diff --git a/.bazeliskrc b/.bazeliskrc index 463b45379f..aa8518ca26 100644 --- a/.bazeliskrc +++ b/.bazeliskrc @@ -1,2 +1,3 @@ # See https://github.com/bazelbuild/bazelisk -USE_BAZEL_VERSION=4.2.2 +# Version required for Java 24 support (https://github.com/bazelbuild/bazel/commit/806a6e82320956b63f1351ebe2b0da8483f36f19). +USE_BAZEL_VERSION=7.7.0 diff --git a/.bazelrc b/.bazelrc index 4a1006ad99..269a7222fc 100644 --- a/.bazelrc +++ b/.bazelrc @@ -2,3 +2,6 @@ startup --batch build --show_timestamps build --protocopt=--experimental_allow_proto3_optional + +build --cxxopt=-std=c++14 +build --host_cxxopt=-std=c++14 diff --git a/.cloudbuild/graalvm/cloudbuild-test-a-downstream-kms.yaml b/.cloudbuild/graalvm/cloudbuild-test-a-downstream-kms.yaml new file mode 100644 index 0000000000..aadc719fc7 --- /dev/null +++ b/.cloudbuild/graalvm/cloudbuild-test-a-downstream-kms.yaml @@ -0,0 +1,48 @@ +# 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. + +timeout: 7200s # 2 hours +substitutions: + _SHARED_DEPENDENCIES_VERSION: '3.30.1-SNAPSHOT' # {x-version-update:google-cloud-shared-dependencies:current} + _JAVA_SHARED_CONFIG_VERSION: '1.17.0' +options: + machineType: 'E2_HIGHCPU_8' + logging: CLOUD_LOGGING_ONLY +steps: + - name: gcr.io/cloud-builders/docker + args: [ + "build", + "-t", "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_a:${_SHARED_DEPENDENCIES_VERSION}", + "--file", "graalvm_a.Dockerfile", + "--build-arg", "JAVA_SHARED_CONFIG_VERSION=$_JAVA_SHARED_CONFIG_VERSION", + "." + ] + dir: .cloudbuild/graalvm + id: graalvm-a-build + waitFor: ["-"] + + - name: gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_a:${_SHARED_DEPENDENCIES_VERSION} + waitFor: [ "graalvm-a-build" ] + entrypoint: java + args: [ '-version' ] + id: java-version + + - name: gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_a:${_SHARED_DEPENDENCIES_VERSION} + entrypoint: bash + args: [ './.kokoro/presubmit/downstream-build.sh' ] + waitFor: [ "graalvm-a-build" ] + id: native-java-kms + env: + - 'MODULES_UNDER_TEST=java-kms' + - 'GOOGLE_CLOUD_PROJECT=java-graalvm-ci-prod' diff --git a/.cloudbuild/graalvm/cloudbuild-test-a-downstream-kmsinventory.yaml b/.cloudbuild/graalvm/cloudbuild-test-a-downstream-kmsinventory.yaml new file mode 100644 index 0000000000..470dd85679 --- /dev/null +++ b/.cloudbuild/graalvm/cloudbuild-test-a-downstream-kmsinventory.yaml @@ -0,0 +1,48 @@ +# 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. + +timeout: 7200s # 2 hours +substitutions: + _SHARED_DEPENDENCIES_VERSION: '3.30.1-SNAPSHOT' # {x-version-update:google-cloud-shared-dependencies:current} + _JAVA_SHARED_CONFIG_VERSION: '1.17.0' +options: + machineType: 'E2_HIGHCPU_8' + logging: CLOUD_LOGGING_ONLY +steps: + - name: gcr.io/cloud-builders/docker + args: [ + "build", + "-t", "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_a:${_SHARED_DEPENDENCIES_VERSION}", + "--file", "graalvm_a.Dockerfile", + "--build-arg", "JAVA_SHARED_CONFIG_VERSION=$_JAVA_SHARED_CONFIG_VERSION", + "." + ] + dir: .cloudbuild/graalvm + id: graalvm-a-build + waitFor: ["-"] + + - name: gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_a:${_SHARED_DEPENDENCIES_VERSION} + waitFor: [ "graalvm-a-build" ] + entrypoint: java + args: [ '-version' ] + id: java-version + + - name: gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_a:${_SHARED_DEPENDENCIES_VERSION} + entrypoint: bash + args: [ './.kokoro/presubmit/downstream-build.sh' ] + waitFor: [ "graalvm-a-build" ] + id: native-java-kmsinventory + env: + - 'MODULES_UNDER_TEST=java-kmsinventory' + - 'GOOGLE_CLOUD_PROJECT=java-graalvm-ci-prod' diff --git a/.cloudbuild/graalvm/cloudbuild-test-a.yaml b/.cloudbuild/graalvm/cloudbuild-test-a.yaml new file mode 100644 index 0000000000..55b608318e --- /dev/null +++ b/.cloudbuild/graalvm/cloudbuild-test-a.yaml @@ -0,0 +1,46 @@ +# Copyright 2023 Google LLC +# +# Licensed under the Apache License, Version 2.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. + +timeout: 7200s # 2 hours +substitutions: + _SHARED_DEPENDENCIES_VERSION: '3.58.1-SNAPSHOT' # {x-version-update:google-cloud-shared-dependencies:current} + _JAVA_SHARED_CONFIG_VERSION: '1.17.0' +options: + machineType: 'E2_HIGHCPU_8' + logging: CLOUD_LOGGING_ONLY +steps: + - name: gcr.io/cloud-builders/docker + args: [ + "build", + "-t", "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_a:${_SHARED_DEPENDENCIES_VERSION}", + "--file", "graalvm_a.Dockerfile", + "--build-arg", "JAVA_SHARED_CONFIG_VERSION=$_JAVA_SHARED_CONFIG_VERSION", + "." + ] + dir: .cloudbuild/graalvm + id: graalvm-a-build + waitFor: ["-"] + + - name: gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_a:${_SHARED_DEPENDENCIES_VERSION} + waitFor: [ "graalvm-a-build" ] + entrypoint: java + args: [ '-version' ] + id: java-version + + - name: gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_a:${_SHARED_DEPENDENCIES_VERSION} + entrypoint: bash + args: [ './.kokoro/presubmit/showcase-native.sh' ] + waitFor: [ "graalvm-a-build" ] + id: native-showcase + diff --git a/.cloudbuild/graalvm/cloudbuild-test-b-downstream-kms.yaml b/.cloudbuild/graalvm/cloudbuild-test-b-downstream-kms.yaml new file mode 100644 index 0000000000..8001e5ca3f --- /dev/null +++ b/.cloudbuild/graalvm/cloudbuild-test-b-downstream-kms.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. + +timeout: 7200s # 2 hours +substitutions: + _SHARED_DEPENDENCIES_VERSION: '3.30.1-SNAPSHOT' # {x-version-update:google-cloud-shared-dependencies:current} + _JAVA_SHARED_CONFIG_VERSION: '1.17.0' +options: + machineType: 'E2_HIGHCPU_8' + logging: CLOUD_LOGGING_ONLY +steps: + - name: gcr.io/cloud-builders/docker + args: [ + "build", + "-t", "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_b:${_SHARED_DEPENDENCIES_VERSION}", + "--file", "graalvm_b.Dockerfile", + "--build-arg", "JAVA_SHARED_CONFIG_VERSION=$_JAVA_SHARED_CONFIG_VERSION", + "." + ] + dir: .cloudbuild/graalvm + id: graalvm-b-build + waitFor: ["-"] + + - name: gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_b:${_SHARED_DEPENDENCIES_VERSION} + waitFor: [ "graalvm-b-build" ] + entrypoint: java + args: [ '-version' ] + id: java-version + + - name: gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_b:${_SHARED_DEPENDENCIES_VERSION} + entrypoint: bash + args: [ './.kokoro/presubmit/downstream-build.sh' ] + waitFor: [ "graalvm-b-build" ] + env: + - 'MODULES_UNDER_TEST=java-kms' + - 'GOOGLE_CLOUD_PROJECT=java-graalvm-ci-prod' diff --git a/.cloudbuild/graalvm/cloudbuild-test-b-downstream-kmsinventory.yaml b/.cloudbuild/graalvm/cloudbuild-test-b-downstream-kmsinventory.yaml new file mode 100644 index 0000000000..45559307e5 --- /dev/null +++ b/.cloudbuild/graalvm/cloudbuild-test-b-downstream-kmsinventory.yaml @@ -0,0 +1,48 @@ +# 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. + +timeout: 7200s # 2 hours +substitutions: + _SHARED_DEPENDENCIES_VERSION: '3.30.1-SNAPSHOT' # {x-version-update:google-cloud-shared-dependencies:current} + _JAVA_SHARED_CONFIG_VERSION: '1.17.0' +options: + machineType: 'E2_HIGHCPU_8' + logging: CLOUD_LOGGING_ONLY +steps: + - name: gcr.io/cloud-builders/docker + args: [ + "build", + "-t", "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_b:${_SHARED_DEPENDENCIES_VERSION}", + "--file", "graalvm_b.Dockerfile", + "--build-arg", "JAVA_SHARED_CONFIG_VERSION=$_JAVA_SHARED_CONFIG_VERSION", + "." + ] + dir: .cloudbuild/graalvm + id: graalvm-b-build + waitFor: ["-"] + + - name: gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_b:${_SHARED_DEPENDENCIES_VERSION} + waitFor: [ "graalvm-b-build" ] + entrypoint: java + args: [ '-version' ] + id: java-version + + - name: gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_b:${_SHARED_DEPENDENCIES_VERSION} + entrypoint: bash + args: [ './.kokoro/presubmit/downstream-build.sh' ] + waitFor: [ "graalvm-b-build" ] + id: native-java-kmsinventory + env: + - 'MODULES_UNDER_TEST=java-kmsinventory' + - 'GOOGLE_CLOUD_PROJECT=java-graalvm-ci-prod' diff --git a/.cloudbuild/graalvm/cloudbuild-test-b.yaml b/.cloudbuild/graalvm/cloudbuild-test-b.yaml new file mode 100644 index 0000000000..73bbfaec3a --- /dev/null +++ b/.cloudbuild/graalvm/cloudbuild-test-b.yaml @@ -0,0 +1,45 @@ +# Copyright 2023 Google LLC +# +# Licensed under the Apache License, Version 2.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. + +timeout: 7200s # 2 hours +substitutions: + _SHARED_DEPENDENCIES_VERSION: '3.58.1-SNAPSHOT' # {x-version-update:google-cloud-shared-dependencies:current} + _JAVA_SHARED_CONFIG_VERSION: '1.17.0' +options: + machineType: 'E2_HIGHCPU_8' + logging: CLOUD_LOGGING_ONLY +steps: + - name: gcr.io/cloud-builders/docker + args: [ + "build", + "-t", "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_b:${_SHARED_DEPENDENCIES_VERSION}", + "--file", "graalvm_b.Dockerfile", + "--build-arg", "JAVA_SHARED_CONFIG_VERSION=$_JAVA_SHARED_CONFIG_VERSION", + "." + ] + dir: .cloudbuild/graalvm + id: graalvm-b-build + waitFor: ["-"] + + - name: gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_b:${_SHARED_DEPENDENCIES_VERSION} + waitFor: [ "graalvm-b-build" ] + entrypoint: java + args: [ '-version' ] + id: java-version + + - name: gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_b:${_SHARED_DEPENDENCIES_VERSION} + entrypoint: bash + args: [ './.kokoro/presubmit/showcase-native.sh' ] + waitFor: [ "graalvm-b-build" ] + id: native-showcase \ No newline at end of file diff --git a/.cloudbuild/graalvm/cloudbuild-test-c-downstream-kms.yaml b/.cloudbuild/graalvm/cloudbuild-test-c-downstream-kms.yaml new file mode 100644 index 0000000000..deed4f544f --- /dev/null +++ b/.cloudbuild/graalvm/cloudbuild-test-c-downstream-kms.yaml @@ -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. + +timeout: 7200s # 2 hours +substitutions: + _SHARED_DEPENDENCIES_VERSION: '3.30.1-SNAPSHOT' # {x-version-update:google-cloud-shared-dependencies:current} + _JAVA_SHARED_CONFIG_VERSION: '1.17.0' +options: + machineType: 'E2_HIGHCPU_8' + logging: CLOUD_LOGGING_ONLY +steps: + - name: gcr.io/cloud-builders/docker + args: [ + "build", + "-t", "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_c:${_SHARED_DEPENDENCIES_VERSION}", + "--file", "graalvm_c.Dockerfile", + "--build-arg", "JAVA_SHARED_CONFIG_VERSION=$_JAVA_SHARED_CONFIG_VERSION", + "." + ] + dir: .cloudbuild/graalvm + id: graalvm-c-build + waitFor: ["-"] + + - name: gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_c:${_SHARED_DEPENDENCIES_VERSION} + waitFor: [ "graalvm-c-build" ] + entrypoint: java + args: [ '-version' ] + id: java-version + + - name: gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_c:${_SHARED_DEPENDENCIES_VERSION} + entrypoint: bash + args: [ './.kokoro/presubmit/downstream-build.sh' ] + waitFor: [ "graalvm-c-build" ] + id: native-java-kms + env: + - 'MODULES_UNDER_TEST=java-kms' + - 'GOOGLE_CLOUD_PROJECT=java-graalvm-ci-prod' diff --git a/.cloudbuild/graalvm/cloudbuild-test-c-downstream-kmsinventory.yaml b/.cloudbuild/graalvm/cloudbuild-test-c-downstream-kmsinventory.yaml new file mode 100644 index 0000000000..a1a33b2662 --- /dev/null +++ b/.cloudbuild/graalvm/cloudbuild-test-c-downstream-kmsinventory.yaml @@ -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. + +timeout: 7200s # 2 hours +substitutions: + _SHARED_DEPENDENCIES_VERSION: '3.30.1-SNAPSHOT' # {x-version-update:google-cloud-shared-dependencies:current} + _JAVA_SHARED_CONFIG_VERSION: '1.17.0' +options: + machineType: 'E2_HIGHCPU_8' + logging: CLOUD_LOGGING_ONLY +steps: + - name: gcr.io/cloud-builders/docker + args: [ + "build", + "-t", "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_c:${_SHARED_DEPENDENCIES_VERSION}", + "--file", "graalvm_c.Dockerfile", + "--build-arg", "JAVA_SHARED_CONFIG_VERSION=$_JAVA_SHARED_CONFIG_VERSION", + "." + ] + dir: .cloudbuild/graalvm + id: graalvm-c-build + waitFor: ["-"] + + - name: gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_c:${_SHARED_DEPENDENCIES_VERSION} + waitFor: [ "graalvm-c-build" ] + entrypoint: java + args: [ '-version' ] + id: java-version + + - name: gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_c:${_SHARED_DEPENDENCIES_VERSION} + entrypoint: bash + args: [ './.kokoro/presubmit/downstream-build.sh' ] + waitFor: [ "graalvm-c-build" ] + id: native-java-kmsinventory + env: + - 'MODULES_UNDER_TEST=java-kmsinventory' + - 'GOOGLE_CLOUD_PROJECT=java-graalvm-ci-prod' diff --git a/.cloudbuild/graalvm/cloudbuild-test-c.yaml b/.cloudbuild/graalvm/cloudbuild-test-c.yaml new file mode 100644 index 0000000000..864d5ca57b --- /dev/null +++ b/.cloudbuild/graalvm/cloudbuild-test-c.yaml @@ -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 +# +# 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. + +timeout: 7200s # 2 hours +substitutions: + _SHARED_DEPENDENCIES_VERSION: '3.58.1-SNAPSHOT' # {x-version-update:google-cloud-shared-dependencies:current} + _JAVA_SHARED_CONFIG_VERSION: '1.17.0' +options: + machineType: 'E2_HIGHCPU_8' + logging: CLOUD_LOGGING_ONLY +steps: + - name: gcr.io/cloud-builders/docker + args: [ + "build", + "-t", "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_c:${_SHARED_DEPENDENCIES_VERSION}", + "--file", "graalvm_c.Dockerfile", + "--build-arg", "JAVA_SHARED_CONFIG_VERSION=$_JAVA_SHARED_CONFIG_VERSION", + "." + ] + dir: .cloudbuild/graalvm + id: graalvm-c-build + waitFor: ["-"] + + - name: gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_c:${_SHARED_DEPENDENCIES_VERSION} + waitFor: [ "graalvm-c-build" ] + entrypoint: java + args: [ '-version' ] + id: java-version + + - name: gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_c:${_SHARED_DEPENDENCIES_VERSION} + entrypoint: bash + args: [ './.kokoro/presubmit/showcase-native.sh' ] + waitFor: [ "graalvm-c-build" ] + id: native-showcase \ No newline at end of file diff --git a/.cloudbuild/graalvm/cloudbuild.yaml b/.cloudbuild/graalvm/cloudbuild.yaml new file mode 100644 index 0000000000..461cf49246 --- /dev/null +++ b/.cloudbuild/graalvm/cloudbuild.yaml @@ -0,0 +1,71 @@ +# Copyright 2023 Google LLC +# +# Licensed under the Apache License, Version 2.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. + +timeout: 7200s # 2 hours +substitutions: + _SHARED_DEPENDENCIES_VERSION: '3.58.1-SNAPSHOT' # {x-version-update:google-cloud-shared-dependencies:current} + _JAVA_SHARED_CONFIG_VERSION: '1.17.0' +steps: + # GraalVM A build + - name: gcr.io/cloud-builders/docker + args: [ + "build", + "-t", "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_a:${_SHARED_DEPENDENCIES_VERSION}", + "-t", "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_a:infrastructure-public-image-$SHORT_SHA", + "--file", "graalvm_a.Dockerfile", + "--build-arg", "JAVA_SHARED_CONFIG_VERSION=$_JAVA_SHARED_CONFIG_VERSION", + "." + ] + dir: .cloudbuild/graalvm + id: graalvm-a-build + waitFor: [ "-" ] + + # GraalVM B build + - name: gcr.io/cloud-builders/docker + args: [ + "build", + "-t", "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_b:${_SHARED_DEPENDENCIES_VERSION}", + "-t", "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_b:infrastructure-public-image-$SHORT_SHA", + "--file", "graalvm_b.Dockerfile", + "--build-arg", "JAVA_SHARED_CONFIG_VERSION=$_JAVA_SHARED_CONFIG_VERSION", + "." + ] + dir: .cloudbuild/graalvm + id: graalvm-b-build + waitFor: [ "-" ] + + # GraalVM C build + - name: gcr.io/cloud-builders/docker + args: [ + "build", + "-t", "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_c:${_SHARED_DEPENDENCIES_VERSION}", + "-t", "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_c:infrastructure-public-image-$SHORT_SHA", + "--file", "graalvm_c.Dockerfile", + "--build-arg", "JAVA_SHARED_CONFIG_VERSION=$_JAVA_SHARED_CONFIG_VERSION", + "." + ] + dir: .cloudbuild/graalvm + id: graalvm-c-build + waitFor: [ "-" ] + +options: + logging: CLOUD_LOGGING_ONLY + +images: + - gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_a:${_SHARED_DEPENDENCIES_VERSION} + - gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_b:${_SHARED_DEPENDENCIES_VERSION} + - gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_c:${_SHARED_DEPENDENCIES_VERSION} + - gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_a:infrastructure-public-image-$SHORT_SHA + - gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_b:infrastructure-public-image-$SHORT_SHA + - gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_c:infrastructure-public-image-$SHORT_SHA \ No newline at end of file diff --git a/.cloudbuild/graalvm/graalvm_a.Dockerfile b/.cloudbuild/graalvm/graalvm_a.Dockerfile new file mode 100644 index 0000000000..ce8a048e43 --- /dev/null +++ b/.cloudbuild/graalvm/graalvm_a.Dockerfile @@ -0,0 +1,19 @@ +# Copyright 2023 Google LLC +# +# Licensed under the Apache License, Version 2.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. + + +ARG JAVA_SHARED_CONFIG_VERSION + +FROM us-docker.pkg.dev/java-graalvm-ci-prod/graalvm-integration-testing/graalvm_a:$JAVA_SHARED_CONFIG_VERSION + diff --git a/.cloudbuild/graalvm/graalvm_b.Dockerfile b/.cloudbuild/graalvm/graalvm_b.Dockerfile new file mode 100644 index 0000000000..51611691b1 --- /dev/null +++ b/.cloudbuild/graalvm/graalvm_b.Dockerfile @@ -0,0 +1,18 @@ +# Copyright 2023 Google LLC +# +# Licensed under the Apache License, Version 2.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. + + +ARG JAVA_SHARED_CONFIG_VERSION + +FROM us-docker.pkg.dev/java-graalvm-ci-prod/graalvm-integration-testing/graalvm_b:$JAVA_SHARED_CONFIG_VERSION \ No newline at end of file diff --git a/.cloudbuild/graalvm/graalvm_c.Dockerfile b/.cloudbuild/graalvm/graalvm_c.Dockerfile new file mode 100644 index 0000000000..23a73a1c04 --- /dev/null +++ b/.cloudbuild/graalvm/graalvm_c.Dockerfile @@ -0,0 +1,18 @@ +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.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. + + +ARG JAVA_SHARED_CONFIG_VERSION + +FROM us-docker.pkg.dev/java-graalvm-ci-prod/graalvm-integration-testing/graalvm_c:$JAVA_SHARED_CONFIG_VERSION \ No newline at end of file diff --git a/.cloudbuild/library_generation/cloudbuild-library-generation-integration-test.yaml b/.cloudbuild/library_generation/cloudbuild-library-generation-integration-test.yaml new file mode 100644 index 0000000000..e39cfbf1a3 --- /dev/null +++ b/.cloudbuild/library_generation/cloudbuild-library-generation-integration-test.yaml @@ -0,0 +1,118 @@ +# 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. + +timeout: 7200s # 2 hours +substitutions: + _TEST_IMAGE: "test-image:latest" +steps: +- name: gcr.io/cloud-builders/docker + args: [ + "build", + "--no-cache", + # Use a fixed protoc version so that the generation result stays the same + "--build-arg", "PROTOC_VERSION=25.8", + "-t", "${_TEST_IMAGE}", + "-f", ".cloudbuild/library_generation/library_generation_airlock.Dockerfile", + "." + ] + id: build-image + waitFor: ["-"] + env: + - "DOCKER_BUILDKIT=1" + +- name: alpine/git:latest + entrypoint: /bin/sh + args: + - "-c" + - | + cd /workspace + git clone https://github.com/googleapis/googleapis + cd googleapis + git checkout 113a378d5aad5018876ec0a8cbfd4d6a4f746809 + id: download-api-definitions + waitFor: ["-"] + +- name: alpine/git:latest + entrypoint: /bin/sh + args: + - "-c" + - | + cd /workspace + git clone https://github.com/googleapis/google-cloud-java + cd google-cloud-java + git checkout chore/test-hermetic-build + mkdir ../golden + cd ../golden + cp -r ../google-cloud-java/java-apigee-connect . + cp -r ../google-cloud-java/java-alloydb . + cp -r ../google-cloud-java/java-alloydb-connectors . + cp -r ../google-cloud-java/java-cloudcontrolspartner . + cp -r ../google-cloud-java/gapic-libraries-bom . + cp -r ../google-cloud-java/pom.xml . + id: prepare-golden + waitFor: ["-"] + +- name: maven:3.9.9-eclipse-temurin-11-alpine + entrypoint: /bin/sh + args: + - "-c" + - | + mvn dependency:copy \ + -B -ntp \ + -Dartifact=com.google.api:gapic-generator-java:2.63.0 \ + -DoutputDirectory=/workspace + cd /workspace + mv gapic-generator-java-2.63.0.jar gapic-generator-java.jar + id: prepare-generator-jar + waitFor: [ "-" ] + +- name: gcr.io/cloud-builders/docker + args: [ + "run", + "--rm", + "-v", "/workspace/google-cloud-java:/workspace", + "-v", "/workspace/hermetic_build/library_generation/tests/resources/integration/google-cloud-java:/workspace/config", + "-v", "/workspace/googleapis:/workspace/apis", + # Fix gapic-generator-java so that the generation result stays + # the same. + "-v", "/workspace/gapic-generator-java.jar:/home/.library_generation/gapic-generator-java.jar", + "${_TEST_IMAGE}", + "--generation-config-path=/workspace/config/generation_config.yaml", + "--api-definitions-path=/workspace/apis" + ] + env: + - "DOCKER_BUILDKIT=1" + id: generate-libraries + waitFor: [ + "build-image", + "download-api-definitions", + "prepare-golden", + "prepare-generator-jar" + ] + +- name: python:3.12.7-alpine3.20 + entrypoint: /bin/sh + args: + - "-c" + - | + python3 -m venv .venv + source .venv/bin/activate + pip install --require-hashes -r requirements.txt + python -m unittest integration_tests.py + dir: ".cloudbuild/library_generation/scripts" + id: verify-generation + waitFor: ["generate-libraries"] +options: + logging: CLOUD_LOGGING_ONLY + machineType: E2_HIGHCPU_8 diff --git a/.cloudbuild/library_generation/cloudbuild-library-generation-push-exitgate.yaml b/.cloudbuild/library_generation/cloudbuild-library-generation-push-exitgate.yaml new file mode 100644 index 0000000000..02e501cfb3 --- /dev/null +++ b/.cloudbuild/library_generation/cloudbuild-library-generation-push-exitgate.yaml @@ -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 +# +# 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. + +timeout: 7200s # 2 hours +substitutions: + _GAPIC_GENERATOR_JAVA_VERSION: '2.57.1-SNAPSHOT' # {x-version-update:gapic-generator-java:current} + _IMAGE_NAME: "us-central1-docker.pkg.dev/cloud-sdk-production-pipeline/images-dev/java-library-generation" + _SHA_IMAGE_ID: "${_IMAGE_NAME}:${COMMIT_SHA}" + _VERSIONED_IMAGE_ID: "${_IMAGE_NAME}:${_GAPIC_GENERATOR_JAVA_VERSION}" +steps: + # Library generation build + - name: gcr.io/cloud-builders/docker + args: [ + "build", + "-t", "${_SHA_IMAGE_ID}", + "-t", "${_VERSIONED_IMAGE_ID}", + "-f", ".cloudbuild/library_generation/library_generation_airlock.Dockerfile", + "." + ] + id: library-generation-build + waitFor: ["-"] + env: + - 'DOCKER_BUILDKIT=1' + +options: + machineType: 'E2_HIGHCPU_8' + requestedVerifyOption: VERIFIED # For provenance attestation generation + +images: + - ${_SHA_IMAGE_ID} + - ${_VERSIONED_IMAGE_ID} diff --git a/.cloudbuild/library_generation/cloudbuild-library-generation-push.yaml b/.cloudbuild/library_generation/cloudbuild-library-generation-push.yaml new file mode 100644 index 0000000000..9c7476a33c --- /dev/null +++ b/.cloudbuild/library_generation/cloudbuild-library-generation-push.yaml @@ -0,0 +1,54 @@ +# 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. + +timeout: 7200s # 2 hours +substitutions: + _GAPIC_GENERATOR_JAVA_VERSION: '2.68.1-SNAPSHOT' # {x-version-update:gapic-generator-java:current} + _PRIVATE_IMAGE_NAME: "us-docker.pkg.dev/java-hermetic-build-prod/private-resources/java-library-generation" + _PRIVATE_SHA_IMAGE_ID: "${_PRIVATE_IMAGE_NAME}:${COMMIT_SHA}" + _PRIVATE_LATEST_IMAGE_ID: "${_PRIVATE_IMAGE_NAME}:latest" + _PRIVATE_VERSIONED_IMAGE_ID: "${_PRIVATE_IMAGE_NAME}:${_GAPIC_GENERATOR_JAVA_VERSION}" + _PUBLIC_IMAGE_NAME: "gcr.io/cloud-devrel-public-resources/java-library-generation" + _PUBLIC_SHA_IMAGE_ID: "${_PUBLIC_IMAGE_NAME}:infrastructure-public-image-${COMMIT_SHA}" + _PUBLIC_LATEST_IMAGE_ID: "${_PUBLIC_IMAGE_NAME}:latest" + _PUBLIC_VERSIONED_IMAGE_ID: "${_PUBLIC_IMAGE_NAME}:${_GAPIC_GENERATOR_JAVA_VERSION}" +steps: + # Library generation build + - name: gcr.io/cloud-builders/docker + args: [ + "build", + "-t", "${_PRIVATE_SHA_IMAGE_ID}", + "-t", "${_PRIVATE_LATEST_IMAGE_ID}", + "-t", "${_PRIVATE_VERSIONED_IMAGE_ID}", + "-t", "${_PUBLIC_SHA_IMAGE_ID}", + "-t", "${_PUBLIC_LATEST_IMAGE_ID}", + "-t", "${_PUBLIC_VERSIONED_IMAGE_ID}", + "-f", ".cloudbuild/library_generation/library_generation_airlock.Dockerfile", + "." + ] + id: library-generation-build + waitFor: ["-"] + env: + - 'DOCKER_BUILDKIT=1' + +options: + logging: CLOUD_LOGGING_ONLY + +images: + - ${_PRIVATE_SHA_IMAGE_ID} + - ${_PRIVATE_LATEST_IMAGE_ID} + - ${_PRIVATE_VERSIONED_IMAGE_ID} + - ${_PUBLIC_SHA_IMAGE_ID} + - ${_PUBLIC_LATEST_IMAGE_ID} + - ${_PUBLIC_VERSIONED_IMAGE_ID} diff --git a/.cloudbuild/library_generation/library_generation.Dockerfile b/.cloudbuild/library_generation/library_generation.Dockerfile new file mode 100644 index 0000000000..f265c74393 --- /dev/null +++ b/.cloudbuild/library_generation/library_generation.Dockerfile @@ -0,0 +1,112 @@ +# 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 +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# install gapic-generator-java in a separate layer so we don't overload the image +# with the transferred source code and jars + + +FROM docker.io/library/maven:3.9.9-eclipse-temurin-17-alpine@sha256:969014ee8852c9910ff5ef09de17541c2587819364b79d7dc044634dfb8a3388 AS ggj-build + +WORKDIR /sdk-platform-java +COPY . . +# {x-version-update-start:gapic-generator-java:current} +ENV DOCKER_GAPIC_GENERATOR_VERSION="2.68.1-SNAPSHOT" +# {x-version-update-end} + +# Download the java formatter +RUN mvn -pl gapic-generator-java-pom-parent help:evaluate -Dexpression='google-java-format.version' -q -DforceStdout > /java-formatter-version +RUN cat /java-formatter-version +RUN V=$(cat /java-formatter-version) && curl -o "/google-java-format.jar" "https://maven-central.storage-download.googleapis.com/maven2/com/google/googlejavaformat/google-java-format/${V}/google-java-format-${V}-all-deps.jar" + +# Compile and install packages +RUN mvn install -B -ntp -T 1.5C -DskipTests -Dcheckstyle.skip -Dclirr.skip -Denforcer.skip -Dfmt.skip +RUN cp "/root/.m2/repository/com/google/api/gapic-generator-java/${DOCKER_GAPIC_GENERATOR_VERSION}/gapic-generator-java-${DOCKER_GAPIC_GENERATOR_VERSION}.jar" \ + "./gapic-generator-java.jar" + +FROM docker.io/library/python:3.13.2-slim@sha256:6b3223eb4d93718828223966ad316909c39813dee3ee9395204940500792b740 as final + +ARG OWLBOT_CLI_COMMITTISH=3a68a9c0de318784b3aefadcc502a6521b3f1bc5 +ARG PROTOC_VERSION=33.2 +ARG GRPC_VERSION=1.76.3 +ENV HOME=/home +ENV OS_ARCHITECTURE="linux-x86_64" + +# install OS tools +RUN apt update && apt install -y curl unzip rsync jq nodejs npm git openjdk-17-jdk + +SHELL [ "/bin/bash", "-c" ] + +# copy source code +COPY hermetic_build/common /src/common +COPY hermetic_build/library_generation /src/library_generation + +# install protoc +WORKDIR /protoc +RUN source /src/library_generation/utils/utilities.sh \ + && download_protoc "${PROTOC_VERSION}" "${OS_ARCHITECTURE}" +# we indicate protoc is available in the container via env vars +ENV DOCKER_PROTOC_LOCATION=/protoc/bin +ENV DOCKER_PROTOC_VERSION="${PROTOC_VERSION}" + +# install grpc +WORKDIR /grpc +RUN source /src/library_generation/utils/utilities.sh \ + && download_grpc_plugin "${GRPC_VERSION}" "${OS_ARCHITECTURE}" +# similar to protoc, we indicate grpc is available in the container via env vars +ENV DOCKER_GRPC_LOCATION="/grpc/protoc-gen-grpc-java.exe" + +RUN python -m pip install --upgrade pip + +# install main scripts as a python package +WORKDIR / +RUN python -m pip install --require-hashes -r src/common/requirements.txt +RUN python -m pip install src/common +RUN python -m pip install --require-hashes -r src/library_generation/requirements.txt +RUN python -m pip install src/library_generation + +# install the owl-bot CLI +WORKDIR /tools +RUN git clone https://github.com/googleapis/repo-automation-bots +WORKDIR /tools/repo-automation-bots/packages/owl-bot +RUN git checkout "${OWLBOT_CLI_COMMITTISH}" +RUN npm i && npm run compile && npm link +RUN owl-bot copy-code --version +RUN chmod o+rx $(which owl-bot) + +# copy the Java formatter +COPY --from=ggj-build "/google-java-format.jar" "${HOME}"/.library_generation/google-java-format.jar +RUN chmod 755 "${HOME}"/.library_generation/google-java-format.jar +ENV JAVA_FORMATTER_LOCATION="${HOME}/.library_generation/google-java-format.jar" + +# Here we transfer gapic-generator-java from the previous stage. +# Note that the destination is a well-known location that will be assumed at runtime +# We hard-code the location string to avoid making it configurable (via ARG) as +# well as to avoid it making it overridable at runtime (via ENV). +COPY --from=ggj-build "/sdk-platform-java/gapic-generator-java.jar" "${HOME}/.library_generation/gapic-generator-java.jar" +RUN chmod 755 "${HOME}/.library_generation/gapic-generator-java.jar" +ENV GAPIC_GENERATOR_LOCATION="${HOME}/.library_generation/gapic-generator-java.jar" + +# allow users to access the script folders +RUN chmod -R o+rx /src + +# set dummy git credentials for the empty commit used in postprocessing +# we use system so all users using the container will use this configuration +RUN git config --system user.email "cloud-java-bot@google.com" +RUN git config --system user.name "Cloud Java Bot" + +# allow read-write for /home and execution for binaries in /home/.nvm +RUN chmod -R a+rw /home + +WORKDIR /workspace +ENTRYPOINT [ "python", "/src/library_generation/cli/entry_point.py", "generate" ] diff --git a/.cloudbuild/library_generation/library_generation_airlock.Dockerfile b/.cloudbuild/library_generation/library_generation_airlock.Dockerfile new file mode 100644 index 0000000000..1d6ddbbb0e --- /dev/null +++ b/.cloudbuild/library_generation/library_generation_airlock.Dockerfile @@ -0,0 +1,113 @@ +# 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 +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# install gapic-generator-java in a separate layer so we don't overload the image +# with the transferred source code and jars + +# 3.9.9-eclipse-temurin-11-alpine +FROM us-docker.pkg.dev/artifact-foundry-prod/docker-3p-trusted/maven@sha256:d3f04985c6a68415e36c0a6468d0f8316f27d4dbee77bc459257ba444224bd9f AS ggj-build + +WORKDIR /sdk-platform-java +COPY . . +# {x-version-update-start:gapic-generator-java:current} +ENV DOCKER_GAPIC_GENERATOR_VERSION="2.68.1-SNAPSHOT" +# {x-version-update-end} + +# Download the java formatter +RUN mvn -pl gapic-generator-java-pom-parent help:evaluate -Dexpression='google-java-format.version' -q -DforceStdout > /java-formatter-version +RUN cat /java-formatter-version +RUN V=$(cat /java-formatter-version) && curl -o "/google-java-format.jar" "https://maven-central.storage-download.googleapis.com/maven2/com/google/googlejavaformat/google-java-format/${V}/google-java-format-${V}-all-deps.jar" + +# Skipping the fmt check until 3.9.9-eclipse-temurin-17-alpine:969014ee8852 is available in Airlock. +RUN mvn install -B -ntp -DskipTests -Dclirr.skip -Dcheckstyle.skip -Dfmt.skip +RUN cp "/root/.m2/repository/com/google/api/gapic-generator-java/${DOCKER_GAPIC_GENERATOR_VERSION}/gapic-generator-java-${DOCKER_GAPIC_GENERATOR_VERSION}.jar" \ + "./gapic-generator-java.jar" + +# 3.12.3-slim-bookworm +FROM us-docker.pkg.dev/artifact-foundry-prod/docker-3p-trusted/python@sha256:afc139a0a640942491ec481ad8dda10f2c5b753f5c969393b12480155fe15a63 as final + +ARG OWLBOT_CLI_COMMITTISH=3a68a9c0de318784b3aefadcc502a6521b3f1bc5 +ARG PROTOC_VERSION=33.2 +ARG GRPC_VERSION=1.76.3 +ENV HOME=/home +ENV OS_ARCHITECTURE="linux-x86_64" + +# install OS tools +RUN apt update && apt install -y curl unzip rsync jq nodejs npm git openjdk-17-jdk + +SHELL [ "/bin/bash", "-c" ] + +# copy source code +COPY hermetic_build/common /src/common +COPY hermetic_build/library_generation /src/library_generation + +# install protoc +WORKDIR /protoc +RUN source /src/library_generation/utils/utilities.sh \ + && download_protoc "${PROTOC_VERSION}" "${OS_ARCHITECTURE}" +# we indicate protoc is available in the container via env vars +ENV DOCKER_PROTOC_LOCATION=/protoc/bin +ENV DOCKER_PROTOC_VERSION="${PROTOC_VERSION}" + +# install grpc +WORKDIR /grpc +RUN source /src/library_generation/utils/utilities.sh \ + && download_grpc_plugin "${GRPC_VERSION}" "${OS_ARCHITECTURE}" +# similar to protoc, we indicate grpc is available in the container via env vars +ENV DOCKER_GRPC_LOCATION="/grpc/protoc-gen-grpc-java.exe" + +RUN python -m pip install --upgrade pip + +# install main scripts as a python package +WORKDIR / +RUN python -m pip install --require-hashes -r src/common/requirements.txt +RUN python -m pip install src/common +RUN python -m pip install --require-hashes -r src/library_generation/requirements.txt +RUN python -m pip install src/library_generation + +# install the owl-bot CLI +WORKDIR /tools +RUN git clone https://github.com/googleapis/repo-automation-bots +WORKDIR /tools/repo-automation-bots/packages/owl-bot +RUN git checkout "${OWLBOT_CLI_COMMITTISH}" +RUN npm i && npm run compile && npm link +RUN owl-bot copy-code --version +RUN chmod o+rx $(which owl-bot) + +# copy the Java formatter +COPY --from=ggj-build "/google-java-format.jar" "${HOME}"/.library_generation/google-java-format.jar +RUN chmod 755 "${HOME}"/.library_generation/google-java-format.jar +ENV JAVA_FORMATTER_LOCATION="${HOME}/.library_generation/google-java-format.jar" + +# Here we transfer gapic-generator-java from the previous stage. +# Note that the destination is a well-known location that will be assumed at runtime +# We hard-code the location string to avoid making it configurable (via ARG) as +# well as to avoid it making it overridable at runtime (via ENV). +COPY --from=ggj-build "/sdk-platform-java/gapic-generator-java.jar" "${HOME}/.library_generation/gapic-generator-java.jar" +RUN chmod 755 "${HOME}/.library_generation/gapic-generator-java.jar" +ENV GAPIC_GENERATOR_LOCATION="${HOME}/.library_generation/gapic-generator-java.jar" + +# allow users to access the script folders +RUN chmod -R o+rx /src + +# set dummy git credentials for the empty commit used in postprocessing +# we use system so all users using the container will use this configuration +RUN git config --system user.email "cloud-java-bot@google.com" +RUN git config --system user.name "Cloud Java Bot" + +# allow read-write for /home and execution for binaries in /home/.nvm +RUN chmod -R a+rw /home + +WORKDIR /workspace +ENTRYPOINT [ "python", "/src/library_generation/cli/entry_point.py", "generate" ] diff --git a/api-common-java/.github/snippet-bot.yml b/.cloudbuild/library_generation/scripts/__init__.py similarity index 100% rename from api-common-java/.github/snippet-bot.yml rename to .cloudbuild/library_generation/scripts/__init__.py diff --git a/.cloudbuild/library_generation/scripts/integration_tests.py b/.cloudbuild/library_generation/scripts/integration_tests.py new file mode 100644 index 0000000000..f040fe84e5 --- /dev/null +++ b/.cloudbuild/library_generation/scripts/integration_tests.py @@ -0,0 +1,247 @@ +# 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 +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT 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 difflib +import json +import os +import sys +import unittest +import xml.etree.ElementTree as tree +from collections import Counter +from filecmp import dircmp + +script_dir = os.path.dirname(os.path.realpath(__file__)) + + +class IntegrationTest(unittest.TestCase): + + def test_monorepo_generation(self): + repo_dest = "/workspace/google-cloud-java" + golden_dir = "/workspace/golden" + library_names = [ + "java-apigee-connect", + "java-alloydb", + "java-alloydb-connectors", + "java-cloudcontrolspartner", + ] + for library_name in library_names: + actual_library = f"{repo_dest}/{library_name}" + print("*" * 50) + print(f"Checking for differences in '{library_name}'.") + print(f" The expected library is in {golden_dir}/{library_name}.") + print(f" The actual library is in {actual_library}.") + compare_result = dircmp( + f"{golden_dir}/{library_name}", + actual_library, + # README.md is ignored because the golden files in the + # google-cloud-java repository still contain the old build badges. + # TODO: Remove README.md from ignore list once golden files are updated. + ignore=[".repo-metadata.json", "README.md"], + ) + diff_files = [] + golden_only = [] + generated_only = [] + # compare source code + self.__recursive_diff_files( + compare_result, diff_files, golden_only, generated_only + ) + + # print all found differences for inspection + def print_file(f: str) -> None: + return print(f" - {f}") + + if len(diff_files) > 0: + print(" Some files (found in both folders) are differing:") + for diff_file in diff_files: + print(f"Difference in {diff_file}:") + with open( + f"{golden_dir}/{library_name}/{diff_file}" + ) as expected_file: + with open(f"{actual_library}/{diff_file}") as actual_file: + [ + print(line) + for line in difflib.unified_diff( + expected_file.readlines(), + actual_file.readlines(), + ) + ] + if len(golden_only) > 0: + print(" There were files found only in the golden dir:") + [print_file(f) for f in golden_only] + if len(generated_only) > 0: + print(" There were files found only in the generated dir:") + [print_file(f) for f in generated_only] + + self.assertTrue(len(golden_only) == 0) + self.assertTrue(len(generated_only) == 0) + self.assertTrue(len(diff_files) == 0) + + print(f" No differences found in {library_name}") + # compare .repo-metadata.json + self.assertTrue( + self.__compare_json_files( + f"{golden_dir}/{library_name}/.repo-metadata.json", + f"{actual_library}/.repo-metadata.json", + ), + msg=f" The generated {library_name}/.repo-metadata.json is different from golden.", + ) + print(" .repo-metadata.json comparison succeed.") + # compare gapic-libraries-bom/pom.xml and pom.xml + self.assertFalse( + self.compare_xml( + f"{golden_dir}/gapic-libraries-bom/pom.xml", + f"{repo_dest}/gapic-libraries-bom/pom.xml", + False, + ) + ) + print(" gapic-libraries-bom/pom.xml comparison succeed.") + self.assertFalse( + self.compare_xml( + f"{golden_dir}/pom.xml", + f"{repo_dest}/pom.xml", + False, + ) + ) + print(" pom.xml comparison succeed.") + + @classmethod + def __compare_json_files(cls, expected: str, actual: str) -> bool: + return cls.__load_json_to_sorted_list( + expected + ) == cls.__load_json_to_sorted_list(actual) + + @classmethod + def __load_json_to_sorted_list(cls, path: str) -> list[tuple]: + with open(path) as f: + data = json.load(f) + res = [(key, value) for key, value in data.items()] + + return sorted(res, key=lambda x: x[0]) + + @classmethod + def __recursive_diff_files( + cls, + dcmp: dircmp, + diff_files: list[str], + left_only: list[str], + right_only: list[str], + dirname: str = "", + ): + """ + Recursively compares two subdirectories. The found differences are + passed to three expected list references. + """ + + def append_dirname(d: str) -> str: + return dirname + d + + diff_files.extend(map(append_dirname, dcmp.diff_files)) + left_only.extend(map(append_dirname, dcmp.left_only)) + right_only.extend(map(append_dirname, dcmp.right_only)) + for sub_dirname, sub_dcmp in dcmp.subdirs.items(): + cls.__recursive_diff_files( + sub_dcmp, diff_files, left_only, right_only, dirname + sub_dirname + "/" + ) + + @classmethod + def compare_xml(cls, expected, actual, print_trees): + """ + compares two XMLs for content differences + the argument print_whole_trees determines if both trees should be printed + """ + try: + expected_tree = tree.parse(expected) + actual_tree = tree.parse(actual) + except tree.ParseError as e: + cls.eprint(f"Error parsing XML") + raise e + except FileNotFoundError as e: + cls.eprint(f"Error reading file") + raise e + + expected_elements = [] + actual_elements = [] + + cls.append_to_element_list(expected_tree.getroot(), "/", expected_elements) + cls.append_to_element_list(actual_tree.getroot(), "/", actual_elements) + + expected_counter = Counter(expected_elements) + actual_counter = Counter(actual_elements) + intersection = expected_counter & actual_counter + only_in_expected = expected_counter - intersection + only_in_actual = actual_counter - intersection + if print_trees: + cls.eprint("expected") + cls.print_counter(actual_counter) + cls.eprint("actual") + cls.print_counter(expected_counter) + if len(only_in_expected) > 0 or len(only_in_actual) > 0: + cls.eprint("only in " + expected) + cls.print_counter(only_in_expected) + cls.eprint("only in " + actual) + cls.print_counter(only_in_actual) + return True + return False + + @classmethod + def append_to_element_list(cls, node, path, elements): + """ + Recursively traverses a node tree and appends element text to a given + `elements` array. If the element tag is `dependency` + then the maven coordinates for its children will be computed as well + """ + namespace_start, namespace_end, tag_name = node.tag.rpartition("}") + namespace = namespace_start + namespace_end + if tag_name == "dependency": + group_id = cls.get_text_from_element(node, "groupId", namespace) + artifact_id = cls.get_text_from_element(node, "artifactId", namespace) + artifact_str = "" + artifact_str += group_id + artifact_str += ":" + artifact_id + elements.append(path + "/" + tag_name + "=" + artifact_str) + if node.text and len(node.text.strip()) > 0: + elements.append(path + "/" + tag_name + "=" + node.text) + + if tag_name == "version": + # versions may be yet to be processed, we disregard them + return elements + + for child in node: + child_path = path + "/" + tag_name + cls.append_to_element_list(child, child_path, elements) + + return elements + + @classmethod + def get_text_from_element(cls, node, element_name, namespace): + """ + Convenience method to access a node's child elements via path and get + its text. + """ + child = node.find(namespace + element_name) + return child.text if child is not None else "" + + @classmethod + def eprint(cls, *args, **kwargs): + """ + prints to stderr + """ + print(*args, file=sys.stderr, **kwargs) + + @classmethod + def print_counter(cls, counter): + """ + Convenience method to pretty print the contents of a Counter (or dict) + """ + for key, value in counter.items(): + cls.eprint(f"{key}: {value}") diff --git a/.cloudbuild/library_generation/scripts/requirements.in b/.cloudbuild/library_generation/scripts/requirements.in new file mode 100644 index 0000000000..59f0563fba --- /dev/null +++ b/.cloudbuild/library_generation/scripts/requirements.in @@ -0,0 +1 @@ +lxml==5.3.0 \ No newline at end of file diff --git a/.cloudbuild/library_generation/scripts/requirements.txt b/.cloudbuild/library_generation/scripts/requirements.txt new file mode 100644 index 0000000000..2ed15cf943 --- /dev/null +++ b/.cloudbuild/library_generation/scripts/requirements.txt @@ -0,0 +1,146 @@ +# +# This file is autogenerated by pip-compile with Python 3.12 +# by the following command: +# +# pip-compile --generate-hashes .cloudbuild/library_generation/scripts/requirements.in +# +lxml==5.3.1 \ + --hash=sha256:016b96c58e9a4528219bb563acf1aaaa8bc5452e7651004894a973f03b84ba81 \ + --hash=sha256:05123fad495a429f123307ac6d8fd6f977b71e9a0b6d9aeeb8f80c017cb17131 \ + --hash=sha256:057e30d0012439bc54ca427a83d458752ccda725c1c161cc283db07bcad43cf9 \ + --hash=sha256:06a20d607a86fccab2fc15a77aa445f2bdef7b49ec0520a842c5c5afd8381576 \ + --hash=sha256:094b28ed8a8a072b9e9e2113a81fda668d2053f2ca9f2d202c2c8c7c2d6516b1 \ + --hash=sha256:0bcfadea3cdc68e678d2b20cb16a16716887dd00a881e16f7d806c2138b8ff0c \ + --hash=sha256:0d6b2fa86becfa81f0a0271ccb9eb127ad45fb597733a77b92e8a35e53414914 \ + --hash=sha256:0f2cfae0688fd01f7056a17367e3b84f37c545fb447d7282cf2c242b16262607 \ + --hash=sha256:106b7b5d2977b339f1e97efe2778e2ab20e99994cbb0ec5e55771ed0795920c8 \ + --hash=sha256:133f3493253a00db2c870d3740bc458ebb7d937bd0a6a4f9328373e0db305709 \ + --hash=sha256:136bf638d92848a939fd8f0e06fcf92d9f2e4b57969d94faae27c55f3d85c05b \ + --hash=sha256:155e1a5693cf4b55af652f5c0f78ef36596c7f680ff3ec6eb4d7d85367259b2c \ + --hash=sha256:1637fa31ec682cd5760092adfabe86d9b718a75d43e65e211d5931809bc111e7 \ + --hash=sha256:172d65f7c72a35a6879217bcdb4bb11bc88d55fb4879e7569f55616062d387c2 \ + --hash=sha256:17b5d7f8acf809465086d498d62a981fa6a56d2718135bb0e4aa48c502055f5c \ + --hash=sha256:198bb4b4dd888e8390afa4f170d4fa28467a7eaf857f1952589f16cfbb67af27 \ + --hash=sha256:1b6f92e35e2658a5ed51c6634ceb5ddae32053182851d8cad2a5bc102a359b33 \ + --hash=sha256:1b92fe86e04f680b848fff594a908edfa72b31bfc3499ef7433790c11d4c8cd8 \ + --hash=sha256:1bcc211542f7af6f2dfb705f5f8b74e865592778e6cafdfd19c792c244ccce19 \ + --hash=sha256:1c93ed3c998ea8472be98fb55aed65b5198740bfceaec07b2eba551e55b7b9ae \ + --hash=sha256:203b1d3eaebd34277be06a3eb880050f18a4e4d60861efba4fb946e31071a295 \ + --hash=sha256:22ec2b3c191f43ed21f9545e9df94c37c6b49a5af0a874008ddc9132d49a2d9c \ + --hash=sha256:231cf4d140b22a923b1d0a0a4e0b4f972e5893efcdec188934cc65888fd0227b \ + --hash=sha256:236610b77589faf462337b3305a1be91756c8abc5a45ff7ca8f245a71c5dab70 \ + --hash=sha256:29bfc8d3d88e56ea0a27e7c4897b642706840247f59f4377d81be8f32aa0cfbf \ + --hash=sha256:2b8969dbc8d09d9cd2ae06362c3bad27d03f433252601ef658a49bd9f2b22d79 \ + --hash=sha256:2dd0b80ac2d8f13ffc906123a6f20b459cb50a99222d0da492360512f3e50f84 \ + --hash=sha256:2df7ed5edeb6bd5590914cd61df76eb6cce9d590ed04ec7c183cf5509f73530d \ + --hash=sha256:2e4a570f6a99e96c457f7bec5ad459c9c420ee80b99eb04cbfcfe3fc18ec6423 \ + --hash=sha256:2f1be45d4c15f237209bbf123a0e05b5d630c8717c42f59f31ea9eae2ad89394 \ + --hash=sha256:2f23cf50eccb3255b6e913188291af0150d89dab44137a69e14e4dcb7be981f1 \ + --hash=sha256:3031e4c16b59424e8d78522c69b062d301d951dc55ad8685736c3335a97fc270 \ + --hash=sha256:33e06717c00c788ab4e79bc4726ecc50c54b9bfb55355eae21473c145d83c2d2 \ + --hash=sha256:364de8f57d6eda0c16dcfb999af902da31396949efa0e583e12675d09709881b \ + --hash=sha256:3715cdf0dd31b836433af9ee9197af10e3df41d273c19bb249230043667a5dfd \ + --hash=sha256:3bb8149840daf2c3f97cebf00e4ed4a65a0baff888bf2605a8d0135ff5cf764e \ + --hash=sha256:3c3c8b55c7fc7b7e8877b9366568cc73d68b82da7fe33d8b98527b73857a225f \ + --hash=sha256:3d68eeef7b4d08a25e51897dac29bcb62aba830e9ac6c4e3297ee7c6a0cf6439 \ + --hash=sha256:3dddf0fb832486cc1ea71d189cb92eb887826e8deebe128884e15020bb6e3f61 \ + --hash=sha256:3edbb9c9130bac05d8c3fe150c51c337a471cc7fdb6d2a0a7d3a88e88a829314 \ + --hash=sha256:3effe081b3135237da6e4c4530ff2a868d3f80be0bda027e118a5971285d42d0 \ + --hash=sha256:422c179022ecdedbe58b0e242607198580804253da220e9454ffe848daa1cfd2 \ + --hash=sha256:42978a68d3825eaac55399eb37a4d52012a205c0c6262199b8b44fcc6fd686e8 \ + --hash=sha256:4399b4226c4785575fb20998dc571bc48125dc92c367ce2602d0d70e0c455eb0 \ + --hash=sha256:45fbb70ccbc8683f2fb58bea89498a7274af1d9ec7995e9f4af5604e028233fc \ + --hash=sha256:4867361c049761a56bd21de507cab2c2a608c55102311d142ade7dab67b34f32 \ + --hash=sha256:48fd46bf7155def2e15287c6f2b133a2f78e2d22cdf55647269977b873c65499 \ + --hash=sha256:4b0d5cdba1b655d5b18042ac9c9ff50bda33568eb80feaaca4fc237b9c4fbfde \ + --hash=sha256:4df0ec814b50275ad6a99bc82a38b59f90e10e47714ac9871e1b223895825468 \ + --hash=sha256:4e52e1b148867b01c05e21837586ee307a01e793b94072d7c7b91d2c2da02ffe \ + --hash=sha256:514fe78fc4b87e7a7601c92492210b20a1b0c6ab20e71e81307d9c2e377c64de \ + --hash=sha256:524ccfded8989a6595dbdda80d779fb977dbc9a7bc458864fc9a0c2fc15dc877 \ + --hash=sha256:528f3a0498a8edc69af0559bdcf8a9f5a8bf7c00051a6ef3141fdcf27017bbf5 \ + --hash=sha256:52d82b0d436edd6a1d22d94a344b9a58abd6c68c357ed44f22d4ba8179b37629 \ + --hash=sha256:5412500e0dc5481b1ee9cf6b38bb3b473f6e411eb62b83dc9b62699c3b7b79f7 \ + --hash=sha256:585c4dc429deebc4307187d2b71ebe914843185ae16a4d582ee030e6cfbb4d8a \ + --hash=sha256:5865b270b420eda7b68928d70bb517ccbe045e53b1a428129bb44372bf3d7dd5 \ + --hash=sha256:5881aaa4bf3a2d086c5f20371d3a5856199a0d8ac72dd8d0dbd7a2ecfc26ab73 \ + --hash=sha256:5885bc586f1edb48e5d68e7a4b4757b5feb2a496b64f462b4d65950f5af3364f \ + --hash=sha256:5a11b16a33656ffc43c92a5343a28dc71eefe460bcc2a4923a96f292692709f6 \ + --hash=sha256:5a997b784a639e05b9d4053ef3b20c7e447ea80814a762f25b8ed5a89d261eac \ + --hash=sha256:5be8f5e4044146a69c96077c7e08f0709c13a314aa5315981185c1f00235fe65 \ + --hash=sha256:63d57fc94eb0bbb4735e45517afc21ef262991d8758a8f2f05dd6e4174944519 \ + --hash=sha256:673b9d8e780f455091200bba8534d5f4f465944cbdd61f31dc832d70e29064a5 \ + --hash=sha256:67d2f8ad9dcc3a9e826bdc7802ed541a44e124c29b7d95a679eeb58c1c14ade8 \ + --hash=sha256:67f5e80adf0aafc7b5454f2c1cb0cde920c9b1f2cbd0485f07cc1d0497c35c5d \ + --hash=sha256:68018c4c67d7e89951a91fbd371e2e34cd8cfc71f0bb43b5332db38497025d51 \ + --hash=sha256:6c4dd3bfd0c82400060896717dd261137398edb7e524527438c54a8c34f736bf \ + --hash=sha256:71f31eda4e370f46af42fc9f264fafa1b09f46ba07bdbee98f25689a04b81c20 \ + --hash=sha256:7512b4d0fc5339d5abbb14d1843f70499cab90d0b864f790e73f780f041615d7 \ + --hash=sha256:75fa3d6946d317ffc7016a6fcc44f42db6d514b7fdb8b4b28cbe058303cb6e53 \ + --hash=sha256:779e851fd0e19795ccc8a9bb4d705d6baa0ef475329fe44a13cf1e962f18ff1e \ + --hash=sha256:796520afa499732191e39fc95b56a3b07f95256f2d22b1c26e217fb69a9db5b5 \ + --hash=sha256:7aae7a3d63b935babfdc6864b31196afd5145878ddd22f5200729006366bc4d5 \ + --hash=sha256:7b82e67c5feb682dbb559c3e6b78355f234943053af61606af126df2183b9ef9 \ + --hash=sha256:7c0536bd9178f754b277a3e53f90f9c9454a3bd108b1531ffff720e082d824f2 \ + --hash=sha256:7eda194dd46e40ec745bf76795a7cccb02a6a41f445ad49d3cf66518b0bd9cff \ + --hash=sha256:82a4bb10b0beef1434fb23a09f001ab5ca87895596b4581fd53f1e5145a8934a \ + --hash=sha256:85c4f11be9cf08917ac2a5a8b6e1ef63b2f8e3799cec194417e76826e5f1de9c \ + --hash=sha256:88b72eb7222d918c967202024812c2bfb4048deeb69ca328363fb8e15254c549 \ + --hash=sha256:89934f9f791566e54c1d92cdc8f8fd0009447a5ecdb1ec6b810d5f8c4955f6be \ + --hash=sha256:8b1942b3e4ed9ed551ed3083a2e6e0772de1e5e3aca872d955e2e86385fb7ff9 \ + --hash=sha256:8ffb141361108e864ab5f1813f66e4e1164181227f9b1f105b042729b6c15125 \ + --hash=sha256:8fffc08de02071c37865a155e5ea5fce0282e1546fd5bde7f6149fcaa32558ac \ + --hash=sha256:91fb6a43d72b4f8863d21f347a9163eecbf36e76e2f51068d59cd004c506f332 \ + --hash=sha256:928e75a7200a4c09e6efc7482a1337919cc61fe1ba289f297827a5b76d8969c2 \ + --hash=sha256:96eef5b9f336f623ffc555ab47a775495e7e8846dde88de5f941e2906453a1ce \ + --hash=sha256:a0611da6b07dd3720f492db1b463a4d1175b096b49438761cc9f35f0d9eaaef5 \ + --hash=sha256:a091026c3bf7519ab1e64655a3f52a59ad4a4e019a6f830c24d6430695b1cf6a \ + --hash=sha256:a22f66270bd6d0804b02cd49dae2b33d4341015545d17f8426f2c4e22f557a23 \ + --hash=sha256:a243132767150a44e6a93cd1dde41010036e1cbc63cc3e9fe1712b277d926ce3 \ + --hash=sha256:a31fa7536ec1fb7155a0cd3a4e3d956c835ad0a43e3610ca32384d01f079ea1c \ + --hash=sha256:a364e8e944d92dcbf33b6b494d4e0fb3499dcc3bd9485beb701aa4b4201fa414 \ + --hash=sha256:a4058f16cee694577f7e4dd410263cd0ef75644b43802a689c2b3c2a7e69453b \ + --hash=sha256:a4b382e0e636ed54cd278791d93fe2c4f370772743f02bcbe431a160089025c9 \ + --hash=sha256:a83d3adea1e0ee36dac34627f78ddd7f093bb9cfc0a8e97f1572a949b695cb98 \ + --hash=sha256:a8ade0363f776f87f982572c2860cc43c65ace208db49c76df0a21dde4ddd16e \ + --hash=sha256:aa59974880ab5ad8ef3afaa26f9bda148c5f39e06b11a8ada4660ecc9fb2feb3 \ + --hash=sha256:aa826340a609d0c954ba52fd831f0fba2a4165659ab0ee1a15e4aac21f302406 \ + --hash=sha256:aaca5a812f050ab55426c32177091130b1e49329b3f002a32934cd0245571307 \ + --hash=sha256:ae82fce1d964f065c32c9517309f0c7be588772352d2f40b1574a214bd6e6098 \ + --hash=sha256:aed57b541b589fa05ac248f4cb1c46cbb432ab82cbd467d1c4f6a2bdc18aecf9 \ + --hash=sha256:afa578b6524ff85fb365f454cf61683771d0170470c48ad9d170c48075f86725 \ + --hash=sha256:b0884e3f22d87c30694e625b1e62e6f30d39782c806287450d9dc2fdf07692fd \ + --hash=sha256:b2aca14c235c7a08558fe0a4786a1a05873a01e86b474dfa8f6df49101853a4e \ + --hash=sha256:b450d7cabcd49aa7ab46a3c6aa3ac7e1593600a1a0605ba536ec0f1b99a04322 \ + --hash=sha256:b725e70d15906d24615201e650d5b0388b08a5187a55f119f25874d0103f90dd \ + --hash=sha256:bfbbab9316330cf81656fed435311386610f78b6c93cc5db4bebbce8dd146675 \ + --hash=sha256:c093c7088b40d8266f57ed71d93112bd64c6724d31f0794c1e52cc4857c28e0e \ + --hash=sha256:c2e49dc23a10a1296b04ca9db200c44d3eb32c8d8ec532e8c1fd24792276522a \ + --hash=sha256:c4393600915c308e546dc7003d74371744234e8444a28622d76fe19b98fa59d1 \ + --hash=sha256:c5ae125276f254b01daa73e2c103363d3e99e3e10505686ac7d9d2442dd4627a \ + --hash=sha256:c6aacf00d05b38a5069826e50ae72751cb5bc27bdc4d5746203988e429b385bb \ + --hash=sha256:c76722b5ed4a31ba103e0dc77ab869222ec36efe1a614e42e9bcea88a36186fe \ + --hash=sha256:c809eef167bf4a57af4b03007004896f5c60bd38dc3852fcd97a26eae3d4c9e6 \ + --hash=sha256:c92ea6d9dd84a750b2bae72ff5e8cf5fdd13e58dda79c33e057862c29a8d5b50 \ + --hash=sha256:cb659702a45136c743bc130760c6f137870d4df3a9e14386478b8a0511abcfca \ + --hash=sha256:ce0930a963ff593e8bb6fda49a503911accc67dee7e5445eec972668e672a0f0 \ + --hash=sha256:d0751528b97d2b19a388b302be2a0ee05817097bab46ff0ed76feeec24951f78 \ + --hash=sha256:d184f85ad2bb1f261eac55cddfcf62a70dee89982c978e92b9a74a1bfef2e367 \ + --hash=sha256:d2a3e412ce1849be34b45922bfef03df32d1410a06d1cdeb793a343c2f1fd666 \ + --hash=sha256:d61ec60945d694df806a9aec88e8f29a27293c6e424f8ff91c80416e3c617645 \ + --hash=sha256:db0c742aad702fd5d0c6611a73f9602f20aec2007c102630c06d7633d9c8f09a \ + --hash=sha256:db4743e30d6f5f92b6d2b7c86b3ad250e0bad8dee4b7ad8a0c44bfb276af89a3 \ + --hash=sha256:dbf7bebc2275016cddf3c997bf8a0f7044160714c64a9b83975670a04e6d2252 \ + --hash=sha256:de1fc314c3ad6bc2f6bd5b5a5b9357b8c6896333d27fdbb7049aea8bd5af2d79 \ + --hash=sha256:df7e5edac4778127f2bf452e0721a58a1cfa4d1d9eac63bdd650535eb8543615 \ + --hash=sha256:e220f7b3e8656ab063d2eb0cd536fafef396829cafe04cb314e734f87649058f \ + --hash=sha256:e3c623923967f3e5961d272718655946e5322b8d058e094764180cdee7bab1af \ + --hash=sha256:e69add9b6b7b08c60d7ff0152c7c9a6c45b4a71a919be5abde6f98f1ea16421c \ + --hash=sha256:e8e0d177b1fe251c3b1b914ab64135475c5273c8cfd2857964b2e3bb0fe196a7 \ + --hash=sha256:ef45f31aec9be01379fc6c10f1d9c677f032f2bac9383c827d44f620e8a88407 \ + --hash=sha256:f1208c1c67ec9e151d78aa3435aa9b08a488b53d9cfac9b699f15255a3461ef2 \ + --hash=sha256:f12582b8d3b4c6be1d298c49cb7ae64a3a73efaf4c2ab4e37db182e3545815ac \ + --hash=sha256:f1de541a9893cf8a1b1db9bf0bf670a2decab42e3e82233d36a74eda7822b4c9 \ + --hash=sha256:f4eac0584cdc3285ef2e74eee1513a6001681fd9753b259e8159421ed28a72e5 \ + --hash=sha256:f7b64fcd670bca8800bc10ced36620c6bbb321e7bc1214b9c0c0df269c1dddc2 \ + --hash=sha256:fb7c61d4be18e930f75948705e9718618862e6fc2ed0d7159b2262be73f167a2 + # via -r .cloudbuild/library_generation/scripts/requirements.in diff --git a/.githooks/pre-commit b/.githooks/pre-commit index 7bd9edd8bb..241070d6de 100755 --- a/.githooks/pre-commit +++ b/.githooks/pre-commit @@ -105,11 +105,11 @@ fi if [ $NUM_JAVA_FILES_CHANGED -gt 0 ] then echo_status "Running Java linter..." - bazel --batch run --disk_cache="$BAZEL_CACHE_DIR" //:google_java_format_verification + mvn fmt:check FORMAT_STATUS=$? if [ $FORMAT_STATUS != 0 ] then - echo_error "Linting failed." "Please run :google_java_format and try again." + echo_error "Linting failed." "Please run mvn fmt:format and try again." exit 1 fi fi @@ -118,7 +118,7 @@ fi if [ $NUM_JAVA_FILES_CHANGED -gt 0 ] || [ $NUM_UNIT_GOLDEN_FILES_CHANGED -gt 0 ] then echo_status "Checking unit tests..." - bazel --batch test //:units --disk_cache="$BAZEL_CACHE_DIR" + mvn install --batch-mode --no-transfer-progress -Dcheckstyle.skip -Dfmt.skip TEST_STATUS=$? if [ $TEST_STATUS != 0 ] then @@ -133,7 +133,7 @@ if [ $NUM_JAVA_FILES_CHANGED -gt 0 ] \ || [ $NUM_INTEGRATION_BAZEL_FILES_CHANGED -gt 0 ] then echo_status "Checking integration tests..." - bazel --batch test --disk_cache="$BAZEL_CACHE_DIR" //test/integration/... + bazelisk --batch test --disk_cache="$BAZEL_CACHE_DIR" //test/integration/... TEST_STATUS=$? if [ $TEST_STATUS != 0 ] then diff --git a/.github/.OwlBot.lock.yaml b/.github/.OwlBot.lock.yaml deleted file mode 100644 index df359043de..0000000000 --- a/.github/.OwlBot.lock.yaml +++ /dev/null @@ -1,17 +0,0 @@ -# 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. -docker: - image: gcr.io/cloud-devrel-public-resources/owlbot-java:latest - digest: sha256:a57d2ea6d1a77aa96c17ad0850b779ec6295f88b6c1da3d214b2095d140a2066 - # created: 2022-11-16T00:00:00.000000000Z \ No newline at end of file diff --git a/.github/.OwlBot.yaml b/.github/.OwlBot.yaml deleted file mode 100644 index 2b0bdb4839..0000000000 --- a/.github/.OwlBot.yaml +++ /dev/null @@ -1,16 +0,0 @@ -# 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. - -docker: - image: "gcr.io/cloud-devrel-public-resources/owlbot-java:latest" diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS deleted file mode 100644 index a4f298456a..0000000000 --- a/.github/CODEOWNERS +++ /dev/null @@ -1,7 +0,0 @@ -# Code owners file. -# This file controls who is tagged for review for any given pull request. -# -# For syntax help see: -# https://help.github.com/en/github/creating-cloning-and-archiving-repositories/about-code-owners#codeowners-syntax - -* @googleapis/cloud-java-team-teamsync diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md new file mode 100644 index 0000000000..3daff23532 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -0,0 +1,51 @@ +--- +name: Bug report +about: Create a report to help us improve + +--- + +Thanks for stopping by to let us know something could be better! + +**PLEASE READ**: Before creating a new issue, please read our [contributing guidelines](https://github.com/googleapis/gapic-generator-java/blob/main/CONTRIBUTING.md). 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/gapic-generator-java/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 artifact at the beginning of the title. For example, "api-common", "gax" etc) +2. OS type and version: +3. Java version: +4. artifact version(s): + +#### Steps to reproduce +If possible, please provide a test case or sample application that reproduces the problem. This makes it much easier for us to diagnose the problem and to verify that we have fixed it. + +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! \ No newline at end of file diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml new file mode 100644 index 0000000000..57185ea00c --- /dev/null +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -0,0 +1,4 @@ +contact_links: + - name: Google Cloud Support + url: https://cloud.google.com/support/ + about: If you have a support contract with Google, please use the Google Cloud Support portal. \ No newline at end of file diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md new file mode 100644 index 0000000000..a71b0715c1 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature_request.md @@ -0,0 +1,22 @@ +--- +name: Feature request +about: Suggest an idea for this library + +--- + +Thanks for stopping by to let us know something could be better! + +**PLEASE READ**: Before creating a new issue, please read our [contributing guidelines](https://github.com/googleapis/gapic-generator-java/blob/main/CONTRIBUTING.md). + 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. \ No newline at end of file diff --git a/.github/ISSUE_TEMPLATE/support_request.md b/.github/ISSUE_TEMPLATE/support_request.md new file mode 100644 index 0000000000..35d1cd8665 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/support_request.md @@ -0,0 +1,6 @@ +name: Support request +about: If you have a support contract with Google, please create an issue in the Google Cloud Support console. + +--- + +**PLEASE READ**: If you have a support contract with Google, please create an issue in the [support console](https://cloud.google.com/support/) instead of filing on GitHub. This will ensure a timely response. diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 0000000000..876946070b --- /dev/null +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,9 @@ +Thank you for opening a Pull Request! Before submitting your PR, please read our [contributing guidelines](https://github.com/googleapis/gapic-generator-java/blob/main/CONTRIBUTING.md). + +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/gapic-generator-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 # ☕️ \ No newline at end of file diff --git a/java-iam/.github/auto-label.yaml b/.github/auto-label.yaml similarity index 97% rename from java-iam/.github/auto-label.yaml rename to .github/auto-label.yaml index 4caef688b7..3d1d831a11 100644 --- a/java-iam/.github/auto-label.yaml +++ b/.github/auto-label.yaml @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. requestsize: - enabled: true + enabled: true \ No newline at end of file diff --git a/.github/release-please.yml b/.github/release-please.yml index 63443e67ca..be562de230 100644 --- a/.github/release-please.yml +++ b/.github/release-please.yml @@ -2,3 +2,28 @@ releaseType: java-yoshi bumpMinorPreMajor: true handleGHRelease: true primaryBranch: main +manifest: true +extraFiles: + - WORKSPACE + - .cloudbuild/graalvm/cloudbuild.yaml + - .cloudbuild/graalvm/cloudbuild-test-a.yaml + - .cloudbuild/graalvm/cloudbuild-test-b.yaml + - .cloudbuild/graalvm/cloudbuild-test-c.yaml + - .cloudbuild/library_generation/cloudbuild-library-generation-release.yaml + - >- + hermetic_build/library_generation/owlbot/templates/java_library/.kokoro/presubmit/graalvm-native-a.cfg + - >- + hermetic_build/library_generation/owlbot/templates/java_library/.kokoro/presubmit/graalvm-native-b.cfg + - >- + hermetic_build/library_generation/owlbot/templates/java_library/.kokoro/presubmit/graalvm-native-c.cfg + - generation_config.yaml +branches: + - branch: protobuf-4.x-rc + - branch: 2.23.x + releaseType: java-backport + - branch: 2.40.x + releaseType: java-backport + - branch: 2.54.x + releaseType: java-backport + - branch: 2.59.x + releaseType: java-backport diff --git a/.github/release-trigger.yml b/.github/release-trigger.yml index d4ca94189e..7efb85fb22 100644 --- a/.github/release-trigger.yml +++ b/.github/release-trigger.yml @@ -1 +1,2 @@ enabled: true +multiScmName: sdk-platform-java diff --git a/.github/scripts/action.yaml b/.github/scripts/action.yaml new file mode 100644 index 0000000000..f67f2a5229 --- /dev/null +++ b/.github/scripts/action.yaml @@ -0,0 +1,85 @@ +# 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. + +# This composite action should be used in google-cloud-java and handwritten +# libraries to generate changed libraries. +# This composite action serves as a source of truth of scripts that run +# library generation and create pull requests. +name: Hermetic library generation +description: Runs hermetic library generation to produce changed libraries +inputs: + base_ref: + description: base branch + required: true + head_ref: + description: head branch + required: true + image_tag: + description: the tag of hermetic build image + required: false + showcase_mode: + description: true if we need to download the showcase api definitions + required: false + token: + description: Personal Access Token + required: true + +runs: + using: "composite" + steps: + - uses: actions/setup-python@v5 + with: + python-version: 3.12 + - name: Copy python script + shell: bash + run: | + set -x + # repository root + cd ${{ github.action_path }}/../../ + rsync -rv \ + --exclude=tests \ + hermetic_build "${GITHUB_WORKSPACE}" + - name: Copy shell script + shell: bash + run: | + cd ${{ github.action_path }} + cp hermetic_library_generation.sh "${GITHUB_WORKSPACE}" + - name: Install python packages + shell: bash + run: | + cd "${GITHUB_WORKSPACE}" + pip install --require-hashes -r hermetic_build/common/requirements.txt + pip install hermetic_build/common + pip install --require-hashes -r hermetic_build/release_note_generation/requirements.txt + pip install hermetic_build/release_note_generation + - name: Generate changed libraries + 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" + cd "${GITHUB_WORKSPACE}" + bash hermetic_library_generation.sh \ + --target_branch "${BASE_REF}" \ + --current_branch "${HEAD_REF}" \ + --showcase_mode "${SHOWCASE_MODE}" \ + --image_tag "${IMAGE_TAG}" + env: + BASE_REF: ${{ inputs.base_ref }} + HEAD_REF: ${{ inputs.head_ref }} + IMAGE_TAG: ${{ inputs.image_tag }} + SHOWCASE_MODE: ${{ inputs.showcase_mode }} + GH_TOKEN: ${{ inputs.token }} diff --git a/.github/scripts/hermetic_library_generation.sh b/.github/scripts/hermetic_library_generation.sh new file mode 100755 index 0000000000..5da0e64c3a --- /dev/null +++ b/.github/scripts/hermetic_library_generation.sh @@ -0,0 +1,151 @@ +#!/bin/bash +set -exo pipefail +# This script should be run at the root of the repository. +# This script is used to, when a pull request changes the generation +# configuration (generation_config.yaml by default) or Dockerfile: +# 1. Find whether the last commit in this pull request contains changes to +# the generation configuration and Dockerfile and exit early if it doesn't have +# such a change since the generation result would be the same. +# 2. Compare generation configurations in the current branch (with which the +# pull request associated) and target branch (into which the pull request is +# merged); +# 3. Generate changed libraries using library_generation image; +# 4. Commit the changes to the pull request, if any. +# 5. Edit the PR body with generated pull request description, if applicable. + +# The following commands need to be installed before running the script: +# 1. git +# 2. gh +# 3. docker +# 4. mvn + +# The parameters of this script is: +# 1. target_branch, the branch into which the pull request is merged. +# 2. current_branch, the branch with which the pull request is associated. +# 3. [optional] image_tag, the tag of gcr.io/cloud-devrel-public-resources/java-library-generation. +# 4. [optional] generation_config, the path to the generation configuration, +# the default value is generation_config.yaml in the repository root. +# 5. [optional] showcase_mode, true if we wish to download the showcase api +# definitions, which are necessary for generating the showcase library. +while [[ $# -gt 0 ]]; do +key="$1" +case "${key}" in + --target_branch) + target_branch="$2" + shift + ;; + --current_branch) + current_branch="$2" + shift + ;; + --image_tag) + image_tag="$2" + shift + ;; + --generation_config) + generation_config="$2" + shift + ;; + --showcase_mode) + showcase_mode="$2" + shift + ;; + *) + echo "Invalid option: [$1]" + exit 1 + ;; +esac +shift +done + +if [ -z "${target_branch}" ]; then + echo "missing required argument --target_branch" + exit 1 +fi + +if [ -z "${current_branch}" ]; then + echo "missing required argument --current_branch" + exit 1 +fi + +if [ -z "${download_showcase}" ]; then + download_showcase="false" +fi + +if [ -z "${generation_config}" ]; then + generation_config=generation_config.yaml + echo "Use default generation config: ${generation_config}" +fi + +if [ -z "${image_tag}" ]; then + image_tag=$(grep "gapic_generator_version" "${generation_config}" | cut -d ':' -f 2 | xargs) +fi + +workspace_name="/workspace" +baseline_generation_config="baseline_generation_config.yaml" +message="chore: generate libraries at $(date)" + +git checkout "${target_branch}" +git checkout "${current_branch}" + +# copy generation configuration from target branch to current branch. +git show "${target_branch}":"${generation_config}" > "${baseline_generation_config}" + +# download api definitions from googleapis repository +googleapis_commitish=$(grep googleapis_commitish "${generation_config}" | cut -d ":" -f 2 | xargs) +api_def_dir=$(mktemp -d) +git clone https://github.com/googleapis/googleapis.git "${api_def_dir}" +pushd "${api_def_dir}" +git checkout "${googleapis_commitish}" +popd + +# we also setup showcase +if [[ "${showcase_mode}" == "true" ]]; then + source java-showcase/scripts/showcase_utilities.sh + append_showcase_to_api_defs "${api_def_dir}" +fi + +# get changed library list. +changed_libraries_file="$(mktemp)" +python hermetic_build/common/cli/get_changed_libraries.py create \ + --baseline-generation-config-path="${baseline_generation_config}" \ + --current-generation-config-path="${generation_config}" | tee "${changed_libraries_file}" +changed_libraries="$(cat "${changed_libraries_file}")" +echo "Changed libraries are: ${changed_libraries:-"No changed library"}." + +# run hermetic code generation docker image. +docker run \ + --rm \ + -u "$(id -u):$(id -g)" \ + -v "$(pwd):${workspace_name}" \ + -v "${api_def_dir}:${workspace_name}/googleapis" \ + -e GENERATOR_VERSION="${image_tag}" \ + gcr.io/cloud-devrel-public-resources/java-library-generation:"${image_tag}" \ + --generation-config-path="${workspace_name}/${generation_config}" \ + --library-names="${changed_libraries}" \ + --api-definitions-path="${workspace_name}/googleapis" + +python hermetic_build/release_note_generation/cli/generate_release_note.py generate \ + --baseline-generation-config-path="${baseline_generation_config}" \ + --current-generation-config-path="${generation_config}" + +# remove api definitions after generation +rm -rf "${api_def_dir}" + +# commit the change to the pull request. +rm -rdf output googleapis "${baseline_generation_config}" +git add --all -- ':!pr_description.txt' ':!hermetic_library_generation.sh' ':!hermetic_build' +changed_files=$(git diff --cached --name-only) +if [[ "${changed_files}" != "" ]]; then + echo "Commit changes..." + git commit -m "${message}" + git push +else + echo "There is no generated code change, skip commit." +fi + +# set pr body if pr_description.txt is generated. +if [[ -f "pr_description.txt" ]]; then + pr_num=$(gh pr list -s open -H "${current_branch}" -q . --json number | jq ".[] | .number") + gh pr edit "${pr_num}" --body "$(cat pr_description.txt)" +fi diff --git a/.github/scripts/test_dependency_compatibility.sh b/.github/scripts/test_dependency_compatibility.sh new file mode 100755 index 0000000000..9b07efd1ce --- /dev/null +++ b/.github/scripts/test_dependency_compatibility.sh @@ -0,0 +1,93 @@ +#!/bin/bash + +# This script generates a maven command to test unit and integration tests for +# the repo. The outputted maven command will be in the rough following format +# `mvn verify ... -D{dependency.name}.version={dependency.version]`. The variables +# ${dependency.name} and ${dependency.version} are parsed from the input to the script. +# +# Default invocation ./.github/scripts/test_dependency_compatibility.sh will use the default +# upper-bounds dependency file at the root of the repo. +# There are two potential inputs to the script: +# 1. -f {file}: Custom file/path for the upper-bound dependencies to test +# 2. -l {deps_list}: Comma-separated list of dependencies to test (e.g. protobuf=4.31.0,guava=33.4.8-jre) +# Note: Do not include the `-D` prefix or `.version` suffix. Those values will be appended when generating +# the maven command. +# +# If both inputs are supplied, the deps_list input has precedence. For Github Actions workflow, +# the default workflow will run with the upper-bounds file. A `workflow_dispatch` option takes in +# an input for the deps_list to manually run a subset of dependencies. +# +# The default upper-bound dependencies file is `dependencies.txt` located in the root +# of sdk-platform-java. See the upper-bound dependencies file for the dependency format. + +set -ex + +function print_help() { + echo "Unexpected input argument for this script." + echo "Use -f {file} for the directory of the upper-bound dependencies file." + echo "Use -l {deps_list} for a comma-separated list of dependencies to test (Format: dep1=1.0,dep2=2.0)" +} + +# Default to the upper bounds file in the root of the repo +file='dependencies.txt' +dependency_list='' + +# The colon (:) after the letter means that there is an input associated with the flag +while getopts 'f:l:' flag; do + case "${flag}" in + f) file="${OPTARG}" ;; + l) dependency_list="${OPTARG}" ;; + *) print_help && exit 1 + esac +done + +# Error if both the file and deps_list inputs is empty +if [[ -z "${file}" && -z "${dependency_list}" ]]; then + print_help && exit 1 +fi + +MAVEN_COMMAND="mvn -ntp -B verify -Penable-integration-tests -Dclirr.skip -Dcheckstyle.skip -Dfmt.skip -Denforcer.skip" + +# Check if a list of dependencies was provided as an argument. If the list of dependency inputted +# is empty, then run with the upper-bound dependencies file +if [ -z "${dependency_list}" ]; then + UPPER_BOUND_DEPENDENCY_FILE=$file + + if [ ! -e "${UPPER_BOUND_DEPENDENCY_FILE}" ]; then + echo "The inputted upper-bound dependency file '${UPPER_BOUND_DEPENDENCY_FILE}' cannot be found" + exit 1 + fi + + # Read the file line by line + while IFS= read -r line; do + # Ignore any comments and blank lines + if [[ "${line}" =~ ^[[:space:]]*# ]] || [[ -z "${line}" ]]; then + continue + fi + # Format from `dependencies.txt`: {GroupID}:{ArtifactID},{PropertyName}={Version} + propertyVersion=$(echo "${line}" | cut -d',' -f2) + dependency=$(echo "${propertyVersion}" | cut -d'=' -f1) + version=$(echo "${propertyVersion}" | cut -d'=' -f2) + MAVEN_COMMAND+=" -D${dependency}.version=${version}" + done < "${UPPER_BOUND_DEPENDENCY_FILE}" +else # This else block means that a list of dependencies was inputted + # Set the Internal Field Separator (IFS) to a comma. + # This tells 'read' to split the string by commas into an array named DEPS. + # The 'read -ra' command reads the input into an array. + IFS=',' read -ra DEPS <<< "${dependency_list}" + + # Loop through each item in the DEPS array. + for DEP_PAIR in "${DEPS[@]}"; do + # Skip any empty items that might result from trailing commas. + if [ -z "${DEP_PAIR}" ]; then + continue + fi + # Format: {MavenPropertyName}={Version} + dependency=$(echo "${DEP_PAIR}" | cut -d'=' -f1) + version=$(echo "${DEP_PAIR}" | cut -d'=' -f2) + MAVEN_COMMAND+=" -D${dependency}.version=${version}" + done +fi + +# Run the generated maven command to test with the dependency versions +$MAVEN_COMMAND diff --git a/.github/scripts/update_googleapis_commit.sh b/.github/scripts/update_googleapis_commit.sh new file mode 100644 index 0000000000..2acad04855 --- /dev/null +++ b/.github/scripts/update_googleapis_commit.sh @@ -0,0 +1,113 @@ +#!/bin/bash +set -e +# This script should be run at the root of the repository. +# This script is used to update googleapis commit to latest 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 + +# 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. +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 + ;; + *) + 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 + +current_branch="generate-libraries-${base_branch}" +title="chore: update googleapis commit 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 +sed -i -e "s/^googleapis_commitish.*$/googleapis_commitish: ${latest_commit}/" "${generation_config}" + +git add "${generation_config}" +changed_files=$(git diff --cached --name-only) +if [[ "${changed_files}" == "" ]]; then + echo "The latest googleapis commit 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 +fi diff --git a/.github/snippet-bot.yml b/.github/snippet-bot.yml index c7ee6ca54b..90a0dd31b7 100644 --- a/.github/snippet-bot.yml +++ b/.github/snippet-bot.yml @@ -3,4 +3,6 @@ alwaysCreateStatusCheck: false ignoreFiles: - src/test/** - test/** - - showcase/** + - java-showcase/** + - library_generation/owlbot/templates/java_library/samples/install-without-bom/pom.xml + - library_generation/owlbot/synthtool/gcp/snippets.py diff --git a/.github/sync-repo-settings.yaml b/.github/sync-repo-settings.yaml index e003740d5d..f53bb09494 100644 --- a/.github/sync-repo-settings.yaml +++ b/.github/sync-repo-settings.yaml @@ -1,3 +1,175 @@ rebaseMergeAllowed: true squashMergeAllowed: true mergeCommitAllowed: false +branchProtectionRules: + - pattern: main + isAdminEnforced: true + requiredApprovingReviewCount: 1 + requiresCodeOwnerReviews: true + requiresStrictStatusChecks: false + requiredStatusCheckContexts: + - build(8) except for gapic-generator-java + - build(8) for gapic-generator-java + - build (11) + - build (17) + - cla/google + - compatibility + - graalvm-presubmit-sdk-platform-java-a (java-graalvm-ci-prod) + - graalvm-presubmit-sdk-platform-java-b (java-graalvm-ci-prod) + - graalvm-presubmit-sdk-platform-java-c (java-graalvm-ci-prod) + - >- + graalvm-presubmit-sdk-platform-java-a-downstream-kms + (java-graalvm-ci-prod) + - >- + graalvm-presubmit-sdk-platform-java-b-downstream-kms + (java-graalvm-ci-prod) + - >- + graalvm-presubmit-sdk-platform-java-c-downstream-kms + (java-graalvm-ci-prod) + - >- + graalvm-presubmit-sdk-platform-java-a-downstream-kmsinventory + (java-graalvm-ci-prod) + - >- + graalvm-presubmit-sdk-platform-java-b-downstream-kmsinventory + (java-graalvm-ci-prod) + - >- + graalvm-presubmit-sdk-platform-java-c-downstream-kmsinventory + (java-graalvm-ci-prod) + - library_generation + - library-generation-integration-test (java-hermetic-build-prod) + - library-generation-lint-python + - library-generation-lint-shell + - library-generation-unit-tests + - lint + - should-run-library-generation-tests + - showcase (11) + - showcase (17) + - pattern: 2.23.x + isAdminEnforced: true + requiredApprovingReviewCount: 1 + requiresCodeOwnerReviews: true + requiresStrictStatusChecks: false + requiredStatusCheckContexts: + - build (8) except for gapic-generator-java + - build (8) for gapic-generator-java + - build (11) + - build (17) + - showcase (11) + - showcase (17) + - compatibility + - cla/google + - lint + - graalvm-presubmit-sdk-platform-java-a (cloud-devrel-kokoro-resources) + - graalvm-presubmit-sdk-platform-java-b (cloud-devrel-kokoro-resources) + - library-generation-integration-tests + - library-generation-lint-shell + - library-generation-lint-python + - should-run-library-generation-tests + - pattern: 2.40.x + isAdminEnforced: true + requiredApprovingReviewCount: 1 + requiresCodeOwnerReviews: true + requiresStrictStatusChecks: false + requiredStatusCheckContexts: + - build (8) except for gapic-generator-java + - build (8) for gapic-generator-java + - build (11) + - build (17) + - build(21) except self-service clients + - showcase (11) + - showcase (17) + - showcase-native + - compatibility + - cla/google + - lint + - graalvm-presubmit-sdk-platform-java-a (cloud-devrel-kokoro-resources) + - graalvm-presubmit-sdk-platform-java-b (cloud-devrel-kokoro-resources) + - library-generation-integration-tests + - library-generation-lint-shell + - library-generation-lint-python + - should-run-library-generation-tests + - pattern: 2.54.x + isAdminEnforced: true + requiredApprovingReviewCount: 1 + requiresCodeOwnerReviews: true + requiresStrictStatusChecks: false + requiredStatusCheckContexts: + - build(8) except for gapic-generator-java + - build(8) for gapic-generator-java + - build (11) + - build (17) + - cla/google + - compatibility + - graalvm-presubmit-sdk-platform-java-a (java-graalvm-ci-prod) + - graalvm-presubmit-sdk-platform-java-b (java-graalvm-ci-prod) + - >- + graalvm-presubmit-sdk-platform-java-a-downstream-kms + (java-graalvm-ci-prod) + - >- + graalvm-presubmit-sdk-platform-java-b-downstream-kms + (java-graalvm-ci-prod) + - >- + graalvm-presubmit-sdk-platform-java-a-downstream-kmsinventory + (java-graalvm-ci-prod) + - >- + graalvm-presubmit-sdk-platform-java-b-downstream-kmsinventory + (java-graalvm-ci-prod) + - library_generation + - library-generation-integration-test (java-hermetic-build-prod) + - library-generation-lint-python + - library-generation-lint-shell + - library-generation-unit-tests + - lint + - should-run-library-generation-tests + - showcase-native + - showcase (11) + - showcase (17) + - pattern: 2.59.x + isAdminEnforced: true + requiredApprovingReviewCount: 1 + requiresCodeOwnerReviews: true + requiresStrictStatusChecks: false + requiredStatusCheckContexts: + - build(8) except for gapic-generator-java + - build(8) for gapic-generator-java + - build (11) + - build (17) + - cla/google + - compatibility + - graalvm-presubmit-sdk-platform-java-a (java-graalvm-ci-prod) + - graalvm-presubmit-sdk-platform-java-b (java-graalvm-ci-prod) + - graalvm-presubmit-sdk-platform-java-c (java-graalvm-ci-prod) + - >- + graalvm-presubmit-sdk-platform-java-a-downstream-kms + (java-graalvm-ci-prod) + - >- + graalvm-presubmit-sdk-platform-java-b-downstream-kms + (java-graalvm-ci-prod) + - >- + graalvm-presubmit-sdk-platform-java-c-downstream-kms + (java-graalvm-ci-prod) + - >- + graalvm-presubmit-sdk-platform-java-a-downstream-kmsinventory + (java-graalvm-ci-prod) + - >- + graalvm-presubmit-sdk-platform-java-b-downstream-kmsinventory + (java-graalvm-ci-prod) + - >- + graalvm-presubmit-sdk-platform-java-c-downstream-kmsinventory + (java-graalvm-ci-prod) + - library_generation + - library-generation-integration-test (java-hermetic-build-prod) + - library-generation-lint-python + - library-generation-lint-shell + - library-generation-unit-tests + - lint + - should-run-library-generation-tests + - showcase (11) + - showcase (17) + - showcase (21) + - showcase (24) +permissionRules: + - team: cloud-java-team-teamsync + permission: admin + - team: cloud-java-bot + permission: write diff --git a/.github/workflows/analyze_dependency.yaml b/.github/workflows/analyze_dependency.yaml new file mode 100644 index 0000000000..22b350d53c --- /dev/null +++ b/.github/workflows/analyze_dependency.yaml @@ -0,0 +1,43 @@ +name: Run dependency analyzer +on: + workflow_dispatch: + inputs: + system: + description: the package management system + required: true + type: choice + default: maven + options: + - maven + name: + description: the name of the dependency + required: true + type: string + version: + description: the version of the dependency + required: true + type: string +jobs: + Run-dependency-analyzer: + runs-on: ubuntu-22.04 + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-java@v4 + with: + distribution: temurin + java-version: 17 + cache: maven + - name: Set up Maven + uses: stCarolas/setup-maven@v4.5 + with: + maven-version: 3.8.2 + - name: Install dependency analyzer + shell: bash + run: | + mvn clean install -V --batch-mode --no-transfer-progress -DskipTests + working-directory: java-shared-dependencies/dependency-analyzer + - name: Check dependency information + shell: bash + run: | + mvn exec:java -Ddep.system=${{ github.event.inputs.system }} -Ddep.name=${{ github.event.inputs.name }} -Ddep.version=${{ github.event.inputs.version }} + working-directory: java-shared-dependencies/dependency-analyzer \ No newline at end of file diff --git a/.github/workflows/ci-maven.yaml b/.github/workflows/ci-maven.yaml deleted file mode 100644 index db85f6f94e..0000000000 --- a/.github/workflows/ci-maven.yaml +++ /dev/null @@ -1,165 +0,0 @@ -on: - push: - branches: - - main - pull_request: -name: ci-maven -env: - SHOWCASE_VERSION: 0.25.0 -jobs: - units: - runs-on: ubuntu-latest - strategy: - matrix: - java: [ 11, 17 ] - steps: - - uses: actions/checkout@v2 - - uses: actions/setup-java@v3 - with: - java-version: ${{ matrix.java }} - distribution: temurin - cache: maven - - run: java -version - - name: Unit Tests - run: | - mvn verify --batch-mode --no-transfer-progress -Dcheckstyle.skip \ - -Dfmt.skip - - units-java8: - name: "units (8) except gapic-generator-java" - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - # Java 8 tests uses JDK 11 to compile and JDK 8 to run tests. - - uses: actions/setup-java@v3 - with: - java-version: 8 - distribution: temurin - cache: maven - - run: echo "JAVA8_HOME=${JAVA_HOME}" >> $GITHUB_ENV - - uses: actions/setup-java@v3 - with: - java-version: 11 - distribution: temurin - - run: echo "JAVA11_HOME=${JAVA_HOME}" >> $GITHUB_ENV - - name: Compile with Java 11 - shell: bash - run: | - set -x - export JAVA_HOME=$JAVA11_HOME - export PATH=${JAVA_HOME}/bin:$PATH - - # Why not compile? It's because the process needs to package jar so - # that gapic-generator-java module can use testlib modules of gax. - mvn verify --batch-mode --no-transfer-progress -Dcheckstyle.skip \ - -DskipTests -Dfmt.skip - - name: Run test with Java 8 for all modules except gapic-generator-java - shell: bash - run: | - set -x - export JAVA_HOME=$JAVA8_HOME - export PATH=${JAVA_HOME}/bin:$PATH - # useIncrementalCompilation=false to avoid recompiling classes - # generated by Java 11 compiler above. - mvn -B -ntp test --projects '!gapic-generator-java' \ - -Dcheckstyle.skip -Dmaven.compiler.useIncrementalCompilation=false \ - -Dfmt.skip - - units-java8-gapic-generator-java: - name: "units (8) for gapic-generator-java" - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - uses: actions/setup-java@v3 - with: - java-version: 11 - distribution: temurin - cache: maven - - name: Install modules outside gapic-generator-java - shell: bash - run: | - mvn -B -ntp install --projects '!gapic-generator-java' \ - -Dcheckstyle.skip -Dfmt.skip -DskipTests - - uses: actions/setup-java@v3 - with: - java-version: 8 - distribution: temurin - cache: maven - - run: java -version - - name: Run test only for gapic-generator-java using Java 8 - shell: bash - run: | - mvn -B -ntp verify --projects 'gapic-generator-java' \ - -Dcheckstyle.skip -Dfmt.skip - - lint: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - uses: actions/setup-java@v3 - with: - java-version: 11 - distribution: temurin - cache: maven - - run: java -version - - name: Java Linter - # Exclude the root project - run: mvn -B -ntp --projects '!.' fmt:check - - showcase: - runs-on: ubuntu-latest - strategy: - matrix: - java: [ 11, 17 ] - steps: - - uses: actions/checkout@v2 - - uses: actions/setup-java@v3 - with: - java-version: ${{ matrix.java }} - distribution: temurin - - run: java -version - - - name: Bazel File Cache Setup - id: cache-bazel - uses: actions/cache@v3 - with: - path: ~/.cache/bazel - key: ${{ runner.os }}-${{ hashFiles('WORKSPACE') }} - restore-keys: ${{ runner.os }}- - - name: Bazel Cache Not Found - if: steps.cache-bazel.outputs.cache-hit != 'true' - run: | - echo "No cache found." - - name: Bazel Cache Found - if: steps.cache-bazel.outputs.cache-hit == 'true' - run: | - echo -n "Cache found. Cache size: " - du -sh ~/.cache/bazel - echo "If the cache seems broken, update the root WORKSPACE file with a trivial change." - echo "The old cache will disappear after 7 days." - - - name: Install maven modules - run: | - mvn install -B -ntp -DskipTests -Dclirr.skip -Dcheckstyle.skip - - - name: Install system dependencies - run: | - sudo apt-get update - sudo apt-get install -y curl unzip - - name: Install showcase server - run: | - sudo mkdir -p /usr/src/showcase - sudo chown -R ${USER} /usr/src/ - curl --location https://github.com/googleapis/gapic-showcase/releases/download/v${SHOWCASE_VERSION}/gapic-showcase-${SHOWCASE_VERSION}-linux-amd64.tar.gz --output /usr/src/showcase/showcase-${SHOWCASE_VERSION}-linux-amd64.tar.gz - cd /usr/src/showcase/ - tar -xf showcase-* - ./gapic-showcase run & - cd - - - name: Showcase integration tests - working-directory: showcase - run: | - mvn verify \ - -P enable-golden-tests \ - -P enable-integration-tests \ - --batch-mode \ - --no-transfer-progress diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 60fddf8afb..c26780ae35 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -6,81 +6,198 @@ on: name: ci jobs: build: - runs-on: ubuntu-latest + runs-on: ubuntu-22.04 strategy: - fail-fast: false matrix: - java: [ 8, 11 ] + java: [ 11, 17] steps: - - uses: actions/checkout@v2 - - uses: actions/setup-java@v3 + - uses: actions/checkout@v4 + - uses: actions/setup-java@v4 with: java-version: ${{ matrix.java }} distribution: temurin + cache: maven - run: java -version + - name: Unit Tests + run: | + mvn test --batch-mode --no-transfer-progress -Dcheckstyle.skip \ + -Dfmt.skip -DenableTestCoverage + # The `envVarTest` profile runs tests that require an environment variable + - name: Env Var Tests + run: | + mvn test --batch-mode --no-transfer-progress -Dcheckstyle.skip \ + -Dfmt.skip -DenableTestCoverage -PenvVarTest + # Set the Env Var for this step only + env: + GOOGLE_CLOUD_UNIVERSE_DOMAIN: random.com + GOOGLE_CLOUD_ENABLE_DIRECT_PATH_XDS: true + GOOGLE_SDK_JAVA_LOGGING: true - run: bazelisk version - - name: Bazel File Cache Setup - id: cache-bazel - uses: actions/cache@v3 - with: - path: ~/.cache/bazel - key: ${{ runner.os }}-${{ hashFiles('WORKSPACE') }} - restore-keys: ${{ runner.os }}- - - name: Bazel Cache Not Found - if: steps.cache-bazel.outputs.cache-hit != 'true' - run: | - echo "No cache found." - - name: Bazel Cache Found - if: steps.cache-bazel.outputs.cache-hit == 'true' - run: | - echo -n "Cache found. Cache size: " - du -sh ~/.cache/bazel - echo "If the cache seems broken, update the root WORKSPACE file with a trivial change." - echo "The old one will disappear after 7 days." - + - name: Install Maven modules + run: | + mvn install -B -ntp -DskipTests -Dclirr.skip -Dcheckstyle.skip -Dfmt.skip - name: Integration Tests - run: bazelisk --batch test //test/integration/... + run: | + bazelisk --batch test //test/integration/... + - name: Gradle Build Generated Storage Client Library + run: | + echo "Building Storage lib from generated source..." + mkdir /tmp/java-storage + bazelisk --batch build @com_google_googleapis//google/storage/v2:google-cloud-storage-v2-java + tar zxvf bazel-bin/external/com_google_googleapis/google/storage/v2/google-cloud-storage-v2-java.tar.gz -C /tmp/java-storage + pushd /tmp/java-storage/google-cloud-storage-v2-java + ./gradlew clean build publishToMavenLocal sourcesJar allJars + popd - - uses: actions/upload-artifact@v3 - if: ${{ failure() }} + - name: Gradle Build Generated Compute Client Library + run: | + echo "Building Compute lib from generated source..." + mkdir /tmp/java-compute + bazelisk --batch build @com_google_googleapis//google/cloud/compute/v1small:google-cloud-compute-small-v1-java + tar zxvf bazel-bin/external/com_google_googleapis/google/cloud/compute/v1small/google-cloud-compute-small-v1-java.tar.gz -C /tmp/java-compute + pushd /tmp/java-compute/google-cloud-compute-small-v1-java + ./gradlew clean build publishToMavenLocal sourcesJar allJars + popd + build-java-21: + name: "build(21) except self-service clients" + # Support for Java 21 is available for all use cases except self-service clients. + runs-on: ubuntu-22.04 + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-java@v4 with: - name: test-artifacts - path: ~/.cache/bazel/*/*/*/gapic_generator_java/bazel-out/*/testlogs/* - retention-days: 5 - - generate-client-libraries: - runs-on: ubuntu-latest - strategy: - fail-fast: false - matrix: - java: [ 8, 11 ] + java-version: 21 + distribution: temurin + cache: maven + - run: java -version + - name: Unit Tests + run: | + mvn test --batch-mode --no-transfer-progress -Dcheckstyle.skip \ + -Dfmt.skip -DenableTestCoverage + # The `envVarTest` profile runs tests that require an environment variable + - name: Env Var Tests + run: | + mvn test --batch-mode --no-transfer-progress -Dcheckstyle.skip \ + -Dfmt.skip -DenableTestCoverage -PenvVarTest + # Set the Env Var for this step only + env: + GOOGLE_CLOUD_UNIVERSE_DOMAIN: random.com + GOOGLE_CLOUD_ENABLE_DIRECT_PATH_XDS: true + GOOGLE_SDK_JAVA_LOGGING: true + - run: bazelisk version + - name: Install Maven modules + run: | + mvn install -B -ntp -DskipTests -Dclirr.skip -Dcheckstyle.skip + - name: Integration Tests + run: | + bazelisk --batch test //test/integration/... + build-java-25: + name: "build(25) except self-service clients" + # Support for Java 25 is available for all use cases except self-service clients. + runs-on: ubuntu-22.04 steps: - - uses: actions/checkout@v2 - - uses: actions/setup-java@v3 + - uses: actions/checkout@v4 + - uses: actions/setup-java@v4 with: - java-version: ${{ matrix.java }} + java-version: 25 distribution: temurin + cache: maven - run: java -version + - name: Unit Tests + run: | + mvn test --batch-mode --no-transfer-progress -Dcheckstyle.skip \ + -Dfmt.skip -DenableTestCoverage + # The `envVarTest` profile runs tests that require an environment variable + - name: Env Var Tests + run: | + mvn test --batch-mode --no-transfer-progress -Dcheckstyle.skip \ + -Dfmt.skip -DenableTestCoverage -PenvVarTest + # Set the Env Var for this step only + env: + GOOGLE_CLOUD_UNIVERSE_DOMAIN: random.com + GOOGLE_CLOUD_ENABLE_DIRECT_PATH_XDS: true + GOOGLE_SDK_JAVA_LOGGING: true - run: bazelisk version - - name: Bazel File Cache Setup - id: cache-bazel - uses: actions/cache@v3 + - name: Install Maven modules + run: | + mvn install -B -ntp -DskipTests -Dclirr.skip -Dcheckstyle.skip -Dfmt.skip + - name: Integration Tests + # note need to set shouldInstallTestSecurityManager=false due to https://github.com/bazelbuild/bazel/issues/24354 + run: | + bazelisk --batch test //test/integration/... --jvmopt=-Dcom.google.testing.junit.runner.shouldInstallTestSecurityManager=false + build-java8-except-gapic-generator-java: + name: "build(8) except for gapic-generator-java" + runs-on: ubuntu-22.04 + steps: + - uses: actions/checkout@v4 + # Java 8 tests uses JDK 17 to compile and JDK 8 to run tests. + - uses: actions/setup-java@v4 with: - path: ~/.cache/bazel - key: ${{ runner.os }}-${{ hashFiles('WORKSPACE') }} - restore-keys: ${{ runner.os }}- - - name: Bazel Cache Not Found - if: steps.cache-bazel.outputs.cache-hit != 'true' - run: | - echo "No cache found." - - name: Bazel Cache Found - if: steps.cache-bazel.outputs.cache-hit == 'true' - run: | - echo -n "Cache found. Cache size: " - du -sh ~/.cache/bazel - echo "If the cache seems broken, update the root WORKSPACE file with a trivial change." - echo "The old cache will disappear after 7 days." + java-version: 8 + distribution: temurin + cache: maven + - run: echo "JAVA8_HOME=${JAVA_HOME}" >> $GITHUB_ENV + - uses: actions/setup-java@v3 + with: + java-version: 17 + distribution: temurin + - name: Compile with Java 17 and run tests with Java 8 + shell: bash + run: | + set -x + export JAVA_HOME=$JAVA_HOME + export PATH=${JAVA_HOME}/bin:$PATH + # Maven surefire plugin lets us to specify the JVM when running tests via + # the "jvm" system property. + mvn verify --batch-mode --no-transfer-progress -Dcheckstyle.skip \ + -Dfmt.skip \ + -Djvm="${JAVA8_HOME}/bin/java" + # The `envVarTest` profile runs tests that require an environment variable + - name: Compile with Java 17 and run tests with Java 8 (Env Var Tests) + shell: bash + run: | + set -x + export JAVA_HOME=$JAVA_HOME + export PATH=${JAVA_HOME}/bin:$PATH + # Maven surefire plugin lets us to specify the JVM when running tests via + # the "jvm" system property. + export GOOGLE_CLOUD_UNIVERSE_DOMAIN=random.com + mvn test --batch-mode --no-transfer-progress -Dcheckstyle.skip \ + -Dfmt.skip -DenableTestCoverage -Dsurefire.failIfNoSpecifiedTests=false \ + -PenvVarTest + # Set the Env Var for this step only + env: + GOOGLE_CLOUD_UNIVERSE_DOMAIN: random.com + GOOGLE_CLOUD_ENABLE_DIRECT_PATH_XDS: true + GOOGLE_SDK_JAVA_LOGGING: true + build-java8-gapic-generator-java: + name: "build(8) for gapic-generator-java" + runs-on: ubuntu-22.04 + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-java@v4 + with: + java-version: 11 + distribution: temurin + cache: maven + - name: Install all modules using Java 11 + shell: bash + run: | + mvn -V -B -ntp clean install -DskipTests -Dfmt.skip + - uses: actions/setup-java@v3 + with: + java-version: 8 + distribution: temurin + - run: java -version + - name: Run tests in Java 8 with the source compiled in Java 11 for gapic-generator-java + shell: bash + run: | + mvn -V -B -ntp surefire:test --projects 'gapic-generator-java' + - run: bazelisk version + - name: Integration Tests + run: | + bazelisk --batch test //test/integration/... - name: Gradle Build Generated Storage Client Library run: | echo "Building Storage lib from generated source..." @@ -101,15 +218,264 @@ jobs: ./gradlew clean build publishToMavenLocal sourcesJar allJars popd - license-header: - runs-on: ubuntu-latest + lint: + runs-on: ubuntu-22.04 + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-java@v4 + with: + java-version: 17 + distribution: temurin + cache: maven + - run: java -version + - name: Java Linter + # Exclude the root project + run: mvn -B -ntp fmt:check + + compatibility: + runs-on: ubuntu-22.04 + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-java@v4 + with: + java-version: 11 + distribution: temurin + cache: maven + - run: java -version + - name: Compatibility check + # package jar so that gapic-generator-java module can use + # testlib modules of gax + run: mvn package clirr:check -DskipTests -Dfmt.skip + + build-java8-showcase: + name: "build(8) for showcase" + runs-on: ubuntu-22.04 steps: - - uses: actions/checkout@v2 - - uses: actions/setup-go@v3 + - uses: actions/checkout@v4 + - uses: actions/setup-java@v4 + with: + java-version: 11 + distribution: temurin + cache: maven + - name: Install all modules using Java 11 + shell: bash + run: | + mvn install -B -ntp -DskipTests -Dclirr.skip -Dcheckstyle.skip -Dfmt.skip + - uses: actions/setup-java@v3 with: - go-version: '^1.13.1' - - name: License Header Check + java-version: 8 + distribution: temurin + - run: java -version + - name: Parse showcase version + working-directory: java-showcase/gapic-showcase + run: echo "SHOWCASE_VERSION=$(mvn help:evaluate -Dexpression=gapic-showcase.version -q -DforceStdout)" >> "$GITHUB_ENV" + - name: Install showcase server + run: | + sudo mkdir -p /usr/src/showcase + sudo chown -R ${USER} /usr/src/ + curl --location https://github.com/googleapis/gapic-showcase/releases/download/v${{env.SHOWCASE_VERSION}}/gapic-showcase-${{env.SHOWCASE_VERSION}}-linux-amd64.tar.gz --output /usr/src/showcase/showcase-${{env.SHOWCASE_VERSION}}-linux-amd64.tar.gz + cd /usr/src/showcase/ + tar -xf showcase-* + ./gapic-showcase run & + cd - + - name: Showcase integration tests + working-directory: java-showcase + run: | + mvn verify \ + -P enable-integration-tests \ + --batch-mode \ + --no-transfer-progress + # The `slf4j1_logback` profile brings logging dependency and compiles logging tests, require env var to be set + - name: Showcase integration tests - Logging SLF4J 1.x + working-directory: java-showcase + run: | + mvn clean verify -P '!showcase,enable-integration-tests,loggingTestBase,slf4j1_logback' \ + --batch-mode \ + --no-transfer-progress + # Set the Env Var for this step only + env: + GOOGLE_SDK_JAVA_LOGGING: true + # The `disabledLogging` profile tests logging disabled when logging dependency present, + # do not set env var for this step + - name: Showcase integration tests - Logging disabed + working-directory: java-showcase + run: | + mvn clean verify -P '!showcase,enable-integration-tests,loggingTestBase,disabledLogging' \ + --batch-mode \ + --no-transfer-progress + - name: Showcase integration tests - Protobuf gen code 3.25.8 + working-directory: java-showcase-3.25.8 run: | - go install github.com/google/addlicense@latest - addlicense -c "Google LLC" -l apache -check $(find $PWD -type f -name '*.java' ! -path '**/showcase/**' ! -iname '*PlaceholderFile.java') + mvn verify \ + -P enable-integration-tests \ + --batch-mode \ + --no-transfer-progress + - name: Showcase integration tests - Protobuf gen code 3.21.0 + working-directory: java-showcase-3.21.0 + run: | + mvn verify \ + -P enable-integration-tests \ + --batch-mode \ + --no-transfer-progress + showcase: + runs-on: ubuntu-22.04 + strategy: + matrix: + java: [ 11, 17, 21, 25 ] + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-java@v4 + with: + java-version: ${{ matrix.java }} + distribution: temurin + - run: mvn -version + - name: Install Maven modules + run: | + mvn install -B -ntp -DskipTests -Dclirr.skip -Dcheckstyle.skip -Dfmt.skip + - name: Showcase golden tests + working-directory: java-showcase + run: | + mvn test \ + -P enable-golden-tests \ + --batch-mode \ + --no-transfer-progress + - name: Parse showcase version + working-directory: java-showcase/gapic-showcase + run: echo "SHOWCASE_VERSION=$(mvn help:evaluate -Dexpression=gapic-showcase.version -q -DforceStdout)" >> "$GITHUB_ENV" + - name: Install showcase server + run: | + sudo mkdir -p /usr/src/showcase + sudo chown -R ${USER} /usr/src/ + curl --location https://github.com/googleapis/gapic-showcase/releases/download/v${{env.SHOWCASE_VERSION}}/gapic-showcase-${{env.SHOWCASE_VERSION}}-linux-amd64.tar.gz --output /usr/src/showcase/showcase-${{env.SHOWCASE_VERSION}}-linux-amd64.tar.gz + cd /usr/src/showcase/ + tar -xf showcase-* + ./gapic-showcase run & + cd - + - name: Showcase integration tests + working-directory: java-showcase + run: | + mvn verify \ + -P enable-integration-tests \ + --batch-mode \ + --no-transfer-progress + # The `slf4j2_logback` profile brings logging dependency and compiles logging tests, require env var to be set + - name: Showcase integration tests - Logging SLF4J 2.x + working-directory: java-showcase + run: | + mvn clean verify -P '!showcase,enable-integration-tests,loggingTestBase,slf4j2_logback' \ + --batch-mode \ + --no-transfer-progress + # Set the Env Var for this step only + env: + GOOGLE_SDK_JAVA_LOGGING: true + # The `slf4j1_logback` profile brings logging dependency and compiles logging tests, require env var to be set + - name: Showcase integration tests - Logging SLF4J 1.x + working-directory: java-showcase + run: | + mvn clean verify -P '!showcase,enable-integration-tests,loggingTestBase,slf4j1_logback' \ + --batch-mode \ + --no-transfer-progress + # Set the Env Var for this step only + env: + GOOGLE_SDK_JAVA_LOGGING: true + # The `disabledLogging` profile tests logging disabled when logging dependency present, + # do not set env var for this step + - name: Showcase integration tests - Logging disabed + working-directory: java-showcase + run: | + mvn clean verify -P '!showcase,enable-integration-tests,loggingTestBase,disabledLogging' \ + --batch-mode \ + --no-transfer-progress + - name: Showcase integration tests - Protobuf 3 compatibility with third party library Tensorflow + working-directory: java-showcase + run: | + mvn clean verify -P 'enable-integration-tests,protobuf3,showcase' \ + --batch-mode \ + --no-transfer-progress + showcase-clirr: + if: ${{ github.base_ref != '' }} # Only execute on pull_request trigger event + runs-on: ubuntu-22.04 + steps: + - name: Checkout @ target branch + uses: actions/checkout@v4 + with: + ref: ${{ github.base_ref }} + - uses: actions/setup-java@v4 + with: + java-version: 17 + distribution: temurin + cache: maven + - name: Install sdk-platform-java and showcase to local maven repository + run: | + mvn install -B -ntp -T 1C -DskipTests + cd java-showcase + mvn install -B -ntp -T 1C -DskipTests + SHOWCASE_CLIENT_VERSION=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout) + echo "SHOWCASE_CLIENT_VERSION=$SHOWCASE_CLIENT_VERSION" >> "$GITHUB_ENV" + - name: Checkout sdk-platform-java @ PR merge commit + uses: actions/checkout@v3 + - name: Install sdk-platform-java @ PR merge commit + run: mvn install -B -ntp -T 1C -DskipTests + # Showcase golden test ensures that src changes are already reflected in the PR. + - name: Clirr check + working-directory: java-showcase + run: | + mvn versions:set -B -ntp -DnewVersion=local + mvn clirr:check -B -ntp -DcomparisonVersion=$SHOWCASE_CLIENT_VERSION + + gapic-generator-java-bom: + runs-on: ubuntu-22.04 + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-java@v4 + with: + java-version: 11 + distribution: temurin + cache: maven + - name: Install Maven modules to local Maven repository + run: | + mvn install -B -ntp -DskipTests -Dclirr.skip -Dcheckstyle.skip -Dfmt.skip + - name: Validate gapic-generator-java-bom + uses: googleapis/java-cloud-bom/tests/validate-bom@47ad868794c5d38ee7eb95d69371a7a79f84d890 + with: + bom-path: gapic-generator-java-bom/pom.xml + + unmanaged_dependency_check: + runs-on: ubuntu-22.04 + steps: + - uses: actions/checkout@v4 + with: + ref: ${{ github.event.pull_request.head.sha }} + - uses: actions/setup-java@v4 + with: + java-version: 11 + distribution: temurin + - run: mvn -version + - name: Unit Tests + run: | + mvn test --batch-mode --no-transfer-progress + working-directory: java-shared-dependencies/unmanaged-dependency-check + - name: Install Maven modules + run: | + mvn install -B -ntp -DskipTests -Dclirr.skip -Dcheckstyle.skip -Dfmt.skip + - name: Unmanaged dependency check + uses: ./java-shared-dependencies/unmanaged-dependency-check + with: + bom-path: gapic-generator-java-bom/pom.xml + + dependency_analyzer_unit_test: + runs-on: ubuntu-22.04 + steps: + - uses: actions/checkout@v4 + with: + ref: ${{ github.event.pull_request.head.sha }} + - uses: actions/setup-java@v4 + with: + java-version: 17 + distribution: temurin + - run: mvn -version + - name: Unit Tests + run: | + mvn test --batch-mode --no-transfer-progress + working-directory: java-shared-dependencies/dependency-analyzer diff --git a/.github/workflows/create_additional_release_tag.yaml b/.github/workflows/create_additional_release_tag.yaml new file mode 100644 index 0000000000..939ce1afab --- /dev/null +++ b/.github/workflows/create_additional_release_tag.yaml @@ -0,0 +1,39 @@ +name: Create additional tags for each release + +on: + release: + types: [published] + workflow_dispatch: + +jobs: + build: + runs-on: ubuntu-latest + permissions: + # Permission to create tag + # https://docs.github.com/en/rest/authentication/permissions-required-for-github-apps?apiVersion=2022-11-28#repository-permissions-for-contents + contents: write + steps: + - name: Checkout code + uses: actions/checkout@v4 + with: + token: ${{ secrets.GITHUB_TOKEN }} + - name: Set up Git + run: | + git config --local user.email "action@github.com" + git config --local user.name "GitHub Action" + - name: Fetch all tags + run: git fetch --tags + - name: Create additional tags + shell: bash + run: | + ARTIFACT_IDS=('google-cloud-shared-dependencies' 'api-common' 'gax') + for ARTIFACT_ID in "${ARTIFACT_IDS[@]}"; do + VERSION=$(grep "^${ARTIFACT_ID}:" versions.txt | cut -d':' -f2 | tr -d '[:space:]') + TAG_NAME="${ARTIFACT_ID}/v$VERSION" + if git show-ref --tags | grep -q "refs/tags/$TAG_NAME"; then + echo "Tag $TAG_NAME already exists. Skipping." + continue + fi + git tag $TAG_NAME + git push origin $TAG_NAME + done diff --git a/.github/workflows/dependency_compatibility_test.yaml b/.github/workflows/dependency_compatibility_test.yaml new file mode 100644 index 0000000000..e1b5203fac --- /dev/null +++ b/.github/workflows/dependency_compatibility_test.yaml @@ -0,0 +1,76 @@ +name: Dependency Compatibility Test + +on: + pull_request: + branches: + - 'main' + workflow_dispatch: + inputs: + dependencies-list: + description: 'Comma-separated list of dependencies to test (Example format: protobuf=4.31.0,guava=33.4.8-jre). + Note: The name should be the maven property. Find this value in the section in the pom. + Do not include the `-D` prefix or `.version` suffix. Those values will be appended when generating + the command. No input (default) will run the the upper-bound dependencies file.' + required: false + default: '' + +jobs: + dependency-compatibility-test: + runs-on: ubuntu-latest + permissions: + contents: read + steps: + - name: Checkout sdk-platform-java + uses: actions/checkout@v4 + - name: Set up JDK 21 + uses: actions/setup-java@v4 + with: + java-version: '21' + distribution: 'temurin' + cache: maven + # The workflow_dispatch event is for team members who want to manually test certain dependencies + version combos + # The normal workflow is not from `workflow_dispatch` and will use the default upper-bounds dependencies file + - name: Determine Inputted Dependencies List + if: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.dependencies-list != '' }} + run: echo "DEPENDENCIES_LIST=${{ github.event.inputs.dependencies-list }}" >> $GITHUB_ENV + + # Run in the root module which should test for everything except for showcase + - name: Perform Dependency Compatibility Unit Testing + shell: bash + run: | + if [[ -n "${{ env.DEPENDENCIES_LIST }}" ]]; then + ./.github/scripts/test_dependency_compatibility.sh -l ${{ env.DEPENDENCIES_LIST }} + else + ./.github/scripts/test_dependency_compatibility.sh + fi + + # Install the modules for showcase (Shared-Deps is required to run showcase) + - name: Install sdk-platform-java's modules + # gapic-generator-java requires Java 8 and is irrelevant for this CI + run: mvn -q -B -ntp install --projects '!gapic-generator-java' -Dcheckstyle.skip -Dfmt.skip -DskipTests -Dclirr.skip -T 1C + + # Set up local showcase server to run the showcase ITs + - name: Parse showcase version + working-directory: java-showcase/gapic-showcase + run: echo "SHOWCASE_VERSION=$(mvn help:evaluate -Dexpression=gapic-showcase.version -q -DforceStdout)" >> "$GITHUB_ENV" + - name: Install showcase server + run: | + sudo mkdir -p /usr/src/showcase + sudo chown -R ${USER} /usr/src/ + curl --location https://github.com/googleapis/gapic-showcase/releases/download/v${{env.SHOWCASE_VERSION}}/gapic-showcase-${{env.SHOWCASE_VERSION}}-linux-amd64.tar.gz --output /usr/src/showcase/showcase-${{env.SHOWCASE_VERSION}}-linux-amd64.tar.gz + cd /usr/src/showcase/ + tar -xf showcase-* + ./gapic-showcase run & + cd - + + # Run Showcase's Integration Tests + - name: Perform Dependency Compatibility Integration Testing (Showcase Tests) + shell: bash + # Need to cd out of the directory to get the scripts as this step is run inside the java-showcase directory + run: | + if [[ -n "${{ env.DEPENDENCIES_LIST }}" ]]; then + ../.github/scripts/test_dependency_compatibility.sh -l ${{ env.DEPENDENCIES_LIST }} + else + ../.github/scripts/test_dependency_compatibility.sh -f ../dependencies.txt + fi + working-directory: java-showcase diff --git a/.github/workflows/downstream-native-image.yaml b/.github/workflows/downstream-native-image.yaml deleted file mode 100644 index 5e0b4431ca..0000000000 --- a/.github/workflows/downstream-native-image.yaml +++ /dev/null @@ -1,41 +0,0 @@ -on: - push: - branches: - - main - pull_request: - -# Keeping this file separate as the dependencies check would use more -# repositories than needed this downstream check for GraalVM native image -# compilation. -name: downstream -jobs: - # GraalVM job ensures the compatibility of GraaVM version - graalvm: - runs-on: ubuntu-latest - strategy: - fail-fast: false - matrix: - graalvm: [22.3.0] - java: [11, 17] - repo: - # GAPIC library that doesn't use a real GCP project in integration tests - - orgpolicy - steps: - - uses: actions/checkout@v2 - - uses: stCarolas/setup-maven@v4 - with: - maven-version: 3.8.1 - - uses: ayltai/setup-graalvm@v1 - with: - java-version: ${{matrix.java}} - # When a new version of native-maven-plugin fails to run in a downstream - # library, it's likely to be an incompatibility with the GraalVM version. - # In that case, you need to upgrade the Docker container used in the - # tests in the downstream repositories (not just this value below). - # Example: https://github.com/googleapis/testing-infra-docker/pull/195 - graalvm-version: ${{matrix.graalvm}} - native-image: true - - run: java -version - - run: sudo apt-get update -y - - run: sudo apt-get install libxml2-utils - - run: .kokoro/downstream-client-library-check.sh ${{matrix.repo}} graalvm diff --git a/.github/workflows/downstream.yaml b/.github/workflows/downstream.yaml new file mode 100644 index 0000000000..aecfda5b77 --- /dev/null +++ b/.github/workflows/downstream.yaml @@ -0,0 +1,59 @@ +on: + pull_request: + # Changes to these directories do not directly affect the downstream libraries + paths-ignore: + - gapic-generator-java/** + - library_generation/** + - showcase/** + - test/** + +name: Downstream Check +jobs: + downstream-compatibility: + runs-on: ubuntu-22.04 + strategy: + fail-fast: false + matrix: + repo: + - google-cloud-java + - java-bigtable + - java-bigquery + - java-firestore + - java-pubsub + - java-pubsublite + - java-spanner-jdbc + - java-spanner + - java-storage + - java-storage-nio + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-java@v3 + with: + java-version: 17 + distribution: temurin + - run: mvn -version + - name: Install xmllint + run: | + sudo apt-get update + sudo apt-get -y install libxml2-utils + - name: Test helper scripts + run: ./.kokoro/presubmit/common_test.sh + - name: Perform downstream compatibility testing + run: REPOS_UNDER_TEST="${{ matrix.repo }}" ./.kokoro/presubmit/downstream-compatibility.sh + downstream-compatibility-spring-generator: + runs-on: ubuntu-22.04 + strategy: + fail-fast: false + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-java@v3 + with: + java-version: 17 + distribution: temurin + - run: mvn -version + - name: Install xmllint + run: | + sudo apt-get update + sudo apt-get -y install libxml2-utils + - name: Perform downstream compatibility testing + run: ./.kokoro/presubmit/downstream-compatibility-spring.sh diff --git a/.github/workflows/downstream_protobuf_compatibility_check_nightly.yaml b/.github/workflows/downstream_protobuf_compatibility_check_nightly.yaml new file mode 100644 index 0000000000..f3d70c1f7b --- /dev/null +++ b/.github/workflows/downstream_protobuf_compatibility_check_nightly.yaml @@ -0,0 +1,65 @@ +on: + pull_request: + # Runs on PRs targeting main, but will be filtered for Release PRs + branches: + - 'main' + workflow_dispatch: + inputs: + protobuf_runtime_versions: + description: 'Comma separated list of Protobuf-Java versions (i.e. "3.25.x","4.x.y"). + Note: Surround each version in the list with quotes ("")' + required: true + schedule: + - cron: '0 1 * * *' # Nightly at 1am + +name: Downstream Protobuf Compatibility Check Nightly +jobs: + downstream-protobuf-test: + # This job runs if any of the three conditions match: + # 1. PR is raised from Release-Please (PR comes from branch: release-please--branches-main) + # 2. Job is invoked by the nightly job (scheduled event) + # 3. Job is manually invoked via Github UI (workflow_dispatch event) + if: github.head_ref == 'release-please--branches--main' || github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' + runs-on: ubuntu-22.04 + strategy: + fail-fast: false + matrix: + repo: + - google-cloud-java + - java-bigtable + - java-bigquery + - java-bigquerystorage + - java-datastore + - java-firestore + - java-logging + - java-logging-logback + - java-pubsub + - java-pubsublite + - java-spanner-jdbc + - java-spanner + - java-storage + - java-storage-nio + # Default Protobuf-Java versions to use are specified here. Without this, the nightly workflow won't know + # which values to use and would resolve to ''. + protobuf-version: ${{ fromJSON(format('[{0}]', inputs.protobuf_runtime_versions || '"4.33.5"')) }} + steps: + - name: Checkout sdk-platform-java repo + uses: actions/checkout@v4 + - uses: actions/setup-java@v4 + with: + java-version: 8 + distribution: temurin + - run: echo "JAVA8_HOME=${JAVA_HOME}" >> $GITHUB_ENV + # Java Client Libraries are compiled with Java 11 and target Java 8. Java 11 is required because GraalVM + # minimum support is for Java 11. + - uses: actions/setup-java@v4 + with: + java-version: 11 + distribution: temurin + - name: Print Protobuf-Java testing version + run: echo "Testing with Protobuf-Java v${{ matrix.protobuf-version }}" + - name: Perform downstream source compatibility testing + run: REPOS_UNDER_TEST="${{ matrix.repo }}" PROTOBUF_RUNTIME_VERSION="${{ matrix.protobuf-version }}" ./.kokoro/nightly/downstream-protobuf-source-compatibility.sh + - name: Perform downstream binary compatibility testing + run: REPOS_UNDER_TEST="${{ matrix.repo }}" PROTOBUF_RUNTIME_VERSION="${{ matrix.protobuf-version }}" ./.kokoro/nightly/downstream-protobuf-binary-compatibility.sh + diff --git a/.github/workflows/downstream_unmanaged_dependency_check.yaml b/.github/workflows/downstream_unmanaged_dependency_check.yaml new file mode 100644 index 0000000000..a3886cc81c --- /dev/null +++ b/.github/workflows/downstream_unmanaged_dependency_check.yaml @@ -0,0 +1,80 @@ +on: + push: + branches: + - main + pull_request: + paths: + - .github/workflows/downstream_unmanaged_dependency_check.yaml + - java-shared-dependencies/** + +name: Downstream Unmanaged Dependency Check +jobs: + validate: + runs-on: ubuntu-22.04 + strategy: + fail-fast: false + matrix: + repo: + - java-bigtable + - java-firestore + - java-logging + steps: + - name: Checkout sdk-platform-java + uses: actions/checkout@v3 + with: + path: sdk-platform-java + - name: Checkout the downstream repo + uses: actions/checkout@v4 + with: + repository: googleapis/${{ matrix.repo }} + path: ${{ matrix.repo }} + - name: Check the environment + shell: bash + run: | + set -euxo pipefail + pwd + ls -alt + - uses: actions/setup-java@v3 + with: + java-version: 11 + distribution: temurin + cache: maven + - name: Install the modules of sdk-platform-java + shell: bash + working-directory: sdk-platform-java + run: | + set -euo pipefail + # gapic-generator-java is irrelevant + mvn -q -B -ntp install --projects '!gapic-generator-java' \ + -Dcheckstyle.skip -Dfmt.skip -DskipTests -T 1C + - name: Build unmanaged dependency check + shell: bash + working-directory: sdk-platform-java/java-shared-dependencies/unmanaged-dependency-check + run: | + set -euo pipefail + echo "Install Unmanaged Dependency Check in $(pwd)" + mvn clean install -V --batch-mode --no-transfer-progress -DskipTests + - name: Install the modules of the downstream repository + shell: bash + working-directory: ${{ matrix.repo }} + run: | + # No argument to build.sh installs the modules in local Maven repository + .kokoro/build.sh + - name: Run unmanaged dependency check + shell: bash + run: | + set -euo pipefail + set -x + # java-bigtable has "-deps-bom" that declares its dependencies. It's not a good + # BOM to list the artifacts generated by that repository. + bom_dir=$(find ${{ matrix.repo }} -type d -name 'google-*-bom' ! -name '*-deps-bom') + bom_absolute_path=$(realpath "${bom_dir}/pom.xml") + cd sdk-platform-java/java-shared-dependencies/unmanaged-dependency-check + echo "Running Unmanaged Dependency Check against ${bom_absolute_path}" + unmanaged_dependencies=$(mvn exec:java -Dexec.args="../pom.xml ${bom_absolute_path}" -q) + if [[ "${unmanaged_dependencies}" != "[]" ]]; then + echo "With this change, the unmanaged dependencies check installed in ${{ matrix.repo }} will start to" + echo "fail due to ${unmanaged_dependencies}, among the artifacts listed in ${bom_absolute_path}." + exit 1 + fi + echo "Unmanaged dependency check passed" diff --git a/.github/workflows/hermetic_library_generation.yaml b/.github/workflows/hermetic_library_generation.yaml new file mode 100644 index 0000000000..517cb085ba --- /dev/null +++ b/.github/workflows/hermetic_library_generation.yaml @@ -0,0 +1,65 @@ +# 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: Hermetic library generation upon generation config change through pull requests +on: + pull_request: + +env: + REPO_FULL_NAME: ${{ github.event.pull_request.head.repo.full_name }} + GITHUB_REPOSITORY: ${{ github.repository }} +jobs: + library_generation: + runs-on: ubuntu-latest + steps: + - name: Determine whether the pull request comes from a fork + run: | + if [[ "${GITHUB_REPOSITORY}" != "${REPO_FULL_NAME}" ]]; then + echo "This PR comes from a fork. Skip library generation." + echo "SHOULD_RUN=false" >> $GITHUB_ENV + else + echo "SHOULD_RUN=true" >> $GITHUB_ENV + fi + - uses: actions/checkout@v4 + if: env.SHOULD_RUN == 'true' + with: + fetch-depth: 0 + token: ${{ secrets.CLOUD_JAVA_BOT_GITHUB_TOKEN }} + - name: Install Maven modules + if: env.SHOULD_RUN == 'true' + shell: bash + run: | + git checkout "${HEAD_REF}" + mvn install -B -ntp -DskipTests -Dclirr.skip -Dcheckstyle.skip + env: + HEAD_REF: ${{ github.head_ref }} + - name: Build image + if: env.SHOULD_RUN == 'true' + shell: bash + run: | + GENERATOR_VERSION=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout -pl gapic-generator-java) + echo "GENERATOR_VERSION=${GENERATOR_VERSION}" >> "$GITHUB_ENV" + DOCKER_BUILDKIT=1 docker build \ + -f .cloudbuild/library_generation/library_generation.Dockerfile \ + -t gcr.io/cloud-devrel-public-resources/java-library-generation:"${GENERATOR_VERSION}" \ + . + - uses: ./.github/scripts + if: env.SHOULD_RUN == 'true' + with: + base_ref: ${{ github.base_ref }} + head_ref: ${{ github.head_ref }} + image_tag: ${{ env.GENERATOR_VERSION }} + token: ${{ secrets.CLOUD_JAVA_BOT_GITHUB_TOKEN }} + showcase_mode: true diff --git a/.github/workflows/java_compatibility_check.yaml b/.github/workflows/java_compatibility_check.yaml new file mode 100644 index 0000000000..f7ab2ddffa --- /dev/null +++ b/.github/workflows/java_compatibility_check.yaml @@ -0,0 +1,46 @@ +# 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: Java 8 compatibility check +jobs: + java8-compatibility-check: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-java@v4 + with: + java-version: 17 + distribution: temurin + cache: maven + - name: Install Maven modules to local Maven repository + run: | + mvn install -B -ntp -T 1C -DskipTests -Dclirr.skip -Dcheckstyle.skip -Denforcer.skip + - name: Check Java 8 compatibility for class files + shell: bash + run: | + find . -type f -name "*.class" -path "*/classes/*" \ + -not -path "*/grpc-*/*" \ + -not -path "*/proto-*/*" \ + -not -path "*/gapic-generator-java/*" -print |\ + while IFS= read -r class_file; do + version=$(javap -v "${class_file}" | grep "major version" | cut -d ' ' -f 5) + if [[ "${version}" != "52" ]]; then + echo "${class_file} is not compatible with Java 8." + exit 1 + fi + done + echo "All class files are compatible with Java 8." \ No newline at end of file diff --git a/.github/workflows/nightly.yaml b/.github/workflows/nightly.yaml new file mode 100644 index 0000000000..326043b37e --- /dev/null +++ b/.github/workflows/nightly.yaml @@ -0,0 +1,69 @@ +name: Nightly +on: + workflow_dispatch: + schedule: + - cron: '0 1 * * *' # Nightly at 1am +defaults: + run: + shell: bash +jobs: + nightly: + strategy: + fail-fast: false + matrix: + os: [ macos-15-intel, ubuntu-22.04, windows-2022 ] + java: [ 11, 17 ] + runs-on: ${{ matrix.os }} + steps: + - run: git config --global core.longpaths true + - uses: actions/checkout@v4 + - uses: actions/setup-java@v5 + with: + java-version: ${{ matrix.java }} + distribution: temurin + cache: maven + - run: mvn -version + - name: Install + run: mvn install --errors --batch-mode --no-transfer-progress -Dcheckstyle.skip -Dfmt.skip + - name: Create issue if previous step fails + if: ${{ failure() }} + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + gh issue create \ + --title "Nightly build for Java ${{ matrix.java }} on ${{ matrix.os }} failed." \ + --body "The build has failed : https://github.com/googleapis/gapic-generator-java/actions/runs/${GITHUB_RUN_ID}" + nightly-java8: # Compile with JDK 11. Run tests with JDK 8. + strategy: + fail-fast: false + matrix: + os: [ macos-15-intel, ubuntu-22.04, windows-2022 ] + runs-on: ${{ matrix.os }} + steps: + - run: git config --global core.longpaths true + - uses: actions/checkout@v4 + - uses: actions/setup-java@v5 + with: + java-version: 11 + distribution: temurin + cache: maven + - run: mvn -version + - name: Install with Java 11 + run: mvn install --errors --batch-mode --no-transfer-progress -Dcheckstyle.skip -DskipTests -Dfmt.skip + + - uses: actions/setup-java@v5 + with: + java-version: 8 + distribution: temurin + - run: mvn -version + - name: Test with Java 8 + # Direct goal invocation ("surefire:test") prevents recompiling tests + run: mvn surefire:test --errors --batch-mode --no-transfer-progress -Dfmt.skip + - name: Create issue if previous step fails + if: ${{ failure() }} + env: + GITHUB_TOKEN: ${{ secrets.CLOUD_JAVA_BOT_GITHUB_TOKEN }} + run: | + gh issue create \ + --title "Nightly-java8 build on ${{ matrix.os }} failed." \ + --body "The build has failed : https://github.com/googleapis/gapic-generator-java/actions/runs/${GITHUB_RUN_ID}" diff --git a/.github/workflows/renovate_config_check.yaml b/.github/workflows/renovate_config_check.yaml new file mode 100644 index 0000000000..236beaf99d --- /dev/null +++ b/.github/workflows/renovate_config_check.yaml @@ -0,0 +1,25 @@ +name: Renovate Bot Config Validation + +on: + pull_request: + paths: + - 'renovate.json' + +jobs: + config_validation: + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Set up Node.js + uses: actions/setup-node@v3 + with: + node-version: '20' + + - name: Install Renovate and Config Validator + run: | + npm install -g npm@latest + npm install --global renovate + renovate-config-validator \ No newline at end of file diff --git a/.github/workflows/shared_dependencies.yaml b/.github/workflows/shared_dependencies.yaml new file mode 100644 index 0000000000..6fedbf7984 --- /dev/null +++ b/.github/workflows/shared_dependencies.yaml @@ -0,0 +1,28 @@ +on: + push: + branches: + - main + pull_request: + paths: + - 'gapic-generator-java-bom/**' + - 'gapic-generator-java-pom-parent/**' + - 'java-shared-dependencies/**' +name: shared-dependencies version check +jobs: + upper-bound-check: + name: Shared Dependencies BOM upper-bound check + runs-on: ubuntu-latest + if: github.repository_owner == 'googleapis' + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-java@v4 + with: + distribution: temurin + java-version: 17 + - run: java -version + - name: Install maven modules + run: | + mvn install -B -ntp -DskipTests -Dclirr.skip -Dcheckstyle.skip + - name: Check the BOM content satisfies the upper-bound-check test case + run: mvn -B -V -ntp verify -Dcheckstyle.skip + working-directory: java-shared-dependencies/upper-bound-check \ No newline at end of file diff --git a/.github/workflows/sonar.yaml b/.github/workflows/sonar.yaml index fb9455e2bb..8506645705 100644 --- a/.github/workflows/sonar.yaml +++ b/.github/workflows/sonar.yaml @@ -8,15 +8,16 @@ on: jobs: build: name: Build - runs-on: ubuntu-latest + if: github.event.pull_request.head.repo.full_name == github.repository || github.event_name != 'pull_request' + runs-on: ubuntu-22.04 steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 with: fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis - - name: Set up JDK 11 + - name: Set up JDK 17 uses: actions/setup-java@v3 with: - java-version: 11 + java-version: 17 distribution: temurin - name: Cache SonarCloud packages uses: actions/cache@v3 @@ -30,14 +31,50 @@ jobs: path: ~/.m2 key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }} restore-keys: ${{ runner.os }}-m2 - - name: Build and analyze + - name: Install modules to local maven + run: | + mvn install -T 1C -DskipTests -ntp -B + cd java-showcase + mvn install -T 1C -DskipTests -ntp -B + - name: Parse showcase version + working-directory: java-showcase/gapic-showcase + run: echo "SHOWCASE_VERSION=$(mvn help:evaluate -Dexpression=gapic-showcase.version -q -DforceStdout)" >> "$GITHUB_ENV" + - name: Install showcase server + run: | + sudo mkdir -p /usr/src/showcase + sudo chown -R ${USER} /usr/src/ + curl --location https://github.com/googleapis/gapic-showcase/releases/download/v${{env.SHOWCASE_VERSION}}/gapic-showcase-${{env.SHOWCASE_VERSION}}-linux-amd64.tar.gz --output /usr/src/showcase/showcase-${{env.SHOWCASE_VERSION}}-linux-amd64.tar.gz + cd /usr/src/showcase/ + tar -xf showcase-* + ./gapic-showcase run & + cd - + # Intentionally do not run the Env Var Tests (no -PenvVarTests) as setting the Env Var + # may alter the results for other tests that use Env Var in the logic. Adding a Sonar + # step for a few tests (env var tests) may be overkill and should be better covered + # when we can upgrade to JUnit 5 (https://github.com/googleapis/sdk-platform-java/issues/1611#issuecomment-1970079325) + - name: Build and analyze for full test coverage env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} run: | mvn -B verify -Dcheckstyle.skip \ + -DenableFullTestCoverage \ + -Penable-integration-tests \ org.sonarsource.scanner.maven:sonar-maven-plugin:sonar \ -Dsonar.projectKey=googleapis_gapic-generator-java \ -Dsonar.organization=googleapis \ -Dsonar.host.url=https://sonarcloud.io - + - name: Build and analyze Showcase Integration Tests Coverage + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any + SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} + run: | + mvn -B clean verify -Dcheckstyle.skip \ + -DskipUnitTests \ + -Penable-integration-tests \ + -DenableShowcaseTestCoverage \ + org.sonarsource.scanner.maven:sonar-maven-plugin:sonar \ + -Dsonar.projectKey=googleapis_gapic-generator-java_integration_tests \ + -Dsonar.organization=googleapis \ + -Dsonar.host.url=https://sonarcloud.io \ + -Dsonar.projectName=java_showcase_integration_tests diff --git a/.github/workflows/update_googleapis_commit.yaml b/.github/workflows/update_googleapis_commit.yaml new file mode 100644 index 0000000000..83d7a206e0 --- /dev/null +++ b/.github/workflows/update_googleapis_commit.yaml @@ -0,0 +1,43 @@ +# 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 googleapis commit +on: + schedule: + - cron: '0 2 * * *' + workflow_dispatch: + +jobs: + update-googleapis-commit: + runs-on: ubuntu-22.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_GITHUB_TOKEN }} + - name: Update googleapis commit 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_googleapis_commit.sh \ + --base_branch "${base_branch}"\ + --repo ${{ github.repository }} + env: + GH_TOKEN: ${{ secrets.CLOUD_JAVA_BOT_GITHUB_TOKEN }} diff --git a/.github/workflows/verify_library_generation.yaml b/.github/workflows/verify_library_generation.yaml new file mode 100644 index 0000000000..93b8409d39 --- /dev/null +++ b/.github/workflows/verify_library_generation.yaml @@ -0,0 +1,108 @@ +on: + pull_request: + +name: verify_library_generation +jobs: + should-run-library-generation-tests: + runs-on: ubuntu-22.04 + outputs: + should_run: ${{ steps.get_changed_directories.outputs.should_run }} + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + - name: get changed directories in the pull request + id: get_changed_directories + shell: bash + run: | + set -ex + # PRs that come from a fork need to be handled differently + if [[ ${head_repo_name} == ${base_repo} ]]; then + git checkout ${base_ref} + git checkout ${head_ref} + changed_directories="$(git diff --name-only ${base_ref} ${head_ref})" + else + git remote add fork ${head_repo_url} + git fetch fork # create a mapping of the fork + git checkout -b "${head_ref}" fork/${head_ref} + changed_directories="$(git diff --name-only "fork/${head_ref}" "origin/${base_ref}")" + fi + if [[ ${changed_directories} =~ "hermetic_build/" ]] || [[ ${changed_directories} =~ ".cloudbuild/library_generation/" ]]; then + echo "should_run=true" >> $GITHUB_OUTPUT + else + echo "should_run=false" >> $GITHUB_OUTPUT + fi + env: + base_ref: ${{ github.event.pull_request.base.ref }} + head_ref: ${{ github.event.pull_request.head.ref }} + head_repo_url: ${{ github.event.pull_request.head.repo.html_url }} + head_repo_name: ${{ github.event.pull_request.head.repo.full_name }} + base_repo: ${{ github.repository }} + library-generation-unit-tests: + runs-on: ubuntu-22.04 + needs: should-run-library-generation-tests + if: needs.should-run-library-generation-tests.outputs.should_run == 'true' + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-python@v5 + with: + python-version: 3.12 + - name: install python modules and dependencies + shell: bash + run: | + set -ex + pip install --upgrade pip + pip install --require-hashes -r hermetic_build/common/requirements.txt + pip install hermetic_build/common + pip install --require-hashes -r hermetic_build/library_generation/requirements.txt + pip install hermetic_build/library_generation + pip install --require-hashes -r hermetic_build/release_note_generation/requirements.txt + pip install hermetic_build/release_note_generation + - name: Run shell unit tests + run: | + set -x + hermetic_build/library_generation/tests/generate_library_unit_tests.sh + - name: Run python unit tests + run: | + set -x + python -m unittest discover -s hermetic_build -p "*unit_tests.py" + library-generation-lint-shell: + runs-on: ubuntu-22.04 + needs: should-run-library-generation-tests + if: needs.should-run-library-generation-tests.outputs.should_run == 'true' + steps: + - uses: actions/checkout@v4 + - name: Run ShellCheck + uses: ludeeus/action-shellcheck@2.0.0 + with: + scandir: 'hermetic_build' + format: tty + severity: error + ignore_paths: + .kokoro + library-generation-lint-python: + runs-on: ubuntu-22.04 + needs: should-run-library-generation-tests + if: needs.should-run-library-generation-tests.outputs.should_run == 'true' + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-python@v5 + with: + python-version: 3.12 + - name: install python dependencies + shell: bash + run: | + set -ex + pip install --upgrade pip + pip install --require-hashes -r hermetic_build/common/requirements.txt + pip install hermetic_build/common + pip install --require-hashes -r hermetic_build/library_generation/requirements.txt + pip install hermetic_build/library_generation + pip install --require-hashes -r hermetic_build/release_note_generation/requirements.txt + pip install hermetic_build/release_note_generation + - name: Lint + shell: bash + run: | + # exclude generated golden files + # exclude owlbot until further refaction + black --check hermetic_build --exclude "(library_generation/tests/resources/goldens)" diff --git a/.gitignore b/.gitignore index 447d437087..1f5d6bd388 100644 --- a/.gitignore +++ b/.gitignore @@ -13,4 +13,17 @@ target/ *.vim # Vscode Settings -.vscode/settings.json +.vscode + +# Python +**/__pycache__/ +.venv +.python-version + +# library generation +**/googleapis +**/*egg-info/ +**/build/ +**/dist/ +library_generation/**/*.jar +**/google-java-format.jar diff --git a/.kokoro/common.cfg b/.kokoro/common.cfg index 429933c8a9..cc0fc577f9 100644 --- a/.kokoro/common.cfg +++ b/.kokoro/common.cfg @@ -5,9 +5,3 @@ gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/trampoline" # All builds use the trampoline script to run in docker. build_file: "gapic-generator-java/.kokoro/trampoline.sh" - -# Tell the trampoline which build file to use. -env_vars: { - key: "TRAMPOLINE_BUILD_FILE" - value: "github/gapic-generator-java/.kokoro/build.sh" -} diff --git a/.kokoro/downstream-client-library-check.sh b/.kokoro/downstream-client-library-check.sh deleted file mode 100755 index 12d87d3b9b..0000000000 --- a/.kokoro/downstream-client-library-check.sh +++ /dev/null @@ -1,100 +0,0 @@ -#!/bin/bash -# 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. - -set -eo pipefail -# Display commands being run. -set -x - -CLIENT_LIBRARY=$1 - -# Example JOB_TYPE: "test" or "graalvm" -export JOB_TYPE=$2 -## 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}"/.. - -# Round 1 -# Publish gax to local maven to make it available for downstream libraries -mvn -B -ntp install --projects '!gapic-generator-java' \ - -Dcheckstyle.skip -Dfmt.skip -DskipTests - -# Read current gax version -GAX_VERSION=$( sed -e 's/xmlns=".*"//' gax-java/pom.xml | xmllint --xpath '/project/version/text()' - ) - -# Round 2 -# Run this gax-java against HEAD of java-shared dependencies - -git clone "https://github.com/googleapis/java-shared-dependencies.git" --depth=1 -pushd java-shared-dependencies/first-party-dependencies - -# replace version -xmllint --shell pom.xml << EOF -setns x=http://maven.apache.org/POM/4.0.0 -cd .//x:artifactId[text()="gax-bom"] -cd ../x:version -set ${GAX_VERSION} -cd ../.. -cd .//x:artifactId[text()="gax-grpc"] -cd ../x:version -set ${GAX_VERSION} -save pom.xml -EOF - -cd .. -mvn verify install -B -V -ntp -fae \ --DskipTests=true \ --Dmaven.javadoc.skip=true \ --Dgcloud.download.skip=true \ --Denforcer.skip=true - -# Namespace (xmlns) prevents xmllint from specifying tag names in XPath -SHARED_DEPS_VERSION=$( sed -e 's/xmlns=".*"//' pom.xml | xmllint --xpath '/project/version/text()' - ) - -if [ -z "${SHARED_DEPS_VERSION}" ]; then - echo "Version is not found in pom.xml" - exit 1 -fi - -# Round 3 -# Run this shared-dependencies BOM against java client libraries -git clone "https://github.com/googleapis/java-${CLIENT_LIBRARY}.git" --depth=1 -pushd java-"${CLIENT_LIBRARY}" - -if [[ $CLIENT_LIBRARY == "bigtable" ]]; then - pushd google-cloud-bigtable-deps-bom -fi - -# replace version -xmllint --shell pom.xml << EOF -setns x=http://maven.apache.org/POM/4.0.0 -cd .//x:artifactId[text()="google-cloud-shared-dependencies"] -cd ../x:version -set ${SHARED_DEPS_VERSION} -save pom.xml -EOF - -if [[ $CLIENT_LIBRARY == "bigtable" ]]; then - popd -fi - -echo "Modification on the shared dependencies BOM:" -git diff -echo - -export INTEGRATION_TEST_ARGS="-Denforcer.skip=true" - -# This reads the JOB_TYPE environmental variable ("test" or "graalvm") -.kokoro/build.sh diff --git a/.kokoro/nightly/common.sh b/.kokoro/nightly/common.sh new file mode 100644 index 0000000000..589ee00bfb --- /dev/null +++ b/.kokoro/nightly/common.sh @@ -0,0 +1,37 @@ +#!/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 +# +# 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. + +# For google-cloud-java, only test specific handwritten libraries included in the monorepo. This is to +# help speed up the execution as building the entire repo is an expensive operation. Specify the nested +# `google-cloud-*` path (except for grafeas as it doesn't have one) because maven -pl will only build the +# specified folder (i.e. parent folder) and ignore all the related sub-modules inside +google_cloud_java_handwritten_maven_args="java-grafeas,java-vertexai/google-cloud-vertexai,java-resourcemanager/google-cloud-resourcemanager,java-translate/google-cloud-translate" + +# Checks that the protobuf compatibility scripts provide non-empty input +function validate_protobuf_compatibility_script_inputs { + # Comma-delimited list of repos to test + if [ -z "${REPOS_UNDER_TEST}" ]; then + echo "REPOS_UNDER_TEST Env Var must be set. This script expects a" + echo "comma-delimited list: i.e REPOS_UNDER_TEST=\"java-bigtable,java-bigquery\"" + exit 1 + fi + + # A single version of Protobuf-Java runtime to test + if [ -z "${PROTOBUF_RUNTIME_VERSION}" ]; then + echo "PROTOBUF_RUNTIME_VERSION Env Var must be set. This script expects a single " + echo "Protobuf-Java runtime version i.e. PROTOBUF_RUNTIME_VERSION=\"4.28.3\"" + exit 1 + fi +} \ No newline at end of file diff --git a/.kokoro/nightly/downstream-protobuf-binary-compatibility.sh b/.kokoro/nightly/downstream-protobuf-binary-compatibility.sh new file mode 100755 index 0000000000..5877eb614c --- /dev/null +++ b/.kokoro/nightly/downstream-protobuf-binary-compatibility.sh @@ -0,0 +1,105 @@ +#!/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 +# +# 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 + +scriptDir=$(realpath "$(dirname "${BASH_SOURCE[0]}")") +source "${scriptDir}/common.sh" + +validate_protobuf_compatibility_script_inputs + +# Declare a map of downstream handwritten libraries and the relevant artifacts to test. The map stores a +# K/V pairing of (Key: repo name, Value: comma separate list of Group ID:Artifact ID pairings). Note: The +# value list doesn't hold the version and this needs to be parsed from the repo's versions.txt file +declare -A repo_linkage_checker_arguments +repo_linkage_checker_arguments["google-cloud-java"]="io.grafeas:grafeas,com.google.cloud:google-cloud-vertexai,com.google.cloud:google-cloud-resourcemanager,com.google.cloud:google-cloud-translate,com.google.api.grpc:grpc-google-cloud-vertexai-v1,com.google.api.grpc:grpc-google-cloud-vertexai-v1beta1,com.google.api.grpc:grpc-google-cloud-resourcemanager-v3,com.google.api.grpc:grpc-google-cloud-translate-v3,com.google.api.grpc:grpc-google-cloud-translate-v3beta1" +repo_linkage_checker_arguments["java-bigtable"]="com.google.cloud:google-cloud-bigtable,com.google.api.grpc:grpc-google-cloud-bigtable-admin-v2,com.google.api.grpc:grpc-google-cloud-bigtable-v2" +repo_linkage_checker_arguments["java-bigquery"]="com.google.cloud:google-cloud-bigquery" +repo_linkage_checker_arguments["java-bigquerystorage"]="com.google.cloud:google-cloud-bigquerystorage,com.google.api.grpc:grpc-google-cloud-bigquerystorage-v1beta1,com.google.api.grpc:grpc-google-cloud-bigquerystorage-v1beta2,com.google.api.grpc:grpc-google-cloud-bigquerystorage-v1,com.google.api.grpc:grpc-google-cloud-bigquerystorage-v1alpha" +repo_linkage_checker_arguments["java-datastore"]="com.google.cloud:google-cloud-datastore,com.google.cloud.datastre:datastore-v1-proto-client,com.google.api.grpc:grpc-google-cloud-datastore-admin-v1" +repo_linkage_checker_arguments["java-firestore"]="com.google.cloud:google-cloud-firestore,com.google.cloud:google-cloud-firestore-admin,com.google.api.grpc:grpc-google-cloud-firestore-admin-v1,com.google.api.grpc:grpc-google-cloud-firestore-v1" +repo_linkage_checker_arguments["java-logging"]="com.google.cloud:google-cloud-logging,com.google.api.grpc:grpc-google-cloud-logging-v2" +repo_linkage_checker_arguments["java-logging-logback"]="com.google.cloud:google-cloud-logging-logback" +repo_linkage_checker_arguments["java-pubsub"]="com.google.cloud:google-cloud-pubsub,com.google.api.grpc:grpc-google-cloud-pubsub-v1" +repo_linkage_checker_arguments["java-pubsublite"]="com.google.cloud:google-cloud-pubsublite,com.google.api.grpc:grpc-google-cloud-pubsublite-v1" +repo_linkage_checker_arguments["java-spanner-jdbc"]="com.google.cloud:google-cloud-spanner-jdbc" +repo_linkage_checker_arguments["java-spanner"]="com.google.cloud:google-cloud-spanner,com.google.cloud:google-cloud-spanner-executor,com.google.api.grpc:grpc-google-cloud-spanner-v1,com.google.api.grpc:grpc-google-cloud-spanner-admin-instance-v1,com.google.api.grpc:grpc-google-cloud-spanner-admin-database-v1,com.google.api.grpc:grpc-google-cloud-spanner-executor-v1" +repo_linkage_checker_arguments["java-storage"]="com.google.cloud:google-cloud-storage,com.google.api.grpc:gapic-google-cloud-storage-v2,com.google.api.grpc:grpc-google-cloud-storage-v2,com.google.cloud:google-cloud-storage-control,com.google.api.grpc:grpc-google-cloud-storage-control-v2" +repo_linkage_checker_arguments["java-storage-nio"]="com.google.cloud:google-cloud-nio" + +# This function requires access to the versions.txt to retrieve the versions for the artifacts +# It will try to match the artifact_id in the versions.txt file and attach it to form the GAV +# The GAV list is required by Linkage Checker as program arguments +function build_program_arguments() { + artifact_list="${repo_linkage_checker_arguments[$1]}" + + for artifact in ${artifact_list//,/ }; do # Split on comma + artifact_id=$(echo "${artifact}" | cut -d ':' -f2) + + # The grep query tries to match `{artifact_id}:{released_version}:{current_version}`. + # The artifact_id must be exact otherwise multiple entries may match + version=$(cat "versions.txt" | grep -E "^${artifact_id}:.*:.*$" | cut -d ':' -f3) + repo_gav_coordinate="${artifact}:${version}" + + # The first entry added is not separated with a comma. Avoids generating `,{ARTIFACT_LIST}` + if [ -z "${linkage_checker_arguments}" ]; then + linkage_checker_arguments="${repo_gav_coordinate}" + else + linkage_checker_arguments="${linkage_checker_arguments},${repo_gav_coordinate}" + fi + done +} + +# TODO(https://github.com/GoogleCloudPlatform/cloud-opensource-java/issues/2395): Java 17+ support for Linkage Checker +# cloud-opensource-java contains the Linkage Checker tool +git clone https://github.com/GoogleCloudPlatform/cloud-opensource-java.git +pushd cloud-opensource-java +mvn -B -ntp clean compile -T 1C +# Linkage Checker tool resides in the /dependencies subfolder +pushd dependencies + +# REPOS_UNDER_TEST Env Var accepts a comma separated list of googleapis repos to test. For Github CI, +# this will be a single repo as Github will build a matrix of repos with each repo being tested in parallel. +# For local invocation, you can pass a list of repos to test multiple repos together. +for repo in ${REPOS_UNDER_TEST//,/ }; do # Split on comma + # Perform testing on main (with latest changes). Shallow copy as history is not important + git clone "https://github.com/googleapis/${repo}.git" --depth=1 + pushd "${repo}" + + if [ "${repo}" == "google-cloud-java" ]; then + # The `-am` command also builds anything these libraries depend on (i.e. proto-* and grpc-* sub modules) + mvn clean install -B -V -ntp -T 1C -DskipTests -Dclirr.skip -Denforcer.skip -Dmaven.javadoc.skip \ + -pl "${google_cloud_java_handwritten_maven_args}" -am + else + # Install all repo modules to ~/.m2 (there can be multiple relevant artifacts to test i.e. core, admin, control) + mvn clean install -B -V -ntp -T 1C -DskipTests -Dclirr.skip -Denforcer.skip -Dmaven.javadoc.skip + fi + + + linkage_checker_arguments="" + build_program_arguments "${repo}" + + # Linkage Checker /dependencies + popd + + echo "Artifact List: ${linkage_checker_arguments}" + # The `-s` argument filters the linkage check problems that stem from the artifact + program_args="-r --artifacts ${linkage_checker_arguments},com.google.protobuf:protobuf-java:${PROTOBUF_RUNTIME_VERSION},com.google.protobuf:protobuf-java-util:${PROTOBUF_RUNTIME_VERSION} -s ${linkage_checker_arguments}" + echo "Running Linkage Checker on the repo's handwritten modules" + echo "Linkage Checker Program Arguments: ${program_args}" + mvn -B -ntp exec:java -Dexec.args="${program_args}" -P exec-linkage-checker +done +popd +popd diff --git a/.kokoro/nightly/downstream-protobuf-source-compatibility.sh b/.kokoro/nightly/downstream-protobuf-source-compatibility.sh new file mode 100755 index 0000000000..aaa65b8208 --- /dev/null +++ b/.kokoro/nightly/downstream-protobuf-source-compatibility.sh @@ -0,0 +1,67 @@ +#!/bin/bash +# Copyright 2023 Google LLC +# +# Licensed under the Apache License, Version 2.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 + +scriptDir=$(realpath "$(dirname "${BASH_SOURCE[0]}")") +source "${scriptDir}/common.sh" + +validate_protobuf_compatibility_script_inputs + +# REPOS_UNDER_TEST Env Var accepts a comma separated list of googleapis repos to test. For Github CI, +# this will be a single repo as Github will build a matrix of repos with each repo being tested in parallel. +# For local invocation, you can pass a list of repos to test multiple repos together. +for repo in ${REPOS_UNDER_TEST//,/ }; do # Split on comma + # Perform source-compatibility testing on main (latest changes) + git clone "https://github.com/googleapis/$repo.git" --depth=1 + pushd "$repo" + + # Compile with Java 11 and run the tests with Java 8 JVM + mvn compile -T 1C + + # JAVA8_HOME is set by the GH Actions CI + if [ -n "${JAVA8_HOME}" ]; then + surefire_opt="-Djvm=${JAVA8_HOME}/bin/java" + else + # Provide a default value for local executions that don't configure JAVA8_HOME + surefire_opt="-Djvm=${JAVA_HOME}/bin/java" + fi + + # Compile the Handwritten Library with the Protobuf-Java version to test source compatibility + # Run unit tests to help check for any behavior differences (dependant on coverage) + if [ "${repo}" == "google-cloud-java" ]; then + # The `-am` command also builds anything these libraries depend on (i.e. proto-* and grpc-* sub modules) + mvn test -B -V -ntp \ + -Dclirr.skip \ + -Denforcer.skip \ + -Dmaven.javadoc.skip \ + -Denforcer.skip \ + -Dprotobuf.version=${PROTOBUF_RUNTIME_VERSION} \ + -pl "${google_cloud_java_handwritten_maven_args}" -am \ + "${surefire_opt}" \ + -T 1C + else + mvn test -B -V -ntp \ + -Dclirr.skip \ + -Denforcer.skip \ + -Dmaven.javadoc.skip \ + -Denforcer.skip \ + -Dprotobuf.version=${PROTOBUF_RUNTIME_VERSION} \ + "${surefire_opt}" \ + -T 1C + fi + + popd +done \ No newline at end of file diff --git a/.kokoro/presubmit/common.sh b/.kokoro/presubmit/common.sh new file mode 100644 index 0000000000..c9fd49ed29 --- /dev/null +++ b/.kokoro/presubmit/common.sh @@ -0,0 +1,112 @@ +#!/bin/bash +# Copyright 2023 Google LLC +# +# Licensed under the Apache License, Version 2.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. + +commonScriptDir=$(realpath "$(dirname "${BASH_SOURCE[0]}")") + +# In the given directory ($1), +# update the pom.xml's dependency on the given artifact ($2) to the given version ($3) +# ex: update_dependency google-cloud-java/google-cloud-jar-parent google-cloud-shared-dependencies 1.2.3 +function update_pom_dependency { + pushd "$1" || exit 1 + xmllint --shell pom.xml &>/dev/null </dev/null; then + found+=("$pom") + fi + done + POMS=(${found[@]}) + unset found + export POMS +} + +# In the given directory ($1), +# find and update all pom.xmls' dependencies on the given artifact ($2) to the given version ($3) +# ex: update_all_poms_dependency google-cloud-java google-cloud-shared-dependencies 1.2.3 +function update_all_poms_dependency { + pushd "$1" || exit 1 + find_all_poms_with_versioned_dependency "$2" + for pom in $POMS; do + update_pom_dependency "$(dirname "$pom")" "$2" "$3" + done + git diff + popd || exit 1 +} + +# Parse the version of the pom.xml file in the given directory ($1) +# ex: VERSION=$(parse_pom_version java-shared-dependencies) +function parse_pom_version { + # Namespace (xmlns) prevents xmllint from specifying tag names in XPath + result=$(sed -e 's/xmlns=".*"//' "$1/pom.xml" | xmllint --xpath '/project/version/text()' -) + + if [ -z "${result}" ]; then + echo "Version is not found in $1" + exit 1 + fi + echo "$result" +} + +# ex: find_last_release_version java-bigtable +# ex: find_last_release_version java-storage 2.22.x +function find_last_release_version { + repo=$1 + branch=${2-"main"} # Default to using main branch + org=${3-"googleapis"} + curl -s -o "versions_${repo}.txt" "https://raw.githubusercontent.com/${org}/${repo}/${branch}/versions.txt" + + # First check to see if there's an entry for the overall repo. Used for google-cloud-java. + primary_artifact=$(grep -E "^${repo}" "versions_${repo}.txt" | head -n 1) + if [ -z "${primary_artifact}" ]; then + # Otherwise, use the first google-cloud-* artifact's version. + primary_artifact=$(grep -E "^google-cloud-" "versions_$1.txt" | head -n 1) + fi + if [ -z "${primary_artifact}" ]; then + echo "Unable to identify primary artifact for $1" + exit 1 + fi + + parts=($(echo "$primary_artifact" | tr ":" "\n")) + echo "${parts[1]}" +} + +# copies settings.xml from the root of sdk-platform-java into Maven's home +# folder +function setup_maven_mirror { + echo "Setup maven mirror" + mkdir -p "${HOME}/.m2" + cp "${commonScriptDir}/../../settings.xml" "${HOME}/.m2" +} + +function install_repo_modules { + target_projects="$1" + projects_arg="" + if [ -n "${target_projects}" ]; then + projects_arg="--projects ${target_projects}" + fi + echo "Installing this repo's modules to local maven." + mvn -q -B -ntp install ${projects_arg} \ + -Dcheckstyle.skip -Dfmt.skip -DskipTests -T 1C +} diff --git a/.kokoro/presubmit/common_test.sh b/.kokoro/presubmit/common_test.sh new file mode 100755 index 0000000000..fcc9638eb7 --- /dev/null +++ b/.kokoro/presubmit/common_test.sh @@ -0,0 +1,80 @@ +#!/bin/bash +# Copyright 2023 Google LLC +# +# Licensed under the Apache License, Version 2.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. + +scriptDir=$(realpath "$(dirname "${BASH_SOURCE[0]}")") +cd "${scriptDir}/../.." # cd to the root of this repo +source "$scriptDir/common.sh" +mkdir -p target +cd target + +function test_find_all_poms_with_versioned_dependency { + mkdir -p test_find_all_poms_with_dependency + pushd test_find_all_poms_with_dependency + cp ../../java-showcase/gapic-showcase/pom.xml pom.xml + + find_all_poms_with_versioned_dependency 'truth' + if [ "${#POMS[@]}" != 1 ]; then + echo 'find_all_poms_with_versioned_dependency did not find the expected pom' + exit 1 + elif [ "${POMS[0]}" != './pom.xml' ]; then + echo "find_all_poms_with_versioned_dependency found ${POMS[0]} instead of expected ./pom.xml" + exit 1 + fi + + find_all_poms_with_versioned_dependency 'gax-grpc' # Versioned by shared-deps + if [ "${#POMS[@]}" != 0 ]; then + echo 'find_all_poms_with_versioned_dependency found unexpected pom' + exit 1 + fi + + popd +} + +function test_update_pom_dependency { + mkdir -p test_update_pom_dependency + pushd test_update_pom_dependency + cp ../../java-showcase/gapic-showcase/pom.xml pom.xml + + update_pom_dependency . truth "99.88.77" + + xmllint --shell pom.xml &>/dev/null </dev/null; then + echo "update_pom_dependency failed to change version to expected value." + exit 1 + fi + rm found-version.txt + popd +} + +function test_parse_pom_version { + mkdir -p test_parse_pom_version + pushd test_parse_pom_version + cp ../../java-showcase/gapic-showcase/pom.xml pom.xml + + VERSION=$(parse_pom_version .) + if [ "$VERSION" != "0.0.1-SNAPSHOT" ]; then + echo "parse_pom_version failed to read expected version of gapic-showcase." + fi + popd +} + +test_find_all_poms_with_versioned_dependency +test_update_pom_dependency +test_parse_pom_version diff --git a/.kokoro/presubmit/downstream-build.sh b/.kokoro/presubmit/downstream-build.sh new file mode 100755 index 0000000000..3a093c8767 --- /dev/null +++ b/.kokoro/presubmit/downstream-build.sh @@ -0,0 +1,54 @@ +#!/bin/bash +# Copyright 2019 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +set -eo pipefail + +if [ -z "${MODULES_UNDER_TEST}" ]; then + echo "MODULES_UNDER_TEST must be set to run downstream-build.sh" + exit 1 +fi + +## Get the directory of the build script +scriptDir=$(realpath "$(dirname "${BASH_SOURCE[0]}")") +cd "${scriptDir}/../.." # git repo root +source "$scriptDir/common.sh" + +# Publish this repo's modules to local maven to make them available for downstream libraries +mvn install --projects '!gapic-generator-java' \ + -Danimal.sniffer.skip \ + -Dcheckstyle.skip \ + -Dclirr.skip \ + -Dfmt.skip \ + -DskipTests \ + -B -ntp \ + -Dorg.slf4j.simpleLogger.showDateTime=true \ + -Dorg.slf4j.simpleLogger.dateTimeFormat=HH:mm:ss:SSS + +SHARED_DEPS_VERSION=$(parse_pom_version java-shared-dependencies) + +# Update the shared-dependencies version in google-cloud-jar-parent +git clone "https://github.com/googleapis/google-cloud-java.git" --depth=1 +update_all_poms_dependency google-cloud-java google-cloud-shared-dependencies "$SHARED_DEPS_VERSION" + +# Run the updated java-shared-dependencies BOM against google-cloud-java integration tests +cd google-cloud-java +source ./.kokoro/common.sh +RETURN_CODE=0 +setup_application_credentials +setup_cloud "$MODULES_UNDER_TEST" +install_modules "$MODULES_UNDER_TEST" +run_graalvm_tests "$MODULES_UNDER_TEST" +# Exit must occur in google-cloud-java directory to correctly destroy IT resources +exit "$RETURN_CODE" diff --git a/.kokoro/presubmit/downstream-compatibility-spring.sh b/.kokoro/presubmit/downstream-compatibility-spring.sh new file mode 100755 index 0000000000..edc99d6cb7 --- /dev/null +++ b/.kokoro/presubmit/downstream-compatibility-spring.sh @@ -0,0 +1,62 @@ +#!/bin/bash +# 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. + +# This script is only meant to test spring-cloud-gpc, specifically on its +# autoconfig generation workflow + +set -eox pipefail + +# Get the directory of the build script +scriptDir=$(realpath "$(dirname "${BASH_SOURCE[0]}")") +cd "${scriptDir}/../.." # cd to the root of this repo +source "$scriptDir/common.sh" + +install_repo_modules +GAPIC_GENERATOR_VERSION=$(parse_pom_version "gapic-generator-java-bom") +echo "Install complete. gapic-generator-java-bom = $GAPIC_GENERATOR_VERSION" + +pushd gapic-generator-java/target +# Download and configure spring-cloud-gcp for testing +last_release=$(find_last_release_version "spring-cloud-gcp" "main" "GoogleCloudPlatform") +git clone "https://github.com/GoogleCloudPlatform/spring-cloud-gcp.git" --depth=1 --branch "v$last_release" +update_all_poms_dependency "spring-cloud-gcp" "gapic-generator-java-bom" "${GAPIC_GENERATOR_VERSION}" + +# Install spring-cloud-gcp modules +pushd spring-cloud-gcp +./mvnw \ + -U \ + --batch-mode \ + --no-transfer-progress \ + --show-version \ + --threads 1.5C \ + --define maven.test.skip=true \ + --define maven.javadoc.skip=true \ + install + + +# Generate showcase autoconfig +pushd spring-cloud-generator +# The script is not executable for non-owners. Here we manually chmod it. +# TODO(diegomarquezp): remove this line after +# https://github.com/GoogleCloudPlatform/spring-cloud-gcp/pull/3183 is merged and released. +chmod 755 ./scripts/generate-showcase.sh +./scripts/generate-showcase.sh +pushd showcase/showcase-spring-starter +mvn verify +popd # showcase/showcase-spring-starter + +popd # spring-cloud-generator +popd # spring-cloud-gcp +popd # gapic-generator-java/target diff --git a/.kokoro/presubmit/downstream-compatibility.sh b/.kokoro/presubmit/downstream-compatibility.sh new file mode 100755 index 0000000000..2e0b8c7c12 --- /dev/null +++ b/.kokoro/presubmit/downstream-compatibility.sh @@ -0,0 +1,46 @@ +#!/bin/bash +# Copyright 2023 Google LLC +# +# Licensed under the Apache License, Version 2.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 + +# Comma-delimited list of repos to test with the local java-shared-dependencies +if [ -z "${REPOS_UNDER_TEST}" ]; then + echo "REPOS_UNDER_TEST must be set to run downstream-compatibility.sh" + exit 1 +fi + + +# Get the directory of the build script +scriptDir=$(realpath "$(dirname "${BASH_SOURCE[0]}")") +cd "${scriptDir}/../.." # cd to the root of this repo +source "$scriptDir/common.sh" + +setup_maven_mirror + +install_repo_modules '!gapic-generator-java' +SHARED_DEPS_VERSION=$(parse_pom_version java-shared-dependencies) +echo "Install complete. java-shared-dependencies = $SHARED_DEPS_VERSION" + +pushd java-shared-dependencies/target +for repo in ${REPOS_UNDER_TEST//,/ }; do # Split on comma + # Perform testing on last release, not HEAD + last_release=$(find_last_release_version "$repo") + git clone "https://github.com/googleapis/$repo.git" --depth=1 --branch "v$last_release" + update_all_poms_dependency "$repo" google-cloud-shared-dependencies "$SHARED_DEPS_VERSION" + pushd "$repo" + JOB_TYPE="test" ./.kokoro/build.sh + popd +done +popd diff --git a/.kokoro/presubmit/showcase-native.sh b/.kokoro/presubmit/showcase-native.sh new file mode 100644 index 0000000000..ad85d8dc6a --- /dev/null +++ b/.kokoro/presubmit/showcase-native.sh @@ -0,0 +1,63 @@ +#!/bin/bash +# 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. + +set -eo pipefail + +## Get the directory of the build script +scriptDir=$(realpath "$(dirname "${BASH_SOURCE[0]}")") +cd "${scriptDir}/../.." # git repo root +source "$scriptDir/common.sh" + +# Use GCP Maven Mirror +mkdir -p "${HOME}/.m2" +cp settings.xml "${HOME}/.m2" + +# Publish this repo's modules to local maven to make them available for downstream libraries +mvn install --projects '!gapic-generator-java' \ + -Danimal.sniffer.skip \ + -Dcheckstyle.skip \ + -Dclirr.skip \ + -Dfmt.skip \ + -DskipTests \ + -B -ntp \ + -Dorg.slf4j.simpleLogger.showDateTime=true \ + -Dorg.slf4j.simpleLogger.dateTimeFormat=HH:mm:ss:SSS + +SHARED_DEPS_VERSION=$(parse_pom_version java-shared-dependencies) + +# Run showcase integration tests in GraalVM +pushd java-showcase/gapic-showcase +SHOWCASE_VERSION=$(mvn help:evaluate -Dexpression=gapic-showcase.version -q -DforceStdout) +popd +# Start showcase server +mkdir -p /usr/src/showcase +curl \ + --location https://github.com/googleapis/gapic-showcase/releases/download/v"${SHOWCASE_VERSION}"/gapic-showcase-"${SHOWCASE_VERSION}"-linux-amd64.tar.gz \ + --output /usr/src/showcase/showcase-"${SHOWCASE_VERSION}"-linux-amd64.tar.gz +pushd /usr/src/showcase/ +tar -xf showcase-* +./gapic-showcase run & +popd + +# Run showcase tests with `native` profile +pushd java-showcase +mvn test -Pnative,-showcase \ + -Denforcer.skip=true \ + -Dcheckstyle.skip \ + -Dfmt.skip \ + -ntp -B \ + -Dorg.slf4j.simpleLogger.showDateTime=true \ + -Dorg.slf4j.simpleLogger.dateTimeFormat=HH:mm:ss:SSS +popd diff --git a/.kokoro/release/common.cfg b/.kokoro/release/common.cfg deleted file mode 100644 index c383884732..0000000000 --- a/.kokoro/release/common.cfg +++ /dev/null @@ -1,49 +0,0 @@ -# Format: //devtools/kokoro/config/proto/build.proto - -# Download trampoline resources. -gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/trampoline" - -# Use the trampoline script to run in docker. -build_file: "gapic-generator-java/.kokoro/trampoline.sh" - -# Configure the docker image for kokoro-trampoline. -env_vars: { - key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-kokoro-resources/java8" -} - -before_action { - fetch_keystore { - keystore_resource { - keystore_config_id: 70247 - keyname: "maven-gpg-keyring" - } - } -} - -before_action { - fetch_keystore { - keystore_resource { - keystore_config_id: 70247 - keyname: "maven-gpg-passphrase" - } - } -} - -before_action { - fetch_keystore { - keystore_resource { - keystore_config_id: 70247 - keyname: "maven-gpg-pubkeyring" - } - } -} - -before_action { - fetch_keystore { - keystore_resource { - keystore_config_id: 70247 - keyname: "sonatype-credentials" - } - } -} diff --git a/.kokoro/release/common.sh b/.kokoro/release/common.sh deleted file mode 100755 index 693bae8bfb..0000000000 --- a/.kokoro/release/common.sh +++ /dev/null @@ -1,52 +0,0 @@ -#!/bin/bash -# Copyright 2019 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -set -eo pipefail - -# Get secrets from keystore and set and environment variables -setup_environment_secrets() { - export GPG_PASSPHRASE=$(cat ${KOKORO_KEYSTORE_DIR}/70247_maven-gpg-passphrase) - export GPG_TTY=$(tty) - export GPG_HOMEDIR=/gpg - mkdir $GPG_HOMEDIR - mv ${KOKORO_KEYSTORE_DIR}/70247_maven-gpg-pubkeyring $GPG_HOMEDIR/pubring.gpg - mv ${KOKORO_KEYSTORE_DIR}/70247_maven-gpg-keyring $GPG_HOMEDIR/secring.gpg - export GPG_KEY_ID=$(echo -n $(gpg --with-colons ${GPG_HOMEDIR}/pubring.gpg | awk -F':' '/pub/{ print $5 }')) - export SONATYPE_USERNAME=$(cat ${KOKORO_KEYSTORE_DIR}/70247_sonatype-credentials | cut -f1 -d'|') - export SONATYPE_PASSWORD=$(cat ${KOKORO_KEYSTORE_DIR}/70247_sonatype-credentials | cut -f2 -d'|') -} - -create_settings_xml_file() { - echo " - - - - ossrh - ${SONATYPE_USERNAME} - ${SONATYPE_PASSWORD} - - - sonatype-nexus-staging - ${SONATYPE_USERNAME} - ${SONATYPE_PASSWORD} - - - sonatype-nexus-snapshots - ${SONATYPE_USERNAME} - ${SONATYPE_PASSWORD} - - -" > $1 -} \ No newline at end of file diff --git a/.kokoro/release/stage.cfg b/.kokoro/release/stage.cfg deleted file mode 100644 index ddd3ab71dc..0000000000 --- a/.kokoro/release/stage.cfg +++ /dev/null @@ -1,17 +0,0 @@ -# Format: //devtools/kokoro/config/proto/build.proto -env_vars: { - key: "TRAMPOLINE_BUILD_FILE" - value: "github/gapic-generator-java/.kokoro/release/stage.sh" -} - -action { - define_artifacts { - regex: "github/gapic-generator-java/target/nexus-staging/staging/*.properties" - strip_prefix: "github/gapic-generator-java" - } -} - -env_vars: { - key: "SECRET_MANAGER_KEYS" - value: "releasetool-publish-reporter-app,releasetool-publish-reporter-googleapis-installation,releasetool-publish-reporter-pem" -} diff --git a/.kokoro/release/stage.sh b/.kokoro/release/stage.sh deleted file mode 100755 index 5ff691d31a..0000000000 --- a/.kokoro/release/stage.sh +++ /dev/null @@ -1,52 +0,0 @@ -#!/bin/bash -# Copyright 2019 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -set -eo pipefail - -if [[ -n "${AUTORELEASE_PR}" ]] -then - # Start the releasetool reporter - requirementsFile=$(realpath $(dirname "${BASH_SOURCE[0]}")/../requirements.txt) - python3 -m pip install --require-hashes -r $requirementsFile - python3 -m releasetool publish-reporter-script > /tmp/publisher-script; source /tmp/publisher-script -fi - -source $(dirname "$0")/common.sh -MAVEN_SETTINGS_FILE=$(realpath $(dirname "$0")/../../)/settings.xml -pushd $(dirname "$0")/../../ - -setup_environment_secrets -create_settings_xml_file "settings.xml" - -mvn clean deploy -B \ - -DskipTests=true \ - -Dclirr.skip=true \ - --settings ${MAVEN_SETTINGS_FILE} \ - -Dgpg.executable=gpg \ - -Dgpg.passphrase=${GPG_PASSPHRASE} \ - -Dgpg.homedir=${GPG_HOMEDIR} \ - -P release - -# The job triggered by Release Please (release-trigger) has this AUTORELEASE_PR -# environment variable. Fusion also lets us to specify this variable. -if [[ -n "${AUTORELEASE_PR}" ]] -then - mvn nexus-staging:release -B \ - -P release-staging-repository \ - -DperformRelease=true \ - --settings=${MAVEN_SETTINGS_FILE} -else - echo "AUTORELEASE_PR is not set. Not releasing." -fi diff --git a/.kokoro/requirements.in b/.kokoro/requirements.in deleted file mode 100644 index 924f94ae6f..0000000000 --- a/.kokoro/requirements.in +++ /dev/null @@ -1,34 +0,0 @@ -gcp-docuploader==0.6.3 -google-crc32c==1.3.0 -googleapis-common-protos==1.56.3 -gcp-releasetool==1.9.1 -cryptography==38.0.3 -cachetools==4.2.4 -cffi==1.15.1 -jeepney==0.7.1 -jinja2==3.0.3 -markupsafe==2.0.1 -keyring==23.4.1 -packaging==21.3 -protobuf==3.19.5 -pyjwt==2.4.0 -pyparsing==3.0.9 -pycparser==2.21 -pyperclip==1.8.2 -python-dateutil==2.8.2 -requests==2.27.1 -certifi==2022.9.24 -importlib-metadata==4.8.3 -zipp==3.6.0 -google_api_core==2.8.2 -google-cloud-storage==2.0.0 -google-resumable-media==2.3.3 -google-cloud-core==2.3.1 -typing-extensions==4.1.1 -urllib3==1.26.12 -zipp==3.6.0 -rsa==4.9 -six==1.16.0 -attrs==22.1.0 -google-auth==2.14.1 -idna==3.4 \ No newline at end of file diff --git a/.kokoro/requirements.txt b/.kokoro/requirements.txt deleted file mode 100644 index 75b9817b94..0000000000 --- a/.kokoro/requirements.txt +++ /dev/null @@ -1,455 +0,0 @@ -# -# This file is autogenerated by pip-compile with python 3.10 -# To update, run: -# -# pip-compile --generate-hashes requirements.in -# -attrs==22.1.0 \ - --hash=sha256:29adc2665447e5191d0e7c568fde78b21f9672d344281d0c6e1ab085429b22b6 \ - --hash=sha256:86efa402f67bf2df34f51a335487cf46b1ec130d02b8d39fd248abfd30da551c - # via - # -r requirements.in - # gcp-releasetool -cachetools==4.2.4 \ - --hash=sha256:89ea6f1b638d5a73a4f9226be57ac5e4f399d22770b92355f92dcb0f7f001693 \ - --hash=sha256:92971d3cb7d2a97efff7c7bb1657f21a8f5fb309a37530537c71b1774189f2d1 - # via - # -r requirements.in - # google-auth -certifi==2022.9.24 \ - --hash=sha256:0d9c601124e5a6ba9712dbc60d9c53c21e34f5f641fe83002317394311bdce14 \ - --hash=sha256:90c1a32f1d68f940488354e36370f6cca89f0f106db09518524c88d6ed83f382 - # via - # -r requirements.in - # requests -cffi==1.15.1 \ - --hash=sha256:00a9ed42e88df81ffae7a8ab6d9356b371399b91dbdf0c3cb1e84c03a13aceb5 \ - --hash=sha256:03425bdae262c76aad70202debd780501fabeaca237cdfddc008987c0e0f59ef \ - --hash=sha256:04ed324bda3cda42b9b695d51bb7d54b680b9719cfab04227cdd1e04e5de3104 \ - --hash=sha256:0e2642fe3142e4cc4af0799748233ad6da94c62a8bec3a6648bf8ee68b1c7426 \ - --hash=sha256:173379135477dc8cac4bc58f45db08ab45d228b3363adb7af79436135d028405 \ - --hash=sha256:198caafb44239b60e252492445da556afafc7d1e3ab7a1fb3f0584ef6d742375 \ - --hash=sha256:1e74c6b51a9ed6589199c787bf5f9875612ca4a8a0785fb2d4a84429badaf22a \ - --hash=sha256:2012c72d854c2d03e45d06ae57f40d78e5770d252f195b93f581acf3ba44496e \ - --hash=sha256:21157295583fe8943475029ed5abdcf71eb3911894724e360acff1d61c1d54bc \ - --hash=sha256:2470043b93ff09bf8fb1d46d1cb756ce6132c54826661a32d4e4d132e1977adf \ - --hash=sha256:285d29981935eb726a4399badae8f0ffdff4f5050eaa6d0cfc3f64b857b77185 \ - --hash=sha256:30d78fbc8ebf9c92c9b7823ee18eb92f2e6ef79b45ac84db507f52fbe3ec4497 \ - --hash=sha256:320dab6e7cb2eacdf0e658569d2575c4dad258c0fcc794f46215e1e39f90f2c3 \ - --hash=sha256:33ab79603146aace82c2427da5ca6e58f2b3f2fb5da893ceac0c42218a40be35 \ - --hash=sha256:3548db281cd7d2561c9ad9984681c95f7b0e38881201e157833a2342c30d5e8c \ - --hash=sha256:3799aecf2e17cf585d977b780ce79ff0dc9b78d799fc694221ce814c2c19db83 \ - --hash=sha256:39d39875251ca8f612b6f33e6b1195af86d1b3e60086068be9cc053aa4376e21 \ - --hash=sha256:3b926aa83d1edb5aa5b427b4053dc420ec295a08e40911296b9eb1b6170f6cca \ - --hash=sha256:3bcde07039e586f91b45c88f8583ea7cf7a0770df3a1649627bf598332cb6984 \ - --hash=sha256:3d08afd128ddaa624a48cf2b859afef385b720bb4b43df214f85616922e6a5ac \ - --hash=sha256:3eb6971dcff08619f8d91607cfc726518b6fa2a9eba42856be181c6d0d9515fd \ - --hash=sha256:40f4774f5a9d4f5e344f31a32b5096977b5d48560c5592e2f3d2c4374bd543ee \ - --hash=sha256:4289fc34b2f5316fbb762d75362931e351941fa95fa18789191b33fc4cf9504a \ - --hash=sha256:470c103ae716238bbe698d67ad020e1db9d9dba34fa5a899b5e21577e6d52ed2 \ - --hash=sha256:4f2c9f67e9821cad2e5f480bc8d83b8742896f1242dba247911072d4fa94c192 \ - --hash=sha256:50a74364d85fd319352182ef59c5c790484a336f6db772c1a9231f1c3ed0cbd7 \ - --hash=sha256:54a2db7b78338edd780e7ef7f9f6c442500fb0d41a5a4ea24fff1c929d5af585 \ - --hash=sha256:5635bd9cb9731e6d4a1132a498dd34f764034a8ce60cef4f5319c0541159392f \ - --hash=sha256:59c0b02d0a6c384d453fece7566d1c7e6b7bae4fc5874ef2ef46d56776d61c9e \ - --hash=sha256:5d598b938678ebf3c67377cdd45e09d431369c3b1a5b331058c338e201f12b27 \ - --hash=sha256:5df2768244d19ab7f60546d0c7c63ce1581f7af8b5de3eb3004b9b6fc8a9f84b \ - --hash=sha256:5ef34d190326c3b1f822a5b7a45f6c4535e2f47ed06fec77d3d799c450b2651e \ - --hash=sha256:6975a3fac6bc83c4a65c9f9fcab9e47019a11d3d2cf7f3c0d03431bf145a941e \ - --hash=sha256:6c9a799e985904922a4d207a94eae35c78ebae90e128f0c4e521ce339396be9d \ - --hash=sha256:70df4e3b545a17496c9b3f41f5115e69a4f2e77e94e1d2a8e1070bc0c38c8a3c \ - --hash=sha256:7473e861101c9e72452f9bf8acb984947aa1661a7704553a9f6e4baa5ba64415 \ - --hash=sha256:8102eaf27e1e448db915d08afa8b41d6c7ca7a04b7d73af6514df10a3e74bd82 \ - --hash=sha256:87c450779d0914f2861b8526e035c5e6da0a3199d8f1add1a665e1cbc6fc6d02 \ - --hash=sha256:8b7ee99e510d7b66cdb6c593f21c043c248537a32e0bedf02e01e9553a172314 \ - --hash=sha256:91fc98adde3d7881af9b59ed0294046f3806221863722ba7d8d120c575314325 \ - --hash=sha256:94411f22c3985acaec6f83c6df553f2dbe17b698cc7f8ae751ff2237d96b9e3c \ - --hash=sha256:98d85c6a2bef81588d9227dde12db8a7f47f639f4a17c9ae08e773aa9c697bf3 \ - --hash=sha256:9ad5db27f9cabae298d151c85cf2bad1d359a1b9c686a275df03385758e2f914 \ - --hash=sha256:a0b71b1b8fbf2b96e41c4d990244165e2c9be83d54962a9a1d118fd8657d2045 \ - --hash=sha256:a0f100c8912c114ff53e1202d0078b425bee3649ae34d7b070e9697f93c5d52d \ - --hash=sha256:a591fe9e525846e4d154205572a029f653ada1a78b93697f3b5a8f1f2bc055b9 \ - --hash=sha256:a5c84c68147988265e60416b57fc83425a78058853509c1b0629c180094904a5 \ - --hash=sha256:a66d3508133af6e8548451b25058d5812812ec3798c886bf38ed24a98216fab2 \ - --hash=sha256:a8c4917bd7ad33e8eb21e9a5bbba979b49d9a97acb3a803092cbc1133e20343c \ - --hash=sha256:b3bbeb01c2b273cca1e1e0c5df57f12dce9a4dd331b4fa1635b8bec26350bde3 \ - --hash=sha256:cba9d6b9a7d64d4bd46167096fc9d2f835e25d7e4c121fb2ddfc6528fb0413b2 \ - --hash=sha256:cc4d65aeeaa04136a12677d3dd0b1c0c94dc43abac5860ab33cceb42b801c1e8 \ - --hash=sha256:ce4bcc037df4fc5e3d184794f27bdaab018943698f4ca31630bc7f84a7b69c6d \ - --hash=sha256:cec7d9412a9102bdc577382c3929b337320c4c4c4849f2c5cdd14d7368c5562d \ - --hash=sha256:d400bfb9a37b1351253cb402671cea7e89bdecc294e8016a707f6d1d8ac934f9 \ - --hash=sha256:d61f4695e6c866a23a21acab0509af1cdfd2c013cf256bbf5b6b5e2695827162 \ - --hash=sha256:db0fbb9c62743ce59a9ff687eb5f4afbe77e5e8403d6697f7446e5f609976f76 \ - --hash=sha256:dd86c085fae2efd48ac91dd7ccffcfc0571387fe1193d33b6394db7ef31fe2a4 \ - --hash=sha256:e00b098126fd45523dd056d2efba6c5a63b71ffe9f2bbe1a4fe1716e1d0c331e \ - --hash=sha256:e229a521186c75c8ad9490854fd8bbdd9a0c9aa3a524326b55be83b54d4e0ad9 \ - --hash=sha256:e263d77ee3dd201c3a142934a086a4450861778baaeeb45db4591ef65550b0a6 \ - --hash=sha256:ed9cb427ba5504c1dc15ede7d516b84757c3e3d7868ccc85121d9310d27eed0b \ - --hash=sha256:fa6693661a4c91757f4412306191b6dc88c1703f780c8234035eac011922bc01 \ - --hash=sha256:fcd131dd944808b5bdb38e6f5b53013c5aa4f334c5cad0c72742f6eba4b73db0 - # via - # -r requirements.in - # cryptography -charset-normalizer==2.0.12 \ - --hash=sha256:2857e29ff0d34db842cd7ca3230549d1a697f96ee6d3fb071cfa6c7393832597 \ - --hash=sha256:6881edbebdb17b39b4eaaa821b438bf6eddffb4468cf344f09f89def34a8b1df - # via requests -click==8.0.4 \ - --hash=sha256:6a7a62563bbfabfda3a38f3023a1db4a35978c0abd76f6c9605ecd6554d6d9b1 \ - --hash=sha256:8458d7b1287c5fb128c90e23381cf99dcde74beaf6c7ff6384ce84d6fe090adb - # via - # gcp-docuploader - # gcp-releasetool -colorlog==6.7.0 \ - --hash=sha256:0d33ca236784a1ba3ff9c532d4964126d8a2c44f1f0cb1d2b0728196f512f662 \ - --hash=sha256:bd94bd21c1e13fac7bd3153f4bc3a7dc0eb0974b8bc2fdf1a989e474f6e582e5 - # via gcp-docuploader -cryptography==38.0.3 \ - --hash=sha256:068147f32fa662c81aebab95c74679b401b12b57494872886eb5c1139250ec5d \ - --hash=sha256:06fc3cc7b6f6cca87bd56ec80a580c88f1da5306f505876a71c8cfa7050257dd \ - --hash=sha256:25c1d1f19729fb09d42e06b4bf9895212292cb27bb50229f5aa64d039ab29146 \ - --hash=sha256:402852a0aea73833d982cabb6d0c3bb582c15483d29fb7085ef2c42bfa7e38d7 \ - --hash=sha256:4e269dcd9b102c5a3d72be3c45d8ce20377b8076a43cbed6f660a1afe365e436 \ - --hash=sha256:5419a127426084933076132d317911e3c6eb77568a1ce23c3ac1e12d111e61e0 \ - --hash=sha256:554bec92ee7d1e9d10ded2f7e92a5d70c1f74ba9524947c0ba0c850c7b011828 \ - --hash=sha256:5e89468fbd2fcd733b5899333bc54d0d06c80e04cd23d8c6f3e0542358c6060b \ - --hash=sha256:65535bc550b70bd6271984d9863a37741352b4aad6fb1b3344a54e6950249b55 \ - --hash=sha256:6ab9516b85bebe7aa83f309bacc5f44a61eeb90d0b4ec125d2d003ce41932d36 \ - --hash=sha256:6addc3b6d593cd980989261dc1cce38263c76954d758c3c94de51f1e010c9a50 \ - --hash=sha256:728f2694fa743a996d7784a6194da430f197d5c58e2f4e278612b359f455e4a2 \ - --hash=sha256:785e4056b5a8b28f05a533fab69febf5004458e20dad7e2e13a3120d8ecec75a \ - --hash=sha256:78cf5eefac2b52c10398a42765bfa981ce2372cbc0457e6bf9658f41ec3c41d8 \ - --hash=sha256:7f836217000342d448e1c9a342e9163149e45d5b5eca76a30e84503a5a96cab0 \ - --hash=sha256:8d41a46251bf0634e21fac50ffd643216ccecfaf3701a063257fe0b2be1b6548 \ - --hash=sha256:984fe150f350a3c91e84de405fe49e688aa6092b3525f407a18b9646f6612320 \ - --hash=sha256:9b24bcff7853ed18a63cfb0c2b008936a9554af24af2fb146e16d8e1aed75748 \ - --hash=sha256:b1b35d9d3a65542ed2e9d90115dfd16bbc027b3f07ee3304fc83580f26e43249 \ - --hash=sha256:b1b52c9e5f8aa2b802d48bd693190341fae201ea51c7a167d69fc48b60e8a959 \ - --hash=sha256:bbf203f1a814007ce24bd4d51362991d5cb90ba0c177a9c08825f2cc304d871f \ - --hash=sha256:be243c7e2bfcf6cc4cb350c0d5cdf15ca6383bbcb2a8ef51d3c9411a9d4386f0 \ - --hash=sha256:bfbe6ee19615b07a98b1d2287d6a6073f734735b49ee45b11324d85efc4d5cbd \ - --hash=sha256:c46837ea467ed1efea562bbeb543994c2d1f6e800785bd5a2c98bc096f5cb220 \ - --hash=sha256:dfb4f4dd568de1b6af9f4cda334adf7d72cf5bc052516e1b2608b683375dd95c \ - --hash=sha256:ed7b00096790213e09eb11c97cc6e2b757f15f3d2f85833cd2d3ec3fe37c1722 - # via - # -r requirements.in - # gcp-releasetool - # secretstorage -gcp-docuploader==0.6.3 \ - --hash=sha256:ba8c9d76b3bbac54b0311c503a373b00edc2dc02d6d54ea9507045adb8e870f7 \ - --hash=sha256:c0f5aaa82ce1854a386197e4e359b120ad6d4e57ae2c812fce42219a3288026b - # via -r requirements.in -gcp-releasetool==1.9.1 \ - --hash=sha256:952f4055d5d986b070ae2a71c4410b250000f9cc5a1e26398fcd55a5bbc5a15f \ - --hash=sha256:d0d3c814a97c1a237517e837d8cfa668ced8df4b882452578ecef4a4e79c583b - # via -r requirements.in -google-api-core==2.8.2 \ - --hash=sha256:06f7244c640322b508b125903bb5701bebabce8832f85aba9335ec00b3d02edc \ - --hash=sha256:93c6a91ccac79079ac6bbf8b74ee75db970cc899278b97d53bc012f35908cf50 - # via - # -r requirements.in - # google-cloud-core - # google-cloud-storage -google-auth==2.14.1 \ - --hash=sha256:f5d8701633bebc12e0deea4df8abd8aff31c28b355360597f7f2ee60f2e4d016 - # via - # -r requirements.in - # gcp-releasetool - # google-api-core - # google-cloud-core - # google-cloud-storage -google-cloud-core==2.3.1 \ - --hash=sha256:113ba4f492467d5bd442c8d724c1a25ad7384045c3178369038840ecdd19346c \ - --hash=sha256:34334359cb04187bdc80ddcf613e462dfd7a3aabbc3fe4d118517ab4b9303d53 - # via - # -r requirements.in - # google-cloud-storage -google-cloud-storage==2.0.0 \ - --hash=sha256:a57a15aead0f9dfbd4381f1bfdbe8bf89818a4bd75bab846cafcefb2db846c47 \ - --hash=sha256:ec4be60bb223a3a960f0d01697d849b86d91cad815a84915a32ed3635e93a5e7 - # via - # -r requirements.in - # gcp-docuploader -google-crc32c==1.3.0 \ - --hash=sha256:04e7c220798a72fd0f08242bc8d7a05986b2a08a0573396187fd32c1dcdd58b3 \ - --hash=sha256:05340b60bf05b574159e9bd940152a47d38af3fb43803ffe71f11d704b7696a6 \ - --hash=sha256:12674a4c3b56b706153a358eaa1018c4137a5a04635b92b4652440d3d7386206 \ - --hash=sha256:127f9cc3ac41b6a859bd9dc4321097b1a4f6aa7fdf71b4f9227b9e3ebffb4422 \ - --hash=sha256:13af315c3a0eec8bb8b8d80b8b128cb3fcd17d7e4edafc39647846345a3f003a \ - --hash=sha256:1926fd8de0acb9d15ee757175ce7242e235482a783cd4ec711cc999fc103c24e \ - --hash=sha256:226f2f9b8e128a6ca6a9af9b9e8384f7b53a801907425c9a292553a3a7218ce0 \ - --hash=sha256:276de6273eb074a35bc598f8efbc00c7869c5cf2e29c90748fccc8c898c244df \ - --hash=sha256:318f73f5484b5671f0c7f5f63741ab020a599504ed81d209b5c7129ee4667407 \ - --hash=sha256:3bbce1be3687bbfebe29abdb7631b83e6b25da3f4e1856a1611eb21854b689ea \ - --hash=sha256:42ae4781333e331a1743445931b08ebdad73e188fd554259e772556fc4937c48 \ - --hash=sha256:58be56ae0529c664cc04a9c76e68bb92b091e0194d6e3c50bea7e0f266f73713 \ - --hash=sha256:5da2c81575cc3ccf05d9830f9e8d3c70954819ca9a63828210498c0774fda1a3 \ - --hash=sha256:6311853aa2bba4064d0c28ca54e7b50c4d48e3de04f6770f6c60ebda1e975267 \ - --hash=sha256:650e2917660e696041ab3dcd7abac160b4121cd9a484c08406f24c5964099829 \ - --hash=sha256:6a4db36f9721fdf391646685ecffa404eb986cbe007a3289499020daf72e88a2 \ - --hash=sha256:779cbf1ce375b96111db98fca913c1f5ec11b1d870e529b1dc7354b2681a8c3a \ - --hash=sha256:7f6fe42536d9dcd3e2ffb9d3053f5d05221ae3bbcefbe472bdf2c71c793e3183 \ - --hash=sha256:891f712ce54e0d631370e1f4997b3f182f3368179198efc30d477c75d1f44942 \ - --hash=sha256:95c68a4b9b7828ba0428f8f7e3109c5d476ca44996ed9a5f8aac6269296e2d59 \ - --hash=sha256:96a8918a78d5d64e07c8ea4ed2bc44354e3f93f46a4866a40e8db934e4c0d74b \ - --hash=sha256:9c3cf890c3c0ecfe1510a452a165431b5831e24160c5fcf2071f0f85ca5a47cd \ - --hash=sha256:9f58099ad7affc0754ae42e6d87443299f15d739b0ce03c76f515153a5cda06c \ - --hash=sha256:a0b9e622c3b2b8d0ce32f77eba617ab0d6768b82836391e4f8f9e2074582bf02 \ - --hash=sha256:a7f9cbea4245ee36190f85fe1814e2d7b1e5f2186381b082f5d59f99b7f11328 \ - --hash=sha256:bab4aebd525218bab4ee615786c4581952eadc16b1ff031813a2fd51f0cc7b08 \ - --hash=sha256:c124b8c8779bf2d35d9b721e52d4adb41c9bfbde45e6a3f25f0820caa9aba73f \ - --hash=sha256:c9da0a39b53d2fab3e5467329ed50e951eb91386e9d0d5b12daf593973c3b168 \ - --hash=sha256:ca60076c388728d3b6ac3846842474f4250c91efbfe5afa872d3ffd69dd4b318 \ - --hash=sha256:cb6994fff247987c66a8a4e550ef374671c2b82e3c0d2115e689d21e511a652d \ - --hash=sha256:d1c1d6236feab51200272d79b3d3e0f12cf2cbb12b208c835b175a21efdb0a73 \ - --hash=sha256:dd7760a88a8d3d705ff562aa93f8445ead54f58fd482e4f9e2bafb7e177375d4 \ - --hash=sha256:dda4d8a3bb0b50f540f6ff4b6033f3a74e8bf0bd5320b70fab2c03e512a62812 \ - --hash=sha256:e0f1ff55dde0ebcfbef027edc21f71c205845585fffe30d4ec4979416613e9b3 \ - --hash=sha256:e7a539b9be7b9c00f11ef16b55486141bc2cdb0c54762f84e3c6fc091917436d \ - --hash=sha256:eb0b14523758e37802f27b7f8cd973f5f3d33be7613952c0df904b68c4842f0e \ - --hash=sha256:ed447680ff21c14aaceb6a9f99a5f639f583ccfe4ce1a5e1d48eb41c3d6b3217 \ - --hash=sha256:f52a4ad2568314ee713715b1e2d79ab55fab11e8b304fd1462ff5cccf4264b3e \ - --hash=sha256:fbd60c6aaa07c31d7754edbc2334aef50601b7f1ada67a96eb1eb57c7c72378f \ - --hash=sha256:fc28e0db232c62ca0c3600884933178f0825c99be4474cdd645e378a10588125 \ - --hash=sha256:fe31de3002e7b08eb20823b3735b97c86c5926dd0581c7710a680b418a8709d4 \ - --hash=sha256:fec221a051150eeddfdfcff162e6db92c65ecf46cb0f7bb1bf812a1520ec026b \ - --hash=sha256:ff71073ebf0e42258a42a0b34f2c09ec384977e7f6808999102eedd5b49920e3 - # via - # -r requirements.in - # google-resumable-media -google-resumable-media==2.3.3 \ - --hash=sha256:27c52620bd364d1c8116eaac4ea2afcbfb81ae9139fb3199652fcac1724bfb6c \ - --hash=sha256:5b52774ea7a829a8cdaa8bd2d4c3d4bc660c91b30857ab2668d0eb830f4ea8c5 - # via - # -r requirements.in - # google-cloud-storage -googleapis-common-protos==1.56.3 \ - --hash=sha256:6f1369b58ed6cf3a4b7054a44ebe8d03b29c309257583a2bbdc064cd1e4a1442 \ - --hash=sha256:87955d7b3a73e6e803f2572a33179de23989ebba725e05ea42f24838b792e461 - # via - # -r requirements.in - # google-api-core -idna==3.4 \ - --hash=sha256:814f528e8dead7d329833b91c5faa87d60bf71824cd12a7530b5526063d02cb4 \ - --hash=sha256:90b77e79eaa3eba6de819a0c442c0b4ceefc341a7a2ab77d7562bf49f425c5c2 - # via - # -r requirements.in - # requests -importlib-metadata==4.8.3 \ - --hash=sha256:65a9576a5b2d58ca44d133c42a241905cc45e34d2c06fd5ba2bafa221e5d7b5e \ - --hash=sha256:766abffff765960fcc18003801f7044eb6755ffae4521c8e8ce8e83b9c9b0668 - # via - # -r requirements.in - # keyring -jeepney==0.7.1 \ - --hash=sha256:1b5a0ea5c0e7b166b2f5895b91a08c14de8915afda4407fb5022a195224958ac \ - --hash=sha256:fa9e232dfa0c498bd0b8a3a73b8d8a31978304dcef0515adc859d4e096f96f4f - # via - # -r requirements.in - # keyring - # secretstorage -jinja2==3.0.3 \ - --hash=sha256:077ce6014f7b40d03b47d1f1ca4b0fc8328a692bd284016f806ed0eaca390ad8 \ - --hash=sha256:611bb273cd68f3b993fabdc4064fc858c5b47a973cb5aa7999ec1ba405c87cd7 - # via - # -r requirements.in - # gcp-releasetool -keyring==23.4.1 \ - --hash=sha256:17e49fb0d6883c2b4445359434dba95aad84aabb29bbff044ad0ed7100232eca \ - --hash=sha256:89cbd74d4683ed164c8082fb38619341097741323b3786905c6dac04d6915a55 - # via - # -r requirements.in - # gcp-releasetool -markupsafe==2.0.1 \ - --hash=sha256:01a9b8ea66f1658938f65b93a85ebe8bc016e6769611be228d797c9d998dd298 \ - --hash=sha256:023cb26ec21ece8dc3907c0e8320058b2e0cb3c55cf9564da612bc325bed5e64 \ - --hash=sha256:0446679737af14f45767963a1a9ef7620189912317d095f2d9ffa183a4d25d2b \ - --hash=sha256:04635854b943835a6ea959e948d19dcd311762c5c0c6e1f0e16ee57022669194 \ - --hash=sha256:0717a7390a68be14b8c793ba258e075c6f4ca819f15edfc2a3a027c823718567 \ - --hash=sha256:0955295dd5eec6cb6cc2fe1698f4c6d84af2e92de33fbcac4111913cd100a6ff \ - --hash=sha256:0d4b31cc67ab36e3392bbf3862cfbadac3db12bdd8b02a2731f509ed5b829724 \ - --hash=sha256:10f82115e21dc0dfec9ab5c0223652f7197feb168c940f3ef61563fc2d6beb74 \ - --hash=sha256:168cd0a3642de83558a5153c8bd34f175a9a6e7f6dc6384b9655d2697312a646 \ - --hash=sha256:1d609f577dc6e1aa17d746f8bd3c31aa4d258f4070d61b2aa5c4166c1539de35 \ - --hash=sha256:1f2ade76b9903f39aa442b4aadd2177decb66525062db244b35d71d0ee8599b6 \ - --hash=sha256:20dca64a3ef2d6e4d5d615a3fd418ad3bde77a47ec8a23d984a12b5b4c74491a \ - --hash=sha256:2a7d351cbd8cfeb19ca00de495e224dea7e7d919659c2841bbb7f420ad03e2d6 \ - --hash=sha256:2d7d807855b419fc2ed3e631034685db6079889a1f01d5d9dac950f764da3dad \ - --hash=sha256:2ef54abee730b502252bcdf31b10dacb0a416229b72c18b19e24a4509f273d26 \ - --hash=sha256:36bc903cbb393720fad60fc28c10de6acf10dc6cc883f3e24ee4012371399a38 \ - --hash=sha256:37205cac2a79194e3750b0af2a5720d95f786a55ce7df90c3af697bfa100eaac \ - --hash=sha256:3c112550557578c26af18a1ccc9e090bfe03832ae994343cfdacd287db6a6ae7 \ - --hash=sha256:3dd007d54ee88b46be476e293f48c85048603f5f516008bee124ddd891398ed6 \ - --hash=sha256:4296f2b1ce8c86a6aea78613c34bb1a672ea0e3de9c6ba08a960efe0b0a09047 \ - --hash=sha256:47ab1e7b91c098ab893b828deafa1203de86d0bc6ab587b160f78fe6c4011f75 \ - --hash=sha256:49e3ceeabbfb9d66c3aef5af3a60cc43b85c33df25ce03d0031a608b0a8b2e3f \ - --hash=sha256:4dc8f9fb58f7364b63fd9f85013b780ef83c11857ae79f2feda41e270468dd9b \ - --hash=sha256:4efca8f86c54b22348a5467704e3fec767b2db12fc39c6d963168ab1d3fc9135 \ - --hash=sha256:53edb4da6925ad13c07b6d26c2a852bd81e364f95301c66e930ab2aef5b5ddd8 \ - --hash=sha256:5855f8438a7d1d458206a2466bf82b0f104a3724bf96a1c781ab731e4201731a \ - --hash=sha256:594c67807fb16238b30c44bdf74f36c02cdf22d1c8cda91ef8a0ed8dabf5620a \ - --hash=sha256:5b6d930f030f8ed98e3e6c98ffa0652bdb82601e7a016ec2ab5d7ff23baa78d1 \ - --hash=sha256:5bb28c636d87e840583ee3adeb78172efc47c8b26127267f54a9c0ec251d41a9 \ - --hash=sha256:60bf42e36abfaf9aff1f50f52644b336d4f0a3fd6d8a60ca0d054ac9f713a864 \ - --hash=sha256:611d1ad9a4288cf3e3c16014564df047fe08410e628f89805e475368bd304914 \ - --hash=sha256:6300b8454aa6930a24b9618fbb54b5a68135092bc666f7b06901f897fa5c2fee \ - --hash=sha256:63f3268ba69ace99cab4e3e3b5840b03340efed0948ab8f78d2fd87ee5442a4f \ - --hash=sha256:6557b31b5e2c9ddf0de32a691f2312a32f77cd7681d8af66c2692efdbef84c18 \ - --hash=sha256:693ce3f9e70a6cf7d2fb9e6c9d8b204b6b39897a2c4a1aa65728d5ac97dcc1d8 \ - --hash=sha256:6a7fae0dd14cf60ad5ff42baa2e95727c3d81ded453457771d02b7d2b3f9c0c2 \ - --hash=sha256:6c4ca60fa24e85fe25b912b01e62cb969d69a23a5d5867682dd3e80b5b02581d \ - --hash=sha256:6fcf051089389abe060c9cd7caa212c707e58153afa2c649f00346ce6d260f1b \ - --hash=sha256:7d91275b0245b1da4d4cfa07e0faedd5b0812efc15b702576d103293e252af1b \ - --hash=sha256:89c687013cb1cd489a0f0ac24febe8c7a666e6e221b783e53ac50ebf68e45d86 \ - --hash=sha256:8d206346619592c6200148b01a2142798c989edcb9c896f9ac9722a99d4e77e6 \ - --hash=sha256:905fec760bd2fa1388bb5b489ee8ee5f7291d692638ea5f67982d968366bef9f \ - --hash=sha256:97383d78eb34da7e1fa37dd273c20ad4320929af65d156e35a5e2d89566d9dfb \ - --hash=sha256:984d76483eb32f1bcb536dc27e4ad56bba4baa70be32fa87152832cdd9db0833 \ - --hash=sha256:99df47edb6bda1249d3e80fdabb1dab8c08ef3975f69aed437cb69d0a5de1e28 \ - --hash=sha256:9f02365d4e99430a12647f09b6cc8bab61a6564363f313126f775eb4f6ef798e \ - --hash=sha256:a30e67a65b53ea0a5e62fe23682cfe22712e01f453b95233b25502f7c61cb415 \ - --hash=sha256:ab3ef638ace319fa26553db0624c4699e31a28bb2a835c5faca8f8acf6a5a902 \ - --hash=sha256:aca6377c0cb8a8253e493c6b451565ac77e98c2951c45f913e0b52facdcff83f \ - --hash=sha256:add36cb2dbb8b736611303cd3bfcee00afd96471b09cda130da3581cbdc56a6d \ - --hash=sha256:b2f4bf27480f5e5e8ce285a8c8fd176c0b03e93dcc6646477d4630e83440c6a9 \ - --hash=sha256:b7f2d075102dc8c794cbde1947378051c4e5180d52d276987b8d28a3bd58c17d \ - --hash=sha256:baa1a4e8f868845af802979fcdbf0bb11f94f1cb7ced4c4b8a351bb60d108145 \ - --hash=sha256:be98f628055368795d818ebf93da628541e10b75b41c559fdf36d104c5787066 \ - --hash=sha256:bf5d821ffabf0ef3533c39c518f3357b171a1651c1ff6827325e4489b0e46c3c \ - --hash=sha256:c47adbc92fc1bb2b3274c4b3a43ae0e4573d9fbff4f54cd484555edbf030baf1 \ - --hash=sha256:cdfba22ea2f0029c9261a4bd07e830a8da012291fbe44dc794e488b6c9bb353a \ - --hash=sha256:d6c7ebd4e944c85e2c3421e612a7057a2f48d478d79e61800d81468a8d842207 \ - --hash=sha256:d7f9850398e85aba693bb640262d3611788b1f29a79f0c93c565694658f4071f \ - --hash=sha256:d8446c54dc28c01e5a2dbac5a25f071f6653e6e40f3a8818e8b45d790fe6ef53 \ - --hash=sha256:deb993cacb280823246a026e3b2d81c493c53de6acfd5e6bfe31ab3402bb37dd \ - --hash=sha256:e0f138900af21926a02425cf736db95be9f4af72ba1bb21453432a07f6082134 \ - --hash=sha256:e9936f0b261d4df76ad22f8fee3ae83b60d7c3e871292cd42f40b81b70afae85 \ - --hash=sha256:f0567c4dc99f264f49fe27da5f735f414c4e7e7dd850cfd8e69f0862d7c74ea9 \ - --hash=sha256:f5653a225f31e113b152e56f154ccbe59eeb1c7487b39b9d9f9cdb58e6c79dc5 \ - --hash=sha256:f826e31d18b516f653fe296d967d700fddad5901ae07c622bb3705955e1faa94 \ - --hash=sha256:f8ba0e8349a38d3001fae7eadded3f6606f0da5d748ee53cc1dab1d6527b9509 \ - --hash=sha256:f9081981fe268bd86831e5c75f7de206ef275defcb82bc70740ae6dc507aee51 \ - --hash=sha256:fa130dd50c57d53368c9d59395cb5526eda596d3ffe36666cd81a44d56e48872 - # via - # -r requirements.in - # jinja2 -packaging==21.3 \ - --hash=sha256:dd47c42927d89ab911e606518907cc2d3a1f38bbd026385970643f9c5b8ecfeb \ - --hash=sha256:ef103e05f519cdc783ae24ea4e2e0f508a9c99b2d4969652eed6a2e1ea5bd522 - # via - # -r requirements.in - # gcp-releasetool -protobuf==3.19.5 \ - --hash=sha256:1867f93b06a183f87696871bb8d1e99ee71dbb69d468ce1f0cc8bf3d30f982f3 \ - --hash=sha256:3c4160b601220627f7e91154e572baf5e161a9c3f445a8242d536ee3d0b7b17c \ - --hash=sha256:4ee2af7051d3b10c8a4fe6fd1a2c69f201fea36aeee7086cf202a692e1b99ee1 \ - --hash=sha256:5266c36cc0af3bb3dbf44f199d225b33da66a9a5c3bdc2b14865ad10eddf0e37 \ - --hash=sha256:5470f892961af464ae6eaf0f3099e2c1190ae8c7f36f174b89491281341f79ca \ - --hash=sha256:66d14b5b90090353efe75c9fb1bf65ef7267383034688d255b500822e37d5c2f \ - --hash=sha256:67efb5d20618020aa9596e17bfc37ca068c28ec0c1507d9507f73c93d46c9855 \ - --hash=sha256:696e6cfab94cc15a14946f2bf72719dced087d437adbd994fff34f38986628bc \ - --hash=sha256:6a02172b9650f819d01fb8e224fc69b0706458fc1ab4f1c669281243c71c1a5e \ - --hash=sha256:950abd6c00e7b51f87ae8b18a0ce4d69fea217f62f171426e77de5061f6d9850 \ - --hash=sha256:9e1d74032f56ff25f417cfe84c8147047732e5059137ca42efad20cbbd25f5e0 \ - --hash=sha256:9e42b1cf2ecd8a1bd161239e693f22035ba99905ae6d7efeac8a0546c7ec1a27 \ - --hash=sha256:9f957ef53e872d58a0afd3bf6d80d48535d28c99b40e75e6634cbc33ea42fd54 \ - --hash=sha256:a89aa0c042e61e11ade320b802d6db4ee5391d8d973e46d3a48172c1597789f8 \ - --hash=sha256:c0f80876a8ff0ae7064084ed094eb86497bd5a3812e6fc96a05318b92301674e \ - --hash=sha256:c44e3282cff74ad18c7e8a0375f407f69ee50c2116364b44492a196293e08b21 \ - --hash=sha256:d249519ba5ecf5dd6b18150c9b6bcde510b273714b696f3923ff8308fc11ae49 \ - --hash=sha256:d3973a2d58aefc7d1230725c2447ce7f86a71cbc094b86a77c6ee1505ac7cdb1 \ - --hash=sha256:dca2284378a5f2a86ffed35c6ac147d14c48b525eefcd1083e5a9ce28dfa8657 \ - --hash=sha256:e63b0b3c42e51c94add62b010366cd4979cb6d5f06158bcae8faac4c294f91e1 \ - --hash=sha256:f2b599a21c9a32e171ec29a2ac54e03297736c578698e11b099d031f79da114b \ - --hash=sha256:f2bde37667b18c2b5280df83bc799204394a5d2d774e4deaf9de0eb741df6833 \ - --hash=sha256:f4f909f4dde413dec435a44b0894956d55bb928ded7d6e3c726556ca4c796e84 \ - --hash=sha256:f976234e20ab2785f54224bcdafa027674e23663b132fa3ca0caa291a6cfbde7 \ - --hash=sha256:f9cebda093c2f6bfed88f1c17cdade09d4d96096421b344026feee236532d4de - # via - # -r requirements.in - # gcp-docuploader - # gcp-releasetool - # google-api-core - # google-cloud-storage - # googleapis-common-protos -pyasn1==0.4.8 \ - --hash=sha256:39c7e2ec30515947ff4e87fb6f456dfc6e84857d34be479c9d4a4ba4bf46aa5d \ - --hash=sha256:aef77c9fb94a3ac588e87841208bdec464471d9871bd5050a287cc9a475cd0ba - # via - # pyasn1-modules - # rsa -pyasn1-modules==0.2.8 \ - --hash=sha256:905f84c712230b2c592c19470d3ca8d552de726050d1d1716282a1f6146be65e \ - --hash=sha256:a50b808ffeb97cb3601dd25981f6b016cbb3d31fbf57a8b8a87428e6158d0c74 - # via google-auth -pycparser==2.21 \ - --hash=sha256:8ee45429555515e1f6b185e78100aea234072576aa43ab53aefcae078162fca9 \ - --hash=sha256:e644fdec12f7872f86c58ff790da456218b10f863970249516d60a5eaca77206 - # via - # -r requirements.in - # cffi -pyjwt==2.4.0 \ - --hash=sha256:72d1d253f32dbd4f5c88eaf1fdc62f3a19f676ccbadb9dbc5d07e951b2b26daf \ - --hash=sha256:d42908208c699b3b973cbeb01a969ba6a96c821eefb1c5bfe4c390c01d67abba - # via - # -r requirements.in - # gcp-releasetool -pyparsing==3.0.9 \ - --hash=sha256:2b020ecf7d21b687f219b71ecad3631f644a47f01403fa1d1036b0c6416d70fb \ - --hash=sha256:5026bae9a10eeaefb61dab2f09052b9f4307d44aee4eda64b309723d8d206bbc - # via - # -r requirements.in - # packaging -pyperclip==1.8.2 \ - --hash=sha256:105254a8b04934f0bc84e9c24eb360a591aaf6535c9def5f29d92af107a9bf57 - # via - # -r requirements.in - # gcp-releasetool -python-dateutil==2.8.2 \ - --hash=sha256:0123cacc1627ae19ddf3c27a5de5bd67ee4586fbdd6440d9748f8abb483d3e86 \ - --hash=sha256:961d03dc3453ebbc59dbdea9e4e11c5651520a876d0f4db161e8674aae935da9 - # via - # -r requirements.in - # gcp-releasetool -requests==2.27.1 \ - --hash=sha256:68d7c56fd5a8999887728ef304a6d12edc7be74f1cfa47714fc8b414525c9a61 \ - --hash=sha256:f22fa1e554c9ddfd16e6e41ac79759e17be9e492b3587efa038054674760e72d - # via - # -r requirements.in - # gcp-releasetool - # google-api-core - # google-cloud-storage -rsa==4.9 \ - --hash=sha256:90260d9058e514786967344d0ef75fa8727eed8a7d2e43ce9f4bcf1b536174f7 \ - --hash=sha256:e38464a49c6c85d7f1351b0126661487a7e0a14a50f1675ec50eb34d4f20ef21 - # via - # -r requirements.in - # google-auth -secretstorage==3.3.3 \ - --hash=sha256:2403533ef369eca6d2ba81718576c5e0f564d5cca1b58f73a8b23e7d4eeebd77 \ - --hash=sha256:f356e6628222568e3af06f2eba8df495efa13b3b63081dafd4f7d9a7b7bc9f99 - # via keyring -six==1.16.0 \ - --hash=sha256:1e61c37477a1626458e36f7b1d82aa5c9b094fa4802892072e49de9c60c4c926 \ - --hash=sha256:8abb2f1d86890a2dfb989f9a77cfcfd3e47c2a354b01111771326f8aa26e0254 - # via - # -r requirements.in - # gcp-docuploader - # google-auth - # python-dateutil -typing-extensions==4.1.1 \ - --hash=sha256:1a9462dcc3347a79b1f1c0271fbe79e844580bb598bafa1ed208b94da3cdcd42 \ - --hash=sha256:21c85e0fe4b9a155d0799430b0ad741cdce7e359660ccbd8b530613e8df88ce2 - # via -r requirements.in -urllib3==1.26.12 \ - --hash=sha256:3fa96cf423e6987997fc326ae8df396db2a8b7c667747d47ddd8ecba91f4a74e \ - --hash=sha256:b930dd878d5a8afb066a637fbb35144fe7901e3b209d1cd4f524bd0e9deee997 - # via - # -r requirements.in - # requests -zipp==3.6.0 \ - --hash=sha256:71c644c5369f4a6e07636f0aa966270449561fcea2e3d6747b8d23efaa9d7832 \ - --hash=sha256:9fe5ea21568a0a70e50f273397638d39b03353731e6cbbb3fd8502a33fec40bc - # via - # -r requirements.in - # importlib-metadata diff --git a/.release-please-manifest.json b/.release-please-manifest.json new file mode 100644 index 0000000000..fc6bc1a457 --- /dev/null +++ b/.release-please-manifest.json @@ -0,0 +1,3 @@ +{ + ".": "2.68.0" +} \ No newline at end of file diff --git a/BUILD.bazel b/BUILD.bazel index 6196f677fe..d2a67f4eee 100644 --- a/BUILD.bazel +++ b/BUILD.bazel @@ -2,117 +2,10 @@ load("@rules_java//java:defs.bzl", "java_binary", "java_proto_library") package(default_visibility = ["//visibility:public"]) -# TODO: some dependencies may be runtime only. -MAIN_DEPS = [ - ":service_config_java_proto", - "@com_google_api_api_common//jar", - "@com_google_api_gax_java//gax", - "@com_google_api_gax_java//gax:gax_testlib", - "@com_google_api_gax_java//gax-grpc:gax_grpc", - "@com_google_api_gax_java//gax-grpc:gax_grpc_testlib", - "@com_google_api_gax_java//gax-httpjson:gax_httpjson", - "@com_google_api_gax_java//gax-httpjson:gax_httpjson_testlib", - "@com_google_api_grpc_proto_google_common_protos", - "@com_google_auto_value_auto_value_annotations//jar", # Ideally should be compile-time only, but this is OK. - "@com_google_code_gson//jar", - "@com_google_googleapis//gapic/metadata:metadata_java_proto", - "@com_google_guava_guava", - "@com_google_http_client_google_http_client//jar", - "@com_google_protobuf//:protobuf_java", - "@com_google_protobuf//:protobuf_java_util", - "@google_java_format_all_deps//jar", - "@io_grpc_grpc_java//api", - "@io_grpc_grpc_java//protobuf", - "@io_grpc_grpc_java//stub", - "@javax_annotation_javax_annotation_api//jar", - "@junit_junit//jar", - "@org_threeten_threetenbp//jar", - "@org_yaml_snakeyaml//jar", -] - -MAIN_DEPS_DEBUG_RUNTIME_ONLY = [ - "@com_google_googleapis//google/api:api_java_proto", - "@com_google_googleapis//google/cloud:extended_operations_java_proto", - "@com_google_googleapis//google/longrunning:longrunning_java_proto", - "@com_google_protobuf//java/core", -] - -# Some dependencies are runtime only, but that's fine for tests. -TEST_DEPS = [ - ":test_java_protos", - "@com_google_googleapis//google/logging/v2:logging_java_proto", - "@com_google_googleapis//google/pubsub/v1:pubsub_java_proto", - "@com_google_googleapis//google/rpc:rpc_java_proto", - "@com_google_truth_truth//jar", - "@io_github_java_diff_utils//jar", -] - -proto_library( - name = "service_config_proto", - srcs = ["gapic-generator-java/src/main/proto/service_config.proto"], - deps = [ - "@com_google_googleapis//google/rpc:code_proto", - "@com_google_protobuf//:duration_proto", - "@com_google_protobuf//:wrappers_proto", - "@com_google_protobuf//:struct_proto", - ], -) -java_proto_library( - name = "service_config_java_proto", - deps = [":service_config_proto"], -) - -proto_library( - name = "test_protos", - srcs = glob(["gapic-generator-java/src/test/proto/*.proto"]), - deps = [ - "@com_google_googleapis//google/api:annotations_proto", - "@com_google_googleapis//google/api:client_proto", - "@com_google_googleapis//google/api:field_behavior_proto", - "@com_google_googleapis//google/api:routing_proto", - "@com_google_googleapis//google/api:resource_proto", - "@com_google_googleapis//google/cloud:extended_operations_proto", - "@com_google_googleapis//google/longrunning:operations_proto", - "@com_google_googleapis//google/rpc:error_details_proto", - "@com_google_googleapis//google/rpc:status_proto", - "@com_google_protobuf//:duration_proto", - "@com_google_protobuf//:empty_proto", - "@com_google_protobuf//:field_mask_proto", - "@com_google_protobuf//:timestamp_proto", - "@com_google_protobuf//:struct_proto", - ], -) -java_proto_library( - name = "test_java_protos", - deps = [ - ":test_protos", - "@com_google_googleapis//google/cloud:common_resources_proto" - ], -) - -java_plugin( - name = "autovalue_plugin", - processor_class = "com.google.auto.value.processor.AutoValueProcessor", - deps = ["@com_google_auto_value_auto_value//jar"], -) - -java_library( - name = "gapic_generator_java", - srcs = glob(["gapic-generator-java/src/main/java/**/*.java"]), - plugins = [":autovalue_plugin"], - deps = MAIN_DEPS, -) - -java_library( - name = "gapic_generator_java_test", - srcs = glob(["gapic-generator-java/src/test/java/**/*.java"]), - deps = [":gapic_generator_java"] + MAIN_DEPS + TEST_DEPS, -) - java_binary( name = "protoc-gen-java_gapic", main_class = "com.google.api.generator.Main", - runtime_deps = [":gapic_generator_java"] + MAIN_DEPS, + runtime_deps = ["@maven//:com_google_api_gapic_generator_java"], ) # Request dumper binary, which dumps the CodeGeneratorRequest to a file on disk @@ -134,7 +27,7 @@ java_binary( java_binary( name = "protoc-gen-code_generator_request_dumper", main_class = "com.google.api.generator.debug.CodeGeneratorRequestDumper", - runtime_deps = [":gapic_generator_java"] + MAIN_DEPS + MAIN_DEPS_DEBUG_RUNTIME_ONLY, + runtime_deps = ["@maven//:com_google_api_gapic_generator_java"], ) # A binary similar to protoc-gen-java_gapic but reads the CodeGeneratorRequest @@ -147,89 +40,9 @@ java_binary( java_binary( name = "code_generator_request_file_to_gapic_main", main_class = "com.google.api.generator.debug.CodeGeneratorRequestFileToGapicMain", - runtime_deps = [":gapic_generator_java"] + MAIN_DEPS + MAIN_DEPS_DEBUG_RUNTIME_ONLY, -) - -# another test resource -genrule( - name = "basic_proto_descriptor", - srcs = ["gapic-generator-java/src/test/proto/basic.proto"], - outs = ["test-proto.descriptorset"], - cmd = "$(location @com_google_protobuf//:protoc) " + - "--include_source_info --include_imports --descriptor_set_out=$(OUTS) $(SRCS)", - message = "Generating proto descriptor", - tools = ["@com_google_protobuf//:protoc"], + runtime_deps = ["@maven//:com_google_api_gapic_generator_java"], ) -# Unit tests. Run each test with, e.g., -# bazel test //:unit_com_google_api_generator_engine_JavaCodeGeneratorTest -[java_test( - # 35 is the length of 'gapic-generator-java/src/test/java' - # 5 is the length of '.java' - name = "unit_" + file[35:-5].replace('gapic-generator-java/', '').replace('/', '_'), - test_class = file[35:-5].replace('gapic-generator-java/', '').replace('/', '.'), - runtime_deps = [ - ":gapic_generator_java", - ":gapic_generator_java_test", - ] + MAIN_DEPS + TEST_DEPS, - data = [":basic_proto_descriptor"] + glob([ - "gapic-generator-java/src/test/java/**/*.golden", - "gapic-generator-java/src/test/resources/**", - ]), - tags = ["small"], -) for file in glob(["gapic-generator-java/src/test/java/**/*Test.java"])] - -test_suite(name = "units", tags = ["small"]) - -# Tests that generate and save unit golden (.golden) files. -GOLDEN_UPDATING_UNIT_TESTS = [ - "com.google.api.generator.engine.JavaCodeGeneratorTest", - "com.google.api.generator.gapic.composer.ComposerTest", - "com.google.api.generator.gapic.composer.ClientLibraryPackageInfoComposerTest", - "com.google.api.generator.gapic.composer.common.BatchingDescriptorComposerTest", - "com.google.api.generator.gapic.composer.grpc.GrpcServiceCallableFactoryClassComposerTest", - "com.google.api.generator.gapic.composer.grpc.GrpcServiceStubClassComposerTest", - "com.google.api.generator.gapic.composer.grpc.MockServiceClassComposerTest", - "com.google.api.generator.gapic.composer.grpc.MockServiceImplClassComposerTest", - "com.google.api.generator.gapic.composer.grpc.ServiceClientClassComposerTest", - "com.google.api.generator.gapic.composer.grpc.ServiceClientTestClassComposerTest", - "com.google.api.generator.gapic.composer.grpc.ServiceSettingsClassComposerTest", - "com.google.api.generator.gapic.composer.grpc.ServiceStubClassComposerTest", - "com.google.api.generator.gapic.composer.grpc.ServiceStubSettingsClassComposerTest", - "com.google.api.generator.gapic.composer.grpcrest.GrpcServiceCallableFactoryClassComposerTest", - "com.google.api.generator.gapic.composer.grpcrest.GrpcServiceStubClassComposerTest", - "com.google.api.generator.gapic.composer.grpcrest.HttpJsonServiceCallableFactoryClassComposerTest", - "com.google.api.generator.gapic.composer.grpcrest.HttpJsonServiceClientTestClassComposerTest", - "com.google.api.generator.gapic.composer.grpcrest.HttpJsonServiceStubClassComposerTest", - "com.google.api.generator.gapic.composer.grpcrest.ServiceClientClassComposerTest", - "com.google.api.generator.gapic.composer.grpcrest.ServiceClientTestClassComposerTest", - "com.google.api.generator.gapic.composer.grpcrest.ServiceSettingsClassComposerTest", - "com.google.api.generator.gapic.composer.grpcrest.ServiceStubSettingsClassComposerTest", - "com.google.api.generator.gapic.composer.resourcename.ResourceNameHelperClassComposerTest", - "com.google.api.generator.gapic.composer.rest.HttpJsonServiceCallableFactoryClassComposerTest", - "com.google.api.generator.gapic.composer.rest.HttpJsonServiceStubClassComposerTest", - "com.google.api.generator.gapic.composer.rest.ServiceClientTestClassComposerTest", - "com.google.api.generator.gapic.composer.rest.ServiceSettingsClassComposerTest", - "com.google.api.generator.gapic.composer.rest.ServiceStubSettingsClassComposerTest", -] - -# Manually runs a single JUnit test for the tests that generate and save .golden -# files. To update .golden files, run with, e.g., -# bazel run //:update_com_google_api_generator_engine_JavaCodeGeneratorTest -[java_binary( - name = "update_%s" % test_class.replace('.', '_'), - main_class = "com.google.api.generator.test.framework.SingleJUnitTestRunner", - args = [test_class], - runtime_deps = [ - ":gapic_generator_java", - ":gapic_generator_java_test", - ] + MAIN_DEPS + TEST_DEPS, - data = glob([ - "gapic-generator-java/src/test/java/**/*.golden", - "gapic-generator-java/src/test/resources/**", - ]), -) for test_class in GOLDEN_UPDATING_UNIT_TESTS] - # google-java-format java_binary( name = "google_java_format_binary", @@ -237,23 +50,3 @@ java_binary( main_class = "com.google.googlejavaformat.java.Main", runtime_deps = ["@google_java_format_all_deps//jar"], ) - -genrule( - name = "google_java_format", - outs = ["google_java_format.sh"], - cmd = "echo 'find gapic-generator-java/src test -name \'*.java\' | grep -v /goldens/ | xargs $(execpath :google_java_format_binary) --replace' > $(OUTS)", - executable = 1, - tools = [":google_java_format_binary"], - local = 1, -) - -# Run `bazel build //:google_java_format_verification` to verify that gapic-generator-java sources -# are formatted correctly. -genrule( - name = "google_java_format_verification", - outs = ["google_java_format_verification.sh"], - cmd = "echo 'find gapic-generator-java/src test -name \'*.java\' | grep -v /goldens/ | xargs $(execpath :google_java_format_binary) --dry-run --set-exit-if-changed' > $(OUTS)", - executable = 1, - tools = [":google_java_format_binary"], - local = 1, -) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9dd45417f3..4545315743 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,1751 @@ # Changelog +## [2.68.0](https://github.com/googleapis/sdk-platform-java/compare/v2.67.0...v2.68.0) (2026-03-17) + + +### Features + +* Add client request duration metric. ([#4132](https://github.com/googleapis/sdk-platform-java/issues/4132)) ([6a76397](https://github.com/googleapis/sdk-platform-java/commit/6a763979c2c5427f0a7ba23708fb7948520662d8)) +* Add more attributes to golden signals metrics. ([#4135](https://github.com/googleapis/sdk-platform-java/issues/4135)) ([59d0624](https://github.com/googleapis/sdk-platform-java/commit/59d0624ec5a85580a503f719897597161f529e3f)) +* **gax-httpjson:** add HttpJsonErrorParser utility ([#4137](https://github.com/googleapis/sdk-platform-java/issues/4137)) ([a1b7565](https://github.com/googleapis/sdk-platform-java/commit/a1b7565ef752259d79d3f1288b85120c6ac7452b)) +* **generator:** add extra allowed modules that will not be removed from the monorepo if they are present ([#4124](https://github.com/googleapis/sdk-platform-java/issues/4124)) ([774fe6e](https://github.com/googleapis/sdk-platform-java/commit/774fe6ede6bf25e150fb405dfe3bac9d85e21169)) +* **o11y:** introduce `gcp.client.repo` and `gcp.client.artifact` attributes ([#4120](https://github.com/googleapis/sdk-platform-java/issues/4120)) ([105f644](https://github.com/googleapis/sdk-platform-java/commit/105f644209cb78845a423d949cb7633a86d07868)) +* **o11y:** Introduce `rpc.system.name` and `rpc.method` in gRPC ([#4121](https://github.com/googleapis/sdk-platform-java/issues/4121)) ([7ab6d2e](https://github.com/googleapis/sdk-platform-java/commit/7ab6d2e5784f264558b7aca6f23e771361dbea3a)) +* **o11y:** introduce server.port attribute ([#4128](https://github.com/googleapis/sdk-platform-java/issues/4128)) ([56aa343](https://github.com/googleapis/sdk-platform-java/commit/56aa3438393e1992bb8f688291fb12030ec9bc0e)) + + +### Bug Fixes + +* add null checks for ApiTracerFactory in ClientContext ([#4122](https://github.com/googleapis/sdk-platform-java/issues/4122)) ([4b3dbe2](https://github.com/googleapis/sdk-platform-java/commit/4b3dbe29b32dd0fba6c7a5f4a08fafa2798eeca5)) +* Decrease log level for directpath warnings outside GCE ([#4139](https://github.com/googleapis/sdk-platform-java/issues/4139)) ([c9651e7](https://github.com/googleapis/sdk-platform-java/commit/c9651e7fa1501726798c0e38365e4b7c0acabc55)) +* **gax-grpc:** add pick_first fallback to direct path service config ([#4143](https://github.com/googleapis/sdk-platform-java/issues/4143)) ([b150fe9](https://github.com/googleapis/sdk-platform-java/commit/b150fe9ccfd5a97319388be4079699722aa033dc)) +* Populate method level attributes in metrics recording ([#4149](https://github.com/googleapis/sdk-platform-java/issues/4149)) ([7b7e6c9](https://github.com/googleapis/sdk-platform-java/commit/7b7e6c99251e1aecb1831084f5576aa9e8e48930)) +* suppress warnings in generated projects for non-idiomatic durations ([#4119](https://github.com/googleapis/sdk-platform-java/issues/4119)) ([4206e6e](https://github.com/googleapis/sdk-platform-java/commit/4206e6ed7546d6b8330dcb8dc29179e59677ccd3)) +* Use ServiceName + MethodName as the regex for Otel ([#2543](https://github.com/googleapis/sdk-platform-java/issues/2543)) ([b9ae73f](https://github.com/googleapis/sdk-platform-java/commit/b9ae73fba59ba32e9688d11c2b3db51fe0d68d8d)) + + +### Documentation + +* **hermetic_build:** fix config field name in readme ([#4130](https://github.com/googleapis/sdk-platform-java/issues/4130)) ([a0c8f67](https://github.com/googleapis/sdk-platform-java/commit/a0c8f67f5a425d9a365b8e451b18add2c5947a11)) + +## [2.67.0](https://github.com/googleapis/sdk-platform-java/compare/v2.66.1...v2.67.0) (2026-02-18) + + +### Features + +* **observability:** introduce minimal tracing implementation ([#4105](https://github.com/googleapis/sdk-platform-java/issues/4105)) ([e4e5e89](https://github.com/googleapis/sdk-platform-java/commit/e4e5e893e7a62bd12528e7d448dc2789f71946eb)) + + +### Dependencies + +* Upgrade Google-Auth-Library to v1.43.0 ([#4114](https://github.com/googleapis/sdk-platform-java/issues/4114)) ([825298b](https://github.com/googleapis/sdk-platform-java/commit/825298b6bf225bb8536ecab9d788f82f3f8eec4d)) +* Upgrade grpc to 1.76.3 ([#4106](https://github.com/googleapis/sdk-platform-java/issues/4106)) ([c6555f5](https://github.com/googleapis/sdk-platform-java/commit/c6555f5f0cd85683db76394271e1f57989cac7d0)) + +## [2.66.1](https://github.com/googleapis/sdk-platform-java/compare/v2.66.0...v2.66.1) (2026-02-04) + + +### Documentation + +* [common-protos] update reference documentation for `SelectionInput.DROPDOWN` to include dynamic data sources and autosuggestion ([9960262](https://github.com/googleapis/sdk-platform-java/commit/9960262cf248400836c04063e6a701bec2aca1ba)) + +## [2.66.0](https://github.com/googleapis/sdk-platform-java/compare/v2.65.1...v2.66.0) (2026-01-23) + + +### Features + +* Upgrade protobuf runtime and gen code to 4.33.x ([#4000](https://github.com/googleapis/sdk-platform-java/issues/4000)) ([#4074](https://github.com/googleapis/sdk-platform-java/issues/4074)) ([3e37376](https://github.com/googleapis/sdk-platform-java/commit/3e37376ccaddf42617436471dc9b014974b8e3df)) + + +### Dependencies + +* Downgrade opentelemetry to 1.51.0 ([#4075](https://github.com/googleapis/sdk-platform-java/issues/4075)) ([cf65482](https://github.com/googleapis/sdk-platform-java/commit/cf6548232830e0461500d92954050186e255b572)) +* update auth library to 1.42.0 ([#4087](https://github.com/googleapis/sdk-platform-java/issues/4087)) ([ad9ee07](https://github.com/googleapis/sdk-platform-java/commit/ad9ee0731a64585ad8ee0f0ac71bece9f6eaf068)) +* update googleapis/java-cloud-bom digest to ef3656d ([#3630](https://github.com/googleapis/sdk-platform-java/issues/3630)) ([790bcf0](https://github.com/googleapis/sdk-platform-java/commit/790bcf0542dc8aba5afe2f65e80a74d643b40cfe)) +* update http-client to 2.1.0 ([#4086](https://github.com/googleapis/sdk-platform-java/issues/4086)) ([d8bc8f5](https://github.com/googleapis/sdk-platform-java/commit/d8bc8f5d335ffde52a603b47718574858f04f5ee)) + +## [2.65.1](https://github.com/googleapis/sdk-platform-java/compare/v2.65.0...v2.65.1) (2026-01-13) + + +### Documentation + +* Update docs for GoogleCredentialsProvider#setScopesToApply ([#4057](https://github.com/googleapis/sdk-platform-java/issues/4057)) ([0a9962f](https://github.com/googleapis/sdk-platform-java/commit/0a9962f9945b6018796a808f89a6a3a309d1ca04)) + +## [2.65.0](https://github.com/googleapis/sdk-platform-java/compare/v2.64.2...v2.65.0) (2026-01-12) + + +### Features + +* add org.json:json to third-party-dependencies pom ([#4047](https://github.com/googleapis/sdk-platform-java/issues/4047)) ([ffa432e](https://github.com/googleapis/sdk-platform-java/commit/ffa432e4e4ae763845afd48b404836c88698bdc0)), closes [#4046](https://github.com/googleapis/sdk-platform-java/issues/4046) +* remove dependency management of graal-sdk ([#4033](https://github.com/googleapis/sdk-platform-java/issues/4033)) ([ad05c34](https://github.com/googleapis/sdk-platform-java/commit/ad05c34e205c09ad035f469170b0c62b4423b748)) + + +### Bug Fixes + +* add api_version breadcrumb to client docs ([#4018](https://github.com/googleapis/sdk-platform-java/issues/4018)) ([a2b2179](https://github.com/googleapis/sdk-platform-java/commit/a2b2179874e6a5435001fe201f4eecc2a8e4c531)) +* Create a single S2AChannelCredentials per application ([#3989](https://github.com/googleapis/sdk-platform-java/issues/3989)) ([3758b43](https://github.com/googleapis/sdk-platform-java/commit/3758b436d7e80b79ad7d5ea330d8f2bf2f430330)) +* provide API to share the same background executor for channel po… ([#4030](https://github.com/googleapis/sdk-platform-java/issues/4030)) ([178182c](https://github.com/googleapis/sdk-platform-java/commit/178182c76c1b35e702215a88adc3ab511dd35a9e)) + + +### Dependencies + +* update dependencies.txt for grpc-gcp to 1.9.0 ([#4025](https://github.com/googleapis/sdk-platform-java/issues/4025)) ([b68791d](https://github.com/googleapis/sdk-platform-java/commit/b68791d074c02e02a5ccf2f937a5922749a14f56)) +* update google api dependencies ([#3917](https://github.com/googleapis/sdk-platform-java/issues/3917)) ([480cf13](https://github.com/googleapis/sdk-platform-java/commit/480cf13148687c53c4af3da9d48490aeb5bf4b88)) +* update google.http-client.version to 2.0.3 ([#4054](https://github.com/googleapis/sdk-platform-java/issues/4054)) ([b9a8c89](https://github.com/googleapis/sdk-platform-java/commit/b9a8c8924e7b03bca8a97e476abfd012b86f6d45)) + + +### Documentation + +* Fix retry guide link in javadocs ([#4029](https://github.com/googleapis/sdk-platform-java/issues/4029)) ([b43f77c](https://github.com/googleapis/sdk-platform-java/commit/b43f77c66d93d2423744d0f6d6a0a2a53a06e6d9)) + +## [2.64.2](https://github.com/googleapis/sdk-platform-java/compare/v2.64.1...v2.64.2) (2025-12-10) + + +### Bug Fixes + +* add per-service api_version to gapic_metadata ([#3984](https://github.com/googleapis/sdk-platform-java/issues/3984)) ([d589306](https://github.com/googleapis/sdk-platform-java/commit/d589306c4ecc12a2a744cb9dfb914ccea8fb34fd)) + + +### Dependencies + +* Upgrade auth to 1.41.0. ([#4008](https://github.com/googleapis/sdk-platform-java/issues/4008)) ([833b3e5](https://github.com/googleapis/sdk-platform-java/commit/833b3e54c0f13ac8183a639c4464dcf58fd44096)) +* upgrade grpc to 1.76.1 ([#3993](https://github.com/googleapis/sdk-platform-java/issues/3993)) ([958611e](https://github.com/googleapis/sdk-platform-java/commit/958611e23460dba596160f3224d8588afdba6bc2)) +* Upgrade grpc to 1.76.2 ([#4006](https://github.com/googleapis/sdk-platform-java/issues/4006)) ([a8060a2](https://github.com/googleapis/sdk-platform-java/commit/a8060a263ba34556b8d4d347a57625849a6859bc)) + +## [2.64.1](https://github.com/googleapis/sdk-platform-java/compare/v2.64.0...v2.64.1) (2025-11-07) + + +### Dependencies + +* bump opentelemetry.version to 1.52.0 ([#3979](https://github.com/googleapis/sdk-platform-java/issues/3979)) ([764778c](https://github.com/googleapis/sdk-platform-java/commit/764778cd63da247037e65d9a8ec3db93caccc806)) + +## [2.64.0](https://github.com/googleapis/sdk-platform-java/compare/v2.63.0...v2.64.0) (2025-10-31) + + +### Features + +* [common-protos] Add `Carousel` widget ([1e4a7e5](https://github.com/googleapis/sdk-platform-java/commit/1e4a7e5088c88e5752cc24cbe44b14b3ce409778)) +* **librariangen:** add generate package ([#3952](https://github.com/googleapis/sdk-platform-java/issues/3952)) ([2f6c75d](https://github.com/googleapis/sdk-platform-java/commit/2f6c75da3021d030c7a192f1fbb4b30908ef9dad)) +* **librariangen:** generate grpc stubs and resource helpers ([#3967](https://github.com/googleapis/sdk-platform-java/issues/3967)) ([452d703](https://github.com/googleapis/sdk-platform-java/commit/452d703b703ab3222fd1a7060ed5e1ac6363322b)) + + +### Dependencies + +* Bump grpc-java to v1.76.0 ([#3942](https://github.com/googleapis/sdk-platform-java/issues/3942)) ([ffb557c](https://github.com/googleapis/sdk-platform-java/commit/ffb557ce8f3460f722b27b30af5e470edd93431b)) + +## [2.63.0](https://github.com/googleapis/sdk-platform-java/compare/v2.62.3...v2.63.0) (2025-10-16) + + +### Features + +* **librariangen:** add bazel package ([#3940](https://github.com/googleapis/sdk-platform-java/issues/3940)) ([feabef3](https://github.com/googleapis/sdk-platform-java/commit/feabef32c4c45be0fb1db3615568365b902ece24)) +* **librariangen:** add execv package ([#3932](https://github.com/googleapis/sdk-platform-java/issues/3932)) ([f6b0b47](https://github.com/googleapis/sdk-platform-java/commit/f6b0b47a14eddd9c76540362b5922a5acc56b5d4)) +* **librariangen:** add protoc package ([#3935](https://github.com/googleapis/sdk-platform-java/issues/3935)) ([598de06](https://github.com/googleapis/sdk-platform-java/commit/598de0697957ea3b05b1347c0898108648c3d7d1)) +* **librariangen:** add request package ([#3933](https://github.com/googleapis/sdk-platform-java/issues/3933)) ([fe44aed](https://github.com/googleapis/sdk-platform-java/commit/fe44aede2aba9627db4aa0397d2ac4de353cea03)) +* **librariangen:** scaffold Java language container for Librarian ([#3926](https://github.com/googleapis/sdk-platform-java/issues/3926)) ([29d188d](https://github.com/googleapis/sdk-platform-java/commit/29d188d20e530570f46774b37d88703822774a33)) + + +### Dependencies + +* Bump errorprone-annotations to v2.42.0 ([8d6c1f9](https://github.com/googleapis/sdk-platform-java/commit/8d6c1f915ba5f0c4ac9b89120e63dddd62e37a22)) +* Bump guava to v33.5.0 ([8d6c1f9](https://github.com/googleapis/sdk-platform-java/commit/8d6c1f915ba5f0c4ac9b89120e63dddd62e37a22)) +* Bump j2objc-annotations to v3.1 ([8d6c1f9](https://github.com/googleapis/sdk-platform-java/commit/8d6c1f915ba5f0c4ac9b89120e63dddd62e37a22)) +* update google auth library dependencies to v1.40.0 ([#3945](https://github.com/googleapis/sdk-platform-java/issues/3945)) ([1d74663](https://github.com/googleapis/sdk-platform-java/commit/1d7466332b5dc13fde6ed687247873135a5fa919)) +* Upgrade Google Http Java Client to v2.0.2 ([#3946](https://github.com/googleapis/sdk-platform-java/issues/3946)) ([7fb4f15](https://github.com/googleapis/sdk-platform-java/commit/7fb4f155eef478c1a66bc2f1fdecd7565d225b3e)) + +## [2.62.3](https://github.com/googleapis/sdk-platform-java/compare/v2.62.2...v2.62.3) (2025-10-02) + + +### Bug Fixes + +* **mtls:** Fix EndpointContext's determineEndpoint logic to respect env var ([#3912](https://github.com/googleapis/sdk-platform-java/issues/3912)) ([e5948d0](https://github.com/googleapis/sdk-platform-java/commit/e5948d0cf27a2ee0ff03da3541524e0463356629)) + +## [2.62.2](https://github.com/googleapis/sdk-platform-java/compare/v2.62.1...v2.62.2) (2025-09-18) + + +### Dependencies + +* update google api dependencies ([#3885](https://github.com/googleapis/sdk-platform-java/issues/3885)) ([3694fed](https://github.com/googleapis/sdk-platform-java/commit/3694fed91e65966d074471942bd2e36075ba70d1)) +* update google auth library dependencies to v1.39.1 ([#3907](https://github.com/googleapis/sdk-platform-java/issues/3907)) ([e86a4f6](https://github.com/googleapis/sdk-platform-java/commit/e86a4f6535bc43b5382f22e790ccf2c76e8e9b23)) + +## [2.62.1](https://github.com/googleapis/sdk-platform-java/compare/v2.62.0...v2.62.1) (2025-09-05) + + +### Dependencies + +* Update auth to 1.39.0 ([#3898](https://github.com/googleapis/sdk-platform-java/issues/3898)) ([9a8443d](https://github.com/googleapis/sdk-platform-java/commit/9a8443d71cdbdb7a693b6da08db72edb85490807)) + +## [2.62.0](https://github.com/googleapis/sdk-platform-java/compare/v2.61.0...v2.62.0) (2025-08-19) + + +### Features + +* Set sampledToLocalTracing flag to true for all gRPC MethodDescriptors ([#3874](https://github.com/googleapis/sdk-platform-java/issues/3874)) ([592e899](https://github.com/googleapis/sdk-platform-java/commit/592e899c516288b0a60b69525ba12d6f29bc6200)) + +## [2.61.0](https://github.com/googleapis/sdk-platform-java/compare/v2.60.2...v2.61.0) (2025-08-04) + + +### Features + +* **mtls:** Add support for X.509-based mTLS-transport in Java GAX lib ([#3852](https://github.com/googleapis/sdk-platform-java/issues/3852)) ([2d02344](https://github.com/googleapis/sdk-platform-java/commit/2d02344d79f5cfdca7834aa0d6306f1b72a7505a)) + + +### Bug Fixes + +* improve error messaging for LRO CancellationException ([#3873](https://github.com/googleapis/sdk-platform-java/issues/3873)) ([9cae675](https://github.com/googleapis/sdk-platform-java/commit/9cae675f0ff44227cea60e6802769e82cce948f2)) +* make generation config update logs verbose ([#3764](https://github.com/googleapis/sdk-platform-java/issues/3764)) ([9b1a34b](https://github.com/googleapis/sdk-platform-java/commit/9b1a34b0dd08c0eddcf09ef5d81b225d0942f529)) + +## [2.60.2](https://github.com/googleapis/sdk-platform-java/compare/v2.60.1...v2.60.2) (2025-07-22) + + +### Dependencies + +* update arrow.version to 17.0.0, auth deps to 1.37.1 and http-client deps to 1.47.1 ([#3863](https://github.com/googleapis/sdk-platform-java/issues/3863)) ([b5bb3ca](https://github.com/googleapis/sdk-platform-java/commit/b5bb3ca6fc08d04e001a3ca83d4aac1627a5c504)) + +## [2.60.1](https://github.com/googleapis/sdk-platform-java/compare/v2.60.0...v2.60.1) (2025-07-08) + + +### Bug Fixes + +* **hermetic-build:** use public maven metadata for latest version inference ([#3853](https://github.com/googleapis/sdk-platform-java/issues/3853)) ([0be1e96](https://github.com/googleapis/sdk-platform-java/commit/0be1e9670079bcf6a9246d0284e59001c24242ea)) + +## [2.60.0](https://github.com/googleapis/sdk-platform-java/compare/v2.59.2...v2.60.0) (2025-06-23) + + +### Features + +* handle auto pagination for BigQuery v2 ([#3829](https://github.com/googleapis/sdk-platform-java/issues/3829)) ([025c84c](https://github.com/googleapis/sdk-platform-java/commit/025c84c6c9b8c49a9057a7b3ebd0eb1fab3cda13)) + + +### Dependencies + +* update google auth library dependencies to v1.37.1 ([#3846](https://github.com/googleapis/sdk-platform-java/issues/3846)) ([ea1d9e5](https://github.com/googleapis/sdk-platform-java/commit/ea1d9e5d3a0346d71a553216cf2486b3be6dc618)) +* update google http client dependencies to v1.47.1 ([#3848](https://github.com/googleapis/sdk-platform-java/issues/3848)) ([a9a39d7](https://github.com/googleapis/sdk-platform-java/commit/a9a39d7f814d1f45188c7b17de685b796c0b5aa7)) + +## [2.59.2](https://github.com/googleapis/sdk-platform-java/compare/v2.59.1...v2.59.2) (2025-06-17) + + +### Bug Fixes + +* update googleapis commit at Thu Jun 12 02:34:24 UTC 2025 ([f3a5d87](https://github.com/googleapis/sdk-platform-java/commit/f3a5d87ed2b5ab1acddd1bf362d11d6ccf3d22b4)) +* update googleapis commit at Thu Jun 12 02:34:24 UTC 2025 ([#3833](https://github.com/googleapis/sdk-platform-java/issues/3833)) ([f3a5d87](https://github.com/googleapis/sdk-platform-java/commit/f3a5d87ed2b5ab1acddd1bf362d11d6ccf3d22b4)) + +## [2.59.1](https://github.com/googleapis/sdk-platform-java/compare/v2.59.0...v2.59.1) (2025-06-12) + + +### Bug Fixes + +* S2A- Check if a default endpoint has been set ([#3784](https://github.com/googleapis/sdk-platform-java/issues/3784)) ([5b2ab82](https://github.com/googleapis/sdk-platform-java/commit/5b2ab829888631caa382621570910187de45ce1c)) + + +### Dependencies + +* update google auth library dependencies to v1.37.0 ([#3830](https://github.com/googleapis/sdk-platform-java/issues/3830)) ([8bf9d3c](https://github.com/googleapis/sdk-platform-java/commit/8bf9d3cbe0be80d0bd15dfb896514103293002e0)) + +## [2.59.0](https://github.com/googleapis/sdk-platform-java/compare/v2.58.0...v2.59.0) (2025-06-02) + + +### Features + +* add logic to set universe domain to ServiceAccountJwtAccessCredentials ([#3806](https://github.com/googleapis/sdk-platform-java/issues/3806)) ([5b45708](https://github.com/googleapis/sdk-platform-java/commit/5b45708d5ff92aae8e4138a737d294c71e1f235a)) +* use debian base image for `java-library-generation` ([#3817](https://github.com/googleapis/sdk-platform-java/issues/3817)) ([94d0b30](https://github.com/googleapis/sdk-platform-java/commit/94d0b30d94d79c74125811bf7353afe917e2fe6c)) + + +### Bug Fixes + +* manage graalvm image versions via Hermetic Build templates _only_ ([#3800](https://github.com/googleapis/sdk-platform-java/issues/3800)) ([244c5dc](https://github.com/googleapis/sdk-platform-java/commit/244c5dce9f77d0b431d2ec3ea5b101b07dcc3d70)) + + +### Dependencies + +* update dependency com.google.oauth-client:google-oauth-client-bom to v1.39.0 ([#3813](https://github.com/googleapis/sdk-platform-java/issues/3813)) ([196a7ca](https://github.com/googleapis/sdk-platform-java/commit/196a7cab502b5570f458f4cf4b324b99265e368c)) +* update google api dependencies ([#3791](https://github.com/googleapis/sdk-platform-java/issues/3791)) ([45ef2e0](https://github.com/googleapis/sdk-platform-java/commit/45ef2e0d595ab71555b0eee780962b08d2f073b6)) +* update google auth library dependencies to v1.36.0 ([#3814](https://github.com/googleapis/sdk-platform-java/issues/3814)) ([07f834a](https://github.com/googleapis/sdk-platform-java/commit/07f834a61201639ae771c179a229f7b5f794774d)) +* update grpc dependencies to 1.71.0 ([#3807](https://github.com/googleapis/sdk-platform-java/issues/3807)) ([49a7ae5](https://github.com/googleapis/sdk-platform-java/commit/49a7ae50071e75fe0d161a4eb9360a4fe4e6147b)) +* Upgrade Protobuf-Java to v3.25.8 ([#3810](https://github.com/googleapis/sdk-platform-java/issues/3810)) ([ab90662](https://github.com/googleapis/sdk-platform-java/commit/ab90662288a2181e16ecfb19c9ebb38fb9e29422)) + +## [2.58.0](https://github.com/googleapis/sdk-platform-java/compare/v2.57.0...v2.58.0) (2025-05-13) + + +### Features + +* add cloudbuild config to publish image via AR Exit Gate ([#3786](https://github.com/googleapis/sdk-platform-java/issues/3786)) ([5cc8857](https://github.com/googleapis/sdk-platform-java/commit/5cc88577f8c78fcac49bcbcbbc2715eef7bf031d)) + + +### Dependencies + +* update google auth library dependencies to v1.35.0 ([#3789](https://github.com/googleapis/sdk-platform-java/issues/3789)) ([93f4c95](https://github.com/googleapis/sdk-platform-java/commit/93f4c951ffb9f9a9b577f6971f47dfacdae7ac4f)) +* update google http client dependencies to v1.47.0 ([#3790](https://github.com/googleapis/sdk-platform-java/issues/3790)) ([4478e34](https://github.com/googleapis/sdk-platform-java/commit/4478e345bd935b3c31800648f7786399f46bb4c9)) + +## [2.57.0](https://github.com/googleapis/sdk-platform-java/compare/v2.56.3...v2.57.0) (2025-05-05) + + +### Features + +* Generate IAM v3beta Client Library ([#3780](https://github.com/googleapis/sdk-platform-java/issues/3780)) ([6fc9656](https://github.com/googleapis/sdk-platform-java/commit/6fc965638ce5df58db0b04726ee0aa3afe99c485)) + + +### Bug Fixes + +* Update IAM v3 groupId to the correct value ([#3777](https://github.com/googleapis/sdk-platform-java/issues/3777)) ([6ecbf5f](https://github.com/googleapis/sdk-platform-java/commit/6ecbf5f1c7731536089bdc255200beb85b1c3586)) + +## [2.56.3](https://github.com/googleapis/sdk-platform-java/compare/v2.56.2...v2.56.3) (2025-05-02) + + +### Bug Fixes + +* Only send mtlsEndpoint if it is non-null ([#3767](https://github.com/googleapis/sdk-platform-java/issues/3767)) ([8f8df7b](https://github.com/googleapis/sdk-platform-java/commit/8f8df7b8eb00adfb49db09e95383a88bdb9eff9e)) +* subscribe Airlock Docker image definition to GRPC updates ([#3765](https://github.com/googleapis/sdk-platform-java/issues/3765)) ([d0f43e3](https://github.com/googleapis/sdk-platform-java/commit/d0f43e33951a7c9da0fe2adb122f7c73038e9421)) + + +### Dependencies + +* update dependency com.google.errorprone:error_prone_annotations to v2.38.0 ([#3773](https://github.com/googleapis/sdk-platform-java/issues/3773)) ([e16fe65](https://github.com/googleapis/sdk-platform-java/commit/e16fe65fed7dc704fce37dfe6957246407dc6178)) +* update gapic-showcase to 36.2 ([#3771](https://github.com/googleapis/sdk-platform-java/issues/3771)) ([15b2577](https://github.com/googleapis/sdk-platform-java/commit/15b2577f67a130d6dbef2ae93da53ab2b49211c7)) +* update google auth library dependencies to v1.34.0 ([#3772](https://github.com/googleapis/sdk-platform-java/issues/3772)) ([406a180](https://github.com/googleapis/sdk-platform-java/commit/406a180969f865d13bf0e880db10c1a65f0ba536)) +* Update maven-shared-utils to v3.2.1 ([#3768](https://github.com/googleapis/sdk-platform-java/issues/3768)) ([7ec93c3](https://github.com/googleapis/sdk-platform-java/commit/7ec93c3015284ecc0e18e820088ebea5aa6975ff)) + +## [2.56.2](https://github.com/googleapis/sdk-platform-java/compare/v2.56.1...v2.56.2) (2025-04-23) + + +### Bug Fixes + +* inline version update in kokoro templates ([#3762](https://github.com/googleapis/sdk-platform-java/issues/3762)) ([050aeab](https://github.com/googleapis/sdk-platform-java/commit/050aeab4e84b6333aa1d4658ba62dcc68818c374)) +* keep native image templates up to date ([#3759](https://github.com/googleapis/sdk-platform-java/issues/3759)) ([7dffab1](https://github.com/googleapis/sdk-platform-java/commit/7dffab1251268736c9bf05b7d4bfcca06ed6576a)) + +## [2.56.1](https://github.com/googleapis/sdk-platform-java/compare/v2.56.0...v2.56.1) (2025-04-23) + + +### Bug Fixes + +* match graalvm job names with internal configs ([#3755](https://github.com/googleapis/sdk-platform-java/issues/3755)) ([23b4b12](https://github.com/googleapis/sdk-platform-java/commit/23b4b1277e3675cad1ebaa32c1115e8050501a0d)) +* use java 17 in samples.yaml ([#3754](https://github.com/googleapis/sdk-platform-java/issues/3754)) ([2d5c5e2](https://github.com/googleapis/sdk-platform-java/commit/2d5c5e28f56cc4332efd511bf9018c966a7c0458)) +* use spotify formatter in hermetic build templates ([#3752](https://github.com/googleapis/sdk-platform-java/issues/3752)) ([65e29da](https://github.com/googleapis/sdk-platform-java/commit/65e29dacaf533be61f2a14cbb8adeea316750911)) + +## [2.56.0](https://github.com/googleapis/sdk-platform-java/compare/v2.55.1...v2.56.0) (2025-04-18) + + +### Features + +* Selective gapic generation phase II ([#3730](https://github.com/googleapis/sdk-platform-java/issues/3730)) ([64ac2c1](https://github.com/googleapis/sdk-platform-java/commit/64ac2c1df1c3ddd46caaa82dd3553365691b66c6)) + + +### Bug Fixes + +* **hermetic-build:** use correct image name in templated graalvm jobs ([#3743](https://github.com/googleapis/sdk-platform-java/issues/3743)) ([29a78d3](https://github.com/googleapis/sdk-platform-java/commit/29a78d3b7b6ac8533790f6a3763cc7f8144826ee)) +* plumb mtls endpoint to TransportChannelProvider ([#3673](https://github.com/googleapis/sdk-platform-java/issues/3673)) ([a961459](https://github.com/googleapis/sdk-platform-java/commit/a9614593701d945a58b9e333b99589871f82ef33)) + + +### Dependencies + +* add opentelemetry gcp-resources to shared deps ([#3722](https://github.com/googleapis/sdk-platform-java/issues/3722)) ([b1b075d](https://github.com/googleapis/sdk-platform-java/commit/b1b075d0530c7b10dc92cdd9cad0801147b95fc7)) + +## [2.55.1](https://github.com/googleapis/sdk-platform-java/compare/v2.55.0...v2.55.1) (2025-03-12) + + +### Dependencies + +* revert "deps: update arrow.version to v18.2.0" ([#3694](https://github.com/googleapis/sdk-platform-java/issues/3694)) ([2725744](https://github.com/googleapis/sdk-platform-java/commit/272574489bc40b8b6379e5edb6ea5161b57bd687)) + +## [2.55.0](https://github.com/googleapis/sdk-platform-java/compare/v2.54.0...v2.55.0) (2025-03-12) + + +### Features + +* generate showcase using docker image ([#3568](https://github.com/googleapis/sdk-platform-java/issues/3568)) ([3857e3f](https://github.com/googleapis/sdk-platform-java/commit/3857e3f6dc633a9adaf29e9770a584419e2f2214)) +* next release from main branch is 2.55.0 ([#3668](https://github.com/googleapis/sdk-platform-java/issues/3668)) ([1eda55f](https://github.com/googleapis/sdk-platform-java/commit/1eda55fc5e4cecedba3f8c163db0ce259d180a66)) + + +### Bug Fixes + +* remove call credentials from call options if DirectPath ([#3670](https://github.com/googleapis/sdk-platform-java/issues/3670)) ([5ede29c](https://github.com/googleapis/sdk-platform-java/commit/5ede29cc9a3f4c585378b03a1b6c6a1e3eed8231)) + + +### Dependencies + +* update arrow.version to v18.2.0 ([#3675](https://github.com/googleapis/sdk-platform-java/issues/3675)) ([5a555e5](https://github.com/googleapis/sdk-platform-java/commit/5a555e5b553b65b0e61517271eafbc3bd7eeb735)) + +## [2.54.0](https://github.com/googleapis/sdk-platform-java/compare/v2.53.0...v2.54.0) (2025-02-25) + + +### Features + +* add client side logging with slf4j ([#3403](https://github.com/googleapis/sdk-platform-java/issues/3403)) ([fe002fa](https://github.com/googleapis/sdk-platform-java/commit/fe002fab1ab65b29eeb5510d1ba1ef72fa3441b0)) + + +### Bug Fixes + +* S2A gRPC flow creates ComputeEngineCredentials via newBuilder. ([#3651](https://github.com/googleapis/sdk-platform-java/issues/3651)) ([29c061e](https://github.com/googleapis/sdk-platform-java/commit/29c061e8a18b9a416262986f11c5148ea6fec9b2)) + + +### Dependencies + +* update dependency ch.qos.logback:logback-core to v1.3.15 [security] ([#3654](https://github.com/googleapis/sdk-platform-java/issues/3654)) ([093d867](https://github.com/googleapis/sdk-platform-java/commit/093d867eb5dcdcc08ece434598f96a6dff760326)) +* update google api dependencies ([#3631](https://github.com/googleapis/sdk-platform-java/issues/3631)) ([48db2a1](https://github.com/googleapis/sdk-platform-java/commit/48db2a10e3ef46ad9ddf23378613a550172f63af)) +* update google auth library dependencies to v1.33.1 ([#3656](https://github.com/googleapis/sdk-platform-java/issues/3656)) ([f7877a5](https://github.com/googleapis/sdk-platform-java/commit/f7877a5b278d3487cb50a1e942f6ff6268121069)) +* update google http client dependencies to v1.46.3 ([#3657](https://github.com/googleapis/sdk-platform-java/issues/3657)) ([9d5b3b5](https://github.com/googleapis/sdk-platform-java/commit/9d5b3b5ae6a18fbc8445025fa9ec1abe00b7f7cc)) +* update grpc to 1.70.0 ([#3641](https://github.com/googleapis/sdk-platform-java/issues/3641)) ([ad26cf9](https://github.com/googleapis/sdk-platform-java/commit/ad26cf98548e325c99edb263baf8fe1a7696e634)) +* update grpc to 1.70.0 (missed update) ([#3658](https://github.com/googleapis/sdk-platform-java/issues/3658)) ([6ca0599](https://github.com/googleapis/sdk-platform-java/commit/6ca05994f6be40344b21befb8cdabb0766a835d0)) +* Update opentelemetry-semconv to v1.29.0-alpha ([#3635](https://github.com/googleapis/sdk-platform-java/issues/3635)) ([49ac09d](https://github.com/googleapis/sdk-platform-java/commit/49ac09d263daad8ceb2e14a623db242339880670)) + + +### Documentation + +* update showcase readme ([#3659](https://github.com/googleapis/sdk-platform-java/issues/3659)) ([0ddf073](https://github.com/googleapis/sdk-platform-java/commit/0ddf0738a8ef74f5676a3bf76c306837d14988e0)) + +## [2.53.0](https://github.com/googleapis/sdk-platform-java/compare/v2.52.0...v2.53.0) (2025-02-10) + + +### Features + +* enable DirectPath bound token in InstantiatingGrpcChannelProvider ([#3572](https://github.com/googleapis/sdk-platform-java/issues/3572)) ([5080495](https://github.com/googleapis/sdk-platform-java/commit/5080495d5aa65e69f67a86ee54e1ee103b42d1ef)) +* Enable MTLS_S2A bound token by default for gRPC S2A enabled flows ([#3591](https://github.com/googleapis/sdk-platform-java/issues/3591)) ([81e21f2](https://github.com/googleapis/sdk-platform-java/commit/81e21f2ef98c9b0776d9bcffb13db667a8a885e6)) +* migrate away from deprecated graal-sdk dependency to use nativeimage ([#2706](https://github.com/googleapis/sdk-platform-java/issues/2706)) ([757801a](https://github.com/googleapis/sdk-platform-java/commit/757801aba582fd6224fc8504a3236568eef8a417)) + + +### Bug Fixes + +* Avoid creating message string prematurely for streaming calls ([#3622](https://github.com/googleapis/sdk-platform-java/issues/3622)) ([f805e70](https://github.com/googleapis/sdk-platform-java/commit/f805e7009add0d9512c70956569ea00f11fa42f9)) + + +### Dependencies + +* update dependency com.google.code.gson:gson to v2.12.0 ([#3595](https://github.com/googleapis/sdk-platform-java/issues/3595)) ([1f1b119](https://github.com/googleapis/sdk-platform-java/commit/1f1b119cc5ff13e6821285347da089e1297372b3)) +* update dependency com.google.code.gson:gson to v2.12.0 ([#3596](https://github.com/googleapis/sdk-platform-java/issues/3596)) ([af62f53](https://github.com/googleapis/sdk-platform-java/commit/af62f5317cac2fd163aee305f9347ae3f2fb729f)) +* update dependency com.google.code.gson:gson to v2.12.1 ([#3599](https://github.com/googleapis/sdk-platform-java/issues/3599)) ([18917ee](https://github.com/googleapis/sdk-platform-java/commit/18917ee918763d40603fc307ec0a446561d10601)) +* update dependency com.google.code.gson:gson to v2.12.1 ([#3600](https://github.com/googleapis/sdk-platform-java/issues/3600)) ([3f82836](https://github.com/googleapis/sdk-platform-java/commit/3f828360d32ae9d4a2015b623b5747c407520417)) +* update dependency commons-codec:commons-codec to v1.18.0 ([#3590](https://github.com/googleapis/sdk-platform-java/issues/3590)) ([cd46ba5](https://github.com/googleapis/sdk-platform-java/commit/cd46ba5e2105c5c009e4700a9c8da65f94e7b79a)) +* update dependency io.netty:netty-tcnative-boringssl-static to v2.0.70.final ([#3623](https://github.com/googleapis/sdk-platform-java/issues/3623)) ([a4d1f95](https://github.com/googleapis/sdk-platform-java/commit/a4d1f95e6803966313478f382918c39038a4728b)) +* update dependency lxml to v5.3.1 ([#3624](https://github.com/googleapis/sdk-platform-java/issues/3624)) ([5407646](https://github.com/googleapis/sdk-platform-java/commit/5407646c3010f65ea55941694e3f05d1fef02a53)) +* update dependency net.bytebuddy:byte-buddy to v1.17.0 ([#3582](https://github.com/googleapis/sdk-platform-java/issues/3582)) ([54d99e9](https://github.com/googleapis/sdk-platform-java/commit/54d99e9f2826d372eb305b65be08033baf0f2f16)) +* update dependency org.checkerframework:checker-qual to v3.49.0 ([#3604](https://github.com/googleapis/sdk-platform-java/issues/3604)) ([390cffa](https://github.com/googleapis/sdk-platform-java/commit/390cffa28f39273bc99c9083deb998da8c9d4e83)) +* update dependency org.graalvm.sdk:nativeimage to v24.1.2 ([#3597](https://github.com/googleapis/sdk-platform-java/issues/3597)) ([9d151c4](https://github.com/googleapis/sdk-platform-java/commit/9d151c422557749c5a61fad0ffaa0216b807cbdc)) +* update docker.io/library/maven:3.9.9-eclipse-temurin-11-alpine docker digest to 456f60c ([#3607](https://github.com/googleapis/sdk-platform-java/issues/3607)) ([c2d2768](https://github.com/googleapis/sdk-platform-java/commit/c2d276857f6ca0e86c91e15af5e08a737bd1510b)) +* update docker.io/library/maven:3.9.9-eclipse-temurin-11-alpine docker digest to d323c2b ([#3601](https://github.com/googleapis/sdk-platform-java/issues/3601)) ([ed35c23](https://github.com/googleapis/sdk-platform-java/commit/ed35c23d99bd9ebbd8840bb34a8a023de10e38cc)) +* update docker.io/library/python docker tag to v3.13.2 ([#3615](https://github.com/googleapis/sdk-platform-java/issues/3615)) ([ba007c2](https://github.com/googleapis/sdk-platform-java/commit/ba007c2f9ce63a9837e87f98241cabd7bf94f082)) +* update docker.io/library/python:3.13.1-alpine3.20 docker digest to 7788ec8 ([#3586](https://github.com/googleapis/sdk-platform-java/issues/3586)) ([a24d1ba](https://github.com/googleapis/sdk-platform-java/commit/a24d1bad2a9480b1f4ebdc938f589bfe0306257a)) +* update google api dependencies ([#3584](https://github.com/googleapis/sdk-platform-java/issues/3584)) ([08f2b7b](https://github.com/googleapis/sdk-platform-java/commit/08f2b7b472ad399f61b669a9d1f283211b142cc9)) +* update google auth library dependencies to v1.32.0 ([#3611](https://github.com/googleapis/sdk-platform-java/issues/3611)) ([9436eb0](https://github.com/googleapis/sdk-platform-java/commit/9436eb0c479af55a55ac465410b036887bc13d71)) +* update google auth library dependencies to v1.32.1 ([#3618](https://github.com/googleapis/sdk-platform-java/issues/3618)) ([88c78e2](https://github.com/googleapis/sdk-platform-java/commit/88c78e205888ed792ed0a4a78979534d6bfddf9b)) +* update google http client dependencies to v1.46.1 ([#3616](https://github.com/googleapis/sdk-platform-java/issues/3616)) ([2462105](https://github.com/googleapis/sdk-platform-java/commit/24621051c28eddada2499c6bf9830bbc77c45706)) +* update googleapis/java-cloud-bom digest to 47ad868 ([#3608](https://github.com/googleapis/sdk-platform-java/issues/3608)) ([2bcf9e0](https://github.com/googleapis/sdk-platform-java/commit/2bcf9e0acba526a38b0beae1cfe9f3520cd64552)) +* update googleapis/java-cloud-bom digest to 514a644 ([#3602](https://github.com/googleapis/sdk-platform-java/issues/3602)) ([172d4da](https://github.com/googleapis/sdk-platform-java/commit/172d4da07b7f06494327d9f7406c605ce8e577db)) +* update googleapis/java-cloud-bom digest to 7752ecd ([#3603](https://github.com/googleapis/sdk-platform-java/issues/3603)) ([06be924](https://github.com/googleapis/sdk-platform-java/commit/06be9247e756aa47a90a249232288fd14fafa4b8)) +* update netty dependencies to v4.1.117.final ([#3581](https://github.com/googleapis/sdk-platform-java/issues/3581)) ([2734dc0](https://github.com/googleapis/sdk-platform-java/commit/2734dc01c83cac661f48bf2587184fbadf88281e)) +* update netty dependencies to v4.1.118.final ([#3625](https://github.com/googleapis/sdk-platform-java/issues/3625)) ([16ff6bd](https://github.com/googleapis/sdk-platform-java/commit/16ff6bd68a43646ced530d0abbbc02962917bdfa)) +* update netty dependencies to v4.1.118.final ([#3626](https://github.com/googleapis/sdk-platform-java/issues/3626)) ([316c425](https://github.com/googleapis/sdk-platform-java/commit/316c42546a4aab60aa1ac0fc4eeae22be8d9889f)) +* Update OpenTelemetry semantic convention packages in the shared dependencies ([#3402](https://github.com/googleapis/sdk-platform-java/issues/3402)) ([0e69784](https://github.com/googleapis/sdk-platform-java/commit/0e69784af6825cd55ac6ce1ee74e42af6c9f94f5)) +* update opentelemetry-java monorepo to v1.46.0 ([#3585](https://github.com/googleapis/sdk-platform-java/issues/3585)) ([ac214be](https://github.com/googleapis/sdk-platform-java/commit/ac214bed8fb657142da821d897fbbf2ca7d1fc12)) +* update opentelemetry-java monorepo to v1.47.0 ([#3619](https://github.com/googleapis/sdk-platform-java/issues/3619)) ([66901df](https://github.com/googleapis/sdk-platform-java/commit/66901df3b0bd7cfb8a25d72aa52cd8505f1bfafa)) +* update repo-automation-bots digest to 35eff2c ([#3609](https://github.com/googleapis/sdk-platform-java/issues/3609)) ([b962a01](https://github.com/googleapis/sdk-platform-java/commit/b962a01918e56bfc5ca928aa9a5e29a311e71a38)) +* update repo-automation-bots digest to 3a68a9c ([#3620](https://github.com/googleapis/sdk-platform-java/issues/3620)) ([1d79552](https://github.com/googleapis/sdk-platform-java/commit/1d795525a6a30ae30bcac40dec903cd7cc743711)) + +## [2.52.0](https://github.com/googleapis/sdk-platform-java/compare/v2.51.1...v2.52.0) (2025-01-24) + + +### Features + +* add support for new setAllowHardBoundTokens field. ([#3467](https://github.com/googleapis/sdk-platform-java/issues/3467)) ([38431a2](https://github.com/googleapis/sdk-platform-java/commit/38431a290ed55174599be0927be32daaa1c49d56)) +* revert [#3400](https://github.com/googleapis/sdk-platform-java/issues/3400): reintroduce experimental S2A integration in client libraries grpc transport ([#3548](https://github.com/googleapis/sdk-platform-java/issues/3548)) ([65a0f11](https://github.com/googleapis/sdk-platform-java/commit/65a0f11d2c8bebade9518ff338103e92a332252c)) + + +### Dependencies + +* update dependency com.google.api-client:google-api-client-bom to v2.7.2 ([#3578](https://github.com/googleapis/sdk-platform-java/issues/3578)) ([f6e5ad9](https://github.com/googleapis/sdk-platform-java/commit/f6e5ad90aced32f8a738b2e52b30fcfa02c7af4b)) +* update dependency commons-codec:commons-codec to v1.17.2 ([#3557](https://github.com/googleapis/sdk-platform-java/issues/3557)) ([07ce801](https://github.com/googleapis/sdk-platform-java/commit/07ce801599479020629ce726afb9c06b2f711093)) +* update dependency gitpython to v3.1.44 ([#3559](https://github.com/googleapis/sdk-platform-java/issues/3559)) ([e924db0](https://github.com/googleapis/sdk-platform-java/commit/e924db06590648ad40b5b3aa0f6269084270064b)) +* update dependency org.checkerframework:checker-qual to v3.48.4 ([#3560](https://github.com/googleapis/sdk-platform-java/issues/3560)) ([a4726e9](https://github.com/googleapis/sdk-platform-java/commit/a4726e9d96e9f54d839b6822a6372b1905839b6d)) +* update dependency smmap to v5.0.2 ([#3561](https://github.com/googleapis/sdk-platform-java/issues/3561)) ([6cd5d0d](https://github.com/googleapis/sdk-platform-java/commit/6cd5d0dfa4c5cd981b2d27771ca4b681ef415c63)) +* update docker.io/library/alpine docker tag to v3.21.1 ([#3551](https://github.com/googleapis/sdk-platform-java/issues/3551)) ([edd5a4c](https://github.com/googleapis/sdk-platform-java/commit/edd5a4c04db6b16cb005301d4dbcd3f8c28b7537)) +* update docker.io/library/alpine docker tag to v3.21.2 ([#3580](https://github.com/googleapis/sdk-platform-java/issues/3580)) ([f577ecd](https://github.com/googleapis/sdk-platform-java/commit/f577ecd044fc30dbeb2209292ecc6dcfdedaa758)) +* update docker.io/library/maven:3.9.9-eclipse-temurin-11-alpine docker digest to 9a259c6 ([#3554](https://github.com/googleapis/sdk-platform-java/issues/3554)) ([eb2cbd6](https://github.com/googleapis/sdk-platform-java/commit/eb2cbd6515ded9278ffd0dae92af80b321e95c25)) +* update docker.io/library/python:3.13.1-alpine3.20 docker digest to 9ab3b6e ([#3555](https://github.com/googleapis/sdk-platform-java/issues/3555)) ([40a74fe](https://github.com/googleapis/sdk-platform-java/commit/40a74fe322b9cc4fc50919e17472c617dd331e86)) +* update google auth library dependencies to v1.31.0 ([#3577](https://github.com/googleapis/sdk-platform-java/issues/3577)) ([7fa879a](https://github.com/googleapis/sdk-platform-java/commit/7fa879a0e795094d481c090123d612f0e3a3968e)) +* update googleapis/java-cloud-bom digest to c7c443f ([#3579](https://github.com/googleapis/sdk-platform-java/issues/3579)) ([fcf40b7](https://github.com/googleapis/sdk-platform-java/commit/fcf40b72d43346e43d78d1e87060be6e621e9d52)) +* update repo-automation-bots digest to 0a12b5d ([#3464](https://github.com/googleapis/sdk-platform-java/issues/3464)) ([b9c9d21](https://github.com/googleapis/sdk-platform-java/commit/b9c9d212ea57598de5ddf2e4ead2ee323c5a8135)) + +## [2.51.1](https://github.com/googleapis/sdk-platform-java/compare/v2.51.0...v2.51.1) (2025-01-08) + + +### Dependencies + +* update dependency com.google.guava:guava to v33.4.0-jre ([#3473](https://github.com/googleapis/sdk-platform-java/issues/3473)) ([453b897](https://github.com/googleapis/sdk-platform-java/commit/453b897aabf9a7abdb59e9ea18ac8f8196b9792a)) +* update dependency com.google.guava:guava-bom to v33.4.0-jre ([#3545](https://github.com/googleapis/sdk-platform-java/issues/3545)) ([07eb10e](https://github.com/googleapis/sdk-platform-java/commit/07eb10e848d73a2e8d1d39018e2ec31b881653c8)) +* update dependency com.google.oauth-client:google-oauth-client-bom to v1.37.0 ([#3471](https://github.com/googleapis/sdk-platform-java/issues/3471)) ([1f1c369](https://github.com/googleapis/sdk-platform-java/commit/1f1c369633f0ae9b5b512a2908befdcd1c9cb952)) +* update dependency net.bytebuddy:byte-buddy to v1.15.11 ([#3468](https://github.com/googleapis/sdk-platform-java/issues/3468)) ([fde27db](https://github.com/googleapis/sdk-platform-java/commit/fde27db7f7959953cf480abfa62dc7dc58ac445e)) +* update google api dependencies ([#3461](https://github.com/googleapis/sdk-platform-java/issues/3461)) ([12d9ff2](https://github.com/googleapis/sdk-platform-java/commit/12d9ff26e6ab905e6230703a671e188690ec1322)) +* update googleapis/java-cloud-bom digest to 03f6dcd ([#3465](https://github.com/googleapis/sdk-platform-java/issues/3465)) ([67f5ea2](https://github.com/googleapis/sdk-platform-java/commit/67f5ea23f50eaf57925cdf34d51c7b0bfcc67cf3)) +* update junit5 monorepo to v5.11.4 ([#3470](https://github.com/googleapis/sdk-platform-java/issues/3470)) ([164ebac](https://github.com/googleapis/sdk-platform-java/commit/164ebac30632ca8fd688781b4aaecc5eab932f77)) +* update netty dependencies to v4.1.116.final ([#3543](https://github.com/googleapis/sdk-platform-java/issues/3543)) ([d4fa54d](https://github.com/googleapis/sdk-platform-java/commit/d4fa54d8b25afeacc4c9675f4763a3bff311f595)) +* update repo-automation-bots digest to 8b7d94b ([#3458](https://github.com/googleapis/sdk-platform-java/issues/3458)) ([59f9e0a](https://github.com/googleapis/sdk-platform-java/commit/59f9e0a3a101d5425b0c751b39e6b784466e16b8)) + + +### Documentation + +* update development guide ([#3480](https://github.com/googleapis/sdk-platform-java/issues/3480)) ([9a65386](https://github.com/googleapis/sdk-platform-java/commit/9a65386dfc3146de4f9b36962caae2df0662ac98)) + +## [2.51.0](https://github.com/googleapis/sdk-platform-java/compare/v2.50.0...v2.51.0) (2024-12-12) + + +### Features + +* [iam] add ResourcePolicyMember to google/iam/v1 ([b8e2859](https://github.com/googleapis/sdk-platform-java/commit/b8e28597774d778fc6b79354edbfacbbd76015af)) + + +### Bug Fixes + +* [#3381](https://github.com/googleapis/sdk-platform-java/issues/3381) ([75dcb96](https://github.com/googleapis/sdk-platform-java/commit/75dcb96b799990bec9998b420463aa782fb65661)) +* graalvm missing build time class when using protobuf 4.x ([#3438](https://github.com/googleapis/sdk-platform-java/issues/3438)) ([f0236cf](https://github.com/googleapis/sdk-platform-java/commit/f0236cfc102cf7ce06e1f733a4f40a50133d6b24)) +* return all library names if repo-level parameter changes ([#3379](https://github.com/googleapis/sdk-platform-java/issues/3379)) ([75dcb96](https://github.com/googleapis/sdk-platform-java/commit/75dcb96b799990bec9998b420463aa782fb65661)), closes [#3381](https://github.com/googleapis/sdk-platform-java/issues/3381) + + +### Dependencies + +* update dependency com.fasterxml.jackson:jackson-bom to v2.18.2 ([#3422](https://github.com/googleapis/sdk-platform-java/issues/3422)) ([fdc3a54](https://github.com/googleapis/sdk-platform-java/commit/fdc3a5427836fcc5e9052fed736c178d7e7bdf18)) +* update dependency com.google.api-client:google-api-client-bom to v2.7.1 ([#3450](https://github.com/googleapis/sdk-platform-java/issues/3450)) ([35f1310](https://github.com/googleapis/sdk-platform-java/commit/35f1310cde638c89cf6680282e82f442821afe65)) +* update dependency com.google.auth:google-auth-library-oauth2-http to v1.30.0 ([#3428](https://github.com/googleapis/sdk-platform-java/issues/3428)) ([78cbff1](https://github.com/googleapis/sdk-platform-java/commit/78cbff1af55fb804400df5307b0df464936e0bae)) +* update dependency com.google.errorprone:error_prone_annotations to v2.36.0 ([#3425](https://github.com/googleapis/sdk-platform-java/issues/3425)) ([52dcc0d](https://github.com/googleapis/sdk-platform-java/commit/52dcc0d7aa525a18329a56fefe8a3b97efd6b1d3)) +* update dependency com.google.errorprone:error_prone_annotations to v2.36.0 ([#3426](https://github.com/googleapis/sdk-platform-java/issues/3426)) ([77dd85d](https://github.com/googleapis/sdk-platform-java/commit/77dd85d5cc7ad39d5dbbb5bab3bb17863fc8b9c9)) +* update dependency dev.cel:cel to v0.8.0 ([#3429](https://github.com/googleapis/sdk-platform-java/issues/3429)) ([79cde20](https://github.com/googleapis/sdk-platform-java/commit/79cde2028c2ec307001c6bedd4310a78d04f379e)) +* update dependency io.github.java-diff-utils:java-diff-utils to v4.15 ([#3430](https://github.com/googleapis/sdk-platform-java/issues/3430)) ([91fd5cb](https://github.com/googleapis/sdk-platform-java/commit/91fd5cb4aaf6ca02a0f73d664c0dbe283d13e989)) +* update dependency net.bytebuddy:byte-buddy to v1.15.10 ([#3298](https://github.com/googleapis/sdk-platform-java/issues/3298)) ([7b503de](https://github.com/googleapis/sdk-platform-java/commit/7b503dead0c8142630a5b05142e1e8a07f7300c3)) +* update dependency org.checkerframework:checker-qual to v3.48.3 ([#3278](https://github.com/googleapis/sdk-platform-java/issues/3278)) ([c5fd1b4](https://github.com/googleapis/sdk-platform-java/commit/c5fd1b4e201de5d042c3e0999ab74ad2a1bd6c17)) +* update dependency org.easymock:easymock to v5.5.0 ([#3431](https://github.com/googleapis/sdk-platform-java/issues/3431)) ([3c22f5e](https://github.com/googleapis/sdk-platform-java/commit/3c22f5e8dc73d867689df3f63c97580c908dfeb5)) +* update dependency packaging to v24.2 ([#3432](https://github.com/googleapis/sdk-platform-java/issues/3432)) ([c1e7c81](https://github.com/googleapis/sdk-platform-java/commit/c1e7c81b68e46a6a7e350cc3d857df48254e337b)) +* update docker.io/library/alpine docker tag to v3.21.0 ([#3433](https://github.com/googleapis/sdk-platform-java/issues/3433)) ([c8318c2](https://github.com/googleapis/sdk-platform-java/commit/c8318c243857242f155d9a78b3a4ff24e31a1b7e)) +* update docker.io/library/alpine:3.20.3 docker digest to 1e42bbe ([#3417](https://github.com/googleapis/sdk-platform-java/issues/3417)) ([0f4ef19](https://github.com/googleapis/sdk-platform-java/commit/0f4ef19b9fa30155fa7630b7b5b95495da646043)) +* update docker.io/library/maven:3.9.9-eclipse-temurin-11-alpine docker digest to 3bab9f2 ([#3447](https://github.com/googleapis/sdk-platform-java/issues/3447)) ([ccf7eac](https://github.com/googleapis/sdk-platform-java/commit/ccf7eacf19c70e1063fc4e15d6340bc0d6c6dac0)) +* update docker.io/library/maven:3.9.9-eclipse-temurin-11-alpine docker digest to cdfb386 ([#3418](https://github.com/googleapis/sdk-platform-java/issues/3418)) ([2559ff8](https://github.com/googleapis/sdk-platform-java/commit/2559ff8998f1cc8f1cb279a02520ad9ee7bac776)) +* update docker.io/library/python docker tag to v3.13.1 ([#3434](https://github.com/googleapis/sdk-platform-java/issues/3434)) ([feefd27](https://github.com/googleapis/sdk-platform-java/commit/feefd2788ac7447f2778bb971f5d752d93ef3b0e)) +* update google api dependencies ([#3435](https://github.com/googleapis/sdk-platform-java/issues/3435)) ([3a1e8f2](https://github.com/googleapis/sdk-platform-java/commit/3a1e8f214a28b514956a6f4ce3857fe89856c4a0)) +* update google auth library dependencies to v1.30.1 ([#3453](https://github.com/googleapis/sdk-platform-java/issues/3453)) ([d7b7dd9](https://github.com/googleapis/sdk-platform-java/commit/d7b7dd98314de957b048c9ddb70ad3089f39fc63)) +* update google http client dependencies to v1.45.2 ([#3394](https://github.com/googleapis/sdk-platform-java/issues/3394)) ([f8ee892](https://github.com/googleapis/sdk-platform-java/commit/f8ee89227ac6b095b186db8c81d067aa5af9bc66)) +* update google http client dependencies to v1.45.3 ([#3454](https://github.com/googleapis/sdk-platform-java/issues/3454)) ([a112559](https://github.com/googleapis/sdk-platform-java/commit/a112559ef0ac4f70d53dcc7ba1c5eaa73b6cc3c1)) +* update google.cloud.opentelemetry.version to v0.33.0 ([#3436](https://github.com/googleapis/sdk-platform-java/issues/3436)) ([e519626](https://github.com/googleapis/sdk-platform-java/commit/e519626e2dc538ff8291f94b699e54b37d50d6a4)) +* update googleapis/java-cloud-bom digest to 93740d5 ([#3280](https://github.com/googleapis/sdk-platform-java/issues/3280)) ([f987db5](https://github.com/googleapis/sdk-platform-java/commit/f987db5dc8bc0f5f8bd7805a2596e13055343cc0)) +* update grpc dependencies to v1.68.2 ([#3420](https://github.com/googleapis/sdk-platform-java/issues/3420)) ([6d0a169](https://github.com/googleapis/sdk-platform-java/commit/6d0a169065b99c00e88592c1caa608447e0fc4e8)) +* update grpc dependencies to v1.69.0 ([#3451](https://github.com/googleapis/sdk-platform-java/issues/3451)) ([0effb37](https://github.com/googleapis/sdk-platform-java/commit/0effb371f88fd7c911861ab7aca7d67c52cc4ad0)) +* update junit5 monorepo to v5.11.3 ([#3310](https://github.com/googleapis/sdk-platform-java/issues/3310)) ([4e33f2b](https://github.com/googleapis/sdk-platform-java/commit/4e33f2b8ff9e169e96f59683a21bb08dc086c110)) +* update netty dependencies ([#3423](https://github.com/googleapis/sdk-platform-java/issues/3423)) ([22ea7b5](https://github.com/googleapis/sdk-platform-java/commit/22ea7b533241660aba124062b0a5d6a5cbfcef7b)) +* update opentelemetry-java monorepo to v1.44.1 ([#3437](https://github.com/googleapis/sdk-platform-java/issues/3437)) ([66b85da](https://github.com/googleapis/sdk-platform-java/commit/66b85da86faef954274d4208f074ca52ad4aebc4)) +* update opentelemetry-java monorepo to v1.45.0 ([#3439](https://github.com/googleapis/sdk-platform-java/issues/3439)) ([d29475a](https://github.com/googleapis/sdk-platform-java/commit/d29475a7ad89e96026f3c710e331976902a161b7)) +* update repo-automation-bots digest to 6662ddc ([#3421](https://github.com/googleapis/sdk-platform-java/issues/3421)) ([dec5de0](https://github.com/googleapis/sdk-platform-java/commit/dec5de0e628ad9be6bd5fb8d768d50918c2edab7)) +* update repo-automation-bots digest to 8230b4e ([#3448](https://github.com/googleapis/sdk-platform-java/issues/3448)) ([e53199b](https://github.com/googleapis/sdk-platform-java/commit/e53199be9632c2f8cc6a94ba25f3aa3567d63ffa)) +* update repo-automation-bots digest to ae0a72f ([#3452](https://github.com/googleapis/sdk-platform-java/issues/3452)) ([331bacf](https://github.com/googleapis/sdk-platform-java/commit/331bacf1b222d9282e116c4b829140407d9b9127)) +* update repo-automation-bots digest to f3fbbab ([#3419](https://github.com/googleapis/sdk-platform-java/issues/3419)) ([343a029](https://github.com/googleapis/sdk-platform-java/commit/343a029a75e7e325f069e0e2aebb131d79a26901)) + + +### Documentation + +* explain default generation config in `README.md` ([#3388](https://github.com/googleapis/sdk-platform-java/issues/3388)) ([2ac86de](https://github.com/googleapis/sdk-platform-java/commit/2ac86de1baf263e92cb442b970a86350d54bbca5)) +* hermetic build README syntax fix ([#3391](https://github.com/googleapis/sdk-platform-java/issues/3391)) ([cf32e72](https://github.com/googleapis/sdk-platform-java/commit/cf32e72d83c06d1d36e1eea01afc37bee5766455)) + +## [2.50.0](https://github.com/googleapis/sdk-platform-java/compare/v2.49.0...v2.50.0) (2024-11-14) + + +### Features + +* Add experimental S2A integration in client libraries grpc transport ([#3326](https://github.com/googleapis/sdk-platform-java/issues/3326)) ([1138ca6](https://github.com/googleapis/sdk-platform-java/commit/1138ca682cd47d6164ceaa47803bfe2f68b1bc14)) +* enable selective generation based on service config include list ([#3323](https://github.com/googleapis/sdk-platform-java/issues/3323)) ([0cddadb](https://github.com/googleapis/sdk-platform-java/commit/0cddadb8ad3eddfffa356a479964d8a720937503)) +* introduce `java.time` to java-core ([#3330](https://github.com/googleapis/sdk-platform-java/issues/3330)) ([f202c3b](https://github.com/googleapis/sdk-platform-java/commit/f202c3b550936168b9876860853876aa6d51c6a1)) +* Update Gapic-Generator to generate libraries using `java.time` methods ([#3321](https://github.com/googleapis/sdk-platform-java/issues/3321)) ([b21c9a4](https://github.com/googleapis/sdk-platform-java/commit/b21c9a42121c22a1ab229d2d485265c271305110)) + + +### Bug Fixes + +* Fix flaky test ScheduledRetryingExecutorTest.testCancelOuterFutureAfterStart ([#3335](https://github.com/googleapis/sdk-platform-java/issues/3335)) ([e73740d](https://github.com/googleapis/sdk-platform-java/commit/e73740dbdb21d7c28908554fe3725504dc8ce84b)) +* httpjson callables to trace attempts (started, failed) ([#3300](https://github.com/googleapis/sdk-platform-java/issues/3300)) ([15a64ee](https://github.com/googleapis/sdk-platform-java/commit/15a64ee2e63165e50fd07b2b3a40f0d2ef2edfe2)) +* instantiate GaxProperties at build time to ensure we get the protobuf version ([#3365](https://github.com/googleapis/sdk-platform-java/issues/3365)) ([bb2a3be](https://github.com/googleapis/sdk-platform-java/commit/bb2a3be87291ae718ac0e8538025a0867a6b6ff6)) +* protobuf version not always getting set in headers ([#3322](https://github.com/googleapis/sdk-platform-java/issues/3322)) ([7f6e470](https://github.com/googleapis/sdk-platform-java/commit/7f6e470fea1673a5cf50fe3b49263615a172afde)) +* use BuildKit instead of legacy builder to build the Hermetic Build images ([#3338](https://github.com/googleapis/sdk-platform-java/issues/3338)) ([222fb45](https://github.com/googleapis/sdk-platform-java/commit/222fb452e00bd195ad51389ea308993a7e1bc956)) + + +### Dependencies + +* update google auth library dependencies to v1.30.0 ([#3367](https://github.com/googleapis/sdk-platform-java/issues/3367)) ([a31c682](https://github.com/googleapis/sdk-platform-java/commit/a31c68232584bf90bc00ace8310adeab8fa26add)) +* update grpc dependencies to v1.68.1 ([#3240](https://github.com/googleapis/sdk-platform-java/issues/3240)) ([c8e3941](https://github.com/googleapis/sdk-platform-java/commit/c8e3941ef6f5bd1236f5ceedfd488e5113928471)) + + +### Documentation + +* fix list num ([#3356](https://github.com/googleapis/sdk-platform-java/issues/3356)) ([b7d6296](https://github.com/googleapis/sdk-platform-java/commit/b7d62968cd837a7addc06da8b9bc2131c36c7fbc)) +* **hermetic-build:** indicate usage of Docker Buildkit in development guide ([#3337](https://github.com/googleapis/sdk-platform-java/issues/3337)) ([01e742d](https://github.com/googleapis/sdk-platform-java/commit/01e742de49e151efbd903808a859f595f99bc8de)) +* modify hermetic build docs ([#3331](https://github.com/googleapis/sdk-platform-java/issues/3331)) ([25023af](https://github.com/googleapis/sdk-platform-java/commit/25023afad8f483a3eae8846c4bc1fbe2c7a260c5)) + +## [2.49.0](https://github.com/googleapis/sdk-platform-java/compare/v2.48.0...v2.49.0) (2024-10-25) + + +### Features + +* Move release note generation to a sub module ([#3299](https://github.com/googleapis/sdk-platform-java/issues/3299)) ([7d6d66a](https://github.com/googleapis/sdk-platform-java/commit/7d6d66a161db5edc538aec065405954acf4434c5)) + + +### Bug Fixes + +* add additional potential exceptions when retrieving protobuf manifest file to get version ([#3315](https://github.com/googleapis/sdk-platform-java/issues/3315)) ([ef9e518](https://github.com/googleapis/sdk-platform-java/commit/ef9e5189740ea5be46ad0d51c2ff554cd99ac162)) + + +### Dependencies + +* update dependency com.google.errorprone:error_prone_annotations to v2.35.1 ([#3316](https://github.com/googleapis/sdk-platform-java/issues/3316)) ([d7c290f](https://github.com/googleapis/sdk-platform-java/commit/d7c290f3e49c8ec7c480229e2c8ae38fcdcd99f6)) + +## [2.48.0](https://github.com/googleapis/sdk-platform-java/compare/v2.47.0...v2.48.0) (2024-10-22) + + +### Features + +* **gax:** add protobuf version tracking to headers ([#3199](https://github.com/googleapis/sdk-platform-java/issues/3199)) ([40c19b1](https://github.com/googleapis/sdk-platform-java/commit/40c19b1aad71da176aeafbba32a0a4b51b5a4366)) +* selectively generate libraries ([#3290](https://github.com/googleapis/sdk-platform-java/issues/3290)) ([dfe1a50](https://github.com/googleapis/sdk-platform-java/commit/dfe1a50ec857cc2998bcbfbc2d8af6801f0ae260)) + + +### Bug Fixes + +* generator setting incorrect name/class for sample due to region tag (2nd attempt) ([#3293](https://github.com/googleapis/sdk-platform-java/issues/3293)) ([771bd0e](https://github.com/googleapis/sdk-platform-java/commit/771bd0e9cb306e430dc15e79a189648830101865)) + + +### Dependencies + +* update dependency com.google.errorprone:error_prone_annotations to v2.34.0 ([#3303](https://github.com/googleapis/sdk-platform-java/issues/3303)) ([5b01274](https://github.com/googleapis/sdk-platform-java/commit/5b0127480ac1358b183d971e432939779f1238ad)) +* update dependency com.google.errorprone:error_prone_annotations to v2.34.0 ([#3304](https://github.com/googleapis/sdk-platform-java/issues/3304)) ([5bd6c9c](https://github.com/googleapis/sdk-platform-java/commit/5bd6c9ceaab11f96c6e50ca8ce9c66c1c1369d5c)) +* update google api dependencies ([#3282](https://github.com/googleapis/sdk-platform-java/issues/3282)) ([a9eac85](https://github.com/googleapis/sdk-platform-java/commit/a9eac851c57989ab45c4e1b28171ea043506bcd9)) +* update google auth library dependencies to v1.29.0 ([#3302](https://github.com/googleapis/sdk-platform-java/issues/3302)) ([e64eda2](https://github.com/googleapis/sdk-platform-java/commit/e64eda231bc3a1a32d56eb5269ae8d3c53ed26de)) + +## [2.47.0](https://github.com/googleapis/sdk-platform-java/compare/v2.46.1...v2.47.0) (2024-10-04) + + +### Features + +* **gax:** add API key authentication to ClientSettings ([#3137](https://github.com/googleapis/sdk-platform-java/issues/3137)) ([df08956](https://github.com/googleapis/sdk-platform-java/commit/df08956a26fa63b287241f3a37058c689c34d245)) +* **gax:** append cred-type header for auth metrics ([#3186](https://github.com/googleapis/sdk-platform-java/issues/3186)) ([ca3ec24](https://github.com/googleapis/sdk-platform-java/commit/ca3ec24f506f0d43623a92ba0eed908f874fe488)) + + +### Bug Fixes + +* address incorrect universe domain validation when quota project id is set ([#3257](https://github.com/googleapis/sdk-platform-java/issues/3257)) ([6e70c37](https://github.com/googleapis/sdk-platform-java/commit/6e70c3705280576278a790a4228476ac996ef9da)), closes [#3256](https://github.com/googleapis/sdk-platform-java/issues/3256) +* Disable automatically retrieving Universe Domain from Metadata Server ([#3272](https://github.com/googleapis/sdk-platform-java/issues/3272)) ([f4402bf](https://github.com/googleapis/sdk-platform-java/commit/f4402bfa717831507e9e54d057d11ff69594e46b)) + + +### Dependencies + +* update dependency com.fasterxml.jackson:jackson-bom to v2.18.0 ([#3248](https://github.com/googleapis/sdk-platform-java/issues/3248)) ([821e83d](https://github.com/googleapis/sdk-platform-java/commit/821e83d8cef94594f8c8e832c40e319c232cb1b9)) +* update dependency com.google.errorprone:error_prone_annotations to v2.33.0 ([#3265](https://github.com/googleapis/sdk-platform-java/issues/3265)) ([94450a9](https://github.com/googleapis/sdk-platform-java/commit/94450a9699d94a078e5f5fa106f4d1ce4282a605)) +* update dependency com.google.errorprone:error_prone_annotations to v2.33.0 ([#3266](https://github.com/googleapis/sdk-platform-java/issues/3266)) ([8235463](https://github.com/googleapis/sdk-platform-java/commit/8235463dc2bc05382359d09702be55e2063f4908)) +* update dependency com.google.guava:guava to v33.3.1-jre ([#3228](https://github.com/googleapis/sdk-platform-java/issues/3228)) ([4e76207](https://github.com/googleapis/sdk-platform-java/commit/4e762078a59e6fd92453bb5a1395730f6f442524)) +* update dependency net.bytebuddy:byte-buddy to v1.15.3 ([#3246](https://github.com/googleapis/sdk-platform-java/issues/3246)) ([2aad71d](https://github.com/googleapis/sdk-platform-java/commit/2aad71dda5fe2bb0cdbe823392cccb36cfea6abb)) +* update google api dependencies ([#3242](https://github.com/googleapis/sdk-platform-java/issues/3242)) ([02aae9d](https://github.com/googleapis/sdk-platform-java/commit/02aae9d919b5c7170eb88d08d0ee79f71a0c5762)) +* update google auth library dependencies to v1.28.0 ([#3267](https://github.com/googleapis/sdk-platform-java/issues/3267)) ([6d85864](https://github.com/googleapis/sdk-platform-java/commit/6d85864779ae61cecddc3eaa9d8991ed4053a253)) +* update googleapis/java-cloud-bom digest to 0cd97b7 ([#3260](https://github.com/googleapis/sdk-platform-java/issues/3260)) ([2d54a5d](https://github.com/googleapis/sdk-platform-java/commit/2d54a5d2825e0956c76f68e22426bbb7665fdb12)) +* update grpc dependencies to v1.67.1 ([#3258](https://github.com/googleapis/sdk-platform-java/issues/3258)) ([e08906c](https://github.com/googleapis/sdk-platform-java/commit/e08906cd86146bfa4f62bbc5e507bf04a0956a37)) +* update grpc dependencies to v1.67.1 in dependencies.properties ([#3279](https://github.com/googleapis/sdk-platform-java/issues/3279)) ([5b46e70](https://github.com/googleapis/sdk-platform-java/commit/5b46e7036d65f350c21a5c922997b4d38532f994)) +* update junit5 monorepo to v5.11.2 ([#3276](https://github.com/googleapis/sdk-platform-java/issues/3276)) ([6b10f94](https://github.com/googleapis/sdk-platform-java/commit/6b10f94c56e8769ff41bb58c77b8c45dafeacc45)) +* update netty dependencies to v4.1.114.final ([#3263](https://github.com/googleapis/sdk-platform-java/issues/3263)) ([8bd83d9](https://github.com/googleapis/sdk-platform-java/commit/8bd83d9ed0794f2aa2f771d6f28d492ecb98500f)) + +## [2.46.1](https://github.com/googleapis/sdk-platform-java/compare/v2.46.0...v2.46.1) (2024-09-25) + + +### Dependencies + +* update dependency black to v24.8.0 ([#3234](https://github.com/googleapis/sdk-platform-java/issues/3234)) ([73d803b](https://github.com/googleapis/sdk-platform-java/commit/73d803b0dddca82a32c1789a9f92bc48431850aa)) +* update dependency lxml to v5.3.0 ([#3237](https://github.com/googleapis/sdk-platform-java/issues/3237)) ([ee2d05a](https://github.com/googleapis/sdk-platform-java/commit/ee2d05a1d7cb03615ba190802e4e720be2955345)) +* update dependency net.bytebuddy:byte-buddy to v1.15.2 ([#3235](https://github.com/googleapis/sdk-platform-java/issues/3235)) ([a7781a6](https://github.com/googleapis/sdk-platform-java/commit/a7781a6ab3a052f60a51b4d1d06464553dcd6b5c)) +* update dependency pyyaml to v6.0.2 ([#3231](https://github.com/googleapis/sdk-platform-java/issues/3231)) ([ce60bdf](https://github.com/googleapis/sdk-platform-java/commit/ce60bdf2c95ce3e9e549f1a9a2eb788424e3d454)) +* update dependency watchdog to v4.0.2 ([#3232](https://github.com/googleapis/sdk-platform-java/issues/3232)) ([ab0976b](https://github.com/googleapis/sdk-platform-java/commit/ab0976b196afb3ff67aca17f121d01bb511375c3)) +* update google api dependencies ([#3224](https://github.com/googleapis/sdk-platform-java/issues/3224)) ([4803738](https://github.com/googleapis/sdk-platform-java/commit/4803738938bf7f602baca025b4bdfbef13f6202e)) +* update google.cloud.opentelemetry.version to v0.32.0 ([#3225](https://github.com/googleapis/sdk-platform-java/issues/3225)) ([69e3e38](https://github.com/googleapis/sdk-platform-java/commit/69e3e38a680cfb5fc9dbcb1fea67d39c89945bdd)) +* update grpc dependencies to v1.68.0 ([#3220](https://github.com/googleapis/sdk-platform-java/issues/3220)) ([f6e30a5](https://github.com/googleapis/sdk-platform-java/commit/f6e30a57816affeb1802d3266b6166ec174a06ee)) +* update junit5 monorepo to v5.11.1 ([#3236](https://github.com/googleapis/sdk-platform-java/issues/3236)) ([8b42993](https://github.com/googleapis/sdk-platform-java/commit/8b42993767c6bba36f396156a5e84217d83c7c57)) + +## [2.46.0](https://github.com/googleapis/sdk-platform-java/compare/v2.45.0...v2.46.0) (2024-09-23) + + +### Features + +* expose property in GrpcTransportChannel if it uses direct path. ([#3170](https://github.com/googleapis/sdk-platform-java/issues/3170)) ([9a432f7](https://github.com/googleapis/sdk-platform-java/commit/9a432f7ce042fb2470ca99817200e0ff82a83c39)) +* generate a GAPIC library from api definition ([#3208](https://github.com/googleapis/sdk-platform-java/issues/3208)) ([b6b5d7b](https://github.com/googleapis/sdk-platform-java/commit/b6b5d7bbe2743034def0859105da146134d9b1b0)) +* Metrics tracer addAttribute map overload ([#3202](https://github.com/googleapis/sdk-platform-java/issues/3202)) ([1a988df](https://github.com/googleapis/sdk-platform-java/commit/1a988df22f7e3d15ce6b121bf26897c59ab468e4)) + + +### Bug Fixes + +* generate pr description with repo level change ([#3182](https://github.com/googleapis/sdk-platform-java/issues/3182)) ([edd2168](https://github.com/googleapis/sdk-platform-java/commit/edd2168fdc7ba7ea9ae328736cb5d39adf950929)) + + +### Dependencies + +* update dependency com.google.errorprone:error_prone_annotations to v2.32.0 ([#3192](https://github.com/googleapis/sdk-platform-java/issues/3192)) ([b280706](https://github.com/googleapis/sdk-platform-java/commit/b28070686ed1360084cd95beb622b78966f4960c)) +* update dependency com.google.errorprone:error_prone_annotations to v2.32.0 ([#3193](https://github.com/googleapis/sdk-platform-java/issues/3193)) ([ed0cd17](https://github.com/googleapis/sdk-platform-java/commit/ed0cd1729b6b964d730a8c5f38589939aab3fd8a)) +* update dependency filelock to v3.16.1 ([#3210](https://github.com/googleapis/sdk-platform-java/issues/3210)) ([703ac3d](https://github.com/googleapis/sdk-platform-java/commit/703ac3d0b73d5388d60b910bcd26bcde6327a0a3)) +* update dependency idna to v3.10 ([#3201](https://github.com/googleapis/sdk-platform-java/issues/3201)) ([211c3ec](https://github.com/googleapis/sdk-platform-java/commit/211c3ecdec1a088267dc3c2765f5eb3835496c9b)) +* update dependency org.threeten:threetenbp to v1.7.0 ([#3205](https://github.com/googleapis/sdk-platform-java/issues/3205)) ([c88a722](https://github.com/googleapis/sdk-platform-java/commit/c88a722c09080b18ecbb9ba94dec56f152de5eb9)) +* update dependency org.threeten:threetenbp to v1.7.0 ([#3206](https://github.com/googleapis/sdk-platform-java/issues/3206)) ([3e9fbac](https://github.com/googleapis/sdk-platform-java/commit/3e9fbacf65411521c87e67f3dd33f392276e8200)) +* update dependency platformdirs to v4.3.3 ([#3200](https://github.com/googleapis/sdk-platform-java/issues/3200)) ([b62b05d](https://github.com/googleapis/sdk-platform-java/commit/b62b05de5295484b48b36fcbf9b94887184d05d4)) +* update dependency platformdirs to v4.3.6 ([#3209](https://github.com/googleapis/sdk-platform-java/issues/3209)) ([227ffa5](https://github.com/googleapis/sdk-platform-java/commit/227ffa5a841c29b91f848453e8be2accf44041f3)) +* update dependency urllib3 to v2.2.3 ([#3194](https://github.com/googleapis/sdk-platform-java/issues/3194)) ([f69d511](https://github.com/googleapis/sdk-platform-java/commit/f69d511d89a50d88bb45fd113611e4f94886696b)) +* update dependency virtualenv to v20.26.5 ([#3212](https://github.com/googleapis/sdk-platform-java/issues/3212)) ([d3ef97a](https://github.com/googleapis/sdk-platform-java/commit/d3ef97a5b9f5252a1e503b638261746a7cf4dc77)) +* update google api dependencies ([#3183](https://github.com/googleapis/sdk-platform-java/issues/3183)) ([02eea8d](https://github.com/googleapis/sdk-platform-java/commit/02eea8d62e5e2d019a97545429346810e00bcaa6)) +* update google auth library dependencies to v1.26.0 ([#3216](https://github.com/googleapis/sdk-platform-java/issues/3216)) ([0b369e9](https://github.com/googleapis/sdk-platform-java/commit/0b369e9ba6551eae6d2041ce430912b56ae9b394)) +* update google auth library dependencies to v1.27.0 ([#3221](https://github.com/googleapis/sdk-platform-java/issues/3221)) ([a3cb9e7](https://github.com/googleapis/sdk-platform-java/commit/a3cb9e75839ceb811f9e264073758691068e4a95)) +* update googleapis/java-cloud-bom digest to 06f632d ([#3198](https://github.com/googleapis/sdk-platform-java/issues/3198)) ([49dcd35](https://github.com/googleapis/sdk-platform-java/commit/49dcd3535fc2836df3a5d7b1665051cd54d09f29)) +* update googleapis/java-cloud-bom digest to e7d8909 ([#3207](https://github.com/googleapis/sdk-platform-java/issues/3207)) ([de497ee](https://github.com/googleapis/sdk-platform-java/commit/de497ee716a4fd0ab3bc64d66c1dc24af11c0368)) +* update opentelemetry-java monorepo to v1.42.1 ([#3189](https://github.com/googleapis/sdk-platform-java/issues/3189)) ([38117d8](https://github.com/googleapis/sdk-platform-java/commit/38117d8b92930abc6e6922a4c46654d02e823f67)) +* Upgrade Protobuf-Java to v3.25.5 ([#3217](https://github.com/googleapis/sdk-platform-java/issues/3217)) ([860c1bc](https://github.com/googleapis/sdk-platform-java/commit/860c1bcfc213fe7b21969c80282c8c08637cd3ba)) + +## [2.45.0](https://github.com/googleapis/sdk-platform-java/compare/v2.44.0...v2.45.0) (2024-09-09) + + +### Features + +* add Batcher#close(timeout) and Batcher#cancelOutstanding ([#3141](https://github.com/googleapis/sdk-platform-java/issues/3141)) ([b5a92e4](https://github.com/googleapis/sdk-platform-java/commit/b5a92e4495b33ad797f9a071a97828460dacd80f)) +* add full RetrySettings sample code to Settings classes ([#3056](https://github.com/googleapis/sdk-platform-java/issues/3056)) ([8fe3a2d](https://github.com/googleapis/sdk-platform-java/commit/8fe3a2d4cfac5d038bcf12afe849c9182073920e)) +* add toString to futures returned by operations ([#3140](https://github.com/googleapis/sdk-platform-java/issues/3140)) ([afecb8c](https://github.com/googleapis/sdk-platform-java/commit/afecb8c43c48067931b3fed78cf2eec55d983f9c)) +* bake gapic-generator-java into the hermetic build docker image ([#3067](https://github.com/googleapis/sdk-platform-java/issues/3067)) ([a372e82](https://github.com/googleapis/sdk-platform-java/commit/a372e82ad322e409cd49196e96abee62cbc567ea)) + + +### Bug Fixes + +* **gax:** prevent truncation/overflow when converting time values ([#3095](https://github.com/googleapis/sdk-platform-java/issues/3095)) ([699074e](https://github.com/googleapis/sdk-platform-java/commit/699074e2db06c4d6d7ebfa235cc2aaeee695fdb4)) + + +### Dependencies + +* add opentelemetry exporter-metrics and shared-resoucemapping to shared dependencies ([#3078](https://github.com/googleapis/sdk-platform-java/issues/3078)) ([fc8d80d](https://github.com/googleapis/sdk-platform-java/commit/fc8d80d11182259c0c15d36c6427db5ba316735d)) +* update dependency certifi to v2024.8.30 ([#3150](https://github.com/googleapis/sdk-platform-java/issues/3150)) ([c18b705](https://github.com/googleapis/sdk-platform-java/commit/c18b705149d32ecfbfd298c0a414dba067b6a7a9)) +* update dependency com.google.api-client:google-api-client-bom to v2.7.0 ([#3151](https://github.com/googleapis/sdk-platform-java/issues/3151)) ([5f43e43](https://github.com/googleapis/sdk-platform-java/commit/5f43e43351ee26ee3729218c0dfe282f20c9053b)) +* update dependency com.google.errorprone:error_prone_annotations to v2.31.0 ([#3153](https://github.com/googleapis/sdk-platform-java/issues/3153)) ([3071509](https://github.com/googleapis/sdk-platform-java/commit/307150935e3b9e1000570f869e5ad14901fd0513)) +* update dependency com.google.errorprone:error_prone_annotations to v2.31.0 ([#3154](https://github.com/googleapis/sdk-platform-java/issues/3154)) ([335ee63](https://github.com/googleapis/sdk-platform-java/commit/335ee63577616eecdbd1d3ccd0526393eb0e50be)) +* update dependency com.google.guava:guava to v33.3.0-jre ([#3119](https://github.com/googleapis/sdk-platform-java/issues/3119)) ([41174b0](https://github.com/googleapis/sdk-platform-java/commit/41174b04a5d4e5cff02dab95d5249e21b8d80496)) +* update dependency dev.cel:cel to v0.7.1 ([#3155](https://github.com/googleapis/sdk-platform-java/issues/3155)) ([b1ddd16](https://github.com/googleapis/sdk-platform-java/commit/b1ddd16158d30aa7716caa4ec408bf45bb3a7a69)) +* update dependency filelock to v3.16.0 ([#3175](https://github.com/googleapis/sdk-platform-java/issues/3175)) ([6681113](https://github.com/googleapis/sdk-platform-java/commit/6681113f1e71c9d0aa4fe0e9d641bf06ccc93f88)) +* update dependency idna to v3.8 ([#3156](https://github.com/googleapis/sdk-platform-java/issues/3156)) ([82f5326](https://github.com/googleapis/sdk-platform-java/commit/82f5326b3f6b94a87009f58f8599780ebfdf77c2)) +* update dependency io.netty:netty-tcnative-boringssl-static to v2.0.66.final ([#3148](https://github.com/googleapis/sdk-platform-java/issues/3148)) ([a7efaa8](https://github.com/googleapis/sdk-platform-java/commit/a7efaa8a06c016878ba8083ddbf4588506f7653e)) +* update dependency net.bytebuddy:byte-buddy to v1.15.1 ([#3115](https://github.com/googleapis/sdk-platform-java/issues/3115)) ([0e06c5f](https://github.com/googleapis/sdk-platform-java/commit/0e06c5f51f13b5de6dab18391d9738ed7c9452ff)) +* update dependency org.apache.commons:commons-lang3 to v3.17.0 ([#3157](https://github.com/googleapis/sdk-platform-java/issues/3157)) ([8d3b9fd](https://github.com/googleapis/sdk-platform-java/commit/8d3b9fd1f1872a10635a3e82a2be75c5b964d582)) +* update dependency org.checkerframework:checker-qual to v3.47.0 ([#3166](https://github.com/googleapis/sdk-platform-java/issues/3166)) ([365674d](https://github.com/googleapis/sdk-platform-java/commit/365674d51bee846aeb0aab2491659d59e48b7512)) +* update dependency org.yaml:snakeyaml to v2.3 ([#3158](https://github.com/googleapis/sdk-platform-java/issues/3158)) ([e67ea9a](https://github.com/googleapis/sdk-platform-java/commit/e67ea9af7d2334d225f75eef2dd24490ee90a442)) +* update dependency platformdirs to v4.3.2 ([#3176](https://github.com/googleapis/sdk-platform-java/issues/3176)) ([4f2f9e0](https://github.com/googleapis/sdk-platform-java/commit/4f2f9e027d1413e1beca1092c20e2e542227ca28)) +* update dependency virtualenv to v20.26.4 ([#3177](https://github.com/googleapis/sdk-platform-java/issues/3177)) ([080e078](https://github.com/googleapis/sdk-platform-java/commit/080e07879d9493a0f1ad53b1c44c181805ef1d25)) +* update google api dependencies ([#3118](https://github.com/googleapis/sdk-platform-java/issues/3118)) ([67342ea](https://github.com/googleapis/sdk-platform-java/commit/67342ea9f11643f02bf215193f7c760d7a05ca2e)) +* update google auth library dependencies to v1.25.0 ([#3168](https://github.com/googleapis/sdk-platform-java/issues/3168)) ([715884a](https://github.com/googleapis/sdk-platform-java/commit/715884ab21c0b3bb526f280ffb100d3f621a5c6c)) +* update google http client dependencies to v1.45.0 ([#3159](https://github.com/googleapis/sdk-platform-java/issues/3159)) ([a3fe612](https://github.com/googleapis/sdk-platform-java/commit/a3fe612476904f34afdf0009fbd53d58aac5ad85)) +* update googleapis/java-cloud-bom digest to 6626f91 ([#3147](https://github.com/googleapis/sdk-platform-java/issues/3147)) ([658e40e](https://github.com/googleapis/sdk-platform-java/commit/658e40e7b7f1673b8f82c537a255aa0c294ee4aa)) +* update junit5 monorepo to v5.11.0 ([#3111](https://github.com/googleapis/sdk-platform-java/issues/3111)) ([6bf84c8](https://github.com/googleapis/sdk-platform-java/commit/6bf84c86ffa3cbc74691ab8de82d69fb0eb75bf9)) +* update netty dependencies to v4.1.113.final ([#3165](https://github.com/googleapis/sdk-platform-java/issues/3165)) ([9b5957d](https://github.com/googleapis/sdk-platform-java/commit/9b5957da2e584569dea523ebcb1af47d49e7a749)) +* update opentelemetry-java monorepo to v1.42.0 ([#3172](https://github.com/googleapis/sdk-platform-java/issues/3172)) ([413c44e](https://github.com/googleapis/sdk-platform-java/commit/413c44e1dbe466b68eb8a5a62b707c2e9544ffaf)) + + +### Documentation + +* Update DEVELOPMENT.md ([#3126](https://github.com/googleapis/sdk-platform-java/issues/3126)) ([92bdf4e](https://github.com/googleapis/sdk-platform-java/commit/92bdf4e19a8c3df365c067142a7aa112a004be20)) + +## [2.44.0](https://github.com/googleapis/sdk-platform-java/compare/v2.43.0...v2.44.0) (2024-08-16) + + +### Features + +* update ErrorDetails to allow unpacking arbitrary messages ([#3073](https://github.com/googleapis/sdk-platform-java/issues/3073)) ([6913db5](https://github.com/googleapis/sdk-platform-java/commit/6913db5c64e35ec8925c25a04ebd6d529895c4fe)) + + +### Bug Fixes + +* Generator callable generation is based on method type ([#3075](https://github.com/googleapis/sdk-platform-java/issues/3075)) ([c21a013](https://github.com/googleapis/sdk-platform-java/commit/c21a0139cccb9001951cab81f4c5ffe3ae51d7c5)) +* improve warnings for Direct Path xDS set via env ([#3019](https://github.com/googleapis/sdk-platform-java/issues/3019)) ([7a26115](https://github.com/googleapis/sdk-platform-java/commit/7a26115078d23e430e190c62556c014c440fcab2)) + + +### Dependencies + +* update dependency argcomplete to v3.5.0 ([#3099](https://github.com/googleapis/sdk-platform-java/issues/3099)) ([0654a28](https://github.com/googleapis/sdk-platform-java/commit/0654a289b745e153e4f41b02cbdc180e3ca9a231)) +* update dependency black to v24.8.0 ([#3082](https://github.com/googleapis/sdk-platform-java/issues/3082)) ([a864f62](https://github.com/googleapis/sdk-platform-java/commit/a864f622023e096f207cf6fe3321f92d1b9f4560)) +* update dependency com.google.crypto.tink:tink to v1.14.1 ([#3083](https://github.com/googleapis/sdk-platform-java/issues/3083)) ([c13b63e](https://github.com/googleapis/sdk-platform-java/commit/c13b63e1e4b391650eb6a0949d1fbc2319a28de6)) +* update dependency com.google.errorprone:error_prone_annotations to v2.30.0 ([#3100](https://github.com/googleapis/sdk-platform-java/issues/3100)) ([a10ef54](https://github.com/googleapis/sdk-platform-java/commit/a10ef54fcd86c321bf15acd4fe5fa96f9937d318)) +* update dependency com.google.errorprone:error_prone_annotations to v2.30.0 ([#3101](https://github.com/googleapis/sdk-platform-java/issues/3101)) ([9bff64f](https://github.com/googleapis/sdk-platform-java/commit/9bff64f416c3eb046cca30ff974a9e9c4b5cebd2)) +* update dependency lxml to v5.3.0 ([#3102](https://github.com/googleapis/sdk-platform-java/issues/3102)) ([4e145b1](https://github.com/googleapis/sdk-platform-java/commit/4e145b128b1b964346fc7c1c874d57d9eedc00d2)) +* update dependency org.apache.commons:commons-lang3 to v3.16.0 ([#3103](https://github.com/googleapis/sdk-platform-java/issues/3103)) ([95c9508](https://github.com/googleapis/sdk-platform-java/commit/95c9508bd9a20f82687c80def38e510fc539eec3)) +* update dependency org.checkerframework:checker-qual to v3.46.0 ([#3081](https://github.com/googleapis/sdk-platform-java/issues/3081)) ([2431920](https://github.com/googleapis/sdk-platform-java/commit/243192089386122c255a4296761775ec80a1fcd0)) +* update dependency org.easymock:easymock to v5.4.0 ([#3079](https://github.com/googleapis/sdk-platform-java/issues/3079)) ([182ae50](https://github.com/googleapis/sdk-platform-java/commit/182ae507f9323e5a5861b240e976a0127d1eea04)) +* update dependency pyyaml to v6.0.2 ([#3086](https://github.com/googleapis/sdk-platform-java/issues/3086)) ([f847e45](https://github.com/googleapis/sdk-platform-java/commit/f847e45c19d45be57d59e9d6887047d2c12b8267)) +* update dependency watchdog to v4.0.2 ([#3094](https://github.com/googleapis/sdk-platform-java/issues/3094)) ([f1c75a1](https://github.com/googleapis/sdk-platform-java/commit/f1c75a15f2462644a58e4a836db6c51cca4ba0a1)) +* update google api dependencies ([#3071](https://github.com/googleapis/sdk-platform-java/issues/3071)) ([c5abe90](https://github.com/googleapis/sdk-platform-java/commit/c5abe907ed063f86571634b2df67bca5a6334abf)) +* update google auth library dependencies to v1.24.1 ([#3109](https://github.com/googleapis/sdk-platform-java/issues/3109)) ([62acdd6](https://github.com/googleapis/sdk-platform-java/commit/62acdd6f1246c8bd95eec4a53f8cd1896e48ae53)) +* update googleapis/java-cloud-bom digest to a98202d ([#3097](https://github.com/googleapis/sdk-platform-java/issues/3097)) ([bb216ae](https://github.com/googleapis/sdk-platform-java/commit/bb216ae8834f5ea169ebfd9a790743680edec053)) +* update googleapis/java-cloud-bom digest to ad905cc ([#3080](https://github.com/googleapis/sdk-platform-java/issues/3080)) ([250b26c](https://github.com/googleapis/sdk-platform-java/commit/250b26c5af6f8c78eec94a4c3a42d3a72e06b1e5)) +* update grpc dependencies to v1.66.0 ([#3104](https://github.com/googleapis/sdk-platform-java/issues/3104)) ([b63b643](https://github.com/googleapis/sdk-platform-java/commit/b63b643b7f6067278406fe56c125f8497aec108f)) +* update opentelemetry-java monorepo to v1.41.0 ([#3105](https://github.com/googleapis/sdk-platform-java/issues/3105)) ([7364916](https://github.com/googleapis/sdk-platform-java/commit/7364916ec5f997d93c668c34e77eef8b9c77d9a5)) +* update protobuf to 3.25.4 ([#3113](https://github.com/googleapis/sdk-platform-java/issues/3113)) ([2b271fc](https://github.com/googleapis/sdk-platform-java/commit/2b271fcd7e5db7f1cab3c5210e8137288497f09f)) +* update slf4j monorepo to v2.0.16 ([#3098](https://github.com/googleapis/sdk-platform-java/issues/3098)) ([c13f932](https://github.com/googleapis/sdk-platform-java/commit/c13f93264a0fe6643b343fa7a72bd4a59856c3e1)) + + +### Documentation + +* Update the Javadoc of ObsoleteApi.java ([#3088](https://github.com/googleapis/sdk-platform-java/issues/3088)) ([0ef6619](https://github.com/googleapis/sdk-platform-java/commit/0ef66196744e21fc3b4e2553d817c0dea5efe127)) + +## [2.43.0](https://github.com/googleapis/sdk-platform-java/compare/v2.42.0...v2.43.0) (2024-07-25) + + +### Features + +* add `transport` option to `generation_config.yaml` ([#3052](https://github.com/googleapis/sdk-platform-java/issues/3052)) ([3b1a915](https://github.com/googleapis/sdk-platform-java/commit/3b1a91551ab6bbaf6a46950e1677c15cdd70d2e9)) +* get released version from versions.txt to render `README.md` ([#3007](https://github.com/googleapis/sdk-platform-java/issues/3007)) ([99bb2b3](https://github.com/googleapis/sdk-platform-java/commit/99bb2b339eadd480dcc1753d4ba3aeda3b5c64de)) +* Introduce java.time to Gax-Java ([#1872](https://github.com/googleapis/sdk-platform-java/issues/1872)) ([308aeaf](https://github.com/googleapis/sdk-platform-java/commit/308aeafc9f04795d2e1df8206c84689b11c4323a)) +* Mark `getDefaultEndpoint()` with @ObsoleteApi ([#2347](https://github.com/googleapis/sdk-platform-java/issues/2347)) ([e46648f](https://github.com/googleapis/sdk-platform-java/commit/e46648f112a149f967783539d30b4c44474b39fe)) +* parse `BUILD.bzel` to determine whether a commit that only changed `BUILD.bazel` is a qualified commit ([#2937](https://github.com/googleapis/sdk-platform-java/issues/2937)) ([502f801](https://github.com/googleapis/sdk-platform-java/commit/502f80101dec191befb660a1aba6d0c354758c18)) + + +### Bug Fixes + +* Fix: ([d996c2d](https://github.com/googleapis/sdk-platform-java/commit/d996c2dfb4b1cb115e0a2cd117eebd8a4ab41cad)) +* `BaseApiTracer` to noop on attemptFailed via overloaded method call ([#3016](https://github.com/googleapis/sdk-platform-java/issues/3016)) ([2fc938a](https://github.com/googleapis/sdk-platform-java/commit/2fc938a819f4a2da9cfd25d2d306b62f53fa1f91)) +* Generator to skip generation for empty services. ([#3051](https://github.com/googleapis/sdk-platform-java/issues/3051)) ([ff2c485](https://github.com/googleapis/sdk-platform-java/commit/ff2c48543940bb0ceb78392b0f5af67568823002)) +* restore hermetic build image publication ([#2952](https://github.com/googleapis/sdk-platform-java/issues/2952)) ([97a6d67](https://github.com/googleapis/sdk-platform-java/commit/97a6d678569b7d8768ff83fe5370d8966a06ca95)) + + +### Dependencies + +* update dependency com.fasterxml.jackson:jackson-bom to v2.17.2 ([#3028](https://github.com/googleapis/sdk-platform-java/issues/3028)) ([d16f9d1](https://github.com/googleapis/sdk-platform-java/commit/d16f9d114a75fb8a77dfc39edf6fe2aa2f967704)) +* update dependency com.google.cloud.opentelemetry:detector-resources-support to v0.30.0 ([#2975](https://github.com/googleapis/sdk-platform-java/issues/2975)) ([b3ec93f](https://github.com/googleapis/sdk-platform-java/commit/b3ec93f1925ff5a92b47200a61303e5561dbb1b8)) +* update dependency com.google.cloud.opentelemetry:detector-resources-support to v0.31.0 ([#3044](https://github.com/googleapis/sdk-platform-java/issues/3044)) ([6bd07dc](https://github.com/googleapis/sdk-platform-java/commit/6bd07dc9fb589c72cf7b86bb2e0137687e1f61f2)) +* update dependency com.google.errorprone:error_prone_annotations to v2.29.2 ([#3058](https://github.com/googleapis/sdk-platform-java/issues/3058)) ([8ea0868](https://github.com/googleapis/sdk-platform-java/commit/8ea0868e9e67a4c58075b98de0cf7b51635ea2f8)) +* update dependency com.google.errorprone:error_prone_annotations to v2.29.2 ([#3059](https://github.com/googleapis/sdk-platform-java/issues/3059)) ([81b23dc](https://github.com/googleapis/sdk-platform-java/commit/81b23dc88eeff492f6cef6328ce3b5d32992f500)) +* update dependency com.google.guava:guava to v33.2.1-jre ([#3027](https://github.com/googleapis/sdk-platform-java/issues/3027)) ([12ee456](https://github.com/googleapis/sdk-platform-java/commit/12ee456727d0cd9d86aeadd65e633b5d7abb3d50)) +* update dependency commons-codec:commons-codec to v1.17.1 ([#3049](https://github.com/googleapis/sdk-platform-java/issues/3049)) ([58d94b7](https://github.com/googleapis/sdk-platform-java/commit/58d94b795db06fa76099c871501d2a1f7465633b)) +* update dependency dev.cel:cel to v0.6.0 ([#3050](https://github.com/googleapis/sdk-platform-java/issues/3050)) ([bc332d9](https://github.com/googleapis/sdk-platform-java/commit/bc332d95919c0a1909e43f4ab7c7fe4db406697e)) +* update dependency net.bytebuddy:byte-buddy to v1.14.18 ([#3029](https://github.com/googleapis/sdk-platform-java/issues/3029)) ([8799cf6](https://github.com/googleapis/sdk-platform-java/commit/8799cf602a3204a4adeaf4f48000979e49107959)) +* update dependency org.apache.commons:commons-lang3 to v3.15.0 ([#3060](https://github.com/googleapis/sdk-platform-java/issues/3060)) ([2538334](https://github.com/googleapis/sdk-platform-java/commit/2538334aff96a4ad70a26bac2141d3235856b1a1)) +* update dependency org.checkerframework:checker-qual to v3.45.0 ([#2988](https://github.com/googleapis/sdk-platform-java/issues/2988)) ([4edd216](https://github.com/googleapis/sdk-platform-java/commit/4edd216163662008ee1060b6eb82ca673045826f)) +* update google api dependencies ([#2951](https://github.com/googleapis/sdk-platform-java/issues/2951)) ([c16f6c9](https://github.com/googleapis/sdk-platform-java/commit/c16f6c95636b4997861ef3914b06f7819a8bd69a)) +* update google auth library dependencies to v1.24.0 ([#3039](https://github.com/googleapis/sdk-platform-java/issues/3039)) ([98b5bd7](https://github.com/googleapis/sdk-platform-java/commit/98b5bd7d2ddb98c7e52bffd0b93c5661a1c9d39b)) +* update googleapis/java-cloud-bom digest to 47c5dbc ([#2974](https://github.com/googleapis/sdk-platform-java/issues/2974)) ([57623f0](https://github.com/googleapis/sdk-platform-java/commit/57623f08441969e0ff0170a72779fb8425ff6592)) +* update grpc dependencies to v1.65.1 ([#3061](https://github.com/googleapis/sdk-platform-java/issues/3061)) ([27497e2](https://github.com/googleapis/sdk-platform-java/commit/27497e215cda4e8ad17fce2faa794b600edfc4cd)) +* update junit5 monorepo to v5.10.3 ([#2963](https://github.com/googleapis/sdk-platform-java/issues/2963)) ([bc55fe1](https://github.com/googleapis/sdk-platform-java/commit/bc55fe1fe55876ee3b4843cefb05ee401c323865)) +* update netty dependencies to v4.1.112.final ([#3057](https://github.com/googleapis/sdk-platform-java/issues/3057)) ([5af127b](https://github.com/googleapis/sdk-platform-java/commit/5af127be3d9dadcdf0d9a5519ce6ad3b2e3bb481)) +* update opentelemetry-java monorepo to v1.40.0 ([#3035](https://github.com/googleapis/sdk-platform-java/issues/3035)) ([5c31c42](https://github.com/googleapis/sdk-platform-java/commit/5c31c4211993f25d2c352ef8f3e085187bc5fd30)) +* Use Gapic-Showcase v0.35.1 ([#3018](https://github.com/googleapis/sdk-platform-java/issues/3018)) ([43773f0](https://github.com/googleapis/sdk-platform-java/commit/43773f0cf2418051b2c0e6245100973b8ce2152e)) + + +### Documentation + +* add support option to 'new issue' choices ([#3055](https://github.com/googleapis/sdk-platform-java/issues/3055)) ([6a2a17d](https://github.com/googleapis/sdk-platform-java/commit/6a2a17d1d84da9d45a4be6675ea6ca0235b42c99)) + +## [2.42.0](https://github.com/googleapis/sdk-platform-java/compare/v2.41.0...v2.42.0) (2024-06-25) + + +### Features + +* Allow Adding Client Level Attributes to MetricsTracerFactory ([#2614](https://github.com/googleapis/sdk-platform-java/issues/2614)) ([f122c6f](https://github.com/googleapis/sdk-platform-java/commit/f122c6f3beebd005a257fe687cf018baf7673b63)) +* gapic-generator-java to perform a no-op when no services are detected ([#2460](https://github.com/googleapis/sdk-platform-java/issues/2460)) ([c0b5646](https://github.com/googleapis/sdk-platform-java/commit/c0b56462a1550c3720a3e5d0b11dcc1a21add7ef)) +* Make Layout Parser generally available in V1 ([e508ae6](https://github.com/googleapis/sdk-platform-java/commit/e508ae69e13455ba2f5c325e0c33d9ff2704e3b1)) +* populate `.repo-metadata.json` from highest version ([#2890](https://github.com/googleapis/sdk-platform-java/issues/2890)) ([f587541](https://github.com/googleapis/sdk-platform-java/commit/f58754178d16e5054326d78d1d372efe1408fa5e)) +* push SNAPSHOT versions of the hermetic build docker image ([#2888](https://github.com/googleapis/sdk-platform-java/issues/2888)) ([81df866](https://github.com/googleapis/sdk-platform-java/commit/81df8660f85785ac7f8ff07ba7686caa0bfd583d)) + + +### Bug Fixes + +* **deps:** update the Java code generator (gapic-generator-java) to 1.2.3 ([e508ae6](https://github.com/googleapis/sdk-platform-java/commit/e508ae69e13455ba2f5c325e0c33d9ff2704e3b1)) +* Expose Gax meter name ([#2865](https://github.com/googleapis/sdk-platform-java/issues/2865)) ([6c5d6ce](https://github.com/googleapis/sdk-platform-java/commit/6c5d6cee7d5034dfc20c43a520d6321689299f21)) +* Move the logic of getting systemProductName from static block to static method ([#2874](https://github.com/googleapis/sdk-platform-java/issues/2874)) ([536f1eb](https://github.com/googleapis/sdk-platform-java/commit/536f1eb6658b44794e9dbba7d9536ecfade84cc3)) +* Update default Otel Attribute from method_name to method ([#2833](https://github.com/googleapis/sdk-platform-java/issues/2833)) ([af10a9e](https://github.com/googleapis/sdk-platform-java/commit/af10a9ef26a5fd9f24fc5341d144b8ee00ff3d00)) + + +### Dependencies + +* update dependency com.google.auto.value:auto-value to v1.11.0 ([#2842](https://github.com/googleapis/sdk-platform-java/issues/2842)) ([dd27fdf](https://github.com/googleapis/sdk-platform-java/commit/dd27fdf03ed756799212ba34a99568b234e13a2a)) +* update dependency com.google.auto.value:auto-value-annotations to v1.11.0 ([#2843](https://github.com/googleapis/sdk-platform-java/issues/2843)) ([bf8e67f](https://github.com/googleapis/sdk-platform-java/commit/bf8e67f3f4c582b7584b6811eb2ae6cb46f8c90e)) +* update dependency com.google.cloud:grpc-gcp to v1.6.1 ([#2943](https://github.com/googleapis/sdk-platform-java/issues/2943)) ([9f16b40](https://github.com/googleapis/sdk-platform-java/commit/9f16b403807a97d8e620aeb5feb74dc4e14367e1)) +* update dependency org.checkerframework:checker-qual to v3.44.0 ([#2848](https://github.com/googleapis/sdk-platform-java/issues/2848)) ([7a99c50](https://github.com/googleapis/sdk-platform-java/commit/7a99c508695e342e10e011dea9bbab371df61ac4)) +* update dependency org.easymock:easymock to v5.3.0 ([#2871](https://github.com/googleapis/sdk-platform-java/issues/2871)) ([c243f7d](https://github.com/googleapis/sdk-platform-java/commit/c243f7dbea5441620364cd51f1829f2690628661)) +* update google api dependencies ([#2846](https://github.com/googleapis/sdk-platform-java/issues/2846)) ([b5ef698](https://github.com/googleapis/sdk-platform-java/commit/b5ef6983f8474c8444caf650116fb34b2e602636)) +* update googleapis/java-cloud-bom digest to 17cc5ec ([#2882](https://github.com/googleapis/sdk-platform-java/issues/2882)) ([d6abd8e](https://github.com/googleapis/sdk-platform-java/commit/d6abd8e0aa37de42038c47e262020a7dd9090907)) +* update netty dependencies to v4.1.111.final ([#2877](https://github.com/googleapis/sdk-platform-java/issues/2877)) ([b5f10b9](https://github.com/googleapis/sdk-platform-java/commit/b5f10b94a16e065aba5d5abe6c0348be87ecf01b)) +* update opentelemetry-java monorepo to v1.39.0 ([#2863](https://github.com/googleapis/sdk-platform-java/issues/2863)) ([9d1f3a8](https://github.com/googleapis/sdk-platform-java/commit/9d1f3a8cd7478df6068b9171c8dc8eb65dc70313)) + +## [2.41.0](https://github.com/googleapis/sdk-platform-java/compare/v2.40.1...v2.41.0) (2024-05-31) + + +### Features + +* add a github client ([#2747](https://github.com/googleapis/sdk-platform-java/issues/2747)) ([f8ea0a0](https://github.com/googleapis/sdk-platform-java/commit/f8ea0a086ddff10a2484a1e2ea249d4832a02f34)) +* generate proto-only repository ([#2720](https://github.com/googleapis/sdk-platform-java/issues/2720)) ([f7a5161](https://github.com/googleapis/sdk-platform-java/commit/f7a5161b637cbefe922b655582f5604e080f51e5)) + + +### Bug Fixes + +* [#2785](https://github.com/googleapis/sdk-platform-java/issues/2785). ([599f5da](https://github.com/googleapis/sdk-platform-java/commit/599f5da13b3e640387a2917b64d6c888167c41f6)) + + +### Dependencies + +* update dependency com.google.api-client:google-api-client-bom to v2.6.0 ([#2782](https://github.com/googleapis/sdk-platform-java/issues/2782)) ([5bc8928](https://github.com/googleapis/sdk-platform-java/commit/5bc89283ba4d9b2cb09c782b1bcc2ce3166650ce)) +* update dependency com.google.cloud.opentelemetry:detector-resources-support to v0.29.0 ([#2831](https://github.com/googleapis/sdk-platform-java/issues/2831)) ([6c1dbfc](https://github.com/googleapis/sdk-platform-java/commit/6c1dbfc2526d9146e551efdbfb62d4add6393ee2)) +* update dependency com.google.code.gson:gson to v2.11.0 ([#2786](https://github.com/googleapis/sdk-platform-java/issues/2786)) ([91f3254](https://github.com/googleapis/sdk-platform-java/commit/91f3254357944410c9b7fd3ef64a17b6da059ffe)) +* update dependency com.google.code.gson:gson to v2.11.0 ([#2787](https://github.com/googleapis/sdk-platform-java/issues/2787)) ([e81893c](https://github.com/googleapis/sdk-platform-java/commit/e81893c72d1c4ae2fcc05b0ad3a1c5b772bd1715)) +* update dependency com.google.errorprone:error_prone_annotations to v2.28.0 ([#2835](https://github.com/googleapis/sdk-platform-java/issues/2835)) ([b8f11b1](https://github.com/googleapis/sdk-platform-java/commit/b8f11b174bc384b9c7bc4c350d869493ba251c67)) +* update dependency com.google.errorprone:error_prone_annotations to v2.28.0 ([#2838](https://github.com/googleapis/sdk-platform-java/issues/2838)) ([5c46f3f](https://github.com/googleapis/sdk-platform-java/commit/5c46f3f1ec1a2cdeaec85da91e87b8408c60e488)) +* update dependency net.bytebuddy:byte-buddy to v1.14.16 ([#2797](https://github.com/googleapis/sdk-platform-java/issues/2797)) ([dfedafc](https://github.com/googleapis/sdk-platform-java/commit/dfedafc37ff31450663296f69cf91718a0a68557)) +* update dependency net.bytebuddy:byte-buddy to v1.14.17 ([#2828](https://github.com/googleapis/sdk-platform-java/issues/2828)) ([6eb9041](https://github.com/googleapis/sdk-platform-java/commit/6eb90416f2d2bb36bf453f02c6cbf4f66c7adf59)) +* update dependency org.checkerframework:checker-qual to v3.43.0 ([#2730](https://github.com/googleapis/sdk-platform-java/issues/2730)) ([b7fa736](https://github.com/googleapis/sdk-platform-java/commit/b7fa736327a1535c347aa516d00b2a41e2a8d143)) +* update dependency requests to v2.32.0 [security] ([#2791](https://github.com/googleapis/sdk-platform-java/issues/2791)) ([c2ea6cc](https://github.com/googleapis/sdk-platform-java/commit/c2ea6ccf4f0e3b2547c030dbcc6bb003b70f8b9b)) +* update dependency watchdog to v4.0.1 ([#2800](https://github.com/googleapis/sdk-platform-java/issues/2800)) ([d5771dd](https://github.com/googleapis/sdk-platform-java/commit/d5771dd4cdbc7a11a06eae6170cf85c0119d2443)) +* update google api dependencies ([#2672](https://github.com/googleapis/sdk-platform-java/issues/2672)) ([6643536](https://github.com/googleapis/sdk-platform-java/commit/66435369822a32cb36cdb67cf4a897071f6ab844)) +* update google http client dependencies to v1.44.2 ([#2783](https://github.com/googleapis/sdk-platform-java/issues/2783)) ([dee7e00](https://github.com/googleapis/sdk-platform-java/commit/dee7e00515b2eb7d5df31790f67150fa7de82f32)) +* update googleapis/java-cloud-bom digest to 59c776b ([#2827](https://github.com/googleapis/sdk-platform-java/issues/2827)) ([03b3eb4](https://github.com/googleapis/sdk-platform-java/commit/03b3eb4dcc75f50f3097c4eeda8f2f62ebcc04ba)) +* update netty dependencies to v4.1.110.final ([#2796](https://github.com/googleapis/sdk-platform-java/issues/2796)) ([d1aaa68](https://github.com/googleapis/sdk-platform-java/commit/d1aaa68fc8455f1b200bb152895aaa4a6849dafc)) + +## [2.40.1](https://github.com/googleapis/sdk-platform-java/compare/v2.40.0...v2.40.1) (2024-05-15) + + +### Bug Fixes + +* [common-protos] An existing method `UpdateVehicleLocation` is ([7f96074](https://github.com/googleapis/sdk-platform-java/commit/7f96074859cd22289fe3ba464e8878d8b228e51c)) +* [common-protos] An existing method `UpdateVehicleLocation` is removed from service `VehicleService` ([#2751](https://github.com/googleapis/sdk-platform-java/issues/2751)) ([7f96074](https://github.com/googleapis/sdk-platform-java/commit/7f96074859cd22289fe3ba464e8878d8b228e51c)) +* [iam] An existing method `UpdateVehicleLocation` is removed from ([4a1ae7b](https://github.com/googleapis/sdk-platform-java/commit/4a1ae7b0b87a3dcc10834d7d2a1f0cd1975f0736)) +* [iam] An existing method `UpdateVehicleLocation` is removed from service `VehicleService` ([#2752](https://github.com/googleapis/sdk-platform-java/issues/2752)) ([4a1ae7b](https://github.com/googleapis/sdk-platform-java/commit/4a1ae7b0b87a3dcc10834d7d2a1f0cd1975f0736)) +* do not populate repo level change while removing library ([#2740](https://github.com/googleapis/sdk-platform-java/issues/2740)) ([43e62b9](https://github.com/googleapis/sdk-platform-java/commit/43e62b998958abd4ca96b83800380c9696ff693f)) +* only append `.api.grpc` suffix to group id if the artifact id starts with `proto-` or `grpc-` ([#2731](https://github.com/googleapis/sdk-platform-java/issues/2731)) ([8e87b2e](https://github.com/googleapis/sdk-platform-java/commit/8e87b2e9a28a1797efb2eea531d25094b4438e0d)) +* opentelemetry-bom to be in third-party-dependencies BOM ([#2736](https://github.com/googleapis/sdk-platform-java/issues/2736)) ([4ecc89b](https://github.com/googleapis/sdk-platform-java/commit/4ecc89bfff1a83e501b2fdc5a04bba47d83a7c00)) +* prepare to generate grafeas ([#2761](https://github.com/googleapis/sdk-platform-java/issues/2761)) ([1114f18](https://github.com/googleapis/sdk-platform-java/commit/1114f1863bf5ae15ee56631fd824a2269e91746d)) +* Replace deprecated protobuf methods. ([#2764](https://github.com/googleapis/sdk-platform-java/issues/2764)) ([986c090](https://github.com/googleapis/sdk-platform-java/commit/986c090a043f06ef98c9787cedf3c89cf7365017)) + + +### Dependencies + +* update dependency black to v24.4.2 ([#2660](https://github.com/googleapis/sdk-platform-java/issues/2660)) ([1cbb681](https://github.com/googleapis/sdk-platform-java/commit/1cbb681f3f395afee4be63cd6b96fefda7083d97)) +* update dependency com.fasterxml.jackson:jackson-bom to v2.17.1 ([#2732](https://github.com/googleapis/sdk-platform-java/issues/2732)) ([891b01d](https://github.com/googleapis/sdk-platform-java/commit/891b01d0d35384df3269cdd8b37102b2587c9188)) +* update dependency com.google.cloud:grpc-gcp to v1.6.0 ([#2767](https://github.com/googleapis/sdk-platform-java/issues/2767)) ([a39aa07](https://github.com/googleapis/sdk-platform-java/commit/a39aa07d013c9c097ad93fd68cf97da1c7d9ff03)) +* update dependency com.google.errorprone:error_prone_annotations to v2.27.1 ([#2708](https://github.com/googleapis/sdk-platform-java/issues/2708)) ([4d7d246](https://github.com/googleapis/sdk-platform-java/commit/4d7d246e821797155792c5f1ad0c1704ec2766d4)) +* update dependency com.google.errorprone:error_prone_annotations to v2.27.1 ([#2709](https://github.com/googleapis/sdk-platform-java/issues/2709)) ([4e31d7d](https://github.com/googleapis/sdk-platform-java/commit/4e31d7dd917c76229c3cfe18b0f98d561c9f7d3b)) +* update dependency com.google.oauth-client:google-oauth-client-bom to v1.36.0 ([#2768](https://github.com/googleapis/sdk-platform-java/issues/2768)) ([22b7398](https://github.com/googleapis/sdk-platform-java/commit/22b7398f07a77935c0c002c78e8e30dca5979652)) +* update dependency commons-codec:commons-codec to v1.17.0 ([#2710](https://github.com/googleapis/sdk-platform-java/issues/2710)) ([b87356c](https://github.com/googleapis/sdk-platform-java/commit/b87356c1d80559fd5ca85ee0edfa3e5f24db6b17)) +* update dependency jinja2 to v3.1.4 [security] ([#2742](https://github.com/googleapis/sdk-platform-java/issues/2742)) ([d67eaf8](https://github.com/googleapis/sdk-platform-java/commit/d67eaf85c409dc7cf653dfb6d753d39a77292135)) +* update dependency lxml to v5.2.2 ([#2766](https://github.com/googleapis/sdk-platform-java/issues/2766)) ([df7e211](https://github.com/googleapis/sdk-platform-java/commit/df7e211e534516f9596e230598b70fdbfdea1ac3)) +* update dependency markupsafe to v2.1.5 ([#2657](https://github.com/googleapis/sdk-platform-java/issues/2657)) ([805baf8](https://github.com/googleapis/sdk-platform-java/commit/805baf87cfd70bb74b345cff93a6a6e02ade3dd7)) +* update dependency net.bytebuddy:byte-buddy to v1.14.15 ([#2753](https://github.com/googleapis/sdk-platform-java/issues/2753)) ([a472620](https://github.com/googleapis/sdk-platform-java/commit/a4726206146a503822f685caa1e4d04273b738dc)) +* update dependency platformdirs to v4.2.1 ([#2662](https://github.com/googleapis/sdk-platform-java/issues/2662)) ([dbdcc91](https://github.com/googleapis/sdk-platform-java/commit/dbdcc91e91ca19eca7c098b6131e3faa90f3386e)) +* update googleapis/java-cloud-bom digest to db4265f ([#2755](https://github.com/googleapis/sdk-platform-java/issues/2755)) ([908db6f](https://github.com/googleapis/sdk-platform-java/commit/908db6f453b1915e2fd4097d5cf639f054829c39)) +* update googleapis/java-cloud-bom digest to f3c611a ([#2700](https://github.com/googleapis/sdk-platform-java/issues/2700)) ([d254e9b](https://github.com/googleapis/sdk-platform-java/commit/d254e9bd67ec12802158d48f3c06dc618e0df903)) +* update opentelemetry-java monorepo to v1.38.0 ([#2769](https://github.com/googleapis/sdk-platform-java/issues/2769)) ([0a5c7c4](https://github.com/googleapis/sdk-platform-java/commit/0a5c7c4075ee986028535c424e4a62458a25f8d2)) + +## [2.40.0](https://github.com/googleapis/sdk-platform-java/compare/v2.39.0...v2.40.0) (2024-05-02) + + +### Features + +* [common-protos] add `Weight` to common types for Shopping APIs to be used for accounts bundle ([#2699](https://github.com/googleapis/sdk-platform-java/issues/2699)) ([5bb9770](https://github.com/googleapis/sdk-platform-java/commit/5bb97700ddcef1b0494808b1e7d8029d92c74d13)) +* add a CLI tool to validate generation configuration ([#2691](https://github.com/googleapis/sdk-platform-java/issues/2691)) ([f2ce524](https://github.com/googleapis/sdk-platform-java/commit/f2ce52478a03048b9daffc3fc535f12cf2a9f856)) +* Parser to consume the api-versioning value from proto ([#2630](https://github.com/googleapis/sdk-platform-java/issues/2630)) ([40711fd](https://github.com/googleapis/sdk-platform-java/commit/40711fd69468a2021108bb5fba00bb02ac4bb19f)) +* Update Gapic generator and Gax to emit api-versioning via header ([#2671](https://github.com/googleapis/sdk-platform-java/issues/2671)) ([e63d1b4](https://github.com/googleapis/sdk-platform-java/commit/e63d1b49159be07f0bb32bfe9d15c8445ac883c8)) + + +### Bug Fixes + +* change folder prefix for adding headers ([#2688](https://github.com/googleapis/sdk-platform-java/issues/2688)) ([4e92be8](https://github.com/googleapis/sdk-platform-java/commit/4e92be8885af8633ea5b3371c43be9423a0f95ef)) +* Log HttpJson's async thread pool core size ([#2697](https://github.com/googleapis/sdk-platform-java/issues/2697)) ([34b4bc3](https://github.com/googleapis/sdk-platform-java/commit/34b4bc3362f3c30bd77f5a59c3cb3aea36358eee)) +* replace `cfg = "host"` with `cfg = "exec"` ([#2637](https://github.com/googleapis/sdk-platform-java/issues/2637)) ([6d673f3](https://github.com/googleapis/sdk-platform-java/commit/6d673f39dc10b072ba6012fecc17deb22136650e)) +* Return resolved endpoint from StubSettings' Builder ([#2715](https://github.com/googleapis/sdk-platform-java/issues/2715)) ([32c9995](https://github.com/googleapis/sdk-platform-java/commit/32c99953496fe3e0ab47c67aad4117c242d1c798)) + + +### Dependencies + +* Make opentelemetry-api an optional dependency. ([#2681](https://github.com/googleapis/sdk-platform-java/issues/2681)) ([3967a19](https://github.com/googleapis/sdk-platform-java/commit/3967a19e8b68c3a95cf1ced737f3a1aa73b02e93)) +* update dependency absl-py to v2.1.0 ([#2659](https://github.com/googleapis/sdk-platform-java/issues/2659)) ([cae6d79](https://github.com/googleapis/sdk-platform-java/commit/cae6d79ed29fd9e64abe4e9390a46b1f9f1d305f)) +* update dependency gitpython to v3.1.43 ([#2656](https://github.com/googleapis/sdk-platform-java/issues/2656)) ([208bef4](https://github.com/googleapis/sdk-platform-java/commit/208bef468b11d49e85d4df4008d99c7a2de9233c)) +* update dependency lxml to v5.2.1 ([#2661](https://github.com/googleapis/sdk-platform-java/issues/2661)) ([b95ad49](https://github.com/googleapis/sdk-platform-java/commit/b95ad49834e0422e79f884b42cf5c81c89bb25fb)) +* update dependency net.bytebuddy:byte-buddy to v1.14.14 ([#2703](https://github.com/googleapis/sdk-platform-java/issues/2703)) ([87069bc](https://github.com/googleapis/sdk-platform-java/commit/87069bc9618704e2607aeae486d8481e4454dc17)) +* update dependency typing to v3.10.0.0 ([#2663](https://github.com/googleapis/sdk-platform-java/issues/2663)) ([7fb5653](https://github.com/googleapis/sdk-platform-java/commit/7fb565324427a98948c6d253066b734a4b5832bc)) +* update gapic-showcase to v0.33.0 ([#2653](https://github.com/googleapis/sdk-platform-java/issues/2653)) ([0a71cbf](https://github.com/googleapis/sdk-platform-java/commit/0a71cbf7092279c50f9f5114b79d8c674cdef997)) + + +### Documentation + +* Add contributing guidelines to PR and issue templates ([#2682](https://github.com/googleapis/sdk-platform-java/issues/2682)) ([42526dc](https://github.com/googleapis/sdk-platform-java/commit/42526dc03e00a2e01e8f7a075817560089f378ee)) + +## [2.39.0](https://github.com/googleapis/sdk-platform-java/compare/v2.38.1...v2.39.0) (2024-04-18) + + +### Features + +* add `libraries_bom_version` to generation configuration ([#2639](https://github.com/googleapis/sdk-platform-java/issues/2639)) ([56c7ca5](https://github.com/googleapis/sdk-platform-java/commit/56c7ca51d4ca99629251e0aa9cac316eb349c974)) +* Add ChannelPoolSettings Getter for gRPC's ChannelProvider ([#2612](https://github.com/googleapis/sdk-platform-java/issues/2612)) ([d0c5191](https://github.com/googleapis/sdk-platform-java/commit/d0c5191525d5d157812cae9551fc15bb70caab7e)) +* add config change ([#2604](https://github.com/googleapis/sdk-platform-java/issues/2604)) ([8312706](https://github.com/googleapis/sdk-platform-java/commit/8312706db6352fca05a5858b513e88f162e5de0b)) +* add entry point ([#2616](https://github.com/googleapis/sdk-platform-java/issues/2616)) ([b19fa33](https://github.com/googleapis/sdk-platform-java/commit/b19fa3373d3fa17531d627d4581d154374a231ff)) +* add generation config comparator ([#2587](https://github.com/googleapis/sdk-platform-java/issues/2587)) ([a94c2f0](https://github.com/googleapis/sdk-platform-java/commit/a94c2f0e8a99f0ddf17106cbc8117cefe6b0e127)) +* Add JavadocJar Task to build.gradle for self service libraries ([#2593](https://github.com/googleapis/sdk-platform-java/issues/2593)) ([993f5ac](https://github.com/googleapis/sdk-platform-java/commit/993f5acf91de3a9d2c7f9fdb10ea47387b240554)) +* Client/StubSettings' getEndpoint() returns the resolved endpoint ([#2440](https://github.com/googleapis/sdk-platform-java/issues/2440)) ([4942bc1](https://github.com/googleapis/sdk-platform-java/commit/4942bc17e9c7261242ba3d03d85cd8b131ca2e5e)) +* generate selected libraries ([#2598](https://github.com/googleapis/sdk-platform-java/issues/2598)) ([739ddbb](https://github.com/googleapis/sdk-platform-java/commit/739ddbbbc662f43e46b9f420bbae685de9b3dbc6)) +* Validate the Universe Domain inside Java-Core ([#2592](https://github.com/googleapis/sdk-platform-java/issues/2592)) ([35d789f](https://github.com/googleapis/sdk-platform-java/commit/35d789fdf488feff41d4bdaa5992013450954870)) + + +### Bug Fixes + +* add main to `generate_repo.py` ([#2607](https://github.com/googleapis/sdk-platform-java/issues/2607)) ([fedeb32](https://github.com/googleapis/sdk-platform-java/commit/fedeb3237b6d25245f4d770ec105bd538dfee405)) +* correct deep-remove and deep-preserve regexes ([#2572](https://github.com/googleapis/sdk-platform-java/issues/2572)) ([4c7fd88](https://github.com/googleapis/sdk-platform-java/commit/4c7fd880a90d08448db366bde40d0d385b45f75e)) +* first attempt should use the min of RPC timeout and total timeout ([#2641](https://github.com/googleapis/sdk-platform-java/issues/2641)) ([0349232](https://github.com/googleapis/sdk-platform-java/commit/034923277750171418d74060e225ffd68ef38bf2)) +* remove duplicated calls to AutoValue builders ([#2636](https://github.com/googleapis/sdk-platform-java/issues/2636)) ([53a3727](https://github.com/googleapis/sdk-platform-java/commit/53a3727e4a9548bf0417d4ee6ed3e9ab571642ed)) +* remove unnecessary slf4j and AbstractGoogleClientRequest native image configs ([0cb7d0e](https://github.com/googleapis/sdk-platform-java/commit/0cb7d0e0c03f2dd2853a86d67c9529a50ed8238f)) +* remove unnecessary slf4j and AbstractGoogleClientRequest native image configs ([#2628](https://github.com/googleapis/sdk-platform-java/issues/2628)) ([0cb7d0e](https://github.com/googleapis/sdk-platform-java/commit/0cb7d0e0c03f2dd2853a86d67c9529a50ed8238f)) + + +### Dependencies + +* update arrow.version to v15.0.2 ([#2589](https://github.com/googleapis/sdk-platform-java/issues/2589)) ([777acf3](https://github.com/googleapis/sdk-platform-java/commit/777acf3df4b5379cd8a8cf52b844203dd514ee24)) +* update dependency com.google.cloud.opentelemetry:detector-resources-support to v0.28.0 ([#2649](https://github.com/googleapis/sdk-platform-java/issues/2649)) ([e4ed176](https://github.com/googleapis/sdk-platform-java/commit/e4ed1765f3dbb950d498df307d79577abf71a66a)) +* update dependency gitpython to v3.1.41 [security] ([#2625](https://github.com/googleapis/sdk-platform-java/issues/2625)) ([e41bd8f](https://github.com/googleapis/sdk-platform-java/commit/e41bd8f00ffcb271b2a008364f334693d9dfdc9d)) +* update dependency net.bytebuddy:byte-buddy to v1.14.13 ([#2646](https://github.com/googleapis/sdk-platform-java/issues/2646)) ([73ac5a4](https://github.com/googleapis/sdk-platform-java/commit/73ac5a4bfe05ac11a121664f52a4013cb4bb33a9)) +* update dependency org.threeten:threeten-extra to v1.8.0 ([#2650](https://github.com/googleapis/sdk-platform-java/issues/2650)) ([226325a](https://github.com/googleapis/sdk-platform-java/commit/226325a5b7c93c1ad1b4af5da4283e369887fa42)) +* update dependency org.threeten:threetenbp to v1.6.9 ([#2602](https://github.com/googleapis/sdk-platform-java/issues/2602)) ([371753e](https://github.com/googleapis/sdk-platform-java/commit/371753ebbd83d703f314dd5f4e34e16c255836c6)) +* update dependency org.threeten:threetenbp to v1.6.9 ([#2665](https://github.com/googleapis/sdk-platform-java/issues/2665)) ([8935bc8](https://github.com/googleapis/sdk-platform-java/commit/8935bc87307e73101df72a85f98a8ec1bdde0c14)) +* update google api dependencies ([#2584](https://github.com/googleapis/sdk-platform-java/issues/2584)) ([cd20604](https://github.com/googleapis/sdk-platform-java/commit/cd20604f3128d2efc1802065c63b6663186ce3af)) +* update googleapis/java-cloud-bom digest to 7071341 ([#2608](https://github.com/googleapis/sdk-platform-java/issues/2608)) ([8d74140](https://github.com/googleapis/sdk-platform-java/commit/8d7414029984c073e9bae2952971d2337dbf81ab)) +* update netty dependencies to v4.1.109.final ([#2597](https://github.com/googleapis/sdk-platform-java/issues/2597)) ([8990693](https://github.com/googleapis/sdk-platform-java/commit/8990693abf157a1adf2723c6db1bce71a5efa810)) +* update opentelemetry-java monorepo to v1.37.0 ([#2652](https://github.com/googleapis/sdk-platform-java/issues/2652)) ([f8fa2e9](https://github.com/googleapis/sdk-platform-java/commit/f8fa2e9f7316f17f1e753a74a6839d9e331c010a)) +* update protobuf dependencies to v3.25.3 ([#2491](https://github.com/googleapis/sdk-platform-java/issues/2491)) ([b0e5041](https://github.com/googleapis/sdk-platform-java/commit/b0e5041ff0fafaf900a7cf1929f0d85fc582a0d7)) +* update slf4j monorepo to v2.0.13 ([#2647](https://github.com/googleapis/sdk-platform-java/issues/2647)) ([f030e29](https://github.com/googleapis/sdk-platform-java/commit/f030e29b1538ad28ad9628ec03d8e3eb2f21d6c2)) + +## [2.38.1](https://github.com/googleapis/sdk-platform-java/compare/v2.38.0...v2.38.1) (2024-03-15) + + +### Bug Fixes + +* **deps:** add detector-resource-support dependencies ([#2559](https://github.com/googleapis/sdk-platform-java/issues/2559)) ([53f2c85](https://github.com/googleapis/sdk-platform-java/commit/53f2c85ff700e114ca88ab74360733144581b861)) +* Update shopping and chat common protos. ([#2580](https://github.com/googleapis/sdk-platform-java/issues/2580)) ([f472756](https://github.com/googleapis/sdk-platform-java/commit/f472756590215308305bbb370097e300439f168b)) + + +### Dependencies + +* update google api dependencies ([#2582](https://github.com/googleapis/sdk-platform-java/issues/2582)) ([dd03d93](https://github.com/googleapis/sdk-platform-java/commit/dd03d9378c6efbaf7a0785f235461cc5951c50d2)) + +## [2.38.0](https://github.com/googleapis/sdk-platform-java/compare/v2.37.0...v2.38.0) (2024-03-15) + + +### Features + +* [common-protos] add `api_version` extension to `ServiceOptions`, for collaborative versioning ([d343be9](https://github.com/googleapis/sdk-platform-java/commit/d343be9416d2521145a8c5d1e8abea6203ff6214)) +* [common-protos] add `api_version` extension to `ServiceOptions`, for collaborative versioning ([#2551](https://github.com/googleapis/sdk-platform-java/issues/2551)) ([d343be9](https://github.com/googleapis/sdk-platform-java/commit/d343be9416d2521145a8c5d1e8abea6203ff6214)) +* add `ErrorReason.LOCATION_POLICY_VIOLATED` enum value ([d343be9](https://github.com/googleapis/sdk-platform-java/commit/d343be9416d2521145a8c5d1e8abea6203ff6214)) +* add `ErrorReason.LOCATION_POLICY_VIOLATED` enum value ([d343be9](https://github.com/googleapis/sdk-platform-java/commit/d343be9416d2521145a8c5d1e8abea6203ff6214)) +* add `Publishing.rest_reference_documentation_uri` to aid client library publication ([d343be9](https://github.com/googleapis/sdk-platform-java/commit/d343be9416d2521145a8c5d1e8abea6203ff6214)) +* add `Publishing.rest_reference_documentation_uri` to aid client library publication ([d343be9](https://github.com/googleapis/sdk-platform-java/commit/d343be9416d2521145a8c5d1e8abea6203ff6214)) +* Add shopping and chat common protos. ([#2553](https://github.com/googleapis/sdk-platform-java/issues/2553)) ([5f2d4e7](https://github.com/googleapis/sdk-platform-java/commit/5f2d4e73ec5511613a97f463e28567487f47cd44)), closes [#2018](https://github.com/googleapis/sdk-platform-java/issues/2018) +* get PR description from googleapis commits ([#2531](https://github.com/googleapis/sdk-platform-java/issues/2531)) ([c2ea697](https://github.com/googleapis/sdk-platform-java/commit/c2ea697fdfd9127a203524424e93e1d32ae2b8fa)) +* Introduce OpenTelemetry Metrics Recording ([#2500](https://github.com/googleapis/sdk-platform-java/issues/2500)) ([b936580](https://github.com/googleapis/sdk-platform-java/commit/b936580e905716a7fdf78d9219eb55889ee9274e)) +* skip build only commit ([#2555](https://github.com/googleapis/sdk-platform-java/issues/2555)) ([180c8a9](https://github.com/googleapis/sdk-platform-java/commit/180c8a964893b3dc8e40c51adc4d76e570a87e04)) +* Universe Domain Environment Variable Support ([#2485](https://github.com/googleapis/sdk-platform-java/issues/2485)) ([1463d64](https://github.com/googleapis/sdk-platform-java/commit/1463d645edf96087335618542f7bbca722a97b71)) + + +### Dependencies + +* normalize dependencies ([#2574](https://github.com/googleapis/sdk-platform-java/issues/2574)) ([6622238](https://github.com/googleapis/sdk-platform-java/commit/66222380977e7cba3a7951fba6102481af130d2e)) +* update arrow.version to v15.0.1 ([#2565](https://github.com/googleapis/sdk-platform-java/issues/2565)) ([b2c3f6a](https://github.com/googleapis/sdk-platform-java/commit/b2c3f6a0bb6bd33063516060851ebbae628c8fed)) +* update dependency com.fasterxml.jackson:jackson-bom to v2.17.0 ([#2564](https://github.com/googleapis/sdk-platform-java/issues/2564)) ([40ae7f9](https://github.com/googleapis/sdk-platform-java/commit/40ae7f9a628ec7b34b5b001ffc54d49e4059dd81)) +* update dependency com.google.api-client:google-api-client-bom to v2.4.0 ([#2570](https://github.com/googleapis/sdk-platform-java/issues/2570)) ([f60441f](https://github.com/googleapis/sdk-platform-java/commit/f60441ff4c1fb530ac27a8c492cd1b45196ea13c)) +* update dependency com.google.errorprone:error_prone_annotations to v2.26.1 ([#2530](https://github.com/googleapis/sdk-platform-java/issues/2530)) ([7c1aaab](https://github.com/googleapis/sdk-platform-java/commit/7c1aaabb0ef5f3664b6065b89ca74a1075ab74c7)) +* update dependency com.google.errorprone:error_prone_annotations to v2.26.1 ([#2532](https://github.com/googleapis/sdk-platform-java/issues/2532)) ([447b4e1](https://github.com/googleapis/sdk-platform-java/commit/447b4e1d8a9079506bde78ab7ec0831a90e19b82)) +* update dependency io.netty:netty-tcnative-boringssl-static to v2.0.65.final ([#2547](https://github.com/googleapis/sdk-platform-java/issues/2547)) ([46e0e0f](https://github.com/googleapis/sdk-platform-java/commit/46e0e0f1d5b0f9d70a9d5cff67a692e802f8992a)) +* update dependency net.bytebuddy:byte-buddy to v1.14.12 ([#2522](https://github.com/googleapis/sdk-platform-java/issues/2522)) ([edfec32](https://github.com/googleapis/sdk-platform-java/commit/edfec3232c99591093a8d9f9a9ff43edeb9878e9)) +* update google api dependencies ([#2484](https://github.com/googleapis/sdk-platform-java/issues/2484)) ([92e91bc](https://github.com/googleapis/sdk-platform-java/commit/92e91bc0d91a2619a87abf9b072229a3ab3f4d91)) +* update google api dependencies ([#2538](https://github.com/googleapis/sdk-platform-java/issues/2538)) ([d9355cf](https://github.com/googleapis/sdk-platform-java/commit/d9355cf5e6751de8bb8a7ff7e101b7f52425e19a)) +* update googleapis/java-cloud-bom digest to 3f93d58 ([#2499](https://github.com/googleapis/sdk-platform-java/issues/2499)) ([5fd4d5e](https://github.com/googleapis/sdk-platform-java/commit/5fd4d5e3a9f864064587eec4d11b14b3c037efcf)) +* update googleapis/java-cloud-bom digest to 659764f ([#2545](https://github.com/googleapis/sdk-platform-java/issues/2545)) ([d6c8be6](https://github.com/googleapis/sdk-platform-java/commit/d6c8be6e7da262ecc1ac61fbc052af24c59d94ef)) +* update netty dependencies ([#2480](https://github.com/googleapis/sdk-platform-java/issues/2480)) ([40753c3](https://github.com/googleapis/sdk-platform-java/commit/40753c3ca3d0d3d6e83bfd38764071a57c9e7c8b)) +* update opentelemetry-java monorepo to v1.35.0 ([#2477](https://github.com/googleapis/sdk-platform-java/issues/2477)) ([3ecefff](https://github.com/googleapis/sdk-platform-java/commit/3ecefff9f1e458119db24da729094b5a1ca22279)) +* update opentelemetry-java monorepo to v1.36.0 ([#2550](https://github.com/googleapis/sdk-platform-java/issues/2550)) ([9669c21](https://github.com/googleapis/sdk-platform-java/commit/9669c21d4e01017b4aa65abc0fb1e80de31ff0c6)) +* update opentelemetry-java monorepo to v1.36.0 ([#2573](https://github.com/googleapis/sdk-platform-java/issues/2573)) ([f5f201e](https://github.com/googleapis/sdk-platform-java/commit/f5f201e9846c46f6e7241a15674d28711fe984f4)) +* update slf4j monorepo to v2.0.12 ([#2481](https://github.com/googleapis/sdk-platform-java/issues/2481)) ([363a354](https://github.com/googleapis/sdk-platform-java/commit/363a3549b2bda040e55ec59ef21010b6c99a021e)) + + +### Documentation + +* minor tweaks to various comments ([d343be9](https://github.com/googleapis/sdk-platform-java/commit/d343be9416d2521145a8c5d1e8abea6203ff6214)) +* minor tweaks to various comments ([d343be9](https://github.com/googleapis/sdk-platform-java/commit/d343be9416d2521145a8c5d1e8abea6203ff6214)) + +## [2.37.0](https://github.com/googleapis/sdk-platform-java/compare/v2.36.0...v2.37.0) (2024-02-29) + + +### Features + +* improve batching summary errors ([#2509](https://github.com/googleapis/sdk-platform-java/issues/2509)) ([d6964a4](https://github.com/googleapis/sdk-platform-java/commit/d6964a4cfda60ef7c5f1871b215a9cf222361e7e)) + + +### Bug Fixes + +* adjust release please config to reflect file location change. ([#2524](https://github.com/googleapis/sdk-platform-java/issues/2524)) ([1e5af1e](https://github.com/googleapis/sdk-platform-java/commit/1e5af1e651a079220b8a63952b7dbc68586d9b7d)) + +## [2.36.0](https://github.com/googleapis/sdk-platform-java/compare/v2.35.0...v2.36.0) (2024-02-29) + + +### Features + +* check library_name is unique among libraries ([#2490](https://github.com/googleapis/sdk-platform-java/issues/2490)) ([8123f0b](https://github.com/googleapis/sdk-platform-java/commit/8123f0b15970c76b08086d8988de14e1ed58a77e)) + + +### Bug Fixes + +* cleanup @BetaApi from Resource Name Builder Methods ([#2450](https://github.com/googleapis/sdk-platform-java/issues/2450)) ([6e8d098](https://github.com/googleapis/sdk-platform-java/commit/6e8d09845610401665556118cd78c7229c46d426)), closes [#2099](https://github.com/googleapis/sdk-platform-java/issues/2099) +* Fix watchdog to start with WAITING state ([#2468](https://github.com/googleapis/sdk-platform-java/issues/2468)) ([dedc40f](https://github.com/googleapis/sdk-platform-java/commit/dedc40fb451633b11be10013b74a91053e155620)) +* ignore comment in BUILD ([#2492](https://github.com/googleapis/sdk-platform-java/issues/2492)) ([6ca20e5](https://github.com/googleapis/sdk-platform-java/commit/6ca20e529a86561cdc935d0d44dd971de3b9e4b2)) +* remove @BetaApi from ApiFutures and ApiService ([#2454](https://github.com/googleapis/sdk-platform-java/issues/2454)) ([f59e717](https://github.com/googleapis/sdk-platform-java/commit/f59e717402d00bc953648e1e780dd84dda7915b3)), closes [#2098](https://github.com/googleapis/sdk-platform-java/issues/2098) + + +### Dependencies + +* grandfathering the dependencies for java-pubsublite and java-bigquery ([#2504](https://github.com/googleapis/sdk-platform-java/issues/2504)) ([9ceab23](https://github.com/googleapis/sdk-platform-java/commit/9ceab23144ba7a9ca9114d585376e09587fd1bee)) +* update dependency gradle to v7.6.4 ([#2474](https://github.com/googleapis/sdk-platform-java/issues/2474)) ([607dc59](https://github.com/googleapis/sdk-platform-java/commit/607dc59f8eb5a70f8807c4d5f7d0745438842381)) +* update dependency org.graalvm.sdk:graal-sdk to v22.3.5 ([#2475](https://github.com/googleapis/sdk-platform-java/issues/2475)) ([2de487b](https://github.com/googleapis/sdk-platform-java/commit/2de487b34c43fee3b81e4af7a2dfe4f2eb6418ac)) +* update grpc dependencies to v1.62.2 ([#2506](https://github.com/googleapis/sdk-platform-java/issues/2506)) ([f438603](https://github.com/googleapis/sdk-platform-java/commit/f4386038766c2381e141d7073959cc6bde896efb)) + + +### Documentation + +* Add contribution guidelines. ([#2045](https://github.com/googleapis/sdk-platform-java/issues/2045)) ([9939b43](https://github.com/googleapis/sdk-platform-java/commit/9939b43dce041c75405cea66a0dde171d991d3eb)) + +## [2.35.0](https://github.com/googleapis/sdk-platform-java/compare/v2.34.0...v2.35.0) (2024-02-13) + + +### Features + +* add `generate_repo.py` ([#2431](https://github.com/googleapis/sdk-platform-java/issues/2431)) ([47b632a](https://github.com/googleapis/sdk-platform-java/commit/47b632aa011874abe04212168ccc74dae50f5fbe)) +* move synthtool templates to `library_generation/owlbot` ([#2443](https://github.com/googleapis/sdk-platform-java/issues/2443)) ([5c95472](https://github.com/googleapis/sdk-platform-java/commit/5c95472ffd9085a6eac3d227f96c0b25097c60ec)) + + +### Bug Fixes + +* Apiary Host returns user set host if set ([#2455](https://github.com/googleapis/sdk-platform-java/issues/2455)) ([5f17e62](https://github.com/googleapis/sdk-platform-java/commit/5f17e62a7b0f10035205ec4197b8f77388b059f8)) +* Cancel the Timeout Task for HttpJson ([#2360](https://github.com/googleapis/sdk-platform-java/issues/2360)) ([b177d9e](https://github.com/googleapis/sdk-platform-java/commit/b177d9e40fd7107bbed67506da0acb021c8f346d)) + + +### Dependencies + +* update dependency commons-codec:commons-codec to v1.16.1 ([#2473](https://github.com/googleapis/sdk-platform-java/issues/2473)) ([8c6e91d](https://github.com/googleapis/sdk-platform-java/commit/8c6e91df765b4e42d0d4de77eaf73936fa43895a)) +* update google api dependencies ([#2469](https://github.com/googleapis/sdk-platform-java/issues/2469)) ([ad4d4e6](https://github.com/googleapis/sdk-platform-java/commit/ad4d4e65c0afae0e13905fe78b8ea711253dcab3)) +* update google auth library dependencies to v1.23.0 ([#2466](https://github.com/googleapis/sdk-platform-java/issues/2466)) ([349a5d3](https://github.com/googleapis/sdk-platform-java/commit/349a5d3b6e31e6184f71d3470a406b2e78eb0775)) +* update google auth library dependencies to v1.23.0 ([#2476](https://github.com/googleapis/sdk-platform-java/issues/2476)) ([6c9127c](https://github.com/googleapis/sdk-platform-java/commit/6c9127cf177ed1965ac2d7823808c9f4a835a44f)) +* update google http client dependencies to v1.44.1 ([#2467](https://github.com/googleapis/sdk-platform-java/issues/2467)) ([87d1435](https://github.com/googleapis/sdk-platform-java/commit/87d143569e3e2fee5050a905b1841995fc20c528)) +* update googleapis/java-cloud-bom digest to ac9893c ([#2472](https://github.com/googleapis/sdk-platform-java/issues/2472)) ([7fff34a](https://github.com/googleapis/sdk-platform-java/commit/7fff34ab3a8e6e0a77b638be81d67fcb4f061686)) +* update grpc dependencies to v1.61.1 ([#2463](https://github.com/googleapis/sdk-platform-java/issues/2463)) ([9ec575b](https://github.com/googleapis/sdk-platform-java/commit/9ec575bae059a96ed3d68af4abc372031d9c4dc7)) + +## [2.34.0](https://github.com/googleapis/sdk-platform-java/compare/v2.33.0...v2.34.0) (2024-01-31) + + +### Features + +* autopopulate fields in the request ([#2353](https://github.com/googleapis/sdk-platform-java/issues/2353)) ([b28235a](https://github.com/googleapis/sdk-platform-java/commit/b28235ab20fd174deddafc0426b8d20352af6e85)) +* enable generation with postprocessing of multiple service versions ([#2342](https://github.com/googleapis/sdk-platform-java/issues/2342)) ([363e35e](https://github.com/googleapis/sdk-platform-java/commit/363e35e46e41c88b810e4b0672906f73cb7c38b6)) +* MetricsTracer implementation ([#2421](https://github.com/googleapis/sdk-platform-java/issues/2421)) ([5c291e8](https://github.com/googleapis/sdk-platform-java/commit/5c291e8786b8e976979ec2e26b13f0327333bb02)) +* move new client script ([#2333](https://github.com/googleapis/sdk-platform-java/issues/2333)) ([acdde47](https://github.com/googleapis/sdk-platform-java/commit/acdde47445916dd306ce8b91489fab45c9c2ef50)) + + +### Bug Fixes + +* Endpoint resolution uses user set endpoint from ClientSettings ([#2429](https://github.com/googleapis/sdk-platform-java/issues/2429)) ([46b0a85](https://github.com/googleapis/sdk-platform-java/commit/46b0a857eaa4484c5f1ebe1170338fc90a994375)) +* Move direct path misconfiguration log to before creating the first channel ([#2430](https://github.com/googleapis/sdk-platform-java/issues/2430)) ([9916540](https://github.com/googleapis/sdk-platform-java/commit/99165403902ff91ecb0b14b858333855e7a10c60)) + +## [2.33.0](https://github.com/googleapis/sdk-platform-java/compare/v2.32.0...v2.33.0) (2024-01-24) + + +### Features + +* Introduce interfaces for metrics instrumentation ([#2403](https://github.com/googleapis/sdk-platform-java/issues/2403)) ([3c61b14](https://github.com/googleapis/sdk-platform-java/commit/3c61b14fef87c735ea2ed382f8510b29176a4279)) + + +### Bug Fixes + +* Verify Universe Domain's DirectPath Compatibility after Endpoint Resolution ([#2412](https://github.com/googleapis/sdk-platform-java/issues/2412)) ([e2de93b](https://github.com/googleapis/sdk-platform-java/commit/e2de93bb7051039e8a96128b9eacc0f2ea3a1205)) + +## [2.32.0](https://github.com/googleapis/sdk-platform-java/compare/v2.31.0...v2.32.0) (2024-01-19) + + +### Features + +* Do not set the default endpoint in StubSettings ([97ae228](https://github.com/googleapis/sdk-platform-java/commit/97ae228a262738e09ddf7b4dab95bb81a4f8860a)) +* Numeric enums in routing headers ([#2328](https://github.com/googleapis/sdk-platform-java/issues/2328)) ([4d043de](https://github.com/googleapis/sdk-platform-java/commit/4d043deeaf096a093e54c5c7b07e408f38647296)) +* StubSettings' `getEndpoint()` will return the service's pre-configured endpoint if there are no user configurations ([97ae228](https://github.com/googleapis/sdk-platform-java/commit/97ae228a262738e09ddf7b4dab95bb81a4f8860a)) +* Validate the Universe Domain ([#2330](https://github.com/googleapis/sdk-platform-java/issues/2330)) ([097bc93](https://github.com/googleapis/sdk-platform-java/commit/097bc93c39d10d8ff08eb8fb3a378bbe6d96c1ac)) + + +### Bug Fixes + +* adjust release-please configs for cloudbuild yaml updates ([#2351](https://github.com/googleapis/sdk-platform-java/issues/2351)) ([ed16261](https://github.com/googleapis/sdk-platform-java/commit/ed16261ac8c90fe588026e30d62d948e7ca1af13)) +* DirectPath non-default SA requires creds ([#2281](https://github.com/googleapis/sdk-platform-java/issues/2281)) ([c7d614a](https://github.com/googleapis/sdk-platform-java/commit/c7d614acd9be75b0aa3d365eed9ef4db41419906)) +* format method types and table in Client Overview ([#2361](https://github.com/googleapis/sdk-platform-java/issues/2361)) ([7436995](https://github.com/googleapis/sdk-platform-java/commit/743699504039c110a1490276ddef809f57716e24)) + + +### Dependencies + +* update dependency com.fasterxml.jackson:jackson-bom to v2.16.1 ([#2386](https://github.com/googleapis/sdk-platform-java/issues/2386)) ([1160f95](https://github.com/googleapis/sdk-platform-java/commit/1160f95d16b1dd0627772a9e8f9c7c8cae7e9c55)) +* update dependency com.google.errorprone:error_prone_annotations to v2.24.1 ([#2390](https://github.com/googleapis/sdk-platform-java/issues/2390)) ([d533760](https://github.com/googleapis/sdk-platform-java/commit/d5337600d95f226bbb3f328ebdb7eb41cd2cb43a)) +* update dependency com.google.errorprone:error_prone_annotations to v2.24.1 ([#2391](https://github.com/googleapis/sdk-platform-java/issues/2391)) ([98b7f3e](https://github.com/googleapis/sdk-platform-java/commit/98b7f3ebcb46430fda53d0d656fcc090ed73654e)) +* update dependency com.google.oauth-client:google-oauth-client-bom to v1.35.0 ([#2392](https://github.com/googleapis/sdk-platform-java/issues/2392)) ([4b78ac7](https://github.com/googleapis/sdk-platform-java/commit/4b78ac7a8e7a8e6844516c30ac8b112a44cfcc9c)) +* update dependency io.perfmark:perfmark-api to v0.27.0 ([#2388](https://github.com/googleapis/sdk-platform-java/issues/2388)) ([42808ba](https://github.com/googleapis/sdk-platform-java/commit/42808baab2f949bfda2abdb109560033f9e34da3)) +* update dependency io.perfmark:perfmark-api to v0.27.0 ([#2389](https://github.com/googleapis/sdk-platform-java/issues/2389)) ([51241f7](https://github.com/googleapis/sdk-platform-java/commit/51241f77bc71769c482d12c47cf82c2f32d0be30)) +* update dependency net.bytebuddy:byte-buddy to v1.14.11 ([#2387](https://github.com/googleapis/sdk-platform-java/issues/2387)) ([07b8ee6](https://github.com/googleapis/sdk-platform-java/commit/07b8ee6d93c42299617de768946ba48e2049dbf9)) +* update dependency org.checkerframework:checker-qual to v3.42.0 ([#2287](https://github.com/googleapis/sdk-platform-java/issues/2287)) ([7c4eb80](https://github.com/googleapis/sdk-platform-java/commit/7c4eb80c2faf1b2d9e0a1bc10acffe4a8d2d7d28)) +* update gapic-showcase to v0.30.0 ([#2354](https://github.com/googleapis/sdk-platform-java/issues/2354)) ([762c125](https://github.com/googleapis/sdk-platform-java/commit/762c125abadb5e56682224c9f1587c71e5c6e653)) +* update google api dependencies ([#2382](https://github.com/googleapis/sdk-platform-java/issues/2382)) ([92bbe61](https://github.com/googleapis/sdk-platform-java/commit/92bbe6123090a9c66a0d6a688484612a069fd9de)) +* update googleapis/java-cloud-bom digest to 8bc17e9 ([#2376](https://github.com/googleapis/sdk-platform-java/issues/2376)) ([bddd4ea](https://github.com/googleapis/sdk-platform-java/commit/bddd4ea81c0ce2d53c7968fbe55eb0755a3dfee8)) +* update grpc dependencies to v1.61.0 ([#2383](https://github.com/googleapis/sdk-platform-java/issues/2383)) ([af15bd1](https://github.com/googleapis/sdk-platform-java/commit/af15bd1ef06456fea983a8e44b3dc78d30751125)) +* update netty dependencies to v4.1.105.final ([#2302](https://github.com/googleapis/sdk-platform-java/issues/2302)) ([1563a55](https://github.com/googleapis/sdk-platform-java/commit/1563a550f820063881c1e1ab87aa79fb47ca667c)) +* update protobuf dependencies to v3.25.2 ([#2378](https://github.com/googleapis/sdk-platform-java/issues/2378)) ([836e7b8](https://github.com/googleapis/sdk-platform-java/commit/836e7b86eecf61552f203e26dff04359ed27bde2)) +* update slf4j monorepo to v2.0.11 ([#2381](https://github.com/googleapis/sdk-platform-java/issues/2381)) ([9e758b7](https://github.com/googleapis/sdk-platform-java/commit/9e758b792615c0bc4d784e8c33d4f90fcc1566ee)) + +## [2.31.0](https://github.com/googleapis/sdk-platform-java/compare/v2.30.0...v2.31.0) (2024-01-04) + + +### Features + +* [common-protos,common-protos] add auto_populated_fields to google.api.MethodSettings ([#2273](https://github.com/googleapis/sdk-platform-java/issues/2273)) ([d9be11c](https://github.com/googleapis/sdk-platform-java/commit/d9be11c7a127452c5e5ef871854a4a65c68b1b34)) +* add auto_populated_fields to google.api.MethodSettings ([d9be11c](https://github.com/googleapis/sdk-platform-java/commit/d9be11c7a127452c5e5ef871854a4a65c68b1b34)) +* add parsing of autopopulated fields from serviceyaml ([#2312](https://github.com/googleapis/sdk-platform-java/issues/2312)) ([4f535a7](https://github.com/googleapis/sdk-platform-java/commit/4f535a7829f98fe79053e62e22deaf91a97ab917)) +* Add Universe Domain to ClientSettings ([#2331](https://github.com/googleapis/sdk-platform-java/issues/2331)) ([1bddac5](https://github.com/googleapis/sdk-platform-java/commit/1bddac5f91b5b7742c6082da2ae0c6667523aaa4)) +* Add Universe Domain to Java-Core ([#2329](https://github.com/googleapis/sdk-platform-java/issues/2329)) ([586ac9f](https://github.com/googleapis/sdk-platform-java/commit/586ac9f668e0ae647e3ef233458d2c754959f6e5)) +* Full Endpoint Resolution from EndpointContext ([#2313](https://github.com/googleapis/sdk-platform-java/issues/2313)) ([f499ced](https://github.com/googleapis/sdk-platform-java/commit/f499ced28a562cbb3ea49f14a4fa16eb6a8173cc)) +* move Java Owlbot into this repository for postprocessing ([#2282](https://github.com/googleapis/sdk-platform-java/issues/2282)) ([f8969d2](https://github.com/googleapis/sdk-platform-java/commit/f8969d2b5b50b338967802436bac8d21c3656e07)) +* new artifact for sdk-platform-java configs. ([#2315](https://github.com/googleapis/sdk-platform-java/issues/2315)) ([99e5195](https://github.com/googleapis/sdk-platform-java/commit/99e51953f319c97b225a0209b093367fa440f9d3)) +* Parse Host Service Name ([#2300](https://github.com/googleapis/sdk-platform-java/issues/2300)) ([8822f3b](https://github.com/googleapis/sdk-platform-java/commit/8822f3b514bdddf028c12db7a773e80fa4f4f3a1)) +* Structs mapper utility ([#2278](https://github.com/googleapis/sdk-platform-java/issues/2278)) ([da6607b](https://github.com/googleapis/sdk-platform-java/commit/da6607b17130ab045640618d505fda915ddb8e49)) +* unmanaged dependency check ([#2223](https://github.com/googleapis/sdk-platform-java/issues/2223)) ([3439691](https://github.com/googleapis/sdk-platform-java/commit/34396919b6c58f85af26650a7d3d429d9b4e9008)) + + +### Bug Fixes + +* format proto comments in Client Overview ([#2280](https://github.com/googleapis/sdk-platform-java/issues/2280)) ([4029fbd](https://github.com/googleapis/sdk-platform-java/commit/4029fbdd9ab060ef55382b1890f323f85fe3ceef)) +* re-enable checkstyle in sdk-platform-java-config ([#2335](https://github.com/googleapis/sdk-platform-java/issues/2335)) ([285bdb1](https://github.com/googleapis/sdk-platform-java/commit/285bdb101194740a7a9618565679b7be01c70f43)) + + +### Dependencies + +* update google api dependencies ([#2277](https://github.com/googleapis/sdk-platform-java/issues/2277)) ([4bc45bd](https://github.com/googleapis/sdk-platform-java/commit/4bc45bd3c525714acc3866ce47943f91d860f8d2)) +* update googleapis/java-cloud-bom digest to 3fe0c17 ([#2286](https://github.com/googleapis/sdk-platform-java/issues/2286)) ([c7de93e](https://github.com/googleapis/sdk-platform-java/commit/c7de93e6a6e08b663041e98eaab9cb5449d51b9f)) +* update grpc dependencies to v1.60.0 ([#2288](https://github.com/googleapis/sdk-platform-java/issues/2288)) ([c8bf058](https://github.com/googleapis/sdk-platform-java/commit/c8bf05813cb8968447572df5622cf497510bca34)) + +## [2.30.0](https://github.com/googleapis/sdk-platform-java/compare/v2.29.0...v2.30.0) (2023-11-29) + + +### Features + +* update javadocs for Client classes to include table of methods ([#2114](https://github.com/googleapis/sdk-platform-java/issues/2114)) ([c81cd0f](https://github.com/googleapis/sdk-platform-java/commit/c81cd0ffb95df7fc6d52629c770254aea60ff4fd)) + + +### Bug Fixes + +* confirm owlbot-copy succeeeded to transfer java files ([#2235](https://github.com/googleapis/sdk-platform-java/issues/2235)) ([94d1dd2](https://github.com/googleapis/sdk-platform-java/commit/94d1dd24e38b348a9727f231d6d9aa4e8635144e)) +* improve information on CancellationException for LROs ([#2236](https://github.com/googleapis/sdk-platform-java/issues/2236)) ([741e40c](https://github.com/googleapis/sdk-platform-java/commit/741e40ceb0b7d5e0eceb8a90a52acf57648c0066)) +* owlbot-cli image sha to be locked (hermetic) ([#2252](https://github.com/googleapis/sdk-platform-java/issues/2252)) ([6c4c236](https://github.com/googleapis/sdk-platform-java/commit/6c4c2364c1798642a19c8208c09c9becd562012d)) + + +### Dependencies + +* update dependency com.fasterxml.jackson:jackson-bom to v2.16.0 ([#2259](https://github.com/googleapis/sdk-platform-java/issues/2259)) ([4eef7ec](https://github.com/googleapis/sdk-platform-java/commit/4eef7ec8311cf196253143fdaa46ccdb6c8fc153)) +* update dependency com.google.cloud:grpc-gcp to v1.5.0 ([#2265](https://github.com/googleapis/sdk-platform-java/issues/2265)) ([964a649](https://github.com/googleapis/sdk-platform-java/commit/964a649838b9b58c2ae40e6d7da205a9ffd17b90)) +* update dependency com.google.errorprone:error_prone_annotations to v2.23.0 ([#2182](https://github.com/googleapis/sdk-platform-java/issues/2182)) ([5116f3d](https://github.com/googleapis/sdk-platform-java/commit/5116f3dcd93759220b450ebfd0a1535cb56e6e30)) +* update dependency com.googlecode.maven-download-plugin:download-maven-plugin to v1.7.1 ([#2151](https://github.com/googleapis/sdk-platform-java/issues/2151)) ([cbe1bb1](https://github.com/googleapis/sdk-platform-java/commit/cbe1bb11548c791cde32d3c5b237977fa486f11a)) +* update dependency cryptography to v41.0.7 ([#2255](https://github.com/googleapis/sdk-platform-java/issues/2255)) ([a98ea5c](https://github.com/googleapis/sdk-platform-java/commit/a98ea5cccc8dc8e4015473a9529f3cd066ad7913)) +* update dependency net.bytebuddy:byte-buddy to v1.14.10 ([#2256](https://github.com/googleapis/sdk-platform-java/issues/2256)) ([094f263](https://github.com/googleapis/sdk-platform-java/commit/094f2639e74e483658b567ceb7125079caed7e34)) +* update dependency org.apache.commons:commons-lang3 to v3.14.0 ([#2260](https://github.com/googleapis/sdk-platform-java/issues/2260)) ([03dc96b](https://github.com/googleapis/sdk-platform-java/commit/03dc96bb5f48e38436812eb882255695d256d69f)) +* update dependency org.checkerframework:checker-qual to v3.40.0 ([#2221](https://github.com/googleapis/sdk-platform-java/issues/2221)) ([c3fcfbd](https://github.com/googleapis/sdk-platform-java/commit/c3fcfbd44656f7589527642056f46c21be8019a5)) +* update dependency pyasn1 to v0.5.1 ([#2262](https://github.com/googleapis/sdk-platform-java/issues/2262)) ([4bfa6cf](https://github.com/googleapis/sdk-platform-java/commit/4bfa6cf7c347d8068b6cbf94788cd057686afb12)) +* update google api dependencies ([#2219](https://github.com/googleapis/sdk-platform-java/issues/2219)) ([877cb2a](https://github.com/googleapis/sdk-platform-java/commit/877cb2a14a3dd9abe26b1c3a4652811c1770ccdc)) +* update googleapis/java-cloud-bom digest to ab98a49 ([#2231](https://github.com/googleapis/sdk-platform-java/issues/2231)) ([67a2c94](https://github.com/googleapis/sdk-platform-java/commit/67a2c947fe6ee4bb3478b873a92d5e7c66eaa3b7)) +* update grpc dependencies to v1.59.1 ([#2263](https://github.com/googleapis/sdk-platform-java/issues/2263)) ([fdb1559](https://github.com/googleapis/sdk-platform-java/commit/fdb1559013e6c2f6c6638c8ed6a078a92314f803)) +* update guava monorepo ([#2139](https://github.com/googleapis/sdk-platform-java/issues/2139)) ([b861f19](https://github.com/googleapis/sdk-platform-java/commit/b861f19a824353da8f585151924813d9197b3c9b)) +* update netty dependencies to v4.1.101.final ([#2257](https://github.com/googleapis/sdk-platform-java/issues/2257)) ([2733fcf](https://github.com/googleapis/sdk-platform-java/commit/2733fcf8baf33f6129cccec3f6b3a305e68ad947)) +* update protobuf dependencies to v3.25.0 ([#2222](https://github.com/googleapis/sdk-platform-java/issues/2222)) ([445477f](https://github.com/googleapis/sdk-platform-java/commit/445477f7fec3a6d4be9df4c9cf3f01c007307645)) +* update protobuf dependencies to v3.25.1 ([#2242](https://github.com/googleapis/sdk-platform-java/issues/2242)) ([faea6c4](https://github.com/googleapis/sdk-platform-java/commit/faea6c4414977fb5e5d7d2abc3604e01d27731c1)) + + +### Documentation + +* Update RetrySettings javadocs to include polling ([#1863](https://github.com/googleapis/sdk-platform-java/issues/1863)) ([3c9cb06](https://github.com/googleapis/sdk-platform-java/commit/3c9cb061c8cee59dd1072bd415c32110ecf10517)) + +## [2.29.0](https://github.com/googleapis/sdk-platform-java/compare/v2.28.0...v2.29.0) (2023-10-31) + + +### Features + +* `generate_library.sh` with postprocessing ([#1951](https://github.com/googleapis/sdk-platform-java/issues/1951)) ([39b9f0e](https://github.com/googleapis/sdk-platform-java/commit/39b9f0e956b7967d118873ee2e365fe6a02a029b)) + + +### Dependencies + +* update dependency cryptography to v41.0.5 ([#2206](https://github.com/googleapis/sdk-platform-java/issues/2206)) ([6d1f84a](https://github.com/googleapis/sdk-platform-java/commit/6d1f84a7923573346fbfbfa3107a3da4c0a19bfe)) +* update dependency google-auth to v2.23.4 ([#2217](https://github.com/googleapis/sdk-platform-java/issues/2217)) ([f1ee04d](https://github.com/googleapis/sdk-platform-java/commit/f1ee04d902000c5f8dd6a9c51dea57c9de01a25e)) +* update dependency google-cloud-storage to v2.13.0 ([#2216](https://github.com/googleapis/sdk-platform-java/issues/2216)) ([1af12a8](https://github.com/googleapis/sdk-platform-java/commit/1af12a8881c2036d4ddb844c061b5f6b17e991d9)) +* update google api dependencies ([#2187](https://github.com/googleapis/sdk-platform-java/issues/2187)) ([448b0d1](https://github.com/googleapis/sdk-platform-java/commit/448b0d1eea5c4bd5f89176315c21cf7d49bc1af5)) +* update googleapis/java-cloud-bom digest to 41d86db ([#2205](https://github.com/googleapis/sdk-platform-java/issues/2205)) ([9152f24](https://github.com/googleapis/sdk-platform-java/commit/9152f24e7aafa165326205b12d3709c61c842a3f)) +* update googleapis/java-cloud-bom digest to b8394a1 ([#2201](https://github.com/googleapis/sdk-platform-java/issues/2201)) ([f9957df](https://github.com/googleapis/sdk-platform-java/commit/f9957df04bc00d72e1a26dfd5c4c4805172d58d7)) +* update googleapis/java-cloud-bom digest to d06156f ([#2200](https://github.com/googleapis/sdk-platform-java/issues/2200)) ([097e37e](https://github.com/googleapis/sdk-platform-java/commit/097e37e560646ed47925e3620c5a490a78889ec7)) +* update googleapis/java-cloud-bom digest to e896c4e ([#2198](https://github.com/googleapis/sdk-platform-java/issues/2198)) ([15a796f](https://github.com/googleapis/sdk-platform-java/commit/15a796f718e7e27991d27a337223314addb0375a)) +* update graal-sdk to 22.3.3 in bazel dependencies file ([#2209](https://github.com/googleapis/sdk-platform-java/issues/2209)) ([25957d3](https://github.com/googleapis/sdk-platform-java/commit/25957d3b8cc0424d5b1ac293e771a15f0fc54721)) +* update grpc dependencies to v1.59.0 ([#2211](https://github.com/googleapis/sdk-platform-java/issues/2211)) ([7dafa8d](https://github.com/googleapis/sdk-platform-java/commit/7dafa8d452615e5ac5dd5fbb95e645a1ce4a9226)) + +## [2.28.0](https://github.com/googleapis/sdk-platform-java/compare/v2.27.0...v2.28.0) (2023-10-19) + + +### Features + +* Add gapic options as inputs to `generate_library.sh` ([#2121](https://github.com/googleapis/sdk-platform-java/issues/2121)) ([b17d8a1](https://github.com/googleapis/sdk-platform-java/commit/b17d8a12575b273b4536b42c37bf61b321fc0e5a)) +* Log DirectPath misconfiguration ([#2105](https://github.com/googleapis/sdk-platform-java/issues/2105)) ([860ae76](https://github.com/googleapis/sdk-platform-java/commit/860ae7646a985786966af55c5d3be35981e0fab1)) +* Replace graal version declarion with properties placeholder ([#2120](https://github.com/googleapis/sdk-platform-java/issues/2120)) ([e5247ba](https://github.com/googleapis/sdk-platform-java/commit/e5247ba61eb4c2e543bab79110eaba3766a8264f)) + + +### Bug Fixes + +* Make sure outstanding RPCs count in ChannelPool can not go negative ([#2185](https://github.com/googleapis/sdk-platform-java/issues/2185)) ([d2d624d](https://github.com/googleapis/sdk-platform-java/commit/d2d624def3d72ecdaa3fdf7e2a92fd29d39ff1aa)) + + +### Dependencies + +* Update dependency attrs to v22.2.0 ([#2146](https://github.com/googleapis/sdk-platform-java/issues/2146)) ([49d7f55](https://github.com/googleapis/sdk-platform-java/commit/49d7f55df0efd1ebf4ec074a8b9c23324de69149)) +* Update dependency cffi to v1.16.0 ([#2147](https://github.com/googleapis/sdk-platform-java/issues/2147)) ([db37d5b](https://github.com/googleapis/sdk-platform-java/commit/db37d5ba609adf571c75f9f2f51c39b7453b862b)) +* Update dependency charset-normalizer to v2.1.1 ([#2148](https://github.com/googleapis/sdk-platform-java/issues/2148)) ([759e957](https://github.com/googleapis/sdk-platform-java/commit/759e957a1a3738218a6e360660d340cb99a3268e)) +* Update dependency com.fasterxml.jackson:jackson-bom to v2.15.3 ([#2136](https://github.com/googleapis/sdk-platform-java/issues/2136)) ([be25555](https://github.com/googleapis/sdk-platform-java/commit/be2555565c91580df0b81ae09ad2cda8ef5a40a7)) +* Update dependency com.google.auto.value:auto-value to v1.10.4 ([#2137](https://github.com/googleapis/sdk-platform-java/issues/2137)) ([5edca8b](https://github.com/googleapis/sdk-platform-java/commit/5edca8b542e767cc9a9a899420f2707a5c91e1e7)) +* Update dependency com.google.auto.value:auto-value-annotations to v1.10.4 ([#2138](https://github.com/googleapis/sdk-platform-java/issues/2138)) ([705c358](https://github.com/googleapis/sdk-platform-java/commit/705c358804767419f742978185fa9a93e622a1da)) +* Update dependency com.google.errorprone:error_prone_annotations to v2.22.0 ([#2130](https://github.com/googleapis/sdk-platform-java/issues/2130)) ([805daf1](https://github.com/googleapis/sdk-platform-java/commit/805daf1a9967f63b747624dd4098d78a80c083bf)) +* Update dependency com.google.errorprone:error_prone_annotations to v2.22.0 ([#2145](https://github.com/googleapis/sdk-platform-java/issues/2145)) ([f936331](https://github.com/googleapis/sdk-platform-java/commit/f9363315f20f27237324a5797ba20a0097283410)) +* Update dependency commons-codec:commons-codec to v1.16.0 ([#2152](https://github.com/googleapis/sdk-platform-java/issues/2152)) ([0cf3440](https://github.com/googleapis/sdk-platform-java/commit/0cf34408d97c5d7dd63ea941de27b64a95e35524)) +* Update dependency cryptography to v41.0.4 [security] ([#2109](https://github.com/googleapis/sdk-platform-java/issues/2109)) ([e2f57f2](https://github.com/googleapis/sdk-platform-java/commit/e2f57f2fe20c920eafb0306ea51c8205e371d972)) +* Update dependency gcp-releasetool to v1.16.0 ([#2111](https://github.com/googleapis/sdk-platform-java/issues/2111)) ([69d1259](https://github.com/googleapis/sdk-platform-java/commit/69d12593dfbd0d69d2bd79df8d42def42eccb892)) +* Update dependency google-api-core to v2.12.0 ([#2153](https://github.com/googleapis/sdk-platform-java/issues/2153)) ([8c1baf5](https://github.com/googleapis/sdk-platform-java/commit/8c1baf59fac515b10698b1548a7104e8ef82cd1e)) +* Update dependency google-auth to v2.23.3 ([#2154](https://github.com/googleapis/sdk-platform-java/issues/2154)) ([3645fed](https://github.com/googleapis/sdk-platform-java/commit/3645fed46926cf4f402e4986749db55b86fab6b6)) +* Update dependency google-cloud-core to v2.3.3 ([#2113](https://github.com/googleapis/sdk-platform-java/issues/2113)) ([c8194cf](https://github.com/googleapis/sdk-platform-java/commit/c8194cf29dfee221d87aaaca13983794ad089433)) +* Update dependency google-cloud-storage to v2.12.0 ([#2155](https://github.com/googleapis/sdk-platform-java/issues/2155)) ([0ec9027](https://github.com/googleapis/sdk-platform-java/commit/0ec902795ae36ff16890a1c02c07b2b977dfed14)) +* Update dependency google-crc32c to v1.5.0 ([#2157](https://github.com/googleapis/sdk-platform-java/issues/2157)) ([6556ed5](https://github.com/googleapis/sdk-platform-java/commit/6556ed588bad9901592949ce5674ac2894102bd2)) +* Update dependency google-resumable-media to v2.6.0 ([#2161](https://github.com/googleapis/sdk-platform-java/issues/2161)) ([87dd6f2](https://github.com/googleapis/sdk-platform-java/commit/87dd6f2862dbd82fe267008306e841c4e9bb5af2)) +* Update dependency googleapis-common-protos to v1.61.0 ([#2156](https://github.com/googleapis/sdk-platform-java/issues/2156)) ([f7fd515](https://github.com/googleapis/sdk-platform-java/commit/f7fd515b00ff615cbd7b86c8471b2a1d8a1ce2ee)) +* Update dependency gradle to v7.6.3 ([#2115](https://github.com/googleapis/sdk-platform-java/issues/2115)) ([cd9748d](https://github.com/googleapis/sdk-platform-java/commit/cd9748d4a62b843080c107309c15d6894eb0eb28)) +* Update dependency importlib-metadata to v4.13.0 ([#2162](https://github.com/googleapis/sdk-platform-java/issues/2162)) ([ac6e3d5](https://github.com/googleapis/sdk-platform-java/commit/ac6e3d5bbeab2dbf35aefc14b20217119e99460d)) +* Update dependency jeepney to v0.8.0 ([#2165](https://github.com/googleapis/sdk-platform-java/issues/2165)) ([59744b5](https://github.com/googleapis/sdk-platform-java/commit/59744b56409564dab142f24533672b1fa9726313)) +* Update dependency jinja2 to v3.1.2 ([#2166](https://github.com/googleapis/sdk-platform-java/issues/2166)) ([c7ac765](https://github.com/googleapis/sdk-platform-java/commit/c7ac765237c7bbed041e7b15b040625f411eee5c)) +* Update dependency markupsafe to v2.1.3 ([#2168](https://github.com/googleapis/sdk-platform-java/issues/2168)) ([ea26b1a](https://github.com/googleapis/sdk-platform-java/commit/ea26b1aedcdb4eb08449194b111b00e07c2c0d02)) +* Update dependency net.bytebuddy:byte-buddy to v1.14.9 ([#2116](https://github.com/googleapis/sdk-platform-java/issues/2116)) ([e0ad3e6](https://github.com/googleapis/sdk-platform-java/commit/e0ad3e678ac9a42cb4c9a6111e8da750a2294ba6)) +* Update dependency org.apache.commons:commons-lang3 to v3.13.0 ([#2131](https://github.com/googleapis/sdk-platform-java/issues/2131)) ([c066286](https://github.com/googleapis/sdk-platform-java/commit/c066286ef3da2f8587d44d2b3d60db63be24875a)) +* Update dependency org.checkerframework:checker-qual to v3.39.0 ([#2158](https://github.com/googleapis/sdk-platform-java/issues/2158)) ([dfe2bbc](https://github.com/googleapis/sdk-platform-java/commit/dfe2bbcd6079ab0b28f091bc132dfc27c9ab98c0)) +* Update dependency org.easymock:easymock to v5.2.0 ([#2159](https://github.com/googleapis/sdk-platform-java/issues/2159)) ([8daf145](https://github.com/googleapis/sdk-platform-java/commit/8daf1452351aa0df2e282676a69e90c3743b4edf)) +* Update dependency org.yaml:snakeyaml to v2.2 ([#2160](https://github.com/googleapis/sdk-platform-java/issues/2160)) ([0664bf6](https://github.com/googleapis/sdk-platform-java/commit/0664bf6e578861197abd3ed31148d7db27b8eb53)) +* Update dependency protobuf to v3.20.3 ([#2169](https://github.com/googleapis/sdk-platform-java/issues/2169)) ([669d369](https://github.com/googleapis/sdk-platform-java/commit/669d3698cb76471cd0c9c6a398fb7b3d848d1571)) +* Update dependency pyasn1 to v0.5.0 ([#2170](https://github.com/googleapis/sdk-platform-java/issues/2170)) ([a842045](https://github.com/googleapis/sdk-platform-java/commit/a842045c71cdf88975505c90b5915eba321f0a65)) +* Update dependency pyasn1-modules to v0.3.0 ([#2171](https://github.com/googleapis/sdk-platform-java/issues/2171)) ([4abbf85](https://github.com/googleapis/sdk-platform-java/commit/4abbf858712b1f629df8b19a9007d1a09451e5e2)) +* Update dependency pyjwt to v2.8.0 ([#2172](https://github.com/googleapis/sdk-platform-java/issues/2172)) ([875146e](https://github.com/googleapis/sdk-platform-java/commit/875146eb3c1ac3cb1953980825f79c75c3251ea6)) +* Update dependency pyparsing to v3.1.1 ([#2173](https://github.com/googleapis/sdk-platform-java/issues/2173)) ([caac831](https://github.com/googleapis/sdk-platform-java/commit/caac8316a12aa0d8b7ef5f57912727a1abfc3151)) +* Update dependency typing-extensions to v4.8.0 ([#2174](https://github.com/googleapis/sdk-platform-java/issues/2174)) ([1a8f7a4](https://github.com/googleapis/sdk-platform-java/commit/1a8f7a446665b6fe03dd98856734ec48b59e080f)) +* Update dependency urllib3 to v1.26.17 [security] ([#2110](https://github.com/googleapis/sdk-platform-java/issues/2110)) ([5f40056](https://github.com/googleapis/sdk-platform-java/commit/5f40056fdb5d62e59744d43dd149d5da20979e59)) +* Update dependency urllib3 to v1.26.18 ([#2177](https://github.com/googleapis/sdk-platform-java/issues/2177)) ([9683111](https://github.com/googleapis/sdk-platform-java/commit/9683111627bca74ed0d123caf37ff0993c71d2ea)) +* Update dependency zipp to v3.17.0 ([#2175](https://github.com/googleapis/sdk-platform-java/issues/2175)) ([1700c59](https://github.com/googleapis/sdk-platform-java/commit/1700c597a74f906689a3a53e023ac094c9deeaff)) +* Update google api dependencies ([#2132](https://github.com/googleapis/sdk-platform-java/issues/2132)) ([bd4ae4f](https://github.com/googleapis/sdk-platform-java/commit/bd4ae4fab88a421ad93e597f99cabb7997f91e1d)) +* Update google auth library dependencies to v1.20.0 ([#2142](https://github.com/googleapis/sdk-platform-java/issues/2142)) ([ce59ed8](https://github.com/googleapis/sdk-platform-java/commit/ce59ed8be29a6b05f7c999bf48cb4d442fc2294a)) +* Update googleapis/java-cloud-bom digest to 4b9b60d ([#2178](https://github.com/googleapis/sdk-platform-java/issues/2178)) ([6a8972e](https://github.com/googleapis/sdk-platform-java/commit/6a8972ea287f665d82046b8314887edee27a6c1a)) +* Update googleapis/java-cloud-bom digest to a0bfee4 ([#2181](https://github.com/googleapis/sdk-platform-java/issues/2181)) ([88bccd9](https://github.com/googleapis/sdk-platform-java/commit/88bccd9e4b6c3245c0fae7e142954155bf373274)) +* Update googleapis/java-cloud-bom digest to e485c2f ([#2134](https://github.com/googleapis/sdk-platform-java/issues/2134)) ([97f97c6](https://github.com/googleapis/sdk-platform-java/commit/97f97c6063f91183af260d875d58958f4bba658b)) +* Update netty dependencies ([#2141](https://github.com/googleapis/sdk-platform-java/issues/2141)) ([fedc7b9](https://github.com/googleapis/sdk-platform-java/commit/fedc7b921f5415b2d51d3147ef1aaebf1b75ccdb)) +* Update protobuf dependencies to v3.24.4 ([#2118](https://github.com/googleapis/sdk-platform-java/issues/2118)) ([7b3f4b9](https://github.com/googleapis/sdk-platform-java/commit/7b3f4b97b013a32f171bd8a365d6d712b94b3849)) + +## [2.27.0](https://github.com/googleapis/sdk-platform-java/compare/v2.26.1...v2.27.0) (2023-10-06) + + +### Features + +* [common-protos] public google.api.FieldInfo type and extension ([#2037](https://github.com/googleapis/sdk-platform-java/issues/2037)) ([f2b8280](https://github.com/googleapis/sdk-platform-java/commit/f2b828005e6b21a2af0e646bb8cc6d0f8c39d4e4)) +* Generate proto-only library ([#2046](https://github.com/googleapis/sdk-platform-java/issues/2046)) ([f9ac8fb](https://github.com/googleapis/sdk-platform-java/commit/f9ac8fb0020372be4b62d5dffe7e1b73a1ac493f)) +* More logging for ChannelPool shutdown ([#2070](https://github.com/googleapis/sdk-platform-java/issues/2070)) ([b8365c2](https://github.com/googleapis/sdk-platform-java/commit/b8365c2a0c56db1ee286c582cd9ebe31a3d614e8)) + + +### Dependencies + +* Bumping java-shared-config to 1.5.8 ([#2072](https://github.com/googleapis/sdk-platform-java/issues/2072)) ([fa5e937](https://github.com/googleapis/sdk-platform-java/commit/fa5e937e98ad19b997f8c0e11cd03e61f707f3fe)) + +## [2.26.1](https://github.com/googleapis/sdk-platform-java/compare/v2.26.0...v2.26.1) (2023-09-25) + + +### Bug Fixes + +* Add Geo common protos to Bazel test dependencies. ([#2033](https://github.com/googleapis/sdk-platform-java/issues/2033)) ([625ecc5](https://github.com/googleapis/sdk-platform-java/commit/625ecc503a6b193716820681aafe0f2daf16d4c4)) + +## [2.26.0](https://github.com/googleapis/sdk-platform-java/compare/v2.25.0...v2.26.0) (2023-09-21) + + +### Features + +* Filter out `*gapic.legacy.yaml` when parsing `java_gapic_opts` ([#2015](https://github.com/googleapis/sdk-platform-java/issues/2015)) ([1ad5ec0](https://github.com/googleapis/sdk-platform-java/commit/1ad5ec0c2d99e41f4fddf9ed131c6dc9bffe17b4)) +* Generate showcase without post-processing ([#1935](https://github.com/googleapis/sdk-platform-java/issues/1935)) ([7218d80](https://github.com/googleapis/sdk-platform-java/commit/7218d8035946c350d7857fede93d32df3b2b8a86)) +* Hermetic build OS detection ([#1988](https://github.com/googleapis/sdk-platform-java/issues/1988)) ([4fc844e](https://github.com/googleapis/sdk-platform-java/commit/4fc844ee0ffdaae26ef3d32c18bbe7604da5c16f)) +* Hermetic build scripts to use a single output/generation folder ([#1987](https://github.com/googleapis/sdk-platform-java/issues/1987)) ([f5efb0e](https://github.com/googleapis/sdk-platform-java/commit/f5efb0edb097980db95832469188c754ec3f1779)) +* Search gapic additional protos in `BUILD.bazel` ([#2004](https://github.com/googleapis/sdk-platform-java/issues/2004)) ([ed16ac7](https://github.com/googleapis/sdk-platform-java/commit/ed16ac74ab8430ee0def437147298d7d88da6b0c)) + + +### Bug Fixes + +* **hermetic-build:** Obtain gapic-generator-java locally on release branch ([#2023](https://github.com/googleapis/sdk-platform-java/issues/2023)) ([f3088d5](https://github.com/googleapis/sdk-platform-java/commit/f3088d55478ab049110d8c2e67ff1dd056a5e71d)) +* Showcase update goal fix ([#2002](https://github.com/googleapis/sdk-platform-java/issues/2002)) ([47811f7](https://github.com/googleapis/sdk-platform-java/commit/47811f79848d6efd9dda8b3e8e4286dc3045423f)) +* Skip generating `grpc-*` directory if transport is `rest` ([#1979](https://github.com/googleapis/sdk-platform-java/issues/1979)) ([9c0316b](https://github.com/googleapis/sdk-platform-java/commit/9c0316bfed890ed7d8e40340a3510d2058dc5d71)) + + +### Documentation + +* Add repo-metadata.json files for modules we publish Cloud RAD d… ([#2003](https://github.com/googleapis/sdk-platform-java/issues/2003)) ([2212ba3](https://github.com/googleapis/sdk-platform-java/commit/2212ba300c215b00cf852fd3d8615f3d3c3458e1)) + + +### Dependencies + +* Update protobuf dependencies to v3.24.3 ([#2020](https://github.com/googleapis/sdk-platform-java/issues/2020)) ([2b45049](https://github.com/googleapis/sdk-platform-java/commit/2b45049fd6fbd38acded8ae900ef4b530a441bdf)) + +## [2.25.0](https://github.com/googleapis/sdk-platform-java/compare/v2.24.0...v2.25.0) (2023-09-08) + + +### Features + +* [common-protos,common-protos] add new FieldBehavior value IDENTIFIER ([#1937](https://github.com/googleapis/sdk-platform-java/issues/1937)) ([24ae2a3](https://github.com/googleapis/sdk-platform-java/commit/24ae2a3e0237fb2821ea07ccdd874c92ead598a2)) +* Add `generate_library.sh` without post processing ([#1916](https://github.com/googleapis/sdk-platform-java/issues/1916)) ([ffc058a](https://github.com/googleapis/sdk-platform-java/commit/ffc058a08c523b3811b021ec1bc30201452a36c9)) +* Adding vendor and vendor information in header ([#1963](https://github.com/googleapis/sdk-platform-java/issues/1963)) ([ed44aa7](https://github.com/googleapis/sdk-platform-java/commit/ed44aa785f8e21ad07aed984220db6e30e07a6c6)) +* Introduce @ObsoleteApi ([#1887](https://github.com/googleapis/sdk-platform-java/issues/1887)) ([5df1aa3](https://github.com/googleapis/sdk-platform-java/commit/5df1aa3733852aaeed068080f6b48047e89dc799)) + + +### Bug Fixes + +* Remove -H:-RunReachabilityHandlersConcurrently ([#1892](https://github.com/googleapis/sdk-platform-java/issues/1892)) ([9cc52e1](https://github.com/googleapis/sdk-platform-java/commit/9cc52e1e788e4196c9e83ad5d8a9487042ae707e)) +* Use && in equals check to avoid possible NPE ([#1927](https://github.com/googleapis/sdk-platform-java/issues/1927)) ([815567c](https://github.com/googleapis/sdk-platform-java/commit/815567ca4085702ecee8fc95603574cd52d6c57d)) + + +### Documentation + +* [iam] Minor formatting ([#1902](https://github.com/googleapis/sdk-platform-java/issues/1902)) ([5ec1142](https://github.com/googleapis/sdk-platform-java/commit/5ec1142458a46ae1c561f608b2ef7ac18ab0bafd)) + +## [2.24.0](https://github.com/googleapis/sdk-platform-java/compare/v2.23.1...v2.24.0) (2023-08-01) + + +### Features + +* [common-protos] Add a proto message to describe the `resource_type` and `resource_permission` for an API method ([#1878](https://github.com/googleapis/sdk-platform-java/issues/1878)) ([3e27ca9](https://github.com/googleapis/sdk-platform-java/commit/3e27ca9763e9639fb00b99bdef9cf95aacd33897)) + +## [2.23.1](https://github.com/googleapis/sdk-platform-java/compare/v2.23.0...v2.23.1) (2023-07-19) + + +### Bug Fixes + +* Resource name class deduplication ([#1854](https://github.com/googleapis/sdk-platform-java/issues/1854)) ([08eca7d](https://github.com/googleapis/sdk-platform-java/commit/08eca7de7e80c6f242a23a9d76659e0a413c896f)) +* Use bindings for resolving multi pattern resources ([#1818](https://github.com/googleapis/sdk-platform-java/issues/1818)) ([1352fab](https://github.com/googleapis/sdk-platform-java/commit/1352fab654052e670df6d5c8718fcc6e06ef086c)) + + +### Dependencies + +* Auto-value version 1.10.2 ([#1859](https://github.com/googleapis/sdk-platform-java/issues/1859)) ([54843c9](https://github.com/googleapis/sdk-platform-java/commit/54843c95e0f0e2d004b14e82650c01026bf2ad70)) +* Bump grpc version to 1.56.1 ([1fcdd89](https://github.com/googleapis/sdk-platform-java/commit/1fcdd893240a7e5da293c6a26df193131577bbdd)) +* Bump jackson version to 2.15.2 ([bde81d8](https://github.com/googleapis/sdk-platform-java/commit/bde81d8c6f15130f51ea4e2d9805de3c0a21ae39)) + +## [2.23.0](https://github.com/googleapis/sdk-platform-java/compare/v2.22.0...v2.23.0) (2023-07-07) + + +### Features + +* Support GDC-H Credentials ([#1642](https://github.com/googleapis/sdk-platform-java/issues/1642)) ([26da0d3](https://github.com/googleapis/sdk-platform-java/commit/26da0d3fb882e4f11c1cc43a81d34eb500c2c0cf)) + + +### Bug Fixes + +* [gapic-generator-java] handle response and metadata type ambiguity in LRO parsing ([#1726](https://github.com/googleapis/sdk-platform-java/issues/1726)) ([1ace494](https://github.com/googleapis/sdk-platform-java/commit/1ace49499175f2509062edb2fa5098e6cf8035d6)) +* Abstract batch resource and add method to determine if batch should be flushed ([#1790](https://github.com/googleapis/sdk-platform-java/issues/1790)) ([4c74107](https://github.com/googleapis/sdk-platform-java/commit/4c741077d614093d08665e9ddd83fb0e332b7881)) + + +### Dependencies + +* Bump grpc-java version to 1.55.3 ([1ff8cc0](https://github.com/googleapis/sdk-platform-java/commit/1ff8cc017bfb567933713ceeb06502f5eec9eaa6)) +* Bump guava version to 32.1.1-jre ([016e84d](https://github.com/googleapis/sdk-platform-java/commit/016e84d17febd68e2aa028cba40e2781a383f7ff)) +* Bump j2obc-annotations version to 2.8 ([4f45313](https://github.com/googleapis/sdk-platform-java/commit/4f4531373f313a7d68c2b9bfd5b0f1f71b21128f)) +* Update google-auth-java-library to 1.19.0 ([#1815](https://github.com/googleapis/sdk-platform-java/issues/1815)) ([41007a9](https://github.com/googleapis/sdk-platform-java/commit/41007a9efbd4cf08a5f933c23e01fce6cf2efac7)) + +## [2.22.0](https://github.com/googleapis/sdk-platform-java/compare/v2.21.0...v2.22.0) (2023-06-22) + + +### Features + +* Dynamically determine protobuf version in build.gradle ([#1753](https://github.com/googleapis/sdk-platform-java/issues/1753)) ([6de5110](https://github.com/googleapis/sdk-platform-java/commit/6de51100965b8b6a1c252ec06b10993486de7d44)) +* GA Gax HttpJson ([#1264](https://github.com/googleapis/sdk-platform-java/issues/1264)) ([9f15fea](https://github.com/googleapis/sdk-platform-java/commit/9f15fea139e9b49ae32e6a4923085f9aca9c3115)) + + +### Bug Fixes + +* Update grpc to 1.55.1 in dependencies.properties ([#1794](https://github.com/googleapis/sdk-platform-java/issues/1794)) ([4df4450](https://github.com/googleapis/sdk-platform-java/commit/4df445067484454455512c8f7de0055c0ae21434)) + +## [2.21.0](https://github.com/googleapis/sdk-platform-java/compare/v2.20.1...v2.21.0) (2023-06-06) + + +### Features + +* Dynamic Routing Headers for HttpJson ([#1667](https://github.com/googleapis/sdk-platform-java/issues/1667)) ([003b993](https://github.com/googleapis/sdk-platform-java/commit/003b993f7ad7cae8ae8c101e0ff147e517dcd83e)) +* Implement awaitTermination() for MangedHttpJsonChannel ([#1677](https://github.com/googleapis/sdk-platform-java/issues/1677)) ([dea8426](https://github.com/googleapis/sdk-platform-java/commit/dea8426a85b53d08d3c8d317a1af4312889b1a3d)) + + +### Bug Fixes + +* [gapic-generator-java] align writer behavior for nested types ([#1709](https://github.com/googleapis/sdk-platform-java/issues/1709)) ([a21ffe8](https://github.com/googleapis/sdk-platform-java/commit/a21ffe88f880c0b3c6b5b512cd4d0741d9620dd3)) +* [gapic-generator-java] update year to 2023 in generated license headers ([#1720](https://github.com/googleapis/sdk-platform-java/issues/1720)) ([ef4a7ff](https://github.com/googleapis/sdk-platform-java/commit/ef4a7ff91b259f0b650cc06bd664eadca7bd17c9)) +* Update the return type of setWaitTimeout for convience ([#1751](https://github.com/googleapis/sdk-platform-java/issues/1751)) ([f1927a5](https://github.com/googleapis/sdk-platform-java/commit/f1927a53306ee28186074e6cb03a933a0cdffc1f)) + + +### Dependencies + +* Update dependency com.google.auth:google-auth-library-credentials and google-auth-library-oauth2-http to v1.17.0 ([#1756](https://github.com/googleapis/sdk-platform-java/issues/1756)) ([f583258](https://github.com/googleapis/sdk-platform-java/commit/f58325893b6ab306adbe4047b6dfc438de133ac7)) +* Update protobuf dependencies to v3.23.2 ([#1755](https://github.com/googleapis/sdk-platform-java/issues/1755)) ([55ecbc3](https://github.com/googleapis/sdk-platform-java/commit/55ecbc35cbd735b8f4aab48e02e080d79828d70c)) + +## [2.20.1](https://github.com/googleapis/sdk-platform-java/compare/v2.20.0...v2.20.1) (2023-05-25) + + +### Bug Fixes + +* Allow quota project to be used in combination with null credentials ([#1688](https://github.com/googleapis/sdk-platform-java/issues/1688)) ([cb07bd4](https://github.com/googleapis/sdk-platform-java/commit/cb07bd405b448fbef51367d1b03d4fe9eab54504)) + +## [2.20.0](https://github.com/googleapis/sdk-platform-java/compare/v2.19.0...v2.20.0) (2023-05-24) + + +### Features + +* Create additional tag on release for google-cloud-shared-dependencies ([#1692](https://github.com/googleapis/sdk-platform-java/issues/1692)) ([c0ea245](https://github.com/googleapis/sdk-platform-java/commit/c0ea24588de744a46600fcf6f0f3c6414549e12d)) +* Make stream wait timeout a first class citizen ([#1473](https://github.com/googleapis/sdk-platform-java/issues/1473)) ([bc8a4ad](https://github.com/googleapis/sdk-platform-java/commit/bc8a4ad864f4d6f2b9d98e5fe296320fea19e74b)) + + +### Bug Fixes + +* Fix release tag workflow to fetch all tags first ([#1700](https://github.com/googleapis/sdk-platform-java/issues/1700)) ([99b0c96](https://github.com/googleapis/sdk-platform-java/commit/99b0c967fbed22967cd072825de403ed9bac0209)) +* Update tag workflow ([#1699](https://github.com/googleapis/sdk-platform-java/issues/1699)) ([a988fe7](https://github.com/googleapis/sdk-platform-java/commit/a988fe7dcfc8568c9256c22b5df907b16e5eea5a)) + + +### Dependencies + +* Update protobuf dependencies to v3.23.1 and gprc to 1.55.1 ([#1698](https://github.com/googleapis/sdk-platform-java/issues/1698)) ([1f56175](https://github.com/googleapis/sdk-platform-java/commit/1f561754ed9e797f639cbdfabe070b86b645281b)) +* Update showcase version to 0.28.1 ([#1673](https://github.com/googleapis/sdk-platform-java/issues/1673)) ([9a120e9](https://github.com/googleapis/sdk-platform-java/commit/9a120e98524018fa54ae5dcbe2fb0f524c2a0f1b)) + +## [2.19.0](https://github.com/googleapis/gapic-generator-java/compare/v2.18.0...v2.19.0) (2023-05-09) + + +### Features + +* [common-protos] .NET library settings (for generator behavior tweaks) ([7479758](https://github.com/googleapis/gapic-generator-java/commit/7479758bcc7c7631b01a2a06d149429852cc3900)) +* [common-protos] add GEO, SHOPPING, GENERATIVE_AI client orgs ([7479758](https://github.com/googleapis/gapic-generator-java/commit/7479758bcc7c7631b01a2a06d149429852cc3900)) +* [common-protos] Log Analytics features of the Cloud Logging API ([#1573](https://github.com/googleapis/gapic-generator-java/issues/1573)) ([7479758](https://github.com/googleapis/gapic-generator-java/commit/7479758bcc7c7631b01a2a06d149429852cc3900)) +* Add an option to enable DirectPath xDS ([#1643](https://github.com/googleapis/gapic-generator-java/issues/1643)) ([4054bc6](https://github.com/googleapis/gapic-generator-java/commit/4054bc668daf797a8fce798843e0ec4cda669faa)) +* Add ConfigServiceV2.CreateBucketAsync method for creating Log Buckets asynchronously ([7479758](https://github.com/googleapis/gapic-generator-java/commit/7479758bcc7c7631b01a2a06d149429852cc3900)) +* Add ConfigServiceV2.CreateLink method for creating linked datasets for Log Analytics Buckets ([7479758](https://github.com/googleapis/gapic-generator-java/commit/7479758bcc7c7631b01a2a06d149429852cc3900)) +* Add ConfigServiceV2.DeleteLink method for deleting linked datasets ([7479758](https://github.com/googleapis/gapic-generator-java/commit/7479758bcc7c7631b01a2a06d149429852cc3900)) +* Add ConfigServiceV2.GetLink methods for describing linked datasets ([7479758](https://github.com/googleapis/gapic-generator-java/commit/7479758bcc7c7631b01a2a06d149429852cc3900)) +* Add ConfigServiceV2.ListLinks method for listing linked datasets ([7479758](https://github.com/googleapis/gapic-generator-java/commit/7479758bcc7c7631b01a2a06d149429852cc3900)) +* Add ConfigServiceV2.UpdateBucketAsync method for creating Log Buckets asynchronously ([7479758](https://github.com/googleapis/gapic-generator-java/commit/7479758bcc7c7631b01a2a06d149429852cc3900)) +* Add LogBucket.analytics_enabled field that specifies whether Log Bucket's Analytics features are enabled ([7479758](https://github.com/googleapis/gapic-generator-java/commit/7479758bcc7c7631b01a2a06d149429852cc3900)) +* Add LogBucket.index_configs field that contains a list of Log Bucket's indexed fields and related configuration data ([7479758](https://github.com/googleapis/gapic-generator-java/commit/7479758bcc7c7631b01a2a06d149429852cc3900)) +* Remove directpath enable env ([#1657](https://github.com/googleapis/gapic-generator-java/issues/1657)) ([47851e8](https://github.com/googleapis/gapic-generator-java/commit/47851e877c868ddd6c3eb368591b4e6b635e21c1)) + + +### Bug Fixes + +* Unary Callables Deadline values respect the TotalTimeout in RetrySettings ([#1603](https://github.com/googleapis/gapic-generator-java/issues/1603)) ([d2fe520](https://github.com/googleapis/gapic-generator-java/commit/d2fe5203c4db1f8ddfd5a9566e6259b53441348a)) + + +### Dependencies + +* Update dependency org.graalvm.sdk:graal-sdk to v22.3.2 ([6107ff3](https://github.com/googleapis/gapic-generator-java/commit/6107ff316c544e4acb1d808a2ddaf9a805f9d7e7)) + + +### Documentation + +* [common-protos] mark ReservationResourceUsage field as deprecated ([7479758](https://github.com/googleapis/gapic-generator-java/commit/7479758bcc7c7631b01a2a06d149429852cc3900)) +* [common-protos] use deprecated=true for deprecated fields ([7479758](https://github.com/googleapis/gapic-generator-java/commit/7479758bcc7c7631b01a2a06d149429852cc3900)) +* Documentation for the Log Analytics features of the Cloud Logging API ([7479758](https://github.com/googleapis/gapic-generator-java/commit/7479758bcc7c7631b01a2a06d149429852cc3900)) +* Fix new_issue_uri comment ([7479758](https://github.com/googleapis/gapic-generator-java/commit/7479758bcc7c7631b01a2a06d149429852cc3900)) +* Separate paragraphs in linear/exponential distributions ([7479758](https://github.com/googleapis/gapic-generator-java/commit/7479758bcc7c7631b01a2a06d149429852cc3900)) + +## [2.18.0](https://github.com/googleapis/gapic-generator-java/compare/v2.17.0...v2.18.0) (2023-04-25) + + +### Features + +* **deps:** Add gapic-generator-java to bom ([#1645](https://github.com/googleapis/gapic-generator-java/issues/1645)) ([3e85c4b](https://github.com/googleapis/gapic-generator-java/commit/3e85c4b0e7c7e7fe1df14f2ace6130ac85039368)) + + +### Bug Fixes + +* Unescape Java keyword field names when generating HttpJson unit tests. ([#1654](https://github.com/googleapis/gapic-generator-java/issues/1654)) ([5fd79ea](https://github.com/googleapis/gapic-generator-java/commit/5fd79ea433d74d27d6115d91e2e0947e7b247b5d)) + +## [2.17.0](https://github.com/googleapis/gapic-generator-java/compare/v2.16.0...v2.17.0) (2023-04-11) + + +### Features + +* Add `FunctionalInterface` annotation ([#1515](https://github.com/googleapis/gapic-generator-java/issues/1515)) ([66c0509](https://github.com/googleapis/gapic-generator-java/commit/66c05093b5c56208c3f785e9cf0f5b50f5ad16d4)) +* Add stream method for `ServerStream` ([#1575](https://github.com/googleapis/gapic-generator-java/issues/1575)) ([e38c8ec](https://github.com/googleapis/gapic-generator-java/commit/e38c8ec4c2fca131c91e264c7b3e2cad9243a6e5)) +* Add stream methods for `Page` ([#1425](https://github.com/googleapis/gapic-generator-java/issues/1425)) ([cf0e01a](https://github.com/googleapis/gapic-generator-java/commit/cf0e01a47258c46a1b4431920b8d7cd24ae9b801)) + + +### Bug Fixes + +* Add javadoc for `ApiFutures` ([#1609](https://github.com/googleapis/gapic-generator-java/issues/1609)) ([4bb0a5e](https://github.com/googleapis/gapic-generator-java/commit/4bb0a5e3ce78878841e87a47cd457995ea9ed87e)) +* **deps:** Remove unnecessary auto-value in api-common-java ([#1621](https://github.com/googleapis/gapic-generator-java/issues/1621)) ([ffeb820](https://github.com/googleapis/gapic-generator-java/commit/ffeb820ab5a530ca0f8a91d873b07b4ebaea320b)) + + +### Dependencies + +* Update dependency cryptography to v39.0.2 ([#1592](https://github.com/googleapis/gapic-generator-java/issues/1592)) ([74cf36e](https://github.com/googleapis/gapic-generator-java/commit/74cf36e628a7f0d2e00c3bf1426be9b8089df8af)) +* Update dependency gcp-docuploader to v0.6.5 ([#1593](https://github.com/googleapis/gapic-generator-java/issues/1593)) ([501ee9c](https://github.com/googleapis/gapic-generator-java/commit/501ee9c61bd3f0091bf07d0e60c1dcd2319d1a17)) +* Update dependency google-cloud-core to v2.3.2 ([#1595](https://github.com/googleapis/gapic-generator-java/issues/1595)) ([335a104](https://github.com/googleapis/gapic-generator-java/commit/335a104d4846623a25497f5650ea553d5cca677a)) +* Update dependency net.bytebuddy:byte-buddy to v1.14.3 ([#1567](https://github.com/googleapis/gapic-generator-java/issues/1567)) ([a270ceb](https://github.com/googleapis/gapic-generator-java/commit/a270cebfeb8d1bb2270cef93f19c44935ed980cf)) +* Update dependency org.threeten:threetenbp to v1.6.8 ([#1590](https://github.com/googleapis/gapic-generator-java/issues/1590)) ([26d1c3e](https://github.com/googleapis/gapic-generator-java/commit/26d1c3e511c6fa3a353c3205c06fa8dad6019715)) +* Update dependency org.threeten:threetenbp to v1.6.8 ([#1591](https://github.com/googleapis/gapic-generator-java/issues/1591)) ([c3bed81](https://github.com/googleapis/gapic-generator-java/commit/c3bed81d540db51aaaa6e057133efa96b0f814a8)) +* Update dependency urllib3 to v1.26.15 ([#1596](https://github.com/googleapis/gapic-generator-java/issues/1596)) ([3288fb3](https://github.com/googleapis/gapic-generator-java/commit/3288fb323d957b182bf246540f9f17157afc5285)) +* Update google api dependencies ([#1578](https://github.com/googleapis/gapic-generator-java/issues/1578)) ([c537aba](https://github.com/googleapis/gapic-generator-java/commit/c537aba9d1c6cd4ecdcdc7ce0914a6c605c58b68)) + +## [2.16.0](https://github.com/googleapis/gapic-generator-java/compare/v2.15.3...v2.16.0) (2023-03-28) + + +### Features + +* [common-protos] add audit_context.proto Bazel targets ([#1493](https://github.com/googleapis/gapic-generator-java/issues/1493)) ([408dba8](https://github.com/googleapis/gapic-generator-java/commit/408dba8fcfa1cbc87acf9bf6fce29ae7e7af739e)) +* Install compatibility check ([#1508](https://github.com/googleapis/gapic-generator-java/issues/1508)) ([960067a](https://github.com/googleapis/gapic-generator-java/commit/960067ab60702b50e386cbc413aee2614eebf6d0)) + + +### Bug Fixes + +* **deps:** Update dependency com.google.api:gapic-generator-java-bom to v2.15.3 ([#9217](https://github.com/googleapis/gapic-generator-java/issues/9217)) ([4b6157c](https://github.com/googleapis/gapic-generator-java/commit/4b6157c482113ecec02959ad9b84242b116f3f43)) +* **deps:** Update dependency com.google.http-client:google-http-client-bom to v1.43.1 ([#9213](https://github.com/googleapis/gapic-generator-java/issues/9213)) ([5d1a0e5](https://github.com/googleapis/gapic-generator-java/commit/5d1a0e54f4681ef8ff55df1da517f9a3876c57bc)) +* Fix race condition in GrpcDirectStreamController ([#1537](https://github.com/googleapis/gapic-generator-java/issues/1537)) ([17d133b](https://github.com/googleapis/gapic-generator-java/commit/17d133bd625a9fe203019514aedf63e9fdad97f8)) +* Use UTF-8 as default charset for HttpJson requests ([#1477](https://github.com/googleapis/gapic-generator-java/issues/1477)) ([79d986b](https://github.com/googleapis/gapic-generator-java/commit/79d986bd35b49a819dc875cfec69ec8685517930)), closes [#1437](https://github.com/googleapis/gapic-generator-java/issues/1437) +* Validate paths and check additionalPathTemplates ([#1522](https://github.com/googleapis/gapic-generator-java/issues/1522)) ([5173014](https://github.com/googleapis/gapic-generator-java/commit/5173014b041001bf6c95209404f31db39347717d)) + + +### Dependencies + +* Update dependency com.google.cloud:google-iam-policy to v1.11.0 ([#1505](https://github.com/googleapis/gapic-generator-java/issues/1505)) ([56a1104](https://github.com/googleapis/gapic-generator-java/commit/56a11046f4349f97e3c272a92cd75acfb5c9e74c)) +* Update dependency org.threeten:threetenbp to v1.6.6 ([#1543](https://github.com/googleapis/gapic-generator-java/issues/1543)) ([4afc5d8](https://github.com/googleapis/gapic-generator-java/commit/4afc5d80b9a89f0b3241ce62a2348894afd34e1b)) +* Update dependency org.threeten:threetenbp to v1.6.6 ([#1544](https://github.com/googleapis/gapic-generator-java/issues/1544)) ([4591e5b](https://github.com/googleapis/gapic-generator-java/commit/4591e5bb8aa99acb1719422313ca3f53345a52dd)) +* Update dependency org.threeten:threetenbp to v1.6.7 ([#1550](https://github.com/googleapis/gapic-generator-java/issues/1550)) ([1df3dd2](https://github.com/googleapis/gapic-generator-java/commit/1df3dd255e4af0028f9010267a45e1cf82a85f31)) +* Update dependency org.threeten:threetenbp to v1.6.7 ([#1551](https://github.com/googleapis/gapic-generator-java/issues/1551)) ([b11395d](https://github.com/googleapis/gapic-generator-java/commit/b11395dd113555e91897ca78f4eaf7277c870892)) +* Update google api dependencies ([#1526](https://github.com/googleapis/gapic-generator-java/issues/1526)) ([750d4f5](https://github.com/googleapis/gapic-generator-java/commit/750d4f5e489ce517d9b9a09969038556c112ebeb)) +* Update netty dependencies to v4.1.90.final ([#1490](https://github.com/googleapis/gapic-generator-java/issues/1490)) ([894ba37](https://github.com/googleapis/gapic-generator-java/commit/894ba379201fe1fa8afe80ad58d17b69554b82d5)) + + +### Documentation + +* Update steps to generate a library locally ([#1539](https://github.com/googleapis/gapic-generator-java/issues/1539)) ([0ed1359](https://github.com/googleapis/gapic-generator-java/commit/0ed1359f7e07a6d231e562ef6cc9426319286bee)) + +## [2.15.3](https://github.com/googleapis/gapic-generator-java/compare/v2.15.2...v2.15.3) (2023-03-14) + + +### Bug Fixes + +* Allow custom HttpRules for REST LROs ([#1288](https://github.com/googleapis/gapic-generator-java/issues/1288)) ([f8ccd2a](https://github.com/googleapis/gapic-generator-java/commit/f8ccd2a1428f96f0ff3231247964c272144b8dc9)) + + +### Dependencies + +* Update actions/checkout action to v3 ([#1365](https://github.com/googleapis/gapic-generator-java/issues/1365)) ([84036c7](https://github.com/googleapis/gapic-generator-java/commit/84036c706620a6c7aef05aeaa5969e7dd0b4674b)) +* Update dependency com.google.api.grpc:grpc-google-common-protos to v2.14.2 ([#1451](https://github.com/googleapis/gapic-generator-java/issues/1451)) ([9566040](https://github.com/googleapis/gapic-generator-java/commit/95660400209c114a460a7d4170da4f093e6e3526)) +* Update dependency com.google.api.grpc:grpc-google-iam-v1 to v1.9.2 ([#1452](https://github.com/googleapis/gapic-generator-java/issues/1452)) ([b30359b](https://github.com/googleapis/gapic-generator-java/commit/b30359bd2a35c3f267b58748012d080bf3f1edf8)) +* Update dependency com.google.code.gson:gson to v2.10.1 ([#1443](https://github.com/googleapis/gapic-generator-java/issues/1443)) ([0ccf457](https://github.com/googleapis/gapic-generator-java/commit/0ccf457a774bd3dbe3b101d82222bdc39f6e5b0e)) +* Update dependency com.google.errorprone:error_prone_annotations to v2.18.0 ([#1459](https://github.com/googleapis/gapic-generator-java/issues/1459)) ([2671dcf](https://github.com/googleapis/gapic-generator-java/commit/2671dcf9131591acaa96d474412ce414fef54a6f)) +* Update dependency io.grpc:grpc-core to v1.53.0 ([#1463](https://github.com/googleapis/gapic-generator-java/issues/1463)) ([6762df6](https://github.com/googleapis/gapic-generator-java/commit/6762df6e121382545cc6da1375553f3de79acb2d)) +* Update dependency io.perfmark:perfmark-api to v0.26.0 ([#1465](https://github.com/googleapis/gapic-generator-java/issues/1465)) ([174f3d8](https://github.com/googleapis/gapic-generator-java/commit/174f3d82408e569028ba5c025b1bc9823e8cdb93)) +* Update dependency net.bytebuddy:byte-buddy to v1.14.1 ([#1467](https://github.com/googleapis/gapic-generator-java/issues/1467)) ([c0d851a](https://github.com/googleapis/gapic-generator-java/commit/c0d851a2afde63b07a620771177c6eb2cf29dc25)) +* Update dependency net.bytebuddy:byte-buddy to v1.14.2 ([#1481](https://github.com/googleapis/gapic-generator-java/issues/1481)) ([cbceed2](https://github.com/googleapis/gapic-generator-java/commit/cbceed21237a5dba62cc318ad0c1903a8d7768f3)) +* Update dependency org.apache.commons:commons-lang3 to v3.12.0 ([#1468](https://github.com/googleapis/gapic-generator-java/issues/1468)) ([2506b91](https://github.com/googleapis/gapic-generator-java/commit/2506b91196f8cbf7f7297af15e01529e7ee51270)) +* Update dependency org.graalvm.sdk:graal-sdk to v22.3.1 ([#1444](https://github.com/googleapis/gapic-generator-java/issues/1444)) ([edb5d12](https://github.com/googleapis/gapic-generator-java/commit/edb5d12689400d0a127b240fc68f12c00e7db0a8)) +* Update dependency org.threeten:threetenbp to v1.6.5 ([#1446](https://github.com/googleapis/gapic-generator-java/issues/1446)) ([842b9e3](https://github.com/googleapis/gapic-generator-java/commit/842b9e398caa6ea273d790c0bc577e7ec22cad39)) +* Update google api dependencies ([#1470](https://github.com/googleapis/gapic-generator-java/issues/1470)) ([e1667f1](https://github.com/googleapis/gapic-generator-java/commit/e1667f1a0eee9a3b9977eae6ee2ae27e06185ad9)) +* Update google auth library dependencies to v1.16.0 ([#1471](https://github.com/googleapis/gapic-generator-java/issues/1471)) ([de67f4e](https://github.com/googleapis/gapic-generator-java/commit/de67f4e2c772ecb1b4a8f7a3d58c5bce564cf788)) +* Update google http client dependencies to v1.43.0 ([#1472](https://github.com/googleapis/gapic-generator-java/issues/1472)) ([524eddb](https://github.com/googleapis/gapic-generator-java/commit/524eddb17488701d0217ee270cdba804b2f8d09b)) +* Update google http client dependencies to v1.43.1 ([#1487](https://github.com/googleapis/gapic-generator-java/issues/1487)) ([da52fdd](https://github.com/googleapis/gapic-generator-java/commit/da52fdd34c6c1c9d329ff6d1834eee2311ed80c6)) +* Update netty dependencies ([#1448](https://github.com/googleapis/gapic-generator-java/issues/1448)) ([97079ef](https://github.com/googleapis/gapic-generator-java/commit/97079ef6b0115d7ed14ffd6060d63b03c0cbd4fd)) + +## [2.15.2](https://github.com/googleapis/gapic-generator-java/compare/v2.15.1...v2.15.2) (2023-02-28) + + +### Bug Fixes + +* Change the default scope of gax from implementation to api in auto-generated gradle files for self-service client libraries. ([#1374](https://github.com/googleapis/gapic-generator-java/issues/1374)) ([eee7573](https://github.com/googleapis/gapic-generator-java/commit/eee757347a93f75e767870c90814322b29ed5275)) + + +### Dependencies + +* Update dependency com.google.http-client:google-http-client-bom to v1.43.0 ([#1377](https://github.com/googleapis/gapic-generator-java/issues/1377)) ([df3e35f](https://github.com/googleapis/gapic-generator-java/commit/df3e35f862724b4465a886f716afa8dd0b23d27f)) +* Update dependency gradle to v7.6.1 ([#1376](https://github.com/googleapis/gapic-generator-java/issues/1376)) ([5d61dcb](https://github.com/googleapis/gapic-generator-java/commit/5d61dcb1ef504ba0553c9ae33faab363b5650f4f)) + +## [2.15.1](https://github.com/googleapis/gapic-generator-java/compare/v2.15.0...v2.15.1) (2023-02-15) + + +### Bug Fixes + +* **batcher:** Exceptions in unaryCaller bubble up ([#1166](https://github.com/googleapis/gapic-generator-java/issues/1166)) ([bcf5ed8](https://github.com/googleapis/gapic-generator-java/commit/bcf5ed856d664f84fa033cee0cc27fb57b97b678)) +* **deps:** Update dependency com.google.auth:google-auth-library-bom to v1.16.0 ([#1355](https://github.com/googleapis/gapic-generator-java/issues/1355)) ([b7de1bc](https://github.com/googleapis/gapic-generator-java/commit/b7de1bc260a641e0c0ca717a33d61fbaa8a2fcf6)) +* **deps:** Update dependency io.grpc:grpc-bom to v1.53.0 ([#1345](https://github.com/googleapis/gapic-generator-java/issues/1345)) ([1e82422](https://github.com/googleapis/gapic-generator-java/commit/1e824223afa0b8a62e9e50ae38cc73e8036e6348)) +* Use pkg_tar from rules_pkg ([#1303](https://github.com/googleapis/gapic-generator-java/issues/1303)) ([fbae565](https://github.com/googleapis/gapic-generator-java/commit/fbae565291aee092acab3df86de858aea129b670)) + +## [2.15.0](https://github.com/googleapis/gapic-generator-java/compare/v2.14.0...v2.15.0) (2023-02-02) + + +### Features + +* Do not generate Service REST code if there are no matching RPC in a Service ([#1236](https://github.com/googleapis/gapic-generator-java/issues/1236)) ([9c06bc9](https://github.com/googleapis/gapic-generator-java/commit/9c06bc95b9aac869bf21c343cbb4b857aa25b593)) + + +### Bug Fixes + +* **ast:** Update import generation to cover annotation parameters ([#1229](https://github.com/googleapis/gapic-generator-java/issues/1229)) ([bdf12b0](https://github.com/googleapis/gapic-generator-java/commit/bdf12b0df91446abac8cb1bf2d361bb886eb91a2)) +* **deps:** Update dependency com.google.auth:google-auth-library-bom to v1.15.0 ([#1278](https://github.com/googleapis/gapic-generator-java/issues/1278)) ([f80861b](https://github.com/googleapis/gapic-generator-java/commit/f80861ba0518be2b9774b3235535f4bd3a27216a)) +* **java:** Initialize netty-shaded at run-time and add reflection configurations for netty classes ([#1290](https://github.com/googleapis/gapic-generator-java/issues/1290)) ([b7ca95f](https://github.com/googleapis/gapic-generator-java/commit/b7ca95f12dfe8287c133e09534be1fc46882ce6c)) +* Support mvn fmt:check and fmt:format ([#1266](https://github.com/googleapis/gapic-generator-java/issues/1266)) ([c96a2e7](https://github.com/googleapis/gapic-generator-java/commit/c96a2e7cf647cf245199c33ad989c8050208646e)) + +## [2.14.0](https://github.com/googleapis/gapic-generator-java/compare/v2.13.0...v2.14.0) (2023-01-19) + + +### Features + +* Add callable getters for non-eligible or non-enabled REST methods ([#1211](https://github.com/googleapis/gapic-generator-java/issues/1211)) ([84a1355](https://github.com/googleapis/gapic-generator-java/commit/84a1355a6db4754404196f153958359f9ba55437)) +* Add the google.rpc.context.AuditContext and google.rpc.http message to the open source ([#1248](https://github.com/googleapis/gapic-generator-java/issues/1248)) ([1538ad8](https://github.com/googleapis/gapic-generator-java/commit/1538ad8e88db7e03ed14337b83c0ddfae287538e)) +* Update JavaDoc to use [@return](https://github.com/return) ([#1233](https://github.com/googleapis/gapic-generator-java/issues/1233)) ([d13d3c3](https://github.com/googleapis/gapic-generator-java/commit/d13d3c381bb64e1833cbc443a12781084e89494b)) + + +### Bug Fixes + +* Add native image reflect-config.json to gax-grpc ([#1251](https://github.com/googleapis/gapic-generator-java/issues/1251)) ([ff2d118](https://github.com/googleapis/gapic-generator-java/commit/ff2d118341dfc95f34bcf114b005625d2fc930f6)) +* **deps:** Update dependency com.google.api:api-common to v2.4.0 ([#1228](https://github.com/googleapis/gapic-generator-java/issues/1228)) ([422315e](https://github.com/googleapis/gapic-generator-java/commit/422315ef0ee35740a2772eaa59cfc757ee499e28)) +* **deps:** Update dependency com.google.code.gson:gson to v2.10.1 ([#1219](https://github.com/googleapis/gapic-generator-java/issues/1219)) ([5a3aed2](https://github.com/googleapis/gapic-generator-java/commit/5a3aed2a8f9a89657d5a8ea858b668ff6ab92b96)) +* **deps:** Update dependency com.google.errorprone:error_prone_annotations to v2.18.0 ([#1231](https://github.com/googleapis/gapic-generator-java/issues/1231)) ([746cc9d](https://github.com/googleapis/gapic-generator-java/commit/746cc9d28809636afdecc85833a2122ec4fbeb76)) +* **deps:** Update dependency com.google.errorprone:error_prone_annotations to v2.18.0 ([#1232](https://github.com/googleapis/gapic-generator-java/issues/1232)) ([467ea48](https://github.com/googleapis/gapic-generator-java/commit/467ea485a32bcb3e9c0f69274edfd66a595e70d8)) +* **deps:** Update dependency io.grpc:grpc-bom to v1.52.1 ([#1240](https://github.com/googleapis/gapic-generator-java/issues/1240)) ([89e0fa2](https://github.com/googleapis/gapic-generator-java/commit/89e0fa2f4efdc48a5d6dbd59706beeae4793f3f3)) +* **deps:** Update dependency io.grpc:grpc-protobuf to v1.52.1 ([#1241](https://github.com/googleapis/gapic-generator-java/issues/1241)) ([f30d96c](https://github.com/googleapis/gapic-generator-java/commit/f30d96c9b9333c48e2d0067af1324bc9447f3580)) +* **deps:** Update dependency io.grpc:grpc-stub to v1.52.1 ([#1242](https://github.com/googleapis/gapic-generator-java/issues/1242)) ([44cef75](https://github.com/googleapis/gapic-generator-java/commit/44cef75afc94516632d1e7e04beffa2a2c7c56d0)) +* **deps:** Update dependency org.graalvm.sdk:graal-sdk to v22.3.1 ([#1252](https://github.com/googleapis/gapic-generator-java/issues/1252)) ([328f4e1](https://github.com/googleapis/gapic-generator-java/commit/328f4e1fb82fb3e413725f0b5a27e05fc45a800d)) +* Handle cancel in ReleasingClientCall and rethrow the exception in start ([#1221](https://github.com/googleapis/gapic-generator-java/issues/1221)) ([8a61249](https://github.com/googleapis/gapic-generator-java/commit/8a6124950ba51f79f0a42afd20f758e937002b35)) +* Rename gapic-parent-pom to groupId to google.cloud.api ([#1238](https://github.com/googleapis/gapic-generator-java/issues/1238)) ([7e6e750](https://github.com/googleapis/gapic-generator-java/commit/7e6e75062eacad157c92c7c9063dcb1899a9953d)) + +## [2.13.0](https://github.com/googleapis/gapic-generator-java/compare/v2.12.0...v2.13.0) (2023-01-06) + + +### Features + +* Parent pom and gapic-generator-java-bom ([#1170](https://github.com/googleapis/gapic-generator-java/issues/1170)) ([4dd5fcf](https://github.com/googleapis/gapic-generator-java/commit/4dd5fcf7b817c56bcfd90c3977bf003f212fbddf)) +* Use gapic-generator-java jar in the client library generation process ([#918](https://github.com/googleapis/gapic-generator-java/issues/918)) ([0051f49](https://github.com/googleapis/gapic-generator-java/commit/0051f4939727ca818509332d78ba8fbbe98ea2c8)) + + +### Bug Fixes + +* **deps:** Update dependency com.google.auth:google-auth-library-oauth2-http to v1.14.0 ([#1183](https://github.com/googleapis/gapic-generator-java/issues/1183)) ([45fd2cb](https://github.com/googleapis/gapic-generator-java/commit/45fd2cbf4713ef070b7a78133169668541a14e74)) +* **deps:** Update dependency com.google.auto.value:auto-value-annotations to v1.10.1 ([#1184](https://github.com/googleapis/gapic-generator-java/issues/1184)) ([e2e01a0](https://github.com/googleapis/gapic-generator-java/commit/e2e01a01b7b222f629ddb3b57fe2537a5d3906de)) +* **deps:** Update dependency com.google.cloud:google-iam-policy to v1.6.22 ([#1145](https://github.com/googleapis/gapic-generator-java/issues/1145)) ([83f3aec](https://github.com/googleapis/gapic-generator-java/commit/83f3aec3d920bca422b12f91f007081d49d0c4cb)) +* **deps:** Update dependency com.google.cloud:libraries-bom to v26.2.0 ([#1185](https://github.com/googleapis/gapic-generator-java/issues/1185)) ([83766f1](https://github.com/googleapis/gapic-generator-java/commit/83766f1c180b756e58bf8c147ea697fbe51a4d13)) +* **deps:** Update dependency com.google.errorprone:error_prone_annotations to v2.17.0 - abandoned ([#1205](https://github.com/googleapis/gapic-generator-java/issues/1205)) ([031fff6](https://github.com/googleapis/gapic-generator-java/commit/031fff6f99694b6035c134fe96b7bef1a6143111)) +* **deps:** Update dependency com.google.errorprone:error_prone_annotations to v2.17.0 ([#1202](https://github.com/googleapis/gapic-generator-java/issues/1202)) ([c9a35b9](https://github.com/googleapis/gapic-generator-java/commit/c9a35b9eb04e1db8b30a81547afb170947f630ec)) +* **deps:** Update dependency com.google.guava:guava to v31.1-jre ([#1146](https://github.com/googleapis/gapic-generator-java/issues/1146)) ([e70f7f6](https://github.com/googleapis/gapic-generator-java/commit/e70f7f6d6e13ab6ddb2a91d378ddd2b286e8902b)) +* **deps:** Update dependency com.google.protobuf:protobuf-bom to v3.21.12 ([#1116](https://github.com/googleapis/gapic-generator-java/issues/1116)) ([41a220c](https://github.com/googleapis/gapic-generator-java/commit/41a220c227195c159fd408b8df07df7f3e7332cd)) +* **deps:** Update dependency com.google.protobuf:protobuf-java to v3.21.12 ([#1155](https://github.com/googleapis/gapic-generator-java/issues/1155)) ([ddb7edf](https://github.com/googleapis/gapic-generator-java/commit/ddb7edfa261540927db240363d3ec5715db2b3db)) +* **deps:** Update dependency io.grpc:grpc-bom to v1.51.1 ([#1137](https://github.com/googleapis/gapic-generator-java/issues/1137)) ([582c796](https://github.com/googleapis/gapic-generator-java/commit/582c796ee9dacc3a127aef0821c40afd8eb537ef)) +* **deps:** Update dependency io.grpc:grpc-bom to v1.51.1 ([#1157](https://github.com/googleapis/gapic-generator-java/issues/1157)) ([7528b45](https://github.com/googleapis/gapic-generator-java/commit/7528b45fb2e8a5046c931dc28619ef17143810ed)) +* **deps:** Update dependency io.grpc:grpc-protobuf to v1.51.1 ([#1158](https://github.com/googleapis/gapic-generator-java/issues/1158)) ([14081a1](https://github.com/googleapis/gapic-generator-java/commit/14081a1048d030748abeb200b26e6ca9add7ba8e)) +* **deps:** Update dependency io.grpc:grpc-stub to v1.51.1 ([#1159](https://github.com/googleapis/gapic-generator-java/issues/1159)) ([8745b57](https://github.com/googleapis/gapic-generator-java/commit/8745b570a033563a44e0d8f9763c2a03e2fa77b2)) +* **deps:** Update dependency jacoco to v0.8.8 ([#1204](https://github.com/googleapis/gapic-generator-java/issues/1204)) ([8c5e17b](https://github.com/googleapis/gapic-generator-java/commit/8c5e17ba325b7711f9ba9501992ab48e736ffc18)) +* **deps:** Update dependency org.mockito:mockito-core to v4.10.0 ([#1186](https://github.com/googleapis/gapic-generator-java/issues/1186)) ([1d791fb](https://github.com/googleapis/gapic-generator-java/commit/1d791fb932052b9e72ec5aabd0cb2fde36ed7a55)) +* **deps:** Update dependency org.mockito:mockito-core to v4.11.0 ([#1200](https://github.com/googleapis/gapic-generator-java/issues/1200)) ([25c7b26](https://github.com/googleapis/gapic-generator-java/commit/25c7b266edf1d2e1332bab8fbfe28486cb237ed6)) +* **deps:** Update dependency org.threeten:threetenbp to v1.6.5 ([#1160](https://github.com/googleapis/gapic-generator-java/issues/1160)) ([53be6b7](https://github.com/googleapis/gapic-generator-java/commit/53be6b7cfd0928675518cf5ba4784ce57c973993)) +* Focus 'Running the Plugin' documentation on googleapis, not showcase ([#1196](https://github.com/googleapis/gapic-generator-java/issues/1196)) ([d58b2e5](https://github.com/googleapis/gapic-generator-java/commit/d58b2e53238d42477ac246eefe9166192618180a)) + + +### Documentation + +* Development with local gapic-generator-java ([#1132](https://github.com/googleapis/gapic-generator-java/issues/1132)) ([079d830](https://github.com/googleapis/gapic-generator-java/commit/079d830a234bb6923f3b71894f40fd0fc31649e6)) +* Development with local gapic-generator-java ([#1132](https://github.com/googleapis/gapic-generator-java/issues/1132)) ([cbb9dce](https://github.com/googleapis/gapic-generator-java/commit/cbb9dce85438942f7b4f1b163756e311f54d75ea)) + ## [2.12.0](https://github.com/googleapis/gapic-generator-java/compare/v2.11.0...v2.12.0) (2022-12-09) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 22b241cb73..f2b357f2ab 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,7 +1,11 @@ # 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. +We'd love to accept your patches and contributions to this project. There are just a few small guidelines you need to follow before opening an issue or a PR: +1. Ensure the issue was not already reported. +2. Open a new issue if you are unable to find an existing issue addressing your problem. Make sure to include a title and clear description, as much relevant information as possible, and a code sample or an executable test case demonstrating the expected behavior that is not occurring. +3. Discuss the priority and potential solutions with the maintainers in the issue. The maintainers would review the issue and add a label "Accepting Contributions" once the issue is ready for accepting contributions. +4. Open a PR only if the issue is labeled with "Accepting Contributions", ensure the PR description clearly describes the problem and solution. Note that an open PR without an issue labeled with "Accepting Contributions" will not be accepted. + ## Contributor License Agreement diff --git a/DEVELOPMENT.md b/DEVELOPMENT.md index 1e7a583cb2..9d7aa2b022 100644 --- a/DEVELOPMENT.md +++ b/DEVELOPMENT.md @@ -1,232 +1,66 @@ -# Development Workflow +# Development Setup + +You need Java 11 or higher to run the build. The build produces Java 8-compatible +bytecode. + +Install [`bazelisk`](https://github.com/bazelbuild/bazelisk) in your `PATH` +for gapic-generator-java's Bazel build. ## Set Up 1. Clone this repo. -2. Copy the Git pre-commit hooks. This will automatically check the build, run +2. (OPTIONAL) Copy the Git pre-commit hooks. This will automatically check the build, run tests, and perform linting before each commit. (Symlinks don't seem to work, but if you find a way, please add it here!) - ```sh - cp .githooks/pre-commit .git/hooks/pre-commit - ``` - -## Code Formatting - -- Run linter checks without actually doing the formatting. - - ```sh - bazel run //:google_java_format_verification - ``` - or - ```sh - mvn fmt:check - ``` - -- Format files. - - ```sh - bazel run //:google_java_format - ``` - or - ```sh - mvn fmt:format - ``` - -## Test Running - -- Run all unit and integration tests. - - ```sh - bazel test //... - ``` - -- Run all unit tests. - - ```sh - bazel test //:units - ``` - or - ```sh - mvn test - ``` - -- Run a single unit test like `JavaCodeGeneratorTest.java`: - - ```sh - bazel test //:unit_com_google_api_generator_engine_JavaCodeGeneratorTest - ``` - or - ```sh - mvn test -Dtest=JavaCodeGeneratorTest - - mvn test "-Dtest=Basic*, !%regex[.*.Unstable.*], !%regex[.*.MyTest.class#one.*|two.*], %regex[#fast.*|slow.*]" - ``` - - - -- Update all unit test golden files: - - ```sh - mvn test -DupdateUnitGoldens - ``` - -- Update a single unit test golden file, for example `JavaCodeGeneratorTest.java`: - - ```sh - bazel run //:update_com_google_api_generator_engine_JavaCodeGeneratorTest - ``` - or - ```sh - mvn test -DupdateUnitGoldens -Dtest=JavaCodeGeneratorTest - ``` - -- Run a single integration test for API like `Redis`, it generates Java source - code using the Java microgenerator and compares them with the goldens files - in `test/integration/goldens/redis`. - - ```sh - bazel test //test/integration:redis - ``` - -- Update integration test golden files, for example `Redis`. This clobbers all the - files in `test/integration/goldens/redis`. - - ```sh - bazel run //test/integration:update_redis - ``` + ```sh + cp .githooks/pre-commit .git/hooks/pre-commit + ``` -## Showcase Integration Testing +## Run Tests for All Modules -[GAPIC Showcase](https://github.com/googleapis/gapic-showcase) is an API that demonstrates Generated -API Client (GAPIC) features and common API patterns used by Google. It follows the [Cloud APIs -design guide](https://cloud.google.com/apis/design/). `gapic-generator-java` generates a client for -the Showcase API which can communicate with a local Showcase server to perform integration tests. - -### Requirements - -* Install [Go](https://go.dev) in your `PATH`. - -### Installing the Server - -Using the latest version of showcase is recommended, but backward compatibility between server -versions is not guaranteed. If changing the version of the server, it may also be necessary to -update to a compatible client version in `./WORKSPACE`. - -```shell -$ GAPIC_SHOWCASE_VERSION=0.25.0 -$ go install github.com/googleapis/gapic-showcase/cmd/gapic-showcase@v"$GAPIC_SHOWCASE_VERSION" -$ PATH=$PATH:`go env GOPATH`/bin -$ gapic-showcase --help -> Root command of gapic-showcase -> -> Usage: -> gapic-showcase [command] -> -> Available Commands: -> completion Emits bash a completion for gapic-showcase -> compliance This service is used to test that GAPICs... -> echo This service is used showcase the four main types... -> help Help about any command -> identity A simple identity service. -> messaging A simple messaging service that implements chat... -> run Runs the showcase server -> sequence Sub-command for Service: Sequence -> testing A service to facilitate running discrete sets of... -> -> Flags: -> -h, --help help for gapic-showcase -> -j, --json Print JSON output -> -v, --verbose Print verbose output -> --version version for gapic-showcase -``` +- Run all unit tests in all modules. -### Running the Server + ```sh + mvn install + ``` -Run the showcase server to allow requests to be sent to it. This opens port `:7469` to send and -receive requests. - -```shell -$ gapic-showcase run -> 2022/11/21 16:22:15 Showcase listening on port: :7469 -> 2022/11/21 16:22:15 Starting endpoint 0: gRPC endpoint -> 2022/11/21 16:22:15 Starting endpoint 1: HTTP/REST endpoint -> 2022/11/21 16:22:15 Starting endpoint multiplexer -> 2022/11/21 16:22:15 Listening for gRPC-fallback connections -> 2022/11/21 16:22:15 Listening for gRPC connections -> 2022/11/21 16:22:15 Listening for REST connections -> 2022/11/21 16:22:15 Fallback server listening on port: :1337 -``` - -### Running the Integration Tests +## Code Formatting -Open a new terminal window in the root project directory. +- Run linter checks without actually doing the formatting. -```shell -$ cd showcase -$ mvn verify -P enable-integration-tests -P enable-golden-tests -``` + ```sh + mvn fmt:check + ``` -Note: - -* `-P enable-golden-tests` is optional. These tests do not require a local server. +- Format files. -### Update the Golden Showcase Files - -Open a new terminal window in the root project directory. - -```shell -$ cd showcase -$ mvn compile -P update -``` + ```sh + mvn fmt:format + ``` -## Running the Plugin - -See also above section "Showcase Integration Testing". +## Testing guide +There are 4 layers of testing in this repo: +1. Traditional unit tests. These tests usually focus on testing one very specific test case at a time. For example, [MethodTest](https://github.com/googleapis/sdk-platform-java/blob/main/gapic-generator-java/src/test/java/com/google/api/generator/gapic/model/MethodTest.java) +2. Golden unit tests. These tests start with a test proto, we create different test cases in the proto, load the proto in unit tests and save the generated file as golden files. For example, [routing header proto](https://github.com/googleapis/sdk-platform-java/blob/main/gapic-generator-java/src/test/proto/explicit_dynamic_routing_header_testing.proto) -> Load in the [unit test](https://github.com/googleapis/sdk-platform-java/blob/main/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/GrpcServiceStubClassComposerTest.java#L56-L64) -> Saved as [golden](https://github.com/googleapis/sdk-platform-java/blob/main/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/GrpcRoutingHeadersStub.golden) +3. Showcase integration tests. They test the generated library's behavior against a mock server, see [README.md](https://github.com/googleapis/sdk-platform-java/blob/main/java-showcase/README.md) of showcase module for details. +4. Golden integration tests. These tests generate a full client library with real protos from googleapis, for example, golden integration tests for [compute](https://github.com/googleapis/sdk-platform-java/tree/main/test/integration/goldens/compute). However, we _should_ stop adding new ones, and rely on golden unit tests and showcase tests. -To generate a production GAPIC API: - -1. Clone [googleapis](https://github.com/googleapis/googleapis). +Based on where the code changes are, we should add different tests, in general -2. Point to local gapic-generator-java - - Normally, googleapis's build pulls in googleapis/gapic-generator-java from the - Internet: - - ``` - # Java microgenerator. - … - _gapic_generator_java_version = "2.1.0" - - http_archive( - name = "gapic_generator_java", - … - urls = ["https://github.com/googleapis/gapic-generator-java/archive/v%s.zip" % _gapic_generator_java_version], - ) - ``` - - By replacing this portion using the built-in local_repository rule, you can make - it refer to your local development repo: - - ``` - local_repository( - name = "gapic_generator_java", - path = "/home//gapic-generator-java", - ) - ``` - -3. Build the new target. - - You can generate any client library based on the protos within googleapis. - You just need the name of the service within the `java_gapic_assembly_gradle_pkg` - rules within the service's `BUILD.bazel` file. - For instance, to run your local generator on the `speech`'s v2 service, you can - run: +- If the changes are in `gax` or `api-common` only, you _must_ add traditional unit tests, you _may_ add showcase integration tests if you are modifying a public setting. +- If the changes are in `gapic-generator-java` only, showcase integration tests are most likely not needed + - If they are in the `composer` module, you _must_ add golden unit tests, you _may_ add traditional unit tests for better coverage and easier testing. + - If they are in the `parser` module, you _should_ add traditional unit tests with a test proto if possible, you _may_ add golden unit tests to easily see the changes. For example, [routing_rule_parser_testing](https://github.com/googleapis/sdk-platform-java/blob/main/gapic-generator-java/src/test/proto/routing_rule_parser_testing.proto) that is only used for testing [RoutingRuleParser](https://github.com/googleapis/sdk-platform-java/blob/main/gapic-generator-java/src/main/java/com/google/api/generator/gapic/protoparser/RoutingRuleParser.java). + - If they are in `other modules(ast, model, writer etc.)`, you _must_ add traditional unit tests, you _may_ add golden unit tests to easily see the changes. +- If the changes are in both `gax` and `gapic-generator-java`, you _must_ add all test layers, including traditional unit tests, golden unit tests and showcase integration tests. - ``` - bazel build //google/cloud/speech/v2:google-cloud-speech-v2-java - ``` +### How to run tests? +See the [Unit Tests](https://github.com/googleapis/sdk-platform-java/blob/main/gapic-generator-java/DEVELOPMENT.md#unit-tests) section in gapic-generator-java/DEVELOPMENT.md for how to run traditional and golden unit tests. +See [Running the Integration Tests](https://github.com/googleapis/sdk-platform-java/blob/main/java-showcase/README.md#running-the-integration-tests) and [Update the Golden Showcase Files](https://github.com/googleapis/sdk-platform-java/blob/main/java-showcase/README.md#update-the-golden-showcase-files) sections in java-showcase/README.md for how to run and update showcase integration tests. +See the [Integration Tests](https://github.com/googleapis/sdk-platform-java/blob/main/gapic-generator-java/DEVELOPMENT.md#integration-tests) section in gapic-generator-java/DEVELOPMENT.md for how to run golden integration tests. + diff --git a/GEMINI.md b/GEMINI.md new file mode 100644 index 0000000000..5f36cd8021 --- /dev/null +++ b/GEMINI.md @@ -0,0 +1,149 @@ +# Gemini CLI Context for sdk-platform-java + +## 1. Overview + +This repository, `sdk-platform-java`, is a monorepo containing the foundational components for building Java client libraries for Google Cloud Platform services. It includes the GAPIC (Generated API Client) generator for Java, the GAX (Google API Extensions) runtime library, and other shared modules. + +## 2. Project Structure + +The repository is structured into several key modules: + +* **`gapic-generator-java`**: The core component for creating new client libraries. It is a Protobuf compiler plugin that generates Java client libraries from API definition files. The `DEVELOPMENT.md` file in this module provides detailed information on how to work with the generator. + +* **`gax-java`**: The Google API Extensions for Java (GAX) library. It provides runtime support for the generated client libraries, including features like pagination, request batching, and polling of long-running operations. It has the following submodules: + * `gax`: Transport-independent part of GAX for Java. + * `gax-grpc`: gRPC-specific logic for GAX. + * `gax-httpjson`: REST-specific logic for GAX. + +* **`api-common-java`**: Contains foundational types and utilities related to Google APIs. It includes the following packages: + * `core`: Core library containing API stability annotations and wrappers around Guava types. + * `pathtemplate`: Path Template library for manipulating strings that are formatted as Google API resource names. + * `resourcenames`: Resource Name library used by generated resource name types. + +* **`java-common-protos`**: Provides Protobuf-generated classes for common Google services that are used across multiple APIs. The code is in this module is auto-generated and should not be modified. + +* **`java-iam`**: Contains Protobuf-generated classes for Google's Identity and Access Management (IAM) service, used for managing policies. The code is in this module is auto-generated and should not be modified. + +* **`java-showcase`**: A demonstration client library for the "Showcase" API, which is a fake API used for integration testing of the GAPIC generator and GAX library. + +* **`java-shared-dependencies`**: Manages shared Maven dependencies for all Google Cloud Java client libraries. This ensures consistency and helps avoid dependency conflicts. + +## 3. Getting Started + +### 3.1. Prerequisites + +To build and work with this project, you will need to install: + +* Java 8+ +* Maven + +### 3.2. Building the Project + +The project uses Maven for its primary build system. To build all modules, run the following command from the root of the repository: + +```sh +mvn install +``` + +### 3.3. Code Formatting + +Code formatting is enforced using the `fmt-maven-plugin`. To check for formatting issues, run: + +```sh +mvn fmt:check +``` + +To format the code, run: + +```sh +mvn fmt:format +``` + +## 4. Testing + +### 4.1. Testing Strategy + +The repository employs a multi-layered testing strategy to ensure the quality and correctness of the generated code: + +* **Unit Tests:** Traditional unit tests for individual classes and methods. See [unit testing best practices](https://engdoc.corp.google.com/eng/doc/devguide/testing/unit/best-practices.md?cl=head&polyglot=java). +* **Golden Unit Tests:** These tests generate code from test protos and compare the output to "golden" files, which are pre-approved versions of the generated code. These test cases exist inside the `gapic-generator-java` module. See [GrpcServiceStubClassComposerTest](https://github.com/googleapis/sdk-platform-java/blob/main/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/GrpcServiceStubClassComposerTest.java) for an example of golden unit tests. The steps for golden unit tests include creating a test proto, loading the test proto, generating from the test proto, and comparing the result with a golden file. +* **Showcase Integration Tests:** These tests run the generated Showcase client against a local Showcase server to verify end-to-end functionality. This is the preferred way of testing integration tests. +* **Golden Integration Tests:** These tests generate full client libraries for real Google Cloud APIs and compare them to golden versions. This is an older test strategy and showcase testing is preferred. + +Based on where the code changes are, we should add different tests, in general + +* If the changes are in `gax` or `api-common` only, you _must_ add traditional unit tests, you _may_ add showcase integration tests if you are modifying a public setting. +* If the changes are in `gapic-generator-java` only, showcase integration tests are most likely not needed + * If they are in the `composer` module, you _must_ add golden unit tests, you _may_ add traditional unit tests for better coverage and easier testing. + * If they are in the `parser` module, you _should_ add traditional unit tests with a test proto if possible, you _may_ add golden unit tests to easily see the changes. For example, [routing_rule_parser_testing](https://github.com/googleapis/sdk-platform-java/blob/main/gapic-generator-java/src/test/proto/routing_rule_parser_testing.proto) that is only used for testing [RoutingRuleParser](https://github.com/googleapis/sdk-platform-java/blob/main/gapic-generator-java/src/main/java/com/google/api/generator/gapic/protoparser/RoutingRuleParser.java). + * If they are in `other modules(ast, model, writer etc.)`, you _must_ add traditional unit tests, you _may_ add golden unit tests to easily see the changes. +- If the changes are in both `gax` and `gapic-generator-java`, you _must_ add all test layers, including traditional unit tests, golden unit tests and showcase integration tests. + +### 4.2. Running Unit Tests + +Unit tests can be tested via this command: + +```sh +mvn test +``` + +### 4.3. Running Golden Integration Tests + +Golden integration tests are run using Bazel. To run all golden integration tests, use the following command from the root of the repository: + +```sh +bazelisk test //... +``` + +Specific integration tests can be run by specifying the target, for example: + +```sh +bazelisk test //test/integration:redis +``` + +### 4.4. Updating Golden Files + +If you make changes that affect the generated code, you will need to update the golden files. This can be done using the following command: + +```sh +bazelisk run //test/integration:update_asset && bazelisk run //test/integration:update_credentials && bazelisk run //test/integration:update_iam && bazelisk run //test/integration:update_kms && bazelisk run //test/integration:update_pubsub && bazelisk run //test/integration:update_logging && bazelisk run //test/integration:update_redis && bazelisk run //test/integration:update_storage && bazelisk run //test/integration:update_library && bazelisk run //test/integration:update_compute && bazelisk run //test/integration:update_bigtable && bazelisk run //test/integration:update_apigeeconnect +``` + +### 4.5. Running Showcase Integration Tests + +Showcase integration tests are run against a local server that implements the Showcase API. The `java-showcase/README.md` file provides detailed instructions on how to run these tests. The general steps are: + +1. **Install the Showcase server:** + + ```sh + go install github.com/googleapis/gapic-showcase/cmd/gapic-showcase@latest + ``` + +2. **Run the Showcase server:** + + ```sh + gapic-showcase run + ``` + +3. **Run the integration tests:** + + ```sh + cd java-showcase + mvn verify -P enable-integration-tests + ``` + +## 5. Dependency Management + +- Try not to bump any external dependency version unless there is a known CVE (security or vulnerability issue) or a critical bug fix. +- Try to avoid introducing new external dependencies. If a new dependency is required, please state the reason. +- Prefer to use features from the Java standard library, then try to use features from any existing dependencies (preferably from Google managed dependencies). + +## 6. Contribution Guidelines + +- **Commits:** Commit messages should follow the [Conventional Commits](https://www.conventionalcommits.org/) + specification. The format is `: `. The type should be one of the following: fix, feat, + build, chore, docs, test, or refactor. +- **Issues:** All significant changes should start with a GitHub issue. +- **Pull Requests:** All code changes must be submitted via a pull request and require review. Before creating a PR, always pull latest from main, merge main to local branch and resolve any conflicts. +- **Testing:** All new logic should be accompanied by tests. +- For more details, see `CONTRIBUTING.md`. diff --git a/PROPERTIES.bzl b/PROPERTIES.bzl deleted file mode 100644 index 4d5e0f286e..0000000000 --- a/PROPERTIES.bzl +++ /dev/null @@ -1,31 +0,0 @@ -PROPERTIES = { - "version.com_google_protobuf": "3.21.7", - # Version of google-java-format is downgraded from 1.8 to 1.7, because 1.8 supports java 11 minimum, while our JRE is java 8. - "version.google_java_format": "1.7", - "version.io_grpc_java": "1.42.1", - - # Common deps. - "maven.com_google_guava_guava": "com.google.guava:guava:30.1-android", - "maven.com_google_code_findbugs_jsr305": "com.google.code.findbugs:jsr305:3.0.0", - "maven.com_google_auto_value_auto_value": "com.google.auto.value:auto-value:1.7.2", - "maven.com_google_auto_value_auto_value_annotations": "com.google.auto.value:auto-value-annotations:1.7.2", - "maven.com_google_code_gson": "com.google.code.gson:gson:2.8.6", - "maven.com_google_protobuf_protobuf_java": "com.google.protobuf:protobuf-java:3.21.7", - "maven.io_github_java_diff_utils": "io.github.java-diff-utils:java-diff-utils:4.11", - "maven.javax_annotation_javax_annotation_api": "javax.annotation:javax.annotation-api:1.3.2", - - # Gapic YAML parsing for batching settings. - "maven.org_yaml_snakeyaml": "org.yaml:snakeyaml:1.26", - - # ServiceStubSettings class. Used only in generated code. - "maven.org_threeten_threetenbp": "org.threeten:threetenbp:1.3.3", - - # Testing. - "maven.junit_junit": "junit:junit:4.13.1", - # This hamcrest-core dependency is for running JUnit test manually, before JUnit 4.11 it's wrapped along with JUnit package. - # But now it has to be explicitly added. - "maven.org_hamcrest_hamcrest_core": "org.hamcrest:hamcrest-core:1.3", - "maven.org_mockito_mockito_core": "org.mockito:mockito-core:2.21.0", - # Keep in sync with gax-java. - "maven.com_google_truth_truth": "com.google.truth:truth:1.1.2", -} diff --git a/README.md b/README.md index 21b323f741..e4b7b5a13a 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,27 @@ +**_THIS REPOSITORY IS DEPRECATED. ALL OF ITS CONTENT AND HISTORY HAS BEEN MOVED TO [GOOGLE-CLOUD-JAVA](https://github.com/googleapis/google-cloud-java/tree/main/sdk-platform-java)_** + [![Coverage](https://sonarcloud.io/api/project_badges/measure?project=googleapis_gapic-generator-java&metric=coverage)](https://sonarcloud.io/summary/new_code?id=googleapis_gapic-generator-java) -# API Client Generator for Java -Generates a Java client library from protocol buffers. -Replaces the Java parts of the -[older monolithic generator](https://github.com/googleapis/gapic-generator). +This repository has been renamed to `sdk-platfom-java`. +For developers, please update the repo's URL in repository clones (this is not actually strictly required because redirection works). +For more information, please refer to [rename a repository](https://docs.github.com/en/repositories/creating-and-managing-repositories/renaming-a-repository). + +This repository consists of the following modules: + +- **[gapic-generator-java](./gapic-generator-java/README.md)**: the Protobuf compiler plugin to generate Java code. + See [gapic-generator-java/DEVELOPMENT.md](./gapic-generator-java/DEVELOPMENT.md) for setup. +- **[gax-java](./gax-java/README.md)**: the runtime library required for Google Cloud client libraries, + including the ones generated by gapic-generator-java. +- **[java-common-protos](./java-common-protos/README.md)** and **[api-common-java](./api-common-java/README.md)**: Protobuf-generated common + classes for Google services. (They are not generated by gapic-generator-java) +- **[java-iam](./java-iam/README.md)**: Protobuf-generated classes for Google's + Identity and Access + Management (IAM). (They are not generated by gapic-generator-java) +- **[showcase](./showcase/README.md)**: demonstration of the generated client + library for the fake "Showcase" API. +- **[gapic-generator-java-bom](./gapic-generator-java-bom)**: The Bill-of-Material for the libraries + produced from this repository. This is used by [java-shared-dependencies](./java-shared-dependencies/first-party-dependencies/pom.xml). + +## Development Setup + +See [DEVELOPMENT.md](DEVELOPMENT.md). diff --git a/WORKSPACE b/WORKSPACE index de55cfc78c..201da0799a 100644 --- a/WORKSPACE +++ b/WORKSPACE @@ -1,44 +1,14 @@ workspace(name = "gapic_generator_java") load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") -load("@bazel_tools//tools/build_defs/repo:jvm.bzl", "jvm_maven_import_external") - -# DO NOT REMOVE. -# This is needed to clobber any transitively-pulled in versions of bazel_skylib so that packages -# like protobuf will build. -http_archive( - name = "bazel_skylib", - sha256 = "74d544d96f4a5bb630d465ca8bbcfe231e3594e5aae57e1edbf17a6eb3ca2506", - urls = [ - "https://mirror.bazel.build/github.com/bazelbuild/bazel-skylib/releases/download/1.3.0/bazel-skylib-1.3.0.tar.gz", - "https://github.com/bazelbuild/bazel-skylib/releases/download/1.3.0/bazel-skylib-1.3.0.tar.gz", - ], -) - -jvm_maven_import_external( - name = "google_java_format_all_deps", - artifact = "com.google.googlejavaformat:google-java-format:jar:all-deps:1.7", - licenses = [ - "notice", - "reciprocal", - ], - server_urls = [ - "https://repo.maven.apache.org/maven2/", - "http://repo1.maven.org/maven2/", - ], -) # gax-java and its transitive dependencies must be imported before # gapic-generator-java dependencies to match the order in googleapis repository, # which in its turn, prioritizes actual generated clients runtime dependencies # over the generator dependencies. - -_gax_java_version = "2.19.0" - -http_archive( - name = "com_google_api_gax_java", - strip_prefix = "gax-java-%s" % _gax_java_version, - urls = ["https://github.com/googleapis/gax-java/archive/v%s.zip" % _gax_java_version], +local_repository( + name = "com_google_api_gax_java", + path = "gax-java", ) load("@com_google_api_gax_java//:repository_rules.bzl", "com_google_api_gax_java_properties") @@ -52,7 +22,16 @@ load("@com_google_api_gax_java//:repositories.bzl", "com_google_api_gax_java_rep com_google_api_gax_java_repositories() -_googleapis_commit = "44d6bef0ca6db8bba3fb324c8186e694bcc4829c" +_googleapis_commit = "7438480b2a1bc6371d748e974f7a3647f90c4e8d" + +# This is required for local testing on macOS. There is known incompatibility between old zlib and the latest macOS (Sequoia 15.7.3 as of writing) +http_archive( + name = "zlib", + build_file = "@com_google_protobuf//:third_party/zlib.BUILD", + sha256 = "9a93b2b7dfdac77ceba5a558a580e74667dd6fede4585b91eefb60f03b72df23", + strip_prefix = "zlib-1.3.1", + urls = ["https://github.com/madler/zlib/releases/download/v1.3.1/zlib-1.3.1.tar.gz"], +) http_archive( name = "com_google_googleapis", @@ -62,14 +41,10 @@ http_archive( ], ) -load("//:repositories.bzl", "gapic_generator_java_repositories") - -gapic_generator_java_repositories() - # protobuf -RULES_JVM_EXTERNAL_TAG = "4.2" +RULES_JVM_EXTERNAL_TAG = "4.5" -RULES_JVM_EXTERNAL_SHA = "cd1a77b7b02e8e008439ca76fd34f5b07aecb8c752961f9640dea15e9e5ba1ca" +RULES_JVM_EXTERNAL_SHA = "b17d7388feb9bfa7f2fa09031b32707df529f26c91ab9e5d909eb1676badd9a6" http_archive( name = "rules_jvm_external", @@ -78,13 +53,30 @@ http_archive( url = "https://github.com/bazelbuild/rules_jvm_external/archive/%s.zip" % RULES_JVM_EXTERNAL_TAG, ) +load("@rules_jvm_external//:repositories.bzl", "rules_jvm_external_deps") + +rules_jvm_external_deps() + +load("@rules_jvm_external//:setup.bzl", "rules_jvm_external_setup") + +rules_jvm_external_setup() + load("@com_google_protobuf//:protobuf_deps.bzl", "PROTOBUF_MAVEN_ARTIFACTS", "protobuf_deps") load("@rules_jvm_external//:defs.bzl", "maven_install") +load("@io_grpc_grpc_java//:repositories.bzl", "IO_GRPC_GRPC_JAVA_ARTIFACTS") +load("@io_grpc_grpc_java//:repositories.bzl", "IO_GRPC_GRPC_JAVA_OVERRIDE_TARGETS") + +_gapic_generator_java_version = "2.68.1-SNAPSHOT" # {x-version-update:gapic-generator-java:current} + maven_install( - artifacts = PROTOBUF_MAVEN_ARTIFACTS, - generate_compat_repositories = True, + artifacts = [ + "com.google.api:gapic-generator-java:" + _gapic_generator_java_version, + ] + PROTOBUF_MAVEN_ARTIFACTS + IO_GRPC_GRPC_JAVA_ARTIFACTS, + fail_on_missing_checksum = False, + override_targets = IO_GRPC_GRPC_JAVA_OVERRIDE_TARGETS, repositories = [ + "m2Local", "https://repo.maven.apache.org/maven2/", ], ) @@ -114,6 +106,17 @@ load("@io_grpc_grpc_java//:repositories.bzl", "grpc_java_repositories") grpc_java_repositories() +# gRPC-Java uses jar_jar for bazel: https://github.com/grpc/grpc-java/pull/12243 +# The following lines are from jar_jar's README: https://github.com/bazeltools/bazel_jar_jar?tab=readme-ov-file#how-to-add-to-bazel-via-workspace +load("@bazel_tools//tools/build_defs/repo:git.bzl", "git_repository") +git_repository( + name = "bazel_jar_jar", + commit = "4e7bf26da8bc8c955578fd8c8a2c763757d344df", # Latest commit SHA as of 2023/10/31 + remote = "https://github.com/bazeltools/bazel_jar_jar.git", +) +load("@bazel_jar_jar//:jar_jar.bzl", "jar_jar_repositories") +jar_jar_repositories() + _disco_to_proto3_converter_commit = "ce8d8732120cdfb5bf4847c3238b5be8acde87e3" http_archive( @@ -122,17 +125,15 @@ http_archive( urls = ["https://github.com/googleapis/disco-to-proto3-converter/archive/%s.zip" % _disco_to_proto3_converter_commit], ) -# Showcase -_showcase_commit = "90d73532a0cab753a85f45c158394f24fc21d91a" - -_showcase_sha256 = "0f582541a379be0746e6b8bc5af3df511581d4b1f18f7dfb9ce203be1a64cef1" - http_archive( - name = "com_google_gapic_showcase", - sha256 = _showcase_sha256, - strip_prefix = "gapic-showcase-%s" % _showcase_commit, + name = "rules_pkg", + sha256 = "8a298e832762eda1830597d64fe7db58178aa84cd5926d76d5b744d6558941c2", urls = [ - # "https://github.com/googleapis/gapic-showcase/archive/refs/tags/v%s.zip" % _showcase_version, - "https://github.com/googleapis/gapic-showcase/archive/%s.zip" % _showcase_commit, + "https://mirror.bazel.build/github.com/bazelbuild/rules_pkg/releases/download/0.7.0/rules_pkg-0.7.0.tar.gz", + "https://github.com/bazelbuild/rules_pkg/releases/download/0.7.0/rules_pkg-0.7.0.tar.gz", ], ) + +load("@rules_pkg//:deps.bzl", "rules_pkg_dependencies") + +rules_pkg_dependencies() diff --git a/api-common-java/.github/CODEOWNERS b/api-common-java/.github/CODEOWNERS deleted file mode 100644 index 1bb9607cb2..0000000000 --- a/api-common-java/.github/CODEOWNERS +++ /dev/null @@ -1,10 +0,0 @@ -# Code owners file. -# This file controls who is tagged for review for any given pull request. - -# For syntax help see: -# https://help.github.com/en/github/creating-cloning-and-archiving-repositories/about-code-owners#codeowners-syntax - -* @googleapis/actools-java @googleapis/yoshi-java - -# The java-samples-reviewers team is the default owner for samples changes -samples/**/*.java @googleapis/java-samples-reviewers diff --git a/api-common-java/.github/ISSUE_TEMPLATE/bug_report.md b/api-common-java/.github/ISSUE_TEMPLATE/bug_report.md deleted file mode 100644 index 4924b71dd0..0000000000 --- a/api-common-java/.github/ISSUE_TEMPLATE/bug_report.md +++ /dev/null @@ -1,51 +0,0 @@ ---- -name: Bug report -about: Create a report to help us improve - ---- - -Thanks for stopping by to let us know something could be better! - -**PLEASE READ**: If you have a support contract with Google, please create an issue in the [support console](https://cloud.google.com/support/) instead of filing on GitHub. This will ensure a timely response. - -Please run down the following list and make sure you've tried the usual "quick fixes": - - - Search the issues already opened: https://github.com/googleapis/api-common-java/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. api-common-java 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/api-common-java/.github/ISSUE_TEMPLATE/feature_request.md b/api-common-java/.github/ISSUE_TEMPLATE/feature_request.md deleted file mode 100644 index 754e30c68a..0000000000 --- a/api-common-java/.github/ISSUE_TEMPLATE/feature_request.md +++ /dev/null @@ -1,21 +0,0 @@ ---- -name: Feature request -about: Suggest an idea for this library - ---- - -Thanks for stopping by to let us know something could be better! - -**PLEASE READ**: If you have a support contract with Google, please create an issue in the [support console](https://cloud.google.com/support/) instead of filing on GitHub. This will ensure a timely response. - -**Is your feature request related to a problem? Please describe.** -What the problem is. Example: I'm always frustrated when [...] - -**Describe the solution you'd like** -What you want to happen. - -**Describe alternatives you've considered** -Any alternative solutions or features you've considered. - -**Additional context** -Any other context or screenshots about the feature request. diff --git a/api-common-java/.github/PULL_REQUEST_TEMPLATE.md b/api-common-java/.github/PULL_REQUEST_TEMPLATE.md deleted file mode 100644 index dfc3053312..0000000000 --- a/api-common-java/.github/PULL_REQUEST_TEMPLATE.md +++ /dev/null @@ -1,7 +0,0 @@ -Thank you for opening a Pull Request! Before submitting your PR, there are a few things you can do to make sure it goes smoothly: -- [ ] Make sure to open an issue as a [bug/issue](https://github.com/googleapis/api-common-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 # ☕️ diff --git a/api-common-java/.github/generated-files-bot.yml b/api-common-java/.github/generated-files-bot.yml deleted file mode 100644 index 47c2ba132e..0000000000 --- a/api-common-java/.github/generated-files-bot.yml +++ /dev/null @@ -1,11 +0,0 @@ -externalManifests: -- type: json - file: 'synth.metadata' - jsonpath: '$.generatedFiles[*]' -- type: json - file: '.github/readme/synth.metadata/synth.metadata' - jsonpath: '$.generatedFiles[*]' -ignoreAuthors: -- 'renovate-bot' -- 'yoshi-automation' -- 'release-please[bot]' diff --git a/api-common-java/.github/release-please.yml b/api-common-java/.github/release-please.yml deleted file mode 100644 index 8b034773a4..0000000000 --- a/api-common-java/.github/release-please.yml +++ /dev/null @@ -1,24 +0,0 @@ -releaseType: java-yoshi -bumpMinorPreMajor: true -handleGHRelease: true -branches: - - releaseType: java-lts - bumpMinorPreMajor: true - branch: 1.10.1-sp - handleGHRelease: true - - bumpMinorPreMajor: true - handleGHRelease: true - releaseType: java-yoshi - branch: java7 - - releaseType: java-backport - bumpMinorPreMajor: true - handleGHRelease: true - branch: 2.0.x - - releaseType: java-backport - bumpMinorPreMajor: true - handleGHRelease: true - branch: 2.1.x - - releaseType: java-backport - bumpMinorPreMajor: true - handleGHRelease: true - branch: 2.2.x diff --git a/api-common-java/.github/release-trigger.yml b/api-common-java/.github/release-trigger.yml deleted file mode 100644 index 7fe3622578..0000000000 --- a/api-common-java/.github/release-trigger.yml +++ /dev/null @@ -1 +0,0 @@ -enabled: true \ No newline at end of file diff --git a/api-common-java/.github/sync-repo-settings.yaml b/api-common-java/.github/sync-repo-settings.yaml deleted file mode 100644 index a1587888ce..0000000000 --- a/api-common-java/.github/sync-repo-settings.yaml +++ /dev/null @@ -1,79 +0,0 @@ -rebaseMergeAllowed: true -squashMergeAllowed: true -mergeCommitAllowed: false -branchProtectionRules: - - pattern: main - isAdminEnforced: true - requiredStatusCheckContexts: - - units (8) - - units (11) - - units (17) - - lint - - cla/google - requiredApprovingReviewCount: 1 - requiresCodeOwnerReviews: true - requiresStrictStatusChecks: true - - pattern: 1.10.1-sp - isAdminEnforced: true - requiredStatusCheckContexts: - - units (8) - - units (11) - - units (17) - - lint - - cla/google - requiredApprovingReviewCount: 1 - requiresCodeOwnerReviews: true - requiresStrictStatusChecks: true - - pattern: java7 - isAdminEnforced: true - requiredStatusCheckContexts: - - units (8) - - units (11) - - units (17) - - lint - - cla/google - requiredApprovingReviewCount: 1 - requiresCodeOwnerReviews: true - requiresStrictStatusChecks: true - - pattern: 2.0.x - isAdminEnforced: true - requiredStatusCheckContexts: - - units (8) - - units (11) - - units (17) - - lint - - cla/google - requiredApprovingReviewCount: 1 - requiresCodeOwnerReviews: true - requiresStrictStatusChecks: true - - pattern: 2.1.x - isAdminEnforced: true - requiredStatusCheckContexts: - - units (8) - - units (11) - - units (17) - - lint - - cla/google - requiredApprovingReviewCount: 1 - requiresCodeOwnerReviews: true - requiresStrictStatusChecks: true - - pattern: 2.2.x - isAdminEnforced: true - requiredStatusCheckContexts: - - units (8) - - units (11) - - units (17) - - lint - - cla/google - requiredApprovingReviewCount: 1 - requiresCodeOwnerReviews: true - requiresStrictStatusChecks: true -permissionRules: - - team: Googlers - permission: pull - - team: yoshi-java - permission: push - - team: yoshi-java-admins - permission: admin - - team: yoshi-admins - permission: admin diff --git a/api-common-java/.github/trusted-contribution.yml b/api-common-java/.github/trusted-contribution.yml deleted file mode 100644 index f247d5c789..0000000000 --- a/api-common-java/.github/trusted-contribution.yml +++ /dev/null @@ -1,2 +0,0 @@ -trustedContributors: -- renovate-bot \ No newline at end of file diff --git a/api-common-java/.github/workflows/ci.yaml b/api-common-java/.github/workflows/ci.yaml deleted file mode 100644 index 663e62aaff..0000000000 --- a/api-common-java/.github/workflows/ci.yaml +++ /dev/null @@ -1,96 +0,0 @@ -on: - push: - branches: - - main - pull_request: -name: ci -jobs: - clirr: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - uses: actions/setup-java@v3 - with: - distribution: temurin - java-version: 8 - - run: echo "JAVA8_HOME=${JAVA_HOME}" >> $GITHUB_ENV - - uses: actions/setup-java@v3 - with: - distribution: temurin - java-version: 11 - - run: echo "JAVA11_HOME=${JAVA_HOME}" >> $GITHUB_ENV - - run: .kokoro/build.sh - env: - JOB_TYPE: clirr - units-8: - name: units (8) - runs-on: ubuntu-latest - steps: - - name: Get current week within the year - id: date - run: echo "::set-output name=week_of_year::$(date +'%W' --utc)" - - uses: actions/checkout@v3 - - uses: actions/setup-java@v3 - with: - java-version: 8 - distribution: temurin - - run: echo "JAVA8_HOME=${JAVA_HOME}" >> $GITHUB_ENV - - uses: actions/setup-java@v3 - with: - java-version: 11 - distribution: temurin - - run: echo "JAVA11_HOME=${JAVA_HOME}" >> $GITHUB_ENV - - uses: actions/cache@v3 - id: mvn-cache - with: - path: ~/.m2/repository - key: ${{ runner.os }}-maven-unified-${{ steps.date.outputs.week_of_year }} - - run: .kokoro/build.sh - env: - JOB_TYPE: test - JOB_NAME: units-8 - units: - runs-on: ubuntu-latest - strategy: - fail-fast: false - matrix: - java: [ 11, 17 ] - steps: - - name: Get current week within the year - id: date - run: echo "::set-output name=week_of_year::$(date +'%W' --utc)" - - uses: actions/checkout@v3 - - uses: actions/setup-java@v3 - with: - distribution: temurin - java-version: ${{matrix.java}} - - run: java -version - - uses: actions/cache@v3 - id: mvn-cache - with: - path: ~/.m2/repository - key: ${{ runner.os }}-maven-unified-${{ steps.date.outputs.week_of_year }} - - run: .kokoro/build.sh - env: - JOB_TYPE: test - JOB_NAME: units-${{matrix.java}} - lint: - runs-on: ubuntu-latest - steps: - - name: Get current week within the year - id: date - run: echo "::set-output name=week_of_year::$(date +'%W' --utc)" - - uses: actions/checkout@v3 - - uses: actions/setup-java@v3 - with: - distribution: temurin - java-version: 11 - - run: java -version - - uses: actions/cache@v3 - id: mvn-cache - with: - path: ~/.m2/repository - key: ${{ runner.os }}-maven-unified-${{ steps.date.outputs.week_of_year }} - - run: java -version - - run: mvn -B -ntp com.coveo:fmt-maven-plugin:check - - run: mvn -B -ntp checkstyle:check@checkstyle diff --git a/api-common-java/.github/workflows/downstream.yaml b/api-common-java/.github/workflows/downstream.yaml deleted file mode 100644 index 250194a16b..0000000000 --- a/api-common-java/.github/workflows/downstream.yaml +++ /dev/null @@ -1,144 +0,0 @@ -on: - pull_request: - types: [ labeled ] - branches: - - main -name: downstream -jobs: - dependencies: - if: ${{ github.event.label.name == 'downstream-check:run' }} - runs-on: ubuntu-latest - strategy: - fail-fast: false - matrix: - java: [8] - repo: - # This list needs to be updated manually until an automated solution is in place. - - accessapproval - - accesscontextmanager - - aiplatform - - analytics-admin - - analytics-data - - api-gateway - - apigee-connect - - appengine-admin - - area120-tables - - artifact-registry - - asset - - assured-workloads - - automl - - bigquery - - bigqueryconnection - - bigquerydatatransfer - - bigquerymigration - - bigqueryreservation - - bigtable - - billing - - billingbudgets - - binary-authorization - - channel - - cloudbuild - - compute - - contact-center-insights - - container - - containeranalysis - - data-fusion - - datacatalog - - dataflow - - datalabeling - - dataproc - - dataproc-metastore - - datastore - - datastream - - debugger-client - - deploy - - dialogflow - - dialogflow-cx - - dlp - - dms - - dns - - document-ai - - domains - - errorreporting - - essential-contacts - - eventarc - - filestore - - firestore - - functions - - game-servers - - gke-connect-gateway - - gkehub - - gsuite-addons - - iam-admin - - iamcredentials - - iot - - kms - - language - - life-sciences - - logging - - logging-logback - - managed-identities - - mediatranslation - - memcache - - monitoring - - monitoring-dashboards - - network-management - - network-security - - networkconnectivity - - notebooks - - orchestration-airflow - - orgpolicy - - os-config - - os-login - - phishingprotection - - policy-troubleshooter - - private-catalog - - profiler - - pubsublite - - recaptchaenterprise - - recommendations-ai - - recommender - - redis - - resource-settings - - resourcemanager - - retail - - scheduler - - secretmanager - - security-private-ca - - securitycenter - - securitycenter-settings - - service-control - - service-management - - service-usage - - servicedirectory - - shell - - spanner - - spanner-jdbc - - speech - - storage - - storage-nio - - storage-transfer - - talent - - tasks - - texttospeech - - tpu - - trace - - translate - - video-intelligence - - video-transcoder - - vision - - vpcaccess - - webrisk - - websecurityscanner - - workflow-executions - - workflows - steps: - - uses: actions/checkout@v2 - - uses: actions/setup-java@v3 - with: - distribution: temurin - java-version: ${{matrix.java}} - - run: java -version - - run: sudo apt-get update -y - - run: sudo apt-get install libxml2-utils - - run: .kokoro/downstream-client-library-check.sh api-common ${{matrix.repo}} diff --git a/api-common-java/.kokoro/build.sh b/api-common-java/.kokoro/build.sh deleted file mode 100755 index 38ab4128a1..0000000000 --- a/api-common-java/.kokoro/build.sh +++ /dev/null @@ -1,69 +0,0 @@ -#!/bin/bash -# Copyright 2019 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -set -eo pipefail - -## Get the directory of the build script -scriptDir=$(realpath $(dirname "${BASH_SOURCE[0]}")) -## cd to the parent directory, i.e. the root of the git repo -cd ${scriptDir}/.. - -# include common functions -source ${scriptDir}/common.sh - -function setJava() { - export JAVA_HOME=$1 - export PATH=${JAVA_HOME}/bin:$PATH -} - -# This project requires compiling the classes in JDK 11 or higher for GraalVM -# classes. Compiling this project with Java 8 or earlier would fail with "class -# file has wrong version 55.0, should be 53.0" and "unrecognized --release 8 -# option" (set in build.gradle). -if [ ! -z "${JAVA11_HOME}" ]; then - setJava "${JAVA11_HOME}" -fi - -echo "Compiling using Java:" -java -version -mvn clean install -B -ntp -DskipTests - -# We ensure the generated class files are compatible with Java 8 -if [ ! -z "${JAVA8_HOME}" ]; then - setJava "${JAVA8_HOME}" -fi - -RETURN_CODE=0 - -case ${JOB_TYPE} in - test) - retry_with_backoff 3 10 \ - mvn -B -ntp \ - -Dclirr.skip=true \ - -Denforcer.skip=true \ - -Dcheckstyle.skip=true \ - -Dmaven.wagon.http.retryHandler.count=5 \ - test - RETURN_CODE=$? - ;; - clirr) - mvn -B -ntp clirr:check - RETURN_CODE=$? - ;; - *) ;; -esac - -echo "exiting with ${RETURN_CODE}" -exit ${RETURN_CODE} diff --git a/api-common-java/.kokoro/coerce_logs.sh b/api-common-java/.kokoro/coerce_logs.sh deleted file mode 100755 index 7b153733df..0000000000 --- a/api-common-java/.kokoro/coerce_logs.sh +++ /dev/null @@ -1,42 +0,0 @@ -#!/bin/bash -# Copyright 2019 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# This script finds and moves sponge logs so that they can be found by placer -# and are not flagged as flaky by sponge. - -set -eo pipefail - -## Get the directory of the build script -scriptDir=$(realpath $(dirname "${BASH_SOURCE[0]}")) -## cd to the parent directory, i.e. the root of the git repo -cd ${scriptDir}/.. - -if [ -z "${KOKORO_JOB_NAME}" ]; then - job="${JOB_NAME}" -else - job=$(basename ${KOKORO_JOB_NAME}) -fi - -echo "coercing sponge logs..." -for xml in `find . -name *-sponge_log.xml` -do - echo "processing ${xml}" - class=$(basename ${xml} | cut -d- -f2) - dir=$(dirname ${xml})/${job}/${class} - text=$(dirname ${xml})/${class}-sponge_log.txt - mkdir -p ${dir} - mv ${xml} ${dir}/sponge_log.xml - mv ${text} ${dir}/sponge_log.txt -done diff --git a/api-common-java/.kokoro/common.cfg b/api-common-java/.kokoro/common.cfg deleted file mode 100644 index 083db40dd8..0000000000 --- a/api-common-java/.kokoro/common.cfg +++ /dev/null @@ -1,13 +0,0 @@ -# Format: //devtools/kokoro/config/proto/build.proto - -# Download trampoline resources. These will be in ${KOKORO_GFILE_DIR} -gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/trampoline" - -# All builds use the trampoline script to run in docker. -build_file: "api-common-java/.kokoro/trampoline.sh" - -# Tell the trampoline which build file to use. -env_vars: { - key: "TRAMPOLINE_BUILD_FILE" - value: "github/api-common-java/.kokoro/build.sh" -} diff --git a/api-common-java/.kokoro/common.sh b/api-common-java/.kokoro/common.sh deleted file mode 100644 index ace89f45a9..0000000000 --- a/api-common-java/.kokoro/common.sh +++ /dev/null @@ -1,58 +0,0 @@ -#!/bin/bash -# Copyright 2020 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -function retry_with_backoff { - attempts_left=$1 - sleep_seconds=$2 - shift 2 - command=$@ - - - # store current flag state - flags=$- - - # allow a failures to continue - set +e - ${command} - exit_code=$? - - # restore "e" flag - if [[ ${flags} =~ e ]] - then set -e - else set +e - fi - - if [[ $exit_code == 0 ]] - then - return 0 - fi - - # failure - if [[ ${attempts_left} > 0 ]] - then - echo "failure (${exit_code}), sleeping ${sleep_seconds}..." - sleep ${sleep_seconds} - new_attempts=$((${attempts_left} - 1)) - new_sleep=$((${sleep_seconds} * 2)) - retry_with_backoff ${new_attempts} ${new_sleep} ${command} - fi - - return $exit_code -} - -## Helper functionss -function now() { date +"%Y-%m-%d %H:%M:%S" | tr -d '\n'; } -function msg() { println "$*" >&2; } -function println() { printf '%s\n' "$(now) $*"; } \ No newline at end of file diff --git a/api-common-java/.kokoro/downstream-client-library-check.sh b/api-common-java/.kokoro/downstream-client-library-check.sh deleted file mode 100755 index b3751f6303..0000000000 --- a/api-common-java/.kokoro/downstream-client-library-check.sh +++ /dev/null @@ -1,92 +0,0 @@ -#!/bin/bash -# Copyright 2020 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Presubmit to ensure the dependencies of the Google Libraries BOM, with the modification of change -# in the PR, pick up the highest versions among transitive dependencies. -# https://maven.apache.org/enforcer/enforcer-rules/requireUpperBoundDeps.html -set -eo pipefail -# Display commands being run. -set -x - -CORE_LIBRARY_ARTIFACT=$1 -CLIENT_LIBRARY=$2 -## 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}"/.. - -CORE_VERSION=$( ./gradlew -q properties | grep '^version: ' | cut -d' ' -f2 ) -echo "$CORE_VERSION" - -# Publish api-common to local maven to make it available for downstream libraries -./gradlew publishToMavenLocal - -# Round 1 -# Check this java core library against HEAD of java-shared dependencies - -git clone "https://github.com/googleapis/java-shared-dependencies.git" --depth=1 -pushd java-shared-dependencies/first-party-dependencies - -# replace version -xmllint --shell pom.xml << EOF -setns x=http://maven.apache.org/POM/4.0.0 -cd .//x:artifactId[text()="${CORE_LIBRARY_ARTIFACT}"] -cd ../x:version -set ${CORE_VERSION} -save pom.xml -EOF - -cd .. -mvn verify install -B -V -ntp -fae \ --DskipTests=true \ --Dmaven.javadoc.skip=true \ --Dgcloud.download.skip=true \ --Denforcer.skip=true - -SHARED_DEPS_VERSION_POM=pom.xml -# Namespace (xmlns) prevents xmllint from specifying tag names in XPath -SHARED_DEPS_VERSION=$(sed -e 's/xmlns=".*"//' ${SHARED_DEPS_VERSION_POM} | xmllint --xpath '/project/version/text()' -) - -if [ -z "${SHARED_DEPS_VERSION}" ]; then - echo "Version is not found in ${SHARED_DEPS_VERSION_POM}" - exit 1 -fi - -# Round 2 -# Check this BOM against java client libraries -git clone "https://github.com/googleapis/java-${CLIENT_LIBRARY}.git" --depth=1 -pushd java-"${CLIENT_LIBRARY}" - -if [[ $CLIENT_LIBRARY == "bigtable" ]]; then - pushd google-cloud-bigtable-deps-bom -fi - -# replace version -xmllint --shell pom.xml << EOF -setns x=http://maven.apache.org/POM/4.0.0 -cd .//x:artifactId[text()="google-cloud-shared-dependencies"] -cd ../x:version -set ${SHARED_DEPS_VERSION} -save pom.xml -EOF - -if [[ $CLIENT_LIBRARY == "bigtable" ]]; then - popd -fi - -mvn verify install -B -V -ntp -fae \ --Dmaven.javadoc.skip=true \ --Dgcloud.download.skip=true \ --Denforcer.skip=true diff --git a/api-common-java/.kokoro/populate-secrets.sh b/api-common-java/.kokoro/populate-secrets.sh deleted file mode 100755 index f52514257e..0000000000 --- a/api-common-java/.kokoro/populate-secrets.sh +++ /dev/null @@ -1,43 +0,0 @@ -#!/bin/bash -# Copyright 2020 Google LLC. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -set -eo pipefail - -function now { date +"%Y-%m-%d %H:%M:%S" | tr -d '\n' ;} -function msg { println "$*" >&2 ;} -function println { printf '%s\n' "$(now) $*" ;} - - -# Populates requested secrets set in SECRET_MANAGER_KEYS from service account: -# kokoro-trampoline@cloud-devrel-kokoro-resources.iam.gserviceaccount.com -SECRET_LOCATION="${KOKORO_GFILE_DIR}/secret_manager" -msg "Creating folder on disk for secrets: ${SECRET_LOCATION}" -mkdir -p ${SECRET_LOCATION} -for key in $(echo ${SECRET_MANAGER_KEYS} | sed "s/,/ /g") -do - msg "Retrieving secret ${key}" - docker run --entrypoint=gcloud \ - --volume=${KOKORO_GFILE_DIR}:${KOKORO_GFILE_DIR} \ - gcr.io/google.com/cloudsdktool/cloud-sdk \ - secrets versions access latest \ - --project cloud-devrel-kokoro-resources \ - --secret ${key} > \ - "${SECRET_LOCATION}/${key}" - if [[ $? == 0 ]]; then - msg "Secret written to ${SECRET_LOCATION}/${key}" - else - msg "Error retrieving secret ${key}" - fi -done diff --git a/api-common-java/.kokoro/release/common.cfg b/api-common-java/.kokoro/release/common.cfg deleted file mode 100644 index 3845a6665f..0000000000 --- a/api-common-java/.kokoro/release/common.cfg +++ /dev/null @@ -1,49 +0,0 @@ -# Format: //devtools/kokoro/config/proto/build.proto - -# Download trampoline resources. -gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/trampoline" - -# Use the trampoline script to run in docker. -build_file: "api-common-java/.kokoro/trampoline.sh" - -# Configure the docker image for kokoro-trampoline. -env_vars: { - key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-kokoro-resources/java11" -} - -before_action { - fetch_keystore { - keystore_resource { - keystore_config_id: 70247 - keyname: "maven-gpg-keyring" - } - } -} - -before_action { - fetch_keystore { - keystore_resource { - keystore_config_id: 70247 - keyname: "maven-gpg-passphrase" - } - } -} - -before_action { - fetch_keystore { - keystore_resource { - keystore_config_id: 70247 - keyname: "maven-gpg-pubkeyring" - } - } -} - -before_action { - fetch_keystore { - keystore_resource { - keystore_config_id: 70247 - keyname: "sonatype-credentials" - } - } -} diff --git a/api-common-java/.kokoro/release/common.sh b/api-common-java/.kokoro/release/common.sh deleted file mode 100755 index e96a6f9689..0000000000 --- a/api-common-java/.kokoro/release/common.sh +++ /dev/null @@ -1,52 +0,0 @@ -#!/bin/bash -# Copyright 2019 Google Inc. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -set -eo pipefail - -# Get secrets from keystore and set and environment variables -setup_environment_secrets() { - export GPG_PASSPHRASE=$(cat ${KOKORO_KEYSTORE_DIR}/70247_maven-gpg-passphrase) - export GPG_TTY=$(tty) - export GPG_HOMEDIR=/gpg - mkdir $GPG_HOMEDIR - mv ${KOKORO_KEYSTORE_DIR}/70247_maven-gpg-pubkeyring $GPG_HOMEDIR/pubring.gpg - mv ${KOKORO_KEYSTORE_DIR}/70247_maven-gpg-keyring $GPG_HOMEDIR/secring.gpg - export GPG_KEY_ID=$(echo -n $(gpg --with-colons ${GPG_HOMEDIR}/pubring.gpg | awk -F':' '/pub/{ print $5 }')) - export SONATYPE_USERNAME=$(cat ${KOKORO_KEYSTORE_DIR}/70247_sonatype-credentials | cut -f1 -d'|') - export SONATYPE_PASSWORD=$(cat ${KOKORO_KEYSTORE_DIR}/70247_sonatype-credentials | cut -f2 -d'|') -} - -create_settings_xml_file() { - echo " - - - - ossrh - ${SONATYPE_USERNAME} - ${SONATYPE_PASSWORD} - - - sonatype-nexus-staging - ${SONATYPE_USERNAME} - ${SONATYPE_PASSWORD} - - - sonatype-nexus-snapshots - ${SONATYPE_USERNAME} - ${SONATYPE_PASSWORD} - - -" > $1 -} diff --git a/api-common-java/.kokoro/release/publish_javadoc11.cfg b/api-common-java/.kokoro/release/publish_javadoc11.cfg deleted file mode 100644 index 2d99e24481..0000000000 --- a/api-common-java/.kokoro/release/publish_javadoc11.cfg +++ /dev/null @@ -1,30 +0,0 @@ -# Format: //devtools/kokoro/config/proto/build.proto - -# cloud-rad production -env_vars: { - key: "STAGING_BUCKET_V2" - value: "docs-staging-v2" -} - -# Configure the docker image for kokoro-trampoline -env_vars: { - key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-kokoro-resources/java11" -} - -env_vars: { - key: "TRAMPOLINE_BUILD_FILE" - value: "github/api-common-java/.kokoro/release/publish_javadoc11.sh" -} - -before_action { - fetch_keystore { - keystore_resource { - keystore_config_id: 73713 - keyname: "docuploader_service_account" - } - } -} - -# Downloads docfx doclet resource. This will be in ${KOKORO_GFILE_DIR}/ -gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/docfx" diff --git a/api-common-java/.kokoro/release/publish_javadoc11.sh b/api-common-java/.kokoro/release/publish_javadoc11.sh deleted file mode 100755 index 73b61d2542..0000000000 --- a/api-common-java/.kokoro/release/publish_javadoc11.sh +++ /dev/null @@ -1,66 +0,0 @@ -#!/bin/bash -# Copyright 2019 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -set -eo pipefail - -if [[ -z "${CREDENTIALS}" ]]; then - CREDENTIALS=${KOKORO_KEYSTORE_DIR}/73713_docuploader_service_account -fi - -if [[ -z "${STAGING_BUCKET_V2}" ]]; then - echo "Need to set STAGING_BUCKET environment variable" - exit 1 -fi - -# work from the git root directory -pushd $(dirname "$0")/../../ - -# install docuploader package -python3 -m pip install --require-hashes -r .kokoro/requirements.txt - -NAME=api-common -VERSION=$(grep ${NAME}: versions.txt | cut -d: -f3) - -# build the docs -mvn -B -ntp \ - -P docFX \ - -Dclirr.skip=true \ - -Denforcer.skip=true \ - -Dcheckstyle.skip=true \ - -Dflatten.skip=true \ - -Danimal.sniffer.skip=true \ - javadoc:aggregate - -# copy README to docfx-yml dir and rename index.md -cp README.md target/docfx-yml/index.md - -# copy CHANGELOG to docfx-yml dir and rename history.md -cp CHANGELOG.md target/docfx-yml/history.md - -pushd target/docfx-yml/ - -# create metadata -python3 -m docuploader create-metadata \ - --name ${NAME} \ - --version ${VERSION} \ - --language java - -# upload docs -python3 -m docuploader upload . \ - --credentials ${CREDENTIALS} \ - --staging-bucket ${STAGING_BUCKET_V2} \ - --destination-prefix docfx - -popd \ No newline at end of file diff --git a/api-common-java/.kokoro/release/stage.cfg b/api-common-java/.kokoro/release/stage.cfg deleted file mode 100644 index d42938cc52..0000000000 --- a/api-common-java/.kokoro/release/stage.cfg +++ /dev/null @@ -1,19 +0,0 @@ -# Format: //devtools/kokoro/config/proto/build.proto - -env_vars: { - key: "TRAMPOLINE_BUILD_FILE" - value: "github/api-common-java/.kokoro/release/stage.sh" -} - -# Need to save the properties file -action { - define_artifacts { - regex: "github/api-common-java/target/nexus-staging/staging/*.properties" - strip_prefix: "github/api-common-java" - } -} - -env_vars: { - key: "SECRET_MANAGER_KEYS" - value: "releasetool-publish-reporter-app,releasetool-publish-reporter-googleapis-installation,releasetool-publish-reporter-pem" -} diff --git a/api-common-java/.kokoro/release/stage.sh b/api-common-java/.kokoro/release/stage.sh deleted file mode 100755 index ba1cf7e20a..0000000000 --- a/api-common-java/.kokoro/release/stage.sh +++ /dev/null @@ -1,50 +0,0 @@ -#!/bin/bash -# Copyright 2019 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -set -eo pipefail - -if [[ -n "${AUTORELEASE_PR}" ]] -then - # Start the releasetool reporter - python3 -m pip install gcp-releasetool - python3 -m releasetool publish-reporter-script > /tmp/publisher-script; source /tmp/publisher-script -fi - -source $(dirname "$0")/common.sh -MAVEN_SETTINGS_FILE=$(realpath $(dirname "$0")/../../)/settings.xml -pushd $(dirname "$0")/../../ - -setup_environment_secrets -create_settings_xml_file "settings.xml" - -mvn clean deploy -B \ - -DskipTests=true \ - -Dclirr.skip=true \ - --settings ${MAVEN_SETTINGS_FILE} \ - -Dgpg.executable=gpg \ - -Dgpg.passphrase=${GPG_PASSPHRASE} \ - -Dgpg.homedir=${GPG_HOMEDIR} \ - -P release - -# The job triggered by Release Please (release-trigger) has this AUTORELEASE_PR -# environment variable. Fusion also lets us to specify this variable. -if [[ -n "${AUTORELEASE_PR}" ]] -then - mvn nexus-staging:release -B \ - -DperformRelease=true \ - --settings=${MAVEN_SETTINGS_FILE} -else - echo "AUTORELEASE_PR is not set. Not releasing." -fi \ No newline at end of file diff --git a/api-common-java/.kokoro/requirements.in b/api-common-java/.kokoro/requirements.in deleted file mode 100644 index 924f94ae6f..0000000000 --- a/api-common-java/.kokoro/requirements.in +++ /dev/null @@ -1,34 +0,0 @@ -gcp-docuploader==0.6.3 -google-crc32c==1.3.0 -googleapis-common-protos==1.56.3 -gcp-releasetool==1.9.1 -cryptography==38.0.3 -cachetools==4.2.4 -cffi==1.15.1 -jeepney==0.7.1 -jinja2==3.0.3 -markupsafe==2.0.1 -keyring==23.4.1 -packaging==21.3 -protobuf==3.19.5 -pyjwt==2.4.0 -pyparsing==3.0.9 -pycparser==2.21 -pyperclip==1.8.2 -python-dateutil==2.8.2 -requests==2.27.1 -certifi==2022.9.24 -importlib-metadata==4.8.3 -zipp==3.6.0 -google_api_core==2.8.2 -google-cloud-storage==2.0.0 -google-resumable-media==2.3.3 -google-cloud-core==2.3.1 -typing-extensions==4.1.1 -urllib3==1.26.12 -zipp==3.6.0 -rsa==4.9 -six==1.16.0 -attrs==22.1.0 -google-auth==2.14.1 -idna==3.4 \ No newline at end of file diff --git a/api-common-java/.kokoro/requirements.txt b/api-common-java/.kokoro/requirements.txt deleted file mode 100644 index 1271b9224f..0000000000 --- a/api-common-java/.kokoro/requirements.txt +++ /dev/null @@ -1,455 +0,0 @@ -# -# This file is autogenerated by pip-compile with python 3.10 -# To update, run: -# -# pip-compile --generate-hashes requirements.in -# -attrs==22.1.0 \ - --hash=sha256:29adc2665447e5191d0e7c568fde78b21f9672d344281d0c6e1ab085429b22b6 \ - --hash=sha256:86efa402f67bf2df34f51a335487cf46b1ec130d02b8d39fd248abfd30da551c - # via - # -r requirements.in - # gcp-releasetool -cachetools==4.2.4 \ - --hash=sha256:89ea6f1b638d5a73a4f9226be57ac5e4f399d22770b92355f92dcb0f7f001693 \ - --hash=sha256:92971d3cb7d2a97efff7c7bb1657f21a8f5fb309a37530537c71b1774189f2d1 - # via - # -r requirements.in - # google-auth -certifi==2022.9.24 \ - --hash=sha256:0d9c601124e5a6ba9712dbc60d9c53c21e34f5f641fe83002317394311bdce14 \ - --hash=sha256:90c1a32f1d68f940488354e36370f6cca89f0f106db09518524c88d6ed83f382 - # via - # -r requirements.in - # requests -cffi==1.15.1 \ - --hash=sha256:00a9ed42e88df81ffae7a8ab6d9356b371399b91dbdf0c3cb1e84c03a13aceb5 \ - --hash=sha256:03425bdae262c76aad70202debd780501fabeaca237cdfddc008987c0e0f59ef \ - --hash=sha256:04ed324bda3cda42b9b695d51bb7d54b680b9719cfab04227cdd1e04e5de3104 \ - --hash=sha256:0e2642fe3142e4cc4af0799748233ad6da94c62a8bec3a6648bf8ee68b1c7426 \ - --hash=sha256:173379135477dc8cac4bc58f45db08ab45d228b3363adb7af79436135d028405 \ - --hash=sha256:198caafb44239b60e252492445da556afafc7d1e3ab7a1fb3f0584ef6d742375 \ - --hash=sha256:1e74c6b51a9ed6589199c787bf5f9875612ca4a8a0785fb2d4a84429badaf22a \ - --hash=sha256:2012c72d854c2d03e45d06ae57f40d78e5770d252f195b93f581acf3ba44496e \ - --hash=sha256:21157295583fe8943475029ed5abdcf71eb3911894724e360acff1d61c1d54bc \ - --hash=sha256:2470043b93ff09bf8fb1d46d1cb756ce6132c54826661a32d4e4d132e1977adf \ - --hash=sha256:285d29981935eb726a4399badae8f0ffdff4f5050eaa6d0cfc3f64b857b77185 \ - --hash=sha256:30d78fbc8ebf9c92c9b7823ee18eb92f2e6ef79b45ac84db507f52fbe3ec4497 \ - --hash=sha256:320dab6e7cb2eacdf0e658569d2575c4dad258c0fcc794f46215e1e39f90f2c3 \ - --hash=sha256:33ab79603146aace82c2427da5ca6e58f2b3f2fb5da893ceac0c42218a40be35 \ - --hash=sha256:3548db281cd7d2561c9ad9984681c95f7b0e38881201e157833a2342c30d5e8c \ - --hash=sha256:3799aecf2e17cf585d977b780ce79ff0dc9b78d799fc694221ce814c2c19db83 \ - --hash=sha256:39d39875251ca8f612b6f33e6b1195af86d1b3e60086068be9cc053aa4376e21 \ - --hash=sha256:3b926aa83d1edb5aa5b427b4053dc420ec295a08e40911296b9eb1b6170f6cca \ - --hash=sha256:3bcde07039e586f91b45c88f8583ea7cf7a0770df3a1649627bf598332cb6984 \ - --hash=sha256:3d08afd128ddaa624a48cf2b859afef385b720bb4b43df214f85616922e6a5ac \ - --hash=sha256:3eb6971dcff08619f8d91607cfc726518b6fa2a9eba42856be181c6d0d9515fd \ - --hash=sha256:40f4774f5a9d4f5e344f31a32b5096977b5d48560c5592e2f3d2c4374bd543ee \ - --hash=sha256:4289fc34b2f5316fbb762d75362931e351941fa95fa18789191b33fc4cf9504a \ - --hash=sha256:470c103ae716238bbe698d67ad020e1db9d9dba34fa5a899b5e21577e6d52ed2 \ - --hash=sha256:4f2c9f67e9821cad2e5f480bc8d83b8742896f1242dba247911072d4fa94c192 \ - --hash=sha256:50a74364d85fd319352182ef59c5c790484a336f6db772c1a9231f1c3ed0cbd7 \ - --hash=sha256:54a2db7b78338edd780e7ef7f9f6c442500fb0d41a5a4ea24fff1c929d5af585 \ - --hash=sha256:5635bd9cb9731e6d4a1132a498dd34f764034a8ce60cef4f5319c0541159392f \ - --hash=sha256:59c0b02d0a6c384d453fece7566d1c7e6b7bae4fc5874ef2ef46d56776d61c9e \ - --hash=sha256:5d598b938678ebf3c67377cdd45e09d431369c3b1a5b331058c338e201f12b27 \ - --hash=sha256:5df2768244d19ab7f60546d0c7c63ce1581f7af8b5de3eb3004b9b6fc8a9f84b \ - --hash=sha256:5ef34d190326c3b1f822a5b7a45f6c4535e2f47ed06fec77d3d799c450b2651e \ - --hash=sha256:6975a3fac6bc83c4a65c9f9fcab9e47019a11d3d2cf7f3c0d03431bf145a941e \ - --hash=sha256:6c9a799e985904922a4d207a94eae35c78ebae90e128f0c4e521ce339396be9d \ - --hash=sha256:70df4e3b545a17496c9b3f41f5115e69a4f2e77e94e1d2a8e1070bc0c38c8a3c \ - --hash=sha256:7473e861101c9e72452f9bf8acb984947aa1661a7704553a9f6e4baa5ba64415 \ - --hash=sha256:8102eaf27e1e448db915d08afa8b41d6c7ca7a04b7d73af6514df10a3e74bd82 \ - --hash=sha256:87c450779d0914f2861b8526e035c5e6da0a3199d8f1add1a665e1cbc6fc6d02 \ - --hash=sha256:8b7ee99e510d7b66cdb6c593f21c043c248537a32e0bedf02e01e9553a172314 \ - --hash=sha256:91fc98adde3d7881af9b59ed0294046f3806221863722ba7d8d120c575314325 \ - --hash=sha256:94411f22c3985acaec6f83c6df553f2dbe17b698cc7f8ae751ff2237d96b9e3c \ - --hash=sha256:98d85c6a2bef81588d9227dde12db8a7f47f639f4a17c9ae08e773aa9c697bf3 \ - --hash=sha256:9ad5db27f9cabae298d151c85cf2bad1d359a1b9c686a275df03385758e2f914 \ - --hash=sha256:a0b71b1b8fbf2b96e41c4d990244165e2c9be83d54962a9a1d118fd8657d2045 \ - --hash=sha256:a0f100c8912c114ff53e1202d0078b425bee3649ae34d7b070e9697f93c5d52d \ - --hash=sha256:a591fe9e525846e4d154205572a029f653ada1a78b93697f3b5a8f1f2bc055b9 \ - --hash=sha256:a5c84c68147988265e60416b57fc83425a78058853509c1b0629c180094904a5 \ - --hash=sha256:a66d3508133af6e8548451b25058d5812812ec3798c886bf38ed24a98216fab2 \ - --hash=sha256:a8c4917bd7ad33e8eb21e9a5bbba979b49d9a97acb3a803092cbc1133e20343c \ - --hash=sha256:b3bbeb01c2b273cca1e1e0c5df57f12dce9a4dd331b4fa1635b8bec26350bde3 \ - --hash=sha256:cba9d6b9a7d64d4bd46167096fc9d2f835e25d7e4c121fb2ddfc6528fb0413b2 \ - --hash=sha256:cc4d65aeeaa04136a12677d3dd0b1c0c94dc43abac5860ab33cceb42b801c1e8 \ - --hash=sha256:ce4bcc037df4fc5e3d184794f27bdaab018943698f4ca31630bc7f84a7b69c6d \ - --hash=sha256:cec7d9412a9102bdc577382c3929b337320c4c4c4849f2c5cdd14d7368c5562d \ - --hash=sha256:d400bfb9a37b1351253cb402671cea7e89bdecc294e8016a707f6d1d8ac934f9 \ - --hash=sha256:d61f4695e6c866a23a21acab0509af1cdfd2c013cf256bbf5b6b5e2695827162 \ - --hash=sha256:db0fbb9c62743ce59a9ff687eb5f4afbe77e5e8403d6697f7446e5f609976f76 \ - --hash=sha256:dd86c085fae2efd48ac91dd7ccffcfc0571387fe1193d33b6394db7ef31fe2a4 \ - --hash=sha256:e00b098126fd45523dd056d2efba6c5a63b71ffe9f2bbe1a4fe1716e1d0c331e \ - --hash=sha256:e229a521186c75c8ad9490854fd8bbdd9a0c9aa3a524326b55be83b54d4e0ad9 \ - --hash=sha256:e263d77ee3dd201c3a142934a086a4450861778baaeeb45db4591ef65550b0a6 \ - --hash=sha256:ed9cb427ba5504c1dc15ede7d516b84757c3e3d7868ccc85121d9310d27eed0b \ - --hash=sha256:fa6693661a4c91757f4412306191b6dc88c1703f780c8234035eac011922bc01 \ - --hash=sha256:fcd131dd944808b5bdb38e6f5b53013c5aa4f334c5cad0c72742f6eba4b73db0 - # via - # -r requirements.in - # cryptography -charset-normalizer==2.0.12 \ - --hash=sha256:2857e29ff0d34db842cd7ca3230549d1a697f96ee6d3fb071cfa6c7393832597 \ - --hash=sha256:6881edbebdb17b39b4eaaa821b438bf6eddffb4468cf344f09f89def34a8b1df - # via requests -click==8.0.4 \ - --hash=sha256:6a7a62563bbfabfda3a38f3023a1db4a35978c0abd76f6c9605ecd6554d6d9b1 \ - --hash=sha256:8458d7b1287c5fb128c90e23381cf99dcde74beaf6c7ff6384ce84d6fe090adb - # via - # gcp-docuploader - # gcp-releasetool -colorlog==6.7.0 \ - --hash=sha256:0d33ca236784a1ba3ff9c532d4964126d8a2c44f1f0cb1d2b0728196f512f662 \ - --hash=sha256:bd94bd21c1e13fac7bd3153f4bc3a7dc0eb0974b8bc2fdf1a989e474f6e582e5 - # via gcp-docuploader -cryptography==38.0.3 \ - --hash=sha256:068147f32fa662c81aebab95c74679b401b12b57494872886eb5c1139250ec5d \ - --hash=sha256:06fc3cc7b6f6cca87bd56ec80a580c88f1da5306f505876a71c8cfa7050257dd \ - --hash=sha256:25c1d1f19729fb09d42e06b4bf9895212292cb27bb50229f5aa64d039ab29146 \ - --hash=sha256:402852a0aea73833d982cabb6d0c3bb582c15483d29fb7085ef2c42bfa7e38d7 \ - --hash=sha256:4e269dcd9b102c5a3d72be3c45d8ce20377b8076a43cbed6f660a1afe365e436 \ - --hash=sha256:5419a127426084933076132d317911e3c6eb77568a1ce23c3ac1e12d111e61e0 \ - --hash=sha256:554bec92ee7d1e9d10ded2f7e92a5d70c1f74ba9524947c0ba0c850c7b011828 \ - --hash=sha256:5e89468fbd2fcd733b5899333bc54d0d06c80e04cd23d8c6f3e0542358c6060b \ - --hash=sha256:65535bc550b70bd6271984d9863a37741352b4aad6fb1b3344a54e6950249b55 \ - --hash=sha256:6ab9516b85bebe7aa83f309bacc5f44a61eeb90d0b4ec125d2d003ce41932d36 \ - --hash=sha256:6addc3b6d593cd980989261dc1cce38263c76954d758c3c94de51f1e010c9a50 \ - --hash=sha256:728f2694fa743a996d7784a6194da430f197d5c58e2f4e278612b359f455e4a2 \ - --hash=sha256:785e4056b5a8b28f05a533fab69febf5004458e20dad7e2e13a3120d8ecec75a \ - --hash=sha256:78cf5eefac2b52c10398a42765bfa981ce2372cbc0457e6bf9658f41ec3c41d8 \ - --hash=sha256:7f836217000342d448e1c9a342e9163149e45d5b5eca76a30e84503a5a96cab0 \ - --hash=sha256:8d41a46251bf0634e21fac50ffd643216ccecfaf3701a063257fe0b2be1b6548 \ - --hash=sha256:984fe150f350a3c91e84de405fe49e688aa6092b3525f407a18b9646f6612320 \ - --hash=sha256:9b24bcff7853ed18a63cfb0c2b008936a9554af24af2fb146e16d8e1aed75748 \ - --hash=sha256:b1b35d9d3a65542ed2e9d90115dfd16bbc027b3f07ee3304fc83580f26e43249 \ - --hash=sha256:b1b52c9e5f8aa2b802d48bd693190341fae201ea51c7a167d69fc48b60e8a959 \ - --hash=sha256:bbf203f1a814007ce24bd4d51362991d5cb90ba0c177a9c08825f2cc304d871f \ - --hash=sha256:be243c7e2bfcf6cc4cb350c0d5cdf15ca6383bbcb2a8ef51d3c9411a9d4386f0 \ - --hash=sha256:bfbe6ee19615b07a98b1d2287d6a6073f734735b49ee45b11324d85efc4d5cbd \ - --hash=sha256:c46837ea467ed1efea562bbeb543994c2d1f6e800785bd5a2c98bc096f5cb220 \ - --hash=sha256:dfb4f4dd568de1b6af9f4cda334adf7d72cf5bc052516e1b2608b683375dd95c \ - --hash=sha256:ed7b00096790213e09eb11c97cc6e2b757f15f3d2f85833cd2d3ec3fe37c1722 - # via - # -r requirements.in - # gcp-releasetool - # secretstorage -gcp-docuploader==0.6.3 \ - --hash=sha256:ba8c9d76b3bbac54b0311c503a373b00edc2dc02d6d54ea9507045adb8e870f7 \ - --hash=sha256:c0f5aaa82ce1854a386197e4e359b120ad6d4e57ae2c812fce42219a3288026b - # via -r requirements.in -gcp-releasetool==1.9.1 \ - --hash=sha256:952f4055d5d986b070ae2a71c4410b250000f9cc5a1e26398fcd55a5bbc5a15f \ - --hash=sha256:d0d3c814a97c1a237517e837d8cfa668ced8df4b882452578ecef4a4e79c583b - # via -r requirements.in -google-api-core==2.8.2 \ - --hash=sha256:06f7244c640322b508b125903bb5701bebabce8832f85aba9335ec00b3d02edc \ - --hash=sha256:93c6a91ccac79079ac6bbf8b74ee75db970cc899278b97d53bc012f35908cf50 - # via - # -r requirements.in - # google-cloud-core - # google-cloud-storage -google-auth==2.14.1 \ - --hash=sha256:f5d8701633bebc12e0deea4df8abd8aff31c28b355360597f7f2ee60f2e4d016 - # via - # -r requirements.in - # gcp-releasetool - # google-api-core - # google-cloud-core - # google-cloud-storage -google-cloud-core==2.3.1 \ - --hash=sha256:113ba4f492467d5bd442c8d724c1a25ad7384045c3178369038840ecdd19346c \ - --hash=sha256:34334359cb04187bdc80ddcf613e462dfd7a3aabbc3fe4d118517ab4b9303d53 - # via - # -r requirements.in - # google-cloud-storage -google-cloud-storage==2.0.0 \ - --hash=sha256:a57a15aead0f9dfbd4381f1bfdbe8bf89818a4bd75bab846cafcefb2db846c47 \ - --hash=sha256:ec4be60bb223a3a960f0d01697d849b86d91cad815a84915a32ed3635e93a5e7 - # via - # -r requirements.in - # gcp-docuploader -google-crc32c==1.3.0 \ - --hash=sha256:04e7c220798a72fd0f08242bc8d7a05986b2a08a0573396187fd32c1dcdd58b3 \ - --hash=sha256:05340b60bf05b574159e9bd940152a47d38af3fb43803ffe71f11d704b7696a6 \ - --hash=sha256:12674a4c3b56b706153a358eaa1018c4137a5a04635b92b4652440d3d7386206 \ - --hash=sha256:127f9cc3ac41b6a859bd9dc4321097b1a4f6aa7fdf71b4f9227b9e3ebffb4422 \ - --hash=sha256:13af315c3a0eec8bb8b8d80b8b128cb3fcd17d7e4edafc39647846345a3f003a \ - --hash=sha256:1926fd8de0acb9d15ee757175ce7242e235482a783cd4ec711cc999fc103c24e \ - --hash=sha256:226f2f9b8e128a6ca6a9af9b9e8384f7b53a801907425c9a292553a3a7218ce0 \ - --hash=sha256:276de6273eb074a35bc598f8efbc00c7869c5cf2e29c90748fccc8c898c244df \ - --hash=sha256:318f73f5484b5671f0c7f5f63741ab020a599504ed81d209b5c7129ee4667407 \ - --hash=sha256:3bbce1be3687bbfebe29abdb7631b83e6b25da3f4e1856a1611eb21854b689ea \ - --hash=sha256:42ae4781333e331a1743445931b08ebdad73e188fd554259e772556fc4937c48 \ - --hash=sha256:58be56ae0529c664cc04a9c76e68bb92b091e0194d6e3c50bea7e0f266f73713 \ - --hash=sha256:5da2c81575cc3ccf05d9830f9e8d3c70954819ca9a63828210498c0774fda1a3 \ - --hash=sha256:6311853aa2bba4064d0c28ca54e7b50c4d48e3de04f6770f6c60ebda1e975267 \ - --hash=sha256:650e2917660e696041ab3dcd7abac160b4121cd9a484c08406f24c5964099829 \ - --hash=sha256:6a4db36f9721fdf391646685ecffa404eb986cbe007a3289499020daf72e88a2 \ - --hash=sha256:779cbf1ce375b96111db98fca913c1f5ec11b1d870e529b1dc7354b2681a8c3a \ - --hash=sha256:7f6fe42536d9dcd3e2ffb9d3053f5d05221ae3bbcefbe472bdf2c71c793e3183 \ - --hash=sha256:891f712ce54e0d631370e1f4997b3f182f3368179198efc30d477c75d1f44942 \ - --hash=sha256:95c68a4b9b7828ba0428f8f7e3109c5d476ca44996ed9a5f8aac6269296e2d59 \ - --hash=sha256:96a8918a78d5d64e07c8ea4ed2bc44354e3f93f46a4866a40e8db934e4c0d74b \ - --hash=sha256:9c3cf890c3c0ecfe1510a452a165431b5831e24160c5fcf2071f0f85ca5a47cd \ - --hash=sha256:9f58099ad7affc0754ae42e6d87443299f15d739b0ce03c76f515153a5cda06c \ - --hash=sha256:a0b9e622c3b2b8d0ce32f77eba617ab0d6768b82836391e4f8f9e2074582bf02 \ - --hash=sha256:a7f9cbea4245ee36190f85fe1814e2d7b1e5f2186381b082f5d59f99b7f11328 \ - --hash=sha256:bab4aebd525218bab4ee615786c4581952eadc16b1ff031813a2fd51f0cc7b08 \ - --hash=sha256:c124b8c8779bf2d35d9b721e52d4adb41c9bfbde45e6a3f25f0820caa9aba73f \ - --hash=sha256:c9da0a39b53d2fab3e5467329ed50e951eb91386e9d0d5b12daf593973c3b168 \ - --hash=sha256:ca60076c388728d3b6ac3846842474f4250c91efbfe5afa872d3ffd69dd4b318 \ - --hash=sha256:cb6994fff247987c66a8a4e550ef374671c2b82e3c0d2115e689d21e511a652d \ - --hash=sha256:d1c1d6236feab51200272d79b3d3e0f12cf2cbb12b208c835b175a21efdb0a73 \ - --hash=sha256:dd7760a88a8d3d705ff562aa93f8445ead54f58fd482e4f9e2bafb7e177375d4 \ - --hash=sha256:dda4d8a3bb0b50f540f6ff4b6033f3a74e8bf0bd5320b70fab2c03e512a62812 \ - --hash=sha256:e0f1ff55dde0ebcfbef027edc21f71c205845585fffe30d4ec4979416613e9b3 \ - --hash=sha256:e7a539b9be7b9c00f11ef16b55486141bc2cdb0c54762f84e3c6fc091917436d \ - --hash=sha256:eb0b14523758e37802f27b7f8cd973f5f3d33be7613952c0df904b68c4842f0e \ - --hash=sha256:ed447680ff21c14aaceb6a9f99a5f639f583ccfe4ce1a5e1d48eb41c3d6b3217 \ - --hash=sha256:f52a4ad2568314ee713715b1e2d79ab55fab11e8b304fd1462ff5cccf4264b3e \ - --hash=sha256:fbd60c6aaa07c31d7754edbc2334aef50601b7f1ada67a96eb1eb57c7c72378f \ - --hash=sha256:fc28e0db232c62ca0c3600884933178f0825c99be4474cdd645e378a10588125 \ - --hash=sha256:fe31de3002e7b08eb20823b3735b97c86c5926dd0581c7710a680b418a8709d4 \ - --hash=sha256:fec221a051150eeddfdfcff162e6db92c65ecf46cb0f7bb1bf812a1520ec026b \ - --hash=sha256:ff71073ebf0e42258a42a0b34f2c09ec384977e7f6808999102eedd5b49920e3 - # via - # -r requirements.in - # google-resumable-media -google-resumable-media==2.3.3 \ - --hash=sha256:27c52620bd364d1c8116eaac4ea2afcbfb81ae9139fb3199652fcac1724bfb6c \ - --hash=sha256:5b52774ea7a829a8cdaa8bd2d4c3d4bc660c91b30857ab2668d0eb830f4ea8c5 - # via - # -r requirements.in - # google-cloud-storage -googleapis-common-protos==1.56.3 \ - --hash=sha256:6f1369b58ed6cf3a4b7054a44ebe8d03b29c309257583a2bbdc064cd1e4a1442 \ - --hash=sha256:87955d7b3a73e6e803f2572a33179de23989ebba725e05ea42f24838b792e461 - # via - # -r requirements.in - # google-api-core -idna==3.4 \ - --hash=sha256:814f528e8dead7d329833b91c5faa87d60bf71824cd12a7530b5526063d02cb4 \ - --hash=sha256:90b77e79eaa3eba6de819a0c442c0b4ceefc341a7a2ab77d7562bf49f425c5c2 - # via - # -r requirements.in - # requests -importlib-metadata==4.8.3 \ - --hash=sha256:65a9576a5b2d58ca44d133c42a241905cc45e34d2c06fd5ba2bafa221e5d7b5e \ - --hash=sha256:766abffff765960fcc18003801f7044eb6755ffae4521c8e8ce8e83b9c9b0668 - # via - # -r requirements.in - # keyring -jeepney==0.7.1 \ - --hash=sha256:1b5a0ea5c0e7b166b2f5895b91a08c14de8915afda4407fb5022a195224958ac \ - --hash=sha256:fa9e232dfa0c498bd0b8a3a73b8d8a31978304dcef0515adc859d4e096f96f4f - # via - # -r requirements.in - # keyring - # secretstorage -jinja2==3.0.3 \ - --hash=sha256:077ce6014f7b40d03b47d1f1ca4b0fc8328a692bd284016f806ed0eaca390ad8 \ - --hash=sha256:611bb273cd68f3b993fabdc4064fc858c5b47a973cb5aa7999ec1ba405c87cd7 - # via - # -r requirements.in - # gcp-releasetool -keyring==23.4.1 \ - --hash=sha256:17e49fb0d6883c2b4445359434dba95aad84aabb29bbff044ad0ed7100232eca \ - --hash=sha256:89cbd74d4683ed164c8082fb38619341097741323b3786905c6dac04d6915a55 - # via - # -r requirements.in - # gcp-releasetool -markupsafe==2.0.1 \ - --hash=sha256:01a9b8ea66f1658938f65b93a85ebe8bc016e6769611be228d797c9d998dd298 \ - --hash=sha256:023cb26ec21ece8dc3907c0e8320058b2e0cb3c55cf9564da612bc325bed5e64 \ - --hash=sha256:0446679737af14f45767963a1a9ef7620189912317d095f2d9ffa183a4d25d2b \ - --hash=sha256:04635854b943835a6ea959e948d19dcd311762c5c0c6e1f0e16ee57022669194 \ - --hash=sha256:0717a7390a68be14b8c793ba258e075c6f4ca819f15edfc2a3a027c823718567 \ - --hash=sha256:0955295dd5eec6cb6cc2fe1698f4c6d84af2e92de33fbcac4111913cd100a6ff \ - --hash=sha256:0d4b31cc67ab36e3392bbf3862cfbadac3db12bdd8b02a2731f509ed5b829724 \ - --hash=sha256:10f82115e21dc0dfec9ab5c0223652f7197feb168c940f3ef61563fc2d6beb74 \ - --hash=sha256:168cd0a3642de83558a5153c8bd34f175a9a6e7f6dc6384b9655d2697312a646 \ - --hash=sha256:1d609f577dc6e1aa17d746f8bd3c31aa4d258f4070d61b2aa5c4166c1539de35 \ - --hash=sha256:1f2ade76b9903f39aa442b4aadd2177decb66525062db244b35d71d0ee8599b6 \ - --hash=sha256:20dca64a3ef2d6e4d5d615a3fd418ad3bde77a47ec8a23d984a12b5b4c74491a \ - --hash=sha256:2a7d351cbd8cfeb19ca00de495e224dea7e7d919659c2841bbb7f420ad03e2d6 \ - --hash=sha256:2d7d807855b419fc2ed3e631034685db6079889a1f01d5d9dac950f764da3dad \ - --hash=sha256:2ef54abee730b502252bcdf31b10dacb0a416229b72c18b19e24a4509f273d26 \ - --hash=sha256:36bc903cbb393720fad60fc28c10de6acf10dc6cc883f3e24ee4012371399a38 \ - --hash=sha256:37205cac2a79194e3750b0af2a5720d95f786a55ce7df90c3af697bfa100eaac \ - --hash=sha256:3c112550557578c26af18a1ccc9e090bfe03832ae994343cfdacd287db6a6ae7 \ - --hash=sha256:3dd007d54ee88b46be476e293f48c85048603f5f516008bee124ddd891398ed6 \ - --hash=sha256:4296f2b1ce8c86a6aea78613c34bb1a672ea0e3de9c6ba08a960efe0b0a09047 \ - --hash=sha256:47ab1e7b91c098ab893b828deafa1203de86d0bc6ab587b160f78fe6c4011f75 \ - --hash=sha256:49e3ceeabbfb9d66c3aef5af3a60cc43b85c33df25ce03d0031a608b0a8b2e3f \ - --hash=sha256:4dc8f9fb58f7364b63fd9f85013b780ef83c11857ae79f2feda41e270468dd9b \ - --hash=sha256:4efca8f86c54b22348a5467704e3fec767b2db12fc39c6d963168ab1d3fc9135 \ - --hash=sha256:53edb4da6925ad13c07b6d26c2a852bd81e364f95301c66e930ab2aef5b5ddd8 \ - --hash=sha256:5855f8438a7d1d458206a2466bf82b0f104a3724bf96a1c781ab731e4201731a \ - --hash=sha256:594c67807fb16238b30c44bdf74f36c02cdf22d1c8cda91ef8a0ed8dabf5620a \ - --hash=sha256:5b6d930f030f8ed98e3e6c98ffa0652bdb82601e7a016ec2ab5d7ff23baa78d1 \ - --hash=sha256:5bb28c636d87e840583ee3adeb78172efc47c8b26127267f54a9c0ec251d41a9 \ - --hash=sha256:60bf42e36abfaf9aff1f50f52644b336d4f0a3fd6d8a60ca0d054ac9f713a864 \ - --hash=sha256:611d1ad9a4288cf3e3c16014564df047fe08410e628f89805e475368bd304914 \ - --hash=sha256:6300b8454aa6930a24b9618fbb54b5a68135092bc666f7b06901f897fa5c2fee \ - --hash=sha256:63f3268ba69ace99cab4e3e3b5840b03340efed0948ab8f78d2fd87ee5442a4f \ - --hash=sha256:6557b31b5e2c9ddf0de32a691f2312a32f77cd7681d8af66c2692efdbef84c18 \ - --hash=sha256:693ce3f9e70a6cf7d2fb9e6c9d8b204b6b39897a2c4a1aa65728d5ac97dcc1d8 \ - --hash=sha256:6a7fae0dd14cf60ad5ff42baa2e95727c3d81ded453457771d02b7d2b3f9c0c2 \ - --hash=sha256:6c4ca60fa24e85fe25b912b01e62cb969d69a23a5d5867682dd3e80b5b02581d \ - --hash=sha256:6fcf051089389abe060c9cd7caa212c707e58153afa2c649f00346ce6d260f1b \ - --hash=sha256:7d91275b0245b1da4d4cfa07e0faedd5b0812efc15b702576d103293e252af1b \ - --hash=sha256:89c687013cb1cd489a0f0ac24febe8c7a666e6e221b783e53ac50ebf68e45d86 \ - --hash=sha256:8d206346619592c6200148b01a2142798c989edcb9c896f9ac9722a99d4e77e6 \ - --hash=sha256:905fec760bd2fa1388bb5b489ee8ee5f7291d692638ea5f67982d968366bef9f \ - --hash=sha256:97383d78eb34da7e1fa37dd273c20ad4320929af65d156e35a5e2d89566d9dfb \ - --hash=sha256:984d76483eb32f1bcb536dc27e4ad56bba4baa70be32fa87152832cdd9db0833 \ - --hash=sha256:99df47edb6bda1249d3e80fdabb1dab8c08ef3975f69aed437cb69d0a5de1e28 \ - --hash=sha256:9f02365d4e99430a12647f09b6cc8bab61a6564363f313126f775eb4f6ef798e \ - --hash=sha256:a30e67a65b53ea0a5e62fe23682cfe22712e01f453b95233b25502f7c61cb415 \ - --hash=sha256:ab3ef638ace319fa26553db0624c4699e31a28bb2a835c5faca8f8acf6a5a902 \ - --hash=sha256:aca6377c0cb8a8253e493c6b451565ac77e98c2951c45f913e0b52facdcff83f \ - --hash=sha256:add36cb2dbb8b736611303cd3bfcee00afd96471b09cda130da3581cbdc56a6d \ - --hash=sha256:b2f4bf27480f5e5e8ce285a8c8fd176c0b03e93dcc6646477d4630e83440c6a9 \ - --hash=sha256:b7f2d075102dc8c794cbde1947378051c4e5180d52d276987b8d28a3bd58c17d \ - --hash=sha256:baa1a4e8f868845af802979fcdbf0bb11f94f1cb7ced4c4b8a351bb60d108145 \ - --hash=sha256:be98f628055368795d818ebf93da628541e10b75b41c559fdf36d104c5787066 \ - --hash=sha256:bf5d821ffabf0ef3533c39c518f3357b171a1651c1ff6827325e4489b0e46c3c \ - --hash=sha256:c47adbc92fc1bb2b3274c4b3a43ae0e4573d9fbff4f54cd484555edbf030baf1 \ - --hash=sha256:cdfba22ea2f0029c9261a4bd07e830a8da012291fbe44dc794e488b6c9bb353a \ - --hash=sha256:d6c7ebd4e944c85e2c3421e612a7057a2f48d478d79e61800d81468a8d842207 \ - --hash=sha256:d7f9850398e85aba693bb640262d3611788b1f29a79f0c93c565694658f4071f \ - --hash=sha256:d8446c54dc28c01e5a2dbac5a25f071f6653e6e40f3a8818e8b45d790fe6ef53 \ - --hash=sha256:deb993cacb280823246a026e3b2d81c493c53de6acfd5e6bfe31ab3402bb37dd \ - --hash=sha256:e0f138900af21926a02425cf736db95be9f4af72ba1bb21453432a07f6082134 \ - --hash=sha256:e9936f0b261d4df76ad22f8fee3ae83b60d7c3e871292cd42f40b81b70afae85 \ - --hash=sha256:f0567c4dc99f264f49fe27da5f735f414c4e7e7dd850cfd8e69f0862d7c74ea9 \ - --hash=sha256:f5653a225f31e113b152e56f154ccbe59eeb1c7487b39b9d9f9cdb58e6c79dc5 \ - --hash=sha256:f826e31d18b516f653fe296d967d700fddad5901ae07c622bb3705955e1faa94 \ - --hash=sha256:f8ba0e8349a38d3001fae7eadded3f6606f0da5d748ee53cc1dab1d6527b9509 \ - --hash=sha256:f9081981fe268bd86831e5c75f7de206ef275defcb82bc70740ae6dc507aee51 \ - --hash=sha256:fa130dd50c57d53368c9d59395cb5526eda596d3ffe36666cd81a44d56e48872 - # via - # -r requirements.in - # jinja2 -packaging==21.3 \ - --hash=sha256:dd47c42927d89ab911e606518907cc2d3a1f38bbd026385970643f9c5b8ecfeb \ - --hash=sha256:ef103e05f519cdc783ae24ea4e2e0f508a9c99b2d4969652eed6a2e1ea5bd522 - # via - # -r requirements.in - # gcp-releasetool -protobuf==3.19.5 \ - --hash=sha256:1867f93b06a183f87696871bb8d1e99ee71dbb69d468ce1f0cc8bf3d30f982f3 \ - --hash=sha256:3c4160b601220627f7e91154e572baf5e161a9c3f445a8242d536ee3d0b7b17c \ - --hash=sha256:4ee2af7051d3b10c8a4fe6fd1a2c69f201fea36aeee7086cf202a692e1b99ee1 \ - --hash=sha256:5266c36cc0af3bb3dbf44f199d225b33da66a9a5c3bdc2b14865ad10eddf0e37 \ - --hash=sha256:5470f892961af464ae6eaf0f3099e2c1190ae8c7f36f174b89491281341f79ca \ - --hash=sha256:66d14b5b90090353efe75c9fb1bf65ef7267383034688d255b500822e37d5c2f \ - --hash=sha256:67efb5d20618020aa9596e17bfc37ca068c28ec0c1507d9507f73c93d46c9855 \ - --hash=sha256:696e6cfab94cc15a14946f2bf72719dced087d437adbd994fff34f38986628bc \ - --hash=sha256:6a02172b9650f819d01fb8e224fc69b0706458fc1ab4f1c669281243c71c1a5e \ - --hash=sha256:950abd6c00e7b51f87ae8b18a0ce4d69fea217f62f171426e77de5061f6d9850 \ - --hash=sha256:9e1d74032f56ff25f417cfe84c8147047732e5059137ca42efad20cbbd25f5e0 \ - --hash=sha256:9e42b1cf2ecd8a1bd161239e693f22035ba99905ae6d7efeac8a0546c7ec1a27 \ - --hash=sha256:9f957ef53e872d58a0afd3bf6d80d48535d28c99b40e75e6634cbc33ea42fd54 \ - --hash=sha256:a89aa0c042e61e11ade320b802d6db4ee5391d8d973e46d3a48172c1597789f8 \ - --hash=sha256:c0f80876a8ff0ae7064084ed094eb86497bd5a3812e6fc96a05318b92301674e \ - --hash=sha256:c44e3282cff74ad18c7e8a0375f407f69ee50c2116364b44492a196293e08b21 \ - --hash=sha256:d249519ba5ecf5dd6b18150c9b6bcde510b273714b696f3923ff8308fc11ae49 \ - --hash=sha256:d3973a2d58aefc7d1230725c2447ce7f86a71cbc094b86a77c6ee1505ac7cdb1 \ - --hash=sha256:dca2284378a5f2a86ffed35c6ac147d14c48b525eefcd1083e5a9ce28dfa8657 \ - --hash=sha256:e63b0b3c42e51c94add62b010366cd4979cb6d5f06158bcae8faac4c294f91e1 \ - --hash=sha256:f2b599a21c9a32e171ec29a2ac54e03297736c578698e11b099d031f79da114b \ - --hash=sha256:f2bde37667b18c2b5280df83bc799204394a5d2d774e4deaf9de0eb741df6833 \ - --hash=sha256:f4f909f4dde413dec435a44b0894956d55bb928ded7d6e3c726556ca4c796e84 \ - --hash=sha256:f976234e20ab2785f54224bcdafa027674e23663b132fa3ca0caa291a6cfbde7 \ - --hash=sha256:f9cebda093c2f6bfed88f1c17cdade09d4d96096421b344026feee236532d4de - # via - # -r requirements.in - # gcp-docuploader - # gcp-releasetool - # google-api-core - # google-cloud-storage - # googleapis-common-protos -pyasn1==0.4.8 \ - --hash=sha256:39c7e2ec30515947ff4e87fb6f456dfc6e84857d34be479c9d4a4ba4bf46aa5d \ - --hash=sha256:aef77c9fb94a3ac588e87841208bdec464471d9871bd5050a287cc9a475cd0ba - # via - # pyasn1-modules - # rsa -pyasn1-modules==0.2.8 \ - --hash=sha256:905f84c712230b2c592c19470d3ca8d552de726050d1d1716282a1f6146be65e \ - --hash=sha256:a50b808ffeb97cb3601dd25981f6b016cbb3d31fbf57a8b8a87428e6158d0c74 - # via google-auth -pycparser==2.21 \ - --hash=sha256:8ee45429555515e1f6b185e78100aea234072576aa43ab53aefcae078162fca9 \ - --hash=sha256:e644fdec12f7872f86c58ff790da456218b10f863970249516d60a5eaca77206 - # via - # -r requirements.in - # cffi -pyjwt==2.4.0 \ - --hash=sha256:72d1d253f32dbd4f5c88eaf1fdc62f3a19f676ccbadb9dbc5d07e951b2b26daf \ - --hash=sha256:d42908208c699b3b973cbeb01a969ba6a96c821eefb1c5bfe4c390c01d67abba - # via - # -r requirements.in - # gcp-releasetool -pyparsing==3.0.9 \ - --hash=sha256:2b020ecf7d21b687f219b71ecad3631f644a47f01403fa1d1036b0c6416d70fb \ - --hash=sha256:5026bae9a10eeaefb61dab2f09052b9f4307d44aee4eda64b309723d8d206bbc - # via - # -r requirements.in - # packaging -pyperclip==1.8.2 \ - --hash=sha256:105254a8b04934f0bc84e9c24eb360a591aaf6535c9def5f29d92af107a9bf57 - # via - # -r requirements.in - # gcp-releasetool -python-dateutil==2.8.2 \ - --hash=sha256:0123cacc1627ae19ddf3c27a5de5bd67ee4586fbdd6440d9748f8abb483d3e86 \ - --hash=sha256:961d03dc3453ebbc59dbdea9e4e11c5651520a876d0f4db161e8674aae935da9 - # via - # -r requirements.in - # gcp-releasetool -requests==2.27.1 \ - --hash=sha256:68d7c56fd5a8999887728ef304a6d12edc7be74f1cfa47714fc8b414525c9a61 \ - --hash=sha256:f22fa1e554c9ddfd16e6e41ac79759e17be9e492b3587efa038054674760e72d - # via - # -r requirements.in - # gcp-releasetool - # google-api-core - # google-cloud-storage -rsa==4.9 \ - --hash=sha256:90260d9058e514786967344d0ef75fa8727eed8a7d2e43ce9f4bcf1b536174f7 \ - --hash=sha256:e38464a49c6c85d7f1351b0126661487a7e0a14a50f1675ec50eb34d4f20ef21 - # via - # -r requirements.in - # google-auth -secretstorage==3.3.3 \ - --hash=sha256:2403533ef369eca6d2ba81718576c5e0f564d5cca1b58f73a8b23e7d4eeebd77 \ - --hash=sha256:f356e6628222568e3af06f2eba8df495efa13b3b63081dafd4f7d9a7b7bc9f99 - # via keyring -six==1.16.0 \ - --hash=sha256:1e61c37477a1626458e36f7b1d82aa5c9b094fa4802892072e49de9c60c4c926 \ - --hash=sha256:8abb2f1d86890a2dfb989f9a77cfcfd3e47c2a354b01111771326f8aa26e0254 - # via - # -r requirements.in - # gcp-docuploader - # google-auth - # python-dateutil -typing-extensions==4.1.1 \ - --hash=sha256:1a9462dcc3347a79b1f1c0271fbe79e844580bb598bafa1ed208b94da3cdcd42 \ - --hash=sha256:21c85e0fe4b9a155d0799430b0ad741cdce7e359660ccbd8b530613e8df88ce2 - # via -r requirements.in -urllib3==1.26.12 \ - --hash=sha256:3fa96cf423e6987997fc326ae8df396db2a8b7c667747d47ddd8ecba91f4a74e \ - --hash=sha256:b930dd878d5a8afb066a637fbb35144fe7901e3b209d1cd4f524bd0e9deee997 - # via - # -r requirements.in - # requests -zipp==3.6.0 \ - --hash=sha256:71c644c5369f4a6e07636f0aa966270449561fcea2e3d6747b8d23efaa9d7832 \ - --hash=sha256:9fe5ea21568a0a70e50f273397638d39b03353731e6cbbb3fd8502a33fec40bc - # via - # -r requirements.in - # importlib-metadata \ No newline at end of file diff --git a/api-common-java/.kokoro/trampoline.sh b/api-common-java/.kokoro/trampoline.sh deleted file mode 100644 index e422a90dda..0000000000 --- a/api-common-java/.kokoro/trampoline.sh +++ /dev/null @@ -1,26 +0,0 @@ -#!/bin/bash -# Copyright 2019 Google Inc. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -set -eo pipefail -# 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/api-common-java/.repo-metadata.json b/api-common-java/.repo-metadata.json new file mode 100644 index 0000000000..d9098a2244 --- /dev/null +++ b/api-common-java/.repo-metadata.json @@ -0,0 +1,13 @@ +{ + "api_shortname": "api-common", + "client_documentation": "https://cloud.google.com/java/docs/reference/api-common/latest/overview", + "product_documentation": "https://github.com/googleapis/sdk-platform-java/tree/main/api-common-java", + "api_description": "API Common for Java is a library for foundational types relating to Google APIs.", + "name_pretty": "API Common for Java", + "release_level": "stable", + "language": "java", + "repo": "googleapis/sdk-platform-java", + "repo_short": "api-common-java", + "library_type": "OTHER", + "distribution_name": "com.google.api:api-common" +} diff --git a/api-common-java/CONTRIBUTING.md b/api-common-java/CONTRIBUTING.md deleted file mode 100644 index c6877c550e..0000000000 --- a/api-common-java/CONTRIBUTING.md +++ /dev/null @@ -1,29 +0,0 @@ -# How to Contribute - -Want to contribute? Great! First, read this page (including the small print at the end). - -### Before you contribute -Before we can use your code, you must sign the -[Google Individual Contributor License Agreement] -(https://cla.developers.google.com/about/google-individual) -(CLA), which you can do online. The CLA is necessary mainly because you own the -copyright to your changes, even after your contribution becomes part of our -codebase, so we need your permission to use and distribute your code. We also -need to be sure of various other things—for instance that you'll tell us if you -know that your code infringes on other people's patents. You don't have to sign -the CLA until after you've submitted your code for review and a member has -approved it, but you must do it before we can put your code into our codebase. -Before you start working on a larger contribution, you should get in touch with -us first through the issue tracker with your idea so that we can help out and -possibly guide you. Coordinating up front makes it much easier to avoid -frustration later on. - -### Code reviews -All submissions, including submissions by project members, require review. We -use Github pull requests for this purpose. - -### The small print -Contributions made by corporations are covered by a different agreement than -the one above, the -[Software Grant and Corporate Contributor License Agreement] -(https://cla.developers.google.com/about/google-corporate). diff --git a/api-common-java/LICENSE b/api-common-java/LICENSE index b442fc4b6c..a5c95e3444 100644 --- a/api-common-java/LICENSE +++ b/api-common-java/LICENSE @@ -1,4 +1,5 @@ -Copyright 2016, Google Inc. +Copyright 2016 Google LLC + Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: @@ -9,7 +10,7 @@ notice, this list of conditions and the following disclaimer. copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - * Neither the name of Google Inc. nor the names of its + * Neither the name of Google LLC nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. diff --git a/api-common-java/README.md b/api-common-java/README.md index 765a6d28cd..50419b0119 100644 --- a/api-common-java/README.md +++ b/api-common-java/README.md @@ -13,14 +13,6 @@ APIs. It currently contains the following packages: formatted as Google API resource names. - resourcenames: Resource Name library used by generated resource name types -> For new and existing Developers/ Contributors: -> -> In December 2022, api-common-java's build tool has been migrated from gradle to maven. -> Gradle related files are no longer being maintained and will be removed. -> -> The artifact coordinates in Maven Central (`{{ group_id }}:{{ artifact_id }}`) remain the same. - - Java Versions ------------- @@ -31,13 +23,6 @@ The build produces Java bytecode targeted for Java 8. The project uses Maven to build. -Contributing ------------- - -Contributions to this library are always welcome and highly encouraged. - -See the [CONTRIBUTING] documentation for more information on how to get started. - Versioning ---------- diff --git a/api-common-java/RELEASING.md b/api-common-java/RELEASING.md deleted file mode 100644 index 9f8e308bba..0000000000 --- a/api-common-java/RELEASING.md +++ /dev/null @@ -1,79 +0,0 @@ -One-time setup -============== - -Set up Sonatype Account ------------------------ -* Sign up for a Sonatype JIRA account [here](https://issues.sonatype.org) -* Click *Sign Up* in the login box, follow instructions - -Get access to repository ------------------------- -* Go to [community support](https://issues.sonatype.org/browse/OSSRH) -* Ask for publish rights by creating an issue similar to [this one](https://issues.sonatype.org/browse/OSSRH-32031) - * You must be logged in to create a new issue - * Use the *Create* button at the top tab - -* Generate the key `gpg --gen-key` - * Keep the defaults, but specify a passphrase - -* Determine your `gpg` version: `gpg -- version` - -* Find the ID of your public key - * If you're using GPG version 1.y.z, `gpg --list-secret-keys` - * Look for the line with format `sec 2048R/ABCDEFGH 2015-11-17` - * The `ABCDEFGH` is the ID for your public key - * If you're using GPG version 2.y.z `gpg --list-secret-keys --keyid-format LONG` - * Look for line with format `sec rsa2048/ABCDEFGHIJKLMNOP` - * The `ABCDEFGHIJKLMNOP` is the ID. It is 16-byte long, but Gradle - only support 8-byte keys. Use the *last* 8 bytes of the key when - following the rest of this document. - * `gpg --export-secret-keys $HOME/.gnupg/secring.gpg` - -* Upload your public key to a public server: `gpg --send-keys --keyserver hkp://pgp.mit.edu ` - -Add deploy credential settings ------------------------- -* Create a settings file at `$HOME/.gradle/gradle.properties` with your key information and your sonatype username/password - -``` -signing.keyId= -signing.password= -signing.secretKeyRingFile=/usr/local/google/home//.gnupg/secring.gpg - -ossrhUsername= -ossrhPassword= -``` - -To prepare a release -==================== - -Update version and deploy to Sonatype -------------------------------------- -1. Update `version.txt` to the release version you want -2. Run `./gradlew stageRelease` to: - * Regenerate `gh-pages` branch containing Javadocs - * Stage artifacts on Sonatype: to the staging repository if "-SNAPSHOT" is *not* included in the version; otherwise to the snapshot repository only -3. Submit a pull request, get it reviewed, and submit - -Publish the release -------------------- -1. Run `./gradlew finalizeRelease` - * Note: this will release **ALL** versions that have been staged to Sonatype: - if you have staged versions you do not intend to release, remove these first - from the [Nexus Repository Manager](https://oss.sonatype.org/) by logging in - (upper right) and browsing staging repositories (left panel) -2. It will take some time (~10 min to ~8 hours) for the package to transition -3. Publish a new release on Github: - * Go to the [releases page](https://github.com/googleapis/api-common-java/releases) and click "Draft a new release" - in order to start a new draft. - * Make sure the "Tag Version" is `vX.Y.Z` and the "Release Title" is `X.Y.Z`, where `X.Y.Z` is the release - version as listed in the `version.txt` files. - * Add the commits since the last release into the release draft. Try to group them into sections with related - changes. Anything that is a breaking change needs to be marked with `*breaking change*`. Such changes are - only allowed for alpha/beta modules and `@BetaApi` features. - * Ensure that the format is consistent with previous releases. After adding any missing updates and - reformatting as necessary, publish the draft. - -Bump development version ------------------------- -1. Update `version.txt` to the following "-SNAPSHOT" version diff --git a/api-common-java/build.gradle b/api-common-java/build.gradle deleted file mode 100644 index defe33162a..0000000000 --- a/api-common-java/build.gradle +++ /dev/null @@ -1,449 +0,0 @@ -import groovy.io.FileType - -buildscript { - repositories { - mavenLocal() - maven { - url 'https://plugins.gradle.org/m2/' - } - mavenCentral() - } - dependencies { - classpath "gradle.plugin.com.github.sherter.google-java-format:google-java-format-gradle-plugin:0.9", - "io.github.gradle-nexus:publish-plugin:1.1.0" - } -} -apply plugin: 'java' -apply plugin: 'eclipse' -apply plugin: 'idea' -apply plugin: 'jacoco' -apply plugin: 'signing' -apply plugin: 'maven-publish' -apply plugin: 'com.github.sherter.google-java-format' -apply plugin: 'io.github.gradle-nexus.publish-plugin' - - -group = "com.google.api" -archivesBaseName = "api-common" - -project.version = "2.3.1" // {x-version-update:api-common:current} - -sourceCompatibility = 1.8 -targetCompatibility = 1.8 - -jacoco { - toolVersion = "0.8.8" -} - -// Dependencies -// ------------ - -ext { - // Shortcuts for libraries we are using - libraries = [ - javax_annotations: 'javax.annotation:javax.annotation-api:1.3.2', - auto_value: 'com.google.auto.value:auto-value:1.10.1', - auto_value_annotations: 'com.google.auto.value:auto-value-annotations:1.10.1', - guava: 'com.google.guava:guava:31.1-jre', - jsr305: 'com.google.code.findbugs:jsr305:3.0.2', - error_prone_annotations: 'com.google.errorprone:error_prone_annotations:2.17.0', - - // Testing - junit: 'junit:junit:4.13.2', - truth: 'com.google.truth:truth:1.1.3', - ] -} - -repositories { - mavenLocal() - mavenCentral() -} - -dependencies { - - annotationProcessor libraries.auto_value - - implementation( libraries.guava, - libraries.jsr305, - libraries.javax_annotations, - libraries.auto_value_annotations) - - compileOnly libraries.error_prone_annotations - - testImplementation(libraries.junit, - libraries.truth) -} - -clean.doFirst { - delete 'tmp_gh-pages/' -} - -jacocoTestReport { - reports { - xml.enabled true - html.enabled true - } -} - -check.dependsOn jacocoTestReport - -// jar with automatic module name: -jar { - manifest { - attributes('Automatic-Module-Name': 'com.google.api.apicommon') - } -} - -// Source jar -// ---------- -project.gradle.taskGraph.whenReady { - println project.gradle.taskGraph.getAllTasks() -} -task sourcesJar(type: Jar, dependsOn: classes) { - archiveClassifier = 'sources' - from sourceSets.main.allSource -} - -// JavaDoc -// ------- - -task javadocJar(type: Jar) { - archiveClassifier = 'javadoc' - from javadoc -} - -javadoc.options { - encoding = 'UTF-8' - links 'https://docs.oracle.com/javase/7/docs/api/' -} - -// JavaDocV3 -// ------- - -task javadocJarV3(type: Jar) { - archiveClassifier = 'javadoc' - from javadoc -} - -javadoc.options { - encoding = 'UTF-8' - links 'https://docs.oracle.com/javase/7/docs/api/' - - if (JavaVersion.current().isJava8Compatible()) { - addStringOption('Xdoclint:all,-missing', '-quiet') - } - if (JavaVersion.current().isJava11Compatible()) { - addStringOption('-release', '7') - } -} - -// Test Logging -// ------------ - -test { - testLogging { - events "passed", "skipped", "failed", "standardOut", "standardError" - exceptionFormat = 'full' - } -} - - -// Eclipse Annotation Processing -// ----------------------------- - -ext { - eclipseAptFolder = '.apt_generated' - eclipseSettingsDir = file('.settings') -} - -configurations { - codeGeneration -} - -dependencies { - codeGeneration libraries.auto_value, libraries.jsr305 - implementation(libraries.jsr305, libraries.auto_value_annotations) -} - -compileJava.classpath += configurations.codeGeneration - -eclipse { - jdt.file.withProperties { - it['org.eclipse.jdt.core.compiler.processAnnotations'] = 'enabled' - } -} - -tasks.eclipseJdt { - doFirst { - def aptPrefs = - file("${eclipseSettingsDir}/org.eclipse.jdt.apt.core.prefs") - aptPrefs.parentFile.mkdirs() - - aptPrefs.text = """\ - eclipse.preferences.version=1 - org.eclipse.jdt.apt.aptEnabled=true - org.eclipse.jdt.apt.genSrcDir=${eclipseAptFolder} - org.eclipse.jdt.apt.reconcileEnabled=true - """.stripIndent() - - file('.factorypath').withWriter { - new groovy.xml.MarkupBuilder(it).'factorypath' { - project.configurations.codeGeneration.each { dep-> - factorypathentry( - kind:'EXTJAR', - id:dep.absolutePath, - enabled:true, - runInBatchMode:false) - } - } - } - } -} - -tasks.cleanEclipseJdt { - doFirst { - delete file("${eclipseSettingsDir}/org.eclipse.jdt.apt.core.prefs"), - file('.factorypath') - } -} - -// Publishing -// ---------- - -artifacts { - archives javadocJar, sourcesJar -} - -signing { - required { gradle.taskGraph.hasTask("uploadArchives") } - if (project.hasProperty('signing.gnupg.executable')) { - useGpgCmd() - } - sign configurations.archives -} - -if (project.hasProperty('ossrhUsername') && project.hasProperty('ossrhPassword')) { - nexusPublishing { - packageGroup = "com.google.api" - repositories { - sonatype { //or custom repository name - nexusUrl.set(uri('https://google.oss.sonatype.org/service/local/')) - snapshotRepositoryUrl.set(uri('https://google.oss.sonatype.org/content/repositories/snapshots/')) - username = ossrhUsername - password = ossrhPassword - } - } - } -} - -afterEvaluate { - publishing { - publications { - mavenJava(MavenPublication) { - version = project.version - - from components.java - - artifact javadocJar - artifact sourcesJar - - pom { - name = 'API Common' - packaging = 'jar' - artifactId = 'api-common' - description = 'Common utilities for Google APIs in Java' - url = 'https://github.com/googleapis/api-common-java' - - scm { - url = 'https://github.com/googleapis/api-common-java' - connection = 'scm:git:https://github.com/googleapis/api-common-java.git' - } - - licenses { - license { - name = 'BSD' - url = 'https://github.com/googleapis/api-common-java/blob/master/LICENSE' - } - } - - developers { - developer { - id = 'GoogleAPIs' - name = 'GoogleAPIs' - email = 'googleapis@googlegroups.com' - url = 'https://github.com/googleapis' - organization = 'Google, Inc.' - organizationUrl = 'https://www.google.com' - } - } - } - } - } - repositories { - maven { - url 'https://google.oss.sonatype.org/service/local/staging/deploy/maven2/' - credentials { - username = project.hasProperty('ossrhUsername') ? project.getProperty('ossrhUsername') : null - password = project.hasProperty('ossrhPassword') ? project.getProperty('ossrhPassword') : null - } - } - } - } - - signing { - if (!project.hasProperty('skip.signing')) { - if (project.hasProperty('signing.gnupg.executable')) { - useGpgCmd() - } - sign publishing.publications - } - } -} - -gradle.projectsEvaluated { - tasks.withType(JavaCompile) { - options.compilerArgs << "-Xlint:unchecked" << "-Xlint:deprecation" - } -} - -// Formatting tasks -// ================ - -task verifyLicense { - doLast { - def licenseText = new File(rootProject.rootDir, 'license-header-javadoc.txt').text - def srcFiles = [] - sourceSets - .collectMany{it.allJava.getSrcDirs()} - .each{it.eachFileRecurse(FileType.FILES, {srcFiles << new Tuple(it, it.text)})} - srcFiles = srcFiles - .findAll{it.get(0).path.endsWith(".java")} - .collect{new Tuple(it.get(0), it.get(1).replaceAll("Copyright 20[0-9]{2}", "Copyright 20xx"))} - .findAll{!it.get(1).startsWith(licenseText)} - if (srcFiles.asList().size() > 0) { - srcFiles.each({println 'missing license: ' + it.get(0)}) - throw new IllegalStateException("Above files do not have licenses") - } - } -} -test.dependsOn verifyLicense - -googleJavaFormat { - toolVersion '1.0' -} -tasks.googleJavaFormat { - exclude '.apt_generated/**' - exclude 'bin/**' - exclude 'build/**' -} -tasks.verifyGoogleJavaFormat { - exclude '.apt_generated/**' - exclude 'bin/**' - exclude 'build/**' -} -test.dependsOn verifyGoogleJavaFormat - -// JavaDocV3 docFX -// -task javadocCombinedV3(type: Javadoc) { - source project.sourceSets.main.allJava - classpath = files(project.sourceSets.main.compileClasspath) - destinationDir = new File(projectDir, 'tmp_docs/docfx-yml') - - options.addStringOption('encoding', 'UTF-8') - options.addStringOption("doclet", "com.microsoft.doclet.DocFxDoclet") - options.addStringOption("projectname", "api-common") - options.docletpath = [file(System.getenv('KOKORO_GFILE_DIR') + "/java-docfx-doclet-1.5.0.jar")] - // Newer Gradle 6 passes -notimestamp by default, which the doclet above doesn't understand: - // https://github.com/gradle/gradle/issues/11898 - options.noTimestamp false -} - -clean { - delete 'tmp_gh-pages/' - delete 'tmp_docs/' -} - - -// Release -// ======= - -task checkOutGhPages { - doLast { - if (!new File('tmp_gh-pages').exists()) { - exec { - commandLine 'git', 'clone', '--branch', 'gh-pages', - '--single-branch', 'https://github.com/googleapis/api-common-java/', 'tmp_gh-pages' - } - } - } -} - -task copyFilesToGhPages { - dependsOn 'checkOutGhPages' - dependsOn 'javadoc' - doLast { - def newSiteDirPath = 'tmp_gh-pages/' + project.version + '/apidocs/' - new File(newSiteDirPath).mkdirs() - copy { - from 'build/docs/javadoc' - into newSiteDirPath - } - copy { - from 'README.md' - into 'tmp_gh-pages' - rename { filename -> filename.replace 'README', 'index' } - } - } -} - -task createApiDocsRedirect { - dependsOn 'copyFilesToGhPages' - doLast { - def template = new File('templates/apidocs_index.html.template').text - def outputContent = template.replace('{{siteVersion}}', project.version) - new File('tmp_gh-pages/apidocs/index.html').write(outputContent) - } -} - -task publishDocs { - dependsOn 'closeAndReleaseSonatypeStagingRepository' - doLast { - exec { - workingDir './tmp_gh-pages' - commandLine 'git', 'add', '.' - } - exec { - workingDir './tmp_gh-pages' - commandLine 'git', 'commit', '-m', 'Release docs for ' + project.version - } - exec { - workingDir './tmp_gh-pages' - commandLine 'git', 'push' - } - } -} - -// 1. Regenerates the gh-pages branch under tmp_gh-pages -// 2. Stages the artifact on Sonatype -task stageRelease { - dependsOn 'createApiDocsRedirect' - doLast { - exec { - commandLine './gradlew', 'uploadArchives' - } - } -} - -// 1. Closes and releases the artifact on Sonatype -// 2. Commits and pushes the new docs -// 3. Removes tmp_gh-pages -// Note: This task assumes that the 'stageRelease' task has been completed. -task finalizeRelease { - dependsOn 'publishDocs' - doLast { - exec { - commandLine 'rm', '-r', 'tmp_gh-pages' - } - } -} diff --git a/api-common-java/gradle/wrapper/gradle-wrapper.jar b/api-common-java/gradle/wrapper/gradle-wrapper.jar deleted file mode 100644 index e708b1c023..0000000000 Binary files a/api-common-java/gradle/wrapper/gradle-wrapper.jar and /dev/null differ diff --git a/api-common-java/gradle/wrapper/gradle-wrapper.properties b/api-common-java/gradle/wrapper/gradle-wrapper.properties deleted file mode 100644 index d355f4c4f3..0000000000 --- a/api-common-java/gradle/wrapper/gradle-wrapper.properties +++ /dev/null @@ -1,5 +0,0 @@ -distributionBase=GRADLE_USER_HOME -distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-6.9.3-bin.zip -zipStoreBase=GRADLE_USER_HOME -zipStorePath=wrapper/dists diff --git a/api-common-java/gradlew b/api-common-java/gradlew deleted file mode 100755 index 1b6c787337..0000000000 --- a/api-common-java/gradlew +++ /dev/null @@ -1,234 +0,0 @@ -#!/bin/sh - -# -# Copyright © 2015-2021 the original authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -############################################################################## -# -# Gradle start up script for POSIX generated by Gradle. -# -# Important for running: -# -# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is -# noncompliant, but you have some other compliant shell such as ksh or -# bash, then to run this script, type that shell name before the whole -# command line, like: -# -# ksh Gradle -# -# Busybox and similar reduced shells will NOT work, because this script -# requires all of these POSIX shell features: -# * functions; -# * expansions «$var», «${var}», «${var:-default}», «${var+SET}», -# «${var#prefix}», «${var%suffix}», and «$( cmd )»; -# * compound commands having a testable exit status, especially «case»; -# * various built-in commands including «command», «set», and «ulimit». -# -# Important for patching: -# -# (2) This script targets any POSIX shell, so it avoids extensions provided -# by Bash, Ksh, etc; in particular arrays are avoided. -# -# The "traditional" practice of packing multiple parameters into a -# space-separated string is a well documented source of bugs and security -# problems, so this is (mostly) avoided, by progressively accumulating -# options in "$@", and eventually passing that to Java. -# -# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS, -# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly; -# see the in-line comments for details. -# -# There are tweaks for specific operating systems such as AIX, CygWin, -# Darwin, MinGW, and NonStop. -# -# (3) This script is generated from the Groovy template -# https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt -# within the Gradle project. -# -# You can find Gradle at https://github.com/gradle/gradle/. -# -############################################################################## - -# Attempt to set APP_HOME - -# Resolve links: $0 may be a link -app_path=$0 - -# Need this for daisy-chained symlinks. -while - APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path - [ -h "$app_path" ] -do - ls=$( ls -ld "$app_path" ) - link=${ls#*' -> '} - case $link in #( - /*) app_path=$link ;; #( - *) app_path=$APP_HOME$link ;; - esac -done - -APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit - -APP_NAME="Gradle" -APP_BASE_NAME=${0##*/} - -# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' - -# Use the maximum available, or set MAX_FD != -1 to use that value. -MAX_FD=maximum - -warn () { - echo "$*" -} >&2 - -die () { - echo - echo "$*" - echo - exit 1 -} >&2 - -# OS specific support (must be 'true' or 'false'). -cygwin=false -msys=false -darwin=false -nonstop=false -case "$( uname )" in #( - CYGWIN* ) cygwin=true ;; #( - Darwin* ) darwin=true ;; #( - MSYS* | MINGW* ) msys=true ;; #( - NONSTOP* ) nonstop=true ;; -esac - -CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar - - -# Determine the Java command to use to start the JVM. -if [ -n "$JAVA_HOME" ] ; then - if [ -x "$JAVA_HOME/jre/sh/java" ] ; then - # IBM's JDK on AIX uses strange locations for the executables - JAVACMD=$JAVA_HOME/jre/sh/java - else - JAVACMD=$JAVA_HOME/bin/java - fi - if [ ! -x "$JAVACMD" ] ; then - die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME - -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." - fi -else - JAVACMD=java - which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. - -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." -fi - -# Increase the maximum file descriptors if we can. -if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then - case $MAX_FD in #( - max*) - MAX_FD=$( ulimit -H -n ) || - warn "Could not query maximum file descriptor limit" - esac - case $MAX_FD in #( - '' | soft) :;; #( - *) - ulimit -n "$MAX_FD" || - warn "Could not set maximum file descriptor limit to $MAX_FD" - esac -fi - -# Collect all arguments for the java command, stacking in reverse order: -# * args from the command line -# * the main class name -# * -classpath -# * -D...appname settings -# * --module-path (only if needed) -# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables. - -# For Cygwin or MSYS, switch paths to Windows format before running java -if "$cygwin" || "$msys" ; then - APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) - CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) - - JAVACMD=$( cygpath --unix "$JAVACMD" ) - - # Now convert the arguments - kludge to limit ourselves to /bin/sh - for arg do - if - case $arg in #( - -*) false ;; # don't mess with options #( - /?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath - [ -e "$t" ] ;; #( - *) false ;; - esac - then - arg=$( cygpath --path --ignore --mixed "$arg" ) - fi - # Roll the args list around exactly as many times as the number of - # args, so each arg winds up back in the position where it started, but - # possibly modified. - # - # NB: a `for` loop captures its iteration list before it begins, so - # changing the positional parameters here affects neither the number of - # iterations, nor the values presented in `arg`. - shift # remove old arg - set -- "$@" "$arg" # push replacement arg - done -fi - -# Collect all arguments for the java command; -# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of -# shell script including quotes and variable substitutions, so put them in -# double quotes to make sure that they get re-expanded; and -# * put everything else in single quotes, so that it's not re-expanded. - -set -- \ - "-Dorg.gradle.appname=$APP_BASE_NAME" \ - -classpath "$CLASSPATH" \ - org.gradle.wrapper.GradleWrapperMain \ - "$@" - -# Use "xargs" to parse quoted args. -# -# With -n1 it outputs one arg per line, with the quotes and backslashes removed. -# -# In Bash we could simply go: -# -# readarray ARGS < <( xargs -n1 <<<"$var" ) && -# set -- "${ARGS[@]}" "$@" -# -# but POSIX shell has neither arrays nor command substitution, so instead we -# post-process each arg (as a line of input to sed) to backslash-escape any -# character that might be a shell metacharacter, then use eval to reverse -# that process (while maintaining the separation between arguments), and wrap -# the whole thing up as a single "set" statement. -# -# This will of course break if any of these variables contains a newline or -# an unmatched quote. -# - -eval "set -- $( - printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | - xargs -n1 | - sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | - tr '\n' ' ' - )" '"$@"' - -exec "$JAVACMD" "$@" diff --git a/api-common-java/gradlew.bat b/api-common-java/gradlew.bat deleted file mode 100644 index ac1b06f938..0000000000 --- a/api-common-java/gradlew.bat +++ /dev/null @@ -1,89 +0,0 @@ -@rem -@rem Copyright 2015 the original author or authors. -@rem -@rem Licensed under the Apache License, Version 2.0 (the "License"); -@rem you may not use this file except in compliance with the License. -@rem You may obtain a copy of the License at -@rem -@rem https://www.apache.org/licenses/LICENSE-2.0 -@rem -@rem Unless required by applicable law or agreed to in writing, software -@rem distributed under the License is distributed on an "AS IS" BASIS, -@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -@rem See the License for the specific language governing permissions and -@rem limitations under the License. -@rem - -@if "%DEBUG%" == "" @echo off -@rem ########################################################################## -@rem -@rem Gradle startup script for Windows -@rem -@rem ########################################################################## - -@rem Set local scope for the variables with windows NT shell -if "%OS%"=="Windows_NT" setlocal - -set DIRNAME=%~dp0 -if "%DIRNAME%" == "" set DIRNAME=. -set APP_BASE_NAME=%~n0 -set APP_HOME=%DIRNAME% - -@rem Resolve any "." and ".." in APP_HOME to make it shorter. -for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi - -@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" - -@rem Find java.exe -if defined JAVA_HOME goto findJavaFromJavaHome - -set JAVA_EXE=java.exe -%JAVA_EXE% -version >NUL 2>&1 -if "%ERRORLEVEL%" == "0" goto execute - -echo. -echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. - -goto fail - -:findJavaFromJavaHome -set JAVA_HOME=%JAVA_HOME:"=% -set JAVA_EXE=%JAVA_HOME%/bin/java.exe - -if exist "%JAVA_EXE%" goto execute - -echo. -echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. - -goto fail - -:execute -@rem Setup the command line - -set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar - - -@rem Execute Gradle -"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* - -:end -@rem End local scope for the variables with windows NT shell -if "%ERRORLEVEL%"=="0" goto mainEnd - -:fail -rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of -rem the _cmd.exe /c_ return code! -if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 -exit /b 1 - -:mainEnd -if "%OS%"=="Windows_NT" endlocal - -:omega diff --git a/api-common-java/license-checks.xml b/api-common-java/license-checks.xml index a800d524d4..b2b69e999b 100644 --- a/api-common-java/license-checks.xml +++ b/api-common-java/license-checks.xml @@ -5,6 +5,6 @@ - + diff --git a/api-common-java/pom.xml b/api-common-java/pom.xml index 4dae57b798..6de7de7de5 100644 --- a/api-common-java/pom.xml +++ b/api-common-java/pom.xml @@ -5,15 +5,14 @@ com.google.api api-common jar - 2.3.2-SNAPSHOT + 2.59.1-SNAPSHOT API Common - https://github.com/googleapis/api-common-java Common utilities for Google APIs in Java - com.google.cloud + com.google.api gapic-generator-java-pom-parent - 2.12.1-SNAPSHOT + 2.68.1-SNAPSHOT ../gapic-generator-java-pom-parent @@ -27,14 +26,9 @@ - - scm:git:https://github.com/googleapis/api-common-java.git - https://github.com/googleapis/api-common-java - - - BSD + BSD-3-Clause https://github.com/googleapis/api-common-java/blob/main/LICENSE @@ -43,7 +37,6 @@ UTF-8 1.8 1.8 - 1.10.1 @@ -57,11 +50,6 @@ auto-value-annotations ${auto-value.version} - - com.google.auto.value - auto-value - ${auto-value.version} - com.google.code.findbugs jsr305 @@ -75,23 +63,40 @@ com.google.errorprone error_prone_annotations - 2.17.0 + ${errorprone.version} compile - junit - junit - 4.13.2 + org.junit.jupiter + junit-jupiter-engine + ${junit.version} + test + + + org.junit.jupiter + junit-jupiter-params + ${junit.version} + test + + + org.junit.vintage + junit-vintage-engine + ${junit.version} test com.google.truth truth - 1.1.3 + 1.4.4 test + + com.google.j2objc + j2objc-annotations + ${j2objc-annotations.version} + @@ -113,7 +118,7 @@ - com.coveo + com.spotify.fmt fmt-maven-plugin @@ -137,4 +142,4 @@ - \ No newline at end of file + diff --git a/api-common-java/renovate.json b/api-common-java/renovate.json deleted file mode 100644 index 0e82ced57a..0000000000 --- a/api-common-java/renovate.json +++ /dev/null @@ -1,74 +0,0 @@ -{ - "extends": [ - ":separateMajorReleases", - ":combinePatchMinorReleases", - ":ignoreUnstable", - ":prImmediately", - ":updateNotScheduled", - ":automergeDisabled", - ":ignoreModulesAndTests", - ":maintainLockFilesDisabled", - ":autodetectPinVersions" - ], - "ignorePaths": [".kokoro/requirements.txt"], - "packageRules": [ - { - "packagePatterns": [ - "^com.google.guava:" - ], - "versionScheme": "docker" - }, - { - "packagePatterns": [ - "*" - ], - "semanticCommitType": "deps", - "semanticCommitScope": null - }, - { - "packagePatterns": [ - "^org.apache.maven", - "^org.jacoco:", - "^org.codehaus.mojo:", - "^org.sonatype.plugins:", - "^com.coveo:", - "^com.google.cloud:google-cloud-shared-config" - ], - "semanticCommitType": "build", - "semanticCommitScope": "deps" - }, - { - "packagePatterns": [ - "^com.google.api:api-common", - "^com.google.cloud:libraries-bom", - "^com.google.cloud.samples:shared-configuration" - ], - "semanticCommitType": "chore", - "semanticCommitScope": "deps" - }, - { - "packagePatterns": [ - "^junit:junit", - "^com.google.truth:truth", - "^org.mockito:mockito-core", - "^org.objenesis:objenesis" - ], - "semanticCommitType": "test", - "semanticCommitScope": "deps" - }, - { - "packagePatterns": [ - "^com.google.cloud:google-cloud-" - ], - "ignoreUnstable": false - }, - { - "packagePatterns": [ - "^com.fasterxml.jackson.core" - ], - "groupName": "jackson dependencies" - } - ], - "semanticCommits": true, - "masterIssue": true -} diff --git a/api-common-java/src/main/java/com/google/api/core/ApiAsyncFunction.java b/api-common-java/src/main/java/com/google/api/core/ApiAsyncFunction.java index deb8d48e35..cb0c8b2cb0 100644 --- a/api-common-java/src/main/java/com/google/api/core/ApiAsyncFunction.java +++ b/api-common-java/src/main/java/com/google/api/core/ApiAsyncFunction.java @@ -34,6 +34,7 @@ * *

It is similar to Guava's {@code AsyncFunction}, redeclared so that Guava can be shaded. */ +@FunctionalInterface public interface ApiAsyncFunction { /** * Returns an output Future to use in place of the given input. The output Future need not be diff --git a/api-common-java/src/main/java/com/google/api/core/ApiFunction.java b/api-common-java/src/main/java/com/google/api/core/ApiFunction.java index d03d934930..ca5dfb1806 100644 --- a/api-common-java/src/main/java/com/google/api/core/ApiFunction.java +++ b/api-common-java/src/main/java/com/google/api/core/ApiFunction.java @@ -34,6 +34,7 @@ * *

It is similar to Guava's {@code Function}, redeclared so that Guava can be shaded. */ +@FunctionalInterface public interface ApiFunction { T apply(F input); } diff --git a/api-common-java/src/main/java/com/google/api/core/ApiFutureToListenableFuture.java b/api-common-java/src/main/java/com/google/api/core/ApiFutureToListenableFuture.java index e7c6e9f78a..92f5cf7471 100644 --- a/api-common-java/src/main/java/com/google/api/core/ApiFutureToListenableFuture.java +++ b/api-common-java/src/main/java/com/google/api/core/ApiFutureToListenableFuture.java @@ -29,6 +29,7 @@ */ package com.google.api.core; +import com.google.common.base.MoreObjects; import com.google.common.util.concurrent.ListenableFuture; import java.util.concurrent.ExecutionException; import java.util.concurrent.Executor; @@ -74,4 +75,11 @@ public V get(long l, TimeUnit timeUnit) throws InterruptedException, ExecutionException, TimeoutException { return apiFuture.get(l, timeUnit); } + + @Override + public String toString() { + return MoreObjects.toStringHelper(ApiFutureToListenableFuture.class.getSimpleName()) + .add("apiFuture", apiFuture) + .toString(); + } } diff --git a/api-common-java/src/main/java/com/google/api/core/ApiFutures.java b/api-common-java/src/main/java/com/google/api/core/ApiFutures.java index 2189a5e533..780c50a783 100644 --- a/api-common-java/src/main/java/com/google/api/core/ApiFutures.java +++ b/api-common-java/src/main/java/com/google/api/core/ApiFutures.java @@ -45,11 +45,16 @@ public final class ApiFutures { private ApiFutures() {} - /* - * @deprecated Use {@linkplain #addCallback(ApiFuture, ApiFutureCallback, Executor) the - * overload that requires an executor}. For identical behavior, pass {@link - * com.google.common.util.concurrent.MoreExecutors#directExecutor}, but consider whether - * another executor would be safer. + /** + * Registers a callback to be run when the {@link ApiFuture}'s computation is complete or, if the + * computation is already complete, immediately. + * + * @param future The future attach the callback to + * @param callback The callback to invoke when future is completed + * @deprecated Use {@linkplain #addCallback(ApiFuture, ApiFutureCallback, Executor) the overload + * that requires an executor}. For identical behavior, pass {@link + * com.google.common.util.concurrent.MoreExecutors#directExecutor}, but consider whether + * another executor would be safer. */ @Deprecated public static void addCallback( @@ -57,6 +62,18 @@ public static void addCallback( addCallback(future, callback, directExecutor()); } + /** + * Registers a callback to be run when the {@link ApiFuture}'s computation is complete or, if the + * computation is already complete, immediately. + * + *

Note that this method is a delegate of {@link Futures#addCallback(ListenableFuture, + * FutureCallback, Executor)}. + * + * @param future The future attach the callback to + * @param callback The callback to invoke when future is completed + * @param executor The executor to run callback when the future completes + * @see Futures#addCallback(ListenableFuture, FutureCallback, Executor) + */ public static void addCallback( final ApiFuture future, final ApiFutureCallback callback, Executor executor) { Futures.addCallback( @@ -75,11 +92,20 @@ public void onSuccess(V v) { executor); } - /* - * @deprecated Use {@linkplain #catching(ApiFuture, Class, ApiFunction, Executor) the - * overload that requires an executor}. For identical behavior, pass {@link - * com.google.common.util.concurrent.MoreExecutors#directExecutor}, but consider whether - * another executor would be safer. + /** + * Returns an {@link ApiFuture} whose result is taken from the given primary input or, if the + * primary input fails with the given exceptionType, from the result provided by the callback. + * + * @param input The primary input {@code ApiFuture} + * @param exceptionType The exception type that triggers use of {@code fallback} + * @param callback The {@link ApiFunction} to be called if input fails with the expected exception + * type + * @return A future whose result is taken either from the given {@code input} or by the {@code + * callback} + * @deprecated Use {@linkplain #catching(ApiFuture, Class, ApiFunction, Executor) the overload + * that requires an executor}. For identical behavior, pass {@link + * com.google.common.util.concurrent.MoreExecutors#directExecutor}, but consider whether + * another executor would be safer. */ @Deprecated public static ApiFuture catching( @@ -89,6 +115,22 @@ public static ApiFuture catching( return catching(input, exceptionType, callback, directExecutor()); } + /** + * Returns an {@link ApiFuture} whose result is taken from the given primary input or, if the + * primary input fails with the given exceptionType, from the result provided by the callback. + * + *

Note that this method is a delegate of {@link Futures#catching(ListenableFuture, Class, + * Function, Executor)}. + * + * @param input The primary input {@code ApiFuture} + * @param exceptionType The exception type that triggers use of {@code fallback} + * @param callback The {@link ApiFunction} to be called if input fails with the expected exception + * type + * @param executor The executor that runs {@code fallback} if {@code input} fails + * @return A future whose result is taken either from the given {@code input} or by the {@code + * callback} + * @see Futures#catching(ListenableFuture, Class, Function, Executor) + */ public static ApiFuture catching( ApiFuture input, Class exceptionType, @@ -103,7 +145,22 @@ public static ApiFuture catching( return new ListenableFutureToApiFuture(catchingFuture); } - @BetaApi + /** + * Returns a {@link ApiFuture} whose result is taken from the given primary input or, if the + * primary input fails with the given exceptionType, from the result provided by the callback. + * + *

Note that this method is a delegate of {@link Futures#catchingAsync(ListenableFuture, Class, + * AsyncFunction, Executor)} + * + * @param input The primary input {@code ApiFuture} + * @param exceptionType The exception type that triggers use of {@code fallback}. + * @param callback The {@link ApiAsyncFunction} to be called if {@code input} fails with the + * expected * exception type. + * @param executor The executor that runs {@code fallback} if {@code input} fails + * @return A future whose result is taken either from the given {@code input} or by the {@code + * callback} + * @see Futures#catchingAsync(ListenableFuture, Class, AsyncFunction, Executor) + */ public static ApiFuture catchingAsync( ApiFuture input, Class exceptionType, @@ -124,23 +181,57 @@ public ListenableFuture apply(X exception) throws Exception { return new ListenableFutureToApiFuture<>(catchingFuture); } + /** + * Creates a {@code ApiFuture} which has its value set immediately upon construction. + * + *

Note that this method is a delegate of {@link Futures#immediateFuture(Object)}. + * + * @param value The value set to the {@code ApiFuture} upon construction + * @return A future that holds {@code value} + * @see Futures#immediateFuture(Object) + */ public static ApiFuture immediateFuture(V value) { return new ListenableFutureToApiFuture<>(Futures.immediateFuture(value)); } + /** + * Returns a {@code ApiFuture} which has an exception set immediately upon construction. + * + *

Note that this method is a delegate of {@link Futures#immediateFailedFuture(Throwable)}. + * + * @param throwable The exception set to the {@code ApiFuture} upon construction + * @return A future that holds an exception + * @see Futures#immediateFailedFuture(Throwable) + */ public static ApiFuture immediateFailedFuture(Throwable throwable) { return new ListenableFutureToApiFuture(Futures.immediateFailedFuture(throwable)); } + /** + * Creates a {@code ApiFuture} which is cancelled immediately upon construction, so that {@code + * isCancelled()} always returns {@code true}. + * + *

Note that this method is a delegate of {@link Futures#immediateCancelledFuture()}. + * + * @return A cancelled future + * @see Futures#immediateCancelledFuture() + */ public static ApiFuture immediateCancelledFuture() { return new ListenableFutureToApiFuture(Futures.immediateCancelledFuture()); } - /* - * @deprecated Use {@linkplain #transform(ApiFuture, ApiFunction, Executor) the - * overload that requires an executor}. For identical behavior, pass {@link - * com.google.common.util.concurrent.MoreExecutors#directExecutor}, but consider whether - * another executor would be safer. + /** + * Returns a new {@code ApiFuture} whose result is derived from the result of the given {@code + * ApiFuture}. + * + * @param input The future to transform + * @param function A Function to transform the results of the provided future to the results of + * the returned future + * @return A future that holds result of the transformation + * @deprecated Use {@linkplain #transform(ApiFuture, ApiFunction, Executor) the overload that + * requires an executor}. For identical behavior, pass {@link + * com.google.common.util.concurrent.MoreExecutors#directExecutor}, but consider whether + * another executor would be safer. */ @Deprecated public static ApiFuture transform( @@ -148,6 +239,20 @@ public static ApiFuture transform( return transform(input, function, directExecutor()); } + /** + * Returns a new {@code ApiFuture} whose result is derived from the result of the given {@code + * ApiFuture}. + * + *

Note that this method is a delegate of {@link Futures#transform(ListenableFuture, Function, + * Executor)}. + * + * @param input The future to transform + * @param function A Function to transform the results of the provided future to the results of + * the returned future. + * @param executor Executor to run the function in. + * @return A future that holds result of the transformation + * @see Futures#transform(ListenableFuture, Function, Executor) + */ public static ApiFuture transform( ApiFuture input, final ApiFunction function, @@ -159,6 +264,18 @@ public static ApiFuture transform( executor)); } + /** + * Creates a new {@code ApiFuture} whose value is a list containing the values of all its input + * futures, if all succeed. + * + *

The list of results is in the same order as the input list. + * + *

Note that this method is a delegate of {@link Futures#allAsList(Iterable)}. + * + * @param futures Futures to combine + * @return A future that provides a list of the results of the component futures + * @see Futures#allAsList(Iterable) + */ public static ApiFuture> allAsList( Iterable> futures) { return new ListenableFutureToApiFuture<>( @@ -172,6 +289,21 @@ public ListenableFuture apply(ApiFuture apiFuture) { }))); } + /** + * Creates a new {@code ApiFuture} whose value is a list containing the values of all its + * successful input futures. The list of results is in the same order as the input list, and if + * any of the provided futures fails or is canceled, its corresponding position will contain + * {@code null} (which is indistinguishable from the future having a successful value of {@code + * null}). + * + *

The list of results is in the same order as the input list. + * + *

Note that this method is a delegate of {@link Futures#successfulAsList(Iterable)}. + * + * @param futures Futures to combine + * @return A future that provides a list of the results of the component futures + * @see Futures#successfulAsList(Iterable) + */ @BetaApi public static ApiFuture> successfulAsList( Iterable> futures) { @@ -186,11 +318,20 @@ public ListenableFuture apply(ApiFuture apiFuture) { }))); } - /* - * @deprecated Use {@linkplain #transformAsync(ApiFuture, ApiFunction, Executor) the - * overload that requires an executor}. For identical behavior, pass {@link - * com.google.common.util.concurrent.MoreExecutors#directExecutor}, but consider whether - * another executor would be safer. + /** + * Returns a new {@code ApiFuture} whose result is asynchronously derived from the result of the + * given {@code ApiFuture}. If the given {@code Future} fails, the returned {@code ApiFuture} + * fails with the same exception (and the function is not invoked). + * + * @param input The future to transform + * @param function A function to transform the result of the input future to the result of the + * output future + * @return A future that holds result of the function (if the input succeeded) or the original + * input's failure (if not) + * @deprecated Use {@linkplain #transformAsync(ApiFuture, ApiAsyncFunction, Executor)}, the + * overload that requires an executor. For identical behavior, pass {@link + * com.google.common.util.concurrent.MoreExecutors#directExecutor}, but consider whether + * another executor would be safer. */ @Deprecated public static ApiFuture transformAsync( @@ -198,6 +339,22 @@ public static ApiFuture transformAsync( return transformAsync(input, function, directExecutor()); } + /** + * Returns a new {@code ApiFuture} whose result is asynchronously derived from the result of the + * given {@code ApiFuture}. If the given {@code Future} fails, the returned {@code ApiFuture} + * fails with the same exception (and the function is not invoked). + * + *

Note that this method is a delegate of {@link Futures#transformAsync(ListenableFuture, + * AsyncFunction, Executor)}. + * + * @param input The future to transform + * @param function A function to transform the result of the input future to the result of the + * output future + * @param executor Executor to run the function in. + * @return A future that holds result of the function (if the input succeeded) or the original + * input's failure (if not) + * @see Futures#transformAsync(ListenableFuture, AsyncFunction, Executor) + */ public static ApiFuture transformAsync( ApiFuture input, final ApiAsyncFunction function, Executor executor) { ListenableFuture listenableInput = listenableFutureForApiFuture(input); diff --git a/api-common-java/src/main/java/com/google/api/core/ApiService.java b/api-common-java/src/main/java/com/google/api/core/ApiService.java index ee49e78f3c..cd3545d8b9 100644 --- a/api-common-java/src/main/java/com/google/api/core/ApiService.java +++ b/api-common-java/src/main/java/com/google/api/core/ApiService.java @@ -165,7 +165,6 @@ public interface ApiService { * {@code A.compareTo(B) < 0} then there is not guaranteed to be a valid state transition * {@code A -> B}. */ - @BetaApi enum State { /** * A service in this state has encountered a problem and may not be operational. It cannot be @@ -198,7 +197,6 @@ enum State { * *

All methods are no-ops by default, implementors should override the ones they care about. */ - @BetaApi abstract class Listener { /** * Called when the service transitions to the {@linkplain State#FAILED FAILED} state. The diff --git a/api-common-java/src/main/java/com/google/api/core/ListenableFutureToApiFuture.java b/api-common-java/src/main/java/com/google/api/core/ListenableFutureToApiFuture.java index fe77f56d30..5d59da1b71 100644 --- a/api-common-java/src/main/java/com/google/api/core/ListenableFutureToApiFuture.java +++ b/api-common-java/src/main/java/com/google/api/core/ListenableFutureToApiFuture.java @@ -29,6 +29,7 @@ */ package com.google.api.core; +import com.google.common.base.MoreObjects; import com.google.common.util.concurrent.ForwardingListenableFuture.SimpleForwardingListenableFuture; import com.google.common.util.concurrent.ListenableFuture; @@ -39,4 +40,10 @@ public class ListenableFutureToApiFuture extends SimpleForwardingListenableFu public ListenableFutureToApiFuture(ListenableFuture delegate) { super(delegate); } + + public String toString() { + return MoreObjects.toStringHelper(ListenableFutureToApiFuture.class) + .add("delegate", delegate()) + .toString(); + } } diff --git a/api-common-java/src/main/java/com/google/api/core/ObsoleteApi.java b/api-common-java/src/main/java/com/google/api/core/ObsoleteApi.java new file mode 100644 index 0000000000..9dc221964c --- /dev/null +++ b/api-common-java/src/main/java/com/google/api/core/ObsoleteApi.java @@ -0,0 +1,65 @@ +/* + * Copyright 2023, Google Inc. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Google Inc. nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +package com.google.api.core; + +import java.lang.annotation.Documented; +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +/** + * Indicates a public API is obsolete, and will be deprecated in a future version. + * + *

Usage guidelines: + * + *

    + *
  1. This annotation must be used only on APIs with non-private visibility. + *
  2. This annotation should only be added if either an alternative API is provided and/or we + * plan to stop supporting the API in a future version. + *
  3. This annotation must be used with a description. + *
  4. Alternative APIs must be referenced in Javadoc and/or description if possible. + *
+ */ +@BetaApi +@Retention(RetentionPolicy.RUNTIME) +@Target({ + ElementType.ANNOTATION_TYPE, + ElementType.CONSTRUCTOR, + ElementType.FIELD, + ElementType.METHOD, + ElementType.PACKAGE, + ElementType.TYPE +}) +@Documented +public @interface ObsoleteApi { + /** Context information such as reasons and alternatives. */ + String value(); +} diff --git a/api-common-java/src/main/java/com/google/api/pathtemplate/ValidationException.java b/api-common-java/src/main/java/com/google/api/pathtemplate/ValidationException.java index 3efa388f5d..2d778c5e95 100644 --- a/api-common-java/src/main/java/com/google/api/pathtemplate/ValidationException.java +++ b/api-common-java/src/main/java/com/google/api/pathtemplate/ValidationException.java @@ -39,6 +39,7 @@ */ public class ValidationException extends IllegalArgumentException { + @FunctionalInterface public interface Supplier { T get(); } diff --git a/api-common-java/src/test/java/com/google/api/core/ApiFutureToListenableFutureTest.java b/api-common-java/src/test/java/com/google/api/core/ApiFutureToListenableFutureTest.java new file mode 100644 index 0000000000..e835c1cd27 --- /dev/null +++ b/api-common-java/src/test/java/com/google/api/core/ApiFutureToListenableFutureTest.java @@ -0,0 +1,51 @@ +/* + * Copyright 2024, Google Inc. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Google Inc. nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +package com.google.api.core; + +import static com.google.common.truth.Truth.assertThat; + +import org.junit.jupiter.api.Test; + +class ApiFutureToListenableFutureTest { + @Test + void testThatInnerToStringIsNotLost() { + String customInnerToString = "my-custom-inner-tostring"; + ApiFuture apiFuture = + new AbstractApiFuture() { + @Override + public String toString() { + return customInnerToString; + } + }; + ApiFutureToListenableFuture listenableFuture = + new ApiFutureToListenableFuture<>(apiFuture); + assertThat(listenableFuture.toString()).contains(customInnerToString); + } +} diff --git a/api-common-java/src/test/java/com/google/api/core/ApiFuturesTest.java b/api-common-java/src/test/java/com/google/api/core/ApiFuturesTest.java index 34dc41dda2..7019ab17e7 100644 --- a/api-common-java/src/test/java/com/google/api/core/ApiFuturesTest.java +++ b/api-common-java/src/test/java/com/google/api/core/ApiFuturesTest.java @@ -38,12 +38,12 @@ import java.util.concurrent.ExecutionException; import java.util.concurrent.Executor; import java.util.concurrent.atomic.AtomicInteger; -import org.junit.Test; +import org.junit.jupiter.api.Test; -public class ApiFuturesTest { +class ApiFuturesTest { @Test - public void testAddCallback() throws Exception { + void testAddCallback() { final AtomicInteger flag = new AtomicInteger(); SettableApiFuture future = SettableApiFuture.create(); ApiFutures.addCallback( @@ -65,7 +65,7 @@ public void onFailure(Throwable t) { } @Test - public void testCatch() throws Exception { + void testCatch() throws Exception { SettableApiFuture future = SettableApiFuture.create(); ApiFuture fallback = ApiFutures.catching( @@ -83,7 +83,7 @@ public Integer apply(Exception ex) { } @Test - public void testCatchAsync() throws Exception { + void testCatchAsync() throws Exception { SettableApiFuture future = SettableApiFuture.create(); ApiFuture fallback = ApiFutures.catchingAsync( @@ -101,7 +101,7 @@ public ApiFuture apply(Exception ex) { } @Test - public void testTransform() throws Exception { + void testTransform() throws Exception { SettableApiFuture inputFuture = SettableApiFuture.create(); ApiFuture transformedFuture = ApiFutures.transform( @@ -118,7 +118,7 @@ public String apply(Integer input) { } @Test - public void testTransformWithExecutor() throws Exception { + void testTransformWithExecutor() throws Exception { SettableApiFuture inputFuture = SettableApiFuture.create(); final AtomicInteger counter = new AtomicInteger(0); ApiFuture transformedFuture = @@ -143,7 +143,7 @@ public void execute(Runnable command) { } @Test - public void testAllAsList() throws Exception { + void testAllAsList() throws Exception { SettableApiFuture inputFuture1 = SettableApiFuture.create(); SettableApiFuture inputFuture2 = SettableApiFuture.create(); ApiFuture> listFuture = @@ -154,7 +154,7 @@ public void testAllAsList() throws Exception { } @Test - public void successfulAllAsList() throws Exception { + void successfulAllAsList() throws Exception { SettableApiFuture inputFuture1 = SettableApiFuture.create(); SettableApiFuture inputFuture2 = SettableApiFuture.create(); ApiFuture> listFuture = @@ -165,7 +165,7 @@ public void successfulAllAsList() throws Exception { } @Test - public void testTransformAsync() throws Exception { + void testTransformAsync() throws Exception { ApiFuture inputFuture = ApiFutures.immediateFuture(0); ApiFuture outputFuture = ApiFutures.transformAsync( @@ -181,31 +181,24 @@ public ApiFuture apply(Integer input) { } @Test - public void testTransformAsyncWithExecutor() throws Exception { + void testTransformAsyncWithExecutor() throws Exception { ApiFuture inputFuture = ApiFutures.immediateFuture(0); final AtomicInteger counter = new AtomicInteger(0); ApiFuture outputFuture = ApiFutures.transformAsync( inputFuture, - new ApiAsyncFunction() { - @Override - public ApiFuture apply(Integer input) { - return ApiFutures.immediateFuture(input + 1); - } - }, - new Executor() { - @Override - public void execute(Runnable command) { - counter.incrementAndGet(); - command.run(); - } - }); + (ApiAsyncFunction) input -> ApiFutures.immediateFuture(input + 1), + (Executor) + command -> { + counter.incrementAndGet(); + command.run(); + }); assertThat(outputFuture.get()).isEqualTo(1); assertThat(counter.get()).isEqualTo(1); } @Test - public void testImmediateFailedFuture() throws InterruptedException { + void testImmediateFailedFuture() throws InterruptedException { ApiFuture future = ApiFutures.immediateFailedFuture(new IllegalArgumentException("The message")); IllegalArgumentException exception = null; @@ -219,7 +212,7 @@ public void testImmediateFailedFuture() throws InterruptedException { } @Test - public void testImmediateCancelledFuture() throws InterruptedException, ExecutionException { + void testImmediateCancelledFuture() throws InterruptedException, ExecutionException { ApiFuture future = ApiFutures.immediateCancelledFuture(); CancellationException exception = null; try { diff --git a/api-common-java/src/test/java/com/google/api/core/ApiServiceTest.java b/api-common-java/src/test/java/com/google/api/core/ApiServiceTest.java index 19b10af472..8bbfe489a2 100644 --- a/api-common-java/src/test/java/com/google/api/core/ApiServiceTest.java +++ b/api-common-java/src/test/java/com/google/api/core/ApiServiceTest.java @@ -31,12 +31,12 @@ import com.google.common.util.concurrent.MoreExecutors; import java.util.concurrent.atomic.AtomicReference; -import org.junit.Assert; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; -public class ApiServiceTest { +class ApiServiceTest { @Test - public void testNoopService() { + void testNoopService() { ApiService service = new AbstractApiService() { @Override @@ -50,12 +50,12 @@ protected void doStart() { } }; service.startAsync().awaitRunning(); - Assert.assertTrue(service.isRunning()); + Assertions.assertTrue(service.isRunning()); service.stopAsync().awaitTerminated(); } @Test - public void testFailingService() { + void testFailingService() { final AtomicReference savedFailure = new AtomicReference<>(); ApiService service = new AbstractApiService() { @@ -86,8 +86,8 @@ public void failed(ApiService.State from, Throwable failure) { // Expected } - Assert.assertEquals(service.state(), ApiService.State.FAILED); - Assert.assertEquals(savedFailure.get().getMessage(), "this service always fails"); - Assert.assertEquals(service.failureCause().getMessage(), "this service always fails"); + Assertions.assertEquals(service.state(), ApiService.State.FAILED); + Assertions.assertEquals(savedFailure.get().getMessage(), "this service always fails"); + Assertions.assertEquals(service.failureCause().getMessage(), "this service always fails"); } } diff --git a/api-common-java/src/test/java/com/google/api/core/ListenableFutureToApiFutureTest.java b/api-common-java/src/test/java/com/google/api/core/ListenableFutureToApiFutureTest.java index 9bc06dae07..3e8d2827d3 100644 --- a/api-common-java/src/test/java/com/google/api/core/ListenableFutureToApiFutureTest.java +++ b/api-common-java/src/test/java/com/google/api/core/ListenableFutureToApiFutureTest.java @@ -30,16 +30,34 @@ package com.google.api.core; import com.google.common.truth.Truth; +import com.google.common.util.concurrent.AbstractFuture; +import com.google.common.util.concurrent.ListenableFuture; import com.google.common.util.concurrent.SettableFuture; -import org.junit.Test; +import org.junit.jupiter.api.Test; -public class ListenableFutureToApiFutureTest { +class ListenableFutureToApiFutureTest { @Test - public void testGet() throws Exception { + void testGet() throws Exception { SettableFuture future = SettableFuture.create(); ListenableFutureToApiFuture apiFuture = new ListenableFutureToApiFuture<>(future); future.set(3); Truth.assertThat(apiFuture.get()).isEqualTo(3); } + + @Test + void testToStringShowsUnderlyingFutureToString() { + String customInnerFutureDesc = "my-custom-toString-impl"; + ListenableFuture listenableFuture = + new AbstractFuture() { + @Override + public String toString() { + return customInnerFutureDesc; + } + }; + + ListenableFutureToApiFuture apiFuture = + new ListenableFutureToApiFuture<>(listenableFuture); + Truth.assertThat(apiFuture.toString()).contains(customInnerFutureDesc); + } } diff --git a/api-common-java/src/test/java/com/google/api/core/SettableApiFutureTest.java b/api-common-java/src/test/java/com/google/api/core/SettableApiFutureTest.java index a4cff9b086..0278b0b933 100644 --- a/api-common-java/src/test/java/com/google/api/core/SettableApiFutureTest.java +++ b/api-common-java/src/test/java/com/google/api/core/SettableApiFutureTest.java @@ -34,11 +34,12 @@ import java.util.concurrent.Executor; import java.util.concurrent.TimeUnit; import java.util.concurrent.atomic.AtomicInteger; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; -public class SettableApiFutureTest { +class SettableApiFutureTest { @Test - public void testSet() throws Exception { + void testSet() throws Exception { SettableApiFuture future = SettableApiFuture.create(); Truth.assertThat(future.isDone()).isFalse(); future.set(42); @@ -48,7 +49,7 @@ public void testSet() throws Exception { } @Test - public void testCancel() throws Exception { + void testCancel() { SettableApiFuture future = SettableApiFuture.create(); Truth.assertThat(future.isDone()).isFalse(); Truth.assertThat(future.isCancelled()).isFalse(); @@ -57,15 +58,19 @@ public void testCancel() throws Exception { Truth.assertThat(future.isCancelled()).isTrue(); } - @Test(expected = ExecutionException.class) - public void testException() throws Exception { - SettableApiFuture future = SettableApiFuture.create(); - future.setException(new Exception()); - future.get(); + @Test + void testException() { + Assertions.assertThrows( + ExecutionException.class, + () -> { + SettableApiFuture future = SettableApiFuture.create(); + future.setException(new Exception()); + future.get(); + }); } @Test - public void testListener() throws Exception { + void testListener() { final AtomicInteger flag = new AtomicInteger(); SettableApiFuture future = SettableApiFuture.create(); future.addListener( diff --git a/api-common-java/src/test/java/com/google/api/pathtemplate/PathTemplateTest.java b/api-common-java/src/test/java/com/google/api/pathtemplate/PathTemplateTest.java index 47747a1159..6ac45cdf20 100644 --- a/api-common-java/src/test/java/com/google/api/pathtemplate/PathTemplateTest.java +++ b/api-common-java/src/test/java/com/google/api/pathtemplate/PathTemplateTest.java @@ -32,40 +32,34 @@ import com.google.common.collect.ImmutableMap; import com.google.common.truth.Truth; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; import java.util.Map; import java.util.Set; -import org.junit.Rule; -import org.junit.Test; -import org.junit.rules.ExpectedException; -import org.junit.runner.RunWith; -import org.junit.runners.JUnit4; +import java.util.stream.Stream; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.MethodSource; /** Tests for {@link PathTemplate}. */ -@RunWith(JUnit4.class) -public class PathTemplateTest { - - @Rule public ExpectedException thrown = ExpectedException.none(); +class PathTemplateTest { // Match // ===== @Test - public void matchAtomicResourceName() { + void matchAtomicResourceName() { PathTemplate template = PathTemplate.create("buckets/*/*/objects/*"); assertPositionalMatch(template.match("buckets/f/o/objects/bar"), "f", "o", "bar"); } @Test - public void matchTemplateWithUnboundedWildcard() { + void matchTemplateWithUnboundedWildcard() { PathTemplate template = PathTemplate.create("buckets/*/objects/**"); assertPositionalMatch(template.match("buckets/foo/objects/bar/baz"), "foo", "bar/baz"); } @Test - public void matchWithForcedHostName() { + void matchWithForcedHostName() { PathTemplate template = PathTemplate.create("buckets/*/objects/*"); Map match = template.matchFromFullName("somewhere.io/buckets/b/objects/o"); Truth.assertThat(match).isNotNull(); @@ -75,7 +69,7 @@ public void matchWithForcedHostName() { } @Test - public void matchWithHostName() { + void matchWithHostName() { PathTemplate template = PathTemplate.create("buckets/*/objects/*"); Map match = template.match("//somewhere.io/buckets/b/objects/o"); Truth.assertThat(match).isNotNull(); @@ -85,7 +79,7 @@ public void matchWithHostName() { } @Test - public void matchWithHostNameAndProtocol() { + void matchWithHostNameAndProtocol() { PathTemplate template = PathTemplate.create("projects/{project}/zones/{zone}"); Map match = template.match( @@ -97,7 +91,7 @@ public void matchWithHostNameAndProtocol() { } @Test - public void matchWithHostNameAndProtocolWithTemplateStartWithBinding() { + void matchWithHostNameAndProtocolWithTemplateStartWithBinding() { PathTemplate template = PathTemplate.create("{project}/zones/{zone}"); Map match = template.match( @@ -109,7 +103,7 @@ public void matchWithHostNameAndProtocolWithTemplateStartWithBinding() { } @Test - public void pathWildcards_matchZeroOrMoreSegments() { + void pathWildcards_matchZeroOrMoreSegments() { PathTemplate start = PathTemplate.create("{glob=**}/b"); PathTemplate middle = PathTemplate.create("a/{glob=**}/b"); PathTemplate end = PathTemplate.create("a/{glob=**}"); @@ -136,7 +130,7 @@ public void pathWildcards_matchZeroOrMoreSegments() { } @Test - public void pathWildcard_canMatchTheEmptyString() { + void pathWildcard_canMatchTheEmptyString() { PathTemplate template = PathTemplate.create("{glob=**}"); Truth.assertThat(template.match("").get("glob")).isEmpty(); @@ -145,7 +139,7 @@ public void pathWildcard_canMatchTheEmptyString() { } @Test - public void matchWithCustomMethod() { + void matchWithCustomMethod() { PathTemplate template = PathTemplate.create("buckets/*/objects/*:custom"); Map match = template.match("buckets/b/objects/o:custom"); Truth.assertThat(match).isNotNull(); @@ -154,31 +148,31 @@ public void matchWithCustomMethod() { } @Test - public void matchFailWhenPathMismatch() { + void matchFailWhenPathMismatch() { PathTemplate template = PathTemplate.create("buckets/*/*/objects/*"); Truth.assertThat(template.match("buckets/f/o/o/objects/bar")).isNull(); } @Test - public void matchFailWhenPathTooShort() { + void matchFailWhenPathTooShort() { PathTemplate template = PathTemplate.create("buckets/*/*/objects/*"); Truth.assertThat(template.match("buckets/f/o/objects")).isNull(); } @Test - public void matchFailWhenPathTooLong() { + void matchFailWhenPathTooLong() { PathTemplate template = PathTemplate.create("buckets/*/*/objects/*"); Truth.assertThat(template.match("buckets/f/o/objects/too/long")).isNull(); } @Test - public void matchWithUnboundInMiddle() { + void matchWithUnboundInMiddle() { PathTemplate template = PathTemplate.create("bar/**/foo/*"); assertPositionalMatch(template.match("bar/foo/foo/foo/bar"), "foo/foo", "bar"); } @Test - public void matchWithNamedBindings() { + void matchWithNamedBindings() { PathTemplate template = PathTemplate.create("projects/*/{instance_id=instances/*}/**"); Map actual = template.match("projects/proj_foo/instances/instance_bar/table/table_baz"); @@ -186,7 +180,7 @@ public void matchWithNamedBindings() { } @Test - public void matchFailWithNamedBindingsWhenPathMismatches() { + void matchFailWithNamedBindingsWhenPathMismatches() { PathTemplate template = PathTemplate.create("projects/*/{instance_id=instances/*}/**"); Map actual = template.match("projects/proj_foo/instances_fail/instance_bar/table/table_baz"); @@ -194,21 +188,21 @@ public void matchFailWithNamedBindingsWhenPathMismatches() { } @Test - public void matchWithNamedBindingsThatHasOnlyWildcard() { + void matchWithNamedBindingsThatHasOnlyWildcard() { PathTemplate template = PathTemplate.create("profiles/{routing_id=*}"); Map actual = template.match("profiles/prof_qux"); Truth.assertThat(actual).containsEntry("routing_id", "prof_qux"); } @Test - public void matchFailWithNamedBindingsThatHasOnlyWildcardWhenPathMismatches() { + void matchFailWithNamedBindingsThatHasOnlyWildcardWhenPathMismatches() { PathTemplate template = PathTemplate.create("profiles/{routing_id=*}"); Map actual = template.match("profiles/prof_qux/fail"); Truth.assertThat(actual).isNull(); } @Test - public void matchWithCustomVerbs() { + void matchWithCustomVerbs() { PathTemplate template = PathTemplate.create("**:foo"); assertPositionalMatch(template.match("a/b/c:foo"), "a/b/c"); } @@ -217,7 +211,7 @@ public void matchWithCustomVerbs() { // ======== @Test - public void complexResourceIdBasicCases() { + void complexResourceIdBasicCases() { // Separate by "~". PathTemplate template = PathTemplate.create("projects/{project}/zones/{zone_a}~{zone_b}"); Map match = @@ -256,7 +250,7 @@ public void complexResourceIdBasicCases() { } @Test - public void complexResourceIdCustomVerb() { + void complexResourceIdCustomVerb() { // Separate by "~". PathTemplate template = PathTemplate.create("projects/{project}/zones/{zone_a}~{zone_b}:hello"); Map match = @@ -295,7 +289,7 @@ public void complexResourceIdCustomVerb() { } @Test - public void complexResourceIdEqualsWildcard() { + void complexResourceIdEqualsWildcard() { PathTemplate template = PathTemplate.create("projects/{project=*}/zones/{zone_a=*}~{zone_b=*}"); Map match = template.match("projects/project-123/zones/europe-west3-c~us-east3-a"); @@ -307,21 +301,19 @@ public void complexResourceIdEqualsWildcard() { } @Test - public void complexResourceIdEqualsPathWildcard() { - thrown.expect(ValidationException.class); - PathTemplate template = PathTemplate.create("projects/{project=*}/zones/{zone_a=**}~{zone_b}"); - thrown.expectMessage( - String.format( - "parse error: wildcard path not allowed in complex ID resource '%s'", "zone_a")); - - template = PathTemplate.create("projects/{project=*}/zones/{zone_a}.{zone_b=**}"); - thrown.expectMessage( + void complexResourceIdEqualsPathWildcard() { + Exception exception = + Assertions.assertThrows( + ValidationException.class, + () -> PathTemplate.create("projects/{project=*}/zones/{zone_a=**}~{zone_b}")); + Assertions.assertEquals( String.format( - "parse error: wildcard path not allowed in complex ID resource '%s'", "zone_b")); + "parse error: wildcard path not allowed in complex ID resource '%s'", "zone_a"), + exception.getMessage()); } @Test - public void complexResourceIdMissingMatches() { + void complexResourceIdMissingMatches() { PathTemplate template = PathTemplate.create("projects/{project}/zones/{zone_a}~{zone_b}"); Truth.assertThat(template.match("projects/project-123/zones/europe-west3-c")).isNull(); @@ -337,39 +329,61 @@ public void complexResourceIdMissingMatches() { } @Test - public void complexResourceIdNoSeparator() { - thrown.expect(ValidationException.class); - PathTemplate.create("projects/{project}/zones/{zone_a}{zone_b}"); - thrown.expectMessage( + void complexResourceIdNoSeparator() { + Exception exception = + Assertions.assertThrows( + ValidationException.class, + () -> PathTemplate.create("projects/{project}/zones/{zone_a}{zone_b}")); + Assertions.assertEquals( String.format( "parse error: missing or 2+ consecutive delimiter characters in '%s'", - "{zone_a}{zone_b}")); - - PathTemplate.create("projects/{project}/zones/{zone_a}_{zone_b}{zone_c}"); - thrown.expectMessage( + "{zone_a}{zone_b}"), + exception.getMessage()); + + exception = + Assertions.assertThrows( + ValidationException.class, + () -> PathTemplate.create("projects/{project}/zones/{zone_a}_{zone_b}{zone_c}")); + Assertions.assertEquals( String.format( "parse error: missing or 2+ consecutive delimiter characters in '%s'", - "{zone_a}_{zone_b}{zone_c}")); - } - - @Test - public void complexResourceIdInvalidDelimiter() { - thrown.expect(ValidationException.class); - // Not a comprehensive set of invalid delimiters, please check the class's defined pattern. - List someInvalidDelimiters = - new ArrayList<>(Arrays.asList("|", "!", "@", "a", "1", ",", "{", ")")); - for (String invalidDelimiter : someInvalidDelimiters) { - PathTemplate.create( - String.format("projects/{project=*}/zones/{zone_a}%s{zone_b}", invalidDelimiter)); - thrown.expectMessage( - String.format( - "parse error: invalid complex resource ID delimiter character in '%s'", - String.format("{zone_a}%s{zone_b}", invalidDelimiter))); - } + "{zone_a}_{zone_b}{zone_c}"), + exception.getMessage()); + + exception = + Assertions.assertThrows( + ValidationException.class, + () -> PathTemplate.create("projects/{project=*}/zones/{zone_a}{{zone_b}")); + Assertions.assertEquals( + String.format( + "parse error: missing or 2+ consecutive delimiter characters in '%s'", + "{zone_a}{{zone_b}"), + exception.getMessage()); + } + + @ParameterizedTest + @MethodSource("invalidDelimiters") + void complexResourceIdInvalidDelimiter(String invalidDelimiter) { + ValidationException exception = + Assertions.assertThrows( + ValidationException.class, + () -> + PathTemplate.create( + String.format( + "projects/{project=*}/zones/{zone_a}%s{zone_b}", invalidDelimiter))); + Assertions.assertEquals( + String.format( + "parse error: invalid complex resource ID delimiter character in '%s'", + String.format("zone_a}%s{zone_b}", invalidDelimiter)), + exception.getMessage()); + } + + static Stream invalidDelimiters() { + return Stream.of("|", "!", "@", "a", "1", ",", ")"); } @Test - public void complexResourceIdMixedSeparators() { + void complexResourceIdMixedSeparators() { // Separate by a mix of delimiters. PathTemplate template = PathTemplate.create("projects/{project}/zones/{zone_a}~{zone_b}.{zone_c}-{zone_d}"); @@ -398,7 +412,7 @@ public void complexResourceIdMixedSeparators() { } @Test - public void collectionWildcardMatchingInParent() { + void collectionWildcardMatchingInParent() { PathTemplate template = PathTemplate.create("v1/publishers/-/books/{book}"); Map match = template.match( @@ -411,19 +425,22 @@ public void collectionWildcardMatchingInParent() { } @Test - public void collectionWildcardMatchingInvalid() { - thrown.expect(ValidationException.class); - PathTemplate.create("v1/publishers/{publisher}/books/-"); + void collectionWildcardMatchingInvalid() { + ValidationException exception = + Assertions.assertThrows( + ValidationException.class, + () -> PathTemplate.create("v1/publishers/{publisher}/books/-")); } + ; @Test - public void complexResourceIdPubSubDeletedTopic() { + void complexResourceIdPubSubDeletedTopic() { PathTemplate template = PathTemplate.create("_deleted-topic_"); Truth.assertThat(template).isNotNull(); } @Test - public void complexResourceIdInParent() { + void complexResourceIdInParent() { // One parent has a complex resource ID. PathTemplate template = PathTemplate.create( @@ -458,7 +475,7 @@ public void complexResourceIdInParent() { } @Test - public void complexResourcePathTemplateVariables() { + void complexResourcePathTemplateVariables() { String pattern = "projects/{foo}_{bar}/zones/{zone_a}-{zone_b}_{zone_c}/machines/{cell1}.{cell2}"; PathTemplate template = PathTemplate.create(pattern); @@ -478,57 +495,77 @@ public void complexResourcePathTemplateVariables() { } @Test - public void complexResourceBasicInvalidIds() { - thrown.expect(ValidationException.class); - PathTemplate.create("projects/*/zones/~{zone_a}"); - thrown.expectMessage( - String.format("parse error: invalid begin or end character in '%s'", "~{zone_a}")); - - PathTemplate.create("projects/*/zones/{zone_a}~"); - thrown.expectMessage( - String.format("parse error: invalid begin or end character in '%s'", "{zone_a}~")); - - PathTemplate.create("projects/*/zones/.{zone_a}"); - thrown.expectMessage( - String.format("parse error: invalid begin or end character in '%s'", ".{zone_a}")); - - PathTemplate.create("projects/*/zones/{zone_a}."); - thrown.expectMessage( - String.format("parse error: invalid begin or end character in '%s'", "{zone_a}.")); - - PathTemplate.create("projects/*/zones/-{zone_a}"); - thrown.expectMessage( - String.format("parse error: invalid begin or end character in '%s'", "-{zone_a}")); - - PathTemplate.create("projects/*/zones/{zone_a}-"); - thrown.expectMessage( - String.format("parse error: invalid begin or end character in '%s'", "{zone_a}-")); - - PathTemplate.create("projects/*/zones/_{zone_a}"); - thrown.expectMessage( - String.format("parse error: invalid begin or end character in '%s'", "{zone_a}_")); - - PathTemplate.create("projects/*/zones/{zone_a}_"); - thrown.expectMessage( - String.format("parse error: invalid begin or end character in '%s'", "{zone_a}_")); - } - - @Test - public void complexResourceMultipleDelimiters() { - thrown.expect(ValidationException.class); - - PathTemplate.create("projects/*/zones/{zone_a}~.{zone_b}"); - thrown.expectMessage( + void complexResourceBasicInvalidIds() { + ValidationException exception = + Assertions.assertThrows( + ValidationException.class, () -> PathTemplate.create("projects/*/zones/~{zone_a}")); + Assertions.assertEquals( + String.format("parse error: invalid begin or end character in '%s'", "~{zone_a}"), + exception.getMessage()); + exception = + Assertions.assertThrows( + ValidationException.class, () -> PathTemplate.create("projects/*/zones/{zone_a}~")); + Assertions.assertEquals( + String.format("parse error: invalid begin or end character in '%s'", "{zone_a}~"), + exception.getMessage()); + exception = + Assertions.assertThrows( + ValidationException.class, () -> PathTemplate.create("projects/*/zones/.{zone_a}")); + Assertions.assertEquals( + String.format("parse error: invalid begin or end character in '%s'", ".{zone_a}"), + exception.getMessage()); + exception = + Assertions.assertThrows( + ValidationException.class, () -> PathTemplate.create("projects/*/zones/{zone_a}.")); + Assertions.assertEquals( + String.format("parse error: invalid begin or end character in '%s'", "{zone_a}."), + exception.getMessage()); + exception = + Assertions.assertThrows( + ValidationException.class, () -> PathTemplate.create("projects/*/zones/-{zone_a}")); + Assertions.assertEquals( + String.format("parse error: invalid begin or end character in '%s'", "-{zone_a}"), + exception.getMessage()); + exception = + Assertions.assertThrows( + ValidationException.class, () -> PathTemplate.create("projects/*/zones/{zone_a}-")); + Assertions.assertEquals( + String.format("parse error: invalid begin or end character in '%s'", "{zone_a}-"), + exception.getMessage()); + exception = + Assertions.assertThrows( + ValidationException.class, () -> PathTemplate.create("projects/*/zones/_{zone_a}")); + Assertions.assertEquals( + String.format("parse error: invalid begin or end character in '%s'", "_{zone_a}"), + exception.getMessage()); + exception = + Assertions.assertThrows( + ValidationException.class, () -> PathTemplate.create("projects/*/zones/{zone_a}_")); + Assertions.assertEquals( + String.format("parse error: invalid begin or end character in '%s'", "{zone_a}_"), + exception.getMessage()); + } + + @Test + void complexResourceMultipleDelimiters() { + ValidationException exception = + Assertions.assertThrows( + ValidationException.class, + () -> PathTemplate.create("projects/*/zones/{zone_a}~.{zone_b}")); + Assertions.assertEquals( String.format( "parse error: missing or 2+ consecutive delimiter characters in '%s'", - "{zone_a}~.{zone_b}")); - - PathTemplate.create("projects/*/zones/{zone_a}~{zone_b}..{zone_c}"); - thrown.expectMessage( + "{zone_a}~.{zone_b}"), + exception.getMessage()); + exception = + Assertions.assertThrows( + ValidationException.class, + () -> PathTemplate.create("projects/*/zones/{zone_a}~{zone_b}..{zone_c}")); + Assertions.assertEquals( String.format( "parse error: missing or 2+ consecutive delimiter characters in '%s'", - "{zone_a}~{zone_b}..{zone_c}")); - + "{zone_a}~{zone_b}..{zone_c}"), + exception.getMessage()); String pathString = "projects/project_123/zones/lorum~ipsum"; PathTemplate template = PathTemplate.create("projects/*/zones/{zone_.~-a}~{zone_b}"); template.validate(pathString, ""); @@ -543,7 +580,7 @@ public void complexResourceMultipleDelimiters() { // ======== @Test - public void validateSuccess() { + void validateSuccess() { String templateString = "buckets/*/objects/*"; String pathString = "buckets/bucket/objects/object"; PathTemplate template = PathTemplate.create(templateString); @@ -552,18 +589,19 @@ public void validateSuccess() { } @Test - public void validateFailure() { - thrown.expect(ValidationException.class); + void validateFailure() { String templateString = "buckets/*/objects/*"; String pathString = "buckets/bucket/invalid/object"; - thrown.expectMessage( - String.format("Parameter \"%s\" must be in the form \"%s\"", pathString, templateString)); PathTemplate template = PathTemplate.create(templateString); - template.validate(pathString, ""); + ValidationException exception = + Assertions.assertThrows(ValidationException.class, () -> template.validate(pathString, "")); + Assertions.assertEquals( + String.format(": Parameter \"%s\" must be in the form \"%s\"", pathString, templateString), + exception.getMessage()); } @Test - public void validateMatchSuccess() { + void validateMatchSuccess() { String templateString = "buckets/*/objects/{object_id}"; String pathString = "buckets/bucket/objects/object"; PathTemplate template = PathTemplate.create(templateString); @@ -573,62 +611,65 @@ public void validateMatchSuccess() { } @Test - public void validateMatchFailure() { - thrown.expect(ValidationException.class); + void validateMatchFailure() { String templateString = "buckets/*/objects/*"; String pathString = "buckets/bucket/invalid/object"; - thrown.expectMessage( - String.format("Parameter \"%s\" must be in the form \"%s\"", pathString, templateString)); PathTemplate template = PathTemplate.create(templateString); - template.validatedMatch(pathString, ""); + ValidationException exception = + Assertions.assertThrows( + ValidationException.class, () -> template.validatedMatch(pathString, "")); + Assertions.assertEquals( + String.format(": Parameter \"%s\" must be in the form \"%s\"", pathString, templateString), + exception.getMessage()); } // Instantiate // =========== @Test - public void instantiateAtomicResource() { + void instantiateAtomicResource() { PathTemplate template = PathTemplate.create("buckets/*/*/*/objects/*"); String url = template.instantiate("$0", "f", "$1", "o", "$2", "o", "$3", "bar"); Truth.assertThat(url).isEqualTo("buckets/f/o/o/objects/bar"); } @Test - public void instantiateEscapeUnsafeChar() { + void instantiateEscapeUnsafeChar() { PathTemplate template = PathTemplate.create("buckets/*/objects/*"); Truth.assertThat(template.instantiate("$0", "f/o/o", "$1", "b/a/r")) .isEqualTo("buckets/f%2Fo%2Fo/objects/b%2Fa%2Fr"); } @Test - public void instantiateNotEscapeForUnboundedWildcard() { + void instantiateNotEscapeForUnboundedWildcard() { PathTemplate template = PathTemplate.create("buckets/*/objects/**"); Truth.assertThat(template.instantiate("$0", "f/o/o", "$1", "b/a/r")) .isEqualTo("buckets/f%2Fo%2Fo/objects/b/a/r"); } @Test - public void instantiateFailWhenTooFewVariables() { - thrown.expect(ValidationException.class); + void instantiateFailWhenTooFewVariables() { PathTemplate template = PathTemplate.create("buckets/*/*/*/objects/*"); - template.instantiate("$0", "f", "1", "o"); + ValidationException exception = + Assertions.assertThrows( + ValidationException.class, () -> template.instantiate("$0", "f", "1", "o")); } @Test - public void instantiateWithUnboundInMiddle() { + void instantiateWithUnboundInMiddle() { PathTemplate template = PathTemplate.create("bar/**/foo/*"); Truth.assertThat(template.instantiate("$0", "1/2", "$1", "3")).isEqualTo("bar/1/2/foo/3"); } @Test - public void instantiatePartial() { + void instantiatePartial() { PathTemplate template = PathTemplate.create("bar/*/foo/*"); String instance = template.instantiatePartial(ImmutableMap.of("$0", "_1")); Truth.assertThat(instance).isEqualTo("bar/_1/foo/*"); } @Test - public void instantiateWithHostName() { + void instantiateWithHostName() { PathTemplate template = PathTemplate.create("bar/*"); String instance = template.instantiate( @@ -637,43 +678,46 @@ public void instantiateWithHostName() { } @Test - public void instantiateEscapeUnsafeCharNoEncoding() { - thrown.expect(ValidationException.class); - thrown.expectMessage("Invalid character \"/\" in path section \"f/o/o\"."); + void instantiateEscapeUnsafeCharNoEncoding() { PathTemplate template = PathTemplate.createWithoutUrlEncoding("buckets/*/objects/*"); - template.instantiate("$0", "f/o/o", "$1", "b/a/r"); + ValidationException exception = + Assertions.assertThrows( + ValidationException.class, () -> template.instantiate("$0", "f/o/o", "$1", "b/a/r")); + Assertions.assertEquals( + String.format("Invalid character \"/\" in path section \"f/o/o\"."), + exception.getMessage()); } @Test - public void instantiateNotEscapeForUnboundedWildcardNoEncoding() { + void instantiateNotEscapeForUnboundedWildcardNoEncoding() { PathTemplate template = PathTemplate.createWithoutUrlEncoding("buckets/*/objects/**"); Truth.assertThat(template.instantiate("$0", "foo", "$1", "b/a/r")) .isEqualTo("buckets/foo/objects/b/a/r"); } @Test - public void instantiateWithGoogProject() { + void instantiateWithGoogProject() { PathTemplate template = PathTemplate.create("projects/{project}"); String instance = template.instantiate(ImmutableMap.of("project", "google.com:test-proj")); Truth.assertThat(instance).isEqualTo("projects/google.com%3Atest-proj"); } @Test - public void instantiateWithGoogProjectNoEncoding() { + void instantiateWithGoogProjectNoEncoding() { PathTemplate template = PathTemplate.createWithoutUrlEncoding("projects/{project}"); String instance = template.instantiate(ImmutableMap.of("project", "google.com:test-proj")); Truth.assertThat(instance).isEqualTo("projects/google.com:test-proj"); } @Test - public void instantiateWithUnusualCharactersNoEncoding() { + void instantiateWithUnusualCharactersNoEncoding() { PathTemplate template = PathTemplate.createWithoutUrlEncoding("bar/*"); String instance = template.instantiate(ImmutableMap.of("$0", "asdf:;`~,.<>[]!@#$%^&*()")); Truth.assertThat(instance).isEqualTo("bar/asdf:;`~,.<>[]!@#$%^&*()"); } @Test - public void instantiateWithComplexResourceId_basic() { + void instantiateWithComplexResourceId_basic() { PathTemplate template = PathTemplate.create("projects/{project}/zones/{zone_a}~{zone_b}"); String instance = template.instantiate("project", "a/b/c", "zone_a", "apple", "zone_b", "baseball"); @@ -681,7 +725,7 @@ public void instantiateWithComplexResourceId_basic() { } @Test - public void instantiateWithComplexResourceId_customVerb() { + void instantiateWithComplexResourceId_customVerb() { PathTemplate template = PathTemplate.create("projects/{project}/zones/{zone_a}~{zone_b}:hello"); String instance = template.instantiate("project", "a/b/c", "zone_a", "apple", "zone_b", "baseball"); @@ -693,7 +737,7 @@ public void instantiateWithComplexResourceId_customVerb() { } @Test - public void instantiateWithComplexResourceId_mixedSeparators() { + void instantiateWithComplexResourceId_mixedSeparators() { PathTemplate template = PathTemplate.create( "projects/{project}/zones/{zone_a}~{zone_b}.{zone_c}-{zone_d}~{zone_e}"); @@ -717,7 +761,7 @@ public void instantiateWithComplexResourceId_mixedSeparators() { } @Test - public void instantiateWithComplexResourceId_mixedSeparatorsInParent() { + void instantiateWithComplexResourceId_mixedSeparatorsInParent() { PathTemplate template = PathTemplate.create("projects/{project_a}~{project_b}.{project_c}/zones/{zone_a}~{zone_b}"); String instance = @@ -736,7 +780,7 @@ public void instantiateWithComplexResourceId_mixedSeparatorsInParent() { } @Test - public void instantiateWithCustomVerbs() { + void instantiateWithCustomVerbs() { PathTemplate template = PathTemplate.create("/v1/{name=operations/**}:cancel"); String templateInstance = template.instantiate("name", "operations/3373707"); Truth.assertThat(templateInstance).isEqualTo("v1/operations/3373707:cancel"); @@ -744,7 +788,7 @@ public void instantiateWithCustomVerbs() { } @Test - public void instantiateWithASegmentStartsWithADelimiter() { + void instantiateWithASegmentStartsWithADelimiter() { PathTemplate pathTemplate = PathTemplate.create( "v1beta1/{parent=projects/*/locations/*/clusters/*}/.well-known/openid-configuration"); @@ -754,17 +798,20 @@ public void instantiateWithASegmentStartsWithADelimiter() { } @Test - public void instantiateWithASegmentContainingComplexResourceNamesAndStartsWithADelimiter() { - thrown.expect(ValidationException.class); - PathTemplate.create( - "v1beta1/{parent=projects/*/locations/*/clusters/*}/.{well}-{known}/openid-configuration"); - thrown.expectMessage( - String.format("parse error: invalid begin or end character in '%s'", ".{well}-{known}")); + void instantiateWithASegmentContainingComplexResourceNamesAndStartsWithADelimiter() { + ValidationException exception = + Assertions.assertThrows( + ValidationException.class, + () -> + PathTemplate.create( + "v1beta1/{parent=projects/*/locations/*/clusters/*}/.{well}-{known}/openid-configuration")); + Assertions.assertEquals( + String.format("parse error: invalid begin or end character in '%s'", ".{well}-{known}"), + exception.getMessage()); } @Test - public void - instantiateWithASegmentContainingNoComplexResourceNamesAndStartsWithMultipleDelimiters() { + void instantiateWithASegmentContainingNoComplexResourceNamesAndStartsWithMultipleDelimiters() { PathTemplate pathTemplate = PathTemplate.create( "v1beta1/{parent=projects/*/locations/*/clusters/*}/.-~well-known/openid-configuration"); @@ -774,21 +821,25 @@ public void instantiateWithASegmentContainingComplexResourceNamesAndStartsWithAD } @Test - public void instantiateWithASegmentOnlyContainingOneDelimiter() { - thrown.expect(ValidationException.class); - PathTemplate.create("v1/publishers/{publisher}/books/."); - thrown.expectMessage(String.format("parse error: invalid begin or end character in '%s'", ".")); + void instantiateWithASegmentOnlyContainingOneDelimiter() { + ValidationException exception = + Assertions.assertThrows( + ValidationException.class, + () -> PathTemplate.create("v1/publishers/{publisher}/books/.")); + Assertions.assertEquals( + String.format("parse error: invalid begin or end character in '%s'", "."), + exception.getMessage()); } @Test - public void instantiateWithASegmentOnlyContainingOneCharacter() { + void instantiateWithASegmentOnlyContainingOneCharacter() { PathTemplate pathTemplate = PathTemplate.create("v1/publishers/{publisher}/books/a"); String pattern = "v1/publishers/o'reilly/books/a"; Truth.assertThat(pathTemplate.matches(pattern)).isTrue(); } @Test - public void instantiateWithASegmentEndsWithADelimiter() { + void instantiateWithASegmentEndsWithADelimiter() { PathTemplate pathTemplate = PathTemplate.create( "v1beta1/{parent=projects/*/locations/*/clusters/*}/well-known./openid-configuration"); @@ -798,17 +849,20 @@ public void instantiateWithASegmentEndsWithADelimiter() { } @Test - public void instantiateWithASegmentContainingComplexResourceNamesAndEndsWithADelimiter() { - thrown.expect(ValidationException.class); - PathTemplate.create( - "v1beta1/{parent=projects/*/locations/*/clusters/*}/{well}-{known}./openid-configuration"); - thrown.expectMessage( - String.format("parse error: invalid begin or end character in '%s'", "{well}-{known}.")); + void instantiateWithASegmentContainingComplexResourceNamesAndEndsWithADelimiter() { + ValidationException exception = + Assertions.assertThrows( + ValidationException.class, + () -> + PathTemplate.create( + "v1beta1/{parent=projects/*/locations/*/clusters/*}/{well}-{known}./openid-configuration")); + Assertions.assertEquals( + String.format("parse error: invalid begin or end character in '%s'", "{well}-{known}."), + exception.getMessage()); } @Test - public void - instantiateWithASegmentContainingNoComplexResourceNamesAndEndsWithMultipleDelimiters() { + void instantiateWithASegmentContainingNoComplexResourceNamesAndEndsWithMultipleDelimiters() { PathTemplate pathTemplate = PathTemplate.create( "v1beta1/{parent=projects/*/locations/*/clusters/*}/well-known.-~/openid-configuration"); @@ -821,20 +875,20 @@ public void instantiateWithASegmentContainingComplexResourceNamesAndEndsWithADel // ===== @Test - public void testMultiplePathWildcardFailure() { - thrown.expect(IllegalArgumentException.class); - PathTemplate.create("bar/**/{name=foo/**}:verb"); + void testMultiplePathWildcardFailure() { + Assertions.assertThrows( + IllegalArgumentException.class, () -> PathTemplate.create("bar/**/{name=foo/**}:verb")); } @Test - public void testTemplateWithSimpleBinding() { + void testTemplateWithSimpleBinding() { PathTemplate template = PathTemplate.create("/v1/messages/{message_id}"); String url = template.instantiate("message_id", "mymessage"); Truth.assertThat(url).isEqualTo("v1/messages/mymessage"); } @Test - public void testTemplateWithMultipleSimpleBindings() { + void testTemplateWithMultipleSimpleBindings() { PathTemplate template = PathTemplate.create("v1/shelves/{shelf}/books/{book}"); String url = template.instantiate("shelf", "s1", "book", "b1"); Truth.assertThat(url).isEqualTo("v1/shelves/s1/books/b1"); diff --git a/api-common-java/src/test/java/com/google/api/pathtemplate/TemplatedResourceNameTest.java b/api-common-java/src/test/java/com/google/api/pathtemplate/TemplatedResourceNameTest.java index bb143932ff..2a7fd6ede4 100644 --- a/api-common-java/src/test/java/com/google/api/pathtemplate/TemplatedResourceNameTest.java +++ b/api-common-java/src/test/java/com/google/api/pathtemplate/TemplatedResourceNameTest.java @@ -31,19 +31,16 @@ package com.google.api.pathtemplate; import com.google.common.truth.Truth; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.junit.runners.JUnit4; +import org.junit.jupiter.api.Test; /** * Tests for {@link TemplatedResourceName}. As resource names are mostly a wrapper around path * templates, not much needs to be done here. */ -@RunWith(JUnit4.class) -public class TemplatedResourceNameTest { +class TemplatedResourceNameTest { @Test - public void resourceNameMethods() { + void resourceNameMethods() { PathTemplate template = PathTemplate.create("buckets/*/objects/**"); TemplatedResourceName name = TemplatedResourceName.create(template, "buckets/b/objects/1/2"); Truth.assertThat(name.toString()).isEqualTo("buckets/b/objects/1/2"); diff --git a/api-common-java/src/test/java/com/google/api/resourcenames/UntypedResourceNameTest.java b/api-common-java/src/test/java/com/google/api/resourcenames/UntypedResourceNameTest.java index c0615da416..6fa28c49eb 100644 --- a/api-common-java/src/test/java/com/google/api/resourcenames/UntypedResourceNameTest.java +++ b/api-common-java/src/test/java/com/google/api/resourcenames/UntypedResourceNameTest.java @@ -30,23 +30,21 @@ package com.google.api.resourcenames; import static junit.framework.TestCase.fail; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertTrue; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertTrue; import java.util.Map; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.junit.runners.JUnit4; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; /** Tests for {@link UntypedResourceNameTest}. */ -@RunWith(JUnit4.class) -public class UntypedResourceNameTest { +class UntypedResourceNameTest { private static final String NAME_STRING = "sunshine"; private static final String EMPTY_STRING = ""; @Test - public void testGetFieldValues() { + void testGetFieldValues() { assertTrue(UntypedResourceName.isParsableFrom(NAME_STRING)); UntypedResourceName fooName = UntypedResourceName.parse(NAME_STRING); @@ -58,7 +56,7 @@ public void testGetFieldValues() { } @Test - public void testInsertIntoFieldValuesMap() { + void testInsertIntoFieldValuesMap() { UntypedResourceName fooName = UntypedResourceName.parse(NAME_STRING); Map fieldValuesMap = fooName.getFieldValuesMap(); @@ -82,11 +80,8 @@ public void testInsertIntoFieldValuesMap() { } @Test - public void testNullName() { + void testNullName() { assertFalse(UntypedResourceName.isParsableFrom(null)); - try { - UntypedResourceName fooName = UntypedResourceName.parse(null); - } catch (NullPointerException e) { - } + Assertions.assertThrows(NullPointerException.class, () -> UntypedResourceName.parse(null)); } } diff --git a/api-common-java/synth.metadata b/api-common-java/synth.metadata deleted file mode 100644 index b8bf18aed1..0000000000 --- a/api-common-java/synth.metadata +++ /dev/null @@ -1,18 +0,0 @@ -{ - "sources": [ - { - "git": { - "name": ".", - "remote": "git@github.com:googleapis/api-common-java.git", - "sha": "7014db17904a165c78fbda1284d433b38e839876" - } - }, - { - "git": { - "name": "synthtool", - "remote": "https://github.com/googleapis/synthtool.git", - "sha": "5a6f30b8bb7672cf237c4f75d5aa96bfba170e7f" - } - } - ] -} \ No newline at end of file diff --git a/coverage-report/README.md b/coverage-report/README.md new file mode 100644 index 0000000000..1cf62cc1d5 --- /dev/null +++ b/coverage-report/README.md @@ -0,0 +1,22 @@ +## Coverage Report + +This module gathers aggregated jacoco test coverage metrics across the `api-common`, `gax-java` and `showcase` modules. The purpose of +the metrics is to provide insights into how much of api-common and GAX code is being exercised by showcase, GAX and api-common tests and where +(unit tests versus integration tests). They will also assist with tracking any changes in coverage as showcase tests continue to be added to the repository. + +### Unit Test Coverage +In order to view aggregate unit test coverage of api-common and GAX in `api-common`, `gax-java` and `showcase`: + +1. At the root of the repository, run `mvn clean test -DenableShowcaseTestCoverage`. +2. The metrics can be found at `gapic-generator-java/coverage-report/target/site/jacoco-aggregate/index.html` + +![Screenshot 2023-03-23 at 4 29 36 PM](https://user-images.githubusercontent.com/66699525/227346653-b50ec440-71f9-49f4-be21-3976c7f995c7.png) + +### Integration Test Coverage + +In order to view aggregate integration test coverage of api-common and GAX in `api-common`, `gax-java` and `showcase`: + +1. At the root of the repository, run `mvn clean verify -DskipUnitTests -DenableShowcaseTestCoverage -Penable-integration-tests`. +2. The metrics can be found at `gapic-generator-java/coverage-report/target/site/jacoco-aggregate/index.html` + +![Screenshot 2023-03-23 at 4 33 11 PM](https://user-images.githubusercontent.com/66699525/227348487-f1ba2bb8-7577-4280-a1a1-7aa78e242f12.png) \ No newline at end of file diff --git a/coverage-report/pom.xml b/coverage-report/pom.xml new file mode 100644 index 0000000000..333cf5059d --- /dev/null +++ b/coverage-report/pom.xml @@ -0,0 +1,84 @@ + + + 4.0.0 + com.google.cloud + coverage-report + pom + 0.0.1-SNAPSHOT + Jacoco Aggregrate Test Coverage Report + + + UTF-8 + true + true + true + 8 + true + + ${project.basedir}/coverage-report/target/site/ + jacoco-aggregate/jacoco.xml + + + + + + com.google.cloud + gapic-showcase + 0.0.1-SNAPSHOT + + + com.google.api + gax + 2.76.1-SNAPSHOT + + + com.google.api + gax-grpc + 2.76.1-SNAPSHOT + + + com.google.api + gax-httpjson + 2.76.1-SNAPSHOT + + + com.google.api + api-common + 2.59.1-SNAPSHOT + + + + + + + org.jacoco + jacoco-maven-plugin + 0.8.13 + + + unit-tests-report-aggregate + + report-aggregate + + test + + + integration-tests-report-aggregate + + report-aggregate + + integration-test + + + + + com.spotify.fmt + fmt-maven-plugin + + + + + + diff --git a/dependencies.txt b/dependencies.txt new file mode 100644 index 0000000000..7650be92ce --- /dev/null +++ b/dependencies.txt @@ -0,0 +1,51 @@ +# This file contains a list of dependencies and their versions to be tested for compatibility. +# The format is `{GroupID}:{ArtifactID},{PropertyName}={Version}`. The GAV coordinates +# (specifically the GroupID and ArtifactID) are parsed by renovate to find the artifact from Maven +# Central. Version stores the currently known upper bound. PropertyName corresponds to the Maven +# property value in the pom.xml (it is NOT a 1:1 mapping to the GAV). +# "1P" refers to First-Party dependencies (owned by Google). +# "3P" refers to Third-Party dependencies. + +# Pom-Parent Dependencies +# These dependencies are declared: https://github.com/googleapis/sdk-platform-java/blob/main/gapic-generator-java-pom-parent/pom.xml +javax.annotation:javax.annotation-api,javax.annotation-api=1.3.2 +io.grpc:grpc-bom,grpc=1.79.0 +com.google.auth:google-auth-library-bom,google.auth=1.43.0 +com.google.http-client:google-http-client,google.http-client=2.1.0 +com.google.code.gson:gson,gson=2.13.2 +com.google.guava:guava,guava=33.5.0-jre +com.google.protobuf:protobuf-java,protobuf=4.34.0 +io.opentelemetry:opentelemetry-bom,opentelemetry=1.60.1 +com.google.errorprone:error_prone_annotations,errorprone=2.48.0 +com.google.j2objc:j2objc-annotations,j2objc-annotations=3.1 +org.threeten:threetenbp,threetenbp=1.7.2 +org.slf4j:slf4j-api,slf4j=2.0.17 + +# 1P Shared-Deps +# These dependencies are declared: https://github.com/googleapis/sdk-platform-java/blob/main/java-shared-dependencies/first-party-dependencies/pom.xml +com.google.cloud:grpc-gcp,grpc-gcp=1.9.2 +com.google.oauth-client:google-oauth-client,google.oauth-client=1.39.0 +com.google.api-client:google-api-client,google.api-client=2.9.0 + +# 3P Shared-Deps +# These dependencies are declared: https://github.com/googleapis/sdk-platform-java/blob/main/java-shared-dependencies/third-party-dependencies/pom.xml +org.threeten:threeten-extra,threeten-extra=1.8.0 +io.opencensus:opencensus-api,opencensus=0.31.1 +com.google.code.findbugs:jsr305,findbugs=3.0.2 +com.fasterxml.jackson:jackson-bom,jackson=2.21.1 +commons-codec:commons-codec,codec=1.21.0 +org.apache.httpcomponents:httpclient,httpcomponents.httpclient=4.5.14 +org.apache.httpcomponents:httpcore,httpcomponents.httpcore=4.4.16 +org.apache.httpcomponents.client5:httpclient5,apache-httpclient-5=5.6 +org.apache.httpcomponents.core5:httpcore5,apache-httpcore-5=5.4.2 +org.json:json,json=20251224 +io.perfmark:perfmark-api,perfmark-api=0.27.0 +# Note: This is the google opentelemetry exporter and not the general opentelemetry project +com.google.cloud.opentelemetry:exporter-metrics,google.cloud.opentelemetry=0.36.0 +com.google.flogger:flogger,flogger=0.9 +org.apache.arrow:arrow-memory-core,arrow=18.3.0 +dev.cel:cel,dev.cel=0.12.0 +com.google.crypto.tink:tink,com.google.crypto.tink=1.20.0 +# The follow opentelemetry dependencies have a different version from the opentelemetry-bom +io.opentelemetry.semconv:opentelemetry-semconv,opentelemetry-semconv=1.40.0 +io.opentelemetry.contrib:opentelemetry-gcp-resources,io.opentelemetry.contrib.opentelemetry-gcp-resources=1.52.0-alpha diff --git a/gapic-generator-java-bom/pom.xml b/gapic-generator-java-bom/pom.xml index d810eef500..b54c6a7684 100644 --- a/gapic-generator-java-bom/pom.xml +++ b/gapic-generator-java-bom/pom.xml @@ -4,7 +4,7 @@ com.google.api gapic-generator-java-bom pom - 2.12.1-SNAPSHOT + 2.68.1-SNAPSHOT GAPIC Generator Java BOM BOM for the libraries in gapic-generator-java repository. Users should not @@ -13,9 +13,9 @@ - com.google.cloud + com.google.api gapic-generator-java-pom-parent - 2.12.1-SNAPSHOT + 2.68.1-SNAPSHOT ../gapic-generator-java-pom-parent @@ -29,6 +29,21 @@ pom import + + com.google.auth + google-auth-library-oauth2-http + ${google.auth.version} + test-jar + testlib + test + + + com.google.http-client + google-http-client-bom + ${google.http-client.version} + pom + import + com.google.code.gson gson @@ -60,59 +75,84 @@ com.google.api api-common - 2.3.2-SNAPSHOT + 2.59.1-SNAPSHOT com.google.api gax-bom - 2.20.2-SNAPSHOT + 2.76.1-SNAPSHOT pom import + + com.google.api + gapic-generator-java + 2.68.1-SNAPSHOT + com.google.api.grpc grpc-google-common-protos - 2.11.1-SNAPSHOT + 2.67.1-SNAPSHOT com.google.api.grpc proto-google-common-protos - 2.11.1-SNAPSHOT + 2.67.1-SNAPSHOT com.google.api.grpc proto-google-iam-v1 - 1.6.23-SNAPSHOT + 1.62.1-SNAPSHOT com.google.api.grpc proto-google-iam-v2 - 1.6.23-SNAPSHOT + 1.62.1-SNAPSHOT com.google.api.grpc proto-google-iam-v2beta - 1.6.23-SNAPSHOT + 1.62.1-SNAPSHOT + + + com.google.api.grpc + proto-google-iam-v3 + 1.62.1-SNAPSHOT + + + com.google.api.grpc + proto-google-iam-v3beta + 1.62.1-SNAPSHOT com.google.api.grpc grpc-google-iam-v1 - 1.6.23-SNAPSHOT + 1.62.1-SNAPSHOT com.google.api.grpc grpc-google-iam-v2 - 1.6.23-SNAPSHOT + 1.62.1-SNAPSHOT com.google.api.grpc grpc-google-iam-v2beta - 1.6.23-SNAPSHOT + 1.62.1-SNAPSHOT + + + com.google.api.grpc + grpc-google-iam-v3 + 1.62.1-SNAPSHOT + + + com.google.api.grpc + grpc-google-iam-v3beta + 1.62.1-SNAPSHOT - \ No newline at end of file + diff --git a/gapic-generator-java-pom-parent/java.header b/gapic-generator-java-pom-parent/java.header new file mode 100644 index 0000000000..772004189a --- /dev/null +++ b/gapic-generator-java-pom-parent/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\.$ +^ \*/$ \ No newline at end of file diff --git a/java-common-protos/license-checks.xml b/gapic-generator-java-pom-parent/license-checks.xml similarity index 100% rename from java-common-protos/license-checks.xml rename to gapic-generator-java-pom-parent/license-checks.xml diff --git a/gapic-generator-java-pom-parent/pom.xml b/gapic-generator-java-pom-parent/pom.xml index e8935c8804..d77f79f9d3 100644 --- a/gapic-generator-java-pom-parent/pom.xml +++ b/gapic-generator-java-pom-parent/pom.xml @@ -3,34 +3,45 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" child.project.url.inherit.append.path="false"> 4.0.0 - com.google.cloud + com.google.api gapic-generator-java-pom-parent - 2.12.1-SNAPSHOT + 2.68.1-SNAPSHOT pom GAPIC Generator Java POM Parent - https://github.com/googleapis/google-cloud-java + https://github.com/googleapis/sdk-platform-java The top-level parent for all modules in the repository. com.google.cloud google-cloud-shared-config - 1.5.5 + 1.17.0 false java.header + 8 - 1.3.2 - 1.51.1 - 1.14.0 - 2.10 - 31.1-jre - 3.21.12 + 1.76.3 + 1.43.0 + 2.1.0 + 2.12.1 + 33.5.0-jre + 4.33.2 + 1.51.0 + 2.42.0 + 3.1 + 1.7.0 + 5.11.4 + 4.11.0 + 2.0.16 + + true @@ -49,13 +60,13 @@ - scm:git:git@github.com:googleapis/google-cloud-java.git - scm:git:git@github.com:googleapis/google-cloud-java.git - https://github.com/googleapis/google-cloud-java + scm:git:git@github.com:googleapis/sdk-platform-java.git + scm:git:git@github.com:googleapis/sdk-platform-java.git + https://github.com/googleapis/sdk-platform-java HEAD - https://github.com/googleapis/google-cloud-java/issues + https://github.com/googleapis/sdk-platform-java/issues GitHub Issues @@ -94,8 +105,105 @@ - + + test-coverage + + + enableShowcaseTestCoverage + + + + + + + org.apache.maven.plugins + maven-surefire-plugin + 3.5.2 + + + + **/*SmokeTest.java + **/IT*.java + + sponge_log + ${surefire.jacoco.args} + ${skipUnitTests} + + + + + org.apache.maven.plugins + maven-failsafe-plugin + 3.5.2 + + + + integration-test + verify + + + + + 3600 + sponge_log + + **/IT*.java + **/*SmokeTest.java + + ${failsafe.jacoco.args} + + + + + + + org.jacoco + jacoco-maven-plugin + 0.8.13 + + + unit-test-execution + + prepare-agent + + + surefire.jacoco.args + + + + integration-test-execution + pre-integration-test + + prepare-agent + + + failsafe.jacoco.args + + + + + + + + + envVarTest + + + + org.apache.maven.plugins + maven-surefire-plugin + + + + **/*.java + + + + + + + google-maven-central-copy @@ -108,4 +216,4 @@ https://repo1.maven.org/maven2 - \ No newline at end of file + diff --git a/gapic-generator-java/DEVELOPMENT.md b/gapic-generator-java/DEVELOPMENT.md index 5eb2740fa0..b00d7b8ee7 100644 --- a/gapic-generator-java/DEVELOPMENT.md +++ b/gapic-generator-java/DEVELOPMENT.md @@ -1,210 +1,220 @@ # Development Workflow -## Set Up +## Test Running -1. Clone this repo. +### Unit Tests -2. Copy the Git pre-commit hooks. This will automatically check the build, run - tests, and perform linting before each commit. (Symlinks don't seem to work, - but if you find a way, please add it here!) +To run the unit tests in `gapic-generator-java` submodule, first build all +modules with `mvn -pl '!gapic-generator-java' install -DskipTests` at the root +directory, +then `cd` into `gapic-generator-java` submodule for the following commands: - ```sh - cp .githooks/pre-commit .git/hooks/pre-commit - ``` +- Run all unit tests: -## Code Formatting + ```sh + # In gapic-generator-java submodule + mvn test + ``` -- Run linter checks without actually doing the formatting. +- Run a single or multiple unit tests: - ```sh - bazel run //:google_java_format_verification - ``` - or - ```sh - mvn fmt:check - ``` + ```sh + # In gapic-generator-java submodule + mvn test -Dtest=JavaCodeGeneratorTest -- Format files. + mvn test "-Dtest=Basic*, !%regex[.*.Unstable.*], !%regex[.*.MyTest.class#one.*|two.*], %regex[#fast.*|slow.*]" + ``` - ```sh - bazel run //:google_java_format - ``` - or - ```sh - mvn fmt:format - ``` +- Update all unit test golden files: -## Test Running + ```sh + # In gapic-generator-java submodule + mvn test -DupdateUnitGoldens + ``` -- Run all unit and integration tests. +- Update a single unit test golden file, for example `JavaCodeGeneratorTest.java`: - ```sh - bazel test //... - ``` + ```sh + # In gapic-generator-java submodule + mvn test -DupdateUnitGoldens -Dtest=JavaCodeGeneratorTest + ``` -- Run all unit tests. +Note that `mvn -pl '!gapic-generator-java' install -DskipTests` +at the root directory is needed for `mvn test` commands, +because the gapic-generator-java submodule depends on the "test jars" of +gax-java. The test jars are absent until Maven's "package" phase, which is later +than the "test" phase. - ```sh - bazel test //:units - ``` - or - ```sh - mvn test - ``` +### Integration Tests -- Run a single unit test like `JavaCodeGeneratorTest.java`: +To run integration test for gapic-generator-java, run this Bazel command in the +root of the repository (where you have WORKSPACE file for Bazel.) - ```sh - bazel test //:unit_com_google_api_generator_engine_JavaCodeGeneratorTest - ``` - or - ```sh - mvn test -Dtest=JavaCodeGeneratorTest +*Note* Make sure you run `mvn clean install` to gather any changes you have made before updating the integration tests. - mvn test "-Dtest=Basic*, !%regex[.*.Unstable.*], !%regex[.*.MyTest.class#one.*|two.*], %regex[#fast.*|slow.*]" - ``` - -- Update all unit test golden files: +```sh +# In the repository root directory +bazelisk test //... # integration tests +``` - ```sh - mvn test -DupdateUnitGoldens - ``` -- Update a single unit test golden file, for example `JavaCodeGeneratorTest.java`: +- Run a single integration test for API like `Redis`, it generates Java source + code using the Java microgenerator and compares them with the goldens files + in `test/integration/goldens/redis`. ```sh - bazel run //:update_com_google_api_generator_engine_JavaCodeGeneratorTest - ``` - or - ```sh - mvn test -DupdateUnitGoldens -Dtest=JavaCodeGeneratorTest + # In the repository root directory + bazelisk test //test/integration:redis ``` -- Run a single integration test for API like `Redis`, it generates Java source - code using the Java microgenerator and compares them with the goldens files - in `test/integration/goldens/redis`. +- Update integration test golden files, for example `Redis`. This clobbers all the + files in `test/integration/goldens/redis`. ```sh - bazel test //test/integration:redis + # In the repository root directory + bazelisk run //test/integration:update_redis ``` -- Update integration test golden files, for example `Redis`. This clobbers all the - files in `test/integration/goldens/redis`. +- To update all integration tests you can use this command: - ```sh - bazel run //test/integration:update_redis + ```sh + # In the repository root directory + bazelisk run //test/integration:update_asset && bazelisk run //test/integration:update_credentials && bazelisk run //test/integration:update_iam && bazelisk run //test/integration:update_kms && bazelisk run //test/integration:update_pubsub && bazelisk run //test/integration:update_logging && bazelisk run //test/integration:update_redis && bazelisk run //test/integration:update_storage && bazelisk run //test/integration:update_library && bazelisk run //test/integration:update_compute && bazelisk run //test/integration:update_bigtable && bazelisk run //test/integration:update_apigeeconnect ``` -## Running the Plugin +## Running the Plugin under googleapis with local gapic-generator-java -1. Clone [googleapis](https://github.com/googleapis/googleapis) and - [gapic-showcase](https://github.com/googleapis/gapic-showcase/). +For running the Plugin with showcase protos and local gapic-generator-java, see +[Showcase Integration Testing](../showcase/README.md). -2. Copy the protos from Showcase into googleapis/google/showcase. +To generate a production GAPIC API: - ```sh - mkdir googleapis/google/showcase - cp -r gapic-showcase/schema/google/showcase/v1beta1 googleapis/google/showcase/v1beta1 - ``` +1. Clone [googleapis](https://github.com/googleapis/googleapis). -3. Add the new microgenerator rules to - `googleapis/google/showcase/v1beta1/BUILD.bazel` file as follows: - - ```python - load( - "@com_google_googleapis_imports//:imports.bzl", - # Existing rules here. - "java_gapic_assembly_gradle_pkg", - "java_gapic_library", - "java_proto_library", - "proto_library_with_info", - ) +2. Modify `googleapis/WORKSPACE` to point to local gapic-generator-java - proto_library_with_info( - name = "showcase_proto_with_info", - deps = [ - ":showcase_proto", - ], - ) - - java_proto_library( - name = "showcase_java_proto", - deps = [ - ":showcase_proto", - ], - ) + Normally, googleapis's build pulls in gapic-generator-java from Maven Central. + For a local run, we first need to build a local SNAPSHOT jar of the generator. Then we point googleapis to + both the local SNAPSHOT jar and the local copy of the generator. - # This should either replace the existing monolith target or have a unique name - # that includes "java_gapic". - java_gapic_library( - name = "showcase_java_gapic", - srcs = [":showcase_proto_with_info"], - grpc_service_config = "showcase_grpc_service_config.json", - test_deps = [ - ":showcase_java_grpc", - ], - deps = [ - ":showcase_java_proto", - ], + Replace the following section in googleapis + ``` + _gapic_generator_java_version = "2.43.0" + + http_archive( + name = "gapic_generator_java", + strip_prefix = "sdk-platform-java-%s" % _gapic_generator_java_version, + urls = ["https://github.com/googleapis/sdk-platform-java/archive/v%s.zip" % _gapic_generator_java_version], ) - - java_gapic_assembly_gradle_pkg( - # This name should be unique from the existing target name. - name = "google-cloud-showcase-v1beta1-java", - deps = [ - # This is the new microgen target above. - ":showcase_java_gapic", - # The following targets already exist. - ":showcase_java_grpc", - ":showcase_java_proto", - ":showcase_proto", - ], + + # gax-java is part of sdk-platform-java repository + http_archive( + name = "com_google_api_gax_java", + strip_prefix = "sdk-platform-java-%s/gax-java" % _gapic_generator_java_version, + urls = ["https://github.com/googleapis/sdk-platform-java/archive/v%s.zip" % _gapic_generator_java_version], ) - ``` - -4. Point to local gapic-generator-java - - Normally, googleapis's build pulls in googleapis/gapic-generator-java from the - Internet: + ``` + to ``` - # Java microgenerator. - … - _gapic_generator_java_version = "2.1.0" - - http_archive( - name = "gapic_generator_java", - … - urls = ["https://github.com/googleapis/gapic-generator-java/archive/v%s.zip" % _gapic_generator_java_version], - ) + _gapic_generator_java_version = "2.43.1-SNAPSHOT" + + local_repository( + name = "gapic_generator_java", + path = "/absolute/path/to/your/local/sdk-platform-java", + ) + + # gax-java is part of sdk-platform-java repository + local_repository( + name = "com_google_api_gax_java", + path = "/absolute/path/to/your/local/sdk-platform-java/gax-java", + ) ``` - By replacing this portion using the built-in local_repository rule, you can mak - it refer to your local development repo: + Note: At the time of writing, the gapic-generator version was `2.43.0`. Update the version to the latest version in the pom.xml + + Then update `fail_on_missing_checksum = False` in this `maven_install` target: ``` - local_repository( - name = "gapic_generator_java", - path = "/home//gapic-generator-java", - ) + maven_install( + artifacts = [ + "com.google.api:gapic-generator-java:" + _gapic_generator_java_version, + ] + PROTOBUF_MAVEN_ARTIFACTS + + IO_GRPC_GRPC_JAVA_ARTIFACTS, + generate_compat_repositories = True, + #Update this False for local development + fail_on_missing_checksum = True, + repositories = [ + "m2Local", + "https://repo.maven.apache.org/maven2/", + ] + ) ``` -5. Build the new target. +3. Build the new target. - ```sh - cd googleapis - bazel build //google/showcase/v1beta1:showcase_java_gapic - ``` - You can generate any client library based on the protos within googleapis. You just need the name of the service within the `java_gapic_assembly_gradle_pkg` rules within the service's `BUILD.bazel` file. For instance, to run your local generator on the `speech`'s v2 service, you can run: - + ``` - bazel build //google/cloud/speech/v2:google-cloud-speech-v2-java + bazelisk build //google/cloud/speech/v2:google-cloud-speech-v2-java ``` - + Note: If you are running into bazel build issues, you can try to remove gapic-generator-java cached in your local m2 + Try running this command: + ``` + rm -rf ~/.m2/repository/com/google/api/ + ``` + and then rebuild gapic-generator-java (`mvn clean install`). + +## Debugging the gapic-generator-java running on protobuf compiler + +1. In [googleapis](https://github.com/googleapis/googleapis) root directory, run the following commands: + 1. Set `JVM_DEBUG_PORT` environment variable. + ```shell + export JVM_DEBUG_PORT=5005 + ``` + The protobuf compiler runs the `protoc-gen-java_gapic` shell script (a wrapper of java command with an option to specify JVM debugging). + We set the environment variable `JVM_DEBUG_PORT` to enable the debug option. + + 2. Run the command to build a client library, e.g., `java-monitoring`, with `--subcommands` flag to output commands spawned by `bazel build`. + ```shell + bazel build --subcommands //google/monitoring/v3:google-cloud-monitoring-v3-java + ``` + 3. In the output, find the command of protobuf compiler invocation with gapic-generator-java plugin (the `darwin_arm64-opt-exec-2B5CBBC6` part may be different on your environment). + + Note that different client libraries have different proto files. + ```shell + bazel-out/darwin_arm64-opt-exec-2B5CBBC6/bin/external/com_google_protobuf/protoc --experimental_allow_proto3_optional '--plugin=protoc-gen-java_gapic=bazel-out/darwin_arm64-opt-exec-2B5CBBC6/bin/external/gapic_generator_java/protoc-gen-java_gapic' '--java_gapic_out=metadata:bazel-out/darwin_arm64-fastbuild/bin/google/monitoring/v3/monitoring_java_gapic_srcjar_raw.srcjar.zip' '--java_gapic_opt=transport=grpc,rest-numeric-enums,grpc-service-config=google/monitoring/v3/monitoring_grpc_service_config.json,gapic-config=google/monitoring/v3/monitoring_gapic.yaml,api-service-config=google/monitoring/v3/monitoring.yaml' '-Igoogle/monitoring/v3/alert.proto=google/monitoring/v3/alert.proto' '-Igoogle/monitoring/v3/alert_service.proto=google/monitoring/v3/alert_service.proto' '-Igoogle/monitoring/v3/common.proto=google/monitoring/v3/common.proto' '-Igoogle/monitoring/v3/dropped_labels.proto=google/monitoring/v3/dropped_labels.proto' '-Igoogle/monitoring/v3/group.proto=google/monitoring/v3/group.proto' '-Igoogle/monitoring/v3/group_service.proto=google/monitoring/v3/group_service.proto' '-Igoogle/monitoring/v3/metric.proto=google/monitoring/v3/metric.proto' '-Igoogle/monitoring/v3/metric_service.proto=google/monitoring/v3/metric_service.proto' '-Igoogle/monitoring/v3/mutation_record.proto=google/monitoring/v3/mutation_record.proto' '-Igoogle/monitoring/v3/notification.proto=google/monitoring/v3/notification.proto' '-Igoogle/monitoring/v3/notification_service.proto=google/monitoring/v3/notification_service.proto' '-Igoogle/monitoring/v3/query_service.proto=google/monitoring/v3/query_service.proto' '-Igoogle/monitoring/v3/service.proto=google/monitoring/v3/service.proto' '-Igoogle/monitoring/v3/service_service.proto=google/monitoring/v3/service_service.proto' '-Igoogle/monitoring/v3/snooze.proto=google/monitoring/v3/snooze.proto' '-Igoogle/monitoring/v3/snooze_service.proto=google/monitoring/v3/snooze_service.proto' '-Igoogle/monitoring/v3/span_context.proto=google/monitoring/v3/span_context.proto' '-Igoogle/monitoring/v3/uptime.proto=google/monitoring/v3/uptime.proto' '-Igoogle/monitoring/v3/uptime_service.proto=google/monitoring/v3/uptime_service.proto' '-Igoogle/api/annotations.proto=google/api/annotations.proto' '-Igoogle/api/http.proto=google/api/http.proto' '-Igoogle/protobuf/descriptor.proto=bazel-out/darwin_arm64-fastbuild/bin/external/com_google_protobuf/_virtual_imports/descriptor_proto/google/protobuf/descriptor.proto' '-Igoogle/api/client.proto=google/api/client.proto' '-Igoogle/api/launch_stage.proto=google/api/launch_stage.proto' '-Igoogle/protobuf/duration.proto=bazel-out/darwin_arm64-fastbuild/bin/external/com_google_protobuf/_virtual_imports/duration_proto/google/protobuf/duration.proto' '-Igoogle/api/distribution.proto=google/api/distribution.proto' '-Igoogle/protobuf/any.proto=bazel-out/darwin_arm64-fastbuild/bin/external/com_google_protobuf/_virtual_imports/any_proto/google/protobuf/any.proto' '-Igoogle/protobuf/timestamp.proto=bazel-out/darwin_arm64-fastbuild/bin/external/com_google_protobuf/_virtual_imports/timestamp_proto/google/protobuf/timestamp.proto' '-Igoogle/api/field_behavior.proto=google/api/field_behavior.proto' '-Igoogle/api/label.proto=google/api/label.proto' '-Igoogle/api/metric.proto=google/api/metric.proto' '-Igoogle/api/monitored_resource.proto=google/api/monitored_resource.proto' '-Igoogle/protobuf/struct.proto=bazel-out/darwin_arm64-fastbuild/bin/external/com_google_protobuf/_virtual_imports/struct_proto/google/protobuf/struct.proto' '-Igoogle/api/resource.proto=google/api/resource.proto' '-Igoogle/rpc/status.proto=google/rpc/status.proto' '-Igoogle/type/calendar_period.proto=google/type/calendar_period.proto' '-Igoogle/protobuf/empty.proto=bazel-out/darwin_arm64-fastbuild/bin/external/com_google_protobuf/_virtual_imports/empty_proto/google/protobuf/empty.proto' '-Igoogle/protobuf/field_mask.proto=bazel-out/darwin_arm64-fastbuild/bin/external/com_google_protobuf/_virtual_imports/field_mask_proto/google/protobuf/field_mask.proto' '-Igoogle/protobuf/wrappers.proto=bazel-out/darwin_arm64-fastbuild/bin/external/com_google_protobuf/_virtual_imports/wrappers_proto/google/protobuf/wrappers.proto' '-Igoogle/cloud/common_resources.proto=google/cloud/common_resources.proto' google/monitoring/v3/alert.proto google/monitoring/v3/alert_service.proto google/monitoring/v3/common.proto google/monitoring/v3/dropped_labels.proto google/monitoring/v3/group.proto google/monitoring/v3/group_service.proto google/monitoring/v3/metric.proto google/monitoring/v3/metric_service.proto google/monitoring/v3/mutation_record.proto google/monitoring/v3/notification.proto google/monitoring/v3/notification_service.proto google/monitoring/v3/query_service.proto google/monitoring/v3/service.proto google/monitoring/v3/service_service.proto google/monitoring/v3/snooze.proto google/monitoring/v3/snooze_service.proto google/monitoring/v3/span_context.proto google/monitoring/v3/uptime.proto google/monitoring/v3/uptime_service.proto google/cloud/common_resources.proto + ``` + 4. Run the protoc command. + + It shows nothing because it's waiting for a debugger to attach. + +2. In the IntelliJ that has gapic-generator-java, add [Remote JVM debug configuration](https://www.jetbrains.com/help/idea/tutorial-remote-debug.html). + +3. Set a breakpoint, e.g., in the 1st line in the main method in [Main](src/main/java/com/google/api/generator/Main.java) (this line always get called). + +4. Start the Remote JVM Debug configuration and you can debug the generator in Intellij. + ![IntelliJ Debug Screenshot](debug.png) + +## FAQ + +### Error in workspace: workspace() got unexpected keyword argument 'managed_directories' + +Full Error: + +``` +ERROR: Traceback (most recent call last): + File "/home/alicejli/googleapis/WORKSPACE", line 1, column 10, in + workspace( +Error in workspace: workspace() got unexpected keyword argument 'managed_directories' +ERROR: Error computing the main repository mapping: Encountered error while reading extension file 'tools/build_defs/repo/http.bzl': no such package '@bazel_tools//tools/build_defs/repo': error loading package 'external': Could not load //external package +``` + +You may be using the latest version of bazel which this project does not support yet. Try installing bazelisk to force +bazel to use the version specified in `.bazeliskrc` diff --git a/gapic-generator-java/README.md b/gapic-generator-java/README.md index 21b323f741..76799f6f81 100644 --- a/gapic-generator-java/README.md +++ b/gapic-generator-java/README.md @@ -4,3 +4,18 @@ Generates a Java client library from protocol buffers. Replaces the Java parts of the [older monolithic generator](https://github.com/googleapis/gapic-generator). + +See [DEVELOPMENT.md](DEVELOPMENT.md) for setting up development environment. + +## service_config.proto + +We use the `src/main/proto/service_config.proto` file to generate corresponding +Java class files. +They are needed to generate client libraries for gRPC-based Google services. + +The source of `src/main/proto/service_config.proto` is the +[https://github.com/grpc/grpc-proto repository]( +https://github.com/grpc/grpc-proto/blob/master/grpc/service_config/service_config.proto). +We copy the file from the repository when a new enhancement is made in the file +and the service team asks us to incorporate the enhancement into the code +generator. diff --git a/gapic-generator-java/debug.png b/gapic-generator-java/debug.png new file mode 100644 index 0000000000..21043c7a90 Binary files /dev/null and b/gapic-generator-java/debug.png differ diff --git a/gapic-generator-java/pom.xml b/gapic-generator-java/pom.xml index 8087b7de47..93bbe8dd98 100644 --- a/gapic-generator-java/pom.xml +++ b/gapic-generator-java/pom.xml @@ -4,7 +4,9 @@ 4.0.0 com.google.api gapic-generator-java - 2.12.1-SNAPSHOT + 2.68.1-SNAPSHOT + GAPIC Generator Java + GAPIC generator Java true @@ -12,16 +14,16 @@ true UTF-8 - 44d6bef0ca6db8bba3fb324c8186e694bcc4829c - 1.10.1 + 9fcfbea0aa5b50fa22e190faceb073d74504172b 1.8 1.8 + 2025 - com.google.cloud + com.google.api gapic-generator-java-pom-parent - 2.12.1-SNAPSHOT + 2.68.1-SNAPSHOT ../gapic-generator-java-pom-parent @@ -30,7 +32,7 @@ com.google.api gapic-generator-java-bom - 2.12.1-SNAPSHOT + 2.68.1-SNAPSHOT pom import @@ -63,7 +65,7 @@ org.sonatype.plugins nexus-staging-maven-plugin - 1.6.13 + 1.7.0 true sonatype-nexus-staging @@ -74,6 +76,19 @@ + + + + showcase-sonar-analysis + + + enableShowcaseTestCoverage + + + + true + + @@ -92,7 +107,7 @@ maven-compiler-plugin - 3.10.1 + 3.13.0 8 8 @@ -107,9 +122,8 @@ - com.coveo + com.spotify.fmt fmt-maven-plugin - 2.9.1 @@ -291,7 +305,11 @@ test-jar - true + false + testlib + + com/google/api/generator/test/** + @@ -299,13 +317,17 @@ org.apache.maven.plugins maven-surefire-plugin - 3.0.0-M7 + 3.5.2 target/generated-test-resources/protobuf/descriptor-sets + + + ${currentYearOverride} + @@ -313,7 +335,7 @@ org.jacoco jacoco-maven-plugin - 0.8.8 + 0.8.13 @@ -333,7 +355,7 @@ org.apache.maven.plugins maven-shade-plugin - 3.4.1 + 3.6.0 package @@ -363,7 +385,7 @@ com.google.guava guava - 31.1-jre + ${guava.version} com.google.api @@ -372,6 +394,8 @@ com.google.api gax + + test-jar testlib @@ -381,6 +405,8 @@ com.google.api gax-grpc + + test-jar testlib @@ -390,6 +416,8 @@ com.google.api gax-httpjson + + test-jar testlib @@ -412,7 +440,7 @@ org.yaml snakeyaml - 1.33 + 2.3 com.google.googlejavaformat @@ -427,12 +455,12 @@ com.google.errorprone error_prone_annotations - 2.17.0 + ${errorprone.version} javax.annotation @@ -443,13 +471,25 @@ com.google.truth truth - 1.1.3 + 1.4.4 test io.github.java-diff-utils java-diff-utils - 4.12 + 4.15 + test + + + org.junit.jupiter + junit-jupiter-engine + ${junit.version} + test + + + org.junit.jupiter + junit-jupiter-params + ${junit.version} test diff --git a/gapic-generator-java/src/main/java/com/google/api/generator/Main.java b/gapic-generator-java/src/main/java/com/google/api/generator/Main.java index 2ad75c19ba..027eedaf81 100644 --- a/gapic-generator-java/src/main/java/com/google/api/generator/Main.java +++ b/gapic-generator-java/src/main/java/com/google/api/generator/Main.java @@ -14,6 +14,8 @@ package com.google.api.generator; +import static com.google.api.generator.gapic.protowriter.Writer.EMPTY_RESPONSE; + import com.google.api.generator.gapic.Generator; import com.google.protobuf.ExtensionRegistry; import com.google.protobuf.compiler.PluginProtos.CodeGeneratorRequest; @@ -26,6 +28,8 @@ public static void main(String[] args) throws IOException { ProtoRegistry.registerAllExtensions(registry); CodeGeneratorRequest request = CodeGeneratorRequest.parseFrom(System.in, registry); CodeGeneratorResponse response = Generator.generateGapic(request); - response.writeTo(System.out); + if (response != EMPTY_RESPONSE) { + response.writeTo(System.out); + } } } diff --git a/gapic-generator-java/src/main/java/com/google/api/generator/ProtoRegistry.java b/gapic-generator-java/src/main/java/com/google/api/generator/ProtoRegistry.java index 6f08ccfa3b..ae9c8cc76e 100644 --- a/gapic-generator-java/src/main/java/com/google/api/generator/ProtoRegistry.java +++ b/gapic-generator-java/src/main/java/com/google/api/generator/ProtoRegistry.java @@ -17,6 +17,7 @@ import com.google.api.AnnotationsProto; import com.google.api.ClientProto; import com.google.api.FieldBehaviorProto; +import com.google.api.FieldInfoProto; import com.google.api.ResourceProto; import com.google.api.RoutingProto; import com.google.cloud.ExtendedOperationsProto; @@ -31,6 +32,7 @@ public static void registerAllExtensions(ExtensionRegistry extensionRegistry) { ClientProto.registerAllExtensions(extensionRegistry); ResourceProto.registerAllExtensions(extensionRegistry); FieldBehaviorProto.registerAllExtensions(extensionRegistry); + FieldInfoProto.registerAllExtensions(extensionRegistry); ExtendedOperationsProto.registerAllExtensions(extensionRegistry); RoutingProto.registerAllExtensions(extensionRegistry); } diff --git a/gapic-generator-java/src/main/java/com/google/api/generator/engine/ast/ClassDefinition.java b/gapic-generator-java/src/main/java/com/google/api/generator/engine/ast/ClassDefinition.java index 4e1211ba3a..1e09e39f40 100644 --- a/gapic-generator-java/src/main/java/com/google/api/generator/engine/ast/ClassDefinition.java +++ b/gapic-generator-java/src/main/java/com/google/api/generator/engine/ast/ClassDefinition.java @@ -27,13 +27,17 @@ public abstract class ClassDefinition implements AstNode { // Optional. public abstract ImmutableList fileHeader(); + // Required for samples classes. @Nullable public abstract RegionTag regionTag(); + // Required. public abstract ScopeNode scope(); + // Required. public abstract IdentifierNode classIdentifier(); + // Required for outer classes. @Nullable public abstract String packageString(); @@ -199,9 +203,6 @@ public ClassDefinition build() { expr instanceof AssignmentExpr, "Class expression statement must be assignment or variable declaration"); VariableExpr variableExpr = ((AssignmentExpr) expr).variableExpr(); - Preconditions.checkState( - !variableExpr.scope().equals(ScopeNode.LOCAL), - "Class variable in assignment statement cannot have a local scope"); } } } diff --git a/gapic-generator-java/src/main/java/com/google/api/generator/engine/ast/ConcreteReference.java b/gapic-generator-java/src/main/java/com/google/api/generator/engine/ast/ConcreteReference.java index 5af0dbe869..48288ab817 100644 --- a/gapic-generator-java/src/main/java/com/google/api/generator/engine/ast/ConcreteReference.java +++ b/gapic-generator-java/src/main/java/com/google/api/generator/engine/ast/ConcreteReference.java @@ -103,14 +103,15 @@ public ImmutableList enclosingClassNames() { if (!hasEnclosingClass()) { return ImmutableList.of(); } - // The innermost type will be the last element in the list. + // Builds list in order of inner to outer. + // Return the reversed list, since the outermost type is expected to lie at index 0. ImmutableList.Builder listBuilder = new ImmutableList.Builder<>(); Class currentClz = clazz(); while (currentClz.getEnclosingClass() != null) { listBuilder.add(currentClz.getEnclosingClass().getSimpleName()); currentClz = currentClz.getEnclosingClass(); } - return listBuilder.build(); + return listBuilder.build().reverse(); } @Override diff --git a/gapic-generator-java/src/main/java/com/google/api/generator/engine/ast/GeneralForStatement.java b/gapic-generator-java/src/main/java/com/google/api/generator/engine/ast/GeneralForStatement.java index 93a5db44cb..ac32c09bfc 100644 --- a/gapic-generator-java/src/main/java/com/google/api/generator/engine/ast/GeneralForStatement.java +++ b/gapic-generator-java/src/main/java/com/google/api/generator/engine/ast/GeneralForStatement.java @@ -67,10 +67,13 @@ private static Builder builder() { abstract static class Builder { // Private setter. abstract Builder setInitializationExpr(Expr initializationExpr); + // Private setter. abstract Builder setTerminationExpr(Expr terminationExpr); + // Private setter. abstract Builder setUpdateExpr(Expr incrementExpr); + // Private setter. abstract Builder setBody(List body); diff --git a/gapic-generator-java/src/main/java/com/google/api/generator/engine/ast/JavaDocComment.java b/gapic-generator-java/src/main/java/com/google/api/generator/engine/ast/JavaDocComment.java index 12300b862c..7184044598 100644 --- a/gapic-generator-java/src/main/java/com/google/api/generator/engine/ast/JavaDocComment.java +++ b/gapic-generator-java/src/main/java/com/google/api/generator/engine/ast/JavaDocComment.java @@ -51,8 +51,11 @@ public abstract static class Builder { String throwsType = null; String throwsDescription = null; String deprecated = null; + String internalOnly = null; + String returnDescription = null; List paramsList = new ArrayList<>(); List componentsList = new ArrayList<>(); + // Private accessor, set complete and consolidated comment. abstract Builder setComment(String comment); @@ -69,6 +72,16 @@ public Builder setDeprecated(String deprecatedText) { return this; } + public Builder setInternalOnly(String internalOnlyText) { + internalOnly = internalOnlyText; + return this; + } + + public Builder setReturn(String returnText) { + returnDescription = returnText; + return this; + } + public Builder addParam(String name, String description) { paramsList.add(String.format("@param %s %s", name, processParamComment(description))); return this; @@ -129,12 +142,20 @@ public boolean emptyComments() { return Strings.isNullOrEmpty(throwsType) && Strings.isNullOrEmpty(throwsDescription) && Strings.isNullOrEmpty(deprecated) + && Strings.isNullOrEmpty(internalOnly) + && Strings.isNullOrEmpty(returnDescription) && paramsList.isEmpty() && componentsList.isEmpty(); } public JavaDocComment build() { - // @param, @throws and @deprecated should always get printed at the end. + // Add additional descriptive text before block tags. + if (!Strings.isNullOrEmpty(internalOnly)) { + componentsList.add( + String.format("

Warning: %s", HtmlEscaper.process(internalOnly))); + } + // @param, @throws, @return and @deprecated should always get printed at the + // end. componentsList.addAll(paramsList); if (!Strings.isNullOrEmpty(throwsType)) { componentsList.add( @@ -143,6 +164,9 @@ public JavaDocComment build() { if (!Strings.isNullOrEmpty(deprecated)) { componentsList.add(String.format("@deprecated %s", deprecated)); } + if (!Strings.isNullOrEmpty(returnDescription)) { + componentsList.add(String.format("@return %s", returnDescription)); + } // Escape component in list one by one, because we will join the components by `\n` // `\n` will be taken as escape character by the comment escaper. componentsList = diff --git a/gapic-generator-java/src/main/java/com/google/api/generator/engine/ast/LineComment.java b/gapic-generator-java/src/main/java/com/google/api/generator/engine/ast/LineComment.java index b725ac6487..426038f3ed 100644 --- a/gapic-generator-java/src/main/java/com/google/api/generator/engine/ast/LineComment.java +++ b/gapic-generator-java/src/main/java/com/google/api/generator/engine/ast/LineComment.java @@ -38,6 +38,7 @@ public static LineComment withComment(String comment) { @AutoValue.Builder public abstract static class Builder { public abstract Builder setComment(String comment); + // Private accessor. abstract String comment(); diff --git a/gapic-generator-java/src/main/java/com/google/api/generator/engine/ast/MethodDefinition.java b/gapic-generator-java/src/main/java/com/google/api/generator/engine/ast/MethodDefinition.java index 4b65d14789..6bd3bca9c5 100644 --- a/gapic-generator-java/src/main/java/com/google/api/generator/engine/ast/MethodDefinition.java +++ b/gapic-generator-java/src/main/java/com/google/api/generator/engine/ast/MethodDefinition.java @@ -32,8 +32,10 @@ public abstract class MethodDefinition implements AstNode { // Required. public abstract ScopeNode scope(); + // Required. public abstract TypeNode returnType(); + // Required. public abstract IdentifierNode methodIdentifier(); diff --git a/gapic-generator-java/src/main/java/com/google/api/generator/engine/ast/TryCatchStatement.java b/gapic-generator-java/src/main/java/com/google/api/generator/engine/ast/TryCatchStatement.java index 1280635e38..77cd964aed 100644 --- a/gapic-generator-java/src/main/java/com/google/api/generator/engine/ast/TryCatchStatement.java +++ b/gapic-generator-java/src/main/java/com/google/api/generator/engine/ast/TryCatchStatement.java @@ -31,6 +31,7 @@ public abstract class TryCatchStatement implements Statement { // Optional only if the sample code bit is set (i.e. this is sample code). public abstract List catchVariableExprs(); + // Optional only if the sample code bit is set (i.e. this is sample code). public abstract List> catchBlocks(); diff --git a/gapic-generator-java/src/main/java/com/google/api/generator/engine/ast/TypeNode.java b/gapic-generator-java/src/main/java/com/google/api/generator/engine/ast/TypeNode.java index b217feb057..12236842fc 100644 --- a/gapic-generator-java/src/main/java/com/google/api/generator/engine/ast/TypeNode.java +++ b/gapic-generator-java/src/main/java/com/google/api/generator/engine/ast/TypeNode.java @@ -74,6 +74,17 @@ public enum TypeKind { withReference( VaporReference.builder().setName("Value").setPakkage("com.google.protobuf").build()); + public static final TypeNode UINT32VALUE = + withReference( + VaporReference.builder() + .setName("UInt32Value") + .setPakkage("com.google.protobuf") + .build()); + + public static final TypeNode INT32VALUE = + withReference( + VaporReference.builder().setName("Int32Value").setPakkage("com.google.protobuf").build()); + private static final Map BOXED_TYPE_MAP = createBoxedTypeMap(); public static final TypeNode VOID = builder().setTypeKind(TypeKind.VOID).build(); diff --git a/gapic-generator-java/src/main/java/com/google/api/generator/engine/lexicon/Keyword.java b/gapic-generator-java/src/main/java/com/google/api/generator/engine/lexicon/Keyword.java index 765fe2eaf3..9e40e54027 100644 --- a/gapic-generator-java/src/main/java/com/google/api/generator/engine/lexicon/Keyword.java +++ b/gapic-generator-java/src/main/java/com/google/api/generator/engine/lexicon/Keyword.java @@ -14,6 +14,7 @@ package com.google.api.generator.engine.lexicon; +import com.google.common.base.Strings; import com.google.common.collect.ImmutableList; public class Keyword { @@ -71,11 +72,27 @@ public class Keyword { "native", "super", "while"); + private static final String ESCAPE_CHAR = "_"; public static boolean isKeyword(String s) { return s.equals(CLASS_KEYWORD) || KEYWORDS.contains(s); } + public static String unescapeKeyword(String str) { + if (Strings.isNullOrEmpty(str)) { + return str; + } + if (!str.endsWith(ESCAPE_CHAR)) { + return str; + } + String strWithoutEscapeChar = str.substring(0, str.lastIndexOf(ESCAPE_CHAR)); + return isKeyword(strWithoutEscapeChar) ? strWithoutEscapeChar : str; + } + + public static String escapeKeyword(String str) { + return Keyword.isKeyword(str) ? str + ESCAPE_CHAR : str; + } + public static boolean isInvalidFieldName(String s) { return KEYWORDS.contains(s); } diff --git a/gapic-generator-java/src/main/java/com/google/api/generator/engine/writer/ImportWriterVisitor.java b/gapic-generator-java/src/main/java/com/google/api/generator/engine/writer/ImportWriterVisitor.java index 37dd4a5733..e19e168c3e 100644 --- a/gapic-generator-java/src/main/java/com/google/api/generator/engine/writer/ImportWriterVisitor.java +++ b/gapic-generator-java/src/main/java/com/google/api/generator/engine/writer/ImportWriterVisitor.java @@ -166,6 +166,9 @@ public void visit(ScopeNode scope) { @Override public void visit(AnnotationNode annotation) { annotation.type().accept(this); + if (annotation.descriptionExprs() != null) { + expressions(annotation.descriptionExprs()); + } } @Override @@ -505,9 +508,11 @@ private void handleReference(Reference reference) { staticImports.add(reference.fullName()); } else { if (reference.hasEnclosingClass()) { + // Only import outermost enclosing class, e.g. import com.foo.bar.Outer addImport( String.format( - "%s.%s", reference.pakkage(), String.join(DOT, reference.enclosingClassNames()))); + "%s.%s", + reference.pakkage(), String.join(DOT, reference.enclosingClassNames().get(0)))); } else { addImport(reference.fullName()); } diff --git a/gapic-generator-java/src/main/java/com/google/api/generator/engine/writer/JavaWriterVisitor.java b/gapic-generator-java/src/main/java/com/google/api/generator/engine/writer/JavaWriterVisitor.java index e092f1c69c..e956d86949 100644 --- a/gapic-generator-java/src/main/java/com/google/api/generator/engine/writer/JavaWriterVisitor.java +++ b/gapic-generator-java/src/main/java/com/google/api/generator/engine/writer/JavaWriterVisitor.java @@ -362,7 +362,8 @@ public void visit(MethodInvocationExpr methodInvocationExpr) { leftAngle(); int numGenerics = methodInvocationExpr.generics().size(); for (int i = 0; i < numGenerics; i++) { - buffer.append(methodInvocationExpr.generics().get(i).name()); + Reference r = methodInvocationExpr.generics().get(i); + r.accept(this); if (i < numGenerics - 1) { buffer.append(COMMA); space(); diff --git a/gapic-generator-java/src/main/java/com/google/api/generator/gapic/Generator.java b/gapic-generator-java/src/main/java/com/google/api/generator/gapic/Generator.java index 30658ff6a5..b005a16ceb 100644 --- a/gapic-generator-java/src/main/java/com/google/api/generator/gapic/Generator.java +++ b/gapic-generator-java/src/main/java/com/google/api/generator/gapic/Generator.java @@ -18,6 +18,7 @@ import com.google.api.generator.gapic.model.GapicClass; import com.google.api.generator.gapic.model.GapicContext; import com.google.api.generator.gapic.model.GapicPackageInfo; +import com.google.api.generator.gapic.model.ReflectConfig; import com.google.api.generator.gapic.protoparser.Parser; import com.google.api.generator.gapic.protowriter.Writer; import com.google.protobuf.compiler.PluginProtos.CodeGeneratorRequest; @@ -29,7 +30,8 @@ public static CodeGeneratorResponse generateGapic(CodeGeneratorRequest request) GapicContext context = Parser.parse(request); List clazzes = Composer.composeServiceClasses(context); GapicPackageInfo packageInfo = Composer.composePackageInfo(context); + List reflectConfig = Composer.composeNativeReflectConfig(context); String outputFilename = "temp-codegen.srcjar"; - return Writer.write(context, clazzes, packageInfo, outputFilename); + return Writer.write(context, clazzes, packageInfo, reflectConfig, outputFilename); } } diff --git a/gapic-generator-java/src/main/java/com/google/api/generator/gapic/composer/ClientLibraryPackageInfoComposer.java b/gapic-generator-java/src/main/java/com/google/api/generator/gapic/composer/ClientLibraryPackageInfoComposer.java index cb794b4230..5bd24bdbd0 100644 --- a/gapic-generator-java/src/main/java/com/google/api/generator/gapic/composer/ClientLibraryPackageInfoComposer.java +++ b/gapic-generator-java/src/main/java/com/google/api/generator/gapic/composer/ClientLibraryPackageInfoComposer.java @@ -29,11 +29,15 @@ import com.google.api.generator.gapic.model.GapicPackageInfo; import com.google.api.generator.gapic.model.Sample; import com.google.api.generator.gapic.model.Service; -import com.google.common.base.Preconditions; import com.google.common.base.Strings; +import java.util.logging.Logger; import javax.annotation.Generated; public class ClientLibraryPackageInfoComposer { + + private static final Logger LOGGER = + Logger.getLogger(ClientLibraryPackageInfoComposer.class.getName()); + private static final String DIVIDER = "======================="; private static final String PACKAGE_INFO_DESCRIPTION = @@ -44,7 +48,10 @@ public class ClientLibraryPackageInfoComposer { private static final String SERVICE_DESCRIPTION_HEADER_PATTERN = "Service Description: %s"; public static GapicPackageInfo generatePackageInfo(GapicContext context) { - Preconditions.checkState(!context.services().isEmpty(), "No services found to generate"); + if (!context.containsServices()) { + LOGGER.warning("Generating empty package info since no services were found"); + return null; + } // Pick some service's package, as we assume they are all the same. String libraryPakkage = context.services().get(0).pakkage(); diff --git a/gapic-generator-java/src/main/java/com/google/api/generator/gapic/composer/ClientLibraryReflectConfigComposer.java b/gapic-generator-java/src/main/java/com/google/api/generator/gapic/composer/ClientLibraryReflectConfigComposer.java new file mode 100644 index 0000000000..14909ef897 --- /dev/null +++ b/gapic-generator-java/src/main/java/com/google/api/generator/gapic/composer/ClientLibraryReflectConfigComposer.java @@ -0,0 +1,108 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.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.google.api.generator.gapic.composer; + +import com.google.api.client.util.Preconditions; +import com.google.api.generator.gapic.model.GapicContext; +import com.google.api.generator.gapic.model.Message; +import com.google.api.generator.gapic.model.ReflectConfig; +import com.google.common.annotations.VisibleForTesting; +import com.google.common.collect.ImmutableList; +import java.util.ArrayList; +import java.util.HashSet; +import java.util.List; + +public class ClientLibraryReflectConfigComposer { + private ClientLibraryReflectConfigComposer() {} // Disallow instance creation + + public static List generateReflectConfig(GapicContext context) { + List allConfigs = new ArrayList<>(); + context + .messages() + .forEach( + (fullyQualifiedClassName, msg) -> + allConfigs.addAll(calculateReflectConfigList(fullyQualifiedClassName, msg))); + + List duplicates = calculateDuplicates(allConfigs); + Preconditions.checkState( + duplicates.isEmpty(), "Duplicate binary name entries found: %s", duplicates); + + return allConfigs.stream() + .sorted() + .map(ReflectConfig::new) + .collect(ImmutableList.toImmutableList()); + } + + /** + * List the binary names of all classes in the Message that should have a reflect-config entry. + * + *

Note: Each reflect-config 'name' entry must be the "binary name" of a class to prevent + * ClassNotFoundException warnings during the native-image build. + * + *

Binary names (ex: `foo.Bar$Baz`) are guaranteed to be unique within a jar. By contrast, + * fully qualified class names (ex: `foo.Bar.Baz`) are only unique if standard Java package naming + * conventions are followed. A class `Baz` in package `foo.Bar` would have the same fully + * qualified class name as a nested class `Baz` in the class `Bar` in package `foo`. + * + *

See also the Java Language Specification @ 13.1.1 and 13.1.2 for specifics on the binary + * name format. + */ + @VisibleForTesting + static List calculateReflectConfigList(String fullyQualifiedClassName, Message message) { + final String binaryName = convertToBinaryName(fullyQualifiedClassName); + + List list = new ArrayList<>(); + list.add(binaryName); + for (String nestedEnum : message.nestedEnums()) { + list.add(binaryName + "$" + nestedEnum); + } + if (!message.isEnum()) { + list.add(binaryName + "$Builder"); + } + return list; + } + + /** + * Replace '.' with '$' in fully qualified class names once the classes become nested. + * + *

For example, the fully qualified class name `com.google.foo.Bar.Baz.Car` becomes the binary + * name `com.google.foo.Bar$Baz$Car`. + * + *

This conversion works only when following standard Java naming conventions that packages + * always start with a lowercase letter, and classes always start with an uppercase letter. + */ + @VisibleForTesting + static String convertToBinaryName(String fullyQualifiedClassName) { + StringBuilder result = new StringBuilder(); + boolean isNested = false; + for (String s : fullyQualifiedClassName.split("\\.")) { + if (result.length() != 0) { + result.append(isNested ? "$" : "."); + } + result.append(s); + if (Character.isUpperCase(s.charAt(0))) { + isNested = true; + } + } + return result.toString(); + } + + @VisibleForTesting + static List calculateDuplicates(List allConfigs) { + List duplicates = new ArrayList<>(allConfigs); + new HashSet<>(allConfigs).forEach(duplicates::remove); + return duplicates; + } +} diff --git a/gapic-generator-java/src/main/java/com/google/api/generator/gapic/composer/Composer.java b/gapic-generator-java/src/main/java/com/google/api/generator/gapic/composer/Composer.java index acd914a163..606176852b 100644 --- a/gapic-generator-java/src/main/java/com/google/api/generator/gapic/composer/Composer.java +++ b/gapic-generator-java/src/main/java/com/google/api/generator/gapic/composer/Composer.java @@ -33,6 +33,7 @@ import com.google.api.generator.gapic.model.GapicClass; import com.google.api.generator.gapic.model.GapicContext; import com.google.api.generator.gapic.model.GapicPackageInfo; +import com.google.api.generator.gapic.model.ReflectConfig; import com.google.api.generator.gapic.model.Sample; import com.google.api.generator.gapic.model.Service; import com.google.api.generator.gapic.model.Transport; @@ -52,15 +53,23 @@ public static List composeServiceClasses(GapicContext context) { } public static GapicPackageInfo composePackageInfo(GapicContext context) { + if (!context.containsServices()) { + return null; + } return addApacheLicense(ClientLibraryPackageInfoComposer.generatePackageInfo(context)); } + public static List composeNativeReflectConfig(GapicContext context) { + return ClientLibraryReflectConfigComposer.generateReflectConfig(context); + } + public static List generateServiceClasses(GapicContext context) { List clazzes = new ArrayList<>(); clazzes.addAll(generateStubClasses(context)); clazzes.addAll(generateClientSettingsClasses(context)); clazzes.addAll(generateMockClasses(context, context.services())); clazzes.addAll(generateTestClasses(context)); + clazzes.addAll(generateVersionClasses(context)); return clazzes; } @@ -189,6 +198,15 @@ public static List generateTestClasses(GapicContext context) { return clazzes; } + public static List generateVersionClasses(GapicContext context) { + return context.services().stream() + .collect(Collectors.toMap(Service::pakkage, s -> s, (s1, s2) -> s1)) + .values() + .stream() + .map(service -> LibraryVersionClassComposer.instance().generate(context, service)) + .collect(Collectors.toList()); + } + @VisibleForTesting static List prepareExecutableSamples(List clazzes) { // Include license header, apiShortName, and apiVersion @@ -202,7 +220,7 @@ static List prepareExecutableSamples(List clazzes) { sample -> samples.add( addRegionTagAndHeaderToSample( - sample, gapicClass.apiShortName(), gapicClass.apiVersion()))); + sample, gapicClass.apiShortName(), gapicClass.packageVersion()))); clazzesWithSamples.add(gapicClass.withSamples(samples)); }); return clazzesWithSamples; @@ -224,9 +242,7 @@ protected static List addApacheLicense(List gapicClassLi .map( gapicClass -> { ClassDefinition classWithHeader = - gapicClass - .classDefinition() - .toBuilder() + gapicClass.classDefinition().toBuilder() .setFileHeader(CommentComposer.APACHE_LICENSE_COMMENT) .build(); return GapicClass.create(gapicClass.kind(), classWithHeader, gapicClass.samples()); @@ -236,9 +252,7 @@ protected static List addApacheLicense(List gapicClassLi private static GapicPackageInfo addApacheLicense(GapicPackageInfo gapicPackageInfo) { return GapicPackageInfo.with( - gapicPackageInfo - .packageInfo() - .toBuilder() + gapicPackageInfo.packageInfo().toBuilder() .setFileHeader(CommentComposer.APACHE_LICENSE_COMMENT) .build()); } diff --git a/gapic-generator-java/src/main/java/com/google/api/generator/gapic/composer/LibraryVersionClassComposer.java b/gapic-generator-java/src/main/java/com/google/api/generator/gapic/composer/LibraryVersionClassComposer.java new file mode 100644 index 0000000000..a450526ac6 --- /dev/null +++ b/gapic-generator-java/src/main/java/com/google/api/generator/gapic/composer/LibraryVersionClassComposer.java @@ -0,0 +1,95 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.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.google.api.generator.gapic.composer; + +import com.google.api.generator.engine.ast.AnnotationNode; +import com.google.api.generator.engine.ast.AssignmentExpr; +import com.google.api.generator.engine.ast.ClassDefinition; +import com.google.api.generator.engine.ast.CommentStatement; +import com.google.api.generator.engine.ast.ConcreteReference; +import com.google.api.generator.engine.ast.ExprStatement; +import com.google.api.generator.engine.ast.LineComment; +import com.google.api.generator.engine.ast.ScopeNode; +import com.google.api.generator.engine.ast.StringObjectValue; +import com.google.api.generator.engine.ast.TypeNode; +import com.google.api.generator.engine.ast.ValueExpr; +import com.google.api.generator.engine.ast.Variable; +import com.google.api.generator.engine.ast.VariableExpr; +import com.google.api.generator.gapic.model.GapicClass; +import com.google.api.generator.gapic.model.GapicContext; +import com.google.api.generator.gapic.model.Service; +import java.util.Arrays; + +public class LibraryVersionClassComposer { + private static final LibraryVersionClassComposer INSTANCE = new LibraryVersionClassComposer(); + + private LibraryVersionClassComposer() {} + + public static LibraryVersionClassComposer instance() { + return INSTANCE; + } + + public GapicClass generate(GapicContext context, Service service) { + String packageName = service.pakkage() + ".stub"; + String className = "Version"; + + String artifact = context.artifact(); + String artifactId = artifact; + if (artifact != null && artifact.contains(":")) { + artifactId = artifact.split(":")[1]; + } + + VariableExpr versionVarExpr = + VariableExpr.withVariable( + Variable.builder().setType(TypeNode.STRING).setName("VERSION").build()); + AssignmentExpr versionAssignmentExpr = + AssignmentExpr.builder() + .setVariableExpr( + versionVarExpr.toBuilder() + .setIsDecl(true) + .setScope(ScopeNode.LOCAL) + .setIsStatic(true) + .setIsFinal(true) + .build()) + .setValueExpr(ValueExpr.withValue(StringObjectValue.withValue("0.0.0-SNAPSHOT"))) + .build(); + + ClassDefinition classDef = + ClassDefinition.builder() + .setPackageString(packageName) + .setAnnotations( + Arrays.asList( + AnnotationNode.builder() + .setType( + TypeNode.withReference( + ConcreteReference.withClazz(com.google.api.core.InternalApi.class))) + .setDescription("For internal use only") + .build())) + .setScope(ScopeNode.LOCAL) + .setIsFinal(true) + .setName(className) + .setStatements( + Arrays.asList( + CommentStatement.withComment( + LineComment.withComment( + String.format("{x-version-update-start:%s:current}", artifactId))), + ExprStatement.withExpr(versionAssignmentExpr), + CommentStatement.withComment( + LineComment.withComment("{x-version-update-end}")))) + .build(); + + return GapicClass.create(GapicClass.Kind.MAIN, classDef); + } +} diff --git a/gapic-generator-java/src/main/java/com/google/api/generator/gapic/composer/comment/CommentComposer.java b/gapic-generator-java/src/main/java/com/google/api/generator/gapic/composer/comment/CommentComposer.java index 3ed030417a..498320731f 100644 --- a/gapic-generator-java/src/main/java/com/google/api/generator/gapic/composer/comment/CommentComposer.java +++ b/gapic-generator-java/src/main/java/com/google/api/generator/gapic/composer/comment/CommentComposer.java @@ -18,21 +18,25 @@ import com.google.api.generator.engine.ast.CommentStatement; import com.google.api.generator.engine.ast.LineComment; import com.google.api.generator.engine.ast.Statement; +import com.google.common.base.Strings; import java.util.Arrays; +import java.util.Calendar; import java.util.List; public class CommentComposer { private static final String APACHE_LICENSE_STRING = - "Copyright 2022 Google LLC\n\n" - + "Licensed under the Apache License, Version 2.0 (the \"License\");\n" - + "you may not use this file except in compliance with the License.\n" - + "You may obtain a copy of the License at\n\n" - + " https://www.apache.org/licenses/LICENSE-2.0\n\n" - + "Unless required by applicable law or agreed to in writing, software\n" - + "distributed under the License is distributed on an \"AS IS\" BASIS,\n" - + "WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n" - + "See the License for the specific language governing permissions and\n" - + "limitations under the License."; + String.format( + "Copyright %s Google LLC\n\n" + + "Licensed under the Apache License, Version 2.0 (the \"License\");\n" + + "you may not use this file except in compliance with the License.\n" + + "You may obtain a copy of the License at\n\n" + + " https://www.apache.org/licenses/LICENSE-2.0\n\n" + + "Unless required by applicable law or agreed to in writing, software\n" + + "distributed under the License is distributed on an \"AS IS\" BASIS,\n" + + "WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n" + + "See the License for the specific language governing permissions and\n" + + "limitations under the License.", + getCurrentYear()); private static final String AUTO_GENERATED_CLASS_DISCLAIMER_STRING = "AUTO-GENERATED DOCUMENTATION AND CLASS."; @@ -46,6 +50,9 @@ public class CommentComposer { static final String DEPRECATED_METHOD_STRING = "This method is deprecated and will be removed in the next major version update."; + static final String INTERNAL_ONLY_METHOD_STRING = + "This method is for internal use only. Please do not use it directly."; + public static final CommentStatement APACHE_LICENSE_COMMENT = CommentStatement.withComment(BlockComment.withComment(APACHE_LICENSE_STRING)); @@ -72,4 +79,20 @@ public class CommentComposer { CommentStatement.withComment( LineComment.withComment( "https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library"))); + + // This environment variable is mainly used to override the current year to a fixed year in tests + // so we don't have to update golden tests every year. + // This does not work for golden integration tests that are generated from Bazel rules. Because + // the Bazel rule java_gapic_library calls the generator through proto_custom_library which does + // not pass any environment variables. Golden integration tests still need to be updated every + // year. + private static final String CURRENT_YEAR_OVERRIDE = "CURRENT_YEAR_OVERRIDE"; + + private static String getCurrentYear() { + String testCurrentYear = System.getenv(CURRENT_YEAR_OVERRIDE); + int currentYearFromCalendar = Calendar.getInstance().get(Calendar.YEAR); + return Strings.isNullOrEmpty(testCurrentYear) + ? String.valueOf(currentYearFromCalendar) + : testCurrentYear; + } } diff --git a/gapic-generator-java/src/main/java/com/google/api/generator/gapic/composer/comment/ServiceClientCommentComposer.java b/gapic-generator-java/src/main/java/com/google/api/generator/gapic/composer/comment/ServiceClientCommentComposer.java index 5835c77935..64ea4adf7c 100644 --- a/gapic-generator-java/src/main/java/com/google/api/generator/gapic/composer/comment/ServiceClientCommentComposer.java +++ b/gapic-generator-java/src/main/java/com/google/api/generator/gapic/composer/comment/ServiceClientCommentComposer.java @@ -14,6 +14,8 @@ package com.google.api.generator.gapic.composer.comment; +import static java.util.stream.Collectors.toList; + import com.google.api.generator.engine.ast.CommentStatement; import com.google.api.generator.engine.ast.JavaDocComment; import com.google.api.generator.engine.ast.TypeNode; @@ -27,7 +29,9 @@ import java.util.Arrays; import java.util.Collections; import java.util.List; +import java.util.Map; import java.util.Optional; +import java.util.stream.Collectors; public class ServiceClientCommentComposer { // Tokens. @@ -39,9 +43,6 @@ public class ServiceClientCommentComposer { private static final String SERVICE_DESCRIPTION_INTRO_STRING = "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:"; - private static final String SERVICE_DESCRIPTION_SURFACE_SUMMARY_STRING = - "The surface of this class includes several types of Java methods for each of the API's " - + "methods:"; private static final String SERVICE_DESCRIPTION_SURFACE_CODA_STRING = "See the individual methods for example code."; private static final String SERVICE_DESCRIPTION_RESOURCE_NAMES_FORMATTING_STRING = @@ -61,18 +62,6 @@ public class ServiceClientCommentComposer { private static final String METHOD_DESCRIPTION_SAMPLE_CODE_SUMMARY_STRING = "Sample code:"; - private static final List SERVICE_DESCRIPTION_SURFACE_DESCRIPTION = - Arrays.asList( - "A \"flattened\" method. With this type of method, the fields of the request type have" - + " been converted into function parameters. It may be the case that not all fields" - + " are available as parameters, and not every API method will have a flattened" - + " method entry point.", - "A \"request object\" method. This type of method only takes one parameter, a request" - + " object, which must be constructed before the call. Not every API method will" - + " have a request object method.", - "A \"callable\" method. This type of method takes no parameters and returns an immutable " - + "API callable object, which can be used to initiate calls to the service."); - // Patterns. private static final String CREATE_METHOD_STUB_ARG_PATTERN = "Constructs an instance of %s, using the given stub for making calls. This is for" @@ -109,6 +98,7 @@ public class ServiceClientCommentComposer { + " operation returned by another API method call."); public static List createClassHeaderComments( + Map> methodVariantsForClientHeader, Service service, String classMethodSampleCode, String credentialsSampleCode, @@ -124,6 +114,12 @@ public static List createClassHeaderComments( classHeaderJavadocBuilder = classHeaderJavadocBuilder.addUnescapedComment(descriptionComment); } + // Include google.api.api_version breadcrumb comment. + if (service.hasApiVersion()) { + classHeaderJavadocBuilder.addParagraph( + String.format("This client uses %s version %s.", service.name(), service.apiVersion())); + } + // Service introduction. classHeaderJavadocBuilder.addParagraph(SERVICE_DESCRIPTION_INTRO_STRING); classHeaderJavadocBuilder.addSampleCode(classMethodSampleCode); @@ -132,8 +128,14 @@ public static List createClassHeaderComments( classHeaderJavadocBuilder.addParagraph( String.format( SERVICE_DESCRIPTION_CLOSE_PATTERN, ClassNames.getServiceClientClassName(service))); - classHeaderJavadocBuilder.addParagraph(SERVICE_DESCRIPTION_SURFACE_SUMMARY_STRING); - classHeaderJavadocBuilder.addOrderedList(SERVICE_DESCRIPTION_SURFACE_DESCRIPTION); + + // Build the map of methods and descriptions to create the table in Client Overviews + List methodAndVariantsList = + service.methods().stream() + .map((Method method) -> createMethodAndVariants(method, methodVariantsForClientHeader)) + .collect(toList()); + + classHeaderJavadocBuilder.addUnescapedComment(createTableOfMethods(methodAndVariantsList)); classHeaderJavadocBuilder.addParagraph(SERVICE_DESCRIPTION_SURFACE_CODA_STRING); // Formatting resource names. @@ -206,6 +208,10 @@ public static List createRpcMethodHeaderComment( methodJavadocBuilder.setDeprecated(CommentComposer.DEPRECATED_METHOD_STRING); } + if (method.isInternalApi()) { + methodJavadocBuilder.setInternalOnly(CommentComposer.INTERNAL_ONLY_METHOD_STRING); + } + List comments = new ArrayList<>(); comments.add(CommentComposer.AUTO_GENERATED_METHOD_COMMENT); if (!methodJavadocBuilder.emptyComments()) { @@ -215,6 +221,104 @@ public static List createRpcMethodHeaderComment( return comments; } + private static MethodAndVariants createMethodAndVariants( + Method method, Map> methodVariantsForClientHeader) { + String name = method.name(); + String description = method.description(); + if (description == null) description = ""; + return new MethodAndVariants(name, description, methodVariantsForClientHeader.get(name)); + } + + private static String createTableOfMethods(List methodAndVariantsList) { + String FLATTENED_METHODS = + "

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

\n"; + String REQUEST_OBJECT_METHODS = + "

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

\n"; + String CALLABLE_METHODS = + "

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

\n"; + String ASYNC_METHODS = + "

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

\n"; + + StringBuilder tableBuilder = new StringBuilder(); + tableBuilder + .append("\n") + .append(" \n") + .append(" \n") + .append(" \n") + .append(" \n") + .append(" \n") + .append(" \n"); + for (MethodAndVariants method : methodAndVariantsList) { + tableBuilder + .append(" \n") + .append(" \n") + .append(" \n") + .append(" \n").append(" \n"); + } + tableBuilder.append("
Methods
MethodDescriptionMethod Variants
") + .append(CommentFormatter.formatAsJavaDocComment(method.method, null)) + .append("") + .append(CommentFormatter.formatAsJavaDocComment(method.description, null)) + .append("\n"); + generateUnorderedListMethodVariants( + tableBuilder, REQUEST_OBJECT_METHODS, method.requestObjectVariants); + generateUnorderedListMethodVariants( + tableBuilder, FLATTENED_METHODS, method.flattenedVariants); + generateUnorderedListMethodVariants(tableBuilder, ASYNC_METHODS, method.asyncVariants); + generateUnorderedListMethodVariants(tableBuilder, CALLABLE_METHODS, method.callableVariants); + tableBuilder.append("
\n"); + return tableBuilder.toString(); + } + + private static void generateUnorderedListMethodVariants( + StringBuilder tableBuilder, String methodType, List methodVariants) { + List formattedMethodVariants = + methodVariants.stream() + .map( + methodVariant -> + CommentFormatter.formatAsJavaDocComment( + methodVariant, null)) // Apply the formatting to each element + .collect(Collectors.toList()); + if (!methodVariants.isEmpty()) { + tableBuilder + .append(" " + methodType + " ") + .append("
    \n") + .append("
  • ") + .append(String.join("\n
  • ", formattedMethodVariants)) + .append("\n") + .append("
") + .append("\n"); + } + } + + private static class MethodAndVariants { + private final String method; + // Description may be empty. It comes from the proto comments above the method. If it is empty, + // then nothing will be displayed. + private final String description; + + private final List flattenedVariants; + private final List requestObjectVariants; + private final List callableVariants; + private final List asyncVariants; + + private MethodAndVariants(String method, String description, List methodVariants) { + this.method = method; + this.description = description; + requestObjectVariants = + methodVariants.stream().filter(s -> s.contains("request")).collect(toList()); + // Flattened method variants do not have a suffix, so the easiest way to identify them is by + // removing all other method variant types. + methodVariants.removeAll(requestObjectVariants); + callableVariants = + methodVariants.stream().filter(s -> s.contains("Callable")).collect(toList()); + methodVariants.removeAll(callableVariants); + asyncVariants = methodVariants.stream().filter(s -> s.contains("Async")).collect(toList()); + methodVariants.removeAll(asyncVariants); + flattenedVariants = methodVariants; + } + } + public static List createRpcMethodHeaderComment( Method method, Optional sampleCodeOpt) { return createRpcMethodHeaderComment(method, Collections.emptyList(), sampleCodeOpt); @@ -251,6 +355,10 @@ public static List createRpcCallableMethodHeaderComment( methodJavadocBuilder.setDeprecated(CommentComposer.DEPRECATED_METHOD_STRING); } + if (method.isInternalApi()) { + methodJavadocBuilder.setInternalOnly(CommentComposer.INTERNAL_ONLY_METHOD_STRING); + } + return Arrays.asList( CommentComposer.AUTO_GENERATED_METHOD_COMMENT, CommentStatement.withComment(methodJavadocBuilder.build())); diff --git a/gapic-generator-java/src/main/java/com/google/api/generator/gapic/composer/comment/SettingsCommentComposer.java b/gapic-generator-java/src/main/java/com/google/api/generator/gapic/composer/comment/SettingsCommentComposer.java index 2e119b670f..8dd115883e 100644 --- a/gapic-generator-java/src/main/java/com/google/api/generator/gapic/composer/comment/SettingsCommentComposer.java +++ b/gapic-generator-java/src/main/java/com/google/api/generator/gapic/composer/comment/SettingsCommentComposer.java @@ -39,7 +39,13 @@ public class SettingsCommentComposer { private static final String CLASS_HEADER_DEFAULT_ADDRESS_PORT_PATTERN = "The default service address (%s) and default port (%d) are used."; private static final String CLASS_HEADER_SAMPLE_CODE_PATTERN = - "For example, to set the total timeout of %s to 30 seconds:"; + "For example, to set the [RetrySettings](https://cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.retrying.RetrySettings) of %s:"; + + private static final String CLASS_HEADER_LRO_SAMPLE_CODE_PATTERN = + "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 %s:"; + + private static final String CLASS_HEADER_SAMPLE_CODE_SUFFIX = + "Please refer to the [Client Side Retry Guide](https://docs.cloud.google.com/java/docs/client-retries) for additional support in setting retries."; private static final String CLASS_HEADER_BUILDER_DESCRIPTION = "The builder of this class is recursive, so contained classes are themselves builders. When" @@ -53,28 +59,31 @@ public class SettingsCommentComposer { "Retries are configured for idempotent methods but not for non-idempotent methods."; public static final CommentStatement DEFAULT_SCOPES_COMMENT = - toSimpleComment("The default scopes of the service."); + toCommentStatement("The default scopes of the service."); public static final CommentStatement DEFAULT_EXECUTOR_PROVIDER_BUILDER_METHOD_COMMENT = - toSimpleComment("Returns a builder for the default ExecutorProvider for this service."); + toCommentStatement("Returns a builder for the default ExecutorProvider for this service."); + + public static final CommentStatement DEFAULT_SERVICE_NAME_METHOD_COMMENT = + toCommentStatement("Returns the default service name."); public static final CommentStatement DEFAULT_SERVICE_ENDPOINT_METHOD_COMMENT = - toSimpleComment("Returns the default service endpoint."); + toCommentStatement("Returns the default service endpoint."); public static final CommentStatement DEFAULT_SERVICE_MTLS_ENDPOINT_METHOD_COMMENT = - toSimpleComment("Returns the default mTLS service endpoint."); + toCommentStatement("Returns the default mTLS service endpoint."); public static final CommentStatement DEFAULT_SERVICE_SCOPES_METHOD_COMMENT = - toSimpleComment("Returns the default service scopes."); + toCommentStatement("Returns the default service scopes."); public static final CommentStatement DEFAULT_CREDENTIALS_PROVIDER_BUILDER_METHOD_COMMENT = - toSimpleComment("Returns a builder for the default credentials for this service."); + toCommentStatement("Returns a builder for the default credentials for this service."); public static final CommentStatement DEFAULT_TRANSPORT_PROVIDER_BUILDER_METHOD_COMMENT = - toSimpleComment("Returns a builder for the default ChannelProvider for this service."); + toCommentStatement("Returns a builder for the default ChannelProvider for this service."); public static final CommentStatement NEW_BUILDER_METHOD_COMMENT = - toSimpleComment("Returns a new builder for this class."); + toCommentStatement("Returns a new builder for this class."); public static final CommentStatement TO_BUILDER_METHOD_COMMENT = - toSimpleComment("Returns a builder containing all the values of this settings class."); + toCommentStatement("Returns a builder containing all the values of this settings class."); public static final List APPLY_TO_ALL_UNARY_METHODS_METHOD_COMMENTS = Arrays.asList( @@ -94,9 +103,10 @@ public class SettingsCommentComposer { public SettingsCommentComposer(String transportPrefix) { this.newTransportBuilderMethodComment = - toSimpleComment(String.format("Returns a new %s builder for this class.", transportPrefix)); + toCommentStatement( + String.format("Returns a new %s builder for this class.", transportPrefix)); this.transportProviderBuilderMethodComment = - toSimpleComment( + toCommentStatement( String.format( "Returns a builder for the default %s ChannelProvider for this service.", transportPrefix)); @@ -111,23 +121,21 @@ public CommentStatement getTransportProviderBuilderMethodComment() { } public static CommentStatement createCallSettingsGetterComment( - String javaMethodName, boolean isMethodDeprecated) { - String methodComment = String.format(CALL_SETTINGS_METHOD_DOC_PATTERN, javaMethodName); - return isMethodDeprecated - ? toDeprecatedSimpleComment(methodComment) - : toSimpleComment(methodComment); + String javaMethodName, boolean isMethodDeprecated, boolean isMethodInternal) { + return toCommentStatement( + String.format(CALL_SETTINGS_METHOD_DOC_PATTERN, javaMethodName), + isMethodDeprecated, + isMethodInternal); } public static CommentStatement createBuilderClassComment(String outerClassName) { - return toSimpleComment(String.format(BUILDER_CLASS_DOC_PATTERN, outerClassName)); + return toCommentStatement(String.format(BUILDER_CLASS_DOC_PATTERN, outerClassName)); } public static CommentStatement createCallSettingsBuilderGetterComment( - String javaMethodName, boolean isMethodDeprecated) { + String javaMethodName, boolean isMethodDeprecated, boolean isMethodInternal) { String methodComment = String.format(CALL_SETTINGS_BUILDER_METHOD_DOC_PATTERN, javaMethodName); - return isMethodDeprecated - ? toDeprecatedSimpleComment(methodComment) - : toSimpleComment(methodComment); + return toCommentStatement(methodComment, isMethodDeprecated, isMethodInternal); } public static List createClassHeaderComments( @@ -136,6 +144,8 @@ public static List createClassHeaderComments( boolean isDeprecated, Optional methodNameOpt, Optional sampleCodeOpt, + Optional lroMethodNameOpt, + Optional lroSampleCodeOpt, TypeNode classType) { // Split default address and port. int colonIndex = defaultHost.indexOf(COLON); @@ -167,7 +177,18 @@ public static List createClassHeaderComments( String.format( CLASS_HEADER_SAMPLE_CODE_PATTERN, JavaStyle.toLowerCamelCase(methodNameOpt.get()))) - .addSampleCode(sampleCodeOpt.get()); + .addSampleCode(sampleCodeOpt.get()) + .addComment(CLASS_HEADER_SAMPLE_CODE_SUFFIX); + } + + if (lroMethodNameOpt.isPresent() && lroSampleCodeOpt.isPresent()) { + javaDocCommentBuilder = + javaDocCommentBuilder + .addParagraph( + String.format( + CLASS_HEADER_LRO_SAMPLE_CODE_PATTERN, + JavaStyle.toLowerCamelCase(lroMethodNameOpt.get()))) + .addSampleCode(lroSampleCodeOpt.get()); } if (isDeprecated) { @@ -179,15 +200,21 @@ public static List createClassHeaderComments( CommentStatement.withComment(javaDocCommentBuilder.build())); } - private static CommentStatement toSimpleComment(String comment) { - return CommentStatement.withComment(JavaDocComment.withComment(comment)); + private static CommentStatement toCommentStatement(String comment) { + return toCommentStatement(comment, false, false); } - private static CommentStatement toDeprecatedSimpleComment(String comment) { - return CommentStatement.withComment( - JavaDocComment.builder() - .addComment(comment) - .setDeprecated(CommentComposer.DEPRECATED_METHOD_STRING) - .build()); + private static CommentStatement toCommentStatement( + String comment, boolean isDeprecated, boolean isInternal) { + JavaDocComment.Builder docBuilder = JavaDocComment.builder().addComment(comment); + docBuilder = + isDeprecated + ? docBuilder.setDeprecated(CommentComposer.DEPRECATED_METHOD_STRING) + : docBuilder; + docBuilder = + isInternal + ? docBuilder.setInternalOnly(CommentComposer.INTERNAL_ONLY_METHOD_STRING) + : docBuilder; + return CommentStatement.withComment(docBuilder.build()); } } diff --git a/gapic-generator-java/src/main/java/com/google/api/generator/gapic/composer/common/AbstractServiceCallableFactoryClassComposer.java b/gapic-generator-java/src/main/java/com/google/api/generator/gapic/composer/common/AbstractServiceCallableFactoryClassComposer.java index 9fcbaa0f9e..fd861390a7 100644 --- a/gapic-generator-java/src/main/java/com/google/api/generator/gapic/composer/common/AbstractServiceCallableFactoryClassComposer.java +++ b/gapic-generator-java/src/main/java/com/google/api/generator/gapic/composer/common/AbstractServiceCallableFactoryClassComposer.java @@ -62,6 +62,11 @@ protected TransportContext getTransportContext() { @Override public GapicClass generate(GapicContext context, Service service) { + // Do not generate the Callable Factory if there are no RPCs enabled for the Transport + if (!service.hasAnyEnabledMethodsForTransport(getTransportContext().transport())) { + return GapicClass.createNonGeneratedGapicClass(); + } + TypeStore typeStore = createTypes(service); String className = @@ -129,15 +134,15 @@ protected MethodDefinition createUnaryCallableMethod(Service service, TypeStore return createGenericCallableMethod( service, typeStore, - /*methodTemplateNames=*/ methodTemplateNames, - /*returnCallableKindName=*/ methodVariantName, - /*returnCallableTemplateNames=*/ methodTemplateNames, - /*methodVariantName=*/ methodVariantName, - /*transportCallSettingsTemplateObjects=*/ methodTemplateNames.stream() + /* methodTemplateNames= */ methodTemplateNames, + /* returnCallableKindName= */ methodVariantName, + /* returnCallableTemplateNames= */ methodTemplateNames, + /* methodVariantName= */ methodVariantName, + /* transportCallSettingsTemplateObjects= */ methodTemplateNames.stream() .map(n -> (Object) n) .collect(Collectors.toList()), - /*callSettingsVariantName=*/ methodVariantName, - /*callSettingsTemplateObjects=*/ methodTemplateNames.stream() + /* callSettingsVariantName= */ methodVariantName, + /* callSettingsTemplateObjects= */ methodTemplateNames.stream() .map(n -> (Object) n) .collect(Collectors.toList())); } @@ -152,15 +157,15 @@ protected MethodDefinition createPagedCallableMethod(Service service, TypeStore return createGenericCallableMethod( service, typeStore, - /*methodTemplateNames=*/ methodTemplateNames, - /*returnCallableKindName=*/ "Unary", - /*returnCallableTemplateNames=*/ Arrays.asList( + /* methodTemplateNames= */ methodTemplateNames, + /* returnCallableKindName= */ "Unary", + /* returnCallableTemplateNames= */ Arrays.asList( requestTemplateName, pagedResponseTemplateName), - /*methodVariantName=*/ methodVariantName, - /*transportCallSettingsTemplateObjects=*/ Arrays.asList( + /* methodVariantName= */ methodVariantName, + /* transportCallSettingsTemplateObjects= */ Arrays.asList( requestTemplateName, responseTemplateName), - /*callSettingsVariantName=*/ methodVariantName, - /*callSettingsTemplateObjects=*/ methodTemplateNames.stream() + /* callSettingsVariantName= */ methodVariantName, + /* callSettingsTemplateObjects= */ methodTemplateNames.stream() .map(n -> (Object) n) .collect(Collectors.toList())); } @@ -173,15 +178,15 @@ protected MethodDefinition createBatchingCallableMethod(Service service, TypeSto return createGenericCallableMethod( service, typeStore, - /*methodTemplateNames=*/ methodTemplateNames, - /*returnCallableKindName=*/ "Unary", - /*returnCallableTemplateNames=*/ methodTemplateNames, - /*methodVariantName=*/ methodVariantName, - /*transportCallSettingsTemplateObjects=*/ methodTemplateNames.stream() + /* methodTemplateNames= */ methodTemplateNames, + /* returnCallableKindName= */ "Unary", + /* returnCallableTemplateNames= */ methodTemplateNames, + /* methodVariantName= */ methodVariantName, + /* transportCallSettingsTemplateObjects= */ methodTemplateNames.stream() .map(n -> (Object) n) .collect(Collectors.toList()), - /*callSettingsVariantName=*/ methodVariantName, - /*callSettingsTemplateObjects=*/ methodTemplateNames.stream() + /* callSettingsVariantName= */ methodVariantName, + /* callSettingsTemplateObjects= */ methodTemplateNames.stream() .map(n -> (Object) n) .collect(Collectors.toList())); } @@ -198,15 +203,15 @@ protected MethodDefinition createServerStreamingCallableMethod( return createGenericCallableMethod( service, typeStore, - /*methodTemplateNames=*/ methodTemplateNames, - /*returnCallableKindName=*/ methodVariantName, - /*returnCallableTemplateNames=*/ methodTemplateNames, - /*methodVariantName=*/ methodVariantName, - /*grpcCallSettingsTemplateObjects=*/ methodTemplateNames.stream() + /* methodTemplateNames= */ methodTemplateNames, + /* returnCallableKindName= */ methodVariantName, + /* returnCallableTemplateNames= */ methodTemplateNames, + /* methodVariantName= */ methodVariantName, + /* grpcCallSettingsTemplateObjects= */ methodTemplateNames.stream() .map(n -> (Object) n) .collect(Collectors.toList()), - /*callSettingsVariantName=*/ methodVariantName, - /*callSettingsTemplateObjects=*/ methodTemplateNames.stream() + /* callSettingsVariantName= */ methodVariantName, + /* callSettingsTemplateObjects= */ methodTemplateNames.stream() .map(n -> (Object) n) .collect(Collectors.toList())); } diff --git a/gapic-generator-java/src/main/java/com/google/api/generator/gapic/composer/common/AbstractServiceClientClassComposer.java b/gapic-generator-java/src/main/java/com/google/api/generator/gapic/composer/common/AbstractServiceClientClassComposer.java index b6095be08b..913ffd0f5c 100644 --- a/gapic-generator-java/src/main/java/com/google/api/generator/gapic/composer/common/AbstractServiceClientClassComposer.java +++ b/gapic-generator-java/src/main/java/com/google/api/generator/gapic/composer/common/AbstractServiceClientClassComposer.java @@ -18,6 +18,7 @@ import com.google.api.core.ApiFuture; import com.google.api.core.ApiFutures; import com.google.api.core.BetaApi; +import com.google.api.core.InternalApi; import com.google.api.gax.core.BackgroundResource; import com.google.api.gax.longrunning.OperationFuture; import com.google.api.gax.paging.AbstractFixedSizeCollection; @@ -62,6 +63,7 @@ import com.google.api.generator.gapic.composer.samplecode.ServiceClientMethodSampleComposer; import com.google.api.generator.gapic.composer.store.TypeStore; import com.google.api.generator.gapic.composer.utils.ClassNames; +import com.google.api.generator.gapic.composer.utils.CommonStrings; import com.google.api.generator.gapic.composer.utils.PackageChecker; import com.google.api.generator.gapic.model.Field; import com.google.api.generator.gapic.model.GapicClass; @@ -103,7 +105,6 @@ import javax.annotation.Generated; public abstract class AbstractServiceClientClassComposer implements ClassComposer { - private static final String PAGED_RESPONSE_TYPE_NAME_PATTERN = "%sPagedResponse"; private static final String CALLABLE_NAME_PATTERN = "%sCallable"; private static final String PAGED_CALLABLE_NAME_PATTERN = "%sPagedCallable"; private static final String OPERATION_CALLABLE_NAME_PATTERN = "%sOperationCallable"; @@ -127,6 +128,21 @@ protected TransportContext getTransportContext() { return transportContext; } + private static List createMethodAnnotations(Method method, TypeStore typeStore) { + List annotations = new ArrayList<>(); + if (method.isDeprecated()) { + annotations.add(AnnotationNode.withType(TypeNode.DEPRECATED)); + } + + if (method.isInternalApi()) { + annotations.add( + AnnotationNode.withTypeAndDescription( + typeStore.get("InternalApi"), CommonStrings.INTERNAL_API_WARNING)); + } + + return annotations; + } + @Override public GapicClass generate(GapicContext context, Service service) { Map resourceNames = context.helperResourceNames(); @@ -136,14 +152,12 @@ public GapicClass generate(GapicContext context, Service service) { GapicClass.Kind kind = Kind.MAIN; String pakkage = service.pakkage(); boolean hasLroClient = service.hasStandardLroMethods(); - List samples = new ArrayList<>(); Map> grpcRpcsToJavaMethodNames = new HashMap<>(); + Map> methodVariantsForClientHeader = new HashMap<>(); ClassDefinition classDef = ClassDefinition.builder() - .setHeaderCommentStatements( - createClassHeaderComments(service, typeStore, resourceNames, messageTypes, samples)) .setPackageString(pakkage) .setAnnotations(createClassAnnotations(service, typeStore)) .setScope(ScopeNode.PUBLIC) @@ -158,14 +172,23 @@ public GapicClass generate(GapicContext context, Service service) { resourceNames, hasLroClient, grpcRpcsToJavaMethodNames, + methodVariantsForClientHeader, samples)) .setNestedClasses(createNestedPagingClasses(service, messageTypes, typeStore)) + .setHeaderCommentStatements( + createClassHeaderComments( + methodVariantsForClientHeader, + service, + typeStore, + resourceNames, + messageTypes, + samples)) .build(); updateGapicMetadata(context, service, className, grpcRpcsToJavaMethodNames); return GapicClass.create(kind, classDef, SampleComposerUtil.handleDuplicateSamples(samples)) .withApiShortName(service.apiShortName()) - .withApiVersion(service.apiVersion()); + .withPackageVersion(service.packageVersion()); } private static List createClassAnnotations(Service service, TypeStore typeStore) { @@ -189,6 +212,7 @@ private static List createClassImplements(TypeStore typeStore) { } protected List createClassHeaderComments( + Map> methodVariantsForClientHeader, Service service, TypeStore typeStore, Map resourceNames, @@ -207,6 +231,7 @@ protected List createClassHeaderComments( clientType, settingsType, service); samples.addAll(Arrays.asList(classMethodSampleCode, credentialsSampleCode, endpointSampleCode)); return ServiceClientCommentComposer.createClassHeaderComments( + methodVariantsForClientHeader, service, SampleCodeWriter.writeInlineSample(classMethodSampleCode.body()), SampleCodeWriter.writeInlineSample(credentialsSampleCode.body()), @@ -223,6 +248,7 @@ private List createClassMethods( Map resourceNames, boolean hasLroClient, Map> grpcRpcToJavaMethodMetadata, + Map> methodVariantsForClientHeader, List samples) { List methods = new ArrayList<>(); methods.addAll(createStaticCreatorMethods(service, typeStore)); @@ -230,7 +256,13 @@ private List createClassMethods( methods.addAll(createGetterMethods(service, typeStore, hasLroClient)); methods.addAll( createServiceMethods( - service, messageTypes, typeStore, resourceNames, grpcRpcToJavaMethodMetadata, samples)); + service, + messageTypes, + typeStore, + resourceNames, + grpcRpcToJavaMethodMetadata, + methodVariantsForClientHeader, + samples)); methods.addAll(createBackgroundResourceMethods(service, typeStore)); return methods; } @@ -561,18 +593,53 @@ private List createGetterMethods( .collect(Collectors.toList()); } + private static String getJavaMethod(MethodDefinition m) { + StringBuilder methodSignature = new StringBuilder(); + + // Method name + methodSignature.append(m.methodIdentifier().name()).append("("); + + // Iterate through and add all parameters + List parameters = + m.arguments().stream().map(VariableExpr::variable).collect(Collectors.toList()); + + // If reference is empty, that means the parameter is a non-Object type. Therefore, use the + // typeKind directly. + for (int i = 0; i < parameters.size(); i++) { + Variable param = parameters.get(i); + String paramType = + param.type().reference() != null + ? param.type().reference().name() + " " + : param.type().typeKind().name().toLowerCase() + " "; + String paramName = param.identifier().name(); + + methodSignature.append(paramType).append(paramName); + + // Add a comma if there are more parameters + if (i < parameters.size() - 1) { + methodSignature.append(", "); + } + } + + methodSignature.append(")"); + + return methodSignature.toString(); + } + private static List createServiceMethods( Service service, Map messageTypes, TypeStore typeStore, Map resourceNames, Map> grpcRpcToJavaMethodMetadata, + Map> methodVariantsForClientHeader, List samples) { List javaMethods = new ArrayList<>(); Function javaMethodNameFn = m -> m.methodIdentifier().name(); for (Method method : service.methods()) { if (!grpcRpcToJavaMethodMetadata.containsKey(method.name())) { grpcRpcToJavaMethodMetadata.put(method.name(), new ArrayList<>()); + methodVariantsForClientHeader.put(method.name(), new ArrayList<>()); } if (method.stream().equals(Stream.NONE)) { List generatedMethods = @@ -592,6 +659,14 @@ private static List createServiceMethods( generatedMethods.stream() .map(m -> javaMethodNameFn.apply(m)) .collect(Collectors.toList())); + + // Collect data for Client header + methodVariantsForClientHeader + .get(method.name()) + .addAll( + generatedMethods.stream() + .map(AbstractServiceClientClassComposer::getJavaMethod) + .collect(Collectors.toList())); javaMethods.addAll(generatedMethods); MethodDefinition generatedMethod = @@ -604,8 +679,9 @@ private static List createServiceMethods( samples, service); - // Collect data for gapic_metadata.json. + // Collect data for gapic_metadata.json and client header. grpcRpcToJavaMethodMetadata.get(method.name()).add(javaMethodNameFn.apply(generatedMethod)); + methodVariantsForClientHeader.get(method.name()).add(getJavaMethod(generatedMethod)); javaMethods.add(generatedMethod); } if (method.hasLro()) { @@ -613,8 +689,9 @@ private static List createServiceMethods( createLroCallableMethod( service, method, typeStore, messageTypes, resourceNames, samples); - // Collect data for gapic_metadata.json. + // Collect data for gapic_metadata.json and client header. grpcRpcToJavaMethodMetadata.get(method.name()).add(javaMethodNameFn.apply(generatedMethod)); + methodVariantsForClientHeader.get(method.name()).add(getJavaMethod(generatedMethod)); javaMethods.add(generatedMethod); } if (method.isPaged()) { @@ -622,15 +699,17 @@ private static List createServiceMethods( createPagedCallableMethod( service, method, typeStore, messageTypes, resourceNames, samples); - // Collect data for gapic_metadata.json. + // Collect data for gapic_metadata.json and client header. grpcRpcToJavaMethodMetadata.get(method.name()).add(javaMethodNameFn.apply(generatedMethod)); + methodVariantsForClientHeader.get(method.name()).add(getJavaMethod(generatedMethod)); javaMethods.add(generatedMethod); } MethodDefinition generatedMethod = createCallableMethod(service, method, typeStore, messageTypes, resourceNames, samples); - // Collect data for the gapic_metadata.json file. + // Collect data for the gapic_metadata.json file and client header. grpcRpcToJavaMethodMetadata.get(method.name()).add(javaMethodNameFn.apply(generatedMethod)); + methodVariantsForClientHeader.get(method.name()).add(getJavaMethod(generatedMethod)); javaMethods.add(generatedMethod); } return javaMethods; @@ -649,7 +728,8 @@ private static List createMethodVariants( TypeNode methodInputType = method.inputType(); TypeNode methodOutputType = method.isPaged() - ? typeStore.get(String.format(PAGED_RESPONSE_TYPE_NAME_PATTERN, method.name())) + ? typeStore.get( + String.format(CommonStrings.PAGED_RESPONSE_TYPE_NAME_PATTERN, method.name())) : method.outputType(); if (method.hasLro()) { LongrunningOperation lro = method.lro(); @@ -738,11 +818,8 @@ private static List createMethodVariants( methodVariantBuilder.setReturnType(methodOutputType).setReturnExpr(rpcInvocationExpr); } - if (method.isDeprecated()) { - methodVariantBuilder = - methodVariantBuilder.setAnnotations( - Arrays.asList(AnnotationNode.withType(TypeNode.DEPRECATED))); - } + methodVariantBuilder = + methodVariantBuilder.setAnnotations(createMethodAnnotations(method, typeStore)); methodVariantBuilder = methodVariantBuilder.setBody(statements); javaMethods.add(methodVariantBuilder.build()); } @@ -762,9 +839,9 @@ private static MethodDefinition createMethodDefaultMethod( TypeNode methodInputType = method.inputType(); TypeNode methodOutputType = method.isPaged() - ? typeStore.get(String.format(PAGED_RESPONSE_TYPE_NAME_PATTERN, method.name())) + ? typeStore.get( + String.format(CommonStrings.PAGED_RESPONSE_TYPE_NAME_PATTERN, method.name())) : method.outputType(); - List annotations = new ArrayList<>(); if (method.hasLro()) { LongrunningOperation lro = method.lro(); methodOutputType = @@ -775,13 +852,6 @@ private static MethodDefinition createMethodDefaultMethod( .copyAndSetGenerics( Arrays.asList( lro.responseType().reference(), lro.metadataType().reference()))); - if (method.lro().operationServiceStubType() != null) { - annotations.add( - AnnotationNode.withTypeAndDescription( - typeStore.get("BetaApi"), - "The surface for long-running operations is not stable yet and may change in the" - + " future.")); - } } // Construct the method that accepts a request proto. @@ -828,10 +898,6 @@ private static MethodDefinition createMethodDefaultMethod( .setName(String.format(method.hasLro() ? "%sAsync" : "%s", methodName)) .setArguments(Arrays.asList(requestArgVarExpr)); - if (method.isDeprecated()) { - annotations.add(AnnotationNode.withType(TypeNode.DEPRECATED)); - } - if (isProtoEmptyType(methodOutputType)) { methodBuilder = methodBuilder @@ -842,8 +908,7 @@ private static MethodDefinition createMethodDefaultMethod( methodBuilder.setReturnExpr(callableMethodExpr).setReturnType(methodOutputType); } - methodBuilder.setAnnotations(annotations); - + methodBuilder.setAnnotations(createMethodAnnotations(method, typeStore)); return methodBuilder.build(); } @@ -909,7 +974,7 @@ private static MethodDefinition createCallableMethod( rawCallableReturnType = typeStore.get("BidiStreamingCallable"); break; case NONE: - // Fall through. + // Fall through. default: rawCallableReturnType = typeStore.get("UnaryCallable"); } @@ -982,11 +1047,8 @@ private static MethodDefinition createCallableMethod( } MethodDefinition.Builder methodDefBuilder = MethodDefinition.builder(); - if (method.isDeprecated()) { - methodDefBuilder = - methodDefBuilder.setAnnotations( - Arrays.asList(AnnotationNode.withType(TypeNode.DEPRECATED))); - } + + methodDefBuilder = methodDefBuilder.setAnnotations(createMethodAnnotations(method, typeStore)); return methodDefBuilder .setHeaderCommentStatements( @@ -1717,6 +1779,7 @@ private static TypeStore createTypes(Service service, Map messa ApiFutures.class, BackgroundResource.class, BetaApi.class, + InternalApi.class, BidiStreamingCallable.class, ClientStreamingCallable.class, Generated.class, @@ -1771,7 +1834,7 @@ private static void createVaporTypes(Service service, TypeStore typeStore) { service.pakkage(), service.methods().stream() .filter(m -> m.isPaged()) - .map(m -> String.format(PAGED_RESPONSE_TYPE_NAME_PATTERN, m.name())) + .map(m -> String.format(CommonStrings.PAGED_RESPONSE_TYPE_NAME_PATTERN, m.name())) .collect(Collectors.toList()), true, ClassNames.getServiceClientClassName(service)); @@ -1789,7 +1852,7 @@ private static List getGenericsForCallable( return Arrays.asList( method.inputType().reference(), typeStore - .get(String.format(PAGED_RESPONSE_TYPE_NAME_PATTERN, method.name())) + .get(String.format(CommonStrings.PAGED_RESPONSE_TYPE_NAME_PATTERN, method.name())) .reference()); } return Arrays.asList(method.inputType().reference(), method.outputType().reference()); @@ -1835,12 +1898,15 @@ private static void updateGapicMetadata( serviceClientProtoBuilder.putRpcs(rpcName, methodList); } - metadataBuilder = - metadataBuilder.putServices( - service.name(), - GapicMetadata.ServiceForTransport.newBuilder() - .putClients("grpc", serviceClientProtoBuilder.build()) - .build()); + GapicMetadata.ServiceForTransport.Builder grpcServiceClient = + GapicMetadata.ServiceForTransport.newBuilder() + .putClients("grpc", serviceClientProtoBuilder.build()); + + if (service.hasApiVersion()) { + grpcServiceClient.setApiVersion(service.apiVersion()); + } + + metadataBuilder = metadataBuilder.putServices(service.name(), grpcServiceClient.build()); context.updateGapicMetadata(metadataBuilder.build()); } } diff --git a/gapic-generator-java/src/main/java/com/google/api/generator/gapic/composer/common/AbstractServiceClientTestClassComposer.java b/gapic-generator-java/src/main/java/com/google/api/generator/gapic/composer/common/AbstractServiceClientTestClassComposer.java index fd6686212f..175d45bc41 100644 --- a/gapic-generator-java/src/main/java/com/google/api/generator/gapic/composer/common/AbstractServiceClientTestClassComposer.java +++ b/gapic-generator-java/src/main/java/com/google/api/generator/gapic/composer/common/AbstractServiceClientTestClassComposer.java @@ -47,6 +47,7 @@ import com.google.api.generator.gapic.composer.defaultvalue.DefaultValueComposer; import com.google.api.generator.gapic.composer.store.TypeStore; import com.google.api.generator.gapic.composer.utils.ClassNames; +import com.google.api.generator.gapic.composer.utils.CommonStrings; import com.google.api.generator.gapic.model.Field; import com.google.api.generator.gapic.model.GapicClass; import com.google.api.generator.gapic.model.GapicClass.Kind; @@ -87,7 +88,6 @@ public abstract class AbstractServiceClientTestClassComposer implements ClassCom protected static final String CLIENT_VAR_NAME = "client"; private static final String MOCK_SERVICE_VAR_NAME_PATTERN = "mock%s"; - private static final String PAGED_RESPONSE_TYPE_NAME_PATTERN = "%sPagedResponse"; protected static final TypeStore FIXED_TYPESTORE = createStaticTypes(); protected static final AnnotationNode TEST_ANNOTATION = @@ -109,6 +109,11 @@ public GapicClass generate(GapicContext context, Service service) { } protected GapicClass generate(String className, GapicContext context, Service service) { + // Do not generate Client Test code for Transport if there are no matching RPCs for a Transport + if (!service.hasAnyEnabledMethodsForTransport(getTransportContext().transport())) { + return GapicClass.createNonGeneratedGapicClass(); + } + Map resourceNames = context.helperResourceNames(); String pakkage = service.pakkage(); TypeStore typeStore = new TypeStore(); @@ -131,10 +136,6 @@ protected GapicClass generate(String className, GapicContext context, Service se return GapicClass.create(kind, classDef); } - protected boolean isSupportedMethod(Method method) { - return true; - } - private List createClassAnnotations() { return Arrays.asList( AnnotationNode.builder() @@ -230,7 +231,7 @@ private List createTestMethods( Map messageTypes = context.messages(); List javaMethods = new ArrayList<>(); for (Method method : service.methods()) { - if (!isSupportedMethod(method)) { + if (!method.isSupportedByTransport(getTransportContext().transport())) { javaMethods.add(createUnsupportedTestMethod(method)); continue; } @@ -943,7 +944,7 @@ private void addDynamicTypes(GapicContext context, Service service, TypeStore ty service.pakkage(), service.methods().stream() .filter(m -> m.isPaged()) - .map(m -> String.format(PAGED_RESPONSE_TYPE_NAME_PATTERN, m.name())) + .map(m -> String.format(CommonStrings.PAGED_RESPONSE_TYPE_NAME_PATTERN, m.name())) .collect(Collectors.toList()), true, ClassNames.getServiceClientClassName(service)); @@ -955,7 +956,7 @@ private void addDynamicTypes(GapicContext context, Service service, TypeStore ty } typeStore.put( service.pakkage(), - String.format(PAGED_RESPONSE_TYPE_NAME_PATTERN, mixinMethod.name()), + String.format(CommonStrings.PAGED_RESPONSE_TYPE_NAME_PATTERN, mixinMethod.name()), true, ClassNames.getServiceClientClassName(service)); } @@ -976,9 +977,9 @@ protected static TypeNode getCallableType(Method protoMethod) { callableClazz = ServerStreamingCallable.class; break; case CLIENT: - // Fall through. + // Fall through. case NONE: - // Fall through + // Fall through default: // Fall through } @@ -994,7 +995,7 @@ protected static TypeNode getCallableType(Method protoMethod) { private static TypeNode getPagedResponseType(Method method, Service service) { return TypeNode.withReference( VaporReference.builder() - .setName(String.format(PAGED_RESPONSE_TYPE_NAME_PATTERN, method.name())) + .setName(String.format(CommonStrings.PAGED_RESPONSE_TYPE_NAME_PATTERN, method.name())) .setPakkage(service.pakkage()) .setEnclosingClassNames(ClassNames.getServiceClientClassName(service)) .setIsStaticImport(true) @@ -1012,9 +1013,9 @@ protected static String getCallableMethodName(Method protoMethod) { case SERVER: return "serverStreamingCall"; case CLIENT: - // Fall through. + // Fall through. case NONE: - // Fall through + // Fall through default: return "clientStreamingCall"; } diff --git a/gapic-generator-java/src/main/java/com/google/api/generator/gapic/composer/common/AbstractServiceSettingsClassComposer.java b/gapic-generator-java/src/main/java/com/google/api/generator/gapic/composer/common/AbstractServiceSettingsClassComposer.java index fdfa33f471..e117097b10 100644 --- a/gapic-generator-java/src/main/java/com/google/api/generator/gapic/composer/common/AbstractServiceSettingsClassComposer.java +++ b/gapic-generator-java/src/main/java/com/google/api/generator/gapic/composer/common/AbstractServiceSettingsClassComposer.java @@ -16,6 +16,7 @@ import com.google.api.core.ApiFunction; import com.google.api.core.BetaApi; +import com.google.api.core.InternalApi; import com.google.api.gax.core.GoogleCredentialsProvider; import com.google.api.gax.core.InstantiatingExecutorProvider; import com.google.api.gax.rpc.ApiClientHeaderProvider; @@ -55,6 +56,7 @@ import com.google.api.generator.gapic.composer.samplecode.SettingsSampleComposer; import com.google.api.generator.gapic.composer.store.TypeStore; import com.google.api.generator.gapic.composer.utils.ClassNames; +import com.google.api.generator.gapic.composer.utils.CommonStrings; import com.google.api.generator.gapic.composer.utils.PackageChecker; import com.google.api.generator.gapic.model.GapicClass; import com.google.api.generator.gapic.model.GapicClass.Kind; @@ -70,7 +72,6 @@ import java.io.IOException; import java.util.ArrayList; import java.util.Arrays; -import java.util.Collections; import java.util.Iterator; import java.util.List; import java.util.Optional; @@ -81,10 +82,7 @@ public abstract class AbstractServiceSettingsClassComposer implements ClassComposer { private static final String BUILDER_CLASS_NAME = "Builder"; - private static final String PAGED_RESPONSE_TYPE_NAME_PATTERN = "%sPagedResponse"; - private static final String OPERATION_SETTINGS_LITERAL = "OperationSettings"; - private static final String SETTINGS_LITERAL = "Settings"; protected static final TypeStore FIXED_TYPESTORE = createStaticTypes(); private final TransportContext transportContext; @@ -97,6 +95,21 @@ protected TransportContext getTransportContext() { return transportContext; } + private static List createMethodAnnotations(Method method) { + List annotations = new ArrayList<>(); + if (method.isDeprecated()) { + annotations.add(AnnotationNode.withType(TypeNode.DEPRECATED)); + } + + if (method.isInternalApi()) { + annotations.add( + AnnotationNode.withTypeAndDescription( + FIXED_TYPESTORE.get("InternalApi"), CommonStrings.INTERNAL_API_WARNING)); + } + + return annotations; + } + @Override public GapicClass generate(GapicContext context, Service service) { String pakkage = service.pakkage(); @@ -128,32 +141,55 @@ public GapicClass generate(GapicContext context, Service service) { .build(); return GapicClass.create(kind, classDef, SampleComposerUtil.handleDuplicateSamples(samples)) .withApiShortName(service.apiShortName()) - .withApiVersion(service.apiVersion()); + .withPackageVersion(service.packageVersion()); } private static List createClassHeaderComments( Service service, TypeNode classType, List samples) { - // Pick the first pure unary rpc method, if no such method exists, then pick the first in the + // Pick the first public pure unary rpc method, if no such method exists, then pick the first + // public in the // list. + List publicMethods = + service.methods().stream() + .filter(m -> m.isInternalApi() == false) + .collect(Collectors.toList()); Optional methodOpt = - service.methods().isEmpty() + publicMethods.isEmpty() ? Optional.empty() : Optional.of( - service.methods().stream() + publicMethods.stream() .filter(m -> m.stream() == Stream.NONE && !m.hasLro() && !m.isPaged()) .findFirst() - .orElse(service.methods().get(0))); + .orElse(publicMethods.get(0))); Optional methodNameOpt = methodOpt.isPresent() ? Optional.of(methodOpt.get().name()) : Optional.empty(); Optional sampleCode = SettingsSampleComposer.composeSettingsSample( methodNameOpt, ClassNames.getServiceSettingsClassName(service), classType); - Optional docSampleCode = Optional.empty(); if (sampleCode.isPresent()) { samples.add(sampleCode.get()); docSampleCode = Optional.of(SampleCodeWriter.writeInlineSample(sampleCode.get().body())); } + // Create a sample for a LRO method using LRO-specific RetrySettings, if one exists in the + // service. + Optional lroMethodOpt = + publicMethods.isEmpty() + ? Optional.empty() + : publicMethods.stream() + .filter(m -> m.stream() == Stream.NONE && m.hasLro()) + .findFirst(); + Optional lroMethodNameOpt = + lroMethodOpt.isPresent() ? Optional.of(lroMethodOpt.get().name()) : Optional.empty(); + Optional lroSampleCode = + SettingsSampleComposer.composeLroSettingsSample( + lroMethodNameOpt, ClassNames.getServiceSettingsClassName(service), classType); + Optional lroDocSampleCode = Optional.empty(); + if (lroSampleCode.isPresent()) { + samples.add(lroSampleCode.get()); + lroDocSampleCode = + Optional.of(SampleCodeWriter.writeInlineSample(lroSampleCode.get().body())); + } return SettingsCommentComposer.createClassHeaderComments( ClassNames.getServiceClientClassName(service), @@ -161,6 +197,8 @@ private static List createClassHeaderComments( service.isDeprecated(), methodNameOpt, docSampleCode, + lroMethodNameOpt, + lroDocSampleCode, classType); } @@ -250,40 +288,36 @@ private static List createSettingsGetterMethods( List javaMethods = new ArrayList<>(); for (Method protoMethod : service.methods()) { String javaStyleName = JavaStyle.toLowerCamelCase(protoMethod.name()); - String javaMethodName = - String.format("%sSettings", JavaStyle.toLowerCamelCase(protoMethod.name())); + String javaMethodName = String.format("%sSettings", javaStyleName); MethodDefinition.Builder methodBuilder = methodMakerFn.apply(getCallSettingsType(protoMethod, typeStore), javaMethodName); - javaMethods.add( - methodBuilder - .setHeaderCommentStatements( - SettingsCommentComposer.createCallSettingsGetterComment( - getMethodNameFromSettingsVarName(javaMethodName), protoMethod.isDeprecated())) - .setAnnotations( - protoMethod.isDeprecated() - ? Arrays.asList(AnnotationNode.withType(TypeNode.DEPRECATED)) - : Collections.emptyList()) - .build()); + javaMethods.add(methodBuilderHelper(protoMethod, methodBuilder, javaMethodName)); if (protoMethod.hasLro()) { - javaMethodName = String.format("%sOperationSettings", javaStyleName); + String javaOperationSettingsMethodName = + String.format("%sOperationSettings", javaStyleName); methodBuilder = - methodMakerFn.apply(getOperationCallSettingsType(protoMethod), javaMethodName); + methodMakerFn.apply( + getOperationCallSettingsType(protoMethod), javaOperationSettingsMethodName); javaMethods.add( - methodBuilder - .setHeaderCommentStatements( - SettingsCommentComposer.createCallSettingsGetterComment( - getMethodNameFromSettingsVarName(javaMethodName), - protoMethod.isDeprecated())) - .setAnnotations( - protoMethod.isDeprecated() - ? Arrays.asList(AnnotationNode.withType(TypeNode.DEPRECATED)) - : Collections.emptyList()) - .build()); + methodBuilderHelper(protoMethod, methodBuilder, javaOperationSettingsMethodName)); } } return javaMethods; } + // Add method header comment statements and annotations. + private static MethodDefinition methodBuilderHelper( + Method protoMethod, MethodDefinition.Builder methodBuilder, String javaMethodName) { + return methodBuilder + .setHeaderCommentStatements( + SettingsCommentComposer.createCallSettingsGetterComment( + getMethodNameFromSettingsVarName(javaMethodName), + protoMethod.isDeprecated(), + protoMethod.isInternalApi())) + .setAnnotations(createMethodAnnotations(protoMethod)) + .build(); + } + private static MethodDefinition createCreatorMethod(Service service, TypeStore typeStore) { TypeNode stubClassType = typeStore.get(ClassNames.getServiceStubSettingsClassName(service)); VariableExpr stubVarExpr = @@ -385,6 +419,14 @@ private List createDefaultGetterMethods(Service service, TypeS while (providerBuilderNamesIt.hasNext() && channelProviderClassesIt.hasNext() && transportNamesIt.hasNext()) { + String providerBuilderName = providerBuilderNamesIt.next(); + Class channelProviderClass = channelProviderClassesIt.next(); + String transportName = transportNamesIt.next(); + + if (!service.hasAnyEnabledMethodsForTransport(transportName)) { + continue; + } + List annotations = ImmutableList.of(); // For clients supporting multiple transports (mainly grpc+rest case) make secondary transport @@ -397,16 +439,13 @@ private List createDefaultGetterMethods(Service service, TypeS SettingsCommentComposer.DEFAULT_TRANSPORT_PROVIDER_BUILDER_METHOD_COMMENT; if (getTransportContext().transportNames().size() > 1) { commentStatement = - new SettingsCommentComposer(transportNamesIt.next()) - .getTransportProviderBuilderMethodComment(); + new SettingsCommentComposer(transportName).getTransportProviderBuilderMethodComment(); } javaMethods.add( methodMakerFn.apply( methodStarterFn - .apply( - providerBuilderNamesIt.next(), - typeMakerFn.apply(channelProviderClassesIt.next())) + .apply(providerBuilderName, typeMakerFn.apply(channelProviderClass)) .setAnnotations(annotations), commentStatement)); secondaryTransportProviderBuilder = true; @@ -425,14 +464,6 @@ private List createDefaultGetterMethods(Service service, TypeS "defaultApiClientHeaderProviderBuilder", TypeNode.withReference( ConcreteReference.withClazz(ApiClientHeaderProvider.Builder.class))) - .setAnnotations( - Arrays.asList( - AnnotationNode.builder() - .setType(FIXED_TYPESTORE.get("BetaApi")) - .setDescription( - "The surface for customizing headers is not stable yet and may" - + " change in the future.") - .build())) .build()); return javaMethods; } @@ -754,11 +785,10 @@ private static List createNestedBuilderSettingsGetterMethods( methodBuilder .setHeaderCommentStatements( SettingsCommentComposer.createCallSettingsBuilderGetterComment( - getMethodNameFromSettingsVarName(javaMethodName), protoMethod.isDeprecated())) - .setAnnotations( - protoMethod.isDeprecated() - ? Arrays.asList(AnnotationNode.withType(TypeNode.DEPRECATED)) - : Collections.emptyList()) + getMethodNameFromSettingsVarName(javaMethodName), + protoMethod.isDeprecated(), + protoMethod.isInternalApi())) + .setAnnotations(createMethodAnnotations(protoMethod)) .build()); if (protoMethod.hasLro()) { @@ -770,11 +800,9 @@ private static List createNestedBuilderSettingsGetterMethods( .setHeaderCommentStatements( SettingsCommentComposer.createCallSettingsBuilderGetterComment( getMethodNameFromSettingsVarName(javaMethodName), - protoMethod.isDeprecated())) - .setAnnotations( - protoMethod.isDeprecated() - ? Arrays.asList(AnnotationNode.withType(TypeNode.DEPRECATED)) - : Collections.emptyList()) + protoMethod.isDeprecated(), + protoMethod.isInternalApi())) + .setAnnotations(createMethodAnnotations(protoMethod)) .build()); } } @@ -805,6 +833,7 @@ private static TypeStore createStaticTypes() { ApiClientHeaderProvider.class, ApiFunction.class, BetaApi.class, + InternalApi.class, ClientContext.class, ClientSettings.class, Generated.class, @@ -845,7 +874,7 @@ private static TypeStore createDynamicTypes(Service service) { service.pakkage(), service.methods().stream() .filter(m -> m.isPaged()) - .map(m -> String.format(PAGED_RESPONSE_TYPE_NAME_PATTERN, m.name())) + .map(m -> String.format(CommonStrings.PAGED_RESPONSE_TYPE_NAME_PATTERN, m.name())) .collect(Collectors.toList()), true, ClassNames.getServiceClientClassName(service)); @@ -898,7 +927,7 @@ private static TypeNode getCallSettingsTypeHelper( } else { switch (protoMethod.stream()) { case CLIENT: - // Fall through. + // Fall through. case BIDI: callSettingsClazz = isBuilder ? StreamingCallSettings.Builder.class : StreamingCallSettings.class; @@ -910,7 +939,7 @@ private static TypeNode getCallSettingsTypeHelper( : ServerStreamingCallSettings.class; break; case NONE: - // Fall through + // Fall through default: // Fall through } @@ -922,7 +951,8 @@ private static TypeNode getCallSettingsTypeHelper( if (protoMethod.isPaged()) { generics.add( typeStore - .get(String.format(PAGED_RESPONSE_TYPE_NAME_PATTERN, protoMethod.name())) + .get( + String.format(CommonStrings.PAGED_RESPONSE_TYPE_NAME_PATTERN, protoMethod.name())) .reference()); } @@ -943,11 +973,11 @@ private static TypeNode getStubSettingsBuilderType(Service service) { private static String getMethodNameFromSettingsVarName(String settingsVarName) { BiFunction methodNameSubstrFn = (s, literal) -> s.substring(0, s.length() - literal.length()); - if (settingsVarName.endsWith(OPERATION_SETTINGS_LITERAL)) { - return methodNameSubstrFn.apply(settingsVarName, OPERATION_SETTINGS_LITERAL); + if (settingsVarName.endsWith(CommonStrings.OPERATION_SETTINGS_LITERAL)) { + return methodNameSubstrFn.apply(settingsVarName, CommonStrings.OPERATION_SETTINGS_LITERAL); } - if (settingsVarName.endsWith(SETTINGS_LITERAL)) { - return methodNameSubstrFn.apply(settingsVarName, SETTINGS_LITERAL); + if (settingsVarName.endsWith(CommonStrings.SETTINGS_LITERAL)) { + return methodNameSubstrFn.apply(settingsVarName, CommonStrings.SETTINGS_LITERAL); } return settingsVarName; } diff --git a/gapic-generator-java/src/main/java/com/google/api/generator/gapic/composer/common/AbstractServiceStubClassComposer.java b/gapic-generator-java/src/main/java/com/google/api/generator/gapic/composer/common/AbstractServiceStubClassComposer.java index c9835c69e4..5cdb08ff10 100644 --- a/gapic-generator-java/src/main/java/com/google/api/generator/gapic/composer/common/AbstractServiceStubClassComposer.java +++ b/gapic-generator-java/src/main/java/com/google/api/generator/gapic/composer/common/AbstractServiceStubClassComposer.java @@ -15,6 +15,7 @@ package com.google.api.generator.gapic.composer.common; import com.google.api.core.BetaApi; +import com.google.api.core.InternalApi; import com.google.api.gax.core.BackgroundResource; import com.google.api.gax.rpc.BidiStreamingCallable; import com.google.api.gax.rpc.ClientStreamingCallable; @@ -34,6 +35,7 @@ import com.google.api.generator.gapic.composer.comment.StubCommentComposer; import com.google.api.generator.gapic.composer.store.TypeStore; import com.google.api.generator.gapic.composer.utils.ClassNames; +import com.google.api.generator.gapic.composer.utils.CommonStrings; import com.google.api.generator.gapic.composer.utils.PackageChecker; import com.google.api.generator.gapic.model.GapicClass; import com.google.api.generator.gapic.model.GapicClass.Kind; @@ -54,7 +56,6 @@ import javax.annotation.Generated; public abstract class AbstractServiceStubClassComposer implements ClassComposer { - private static final String PAGED_RESPONSE_TYPE_NAME_PATTERN = "%sPagedResponse"; private final TransportContext transportContext; @@ -171,7 +172,7 @@ private MethodDefinition createCallableGetterHelper( returnType = typeStore.get("BidiStreamingCallable"); break; case NONE: - // Fall through. + // Fall through. default: returnType = typeStore.get(isLroCallable ? "OperationCallable" : "UnaryCallable"); } @@ -189,16 +190,21 @@ private MethodDefinition createCallableGetterHelper( } else if (isPaged) { genericRefs.add( typeStore - .get(String.format(PAGED_RESPONSE_TYPE_NAME_PATTERN, method.name())) + .get(String.format(CommonStrings.PAGED_RESPONSE_TYPE_NAME_PATTERN, method.name())) .reference()); } else { genericRefs.add(method.outputType().reference()); } - List annotations = - method.isDeprecated() - ? Arrays.asList(AnnotationNode.withType(TypeNode.DEPRECATED)) - : Collections.emptyList(); + List annotations = new ArrayList<>(); + if (method.isDeprecated()) { + annotations.add(AnnotationNode.withType(TypeNode.DEPRECATED)); + } + if (method.isInternalApi()) { + annotations.add( + AnnotationNode.withTypeAndDescription( + typeStore.get("InternalApi"), CommonStrings.INTERNAL_API_WARNING)); + } returnType = TypeNode.withReference(returnType.reference().copyAndSetGenerics(genericRefs)); @@ -235,7 +241,7 @@ private List createLongRunningClientGetters(TypeStore typeStor createCallableGetterMethodDefinition( TypeNode.withReference(ConcreteReference.withClazz(LongRunningClient.class)), "longRunningClient", - ImmutableList.of(AnnotationNode.withType(typeStore.get("BetaApi"))), + Collections.emptyList(), typeStore)); } @@ -256,6 +262,7 @@ private static TypeStore createTypes(Service service, Map messa Arrays.asList( BackgroundResource.class, BetaApi.class, + InternalApi.class, BidiStreamingCallable.class, ClientStreamingCallable.class, Generated.class, @@ -273,7 +280,7 @@ private static TypeStore createTypes(Service service, Map messa service.pakkage(), service.methods().stream() .filter(m -> m.isPaged()) - .map(m -> String.format(PAGED_RESPONSE_TYPE_NAME_PATTERN, m.name())) + .map(m -> String.format(CommonStrings.PAGED_RESPONSE_TYPE_NAME_PATTERN, m.name())) .collect(Collectors.toList()), true, ClassNames.getServiceClientClassName(service)); diff --git a/gapic-generator-java/src/main/java/com/google/api/generator/gapic/composer/common/AbstractServiceStubSettingsClassComposer.java b/gapic-generator-java/src/main/java/com/google/api/generator/gapic/composer/common/AbstractServiceStubSettingsClassComposer.java index fe66a11e77..698fd50a29 100644 --- a/gapic-generator-java/src/main/java/com/google/api/generator/gapic/composer/common/AbstractServiceStubSettingsClassComposer.java +++ b/gapic-generator-java/src/main/java/com/google/api/generator/gapic/composer/common/AbstractServiceStubSettingsClassComposer.java @@ -18,6 +18,8 @@ import com.google.api.core.ApiFunction; import com.google.api.core.ApiFuture; import com.google.api.core.BetaApi; +import com.google.api.core.InternalApi; +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.LimitExceededBehavior; @@ -35,6 +37,7 @@ 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.LibraryMetadata; import com.google.api.gax.rpc.OperationCallSettings; import com.google.api.gax.rpc.PageContext; import com.google.api.gax.rpc.PagedCallSettings; @@ -64,13 +67,11 @@ import com.google.api.generator.engine.ast.PrimitiveValue; import com.google.api.generator.engine.ast.Reference; import com.google.api.generator.engine.ast.ReferenceConstructorExpr; -import com.google.api.generator.engine.ast.RelationalOperationExpr; import com.google.api.generator.engine.ast.ReturnExpr; import com.google.api.generator.engine.ast.ScopeNode; import com.google.api.generator.engine.ast.Statement; import com.google.api.generator.engine.ast.StringObjectValue; import com.google.api.generator.engine.ast.SuperObjectValue; -import com.google.api.generator.engine.ast.TernaryExpr; import com.google.api.generator.engine.ast.ThisObjectValue; import com.google.api.generator.engine.ast.ThrowExpr; import com.google.api.generator.engine.ast.TypeNode; @@ -84,6 +85,7 @@ import com.google.api.generator.gapic.composer.samplecode.SettingsSampleComposer; import com.google.api.generator.gapic.composer.store.TypeStore; import com.google.api.generator.gapic.composer.utils.ClassNames; +import com.google.api.generator.gapic.composer.utils.CommonStrings; import com.google.api.generator.gapic.composer.utils.PackageChecker; import com.google.api.generator.gapic.model.Field; import com.google.api.generator.gapic.model.GapicBatchingSettings; @@ -97,6 +99,7 @@ import com.google.api.generator.gapic.model.Service; import com.google.api.generator.gapic.utils.JavaStyle; import com.google.common.base.Preconditions; +import com.google.common.base.Strings; import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; import com.google.common.collect.ImmutableSet; @@ -104,6 +107,7 @@ import com.google.longrunning.Operation; import com.google.protobuf.Empty; import java.io.IOException; +import java.time.Duration; import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; @@ -120,7 +124,6 @@ import java.util.stream.Collectors; import javax.annotation.Generated; import javax.annotation.Nullable; -import org.threeten.bp.Duration; public abstract class AbstractServiceStubSettingsClassComposer implements ClassComposer { private static final Statement EMPTY_LINE_STATEMENT = EmptyLineStatement.create(); @@ -128,17 +131,12 @@ public abstract class AbstractServiceStubSettingsClassComposer implements ClassC private static final String BATCHING_DESC_PATTERN = "%s_BATCHING_DESC"; private static final String PAGE_STR_DESC_PATTERN = "%s_PAGE_STR_DESC"; private static final String PAGED_RESPONSE_FACTORY_PATTERN = "%s_PAGE_STR_FACT"; - private static final String PAGED_RESPONSE_TYPE_NAME_PATTERN = "%sPagedResponse"; private static final String NESTED_BUILDER_CLASS_NAME = "Builder"; private static final String NESTED_UNARY_METHOD_SETTINGS_BUILDERS_VAR_NAME = "unaryMethodSettingsBuilders"; private static final String NESTED_RETRYABLE_CODE_DEFINITIONS_VAR_NAME = "RETRYABLE_CODE_DEFINITIONS"; private static final String NESTED_RETRY_PARAM_DEFINITIONS_VAR_NAME = "RETRY_PARAM_DEFINITIONS"; - - private static final String OPERATION_SETTINGS_LITERAL = "OperationSettings"; - private static final String SETTINGS_LITERAL = "Settings"; - private static final String DOT = "."; protected static final TypeStore FIXED_TYPESTORE = createStaticTypes(); @@ -152,6 +150,20 @@ public abstract class AbstractServiceStubSettingsClassComposer implements ClassC private final TransportContext transportContext; + // Maps of BigQuery methods to pagination types. + private static final ImmutableMap BIGQUERY_PAGINATE_MAX_RESULT_TYPES = + ImmutableMap.of( + "com.google.cloud.bigquery.v2.ListDatasets", + TypeNode.UINT32VALUE, + "com.google.cloud.bigquery.v2.ListJobs", + TypeNode.INT32VALUE, + "com.google.cloud.bigquery.v2.ListModels", + TypeNode.UINT32VALUE, + "com.google.cloud.bigquery.v2.ListRoutines", + TypeNode.UINT32VALUE, + "com.google.cloud.bigquery.v2.ListTables", + TypeNode.UINT32VALUE); + protected static final VariableExpr DEFAULT_SERVICE_SCOPES_VAR_EXPR = createDefaultServiceScopesVarExpr(); @@ -173,13 +185,15 @@ public GapicClass generate(GapicContext context, Service service) { List samples = new ArrayList<>(); Set deprecatedSettingVarNames = new HashSet<>(); + Set internalSettingVarNames = new HashSet<>(); Map methodSettingsMemberVarExprs = createMethodSettingsClassMemberVarExprs( service, serviceConfig, typeStore, /* isNestedClass= */ false, - deprecatedSettingVarNames); + deprecatedSettingVarNames, + internalSettingVarNames); String className = ClassNames.getServiceStubSettingsClassName(service); List classHeaderComments = createClassHeaderComments(service, typeStore.get(className), samples); @@ -196,14 +210,19 @@ public GapicClass generate(GapicContext context, Service service) { service, serviceConfig, methodSettingsMemberVarExprs, messageTypes, typeStore)) .setMethods( createClassMethods( - service, methodSettingsMemberVarExprs, deprecatedSettingVarNames, typeStore)) + context, + service, + methodSettingsMemberVarExprs, + deprecatedSettingVarNames, + internalSettingVarNames, + typeStore)) .setNestedClasses( Arrays.asList(createNestedBuilderClass(service, serviceConfig, typeStore))) .build(); return GapicClass.create( GapicClass.Kind.STUB, classDef, SampleComposerUtil.handleDuplicateSamples(samples)) .withApiShortName(service.apiShortName()) - .withApiVersion(service.apiVersion()); + .withPackageVersion(service.packageVersion()); } protected MethodDefinition createDefaultCredentialsProviderBuilderMethod() { @@ -243,7 +262,8 @@ protected MethodDefinition createDefaultCredentialsProviderBuilderMethod() { .build(); } - protected List createDefaultTransportTransportProviderBuilderMethods() { + protected List createDefaultTransportTransportProviderBuilderMethods( + Service service) { // Create the defaultGrpcTransportProviderBuilder method. Iterator> providerClassIt = getTransportContext().instantiatingChannelProviderClasses().iterator(); @@ -259,10 +279,19 @@ protected List createDefaultTransportTransportProviderBuilderM && providerBuilderClassIt.hasNext() && builderNamesIt.hasNext() && transportNamesIt.hasNext()) { + Class providerClass = providerClassIt.next(); + Class providerBuilderClass = providerBuilderClassIt.next(); + String builderName = builderNamesIt.next(); + String transportName = transportNamesIt.next(); + + if (!service.hasAnyEnabledMethodsForTransport(transportName)) { + continue; + } + TypeNode returnType = - TypeNode.withReference(ConcreteReference.withClazz(providerBuilderClassIt.next())); + TypeNode.withReference(ConcreteReference.withClazz(providerBuilderClass)); TypeNode channelProviderType = - TypeNode.withReference(ConcreteReference.withClazz(providerClassIt.next())); + TypeNode.withReference(ConcreteReference.withClazz(providerClass)); MethodInvocationExpr transportChannelProviderBuilderExpr = MethodInvocationExpr.builder() @@ -281,8 +310,7 @@ protected List createDefaultTransportTransportProviderBuilderM SettingsCommentComposer.DEFAULT_TRANSPORT_PROVIDER_BUILDER_METHOD_COMMENT; if (getTransportContext().transportNames().size() > 1) { commentStatement = - new SettingsCommentComposer(transportNamesIt.next()) - .getTransportProviderBuilderMethodComment(); + new SettingsCommentComposer(transportName).getTransportProviderBuilderMethodComment(); } MethodDefinition method = @@ -292,7 +320,7 @@ protected List createDefaultTransportTransportProviderBuilderM .setScope(ScopeNode.PUBLIC) .setIsStatic(true) .setReturnType(returnType) - .setName(builderNamesIt.next()) + .setName(builderName) .setReturnExpr(returnExpr) .build(); @@ -360,15 +388,17 @@ protected MethodDefinition createApiClientHeaderProviderBuilderMethod( .setReturnType(returnType) .build(); - AnnotationNode annotation = - AnnotationNode.builder() - .setType(FIXED_TYPESTORE.get("BetaApi")) - .setDescription( - "The surface for customizing headers is not stable yet and may change in the" - + " future.") - .build(); + if (service.hasApiVersion()) { + + returnExpr = + MethodInvocationExpr.builder() + .setExprReferenceExpr(returnExpr) + .setMethodName("setApiVersionToken") + .setArguments(ValueExpr.withValue(StringObjectValue.withValue(service.apiVersion()))) + .setReturnType(returnType) + .build(); + } return MethodDefinition.builder() - .setAnnotations(Arrays.asList(annotation)) .setScope(ScopeNode.PUBLIC) .setIsStatic(true) .setReturnType(returnType) @@ -394,31 +424,62 @@ private List createClassAnnotations(Service service) { .setType(FIXED_TYPESTORE.get("Generated")) .setDescription("by gapic-generator-java") .build()); + + // Suppress the error-prone CanonicalDuration warning in generated code. + annotations.add( + AnnotationNode.builder() + .setType(FIXED_TYPESTORE.get("SuppressWarnings")) + .setDescription("CanonicalDuration") + .build()); return annotations; } private static List createClassHeaderComments( Service service, TypeNode classType, List samples) { - // Pick the first pure unary rpc method, if no such method exists, then pick the first in the + // Pick the first public pure unary rpc method, if no such method exists, then pick the first + // public in the // list. + List publicMethods = + service.methods().stream() + .filter(m -> m.isInternalApi() == false) + .collect(Collectors.toList()); Optional methodOpt = - service.methods().isEmpty() + publicMethods.isEmpty() ? Optional.empty() : Optional.of( - service.methods().stream() + publicMethods.stream() .filter(m -> m.stream() == Stream.NONE && !m.hasLro() && !m.isPaged()) .findFirst() - .orElse(service.methods().get(0))); + .orElse(publicMethods.get(0))); Optional methodNameOpt = methodOpt.map(Method::name); + Optional sampleCode = SettingsSampleComposer.composeSettingsSample( methodNameOpt, ClassNames.getServiceSettingsClassName(service), classType); - Optional docSampleCode = Optional.empty(); if (sampleCode.isPresent()) { samples.add(sampleCode.get()); docSampleCode = Optional.of(SampleCodeWriter.writeInlineSample(sampleCode.get().body())); } + // Create a sample for a LRO method using LRO-specific RetrySettings, if one exists in the + // service. + Optional lroMethodOpt = + publicMethods.isEmpty() + ? Optional.empty() + : publicMethods.stream() + .filter(m -> m.stream() == Stream.NONE && m.hasLro()) + .findFirst(); + Optional lroMethodNameOpt = + lroMethodOpt.isPresent() ? Optional.of(lroMethodOpt.get().name()) : Optional.empty(); + Optional lroSampleCode = + SettingsSampleComposer.composeLroSettingsSample( + lroMethodNameOpt, ClassNames.getServiceSettingsClassName(service), classType); + Optional lroDocSampleCode = Optional.empty(); + if (lroSampleCode.isPresent()) { + samples.add(lroSampleCode.get()); + lroDocSampleCode = + Optional.of(SampleCodeWriter.writeInlineSample(lroSampleCode.get().body())); + } return SettingsCommentComposer.createClassHeaderComments( ClassNames.getServiceStubClassName(service), @@ -426,6 +487,8 @@ private static List createClassHeaderComments( service.isDeprecated(), methodNameOpt, docSampleCode, + lroMethodNameOpt, + lroDocSampleCode, classType); } @@ -443,8 +506,8 @@ private static Map createMethodSettingsClassMemberVarExprs GapicServiceConfig serviceConfig, TypeStore typeStore, boolean isNestedClass, - Set deprecatedSettingVarNames) { - // Maintain insertion order. + Set deprecatedSettingVarNames, + Set internalSettingVarNames) { Map varExprs = new LinkedHashMap<>(); // Creates class variables Settings, e.g. echoSettings. @@ -457,6 +520,9 @@ private static Map createMethodSettingsClassMemberVarExprs if (method.isDeprecated()) { deprecatedSettingVarNames.add(varName); } + if (method.isInternalApi()) { + internalSettingVarNames.add(varName); + } varExprs.put( varName, VariableExpr.withVariable( @@ -480,14 +546,14 @@ private static List createClassStatements( Map methodSettingsMemberVarExprs, Map messageTypes, TypeStore typeStore) { + // Maintain insertion order. Function exprToStatementFn = e -> ExprStatement.withExpr(e); List statements = new ArrayList<>(); // Assign DEFAULT_SERVICE_SCOPES. statements.add(SettingsCommentComposer.DEFAULT_SCOPES_COMMENT); VariableExpr defaultServiceScopesDeclVarExpr = - DEFAULT_SERVICE_SCOPES_VAR_EXPR - .toBuilder() + DEFAULT_SERVICE_SCOPES_VAR_EXPR.toBuilder() .setIsDecl(true) .setScope(ScopeNode.PRIVATE) .setIsStatic(true) @@ -684,9 +750,12 @@ private static Expr createPagedListDescriptorAssignExpr( .build()); // Create injectPageSize method. + String methodFullName = + String.format("%s.%s", method.inputType().reference().pakkage(), method.name()); VariableExpr pageSizeVarExpr = VariableExpr.withVariable( Variable.builder().setType(TypeNode.INT).setName("pageSize").build()); + // Re-declare for clarity and easier readability. returnType = method.inputType(); returnExpr = @@ -695,6 +764,20 @@ private static Expr createPagedListDescriptorAssignExpr( .setMethodName("set" + JavaStyle.toUpperCamelCase(method.pageSizeFieldName())) .setArguments(pageSizeVarExpr) .build(); + if (BIGQUERY_PAGINATE_MAX_RESULT_TYPES.containsKey(methodFullName)) { + returnExpr = + MethodInvocationExpr.builder() + .setExprReferenceExpr(newBuilderExpr) + .setMethodName("set" + JavaStyle.toUpperCamelCase(method.pageSizeFieldName())) + .setArguments( + MethodInvocationExpr.builder() + .setStaticReferenceType( + BIGQUERY_PAGINATE_MAX_RESULT_TYPES.get(methodFullName)) + .setMethodName("of") + .setArguments(pageSizeVarExpr) + .build()) + .build(); + } returnExpr = MethodInvocationExpr.builder() .setExprReferenceExpr(returnExpr) @@ -715,17 +798,32 @@ private static Expr createPagedListDescriptorAssignExpr( // TODO(miraleung): Test the edge cases where these proto fields aren't present. // Create extractPageSize method. returnType = TypeNode.INT_OBJECT; + returnExpr = + MethodInvocationExpr.builder() + .setExprReferenceExpr(payloadVarExpr) + .setMethodName("get" + JavaStyle.toUpperCamelCase(method.pageSizeFieldName())) + .setReturnType(returnType) + .build(); + if (BIGQUERY_PAGINATE_MAX_RESULT_TYPES.containsKey(methodFullName)) { + // Return type is UINT32VALUE or INT32VALUE so use getValue to unwrap. + returnExpr = + MethodInvocationExpr.builder() + .setExprReferenceExpr(payloadVarExpr) + .setMethodName("get" + JavaStyle.toUpperCamelCase(method.pageSizeFieldName())) + .build(); + returnExpr = + MethodInvocationExpr.builder() + .setExprReferenceExpr(returnExpr) + .setMethodName("getValue") + .setReturnType(returnType) + .build(); + } anonClassMethods.add( methodStarterBuilder .setReturnType(returnType) .setName("extractPageSize") .setArguments(payloadVarExpr.toBuilder().setIsDecl(true).build()) - .setReturnExpr( - MethodInvocationExpr.builder() - .setExprReferenceExpr(payloadVarExpr) - .setMethodName("get" + JavaStyle.toUpperCamelCase(method.pageSizeFieldName())) - .setReturnType(returnType) - .build()) + .setReturnExpr(returnExpr) .build()); // Create extractNextToken method. @@ -754,27 +852,9 @@ private static Expr createPagedListDescriptorAssignExpr( .setGenerics(Arrays.asList(repeatedResponseType.reference())) .build()); - Expr getResponsesExpr; - Expr elseExpr; - Expr thenExpr; if (repeatedResponseType.reference() != null && "java.util.Map.Entry".equals(repeatedResponseType.reference().fullName())) { - getResponsesExpr = - MethodInvocationExpr.builder() - .setExprReferenceExpr(payloadVarExpr) - .setMethodName( - String.format("get%sMap", JavaStyle.toUpperCamelCase(repeatedFieldName))) - .setReturnType(returnType) - .build(); - thenExpr = - MethodInvocationExpr.builder() - .setStaticReferenceType( - TypeNode.withReference(ConcreteReference.withClazz(Collections.class))) - .setGenerics(Arrays.asList(repeatedResponseType.reference())) - .setMethodName("emptySet") - .setReturnType(returnType) - .build(); - elseExpr = + returnExpr = MethodInvocationExpr.builder() .setMethodName("entrySet") .setExprReferenceExpr( @@ -786,39 +866,14 @@ private static Expr createPagedListDescriptorAssignExpr( .setReturnType(returnType) .build(); } else { - getResponsesExpr = + returnExpr = MethodInvocationExpr.builder() .setExprReferenceExpr(payloadVarExpr) .setMethodName( String.format("get%sList", JavaStyle.toUpperCamelCase(repeatedFieldName))) .setReturnType(returnType) .build(); - thenExpr = - MethodInvocationExpr.builder() - .setStaticReferenceType( - TypeNode.withReference(ConcreteReference.withClazz(ImmutableList.class))) - .setGenerics(Arrays.asList(repeatedResponseType.reference())) - .setMethodName("of") - .setReturnType(returnType) - .build(); - elseExpr = getResponsesExpr; } - // While protobufs should not be null, this null-check is needed to protect against NPEs - // in paged iteration on clients that use legacy HTTP/JSON types, as these clients can - // actually return null instead of an empty list. - // Context: - // Original issue: https://github.com/googleapis/google-cloud-java/issues/3736 - // Relevant discussion where this check was first added: - // https://github.com/googleapis/google-cloud-java/pull/4499#discussion_r257057409 - Expr conditionExpr = - RelationalOperationExpr.equalToWithExprs(getResponsesExpr, ValueExpr.createNullExpr()); - - returnExpr = - TernaryExpr.builder() - .setConditionExpr(conditionExpr) - .setThenExpr(thenExpr) - .setElseExpr(elseExpr) - .build(); anonClassMethods.add( methodStarterBuilder .setReturnType(returnType) @@ -837,8 +892,7 @@ private static Expr createPagedListDescriptorAssignExpr( // Declare and assign the variable. return AssignmentExpr.builder() .setVariableExpr( - pagedListDescVarExpr - .toBuilder() + pagedListDescVarExpr.toBuilder() .setIsDecl(true) .setScope(ScopeNode.PRIVATE) .setIsStatic(true) @@ -977,8 +1031,7 @@ private static Expr createPagedListResponseFactoryAssignExpr( return AssignmentExpr.builder() .setVariableExpr( - pagedListResponseFactoryVarExpr - .toBuilder() + pagedListResponseFactoryVarExpr.toBuilder() .setIsDecl(true) .setScope(ScopeNode.PRIVATE) .setIsStatic(true) @@ -989,13 +1042,16 @@ private static Expr createPagedListResponseFactoryAssignExpr( } private List createClassMethods( + GapicContext context, Service service, Map methodSettingsMemberVarExprs, Set deprecatedSettingVarNames, + Set internalSettingVarNames, TypeStore typeStore) { List javaMethods = new ArrayList<>(); javaMethods.addAll( - createMethodSettingsGetterMethods(methodSettingsMemberVarExprs, deprecatedSettingVarNames)); + createMethodSettingsGetterMethods( + methodSettingsMemberVarExprs, deprecatedSettingVarNames, internalSettingVarNames)); javaMethods.add(createCreateStubMethod(service, typeStore)); javaMethods.addAll(createDefaultHelperAndGetterMethods(service, typeStore)); javaMethods.addAll( @@ -1007,23 +1063,37 @@ private List createClassMethods( SettingsCommentComposer.NEW_BUILDER_METHOD_COMMENT)); javaMethods.addAll(createBuilderHelperMethods(service, typeStore)); javaMethods.add(createClassConstructor(service, methodSettingsMemberVarExprs, typeStore)); + javaMethods.add(createGetLibraryMetadataMethod(context, service)); return javaMethods; } + private static List createMethodAnnotation( + boolean isDeprecated, boolean isInternal) { + List annotations = new ArrayList<>(); + if (isDeprecated) { + annotations.add(AnnotationNode.withType(TypeNode.DEPRECATED)); + } + if (isInternal) { + annotations.add( + AnnotationNode.withTypeAndDescription( + FIXED_TYPESTORE.get("InternalApi"), CommonStrings.INTERNAL_API_WARNING)); + } + return annotations; + } + private static List createMethodSettingsGetterMethods( Map methodSettingsMemberVarExprs, - final Set deprecatedSettingVarNames) { + final Set deprecatedSettingVarNames, + final Set internalSettingVarNames) { Function, MethodDefinition> varToMethodFn = e -> { boolean isDeprecated = deprecatedSettingVarNames.contains(e.getKey()); + boolean isInternal = internalSettingVarNames.contains(e.getKey()); return MethodDefinition.builder() .setHeaderCommentStatements( SettingsCommentComposer.createCallSettingsGetterComment( - getMethodNameFromSettingsVarName(e.getKey()), isDeprecated)) - .setAnnotations( - isDeprecated - ? Arrays.asList(AnnotationNode.withType(TypeNode.DEPRECATED)) - : Collections.emptyList()) + getMethodNameFromSettingsVarName(e.getKey()), isDeprecated, isInternal)) + .setAnnotations(createMethodAnnotation(isDeprecated, isInternal)) .setScope(ScopeNode.PUBLIC) .setReturnType(e.getValue().type()) .setName(e.getKey()) @@ -1047,17 +1117,23 @@ private MethodDefinition createCreateStubMethod(Service service, TypeStore typeS .setMethodName("getTransportName") .build(); + Iterator transportNamesIt = getTransportContext().transportNames().iterator(); Iterator channelTypesIt = getTransportContext().transportChannelTypes().iterator(); Iterator getterNameIt = getTransportContext().transportGetterNames().iterator(); Iterator serivceStubClassNameIt = getTransportContext().classNames().getTransportServiceStubClassNames(service).iterator(); while (channelTypesIt.hasNext() && getterNameIt.hasNext()) { + String transportName = transportNamesIt.next(); TypeNode channelType = channelTypesIt.next(); String getterName = getterNameIt.next(); String serivceStubClassName = serivceStubClassNameIt.next(); - Expr tRansportNameExpr = + if (!service.hasAnyEnabledMethodsForTransport(transportName)) { + continue; + } + + Expr transportNameExpr = MethodInvocationExpr.builder() .setStaticReferenceType(channelType) .setMethodName(getterName) @@ -1067,7 +1143,7 @@ private MethodDefinition createCreateStubMethod(Service service, TypeStore typeS MethodInvocationExpr.builder() .setExprReferenceExpr(getTransportNameExpr) .setMethodName("equals") - .setArguments(tRansportNameExpr) + .setArguments(transportNameExpr) .setReturnType(TypeNode.BOOLEAN) .build(); @@ -1122,9 +1198,27 @@ private MethodDefinition createCreateStubMethod(Service service, TypeStore typeS private List createDefaultHelperAndGetterMethods( Service service, TypeStore typeStore) { List javaMethods = new ArrayList<>(); + TypeNode returnType; + + // Create the getServiceName method. + if (!Strings.isNullOrEmpty(service.hostServiceName())) { + returnType = TypeNode.STRING; + javaMethods.add( + MethodDefinition.builder() + .setHeaderCommentStatements( + SettingsCommentComposer.DEFAULT_SERVICE_NAME_METHOD_COMMENT) + .setIsOverride(true) + .setScope(ScopeNode.PUBLIC) + .setIsStatic(false) + .setReturnType(returnType) + .setName("getServiceName") + .setReturnExpr( + ValueExpr.withValue(StringObjectValue.withValue(service.hostServiceName()))) + .build()); + } // Create the defaultExecutorProviderBuilder method. - TypeNode returnType = + returnType = TypeNode.withReference( ConcreteReference.withClazz(InstantiatingExecutorProvider.Builder.class)); javaMethods.add( @@ -1154,6 +1248,12 @@ private List createDefaultHelperAndGetterMethods( .setReturnType(returnType) .setName("getDefaultEndpoint") .setReturnExpr(ValueExpr.withValue(StringObjectValue.withValue(service.defaultHost()))) + .setAnnotations( + ImmutableList.of( + AnnotationNode.builder() + .setType(FIXED_TYPESTORE.get(ObsoleteApi.class.getSimpleName())) + .setDescription("Use getEndpoint() instead") + .build())) .build()); // Create the getDefaultMtlsEndpoint method. @@ -1191,7 +1291,7 @@ private List createDefaultHelperAndGetterMethods( .build()); javaMethods.add(createDefaultCredentialsProviderBuilderMethod()); - javaMethods.addAll(createDefaultTransportTransportProviderBuilderMethods()); + javaMethods.addAll(createDefaultTransportTransportProviderBuilderMethods(service)); javaMethods.add(createDefaultTransportChannelProviderMethod()); javaMethods.addAll(createApiClientHeaderProviderBuilderMethods(service, typeStore)); @@ -1332,13 +1432,15 @@ private ClassDefinition createNestedBuilderClass( .build()); Set nestedDeprecatedSettingVarNames = new HashSet<>(); + Set nestedInternalSettingVarNames = new HashSet<>(); Map nestedMethodSettingsMemberVarExprs = createMethodSettingsClassMemberVarExprs( service, serviceConfig, typeStore, /* isNestedClass= */ true, - nestedDeprecatedSettingVarNames); + nestedDeprecatedSettingVarNames, + nestedInternalSettingVarNames); // TODO(miraleung): Fill this out. return ClassDefinition.builder() @@ -1359,6 +1461,7 @@ private ClassDefinition createNestedBuilderClass( extendsType, nestedMethodSettingsMemberVarExprs, nestedDeprecatedSettingVarNames, + nestedInternalSettingVarNames, typeStore)) .build(); } @@ -1419,18 +1522,21 @@ private List createNestedClassMethods( TypeNode superType, Map nestedMethodSettingsMemberVarExprs, Set nestedDeprecatedSettingVarNames, + Set nestedInternalSettingVarNames, TypeStore typeStore) { List nestedClassMethods = new ArrayList<>(); nestedClassMethods.addAll( createNestedClassConstructorMethods( service, serviceConfig, nestedMethodSettingsMemberVarExprs, typeStore)); - nestedClassMethods.addAll(createNestedClassCreateDefaultMethods(typeStore)); + nestedClassMethods.addAll(createNestedClassCreateDefaultMethods(service, typeStore)); nestedClassMethods.add(createNestedClassInitDefaultsMethod(service, serviceConfig, typeStore)); nestedClassMethods.add(createNestedClassApplyToAllUnaryMethodsMethod(superType, typeStore)); nestedClassMethods.add(createNestedClassUnaryMethodSettingsBuilderGetterMethod()); nestedClassMethods.addAll( createNestedClassSettingsBuilderGetterMethods( - nestedMethodSettingsMemberVarExprs, nestedDeprecatedSettingVarNames)); + nestedMethodSettingsMemberVarExprs, + nestedDeprecatedSettingVarNames, + nestedInternalSettingVarNames)); nestedClassMethods.add(createNestedClassBuildMethod(service, typeStore)); return nestedClassMethods; } @@ -1582,7 +1688,7 @@ private static List createNestedClassConstructorMethods( VariableExpr varExpr = e.getValue(); TypeNode varType = varExpr.type(); Preconditions.checkState( - e.getKey().endsWith(SETTINGS_LITERAL), + e.getKey().endsWith(CommonStrings.SETTINGS_LITERAL), String.format("%s expected to end with \"Settings\"", e.getKey())); String methodName = getMethodNameFromSettingsVarName(e.getKey()); @@ -1762,14 +1868,19 @@ private static List createNestedClassConstructorMethods( return ctorMethods; } - protected List createNestedClassCreateDefaultMethods(TypeStore typeStore) { - return Collections.singletonList( - createNestedClassCreateDefaultMethod( - typeStore, - "createDefault", - "defaultTransportChannelProvider", - null, - "defaultApiClientHeaderProviderBuilder")); + protected List createNestedClassCreateDefaultMethods( + Service service, TypeStore typeStore) { + if (service.hasAnyEnabledMethodsForTransport(getTransportContext().transport())) { + return Arrays.asList( + createNestedClassCreateDefaultMethod( + typeStore, + "createDefault", + "defaultTransportChannelProvider", + null, + "defaultApiClientHeaderProviderBuilder")); + } else { + return Collections.emptyList(); + } } protected MethodDefinition createNestedClassCreateDefaultMethod( @@ -1856,14 +1967,6 @@ protected MethodDefinition createNestedClassCreateDefaultMethod( .setMethodName("build") .build()) .build()); - - bodyExprs.add( - MethodInvocationExpr.builder() - .setExprReferenceExpr(builderVarExpr) - .setMethodName("setEndpoint") - .setArguments( - MethodInvocationExpr.builder().setMethodName("getDefaultEndpoint").build()) - .build()); bodyExprs.add( MethodInvocationExpr.builder() .setExprReferenceExpr(builderVarExpr) @@ -1951,7 +2054,8 @@ private static MethodDefinition createNestedClassUnaryMethodSettingsBuilderGette private static List createNestedClassSettingsBuilderGetterMethods( Map nestedMethodSettingsMemberVarExprs, - Set nestedDeprecatedSettingVarNames) { + Set nestedDeprecatedSettingVarNames, + Set nestedInternalSettingVarNames) { Reference operationCallSettingsBuilderRef = ConcreteReference.withClazz(OperationCallSettings.Builder.class); Function isOperationCallSettingsBuilderFn = @@ -1959,39 +2063,22 @@ private static List createNestedClassSettingsBuilderGetterMeth t.reference() .copyAndSetGenerics(ImmutableList.of()) .equals(operationCallSettingsBuilderRef); - AnnotationNode lroBetaAnnotation = - AnnotationNode.builder() - .setType(FIXED_TYPESTORE.get("BetaApi")) - .setDescription( - "The surface for use by generated code is not stable yet and may change in the" - + " future.") - .build(); - AnnotationNode deprecatedAnnotation = AnnotationNode.withType(TypeNode.DEPRECATED); List javaMethods = new ArrayList<>(); for (Map.Entry settingsVarEntry : nestedMethodSettingsMemberVarExprs.entrySet()) { String varName = settingsVarEntry.getKey(); VariableExpr settingsVarExpr = settingsVarEntry.getValue(); - boolean isOperationCallSettings = - isOperationCallSettingsBuilderFn.apply(settingsVarExpr.type()); - - List annotations = new ArrayList<>(); - if (isOperationCallSettings) { - annotations.add(lroBetaAnnotation); - } boolean isDeprecated = nestedDeprecatedSettingVarNames.contains(varName); - if (isDeprecated) { - annotations.add(deprecatedAnnotation); - } + boolean isInternal = nestedInternalSettingVarNames.contains(varName); javaMethods.add( MethodDefinition.builder() .setHeaderCommentStatements( SettingsCommentComposer.createCallSettingsBuilderGetterComment( - getMethodNameFromSettingsVarName(varName), isDeprecated)) - .setAnnotations(annotations) + getMethodNameFromSettingsVarName(varName), isDeprecated, isInternal)) + .setAnnotations(createMethodAnnotation(isDeprecated, isInternal)) .setScope(ScopeNode.PUBLIC) .setReturnType(settingsVarExpr.type()) .setName(settingsVarExpr.variable().identifier().name()) @@ -2020,6 +2107,65 @@ private static MethodDefinition createNestedClassBuildMethod( .build(); } + private MethodDefinition createGetLibraryMetadataMethod(GapicContext context, Service service) { + TypeNode returnType = FIXED_TYPESTORE.get("LibraryMetadata"); + MethodInvocationExpr libraryMetadataBuilderExpr = + MethodInvocationExpr.builder() + .setStaticReferenceType(FIXED_TYPESTORE.get("LibraryMetadata")) + .setMethodName("newBuilder") + .build(); + + if (!Strings.isNullOrEmpty(context.artifact())) { + libraryMetadataBuilderExpr = + MethodInvocationExpr.builder() + .setExprReferenceExpr(libraryMetadataBuilderExpr) + .setMethodName("setArtifactName") + .setArguments(ValueExpr.withValue(StringObjectValue.withValue(context.artifact()))) + .build(); + } + + if (!Strings.isNullOrEmpty(context.repo())) { + libraryMetadataBuilderExpr = + MethodInvocationExpr.builder() + .setExprReferenceExpr(libraryMetadataBuilderExpr) + .setMethodName("setRepository") + .setArguments(ValueExpr.withValue(StringObjectValue.withValue(context.repo()))) + .build(); + } + + libraryMetadataBuilderExpr = + MethodInvocationExpr.builder() + .setExprReferenceExpr(libraryMetadataBuilderExpr) + .setMethodName("setVersion") + .setArguments( + VariableExpr.builder() + .setStaticReferenceType( + TypeNode.withReference( + VaporReference.builder() + .setName("Version") + .setPakkage(String.format("%s.stub", service.pakkage())) + .build())) + .setVariable( + Variable.builder().setName("VERSION").setType(TypeNode.STRING).build()) + .build()) + .build(); + + Expr returnExpr = + MethodInvocationExpr.builder() + .setExprReferenceExpr(libraryMetadataBuilderExpr) + .setMethodName("build") + .setReturnType(returnType) + .build(); + + return MethodDefinition.builder() + .setIsOverride(true) + .setScope(ScopeNode.PROTECTED) + .setReturnType(returnType) + .setName("getLibraryMetadata") + .setReturnExpr(returnExpr) + .build(); + } + private static TypeStore createStaticTypes() { List> concreteClazzes = Arrays.asList( @@ -2032,6 +2178,7 @@ private static TypeStore createStaticTypes() { BatchingDescriptor.class, BatchingSettings.class, BetaApi.class, + InternalApi.class, ClientContext.class, Duration.class, Empty.class, @@ -2044,10 +2191,12 @@ private static TypeStore createStaticTypes() { ImmutableMap.class, ImmutableSet.class, InstantiatingExecutorProvider.class, + LibraryMetadata.class, LimitExceededBehavior.class, List.class, Lists.class, MonitoredResourceDescriptor.class, + ObsoleteApi.class, Operation.class, OperationCallSettings.class, OperationSnapshot.class, @@ -2063,6 +2212,7 @@ private static TypeStore createStaticTypes() { StatusCode.class, StreamingCallSettings.class, StubSettings.class, + SuppressWarnings.class, TransportChannelProvider.class, UnaryCallSettings.class, UnaryCallable.class); @@ -2092,7 +2242,7 @@ private TypeStore createDynamicTypes(Service service, String pakkage) { service.pakkage(), service.methods().stream() .filter(m -> m.isPaged()) - .map(m -> String.format(PAGED_RESPONSE_TYPE_NAME_PATTERN, m.name())) + .map(m -> String.format(CommonStrings.PAGED_RESPONSE_TYPE_NAME_PATTERN, m.name())) .collect(Collectors.toList()), true, ClassNames.getServiceClientClassName(service)); @@ -2171,7 +2321,8 @@ private static VariableExpr createNestedRetryParamDefinitionsVarExpr() { } private static String getPagedResponseTypeName(String methodName) { - return String.format(PAGED_RESPONSE_TYPE_NAME_PATTERN, JavaStyle.toUpperCamelCase(methodName)); + return String.format( + CommonStrings.PAGED_RESPONSE_TYPE_NAME_PATTERN, JavaStyle.toUpperCamelCase(methodName)); } private static TypeNode getCallSettingsType( @@ -2204,7 +2355,7 @@ private static TypeNode getCallSettingsType( : ServerStreamingCallSettings.class); break; case CLIENT: - // Fall through. + // Fall through. case BIDI: callSettingsType = typeMakerFn.apply( @@ -2213,7 +2364,7 @@ private static TypeNode getCallSettingsType( : StreamingCallSettings.class); break; case NONE: - // Fall through. + // Fall through. default: break; } @@ -2249,11 +2400,11 @@ private static TypeNode getOperationCallSettingsType(Method method, boolean isSe private static String getMethodNameFromSettingsVarName(String settingsVarName) { BiFunction methodNameSubstrFn = (s, literal) -> s.substring(0, s.length() - literal.length()); - if (settingsVarName.endsWith(OPERATION_SETTINGS_LITERAL)) { - return methodNameSubstrFn.apply(settingsVarName, OPERATION_SETTINGS_LITERAL); + if (settingsVarName.endsWith(CommonStrings.OPERATION_SETTINGS_LITERAL)) { + return methodNameSubstrFn.apply(settingsVarName, CommonStrings.OPERATION_SETTINGS_LITERAL); } - if (settingsVarName.endsWith(SETTINGS_LITERAL)) { - return methodNameSubstrFn.apply(settingsVarName, SETTINGS_LITERAL); + if (settingsVarName.endsWith(CommonStrings.SETTINGS_LITERAL)) { + return methodNameSubstrFn.apply(settingsVarName, CommonStrings.SETTINGS_LITERAL); } return settingsVarName; } diff --git a/gapic-generator-java/src/main/java/com/google/api/generator/gapic/composer/common/AbstractTransportServiceStubClassComposer.java b/gapic-generator-java/src/main/java/com/google/api/generator/gapic/composer/common/AbstractTransportServiceStubClassComposer.java index c2f4fb7473..98d8a121f7 100644 --- a/gapic-generator-java/src/main/java/com/google/api/generator/gapic/composer/common/AbstractTransportServiceStubClassComposer.java +++ b/gapic-generator-java/src/main/java/com/google/api/generator/gapic/composer/common/AbstractTransportServiceStubClassComposer.java @@ -23,6 +23,7 @@ import com.google.api.gax.rpc.ClientStreamingCallable; import com.google.api.gax.rpc.LongRunningClient; import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.RequestParamsBuilder; import com.google.api.gax.rpc.RequestParamsExtractor; import com.google.api.gax.rpc.ServerStreamingCallable; import com.google.api.gax.rpc.UnaryCallable; @@ -34,13 +35,19 @@ import com.google.api.generator.engine.ast.EmptyLineStatement; import com.google.api.generator.engine.ast.Expr; import com.google.api.generator.engine.ast.ExprStatement; +import com.google.api.generator.engine.ast.IfStatement; import com.google.api.generator.engine.ast.JavaDocComment; +import com.google.api.generator.engine.ast.LambdaExpr; +import com.google.api.generator.engine.ast.LogicalOperationExpr; import com.google.api.generator.engine.ast.MethodDefinition; import com.google.api.generator.engine.ast.MethodInvocationExpr; import com.google.api.generator.engine.ast.NewObjectExpr; +import com.google.api.generator.engine.ast.Reference; import com.google.api.generator.engine.ast.ReferenceConstructorExpr; +import com.google.api.generator.engine.ast.RelationalOperationExpr; import com.google.api.generator.engine.ast.ScopeNode; import com.google.api.generator.engine.ast.Statement; +import com.google.api.generator.engine.ast.StringObjectValue; import com.google.api.generator.engine.ast.ThisObjectValue; import com.google.api.generator.engine.ast.ThrowExpr; import com.google.api.generator.engine.ast.TryCatchStatement; @@ -51,19 +58,29 @@ import com.google.api.generator.engine.ast.VariableExpr; import com.google.api.generator.gapic.composer.comment.StubCommentComposer; import com.google.api.generator.gapic.composer.store.TypeStore; +import com.google.api.generator.gapic.composer.utils.CommonStrings; import com.google.api.generator.gapic.composer.utils.PackageChecker; +import com.google.api.generator.gapic.model.Field; import com.google.api.generator.gapic.model.GapicClass; import com.google.api.generator.gapic.model.GapicClass.Kind; import com.google.api.generator.gapic.model.GapicContext; import com.google.api.generator.gapic.model.GapicServiceConfig; +import com.google.api.generator.gapic.model.HttpBindings; import com.google.api.generator.gapic.model.Message; import com.google.api.generator.gapic.model.Method; +import com.google.api.generator.gapic.model.RoutingHeaderRule; import com.google.api.generator.gapic.model.Service; +import com.google.api.generator.gapic.model.Transport; import com.google.api.generator.gapic.utils.JavaStyle; +import com.google.api.pathtemplate.PathTemplate; +import com.google.common.annotations.VisibleForTesting; import com.google.common.base.Preconditions; +import com.google.common.base.Splitter; +import com.google.common.base.Strings; import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; import com.google.longrunning.Operation; +import com.google.protobuf.TypeRegistry; import java.io.IOException; import java.util.ArrayList; import java.util.Arrays; @@ -72,9 +89,11 @@ import java.util.List; import java.util.Map; import java.util.Optional; +import java.util.UUID; import java.util.concurrent.TimeUnit; import java.util.function.BiFunction; import java.util.function.Function; +import java.util.function.Predicate; import java.util.stream.Collectors; import javax.annotation.Generated; import javax.annotation.Nullable; @@ -83,17 +102,12 @@ public abstract class AbstractTransportServiceStubClassComposer implements Class private static final Statement EMPTY_LINE_STATEMENT = EmptyLineStatement.create(); private static final String METHOD_DESCRIPTOR_NAME_PATTERN = "%sMethodDescriptor"; - private static final String PAGED_RESPONSE_TYPE_NAME_PATTERN = "%sPagedResponse"; private static final String PAGED_CALLABLE_CLASS_MEMBER_PATTERN = "%sPagedCallable"; private static final String BACKGROUND_RESOURCES_MEMBER_NAME = "backgroundResources"; - private static final String CALLABLE_NAME = "Callable"; private static final String CALLABLE_FACTORY_MEMBER_NAME = "callableFactory"; - private static final String CALLABLE_CLASS_MEMBER_PATTERN = "%sCallable"; + protected static final String CALLABLE_CLASS_MEMBER_PATTERN = "%sCallable"; private static final String OPERATION_CALLABLE_CLASS_MEMBER_PATTERN = "%sOperationCallable"; - private static final String OPERATION_CALLABLE_NAME = "OperationCallable"; - // private static final String OPERATIONS_STUB_MEMBER_NAME = "operationsStub"; - private static final String PAGED_CALLABLE_NAME = "PagedCallable"; protected static final TypeStore FIXED_TYPESTORE = createStaticTypes(); @@ -124,14 +138,21 @@ private static TypeStore createStaticTypes() { OperationCallable.class, OperationSnapshot.class, RequestParamsExtractor.class, + UUID.class, ServerStreamingCallable.class, TimeUnit.class, - UnaryCallable.class); + TypeRegistry.class, + UnaryCallable.class, + UnsupportedOperationException.class); return new TypeStore(concreteClazzes); } @Override public GapicClass generate(GapicContext context, Service service) { + if (!service.hasAnyEnabledMethodsForTransport(getTransportContext().transport())) { + return GapicClass.createNonGeneratedGapicClass(); + } + String pakkage = service.pakkage() + ".stub"; TypeStore typeStore = createDynamicTypes(service, pakkage); String className = getTransportContext().classNames().getTransportServiceStubClassName(service); @@ -190,6 +211,19 @@ public GapicClass generate(GapicContext context, Service service) { messageTypes, context.restNumericEnumsEnabled()); + List methodDefinitions = + createClassMethods( + context, + service, + typeStore, + classMemberVarExprs, + callableClassMemberVarExprs, + protoMethodNameToDescriptorVarExprs, + classStatements); + methodDefinitions.addAll( + createStubOverrideMethods( + classMemberVarExprs.get(BACKGROUND_RESOURCES_MEMBER_NAME), service)); + StubCommentComposer commentComposer = new StubCommentComposer(getTransportContext().transportNames().get(0)); @@ -204,24 +238,12 @@ public GapicClass generate(GapicContext context, Service service) { .setName(className) .setExtendsType( typeStore.get(getTransportContext().classNames().getServiceStubClassName(service))) - .setMethods( - createClassMethods( - context, - service, - typeStore, - classMemberVarExprs, - callableClassMemberVarExprs, - protoMethodNameToDescriptorVarExprs, - classStatements)) + .setMethods(methodDefinitions) .setStatements(classStatements) .build(); return GapicClass.create(kind, classDef); } - protected boolean isSupportedMethod(Method method) { - return true; - } - protected abstract Statement createMethodDescriptorVariableDecl( Service service, Method protoMethod, @@ -254,11 +276,82 @@ protected List createOperationsStubGetterMethod( .build()); } - protected abstract Expr createTransportSettingsInitExpr( + protected Expr createTransportSettingsInitExpr( Method method, VariableExpr transportSettingsVarExpr, VariableExpr methodDescriptorVarExpr, - List classStatements); + List classStatements, + ImmutableMap messageTypes) { + MethodInvocationExpr callSettingsBuilderExpr = + MethodInvocationExpr.builder() + .setStaticReferenceType(getTransportContext().transportCallSettingsType()) + .setGenerics(transportSettingsVarExpr.type().reference().generics()) + .setMethodName("newBuilder") + .build(); + callSettingsBuilderExpr = + MethodInvocationExpr.builder() + .setExprReferenceExpr(callSettingsBuilderExpr) + .setMethodName("setMethodDescriptor") + .setArguments(Arrays.asList(methodDescriptorVarExpr)) + .build(); + + // Transport is set to be either REST or GRPC from the sub composers + if (getTransportContext().transport() == Transport.REST) { + callSettingsBuilderExpr = + MethodInvocationExpr.builder() + .setExprReferenceExpr(callSettingsBuilderExpr) + .setMethodName("setTypeRegistry") + .setArguments( + Arrays.asList( + VariableExpr.builder() + .setVariable( + Variable.builder() + .setName("typeRegistry") + .setType(FIXED_TYPESTORE.get(TypeRegistry.class.getSimpleName())) + .build()) + .build())) + .build(); + } + + if (method.shouldSetParamsExtractor()) { + callSettingsBuilderExpr = + MethodInvocationExpr.builder() + .setExprReferenceExpr(callSettingsBuilderExpr) + .setMethodName("setParamsExtractor") + .setArguments(createRequestParamsExtractorClassInstance(method, classStatements)) + .build(); + } + + if (method.hasAutoPopulatedFields() && shouldGenerateRequestMutator(method, messageTypes)) { + callSettingsBuilderExpr = + MethodInvocationExpr.builder() + .setExprReferenceExpr(callSettingsBuilderExpr) + .setMethodName("setRequestMutator") + .setArguments(createRequestMutatorClassInstance(method, messageTypes)) + .build(); + } + + LambdaExpr extractor = createResourceNameExtractorClassInstance(method, messageTypes); + if (extractor != null) { + callSettingsBuilderExpr = + MethodInvocationExpr.builder() + .setExprReferenceExpr(callSettingsBuilderExpr) + .setMethodName("setResourceNameExtractor") + .setArguments(extractor) + .build(); + } + + callSettingsBuilderExpr = + MethodInvocationExpr.builder() + .setExprReferenceExpr(callSettingsBuilderExpr) + .setMethodName("build") + .setReturnType(transportSettingsVarExpr.type()) + .build(); + return AssignmentExpr.builder() + .setVariableExpr(transportSettingsVarExpr.toBuilder().setIsDecl(true).build()) + .setValueExpr(callSettingsBuilderExpr) + .build(); + } protected List createGetMethodDescriptorsMethod( Service service, @@ -307,7 +400,7 @@ protected List createMethodDescriptorVariableDecls( Map messageTypes, boolean restNumericEnumsEnabled) { return service.methods().stream() - .filter(this::isSupportedMethod) + .filter(x -> x.isSupportedByTransport(getTransportContext().transport())) .map( m -> createMethodDescriptorVariableDecl( @@ -336,7 +429,7 @@ private static List createClassMemberFieldDeclarations( protected Map createProtoMethodNameToDescriptorClassMembers( Service service, Class descriptorClass) { return service.methods().stream() - .filter(this::isSupportedMethod) + .filter(x -> x.isSupportedByTransport(getTransportContext().transport())) .collect( Collectors.toMap( Method::name, @@ -368,64 +461,69 @@ private Map createCallableClassMembers( Map callableClassMembers = new LinkedHashMap<>(); // Using a for-loop because the output cardinality is not a 1:1 mapping to the input set. for (Method protoMethod : service.methods()) { - if (!isSupportedMethod(protoMethod)) { + if (!protoMethod.isSupportedByTransport(getTransportContext().transport())) { continue; } String javaStyleProtoMethodName = JavaStyle.toLowerCamelCase(protoMethod.name()); String callableName = String.format(CALLABLE_CLASS_MEMBER_PATTERN, javaStyleProtoMethodName); - callableClassMembers.put( - callableName, - VariableExpr.withVariable( - Variable.builder() - .setName(callableName) - .setType(getCallableType(protoMethod)) - .build())); + callableClassMembers.put(callableName, getCallableExpr(protoMethod, callableName)); if (protoMethod.hasLro()) { callableName = String.format(OPERATION_CALLABLE_CLASS_MEMBER_PATTERN, javaStyleProtoMethodName); - callableClassMembers.put( - callableName, - VariableExpr.withVariable( - Variable.builder() - .setName(callableName) - .setType( - TypeNode.withReference( - ConcreteReference.builder() - .setClazz(OperationCallable.class) - .setGenerics( - Arrays.asList( - protoMethod.inputType().reference(), - protoMethod.lro().responseType().reference(), - protoMethod.lro().metadataType().reference())) - .build())) - .build())); + callableClassMembers.put(callableName, getOperationCallableExpr(protoMethod, callableName)); } if (protoMethod.isPaged()) { callableName = String.format(PAGED_CALLABLE_CLASS_MEMBER_PATTERN, javaStyleProtoMethodName); callableClassMembers.put( - callableName, - VariableExpr.withVariable( - Variable.builder() - .setName(callableName) - .setType( - TypeNode.withReference( - getCallableType(protoMethod) - .reference() - .copyAndSetGenerics( - Arrays.asList( - protoMethod.inputType().reference(), - typeStore - .get( - String.format( - PAGED_RESPONSE_TYPE_NAME_PATTERN, - protoMethod.name())) - .reference())))) - .build())); + callableName, getPagedCallableExpr(typeStore, protoMethod, callableName)); } } return callableClassMembers; } + private VariableExpr getCallableExpr(Method protoMethod, String callableName) { + return VariableExpr.withVariable( + Variable.builder().setName(callableName).setType(getCallableType(protoMethod)).build()); + } + + private VariableExpr getPagedCallableExpr( + TypeStore typeStore, Method protoMethod, String callableName) { + return VariableExpr.withVariable( + Variable.builder() + .setName(callableName) + .setType( + TypeNode.withReference( + getCallableType(protoMethod) + .reference() + .copyAndSetGenerics( + Arrays.asList( + protoMethod.inputType().reference(), + typeStore + .get( + String.format( + CommonStrings.PAGED_RESPONSE_TYPE_NAME_PATTERN, + protoMethod.name())) + .reference())))) + .build()); + } + + private VariableExpr getOperationCallableExpr(Method protoMethod, String callableName) { + return VariableExpr.withVariable( + Variable.builder() + .setName(callableName) + .setType( + TypeNode.withReference( + ConcreteReference.builder() + .setClazz(OperationCallable.class) + .setGenerics( + Arrays.asList( + protoMethod.inputType().reference(), + protoMethod.lro().responseType().reference(), + protoMethod.lro().metadataType().reference())) + .build())) + .build()); + } + protected List createClassAnnotations(Service service) { List annotations = new ArrayList<>(); if (!PackageChecker.isGaApi(service.pakkage())) { @@ -460,7 +558,6 @@ protected List createClassMethods( service, typeStore, classMemberVarExprs, - callableClassMemberVarExprs, protoMethodNameToDescriptorVarExprs, classStatements)); javaMethods.addAll( @@ -470,9 +567,6 @@ protected List createClassMethods( service, classMemberVarExprs.get(getTransportContext().transportOperationsStubNames().get(0)))); javaMethods.addAll(createCallableGetterMethods(callableClassMemberVarExprs)); - javaMethods.addAll( - createStubOverrideMethods( - classMemberVarExprs.get(BACKGROUND_RESOURCES_MEMBER_NAME), service)); return javaMethods; } @@ -562,7 +656,6 @@ protected List createConstructorMethods( Service service, TypeStore typeStore, Map classMemberVarExprs, - Map callableClassMemberVarExprs, Map protoMethodNameToDescriptorVarExprs, List classStatements) { TypeNode stubSettingsType = @@ -633,9 +726,7 @@ protected List createConstructorMethods( secondCtorExprs.add( AssignmentExpr.builder() .setVariableExpr( - classMemberVarExprs - .get("callableFactory") - .toBuilder() + classMemberVarExprs.get("callableFactory").toBuilder() .setExprReferenceExpr(thisExpr) .build()) .setValueExpr(callableFactoryVarExpr) @@ -646,6 +737,7 @@ protected List createConstructorMethods( if (generateOperationsStubLogic(service)) { secondCtorExprs.addAll( createOperationsStubInitExpr( + context, service, thisExpr, operationsStubClassVarExpr, @@ -660,7 +752,7 @@ protected List createConstructorMethods( // Transport settings local variables. Map javaStyleMethodNameToTransportSettingsVarExprs = service.methods().stream() - .filter(this::isSupportedMethod) + .filter(x -> x.isSupportedByTransport(getTransportContext().transport())) .collect( Collectors.toMap( m -> JavaStyle.toLowerCamelCase(m.name()), @@ -684,7 +776,7 @@ protected List createConstructorMethods( secondCtorExprs.addAll( service.methods().stream() - .filter(this::isSupportedMethod) + .filter(x -> x.isSupportedByTransport(getTransportContext().transport())) .map( m -> createTransportSettingsInitExpr( @@ -692,7 +784,8 @@ protected List createConstructorMethods( javaStyleMethodNameToTransportSettingsVarExprs.get( JavaStyle.toLowerCamelCase(m.name())), protoMethodNameToDescriptorVarExprs.get(m.name()), - classStatements)) + classStatements, + context.messages())) .collect(Collectors.toList())); secondCtorStatements.addAll( secondCtorExprs.stream().map(ExprStatement::withExpr).collect(Collectors.toList())); @@ -700,22 +793,33 @@ protected List createConstructorMethods( secondCtorStatements.add(EMPTY_LINE_STATEMENT); // Initialize Callable variables. - secondCtorExprs.addAll( - callableClassMemberVarExprs.entrySet().stream() - .map( - e -> - createCallableInitExpr( - context, - service, - e.getKey(), - e.getValue(), - callableFactoryVarExpr, - settingsVarExpr, - clientContextVarExpr, - operationsStubClassVarExpr, - thisExpr, - javaStyleMethodNameToTransportSettingsVarExprs)) - .collect(Collectors.toList())); + // The logic inside createCallableInitExprs() is very similar to createCallableClassMembers(). + // It is mostly duplicated because `createCallableClassMembers` returns a heuristic to + // determine the RPC type. The RPCs are mapped by name and the types are determined by the + // generated name and was problematic for certain RPC names. For example, the GetApiOperation + // RPC name would have a mapping of GetApiOperationCallable, and the `createCallableInitExprs` + // method would attempt to generate LRO code because of the `OperationCallable` suffix. + // Instead, we now pass the method object which is the SoT for the type of the method and not + // based on heuristics/ suffix. + for (Method method : service.methods()) { + // Do not generate callables for non supported RPCs (i.e. Bidi-Streaming and Client Streaming + // for HttpJson) + if (!method.isSupportedByTransport(getTransportContext().transport())) { + continue; + } + secondCtorExprs.addAll( + createCallableInitExprs( + context, + service, + method, + typeStore, + callableFactoryVarExpr, + settingsVarExpr, + clientContextVarExpr, + operationsStubClassVarExpr, + thisExpr, + javaStyleMethodNameToTransportSettingsVarExprs)); + } secondCtorStatements.addAll( secondCtorExprs.stream().map(ExprStatement::withExpr).collect(Collectors.toList())); secondCtorExprs.clear(); @@ -755,6 +859,7 @@ protected List createConstructorMethods( } protected List createOperationsStubInitExpr( + GapicContext context, Service service, Expr thisExpr, VariableExpr operationsStubClassVarExpr, @@ -784,67 +889,116 @@ protected VariableExpr declareLongRunningClient() { return null; } - private Expr createCallableInitExpr( + // Can return multiple Exprs for a single RPC. Each of the Exprs will initialize a callable + // in the constructor. The possible combinations are Normal (Unary, Streaming, Batching) and + // either Operation or Paged (if needed). It is not possible to have three callable Exprs + // returned because LROs are not paged, so it will either be an additional LRO or paged callable. + private List createCallableInitExprs( GapicContext context, Service service, - String callableVarName, - VariableExpr callableVarExpr, + Method method, + TypeStore typeStore, VariableExpr callableFactoryVarExpr, VariableExpr settingsVarExpr, VariableExpr clientContextVarExpr, VariableExpr operationsStubClassVarExpr, Expr thisExpr, Map javaStyleMethodNameToTransportSettingsVarExprs) { - boolean isOperation = callableVarName.endsWith(OPERATION_CALLABLE_NAME); - boolean isPaged = callableVarName.endsWith(PAGED_CALLABLE_NAME); - int sublength; - if (isOperation) { - sublength = OPERATION_CALLABLE_NAME.length(); - } else if (isPaged) { - sublength = PAGED_CALLABLE_NAME.length(); - } else { - sublength = CALLABLE_NAME.length(); - } - String javaStyleMethodName = callableVarName.substring(0, callableVarName.length() - sublength); - List creatorMethodArgVarExprs; + List callableInitExprs = new ArrayList<>(); + String javaStyleProtoMethodName = JavaStyle.toLowerCamelCase(method.name()); + Expr transportSettingsVarExpr = - javaStyleMethodNameToTransportSettingsVarExprs.get(javaStyleMethodName); - if (transportSettingsVarExpr == null && isOperation) { - // Try again, in case the name detection above was inaccurate. - isOperation = false; - sublength = CALLABLE_NAME.length(); - javaStyleMethodName = callableVarName.substring(0, callableVarName.length() - sublength); - transportSettingsVarExpr = - javaStyleMethodNameToTransportSettingsVarExprs.get(javaStyleMethodName); - } + javaStyleMethodNameToTransportSettingsVarExprs.get(javaStyleProtoMethodName); Preconditions.checkNotNull( transportSettingsVarExpr, String.format( - "No transport settings variable found for method name %s", javaStyleMethodName)); - if (isOperation) { + "No transport settings variable found for method name %s", javaStyleProtoMethodName)); + + // Build the normal callable which will be generated for every RPC + VariableExpr callableVarExpr = + getCallableExpr( + method, String.format(CALLABLE_CLASS_MEMBER_PATTERN, javaStyleProtoMethodName)); + List creatorMethodArgVarExprs = + Arrays.asList( + transportSettingsVarExpr, + MethodInvocationExpr.builder() + .setExprReferenceExpr(settingsVarExpr) + .setMethodName(String.format("%sSettings", javaStyleProtoMethodName)) + .build(), + clientContextVarExpr); + AssignmentExpr callableExpr = + buildCallableTransportExpr( + context, + service, + callableFactoryVarExpr, + thisExpr, + javaStyleProtoMethodName, + callableVarExpr, + creatorMethodArgVarExprs); + callableInitExprs.add(callableExpr); + + // Build an additional paged callable if the RPC is paged. The creatorMethodArgVarExprs is the + // same as the normal callable + if (method.isPaged()) { + callableVarExpr = + getPagedCallableExpr( + typeStore, + method, + String.format(PAGED_CALLABLE_CLASS_MEMBER_PATTERN, javaStyleProtoMethodName)); + callableExpr = + buildCallableTransportExpr( + context, + service, + callableFactoryVarExpr, + thisExpr, + javaStyleProtoMethodName, + callableVarExpr, + creatorMethodArgVarExprs); + callableInitExprs.add(callableExpr); + } + + // Build an additional operation callable if the RPC is an LRO. Rebuild the + // creatorMethodArgVarExprs as LROs have a special OperationSettings + if (method.hasLro()) { + callableVarExpr = + getOperationCallableExpr( + method, + String.format(OPERATION_CALLABLE_CLASS_MEMBER_PATTERN, javaStyleProtoMethodName)); creatorMethodArgVarExprs = Arrays.asList( transportSettingsVarExpr, MethodInvocationExpr.builder() .setExprReferenceExpr(settingsVarExpr) - .setMethodName(String.format("%sOperationSettings", javaStyleMethodName)) + .setMethodName(String.format("%sOperationSettings", javaStyleProtoMethodName)) .build(), clientContextVarExpr, operationsStubClassVarExpr); - } else { - creatorMethodArgVarExprs = - Arrays.asList( - transportSettingsVarExpr, - MethodInvocationExpr.builder() - .setExprReferenceExpr(settingsVarExpr) - .setMethodName(String.format("%sSettings", javaStyleMethodName)) - .build(), - clientContextVarExpr); + callableExpr = + buildCallableTransportExpr( + context, + service, + callableFactoryVarExpr, + thisExpr, + javaStyleProtoMethodName, + callableVarExpr, + creatorMethodArgVarExprs); + callableInitExprs.add(callableExpr); } - String methodName = JavaStyle.toUpperCamelCase(javaStyleMethodName); + return callableInitExprs; + } + + private AssignmentExpr buildCallableTransportExpr( + GapicContext context, + Service service, + VariableExpr callableFactoryVarExpr, + Expr thisExpr, + String methodName, + VariableExpr callableVarExpr, + List creatorMethodArgVarExprs) { Optional callableCreatorMethodName = - getCallableCreatorMethodName(context, service, callableVarExpr.type(), methodName); + getCallableCreatorMethodName( + context, service, callableVarExpr.type(), JavaStyle.toUpperCamelCase(methodName)); Expr initExpr; if (callableCreatorMethodName.isPresent()) { @@ -1055,7 +1209,7 @@ private List createStubOverrideMethods( private boolean checkOperationPollingMethod(Service service) { return service.methods().stream() - .filter(this::isSupportedMethod) + .filter(x -> x.isSupportedByTransport(getTransportContext().transport())) .anyMatch(Method::isOperationPollingMethod); } @@ -1094,16 +1248,16 @@ private TypeStore createDynamicTypes(Service service, String stubPakkage) { typeStore.putAll( service.pakkage(), service.methods().stream() - .filter(this::isSupportedMethod) + .filter(x -> x.isSupportedByTransport(getTransportContext().transport())) .filter(Method::isPaged) - .map(m -> String.format(PAGED_RESPONSE_TYPE_NAME_PATTERN, m.name())) + .map(m -> String.format(CommonStrings.PAGED_RESPONSE_TYPE_NAME_PATTERN, m.name())) .collect(Collectors.toList()), true, getTransportContext().classNames().getServiceClientClassName(service)); return typeStore; } - private static TypeNode getCallableType(Method protoMethod) { + protected static TypeNode getCallableType(Method protoMethod) { TypeNode callableType = FIXED_TYPESTORE.get("UnaryCallable"); switch (protoMethod.stream()) { case CLIENT: @@ -1116,7 +1270,7 @@ private static TypeNode getCallableType(Method protoMethod) { callableType = FIXED_TYPESTORE.get("BidiStreamingCallable"); break; case NONE: - // Fall through + // Fall through default: // Fall through } @@ -1163,4 +1317,512 @@ protected TypeNode getTransportOperationsStubType(Service service) { return transportOpeationsStubType; } + + protected static LambdaExpr createRequestMutatorClassInstance( + Method method, ImmutableMap messageTypes) { + List bodyStatements = new ArrayList<>(); + VariableExpr requestVarExpr = createRequestVarExpr(method); + + Reference requestBuilderRef = + VaporReference.builder() + .setEnclosingClassNames(method.inputType().reference().name()) + .setName("Builder") + .setPakkage(method.inputType().reference().pakkage()) + .build(); + + TypeNode requestBuilderType = TypeNode.withReference(requestBuilderRef); + + VariableExpr requestBuilderVarExpr = + VariableExpr.builder() + .setVariable( + Variable.builder().setName("requestBuilder").setType(requestBuilderType).build()) + .setIsDecl(true) + .build(); + + MethodInvocationExpr setRequestBuilderInvocationExpr = + MethodInvocationExpr.builder() + .setExprReferenceExpr(requestVarExpr) + .setMethodName("toBuilder") + .setReturnType(requestBuilderType) + .build(); + + Expr requestBuilderExpr = + AssignmentExpr.builder() + .setVariableExpr(requestBuilderVarExpr) + .setValueExpr(setRequestBuilderInvocationExpr) + .build(); + + bodyStatements.add(ExprStatement.withExpr(requestBuilderExpr)); + + VariableExpr returnBuilderVarExpr = + VariableExpr.builder() + .setVariable( + Variable.builder().setName("requestBuilder").setType(requestBuilderType).build()) + .setIsDecl(false) + .build(); + + MethodInvocationExpr.Builder returnExpr = + MethodInvocationExpr.builder() + .setExprReferenceExpr(returnBuilderVarExpr) + .setMethodName("build"); + + createRequestMutatorBody(method, messageTypes, bodyStatements, returnBuilderVarExpr); + + return LambdaExpr.builder() + .setArguments(requestVarExpr.toBuilder().setIsDecl(true).build()) + .setBody(bodyStatements) + .setReturnExpr(returnExpr.build()) + .build(); + } + + @VisibleForTesting + static List createRequestMutatorBody( + Method method, + ImmutableMap messageTypes, + List bodyStatements, + VariableExpr returnBuilderVarExpr) { + + Message methodRequestMessage = messageTypes.get(method.inputType().reference().fullName()); + method.autoPopulatedFields().stream() + // Map each field name to its corresponding Field object, if present + .map( + fieldName -> + methodRequestMessage.fields().stream() + .filter(field -> field.name().equals(fieldName)) + .findFirst()) + .filter(Optional::isPresent) // Keep only the existing Fields + .map(Optional::get) // Extract the Field from the Optional + .filter(Field::canBeAutoPopulated) // Filter fields that can be autopopulated + .forEach( + matchedField -> { + // Create statements for each autopopulated Field + bodyStatements.add( + createAutoPopulatedRequestStatement( + method, matchedField.name(), returnBuilderVarExpr)); + }); + return bodyStatements; + } + + @VisibleForTesting + static Statement createAutoPopulatedRequestStatement( + Method method, String fieldName, VariableExpr returnBuilderVarExpr) { + + VariableExpr requestVarExpr = createRequestVarExpr(method); + + // Expected expression: request.getRequestId() + MethodInvocationExpr getAutoPopulatedFieldInvocationExpr = + MethodInvocationExpr.builder() + .setExprReferenceExpr(requestVarExpr) + .setMethodName(String.format("get%s", JavaStyle.toUpperCamelCase(fieldName))) + .setReturnType(TypeNode.STRING) + .build(); + + VariableExpr stringsVar = + VariableExpr.withVariable( + Variable.builder() + .setType(TypeNode.withReference(ConcreteReference.withClazz(Strings.class))) + .setName("Strings") + .build()); + + // Expected expression: Strings.isNullOrEmpty(request.getRequestId()) + MethodInvocationExpr isNullOrEmptyFieldInvocationExpr = + MethodInvocationExpr.builder() + .setExprReferenceExpr(stringsVar) + .setMethodName("isNullOrEmpty") + .setReturnType(TypeNode.BOOLEAN) + .setArguments(getAutoPopulatedFieldInvocationExpr) + .build(); + + // Note: Currently, autopopulation is only for UUID. + VariableExpr uuidVarExpr = + VariableExpr.withVariable( + Variable.builder() + .setType( + TypeNode.withReference( + ConcreteReference.builder().setClazz(UUID.class).build())) + .setName("UUID") + .build()); + + // Expected expression: UUID.randomUUID() + MethodInvocationExpr autoPopulatedFieldsArgsHelper = + MethodInvocationExpr.builder() + .setExprReferenceExpr(uuidVarExpr) + .setMethodName("randomUUID") + .setReturnType( + TypeNode.withReference(ConcreteReference.builder().setClazz(UUID.class).build())) + .build(); + + // Expected expression: UUID.randomUUID().toString() + MethodInvocationExpr autoPopulatedFieldsArgsToString = + MethodInvocationExpr.builder() + .setExprReferenceExpr(autoPopulatedFieldsArgsHelper) + .setMethodName("toString") + .setReturnType(TypeNode.STRING) + .build(); + + // Expected expression: requestBuilder().setField(UUID.randomUUID().toString()) + MethodInvocationExpr setAutoPopulatedFieldInvocationExpr = + MethodInvocationExpr.builder() + .setArguments(autoPopulatedFieldsArgsToString) + .setExprReferenceExpr(returnBuilderVarExpr) + .setMethodName(String.format("set%s", JavaStyle.toUpperCamelCase(fieldName))) + .setReturnType(method.inputType()) + .build(); + + return IfStatement.builder() + .setConditionExpr(isNullOrEmptyFieldInvocationExpr) + .setBody(Arrays.asList(ExprStatement.withExpr(setAutoPopulatedFieldInvocationExpr))) + .build(); + } + + /** + * The Request Mutator should only be generated if the field exists in the Message and is properly + * configured in the Message(see {@link Field#canBeAutoPopulated()}) + */ + @VisibleForTesting + static Boolean shouldGenerateRequestMutator( + Method method, ImmutableMap messageTypes) { + if (method.inputType().reference() == null + || method.inputType().reference().fullName() == null) { + return false; + } + String methodRequestName = method.inputType().reference().fullName(); + + Message methodRequestMessage = messageTypes.get(methodRequestName); + if (methodRequestMessage == null || methodRequestMessage.fields() == null) { + return false; + } + return method.autoPopulatedFields().stream().anyMatch(shouldAutoPopulate(methodRequestMessage)); + } + + /** + * The field has to exist in the Message and properly configured in the Message(see {@link + * Field#canBeAutoPopulated()}) + */ + private static Predicate shouldAutoPopulate(Message methodRequestMessage) { + return fieldName -> + methodRequestMessage.fields().stream() + .anyMatch(field -> field.name().equals(fieldName) && field.canBeAutoPopulated()); + } + + /** + * The Resource Name Extractor should only be generated if the request contains a field that has + * resource reference (see {@link Field#hasResourceReference()}) + */ + @Nullable + protected static LambdaExpr createResourceNameExtractorClassInstance( + Method method, ImmutableMap messageTypes) { + Field resourceNameField = getDestinationResourceIdField(method, messageTypes); + + if (resourceNameField == null) { + return null; + } + + // Expected expression: request -> request.getField() + VariableExpr requestVarExpr = createRequestVarExpr(method); + List bodyStatements = new ArrayList<>(); + Expr returnExpr = + MethodInvocationExpr.builder() + .setExprReferenceExpr(requestVarExpr) + .setMethodName( + String.format("get%s", JavaStyle.toUpperCamelCase(resourceNameField.name()))) + .setReturnType(TypeNode.STRING) + .build(); + + return LambdaExpr.builder() + .setArguments(requestVarExpr.toBuilder().setIsDecl(true).build()) + .setBody(bodyStatements) + .setReturnExpr(returnExpr) + .build(); + } + + // Find the first field that has resource reference in a request message + private static Field getDestinationResourceIdField( + Method method, ImmutableMap messageTypes) { + if (method.inputType().reference() == null + || method.inputType().reference().fullName() == null) { + return null; + } + String methodRequestName = method.inputType().reference().fullName(); + Message methodRequestMessage = messageTypes.get(methodRequestName); + if (methodRequestMessage == null) { + return null; + } + + return methodRequestMessage.fields().stream() + .filter(Field::hasResourceReference) + .filter(f -> !f.isRepeated()) + .findFirst() + .orElse(null); + } + + protected LambdaExpr createRequestParamsExtractorClassInstance( + Method method, List classStatements) { + List bodyStatements = new ArrayList<>(); + VariableExpr requestVarExpr = createRequestVarExpr(method); + TypeNode returnType = + TypeNode.withReference( + ConcreteReference.builder() + .setClazz(Map.class) + .setGenerics(TypeNode.STRING.reference(), TypeNode.STRING.reference()) + .build()); + MethodInvocationExpr.Builder returnExpr = + MethodInvocationExpr.builder().setReturnType(returnType); + // If the google.api.routing annotation is present(even with empty routing parameters), + // the implicit routing headers specified in the google.api.http annotation should not be sent + if (method.routingHeaderRule() == null) { + createRequestParamsExtractorBodyForHttpBindings( + method, requestVarExpr, bodyStatements, returnExpr); + } else { + createRequestParamsExtractorBodyForRoutingHeaders( + method, requestVarExpr, classStatements, bodyStatements, returnExpr); + } + + // Overrides extract(). + // https://github.com/googleapis/gax-java/blob/8d45d186e36ae97b789a6f89d80ae5213a773b65/gax/src/main/java/com/google/api/gax/rpc/RequestParamsExtractor.java#L55 + return LambdaExpr.builder() + .setArguments(requestVarExpr.toBuilder().setIsDecl(true).build()) + .setBody(bodyStatements) + .setReturnExpr(returnExpr.build()) + .build(); + } + + private void createRequestParamsExtractorBodyForHttpBindings( + Method method, + VariableExpr requestVarExpr, + List bodyStatements, + MethodInvocationExpr.Builder returnExprBuilder) { + TypeNode routingHeadersBuilderType = + TypeNode.withReference( + ConcreteReference.builder().setClazz(RequestParamsBuilder.class).build()); + VariableExpr routingHeadersBuilderVarExpr = + VariableExpr.builder() + .setVariable( + Variable.builder().setName("builder").setType(routingHeadersBuilderType).build()) + .setIsDecl(true) + .build(); + MethodInvocationExpr routingHeaderBuilderInvokeExpr = + MethodInvocationExpr.builder() + .setStaticReferenceType(routingHeadersBuilderType) + .setMethodName("create") + .setReturnType(routingHeadersBuilderType) + .build(); + Expr routingHeadersBuilderInitExpr = + AssignmentExpr.builder() + .setVariableExpr(routingHeadersBuilderVarExpr) + .setValueExpr(routingHeaderBuilderInvokeExpr) + .build(); + bodyStatements.add(ExprStatement.withExpr(routingHeadersBuilderInitExpr)); + VariableExpr routingHeadersBuilderVarNonDeclExpr = + VariableExpr.builder() + .setVariable( + Variable.builder().setName("builder").setType(routingHeadersBuilderType).build()) + .build(); + for (HttpBindings.HttpBinding httpBindingFieldBinding : + method.httpBindings().pathParameters()) { + MethodInvocationExpr requestBuilderExpr = + createRequestFieldGetterExpr( + requestVarExpr, + httpBindingFieldBinding.name(), + httpBindingFieldBinding.field() != null && httpBindingFieldBinding.field().isEnum()); + Expr valueOfExpr = + MethodInvocationExpr.builder() + .setStaticReferenceType(TypeNode.STRING) + .setMethodName("valueOf") + .setArguments(requestBuilderExpr) + .build(); + + Expr paramsAddExpr = + MethodInvocationExpr.builder() + .setExprReferenceExpr(routingHeadersBuilderVarNonDeclExpr) + .setMethodName("add") + .setArguments( + ValueExpr.withValue(StringObjectValue.withValue(httpBindingFieldBinding.name())), + valueOfExpr) + .build(); + bodyStatements.add(ExprStatement.withExpr(paramsAddExpr)); + } + + returnExprBuilder + .setExprReferenceExpr(routingHeadersBuilderVarNonDeclExpr) + .setMethodName("build"); + } + + private void createRequestParamsExtractorBodyForRoutingHeaders( + Method method, + VariableExpr requestVarExpr, + List classStatements, + List bodyStatements, + MethodInvocationExpr.Builder returnExprBuilder) { + TypeNode routingHeadersBuilderType = + TypeNode.withReference( + ConcreteReference.builder().setClazz(RequestParamsBuilder.class).build()); + VariableExpr routingHeadersBuilderVarExpr = + VariableExpr.builder() + .setVariable( + Variable.builder().setName("builder").setType(routingHeadersBuilderType).build()) + .setIsDecl(true) + .build(); + MethodInvocationExpr routingHeaderBuilderInvokeExpr = + MethodInvocationExpr.builder() + .setStaticReferenceType(routingHeadersBuilderType) + .setMethodName("create") + .setReturnType(routingHeadersBuilderType) + .build(); + Expr routingHeadersBuilderInitExpr = + AssignmentExpr.builder() + .setVariableExpr(routingHeadersBuilderVarExpr) + .setValueExpr(routingHeaderBuilderInvokeExpr) + .build(); + bodyStatements.add(ExprStatement.withExpr(routingHeadersBuilderInitExpr)); + List routingHeaderParams = + method.routingHeaderRule().routingHeaderParams(); + VariableExpr routingHeadersBuilderVarNonDeclExpr = + VariableExpr.builder() + .setVariable( + Variable.builder().setName("builder").setType(routingHeadersBuilderType).build()) + .build(); + for (int i = 0; i < routingHeaderParams.size(); i++) { + RoutingHeaderRule.RoutingHeaderParam routingHeaderParam = routingHeaderParams.get(i); + // Explicit routing headers are implemented as strings currently, hence sending "false" + // in isFieldEnum() for it. + MethodInvocationExpr requestFieldGetterExpr = + createRequestFieldGetterExpr(requestVarExpr, routingHeaderParam.fieldName(), false); + Expr routingHeaderKeyExpr = + ValueExpr.withValue(StringObjectValue.withValue(routingHeaderParam.key())); + String pathTemplateName = + String.format("%s_%s_PATH_TEMPLATE", JavaStyle.toUpperSnakeCase(method.name()), i); + TypeNode pathTemplateType = + TypeNode.withReference(ConcreteReference.withClazz(PathTemplate.class)); + Variable pathTemplateVar = + Variable.builder().setType(pathTemplateType).setName(pathTemplateName).build(); + Expr routingHeaderPatternExpr = VariableExpr.withVariable(pathTemplateVar); + Statement pathTemplateClassVar = + createPathTemplateClassStatement(routingHeaderParam, pathTemplateType, pathTemplateVar); + classStatements.add(pathTemplateClassVar); + MethodInvocationExpr addParamMethodExpr = + MethodInvocationExpr.builder() + .setExprReferenceExpr(routingHeadersBuilderVarNonDeclExpr) + .setMethodName("add") + .setArguments(requestFieldGetterExpr, routingHeaderKeyExpr, routingHeaderPatternExpr) + .build(); + + ExprStatement addParamStatement = ExprStatement.withExpr(addParamMethodExpr); + // No need to add null check if there is no nested fields + if (routingHeaderParam.getDescendantFieldNames().size() == 1) { + bodyStatements.add(addParamStatement); + } else { + IfStatement ifStatement = + IfStatement.builder() + .setConditionExpr( + fieldValuesNotNullConditionExpr( + requestVarExpr, routingHeaderParam.getDescendantFieldNames())) + .setBody(ImmutableList.of(addParamStatement)) + .build(); + bodyStatements.add(ifStatement); + } + } + returnExprBuilder + .setExprReferenceExpr(routingHeadersBuilderVarNonDeclExpr) + .setMethodName("build"); + } + + private Statement createPathTemplateClassStatement( + RoutingHeaderRule.RoutingHeaderParam routingHeaderParam, + TypeNode pathTemplateType, + Variable pathTemplateVar) { + VariableExpr pathTemplateVarExpr = + VariableExpr.builder() + .setVariable(pathTemplateVar) + .setIsDecl(true) + .setIsStatic(true) + .setIsFinal(true) + .setScope(ScopeNode.PRIVATE) + .build(); + ValueExpr valueExpr = + ValueExpr.withValue(StringObjectValue.withValue(routingHeaderParam.pattern())); + Expr pathTemplateExpr = + AssignmentExpr.builder() + .setVariableExpr(pathTemplateVarExpr) + .setValueExpr( + MethodInvocationExpr.builder() + .setStaticReferenceType(pathTemplateType) + .setMethodName("create") + .setArguments(valueExpr) + .setReturnType(pathTemplateType) + .build()) + .build(); + return ExprStatement.withExpr(pathTemplateExpr); + } + + private Expr fieldValuesNotNullConditionExpr( + VariableExpr requestVarExpr, List fieldNames) { + MethodInvocationExpr.Builder requestFieldGetterExprBuilder = + MethodInvocationExpr.builder().setExprReferenceExpr(requestVarExpr); + Expr fieldValuesNotNullExpr = null; + for (int i = 0; i < fieldNames.size() - 1; i++) { + String currFieldName = fieldNames.get(i); + String bindingFieldMethodName = + String.format("get%s", JavaStyle.toUpperCamelCase(currFieldName)); + requestFieldGetterExprBuilder = + requestFieldGetterExprBuilder.setMethodName(bindingFieldMethodName); + // set return type of each method invocation to String just to pass the validation for + // RelationalOperationExpr that both side of relational operation needs to be a valid equality + // type + MethodInvocationExpr requestGetterExpr = + requestFieldGetterExprBuilder.setReturnType(TypeNode.STRING).build(); + Expr currentValueNotNullExpr = + RelationalOperationExpr.notEqualToWithExprs( + requestGetterExpr, ValueExpr.createNullExpr()); + if (fieldValuesNotNullExpr == null) { + fieldValuesNotNullExpr = currentValueNotNullExpr; + } else { + fieldValuesNotNullExpr = + LogicalOperationExpr.logicalAndWithExprs( + fieldValuesNotNullExpr, currentValueNotNullExpr); + } + requestFieldGetterExprBuilder = + MethodInvocationExpr.builder().setExprReferenceExpr(requestGetterExpr); + } + return fieldValuesNotNullExpr; + } + + private MethodInvocationExpr createRequestFieldGetterExpr( + VariableExpr requestVarExpr, String fieldName, boolean isFieldEnum) { + MethodInvocationExpr.Builder requestFieldGetterExprBuilder = + MethodInvocationExpr.builder().setExprReferenceExpr(requestVarExpr); + List descendantFields = Splitter.on(".").splitToList(fieldName); + // Handle foo.bar cases by descending into the subfields. + // e.g. foo.bar -> request.getFoo().getBar() + for (int i = 0; i < descendantFields.size(); i++) { + String currFieldName = descendantFields.get(i); + String bindingFieldMethodName = + String.format("get%s", JavaStyle.toUpperCamelCase(currFieldName)); + + // Only at the last descendant field, if enum, we want to extract the value. + // For example, consider the chain request.getFoo().getBar(). + // If you added "Value" to both fields (getFooValue().getBarValue()), + // it would not work correctly, as getFooValue() may return an int or some other type, + // and calling getBarValue() on it wouldn't make sense + // By adding "Value" only at the last descendant field, + // you ensure that the modification aligns with the expected method + // chaining behavior and correctly retrieves the underlying value of the enum field." + if (i == descendantFields.size() - 1 && isFieldEnum) { + bindingFieldMethodName = bindingFieldMethodName + "Value"; + } + requestFieldGetterExprBuilder = + requestFieldGetterExprBuilder.setMethodName(bindingFieldMethodName); + if (i < descendantFields.size() - 1) { + requestFieldGetterExprBuilder = + MethodInvocationExpr.builder() + .setExprReferenceExpr(requestFieldGetterExprBuilder.build()); + } + } + return requestFieldGetterExprBuilder.build(); + } + + private static VariableExpr createRequestVarExpr(Method method) { + return VariableExpr.withVariable( + Variable.builder().setType(method.inputType()).setName("request").build()); + } } diff --git a/gapic-generator-java/src/main/java/com/google/api/generator/gapic/composer/common/BatchingDescriptorComposer.java b/gapic-generator-java/src/main/java/com/google/api/generator/gapic/composer/common/BatchingDescriptorComposer.java index 7db4a99714..dc96c7bc43 100644 --- a/gapic-generator-java/src/main/java/com/google/api/generator/gapic/composer/common/BatchingDescriptorComposer.java +++ b/gapic-generator-java/src/main/java/com/google/api/generator/gapic/composer/common/BatchingDescriptorComposer.java @@ -230,8 +230,7 @@ private static MethodDefinition createGetRequestBuilderMethod( .setStatements( Arrays.asList( ExprStatement.withExpr( - builderVarExpr - .toBuilder() + builderVarExpr.toBuilder() .setIsDecl(true) .setScope(ScopeNode.PRIVATE) .build()))) diff --git a/gapic-generator-java/src/main/java/com/google/api/generator/gapic/composer/common/RetrySettingsComposer.java b/gapic-generator-java/src/main/java/com/google/api/generator/gapic/composer/common/RetrySettingsComposer.java index e5e4ad4195..6690c57674 100644 --- a/gapic-generator-java/src/main/java/com/google/api/generator/gapic/composer/common/RetrySettingsComposer.java +++ b/gapic-generator-java/src/main/java/com/google/api/generator/gapic/composer/common/RetrySettingsComposer.java @@ -390,7 +390,7 @@ public static Expr createBatchingBuilderSettingsExpr( batchingSettingsBuilderExpr = MethodInvocationExpr.builder() .setExprReferenceExpr(batchingSettingsBuilderExpr) - .setMethodName("setDelayThreshold") + .setMethodName("setDelayThresholdDuration") .setArguments( createDurationOfMillisExpr(toValExpr(batchingSettings.delayThresholdMillis()))) .build(); @@ -511,7 +511,7 @@ private static List createRetrySettingsExprs( settingsBuilderExpr = MethodInvocationExpr.builder() .setExprReferenceExpr(settingsBuilderExpr) - .setMethodName("setInitialRetryDelay") + .setMethodName("setInitialRetryDelayDuration") .setArguments(createDurationOfMillisExpr(toValExpr(retryPolicy.getInitialBackoff()))) .build(); @@ -528,7 +528,7 @@ private static List createRetrySettingsExprs( settingsBuilderExpr = MethodInvocationExpr.builder() .setExprReferenceExpr(settingsBuilderExpr) - .setMethodName("setMaxRetryDelay") + .setMethodName("setMaxRetryDelayDuration") .setArguments(createDurationOfMillisExpr(toValExpr(retryPolicy.getMaxBackoff()))) .build(); } @@ -537,7 +537,7 @@ private static List createRetrySettingsExprs( settingsBuilderExpr = MethodInvocationExpr.builder() .setExprReferenceExpr(settingsBuilderExpr) - .setMethodName("setInitialRpcTimeout") + .setMethodName("setInitialRpcTimeoutDuration") .setArguments(createDurationOfMillisExpr(toValExpr(settings.timeout()))) .build(); } @@ -553,7 +553,8 @@ private static List createRetrySettingsExprs( .build(); if (!settings.kind().equals(GapicRetrySettings.Kind.NONE)) { - for (String setterMethodName : Arrays.asList("setMaxRpcTimeout", "setTotalTimeout")) { + for (String setterMethodName : + Arrays.asList("setMaxRpcTimeoutDuration", "setTotalTimeoutDuration")) { settingsBuilderExpr = MethodInvocationExpr.builder() .setExprReferenceExpr(settingsBuilderExpr) @@ -614,7 +615,7 @@ private static Expr createLroRetrySettingsExpr( lroRetrySettingsExpr = MethodInvocationExpr.builder() .setExprReferenceExpr(lroRetrySettingsExpr) - .setMethodName("setInitialRetryDelay") + .setMethodName("setInitialRetryDelayDuration") .setArguments(createDurationOfMillisExpr(toValExpr(initialPollDelayMillis))) .build(); @@ -628,7 +629,7 @@ private static Expr createLroRetrySettingsExpr( lroRetrySettingsExpr = MethodInvocationExpr.builder() .setExprReferenceExpr(lroRetrySettingsExpr) - .setMethodName("setMaxRetryDelay") + .setMethodName("setMaxRetryDelayDuration") .setArguments(createDurationOfMillisExpr(toValExpr(maxPollDelayMillis))) .build(); @@ -638,7 +639,7 @@ private static Expr createLroRetrySettingsExpr( lroRetrySettingsExpr = MethodInvocationExpr.builder() .setExprReferenceExpr(lroRetrySettingsExpr) - .setMethodName("setInitialRpcTimeout") + .setMethodName("setInitialRpcTimeoutDuration") .setArguments(zeroDurationExpr) .build(); @@ -654,14 +655,14 @@ private static Expr createLroRetrySettingsExpr( lroRetrySettingsExpr = MethodInvocationExpr.builder() .setExprReferenceExpr(lroRetrySettingsExpr) - .setMethodName("setMaxRpcTimeout") + .setMethodName("setMaxRpcTimeoutDuration") .setArguments(zeroDurationExpr) .build(); lroRetrySettingsExpr = MethodInvocationExpr.builder() .setExprReferenceExpr(lroRetrySettingsExpr) - .setMethodName("setTotalTimeout") + .setMethodName("setTotalTimeoutDuration") .setArguments(createDurationOfMillisExpr(toValExpr(totalPollTimeoutMillis))) .build(); @@ -714,7 +715,7 @@ private static TypeStore createStaticTypes() { List> concreteClazzes = Arrays.asList( BatchingSettings.class, - org.threeten.bp.Duration.class, + java.time.Duration.class, FlowControlSettings.class, FlowController.LimitExceededBehavior.class, ImmutableMap.class, diff --git a/gapic-generator-java/src/main/java/com/google/api/generator/gapic/composer/defaultvalue/DefaultValueComposer.java b/gapic-generator-java/src/main/java/com/google/api/generator/gapic/composer/defaultvalue/DefaultValueComposer.java index 54fc1dad57..3669e9f77e 100644 --- a/gapic-generator-java/src/main/java/com/google/api/generator/gapic/composer/defaultvalue/DefaultValueComposer.java +++ b/gapic-generator-java/src/main/java/com/google/api/generator/gapic/composer/defaultvalue/DefaultValueComposer.java @@ -30,6 +30,7 @@ import com.google.api.generator.engine.ast.VaporReference; import com.google.api.generator.engine.ast.Variable; import com.google.api.generator.engine.ast.VariableExpr; +import com.google.api.generator.engine.lexicon.Keyword; import com.google.api.generator.gapic.composer.resourcename.ResourceNameTokenizer; import com.google.api.generator.gapic.model.Field; import com.google.api.generator.gapic.model.HttpBindings; @@ -101,7 +102,8 @@ public static Expr createMethodArgValue( } if (methodArg.type().equals(methodArg.field().type())) { - return createValue(methodArg.field(), false, resourceNames, messageTypes, valuePatterns); + return createValue( + methodArg.field(), false, resourceNames, messageTypes, valuePatterns, bindings); } return createValue(Field.builder().setName(methodArg.name()).setType(methodArg.type()).build()); @@ -109,7 +111,7 @@ public static Expr createMethodArgValue( public static Expr createValue(Field field) { return createValue( - field, false, Collections.emptyMap(), Collections.emptyMap(), Collections.emptyMap()); + field, false, Collections.emptyMap(), Collections.emptyMap(), Collections.emptyMap(), null); } public static Expr createValue( @@ -117,7 +119,8 @@ public static Expr createValue( boolean useExplicitInitTypeInGenerics, Map resourceNames, Map messageTypes, - Map valuePatterns) { + Map valuePatterns, + HttpBindings bindings) { if (field.isRepeated()) { ConcreteReference.Builder refBuilder = ConcreteReference.builder().setClazz(field.isMap() ? HashMap.class : ArrayList.class); @@ -149,6 +152,7 @@ public static Expr createValue( Map nestedValuePatterns = new HashMap<>(); for (Map.Entry entry : valuePatterns.entrySet()) { String lowerCamelNestedFieldName = JavaStyle.toLowerCamelCase(nestedFieldName); + lowerCamelNestedFieldName = Keyword.unescapeKeyword(lowerCamelNestedFieldName); if (entry.getKey().startsWith(lowerCamelNestedFieldName + '.')) { nestedValuePatterns.put( entry.getKey().substring(lowerCamelNestedFieldName.length() + 1), entry.getValue()); @@ -159,7 +163,7 @@ public static Expr createValue( Message nestedMessage = messageTypes.get(field.type().reference().fullName()); if (nestedMessage != null) { return createSimpleMessageBuilderValue( - nestedMessage, resourceNames, messageTypes, nestedValuePatterns, null); + nestedMessage, resourceNames, messageTypes, nestedValuePatterns, bindings); } } @@ -272,7 +276,7 @@ static Expr createResourceHelperValue( if (!resname.isOnlyWildcard() && (bindings == null || resname.getMatchingPattern(bindings) != null)) { return createResourceHelperValue( - resname, false, unexaminedResnames, fieldOrMessageName, null); + resname, false, unexaminedResnames, fieldOrMessageName, bindings); } } @@ -383,7 +387,7 @@ public static Expr createSimpleMessageBuilderValue( field.resourceReference().isChildType(), resourceNames.values().stream().collect(Collectors.toList()), message.name(), - /* allowAnonResourceNameClass = */ false, + /* allowAnonResourceNameClass= */ false, bindings); defaultExpr = MethodInvocationExpr.builder() @@ -418,7 +422,8 @@ public static Expr createSimpleMessageBuilderValue( } if (defaultExpr == null) { - defaultExpr = createValue(field, true, resourceNames, messageTypes, valuePatterns); + defaultExpr = + createValue(field, true, resourceNames, messageTypes, valuePatterns, bindings); } } builderExpr = diff --git a/gapic-generator-java/src/main/java/com/google/api/generator/gapic/composer/grpc/GrpcServiceCallableFactoryClassComposer.java b/gapic-generator-java/src/main/java/com/google/api/generator/gapic/composer/grpc/GrpcServiceCallableFactoryClassComposer.java index e193bb7444..b7fc7c7de1 100644 --- a/gapic-generator-java/src/main/java/com/google/api/generator/gapic/composer/grpc/GrpcServiceCallableFactoryClassComposer.java +++ b/gapic-generator-java/src/main/java/com/google/api/generator/gapic/composer/grpc/GrpcServiceCallableFactoryClassComposer.java @@ -67,15 +67,15 @@ protected MethodDefinition createUnaryCallableMethod(Service service, TypeStore return createGenericCallableMethod( service, typeStore, - /*methodTemplateNames=*/ methodTemplateNames, - /*returnCallableKindName=*/ methodVariantName, - /*returnCallableTemplateNames=*/ methodTemplateNames, - /*methodVariantName=*/ methodVariantName, - /*grpcCallSettingsTemplateObjects=*/ methodTemplateNames.stream() + /* methodTemplateNames= */ methodTemplateNames, + /* returnCallableKindName= */ methodVariantName, + /* returnCallableTemplateNames= */ methodTemplateNames, + /* methodVariantName= */ methodVariantName, + /* grpcCallSettingsTemplateObjects= */ methodTemplateNames.stream() .map(n -> (Object) n) .collect(Collectors.toList()), - /*callSettingsVariantName=*/ methodVariantName, - /*callSettingsTemplateObjects=*/ methodTemplateNames.stream() + /* callSettingsVariantName= */ methodVariantName, + /* callSettingsTemplateObjects= */ methodTemplateNames.stream() .map(n -> (Object) n) .collect(Collectors.toList())); } @@ -91,15 +91,15 @@ protected MethodDefinition createPagedCallableMethod(Service service, TypeStore return createGenericCallableMethod( service, typeStore, - /*methodTemplateNames=*/ methodTemplateNames, - /*returnCallableKindName=*/ "Unary", - /*returnCallableTemplateNames=*/ Arrays.asList( + /* methodTemplateNames= */ methodTemplateNames, + /* returnCallableKindName= */ "Unary", + /* returnCallableTemplateNames= */ Arrays.asList( requestTemplateName, pagedResponseTemplateName), - /*methodVariantName=*/ methodVariantName, - /*grpcCallSettingsTemplateObjects=*/ Arrays.asList( + /* methodVariantName= */ methodVariantName, + /* grpcCallSettingsTemplateObjects= */ Arrays.asList( requestTemplateName, responseTemplateName), - /*callSettingsVariantName=*/ methodVariantName, - /*callSettingsTemplateObjects=*/ methodTemplateNames.stream() + /* callSettingsVariantName= */ methodVariantName, + /* callSettingsTemplateObjects= */ methodTemplateNames.stream() .map(n -> (Object) n) .collect(Collectors.toList())); } @@ -114,13 +114,13 @@ protected MethodDefinition createOperationCallableMethod(Service service, TypeSt return createGenericCallableMethod( service, typeStore, - /*methodTemplateNames=*/ methodTemplateNames, - /*returnCallableKindName=*/ methodVariantName, - /*returnCallableTemplateNames=*/ methodTemplateNames, - /*methodVariantName=*/ methodVariantName, - /*grpcCallSettingsTemplateObjects=*/ Arrays.asList(requestTemplateName, OPERATION_TYPE), - /*callSettingsVariantName=*/ methodVariantName, - /*callSettingsTemplateObjects=*/ methodTemplateNames.stream() + /* methodTemplateNames= */ methodTemplateNames, + /* returnCallableKindName= */ methodVariantName, + /* returnCallableTemplateNames= */ methodTemplateNames, + /* methodVariantName= */ methodVariantName, + /* grpcCallSettingsTemplateObjects= */ Arrays.asList(requestTemplateName, OPERATION_TYPE), + /* callSettingsVariantName= */ methodVariantName, + /* callSettingsTemplateObjects= */ methodTemplateNames.stream() .map(n -> (Object) n) .collect(Collectors.toList())); } @@ -133,15 +133,15 @@ private MethodDefinition createBidiStreamingCallableMethod(Service service, Type return createGenericCallableMethod( service, typeStore, - /*methodTemplateNames=*/ methodTemplateNames, - /*returnCallableKindName=*/ methodVariantName, - /*returnCallableTemplateNames=*/ methodTemplateNames, - /*methodVariantName=*/ methodVariantName, - /*grpcCallSettingsTemplateObjects=*/ methodTemplateNames.stream() + /* methodTemplateNames= */ methodTemplateNames, + /* returnCallableKindName= */ methodVariantName, + /* returnCallableTemplateNames= */ methodTemplateNames, + /* methodVariantName= */ methodVariantName, + /* grpcCallSettingsTemplateObjects= */ methodTemplateNames.stream() .map(n -> (Object) n) .collect(Collectors.toList()), - /*callSettingsVariantName=*/ "Streaming", - /*callSettingsTemplateObjects=*/ methodTemplateNames.stream() + /* callSettingsVariantName= */ "Streaming", + /* callSettingsTemplateObjects= */ methodTemplateNames.stream() .map(n -> (Object) n) .collect(Collectors.toList())); } @@ -155,15 +155,15 @@ private MethodDefinition createClientStreamingCallableMethod( return createGenericCallableMethod( service, typeStore, - /*methodTemplateNames=*/ methodTemplateNames, - /*returnCallableKindName=*/ methodVariantName, - /*returnCallableTemplateNames=*/ methodTemplateNames, - /*methodVariantName=*/ methodVariantName, - /*grpcCallSettingsTemplateObjects=*/ methodTemplateNames.stream() + /* methodTemplateNames= */ methodTemplateNames, + /* returnCallableKindName= */ methodVariantName, + /* returnCallableTemplateNames= */ methodTemplateNames, + /* methodVariantName= */ methodVariantName, + /* grpcCallSettingsTemplateObjects= */ methodTemplateNames.stream() .map(n -> (Object) n) .collect(Collectors.toList()), - /*callSettingsVariantName=*/ "Streaming", - /*callSettingsTemplateObjects=*/ methodTemplateNames.stream() + /* callSettingsVariantName= */ "Streaming", + /* callSettingsTemplateObjects= */ methodTemplateNames.stream() .map(n -> (Object) n) .collect(Collectors.toList())); } diff --git a/gapic-generator-java/src/main/java/com/google/api/generator/gapic/composer/grpc/GrpcServiceStubClassComposer.java b/gapic-generator-java/src/main/java/com/google/api/generator/gapic/composer/grpc/GrpcServiceStubClassComposer.java index d6eedb9987..455c507e0b 100644 --- a/gapic-generator-java/src/main/java/com/google/api/generator/gapic/composer/grpc/GrpcServiceStubClassComposer.java +++ b/gapic-generator-java/src/main/java/com/google/api/generator/gapic/composer/grpc/GrpcServiceStubClassComposer.java @@ -16,40 +16,27 @@ import com.google.api.gax.grpc.GrpcCallSettings; import com.google.api.gax.grpc.GrpcStubCallableFactory; -import com.google.api.gax.rpc.RequestParamsBuilder; import com.google.api.generator.engine.ast.AssignmentExpr; import com.google.api.generator.engine.ast.ConcreteReference; import com.google.api.generator.engine.ast.EnumRefExpr; import com.google.api.generator.engine.ast.Expr; import com.google.api.generator.engine.ast.ExprStatement; -import com.google.api.generator.engine.ast.IfStatement; -import com.google.api.generator.engine.ast.LambdaExpr; -import com.google.api.generator.engine.ast.LogicalOperationExpr; import com.google.api.generator.engine.ast.MethodInvocationExpr; -import com.google.api.generator.engine.ast.RelationalOperationExpr; +import com.google.api.generator.engine.ast.PrimitiveValue; import com.google.api.generator.engine.ast.ScopeNode; import com.google.api.generator.engine.ast.Statement; import com.google.api.generator.engine.ast.StringObjectValue; import com.google.api.generator.engine.ast.TypeNode; import com.google.api.generator.engine.ast.ValueExpr; -import com.google.api.generator.engine.ast.Variable; import com.google.api.generator.engine.ast.VariableExpr; import com.google.api.generator.gapic.composer.common.AbstractTransportServiceStubClassComposer; import com.google.api.generator.gapic.composer.store.TypeStore; -import com.google.api.generator.gapic.model.HttpBindings.HttpBinding; import com.google.api.generator.gapic.model.Message; import com.google.api.generator.gapic.model.Method; -import com.google.api.generator.gapic.model.RoutingHeaderRule.RoutingHeaderParam; import com.google.api.generator.gapic.model.Service; -import com.google.api.generator.gapic.utils.JavaStyle; -import com.google.api.pathtemplate.PathTemplate; -import com.google.common.base.Splitter; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; import com.google.longrunning.stub.GrpcOperationsStub; import io.grpc.MethodDescriptor; import io.grpc.protobuf.ProtoUtils; -import java.util.ArrayList; import java.util.Arrays; import java.util.HashSet; import java.util.List; @@ -154,6 +141,16 @@ protected Statement createMethodDescriptorVariableDecl( .apply("setResponseMarshaller", protoUtilsMarshallerFn.apply(methodInvocationArg)) .apply(methodDescriptorMaker); + // The sampledToLocalTracing flag is set to true for all gRPC MethodDescriptors in GAPICs + // This flag enables captures for specific method names to help provide more detailed metrics + methodDescriptorMaker = + methodMakerFn + .apply( + "setSampledToLocalTracing", + ValueExpr.withValue( + PrimitiveValue.builder().setType(TypeNode.BOOLEAN).setValue("true").build())) + .apply(methodDescriptorMaker); + methodDescriptorMaker = MethodInvocationExpr.builder() .setMethodName("build") @@ -164,8 +161,7 @@ protected Statement createMethodDescriptorVariableDecl( return ExprStatement.withExpr( AssignmentExpr.builder() .setVariableExpr( - methodDescriptorVarExpr - .toBuilder() + methodDescriptorVarExpr.toBuilder() .setIsDecl(true) .setScope(ScopeNode.PRIVATE) .setIsStatic(true) @@ -188,7 +184,7 @@ protected EnumRefExpr getMethodDescriptorMethodTypeExpr(Method protoMethod) { enumName = "BIDI_STREAMING"; break; case NONE: - // Fall through. + // Fall through. default: enumName = "UNARY"; } @@ -200,46 +196,6 @@ protected EnumRefExpr getMethodDescriptorMethodTypeExpr(Method protoMethod) { .build(); } - @Override - protected Expr createTransportSettingsInitExpr( - Method method, - VariableExpr transportSettingsVarExpr, - VariableExpr methodDescriptorVarExpr, - List classStatements) { - MethodInvocationExpr callSettingsBuilderExpr = - MethodInvocationExpr.builder() - .setStaticReferenceType(getTransportContext().transportCallSettingsType()) - .setGenerics(transportSettingsVarExpr.type().reference().generics()) - .setMethodName("newBuilder") - .build(); - callSettingsBuilderExpr = - MethodInvocationExpr.builder() - .setExprReferenceExpr(callSettingsBuilderExpr) - .setMethodName("setMethodDescriptor") - .setArguments(Arrays.asList(methodDescriptorVarExpr)) - .build(); - - if (method.shouldSetParamsExtractor()) { - callSettingsBuilderExpr = - MethodInvocationExpr.builder() - .setExprReferenceExpr(callSettingsBuilderExpr) - .setMethodName("setParamsExtractor") - .setArguments(createRequestParamsExtractorClassInstance(method, classStatements)) - .build(); - } - - callSettingsBuilderExpr = - MethodInvocationExpr.builder() - .setExprReferenceExpr(callSettingsBuilderExpr) - .setMethodName("build") - .setReturnType(transportSettingsVarExpr.type()) - .build(); - return AssignmentExpr.builder() - .setVariableExpr(transportSettingsVarExpr.toBuilder().setIsDecl(true).build()) - .setValueExpr(callSettingsBuilderExpr) - .build(); - } - @Override protected String getProtoRpcFullMethodName(Service protoService, Method protoMethod) { if (protoMethod.isMixin()) { @@ -255,244 +211,4 @@ protected String getProtoRpcFullMethodName(Service protoService, Method protoMet // long-term solution. return String.format("google.iam.v1.IAMPolicy/%s", protoMethod.name()); } - - private LambdaExpr createRequestParamsExtractorClassInstance( - Method method, List classStatements) { - List bodyStatements = new ArrayList<>(); - VariableExpr requestVarExpr = - VariableExpr.withVariable( - Variable.builder().setType(method.inputType()).setName("request").build()); - TypeNode returnType = - TypeNode.withReference( - ConcreteReference.builder() - .setClazz(Map.class) - .setGenerics(TypeNode.STRING.reference(), TypeNode.STRING.reference()) - .build()); - MethodInvocationExpr.Builder returnExpr = - MethodInvocationExpr.builder().setReturnType(returnType); - // If the google.api.routing annotation is present(even with empty routing parameters), - // the implicit routing headers specified in the google.api.http annotation should not be sent - if (method.routingHeaderRule() == null) { - createRequestParamsExtractorBodyForHttpBindings( - method, requestVarExpr, bodyStatements, returnExpr); - } else { - createRequestParamsExtractorBodyForRoutingHeaders( - method, requestVarExpr, classStatements, bodyStatements, returnExpr); - } - - // Overrides extract(). - // https://github.com/googleapis/gax-java/blob/8d45d186e36ae97b789a6f89d80ae5213a773b65/gax/src/main/java/com/google/api/gax/rpc/RequestParamsExtractor.java#L55 - return LambdaExpr.builder() - .setArguments(requestVarExpr.toBuilder().setIsDecl(true).build()) - .setBody(bodyStatements) - .setReturnExpr(returnExpr.build()) - .build(); - } - - private void createRequestParamsExtractorBodyForHttpBindings( - Method method, - VariableExpr requestVarExpr, - List bodyStatements, - MethodInvocationExpr.Builder returnExprBuilder) { - TypeNode paramsVarType = - TypeNode.withReference( - ConcreteReference.builder() - .setClazz(ImmutableMap.Builder.class) - .setGenerics(TypeNode.STRING.reference(), TypeNode.STRING.reference()) - .build()); - VariableExpr paramsVarExpr = - VariableExpr.withVariable( - Variable.builder().setName("params").setType(paramsVarType).build()); - - Expr paramsAssignExpr = - AssignmentExpr.builder() - .setVariableExpr(paramsVarExpr.toBuilder().setIsDecl(true).build()) - .setValueExpr( - MethodInvocationExpr.builder() - .setStaticReferenceType(FIXED_TYPESTORE.get("ImmutableMap")) - .setMethodName("builder") - .setReturnType(paramsVarType) - .build()) - .build(); - bodyStatements.add(ExprStatement.withExpr(paramsAssignExpr)); - - for (HttpBinding httpBindingFieldBinding : method.httpBindings().pathParameters()) { - MethodInvocationExpr requestBuilderExpr = - createRequestFieldGetterExpr(requestVarExpr, httpBindingFieldBinding.name()); - Expr valueOfExpr = - MethodInvocationExpr.builder() - .setStaticReferenceType(TypeNode.STRING) - .setMethodName("valueOf") - .setArguments(requestBuilderExpr) - .build(); - - Expr paramsPutExpr = - MethodInvocationExpr.builder() - .setExprReferenceExpr(paramsVarExpr) - .setMethodName("put") - .setArguments( - ValueExpr.withValue(StringObjectValue.withValue(httpBindingFieldBinding.name())), - valueOfExpr) - .build(); - bodyStatements.add(ExprStatement.withExpr(paramsPutExpr)); - } - - returnExprBuilder.setExprReferenceExpr(paramsVarExpr).setMethodName("build"); - } - - private void createRequestParamsExtractorBodyForRoutingHeaders( - Method method, - VariableExpr requestVarExpr, - List classStatements, - List bodyStatements, - MethodInvocationExpr.Builder returnExprBuilder) { - TypeNode routingHeadersBuilderType = - TypeNode.withReference( - ConcreteReference.builder().setClazz(RequestParamsBuilder.class).build()); - VariableExpr routingHeadersBuilderVarExpr = - VariableExpr.builder() - .setVariable( - Variable.builder().setName("builder").setType(routingHeadersBuilderType).build()) - .setIsDecl(true) - .build(); - MethodInvocationExpr routingHeaderBuilderInvokeExpr = - MethodInvocationExpr.builder() - .setStaticReferenceType(routingHeadersBuilderType) - .setMethodName("create") - .setReturnType(routingHeadersBuilderType) - .build(); - Expr routingHeadersBuilderInitExpr = - AssignmentExpr.builder() - .setVariableExpr(routingHeadersBuilderVarExpr) - .setValueExpr(routingHeaderBuilderInvokeExpr) - .build(); - bodyStatements.add(ExprStatement.withExpr(routingHeadersBuilderInitExpr)); - List routingHeaderParams = method.routingHeaderRule().routingHeaderParams(); - VariableExpr routingHeadersBuilderVarNonDeclExpr = - VariableExpr.builder() - .setVariable( - Variable.builder().setName("builder").setType(routingHeadersBuilderType).build()) - .build(); - for (int i = 0; i < routingHeaderParams.size(); i++) { - RoutingHeaderParam routingHeaderParam = routingHeaderParams.get(i); - MethodInvocationExpr requestFieldGetterExpr = - createRequestFieldGetterExpr(requestVarExpr, routingHeaderParam.fieldName()); - Expr routingHeaderKeyExpr = - ValueExpr.withValue(StringObjectValue.withValue(routingHeaderParam.key())); - String pathTemplateName = - String.format("%s_%s_PATH_TEMPLATE", JavaStyle.toUpperSnakeCase(method.name()), i); - TypeNode pathTemplateType = - TypeNode.withReference(ConcreteReference.withClazz(PathTemplate.class)); - Variable pathTemplateVar = - Variable.builder().setType(pathTemplateType).setName(pathTemplateName).build(); - Expr routingHeaderPatternExpr = VariableExpr.withVariable(pathTemplateVar); - Statement pathTemplateClassVar = - createPathTemplateClassStatement(routingHeaderParam, pathTemplateType, pathTemplateVar); - classStatements.add(pathTemplateClassVar); - MethodInvocationExpr addParamMethodExpr = - MethodInvocationExpr.builder() - .setExprReferenceExpr(routingHeadersBuilderVarNonDeclExpr) - .setMethodName("add") - .setArguments(requestFieldGetterExpr, routingHeaderKeyExpr, routingHeaderPatternExpr) - .build(); - - ExprStatement addParamStatement = ExprStatement.withExpr(addParamMethodExpr); - // No need to add null check if there is no nested fields - if (routingHeaderParam.getDescendantFieldNames().size() == 1) { - bodyStatements.add(addParamStatement); - } else { - IfStatement ifStatement = - IfStatement.builder() - .setConditionExpr( - fieldValuesNotNullConditionExpr( - requestVarExpr, routingHeaderParam.getDescendantFieldNames())) - .setBody(ImmutableList.of(addParamStatement)) - .build(); - bodyStatements.add(ifStatement); - } - } - returnExprBuilder - .setExprReferenceExpr(routingHeadersBuilderVarNonDeclExpr) - .setMethodName("build"); - } - - private Statement createPathTemplateClassStatement( - RoutingHeaderParam routingHeaderParam, TypeNode pathTemplateType, Variable pathTemplateVar) { - VariableExpr pathTemplateVarExpr = - VariableExpr.builder() - .setVariable(pathTemplateVar) - .setIsDecl(true) - .setIsStatic(true) - .setIsFinal(true) - .setScope(ScopeNode.PRIVATE) - .build(); - ValueExpr valueExpr = - ValueExpr.withValue(StringObjectValue.withValue(routingHeaderParam.pattern())); - Expr pathTemplateExpr = - AssignmentExpr.builder() - .setVariableExpr(pathTemplateVarExpr) - .setValueExpr( - MethodInvocationExpr.builder() - .setStaticReferenceType(pathTemplateType) - .setMethodName("create") - .setArguments(valueExpr) - .setReturnType(pathTemplateType) - .build()) - .build(); - return ExprStatement.withExpr(pathTemplateExpr); - } - - private Expr fieldValuesNotNullConditionExpr( - VariableExpr requestVarExpr, List fieldNames) { - MethodInvocationExpr.Builder requestFieldGetterExprBuilder = - MethodInvocationExpr.builder().setExprReferenceExpr(requestVarExpr); - Expr fieldValuesNotNullExpr = null; - for (int i = 0; i < fieldNames.size() - 1; i++) { - String currFieldName = fieldNames.get(i); - String bindingFieldMethodName = - String.format("get%s", JavaStyle.toUpperCamelCase(currFieldName)); - requestFieldGetterExprBuilder = - requestFieldGetterExprBuilder.setMethodName(bindingFieldMethodName); - // set return type of each method invocation to String just to pass the validation for - // RelationalOperationExpr that both side of relational operation needs to be a valid equality - // type - MethodInvocationExpr requestGetterExpr = - requestFieldGetterExprBuilder.setReturnType(TypeNode.STRING).build(); - Expr currentValueNotNullExpr = - RelationalOperationExpr.notEqualToWithExprs( - requestGetterExpr, ValueExpr.createNullExpr()); - if (fieldValuesNotNullExpr == null) { - fieldValuesNotNullExpr = currentValueNotNullExpr; - } else { - fieldValuesNotNullExpr = - LogicalOperationExpr.logicalAndWithExprs( - fieldValuesNotNullExpr, currentValueNotNullExpr); - } - requestFieldGetterExprBuilder = - MethodInvocationExpr.builder().setExprReferenceExpr(requestGetterExpr); - } - return fieldValuesNotNullExpr; - } - - private MethodInvocationExpr createRequestFieldGetterExpr( - VariableExpr requestVarExpr, String fieldName) { - MethodInvocationExpr.Builder requestFieldGetterExprBuilder = - MethodInvocationExpr.builder().setExprReferenceExpr(requestVarExpr); - List descendantFields = Splitter.on(".").splitToList(fieldName); - // Handle foo.bar cases by descending into the subfields. - // e.g. foo.bar -> request.getFoo().getBar() - for (int i = 0; i < descendantFields.size(); i++) { - String currFieldName = descendantFields.get(i); - String bindingFieldMethodName = - String.format("get%s", JavaStyle.toUpperCamelCase(currFieldName)); - requestFieldGetterExprBuilder = - requestFieldGetterExprBuilder.setMethodName(bindingFieldMethodName); - if (i < descendantFields.size() - 1) { - requestFieldGetterExprBuilder = - MethodInvocationExpr.builder() - .setExprReferenceExpr(requestFieldGetterExprBuilder.build()); - } - } - return requestFieldGetterExprBuilder.build(); - } } diff --git a/gapic-generator-java/src/main/java/com/google/api/generator/gapic/composer/grpc/MockServiceImplClassComposer.java b/gapic-generator-java/src/main/java/com/google/api/generator/gapic/composer/grpc/MockServiceImplClassComposer.java index e16cc875f4..d6573f026d 100644 --- a/gapic-generator-java/src/main/java/com/google/api/generator/gapic/composer/grpc/MockServiceImplClassComposer.java +++ b/gapic-generator-java/src/main/java/com/google/api/generator/gapic/composer/grpc/MockServiceImplClassComposer.java @@ -214,8 +214,7 @@ private static MethodDefinition createSetResponsesMethod(Service service) { Expr responseAssignExpr = AssignmentExpr.builder() .setVariableExpr( - responsesVarExpr - .toBuilder() + responsesVarExpr.toBuilder() .setExprReferenceExpr( ValueExpr.withValue(ThisObjectValue.withType(getThisClassType(service)))) .build()) diff --git a/gapic-generator-java/src/main/java/com/google/api/generator/gapic/composer/grpc/ServiceClientTestClassComposer.java b/gapic-generator-java/src/main/java/com/google/api/generator/gapic/composer/grpc/ServiceClientTestClassComposer.java index b43d4a4fc2..b6d1ff3bc3 100644 --- a/gapic-generator-java/src/main/java/com/google/api/generator/gapic/composer/grpc/ServiceClientTestClassComposer.java +++ b/gapic-generator-java/src/main/java/com/google/api/generator/gapic/composer/grpc/ServiceClientTestClassComposer.java @@ -162,7 +162,7 @@ protected MethodDefinition createStartStaticServerMethod( varInitExprs.add(serviceToVarInitExprFn.apply(service)); mockServiceVarExprs.add(serviceToVarExprFn.apply(service)); // Careful: Java 8 and 11 make different ordering choices if this set is not explicitly sorted. - // Context: https://github.com/googleapis/gapic-generator-java/pull/750 + // Context: https://github.com/googleapis/sdk-platform-java/pull/750 for (Service mixinService : context.mixinServices().stream() .sorted((s1, s2) -> s2.name().compareTo(s1.name())) diff --git a/gapic-generator-java/src/main/java/com/google/api/generator/gapic/composer/grpcrest/HttpJsonServiceClientTestClassComposer.java b/gapic-generator-java/src/main/java/com/google/api/generator/gapic/composer/grpcrest/HttpJsonServiceClientTestClassComposer.java index 00f76eb75e..9f9bbafc05 100644 --- a/gapic-generator-java/src/main/java/com/google/api/generator/gapic/composer/grpcrest/HttpJsonServiceClientTestClassComposer.java +++ b/gapic-generator-java/src/main/java/com/google/api/generator/gapic/composer/grpcrest/HttpJsonServiceClientTestClassComposer.java @@ -21,8 +21,6 @@ import com.google.api.generator.gapic.composer.store.TypeStore; import com.google.api.generator.gapic.model.GapicClass; import com.google.api.generator.gapic.model.GapicContext; -import com.google.api.generator.gapic.model.Method; -import com.google.api.generator.gapic.model.Method.Stream; import com.google.api.generator.gapic.model.Service; import java.util.Map; @@ -46,12 +44,6 @@ protected GapicClass generate(String className, GapicContext context, Service se service); } - protected boolean isSupportedMethod(Method method) { - return method.httpBindings() != null - && method.stream() != Stream.BIDI - && method.stream() != Stream.CLIENT; - } - @Override protected MethodDefinition createStartStaticServerMethod( Service service, diff --git a/gapic-generator-java/src/main/java/com/google/api/generator/gapic/composer/grpcrest/HttpJsonServiceStubClassComposer.java b/gapic-generator-java/src/main/java/com/google/api/generator/gapic/composer/grpcrest/HttpJsonServiceStubClassComposer.java index 7f99c81287..6d46c07792 100644 --- a/gapic-generator-java/src/main/java/com/google/api/generator/gapic/composer/grpcrest/HttpJsonServiceStubClassComposer.java +++ b/gapic-generator-java/src/main/java/com/google/api/generator/gapic/composer/grpcrest/HttpJsonServiceStubClassComposer.java @@ -35,6 +35,8 @@ public static HttpJsonServiceStubClassComposer instance() { @Override protected List createStaticCreatorMethods( Service service, TypeStore typeStore, String newBuilderMethod) { + // No need to check if REST Transport is enabled + // AbstractTransportServiceStubClassComposer won't generate a file if REST isn't enabled return super.createStaticCreatorMethods(service, typeStore, "newHttpJsonBuilder"); } } diff --git a/gapic-generator-java/src/main/java/com/google/api/generator/gapic/composer/grpcrest/ServiceClientClassComposer.java b/gapic-generator-java/src/main/java/com/google/api/generator/gapic/composer/grpcrest/ServiceClientClassComposer.java index 8933b7b4ed..3710f69492 100644 --- a/gapic-generator-java/src/main/java/com/google/api/generator/gapic/composer/grpcrest/ServiceClientClassComposer.java +++ b/gapic-generator-java/src/main/java/com/google/api/generator/gapic/composer/grpcrest/ServiceClientClassComposer.java @@ -26,6 +26,7 @@ import com.google.api.generator.gapic.model.ResourceName; import com.google.api.generator.gapic.model.Sample; import com.google.api.generator.gapic.model.Service; +import com.google.api.generator.gapic.model.Transport; import java.util.Arrays; import java.util.List; import java.util.Map; @@ -43,11 +44,16 @@ public static ServiceClientClassComposer instance() { @Override protected List createClassHeaderComments( + Map> grpcRpcsToJavaMethodNames, Service service, TypeStore typeStore, Map resourceNames, Map messageTypes, List samples) { + if (!service.hasAnyEnabledMethodsForTransport(Transport.REST)) { + return super.createClassHeaderComments( + grpcRpcsToJavaMethodNames, service, typeStore, resourceNames, messageTypes, samples); + } TypeNode clientType = typeStore.get(ClassNames.getServiceClientClassName(service)); TypeNode settingsType = typeStore.get(ClassNames.getServiceSettingsClassName(service)); Sample classMethodSampleCode = @@ -67,6 +73,7 @@ protected List createClassHeaderComments( classMethodSampleCode, credentialsSampleCode, endpointSampleCode, transportSampleCode)); return ServiceClientCommentComposer.createClassHeaderComments( + grpcRpcsToJavaMethodNames, service, SampleCodeWriter.writeInlineSample(classMethodSampleCode.body()), SampleCodeWriter.writeInlineSample(credentialsSampleCode.body()), diff --git a/gapic-generator-java/src/main/java/com/google/api/generator/gapic/composer/grpcrest/ServiceSettingsClassComposer.java b/gapic-generator-java/src/main/java/com/google/api/generator/gapic/composer/grpcrest/ServiceSettingsClassComposer.java index 3b48a45958..c5a735acad 100644 --- a/gapic-generator-java/src/main/java/com/google/api/generator/gapic/composer/grpcrest/ServiceSettingsClassComposer.java +++ b/gapic-generator-java/src/main/java/com/google/api/generator/gapic/composer/grpcrest/ServiceSettingsClassComposer.java @@ -21,6 +21,7 @@ import com.google.api.generator.gapic.composer.common.AbstractServiceSettingsClassComposer; import com.google.api.generator.gapic.composer.store.TypeStore; import com.google.api.generator.gapic.model.Service; +import com.google.api.generator.gapic.model.Transport; import com.google.common.collect.ImmutableList; import java.util.ArrayList; import java.util.Iterator; @@ -44,24 +45,20 @@ protected List createNestedBuilderCreatorMethods( String newBuilderMethodName, String createDefaultMethodName, List annotations) { - List methods = new ArrayList<>(); - AnnotationNode betaApiAnnotaiton = - AnnotationNode.builder().setType(FIXED_TYPESTORE.get("BetaApi")).build(); + List methods = new ArrayList<>(); methods.addAll( super.createNestedBuilderCreatorMethods( service, typeStore, "newBuilder", "createDefault", annotations)); - methods.addAll( - super.createNestedBuilderCreatorMethods( - service, - typeStore, - "newHttpJsonBuilder", - "createHttpJsonDefault", - ImmutableList.builder() - .addAll(annotations) - .add(betaApiAnnotaiton) - .build())); - + if (service.hasAnyEnabledMethodsForTransport(Transport.REST)) { + methods.addAll( + super.createNestedBuilderCreatorMethods( + service, + typeStore, + "newHttpJsonBuilder", + "createHttpJsonDefault", + ImmutableList.builder().addAll(annotations).build())); + } return methods; } @@ -75,9 +72,6 @@ protected List createNewBuilderMethods( CommentStatement comment) { List methods = new ArrayList<>(); - AnnotationNode betaApiAnnotaiton = - AnnotationNode.builder().setType(FIXED_TYPESTORE.get("BetaApi")).build(); - Iterator transportNames = getTransportContext().transportNames().iterator(); methods.addAll( @@ -89,19 +83,17 @@ protected List createNewBuilderMethods( annotations, new SettingsCommentComposer(transportNames.next()) .getNewTransportBuilderMethodComment())); - methods.addAll( - super.createNewBuilderMethods( - service, - typeStore, - "newHttpJsonBuilder", - "createHttpJsonDefault", - ImmutableList.builder() - .addAll(annotations) - .add(betaApiAnnotaiton) - .build(), - new SettingsCommentComposer(transportNames.next()) - .getNewTransportBuilderMethodComment())); - + if (service.hasAnyEnabledMethodsForTransport(Transport.REST)) { + methods.addAll( + super.createNewBuilderMethods( + service, + typeStore, + "newHttpJsonBuilder", + "createHttpJsonDefault", + ImmutableList.builder().addAll(annotations).build(), + new SettingsCommentComposer(transportNames.next()) + .getNewTransportBuilderMethodComment())); + } return methods; } } diff --git a/gapic-generator-java/src/main/java/com/google/api/generator/gapic/composer/grpcrest/ServiceStubSettingsClassComposer.java b/gapic-generator-java/src/main/java/com/google/api/generator/gapic/composer/grpcrest/ServiceStubSettingsClassComposer.java index 84adf3598a..b79c74ed99 100644 --- a/gapic-generator-java/src/main/java/com/google/api/generator/gapic/composer/grpcrest/ServiceStubSettingsClassComposer.java +++ b/gapic-generator-java/src/main/java/com/google/api/generator/gapic/composer/grpcrest/ServiceStubSettingsClassComposer.java @@ -34,7 +34,7 @@ import com.google.api.generator.gapic.composer.store.TypeStore; import com.google.api.generator.gapic.composer.utils.ClassNames; import com.google.api.generator.gapic.model.Service; -import com.google.common.collect.ImmutableList; +import com.google.api.generator.gapic.model.Transport; import java.util.ArrayList; import java.util.Iterator; import java.util.List; @@ -118,21 +118,26 @@ protected List createApiClientHeaderProviderBuilderMethods( TypeNode returnType = TypeNode.withReference(ConcreteReference.withClazz(ApiClientHeaderProvider.Builder.class)); - return ImmutableList.of( + List methodDefinitions = new ArrayList<>(); + methodDefinitions.add( createApiClientHeaderProviderBuilderMethod( service, typeStore, "defaultGrpcApiClientHeaderProviderBuilder", TypeNode.withReference(ConcreteReference.withClazz(GaxGrpcProperties.class)), "getGrpcTokenName", - "getGrpcVersion"), - createApiClientHeaderProviderBuilderMethod( - service, - typeStore, - "defaultHttpJsonApiClientHeaderProviderBuilder", - TypeNode.withReference(ConcreteReference.withClazz(GaxHttpJsonProperties.class)), - "getHttpJsonTokenName", - "getHttpJsonVersion"), + "getGrpcVersion")); + if (service.hasAnyEnabledMethodsForTransport(Transport.REST)) { + methodDefinitions.add( + createApiClientHeaderProviderBuilderMethod( + service, + typeStore, + "defaultHttpJsonApiClientHeaderProviderBuilder", + TypeNode.withReference(ConcreteReference.withClazz(GaxHttpJsonProperties.class)), + "getHttpJsonTokenName", + "getHttpJsonVersion")); + } + methodDefinitions.add( MethodDefinition.builder() .setScope(ScopeNode.PUBLIC) .setIsStatic(true) @@ -146,6 +151,7 @@ protected List createApiClientHeaderProviderBuilderMethods( .setReturnType(returnType) .build()) .build()); + return methodDefinitions; } @Override @@ -169,20 +175,26 @@ public MethodDefinition createDefaultTransportChannelProviderMethod() { } @Override - protected List createNestedClassCreateDefaultMethods(TypeStore typeStore) { - return ImmutableList.of( + protected List createNestedClassCreateDefaultMethods( + Service service, TypeStore typeStore) { + List methodDefinitions = new ArrayList<>(); + methodDefinitions.add( createNestedClassCreateDefaultMethod( typeStore, "createDefault", "defaultTransportChannelProvider", null, - "defaultApiClientHeaderProviderBuilder"), - createNestedClassCreateDefaultMethod( - typeStore, - "createHttpJsonDefault", - null, - "defaultHttpJsonTransportProviderBuilder", - "defaultHttpJsonApiClientHeaderProviderBuilder")); + "defaultApiClientHeaderProviderBuilder")); + if (service.hasAnyEnabledMethodsForTransport(Transport.REST)) { + methodDefinitions.add( + createNestedClassCreateDefaultMethod( + typeStore, + "createHttpJsonDefault", + null, + "defaultHttpJsonTransportProviderBuilder", + "defaultHttpJsonApiClientHeaderProviderBuilder")); + } + return methodDefinitions; } @Override @@ -202,14 +214,16 @@ protected List createNewBuilderMethods( "createDefault", new SettingsCommentComposer(transportNames.next()) .getNewTransportBuilderMethodComment())); - methods.addAll( - super.createNewBuilderMethods( - service, - typeStore, - "newHttpJsonBuilder", - "createHttpJsonDefault", - new SettingsCommentComposer(transportNames.next()) - .getNewTransportBuilderMethodComment())); + if (service.hasAnyEnabledMethodsForTransport(Transport.REST)) { + methods.addAll( + super.createNewBuilderMethods( + service, + typeStore, + "newHttpJsonBuilder", + "createHttpJsonDefault", + new SettingsCommentComposer(transportNames.next()) + .getNewTransportBuilderMethodComment())); + } return methods; } } diff --git a/gapic-generator-java/src/main/java/com/google/api/generator/gapic/composer/resourcename/ResourceNameHelperClassComposer.java b/gapic-generator-java/src/main/java/com/google/api/generator/gapic/composer/resourcename/ResourceNameHelperClassComposer.java index f8c961ccab..775a88c01b 100644 --- a/gapic-generator-java/src/main/java/com/google/api/generator/gapic/composer/resourcename/ResourceNameHelperClassComposer.java +++ b/gapic-generator-java/src/main/java/com/google/api/generator/gapic/composer/resourcename/ResourceNameHelperClassComposer.java @@ -14,7 +14,6 @@ package com.google.api.generator.gapic.composer.resourcename; -import com.google.api.core.BetaApi; import com.google.api.generator.engine.ast.AnnotationNode; import com.google.api.generator.engine.ast.AssignmentExpr; import com.google.api.generator.engine.ast.AssignmentOperationExpr; @@ -60,7 +59,6 @@ import com.google.common.collect.ImmutableMap; import java.util.ArrayList; import java.util.Arrays; -import java.util.Collections; import java.util.HashMap; import java.util.Iterator; import java.util.LinkedHashSet; @@ -131,7 +129,7 @@ public GapicClass generate(ResourceName resourceName, GapicContext context) { .setAnnotations(createClassAnnotations()) .setScope(ScopeNode.PUBLIC) .setName(className) - .setImplementsTypes(createImplementsTypes()) + .setImplementsTypes(Arrays.asList(createImplementsTypes(className))) .setStatements( createClassStatements( templateFinalVarExprs, @@ -160,8 +158,26 @@ private static List createClassAnnotations() { .build()); } - private static List createImplementsTypes() { - return Arrays.asList(FIXED_TYPESTORE.get("ResourceName")); + /** + * Returns a singleton list with {@code ResourceName} as its only member. Checks for collisions + * + * @param implementingClassName class that is implementing the resulting list + */ + private static TypeNode createImplementsTypes(String implementingClassName) { + // the original resource name reference has useFullName == false + TypeNode originalResourceName = FIXED_TYPESTORE.get("ResourceName"); + if (implementingClassName.equals(originalResourceName.reference().name())) { + // we create a copy with useFullName == true + return TypeNode.withReference( + ConcreteReference.builder() + .setUseFullName(true) + .setClazz(com.google.api.resourcenames.ResourceName.class) + .setGenerics(originalResourceName.reference().generics()) + .setIsStaticImport(originalResourceName.reference().isStaticImport()) + .setWildcardUpperBound(originalResourceName.reference().wildcardUpperBound()) + .build()); + } + return originalResourceName; } private static List createTemplateClassMembers( @@ -214,9 +230,7 @@ private static List createClassStatements( // "projects/{project}/locations/{location}/autoscalingPolicies/{autoscaling_policy}"); for (int i = 0; i < patterns.size(); i++) { VariableExpr varExpr = - templateFinalVarExprs - .get(i) - .toBuilder() + templateFinalVarExprs.get(i).toBuilder() .setIsDecl(true) .setScope(ScopeNode.PRIVATE) .setIsStatic(true) @@ -240,9 +254,7 @@ private static List createClassStatements( } memberVars.add( - FIXED_CLASS_VARS - .get("fieldValuesMap") - .toBuilder() + FIXED_CLASS_VARS.get("fieldValuesMap").toBuilder() .setIsDecl(true) .setScope(ScopeNode.PRIVATE) .setIsVolatile(true) @@ -485,13 +497,6 @@ private static List createBuilderCreatorMethods( ResourceName resourceName, List> tokenHierarchies, TypeStore typeStore) { List javaMethods = new ArrayList<>(); String newMethodNameFormat = "new%s"; - AnnotationNode betaAnnotation = - AnnotationNode.builder() - .setType(FIXED_TYPESTORE.get("BetaApi")) - .setDescription( - "The per-pattern Builders are not stable yet and may be changed in the future.") - .build(); - List annotations = Arrays.asList(betaAnnotation); // Create the newBuilder and variation methods here. // Variation example: newProjectLocationAutoscalingPolicyBuilder(). @@ -515,17 +520,13 @@ private static List createBuilderCreatorMethods( String variantName = getBuilderTypeName(tokenHierarchies, i); javaMethods.add( - methodDefStarterFn - .apply(String.format(newMethodNameFormat, variantName)) - .setAnnotations(i == 0 ? Collections.emptyList() : annotations) - .build()); + methodDefStarterFn.apply(String.format(newMethodNameFormat, variantName)).build()); if (i == 0 && tokenHierarchies.size() > 1) { // Create another builder creator method, but with the per-variant name. javaMethods.add( methodDefStarterFn .apply( String.format(newMethodNameFormat, getBuilderTypeName(tokenHierarchies.get(i)))) - .setAnnotations(annotations) .build()); } } @@ -555,7 +556,11 @@ private static List createOfCreatorMethods( List> tokenHierarchies, TypeStore typeStore) { return createOfOrFormatMethodHelper( - resourceName, patternTokenVarExprs, tokenHierarchies, typeStore, /*isFormatMethod=*/ false); + resourceName, + patternTokenVarExprs, + tokenHierarchies, + typeStore, + /* isFormatMethod= */ false); } private static List createFormatCreatorMethods( @@ -564,7 +569,11 @@ private static List createFormatCreatorMethods( List> tokenHierarchies, TypeStore typeStore) { return createOfOrFormatMethodHelper( - resourceName, patternTokenVarExprs, tokenHierarchies, typeStore, /*isFormatMethod=*/ true); + resourceName, + patternTokenVarExprs, + tokenHierarchies, + typeStore, + /* isFormatMethod= */ true); } private static List createOfOrFormatMethodHelper( @@ -579,15 +588,6 @@ private static List createOfOrFormatMethodHelper( String setMethodNameFormat = "set%s"; String buildMethodName = "build"; String toStringMethodName = "toString"; - AnnotationNode betaAnnotation = - AnnotationNode.builder() - .setType(FIXED_TYPESTORE.get("BetaApi")) - .setDescription( - String.format( - "The static %s methods are not stable yet and may be changed in the future.", - isFormatMethod ? "format" : "create")) - .build(); - List annotations = Arrays.asList(betaAnnotation); TypeNode thisClassType = typeStore.get(getThisClassName(resourceName)); TypeNode returnType = isFormatMethod ? TypeNode.STRING : thisClassType; @@ -606,7 +606,6 @@ private static List createOfOrFormatMethodHelper( MethodDefinition.builder() .setScope(ScopeNode.PUBLIC) .setIsStatic(true) - .setAnnotations(annotations) .setReturnType(returnType) .setName( String.format(methodNameFormat, concatToUpperCamelCaseName(tokens) + "Name")) @@ -664,7 +663,6 @@ private static List createOfOrFormatMethodHelper( MethodDefinition.builder() .setScope(ScopeNode.PUBLIC) .setIsStatic(true) - .setAnnotations(i == 0 ? Collections.emptyList() : annotations) .setReturnType(returnType) .setName( String.format( @@ -678,7 +676,6 @@ private static List createOfOrFormatMethodHelper( MethodDefinition.builder() .setScope(ScopeNode.PUBLIC) .setIsStatic(true) - .setAnnotations(annotations) .setReturnType(returnType) .setName( String.format( @@ -1331,8 +1328,8 @@ private static MethodDefinition createEqualsMethod( RelationalOperationExpr.equalToWithExprs( getClassMethodInvocationExpr, getClassMethodInvocationExpr.toBuilder().setExprReferenceExpr(argVarExpr).build()); - LogicalOperationExpr orLogicalExpr = - LogicalOperationExpr.logicalOrWithExprs(oNotEqualsNullExpr, getClassEqualsExpr); + LogicalOperationExpr andLogicalExpr = + LogicalOperationExpr.logicalAndWithExprs(oNotEqualsNullExpr, getClassEqualsExpr); // Create second if statement's body assignment expression. Variable thatVariable = Variable.builder().setName("that").setType(thisClassType).build(); @@ -1381,11 +1378,11 @@ private static MethodDefinition createEqualsMethod( .setConditionExpr(oEqualsThisExpr) .setBody(Arrays.asList(ExprStatement.withExpr(returnTrueExpr))) .build(); - // Code: if (o != null || getClass() == o.getClass()) { FoobarName that = ((FoobarName) o); + // Code: if (o != null && getClass() == o.getClass()) { FoobarName that = ((FoobarName) o); // return ..} IfStatement secondIfStatement = IfStatement.builder() - .setConditionExpr(orLogicalExpr) + .setConditionExpr(andLogicalExpr) .setBody( Arrays.asList( ExprStatement.withExpr(thatAssignmentExpr), @@ -1622,9 +1619,7 @@ private static ClassDefinition createNestedBuilderClass( .setStaticReferenceType(FIXED_TYPESTORE.get("Objects")) .setMethodName("equals") .setArguments( - FIXED_CLASS_VARS - .get("pathTemplate") - .toBuilder() + FIXED_CLASS_VARS.get("pathTemplate").toBuilder() .setExprReferenceExpr(outerClassVarExpr) .build(), templateFinalVarExpr) @@ -1651,8 +1646,7 @@ private static ClassDefinition createNestedBuilderClass( AssignmentExpr.builder() .setVariableExpr(currClassTokenVarExpr) .setValueExpr( - currClassTokenVarExpr - .toBuilder() + currClassTokenVarExpr.toBuilder() .setExprReferenceExpr(outerClassVarExpr) .build()) .build()); @@ -1683,21 +1677,12 @@ private static ClassDefinition createNestedBuilderClass( nestedClassMethods.add(buildMethod); // Return the class. - AnnotationNode betaAnnotation = - AnnotationNode.builder() - .setType(FIXED_TYPESTORE.get("BetaApi")) - .setDescription( - "The per-pattern Builders are not stable yet and may be changed in the future.") - .build(); - List classAnnotations = - isDefaultClass ? Collections.emptyList() : Arrays.asList(betaAnnotation); return ClassDefinition.builder() .setHeaderCommentStatements( CommentStatement.withComment( JavaDocComment.withComment( String.format(BUILDER_CLASS_HEADER_PATTERN, resourceNamePattern)))) - .setAnnotations(classAnnotations) .setIsNested(true) .setScope(ScopeNode.PUBLIC) .setIsStatic(true) @@ -1711,7 +1696,6 @@ private static TypeStore createStaticTypes() { List> concreteClazzes = Arrays.asList( ArrayList.class, - BetaApi.class, Generated.class, ImmutableMap.class, List.class, diff --git a/gapic-generator-java/src/main/java/com/google/api/generator/gapic/composer/rest/HttpJsonServiceCallableFactoryClassComposer.java b/gapic-generator-java/src/main/java/com/google/api/generator/gapic/composer/rest/HttpJsonServiceCallableFactoryClassComposer.java index 9a973a2b76..00a4185df7 100644 --- a/gapic-generator-java/src/main/java/com/google/api/generator/gapic/composer/rest/HttpJsonServiceCallableFactoryClassComposer.java +++ b/gapic-generator-java/src/main/java/com/google/api/generator/gapic/composer/rest/HttpJsonServiceCallableFactoryClassComposer.java @@ -18,7 +18,6 @@ import com.google.api.gax.httpjson.HttpJsonOperationSnapshotCallable; import com.google.api.gax.rpc.OperationCallable; import com.google.api.gax.rpc.UnaryCallable; -import com.google.api.generator.engine.ast.AnnotationNode; import com.google.api.generator.engine.ast.AssignmentExpr; import com.google.api.generator.engine.ast.ConcreteReference; import com.google.api.generator.engine.ast.ExprStatement; @@ -36,6 +35,7 @@ import com.google.longrunning.Operation; import java.util.ArrayList; import java.util.Arrays; +import java.util.Collections; import java.util.List; import java.util.stream.Collectors; @@ -55,20 +55,6 @@ public static HttpJsonServiceCallableFactoryClassComposer instance() { return INSTANCE; } - @Override - protected List createClassAnnotations(Service service, TypeStore typeStore) { - List annotations = super.createClassAnnotations(service, typeStore); - // Always add @BetaApi annotation to the generated CallableFactory for now. It is a public class - // for technical reasons, end users are not expected to interact with it, but it may change - // when we add LRO support, that is why making it @BetaApi for now. - // - // Remove the @BetaApi annotation once the LRO feature is fully implemented and stabilized. - if (annotations.stream().noneMatch(a -> a.type().equals(typeStore.get("BetaApi")))) { - annotations.add(AnnotationNode.withType(typeStore.get("BetaApi"))); - } - return annotations; - } - @Override protected List createClassImplements(Service service, TypeStore typeStore) { TypeNode operationsStubType = getOperationsStubType(service); @@ -104,16 +90,6 @@ protected MethodDefinition createOperationCallableMethod(Service service, TypeSt List methodTemplateNames = Arrays.asList(requestTemplateName, responseTemplateName, "MetadataT"); - // Always add @BetaApi annotation to the generated createOperationCallable() method for now, - // until LRO is fully implemented. - // - // Remove the @BetaApi annotation once the LRO feature is fully implemented and stabilized. - AnnotationNode betaAnnotation = - AnnotationNode.withTypeAndDescription( - typeStore.get("BetaApi"), - "The surface for long-running operations is not stable yet and may change in the" - + " future."); - // Generate generic method without the body TypeNode operationType = service.operationType(); if (operationType == null) { @@ -123,17 +99,17 @@ protected MethodDefinition createOperationCallableMethod(Service service, TypeSt createGenericCallableMethod( service, typeStore, - /*methodTemplateNames=*/ methodTemplateNames, - /*returnCallableKindName=*/ methodVariantName, - /*returnCallableTemplateNames=*/ methodTemplateNames, - /*methodVariantName=*/ methodVariantName, - /*httpJsonCallSettingsTemplateObjects=*/ Arrays.asList( + /* methodTemplateNames= */ methodTemplateNames, + /* returnCallableKindName= */ methodVariantName, + /* returnCallableTemplateNames= */ methodTemplateNames, + /* methodVariantName= */ methodVariantName, + /* httpJsonCallSettingsTemplateObjects= */ Arrays.asList( requestTemplateName, operationType), - /*callSettingsVariantName=*/ methodVariantName, - /*callSettingsTemplateObjects=*/ methodTemplateNames.stream() + /* callSettingsVariantName= */ methodVariantName, + /* callSettingsTemplateObjects= */ methodTemplateNames.stream() .map(n -> (Object) n) .collect(Collectors.toList()), - Arrays.asList(betaAnnotation)); + Collections.emptyList()); List createOperationCallableBody = new ArrayList<>(); List arguments = new ArrayList<>(method.arguments()); @@ -247,8 +223,7 @@ protected MethodDefinition createOperationCallableMethod(Service service, TypeSt .build(); // Add body and return statement to method - return method - .toBuilder() + return method.toBuilder() .setBody(createOperationCallableBody) .setReturnExpr(createOperationCallable) .build(); diff --git a/gapic-generator-java/src/main/java/com/google/api/generator/gapic/composer/rest/HttpJsonServiceStubClassComposer.java b/gapic-generator-java/src/main/java/com/google/api/generator/gapic/composer/rest/HttpJsonServiceStubClassComposer.java index 67e003f50f..45ed87eeb0 100644 --- a/gapic-generator-java/src/main/java/com/google/api/generator/gapic/composer/rest/HttpJsonServiceStubClassComposer.java +++ b/gapic-generator-java/src/main/java/com/google/api/generator/gapic/composer/rest/HttpJsonServiceStubClassComposer.java @@ -14,6 +14,7 @@ package com.google.api.generator.gapic.composer.rest; +import com.google.api.HttpRule; import com.google.api.core.InternalApi; import com.google.api.gax.httpjson.ApiMethodDescriptor; import com.google.api.gax.httpjson.ApiMethodDescriptor.MethodType; @@ -45,6 +46,7 @@ import com.google.api.generator.engine.ast.Statement; import com.google.api.generator.engine.ast.StringObjectValue; import com.google.api.generator.engine.ast.ThisObjectValue; +import com.google.api.generator.engine.ast.ThrowExpr; import com.google.api.generator.engine.ast.TypeNode; import com.google.api.generator.engine.ast.ValueExpr; import com.google.api.generator.engine.ast.VaporReference; @@ -52,16 +54,17 @@ import com.google.api.generator.engine.ast.VariableExpr; import com.google.api.generator.gapic.composer.common.AbstractTransportServiceStubClassComposer; import com.google.api.generator.gapic.composer.store.TypeStore; +import com.google.api.generator.gapic.model.GapicContext; import com.google.api.generator.gapic.model.HttpBindings.HttpBinding; import com.google.api.generator.gapic.model.Message; import com.google.api.generator.gapic.model.Method; -import com.google.api.generator.gapic.model.Method.Stream; import com.google.api.generator.gapic.model.OperationResponse; import com.google.api.generator.gapic.model.Service; import com.google.api.generator.gapic.utils.JavaStyle; import com.google.common.annotations.VisibleForTesting; import com.google.common.collect.BiMap; import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; import com.google.protobuf.TypeRegistry; import java.util.ArrayList; import java.util.Arrays; @@ -72,10 +75,10 @@ import java.util.Set; import java.util.function.BiFunction; import java.util.function.Function; +import java.util.function.Predicate; import java.util.stream.Collectors; public class HttpJsonServiceStubClassComposer extends AbstractTransportServiceStubClassComposer { - private static final HttpJsonServiceStubClassComposer INSTANCE = new HttpJsonServiceStubClassComposer(); @@ -88,6 +91,7 @@ public class HttpJsonServiceStubClassComposer extends AbstractTransportServiceSt .setType(FIXED_REST_TYPESTORE.get(TypeRegistry.class.getSimpleName())) .build()) .build(); + private static final String LRO_NAME_PREFIX = "google.longrunning.Operations"; protected HttpJsonServiceStubClassComposer() { super(RestContext.instance()); @@ -108,19 +112,15 @@ private static TypeStore createStaticTypes() { HttpJsonCallSettings.class, HttpJsonOperationSnapshot.class, HttpJsonStubCallableFactory.class, + HttpRule.class, Map.class, + ImmutableMap.class, ProtoMessageRequestFormatter.class, ProtoMessageResponseParser.class, ProtoRestSerializer.class, TypeRegistry.class)); } - protected boolean isSupportedMethod(Method method) { - return method.httpBindings() != null - && method.stream() != Stream.BIDI - && method.stream() != Stream.CLIENT; - } - @Override protected boolean generateOperationsStubLogic(Service service) { return service.hasLroMethods(); @@ -190,8 +190,7 @@ protected Statement createMethodDescriptorVariableDecl( return ExprStatement.withExpr( AssignmentExpr.builder() .setVariableExpr( - methodDescriptorVarExpr - .toBuilder() + methodDescriptorVarExpr.toBuilder() .setIsDecl(true) .setScope(ScopeNode.PRIVATE) .setIsStatic(true) @@ -210,58 +209,6 @@ protected List createOperationsStubGetterMethod( return super.createOperationsStubGetterMethod(service, operationsStubVarExpr); } - @Override - protected Expr createTransportSettingsInitExpr( - Method method, - VariableExpr transportSettingsVarExpr, - VariableExpr methodDescriptorVarExpr, - List classStatements) { - MethodInvocationExpr callSettingsBuilderExpr = - MethodInvocationExpr.builder() - .setStaticReferenceType( - FIXED_REST_TYPESTORE.get(HttpJsonCallSettings.class.getSimpleName())) - .setGenerics(transportSettingsVarExpr.type().reference().generics()) - .setMethodName("newBuilder") - .build(); - callSettingsBuilderExpr = - MethodInvocationExpr.builder() - .setExprReferenceExpr(callSettingsBuilderExpr) - .setMethodName("setMethodDescriptor") - .setArguments(Arrays.asList(methodDescriptorVarExpr)) - .build(); - - callSettingsBuilderExpr = - MethodInvocationExpr.builder() - .setExprReferenceExpr(callSettingsBuilderExpr) - .setMethodName("setTypeRegistry") - .setArguments(Arrays.asList(TYPE_REGISTRY_VAR_EXPR)) - .build(); - - callSettingsBuilderExpr = - MethodInvocationExpr.builder() - .setExprReferenceExpr(callSettingsBuilderExpr) - .setMethodName("build") - .setReturnType(transportSettingsVarExpr.type()) - .build(); - return AssignmentExpr.builder() - .setVariableExpr(transportSettingsVarExpr.toBuilder().setIsDecl(true).build()) - .setValueExpr(callSettingsBuilderExpr) - .build(); - } - - @Override - protected List createClassAnnotations(Service service) { - List annotations = super.createClassAnnotations(service); - - TypeNode betaApiType = FIXED_TYPESTORE.get("BetaApi"); - - if (annotations.stream().noneMatch(a -> betaApiType.equals(a.type()))) { - annotations.add(AnnotationNode.builder().setType(betaApiType).build()); - } - - return annotations; - } - @Override protected List createGetMethodDescriptorsMethod( Service service, @@ -1058,9 +1005,9 @@ private List getMethodTypeExpr(Method protoMethod) { methodType = MethodType.SERVER_STREAMING; break; case CLIENT: - // Not feasible to suppor in REST + // Not feasible to suppor in REST case BIDI: - // Not feasible to suppor in REST + // Not feasible to suppor in REST default: throw new UnsupportedOperationException( String.format( @@ -1080,6 +1027,7 @@ private List getMethodTypeExpr(Method protoMethod) { @Override protected List createOperationsStubInitExpr( + GapicContext context, Service service, Expr thisExpr, VariableExpr operationsStubClassVarExpr, @@ -1094,6 +1042,47 @@ protected List createOperationsStubInitExpr( arguments.add(TYPE_REGISTRY_VAR_EXPR); } + // If the Service contains custom HttpRules for Operations, we pass a map of the custom rules to + // the Operations Client + Map operationCustomHttpRules = parseOperationsCustomHttpRules(context); + if (operationCustomHttpRules.size() > 0) { + Expr operationCustomHttpBindingsBuilderExpr = + MethodInvocationExpr.builder() + .setStaticReferenceType(FIXED_REST_TYPESTORE.get(ImmutableMap.class.getSimpleName())) + .setMethodName("builder") + .setGenerics( + Arrays.asList( + TypeNode.STRING.reference(), + FIXED_REST_TYPESTORE.get(HttpRule.class.getSimpleName()).reference())) + .build(); + + // Sorting is done to ensure consistent ordering of the entries in the Custom HttpRule Map + for (String selector : + operationCustomHttpRules.keySet().stream().sorted().collect(Collectors.toList())) { + HttpRule httpRule = operationCustomHttpRules.get(selector); + Expr httpRuleBuilderExpr = createHttpRuleExpr(httpRule, true); + + operationCustomHttpBindingsBuilderExpr = + MethodInvocationExpr.builder() + .setExprReferenceExpr(operationCustomHttpBindingsBuilderExpr) + .setMethodName("put") + .setArguments( + Arrays.asList( + ValueExpr.withValue(StringObjectValue.withValue(selector)), + httpRuleBuilderExpr)) + .build(); + } + + operationCustomHttpBindingsBuilderExpr = + MethodInvocationExpr.builder() + .setExprReferenceExpr(operationCustomHttpBindingsBuilderExpr) + .setMethodName("build") + .setReturnType(FIXED_REST_TYPESTORE.get(ImmutableMap.class.getSimpleName())) + .build(); + + arguments.add(operationCustomHttpBindingsBuilderExpr); + } + return Collections.singletonList( AssignmentExpr.builder() .setVariableExpr( @@ -1108,6 +1097,73 @@ protected List createOperationsStubInitExpr( .build()); } + /* Build an Expr that creates an HttpRule. Creates a builder and adds the http verb, custom path, and any additional bindings. `additional_bindings` can only be nested one layer deep, so we only check once */ + private Expr createHttpRuleExpr(HttpRule httpRule, boolean checkAdditionalBindings) { + Expr httpRuleBuilderExpr = + MethodInvocationExpr.builder() + .setStaticReferenceType(FIXED_REST_TYPESTORE.get(HttpRule.class.getSimpleName())) + .setMethodName("newBuilder") + .build(); + + httpRuleBuilderExpr = + MethodInvocationExpr.builder() + .setExprReferenceExpr(httpRuleBuilderExpr) + // toLowerCase as the PatternCase result is all uppercase + .setMethodName(setMethodFormat(httpRule.getPatternCase().toString().toLowerCase())) + .setArguments( + ValueExpr.withValue( + StringObjectValue.withValue(getOperationsURIValueFromHttpRule(httpRule)))) + .setReturnType(FIXED_REST_TYPESTORE.get(HttpRule.class.getSimpleName())) + .build(); + + if (checkAdditionalBindings) { + for (HttpRule additionalBindings : httpRule.getAdditionalBindingsList()) { + httpRuleBuilderExpr = + MethodInvocationExpr.builder() + .setExprReferenceExpr(httpRuleBuilderExpr) + .setMethodName("addAdditionalBindings") + .setArguments(Arrays.asList(createHttpRuleExpr(additionalBindings, false))) + .build(); + } + } + + httpRuleBuilderExpr = + MethodInvocationExpr.builder() + .setExprReferenceExpr(httpRuleBuilderExpr) + .setMethodName("build") + .setReturnType(FIXED_REST_TYPESTORE.get(HttpRule.class.getSimpleName())) + .build(); + return httpRuleBuilderExpr; + } + + /* Parses the Service Yaml file's for custom HttpRules. Filter the HttpRules for ones that match Operations */ + Map parseOperationsCustomHttpRules(GapicContext context) { + Predicate predicate = x -> x.getSelector().contains(LRO_NAME_PREFIX); + com.google.api.Service service = context.serviceYamlProto(); + if (service == null || service.getHttp() == null) { + return ImmutableMap.of(); + } + return service.getHttp().getRulesList().stream() + .filter(predicate) + .collect(Collectors.toMap(HttpRule::getSelector, x -> x)); + } + + /* This is meant to be used for the OperationsClient Mixin OperationsClient's RPCs are mapped to GET/POST/DELETE and this function only expects those HttpVerbs to be used */ + String getOperationsURIValueFromHttpRule(HttpRule httpRule) { + switch (httpRule.getPatternCase().getNumber()) { + case 2: + return httpRule.getGet(); + case 4: + return httpRule.getPost(); + case 5: + return httpRule.getDelete(); + default: + throw new IllegalArgumentException( + "Operations HttpRule should only contain GET/POST/DELETE. Invalid: " + + httpRule.getSelector()); + } + } + @Override protected List createLongRunningClient(Service service, TypeStore typeStore) { Method pollingMethod = service.operationPollingMethod(); @@ -1197,8 +1253,7 @@ protected List createTypeRegistry(Service service) { TypeNode typeRegistryType = FIXED_REST_TYPESTORE.get(TypeRegistry.class.getSimpleName()); VariableExpr typeRegistryVarExpr = - TYPE_REGISTRY_VAR_EXPR - .toBuilder() + TYPE_REGISTRY_VAR_EXPR.toBuilder() .setIsDecl(true) .setIsStatic(true) .setScope(ScopeNode.PRIVATE) @@ -1248,4 +1303,56 @@ protected List createTypeRegistry(Service service) { .setValueExpr(typeRegistryBuilderExpr) .build())); } + + @Override + protected List createClassMethods( + GapicContext context, + Service service, + TypeStore typeStore, + Map classMemberVarExprs, + Map callableClassMemberVarExprs, + Map protoMethodNameToDescriptorVarExprs, + List classStatements) { + List javaMethods = new ArrayList<>(); + javaMethods.addAll( + super.createClassMethods( + context, + service, + typeStore, + classMemberVarExprs, + callableClassMemberVarExprs, + protoMethodNameToDescriptorVarExprs, + classStatements)); + javaMethods.addAll(createInvalidClassMethods(service)); + return javaMethods; + } + + private List createInvalidClassMethods(Service service) { + List methodDefinitions = new ArrayList<>(); + for (Method protoMethod : service.methods()) { + if (protoMethod.isSupportedByTransport(getTransportContext().transport())) { + continue; + } + String javaStyleProtoMethodName = JavaStyle.toLowerCamelCase(protoMethod.name()); + String callableName = String.format(CALLABLE_CLASS_MEMBER_PATTERN, javaStyleProtoMethodName); + methodDefinitions.add( + MethodDefinition.builder() + .setIsOverride(true) + .setScope(ScopeNode.PUBLIC) + .setName(callableName) + .setReturnType(getCallableType(protoMethod)) + .setBody( + Arrays.asList( + ExprStatement.withExpr( + ThrowExpr.builder() + .setType(FIXED_TYPESTORE.get("UnsupportedOperationException")) + .setMessageExpr( + String.format( + "Not implemented: %s(). %s transport is not implemented for this method yet.", + callableName, getTransportContext().transport())) + .build()))) + .build()); + } + return methodDefinitions; + } } diff --git a/gapic-generator-java/src/main/java/com/google/api/generator/gapic/composer/rest/ServiceStubSettingsClassComposer.java b/gapic-generator-java/src/main/java/com/google/api/generator/gapic/composer/rest/ServiceStubSettingsClassComposer.java index b12528ec3f..654337fb87 100644 --- a/gapic-generator-java/src/main/java/com/google/api/generator/gapic/composer/rest/ServiceStubSettingsClassComposer.java +++ b/gapic-generator-java/src/main/java/com/google/api/generator/gapic/composer/rest/ServiceStubSettingsClassComposer.java @@ -53,14 +53,18 @@ private static TypeStore createStaticTypes() { @Override protected List createApiClientHeaderProviderBuilderMethods( Service service, TypeStore typeStore) { - return Collections.singletonList( - createApiClientHeaderProviderBuilderMethod( - service, - typeStore, - "defaultApiClientHeaderProviderBuilder", - FIXED_REST_TYPESTORE.get(GaxHttpJsonProperties.class.getSimpleName()), - "getHttpJsonTokenName", - "getHttpJsonVersion")); + if (service.hasAnyEnabledMethodsForTransport(getTransportContext().transport())) { + return Collections.singletonList( + createApiClientHeaderProviderBuilderMethod( + service, + typeStore, + "defaultApiClientHeaderProviderBuilder", + FIXED_REST_TYPESTORE.get(GaxHttpJsonProperties.class.getSimpleName()), + "getHttpJsonTokenName", + "getHttpJsonVersion")); + } else { + return Collections.emptyList(); + } } @Override diff --git a/gapic-generator-java/src/main/java/com/google/api/generator/gapic/composer/samplecode/ServiceClientHeaderSampleComposer.java b/gapic-generator-java/src/main/java/com/google/api/generator/gapic/composer/samplecode/ServiceClientHeaderSampleComposer.java index b979f87744..c4e38e24a3 100644 --- a/gapic-generator-java/src/main/java/com/google/api/generator/gapic/composer/samplecode/ServiceClientHeaderSampleComposer.java +++ b/gapic-generator-java/src/main/java/com/google/api/generator/gapic/composer/samplecode/ServiceClientHeaderSampleComposer.java @@ -52,17 +52,23 @@ public static Sample composeClassHeaderSample( TypeNode clientType, Map resourceNames, Map messageTypes) { - if (service.methods().isEmpty()) { + List publicMethods = + service.methods().stream() + .filter(m -> m.isInternalApi() == false) + .collect(Collectors.toList()); + + // If all generated methods are INTERNAL, generate an empty service sample. + if (publicMethods.isEmpty()) { return ServiceClientMethodSampleComposer.composeEmptyServiceSample(clientType, service); } - // Use the first pure unary RPC method's sample code as showcase, if no such method exists, use - // the first method in the service's methods list. + // Use the first public pure unary RPC method's sample code as showcase, if no such method + // exists, use the first public method in the service's methods list. Method method = - service.methods().stream() + publicMethods.stream() .filter(m -> m.stream() == Method.Stream.NONE && !m.hasLro() && !m.isPaged()) .findFirst() - .orElse(service.methods().get(0)); + .orElse(publicMethods.get(0)); if (method.stream() == Method.Stream.NONE) { if (method.methodSignatures().isEmpty()) { @@ -342,7 +348,7 @@ public static Sample composeTransportSample( RegionTag.builder() .setServiceName(service.name()) .setRpcName(rpcName) - .setOverloadDisambiguation("setCredentialsProvider") + .setOverloadDisambiguation("useHttpJsonTransport") .build(); return Sample.builder().setBody(sampleBody).setRegionTag(regionTag).build(); } diff --git a/gapic-generator-java/src/main/java/com/google/api/generator/gapic/composer/samplecode/SettingsSampleComposer.java b/gapic-generator-java/src/main/java/com/google/api/generator/gapic/composer/samplecode/SettingsSampleComposer.java index 372399ee56..57d396847e 100644 --- a/gapic-generator-java/src/main/java/com/google/api/generator/gapic/composer/samplecode/SettingsSampleComposer.java +++ b/gapic-generator-java/src/main/java/com/google/api/generator/gapic/composer/samplecode/SettingsSampleComposer.java @@ -70,15 +70,15 @@ public static Optional composeSettingsSample( .build(); // Builder with set value method - // e.g foobarSettingBuilder.fooSetting().setRetrySettings( - // echoSettingsBuilder.echoSettings().getRetrySettings().toBuilder().setTotalTimeout(Duration.ofSeconds(30)).build()); + // e.g. foobarSettingBuilder.fooSetting().setRetrySettings( + // echoSettingsBuilder.echoSettings().getRetrySettings().toBuilder() + // .setTotalTimeoutDuration(Duration.ofSeconds(30)).build()); MethodInvocationExpr settingBuilderMethodInvocationExpr = MethodInvocationExpr.builder() .setExprReferenceExpr(localSettingsVarExpr) .setMethodName( JavaStyle.toLowerCamelCase(String.format("%sSettings", methodNameOpt.get()))) .build(); - String disambiguation = "Settings"; MethodInvocationExpr retrySettingsArgExpr = MethodInvocationExpr.builder() .setExprReferenceExpr(settingBuilderMethodInvocationExpr) @@ -89,7 +89,25 @@ public static Optional composeSettingsSample( .setExprReferenceExpr(retrySettingsArgExpr) .setMethodName("toBuilder") .build(); - MethodInvocationExpr ofSecondMethodInvocationExpr = + MethodInvocationExpr ofOneSecondMethodInvocationExpr = + MethodInvocationExpr.builder() + .setStaticReferenceType( + TypeNode.withReference(ConcreteReference.withClazz(Duration.class))) + .setMethodName("ofSeconds") + .setArguments( + ValueExpr.withValue( + PrimitiveValue.builder().setType(TypeNode.INT).setValue("1").build())) + .build(); + MethodInvocationExpr ofFiveSecondsMethodInvocationExpr = + MethodInvocationExpr.builder() + .setStaticReferenceType( + TypeNode.withReference(ConcreteReference.withClazz(Duration.class))) + .setMethodName("ofSeconds") + .setArguments( + ValueExpr.withValue( + PrimitiveValue.builder().setType(TypeNode.INT).setValue("5").build())) + .build(); + MethodInvocationExpr ofThirtySecondsMethodInvocationExpr = MethodInvocationExpr.builder() .setStaticReferenceType( TypeNode.withReference(ConcreteReference.withClazz(Duration.class))) @@ -98,11 +116,85 @@ public static Optional composeSettingsSample( ValueExpr.withValue( PrimitiveValue.builder().setType(TypeNode.INT).setValue("30").build())) .build(); + MethodInvocationExpr ofSixtySecondsMethodInvocationExpr = + MethodInvocationExpr.builder() + .setStaticReferenceType( + TypeNode.withReference(ConcreteReference.withClazz(Duration.class))) + .setMethodName("ofSeconds") + .setArguments( + ValueExpr.withValue( + PrimitiveValue.builder().setType(TypeNode.INT).setValue("60").build())) + .build(); + MethodInvocationExpr ofThreeHundredSecondsMethodInvocationExpr = + MethodInvocationExpr.builder() + .setStaticReferenceType( + TypeNode.withReference(ConcreteReference.withClazz(Duration.class))) + .setMethodName("ofSeconds") + .setArguments( + ValueExpr.withValue( + PrimitiveValue.builder().setType(TypeNode.INT).setValue("300").build())) + .build(); + retrySettingsArgExpr = + MethodInvocationExpr.builder() + .setExprReferenceExpr(retrySettingsArgExpr) + .setMethodName("setInitialRetryDelayDuration") + .setArguments(ofOneSecondMethodInvocationExpr) + .build(); + retrySettingsArgExpr = + MethodInvocationExpr.builder() + .setExprReferenceExpr(retrySettingsArgExpr) + .setMethodName("setInitialRpcTimeoutDuration") + .setArguments(ofFiveSecondsMethodInvocationExpr) + .build(); retrySettingsArgExpr = MethodInvocationExpr.builder() .setExprReferenceExpr(retrySettingsArgExpr) - .setMethodName("setTotalTimeout") - .setArguments(ofSecondMethodInvocationExpr) + .setMethodName("setMaxAttempts") + .setArguments( + ValueExpr.withValue( + PrimitiveValue.builder().setType(TypeNode.INT).setValue("5").build())) + .build(); + retrySettingsArgExpr = + MethodInvocationExpr.builder() + .setExprReferenceExpr(retrySettingsArgExpr) + .setMethodName("setMaxRetryDelayDuration") + .setArguments(ofThirtySecondsMethodInvocationExpr) + .build(); + retrySettingsArgExpr = + MethodInvocationExpr.builder() + .setExprReferenceExpr(retrySettingsArgExpr) + .setMethodName("setMaxRpcTimeoutDuration") + .setArguments(ofSixtySecondsMethodInvocationExpr) + .build(); + double retryDelayMultiplier = 1.3; + retrySettingsArgExpr = + MethodInvocationExpr.builder() + .setExprReferenceExpr(retrySettingsArgExpr) + .setMethodName("setRetryDelayMultiplier") + .setArguments( + ValueExpr.withValue( + PrimitiveValue.builder() + .setType(TypeNode.DOUBLE) + .setValue(String.format("%.1f", retryDelayMultiplier)) + .build())) + .build(); + double rpcTimeoutMultiplier = 1.5; + retrySettingsArgExpr = + MethodInvocationExpr.builder() + .setExprReferenceExpr(retrySettingsArgExpr) + .setMethodName("setRpcTimeoutMultiplier") + .setArguments( + ValueExpr.withValue( + PrimitiveValue.builder() + .setType(TypeNode.DOUBLE) + .setValue(String.format("%.1f", rpcTimeoutMultiplier)) + .build())) + .build(); + retrySettingsArgExpr = + MethodInvocationExpr.builder() + .setExprReferenceExpr(retrySettingsArgExpr) + .setMethodName("setTotalTimeoutDuration") + .setArguments(ofThreeHundredSecondsMethodInvocationExpr) .build(); retrySettingsArgExpr = MethodInvocationExpr.builder() @@ -153,4 +245,195 @@ public static Optional composeSettingsSample( .build(); return Optional.of(Sample.builder().setBody(statements).setRegionTag(regionTag).build()); } + + public static Optional composeLroSettingsSample( + Optional methodNameOpt, String settingsClassName, TypeNode classType) { + if (!methodNameOpt.isPresent()) { + return Optional.empty(); + } + // Initialize services settingsBuilder with newBuilder() + // e.g. FoobarSettings.Builder foobarSettingsBuilder = FoobarSettings.newBuilder(); + TypeNode builderType = + TypeNode.withReference( + VaporReference.builder() + .setEnclosingClassNames(classType.reference().name()) + .setName("Builder") + .setPakkage(classType.reference().pakkage()) + .build()); + VariableExpr localSettingsVarExpr = + VariableExpr.withVariable( + Variable.builder() + .setName(JavaStyle.toLowerCamelCase(String.format("%sBuilder", settingsClassName))) + .setType(builderType) + .build()); + MethodInvocationExpr settingsBuilderMethodInvocationExpr = + MethodInvocationExpr.builder() + .setStaticReferenceType(classType) + .setMethodName("newBuilder") + .setReturnType(builderType) + .build(); + AssignmentExpr initLocalSettingsExpr = + AssignmentExpr.builder() + .setVariableExpr(localSettingsVarExpr.toBuilder().setIsDecl(true).build()) + .setValueExpr(settingsBuilderMethodInvocationExpr) + .build(); + + // Initialize TimedRetryAlgorithm initialization + // e.g. TimedRetryAlgorithm timedRetryAlgorithm = OperationalTimedPollAlgorithm.create( + TypeNode TimedRetryAlgorithmType = + TypeNode.withReference( + VaporReference.builder() + .setName("TimedRetryAlgorithm") + .setPakkage("com.google.api.gax.retrying") + .build()); + VariableExpr TimedRetryVarExpr = + VariableExpr.withVariable( + Variable.builder() + .setName("timedRetryAlgorithm") + .setType(TimedRetryAlgorithmType) + .build()); + TypeNode OperationalTimedPollAlgorithmType = + TypeNode.withReference( + VaporReference.builder() + .setName("OperationalTimedPollAlgorithm") + .setPakkage("com.google.api.gax.longrunning") + .build()); + + // Set RetrySettings for TimedRetryAlgorithm + TypeNode RetrySettingsType = + TypeNode.withReference( + VaporReference.builder() + .setName("RetrySettings") + .setPakkage("com.google.api.gax.retrying") + .build()); + VariableExpr RetrySettingsVarExpr = + VariableExpr.withVariable( + Variable.builder().setName("RetrySettings").setType(RetrySettingsType).build()); + MethodInvocationExpr retrySettingsArgExpr = + MethodInvocationExpr.builder() + .setExprReferenceExpr(RetrySettingsVarExpr) + .setMethodName("newBuilder") + .build(); + + MethodInvocationExpr ofFiveHundredMillisMethodInvocationExpr = + MethodInvocationExpr.builder() + .setStaticReferenceType( + TypeNode.withReference(ConcreteReference.withClazz(Duration.class))) + .setMethodName("ofMillis") + .setArguments( + ValueExpr.withValue( + PrimitiveValue.builder().setType(TypeNode.INT).setValue("500").build())) + .build(); + MethodInvocationExpr ofFiveThousandMillisMethodInvocationExpr = + MethodInvocationExpr.builder() + .setStaticReferenceType( + TypeNode.withReference(ConcreteReference.withClazz(Duration.class))) + .setMethodName("ofMillis") + .setArguments( + ValueExpr.withValue( + PrimitiveValue.builder().setType(TypeNode.INT).setValue("5000").build())) + .build(); + MethodInvocationExpr ofTwentyFourHoursMethodInvocationExpr = + MethodInvocationExpr.builder() + .setStaticReferenceType( + TypeNode.withReference(ConcreteReference.withClazz(Duration.class))) + .setMethodName("ofHours") + .setArguments( + ValueExpr.withValue( + PrimitiveValue.builder().setType(TypeNode.INT).setValue("24").build())) + .build(); + + retrySettingsArgExpr = + MethodInvocationExpr.builder() + .setExprReferenceExpr(retrySettingsArgExpr) + .setMethodName("setInitialRetryDelayDuration") + .setArguments(ofFiveHundredMillisMethodInvocationExpr) + .build(); + double retryDelayMultiplier = 1.5; + retrySettingsArgExpr = + MethodInvocationExpr.builder() + .setExprReferenceExpr(retrySettingsArgExpr) + .setMethodName("setRetryDelayMultiplier") + .setArguments( + ValueExpr.withValue( + PrimitiveValue.builder() + .setType(TypeNode.DOUBLE) + .setValue(String.format("%.1f", retryDelayMultiplier)) + .build())) + .build(); + retrySettingsArgExpr = + MethodInvocationExpr.builder() + .setExprReferenceExpr(retrySettingsArgExpr) + .setMethodName("setMaxRetryDelayDuration") + .setArguments(ofFiveThousandMillisMethodInvocationExpr) + .build(); + retrySettingsArgExpr = + MethodInvocationExpr.builder() + .setExprReferenceExpr(retrySettingsArgExpr) + .setMethodName("setTotalTimeoutDuration") + .setArguments(ofTwentyFourHoursMethodInvocationExpr) + .build(); + + MethodInvocationExpr RetrySettingsMethodInvocationExpr = + MethodInvocationExpr.builder() + .setExprReferenceExpr(retrySettingsArgExpr) + .setMethodName("build") + .setReturnType(RetrySettingsType) + .build(); + MethodInvocationExpr TimedRetryAlgorithmMethodInvocationExpr = + MethodInvocationExpr.builder() + .setStaticReferenceType(OperationalTimedPollAlgorithmType) + .setMethodName("create") + .setReturnType(TimedRetryAlgorithmType) + .setArguments(RetrySettingsMethodInvocationExpr) + .build(); + AssignmentExpr initTimedRetryAlgorithmMethodInvocationExpr = + AssignmentExpr.builder() + .setVariableExpr(TimedRetryVarExpr.toBuilder().setIsDecl(true).build()) + .setValueExpr(TimedRetryAlgorithmMethodInvocationExpr) + .build(); + + // Build the settings + // e.g: + // echoSettingsBuilder.createClusterOperationSettings().setPollingAlgorithm(timedRetryAlgorithm).build(); + + MethodInvocationExpr builderMethodInvocationExpr = + MethodInvocationExpr.builder() + .setExprReferenceExpr(localSettingsVarExpr) + .setMethodName("createClusterOperationSettings") + .setReturnType(builderType) + .build(); + + builderMethodInvocationExpr = + MethodInvocationExpr.builder() + .setExprReferenceExpr(builderMethodInvocationExpr) + .setMethodName("setPollingAlgorithm") + .setArguments(TimedRetryVarExpr) + .setReturnType(builderType) + .build(); + + builderMethodInvocationExpr = + MethodInvocationExpr.builder() + .setExprReferenceExpr(builderMethodInvocationExpr) + .setMethodName("build") + .setReturnType(builderType) + .build(); + + List statements = + Arrays.asList( + initLocalSettingsExpr, + initTimedRetryAlgorithmMethodInvocationExpr, + builderMethodInvocationExpr) + .stream() + .map(e -> ExprStatement.withExpr(e)) + .collect(Collectors.toList()); + + // TODO: alicejli edit RegionTag to match other languages + RegionTag regionTag = + RegionTag.builder() + .setServiceName(classType.reference().name()) + .setRpcName(methodNameOpt.get()) + .build(); + return Optional.of(Sample.builder().setBody(statements).setRegionTag(regionTag).build()); + } } diff --git a/gapic-generator-java/src/main/java/com/google/api/generator/gapic/composer/utils/CommonStrings.java b/gapic-generator-java/src/main/java/com/google/api/generator/gapic/composer/utils/CommonStrings.java new file mode 100644 index 0000000000..201e50e8e7 --- /dev/null +++ b/gapic-generator-java/src/main/java/com/google/api/generator/gapic/composer/utils/CommonStrings.java @@ -0,0 +1,24 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.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.google.api.generator.gapic.composer.utils; + +/** Provides Gapic common strings. */ +public class CommonStrings { + public static final String PAGED_RESPONSE_TYPE_NAME_PATTERN = "%sPagedResponse"; + public static final String INTERNAL_API_WARNING = + "This API is not intended for public consumption."; + public static final String SETTINGS_LITERAL = "Settings"; + public static final String OPERATION_SETTINGS_LITERAL = "OperationSettings"; +} diff --git a/gapic-generator-java/src/main/java/com/google/api/generator/gapic/model/Field.java b/gapic-generator-java/src/main/java/com/google/api/generator/gapic/model/Field.java index a5ec9caacb..39213909de 100644 --- a/gapic-generator-java/src/main/java/com/google/api/generator/gapic/model/Field.java +++ b/gapic-generator-java/src/main/java/com/google/api/generator/gapic/model/Field.java @@ -14,6 +14,7 @@ package com.google.api.generator.gapic.model; +import com.google.api.FieldInfo.Format; import com.google.api.generator.engine.ast.TypeNode; import com.google.auto.value.AutoValue; import java.util.Objects; @@ -32,6 +33,15 @@ public abstract class Field { public abstract TypeNode type(); + // If the field is annotated with google.api.field_behavior = REQUIRED, then this is true. This is + // currently only used to check if a field should be auto-populated. If it is true, then the field + // should + // *not* be autopopulated. + public abstract boolean isRequired(); + + @Nullable + public abstract Format fieldInfoFormat(); + public abstract boolean isMessage(); public abstract boolean isEnum(); @@ -62,6 +72,17 @@ public boolean hasResourceReference() { return type().equals(TypeNode.STRING) && resourceReference() != null; } + // Check that the field format is of UUID, it is not annotated as required, and is of type String. + // Unless + // those three conditions are met, do not autopopulate the field. + // In the future, if additional formats are supported for autopopulation, this will need to be + // refactored to support those formats. + public boolean canBeAutoPopulated() { + return Format.UUID4.equals(fieldInfoFormat()) + && !isRequired() + && TypeNode.STRING.equals(type()); + } + @Override public boolean equals(Object o) { if (!(o instanceof Field)) { @@ -72,6 +93,8 @@ public boolean equals(Object o) { return name().equals(other.name()) && originalName().equals(other.originalName()) && type().equals(other.type()) + && isRequired() == other.isRequired() + && fieldInfoFormat() == other.fieldInfoFormat() && isMessage() == other.isMessage() && isEnum() == other.isEnum() && isRepeated() == other.isRepeated() @@ -89,6 +112,8 @@ public int hashCode() { + 19 * type().hashCode() + (isMessage() ? 1 : 0) * 23 + (isEnum() ? 1 : 0) * 29 + + (isRequired() ? 1 : 0) * 31 + + (fieldInfoFormat() == null ? 0 : fieldInfoFormat().hashCode()) + (isRepeated() ? 1 : 0) * 31 + (isMap() ? 1 : 0) * 37 + (isContainedInOneof() ? 1 : 0) * 41 @@ -101,6 +126,7 @@ public int hashCode() { public static Builder builder() { return new AutoValue_Field.Builder() + .setIsRequired(false) .setIsMessage(false) .setIsEnum(false) .setIsRepeated(false) @@ -117,6 +143,10 @@ public abstract static class Builder { public abstract Builder setType(TypeNode type); + public abstract Builder setIsRequired(boolean isRequired); + + public abstract Builder setFieldInfoFormat(Format fieldInfoFormat); + public abstract Builder setIsMessage(boolean isMessage); public abstract Builder setIsEnum(boolean isEnum); diff --git a/gapic-generator-java/src/main/java/com/google/api/generator/gapic/model/GapicClass.java b/gapic-generator-java/src/main/java/com/google/api/generator/gapic/model/GapicClass.java index f05e308290..1fd06a8dfe 100644 --- a/gapic-generator-java/src/main/java/com/google/api/generator/gapic/model/GapicClass.java +++ b/gapic-generator-java/src/main/java/com/google/api/generator/gapic/model/GapicClass.java @@ -15,6 +15,7 @@ package com.google.api.generator.gapic.model; import com.google.api.generator.engine.ast.ClassDefinition; +import com.google.api.generator.engine.ast.ScopeNode; import com.google.auto.value.AutoValue; import java.util.Collections; import java.util.List; @@ -26,7 +27,10 @@ public enum Kind { MAIN, STUB, TEST, - PROTO + PROTO, + // Used to denote a Gapic Class that has no intention of being generated + // The Writer will skip generating code for this class + NON_GENERATED }; public abstract Kind kind(); @@ -39,7 +43,25 @@ public enum Kind { public abstract String apiShortName(); // Only used for generating the region tag for samples; therefore only used in select Composers. - public abstract String apiVersion(); + public abstract String packageVersion(); + + /** + * Create a GapicClass with minimal information. This is intended to be used for GapicClasses that + * will not generate any Java files (Writer will skip) + * + * @return GapicClass denoted with NON_GENERATED Kind enum + */ + public static GapicClass createNonGeneratedGapicClass() { + return builder() + .setKind(Kind.NON_GENERATED) + .setClassDefinition( + ClassDefinition.builder() + .setPackageString("Empty Package") + .setName("Empty Name") + .setScope(ScopeNode.PUBLIC) + .build()) + .build(); + } public static GapicClass create(Kind kind, ClassDefinition classDefinition) { return builder().setKind(kind).setClassDefinition(classDefinition).build(); @@ -54,7 +76,7 @@ static Builder builder() { return new AutoValue_GapicClass.Builder() .setSamples(Collections.emptyList()) .setApiShortName("") - .setApiVersion(""); + .setPackageVersion(""); } abstract Builder toBuilder(); @@ -67,8 +89,8 @@ public final GapicClass withApiShortName(String apiShortName) { return toBuilder().setApiShortName(apiShortName).build(); } - public final GapicClass withApiVersion(String apiVersion) { - return toBuilder().setApiVersion(apiVersion).build(); + public final GapicClass withPackageVersion(String packageVersion) { + return toBuilder().setPackageVersion(packageVersion).build(); } @AutoValue.Builder @@ -81,7 +103,7 @@ abstract static class Builder { abstract Builder setApiShortName(String apiShortName); - abstract Builder setApiVersion(String apiVersion); + abstract Builder setPackageVersion(String packageVersion); abstract GapicClass build(); } diff --git a/gapic-generator-java/src/main/java/com/google/api/generator/gapic/model/GapicContext.java b/gapic-generator-java/src/main/java/com/google/api/generator/gapic/model/GapicContext.java index 8fdba8d3ee..d4cfa19b48 100644 --- a/gapic-generator-java/src/main/java/com/google/api/generator/gapic/model/GapicContext.java +++ b/gapic-generator-java/src/main/java/com/google/api/generator/gapic/model/GapicContext.java @@ -21,6 +21,7 @@ import java.util.Collections; import java.util.List; import java.util.Map; +import java.util.Optional; import java.util.Set; import java.util.TreeMap; import java.util.stream.Collectors; @@ -32,6 +33,16 @@ public abstract class GapicContext { // it iteratively as we generate client methods. private GapicMetadata gapicMetadata = defaultGapicMetadata(); + public static final GapicContext EMPTY = + builder() + .setServices(Collections.emptyList()) + .setMessages(Collections.emptyMap()) + .setServiceConfig(GapicServiceConfig.create(Optional.empty())) + .setResourceNames(Collections.emptyMap()) + .setHelperResourceNames(Collections.emptySet()) + .setTransport(Transport.GRPC) + .build(); + // Maps the message name (as it appears in the protobuf) to Messages. public abstract ImmutableMap messages(); @@ -59,6 +70,16 @@ public GapicMetadata gapicMetadata() { @Nullable public abstract com.google.api.Service serviceYamlProto(); + @Nullable + public abstract String repo(); + + @Nullable + public abstract String artifact(); + + public boolean containsServices() { + return !services().isEmpty(); + } + public boolean hasServiceYamlProto() { return serviceYamlProto() != null; } @@ -115,6 +136,10 @@ public Builder setHelperResourceNames(Set helperResourceNames) { public abstract Builder setTransport(Transport transport); + public abstract Builder setRepo(String repo); + + public abstract Builder setArtifact(String artifact); + abstract ImmutableMap resourceNames(); abstract ImmutableMap helperResourceNames(); diff --git a/gapic-generator-java/src/main/java/com/google/api/generator/gapic/model/Message.java b/gapic-generator-java/src/main/java/com/google/api/generator/gapic/model/Message.java index ecfdd484df..2866e84624 100644 --- a/gapic-generator-java/src/main/java/com/google/api/generator/gapic/model/Message.java +++ b/gapic-generator-java/src/main/java/com/google/api/generator/gapic/model/Message.java @@ -47,10 +47,15 @@ public abstract class Message { // a specific field. public abstract ImmutableList fields(); - // String :: number value map for enums. // TODO(unsupported): Consider making enums a separate POJO. However, that would require // passing in a map of Message and another map of Enum types, which is not needed for // 99.99% of protobuf generation. + /** + * This Message POJO is used to represent both proto-messages and proto-enums. + * + * @return an empty map if this instance represents a proto-message, otherwise the proto-enum's + * String-number value map. + */ public abstract ImmutableMap enumValues(); public abstract TypeNode type(); @@ -74,8 +79,24 @@ public abstract class Message { // [Foo, Bar, Car]. public abstract ImmutableList outerNestedTypes(); + /** + * This Message POJO is used to represent both proto-messages and proto-enums. + * + *

If this instance represents a proto-enum (this.isEnum() == true), this method + * will always return an empty list, since enums cannot contain nested enums. + * + *

If this instance represents a proto-message (this.isEnum() == false), this + * method returns a list of any nested proto-enums defined in this proto-message. + */ + public abstract ImmutableList nestedEnums(); + public abstract Builder toBuilder(); + /** + * This Message POJO is used to represent both proto-messages and proto-enums. + * + * @return true, when this instance represents a proto-enum. + */ public boolean isEnum() { return !enumValues().isEmpty(); } @@ -150,6 +171,7 @@ public Field findAndUnwrapPaginatedRepeatedField() { public static Builder builder() { return new AutoValue_Message.Builder() + .setNestedEnums(Collections.emptyList()) .setOuterNestedTypes(Collections.emptyList()) .setFields(Collections.emptyList()) .setFieldMap(Collections.emptyMap()) @@ -188,6 +210,8 @@ public Builder setEnumValues(List names, List numbers) { public abstract Builder setOperationResponseFields( BiMap operationRequestFields); + public abstract Builder setNestedEnums(List nestedEnums); + abstract Builder setFieldMap(Map fieldMap); abstract ImmutableList fields(); diff --git a/gapic-generator-java/src/main/java/com/google/api/generator/gapic/model/Method.java b/gapic-generator-java/src/main/java/com/google/api/generator/gapic/model/Method.java index dc2452f2d5..66acd065a3 100644 --- a/gapic-generator-java/src/main/java/com/google/api/generator/gapic/model/Method.java +++ b/gapic-generator-java/src/main/java/com/google/api/generator/gapic/model/Method.java @@ -17,6 +17,7 @@ import com.google.api.generator.engine.ast.TypeNode; import com.google.auto.value.AutoValue; import com.google.common.collect.ImmutableList; +import java.util.ArrayList; import java.util.List; import javax.annotation.Nullable; @@ -37,6 +38,8 @@ public enum Stream { public abstract TypeNode outputType(); + public abstract boolean isInternalApi(); + public abstract boolean isBatching(); public boolean isPaged() { @@ -69,6 +72,16 @@ public boolean isPaged() { // [["content", "error"], ["content", "error", "info"]]. public abstract ImmutableList> methodSignatures(); + public abstract List autoPopulatedFields(); + + /** + * If a service's service_config.yaml file contains method_settings.auto_populated_fields for this + * method, and the method is a Unary-type, then this is true + */ + public boolean hasAutoPopulatedFields() { + return !autoPopulatedFields().isEmpty() && stream() == Stream.NONE; + } + public abstract boolean operationPollingMethod(); public boolean hasLro() { @@ -99,12 +112,33 @@ public boolean isOperationPollingMethod() { return operationPollingMethod(); } + /** + * Determines if method is both eligible and enabled for the Transport. GRPC+REST Transport is not + * supported as each transport's sub composers will invoke this method the specific transport + * (GRPC or REST) + * + * @param transport Expects either GRPC or REST Transport + * @return boolean if method should be generated for the transport + */ + public boolean isSupportedByTransport(Transport transport) { + if (transport == Transport.REST) { + return httpBindings() != null && stream() != Stream.BIDI && stream() != Stream.CLIENT; + } else if (transport == Transport.GRPC) { + return true; + } else { + throw new IllegalArgumentException( + String.format("Invalid Transport: %s. Expecting GRPC or REST", transport.name())); + } + } + public abstract Builder toBuilder(); public static Builder builder() { return new AutoValue_Method.Builder() .setStream(Stream.NONE) + .setAutoPopulatedFields(new ArrayList<>()) .setMethodSignatures(ImmutableList.of()) + .setIsInternalApi(false) .setIsBatching(false) .setIsDeprecated(false) .setOperationPollingMethod(false); @@ -131,6 +165,8 @@ public abstract static class Builder { public abstract Builder setOutputType(TypeNode outputType); + public abstract Builder setIsInternalApi(boolean isInternalApi); + public abstract Builder setStream(Stream stream); public abstract Builder setLro(LongrunningOperation lro); @@ -151,6 +187,8 @@ public abstract static class Builder { public abstract Builder setOperationPollingMethod(boolean operationPollingMethod); + public abstract Builder setAutoPopulatedFields(List autoPopulatedFields); + public abstract Builder setRoutingHeaderRule(RoutingHeaderRule routingHeaderRule); public abstract Method build(); diff --git a/gapic-generator-java/src/main/java/com/google/api/generator/gapic/model/ReflectConfig.java b/gapic-generator-java/src/main/java/com/google/api/generator/gapic/model/ReflectConfig.java new file mode 100644 index 0000000000..05f7220756 --- /dev/null +++ b/gapic-generator-java/src/main/java/com/google/api/generator/gapic/model/ReflectConfig.java @@ -0,0 +1,33 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.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.google.api.generator.gapic.model; + +public class ReflectConfig { + String name; + boolean queryAllDeclaredConstructors = true; + boolean queryAllPublicConstructors = true; + boolean queryAllDeclaredMethods = true; + boolean allPublicMethods = true; + boolean allDeclaredClasses = true; + boolean allPublicClasses = true; + + public ReflectConfig(String name) { + this.name = name; + } + + public String getName() { + return name; + } +} diff --git a/gapic-generator-java/src/main/java/com/google/api/generator/gapic/model/Service.java b/gapic-generator-java/src/main/java/com/google/api/generator/gapic/model/Service.java index 2e3a6be7df..656bf6bbd3 100644 --- a/gapic-generator-java/src/main/java/com/google/api/generator/gapic/model/Service.java +++ b/gapic-generator-java/src/main/java/com/google/api/generator/gapic/model/Service.java @@ -27,6 +27,9 @@ public abstract class Service { public abstract String name(); + @Nullable + public abstract String apiVersion(); + public abstract String defaultHost(); public abstract ImmutableList oauthScopes(); @@ -52,6 +55,16 @@ public boolean hasDescription() { return !Strings.isNullOrEmpty(description()); } + public boolean hasApiVersion() { + return !Strings.isNullOrEmpty(apiVersion()); + } + + public String hostServiceName() { + // Host Service Name is guaranteed to exist and be non-null and non-empty + // Parser will fail if the default host is not supplied + return parseHostServiceName(defaultHost()); + } + public String apiShortName() { if (!Strings.isNullOrEmpty(defaultHost())) { return parseApiShortName(defaultHost()); @@ -59,9 +72,9 @@ public String apiShortName() { return ""; } - public String apiVersion() { + public String packageVersion() { if (!Strings.isNullOrEmpty(protoPakkage())) { - return parseApiVersion(protoPakkage()); + return parsePackageVersion(protoPakkage()); } return ""; } @@ -113,6 +126,33 @@ public boolean hasStandardLroMethods() { return false; } + /** + * Wrapper for hasAnyEnabledMethodsForTransport(Transport). Some invocations are called with + * `gRPC` which can't match with the correct Transport (GRPC) + * + * @param transportName String transport value + * @return boolean if service contains any enabled methods for a transport + */ + public boolean hasAnyEnabledMethodsForTransport(String transportName) { + return hasAnyEnabledMethodsForTransport(Transport.parse(transportName)); + } + + /** + * Determines if a Service contains any methods that are both eligible and enabled for the + * Transport. GRPC+REST Transport is not supported as each transport's sub composers will invoke + * this method the specific transport (GRPC or REST) + * + * @param transport Expects either GRPC or REST Transport + * @return boolean if service contains any enabled methods for a transport + */ + public boolean hasAnyEnabledMethodsForTransport(Transport transport) { + if (transport == Transport.GRPC_REST) { + throw new IllegalArgumentException( + String.format("Invalid Transport: %s. Expecting GRPC or REST", transport.name())); + } + return methods().stream().anyMatch(x -> x.isSupportedByTransport(transport)); + } + public abstract Builder toBuilder(); public static Builder builder() { @@ -125,6 +165,8 @@ public abstract static class Builder { public abstract Builder setOverriddenName(String overriddenName); + public abstract Builder setApiVersion(String apiVersion); + public abstract Builder setDefaultHost(String defaultHost); public abstract Builder setOauthScopes(List oauthScopes); @@ -144,17 +186,28 @@ public abstract static class Builder { public abstract Service build(); } - private static String parseApiVersion(String protoPackage) { - // parse protoPackage for apiVersion + private static String parsePackageVersion(String protoPackage) { + // parse protoPackage for packageVersion String[] pakkage = protoPackage.split("\\."); - String apiVersion; + String packageVersion; // e.g. v1, v2, v1beta1 if (pakkage[pakkage.length - 1].matches("v[0-9].*")) { - apiVersion = pakkage[pakkage.length - 1]; + packageVersion = pakkage[pakkage.length - 1]; } else { - apiVersion = ""; + packageVersion = ""; } - return apiVersion; + return packageVersion; + } + + // Parse the service name from the default host configured in the protos + // or service yaml file. For Google Cloud Services, the default host value + // is expected to contain `.googleapis.com`. Exceptions may exist (i.e. localhost), + // in which case we will return an empty string. + private static String parseHostServiceName(String defaultHost) { + if (defaultHost.contains(".googleapis.com")) { + return Iterables.getFirst(Splitter.on(".").split(defaultHost), defaultHost); + } + return ""; } // Parse defaultHost for apiShortName for the RegionTag. Need to account for regional default diff --git a/gapic-generator-java/src/main/java/com/google/api/generator/gapic/model/Transport.java b/gapic-generator-java/src/main/java/com/google/api/generator/gapic/model/Transport.java index ae7820c8ed..87d49820bf 100644 --- a/gapic-generator-java/src/main/java/com/google/api/generator/gapic/model/Transport.java +++ b/gapic-generator-java/src/main/java/com/google/api/generator/gapic/model/Transport.java @@ -20,12 +20,12 @@ public enum Transport { GRPC_REST; /** - * Parse command line transport argument in the format `grpc+rest`. + * Parse the input and return the corresponding Transport enum * - * @param name name of the transport. Valid inputs are "grpc", "rest", "grpc+rest" - * @return the {@code Transport} enum matching the command line argument + * @param name Transport name + * @return the {@code Transport} enum matching the name parameter */ public static Transport parse(String name) { - return valueOf(name.replace('+', '_').toUpperCase()); + return valueOf(name.toLowerCase().replace('+', '_').toUpperCase()); } } diff --git a/gapic-generator-java/src/main/java/com/google/api/generator/gapic/protoparser/BatchingSettingsConfigParser.java b/gapic-generator-java/src/main/java/com/google/api/generator/gapic/protoparser/BatchingSettingsConfigParser.java index f681399342..e7a88a27a7 100644 --- a/gapic-generator-java/src/main/java/com/google/api/generator/gapic/protoparser/BatchingSettingsConfigParser.java +++ b/gapic-generator-java/src/main/java/com/google/api/generator/gapic/protoparser/BatchingSettingsConfigParser.java @@ -27,6 +27,7 @@ import java.util.List; import java.util.Map; import java.util.Optional; +import org.yaml.snakeyaml.LoaderOptions; import org.yaml.snakeyaml.Yaml; import org.yaml.snakeyaml.constructor.SafeConstructor; @@ -77,7 +78,7 @@ static Optional> parse(String gapicYamlConfigFilePat return Optional.empty(); } - Yaml yaml = new Yaml(new SafeConstructor()); + Yaml yaml = new Yaml(new SafeConstructor(new LoaderOptions())); Map yamlMap = yaml.load(fileContents); return parseFromMap(yamlMap); } diff --git a/gapic-generator-java/src/main/java/com/google/api/generator/gapic/protoparser/GapicLanguageSettingsParser.java b/gapic-generator-java/src/main/java/com/google/api/generator/gapic/protoparser/GapicLanguageSettingsParser.java index e1cad0ef97..1f957cb23a 100644 --- a/gapic-generator-java/src/main/java/com/google/api/generator/gapic/protoparser/GapicLanguageSettingsParser.java +++ b/gapic-generator-java/src/main/java/com/google/api/generator/gapic/protoparser/GapicLanguageSettingsParser.java @@ -24,6 +24,7 @@ import java.nio.file.Paths; import java.util.Map; import java.util.Optional; +import org.yaml.snakeyaml.LoaderOptions; import org.yaml.snakeyaml.Yaml; import org.yaml.snakeyaml.constructor.SafeConstructor; @@ -56,7 +57,7 @@ static Optional parse(String gapicYamlConfigFilePath) { return Optional.empty(); } - Yaml yaml = new Yaml(new SafeConstructor()); + Yaml yaml = new Yaml(new SafeConstructor(new LoaderOptions())); Map yamlMap = yaml.load(fileContents); return parseFromMap(yamlMap); } diff --git a/gapic-generator-java/src/main/java/com/google/api/generator/gapic/protoparser/GapicLroRetrySettingsParser.java b/gapic-generator-java/src/main/java/com/google/api/generator/gapic/protoparser/GapicLroRetrySettingsParser.java index b30e93791b..263d227b22 100644 --- a/gapic-generator-java/src/main/java/com/google/api/generator/gapic/protoparser/GapicLroRetrySettingsParser.java +++ b/gapic-generator-java/src/main/java/com/google/api/generator/gapic/protoparser/GapicLroRetrySettingsParser.java @@ -26,6 +26,7 @@ import java.util.List; import java.util.Map; import java.util.Optional; +import org.yaml.snakeyaml.LoaderOptions; import org.yaml.snakeyaml.Yaml; import org.yaml.snakeyaml.constructor.SafeConstructor; @@ -64,7 +65,7 @@ static Optional> parse(String gapicYamlConfigFilePat return Optional.empty(); } - Yaml yaml = new Yaml(new SafeConstructor()); + Yaml yaml = new Yaml(new SafeConstructor(new LoaderOptions())); Map yamlMap = yaml.load(fileContents); return parseFromMap(yamlMap); } diff --git a/gapic-generator-java/src/main/java/com/google/api/generator/gapic/protoparser/HttpRuleParser.java b/gapic-generator-java/src/main/java/com/google/api/generator/gapic/protoparser/HttpRuleParser.java index 87bcd76abb..499f28427d 100644 --- a/gapic-generator-java/src/main/java/com/google/api/generator/gapic/protoparser/HttpRuleParser.java +++ b/gapic-generator-java/src/main/java/com/google/api/generator/gapic/protoparser/HttpRuleParser.java @@ -183,7 +183,7 @@ private static String getHttpVerbPattern(HttpRule httpRule) { case PATCH: return httpRule.getPatch(); case CUSTOM: // Invalid pattern. - // Fall through. + // Fall through. default: return ""; } diff --git a/gapic-generator-java/src/main/java/com/google/api/generator/gapic/protoparser/MethodSignatureParser.java b/gapic-generator-java/src/main/java/com/google/api/generator/gapic/protoparser/MethodSignatureParser.java index f34a19a3d4..6f9c2df90c 100644 --- a/gapic-generator-java/src/main/java/com/google/api/generator/gapic/protoparser/MethodSignatureParser.java +++ b/gapic-generator-java/src/main/java/com/google/api/generator/gapic/protoparser/MethodSignatureParser.java @@ -215,8 +215,7 @@ private static Map parseTypeFromArgumentName( r -> r.type(), r -> // Contruct a new field using the parent resource. - field - .toBuilder() + field.toBuilder() .setResourceReference( ResourceReference.withType(r.resourceTypeString())) .build()))); diff --git a/gapic-generator-java/src/main/java/com/google/api/generator/gapic/protoparser/Parser.java b/gapic-generator-java/src/main/java/com/google/api/generator/gapic/protoparser/Parser.java index 35ba86dcc6..0ad6eec694 100644 --- a/gapic-generator-java/src/main/java/com/google/api/generator/gapic/protoparser/Parser.java +++ b/gapic-generator-java/src/main/java/com/google/api/generator/gapic/protoparser/Parser.java @@ -14,11 +14,18 @@ package com.google.api.generator.gapic.protoparser; +import com.google.api.ClientLibrarySettings; import com.google.api.ClientProto; import com.google.api.DocumentationRule; +import com.google.api.FieldBehavior; +import com.google.api.FieldBehaviorProto; +import com.google.api.FieldInfo.Format; +import com.google.api.FieldInfoProto; import com.google.api.HttpRule; +import com.google.api.MethodSettings; import com.google.api.ResourceDescriptor; import com.google.api.ResourceProto; +import com.google.api.SelectiveGapicGeneration; import com.google.api.generator.engine.ast.TypeNode; import com.google.api.generator.engine.ast.VaporReference; import com.google.api.generator.gapic.model.Field; @@ -46,6 +53,8 @@ import com.google.common.base.Strings; import com.google.common.collect.BiMap; import com.google.common.collect.HashBiMap; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; import com.google.common.collect.ImmutableSet; import com.google.common.collect.Maps; import com.google.longrunning.OperationInfo; @@ -72,14 +81,27 @@ import java.util.HashSet; import java.util.List; import java.util.Map; +import java.util.Map.Entry; import java.util.Objects; import java.util.Optional; import java.util.Set; import java.util.function.Function; +import java.util.logging.Level; +import java.util.logging.Logger; import java.util.stream.Collectors; import java.util.stream.IntStream; public class Parser { + enum SelectiveGapicType { + // Methods will be generated and exposed externally as usual. + PUBLIC, + // Methods will not be generated. + HIDDEN, + // Methods will be generated and tagged @InternalApi (internal use) during generation. + INTERNAL + } + + private static final Logger LOGGER = Logger.getLogger(Parser.class.getName()); private static final String COMMA = ","; private static final String COLON = ":"; private static final String DEFAULT_PORT = "443"; @@ -99,6 +121,16 @@ public class Parser { private static final Set MIXIN_JAVA_PACKAGE_ALLOWLIST = ImmutableSet.of("com.google.iam.v1", "com.google.longrunning", "com.google.cloud.location"); + // List of BigQuery methods that can use max_result field as an alternative to page_size for + // pagination. + private static final ImmutableSet BIGQUERY_LEGACY_PAGINATION_ALLOWLIST = + ImmutableSet.of( + "google.cloud.bigquery.v2.JobService.ListJobs", + "google.cloud.bigquery.v2.RoutineService.ListRoutines", + "google.cloud.bigquery.v2.DatasetService.ListDatasets", + "google.cloud.bigquery.v2.ModelService.ListModels", + "google.cloud.bigquery.v2.TableService.ListTables"); + // Allow other parsers to access this. protected static final SourceCodeInfoParser SOURCE_CODE_INFO_PARSER = new SourceCodeInfoParser(); @@ -118,6 +150,8 @@ public static GapicContext parse(CodeGeneratorRequest request) { Optional languageSettingsOpt = GapicLanguageSettingsParser.parse(gapicYamlConfigPathOpt); Optional transportOpt = PluginArgumentParser.parseTransport(request); + Optional repoOpt = PluginArgumentParser.parseRepo(request); + Optional artifactOpt = PluginArgumentParser.parseArtifact(request); boolean willGenerateMetadata = PluginArgumentParser.hasMetadataFlag(request); boolean willGenerateNumericEnum = PluginArgumentParser.hasNumericEnumFlag(request); @@ -149,11 +183,11 @@ public static GapicContext parse(CodeGeneratorRequest request) { messages = updateResourceNamesInMessages(messages, resourceNames.values()); // Contains only resource names that are actually used. Usage refers to the presence of a - // request message's field in an RPC's method_signature annotation. That is, resource name - // definitions - // or references that are simply defined, but not used in such a manner, will not have - // corresponding Java helper - // classes generated. + // request message's field in an RPC's method_signature annotation. That is, resource name + // definitions or references that are simply defined, but not used in such a manner, + // will not have corresponding Java helper classes generated. + // If selective api generation is configured via service yaml, Java helper classes are only + // generated if resource names are actually used by methods selected to generate. Set outputArgResourceNames = new HashSet<>(); List mixinServices = new ArrayList<>(); Transport transport = Transport.parse(transportOpt.orElse(Transport.GRPC.toString())); @@ -168,7 +202,10 @@ public static GapicContext parse(CodeGeneratorRequest request) { mixinServices, transport); - Preconditions.checkState(!services.isEmpty(), "No services found to generate"); + if (services.isEmpty()) { + LOGGER.warning("No services found to generate. This will cause a no-op (no files generated)"); + return GapicContext.EMPTY; + } // TODO(vam-google): Figure out whether we should keep this allowlist or bring // back the unused resource names for all APIs. @@ -218,6 +255,8 @@ public static GapicContext parse(CodeGeneratorRequest request) { .setServiceYamlProto(serviceYamlProtoOpt.orElse(null)) .setTransport(transport) .setRestNumericEnumsEnabled(willGenerateNumericEnum) + .setRepo(repoOpt.orElse(null)) + .setArtifact(artifactOpt.orElse(null)) .build(); } @@ -411,6 +450,81 @@ public static List parseService( Transport.GRPC); } + static SelectiveGapicType getMethodSelectiveGapicType( + MethodDescriptor method, + Optional serviceYamlProtoOpt, + String protoPackage) { + // default to include all when no service yaml or no library setting section. + if (!serviceYamlProtoOpt.isPresent() + || serviceYamlProtoOpt.get().getPublishing().getLibrarySettingsCount() == 0) { + return SelectiveGapicType.PUBLIC; + } + List librarySettingsList = + serviceYamlProtoOpt.get().getPublishing().getLibrarySettingsList(); + // Validate for logging purpose, this should be validated upstream. + // If library_settings.version does not match with proto package name + // Give warnings and disregard this config. default to include all. + if (!librarySettingsList.get(0).getVersion().isEmpty() + && !protoPackage.equals(librarySettingsList.get(0).getVersion())) { + if (LOGGER.isLoggable(Level.WARNING)) { + LOGGER.warning( + String.format( + "Service yaml config is misconfigured. Version in " + + "publishing.library_settings (%s) does not match proto package (%s)." + + "Disregarding selective generation settings.", + librarySettingsList.get(0).getVersion(), protoPackage)); + } + return SelectiveGapicType.PUBLIC; + } + // librarySettingsList is technically a list, but is processed upstream and + // only leave with 1 element. Otherwise, it is a misconfiguration and + // should be caught upstream. + SelectiveGapicGeneration selectiveGapicGenerationConfig = + librarySettingsList.get(0).getJavaSettings().getCommon().getSelectiveGapicGeneration(); + + List includeMethodsList = selectiveGapicGenerationConfig.getMethodsList(); + + Boolean generateOmittedAsInternal = + selectiveGapicGenerationConfig.getGenerateOmittedAsInternal(); + + // Set method to PUBLIC if no SelectiveGapicGeneration Configuration is configured and + // GenerateOmittedAsInternal is false. + if (includeMethodsList.isEmpty() && generateOmittedAsInternal == false) { + return SelectiveGapicType.PUBLIC; + } + + // Set method to PUBLIC if the method is in the allow list. + if (includeMethodsList.contains(method.getFullName())) { + return SelectiveGapicType.PUBLIC; + } + // Otherwise, generate this method as INTERNAL or HIDDEN based on GenerateOmittedAsInternal + // flag. + + return generateOmittedAsInternal ? SelectiveGapicType.INTERNAL : SelectiveGapicType.HIDDEN; + } + + // A service is considered empty if it contains no methods, or only methods marked as HIDDEN. + private static boolean isEmptyService( + ServiceDescriptor serviceDescriptor, + Optional serviceYamlProtoOpt, + String protoPackage) { + List methodsList = serviceDescriptor.getMethods(); + List methodListNotHidden = + methodsList.stream() + .filter( + method -> + getMethodSelectiveGapicType(method, serviceYamlProtoOpt, protoPackage) + != SelectiveGapicType.HIDDEN) + .collect(Collectors.toList()); + if (methodListNotHidden.isEmpty()) { + LOGGER.log( + Level.WARNING, + "Service {0} has no public or internal RPC methods and will not be generated", + serviceDescriptor.getName()); + } + return methodListNotHidden.isEmpty(); + } + public static List parseService( FileDescriptor fileDescriptor, Map messageTypes, @@ -419,8 +533,11 @@ public static List parseService( Optional serviceConfigOpt, Set outputArgResourceNames, Transport transport) { - + String protoPackage = fileDescriptor.getPackage(); return fileDescriptor.getServices().stream() + .filter( + serviceDescriptor -> + !isEmptyService(serviceDescriptor, serviceYamlProtoOpt, protoPackage)) .map( s -> { // Workaround for a missing default_host and oauth_scopes annotation from a service @@ -463,11 +580,18 @@ public static List parseService( } } + if (serviceOptions.hasExtension(ClientProto.apiVersion)) { + String apiVersion = serviceOptions.getExtension(ClientProto.apiVersion); + serviceBuilder.setApiVersion(apiVersion); + } + String serviceName = s.getName(); String overriddenServiceName = serviceName; String pakkage = TypeParser.getPackage(fileDescriptor); String originalJavaPackage = pakkage; // Override Java package with that specified in gapic.yaml. + // this override is deprecated and legacy support only + // see go/client-user-guide#configure-long-running-operation-polling-timeouts-optional if (serviceConfigOpt.isPresent() && serviceConfigOpt.get().getLanguageSettingsOpt().isPresent()) { GapicLanguageSettings languageSettings = @@ -488,10 +612,12 @@ public static List parseService( .setMethods( parseMethods( s, + protoPackage, pakkage, messageTypes, resourceNames, serviceConfigOpt, + serviceYamlProtoOpt, outputArgResourceNames, transport)) .build(); @@ -554,21 +680,20 @@ private static Map parseMessages( List outerNestedTypes) { Map messages = new HashMap<>(); String messageName = messageDescriptor.getName(); - if (!messageDescriptor.getNestedTypes().isEmpty()) { - for (Descriptor nestedMessage : messageDescriptor.getNestedTypes()) { - if (isMapType(nestedMessage)) { - continue; - } - List currentNestedTypes = new ArrayList<>(outerNestedTypes); - currentNestedTypes.add(messageName); - messages.putAll( - parseMessages(nestedMessage, outputResourceReferencesSeen, currentNestedTypes)); + + for (Descriptor nestedMessage : messageDescriptor.getNestedTypes()) { + if (isMapType(nestedMessage)) { + continue; } + List currentNestedTypes = new ArrayList<>(outerNestedTypes); + currentNestedTypes.add(messageName); + messages.putAll( + parseMessages(nestedMessage, outputResourceReferencesSeen, currentNestedTypes)); } TypeNode messageType = TypeParser.parseType(messageDescriptor); List fields = messageDescriptor.getFields(); - HashMap operationRequestFields = new HashMap(); + HashMap operationRequestFields = new HashMap<>(); BiMap operationResponseFields = HashBiMap.create(); OperationResponse.Builder operationResponse = null; for (FieldDescriptor fd : fields) { @@ -598,9 +723,16 @@ private static Map parseMessages( } } } + + List nestedEnums = + messageDescriptor.getEnumTypes().stream() + .map(EnumDescriptor::getName) + .collect(ImmutableList.toImmutableList()); + messages.put( messageType.reference().fullName(), Message.builder() + .setNestedEnums(nestedEnums) .setType(messageType) .setName(messageName) .setFullProtoName(messageDescriptor.getFullName()) @@ -672,14 +804,26 @@ public static Map parseResourceNames( @VisibleForTesting static List parseMethods( ServiceDescriptor serviceDescriptor, + String protoPackage, String servicePackage, Map messageTypes, Map resourceNames, Optional serviceConfigOpt, + Optional serviceYamlProtoOpt, Set outputArgResourceNames, Transport transport) { List methods = new ArrayList<>(); + + // Parse the serviceYaml for autopopulated methods and fields once and put into a map + Map> autoPopulatedMethodsWithFields = + parseAutoPopulatedMethodsAndFields(serviceYamlProtoOpt); for (MethodDescriptor protoMethod : serviceDescriptor.getMethods()) { + SelectiveGapicType methodSelectiveGapicType = + getMethodSelectiveGapicType(protoMethod, serviceYamlProtoOpt, protoPackage); + // Skip generation for methods marked as HIDDEN + if (methodSelectiveGapicType == SelectiveGapicType.HIDDEN) { + continue; + } // Parse the method. TypeNode inputType = TypeParser.parseType(protoMethod.getInputType()); Method.Builder methodBuilder = Method.builder(); @@ -692,6 +836,12 @@ static List parseMethods( } } + // Associate the autopopulated fields with the correct method + List autoPopulatedFields = new ArrayList<>(); + if (autoPopulatedMethodsWithFields.containsKey(protoMethod.getFullName())) { + autoPopulatedFields = autoPopulatedMethodsWithFields.get(protoMethod.getFullName()); + } + boolean isDeprecated = false; if (protoMethod.getOptions().hasDeprecated()) { isDeprecated = protoMethod.getOptions().getDeprecated(); @@ -724,6 +874,7 @@ static List parseMethods( .setName(protoMethod.getName()) .setInputType(inputType) .setOutputType(TypeParser.parseType(protoMethod.getOutputType())) + .setIsInternalApi(methodSelectiveGapicType == SelectiveGapicType.INTERNAL) .setStream( Method.toStream(protoMethod.isClientStreaming(), protoMethod.isServerStreaming())) .setLro(parseLro(servicePackage, protoMethod, messageTypes)) @@ -736,6 +887,7 @@ static List parseMethods( resourceNames, outputArgResourceNames)) .setHttpBindings(httpBindings) + .setAutoPopulatedFields(autoPopulatedFields) .setRoutingHeaderRule(routingHeaderRule) .setIsBatching(isBatching) .setPageSizeFieldName(parsePageSizeFieldName(protoMethod, messageTypes, transport)) @@ -780,6 +932,21 @@ static List parseMethods( return methods; } + private static String fetchTypeFullName(String typeName, MethodDescriptor methodDescriptor) { + // When provided type name is fully qualified, return as-is + // When only shortname is provided, assume same proto package as method (See + // https://aip.dev/151) + int lastDotIndex = typeName.lastIndexOf('.'); + boolean isResponseTypeNameShortOnly = lastDotIndex < 0; + String responseTypeShortName = + lastDotIndex >= 0 ? typeName.substring(lastDotIndex + 1) : typeName; + String typeFullName = + isResponseTypeNameShortOnly + ? methodDescriptor.getFile().getPackage() + "." + responseTypeShortName + : typeName; + return typeFullName; + } + @VisibleForTesting static LongrunningOperation parseLro( String servicePackage, MethodDescriptor methodDescriptor, Map messageTypes) { @@ -820,43 +987,19 @@ static LongrunningOperation parseLro( Message responseMessage = null; Message metadataMessage = null; - int lastDotIndex = responseTypeName.lastIndexOf('.'); - boolean isResponseTypeNameShortOnly = lastDotIndex < 0; - String responseTypeShortName = - lastDotIndex >= 0 ? responseTypeName.substring(lastDotIndex + 1) : responseTypeName; - - lastDotIndex = metadataTypeName.lastIndexOf('.'); - boolean isMetadataTypeNameShortOnly = lastDotIndex < 0; - String metadataTypeShortName = - lastDotIndex >= 0 ? metadataTypeName.substring(lastDotIndex + 1) : metadataTypeName; + String responseTypeFullName = fetchTypeFullName(responseTypeName, methodDescriptor); + String metadataTypeFullName = fetchTypeFullName(metadataTypeName, methodDescriptor); // The messageTypes map keys to the Java fully-qualified name. for (Map.Entry messageEntry : messageTypes.entrySet()) { - String messageKey = messageEntry.getKey(); - int messageLastDotIndex = messageEntry.getKey().lastIndexOf('.'); - String messageShortName = - messageLastDotIndex >= 0 ? messageKey.substring(messageLastDotIndex + 1) : messageKey; - if (responseMessage == null) { - if (isResponseTypeNameShortOnly && responseTypeName.equals(messageShortName)) { - responseMessage = messageEntry.getValue(); - } else if (!isResponseTypeNameShortOnly && responseTypeShortName.equals(messageShortName)) { - // Ensure that the full proto name matches. - Message candidateMessage = messageEntry.getValue(); - if (candidateMessage.fullProtoName().equals(responseTypeName)) { - responseMessage = candidateMessage; - } - } + Message candidateMessage = messageEntry.getValue(); + if (responseMessage == null + && candidateMessage.fullProtoName().equals(responseTypeFullName)) { + responseMessage = candidateMessage; } - if (metadataMessage == null) { - if (isMetadataTypeNameShortOnly && metadataTypeName.equals(messageShortName)) { - metadataMessage = messageEntry.getValue(); - } else if (!isMetadataTypeNameShortOnly && metadataTypeShortName.equals(messageShortName)) { - // Ensure that the full proto name matches. - Message candidateMessage = messageEntry.getValue(); - if (candidateMessage.fullProtoName().equals(metadataTypeName)) { - metadataMessage = candidateMessage; - } - } + if (metadataMessage == null + && candidateMessage.fullProtoName().equals(metadataTypeFullName)) { + metadataMessage = candidateMessage; } } @@ -900,7 +1043,8 @@ static String parsePageSizeFieldName( // page_size gets priority over max_results if both are present List fieldNames = new ArrayList<>(); fieldNames.add("page_size"); - if (transport == Transport.REST) { + if ((transport == Transport.REST) + || (BIGQUERY_LEGACY_PAGINATION_ALLOWLIST.contains(methodDescriptor.getFullName()))) { fieldNames.add("max_results"); } for (String fieldName : fieldNames) { @@ -972,6 +1116,8 @@ private static Field parseField( FieldOptions fieldOptions = fieldDescriptor.getOptions(); MessageOptions messageOptions = messageDescriptor.getOptions(); ResourceReference resourceReference = null; + boolean isRequired = false; + Format fieldInfoFormat = null; if (fieldOptions.hasExtension(ResourceProto.resourceReference)) { com.google.api.ResourceReference protoResourceReference = fieldOptions.getExtension(ResourceProto.resourceReference); @@ -1002,6 +1148,19 @@ private static Field parseField( } } + if (fieldOptions.hasExtension(FieldInfoProto.fieldInfo)) { + fieldInfoFormat = fieldOptions.getExtension(FieldInfoProto.fieldInfo).getFormat(); + } + + // Cannot directly check fieldOptions.hasExtension(FieldBehaviorProto.fieldBehavior) because the + // default is null + if (fieldOptions.getExtensionCount(FieldBehaviorProto.fieldBehavior) > 0 + && fieldOptions + .getExtension(FieldBehaviorProto.fieldBehavior) + .contains(FieldBehavior.REQUIRED)) { + isRequired = true; + } + Field.Builder fieldBuilder = Field.builder(); if (fieldDescriptor.getFile().toProto().hasSourceCodeInfo()) { SourceCodeInfoLocation protoFieldLocation = @@ -1025,13 +1184,13 @@ private static Field parseField( .setType(TypeParser.parseType(fieldDescriptor)) .setIsMessage(fieldDescriptor.getJavaType() == FieldDescriptor.JavaType.MESSAGE) .setIsEnum(fieldDescriptor.getJavaType() == FieldDescriptor.JavaType.ENUM) - .setIsContainedInOneof( - fieldDescriptor.getContainingOneof() != null - && !fieldDescriptor.getContainingOneof().isSynthetic()) + .setIsContainedInOneof(fieldDescriptor.getRealContainingOneof() != null) .setIsProto3Optional( fieldDescriptor.getContainingOneof() != null - && fieldDescriptor.getContainingOneof().isSynthetic()) + && fieldDescriptor.getRealContainingOneof() == null) .setIsRepeated(fieldDescriptor.isRepeated()) + .setIsRequired(isRequired) + .setFieldInfoFormat(fieldInfoFormat) .setIsMap(fieldDescriptor.isMapField()) .setResourceReference(resourceReference) .build(); @@ -1064,7 +1223,8 @@ private static Map getFilesToGenerate(CodeGeneratorReque return fileDescriptors; } - private static String parseServiceJavaPackage(CodeGeneratorRequest request) { + @VisibleForTesting + static String parseServiceJavaPackage(CodeGeneratorRequest request) { Map javaPackageCount = new HashMap<>(); Map fileDescriptors = getFilesToGenerate(request); for (String fileToGenerate : request.getFileToGenerateList()) { @@ -1097,13 +1257,12 @@ private static String parseServiceJavaPackage(CodeGeneratorRequest request) { processedJavaPackageCount = javaPackageCount; } - String finalJavaPackage = - processedJavaPackageCount.entrySet().stream() - .max(Map.Entry.comparingByValue()) - .get() - .getKey(); - Preconditions.checkState( - !Strings.isNullOrEmpty(finalJavaPackage), "No service Java package found"); + String finalJavaPackage = ""; + Optional> finalPackageEntry = + processedJavaPackageCount.entrySet().stream().max(Map.Entry.comparingByValue()); + if (finalPackageEntry.isPresent()) { + finalJavaPackage = finalPackageEntry.get().getKey(); + } return finalJavaPackage; } @@ -1126,4 +1285,25 @@ static String parseNestedProtoTypeName(String fullyQualifiedName) { .collect(Collectors.toList()); return String.join(".", nestedTypeComponents); } + + /** + * Converts a serviceYaml file to a map of methods and autopopulated fields. Note: this does NOT + * currently support wildcards in MethodSettings.selectors. + */ + @VisibleForTesting + static Map> parseAutoPopulatedMethodsAndFields( + Optional serviceYamlProtoOpt) { + if (!hasMethodSettings(serviceYamlProtoOpt)) { + return ImmutableMap.>builder().build(); + } + return serviceYamlProtoOpt.get().getPublishing().getMethodSettingsList().stream() + .collect( + Collectors.toMap( + MethodSettings::getSelector, MethodSettings::getAutoPopulatedFieldsList)); + } + + @VisibleForTesting + static boolean hasMethodSettings(Optional serviceYamlProtoOpt) { + return serviceYamlProtoOpt.isPresent() && serviceYamlProtoOpt.get().hasPublishing(); + } } diff --git a/gapic-generator-java/src/main/java/com/google/api/generator/gapic/protoparser/PluginArgumentParser.java b/gapic-generator-java/src/main/java/com/google/api/generator/gapic/protoparser/PluginArgumentParser.java index f56e0621a9..365ade22e0 100644 --- a/gapic-generator-java/src/main/java/com/google/api/generator/gapic/protoparser/PluginArgumentParser.java +++ b/gapic-generator-java/src/main/java/com/google/api/generator/gapic/protoparser/PluginArgumentParser.java @@ -32,6 +32,8 @@ public class PluginArgumentParser { @VisibleForTesting static final String KEY_NUMERIC_ENUM = "rest-numeric-enums"; @VisibleForTesting static final String KEY_SERVICE_YAML_CONFIG = "api-service-config"; @VisibleForTesting static final String KEY_TRANSPORT = "transport"; + @VisibleForTesting static final String KEY_REPO = "repo"; + @VisibleForTesting static final String KEY_ARTIFACT = "artifact"; private static final String JSON_FILE_ENDING = "grpc_service_config.json"; private static final String GAPIC_YAML_FILE_ENDING = "gapic.yaml"; @@ -53,6 +55,14 @@ static Optional parseTransport(CodeGeneratorRequest request) { return parseConfigArgument(request.getParameter(), KEY_TRANSPORT); } + static Optional parseRepo(CodeGeneratorRequest request) { + return parseConfigArgument(request.getParameter(), KEY_REPO); + } + + static Optional parseArtifact(CodeGeneratorRequest request) { + return parseConfigArgument(request.getParameter(), KEY_ARTIFACT); + } + static boolean hasMetadataFlag(CodeGeneratorRequest request) { return hasFlag(request.getParameter(), KEY_METADATA); } diff --git a/gapic-generator-java/src/main/java/com/google/api/generator/gapic/protoparser/ServiceYamlParser.java b/gapic-generator-java/src/main/java/com/google/api/generator/gapic/protoparser/ServiceYamlParser.java index 5b136b897f..cb0030d123 100644 --- a/gapic-generator-java/src/main/java/com/google/api/generator/gapic/protoparser/ServiceYamlParser.java +++ b/gapic-generator-java/src/main/java/com/google/api/generator/gapic/protoparser/ServiceYamlParser.java @@ -27,6 +27,7 @@ import java.util.LinkedHashMap; import java.util.Map; import java.util.Optional; +import org.yaml.snakeyaml.LoaderOptions; import org.yaml.snakeyaml.Yaml; import org.yaml.snakeyaml.constructor.SafeConstructor; @@ -44,7 +45,7 @@ public static Optional parse(String serviceYamlFilePath) return Optional.empty(); } - Yaml yaml = new Yaml(new SafeConstructor()); + Yaml yaml = new Yaml(new SafeConstructor(new LoaderOptions())); Map yamlMap = yaml.load(fileContents); Gson gson = new GsonBuilder().setPrettyPrinting().setLenient().create(); String jsonString = gson.toJson(yamlMap, LinkedHashMap.class); diff --git a/gapic-generator-java/src/main/java/com/google/api/generator/gapic/protowriter/Writer.java b/gapic-generator-java/src/main/java/com/google/api/generator/gapic/protowriter/Writer.java index 35f9f21fdb..79c9cbf349 100644 --- a/gapic-generator-java/src/main/java/com/google/api/generator/gapic/protowriter/Writer.java +++ b/gapic-generator-java/src/main/java/com/google/api/generator/gapic/protowriter/Writer.java @@ -21,7 +21,11 @@ import com.google.api.generator.gapic.model.GapicClass; import com.google.api.generator.gapic.model.GapicContext; import com.google.api.generator.gapic.model.GapicPackageInfo; +import com.google.api.generator.gapic.model.ReflectConfig; import com.google.api.generator.gapic.model.Sample; +import com.google.common.annotations.VisibleForTesting; +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; import com.google.protobuf.ByteString; import com.google.protobuf.compiler.PluginProtos.CodeGeneratorResponse; import com.google.protobuf.util.JsonFormat; @@ -32,43 +36,44 @@ import java.util.jar.JarOutputStream; public class Writer { - static class GapicWriterException extends RuntimeException { - public GapicWriterException(String errorMessage) { - super(errorMessage); - } + static class GapicWriterException extends RuntimeException { public GapicWriterException(String errorMessage, Throwable cause) { super(errorMessage, cause); } } - public static CodeGeneratorResponse write( + public static final CodeGeneratorResponse EMPTY_RESPONSE = null; + + @VisibleForTesting + protected static CodeGeneratorResponse write( GapicContext context, List clazzes, GapicPackageInfo gapicPackageInfo, - String outputFilePath) { - ByteString.Output output = ByteString.newOutput(); + List reflectConfigInfo, + String outputFilePath, + JarOutputStream jos, + ByteString.Output output) + throws IOException { JavaWriterVisitor codeWriter = new JavaWriterVisitor(); - JarOutputStream jos; - try { - jos = new JarOutputStream(output); - } catch (IOException e) { - throw new GapicWriterException(e.getMessage(), e); + + if (!context.containsServices()) { + return EMPTY_RESPONSE; } for (GapicClass gapicClazz : clazzes) { + if (gapicClazz.kind() == GapicClass.Kind.NON_GENERATED) { + continue; + } String classPath = writeClazz(gapicClazz, codeWriter, jos); writeSamples(gapicClazz, getSamplePackage(gapicClazz), classPath, jos); } writeMetadataFile(context, writePackageInfo(gapicPackageInfo, codeWriter, jos), jos); + writeReflectConfigFile(gapicPackageInfo.packageInfo().pakkage(), reflectConfigInfo, jos); - try { - jos.finish(); - jos.flush(); - } catch (IOException e) { - throw new GapicWriterException(e.getMessage(), e); - } + jos.finish(); + jos.flush(); CodeGeneratorResponse.Builder response = CodeGeneratorResponse.newBuilder(); response @@ -79,6 +84,53 @@ public static CodeGeneratorResponse write( return response.build(); } + public static CodeGeneratorResponse write( + GapicContext context, + List clazzes, + GapicPackageInfo gapicPackageInfo, + List reflectConfigInfo, + String outputFilePath) { + ByteString.Output output = ByteString.newOutput(); + CodeGeneratorResponse response; + try (JarOutputStream jos = new JarOutputStream(output)) { + response = + write(context, clazzes, gapicPackageInfo, reflectConfigInfo, outputFilePath, jos, output); + } catch (IOException e) { + throw new GapicWriterException(e.getMessage(), e); + } + return response; + } + + @VisibleForTesting + static void writeReflectConfigFile( + String pakkage, List reflectConfigInfo, JarOutputStream jos) { + if (reflectConfigInfo.isEmpty()) { + return; + } + Gson prettyGson = new GsonBuilder().setPrettyPrinting().create(); + + // This path does not follow the recommended native-image subdirectory structure defined by + // https://www.graalvm.org/22.1/reference-manual/native-image/BuildConfiguration/#embedding-a-configuration-file + // + // The recommended subdirectory is .../native-image///reflect-config.json + // to prevent multiple jars from having overlapping configurations when combined into the same + // native-image. However, we don't have access to the client library's groupId and artifactId in + // the GAPIC generator, and we're only providing a single reflection configuration per client + // library. So this package-based path is "unique enough" for our current use. + // + // TODO: If we begin splitting the reflection configuration into gapic-specific, grpc-specific, + // and proto-specific files, we will need to prevent collisions by either following the + // recommended subdirectory structure, or adding a gapic/grpc/proto identifier to this path. + String jarEntryLocation = + String.format("src/main/resources/META-INF/native-image/%s/reflect-config.json", pakkage); + try { + jos.putNextEntry(new JarEntry(jarEntryLocation)); + jos.write(prettyGson.toJson(reflectConfigInfo).getBytes(StandardCharsets.UTF_8)); + } catch (IOException e) { + throw new GapicWriterException("Could not write reflect-config.json", e); + } + } + private static String writeClazz( GapicClass gapicClazz, JavaWriterVisitor codeWriter, JarOutputStream jos) { ClassDefinition clazz = gapicClazz.classDefinition(); @@ -128,7 +180,8 @@ private static void writeSamples( } } - private static String writePackageInfo( + @VisibleForTesting + static String writePackageInfo( GapicPackageInfo gapicPackageInfo, JavaWriterVisitor codeWriter, JarOutputStream jos) { PackageInfoDefinition packageInfo = gapicPackageInfo.packageInfo(); packageInfo.accept(codeWriter); diff --git a/gapic-generator-java/src/main/java/com/google/api/generator/gapic/utils/JavaStyle.java b/gapic-generator-java/src/main/java/com/google/api/generator/gapic/utils/JavaStyle.java index d99777bcd2..5c1be0aff8 100644 --- a/gapic-generator-java/src/main/java/com/google/api/generator/gapic/utils/JavaStyle.java +++ b/gapic-generator-java/src/main/java/com/google/api/generator/gapic/utils/JavaStyle.java @@ -39,7 +39,7 @@ public static String toLowerCamelCase(String s) { // Some APIs use legit java keywords as method names. Both protobuf and gGRPC add an underscore // in generated stubs to resolve name conflict, so we need to do the same. - return Keyword.isKeyword(name) ? name + '_' : name; + return Keyword.escapeKeyword(name); } public static String toUpperCamelCase(String s) { diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/engine/JavaCodeGeneratorTest.java b/gapic-generator-java/src/test/java/com/google/api/generator/engine/JavaCodeGeneratorTest.java index 3bbc0808de..f759fec870 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/engine/JavaCodeGeneratorTest.java +++ b/gapic-generator-java/src/test/java/com/google/api/generator/engine/JavaCodeGeneratorTest.java @@ -50,7 +50,7 @@ import com.google.api.generator.engine.ast.WhileStatement; import com.google.api.generator.engine.writer.JavaWriterVisitor; import com.google.api.generator.test.framework.Assert; -import com.google.api.generator.test.framework.Utils; +import com.google.api.generator.test.framework.GoldenFileWriter; import java.io.FileWriter; import java.io.IOException; import java.nio.file.Path; @@ -60,9 +60,9 @@ import java.util.HashMap; import java.util.List; import java.util.Stack; -import org.junit.Test; +import org.junit.jupiter.api.Test; -public class JavaCodeGeneratorTest { +class JavaCodeGeneratorTest { private static final String GOLDENFILES_DIRECTORY = "src/test/java/com/google/api/generator/engine/goldens/"; @@ -101,7 +101,7 @@ public class JavaCodeGeneratorTest { private static final Variable bookKindVar = createVarFromVaporRef(bookKindRef, "bookKind"); @Test - public void validJavaClass() { + void validJavaClass() { // Create outer class variableDecls. // [code] private static final String serviceName = "LibraryServiceStub"; VariableExpr serviceName = createServiceNameVarExpr(); @@ -174,7 +174,7 @@ public void validJavaClass() { .build(); JavaWriterVisitor javaWriterVisitor = new JavaWriterVisitor(); libraryServiceStubClass.accept(javaWriterVisitor); - Utils.saveCodegenToFile( + GoldenFileWriter.saveCodegenToFile( this.getClass(), "JavaCodeGeneratorTest.golden", javaWriterVisitor.write()); Path goldenFilePath = Paths.get(GOLDENFILES_DIRECTORY, "JavaCodeGeneratorTest.golden"); Assert.assertCodeEquals(goldenFilePath, javaWriterVisitor.write()); diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/engine/ast/AnonymousClassExprTest.java b/gapic-generator-java/src/test/java/com/google/api/generator/engine/ast/AnonymousClassExprTest.java index 9fab46d98d..cfdbbfe6f2 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/engine/ast/AnonymousClassExprTest.java +++ b/gapic-generator-java/src/test/java/com/google/api/generator/engine/ast/AnonymousClassExprTest.java @@ -20,11 +20,11 @@ import com.google.common.base.Function; import java.util.Arrays; -import org.junit.Test; +import org.junit.jupiter.api.Test; -public class AnonymousClassExprTest { +class AnonymousClassExprTest { @Test - public void validAnonymousClass_basic() { + void validAnonymousClass_basic() { ConcreteReference ref = ConcreteReference.withClazz(Runnable.class); TypeNode type = TypeNode.withReference(ref); AssignmentExpr assignmentExpr = createAssignmentExpr("foobar", "false", TypeNode.BOOLEAN); @@ -45,7 +45,7 @@ public void validAnonymousClass_basic() { } @Test - public void validAnonymousClass_genericAndVariableExpr() { + void validAnonymousClass_genericAndVariableExpr() { // [Constructing] new Function() ConcreteReference ref = ConcreteReference.builder() @@ -100,14 +100,14 @@ public void validAnonymousClass_genericAndVariableExpr() { } @Test - public void invalidAnonymousClass_primitiveType() { + void invalidAnonymousClass_primitiveType() { assertThrows( IllegalStateException.class, () -> AnonymousClassExpr.builder().setType(TypeNode.INT).build()); } @Test - public void invalidAnonymousClass_staticMethod() { + void invalidAnonymousClass_staticMethod() { ConcreteReference ref = ConcreteReference.withClazz(Runnable.class); TypeNode type = TypeNode.withReference(ref); MethodDefinition method = @@ -127,7 +127,7 @@ public void invalidAnonymousClass_staticMethod() { } @Test - public void invalidAnonymousClass_explicitConstructor() { + void invalidAnonymousClass_explicitConstructor() { TypeNode type = TypeNode.withReference(ConcreteReference.withClazz(Runnable.class)); TypeNode returnType = TypeNode.withReference( @@ -143,7 +143,7 @@ public void invalidAnonymousClass_explicitConstructor() { } @Test - public void invalidAnonymousClass_staticVariableExpr() { + void invalidAnonymousClass_staticVariableExpr() { ConcreteReference ref = ConcreteReference.withClazz(Runnable.class); TypeNode type = TypeNode.withReference(ref); Variable variable = createVariable("s", TypeNode.STRING); diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/engine/ast/ArithmeticOperationExprTest.java b/gapic-generator-java/src/test/java/com/google/api/generator/engine/ast/ArithmeticOperationExprTest.java index 4505064472..d19a117974 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/engine/ast/ArithmeticOperationExprTest.java +++ b/gapic-generator-java/src/test/java/com/google/api/generator/engine/ast/ArithmeticOperationExprTest.java @@ -16,11 +16,11 @@ import static org.junit.Assert.assertThrows; -import org.junit.Test; +import org.junit.jupiter.api.Test; -public class ArithmeticOperationExprTest { +class ArithmeticOperationExprTest { @Test - public void concatOperator_validBasic() { + void concatOperator_validBasic() { // valid type-checking for x + getSomeString() VariableExpr lhsExpr = VariableExpr.withVariable(Variable.builder().setType(TypeNode.INT).setName("x").build()); @@ -34,7 +34,7 @@ public void concatOperator_validBasic() { } @Test - public void concatOperator_validWithNull() { + void concatOperator_validWithNull() { // Type-checking for String variable x and null object value. VariableExpr lhsExpr = VariableExpr.withVariable(Variable.builder().setType(TypeNode.STRING).setName("x").build()); @@ -44,7 +44,7 @@ public void concatOperator_validWithNull() { } @Test - public void concatOperator_validWithReferenceType() { + void concatOperator_validWithReferenceType() { // Type-checking for String variable x, Expr variable y. VariableExpr lhsExpr = VariableExpr.withVariable(Variable.builder().setType(TypeNode.STRING).setName("x").build()); @@ -59,7 +59,7 @@ public void concatOperator_validWithReferenceType() { } @Test - public void concatOperator_invalidVoidType() { + void concatOperator_invalidVoidType() { // throw exception if one of expr is void-type VariableExpr lhsExpr = VariableExpr.withVariable(Variable.builder().setType(TypeNode.STRING).setName("x").build()); @@ -74,7 +74,7 @@ public void concatOperator_invalidVoidType() { } @Test - public void concatString_invalidNonStringType() { + void concatString_invalidNonStringType() { // throw exception for concat usage if none of exprs is String-type VariableExpr lhsExpr = VariableExpr.withVariable(Variable.builder().setType(TypeNode.INT).setName("x").build()); diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/engine/ast/ArrayExprTest.java b/gapic-generator-java/src/test/java/com/google/api/generator/engine/ast/ArrayExprTest.java index 723c60ad4f..98ab1d876a 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/engine/ast/ArrayExprTest.java +++ b/gapic-generator-java/src/test/java/com/google/api/generator/engine/ast/ArrayExprTest.java @@ -17,19 +17,19 @@ import static com.google.common.truth.Truth.assertThat; import static org.junit.Assert.assertThrows; -import com.google.api.generator.util.TestUtils; -import org.junit.Test; +import com.google.api.generator.test.utils.TestExprBuilder; +import org.junit.jupiter.api.Test; -public class ArrayExprTest { +class ArrayExprTest { @Test - public void validAnonymousArray_sametype() { + void validAnonymousArray_sametype() { ArrayExpr.Builder exprBuilder = ArrayExpr.builder() .setType(TypeNode.createArrayTypeOf(TypeNode.STRING)) - .addExpr(TestUtils.generateStringValueExpr("test1")) - .addExpr(TestUtils.generateStringValueExpr("test2")) - .addExpr(TestUtils.generateStringValueExpr("test3")) + .addExpr(TestExprBuilder.generateStringValueExpr("test1")) + .addExpr(TestExprBuilder.generateStringValueExpr("test2")) + .addExpr(TestExprBuilder.generateStringValueExpr("test3")) .addExpr( ValueExpr.withValue( PrimitiveValue.builder().setValue("1").setType(TypeNode.INT).build())); @@ -41,7 +41,7 @@ public void validAnonymousArray_sametype() { } @Test - public void validAnonymousArray_unsetTypeThrows() { + void validAnonymousArray_unsetTypeThrows() { ArrayExpr.Builder exprBuilder = ArrayExpr.builder(); IllegalStateException thrown = assertThrows(IllegalStateException.class, () -> exprBuilder.build()); @@ -49,7 +49,7 @@ public void validAnonymousArray_unsetTypeThrows() { } @Test - public void validAnonymousArray_onlyVariableAndValueExprs() { + void validAnonymousArray_onlyVariableAndValueExprs() { ArrayExpr.Builder exprBuilder = ArrayExpr.builder().setType(TypeNode.createArrayTypeOf(TypeNode.INT)); Variable variable = Variable.builder().setName("x").setType(TypeNode.INT).build(); diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/engine/ast/AssignmentExprTest.java b/gapic-generator-java/src/test/java/com/google/api/generator/engine/ast/AssignmentExprTest.java index b40590f231..7e1cc421f7 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/engine/ast/AssignmentExprTest.java +++ b/gapic-generator-java/src/test/java/com/google/api/generator/engine/ast/AssignmentExprTest.java @@ -19,11 +19,11 @@ import java.util.ArrayList; import java.util.List; -import org.junit.Test; +import org.junit.jupiter.api.Test; -public class AssignmentExprTest { +class AssignmentExprTest { @Test - public void assignMatchingValue() { + void assignMatchingValue() { Variable variable = Variable.builder().setName("x").setType(TypeNode.INT).build(); VariableExpr variableExpr = VariableExpr.builder().setVariable(variable).setIsDecl(true).build(); @@ -35,7 +35,7 @@ public void assignMatchingValue() { } @Test - public void assignMismatchedValue() { + void assignMismatchedValue() { Variable variable = Variable.builder().setName("x").setType(TypeNode.BOOLEAN).build(); VariableExpr variableExpr = VariableExpr.builder().setVariable(variable).setIsDecl(true).build(); @@ -47,7 +47,7 @@ public void assignMismatchedValue() { } @Test - public void assignSubtypeValue() { + void assignSubtypeValue() { Variable variable = Variable.builder() .setName("x") @@ -66,7 +66,7 @@ public void assignSubtypeValue() { } @Test - public void assignMatchingVariable() { + void assignMatchingVariable() { Variable variable = Variable.builder().setName("x").setType(TypeNode.INT).build(); VariableExpr variableExpr = VariableExpr.builder().setVariable(variable).setIsDecl(true).build(); @@ -78,7 +78,7 @@ public void assignMatchingVariable() { } @Test - public void assignNullObjectValue() { + void assignNullObjectValue() { Variable variable = Variable.builder().setName("x").setType(TypeNode.STRING).build(); VariableExpr variableExpr = VariableExpr.builder().setVariable(variable).setIsDecl(true).build(); @@ -90,7 +90,7 @@ public void assignNullObjectValue() { } @Test - public void writeAssignmentExpr_nullObjectValuePrimitiveType() { + void writeAssignmentExpr_nullObjectValuePrimitiveType() { Variable variable = Variable.builder().setName("x").setType(TypeNode.INT).build(); VariableExpr variableExpr = VariableExpr.builder().setVariable(variable).setIsDecl(true).build(); @@ -102,7 +102,7 @@ public void writeAssignmentExpr_nullObjectValuePrimitiveType() { } @Test - public void writeAssignmentExpr_primitiveToBoxedType() { + void writeAssignmentExpr_primitiveToBoxedType() { // [Constructing] `Boolean x = (boolean) true` Variable variable = Variable.builder().setName("x").setType(TypeNode.BOOLEAN_OBJECT).build(); VariableExpr variableExpr = @@ -114,7 +114,7 @@ public void writeAssignmentExpr_primitiveToBoxedType() { } @Test - public void writeAssignmentExpr_boxedToPrimitiveType() { + void writeAssignmentExpr_boxedToPrimitiveType() { // [Constructing] `double x = (Double) y` Variable lVariable = Variable.builder().setName("x").setType(TypeNode.DOUBLE).build(); VariableExpr lVariableExpr = @@ -126,7 +126,7 @@ public void writeAssignmentExpr_boxedToPrimitiveType() { } @Test - public void writeAssignmentExpr_invalidBoxedPrimitiveType() { + void writeAssignmentExpr_invalidBoxedPrimitiveType() { // [Constructing] `double x = (Integer) y` Variable lVariable = Variable.builder().setName("x").setType(TypeNode.DOUBLE).build(); VariableExpr lVariableExpr = @@ -138,7 +138,7 @@ public void writeAssignmentExpr_invalidBoxedPrimitiveType() { } @Test - public void writeAssignmentExpr_validIsDeclFinalVariableExpr() { + void writeAssignmentExpr_validIsDeclFinalVariableExpr() { Variable lVariable = Variable.builder().setName("x").setType(TypeNode.INT).build(); VariableExpr lVariableExpr = VariableExpr.builder().setVariable(lVariable).setIsDecl(true).setIsFinal(true).build(); @@ -149,7 +149,7 @@ public void writeAssignmentExpr_validIsDeclFinalVariableExpr() { } @Test - public void writeAssignmentExpr_invalidIsNotDeclFinalVariableExpr() { + void writeAssignmentExpr_invalidIsNotDeclFinalVariableExpr() { Variable lVariable = Variable.builder().setName("x").setType(TypeNode.INT).build(); VariableExpr lVariableExpr = VariableExpr.builder().setVariable(lVariable).setIsDecl(false).setIsFinal(true).build(); diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/engine/ast/AssignmentOperationExprTest.java b/gapic-generator-java/src/test/java/com/google/api/generator/engine/ast/AssignmentOperationExprTest.java index 64a6077706..36216e40a6 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/engine/ast/AssignmentOperationExprTest.java +++ b/gapic-generator-java/src/test/java/com/google/api/generator/engine/ast/AssignmentOperationExprTest.java @@ -16,12 +16,12 @@ import static org.junit.Assert.assertThrows; -import org.junit.Test; +import org.junit.jupiter.api.Test; -public class AssignmentOperationExprTest { +class AssignmentOperationExprTest { /** ========= Multiply And Assignment Operators: VariableExpr is numeric types ============== */ @Test - public void validMultiplyAndAssignmentOperationExpr_numericMatched() { + void validMultiplyAndAssignmentOperationExpr_numericMatched() { // No need swap test case. VariableExpr lhsExpr = createVariableExpr(TypeNode.INT, "x"); VariableExpr rhsExpr = createVariableExpr(TypeNode.INT, "y"); @@ -30,7 +30,7 @@ public void validMultiplyAndAssignmentOperationExpr_numericMatched() { } @Test - public void validMultiplyAndAssignmentOperationExpr_numericUnmatched() { + void validMultiplyAndAssignmentOperationExpr_numericUnmatched() { // No need swap test case. VariableExpr lhsExpr = createVariableExpr(TypeNode.INT, "x"); ValueExpr rhsExpr = createValueExpr(TypeNode.INT, "5"); @@ -39,7 +39,7 @@ public void validMultiplyAndAssignmentOperationExpr_numericUnmatched() { } @Test - public void validMultiplyAndAssignmentOperationExpr_numericMatchedBoxedType() { + void validMultiplyAndAssignmentOperationExpr_numericMatchedBoxedType() { // Swap test case in "validMultiplyAndAssignmentOperationExpr_integerMatchedBoxedType". VariableExpr lhsExpr = createVariableExpr(TypeNode.INT, "x"); VariableExpr rhsExpr = createVariableExpr(TypeNode.INT_OBJECT, "y"); @@ -48,7 +48,7 @@ public void validMultiplyAndAssignmentOperationExpr_numericMatchedBoxedType() { } @Test - public void validMultiplyAndAssignmentOperationExpr_numericUnmatchedBoxedType() { + void validMultiplyAndAssignmentOperationExpr_numericUnmatchedBoxedType() { // Swap test case in "validMultiplyAndAssignmentOperationExpr_integerBoxedWithShortType". VariableExpr lhsExpr = createVariableExpr(TypeNode.INT, "x"); VariableExpr rhsExpr = createVariableExpr(TypeNode.FLOAT_OBJECT, "y"); @@ -57,7 +57,7 @@ public void validMultiplyAndAssignmentOperationExpr_numericUnmatchedBoxedType() } @Test - public void validMultiplyAndAssignmentOperationExpr_numericWithFloatType() { + void validMultiplyAndAssignmentOperationExpr_numericWithFloatType() { // Swap test case in "validMultiplyAndAssignmentOperationExpr_integerBoxedWithFloatType". VariableExpr lhsExpr = createVariableExpr(TypeNode.FLOAT, "x"); VariableExpr rhsExpr = createVariableExpr(TypeNode.INT_OBJECT, "y"); @@ -66,7 +66,7 @@ public void validMultiplyAndAssignmentOperationExpr_numericWithFloatType() { } @Test - public void validMultiplyAndAssignmentOperationExpr_doubleWithIntegerBoxedType() { + void validMultiplyAndAssignmentOperationExpr_doubleWithIntegerBoxedType() { // Swap test case in "validMultiplyAndAssignmentOperationExpr_integerBoxedWithDoubleType". VariableExpr lhsExpr = createVariableExpr(TypeNode.DOUBLE, "x"); VariableExpr rhsExpr = createVariableExpr(TypeNode.INT_OBJECT, "y"); @@ -75,7 +75,7 @@ public void validMultiplyAndAssignmentOperationExpr_doubleWithIntegerBoxedType() } @Test - public void validMultiplyAndAssignmentOperationExpr_doubleWithLongBoxedType() { + void validMultiplyAndAssignmentOperationExpr_doubleWithLongBoxedType() { // Swap test case in "invalidMultiplyAndAssignmentOperationExpr_longBoxedWithDoubleType". VariableExpr lhsExpr = createVariableExpr(TypeNode.DOUBLE, "x"); VariableExpr rhsExpr = createVariableExpr(TypeNode.LONG_OBJECT, "y"); @@ -84,7 +84,7 @@ public void validMultiplyAndAssignmentOperationExpr_doubleWithLongBoxedType() { } @Test - public void validMultiplyAndAssignmentOperationExpr_longWithIntegerBoxedType() { + void validMultiplyAndAssignmentOperationExpr_longWithIntegerBoxedType() { // Swap test case in "invalidMultiplyAndAssignmentOperationExpr_integerBoxedWithLongType". VariableExpr lhsExpr = createVariableExpr(TypeNode.LONG, "x"); VariableExpr rhsExpr = createVariableExpr(TypeNode.INT_OBJECT, "y"); @@ -93,7 +93,7 @@ public void validMultiplyAndAssignmentOperationExpr_longWithIntegerBoxedType() { } @Test - public void validMultiplyAndAssignmentOperationExpr_integerWithFloatBoxedType() { + void validMultiplyAndAssignmentOperationExpr_integerWithFloatBoxedType() { // Swap test case in "validMultiplyAndAssignmentOperationExpr_floatBoxedWithIntegerType". VariableExpr lhsExpr = createVariableExpr(TypeNode.INT, "x"); VariableExpr rhsExpr = createVariableExpr(TypeNode.FLOAT_OBJECT, "y"); @@ -102,7 +102,7 @@ public void validMultiplyAndAssignmentOperationExpr_integerWithFloatBoxedType() } @Test - public void validMultiplyAndAssignmentOperationExpr_validFloatWithLongBoxedType() { + void validMultiplyAndAssignmentOperationExpr_validFloatWithLongBoxedType() { // Swap test case in "invalidMultiplyAndAssignmentOperationExpr_longBoxedWithFloatType". VariableExpr lhsExpr = createVariableExpr(TypeNode.FLOAT, "x"); VariableExpr rhsExpr = createVariableExpr(TypeNode.LONG_OBJECT, "y"); @@ -111,7 +111,7 @@ public void validMultiplyAndAssignmentOperationExpr_validFloatWithLongBoxedType( } @Test - public void invalidMultiplyAndAssignmentOperationExpr_numericWithBooleanBoxedType() { + void invalidMultiplyAndAssignmentOperationExpr_numericWithBooleanBoxedType() { // Swap test case in "invalidMultiplyAndAssignmentOperationExpr_booleanBoxedWithNumericType". VariableExpr lhsExpr = createVariableExpr(TypeNode.INT, "x"); VariableExpr rhsExpr = createVariableExpr(TypeNode.BOOLEAN_OBJECT, "y"); @@ -121,7 +121,7 @@ public void invalidMultiplyAndAssignmentOperationExpr_numericWithBooleanBoxedTyp } @Test - public void invalidMultiplyAndAssignmentOperationExpr_numericWithBooleanType() { + void invalidMultiplyAndAssignmentOperationExpr_numericWithBooleanType() { // Swap test case in "invalidMultiplyAndAssignmentOperationExpr_numericWithBooleanType". VariableExpr lhsExpr = createVariableExpr(TypeNode.INT, "x"); VariableExpr rhsExpr = createVariableExpr(TypeNode.BOOLEAN, "y"); @@ -131,7 +131,7 @@ public void invalidMultiplyAndAssignmentOperationExpr_numericWithBooleanType() { } @Test - public void invalidMultiplyAndAssignmentOperationExpr_numericWithReferenceType() { + void invalidMultiplyAndAssignmentOperationExpr_numericWithReferenceType() { // Swap test case in "invalidMultiplyAndAssignmentOperationExpr_referencedWithNumericType". VariableExpr lhsExpr = createVariableExpr(TypeNode.INT, "x"); VariableExpr rhsExpr = createVariableExpr(TypeNode.STRING, "y"); @@ -141,7 +141,7 @@ public void invalidMultiplyAndAssignmentOperationExpr_numericWithReferenceType() } @Test - public void invalidMultiplyAndAssignmentOperationExpr_NumericWithNewObject() { + void invalidMultiplyAndAssignmentOperationExpr_NumericWithNewObject() { // No Need swap case. VariableExpr lhsExpr = createVariableExpr(TypeNode.INT, "x"); NewObjectExpr rhsExpr = NewObjectExpr.withType(TypeNode.OBJECT); @@ -152,7 +152,7 @@ public void invalidMultiplyAndAssignmentOperationExpr_NumericWithNewObject() { /** ==== Multiply And Assignment Operators: LHS data type is boolean and its boxed type ===== */ @Test - public void invalidMultiplyAndAssignmentOperationExpr_booleanWithNumericType() { + void invalidMultiplyAndAssignmentOperationExpr_booleanWithNumericType() { // Swap test case in "invalidMultiplyAndAssignmentOperationExpr_numericWithBooleanType". VariableExpr lhsExpr = createVariableExpr(TypeNode.BOOLEAN, "x"); VariableExpr rhsExpr = createVariableExpr(TypeNode.INT, "y"); @@ -162,7 +162,7 @@ public void invalidMultiplyAndAssignmentOperationExpr_booleanWithNumericType() { } @Test - public void invalidMultiplyAndAssignmentOperationExpr_booleanBoxedWithNumericType() { + void invalidMultiplyAndAssignmentOperationExpr_booleanBoxedWithNumericType() { // Swap test case in "invalidMultiplyAndAssignmentOperationExpr_numericWithBooleanBoxedType". VariableExpr lhsExpr = createVariableExpr(TypeNode.BOOLEAN_OBJECT, "x"); ValueExpr rhsExpr = createValueExpr(TypeNode.INT, "5"); @@ -174,7 +174,7 @@ public void invalidMultiplyAndAssignmentOperationExpr_booleanBoxedWithNumericTyp /** ======== Multiply And Assignment Operators: LHS data type is Integer Box Type ============ */ // RHS should be int, char, short, byte or these types' boxed types. @Test - public void validMultiplyAndAssignmentOperationExpr_integerMatchedBoxedType() { + void validMultiplyAndAssignmentOperationExpr_integerMatchedBoxedType() { // Swap test case in "validMultiplyAndAssignmentOperationExpr_numericMatchedBoxedType". VariableExpr lhsExpr = createVariableExpr(TypeNode.INT_OBJECT, "x"); ValueExpr rhsExpr = createValueExpr(TypeNode.INT, "5"); @@ -183,7 +183,7 @@ public void validMultiplyAndAssignmentOperationExpr_integerMatchedBoxedType() { } @Test - public void validMultiplyAndAssignmentOperationExpr_integerBoxedWithShortType() { + void validMultiplyAndAssignmentOperationExpr_integerBoxedWithShortType() { // Swap test case in "validMultiplyAndAssignmentOperationExpr_numericUnmatchedBoxedType". VariableExpr lhsExpr = createVariableExpr(TypeNode.INT_OBJECT, "x"); VariableExpr rhsExpr = createVariableExpr(TypeNode.SHORT, "y"); @@ -192,7 +192,7 @@ public void validMultiplyAndAssignmentOperationExpr_integerBoxedWithShortType() } @Test - public void validMultiplyAndAssignmentOperationExpr_integerBoxedWithShortBoxedType() { + void validMultiplyAndAssignmentOperationExpr_integerBoxedWithShortBoxedType() { // Swap test case in "validMultiplyAndAssignmentOperationExpr_shortBoxedWithIntegerBoxedType". VariableExpr lhsExpr = createVariableExpr(TypeNode.INT_OBJECT, "x"); VariableExpr rhsExpr = createVariableExpr(TypeNode.SHORT_OBJECT, "y"); @@ -201,7 +201,7 @@ public void validMultiplyAndAssignmentOperationExpr_integerBoxedWithShortBoxedTy } @Test - public void validMultiplyAndAssignmentOperationExpr_integerBoxedWithCharacterBoxedType() { + void validMultiplyAndAssignmentOperationExpr_integerBoxedWithCharacterBoxedType() { // Swap test case in "validMultiplyAndAssignmentOperationExpr_shortBoxedWithIntegerBoxedType". VariableExpr lhsExpr = createVariableExpr(TypeNode.INT_OBJECT, "x"); VariableExpr rhsExpr = createVariableExpr(TypeNode.CHAR_OBJECT, "y"); @@ -210,7 +210,7 @@ public void validMultiplyAndAssignmentOperationExpr_integerBoxedWithCharacterBox } @Test - public void validMultiplyAndAssignmentOperationExpr_integerBoxedWithByteBoxedType() { + void validMultiplyAndAssignmentOperationExpr_integerBoxedWithByteBoxedType() { // Swap test case in "validMultiplyAndAssignmentOperationExpr_byteBoxedWithIntegerBoxedType". VariableExpr lhsExpr = createVariableExpr(TypeNode.INT_OBJECT, "x"); VariableExpr rhsExpr = createVariableExpr(TypeNode.BYTE_OBJECT, "y"); @@ -219,7 +219,7 @@ public void validMultiplyAndAssignmentOperationExpr_integerBoxedWithByteBoxedTyp } @Test - public void invalidMultiplyAndAssignmentOperationExpr_integerBoxedWithFloatType() { + void invalidMultiplyAndAssignmentOperationExpr_integerBoxedWithFloatType() { // Swap test case in "validMultiplyAndAssignmentOperationExpr_numericWithFloatType". VariableExpr lhsExpr = createVariableExpr(TypeNode.INT_OBJECT, "x"); VariableExpr rhsExpr = createVariableExpr(TypeNode.FLOAT, "y"); @@ -229,7 +229,7 @@ public void invalidMultiplyAndAssignmentOperationExpr_integerBoxedWithFloatType( } @Test - public void invalidMultiplyAndAssignmentOperationExpr_integerBoxedWithFloatBoxedType() { + void invalidMultiplyAndAssignmentOperationExpr_integerBoxedWithFloatBoxedType() { // Swap test case in "validMultiplyAndAssignmentOperationExpr_floatBoxedWithIntegerBoxedType". VariableExpr lhsExpr = createVariableExpr(TypeNode.INT_OBJECT, "x"); VariableExpr rhsExpr = createVariableExpr(TypeNode.FLOAT_OBJECT, "y"); @@ -239,7 +239,7 @@ public void invalidMultiplyAndAssignmentOperationExpr_integerBoxedWithFloatBoxed } @Test - public void invalidMultiplyAndAssignmentOperationExpr_integerBoxedWithDoubleType() { + void invalidMultiplyAndAssignmentOperationExpr_integerBoxedWithDoubleType() { // Swap test case in "validMultiplyAndAssignmentOperationExpr_doubleWithIntegerBoxedType". VariableExpr lhsExpr = createVariableExpr(TypeNode.INT_OBJECT, "x"); VariableExpr rhsExpr = createVariableExpr(TypeNode.DOUBLE, "y"); @@ -249,7 +249,7 @@ public void invalidMultiplyAndAssignmentOperationExpr_integerBoxedWithDoubleType } @Test - public void invalidMultiplyAndAssignmentOperationExpr_integerBoxedWithDoubleBoxedType() { + void invalidMultiplyAndAssignmentOperationExpr_integerBoxedWithDoubleBoxedType() { // Swap test case in "validMultiplyAndAssignmentOperationExpr_doubleBoxedWithIntegerBoxedType". VariableExpr lhsExpr = createVariableExpr(TypeNode.INT_OBJECT, "x"); VariableExpr rhsExpr = createVariableExpr(TypeNode.DOUBLE_OBJECT, "y"); @@ -259,7 +259,7 @@ public void invalidMultiplyAndAssignmentOperationExpr_integerBoxedWithDoubleBoxe } @Test - public void invalidMultiplyAndAssignmentOperationExpr_integerBoxedWithLongType() { + void invalidMultiplyAndAssignmentOperationExpr_integerBoxedWithLongType() { // Swap test case in "validMultiplyAndAssignmentOperationExpr_longWithIntegerBoxedType". VariableExpr lhsExpr = createVariableExpr(TypeNode.INT_OBJECT, "x"); VariableExpr rhsExpr = createVariableExpr(TypeNode.LONG, "y"); @@ -269,7 +269,7 @@ public void invalidMultiplyAndAssignmentOperationExpr_integerBoxedWithLongType() } @Test - public void invalidMultiplyAndAssignmentOperationExpr_integerBoxedWithLongBoxedType() { + void invalidMultiplyAndAssignmentOperationExpr_integerBoxedWithLongBoxedType() { // Swap test case in "validMultiplyAndAssignmentOperationExpr_longBoxedWithIntegerBoxedType". VariableExpr lhsExpr = createVariableExpr(TypeNode.INT_OBJECT, "x"); VariableExpr rhsExpr = createVariableExpr(TypeNode.LONG_OBJECT, "y"); @@ -281,7 +281,7 @@ public void invalidMultiplyAndAssignmentOperationExpr_integerBoxedWithLongBoxedT /** ==== Multiply And Assignment Operators: LHS data type is Float boxed type ====== */ // RHS could be numeric or numeric boxed type, beside double and its boxed type. @Test - public void validMultiplyAndAssignmentOperationExpr_floatBoxedWithIntegerType() { + void validMultiplyAndAssignmentOperationExpr_floatBoxedWithIntegerType() { // Swap test case in "validMultiplyAndAssignmentOperationExpr_integerWithFloatBoxedType". VariableExpr lhsExpr = createVariableExpr(TypeNode.FLOAT_OBJECT, "x"); ValueExpr rhsExpr = createValueExpr(TypeNode.INT, "5"); @@ -290,7 +290,7 @@ public void validMultiplyAndAssignmentOperationExpr_floatBoxedWithIntegerType() } @Test - public void validMultiplyAndAssignmentOperationExpr_floatBoxedWithIntegerBoxedType() { + void validMultiplyAndAssignmentOperationExpr_floatBoxedWithIntegerBoxedType() { // Swap test case in "invalidMultiplyAndAssignmentOperationExpr_integerBoxedWithFloatBoxedType". VariableExpr lhsExpr = createVariableExpr(TypeNode.FLOAT_OBJECT, "x"); VariableExpr rhsExpr = createVariableExpr(TypeNode.INT_OBJECT, "y"); @@ -299,7 +299,7 @@ public void validMultiplyAndAssignmentOperationExpr_floatBoxedWithIntegerBoxedTy } @Test - public void validMultiplyAndAssignmentOperationExpr_floatBoxedWithCharBoxedType() { + void validMultiplyAndAssignmentOperationExpr_floatBoxedWithCharBoxedType() { // Swap test case in "invalidMultiplyAndAssignmentOperationExpr_charBoxedWithFloatBoxedType". VariableExpr lhsExpr = createVariableExpr(TypeNode.FLOAT_OBJECT, "x"); VariableExpr rhsExpr = createVariableExpr(TypeNode.CHAR_OBJECT, "y"); @@ -308,7 +308,7 @@ public void validMultiplyAndAssignmentOperationExpr_floatBoxedWithCharBoxedType( } @Test - public void validMultiplyAndAssignmentOperationExpr_floatBoxedWithByteBoxedType() { + void validMultiplyAndAssignmentOperationExpr_floatBoxedWithByteBoxedType() { // Swap test case in "invalidMultiplyAndAssignmentOperationExpr_byteBoxedWithFloatBoxedType". VariableExpr lhsExpr = createVariableExpr(TypeNode.FLOAT_OBJECT, "x"); VariableExpr rhsExpr = createVariableExpr(TypeNode.BYTE_OBJECT, "y"); @@ -317,7 +317,7 @@ public void validMultiplyAndAssignmentOperationExpr_floatBoxedWithByteBoxedType( } @Test - public void validMultiplyAndAssignmentOperationExpr_floatBoxedWithLongBoxedType() { + void validMultiplyAndAssignmentOperationExpr_floatBoxedWithLongBoxedType() { // Swap test case in "invalidMultiplyAndAssignmentOperationExpr_longBoxedWithFloatBoxedType". VariableExpr lhsExpr = createVariableExpr(TypeNode.FLOAT_OBJECT, "x"); VariableExpr rhsExpr = createVariableExpr(TypeNode.LONG_OBJECT, "y"); @@ -326,7 +326,7 @@ public void validMultiplyAndAssignmentOperationExpr_floatBoxedWithLongBoxedType( } @Test - public void validMultiplyAndAssignmentOperationExpr_floatBoxedWithDoubleBoxedType() { + void validMultiplyAndAssignmentOperationExpr_floatBoxedWithDoubleBoxedType() { // Swap test case in "validMultiplyAndAssignmentOperationExpr_doubleBoxedWithFloatBoxedType". VariableExpr lhsExpr = createVariableExpr(TypeNode.FLOAT_OBJECT, "x"); VariableExpr rhsExpr = createVariableExpr(TypeNode.DOUBLE_OBJECT, "y"); @@ -336,7 +336,7 @@ public void validMultiplyAndAssignmentOperationExpr_floatBoxedWithDoubleBoxedTyp } @Test - public void invalidMultiplyAndAssignmentOperationExpr_floatBoxedWithObjectType() { + void invalidMultiplyAndAssignmentOperationExpr_floatBoxedWithObjectType() { // No need swap case. VariableExpr lhsExpr = createVariableExpr(TypeNode.FLOAT_OBJECT, "x"); NewObjectExpr rhsExpr = NewObjectExpr.withType(TypeNode.OBJECT); @@ -346,7 +346,7 @@ public void invalidMultiplyAndAssignmentOperationExpr_floatBoxedWithObjectType() } @Test - public void invalidMultiplyAndAssignmentOperationExpr_floatBoxedWithNullType() { + void invalidMultiplyAndAssignmentOperationExpr_floatBoxedWithNullType() { // No need swap case. VariableExpr lhsExpr = createVariableExpr(TypeNode.FLOAT_OBJECT, "x"); ValueExpr rhsExpr = ValueExpr.createNullExpr(); @@ -356,7 +356,7 @@ public void invalidMultiplyAndAssignmentOperationExpr_floatBoxedWithNullType() { } @Test - public void invalidMultiplyAndAssignmentOperationExpr_floatBoxedWithReferenceType() { + void invalidMultiplyAndAssignmentOperationExpr_floatBoxedWithReferenceType() { // Swap test case in "invalidMultiplyAndAssignmentOperationExpr_referenceWithFloatBoxedType". VariableExpr lhsExpr = createVariableExpr(TypeNode.FLOAT_OBJECT, "x"); VariableExpr rhsExpr = createVariableExpr(TypeNode.STRING, "y"); @@ -368,7 +368,7 @@ public void invalidMultiplyAndAssignmentOperationExpr_floatBoxedWithReferenceTyp /** ==== Multiply And Assignment Operators: LHS data type is Short/Char/Byte Boxed Type ====== */ // RHS has no valid type. @Test - public void invalidMultiplyAndAssignmentOperationExpr_byteBoxedWithIntegerBoxedType() { + void invalidMultiplyAndAssignmentOperationExpr_byteBoxedWithIntegerBoxedType() { // Swap test case in "validMultiplyAndAssignmentOperationExpr_integerBoxedWithByteBoxedType". VariableExpr lhsExpr = createVariableExpr(TypeNode.BYTE_OBJECT, "x"); VariableExpr rhsExpr = createVariableExpr(TypeNode.INT_OBJECT, "y"); @@ -378,7 +378,7 @@ public void invalidMultiplyAndAssignmentOperationExpr_byteBoxedWithIntegerBoxedT } @Test - public void invalidMultiplyAndAssignmentOperationExpr_shortBoxedWithIntegerBoxedType() { + void invalidMultiplyAndAssignmentOperationExpr_shortBoxedWithIntegerBoxedType() { // Swap test case in // "validMultiplyAndAssignmentOperationExpr_validCharacterBoxedWithIntegerBoxedType". VariableExpr lhsExpr = createVariableExpr(TypeNode.SHORT_OBJECT, "x"); @@ -389,7 +389,7 @@ public void invalidMultiplyAndAssignmentOperationExpr_shortBoxedWithIntegerBoxed } @Test - public void validMultiplyAndAssignmentOperationExpr_characterBoxedWithIntegerBoxedType() { + void validMultiplyAndAssignmentOperationExpr_characterBoxedWithIntegerBoxedType() { // Swap test case in // "validMultiplyAndAssignmentOperationExpr_integerBoxedWithCharacterBoxedType". VariableExpr lhsExpr = createVariableExpr(TypeNode.CHAR_OBJECT, "x"); @@ -400,7 +400,7 @@ public void validMultiplyAndAssignmentOperationExpr_characterBoxedWithIntegerBox } @Test - public void invalidMultiplyAndAssignmentOperationExpr_charBoxedWithFloatBoxedType() { + void invalidMultiplyAndAssignmentOperationExpr_charBoxedWithFloatBoxedType() { // Swap test case in "invalidMultiplyAndAssignmentOperationExpr_integerBoxedWithFloatBoxedType". VariableExpr lhsExpr = createVariableExpr(TypeNode.CHAR_OBJECT, "x"); VariableExpr rhsExpr = createVariableExpr(TypeNode.FLOAT_OBJECT, "y"); @@ -410,7 +410,7 @@ public void invalidMultiplyAndAssignmentOperationExpr_charBoxedWithFloatBoxedTyp } @Test - public void invalidMultiplyAndAssignmentOperationExpr_byteBoxedWithFloatBoxedType() { + void invalidMultiplyAndAssignmentOperationExpr_byteBoxedWithFloatBoxedType() { // Swap test case in "validMultiplyAndAssignmentOperationExpr_floatBoxedWithByteBoxedType". VariableExpr lhsExpr = createVariableExpr(TypeNode.BYTE_OBJECT, "x"); VariableExpr rhsExpr = createVariableExpr(TypeNode.FLOAT_OBJECT, "y"); @@ -422,7 +422,7 @@ public void invalidMultiplyAndAssignmentOperationExpr_byteBoxedWithFloatBoxedTyp /** ======== Multiply And Assignment Operators: LHS data type is Double Boxed Type ============ */ // RHS could be any numeric type or numeric boxed type. @Test - public void validMultiplyAndAssignmentOperationExpr_doubleBoxedWithIntegerBoxedType() { + void validMultiplyAndAssignmentOperationExpr_doubleBoxedWithIntegerBoxedType() { // Swap test case in // "invalidMultiplyAndAssignmentOperationExpr_integerBoxedWithDoubleBoxedType". VariableExpr lhsExpr = createVariableExpr(TypeNode.DOUBLE_OBJECT, "x"); @@ -432,7 +432,7 @@ public void validMultiplyAndAssignmentOperationExpr_doubleBoxedWithIntegerBoxedT } @Test - public void validMultiplyAndAssignmentOperationExpr_doubleBoxedWithFloatBoxedType() { + void validMultiplyAndAssignmentOperationExpr_doubleBoxedWithFloatBoxedType() { // Swap test case in "invalidMultiplyAndAssignmentOperationExpr_floatBoxedWithDoubleBoxedType". VariableExpr lhsExpr = createVariableExpr(TypeNode.DOUBLE_OBJECT, "x"); VariableExpr rhsExpr = createVariableExpr(TypeNode.FLOAT_OBJECT, "y"); @@ -441,7 +441,7 @@ public void validMultiplyAndAssignmentOperationExpr_doubleBoxedWithFloatBoxedTyp } @Test - public void validMultiplyAndAssignmentOperationExpr_doubleBoxedWithLongBoxedType() { + void validMultiplyAndAssignmentOperationExpr_doubleBoxedWithLongBoxedType() { // Swap test case in "invalidMultiplyAndAssignmentOperationExpr_longBoxedWithDoubleBoxedType". VariableExpr lhsExpr = createVariableExpr(TypeNode.DOUBLE_OBJECT, "x"); VariableExpr rhsExpr = createVariableExpr(TypeNode.LONG_OBJECT, "y"); @@ -450,7 +450,7 @@ public void validMultiplyAndAssignmentOperationExpr_doubleBoxedWithLongBoxedType } @Test - public void invalidMultiplyAndAssignmentOperationExpr_doubleBoxedWithReferenceType() { + void invalidMultiplyAndAssignmentOperationExpr_doubleBoxedWithReferenceType() { // Swap test case in "invalidMultiplyAndAssignmentOperationExpr_referenceWithDoubleBoxedType". VariableExpr lhsExpr = createVariableExpr(TypeNode.DOUBLE_OBJECT, "x"); ValueExpr valueExpr = ValueExpr.withValue(StringObjectValue.withValue("abc")); @@ -460,7 +460,7 @@ public void invalidMultiplyAndAssignmentOperationExpr_doubleBoxedWithReferenceTy } @Test - public void invalidMultiplyAndAssignmentOperationExpr_doubleBoxedWithNullType() { + void invalidMultiplyAndAssignmentOperationExpr_doubleBoxedWithNullType() { // No need swap case. VariableExpr lhsExpr = createVariableExpr(TypeNode.DOUBLE_OBJECT, "x"); ValueExpr valueExprExpr = ValueExpr.createNullExpr(); @@ -470,7 +470,7 @@ public void invalidMultiplyAndAssignmentOperationExpr_doubleBoxedWithNullType() } @Test - public void invalidMultiplyAndAssignmentOperationExpr_doubleBoxedWithObjectType() { + void invalidMultiplyAndAssignmentOperationExpr_doubleBoxedWithObjectType() { // No need swap test. VariableExpr lhsExpr = createVariableExpr(TypeNode.DOUBLE_OBJECT, "x"); NewObjectExpr rhsExpr = NewObjectExpr.withType(TypeNode.OBJECT); @@ -481,7 +481,7 @@ public void invalidMultiplyAndAssignmentOperationExpr_doubleBoxedWithObjectType( /** ======== Multiply And Assignment Operators: LHS data type is Long boxed type ============ */ @Test - public void validMultiplyAndAssignmentOperationExpr_longBoxedWithIntegerBoxedType() { + void validMultiplyAndAssignmentOperationExpr_longBoxedWithIntegerBoxedType() { // Swap test case in "invalidMultiplyAndAssignmentOperationExpr_integerBoxedWithLongBoxedType". VariableExpr lhsExpr = createVariableExpr(TypeNode.LONG_OBJECT, "x"); VariableExpr rhsExpr = createVariableExpr(TypeNode.INT_OBJECT, "y"); @@ -490,7 +490,7 @@ public void validMultiplyAndAssignmentOperationExpr_longBoxedWithIntegerBoxedTyp } @Test - public void invalidMultiplyAndAssignmentOperationExpr_longBoxedWithFloatBoxedType() { + void invalidMultiplyAndAssignmentOperationExpr_longBoxedWithFloatBoxedType() { // Swap test case in "validMultiplyAndAssignmentOperationExpr_floatBoxedWithLongBoxedType". VariableExpr lhsExpr = createVariableExpr(TypeNode.LONG_OBJECT, "x"); VariableExpr rhsExpr = createVariableExpr(TypeNode.FLOAT_OBJECT, "y"); @@ -500,7 +500,7 @@ public void invalidMultiplyAndAssignmentOperationExpr_longBoxedWithFloatBoxedTyp } @Test - public void invalidMultiplyAndAssignmentOperationExpr_longBoxedWithFloatType() { + void invalidMultiplyAndAssignmentOperationExpr_longBoxedWithFloatType() { // Swap test case in "validMultiplyAndAssignmentOperationExpr_floatWithLongBoxedType". VariableExpr lhsExpr = createVariableExpr(TypeNode.LONG_OBJECT, "x"); VariableExpr rhsExpr = createVariableExpr(TypeNode.FLOAT, "y"); @@ -510,7 +510,7 @@ public void invalidMultiplyAndAssignmentOperationExpr_longBoxedWithFloatType() { } @Test - public void invalidMultiplyAndAssignmentOperationExpr_longBoxedWithDoubleBoxedType() { + void invalidMultiplyAndAssignmentOperationExpr_longBoxedWithDoubleBoxedType() { // Swap test case in "validMultiplyAndAssignmentOperationExpr_doubleBoxedWithLongBoxedType". VariableExpr lhsExpr = createVariableExpr(TypeNode.LONG_OBJECT, "x"); VariableExpr rhsExpr = createVariableExpr(TypeNode.DOUBLE_OBJECT, "y"); @@ -520,7 +520,7 @@ public void invalidMultiplyAndAssignmentOperationExpr_longBoxedWithDoubleBoxedTy } @Test - public void invalidMultiplyAndAssignmentOperationExpr_longBoxedWithDoubleType() { + void invalidMultiplyAndAssignmentOperationExpr_longBoxedWithDoubleType() { // Swap test case in "validMultiplyAndAssignmentOperationExpr_doubleWithLongBoxedType". VariableExpr lhsExpr = createVariableExpr(TypeNode.LONG_OBJECT, "x"); VariableExpr rhsExpr = createVariableExpr(TypeNode.DOUBLE, "y"); @@ -530,7 +530,7 @@ public void invalidMultiplyAndAssignmentOperationExpr_longBoxedWithDoubleType() } @Test - public void invalidMultiplyAndAssignmentOperationExpr_longBoxedWithNullType() { + void invalidMultiplyAndAssignmentOperationExpr_longBoxedWithNullType() { // Swap test case in "invalidMultiplyAndAssignmentOperationExpr_nullWithLongBoxedType". VariableExpr lhsExpr = createVariableExpr(TypeNode.LONG_OBJECT, "x"); ValueExpr rhsExpr = ValueExpr.createNullExpr(); @@ -540,7 +540,7 @@ public void invalidMultiplyAndAssignmentOperationExpr_longBoxedWithNullType() { } @Test - public void invalidMultiplyAndAssignmentOperationExpr_longBoxedWithObjectType() { + void invalidMultiplyAndAssignmentOperationExpr_longBoxedWithObjectType() { // No need swap case. VariableExpr lhsExpr = createVariableExpr(TypeNode.LONG_OBJECT, "x"); NewObjectExpr rhsExpr = NewObjectExpr.withType(TypeNode.OBJECT); @@ -550,7 +550,7 @@ public void invalidMultiplyAndAssignmentOperationExpr_longBoxedWithObjectType() } @Test - public void invalidMultiplyAndAssignmentOperationExpr_longBoxedWithReferenceType() { + void invalidMultiplyAndAssignmentOperationExpr_longBoxedWithReferenceType() { // Swap test case in "invalidMultiplyAndAssignmentOperationExpr_referenceWithLongBoxedType". VariableExpr lhsExpr = createVariableExpr(TypeNode.LONG_OBJECT, "x"); VariableExpr rhsExpr = createVariableExpr(TypeNode.STRING, "y"); @@ -561,7 +561,7 @@ public void invalidMultiplyAndAssignmentOperationExpr_longBoxedWithReferenceType /** ======== Multiply And Assignment Operators: LHS data type is Reference Type ============ */ @Test - public void invalidMultiplyAndAssignmentOperationExpr_referencedWithNumericType() { + void invalidMultiplyAndAssignmentOperationExpr_referencedWithNumericType() { // Swap test case in "invalidMultiplyAndAssignmentOperationExpr_numericWithReferenceType". VariableExpr lhsExpr = createVariableExpr(TypeNode.STRING, "x"); VariableExpr rhsExpr = createVariableExpr(TypeNode.DOUBLE, "y"); @@ -571,7 +571,7 @@ public void invalidMultiplyAndAssignmentOperationExpr_referencedWithNumericType( } @Test - public void invalidMultiplyAndAssignmentOperationExpr_referenceWithFloatBoxedType() { + void invalidMultiplyAndAssignmentOperationExpr_referenceWithFloatBoxedType() { // Swap test case in "invalidMultiplyAndAssignmentOperationExpr_floatBoxedWithReferenceType". VariableExpr lhsExpr = createVariableExpr(TypeNode.STRING, "x"); VariableExpr rhsExpr = createVariableExpr(TypeNode.FLOAT_OBJECT, "y"); @@ -581,7 +581,7 @@ public void invalidMultiplyAndAssignmentOperationExpr_referenceWithFloatBoxedTyp } @Test - public void invalidMultiplyAndAssignmentOperationExpr_referenceWithLongBoxedType() { + void invalidMultiplyAndAssignmentOperationExpr_referenceWithLongBoxedType() { // Swap test case in "invalidMultiplyAndAssignmentOperationExpr_longBoxedWithReferenceType". VariableExpr lhsExpr = createVariableExpr(TypeNode.STRING, "x"); VariableExpr rhsExpr = createVariableExpr(TypeNode.LONG_OBJECT, "y"); @@ -591,7 +591,7 @@ public void invalidMultiplyAndAssignmentOperationExpr_referenceWithLongBoxedType } @Test - public void invalidMultiplyAndAssignmentOperationExpr_referenceWithDoubleBoxedType() { + void invalidMultiplyAndAssignmentOperationExpr_referenceWithDoubleBoxedType() { // Swap test case in "invalidMultiplyAndAssignmentOperationExpr_doubleBoxedWithReferenceType". VariableExpr lhsExpr = createVariableExpr(TypeNode.STRING, "x"); VariableExpr rhsExpr = createVariableExpr(TypeNode.DOUBLE_OBJECT, "y"); @@ -602,7 +602,7 @@ public void invalidMultiplyAndAssignmentOperationExpr_referenceWithDoubleBoxedTy /** =========== Multiply And Assignment Operators: Variable is declaration ================ */ @Test - public void invalidMultiplyAndAssignmentOperationExpr_variableExprIsDecl() { + void invalidMultiplyAndAssignmentOperationExpr_variableExprIsDecl() { Variable variable = Variable.builder().setName("x").setType(TypeNode.INT).build(); VariableExpr lhsExpr = VariableExpr.builder().setVariable(variable).setIsDecl(true).build(); VariableExpr rhsExpr = createVariableExpr(TypeNode.INT, "y"); @@ -612,7 +612,7 @@ public void invalidMultiplyAndAssignmentOperationExpr_variableExprIsDecl() { } @Test - public void invalidMultiplyAndAssignmentOperationExpr_valueExprIsDecl() { + void invalidMultiplyAndAssignmentOperationExpr_valueExprIsDecl() { VariableExpr lhsExpr = createVariableExpr(TypeNode.INT, "x"); Variable variable = Variable.builder().setName("x").setType(TypeNode.INT).build(); VariableExpr rhsExpr = VariableExpr.builder().setVariable(variable).setIsDecl(true).build(); @@ -622,7 +622,7 @@ public void invalidMultiplyAndAssignmentOperationExpr_valueExprIsDecl() { } @Test - public void invalidMultiplyAndAssignmentOperationExpr_variableExprAndValueExprIsDecl() { + void invalidMultiplyAndAssignmentOperationExpr_variableExprAndValueExprIsDecl() { Variable lVariable = Variable.builder().setName("x").setType(TypeNode.INT).build(); VariableExpr lhsExpr = VariableExpr.builder().setVariable(lVariable).setIsDecl(true).build(); Variable rVariable = Variable.builder().setName("y").setType(TypeNode.INT).build(); @@ -634,7 +634,7 @@ public void invalidMultiplyAndAssignmentOperationExpr_variableExprAndValueExprIs /** ======================= Multiply And Assignment Operators: Void type ===================== */ @Test - public void invalidMultiplyAndAssignmentOperationExpr_voidType() { + void invalidMultiplyAndAssignmentOperationExpr_voidType() { // No need swap case. VariableExpr lhsExprExpr = createVariableExpr(TypeNode.FLOAT_OBJECT, "x"); MethodInvocationExpr rhsExpr = @@ -646,7 +646,7 @@ public void invalidMultiplyAndAssignmentOperationExpr_voidType() { /** =================== XOR Assignment Operators: boolean type ======================= */ @Test - public void validXorAssignmentOperationExpr_booleanType() { + void validXorAssignmentOperationExpr_booleanType() { // No need swap case. VariableExpr lhsExpr = createVariableExpr(TypeNode.BOOLEAN, "x"); VariableExpr rhsExpr = createVariableExpr(TypeNode.BOOLEAN, "y"); @@ -655,7 +655,7 @@ public void validXorAssignmentOperationExpr_booleanType() { } @Test - public void validXorAssignmentOperationExpr_booleanWithBooleanBoxedType() { + void validXorAssignmentOperationExpr_booleanWithBooleanBoxedType() { // Swap case in "validXorAssignmentOperationExpr_booleanBoxedTypeWithUnboxedType. VariableExpr lhsExpr = createVariableExpr(TypeNode.BOOLEAN, "x"); VariableExpr rhsExpr = createVariableExpr(TypeNode.BOOLEAN_OBJECT, "y"); @@ -664,7 +664,7 @@ public void validXorAssignmentOperationExpr_booleanWithBooleanBoxedType() { } @Test - public void validXorAssignmentOperationExpr_booleanBoxedTypeWithUnboxedType() { + void validXorAssignmentOperationExpr_booleanBoxedTypeWithUnboxedType() { // Swap case in "validXorAssignmentOperationExpr_booleanWithBooleanBoxedType". VariableExpr lhsExpr = createVariableExpr(TypeNode.BOOLEAN_OBJECT, "x"); VariableExpr rhsExpr = createVariableExpr(TypeNode.BOOLEAN, "y"); @@ -673,7 +673,7 @@ public void validXorAssignmentOperationExpr_booleanBoxedTypeWithUnboxedType() { } @Test - public void validXorAssignmentOperationExpr_booleanBoxedType() { + void validXorAssignmentOperationExpr_booleanBoxedType() { // No need swap case. VariableExpr lhsExpr = createVariableExpr(TypeNode.BOOLEAN_OBJECT, "x"); VariableExpr rhsExpr = createVariableExpr(TypeNode.BOOLEAN_OBJECT, "y"); @@ -682,7 +682,7 @@ public void validXorAssignmentOperationExpr_booleanBoxedType() { } @Test - public void invalidXorAssignmentOperationExpr_booleanWithNumericTypes() { + void invalidXorAssignmentOperationExpr_booleanWithNumericTypes() { // Swap case in "invalidXorAssignmentOperationExpr_integerWithBooleanTypes". VariableExpr lhsExpr = createVariableExpr(TypeNode.BOOLEAN, "x"); VariableExpr rhsExpr = createVariableExpr(TypeNode.INT, "y"); @@ -692,7 +692,7 @@ public void invalidXorAssignmentOperationExpr_booleanWithNumericTypes() { } @Test - public void invalidXorAssignmentOperationExpr_booleanWithIntegerBoxedTypes() { + void invalidXorAssignmentOperationExpr_booleanWithIntegerBoxedTypes() { // Swap case in "invalidXorAssignmentOperationExpr_integerBoxedTypeWithBooleanTypes". VariableExpr lhsExpr = createVariableExpr(TypeNode.BOOLEAN, "x"); VariableExpr rhsExpr = createVariableExpr(TypeNode.INT_OBJECT, "y"); @@ -702,7 +702,7 @@ public void invalidXorAssignmentOperationExpr_booleanWithIntegerBoxedTypes() { } @Test - public void invalidXorAssignmentOperationExpr_booleanWithReferencedTypes() { + void invalidXorAssignmentOperationExpr_booleanWithReferencedTypes() { // Swap case in "invalidXorAssignmentOperationExpr_referencedTypeWithBooleanTypes". VariableExpr lhsExpr = createVariableExpr(TypeNode.BOOLEAN, "x"); VariableExpr rhsExpr = createVariableExpr(TypeNode.STRING, "y"); @@ -712,7 +712,7 @@ public void invalidXorAssignmentOperationExpr_booleanWithReferencedTypes() { } @Test - public void invalidXorAssignmentOperationExpr_booleanWithNullTypes() { + void invalidXorAssignmentOperationExpr_booleanWithNullTypes() { // No valid swap case. VariableExpr lhsExpr = createVariableExpr(TypeNode.BOOLEAN, "x"); ValueExpr rhsExpr = ValueExpr.createNullExpr(); @@ -722,7 +722,7 @@ public void invalidXorAssignmentOperationExpr_booleanWithNullTypes() { } @Test - public void invalidXorAssignmentOperationExpr_booleanWithNewObjectTypes() { + void invalidXorAssignmentOperationExpr_booleanWithNewObjectTypes() { // No valid swap case. VariableExpr lhsExpr = createVariableExpr(TypeNode.BOOLEAN, "x"); NewObjectExpr rhsExpr = NewObjectExpr.withType(TypeNode.OBJECT); @@ -733,7 +733,7 @@ public void invalidXorAssignmentOperationExpr_booleanWithNewObjectTypes() { /** ======= XOR Assignment Operators: LHS is non-floating-point numeric types ========= */ @Test - public void validXorAssignmentOperationExpr_integerWithCharType() { + void validXorAssignmentOperationExpr_integerWithCharType() { // No need swap case. VariableExpr lhsExpr = createVariableExpr(TypeNode.INT, "x"); VariableExpr rhsExpr = createVariableExpr(TypeNode.CHAR, "y"); @@ -742,7 +742,7 @@ public void validXorAssignmentOperationExpr_integerWithCharType() { } @Test - public void validXorAssignmentOperationExpr_integerWithIntegerType() { + void validXorAssignmentOperationExpr_integerWithIntegerType() { // No need swap case. VariableExpr lhsExpr = createVariableExpr(TypeNode.INT, "x"); VariableExpr rhsExpr = createVariableExpr(TypeNode.INT, "y"); @@ -751,7 +751,7 @@ public void validXorAssignmentOperationExpr_integerWithIntegerType() { } @Test - public void validXorAssignmentOperationExpr_integerWithByteType() { + void validXorAssignmentOperationExpr_integerWithByteType() { // No need swap case. VariableExpr lhsExpr = createVariableExpr(TypeNode.INT, "x"); VariableExpr rhsExpr = createVariableExpr(TypeNode.BYTE, "y"); @@ -760,7 +760,7 @@ public void validXorAssignmentOperationExpr_integerWithByteType() { } @Test - public void validXorAssignmentOperationExpr_integerWithShortType() { + void validXorAssignmentOperationExpr_integerWithShortType() { // No need swap case. VariableExpr lhsExpr = createVariableExpr(TypeNode.INT, "x"); VariableExpr rhsExpr = createVariableExpr(TypeNode.SHORT, "y"); @@ -769,7 +769,7 @@ public void validXorAssignmentOperationExpr_integerWithShortType() { } @Test - public void validXorAssignmentOperationExpr_integerWithLongType() { + void validXorAssignmentOperationExpr_integerWithLongType() { // No need swap case. VariableExpr lhsExpr = createVariableExpr(TypeNode.INT, "x"); VariableExpr rhsExpr = createVariableExpr(TypeNode.LONG, "y"); @@ -778,7 +778,7 @@ public void validXorAssignmentOperationExpr_integerWithLongType() { } @Test - public void validXorAssignmentOperationExpr_byteWithIntegerBoxedType() { + void validXorAssignmentOperationExpr_byteWithIntegerBoxedType() { // Swap case in "validXorAssignmentOperationExpr_integerBoxedTypeWithByteType". VariableExpr lhsExpr = createVariableExpr(TypeNode.BYTE, "x"); VariableExpr rhsExpr = createVariableExpr(TypeNode.INT_OBJECT, "y"); @@ -787,7 +787,7 @@ public void validXorAssignmentOperationExpr_byteWithIntegerBoxedType() { } @Test - public void validXorAssignmentOperationExpr_charWithIntegerType() { + void validXorAssignmentOperationExpr_charWithIntegerType() { // No need swap case. VariableExpr lhsExpr = createVariableExpr(TypeNode.CHAR, "x"); VariableExpr rhsExpr = createVariableExpr(TypeNode.INT, "y"); @@ -796,7 +796,7 @@ public void validXorAssignmentOperationExpr_charWithIntegerType() { } @Test - public void validXorAssignmentOperationExpr_shortWithIntegerType() { + void validXorAssignmentOperationExpr_shortWithIntegerType() { // No need swap case. VariableExpr lhsExpr = createVariableExpr(TypeNode.SHORT, "x"); VariableExpr rhsExpr = createVariableExpr(TypeNode.INT, "y"); @@ -805,7 +805,7 @@ public void validXorAssignmentOperationExpr_shortWithIntegerType() { } @Test - public void validXorAssignmentOperationExpr_longWithIntegerType() { + void validXorAssignmentOperationExpr_longWithIntegerType() { // No need swap case. VariableExpr lhsExpr = createVariableExpr(TypeNode.LONG, "x"); VariableExpr rhsExpr = createVariableExpr(TypeNode.INT, "y"); @@ -814,7 +814,7 @@ public void validXorAssignmentOperationExpr_longWithIntegerType() { } @Test - public void validXorAssignmentOperationExpr_charWithIntegerBoxedType() { + void validXorAssignmentOperationExpr_charWithIntegerBoxedType() { // Swap case in . VariableExpr lhsExpr = createVariableExpr(TypeNode.CHAR, "x"); VariableExpr rhsExpr = createVariableExpr(TypeNode.INT_OBJECT, "y"); @@ -823,7 +823,7 @@ public void validXorAssignmentOperationExpr_charWithIntegerBoxedType() { } @Test - public void validXorAssignmentOperationExpr_longWithByteBoxedType() { + void validXorAssignmentOperationExpr_longWithByteBoxedType() { // Swap case in . VariableExpr lhsExpr = createVariableExpr(TypeNode.LONG, "x"); VariableExpr rhsExpr = createVariableExpr(TypeNode.BYTE_OBJECT, "y"); @@ -832,7 +832,7 @@ public void validXorAssignmentOperationExpr_longWithByteBoxedType() { } @Test - public void validXorAssignmentOperationExpr_integerWithLongBoxedType() { + void validXorAssignmentOperationExpr_integerWithLongBoxedType() { // Swap case in . VariableExpr lhsExpr = createVariableExpr(TypeNode.INT, "x"); VariableExpr rhsExpr = createVariableExpr(TypeNode.LONG_OBJECT, "y"); @@ -841,7 +841,7 @@ public void validXorAssignmentOperationExpr_integerWithLongBoxedType() { } @Test - public void invalidXorAssignmentOperationExpr_integerWithDoubleTypes() { + void invalidXorAssignmentOperationExpr_integerWithDoubleTypes() { // Swap case in "invalidXorAssignmentOperationExpr_doubleWithIntegerTypes". VariableExpr lhsExpr = createVariableExpr(TypeNode.INT, "x"); VariableExpr rhsExpr = createVariableExpr(TypeNode.DOUBLE, "y"); @@ -851,7 +851,7 @@ public void invalidXorAssignmentOperationExpr_integerWithDoubleTypes() { } @Test - public void invalidXorAssignmentOperationExpr_integerWithDoubleBoxedTypes() { + void invalidXorAssignmentOperationExpr_integerWithDoubleBoxedTypes() { // Swap case in "invalidXorAssignmentOperationExpr_doubleBoxedWithIntegerTypes". VariableExpr lhsExpr = createVariableExpr(TypeNode.INT, "x"); VariableExpr rhsExpr = createVariableExpr(TypeNode.DOUBLE_OBJECT, "y"); @@ -861,7 +861,7 @@ public void invalidXorAssignmentOperationExpr_integerWithDoubleBoxedTypes() { } @Test - public void invalidXorAssignmentOperationExpr_charWithFloatTypes() { + void invalidXorAssignmentOperationExpr_charWithFloatTypes() { // Swap case in "invalidXorAssignmentOperationExpr_floatWithCharTypes". VariableExpr lhsExpr = createVariableExpr(TypeNode.CHAR, "x"); VariableExpr rhsExpr = createVariableExpr(TypeNode.FLOAT, "y"); @@ -871,7 +871,7 @@ public void invalidXorAssignmentOperationExpr_charWithFloatTypes() { } @Test - public void invalidXorAssignmentOperationExpr_charWithFloatBoxedTypes() { + void invalidXorAssignmentOperationExpr_charWithFloatBoxedTypes() { // Swap case in "invalidXorAssignmentOperationExpr_floatBoxedWithCharTypes". VariableExpr lhsExpr = createVariableExpr(TypeNode.CHAR, "x"); VariableExpr rhsExpr = createVariableExpr(TypeNode.FLOAT_OBJECT, "y"); @@ -881,7 +881,7 @@ public void invalidXorAssignmentOperationExpr_charWithFloatBoxedTypes() { } @Test - public void invalidXorAssignmentOperationExpr_integerWithBooleanTypes() { + void invalidXorAssignmentOperationExpr_integerWithBooleanTypes() { // Swap case in "invalidXorAssignmentOperationExpr_booleanWithNumericTypes". VariableExpr lhsExpr = createVariableExpr(TypeNode.INT, "x"); VariableExpr rhsExpr = createVariableExpr(TypeNode.BOOLEAN, "y"); @@ -891,7 +891,7 @@ public void invalidXorAssignmentOperationExpr_integerWithBooleanTypes() { } @Test - public void invalidXorAssignmentOperationExpr_integerWithNullTypes() { + void invalidXorAssignmentOperationExpr_integerWithNullTypes() { // No need swap case. VariableExpr lhsExpr = createVariableExpr(TypeNode.INT, "x"); ValueExpr rhsExpr = ValueExpr.createNullExpr(); @@ -901,7 +901,7 @@ public void invalidXorAssignmentOperationExpr_integerWithNullTypes() { } @Test - public void invalidXorAssignmentOperationExpr_integerWithReferenceTypes() { + void invalidXorAssignmentOperationExpr_integerWithReferenceTypes() { // Swap case in invalidXorAssignmentOperationExpr_referenceWithCharTypes. VariableExpr lhsExpr = createVariableExpr(TypeNode.INT, "x"); VariableExpr rhsExpr = createVariableExpr(TypeNode.STRING, "y"); @@ -912,7 +912,7 @@ public void invalidXorAssignmentOperationExpr_integerWithReferenceTypes() { /** ============= XOR Assignment Operators: LHS is integer boxed type ================= */ @Test - public void validXorAssignmentOperationExpr_integerBoxedTypeWithIntegerType() { + void validXorAssignmentOperationExpr_integerBoxedTypeWithIntegerType() { // Swap case in "validXorAssignmentOperationExpr_charWithIntegerBoxedType". VariableExpr lhsExpr = createVariableExpr(TypeNode.INT_OBJECT, "x"); VariableExpr rhsExpr = createVariableExpr(TypeNode.INT, "y"); @@ -921,7 +921,7 @@ public void validXorAssignmentOperationExpr_integerBoxedTypeWithIntegerType() { } @Test - public void validXorAssignmentOperationExpr_integerBoxedTypeWithCharType() { + void validXorAssignmentOperationExpr_integerBoxedTypeWithCharType() { // Swap case in validXorAssignmentOperationExpr_charWithIntegerBoxedType. VariableExpr lhsExpr = createVariableExpr(TypeNode.INT_OBJECT, "x"); VariableExpr rhsExpr = createVariableExpr(TypeNode.CHAR, "y"); @@ -930,7 +930,7 @@ public void validXorAssignmentOperationExpr_integerBoxedTypeWithCharType() { } @Test - public void validXorAssignmentOperationExpr_integerBoxedTypeWithByteType() { + void validXorAssignmentOperationExpr_integerBoxedTypeWithByteType() { // Swap case in "validXorAssignmentOperationExpr_byteWithIntegerBoxedType". VariableExpr lhsExpr = createVariableExpr(TypeNode.INT_OBJECT, "x"); VariableExpr rhsExpr = createVariableExpr(TypeNode.BYTE, "y"); @@ -939,7 +939,7 @@ public void validXorAssignmentOperationExpr_integerBoxedTypeWithByteType() { } @Test - public void validXorAssignmentOperationExpr_integerBoxedTypeWithLongBoxedType() { + void validXorAssignmentOperationExpr_integerBoxedTypeWithLongBoxedType() { // Swap case in "invalidXorAssignmentOperationExpr_longBoxedTypeWithIntegerBoxedType". VariableExpr lhsExpr = createVariableExpr(TypeNode.INT_OBJECT, "x"); VariableExpr rhsExpr = createVariableExpr(TypeNode.LONG_OBJECT, "y"); @@ -948,7 +948,7 @@ public void validXorAssignmentOperationExpr_integerBoxedTypeWithLongBoxedType() } @Test - public void validXorAssignmentOperationExpr_integerBoxedTypeWithShortBoxedType() { + void validXorAssignmentOperationExpr_integerBoxedTypeWithShortBoxedType() { // Swap case in "invalidXorAssignmentOperationExpr_shortBoxedTypeWithIntegerBoxedType". VariableExpr lhsExpr = createVariableExpr(TypeNode.INT_OBJECT, "x"); VariableExpr rhsExpr = createVariableExpr(TypeNode.SHORT_OBJECT, "y"); @@ -957,7 +957,7 @@ public void validXorAssignmentOperationExpr_integerBoxedTypeWithShortBoxedType() } @Test - public void invalidXorAssignmentOperationExpr_integerBoxedTypeWithFloatType() { + void invalidXorAssignmentOperationExpr_integerBoxedTypeWithFloatType() { // Swap case in "invalidXorAssignmentOperationExpr_floatWithIntegerBoxedType". VariableExpr lhsExpr = createVariableExpr(TypeNode.INT_OBJECT, "x"); VariableExpr rhsExpr = createVariableExpr(TypeNode.FLOAT, "y"); @@ -967,7 +967,7 @@ public void invalidXorAssignmentOperationExpr_integerBoxedTypeWithFloatType() { } @Test - public void invalidXorAssignmentOperationExpr_integerBoxedTypeWithFloatBoxedType() { + void invalidXorAssignmentOperationExpr_integerBoxedTypeWithFloatBoxedType() { // Swap case in "invalidXorAssignmentOperationExpr_floatBoxedWithIntegerBoxedType". VariableExpr lhsExpr = createVariableExpr(TypeNode.INT_OBJECT, "x"); VariableExpr rhsExpr = createVariableExpr(TypeNode.FLOAT_OBJECT, "y"); @@ -977,7 +977,7 @@ public void invalidXorAssignmentOperationExpr_integerBoxedTypeWithFloatBoxedType } @Test - public void invalidXorAssignmentOperationExpr_integerBoxedTypeWithDoubleType() { + void invalidXorAssignmentOperationExpr_integerBoxedTypeWithDoubleType() { // Swap case in "invalidXorAssignmentOperationExpr_doubleWithIntegerBoxedType". VariableExpr lhsExpr = createVariableExpr(TypeNode.INT_OBJECT, "x"); VariableExpr rhsExpr = createVariableExpr(TypeNode.DOUBLE, "y"); @@ -987,7 +987,7 @@ public void invalidXorAssignmentOperationExpr_integerBoxedTypeWithDoubleType() { } @Test - public void invalidXorAssignmentOperationExpr_integerBoxedTypeWithDoubleBoxedType() { + void invalidXorAssignmentOperationExpr_integerBoxedTypeWithDoubleBoxedType() { // Swap case in "invalidXorAssignmentOperationExpr_doubleBoxedWithIntegerBoxedType". VariableExpr lhsExpr = createVariableExpr(TypeNode.INT_OBJECT, "x"); VariableExpr rhsExpr = createVariableExpr(TypeNode.DOUBLE_OBJECT, "y"); @@ -998,7 +998,7 @@ public void invalidXorAssignmentOperationExpr_integerBoxedTypeWithDoubleBoxedTyp /** =========== XOR Assignment Operators: LHS is floating-point type =============== */ @Test - public void invalidXorAssignmentOperationExpr_floatWithIntegerBoxedType() { + void invalidXorAssignmentOperationExpr_floatWithIntegerBoxedType() { // Swap case in "invalidXorAssignmentOperationExpr_integerBoxedTypeWithFloatType". VariableExpr lhsExpr = createVariableExpr(TypeNode.FLOAT, "x"); VariableExpr rhsExpr = createVariableExpr(TypeNode.INT_OBJECT, "y"); @@ -1008,7 +1008,7 @@ public void invalidXorAssignmentOperationExpr_floatWithIntegerBoxedType() { } @Test - public void invalidXorAssignmentOperationExpr_floatBoxedWithIntegerBoxedType() { + void invalidXorAssignmentOperationExpr_floatBoxedWithIntegerBoxedType() { // Swap case in "invalidXorAssignmentOperationExpr_integerBoxedTypeWithFloatBoxedType". VariableExpr lhsExpr = createVariableExpr(TypeNode.FLOAT_OBJECT, "x"); VariableExpr rhsExpr = createVariableExpr(TypeNode.INT_OBJECT, "y"); @@ -1018,7 +1018,7 @@ public void invalidXorAssignmentOperationExpr_floatBoxedWithIntegerBoxedType() { } @Test - public void invalidXorAssignmentOperationExpr_doubleWithIntegerBoxedType() { + void invalidXorAssignmentOperationExpr_doubleWithIntegerBoxedType() { // Swap case in "invalidXorAssignmentOperationExpr_integerBoxedTypeWithDoubleType". VariableExpr lhsExpr = createVariableExpr(TypeNode.DOUBLE, "x"); VariableExpr rhsExpr = createVariableExpr(TypeNode.INT_OBJECT, "y"); @@ -1028,7 +1028,7 @@ public void invalidXorAssignmentOperationExpr_doubleWithIntegerBoxedType() { } @Test - public void invalidXorAssignmentOperationExpr_doubleBoxedWithIntegerBoxedType() { + void invalidXorAssignmentOperationExpr_doubleBoxedWithIntegerBoxedType() { // Swap case in "invalidXorAssignmentOperationExpr_integerBoxedTypeWithDoubleBoxedType". VariableExpr lhsExpr = createVariableExpr(TypeNode.DOUBLE_OBJECT, "x"); VariableExpr rhsExpr = createVariableExpr(TypeNode.INT_OBJECT, "y"); @@ -1038,7 +1038,7 @@ public void invalidXorAssignmentOperationExpr_doubleBoxedWithIntegerBoxedType() } @Test - public void invalidXorAssignmentOperationExpr_doubleWithIntegerTypes() { + void invalidXorAssignmentOperationExpr_doubleWithIntegerTypes() { // Swap case in "invalidXorAssignmentOperationExpr_integerWithDoubleTypes". VariableExpr lhsExpr = createVariableExpr(TypeNode.DOUBLE, "x"); VariableExpr rhsExpr = createVariableExpr(TypeNode.INT, "y"); @@ -1048,7 +1048,7 @@ public void invalidXorAssignmentOperationExpr_doubleWithIntegerTypes() { } @Test - public void invalidXorAssignmentOperationExpr_doubleBoxedWithIntegerTypes() { + void invalidXorAssignmentOperationExpr_doubleBoxedWithIntegerTypes() { // Swap case in "invalidXorAssignmentOperationExpr_integerWithDoubleBoxedTypes". VariableExpr lhsExpr = createVariableExpr(TypeNode.DOUBLE_OBJECT, "x"); VariableExpr rhsExpr = createVariableExpr(TypeNode.INT, "y"); @@ -1058,7 +1058,7 @@ public void invalidXorAssignmentOperationExpr_doubleBoxedWithIntegerTypes() { } @Test - public void invalidXorAssignmentOperationExpr_floatWithCharTypes() { + void invalidXorAssignmentOperationExpr_floatWithCharTypes() { // Swap case in "invalidXorAssignmentOperationExpr_charWithFloatTypes". VariableExpr lhsExpr = createVariableExpr(TypeNode.FLOAT, "x"); VariableExpr rhsExpr = createVariableExpr(TypeNode.CHAR, "y"); @@ -1068,7 +1068,7 @@ public void invalidXorAssignmentOperationExpr_floatWithCharTypes() { } @Test - public void invalidXorAssignmentOperationExpr_floatBoxedTypeWithCharTypes() { + void invalidXorAssignmentOperationExpr_floatBoxedTypeWithCharTypes() { // Swap case in "invalidXorAssignmentOperationExpr_charWithFloatBoxedTypes". VariableExpr lhsExpr = createVariableExpr(TypeNode.FLOAT_OBJECT, "x"); VariableExpr rhsExpr = createVariableExpr(TypeNode.CHAR, "y"); @@ -1078,7 +1078,7 @@ public void invalidXorAssignmentOperationExpr_floatBoxedTypeWithCharTypes() { } @Test - public void invalidXorAssignmentOperationExpr_integerBoxedTypeWithBooleanTypes() { + void invalidXorAssignmentOperationExpr_integerBoxedTypeWithBooleanTypes() { // Swap case in "invalidXorAssignmentOperationExpr_booleanWithIntegerBoxedTypes". VariableExpr lhsExpr = createVariableExpr(TypeNode.INT_OBJECT, "x"); VariableExpr rhsExpr = createVariableExpr(TypeNode.BOOLEAN, "y"); @@ -1088,7 +1088,7 @@ public void invalidXorAssignmentOperationExpr_integerBoxedTypeWithBooleanTypes() } @Test - public void invalidXorAssignmentOperationExpr_integerBoxedWithNullTypes() { + void invalidXorAssignmentOperationExpr_integerBoxedWithNullTypes() { // No need swap case. VariableExpr lhsExpr = createVariableExpr(TypeNode.INT_OBJECT, "x"); ValueExpr rhsExpr = ValueExpr.createNullExpr(); @@ -1098,7 +1098,7 @@ public void invalidXorAssignmentOperationExpr_integerBoxedWithNullTypes() { } @Test - public void invalidXorAssignmentOperationExpr_integerBoxedWithReferenceTypes() { + void invalidXorAssignmentOperationExpr_integerBoxedWithReferenceTypes() { // Swap case in invalidXorAssignmentOperationExpr_referenceWithIntegerBoxedTypes. VariableExpr lhsExpr = createVariableExpr(TypeNode.INT_OBJECT, "x"); VariableExpr rhsExpr = createVariableExpr(TypeNode.STRING, "y"); @@ -1108,7 +1108,7 @@ public void invalidXorAssignmentOperationExpr_integerBoxedWithReferenceTypes() { } @Test - public void invalidXorAssignmentOperationExpr_integerBoxedWithNewObjectTypes() { + void invalidXorAssignmentOperationExpr_integerBoxedWithNewObjectTypes() { // No swap case. VariableExpr lhsExpr = createVariableExpr(TypeNode.INT_OBJECT, "x"); NewObjectExpr rhsExpr = NewObjectExpr.withType(TypeNode.OBJECT); @@ -1119,7 +1119,7 @@ public void invalidXorAssignmentOperationExpr_integerBoxedWithNewObjectTypes() { /** ======= XOR Assignment Operators: LHS is non integer numeric boxed type =========== */ @Test - public void invalidXorAssignmentOperationExpr_longBoxedTypeWithIntegerBoxedType() { + void invalidXorAssignmentOperationExpr_longBoxedTypeWithIntegerBoxedType() { // Swap case in "validXorAssignmentOperationExpr_integerBoxedTypeWithLongBoxedType". VariableExpr lhsExpr = createVariableExpr(TypeNode.LONG_OBJECT, "x"); VariableExpr rhsExpr = createVariableExpr(TypeNode.INT_OBJECT, "y"); @@ -1129,7 +1129,7 @@ public void invalidXorAssignmentOperationExpr_longBoxedTypeWithIntegerBoxedType( } @Test - public void invalidXorAssignmentOperationExpr_shortBoxedTypeWithIntegerBoxedType() { + void invalidXorAssignmentOperationExpr_shortBoxedTypeWithIntegerBoxedType() { // Swap case in "validXorAssignmentOperationExpr_integerBoxedTypeWithShortBoxedType". VariableExpr lhsExpr = createVariableExpr(TypeNode.SHORT_OBJECT, "x"); VariableExpr rhsExpr = createVariableExpr(TypeNode.INT_OBJECT, "y"); @@ -1139,7 +1139,7 @@ public void invalidXorAssignmentOperationExpr_shortBoxedTypeWithIntegerBoxedType } @Test - public void invalidXorAssignmentOperationExpr_charBoxedTypeWithIntegerType() { + void invalidXorAssignmentOperationExpr_charBoxedTypeWithIntegerType() { // No swap case need. VariableExpr lhsExpr = createVariableExpr(TypeNode.CHAR_OBJECT, "x"); VariableExpr rhsExpr = createVariableExpr(TypeNode.INT, "y"); @@ -1149,7 +1149,7 @@ public void invalidXorAssignmentOperationExpr_charBoxedTypeWithIntegerType() { } @Test - public void invalidXorAssignmentOperationExpr_byteBoxedTypeWithIntegerType() { + void invalidXorAssignmentOperationExpr_byteBoxedTypeWithIntegerType() { // No swap case need. VariableExpr lhsExpr = createVariableExpr(TypeNode.BYTE_OBJECT, "x"); VariableExpr rhsExpr = createVariableExpr(TypeNode.INT, "y"); @@ -1160,7 +1160,7 @@ public void invalidXorAssignmentOperationExpr_byteBoxedTypeWithIntegerType() { /** ============= XOR Assignment Operators: LHS is non primitive type ================= */ @Test - public void invalidXorAssignmentOperationExpr_referencedTypeWithBooleanTypes() { + void invalidXorAssignmentOperationExpr_referencedTypeWithBooleanTypes() { // Swap case in "invalidXorAssignmentOperationExpr_booleanWithReferencedTypes". VariableExpr lhsExpr = createVariableExpr(TypeNode.STRING, "x"); VariableExpr rhsExpr = createVariableExpr(TypeNode.BOOLEAN, "y"); @@ -1170,7 +1170,7 @@ public void invalidXorAssignmentOperationExpr_referencedTypeWithBooleanTypes() { } @Test - public void invalidXorAssignmentOperationExpr_referencedTypeWithCharTypes() { + void invalidXorAssignmentOperationExpr_referencedTypeWithCharTypes() { // Swap case in "invalidXorAssignmentOperationExpr_integerWithReferencedTypes". VariableExpr lhsExpr = createVariableExpr(TypeNode.STRING, "x"); VariableExpr rhsExpr = createVariableExpr(TypeNode.CHAR, "y"); @@ -1180,7 +1180,7 @@ public void invalidXorAssignmentOperationExpr_referencedTypeWithCharTypes() { } @Test - public void invalidXorAssignmentOperationExpr_ReferenceTypeWithIntegerBoxedType() { + void invalidXorAssignmentOperationExpr_ReferenceTypeWithIntegerBoxedType() { // Swap case in "invalidXorAssignmentOperationExpr_referenceWithIntegerBoxedType". VariableExpr lhsExpr = createVariableExpr(TypeNode.STRING, "x"); VariableExpr rhsExpr = createVariableExpr(TypeNode.INT_OBJECT, "y"); @@ -1190,7 +1190,7 @@ public void invalidXorAssignmentOperationExpr_ReferenceTypeWithIntegerBoxedType( } @Test - public void invalidXorAssignmentOperationExpr_voidType() { + void invalidXorAssignmentOperationExpr_voidType() { // No need swap case. VariableExpr lhsExprExpr = createVariableExpr(TypeNode.BOOLEAN, "x"); MethodInvocationExpr rhsExpr = @@ -1202,7 +1202,7 @@ public void invalidXorAssignmentOperationExpr_voidType() { /** =========== XOR Assignment Operators: Variable is declaration ================ */ @Test - public void invalidXorAssignmentOperationExpr_variableExprIsDecl() { + void invalidXorAssignmentOperationExpr_variableExprIsDecl() { Variable variable = Variable.builder().setName("x").setType(TypeNode.INT).build(); VariableExpr lhsExpr = VariableExpr.builder().setVariable(variable).setIsDecl(true).build(); VariableExpr rhsExpr = createVariableExpr(TypeNode.INT, "y"); @@ -1212,7 +1212,7 @@ public void invalidXorAssignmentOperationExpr_variableExprIsDecl() { } @Test - public void invalidXorAssignmentOperationExpr_valueExprIsDecl() { + void invalidXorAssignmentOperationExpr_valueExprIsDecl() { VariableExpr lhsExpr = createVariableExpr(TypeNode.INT, "x"); Variable variable = Variable.builder().setName("x").setType(TypeNode.INT).build(); VariableExpr rhsExpr = VariableExpr.builder().setVariable(variable).setIsDecl(true).build(); @@ -1222,7 +1222,7 @@ public void invalidXorAssignmentOperationExpr_valueExprIsDecl() { } @Test - public void invalidXorAssignmentOperationExpr_variableExprAndValueExprIsDecl() { + void invalidXorAssignmentOperationExpr_variableExprAndValueExprIsDecl() { Variable lVariable = Variable.builder().setName("x").setType(TypeNode.INT).build(); VariableExpr lhsExpr = VariableExpr.builder().setVariable(lVariable).setIsDecl(true).build(); Variable rVariable = Variable.builder().setName("y").setType(TypeNode.INT).build(); diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/engine/ast/CastExprTest.java b/gapic-generator-java/src/test/java/com/google/api/generator/engine/ast/CastExprTest.java index 04bb8a05ca..4d79d3c7ac 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/engine/ast/CastExprTest.java +++ b/gapic-generator-java/src/test/java/com/google/api/generator/engine/ast/CastExprTest.java @@ -16,11 +16,11 @@ import static org.junit.Assert.assertThrows; -import org.junit.Test; +import org.junit.jupiter.api.Test; -public class CastExprTest { +class CastExprTest { @Test - public void validCastExpr_basic() { + void validCastExpr_basic() { Variable variable = Variable.builder().setName("x").setType(TypeNode.STRING).build(); VariableExpr variableExpr = VariableExpr.builder().setVariable(variable).build(); CastExpr.builder() @@ -31,7 +31,7 @@ public void validCastExpr_basic() { } @Test - public void validCastExpr_basicNull() { + void validCastExpr_basicNull() { CastExpr.builder() .setType(TypeNode.withReference(ConcreteReference.withClazz(Object.class))) .setExpr(ValueExpr.createNullExpr()) @@ -40,7 +40,7 @@ public void validCastExpr_basicNull() { } @Test - public void validCastExpr_basicPrimitiveSame() { + void validCastExpr_basicPrimitiveSame() { Variable variable = Variable.builder().setName("x").setType(TypeNode.LONG).build(); VariableExpr variableExpr = VariableExpr.builder().setVariable(variable).build(); CastExpr.builder().setType(TypeNode.LONG).setExpr(variableExpr).build(); @@ -48,7 +48,7 @@ public void validCastExpr_basicPrimitiveSame() { } @Test - public void validCastExpr_basicPrimitiveBoolean() { + void validCastExpr_basicPrimitiveBoolean() { Variable variable = Variable.builder().setName("x").setType(TypeNode.BOOLEAN).build(); VariableExpr variableExpr = VariableExpr.builder().setVariable(variable).build(); CastExpr.builder().setType(TypeNode.BOOLEAN).setExpr(variableExpr).build(); @@ -56,7 +56,7 @@ public void validCastExpr_basicPrimitiveBoolean() { } @Test - public void validCastExpr_basicPrimitiveNarrowing() { + void validCastExpr_basicPrimitiveNarrowing() { Variable variable = Variable.builder().setName("x").setType(TypeNode.LONG).build(); VariableExpr variableExpr = VariableExpr.builder().setVariable(variable).build(); CastExpr.builder().setType(TypeNode.INT).setExpr(variableExpr).build(); @@ -70,7 +70,7 @@ public void validCastExpr_basicPrimitiveNarrowing() { } @Test - public void validCastExpr_basicPrimitiveWidening() { + void validCastExpr_basicPrimitiveWidening() { Variable variable = Variable.builder().setName("x").setType(TypeNode.INT).build(); VariableExpr variableExpr = VariableExpr.builder().setVariable(variable).build(); CastExpr.builder().setType(TypeNode.LONG).setExpr(variableExpr).build(); @@ -83,21 +83,21 @@ public void validCastExpr_basicPrimitiveWidening() { } @Test - public void validCastExpr_castPrimitiveToBoxedType() { + void validCastExpr_castPrimitiveToBoxedType() { PrimitiveValue intValue = PrimitiveValue.builder().setValue("3").setType(TypeNode.INT).build(); ValueExpr valueExpr = ValueExpr.withValue(intValue); CastExpr.builder().setType(TypeNode.INT_OBJECT).setExpr(valueExpr).build(); } @Test - public void validCastExpr_castBoxedTypeToPrimitive() { + void validCastExpr_castBoxedTypeToPrimitive() { Variable variable = Variable.builder().setName("x").setType(TypeNode.DOUBLE_OBJECT).build(); VariableExpr variableExpr = VariableExpr.builder().setVariable(variable).build(); CastExpr.builder().setType(TypeNode.DOUBLE).setExpr(variableExpr).build(); } @Test - public void validCastExpr_booleanToBoxedType() { + void validCastExpr_booleanToBoxedType() { PrimitiveValue booleanValue = PrimitiveValue.builder().setValue("true").setType(TypeNode.BOOLEAN).build(); ValueExpr valueExpr = ValueExpr.withValue(booleanValue); @@ -105,14 +105,14 @@ public void validCastExpr_booleanToBoxedType() { } @Test - public void validCastExpr_castBooleanToPrimitive() { + void validCastExpr_castBooleanToPrimitive() { Variable variable = Variable.builder().setName("x").setType(TypeNode.BOOLEAN_OBJECT).build(); VariableExpr variableExpr = VariableExpr.builder().setVariable(variable).build(); CastExpr.builder().setType(TypeNode.BOOLEAN).setExpr(variableExpr).build(); } @Test - public void invalidCastExpr_castBoxedPrimitiveArray() { + void invalidCastExpr_castBoxedPrimitiveArray() { TypeNode intArray = TypeNode.builder().setTypeKind(TypeNode.TypeKind.INT).setIsArray(true).build(); TypeNode integerArray = @@ -129,7 +129,7 @@ public void invalidCastExpr_castBoxedPrimitiveArray() { } @Test - public void invalidCastExpr_castObjectToPrimitive() { + void invalidCastExpr_castObjectToPrimitive() { Variable variable = Variable.builder().setName("x").setType(TypeNode.STRING).build(); VariableExpr variableExpr = VariableExpr.builder().setVariable(variable).build(); assertThrows( @@ -138,7 +138,7 @@ public void invalidCastExpr_castObjectToPrimitive() { } @Test - public void invalidCastExpr_castPrimitiveToObject() { + void invalidCastExpr_castPrimitiveToObject() { Variable variable = Variable.builder().setName("x").setType(TypeNode.INT).build(); VariableExpr variableExpr = VariableExpr.builder().setVariable(variable).build(); assertThrows( @@ -151,7 +151,7 @@ public void invalidCastExpr_castPrimitiveToObject() { } @Test - public void invalidCastExpr_castBooleanToNumeric() { + void invalidCastExpr_castBooleanToNumeric() { Variable variable = Variable.builder().setName("x").setType(TypeNode.BOOLEAN).build(); VariableExpr variableExpr = VariableExpr.builder().setVariable(variable).build(); assertThrows( @@ -160,7 +160,7 @@ public void invalidCastExpr_castBooleanToNumeric() { } @Test - public void invalidCastExpr_castNumericToBoolean() { + void invalidCastExpr_castNumericToBoolean() { Variable variable = Variable.builder().setName("x").setType(TypeNode.INT).build(); VariableExpr variableExpr = VariableExpr.builder().setVariable(variable).build(); assertThrows( @@ -169,7 +169,7 @@ public void invalidCastExpr_castNumericToBoolean() { } @Test - public void invalidCastExpr_castToVoidType() { + void invalidCastExpr_castToVoidType() { Variable variable = Variable.builder().setName("x").setType(TypeNode.INT).build(); VariableExpr variableExpr = VariableExpr.builder().setVariable(variable).build(); assertThrows( diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/engine/ast/ClassDefinitionTest.java b/gapic-generator-java/src/test/java/com/google/api/generator/engine/ast/ClassDefinitionTest.java index d08ad60225..964eefa3c8 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/engine/ast/ClassDefinitionTest.java +++ b/gapic-generator-java/src/test/java/com/google/api/generator/engine/ast/ClassDefinitionTest.java @@ -18,12 +18,12 @@ import java.util.Arrays; import java.util.List; -import org.junit.Test; +import org.junit.jupiter.api.Test; -public class ClassDefinitionTest { +class ClassDefinitionTest { @Test - public void validClassDefinition_basicWithCommentsAndHeader() { + void validClassDefinition_basicWithCommentsAndHeader() { LineComment lineComment = LineComment.withComment("AUTO-GENERATED DOCUMENTATION AND CLASS"); JavaDocComment javaDocComment = JavaDocComment.builder() @@ -45,7 +45,7 @@ public void validClassDefinition_basicWithCommentsAndHeader() { } @Test - public void validClassDefinition_exprCommentAndBlockStatements() { + void validClassDefinition_exprCommentAndBlockStatements() { ClassDefinition.builder() .setName("LibraryServiceStub") .setIsNested(true) @@ -74,7 +74,7 @@ public void validClassDefinition_exprCommentAndBlockStatements() { } @Test - public void validClassDefinition_nestedBasic() { + void validClassDefinition_nestedBasic() { ClassDefinition.builder() .setName("LibraryServiceStub") .setIsNested(true) @@ -92,7 +92,7 @@ public void validClassDefinition_nestedBasic() { } @Test - public void validClassDefinition_withAnnotationsExtendsAndImplements() { + void validClassDefinition_withAnnotationsExtendsAndImplements() { ClassDefinition.builder() .setPackageString("com.google.example.library.v1.stub") .setName("LibraryServiceStub") @@ -110,7 +110,7 @@ public void validClassDefinition_withAnnotationsExtendsAndImplements() { } @Test - public void validClassDefinition_statementsAndMethods() { + void validClassDefinition_statementsAndMethods() { List statements = Arrays.asList( ExprStatement.withExpr(createAssignmentExpr()), @@ -149,7 +149,7 @@ public void validClassDefinition_statementsAndMethods() { } @Test - public void invalidClassDefinition_nestedWithFileHeader() { + void invalidClassDefinition_nestedWithFileHeader() { assertThrows( IllegalStateException.class, () -> { @@ -164,7 +164,7 @@ public void invalidClassDefinition_nestedWithFileHeader() { } @Test - public void invalidClassDefinition_implementsNullType() { + void invalidClassDefinition_implementsNullType() { assertThrows( IllegalStateException.class, () -> { @@ -178,7 +178,7 @@ public void invalidClassDefinition_implementsNullType() { } @Test - public void invalidClassDefinition_outerClassMissingPackage() { + void invalidClassDefinition_outerClassMissingPackage() { assertThrows( NullPointerException.class, () -> { @@ -190,7 +190,7 @@ public void invalidClassDefinition_outerClassMissingPackage() { } @Test - public void invalidClassDefinition_outerClassStatic() { + void invalidClassDefinition_outerClassStatic() { assertThrows( IllegalStateException.class, () -> { @@ -204,7 +204,7 @@ public void invalidClassDefinition_outerClassStatic() { } @Test - public void invalidClassDefinition_outerClassPrivate() { + void invalidClassDefinition_outerClassPrivate() { assertThrows( IllegalStateException.class, () -> { @@ -217,7 +217,7 @@ public void invalidClassDefinition_outerClassPrivate() { } @Test - public void invalidClassDefinition_extendsPrimitiveType() { + void invalidClassDefinition_extendsPrimitiveType() { assertThrows( IllegalStateException.class, () -> { @@ -231,7 +231,7 @@ public void invalidClassDefinition_extendsPrimitiveType() { } @Test - public void invalidClassDefinition_extendsNullType() { + void invalidClassDefinition_extendsNullType() { assertThrows( IllegalStateException.class, () -> { @@ -245,7 +245,7 @@ public void invalidClassDefinition_extendsNullType() { } @Test - public void invalidClassDefinition_abstractFinal() { + void invalidClassDefinition_abstractFinal() { assertThrows( IllegalStateException.class, () -> { @@ -261,7 +261,7 @@ public void invalidClassDefinition_abstractFinal() { } @Test - public void invalidClassDefinition_implementsPrimtiveType() { + void invalidClassDefinition_implementsPrimtiveType() { assertThrows( IllegalStateException.class, () -> { @@ -275,7 +275,7 @@ public void invalidClassDefinition_implementsPrimtiveType() { } @Test - public void invalidClassDefinition_extendsImplementsSameType() { + void invalidClassDefinition_extendsImplementsSameType() { TypeNode cloneableType = TypeNode.withReference(ConcreteReference.withClazz(Cloneable.class)); assertThrows( IllegalStateException.class, @@ -294,32 +294,7 @@ public void invalidClassDefinition_extendsImplementsSameType() { } @Test - public void invalidClassDefinition_assignmentWithUnscopedVariableExprStatement() { - Variable variable = createVariable("x", TypeNode.INT); - VariableExpr variableExpr = - VariableExpr.builder().setVariable(variable).setIsDecl(true).build(); - - Variable anotherVariable = createVariable("y", TypeNode.INT); - Expr valueExpr = VariableExpr.builder().setVariable(anotherVariable).build(); - - AssignmentExpr assignmentExpr = - AssignmentExpr.builder().setVariableExpr(variableExpr).setValueExpr(valueExpr).build(); - - List statements = Arrays.asList(ExprStatement.withExpr(assignmentExpr)); - assertThrows( - IllegalStateException.class, - () -> { - ClassDefinition.builder() - .setPackageString("com.google.example.library.v1.stub") - .setName("LibraryServiceStub") - .setScope(ScopeNode.PUBLIC) - .setStatements(statements) - .build(); - }); - } - - @Test - public void invalidClassDefinition_unscopedVariableExprStatement() { + void invalidClassDefinition_unscopedVariableExprStatement() { List statements = Arrays.asList( ExprStatement.withExpr(createAssignmentExpr()), @@ -341,7 +316,7 @@ public void invalidClassDefinition_unscopedVariableExprStatement() { } @Test - public void invalidClassDefinition_badStatementType() { + void invalidClassDefinition_badStatementType() { List statements = Arrays.asList(createForStatement()); assertThrows( IllegalStateException.class, @@ -392,6 +367,7 @@ private static ForStatement createForStatement() { .setBody(Arrays.asList(ExprStatement.withExpr(createAssignmentExpr()))) .build(); } + // Create a simple block comment to stand for the Apache License header. private static List createFileHeader() { return Arrays.asList(CommentStatement.withComment(BlockComment.withComment("Apache License"))); diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/engine/ast/ConcreteReferenceTest.java b/gapic-generator-java/src/test/java/com/google/api/generator/engine/ast/ConcreteReferenceTest.java index 6fdc65a937..f0786fbe3c 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/engine/ast/ConcreteReferenceTest.java +++ b/gapic-generator-java/src/test/java/com/google/api/generator/engine/ast/ConcreteReferenceTest.java @@ -23,18 +23,18 @@ import java.util.HashMap; import java.util.List; import java.util.Map; -import org.junit.Test; +import org.junit.jupiter.api.Test; -public class ConcreteReferenceTest { +class ConcreteReferenceTest { @Test - public void basicConcreteReference() { + void basicConcreteReference() { Reference reference = ConcreteReference.builder().setClazz(Integer.class).build(); assertEquals(Integer.class.getSimpleName(), reference.name()); assertFalse(reference.isStaticImport()); } @Test - public void basicConcreteReference_setIsStaticImport() { + void basicConcreteReference_setIsStaticImport() { Reference reference = ConcreteReference.builder().setClazz(Integer.class).setIsStaticImport(true).build(); assertEquals(Integer.class.getSimpleName(), reference.name()); @@ -42,14 +42,14 @@ public void basicConcreteReference_setIsStaticImport() { } @Test - public void basicConcreteReference_nested() { + void basicConcreteReference_nested() { Reference reference = ConcreteReference.builder().setClazz(Map.Entry.class).build(); assertEquals("Map.Entry", reference.name()); assertFalse(reference.isStaticImport()); } @Test - public void basicConcreteReference_nestedAndStaticImport() { + void basicConcreteReference_nestedAndStaticImport() { Reference reference = ConcreteReference.builder().setClazz(Map.Entry.class).setIsStaticImport(true).build(); assertEquals(Map.Entry.class.getSimpleName(), reference.name()); @@ -57,7 +57,7 @@ public void basicConcreteReference_nestedAndStaticImport() { } @Test - public void parameterizedConcreteReference() { + void parameterizedConcreteReference() { Reference reference = ConcreteReference.builder() .setClazz(HashMap.class) @@ -71,7 +71,7 @@ public void parameterizedConcreteReference() { } @Test - public void nestedParameterizedConcreteReference() { + void nestedParameterizedConcreteReference() { Reference mapReference = ConcreteReference.builder() .setClazz(HashMap.class) @@ -96,7 +96,7 @@ public void nestedParameterizedConcreteReference() { } @Test - public void isSupertype_basic() { + void isSupertype_basic() { assertTrue(TypeNode.STRING.isSupertypeOrEquals(TypeNode.STRING)); assertFalse(TypeNode.INT.isSupertypeOrEquals(TypeNode.STRING)); assertFalse(TypeNode.STRING.isSupertypeOrEquals(TypeNode.INT)); @@ -109,7 +109,7 @@ public void isSupertype_basic() { } @Test - public void isSupertype_nestedGenerics() { + void isSupertype_nestedGenerics() { Reference stringRef = ConcreteReference.withClazz(String.class); TypeNode typeOne = TypeNode.withReference( @@ -142,7 +142,7 @@ public void isSupertype_nestedGenerics() { } @Test - public void wildcards() { + void wildcards() { assertEquals(ConcreteReference.wildcard().name(), "?"); assertEquals( "? extends String", @@ -150,7 +150,7 @@ public void wildcards() { } @Test - public void isAssignableFrom_concreteRef() { + void isAssignableFrom_concreteRef() { assertFalse( ConcreteReference.withClazz(List.class) .isAssignableFrom(ConcreteReference.withClazz(Map.class))); @@ -195,7 +195,7 @@ public void isAssignableFrom_concreteRef() { } @Test - public void isAssignableFrom_vaporRef() { + void isAssignableFrom_vaporRef() { assertFalse( ConcreteReference.withClazz(List.class) .isAssignableFrom( @@ -207,7 +207,7 @@ public void isAssignableFrom_vaporRef() { } @Test - public void isAssignableFrom_vaporRefWithConcreteRefSupertype() { + void isAssignableFrom_vaporRefWithConcreteRefSupertype() { assertTrue( ConcreteReference.withClazz(List.class) .isAssignableFrom( diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/engine/ast/EnumRefExprTest.java b/gapic-generator-java/src/test/java/com/google/api/generator/engine/ast/EnumRefExprTest.java index 436f00a536..6cc79fe697 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/engine/ast/EnumRefExprTest.java +++ b/gapic-generator-java/src/test/java/com/google/api/generator/engine/ast/EnumRefExprTest.java @@ -16,25 +16,25 @@ import static org.junit.Assert.assertThrows; -import org.junit.Test; +import org.junit.jupiter.api.Test; -public class EnumRefExprTest { +class EnumRefExprTest { @Test - public void validEnumRefExpr_basic() { + void validEnumRefExpr_basic() { TypeNode enumType = TypeNode.withReference(ConcreteReference.withClazz(TypeNode.TypeKind.class)); EnumRefExpr.builder().setName("VOID").setType(enumType).build(); } @Test - public void invalidEnumRefExpr_primitiveType() { + void invalidEnumRefExpr_primitiveType() { assertThrows( IllegalStateException.class, () -> EnumRefExpr.builder().setName("VOID").setType(TypeNode.INT).build()); } @Test - public void invalidEnumRefExpr_nullType() { + void invalidEnumRefExpr_nullType() { assertThrows( IllegalStateException.class, () -> EnumRefExpr.builder().setName("VOID").setType(TypeNode.NULL).build()); diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/engine/ast/ExprStatementTest.java b/gapic-generator-java/src/test/java/com/google/api/generator/engine/ast/ExprStatementTest.java index d97a3ddce3..b87711d645 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/engine/ast/ExprStatementTest.java +++ b/gapic-generator-java/src/test/java/com/google/api/generator/engine/ast/ExprStatementTest.java @@ -17,12 +17,12 @@ import static com.google.common.truth.Truth.assertThat; import static org.junit.Assert.assertThrows; -import org.junit.Test; +import org.junit.jupiter.api.Test; -public class ExprStatementTest { +class ExprStatementTest { @Test - public void validExprStatement_method() { + void validExprStatement_method() { TypeNode someType = TypeNode.withReference( VaporReference.builder() @@ -39,13 +39,13 @@ public void validExprStatement_method() { } @Test - public void validExprStatement_variable() { + void validExprStatement_variable() { Variable variable = Variable.builder().setName("x").setType(TypeNode.INT).build(); assertValidExprStatement(VariableExpr.builder().setVariable(variable).setIsDecl(true).build()); } @Test - public void validExprStatement_assignment() { + void validExprStatement_assignment() { Variable variable = Variable.builder().setName("x").setType(TypeNode.INT).build(); VariableExpr variableExpr = VariableExpr.builder().setVariable(variable).setIsDecl(true).build(); @@ -59,20 +59,20 @@ public void validExprStatement_assignment() { } @Test - public void validExprStatement_throw() { + void validExprStatement_throw() { TypeNode npeType = TypeNode.withReference(ConcreteReference.withClazz(NullPointerException.class)); assertValidExprStatement(ThrowExpr.builder().setType(npeType).build()); } @Test - public void validExprStatement_return() { + void validExprStatement_return() { assertValidExprStatement( ReturnExpr.withExpr(ValueExpr.withValue(StringObjectValue.withValue("asdf")))); } @Test - public void validExprStatement_unaryOperation() { + void validExprStatement_unaryOperation() { assertValidExprStatement( UnaryOperationExpr.postfixIncrementWithExpr( VariableExpr.withVariable( @@ -80,7 +80,7 @@ public void validExprStatement_unaryOperation() { } @Test - public void validExprStatement_assignmentOperationExpr() { + void validExprStatement_assignmentOperationExpr() { VariableExpr lhsExpr = VariableExpr.withVariable(Variable.builder().setName("i").setType(TypeNode.INT).build()); ValueExpr rhsExpr = @@ -89,21 +89,21 @@ public void validExprStatement_assignmentOperationExpr() { } @Test - public void invalidExprStatement_variable() { + void invalidExprStatement_variable() { Variable variable = Variable.builder().setType(TypeNode.INT).setName("libraryClient").build(); VariableExpr varExpr = VariableExpr.builder().setVariable(variable).build(); assertInvalidExprStatement(varExpr); } @Test - public void invalidExprStatement_value() { + void invalidExprStatement_value() { Value value = PrimitiveValue.builder().setType(TypeNode.INT).setValue("3").build(); ValueExpr valueExpr = ValueExpr.builder().setValue(value).build(); assertInvalidExprStatement(valueExpr); } @Test - public void invalidExprStatement_logicalNotUnaryOperator() { + void invalidExprStatement_logicalNotUnaryOperator() { Expr logicalNotExpr = UnaryOperationExpr.logicalNotWithExpr( VariableExpr.withVariable( diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/engine/ast/ForStatementTest.java b/gapic-generator-java/src/test/java/com/google/api/generator/engine/ast/ForStatementTest.java index 569eebb3c0..5d44157e73 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/engine/ast/ForStatementTest.java +++ b/gapic-generator-java/src/test/java/com/google/api/generator/engine/ast/ForStatementTest.java @@ -18,12 +18,12 @@ import static org.junit.Assert.assertThrows; import java.util.Arrays; -import org.junit.Test; +import org.junit.jupiter.api.Test; -public class ForStatementTest { +class ForStatementTest { @Test - public void validForStatement() { + void validForStatement() { Variable variable = Variable.builder().setName("str").setType(TypeNode.STRING).build(); VariableExpr variableExpr = VariableExpr.builder().setVariable(variable).setIsDecl(true).build(); @@ -41,7 +41,7 @@ public void validForStatement() { } @Test - public void invalidForStatement() { + void invalidForStatement() { Variable variable = Variable.builder().setName("str").setType(TypeNode.STRING).build(); VariableExpr variableExpr = VariableExpr.builder().setVariable(variable).build(); diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/engine/ast/GeneralForStatementTest.java b/gapic-generator-java/src/test/java/com/google/api/generator/engine/ast/GeneralForStatementTest.java index 4d14429c1a..9b9d3af6ae 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/engine/ast/GeneralForStatementTest.java +++ b/gapic-generator-java/src/test/java/com/google/api/generator/engine/ast/GeneralForStatementTest.java @@ -18,13 +18,13 @@ import java.util.Arrays; import java.util.Collections; -import org.junit.Test; +import org.junit.jupiter.api.Test; -public class GeneralForStatementTest { +class GeneralForStatementTest { /** ============================== incrementWith ====================================== */ @Test // validGeneralForStatement_basicIsDecl tests declare a variable inside in initialization expr. - public void validGeneralForStatement_basicIsDecl() { + void validGeneralForStatement_basicIsDecl() { Variable variable = Variable.builder().setName("i").setType(TypeNode.INT).build(); VariableExpr variableExpr = VariableExpr.builder().setVariable(variable).setIsDecl(true).build(); @@ -41,7 +41,7 @@ public void validGeneralForStatement_basicIsDecl() { @Test // validGeneralForStatement_basicIsNotDecl tests assigning a method-level local variable in // initialization expr. - public void validGeneralForStatement_basicIsNotDecl() { + void validGeneralForStatement_basicIsNotDecl() { Variable variable = Variable.builder().setName("i").setType(TypeNode.INT).build(); VariableExpr variableExpr = VariableExpr.builder().setVariable(variable).setIsDecl(false).build(); @@ -57,7 +57,7 @@ public void validGeneralForStatement_basicIsNotDecl() { @Test // validGeneralForStatement_emptyBody tests set empty body in update expr. - public void validGeneralForStatement_emptyBody() { + void validGeneralForStatement_emptyBody() { Variable variable = Variable.builder().setName("i").setType(TypeNode.INT).build(); VariableExpr variableExpr = VariableExpr.builder().setVariable(variable).setIsDecl(false).build(); @@ -74,7 +74,7 @@ public void validGeneralForStatement_emptyBody() { @Test // validForStatement_privateNotIsDeclVariable tests assigning an instance variable with private // scope. - public void validForStatement_privateNotIsDeclVariable() { + void validForStatement_privateNotIsDeclVariable() { Variable variable = Variable.builder().setName("i").setType(TypeNode.INT).build(); VariableExpr variableExpr = VariableExpr.builder() @@ -91,9 +91,9 @@ public void validForStatement_privateNotIsDeclVariable() { } @Test - // validForStatement_instanceStaticVariable tests assigning an instance variable with public scope + // validForStatement_instanceStaticVariable tests assigning an instance variable with scope // and static modifier. - public void validForStatement_instanceStaticVariable() { + void validForStatement_instanceStaticVariable() { Variable variable = Variable.builder().setName("i").setType(TypeNode.INT).build(); VariableExpr variableExpr = VariableExpr.builder() @@ -113,7 +113,7 @@ public void validForStatement_instanceStaticVariable() { @Test // invalidForStatement_privateIsDeclVariable tests declaring a non-local variable inside of // for-loop. - public void invalidForStatement_privateIsDeclVariable() { + void invalidForStatement_privateIsDeclVariable() { Variable variable = Variable.builder().setName("i").setType(TypeNode.INT).build(); VariableExpr variableExpr = VariableExpr.builder() @@ -136,7 +136,7 @@ public void invalidForStatement_privateIsDeclVariable() { @Test // invalidForStatement_staticIsDeclVariable tests declare a static local variable in // initialization expr. - public void invalidForStatement_staticIsDeclVariable() { + void invalidForStatement_staticIsDeclVariable() { Variable variable = Variable.builder().setName("i").setType(TypeNode.INT).build(); VariableExpr variableExpr = VariableExpr.builder().setVariable(variable).setIsDecl(true).setIsStatic(true).build(); @@ -155,7 +155,7 @@ public void invalidForStatement_staticIsDeclVariable() { @Test // invalidForStatement_finalIsNotDeclVariable tests invalid case of assigning the initial value to // a variable which is declared as a final instance variable. - public void invalidForStatement_finalIsNotDeclVariable() { + void invalidForStatement_finalIsNotDeclVariable() { Variable variable = Variable.builder().setName("i").setType(TypeNode.INT).build(); VariableExpr variableExpr = VariableExpr.builder() @@ -179,7 +179,7 @@ public void invalidForStatement_finalIsNotDeclVariable() { @Test // invalidForStatement_localFinalVariable tests declare a final variable in initialization expr, // updateExpr should throw error. - public void invalidForStatement_localFinalVariable() { + void invalidForStatement_localFinalVariable() { Variable variable = Variable.builder().setName("i").setType(TypeNode.INT).build(); VariableExpr variableExpr = VariableExpr.builder().setVariable(variable).setIsDecl(true).setIsFinal(true).build(); diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/engine/ast/IdentifierNodeTest.java b/gapic-generator-java/src/test/java/com/google/api/generator/engine/ast/IdentifierNodeTest.java index ead7d8be37..d0df3bd62f 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/engine/ast/IdentifierNodeTest.java +++ b/gapic-generator-java/src/test/java/com/google/api/generator/engine/ast/IdentifierNodeTest.java @@ -18,11 +18,11 @@ import static org.junit.Assert.assertThrows; import com.google.api.generator.engine.ast.IdentifierNode.InvalidIdentifierException; -import org.junit.Test; +import org.junit.jupiter.api.Test; -public class IdentifierNodeTest { +class IdentifierNodeTest { @Test - public void createIdentifier_basic() { + void createIdentifier_basic() { assertValidIdentifier("foobar"); assertValidIdentifier("x"); assertValidIdentifier("afalse"); @@ -34,7 +34,7 @@ public void createIdentifier_basic() { } @Test - public void createIdentifier_nameHasLiteral() { + void createIdentifier_nameHasLiteral() { assertValidIdentifier("a123L"); assertValidIdentifier("a10e3"); assertValidIdentifier("anull"); @@ -51,7 +51,7 @@ public void createIdentifier_nameHasLiteral() { } @Test - public void createIdentifier_namdHasInvalidSymbols() { + void createIdentifier_namdHasInvalidSymbols() { assertInvalidIdentifier("a.b"); assertInvalidIdentifier("a,b"); assertInvalidIdentifier("a-b"); @@ -81,7 +81,7 @@ public void createIdentifier_namdHasInvalidSymbols() { } @Test - public void createIdentifier_nameHasKeyword() { + void createIdentifier_nameHasKeyword() { assertValidIdentifier("aclass"); // Random sampling of keywords. diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/engine/ast/IfStatementTest.java b/gapic-generator-java/src/test/java/com/google/api/generator/engine/ast/IfStatementTest.java index 46e183d6e0..ab2f8c5674 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/engine/ast/IfStatementTest.java +++ b/gapic-generator-java/src/test/java/com/google/api/generator/engine/ast/IfStatementTest.java @@ -18,11 +18,11 @@ import java.util.Arrays; import java.util.List; -import org.junit.Test; +import org.junit.jupiter.api.Test; -public class IfStatementTest { +class IfStatementTest { @Test - public void validIfStatement_simple() { + void validIfStatement_simple() { IfStatement ifStatement = IfStatement.builder() .setConditionExpr(createConditionExpr("condition")) @@ -32,7 +32,7 @@ public void validIfStatement_simple() { } @Test - public void validIfStatement_booleanObjectCondition() { + void validIfStatement_booleanObjectCondition() { // The condition expression type can be boolean or its boxed type. VariableExpr condExpr = VariableExpr.withVariable( @@ -47,7 +47,7 @@ public void validIfStatement_booleanObjectCondition() { } @Test - public void validIfStatement_elseIfsAndElse() { + void validIfStatement_elseIfsAndElse() { VariableExpr condExpr = createConditionExpr("condition"); VariableExpr secondCondExpr = createConditionExpr("secondCondExpr"); VariableExpr thirdCondExpr = createConditionExpr("thirdCondExpr"); @@ -64,7 +64,7 @@ public void validIfStatement_elseIfsAndElse() { } @Test - public void validIfStatement_nested() { + void validIfStatement_nested() { VariableExpr condExpr = createConditionExpr("condition"); VariableExpr nestedCondExpr = createConditionExpr("nestedCondition"); IfStatement nestedIfStatement = diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/engine/ast/InstanceofExprTest.java b/gapic-generator-java/src/test/java/com/google/api/generator/engine/ast/InstanceofExprTest.java index ba53349f85..382c0ebb8c 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/engine/ast/InstanceofExprTest.java +++ b/gapic-generator-java/src/test/java/com/google/api/generator/engine/ast/InstanceofExprTest.java @@ -17,11 +17,11 @@ import static com.google.common.truth.Truth.assertThat; import static org.junit.Assert.assertThrows; -import org.junit.Test; +import org.junit.jupiter.api.Test; -public class InstanceofExprTest { +class InstanceofExprTest { @Test - public void validInstanceofExpr_basicExprPrimitiveType() { + void validInstanceofExpr_basicExprPrimitiveType() { Variable variable = Variable.builder().setName("x").setType(TypeNode.INT).build(); VariableExpr variableExpr = VariableExpr.builder().setVariable(variable).build(); InstanceofExpr expr = @@ -32,7 +32,7 @@ public void validInstanceofExpr_basicExprPrimitiveType() { } @Test - public void validInstanceofExpr_basicExprObjectType() { + void validInstanceofExpr_basicExprObjectType() { Variable variable = Variable.builder().setName("x").setType(TypeNode.STRING).build(); VariableExpr variableExpr = VariableExpr.builder().setVariable(variable).build(); InstanceofExpr.builder().setCheckType(TypeNode.STRING).setExpr(variableExpr).build(); @@ -40,7 +40,7 @@ public void validInstanceofExpr_basicExprObjectType() { } @Test - public void invalidInstanceofExpr_primitiveObjectType() { + void invalidInstanceofExpr_primitiveObjectType() { Variable variable = Variable.builder().setName("x").setType(TypeNode.STRING).build(); VariableExpr variableExpr = VariableExpr.builder().setVariable(variable).build(); assertThrows( diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/engine/ast/JavaDocCommentTest.java b/gapic-generator-java/src/test/java/com/google/api/generator/engine/ast/JavaDocCommentTest.java index 0d3550971d..4919e5982b 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/engine/ast/JavaDocCommentTest.java +++ b/gapic-generator-java/src/test/java/com/google/api/generator/engine/ast/JavaDocCommentTest.java @@ -16,21 +16,31 @@ import static org.junit.Assert.assertEquals; -import com.google.api.generator.testutils.LineFormatter; +import com.google.api.generator.test.utils.LineFormatter; import java.util.Arrays; import java.util.List; -import org.junit.Test; +import org.junit.jupiter.api.Test; -public class JavaDocCommentTest { +class JavaDocCommentTest { @Test - public void createJavaDocComment_basic() { + void emptyJavaDocComment() { + JavaDocComment.Builder javaDocCommentBuilder = JavaDocComment.builder(); + assertEquals(true, javaDocCommentBuilder.emptyComments()); + + String content = "testing return"; + javaDocCommentBuilder.setReturn(content); + assertEquals(false, javaDocCommentBuilder.emptyComments()); + } + + @Test + void createJavaDocComment_basic() { String content = "this is a test comment"; JavaDocComment javaDocComment = JavaDocComment.builder().addComment(content).build(); assertEquals(content, javaDocComment.comment()); } @Test - public void createJavaDocComment_specialCharacter() { + void createJavaDocComment_specialCharacter() { // Check that we handle special characters correctly which includes escape characters, // html escape characters and unexpected block end `*/`. JavaDocComment javaDocComment = @@ -57,7 +67,7 @@ public void createJavaDocComment_specialCharacter() { } @Test - public void createJavaDocComment_sampleCode() { + void createJavaDocComment_sampleCode() { String comment = "sample codes:"; String sampleCode = "resource = project/{project}/shelfId/{shelfId}"; JavaDocComment javaDocComment = @@ -72,7 +82,7 @@ public void createJavaDocComment_sampleCode() { } @Test - public void createJavaDocComment_sampleCodePreserveIndentAndLineBreaks() { + void createJavaDocComment_sampleCodePreserveIndentAndLineBreaks() { String comment = "sample codes:"; String formattedSampleCode = LineFormatter.lines( @@ -97,7 +107,7 @@ public void createJavaDocComment_sampleCodePreserveIndentAndLineBreaks() { } @Test - public void createJavaDocComment_multipleComments() { + void createJavaDocComment_multipleComments() { // Add methods, like `addComment()`, should add components at any place, // and they will get printed in order. String comment1 = "This is a test comment."; @@ -132,7 +142,7 @@ public void createJavaDocComment_multipleComments() { } @Test - public void createJavaDocComment_multipleParams() { + void createJavaDocComment_multipleParams() { // Parameters should be grouped together and get printed after block comments. String comment = "This is a block comment."; String paramName1 = "shelfName"; @@ -153,9 +163,35 @@ public void createJavaDocComment_multipleParams() { } @Test - public void createJavaDocComment_throwsAndDeprecated() { - // No matter how many times or order `setThrows` and `setDeprecated` are called, - // only one @throws and @deprecated will be printed. + void createJavaDocComment_multipleParamsAndReturn() { + // Parameters should be grouped together and get printed after block comments. + // Return text should get printed at the very end. + String comment = "This is a block comment."; + String paramName1 = "shelfName"; + String paramDescription1 = "The name of the shelf where books are published to."; + String paramName2 = "shelfId"; + String paramDescription2 = "The shelfId of the shelf where books are published to."; + String returnText = "This is the method return text."; + JavaDocComment javaDocComment = + JavaDocComment.builder() + .addParam(paramName1, paramDescription1) + .addParam(paramName2, paramDescription2) + .addComment(comment) + .setReturn(returnText) + .build(); + String expected = + "This is a block comment.\n" + + "@param shelfName The name of the shelf where books are published to.\n" + + "@param shelfId The shelfId of the shelf where books are published to.\n" + + "@return This is the method return text."; + assertEquals(expected, javaDocComment.comment()); + } + + @Test + void createJavaDocComment_throwsAndDeprecatedAndInternalAndReturn() { + // No matter how many times or order `setThrows`, `setDeprecated`, `setInternalOnly`, + // `setReturn` are called, + // only one @throws, @deprecated, and @return will be printed. String throwsType = "com.google.api.gax.rpc.ApiException"; String throwsDescription = "if the remote call fails."; String throwsType_print = "java.lang.RuntimeException"; @@ -164,28 +200,43 @@ public void createJavaDocComment_throwsAndDeprecated() { String deprecatedText = "Use the {@link ArchivedBookName} class instead."; String deprecatedText_print = "Use the {@link ShelfBookName} class instead."; + String internalOnlyText = + "This method is for internal use only. Please do not use it directly."; + + String returnText = "This is the incorrect method return text."; + String returnText_print = "This is the correct method return text."; + JavaDocComment javaDocComment = JavaDocComment.builder() .setThrows(throwsType, throwsDescription) .setDeprecated(deprecatedText) + .setReturn(returnText) + .setInternalOnly(internalOnlyText) .setThrows(throwsType_print, throwsDescription_print) .setDeprecated(deprecatedText_print) + .setReturn(returnText_print) .build(); String expected = LineFormatter.lines( + "

Warning: This method is for internal use only. Please do not use it directly.\n", "@throws java.lang.RuntimeException if the remote call fails.\n", - "@deprecated Use the {@link ShelfBookName} class instead."); + "@deprecated Use the {@link ShelfBookName} class instead.\n", + "@return This is the correct method return text."); assertEquals(expected, javaDocComment.comment()); } @Test - public void createJavaDocComment_allComponents() { - // No matter what order `setThrows`, `setDeprecated` are called, + void createJavaDocComment_allComponents() { + // No matter what order `setThrows`, `setDeprecated`, and `setReturn` are called, // They will be printed at the end. And `@param` should be grouped, - // they should always be printed right before `@throws` and `@deprecated`. + // they should always be printed right before `@throws`, `@deprecated` and + // `@return`. // All other add methods should keep the order of how they are added. String content = "this is a test comment"; String deprecatedText = "Use the {@link ArchivedBookName} class instead."; + String internalOnlyText = + "This method is for internal use only. Please do not use it directly."; + String returnText = "This is the method return text."; String paramName1 = "shelfName"; String paramDescription1 = "The name of the shelf where books are published to."; String paramName2 = "shelf"; @@ -204,12 +255,14 @@ public void createJavaDocComment_allComponents() { JavaDocComment.builder() .setDeprecated(deprecatedText) .setThrows(throwsType, throwsDescription) + .setReturn(returnText) .addParam(paramName1, paramDescription1) .addComment(content) .addParagraph(paragraph1) .addParagraph(paragraph2) .addOrderedList(orderedList) .addParam(paramName2, paramDescription2) + .setInternalOnly(internalOnlyText) .build(); String expected = LineFormatter.lines( @@ -223,10 +276,12 @@ public void createJavaDocComment_allComponents() { "

  • A request object method.\n", "
  • A callable method.\n", "\n", + "

    Warning: This method is for internal use only. Please do not use it directly.\n", "@param shelfName The name of the shelf where books are published to.\n", "@param shelf The shelf to create.\n", "@throws com.google.api.gax.rpc.ApiException if the remote call fails.\n", - "@deprecated Use the {@link ArchivedBookName} class instead."); + "@deprecated Use the {@link ArchivedBookName} class instead.\n", + "@return This is the method return text."); assertEquals(expected, javaDocComment.comment()); } } diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/engine/ast/LambdaExprTest.java b/gapic-generator-java/src/test/java/com/google/api/generator/engine/ast/LambdaExprTest.java index 46bca0357f..15e35858b0 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/engine/ast/LambdaExprTest.java +++ b/gapic-generator-java/src/test/java/com/google/api/generator/engine/ast/LambdaExprTest.java @@ -18,18 +18,18 @@ import static org.junit.Assert.assertThrows; import java.util.Arrays; -import org.junit.Test; +import org.junit.jupiter.api.Test; -public class LambdaExprTest { +class LambdaExprTest { @Test - public void validLambdaExpr_noArguments() { + void validLambdaExpr_noArguments() { LambdaExpr.builder() .setReturnExpr(ValueExpr.withValue(StringObjectValue.withValue("foo"))) .build(); } @Test - public void validLambdaExpr_inferTypeFromReturnExpr() { + void validLambdaExpr_inferTypeFromReturnExpr() { LambdaExpr lambdaExpr = LambdaExpr.builder() .setReturnExpr(ValueExpr.withValue(StringObjectValue.withValue("foo"))) @@ -38,7 +38,7 @@ public void validLambdaExpr_inferTypeFromReturnExpr() { } @Test - public void validLambdaExpr_severalArguments() { + void validLambdaExpr_severalArguments() { VariableExpr argOneVarExpr = VariableExpr.builder() .setVariable(Variable.builder().setName("arg").setType(TypeNode.INT).build()) @@ -62,7 +62,7 @@ public void validLambdaExpr_severalArguments() { } @Test - public void validLambdaExpr_withBody() { + void validLambdaExpr_withBody() { VariableExpr fooVarExpr = VariableExpr.builder() .setVariable(Variable.builder().setName("foo").setType(TypeNode.INT).build()) @@ -85,7 +85,7 @@ public void validLambdaExpr_withBody() { } @Test - public void validLambdaExpr_returnsVoid() { + void validLambdaExpr_returnsVoid() { LambdaExpr voidLambda = LambdaExpr.builder() .setReturnExpr( @@ -98,7 +98,7 @@ public void validLambdaExpr_returnsVoid() { } @Test - public void invalidLambdaExpr_undeclaredArgVarExpr() { + void invalidLambdaExpr_undeclaredArgVarExpr() { VariableExpr argVarExpr = VariableExpr.builder() .setVariable(Variable.builder().setName("arg").setType(TypeNode.INT).build()) @@ -114,7 +114,7 @@ public void invalidLambdaExpr_undeclaredArgVarExpr() { } @Test - public void invalidLambdaExpr_argVarExprWithModifiers() { + void invalidLambdaExpr_argVarExprWithModifiers() { VariableExpr argVarExpr = VariableExpr.builder() .setVariable(Variable.builder().setName("arg").setType(TypeNode.INT).build()) @@ -132,7 +132,7 @@ public void invalidLambdaExpr_argVarExprWithModifiers() { } @Test - public void invalidLambdaExpr_argVarExprWithNonLocalScope() { + void invalidLambdaExpr_argVarExprWithNonLocalScope() { VariableExpr argVarExpr = VariableExpr.builder() .setVariable(Variable.builder().setName("arg").setType(TypeNode.INT).build()) @@ -150,7 +150,7 @@ public void invalidLambdaExpr_argVarExprWithNonLocalScope() { } @Test - public void invalidLambdaExpr_repeatedArgName() { + void invalidLambdaExpr_repeatedArgName() { VariableExpr argOneVarExpr = VariableExpr.builder() .setVariable(Variable.builder().setName("arg").setType(TypeNode.INT).build()) diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/engine/ast/LogicalOperationExprTest.java b/gapic-generator-java/src/test/java/com/google/api/generator/engine/ast/LogicalOperationExprTest.java index 3a54cb2706..df39b03121 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/engine/ast/LogicalOperationExprTest.java +++ b/gapic-generator-java/src/test/java/com/google/api/generator/engine/ast/LogicalOperationExprTest.java @@ -16,12 +16,12 @@ import static org.junit.Assert.assertThrows; -import org.junit.Test; +import org.junit.jupiter.api.Test; -public class LogicalOperationExprTest { +class LogicalOperationExprTest { /** =============================== Logic And Operation Expr =============================== */ @Test - public void logicalAnd_validBasic() { + void logicalAnd_validBasic() { VariableExpr lhsExpr = VariableExpr.withVariable( Variable.builder().setType(TypeNode.BOOLEAN).setName("isGood").build()); @@ -33,7 +33,7 @@ public void logicalAnd_validBasic() { } @Test - public void logicalAnd_validBoxedBoolean() { + void logicalAnd_validBoxedBoolean() { VariableExpr lhsExpr = VariableExpr.withVariable( Variable.builder().setType(TypeNode.BOOLEAN).setName("isGood").build()); @@ -45,7 +45,7 @@ public void logicalAnd_validBoxedBoolean() { } @Test - public void logicalAnd_invalidNumericType() { + void logicalAnd_invalidNumericType() { VariableExpr lhsExpr = VariableExpr.withVariable(Variable.builder().setType(TypeNode.INT).setName("x").build()); VariableExpr rhsExpr = @@ -57,7 +57,7 @@ public void logicalAnd_invalidNumericType() { } @Test - public void logicalAnd_invalidStringType() { + void logicalAnd_invalidStringType() { VariableExpr lhsExpr = VariableExpr.withVariable( Variable.builder().setType(TypeNode.BOOLEAN_OBJECT).setName("x").build()); @@ -71,7 +71,7 @@ public void logicalAnd_invalidStringType() { /** =============================== Logic Or Operation Expr =============================== */ @Test - public void logicalOr_validBoxedBoolean() { + void logicalOr_validBoxedBoolean() { VariableExpr lhsExpr = VariableExpr.withVariable( Variable.builder().setType(TypeNode.BOOLEAN_OBJECT).setName("isGood").build()); @@ -83,7 +83,7 @@ public void logicalOr_validBoxedBoolean() { } @Test - public void logicalOr_invalidVoidType() { + void logicalOr_invalidVoidType() { VariableExpr lhsExpr = VariableExpr.withVariable( Variable.builder().setType(TypeNode.BOOLEAN).setName("x").build()); @@ -95,7 +95,7 @@ public void logicalOr_invalidVoidType() { } @Test - public void logicalOr_invalidNullType() { + void logicalOr_invalidNullType() { VariableExpr lhsExpr = VariableExpr.withVariable( Variable.builder().setType(TypeNode.BOOLEAN).setName("x").build()); diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/engine/ast/MethodDefinitionTest.java b/gapic-generator-java/src/test/java/com/google/api/generator/engine/ast/MethodDefinitionTest.java index 96e09352cc..17db2d8019 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/engine/ast/MethodDefinitionTest.java +++ b/gapic-generator-java/src/test/java/com/google/api/generator/engine/ast/MethodDefinitionTest.java @@ -21,11 +21,11 @@ import java.util.Arrays; import java.util.List; import java.util.Map; -import org.junit.Test; +import org.junit.jupiter.api.Test; -public class MethodDefinitionTest { +class MethodDefinitionTest { @Test - public void validMethodDefinition_basicWithComments() { + void validMethodDefinition_basicWithComments() { MethodDefinition.builder() .setHeaderCommentStatements(createCommentStatements()) .setName("close") @@ -37,7 +37,7 @@ public void validMethodDefinition_basicWithComments() { } @Test - public void validMethodDefinition_emptyBody() { + void validMethodDefinition_emptyBody() { MethodDefinition.builder() .setHeaderCommentStatements(createCommentStatements()) .setName("close") @@ -47,7 +47,7 @@ public void validMethodDefinition_emptyBody() { } @Test - public void validMethodDefinition_repeatedAnnotations() { + void validMethodDefinition_repeatedAnnotations() { MethodDefinition method = MethodDefinition.builder() .setName("close") @@ -65,7 +65,7 @@ public void validMethodDefinition_repeatedAnnotations() { } @Test - public void validMethodDefinition_basicWithReturnType() { + void validMethodDefinition_basicWithReturnType() { MethodDefinition.builder() .setName("close") .setScope(ScopeNode.PUBLIC) @@ -81,7 +81,7 @@ public void validMethodDefinition_basicWithReturnType() { } @Test - public void validMethodDefinition_throwInsteadOfReturnType() { + void validMethodDefinition_throwInsteadOfReturnType() { MethodDefinition.builder() .setName("foobar") .setScope(ScopeNode.PUBLIC) @@ -99,7 +99,7 @@ public void validMethodDefinition_throwInsteadOfReturnType() { } @Test - public void validMethodDefinition_voidThrowInsteadOfReturnType() { + void validMethodDefinition_voidThrowInsteadOfReturnType() { MethodDefinition.builder() .setName("foobar") .setScope(ScopeNode.PUBLIC) @@ -117,7 +117,7 @@ public void validMethodDefinition_voidThrowInsteadOfReturnType() { } @Test - public void validMethodDefinition_subtyping() { + void validMethodDefinition_subtyping() { Reference stringRef = ConcreteReference.withClazz(String.class); TypeNode returnType = TypeNode.withReference( @@ -149,7 +149,7 @@ public void validMethodDefinition_subtyping() { } @Test - public void validMethodDefinition_basicAbstract() { + void validMethodDefinition_basicAbstract() { MethodDefinition.builder() .setName("close") .setIsAbstract(true) @@ -160,7 +160,7 @@ public void validMethodDefinition_basicAbstract() { } @Test - public void validMethodDefinition_constructor() { + void validMethodDefinition_constructor() { TypeNode returnType = TypeNode.withReference( VaporReference.builder() @@ -174,7 +174,7 @@ public void validMethodDefinition_constructor() { } @Test - public void validMethodDefinition_withArgumentsAndReturnExpr() { + void validMethodDefinition_withArgumentsAndReturnExpr() { ValueExpr returnExpr = ValueExpr.builder() .setValue(PrimitiveValue.builder().setType(TypeNode.INT).setValue("3").build()) @@ -201,7 +201,7 @@ public void validMethodDefinition_withArgumentsAndReturnExpr() { } @Test - public void validMethodDefinition_nonRuntimeException() { + void validMethodDefinition_nonRuntimeException() { MethodDefinition.builder() .setName("close") .setScope(ScopeNode.PUBLIC) @@ -213,7 +213,7 @@ public void validMethodDefinition_nonRuntimeException() { } @Test - public void validMethodDefinition_templateBasic() { + void validMethodDefinition_templateBasic() { TypeNode returnType = TypeNode.withReference(ConcreteReference.withClazz(Map.class)); MethodDefinition.builder() .setName("close") @@ -231,7 +231,7 @@ public void validMethodDefinition_templateBasic() { } @Test - public void validMethodDefinition_templateOnArguments() { + void validMethodDefinition_templateOnArguments() { Reference listRef = ConcreteReference.withClazz(List.class); List arguments = Arrays.asList( @@ -263,7 +263,7 @@ public void validMethodDefinition_templateOnArguments() { } @Test - public void validMethodDefinition_primitiveReturnTypeWithoutTemplates() { + void validMethodDefinition_primitiveReturnTypeWithoutTemplates() { // Not valid Java. Please change this test if you are trying to prevent this case. MethodDefinition.builder() .setName("close") @@ -275,7 +275,7 @@ public void validMethodDefinition_primitiveReturnTypeWithoutTemplates() { } @Test - public void validMethodDefinition_boxedReturnType() { + void validMethodDefinition_boxedReturnType() { MethodDefinition.builder() .setName("foobar") .setScope(ScopeNode.PUBLIC) @@ -288,7 +288,7 @@ public void validMethodDefinition_boxedReturnType() { } @Test - public void validMethodDefinition_setReturnExprUsingReturnExpr() { + void validMethodDefinition_setReturnExprUsingReturnExpr() { ReturnExpr returnExpr = ReturnExpr.withExpr( ValueExpr.withValue( @@ -303,7 +303,7 @@ public void validMethodDefinition_setReturnExprUsingReturnExpr() { } @Test - public void invalidMethodDefinition_badTemplateName() { + void invalidMethodDefinition_badTemplateName() { assertThrows( IdentifierNode.InvalidIdentifierException.class, () -> @@ -317,7 +317,7 @@ public void invalidMethodDefinition_badTemplateName() { } @Test - public void invalidMethodDefinition_primitiveReturnType() { + void invalidMethodDefinition_primitiveReturnType() { assertThrows( IllegalStateException.class, () -> @@ -332,7 +332,7 @@ public void invalidMethodDefinition_primitiveReturnType() { } @Test - public void invalidMethodDefinition_emptyTemplatesOnMethod() { + void invalidMethodDefinition_emptyTemplatesOnMethod() { assertThrows( IllegalStateException.class, () -> @@ -348,7 +348,7 @@ public void invalidMethodDefinition_emptyTemplatesOnMethod() { } @Test - public void invalidMethodDefinition_returnTemplatesNotPresent() { + void invalidMethodDefinition_returnTemplatesNotPresent() { assertThrows( IllegalStateException.class, () -> @@ -365,7 +365,7 @@ public void invalidMethodDefinition_returnTemplatesNotPresent() { } @Test - public void invalidMethodDefinition_noName() { + void invalidMethodDefinition_noName() { assertThrows( NullPointerException.class, () -> { @@ -378,7 +378,7 @@ public void invalidMethodDefinition_noName() { } @Test - public void invalidMethodDefinition_runtimeException() { + void invalidMethodDefinition_runtimeException() { assertThrows( IllegalStateException.class, () -> { @@ -394,7 +394,7 @@ public void invalidMethodDefinition_runtimeException() { } @Test - public void invalidMethodDefinition_abstractStatic() { + void invalidMethodDefinition_abstractStatic() { assertThrows( IllegalStateException.class, () -> { @@ -409,7 +409,7 @@ public void invalidMethodDefinition_abstractStatic() { } @Test - public void invalidMethodDefinition_localScope() { + void invalidMethodDefinition_localScope() { assertThrows( IllegalStateException.class, () -> { @@ -422,7 +422,7 @@ public void invalidMethodDefinition_localScope() { } @Test - public void invalidMethodDefinition_constructorOverride() { + void invalidMethodDefinition_constructorOverride() { TypeNode returnType = TypeNode.withReference( VaporReference.builder() @@ -441,7 +441,7 @@ public void invalidMethodDefinition_constructorOverride() { } @Test - public void invalidMethodDefinition_constructorFinalOrStatic() { + void invalidMethodDefinition_constructorFinalOrStatic() { TypeNode returnType = TypeNode.withReference( VaporReference.builder() @@ -469,7 +469,7 @@ public void invalidMethodDefinition_constructorFinalOrStatic() { } @Test - public void invalidMethodDefinition_constructorHasReturnExpr() { + void invalidMethodDefinition_constructorHasReturnExpr() { TypeNode returnType = TypeNode.withReference( VaporReference.builder() @@ -492,7 +492,7 @@ public void invalidMethodDefinition_constructorHasReturnExpr() { } @Test - public void invalidMethodDefinition_objectPrimitiveTypeMismatch() { + void invalidMethodDefinition_objectPrimitiveTypeMismatch() { Value value = PrimitiveValue.builder().setType(TypeNode.INT).setValue("3").build(); ValueExpr valueExpr = ValueExpr.builder().setValue(value).build(); @@ -510,7 +510,7 @@ public void invalidMethodDefinition_objectPrimitiveTypeMismatch() { } @Test - public void invalidMethodDefinition_mismatchedTypes() { + void invalidMethodDefinition_mismatchedTypes() { Reference stringRef = ConcreteReference.withClazz(String.class); TypeNode returnType = TypeNode.withReference( @@ -539,7 +539,7 @@ public void invalidMethodDefinition_mismatchedTypes() { } @Test - public void invalidMethodDefinition_abstractFinal() { + void invalidMethodDefinition_abstractFinal() { assertThrows( IllegalStateException.class, () -> { @@ -554,7 +554,7 @@ public void invalidMethodDefinition_abstractFinal() { } @Test - public void invalidMethodDefinition_abstractPrivate() { + void invalidMethodDefinition_abstractPrivate() { assertThrows( IllegalStateException.class, () -> { @@ -568,7 +568,7 @@ public void invalidMethodDefinition_abstractPrivate() { } @Test - public void invalidMethodDefinition_invalidException() { + void invalidMethodDefinition_invalidException() { assertThrows( IllegalStateException.class, () -> { @@ -583,7 +583,7 @@ public void invalidMethodDefinition_invalidException() { } @Test - public void invalidMethodDefinition_missingNonVoidReturnType() { + void invalidMethodDefinition_missingNonVoidReturnType() { assertThrows( NullPointerException.class, () -> { @@ -597,7 +597,7 @@ public void invalidMethodDefinition_missingNonVoidReturnType() { } @Test - public void invalidMethodDefinition_mismatchedPrimitiveReturnType() { + void invalidMethodDefinition_mismatchedPrimitiveReturnType() { ValueExpr booleanValueExpr = ValueExpr.builder() .setValue(PrimitiveValue.builder().setType(TypeNode.BOOLEAN).setValue("false").build()) @@ -616,7 +616,7 @@ public void invalidMethodDefinition_mismatchedPrimitiveReturnType() { } @Test - public void invalidMethodDefinition_mismatchedObjectReturnType() { + void invalidMethodDefinition_mismatchedObjectReturnType() { assertThrows( IllegalStateException.class, () -> { @@ -635,7 +635,7 @@ public void invalidMethodDefinition_mismatchedObjectReturnType() { } @Test - public void invalidMethodDefinition_mismatchedPrimitiveToObjectReturnType() { + void invalidMethodDefinition_mismatchedPrimitiveToObjectReturnType() { assertThrows( IllegalStateException.class, () -> { @@ -654,7 +654,7 @@ public void invalidMethodDefinition_mismatchedPrimitiveToObjectReturnType() { } @Test - public void invalidMethodDefinition_repeatedArgumentName() { + void invalidMethodDefinition_repeatedArgumentName() { ValueExpr returnValueExpr = ValueExpr.builder() .setValue(PrimitiveValue.builder().setType(TypeNode.INT).setValue("3").build()) @@ -678,7 +678,7 @@ public void invalidMethodDefinition_repeatedArgumentName() { } @Test - public void invalidMethodDefinition_nonDeclArguments() { + void invalidMethodDefinition_nonDeclArguments() { ValueExpr returnValueExpr = ValueExpr.builder() .setValue(PrimitiveValue.builder().setType(TypeNode.INT).setValue("3").build()) @@ -702,7 +702,7 @@ public void invalidMethodDefinition_nonDeclArguments() { } @Test - public void invalidMethodDefinition_argumentsWithModifiers() { + void invalidMethodDefinition_argumentsWithModifiers() { ValueExpr returnValueExpr = ValueExpr.builder() .setValue(PrimitiveValue.builder().setType(TypeNode.INT).setValue("3").build()) @@ -729,7 +729,7 @@ public void invalidMethodDefinition_argumentsWithModifiers() { } @Test - public void invalidMethodDefinition_argumentsWithScope() { + void invalidMethodDefinition_argumentsWithScope() { ValueExpr returnValueExpr = ValueExpr.builder() .setValue(PrimitiveValue.builder().setType(TypeNode.INT).setValue("3").build()) @@ -755,7 +755,7 @@ public void invalidMethodDefinition_argumentsWithScope() { } @Test - public void invalidMethodDefinition_nullReturnType() { + void invalidMethodDefinition_nullReturnType() { assertThrows( IllegalStateException.class, () -> { @@ -768,7 +768,7 @@ public void invalidMethodDefinition_nullReturnType() { } @Test - public void invalidMethodDefinition_missingReturnType() { + void invalidMethodDefinition_missingReturnType() { assertThrows( NullPointerException.class, () -> { diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/engine/ast/MethodInvocationExprTest.java b/gapic-generator-java/src/test/java/com/google/api/generator/engine/ast/MethodInvocationExprTest.java index eed99da9b7..7261cd2b77 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/engine/ast/MethodInvocationExprTest.java +++ b/gapic-generator-java/src/test/java/com/google/api/generator/engine/ast/MethodInvocationExprTest.java @@ -18,12 +18,12 @@ import java.util.ArrayList; import java.util.Arrays; -import org.junit.Test; +import org.junit.jupiter.api.Test; -public class MethodInvocationExprTest { +class MethodInvocationExprTest { @Test - public void validBuildMethodInvocationExpr() { + void validBuildMethodInvocationExpr() { Reference stringRef = ConcreteReference.withClazz(String.class); TypeNode returnType = TypeNode.withReference( @@ -37,7 +37,7 @@ public void validBuildMethodInvocationExpr() { } @Test - public void validBuildMethodInvocationExpr_hasArguments() { + void validBuildMethodInvocationExpr_hasArguments() { Reference stringRef = ConcreteReference.withClazz(String.class); TypeNode returnType = TypeNode.withReference( @@ -59,7 +59,7 @@ public void validBuildMethodInvocationExpr_hasArguments() { } @Test - public void validBuildMethodInvocationExpr_staticReference() { + void validBuildMethodInvocationExpr_staticReference() { TypeNode someType = TypeNode.withReference( VaporReference.builder() @@ -75,7 +75,7 @@ public void validBuildMethodInvocationExpr_staticReference() { } @Test - public void invalidBuildMethodInvocationExpr_nullReturnType() { + void invalidBuildMethodInvocationExpr_nullReturnType() { assertThrows( IllegalStateException.class, () -> { @@ -87,7 +87,7 @@ public void invalidBuildMethodInvocationExpr_nullReturnType() { } @Test - public void invalidBuildMethodInvocationExpr_staticAndExprBoth() { + void invalidBuildMethodInvocationExpr_staticAndExprBoth() { TypeNode someType = TypeNode.withReference( VaporReference.builder() @@ -110,7 +110,7 @@ public void invalidBuildMethodInvocationExpr_staticAndExprBoth() { } @Test - public void invalidBuildMethodInvocationExpr_nullArgument() { + void invalidBuildMethodInvocationExpr_nullArgument() { Reference stringRef = ConcreteReference.withClazz(String.class); TypeNode returnType = TypeNode.withReference( diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/engine/ast/NewObjectExprTest.java b/gapic-generator-java/src/test/java/com/google/api/generator/engine/ast/NewObjectExprTest.java index 2287a75394..12112f7b45 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/engine/ast/NewObjectExprTest.java +++ b/gapic-generator-java/src/test/java/com/google/api/generator/engine/ast/NewObjectExprTest.java @@ -21,11 +21,11 @@ import java.util.HashMap; import java.util.LinkedList; import java.util.List; -import org.junit.Test; +import org.junit.jupiter.api.Test; -public class NewObjectExprTest { +class NewObjectExprTest { @Test - public void validNewObjectValue_basic() { + void validNewObjectValue_basic() { // isGeneric() is true and generics() is not empty. // [Constructing] `new List()`, no exception should be thrown. ConcreteReference ref = @@ -40,7 +40,7 @@ public void validNewObjectValue_basic() { } @Test - public void validNewObjectValue_hasArgument() { + void validNewObjectValue_hasArgument() { VaporReference ref = VaporReference.builder() .setName("Student") @@ -58,7 +58,7 @@ public void validNewObjectValue_hasArgument() { } @Test - public void validNewObjectExpr_edgeCase() { + void validNewObjectExpr_edgeCase() { // isGeneric() is false, but generics() is not empty. // The expression is still valid, we will set isGeneric() as true for the users. // [Constructing] `new List()`, no exception should be thrown. @@ -74,7 +74,7 @@ public void validNewObjectExpr_edgeCase() { } @Test - public void validNewObjectExpr_noGenericWithArgs() { + void validNewObjectExpr_noGenericWithArgs() { // isGeneric() is false, and generics() is empty. // [Constructing] `new Integer(123)` no exception should be thrown. ConcreteReference ref = ConcreteReference.builder().setClazz(Integer.class).build(); @@ -88,7 +88,7 @@ public void validNewObjectExpr_noGenericWithArgs() { } @Test - public void validNewObjectExpr_emptyGeneric() { + void validNewObjectExpr_emptyGeneric() { // isGeneric() is true, but generics() is empty. // [Constructing] `new LinkedList<>()` no exception should be thrown. ConcreteReference ref = ConcreteReference.builder().setClazz(LinkedList.class).build(); @@ -99,7 +99,7 @@ public void validNewObjectExpr_emptyGeneric() { } @Test - public void validNewObjectExpr_genericsAndArgs() { + void validNewObjectExpr_genericsAndArgs() { // isGeneric() is true, generics() is not empty, and argument list is also not empty. // [Constructing] `new HashMap, Integer>>(initialCapacity, loadFactor)`. ConcreteReference listRef = @@ -130,7 +130,7 @@ public void validNewObjectExpr_genericsAndArgs() { } @Test - public void invalidNewObjectExpr_primitiveType() { + void invalidNewObjectExpr_primitiveType() { // New object expressions should be reference types. assertThrows( IllegalStateException.class, @@ -140,7 +140,7 @@ public void invalidNewObjectExpr_primitiveType() { } @Test - public void invalidNewObjectExpr_nullType() { + void invalidNewObjectExpr_nullType() { // New object expressions cannot be null type. assertThrows( IllegalStateException.class, @@ -150,7 +150,7 @@ public void invalidNewObjectExpr_nullType() { } @Test - public void invalidNewObjectValue_nullArgument() { + void invalidNewObjectValue_nullArgument() { VaporReference ref = VaporReference.builder() .setName("Student") diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/engine/ast/NullObjectValueTest.java b/gapic-generator-java/src/test/java/com/google/api/generator/engine/ast/NullObjectValueTest.java index fa9dfa2669..8e31801a47 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/engine/ast/NullObjectValueTest.java +++ b/gapic-generator-java/src/test/java/com/google/api/generator/engine/ast/NullObjectValueTest.java @@ -17,13 +17,13 @@ import static com.google.common.truth.Truth.assertThat; import static org.junit.Assert.assertEquals; -import org.junit.Test; +import org.junit.jupiter.api.Test; -public class NullObjectValueTest { +class NullObjectValueTest { private static final String NULL_VALUE = "null"; @Test - public void createNullObjectValue_valid() { + void createNullObjectValue_valid() { NullObjectValue nullValue = NullObjectValue.create(); assertEquals(NULL_VALUE, nullValue.value()); assertThat(nullValue.type()).isEqualTo(TypeNode.NULL); diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/engine/ast/PrimitiveValueTest.java b/gapic-generator-java/src/test/java/com/google/api/generator/engine/ast/PrimitiveValueTest.java index 37c3ae9cc4..6045d7ec35 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/engine/ast/PrimitiveValueTest.java +++ b/gapic-generator-java/src/test/java/com/google/api/generator/engine/ast/PrimitiveValueTest.java @@ -19,11 +19,11 @@ import static org.junit.Assert.assertThrows; import com.google.api.generator.engine.ast.TypeNode.TypeKind; -import org.junit.Test; +import org.junit.jupiter.api.Test; -public class PrimitiveValueTest { +class PrimitiveValueTest { @Test - public void createPrimitiveValue_basic() { + void createPrimitiveValue_basic() { assertValidValue(TypeKind.INT, "3"); assertValidValue(TypeKind.BOOLEAN, "false"); assertValidValue(TypeKind.LONG, "123"); @@ -32,7 +32,7 @@ public void createPrimitiveValue_basic() { } @Test - public void createPrimitiveValue_invalid() { + void createPrimitiveValue_invalid() { assertInvalidValue(TypeKind.INT, "123.f"); assertInvalidValue(TypeKind.INT, "false"); assertInvalidValue(TypeKind.BOOLEAN, "False"); @@ -40,7 +40,7 @@ public void createPrimitiveValue_invalid() { } @Test - public void createPrimitiveValue_unsupported() { + void createPrimitiveValue_unsupported() { assertInvalidValue(TypeKind.BYTE, "0x2"); assertInvalidValue(TypeKind.SHORT, "1"); assertInvalidValue(TypeKind.CHAR, "a"); diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/engine/ast/ReferenceConstructorExprTest.java b/gapic-generator-java/src/test/java/com/google/api/generator/engine/ast/ReferenceConstructorExprTest.java index 8ba47c8ac6..03e579d411 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/engine/ast/ReferenceConstructorExprTest.java +++ b/gapic-generator-java/src/test/java/com/google/api/generator/engine/ast/ReferenceConstructorExprTest.java @@ -16,12 +16,12 @@ import static org.junit.Assert.assertThrows; -import org.junit.Test; +import org.junit.jupiter.api.Test; -public class ReferenceConstructorExprTest { +class ReferenceConstructorExprTest { @Test - public void validReferenceConstructorExpr_thisConstructorBasic() { + void validReferenceConstructorExpr_thisConstructorBasic() { VaporReference ref = VaporReference.builder() .setName("Student") @@ -33,7 +33,7 @@ public void validReferenceConstructorExpr_thisConstructorBasic() { } @Test - public void validReferenceConstructorExpr_hasArguments() { + void validReferenceConstructorExpr_hasArguments() { VaporReference ref = VaporReference.builder() .setName("Student") @@ -51,7 +51,7 @@ public void validReferenceConstructorExpr_hasArguments() { } @Test - public void validReferenceConstructorExpr_superConstructorBasic() { + void validReferenceConstructorExpr_superConstructorBasic() { VaporReference ref = VaporReference.builder() .setName("Student") @@ -63,7 +63,7 @@ public void validReferenceConstructorExpr_superConstructorBasic() { } @Test - public void invalidReferenceConstructorExpr_nonReferenceType() { + void invalidReferenceConstructorExpr_nonReferenceType() { assertThrows( IllegalStateException.class, () -> { @@ -72,7 +72,7 @@ public void invalidReferenceConstructorExpr_nonReferenceType() { } @Test - public void invalidReferenceConstructorExpr_nullType() { + void invalidReferenceConstructorExpr_nullType() { assertThrows( IllegalStateException.class, () -> { @@ -81,7 +81,7 @@ public void invalidReferenceConstructorExpr_nullType() { } @Test - public void invalidReferenceConstructorExpr_nullArgument() { + void invalidReferenceConstructorExpr_nullArgument() { VaporReference ref = VaporReference.builder() .setName("Student") diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/engine/ast/ReferenceTest.java b/gapic-generator-java/src/test/java/com/google/api/generator/engine/ast/ReferenceTest.java index b4e4b43496..c210900a4f 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/engine/ast/ReferenceTest.java +++ b/gapic-generator-java/src/test/java/com/google/api/generator/engine/ast/ReferenceTest.java @@ -20,11 +20,11 @@ import java.util.Arrays; import java.util.HashMap; import java.util.List; -import org.junit.Test; +import org.junit.jupiter.api.Test; -public class ReferenceTest { +class ReferenceTest { @Test - public void nestedGenerics_concreteReferenceOuter() { + void nestedGenerics_concreteReferenceOuter() { Reference mapReference = VaporReference.builder() .setName("HashMap") @@ -50,7 +50,7 @@ public void nestedGenerics_concreteReferenceOuter() { } @Test - public void nestedGenerics_vaporReferenceOuter() { + void nestedGenerics_vaporReferenceOuter() { Reference mapReference = ConcreteReference.builder() .setClazz(HashMap.class) @@ -77,7 +77,7 @@ public void nestedGenerics_vaporReferenceOuter() { } @Test - public void mixedConcreteVaporReferenceEquals() { + void mixedConcreteVaporReferenceEquals() { Reference mapReferenceVaporOuter = ConcreteReference.builder() .setClazz(HashMap.class) diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/engine/ast/RelationalOperationExprTest.java b/gapic-generator-java/src/test/java/com/google/api/generator/engine/ast/RelationalOperationExprTest.java index f1b3f1f424..829f763328 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/engine/ast/RelationalOperationExprTest.java +++ b/gapic-generator-java/src/test/java/com/google/api/generator/engine/ast/RelationalOperationExprTest.java @@ -17,12 +17,12 @@ import static org.junit.Assert.assertThrows; import com.google.api.generator.engine.ast.TypeNode.TypeKind; -import org.junit.Test; +import org.junit.jupiter.api.Test; -public class RelationalOperationExprTest { +class RelationalOperationExprTest { /** ==================== Equality Operators: LHS data type is numeric ======================= */ @Test - public void equalToOperationExpr_validBasic() { + void equalToOperationExpr_validBasic() { // LHS: numeric type, RHS: matched numeric type. // No need swap LHS and RHS test case. VariableExpr lhsExpr = createVariableExpr(TypeNode.INT, "x"); @@ -32,7 +32,7 @@ public void equalToOperationExpr_validBasic() { } @Test - public void equalToOperationExpr_validNumericTYpe() { + void equalToOperationExpr_validNumericTYpe() { // LHS: numeric type, RHS: unmatched numeric type. // No need swap LHS and RHS test case. VariableExpr lhsExpr = createVariableExpr(TypeNode.CHAR, "x"); @@ -42,7 +42,7 @@ public void equalToOperationExpr_validNumericTYpe() { } @Test - public void notEqualToOperationExpr_validMatchedNumericBoxTYpe() { + void notEqualToOperationExpr_validMatchedNumericBoxTYpe() { // LHS: numeric type, RHS: matched numeric Boxed type. // Swapping LHS and RHS test case is covered in // "equalToOperationExpr_validBoxedWithMatchedUnBoxedType". @@ -53,7 +53,7 @@ public void notEqualToOperationExpr_validMatchedNumericBoxTYpe() { } @Test - public void notEqualToOperationExpr_validNumericBoxTYpe() { + void notEqualToOperationExpr_validNumericBoxTYpe() { // LHS: numeric type, RHS: unmatched numeric Boxed type. // Swapping LHS and RHS test case is covered in // equalToOperationExpr_validBoxedWithUnmatchedUnBoxedType". @@ -64,7 +64,7 @@ public void notEqualToOperationExpr_validNumericBoxTYpe() { } @Test - public void equalToOperationExpr_invalidNumericBooleanBoxedType() { + void equalToOperationExpr_invalidNumericBooleanBoxedType() { // LHS: numeric type, RHS: boolean boxed Type. // Swapping LHS and RHS test case is covered in // "equalToOperationExpr_invalidBoxedBooleanWithNumericType". @@ -76,7 +76,7 @@ public void equalToOperationExpr_invalidNumericBooleanBoxedType() { } @Test - public void notEqualToOperationExpr_invalidNumericStringType() { + void notEqualToOperationExpr_invalidNumericStringType() { // LHS: numeric type, RHS: referenced type. // Swapping LHS and RHS test case is covered in // "equalToOperationExpr_invalidReferenceWithNumericType". @@ -88,7 +88,7 @@ public void notEqualToOperationExpr_invalidNumericStringType() { } @Test - public void notEqualToOperationExpr_invalidNumericNullType() { + void notEqualToOperationExpr_invalidNumericNullType() { // LHS: numeric type, RHS: null. // Swapping LHS and RHS test case is covered in // "equalToOperationExpr_invalidNullWithNumericType". @@ -100,7 +100,7 @@ public void notEqualToOperationExpr_invalidNumericNullType() { } @Test - public void equalToOperationExpr_invalidNumericBooleanType() { + void equalToOperationExpr_invalidNumericBooleanType() { // LHS: numeric type, RHS: boolean boxed Type. // Swapping LHS and RHS test case is covered in // notEqualToOperationExpr_invalidBooleanToNumericType. @@ -112,7 +112,7 @@ public void equalToOperationExpr_invalidNumericBooleanType() { } @Test - public void equalToOperationExpr_invalidNumericTypeWithArrayType() { + void equalToOperationExpr_invalidNumericTypeWithArrayType() { // LHS: Numeric Type, RHS: Array with numeric type. // Swapping LHS and RHS test case is covered in // "equalToOperationExpr_invalidArrayWithNotArrayType". @@ -127,7 +127,7 @@ public void equalToOperationExpr_invalidNumericTypeWithArrayType() { /** =============== Equality Operators: LHS data type is numeric boxed type ================ */ @Test - public void equalToOperationExpr_validBoxedWithMatchedBoxedType() { + void equalToOperationExpr_validBoxedWithMatchedBoxedType() { // LHS: Boxed type, RHS: Matched Boxed. // No need swap LHS and RHS test case. VariableExpr lhsExpr = createVariableExpr(TypeNode.INT_OBJECT, "x"); @@ -137,7 +137,7 @@ public void equalToOperationExpr_validBoxedWithMatchedBoxedType() { } @Test - public void equalToOperationExpr_validBoxedWithMatchedUnBoxedType() { + void equalToOperationExpr_validBoxedWithMatchedUnBoxedType() { // LHS: Boxed type, RHS: Unmatched Boxed. // Swapping LHS and RHS test case is covered in // "notEqualToOperationExpr_validMatchedNumericBoxTYpe". @@ -148,7 +148,7 @@ public void equalToOperationExpr_validBoxedWithMatchedUnBoxedType() { } @Test - public void equalToOperationExpr_validBoxedWithUnmatchedUnBoxedType() { + void equalToOperationExpr_validBoxedWithUnmatchedUnBoxedType() { // LHS: Numeric boxed type, RHS: other numeric type. // Swapping LHS and RHS test case is covered in "notEqualToOperationExpr_validNumericBoxTYpe". VariableExpr lhsExpr = createVariableExpr(TypeNode.FLOAT_OBJECT, "x"); @@ -158,7 +158,7 @@ public void equalToOperationExpr_validBoxedWithUnmatchedUnBoxedType() { } @Test - public void equalToOperationExpr_validNumericBoxedWithNullType() { + void equalToOperationExpr_validNumericBoxedWithNullType() { // LHS: Boxed type, RHS: Null. // Swapping LHS and RHS test case is covered in // "equalToOperationExpr_validNullWithNumericBoxedType". @@ -169,7 +169,7 @@ public void equalToOperationExpr_validNumericBoxedWithNullType() { } @Test - public void equalToOperationExpr_validNumericBoxedWithNewObjectType() { + void equalToOperationExpr_validNumericBoxedWithNewObjectType() { // LHS: Numeric boxed type, RHS: new object. // Swapping LHS and RHS test case is covered in // "equalToOperationExpr_validObjectWithNumericBoxedType". @@ -180,7 +180,7 @@ public void equalToOperationExpr_validNumericBoxedWithNewObjectType() { } @Test - public void equalToOperationExpr_invalidNumericBoxedWithBooleanType() { + void equalToOperationExpr_invalidNumericBoxedWithBooleanType() { // LHS: Numeric boxed type, RHS: Boolean type. // Swapping LHS and RHS test case is covered in // "notEqualToOperationExpr_invalidBooleanToOtherBoxedType". @@ -192,7 +192,7 @@ public void equalToOperationExpr_invalidNumericBoxedWithBooleanType() { } @Test - public void equalToOperationExpr_invalidNumericBoxedWithBooleanBoxedType() { + void equalToOperationExpr_invalidNumericBoxedWithBooleanBoxedType() { // LHS: Numeric boxed type, RHS: Boolean Boxed type. // Swapping LHS and RHS test case is covered in // "equalToOperationExpr_invalidBooleanBoxedWithNumericBoxedType". @@ -204,7 +204,7 @@ public void equalToOperationExpr_invalidNumericBoxedWithBooleanBoxedType() { } @Test - public void equalToOperationExpr_invalidNumericBoxedWithReferenceType() { + void equalToOperationExpr_invalidNumericBoxedWithReferenceType() { // LHS: Numeric boxed type, RHS: Reference type. // Swapping LHS and RHS test case is covered in // "equalToOperationExpr_invalidReferenceWithNumericBoxedType". @@ -217,7 +217,7 @@ public void equalToOperationExpr_invalidNumericBoxedWithReferenceType() { /** ============= Equality Operators: LHS data type is boolean or its boxed type ============== */ @Test - public void equalToOperationExpr_validBooleanType() { + void equalToOperationExpr_validBooleanType() { // LHS: boolean type, RHS: boolean Type. // No need swap LHS and RHS test case. VariableExpr lhsExpr = createVariableExpr(TypeNode.BOOLEAN, "x"); @@ -227,7 +227,7 @@ public void equalToOperationExpr_validBooleanType() { } @Test - public void equalToOperationExpr_validRHSBooleanBoxedType() { + void equalToOperationExpr_validRHSBooleanBoxedType() { // LHS: boolean type, RHS: boolean boxed Type. // Swapping LHS and RHS test case is covered in "equalToOperationExpr_validLHSBooleanBoxedType". VariableExpr lhsExpr = createVariableExpr(TypeNode.BOOLEAN, "x"); @@ -237,7 +237,7 @@ public void equalToOperationExpr_validRHSBooleanBoxedType() { } @Test - public void equalToOperationExpr_validLHSBooleanBoxedType() { + void equalToOperationExpr_validLHSBooleanBoxedType() { // LHS: boolean boxed type, RHS: boolean Type. // Swapping LHS and RHS test case is covered in "equalToOperationExpr_validRHSBooleanBoxedType". VariableExpr lhsExpr = createVariableExpr(TypeNode.BOOLEAN_OBJECT, "x"); @@ -247,7 +247,7 @@ public void equalToOperationExpr_validLHSBooleanBoxedType() { } @Test - public void notEqualToOperationExpr_validBooleanBoxedToNullType() { + void notEqualToOperationExpr_validBooleanBoxedToNullType() { // LHS: boolean boxed type, RHS: null. // Swapping LHS and RHS test case is covered in // "equalToOperationExpr_validNullWithBooleanBoxedType". @@ -258,7 +258,7 @@ public void notEqualToOperationExpr_validBooleanBoxedToNullType() { } @Test - public void notEqualToOperationExpr_validBooleanBoxedToObjectType() { + void notEqualToOperationExpr_validBooleanBoxedToObjectType() { // LHS: boolean boxed type, RHS: null. // Swapping LHS and RHS test case is covered in // "equalToOperationExpr_validObjectWithBooleanBoxedType". @@ -269,7 +269,7 @@ public void notEqualToOperationExpr_validBooleanBoxedToObjectType() { } @Test - public void notEqualToOperationExpr_invalidBooleanToNumericType() { + void notEqualToOperationExpr_invalidBooleanToNumericType() { // LHS: boolean type, RHS: char boxed type. // Swapping LHS and RHS test case is covered in // "equalToOperationExpr_invalidNumericBooleanType". @@ -281,7 +281,7 @@ public void notEqualToOperationExpr_invalidBooleanToNumericType() { } @Test - public void notEqualToOperationExpr_invalidBooleanToOtherBoxedType() { + void notEqualToOperationExpr_invalidBooleanToOtherBoxedType() { // LHS: boolean type, RHS: numeric boxed type. // Swapping LHS and RHS test case is covered in // "equalToOperationExpr_invalidNumericBoxedWithBooleanType". @@ -293,7 +293,7 @@ public void notEqualToOperationExpr_invalidBooleanToOtherBoxedType() { } @Test - public void notEqualToOperationExpr_invalidBooleanToReferenceType() { + void notEqualToOperationExpr_invalidBooleanToReferenceType() { // LHS: boolean type, RHS: object type. // Swapping LHS and RHS test case is covered in // "equalToOperationExpr_invalidReferenceWithBooleanType". @@ -305,7 +305,7 @@ public void notEqualToOperationExpr_invalidBooleanToReferenceType() { } @Test - public void equalToOperationExpr_invalidBooleanWithNullType() { + void equalToOperationExpr_invalidBooleanWithNullType() { // LHS: boolean type, RHS: null type. // Swapping LHS and RHS test case is covered in // "equalToOperationExpr_invalidNullWithBooleanType". @@ -317,7 +317,7 @@ public void equalToOperationExpr_invalidBooleanWithNullType() { } @Test - public void equalToOperationExpr_invalidBooleanWithObjectType() { + void equalToOperationExpr_invalidBooleanWithObjectType() { // LHS: boolean type, RHS: object type. // Swapping LHS and RHS test case is covered in // "equalToOperationExpr_invalidObjectWithBooleanType". @@ -329,7 +329,7 @@ public void equalToOperationExpr_invalidBooleanWithObjectType() { } @Test - public void equalToOperationExpr_invalidBoxedBooleanWithNumericType() { + void equalToOperationExpr_invalidBoxedBooleanWithNumericType() { // LHS: boolean boxed type, RHS: numeric // Swapping LHS and RHS test case is covered in // "equalToOperationExpr_invalidNumericBooleanBoxedType". @@ -341,7 +341,7 @@ public void equalToOperationExpr_invalidBoxedBooleanWithNumericType() { } @Test - public void equalToOperationExpr_invalidBooleanBoxedWithNumericBoxedType() { + void equalToOperationExpr_invalidBooleanBoxedWithNumericBoxedType() { // LHS: boolean boxed type, RHS: numeric // Swapping LHS and RHS test case is covered in // "equalToOperationExpr_invalidNumericBoxedWithBooleanBoxedType". @@ -353,7 +353,7 @@ public void equalToOperationExpr_invalidBooleanBoxedWithNumericBoxedType() { } @Test - public void equalToOperationExpr_invalidBoxedBooleanWithReferencedType() { + void equalToOperationExpr_invalidBoxedBooleanWithReferencedType() { // LHS: boolean boxed type, RHS: reference type. // Swapping LHS and RHS test case is covered in // "equalToOperationExpr_invalidReferenceWithBooleanBoxedType". @@ -366,7 +366,7 @@ public void equalToOperationExpr_invalidBoxedBooleanWithReferencedType() { /** ===================== Equality Operators: LHS data type is Array ======================== */ @Test - public void equalToOperationExpr_validArrayWithMatchedType() { + void equalToOperationExpr_validArrayWithMatchedType() { // LHS: Array with numeric type, RHS: Array with matched numeric type. // No need swap LHS and RHS test case. VariableExpr lhsExpr = @@ -380,7 +380,7 @@ public void equalToOperationExpr_validArrayWithMatchedType() { } @Test - public void equalToOperationExpr_validArrayWithNullType() { + void equalToOperationExpr_validArrayWithNullType() { // LHS: Array with numeric type, RHS: null // Swapping LHS and RHS test case is covered in "equalToOperationExpr_validANullWithArrayType". VariableExpr lhsExpr = @@ -393,7 +393,7 @@ public void equalToOperationExpr_validArrayWithNullType() { } @Test - public void notEqualToOperationExpr_invalidArrayWithUnmatchedType() { + void notEqualToOperationExpr_invalidArrayWithUnmatchedType() { // LHS: Array with numeric type, RHS: Array with unmatched numeric type. // No need swap LHS and RHS test case. VariableExpr lhsExpr = @@ -408,7 +408,7 @@ public void notEqualToOperationExpr_invalidArrayWithUnmatchedType() { } @Test - public void equalToOperationExpr_invalidArrayWithNotArrayType() { + void equalToOperationExpr_invalidArrayWithNotArrayType() { // LHS: Array with numeric type, RHS: not Array // Swapping LHS and RHS test case is covered in // "equalToOperationExpr_invalidNumericTypeWithArrayType". @@ -422,7 +422,7 @@ public void equalToOperationExpr_invalidArrayWithNotArrayType() { } @Test - public void equalToOperationExpr_invalidArrayWithObjectType() { + void equalToOperationExpr_invalidArrayWithObjectType() { // LHS: Array with numeric type, RHS: New Object type. // Swapping LHS and RHS test case is covered in // "equalToOperationExpr_invalidObjectTypeWithArray". @@ -437,7 +437,7 @@ public void equalToOperationExpr_invalidArrayWithObjectType() { /** ================== Equality Operators: LHS data type is reference type =================== */ @Test - public void equalToOperationExpr_validReferenceWithMatchedType() { + void equalToOperationExpr_validReferenceWithMatchedType() { // LHS: String type, RHS: matched String type. // No need swap LHS and RHS test case. VariableExpr lhsExpr = createVariableExpr(TypeNode.STRING, "x"); @@ -447,7 +447,7 @@ public void equalToOperationExpr_validReferenceWithMatchedType() { } @Test - public void equalToOperationExpr_validReferenceWithNullType() { + void equalToOperationExpr_validReferenceWithNullType() { // LHS: String type, RHS: null. // Swapping LHS and RHS test case is covered in // "equalToOperationExpr_validNullWithReferenceType". @@ -458,7 +458,7 @@ public void equalToOperationExpr_validReferenceWithNullType() { } @Test - public void equalToOperationExpr_validReferenceWithObjectType() { + void equalToOperationExpr_validReferenceWithObjectType() { // LHS: String type, RHS: New object type. // Swapping LHS and RHS test case is covered in // "equalToOperationExpr_validObjectWithStringType". @@ -469,7 +469,7 @@ public void equalToOperationExpr_validReferenceWithObjectType() { } @Test - public void equalToOperationExpr_validAnyObjectTypeWithObject() { + void equalToOperationExpr_validAnyObjectTypeWithObject() { // LHS: Any reference type, RHS: Object type. // Swapping LHS and RHS test case is covered in // "equalToOperationExpr_validObjectWithAnyObjectType". @@ -486,7 +486,7 @@ public void equalToOperationExpr_validAnyObjectTypeWithObject() { } @Test - public void equalToOperationExpr_validAnyReferenceTypeWithNull() { + void equalToOperationExpr_validAnyReferenceTypeWithNull() { // LHS: Any reference type, RHS: Null type. // Swapping LHS and RHS test case is covered in // "equalToOperationExpr_validNullWithAnyReferenceType". @@ -503,7 +503,7 @@ public void equalToOperationExpr_validAnyReferenceTypeWithNull() { } @Test - public void equalToOperationExpr_invalidReferenceWithUnmatchedReferenceType() { + void equalToOperationExpr_invalidReferenceWithUnmatchedReferenceType() { // LHS: String type, RHS: Unmatched reference type. // No need swap LHS and RHS test case. VariableExpr lhsExpr = createVariableExpr(TypeNode.STRING, "x"); @@ -520,7 +520,7 @@ public void equalToOperationExpr_invalidReferenceWithUnmatchedReferenceType() { } @Test - public void equalToOperationExpr_invalidReferenceWithNumericType() { + void equalToOperationExpr_invalidReferenceWithNumericType() { // LHS: String type, RHS: Numeric type // Swapping LHS and RHS test case is covered in // "notEqualToOperationExpr_invalidNumericStringType". @@ -532,7 +532,7 @@ public void equalToOperationExpr_invalidReferenceWithNumericType() { } @Test - public void equalToOperationExpr_invalidReferenceWithNumericBoxedType() { + void equalToOperationExpr_invalidReferenceWithNumericBoxedType() { // LHS: String type, RHS: numeric boxed type. // Swapping LHS and RHS test case is covered in // "equalToOperationExpr_invalidNumericBoxedWithReferenceType". @@ -544,7 +544,7 @@ public void equalToOperationExpr_invalidReferenceWithNumericBoxedType() { } @Test - public void equalToOperationExpr_invalidReferenceWithBooleanType() { + void equalToOperationExpr_invalidReferenceWithBooleanType() { // LHS: String type, RHS: Boolean boxed type. // Swapping LHS and RHS test case is covered in // "notEqualToOperationExpr_invalidBooleanToReferenceType". @@ -556,7 +556,7 @@ public void equalToOperationExpr_invalidReferenceWithBooleanType() { } @Test - public void equalToOperationExpr_invalidReferenceWithBooleanBoxedType() { + void equalToOperationExpr_invalidReferenceWithBooleanBoxedType() { // LHS: String type, RHS: Boolean boxed type. // Swapping LHS and RHS test case is covered in // "equalToOperationExpr_invalidBoxedBooleanWithReferencedType". @@ -569,7 +569,7 @@ public void equalToOperationExpr_invalidReferenceWithBooleanBoxedType() { /** ================== Equality Operators: LHS data type is Object or null =================== */ @Test - public void equalToOperationExpr_validObjectWithAnyObjectType() { + void equalToOperationExpr_validObjectWithAnyObjectType() { // LHS: Object type, RHS: Any reference type. // Swapping LHS and RHS test case is covered in // "equalToOperationExpr_validAnyObjectTypeWithObject". @@ -586,7 +586,7 @@ public void equalToOperationExpr_validObjectWithAnyObjectType() { } @Test - public void equalToOperationExpr_validNullWithAnyReferenceType() { + void equalToOperationExpr_validNullWithAnyReferenceType() { // LHS: Null type, RHS: any reference type // Swapping LHS and RHS test case is covered in // "equalToOperationExpr_validAnyReferenceTypeWithNull". @@ -603,7 +603,7 @@ public void equalToOperationExpr_validNullWithAnyReferenceType() { } @Test - public void equalToOperationExpr_validObjectWithNullType() { + void equalToOperationExpr_validObjectWithNullType() { // LHS: Object, RHS: Null. // Swapping LHS and RHS test case is covered in "equalToOperationExpr_validNullWithObjectType". VariableExpr lhsExpr = createVariableExpr(TypeNode.OBJECT, "x"); @@ -613,7 +613,7 @@ public void equalToOperationExpr_validObjectWithNullType() { } @Test - public void equalToOperationExpr_validNullWithObjectType() { + void equalToOperationExpr_validNullWithObjectType() { // LHS: Null, RHS: Object. // Swapping LHS and RHS test case is covered in "equalToOperationExpr_validObjectWithNullType". VariableExpr rhsExpr = createVariableExpr(TypeNode.OBJECT, "x"); @@ -623,7 +623,7 @@ public void equalToOperationExpr_validNullWithObjectType() { } @Test - public void equalToOperationExpr_validNullWithNullType() { + void equalToOperationExpr_validNullWithNullType() { // LHS: Null, RHS: Null. // No need swap LHS and RHS test case. ValueExpr lhsExpr = ValueExpr.createNullExpr(); @@ -633,7 +633,7 @@ public void equalToOperationExpr_validNullWithNullType() { } @Test - public void equalToOperationExpr_validObjectWithStringType() { + void equalToOperationExpr_validObjectWithStringType() { // LHS: Object type, RHS: Reference type. // Swapping LHS and RHS test case is covered in // "equalToOperationExpr_validReferenceWithObjectType". @@ -644,7 +644,7 @@ public void equalToOperationExpr_validObjectWithStringType() { } @Test - public void equalToOperationExpr_validObjectWithBooleanBoxedType() { + void equalToOperationExpr_validObjectWithBooleanBoxedType() { // LHS: Object type, RHS: Boolean boxed type. // Swapping LHS and RHS test case is covered in // "notEqualToOperationExpr_validBooleanBoxedToObjectType". @@ -655,7 +655,7 @@ public void equalToOperationExpr_validObjectWithBooleanBoxedType() { } @Test - public void equalToOperationExpr_validObjectWithNumericBoxedType() { + void equalToOperationExpr_validObjectWithNumericBoxedType() { // LHS: Object type, RHS: Any Boxed type. // Swapping LHS and RHS test case is covered in // "equalToOperationExpr_validNumericBoxedWithNewObjectType". @@ -666,7 +666,7 @@ public void equalToOperationExpr_validObjectWithNumericBoxedType() { } @Test - public void equalToOperationExpr_validNullWithReferenceType() { + void equalToOperationExpr_validNullWithReferenceType() { // LHS: Null type, RHS: Reference type. // Swapping LHS and RHS test case is covered in // "equalToOperationExpr_validNullWithReferenceType". @@ -677,7 +677,7 @@ public void equalToOperationExpr_validNullWithReferenceType() { } @Test - public void equalToOperationExpr_validNullWithBooleanBoxedType() { + void equalToOperationExpr_validNullWithBooleanBoxedType() { // LHS: Object type, RHS: Any Boxed type // Swapping LHS and RHS test case is covered in // "notEqualToOperationExpr_validBooleanBoxedToNullType". @@ -688,7 +688,7 @@ public void equalToOperationExpr_validNullWithBooleanBoxedType() { } @Test - public void equalToOperationExpr_validNullWithNumericBoxedType() { + void equalToOperationExpr_validNullWithNumericBoxedType() { // LHS: Object type, RHS: Any Boxed type. // Swapping LHS and RHS test case is covered in // "equalToOperationExpr_validNumericBoxedWithNullType". @@ -699,7 +699,7 @@ public void equalToOperationExpr_validNullWithNumericBoxedType() { } @Test - public void equalToOperationExpr_validANullWithArrayType() { + void equalToOperationExpr_validANullWithArrayType() { // LHS: Null, RHS: Array with numeric type. // Swapping LHS and RHS test case is covered in "equalToOperationExpr_validArrayWithNullType". NullObjectValue nullObjectValue = NullObjectValue.create(); @@ -712,7 +712,7 @@ public void equalToOperationExpr_validANullWithArrayType() { } @Test - public void equalToOperationExpr_invalidNullWithNumericType() { + void equalToOperationExpr_invalidNullWithNumericType() { // LHS: Null type, RHS: Nny Numeric type. // Swapping LHS and RHS test case is covered in // "notEqualToOperationExpr_invalidNumericNullType". @@ -724,7 +724,7 @@ public void equalToOperationExpr_invalidNullWithNumericType() { } @Test - public void equalToOperationExpr_invalidNullWithBooleanType() { + void equalToOperationExpr_invalidNullWithBooleanType() { // LHS: Null type, RHS: Boolean type. // Swapping LHS and RHS test case is covered in // "equalToOperationExpr_invalidBooleanWithNullType". @@ -736,7 +736,7 @@ public void equalToOperationExpr_invalidNullWithBooleanType() { } @Test - public void equalToOperationExpr_invalidObjectWithNumericType() { + void equalToOperationExpr_invalidObjectWithNumericType() { // LHS: Object type, RHS: Any Numeric type. VariableExpr lhsExpr = createVariableExpr(TypeNode.OBJECT, "x"); VariableExpr rhsExpr = createVariableExpr(TypeNode.DOUBLE, "y"); @@ -746,7 +746,7 @@ public void equalToOperationExpr_invalidObjectWithNumericType() { } @Test - public void equalToOperationExpr_invalidObjectWithBooleanType() { + void equalToOperationExpr_invalidObjectWithBooleanType() { // LHS: Object type, RHS: Boolean type. // Swapping LHS and RHS test case is covered in // "equalToOperationExpr_invalidBooleanWithObjectType". @@ -758,7 +758,7 @@ public void equalToOperationExpr_invalidObjectWithBooleanType() { } @Test - public void equalToOperationExpr_invalidObjectTypeWithArray() { + void equalToOperationExpr_invalidObjectTypeWithArray() { // LHS: New Object type, RHS: Array with numeric type. // Swapping LHS and RHS test case is covered in // "equalToOperationExpr_invalidArrayWithObjectType". @@ -774,7 +774,7 @@ public void equalToOperationExpr_invalidObjectTypeWithArray() { /** ================== Less Than Operators: expr types are numeric types =================== */ // The expression types on LHS or RHS could be any numeric type or any numeric boxed type. @Test - public void lessThanOperationExpr_validMatchedNumericType() { + void lessThanOperationExpr_validMatchedNumericType() { // LHS: Numeric type, RHS: Matched numeric type. // No need swap LHS and RHS test case. VariableExpr lhsExpr = createVariableExpr(TypeNode.INT, "x"); @@ -784,7 +784,7 @@ public void lessThanOperationExpr_validMatchedNumericType() { } @Test - public void lessThanOperationExpr_validUnmatchedNumericType() { + void lessThanOperationExpr_validUnmatchedNumericType() { // LHS: Numeric type, RHS: Unmatched numeric type. // No need swap LHS and RHS test case. VariableExpr lhsExpr = createVariableExpr(TypeNode.INT, "x"); @@ -794,7 +794,7 @@ public void lessThanOperationExpr_validUnmatchedNumericType() { } @Test - public void lessThanOperationExpr_validMatchedNumericBoxedType() { + void lessThanOperationExpr_validMatchedNumericBoxedType() { // LHS: Numeric type, RHS: Matched numeric type. // Swap case in "lessThanOperationExpr_validNumericBoxedTypeWithMatchedNumericType". VariableExpr lhsExpr = createVariableExpr(TypeNode.FLOAT, "x"); @@ -804,7 +804,7 @@ public void lessThanOperationExpr_validMatchedNumericBoxedType() { } @Test - public void lessThanOperationExpr_validNumericBoxedTypeWithMatchedNumericType() { + void lessThanOperationExpr_validNumericBoxedTypeWithMatchedNumericType() { // LHS: Numeric boxed type, RHS: Matched numeric type. // Swap case in "lessThanOperationExpr_validMatchedNumericBoxedType". VariableExpr lhsExpr = createVariableExpr(TypeNode.CHAR_OBJECT, "x"); @@ -814,7 +814,7 @@ public void lessThanOperationExpr_validNumericBoxedTypeWithMatchedNumericType() } @Test - public void lessThanOperationExpr_validUnmatchedNumericBoxedType() { + void lessThanOperationExpr_validUnmatchedNumericBoxedType() { // LHS: Numeric type, RHS: Unmatched numeric boxed type. // Swap case in "lessThanOperationExpr_validNumericBoxedTypeWithUnmatchedUnBoxedType". VariableExpr lhsExpr = createVariableExpr(TypeNode.DOUBLE, "x"); @@ -824,7 +824,7 @@ public void lessThanOperationExpr_validUnmatchedNumericBoxedType() { } @Test - public void lessThanOperationExpr_validNumericBoxedTypeWithUnmatchedUnBoxedType() { + void lessThanOperationExpr_validNumericBoxedTypeWithUnmatchedUnBoxedType() { // LHS: Numeric boxed type, RHS: Unmatched numeric type. // Swap case in "lessThanOperationExpr_validUnmatchedNumericBoxedType". VariableExpr lhsExpr = createVariableExpr(TypeNode.INT_OBJECT, "x"); @@ -834,7 +834,7 @@ public void lessThanOperationExpr_validNumericBoxedTypeWithUnmatchedUnBoxedType( } @Test - public void lessThanOperationExpr_validNumericBoxedTypeWithMatchedBoxedType() { + void lessThanOperationExpr_validNumericBoxedTypeWithMatchedBoxedType() { // LHS: Numeric boxed type, RHS: Matched numeric boxed type. // No need swap case. VariableExpr lhsExpr = createVariableExpr(TypeNode.INT_OBJECT, "x"); @@ -844,7 +844,7 @@ public void lessThanOperationExpr_validNumericBoxedTypeWithMatchedBoxedType() { } @Test - public void lessThanOperationExpr_validNumericBoxedTypeWithUnmatchedBoxedType() { + void lessThanOperationExpr_validNumericBoxedTypeWithUnmatchedBoxedType() { // LHS: Numeric boxed type, RHS: Unmatched numeric boxed type. // No need swap case. VariableExpr lhsExpr = createVariableExpr(TypeNode.INT_OBJECT, "x"); @@ -856,7 +856,7 @@ public void lessThanOperationExpr_validNumericBoxedTypeWithUnmatchedBoxedType() /** ================= Less Than Operators: expr types are non-numeric types ================== */ // Invalid if any of expression type on LHS or RHS is non-numeric type or non numeric boxed type. @Test - public void lessThanOperationExpr_invalidNumericTypeWithNullType() { + void lessThanOperationExpr_invalidNumericTypeWithNullType() { // LHS: Null type, RHS: Numeric type. // Swap case in "lessThanOperationExpr_invalidNumericWithNullType". VariableExpr lhsExpr = createVariableExpr(TypeNode.INT, "x"); @@ -867,7 +867,7 @@ public void lessThanOperationExpr_invalidNumericTypeWithNullType() { } @Test - public void lessThanOperationExpr_invalidNumericBoxedTypeWithNullType() { + void lessThanOperationExpr_invalidNumericBoxedTypeWithNullType() { // LHS: Numeric boxed type, RHS: Null type. // Swap case in "lessThanOperationExpr_invalidNullWithNumericBoxedType". VariableExpr lhsExpr = createVariableExpr(TypeNode.INT_OBJECT, "x"); @@ -878,7 +878,7 @@ public void lessThanOperationExpr_invalidNumericBoxedTypeWithNullType() { } @Test - public void lessThanOperationExpr_invalidNumericTypeWithObjectType() { + void lessThanOperationExpr_invalidNumericTypeWithObjectType() { // LHS: Numeric type, RHS: Object Type. // Swap case in "lessThanOperationExpr_invalidObjectNumericType". VariableExpr lhsExpr = createVariableExpr(TypeNode.INT, "x"); @@ -889,7 +889,7 @@ public void lessThanOperationExpr_invalidNumericTypeWithObjectType() { } @Test - public void lessThanOperationExpr_invalidNumericBoxedTypeWithObjectType() { + void lessThanOperationExpr_invalidNumericBoxedTypeWithObjectType() { // LHS: Numeric boxed type, RHS: Object Type. // Swap case in "lessThanOperationExpr_invalidObjectNumericBoxedType". VariableExpr lhsExpr = createVariableExpr(TypeNode.INT_OBJECT, "x"); @@ -900,7 +900,7 @@ public void lessThanOperationExpr_invalidNumericBoxedTypeWithObjectType() { } @Test - public void lessThanOperationExpr_invalidNumericBoxedTypeWithReferenceType() { + void lessThanOperationExpr_invalidNumericBoxedTypeWithReferenceType() { // LHS: Numeric boxed type, RHS: Reference Type. // Swap case in "lessThanOperationExpr_invalidReferenceTypeWithNumericBoxedType". VariableExpr lhsExpr = createVariableExpr(TypeNode.INT_OBJECT, "x"); @@ -911,7 +911,7 @@ public void lessThanOperationExpr_invalidNumericBoxedTypeWithReferenceType() { } @Test - public void lessThanOperationExpr_invalidReferenceTypeWithNumericBoxedType() { + void lessThanOperationExpr_invalidReferenceTypeWithNumericBoxedType() { // LHS: Reference type, RHS: Numeric boxed Type. // Swap case in "lessThanOperationExpr_invalidNumericBoxedTypeWithReferenceType". VariableExpr lhsExpr = createVariableExpr(TypeNode.STRING, "x"); @@ -922,7 +922,7 @@ public void lessThanOperationExpr_invalidReferenceTypeWithNumericBoxedType() { } @Test - public void lessThanOperationExpr_invalidObjectNumericType() { + void lessThanOperationExpr_invalidObjectNumericType() { // LHS: Object type, RHS: Numeric Type. // Swap case in "lessThanOperationExpr_invalidNumericTypeWithObjectType". NewObjectExpr lhsExpr = NewObjectExpr.withType(TypeNode.OBJECT); @@ -933,7 +933,7 @@ public void lessThanOperationExpr_invalidObjectNumericType() { } @Test - public void lessThanOperationExpr_invalidObjectNumericBoxedType() { + void lessThanOperationExpr_invalidObjectNumericBoxedType() { // LHS: Object type, RHS: Numeric boxed Type. // Swap case in "lessThanOperationExpr_invalidNumericBoxedTypeWithObjectType". NewObjectExpr lhsExpr = NewObjectExpr.withType(TypeNode.OBJECT); @@ -944,7 +944,7 @@ public void lessThanOperationExpr_invalidObjectNumericBoxedType() { } @Test - public void lessThanOperationExpr_invalidNumericWithNullType() { + void lessThanOperationExpr_invalidNumericWithNullType() { // LHS: Null type, RHS: Numeric box type. ValueExpr lhsExpr = ValueExpr.createNullExpr(); @@ -955,7 +955,7 @@ public void lessThanOperationExpr_invalidNumericWithNullType() { } @Test - public void lessThanOperationExpr_invalidNullWithNumericBoxedType() { + void lessThanOperationExpr_invalidNullWithNumericBoxedType() { // LHS: Null type, RHS: Numeric box type. // Swap case in "lessThanOperationExpr_invalidNumericTypeWithNullType". ValueExpr lhsExpr = ValueExpr.createNullExpr(); @@ -966,7 +966,7 @@ public void lessThanOperationExpr_invalidNullWithNumericBoxedType() { } @Test - public void lessThanOperationExpr_invalidVoidType() { + void lessThanOperationExpr_invalidVoidType() { // LHS: Null type, RHS: Numeric box type. // No need swap case MethodInvocationExpr lhsExpr = diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/engine/ast/ReturnExprTest.java b/gapic-generator-java/src/test/java/com/google/api/generator/engine/ast/ReturnExprTest.java index 260c5955f7..cb570034b3 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/engine/ast/ReturnExprTest.java +++ b/gapic-generator-java/src/test/java/com/google/api/generator/engine/ast/ReturnExprTest.java @@ -16,17 +16,17 @@ import static org.junit.Assert.assertThrows; -import org.junit.Test; +import org.junit.jupiter.api.Test; -public class ReturnExprTest { +class ReturnExprTest { @Test - public void validReturnExpr_basic() { + void validReturnExpr_basic() { ReturnExpr.withExpr(ValueExpr.withValue(StringObjectValue.withValue("asdf"))); // No exception thrown, we're good. } @Test - public void invalidReturnExpr_nestedReturnExpr() { + void invalidReturnExpr_nestedReturnExpr() { ReturnExpr returnExpr = ReturnExpr.withExpr(ValueExpr.withValue(StringObjectValue.withValue("asdf"))); assertThrows(IllegalStateException.class, () -> ReturnExpr.withExpr(returnExpr)); diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/engine/ast/StringObjectValueTest.java b/gapic-generator-java/src/test/java/com/google/api/generator/engine/ast/StringObjectValueTest.java index 1f29f92b14..8d7d92db0f 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/engine/ast/StringObjectValueTest.java +++ b/gapic-generator-java/src/test/java/com/google/api/generator/engine/ast/StringObjectValueTest.java @@ -16,19 +16,19 @@ import static com.google.common.truth.Truth.assertThat; -import org.junit.Test; +import org.junit.jupiter.api.Test; -public class StringObjectValueTest { +class StringObjectValueTest { @Test - public void createStringObjectValue_basic() { + void createStringObjectValue_basic() { StringObjectValue s = StringObjectValue.builder().setValue("test").build(); assertThat(s.value()).isEqualTo("\"test\""); assertThat(s.type()).isEqualTo(TypeNode.STRING); } @Test - public void createStringObjectValue_escapeCharacter() { + void createStringObjectValue_escapeCharacter() { StringObjectValue valueSpecialChar = StringObjectValue.withValue("\" \t \\ \b \r \f \n '"); String expected = "\"\\\" \\t \\\\ \\b \\r \\f \\n '\""; assertThat(valueSpecialChar.value()).isEqualTo(expected); @@ -36,7 +36,7 @@ public void createStringObjectValue_escapeCharacter() { } @Test - public void createStringObjectValue_specialCharacter() { + void createStringObjectValue_specialCharacter() { StringObjectValue valueSpecialChar = StringObjectValue.withValue("Tom said: \"Hi!\"; \n"); String expected = "\"Tom said: \\\"Hi!\\\"; \\n\""; assertThat(valueSpecialChar.value()).isEqualTo(expected); @@ -44,7 +44,7 @@ public void createStringObjectValue_specialCharacter() { } @Test - public void createStringObjectValue_specialCharacterComment() { + void createStringObjectValue_specialCharacterComment() { StringObjectValue valueSpecialChar = StringObjectValue.withValue("Service comment may include special characters: <>&\"`'@"); String expected = "\"Service comment may include special characters: <>&\\\"`'@\""; @@ -53,7 +53,7 @@ public void createStringObjectValue_specialCharacterComment() { } @Test - public void createStringObjectValue_usPunctuation() { + void createStringObjectValue_usPunctuation() { StringObjectValue valueSpecialChar = StringObjectValue.withValue("US Punctuation, one of !\"#$%&'()*+,-./:;<=>?@[\\]^_`{|}~"); String expected = "\"US Punctuation, one of !\\\"#$%&'()*+,-./:;<=>?@[\\\\]^_`{|}~\""; @@ -62,7 +62,7 @@ public void createStringObjectValue_usPunctuation() { } @Test - public void createStringObjectValue_htmlCharacterComment() { + void createStringObjectValue_htmlCharacterComment() { StringObjectValue valueSpecialChar = StringObjectValue.withValue("  ( [ – >:<"); String expected = "\"  ( [ – >:<\""; diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/engine/ast/SuperObjectValueTest.java b/gapic-generator-java/src/test/java/com/google/api/generator/engine/ast/SuperObjectValueTest.java index 3c7a264ca9..1e06bec08c 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/engine/ast/SuperObjectValueTest.java +++ b/gapic-generator-java/src/test/java/com/google/api/generator/engine/ast/SuperObjectValueTest.java @@ -16,12 +16,12 @@ import static org.junit.Assert.assertThrows; -import org.junit.Test; +import org.junit.jupiter.api.Test; -public class SuperObjectValueTest { +class SuperObjectValueTest { @Test - public void validSuperObjectValue_basic() { + void validSuperObjectValue_basic() { VaporReference ref = VaporReference.builder() .setName("Student") @@ -33,7 +33,7 @@ public void validSuperObjectValue_basic() { } @Test - public void invalidSuperObjectValue_nonReferenceType() { + void invalidSuperObjectValue_nonReferenceType() { assertThrows( IllegalStateException.class, () -> { @@ -42,7 +42,7 @@ public void invalidSuperObjectValue_nonReferenceType() { } @Test - public void invalidSuperObjectValue_nullType() { + void invalidSuperObjectValue_nullType() { assertThrows( IllegalStateException.class, () -> { diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/engine/ast/SynchronizedStatementTest.java b/gapic-generator-java/src/test/java/com/google/api/generator/engine/ast/SynchronizedStatementTest.java index f7957d03e3..67a6a1c6c6 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/engine/ast/SynchronizedStatementTest.java +++ b/gapic-generator-java/src/test/java/com/google/api/generator/engine/ast/SynchronizedStatementTest.java @@ -16,11 +16,11 @@ import static org.junit.Assert.assertThrows; -import org.junit.Test; +import org.junit.jupiter.api.Test; -public class SynchronizedStatementTest { +class SynchronizedStatementTest { @Test - public void validSynchronizedStatement_basicThis() { + void validSynchronizedStatement_basicThis() { SynchronizedStatement.builder() .setLock( ThisObjectValue.withType( @@ -31,7 +31,7 @@ public void validSynchronizedStatement_basicThis() { } @Test - public void validSynchronizedStatement_basicVariableExpr() { + void validSynchronizedStatement_basicVariableExpr() { SynchronizedStatement.builder() .setLock( VariableExpr.withVariable( @@ -42,7 +42,7 @@ public void validSynchronizedStatement_basicVariableExpr() { } @Test - public void invalidSynchronizedStatement_primitiveLock() { + void invalidSynchronizedStatement_primitiveLock() { assertThrows( IllegalStateException.class, () -> @@ -57,7 +57,7 @@ public void invalidSynchronizedStatement_primitiveLock() { } @Test - public void invalidSynchronizedStatement_declaredVariableExpr() { + void invalidSynchronizedStatement_declaredVariableExpr() { VariableExpr strVarExpr = VariableExpr.builder() .setVariable(Variable.builder().setName("str").setType(TypeNode.STRING).build()) diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/engine/ast/TernaryExprTest.java b/gapic-generator-java/src/test/java/com/google/api/generator/engine/ast/TernaryExprTest.java index 9cde2c39d3..153fb797ba 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/engine/ast/TernaryExprTest.java +++ b/gapic-generator-java/src/test/java/com/google/api/generator/engine/ast/TernaryExprTest.java @@ -17,11 +17,11 @@ import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertThrows; -import org.junit.Test; +import org.junit.jupiter.api.Test; -public class TernaryExprTest { +class TernaryExprTest { @Test - public void validTernaryExpr_primitiveType() { + void validTernaryExpr_primitiveType() { Variable conditionVariable = Variable.builder().setName("condition").setType(TypeNode.BOOLEAN).build(); VariableExpr conditionExpr = VariableExpr.builder().setVariable(conditionVariable).build(); @@ -43,7 +43,7 @@ public void validTernaryExpr_primitiveType() { } @Test - public void validTernaryExpr_objectType() { + void validTernaryExpr_objectType() { Variable conditionVariable = Variable.builder().setName("condition").setType(TypeNode.BOOLEAN).build(); VariableExpr conditionExpr = VariableExpr.builder().setVariable(conditionVariable).build(); @@ -65,7 +65,7 @@ public void validTernaryExpr_objectType() { } @Test - public void validTernaryExpr_primitiveAndBoxedType() { + void validTernaryExpr_primitiveAndBoxedType() { // [Constructing] `condition ? intValue : integerValue` // The type of whole expression should be Integer. Variable conditionVariable = @@ -88,7 +88,7 @@ public void validTernaryExpr_primitiveAndBoxedType() { } @Test - public void validTernaryExpr_boxedAndPrimitiveType() { + void validTernaryExpr_boxedAndPrimitiveType() { // [Constructing] `condition ? doubleObjectVariable : doubleVariable` // The type of whole expression should be Double. Variable conditionVariable = @@ -112,7 +112,7 @@ public void validTernaryExpr_boxedAndPrimitiveType() { } @Test - public void validTernaryExpr_objectAndNull() { + void validTernaryExpr_objectAndNull() { TernaryExpr ternaryExpr = TernaryExpr.builder() .setConditionExpr( @@ -126,7 +126,7 @@ public void validTernaryExpr_objectAndNull() { } @Test - public void validTernaryExpr_nullAndObject() { + void validTernaryExpr_nullAndObject() { TernaryExpr ternaryExpr = TernaryExpr.builder() .setConditionExpr( @@ -140,7 +140,7 @@ public void validTernaryExpr_nullAndObject() { } @Test - public void validTernaryExpr_superAndSubtype() { + void validTernaryExpr_superAndSubtype() { TernaryExpr ternaryExpr = TernaryExpr.builder() .setConditionExpr( @@ -156,7 +156,7 @@ public void validTernaryExpr_superAndSubtype() { } @Test - public void validTernaryExpr_subAndSupertype() { + void validTernaryExpr_subAndSupertype() { TernaryExpr ternaryExpr = TernaryExpr.builder() .setConditionExpr( @@ -172,7 +172,7 @@ public void validTernaryExpr_subAndSupertype() { } @Test - public void invalidTernaryExpr_mismatchedPrimitiveTypes() { + void invalidTernaryExpr_mismatchedPrimitiveTypes() { Variable conditionVariable = Variable.builder().setName("condition").setType(TypeNode.BOOLEAN).build(); VariableExpr conditionExpr = VariableExpr.builder().setVariable(conditionVariable).build(); @@ -193,7 +193,7 @@ public void invalidTernaryExpr_mismatchedPrimitiveTypes() { } @Test - public void invalidTernaryExpr_mismatchedBoxedAndPrimitiveTypes() { + void invalidTernaryExpr_mismatchedBoxedAndPrimitiveTypes() { Variable conditionVariable = Variable.builder().setName("condition").setType(TypeNode.BOOLEAN).build(); VariableExpr conditionExpr = VariableExpr.builder().setVariable(conditionVariable).build(); @@ -216,7 +216,7 @@ public void invalidTernaryExpr_mismatchedBoxedAndPrimitiveTypes() { } @Test - public void invalidTernaryExpr_incompatibleThenElsePrimitiveTypes() { + void invalidTernaryExpr_incompatibleThenElsePrimitiveTypes() { assertThrows( IllegalStateException.class, () -> @@ -238,7 +238,7 @@ public void invalidTernaryExpr_incompatibleThenElsePrimitiveTypes() { } @Test - public void invalidTernaryExpr_incompatibleThenElseObjectTypes() { + void invalidTernaryExpr_incompatibleThenElseObjectTypes() { assertThrows( IllegalStateException.class, () -> diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/engine/ast/ThisObjectValueTest.java b/gapic-generator-java/src/test/java/com/google/api/generator/engine/ast/ThisObjectValueTest.java index 83e7c75ab8..870f4fb7af 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/engine/ast/ThisObjectValueTest.java +++ b/gapic-generator-java/src/test/java/com/google/api/generator/engine/ast/ThisObjectValueTest.java @@ -16,11 +16,11 @@ import static org.junit.Assert.assertThrows; -import org.junit.Test; +import org.junit.jupiter.api.Test; -public class ThisObjectValueTest { +class ThisObjectValueTest { @Test - public void validThisObjectValue_basic() { + void validThisObjectValue_basic() { VaporReference ref = VaporReference.builder() .setName("Student") @@ -32,7 +32,7 @@ public void validThisObjectValue_basic() { } @Test - public void invalidThisObjectValue_nonReferenceType() { + void invalidThisObjectValue_nonReferenceType() { assertThrows( IllegalStateException.class, () -> { @@ -41,7 +41,7 @@ public void invalidThisObjectValue_nonReferenceType() { } @Test - public void invalidThisObjectValue_nullType() { + void invalidThisObjectValue_nullType() { assertThrows( IllegalStateException.class, () -> { diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/engine/ast/ThrowExprTest.java b/gapic-generator-java/src/test/java/com/google/api/generator/engine/ast/ThrowExprTest.java index cc4b38f3df..e4baf14fc1 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/engine/ast/ThrowExprTest.java +++ b/gapic-generator-java/src/test/java/com/google/api/generator/engine/ast/ThrowExprTest.java @@ -17,18 +17,18 @@ import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertThrows; -import org.junit.Test; +import org.junit.jupiter.api.Test; -public class ThrowExprTest { +class ThrowExprTest { @Test - public void createThrowExpr_basic() { + void createThrowExpr_basic() { TypeNode npeType = TypeNode.withExceptionClazz(NullPointerException.class); ThrowExpr.builder().setType(npeType).build(); // No exception thrown, we're good. } @Test - public void createThrowExpr_basicExpr() { + void createThrowExpr_basicExpr() { TypeNode npeType = TypeNode.withExceptionClazz(NullPointerException.class); VariableExpr throwVarExpr = VariableExpr.builder() @@ -46,14 +46,14 @@ public void createThrowExpr_basicExpr() { } @Test - public void createThrowExpr_basicWithStringMessage() { + void createThrowExpr_basicWithStringMessage() { TypeNode npeType = TypeNode.withExceptionClazz(NullPointerException.class); ThrowExpr.builder().setType(npeType).setMessageExpr("Some message").build(); // No exception thrown, we're good. } @Test - public void createThrowExpr_messageExpr() { + void createThrowExpr_messageExpr() { TypeNode npeType = TypeNode.withExceptionClazz(NullPointerException.class); Expr messageExpr = MethodInvocationExpr.builder() @@ -65,14 +65,14 @@ public void createThrowExpr_messageExpr() { } @Test - public void createThrowExpr_badExceptionType() { + void createThrowExpr_badExceptionType() { TypeNode nonExceptionType = TypeNode.STRING; assertThrows( IllegalStateException.class, () -> ThrowExpr.builder().setType(nonExceptionType).build()); } @Test - public void createThrowExpr_badMessageExpr() { + void createThrowExpr_badMessageExpr() { TypeNode npeType = TypeNode.withExceptionClazz(NullPointerException.class); Expr messageExpr = MethodInvocationExpr.builder().setMethodName("foobar").setReturnType(TypeNode.INT).build(); @@ -82,7 +82,7 @@ public void createThrowExpr_badMessageExpr() { } @Test - public void createThrowExpr_causeExpr() { + void createThrowExpr_causeExpr() { TypeNode npeType = TypeNode.withReference(ConcreteReference.withClazz(NullPointerException.class)); ThrowExpr.builder() @@ -96,7 +96,7 @@ public void createThrowExpr_causeExpr() { } @Test - public void createThrowExpr_causeExpr_throwableSubtype() { + void createThrowExpr_causeExpr_throwableSubtype() { TypeNode npeType = TypeNode.withReference(ConcreteReference.withClazz(NullPointerException.class)); ThrowExpr.builder() @@ -110,7 +110,7 @@ public void createThrowExpr_causeExpr_throwableSubtype() { } @Test - public void createThrowExpr_causeExpr_onThrowableSubtype() { + void createThrowExpr_causeExpr_onThrowableSubtype() { TypeNode npeType = TypeNode.withReference(ConcreteReference.withClazz(NullPointerException.class)); assertThrows( @@ -123,7 +123,7 @@ public void createThrowExpr_causeExpr_onThrowableSubtype() { } @Test - public void createThrowExpr_messageAndCauseExpr() { + void createThrowExpr_messageAndCauseExpr() { TypeNode npeType = TypeNode.withReference(ConcreteReference.withClazz(NullPointerException.class)); Expr messageExpr = @@ -143,7 +143,7 @@ public void createThrowExpr_messageAndCauseExpr() { } @Test - public void createThrowExpr_cannotThrowVariableDeclaration() { + void createThrowExpr_cannotThrowVariableDeclaration() { VariableExpr throwVarExpr = VariableExpr.builder() .setVariable( @@ -161,7 +161,7 @@ public void createThrowExpr_cannotThrowVariableDeclaration() { } @Test - public void createThrowExpr_cannotThrowNonExceptionTypedExpr() { + void createThrowExpr_cannotThrowNonExceptionTypedExpr() { VariableExpr throwVarExpr = VariableExpr.builder() .setVariable(Variable.builder().setName("str").setType(TypeNode.STRING).build()) @@ -171,7 +171,7 @@ public void createThrowExpr_cannotThrowNonExceptionTypedExpr() { } @Test - public void createThrowExpr_cannotHaveThrowVariableAndMessageExprPresent() { + void createThrowExpr_cannotHaveThrowVariableAndMessageExprPresent() { Expr messageExpr = MethodInvocationExpr.builder() .setMethodName("foobar") @@ -191,7 +191,7 @@ public void createThrowExpr_cannotHaveThrowVariableAndMessageExprPresent() { } @Test - public void createThrowExpr_cannotHaveThrowVariableAndCauseExprPresent() { + void createThrowExpr_cannotHaveThrowVariableAndCauseExprPresent() { VariableExpr throwVarExpr = VariableExpr.builder() .setVariable( diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/engine/ast/TryCatchStatementTest.java b/gapic-generator-java/src/test/java/com/google/api/generator/engine/ast/TryCatchStatementTest.java index 9837c192f5..efa02ee2a8 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/engine/ast/TryCatchStatementTest.java +++ b/gapic-generator-java/src/test/java/com/google/api/generator/engine/ast/TryCatchStatementTest.java @@ -20,12 +20,12 @@ import java.util.Arrays; import java.util.Collections; -import org.junit.Test; +import org.junit.jupiter.api.Test; -public class TryCatchStatementTest { +class TryCatchStatementTest { @Test - public void validTryCatchStatement_simple() { + void validTryCatchStatement_simple() { Reference exceptionReference = ConcreteReference.withClazz(IllegalArgumentException.class); TypeNode type = TypeNode.withReference(exceptionReference); VariableExpr variableExpr = @@ -41,7 +41,7 @@ public void validTryCatchStatement_simple() { } @Test - public void validTryCatchStatement_simpleMultiBlock() { + void validTryCatchStatement_simpleMultiBlock() { VariableExpr firstCatchVarExpr = VariableExpr.builder() .setVariable( @@ -67,7 +67,7 @@ public void validTryCatchStatement_simpleMultiBlock() { } @Test - public void validTryCatchStatement_withResources() { + void validTryCatchStatement_withResources() { Reference exceptionReference = ConcreteReference.withClazz(IllegalArgumentException.class); TypeNode type = TypeNode.withReference(exceptionReference); VariableExpr variableExpr = @@ -85,7 +85,7 @@ public void validTryCatchStatement_withResources() { } @Test - public void validTryCatchStatement_sampleCode() { + void validTryCatchStatement_sampleCode() { TryCatchStatement tryCatch = TryCatchStatement.builder() .setTryBody(Arrays.asList(ExprStatement.withExpr(createAssignmentExpr()))) @@ -95,7 +95,7 @@ public void validTryCatchStatement_sampleCode() { } @Test - public void invalidTryCatchStatement_missingCatchVariable() { + void invalidTryCatchStatement_missingCatchVariable() { assertThrows( IllegalStateException.class, () -> @@ -105,7 +105,7 @@ public void invalidTryCatchStatement_missingCatchVariable() { } @Test - public void invalidTryCatchStatement_catchVariableNotDecl() { + void invalidTryCatchStatement_catchVariableNotDecl() { Reference exceptionReference = ConcreteReference.withClazz(IllegalArgumentException.class); TypeNode type = TypeNode.withReference(exceptionReference); VariableExpr variableExpr = @@ -121,7 +121,7 @@ public void invalidTryCatchStatement_catchVariableNotDecl() { } @Test - public void invalidTryCatchStatement_nonExceptionReference() { + void invalidTryCatchStatement_nonExceptionReference() { Reference exceptionReference = ConcreteReference.withClazz(Integer.class); TypeNode type = TypeNode.withReference(exceptionReference); VariableExpr variableExpr = diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/engine/ast/TypeNodeTest.java b/gapic-generator-java/src/test/java/com/google/api/generator/engine/ast/TypeNodeTest.java index 5b80fdedc0..4977a5b877 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/engine/ast/TypeNodeTest.java +++ b/gapic-generator-java/src/test/java/com/google/api/generator/engine/ast/TypeNodeTest.java @@ -22,9 +22,9 @@ import com.google.api.generator.engine.ast.TypeNode.TypeKind; import java.util.Arrays; import java.util.List; -import org.junit.Test; +import org.junit.jupiter.api.Test; -public class TypeNodeTest { +class TypeNodeTest { private static final TypeNode INT_ARRAY = TypeNode.builder().setTypeKind(TypeKind.INT).setIsArray(true).build(); private static final TypeNode INTEGER_ARRAY = @@ -37,7 +37,7 @@ public class TypeNodeTest { TypeNode.builder().setTypeKind(TypeKind.BOOLEAN).setIsArray(true).build(); @Test - public void strictEquals_basic() { + void strictEquals_basic() { assertFalse(TypeNode.INT.strictEquals(TypeNode.BOOLEAN)); assertFalse(TypeNode.CHAR.strictEquals(TypeNode.NULL)); assertFalse(TypeNode.INT.strictEquals(INT_ARRAY)); @@ -45,7 +45,7 @@ public void strictEquals_basic() { } @Test - public void strictEquals_referenceType() { + void strictEquals_referenceType() { TypeNode list = TypeNode.withReference(ConcreteReference.withClazz(List.class)); TypeNode intList = TypeNode.withReference( @@ -64,7 +64,7 @@ public void strictEquals_referenceType() { } @Test - public void isBoxedTypeEquals_basic() { + void isBoxedTypeEquals_basic() { assertTrue(TypeNode.INT.isBoxedTypeEquals(TypeNode.INT_OBJECT)); assertTrue(TypeNode.DOUBLE_OBJECT.isBoxedTypeEquals(TypeNode.DOUBLE)); assertFalse(TypeNode.BOOLEAN_OBJECT.isBoxedTypeEquals(TypeNode.SHORT)); @@ -73,14 +73,14 @@ public void isBoxedTypeEquals_basic() { } @Test - public void isBoxedTypeEquals_arrayType() { + void isBoxedTypeEquals_arrayType() { assertFalse(TypeNode.INT.isBoxedTypeEquals(INT_ARRAY)); assertFalse(INTEGER_ARRAY.isBoxedTypeEquals(INT_ARRAY)); assertFalse(BOOLEAN_ARRAY.isBoxedTypeEquals(INT_ARRAY)); } @Test - public void equals_basic() { + void equals_basic() { assertTrue(TypeNode.INT.equals(TypeNode.INT_OBJECT)); assertTrue(TypeNode.DOUBLE_OBJECT.equals(TypeNode.DOUBLE)); assertTrue(TypeNode.BOOLEAN.equals(TypeNode.BOOLEAN)); @@ -92,7 +92,7 @@ public void equals_basic() { } @Test - public void type_wildcardGenerics() { + void type_wildcardGenerics() { // No exception thrown equates to success. TypeNode.withReference( ConcreteReference.builder() @@ -102,7 +102,7 @@ public void type_wildcardGenerics() { } @Test - public void type_wildcardUpperBoundGenerics() { + void type_wildcardUpperBoundGenerics() { // No exception thrown equates to success. TypeNode.withReference( ConcreteReference.builder() @@ -114,7 +114,7 @@ public void type_wildcardUpperBoundGenerics() { } @Test - public void compareTypes() { + void compareTypes() { // Primitive and primitive. // Can't compare objects to themselves, so this test is omitted. assertThat(TypeNode.INT.compareTo(TypeNode.BOOLEAN)).isGreaterThan(0); @@ -144,13 +144,13 @@ public void compareTypes() { } @Test - public void invalidType_topLevelWildcard() { + void invalidType_topLevelWildcard() { assertThrows( IllegalStateException.class, () -> TypeNode.withReference(ConcreteReference.wildcard())); } @Test - public void isBoxedType_basic() { + void isBoxedType_basic() { assertTrue(TypeNode.isBoxedType(TypeNode.INT_OBJECT)); assertTrue(TypeNode.isBoxedType(TypeNode.BOOLEAN_OBJECT)); assertTrue(TypeNode.isBoxedType(TypeNode.DOUBLE_OBJECT)); diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/engine/ast/UnaryOperationExprTest.java b/gapic-generator-java/src/test/java/com/google/api/generator/engine/ast/UnaryOperationExprTest.java index b1a45f5312..fc1fecfa2f 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/engine/ast/UnaryOperationExprTest.java +++ b/gapic-generator-java/src/test/java/com/google/api/generator/engine/ast/UnaryOperationExprTest.java @@ -16,12 +16,12 @@ import static org.junit.Assert.assertThrows; -import org.junit.Test; +import org.junit.jupiter.api.Test; -public class UnaryOperationExprTest { +class UnaryOperationExprTest { /** =============================== Logic Not Operation Expr =============================== */ @Test - public void validLogicalNotOperationExpr_basic() { + void validLogicalNotOperationExpr_basic() { VariableExpr variableExpr = VariableExpr.withVariable( Variable.builder().setName("x").setType(TypeNode.BOOLEAN).build()); @@ -30,7 +30,7 @@ public void validLogicalNotOperationExpr_basic() { } @Test - public void validLogicalNot_boxedType() { + void validLogicalNot_boxedType() { VariableExpr variableExpr = VariableExpr.withVariable( Variable.builder().setName("x").setType(TypeNode.BOOLEAN_OBJECT).build()); @@ -39,7 +39,7 @@ public void validLogicalNot_boxedType() { } @Test - public void invalidLogicalNot_numericType() { + void invalidLogicalNot_numericType() { VariableExpr variableExpr = VariableExpr.withVariable(Variable.builder().setName("x").setType(TypeNode.INT).build()); assertThrows( @@ -47,7 +47,7 @@ public void invalidLogicalNot_numericType() { } @Test - public void invalidLogicalNot_referenceType() { + void invalidLogicalNot_referenceType() { VariableExpr variableExpr = VariableExpr.withVariable(Variable.builder().setName("x").setType(TypeNode.STRING).build()); assertThrows( @@ -58,7 +58,7 @@ public void invalidLogicalNot_referenceType() { * =============================== Post Increment Operation Expr =============================== */ @Test - public void validPostIncrement_basic() { + void validPostIncrement_basic() { VariableExpr variableExpr = VariableExpr.withVariable(Variable.builder().setName("x").setType(TypeNode.INT).build()); UnaryOperationExpr.postfixIncrementWithExpr(variableExpr); @@ -66,7 +66,7 @@ public void validPostIncrement_basic() { } @Test - public void validPostIncrement_boxedType() { + void validPostIncrement_boxedType() { VariableExpr variableExpr = VariableExpr.withVariable( Variable.builder().setName("x").setType(TypeNode.FLOAT_OBJECT).build()); @@ -75,7 +75,7 @@ public void validPostIncrement_boxedType() { } @Test - public void invalidPostIncrement_boxedBooleanType() { + void invalidPostIncrement_boxedBooleanType() { VariableExpr variableExpr = VariableExpr.withVariable( Variable.builder().setName("x").setType(TypeNode.BOOLEAN_OBJECT).build()); @@ -85,7 +85,7 @@ public void invalidPostIncrement_boxedBooleanType() { } @Test - public void invalidPostIncrement_referenceType() { + void invalidPostIncrement_referenceType() { VariableExpr variableExpr = VariableExpr.withVariable(Variable.builder().setName("x").setType(TypeNode.STRING).build()); assertThrows( @@ -94,7 +94,7 @@ public void invalidPostIncrement_referenceType() { } @Test - public void invalidPostIncrement_finalVariable() { + void invalidPostIncrement_finalVariable() { Variable variable = Variable.builder().setName("i").setType(TypeNode.INT).build(); VariableExpr variableExpr = VariableExpr.builder().setIsFinal(true).setVariable(variable).build(); @@ -104,7 +104,7 @@ public void invalidPostIncrement_finalVariable() { } @Test - public void invalidPostIncrement_declaredVariable() { + void invalidPostIncrement_declaredVariable() { Variable variable = Variable.builder().setName("i").setType(TypeNode.INT).build(); VariableExpr variableExpr = VariableExpr.builder().setIsDecl(true).setVariable(variable).build(); diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/engine/ast/VaporReferenceTest.java b/gapic-generator-java/src/test/java/com/google/api/generator/engine/ast/VaporReferenceTest.java index 486bc2efab..598a40c087 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/engine/ast/VaporReferenceTest.java +++ b/gapic-generator-java/src/test/java/com/google/api/generator/engine/ast/VaporReferenceTest.java @@ -18,11 +18,11 @@ import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertTrue; -import org.junit.Test; +import org.junit.jupiter.api.Test; -public class VaporReferenceTest { +class VaporReferenceTest { @Test - public void basic() { + void basic() { String pkg = "com.google.example.examples.library.v1"; String name = "Babbage"; Reference ref = VaporReference.builder().setName(name).setPakkage(pkg).build(); @@ -34,7 +34,7 @@ public void basic() { } @Test - public void basic_isStaticImport() { + void basic_isStaticImport() { String pkg = "com.google.example.examples.library.v1"; String name = "Babbage"; Reference ref = @@ -49,7 +49,7 @@ public void basic_isStaticImport() { } @Test - public void basic_nested() { + void basic_nested() { String pkg = "com.google.example.examples.library.v1"; String name = "Charles"; Reference ref = @@ -69,7 +69,7 @@ public void basic_nested() { } @Test - public void basic_nestedAndStaticImport() { + void basic_nestedAndStaticImport() { String pkg = "com.google.example.examples.library.v1"; String name = "Charles"; String enclosingClassName = "Babbage"; @@ -89,7 +89,7 @@ public void basic_nestedAndStaticImport() { } @Test - public void concreteHierarchiesNotHandled() { + void concreteHierarchiesNotHandled() { String pkg = "java.io"; String name = "IOException"; Reference ref = VaporReference.builder().setName(name).setPakkage(pkg).build(); @@ -101,7 +101,7 @@ public void concreteHierarchiesNotHandled() { } @Test - public void enclosingClass() { + void enclosingClass() { String pkg = "java.util"; String enclosingName = "Map"; String name = "Entry"; diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/engine/ast/VariableExprTest.java b/gapic-generator-java/src/test/java/com/google/api/generator/engine/ast/VariableExprTest.java index 43a5fd4f09..08dc046356 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/engine/ast/VariableExprTest.java +++ b/gapic-generator-java/src/test/java/com/google/api/generator/engine/ast/VariableExprTest.java @@ -19,11 +19,11 @@ import java.util.Arrays; import java.util.HashMap; -import org.junit.Test; +import org.junit.jupiter.api.Test; -public class VariableExprTest { +class VariableExprTest { @Test - public void validVariableExpr_basic() { + void validVariableExpr_basic() { Variable variable = Variable.builder().setName("x").setType(TypeNode.INT).build(); VariableExpr variableExpr = VariableExpr.builder().setVariable(variable).build(); assertThat(variableExpr.variable()).isEqualTo(variable); @@ -35,7 +35,7 @@ public void validVariableExpr_basic() { } @Test - public void validVariableExpr_staticReference() { + void validVariableExpr_staticReference() { VariableExpr.builder() .setVariable(Variable.builder().setType(TypeNode.INT).setName("MAX_VALUE").build()) .setStaticReferenceType(TypeNode.INT_OBJECT) @@ -43,7 +43,7 @@ public void validVariableExpr_staticReference() { } @Test - public void validVariableExpr_classFieldOnStaticReference() { + void validVariableExpr_classFieldOnStaticReference() { VariableExpr.builder() .setVariable( Variable.builder() @@ -55,7 +55,7 @@ public void validVariableExpr_classFieldOnStaticReference() { } @Test - public void validVariableExpr_classFieldOnExprReference() { + void validVariableExpr_classFieldOnExprReference() { VariableExpr.builder() .setVariable( Variable.builder() @@ -71,7 +71,7 @@ public void validVariableExpr_classFieldOnExprReference() { } @Test - public void validVariableExpr_withFields() { + void validVariableExpr_withFields() { Variable variable = Variable.builder().setName("x").setType(TypeNode.STRING).build(); VariableExpr variableExpr = VariableExpr.builder() @@ -89,7 +89,7 @@ public void validVariableExpr_withFields() { } @Test - public void validVariableExpr_declaration() { + void validVariableExpr_declaration() { Variable variable = Variable.builder().setName("x").setType(TypeNode.BOOLEAN).build(); VariableExpr variableExpr = VariableExpr.builder().setVariable(variable).setIsDecl(true).build(); @@ -99,7 +99,7 @@ public void validVariableExpr_declaration() { } @Test - public void validVariableExpr_volatileDeclaration() { + void validVariableExpr_volatileDeclaration() { Variable variable = Variable.builder().setName("x").setType(TypeNode.BOOLEAN).build(); VariableExpr variableExpr = VariableExpr.builder() @@ -118,7 +118,7 @@ public void validVariableExpr_volatileDeclaration() { } @Test - public void validVariableExpr_reference() { + void validVariableExpr_reference() { Variable variable = Variable.builder().setName("x").setType(TypeNode.STRING_ARRAY).build(); VariableExpr variableExpr = VariableExpr.builder().setVariable(variable).build(); @@ -128,7 +128,7 @@ public void validVariableExpr_reference() { } @Test - public void validVariableExpr_referenceWithModifiersSet() { + void validVariableExpr_referenceWithModifiersSet() { Variable variable = Variable.builder().setName("x").setType(TypeNode.STRING_ARRAY).build(); VariableExpr variableExpr = VariableExpr.builder().setVariable(variable).build(); @@ -144,7 +144,7 @@ public void validVariableExpr_referenceWithModifiersSet() { } @Test - public void validVariableExpr_templatedArgInMethod() { + void validVariableExpr_templatedArgInMethod() { Variable variable = Variable.builder() .setName("x") @@ -158,7 +158,7 @@ public void validVariableExpr_templatedArgInMethod() { } @Test - public void validVariableExpr_templatedArgNameAndTypeInMethod() { + void validVariableExpr_templatedArgNameAndTypeInMethod() { Variable variable = Variable.builder() .setName("x") @@ -174,7 +174,7 @@ public void validVariableExpr_templatedArgNameAndTypeInMethod() { } @Test - public void validVariableExpr_declarationWithAnnotations() { + void validVariableExpr_declarationWithAnnotations() { Variable variable = Variable.builder().setName("x").setType(TypeNode.BOOLEAN).build(); VariableExpr variableExpr = VariableExpr.builder() @@ -194,7 +194,7 @@ public void validVariableExpr_declarationWithAnnotations() { } @Test - public void invalidVariableExpr_templatedArgInMethodHasNonStringNonTypeNodeObject() { + void invalidVariableExpr_templatedArgInMethodHasNonStringNonTypeNodeObject() { Variable variable = Variable.builder() .setName("x") @@ -210,7 +210,7 @@ public void invalidVariableExpr_templatedArgInMethodHasNonStringNonTypeNodeObjec } @Test - public void invalidVariableExpr_badTemplateName() { + void invalidVariableExpr_badTemplateName() { Variable variable = Variable.builder().setName("x").setType(TypeNode.STRING_ARRAY).build(); assertThrows( IdentifierNode.InvalidIdentifierException.class, @@ -222,7 +222,7 @@ public void invalidVariableExpr_badTemplateName() { } @Test - public void invalidVariableExpr_referencePrimitiveType() { + void invalidVariableExpr_referencePrimitiveType() { Variable variable = Variable.builder().setName("x").setType(TypeNode.INT).build(); VariableExpr variableExpr = VariableExpr.builder().setVariable(variable).build(); @@ -237,7 +237,7 @@ public void invalidVariableExpr_referencePrimitiveType() { } @Test - public void invalidVariableExpr_referenceAndDecl() { + void invalidVariableExpr_referenceAndDecl() { Variable variable = Variable.builder().setName("x").setType(TypeNode.STRING_ARRAY).build(); VariableExpr variableExpr = VariableExpr.builder().setVariable(variable).build(); @@ -253,7 +253,7 @@ public void invalidVariableExpr_referenceAndDecl() { } @Test - public void invalidVariableExpr_exprAndStaticReference() { + void invalidVariableExpr_exprAndStaticReference() { Variable refVariable = Variable.builder().setName("x").setType(TypeNode.STRING_ARRAY).build(); assertThrows( IllegalStateException.class, @@ -266,7 +266,7 @@ public void invalidVariableExpr_exprAndStaticReference() { } @Test - public void invalidVariableExpr_primitiveStaticReference() { + void invalidVariableExpr_primitiveStaticReference() { assertThrows( IllegalStateException.class, () -> @@ -277,7 +277,7 @@ public void invalidVariableExpr_primitiveStaticReference() { } @Test - public void invalidVariableExpr_standaloneClassField() { + void invalidVariableExpr_standaloneClassField() { assertThrows( IllegalStateException.class, () -> @@ -291,7 +291,7 @@ public void invalidVariableExpr_standaloneClassField() { } @Test - public void invalidVariableExpr_classFieldOnPrimitiveType() { + void invalidVariableExpr_classFieldOnPrimitiveType() { assertThrows( IllegalStateException.class, () -> @@ -310,7 +310,7 @@ public void invalidVariableExpr_classFieldOnPrimitiveType() { } @Test - public void invalidVariableExpr_annotationNoDeclaration() { + void invalidVariableExpr_annotationNoDeclaration() { Variable variable = Variable.builder().setName("x").setType(TypeNode.BOOLEAN).build(); VariableExpr.Builder variableExprBuilder = VariableExpr.builder() diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/engine/ast/VariableTest.java b/gapic-generator-java/src/test/java/com/google/api/generator/engine/ast/VariableTest.java index b11cfd0662..50a752f796 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/engine/ast/VariableTest.java +++ b/gapic-generator-java/src/test/java/com/google/api/generator/engine/ast/VariableTest.java @@ -19,11 +19,11 @@ import static org.junit.Assert.assertThrows; import com.google.api.generator.engine.ast.TypeNode.TypeKind; -import org.junit.Test; +import org.junit.jupiter.api.Test; -public class VariableTest { +class VariableTest { @Test - public void createVariable_basic() { + void createVariable_basic() { assertValidVariable(TypeKind.INT, "intVar"); assertValidVariable(TypeKind.BOOLEAN, "boolVar"); assertValidVariable(TypeKind.DOUBLE, "doubleVar"); @@ -33,7 +33,7 @@ public void createVariable_basic() { } @Test - public void createVariable_setIdentifier() { + void createVariable_setIdentifier() { IdentifierNode identifierNode = IdentifierNode.builder().setName("x").build(); Variable variable = Variable.builder() @@ -46,7 +46,7 @@ public void createVariable_setIdentifier() { } @Test - public void createVariable_invalidType() { + void createVariable_invalidType() { assertInvalidVariable(TypeNode.VOID); assertInvalidVariable(TypeNode.NULL); } diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/engine/ast/WhileStatementTest.java b/gapic-generator-java/src/test/java/com/google/api/generator/engine/ast/WhileStatementTest.java index ebaedc31ef..82127968c8 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/engine/ast/WhileStatementTest.java +++ b/gapic-generator-java/src/test/java/com/google/api/generator/engine/ast/WhileStatementTest.java @@ -19,11 +19,11 @@ import java.util.Arrays; import java.util.List; -import org.junit.Test; +import org.junit.jupiter.api.Test; -public class WhileStatementTest { +class WhileStatementTest { @Test - public void validWhileStatement_simple() { + void validWhileStatement_simple() { WhileStatement whileStatement = WhileStatement.builder() .setConditionExpr(createConditionExpr("condition")) @@ -33,7 +33,7 @@ public void validWhileStatement_simple() { } @Test - public void validWhileStatement_booleanObjectCondition() { + void validWhileStatement_booleanObjectCondition() { // The condition expression type can be boolean or its boxed type. VariableExpr condExpr = VariableExpr.withVariable( @@ -47,7 +47,7 @@ public void validWhileStatement_booleanObjectCondition() { } @Test - public void validWhileStatement_nested() { + void validWhileStatement_nested() { WhileStatement nestedWhileStatement = WhileStatement.builder() .setConditionExpr(createConditionExpr("nestedCondition")) @@ -62,7 +62,7 @@ public void validWhileStatement_nested() { } @Test - public void invalidWhileStatement_emptyBody() { + void invalidWhileStatement_emptyBody() { assertThrows( IllegalStateException.class, () -> { diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/engine/lexicon/InvalidSymbolTest.java b/gapic-generator-java/src/test/java/com/google/api/generator/engine/lexicon/InvalidSymbolTest.java index 7fb5b1d5a5..2e940c0cc0 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/engine/lexicon/InvalidSymbolTest.java +++ b/gapic-generator-java/src/test/java/com/google/api/generator/engine/lexicon/InvalidSymbolTest.java @@ -16,12 +16,12 @@ import static com.google.common.truth.Truth.assertThat; -import org.junit.Test; +import org.junit.jupiter.api.Test; -public class InvalidSymbolTest { +class InvalidSymbolTest { @Test - public void invalidSymbolDetected() { + void invalidSymbolDetected() { assertThat(InvalidSymbol.containsInvalidSymbol("foo")).isFalse(); assertThat(InvalidSymbol.containsInvalidSymbol("foo`foo")).isTrue(); diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/engine/lexicon/KeywordTest.java b/gapic-generator-java/src/test/java/com/google/api/generator/engine/lexicon/KeywordTest.java index 17d51461ed..cfda620d60 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/engine/lexicon/KeywordTest.java +++ b/gapic-generator-java/src/test/java/com/google/api/generator/engine/lexicon/KeywordTest.java @@ -16,11 +16,11 @@ import static com.google.common.truth.Truth.assertThat; -import org.junit.Test; +import org.junit.jupiter.api.Test; -public class KeywordTest { +class KeywordTest { @Test - public void keywordDetected() { + void keywordDetected() { // Modifiers. assertThat(Keyword.isKeyword("static")).isTrue(); assertThat(Keyword.isKeyword("private")).isTrue(); @@ -45,4 +45,34 @@ public void keywordDetected() { assertThat(Keyword.isKeyword("class")).isTrue(); assertThat(Keyword.isInvalidFieldName("class")).isFalse(); } + + @Test + void unescapedKeyword_shouldReturnItselfIfEmpty() { + assertThat(Keyword.unescapeKeyword("")).isEqualTo(""); + } + + @Test + void unescapedKeyword_shouldReturnItselfIfDoesNotEndWithEscapeChar() { + assertThat(Keyword.unescapeKeyword("hello")).isEqualTo("hello"); + } + + @Test + void unescapedKeyword_shouldReturnItselfIfEndsWithEscapeCharButNotAKeyword() { + assertThat(Keyword.unescapeKeyword("important_")).isEqualTo("important_"); + } + + @Test + void unescapedKeyword_shouldUnescapeIfEndsWithEscapeCharAndAKeyword() { + assertThat(Keyword.unescapeKeyword("import_")).isEqualTo("import"); + } + + @Test + void escapeKeyword_shouldEscapeIfIsAKeyword() { + assertThat(Keyword.escapeKeyword("final")).isEqualTo("final_"); + } + + @Test + void escapeKeyword_shouldNotEscapeIfIsNotAKeyword() { + assertThat(Keyword.escapeKeyword("fantasy")).isEqualTo("fantasy"); + } } diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/engine/lexicon/LiteralTest.java b/gapic-generator-java/src/test/java/com/google/api/generator/engine/lexicon/LiteralTest.java index 80b155045e..fe4ee22713 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/engine/lexicon/LiteralTest.java +++ b/gapic-generator-java/src/test/java/com/google/api/generator/engine/lexicon/LiteralTest.java @@ -16,17 +16,17 @@ import static com.google.common.truth.Truth.assertThat; -import org.junit.Test; +import org.junit.jupiter.api.Test; -public class LiteralTest { +class LiteralTest { @Test - public void booleanDetected() { + void booleanDetected() { assertThat(Literal.isBooleanLiteral("True")).isFalse(); assertThat(Literal.isBooleanLiteral("true")).isTrue(); } @Test - public void nullLDetected() { + void nullLDetected() { assertThat(Literal.isNullLiteral("NULL")).isFalse(); assertThat(Literal.isNullLiteral("null")).isTrue(); assertThat(Literal.isNullLiteral("null_asdf")).isFalse(); @@ -34,7 +34,7 @@ public void nullLDetected() { } @Test - public void integerDetected() { + void integerDetected() { assertThat(Literal.isIntegerLiteral("a123")).isFalse(); assertThat(Literal.isIntegerLiteral("123")).isTrue(); assertThat(Literal.isIntegerLiteral("-123")).isTrue(); @@ -44,7 +44,7 @@ public void integerDetected() { } @Test - public void longDetected() { + void longDetected() { assertThat(Literal.isLongLiteral("123")).isTrue(); assertThat(Literal.isLongLiteral("123L")).isTrue(); assertThat(Literal.isLongLiteral("123l")).isTrue(); @@ -53,7 +53,7 @@ public void longDetected() { } @Test - public void floatDetected() { + void floatDetected() { assertThat(Literal.isFloatLiteral("123")).isTrue(); assertThat(Literal.isFloatLiteral("123f")).isTrue(); assertThat(Literal.isFloatLiteral("123.")).isFalse(); @@ -68,7 +68,7 @@ public void floatDetected() { } @Test - public void doubleDetected() { + void doubleDetected() { assertThat(Literal.isDoubleLiteral("123")).isTrue(); assertThat(Literal.isDoubleLiteral("0.01")).isTrue(); assertThat(Literal.isDoubleLiteral(".01")).isTrue(); @@ -86,7 +86,7 @@ public void doubleDetected() { } @Test - public void literalDetected() { + void literalDetected() { assertThat(Literal.isLiteral("False")).isFalse(); assertThat(Literal.isLiteral("asdf")).isFalse(); assertThat(Literal.isLiteral("asdf12345")).isFalse(); diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/engine/lexicon/OperatorTest.java b/gapic-generator-java/src/test/java/com/google/api/generator/engine/lexicon/OperatorTest.java index 4e89227519..dfcdc5e3fe 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/engine/lexicon/OperatorTest.java +++ b/gapic-generator-java/src/test/java/com/google/api/generator/engine/lexicon/OperatorTest.java @@ -16,12 +16,12 @@ import static com.google.common.truth.Truth.assertThat; -import org.junit.Test; +import org.junit.jupiter.api.Test; -public class OperatorTest { +class OperatorTest { @Test - public void operatorsDetected() { + void operatorsDetected() { assertThat(Operator.containsOperator("foo")).isFalse(); assertThat(Operator.containsOperator("foo+foo")).isTrue(); diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/engine/lexicon/SeparatorTest.java b/gapic-generator-java/src/test/java/com/google/api/generator/engine/lexicon/SeparatorTest.java index 81f6c93f13..96e5bddd7d 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/engine/lexicon/SeparatorTest.java +++ b/gapic-generator-java/src/test/java/com/google/api/generator/engine/lexicon/SeparatorTest.java @@ -16,11 +16,11 @@ import static com.google.common.truth.Truth.assertThat; -import org.junit.Test; +import org.junit.jupiter.api.Test; -public class SeparatorTest { +class SeparatorTest { @Test - public void separatorTest() { + void separatorTest() { assertThat(Separator.containsSeparator("foo")).isFalse(); assertThat(Separator.containsSeparator("foo.foo")).isTrue(); diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/engine/writer/ImportWriterVisitorTest.java b/gapic-generator-java/src/test/java/com/google/api/generator/engine/writer/ImportWriterVisitorTest.java index 865f505a62..08d00af14d 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/engine/writer/ImportWriterVisitorTest.java +++ b/gapic-generator-java/src/test/java/com/google/api/generator/engine/writer/ImportWriterVisitorTest.java @@ -55,13 +55,15 @@ import com.google.api.generator.engine.ast.VaporReference; import com.google.api.generator.engine.ast.Variable; import com.google.api.generator.engine.ast.VariableExpr; -import com.google.api.generator.testutils.LineFormatter; +import com.google.api.generator.test.utils.LineFormatter; import com.google.common.base.Function; import com.google.common.base.Strings; +import com.google.testgapic.v1beta1.Outer; import java.io.File; import java.io.FileNotFoundException; import java.io.FileOutputStream; import java.io.IOException; +import java.lang.annotation.Repeatable; import java.util.ArrayList; import java.util.Arrays; import java.util.HashMap; @@ -69,22 +71,22 @@ import java.util.Map; import java.util.stream.LongStream; import javax.annotation.Generated; -import org.junit.Before; -import org.junit.Test; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; -public class ImportWriterVisitorTest { +class ImportWriterVisitorTest { private static final String CURRENT_PACKAGE = "com.google.api.generator.engine.foobar"; private static final String CURRENT_CLASS = "SomeClass"; private ImportWriterVisitor writerVisitor; - @Before - public void setUp() { + @BeforeEach + void setUp() { writerVisitor = new ImportWriterVisitor(); writerVisitor.initialize(CURRENT_PACKAGE, CURRENT_CLASS); } @Test - public void writeReferenceTypeImports_basic() { + void writeReferenceTypeImports_basic() { TypeNode.withReference(ConcreteReference.withClazz(List.class)).accept(writerVisitor); assertEquals("import java.util.List;\n\n", writerVisitor.write()); @@ -96,7 +98,7 @@ public void writeReferenceTypeImports_basic() { } @Test - public void writeReferenceTypeImports_useFullName() { + void writeReferenceTypeImports_useFullName() { TypeNode.withReference( ConcreteReference.builder().setClazz(List.class).setUseFullName(true).build()) .accept(writerVisitor); @@ -114,7 +116,7 @@ public void writeReferenceTypeImports_useFullName() { } @Test - public void writeNewObjectExprImports_basic() { + void writeNewObjectExprImports_basic() { // [Constructing] `new ArrayList<>()` NewObjectExpr newObjectExpr = NewObjectExpr.builder() @@ -126,7 +128,7 @@ public void writeNewObjectExprImports_basic() { } @Test - public void writeNewObjectExprImports_withArgs() { + void writeNewObjectExprImports_withArgs() { // [Constructing] `new FileOutputStream(File file)` and the argument needs to be imported. ConcreteReference fileOutputStreamRef = ConcreteReference.withClazz(FileOutputStream.class); ConcreteReference fileRef = ConcreteReference.withClazz(File.class); @@ -145,7 +147,7 @@ public void writeNewObjectExprImports_withArgs() { } @Test - public void writeNewObjectExprImports_genericsAndVariableArgs() { + void writeNewObjectExprImports_genericsAndVariableArgs() { // [Constructing] `new HashMap, Integer>>(int initialCapacity, float loadFactor)` ConcreteReference listRef = ConcreteReference.builder() @@ -177,7 +179,7 @@ public void writeNewObjectExprImports_genericsAndVariableArgs() { } @Test - public void writeNewObjectExprImports_methodExprArg() { + void writeNewObjectExprImports_methodExprArg() { // [Constructing] `new IOException(message, cause(mapArg))` and `cause(mapArg)` is a method // invocation with a `HashMap` argument. TypeNode exceptionType = TypeNode.withReference(ConcreteReference.withClazz(IOException.class)); @@ -206,7 +208,7 @@ public void writeNewObjectExprImports_methodExprArg() { } @Test - public void writeTernaryExprImports() { + void writeTernaryExprImports() { MethodInvocationExpr conditionExpr = MethodInvocationExpr.builder() .setStaticReferenceType(TypeNode.withReference(ConcreteReference.withClazz(Expr.class))) @@ -244,7 +246,7 @@ public void writeTernaryExprImports() { } @Test - public void writeVariableExprImports_staticReference() { + void writeVariableExprImports_staticReference() { VariableExpr variableExpr = VariableExpr.builder() .setVariable( @@ -266,7 +268,7 @@ public void writeVariableExprImports_staticReference() { } @Test - public void writeVariableExprImports_wildcardType() { + void writeVariableExprImports_wildcardType() { TypeNode wildcardListType = TypeNode.withReference( ConcreteReference.builder() @@ -284,7 +286,7 @@ public void writeVariableExprImports_wildcardType() { } @Test - public void writeVariableExprImport_wildcardTypeWithUpperBound() { + void writeVariableExprImport_wildcardTypeWithUpperBound() { TypeNode wildcardListType = TypeNode.withReference( ConcreteReference.builder() @@ -308,7 +310,7 @@ public void writeVariableExprImport_wildcardTypeWithUpperBound() { } @Test - public void writeVariableExprImports_reference() { + void writeVariableExprImports_reference() { Variable variable = Variable.builder() .setName("expr") @@ -332,7 +334,7 @@ public void writeVariableExprImports_reference() { } @Test - public void writeVariableExprImports_nestedReference() { + void writeVariableExprImports_nestedReference() { Variable variable = Variable.builder() .setName("expr") @@ -365,7 +367,7 @@ public void writeVariableExprImports_nestedReference() { } @Test - public void writeVariableExprImports_withAnnotations() { + void writeVariableExprImports_withAnnotations() { Variable variable = Variable.builder() .setName("expr") @@ -391,7 +393,65 @@ public void writeVariableExprImports_withAnnotations() { } @Test - public void writeAnonymousClassExprImports() { + void writeVariableExprImports_annotationsWithDescription() { + Variable variable = + Variable.builder() + .setName("expr") + .setType(TypeNode.withReference(ConcreteReference.withClazz(Expr.class))) + .build(); + + VariableExpr annotationDescription = + VariableExpr.builder() + .setVariable(Variable.builder().setType(TypeNode.CLASS_OBJECT).setName("class").build()) + .setStaticReferenceType(TypeNode.withReference(ConcreteReference.withClazz(List.class))) + .build(); + + // Constructs with annotation @Repeatable(List.class) + VariableExpr variableExpr = + VariableExpr.builder() + .setVariable(variable) + .setIsDecl(true) + .setAnnotations( + Arrays.asList( + AnnotationNode.builder() + .setType( + TypeNode.withReference(ConcreteReference.withClazz(Repeatable.class))) + .setDescription(annotationDescription) + .build())) + .build(); + + variableExpr.accept(writerVisitor); + assertEquals( + LineFormatter.lines( + "import com.google.api.generator.engine.ast.Expr;\n", + "import java.lang.annotation.Repeatable;\n", + "import java.util.List;\n\n"), + writerVisitor.write()); + } + + @Test + void writeVaporReferenceImport_outermostForNestedClass() { + VaporReference nestedVaporReference = + VaporReference.builder() + .setName("Inner") + .setEnclosingClassNames(Arrays.asList("Outer", "Middle")) + .setPakkage("com.google.testgapic.v1beta1") + .build(); + + TypeNode.withReference(nestedVaporReference).accept(writerVisitor); + assertEquals("import com.google.testgapic.v1beta1.Outer;\n\n", writerVisitor.write()); + } + + @Test + void writeConcreteReferenceImport_outermostForNestedClass() { + ConcreteReference nestedConcreteReference = + ConcreteReference.withClazz(Outer.Middle.Inner.class); + TypeNode.withReference(nestedConcreteReference).accept(writerVisitor); + assertEquals("import com.google.testgapic.v1beta1.Outer;\n\n", writerVisitor.write()); + } + + @Test + void writeAnonymousClassExprImports() { // [Constructing] Function, MethodDefinition> ConcreteReference exceptionListRef = ConcreteReference.builder() @@ -466,7 +526,7 @@ public void writeAnonymousClassExprImports() { } @Test - public void writeThrowExprImports_basic() { + void writeThrowExprImports_basic() { TypeNode exceptionTypes = TypeNode.withReference(ConcreteReference.withClazz(IOException.class)); String message = "Some message asdf"; @@ -477,7 +537,7 @@ public void writeThrowExprImports_basic() { } @Test - public void writeThrowExprImports_throwExpr() { + void writeThrowExprImports_throwExpr() { Expr exprToThrow = MethodInvocationExpr.builder() .setStaticReferenceType( @@ -497,7 +557,7 @@ public void writeThrowExprImports_throwExpr() { } @Test - public void writeThrowExprImports_messageExpr() { + void writeThrowExprImports_messageExpr() { TypeNode npeType = TypeNode.withExceptionClazz(NullPointerException.class); Expr messageExpr = MethodInvocationExpr.builder() @@ -524,7 +584,7 @@ public void writeThrowExprImports_messageExpr() { } @Test - public void writeThrowExprImports_messageAndCauseExpr() { + void writeThrowExprImports_messageAndCauseExpr() { TypeNode npeType = TypeNode.withExceptionClazz(NullPointerException.class); Expr messageExpr = MethodInvocationExpr.builder() @@ -560,7 +620,7 @@ public void writeThrowExprImports_messageAndCauseExpr() { } @Test - public void writeInstanceofExprImports_basic() { + void writeInstanceofExprImports_basic() { TypeNode exprType = TypeNode.withReference(ConcreteReference.withClazz(Expr.class)); TypeNode assignExprType = TypeNode.withReference(ConcreteReference.withClazz(AssignmentExpr.class)); @@ -579,7 +639,7 @@ public void writeInstanceofExprImports_basic() { } @Test - public void writeEnumRefExprImports_basic() { + void writeEnumRefExprImports_basic() { TypeNode enumType = TypeNode.withReference( ConcreteReference.builder() @@ -595,7 +655,7 @@ public void writeEnumRefExprImports_basic() { } @Test - public void writeEnumRefExprImports_nested() { + void writeEnumRefExprImports_nested() { TypeNode enumType = TypeNode.withReference(ConcreteReference.withClazz(TypeNode.TypeKind.class)); EnumRefExpr enumRefExpr = EnumRefExpr.builder().setName("VOID").setType(enumType).build(); @@ -604,7 +664,7 @@ public void writeEnumRefExprImports_nested() { } @Test - public void writeReturnExprImports_basic() { + void writeReturnExprImports_basic() { ReturnExpr returnExpr = ReturnExpr.withExpr( MethodInvocationExpr.builder() @@ -616,7 +676,7 @@ public void writeReturnExprImports_basic() { } @Test - public void writeMethodDefinitionImports_templatedMixedNamesAndTypes() { + void writeMethodDefinitionImports_templatedMixedNamesAndTypes() { Reference mapRef = ConcreteReference.withClazz(Map.class); List arguments = Arrays.asList( @@ -658,7 +718,7 @@ public void writeMethodDefinitionImports_templatedMixedNamesAndTypes() { } @Test - public void writeReferenceConstructorExprImports_basic() { + void writeReferenceConstructorExprImports_basic() { VaporReference ref = VaporReference.builder().setName("Parent").setPakkage("com.google.example.v1").build(); TypeNode classType = TypeNode.withReference(ref); @@ -669,7 +729,7 @@ public void writeReferenceConstructorExprImports_basic() { } @Test - public void writeReferenceConstructorExprImports_withArgs() { + void writeReferenceConstructorExprImports_withArgs() { VaporReference ref = VaporReference.builder().setName("Student").setPakkage("com.google.example.v1").build(); TypeNode classType = TypeNode.withReference(ref); @@ -689,7 +749,7 @@ public void writeReferenceConstructorExprImports_withArgs() { } @Test - public void writeArithmeticOperationExprImports() { + void writeArithmeticOperationExprImports() { MethodInvocationExpr lhsExpr = MethodInvocationExpr.builder() .setStaticReferenceType(TypeNode.withReference(ConcreteReference.withClazz(Expr.class))) @@ -704,7 +764,7 @@ public void writeArithmeticOperationExprImports() { } @Test - public void writeSynchronizedStatementImports_basicThis() { + void writeSynchronizedStatementImports_basicThis() { SynchronizedStatement synchronizedStatement = SynchronizedStatement.builder() .setLock( @@ -726,7 +786,7 @@ public void writeSynchronizedStatementImports_basicThis() { } @Test - public void writeSuperObjectValueImports() { + void writeSuperObjectValueImports() { VaporReference ref = VaporReference.builder() .setName("Student") @@ -745,7 +805,7 @@ public void writeSuperObjectValueImports() { } @Test - public void writeSynchronizedStatementImports_basicVariableExpr() { + void writeSynchronizedStatementImports_basicVariableExpr() { VariableExpr strVarExpr = VariableExpr.withVariable( Variable.builder() @@ -773,7 +833,7 @@ public void writeSynchronizedStatementImports_basicVariableExpr() { } @Test - public void writeUnaryOperationExprImports_LogicalNot() { + void writeUnaryOperationExprImports_LogicalNot() { MethodInvocationExpr expr = MethodInvocationExpr.builder() .setStaticReferenceType(TypeNode.withReference(ConcreteReference.withClazz(Expr.class))) @@ -786,7 +846,7 @@ public void writeUnaryOperationExprImports_LogicalNot() { } @Test - public void writeUnaryOperationExprImports_PostIncrement() { + void writeUnaryOperationExprImports_PostIncrement() { MethodInvocationExpr expr = MethodInvocationExpr.builder() .setStaticReferenceType(TypeNode.withReference(ConcreteReference.withClazz(Expr.class))) @@ -799,7 +859,7 @@ public void writeUnaryOperationExprImports_PostIncrement() { } @Test - public void writeRelationalOperationExprImports() { + void writeRelationalOperationExprImports() { MethodInvocationExpr lhsExpr = MethodInvocationExpr.builder() .setStaticReferenceType(TypeNode.withReference(ConcreteReference.withClazz(Expr.class))) @@ -829,7 +889,7 @@ public void writeRelationalOperationExprImports() { } @Test - public void writeLogicalOperationExprImports() { + void writeLogicalOperationExprImports() { MethodInvocationExpr lhsExpr = MethodInvocationExpr.builder() .setStaticReferenceType( @@ -848,14 +908,14 @@ public void writeLogicalOperationExprImports() { } @Test - public void writeEmptyLineStatementImports() { + void writeEmptyLineStatementImports() { EmptyLineStatement statement = EmptyLineStatement.create(); statement.accept(writerVisitor); assertThat(writerVisitor.write()).isEmpty(); } @Test - public void writePackageInfoDefinitionImports() { + void writePackageInfoDefinitionImports() { PackageInfoDefinition packageInfo = PackageInfoDefinition.builder() .setPakkage("com.google.example.library.v1") @@ -875,7 +935,7 @@ public void writePackageInfoDefinitionImports() { } @Test - public void writeLambdaExprImports() { + void writeLambdaExprImports() { // Similar to method defnitions. Reference mapRef = ConcreteReference.withClazz(Map.class); List arguments = @@ -921,7 +981,7 @@ public void writeLambdaExprImports() { } @Test - public void importArrayExprTypes() { + void importArrayExprTypes() { ArrayExpr arrayExpr = ArrayExpr.builder() .setType( diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/engine/writer/JavaWriterVisitorTest.java b/gapic-generator-java/src/test/java/com/google/api/generator/engine/writer/JavaWriterVisitorTest.java index 9852b44a65..d9a38d8d7f 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/engine/writer/JavaWriterVisitorTest.java +++ b/gapic-generator-java/src/test/java/com/google/api/generator/engine/writer/JavaWriterVisitorTest.java @@ -71,9 +71,17 @@ import com.google.api.generator.engine.ast.Variable; import com.google.api.generator.engine.ast.VariableExpr; import com.google.api.generator.engine.ast.WhileStatement; -import com.google.api.generator.testutils.LineFormatter; -import com.google.api.generator.util.TestUtils; +import com.google.api.generator.engine.writer.JavaFormatter.FormatException; +import com.google.api.generator.gapic.composer.grpc.ServiceClientClassComposer; +import com.google.api.generator.gapic.model.GapicClass; +import com.google.api.generator.gapic.model.GapicContext; +import com.google.api.generator.gapic.model.Service; +import com.google.api.generator.test.framework.Assert; +import com.google.api.generator.test.protoloader.TestProtoLoader; +import com.google.api.generator.test.utils.LineFormatter; +import com.google.api.generator.test.utils.TestExprBuilder; import com.google.common.base.Function; +import com.google.testgapic.v1beta1.Outer; import java.io.IOException; import java.util.Arrays; import java.util.Collections; @@ -82,26 +90,26 @@ import java.util.Map; import java.util.concurrent.TimeoutException; import javax.annotation.Generated; -import org.junit.Before; -import org.junit.Test; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; -public class JavaWriterVisitorTest { +class JavaWriterVisitorTest { private JavaWriterVisitor writerVisitor; - @Before - public void setUp() { + @BeforeEach + void setUp() { writerVisitor = new JavaWriterVisitor(); } @Test - public void writeIdentifier() { + void writeIdentifier() { String idName = "foobar"; IdentifierNode.builder().setName(idName).build().accept(writerVisitor); assertEquals(idName, writerVisitor.write()); } @Test - public void writePrimitiveType() { + void writePrimitiveType() { TypeNode intType = TypeNode.INT; assertThat(intType).isNotNull(); intType.accept(writerVisitor); @@ -109,7 +117,7 @@ public void writePrimitiveType() { } @Test - public void writePrimitiveArrayType() { + void writePrimitiveArrayType() { TypeNode byteArrayType = TypeNode.builder().setTypeKind(TypeNode.TypeKind.BYTE).setIsArray(true).build(); assertThat(byteArrayType).isNotNull(); @@ -118,7 +126,7 @@ public void writePrimitiveArrayType() { } @Test - public void writeReferenceType_basic() { + void writeReferenceType_basic() { TypeNode.withReference(ConcreteReference.withClazz(List.class)).accept(writerVisitor); assertEquals("List", writerVisitor.write()); @@ -130,7 +138,27 @@ public void writeReferenceType_basic() { } @Test - public void writeReferenceType_useFullName() { + void writeVaporReferenceType_nestedClasses() { + VaporReference nestedVaporReference = + VaporReference.builder() + .setName("Inner") + .setEnclosingClassNames(Arrays.asList("Outer", "Middle")) + .setPakkage("com.google.testgapic.v1beta1") + .build(); + TypeNode.withReference(nestedVaporReference).accept(writerVisitor); + assertEquals("Outer.Middle.Inner", writerVisitor.write()); + } + + @Test + void writeConcreteReferenceType_nestedClasses() { + ConcreteReference nestedConcreteReference = + ConcreteReference.withClazz(Outer.Middle.Inner.class); + TypeNode.withReference(nestedConcreteReference).accept(writerVisitor); + assertEquals("Outer.Middle.Inner", writerVisitor.write()); + } + + @Test + void writeReferenceType_useFullName() { TypeNode.withReference( ConcreteReference.builder().setClazz(List.class).setUseFullName(true).build()) .accept(writerVisitor); @@ -148,21 +176,21 @@ public void writeReferenceType_useFullName() { } @Test - public void writeAnnotation_simple() { + void writeAnnotation_simple() { AnnotationNode annotation = AnnotationNode.OVERRIDE; annotation.accept(writerVisitor); assertEquals("@Override\n", writerVisitor.write()); } @Test - public void writeAnnotation_withStringDescription() { + void writeAnnotation_withStringDescription() { AnnotationNode annotation = AnnotationNode.withSuppressWarnings("all"); annotation.accept(writerVisitor); assertEquals("@SuppressWarnings(\"all\")\n", writerVisitor.write()); } @Test - public void writeAnnotation_withValueDescription() { + void writeAnnotation_withValueDescription() { TypeNode fakeAnnotationType = TypeNode.withReference( VaporReference.builder().setName("FakeAnnotation").setPakkage("com.foo.bar").build()); @@ -178,7 +206,7 @@ public void writeAnnotation_withValueDescription() { } @Test - public void writeAnnotation_withVariableExprDescription() { + void writeAnnotation_withVariableExprDescription() { TypeNode conditionalOnPropertyType = TypeNode.withReference( VaporReference.builder() @@ -207,7 +235,7 @@ public void writeAnnotation_withVariableExprDescription() { } @Test - public void writeAnnotation_withMultipleNamedDescriptions() { + void writeAnnotation_withMultipleNamedDescriptions() { TypeNode conditionalOnPropertyType = TypeNode.withReference( VaporReference.builder() @@ -246,7 +274,7 @@ public void writeAnnotation_withMultipleNamedDescriptions() { } @Test - public void writeAnnotation_withInvalidDescriptions() { + void writeAnnotation_withInvalidDescriptions() { TypeNode fakeAnnotationType = TypeNode.withReference( VaporReference.builder().setName("FakeAnnotation").setPakkage("com.foo.bar").build()); @@ -311,7 +339,7 @@ public void writeAnnotation_withInvalidDescriptions() { } @Test - public void writeAnnotation_withArrayExpr() { + void writeAnnotation_withArrayExpr() { TypeNode fakeAnnotationType = TypeNode.withReference( VaporReference.builder().setName("FakeAnnotation").setPakkage("com.foo.bar").build()); @@ -321,8 +349,8 @@ public void writeAnnotation_withArrayExpr() { .setDescription( ArrayExpr.builder() .setType(TypeNode.createArrayTypeOf(TypeNode.CLASS_OBJECT)) - .addExpr(TestUtils.generateClassValueExpr("Class1")) - .addExpr(TestUtils.generateClassValueExpr("Class2")) + .addExpr(TestExprBuilder.generateClassValueExpr("Class1")) + .addExpr(TestExprBuilder.generateClassValueExpr("Class2")) .build()) .build(); annotation.accept(writerVisitor); @@ -330,15 +358,15 @@ public void writeAnnotation_withArrayExpr() { } @Test - public void writeAnnotation_withArrayExprAssignment() { + void writeAnnotation_withArrayExprAssignment() { TypeNode fakeAnnotationType = TypeNode.withReference( VaporReference.builder().setName("FakeAnnotation").setPakkage("com.foo.bar").build()); ArrayExpr arrayExpr = ArrayExpr.builder() .setType(TypeNode.createArrayTypeOf(TypeNode.CLASS_OBJECT)) - .addExpr(TestUtils.generateClassValueExpr("Class1")) - .addExpr(TestUtils.generateClassValueExpr("Class2")) + .addExpr(TestExprBuilder.generateClassValueExpr("Class1")) + .addExpr(TestExprBuilder.generateClassValueExpr("Class2")) .build(); AssignmentExpr clazz1AssignExpr = AssignmentExpr.builder() @@ -376,7 +404,7 @@ public void writeAnnotation_withArrayExprAssignment() { } @Test - public void writeArrayExpr_add1StringExpr() { + void writeArrayExpr_add1StringExpr() { ArrayExpr expr = ArrayExpr.builder() .setType(TypeNode.createArrayTypeOf(TypeNode.STRING)) @@ -387,33 +415,33 @@ public void writeArrayExpr_add1StringExpr() { } @Test - public void writeArrayExpr_addManyStrExpr() { + void writeArrayExpr_addManyStrExpr() { ArrayExpr expr = ArrayExpr.builder() .setType(TypeNode.createArrayTypeOf(TypeNode.STRING)) - .addExpr(TestUtils.generateStringValueExpr("test1")) - .addExpr(TestUtils.generateStringValueExpr("test2")) - .addExpr(TestUtils.generateStringValueExpr("test3")) + .addExpr(TestExprBuilder.generateStringValueExpr("test1")) + .addExpr(TestExprBuilder.generateStringValueExpr("test2")) + .addExpr(TestExprBuilder.generateStringValueExpr("test3")) .build(); expr.accept(writerVisitor); assertEquals("{\"test1\", \"test2\", \"test3\"}", writerVisitor.write()); } @Test - public void writeArrayExpr_addManyClassExpr() { + void writeArrayExpr_addManyClassExpr() { ArrayExpr expr = ArrayExpr.builder() .setType(TypeNode.createArrayTypeOf(TypeNode.CLASS_OBJECT)) - .addExpr(TestUtils.generateClassValueExpr("Class1")) - .addExpr(TestUtils.generateClassValueExpr("Class2")) - .addExpr(TestUtils.generateClassValueExpr("Class3")) + .addExpr(TestExprBuilder.generateClassValueExpr("Class1")) + .addExpr(TestExprBuilder.generateClassValueExpr("Class2")) + .addExpr(TestExprBuilder.generateClassValueExpr("Class3")) .build(); expr.accept(writerVisitor); assertEquals("{Class1.class, Class2.class, Class3.class}", writerVisitor.write()); } @Test - public void writeArrayExpr_mixedVariablesStaticAndNormalReference() { + void writeArrayExpr_mixedVariablesStaticAndNormalReference() { VariableExpr clazzVar = VariableExpr.builder() .setVariable( @@ -423,14 +451,14 @@ public void writeArrayExpr_mixedVariablesStaticAndNormalReference() { ArrayExpr.builder() .setType(TypeNode.createArrayTypeOf(TypeNode.CLASS_OBJECT)) .addExpr(clazzVar) - .addExpr(TestUtils.generateClassValueExpr("Class2")) + .addExpr(TestExprBuilder.generateClassValueExpr("Class2")) .build(); expr.accept(writerVisitor); assertEquals("{clazz1Var, Class2.class}", writerVisitor.write()); } @Test - public void writeArrayExpr_assignemntWithDeclaration() { + void writeArrayExpr_assignemntWithDeclaration() { VariableExpr varExpr = VariableExpr.builder() .setVariable( @@ -443,8 +471,8 @@ public void writeArrayExpr_assignemntWithDeclaration() { ArrayExpr expr = ArrayExpr.builder() .setType(TypeNode.createArrayTypeOf(TypeNode.STRING)) - .addExpr(TestUtils.generateStringValueExpr("str1")) - .addExpr(TestUtils.generateStringValueExpr("str2")) + .addExpr(TestExprBuilder.generateStringValueExpr("str1")) + .addExpr(TestExprBuilder.generateStringValueExpr("str2")) .build(); AssignmentExpr assignmentExpr = AssignmentExpr.builder().setVariableExpr(varExpr).setValueExpr(expr).build(); @@ -453,7 +481,7 @@ public void writeArrayExpr_assignemntWithDeclaration() { } @Test - public void writeNewObjectExpr_basic() { + void writeNewObjectExpr_basic() { // isGeneric() is true, but generics() is empty. ConcreteReference ref = ConcreteReference.withClazz(List.class); TypeNode type = TypeNode.withReference(ref); @@ -463,7 +491,7 @@ public void writeNewObjectExpr_basic() { } @Test - public void writeNewObjectExpr_withMethodExprArgs() { + void writeNewObjectExpr_withMethodExprArgs() { // isGeneric() is false, and generics() is empty. // [Constructing] `new IOException(message, cause())` and `cause()` is a method invocation. TypeNode type = TypeNode.withReference(ConcreteReference.withClazz(IOException.class)); @@ -484,7 +512,7 @@ public void writeNewObjectExpr_withMethodExprArgs() { } @Test - public void writeNewObjectExpr_withGenericsAndArgs() { + void writeNewObjectExpr_withGenericsAndArgs() { // isGeneric() is true and generics() is not empty. ConcreteReference listRef = ConcreteReference.builder() @@ -525,7 +553,7 @@ public void writeNewObjectExpr_withGenericsAndArgs() { /** =============================== EXPRESSIONS =============================== */ @Test - public void writeValueExpr() { + void writeValueExpr() { Value value = PrimitiveValue.builder().setType(TypeNode.INT).setValue("3").build(); ValueExpr valueExpr = ValueExpr.builder().setValue(value).build(); valueExpr.accept(writerVisitor); @@ -533,7 +561,7 @@ public void writeValueExpr() { } @Test - public void writeVariableExpr_basic() { + void writeVariableExpr_basic() { Variable variable = Variable.builder().setName("x").setType(TypeNode.INT).build(); VariableExpr variableExpr = VariableExpr.builder().setVariable(variable).build(); @@ -542,7 +570,7 @@ public void writeVariableExpr_basic() { } @Test - public void writeVariableExpr_wildcardType() { + void writeVariableExpr_wildcardType() { TypeNode wildcardListType = TypeNode.withReference( ConcreteReference.builder() @@ -559,7 +587,7 @@ public void writeVariableExpr_wildcardType() { } @Test - public void writeVariableExpr_wildcardTypeWithUpperBound() { + void writeVariableExpr_wildcardTypeWithUpperBound() { TypeNode wildcardListType = TypeNode.withReference( ConcreteReference.builder() @@ -579,7 +607,7 @@ public void writeVariableExpr_wildcardTypeWithUpperBound() { } @Test - public void writeVariableExpr_staticReference() { + void writeVariableExpr_staticReference() { VariableExpr variableExpr = VariableExpr.builder() .setVariable( @@ -592,7 +620,7 @@ public void writeVariableExpr_staticReference() { } @Test - public void writeVariableExpr_nonDeclIgnoresModifiers() { + void writeVariableExpr_nonDeclIgnoresModifiers() { Variable variable = Variable.builder().setName("x").setType(TypeNode.BOOLEAN).build(); VariableExpr expr = VariableExpr.builder() @@ -607,7 +635,7 @@ public void writeVariableExpr_nonDeclIgnoresModifiers() { } @Test - public void writeVariableExpr_basicLocalDecl() { + void writeVariableExpr_basicLocalDecl() { Variable variable = Variable.builder().setName("x").setType(TypeNode.INT).build(); VariableExpr expr = VariableExpr.builder().setVariable(variable).setIsDecl(true).build(); @@ -616,7 +644,7 @@ public void writeVariableExpr_basicLocalDecl() { } @Test - public void writeVariableExpr_localFinalDecl() { + void writeVariableExpr_localFinalDecl() { Variable variable = Variable.builder().setName("x").setType(TypeNode.BOOLEAN).build(); VariableExpr expr = @@ -627,7 +655,7 @@ public void writeVariableExpr_localFinalDecl() { } @Test - public void writeVariableExpr_scopedDecl() { + void writeVariableExpr_scopedDecl() { Variable variable = Variable.builder().setName("x").setType(TypeNode.INT).build(); VariableExpr expr = VariableExpr.builder() @@ -641,7 +669,7 @@ public void writeVariableExpr_scopedDecl() { } @Test - public void writeVariableExpr_scopedStaticFinalDecl() { + void writeVariableExpr_scopedStaticFinalDecl() { Variable variable = Variable.builder().setName("x").setType(TypeNode.BOOLEAN).build(); VariableExpr expr = VariableExpr.builder() @@ -657,7 +685,7 @@ public void writeVariableExpr_scopedStaticFinalDecl() { } @Test - public void writeVariableExpr_scopedStaticFinalVolatileDecl() { + void writeVariableExpr_scopedStaticFinalVolatileDecl() { Variable variable = Variable.builder().setName("x").setType(TypeNode.BOOLEAN).build(); VariableExpr expr = VariableExpr.builder() @@ -674,7 +702,7 @@ public void writeVariableExpr_scopedStaticFinalVolatileDecl() { } @Test - public void writeVariableExpr_basicReference() { + void writeVariableExpr_basicReference() { Variable variable = Variable.builder().setName("x").setType(TypeNode.STRING_ARRAY).build(); VariableExpr variableExpr = VariableExpr.builder().setVariable(variable).build(); @@ -686,7 +714,7 @@ public void writeVariableExpr_basicReference() { } @Test - public void writeVariableExpr_basicReferenceWithModifiersSet() { + void writeVariableExpr_basicReferenceWithModifiersSet() { Variable variable = Variable.builder().setName("x").setType(TypeNode.STRING_ARRAY).build(); VariableExpr variableExpr = VariableExpr.builder().setVariable(variable).build(); @@ -704,7 +732,7 @@ public void writeVariableExpr_basicReferenceWithModifiersSet() { } @Test - public void writeVariableExpr_nestedReference() { + void writeVariableExpr_nestedReference() { Variable variable = Variable.builder().setName("x").setType(TypeNode.STRING_ARRAY).build(); VariableExpr variableExpr = VariableExpr.builder().setVariable(variable).build(); @@ -723,7 +751,7 @@ public void writeVariableExpr_nestedReference() { } @Test - public void writeArithmeticOperationExpr_concatStringWithMethod() { + void writeArithmeticOperationExpr_concatStringWithMethod() { ValueExpr lhsExpr = ValueExpr.withValue(StringObjectValue.withValue("someWord")); MethodInvocationExpr methodInvocationExpr = MethodInvocationExpr.builder().setMethodName("getMethod").build(); @@ -740,7 +768,7 @@ public void writeArithmeticOperationExpr_concatStringWithMethod() { } @Test - public void writeArithmeticOperationExpr_concatStringWithNumber() { + void writeArithmeticOperationExpr_concatStringWithNumber() { ValueExpr rhsExpr = ValueExpr.withValue(PrimitiveValue.builder().setType(TypeNode.INT).setValue("5").build()); ValueExpr lhsExpr = ValueExpr.withValue(StringObjectValue.withValue("someWord")); @@ -752,7 +780,7 @@ public void writeArithmeticOperationExpr_concatStringWithNumber() { /** =============================== COMMENT =============================== */ @Test - public void writeBlockCommentStatement_basic() { + void writeBlockCommentStatement_basic() { String content = "this is a test comment"; BlockComment blockComment = BlockComment.builder().setComment(content).build(); CommentStatement commentStatement = CommentStatement.withComment(blockComment); @@ -762,7 +790,7 @@ public void writeBlockCommentStatement_basic() { } @Test - public void writeLineCommentStatement_basic() { + void writeLineCommentStatement_basic() { String content = "this is a test comment"; LineComment lineComment = LineComment.builder().setComment(content).build(); CommentStatement commentStatement = CommentStatement.withComment(lineComment); @@ -772,7 +800,7 @@ public void writeLineCommentStatement_basic() { } @Test - public void writeJavaDocCommentStatement_allComponents() { + void writeJavaDocCommentStatement_allComponents() { String content = "this is a test comment"; String deprecatedText = "Use the {@link ArchivedBookName} class instead."; String paramName = "shelfName"; @@ -833,7 +861,7 @@ public void writeJavaDocCommentStatement_allComponents() { } @Test - public void writeBlockComment_shortLines() { + void writeBlockComment_shortLines() { String content = "Apache License \nThis is a test file header"; BlockComment blockComment = BlockComment.builder().setComment(content).build(); String expected = @@ -843,7 +871,7 @@ public void writeBlockComment_shortLines() { } @Test - public void writeBlockComment_newLineInBetween() { + void writeBlockComment_newLineInBetween() { String content = "Apache License \n" + "Licensed under the Apache License, Version 2.0 (the \"License\");\n\n" @@ -862,7 +890,7 @@ public void writeBlockComment_newLineInBetween() { } @Test - public void writeLineComment_longLine() { + void writeLineComment_longLine() { String content = "this is a long test comment with so many words, hello world, hello again, hello for 3" + " times, blah, blah!"; @@ -877,7 +905,7 @@ public void writeLineComment_longLine() { } @Test - public void writeLineComment_specialChar() { + void writeLineComment_specialChar() { String content = "usage: gradle run -PmainClass=com.google.example.examples.library.v1.Hopper" + " [--args='[--shelf \"Novel\\\"`\b\t\n\r" @@ -895,7 +923,7 @@ public void writeLineComment_specialChar() { } @Test - public void writeJavaDocComment_specialChar() { + void writeJavaDocComment_specialChar() { // Only comments and sample codes in JavaDocComment need this escaper. //

      • are hard-coded in monolith generator, which do not need escaping. JavaDocComment javaDocComment = @@ -934,7 +962,26 @@ public void writeJavaDocComment_specialChar() { } @Test - public void writeTernaryExpr_basic() { + void writeFailingComment_specialChar() { + JavaDocComment javaDocComment = + JavaDocComment.builder() + .addUnescapedComment( + "This resource reference needs to be CommentFormatted or it will fail: `bookShelves/*/`") + .build(); + + FormatException exceptionForIncorrectlyFormattedComment = + assertThrows( + FormatException.class, + () -> { + javaDocComment.accept(writerVisitor); + }); + assertThat(exceptionForIncorrectlyFormattedComment) + .hasMessageThat() + .contains("The input resource can not be parsed"); + } + + @Test + void writeTernaryExpr_basic() { Variable conditionVariable = Variable.builder().setName("condition").setType(TypeNode.BOOLEAN).build(); VariableExpr conditionExpr = VariableExpr.builder().setVariable(conditionVariable).build(); @@ -955,7 +1002,7 @@ public void writeTernaryExpr_basic() { } @Test - public void writeAssignmentExpr_basicValue() { + void writeAssignmentExpr_basicValue() { Variable variable = Variable.builder().setName("x").setType(TypeNode.INT).build(); VariableExpr variableExpr = VariableExpr.builder().setVariable(variable).setIsDecl(true).build(); @@ -971,7 +1018,7 @@ public void writeAssignmentExpr_basicValue() { } @Test - public void writeAssignmentExpr_varToVar() { + void writeAssignmentExpr_varToVar() { Variable variable = Variable.builder().setName("foobar").setType(TypeNode.INT).build(); VariableExpr variableExpr = VariableExpr.builder() @@ -993,7 +1040,7 @@ public void writeAssignmentExpr_varToVar() { } @Test - public void writeAssignmentExpr_nullObjectValueReferenceType() { + void writeAssignmentExpr_nullObjectValueReferenceType() { Variable variable = Variable.builder().setName("x").setType(TypeNode.STRING).build(); VariableExpr variableExpr = VariableExpr.builder().setVariable(variable).setIsDecl(true).build(); @@ -1009,7 +1056,7 @@ public void writeAssignmentExpr_nullObjectValueReferenceType() { } @Test - public void writeStringObjectValue_basic() { + void writeStringObjectValue_basic() { Value value = StringObjectValue.withValue("test"); Expr valueExpr = ValueExpr.builder().setValue(value).build(); valueExpr.accept(writerVisitor); @@ -1017,7 +1064,7 @@ public void writeStringObjectValue_basic() { } @Test - public void writeAssignmentExpr_stringObjectValue() { + void writeAssignmentExpr_stringObjectValue() { Variable variable = Variable.builder().setName("x").setType(TypeNode.STRING).build(); VariableExpr variableExpr = VariableExpr.builder().setVariable(variable).setIsDecl(true).build(); @@ -1032,7 +1079,7 @@ public void writeAssignmentExpr_stringObjectValue() { } @Test - public void writeAssignmentExpr_variableDeclarationWithAnnotation() { + void writeAssignmentExpr_variableDeclarationWithAnnotation() { Variable variable = Variable.builder().setName("x").setType(TypeNode.STRING).build(); VariableExpr variableExpr = VariableExpr.builder() @@ -1051,7 +1098,7 @@ public void writeAssignmentExpr_variableDeclarationWithAnnotation() { } @Test - public void writeMethodInvocationExpr_basic() { + void writeMethodInvocationExpr_basic() { MethodInvocationExpr methodExpr = MethodInvocationExpr.builder().setMethodName("foobar").build(); @@ -1060,7 +1107,7 @@ public void writeMethodInvocationExpr_basic() { } @Test - public void writeMethodInvocationExpr_staticRef() { + void writeMethodInvocationExpr_staticRef() { TypeNode someType = TypeNode.withReference( VaporReference.builder() @@ -1079,7 +1126,7 @@ public void writeMethodInvocationExpr_staticRef() { } @Test - public void writeMethodInvocationExpr_genericWithArgs() { + void writeMethodInvocationExpr_genericWithArgs() { Reference mapReference = ConcreteReference.builder() .setClazz(HashMap.class) @@ -1126,7 +1173,7 @@ public void writeMethodInvocationExpr_genericWithArgs() { } @Test - public void writeMethodInvocationExpr_chained() { + void writeMethodInvocationExpr_chained() { Variable variable = Variable.builder().setType(TypeNode.INT).setName("libraryClient").build(); VariableExpr varExpr = VariableExpr.builder().setVariable(variable).build(); @@ -1152,7 +1199,7 @@ public void writeMethodInvocationExpr_chained() { } @Test - public void writeCastExpr_basic() { + void writeCastExpr_basic() { Variable variable = Variable.builder().setType(TypeNode.STRING).setName("str").build(); VariableExpr varExpr = VariableExpr.builder().setVariable(variable).build(); CastExpr castExpr = @@ -1165,7 +1212,7 @@ public void writeCastExpr_basic() { } @Test - public void writeCastExpr_methodInvocation() { + void writeCastExpr_methodInvocation() { TypeNode someType = TypeNode.withReference( VaporReference.builder() @@ -1189,7 +1236,7 @@ public void writeCastExpr_methodInvocation() { } @Test - public void writeCastExpr_nested() { + void writeCastExpr_nested() { Variable variable = Variable.builder().setType(TypeNode.STRING).setName("str").build(); VariableExpr varExpr = VariableExpr.builder().setVariable(variable).build(); CastExpr castExpr = @@ -1203,7 +1250,7 @@ public void writeCastExpr_nested() { } @Test - public void writeAnonymousClassExpr_basic() { + void writeAnonymousClassExpr_basic() { ConcreteReference ref = ConcreteReference.withClazz(Runnable.class); TypeNode type = TypeNode.withReference(ref); AssignmentExpr assignmentExpr = createAssignmentExpr("foobar", "false", TypeNode.BOOLEAN); @@ -1230,7 +1277,7 @@ public void writeAnonymousClassExpr_basic() { } @Test - public void writeAnonymousClassExpr_withStatementsMethods() { + void writeAnonymousClassExpr_withStatementsMethods() { ConcreteReference ref = ConcreteReference.withClazz(Runnable.class); TypeNode type = TypeNode.withReference(ref); // [Constructing] private static final String s = "foo"; @@ -1275,7 +1322,7 @@ public void writeAnonymousClassExpr_withStatementsMethods() { } @Test - public void writeAnonymousClassExpr_generics() { + void writeAnonymousClassExpr_generics() { // [Constructing] Function, MethodDefinition> ConcreteReference exceptionListRef = ConcreteReference.builder() @@ -1331,7 +1378,7 @@ public void writeAnonymousClassExpr_generics() { } @Test - public void writeThrowExpr_basic() { + void writeThrowExpr_basic() { TypeNode npeType = TypeNode.withReference(ConcreteReference.withClazz(NullPointerException.class)); ThrowExpr throwExpr = ThrowExpr.builder().setType(npeType).build(); @@ -1340,7 +1387,7 @@ public void writeThrowExpr_basic() { } @Test - public void writeThrowExpr_basicThrowExpr() { + void writeThrowExpr_basicThrowExpr() { Expr exprToThrow = MethodInvocationExpr.builder() .setStaticReferenceType( @@ -1355,7 +1402,7 @@ public void writeThrowExpr_basicThrowExpr() { } @Test - public void writeThrowExpr_basicWithMessage() { + void writeThrowExpr_basicWithMessage() { TypeNode npeType = TypeNode.withReference(ConcreteReference.withClazz(NullPointerException.class)); String message = "Some message asdf"; @@ -1365,7 +1412,7 @@ public void writeThrowExpr_basicWithMessage() { } @Test - public void writeThrowExpr_basicWithCause() { + void writeThrowExpr_basicWithCause() { TypeNode npeType = TypeNode.withReference(ConcreteReference.withClazz(NullPointerException.class)); ThrowExpr throwExpr = @@ -1381,7 +1428,7 @@ public void writeThrowExpr_basicWithCause() { } @Test - public void writeThrowExpr_messageExpr() { + void writeThrowExpr_messageExpr() { TypeNode npeType = TypeNode.withExceptionClazz(NullPointerException.class); Expr messageExpr = MethodInvocationExpr.builder() @@ -1395,7 +1442,7 @@ public void writeThrowExpr_messageExpr() { } @Test - public void writeThrowExpr_messageAndCauseExpr() { + void writeThrowExpr_messageAndCauseExpr() { TypeNode npeType = TypeNode.withExceptionClazz(NullPointerException.class); Expr messageExpr = MethodInvocationExpr.builder() @@ -1418,7 +1465,7 @@ public void writeThrowExpr_messageAndCauseExpr() { } @Test - public void writeInstanceofExpr() { + void writeInstanceofExpr() { Variable variable = Variable.builder().setName("x").setType(TypeNode.STRING).build(); VariableExpr variableExpr = VariableExpr.builder().setVariable(variable).build(); InstanceofExpr instanceofExpr = @@ -1428,7 +1475,7 @@ public void writeInstanceofExpr() { } @Test - public void writeEnumRefExpr_basic() { + void writeEnumRefExpr_basic() { TypeNode enumType = TypeNode.withReference( ConcreteReference.builder() @@ -1442,7 +1489,7 @@ public void writeEnumRefExpr_basic() { } @Test - public void writeEnumRefExpr_nested() { + void writeEnumRefExpr_nested() { TypeNode enumType = TypeNode.withReference(ConcreteReference.withClazz(TypeNode.TypeKind.class)); EnumRefExpr enumRefExpr = EnumRefExpr.builder().setName("VOID").setType(enumType).build(); @@ -1451,7 +1498,7 @@ public void writeEnumRefExpr_nested() { } @Test - public void writeReturnExpr_basic() { + void writeReturnExpr_basic() { ReturnExpr returnExpr = ReturnExpr.withExpr(ValueExpr.withValue(StringObjectValue.withValue("asdf"))); returnExpr.accept(writerVisitor); @@ -1460,7 +1507,7 @@ public void writeReturnExpr_basic() { /** =============================== STATEMENTS =============================== */ @Test - public void writeExprStatement() { + void writeExprStatement() { TypeNode someType = TypeNode.withReference( VaporReference.builder() @@ -1480,14 +1527,14 @@ public void writeExprStatement() { } @Test - public void writeBlockStatement_empty() { + void writeBlockStatement_empty() { BlockStatement blockStatement = BlockStatement.builder().build(); blockStatement.accept(writerVisitor); assertEquals("{\n}\n", writerVisitor.write()); } @Test - public void writeBlockStatement_simple() { + void writeBlockStatement_simple() { TypeNode someType = TypeNode.withReference( VaporReference.builder() @@ -1508,7 +1555,7 @@ public void writeBlockStatement_simple() { } @Test - public void writeBlockStatement_static() { + void writeBlockStatement_static() { TypeNode someType = TypeNode.withReference( VaporReference.builder() @@ -1534,7 +1581,7 @@ public void writeBlockStatement_static() { } @Test - public void writeIfStatement_simple() { + void writeIfStatement_simple() { AssignmentExpr assignExpr = createAssignmentExpr("x", "3", TypeNode.INT); Statement assignExprStatement = ExprStatement.withExpr(assignExpr); List ifBody = Arrays.asList(assignExprStatement, assignExprStatement); @@ -1550,7 +1597,7 @@ public void writeIfStatement_simple() { } @Test - public void writeIfStatement_withElse() { + void writeIfStatement_withElse() { AssignmentExpr assignExpr = createAssignmentExpr("x", "3", TypeNode.INT); Statement assignExprStatement = ExprStatement.withExpr(assignExpr); List ifBody = Arrays.asList(assignExprStatement, assignExprStatement); @@ -1578,7 +1625,7 @@ public void writeIfStatement_withElse() { } @Test - public void writeIfStatement_elseIfs() { + void writeIfStatement_elseIfs() { List ifBody = Arrays.asList( ExprStatement.withExpr(createAssignmentExpr("x", "3", TypeNode.INT)), @@ -1619,7 +1666,7 @@ public void writeIfStatement_elseIfs() { } @Test - public void writeIfStatement_nested() { + void writeIfStatement_nested() { List ifBody = Arrays.asList( ExprStatement.withExpr(createAssignmentExpr("x", "3", TypeNode.INT)), @@ -1682,7 +1729,7 @@ public void writeIfStatement_nested() { } @Test - public void writeWhileStatement_simple() { + void writeWhileStatement_simple() { AssignmentExpr assignExpr = createAssignmentExpr("x", "3", TypeNode.INT); Statement assignExprStatement = ExprStatement.withExpr(assignExpr); List whileBody = Arrays.asList(assignExprStatement, assignExprStatement); @@ -1698,7 +1745,7 @@ public void writeWhileStatement_simple() { } @Test - public void writeForStatement() { + void writeForStatement() { AssignmentExpr assignExpr = createAssignmentExpr("x", "3", TypeNode.INT); Statement assignExprStatement = ExprStatement.withExpr(assignExpr); List body = Arrays.asList(assignExprStatement, assignExprStatement); @@ -1722,7 +1769,7 @@ public void writeForStatement() { } @Test - public void writeGeneralForStatement_basicIsDecl() { + void writeGeneralForStatement_basicIsDecl() { AssignmentExpr assignExpr = createAssignmentExpr("x", "3", TypeNode.INT); Statement assignExprStatement = ExprStatement.withExpr(assignExpr); List body = Arrays.asList(assignExprStatement, assignExprStatement); @@ -1745,7 +1792,7 @@ public void writeGeneralForStatement_basicIsDecl() { } @Test - public void writeGeneralForStatement_basicIsNotDecl() { + void writeGeneralForStatement_basicIsNotDecl() { AssignmentExpr assignExpr = createAssignmentExpr("x", "3", TypeNode.INT); Statement assignExprStatement = ExprStatement.withExpr(assignExpr); List body = Arrays.asList(assignExprStatement, assignExprStatement); @@ -1767,7 +1814,7 @@ public void writeGeneralForStatement_basicIsNotDecl() { } @Test - public void writeTryCatchStatement_simple() { + void writeTryCatchStatement_simple() { Reference exceptionReference = ConcreteReference.withClazz(IllegalArgumentException.class); TypeNode type = TypeNode.withReference(exceptionReference); VariableExpr variableExpr = @@ -1789,7 +1836,7 @@ public void writeTryCatchStatement_simple() { } @Test - public void writeTryCatchStatement_simpleMultiCatch() { + void writeTryCatchStatement_simpleMultiCatch() { VariableExpr firstCatchVarExpr = VariableExpr.builder() .setVariable( @@ -1822,7 +1869,7 @@ public void writeTryCatchStatement_simpleMultiCatch() { } @Test - public void writeTryCatchStatement_simpleMultiCatchOrderMatters() { + void writeTryCatchStatement_simpleMultiCatchOrderMatters() { VariableExpr firstCatchVarExpr = VariableExpr.builder() .setVariable( @@ -1855,7 +1902,7 @@ public void writeTryCatchStatement_simpleMultiCatchOrderMatters() { } @Test - public void writeTryCatchStatement_withResources() { + void writeTryCatchStatement_withResources() { Reference exceptionReference = ConcreteReference.withClazz(IllegalArgumentException.class); TypeNode type = TypeNode.withReference(exceptionReference); VariableExpr variableExpr = @@ -1885,7 +1932,7 @@ public void writeTryCatchStatement_withResources() { } @Test - public void writeTryCatchStatement_sampleCodeNoCatch() { + void writeTryCatchStatement_sampleCodeNoCatch() { TryCatchStatement tryCatch = TryCatchStatement.builder() .setTryBody( @@ -1898,7 +1945,7 @@ public void writeTryCatchStatement_sampleCodeNoCatch() { } @Test - public void writeTryCatchStatement_sampleCodeWithCatch() { + void writeTryCatchStatement_sampleCodeWithCatch() { Reference exceptionReference = ConcreteReference.withClazz(IllegalArgumentException.class); TypeNode type = TypeNode.withReference(exceptionReference); VariableExpr variableExpr = @@ -1929,7 +1976,7 @@ public void writeTryCatchStatement_sampleCodeWithCatch() { } @Test - public void writeSynchronizedStatement_basicThis() { + void writeSynchronizedStatement_basicThis() { SynchronizedStatement synchronizedStatement = SynchronizedStatement.builder() .setLock( @@ -1946,7 +1993,7 @@ public void writeSynchronizedStatement_basicThis() { } @Test - public void writeSynchronizedStatement_basicVariableExpr() { + void writeSynchronizedStatement_basicVariableExpr() { VariableExpr strVarExpr = VariableExpr.withVariable( Variable.builder().setName("str").setType(TypeNode.STRING).build()); @@ -1965,7 +2012,7 @@ public void writeSynchronizedStatement_basicVariableExpr() { } @Test - public void writeMethodDefinition_basic() { + void writeMethodDefinition_basic() { MethodDefinition methodDefinition = MethodDefinition.builder() .setName("close") @@ -1982,7 +2029,7 @@ public void writeMethodDefinition_basic() { } @Test - public void writeMethodDefinition_constructor() { + void writeMethodDefinition_constructor() { TypeNode returnType = TypeNode.withReference( VaporReference.builder() @@ -2000,7 +2047,7 @@ public void writeMethodDefinition_constructor() { } @Test - public void writeMethodDefinition_basicEmptyBody() { + void writeMethodDefinition_basicEmptyBody() { MethodDefinition methodDefinition = MethodDefinition.builder() .setName("close") @@ -2013,7 +2060,7 @@ public void writeMethodDefinition_basicEmptyBody() { } @Test - public void writeMethodDefinition_basicAbstract() { + void writeMethodDefinition_basicAbstract() { MethodDefinition methodDefinition = MethodDefinition.builder() .setName("close") @@ -2031,7 +2078,7 @@ public void writeMethodDefinition_basicAbstract() { } @Test - public void writeMethodDefinition_basicAbstractEmptyBody() { + void writeMethodDefinition_basicAbstractEmptyBody() { MethodDefinition methodDefinition = MethodDefinition.builder() .setName("close") @@ -2045,7 +2092,7 @@ public void writeMethodDefinition_basicAbstractEmptyBody() { } @Test - public void writeMethodDefinition_withArgumentsAndReturnExpr() { + void writeMethodDefinition_withArgumentsAndReturnExpr() { ValueExpr returnExpr = ValueExpr.builder() .setValue(PrimitiveValue.builder().setType(TypeNode.INT).setValue("3").build()) @@ -2084,7 +2131,7 @@ public void writeMethodDefinition_withArgumentsAndReturnExpr() { } @Test - public void writeMethodDefinition_withCommentsAnnotationsAndThrows() { + void writeMethodDefinition_withCommentsAnnotationsAndThrows() { LineComment lineComment = LineComment.withComment("AUTO-GENERATED DOCUMENTATION AND METHOD"); JavaDocComment javaDocComment = JavaDocComment.builder() @@ -2161,7 +2208,7 @@ public void writeMethodDefinition_withCommentsAnnotationsAndThrows() { } @Test - public void writeMethodDefinition_templatedReturnTypeAndArguments() { + void writeMethodDefinition_templatedReturnTypeAndArguments() { Reference mapRef = ConcreteReference.withClazz(Map.class); List arguments = Arrays.asList( @@ -2202,7 +2249,7 @@ public void writeMethodDefinition_templatedReturnTypeAndArguments() { } @Test - public void writeClassDefinition_basicWithFileHeader() { + void writeClassDefinition_basicWithFileHeader() { List fileHeader = Arrays.asList(CommentStatement.withComment(BlockComment.withComment("Apache License"))); ClassDefinition classDef = @@ -2226,7 +2273,7 @@ public void writeClassDefinition_basicWithFileHeader() { } @Test - public void writeClassDefinition_withAnnotationsExtendsAndImplements() { + void writeClassDefinition_withAnnotationsExtendsAndImplements() { ClassDefinition classDef = ClassDefinition.builder() .setPackageString("com.google.example.library.v1.stub") @@ -2257,7 +2304,7 @@ public void writeClassDefinition_withAnnotationsExtendsAndImplements() { } @Test - public void writeClassDefinition_commentsStatementsAndMethods() { + void writeClassDefinition_commentsStatementsAndMethods() { LineComment lineComment = LineComment.withComment("AUTO-GENERATED DOCUMENTATION AND CLASS"); JavaDocComment javaDocComment = JavaDocComment.builder() @@ -2396,7 +2443,72 @@ public void writeClassDefinition_commentsStatementsAndMethods() { } @Test - public void writeReferenceConstructorExpr_thisConstructorWithArguments() { + void writeClassDefinition_withImportCollision() { + + VaporReference firstType = + VaporReference.builder() + .setName("Service") + .setPakkage("com.google.api.generator.gapic.model") + .build(); + + VaporReference secondType = + VaporReference.builder().setName("Service").setPakkage("com.google.api").build(); + + Variable secondTypeVar = + Variable.builder() + .setName("anotherServiceVar") + .setType(TypeNode.withReference(secondType)) + .build(); + + MethodInvocationExpr genericMethodInvocation = + MethodInvocationExpr.builder() + .setMethodName("barMethod") + .setStaticReferenceType(TypeNode.withReference(firstType)) + .setGenerics(Arrays.asList(secondType)) + .setArguments(VariableExpr.withVariable(secondTypeVar)) + .setReturnType(TypeNode.STRING) + .build(); + + List statements = Arrays.asList(ExprStatement.withExpr(genericMethodInvocation)); + + MethodDefinition methodOne = + MethodDefinition.builder() + .setName("doSomething") + .setScope(ScopeNode.PRIVATE) + .setBody(statements) + .setReturnType(TypeNode.VOID) + .build(); + + List methods = Arrays.asList(methodOne); + + ClassDefinition classDef = + ClassDefinition.builder() + .setPackageString("com.google.example") + .setName("FooService") + .setScope(ScopeNode.PUBLIC) + .setMethods(methods) + .build(); + + classDef.accept(writerVisitor); + + String expected = + LineFormatter.lines( + "package com.google.example;\n" + + "\n" + + "import com.google.api.generator.gapic.model.Service;\n" + + "\n" + + "public class FooService {\n" + + "\n" + + " private void doSomething() {\n" + + " Service.barMethod(anotherServiceVar);\n" + + " }\n" + + "}\n"); + + assertThat(writerVisitor.write()).isEqualTo(expected); + } + + @Test + void writeReferenceConstructorExpr_thisConstructorWithArguments() { VaporReference ref = VaporReference.builder().setName("Student").setPakkage("com.google.example.v1").build(); TypeNode classType = TypeNode.withReference(ref); @@ -2418,7 +2530,7 @@ public void writeReferenceConstructorExpr_thisConstructorWithArguments() { } @Test - public void writeReferenceConstructorExpr_superConstructorWithNoArguments() { + void writeReferenceConstructorExpr_superConstructorWithNoArguments() { VaporReference ref = VaporReference.builder().setName("Parent").setPakkage("com.google.example.v1").build(); TypeNode classType = TypeNode.withReference(ref); @@ -2429,7 +2541,7 @@ public void writeReferenceConstructorExpr_superConstructorWithNoArguments() { } @Test - public void writeThisObjectValue_methodReturn() { + void writeThisObjectValue_methodReturn() { VaporReference ref = VaporReference.builder().setName("Student").setPakkage("com.google.example.v1").build(); TypeNode classType = TypeNode.withReference(ref); @@ -2448,7 +2560,7 @@ public void writeThisObjectValue_methodReturn() { } @Test - public void writeThisObjectValue_accessFieldAndInvokeMethod() { + void writeThisObjectValue_accessFieldAndInvokeMethod() { VaporReference ref = VaporReference.builder().setName("Student").setPakkage("com.google.example.v1").build(); TypeNode classType = TypeNode.withReference(ref); @@ -2477,7 +2589,7 @@ public void writeThisObjectValue_accessFieldAndInvokeMethod() { } @Test - public void writeSuperObjectValue_accessFieldAndInvokeMethod() { + void writeSuperObjectValue_accessFieldAndInvokeMethod() { VaporReference ref = VaporReference.builder().setName("Student").setPakkage("com.google.example.v1").build(); TypeNode classType = TypeNode.withReference(ref); @@ -2507,7 +2619,7 @@ public void writeSuperObjectValue_accessFieldAndInvokeMethod() { } @Test - public void writeUnaryOperationExpr_postfixIncrement() { + void writeUnaryOperationExpr_postfixIncrement() { VariableExpr variableExpr = VariableExpr.withVariable(Variable.builder().setType(TypeNode.INT).setName("i").build()); UnaryOperationExpr postIncrementOperationExpr = @@ -2517,7 +2629,7 @@ public void writeUnaryOperationExpr_postfixIncrement() { } @Test - public void writeUnaryOperationExpr_logicalNot() { + void writeUnaryOperationExpr_logicalNot() { MethodInvocationExpr methodInvocationExpr = MethodInvocationExpr.builder() .setMethodName("isEmpty") @@ -2530,7 +2642,7 @@ public void writeUnaryOperationExpr_logicalNot() { } @Test - public void writeRelationalOperationExpr_equalTo() { + void writeRelationalOperationExpr_equalTo() { VariableExpr variableExprLHS = VariableExpr.withVariable( Variable.builder().setType(TypeNode.BOOLEAN_OBJECT).setName("isGood").build()); @@ -2547,7 +2659,7 @@ public void writeRelationalOperationExpr_equalTo() { } @Test - public void writeRelationOperationExpr_notEqualTo() { + void writeRelationOperationExpr_notEqualTo() { TypeNode someType = TypeNode.withReference( VaporReference.builder() @@ -2569,7 +2681,7 @@ public void writeRelationOperationExpr_notEqualTo() { } @Test - public void writeRelationalOperationExpr_lessThan() { + void writeRelationalOperationExpr_lessThan() { VariableExpr lhsExpr = VariableExpr.withVariable(createVariable("i", TypeNode.INT)); MethodInvocationExpr rhsExpr = MethodInvocationExpr.builder() @@ -2584,7 +2696,7 @@ public void writeRelationalOperationExpr_lessThan() { } @Test - public void writeLogicalOperationExpr_logicalAnd() { + void writeLogicalOperationExpr_logicalAnd() { VariableExpr lhsExpr = VariableExpr.withVariable(createVariable("isEmpty", TypeNode.BOOLEAN)); VaporReference ref = VaporReference.builder().setName("Student").setPakkage("com.google.example.v1").build(); @@ -2602,7 +2714,7 @@ public void writeLogicalOperationExpr_logicalAnd() { } @Test - public void writeLogicalOperationExpr_logicalOr() { + void writeLogicalOperationExpr_logicalOr() { VariableExpr lhsExpr = VariableExpr.withVariable(createVariable("isGood", TypeNode.BOOLEAN)); MethodInvocationExpr rhsExpr = MethodInvocationExpr.builder() @@ -2616,7 +2728,7 @@ public void writeLogicalOperationExpr_logicalOr() { } @Test - public void writeAssignmentOperationExpr_multiplyAssignment() { + void writeAssignmentOperationExpr_multiplyAssignment() { VariableExpr lhsExpr = createVariableExpr("h", TypeNode.INT); ValueExpr rhsExpr = ValueExpr.withValue( @@ -2628,7 +2740,7 @@ public void writeAssignmentOperationExpr_multiplyAssignment() { } @Test - public void writeAssignmentOperationExpr_xorAssignment() { + void writeAssignmentOperationExpr_xorAssignment() { VariableExpr lhsExpr = createVariableExpr("h", TypeNode.INT); TypeNode objectType = TypeNode.withReference( @@ -2649,7 +2761,7 @@ public void writeAssignmentOperationExpr_xorAssignment() { } @Test - public void writeLambdaExpr_noParameters() { + void writeLambdaExpr_noParameters() { LambdaExpr lambdaExpr = LambdaExpr.builder() .setReturnExpr(ValueExpr.withValue(StringObjectValue.withValue("foo"))) @@ -2659,7 +2771,7 @@ public void writeLambdaExpr_noParameters() { } @Test - public void writeLambdaExpr_assignToVariable() { + void writeLambdaExpr_assignToVariable() { LambdaExpr lambdaExpr = LambdaExpr.builder() .setReturnExpr(ValueExpr.withValue(StringObjectValue.withValue("foo"))) @@ -2676,7 +2788,7 @@ public void writeLambdaExpr_assignToVariable() { } @Test - public void writeLambdaExpr_oneParameter() { + void writeLambdaExpr_oneParameter() { VariableExpr argVarExpr = VariableExpr.builder() .setVariable(Variable.builder().setName("arg").setType(TypeNode.INT).build()) @@ -2693,7 +2805,7 @@ public void writeLambdaExpr_oneParameter() { } @Test - public void writeLambdaExpr_severalParameters() { + void writeLambdaExpr_severalParameters() { VariableExpr argOneVarExpr = VariableExpr.builder() .setVariable(Variable.builder().setName("arg").setType(TypeNode.INT).build()) @@ -2720,7 +2832,7 @@ public void writeLambdaExpr_severalParameters() { } @Test - public void writeLambdaExpr_body() { + void writeLambdaExpr_body() { VariableExpr argVarExpr = VariableExpr.builder() .setVariable(Variable.builder().setName("arg").setType(TypeNode.INT).build()) @@ -2752,21 +2864,21 @@ public void writeLambdaExpr_body() { } @Test - public void writeEmptyLineStatement() { + void writeEmptyLineStatement() { EmptyLineStatement statement = EmptyLineStatement.create(); statement.accept(writerVisitor); assertEquals("\n", writerVisitor.write()); } @Test - public void writeBreakStatement() { + void writeBreakStatement() { BreakStatement statement = BreakStatement.create(); statement.accept(writerVisitor); assertEquals("break;", writerVisitor.write()); } @Test - public void writePackageInfoDefinition() { + void writePackageInfoDefinition() { PackageInfoDefinition packageInfo = PackageInfoDefinition.builder() .setPakkage("com.google.example.library.v1") @@ -2796,6 +2908,17 @@ public void writePackageInfoDefinition() { writerVisitor.write()); } + /** =============================== GOLDEN TESTS =============================== */ + @Test + void writeSGrpcServiceClientWithNestedClassImport() { + GapicContext context = TestProtoLoader.instance().parseNestedMessage(); + Service nestedService = context.services().get(0); + GapicClass clazz = ServiceClientClassComposer.instance().generate(context, nestedService); + + Assert.assertGoldenClass( + this.getClass(), clazz, "GrpcServiceClientWithNestedClassImport.golden"); + } + /** =============================== HELPERS =============================== */ private static AssignmentExpr createAssignmentExpr( String variableName, String value, TypeNode type) { diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/engine/writer/goldens/GrpcServiceClientWithNestedClassImport.golden b/gapic-generator-java/src/test/java/com/google/api/generator/engine/writer/goldens/GrpcServiceClientWithNestedClassImport.golden new file mode 100644 index 0000000000..9a8f46553d --- /dev/null +++ b/gapic-generator-java/src/test/java/com/google/api/generator/engine/writer/goldens/GrpcServiceClientWithNestedClassImport.golden @@ -0,0 +1,225 @@ +package com.google.types.testing; + +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.testgapic.v1beta1.Outer; +import com.google.types.testing.stub.NestedMessageServiceStub; +import com.google.types.testing.stub.NestedMessageServiceStubSettings; +import java.io.IOException; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * 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 (NestedMessageServiceClient nestedMessageServiceClient =
        + *     NestedMessageServiceClient.create()) {
        + *   Outer.Middle request = Outer.Middle.newBuilder().setX(120).build();
        + *   Outer.Middle.Inner response = nestedMessageServiceClient.nestedMessageMethod(request);
        + * }
        + * }
        + * + *

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

        NestedMessageMethod

        + *

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

        + *
          + *
        • nestedMessageMethod(Outer.Middle request) + *

        + *

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

        + *
          + *
        • nestedMessageMethodCallable() + *

        + *
        + * + *

        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 NestedMessageServiceSettings + * 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
        + * NestedMessageServiceSettings nestedMessageServiceSettings =
        + *     NestedMessageServiceSettings.newBuilder()
        + *         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
        + *         .build();
        + * NestedMessageServiceClient nestedMessageServiceClient =
        + *     NestedMessageServiceClient.create(nestedMessageServiceSettings);
        + * }
        + * + *

        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
        + * NestedMessageServiceSettings nestedMessageServiceSettings =
        + *     NestedMessageServiceSettings.newBuilder().setEndpoint(myEndpoint).build();
        + * NestedMessageServiceClient nestedMessageServiceClient =
        + *     NestedMessageServiceClient.create(nestedMessageServiceSettings);
        + * }
        + * + *

        Please refer to the GitHub repository's samples for more quickstart code snippets. + */ +@Generated("by gapic-generator-java") +public class NestedMessageServiceClient implements BackgroundResource { + private final NestedMessageServiceSettings settings; + private final NestedMessageServiceStub stub; + + /** Constructs an instance of NestedMessageServiceClient with default settings. */ + public static final NestedMessageServiceClient create() throws IOException { + return create(NestedMessageServiceSettings.newBuilder().build()); + } + + /** + * Constructs an instance of NestedMessageServiceClient, 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 NestedMessageServiceClient create(NestedMessageServiceSettings settings) + throws IOException { + return new NestedMessageServiceClient(settings); + } + + /** + * Constructs an instance of NestedMessageServiceClient, using the given stub for making calls. + * This is for advanced usage - prefer using create(NestedMessageServiceSettings). + */ + public static final NestedMessageServiceClient create(NestedMessageServiceStub stub) { + return new NestedMessageServiceClient(stub); + } + + /** + * Constructs an instance of NestedMessageServiceClient, 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 NestedMessageServiceClient(NestedMessageServiceSettings settings) throws IOException { + this.settings = settings; + this.stub = ((NestedMessageServiceStubSettings) settings.getStubSettings()).createStub(); + } + + protected NestedMessageServiceClient(NestedMessageServiceStub stub) { + this.settings = null; + this.stub = stub; + } + + public final NestedMessageServiceSettings getSettings() { + return settings; + } + + public NestedMessageServiceStub getStub() { + return stub; + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * 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 (NestedMessageServiceClient nestedMessageServiceClient =
        +   *     NestedMessageServiceClient.create()) {
        +   *   Outer.Middle request = Outer.Middle.newBuilder().setX(120).build();
        +   *   Outer.Middle.Inner response = nestedMessageServiceClient.nestedMessageMethod(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 Outer.Middle.Inner nestedMessageMethod(Outer.Middle request) { + return nestedMessageMethodCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * 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 (NestedMessageServiceClient nestedMessageServiceClient =
        +   *     NestedMessageServiceClient.create()) {
        +   *   Outer.Middle request = Outer.Middle.newBuilder().setX(120).build();
        +   *   ApiFuture future =
        +   *       nestedMessageServiceClient.nestedMessageMethodCallable().futureCall(request);
        +   *   // Do something.
        +   *   Outer.Middle.Inner response = future.get();
        +   * }
        +   * }
        + */ + public final UnaryCallable nestedMessageMethodCallable() { + return stub.nestedMessageMethodCallable(); + } + + @Override + public final void close() { + stub.close(); + } + + @Override + public void shutdown() { + stub.shutdown(); + } + + @Override + public boolean isShutdown() { + return stub.isShutdown(); + } + + @Override + public boolean isTerminated() { + return stub.isTerminated(); + } + + @Override + public void shutdownNow() { + stub.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return stub.awaitTermination(duration, unit); + } +} diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/ClientLibraryPackageInfoComposerTest.java b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/ClientLibraryPackageInfoComposerTest.java index f827bfc63e..5110e3efaf 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/ClientLibraryPackageInfoComposerTest.java +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/ClientLibraryPackageInfoComposerTest.java @@ -14,27 +14,36 @@ package com.google.api.generator.gapic.composer; +import static org.junit.jupiter.api.Assertions.assertNull; + import com.google.api.generator.engine.writer.JavaWriterVisitor; -import com.google.api.generator.gapic.composer.common.TestProtoLoader; import com.google.api.generator.gapic.model.GapicContext; import com.google.api.generator.gapic.model.GapicPackageInfo; import com.google.api.generator.test.framework.Assert; -import com.google.api.generator.test.framework.Utils; +import com.google.api.generator.test.framework.GoldenFileWriter; +import com.google.api.generator.test.protoloader.TestProtoLoader; import java.nio.file.Path; import java.nio.file.Paths; -import org.junit.Test; +import org.junit.jupiter.api.Test; -public class ClientLibraryPackageInfoComposerTest { +class ClientLibraryPackageInfoComposerTest { private GapicContext context = TestProtoLoader.instance().parseShowcaseEcho(); @Test - public void composePackageInfo_showcase() { + void composePackageInfo_showcase() { GapicPackageInfo packageInfo = ClientLibraryPackageInfoComposer.generatePackageInfo(context); JavaWriterVisitor visitor = new JavaWriterVisitor(); packageInfo.packageInfo().accept(visitor); - Utils.saveCodegenToFile(this.getClass(), "ShowcaseWithEchoPackageInfo.golden", visitor.write()); + GoldenFileWriter.saveCodegenToFile( + this.getClass(), "ShowcaseWithEchoPackageInfo.golden", visitor.write()); Path goldenFilePath = - Paths.get(Utils.getGoldenDir(this.getClass()), "ShowcaseWithEchoPackageInfo.golden"); + Paths.get( + GoldenFileWriter.getGoldenDir(this.getClass()), "ShowcaseWithEchoPackageInfo.golden"); Assert.assertCodeEquals(goldenFilePath, visitor.write()); } + + @Test + void testGeneratePackageInfo_noServices_returnsNullPackageInfo() { + assertNull(ClientLibraryPackageInfoComposer.generatePackageInfo(GapicContext.EMPTY)); + } } diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/ClientLibraryReflectConfigComposerTest.java b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/ClientLibraryReflectConfigComposerTest.java new file mode 100644 index 0000000000..31d3f7a578 --- /dev/null +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/ClientLibraryReflectConfigComposerTest.java @@ -0,0 +1,147 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.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.google.api.generator.gapic.composer; + +import static com.google.common.truth.Truth.assertThat; +import static java.util.stream.Collectors.toList; +import static org.junit.Assert.assertEquals; + +import com.google.api.generator.engine.ast.TypeNode; +import com.google.api.generator.gapic.model.GapicContext; +import com.google.api.generator.gapic.model.Message; +import com.google.api.generator.gapic.model.ReflectConfig; +import com.google.api.generator.test.protoloader.TestProtoLoader; +import java.util.Arrays; +import java.util.Collections; +import java.util.List; +import org.junit.jupiter.api.Test; + +class ClientLibraryReflectConfigComposerTest { + + private final Message.Builder testMessageBuilder = + Message.builder() + .setName("MESSAGE_NAME") + .setFullProtoName("com.google.test.TestMessage") + .setType(TypeNode.OBJECT); + + @Test + void composeReflectConfigs_showcase() { + final GapicContext context = TestProtoLoader.instance().parseShowcaseEcho(); + List configs = Composer.composeNativeReflectConfig(context); + assertThat(configs).isNotEmpty(); + + List configClassNames = configs.stream().map(ReflectConfig::getName).collect(toList()); + assertThat(configClassNames).containsNoDuplicates(); + assertThat(configClassNames).isInOrder(); + assertThat(configClassNames) + .containsExactly( + "com.google.showcase.v1beta1.BlockRequest", + "com.google.showcase.v1beta1.BlockRequest$Builder", + "com.google.showcase.v1beta1.BlockResponse", + "com.google.showcase.v1beta1.BlockResponse$Builder", + "com.google.showcase.v1beta1.EchoRequest", + "com.google.showcase.v1beta1.EchoRequest$Builder", + "com.google.showcase.v1beta1.EchoResponse", + "com.google.showcase.v1beta1.EchoResponse$Builder", + "com.google.showcase.v1beta1.ExpandRequest", + "com.google.showcase.v1beta1.ExpandRequest$Builder", + "com.google.showcase.v1beta1.Foobar", + "com.google.showcase.v1beta1.Foobar$Builder", + "com.google.showcase.v1beta1.Object", + "com.google.showcase.v1beta1.Object$Builder", + "com.google.showcase.v1beta1.PagedExpandLegacyRequest", + "com.google.showcase.v1beta1.PagedExpandLegacyRequest$Builder", + "com.google.showcase.v1beta1.PagedExpandRequest", + "com.google.showcase.v1beta1.PagedExpandRequest$Builder", + "com.google.showcase.v1beta1.PagedExpandResponse", + "com.google.showcase.v1beta1.PagedExpandResponse$Builder", + "com.google.showcase.v1beta1.Severity", + "com.google.showcase.v1beta1.WaitMetadata", + "com.google.showcase.v1beta1.WaitMetadata$Builder", + "com.google.showcase.v1beta1.WaitRequest", + "com.google.showcase.v1beta1.WaitRequest$Builder", + "com.google.showcase.v1beta1.WaitResponse", + "com.google.showcase.v1beta1.WaitResponse$Builder"); + } + + @Test + void composeReflectConfigs_SimpleMessage() { + List entries = + ClientLibraryReflectConfigComposer.calculateReflectConfigList( + "foo.Bar", testMessageBuilder.build()); + + assertThat(entries).hasSize(2); + assertThat(entries).containsExactly("foo.Bar", "foo.Bar$Builder"); + } + + @Test + void composeReflectConfigs_Enum() { + List entries = + ClientLibraryReflectConfigComposer.calculateReflectConfigList( + "e.Num", + testMessageBuilder.setEnumValues(Collections.singletonMap("value", 0)).build()); + + assertThat(entries).hasSize(1); + assertThat(entries).containsExactly("e.Num"); + } + + @Test + void composeReflectConfigs_NestedEnums() { + List nestedEnums = Arrays.asList("NestedEnum1", "NestedEnum2"); + List entries = + ClientLibraryReflectConfigComposer.calculateReflectConfigList( + "message.withNestedEnums", testMessageBuilder.setNestedEnums(nestedEnums).build()); + + assertThat(entries).hasSize(4); + assertThat(entries) + .containsExactly( + "message.withNestedEnums", + "message.withNestedEnums$Builder", + "message.withNestedEnums$NestedEnum1", + "message.withNestedEnums$NestedEnum2"); + } + + @Test + void formatNestedClassFullyQualifiedNames_noNested() { + assertEquals("a.B", ClientLibraryReflectConfigComposer.convertToBinaryName("a.B")); + assertEquals("aa.bb.CC", ClientLibraryReflectConfigComposer.convertToBinaryName("aa.bb.CC")); + } + + @Test + void formatNestedClassFullyQualifiedNames_oneNested() { + assertEquals("a.B$C", ClientLibraryReflectConfigComposer.convertToBinaryName("a.B.C")); + assertEquals( + "aa.bb.Cc$Dd", ClientLibraryReflectConfigComposer.convertToBinaryName("aa.bb.Cc.Dd")); + } + + @Test + void formatNestedClassFullyQualifiedNames_twoNested() { + assertEquals("a.B$C$D", ClientLibraryReflectConfigComposer.convertToBinaryName("a.B.C.D")); + assertEquals( + "aa.bb.Cc$Dd$Ee", ClientLibraryReflectConfigComposer.convertToBinaryName("aa.bb.Cc.Dd.Ee")); + } + + @Test + void duplicateEntries_found() { + assertThat(ClientLibraryReflectConfigComposer.calculateDuplicates(Arrays.asList("a", "a", "b"))) + .containsExactly("a"); + + assertThat(ClientLibraryReflectConfigComposer.calculateDuplicates(Arrays.asList("a", "a", "a"))) + .containsExactly("a", "a"); + + assertThat(ClientLibraryReflectConfigComposer.calculateDuplicates(Arrays.asList("a", "b"))) + .isEmpty(); + } +} diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/ComposerTest.java b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/ComposerTest.java index d99325fbe8..ad370307c1 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/ComposerTest.java +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/ComposerTest.java @@ -14,15 +14,16 @@ package com.google.api.generator.gapic.composer; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertFalse; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertNull; +import static org.junit.jupiter.api.Assertions.assertTrue; import com.google.api.generator.engine.ast.ClassDefinition; import com.google.api.generator.engine.ast.ScopeNode; import com.google.api.generator.engine.writer.JavaWriterVisitor; import com.google.api.generator.gapic.composer.comment.CommentComposer; import com.google.api.generator.gapic.composer.grpc.GrpcServiceCallableFactoryClassComposer; -import com.google.api.generator.gapic.composer.grpc.GrpcTestProtoLoader; import com.google.api.generator.gapic.model.GapicClass; import com.google.api.generator.gapic.model.GapicClass.Kind; import com.google.api.generator.gapic.model.GapicContext; @@ -30,14 +31,16 @@ import com.google.api.generator.gapic.model.Sample; import com.google.api.generator.gapic.model.Service; import com.google.api.generator.test.framework.Assert; -import com.google.api.generator.test.framework.Utils; +import com.google.api.generator.test.framework.GoldenFileWriter; +import com.google.api.generator.test.protoloader.GrpcTestProtoLoader; import java.nio.file.Path; import java.nio.file.Paths; import java.util.Arrays; import java.util.List; -import org.junit.Test; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; -public class ComposerTest { +class ComposerTest { private final GapicContext context = GrpcTestProtoLoader.instance().parseShowcaseEcho(); private final Service echoProtoService = context.services().get(0); private final List clazzes = @@ -45,7 +48,7 @@ public class ComposerTest { GrpcServiceCallableFactoryClassComposer.instance() .generate(context, echoProtoService) .withApiShortName(echoProtoService.apiShortName()) - .withApiVersion(echoProtoService.apiVersion())); + .withPackageVersion(echoProtoService.packageVersion())); private final Sample sample = Sample.builder() .setRegionTag( @@ -53,8 +56,13 @@ public class ComposerTest { .build(); private List ListofSamples = Arrays.asList(new Sample[] {sample}); + @BeforeEach + void initialSanityCheck() { + assertTrue(context.containsServices()); + } + @Test - public void gapicClass_addApacheLicense() { + public void gapicClass_addApacheLicense_validInput_succeeds() { ClassDefinition classDef = ClassDefinition.builder() .setPackageString("com.google.showcase.v1beta1.stub") @@ -65,14 +73,16 @@ public void gapicClass_addApacheLicense() { Composer.addApacheLicense(Arrays.asList(GapicClass.create(Kind.TEST, classDef))); JavaWriterVisitor visitor = new JavaWriterVisitor(); gapicClassWithHeaderList.get(0).classDefinition().accept(visitor); - Utils.saveCodegenToFile(this.getClass(), "ComposerPostProcOnFooBar.golden", visitor.write()); + GoldenFileWriter.saveCodegenToFile( + this.getClass(), "ComposerPostProcOnFooBar.golden", visitor.write()); Path goldenFilePath = - Paths.get(Utils.getGoldenDir(this.getClass()), "ComposerPostProcOnFooBar.golden"); + Paths.get( + GoldenFileWriter.getGoldenDir(this.getClass()), "ComposerPostProcOnFooBar.golden"); Assert.assertCodeEquals(goldenFilePath, visitor.write()); } @Test - public void composeSamples_showcase() { + void composeSamples_showcase() { GapicClass testClass = clazzes.get(0).withSamples(ListofSamples); List testClassList = Arrays.asList(new GapicClass[] {testClass}); @@ -82,19 +92,19 @@ public void composeSamples_showcase() { assertFalse(composedSamples.isEmpty()); for (Sample sample : composedSamples) { assertEquals( - "File header should be APACHE", Arrays.asList(CommentComposer.APACHE_LICENSE_COMMENT), - sample.fileHeader()); + sample.fileHeader(), + "File header should be APACHE"); assertEquals( - "ApiShortName should be Localhost7469", "Localhost7469", - sample.regionTag().apiShortName()); - assertEquals("ApiVersion should be V1Beta1", "V1Beta1", sample.regionTag().apiVersion()); + sample.regionTag().apiShortName(), + "ApiShortName should be Localhost7469"); + assertEquals("V1Beta1", sample.regionTag().apiVersion(), "ApiVersion should be V1Beta1"); } } @Test - public void gapicClass_addRegionTagAndHeaderToSample() { + void gapicClass_addRegionTagAndHeaderToSample() { Sample testSample; testSample = Composer.addRegionTagAndHeaderToSample(sample, "showcase", "v1"); assertEquals("Showcase", testSample.regionTag().apiShortName()); @@ -103,7 +113,7 @@ public void gapicClass_addRegionTagAndHeaderToSample() { } @Test - public void composeSamples_parseProtoPackage() { + void composeSamples_parseProtoPackage() { String defaultHost = "accessapproval.googleapis.com:443"; String protoPack = "google.cloud.accessapproval.v1"; @@ -118,10 +128,10 @@ public void composeSamples_parseProtoPackage() { for (Sample sample : composedSamples) { assertEquals( - "ApiShortName should be Accessapproval", + "Accessapproval", sample.regionTag().apiShortName(), - "Accessapproval"); - assertEquals("ApiVersion should be V1", sample.regionTag().apiVersion(), "V1"); + "ApiShortName should be Accessapproval"); + assertEquals("V1", sample.regionTag().apiVersion(), "ApiVersion should be V1"); } protoPack = "google.cloud.vision.v1p1beta1"; @@ -134,8 +144,8 @@ public void composeSamples_parseProtoPackage() { assertFalse(composedSamples.isEmpty()); for (Sample sample : composedSamples) { - assertEquals("ApiShortName should be Vision", sample.regionTag().apiShortName(), "Vision"); - assertEquals("ApiVersion should be V1P1Beta1", sample.regionTag().apiVersion(), "V1P1Beta1"); + assertEquals("Vision", sample.regionTag().apiShortName(), "ApiShortName should be Vision"); + assertEquals("V1P1Beta1", sample.regionTag().apiVersion(), "ApiVersion should be V1P1Beta1"); } protoPack = "google.cloud.vision"; @@ -147,18 +157,28 @@ public void composeSamples_parseProtoPackage() { assertFalse(composedSamples.isEmpty()); for (Sample sample : composedSamples) { - assertEquals("ApiShortName should be Vision", sample.regionTag().apiShortName(), "Vision"); - assertEquals("ApiVersion should be empty", sample.regionTag().apiVersion(), ""); + assertEquals("Vision", sample.regionTag().apiShortName(), "ApiShortName should be Vision"); + assertTrue(sample.regionTag().apiVersion().isEmpty(), "ApiVersion should be empty"); } } + @Test + void testEmptyGapicContext_doesNotThrow() { + assertTrue(Composer.composeServiceClasses(GapicContext.EMPTY).isEmpty()); + } + + @Test + void testComposePackageInfo_emptyGapicContext_returnsNull() { + assertNull(Composer.composePackageInfo(GapicContext.EMPTY)); + } + private List getTestClassListFromService(Service testService) { GapicClass testClass = GrpcServiceCallableFactoryClassComposer.instance() .generate(context, testService) .withSamples(ListofSamples) .withApiShortName(testService.apiShortName()) - .withApiVersion(testService.apiVersion()); + .withPackageVersion(testService.packageVersion()); List testClassList = Arrays.asList(new GapicClass[] {testClass}); return testClassList; } diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/LibraryVersionClassComposerTest.java b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/LibraryVersionClassComposerTest.java new file mode 100644 index 0000000000..75c82b44eb --- /dev/null +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/LibraryVersionClassComposerTest.java @@ -0,0 +1,34 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.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.google.api.generator.gapic.composer; + +import com.google.api.generator.gapic.model.GapicClass; +import com.google.api.generator.gapic.model.GapicContext; +import com.google.api.generator.gapic.model.Service; +import com.google.api.generator.test.framework.Assert; +import com.google.api.generator.test.protoloader.GrpcTestProtoLoader; +import org.junit.Test; + +public class LibraryVersionClassComposerTest { + + @Test + public void generateVersionClasses() { + GapicContext context = GrpcTestProtoLoader.instance().parseShowcaseEcho(); + Service service = context.services().get(0); + GapicClass clazz = LibraryVersionClassComposer.instance().generate(context, service); + + Assert.assertGoldenClass(this.getClass(), clazz, "EchoVersion.golden"); + } +} diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/common/AbstractTransportServiceStubClassComposerTest.java b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/common/AbstractTransportServiceStubClassComposerTest.java new file mode 100644 index 0000000000..44f3b49beb --- /dev/null +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/common/AbstractTransportServiceStubClassComposerTest.java @@ -0,0 +1,529 @@ +/* + * Copyright 2024 Google LLC + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Google LLC nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +package com.google.api.generator.gapic.composer.common; + +import static com.google.api.generator.gapic.composer.common.AbstractTransportServiceStubClassComposer.shouldGenerateRequestMutator; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertTrue; + +import com.google.api.FieldInfo.Format; +import com.google.api.generator.engine.ast.LambdaExpr; +import com.google.api.generator.engine.ast.Reference; +import com.google.api.generator.engine.ast.Statement; +import com.google.api.generator.engine.ast.TypeNode; +import com.google.api.generator.engine.ast.VaporReference; +import com.google.api.generator.engine.ast.Variable; +import com.google.api.generator.engine.ast.VariableExpr; +import com.google.api.generator.engine.writer.JavaWriterVisitor; +import com.google.api.generator.gapic.model.Field; +import com.google.api.generator.gapic.model.Message; +import com.google.api.generator.gapic.model.Method; +import com.google.api.generator.test.utils.LineFormatter; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.List; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; + +class AbstractTransportServiceStubClassComposerTest { + private JavaWriterVisitor writerVisitor; + + @BeforeEach + void setUp() { + writerVisitor = new JavaWriterVisitor(); + } + + @Test + void shouldGenerateRequestMutator_fieldConfiguredCorrectly() { + String ECHO_PACKAGE = "com.google.showcase.v1beta1"; + List autoPopulatedFieldList = new ArrayList<>(); + autoPopulatedFieldList.add("TestField"); + + Method METHOD = + Method.builder() + .setName("TestMethod") + .setInputType( + TypeNode.withReference( + VaporReference.builder() + .setName("SampleRequest") + .setPakkage(ECHO_PACKAGE) + .build())) + .setOutputType(TypeNode.STRING) + .setAutoPopulatedFields(autoPopulatedFieldList) + .build(); + + Field FIELD = + Field.builder() + .setName("TestField") + .setFieldInfoFormat(Format.UUID4) + .setType(TypeNode.STRING) + .build(); + List fieldList = new ArrayList<>(); + fieldList.add(FIELD); + + Message MESSAGE = + Message.builder() + .setFullProtoName("com.google.showcase.v1beta1.SampleRequest") + .setName("SampleRequest") + .setType(TypeNode.STRING) + .setFields(fieldList) + .build(); + + ImmutableMap messageTypes = + ImmutableMap.of("com.google.showcase.v1beta1.SampleRequest", MESSAGE); + + assertTrue(shouldGenerateRequestMutator(METHOD, messageTypes)); + } + + @Test + void shouldNotGenerateRequestMutator_fieldConfiguredIncorrectly() { + String ECHO_PACKAGE = "com.google.showcase.v1beta1"; + List autoPopulatedFieldList = new ArrayList<>(); + autoPopulatedFieldList.add("TestField"); + + Method METHOD = + Method.builder() + .setName("TestMethod") + .setInputType( + TypeNode.withReference( + VaporReference.builder() + .setName("SampleRequest") + .setPakkage(ECHO_PACKAGE) + .build())) + .setOutputType(TypeNode.STRING) + .setAutoPopulatedFields(autoPopulatedFieldList) + .build(); + + Field FIELD = + Field.builder() + .setName("TestField") + .setFieldInfoFormat(Format.IPV6) + .setType(TypeNode.STRING) + .build(); + List fieldList = new ArrayList<>(); + fieldList.add(FIELD); + + Message MESSAGE = + Message.builder() + .setFullProtoName("com.google.showcase.v1beta1.SampleRequest") + .setName("SampleRequest") + .setType(TypeNode.STRING) + .setFields(fieldList) + .build(); + + ImmutableMap messageTypes = + ImmutableMap.of("com.google.showcase.v1beta1.SampleRequest", MESSAGE); + + assertFalse(shouldGenerateRequestMutator(METHOD, messageTypes)); + } + + // TODO: add unit tests where the field is not found in the messageTypes map + @Test + void createAutoPopulatedRequestStatement_sampleField() { + Reference RequestBuilderRef = + VaporReference.builder() + .setName("EchoRequest") + .setPakkage("com.google.example.examples.library.v1") + .build(); + + TypeNode testType = TypeNode.withReference(RequestBuilderRef); + + Method METHOD = + Method.builder() + .setName("TestMethod") + .setInputType(testType) + .setOutputType(TypeNode.STRING) + .build(); + + Reference RequestVarBuilderRef = + VaporReference.builder() + .setEnclosingClassNames(METHOD.inputType().reference().name()) + .setName("Builder") + .setPakkage(METHOD.inputType().reference().pakkage()) + .build(); + + TypeNode requestBuilderType = TypeNode.withReference(RequestVarBuilderRef); + + VariableExpr requestBuilderVarExpr = + VariableExpr.builder() + .setVariable( + Variable.builder().setName("requestBuilder").setType(requestBuilderType).build()) + .setIsDecl(false) + .build(); + + Statement autoPopulatedFieldStatement = + AbstractTransportServiceStubClassComposer.createAutoPopulatedRequestStatement( + METHOD, "sampleField", requestBuilderVarExpr); + + autoPopulatedFieldStatement.accept(writerVisitor); + String expected = + LineFormatter.lines( + "if (Strings.isNullOrEmpty(request.getSampleField())) {\n", + "requestBuilder.setSampleField(UUID.randomUUID().toString());\n", + "}\n"); + assertEquals(expected, writerVisitor.write()); + } + + @Test + void createRequestMutatorBody_TestField() { + List bodyStatements = new ArrayList<>(); + String ECHO_PACKAGE = "com.google.showcase.v1beta1"; + List autoPopulatedFieldList = new ArrayList<>(); + autoPopulatedFieldList.add("TestField"); + + Method METHOD = + Method.builder() + .setName("TestMethod") + .setInputType( + TypeNode.withReference( + VaporReference.builder() + .setName("SampleRequest") + .setPakkage(ECHO_PACKAGE) + .build())) + .setOutputType(TypeNode.STRING) + .setAutoPopulatedFields(autoPopulatedFieldList) + .build(); + + Field FIELD = + Field.builder() + .setName("TestField") + .setFieldInfoFormat(Format.UUID4) + .setType(TypeNode.STRING) + .build(); + List fieldList = new ArrayList<>(); + fieldList.add(FIELD); + + Message MESSAGE = + Message.builder() + .setFullProtoName("com.google.showcase.v1beta1.SampleRequest") + .setName("SampleRequest") + .setType(TypeNode.STRING) + .setFields(fieldList) + .build(); + + Reference RequestBuilderRef = + VaporReference.builder() + .setEnclosingClassNames(METHOD.inputType().reference().name()) + .setName("Builder") + .setPakkage(METHOD.inputType().reference().pakkage()) + .build(); + + TypeNode requestBuilderType = TypeNode.withReference(RequestBuilderRef); + + VariableExpr requestBuilderVarExpr = + VariableExpr.builder() + .setVariable( + Variable.builder().setName("requestBuilder").setType(requestBuilderType).build()) + .setIsDecl(false) + .build(); + + ImmutableMap messageTypes = + ImmutableMap.of("com.google.showcase.v1beta1.SampleRequest", MESSAGE); + + List listOfAutoPopulatedStatements = + AbstractTransportServiceStubClassComposer.createRequestMutatorBody( + METHOD, messageTypes, bodyStatements, requestBuilderVarExpr); + + for (Statement statement : listOfAutoPopulatedStatements) { + statement.accept(writerVisitor); + } + + String expected = + LineFormatter.lines( + "if (Strings.isNullOrEmpty(request.getTestField())) {\n", + "requestBuilder.setTestField(UUID.randomUUID().toString());\n", + "}\n"); + assertEquals(expected, writerVisitor.write()); + } + + @Test + void createRequestMutatorBody_TestFieldNotString_shouldReturnNull() { + List bodyStatements = new ArrayList<>(); + + String ECHO_PACKAGE = "com.google.showcase.v1beta1"; + List autoPopulatedFieldList = new ArrayList<>(); + autoPopulatedFieldList.add("TestField"); + + Method METHOD = + Method.builder() + .setName("TestMethod") + .setInputType( + TypeNode.withReference( + VaporReference.builder() + .setName("SampleRequest") + .setPakkage(ECHO_PACKAGE) + .build())) + .setOutputType(TypeNode.STRING) + .setAutoPopulatedFields(autoPopulatedFieldList) + .build(); + + Field FIELD = + Field.builder() + .setName("TestField") + .setFieldInfoFormat(Format.UUID4) + .setType(TypeNode.BOOLEAN) + .build(); + List fieldList = new ArrayList<>(); + fieldList.add(FIELD); + + Message MESSAGE = + Message.builder() + .setFullProtoName("com.google.showcase.v1beta1.SampleRequest") + .setName("SampleRequest") + .setType(TypeNode.STRING) + .setFields(fieldList) + .build(); + + Reference RequestBuilderRef = + VaporReference.builder() + .setEnclosingClassNames(METHOD.inputType().reference().name()) + .setName("Builder") + .setPakkage(METHOD.inputType().reference().pakkage()) + .build(); + + TypeNode requestBuilderType = TypeNode.withReference(RequestBuilderRef); + + VariableExpr requestBuilderVarExpr = + VariableExpr.builder() + .setVariable( + Variable.builder().setName("requestBuilder").setType(requestBuilderType).build()) + .setIsDecl(false) + .build(); + + ImmutableMap messageTypes = + ImmutableMap.of("com.google.showcase.v1beta1.SampleRequest", MESSAGE); + + List listOfAutoPopulatedStatements = + AbstractTransportServiceStubClassComposer.createRequestMutatorBody( + METHOD, messageTypes, bodyStatements, requestBuilderVarExpr); + + for (Statement statement : listOfAutoPopulatedStatements) { + statement.accept(writerVisitor); + } + + String expected = LineFormatter.lines(""); + assertEquals(expected, writerVisitor.write()); + } + + @Test + void createRequestMutatorBody_TestFieldFormatNotUUID_shouldReturnNull() { + List bodyStatements = new ArrayList<>(); + String ECHO_PACKAGE = "com.google.showcase.v1beta1"; + List autoPopulatedFieldList = new ArrayList<>(); + autoPopulatedFieldList.add("TestField"); + + Method METHOD = + Method.builder() + .setName("TestMethod") + .setInputType( + TypeNode.withReference( + VaporReference.builder() + .setName("SampleRequest") + .setPakkage(ECHO_PACKAGE) + .build())) + .setOutputType(TypeNode.STRING) + .setAutoPopulatedFields(autoPopulatedFieldList) + .build(); + + Field FIELD = + Field.builder() + .setName("TestField") + .setFieldInfoFormat(Format.IPV4_OR_IPV6) + .setType(TypeNode.STRING) + .build(); + List fieldList = new ArrayList<>(); + fieldList.add(FIELD); + + Message MESSAGE = + Message.builder() + .setFullProtoName("com.google.showcase.v1beta1.SampleRequest") + .setName("SampleRequest") + .setType(TypeNode.STRING) + .setFields(fieldList) + .build(); + + Reference RequestBuilderRef = + VaporReference.builder() + .setEnclosingClassNames(METHOD.inputType().reference().name()) + .setName("Builder") + .setPakkage(METHOD.inputType().reference().pakkage()) + .build(); + + TypeNode requestBuilderType = TypeNode.withReference(RequestBuilderRef); + + VariableExpr requestBuilderVarExpr = + VariableExpr.builder() + .setVariable( + Variable.builder().setName("requestBuilder").setType(requestBuilderType).build()) + .setIsDecl(false) + .build(); + + ImmutableMap messageTypes = + ImmutableMap.of("com.google.showcase.v1beta1.SampleRequest", MESSAGE); + + List listOfAutoPopulatedStatements = + AbstractTransportServiceStubClassComposer.createRequestMutatorBody( + METHOD, messageTypes, bodyStatements, requestBuilderVarExpr); + + for (Statement statement : listOfAutoPopulatedStatements) { + statement.accept(writerVisitor); + } + + String expected = LineFormatter.lines(""); + assertEquals(expected, writerVisitor.write()); + } + + @Test + void createRequestMutatorBody_TestFieldIncorrectName_shouldReturnNull() { + List bodyStatements = new ArrayList<>(); + String ECHO_PACKAGE = "com.google.showcase.v1beta1"; + List autoPopulatedFieldList = new ArrayList<>(); + autoPopulatedFieldList.add("TestField"); + + Method METHOD = + Method.builder() + .setName("TestMethod") + .setInputType( + TypeNode.withReference( + VaporReference.builder() + .setName("SampleRequest") + .setPakkage(ECHO_PACKAGE) + .build())) + .setOutputType(TypeNode.STRING) + .setAutoPopulatedFields(autoPopulatedFieldList) + .build(); + + Field FIELD = + Field.builder() + .setName("TestIncorrectField") + .setFieldInfoFormat(Format.UUID4) + .setType(TypeNode.STRING) + .build(); + List fieldList = new ArrayList<>(); + fieldList.add(FIELD); + + Message MESSAGE = + Message.builder() + .setFullProtoName("com.google.showcase.v1beta1.SampleRequest") + .setName("SampleRequest") + .setType(TypeNode.STRING) + .setFields(fieldList) + .build(); + + Reference RequestBuilderRef = + VaporReference.builder() + .setEnclosingClassNames(METHOD.inputType().reference().name()) + .setName("Builder") + .setPakkage(METHOD.inputType().reference().pakkage()) + .build(); + + TypeNode requestBuilderType = TypeNode.withReference(RequestBuilderRef); + + VariableExpr requestBuilderVarExpr = + VariableExpr.builder() + .setVariable( + Variable.builder().setName("requestBuilder").setType(requestBuilderType).build()) + .setIsDecl(false) + .build(); + + ImmutableMap messageTypes = + ImmutableMap.of("com.google.showcase.v1beta1.SampleRequest", MESSAGE); + + List listOfAutoPopulatedStatements = + AbstractTransportServiceStubClassComposer.createRequestMutatorBody( + METHOD, messageTypes, bodyStatements, requestBuilderVarExpr); + + for (Statement statement : listOfAutoPopulatedStatements) { + statement.accept(writerVisitor); + } + + String expected = LineFormatter.lines(""); + assertEquals(expected, writerVisitor.write()); + } + + @Test + void createRequestMutator_TestField() { + String ECHO_PACKAGE = "com.google.showcase.v1beta1"; + List autoPopulatedFieldList = new ArrayList<>(); + autoPopulatedFieldList.add("TestField"); + + Method METHOD = + Method.builder() + .setName("TestMethod") + .setInputType( + TypeNode.withReference( + VaporReference.builder() + .setName("SampleRequest") + .setPakkage(ECHO_PACKAGE) + .build())) + .setOutputType(TypeNode.STRING) + .setAutoPopulatedFields(autoPopulatedFieldList) + .build(); + + Field FIELD = + Field.builder() + .setName("TestField") + .setFieldInfoFormat(Format.UUID4) + .setType(TypeNode.STRING) + .build(); + List fieldList = new ArrayList<>(); + fieldList.add(FIELD); + + Message MESSAGE = + Message.builder() + .setFullProtoName("com.google.showcase.v1beta1.SampleRequest") + .setName("SampleRequest") + .setType(TypeNode.STRING) + .setFields(fieldList) + .build(); + + ImmutableMap messageTypes = + ImmutableMap.of("com.google.showcase.v1beta1.SampleRequest", MESSAGE); + + LambdaExpr requestMutator = + AbstractTransportServiceStubClassComposer.createRequestMutatorClassInstance( + METHOD, messageTypes); + + requestMutator.accept(writerVisitor); + + String expected = + LineFormatter.lines( + "request -> {\n", + "SampleRequest.Builder requestBuilder = request.toBuilder();\n", + "if (Strings.isNullOrEmpty(request.getTestField())) {\n", + "requestBuilder.setTestField(UUID.randomUUID().toString());\n", + "}\n", + "return requestBuilder.build();\n", + "}"); + assertEquals(expected, writerVisitor.write()); + } +} diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/common/BatchingDescriptorComposerTest.java b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/common/BatchingDescriptorComposerTest.java index a3cae5106c..ad13e0f45e 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/common/BatchingDescriptorComposerTest.java +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/common/BatchingDescriptorComposerTest.java @@ -29,7 +29,8 @@ import com.google.api.generator.gapic.protoparser.Parser; import com.google.api.generator.gapic.protoparser.ServiceConfigParser; import com.google.api.generator.test.framework.Assert; -import com.google.api.generator.test.framework.Utils; +import com.google.api.generator.test.framework.GoldenFileWriter; +import com.google.api.generator.test.protoloader.TestProtoLoader; import com.google.logging.v2.LogEntryProto; import com.google.logging.v2.LoggingConfigProto; import com.google.logging.v2.LoggingMetricsProto; @@ -47,19 +48,19 @@ import java.util.Map; import java.util.Optional; import java.util.Set; -import org.junit.Before; -import org.junit.Test; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; -public class BatchingDescriptorComposerTest { +class BatchingDescriptorComposerTest { private JavaWriterVisitor writerVisitor; - @Before - public void setUp() { + @BeforeEach + void setUp() { writerVisitor = new JavaWriterVisitor(); } @Test - public void batchingDescriptor_hasSubresponseField() { + void batchingDescriptor_hasSubresponseField() { FileDescriptor serviceFileDescriptor = PubsubProto.getDescriptor(); FileDescriptor commonResourcesFileDescriptor = CommonResources.getDescriptor(); ServiceDescriptor serviceDescriptor = serviceFileDescriptor.getServices().get(0); @@ -104,17 +105,17 @@ public void batchingDescriptor_hasSubresponseField() { method, batchingSetting, messageTypes); batchingDescriptorExpr.accept(writerVisitor); - Utils.saveCodegenToFile( + GoldenFileWriter.saveCodegenToFile( this.getClass(), "BatchingDescriptorComposerTestSubresponse.golden", writerVisitor.write()); Path goldenFilePath = Paths.get( - Utils.getGoldenDir(this.getClass()), + GoldenFileWriter.getGoldenDir(this.getClass()), "BatchingDescriptorComposerTestSubresponse.golden"); Assert.assertCodeEquals(goldenFilePath, writerVisitor.write()); } @Test - public void batchingDescriptor_noSubresponseField() { + void batchingDescriptor_noSubresponseField() { FileDescriptor serviceFileDescriptor = LoggingProto.getDescriptor(); ServiceDescriptor serviceDescriptor = serviceFileDescriptor.getServices().get(0); assertEquals(serviceDescriptor.getName(), "LoggingServiceV2"); @@ -166,13 +167,13 @@ public void batchingDescriptor_noSubresponseField() { method, batchingSetting, messageTypes); batchingDescriptorExpr.accept(writerVisitor); - Utils.saveCodegenToFile( + GoldenFileWriter.saveCodegenToFile( this.getClass(), "BatchingDescriptorComposerTestNoSubresponse.golden", writerVisitor.write()); Path goldenFilePath = Paths.get( - Utils.getGoldenDir(this.getClass()), + GoldenFileWriter.getGoldenDir(this.getClass()), "BatchingDescriptorComposerTestNoSubresponse.golden"); Assert.assertCodeEquals(goldenFilePath, writerVisitor.write()); } diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/common/RetrySettingsComposerTest.java b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/common/RetrySettingsComposerTest.java index 598f261f8a..775a0b1d09 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/common/RetrySettingsComposerTest.java +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/common/RetrySettingsComposerTest.java @@ -38,7 +38,8 @@ import com.google.api.generator.gapic.protoparser.BatchingSettingsConfigParser; import com.google.api.generator.gapic.protoparser.Parser; import com.google.api.generator.gapic.protoparser.ServiceConfigParser; -import com.google.api.generator.testutils.LineFormatter; +import com.google.api.generator.test.protoloader.TestProtoLoader; +import com.google.api.generator.test.utils.LineFormatter; import com.google.common.collect.ImmutableMap; import com.google.common.collect.ImmutableSet; import com.google.protobuf.Descriptors.FileDescriptor; @@ -52,10 +53,10 @@ import java.util.Optional; import java.util.Set; import java.util.stream.Collectors; -import org.junit.Before; -import org.junit.Test; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; -public class RetrySettingsComposerTest { +class RetrySettingsComposerTest { private static final VariableExpr RETRY_PARAM_DEFINITIONS_VAR_EXPR = createRetryParamDefinitionsVarExpr(); private static final VariableExpr RETRY_CODES_DEFINITIONS_VAR_EXPR = @@ -63,13 +64,13 @@ public class RetrySettingsComposerTest { private JavaWriterVisitor writerVisitor; - @Before - public void setUp() { + @BeforeEach + void setUp() { writerVisitor = new JavaWriterVisitor(); } @Test - public void paramDefinitionsBlock_noConfigsFound() { + void paramDefinitionsBlock_noConfigsFound() { GapicContext context = TestProtoLoader.instance().parseShowcaseEcho(); Service service = context.services().get(0); @@ -97,7 +98,7 @@ public void paramDefinitionsBlock_noConfigsFound() { } @Test - public void paramDefinitionsBlock_basic() { + void paramDefinitionsBlock_basic() { GapicContext context = TestProtoLoader.instance().parseShowcaseEcho(); Service service = context.services().get(0); @@ -118,20 +119,20 @@ public void paramDefinitionsBlock_basic() { "ImmutableMap.Builder definitions = ImmutableMap.builder();\n", "RetrySettings settings = null;\n", "settings =" - + " RetrySettings.newBuilder().setInitialRetryDelay(" + + " RetrySettings.newBuilder().setInitialRetryDelayDuration(" + "Duration.ofMillis(100L)).setRetryDelayMultiplier(2.0)" - + ".setMaxRetryDelay(Duration.ofMillis(3000L))" - + ".setInitialRpcTimeout(Duration.ofMillis(10000L))" + + ".setMaxRetryDelayDuration(Duration.ofMillis(3000L))" + + ".setInitialRpcTimeoutDuration(Duration.ofMillis(10000L))" + ".setRpcTimeoutMultiplier(1.0)" - + ".setMaxRpcTimeout(Duration.ofMillis(10000L))" - + ".setTotalTimeout(Duration.ofMillis(10000L)).build();\n", + + ".setMaxRpcTimeoutDuration(Duration.ofMillis(10000L))" + + ".setTotalTimeoutDuration(Duration.ofMillis(10000L)).build();\n", "definitions.put(\"retry_policy_1_params\", settings);\n", "settings =" + " RetrySettings.newBuilder()" - + ".setInitialRpcTimeout(Duration.ofMillis(5000L))" + + ".setInitialRpcTimeoutDuration(Duration.ofMillis(5000L))" + ".setRpcTimeoutMultiplier(1.0)" - + ".setMaxRpcTimeout(Duration.ofMillis(5000L))" - + ".setTotalTimeout(Duration.ofMillis(5000L)).build();\n", + + ".setMaxRpcTimeoutDuration(Duration.ofMillis(5000L))" + + ".setTotalTimeoutDuration(Duration.ofMillis(5000L)).build();\n", "definitions.put(\"no_retry_0_params\", settings);\n", "RETRY_PARAM_DEFINITIONS = definitions.build();\n", "}\n"); @@ -139,7 +140,7 @@ public void paramDefinitionsBlock_basic() { } @Test - public void codesDefinitionsBlock_noConfigsFound() { + void codesDefinitionsBlock_noConfigsFound() { FileDescriptor echoFileDescriptor = EchoOuterClass.getDescriptor(); Map messageTypes = Parser.parseMessages(echoFileDescriptor); Map resourceNames = Parser.parseResourceNames(echoFileDescriptor); @@ -175,7 +176,7 @@ public void codesDefinitionsBlock_noConfigsFound() { } @Test - public void codesDefinitionsBlock_basic() { + void codesDefinitionsBlock_basic() { FileDescriptor echoFileDescriptor = EchoOuterClass.getDescriptor(); Map messageTypes = Parser.parseMessages(echoFileDescriptor); Map resourceNames = Parser.parseResourceNames(echoFileDescriptor); @@ -214,7 +215,7 @@ public void codesDefinitionsBlock_basic() { } @Test - public void simpleBuilderExpr_basic() { + void simpleBuilderExpr_basic() { FileDescriptor echoFileDescriptor = EchoOuterClass.getDescriptor(); Map messageTypes = Parser.parseMessages(echoFileDescriptor); Map resourceNames = Parser.parseResourceNames(echoFileDescriptor); @@ -295,7 +296,7 @@ public void simpleBuilderExpr_basic() { } @Test - public void lroBuilderExpr() { + void lroBuilderExpr() { FileDescriptor echoFileDescriptor = EchoOuterClass.getDescriptor(); Map messageTypes = Parser.parseMessages(echoFileDescriptor); Map resourceNames = Parser.parseResourceNames(echoFileDescriptor); @@ -340,16 +341,16 @@ public void lroBuilderExpr() { + "WaitResponse.class))" + ".setMetadataTransformer(ProtoOperationTransformers.MetadataTransformer.create(" + "WaitMetadata.class)).setPollingAlgorithm(OperationTimedPollAlgorithm.create(" - + "RetrySettings.newBuilder().setInitialRetryDelay(Duration.ofMillis(5000L))" - + ".setRetryDelayMultiplier(1.5).setMaxRetryDelay(Duration.ofMillis(45000L))" - + ".setInitialRpcTimeout(Duration.ZERO).setRpcTimeoutMultiplier(1.0)" - + ".setMaxRpcTimeout(Duration.ZERO).setTotalTimeout(Duration.ofMillis(300000L))" + + "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()))"); assertEquals(expected, writerVisitor.write()); } @Test - public void batchingSettings_minimalFlowControlSettings() { + void batchingSettings_minimalFlowControlSettings() { String filename = "pubsub_gapic.yaml"; Path path = Paths.get(TestProtoLoader.instance().getTestFilesDirectory(), filename); Optional> batchingSettingsOpt = @@ -393,7 +394,7 @@ public void batchingSettings_minimalFlowControlSettings() { + "BatchingSettings.newBuilder()" + ".setElementCountThreshold(100L)" + ".setRequestByteThreshold(1048576L)" - + ".setDelayThreshold(Duration.ofMillis(10L))" + + ".setDelayThresholdDuration(Duration.ofMillis(10L))" + ".setFlowControlSettings(" + "FlowControlSettings.newBuilder()" + ".setLimitExceededBehavior(FlowController.LimitExceededBehavior.Ignore)" @@ -403,7 +404,7 @@ public void batchingSettings_minimalFlowControlSettings() { } @Test - public void batchingSettings_fullFlowControlSettings() { + void batchingSettings_fullFlowControlSettings() { String filename = "logging_gapic.yaml"; Path path = Paths.get(TestProtoLoader.instance().getTestFilesDirectory(), filename); Optional> batchingSettingsOpt = @@ -450,7 +451,7 @@ public void batchingSettings_fullFlowControlSettings() { + "BatchingSettings.newBuilder()" + ".setElementCountThreshold(1000L)" + ".setRequestByteThreshold(1048576L)" - + ".setDelayThreshold(Duration.ofMillis(50L))" + + ".setDelayThresholdDuration(Duration.ofMillis(50L))" + ".setFlowControlSettings(" + "FlowControlSettings.newBuilder()" + ".setMaxOutstandingElementCount(100000L)" diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/common/TestProtoLoader.java b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/common/TestProtoLoader.java deleted file mode 100644 index 4df5052b6b..0000000000 --- a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/common/TestProtoLoader.java +++ /dev/null @@ -1,367 +0,0 @@ -// Copyright 2021 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package com.google.api.generator.gapic.composer.common; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertTrue; - -import com.google.api.generator.gapic.model.GapicBatchingSettings; -import com.google.api.generator.gapic.model.GapicContext; -import com.google.api.generator.gapic.model.GapicServiceConfig; -import com.google.api.generator.gapic.model.Message; -import com.google.api.generator.gapic.model.ResourceName; -import com.google.api.generator.gapic.model.Service; -import com.google.api.generator.gapic.model.Transport; -import com.google.api.generator.gapic.protoparser.BatchingSettingsConfigParser; -import com.google.api.generator.gapic.protoparser.Parser; -import com.google.api.generator.gapic.protoparser.ServiceConfigParser; -import com.google.bookshop.v1beta1.BookshopProto; -import com.google.explicit.dynamic.routing.header.ExplicitDynamicRoutingHeaderTestingOuterClass; -import com.google.logging.v2.LogEntryProto; -import com.google.logging.v2.LoggingConfigProto; -import com.google.logging.v2.LoggingMetricsProto; -import com.google.logging.v2.LoggingProto; -import com.google.protobuf.Descriptors.FileDescriptor; -import com.google.protobuf.Descriptors.ServiceDescriptor; -import com.google.pubsub.v1.PubsubProto; -import com.google.showcase.v1beta1.EchoOuterClass; -import com.google.showcase.v1beta1.IdentityOuterClass; -import com.google.showcase.v1beta1.MessagingOuterClass; -import com.google.showcase.v1beta1.TestingOuterClass; -import com.google.testdata.v1.DeprecatedServiceOuterClass; -import google.cloud.CommonResources; -import java.nio.file.Path; -import java.nio.file.Paths; -import java.util.Arrays; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Optional; -import java.util.Set; -import java.util.stream.Collectors; - -public class TestProtoLoader { - - private static final TestProtoLoader INSTANCE = - new TestProtoLoader(Transport.GRPC, "src/test/resources/"); - private static final String ECHO_SERVICE_DESCRIPTION = - "This service is used showcase the four main types of rpcs - unary, server\n" - + " side streaming, client side streaming, and bidirectional streaming. This\n" - + " service also exposes methods that explicitly implement server delay, and\n" - + " paginated calls. Set the 'showcase-trailer' metadata key on any method\n" - + " to have the values echoed in the response trailers."; - private final String testFilesDirectory; - private final Transport transport; - - protected TestProtoLoader(Transport transport, String testFilesDirectory) { - this.testFilesDirectory = testFilesDirectory; - this.transport = transport; - } - - public static TestProtoLoader instance() { - return INSTANCE; - } - - public GapicContext parseDeprecatedService() { - FileDescriptor fileDescriptor = DeprecatedServiceOuterClass.getDescriptor(); - ServiceDescriptor serviceDescriptor = fileDescriptor.getServices().get(0); - assertEquals(serviceDescriptor.getName(), "DeprecatedService"); - - Map messageTypes = Parser.parseMessages(fileDescriptor); - Map resourceNames = new HashMap<>(); - Set outputResourceNames = new HashSet<>(); - List services = - Parser.parseService( - fileDescriptor, messageTypes, resourceNames, Optional.empty(), outputResourceNames); - - String jsonFilename = "deprecated_service_grpc_service_config.json"; - Path jsonPath = Paths.get(testFilesDirectory, jsonFilename); - Optional configOpt = ServiceConfigParser.parse(jsonPath.toString()); - assertTrue(configOpt.isPresent()); - GapicServiceConfig config = configOpt.get(); - - return GapicContext.builder() - .setMessages(messageTypes) - .setResourceNames(resourceNames) - .setServices(services) - .setServiceConfig(config) - .setHelperResourceNames(outputResourceNames) - .setTransport(transport) - .build(); - } - - public GapicContext parseBookshopService() { - FileDescriptor fileDescriptor = BookshopProto.getDescriptor(); - ServiceDescriptor serviceDescriptor = fileDescriptor.getServices().get(0); - assertEquals(serviceDescriptor.getName(), "Bookshop"); - - Map messageTypes = Parser.parseMessages(fileDescriptor); - Map resourceNames = new HashMap<>(); - Set outputResourceNames = new HashSet<>(); - List services = - Parser.parseService( - fileDescriptor, messageTypes, resourceNames, Optional.empty(), outputResourceNames); - - String jsonFilename = "bookshop_grpc_service_config.json"; - Path jsonPath = Paths.get(testFilesDirectory, jsonFilename); - Optional configOpt = ServiceConfigParser.parse(jsonPath.toString()); - assertTrue(configOpt.isPresent()); - GapicServiceConfig config = configOpt.get(); - - return GapicContext.builder() - .setMessages(messageTypes) - .setResourceNames(resourceNames) - .setServices(services) - .setServiceConfig(config) - .setHelperResourceNames(outputResourceNames) - .setTransport(transport) - .build(); - } - - public GapicContext parseShowcaseEcho() { - FileDescriptor echoFileDescriptor = EchoOuterClass.getDescriptor(); - ServiceDescriptor echoServiceDescriptor = echoFileDescriptor.getServices().get(0); - assertEquals(echoServiceDescriptor.getName(), "Echo"); - - Map messageTypes = Parser.parseMessages(echoFileDescriptor); - Map resourceNames = Parser.parseResourceNames(echoFileDescriptor); - Set outputResourceNames = new HashSet<>(); - List services = - Parser.parseService( - echoFileDescriptor, messageTypes, resourceNames, Optional.empty(), outputResourceNames); - - // Explicitly adds service description, since this is not parsed from source code location - // in test protos, as it would from a protoc CodeGeneratorRequest - List servicesWithDescription = - services.stream() - .map(s -> s.toBuilder().setDescription(ECHO_SERVICE_DESCRIPTION).build()) - .collect(Collectors.toList()); - - String jsonFilename = "showcase_grpc_service_config.json"; - Path jsonPath = Paths.get(testFilesDirectory, jsonFilename); - Optional configOpt = ServiceConfigParser.parse(jsonPath.toString()); - assertTrue(configOpt.isPresent()); - GapicServiceConfig config = configOpt.get(); - - return GapicContext.builder() - .setMessages(messageTypes) - .setResourceNames(resourceNames) - .setServices(servicesWithDescription) - .setServiceConfig(config) - .setHelperResourceNames(outputResourceNames) - .setTransport(transport) - .build(); - } - - public GapicContext parseShowcaseIdentity() { - FileDescriptor fileDescriptor = IdentityOuterClass.getDescriptor(); - ServiceDescriptor identityService = fileDescriptor.getServices().get(0); - assertEquals(identityService.getName(), "Identity"); - - Map messageTypes = Parser.parseMessages(fileDescriptor); - Map resourceNames = Parser.parseResourceNames(fileDescriptor); - Set outputResourceNames = new HashSet<>(); - List services = - Parser.parseService( - fileDescriptor, messageTypes, resourceNames, Optional.empty(), outputResourceNames); - - return GapicContext.builder() - .setMessages(messageTypes) - .setResourceNames(resourceNames) - .setServices(services) - .setHelperResourceNames(outputResourceNames) - .setTransport(transport) - .build(); - } - - public GapicContext parseShowcaseMessaging() { - FileDescriptor fileDescriptor = MessagingOuterClass.getDescriptor(); - ServiceDescriptor messagingService = fileDescriptor.getServices().get(0); - assertEquals(messagingService.getName(), "Messaging"); - - Map messageTypes = Parser.parseMessages(fileDescriptor); - Map resourceNames = Parser.parseResourceNames(fileDescriptor); - Set outputResourceNames = new HashSet<>(); - List services = - Parser.parseService( - fileDescriptor, messageTypes, resourceNames, Optional.empty(), outputResourceNames); - - return GapicContext.builder() - .setMessages(messageTypes) - .setResourceNames(resourceNames) - .setServices(services) - .setHelperResourceNames(outputResourceNames) - .setTransport(transport) - .build(); - } - - public GapicContext parseShowcaseTesting() { - FileDescriptor testingFileDescriptor = TestingOuterClass.getDescriptor(); - ServiceDescriptor testingService = testingFileDescriptor.getServices().get(0); - assertEquals(testingService.getName(), "Testing"); - - Map messageTypes = Parser.parseMessages(testingFileDescriptor); - Map resourceNames = Parser.parseResourceNames(testingFileDescriptor); - Set outputResourceNames = new HashSet<>(); - List services = - Parser.parseService( - testingFileDescriptor, - messageTypes, - resourceNames, - Optional.empty(), - outputResourceNames); - - return GapicContext.builder() - .setMessages(messageTypes) - .setResourceNames(resourceNames) - .setServices(services) - .setHelperResourceNames(outputResourceNames) - .setTransport(transport) - .build(); - } - - public GapicContext parseExplicitDynamicRoutingHeaderTesting() { - FileDescriptor testingFileDescriptor = - ExplicitDynamicRoutingHeaderTestingOuterClass.getDescriptor(); - ServiceDescriptor testingService = testingFileDescriptor.getServices().get(0); - assertEquals(testingService.getName(), "ExplicitDynamicRoutingHeaderTesting"); - - Map messageTypes = Parser.parseMessages(testingFileDescriptor); - Map resourceNames = Parser.parseResourceNames(testingFileDescriptor); - Set outputResourceNames = new HashSet<>(); - List services = - Parser.parseService( - testingFileDescriptor, - messageTypes, - resourceNames, - Optional.empty(), - outputResourceNames); - - return GapicContext.builder() - .setMessages(messageTypes) - .setResourceNames(resourceNames) - .setServices(services) - .setHelperResourceNames(outputResourceNames) - .setTransport(transport) - .build(); - } - - public GapicContext parsePubSubPublisher() { - FileDescriptor serviceFileDescriptor = PubsubProto.getDescriptor(); - FileDescriptor commonResourcesFileDescriptor = CommonResources.getDescriptor(); - ServiceDescriptor serviceDescriptor = serviceFileDescriptor.getServices().get(0); - assertEquals("Publisher", serviceDescriptor.getName()); - - Map resourceNames = new HashMap<>(); - resourceNames.putAll(Parser.parseResourceNames(serviceFileDescriptor)); - resourceNames.putAll(Parser.parseResourceNames(commonResourcesFileDescriptor)); - Map messageTypes = Parser.parseMessages(serviceFileDescriptor); - - Set outputResourceNames = new HashSet<>(); - List services = - Parser.parseService( - serviceFileDescriptor, - messageTypes, - resourceNames, - Optional.empty(), - outputResourceNames); - - String filename = "pubsub_gapic.yaml"; - Path path = Paths.get(getTestFilesDirectory(), filename); - Optional> batchingSettingsOpt = - BatchingSettingsConfigParser.parse(Optional.of(path.toString())); - assertTrue(batchingSettingsOpt.isPresent()); - - String jsonFilename = "pubsub_grpc_service_config.json"; - Path jsonPath = Paths.get(getTestFilesDirectory(), jsonFilename); - Optional configOpt = ServiceConfigParser.parse(jsonPath.toString()); - assertTrue(configOpt.isPresent()); - GapicServiceConfig config = configOpt.get(); - config.setBatchingSettings(batchingSettingsOpt); - - return GapicContext.builder() - .setMessages(messageTypes) - .setResourceNames(resourceNames) - .setServices(services) - .setServiceConfig(config) - .setHelperResourceNames(outputResourceNames) - .setTransport(transport) - .build(); - } - - public GapicContext parseLogging() { - FileDescriptor serviceFileDescriptor = LoggingProto.getDescriptor(); - ServiceDescriptor serviceDescriptor = serviceFileDescriptor.getServices().get(0); - assertEquals(serviceDescriptor.getName(), "LoggingServiceV2"); - - List protoFiles = - Arrays.asList( - serviceFileDescriptor, - LogEntryProto.getDescriptor(), - LoggingConfigProto.getDescriptor(), - LoggingMetricsProto.getDescriptor()); - - Map resourceNames = new HashMap<>(); - Map messageTypes = new HashMap<>(); - for (FileDescriptor fileDescriptor : protoFiles) { - resourceNames.putAll(Parser.parseResourceNames(fileDescriptor)); - messageTypes.putAll(Parser.parseMessages(fileDescriptor)); - } - - // Additional resource names. - FileDescriptor commonResourcesFileDescriptor = CommonResources.getDescriptor(); - resourceNames.putAll(Parser.parseResourceNames(commonResourcesFileDescriptor)); - - Set outputResourceNames = new HashSet<>(); - List services = - Parser.parseService( - serviceFileDescriptor, - messageTypes, - resourceNames, - Optional.empty(), - outputResourceNames); - - String filename = "logging_gapic.yaml"; - Path path = Paths.get(getTestFilesDirectory(), filename); - Optional> batchingSettingsOpt = - BatchingSettingsConfigParser.parse(Optional.of(path.toString())); - assertTrue(batchingSettingsOpt.isPresent()); - - String jsonFilename = "logging_grpc_service_config.json"; - Path jsonPath = Paths.get(getTestFilesDirectory(), jsonFilename); - Optional configOpt = ServiceConfigParser.parse(jsonPath.toString()); - assertTrue(configOpt.isPresent()); - GapicServiceConfig config = configOpt.get(); - config.setBatchingSettings(batchingSettingsOpt); - - return GapicContext.builder() - .setMessages(messageTypes) - .setResourceNames(resourceNames) - .setServices(services) - .setServiceConfig(config) - .setHelperResourceNames(outputResourceNames) - .setTransport(transport) - .build(); - } - - public String getTestFilesDirectory() { - return testFilesDirectory; - } - - public Transport getTransport() { - return transport; - } -} diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/defaultvalue/DefaultValueComposerTest.java b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/defaultvalue/DefaultValueComposerTest.java index 298d6e27d8..2464f74c4c 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/defaultvalue/DefaultValueComposerTest.java +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/defaultvalue/DefaultValueComposerTest.java @@ -26,29 +26,31 @@ import com.google.api.generator.gapic.model.Message; import com.google.api.generator.gapic.model.ResourceName; import com.google.api.generator.gapic.protoparser.Parser; -import com.google.api.generator.testutils.LineFormatter; +import com.google.api.generator.test.utils.LineFormatter; +import com.google.common.collect.ImmutableList; import com.google.protobuf.ByteString; import com.google.protobuf.Descriptors.FileDescriptor; import com.google.protobuf.StructProto; import com.google.showcase.v1beta1.EchoOuterClass; +import com.google.showcase.v1beta1.MessagingOuterClass; import com.google.testgapic.v1beta1.LockerProto; import java.util.Arrays; import java.util.Collections; import java.util.Map; import java.util.stream.Collectors; -import org.junit.Before; -import org.junit.Test; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; -public class DefaultValueComposerTest { +class DefaultValueComposerTest { private JavaWriterVisitor writerVisitor; - @Before - public void setUp() { + @BeforeEach + void setUp() { writerVisitor = new JavaWriterVisitor(); } @Test - public void defaultValue_mapField() { + void defaultValue_mapField() { // Incorrect and will never happen in real usage, but proves that map detection is based on // isMap rather than type(). Field field = @@ -73,7 +75,7 @@ public void defaultValue_mapField() { } @Test - public void defaultValue_listField() { + void defaultValue_listField() { // Incorrect and will never happen in real usage, but proves that list detection is based on // isRepeated rather than type(). Field field = @@ -84,7 +86,7 @@ public void defaultValue_listField() { } @Test - public void defaultValue_enumField() { + void defaultValue_enumField() { // Incorrect and will never happen in real usage, but proves that enum detection is based on // isEnum() rather than type(). Field field = @@ -95,7 +97,7 @@ public void defaultValue_enumField() { } @Test - public void defaultValue_messageField() { + void defaultValue_messageField() { // Incorrect and will never happen in real usage, but proves that message detection is based on // isMessage() rather than type(). Field field = @@ -106,7 +108,7 @@ public void defaultValue_messageField() { } @Test - public void defaultValue_stringField() { + void defaultValue_stringField() { Field field = Field.builder().setName("foobar").setType(TypeNode.STRING).build(); Expr expr = DefaultValueComposer.createValue(field); expr.accept(writerVisitor); @@ -122,7 +124,7 @@ public void defaultValue_stringField() { } @Test - public void defaultValue_numericField() { + void defaultValue_numericField() { Field field = Field.builder().setName("foobar").setType(TypeNode.INT).build(); Expr expr = DefaultValueComposer.createValue(field); expr.accept(writerVisitor); @@ -136,7 +138,7 @@ public void defaultValue_numericField() { } @Test - public void defaultValue_booleanField() { + void defaultValue_booleanField() { Field field = Field.builder().setName("foobar").setType(TypeNode.BOOLEAN).build(); Expr expr = DefaultValueComposer.createValue(field); expr.accept(writerVisitor); @@ -144,7 +146,7 @@ public void defaultValue_booleanField() { } @Test - public void defaultValue_byteStringField() { + void defaultValue_byteStringField() { Field field = Field.builder() .setName("foobar") @@ -156,7 +158,7 @@ public void defaultValue_byteStringField() { } @Test - public void defaultValue_resourceNameWithOnePattern() { + void defaultValue_resourceNameWithOnePattern() { FileDescriptor lockerServiceFileDescriptor = LockerProto.getDescriptor(); Map typeStringsToResourceNames = Parser.parseResourceNames(lockerServiceFileDescriptor); @@ -174,7 +176,7 @@ public void defaultValue_resourceNameWithOnePattern() { } @Test - public void defaultValue_resourceNameWithMultiplePatterns() { + void defaultValue_resourceNameWithMultiplePatterns_noBindings() { FileDescriptor lockerServiceFileDescriptor = LockerProto.getDescriptor(); Map typeStringsToResourceNames = Parser.parseResourceNames(lockerServiceFileDescriptor); @@ -188,12 +190,47 @@ public void defaultValue_resourceNameWithMultiplePatterns() { "ignored", null); expr.accept(writerVisitor); + /* + There are two patterns: + - pattern: "projects/{project}/folders/{folder}" + - pattern: "folders/{folder}" + It matches the first one given no bindings + */ assertEquals( "FolderName.ofProjectFolderName(\"[PROJECT]\", \"[FOLDER]\")", writerVisitor.write()); } @Test - public void defaultValue_resourceNameWithWildcardPattern() { + void defaultValue_resourceNameWithMultiplePatterns_matchesBindings() { + FileDescriptor lockerServiceFileDescriptor = LockerProto.getDescriptor(); + Map typeStringsToResourceNames = + Parser.parseResourceNames(lockerServiceFileDescriptor); + ResourceName resourceName = + typeStringsToResourceNames.get("cloudresourcemanager.googleapis.com/Folder"); + Expr expr = + DefaultValueComposer.createResourceHelperValue( + resourceName, + false, + typeStringsToResourceNames.values().stream().collect(Collectors.toList()), + "folder", + HttpBindings.builder() + .setHttpVerb(HttpVerb.POST) + .setPattern("/v1/{name=folders/*}") + .setAdditionalPatterns(ImmutableList.of()) + .setIsAsteriskBody(true) + .build()); + expr.accept(writerVisitor); + /* + There are two patterns: + - pattern: "projects/{project}/folders/{folder}" + - pattern: "folders/{folder}" + It attempts to match the correct HttpBinding + */ + assertEquals("FolderName.ofFolderName(\"[FOLDER]\")", writerVisitor.write()); + } + + @Test + void defaultValue_resourceNameWithWildcardPattern() { FileDescriptor lockerServiceFileDescriptor = LockerProto.getDescriptor(); Map typeStringsToResourceNames = Parser.parseResourceNames(lockerServiceFileDescriptor); @@ -211,7 +248,7 @@ public void defaultValue_resourceNameWithWildcardPattern() { } @Test - public void defaultValue_wildcardResourceNameWithOnlyDeletedTopic() { + void defaultValue_wildcardResourceNameWithOnlyDeletedTopic() { // Edge case that should never happen in practice. // Wildcard, but the resource names map has only other names that contain only the deleted-topic // constant. @@ -235,7 +272,7 @@ public void defaultValue_wildcardResourceNameWithOnlyDeletedTopic() { } @Test - public void defaultValue_resourceNameWithOnlyWildcards_valueOnly() { + void defaultValue_resourceNameWithOnlyWildcards_valueOnly() { // Edge case that occurs in GCS. // Wildcard, but the resource names map has only other names that contain only the deleted-topic // constant. @@ -251,7 +288,7 @@ public void defaultValue_resourceNameWithOnlyWildcards_valueOnly() { false, Collections.emptyList(), fallbackField, - /* allowAnonResourceNameClass = */ false, + /* allowAnonResourceNameClass= */ false, null); expr.accept(writerVisitor); assertEquals( @@ -259,7 +296,7 @@ public void defaultValue_resourceNameWithOnlyWildcards_valueOnly() { } @Test - public void defaultValue_resourceNameWithOnlyWildcards_matchingBinding() { + void defaultValue_resourceNameWithOnlyWildcards_matchingBinding() { FileDescriptor lockerServiceFileDescriptor = LockerProto.getDescriptor(); Map typeStringsToResourceNames = Parser.parseResourceNames(lockerServiceFileDescriptor); @@ -290,14 +327,14 @@ public void defaultValue_resourceNameWithOnlyWildcards_matchingBinding() { false, Arrays.asList(resourceName, extraResourceName), fallbackField, - /* allowAnonResourceNameClass = */ false, + /* allowAnonResourceNameClass= */ false, bindings); expr.accept(writerVisitor); assertEquals("TopicName.ofProjectTopicName(\"[PROJECT]\", \"[TOPIC]\")", writerVisitor.write()); } @Test - public void defaultValue_resourceNameWithOnlyWildcards_mismatchingBinding() { + void defaultValue_resourceNameWithOnlyWildcards_mismatchingBinding() { FileDescriptor lockerServiceFileDescriptor = LockerProto.getDescriptor(); Map typeStringsToResourceNames = Parser.parseResourceNames(lockerServiceFileDescriptor); @@ -328,7 +365,7 @@ public void defaultValue_resourceNameWithOnlyWildcards_mismatchingBinding() { false, Arrays.asList(resourceName, extraResourceName), fallbackField, - /* allowAnonResourceNameClass = */ false, + /* allowAnonResourceNameClass= */ false, bindings); expr.accept(writerVisitor); assertEquals( @@ -336,7 +373,7 @@ public void defaultValue_resourceNameWithOnlyWildcards_mismatchingBinding() { } @Test - public void defaultValue_resourceNameWithOnlyWildcards_allowAnonResourceNameClass() { + void defaultValue_resourceNameWithOnlyWildcards_allowAnonResourceNameClass() { // Edge case that occurs in GCS. // Wildcard, but the resource names map has only other names that contain only the deleted-topic // constant. @@ -375,7 +412,130 @@ public void defaultValue_resourceNameWithOnlyWildcards_allowAnonResourceNameClas } @Test - public void createSimpleMessage_basicPrimitivesOnly() { + void createSimpleMessageBuilderValue_resourceNameMultiplePatterns_matchesHttpBinding() { + FileDescriptor messagingFileDescriptor = MessagingOuterClass.getDescriptor(); + Map messageTypes = Parser.parseMessages(messagingFileDescriptor); + Map typeStringsToResourceNames = + Parser.parseResourceNames(messagingFileDescriptor); + /* + Blurb Resource contains four patterns (in order of): + - pattern: "users/{user}/profile/blurbs/legacy/{legacy_user}~{blurb}" + - pattern: "users/{user}/profile/blurbs/{blurb}" + - pattern: "rooms/{room}/blurbs/{blurb}" + - pattern: "rooms/{room}/blurbs/legacy/{legacy_room}.{blurb}" + */ + Message message = messageTypes.get("com.google.showcase.v1beta1.Blurb"); + + HttpBindings bindings = + HttpBindings.builder() + .setHttpVerb(HttpVerb.PATCH) + .setPattern("/v1beta1/{blurb.name=rooms/*/blurbs/*}") + .setAdditionalPatterns( + Collections.singletonList("/v1beta1/{blurb.name=users/*/profile/blurbs/*}")) + .setIsAsteriskBody(false) + .build(); + + Expr expr = + DefaultValueComposer.createSimpleMessageBuilderValue( + message, typeStringsToResourceNames, messageTypes, bindings); + expr.accept(writerVisitor); + // Matches with the default pattern in the HttpBindings and uses the variables in the pattern + assertEquals( + "Blurb.newBuilder().setName(BlurbName.ofRoomBlurbName(\"[ROOM]\", \"[BLURB]\").toString()).build()", + writerVisitor.write()); + } + + @Test + void createSimpleMessageBuilderValue_resourceNameMultiplePatterns_matchesAdditionalHttpBinding() { + FileDescriptor messagingFileDescriptor = MessagingOuterClass.getDescriptor(); + Map messageTypes = Parser.parseMessages(messagingFileDescriptor); + Map typeStringsToResourceNames = + Parser.parseResourceNames(messagingFileDescriptor); + /* + Blurb Resource contains four patterns (in order of): + - pattern: "users/{user}/profile/blurbs/legacy/{legacy_user}~{blurb}" + - pattern: "users/{user}/profile/blurbs/{blurb}" + - pattern: "rooms/{room}/blurbs/{blurb}" + - pattern: "rooms/{room}/blurbs/legacy/{legacy_room}.{blurb}" + */ + Message message = messageTypes.get("com.google.showcase.v1beta1.Blurb"); + + HttpBindings bindings = + HttpBindings.builder() + .setHttpVerb(HttpVerb.PATCH) + .setPattern("/v1beta1/{blurb.name=invalid/pattern/*}") + .setAdditionalPatterns( + Collections.singletonList("/v1beta1/{blurb.name=users/*/profile/blurbs/*}")) + .setIsAsteriskBody(false) + .build(); + + Expr expr = + DefaultValueComposer.createSimpleMessageBuilderValue( + message, typeStringsToResourceNames, messageTypes, bindings); + expr.accept(writerVisitor); + // Because the default pattern does not match, it will attempt to match with patterns in the + // additional bindings and use variables for any pattern that matches + assertEquals( + "Blurb.newBuilder().setName(BlurbName.ofUserBlurbName(\"[USER]\", \"[BLURB]\").toString()).build()", + writerVisitor.write()); + } + + @Test + void createSimpleMessageBuilderValue_resourceNameMultiplePatterns_doesNotMatchHttpBinding() { + FileDescriptor messagingFileDescriptor = MessagingOuterClass.getDescriptor(); + Map messageTypes = Parser.parseMessages(messagingFileDescriptor); + Map typeStringsToResourceNames = + Parser.parseResourceNames(messagingFileDescriptor); + /* + Blurb Resource contains four patterns (in order of): + - pattern: "users/{user}/profile/blurbs/legacy/{legacy_user}~{blurb}" + - pattern: "users/{user}/profile/blurbs/{blurb}" + - pattern: "rooms/{room}/blurbs/{blurb}" + - pattern: "rooms/{room}/blurbs/legacy/{legacy_room}.{blurb}" + */ + Message message = messageTypes.get("com.google.showcase.v1beta1.Blurb"); + + HttpBindings bindings = + HttpBindings.builder() + .setHttpVerb(HttpVerb.PATCH) + .setPattern("/v1beta1/{blurb.name=invalid/pattern/*}") + .setAdditionalPatterns( + Collections.singletonList("/v1beta1/{blurb.name=nothing/matches/*}")) + .setIsAsteriskBody(false) + .build(); + + Expr expr = + DefaultValueComposer.createSimpleMessageBuilderValue( + message, typeStringsToResourceNames, messageTypes, bindings); + expr.accept(writerVisitor); + // If no pattern matches (default and additional bindings), it will simply pick the first + // resource pattern in the resource definition. + assertEquals( + "Blurb.newBuilder().setName(BlurbName.ofUserLegacyUserBlurbName(\"[USER]\", \"[LEGACY_USER]\", \"[BLURB]\").toString()).build()", + writerVisitor.write()); + } + + @Test + void defaultValue_resourceNameMultiplePatterns_noHttpBinding() { + FileDescriptor messagingFileDescriptor = MessagingOuterClass.getDescriptor(); + Map messageTypes = Parser.parseMessages(messagingFileDescriptor); + Map typeStringsToResourceNames = + Parser.parseResourceNames(messagingFileDescriptor); + Message message = messageTypes.get("com.google.showcase.v1beta1.Blurb"); + + Expr expr = + DefaultValueComposer.createSimpleMessageBuilderValue( + message, typeStringsToResourceNames, messageTypes, null); + expr.accept(writerVisitor); + // If no pattern matches (default and additional bindings), it will simply pick the first + // resource pattern in the resource definition. + assertEquals( + "Blurb.newBuilder().setName(BlurbName.ofUserLegacyUserBlurbName(\"[USER]\", \"[LEGACY_USER]\", \"[BLURB]\").toString()).build()", + writerVisitor.write()); + } + + @Test + void createSimpleMessage_basicPrimitivesOnly() { FileDescriptor echoFileDescriptor = EchoOuterClass.getDescriptor(); Map messageTypes = Parser.parseMessages(echoFileDescriptor); Map typeStringsToResourceNames = @@ -392,7 +552,7 @@ public void createSimpleMessage_basicPrimitivesOnly() { } @Test - public void createSimpleMessage_containsMessagesEnumsAndResourceName() { + void createSimpleMessage_containsMessagesEnumsAndResourceName() { FileDescriptor echoFileDescriptor = EchoOuterClass.getDescriptor(); Map messageTypes = Parser.parseMessages(echoFileDescriptor); Map typeStringsToResourceNames = @@ -412,7 +572,7 @@ public void createSimpleMessage_containsMessagesEnumsAndResourceName() { } @Test - public void createSimpleMessage_valueField() { + void createSimpleMessage_valueField() { FileDescriptor echoFileDescriptor = com.google.showcase.grpcrest.v1beta1.EchoGrpcrest.getDescriptor(); Map messageTypes = Parser.parseMessages(echoFileDescriptor); @@ -434,7 +594,7 @@ public void createSimpleMessage_valueField() { } @Test - public void createSimpleMessage_containsRepeatedField() { + void createSimpleMessage_containsRepeatedField() { FileDescriptor echoFileDescriptor = EchoOuterClass.getDescriptor(); Map messageTypes = Parser.parseMessages(echoFileDescriptor); Map typeStringsToResourceNames = @@ -451,7 +611,7 @@ public void createSimpleMessage_containsRepeatedField() { } @Test - public void createSimpleMessage_onlyOneofs() { + void createSimpleMessage_onlyOneofs() { FileDescriptor echoFileDescriptor = EchoOuterClass.getDescriptor(); Map messageTypes = Parser.parseMessages(echoFileDescriptor); Map typeStringsToResourceNames = @@ -465,7 +625,7 @@ public void createSimpleMessage_onlyOneofs() { } @Test - public void createAnonymousResourceNameClass() { + void createAnonymousResourceNameClass() { Expr expr = DefaultValueComposer.createAnonymousResourceNameClassValue("resource", null); expr.accept(writerVisitor); String expected = diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/goldens/ComposerPostProcOnFooBar.golden b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/goldens/ComposerPostProcOnFooBar.golden index ae7b63ea5b..b40cc9cbdc 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/goldens/ComposerPostProcOnFooBar.golden +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/goldens/ComposerPostProcOnFooBar.golden @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2025 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/goldens/EchoVersion.golden b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/goldens/EchoVersion.golden new file mode 100644 index 0000000000..b8b3199cba --- /dev/null +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/goldens/EchoVersion.golden @@ -0,0 +1,11 @@ +package com.google.showcase.v1beta1.stub; + +import com.google.api.core.InternalApi; + +@InternalApi("For internal use only") +final class Version { + // {x-version-update-start:gapic-showcase:current} + static final String VERSION = "0.0.0-SNAPSHOT"; + // {x-version-update-end} + +} diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/GrpcServiceCallableFactoryClassComposerTest.java b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/GrpcServiceCallableFactoryClassComposerTest.java index 7269d61140..6895bccf9e 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/GrpcServiceCallableFactoryClassComposerTest.java +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/GrpcServiceCallableFactoryClassComposerTest.java @@ -18,11 +18,12 @@ import com.google.api.generator.gapic.model.GapicContext; import com.google.api.generator.gapic.model.Service; import com.google.api.generator.test.framework.Assert; -import org.junit.Test; +import com.google.api.generator.test.protoloader.GrpcTestProtoLoader; +import org.junit.jupiter.api.Test; -public class GrpcServiceCallableFactoryClassComposerTest { +class GrpcServiceCallableFactoryClassComposerTest { @Test - public void generateServiceClasses() { + void generateServiceClasses() { GapicContext context = GrpcTestProtoLoader.instance().parseShowcaseEcho(); Service echoProtoService = context.services().get(0); GapicClass clazz = @@ -33,7 +34,7 @@ public void generateServiceClasses() { } @Test - public void generateServiceClasses_deprecated() { + void generateServiceClasses_deprecated() { GapicContext context = GrpcTestProtoLoader.instance().parseDeprecatedService(); Service protoService = context.services().get(0); GapicClass clazz = diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/GrpcServiceStubClassComposerTest.java b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/GrpcServiceStubClassComposerTest.java index f41143acbe..eb54b80091 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/GrpcServiceStubClassComposerTest.java +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/GrpcServiceStubClassComposerTest.java @@ -18,11 +18,12 @@ import com.google.api.generator.gapic.model.GapicContext; import com.google.api.generator.gapic.model.Service; import com.google.api.generator.test.framework.Assert; -import org.junit.Test; +import com.google.api.generator.test.protoloader.GrpcTestProtoLoader; +import org.junit.jupiter.api.Test; -public class GrpcServiceStubClassComposerTest { +class GrpcServiceStubClassComposerTest { @Test - public void generateGrpcServiceStubClass_simple() { + void generateGrpcServiceStubClass_simple() { GapicContext context = GrpcTestProtoLoader.instance().parseShowcaseEcho(); Service echoProtoService = context.services().get(0); GapicClass clazz = GrpcServiceStubClassComposer.instance().generate(context, echoProtoService); @@ -32,7 +33,7 @@ public void generateGrpcServiceStubClass_simple() { } @Test - public void generateGrpcServiceStubClass_deprecated() { + void generateGrpcServiceStubClass_deprecated() { GapicContext context = GrpcTestProtoLoader.instance().parseDeprecatedService(); Service protoService = context.services().get(0); GapicClass clazz = GrpcServiceStubClassComposer.instance().generate(context, protoService); @@ -42,7 +43,7 @@ public void generateGrpcServiceStubClass_deprecated() { } @Test - public void generateGrpcServiceStubClass_httpBindings() { + void generateGrpcServiceStubClass_httpBindings() { GapicContext context = GrpcTestProtoLoader.instance().parseShowcaseTesting(); Service service = context.services().get(0); GapicClass clazz = GrpcServiceStubClassComposer.instance().generate(context, service); @@ -52,7 +53,7 @@ public void generateGrpcServiceStubClass_httpBindings() { } @Test - public void generateGrpcServiceStubClass_routingHeaders() { + void generateGrpcServiceStubClass_routingHeaders() { GapicContext context = GrpcTestProtoLoader.instance().parseExplicitDynamicRoutingHeaderTesting(); Service service = context.services().get(0); @@ -63,7 +64,7 @@ public void generateGrpcServiceStubClass_routingHeaders() { } @Test - public void generateGrpcServiceStubClass_httpBindingsWithSubMessageFields() { + void generateGrpcServiceStubClass_httpBindingsWithSubMessageFields() { GapicContext context = GrpcTestProtoLoader.instance().parsePubSubPublisher(); Service service = context.services().get(0); GapicClass clazz = GrpcServiceStubClassComposer.instance().generate(context, service); @@ -73,7 +74,7 @@ public void generateGrpcServiceStubClass_httpBindingsWithSubMessageFields() { } @Test - public void generateGrpcServiceStubClass_createBatchingCallable() { + void generateGrpcServiceStubClass_createBatchingCallable() { GapicContext context = GrpcTestProtoLoader.instance().parseLogging(); Service service = context.services().get(0); GapicClass clazz = GrpcServiceStubClassComposer.instance().generate(context, service); @@ -81,4 +82,44 @@ public void generateGrpcServiceStubClass_createBatchingCallable() { Assert.assertGoldenClass(this.getClass(), clazz, "GrpcLoggingStub.golden"); Assert.assertEmptySamples(clazz.samples()); } + + @Test + void generateGrpcServiceStubClass_autopopulateField() { + GapicContext context = GrpcTestProtoLoader.instance().parseAutoPopulateFieldTesting(); + Service service = context.services().get(0); + GapicClass clazz = GrpcServiceStubClassComposer.instance().generate(context, service); + + Assert.assertGoldenClass(this.getClass(), clazz, "GrpcAutoPopulateFieldStub.golden"); + Assert.assertEmptySamples(clazz.samples()); + } + + @Test + void generateGrpcServiceStubClass_callableNameType() { + GapicContext context = GrpcTestProtoLoader.instance().parseCallabeNameType(); + Service service = context.services().get(0); + GapicClass clazz = GrpcServiceStubClassComposer.instance().generate(context, service); + Assert.assertGoldenClass(this.getClass(), clazz, "GrpcCallableNameTypeStub.golden"); + Assert.assertEmptySamples(clazz.samples()); + } + + @Test + void generateGrpcServiceStubClass_bigQuery() { + GapicContext context = GrpcTestProtoLoader.instance().parseBigqueryService(); + + Service bigqueryJobService = context.services().get(0); + GapicClass clazz = + GrpcServiceStubClassComposer.instance().generate(context, bigqueryJobService); + Assert.assertGoldenClass(this.getClass(), clazz, "GrpcBigQueryJobServiceStub.golden"); + Assert.assertEmptySamples(clazz.samples()); + } + + @Test + void generateGrpcServiceStubClass_clientResourceNameExtractor() { + GapicContext context = GrpcTestProtoLoader.instance().parseResourceNameExtractorTesting(); + Service service = context.services().get(0); + GapicClass clazz = GrpcServiceStubClassComposer.instance().generate(context, service); + + Assert.assertGoldenClass(this.getClass(), clazz, "GrpcResourceNameExtractorStub.golden"); + Assert.assertEmptySamples(clazz.samples()); + } } diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/MockServiceClassComposerTest.java b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/MockServiceClassComposerTest.java index 7762c6a4df..1f6459e57c 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/MockServiceClassComposerTest.java +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/MockServiceClassComposerTest.java @@ -18,30 +18,24 @@ import com.google.api.generator.gapic.model.GapicContext; import com.google.api.generator.gapic.model.Service; import com.google.api.generator.test.framework.Assert; -import java.util.Arrays; -import java.util.Collection; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.junit.runners.Parameterized; +import com.google.api.generator.test.protoloader.GrpcTestProtoLoader; +import java.util.stream.Stream; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.Arguments; +import org.junit.jupiter.params.provider.MethodSource; -@RunWith(Parameterized.class) -public class MockServiceClassComposerTest { - @Parameterized.Parameters - public static Collection data() { - return Arrays.asList( - new Object[][] { - {"MockEcho", GrpcTestProtoLoader.instance().parseShowcaseEcho()}, - {"MockDeprecatedService", GrpcTestProtoLoader.instance().parseDeprecatedService()} - }); - } - - @Parameterized.Parameter public String name; +class MockServiceClassComposerTest { - @Parameterized.Parameter(1) - public GapicContext context; + static Stream data() { + return Stream.of( + Arguments.of("MockEcho", GrpcTestProtoLoader.instance().parseShowcaseEcho()), + Arguments.of( + "MockDeprecatedService", GrpcTestProtoLoader.instance().parseDeprecatedService())); + } - @Test - public void generateMockServiceClasses() { + @ParameterizedTest + @MethodSource("data") + void generateMockServiceClasses(String name, GapicContext context) { Service service = context.services().get(0); GapicClass clazz = MockServiceClassComposer.instance().generate(context, service); diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/MockServiceImplClassComposerTest.java b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/MockServiceImplClassComposerTest.java index aa062279ec..547caeecb3 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/MockServiceImplClassComposerTest.java +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/MockServiceImplClassComposerTest.java @@ -18,30 +18,23 @@ import com.google.api.generator.gapic.model.GapicContext; import com.google.api.generator.gapic.model.Service; import com.google.api.generator.test.framework.Assert; -import java.util.Arrays; -import java.util.Collection; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.junit.runners.Parameterized; +import com.google.api.generator.test.protoloader.GrpcTestProtoLoader; +import java.util.stream.Stream; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.Arguments; +import org.junit.jupiter.params.provider.MethodSource; -@RunWith(Parameterized.class) -public class MockServiceImplClassComposerTest { - @Parameterized.Parameters - public static Collection data() { - return Arrays.asList( - new Object[][] { - {"MockEchoImpl", GrpcTestProtoLoader.instance().parseShowcaseEcho()}, - {"MockDeprecatedServiceImpl", GrpcTestProtoLoader.instance().parseDeprecatedService()} - }); +class MockServiceImplClassComposerTest { + static Stream data() { + return Stream.of( + Arguments.of("MockEchoImpl", GrpcTestProtoLoader.instance().parseShowcaseEcho()), + Arguments.of( + "MockDeprecatedServiceImpl", GrpcTestProtoLoader.instance().parseDeprecatedService())); } - @Parameterized.Parameter public String name; - - @Parameterized.Parameter(1) - public GapicContext context; - - @Test - public void generateMockServiceImplClasses() { + @ParameterizedTest + @MethodSource("data") + void generateMockServiceImplClasses(String name, GapicContext context) { Service service = context.services().get(0); GapicClass clazz = MockServiceImplClassComposer.instance().generate(context, service); diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/ServiceClientClassComposerTest.java b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/ServiceClientClassComposerTest.java index c169c88eb3..2654eb6015 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/ServiceClientClassComposerTest.java +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/ServiceClientClassComposerTest.java @@ -18,70 +18,70 @@ import com.google.api.generator.gapic.model.GapicContext; import com.google.api.generator.gapic.model.Service; import com.google.api.generator.test.framework.Assert; +import com.google.api.generator.test.protoloader.GrpcTestProtoLoader; import java.util.*; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.junit.runners.Parameterized; +import java.util.stream.Stream; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.Arguments; +import org.junit.jupiter.params.provider.MethodSource; -@RunWith(Parameterized.class) -public class ServiceClientClassComposerTest { - @Parameterized.Parameters - public static Collection data() { - return Arrays.asList( - new Object[][] { - { +class ServiceClientClassComposerTest { + + private static Stream data() { + return Stream.of( + Arguments.of( "EchoClient", GrpcTestProtoLoader.instance().parseShowcaseEcho(), "localhost:7469", - "v1beta1" - }, - { + "v1beta1", + 0), + Arguments.of( "DeprecatedServiceClient", GrpcTestProtoLoader.instance().parseDeprecatedService(), "localhost:7469", - "v1" - }, - { + "v1", + 0), + Arguments.of( "IdentityClient", GrpcTestProtoLoader.instance().parseShowcaseIdentity(), "localhost:7469", - "v1beta1" - }, - { + "v1beta1", + 0), + Arguments.of( "BookshopClient", GrpcTestProtoLoader.instance().parseBookshopService(), "localhost:2665", - "v1beta1" - }, - { + "v1beta1", + 0), + Arguments.of( "MessagingClient", GrpcTestProtoLoader.instance().parseShowcaseMessaging(), "localhost:7469", - "v1beta1" - }, - }); + "v1beta1", + 0), + Arguments.of( + "EchoServiceSelectiveGapicClient", + GrpcTestProtoLoader.instance().parseSelectiveGenerationTesting(), + "localhost:7469", + "v1beta1", + 1)); } - @Parameterized.Parameter public String name; - - @Parameterized.Parameter(1) - public GapicContext context; - - @Parameterized.Parameter(2) - public String apiShortNameExpected; - - @Parameterized.Parameter(3) - public String apiVersionExpected; - - @Test - public void generateServiceClientClasses() { - Service service = context.services().get(0); + @ParameterizedTest + @MethodSource("data") + void generateServiceClientClasses( + String name, + GapicContext context, + String apiShortNameExpected, + String packageVersionExpected, + int serviceIndex) { + Service service = context.services().get(serviceIndex); GapicClass clazz = ServiceClientClassComposer.instance().generate(context, service); Assert.assertGoldenClass(this.getClass(), clazz, name + ".golden"); Assert.assertGoldenSamples( this.getClass(), name, clazz.classDefinition().packageString(), clazz.samples()); Assert.assertCodeEquals(clazz.apiShortName(), apiShortNameExpected); - Assert.assertCodeEquals(clazz.apiVersion(), apiVersionExpected); + Assert.assertCodeEquals(clazz.packageVersion(), packageVersionExpected); } } diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/ServiceClientTestClassComposerTest.java b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/ServiceClientTestClassComposerTest.java index 0eca4e060d..c20bf8bf56 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/ServiceClientTestClassComposerTest.java +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/ServiceClientTestClassComposerTest.java @@ -18,40 +18,30 @@ import com.google.api.generator.gapic.model.GapicContext; import com.google.api.generator.gapic.model.Service; import com.google.api.generator.test.framework.Assert; -import java.util.Arrays; -import java.util.Collection; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.junit.runners.Parameterized; - -@RunWith(Parameterized.class) -public class ServiceClientTestClassComposerTest { - @Parameterized.Parameters - public static Collection data() { - return Arrays.asList( - new Object[][] { - {"EchoClientTest", GrpcTestProtoLoader.instance().parseShowcaseEcho(), 0}, - { +import com.google.api.generator.test.protoloader.GrpcTestProtoLoader; +import java.util.stream.Stream; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.Arguments; +import org.junit.jupiter.params.provider.MethodSource; + +class ServiceClientTestClassComposerTest { + + static Stream data() { + return Stream.of( + Arguments.of("EchoClientTest", GrpcTestProtoLoader.instance().parseShowcaseEcho(), 0), + Arguments.of( "DeprecatedServiceClientTest", GrpcTestProtoLoader.instance().parseDeprecatedService(), - 0 - }, - {"TestingClientTest", GrpcTestProtoLoader.instance().parseShowcaseTesting(), 0}, - {"SubscriberClientTest", GrpcTestProtoLoader.instance().parsePubSubPublisher(), 1}, - {"LoggingClientTest", GrpcTestProtoLoader.instance().parseLogging(), 0}, - }); + 0), + Arguments.of("TestingClientTest", GrpcTestProtoLoader.instance().parseShowcaseTesting(), 0), + Arguments.of( + "SubscriberClientTest", GrpcTestProtoLoader.instance().parsePubSubPublisher(), 1), + Arguments.of("LoggingClientTest", GrpcTestProtoLoader.instance().parseLogging(), 0)); } - @Parameterized.Parameter public String name; - - @Parameterized.Parameter(1) - public GapicContext context; - - @Parameterized.Parameter(2) - public int serviceIndex; - - @Test - public void generateServiceClientTestClasses() { + @ParameterizedTest + @MethodSource("data") + void generateServiceClientTestClasses(String name, GapicContext context, int serviceIndex) { Service echoProtoService = context.services().get(serviceIndex); GapicClass clazz = ServiceClientTestClassComposer.instance().generate(context, echoProtoService); diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/ServiceSettingsClassComposerTest.java b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/ServiceSettingsClassComposerTest.java index 1d245a7490..da503cd09f 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/ServiceSettingsClassComposerTest.java +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/ServiceSettingsClassComposerTest.java @@ -14,52 +14,49 @@ package com.google.api.generator.gapic.composer.grpc; -import com.google.api.generator.gapic.composer.common.TestProtoLoader; import com.google.api.generator.gapic.model.GapicClass; import com.google.api.generator.gapic.model.GapicContext; import com.google.api.generator.gapic.model.Service; import com.google.api.generator.test.framework.Assert; -import java.util.Arrays; -import java.util.Collection; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.junit.runners.Parameterized; +import com.google.api.generator.test.protoloader.TestProtoLoader; +import java.util.stream.Stream; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.Arguments; +import org.junit.jupiter.params.provider.MethodSource; -@RunWith(Parameterized.class) -public class ServiceSettingsClassComposerTest { - @Parameterized.Parameters - public static Collection data() { - return Arrays.asList( - new Object[][] { - { +class ServiceSettingsClassComposerTest { + + static Stream data() { + return Stream.of( + Arguments.of( "EchoSettings", TestProtoLoader.instance().parseShowcaseEcho(), "localhost:7469", - "v1beta1" - }, - { + "v1beta1", + 0), + Arguments.of( "DeprecatedServiceSettings", TestProtoLoader.instance().parseDeprecatedService(), "localhost:7469", - "v1" - } - }); + "v1", + 0), + Arguments.of( + "EchoServiceSelectiveGapicServiceSettings", + TestProtoLoader.instance().parseSelectiveGenerationTesting(), + "localhost:7469", + "v1beta1", + 1)); } - @Parameterized.Parameter public String name; - - @Parameterized.Parameter(1) - public GapicContext context; - - @Parameterized.Parameter(2) - public String apiShortNameExpected; - - @Parameterized.Parameter(3) - public String apiVersionExpected; - - @Test - public void generateServiceSettingsClasses() { - Service service = context.services().get(0); + @ParameterizedTest + @MethodSource("data") + void generateServiceSettingsClasses( + String name, + GapicContext context, + String apiShortNameExpected, + String packageVersionExpected, + int serviceIndex) { + Service service = context.services().get(serviceIndex); GapicClass clazz = ServiceSettingsClassComposer.instance().generate(context, service); Assert.assertGoldenClass(this.getClass(), clazz, name + ".golden"); @@ -69,6 +66,6 @@ public void generateServiceSettingsClasses() { clazz.classDefinition().packageString(), clazz.samples()); Assert.assertCodeEquals(clazz.apiShortName(), apiShortNameExpected); - Assert.assertCodeEquals(clazz.apiVersion(), apiVersionExpected); + Assert.assertCodeEquals(clazz.packageVersion(), packageVersionExpected); } } diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/ServiceStubClassComposerTest.java b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/ServiceStubClassComposerTest.java index 730136c083..21d57f02b8 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/ServiceStubClassComposerTest.java +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/ServiceStubClassComposerTest.java @@ -14,47 +14,48 @@ package com.google.api.generator.gapic.composer.grpc; -import com.google.api.generator.gapic.composer.common.TestProtoLoader; import com.google.api.generator.gapic.model.GapicClass; import com.google.api.generator.gapic.model.GapicContext; import com.google.api.generator.gapic.model.Service; import com.google.api.generator.test.framework.Assert; -import java.util.Arrays; -import java.util.Collection; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.junit.runners.Parameterized; - -@RunWith(Parameterized.class) -public class ServiceStubClassComposerTest { - @Parameterized.Parameters - public static Collection data() { - return Arrays.asList( - new Object[][] { - {"EchoStub", TestProtoLoader.instance().parseShowcaseEcho(), "", ""}, - {"DeprecatedServiceStub", TestProtoLoader.instance().parseDeprecatedService(), "", ""} - }); +import com.google.api.generator.test.protoloader.TestProtoLoader; +import java.util.stream.Stream; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.Arguments; +import org.junit.jupiter.params.provider.MethodSource; + +class ServiceStubClassComposerTest { + static Stream data() { + return Stream.of( + Arguments.of("EchoStub", TestProtoLoader.instance().parseShowcaseEcho(), "", "", 0), + Arguments.of( + "DeprecatedServiceStub", + TestProtoLoader.instance().parseDeprecatedService(), + "", + "", + 0), + Arguments.of( + "EchoServiceSelectiveGapicClientStub", + TestProtoLoader.instance().parseSelectiveGenerationTesting(), + "", + "", + 1)); } - @Parameterized.Parameter public String name; - - @Parameterized.Parameter(1) - public GapicContext context; - - @Parameterized.Parameter(2) - public String apiShortNameExpected; - - @Parameterized.Parameter(3) - public String apiVersionExpected; - - @Test - public void generateServiceStubClasses() { - Service service = context.services().get(0); + @ParameterizedTest + @MethodSource("data") + void generateServiceStubClasses( + String name, + GapicContext context, + String apiShortNameExpected, + String packageVersionExpected, + int serviceIndex) { + Service service = context.services().get(serviceIndex); GapicClass clazz = ServiceStubClassComposer.instance().generate(context, service); Assert.assertGoldenClass(this.getClass(), clazz, name + ".golden"); Assert.assertEmptySamples(clazz.samples()); Assert.assertCodeEquals(clazz.apiShortName(), apiShortNameExpected); - Assert.assertCodeEquals(clazz.apiVersion(), apiVersionExpected); + Assert.assertCodeEquals(clazz.packageVersion(), packageVersionExpected); } } diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/ServiceStubSettingsClassComposerTest.java b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/ServiceStubSettingsClassComposerTest.java index 747b19b8e0..3287309ee4 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/ServiceStubSettingsClassComposerTest.java +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/ServiceStubSettingsClassComposerTest.java @@ -18,59 +18,68 @@ import com.google.api.generator.gapic.model.GapicContext; import com.google.api.generator.gapic.model.Service; import com.google.api.generator.test.framework.Assert; -import java.util.Arrays; -import java.util.Collection; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.junit.runners.Parameterized; +import com.google.api.generator.test.protoloader.GrpcTestProtoLoader; +import java.util.stream.Stream; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.Arguments; +import org.junit.jupiter.params.provider.MethodSource; -@RunWith(Parameterized.class) -public class ServiceStubSettingsClassComposerTest { - @Parameterized.Parameters - public static Collection data() { - return Arrays.asList( - new Object[][] { - { +class ServiceStubSettingsClassComposerTest { + static Stream data() { + return Stream.of( + Arguments.of( "LoggingServiceV2StubSettings", GrpcTestProtoLoader.instance().parseLogging(), "logging", - "v2" - }, - { + "v2", + 0), + Arguments.of( "PublisherStubSettings", GrpcTestProtoLoader.instance().parsePubSubPublisher(), "pubsub", - "v1" - }, - { + "v1", + 0), + Arguments.of( "EchoStubSettings", GrpcTestProtoLoader.instance().parseShowcaseEcho(), "localhost:7469", - "v1beta1" - }, - { + "v1beta1", + 0), + Arguments.of( "DeprecatedServiceStubSettings", GrpcTestProtoLoader.instance().parseDeprecatedService(), "localhost:7469", - "v1" - } - }); + "v1", + 0), + Arguments.of( + "ApiVersionTestingStubSettings", + GrpcTestProtoLoader.instance().parseApiVersionTesting(), + "localhost:7469", + "v1", + 0), + Arguments.of( + "EchoServiceSelectiveGapicStubSettings", + GrpcTestProtoLoader.instance().parseSelectiveGenerationTesting(), + "localhost:7469", + "v1beta1", + 1), + Arguments.of( + "JobServiceStubSettings", + GrpcTestProtoLoader.instance().parseBigqueryService(), + "bigquery", + "v2", + 0)); } - @Parameterized.Parameter public String name; - - @Parameterized.Parameter(1) - public GapicContext context; - - @Parameterized.Parameter(2) - public String apiShortNameExpected; - - @Parameterized.Parameter(3) - public String apiVersionExpected; - - @Test - public void generateServiceStubSettingsClasses() { - Service service = context.services().get(0); + @ParameterizedTest + @MethodSource("data") + void generateServiceStubSettingsClasses( + String name, + GapicContext context, + String apiShortNameExpected, + String packageVersionExpected, + int serviceIndex) { + Service service = context.services().get(serviceIndex); GapicClass clazz = ServiceStubSettingsClassComposer.instance().generate(context, service); Assert.assertGoldenClass(this.getClass(), clazz, name + ".golden"); @@ -80,6 +89,6 @@ public void generateServiceStubSettingsClasses() { clazz.classDefinition().packageString(), clazz.samples()); Assert.assertCodeEquals(clazz.apiShortName(), apiShortNameExpected); - Assert.assertCodeEquals(clazz.apiVersion(), apiVersionExpected); + Assert.assertCodeEquals(clazz.packageVersion(), packageVersionExpected); } } diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/ApiVersionTestingStubSettings.golden b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/ApiVersionTestingStubSettings.golden new file mode 100644 index 0000000000..e6a8c4d47b --- /dev/null +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/ApiVersionTestingStubSettings.golden @@ -0,0 +1,270 @@ +package com.google.api.version.test.stub; + +import com.google.api.core.ApiFunction; +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.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.LibraryMetadata; +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.version.test.EchoRequest; +import com.google.api.version.test.EchoResponse; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.ImmutableSet; +import com.google.common.collect.Lists; +import java.io.IOException; +import java.util.List; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Settings class to configure an instance of {@link EchoWithVersionStub}. + * + *

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

          + *
        • The default service address (localhost) and default port (7469) 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 echoWithVersionMethod: + * + *

        {@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
        + * EchoWithVersionStubSettings.Builder echoWithVersionSettingsBuilder =
        + *     EchoWithVersionStubSettings.newBuilder();
        + * echoWithVersionSettingsBuilder
        + *     .echoWithVersionMethodSettings()
        + *     .setRetrySettings(
        + *         echoWithVersionSettingsBuilder
        + *             .echoWithVersionMethodSettings()
        + *             .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());
        + * EchoWithVersionStubSettings echoWithVersionSettings = echoWithVersionSettingsBuilder.build();
        + * }
        + * + * Please refer to the [Client Side Retry + * Guide](https://docs.cloud.google.com/java/docs/client-retries) for additional support in setting + * retries. + */ +@Generated("by gapic-generator-java") +@SuppressWarnings("CanonicalDuration") +public class EchoWithVersionStubSettings extends StubSettings { + /** The default scopes of the service. */ + private static final ImmutableList DEFAULT_SERVICE_SCOPES = + ImmutableList.builder().add("https://www.googleapis.com/auth/cloud-platform").build(); + + private final UnaryCallSettings echoWithVersionMethodSettings; + + /** Returns the object with the settings used for calls to echoWithVersionMethod. */ + public UnaryCallSettings echoWithVersionMethodSettings() { + return echoWithVersionMethodSettings; + } + + public EchoWithVersionStub createStub() throws IOException { + if (getTransportChannelProvider() + .getTransportName() + .equals(GrpcTransportChannel.getGrpcTransportName())) { + return GrpcEchoWithVersionStub.create(this); + } + throw new UnsupportedOperationException( + String.format( + "Transport not supported: %s", getTransportChannelProvider().getTransportName())); + } + + /** Returns a builder for the default ExecutorProvider for this service. */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return InstantiatingExecutorProvider.newBuilder(); + } + + /** Returns the default service endpoint. */ + @ObsoleteApi("Use getEndpoint() instead") + public static String getDefaultEndpoint() { + return "localhost:7469"; + } + + /** Returns the default mTLS service endpoint. */ + public static String getDefaultMtlsEndpoint() { + return "localhost:7469"; + } + + /** 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(EchoWithVersionStubSettings.class)) + .setTransportToken(GaxGrpcProperties.getGrpcTokenName(), GaxGrpcProperties.getGrpcVersion()) + .setApiVersionToken("fake_version"); + } + + /** 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 EchoWithVersionStubSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + + echoWithVersionMethodSettings = settingsBuilder.echoWithVersionMethodSettings().build(); + } + + @Override + protected LibraryMetadata getLibraryMetadata() { + return LibraryMetadata.newBuilder().setVersion(Version.VERSION).build(); + } + + /** Builder for EchoWithVersionStubSettings. */ + public static class Builder extends StubSettings.Builder { + private final ImmutableList> unaryMethodSettingsBuilders; + private final UnaryCallSettings.Builder + echoWithVersionMethodSettings; + private static final ImmutableMap> + RETRYABLE_CODE_DEFINITIONS; + + static { + ImmutableMap.Builder> definitions = + ImmutableMap.builder(); + definitions.put("no_retry_codes", ImmutableSet.copyOf(Lists.newArrayList())); + RETRYABLE_CODE_DEFINITIONS = definitions.build(); + } + + private static final ImmutableMap RETRY_PARAM_DEFINITIONS; + + static { + ImmutableMap.Builder definitions = ImmutableMap.builder(); + RetrySettings settings = null; + settings = RetrySettings.newBuilder().setRpcTimeoutMultiplier(1.0).build(); + definitions.put("no_retry_params", settings); + RETRY_PARAM_DEFINITIONS = definitions.build(); + } + + protected Builder() { + this(((ClientContext) null)); + } + + protected Builder(ClientContext clientContext) { + super(clientContext); + + echoWithVersionMethodSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of(echoWithVersionMethodSettings); + initDefaults(this); + } + + protected Builder(EchoWithVersionStubSettings settings) { + super(settings); + + echoWithVersionMethodSettings = settings.echoWithVersionMethodSettings.toBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of(echoWithVersionMethodSettings); + } + + 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 + .echoWithVersionMethodSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_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 echoWithVersionMethod. */ + public UnaryCallSettings.Builder echoWithVersionMethodSettings() { + return echoWithVersionMethodSettings; + } + + @Override + public EchoWithVersionStubSettings build() throws IOException { + return new EchoWithVersionStubSettings(this); + } + } +} diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/BookshopClient.golden b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/BookshopClient.golden index e1de9b7f4e..13e5485039 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/BookshopClient.golden +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/BookshopClient.golden @@ -31,19 +31,33 @@ import javax.annotation.Generated; *

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

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

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

        GetBook

        + *

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

        + *
          + *
        • getBook(GetBookRequest request) + *

        + *

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

        + *
          + *
        • getBook(int booksCount, List<Book> books) + *

        • getBook(String booksList, List<Book> books) + *

        + *

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

        + *
          + *
        • getBookCallable() + *

        + *
        * *

        See the individual methods for example code. * diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/DeprecatedServiceClient.golden b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/DeprecatedServiceClient.golden index 25847773a2..aec12869e4 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/DeprecatedServiceClient.golden +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/DeprecatedServiceClient.golden @@ -30,19 +30,42 @@ import javax.annotation.Generated; * such as threads. In the example above, try-with-resources is used, which automatically calls * close(). * - *

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

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

        FastFibonacci

        + *

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

        + *
          + *
        • fastFibonacci(FibonacciRequest request) + *

        + *

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

        + *
          + *
        • fastFibonacciCallable() + *

        + *

        SlowFibonacci

        + *

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

        + *
          + *
        • slowFibonacci(FibonacciRequest request) + *

        + *

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

        + *
          + *
        • slowFibonacciCallable() + *

        + *
        * *

        See the individual methods for example code. * diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/DeprecatedServiceSettings.golden b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/DeprecatedServiceSettings.golden index 6debab4c44..3a17bc1a9b 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/DeprecatedServiceSettings.golden +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/DeprecatedServiceSettings.golden @@ -1,7 +1,6 @@ package com.google.testdata.v1; import com.google.api.core.ApiFunction; -import com.google.api.core.BetaApi; import com.google.api.gax.core.GoogleCredentialsProvider; import com.google.api.gax.core.InstantiatingExecutorProvider; import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; @@ -32,7 +31,9 @@ import javax.annotation.Generated; *

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

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

        For example, to set the + * [RetrySettings](https://cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.retrying.RetrySettings) + * of fastFibonacci: * *

        {@code
          * // This snippet has been automatically generated and should be regarded as a code template only.
        @@ -49,11 +50,22 @@ import javax.annotation.Generated;
          *             .fastFibonacciSettings()
          *             .getRetrySettings()
          *             .toBuilder()
        - *             .setTotalTimeout(Duration.ofSeconds(30))
        + *             .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());
          * DeprecatedServiceSettings deprecatedServiceSettings = deprecatedServiceSettingsBuilder.build();
          * }
        * + * Please refer to the [Client Side Retry + * Guide](https://docs.cloud.google.com/java/docs/client-retries) for additional support in setting + * retries. + * * @deprecated This class is deprecated and will be removed in the next major version update. */ @Deprecated @@ -109,7 +121,6 @@ public class DeprecatedServiceSettings extends ClientSettingsThe builder of this class is recursive, so contained classes are themselves builders. When * build() is called, the tree of builders is called to create the complete settings object. * - *

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

        For example, to set the + * [RetrySettings](https://cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.retrying.RetrySettings) + * of fastFibonacci: * *

        {@code
          * // This snippet has been automatically generated and should be regarded as a code template only.
        @@ -58,16 +61,28 @@ import org.threeten.bp.Duration;
          *             .fastFibonacciSettings()
          *             .getRetrySettings()
          *             .toBuilder()
        - *             .setTotalTimeout(Duration.ofSeconds(30))
        + *             .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());
          * DeprecatedServiceStubSettings deprecatedServiceSettings =
          *     deprecatedServiceSettingsBuilder.build();
          * }
        * + * Please refer to the [Client Side Retry + * Guide](https://docs.cloud.google.com/java/docs/client-retries) for additional support in setting + * retries. + * * @deprecated This class is deprecated and will be removed in the next major version update. */ @Deprecated @Generated("by gapic-generator-java") +@SuppressWarnings("CanonicalDuration") public class DeprecatedServiceStubSettings extends StubSettings { /** The default scopes of the service. */ private static final ImmutableList DEFAULT_SERVICE_SCOPES = @@ -108,6 +123,7 @@ public class DeprecatedServiceStubSettings extends StubSettings { private final ImmutableList> unaryMethodSettingsBuilders; @@ -193,10 +213,10 @@ public class DeprecatedServiceStubSettings extends StubSettingsNote: close() needs to be called on the EchoClient object to clean up resources such as * threads. In the example above, try-with-resources is used, which automatically calls close(). * - *

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

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

        Echo

        + *

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

        + *
          + *
        • echo(EchoRequest request) + *

        + *

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

        + *
          + *
        • echo() + *

        • echo(ResourceName parent) + *

        • echo(Status error) + *

        • echo(FoobarName name) + *

        • echo(String content) + *

        • echo(String name) + *

        • echo(String parent) + *

        • echo(String content, Severity severity) + *

        + *

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

        + *
          + *
        • echoCallable() + *

        + *

        Expand

        + *

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

        + *
          + *
        • expandCallable() + *

        + *

        Collect

        + *

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

        + *
          + *
        • collectCallable() + *

        + *

        Chat

        + *

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

        + *
          + *
        • chatCallable() + *

        + *

        ChatAgain

        + *

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

        + *
          + *
        • chatAgainCallable() + *

        + *

        PagedExpand

        + *

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

        + *
          + *
        • pagedExpand(PagedExpandRequest request) + *

        + *

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

        + *
          + *
        • pagedExpandPagedCallable() + *

        • pagedExpandCallable() + *

        + *

        SimplePagedExpand

        + *

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

        + *
          + *
        • simplePagedExpand(PagedExpandRequest request) + *

        + *

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

        + *
          + *
        • simplePagedExpand() + *

        + *

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

        + *
          + *
        • simplePagedExpandPagedCallable() + *

        • simplePagedExpandCallable() + *

        + *

        Wait

        + *

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

        + *
          + *
        • waitAsync(WaitRequest request) + *

        + *

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

        + *
          + *
        • waitAsync(Duration ttl) + *

        • waitAsync(Timestamp endTime) + *

        + *

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

        + *
          + *
        • waitOperationCallable() + *

        • waitCallable() + *

        + *

        Block

        + *

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

        + *
          + *
        • block(BlockRequest request) + *

        + *

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

        + *
          + *
        • blockCallable() + *

        + *

        CollideName

        + *

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

        + *
          + *
        • collideName(EchoRequest request) + *

        + *

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

        + *
          + *
        • collideNameCallable() + *

        + *

        PagedExpandLegacy

        + *

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

        + *
          + *
        • pagedExpandLegacy(PagedExpandLegacyRequest request) + *

        + *

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

        + *
          + *
        • pagedExpandLegacyCallable() + *

        + *
        * *

        See the individual methods for example code. * @@ -982,6 +1138,63 @@ public class EchoClient implements BackgroundResource { return stub.collideNameCallable(); } + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * 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 (EchoClient echoClient = EchoClient.create()) {
        +   *   PagedExpandLegacyRequest request =
        +   *       PagedExpandLegacyRequest.newBuilder()
        +   *           .setContent("content951530617")
        +   *           .setMaxResults(1128457243)
        +   *           .setPageToken("pageToken873572522")
        +   *           .build();
        +   *   PagedExpandResponse response = echoClient.pagedExpandLegacy(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 PagedExpandResponse pagedExpandLegacy(PagedExpandLegacyRequest request) { + return pagedExpandLegacyCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * 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 (EchoClient echoClient = EchoClient.create()) {
        +   *   PagedExpandLegacyRequest request =
        +   *       PagedExpandLegacyRequest.newBuilder()
        +   *           .setContent("content951530617")
        +   *           .setMaxResults(1128457243)
        +   *           .setPageToken("pageToken873572522")
        +   *           .build();
        +   *   ApiFuture future =
        +   *       echoClient.pagedExpandLegacyCallable().futureCall(request);
        +   *   // Do something.
        +   *   PagedExpandResponse response = future.get();
        +   * }
        +   * }
        + */ + public final UnaryCallable + pagedExpandLegacyCallable() { + return stub.pagedExpandLegacyCallable(); + } + @Override public final void close() { stub.close(); diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/EchoClientTest.golden b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/EchoClientTest.golden index 1372cdd94e..515649a093 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/EchoClientTest.golden +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/EchoClientTest.golden @@ -26,6 +26,7 @@ import com.google.protobuf.Timestamp; import com.google.rpc.Status; import io.grpc.StatusRuntimeException; import java.io.IOException; +import java.util.ArrayList; import java.util.Arrays; import java.util.List; import java.util.UUID; @@ -890,4 +891,55 @@ public class EchoClientTest { // Expected exception. } } + + @Test + public void pagedExpandLegacyTest() throws Exception { + PagedExpandResponse expectedResponse = + PagedExpandResponse.newBuilder() + .addAllResponses(new ArrayList()) + .setNextPageToken("nextPageToken-1386094857") + .build(); + mockEcho.addResponse(expectedResponse); + + PagedExpandLegacyRequest request = + PagedExpandLegacyRequest.newBuilder() + .setContent("content951530617") + .setMaxResults(1128457243) + .setPageToken("pageToken873572522") + .build(); + + PagedExpandResponse actualResponse = client.pagedExpandLegacy(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockEcho.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + PagedExpandLegacyRequest actualRequest = ((PagedExpandLegacyRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getContent(), actualRequest.getContent()); + Assert.assertEquals(request.getMaxResults(), actualRequest.getMaxResults()); + Assert.assertEquals(request.getPageToken(), actualRequest.getPageToken()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void pagedExpandLegacyExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockEcho.addException(exception); + + try { + PagedExpandLegacyRequest request = + PagedExpandLegacyRequest.newBuilder() + .setContent("content951530617") + .setMaxResults(1128457243) + .setPageToken("pageToken873572522") + .build(); + client.pagedExpandLegacy(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } } diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/EchoServiceSelectiveGapicClient.golden b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/EchoServiceSelectiveGapicClient.golden new file mode 100644 index 0000000000..731ebe1834 --- /dev/null +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/EchoServiceSelectiveGapicClient.golden @@ -0,0 +1,641 @@ +package com.google.selective.generate.v1beta1; + +import com.google.api.core.BetaApi; +import com.google.api.core.InternalApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.rpc.BidiStreamingCallable; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.selective.generate.v1beta1.stub.EchoServiceShouldGeneratePartialUsualStub; +import com.google.selective.generate.v1beta1.stub.EchoServiceShouldGeneratePartialUsualStubSettings; +import java.io.IOException; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * 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 (EchoServiceShouldGeneratePartialUsualClient echoServiceShouldGeneratePartialUsualClient =
        + *     EchoServiceShouldGeneratePartialUsualClient.create()) {
        + *   EchoResponse response =
        + *       echoServiceShouldGeneratePartialUsualClient.echoShouldGenerateAsUsual();
        + * }
        + * }
        + * + *

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

        EchoShouldGenerateAsUsual

        + *

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

        + *
          + *
        • echoShouldGenerateAsUsual(EchoRequest request) + *

        + *

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

        + *
          + *
        • echoShouldGenerateAsUsual() + *

        • echoShouldGenerateAsUsual(FoobarName name) + *

        • echoShouldGenerateAsUsual(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.

        + *
          + *
        • echoShouldGenerateAsUsualCallable() + *

        + *

        ChatShouldGenerateAsUsual

        + *

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

        + *
          + *
        • chatShouldGenerateAsUsualCallable() + *

        + *

        ChatAgainShouldGenerateAsUsual

        + *

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

        + *
          + *
        • chatAgainShouldGenerateAsUsualCallable() + *

        + *

        ChatShouldGenerateAsInternal

        + *

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

        + *
          + *
        • chatShouldGenerateAsInternal(EchoRequest request) + *

        + *

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

        + *
          + *
        • chatShouldGenerateAsInternal() + *

        • chatShouldGenerateAsInternal(FoobarName name) + *

        • chatShouldGenerateAsInternal(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.

        + *
          + *
        • chatShouldGenerateAsInternalCallable() + *

        + *

        EchoShouldGenerateAsInternal

        + *

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

        + *
          + *
        • echoShouldGenerateAsInternalCallable() + *

        + *
        + * + *

        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 + * EchoServiceShouldGeneratePartialUsualSettings 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
        + * EchoServiceShouldGeneratePartialUsualSettings echoServiceShouldGeneratePartialUsualSettings =
        + *     EchoServiceShouldGeneratePartialUsualSettings.newBuilder()
        + *         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
        + *         .build();
        + * EchoServiceShouldGeneratePartialUsualClient echoServiceShouldGeneratePartialUsualClient =
        + *     EchoServiceShouldGeneratePartialUsualClient.create(
        + *         echoServiceShouldGeneratePartialUsualSettings);
        + * }
        + * + *

        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
        + * EchoServiceShouldGeneratePartialUsualSettings echoServiceShouldGeneratePartialUsualSettings =
        + *     EchoServiceShouldGeneratePartialUsualSettings.newBuilder().setEndpoint(myEndpoint).build();
        + * EchoServiceShouldGeneratePartialUsualClient echoServiceShouldGeneratePartialUsualClient =
        + *     EchoServiceShouldGeneratePartialUsualClient.create(
        + *         echoServiceShouldGeneratePartialUsualSettings);
        + * }
        + * + *

        Please refer to the GitHub repository's samples for more quickstart code snippets. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class EchoServiceShouldGeneratePartialUsualClient implements BackgroundResource { + private final EchoServiceShouldGeneratePartialUsualSettings settings; + private final EchoServiceShouldGeneratePartialUsualStub stub; + + /** + * Constructs an instance of EchoServiceShouldGeneratePartialUsualClient with default settings. + */ + public static final EchoServiceShouldGeneratePartialUsualClient create() throws IOException { + return create(EchoServiceShouldGeneratePartialUsualSettings.newBuilder().build()); + } + + /** + * Constructs an instance of EchoServiceShouldGeneratePartialUsualClient, 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 EchoServiceShouldGeneratePartialUsualClient create( + EchoServiceShouldGeneratePartialUsualSettings settings) throws IOException { + return new EchoServiceShouldGeneratePartialUsualClient(settings); + } + + /** + * Constructs an instance of EchoServiceShouldGeneratePartialUsualClient, using the given stub for + * making calls. This is for advanced usage - prefer using + * create(EchoServiceShouldGeneratePartialUsualSettings). + */ + public static final EchoServiceShouldGeneratePartialUsualClient create( + EchoServiceShouldGeneratePartialUsualStub stub) { + return new EchoServiceShouldGeneratePartialUsualClient(stub); + } + + /** + * Constructs an instance of EchoServiceShouldGeneratePartialUsualClient, 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 EchoServiceShouldGeneratePartialUsualClient( + EchoServiceShouldGeneratePartialUsualSettings settings) throws IOException { + this.settings = settings; + this.stub = + ((EchoServiceShouldGeneratePartialUsualStubSettings) settings.getStubSettings()) + .createStub(); + } + + protected EchoServiceShouldGeneratePartialUsualClient( + EchoServiceShouldGeneratePartialUsualStub stub) { + this.settings = null; + this.stub = stub; + } + + public final EchoServiceShouldGeneratePartialUsualSettings getSettings() { + return settings; + } + + public EchoServiceShouldGeneratePartialUsualStub getStub() { + return stub; + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * 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 (EchoServiceShouldGeneratePartialUsualClient echoServiceShouldGeneratePartialUsualClient =
        +   *     EchoServiceShouldGeneratePartialUsualClient.create()) {
        +   *   EchoResponse response =
        +   *       echoServiceShouldGeneratePartialUsualClient.echoShouldGenerateAsUsual();
        +   * }
        +   * }
        + * + * @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 EchoResponse echoShouldGenerateAsUsual() { + EchoRequest request = EchoRequest.newBuilder().build(); + return echoShouldGenerateAsUsual(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * 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 (EchoServiceShouldGeneratePartialUsualClient echoServiceShouldGeneratePartialUsualClient =
        +   *     EchoServiceShouldGeneratePartialUsualClient.create()) {
        +   *   FoobarName name = FoobarName.of("[PROJECT]", "[FOOBAR]");
        +   *   EchoResponse response =
        +   *       echoServiceShouldGeneratePartialUsualClient.echoShouldGenerateAsUsual(name);
        +   * }
        +   * }
        + * + * @param name + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final EchoResponse echoShouldGenerateAsUsual(FoobarName name) { + EchoRequest request = + EchoRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + return echoShouldGenerateAsUsual(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * 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 (EchoServiceShouldGeneratePartialUsualClient echoServiceShouldGeneratePartialUsualClient =
        +   *     EchoServiceShouldGeneratePartialUsualClient.create()) {
        +   *   String name = FoobarName.of("[PROJECT]", "[FOOBAR]").toString();
        +   *   EchoResponse response =
        +   *       echoServiceShouldGeneratePartialUsualClient.echoShouldGenerateAsUsual(name);
        +   * }
        +   * }
        + * + * @param name + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final EchoResponse echoShouldGenerateAsUsual(String name) { + EchoRequest request = EchoRequest.newBuilder().setName(name).build(); + return echoShouldGenerateAsUsual(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * 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 (EchoServiceShouldGeneratePartialUsualClient echoServiceShouldGeneratePartialUsualClient =
        +   *     EchoServiceShouldGeneratePartialUsualClient.create()) {
        +   *   EchoRequest request =
        +   *       EchoRequest.newBuilder()
        +   *           .setName(FoobarName.of("[PROJECT]", "[FOOBAR]").toString())
        +   *           .setParent(FoobarName.of("[PROJECT]", "[FOOBAR]").toString())
        +   *           .setFoobar(Foobar.newBuilder().build())
        +   *           .build();
        +   *   EchoResponse response =
        +   *       echoServiceShouldGeneratePartialUsualClient.echoShouldGenerateAsUsual(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 EchoResponse echoShouldGenerateAsUsual(EchoRequest request) { + return echoShouldGenerateAsUsualCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * 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 (EchoServiceShouldGeneratePartialUsualClient echoServiceShouldGeneratePartialUsualClient =
        +   *     EchoServiceShouldGeneratePartialUsualClient.create()) {
        +   *   EchoRequest request =
        +   *       EchoRequest.newBuilder()
        +   *           .setName(FoobarName.of("[PROJECT]", "[FOOBAR]").toString())
        +   *           .setParent(FoobarName.of("[PROJECT]", "[FOOBAR]").toString())
        +   *           .setFoobar(Foobar.newBuilder().build())
        +   *           .build();
        +   *   ApiFuture future =
        +   *       echoServiceShouldGeneratePartialUsualClient
        +   *           .echoShouldGenerateAsUsualCallable()
        +   *           .futureCall(request);
        +   *   // Do something.
        +   *   EchoResponse response = future.get();
        +   * }
        +   * }
        + */ + public final UnaryCallable echoShouldGenerateAsUsualCallable() { + return stub.echoShouldGenerateAsUsualCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * 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 (EchoServiceShouldGeneratePartialUsualClient echoServiceShouldGeneratePartialUsualClient =
        +   *     EchoServiceShouldGeneratePartialUsualClient.create()) {
        +   *   BidiStream bidiStream =
        +   *       echoServiceShouldGeneratePartialUsualClient.chatShouldGenerateAsUsualCallable().call();
        +   *   EchoRequest request =
        +   *       EchoRequest.newBuilder()
        +   *           .setName(FoobarName.of("[PROJECT]", "[FOOBAR]").toString())
        +   *           .setParent(FoobarName.of("[PROJECT]", "[FOOBAR]").toString())
        +   *           .setFoobar(Foobar.newBuilder().build())
        +   *           .build();
        +   *   bidiStream.send(request);
        +   *   for (EchoResponse response : bidiStream) {
        +   *     // Do something when a response is received.
        +   *   }
        +   * }
        +   * }
        + */ + public final BidiStreamingCallable + chatShouldGenerateAsUsualCallable() { + return stub.chatShouldGenerateAsUsualCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * 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 (EchoServiceShouldGeneratePartialUsualClient echoServiceShouldGeneratePartialUsualClient =
        +   *     EchoServiceShouldGeneratePartialUsualClient.create()) {
        +   *   BidiStream bidiStream =
        +   *       echoServiceShouldGeneratePartialUsualClient
        +   *           .chatAgainShouldGenerateAsUsualCallable()
        +   *           .call();
        +   *   EchoRequest request =
        +   *       EchoRequest.newBuilder()
        +   *           .setName(FoobarName.of("[PROJECT]", "[FOOBAR]").toString())
        +   *           .setParent(FoobarName.of("[PROJECT]", "[FOOBAR]").toString())
        +   *           .setFoobar(Foobar.newBuilder().build())
        +   *           .build();
        +   *   bidiStream.send(request);
        +   *   for (EchoResponse response : bidiStream) {
        +   *     // Do something when a response is received.
        +   *   }
        +   * }
        +   * }
        + */ + public final BidiStreamingCallable + chatAgainShouldGenerateAsUsualCallable() { + return stub.chatAgainShouldGenerateAsUsualCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * 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 (EchoServiceShouldGeneratePartialUsualClient echoServiceShouldGeneratePartialUsualClient =
        +   *     EchoServiceShouldGeneratePartialUsualClient.create()) {
        +   *   EchoResponse response =
        +   *       echoServiceShouldGeneratePartialUsualClient.chatShouldGenerateAsInternal();
        +   * }
        +   * }
        + * + *

        Warning: This method is for internal use only. Please do not use it directly. + * + * @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 + */ + @InternalApi("This API is not intended for public consumption.") + public final EchoResponse chatShouldGenerateAsInternal() { + EchoRequest request = EchoRequest.newBuilder().build(); + return chatShouldGenerateAsInternal(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * 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 (EchoServiceShouldGeneratePartialUsualClient echoServiceShouldGeneratePartialUsualClient =
        +   *     EchoServiceShouldGeneratePartialUsualClient.create()) {
        +   *   FoobarName name = FoobarName.of("[PROJECT]", "[FOOBAR]");
        +   *   EchoResponse response =
        +   *       echoServiceShouldGeneratePartialUsualClient.chatShouldGenerateAsInternal(name);
        +   * }
        +   * }
        + * + *

        Warning: This method is for internal use only. Please do not use it directly. + * + * @param name + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @InternalApi("This API is not intended for public consumption.") + public final EchoResponse chatShouldGenerateAsInternal(FoobarName name) { + EchoRequest request = + EchoRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + return chatShouldGenerateAsInternal(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * 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 (EchoServiceShouldGeneratePartialUsualClient echoServiceShouldGeneratePartialUsualClient =
        +   *     EchoServiceShouldGeneratePartialUsualClient.create()) {
        +   *   String name = FoobarName.of("[PROJECT]", "[FOOBAR]").toString();
        +   *   EchoResponse response =
        +   *       echoServiceShouldGeneratePartialUsualClient.chatShouldGenerateAsInternal(name);
        +   * }
        +   * }
        + * + *

        Warning: This method is for internal use only. Please do not use it directly. + * + * @param name + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @InternalApi("This API is not intended for public consumption.") + public final EchoResponse chatShouldGenerateAsInternal(String name) { + EchoRequest request = EchoRequest.newBuilder().setName(name).build(); + return chatShouldGenerateAsInternal(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * 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 (EchoServiceShouldGeneratePartialUsualClient echoServiceShouldGeneratePartialUsualClient =
        +   *     EchoServiceShouldGeneratePartialUsualClient.create()) {
        +   *   EchoRequest request =
        +   *       EchoRequest.newBuilder()
        +   *           .setName(FoobarName.of("[PROJECT]", "[FOOBAR]").toString())
        +   *           .setParent(FoobarName.of("[PROJECT]", "[FOOBAR]").toString())
        +   *           .setFoobar(Foobar.newBuilder().build())
        +   *           .build();
        +   *   EchoResponse response =
        +   *       echoServiceShouldGeneratePartialUsualClient.chatShouldGenerateAsInternal(request);
        +   * }
        +   * }
        + * + *

        Warning: This method is for internal use only. Please do not use it directly. + * + * @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 + */ + @InternalApi("This API is not intended for public consumption.") + public final EchoResponse chatShouldGenerateAsInternal(EchoRequest request) { + return chatShouldGenerateAsInternalCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * 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 (EchoServiceShouldGeneratePartialUsualClient echoServiceShouldGeneratePartialUsualClient =
        +   *     EchoServiceShouldGeneratePartialUsualClient.create()) {
        +   *   EchoRequest request =
        +   *       EchoRequest.newBuilder()
        +   *           .setName(FoobarName.of("[PROJECT]", "[FOOBAR]").toString())
        +   *           .setParent(FoobarName.of("[PROJECT]", "[FOOBAR]").toString())
        +   *           .setFoobar(Foobar.newBuilder().build())
        +   *           .build();
        +   *   ApiFuture future =
        +   *       echoServiceShouldGeneratePartialUsualClient
        +   *           .chatShouldGenerateAsInternalCallable()
        +   *           .futureCall(request);
        +   *   // Do something.
        +   *   EchoResponse response = future.get();
        +   * }
        +   * }
        + * + *

        Warning: This method is for internal use only. Please do not use it directly. + */ + @InternalApi("This API is not intended for public consumption.") + public final UnaryCallable chatShouldGenerateAsInternalCallable() { + return stub.chatShouldGenerateAsInternalCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * 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 (EchoServiceShouldGeneratePartialUsualClient echoServiceShouldGeneratePartialUsualClient =
        +   *     EchoServiceShouldGeneratePartialUsualClient.create()) {
        +   *   BidiStream bidiStream =
        +   *       echoServiceShouldGeneratePartialUsualClient.echoShouldGenerateAsInternalCallable().call();
        +   *   EchoRequest request =
        +   *       EchoRequest.newBuilder()
        +   *           .setName(FoobarName.of("[PROJECT]", "[FOOBAR]").toString())
        +   *           .setParent(FoobarName.of("[PROJECT]", "[FOOBAR]").toString())
        +   *           .setFoobar(Foobar.newBuilder().build())
        +   *           .build();
        +   *   bidiStream.send(request);
        +   *   for (EchoResponse response : bidiStream) {
        +   *     // Do something when a response is received.
        +   *   }
        +   * }
        +   * }
        + * + *

        Warning: This method is for internal use only. Please do not use it directly. + */ + @InternalApi("This API is not intended for public consumption.") + public final BidiStreamingCallable + echoShouldGenerateAsInternalCallable() { + return stub.echoShouldGenerateAsInternalCallable(); + } + + @Override + public final void close() { + stub.close(); + } + + @Override + public void shutdown() { + stub.shutdown(); + } + + @Override + public boolean isShutdown() { + return stub.isShutdown(); + } + + @Override + public boolean isTerminated() { + return stub.isTerminated(); + } + + @Override + public void shutdownNow() { + stub.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return stub.awaitTermination(duration, unit); + } +} diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/EchoServiceSelectiveGapicClientStub.golden b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/EchoServiceSelectiveGapicClientStub.golden new file mode 100644 index 0000000000..d654e9644c --- /dev/null +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/EchoServiceSelectiveGapicClientStub.golden @@ -0,0 +1,49 @@ +package com.google.selective.generate.v1beta1.stub; + +import com.google.api.core.BetaApi; +import com.google.api.core.InternalApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.rpc.BidiStreamingCallable; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.selective.generate.v1beta1.EchoRequest; +import com.google.selective.generate.v1beta1.EchoResponse; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Base stub class for the EchoServiceShouldGeneratePartialUsual service API. + * + *

        This class is for advanced usage and reflects the underlying API directly. + */ +@BetaApi +@Generated("by gapic-generator-java") +public abstract class EchoServiceShouldGeneratePartialUsualStub implements BackgroundResource { + + public UnaryCallable echoShouldGenerateAsUsualCallable() { + throw new UnsupportedOperationException("Not implemented: echoShouldGenerateAsUsualCallable()"); + } + + public BidiStreamingCallable chatShouldGenerateAsUsualCallable() { + throw new UnsupportedOperationException("Not implemented: chatShouldGenerateAsUsualCallable()"); + } + + public BidiStreamingCallable chatAgainShouldGenerateAsUsualCallable() { + throw new UnsupportedOperationException( + "Not implemented: chatAgainShouldGenerateAsUsualCallable()"); + } + + @InternalApi("This API is not intended for public consumption.") + public UnaryCallable chatShouldGenerateAsInternalCallable() { + throw new UnsupportedOperationException( + "Not implemented: chatShouldGenerateAsInternalCallable()"); + } + + @InternalApi("This API is not intended for public consumption.") + public BidiStreamingCallable echoShouldGenerateAsInternalCallable() { + throw new UnsupportedOperationException( + "Not implemented: echoShouldGenerateAsInternalCallable()"); + } + + @Override + public abstract void close(); +} diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/EchoServiceSelectiveGapicServiceSettings.golden b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/EchoServiceSelectiveGapicServiceSettings.golden new file mode 100644 index 0000000000..e78f11aef4 --- /dev/null +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/EchoServiceSelectiveGapicServiceSettings.golden @@ -0,0 +1,262 @@ +package com.google.selective.generate.v1beta1; + +import com.google.api.core.ApiFunction; +import com.google.api.core.BetaApi; +import com.google.api.core.InternalApi; +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.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.selective.generate.v1beta1.stub.EchoServiceShouldGeneratePartialUsualStubSettings; +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 EchoServiceShouldGeneratePartialUsualClient}. + * + *

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

          + *
        • The default service address (localhost) and default port (7469) 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 echoShouldGenerateAsUsual: + * + *

        {@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
        + * EchoServiceShouldGeneratePartialUsualSettings.Builder
        + *     echoServiceShouldGeneratePartialUsualSettingsBuilder =
        + *         EchoServiceShouldGeneratePartialUsualSettings.newBuilder();
        + * echoServiceShouldGeneratePartialUsualSettingsBuilder
        + *     .echoShouldGenerateAsUsualSettings()
        + *     .setRetrySettings(
        + *         echoServiceShouldGeneratePartialUsualSettingsBuilder
        + *             .echoShouldGenerateAsUsualSettings()
        + *             .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());
        + * EchoServiceShouldGeneratePartialUsualSettings echoServiceShouldGeneratePartialUsualSettings =
        + *     echoServiceShouldGeneratePartialUsualSettingsBuilder.build();
        + * }
        + * + * Please refer to the [Client Side Retry + * Guide](https://docs.cloud.google.com/java/docs/client-retries) for additional support in setting + * retries. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class EchoServiceShouldGeneratePartialUsualSettings + extends ClientSettings { + + /** Returns the object with the settings used for calls to echoShouldGenerateAsUsual. */ + public UnaryCallSettings echoShouldGenerateAsUsualSettings() { + return ((EchoServiceShouldGeneratePartialUsualStubSettings) getStubSettings()) + .echoShouldGenerateAsUsualSettings(); + } + + /** Returns the object with the settings used for calls to chatShouldGenerateAsUsual. */ + public StreamingCallSettings chatShouldGenerateAsUsualSettings() { + return ((EchoServiceShouldGeneratePartialUsualStubSettings) getStubSettings()) + .chatShouldGenerateAsUsualSettings(); + } + + /** Returns the object with the settings used for calls to chatAgainShouldGenerateAsUsual. */ + public StreamingCallSettings chatAgainShouldGenerateAsUsualSettings() { + return ((EchoServiceShouldGeneratePartialUsualStubSettings) getStubSettings()) + .chatAgainShouldGenerateAsUsualSettings(); + } + + /** + * Returns the object with the settings used for calls to chatShouldGenerateAsInternal. + * + *

        Warning: This method is for internal use only. Please do not use it directly. + */ + @InternalApi("This API is not intended for public consumption.") + public UnaryCallSettings chatShouldGenerateAsInternalSettings() { + return ((EchoServiceShouldGeneratePartialUsualStubSettings) getStubSettings()) + .chatShouldGenerateAsInternalSettings(); + } + + /** + * Returns the object with the settings used for calls to echoShouldGenerateAsInternal. + * + *

        Warning: This method is for internal use only. Please do not use it directly. + */ + @InternalApi("This API is not intended for public consumption.") + public StreamingCallSettings echoShouldGenerateAsInternalSettings() { + return ((EchoServiceShouldGeneratePartialUsualStubSettings) getStubSettings()) + .echoShouldGenerateAsInternalSettings(); + } + + public static final EchoServiceShouldGeneratePartialUsualSettings create( + EchoServiceShouldGeneratePartialUsualStubSettings stub) throws IOException { + return new EchoServiceShouldGeneratePartialUsualSettings.Builder(stub.toBuilder()).build(); + } + + /** Returns a builder for the default ExecutorProvider for this service. */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return EchoServiceShouldGeneratePartialUsualStubSettings.defaultExecutorProviderBuilder(); + } + + /** Returns the default service endpoint. */ + public static String getDefaultEndpoint() { + return EchoServiceShouldGeneratePartialUsualStubSettings.getDefaultEndpoint(); + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return EchoServiceShouldGeneratePartialUsualStubSettings.getDefaultServiceScopes(); + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return EchoServiceShouldGeneratePartialUsualStubSettings.defaultCredentialsProviderBuilder(); + } + + /** Returns a builder for the default ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return EchoServiceShouldGeneratePartialUsualStubSettings.defaultGrpcTransportProviderBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return EchoServiceShouldGeneratePartialUsualStubSettings.defaultTransportChannelProvider(); + } + + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return EchoServiceShouldGeneratePartialUsualStubSettings + .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 EchoServiceShouldGeneratePartialUsualSettings(Builder settingsBuilder) + throws IOException { + super(settingsBuilder); + } + + /** Builder for EchoServiceShouldGeneratePartialUsualSettings. */ + public static class Builder + extends ClientSettings.Builder { + + protected Builder() throws IOException { + this(((ClientContext) null)); + } + + protected Builder(ClientContext clientContext) { + super(EchoServiceShouldGeneratePartialUsualStubSettings.newBuilder(clientContext)); + } + + protected Builder(EchoServiceShouldGeneratePartialUsualSettings settings) { + super(settings.getStubSettings().toBuilder()); + } + + protected Builder(EchoServiceShouldGeneratePartialUsualStubSettings.Builder stubSettings) { + super(stubSettings); + } + + private static Builder createDefault() { + return new Builder(EchoServiceShouldGeneratePartialUsualStubSettings.newBuilder()); + } + + public EchoServiceShouldGeneratePartialUsualStubSettings.Builder getStubSettingsBuilder() { + return ((EchoServiceShouldGeneratePartialUsualStubSettings.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 echoShouldGenerateAsUsual. */ + public UnaryCallSettings.Builder + echoShouldGenerateAsUsualSettings() { + return getStubSettingsBuilder().echoShouldGenerateAsUsualSettings(); + } + + /** Returns the builder for the settings used for calls to chatShouldGenerateAsUsual. */ + public StreamingCallSettings.Builder + chatShouldGenerateAsUsualSettings() { + return getStubSettingsBuilder().chatShouldGenerateAsUsualSettings(); + } + + /** Returns the builder for the settings used for calls to chatAgainShouldGenerateAsUsual. */ + public StreamingCallSettings.Builder + chatAgainShouldGenerateAsUsualSettings() { + return getStubSettingsBuilder().chatAgainShouldGenerateAsUsualSettings(); + } + + /** + * Returns the builder for the settings used for calls to chatShouldGenerateAsInternal. + * + *

        Warning: This method is for internal use only. Please do not use it directly. + */ + @InternalApi("This API is not intended for public consumption.") + public UnaryCallSettings.Builder + chatShouldGenerateAsInternalSettings() { + return getStubSettingsBuilder().chatShouldGenerateAsInternalSettings(); + } + + /** + * Returns the builder for the settings used for calls to echoShouldGenerateAsInternal. + * + *

        Warning: This method is for internal use only. Please do not use it directly. + */ + @InternalApi("This API is not intended for public consumption.") + public StreamingCallSettings.Builder + echoShouldGenerateAsInternalSettings() { + return getStubSettingsBuilder().echoShouldGenerateAsInternalSettings(); + } + + @Override + public EchoServiceShouldGeneratePartialUsualSettings build() throws IOException { + return new EchoServiceShouldGeneratePartialUsualSettings(this); + } + } +} diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/EchoServiceSelectiveGapicStubSettings.golden b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/EchoServiceSelectiveGapicStubSettings.golden new file mode 100644 index 0000000000..e2b808edc1 --- /dev/null +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/EchoServiceSelectiveGapicStubSettings.golden @@ -0,0 +1,386 @@ +package com.google.selective.generate.v1beta1.stub; + +import com.google.api.core.ApiFunction; +import com.google.api.core.BetaApi; +import com.google.api.core.InternalApi; +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.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.LibraryMetadata; +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.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.ImmutableSet; +import com.google.common.collect.Lists; +import com.google.selective.generate.v1beta1.EchoRequest; +import com.google.selective.generate.v1beta1.EchoResponse; +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 EchoServiceShouldGeneratePartialUsualStub}. + * + *

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

          + *
        • The default service address (localhost) and default port (7469) 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 echoShouldGenerateAsUsual: + * + *

        {@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
        + * EchoServiceShouldGeneratePartialUsualStubSettings.Builder
        + *     echoServiceShouldGeneratePartialUsualSettingsBuilder =
        + *         EchoServiceShouldGeneratePartialUsualStubSettings.newBuilder();
        + * echoServiceShouldGeneratePartialUsualSettingsBuilder
        + *     .echoShouldGenerateAsUsualSettings()
        + *     .setRetrySettings(
        + *         echoServiceShouldGeneratePartialUsualSettingsBuilder
        + *             .echoShouldGenerateAsUsualSettings()
        + *             .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());
        + * EchoServiceShouldGeneratePartialUsualStubSettings
        + *     echoServiceShouldGeneratePartialUsualSettings =
        + *         echoServiceShouldGeneratePartialUsualSettingsBuilder.build();
        + * }
        + * + * Please refer to the [Client Side Retry + * Guide](https://docs.cloud.google.com/java/docs/client-retries) for additional support in setting + * retries. + */ +@BetaApi +@Generated("by gapic-generator-java") +@SuppressWarnings("CanonicalDuration") +public class EchoServiceShouldGeneratePartialUsualStubSettings + extends StubSettings { + /** The default scopes of the service. */ + private static final ImmutableList DEFAULT_SERVICE_SCOPES = + ImmutableList.builder().build(); + + private final UnaryCallSettings echoShouldGenerateAsUsualSettings; + private final StreamingCallSettings chatShouldGenerateAsUsualSettings; + private final StreamingCallSettings + chatAgainShouldGenerateAsUsualSettings; + private final UnaryCallSettings chatShouldGenerateAsInternalSettings; + private final StreamingCallSettings + echoShouldGenerateAsInternalSettings; + + /** Returns the object with the settings used for calls to echoShouldGenerateAsUsual. */ + public UnaryCallSettings echoShouldGenerateAsUsualSettings() { + return echoShouldGenerateAsUsualSettings; + } + + /** Returns the object with the settings used for calls to chatShouldGenerateAsUsual. */ + public StreamingCallSettings chatShouldGenerateAsUsualSettings() { + return chatShouldGenerateAsUsualSettings; + } + + /** Returns the object with the settings used for calls to chatAgainShouldGenerateAsUsual. */ + public StreamingCallSettings chatAgainShouldGenerateAsUsualSettings() { + return chatAgainShouldGenerateAsUsualSettings; + } + + /** + * Returns the object with the settings used for calls to chatShouldGenerateAsInternal. + * + *

        Warning: This method is for internal use only. Please do not use it directly. + */ + @InternalApi("This API is not intended for public consumption.") + public UnaryCallSettings chatShouldGenerateAsInternalSettings() { + return chatShouldGenerateAsInternalSettings; + } + + /** + * Returns the object with the settings used for calls to echoShouldGenerateAsInternal. + * + *

        Warning: This method is for internal use only. Please do not use it directly. + */ + @InternalApi("This API is not intended for public consumption.") + public StreamingCallSettings echoShouldGenerateAsInternalSettings() { + return echoShouldGenerateAsInternalSettings; + } + + public EchoServiceShouldGeneratePartialUsualStub createStub() throws IOException { + if (getTransportChannelProvider() + .getTransportName() + .equals(GrpcTransportChannel.getGrpcTransportName())) { + return GrpcEchoServiceShouldGeneratePartialUsualStub.create(this); + } + throw new UnsupportedOperationException( + String.format( + "Transport not supported: %s", getTransportChannelProvider().getTransportName())); + } + + /** Returns a builder for the default ExecutorProvider for this service. */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return InstantiatingExecutorProvider.newBuilder(); + } + + /** Returns the default service endpoint. */ + @ObsoleteApi("Use getEndpoint() instead") + public static String getDefaultEndpoint() { + return "localhost:7469"; + } + + /** Returns the default mTLS service endpoint. */ + public static String getDefaultMtlsEndpoint() { + return "localhost:7469"; + } + + /** 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( + EchoServiceShouldGeneratePartialUsualStubSettings.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 EchoServiceShouldGeneratePartialUsualStubSettings(Builder settingsBuilder) + throws IOException { + super(settingsBuilder); + + echoShouldGenerateAsUsualSettings = settingsBuilder.echoShouldGenerateAsUsualSettings().build(); + chatShouldGenerateAsUsualSettings = settingsBuilder.chatShouldGenerateAsUsualSettings().build(); + chatAgainShouldGenerateAsUsualSettings = + settingsBuilder.chatAgainShouldGenerateAsUsualSettings().build(); + chatShouldGenerateAsInternalSettings = + settingsBuilder.chatShouldGenerateAsInternalSettings().build(); + echoShouldGenerateAsInternalSettings = + settingsBuilder.echoShouldGenerateAsInternalSettings().build(); + } + + @Override + protected LibraryMetadata getLibraryMetadata() { + return LibraryMetadata.newBuilder().setVersion(Version.VERSION).build(); + } + + /** Builder for EchoServiceShouldGeneratePartialUsualStubSettings. */ + public static class Builder + extends StubSettings.Builder { + private final ImmutableList> unaryMethodSettingsBuilders; + private final UnaryCallSettings.Builder + echoShouldGenerateAsUsualSettings; + private final StreamingCallSettings.Builder + chatShouldGenerateAsUsualSettings; + private final StreamingCallSettings.Builder + chatAgainShouldGenerateAsUsualSettings; + private final UnaryCallSettings.Builder + chatShouldGenerateAsInternalSettings; + private final StreamingCallSettings.Builder + echoShouldGenerateAsInternalSettings; + private static final ImmutableMap> + RETRYABLE_CODE_DEFINITIONS; + + static { + ImmutableMap.Builder> definitions = + ImmutableMap.builder(); + definitions.put("no_retry_codes", ImmutableSet.copyOf(Lists.newArrayList())); + RETRYABLE_CODE_DEFINITIONS = definitions.build(); + } + + private static final ImmutableMap RETRY_PARAM_DEFINITIONS; + + static { + ImmutableMap.Builder definitions = ImmutableMap.builder(); + RetrySettings settings = null; + settings = RetrySettings.newBuilder().setRpcTimeoutMultiplier(1.0).build(); + definitions.put("no_retry_params", settings); + RETRY_PARAM_DEFINITIONS = definitions.build(); + } + + protected Builder() { + this(((ClientContext) null)); + } + + protected Builder(ClientContext clientContext) { + super(clientContext); + + echoShouldGenerateAsUsualSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + chatShouldGenerateAsUsualSettings = StreamingCallSettings.newBuilder(); + chatAgainShouldGenerateAsUsualSettings = StreamingCallSettings.newBuilder(); + chatShouldGenerateAsInternalSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + echoShouldGenerateAsInternalSettings = StreamingCallSettings.newBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + echoShouldGenerateAsUsualSettings, chatShouldGenerateAsInternalSettings); + initDefaults(this); + } + + protected Builder(EchoServiceShouldGeneratePartialUsualStubSettings settings) { + super(settings); + + echoShouldGenerateAsUsualSettings = settings.echoShouldGenerateAsUsualSettings.toBuilder(); + chatShouldGenerateAsUsualSettings = settings.chatShouldGenerateAsUsualSettings.toBuilder(); + chatAgainShouldGenerateAsUsualSettings = + settings.chatAgainShouldGenerateAsUsualSettings.toBuilder(); + chatShouldGenerateAsInternalSettings = + settings.chatShouldGenerateAsInternalSettings.toBuilder(); + echoShouldGenerateAsInternalSettings = + settings.echoShouldGenerateAsInternalSettings.toBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + echoShouldGenerateAsUsualSettings, chatShouldGenerateAsInternalSettings); + } + + 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 + .echoShouldGenerateAsUsualSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .chatShouldGenerateAsInternalSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_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 echoShouldGenerateAsUsual. */ + public UnaryCallSettings.Builder + echoShouldGenerateAsUsualSettings() { + return echoShouldGenerateAsUsualSettings; + } + + /** Returns the builder for the settings used for calls to chatShouldGenerateAsUsual. */ + public StreamingCallSettings.Builder + chatShouldGenerateAsUsualSettings() { + return chatShouldGenerateAsUsualSettings; + } + + /** Returns the builder for the settings used for calls to chatAgainShouldGenerateAsUsual. */ + public StreamingCallSettings.Builder + chatAgainShouldGenerateAsUsualSettings() { + return chatAgainShouldGenerateAsUsualSettings; + } + + /** + * Returns the builder for the settings used for calls to chatShouldGenerateAsInternal. + * + *

        Warning: This method is for internal use only. Please do not use it directly. + */ + @InternalApi("This API is not intended for public consumption.") + public UnaryCallSettings.Builder + chatShouldGenerateAsInternalSettings() { + return chatShouldGenerateAsInternalSettings; + } + + /** + * Returns the builder for the settings used for calls to echoShouldGenerateAsInternal. + * + *

        Warning: This method is for internal use only. Please do not use it directly. + */ + @InternalApi("This API is not intended for public consumption.") + public StreamingCallSettings.Builder + echoShouldGenerateAsInternalSettings() { + return echoShouldGenerateAsInternalSettings; + } + + @Override + public EchoServiceShouldGeneratePartialUsualStubSettings build() throws IOException { + return new EchoServiceShouldGeneratePartialUsualStubSettings(this); + } + } +} diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/EchoSettings.golden b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/EchoSettings.golden index 3b6ece49e5..753662f8f9 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/EchoSettings.golden +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/EchoSettings.golden @@ -39,7 +39,9 @@ import javax.annotation.Generated; *

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

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

        For example, to set the + * [RetrySettings](https://cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.retrying.RetrySettings) + * of echo: * *

        {@code
          * // This snippet has been automatically generated and should be regarded as a code template only.
        @@ -55,10 +57,46 @@ import javax.annotation.Generated;
          *             .echoSettings()
          *             .getRetrySettings()
          *             .toBuilder()
        - *             .setTotalTimeout(Duration.ofSeconds(30))
        + *             .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());
          * EchoSettings echoSettings = echoSettingsBuilder.build();
          * }
        + * + * Please refer to the [Client Side Retry + * Guide](https://docs.cloud.google.com/java/docs/client-retries) 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 wait: + * + *

        {@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
        + * EchoSettings.Builder echoSettingsBuilder = EchoSettings.newBuilder();
        + * TimedRetryAlgorithm timedRetryAlgorithm =
        + *     OperationalTimedPollAlgorithm.create(
        + *         RetrySettings.newBuilder()
        + *             .setInitialRetryDelayDuration(Duration.ofMillis(500))
        + *             .setRetryDelayMultiplier(1.5)
        + *             .setMaxRetryDelayDuration(Duration.ofMillis(5000))
        + *             .setTotalTimeoutDuration(Duration.ofHours(24))
        + *             .build());
        + * echoSettingsBuilder
        + *     .createClusterOperationSettings()
        + *     .setPollingAlgorithm(timedRetryAlgorithm)
        + *     .build();
        + * }
        */ @BetaApi @Generated("by gapic-generator-java") @@ -121,6 +159,12 @@ public class EchoSettings extends ClientSettings { return ((EchoStubSettings) getStubSettings()).collideNameSettings(); } + /** Returns the object with the settings used for calls to pagedExpandLegacy. */ + public UnaryCallSettings + pagedExpandLegacySettings() { + return ((EchoStubSettings) getStubSettings()).pagedExpandLegacySettings(); + } + public static final EchoSettings create(EchoStubSettings stub) throws IOException { return new EchoSettings.Builder(stub.toBuilder()).build(); } @@ -154,7 +198,6 @@ public class EchoSettings extends ClientSettings { return EchoStubSettings.defaultTransportChannelProvider(); } - @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { return EchoStubSettings.defaultApiClientHeaderProviderBuilder(); } @@ -277,6 +320,12 @@ public class EchoSettings extends ClientSettings { return getStubSettingsBuilder().collideNameSettings(); } + /** Returns the builder for the settings used for calls to pagedExpandLegacy. */ + public UnaryCallSettings.Builder + pagedExpandLegacySettings() { + return getStubSettingsBuilder().pagedExpandLegacySettings(); + } + @Override public EchoSettings build() throws IOException { return new EchoSettings(this); diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/EchoStub.golden b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/EchoStub.golden index 9270f22851..c43465da68 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/EchoStub.golden +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/EchoStub.golden @@ -18,6 +18,7 @@ import com.google.showcase.v1beta1.EchoRequest; import com.google.showcase.v1beta1.EchoResponse; import com.google.showcase.v1beta1.ExpandRequest; import com.google.showcase.v1beta1.Object; +import com.google.showcase.v1beta1.PagedExpandLegacyRequest; import com.google.showcase.v1beta1.PagedExpandRequest; import com.google.showcase.v1beta1.PagedExpandResponse; import com.google.showcase.v1beta1.WaitMetadata; @@ -92,6 +93,10 @@ public abstract class EchoStub implements BackgroundResource { throw new UnsupportedOperationException("Not implemented: collideNameCallable()"); } + public UnaryCallable pagedExpandLegacyCallable() { + throw new UnsupportedOperationException("Not implemented: pagedExpandLegacyCallable()"); + } + @Override public abstract void close(); } diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/EchoStubSettings.golden b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/EchoStubSettings.golden index b04e5d4767..530dc8a269 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/EchoStubSettings.golden +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/EchoStubSettings.golden @@ -6,6 +6,7 @@ import static com.google.showcase.v1beta1.EchoClient.SimplePagedExpandPagedRespo import com.google.api.core.ApiFunction; import com.google.api.core.ApiFuture; import com.google.api.core.BetaApi; +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; @@ -19,6 +20,7 @@ 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.LibraryMetadata; import com.google.api.gax.rpc.OperationCallSettings; import com.google.api.gax.rpc.PageContext; import com.google.api.gax.rpc.PagedCallSettings; @@ -42,15 +44,16 @@ import com.google.showcase.v1beta1.EchoRequest; import com.google.showcase.v1beta1.EchoResponse; import com.google.showcase.v1beta1.ExpandRequest; import com.google.showcase.v1beta1.Object; +import com.google.showcase.v1beta1.PagedExpandLegacyRequest; import com.google.showcase.v1beta1.PagedExpandRequest; import com.google.showcase.v1beta1.PagedExpandResponse; import com.google.showcase.v1beta1.WaitMetadata; import com.google.showcase.v1beta1.WaitRequest; import com.google.showcase.v1beta1.WaitResponse; import java.io.IOException; +import java.time.Duration; import java.util.List; import javax.annotation.Generated; -import org.threeten.bp.Duration; // AUTO-GENERATED DOCUMENTATION AND CLASS. /** @@ -67,7 +70,9 @@ import org.threeten.bp.Duration; *

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

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

        For example, to set the + * [RetrySettings](https://cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.retrying.RetrySettings) + * of echo: * *

        {@code
          * // This snippet has been automatically generated and should be regarded as a code template only.
        @@ -83,13 +88,50 @@ import org.threeten.bp.Duration;
          *             .echoSettings()
          *             .getRetrySettings()
          *             .toBuilder()
        - *             .setTotalTimeout(Duration.ofSeconds(30))
        + *             .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());
          * EchoStubSettings echoSettings = echoSettingsBuilder.build();
          * }
        + * + * Please refer to the [Client Side Retry + * Guide](https://docs.cloud.google.com/java/docs/client-retries) 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 wait: + * + *

        {@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
        + * EchoStubSettings.Builder echoSettingsBuilder = EchoStubSettings.newBuilder();
        + * TimedRetryAlgorithm timedRetryAlgorithm =
        + *     OperationalTimedPollAlgorithm.create(
        + *         RetrySettings.newBuilder()
        + *             .setInitialRetryDelayDuration(Duration.ofMillis(500))
        + *             .setRetryDelayMultiplier(1.5)
        + *             .setMaxRetryDelayDuration(Duration.ofMillis(5000))
        + *             .setTotalTimeoutDuration(Duration.ofHours(24))
        + *             .build());
        + * echoSettingsBuilder
        + *     .createClusterOperationSettings()
        + *     .setPollingAlgorithm(timedRetryAlgorithm)
        + *     .build();
        + * }
        */ @BetaApi @Generated("by gapic-generator-java") +@SuppressWarnings("CanonicalDuration") public class EchoStubSettings extends StubSettings { /** The default scopes of the service. */ private static final ImmutableList DEFAULT_SERVICE_SCOPES = @@ -110,6 +152,8 @@ public class EchoStubSettings extends StubSettings { waitOperationSettings; private final UnaryCallSettings blockSettings; private final UnaryCallSettings collideNameSettings; + private final UnaryCallSettings + pagedExpandLegacySettings; private static final PagedListDescriptor PAGED_EXPAND_PAGE_STR_DESC = @@ -141,9 +185,7 @@ public class EchoStubSettings extends StubSettings { @Override public Iterable extractResources(PagedExpandResponse payload) { - return payload.getResponsesList() == null - ? ImmutableList.of() - : payload.getResponsesList(); + return payload.getResponsesList(); } }; @@ -177,9 +219,7 @@ public class EchoStubSettings extends StubSettings { @Override public Iterable extractResources(PagedExpandResponse payload) { - return payload.getResponsesList() == null - ? ImmutableList.of() - : payload.getResponsesList(); + return payload.getResponsesList(); } }; @@ -274,6 +314,12 @@ public class EchoStubSettings extends StubSettings { return collideNameSettings; } + /** Returns the object with the settings used for calls to pagedExpandLegacy. */ + public UnaryCallSettings + pagedExpandLegacySettings() { + return pagedExpandLegacySettings; + } + public EchoStub createStub() throws IOException { if (getTransportChannelProvider() .getTransportName() @@ -291,6 +337,7 @@ public class EchoStubSettings extends StubSettings { } /** Returns the default service endpoint. */ + @ObsoleteApi("Use getEndpoint() instead") public static String getDefaultEndpoint() { return "localhost:7469"; } @@ -322,7 +369,6 @@ public class EchoStubSettings extends StubSettings { return defaultGrpcTransportProviderBuilder().build(); } - @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { return ApiClientHeaderProvider.newBuilder() .setGeneratedLibToken("gapic", GaxProperties.getLibraryVersion(EchoStubSettings.class)) @@ -359,6 +405,16 @@ public class EchoStubSettings extends StubSettings { waitOperationSettings = settingsBuilder.waitOperationSettings().build(); blockSettings = settingsBuilder.blockSettings().build(); collideNameSettings = settingsBuilder.collideNameSettings().build(); + pagedExpandLegacySettings = settingsBuilder.pagedExpandLegacySettings().build(); + } + + @Override + protected LibraryMetadata getLibraryMetadata() { + return LibraryMetadata.newBuilder() + .setArtifactName("com.google.cloud:gapic-showcase") + .setRepository("googleapis/sdk-platform-java") + .setVersion(Version.VERSION) + .build(); } /** Builder for EchoStubSettings. */ @@ -380,6 +436,8 @@ public class EchoStubSettings extends StubSettings { waitOperationSettings; private final UnaryCallSettings.Builder blockSettings; private final UnaryCallSettings.Builder collideNameSettings; + private final UnaryCallSettings.Builder + pagedExpandLegacySettings; private static final ImmutableMap> RETRYABLE_CODE_DEFINITIONS; @@ -403,21 +461,21 @@ public class EchoStubSettings extends StubSettings { RetrySettings settings = null; settings = RetrySettings.newBuilder() - .setInitialRetryDelay(Duration.ofMillis(100L)) + .setInitialRetryDelayDuration(Duration.ofMillis(100L)) .setRetryDelayMultiplier(2.0) - .setMaxRetryDelay(Duration.ofMillis(3000L)) - .setInitialRpcTimeout(Duration.ofMillis(10000L)) + .setMaxRetryDelayDuration(Duration.ofMillis(3000L)) + .setInitialRpcTimeoutDuration(Duration.ofMillis(10000L)) .setRpcTimeoutMultiplier(1.0) - .setMaxRpcTimeout(Duration.ofMillis(10000L)) - .setTotalTimeout(Duration.ofMillis(10000L)) + .setMaxRpcTimeoutDuration(Duration.ofMillis(10000L)) + .setTotalTimeoutDuration(Duration.ofMillis(10000L)) .build(); definitions.put("retry_policy_1_params", settings); settings = RetrySettings.newBuilder() - .setInitialRpcTimeout(Duration.ofMillis(5000L)) + .setInitialRpcTimeoutDuration(Duration.ofMillis(5000L)) .setRpcTimeoutMultiplier(1.0) - .setMaxRpcTimeout(Duration.ofMillis(5000L)) - .setTotalTimeout(Duration.ofMillis(5000L)) + .setMaxRpcTimeoutDuration(Duration.ofMillis(5000L)) + .setTotalTimeoutDuration(Duration.ofMillis(5000L)) .build(); definitions.put("no_retry_0_params", settings); RETRY_PARAM_DEFINITIONS = definitions.build(); @@ -441,6 +499,7 @@ public class EchoStubSettings extends StubSettings { waitOperationSettings = OperationCallSettings.newBuilder(); blockSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); collideNameSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + pagedExpandLegacySettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); unaryMethodSettingsBuilders = ImmutableList.>of( @@ -449,7 +508,8 @@ public class EchoStubSettings extends StubSettings { simplePagedExpandSettings, waitSettings, blockSettings, - collideNameSettings); + collideNameSettings, + pagedExpandLegacySettings); initDefaults(this); } @@ -467,6 +527,7 @@ public class EchoStubSettings extends StubSettings { waitOperationSettings = settings.waitOperationSettings.toBuilder(); blockSettings = settings.blockSettings.toBuilder(); collideNameSettings = settings.collideNameSettings.toBuilder(); + pagedExpandLegacySettings = settings.pagedExpandLegacySettings.toBuilder(); unaryMethodSettingsBuilders = ImmutableList.>of( @@ -475,7 +536,8 @@ public class EchoStubSettings extends StubSettings { simplePagedExpandSettings, waitSettings, blockSettings, - collideNameSettings); + collideNameSettings, + pagedExpandLegacySettings); } private static Builder createDefault() { @@ -484,7 +546,6 @@ public class EchoStubSettings extends StubSettings { builder.setTransportChannelProvider(defaultTransportChannelProvider()); builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); builder.setInternalHeaderProvider(defaultApiClientHeaderProviderBuilder().build()); - builder.setEndpoint(getDefaultEndpoint()); builder.setMtlsEndpoint(getDefaultMtlsEndpoint()); builder.setSwitchToMtlsEndpointAllowed(true); @@ -527,6 +588,11 @@ public class EchoStubSettings extends StubSettings { .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + builder + .pagedExpandLegacySettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + builder .waitOperationSettings() .setInitialCallSettings( @@ -541,13 +607,13 @@ public class EchoStubSettings extends StubSettings { .setPollingAlgorithm( OperationTimedPollAlgorithm.create( RetrySettings.newBuilder() - .setInitialRetryDelay(Duration.ofMillis(5000L)) + .setInitialRetryDelayDuration(Duration.ofMillis(5000L)) .setRetryDelayMultiplier(1.5) - .setMaxRetryDelay(Duration.ofMillis(45000L)) - .setInitialRpcTimeout(Duration.ZERO) + .setMaxRetryDelayDuration(Duration.ofMillis(45000L)) + .setInitialRpcTimeoutDuration(Duration.ZERO) .setRpcTimeoutMultiplier(1.0) - .setMaxRpcTimeout(Duration.ZERO) - .setTotalTimeout(Duration.ofMillis(300000L)) + .setMaxRpcTimeoutDuration(Duration.ZERO) + .setTotalTimeoutDuration(Duration.ofMillis(300000L)) .build())); return builder; @@ -613,8 +679,6 @@ public class EchoStubSettings extends StubSettings { } /** Returns the builder for the settings used for calls to wait. */ - @BetaApi( - "The surface for use by generated code is not stable yet and may change in the future.") public OperationCallSettings.Builder waitOperationSettings() { return waitOperationSettings; @@ -630,6 +694,12 @@ public class EchoStubSettings extends StubSettings { return collideNameSettings; } + /** Returns the builder for the settings used for calls to pagedExpandLegacy. */ + public UnaryCallSettings.Builder + pagedExpandLegacySettings() { + return pagedExpandLegacySettings; + } + @Override public EchoStubSettings build() throws IOException { return new EchoStubSettings(this); diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/GrpcAutoPopulateFieldStub.golden b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/GrpcAutoPopulateFieldStub.golden new file mode 100644 index 0000000000..f3614d7226 --- /dev/null +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/GrpcAutoPopulateFieldStub.golden @@ -0,0 +1,286 @@ +package com.google.auto.populate.field.stub; + +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.grpc.GrpcCallSettings; +import com.google.api.gax.grpc.GrpcStubCallableFactory; +import com.google.api.gax.rpc.BidiStreamingCallable; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientStreamingCallable; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.auto.populate.field.AutoPopulateFieldTestingEchoRequest; +import com.google.auto.populate.field.AutoPopulateFieldTestingEchoResponse; +import com.google.auto.populate.field.AutoPopulateFieldTestingExpandRequest; +import com.google.common.base.Strings; +import com.google.longrunning.stub.GrpcOperationsStub; +import io.grpc.MethodDescriptor; +import io.grpc.protobuf.ProtoUtils; +import java.io.IOException; +import java.util.UUID; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * gRPC stub implementation for the AutoPopulateFieldTesting service API. + * + *

        This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by gapic-generator-java") +public class GrpcAutoPopulateFieldTestingStub extends AutoPopulateFieldTestingStub { + private static final MethodDescriptor< + AutoPopulateFieldTestingEchoRequest, AutoPopulateFieldTestingEchoResponse> + autoPopulateFieldTestingEchoMethodDescriptor = + MethodDescriptor + . + newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.auto.populate.field.AutoPopulateFieldTesting/AutoPopulateFieldTestingEcho") + .setRequestMarshaller( + ProtoUtils.marshaller(AutoPopulateFieldTestingEchoRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(AutoPopulateFieldTestingEchoResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor< + AutoPopulateFieldTestingExpandRequest, AutoPopulateFieldTestingEchoResponse> + autoPopulateFieldTestingExpandMethodDescriptor = + MethodDescriptor + . + newBuilder() + .setType(MethodDescriptor.MethodType.SERVER_STREAMING) + .setFullMethodName( + "google.auto.populate.field.AutoPopulateFieldTesting/AutoPopulateFieldTestingExpand") + .setRequestMarshaller( + ProtoUtils.marshaller(AutoPopulateFieldTestingExpandRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(AutoPopulateFieldTestingEchoResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor< + AutoPopulateFieldTestingEchoRequest, AutoPopulateFieldTestingEchoResponse> + autoPopulateFieldTestingCollectMethodDescriptor = + MethodDescriptor + . + newBuilder() + .setType(MethodDescriptor.MethodType.CLIENT_STREAMING) + .setFullMethodName( + "google.auto.populate.field.AutoPopulateFieldTesting/AutoPopulateFieldTestingCollect") + .setRequestMarshaller( + ProtoUtils.marshaller(AutoPopulateFieldTestingEchoRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(AutoPopulateFieldTestingEchoResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor< + AutoPopulateFieldTestingEchoRequest, AutoPopulateFieldTestingEchoResponse> + autoPopulateFieldTestingChatMethodDescriptor = + MethodDescriptor + . + newBuilder() + .setType(MethodDescriptor.MethodType.BIDI_STREAMING) + .setFullMethodName( + "google.auto.populate.field.AutoPopulateFieldTesting/AutoPopulateFieldTestingChat") + .setRequestMarshaller( + ProtoUtils.marshaller(AutoPopulateFieldTestingEchoRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(AutoPopulateFieldTestingEchoResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private final UnaryCallable< + AutoPopulateFieldTestingEchoRequest, AutoPopulateFieldTestingEchoResponse> + autoPopulateFieldTestingEchoCallable; + private final ServerStreamingCallable< + AutoPopulateFieldTestingExpandRequest, AutoPopulateFieldTestingEchoResponse> + autoPopulateFieldTestingExpandCallable; + private final ClientStreamingCallable< + AutoPopulateFieldTestingEchoRequest, AutoPopulateFieldTestingEchoResponse> + autoPopulateFieldTestingCollectCallable; + private final BidiStreamingCallable< + AutoPopulateFieldTestingEchoRequest, AutoPopulateFieldTestingEchoResponse> + autoPopulateFieldTestingChatCallable; + + private final BackgroundResource backgroundResources; + private final GrpcOperationsStub operationsStub; + private final GrpcStubCallableFactory callableFactory; + + public static final GrpcAutoPopulateFieldTestingStub create( + AutoPopulateFieldTestingStubSettings settings) throws IOException { + return new GrpcAutoPopulateFieldTestingStub(settings, ClientContext.create(settings)); + } + + public static final GrpcAutoPopulateFieldTestingStub create(ClientContext clientContext) + throws IOException { + return new GrpcAutoPopulateFieldTestingStub( + AutoPopulateFieldTestingStubSettings.newBuilder().build(), clientContext); + } + + public static final GrpcAutoPopulateFieldTestingStub create( + ClientContext clientContext, GrpcStubCallableFactory callableFactory) throws IOException { + return new GrpcAutoPopulateFieldTestingStub( + AutoPopulateFieldTestingStubSettings.newBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of GrpcAutoPopulateFieldTestingStub, 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 GrpcAutoPopulateFieldTestingStub( + AutoPopulateFieldTestingStubSettings settings, ClientContext clientContext) + throws IOException { + this(settings, clientContext, new GrpcAutoPopulateFieldTestingCallableFactory()); + } + + /** + * Constructs an instance of GrpcAutoPopulateFieldTestingStub, 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 GrpcAutoPopulateFieldTestingStub( + AutoPopulateFieldTestingStubSettings settings, + ClientContext clientContext, + GrpcStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + this.operationsStub = GrpcOperationsStub.create(clientContext, callableFactory); + + GrpcCallSettings + autoPopulateFieldTestingEchoTransportSettings = + GrpcCallSettings + . + newBuilder() + .setMethodDescriptor(autoPopulateFieldTestingEchoMethodDescriptor) + .setRequestMutator( + request -> { + AutoPopulateFieldTestingEchoRequest.Builder requestBuilder = + request.toBuilder(); + if (Strings.isNullOrEmpty(request.getRequestId())) { + requestBuilder.setRequestId(UUID.randomUUID().toString()); + } + if (Strings.isNullOrEmpty(request.getSecondRequestId())) { + requestBuilder.setSecondRequestId(UUID.randomUUID().toString()); + } + return requestBuilder.build(); + }) + .build(); + GrpcCallSettings + autoPopulateFieldTestingExpandTransportSettings = + GrpcCallSettings + . + newBuilder() + .setMethodDescriptor(autoPopulateFieldTestingExpandMethodDescriptor) + .build(); + GrpcCallSettings + autoPopulateFieldTestingCollectTransportSettings = + GrpcCallSettings + . + newBuilder() + .setMethodDescriptor(autoPopulateFieldTestingCollectMethodDescriptor) + .build(); + GrpcCallSettings + autoPopulateFieldTestingChatTransportSettings = + GrpcCallSettings + . + newBuilder() + .setMethodDescriptor(autoPopulateFieldTestingChatMethodDescriptor) + .build(); + + this.autoPopulateFieldTestingEchoCallable = + callableFactory.createUnaryCallable( + autoPopulateFieldTestingEchoTransportSettings, + settings.autoPopulateFieldTestingEchoSettings(), + clientContext); + this.autoPopulateFieldTestingExpandCallable = + callableFactory.createServerStreamingCallable( + autoPopulateFieldTestingExpandTransportSettings, + settings.autoPopulateFieldTestingExpandSettings(), + clientContext); + this.autoPopulateFieldTestingCollectCallable = + callableFactory.createClientStreamingCallable( + autoPopulateFieldTestingCollectTransportSettings, + settings.autoPopulateFieldTestingCollectSettings(), + clientContext); + this.autoPopulateFieldTestingChatCallable = + callableFactory.createBidiStreamingCallable( + autoPopulateFieldTestingChatTransportSettings, + settings.autoPopulateFieldTestingChatSettings(), + clientContext); + + this.backgroundResources = + new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + public GrpcOperationsStub getOperationsStub() { + return operationsStub; + } + + @Override + public UnaryCallable + autoPopulateFieldTestingEchoCallable() { + return autoPopulateFieldTestingEchoCallable; + } + + @Override + public ServerStreamingCallable< + AutoPopulateFieldTestingExpandRequest, AutoPopulateFieldTestingEchoResponse> + autoPopulateFieldTestingExpandCallable() { + return autoPopulateFieldTestingExpandCallable; + } + + @Override + public ClientStreamingCallable< + AutoPopulateFieldTestingEchoRequest, AutoPopulateFieldTestingEchoResponse> + autoPopulateFieldTestingCollectCallable() { + return autoPopulateFieldTestingCollectCallable; + } + + @Override + public BidiStreamingCallable< + AutoPopulateFieldTestingEchoRequest, AutoPopulateFieldTestingEchoResponse> + autoPopulateFieldTestingChatCallable() { + return autoPopulateFieldTestingChatCallable; + } + + @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/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/GrpcBigQueryJobServiceStub.golden b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/GrpcBigQueryJobServiceStub.golden new file mode 100644 index 0000000000..a6a08d1acb --- /dev/null +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/GrpcBigQueryJobServiceStub.golden @@ -0,0 +1,189 @@ +package com.google.cloud.bigquery.v2.stub; + +import static com.google.cloud.bigquery.v2.JobServiceClient.ListJobsPagedResponse; + +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.cloud.bigquery.v2.JobProto; +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.Map; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * gRPC stub implementation for the JobService service API. + * + *

        This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by gapic-generator-java") +public class GrpcJobServiceStub extends JobServiceStub { + private static final MethodDescriptor + deleteJobMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.bigquery.v2.JobService/DeleteJob") + .setRequestMarshaller( + ProtoUtils.marshaller(JobProto.DeleteJobRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Empty.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor + listJobsMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.bigquery.v2.JobService/ListJobs") + .setRequestMarshaller( + ProtoUtils.marshaller(JobProto.ListJobsRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(JobProto.JobList.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private final UnaryCallable deleteJobCallable; + private final UnaryCallable listJobsCallable; + private final UnaryCallable + listJobsPagedCallable; + + private final BackgroundResource backgroundResources; + private final GrpcOperationsStub operationsStub; + private final GrpcStubCallableFactory callableFactory; + + public static final GrpcJobServiceStub create(JobServiceStubSettings settings) + throws IOException { + return new GrpcJobServiceStub(settings, ClientContext.create(settings)); + } + + public static final GrpcJobServiceStub create(ClientContext clientContext) throws IOException { + return new GrpcJobServiceStub(JobServiceStubSettings.newBuilder().build(), clientContext); + } + + public static final GrpcJobServiceStub create( + ClientContext clientContext, GrpcStubCallableFactory callableFactory) throws IOException { + return new GrpcJobServiceStub( + JobServiceStubSettings.newBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of GrpcJobServiceStub, 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 GrpcJobServiceStub(JobServiceStubSettings settings, ClientContext clientContext) + throws IOException { + this(settings, clientContext, new GrpcJobServiceCallableFactory()); + } + + /** + * Constructs an instance of GrpcJobServiceStub, 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 GrpcJobServiceStub( + JobServiceStubSettings settings, + ClientContext clientContext, + GrpcStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + this.operationsStub = GrpcOperationsStub.create(clientContext, callableFactory); + + GrpcCallSettings deleteJobTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(deleteJobMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("job_id", String.valueOf(request.getJobId())); + builder.add("project_id", String.valueOf(request.getProjectId())); + return builder.build(); + }) + .build(); + GrpcCallSettings listJobsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(listJobsMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("project_id", String.valueOf(request.getProjectId())); + return builder.build(); + }) + .build(); + + this.deleteJobCallable = + callableFactory.createUnaryCallable( + deleteJobTransportSettings, settings.deleteJobSettings(), clientContext); + this.listJobsCallable = + callableFactory.createUnaryCallable( + listJobsTransportSettings, settings.listJobsSettings(), clientContext); + this.listJobsPagedCallable = + callableFactory.createPagedCallable( + listJobsTransportSettings, settings.listJobsSettings(), clientContext); + + this.backgroundResources = + new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + public GrpcOperationsStub getOperationsStub() { + return operationsStub; + } + + @Override + public UnaryCallable deleteJobCallable() { + return deleteJobCallable; + } + + @Override + public UnaryCallable listJobsCallable() { + return listJobsCallable; + } + + @Override + public UnaryCallable listJobsPagedCallable() { + return listJobsPagedCallable; + } + + @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/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/GrpcCallableNameTypeStub.golden b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/GrpcCallableNameTypeStub.golden new file mode 100644 index 0000000000..870c0181d1 --- /dev/null +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/GrpcCallableNameTypeStub.golden @@ -0,0 +1,181 @@ +package com.google.test.callablenamingtype.stub; + +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.grpc.GrpcCallSettings; +import com.google.api.gax.grpc.GrpcStubCallableFactory; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.RequestParamsBuilder; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.longrunning.stub.GrpcOperationsStub; +import com.google.test.callablenamingtype.ApiOperation; +import com.google.test.callablenamingtype.GetApiOperationRequest; +import io.grpc.MethodDescriptor; +import io.grpc.protobuf.ProtoUtils; +import java.io.IOException; +import java.util.Map; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * gRPC stub implementation for the CallableNameTypeService service API. + * + *

        This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by gapic-generator-java") +public class GrpcCallableNameTypeServiceStub extends CallableNameTypeServiceStub { + private static final MethodDescriptor + getApiOperationMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.test.naming.CallableNameTypeService/GetApiOperation") + .setRequestMarshaller( + ProtoUtils.marshaller(GetApiOperationRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(ApiOperation.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor + apiPagedMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.test.naming.CallableNameTypeService/ApiPaged") + .setRequestMarshaller( + ProtoUtils.marshaller(GetApiOperationRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(ApiOperation.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private final UnaryCallable getApiOperationCallable; + private final UnaryCallable apiPagedCallable; + + private final BackgroundResource backgroundResources; + private final GrpcOperationsStub operationsStub; + private final GrpcStubCallableFactory callableFactory; + + public static final GrpcCallableNameTypeServiceStub create( + CallableNameTypeServiceStubSettings settings) throws IOException { + return new GrpcCallableNameTypeServiceStub(settings, ClientContext.create(settings)); + } + + public static final GrpcCallableNameTypeServiceStub create(ClientContext clientContext) + throws IOException { + return new GrpcCallableNameTypeServiceStub( + CallableNameTypeServiceStubSettings.newBuilder().build(), clientContext); + } + + public static final GrpcCallableNameTypeServiceStub create( + ClientContext clientContext, GrpcStubCallableFactory callableFactory) throws IOException { + return new GrpcCallableNameTypeServiceStub( + CallableNameTypeServiceStubSettings.newBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of GrpcCallableNameTypeServiceStub, 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 GrpcCallableNameTypeServiceStub( + CallableNameTypeServiceStubSettings settings, ClientContext clientContext) + throws IOException { + this(settings, clientContext, new GrpcCallableNameTypeServiceCallableFactory()); + } + + /** + * Constructs an instance of GrpcCallableNameTypeServiceStub, 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 GrpcCallableNameTypeServiceStub( + CallableNameTypeServiceStubSettings settings, + ClientContext clientContext, + GrpcStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + this.operationsStub = GrpcOperationsStub.create(clientContext, callableFactory); + + GrpcCallSettings getApiOperationTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getApiOperationMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .setResourceNameExtractor(request -> request.getName()) + .build(); + GrpcCallSettings apiPagedTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(apiPagedMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .setResourceNameExtractor(request -> request.getName()) + .build(); + + this.getApiOperationCallable = + callableFactory.createUnaryCallable( + getApiOperationTransportSettings, settings.getApiOperationSettings(), clientContext); + this.apiPagedCallable = + callableFactory.createUnaryCallable( + apiPagedTransportSettings, settings.apiPagedSettings(), clientContext); + + this.backgroundResources = + new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + public GrpcOperationsStub getOperationsStub() { + return operationsStub; + } + + @Override + public UnaryCallable getApiOperationCallable() { + return getApiOperationCallable; + } + + @Override + public UnaryCallable apiPagedCallable() { + return apiPagedCallable; + } + + @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/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/GrpcDeprecatedServiceStub.golden b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/GrpcDeprecatedServiceStub.golden index b472790622..c225eb1a32 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/GrpcDeprecatedServiceStub.golden +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/GrpcDeprecatedServiceStub.golden @@ -32,6 +32,7 @@ public class GrpcDeprecatedServiceStub extends DeprecatedServiceStub { .setFullMethodName("google.testdata.v1.DeprecatedService/FastFibonacci") .setRequestMarshaller(ProtoUtils.marshaller(FibonacciRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(Empty.getDefaultInstance())) + .setSampledToLocalTracing(true) .build(); private static final MethodDescriptor slowFibonacciMethodDescriptor = @@ -40,6 +41,7 @@ public class GrpcDeprecatedServiceStub extends DeprecatedServiceStub { .setFullMethodName("google.testdata.v1.DeprecatedService/SlowFibonacci") .setRequestMarshaller(ProtoUtils.marshaller(FibonacciRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(Empty.getDefaultInstance())) + .setSampledToLocalTracing(true) .build(); private final UnaryCallable fastFibonacciCallable; diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/GrpcEchoStub.golden b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/GrpcEchoStub.golden index 940ab7d4c4..6b6bf63681 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/GrpcEchoStub.golden +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/GrpcEchoStub.golden @@ -22,6 +22,7 @@ import com.google.showcase.v1beta1.EchoRequest; import com.google.showcase.v1beta1.EchoResponse; import com.google.showcase.v1beta1.ExpandRequest; import com.google.showcase.v1beta1.Object; +import com.google.showcase.v1beta1.PagedExpandLegacyRequest; import com.google.showcase.v1beta1.PagedExpandRequest; import com.google.showcase.v1beta1.PagedExpandResponse; import com.google.showcase.v1beta1.WaitMetadata; @@ -48,6 +49,7 @@ public class GrpcEchoStub extends EchoStub { .setFullMethodName("google.showcase.v1beta1.Echo/Echo") .setRequestMarshaller(ProtoUtils.marshaller(EchoRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(EchoResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) .build(); private static final MethodDescriptor expandMethodDescriptor = @@ -56,6 +58,7 @@ public class GrpcEchoStub extends EchoStub { .setFullMethodName("google.showcase.v1beta1.Echo/Expand") .setRequestMarshaller(ProtoUtils.marshaller(ExpandRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(EchoResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) .build(); private static final MethodDescriptor collectMethodDescriptor = @@ -64,6 +67,7 @@ public class GrpcEchoStub extends EchoStub { .setFullMethodName("google.showcase.v1beta1.Echo/Collect") .setRequestMarshaller(ProtoUtils.marshaller(EchoRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(EchoResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) .build(); private static final MethodDescriptor chatMethodDescriptor = @@ -72,6 +76,7 @@ public class GrpcEchoStub extends EchoStub { .setFullMethodName("google.showcase.v1beta1.Echo/Chat") .setRequestMarshaller(ProtoUtils.marshaller(EchoRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(EchoResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) .build(); private static final MethodDescriptor chatAgainMethodDescriptor = @@ -80,6 +85,7 @@ public class GrpcEchoStub extends EchoStub { .setFullMethodName("google.showcase.v1beta1.Echo/ChatAgain") .setRequestMarshaller(ProtoUtils.marshaller(EchoRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(EchoResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) .build(); private static final MethodDescriptor @@ -90,6 +96,7 @@ public class GrpcEchoStub extends EchoStub { .setRequestMarshaller(ProtoUtils.marshaller(PagedExpandRequest.getDefaultInstance())) .setResponseMarshaller( ProtoUtils.marshaller(PagedExpandResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) .build(); private static final MethodDescriptor @@ -100,6 +107,7 @@ public class GrpcEchoStub extends EchoStub { .setRequestMarshaller(ProtoUtils.marshaller(PagedExpandRequest.getDefaultInstance())) .setResponseMarshaller( ProtoUtils.marshaller(PagedExpandResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) .build(); private static final MethodDescriptor waitMethodDescriptor = @@ -108,6 +116,7 @@ public class GrpcEchoStub extends EchoStub { .setFullMethodName("google.showcase.v1beta1.Echo/Wait") .setRequestMarshaller(ProtoUtils.marshaller(WaitRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .setSampledToLocalTracing(true) .build(); private static final MethodDescriptor blockMethodDescriptor = @@ -116,6 +125,7 @@ public class GrpcEchoStub extends EchoStub { .setFullMethodName("google.showcase.v1beta1.Echo/Block") .setRequestMarshaller(ProtoUtils.marshaller(BlockRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(BlockResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) .build(); private static final MethodDescriptor collideNameMethodDescriptor = @@ -124,8 +134,21 @@ public class GrpcEchoStub extends EchoStub { .setFullMethodName("google.showcase.v1beta1.Echo/CollideName") .setRequestMarshaller(ProtoUtils.marshaller(EchoRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(Object.getDefaultInstance())) + .setSampledToLocalTracing(true) .build(); + private static final MethodDescriptor + pagedExpandLegacyMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.showcase.v1beta1.Echo/PagedExpandLegacy") + .setRequestMarshaller( + ProtoUtils.marshaller(PagedExpandLegacyRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(PagedExpandResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + private final UnaryCallable echoCallable; private final ServerStreamingCallable expandCallable; private final ClientStreamingCallable collectCallable; @@ -141,6 +164,8 @@ public class GrpcEchoStub extends EchoStub { private final OperationCallable waitOperationCallable; private final UnaryCallable blockCallable; private final UnaryCallable collideNameCallable; + private final UnaryCallable + pagedExpandLegacyCallable; private final BackgroundResource backgroundResources; private final GrpcOperationsStub operationsStub; @@ -183,6 +208,7 @@ public class GrpcEchoStub extends EchoStub { GrpcCallSettings echoTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(echoMethodDescriptor) + .setResourceNameExtractor(request -> request.getName()) .build(); GrpcCallSettings expandTransportSettings = GrpcCallSettings.newBuilder() @@ -191,14 +217,17 @@ public class GrpcEchoStub extends EchoStub { GrpcCallSettings collectTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(collectMethodDescriptor) + .setResourceNameExtractor(request -> request.getName()) .build(); GrpcCallSettings chatTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(chatMethodDescriptor) + .setResourceNameExtractor(request -> request.getName()) .build(); GrpcCallSettings chatAgainTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(chatAgainMethodDescriptor) + .setResourceNameExtractor(request -> request.getName()) .build(); GrpcCallSettings pagedExpandTransportSettings = GrpcCallSettings.newBuilder() @@ -219,7 +248,13 @@ public class GrpcEchoStub extends EchoStub { GrpcCallSettings collideNameTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(collideNameMethodDescriptor) + .setResourceNameExtractor(request -> request.getName()) .build(); + GrpcCallSettings + pagedExpandLegacyTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(pagedExpandLegacyMethodDescriptor) + .build(); this.echoCallable = callableFactory.createUnaryCallable( @@ -264,6 +299,11 @@ public class GrpcEchoStub extends EchoStub { this.collideNameCallable = callableFactory.createUnaryCallable( collideNameTransportSettings, settings.collideNameSettings(), clientContext); + this.pagedExpandLegacyCallable = + callableFactory.createUnaryCallable( + pagedExpandLegacyTransportSettings, + settings.pagedExpandLegacySettings(), + clientContext); this.backgroundResources = new BackgroundResourceAggregation(clientContext.getBackgroundResources()); @@ -339,6 +379,11 @@ public class GrpcEchoStub extends EchoStub { return collideNameCallable; } + @Override + public UnaryCallable pagedExpandLegacyCallable() { + return pagedExpandLegacyCallable; + } + @Override public final void close() { try { diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/GrpcLoggingStub.golden b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/GrpcLoggingStub.golden index 09386582c9..940d0c779a 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/GrpcLoggingStub.golden +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/GrpcLoggingStub.golden @@ -10,8 +10,8 @@ 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.common.collect.ImmutableMap; import com.google.logging.v2.DeleteLogRequest; import com.google.logging.v2.ListLogEntriesRequest; import com.google.logging.v2.ListLogEntriesResponse; @@ -46,6 +46,7 @@ public class GrpcLoggingServiceV2Stub extends LoggingServiceV2Stub { .setFullMethodName("google.logging.v2.LoggingServiceV2/DeleteLog") .setRequestMarshaller(ProtoUtils.marshaller(DeleteLogRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(Empty.getDefaultInstance())) + .setSampledToLocalTracing(true) .build(); private static final MethodDescriptor @@ -57,6 +58,7 @@ public class GrpcLoggingServiceV2Stub extends LoggingServiceV2Stub { ProtoUtils.marshaller(WriteLogEntriesRequest.getDefaultInstance())) .setResponseMarshaller( ProtoUtils.marshaller(WriteLogEntriesResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) .build(); private static final MethodDescriptor @@ -68,6 +70,7 @@ public class GrpcLoggingServiceV2Stub extends LoggingServiceV2Stub { ProtoUtils.marshaller(ListLogEntriesRequest.getDefaultInstance())) .setResponseMarshaller( ProtoUtils.marshaller(ListLogEntriesResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) .build(); private static final MethodDescriptor< @@ -85,6 +88,7 @@ public class GrpcLoggingServiceV2Stub extends LoggingServiceV2Stub { .setResponseMarshaller( ProtoUtils.marshaller( ListMonitoredResourceDescriptorsResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) .build(); private static final MethodDescriptor @@ -94,6 +98,7 @@ public class GrpcLoggingServiceV2Stub extends LoggingServiceV2Stub { .setFullMethodName("google.logging.v2.LoggingServiceV2/ListLogs") .setRequestMarshaller(ProtoUtils.marshaller(ListLogsRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(ListLogsResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) .build(); private static final MethodDescriptor @@ -105,6 +110,7 @@ public class GrpcLoggingServiceV2Stub extends LoggingServiceV2Stub { ProtoUtils.marshaller(TailLogEntriesRequest.getDefaultInstance())) .setResponseMarshaller( ProtoUtils.marshaller(TailLogEntriesResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) .build(); private final UnaryCallable deleteLogCallable; @@ -173,15 +179,17 @@ public class GrpcLoggingServiceV2Stub extends LoggingServiceV2Stub { .setMethodDescriptor(deleteLogMethodDescriptor) .setParamsExtractor( request -> { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("log_name", String.valueOf(request.getLogName())); - return params.build(); + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("log_name", String.valueOf(request.getLogName())); + return builder.build(); }) + .setResourceNameExtractor(request -> request.getLogName()) .build(); GrpcCallSettings writeLogEntriesTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(writeLogEntriesMethodDescriptor) + .setResourceNameExtractor(request -> request.getLogName()) .build(); GrpcCallSettings listLogEntriesTransportSettings = @@ -201,10 +209,11 @@ public class GrpcLoggingServiceV2Stub extends LoggingServiceV2Stub { .setMethodDescriptor(listLogsMethodDescriptor) .setParamsExtractor( request -> { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("parent", String.valueOf(request.getParent())); - return params.build(); + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); }) + .setResourceNameExtractor(request -> request.getParent()) .build(); GrpcCallSettings tailLogEntriesTransportSettings = diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/GrpcPublisherStub.golden b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/GrpcPublisherStub.golden index 1b61e70b05..a881a35e88 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/GrpcPublisherStub.golden +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/GrpcPublisherStub.golden @@ -9,8 +9,8 @@ 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.common.collect.ImmutableMap; import com.google.longrunning.stub.GrpcOperationsStub; import com.google.protobuf.Empty; import com.google.pubsub.v1.DeleteTopicRequest; @@ -48,6 +48,7 @@ public class GrpcPublisherStub extends PublisherStub { .setFullMethodName("google.pubsub.v1.Publisher/CreateTopic") .setRequestMarshaller(ProtoUtils.marshaller(Topic.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(Topic.getDefaultInstance())) + .setSampledToLocalTracing(true) .build(); private static final MethodDescriptor updateTopicMethodDescriptor = @@ -56,6 +57,7 @@ public class GrpcPublisherStub extends PublisherStub { .setFullMethodName("google.pubsub.v1.Publisher/UpdateTopic") .setRequestMarshaller(ProtoUtils.marshaller(UpdateTopicRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(Topic.getDefaultInstance())) + .setSampledToLocalTracing(true) .build(); private static final MethodDescriptor publishMethodDescriptor = @@ -64,6 +66,7 @@ public class GrpcPublisherStub extends PublisherStub { .setFullMethodName("google.pubsub.v1.Publisher/Publish") .setRequestMarshaller(ProtoUtils.marshaller(PublishRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(PublishResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) .build(); private static final MethodDescriptor getTopicMethodDescriptor = @@ -72,6 +75,7 @@ public class GrpcPublisherStub extends PublisherStub { .setFullMethodName("google.pubsub.v1.Publisher/GetTopic") .setRequestMarshaller(ProtoUtils.marshaller(GetTopicRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(Topic.getDefaultInstance())) + .setSampledToLocalTracing(true) .build(); private static final MethodDescriptor @@ -81,6 +85,7 @@ public class GrpcPublisherStub extends PublisherStub { .setFullMethodName("google.pubsub.v1.Publisher/ListTopics") .setRequestMarshaller(ProtoUtils.marshaller(ListTopicsRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(ListTopicsResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) .build(); private static final MethodDescriptor< @@ -94,6 +99,7 @@ public class GrpcPublisherStub extends PublisherStub { ProtoUtils.marshaller(ListTopicSubscriptionsRequest.getDefaultInstance())) .setResponseMarshaller( ProtoUtils.marshaller(ListTopicSubscriptionsResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) .build(); private static final MethodDescriptor @@ -105,6 +111,7 @@ public class GrpcPublisherStub extends PublisherStub { ProtoUtils.marshaller(ListTopicSnapshotsRequest.getDefaultInstance())) .setResponseMarshaller( ProtoUtils.marshaller(ListTopicSnapshotsResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) .build(); private static final MethodDescriptor deleteTopicMethodDescriptor = @@ -113,6 +120,7 @@ public class GrpcPublisherStub extends PublisherStub { .setFullMethodName("google.pubsub.v1.Publisher/DeleteTopic") .setRequestMarshaller(ProtoUtils.marshaller(DeleteTopicRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(Empty.getDefaultInstance())) + .setSampledToLocalTracing(true) .build(); private static final MethodDescriptor @@ -124,6 +132,7 @@ public class GrpcPublisherStub extends PublisherStub { ProtoUtils.marshaller(DetachSubscriptionRequest.getDefaultInstance())) .setResponseMarshaller( ProtoUtils.marshaller(DetachSubscriptionResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) .build(); private final UnaryCallable createTopicCallable; @@ -190,19 +199,20 @@ public class GrpcPublisherStub extends PublisherStub { .setMethodDescriptor(createTopicMethodDescriptor) .setParamsExtractor( request -> { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("name", String.valueOf(request.getName())); - return params.build(); + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); }) + .setResourceNameExtractor(request -> request.getName()) .build(); GrpcCallSettings updateTopicTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(updateTopicMethodDescriptor) .setParamsExtractor( request -> { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("topic.name", String.valueOf(request.getTopic().getName())); - return params.build(); + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("topic.name", String.valueOf(request.getTopic().getName())); + return builder.build(); }) .build(); GrpcCallSettings publishTransportSettings = @@ -210,30 +220,33 @@ public class GrpcPublisherStub extends PublisherStub { .setMethodDescriptor(publishMethodDescriptor) .setParamsExtractor( request -> { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("topic", String.valueOf(request.getTopic())); - return params.build(); + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("topic", String.valueOf(request.getTopic())); + return builder.build(); }) + .setResourceNameExtractor(request -> request.getTopic()) .build(); GrpcCallSettings getTopicTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(getTopicMethodDescriptor) .setParamsExtractor( request -> { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("topic", String.valueOf(request.getTopic())); - return params.build(); + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("topic", String.valueOf(request.getTopic())); + return builder.build(); }) + .setResourceNameExtractor(request -> request.getTopic()) .build(); GrpcCallSettings listTopicsTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(listTopicsMethodDescriptor) .setParamsExtractor( request -> { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("project", String.valueOf(request.getProject())); - return params.build(); + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("project", String.valueOf(request.getProject())); + return builder.build(); }) + .setResourceNameExtractor(request -> request.getProject()) .build(); GrpcCallSettings listTopicSubscriptionsTransportSettings = @@ -242,10 +255,11 @@ public class GrpcPublisherStub extends PublisherStub { .setMethodDescriptor(listTopicSubscriptionsMethodDescriptor) .setParamsExtractor( request -> { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("topic", String.valueOf(request.getTopic())); - return params.build(); + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("topic", String.valueOf(request.getTopic())); + return builder.build(); }) + .setResourceNameExtractor(request -> request.getTopic()) .build(); GrpcCallSettings listTopicSnapshotsTransportSettings = @@ -253,20 +267,22 @@ public class GrpcPublisherStub extends PublisherStub { .setMethodDescriptor(listTopicSnapshotsMethodDescriptor) .setParamsExtractor( request -> { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("topic", String.valueOf(request.getTopic())); - return params.build(); + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("topic", String.valueOf(request.getTopic())); + return builder.build(); }) + .setResourceNameExtractor(request -> request.getTopic()) .build(); GrpcCallSettings deleteTopicTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(deleteTopicMethodDescriptor) .setParamsExtractor( request -> { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("topic", String.valueOf(request.getTopic())); - return params.build(); + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("topic", String.valueOf(request.getTopic())); + return builder.build(); }) + .setResourceNameExtractor(request -> request.getTopic()) .build(); GrpcCallSettings detachSubscriptionTransportSettings = @@ -274,10 +290,11 @@ public class GrpcPublisherStub extends PublisherStub { .setMethodDescriptor(detachSubscriptionMethodDescriptor) .setParamsExtractor( request -> { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("subscription", String.valueOf(request.getSubscription())); - return params.build(); + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("subscription", String.valueOf(request.getSubscription())); + return builder.build(); }) + .setResourceNameExtractor(request -> request.getSubscription()) .build(); this.createTopicCallable = diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/GrpcResourceNameExtractorStub.golden b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/GrpcResourceNameExtractorStub.golden new file mode 100644 index 0000000000..371e29f394 --- /dev/null +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/GrpcResourceNameExtractorStub.golden @@ -0,0 +1,212 @@ +package com.google.extractor.testing.stub; + +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.grpc.GrpcCallSettings; +import com.google.api.gax.grpc.GrpcStubCallableFactory; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.RequestParamsBuilder; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.extractor.testing.Bar; +import com.google.extractor.testing.Foo; +import com.google.extractor.testing.GetBarRequest; +import com.google.extractor.testing.GetFooRequest; +import com.google.extractor.testing.ListFoosRequest; +import com.google.extractor.testing.ListFoosResponse; +import com.google.longrunning.stub.GrpcOperationsStub; +import io.grpc.MethodDescriptor; +import io.grpc.protobuf.ProtoUtils; +import java.io.IOException; +import java.util.Map; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * gRPC stub implementation for the ResourceNameExtractorTesting service API. + * + *

        This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by gapic-generator-java") +public class GrpcResourceNameExtractorTestingStub extends ResourceNameExtractorTestingStub { + private static final MethodDescriptor getFooMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.extractor.testing.ResourceNameExtractorTesting/GetFoo") + .setRequestMarshaller(ProtoUtils.marshaller(GetFooRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Foo.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor getBarMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.extractor.testing.ResourceNameExtractorTesting/GetBar") + .setRequestMarshaller(ProtoUtils.marshaller(GetBarRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Bar.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor + listFoosMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.extractor.testing.ResourceNameExtractorTesting/ListFoos") + .setRequestMarshaller(ProtoUtils.marshaller(ListFoosRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(ListFoosResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private final UnaryCallable getFooCallable; + private final UnaryCallable getBarCallable; + private final UnaryCallable listFoosCallable; + + private final BackgroundResource backgroundResources; + private final GrpcOperationsStub operationsStub; + private final GrpcStubCallableFactory callableFactory; + + public static final GrpcResourceNameExtractorTestingStub create( + ResourceNameExtractorTestingStubSettings settings) throws IOException { + return new GrpcResourceNameExtractorTestingStub(settings, ClientContext.create(settings)); + } + + public static final GrpcResourceNameExtractorTestingStub create(ClientContext clientContext) + throws IOException { + return new GrpcResourceNameExtractorTestingStub( + ResourceNameExtractorTestingStubSettings.newBuilder().build(), clientContext); + } + + public static final GrpcResourceNameExtractorTestingStub create( + ClientContext clientContext, GrpcStubCallableFactory callableFactory) throws IOException { + return new GrpcResourceNameExtractorTestingStub( + ResourceNameExtractorTestingStubSettings.newBuilder().build(), + clientContext, + callableFactory); + } + + /** + * Constructs an instance of GrpcResourceNameExtractorTestingStub, 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 GrpcResourceNameExtractorTestingStub( + ResourceNameExtractorTestingStubSettings settings, ClientContext clientContext) + throws IOException { + this(settings, clientContext, new GrpcResourceNameExtractorTestingCallableFactory()); + } + + /** + * Constructs an instance of GrpcResourceNameExtractorTestingStub, 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 GrpcResourceNameExtractorTestingStub( + ResourceNameExtractorTestingStubSettings settings, + ClientContext clientContext, + GrpcStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + this.operationsStub = GrpcOperationsStub.create(clientContext, callableFactory); + + GrpcCallSettings getFooTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getFooMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .setResourceNameExtractor(request -> request.getName()) + .build(); + GrpcCallSettings getBarTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getBarMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("bar", String.valueOf(request.getBar())); + return builder.build(); + }) + .build(); + GrpcCallSettings listFoosTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(listFoosMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .setResourceNameExtractor(request -> request.getParent()) + .build(); + + this.getFooCallable = + callableFactory.createUnaryCallable( + getFooTransportSettings, settings.getFooSettings(), clientContext); + this.getBarCallable = + callableFactory.createUnaryCallable( + getBarTransportSettings, settings.getBarSettings(), clientContext); + this.listFoosCallable = + callableFactory.createUnaryCallable( + listFoosTransportSettings, settings.listFoosSettings(), clientContext); + + this.backgroundResources = + new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + public GrpcOperationsStub getOperationsStub() { + return operationsStub; + } + + @Override + public UnaryCallable getFooCallable() { + return getFooCallable; + } + + @Override + public UnaryCallable getBarCallable() { + return getBarCallable; + } + + @Override + public UnaryCallable listFoosCallable() { + return listFoosCallable; + } + + @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/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/GrpcRoutingHeadersStub.golden b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/GrpcRoutingHeadersStub.golden index 84489dd164..26b66097b5 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/GrpcRoutingHeadersStub.golden +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/GrpcRoutingHeadersStub.golden @@ -8,7 +8,8 @@ import com.google.api.gax.rpc.ClientContext; import com.google.api.gax.rpc.RequestParamsBuilder; import com.google.api.gax.rpc.UnaryCallable; import com.google.api.pathtemplate.PathTemplate; -import com.google.common.collect.ImmutableMap; +import com.google.explicit.dynamic.routing.header.EnumRequest; +import com.google.explicit.dynamic.routing.header.EnumResponse; import com.google.explicit.dynamic.routing.header.Request; import com.google.explicit.dynamic.routing.header.RequestWithNestedField; import com.google.longrunning.stub.GrpcOperationsStub; @@ -36,6 +37,7 @@ public class GrpcExplicitDynamicRoutingHeaderTestingStub "google.explicit.dynamic.routing.header.ExplicitDynamicRoutingHeaderTesting/Example1Test") .setRequestMarshaller(ProtoUtils.marshaller(Request.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(Empty.getDefaultInstance())) + .setSampledToLocalTracing(true) .build(); private static final MethodDescriptor example2TestMethodDescriptor = @@ -45,6 +47,7 @@ public class GrpcExplicitDynamicRoutingHeaderTestingStub "google.explicit.dynamic.routing.header.ExplicitDynamicRoutingHeaderTesting/Example2Test") .setRequestMarshaller(ProtoUtils.marshaller(Request.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(Empty.getDefaultInstance())) + .setSampledToLocalTracing(true) .build(); private static final MethodDescriptor example3TestMethodDescriptor = @@ -54,6 +57,7 @@ public class GrpcExplicitDynamicRoutingHeaderTestingStub "google.explicit.dynamic.routing.header.ExplicitDynamicRoutingHeaderTesting/Example3Test") .setRequestMarshaller(ProtoUtils.marshaller(Request.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(Empty.getDefaultInstance())) + .setSampledToLocalTracing(true) .build(); private static final MethodDescriptor example3CTestMethodDescriptor = @@ -63,6 +67,7 @@ public class GrpcExplicitDynamicRoutingHeaderTestingStub "google.explicit.dynamic.routing.header.ExplicitDynamicRoutingHeaderTesting/Example3CTest") .setRequestMarshaller(ProtoUtils.marshaller(Request.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(Empty.getDefaultInstance())) + .setSampledToLocalTracing(true) .build(); private static final MethodDescriptor example4TestMethodDescriptor = @@ -72,6 +77,7 @@ public class GrpcExplicitDynamicRoutingHeaderTestingStub "google.explicit.dynamic.routing.header.ExplicitDynamicRoutingHeaderTesting/Example4Test") .setRequestMarshaller(ProtoUtils.marshaller(Request.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(Empty.getDefaultInstance())) + .setSampledToLocalTracing(true) .build(); private static final MethodDescriptor example5TestMethodDescriptor = @@ -81,6 +87,7 @@ public class GrpcExplicitDynamicRoutingHeaderTestingStub "google.explicit.dynamic.routing.header.ExplicitDynamicRoutingHeaderTesting/Example5Test") .setRequestMarshaller(ProtoUtils.marshaller(Request.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(Empty.getDefaultInstance())) + .setSampledToLocalTracing(true) .build(); private static final MethodDescriptor example6TestMethodDescriptor = @@ -90,6 +97,7 @@ public class GrpcExplicitDynamicRoutingHeaderTestingStub "google.explicit.dynamic.routing.header.ExplicitDynamicRoutingHeaderTesting/Example6Test") .setRequestMarshaller(ProtoUtils.marshaller(Request.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(Empty.getDefaultInstance())) + .setSampledToLocalTracing(true) .build(); private static final MethodDescriptor example7TestMethodDescriptor = @@ -99,6 +107,7 @@ public class GrpcExplicitDynamicRoutingHeaderTestingStub "google.explicit.dynamic.routing.header.ExplicitDynamicRoutingHeaderTesting/Example7Test") .setRequestMarshaller(ProtoUtils.marshaller(Request.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(Empty.getDefaultInstance())) + .setSampledToLocalTracing(true) .build(); private static final MethodDescriptor example8TestMethodDescriptor = @@ -108,6 +117,7 @@ public class GrpcExplicitDynamicRoutingHeaderTestingStub "google.explicit.dynamic.routing.header.ExplicitDynamicRoutingHeaderTesting/Example8Test") .setRequestMarshaller(ProtoUtils.marshaller(Request.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(Empty.getDefaultInstance())) + .setSampledToLocalTracing(true) .build(); private static final MethodDescriptor example9TestMethodDescriptor = @@ -117,6 +127,7 @@ public class GrpcExplicitDynamicRoutingHeaderTestingStub "google.explicit.dynamic.routing.header.ExplicitDynamicRoutingHeaderTesting/Example9Test") .setRequestMarshaller(ProtoUtils.marshaller(Request.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(Empty.getDefaultInstance())) + .setSampledToLocalTracing(true) .build(); private static final MethodDescriptor backwardsCompatible1TestMethodDescriptor = @@ -126,6 +137,7 @@ public class GrpcExplicitDynamicRoutingHeaderTestingStub "google.explicit.dynamic.routing.header.ExplicitDynamicRoutingHeaderTesting/BackwardsCompatible1Test") .setRequestMarshaller(ProtoUtils.marshaller(Request.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(Empty.getDefaultInstance())) + .setSampledToLocalTracing(true) .build(); private static final MethodDescriptor backwardsCompatible2TestMethodDescriptor = @@ -135,6 +147,7 @@ public class GrpcExplicitDynamicRoutingHeaderTestingStub "google.explicit.dynamic.routing.header.ExplicitDynamicRoutingHeaderTesting/BackwardsCompatible2Test") .setRequestMarshaller(ProtoUtils.marshaller(Request.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(Empty.getDefaultInstance())) + .setSampledToLocalTracing(true) .build(); private static final MethodDescriptor backwardsCompatible3TestMethodDescriptor = @@ -144,6 +157,7 @@ public class GrpcExplicitDynamicRoutingHeaderTestingStub "google.explicit.dynamic.routing.header.ExplicitDynamicRoutingHeaderTesting/BackwardsCompatible3Test") .setRequestMarshaller(ProtoUtils.marshaller(Request.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(Empty.getDefaultInstance())) + .setSampledToLocalTracing(true) .build(); private static final MethodDescriptor @@ -155,6 +169,18 @@ public class GrpcExplicitDynamicRoutingHeaderTestingStub .setRequestMarshaller( ProtoUtils.marshaller(RequestWithNestedField.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(Empty.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor + implicitRoutingHeaderWithEnumTestMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.explicit.dynamic.routing.header.ExplicitDynamicRoutingHeaderTesting/ImplicitRoutingHeaderWithEnumTest") + .setRequestMarshaller(ProtoUtils.marshaller(EnumRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(EnumResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) .build(); private final UnaryCallable example1TestCallable; @@ -171,6 +197,7 @@ public class GrpcExplicitDynamicRoutingHeaderTestingStub private final UnaryCallable backwardsCompatible2TestCallable; private final UnaryCallable backwardsCompatible3TestCallable; private final UnaryCallable nestedFieldTestCallable; + private final UnaryCallable implicitRoutingHeaderWithEnumTestCallable; private final BackgroundResource backgroundResources; private final GrpcOperationsStub operationsStub; @@ -407,9 +434,9 @@ public class GrpcExplicitDynamicRoutingHeaderTestingStub .setMethodDescriptor(backwardsCompatible3TestMethodDescriptor) .setParamsExtractor( request -> { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("table_name", String.valueOf(request.getTableName())); - return params.build(); + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("table_name", String.valueOf(request.getTableName())); + return builder.build(); }) .build(); GrpcCallSettings nestedFieldTestTransportSettings = @@ -428,6 +455,17 @@ public class GrpcExplicitDynamicRoutingHeaderTestingStub return builder.build(); }) .build(); + GrpcCallSettings implicitRoutingHeaderWithEnumTestTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(implicitRoutingHeaderWithEnumTestMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add( + "info.enum_test", String.valueOf(request.getInfo().getEnumTestValue())); + return builder.build(); + }) + .build(); this.example1TestCallable = callableFactory.createUnaryCallable( @@ -477,6 +515,11 @@ public class GrpcExplicitDynamicRoutingHeaderTestingStub this.nestedFieldTestCallable = callableFactory.createUnaryCallable( nestedFieldTestTransportSettings, settings.nestedFieldTestSettings(), clientContext); + this.implicitRoutingHeaderWithEnumTestCallable = + callableFactory.createUnaryCallable( + implicitRoutingHeaderWithEnumTestTransportSettings, + settings.implicitRoutingHeaderWithEnumTestSettings(), + clientContext); this.backgroundResources = new BackgroundResourceAggregation(clientContext.getBackgroundResources()); @@ -556,6 +599,11 @@ public class GrpcExplicitDynamicRoutingHeaderTestingStub return nestedFieldTestCallable; } + @Override + public UnaryCallable implicitRoutingHeaderWithEnumTestCallable() { + return implicitRoutingHeaderWithEnumTestCallable; + } + @Override public final void close() { try { diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/GrpcTestingStub.golden b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/GrpcTestingStub.golden index 6c0a667291..a467bb696f 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/GrpcTestingStub.golden +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/GrpcTestingStub.golden @@ -12,7 +12,6 @@ import com.google.api.gax.rpc.ClientContext; import com.google.api.gax.rpc.RequestParamsBuilder; import com.google.api.gax.rpc.UnaryCallable; import com.google.api.pathtemplate.PathTemplate; -import com.google.common.collect.ImmutableMap; import com.google.longrunning.stub.GrpcOperationsStub; import com.google.protobuf.Empty; import com.google.showcase.v1beta1.CreateSessionRequest; @@ -54,6 +53,7 @@ public class GrpcTestingStub extends TestingStub { .setRequestMarshaller( ProtoUtils.marshaller(CreateSessionRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(Session.getDefaultInstance())) + .setSampledToLocalTracing(true) .build(); private static final MethodDescriptor getSessionMethodDescriptor = @@ -62,6 +62,7 @@ public class GrpcTestingStub extends TestingStub { .setFullMethodName("google.showcase.v1beta1.Testing/GetSession") .setRequestMarshaller(ProtoUtils.marshaller(GetSessionRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(Session.getDefaultInstance())) + .setSampledToLocalTracing(true) .build(); private static final MethodDescriptor @@ -72,6 +73,7 @@ public class GrpcTestingStub extends TestingStub { .setRequestMarshaller(ProtoUtils.marshaller(ListSessionsRequest.getDefaultInstance())) .setResponseMarshaller( ProtoUtils.marshaller(ListSessionsResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) .build(); private static final MethodDescriptor deleteSessionMethodDescriptor = @@ -80,6 +82,7 @@ public class GrpcTestingStub extends TestingStub { .setFullMethodName("google.showcase.v1beta1.Testing/DeleteSession") .setRequestMarshaller(ProtoUtils.marshaller(DeleteSessionRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(Empty.getDefaultInstance())) + .setSampledToLocalTracing(true) .build(); private static final MethodDescriptor @@ -91,6 +94,7 @@ public class GrpcTestingStub extends TestingStub { ProtoUtils.marshaller(ReportSessionRequest.getDefaultInstance())) .setResponseMarshaller( ProtoUtils.marshaller(ReportSessionResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) .build(); private static final MethodDescriptor getTestMethodDescriptor = @@ -99,6 +103,7 @@ public class GrpcTestingStub extends TestingStub { .setFullMethodName("google.showcase.v1beta1.Testing/GetTest") .setRequestMarshaller(ProtoUtils.marshaller(GetTestRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(Test.getDefaultInstance())) + .setSampledToLocalTracing(true) .build(); private static final MethodDescriptor @@ -108,6 +113,7 @@ public class GrpcTestingStub extends TestingStub { .setFullMethodName("google.showcase.v1beta1.Testing/ListTests") .setRequestMarshaller(ProtoUtils.marshaller(ListTestsRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(ListTestsResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) .build(); private static final MethodDescriptor deleteTestMethodDescriptor = @@ -116,6 +122,7 @@ public class GrpcTestingStub extends TestingStub { .setFullMethodName("google.showcase.v1beta1.Testing/DeleteTest") .setRequestMarshaller(ProtoUtils.marshaller(DeleteTestRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(Empty.getDefaultInstance())) + .setSampledToLocalTracing(true) .build(); private static final MethodDescriptor @@ -125,6 +132,7 @@ public class GrpcTestingStub extends TestingStub { .setFullMethodName("google.showcase.v1beta1.Testing/VerifyTest") .setRequestMarshaller(ProtoUtils.marshaller(VerifyTestRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(VerifyTestResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) .build(); private final UnaryCallable createSessionCallable; @@ -193,10 +201,11 @@ public class GrpcTestingStub extends TestingStub { .setMethodDescriptor(getSessionMethodDescriptor) .setParamsExtractor( request -> { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("name", String.valueOf(request.getName())); - return params.build(); + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); }) + .setResourceNameExtractor(request -> request.getName()) .build(); GrpcCallSettings listSessionsTransportSettings = GrpcCallSettings.newBuilder() @@ -207,20 +216,22 @@ public class GrpcTestingStub extends TestingStub { .setMethodDescriptor(deleteSessionMethodDescriptor) .setParamsExtractor( request -> { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("name", String.valueOf(request.getName())); - return params.build(); + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); }) + .setResourceNameExtractor(request -> request.getName()) .build(); GrpcCallSettings reportSessionTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(reportSessionMethodDescriptor) .setParamsExtractor( request -> { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("name", String.valueOf(request.getName())); - return params.build(); + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); }) + .setResourceNameExtractor(request -> request.getName()) .build(); GrpcCallSettings getTestTransportSettings = GrpcCallSettings.newBuilder() @@ -235,41 +246,45 @@ public class GrpcTestingStub extends TestingStub { } return builder.build(); }) + .setResourceNameExtractor(request -> request.getName()) .build(); GrpcCallSettings listTestsTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(listTestsMethodDescriptor) .setParamsExtractor( request -> { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("parent", String.valueOf(request.getParent())); - return params.build(); + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); }) + .setResourceNameExtractor(request -> request.getParent()) .build(); GrpcCallSettings deleteTestTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(deleteTestMethodDescriptor) .setParamsExtractor( request -> { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("name", String.valueOf(request.getName())); - return params.build(); + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); }) + .setResourceNameExtractor(request -> request.getName()) .build(); GrpcCallSettings verifyTestTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(verifyTestMethodDescriptor) .setParamsExtractor( request -> { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("answer", String.valueOf(request.getAnswer())); - params.put("foo", String.valueOf(request.getFoo())); - params.put("name", String.valueOf(request.getName())); - params.put( + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("answer", String.valueOf(request.getAnswer())); + builder.add("foo", String.valueOf(request.getFoo())); + builder.add("name", String.valueOf(request.getName())); + builder.add( "test_to_verify.name", String.valueOf(request.getTestToVerify().getName())); - params.put("type", String.valueOf(request.getType())); - return params.build(); + builder.add("type", String.valueOf(request.getTypeValue())); + return builder.build(); }) + .setResourceNameExtractor(request -> request.getName()) .build(); this.createSessionCallable = diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/IdentityClient.golden b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/IdentityClient.golden index bcd0f26738..efb41dc308 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/IdentityClient.golden +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/IdentityClient.golden @@ -40,19 +40,101 @@ import javax.annotation.Generated; *

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

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

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

        CreateUser

        + *

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

        + *
          + *
        • createUser(CreateUserRequest request) + *

        + *

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

        + *
          + *
        • createUser(String parent, String displayName, String email) + *

        • createUser(String parent, String displayName, String email, int age, String nickname, boolean enableNotifications, double heightFeet) + *

        • createUser(String parent, String displayName, String email, String hobbyName, String songName, int weeklyFrequency, String companyName, String title, String subject, String artistName) + *

        + *

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

        + *
          + *
        • createUserCallable() + *

        + *

        GetUser

        + *

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

        + *
          + *
        • getUser(GetUserRequest request) + *

        + *

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

        + *
          + *
        • getUser(UserName name) + *

        • getUser(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.

        + *
          + *
        • getUserCallable() + *

        + *

        UpdateUser

        + *

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

        + *
          + *
        • updateUser(UpdateUserRequest request) + *

        + *

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

        + *
          + *
        • updateUserCallable() + *

        + *

        DeleteUser

        + *

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

        + *
          + *
        • deleteUser(DeleteUserRequest request) + *

        + *

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

        + *
          + *
        • deleteUser(UserName name) + *

        • deleteUser(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.

        + *
          + *
        • deleteUserCallable() + *

        + *

        ListUsers

        + *

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

        + *
          + *
        • listUsers(ListUsersRequest request) + *

        + *

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

        + *
          + *
        • listUsersPagedCallable() + *

        • listUsersCallable() + *

        + *
        * *

        See the individual methods for example code. * diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/JobServiceStubSettings.golden b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/JobServiceStubSettings.golden new file mode 100644 index 0000000000..f064845177 --- /dev/null +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/JobServiceStubSettings.golden @@ -0,0 +1,383 @@ +package com.google.cloud.bigquery.v2.stub; + +import static com.google.cloud.bigquery.v2.JobServiceClient.ListJobsPagedResponse; + +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.LibraryMetadata; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.PagedListDescriptor; +import com.google.api.gax.rpc.PagedListResponseFactory; +import com.google.api.gax.rpc.StatusCode; +import com.google.api.gax.rpc.StubSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.bigquery.v2.JobProto; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.ImmutableSet; +import com.google.common.collect.Lists; +import com.google.protobuf.Empty; +import com.google.protobuf.Int32Value; +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 JobServiceStub}. + * + *

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

          + *
        • The default service address (bigquery.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 deleteJob: + * + *

        {@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
        + * JobServiceStubSettings.Builder jobServiceSettingsBuilder = JobServiceStubSettings.newBuilder();
        + * jobServiceSettingsBuilder
        + *     .deleteJobSettings()
        + *     .setRetrySettings(
        + *         jobServiceSettingsBuilder
        + *             .deleteJobSettings()
        + *             .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());
        + * JobServiceStubSettings jobServiceSettings = jobServiceSettingsBuilder.build();
        + * }
        + * + * Please refer to the [Client Side Retry + * Guide](https://docs.cloud.google.com/java/docs/client-retries) for additional support in setting + * retries. + */ +@Generated("by gapic-generator-java") +@SuppressWarnings("CanonicalDuration") +public class JobServiceStubSettings extends StubSettings { + /** The default scopes of the service. */ + private static final ImmutableList DEFAULT_SERVICE_SCOPES = + ImmutableList.builder() + .add("https://www.googleapis.com/auth/bigquery") + .add("https://www.googleapis.com/auth/cloud-platform") + .add("https://www.googleapis.com/auth/cloud-platform.read-only") + .add("https://www.googleapis.com/auth/devstorage.full_control") + .add("https://www.googleapis.com/auth/devstorage.read_only") + .add("https://www.googleapis.com/auth/devstorage.read_write") + .build(); + + private final UnaryCallSettings deleteJobSettings; + private final PagedCallSettings + listJobsSettings; + + private static final PagedListDescriptor< + JobProto.ListJobsRequest, JobProto.JobList, JobProto.ListFormatJob> + LIST_JOBS_PAGE_STR_DESC = + new PagedListDescriptor< + JobProto.ListJobsRequest, JobProto.JobList, JobProto.ListFormatJob>() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public JobProto.ListJobsRequest injectToken( + JobProto.ListJobsRequest payload, String token) { + return JobProto.ListJobsRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public JobProto.ListJobsRequest injectPageSize( + JobProto.ListJobsRequest payload, int pageSize) { + return JobProto.ListJobsRequest.newBuilder(payload) + .setMaxResults(Int32Value.of(pageSize)) + .build(); + } + + @Override + public Integer extractPageSize(JobProto.ListJobsRequest payload) { + return payload.getMaxResults().getValue(); + } + + @Override + public String extractNextToken(JobProto.JobList payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources(JobProto.JobList payload) { + return payload.getJobsList(); + } + }; + + private static final PagedListResponseFactory< + JobProto.ListJobsRequest, JobProto.JobList, ListJobsPagedResponse> + LIST_JOBS_PAGE_STR_FACT = + new PagedListResponseFactory< + JobProto.ListJobsRequest, JobProto.JobList, ListJobsPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + JobProto.ListJobsRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext + pageContext = + PageContext.create(callable, LIST_JOBS_PAGE_STR_DESC, request, context); + return ListJobsPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + /** Returns the object with the settings used for calls to deleteJob. */ + public UnaryCallSettings deleteJobSettings() { + return deleteJobSettings; + } + + /** Returns the object with the settings used for calls to listJobs. */ + public PagedCallSettings + listJobsSettings() { + return listJobsSettings; + } + + public JobServiceStub createStub() throws IOException { + if (getTransportChannelProvider() + .getTransportName() + .equals(GrpcTransportChannel.getGrpcTransportName())) { + return GrpcJobServiceStub.create(this); + } + throw new UnsupportedOperationException( + String.format( + "Transport not supported: %s", getTransportChannelProvider().getTransportName())); + } + + /** Returns the default service name. */ + @Override + public String getServiceName() { + return "bigquery"; + } + + /** 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 "bigquery.googleapis.com:443"; + } + + /** Returns the default mTLS service endpoint. */ + public static String getDefaultMtlsEndpoint() { + return "bigquery.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(JobServiceStubSettings.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 JobServiceStubSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + + deleteJobSettings = settingsBuilder.deleteJobSettings().build(); + listJobsSettings = settingsBuilder.listJobsSettings().build(); + } + + @Override + protected LibraryMetadata getLibraryMetadata() { + return LibraryMetadata.newBuilder().setVersion(Version.VERSION).build(); + } + + /** Builder for JobServiceStubSettings. */ + public static class Builder extends StubSettings.Builder { + private final ImmutableList> unaryMethodSettingsBuilders; + private final UnaryCallSettings.Builder deleteJobSettings; + private final PagedCallSettings.Builder< + JobProto.ListJobsRequest, JobProto.JobList, ListJobsPagedResponse> + listJobsSettings; + private static final ImmutableMap> + RETRYABLE_CODE_DEFINITIONS; + + static { + ImmutableMap.Builder> definitions = + ImmutableMap.builder(); + 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() + .setInitialRpcTimeoutDuration(Duration.ofMillis(5000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeoutDuration(Duration.ofMillis(5000L)) + .setTotalTimeoutDuration(Duration.ofMillis(5000L)) + .build(); + definitions.put("no_retry_0_params", settings); + RETRY_PARAM_DEFINITIONS = definitions.build(); + } + + protected Builder() { + this(((ClientContext) null)); + } + + protected Builder(ClientContext clientContext) { + super(clientContext); + + deleteJobSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + listJobsSettings = PagedCallSettings.newBuilder(LIST_JOBS_PAGE_STR_FACT); + + unaryMethodSettingsBuilders = + ImmutableList.>of(deleteJobSettings, listJobsSettings); + initDefaults(this); + } + + protected Builder(JobServiceStubSettings settings) { + super(settings); + + deleteJobSettings = settings.deleteJobSettings.toBuilder(); + listJobsSettings = settings.listJobsSettings.toBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of(deleteJobSettings, listJobsSettings); + } + + 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 + .deleteJobSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + + builder + .listJobsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + + return builder; + } + + /** + * Applies the given settings updater function to all of the unary API methods in this service. + * + *

        Note: This method does not support applying settings to streaming methods. + */ + public Builder applyToAllUnaryMethods( + ApiFunction, Void> settingsUpdater) { + super.applyToAllUnaryMethods(unaryMethodSettingsBuilders, settingsUpdater); + return this; + } + + public ImmutableList> unaryMethodSettingsBuilders() { + return unaryMethodSettingsBuilders; + } + + /** Returns the builder for the settings used for calls to deleteJob. */ + public UnaryCallSettings.Builder deleteJobSettings() { + return deleteJobSettings; + } + + /** Returns the builder for the settings used for calls to listJobs. */ + public PagedCallSettings.Builder< + JobProto.ListJobsRequest, JobProto.JobList, ListJobsPagedResponse> + listJobsSettings() { + return listJobsSettings; + } + + @Override + public JobServiceStubSettings build() throws IOException { + return new JobServiceStubSettings(this); + } + } +} diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/LoggingServiceV2StubSettings.golden b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/LoggingServiceV2StubSettings.golden index 54f6b34b93..d90cf2f7c1 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/LoggingServiceV2StubSettings.golden +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/LoggingServiceV2StubSettings.golden @@ -7,7 +7,7 @@ import static com.google.logging.v2.LoggingServiceV2Client.ListMonitoredResource import com.google.api.MonitoredResourceDescriptor; import com.google.api.core.ApiFunction; import com.google.api.core.ApiFuture; -import com.google.api.core.BetaApi; +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; @@ -26,6 +26,7 @@ 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.LibraryMetadata; import com.google.api.gax.rpc.PageContext; import com.google.api.gax.rpc.PagedCallSettings; import com.google.api.gax.rpc.PagedListDescriptor; @@ -54,10 +55,10 @@ 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; -import org.threeten.bp.Duration; // AUTO-GENERATED DOCUMENTATION AND CLASS. /** @@ -74,7 +75,9 @@ import org.threeten.bp.Duration; *

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

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

        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.
        @@ -91,12 +94,24 @@ import org.threeten.bp.Duration;
          *             .deleteLogSettings()
          *             .getRetrySettings()
          *             .toBuilder()
        - *             .setTotalTimeout(Duration.ofSeconds(30))
        + *             .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 loggingServiceV2Settings = loggingServiceV2SettingsBuilder.build();
          * }
        + * + * Please refer to the [Client Side Retry + * Guide](https://docs.cloud.google.com/java/docs/client-retries) for additional support in setting + * retries. */ @Generated("by gapic-generator-java") +@SuppressWarnings("CanonicalDuration") public class LoggingServiceV2StubSettings extends StubSettings { /** The default scopes of the service. */ private static final ImmutableList DEFAULT_SERVICE_SCOPES = @@ -155,9 +170,7 @@ public class LoggingServiceV2StubSettings extends StubSettings extractResources(ListLogEntriesResponse payload) { - return payload.getEntriesList() == null - ? ImmutableList.of() - : payload.getEntriesList(); + return payload.getEntriesList(); } }; @@ -204,9 +217,7 @@ public class LoggingServiceV2StubSettings extends StubSettings extractResources( ListMonitoredResourceDescriptorsResponse payload) { - return payload.getResourceDescriptorsList() == null - ? ImmutableList.of() - : payload.getResourceDescriptorsList(); + return payload.getResourceDescriptorsList(); } }; @@ -240,9 +251,7 @@ public class LoggingServiceV2StubSettings extends StubSettings extractResources(ListLogsResponse payload) { - return payload.getLogNamesList() == null - ? ImmutableList.of() - : payload.getLogNamesList(); + return payload.getLogNamesList(); } }; @@ -422,12 +431,19 @@ public class LoggingServiceV2StubSettings extends StubSettings { private final ImmutableList> unaryMethodSettingsBuilders; @@ -544,24 +567,24 @@ public class LoggingServiceV2StubSettings extends StubSettingsNote: close() needs to be called on the MessagingClient object to clean up resources such as * threads. In the example above, try-with-resources is used, which automatically calls close(). * - *

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

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

        CreateRoom

        + *

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

        + *
          + *
        • createRoom(CreateRoomRequest request) + *

        + *

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

        + *
          + *
        • createRoom(String displayName, String description) + *

        + *

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

        + *
          + *
        • createRoomCallable() + *

        + *

        GetRoom

        + *

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

        + *
          + *
        • getRoom(GetRoomRequest request) + *

        + *

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

        + *
          + *
        • getRoom(RoomName name) + *

        • getRoom(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.

        + *
          + *
        • getRoomCallable() + *

        + *

        UpdateRoom

        + *

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

        + *
          + *
        • updateRoom(UpdateRoomRequest request) + *

        + *

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

        + *
          + *
        • updateRoomCallable() + *

        + *

        DeleteRoom

        + *

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

        + *
          + *
        • deleteRoom(DeleteRoomRequest request) + *

        + *

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

        + *
          + *
        • deleteRoom(RoomName name) + *

        • deleteRoom(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.

        + *
          + *
        • deleteRoomCallable() + *

        + *

        ListRooms

        + *

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

        + *
          + *
        • listRooms(ListRoomsRequest request) + *

        + *

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

        + *
          + *
        • listRoomsPagedCallable() + *

        • listRoomsCallable() + *

        + *

        CreateBlurb

        + *

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

        + *
          + *
        • createBlurb(CreateBlurbRequest request) + *

        + *

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

        + *
          + *
        • createBlurb(ProfileName parent, ByteString image) + *

        • createBlurb(ProfileName parent, String text) + *

        • createBlurb(RoomName parent, ByteString image) + *

        • createBlurb(RoomName parent, String text) + *

        • createBlurb(String parent, ByteString image) + *

        • createBlurb(String parent, String text) + *

        + *

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

        + *
          + *
        • createBlurbCallable() + *

        + *

        GetBlurb

        + *

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

        + *
          + *
        • getBlurb(GetBlurbRequest request) + *

        + *

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

        + *
          + *
        • getBlurb(BlurbName name) + *

        • getBlurb(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.

        + *
          + *
        • getBlurbCallable() + *

        + *

        UpdateBlurb

        + *

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

        + *
          + *
        • updateBlurb(UpdateBlurbRequest request) + *

        + *

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

        + *
          + *
        • updateBlurbCallable() + *

        + *

        DeleteBlurb

        + *

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

        + *
          + *
        • deleteBlurb(DeleteBlurbRequest request) + *

        + *

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

        + *
          + *
        • deleteBlurb(BlurbName name) + *

        • deleteBlurb(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.

        + *
          + *
        • deleteBlurbCallable() + *

        + *

        ListBlurbs

        + *

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

        + *
          + *
        • listBlurbs(ListBlurbsRequest request) + *

        + *

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

        + *
          + *
        • listBlurbs(ProfileName parent) + *

        • listBlurbs(RoomName parent) + *

        • listBlurbs(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.

        + *
          + *
        • listBlurbsPagedCallable() + *

        • listBlurbsCallable() + *

        + *

        SearchBlurbs

        + *

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

        + *
          + *
        • searchBlurbsAsync(SearchBlurbsRequest request) + *

        + *

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

        + *
          + *
        • searchBlurbsAsync(String query) + *

        + *

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

        + *
          + *
        • searchBlurbsOperationCallable() + *

        • searchBlurbsCallable() + *

        + *

        StreamBlurbs

        + *

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

        + *
          + *
        • streamBlurbsCallable() + *

        + *

        SendBlurbs

        + *

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

        + *
          + *
        • sendBlurbsCallable() + *

        + *

        Connect

        + *

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

        + *
          + *
        • connectCallable() + *

        + *
        * *

        See the individual methods for example code. * diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/MockEchoImpl.golden b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/MockEchoImpl.golden index ae3ff13888..f8b42faff0 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/MockEchoImpl.golden +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/MockEchoImpl.golden @@ -293,4 +293,25 @@ public class MockEchoImpl extends EchoImplBase { Exception.class.getName()))); } } + + @Override + public void pagedExpandLegacy( + PagedExpandLegacyRequest request, StreamObserver responseObserver) { + java.lang.Object response = responses.poll(); + if (response instanceof PagedExpandResponse) { + requests.add(request); + responseObserver.onNext(((PagedExpandResponse) 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 PagedExpandLegacy, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + PagedExpandResponse.class.getName(), + Exception.class.getName()))); + } + } } diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/PublisherStubSettings.golden b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/PublisherStubSettings.golden index ba8d449186..c6f8227278 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/PublisherStubSettings.golden +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/PublisherStubSettings.golden @@ -6,7 +6,7 @@ import static com.google.pubsub.v1.PublisherClient.ListTopicsPagedResponse; import com.google.api.core.ApiFunction; import com.google.api.core.ApiFuture; -import com.google.api.core.BetaApi; +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; @@ -25,6 +25,7 @@ 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.LibraryMetadata; import com.google.api.gax.rpc.PageContext; import com.google.api.gax.rpc.PagedCallSettings; import com.google.api.gax.rpc.PagedListDescriptor; @@ -54,11 +55,11 @@ import com.google.pubsub.v1.PublishResponse; import com.google.pubsub.v1.Topic; import com.google.pubsub.v1.UpdateTopicRequest; import java.io.IOException; +import java.time.Duration; import java.util.ArrayList; import java.util.Collection; import java.util.List; import javax.annotation.Generated; -import org.threeten.bp.Duration; // AUTO-GENERATED DOCUMENTATION AND CLASS. /** @@ -75,7 +76,9 @@ import org.threeten.bp.Duration; *

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

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

        For example, to set the + * [RetrySettings](https://cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.retrying.RetrySettings) + * of createTopic: * *

        {@code
          * // This snippet has been automatically generated and should be regarded as a code template only.
        @@ -91,12 +94,24 @@ import org.threeten.bp.Duration;
          *             .createTopicSettings()
          *             .getRetrySettings()
          *             .toBuilder()
        - *             .setTotalTimeout(Duration.ofSeconds(30))
        + *             .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());
          * PublisherStubSettings publisherSettings = publisherSettingsBuilder.build();
          * }
        + * + * Please refer to the [Client Side Retry + * Guide](https://docs.cloud.google.com/java/docs/client-retries) for additional support in setting + * retries. */ @Generated("by gapic-generator-java") +@SuppressWarnings("CanonicalDuration") public class PublisherStubSettings extends StubSettings { /** The default scopes of the service. */ private static final ImmutableList DEFAULT_SERVICE_SCOPES = @@ -153,9 +168,7 @@ public class PublisherStubSettings extends StubSettings { @Override public Iterable extractResources(ListTopicsResponse payload) { - return payload.getTopicsList() == null - ? ImmutableList.of() - : payload.getTopicsList(); + return payload.getTopicsList(); } }; @@ -195,9 +208,7 @@ public class PublisherStubSettings extends StubSettings { @Override public Iterable extractResources(ListTopicSubscriptionsResponse payload) { - return payload.getSubscriptionsList() == null - ? ImmutableList.of() - : payload.getSubscriptionsList(); + return payload.getSubscriptionsList(); } }; @@ -234,9 +245,7 @@ public class PublisherStubSettings extends StubSettings { @Override public Iterable extractResources(ListTopicSnapshotsResponse payload) { - return payload.getSnapshotsList() == null - ? ImmutableList.of() - : payload.getSnapshotsList(); + return payload.getSnapshotsList(); } }; @@ -431,12 +440,19 @@ public class PublisherStubSettings extends StubSettings { "Transport not supported: %s", getTransportChannelProvider().getTransportName())); } + /** Returns the default service name. */ + @Override + public String getServiceName() { + return "pubsub"; + } + /** 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 "pubsub.googleapis.com:443"; } @@ -468,7 +484,6 @@ public class PublisherStubSettings extends StubSettings { return defaultGrpcTransportProviderBuilder().build(); } - @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { return ApiClientHeaderProvider.newBuilder() .setGeneratedLibToken("gapic", GaxProperties.getLibraryVersion(PublisherStubSettings.class)) @@ -505,6 +520,11 @@ public class PublisherStubSettings extends StubSettings { detachSubscriptionSettings = settingsBuilder.detachSubscriptionSettings().build(); } + @Override + protected LibraryMetadata getLibraryMetadata() { + return LibraryMetadata.newBuilder().setVersion(Version.VERSION).build(); + } + /** Builder for PublisherStubSettings. */ public static class Builder extends StubSettings.Builder { private final ImmutableList> unaryMethodSettingsBuilders; @@ -561,35 +581,35 @@ public class PublisherStubSettings extends StubSettings { RetrySettings settings = null; settings = RetrySettings.newBuilder() - .setInitialRetryDelay(Duration.ofMillis(100L)) + .setInitialRetryDelayDuration(Duration.ofMillis(100L)) .setRetryDelayMultiplier(1.3) - .setMaxRetryDelay(Duration.ofMillis(60000L)) - .setInitialRpcTimeout(Duration.ofMillis(60000L)) + .setMaxRetryDelayDuration(Duration.ofMillis(60000L)) + .setInitialRpcTimeoutDuration(Duration.ofMillis(60000L)) .setRpcTimeoutMultiplier(1.0) - .setMaxRpcTimeout(Duration.ofMillis(60000L)) - .setTotalTimeout(Duration.ofMillis(60000L)) + .setMaxRpcTimeoutDuration(Duration.ofMillis(60000L)) + .setTotalTimeoutDuration(Duration.ofMillis(60000L)) .build(); definitions.put("retry_policy_0_params", settings); settings = RetrySettings.newBuilder() - .setInitialRetryDelay(Duration.ofMillis(100L)) + .setInitialRetryDelayDuration(Duration.ofMillis(100L)) .setRetryDelayMultiplier(1.3) - .setMaxRetryDelay(Duration.ofMillis(60000L)) - .setInitialRpcTimeout(Duration.ofMillis(60000L)) + .setMaxRetryDelayDuration(Duration.ofMillis(60000L)) + .setInitialRpcTimeoutDuration(Duration.ofMillis(60000L)) .setRpcTimeoutMultiplier(1.0) - .setMaxRpcTimeout(Duration.ofMillis(60000L)) - .setTotalTimeout(Duration.ofMillis(60000L)) + .setMaxRpcTimeoutDuration(Duration.ofMillis(60000L)) + .setTotalTimeoutDuration(Duration.ofMillis(60000L)) .build(); definitions.put("retry_policy_1_params", settings); settings = RetrySettings.newBuilder() - .setInitialRetryDelay(Duration.ofMillis(100L)) + .setInitialRetryDelayDuration(Duration.ofMillis(100L)) .setRetryDelayMultiplier(1.3) - .setMaxRetryDelay(Duration.ofMillis(60000L)) - .setInitialRpcTimeout(Duration.ofMillis(60000L)) + .setMaxRetryDelayDuration(Duration.ofMillis(60000L)) + .setInitialRpcTimeoutDuration(Duration.ofMillis(60000L)) .setRpcTimeoutMultiplier(1.0) - .setMaxRpcTimeout(Duration.ofMillis(60000L)) - .setTotalTimeout(Duration.ofMillis(60000L)) + .setMaxRpcTimeoutDuration(Duration.ofMillis(60000L)) + .setTotalTimeoutDuration(Duration.ofMillis(60000L)) .build(); definitions.put("retry_policy_2_params", settings); RETRY_PARAM_DEFINITIONS = definitions.build(); @@ -661,7 +681,6 @@ public class PublisherStubSettings extends StubSettings { builder.setTransportChannelProvider(defaultTransportChannelProvider()); builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); builder.setInternalHeaderProvider(defaultApiClientHeaderProviderBuilder().build()); - builder.setEndpoint(getDefaultEndpoint()); builder.setMtlsEndpoint(getDefaultMtlsEndpoint()); builder.setSwitchToMtlsEndpointAllowed(true); @@ -685,7 +704,7 @@ public class PublisherStubSettings extends StubSettings { BatchingSettings.newBuilder() .setElementCountThreshold(100L) .setRequestByteThreshold(1048576L) - .setDelayThreshold(Duration.ofMillis(10L)) + .setDelayThresholdDuration(Duration.ofMillis(10L)) .setFlowControlSettings( FlowControlSettings.newBuilder() .setLimitExceededBehavior(FlowController.LimitExceededBehavior.Ignore) diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/SubscriberClientTest.golden b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/SubscriberClientTest.golden index d9a1215708..b0ffbf3c02 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/SubscriberClientTest.golden +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/SubscriberClientTest.golden @@ -17,6 +17,7 @@ import com.google.api.gax.rpc.StatusCode; import com.google.common.collect.Lists; import com.google.protobuf.AbstractMessage; import com.google.protobuf.Empty; +import com.google.protobuf.FieldMask; import google.cloud.ProjectName; import io.grpc.StatusRuntimeException; import java.io.IOException; @@ -79,6 +80,8 @@ public class SubscriberClientTest { .setName(SubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]").toString()) .setTopic(TopicName.ofProjectTopicName("[PROJECT]", "[TOPIC]").toString()) .setPushConfig(PushConfig.newBuilder().build()) + .setBigqueryConfig(BigQueryConfig.newBuilder().build()) + .setCloudStorageConfig(CloudStorageConfig.newBuilder().build()) .setAckDeadlineSeconds(2135351438) .setRetainAckedMessages(true) .putAllLabels(new HashMap()) @@ -89,6 +92,10 @@ public class SubscriberClientTest { .setRetryPolicy(RetryPolicy.newBuilder().build()) .setDetached(true) .setEnableExactlyOnceDelivery(true) + .setAnalyticsHubSubscriptionInfo( + Subscription.AnalyticsHubSubscriptionInfo.newBuilder().build()) + .addAllMessageTransforms(new ArrayList()) + .putAllTags(new HashMap()) .build(); mockSubscriber.addResponse(expectedResponse); @@ -139,6 +146,8 @@ public class SubscriberClientTest { .setName(SubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]").toString()) .setTopic(TopicName.ofProjectTopicName("[PROJECT]", "[TOPIC]").toString()) .setPushConfig(PushConfig.newBuilder().build()) + .setBigqueryConfig(BigQueryConfig.newBuilder().build()) + .setCloudStorageConfig(CloudStorageConfig.newBuilder().build()) .setAckDeadlineSeconds(2135351438) .setRetainAckedMessages(true) .putAllLabels(new HashMap()) @@ -149,6 +158,10 @@ public class SubscriberClientTest { .setRetryPolicy(RetryPolicy.newBuilder().build()) .setDetached(true) .setEnableExactlyOnceDelivery(true) + .setAnalyticsHubSubscriptionInfo( + Subscription.AnalyticsHubSubscriptionInfo.newBuilder().build()) + .addAllMessageTransforms(new ArrayList()) + .putAllTags(new HashMap()) .build(); mockSubscriber.addResponse(expectedResponse); @@ -199,6 +212,8 @@ public class SubscriberClientTest { .setName(SubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]").toString()) .setTopic(TopicName.ofProjectTopicName("[PROJECT]", "[TOPIC]").toString()) .setPushConfig(PushConfig.newBuilder().build()) + .setBigqueryConfig(BigQueryConfig.newBuilder().build()) + .setCloudStorageConfig(CloudStorageConfig.newBuilder().build()) .setAckDeadlineSeconds(2135351438) .setRetainAckedMessages(true) .putAllLabels(new HashMap()) @@ -209,6 +224,10 @@ public class SubscriberClientTest { .setRetryPolicy(RetryPolicy.newBuilder().build()) .setDetached(true) .setEnableExactlyOnceDelivery(true) + .setAnalyticsHubSubscriptionInfo( + Subscription.AnalyticsHubSubscriptionInfo.newBuilder().build()) + .addAllMessageTransforms(new ArrayList()) + .putAllTags(new HashMap()) .build(); mockSubscriber.addResponse(expectedResponse); @@ -259,6 +278,8 @@ public class SubscriberClientTest { .setName(SubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]").toString()) .setTopic(TopicName.ofProjectTopicName("[PROJECT]", "[TOPIC]").toString()) .setPushConfig(PushConfig.newBuilder().build()) + .setBigqueryConfig(BigQueryConfig.newBuilder().build()) + .setCloudStorageConfig(CloudStorageConfig.newBuilder().build()) .setAckDeadlineSeconds(2135351438) .setRetainAckedMessages(true) .putAllLabels(new HashMap()) @@ -269,6 +290,10 @@ public class SubscriberClientTest { .setRetryPolicy(RetryPolicy.newBuilder().build()) .setDetached(true) .setEnableExactlyOnceDelivery(true) + .setAnalyticsHubSubscriptionInfo( + Subscription.AnalyticsHubSubscriptionInfo.newBuilder().build()) + .addAllMessageTransforms(new ArrayList()) + .putAllTags(new HashMap()) .build(); mockSubscriber.addResponse(expectedResponse); @@ -319,6 +344,8 @@ public class SubscriberClientTest { .setName(SubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]").toString()) .setTopic(TopicName.ofProjectTopicName("[PROJECT]", "[TOPIC]").toString()) .setPushConfig(PushConfig.newBuilder().build()) + .setBigqueryConfig(BigQueryConfig.newBuilder().build()) + .setCloudStorageConfig(CloudStorageConfig.newBuilder().build()) .setAckDeadlineSeconds(2135351438) .setRetainAckedMessages(true) .putAllLabels(new HashMap()) @@ -329,6 +356,10 @@ public class SubscriberClientTest { .setRetryPolicy(RetryPolicy.newBuilder().build()) .setDetached(true) .setEnableExactlyOnceDelivery(true) + .setAnalyticsHubSubscriptionInfo( + Subscription.AnalyticsHubSubscriptionInfo.newBuilder().build()) + .addAllMessageTransforms(new ArrayList()) + .putAllTags(new HashMap()) .build(); mockSubscriber.addResponse(expectedResponse); @@ -369,6 +400,8 @@ public class SubscriberClientTest { .setName(SubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]").toString()) .setTopic(TopicName.ofProjectTopicName("[PROJECT]", "[TOPIC]").toString()) .setPushConfig(PushConfig.newBuilder().build()) + .setBigqueryConfig(BigQueryConfig.newBuilder().build()) + .setCloudStorageConfig(CloudStorageConfig.newBuilder().build()) .setAckDeadlineSeconds(2135351438) .setRetainAckedMessages(true) .putAllLabels(new HashMap()) @@ -379,6 +412,10 @@ public class SubscriberClientTest { .setRetryPolicy(RetryPolicy.newBuilder().build()) .setDetached(true) .setEnableExactlyOnceDelivery(true) + .setAnalyticsHubSubscriptionInfo( + Subscription.AnalyticsHubSubscriptionInfo.newBuilder().build()) + .addAllMessageTransforms(new ArrayList()) + .putAllTags(new HashMap()) .build(); mockSubscriber.addResponse(expectedResponse); @@ -419,6 +456,8 @@ public class SubscriberClientTest { .setName(SubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]").toString()) .setTopic(TopicName.ofProjectTopicName("[PROJECT]", "[TOPIC]").toString()) .setPushConfig(PushConfig.newBuilder().build()) + .setBigqueryConfig(BigQueryConfig.newBuilder().build()) + .setCloudStorageConfig(CloudStorageConfig.newBuilder().build()) .setAckDeadlineSeconds(2135351438) .setRetainAckedMessages(true) .putAllLabels(new HashMap()) @@ -429,23 +468,25 @@ public class SubscriberClientTest { .setRetryPolicy(RetryPolicy.newBuilder().build()) .setDetached(true) .setEnableExactlyOnceDelivery(true) + .setAnalyticsHubSubscriptionInfo( + Subscription.AnalyticsHubSubscriptionInfo.newBuilder().build()) + .addAllMessageTransforms(new ArrayList()) + .putAllTags(new HashMap()) .build(); mockSubscriber.addResponse(expectedResponse); - UpdateSubscriptionRequest request = - UpdateSubscriptionRequest.newBuilder() - .setSubscription(Subscription.newBuilder().build()) - .build(); + Subscription subscription = Subscription.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); - Subscription actualResponse = client.updateSubscription(request); + Subscription actualResponse = client.updateSubscription(subscription, updateMask); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockSubscriber.getRequests(); Assert.assertEquals(1, actualRequests.size()); UpdateSubscriptionRequest actualRequest = ((UpdateSubscriptionRequest) actualRequests.get(0)); - Assert.assertEquals(request.getSubscription(), actualRequest.getSubscription()); - Assert.assertEquals(request.getUpdateMask(), actualRequest.getUpdateMask()); + Assert.assertEquals(subscription, actualRequest.getSubscription()); + Assert.assertEquals(updateMask, actualRequest.getUpdateMask()); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), @@ -458,11 +499,9 @@ public class SubscriberClientTest { mockSubscriber.addException(exception); try { - UpdateSubscriptionRequest request = - UpdateSubscriptionRequest.newBuilder() - .setSubscription(Subscription.newBuilder().build()) - .build(); - client.updateSubscription(request); + Subscription subscription = Subscription.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + client.updateSubscription(subscription, updateMask); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception. @@ -946,7 +985,7 @@ public class SubscriberClientTest { StreamingPullResponse expectedResponse = StreamingPullResponse.newBuilder() .addAllReceivedMessages(new ArrayList()) - .setAcknowlegeConfirmation( + .setAcknowledgeConfirmation( StreamingPullResponse.AcknowledgeConfirmation.newBuilder().build()) .setModifyAckDeadlineConfirmation( StreamingPullResponse.ModifyAckDeadlineConfirmation.newBuilder().build()) @@ -964,6 +1003,7 @@ public class SubscriberClientTest { .setClientId("clientId908408390") .setMaxOutstandingMessages(-1315266996) .setMaxOutstandingBytes(-2103098517) + .setProtocolVersion(-1161610703) .build(); MockStreamObserver responseObserver = new MockStreamObserver<>(); @@ -995,6 +1035,7 @@ public class SubscriberClientTest { .setClientId("clientId908408390") .setMaxOutstandingMessages(-1315266996) .setMaxOutstandingBytes(-2103098517) + .setProtocolVersion(-1161610703) .build(); MockStreamObserver responseObserver = new MockStreamObserver<>(); @@ -1440,18 +1481,18 @@ public class SubscriberClientTest { .build(); mockSubscriber.addResponse(expectedResponse); - UpdateSnapshotRequest request = - UpdateSnapshotRequest.newBuilder().setSnapshot(Snapshot.newBuilder().build()).build(); + Snapshot snapshot = Snapshot.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); - Snapshot actualResponse = client.updateSnapshot(request); + Snapshot actualResponse = client.updateSnapshot(snapshot, updateMask); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockSubscriber.getRequests(); Assert.assertEquals(1, actualRequests.size()); UpdateSnapshotRequest actualRequest = ((UpdateSnapshotRequest) actualRequests.get(0)); - Assert.assertEquals(request.getSnapshot(), actualRequest.getSnapshot()); - Assert.assertEquals(request.getUpdateMask(), actualRequest.getUpdateMask()); + Assert.assertEquals(snapshot, actualRequest.getSnapshot()); + Assert.assertEquals(updateMask, actualRequest.getUpdateMask()); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), @@ -1464,9 +1505,9 @@ public class SubscriberClientTest { mockSubscriber.addException(exception); try { - UpdateSnapshotRequest request = - UpdateSnapshotRequest.newBuilder().setSnapshot(Snapshot.newBuilder().build()).build(); - client.updateSnapshot(request); + Snapshot snapshot = Snapshot.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + client.updateSnapshot(snapshot, updateMask); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception. diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/bookshopclient/AsyncGetBook.golden b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/bookshopclient/AsyncGetBook.golden index 87236a1311..94239b0ccb 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/bookshopclient/AsyncGetBook.golden +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/bookshopclient/AsyncGetBook.golden @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2025 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/bookshopclient/SyncCreateSetCredentialsProvider.golden b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/bookshopclient/SyncCreateSetCredentialsProvider.golden index 346f1125da..1743583f3a 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/bookshopclient/SyncCreateSetCredentialsProvider.golden +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/bookshopclient/SyncCreateSetCredentialsProvider.golden @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2025 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/bookshopclient/SyncCreateSetEndpoint.golden b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/bookshopclient/SyncCreateSetEndpoint.golden index 43cd64aa7c..021437279a 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/bookshopclient/SyncCreateSetEndpoint.golden +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/bookshopclient/SyncCreateSetEndpoint.golden @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2025 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/bookshopclient/SyncGetBook.golden b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/bookshopclient/SyncGetBook.golden index bd89a8fc05..7d3b2bcbeb 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/bookshopclient/SyncGetBook.golden +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/bookshopclient/SyncGetBook.golden @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2025 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/bookshopclient/SyncGetBookIntListbook.golden b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/bookshopclient/SyncGetBookIntListbook.golden index 31c6a24d01..7a6f9db7ab 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/bookshopclient/SyncGetBookIntListbook.golden +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/bookshopclient/SyncGetBookIntListbook.golden @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2025 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/bookshopclient/SyncGetBookStringListbook.golden b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/bookshopclient/SyncGetBookStringListbook.golden index f2d3903e1b..a2d3ceaaba 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/bookshopclient/SyncGetBookStringListbook.golden +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/bookshopclient/SyncGetBookStringListbook.golden @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2025 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/deprecatedserviceclient/AsyncFastFibonacci.golden b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/deprecatedserviceclient/AsyncFastFibonacci.golden index ea0ae6c62d..dbe0565f8f 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/deprecatedserviceclient/AsyncFastFibonacci.golden +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/deprecatedserviceclient/AsyncFastFibonacci.golden @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2025 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/deprecatedserviceclient/AsyncSlowFibonacci.golden b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/deprecatedserviceclient/AsyncSlowFibonacci.golden index 3e4f69d714..1c2973890e 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/deprecatedserviceclient/AsyncSlowFibonacci.golden +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/deprecatedserviceclient/AsyncSlowFibonacci.golden @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2025 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/deprecatedserviceclient/SyncCreateSetCredentialsProvider.golden b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/deprecatedserviceclient/SyncCreateSetCredentialsProvider.golden index 34f20df610..6b530479ad 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/deprecatedserviceclient/SyncCreateSetCredentialsProvider.golden +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/deprecatedserviceclient/SyncCreateSetCredentialsProvider.golden @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2025 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/deprecatedserviceclient/SyncCreateSetEndpoint.golden b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/deprecatedserviceclient/SyncCreateSetEndpoint.golden index 8d5f08f8af..d688b1c89d 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/deprecatedserviceclient/SyncCreateSetEndpoint.golden +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/deprecatedserviceclient/SyncCreateSetEndpoint.golden @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2025 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/deprecatedserviceclient/SyncFastFibonacci.golden b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/deprecatedserviceclient/SyncFastFibonacci.golden index e067991442..e65a153f67 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/deprecatedserviceclient/SyncFastFibonacci.golden +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/deprecatedserviceclient/SyncFastFibonacci.golden @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2025 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/deprecatedserviceclient/SyncSlowFibonacci.golden b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/deprecatedserviceclient/SyncSlowFibonacci.golden index a6dfe7ece4..84c260ec28 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/deprecatedserviceclient/SyncSlowFibonacci.golden +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/deprecatedserviceclient/SyncSlowFibonacci.golden @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2025 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/echoclient/AsyncBlock.golden b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/echoclient/AsyncBlock.golden index fcb7690270..eab80046e5 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/echoclient/AsyncBlock.golden +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/echoclient/AsyncBlock.golden @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2025 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/echoclient/AsyncChat.golden b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/echoclient/AsyncChat.golden index 2ef5f41da6..e4730a1d9a 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/echoclient/AsyncChat.golden +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/echoclient/AsyncChat.golden @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2025 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/echoclient/AsyncChatAgain.golden b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/echoclient/AsyncChatAgain.golden index 4e8eaa63f4..423a7c38d2 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/echoclient/AsyncChatAgain.golden +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/echoclient/AsyncChatAgain.golden @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2025 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/echoclient/AsyncCollect.golden b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/echoclient/AsyncCollect.golden index b2ff87a8c4..d750b9290b 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/echoclient/AsyncCollect.golden +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/echoclient/AsyncCollect.golden @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2025 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/echoclient/AsyncCollideName.golden b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/echoclient/AsyncCollideName.golden index 8a13eb4386..c25f9a7f94 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/echoclient/AsyncCollideName.golden +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/echoclient/AsyncCollideName.golden @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2025 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/echoclient/AsyncEcho.golden b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/echoclient/AsyncEcho.golden index 1188e05d7e..0fe243d582 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/echoclient/AsyncEcho.golden +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/echoclient/AsyncEcho.golden @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2025 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/echoclient/AsyncExpand.golden b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/echoclient/AsyncExpand.golden index 3d804cf625..c9f643ca71 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/echoclient/AsyncExpand.golden +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/echoclient/AsyncExpand.golden @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2025 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/echoclient/AsyncPagedExpand.golden b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/echoclient/AsyncPagedExpand.golden index 653f0c2489..cf324c1945 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/echoclient/AsyncPagedExpand.golden +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/echoclient/AsyncPagedExpand.golden @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2025 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/echoclient/AsyncPagedExpandLegacy.golden b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/echoclient/AsyncPagedExpandLegacy.golden new file mode 100644 index 0000000000..04fdf3b93f --- /dev/null +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/echoclient/AsyncPagedExpandLegacy.golden @@ -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.showcase.v1beta1.samples; + +// [START goldensample_generated_Echo_PagedExpandLegacy_async] +import com.google.api.core.ApiFuture; +import com.google.showcase.v1beta1.EchoClient; +import com.google.showcase.v1beta1.PagedExpandLegacyRequest; +import com.google.showcase.v1beta1.PagedExpandResponse; + +public class AsyncPagedExpandLegacy { + + public static void main(String[] args) throws Exception { + asyncPagedExpandLegacy(); + } + + public static void asyncPagedExpandLegacy() 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 (EchoClient echoClient = EchoClient.create()) { + PagedExpandLegacyRequest request = + PagedExpandLegacyRequest.newBuilder() + .setContent("content951530617") + .setMaxResults(1128457243) + .setPageToken("pageToken873572522") + .build(); + ApiFuture future = + echoClient.pagedExpandLegacyCallable().futureCall(request); + // Do something. + PagedExpandResponse response = future.get(); + } + } +} +// [END goldensample_generated_Echo_PagedExpandLegacy_async] diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/echoclient/AsyncPagedExpandPaged.golden b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/echoclient/AsyncPagedExpandPaged.golden index 854477fe8f..70c49d5275 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/echoclient/AsyncPagedExpandPaged.golden +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/echoclient/AsyncPagedExpandPaged.golden @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2025 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/echoclient/AsyncSimplePagedExpand.golden b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/echoclient/AsyncSimplePagedExpand.golden index d0decc78d6..308cb10bd2 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/echoclient/AsyncSimplePagedExpand.golden +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/echoclient/AsyncSimplePagedExpand.golden @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2025 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/echoclient/AsyncSimplePagedExpandPaged.golden b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/echoclient/AsyncSimplePagedExpandPaged.golden index 0ab1bb2620..2f1be8aba1 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/echoclient/AsyncSimplePagedExpandPaged.golden +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/echoclient/AsyncSimplePagedExpandPaged.golden @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2025 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/echoclient/AsyncWait.golden b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/echoclient/AsyncWait.golden index b433d3de7b..d416fb42d0 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/echoclient/AsyncWait.golden +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/echoclient/AsyncWait.golden @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2025 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/echoclient/AsyncWaitLRO.golden b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/echoclient/AsyncWaitLRO.golden index ee7219e6a5..08b3dbe42d 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/echoclient/AsyncWaitLRO.golden +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/echoclient/AsyncWaitLRO.golden @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2025 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/echoclient/SyncBlock.golden b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/echoclient/SyncBlock.golden index 49083f06a5..fbb92823b1 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/echoclient/SyncBlock.golden +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/echoclient/SyncBlock.golden @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2025 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/echoclient/SyncCollideName.golden b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/echoclient/SyncCollideName.golden index f54228fe7b..47b8b43086 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/echoclient/SyncCollideName.golden +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/echoclient/SyncCollideName.golden @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2025 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/echoclient/SyncCreateSetCredentialsProvider.golden b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/echoclient/SyncCreateSetCredentialsProvider.golden index 137d71af02..4eb8187560 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/echoclient/SyncCreateSetCredentialsProvider.golden +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/echoclient/SyncCreateSetCredentialsProvider.golden @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2025 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/echoclient/SyncCreateSetEndpoint.golden b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/echoclient/SyncCreateSetEndpoint.golden index b6a2ea7d5b..1f5a8f82ae 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/echoclient/SyncCreateSetEndpoint.golden +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/echoclient/SyncCreateSetEndpoint.golden @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2025 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/echoclient/SyncEcho.golden b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/echoclient/SyncEcho.golden index c17dbf2e4a..e5de2abc54 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/echoclient/SyncEcho.golden +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/echoclient/SyncEcho.golden @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2025 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/echoclient/SyncEchoFoobarname.golden b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/echoclient/SyncEchoFoobarname.golden index dd60585688..1ee28149d4 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/echoclient/SyncEchoFoobarname.golden +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/echoclient/SyncEchoFoobarname.golden @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2025 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/echoclient/SyncEchoNoargs.golden b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/echoclient/SyncEchoNoargs.golden index 7876817dac..cc5dbeedb8 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/echoclient/SyncEchoNoargs.golden +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/echoclient/SyncEchoNoargs.golden @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2025 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/echoclient/SyncEchoResourcename.golden b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/echoclient/SyncEchoResourcename.golden index 8f06e73ae8..5233fe9bdd 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/echoclient/SyncEchoResourcename.golden +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/echoclient/SyncEchoResourcename.golden @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2025 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/echoclient/SyncEchoStatus.golden b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/echoclient/SyncEchoStatus.golden index 292f2fd990..32a897cc33 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/echoclient/SyncEchoStatus.golden +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/echoclient/SyncEchoStatus.golden @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2025 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/echoclient/SyncEchoString.golden b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/echoclient/SyncEchoString.golden index 32f664871e..43b2a7c26e 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/echoclient/SyncEchoString.golden +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/echoclient/SyncEchoString.golden @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2025 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/echoclient/SyncEchoString1.golden b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/echoclient/SyncEchoString1.golden index 96630803f2..7e2c89d8ae 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/echoclient/SyncEchoString1.golden +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/echoclient/SyncEchoString1.golden @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2025 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/echoclient/SyncEchoString2.golden b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/echoclient/SyncEchoString2.golden index eccc2e54f9..cdf4a72efc 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/echoclient/SyncEchoString2.golden +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/echoclient/SyncEchoString2.golden @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2025 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/echoclient/SyncEchoStringSeverity.golden b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/echoclient/SyncEchoStringSeverity.golden index 966053a99d..d6f42b862f 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/echoclient/SyncEchoStringSeverity.golden +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/echoclient/SyncEchoStringSeverity.golden @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2025 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/echoclient/SyncPagedExpand.golden b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/echoclient/SyncPagedExpand.golden index b30d626699..ba092a99d4 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/echoclient/SyncPagedExpand.golden +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/echoclient/SyncPagedExpand.golden @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2025 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/echoclient/SyncPagedExpandLegacy.golden b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/echoclient/SyncPagedExpandLegacy.golden new file mode 100644 index 0000000000..51a0bad09a --- /dev/null +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/echoclient/SyncPagedExpandLegacy.golden @@ -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.showcase.v1beta1.samples; + +// [START goldensample_generated_Echo_PagedExpandLegacy_sync] +import com.google.showcase.v1beta1.EchoClient; +import com.google.showcase.v1beta1.PagedExpandLegacyRequest; +import com.google.showcase.v1beta1.PagedExpandResponse; + +public class SyncPagedExpandLegacy { + + public static void main(String[] args) throws Exception { + syncPagedExpandLegacy(); + } + + public static void syncPagedExpandLegacy() 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 (EchoClient echoClient = EchoClient.create()) { + PagedExpandLegacyRequest request = + PagedExpandLegacyRequest.newBuilder() + .setContent("content951530617") + .setMaxResults(1128457243) + .setPageToken("pageToken873572522") + .build(); + PagedExpandResponse response = echoClient.pagedExpandLegacy(request); + } + } +} +// [END goldensample_generated_Echo_PagedExpandLegacy_sync] diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/echoclient/SyncSimplePagedExpand.golden b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/echoclient/SyncSimplePagedExpand.golden index ba9caf6133..0e75e96f3a 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/echoclient/SyncSimplePagedExpand.golden +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/echoclient/SyncSimplePagedExpand.golden @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2025 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/echoclient/SyncSimplePagedExpandNoargs.golden b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/echoclient/SyncSimplePagedExpandNoargs.golden index 050f9b3d74..dab3712556 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/echoclient/SyncSimplePagedExpandNoargs.golden +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/echoclient/SyncSimplePagedExpandNoargs.golden @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2025 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/echoclient/SyncWait.golden b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/echoclient/SyncWait.golden index 426785177c..8e25a6f6e7 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/echoclient/SyncWait.golden +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/echoclient/SyncWait.golden @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2025 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/echoclient/SyncWaitDuration.golden b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/echoclient/SyncWaitDuration.golden index c045e0e3ec..04d2f6c4b5 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/echoclient/SyncWaitDuration.golden +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/echoclient/SyncWaitDuration.golden @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2025 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/echoclient/SyncWaitTimestamp.golden b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/echoclient/SyncWaitTimestamp.golden index c4cfdca153..4121227dda 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/echoclient/SyncWaitTimestamp.golden +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/echoclient/SyncWaitTimestamp.golden @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2025 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/echoserviceselectivegapicclient/AsyncChatAgainShouldGenerateAsPublic.golden b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/echoserviceselectivegapicclient/AsyncChatAgainShouldGenerateAsPublic.golden new file mode 100644 index 0000000000..79c040a4c1 --- /dev/null +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/echoserviceselectivegapicclient/AsyncChatAgainShouldGenerateAsPublic.golden @@ -0,0 +1,58 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.selective.generate.v1beta1.samples; + +// [START goldensample_generated_EchoServiceShouldGeneratePartialPublic_ChatAgainShouldGenerateAsPublic_async] +import com.google.api.gax.rpc.BidiStream; +import com.google.selective.generate.v1beta1.EchoRequest; +import com.google.selective.generate.v1beta1.EchoResponse; +import com.google.selective.generate.v1beta1.EchoServiceShouldGeneratePartialPublicClient; +import com.google.selective.generate.v1beta1.Foobar; +import com.google.selective.generate.v1beta1.FoobarName; + +public class AsyncChatAgainShouldGenerateAsPublic { + + public static void main(String[] args) throws Exception { + asyncChatAgainShouldGenerateAsPublic(); + } + + public static void asyncChatAgainShouldGenerateAsPublic() 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 (EchoServiceShouldGeneratePartialPublicClient echoServiceShouldGeneratePartialPublicClient = + EchoServiceShouldGeneratePartialPublicClient.create()) { + BidiStream bidiStream = + echoServiceShouldGeneratePartialPublicClient + .chatAgainShouldGenerateAsPublicCallable() + .call(); + EchoRequest request = + EchoRequest.newBuilder() + .setName(FoobarName.of("[PROJECT]", "[FOOBAR]").toString()) + .setParent(FoobarName.of("[PROJECT]", "[FOOBAR]").toString()) + .setFoobar(Foobar.newBuilder().build()) + .build(); + bidiStream.send(request); + for (EchoResponse response : bidiStream) { + // Do something when a response is received. + } + } + } +} +// [END goldensample_generated_EchoServiceShouldGeneratePartialPublic_ChatAgainShouldGenerateAsPublic_async] diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/echoserviceselectivegapicclient/AsyncChatAgainShouldGenerateAsUsual.golden b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/echoserviceselectivegapicclient/AsyncChatAgainShouldGenerateAsUsual.golden new file mode 100644 index 0000000000..e745bdb237 --- /dev/null +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/echoserviceselectivegapicclient/AsyncChatAgainShouldGenerateAsUsual.golden @@ -0,0 +1,58 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.selective.generate.v1beta1.samples; + +// [START goldensample_generated_EchoServiceShouldGeneratePartialUsual_ChatAgainShouldGenerateAsUsual_async] +import com.google.api.gax.rpc.BidiStream; +import com.google.selective.generate.v1beta1.EchoRequest; +import com.google.selective.generate.v1beta1.EchoResponse; +import com.google.selective.generate.v1beta1.EchoServiceShouldGeneratePartialUsualClient; +import com.google.selective.generate.v1beta1.Foobar; +import com.google.selective.generate.v1beta1.FoobarName; + +public class AsyncChatAgainShouldGenerateAsUsual { + + public static void main(String[] args) throws Exception { + asyncChatAgainShouldGenerateAsUsual(); + } + + public static void asyncChatAgainShouldGenerateAsUsual() 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 (EchoServiceShouldGeneratePartialUsualClient echoServiceShouldGeneratePartialUsualClient = + EchoServiceShouldGeneratePartialUsualClient.create()) { + BidiStream bidiStream = + echoServiceShouldGeneratePartialUsualClient + .chatAgainShouldGenerateAsUsualCallable() + .call(); + EchoRequest request = + EchoRequest.newBuilder() + .setName(FoobarName.of("[PROJECT]", "[FOOBAR]").toString()) + .setParent(FoobarName.of("[PROJECT]", "[FOOBAR]").toString()) + .setFoobar(Foobar.newBuilder().build()) + .build(); + bidiStream.send(request); + for (EchoResponse response : bidiStream) { + // Do something when a response is received. + } + } + } +} +// [END goldensample_generated_EchoServiceShouldGeneratePartialUsual_ChatAgainShouldGenerateAsUsual_async] diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/echoserviceselectivegapicclient/AsyncChatShouldGenerateAsInternal.golden b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/echoserviceselectivegapicclient/AsyncChatShouldGenerateAsInternal.golden new file mode 100644 index 0000000000..dca5a1b9f4 --- /dev/null +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/echoserviceselectivegapicclient/AsyncChatShouldGenerateAsInternal.golden @@ -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.selective.generate.v1beta1.samples; + +// [START goldensample_generated_EchoServiceShouldGeneratePartialUsual_ChatShouldGenerateAsInternal_async] +import com.google.api.core.ApiFuture; +import com.google.selective.generate.v1beta1.EchoRequest; +import com.google.selective.generate.v1beta1.EchoResponse; +import com.google.selective.generate.v1beta1.EchoServiceShouldGeneratePartialUsualClient; +import com.google.selective.generate.v1beta1.Foobar; +import com.google.selective.generate.v1beta1.FoobarName; + +public class AsyncChatShouldGenerateAsInternal { + + public static void main(String[] args) throws Exception { + asyncChatShouldGenerateAsInternal(); + } + + public static void asyncChatShouldGenerateAsInternal() 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 (EchoServiceShouldGeneratePartialUsualClient echoServiceShouldGeneratePartialUsualClient = + EchoServiceShouldGeneratePartialUsualClient.create()) { + EchoRequest request = + EchoRequest.newBuilder() + .setName(FoobarName.of("[PROJECT]", "[FOOBAR]").toString()) + .setParent(FoobarName.of("[PROJECT]", "[FOOBAR]").toString()) + .setFoobar(Foobar.newBuilder().build()) + .build(); + ApiFuture future = + echoServiceShouldGeneratePartialUsualClient + .chatShouldGenerateAsInternalCallable() + .futureCall(request); + // Do something. + EchoResponse response = future.get(); + } + } +} +// [END goldensample_generated_EchoServiceShouldGeneratePartialUsual_ChatShouldGenerateAsInternal_async] diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/echoserviceselectivegapicclient/AsyncChatShouldGenerateAsPublic.golden b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/echoserviceselectivegapicclient/AsyncChatShouldGenerateAsPublic.golden new file mode 100644 index 0000000000..74eb1d0118 --- /dev/null +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/echoserviceselectivegapicclient/AsyncChatShouldGenerateAsPublic.golden @@ -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.selective.generate.v1beta1.samples; + +// [START goldensample_generated_EchoServiceShouldGeneratePartialPublic_ChatShouldGenerateAsPublic_async] +import com.google.api.gax.rpc.BidiStream; +import com.google.selective.generate.v1beta1.EchoRequest; +import com.google.selective.generate.v1beta1.EchoResponse; +import com.google.selective.generate.v1beta1.EchoServiceShouldGeneratePartialPublicClient; +import com.google.selective.generate.v1beta1.Foobar; +import com.google.selective.generate.v1beta1.FoobarName; + +public class AsyncChatShouldGenerateAsPublic { + + public static void main(String[] args) throws Exception { + asyncChatShouldGenerateAsPublic(); + } + + public static void asyncChatShouldGenerateAsPublic() 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 (EchoServiceShouldGeneratePartialPublicClient echoServiceShouldGeneratePartialPublicClient = + EchoServiceShouldGeneratePartialPublicClient.create()) { + BidiStream bidiStream = + echoServiceShouldGeneratePartialPublicClient.chatShouldGenerateAsPublicCallable().call(); + EchoRequest request = + EchoRequest.newBuilder() + .setName(FoobarName.of("[PROJECT]", "[FOOBAR]").toString()) + .setParent(FoobarName.of("[PROJECT]", "[FOOBAR]").toString()) + .setFoobar(Foobar.newBuilder().build()) + .build(); + bidiStream.send(request); + for (EchoResponse response : bidiStream) { + // Do something when a response is received. + } + } + } +} +// [END goldensample_generated_EchoServiceShouldGeneratePartialPublic_ChatShouldGenerateAsPublic_async] diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/echoserviceselectivegapicclient/AsyncChatShouldGenerateAsUsual.golden b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/echoserviceselectivegapicclient/AsyncChatShouldGenerateAsUsual.golden new file mode 100644 index 0000000000..0cbc13407c --- /dev/null +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/echoserviceselectivegapicclient/AsyncChatShouldGenerateAsUsual.golden @@ -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.selective.generate.v1beta1.samples; + +// [START goldensample_generated_EchoServiceShouldGeneratePartialUsual_ChatShouldGenerateAsUsual_async] +import com.google.api.gax.rpc.BidiStream; +import com.google.selective.generate.v1beta1.EchoRequest; +import com.google.selective.generate.v1beta1.EchoResponse; +import com.google.selective.generate.v1beta1.EchoServiceShouldGeneratePartialUsualClient; +import com.google.selective.generate.v1beta1.Foobar; +import com.google.selective.generate.v1beta1.FoobarName; + +public class AsyncChatShouldGenerateAsUsual { + + public static void main(String[] args) throws Exception { + asyncChatShouldGenerateAsUsual(); + } + + public static void asyncChatShouldGenerateAsUsual() 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 (EchoServiceShouldGeneratePartialUsualClient echoServiceShouldGeneratePartialUsualClient = + EchoServiceShouldGeneratePartialUsualClient.create()) { + BidiStream bidiStream = + echoServiceShouldGeneratePartialUsualClient.chatShouldGenerateAsUsualCallable().call(); + EchoRequest request = + EchoRequest.newBuilder() + .setName(FoobarName.of("[PROJECT]", "[FOOBAR]").toString()) + .setParent(FoobarName.of("[PROJECT]", "[FOOBAR]").toString()) + .setFoobar(Foobar.newBuilder().build()) + .build(); + bidiStream.send(request); + for (EchoResponse response : bidiStream) { + // Do something when a response is received. + } + } + } +} +// [END goldensample_generated_EchoServiceShouldGeneratePartialUsual_ChatShouldGenerateAsUsual_async] diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/echoserviceselectivegapicclient/AsyncEchoShouldGenerateAsInternal.golden b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/echoserviceselectivegapicclient/AsyncEchoShouldGenerateAsInternal.golden new file mode 100644 index 0000000000..64d8dd2a4c --- /dev/null +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/echoserviceselectivegapicclient/AsyncEchoShouldGenerateAsInternal.golden @@ -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.selective.generate.v1beta1.samples; + +// [START goldensample_generated_EchoServiceShouldGeneratePartialUsual_EchoShouldGenerateAsInternal_async] +import com.google.api.gax.rpc.BidiStream; +import com.google.selective.generate.v1beta1.EchoRequest; +import com.google.selective.generate.v1beta1.EchoResponse; +import com.google.selective.generate.v1beta1.EchoServiceShouldGeneratePartialUsualClient; +import com.google.selective.generate.v1beta1.Foobar; +import com.google.selective.generate.v1beta1.FoobarName; + +public class AsyncEchoShouldGenerateAsInternal { + + public static void main(String[] args) throws Exception { + asyncEchoShouldGenerateAsInternal(); + } + + public static void asyncEchoShouldGenerateAsInternal() 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 (EchoServiceShouldGeneratePartialUsualClient echoServiceShouldGeneratePartialUsualClient = + EchoServiceShouldGeneratePartialUsualClient.create()) { + BidiStream bidiStream = + echoServiceShouldGeneratePartialUsualClient.echoShouldGenerateAsInternalCallable().call(); + EchoRequest request = + EchoRequest.newBuilder() + .setName(FoobarName.of("[PROJECT]", "[FOOBAR]").toString()) + .setParent(FoobarName.of("[PROJECT]", "[FOOBAR]").toString()) + .setFoobar(Foobar.newBuilder().build()) + .build(); + bidiStream.send(request); + for (EchoResponse response : bidiStream) { + // Do something when a response is received. + } + } + } +} +// [END goldensample_generated_EchoServiceShouldGeneratePartialUsual_EchoShouldGenerateAsInternal_async] diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/echoserviceselectivegapicclient/AsyncEchoShouldGenerateAsPublic.golden b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/echoserviceselectivegapicclient/AsyncEchoShouldGenerateAsPublic.golden new file mode 100644 index 0000000000..1da3c77914 --- /dev/null +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/echoserviceselectivegapicclient/AsyncEchoShouldGenerateAsPublic.golden @@ -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.selective.generate.v1beta1.samples; + +// [START goldensample_generated_EchoServiceShouldGeneratePartialPublic_EchoShouldGenerateAsPublic_async] +import com.google.api.core.ApiFuture; +import com.google.selective.generate.v1beta1.EchoRequest; +import com.google.selective.generate.v1beta1.EchoResponse; +import com.google.selective.generate.v1beta1.EchoServiceShouldGeneratePartialPublicClient; +import com.google.selective.generate.v1beta1.Foobar; +import com.google.selective.generate.v1beta1.FoobarName; + +public class AsyncEchoShouldGenerateAsPublic { + + public static void main(String[] args) throws Exception { + asyncEchoShouldGenerateAsPublic(); + } + + public static void asyncEchoShouldGenerateAsPublic() 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 (EchoServiceShouldGeneratePartialPublicClient echoServiceShouldGeneratePartialPublicClient = + EchoServiceShouldGeneratePartialPublicClient.create()) { + EchoRequest request = + EchoRequest.newBuilder() + .setName(FoobarName.of("[PROJECT]", "[FOOBAR]").toString()) + .setParent(FoobarName.of("[PROJECT]", "[FOOBAR]").toString()) + .setFoobar(Foobar.newBuilder().build()) + .build(); + ApiFuture future = + echoServiceShouldGeneratePartialPublicClient + .echoShouldGenerateAsPublicCallable() + .futureCall(request); + // Do something. + EchoResponse response = future.get(); + } + } +} +// [END goldensample_generated_EchoServiceShouldGeneratePartialPublic_EchoShouldGenerateAsPublic_async] diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/echoserviceselectivegapicclient/AsyncEchoShouldGenerateAsUsual.golden b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/echoserviceselectivegapicclient/AsyncEchoShouldGenerateAsUsual.golden new file mode 100644 index 0000000000..ec63a3c587 --- /dev/null +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/echoserviceselectivegapicclient/AsyncEchoShouldGenerateAsUsual.golden @@ -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.selective.generate.v1beta1.samples; + +// [START goldensample_generated_EchoServiceShouldGeneratePartialUsual_EchoShouldGenerateAsUsual_async] +import com.google.api.core.ApiFuture; +import com.google.selective.generate.v1beta1.EchoRequest; +import com.google.selective.generate.v1beta1.EchoResponse; +import com.google.selective.generate.v1beta1.EchoServiceShouldGeneratePartialUsualClient; +import com.google.selective.generate.v1beta1.Foobar; +import com.google.selective.generate.v1beta1.FoobarName; + +public class AsyncEchoShouldGenerateAsUsual { + + public static void main(String[] args) throws Exception { + asyncEchoShouldGenerateAsUsual(); + } + + public static void asyncEchoShouldGenerateAsUsual() 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 (EchoServiceShouldGeneratePartialUsualClient echoServiceShouldGeneratePartialUsualClient = + EchoServiceShouldGeneratePartialUsualClient.create()) { + EchoRequest request = + EchoRequest.newBuilder() + .setName(FoobarName.of("[PROJECT]", "[FOOBAR]").toString()) + .setParent(FoobarName.of("[PROJECT]", "[FOOBAR]").toString()) + .setFoobar(Foobar.newBuilder().build()) + .build(); + ApiFuture future = + echoServiceShouldGeneratePartialUsualClient + .echoShouldGenerateAsUsualCallable() + .futureCall(request); + // Do something. + EchoResponse response = future.get(); + } + } +} +// [END goldensample_generated_EchoServiceShouldGeneratePartialUsual_EchoShouldGenerateAsUsual_async] diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/echoserviceselectivegapicclient/SyncChatShouldGenerateAsInternal.golden b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/echoserviceselectivegapicclient/SyncChatShouldGenerateAsInternal.golden new file mode 100644 index 0000000000..18017ebfc3 --- /dev/null +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/echoserviceselectivegapicclient/SyncChatShouldGenerateAsInternal.golden @@ -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.selective.generate.v1beta1.samples; + +// [START goldensample_generated_EchoServiceShouldGeneratePartialUsual_ChatShouldGenerateAsInternal_sync] +import com.google.selective.generate.v1beta1.EchoRequest; +import com.google.selective.generate.v1beta1.EchoResponse; +import com.google.selective.generate.v1beta1.EchoServiceShouldGeneratePartialUsualClient; +import com.google.selective.generate.v1beta1.Foobar; +import com.google.selective.generate.v1beta1.FoobarName; + +public class SyncChatShouldGenerateAsInternal { + + public static void main(String[] args) throws Exception { + syncChatShouldGenerateAsInternal(); + } + + public static void syncChatShouldGenerateAsInternal() 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 (EchoServiceShouldGeneratePartialUsualClient echoServiceShouldGeneratePartialUsualClient = + EchoServiceShouldGeneratePartialUsualClient.create()) { + EchoRequest request = + EchoRequest.newBuilder() + .setName(FoobarName.of("[PROJECT]", "[FOOBAR]").toString()) + .setParent(FoobarName.of("[PROJECT]", "[FOOBAR]").toString()) + .setFoobar(Foobar.newBuilder().build()) + .build(); + EchoResponse response = + echoServiceShouldGeneratePartialUsualClient.chatShouldGenerateAsInternal(request); + } + } +} +// [END goldensample_generated_EchoServiceShouldGeneratePartialUsual_ChatShouldGenerateAsInternal_sync] diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/echoserviceselectivegapicclient/SyncChatShouldGenerateAsInternalFoobarname.golden b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/echoserviceselectivegapicclient/SyncChatShouldGenerateAsInternalFoobarname.golden new file mode 100644 index 0000000000..f217b8f4ef --- /dev/null +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/echoserviceselectivegapicclient/SyncChatShouldGenerateAsInternalFoobarname.golden @@ -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.selective.generate.v1beta1.samples; + +// [START goldensample_generated_EchoServiceShouldGeneratePartialUsual_ChatShouldGenerateAsInternal_Foobarname_sync] +import com.google.selective.generate.v1beta1.EchoResponse; +import com.google.selective.generate.v1beta1.EchoServiceShouldGeneratePartialUsualClient; +import com.google.selective.generate.v1beta1.FoobarName; + +public class SyncChatShouldGenerateAsInternalFoobarname { + + public static void main(String[] args) throws Exception { + syncChatShouldGenerateAsInternalFoobarname(); + } + + public static void syncChatShouldGenerateAsInternalFoobarname() 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 (EchoServiceShouldGeneratePartialUsualClient echoServiceShouldGeneratePartialUsualClient = + EchoServiceShouldGeneratePartialUsualClient.create()) { + FoobarName name = FoobarName.of("[PROJECT]", "[FOOBAR]"); + EchoResponse response = + echoServiceShouldGeneratePartialUsualClient.chatShouldGenerateAsInternal(name); + } + } +} +// [END goldensample_generated_EchoServiceShouldGeneratePartialUsual_ChatShouldGenerateAsInternal_Foobarname_sync] diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/echoserviceselectivegapicclient/SyncChatShouldGenerateAsInternalNoargs.golden b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/echoserviceselectivegapicclient/SyncChatShouldGenerateAsInternalNoargs.golden new file mode 100644 index 0000000000..9b3c95e017 --- /dev/null +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/echoserviceselectivegapicclient/SyncChatShouldGenerateAsInternalNoargs.golden @@ -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.selective.generate.v1beta1.samples; + +// [START goldensample_generated_EchoServiceShouldGeneratePartialUsual_ChatShouldGenerateAsInternal_Noargs_sync] +import com.google.selective.generate.v1beta1.EchoResponse; +import com.google.selective.generate.v1beta1.EchoServiceShouldGeneratePartialUsualClient; + +public class SyncChatShouldGenerateAsInternalNoargs { + + public static void main(String[] args) throws Exception { + syncChatShouldGenerateAsInternalNoargs(); + } + + public static void syncChatShouldGenerateAsInternalNoargs() 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 (EchoServiceShouldGeneratePartialUsualClient echoServiceShouldGeneratePartialUsualClient = + EchoServiceShouldGeneratePartialUsualClient.create()) { + EchoResponse response = + echoServiceShouldGeneratePartialUsualClient.chatShouldGenerateAsInternal(); + } + } +} +// [END goldensample_generated_EchoServiceShouldGeneratePartialUsual_ChatShouldGenerateAsInternal_Noargs_sync] diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/echoserviceselectivegapicclient/SyncChatShouldGenerateAsInternalString.golden b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/echoserviceselectivegapicclient/SyncChatShouldGenerateAsInternalString.golden new file mode 100644 index 0000000000..1a0216d16d --- /dev/null +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/echoserviceselectivegapicclient/SyncChatShouldGenerateAsInternalString.golden @@ -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.selective.generate.v1beta1.samples; + +// [START goldensample_generated_EchoServiceShouldGeneratePartialUsual_ChatShouldGenerateAsInternal_String_sync] +import com.google.selective.generate.v1beta1.EchoResponse; +import com.google.selective.generate.v1beta1.EchoServiceShouldGeneratePartialUsualClient; +import com.google.selective.generate.v1beta1.FoobarName; + +public class SyncChatShouldGenerateAsInternalString { + + public static void main(String[] args) throws Exception { + syncChatShouldGenerateAsInternalString(); + } + + public static void syncChatShouldGenerateAsInternalString() 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 (EchoServiceShouldGeneratePartialUsualClient echoServiceShouldGeneratePartialUsualClient = + EchoServiceShouldGeneratePartialUsualClient.create()) { + String name = FoobarName.of("[PROJECT]", "[FOOBAR]").toString(); + EchoResponse response = + echoServiceShouldGeneratePartialUsualClient.chatShouldGenerateAsInternal(name); + } + } +} +// [END goldensample_generated_EchoServiceShouldGeneratePartialUsual_ChatShouldGenerateAsInternal_String_sync] diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/echoserviceselectivegapicclient/SyncCreateSetCredentialsProvider.golden b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/echoserviceselectivegapicclient/SyncCreateSetCredentialsProvider.golden new file mode 100644 index 0000000000..9ea2dc09f3 --- /dev/null +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/echoserviceselectivegapicclient/SyncCreateSetCredentialsProvider.golden @@ -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.selective.generate.v1beta1.samples; + +// [START goldensample_generated_EchoServiceShouldGeneratePartialUsual_Create_SetCredentialsProvider_sync] +import com.google.api.gax.core.FixedCredentialsProvider; +import com.google.selective.generate.v1beta1.EchoServiceShouldGeneratePartialUsualClient; +import com.google.selective.generate.v1beta1.EchoServiceShouldGeneratePartialUsualSettings; +import com.google.selective.generate.v1beta1.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 + EchoServiceShouldGeneratePartialUsualSettings echoServiceShouldGeneratePartialUsualSettings = + EchoServiceShouldGeneratePartialUsualSettings.newBuilder() + .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials)) + .build(); + EchoServiceShouldGeneratePartialUsualClient echoServiceShouldGeneratePartialUsualClient = + EchoServiceShouldGeneratePartialUsualClient.create( + echoServiceShouldGeneratePartialUsualSettings); + } +} +// [END goldensample_generated_EchoServiceShouldGeneratePartialUsual_Create_SetCredentialsProvider_sync] diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/echoserviceselectivegapicclient/SyncCreateSetEndpoint.golden b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/echoserviceselectivegapicclient/SyncCreateSetEndpoint.golden new file mode 100644 index 0000000000..1b58cbe100 --- /dev/null +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/echoserviceselectivegapicclient/SyncCreateSetEndpoint.golden @@ -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.selective.generate.v1beta1.samples; + +// [START goldensample_generated_EchoServiceShouldGeneratePartialUsual_Create_SetEndpoint_sync] +import com.google.selective.generate.v1beta1.EchoServiceShouldGeneratePartialUsualClient; +import com.google.selective.generate.v1beta1.EchoServiceShouldGeneratePartialUsualSettings; +import com.google.selective.generate.v1beta1.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 + EchoServiceShouldGeneratePartialUsualSettings echoServiceShouldGeneratePartialUsualSettings = + EchoServiceShouldGeneratePartialUsualSettings.newBuilder().setEndpoint(myEndpoint).build(); + EchoServiceShouldGeneratePartialUsualClient echoServiceShouldGeneratePartialUsualClient = + EchoServiceShouldGeneratePartialUsualClient.create( + echoServiceShouldGeneratePartialUsualSettings); + } +} +// [END goldensample_generated_EchoServiceShouldGeneratePartialUsual_Create_SetEndpoint_sync] diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/echoserviceselectivegapicclient/SyncEchoShouldGenerateAsPublic.golden b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/echoserviceselectivegapicclient/SyncEchoShouldGenerateAsPublic.golden new file mode 100644 index 0000000000..02533c5d40 --- /dev/null +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/echoserviceselectivegapicclient/SyncEchoShouldGenerateAsPublic.golden @@ -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.selective.generate.v1beta1.samples; + +// [START goldensample_generated_EchoServiceShouldGeneratePartialPublic_EchoShouldGenerateAsPublic_sync] +import com.google.selective.generate.v1beta1.EchoRequest; +import com.google.selective.generate.v1beta1.EchoResponse; +import com.google.selective.generate.v1beta1.EchoServiceShouldGeneratePartialPublicClient; +import com.google.selective.generate.v1beta1.Foobar; +import com.google.selective.generate.v1beta1.FoobarName; + +public class SyncEchoShouldGenerateAsPublic { + + public static void main(String[] args) throws Exception { + syncEchoShouldGenerateAsPublic(); + } + + public static void syncEchoShouldGenerateAsPublic() 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 (EchoServiceShouldGeneratePartialPublicClient echoServiceShouldGeneratePartialPublicClient = + EchoServiceShouldGeneratePartialPublicClient.create()) { + EchoRequest request = + EchoRequest.newBuilder() + .setName(FoobarName.of("[PROJECT]", "[FOOBAR]").toString()) + .setParent(FoobarName.of("[PROJECT]", "[FOOBAR]").toString()) + .setFoobar(Foobar.newBuilder().build()) + .build(); + EchoResponse response = + echoServiceShouldGeneratePartialPublicClient.echoShouldGenerateAsPublic(request); + } + } +} +// [END goldensample_generated_EchoServiceShouldGeneratePartialPublic_EchoShouldGenerateAsPublic_sync] diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/echoserviceselectivegapicclient/SyncEchoShouldGenerateAsPublicFoobarname.golden b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/echoserviceselectivegapicclient/SyncEchoShouldGenerateAsPublicFoobarname.golden new file mode 100644 index 0000000000..586d181fe4 --- /dev/null +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/echoserviceselectivegapicclient/SyncEchoShouldGenerateAsPublicFoobarname.golden @@ -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.selective.generate.v1beta1.samples; + +// [START goldensample_generated_EchoServiceShouldGeneratePartialPublic_EchoShouldGenerateAsPublic_Foobarname_sync] +import com.google.selective.generate.v1beta1.EchoResponse; +import com.google.selective.generate.v1beta1.EchoServiceShouldGeneratePartialPublicClient; +import com.google.selective.generate.v1beta1.FoobarName; + +public class SyncEchoShouldGenerateAsPublicFoobarname { + + public static void main(String[] args) throws Exception { + syncEchoShouldGenerateAsPublicFoobarname(); + } + + public static void syncEchoShouldGenerateAsPublicFoobarname() 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 (EchoServiceShouldGeneratePartialPublicClient echoServiceShouldGeneratePartialPublicClient = + EchoServiceShouldGeneratePartialPublicClient.create()) { + FoobarName name = FoobarName.of("[PROJECT]", "[FOOBAR]"); + EchoResponse response = + echoServiceShouldGeneratePartialPublicClient.echoShouldGenerateAsPublic(name); + } + } +} +// [END goldensample_generated_EchoServiceShouldGeneratePartialPublic_EchoShouldGenerateAsPublic_Foobarname_sync] diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/echoserviceselectivegapicclient/SyncEchoShouldGenerateAsPublicNoargs.golden b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/echoserviceselectivegapicclient/SyncEchoShouldGenerateAsPublicNoargs.golden new file mode 100644 index 0000000000..9e61ddb98b --- /dev/null +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/echoserviceselectivegapicclient/SyncEchoShouldGenerateAsPublicNoargs.golden @@ -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.selective.generate.v1beta1.samples; + +// [START goldensample_generated_EchoServiceShouldGeneratePartialPublic_EchoShouldGenerateAsPublic_Noargs_sync] +import com.google.selective.generate.v1beta1.EchoResponse; +import com.google.selective.generate.v1beta1.EchoServiceShouldGeneratePartialPublicClient; + +public class SyncEchoShouldGenerateAsPublicNoargs { + + public static void main(String[] args) throws Exception { + syncEchoShouldGenerateAsPublicNoargs(); + } + + public static void syncEchoShouldGenerateAsPublicNoargs() 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 (EchoServiceShouldGeneratePartialPublicClient echoServiceShouldGeneratePartialPublicClient = + EchoServiceShouldGeneratePartialPublicClient.create()) { + EchoResponse response = + echoServiceShouldGeneratePartialPublicClient.echoShouldGenerateAsPublic(); + } + } +} +// [END goldensample_generated_EchoServiceShouldGeneratePartialPublic_EchoShouldGenerateAsPublic_Noargs_sync] diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/echoserviceselectivegapicclient/SyncEchoShouldGenerateAsPublicString.golden b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/echoserviceselectivegapicclient/SyncEchoShouldGenerateAsPublicString.golden new file mode 100644 index 0000000000..a035c1000e --- /dev/null +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/echoserviceselectivegapicclient/SyncEchoShouldGenerateAsPublicString.golden @@ -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.selective.generate.v1beta1.samples; + +// [START goldensample_generated_EchoServiceShouldGeneratePartialPublic_EchoShouldGenerateAsPublic_String_sync] +import com.google.selective.generate.v1beta1.EchoResponse; +import com.google.selective.generate.v1beta1.EchoServiceShouldGeneratePartialPublicClient; +import com.google.selective.generate.v1beta1.FoobarName; + +public class SyncEchoShouldGenerateAsPublicString { + + public static void main(String[] args) throws Exception { + syncEchoShouldGenerateAsPublicString(); + } + + public static void syncEchoShouldGenerateAsPublicString() 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 (EchoServiceShouldGeneratePartialPublicClient echoServiceShouldGeneratePartialPublicClient = + EchoServiceShouldGeneratePartialPublicClient.create()) { + String name = FoobarName.of("[PROJECT]", "[FOOBAR]").toString(); + EchoResponse response = + echoServiceShouldGeneratePartialPublicClient.echoShouldGenerateAsPublic(name); + } + } +} +// [END goldensample_generated_EchoServiceShouldGeneratePartialPublic_EchoShouldGenerateAsPublic_String_sync] diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/echoserviceselectivegapicclient/SyncEchoShouldGenerateAsUsual.golden b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/echoserviceselectivegapicclient/SyncEchoShouldGenerateAsUsual.golden new file mode 100644 index 0000000000..af978eee1e --- /dev/null +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/echoserviceselectivegapicclient/SyncEchoShouldGenerateAsUsual.golden @@ -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.selective.generate.v1beta1.samples; + +// [START goldensample_generated_EchoServiceShouldGeneratePartialUsual_EchoShouldGenerateAsUsual_sync] +import com.google.selective.generate.v1beta1.EchoRequest; +import com.google.selective.generate.v1beta1.EchoResponse; +import com.google.selective.generate.v1beta1.EchoServiceShouldGeneratePartialUsualClient; +import com.google.selective.generate.v1beta1.Foobar; +import com.google.selective.generate.v1beta1.FoobarName; + +public class SyncEchoShouldGenerateAsUsual { + + public static void main(String[] args) throws Exception { + syncEchoShouldGenerateAsUsual(); + } + + public static void syncEchoShouldGenerateAsUsual() 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 (EchoServiceShouldGeneratePartialUsualClient echoServiceShouldGeneratePartialUsualClient = + EchoServiceShouldGeneratePartialUsualClient.create()) { + EchoRequest request = + EchoRequest.newBuilder() + .setName(FoobarName.of("[PROJECT]", "[FOOBAR]").toString()) + .setParent(FoobarName.of("[PROJECT]", "[FOOBAR]").toString()) + .setFoobar(Foobar.newBuilder().build()) + .build(); + EchoResponse response = + echoServiceShouldGeneratePartialUsualClient.echoShouldGenerateAsUsual(request); + } + } +} +// [END goldensample_generated_EchoServiceShouldGeneratePartialUsual_EchoShouldGenerateAsUsual_sync] diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/echoserviceselectivegapicclient/SyncEchoShouldGenerateAsUsualFoobarname.golden b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/echoserviceselectivegapicclient/SyncEchoShouldGenerateAsUsualFoobarname.golden new file mode 100644 index 0000000000..c2e469912a --- /dev/null +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/echoserviceselectivegapicclient/SyncEchoShouldGenerateAsUsualFoobarname.golden @@ -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.selective.generate.v1beta1.samples; + +// [START goldensample_generated_EchoServiceShouldGeneratePartialUsual_EchoShouldGenerateAsUsual_Foobarname_sync] +import com.google.selective.generate.v1beta1.EchoResponse; +import com.google.selective.generate.v1beta1.EchoServiceShouldGeneratePartialUsualClient; +import com.google.selective.generate.v1beta1.FoobarName; + +public class SyncEchoShouldGenerateAsUsualFoobarname { + + public static void main(String[] args) throws Exception { + syncEchoShouldGenerateAsUsualFoobarname(); + } + + public static void syncEchoShouldGenerateAsUsualFoobarname() 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 (EchoServiceShouldGeneratePartialUsualClient echoServiceShouldGeneratePartialUsualClient = + EchoServiceShouldGeneratePartialUsualClient.create()) { + FoobarName name = FoobarName.of("[PROJECT]", "[FOOBAR]"); + EchoResponse response = + echoServiceShouldGeneratePartialUsualClient.echoShouldGenerateAsUsual(name); + } + } +} +// [END goldensample_generated_EchoServiceShouldGeneratePartialUsual_EchoShouldGenerateAsUsual_Foobarname_sync] diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/echoserviceselectivegapicclient/SyncEchoShouldGenerateAsUsualNoargs.golden b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/echoserviceselectivegapicclient/SyncEchoShouldGenerateAsUsualNoargs.golden new file mode 100644 index 0000000000..b080af1eb4 --- /dev/null +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/echoserviceselectivegapicclient/SyncEchoShouldGenerateAsUsualNoargs.golden @@ -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.selective.generate.v1beta1.samples; + +// [START goldensample_generated_EchoServiceShouldGeneratePartialUsual_EchoShouldGenerateAsUsual_Noargs_sync] +import com.google.selective.generate.v1beta1.EchoResponse; +import com.google.selective.generate.v1beta1.EchoServiceShouldGeneratePartialUsualClient; + +public class SyncEchoShouldGenerateAsUsualNoargs { + + public static void main(String[] args) throws Exception { + syncEchoShouldGenerateAsUsualNoargs(); + } + + public static void syncEchoShouldGenerateAsUsualNoargs() 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 (EchoServiceShouldGeneratePartialUsualClient echoServiceShouldGeneratePartialUsualClient = + EchoServiceShouldGeneratePartialUsualClient.create()) { + EchoResponse response = + echoServiceShouldGeneratePartialUsualClient.echoShouldGenerateAsUsual(); + } + } +} +// [END goldensample_generated_EchoServiceShouldGeneratePartialUsual_EchoShouldGenerateAsUsual_Noargs_sync] diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/echoserviceselectivegapicclient/SyncEchoShouldGenerateAsUsualString.golden b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/echoserviceselectivegapicclient/SyncEchoShouldGenerateAsUsualString.golden new file mode 100644 index 0000000000..e4142b60d3 --- /dev/null +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/echoserviceselectivegapicclient/SyncEchoShouldGenerateAsUsualString.golden @@ -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.selective.generate.v1beta1.samples; + +// [START goldensample_generated_EchoServiceShouldGeneratePartialUsual_EchoShouldGenerateAsUsual_String_sync] +import com.google.selective.generate.v1beta1.EchoResponse; +import com.google.selective.generate.v1beta1.EchoServiceShouldGeneratePartialUsualClient; +import com.google.selective.generate.v1beta1.FoobarName; + +public class SyncEchoShouldGenerateAsUsualString { + + public static void main(String[] args) throws Exception { + syncEchoShouldGenerateAsUsualString(); + } + + public static void syncEchoShouldGenerateAsUsualString() 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 (EchoServiceShouldGeneratePartialUsualClient echoServiceShouldGeneratePartialUsualClient = + EchoServiceShouldGeneratePartialUsualClient.create()) { + String name = FoobarName.of("[PROJECT]", "[FOOBAR]").toString(); + EchoResponse response = + echoServiceShouldGeneratePartialUsualClient.echoShouldGenerateAsUsual(name); + } + } +} +// [END goldensample_generated_EchoServiceShouldGeneratePartialUsual_EchoShouldGenerateAsUsual_String_sync] diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/identityclient/AsyncCreateUser.golden b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/identityclient/AsyncCreateUser.golden index 42b3f90307..0a4e2fabc1 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/identityclient/AsyncCreateUser.golden +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/identityclient/AsyncCreateUser.golden @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2025 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/identityclient/AsyncDeleteUser.golden b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/identityclient/AsyncDeleteUser.golden index 09d4bf8625..b83b712054 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/identityclient/AsyncDeleteUser.golden +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/identityclient/AsyncDeleteUser.golden @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2025 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/identityclient/AsyncGetUser.golden b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/identityclient/AsyncGetUser.golden index ab82342d69..aaac81aa05 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/identityclient/AsyncGetUser.golden +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/identityclient/AsyncGetUser.golden @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2025 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/identityclient/AsyncListUsers.golden b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/identityclient/AsyncListUsers.golden index 07b5e7b761..00dd35665f 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/identityclient/AsyncListUsers.golden +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/identityclient/AsyncListUsers.golden @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2025 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/identityclient/AsyncListUsersPaged.golden b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/identityclient/AsyncListUsersPaged.golden index 2dd52c01a9..820c403e33 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/identityclient/AsyncListUsersPaged.golden +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/identityclient/AsyncListUsersPaged.golden @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2025 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/identityclient/AsyncUpdateUser.golden b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/identityclient/AsyncUpdateUser.golden index 6a77b3f29d..2002340858 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/identityclient/AsyncUpdateUser.golden +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/identityclient/AsyncUpdateUser.golden @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2025 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/identityclient/SyncCreateSetCredentialsProvider.golden b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/identityclient/SyncCreateSetCredentialsProvider.golden index 170fb27fb1..222ed7a2eb 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/identityclient/SyncCreateSetCredentialsProvider.golden +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/identityclient/SyncCreateSetCredentialsProvider.golden @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2025 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/identityclient/SyncCreateSetEndpoint.golden b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/identityclient/SyncCreateSetEndpoint.golden index 33dd94a49b..d61a0b2f95 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/identityclient/SyncCreateSetEndpoint.golden +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/identityclient/SyncCreateSetEndpoint.golden @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2025 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/identityclient/SyncCreateUser.golden b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/identityclient/SyncCreateUser.golden index 7fb81d997e..c199e8ae8f 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/identityclient/SyncCreateUser.golden +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/identityclient/SyncCreateUser.golden @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2025 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/identityclient/SyncCreateUserStringStringString.golden b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/identityclient/SyncCreateUserStringStringString.golden index 39feaa06d3..c607200a90 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/identityclient/SyncCreateUserStringStringString.golden +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/identityclient/SyncCreateUserStringStringString.golden @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2025 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/identityclient/SyncCreateUserStringStringStringIntStringBooleanDouble.golden b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/identityclient/SyncCreateUserStringStringStringIntStringBooleanDouble.golden index 338a1262a2..f2fd7d1c22 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/identityclient/SyncCreateUserStringStringStringIntStringBooleanDouble.golden +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/identityclient/SyncCreateUserStringStringStringIntStringBooleanDouble.golden @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2025 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/identityclient/SyncCreateUserStringStringStringStringStringIntStringStringStringString.golden b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/identityclient/SyncCreateUserStringStringStringStringStringIntStringStringStringString.golden index e56b757fe6..3edeac6779 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/identityclient/SyncCreateUserStringStringStringStringStringIntStringStringStringString.golden +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/identityclient/SyncCreateUserStringStringStringStringStringIntStringStringStringString.golden @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2025 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/identityclient/SyncDeleteUser.golden b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/identityclient/SyncDeleteUser.golden index 1142599cce..c410fe1367 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/identityclient/SyncDeleteUser.golden +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/identityclient/SyncDeleteUser.golden @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2025 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/identityclient/SyncDeleteUserString.golden b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/identityclient/SyncDeleteUserString.golden index a809efb619..0471b89167 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/identityclient/SyncDeleteUserString.golden +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/identityclient/SyncDeleteUserString.golden @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2025 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/identityclient/SyncDeleteUserUsername.golden b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/identityclient/SyncDeleteUserUsername.golden index 742b1e748c..b0a0d20dd8 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/identityclient/SyncDeleteUserUsername.golden +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/identityclient/SyncDeleteUserUsername.golden @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2025 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/identityclient/SyncGetUser.golden b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/identityclient/SyncGetUser.golden index e3bf802301..a32aed24a6 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/identityclient/SyncGetUser.golden +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/identityclient/SyncGetUser.golden @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2025 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/identityclient/SyncGetUserString.golden b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/identityclient/SyncGetUserString.golden index 73c4cf2bba..b54b28c5e1 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/identityclient/SyncGetUserString.golden +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/identityclient/SyncGetUserString.golden @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2025 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/identityclient/SyncGetUserUsername.golden b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/identityclient/SyncGetUserUsername.golden index 4af40f648d..ef19a6ad18 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/identityclient/SyncGetUserUsername.golden +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/identityclient/SyncGetUserUsername.golden @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2025 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/identityclient/SyncListUsers.golden b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/identityclient/SyncListUsers.golden index d111584331..b5f3a01511 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/identityclient/SyncListUsers.golden +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/identityclient/SyncListUsers.golden @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2025 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/identityclient/SyncUpdateUser.golden b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/identityclient/SyncUpdateUser.golden index beca349fe1..05f88e969a 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/identityclient/SyncUpdateUser.golden +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/identityclient/SyncUpdateUser.golden @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2025 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/messagingclient/AsyncConnect.golden b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/messagingclient/AsyncConnect.golden index 1527fbf21c..318986b0d1 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/messagingclient/AsyncConnect.golden +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/messagingclient/AsyncConnect.golden @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2025 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/messagingclient/AsyncCreateBlurb.golden b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/messagingclient/AsyncCreateBlurb.golden index 7d4dedad14..e58bd83737 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/messagingclient/AsyncCreateBlurb.golden +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/messagingclient/AsyncCreateBlurb.golden @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2025 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/messagingclient/AsyncCreateRoom.golden b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/messagingclient/AsyncCreateRoom.golden index 0b97e48893..ff22fccac9 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/messagingclient/AsyncCreateRoom.golden +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/messagingclient/AsyncCreateRoom.golden @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2025 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/messagingclient/AsyncDeleteBlurb.golden b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/messagingclient/AsyncDeleteBlurb.golden index 541b576c49..af1812a55b 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/messagingclient/AsyncDeleteBlurb.golden +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/messagingclient/AsyncDeleteBlurb.golden @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2025 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/messagingclient/AsyncDeleteRoom.golden b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/messagingclient/AsyncDeleteRoom.golden index a848b99195..8c0aba4c55 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/messagingclient/AsyncDeleteRoom.golden +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/messagingclient/AsyncDeleteRoom.golden @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2025 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/messagingclient/AsyncGetBlurb.golden b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/messagingclient/AsyncGetBlurb.golden index 91561164d4..ed3e142a40 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/messagingclient/AsyncGetBlurb.golden +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/messagingclient/AsyncGetBlurb.golden @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2025 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/messagingclient/AsyncGetRoom.golden b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/messagingclient/AsyncGetRoom.golden index e18adcb4fe..476dfc81b1 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/messagingclient/AsyncGetRoom.golden +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/messagingclient/AsyncGetRoom.golden @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2025 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/messagingclient/AsyncListBlurbs.golden b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/messagingclient/AsyncListBlurbs.golden index f61cbee5ec..077ecdd0f3 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/messagingclient/AsyncListBlurbs.golden +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/messagingclient/AsyncListBlurbs.golden @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2025 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/messagingclient/AsyncListBlurbsPaged.golden b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/messagingclient/AsyncListBlurbsPaged.golden index 261b3be58b..20ebe70435 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/messagingclient/AsyncListBlurbsPaged.golden +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/messagingclient/AsyncListBlurbsPaged.golden @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2025 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/messagingclient/AsyncListRooms.golden b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/messagingclient/AsyncListRooms.golden index 0fa5c5dd31..ee18467a10 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/messagingclient/AsyncListRooms.golden +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/messagingclient/AsyncListRooms.golden @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2025 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/messagingclient/AsyncListRoomsPaged.golden b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/messagingclient/AsyncListRoomsPaged.golden index 83a9c04205..a9dbe62410 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/messagingclient/AsyncListRoomsPaged.golden +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/messagingclient/AsyncListRoomsPaged.golden @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2025 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/messagingclient/AsyncSearchBlurbs.golden b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/messagingclient/AsyncSearchBlurbs.golden index a492728b11..0331967ba4 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/messagingclient/AsyncSearchBlurbs.golden +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/messagingclient/AsyncSearchBlurbs.golden @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2025 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/messagingclient/AsyncSearchBlurbsLRO.golden b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/messagingclient/AsyncSearchBlurbsLRO.golden index c4db52aceb..b58df5ec14 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/messagingclient/AsyncSearchBlurbsLRO.golden +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/messagingclient/AsyncSearchBlurbsLRO.golden @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2025 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/messagingclient/AsyncSendBlurbs.golden b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/messagingclient/AsyncSendBlurbs.golden index 9275afa82b..87960ea720 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/messagingclient/AsyncSendBlurbs.golden +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/messagingclient/AsyncSendBlurbs.golden @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2025 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/messagingclient/AsyncStreamBlurbs.golden b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/messagingclient/AsyncStreamBlurbs.golden index eeefc7952e..6d4a1397aa 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/messagingclient/AsyncStreamBlurbs.golden +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/messagingclient/AsyncStreamBlurbs.golden @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2025 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/messagingclient/AsyncUpdateBlurb.golden b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/messagingclient/AsyncUpdateBlurb.golden index f7b197c194..e3fafc66ea 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/messagingclient/AsyncUpdateBlurb.golden +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/messagingclient/AsyncUpdateBlurb.golden @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2025 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/messagingclient/AsyncUpdateRoom.golden b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/messagingclient/AsyncUpdateRoom.golden index 7bdf9bed17..539dbd8d67 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/messagingclient/AsyncUpdateRoom.golden +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/messagingclient/AsyncUpdateRoom.golden @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2025 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/messagingclient/SyncCreateBlurb.golden b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/messagingclient/SyncCreateBlurb.golden index 57d0f0c180..d2b5c1a05b 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/messagingclient/SyncCreateBlurb.golden +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/messagingclient/SyncCreateBlurb.golden @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2025 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/messagingclient/SyncCreateBlurbProfilenameBytestring.golden b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/messagingclient/SyncCreateBlurbProfilenameBytestring.golden index ab5a62701c..33f6c4a10c 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/messagingclient/SyncCreateBlurbProfilenameBytestring.golden +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/messagingclient/SyncCreateBlurbProfilenameBytestring.golden @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2025 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/messagingclient/SyncCreateBlurbProfilenameString.golden b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/messagingclient/SyncCreateBlurbProfilenameString.golden index a7efb77b5d..8e60d8e479 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/messagingclient/SyncCreateBlurbProfilenameString.golden +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/messagingclient/SyncCreateBlurbProfilenameString.golden @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2025 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/messagingclient/SyncCreateBlurbRoomnameBytestring.golden b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/messagingclient/SyncCreateBlurbRoomnameBytestring.golden index 143145ac95..761e4c46c3 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/messagingclient/SyncCreateBlurbRoomnameBytestring.golden +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/messagingclient/SyncCreateBlurbRoomnameBytestring.golden @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2025 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/messagingclient/SyncCreateBlurbRoomnameString.golden b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/messagingclient/SyncCreateBlurbRoomnameString.golden index 8b7d8c6bbf..ee819230f6 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/messagingclient/SyncCreateBlurbRoomnameString.golden +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/messagingclient/SyncCreateBlurbRoomnameString.golden @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2025 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/messagingclient/SyncCreateBlurbStringBytestring.golden b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/messagingclient/SyncCreateBlurbStringBytestring.golden index 08e2fc9a9b..5e5ebad693 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/messagingclient/SyncCreateBlurbStringBytestring.golden +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/messagingclient/SyncCreateBlurbStringBytestring.golden @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2025 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/messagingclient/SyncCreateBlurbStringString.golden b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/messagingclient/SyncCreateBlurbStringString.golden index f77ae6eb0f..5fc08872f3 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/messagingclient/SyncCreateBlurbStringString.golden +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/messagingclient/SyncCreateBlurbStringString.golden @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2025 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/messagingclient/SyncCreateRoom.golden b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/messagingclient/SyncCreateRoom.golden index f1ac7b0bf8..7842ebea24 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/messagingclient/SyncCreateRoom.golden +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/messagingclient/SyncCreateRoom.golden @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2025 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/messagingclient/SyncCreateRoomStringString.golden b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/messagingclient/SyncCreateRoomStringString.golden index 05a335d704..f96d76acf4 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/messagingclient/SyncCreateRoomStringString.golden +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/messagingclient/SyncCreateRoomStringString.golden @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2025 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/messagingclient/SyncCreateSetCredentialsProvider.golden b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/messagingclient/SyncCreateSetCredentialsProvider.golden index 2707298f00..f2377f6dd5 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/messagingclient/SyncCreateSetCredentialsProvider.golden +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/messagingclient/SyncCreateSetCredentialsProvider.golden @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2025 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/messagingclient/SyncCreateSetEndpoint.golden b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/messagingclient/SyncCreateSetEndpoint.golden index 53141d54ff..a0ebebc4da 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/messagingclient/SyncCreateSetEndpoint.golden +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/messagingclient/SyncCreateSetEndpoint.golden @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2025 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/messagingclient/SyncDeleteBlurb.golden b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/messagingclient/SyncDeleteBlurb.golden index 16d8a41623..cdb73087b1 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/messagingclient/SyncDeleteBlurb.golden +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/messagingclient/SyncDeleteBlurb.golden @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2025 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/messagingclient/SyncDeleteBlurbBlurbname.golden b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/messagingclient/SyncDeleteBlurbBlurbname.golden index 752875d995..21d3be2509 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/messagingclient/SyncDeleteBlurbBlurbname.golden +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/messagingclient/SyncDeleteBlurbBlurbname.golden @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2025 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/messagingclient/SyncDeleteBlurbString.golden b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/messagingclient/SyncDeleteBlurbString.golden index c52c8d070f..864f6bf16b 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/messagingclient/SyncDeleteBlurbString.golden +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/messagingclient/SyncDeleteBlurbString.golden @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2025 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/messagingclient/SyncDeleteRoom.golden b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/messagingclient/SyncDeleteRoom.golden index 621d024d15..128c9d6798 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/messagingclient/SyncDeleteRoom.golden +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/messagingclient/SyncDeleteRoom.golden @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2025 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/messagingclient/SyncDeleteRoomRoomname.golden b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/messagingclient/SyncDeleteRoomRoomname.golden index bd203c1483..4f3cde1c6b 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/messagingclient/SyncDeleteRoomRoomname.golden +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/messagingclient/SyncDeleteRoomRoomname.golden @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2025 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/messagingclient/SyncDeleteRoomString.golden b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/messagingclient/SyncDeleteRoomString.golden index d65c2b43dd..ec8a08416b 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/messagingclient/SyncDeleteRoomString.golden +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/messagingclient/SyncDeleteRoomString.golden @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2025 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/messagingclient/SyncGetBlurb.golden b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/messagingclient/SyncGetBlurb.golden index 16570a645d..631604f878 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/messagingclient/SyncGetBlurb.golden +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/messagingclient/SyncGetBlurb.golden @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2025 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/messagingclient/SyncGetBlurbBlurbname.golden b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/messagingclient/SyncGetBlurbBlurbname.golden index 012a36a6da..d538b7fab2 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/messagingclient/SyncGetBlurbBlurbname.golden +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/messagingclient/SyncGetBlurbBlurbname.golden @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2025 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/messagingclient/SyncGetBlurbString.golden b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/messagingclient/SyncGetBlurbString.golden index ec7957a5d6..004da1b32b 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/messagingclient/SyncGetBlurbString.golden +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/messagingclient/SyncGetBlurbString.golden @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2025 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/messagingclient/SyncGetRoom.golden b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/messagingclient/SyncGetRoom.golden index 12aef664c1..3c6df997a1 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/messagingclient/SyncGetRoom.golden +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/messagingclient/SyncGetRoom.golden @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2025 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/messagingclient/SyncGetRoomRoomname.golden b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/messagingclient/SyncGetRoomRoomname.golden index b732876cb2..62193bbaa8 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/messagingclient/SyncGetRoomRoomname.golden +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/messagingclient/SyncGetRoomRoomname.golden @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2025 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/messagingclient/SyncGetRoomString.golden b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/messagingclient/SyncGetRoomString.golden index ce6113ed1a..963edfe1e6 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/messagingclient/SyncGetRoomString.golden +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/messagingclient/SyncGetRoomString.golden @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2025 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/messagingclient/SyncListBlurbs.golden b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/messagingclient/SyncListBlurbs.golden index af34fdbf29..eec7f8f964 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/messagingclient/SyncListBlurbs.golden +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/messagingclient/SyncListBlurbs.golden @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2025 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/messagingclient/SyncListBlurbsProfilename.golden b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/messagingclient/SyncListBlurbsProfilename.golden index ce95287fb5..92bab5e6ac 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/messagingclient/SyncListBlurbsProfilename.golden +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/messagingclient/SyncListBlurbsProfilename.golden @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2025 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/messagingclient/SyncListBlurbsRoomname.golden b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/messagingclient/SyncListBlurbsRoomname.golden index f3bac1b2b5..dc7a69d58e 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/messagingclient/SyncListBlurbsRoomname.golden +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/messagingclient/SyncListBlurbsRoomname.golden @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2025 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/messagingclient/SyncListBlurbsString.golden b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/messagingclient/SyncListBlurbsString.golden index 89f24d8d1b..3536a447dd 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/messagingclient/SyncListBlurbsString.golden +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/messagingclient/SyncListBlurbsString.golden @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2025 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/messagingclient/SyncListRooms.golden b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/messagingclient/SyncListRooms.golden index 0318e80856..3e98751800 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/messagingclient/SyncListRooms.golden +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/messagingclient/SyncListRooms.golden @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2025 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/messagingclient/SyncSearchBlurbs.golden b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/messagingclient/SyncSearchBlurbs.golden index 09e3843acc..f00ca3afeb 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/messagingclient/SyncSearchBlurbs.golden +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/messagingclient/SyncSearchBlurbs.golden @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2025 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/messagingclient/SyncSearchBlurbsString.golden b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/messagingclient/SyncSearchBlurbsString.golden index 2fbae35501..a6c3061951 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/messagingclient/SyncSearchBlurbsString.golden +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/messagingclient/SyncSearchBlurbsString.golden @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2025 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/messagingclient/SyncUpdateBlurb.golden b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/messagingclient/SyncUpdateBlurb.golden index cc949cd2e2..4c58aa77b2 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/messagingclient/SyncUpdateBlurb.golden +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/messagingclient/SyncUpdateBlurb.golden @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2025 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/messagingclient/SyncUpdateRoom.golden b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/messagingclient/SyncUpdateRoom.golden index f532f73957..5a8f111584 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/messagingclient/SyncUpdateRoom.golden +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/messagingclient/SyncUpdateRoom.golden @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2025 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/servicesettings/SyncEcho.golden b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/servicesettings/SyncEcho.golden index 5d031b7c77..72bcf935af 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/servicesettings/SyncEcho.golden +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/servicesettings/SyncEcho.golden @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2025 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -40,7 +40,14 @@ public class SyncEcho { .echoSettings() .getRetrySettings() .toBuilder() - .setTotalTimeout(Duration.ofSeconds(30)) + .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()); EchoSettings echoSettings = echoSettingsBuilder.build(); } diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/servicesettings/SyncEchoShouldGenerateAsUsual.golden b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/servicesettings/SyncEchoShouldGenerateAsUsual.golden new file mode 100644 index 0000000000..64beddd0cd --- /dev/null +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/servicesettings/SyncEchoShouldGenerateAsUsual.golden @@ -0,0 +1,58 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.selective.generate.v1beta1.samples; + +// [START goldensample_generated_EchoServiceShouldGeneratePartialUsualSettings_EchoShouldGenerateAsUsual_sync] +import com.google.selective.generate.v1beta1.EchoServiceShouldGeneratePartialUsualSettings; +import java.time.Duration; + +public class SyncEchoShouldGenerateAsUsual { + + public static void main(String[] args) throws Exception { + syncEchoShouldGenerateAsUsual(); + } + + public static void syncEchoShouldGenerateAsUsual() 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 + EchoServiceShouldGeneratePartialUsualSettings.Builder + echoServiceShouldGeneratePartialUsualSettingsBuilder = + EchoServiceShouldGeneratePartialUsualSettings.newBuilder(); + echoServiceShouldGeneratePartialUsualSettingsBuilder + .echoShouldGenerateAsUsualSettings() + .setRetrySettings( + echoServiceShouldGeneratePartialUsualSettingsBuilder + .echoShouldGenerateAsUsualSettings() + .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()); + EchoServiceShouldGeneratePartialUsualSettings echoServiceShouldGeneratePartialUsualSettings = + echoServiceShouldGeneratePartialUsualSettingsBuilder.build(); + } +} +// [END goldensample_generated_EchoServiceShouldGeneratePartialUsualSettings_EchoShouldGenerateAsUsual_sync] diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/servicesettings/SyncFastFibonacci.golden b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/servicesettings/SyncFastFibonacci.golden index 90cd534cee..1ad7ea2c07 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/servicesettings/SyncFastFibonacci.golden +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/servicesettings/SyncFastFibonacci.golden @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2025 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -41,7 +41,14 @@ public class SyncFastFibonacci { .fastFibonacciSettings() .getRetrySettings() .toBuilder() - .setTotalTimeout(Duration.ofSeconds(30)) + .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()); DeprecatedServiceSettings deprecatedServiceSettings = deprecatedServiceSettingsBuilder.build(); } diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/servicesettings/SyncWait.golden b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/servicesettings/SyncWait.golden new file mode 100644 index 0000000000..56b28ef988 --- /dev/null +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/servicesettings/SyncWait.golden @@ -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.showcase.v1beta1.samples; + +// [START goldensample_generated_EchoSettings_Wait_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.showcase.v1beta1.EchoSettings; +import java.time.Duration; + +public class SyncWait { + + public static void main(String[] args) throws Exception { + syncWait(); + } + + public static void syncWait() 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 + EchoSettings.Builder echoSettingsBuilder = EchoSettings.newBuilder(); + TimedRetryAlgorithm timedRetryAlgorithm = + OperationalTimedPollAlgorithm.create( + RetrySettings.newBuilder() + .setInitialRetryDelayDuration(Duration.ofMillis(500)) + .setRetryDelayMultiplier(1.5) + .setMaxRetryDelayDuration(Duration.ofMillis(5000)) + .setTotalTimeoutDuration(Duration.ofHours(24)) + .build()); + echoSettingsBuilder + .createClusterOperationSettings() + .setPollingAlgorithm(timedRetryAlgorithm) + .build(); + } +} +// [END goldensample_generated_EchoSettings_Wait_sync] diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/servicesettings/stub/SyncCreateTopic.golden b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/servicesettings/stub/SyncCreateTopic.golden index 7417d5b42e..1d4be7de41 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/servicesettings/stub/SyncCreateTopic.golden +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/servicesettings/stub/SyncCreateTopic.golden @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2025 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -40,7 +40,14 @@ public class SyncCreateTopic { .createTopicSettings() .getRetrySettings() .toBuilder() - .setTotalTimeout(Duration.ofSeconds(30)) + .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()); PublisherStubSettings publisherSettings = publisherSettingsBuilder.build(); } diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/servicesettings/stub/SyncDeleteJob.golden b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/servicesettings/stub/SyncDeleteJob.golden new file mode 100644 index 0000000000..db01c32cd8 --- /dev/null +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/servicesettings/stub/SyncDeleteJob.golden @@ -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.bigquery.v2.stub.samples; + +// [START goldensample_generated_JobServiceStubSettings_DeleteJob_sync] +import com.google.cloud.bigquery.v2.stub.JobServiceStubSettings; +import java.time.Duration; + +public class SyncDeleteJob { + + public static void main(String[] args) throws Exception { + syncDeleteJob(); + } + + public static void syncDeleteJob() 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 + JobServiceStubSettings.Builder jobServiceSettingsBuilder = JobServiceStubSettings.newBuilder(); + jobServiceSettingsBuilder + .deleteJobSettings() + .setRetrySettings( + jobServiceSettingsBuilder + .deleteJobSettings() + .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()); + JobServiceStubSettings jobServiceSettings = jobServiceSettingsBuilder.build(); + } +} +// [END goldensample_generated_JobServiceStubSettings_DeleteJob_sync] diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/servicesettings/stub/SyncDeleteLog.golden b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/servicesettings/stub/SyncDeleteLog.golden index a72b00ae23..e52a0ed501 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/servicesettings/stub/SyncDeleteLog.golden +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/servicesettings/stub/SyncDeleteLog.golden @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2025 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -41,7 +41,14 @@ public class SyncDeleteLog { .deleteLogSettings() .getRetrySettings() .toBuilder() - .setTotalTimeout(Duration.ofSeconds(30)) + .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 loggingServiceV2Settings = loggingServiceV2SettingsBuilder.build(); } diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/servicesettings/stub/SyncEcho.golden b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/servicesettings/stub/SyncEcho.golden index 968fb98297..6ddb9df643 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/servicesettings/stub/SyncEcho.golden +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/servicesettings/stub/SyncEcho.golden @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2025 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -40,7 +40,14 @@ public class SyncEcho { .echoSettings() .getRetrySettings() .toBuilder() - .setTotalTimeout(Duration.ofSeconds(30)) + .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()); EchoStubSettings echoSettings = echoSettingsBuilder.build(); } diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/servicesettings/stub/SyncEchoShouldGenerateAsUsual.golden b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/servicesettings/stub/SyncEchoShouldGenerateAsUsual.golden new file mode 100644 index 0000000000..8daf4e32c6 --- /dev/null +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/servicesettings/stub/SyncEchoShouldGenerateAsUsual.golden @@ -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.selective.generate.v1beta1.stub.samples; + +// [START goldensample_generated_EchoServiceShouldGeneratePartialUsualStubSettings_EchoShouldGenerateAsUsual_sync] +import com.google.selective.generate.v1beta1.stub.EchoServiceShouldGeneratePartialUsualStubSettings; +import java.time.Duration; + +public class SyncEchoShouldGenerateAsUsual { + + public static void main(String[] args) throws Exception { + syncEchoShouldGenerateAsUsual(); + } + + public static void syncEchoShouldGenerateAsUsual() 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 + EchoServiceShouldGeneratePartialUsualStubSettings.Builder + echoServiceShouldGeneratePartialUsualSettingsBuilder = + EchoServiceShouldGeneratePartialUsualStubSettings.newBuilder(); + echoServiceShouldGeneratePartialUsualSettingsBuilder + .echoShouldGenerateAsUsualSettings() + .setRetrySettings( + echoServiceShouldGeneratePartialUsualSettingsBuilder + .echoShouldGenerateAsUsualSettings() + .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()); + EchoServiceShouldGeneratePartialUsualStubSettings + echoServiceShouldGeneratePartialUsualSettings = + echoServiceShouldGeneratePartialUsualSettingsBuilder.build(); + } +} +// [END goldensample_generated_EchoServiceShouldGeneratePartialUsualStubSettings_EchoShouldGenerateAsUsual_sync] diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/servicesettings/stub/SyncEchoWithVersionMethod.golden b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/servicesettings/stub/SyncEchoWithVersionMethod.golden new file mode 100644 index 0000000000..30718ddfae --- /dev/null +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/servicesettings/stub/SyncEchoWithVersionMethod.golden @@ -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.api.version.test.stub.samples; + +// [START goldensample_generated_EchoWithVersionStubSettings_EchoWithVersionMethod_sync] +import com.google.api.version.test.stub.EchoWithVersionStubSettings; +import java.time.Duration; + +public class SyncEchoWithVersionMethod { + + public static void main(String[] args) throws Exception { + syncEchoWithVersionMethod(); + } + + public static void syncEchoWithVersionMethod() 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 + EchoWithVersionStubSettings.Builder echoWithVersionSettingsBuilder = + EchoWithVersionStubSettings.newBuilder(); + echoWithVersionSettingsBuilder + .echoWithVersionMethodSettings() + .setRetrySettings( + echoWithVersionSettingsBuilder + .echoWithVersionMethodSettings() + .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()); + EchoWithVersionStubSettings echoWithVersionSettings = echoWithVersionSettingsBuilder.build(); + } +} +// [END goldensample_generated_EchoWithVersionStubSettings_EchoWithVersionMethod_sync] diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/servicesettings/stub/SyncFastFibonacci.golden b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/servicesettings/stub/SyncFastFibonacci.golden index 042d351178..6dac79d370 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/servicesettings/stub/SyncFastFibonacci.golden +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/servicesettings/stub/SyncFastFibonacci.golden @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2025 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -41,7 +41,14 @@ public class SyncFastFibonacci { .fastFibonacciSettings() .getRetrySettings() .toBuilder() - .setTotalTimeout(Duration.ofSeconds(30)) + .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()); DeprecatedServiceStubSettings deprecatedServiceSettings = deprecatedServiceSettingsBuilder.build(); diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/servicesettings/stub/SyncListJobs.golden b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/servicesettings/stub/SyncListJobs.golden new file mode 100644 index 0000000000..ba4be080cd --- /dev/null +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/servicesettings/stub/SyncListJobs.golden @@ -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.bigquery.v2.stub.samples; + +// [START goldensample_generated_JobServiceStubSettings_ListJobs_sync] +import com.google.cloud.bigquery.v2.stub.JobServiceStubSettings; +import java.time.Duration; + +public class SyncListJobs { + + public static void main(String[] args) throws Exception { + syncListJobs(); + } + + public static void syncListJobs() 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 + JobServiceStubSettings.Builder jobServiceSettingsBuilder = JobServiceStubSettings.newBuilder(); + jobServiceSettingsBuilder + .listJobsSettings() + .setRetrySettings( + jobServiceSettingsBuilder + .listJobsSettings() + .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()); + JobServiceStubSettings jobServiceSettings = jobServiceSettingsBuilder.build(); + } +} +// [END goldensample_generated_JobServiceStubSettings_ListJobs_sync] diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/servicesettings/stub/SyncWait.golden b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/servicesettings/stub/SyncWait.golden new file mode 100644 index 0000000000..0d3abce70e --- /dev/null +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/servicesettings/stub/SyncWait.golden @@ -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.showcase.v1beta1.stub.samples; + +// [START goldensample_generated_EchoStubSettings_Wait_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.showcase.v1beta1.stub.EchoStubSettings; +import java.time.Duration; + +public class SyncWait { + + public static void main(String[] args) throws Exception { + syncWait(); + } + + public static void syncWait() 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 + EchoStubSettings.Builder echoSettingsBuilder = EchoStubSettings.newBuilder(); + TimedRetryAlgorithm timedRetryAlgorithm = + OperationalTimedPollAlgorithm.create( + RetrySettings.newBuilder() + .setInitialRetryDelayDuration(Duration.ofMillis(500)) + .setRetryDelayMultiplier(1.5) + .setMaxRetryDelayDuration(Duration.ofMillis(5000)) + .setTotalTimeoutDuration(Duration.ofHours(24)) + .build()); + echoSettingsBuilder + .createClusterOperationSettings() + .setPollingAlgorithm(timedRetryAlgorithm) + .build(); + } +} +// [END goldensample_generated_EchoStubSettings_Wait_sync] diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpcrest/GrpcRestTestProtoLoader.java b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpcrest/GrpcRestTestProtoLoader.java deleted file mode 100644 index 05c0241327..0000000000 --- a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpcrest/GrpcRestTestProtoLoader.java +++ /dev/null @@ -1,85 +0,0 @@ -// 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. - -package com.google.api.generator.gapic.composer.grpcrest; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertTrue; - -import com.google.api.generator.gapic.composer.common.TestProtoLoader; -import com.google.api.generator.gapic.model.GapicContext; -import com.google.api.generator.gapic.model.GapicServiceConfig; -import com.google.api.generator.gapic.model.Message; -import com.google.api.generator.gapic.model.ResourceName; -import com.google.api.generator.gapic.model.Service; -import com.google.api.generator.gapic.model.Transport; -import com.google.api.generator.gapic.protoparser.Parser; -import com.google.api.generator.gapic.protoparser.ServiceConfigParser; -import com.google.longrunning.OperationsProto; -import com.google.protobuf.Descriptors.FileDescriptor; -import com.google.protobuf.Descriptors.ServiceDescriptor; -import com.google.protobuf.StructProto; -import com.google.showcase.grpcrest.v1beta1.EchoGrpcrest; -import java.nio.file.Path; -import java.nio.file.Paths; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Optional; -import java.util.Set; - -public class GrpcRestTestProtoLoader extends TestProtoLoader { - private static final GrpcRestTestProtoLoader INSTANCE = new GrpcRestTestProtoLoader(); - - protected GrpcRestTestProtoLoader() { - super(Transport.GRPC_REST, "src/test/resources/"); - } - - public static GrpcRestTestProtoLoader instance() { - return INSTANCE; - } - - @Override - public GapicContext parseShowcaseEcho() { - FileDescriptor echoFileDescriptor = EchoGrpcrest.getDescriptor(); - - ServiceDescriptor echoServiceDescriptor = echoFileDescriptor.getServices().get(0); - assertEquals("Echo", echoServiceDescriptor.getName()); - - Map messageTypes = Parser.parseMessages(echoFileDescriptor); - messageTypes.putAll(Parser.parseMessages(OperationsProto.getDescriptor())); - messageTypes.putAll(Parser.parseMessages(StructProto.getDescriptor())); - - Map resourceNames = Parser.parseResourceNames(echoFileDescriptor); - Set outputResourceNames = new HashSet<>(); - List services = - Parser.parseService( - echoFileDescriptor, messageTypes, resourceNames, Optional.empty(), outputResourceNames); - - String jsonFilename = "showcase_grpc_service_config.json"; - Path jsonPath = Paths.get(getTestFilesDirectory(), jsonFilename); - Optional configOpt = ServiceConfigParser.parse(jsonPath.toString()); - assertTrue(configOpt.isPresent()); - GapicServiceConfig config = configOpt.get(); - - return GapicContext.builder() - .setMessages(messageTypes) - .setResourceNames(resourceNames) - .setServices(services) - .setServiceConfig(config) - .setHelperResourceNames(outputResourceNames) - .setTransport(getTransport()) - .build(); - } -} diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpcrest/GrpcServiceCallableFactoryClassComposerTest.java b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpcrest/GrpcServiceCallableFactoryClassComposerTest.java index dc6adc72fe..376c7fd32c 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpcrest/GrpcServiceCallableFactoryClassComposerTest.java +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpcrest/GrpcServiceCallableFactoryClassComposerTest.java @@ -20,14 +20,15 @@ import com.google.api.generator.gapic.model.GapicContext; import com.google.api.generator.gapic.model.Service; import com.google.api.generator.test.framework.Assert; -import com.google.api.generator.test.framework.Utils; +import com.google.api.generator.test.framework.GoldenFileWriter; +import com.google.api.generator.test.protoloader.GrpcRestTestProtoLoader; import java.nio.file.Path; import java.nio.file.Paths; -import org.junit.Test; +import org.junit.jupiter.api.Test; -public class GrpcServiceCallableFactoryClassComposerTest { +class GrpcServiceCallableFactoryClassComposerTest { @Test - public void generateServiceClasses() { + void generateServiceClasses() { GapicContext context = GrpcRestTestProtoLoader.instance().parseShowcaseEcho(); Service echoProtoService = context.services().get(0); GapicClass clazz = @@ -35,9 +36,27 @@ public void generateServiceClasses() { JavaWriterVisitor visitor = new JavaWriterVisitor(); clazz.classDefinition().accept(visitor); - Utils.saveCodegenToFile(this.getClass(), "GrpcEchoCallableFactory.golden", visitor.write()); + GoldenFileWriter.saveCodegenToFile( + this.getClass(), "GrpcEchoCallableFactory.golden", visitor.write()); Path goldenFilePath = - Paths.get(Utils.getGoldenDir(this.getClass()), "GrpcEchoCallableFactory.golden"); + Paths.get(GoldenFileWriter.getGoldenDir(this.getClass()), "GrpcEchoCallableFactory.golden"); + Assert.assertCodeEquals(goldenFilePath, visitor.write()); + } + + @Test + void generateServiceClassesWicked() { + GapicContext context = GrpcRestTestProtoLoader.instance().parseShowcaseWicked(); + Service wickedProtoService = context.services().get(0); + GapicClass clazz = + GrpcServiceCallableFactoryClassComposer.instance().generate(context, wickedProtoService); + + JavaWriterVisitor visitor = new JavaWriterVisitor(); + clazz.classDefinition().accept(visitor); + GoldenFileWriter.saveCodegenToFile( + this.getClass(), "GrpcWickedCallableFactory.golden", visitor.write()); + Path goldenFilePath = + Paths.get( + GoldenFileWriter.getGoldenDir(this.getClass()), "GrpcWickedCallableFactory.golden"); Assert.assertCodeEquals(goldenFilePath, visitor.write()); } } diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpcrest/GrpcServiceStubClassComposerTest.java b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpcrest/GrpcServiceStubClassComposerTest.java index f9385b56b1..62067343a7 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpcrest/GrpcServiceStubClassComposerTest.java +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpcrest/GrpcServiceStubClassComposerTest.java @@ -20,22 +20,39 @@ import com.google.api.generator.gapic.model.GapicContext; import com.google.api.generator.gapic.model.Service; import com.google.api.generator.test.framework.Assert; -import com.google.api.generator.test.framework.Utils; +import com.google.api.generator.test.framework.GoldenFileWriter; +import com.google.api.generator.test.protoloader.GrpcRestTestProtoLoader; import java.nio.file.Path; import java.nio.file.Paths; -import org.junit.Test; +import org.junit.jupiter.api.Test; -public class GrpcServiceStubClassComposerTest { +class GrpcServiceStubClassComposerTest { @Test - public void generateServiceClasses() { + void generateServiceClasses() { GapicContext context = GrpcRestTestProtoLoader.instance().parseShowcaseEcho(); Service echoProtoService = context.services().get(0); GapicClass clazz = GrpcServiceStubClassComposer.instance().generate(context, echoProtoService); JavaWriterVisitor visitor = new JavaWriterVisitor(); clazz.classDefinition().accept(visitor); - Utils.saveCodegenToFile(this.getClass(), "GrpcEchoStub.golden", visitor.write()); - Path goldenFilePath = Paths.get(Utils.getGoldenDir(this.getClass()), "GrpcEchoStub.golden"); + GoldenFileWriter.saveCodegenToFile(this.getClass(), "GrpcEchoStub.golden", visitor.write()); + Path goldenFilePath = + Paths.get(GoldenFileWriter.getGoldenDir(this.getClass()), "GrpcEchoStub.golden"); + Assert.assertCodeEquals(goldenFilePath, visitor.write()); + } + + @Test + void generateServiceClassesWicked() { + GapicContext context = GrpcRestTestProtoLoader.instance().parseShowcaseWicked(); + Service wickedProtoService = context.services().get(0); + GapicClass clazz = + GrpcServiceStubClassComposer.instance().generate(context, wickedProtoService); + + JavaWriterVisitor visitor = new JavaWriterVisitor(); + clazz.classDefinition().accept(visitor); + GoldenFileWriter.saveCodegenToFile(this.getClass(), "GrpcWickedStub.golden", visitor.write()); + Path goldenFilePath = + Paths.get(GoldenFileWriter.getGoldenDir(this.getClass()), "GrpcWickedStub.golden"); Assert.assertCodeEquals(goldenFilePath, visitor.write()); } } diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpcrest/HttpJsonServiceCallableFactoryClassComposerTest.java b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpcrest/HttpJsonServiceCallableFactoryClassComposerTest.java index 249013974f..a5ded2aaaa 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpcrest/HttpJsonServiceCallableFactoryClassComposerTest.java +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpcrest/HttpJsonServiceCallableFactoryClassComposerTest.java @@ -14,20 +14,23 @@ package com.google.api.generator.gapic.composer.grpcrest; +import static com.google.common.truth.Truth.assertThat; + import com.google.api.generator.engine.writer.JavaWriterVisitor; import com.google.api.generator.gapic.composer.rest.HttpJsonServiceCallableFactoryClassComposer; import com.google.api.generator.gapic.model.GapicClass; import com.google.api.generator.gapic.model.GapicContext; import com.google.api.generator.gapic.model.Service; import com.google.api.generator.test.framework.Assert; -import com.google.api.generator.test.framework.Utils; +import com.google.api.generator.test.framework.GoldenFileWriter; +import com.google.api.generator.test.protoloader.GrpcRestTestProtoLoader; import java.nio.file.Path; import java.nio.file.Paths; -import org.junit.Test; +import org.junit.jupiter.api.Test; -public class HttpJsonServiceCallableFactoryClassComposerTest { +class HttpJsonServiceCallableFactoryClassComposerTest { @Test - public void generateServiceClasses() { + void generateServiceClasses() { GapicContext context = GrpcRestTestProtoLoader.instance().parseShowcaseEcho(); Service echoProtoService = context.services().get(0); GapicClass clazz = @@ -35,9 +38,21 @@ public void generateServiceClasses() { JavaWriterVisitor visitor = new JavaWriterVisitor(); clazz.classDefinition().accept(visitor); - Utils.saveCodegenToFile(this.getClass(), "HttpJsonEchoCallableFactory.golden", visitor.write()); + GoldenFileWriter.saveCodegenToFile( + this.getClass(), "HttpJsonEchoCallableFactory.golden", visitor.write()); Path goldenFilePath = - Paths.get(Utils.getGoldenDir(this.getClass()), "HttpJsonEchoCallableFactory.golden"); + Paths.get( + GoldenFileWriter.getGoldenDir(this.getClass()), "HttpJsonEchoCallableFactory.golden"); Assert.assertCodeEquals(goldenFilePath, visitor.write()); } + + @Test + void generateServiceClassesWicked() { + GapicContext context = GrpcRestTestProtoLoader.instance().parseShowcaseWicked(); + Service wickedProtoService = context.services().get(0); + GapicClass clazz = + HttpJsonServiceCallableFactoryClassComposer.instance() + .generate(context, wickedProtoService); + assertThat(clazz.kind()).isEqualTo(GapicClass.Kind.NON_GENERATED); + } } diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpcrest/HttpJsonServiceClientTestClassComposerTest.java b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpcrest/HttpJsonServiceClientTestClassComposerTest.java index 23d0a9adb3..ec8334924f 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpcrest/HttpJsonServiceClientTestClassComposerTest.java +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpcrest/HttpJsonServiceClientTestClassComposerTest.java @@ -15,19 +15,22 @@ package com.google.api.generator.gapic.composer.grpcrest; import static com.google.api.generator.test.framework.Assert.assertCodeEquals; +import static com.google.common.truth.Truth.assertThat; import com.google.api.generator.engine.writer.JavaWriterVisitor; import com.google.api.generator.gapic.model.GapicClass; import com.google.api.generator.gapic.model.GapicContext; import com.google.api.generator.gapic.model.Service; -import com.google.api.generator.test.framework.Utils; +import com.google.api.generator.test.framework.GoldenFileWriter; +import com.google.api.generator.test.protoloader.GrpcRestTestProtoLoader; import java.nio.file.Path; import java.nio.file.Paths; -import org.junit.Test; +import org.junit.jupiter.api.Test; + +class HttpJsonServiceClientTestClassComposerTest { -public class HttpJsonServiceClientTestClassComposerTest { @Test - public void generateServiceClasses() { + void generateServiceClasses() { GapicContext context = GrpcRestTestProtoLoader.instance().parseShowcaseEcho(); Service echoProtoService = context.services().get(0); GapicClass clazz = @@ -35,9 +38,19 @@ public void generateServiceClasses() { JavaWriterVisitor visitor = new JavaWriterVisitor(); clazz.classDefinition().accept(visitor); - Utils.saveCodegenToFile(this.getClass(), "EchoClientHttpJsonTest.golden", visitor.write()); + GoldenFileWriter.saveCodegenToFile( + this.getClass(), "EchoClientHttpJsonTest.golden", visitor.write()); Path goldenFilePath = - Paths.get(Utils.getGoldenDir(this.getClass()), "EchoClientHttpJsonTest.golden"); + Paths.get(GoldenFileWriter.getGoldenDir(this.getClass()), "EchoClientHttpJsonTest.golden"); assertCodeEquals(goldenFilePath, visitor.write()); } + + @Test + void generateServiceClassesWicked() { + GapicContext context = GrpcRestTestProtoLoader.instance().parseShowcaseWicked(); + Service wickedProtoService = context.services().get(0); + GapicClass clazz = + HttpJsonServiceClientTestClassComposer.instance().generate(context, wickedProtoService); + assertThat(clazz.kind()).isEqualTo(GapicClass.Kind.NON_GENERATED); + } } diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpcrest/HttpJsonServiceStubClassComposerTest.java b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpcrest/HttpJsonServiceStubClassComposerTest.java index 87f21c8872..8ed541475a 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpcrest/HttpJsonServiceStubClassComposerTest.java +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpcrest/HttpJsonServiceStubClassComposerTest.java @@ -14,19 +14,22 @@ package com.google.api.generator.gapic.composer.grpcrest; +import static com.google.common.truth.Truth.assertThat; + import com.google.api.generator.engine.writer.JavaWriterVisitor; import com.google.api.generator.gapic.model.GapicClass; import com.google.api.generator.gapic.model.GapicContext; import com.google.api.generator.gapic.model.Service; import com.google.api.generator.test.framework.Assert; -import com.google.api.generator.test.framework.Utils; +import com.google.api.generator.test.framework.GoldenFileWriter; +import com.google.api.generator.test.protoloader.GrpcRestTestProtoLoader; import java.nio.file.Path; import java.nio.file.Paths; -import org.junit.Test; +import org.junit.jupiter.api.Test; -public class HttpJsonServiceStubClassComposerTest { +class HttpJsonServiceStubClassComposerTest { @Test - public void generateServiceClasses() { + void generateServiceClasses() { GapicContext context = GrpcRestTestProtoLoader.instance().parseShowcaseEcho(); Service echoProtoService = context.services().get(0); GapicClass clazz = @@ -34,8 +37,18 @@ public void generateServiceClasses() { JavaWriterVisitor visitor = new JavaWriterVisitor(); clazz.classDefinition().accept(visitor); - Utils.saveCodegenToFile(this.getClass(), "HttpJsonEchoStub.golden", visitor.write()); - Path goldenFilePath = Paths.get(Utils.getGoldenDir(this.getClass()), "HttpJsonEchoStub.golden"); + GoldenFileWriter.saveCodegenToFile(this.getClass(), "HttpJsonEchoStub.golden", visitor.write()); + Path goldenFilePath = + Paths.get(GoldenFileWriter.getGoldenDir(this.getClass()), "HttpJsonEchoStub.golden"); Assert.assertCodeEquals(goldenFilePath, visitor.write()); } + + @Test + void generateServiceClassesWicked() { + GapicContext context = GrpcRestTestProtoLoader.instance().parseShowcaseWicked(); + Service wickedProtoService = context.services().get(0); + GapicClass clazz = + HttpJsonServiceStubClassComposer.instance().generate(context, wickedProtoService); + assertThat(clazz.kind()).isEqualTo(GapicClass.Kind.NON_GENERATED); + } } diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpcrest/ServiceClientClassComposerTest.java b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpcrest/ServiceClientClassComposerTest.java index 0be072badd..a6d057fe8d 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpcrest/ServiceClientClassComposerTest.java +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpcrest/ServiceClientClassComposerTest.java @@ -19,35 +19,38 @@ import com.google.api.generator.gapic.model.GapicContext; import com.google.api.generator.gapic.model.Service; import com.google.api.generator.test.framework.Assert; -import com.google.api.generator.test.framework.Utils; +import com.google.api.generator.test.framework.GoldenFileWriter; +import com.google.api.generator.test.protoloader.GrpcRestTestProtoLoader; import java.nio.file.Path; import java.nio.file.Paths; -import org.junit.Test; +import org.junit.jupiter.api.Test; -public class ServiceClientClassComposerTest { +class ServiceClientClassComposerTest { @Test - public void generateServiceClasses() { + void generateServiceClasses() { GapicContext context = GrpcRestTestProtoLoader.instance().parseShowcaseEcho(); Service echoProtoService = context.services().get(0); GapicClass clazz = ServiceClientClassComposer.instance().generate(context, echoProtoService); JavaWriterVisitor visitor = new JavaWriterVisitor(); clazz.classDefinition().accept(visitor); - Utils.saveCodegenToFile(this.getClass(), "EchoClient.golden", visitor.write()); - Path goldenFilePath = Paths.get(Utils.getGoldenDir(this.getClass()), "EchoClient.golden"); + GoldenFileWriter.saveCodegenToFile(this.getClass(), "EchoClient.golden", visitor.write()); + Path goldenFilePath = + Paths.get(GoldenFileWriter.getGoldenDir(this.getClass()), "EchoClient.golden"); Assert.assertCodeEquals(goldenFilePath, visitor.write()); } @Test - public void generateServiceClassesEmpty() { - GapicContext context = GrpcRestTestProtoLoader.instance().parseShowcaseEcho(); - Service echoProtoService = context.services().get(1); - GapicClass clazz = ServiceClientClassComposer.instance().generate(context, echoProtoService); + void generateServiceClassesWicked() { + GapicContext context = GrpcRestTestProtoLoader.instance().parseShowcaseWicked(); + Service wickedProtoService = context.services().get(0); + GapicClass clazz = ServiceClientClassComposer.instance().generate(context, wickedProtoService); JavaWriterVisitor visitor = new JavaWriterVisitor(); clazz.classDefinition().accept(visitor); - Utils.saveCodegenToFile(this.getClass(), "EchoEmpty.golden", visitor.write()); - Path goldenFilePath = Paths.get(Utils.getGoldenDir(this.getClass()), "EchoEmpty.golden"); + GoldenFileWriter.saveCodegenToFile(this.getClass(), "WickedClient.golden", visitor.write()); + Path goldenFilePath = + Paths.get(GoldenFileWriter.getGoldenDir(this.getClass()), "WickedClient.golden"); Assert.assertCodeEquals(goldenFilePath, visitor.write()); } } diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpcrest/ServiceClientTestClassComposerTest.java b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpcrest/ServiceClientTestClassComposerTest.java index d7d4053f07..b7164ce590 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpcrest/ServiceClientTestClassComposerTest.java +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpcrest/ServiceClientTestClassComposerTest.java @@ -21,14 +21,16 @@ import com.google.api.generator.gapic.model.GapicClass; import com.google.api.generator.gapic.model.GapicContext; import com.google.api.generator.gapic.model.Service; -import com.google.api.generator.test.framework.Utils; +import com.google.api.generator.test.framework.Assert; +import com.google.api.generator.test.framework.GoldenFileWriter; +import com.google.api.generator.test.protoloader.GrpcRestTestProtoLoader; import java.nio.file.Path; import java.nio.file.Paths; -import org.junit.Test; +import org.junit.jupiter.api.Test; -public class ServiceClientTestClassComposerTest { +class ServiceClientTestClassComposerTest { @Test - public void generateServiceClasses() { + void generateServiceClasses() { GapicContext context = GrpcRestTestProtoLoader.instance().parseShowcaseEcho(); Service echoProtoService = context.services().get(0); GapicClass clazz = @@ -36,8 +38,24 @@ public void generateServiceClasses() { JavaWriterVisitor visitor = new JavaWriterVisitor(); clazz.classDefinition().accept(visitor); - Utils.saveCodegenToFile(this.getClass(), "EchoClientTest.golden", visitor.write()); - Path goldenFilePath = Paths.get(Utils.getGoldenDir(this.getClass()), "EchoClientTest.golden"); + GoldenFileWriter.saveCodegenToFile(this.getClass(), "EchoClientTest.golden", visitor.write()); + Path goldenFilePath = + Paths.get(GoldenFileWriter.getGoldenDir(this.getClass()), "EchoClientTest.golden"); assertCodeEquals(goldenFilePath, visitor.write()); } + + @Test + void generateServiceClassesWicked() { + GapicContext context = GrpcRestTestProtoLoader.instance().parseShowcaseWicked(); + Service wickedProtoService = context.services().get(0); + GapicClass clazz = + ServiceClientTestClassComposer.instance().generate(context, wickedProtoService); + + JavaWriterVisitor visitor = new JavaWriterVisitor(); + clazz.classDefinition().accept(visitor); + GoldenFileWriter.saveCodegenToFile(this.getClass(), "WickedClientTest.golden", visitor.write()); + Path goldenFilePath = + Paths.get(GoldenFileWriter.getGoldenDir(this.getClass()), "WickedClientTest.golden"); + Assert.assertCodeEquals(goldenFilePath, visitor.write()); + } } diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpcrest/ServiceSettingsClassComposerTest.java b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpcrest/ServiceSettingsClassComposerTest.java index 8ccca9269b..5ee96c0cfe 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpcrest/ServiceSettingsClassComposerTest.java +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpcrest/ServiceSettingsClassComposerTest.java @@ -19,22 +19,39 @@ import com.google.api.generator.gapic.model.GapicContext; import com.google.api.generator.gapic.model.Service; import com.google.api.generator.test.framework.Assert; -import com.google.api.generator.test.framework.Utils; +import com.google.api.generator.test.framework.GoldenFileWriter; +import com.google.api.generator.test.protoloader.GrpcRestTestProtoLoader; import java.nio.file.Path; import java.nio.file.Paths; -import org.junit.Test; +import org.junit.jupiter.api.Test; -public class ServiceSettingsClassComposerTest { +class ServiceSettingsClassComposerTest { @Test - public void generateServiceClasses() { + void generateServiceClasses() { GapicContext context = GrpcRestTestProtoLoader.instance().parseShowcaseEcho(); Service echoProtoService = context.services().get(0); GapicClass clazz = ServiceSettingsClassComposer.instance().generate(context, echoProtoService); JavaWriterVisitor visitor = new JavaWriterVisitor(); clazz.classDefinition().accept(visitor); - Utils.saveCodegenToFile(this.getClass(), "EchoSettings.golden", visitor.write()); - Path goldenFilePath = Paths.get(Utils.getGoldenDir(this.getClass()), "EchoSettings.golden"); + GoldenFileWriter.saveCodegenToFile(this.getClass(), "EchoSettings.golden", visitor.write()); + Path goldenFilePath = + Paths.get(GoldenFileWriter.getGoldenDir(this.getClass()), "EchoSettings.golden"); + Assert.assertCodeEquals(goldenFilePath, visitor.write()); + } + + @Test + void generateServiceClassesWicked() { + GapicContext context = GrpcRestTestProtoLoader.instance().parseShowcaseWicked(); + Service wickedProtoService = context.services().get(0); + GapicClass clazz = + ServiceSettingsClassComposer.instance().generate(context, wickedProtoService); + + JavaWriterVisitor visitor = new JavaWriterVisitor(); + clazz.classDefinition().accept(visitor); + GoldenFileWriter.saveCodegenToFile(this.getClass(), "WickedSettings.golden", visitor.write()); + Path goldenFilePath = + Paths.get(GoldenFileWriter.getGoldenDir(this.getClass()), "WickedSettings.golden"); Assert.assertCodeEquals(goldenFilePath, visitor.write()); } } diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpcrest/ServiceStubSettingsClassComposerTest.java b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpcrest/ServiceStubSettingsClassComposerTest.java index 812df41ff8..160df81f1d 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpcrest/ServiceStubSettingsClassComposerTest.java +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpcrest/ServiceStubSettingsClassComposerTest.java @@ -19,23 +19,35 @@ import com.google.api.generator.gapic.model.GapicContext; import com.google.api.generator.gapic.model.Service; import com.google.api.generator.test.framework.Assert; -import com.google.api.generator.test.framework.Utils; +import com.google.api.generator.test.framework.GoldenFileWriter; +import com.google.api.generator.test.protoloader.GrpcRestTestProtoLoader; import java.nio.file.Path; import java.nio.file.Paths; -import org.junit.Test; +import java.util.stream.Stream; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.Arguments; +import org.junit.jupiter.params.provider.MethodSource; -public class ServiceStubSettingsClassComposerTest { - @Test - public void generateServiceClasses() { - GapicContext context = GrpcRestTestProtoLoader.instance().parseShowcaseEcho(); +class ServiceStubSettingsClassComposerTest { + static Stream data() { + return Stream.of( + Arguments.of( + "EchoStubSettings.golden", GrpcRestTestProtoLoader.instance().parseShowcaseEcho()), + Arguments.of( + "WickedStubSettings.golden", GrpcRestTestProtoLoader.instance().parseShowcaseWicked())); + } + + @ParameterizedTest + @MethodSource("data") + void generateServiceClasses(String goldenFileName, GapicContext context) { Service echoProtoService = context.services().get(0); GapicClass clazz = ServiceStubSettingsClassComposer.instance().generate(context, echoProtoService); JavaWriterVisitor visitor = new JavaWriterVisitor(); clazz.classDefinition().accept(visitor); - Utils.saveCodegenToFile(this.getClass(), "EchoStubSettings.golden", visitor.write()); - Path goldenFilePath = Paths.get(Utils.getGoldenDir(this.getClass()), "EchoStubSettings.golden"); + GoldenFileWriter.saveCodegenToFile(this.getClass(), goldenFileName, visitor.write()); + Path goldenFilePath = Paths.get(GoldenFileWriter.getGoldenDir(this.getClass()), goldenFileName); Assert.assertCodeEquals(goldenFilePath, visitor.write()); } } diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpcrest/goldens/EchoClient.golden b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpcrest/goldens/EchoClient.golden index 15d3a77a29..91e167d4e1 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpcrest/goldens/EchoClient.golden +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpcrest/goldens/EchoClient.golden @@ -18,6 +18,7 @@ import com.google.api.resourcenames.ResourceName; import com.google.common.util.concurrent.MoreExecutors; import com.google.longrunning.Operation; import com.google.protobuf.Duration; +import com.google.protobuf.FieldMask; import com.google.protobuf.Timestamp; import com.google.rpc.Status; import com.google.showcase.grpcrest.v1beta1.stub.EchoStub; @@ -29,8 +30,10 @@ import javax.annotation.Generated; // AUTO-GENERATED DOCUMENTATION AND CLASS. /** - * 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: + * This client uses Echo version foo_version_for_tests. + * + *

        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.
        @@ -46,19 +49,187 @@ import javax.annotation.Generated;
          * 

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

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

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

        Echo

        + *

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

        + *
          + *
        • echo(EchoRequest request) + *

        + *

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

        + *
          + *
        • echo() + *

        • echo(ResourceName parent) + *

        • echo(Status error) + *

        • echo(FoobarName name) + *

        • echo(String content) + *

        • echo(String name) + *

        • echo(String parent) + *

        • echo(String content, Severity severity) + *

        + *

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

        + *
          + *
        • echoCallable() + *

        + *

        Expand

        + *

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

        + *
          + *
        • expandCallable() + *

        + *

        PagedExpand

        + *

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

        + *
          + *
        • pagedExpand(PagedExpandRequest request) + *

        + *

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

        + *
          + *
        • pagedExpandPagedCallable() + *

        • pagedExpandCallable() + *

        + *

        SimplePagedExpand

        + *

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

        + *
          + *
        • simplePagedExpand(PagedExpandRequest request) + *

        + *

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

        + *
          + *
        • simplePagedExpand() + *

        + *

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

        + *
          + *
        • simplePagedExpandPagedCallable() + *

        • simplePagedExpandCallable() + *

        + *

        Wait

        + *

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

        + *
          + *
        • waitAsync(WaitRequest request) + *

        + *

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

        + *
          + *
        • waitAsync(Duration ttl) + *

        • waitAsync(Timestamp endTime) + *

        + *

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

        + *
          + *
        • waitOperationCallable() + *

        • waitCallable() + *

        + *

        Block

        + *

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

        + *
          + *
        • block(BlockRequest request) + *

        + *

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

        + *
          + *
        • blockCallable() + *

        + *

        CollideName

        + *

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

        + *
          + *
        • collideName(EchoRequest request) + *

        + *

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

        + *
          + *
        • collideNameCallable() + *

        + *

        NestedBinding

        + *

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

        + *
          + *
        • nestedBinding(EchoRequest request) + *

        + *

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

        + *
          + *
        • nestedBindingCallable() + *

        + *

        Chat

        + *

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

        + *
          + *
        • chatCallable() + *

        + *

        NoBinding

        + *

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

        + *
          + *
        • noBinding(EchoRequest request) + *

        + *

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

        + *
          + *
        • noBindingCallable() + *

        + *

        UpdateCase

        + *

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

        + *
          + *
        • updateCase(UpdateCaseRequest request) + *

        + *

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

        + *
          + *
        • updateCase(Case case_, 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.

        + *
          + *
        • updateCaseCallable() + *

        + *
        * *

        See the individual methods for example code. * @@ -1045,6 +1216,80 @@ public class EchoClient implements BackgroundResource { return stub.noBindingCallable(); } + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * 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 (EchoClient echoClient = EchoClient.create()) {
        +   *   Case case_ = Case.newBuilder().build();
        +   *   FieldMask updateMask = FieldMask.newBuilder().build();
        +   *   Case response = echoClient.updateCase(case_, updateMask);
        +   * }
        +   * }
        + * + * @param case_ + * @param updateMask + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Case updateCase(Case case_, FieldMask updateMask) { + UpdateCaseRequest request = + UpdateCaseRequest.newBuilder().setCase(case_).setUpdateMask(updateMask).build(); + return updateCase(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * 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 (EchoClient echoClient = EchoClient.create()) {
        +   *   UpdateCaseRequest request =
        +   *       UpdateCaseRequest.newBuilder().setCase(Case.newBuilder().build()).build();
        +   *   Case response = echoClient.updateCase(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 Case updateCase(UpdateCaseRequest request) { + return updateCaseCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * 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 (EchoClient echoClient = EchoClient.create()) {
        +   *   UpdateCaseRequest request =
        +   *       UpdateCaseRequest.newBuilder().setCase(Case.newBuilder().build()).build();
        +   *   ApiFuture future = echoClient.updateCaseCallable().futureCall(request);
        +   *   // Do something.
        +   *   Case response = future.get();
        +   * }
        +   * }
        + */ + public final UnaryCallable updateCaseCallable() { + return stub.updateCaseCallable(); + } + @Override public final void close() { stub.close(); diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpcrest/goldens/EchoClientHttpJsonTest.golden b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpcrest/goldens/EchoClientHttpJsonTest.golden index e3a030ccd9..a26bd912a8 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpcrest/goldens/EchoClientHttpJsonTest.golden +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpcrest/goldens/EchoClientHttpJsonTest.golden @@ -17,6 +17,7 @@ import com.google.common.collect.Lists; import com.google.longrunning.Operation; import com.google.protobuf.Any; import com.google.protobuf.Duration; +import com.google.protobuf.FieldMask; import com.google.protobuf.Timestamp; import com.google.protobuf.Value; import com.google.rpc.Status; @@ -826,4 +827,62 @@ public class EchoClientHttpJsonTest { // The noBinding() method is not supported in REST transport. // This empty test is generated for technical reasons. } + + @Test + public void updateCaseTest() throws Exception { + Case expectedResponse = + Case.newBuilder() + .setName("name3373707") + .setDisplayName("displayName1714148973") + .setDescription("description-1724546052") + .build(); + mockService.addResponse(expectedResponse); + + Case case_ = + Case.newBuilder() + .setName("projects/project-3807/cases/case-3807") + .setDisplayName("displayName1714148973") + .setDescription("description-1724546052") + .build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + + Case actualResponse = client.updateCase(case_, updateMask); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void updateCaseExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + Case case_ = + Case.newBuilder() + .setName("projects/project-3807/cases/case-3807") + .setDisplayName("displayName1714148973") + .setDescription("description-1724546052") + .build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + client.updateCase(case_, updateMask); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } } diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpcrest/goldens/EchoClientTest.golden b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpcrest/goldens/EchoClientTest.golden index aed3486918..1d87f4584f 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpcrest/goldens/EchoClientTest.golden +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpcrest/goldens/EchoClientTest.golden @@ -21,6 +21,7 @@ import com.google.longrunning.Operation; import com.google.protobuf.AbstractMessage; import com.google.protobuf.Any; import com.google.protobuf.Duration; +import com.google.protobuf.FieldMask; import com.google.protobuf.Timestamp; import com.google.protobuf.Value; import com.google.rpc.Status; @@ -900,4 +901,47 @@ public class EchoClientTest { // Expected exception. } } + + @Test + public void updateCaseTest() throws Exception { + Case expectedResponse = + Case.newBuilder() + .setName("name3373707") + .setDisplayName("displayName1714148973") + .setDescription("description-1724546052") + .build(); + mockEcho.addResponse(expectedResponse); + + Case case_ = Case.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + + Case actualResponse = client.updateCase(case_, updateMask); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockEcho.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + UpdateCaseRequest actualRequest = ((UpdateCaseRequest) actualRequests.get(0)); + + Assert.assertEquals(case_, actualRequest.getCase()); + Assert.assertEquals(updateMask, actualRequest.getUpdateMask()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void updateCaseExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockEcho.addException(exception); + + try { + Case case_ = Case.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + client.updateCase(case_, updateMask); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } } diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpcrest/goldens/EchoEmpty.golden b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpcrest/goldens/EchoEmpty.golden deleted file mode 100644 index d9708af4ae..0000000000 --- a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpcrest/goldens/EchoEmpty.golden +++ /dev/null @@ -1,172 +0,0 @@ -package com.google.showcase.grpcrest.v1beta1; - -import com.google.api.core.BetaApi; -import com.google.api.gax.core.BackgroundResource; -import com.google.showcase.grpcrest.v1beta1.stub.EchoEmpyStub; -import com.google.showcase.grpcrest.v1beta1.stub.EchoEmpyStubSettings; -import java.io.IOException; -import java.util.concurrent.TimeUnit; -import javax.annotation.Generated; - -// AUTO-GENERATED DOCUMENTATION AND CLASS. -/** - * 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 (EchoEmpyClient echoEmpyClient = EchoEmpyClient.create()) {}
        - * }
        - * - *

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

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

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

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

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

        This class can be customized by passing in a custom instance of EchoEmpySettings 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
        - * EchoEmpySettings echoEmpySettings =
        - *     EchoEmpySettings.newBuilder()
        - *         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
        - *         .build();
        - * EchoEmpyClient echoEmpyClient = EchoEmpyClient.create(echoEmpySettings);
        - * }
        - * - *

        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
        - * EchoEmpySettings echoEmpySettings =
        - *     EchoEmpySettings.newBuilder().setEndpoint(myEndpoint).build();
        - * EchoEmpyClient echoEmpyClient = EchoEmpyClient.create(echoEmpySettings);
        - * }
        - * - *

        To use REST (HTTP1.1/JSON) transport (instead of gRPC) for sending and receiving requests over - * the wire: - * - *

        {@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
        - * EchoEmpySettings echoEmpySettings = EchoEmpySettings.newHttpJsonBuilder().build();
        - * EchoEmpyClient echoEmpyClient = EchoEmpyClient.create(echoEmpySettings);
        - * }
        - * - *

        Please refer to the GitHub repository's samples for more quickstart code snippets. - */ -@BetaApi -@Generated("by gapic-generator-java") -public class EchoEmpyClient implements BackgroundResource { - private final EchoEmpySettings settings; - private final EchoEmpyStub stub; - - /** Constructs an instance of EchoEmpyClient with default settings. */ - public static final EchoEmpyClient create() throws IOException { - return create(EchoEmpySettings.newBuilder().build()); - } - - /** - * Constructs an instance of EchoEmpyClient, 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 EchoEmpyClient create(EchoEmpySettings settings) throws IOException { - return new EchoEmpyClient(settings); - } - - /** - * Constructs an instance of EchoEmpyClient, using the given stub for making calls. This is for - * advanced usage - prefer using create(EchoEmpySettings). - */ - public static final EchoEmpyClient create(EchoEmpyStub stub) { - return new EchoEmpyClient(stub); - } - - /** - * Constructs an instance of EchoEmpyClient, 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 EchoEmpyClient(EchoEmpySettings settings) throws IOException { - this.settings = settings; - this.stub = ((EchoEmpyStubSettings) settings.getStubSettings()).createStub(); - } - - protected EchoEmpyClient(EchoEmpyStub stub) { - this.settings = null; - this.stub = stub; - } - - public final EchoEmpySettings getSettings() { - return settings; - } - - public EchoEmpyStub getStub() { - return stub; - } - - @Override - public final void close() { - stub.close(); - } - - @Override - public void shutdown() { - stub.shutdown(); - } - - @Override - public boolean isShutdown() { - return stub.isShutdown(); - } - - @Override - public boolean isTerminated() { - return stub.isTerminated(); - } - - @Override - public void shutdownNow() { - stub.shutdownNow(); - } - - @Override - public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { - return stub.awaitTermination(duration, unit); - } -} diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpcrest/goldens/EchoSettings.golden b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpcrest/goldens/EchoSettings.golden index 9c51589512..2249b438e5 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpcrest/goldens/EchoSettings.golden +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpcrest/goldens/EchoSettings.golden @@ -40,7 +40,9 @@ import javax.annotation.Generated; *

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

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

        For example, to set the + * [RetrySettings](https://cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.retrying.RetrySettings) + * of echo: * *

        {@code
          * // This snippet has been automatically generated and should be regarded as a code template only.
        @@ -56,10 +58,46 @@ import javax.annotation.Generated;
          *             .echoSettings()
          *             .getRetrySettings()
          *             .toBuilder()
        - *             .setTotalTimeout(Duration.ofSeconds(30))
        + *             .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());
          * EchoSettings echoSettings = echoSettingsBuilder.build();
          * }
        + * + * Please refer to the [Client Side Retry + * Guide](https://docs.cloud.google.com/java/docs/client-retries) 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 wait: + * + *

        {@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
        + * EchoSettings.Builder echoSettingsBuilder = EchoSettings.newBuilder();
        + * TimedRetryAlgorithm timedRetryAlgorithm =
        + *     OperationalTimedPollAlgorithm.create(
        + *         RetrySettings.newBuilder()
        + *             .setInitialRetryDelayDuration(Duration.ofMillis(500))
        + *             .setRetryDelayMultiplier(1.5)
        + *             .setMaxRetryDelayDuration(Duration.ofMillis(5000))
        + *             .setTotalTimeoutDuration(Duration.ofHours(24))
        + *             .build());
        + * echoSettingsBuilder
        + *     .createClusterOperationSettings()
        + *     .setPollingAlgorithm(timedRetryAlgorithm)
        + *     .build();
        + * }
        */ @BetaApi @Generated("by gapic-generator-java") @@ -122,6 +160,11 @@ public class EchoSettings extends ClientSettings { return ((EchoStubSettings) getStubSettings()).noBindingSettings(); } + /** Returns the object with the settings used for calls to updateCase. */ + public UnaryCallSettings updateCaseSettings() { + return ((EchoStubSettings) getStubSettings()).updateCaseSettings(); + } + public static final EchoSettings create(EchoStubSettings stub) throws IOException { return new EchoSettings.Builder(stub.toBuilder()).build(); } @@ -162,7 +205,6 @@ public class EchoSettings extends ClientSettings { return EchoStubSettings.defaultTransportChannelProvider(); } - @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { return EchoStubSettings.defaultApiClientHeaderProviderBuilder(); } @@ -173,7 +215,6 @@ public class EchoSettings extends ClientSettings { } /** Returns a new REST builder for this class. */ - @BetaApi public static Builder newHttpJsonBuilder() { return Builder.createHttpJsonDefault(); } @@ -215,7 +256,6 @@ public class EchoSettings extends ClientSettings { return new Builder(EchoStubSettings.newBuilder()); } - @BetaApi private static Builder createHttpJsonDefault() { return new Builder(EchoStubSettings.newHttpJsonBuilder()); } @@ -296,6 +336,11 @@ public class EchoSettings extends ClientSettings { return getStubSettingsBuilder().noBindingSettings(); } + /** Returns the builder for the settings used for calls to updateCase. */ + public UnaryCallSettings.Builder updateCaseSettings() { + return getStubSettingsBuilder().updateCaseSettings(); + } + @Override public EchoSettings build() throws IOException { return new EchoSettings(this); diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpcrest/goldens/EchoStubSettings.golden b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpcrest/goldens/EchoStubSettings.golden index bc6b181db1..86d7494823 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpcrest/goldens/EchoStubSettings.golden +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpcrest/goldens/EchoStubSettings.golden @@ -6,6 +6,7 @@ import static com.google.showcase.grpcrest.v1beta1.EchoClient.SimplePagedExpandP import com.google.api.core.ApiFunction; import com.google.api.core.ApiFuture; import com.google.api.core.BetaApi; +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; @@ -22,6 +23,7 @@ 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.LibraryMetadata; import com.google.api.gax.rpc.OperationCallSettings; import com.google.api.gax.rpc.PageContext; import com.google.api.gax.rpc.PagedCallSettings; @@ -41,19 +43,21 @@ import com.google.common.collect.Lists; import com.google.longrunning.Operation; import com.google.showcase.grpcrest.v1beta1.BlockRequest; import com.google.showcase.grpcrest.v1beta1.BlockResponse; +import com.google.showcase.grpcrest.v1beta1.Case; import com.google.showcase.grpcrest.v1beta1.EchoRequest; import com.google.showcase.grpcrest.v1beta1.EchoResponse; import com.google.showcase.grpcrest.v1beta1.ExpandRequest; import com.google.showcase.grpcrest.v1beta1.Object; import com.google.showcase.grpcrest.v1beta1.PagedExpandRequest; import com.google.showcase.grpcrest.v1beta1.PagedExpandResponse; +import com.google.showcase.grpcrest.v1beta1.UpdateCaseRequest; import com.google.showcase.grpcrest.v1beta1.WaitMetadata; import com.google.showcase.grpcrest.v1beta1.WaitRequest; import com.google.showcase.grpcrest.v1beta1.WaitResponse; import java.io.IOException; +import java.time.Duration; import java.util.List; import javax.annotation.Generated; -import org.threeten.bp.Duration; // AUTO-GENERATED DOCUMENTATION AND CLASS. /** @@ -70,7 +74,9 @@ import org.threeten.bp.Duration; *

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

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

        For example, to set the + * [RetrySettings](https://cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.retrying.RetrySettings) + * of echo: * *

        {@code
          * // This snippet has been automatically generated and should be regarded as a code template only.
        @@ -86,13 +92,50 @@ import org.threeten.bp.Duration;
          *             .echoSettings()
          *             .getRetrySettings()
          *             .toBuilder()
        - *             .setTotalTimeout(Duration.ofSeconds(30))
        + *             .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());
          * EchoStubSettings echoSettings = echoSettingsBuilder.build();
          * }
        + * + * Please refer to the [Client Side Retry + * Guide](https://docs.cloud.google.com/java/docs/client-retries) 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 wait: + * + *

        {@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
        + * EchoStubSettings.Builder echoSettingsBuilder = EchoStubSettings.newBuilder();
        + * TimedRetryAlgorithm timedRetryAlgorithm =
        + *     OperationalTimedPollAlgorithm.create(
        + *         RetrySettings.newBuilder()
        + *             .setInitialRetryDelayDuration(Duration.ofMillis(500))
        + *             .setRetryDelayMultiplier(1.5)
        + *             .setMaxRetryDelayDuration(Duration.ofMillis(5000))
        + *             .setTotalTimeoutDuration(Duration.ofHours(24))
        + *             .build());
        + * echoSettingsBuilder
        + *     .createClusterOperationSettings()
        + *     .setPollingAlgorithm(timedRetryAlgorithm)
        + *     .build();
        + * }
        */ @BetaApi @Generated("by gapic-generator-java") +@SuppressWarnings("CanonicalDuration") public class EchoStubSettings extends StubSettings { /** The default scopes of the service. */ private static final ImmutableList DEFAULT_SERVICE_SCOPES = @@ -113,6 +156,7 @@ public class EchoStubSettings extends StubSettings { private final UnaryCallSettings nestedBindingSettings; private final StreamingCallSettings chatSettings; private final UnaryCallSettings noBindingSettings; + private final UnaryCallSettings updateCaseSettings; private static final PagedListDescriptor PAGED_EXPAND_PAGE_STR_DESC = @@ -144,9 +188,7 @@ public class EchoStubSettings extends StubSettings { @Override public Iterable extractResources(PagedExpandResponse payload) { - return payload.getResponsesList() == null - ? ImmutableList.of() - : payload.getResponsesList(); + return payload.getResponsesList(); } }; @@ -180,9 +222,7 @@ public class EchoStubSettings extends StubSettings { @Override public Iterable extractResources(PagedExpandResponse payload) { - return payload.getResponsesList() == null - ? ImmutableList.of() - : payload.getResponsesList(); + return payload.getResponsesList(); } }; @@ -277,6 +317,11 @@ public class EchoStubSettings extends StubSettings { return noBindingSettings; } + /** Returns the object with the settings used for calls to updateCase. */ + public UnaryCallSettings updateCaseSettings() { + return updateCaseSettings; + } + public EchoStub createStub() throws IOException { if (getTransportChannelProvider() .getTransportName() @@ -299,6 +344,7 @@ public class EchoStubSettings extends StubSettings { } /** Returns the default service endpoint. */ + @ObsoleteApi("Use getEndpoint() instead") public static String getDefaultEndpoint() { return "localhost:7469"; } @@ -337,21 +383,20 @@ public class EchoStubSettings extends StubSettings { return defaultGrpcTransportProviderBuilder().build(); } - @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") public static ApiClientHeaderProvider.Builder defaultGrpcApiClientHeaderProviderBuilder() { return ApiClientHeaderProvider.newBuilder() .setGeneratedLibToken("gapic", GaxProperties.getLibraryVersion(EchoStubSettings.class)) - .setTransportToken( - GaxGrpcProperties.getGrpcTokenName(), GaxGrpcProperties.getGrpcVersion()); + .setTransportToken(GaxGrpcProperties.getGrpcTokenName(), GaxGrpcProperties.getGrpcVersion()) + .setApiVersionToken("foo_version_for_tests"); } - @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") public static ApiClientHeaderProvider.Builder defaultHttpJsonApiClientHeaderProviderBuilder() { return ApiClientHeaderProvider.newBuilder() .setGeneratedLibToken("gapic", GaxProperties.getLibraryVersion(EchoStubSettings.class)) .setTransportToken( GaxHttpJsonProperties.getHttpJsonTokenName(), - GaxHttpJsonProperties.getHttpJsonVersion()); + GaxHttpJsonProperties.getHttpJsonVersion()) + .setApiVersionToken("foo_version_for_tests"); } public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { @@ -392,6 +437,16 @@ public class EchoStubSettings extends StubSettings { nestedBindingSettings = settingsBuilder.nestedBindingSettings().build(); chatSettings = settingsBuilder.chatSettings().build(); noBindingSettings = settingsBuilder.noBindingSettings().build(); + updateCaseSettings = settingsBuilder.updateCaseSettings().build(); + } + + @Override + protected LibraryMetadata getLibraryMetadata() { + return LibraryMetadata.newBuilder() + .setArtifactName("com.google.cloud:gapic-showcase") + .setRepository("googleapis/sdk-platform-java") + .setVersion(Version.VERSION) + .build(); } /** Builder for EchoStubSettings. */ @@ -413,6 +468,7 @@ public class EchoStubSettings extends StubSettings { private final UnaryCallSettings.Builder nestedBindingSettings; private final StreamingCallSettings.Builder chatSettings; private final UnaryCallSettings.Builder noBindingSettings; + private final UnaryCallSettings.Builder updateCaseSettings; private static final ImmutableMap> RETRYABLE_CODE_DEFINITIONS; @@ -451,6 +507,7 @@ public class EchoStubSettings extends StubSettings { nestedBindingSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); chatSettings = StreamingCallSettings.newBuilder(); noBindingSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + updateCaseSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); unaryMethodSettingsBuilders = ImmutableList.>of( @@ -461,7 +518,8 @@ public class EchoStubSettings extends StubSettings { blockSettings, collideNameSettings, nestedBindingSettings, - noBindingSettings); + noBindingSettings, + updateCaseSettings); initDefaults(this); } @@ -479,6 +537,7 @@ public class EchoStubSettings extends StubSettings { nestedBindingSettings = settings.nestedBindingSettings.toBuilder(); chatSettings = settings.chatSettings.toBuilder(); noBindingSettings = settings.noBindingSettings.toBuilder(); + updateCaseSettings = settings.updateCaseSettings.toBuilder(); unaryMethodSettingsBuilders = ImmutableList.>of( @@ -489,7 +548,8 @@ public class EchoStubSettings extends StubSettings { blockSettings, collideNameSettings, nestedBindingSettings, - noBindingSettings); + noBindingSettings, + updateCaseSettings); } private static Builder createDefault() { @@ -498,7 +558,6 @@ public class EchoStubSettings extends StubSettings { builder.setTransportChannelProvider(defaultTransportChannelProvider()); builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); builder.setInternalHeaderProvider(defaultApiClientHeaderProviderBuilder().build()); - builder.setEndpoint(getDefaultEndpoint()); builder.setMtlsEndpoint(getDefaultMtlsEndpoint()); builder.setSwitchToMtlsEndpointAllowed(true); @@ -511,7 +570,6 @@ public class EchoStubSettings extends StubSettings { builder.setTransportChannelProvider(defaultHttpJsonTransportProviderBuilder().build()); builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); builder.setInternalHeaderProvider(defaultHttpJsonApiClientHeaderProviderBuilder().build()); - builder.setEndpoint(getDefaultEndpoint()); builder.setMtlsEndpoint(getDefaultMtlsEndpoint()); builder.setSwitchToMtlsEndpointAllowed(true); @@ -564,6 +622,11 @@ public class EchoStubSettings extends StubSettings { .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + builder + .updateCaseSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + builder .waitOperationSettings() .setInitialCallSettings( @@ -578,13 +641,13 @@ public class EchoStubSettings extends StubSettings { .setPollingAlgorithm( OperationTimedPollAlgorithm.create( RetrySettings.newBuilder() - .setInitialRetryDelay(Duration.ofMillis(5000L)) + .setInitialRetryDelayDuration(Duration.ofMillis(5000L)) .setRetryDelayMultiplier(1.5) - .setMaxRetryDelay(Duration.ofMillis(45000L)) - .setInitialRpcTimeout(Duration.ZERO) + .setMaxRetryDelayDuration(Duration.ofMillis(45000L)) + .setInitialRpcTimeoutDuration(Duration.ZERO) .setRpcTimeoutMultiplier(1.0) - .setMaxRpcTimeout(Duration.ZERO) - .setTotalTimeout(Duration.ofMillis(300000L)) + .setMaxRpcTimeoutDuration(Duration.ZERO) + .setTotalTimeoutDuration(Duration.ofMillis(300000L)) .build())); return builder; @@ -635,8 +698,6 @@ public class EchoStubSettings extends StubSettings { } /** Returns the builder for the settings used for calls to wait. */ - @BetaApi( - "The surface for use by generated code is not stable yet and may change in the future.") public OperationCallSettings.Builder waitOperationSettings() { return waitOperationSettings; @@ -667,6 +728,11 @@ public class EchoStubSettings extends StubSettings { return noBindingSettings; } + /** Returns the builder for the settings used for calls to updateCase. */ + public UnaryCallSettings.Builder updateCaseSettings() { + return updateCaseSettings; + } + @Override public EchoStubSettings build() throws IOException { return new EchoStubSettings(this); diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpcrest/goldens/GrpcEchoStub.golden b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpcrest/goldens/GrpcEchoStub.golden index 8cf20fee1f..3d337d1d44 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpcrest/goldens/GrpcEchoStub.golden +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpcrest/goldens/GrpcEchoStub.golden @@ -11,19 +11,21 @@ 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.OperationCallable; +import com.google.api.gax.rpc.RequestParamsBuilder; import com.google.api.gax.rpc.ServerStreamingCallable; import com.google.api.gax.rpc.UnaryCallable; -import com.google.common.collect.ImmutableMap; import com.google.longrunning.Operation; import com.google.longrunning.stub.GrpcOperationsStub; import com.google.showcase.grpcrest.v1beta1.BlockRequest; import com.google.showcase.grpcrest.v1beta1.BlockResponse; +import com.google.showcase.grpcrest.v1beta1.Case; import com.google.showcase.grpcrest.v1beta1.EchoRequest; import com.google.showcase.grpcrest.v1beta1.EchoResponse; import com.google.showcase.grpcrest.v1beta1.ExpandRequest; import com.google.showcase.grpcrest.v1beta1.Object; import com.google.showcase.grpcrest.v1beta1.PagedExpandRequest; import com.google.showcase.grpcrest.v1beta1.PagedExpandResponse; +import com.google.showcase.grpcrest.v1beta1.UpdateCaseRequest; import com.google.showcase.grpcrest.v1beta1.WaitMetadata; import com.google.showcase.grpcrest.v1beta1.WaitRequest; import com.google.showcase.grpcrest.v1beta1.WaitResponse; @@ -49,6 +51,7 @@ public class GrpcEchoStub extends EchoStub { .setFullMethodName("google.showcase.grpcrest.v1beta1.Echo/Echo") .setRequestMarshaller(ProtoUtils.marshaller(EchoRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(EchoResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) .build(); private static final MethodDescriptor expandMethodDescriptor = @@ -57,6 +60,7 @@ public class GrpcEchoStub extends EchoStub { .setFullMethodName("google.showcase.grpcrest.v1beta1.Echo/Expand") .setRequestMarshaller(ProtoUtils.marshaller(ExpandRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(EchoResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) .build(); private static final MethodDescriptor @@ -67,6 +71,7 @@ public class GrpcEchoStub extends EchoStub { .setRequestMarshaller(ProtoUtils.marshaller(PagedExpandRequest.getDefaultInstance())) .setResponseMarshaller( ProtoUtils.marshaller(PagedExpandResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) .build(); private static final MethodDescriptor @@ -77,6 +82,7 @@ public class GrpcEchoStub extends EchoStub { .setRequestMarshaller(ProtoUtils.marshaller(PagedExpandRequest.getDefaultInstance())) .setResponseMarshaller( ProtoUtils.marshaller(PagedExpandResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) .build(); private static final MethodDescriptor waitMethodDescriptor = @@ -85,6 +91,7 @@ public class GrpcEchoStub extends EchoStub { .setFullMethodName("google.showcase.grpcrest.v1beta1.Echo/Wait") .setRequestMarshaller(ProtoUtils.marshaller(WaitRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .setSampledToLocalTracing(true) .build(); private static final MethodDescriptor blockMethodDescriptor = @@ -93,6 +100,7 @@ public class GrpcEchoStub extends EchoStub { .setFullMethodName("google.showcase.grpcrest.v1beta1.Echo/Block") .setRequestMarshaller(ProtoUtils.marshaller(BlockRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(BlockResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) .build(); private static final MethodDescriptor collideNameMethodDescriptor = @@ -101,6 +109,7 @@ public class GrpcEchoStub extends EchoStub { .setFullMethodName("google.showcase.grpcrest.v1beta1.Echo/CollideName") .setRequestMarshaller(ProtoUtils.marshaller(EchoRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(Object.getDefaultInstance())) + .setSampledToLocalTracing(true) .build(); private static final MethodDescriptor nestedBindingMethodDescriptor = @@ -109,6 +118,7 @@ public class GrpcEchoStub extends EchoStub { .setFullMethodName("google.showcase.grpcrest.v1beta1.Echo/NestedBinding") .setRequestMarshaller(ProtoUtils.marshaller(EchoRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(Object.getDefaultInstance())) + .setSampledToLocalTracing(true) .build(); private static final MethodDescriptor chatMethodDescriptor = @@ -117,6 +127,7 @@ public class GrpcEchoStub extends EchoStub { .setFullMethodName("google.showcase.grpcrest.v1beta1.Echo/Chat") .setRequestMarshaller(ProtoUtils.marshaller(EchoRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(EchoResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) .build(); private static final MethodDescriptor noBindingMethodDescriptor = @@ -125,6 +136,16 @@ public class GrpcEchoStub extends EchoStub { .setFullMethodName("google.showcase.grpcrest.v1beta1.Echo/NoBinding") .setRequestMarshaller(ProtoUtils.marshaller(EchoRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(EchoResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor updateCaseMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.showcase.grpcrest.v1beta1.Echo/UpdateCase") + .setRequestMarshaller(ProtoUtils.marshaller(UpdateCaseRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Case.getDefaultInstance())) + .setSampledToLocalTracing(true) .build(); private final UnaryCallable echoCallable; @@ -142,6 +163,7 @@ public class GrpcEchoStub extends EchoStub { private final UnaryCallable nestedBindingCallable; private final BidiStreamingCallable chatCallable; private final UnaryCallable noBindingCallable; + private final UnaryCallable updateCaseCallable; private final BackgroundResource backgroundResources; private final GrpcOperationsStub operationsStub; @@ -184,6 +206,7 @@ public class GrpcEchoStub extends EchoStub { GrpcCallSettings echoTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(echoMethodDescriptor) + .setResourceNameExtractor(request -> request.getName()) .build(); GrpcCallSettings expandTransportSettings = GrpcCallSettings.newBuilder() @@ -208,24 +231,38 @@ public class GrpcEchoStub extends EchoStub { GrpcCallSettings collideNameTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(collideNameMethodDescriptor) + .setResourceNameExtractor(request -> request.getName()) .build(); GrpcCallSettings nestedBindingTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(nestedBindingMethodDescriptor) .setParamsExtractor( request -> { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("foo_bar.name", String.valueOf(request.getFooBar().getName())); - return params.build(); + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("foo_bar.name", String.valueOf(request.getFooBar().getName())); + return builder.build(); }) + .setResourceNameExtractor(request -> request.getName()) .build(); GrpcCallSettings chatTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(chatMethodDescriptor) + .setResourceNameExtractor(request -> request.getName()) .build(); GrpcCallSettings noBindingTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(noBindingMethodDescriptor) + .setResourceNameExtractor(request -> request.getName()) + .build(); + GrpcCallSettings updateCaseTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(updateCaseMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("case.name", String.valueOf(request.getCase().getName())); + return builder.build(); + }) .build(); this.echoCallable = @@ -271,6 +308,9 @@ public class GrpcEchoStub extends EchoStub { this.noBindingCallable = callableFactory.createUnaryCallable( noBindingTransportSettings, settings.noBindingSettings(), clientContext); + this.updateCaseCallable = + callableFactory.createUnaryCallable( + updateCaseTransportSettings, settings.updateCaseSettings(), clientContext); this.backgroundResources = new BackgroundResourceAggregation(clientContext.getBackgroundResources()); @@ -346,6 +386,11 @@ public class GrpcEchoStub extends EchoStub { return noBindingCallable; } + @Override + public UnaryCallable updateCaseCallable() { + return updateCaseCallable; + } + @Override public final void close() { try { diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpcrest/goldens/GrpcWickedCallableFactory.golden b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpcrest/goldens/GrpcWickedCallableFactory.golden new file mode 100644 index 0000000000..88f063999a --- /dev/null +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpcrest/goldens/GrpcWickedCallableFactory.golden @@ -0,0 +1,99 @@ +package com.google.showcase.v1beta1.stub; + +import com.google.api.core.BetaApi; +import com.google.api.gax.grpc.GrpcCallSettings; +import com.google.api.gax.grpc.GrpcCallableFactory; +import com.google.api.gax.grpc.GrpcStubCallableFactory; +import com.google.api.gax.rpc.BatchingCallSettings; +import com.google.api.gax.rpc.BidiStreamingCallable; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientStreamingCallable; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.api.gax.rpc.StreamingCallSettings; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.longrunning.Operation; +import com.google.longrunning.stub.OperationsStub; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * gRPC callable factory implementation for the Wicked service API. + * + *

        This class is for advanced usage. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class GrpcWickedCallableFactory 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/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpcrest/goldens/GrpcWickedStub.golden b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpcrest/goldens/GrpcWickedStub.golden new file mode 100644 index 0000000000..c421c2a8a6 --- /dev/null +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpcrest/goldens/GrpcWickedStub.golden @@ -0,0 +1,185 @@ +package com.google.showcase.v1beta1.stub; + +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.grpc.GrpcCallSettings; +import com.google.api.gax.grpc.GrpcStubCallableFactory; +import com.google.api.gax.rpc.BidiStreamingCallable; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientStreamingCallable; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.longrunning.stub.GrpcOperationsStub; +import com.google.showcase.v1beta1.EvilRequest; +import com.google.showcase.v1beta1.EvilResponse; +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 Wicked service API. + * + *

        This class is for advanced usage and reflects the underlying API directly. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class GrpcWickedStub extends WickedStub { + private static final MethodDescriptor craftEvilPlanMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.showcase.v1beta1.Wicked/CraftEvilPlan") + .setRequestMarshaller(ProtoUtils.marshaller(EvilRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(EvilResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor + brainstormEvilPlansMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.BIDI_STREAMING) + .setFullMethodName("google.showcase.v1beta1.Wicked/BrainstormEvilPlans") + .setRequestMarshaller(ProtoUtils.marshaller(EvilRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(EvilResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor + persuadeEvilPlanMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.CLIENT_STREAMING) + .setFullMethodName("google.showcase.v1beta1.Wicked/PersuadeEvilPlan") + .setRequestMarshaller(ProtoUtils.marshaller(EvilRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(EvilResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private final UnaryCallable craftEvilPlanCallable; + private final BidiStreamingCallable brainstormEvilPlansCallable; + private final ClientStreamingCallable persuadeEvilPlanCallable; + + private final BackgroundResource backgroundResources; + private final GrpcOperationsStub operationsStub; + private final GrpcStubCallableFactory callableFactory; + + public static final GrpcWickedStub create(WickedStubSettings settings) throws IOException { + return new GrpcWickedStub(settings, ClientContext.create(settings)); + } + + public static final GrpcWickedStub create(ClientContext clientContext) throws IOException { + return new GrpcWickedStub(WickedStubSettings.newBuilder().build(), clientContext); + } + + public static final GrpcWickedStub create( + ClientContext clientContext, GrpcStubCallableFactory callableFactory) throws IOException { + return new GrpcWickedStub( + WickedStubSettings.newBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of GrpcWickedStub, 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 GrpcWickedStub(WickedStubSettings settings, ClientContext clientContext) + throws IOException { + this(settings, clientContext, new GrpcWickedCallableFactory()); + } + + /** + * Constructs an instance of GrpcWickedStub, 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 GrpcWickedStub( + WickedStubSettings settings, + ClientContext clientContext, + GrpcStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + this.operationsStub = GrpcOperationsStub.create(clientContext, callableFactory); + + GrpcCallSettings craftEvilPlanTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(craftEvilPlanMethodDescriptor) + .build(); + GrpcCallSettings brainstormEvilPlansTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(brainstormEvilPlansMethodDescriptor) + .build(); + GrpcCallSettings persuadeEvilPlanTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(persuadeEvilPlanMethodDescriptor) + .build(); + + this.craftEvilPlanCallable = + callableFactory.createUnaryCallable( + craftEvilPlanTransportSettings, settings.craftEvilPlanSettings(), clientContext); + this.brainstormEvilPlansCallable = + callableFactory.createBidiStreamingCallable( + brainstormEvilPlansTransportSettings, + settings.brainstormEvilPlansSettings(), + clientContext); + this.persuadeEvilPlanCallable = + callableFactory.createClientStreamingCallable( + persuadeEvilPlanTransportSettings, settings.persuadeEvilPlanSettings(), clientContext); + + this.backgroundResources = + new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + public GrpcOperationsStub getOperationsStub() { + return operationsStub; + } + + @Override + public UnaryCallable craftEvilPlanCallable() { + return craftEvilPlanCallable; + } + + @Override + public BidiStreamingCallable brainstormEvilPlansCallable() { + return brainstormEvilPlansCallable; + } + + @Override + public ClientStreamingCallable persuadeEvilPlanCallable() { + return persuadeEvilPlanCallable; + } + + @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/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpcrest/goldens/HttpJsonEchoCallableFactory.golden b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpcrest/goldens/HttpJsonEchoCallableFactory.golden index 3996e0747e..5da8337d63 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpcrest/goldens/HttpJsonEchoCallableFactory.golden +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpcrest/goldens/HttpJsonEchoCallableFactory.golden @@ -57,8 +57,6 @@ public class HttpJsonEchoCallableFactory httpJsonCallSettings, callSettings, clientContext); } - @BetaApi( - "The surface for long-running operations is not stable yet and may change in the future.") @Override public OperationCallable createOperationCallable( diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpcrest/goldens/HttpJsonEchoStub.golden b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpcrest/goldens/HttpJsonEchoStub.golden index 6d6d179d9b..24ff0ee928 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpcrest/goldens/HttpJsonEchoStub.golden +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpcrest/goldens/HttpJsonEchoStub.golden @@ -3,6 +3,7 @@ package com.google.showcase.grpcrest.v1beta1.stub; import static com.google.showcase.grpcrest.v1beta1.EchoClient.PagedExpandPagedResponse; import static com.google.showcase.grpcrest.v1beta1.EchoClient.SimplePagedExpandPagedResponse; +import com.google.api.HttpRule; import com.google.api.core.BetaApi; import com.google.api.core.InternalApi; import com.google.api.gax.core.BackgroundResource; @@ -16,20 +17,25 @@ import com.google.api.gax.httpjson.ProtoMessageResponseParser; import com.google.api.gax.httpjson.ProtoRestSerializer; import com.google.api.gax.httpjson.longrunning.stub.HttpJsonOperationsStub; import com.google.api.gax.longrunning.OperationSnapshot; +import com.google.api.gax.rpc.BidiStreamingCallable; 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.ServerStreamingCallable; import com.google.api.gax.rpc.UnaryCallable; +import com.google.common.collect.ImmutableMap; import com.google.longrunning.Operation; import com.google.protobuf.TypeRegistry; import com.google.showcase.grpcrest.v1beta1.BlockRequest; import com.google.showcase.grpcrest.v1beta1.BlockResponse; +import com.google.showcase.grpcrest.v1beta1.Case; import com.google.showcase.grpcrest.v1beta1.EchoRequest; import com.google.showcase.grpcrest.v1beta1.EchoResponse; import com.google.showcase.grpcrest.v1beta1.ExpandRequest; import com.google.showcase.grpcrest.v1beta1.Object; import com.google.showcase.grpcrest.v1beta1.PagedExpandRequest; import com.google.showcase.grpcrest.v1beta1.PagedExpandResponse; +import com.google.showcase.grpcrest.v1beta1.UpdateCaseRequest; import com.google.showcase.grpcrest.v1beta1.WaitMetadata; import com.google.showcase.grpcrest.v1beta1.WaitRequest; import com.google.showcase.grpcrest.v1beta1.WaitResponse; @@ -329,6 +335,42 @@ public class HttpJsonEchoStub extends EchoStub { .build()) .build(); + private static final ApiMethodDescriptor updateCaseMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.showcase.grpcrest.v1beta1.Echo/UpdateCase") + .setHttpMethod("PATCH") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v2beta/{case.name=projects/*/cases/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "case.name", request.getCase().getName()); + return fields; + }) + .setAdditionalPaths("/v2beta/{case.name=organizations/*/cases/*}") + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "updateMask", request.getUpdateMask()); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create().toBody("case_", request.getCase(), false)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Case.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + private final UnaryCallable echoCallable; private final ServerStreamingCallable expandCallable; private final UnaryCallable pagedExpandCallable; @@ -342,6 +384,7 @@ public class HttpJsonEchoStub extends EchoStub { private final UnaryCallable blockCallable; private final UnaryCallable collideNameCallable; private final UnaryCallable nestedBindingCallable; + private final UnaryCallable updateCaseCallable; private final BackgroundResource backgroundResources; private final HttpJsonOperationsStub httpJsonOperationsStub; @@ -381,12 +424,62 @@ public class HttpJsonEchoStub extends EchoStub { throws IOException { this.callableFactory = callableFactory; this.httpJsonOperationsStub = - HttpJsonOperationsStub.create(clientContext, callableFactory, typeRegistry); + HttpJsonOperationsStub.create( + clientContext, + callableFactory, + typeRegistry, + ImmutableMap.builder() + .put( + "google.longrunning.Operations.CancelOperation", + HttpRule.newBuilder() + .setPost("/v1beta1/{name=operations/**}:cancel") + .addAdditionalBindings( + HttpRule.newBuilder() + .setPost("/v1beta2/{name=operations/**}:cancel") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setPost("/v1beta3/{name=operations/**}:cancel") + .build()) + .build()) + .put( + "google.longrunning.Operations.DeleteOperation", + HttpRule.newBuilder() + .setDelete("/v1beta1/{name=operations/**}") + .addAdditionalBindings( + HttpRule.newBuilder() + .setDelete("/v1beta2/{name=operations/**}") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setDelete("/v1beta3/{name=operations/**}") + .build()) + .build()) + .put( + "google.longrunning.Operations.GetOperation", + HttpRule.newBuilder() + .setGet("/v1beta1/{name=operations/**}") + .addAdditionalBindings( + HttpRule.newBuilder().setGet("/v1beta2/{name=operations/**}").build()) + .addAdditionalBindings( + HttpRule.newBuilder().setGet("/v1beta3/{name=operations/**}").build()) + .build()) + .put( + "google.longrunning.Operations.ListOperations", + HttpRule.newBuilder() + .setGet("/v1beta1/operations") + .addAdditionalBindings( + HttpRule.newBuilder().setGet("/v1beta2/operations").build()) + .addAdditionalBindings( + HttpRule.newBuilder().setGet("/v1beta3/operations").build()) + .build()) + .build()); HttpJsonCallSettings echoTransportSettings = HttpJsonCallSettings.newBuilder() .setMethodDescriptor(echoMethodDescriptor) .setTypeRegistry(typeRegistry) + .setResourceNameExtractor(request -> request.getName()) .build(); HttpJsonCallSettings expandTransportSettings = HttpJsonCallSettings.newBuilder() @@ -418,11 +511,30 @@ public class HttpJsonEchoStub extends EchoStub { HttpJsonCallSettings.newBuilder() .setMethodDescriptor(collideNameMethodDescriptor) .setTypeRegistry(typeRegistry) + .setResourceNameExtractor(request -> request.getName()) .build(); HttpJsonCallSettings nestedBindingTransportSettings = HttpJsonCallSettings.newBuilder() .setMethodDescriptor(nestedBindingMethodDescriptor) .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("foo_bar.name", String.valueOf(request.getFooBar().getName())); + return builder.build(); + }) + .setResourceNameExtractor(request -> request.getName()) + .build(); + HttpJsonCallSettings updateCaseTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(updateCaseMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("case.name", String.valueOf(request.getCase().getName())); + return builder.build(); + }) .build(); this.echoCallable = @@ -465,6 +577,9 @@ public class HttpJsonEchoStub extends EchoStub { this.nestedBindingCallable = callableFactory.createUnaryCallable( nestedBindingTransportSettings, settings.nestedBindingSettings(), clientContext); + this.updateCaseCallable = + callableFactory.createUnaryCallable( + updateCaseTransportSettings, settings.updateCaseSettings(), clientContext); this.backgroundResources = new BackgroundResourceAggregation(clientContext.getBackgroundResources()); @@ -481,6 +596,7 @@ public class HttpJsonEchoStub extends EchoStub { methodDescriptors.add(blockMethodDescriptor); methodDescriptors.add(collideNameMethodDescriptor); methodDescriptors.add(nestedBindingMethodDescriptor); + methodDescriptors.add(updateCaseMethodDescriptor); return methodDescriptors; } @@ -544,6 +660,23 @@ public class HttpJsonEchoStub extends EchoStub { return nestedBindingCallable; } + @Override + public UnaryCallable updateCaseCallable() { + return updateCaseCallable; + } + + @Override + public BidiStreamingCallable chatCallable() { + throw new UnsupportedOperationException( + "Not implemented: chatCallable(). REST transport is not implemented for this method yet."); + } + + @Override + public UnaryCallable noBindingCallable() { + throw new UnsupportedOperationException( + "Not implemented: noBindingCallable(). REST transport is not implemented for this method yet."); + } + @Override public final void close() { try { diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpcrest/goldens/WickedClient.golden b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpcrest/goldens/WickedClient.golden new file mode 100644 index 0000000000..138bee4bc1 --- /dev/null +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpcrest/goldens/WickedClient.golden @@ -0,0 +1,307 @@ +package com.google.showcase.v1beta1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.rpc.BidiStreamingCallable; +import com.google.api.gax.rpc.ClientStreamingCallable; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.showcase.v1beta1.stub.WickedStub; +import com.google.showcase.v1beta1.stub.WickedStubSettings; +import java.io.IOException; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * 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 (WickedClient wickedClient = WickedClient.create()) {
        + *   EvilRequest request =
        + *       EvilRequest.newBuilder().setMaliciousIdea("maliciousIdea712541645").build();
        + *   EvilResponse response = wickedClient.craftEvilPlan(request);
        + * }
        + * }
        + * + *

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

        CraftEvilPlan

        + *

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

        + *
          + *
        • craftEvilPlan(EvilRequest request) + *

        + *

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

        + *
          + *
        • craftEvilPlanCallable() + *

        + *

        BrainstormEvilPlans

        + *

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

        + *
          + *
        • brainstormEvilPlansCallable() + *

        + *

        PersuadeEvilPlan

        + *

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

        + *
          + *
        • persuadeEvilPlanCallable() + *

        + *
        + * + *

        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 WickedSettings 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
        + * WickedSettings wickedSettings =
        + *     WickedSettings.newBuilder()
        + *         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
        + *         .build();
        + * WickedClient wickedClient = WickedClient.create(wickedSettings);
        + * }
        + * + *

        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
        + * WickedSettings wickedSettings = WickedSettings.newBuilder().setEndpoint(myEndpoint).build();
        + * WickedClient wickedClient = WickedClient.create(wickedSettings);
        + * }
        + * + *

        Please refer to the GitHub repository's samples for more quickstart code snippets. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class WickedClient implements BackgroundResource { + private final WickedSettings settings; + private final WickedStub stub; + + /** Constructs an instance of WickedClient with default settings. */ + public static final WickedClient create() throws IOException { + return create(WickedSettings.newBuilder().build()); + } + + /** + * Constructs an instance of WickedClient, 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 WickedClient create(WickedSettings settings) throws IOException { + return new WickedClient(settings); + } + + /** + * Constructs an instance of WickedClient, using the given stub for making calls. This is for + * advanced usage - prefer using create(WickedSettings). + */ + public static final WickedClient create(WickedStub stub) { + return new WickedClient(stub); + } + + /** + * Constructs an instance of WickedClient, 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 WickedClient(WickedSettings settings) throws IOException { + this.settings = settings; + this.stub = ((WickedStubSettings) settings.getStubSettings()).createStub(); + } + + protected WickedClient(WickedStub stub) { + this.settings = null; + this.stub = stub; + } + + public final WickedSettings getSettings() { + return settings; + } + + public WickedStub getStub() { + return stub; + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * 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 (WickedClient wickedClient = WickedClient.create()) {
        +   *   EvilRequest request =
        +   *       EvilRequest.newBuilder().setMaliciousIdea("maliciousIdea712541645").build();
        +   *   EvilResponse response = wickedClient.craftEvilPlan(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 EvilResponse craftEvilPlan(EvilRequest request) { + return craftEvilPlanCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * 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 (WickedClient wickedClient = WickedClient.create()) {
        +   *   EvilRequest request =
        +   *       EvilRequest.newBuilder().setMaliciousIdea("maliciousIdea712541645").build();
        +   *   ApiFuture future = wickedClient.craftEvilPlanCallable().futureCall(request);
        +   *   // Do something.
        +   *   EvilResponse response = future.get();
        +   * }
        +   * }
        + */ + public final UnaryCallable craftEvilPlanCallable() { + return stub.craftEvilPlanCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * 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 (WickedClient wickedClient = WickedClient.create()) {
        +   *   BidiStream bidiStream =
        +   *       wickedClient.brainstormEvilPlansCallable().call();
        +   *   EvilRequest request =
        +   *       EvilRequest.newBuilder().setMaliciousIdea("maliciousIdea712541645").build();
        +   *   bidiStream.send(request);
        +   *   for (EvilResponse response : bidiStream) {
        +   *     // Do something when a response is received.
        +   *   }
        +   * }
        +   * }
        + */ + public final BidiStreamingCallable brainstormEvilPlansCallable() { + return stub.brainstormEvilPlansCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * 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 (WickedClient wickedClient = WickedClient.create()) {
        +   *   ApiStreamObserver responseObserver =
        +   *       new ApiStreamObserver() {
        +   *         {@literal @}Override
        +   *         public void onNext(EvilResponse response) {
        +   *           // Do something when a response is received.
        +   *         }
        +   *
        +   *         {@literal @}Override
        +   *         public void onError(Throwable t) {
        +   *           // Add error-handling
        +   *         }
        +   *
        +   *         {@literal @}Override
        +   *         public void onCompleted() {
        +   *           // Do something when complete.
        +   *         }
        +   *       };
        +   *   ApiStreamObserver requestObserver =
        +   *       wickedClient.persuadeEvilPlan().clientStreamingCall(responseObserver);
        +   *   EvilRequest request =
        +   *       EvilRequest.newBuilder().setMaliciousIdea("maliciousIdea712541645").build();
        +   *   requestObserver.onNext(request);
        +   * }
        +   * }
        + */ + public final ClientStreamingCallable persuadeEvilPlanCallable() { + return stub.persuadeEvilPlanCallable(); + } + + @Override + public final void close() { + stub.close(); + } + + @Override + public void shutdown() { + stub.shutdown(); + } + + @Override + public boolean isShutdown() { + return stub.isShutdown(); + } + + @Override + public boolean isTerminated() { + return stub.isTerminated(); + } + + @Override + public void shutdownNow() { + stub.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return stub.awaitTermination(duration, unit); + } +} diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpcrest/goldens/WickedClientTest.golden b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpcrest/goldens/WickedClientTest.golden new file mode 100644 index 0000000000..69db1fda7a --- /dev/null +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpcrest/goldens/WickedClientTest.golden @@ -0,0 +1,197 @@ +package com.google.showcase.v1beta1; + +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.ClientStreamingCallable; +import com.google.api.gax.rpc.InvalidArgumentException; +import com.google.api.gax.rpc.StatusCode; +import com.google.protobuf.AbstractMessage; +import io.grpc.StatusRuntimeException; +import java.io.IOException; +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 WickedClientTest { + private static MockServiceHelper mockServiceHelper; + private static MockWicked mockWicked; + private LocalChannelProvider channelProvider; + private WickedClient client; + + @BeforeClass + public static void startStaticServer() { + mockWicked = new MockWicked(); + mockServiceHelper = + new MockServiceHelper( + UUID.randomUUID().toString(), Arrays.asList(mockWicked)); + mockServiceHelper.start(); + } + + @AfterClass + public static void stopServer() { + mockServiceHelper.stop(); + } + + @Before + public void setUp() throws IOException { + mockServiceHelper.reset(); + channelProvider = mockServiceHelper.createChannelProvider(); + WickedSettings settings = + WickedSettings.newBuilder() + .setTransportChannelProvider(channelProvider) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = WickedClient.create(settings); + } + + @After + public void tearDown() throws Exception { + client.close(); + } + + @Test + public void craftEvilPlanTest() throws Exception { + EvilResponse expectedResponse = + EvilResponse.newBuilder().setMaliciousPlan("maliciousPlan712757759").build(); + mockWicked.addResponse(expectedResponse); + + EvilRequest request = + EvilRequest.newBuilder().setMaliciousIdea("maliciousIdea712541645").build(); + + EvilResponse actualResponse = client.craftEvilPlan(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockWicked.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + EvilRequest actualRequest = ((EvilRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getMaliciousIdea(), actualRequest.getMaliciousIdea()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void craftEvilPlanExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockWicked.addException(exception); + + try { + EvilRequest request = + EvilRequest.newBuilder().setMaliciousIdea("maliciousIdea712541645").build(); + client.craftEvilPlan(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void brainstormEvilPlansTest() throws Exception { + EvilResponse expectedResponse = + EvilResponse.newBuilder().setMaliciousPlan("maliciousPlan712757759").build(); + mockWicked.addResponse(expectedResponse); + EvilRequest request = + EvilRequest.newBuilder().setMaliciousIdea("maliciousIdea712541645").build(); + + MockStreamObserver responseObserver = new MockStreamObserver<>(); + + BidiStreamingCallable callable = + client.brainstormEvilPlansCallable(); + 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 brainstormEvilPlansExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockWicked.addException(exception); + EvilRequest request = + EvilRequest.newBuilder().setMaliciousIdea("maliciousIdea712541645").build(); + + MockStreamObserver responseObserver = new MockStreamObserver<>(); + + BidiStreamingCallable callable = + client.brainstormEvilPlansCallable(); + 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()); + } + } + + @Test + public void persuadeEvilPlanTest() throws Exception { + EvilResponse expectedResponse = + EvilResponse.newBuilder().setMaliciousPlan("maliciousPlan712757759").build(); + mockWicked.addResponse(expectedResponse); + EvilRequest request = + EvilRequest.newBuilder().setMaliciousIdea("maliciousIdea712541645").build(); + + MockStreamObserver responseObserver = new MockStreamObserver<>(); + + ClientStreamingCallable callable = client.persuadeEvilPlanCallable(); + ApiStreamObserver requestObserver = callable.clientStreamingCall(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 persuadeEvilPlanExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockWicked.addException(exception); + EvilRequest request = + EvilRequest.newBuilder().setMaliciousIdea("maliciousIdea712541645").build(); + + MockStreamObserver responseObserver = new MockStreamObserver<>(); + + ClientStreamingCallable callable = client.persuadeEvilPlanCallable(); + ApiStreamObserver requestObserver = callable.clientStreamingCall(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/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpcrest/goldens/WickedSettings.golden b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpcrest/goldens/WickedSettings.golden new file mode 100644 index 0000000000..7df7e658dc --- /dev/null +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpcrest/goldens/WickedSettings.golden @@ -0,0 +1,203 @@ +package com.google.showcase.v1beta1; + +import com.google.api.core.ApiFunction; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientSettings; +import com.google.api.gax.rpc.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.showcase.v1beta1.stub.WickedStubSettings; +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 WickedClient}. + * + *

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

          + *
        • The default service address (localhost) and default port (7469) 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 craftEvilPlan: + * + *

        {@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
        + * WickedSettings.Builder wickedSettingsBuilder = WickedSettings.newBuilder();
        + * wickedSettingsBuilder
        + *     .craftEvilPlanSettings()
        + *     .setRetrySettings(
        + *         wickedSettingsBuilder
        + *             .craftEvilPlanSettings()
        + *             .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());
        + * WickedSettings wickedSettings = wickedSettingsBuilder.build();
        + * }
        + * + * Please refer to the [Client Side Retry + * Guide](https://docs.cloud.google.com/java/docs/client-retries) for additional support in setting + * retries. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class WickedSettings extends ClientSettings { + + /** Returns the object with the settings used for calls to craftEvilPlan. */ + public UnaryCallSettings craftEvilPlanSettings() { + return ((WickedStubSettings) getStubSettings()).craftEvilPlanSettings(); + } + + /** Returns the object with the settings used for calls to brainstormEvilPlans. */ + public StreamingCallSettings brainstormEvilPlansSettings() { + return ((WickedStubSettings) getStubSettings()).brainstormEvilPlansSettings(); + } + + /** Returns the object with the settings used for calls to persuadeEvilPlan. */ + public StreamingCallSettings persuadeEvilPlanSettings() { + return ((WickedStubSettings) getStubSettings()).persuadeEvilPlanSettings(); + } + + public static final WickedSettings create(WickedStubSettings stub) throws IOException { + return new WickedSettings.Builder(stub.toBuilder()).build(); + } + + /** Returns a builder for the default ExecutorProvider for this service. */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return WickedStubSettings.defaultExecutorProviderBuilder(); + } + + /** Returns the default service endpoint. */ + public static String getDefaultEndpoint() { + return WickedStubSettings.getDefaultEndpoint(); + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return WickedStubSettings.getDefaultServiceScopes(); + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return WickedStubSettings.defaultCredentialsProviderBuilder(); + } + + /** Returns a builder for the default gRPC ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return WickedStubSettings.defaultGrpcTransportProviderBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return WickedStubSettings.defaultTransportChannelProvider(); + } + + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return WickedStubSettings.defaultApiClientHeaderProviderBuilder(); + } + + /** Returns a new gRPC 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 WickedSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + } + + /** Builder for WickedSettings. */ + public static class Builder extends ClientSettings.Builder { + + protected Builder() throws IOException { + this(((ClientContext) null)); + } + + protected Builder(ClientContext clientContext) { + super(WickedStubSettings.newBuilder(clientContext)); + } + + protected Builder(WickedSettings settings) { + super(settings.getStubSettings().toBuilder()); + } + + protected Builder(WickedStubSettings.Builder stubSettings) { + super(stubSettings); + } + + private static Builder createDefault() { + return new Builder(WickedStubSettings.newBuilder()); + } + + public WickedStubSettings.Builder getStubSettingsBuilder() { + return ((WickedStubSettings.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 craftEvilPlan. */ + public UnaryCallSettings.Builder craftEvilPlanSettings() { + return getStubSettingsBuilder().craftEvilPlanSettings(); + } + + /** Returns the builder for the settings used for calls to brainstormEvilPlans. */ + public StreamingCallSettings.Builder brainstormEvilPlansSettings() { + return getStubSettingsBuilder().brainstormEvilPlansSettings(); + } + + /** Returns the builder for the settings used for calls to persuadeEvilPlan. */ + public StreamingCallSettings.Builder persuadeEvilPlanSettings() { + return getStubSettingsBuilder().persuadeEvilPlanSettings(); + } + + @Override + public WickedSettings build() throws IOException { + return new WickedSettings(this); + } + } +} diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpcrest/goldens/WickedStubSettings.golden b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpcrest/goldens/WickedStubSettings.golden new file mode 100644 index 0000000000..49780b5885 --- /dev/null +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpcrest/goldens/WickedStubSettings.golden @@ -0,0 +1,309 @@ +package com.google.showcase.v1beta1.stub; + +import com.google.api.core.ApiFunction; +import com.google.api.core.BetaApi; +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.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.LibraryMetadata; +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.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.ImmutableSet; +import com.google.common.collect.Lists; +import com.google.showcase.v1beta1.EvilRequest; +import com.google.showcase.v1beta1.EvilResponse; +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 WickedStub}. + * + *

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

          + *
        • The default service address (localhost) and default port (7469) 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 craftEvilPlan: + * + *

        {@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
        + * WickedStubSettings.Builder wickedSettingsBuilder = WickedStubSettings.newBuilder();
        + * wickedSettingsBuilder
        + *     .craftEvilPlanSettings()
        + *     .setRetrySettings(
        + *         wickedSettingsBuilder
        + *             .craftEvilPlanSettings()
        + *             .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());
        + * WickedStubSettings wickedSettings = wickedSettingsBuilder.build();
        + * }
        + * + * Please refer to the [Client Side Retry + * Guide](https://docs.cloud.google.com/java/docs/client-retries) for additional support in setting + * retries. + */ +@BetaApi +@Generated("by gapic-generator-java") +@SuppressWarnings("CanonicalDuration") +public class WickedStubSettings extends StubSettings { + /** The default scopes of the service. */ + private static final ImmutableList DEFAULT_SERVICE_SCOPES = + ImmutableList.builder().build(); + + private final UnaryCallSettings craftEvilPlanSettings; + private final StreamingCallSettings brainstormEvilPlansSettings; + private final StreamingCallSettings persuadeEvilPlanSettings; + + /** Returns the object with the settings used for calls to craftEvilPlan. */ + public UnaryCallSettings craftEvilPlanSettings() { + return craftEvilPlanSettings; + } + + /** Returns the object with the settings used for calls to brainstormEvilPlans. */ + public StreamingCallSettings brainstormEvilPlansSettings() { + return brainstormEvilPlansSettings; + } + + /** Returns the object with the settings used for calls to persuadeEvilPlan. */ + public StreamingCallSettings persuadeEvilPlanSettings() { + return persuadeEvilPlanSettings; + } + + public WickedStub createStub() throws IOException { + if (getTransportChannelProvider() + .getTransportName() + .equals(GrpcTransportChannel.getGrpcTransportName())) { + return GrpcWickedStub.create(this); + } + throw new UnsupportedOperationException( + String.format( + "Transport not supported: %s", getTransportChannelProvider().getTransportName())); + } + + /** Returns a builder for the default ExecutorProvider for this service. */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return InstantiatingExecutorProvider.newBuilder(); + } + + /** Returns the default service endpoint. */ + @ObsoleteApi("Use getEndpoint() instead") + public static String getDefaultEndpoint() { + return "localhost:7469"; + } + + /** Returns the default mTLS service endpoint. */ + public static String getDefaultMtlsEndpoint() { + return "localhost:7469"; + } + + /** 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 gRPC 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 defaultGrpcApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken("gapic", GaxProperties.getLibraryVersion(WickedStubSettings.class)) + .setTransportToken( + GaxGrpcProperties.getGrpcTokenName(), GaxGrpcProperties.getGrpcVersion()); + } + + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return WickedStubSettings.defaultGrpcApiClientHeaderProviderBuilder(); + } + + /** Returns a new gRPC 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 WickedStubSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + + craftEvilPlanSettings = settingsBuilder.craftEvilPlanSettings().build(); + brainstormEvilPlansSettings = settingsBuilder.brainstormEvilPlansSettings().build(); + persuadeEvilPlanSettings = settingsBuilder.persuadeEvilPlanSettings().build(); + } + + @Override + protected LibraryMetadata getLibraryMetadata() { + return LibraryMetadata.newBuilder() + .setArtifactName("com.google.cloud:gapic-showcase") + .setRepository("googleapis/sdk-platform-java") + .setVersion(Version.VERSION) + .build(); + } + + /** Builder for WickedStubSettings. */ + public static class Builder extends StubSettings.Builder { + private final ImmutableList> unaryMethodSettingsBuilders; + private final UnaryCallSettings.Builder craftEvilPlanSettings; + private final StreamingCallSettings.Builder + brainstormEvilPlansSettings; + private final StreamingCallSettings.Builder persuadeEvilPlanSettings; + private static final ImmutableMap> + RETRYABLE_CODE_DEFINITIONS; + + static { + ImmutableMap.Builder> definitions = + ImmutableMap.builder(); + definitions.put("no_retry_codes", ImmutableSet.copyOf(Lists.newArrayList())); + RETRYABLE_CODE_DEFINITIONS = definitions.build(); + } + + private static final ImmutableMap RETRY_PARAM_DEFINITIONS; + + static { + ImmutableMap.Builder definitions = ImmutableMap.builder(); + RetrySettings settings = null; + settings = RetrySettings.newBuilder().setRpcTimeoutMultiplier(1.0).build(); + definitions.put("no_retry_params", settings); + RETRY_PARAM_DEFINITIONS = definitions.build(); + } + + protected Builder() { + this(((ClientContext) null)); + } + + protected Builder(ClientContext clientContext) { + super(clientContext); + + craftEvilPlanSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + brainstormEvilPlansSettings = StreamingCallSettings.newBuilder(); + persuadeEvilPlanSettings = StreamingCallSettings.newBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of(craftEvilPlanSettings); + initDefaults(this); + } + + protected Builder(WickedStubSettings settings) { + super(settings); + + craftEvilPlanSettings = settings.craftEvilPlanSettings.toBuilder(); + brainstormEvilPlansSettings = settings.brainstormEvilPlansSettings.toBuilder(); + persuadeEvilPlanSettings = settings.persuadeEvilPlanSettings.toBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of(craftEvilPlanSettings); + } + + 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 + .craftEvilPlanSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_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 craftEvilPlan. */ + public UnaryCallSettings.Builder craftEvilPlanSettings() { + return craftEvilPlanSettings; + } + + /** Returns the builder for the settings used for calls to brainstormEvilPlans. */ + public StreamingCallSettings.Builder brainstormEvilPlansSettings() { + return brainstormEvilPlansSettings; + } + + /** Returns the builder for the settings used for calls to persuadeEvilPlan. */ + public StreamingCallSettings.Builder persuadeEvilPlanSettings() { + return persuadeEvilPlanSettings; + } + + @Override + public WickedStubSettings build() throws IOException { + return new WickedStubSettings(this); + } + } +} diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/resourcename/ResourceNameHelperClassComposerTest.java b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/resourcename/ResourceNameHelperClassComposerTest.java index c54218a52e..ecc3e682ae 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/resourcename/ResourceNameHelperClassComposerTest.java +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/resourcename/ResourceNameHelperClassComposerTest.java @@ -16,24 +16,27 @@ import static com.google.common.truth.Truth.assertThat; import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertTrue; import com.google.api.generator.engine.writer.JavaWriterVisitor; -import com.google.api.generator.gapic.composer.common.TestProtoLoader; import com.google.api.generator.gapic.model.GapicClass; import com.google.api.generator.gapic.model.GapicContext; import com.google.api.generator.gapic.model.Message; import com.google.api.generator.gapic.model.ResourceName; import com.google.api.generator.gapic.protoparser.Parser; import com.google.api.generator.test.framework.Assert; -import com.google.api.generator.test.framework.Utils; +import com.google.api.generator.test.framework.GoldenFileWriter; +import com.google.api.generator.test.protoloader.TestProtoLoader; import com.google.logging.v2.LogEntryProto; import com.google.logging.v2.LoggingConfigProto; import com.google.logging.v2.LoggingMetricsProto; import com.google.logging.v2.LoggingProto; import com.google.protobuf.Descriptors.FileDescriptor; import com.google.protobuf.Descriptors.ServiceDescriptor; +import com.google.protobuf.EmptyProto; import com.google.showcase.v1beta1.EchoOuterClass; import com.google.showcase.v1beta1.TestingOuterClass; +import com.google.test.collisions.CollisionsOuterClass; import google.cloud.CommonResources; import java.nio.file.Path; import java.nio.file.Paths; @@ -46,22 +49,25 @@ import java.util.Set; import java.util.stream.Collectors; import java.util.stream.Stream; -import org.junit.Before; -import org.junit.Test; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; + +class ResourceNameHelperClassComposerTest { + + private final String COLLIDING_RESOURCE_NAME_KEY = "config.googleapis.com/Resource"; -public class ResourceNameHelperClassComposerTest { private ServiceDescriptor echoService; private FileDescriptor echoFileDescriptor; - @Before - public void setUp() { + @BeforeEach + void setUp() { echoFileDescriptor = EchoOuterClass.getDescriptor(); echoService = echoFileDescriptor.getServices().get(0); assertEquals(echoService.getName(), "Echo"); } @Test - public void getTokenSet_basic() { + void getTokenSet_basic() { List patterns = Arrays.asList( "projects/{project}/agent/sessions/{session}", @@ -75,7 +81,7 @@ public void getTokenSet_basic() { } @Test - public void concatToUpperSnakeCaseName_basic() { + void concatToUpperSnakeCaseName_basic() { assertEquals( "PROJECT_LOCATION_AUTOSCALING_POLICY", ResourceNameHelperClassComposer.concatToUpperSnakeCaseName( @@ -83,7 +89,7 @@ public void concatToUpperSnakeCaseName_basic() { } @Test - public void concatToUpperCamelCaseName_basic() { + void concatToUpperCamelCaseName_basic() { assertEquals( "ProjectLocationAutoscalingPolicy", ResourceNameHelperClassComposer.concatToUpperCamelCaseName( @@ -91,7 +97,7 @@ public void concatToUpperCamelCaseName_basic() { } @Test - public void generateResourceNameClass_echoFoobarMultiplePatterns() { + void generateResourceNameClass_echoFoobarMultiplePatterns() { Map messageTypes = Parser.parseMessages(echoFileDescriptor); Map resourceNames = Parser.parseResourceNames(echoFileDescriptor); Set outputResourceNames = new HashSet<>(); @@ -107,13 +113,14 @@ public void generateResourceNameClass_echoFoobarMultiplePatterns() { JavaWriterVisitor visitor = new JavaWriterVisitor(); clazz.classDefinition().accept(visitor); - Utils.saveCodegenToFile(this.getClass(), "FoobarName.golden", visitor.write()); - Path goldenFilePath = Paths.get(Utils.getGoldenDir(this.getClass()), "FoobarName.golden"); + GoldenFileWriter.saveCodegenToFile(this.getClass(), "FoobarName.golden", visitor.write()); + Path goldenFilePath = + Paths.get(GoldenFileWriter.getGoldenDir(this.getClass()), "FoobarName.golden"); Assert.assertCodeEquals(goldenFilePath, visitor.write()); } @Test - public void generateResourceNameClass_loggingOnePatternMultipleVariables() { + void generateResourceNameClass_loggingOnePatternMultipleVariables() { FileDescriptor serviceFileDescriptor = LoggingConfigProto.getDescriptor(); ServiceDescriptor serviceDescriptor = serviceFileDescriptor.getServices().get(0); assertEquals(serviceDescriptor.getName(), "ConfigServiceV2"); @@ -137,6 +144,12 @@ public void generateResourceNameClass_loggingOnePatternMultipleVariables() { FileDescriptor commonResourcesFileDescriptor = CommonResources.getDescriptor(); resourceNames.putAll(Parser.parseResourceNames(commonResourcesFileDescriptor)); + // Additional dependency found in LoggingService.DeleteLink LRO + // (google.longrunning.operation_info).response_type. Necessary for + // complete parsing of the descriptors. + FileDescriptor emptyFileDescriptor = EmptyProto.getDescriptor(); + messageTypes.putAll(Parser.parseMessages(emptyFileDescriptor)); + Set outputResourceNames = new HashSet<>(); Parser.parseService( serviceFileDescriptor, messageTypes, resourceNames, Optional.empty(), outputResourceNames); @@ -151,14 +164,16 @@ public void generateResourceNameClass_loggingOnePatternMultipleVariables() { JavaWriterVisitor visitor = new JavaWriterVisitor(); clazz.classDefinition().accept(visitor); - Utils.saveCodegenToFile(this.getClass(), "BillingAccountLocationName.golden", visitor.write()); + GoldenFileWriter.saveCodegenToFile( + this.getClass(), "BillingAccountLocationName.golden", visitor.write()); Path goldenFilePath = - Paths.get(Utils.getGoldenDir(this.getClass()), "BillingAccountLocationName.golden"); + Paths.get( + GoldenFileWriter.getGoldenDir(this.getClass()), "BillingAccountLocationName.golden"); Assert.assertCodeEquals(goldenFilePath, visitor.write()); } @Test - public void generateResourceNameClass_testingSessionOnePattern() { + void generateResourceNameClass_testingSessionOnePattern() { FileDescriptor testingFileDescriptor = TestingOuterClass.getDescriptor(); ServiceDescriptor testingService = testingFileDescriptor.getServices().get(0); assertEquals(testingService.getName(), "Testing"); @@ -178,13 +193,14 @@ public void generateResourceNameClass_testingSessionOnePattern() { JavaWriterVisitor visitor = new JavaWriterVisitor(); clazz.classDefinition().accept(visitor); - Utils.saveCodegenToFile(this.getClass(), "SessionName.golden", visitor.write()); - Path goldenFilePath = Paths.get(Utils.getGoldenDir(this.getClass()), "SessionName.golden"); + GoldenFileWriter.saveCodegenToFile(this.getClass(), "SessionName.golden", visitor.write()); + Path goldenFilePath = + Paths.get(GoldenFileWriter.getGoldenDir(this.getClass()), "SessionName.golden"); Assert.assertCodeEquals(goldenFilePath, visitor.write()); } @Test - public void generateResourceNameClass_testingBlueprintPatternWithNonSlashSeparator() { + void generateResourceNameClass_testingBlueprintPatternWithNonSlashSeparator() { FileDescriptor testingFileDescriptor = TestingOuterClass.getDescriptor(); ServiceDescriptor testingService = testingFileDescriptor.getServices().get(0); assertEquals(testingService.getName(), "Testing"); @@ -204,13 +220,14 @@ public void generateResourceNameClass_testingBlueprintPatternWithNonSlashSeparat JavaWriterVisitor visitor = new JavaWriterVisitor(); clazz.classDefinition().accept(visitor); - Utils.saveCodegenToFile(this.getClass(), "TestName.golden", visitor.write()); - Path goldenFilePath = Paths.get(Utils.getGoldenDir(this.getClass()), "TestName.golden"); + GoldenFileWriter.saveCodegenToFile(this.getClass(), "TestName.golden", visitor.write()); + Path goldenFilePath = + Paths.get(GoldenFileWriter.getGoldenDir(this.getClass()), "TestName.golden"); Assert.assertCodeEquals(goldenFilePath, visitor.write()); } @Test - public void generateResourceNameClass_childSingleton() { + void generateResourceNameClass_childSingleton() { ResourceName agentResname = ResourceName.builder() .setVariableName("agent") @@ -228,8 +245,34 @@ public void generateResourceNameClass_childSingleton() { ResourceNameHelperClassComposer.instance().generate(agentResname, irrelevantContext); JavaWriterVisitor visitor = new JavaWriterVisitor(); clazz.classDefinition().accept(visitor); - Utils.saveCodegenToFile(this.getClass(), "AgentName.golden", visitor.write()); - Path goldenFilePath = Paths.get(Utils.getGoldenDir(this.getClass()), "AgentName.golden"); + GoldenFileWriter.saveCodegenToFile(this.getClass(), "AgentName.golden", visitor.write()); + Path goldenFilePath = + Paths.get(GoldenFileWriter.getGoldenDir(this.getClass()), "AgentName.golden"); + Assert.assertCodeEquals(goldenFilePath, visitor.write()); + } + + @Test + void generateResourceNameClass_resourceNameCollisionIsAvoided() { + ResourceName collidingResourceName = + Parser.parseResourceNames(CollisionsOuterClass.getDescriptor()) + .get(COLLIDING_RESOURCE_NAME_KEY); + + GapicContext irrelevantContext = TestProtoLoader.instance().parseShowcaseEcho(); + GapicClass clazz = + ResourceNameHelperClassComposer.instance() + .generate(collidingResourceName, irrelevantContext); + JavaWriterVisitor visitor = new JavaWriterVisitor(); + clazz.classDefinition().accept(visitor); + GoldenFileWriter.saveCodegenToFile( + this.getClass(), "CollisionResourceName.golden", visitor.write()); + Path goldenFilePath = + Paths.get(GoldenFileWriter.getGoldenDir(this.getClass()), "CollisionResourceName.golden"); Assert.assertCodeEquals(goldenFilePath, visitor.write()); + + assertEquals(1, clazz.classDefinition().implementsTypes().size()); + assertTrue(clazz.classDefinition().implementsTypes().get(0).reference().useFullName()); + assertEquals( + clazz.classDefinition().classIdentifier().name(), + clazz.classDefinition().implementsTypes().get(0).reference().name()); } } diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/resourcename/ResourceNameTokenizerTest.java b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/resourcename/ResourceNameTokenizerTest.java index b49e731db2..9a4c0a3c67 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/resourcename/ResourceNameTokenizerTest.java +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/resourcename/ResourceNameTokenizerTest.java @@ -22,22 +22,22 @@ import com.google.showcase.v1beta1.EchoOuterClass; import java.util.Arrays; import java.util.List; -import org.junit.Before; -import org.junit.Test; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; -public class ResourceNameTokenizerTest { +class ResourceNameTokenizerTest { private ServiceDescriptor echoService; private FileDescriptor echoFileDescriptor; - @Before - public void setUp() { + @BeforeEach + void setUp() { echoFileDescriptor = EchoOuterClass.getDescriptor(); echoService = echoFileDescriptor.getServices().get(0); assertEquals(echoService.getName(), "Echo"); } @Test - public void parseTokenHierarchy_basic() { + void parseTokenHierarchy_basic() { List patterns = Arrays.asList( "projects/{project}/locations/{location}/autoscalingPolicies/{autoscaling_policy}", @@ -52,7 +52,7 @@ public void parseTokenHierarchy_basic() { } @Test - public void parseTokenHierarchy_substringsInPattern() { + void parseTokenHierarchy_substringsInPattern() { List patterns = Arrays.asList( "customers/{customer}/customerExtensionSettings/{customer_extension_setting}"); @@ -62,7 +62,7 @@ public void parseTokenHierarchy_substringsInPattern() { } @Test - public void parseTokenHierarchy_wildcards() { + void parseTokenHierarchy_wildcards() { List patterns = Arrays.asList( "projects/{project}/metricDescriptors/{metric_descriptor=**}", @@ -76,7 +76,7 @@ public void parseTokenHierarchy_wildcards() { } @Test - public void parseTokenHierarchy_singletonCollection() { + void parseTokenHierarchy_singletonCollection() { List patterns = Arrays.asList( "projects/{project}/agent/sessions/{session}", @@ -89,7 +89,7 @@ public void parseTokenHierarchy_singletonCollection() { } @Test - public void parseTokenHierarchy_singletonCollectionAndNonSlashSeparators() { + void parseTokenHierarchy_singletonCollectionAndNonSlashSeparators() { List patterns = Arrays.asList( "users/{user}/profile/blurbs/legacy/{legacy_user}~{blurb}", @@ -110,7 +110,7 @@ public void parseTokenHierarchy_singletonCollectionAndNonSlashSeparators() { } @Test - public void parseTokenHierarchy_invalidPatterns() { + void parseTokenHierarchy_invalidPatterns() { List patterns = Arrays.asList( "projects/{project}/agent/sessions/{session}/anotherSingleton", diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/resourcename/goldens/AgentName.golden b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/resourcename/goldens/AgentName.golden index 76f96eead8..2eb43f4f39 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/resourcename/goldens/AgentName.golden +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/resourcename/goldens/AgentName.golden @@ -1,6 +1,5 @@ package com.google.cloud.dialogflow.v2beta1; -import com.google.api.core.BetaApi; import com.google.api.pathtemplate.PathTemplate; import com.google.api.pathtemplate.ValidationException; import com.google.api.resourcenames.ResourceName; @@ -55,12 +54,10 @@ public class AgentName implements ResourceName { return new Builder(); } - @BetaApi("The per-pattern Builders are not stable yet and may be changed in the future.") public static Builder newProjectLocationBuilder() { return new Builder(); } - @BetaApi("The per-pattern Builders are not stable yet and may be changed in the future.") public static ProjectBuilder newProjectBuilder() { return new ProjectBuilder(); } @@ -73,12 +70,10 @@ public class AgentName implements ResourceName { return newBuilder().setProject(project).setLocation(location).build(); } - @BetaApi("The static create methods are not stable yet and may be changed in the future.") public static AgentName ofProjectLocationName(String project, String location) { return newBuilder().setProject(project).setLocation(location).build(); } - @BetaApi("The static create methods are not stable yet and may be changed in the future.") public static AgentName ofProjectName(String project) { return newProjectBuilder().setProject(project).build(); } @@ -87,12 +82,10 @@ public class AgentName implements ResourceName { return newBuilder().setProject(project).setLocation(location).build().toString(); } - @BetaApi("The static format methods are not stable yet and may be changed in the future.") public static String formatProjectLocationName(String project, String location) { return newBuilder().setProject(project).setLocation(location).build().toString(); } - @BetaApi("The static format methods are not stable yet and may be changed in the future.") public static String formatProjectName(String project) { return newProjectBuilder().setProject(project).build().toString(); } @@ -168,7 +161,7 @@ public class AgentName implements ResourceName { if (o == this) { return true; } - if (o != null || getClass() == o.getClass()) { + if (o != null && getClass() == o.getClass()) { AgentName that = ((AgentName) o); return Objects.equals(this.project, that.project) && Objects.equals(this.location, that.location); @@ -227,7 +220,6 @@ public class AgentName implements ResourceName { } /** Builder for projects/{project}/agent. */ - @BetaApi("The per-pattern Builders are not stable yet and may be changed in the future.") public static class ProjectBuilder { private String project; diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/resourcename/goldens/BillingAccountLocationName.golden b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/resourcename/goldens/BillingAccountLocationName.golden index 68c8b4c472..123088ef24 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/resourcename/goldens/BillingAccountLocationName.golden +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/resourcename/goldens/BillingAccountLocationName.golden @@ -124,7 +124,7 @@ public class BillingAccountLocationName implements ResourceName { if (o == this) { return true; } - if (o != null || getClass() == o.getClass()) { + if (o != null && getClass() == o.getClass()) { BillingAccountLocationName that = ((BillingAccountLocationName) o); return Objects.equals(this.billingAccount, that.billingAccount) && Objects.equals(this.location, that.location); diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/resourcename/goldens/CollisionResourceName.golden b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/resourcename/goldens/CollisionResourceName.golden new file mode 100644 index 0000000000..273db9bd66 --- /dev/null +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/resourcename/goldens/CollisionResourceName.golden @@ -0,0 +1,281 @@ +package com.google.test.collisions; + +import com.google.api.pathtemplate.PathTemplate; +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 ResourceName implements com.google.api.resourcenames.ResourceName { + private static final PathTemplate PROJECT_LOCATION_DEPLOYMENT_REVISION_RESOURCE = + PathTemplate.createWithoutUrlEncoding( + "projects/{project}/locations/{location}/deployments/{deployment}/revisions/{revision}/resources/{resource}"); + private volatile Map fieldValuesMap; + private final String project; + private final String location; + private final String deployment; + private final String revision; + private final String resource; + + @Deprecated + protected ResourceName() { + project = null; + location = null; + deployment = null; + revision = null; + resource = null; + } + + private ResourceName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + location = Preconditions.checkNotNull(builder.getLocation()); + deployment = Preconditions.checkNotNull(builder.getDeployment()); + revision = Preconditions.checkNotNull(builder.getRevision()); + resource = Preconditions.checkNotNull(builder.getResource()); + } + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public String getDeployment() { + return deployment; + } + + public String getRevision() { + return revision; + } + + public String getResource() { + return resource; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + public static ResourceName of( + String project, String location, String deployment, String revision, String resource) { + return newBuilder() + .setProject(project) + .setLocation(location) + .setDeployment(deployment) + .setRevision(revision) + .setResource(resource) + .build(); + } + + public static String format( + String project, String location, String deployment, String revision, String resource) { + return newBuilder() + .setProject(project) + .setLocation(location) + .setDeployment(deployment) + .setRevision(revision) + .setResource(resource) + .build() + .toString(); + } + + public static ResourceName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + PROJECT_LOCATION_DEPLOYMENT_REVISION_RESOURCE.validatedMatch( + formattedString, "ResourceName.parse: formattedString not in valid format"); + return of( + matchMap.get("project"), + matchMap.get("location"), + matchMap.get("deployment"), + matchMap.get("revision"), + matchMap.get("resource")); + } + + 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 (ResourceName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return PROJECT_LOCATION_DEPLOYMENT_REVISION_RESOURCE.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 (deployment != null) { + fieldMapBuilder.put("deployment", deployment); + } + if (revision != null) { + fieldMapBuilder.put("revision", revision); + } + if (resource != null) { + fieldMapBuilder.put("resource", resource); + } + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return PROJECT_LOCATION_DEPLOYMENT_REVISION_RESOURCE.instantiate( + "project", + project, + "location", + location, + "deployment", + deployment, + "revision", + revision, + "resource", + resource); + } + + @Override + public boolean equals(java.lang.Object o) { + if (o == this) { + return true; + } + if (o != null && getClass() == o.getClass()) { + ResourceName that = ((ResourceName) o); + return Objects.equals(this.project, that.project) + && Objects.equals(this.location, that.location) + && Objects.equals(this.deployment, that.deployment) + && Objects.equals(this.revision, that.revision) + && Objects.equals(this.resource, that.resource); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= Objects.hashCode(project); + h *= 1000003; + h ^= Objects.hashCode(location); + h *= 1000003; + h ^= Objects.hashCode(deployment); + h *= 1000003; + h ^= Objects.hashCode(revision); + h *= 1000003; + h ^= Objects.hashCode(resource); + return h; + } + + /** + * Builder for + * projects/{project}/locations/{location}/deployments/{deployment}/revisions/{revision}/resources/{resource}. + */ + public static class Builder { + private String project; + private String location; + private String deployment; + private String revision; + private String resource; + + protected Builder() {} + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public String getDeployment() { + return deployment; + } + + public String getRevision() { + return revision; + } + + public String getResource() { + return resource; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + public Builder setLocation(String location) { + this.location = location; + return this; + } + + public Builder setDeployment(String deployment) { + this.deployment = deployment; + return this; + } + + public Builder setRevision(String revision) { + this.revision = revision; + return this; + } + + public Builder setResource(String resource) { + this.resource = resource; + return this; + } + + private Builder(ResourceName resourceName) { + this.project = resourceName.project; + this.location = resourceName.location; + this.deployment = resourceName.deployment; + this.revision = resourceName.revision; + this.resource = resourceName.resource; + } + + public ResourceName build() { + return new ResourceName(this); + } + } +} diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/resourcename/goldens/FoobarName.golden b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/resourcename/goldens/FoobarName.golden index 4af08e31b7..4dcf36186a 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/resourcename/goldens/FoobarName.golden +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/resourcename/goldens/FoobarName.golden @@ -1,6 +1,5 @@ package com.google.showcase.v1beta1; -import com.google.api.core.BetaApi; import com.google.api.pathtemplate.PathTemplate; import com.google.api.pathtemplate.ValidationException; import com.google.api.resourcenames.ResourceName; @@ -92,22 +91,18 @@ public class FoobarName implements ResourceName { return new Builder(); } - @BetaApi("The per-pattern Builders are not stable yet and may be changed in the future.") public static Builder newProjectFoobarBuilder() { return new Builder(); } - @BetaApi("The per-pattern Builders are not stable yet and may be changed in the future.") public static ProjectVariantFoobarBuilder newProjectVariantFoobarBuilder() { return new ProjectVariantFoobarBuilder(); } - @BetaApi("The per-pattern Builders are not stable yet and may be changed in the future.") public static FoobarBuilder newFoobarBuilder() { return new FoobarBuilder(); } - @BetaApi("The per-pattern Builders are not stable yet and may be changed in the future.") public static BarFooFoobarBuilder newBarFooFoobarBuilder() { return new BarFooFoobarBuilder(); } @@ -120,12 +115,10 @@ public class FoobarName implements ResourceName { return newBuilder().setProject(project).setFoobar(foobar).build(); } - @BetaApi("The static create methods are not stable yet and may be changed in the future.") public static FoobarName ofProjectFoobarName(String project, String foobar) { return newBuilder().setProject(project).setFoobar(foobar).build(); } - @BetaApi("The static create methods are not stable yet and may be changed in the future.") public static FoobarName ofProjectVariantFoobarName( String project, String variant, String foobar) { return newProjectVariantFoobarBuilder() @@ -135,12 +128,10 @@ public class FoobarName implements ResourceName { .build(); } - @BetaApi("The static create methods are not stable yet and may be changed in the future.") public static FoobarName ofFoobarName(String foobar) { return newFoobarBuilder().setFoobar(foobar).build(); } - @BetaApi("The static create methods are not stable yet and may be changed in the future.") public static FoobarName ofBarFooFoobarName(String barFoo, String foobar) { return newBarFooFoobarBuilder().setBarFoo(barFoo).setFoobar(foobar).build(); } @@ -149,12 +140,10 @@ public class FoobarName implements ResourceName { return newBuilder().setProject(project).setFoobar(foobar).build().toString(); } - @BetaApi("The static format methods are not stable yet and may be changed in the future.") public static String formatProjectFoobarName(String project, String foobar) { return newBuilder().setProject(project).setFoobar(foobar).build().toString(); } - @BetaApi("The static format methods are not stable yet and may be changed in the future.") public static String formatProjectVariantFoobarName( String project, String variant, String foobar) { return newProjectVariantFoobarBuilder() @@ -165,12 +154,10 @@ public class FoobarName implements ResourceName { .toString(); } - @BetaApi("The static format methods are not stable yet and may be changed in the future.") public static String formatFoobarName(String foobar) { return newFoobarBuilder().setFoobar(foobar).build().toString(); } - @BetaApi("The static format methods are not stable yet and may be changed in the future.") public static String formatBarFooFoobarName(String barFoo, String foobar) { return newBarFooFoobarBuilder().setBarFoo(barFoo).setFoobar(foobar).build().toString(); } @@ -262,7 +249,7 @@ public class FoobarName implements ResourceName { if (o == this) { return true; } - if (o != null || getClass() == o.getClass()) { + if (o != null && getClass() == o.getClass()) { FoobarName that = ((FoobarName) o); return Objects.equals(this.project, that.project) && Objects.equals(this.foobar, that.foobar) @@ -327,7 +314,6 @@ public class FoobarName implements ResourceName { } /** Builder for projects/{project}/chocolate/variants/{variant}/foobars/{foobar}. */ - @BetaApi("The per-pattern Builders are not stable yet and may be changed in the future.") public static class ProjectVariantFoobarBuilder { private String project; private String variant; @@ -368,7 +354,6 @@ public class FoobarName implements ResourceName { } /** Builder for foobars/{foobar}. */ - @BetaApi("The per-pattern Builders are not stable yet and may be changed in the future.") public static class FoobarBuilder { private String foobar; @@ -389,7 +374,6 @@ public class FoobarName implements ResourceName { } /** Builder for bar_foos/{bar_foo}/foobars/{foobar}. */ - @BetaApi("The per-pattern Builders are not stable yet and may be changed in the future.") public static class BarFooFoobarBuilder { private String barFoo; private String foobar; diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/resourcename/goldens/SessionName.golden b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/resourcename/goldens/SessionName.golden index d61bb14c47..cb5996f0ed 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/resourcename/goldens/SessionName.golden +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/resourcename/goldens/SessionName.golden @@ -111,7 +111,7 @@ public class SessionName implements ResourceName { if (o == this) { return true; } - if (o != null || getClass() == o.getClass()) { + if (o != null && getClass() == o.getClass()) { SessionName that = ((SessionName) o); return Objects.equals(this.session, that.session); } diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/resourcename/goldens/TestName.golden b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/resourcename/goldens/TestName.golden index 1864a4e7f9..0fc68b527a 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/resourcename/goldens/TestName.golden +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/resourcename/goldens/TestName.golden @@ -137,7 +137,7 @@ public class TestName implements ResourceName { if (o == this) { return true; } - if (o != null || getClass() == o.getClass()) { + if (o != null && getClass() == o.getClass()) { TestName that = ((TestName) o); return Objects.equals(this.session, that.session) && Objects.equals(this.shardId, that.shardId) diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/rest/HttpJsonServiceCallableFactoryClassComposerTest.java b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/rest/HttpJsonServiceCallableFactoryClassComposerTest.java index 2207e3d7d1..ee2d4da0af 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/rest/HttpJsonServiceCallableFactoryClassComposerTest.java +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/rest/HttpJsonServiceCallableFactoryClassComposerTest.java @@ -19,14 +19,15 @@ import com.google.api.generator.gapic.model.GapicContext; import com.google.api.generator.gapic.model.Service; import com.google.api.generator.test.framework.Assert; -import com.google.api.generator.test.framework.Utils; +import com.google.api.generator.test.framework.GoldenFileWriter; +import com.google.api.generator.test.protoloader.RestTestProtoLoader; import java.nio.file.Path; import java.nio.file.Paths; -import org.junit.Test; +import org.junit.jupiter.api.Test; -public class HttpJsonServiceCallableFactoryClassComposerTest { +class HttpJsonServiceCallableFactoryClassComposerTest { @Test - public void generateServiceClasses() { + void generateServiceClasses() { GapicContext context = RestTestProtoLoader.instance().parseCompliance(); Service echoProtoService = context.services().get(0); GapicClass clazz = @@ -34,10 +35,12 @@ public void generateServiceClasses() { JavaWriterVisitor visitor = new JavaWriterVisitor(); clazz.classDefinition().accept(visitor); - Utils.saveCodegenToFile( + GoldenFileWriter.saveCodegenToFile( this.getClass(), "HttpJsonComplianceCallableFactory.golden", visitor.write()); Path goldenFilePath = - Paths.get(Utils.getGoldenDir(this.getClass()), "HttpJsonComplianceCallableFactory.golden"); + Paths.get( + GoldenFileWriter.getGoldenDir(this.getClass()), + "HttpJsonComplianceCallableFactory.golden"); Assert.assertCodeEquals(goldenFilePath, visitor.write()); } } diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/rest/HttpJsonServiceStubClassComposerTest.java b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/rest/HttpJsonServiceStubClassComposerTest.java index 243ef54ce2..0e78c76c36 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/rest/HttpJsonServiceStubClassComposerTest.java +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/rest/HttpJsonServiceStubClassComposerTest.java @@ -14,6 +14,11 @@ package com.google.api.generator.gapic.composer.rest; +import static org.junit.Assert.assertThrows; + +import com.google.api.CustomHttpPattern; +import com.google.api.Http; +import com.google.api.HttpRule; import com.google.api.generator.engine.ast.TypeNode; import com.google.api.generator.engine.writer.JavaWriterVisitor; import com.google.api.generator.gapic.model.Field; @@ -22,39 +27,57 @@ import com.google.api.generator.gapic.model.HttpBindings.HttpBinding; import com.google.api.generator.gapic.model.Service; import com.google.api.generator.test.framework.Assert; -import com.google.api.generator.test.framework.Utils; +import com.google.api.generator.test.framework.GoldenFileWriter; +import com.google.api.generator.test.protoloader.RestTestProtoLoader; +import com.google.common.collect.ImmutableList; import com.google.common.truth.Truth; import java.nio.file.Path; import java.nio.file.Paths; -import org.junit.Before; -import org.junit.Test; +import java.util.List; +import java.util.Map; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; -public class HttpJsonServiceStubClassComposerTest { +class HttpJsonServiceStubClassComposerTest { private HttpJsonServiceStubClassComposer composer; - @Before - public void setUp() throws Exception { + @BeforeEach + void setUp() throws Exception { composer = HttpJsonServiceStubClassComposer.instance(); } @Test - public void generateServiceClasses() { + void generateComplianceServiceClasses() { GapicContext context = RestTestProtoLoader.instance().parseCompliance(); + Service complianceProtoServices = context.services().get(0); + GapicClass clazz = composer.generate(context, complianceProtoServices); + + JavaWriterVisitor visitor = new JavaWriterVisitor(); + clazz.classDefinition().accept(visitor); + GoldenFileWriter.saveCodegenToFile( + this.getClass(), "HttpJsonComplianceStub.golden", visitor.write()); + Path goldenFilePath = + Paths.get(GoldenFileWriter.getGoldenDir(this.getClass()), "HttpJsonComplianceStub.golden"); + Assert.assertCodeEquals(goldenFilePath, visitor.write()); + } + + @Test + void generateEchoServiceClasses() { + GapicContext context = RestTestProtoLoader.instance().parseEcho(); Service echoProtoService = context.services().get(0); GapicClass clazz = composer.generate(context, echoProtoService); JavaWriterVisitor visitor = new JavaWriterVisitor(); clazz.classDefinition().accept(visitor); - Utils.saveCodegenToFile(this.getClass(), "HttpJsonComplianceStub.golden", visitor.write()); + GoldenFileWriter.saveCodegenToFile(this.getClass(), "HttpJsonEchoStub.golden", visitor.write()); Path goldenFilePath = - Paths.get(Utils.getGoldenDir(this.getClass()), "HttpJsonComplianceStub.golden"); + Paths.get(GoldenFileWriter.getGoldenDir(this.getClass()), "HttpJsonEchoStub.golden"); Assert.assertCodeEquals(goldenFilePath, visitor.write()); } @Test - public void - getBindingFieldMethodName_shouldReturnGetFieldListIfTheFieldIsInLastPositionAndIsRepeated() { + void getBindingFieldMethodName_shouldReturnGetFieldListIfTheFieldIsInLastPositionAndIsRepeated() { Field field = Field.builder() .setIsRepeated(true) @@ -68,8 +91,7 @@ public void generateServiceClasses() { } @Test - public void - getBindingFieldMethodName_shouldReturnGetFieldValueIfTheFieldIsInLastPositionAndIsEnum() { + void getBindingFieldMethodName_shouldReturnGetFieldValueIfTheFieldIsInLastPositionAndIsEnum() { Field field = Field.builder().setIsEnum(true).setName("doesNotMatter").setType(TypeNode.OBJECT).build(); HttpBinding httpBinding = @@ -79,7 +101,7 @@ public void generateServiceClasses() { } @Test - public void + void getBindingFieldMethodName_shouldReturnGetFieldIfTheFieldIsInLastPositionAndNotRepeatedOrEnum() { Field field = Field.builder().setName("doesNotMatter").setType(TypeNode.OBJECT).build(); HttpBinding httpBinding = @@ -89,11 +111,116 @@ public void generateServiceClasses() { } @Test - public void getBindingFieldMethodName_shouldReturnGetFieldIfTheFieldIsNotInLastPosition() { + void getBindingFieldMethodName_shouldReturnGetFieldIfTheFieldIsNotInLastPosition() { Field field = Field.builder().setName("doesNotMatter").setType(TypeNode.OBJECT).build(); HttpBinding httpBinding = HttpBinding.builder().setField(field).setName("doesNotMatter").build(); String actual = composer.getBindingFieldMethodName(httpBinding, 4, 1, "Value"); Truth.assertThat(actual).isEqualTo("getValue"); } + + @Test + void parseOperationsCustomHttpRules_shouldReturnMapIfContextContainsValidServiceYaml() { + List httpRuleList = + ImmutableList.of( + HttpRule.newBuilder() + .setSelector("google.longrunning.Operations.Get") + .setGet("testGet") + .build(), + HttpRule.newBuilder() + .setSelector("google.longrunning.Operations.Post") + .setPost("testPost") + .build(), + HttpRule.newBuilder() + .setSelector("google.longrunning.Operations.Delete") + .setDelete("testDelete") + .build()); + GapicContext contextServiceYaml = RestTestProtoLoader.instance().parseCompliance(); + contextServiceYaml = + contextServiceYaml.toBuilder() + .setServiceYamlProto( + com.google.api.Service.newBuilder() + .setHttp(Http.newBuilder().addAllRules(httpRuleList)) + .build()) + .build(); + Map httpRuleMap = composer.parseOperationsCustomHttpRules(contextServiceYaml); + Truth.assertThat(httpRuleMap.isEmpty()).isFalse(); + Truth.assertThat(httpRuleMap.size()).isEqualTo(httpRuleList.size()); + } + + @Test + void parseOperationsCustomHttpRules_shouldReturnEmptyMapIfContextHasInvalidServiceYaml() { + GapicContext contextNullServiceYaml = RestTestProtoLoader.instance().parseCompliance(); + contextNullServiceYaml = contextNullServiceYaml.toBuilder().setServiceYamlProto(null).build(); + Map httpRuleMapNull = + composer.parseOperationsCustomHttpRules(contextNullServiceYaml); + Truth.assertThat(httpRuleMapNull.isEmpty()).isTrue(); + + GapicContext contextEmptyServiceYaml = RestTestProtoLoader.instance().parseCompliance(); + contextNullServiceYaml = + contextEmptyServiceYaml.toBuilder() + .setServiceYamlProto(com.google.api.Service.newBuilder().build()) + .build(); + Map httpRuleMapEmpty = + composer.parseOperationsCustomHttpRules(contextNullServiceYaml); + Truth.assertThat(httpRuleMapEmpty.isEmpty()).isTrue(); + } + + @Test + void testGetOperationsURIValueFromHttpRule() { + HttpRule getHttpRule = HttpRule.newBuilder().setGet("Get").build(); + Truth.assertThat(composer.getOperationsURIValueFromHttpRule(getHttpRule)).isEqualTo("Get"); + HttpRule postHttpRule = HttpRule.newBuilder().setPost("Post").build(); + Truth.assertThat(composer.getOperationsURIValueFromHttpRule(postHttpRule)).isEqualTo("Post"); + HttpRule deleteHttpRule = HttpRule.newBuilder().setDelete("Delete").build(); + Truth.assertThat(composer.getOperationsURIValueFromHttpRule(deleteHttpRule)) + .isEqualTo("Delete"); + + HttpRule patchHttpRule = HttpRule.newBuilder().setPatch("Patch").build(); + assertThrows( + IllegalArgumentException.class, + () -> composer.getOperationsURIValueFromHttpRule(patchHttpRule)); + HttpRule putHttpRule = HttpRule.newBuilder().setPut("Put").build(); + assertThrows( + IllegalArgumentException.class, + () -> composer.getOperationsURIValueFromHttpRule(putHttpRule)); + HttpRule customHttpRule = + HttpRule.newBuilder() + .setCustom(CustomHttpPattern.newBuilder().setPath("Custom").build()) + .build(); + assertThrows( + IllegalArgumentException.class, + () -> composer.getOperationsURIValueFromHttpRule(customHttpRule)); + } + + @Test + void generateGrpcServiceStubClass_routingHeaders() { + GapicContext context = + RestTestProtoLoader.instance().parseExplicitDynamicRoutingHeaderTesting(); + Service service = context.services().get(0); + GapicClass clazz = HttpJsonServiceStubClassComposer.instance().generate(context, service); + + Assert.assertGoldenClass(this.getClass(), clazz, "HttpJsonRoutingHeadersStub.golden"); + Assert.assertEmptySamples(clazz.samples()); + } + + @Test + void generateHttpJsonServiceStubClass_autopopulateField() { + GapicContext context = RestTestProtoLoader.instance().parseAutoPopulateFieldTesting(); + Service service = context.services().get(0); + GapicClass clazz = HttpJsonServiceStubClassComposer.instance().generate(context, service); + + Assert.assertGoldenClass(this.getClass(), clazz, "HttpJsonAutoPopulateFieldTestingStub.golden"); + Assert.assertEmptySamples(clazz.samples()); + } + + @Test + void generateHttpJsonServiceStubClass_clientResourceNameExtractor() { + GapicContext context = RestTestProtoLoader.instance().parseResourceNameExtractorTesting(); + Service service = context.services().get(0); + GapicClass clazz = HttpJsonServiceStubClassComposer.instance().generate(context, service); + + Assert.assertGoldenClass(this.getClass(), clazz, "HttpJsonResourceNameExtractorStub.golden"); + Assert.assertEmptySamples(clazz.samples()); + } } diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/rest/RestTestProtoLoader.java b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/rest/RestTestProtoLoader.java deleted file mode 100644 index 3713242c1f..0000000000 --- a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/rest/RestTestProtoLoader.java +++ /dev/null @@ -1,79 +0,0 @@ -// Copyright 2021 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package com.google.api.generator.gapic.composer.rest; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertTrue; - -import com.google.api.generator.gapic.composer.common.TestProtoLoader; -import com.google.api.generator.gapic.model.GapicContext; -import com.google.api.generator.gapic.model.GapicServiceConfig; -import com.google.api.generator.gapic.model.Message; -import com.google.api.generator.gapic.model.ResourceName; -import com.google.api.generator.gapic.model.Service; -import com.google.api.generator.gapic.model.Transport; -import com.google.api.generator.gapic.protoparser.Parser; -import com.google.api.generator.gapic.protoparser.ServiceConfigParser; -import com.google.protobuf.Descriptors.FileDescriptor; -import com.google.protobuf.Descriptors.ServiceDescriptor; -import com.google.showcase.v1beta1.ComplianceOuterClass; -import java.nio.file.Path; -import java.nio.file.Paths; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Optional; -import java.util.Set; - -public class RestTestProtoLoader extends TestProtoLoader { - private static final RestTestProtoLoader INSTANCE = new RestTestProtoLoader(); - - protected RestTestProtoLoader() { - super(Transport.REST, "src/test/resources/"); - } - - public static RestTestProtoLoader instance() { - return INSTANCE; - } - - public GapicContext parseCompliance() { - FileDescriptor echoFileDescriptor = ComplianceOuterClass.getDescriptor(); - ServiceDescriptor echoServiceDescriptor = echoFileDescriptor.getServices().get(0); - assertEquals(echoServiceDescriptor.getName(), "Compliance"); - - Map messageTypes = Parser.parseMessages(echoFileDescriptor); - Map resourceNames = Parser.parseResourceNames(echoFileDescriptor); - Set outputResourceNames = new HashSet<>(); - List services = - Parser.parseService( - echoFileDescriptor, messageTypes, resourceNames, Optional.empty(), outputResourceNames); - - String jsonFilename = "showcase_grpc_service_config.json"; - Path jsonPath = Paths.get(getTestFilesDirectory(), jsonFilename); - Optional configOpt = ServiceConfigParser.parse(jsonPath.toString()); - assertTrue(configOpt.isPresent()); - GapicServiceConfig config = configOpt.get(); - - return GapicContext.builder() - .setMessages(messageTypes) - .setResourceNames(resourceNames) - .setServices(services) - .setServiceConfig(config) - .setHelperResourceNames(outputResourceNames) - .setTransport(getTransport()) - .setRestNumericEnumsEnabled(true) - .build(); - } -} diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/rest/ServiceClientTestClassComposerTest.java b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/rest/ServiceClientTestClassComposerTest.java index 55ca4c5f57..5e9b2e0df1 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/rest/ServiceClientTestClassComposerTest.java +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/rest/ServiceClientTestClassComposerTest.java @@ -20,14 +20,15 @@ import com.google.api.generator.gapic.model.GapicClass; import com.google.api.generator.gapic.model.GapicContext; import com.google.api.generator.gapic.model.Service; -import com.google.api.generator.test.framework.Utils; +import com.google.api.generator.test.framework.GoldenFileWriter; +import com.google.api.generator.test.protoloader.RestTestProtoLoader; import java.nio.file.Path; import java.nio.file.Paths; -import org.junit.Test; +import org.junit.jupiter.api.Test; -public class ServiceClientTestClassComposerTest { +class ServiceClientTestClassComposerTest { @Test - public void generateServiceClasses() { + void generateServiceClasses() { GapicContext context = RestTestProtoLoader.instance().parseCompliance(); Service echoProtoService = context.services().get(0); GapicClass clazz = @@ -35,9 +36,10 @@ public void generateServiceClasses() { JavaWriterVisitor visitor = new JavaWriterVisitor(); clazz.classDefinition().accept(visitor); - Utils.saveCodegenToFile(this.getClass(), "ComplianceClientTest.golden", visitor.write()); + GoldenFileWriter.saveCodegenToFile( + this.getClass(), "ComplianceClientTest.golden", visitor.write()); Path goldenFilePath = - Paths.get(Utils.getGoldenDir(this.getClass()), "ComplianceClientTest.golden"); + Paths.get(GoldenFileWriter.getGoldenDir(this.getClass()), "ComplianceClientTest.golden"); assertCodeEquals(goldenFilePath, visitor.write()); } } diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/rest/ServiceSettingsClassComposerTest.java b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/rest/ServiceSettingsClassComposerTest.java index 5631b00607..45d428bacc 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/rest/ServiceSettingsClassComposerTest.java +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/rest/ServiceSettingsClassComposerTest.java @@ -19,23 +19,25 @@ import com.google.api.generator.gapic.model.GapicContext; import com.google.api.generator.gapic.model.Service; import com.google.api.generator.test.framework.Assert; -import com.google.api.generator.test.framework.Utils; +import com.google.api.generator.test.framework.GoldenFileWriter; +import com.google.api.generator.test.protoloader.RestTestProtoLoader; import java.nio.file.Path; import java.nio.file.Paths; -import org.junit.Test; +import org.junit.jupiter.api.Test; -public class ServiceSettingsClassComposerTest { +class ServiceSettingsClassComposerTest { @Test - public void generateServiceClasses() { + void generateServiceClasses() { GapicContext context = RestTestProtoLoader.instance().parseCompliance(); Service echoProtoService = context.services().get(0); GapicClass clazz = ServiceSettingsClassComposer.instance().generate(context, echoProtoService); JavaWriterVisitor visitor = new JavaWriterVisitor(); clazz.classDefinition().accept(visitor); - Utils.saveCodegenToFile(this.getClass(), "ComplianceSettings.golden", visitor.write()); + GoldenFileWriter.saveCodegenToFile( + this.getClass(), "ComplianceSettings.golden", visitor.write()); Path goldenFilePath = - Paths.get(Utils.getGoldenDir(this.getClass()), "ComplianceSettings.golden"); + Paths.get(GoldenFileWriter.getGoldenDir(this.getClass()), "ComplianceSettings.golden"); Assert.assertCodeEquals(goldenFilePath, visitor.write()); } } diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/rest/ServiceStubSettingsClassComposerTest.java b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/rest/ServiceStubSettingsClassComposerTest.java index 309467cd2d..d10a2555d1 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/rest/ServiceStubSettingsClassComposerTest.java +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/rest/ServiceStubSettingsClassComposerTest.java @@ -19,24 +19,36 @@ import com.google.api.generator.gapic.model.GapicContext; import com.google.api.generator.gapic.model.Service; import com.google.api.generator.test.framework.Assert; -import com.google.api.generator.test.framework.Utils; +import com.google.api.generator.test.framework.GoldenFileWriter; +import com.google.api.generator.test.protoloader.RestTestProtoLoader; import java.nio.file.Path; import java.nio.file.Paths; -import org.junit.Test; +import java.util.stream.Stream; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.Arguments; +import org.junit.jupiter.params.provider.MethodSource; -public class ServiceStubSettingsClassComposerTest { - @Test - public void generateServiceClasses() { - GapicContext context = RestTestProtoLoader.instance().parseCompliance(); - Service echoProtoService = context.services().get(0); - GapicClass clazz = - ServiceStubSettingsClassComposer.instance().generate(context, echoProtoService); +class ServiceStubSettingsClassComposerTest { + + static Stream data() { + return Stream.of( + Arguments.of( + "ComplianceStubSettings.golden", RestTestProtoLoader.instance().parseCompliance()), + Arguments.of( + "HttpJsonApiVersionTestingStubSettings.golden", + RestTestProtoLoader.instance().parseApiVersionTesting())); + } + + @ParameterizedTest + @MethodSource("data") + void generateServiceClasses(String goldenFileName, GapicContext context) { + Service protoService = context.services().get(0); + GapicClass clazz = ServiceStubSettingsClassComposer.instance().generate(context, protoService); JavaWriterVisitor visitor = new JavaWriterVisitor(); clazz.classDefinition().accept(visitor); - Utils.saveCodegenToFile(this.getClass(), "ComplianceStubSettings.golden", visitor.write()); - Path goldenFilePath = - Paths.get(Utils.getGoldenDir(this.getClass()), "ComplianceStubSettings.golden"); + GoldenFileWriter.saveCodegenToFile(this.getClass(), goldenFileName, visitor.write()); + Path goldenFilePath = Paths.get(GoldenFileWriter.getGoldenDir(this.getClass()), goldenFileName); Assert.assertCodeEquals(goldenFilePath, visitor.write()); } } diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/rest/goldens/ComplianceSettings.golden b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/rest/goldens/ComplianceSettings.golden index 3730206623..357b0a8bb0 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/rest/goldens/ComplianceSettings.golden +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/rest/goldens/ComplianceSettings.golden @@ -31,7 +31,9 @@ import javax.annotation.Generated; *

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

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

        For example, to set the + * [RetrySettings](https://cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.retrying.RetrySettings) + * of repeatDataBody: * *

        {@code
          * // This snippet has been automatically generated and should be regarded as a code template only.
        @@ -47,10 +49,21 @@ import javax.annotation.Generated;
          *             .repeatDataBodySettings()
          *             .getRetrySettings()
          *             .toBuilder()
        - *             .setTotalTimeout(Duration.ofSeconds(30))
        + *             .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());
          * ComplianceSettings complianceSettings = complianceSettingsBuilder.build();
          * }
        + * + * Please refer to the [Client Side Retry + * Guide](https://docs.cloud.google.com/java/docs/client-retries) for additional support in setting + * retries. */ @BetaApi @Generated("by gapic-generator-java") @@ -130,7 +143,6 @@ public class ComplianceSettings extends ClientSettings { return ComplianceStubSettings.defaultTransportChannelProvider(); } - @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { return ComplianceStubSettings.defaultApiClientHeaderProviderBuilder(); } diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/rest/goldens/ComplianceStubSettings.golden b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/rest/goldens/ComplianceStubSettings.golden index acd321473f..1633188ee0 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/rest/goldens/ComplianceStubSettings.golden +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/rest/goldens/ComplianceStubSettings.golden @@ -2,6 +2,7 @@ package com.google.showcase.v1beta1.stub; import com.google.api.core.ApiFunction; import com.google.api.core.BetaApi; +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; @@ -11,6 +12,7 @@ import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; import com.google.api.gax.retrying.RetrySettings; import com.google.api.gax.rpc.ApiClientHeaderProvider; import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.LibraryMetadata; import com.google.api.gax.rpc.StatusCode; import com.google.api.gax.rpc.StubSettings; import com.google.api.gax.rpc.TransportChannelProvider; @@ -42,7 +44,9 @@ import javax.annotation.Generated; *

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

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

        For example, to set the + * [RetrySettings](https://cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.retrying.RetrySettings) + * of repeatDataBody: * *

        {@code
          * // This snippet has been automatically generated and should be regarded as a code template only.
        @@ -58,13 +62,25 @@ import javax.annotation.Generated;
          *             .repeatDataBodySettings()
          *             .getRetrySettings()
          *             .toBuilder()
        - *             .setTotalTimeout(Duration.ofSeconds(30))
        + *             .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());
          * ComplianceStubSettings complianceSettings = complianceSettingsBuilder.build();
          * }
        + * + * Please refer to the [Client Side Retry + * Guide](https://docs.cloud.google.com/java/docs/client-retries) for additional support in setting + * retries. */ @BetaApi @Generated("by gapic-generator-java") +@SuppressWarnings("CanonicalDuration") public class ComplianceStubSettings extends StubSettings { /** The default scopes of the service. */ private static final ImmutableList DEFAULT_SERVICE_SCOPES = @@ -137,6 +153,7 @@ public class ComplianceStubSettings extends StubSettings } /** Returns the default service endpoint. */ + @ObsoleteApi("Use getEndpoint() instead") public static String getDefaultEndpoint() { return "localhost:7469"; } @@ -168,7 +185,6 @@ public class ComplianceStubSettings extends StubSettings return defaultHttpJsonTransportProviderBuilder().build(); } - @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { return ApiClientHeaderProvider.newBuilder() .setGeneratedLibToken( @@ -207,6 +223,11 @@ public class ComplianceStubSettings extends StubSettings verifyEnumSettings = settingsBuilder.verifyEnumSettings().build(); } + @Override + protected LibraryMetadata getLibraryMetadata() { + return LibraryMetadata.newBuilder().setVersion(Version.VERSION).build(); + } + /** Builder for ComplianceStubSettings. */ public static class Builder extends StubSettings.Builder { private final ImmutableList> unaryMethodSettingsBuilders; @@ -302,7 +323,6 @@ public class ComplianceStubSettings extends StubSettings builder.setTransportChannelProvider(defaultTransportChannelProvider()); builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); builder.setInternalHeaderProvider(defaultApiClientHeaderProviderBuilder().build()); - builder.setEndpoint(getDefaultEndpoint()); builder.setMtlsEndpoint(getDefaultMtlsEndpoint()); builder.setSwitchToMtlsEndpointAllowed(true); diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/rest/goldens/HttpJsonApiVersionTestingStubSettings.golden b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/rest/goldens/HttpJsonApiVersionTestingStubSettings.golden new file mode 100644 index 0000000000..924e9c5566 --- /dev/null +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/rest/goldens/HttpJsonApiVersionTestingStubSettings.golden @@ -0,0 +1,272 @@ +package com.google.api.version.test.stub; + +import com.google.api.core.ApiFunction; +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.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.HttpJsonTransportChannel; +import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; +import com.google.api.gax.retrying.RetrySettings; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.LibraryMetadata; +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.version.test.EchoRequest; +import com.google.api.version.test.EchoResponse; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.ImmutableSet; +import com.google.common.collect.Lists; +import java.io.IOException; +import java.util.List; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Settings class to configure an instance of {@link EchoWithVersionStub}. + * + *

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

          + *
        • The default service address (localhost) and default port (7469) 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 echoWithVersionMethod: + * + *

        {@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
        + * EchoWithVersionStubSettings.Builder echoWithVersionSettingsBuilder =
        + *     EchoWithVersionStubSettings.newBuilder();
        + * echoWithVersionSettingsBuilder
        + *     .echoWithVersionMethodSettings()
        + *     .setRetrySettings(
        + *         echoWithVersionSettingsBuilder
        + *             .echoWithVersionMethodSettings()
        + *             .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());
        + * EchoWithVersionStubSettings echoWithVersionSettings = echoWithVersionSettingsBuilder.build();
        + * }
        + * + * Please refer to the [Client Side Retry + * Guide](https://docs.cloud.google.com/java/docs/client-retries) for additional support in setting + * retries. + */ +@Generated("by gapic-generator-java") +@SuppressWarnings("CanonicalDuration") +public class EchoWithVersionStubSettings extends StubSettings { + /** The default scopes of the service. */ + private static final ImmutableList DEFAULT_SERVICE_SCOPES = + ImmutableList.builder().add("https://www.googleapis.com/auth/cloud-platform").build(); + + private final UnaryCallSettings echoWithVersionMethodSettings; + + /** Returns the object with the settings used for calls to echoWithVersionMethod. */ + public UnaryCallSettings echoWithVersionMethodSettings() { + return echoWithVersionMethodSettings; + } + + public EchoWithVersionStub createStub() throws IOException { + if (getTransportChannelProvider() + .getTransportName() + .equals(HttpJsonTransportChannel.getHttpJsonTransportName())) { + return HttpJsonEchoWithVersionStub.create(this); + } + throw new UnsupportedOperationException( + String.format( + "Transport not supported: %s", getTransportChannelProvider().getTransportName())); + } + + /** Returns a builder for the default ExecutorProvider for this service. */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return InstantiatingExecutorProvider.newBuilder(); + } + + /** Returns the default service endpoint. */ + @ObsoleteApi("Use getEndpoint() instead") + public static String getDefaultEndpoint() { + return "localhost:7469"; + } + + /** Returns the default mTLS service endpoint. */ + public static String getDefaultMtlsEndpoint() { + return "localhost:7469"; + } + + /** 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 InstantiatingHttpJsonChannelProvider.Builder + defaultHttpJsonTransportProviderBuilder() { + return InstantiatingHttpJsonChannelProvider.newBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return defaultHttpJsonTransportProviderBuilder().build(); + } + + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken( + "gapic", GaxProperties.getLibraryVersion(EchoWithVersionStubSettings.class)) + .setTransportToken( + GaxHttpJsonProperties.getHttpJsonTokenName(), + GaxHttpJsonProperties.getHttpJsonVersion()) + .setApiVersionToken("fake_version"); + } + + /** 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 EchoWithVersionStubSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + + echoWithVersionMethodSettings = settingsBuilder.echoWithVersionMethodSettings().build(); + } + + @Override + protected LibraryMetadata getLibraryMetadata() { + return LibraryMetadata.newBuilder().setVersion(Version.VERSION).build(); + } + + /** Builder for EchoWithVersionStubSettings. */ + public static class Builder extends StubSettings.Builder { + private final ImmutableList> unaryMethodSettingsBuilders; + private final UnaryCallSettings.Builder + echoWithVersionMethodSettings; + private static final ImmutableMap> + RETRYABLE_CODE_DEFINITIONS; + + static { + ImmutableMap.Builder> definitions = + ImmutableMap.builder(); + definitions.put("no_retry_codes", ImmutableSet.copyOf(Lists.newArrayList())); + RETRYABLE_CODE_DEFINITIONS = definitions.build(); + } + + private static final ImmutableMap RETRY_PARAM_DEFINITIONS; + + static { + ImmutableMap.Builder definitions = ImmutableMap.builder(); + RetrySettings settings = null; + settings = RetrySettings.newBuilder().setRpcTimeoutMultiplier(1.0).build(); + definitions.put("no_retry_params", settings); + RETRY_PARAM_DEFINITIONS = definitions.build(); + } + + protected Builder() { + this(((ClientContext) null)); + } + + protected Builder(ClientContext clientContext) { + super(clientContext); + + echoWithVersionMethodSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of(echoWithVersionMethodSettings); + initDefaults(this); + } + + protected Builder(EchoWithVersionStubSettings settings) { + super(settings); + + echoWithVersionMethodSettings = settings.echoWithVersionMethodSettings.toBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of(echoWithVersionMethodSettings); + } + + 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 + .echoWithVersionMethodSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_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 echoWithVersionMethod. */ + public UnaryCallSettings.Builder echoWithVersionMethodSettings() { + return echoWithVersionMethodSettings; + } + + @Override + public EchoWithVersionStubSettings build() throws IOException { + return new EchoWithVersionStubSettings(this); + } + } +} diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/rest/goldens/HttpJsonAutoPopulateFieldTestingStub.golden b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/rest/goldens/HttpJsonAutoPopulateFieldTestingStub.golden new file mode 100644 index 0000000000..6b390feb69 --- /dev/null +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/rest/goldens/HttpJsonAutoPopulateFieldTestingStub.golden @@ -0,0 +1,286 @@ +package com.google.auto.populate.field.stub; + +import com.google.api.core.InternalApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.httpjson.ApiMethodDescriptor; +import com.google.api.gax.httpjson.HttpJsonCallSettings; +import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; +import com.google.api.gax.httpjson.ProtoMessageRequestFormatter; +import com.google.api.gax.httpjson.ProtoMessageResponseParser; +import com.google.api.gax.httpjson.ProtoRestSerializer; +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.ServerStreamingCallable; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.auto.populate.field.AutoPopulateFieldTestingEchoRequest; +import com.google.auto.populate.field.AutoPopulateFieldTestingEchoResponse; +import com.google.auto.populate.field.AutoPopulateFieldTestingExpandRequest; +import com.google.common.base.Strings; +import com.google.protobuf.TypeRegistry; +import java.io.IOException; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.UUID; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * REST stub implementation for the AutoPopulateFieldTesting service API. + * + *

        This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by gapic-generator-java") +public class HttpJsonAutoPopulateFieldTestingStub extends AutoPopulateFieldTestingStub { + private static final TypeRegistry typeRegistry = TypeRegistry.newBuilder().build(); + + private static final ApiMethodDescriptor< + AutoPopulateFieldTestingEchoRequest, AutoPopulateFieldTestingEchoResponse> + autoPopulateFieldTestingEchoMethodDescriptor = + ApiMethodDescriptor + . + newBuilder() + .setFullMethodName( + "google.auto.populate.field.AutoPopulateFieldTesting/AutoPopulateFieldTestingEcho") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/AutoPopulateFieldTesting:echo", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("*", request.toBuilder().build(), false)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(AutoPopulateFieldTestingEchoResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor< + AutoPopulateFieldTestingExpandRequest, AutoPopulateFieldTestingEchoResponse> + autoPopulateFieldTestingExpandMethodDescriptor = + ApiMethodDescriptor + . + newBuilder() + .setFullMethodName( + "google.auto.populate.field.AutoPopulateFieldTesting/AutoPopulateFieldTestingExpand") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.SERVER_STREAMING) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/AutoPopulateFieldTesting:expand", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("*", request.toBuilder().build(), false)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(AutoPopulateFieldTestingEchoResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private final UnaryCallable< + AutoPopulateFieldTestingEchoRequest, AutoPopulateFieldTestingEchoResponse> + autoPopulateFieldTestingEchoCallable; + private final ServerStreamingCallable< + AutoPopulateFieldTestingExpandRequest, AutoPopulateFieldTestingEchoResponse> + autoPopulateFieldTestingExpandCallable; + + private final BackgroundResource backgroundResources; + private final HttpJsonStubCallableFactory callableFactory; + + public static final HttpJsonAutoPopulateFieldTestingStub create( + AutoPopulateFieldTestingStubSettings settings) throws IOException { + return new HttpJsonAutoPopulateFieldTestingStub(settings, ClientContext.create(settings)); + } + + public static final HttpJsonAutoPopulateFieldTestingStub create(ClientContext clientContext) + throws IOException { + return new HttpJsonAutoPopulateFieldTestingStub( + AutoPopulateFieldTestingStubSettings.newBuilder().build(), clientContext); + } + + public static final HttpJsonAutoPopulateFieldTestingStub create( + ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { + return new HttpJsonAutoPopulateFieldTestingStub( + AutoPopulateFieldTestingStubSettings.newBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of HttpJsonAutoPopulateFieldTestingStub, 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 HttpJsonAutoPopulateFieldTestingStub( + AutoPopulateFieldTestingStubSettings settings, ClientContext clientContext) + throws IOException { + this(settings, clientContext, new HttpJsonAutoPopulateFieldTestingCallableFactory()); + } + + /** + * Constructs an instance of HttpJsonAutoPopulateFieldTestingStub, 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 HttpJsonAutoPopulateFieldTestingStub( + AutoPopulateFieldTestingStubSettings settings, + ClientContext clientContext, + HttpJsonStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + + HttpJsonCallSettings + autoPopulateFieldTestingEchoTransportSettings = + HttpJsonCallSettings + . + newBuilder() + .setMethodDescriptor(autoPopulateFieldTestingEchoMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setRequestMutator( + request -> { + AutoPopulateFieldTestingEchoRequest.Builder requestBuilder = + request.toBuilder(); + if (Strings.isNullOrEmpty(request.getRequestId())) { + requestBuilder.setRequestId(UUID.randomUUID().toString()); + } + if (Strings.isNullOrEmpty(request.getSecondRequestId())) { + requestBuilder.setSecondRequestId(UUID.randomUUID().toString()); + } + return requestBuilder.build(); + }) + .build(); + HttpJsonCallSettings< + AutoPopulateFieldTestingExpandRequest, AutoPopulateFieldTestingEchoResponse> + autoPopulateFieldTestingExpandTransportSettings = + HttpJsonCallSettings + . + newBuilder() + .setMethodDescriptor(autoPopulateFieldTestingExpandMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + + this.autoPopulateFieldTestingEchoCallable = + callableFactory.createUnaryCallable( + autoPopulateFieldTestingEchoTransportSettings, + settings.autoPopulateFieldTestingEchoSettings(), + clientContext); + this.autoPopulateFieldTestingExpandCallable = + callableFactory.createServerStreamingCallable( + autoPopulateFieldTestingExpandTransportSettings, + settings.autoPopulateFieldTestingExpandSettings(), + clientContext); + + this.backgroundResources = + new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + @InternalApi + public static List getMethodDescriptors() { + List methodDescriptors = new ArrayList<>(); + methodDescriptors.add(autoPopulateFieldTestingEchoMethodDescriptor); + methodDescriptors.add(autoPopulateFieldTestingExpandMethodDescriptor); + return methodDescriptors; + } + + @Override + public UnaryCallable + autoPopulateFieldTestingEchoCallable() { + return autoPopulateFieldTestingEchoCallable; + } + + @Override + public ServerStreamingCallable< + AutoPopulateFieldTestingExpandRequest, AutoPopulateFieldTestingEchoResponse> + autoPopulateFieldTestingExpandCallable() { + return autoPopulateFieldTestingExpandCallable; + } + + @Override + public ClientStreamingCallable< + AutoPopulateFieldTestingEchoRequest, AutoPopulateFieldTestingEchoResponse> + autoPopulateFieldTestingCollectCallable() { + throw new UnsupportedOperationException( + "Not implemented: autoPopulateFieldTestingCollectCallable(). REST transport is not implemented for this method yet."); + } + + @Override + public BidiStreamingCallable< + AutoPopulateFieldTestingEchoRequest, AutoPopulateFieldTestingEchoResponse> + autoPopulateFieldTestingChatCallable() { + throw new UnsupportedOperationException( + "Not implemented: autoPopulateFieldTestingChatCallable(). REST transport is not implemented for this method yet."); + } + + @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/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/rest/goldens/HttpJsonComplianceCallableFactory.golden b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/rest/goldens/HttpJsonComplianceCallableFactory.golden index 6e9ff65f91..25f9086a13 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/rest/goldens/HttpJsonComplianceCallableFactory.golden +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/rest/goldens/HttpJsonComplianceCallableFactory.golden @@ -57,8 +57,6 @@ public class HttpJsonComplianceCallableFactory httpJsonCallSettings, callSettings, clientContext); } - @BetaApi( - "The surface for long-running operations is not stable yet and may change in the future.") @Override public OperationCallable createOperationCallable( diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/rest/goldens/HttpJsonComplianceStub.golden b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/rest/goldens/HttpJsonComplianceStub.golden index bf282ba988..c808b9404e 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/rest/goldens/HttpJsonComplianceStub.golden +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/rest/goldens/HttpJsonComplianceStub.golden @@ -11,6 +11,7 @@ import com.google.api.gax.httpjson.ProtoMessageRequestFormatter; import com.google.api.gax.httpjson.ProtoMessageResponseParser; import com.google.api.gax.httpjson.ProtoRestSerializer; import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.RequestParamsBuilder; import com.google.api.gax.rpc.UnaryCallable; import com.google.protobuf.TypeRegistry; import com.google.showcase.v1beta1.EnumRequest; @@ -419,17 +420,47 @@ public class HttpJsonComplianceStub extends ComplianceStub { HttpJsonCallSettings.newBuilder() .setMethodDescriptor(repeatDataSimplePathMethodDescriptor) .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("info.f_bool", String.valueOf(request.getInfo().getFBool())); + builder.add("info.f_double", String.valueOf(request.getInfo().getFDouble())); + builder.add("info.f_int32", String.valueOf(request.getInfo().getFInt32())); + builder.add( + "info.f_kingdom", String.valueOf(request.getInfo().getFKingdomValue())); + builder.add("info.f_string", String.valueOf(request.getInfo().getFString())); + return builder.build(); + }) .build(); HttpJsonCallSettings repeatDataPathResourceTransportSettings = HttpJsonCallSettings.newBuilder() .setMethodDescriptor(repeatDataPathResourceMethodDescriptor) .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("info.f_bool", String.valueOf(request.getInfo().getFBool())); + builder.add( + "info.f_child.f_string", + String.valueOf(request.getInfo().getFChild().getFString())); + builder.add("info.f_string", String.valueOf(request.getInfo().getFString())); + return builder.build(); + }) .build(); HttpJsonCallSettings repeatDataPathTrailingResourceTransportSettings = HttpJsonCallSettings.newBuilder() .setMethodDescriptor(repeatDataPathTrailingResourceMethodDescriptor) .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add( + "info.f_child.f_string", + String.valueOf(request.getInfo().getFChild().getFString())); + builder.add("info.f_string", String.valueOf(request.getInfo().getFString())); + return builder.build(); + }) .build(); HttpJsonCallSettings getEnumTransportSettings = HttpJsonCallSettings.newBuilder() diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/rest/goldens/HttpJsonEchoStub.golden b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/rest/goldens/HttpJsonEchoStub.golden new file mode 100644 index 0000000000..4435118052 --- /dev/null +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/rest/goldens/HttpJsonEchoStub.golden @@ -0,0 +1,665 @@ +package com.google.showcase.v1beta1.stub; + +import static com.google.showcase.v1beta1.EchoClient.PagedExpandPagedResponse; +import static com.google.showcase.v1beta1.EchoClient.SimplePagedExpandPagedResponse; + +import com.google.api.HttpRule; +import com.google.api.core.BetaApi; +import com.google.api.core.InternalApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.httpjson.ApiMethodDescriptor; +import com.google.api.gax.httpjson.HttpJsonCallSettings; +import com.google.api.gax.httpjson.HttpJsonOperationSnapshot; +import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; +import com.google.api.gax.httpjson.ProtoMessageRequestFormatter; +import com.google.api.gax.httpjson.ProtoMessageResponseParser; +import com.google.api.gax.httpjson.ProtoRestSerializer; +import com.google.api.gax.httpjson.longrunning.stub.HttpJsonOperationsStub; +import com.google.api.gax.longrunning.OperationSnapshot; +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.OperationCallable; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.common.collect.ImmutableMap; +import com.google.longrunning.Operation; +import com.google.protobuf.TypeRegistry; +import com.google.showcase.v1beta1.BlockRequest; +import com.google.showcase.v1beta1.BlockResponse; +import com.google.showcase.v1beta1.EchoRequest; +import com.google.showcase.v1beta1.EchoResponse; +import com.google.showcase.v1beta1.ExpandRequest; +import com.google.showcase.v1beta1.Object; +import com.google.showcase.v1beta1.PagedExpandLegacyRequest; +import com.google.showcase.v1beta1.PagedExpandRequest; +import com.google.showcase.v1beta1.PagedExpandResponse; +import com.google.showcase.v1beta1.WaitMetadata; +import com.google.showcase.v1beta1.WaitRequest; +import com.google.showcase.v1beta1.WaitResponse; +import java.io.IOException; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * REST stub implementation for the Echo service API. + * + *

        This class is for advanced usage and reflects the underlying API directly. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class HttpJsonEchoStub extends EchoStub { + private static final TypeRegistry typeRegistry = + TypeRegistry.newBuilder() + .add(WaitResponse.getDescriptor()) + .add(WaitMetadata.getDescriptor()) + .build(); + + private static final ApiMethodDescriptor echoMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.showcase.v1beta1.Echo/Echo") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/echo:echo", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = ProtoRestSerializer.create(); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("*", request.toBuilder().build(), true)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(EchoResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor expandMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.showcase.v1beta1.Echo/Expand") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.SERVER_STREAMING) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/echo:expand", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("*", request.toBuilder().build(), true)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(EchoResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + pagedExpandMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.showcase.v1beta1.Echo/PagedExpand") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/echo:pagedExpand", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("*", request.toBuilder().build(), true)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(PagedExpandResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + simplePagedExpandMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.showcase.v1beta1.Echo/SimplePagedExpand") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/echo:pagedExpand", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("*", request.toBuilder().build(), true)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(PagedExpandResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor waitMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.showcase.v1beta1.Echo/Wait") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/echo:wait", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = ProtoRestSerializer.create(); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("*", request.toBuilder().build(), true)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Operation.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .setOperationSnapshotFactory( + (WaitRequest request, Operation response) -> + HttpJsonOperationSnapshot.create(response)) + .build(); + + private static final ApiMethodDescriptor blockMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.showcase.v1beta1.Echo/Block") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/echo:block", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = ProtoRestSerializer.create(); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("*", request.toBuilder().build(), true)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(BlockResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor collideNameMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.showcase.v1beta1.Echo/CollideName") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/echo:foo", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = ProtoRestSerializer.create(); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("*", request.toBuilder().build(), true)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Object.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + pagedExpandLegacyMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.showcase.v1beta1.Echo/PagedExpandLegacy") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/echo:pagedExpandLegacy", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("*", request.toBuilder().build(), true)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(PagedExpandResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private final UnaryCallable echoCallable; + private final ServerStreamingCallable expandCallable; + private final UnaryCallable pagedExpandCallable; + private final UnaryCallable + pagedExpandPagedCallable; + private final UnaryCallable simplePagedExpandCallable; + private final UnaryCallable + simplePagedExpandPagedCallable; + private final UnaryCallable waitCallable; + private final OperationCallable waitOperationCallable; + private final UnaryCallable blockCallable; + private final UnaryCallable collideNameCallable; + private final UnaryCallable + pagedExpandLegacyCallable; + + private final BackgroundResource backgroundResources; + private final HttpJsonOperationsStub httpJsonOperationsStub; + private final HttpJsonStubCallableFactory callableFactory; + + public static final HttpJsonEchoStub create(EchoStubSettings settings) throws IOException { + return new HttpJsonEchoStub(settings, ClientContext.create(settings)); + } + + public static final HttpJsonEchoStub create(ClientContext clientContext) throws IOException { + return new HttpJsonEchoStub(EchoStubSettings.newBuilder().build(), clientContext); + } + + public static final HttpJsonEchoStub create( + ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { + return new HttpJsonEchoStub( + EchoStubSettings.newBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of HttpJsonEchoStub, 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 HttpJsonEchoStub(EchoStubSettings settings, ClientContext clientContext) + throws IOException { + this(settings, clientContext, new HttpJsonEchoCallableFactory()); + } + + /** + * Constructs an instance of HttpJsonEchoStub, 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 HttpJsonEchoStub( + EchoStubSettings settings, + ClientContext clientContext, + HttpJsonStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + this.httpJsonOperationsStub = + HttpJsonOperationsStub.create( + clientContext, + callableFactory, + typeRegistry, + ImmutableMap.builder() + .put( + "google.longrunning.Operations.CancelOperation", + HttpRule.newBuilder() + .setPost("/v1beta1/{name=operations/**}:cancel") + .addAdditionalBindings( + HttpRule.newBuilder() + .setPost("/v1beta2/{name=operations/**}:cancel") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setPost("/v1beta3/{name=operations/**}:cancel") + .build()) + .build()) + .put( + "google.longrunning.Operations.DeleteOperation", + HttpRule.newBuilder() + .setDelete("/v1beta1/{name=operations/**}") + .addAdditionalBindings( + HttpRule.newBuilder() + .setDelete("/v1beta2/{name=operations/**}") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setDelete("/v1beta3/{name=operations/**}") + .build()) + .build()) + .put( + "google.longrunning.Operations.GetOperation", + HttpRule.newBuilder() + .setGet("/v1beta1/{name=operations/**}") + .addAdditionalBindings( + HttpRule.newBuilder().setGet("/v1beta2/{name=operations/**}").build()) + .addAdditionalBindings( + HttpRule.newBuilder().setGet("/v1beta3/{name=operations/**}").build()) + .build()) + .put( + "google.longrunning.Operations.ListOperations", + HttpRule.newBuilder() + .setGet("/v1beta1/operations") + .addAdditionalBindings( + HttpRule.newBuilder().setGet("/v1beta2/operations").build()) + .addAdditionalBindings( + HttpRule.newBuilder().setGet("/v1beta3/operations").build()) + .build()) + .build()); + + HttpJsonCallSettings echoTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(echoMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setResourceNameExtractor(request -> request.getName()) + .build(); + HttpJsonCallSettings expandTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(expandMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings pagedExpandTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(pagedExpandMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings + simplePagedExpandTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(simplePagedExpandMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings waitTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(waitMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings blockTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(blockMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings collideNameTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(collideNameMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setResourceNameExtractor(request -> request.getName()) + .build(); + HttpJsonCallSettings + pagedExpandLegacyTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(pagedExpandLegacyMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + + this.echoCallable = + callableFactory.createUnaryCallable( + echoTransportSettings, settings.echoSettings(), clientContext); + this.expandCallable = + callableFactory.createServerStreamingCallable( + expandTransportSettings, settings.expandSettings(), clientContext); + this.pagedExpandCallable = + callableFactory.createUnaryCallable( + pagedExpandTransportSettings, settings.pagedExpandSettings(), clientContext); + this.pagedExpandPagedCallable = + callableFactory.createPagedCallable( + pagedExpandTransportSettings, settings.pagedExpandSettings(), clientContext); + this.simplePagedExpandCallable = + callableFactory.createUnaryCallable( + simplePagedExpandTransportSettings, + settings.simplePagedExpandSettings(), + clientContext); + this.simplePagedExpandPagedCallable = + callableFactory.createPagedCallable( + simplePagedExpandTransportSettings, + settings.simplePagedExpandSettings(), + clientContext); + this.waitCallable = + callableFactory.createUnaryCallable( + waitTransportSettings, settings.waitSettings(), clientContext); + this.waitOperationCallable = + callableFactory.createOperationCallable( + waitTransportSettings, + settings.waitOperationSettings(), + clientContext, + httpJsonOperationsStub); + this.blockCallable = + callableFactory.createUnaryCallable( + blockTransportSettings, settings.blockSettings(), clientContext); + this.collideNameCallable = + callableFactory.createUnaryCallable( + collideNameTransportSettings, settings.collideNameSettings(), clientContext); + this.pagedExpandLegacyCallable = + callableFactory.createUnaryCallable( + pagedExpandLegacyTransportSettings, + settings.pagedExpandLegacySettings(), + clientContext); + + this.backgroundResources = + new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + @InternalApi + public static List getMethodDescriptors() { + List methodDescriptors = new ArrayList<>(); + methodDescriptors.add(echoMethodDescriptor); + methodDescriptors.add(expandMethodDescriptor); + methodDescriptors.add(pagedExpandMethodDescriptor); + methodDescriptors.add(simplePagedExpandMethodDescriptor); + methodDescriptors.add(waitMethodDescriptor); + methodDescriptors.add(blockMethodDescriptor); + methodDescriptors.add(collideNameMethodDescriptor); + methodDescriptors.add(pagedExpandLegacyMethodDescriptor); + return methodDescriptors; + } + + public HttpJsonOperationsStub getHttpJsonOperationsStub() { + return httpJsonOperationsStub; + } + + @Override + public UnaryCallable echoCallable() { + return echoCallable; + } + + @Override + public ServerStreamingCallable expandCallable() { + return expandCallable; + } + + @Override + public UnaryCallable pagedExpandCallable() { + return pagedExpandCallable; + } + + @Override + public UnaryCallable pagedExpandPagedCallable() { + return pagedExpandPagedCallable; + } + + @Override + public UnaryCallable simplePagedExpandCallable() { + return simplePagedExpandCallable; + } + + @Override + public UnaryCallable + simplePagedExpandPagedCallable() { + return simplePagedExpandPagedCallable; + } + + @Override + public UnaryCallable waitCallable() { + return waitCallable; + } + + @Override + public OperationCallable waitOperationCallable() { + return waitOperationCallable; + } + + @Override + public UnaryCallable blockCallable() { + return blockCallable; + } + + @Override + public UnaryCallable collideNameCallable() { + return collideNameCallable; + } + + @Override + public UnaryCallable pagedExpandLegacyCallable() { + return pagedExpandLegacyCallable; + } + + @Override + public ClientStreamingCallable collectCallable() { + throw new UnsupportedOperationException( + "Not implemented: collectCallable(). REST transport is not implemented for this method yet."); + } + + @Override + public BidiStreamingCallable chatCallable() { + throw new UnsupportedOperationException( + "Not implemented: chatCallable(). REST transport is not implemented for this method yet."); + } + + @Override + public BidiStreamingCallable chatAgainCallable() { + throw new UnsupportedOperationException( + "Not implemented: chatAgainCallable(). REST transport is not implemented for this method yet."); + } + + @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/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/rest/goldens/HttpJsonEchoStubSettings.golden b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/rest/goldens/HttpJsonEchoStubSettings.golden new file mode 100644 index 0000000000..0c788d7ebd --- /dev/null +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/rest/goldens/HttpJsonEchoStubSettings.golden @@ -0,0 +1,635 @@ +package com.google.showcase.v1beta1.stub; + +import static com.google.showcase.v1beta1.EchoClient.PagedExpandPagedResponse; +import static com.google.showcase.v1beta1.EchoClient.SimplePagedExpandPagedResponse; + +import com.google.api.core.ApiFunction; +import com.google.api.core.ApiFuture; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.GaxProperties; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.HttpJsonTransportChannel; +import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; +import com.google.api.gax.httpjson.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.ServerStreamingCallSettings; +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.longrunning.Operation; +import com.google.showcase.v1beta1.BlockRequest; +import com.google.showcase.v1beta1.BlockResponse; +import com.google.showcase.v1beta1.EchoRequest; +import com.google.showcase.v1beta1.EchoResponse; +import com.google.showcase.v1beta1.ExpandRequest; +import com.google.showcase.v1beta1.Object; +import com.google.showcase.v1beta1.PagedExpandRequest; +import com.google.showcase.v1beta1.PagedExpandResponse; +import com.google.showcase.v1beta1.WaitMetadata; +import com.google.showcase.v1beta1.WaitRequest; +import com.google.showcase.v1beta1.WaitResponse; +import java.io.IOException; +import java.util.List; +import javax.annotation.Generated; +import org.threeten.bp.Duration; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Settings class to configure an instance of {@link EchoStub}. + * + *

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

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

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

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

        {@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
        + * EchoStubSettings.Builder echoSettingsBuilder = EchoStubSettings.newBuilder();
        + * echoSettingsBuilder
        + *     .echoSettings()
        + *     .setRetrySettings(
        + *         echoSettingsBuilder
        + *             .echoSettings()
        + *             .getRetrySettings()
        + *             .toBuilder()
        + *             .setTotalTimeout(Duration.ofSeconds(30))
        + *             .build());
        + * EchoStubSettings echoSettings = echoSettingsBuilder.build();
        + * }
        + */ +@BetaApi +@Generated("by gapic-generator-java") +public class EchoStubSettings extends StubSettings { + /** The default scopes of the service. */ + private static final ImmutableList DEFAULT_SERVICE_SCOPES = + ImmutableList.builder().add("https://www.googleapis.com/auth/cloud-platform").build(); + + private final UnaryCallSettings echoSettings; + private final ServerStreamingCallSettings expandSettings; + private final StreamingCallSettings collectSettings; + private final StreamingCallSettings chatSettings; + private final StreamingCallSettings chatAgainSettings; + private final PagedCallSettings + pagedExpandSettings; + private final PagedCallSettings< + PagedExpandRequest, PagedExpandResponse, SimplePagedExpandPagedResponse> + simplePagedExpandSettings; + private final UnaryCallSettings waitSettings; + private final OperationCallSettings + waitOperationSettings; + private final UnaryCallSettings blockSettings; + private final UnaryCallSettings collideNameSettings; + + private static final PagedListDescriptor + PAGED_EXPAND_PAGE_STR_DESC = + new PagedListDescriptor() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public PagedExpandRequest injectToken(PagedExpandRequest payload, String token) { + return PagedExpandRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public PagedExpandRequest injectPageSize(PagedExpandRequest payload, int pageSize) { + return PagedExpandRequest.newBuilder(payload).setPageSize(pageSize).build(); + } + + @Override + public Integer extractPageSize(PagedExpandRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(PagedExpandResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources(PagedExpandResponse payload) { + return payload.getResponsesList() == null + ? ImmutableList.of() + : payload.getResponsesList(); + } + }; + + private static final PagedListDescriptor + SIMPLE_PAGED_EXPAND_PAGE_STR_DESC = + new PagedListDescriptor() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public PagedExpandRequest injectToken(PagedExpandRequest payload, String token) { + return PagedExpandRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public PagedExpandRequest injectPageSize(PagedExpandRequest payload, int pageSize) { + return PagedExpandRequest.newBuilder(payload).setPageSize(pageSize).build(); + } + + @Override + public Integer extractPageSize(PagedExpandRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(PagedExpandResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources(PagedExpandResponse payload) { + return payload.getResponsesList() == null + ? ImmutableList.of() + : payload.getResponsesList(); + } + }; + + private static final PagedListResponseFactory< + PagedExpandRequest, PagedExpandResponse, PagedExpandPagedResponse> + PAGED_EXPAND_PAGE_STR_FACT = + new PagedListResponseFactory< + PagedExpandRequest, PagedExpandResponse, PagedExpandPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + PagedExpandRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext pageContext = + PageContext.create(callable, PAGED_EXPAND_PAGE_STR_DESC, request, context); + return PagedExpandPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + private static final PagedListResponseFactory< + PagedExpandRequest, PagedExpandResponse, SimplePagedExpandPagedResponse> + SIMPLE_PAGED_EXPAND_PAGE_STR_FACT = + new PagedListResponseFactory< + PagedExpandRequest, PagedExpandResponse, SimplePagedExpandPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + PagedExpandRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext pageContext = + PageContext.create(callable, SIMPLE_PAGED_EXPAND_PAGE_STR_DESC, request, context); + return SimplePagedExpandPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + /** Returns the object with the settings used for calls to echo. */ + public UnaryCallSettings echoSettings() { + return echoSettings; + } + + /** Returns the object with the settings used for calls to expand. */ + public ServerStreamingCallSettings expandSettings() { + return expandSettings; + } + + /** Returns the object with the settings used for calls to collect. */ + public StreamingCallSettings collectSettings() { + return collectSettings; + } + + /** Returns the object with the settings used for calls to chat. */ + public StreamingCallSettings chatSettings() { + return chatSettings; + } + + /** Returns the object with the settings used for calls to chatAgain. */ + public StreamingCallSettings chatAgainSettings() { + return chatAgainSettings; + } + + /** Returns the object with the settings used for calls to pagedExpand. */ + public PagedCallSettings + pagedExpandSettings() { + return pagedExpandSettings; + } + + /** Returns the object with the settings used for calls to simplePagedExpand. */ + public PagedCallSettings + simplePagedExpandSettings() { + return simplePagedExpandSettings; + } + + /** Returns the object with the settings used for calls to wait. */ + public UnaryCallSettings waitSettings() { + return waitSettings; + } + + /** Returns the object with the settings used for calls to wait. */ + public OperationCallSettings waitOperationSettings() { + return waitOperationSettings; + } + + /** Returns the object with the settings used for calls to block. */ + public UnaryCallSettings blockSettings() { + return blockSettings; + } + + /** Returns the object with the settings used for calls to collideName. */ + public UnaryCallSettings collideNameSettings() { + return collideNameSettings; + } + + public EchoStub createStub() throws IOException { + if (getTransportChannelProvider() + .getTransportName() + .equals(HttpJsonTransportChannel.getHttpJsonTransportName())) { + return HttpJsonEchoStub.create(this); + } + throw new UnsupportedOperationException( + String.format( + "Transport not supported: %s", getTransportChannelProvider().getTransportName())); + } + + /** Returns a builder for the default ExecutorProvider for this service. */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return InstantiatingExecutorProvider.newBuilder(); + } + + /** Returns the default service endpoint. */ + public static String getDefaultEndpoint() { + return "localhost:7469"; + } + + /** Returns the default mTLS service endpoint. */ + public static String getDefaultMtlsEndpoint() { + return "localhost:7469"; + } + + /** 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 InstantiatingHttpJsonChannelProvider.Builder + defaultHttpJsonTransportProviderBuilder() { + return InstantiatingHttpJsonChannelProvider.newBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return defaultHttpJsonTransportProviderBuilder().build(); + } + + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken("gapic", GaxProperties.getLibraryVersion(EchoStubSettings.class)) + .setTransportToken( + GaxHttpJsonProperties.getHttpJsonTokenName(), + GaxHttpJsonProperties.getHttpJsonVersion()); + } + + /** 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 EchoStubSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + + echoSettings = settingsBuilder.echoSettings().build(); + expandSettings = settingsBuilder.expandSettings().build(); + collectSettings = settingsBuilder.collectSettings().build(); + chatSettings = settingsBuilder.chatSettings().build(); + chatAgainSettings = settingsBuilder.chatAgainSettings().build(); + pagedExpandSettings = settingsBuilder.pagedExpandSettings().build(); + simplePagedExpandSettings = settingsBuilder.simplePagedExpandSettings().build(); + waitSettings = settingsBuilder.waitSettings().build(); + waitOperationSettings = settingsBuilder.waitOperationSettings().build(); + blockSettings = settingsBuilder.blockSettings().build(); + collideNameSettings = settingsBuilder.collideNameSettings().build(); + } + + /** Builder for EchoStubSettings. */ + public static class Builder extends StubSettings.Builder { + private final ImmutableList> unaryMethodSettingsBuilders; + private final UnaryCallSettings.Builder echoSettings; + private final ServerStreamingCallSettings.Builder expandSettings; + private final StreamingCallSettings.Builder collectSettings; + private final StreamingCallSettings.Builder chatSettings; + private final StreamingCallSettings.Builder chatAgainSettings; + private final PagedCallSettings.Builder< + PagedExpandRequest, PagedExpandResponse, PagedExpandPagedResponse> + pagedExpandSettings; + private final PagedCallSettings.Builder< + PagedExpandRequest, PagedExpandResponse, SimplePagedExpandPagedResponse> + simplePagedExpandSettings; + private final UnaryCallSettings.Builder waitSettings; + private final OperationCallSettings.Builder + waitOperationSettings; + private final UnaryCallSettings.Builder blockSettings; + private final UnaryCallSettings.Builder collideNameSettings; + 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.UNAVAILABLE, StatusCode.Code.UNKNOWN))); + 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() + .setInitialRetryDelay(Duration.ofMillis(100L)) + .setRetryDelayMultiplier(2.0) + .setMaxRetryDelay(Duration.ofMillis(3000L)) + .setInitialRpcTimeout(Duration.ofMillis(10000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ofMillis(10000L)) + .setTotalTimeout(Duration.ofMillis(10000L)) + .build(); + definitions.put("retry_policy_1_params", settings); + settings = + RetrySettings.newBuilder() + .setInitialRpcTimeout(Duration.ofMillis(5000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ofMillis(5000L)) + .setTotalTimeout(Duration.ofMillis(5000L)) + .build(); + definitions.put("no_retry_0_params", settings); + RETRY_PARAM_DEFINITIONS = definitions.build(); + } + + protected Builder() { + this(((ClientContext) null)); + } + + protected Builder(ClientContext clientContext) { + super(clientContext); + + echoSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + expandSettings = ServerStreamingCallSettings.newBuilder(); + collectSettings = StreamingCallSettings.newBuilder(); + chatSettings = StreamingCallSettings.newBuilder(); + chatAgainSettings = StreamingCallSettings.newBuilder(); + pagedExpandSettings = PagedCallSettings.newBuilder(PAGED_EXPAND_PAGE_STR_FACT); + simplePagedExpandSettings = PagedCallSettings.newBuilder(SIMPLE_PAGED_EXPAND_PAGE_STR_FACT); + waitSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + waitOperationSettings = OperationCallSettings.newBuilder(); + blockSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + collideNameSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + echoSettings, + pagedExpandSettings, + simplePagedExpandSettings, + waitSettings, + blockSettings, + collideNameSettings); + initDefaults(this); + } + + protected Builder(EchoStubSettings settings) { + super(settings); + + echoSettings = settings.echoSettings.toBuilder(); + expandSettings = settings.expandSettings.toBuilder(); + collectSettings = settings.collectSettings.toBuilder(); + chatSettings = settings.chatSettings.toBuilder(); + chatAgainSettings = settings.chatAgainSettings.toBuilder(); + pagedExpandSettings = settings.pagedExpandSettings.toBuilder(); + simplePagedExpandSettings = settings.simplePagedExpandSettings.toBuilder(); + waitSettings = settings.waitSettings.toBuilder(); + waitOperationSettings = settings.waitOperationSettings.toBuilder(); + blockSettings = settings.blockSettings.toBuilder(); + collideNameSettings = settings.collideNameSettings.toBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + echoSettings, + pagedExpandSettings, + simplePagedExpandSettings, + waitSettings, + blockSettings, + collideNameSettings); + } + + 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 + .echoSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")); + + builder + .expandSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")); + + builder + .pagedExpandSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")); + + builder + .simplePagedExpandSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + + builder + .waitSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + + builder + .blockSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + + builder + .collideNameSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + + builder + .waitOperationSettings() + .setInitialCallSettings( + UnaryCallSettings.newUnaryCallSettingsBuilder() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")) + .build()) + .setResponseTransformer( + ProtoOperationTransformers.ResponseTransformer.create(WaitResponse.class)) + .setMetadataTransformer( + ProtoOperationTransformers.MetadataTransformer.create(WaitMetadata.class)) + .setPollingAlgorithm( + OperationTimedPollAlgorithm.create( + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(5000L)) + .setRetryDelayMultiplier(1.5) + .setMaxRetryDelay(Duration.ofMillis(45000L)) + .setInitialRpcTimeout(Duration.ZERO) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ZERO) + .setTotalTimeout(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 echo. */ + public UnaryCallSettings.Builder echoSettings() { + return echoSettings; + } + + /** Returns the builder for the settings used for calls to expand. */ + public ServerStreamingCallSettings.Builder expandSettings() { + return expandSettings; + } + + /** Returns the builder for the settings used for calls to collect. */ + public StreamingCallSettings.Builder collectSettings() { + return collectSettings; + } + + /** Returns the builder for the settings used for calls to chat. */ + public StreamingCallSettings.Builder chatSettings() { + return chatSettings; + } + + /** Returns the builder for the settings used for calls to chatAgain. */ + public StreamingCallSettings.Builder chatAgainSettings() { + return chatAgainSettings; + } + + /** Returns the builder for the settings used for calls to pagedExpand. */ + public PagedCallSettings.Builder< + PagedExpandRequest, PagedExpandResponse, PagedExpandPagedResponse> + pagedExpandSettings() { + return pagedExpandSettings; + } + + /** Returns the builder for the settings used for calls to simplePagedExpand. */ + public PagedCallSettings.Builder< + PagedExpandRequest, PagedExpandResponse, SimplePagedExpandPagedResponse> + simplePagedExpandSettings() { + return simplePagedExpandSettings; + } + + /** Returns the builder for the settings used for calls to wait. */ + public UnaryCallSettings.Builder waitSettings() { + return waitSettings; + } + + /** Returns the builder for the settings used for calls to wait. */ + public OperationCallSettings.Builder + waitOperationSettings() { + return waitOperationSettings; + } + + /** Returns the builder for the settings used for calls to block. */ + public UnaryCallSettings.Builder blockSettings() { + return blockSettings; + } + + /** Returns the builder for the settings used for calls to collideName. */ + public UnaryCallSettings.Builder collideNameSettings() { + return collideNameSettings; + } + + @Override + public EchoStubSettings build() throws IOException { + return new EchoStubSettings(this); + } + } +} diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/rest/goldens/HttpJsonResourceNameExtractorStub.golden b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/rest/goldens/HttpJsonResourceNameExtractorStub.golden new file mode 100644 index 0000000000..c3296eb841 --- /dev/null +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/rest/goldens/HttpJsonResourceNameExtractorStub.golden @@ -0,0 +1,295 @@ +package com.google.extractor.testing.stub; + +import com.google.api.core.InternalApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.httpjson.ApiMethodDescriptor; +import com.google.api.gax.httpjson.HttpJsonCallSettings; +import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; +import com.google.api.gax.httpjson.ProtoMessageRequestFormatter; +import com.google.api.gax.httpjson.ProtoMessageResponseParser; +import com.google.api.gax.httpjson.ProtoRestSerializer; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.RequestParamsBuilder; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.extractor.testing.Bar; +import com.google.extractor.testing.Foo; +import com.google.extractor.testing.GetBarRequest; +import com.google.extractor.testing.GetFooRequest; +import com.google.extractor.testing.ListFoosRequest; +import com.google.extractor.testing.ListFoosResponse; +import com.google.protobuf.TypeRegistry; +import java.io.IOException; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * REST stub implementation for the ResourceNameExtractorTesting service API. + * + *

        This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by gapic-generator-java") +public class HttpJsonResourceNameExtractorTestingStub extends ResourceNameExtractorTestingStub { + private static final TypeRegistry typeRegistry = TypeRegistry.newBuilder().build(); + + private static final ApiMethodDescriptor getFooMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.extractor.testing.ResourceNameExtractorTesting/GetFoo") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{name=projects/*/locations/*/foos/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Foo.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor getBarMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.extractor.testing.ResourceNameExtractorTesting/GetBar") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{bar=projects/*/locations/*/bars/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "bar", request.getBar()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Bar.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + listFoosMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.extractor.testing.ResourceNameExtractorTesting/ListFoos") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{parent=projects/*/locations/*}/foos", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "parent", request.getParent()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(ListFoosResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private final UnaryCallable getFooCallable; + private final UnaryCallable getBarCallable; + private final UnaryCallable listFoosCallable; + + private final BackgroundResource backgroundResources; + private final HttpJsonStubCallableFactory callableFactory; + + public static final HttpJsonResourceNameExtractorTestingStub create( + ResourceNameExtractorTestingStubSettings settings) throws IOException { + return new HttpJsonResourceNameExtractorTestingStub(settings, ClientContext.create(settings)); + } + + public static final HttpJsonResourceNameExtractorTestingStub create(ClientContext clientContext) + throws IOException { + return new HttpJsonResourceNameExtractorTestingStub( + ResourceNameExtractorTestingStubSettings.newBuilder().build(), clientContext); + } + + public static final HttpJsonResourceNameExtractorTestingStub create( + ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { + return new HttpJsonResourceNameExtractorTestingStub( + ResourceNameExtractorTestingStubSettings.newBuilder().build(), + clientContext, + callableFactory); + } + + /** + * Constructs an instance of HttpJsonResourceNameExtractorTestingStub, 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 HttpJsonResourceNameExtractorTestingStub( + ResourceNameExtractorTestingStubSettings settings, ClientContext clientContext) + throws IOException { + this(settings, clientContext, new HttpJsonResourceNameExtractorTestingCallableFactory()); + } + + /** + * Constructs an instance of HttpJsonResourceNameExtractorTestingStub, 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 HttpJsonResourceNameExtractorTestingStub( + ResourceNameExtractorTestingStubSettings settings, + ClientContext clientContext, + HttpJsonStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + + HttpJsonCallSettings getFooTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getFooMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .setResourceNameExtractor(request -> request.getName()) + .build(); + HttpJsonCallSettings getBarTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getBarMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("bar", String.valueOf(request.getBar())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings listFoosTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(listFoosMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .setResourceNameExtractor(request -> request.getParent()) + .build(); + + this.getFooCallable = + callableFactory.createUnaryCallable( + getFooTransportSettings, settings.getFooSettings(), clientContext); + this.getBarCallable = + callableFactory.createUnaryCallable( + getBarTransportSettings, settings.getBarSettings(), clientContext); + this.listFoosCallable = + callableFactory.createUnaryCallable( + listFoosTransportSettings, settings.listFoosSettings(), clientContext); + + this.backgroundResources = + new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + @InternalApi + public static List getMethodDescriptors() { + List methodDescriptors = new ArrayList<>(); + methodDescriptors.add(getFooMethodDescriptor); + methodDescriptors.add(getBarMethodDescriptor); + methodDescriptors.add(listFoosMethodDescriptor); + return methodDescriptors; + } + + @Override + public UnaryCallable getFooCallable() { + return getFooCallable; + } + + @Override + public UnaryCallable getBarCallable() { + return getBarCallable; + } + + @Override + public UnaryCallable listFoosCallable() { + return listFoosCallable; + } + + @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/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/rest/goldens/HttpJsonRoutingHeadersStub.golden b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/rest/goldens/HttpJsonRoutingHeadersStub.golden new file mode 100644 index 0000000000..b377fe3a18 --- /dev/null +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/rest/goldens/HttpJsonRoutingHeadersStub.golden @@ -0,0 +1,435 @@ +package com.google.explicit.dynamic.routing.header.stub; + +import com.google.api.core.InternalApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.httpjson.ApiMethodDescriptor; +import com.google.api.gax.httpjson.HttpJsonCallSettings; +import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; +import com.google.api.gax.httpjson.ProtoMessageRequestFormatter; +import com.google.api.gax.httpjson.ProtoMessageResponseParser; +import com.google.api.gax.httpjson.ProtoRestSerializer; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.RequestParamsBuilder; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.api.pathtemplate.PathTemplate; +import com.google.explicit.dynamic.routing.header.EnumRequest; +import com.google.explicit.dynamic.routing.header.EnumResponse; +import com.google.explicit.dynamic.routing.header.Request; +import com.google.explicit.dynamic.routing.header.RequestWithNestedField; +import com.google.protobuf.Empty; +import com.google.protobuf.TypeRegistry; +import java.io.IOException; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * REST stub implementation for the ExplicitDynamicRoutingHeaderTesting service API. + * + *

        This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by gapic-generator-java") +public class HttpJsonExplicitDynamicRoutingHeaderTestingStub + extends ExplicitDynamicRoutingHeaderTestingStub { + private static final TypeRegistry typeRegistry = TypeRegistry.newBuilder().build(); + + private static final ApiMethodDescriptor + backwardsCompatible1TestMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName( + "google.explicit.dynamic.routing.header.ExplicitDynamicRoutingHeaderTesting/BackwardsCompatible1Test") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/{tableName=tests/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = ProtoRestSerializer.create(); + serializer.putPathParam(fields, "tableName", request.getTableName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = ProtoRestSerializer.create(); + serializer.putQueryParam( + fields, "appProfileId", request.getAppProfileId()); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Empty.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + backwardsCompatible2TestMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName( + "google.explicit.dynamic.routing.header.ExplicitDynamicRoutingHeaderTesting/BackwardsCompatible2Test") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/{tableName=tests/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = ProtoRestSerializer.create(); + serializer.putPathParam(fields, "tableName", request.getTableName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = ProtoRestSerializer.create(); + serializer.putQueryParam( + fields, "appProfileId", request.getAppProfileId()); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Empty.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + backwardsCompatible3TestMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName( + "google.explicit.dynamic.routing.header.ExplicitDynamicRoutingHeaderTesting/BackwardsCompatible3Test") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/{tableName=tests/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = ProtoRestSerializer.create(); + serializer.putPathParam(fields, "tableName", request.getTableName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = ProtoRestSerializer.create(); + serializer.putQueryParam( + fields, "appProfileId", request.getAppProfileId()); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Empty.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + implicitRoutingHeaderWithEnumTestMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName( + "google.explicit.dynamic.routing.header.ExplicitDynamicRoutingHeaderTesting/ImplicitRoutingHeaderWithEnumTest") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/{info.enumTest}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam( + fields, "info.enumTest", request.getInfo().getEnumTestValue()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("*", request.toBuilder().build(), false)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(EnumResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private final UnaryCallable backwardsCompatible1TestCallable; + private final UnaryCallable backwardsCompatible2TestCallable; + private final UnaryCallable backwardsCompatible3TestCallable; + private final UnaryCallable implicitRoutingHeaderWithEnumTestCallable; + + private final BackgroundResource backgroundResources; + private final HttpJsonStubCallableFactory callableFactory; + + private static final PathTemplate BACKWARDS_COMPATIBLE1_TEST_0_PATH_TEMPLATE = + PathTemplate.create("{routing_id=projects/*}/**"); + + public static final HttpJsonExplicitDynamicRoutingHeaderTestingStub create( + ExplicitDynamicRoutingHeaderTestingStubSettings settings) throws IOException { + return new HttpJsonExplicitDynamicRoutingHeaderTestingStub( + settings, ClientContext.create(settings)); + } + + public static final HttpJsonExplicitDynamicRoutingHeaderTestingStub create( + ClientContext clientContext) throws IOException { + return new HttpJsonExplicitDynamicRoutingHeaderTestingStub( + ExplicitDynamicRoutingHeaderTestingStubSettings.newBuilder().build(), clientContext); + } + + public static final HttpJsonExplicitDynamicRoutingHeaderTestingStub create( + ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { + return new HttpJsonExplicitDynamicRoutingHeaderTestingStub( + ExplicitDynamicRoutingHeaderTestingStubSettings.newBuilder().build(), + clientContext, + callableFactory); + } + + /** + * Constructs an instance of HttpJsonExplicitDynamicRoutingHeaderTestingStub, 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 HttpJsonExplicitDynamicRoutingHeaderTestingStub( + ExplicitDynamicRoutingHeaderTestingStubSettings settings, ClientContext clientContext) + throws IOException { + this(settings, clientContext, new HttpJsonExplicitDynamicRoutingHeaderTestingCallableFactory()); + } + + /** + * Constructs an instance of HttpJsonExplicitDynamicRoutingHeaderTestingStub, 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 HttpJsonExplicitDynamicRoutingHeaderTestingStub( + ExplicitDynamicRoutingHeaderTestingStubSettings settings, + ClientContext clientContext, + HttpJsonStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + + HttpJsonCallSettings backwardsCompatible1TestTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(backwardsCompatible1TestMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add( + request.getTableName(), + "routing_id", + BACKWARDS_COMPATIBLE1_TEST_0_PATH_TEMPLATE); + return builder.build(); + }) + .build(); + HttpJsonCallSettings backwardsCompatible2TestTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(backwardsCompatible2TestMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings backwardsCompatible3TestTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(backwardsCompatible3TestMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("table_name", String.valueOf(request.getTableName())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings + implicitRoutingHeaderWithEnumTestTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(implicitRoutingHeaderWithEnumTestMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add( + "info.enum_test", String.valueOf(request.getInfo().getEnumTestValue())); + return builder.build(); + }) + .build(); + + this.backwardsCompatible1TestCallable = + callableFactory.createUnaryCallable( + backwardsCompatible1TestTransportSettings, + settings.backwardsCompatible1TestSettings(), + clientContext); + this.backwardsCompatible2TestCallable = + callableFactory.createUnaryCallable( + backwardsCompatible2TestTransportSettings, + settings.backwardsCompatible2TestSettings(), + clientContext); + this.backwardsCompatible3TestCallable = + callableFactory.createUnaryCallable( + backwardsCompatible3TestTransportSettings, + settings.backwardsCompatible3TestSettings(), + clientContext); + this.implicitRoutingHeaderWithEnumTestCallable = + callableFactory.createUnaryCallable( + implicitRoutingHeaderWithEnumTestTransportSettings, + settings.implicitRoutingHeaderWithEnumTestSettings(), + clientContext); + + this.backgroundResources = + new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + @InternalApi + public static List getMethodDescriptors() { + List methodDescriptors = new ArrayList<>(); + methodDescriptors.add(backwardsCompatible1TestMethodDescriptor); + methodDescriptors.add(backwardsCompatible2TestMethodDescriptor); + methodDescriptors.add(backwardsCompatible3TestMethodDescriptor); + methodDescriptors.add(implicitRoutingHeaderWithEnumTestMethodDescriptor); + return methodDescriptors; + } + + @Override + public UnaryCallable backwardsCompatible1TestCallable() { + return backwardsCompatible1TestCallable; + } + + @Override + public UnaryCallable backwardsCompatible2TestCallable() { + return backwardsCompatible2TestCallable; + } + + @Override + public UnaryCallable backwardsCompatible3TestCallable() { + return backwardsCompatible3TestCallable; + } + + @Override + public UnaryCallable implicitRoutingHeaderWithEnumTestCallable() { + return implicitRoutingHeaderWithEnumTestCallable; + } + + @Override + public UnaryCallable example1TestCallable() { + throw new UnsupportedOperationException( + "Not implemented: example1TestCallable(). REST transport is not implemented for this method yet."); + } + + @Override + public UnaryCallable example2TestCallable() { + throw new UnsupportedOperationException( + "Not implemented: example2TestCallable(). REST transport is not implemented for this method yet."); + } + + @Override + public UnaryCallable example3TestCallable() { + throw new UnsupportedOperationException( + "Not implemented: example3TestCallable(). REST transport is not implemented for this method yet."); + } + + @Override + public UnaryCallable example3CTestCallable() { + throw new UnsupportedOperationException( + "Not implemented: example3CTestCallable(). REST transport is not implemented for this method yet."); + } + + @Override + public UnaryCallable example4TestCallable() { + throw new UnsupportedOperationException( + "Not implemented: example4TestCallable(). REST transport is not implemented for this method yet."); + } + + @Override + public UnaryCallable example5TestCallable() { + throw new UnsupportedOperationException( + "Not implemented: example5TestCallable(). REST transport is not implemented for this method yet."); + } + + @Override + public UnaryCallable example6TestCallable() { + throw new UnsupportedOperationException( + "Not implemented: example6TestCallable(). REST transport is not implemented for this method yet."); + } + + @Override + public UnaryCallable example7TestCallable() { + throw new UnsupportedOperationException( + "Not implemented: example7TestCallable(). REST transport is not implemented for this method yet."); + } + + @Override + public UnaryCallable example8TestCallable() { + throw new UnsupportedOperationException( + "Not implemented: example8TestCallable(). REST transport is not implemented for this method yet."); + } + + @Override + public UnaryCallable example9TestCallable() { + throw new UnsupportedOperationException( + "Not implemented: example9TestCallable(). REST transport is not implemented for this method yet."); + } + + @Override + public UnaryCallable nestedFieldTestCallable() { + throw new UnsupportedOperationException( + "Not implemented: nestedFieldTestCallable(). REST transport is not implemented for this method yet."); + } + + @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/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/samplecode/SampleBodyJavaFormatterTest.java b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/samplecode/SampleBodyJavaFormatterTest.java index 3947bb5894..bdeda049c3 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/samplecode/SampleBodyJavaFormatterTest.java +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/samplecode/SampleBodyJavaFormatterTest.java @@ -17,13 +17,13 @@ import static junit.framework.TestCase.assertEquals; import static org.junit.Assert.assertThrows; -import com.google.api.generator.testutils.LineFormatter; -import org.junit.Test; +import com.google.api.generator.test.utils.LineFormatter; +import org.junit.jupiter.api.Test; -public class SampleBodyJavaFormatterTest { +class SampleBodyJavaFormatterTest { @Test - public void validFormatSampleCode_tryCatchStatement() { + void validFormatSampleCode_tryCatchStatement() { String samplecode = LineFormatter.lines("try(boolean condition = false){", "int x = 3;", "}"); String result = SampleBodyJavaFormatter.format(samplecode); String expected = @@ -32,7 +32,7 @@ public void validFormatSampleCode_tryCatchStatement() { } @Test - public void validFormatSampleCode_longLineStatement() { + void validFormatSampleCode_longLineStatement() { String sampleCode = "SubscriptionAdminSettings subscriptionAdminSettings = " + "SubscriptionAdminSettings.newBuilder().setEndpoint(myEndpoint).build();"; @@ -45,7 +45,7 @@ public void validFormatSampleCode_longLineStatement() { } @Test - public void validFormatSampleCode_longChainMethod() { + void validFormatSampleCode_longChainMethod() { String sampleCode = "echoSettingsBuilder.echoSettings().setRetrySettings(" + "echoSettingsBuilder.echoSettings().getRetrySettings().toBuilder()" @@ -66,7 +66,7 @@ public void validFormatSampleCode_longChainMethod() { } @Test - public void invalidFormatSampleCode_nonStatement() { + void invalidFormatSampleCode_nonStatement() { assertThrows( SampleBodyJavaFormatter.FormatException.class, () -> { diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/samplecode/SampleCodeWriterTest.java b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/samplecode/SampleCodeWriterTest.java index d34c2d6714..820fa739a1 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/samplecode/SampleCodeWriterTest.java +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/samplecode/SampleCodeWriterTest.java @@ -30,21 +30,21 @@ import com.google.api.generator.engine.ast.VariableExpr; import com.google.api.generator.gapic.model.RegionTag; import com.google.api.generator.gapic.model.Sample; -import com.google.api.generator.testutils.LineFormatter; +import com.google.api.generator.test.utils.LineFormatter; import java.util.Arrays; import java.util.List; import org.junit.Assert; -import org.junit.BeforeClass; -import org.junit.Test; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Test; -public class SampleCodeWriterTest { +class SampleCodeWriterTest { private static String packageName = "com.google.samples"; private static List testingSampleStatements; private static Sample testingSample; private static RegionTag regionTag; - @BeforeClass - public static void setUp() { + @BeforeAll + static void setUp() { TypeNode settingType = TypeNode.withReference(ConcreteReference.withClazz(ClientSettings.class)); Variable aVar = Variable.builder().setName("clientSettings").setType(settingType).build(); @@ -92,7 +92,7 @@ public static void setUp() { } @Test - public void writeSampleCodeStatements() { + void writeSampleCodeStatements() { String result = SampleCodeWriter.write(testingSampleStatements); String expected = "ClientSettings clientSettings = ClientSettings.newBuilder().build();\n" @@ -103,7 +103,7 @@ public void writeSampleCodeStatements() { } @Test - public void writeInlineSample() { + void writeInlineSample() { String result = SampleCodeWriter.writeInlineSample(testingSampleStatements); String expected = LineFormatter.lines( @@ -120,7 +120,7 @@ public void writeInlineSample() { } @Test - public void writeExecutableSample() { + void writeExecutableSample() { Sample sample = testingSample.withRegionTag(regionTag.withOverloadDisambiguation("ExecutableSample")); String result = SampleCodeWriter.writeExecutableSample(sample, packageName); diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/samplecode/SampleComposerTest.java b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/samplecode/SampleComposerTest.java index 726166861d..94e381dca8 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/samplecode/SampleComposerTest.java +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/samplecode/SampleComposerTest.java @@ -32,19 +32,19 @@ import com.google.api.generator.engine.ast.VariableExpr; import com.google.api.generator.gapic.model.RegionTag; import com.google.api.generator.gapic.model.Sample; -import com.google.api.generator.testutils.LineFormatter; +import com.google.api.generator.test.utils.LineFormatter; import com.google.common.collect.ImmutableList; import java.util.Arrays; import java.util.List; -import org.junit.Test; +import org.junit.jupiter.api.Test; -public class SampleComposerTest { +class SampleComposerTest { private final String packageName = "com.google.example"; private final RegionTag.Builder regionTag = RegionTag.builder().setApiShortName("apiName").setServiceName("echo"); @Test - public void createInlineSample() { + void createInlineSample() { List sampleBody = Arrays.asList(ExprStatement.withExpr(systemOutPrint("testing"))); String sampleResult = writeSample(SampleComposer.composeInlineSample(sampleBody)); String expected = @@ -60,7 +60,7 @@ public void createInlineSample() { } @Test - public void createExecutableSampleEmptyStatementSample() { + void createExecutableSampleEmptyStatementSample() { Sample sample = Sample.builder() .setRegionTag( @@ -96,7 +96,7 @@ public void createExecutableSampleEmptyStatementSample() { } @Test - public void createExecutableSampleMethodArgsNoVar() { + void createExecutableSampleMethodArgsNoVar() { Statement sampleBody = ExprStatement.withExpr(systemOutPrint("Testing CreateExecutableSampleMethodArgsNoVar")); Sample sample = @@ -136,7 +136,7 @@ public void createExecutableSampleMethodArgsNoVar() { } @Test - public void createExecutableSampleMethod() { + void createExecutableSampleMethod() { VariableExpr variableExpr = VariableExpr.builder() .setVariable(Variable.builder().setType(TypeNode.STRING).setName("content").build()) @@ -185,7 +185,7 @@ public void createExecutableSampleMethod() { } @Test - public void createExecutableSampleMethodMultipleStatements() { + void createExecutableSampleMethodMultipleStatements() { VariableExpr strVariableExpr = VariableExpr.builder() .setVariable(Variable.builder().setType(TypeNode.STRING).setName("content").build()) diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/samplecode/SampleComposerUtilTest.java b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/samplecode/SampleComposerUtilTest.java index 05b86ddf1b..a6221ccac1 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/samplecode/SampleComposerUtilTest.java +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/samplecode/SampleComposerUtilTest.java @@ -28,9 +28,9 @@ import java.util.Arrays; import java.util.Collections; import java.util.List; -import org.junit.Test; +import org.junit.jupiter.api.Test; -public class SampleComposerUtilTest { +class SampleComposerUtilTest { private static final String SHOWCASE_PACKAGE_NAME = "com.google.showcase.v1beta1"; TypeNode clientType = TypeNode.withReference( @@ -55,7 +55,7 @@ public class SampleComposerUtilTest { .build(); @Test - public void assignClientVariableWithCreateMethodExpr() { + void assignClientVariableWithCreateMethodExpr() { String result = SampleCodeWriter.write( SampleComposerUtil.assignClientVariableWithCreateMethodExpr(echoClientVariableExpr)); @@ -65,14 +65,14 @@ public void assignClientVariableWithCreateMethodExpr() { } @Test - public void createOverloadDisambiguation_noargs() { + void createOverloadDisambiguation_noargs() { String result = SampleComposerUtil.createOverloadDisambiguation(new ArrayList<>()); String expected = "Noargs"; assertEquals(expected, result); } @Test - public void createOverloadDisambiguation_sameargs() { + void createOverloadDisambiguation_sameargs() { List methodArgVarExprs = Collections.nCopies(5, stringVariableExpr); String result = SampleComposerUtil.createOverloadDisambiguation(methodArgVarExprs); @@ -81,7 +81,7 @@ public void createOverloadDisambiguation_sameargs() { } @Test - public void createOverloadDisambiguation_containsInt() { + void createOverloadDisambiguation_containsInt() { List methodArgVarExprs = Arrays.asList(echoClientVariableExpr, stringVariableExpr, intVariableExpr); @@ -91,7 +91,7 @@ public void createOverloadDisambiguation_containsInt() { } @Test - public void handleDuplicateSamples_actualDuplicates() { + void handleDuplicateSamples_actualDuplicates() { List samples = Collections.nCopies(5, echoClientSample); assertEquals(samples.size(), 5); @@ -101,13 +101,12 @@ public void handleDuplicateSamples_actualDuplicates() { } @Test - public void handleDuplicateSamples_distinctDuplicates() { + void handleDuplicateSamples_distinctDuplicates() { VariableExpr echoClientVariableExprDiffVarName = VariableExpr.withVariable( Variable.builder().setName("echoClient2").setType(clientType).build()); Sample echoClientSampleDiffVarName = - echoClientSample - .toBuilder() + echoClientSample.toBuilder() .setBody( Arrays.asList( ExprStatement.withExpr( @@ -128,7 +127,7 @@ public void handleDuplicateSamples_distinctDuplicates() { } @Test - public void handleDuplicateSamples_notDuplicateName() { + void handleDuplicateSamples_notDuplicateName() { Sample echoClientSampleDiffRpcName = echoClientSample.withRegionTag( echoClientSample.regionTag().toBuilder().setRpcName("createB").build()); diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/samplecode/ServiceClientCallableMethodSampleComposerTest.java b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/samplecode/ServiceClientCallableMethodSampleComposerTest.java index 3edd5936de..2b058aca7c 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/samplecode/ServiceClientCallableMethodSampleComposerTest.java +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/samplecode/ServiceClientCallableMethodSampleComposerTest.java @@ -24,16 +24,16 @@ import com.google.api.generator.gapic.model.Sample; import com.google.api.generator.gapic.model.Service; import com.google.api.generator.gapic.protoparser.Parser; -import com.google.api.generator.testutils.LineFormatter; +import com.google.api.generator.test.utils.LineFormatter; import com.google.protobuf.Descriptors; import com.google.showcase.v1beta1.EchoOuterClass; import java.util.Arrays; import java.util.Collections; import java.util.Map; import org.junit.Assert; -import org.junit.Test; +import org.junit.jupiter.api.Test; -public class ServiceClientCallableMethodSampleComposerTest { +class ServiceClientCallableMethodSampleComposerTest { private static final String SHOWCASE_PACKAGE_NAME = "com.google.showcase.v1beta1"; private static final String LRO_PACKAGE_NAME = "com.google.longrunning"; private static final String PROTO_PACKAGE_NAME = "com.google.protobuf"; @@ -51,7 +51,7 @@ public class ServiceClientCallableMethodSampleComposerTest { /*Testing composeLroCallableMethod*/ @Test - public void valid_composeLroCallableMethod_withReturnResponse() { + void valid_composeLroCallableMethod_withReturnResponse() { Descriptors.FileDescriptor echoFileDescriptor = EchoOuterClass.getDescriptor(); Map resourceNames = Parser.parseResourceNames(echoFileDescriptor); Map messageTypes = Parser.parseMessages(echoFileDescriptor); @@ -122,7 +122,7 @@ public void valid_composeLroCallableMethod_withReturnResponse() { } @Test - public void valid_composeLroCallableMethod_withReturnVoid() { + void valid_composeLroCallableMethod_withReturnVoid() { Descriptors.FileDescriptor echoFileDescriptor = EchoOuterClass.getDescriptor(); Map resourceNames = Parser.parseResourceNames(echoFileDescriptor); Map messageTypes = Parser.parseMessages(echoFileDescriptor); @@ -191,7 +191,7 @@ public void valid_composeLroCallableMethod_withReturnVoid() { /*Testing composePagedCallableMethod*/ @Test - public void valid_composePagedCallableMethod() { + void valid_composePagedCallableMethod() { Descriptors.FileDescriptor echoFileDescriptor = EchoOuterClass.getDescriptor(); Map resourceNames = Parser.parseResourceNames(echoFileDescriptor); Map messageTypes = Parser.parseMessages(echoFileDescriptor); @@ -255,7 +255,7 @@ public void valid_composePagedCallableMethod() { } @Test - public void invalid_composePagedCallableMethod_inputTypeNotExistInMessage() { + void invalid_composePagedCallableMethod_inputTypeNotExistInMessage() { Descriptors.FileDescriptor echoFileDescriptor = EchoOuterClass.getDescriptor(); Map resourceNames = Parser.parseResourceNames(echoFileDescriptor); Map messageTypes = Parser.parseMessages(echoFileDescriptor); @@ -303,7 +303,7 @@ public void invalid_composePagedCallableMethod_inputTypeNotExistInMessage() { } @Test - public void invalid_composePagedCallableMethod_noExistMethodResponse() { + void invalid_composePagedCallableMethod_noExistMethodResponse() { Descriptors.FileDescriptor echoFileDescriptor = EchoOuterClass.getDescriptor(); Map resourceNames = Parser.parseResourceNames(echoFileDescriptor); Map messageTypes = Parser.parseMessages(echoFileDescriptor); @@ -351,7 +351,7 @@ public void invalid_composePagedCallableMethod_noExistMethodResponse() { } @Test - public void invalid_composePagedCallableMethod_noRepeatedResponse() { + void invalid_composePagedCallableMethod_noRepeatedResponse() { Descriptors.FileDescriptor echoFileDescriptor = EchoOuterClass.getDescriptor(); Map resourceNames = Parser.parseResourceNames(echoFileDescriptor); Map messageTypes = Parser.parseMessages(echoFileDescriptor); @@ -414,7 +414,7 @@ public void invalid_composePagedCallableMethod_noRepeatedResponse() { /*Testing composeStreamCallableMethod*/ @Test - public void valid_composeStreamCallableMethod_serverStream() { + void valid_composeStreamCallableMethod_serverStream() { Descriptors.FileDescriptor echoFileDescriptor = EchoOuterClass.getDescriptor(); Map resourceNames = Parser.parseResourceNames(echoFileDescriptor); Map messageTypes = Parser.parseMessages(echoFileDescriptor); @@ -472,7 +472,7 @@ public void valid_composeStreamCallableMethod_serverStream() { } @Test - public void invalid_composeStreamCallableMethod_serverStreamNotExistRequest() { + void invalid_composeStreamCallableMethod_serverStreamNotExistRequest() { Descriptors.FileDescriptor echoFileDescriptor = EchoOuterClass.getDescriptor(); Map resourceNames = Parser.parseResourceNames(echoFileDescriptor); Map messageTypes = Parser.parseMessages(echoFileDescriptor); @@ -520,7 +520,7 @@ public void invalid_composeStreamCallableMethod_serverStreamNotExistRequest() { } @Test - public void valid_composeStreamCallableMethod_bidiStream() { + void valid_composeStreamCallableMethod_bidiStream() { Descriptors.FileDescriptor echoFileDescriptor = EchoOuterClass.getDescriptor(); Map resourceNames = Parser.parseResourceNames(echoFileDescriptor); Map messageTypes = Parser.parseMessages(echoFileDescriptor); @@ -587,7 +587,7 @@ public void valid_composeStreamCallableMethod_bidiStream() { } @Test - public void invalid_composeStreamCallableMethod_bidiStreamNotExistRequest() { + void invalid_composeStreamCallableMethod_bidiStreamNotExistRequest() { Descriptors.FileDescriptor echoFileDescriptor = EchoOuterClass.getDescriptor(); Map resourceNames = Parser.parseResourceNames(echoFileDescriptor); Map messageTypes = Parser.parseMessages(echoFileDescriptor); @@ -635,7 +635,7 @@ public void invalid_composeStreamCallableMethod_bidiStreamNotExistRequest() { } @Test - public void valid_composeStreamCallableMethod_clientStream() { + void valid_composeStreamCallableMethod_clientStream() { Descriptors.FileDescriptor echoFileDescriptor = EchoOuterClass.getDescriptor(); Map resourceNames = Parser.parseResourceNames(echoFileDescriptor); Map messageTypes = Parser.parseMessages(echoFileDescriptor); @@ -716,7 +716,7 @@ public void valid_composeStreamCallableMethod_clientStream() { } @Test - public void invalid_composeStreamCallableMethod_clientStreamNotExistRequest() { + void invalid_composeStreamCallableMethod_clientStreamNotExistRequest() { Descriptors.FileDescriptor echoFileDescriptor = EchoOuterClass.getDescriptor(); Map resourceNames = Parser.parseResourceNames(echoFileDescriptor); Map messageTypes = Parser.parseMessages(echoFileDescriptor); @@ -765,7 +765,7 @@ public void invalid_composeStreamCallableMethod_clientStreamNotExistRequest() { /*Testing composeRegularCallableMethod*/ @Test - public void valid_composeRegularCallableMethod_unaryRpc() { + void valid_composeRegularCallableMethod_unaryRpc() { Descriptors.FileDescriptor echoFileDescriptor = EchoOuterClass.getDescriptor(); Map resourceNames = Parser.parseResourceNames(echoFileDescriptor); Map messageTypes = Parser.parseMessages(echoFileDescriptor); @@ -824,7 +824,7 @@ public void valid_composeRegularCallableMethod_unaryRpc() { } @Test - public void valid_composeRegularCallableMethod_lroRpc() { + void valid_composeRegularCallableMethod_lroRpc() { Descriptors.FileDescriptor echoFileDescriptor = EchoOuterClass.getDescriptor(); Map resourceNames = Parser.parseResourceNames(echoFileDescriptor); Map messageTypes = Parser.parseMessages(echoFileDescriptor); @@ -894,7 +894,7 @@ public void valid_composeRegularCallableMethod_lroRpc() { } @Test - public void valid_composeRegularCallableMethod_lroRpcWithReturnVoid() { + void valid_composeRegularCallableMethod_lroRpcWithReturnVoid() { Descriptors.FileDescriptor echoFileDescriptor = EchoOuterClass.getDescriptor(); Map resourceNames = Parser.parseResourceNames(echoFileDescriptor); Map messageTypes = Parser.parseMessages(echoFileDescriptor); @@ -961,7 +961,7 @@ public void valid_composeRegularCallableMethod_lroRpcWithReturnVoid() { } @Test - public void valid_composeRegularCallableMethod_pageRpc() { + void valid_composeRegularCallableMethod_pageRpc() { Descriptors.FileDescriptor echoFileDescriptor = EchoOuterClass.getDescriptor(); Map resourceNames = Parser.parseResourceNames(echoFileDescriptor); Map messageTypes = Parser.parseMessages(echoFileDescriptor); @@ -1032,7 +1032,7 @@ public void valid_composeRegularCallableMethod_pageRpc() { } @Test - public void invalid_composeRegularCallableMethod_noExistMethodRequest() { + void invalid_composeRegularCallableMethod_noExistMethodRequest() { Descriptors.FileDescriptor echoFileDescriptor = EchoOuterClass.getDescriptor(); Map resourceNames = Parser.parseResourceNames(echoFileDescriptor); Map messageTypes = Parser.parseMessages(echoFileDescriptor); @@ -1075,7 +1075,7 @@ public void invalid_composeRegularCallableMethod_noExistMethodRequest() { } @Test - public void invalid_composeRegularCallableMethod_noExistMethodResponsePagedRpc() { + void invalid_composeRegularCallableMethod_noExistMethodResponsePagedRpc() { Descriptors.FileDescriptor echoFileDescriptor = EchoOuterClass.getDescriptor(); Map resourceNames = Parser.parseResourceNames(echoFileDescriptor); Map messageTypes = Parser.parseMessages(echoFileDescriptor); @@ -1123,7 +1123,7 @@ public void invalid_composeRegularCallableMethod_noExistMethodResponsePagedRpc() } @Test - public void invalid_composeRegularCallableMethod_noRepeatedResponsePagedRpc() { + void invalid_composeRegularCallableMethod_noRepeatedResponsePagedRpc() { Descriptors.FileDescriptor echoFileDescriptor = EchoOuterClass.getDescriptor(); Map resourceNames = Parser.parseResourceNames(echoFileDescriptor); Map messageTypes = Parser.parseMessages(echoFileDescriptor); diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/samplecode/ServiceClientHeaderSampleComposerTest.java b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/samplecode/ServiceClientHeaderSampleComposerTest.java index 64593d0fea..48a7e4175e 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/samplecode/ServiceClientHeaderSampleComposerTest.java +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/samplecode/ServiceClientHeaderSampleComposerTest.java @@ -27,8 +27,9 @@ import com.google.api.generator.gapic.model.Sample; import com.google.api.generator.gapic.model.Service; import com.google.api.generator.gapic.protoparser.Parser; -import com.google.api.generator.testutils.LineFormatter; +import com.google.api.generator.test.utils.LineFormatter; import com.google.protobuf.Descriptors; +import com.google.selective.generate.v1beta1.SelectiveApiGenerationOuterClass; import com.google.showcase.v1beta1.EchoOuterClass; import java.util.Arrays; import java.util.Collections; @@ -38,10 +39,11 @@ import java.util.Optional; import java.util.Set; import org.junit.Assert; -import org.junit.Test; +import org.junit.jupiter.api.Test; -public class ServiceClientHeaderSampleComposerTest { +class ServiceClientHeaderSampleComposerTest { private static final String SHOWCASE_PACKAGE_NAME = "com.google.showcase.v1beta1"; + private static final String SELECTIVE_API_PACKAGE_NAME = "com.google.selective.generate.v1beta1"; private static final String LRO_PACKAGE_NAME = "com.google.longrunning"; private static final String PROTO_PACKAGE_NAME = "com.google.protobuf"; private static final String PAGINATED_FIELD_NAME = "page_size"; @@ -58,7 +60,7 @@ public class ServiceClientHeaderSampleComposerTest { /*Testing composeClassHeaderSample*/ @Test - public void composeClassHeaderSample_unaryRpc() { + void composeClassHeaderSample_unaryRpc() { Descriptors.FileDescriptor echoFileDescriptor = EchoOuterClass.getDescriptor(); Map resourceNames = Parser.parseResourceNames(echoFileDescriptor); Map messageTypes = Parser.parseMessages(echoFileDescriptor); @@ -86,7 +88,7 @@ public void composeClassHeaderSample_unaryRpc() { } @Test - public void composeClassHeaderSample_firstMethodIsNotUnaryRpc() { + void composeClassHeaderSample_firstMethodIsNotUnaryRpc() { Descriptors.FileDescriptor echoFileDescriptor = EchoOuterClass.getDescriptor(); Map resourceNames = Parser.parseResourceNames(echoFileDescriptor); Map messageTypes = Parser.parseMessages(echoFileDescriptor); @@ -170,7 +172,7 @@ public void composeClassHeaderSample_firstMethodIsNotUnaryRpc() { } @Test - public void composeClassHeaderSample_firstMethodHasNoSignatures() { + void composeClassHeaderSample_firstMethodHasNoSignatures() { Descriptors.FileDescriptor echoFileDescriptor = EchoOuterClass.getDescriptor(); Map resourceNames = Parser.parseResourceNames(echoFileDescriptor); Map messageTypes = Parser.parseMessages(echoFileDescriptor); @@ -214,6 +216,7 @@ public void composeClassHeaderSample_firstMethodHasNoSignatures() { writeStatements( ServiceClientHeaderSampleComposer.composeClassHeaderSample( service, clientType, resourceNames, messageTypes)); + System.out.println("results: " + results); String expected = LineFormatter.lines( "try (EchoClient echoClient = EchoClient.create()) {\n", @@ -228,11 +231,12 @@ public void composeClassHeaderSample_firstMethodHasNoSignatures() { " .build();\n", " EchoResponse response = echoClient.echo(request);\n", "}"); + System.out.println("results: " + expected); Assert.assertEquals(results, expected); } @Test - public void composeClassHeaderSample_firstMethodIsStream() { + void composeClassHeaderSample_firstMethodIsStream() { Descriptors.FileDescriptor echoFileDescriptor = EchoOuterClass.getDescriptor(); Map resourceNames = Parser.parseResourceNames(echoFileDescriptor); Map messageTypes = Parser.parseMessages(echoFileDescriptor); @@ -289,9 +293,140 @@ public void composeClassHeaderSample_firstMethodIsStream() { Assert.assertEquals(results, expected); } + @Test + void composeClassHeaderSample_firstMethodIsInternal() { + Descriptors.FileDescriptor selectiveApiGenerationFileDescriptor = + SelectiveApiGenerationOuterClass.getDescriptor(); + Map resourceNames = + Parser.parseResourceNames(selectiveApiGenerationFileDescriptor); + Map messageTypes = Parser.parseMessages(selectiveApiGenerationFileDescriptor); + TypeNode inputType = + TypeNode.withReference( + VaporReference.builder() + .setName("EchoRequest") + .setPakkage(SELECTIVE_API_PACKAGE_NAME) + .build()); + TypeNode outputType = + TypeNode.withReference( + VaporReference.builder() + .setName("EchoResponse") + .setPakkage(SELECTIVE_API_PACKAGE_NAME) + .build()); + Method internalMethod = + Method.builder() + .setName("ChatShouldGenerateAsInternal") + .setInputType(inputType) + .setOutputType(outputType) + .setIsInternalApi(true) + .build(); + Method publicMethod = + Method.builder() + .setName("ChatShouldGenerateAsUsual") + .setInputType(inputType) + .setOutputType(outputType) + .setIsInternalApi(false) + .build(); + Service service = + Service.builder() + .setName("EchoServiceShouldGeneratePartialUsual") + .setDefaultHost("localhost:7469") + .setOauthScopes(Arrays.asList("https://www.googleapis.com/auth/cloud-platform")) + .setPakkage(SELECTIVE_API_PACKAGE_NAME) + .setProtoPakkage(SELECTIVE_API_PACKAGE_NAME) + .setOriginalJavaPackage(SELECTIVE_API_PACKAGE_NAME) + .setOverriddenName("EchoServiceShouldGeneratePartialUsual") + .setMethods(Arrays.asList(internalMethod, publicMethod)) + .build(); + TypeNode clientType = + TypeNode.withReference( + VaporReference.builder() + .setName("EchoServiceSelectiveApiClient") + .setPakkage(SELECTIVE_API_PACKAGE_NAME) + .build()); + String results = + writeStatements( + ServiceClientHeaderSampleComposer.composeClassHeaderSample( + service, clientType, resourceNames, messageTypes)); + String expected = + LineFormatter.lines( + "try (EchoServiceSelectiveApiClient echoServiceSelectiveApiClient =\n" + + " EchoServiceSelectiveApiClient.create()) {\n" + + " EchoRequest request =\n" + + " EchoRequest.newBuilder()\n" + + " .setName(FoobarName.of(\"[PROJECT]\", \"[FOOBAR]\").toString())\n" + + " .setParent(\n" + + " FoobarbazName.ofProjectFoobarbazName(\"[PROJECT]\", \"[FOOBARBAZ]\").toString())\n" + + " .setFoobar(Foobar.newBuilder().build())\n" + + " .build();\n" + + " EchoResponse response = echoServiceSelectiveApiClient.chatShouldGenerateAsUsual(request);\n" + + "}"); + Assert.assertEquals(results, expected); + } + + @Test + void composeClassHeaderSample_allMethodsAreInternal() { + Descriptors.FileDescriptor selectiveApiGenerationFileDescriptor = + SelectiveApiGenerationOuterClass.getDescriptor(); + Map resourceNames = + Parser.parseResourceNames(selectiveApiGenerationFileDescriptor); + Map messageTypes = Parser.parseMessages(selectiveApiGenerationFileDescriptor); + TypeNode inputType = + TypeNode.withReference( + VaporReference.builder() + .setName("EchoRequest") + .setPakkage(SELECTIVE_API_PACKAGE_NAME) + .build()); + TypeNode outputType = + TypeNode.withReference( + VaporReference.builder() + .setName("EchoResponse") + .setPakkage(SELECTIVE_API_PACKAGE_NAME) + .build()); + Method internalMethod1 = + Method.builder() + .setName("ChatShouldGenerateAsInternal") + .setInputType(inputType) + .setOutputType(outputType) + .setIsInternalApi(true) + .build(); + Method internalMethod2 = + Method.builder() + .setName("EchoShouldGenerateAsInternal") + .setInputType(inputType) + .setOutputType(outputType) + .setIsInternalApi(true) + .build(); + Service service = + Service.builder() + .setName("EchoServiceShouldGeneratePartialUsual") + .setDefaultHost("localhost:7469") + .setOauthScopes(Arrays.asList("https://www.googleapis.com/auth/cloud-platform")) + .setPakkage(SELECTIVE_API_PACKAGE_NAME) + .setProtoPakkage(SELECTIVE_API_PACKAGE_NAME) + .setOriginalJavaPackage(SELECTIVE_API_PACKAGE_NAME) + .setOverriddenName("EchoServiceShouldGeneratePartialUsual") + .setMethods(Arrays.asList(internalMethod1, internalMethod2)) + .build(); + TypeNode clientType = + TypeNode.withReference( + VaporReference.builder() + .setName("EchoServiceSelectiveApiClient") + .setPakkage(SELECTIVE_API_PACKAGE_NAME) + .build()); + String results = + writeStatements( + ServiceClientHeaderSampleComposer.composeClassHeaderSample( + service, clientType, resourceNames, messageTypes)); + String expected = + LineFormatter.lines( + "try (EchoServiceSelectiveApiClient echoServiceSelectiveApiClient =\n" + + " EchoServiceSelectiveApiClient.create()) {}"); + Assert.assertEquals(expected, results); + } + /*Testing composeSetCredentialsSample*/ @Test - public void composeSetCredentialsSample() { + void composeSetCredentialsSample() { TypeNode clientType = TypeNode.withReference( VaporReference.builder() @@ -320,7 +455,7 @@ public void composeSetCredentialsSample() { /*Testing composeSetEndpointSample*/ @Test - public void composeSetEndpointSample() { + void composeSetEndpointSample() { TypeNode clientType = TypeNode.withReference( VaporReference.builder() @@ -347,7 +482,7 @@ public void composeSetEndpointSample() { /*Testing composeShowcaseMethodSample*/ @Test - public void valid_composeShowcaseMethodSample_pagedRpcWithMultipleMethodArguments() { + void valid_composeShowcaseMethodSample_pagedRpcWithMultipleMethodArguments() { Descriptors.FileDescriptor echoFileDescriptor = EchoOuterClass.getDescriptor(); Map resourceNames = Parser.parseResourceNames(echoFileDescriptor); Map messageTypes = Parser.parseMessages(echoFileDescriptor); @@ -455,7 +590,7 @@ public void valid_composeShowcaseMethodSample_pagedRpcWithMultipleMethodArgument } @Test - public void valid_composeShowcaseMethodSample_pagedRpcWithNoMethodArguments() { + void valid_composeShowcaseMethodSample_pagedRpcWithNoMethodArguments() { Descriptors.FileDescriptor echoFileDescriptor = EchoOuterClass.getDescriptor(); Map resourceNames = Parser.parseResourceNames(echoFileDescriptor); Map messageTypes = Parser.parseMessages(echoFileDescriptor); @@ -537,7 +672,7 @@ public void valid_composeShowcaseMethodSample_pagedRpcWithNoMethodArguments() { } @Test - public void invalid_composeShowcaseMethodSample_noMatchedRepeatedResponseTypeInPagedMethod() { + void invalid_composeShowcaseMethodSample_noMatchedRepeatedResponseTypeInPagedMethod() { Descriptors.FileDescriptor echoFileDescriptor = EchoOuterClass.getDescriptor(); Map resourceNames = Parser.parseResourceNames(echoFileDescriptor); Map messageTypes = Parser.parseMessages(echoFileDescriptor); @@ -587,7 +722,7 @@ public void invalid_composeShowcaseMethodSample_noMatchedRepeatedResponseTypeInP } @Test - public void invalid_composeShowcaseMethodSample_noRepeatedResponseTypeInPagedMethod() { + void invalid_composeShowcaseMethodSample_noRepeatedResponseTypeInPagedMethod() { Descriptors.FileDescriptor echoFileDescriptor = EchoOuterClass.getDescriptor(); Map resourceNames = Parser.parseResourceNames(echoFileDescriptor); Map messageTypes = Parser.parseMessages(echoFileDescriptor); @@ -659,7 +794,7 @@ public void invalid_composeShowcaseMethodSample_noRepeatedResponseTypeInPagedMet } @Test - public void valid_composeShowcaseMethodSample_lroUnaryRpcWithNoMethodArgument() { + void valid_composeShowcaseMethodSample_lroUnaryRpcWithNoMethodArgument() { Descriptors.FileDescriptor echoFileDescriptor = EchoOuterClass.getDescriptor(); Map resourceNames = Parser.parseResourceNames(echoFileDescriptor); Map messageTypes = Parser.parseMessages(echoFileDescriptor); @@ -727,7 +862,7 @@ public void valid_composeShowcaseMethodSample_lroUnaryRpcWithNoMethodArgument() } @Test - public void valid_composeShowcaseMethodSample_lroRpcWithReturnResponseType() { + void valid_composeShowcaseMethodSample_lroRpcWithReturnResponseType() { Descriptors.FileDescriptor echoFileDescriptor = EchoOuterClass.getDescriptor(); Map resourceNames = Parser.parseResourceNames(echoFileDescriptor); Map messageTypes = Parser.parseMessages(echoFileDescriptor); @@ -813,7 +948,7 @@ public void valid_composeShowcaseMethodSample_lroRpcWithReturnResponseType() { } @Test - public void valid_composeShowcaseMethodSample_lroRpcWithReturnVoid() { + void valid_composeShowcaseMethodSample_lroRpcWithReturnVoid() { Descriptors.FileDescriptor echoFileDescriptor = EchoOuterClass.getDescriptor(); Map resourceNames = Parser.parseResourceNames(echoFileDescriptor); Map messageTypes = Parser.parseMessages(echoFileDescriptor); diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/samplecode/ServiceClientMethodSampleComposerTest.java b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/samplecode/ServiceClientMethodSampleComposerTest.java index 68b76374a9..d1b93a932a 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/samplecode/ServiceClientMethodSampleComposerTest.java +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/samplecode/ServiceClientMethodSampleComposerTest.java @@ -23,23 +23,23 @@ import com.google.api.generator.gapic.model.Sample; import com.google.api.generator.gapic.model.Service; import com.google.api.generator.gapic.protoparser.Parser; -import com.google.api.generator.testutils.LineFormatter; +import com.google.api.generator.test.utils.LineFormatter; import com.google.protobuf.Descriptors.FileDescriptor; import com.google.showcase.v1beta1.EchoOuterClass; import java.util.Arrays; import java.util.Collections; import java.util.Map; import org.junit.Assert; -import org.junit.Test; +import org.junit.jupiter.api.Test; -public class ServiceClientMethodSampleComposerTest { +class ServiceClientMethodSampleComposerTest { private static final String SHOWCASE_PACKAGE_NAME = "com.google.showcase.v1beta1"; private static final String LRO_PACKAGE_NAME = "com.google.longrunning"; private static final String PROTO_PACKAGE_NAME = "com.google.protobuf"; private static final String PAGINATED_FIELD_NAME = "page_size"; @Test - public void valid_composeDefaultSample_isPagedMethod() { + void valid_composeDefaultSample_isPagedMethod() { FileDescriptor echoFileDescriptor = EchoOuterClass.getDescriptor(); Map resourceNames = Parser.parseResourceNames(echoFileDescriptor); Map messageTypes = Parser.parseMessages(echoFileDescriptor); @@ -101,7 +101,7 @@ public void valid_composeDefaultSample_isPagedMethod() { } @Test - public void invalid_composeDefaultSample_isPagedMethod() { + void invalid_composeDefaultSample_isPagedMethod() { FileDescriptor echoFileDescriptor = EchoOuterClass.getDescriptor(); Map resourceNames = Parser.parseResourceNames(echoFileDescriptor); Map messageTypes = Parser.parseMessages(echoFileDescriptor); @@ -150,7 +150,7 @@ public void invalid_composeDefaultSample_isPagedMethod() { } @Test - public void valid_composeDefaultSample_hasLroMethodWithReturnResponse() { + void valid_composeDefaultSample_hasLroMethodWithReturnResponse() { FileDescriptor echoFileDescriptor = EchoOuterClass.getDescriptor(); Map resourceNames = Parser.parseResourceNames(echoFileDescriptor); Map messageTypes = Parser.parseMessages(echoFileDescriptor); @@ -216,7 +216,7 @@ public void valid_composeDefaultSample_hasLroMethodWithReturnResponse() { } @Test - public void valid_composeDefaultSample_hasLroMethodWithReturnVoid() { + void valid_composeDefaultSample_hasLroMethodWithReturnVoid() { FileDescriptor echoFileDescriptor = EchoOuterClass.getDescriptor(); Map resourceNames = Parser.parseResourceNames(echoFileDescriptor); Map messageTypes = Parser.parseMessages(echoFileDescriptor); @@ -285,7 +285,7 @@ public void valid_composeDefaultSample_hasLroMethodWithReturnVoid() { } @Test - public void valid_composeDefaultSample_pureUnaryReturnVoid() { + void valid_composeDefaultSample_pureUnaryReturnVoid() { FileDescriptor echoFileDescriptor = EchoOuterClass.getDescriptor(); Map resourceNames = Parser.parseResourceNames(echoFileDescriptor); Map messageTypes = Parser.parseMessages(echoFileDescriptor); @@ -344,7 +344,7 @@ public void valid_composeDefaultSample_pureUnaryReturnVoid() { } @Test - public void valid_composeDefaultSample_pureUnaryReturnResponse() { + void valid_composeDefaultSample_pureUnaryReturnResponse() { FileDescriptor echoFileDescriptor = EchoOuterClass.getDescriptor(); Map resourceNames = Parser.parseResourceNames(echoFileDescriptor); Map messageTypes = Parser.parseMessages(echoFileDescriptor); diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/samplecode/SettingsSampleComposerTest.java b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/samplecode/SettingsSampleComposerTest.java index 33e428efeb..eb81a73a8e 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/samplecode/SettingsSampleComposerTest.java +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/samplecode/SettingsSampleComposerTest.java @@ -19,13 +19,13 @@ import com.google.api.generator.engine.ast.TypeNode; import com.google.api.generator.engine.ast.VaporReference; import com.google.api.generator.gapic.model.Sample; -import com.google.api.generator.testutils.LineFormatter; +import com.google.api.generator.test.utils.LineFormatter; import java.util.Optional; -import org.junit.Test; +import org.junit.jupiter.api.Test; -public class SettingsSampleComposerTest { +class SettingsSampleComposerTest { @Test - public void composeSettingsSample_noMethods() { + void composeSettingsSample_noMethods() { TypeNode classType = TypeNode.withReference( VaporReference.builder() @@ -40,7 +40,7 @@ public void composeSettingsSample_noMethods() { } @Test - public void composeSettingsSample_serviceSettingsClass() { + void composeSettingsSample_serviceSettingsClass() { TypeNode classType = TypeNode.withReference( VaporReference.builder() @@ -61,14 +61,21 @@ public void composeSettingsSample_serviceSettingsClass() { " .echoSettings()\n", " .getRetrySettings()\n", " .toBuilder()\n", - " .setTotalTimeout(Duration.ofSeconds(30))\n", + " .setInitialRetryDelayDuration(Duration.ofSeconds(1))\n", + " .setInitialRpcTimeoutDuration(Duration.ofSeconds(5))\n", + " .setMaxAttempts(5)\n", + " .setMaxRetryDelayDuration(Duration.ofSeconds(30))\n", + " .setMaxRpcTimeoutDuration(Duration.ofSeconds(60))\n", + " .setRetryDelayMultiplier(1.3)\n", + " .setRpcTimeoutMultiplier(1.5)\n", + " .setTotalTimeoutDuration(Duration.ofSeconds(300))\n", " .build());\n", "EchoSettings echoSettings = echoSettingsBuilder.build();"); assertEquals(results.get(), expected); } @Test - public void composeSettingsSample_serviceStubClass() { + void composeSettingsSample_serviceStubClass() { TypeNode classType = TypeNode.withReference( VaporReference.builder() @@ -89,12 +96,79 @@ public void composeSettingsSample_serviceStubClass() { " .echoSettings()\n", " .getRetrySettings()\n", " .toBuilder()\n", - " .setTotalTimeout(Duration.ofSeconds(30))\n", + " .setInitialRetryDelayDuration(Duration.ofSeconds(1))\n", + " .setInitialRpcTimeoutDuration(Duration.ofSeconds(5))\n", + " .setMaxAttempts(5)\n", + " .setMaxRetryDelayDuration(Duration.ofSeconds(30))\n", + " .setMaxRpcTimeoutDuration(Duration.ofSeconds(60))\n", + " .setRetryDelayMultiplier(1.3)\n", + " .setRpcTimeoutMultiplier(1.5)\n", + " .setTotalTimeoutDuration(Duration.ofSeconds(300))\n", " .build());\n", "EchoStubSettings echoSettings = echoSettingsBuilder.build();"); assertEquals(results.get(), expected); } + @Test + void composeSettingsSample_serviceSettingsClass_LroMethod() { + TypeNode classType = + TypeNode.withReference( + VaporReference.builder() + .setName("WaitSettings") + .setPakkage("com.google.showcase.v1beta1") + .build()); + Optional results = + writeSample( + SettingsSampleComposer.composeLroSettingsSample( + Optional.of("Wait"), "WaitSettings", classType)); + String expected = + LineFormatter.lines( + "WaitSettings.Builder waitSettingsBuilder = WaitSettings.newBuilder();\n", + "TimedRetryAlgorithm timedRetryAlgorithm =\n", + " OperationalTimedPollAlgorithm.create(\n", + " RetrySettings.newBuilder()\n", + " .setInitialRetryDelayDuration(Duration.ofMillis(500))\n", + " .setRetryDelayMultiplier(1.5)\n", + " .setMaxRetryDelayDuration(Duration.ofMillis(5000))\n", + " .setTotalTimeoutDuration(Duration.ofHours(24))\n", + " .build());\n", + "waitSettingsBuilder\n", + " .createClusterOperationSettings()\n", + " .setPollingAlgorithm(timedRetryAlgorithm)\n", + " .build();"); + assertEquals(expected, results.get()); + } + + @Test + void composeSettingsSample_serviceStubClass_LroMethod() { + TypeNode classType = + TypeNode.withReference( + VaporReference.builder() + .setName("WaitStubSettings") + .setPakkage("com.google.showcase.v1beta1") + .build()); + Optional results = + writeSample( + SettingsSampleComposer.composeLroSettingsSample( + Optional.of("Wait"), "WaitSettings", classType)); + String expected = + LineFormatter.lines( + "WaitStubSettings.Builder waitSettingsBuilder = WaitStubSettings.newBuilder();\n", + "TimedRetryAlgorithm timedRetryAlgorithm =\n", + " OperationalTimedPollAlgorithm.create(\n", + " RetrySettings.newBuilder()\n", + " .setInitialRetryDelayDuration(Duration.ofMillis(500))\n", + " .setRetryDelayMultiplier(1.5)\n", + " .setMaxRetryDelayDuration(Duration.ofMillis(5000))\n", + " .setTotalTimeoutDuration(Duration.ofHours(24))\n", + " .build());\n", + "waitSettingsBuilder\n", + " .createClusterOperationSettings()\n", + " .setPollingAlgorithm(timedRetryAlgorithm)\n", + " .build();"); + assertEquals(results.get(), expected); + } + private Optional writeSample(Optional sample) { if (sample.isPresent()) { return Optional.of(SampleCodeWriter.write(sample.get().body())); diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/utils/CommentFormatterTest.java b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/utils/CommentFormatterTest.java index 8f562de47c..0ec26d26cf 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/utils/CommentFormatterTest.java +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/utils/CommentFormatterTest.java @@ -16,14 +16,14 @@ import static org.junit.Assert.assertEquals; -import com.google.api.generator.testutils.LineFormatter; -import org.junit.Test; +import com.google.api.generator.test.utils.LineFormatter; +import org.junit.jupiter.api.Test; -public class CommentFormatterTest { +class CommentFormatterTest { private static final String SERVICE_DESCRIPTION_HEADER_PATTERN = "Service Description: %s"; @Test - public void parseCommentWithItemizedList_paragraphContainsList() { + void parseCommentWithItemizedList_paragraphContainsList() { String protobufComment = LineFormatter.lines( "Service Name\n\n", @@ -43,7 +43,7 @@ public void parseCommentWithItemizedList_paragraphContainsList() { } @Test - public void parseCommentWithItemizedList_paragraphStartsWithList() { + void parseCommentWithItemizedList_paragraphStartsWithList() { String protobufComment = LineFormatter.lines( "Paragraphs starting with list items should still be parsed as list:\n\n", @@ -61,7 +61,7 @@ public void parseCommentWithItemizedList_paragraphStartsWithList() { } @Test - public void parseCommentWithPrefixPattern_addIfStartsWithParagraph() { + void parseCommentWithPrefixPattern_addIfStartsWithParagraph() { String protobufComment = LineFormatter.lines( "Service Name\n\n", @@ -83,7 +83,7 @@ public void parseCommentWithPrefixPattern_addIfStartsWithParagraph() { } @Test - public void parseCommentWithPrefixPattern_ignoreIfStartsWithList() { + void parseCommentWithPrefixPattern_ignoreIfStartsWithList() { String protobufComment = LineFormatter.lines(" * This is item one\n", " * This is item two"); String result = CommentFormatter.formatAsJavaDocComment( diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/utils/PackageCheckerTest.java b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/utils/PackageCheckerTest.java index c8f220f65e..9636ca0ea6 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/utils/PackageCheckerTest.java +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/utils/PackageCheckerTest.java @@ -17,11 +17,11 @@ import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertTrue; -import org.junit.Test; +import org.junit.jupiter.api.Test; -public class PackageCheckerTest { +class PackageCheckerTest { @Test - public void isGaApi_gaVersionPresent() { + void isGaApi_gaVersionPresent() { assertTrue(PackageChecker.isGaApi("com.google.cloud.dataproc.v1.services")); assertTrue(PackageChecker.isGaApi("com.google.cloud.v1.foobar.services")); assertTrue(PackageChecker.isGaApi("com.google.cloud.dataproc.v1")); @@ -34,7 +34,7 @@ public void isGaApi_gaVersionPresent() { } @Test - public void isGaApi_alphaBetaVersionPresent() { + void isGaApi_alphaBetaVersionPresent() { assertFalse(PackageChecker.isGaApi("com.google.cloud.dataproc.v1beta1")); assertFalse(PackageChecker.isGaApi("com.google.cloud.dataproc.v1alpha1")); assertFalse(PackageChecker.isGaApi("com.google.cloud.dataproc.v1beta")); diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/model/FieldTest.java b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/model/FieldTest.java new file mode 100644 index 0000000000..44069555a8 --- /dev/null +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/model/FieldTest.java @@ -0,0 +1,76 @@ +// 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. + +package com.google.api.generator.gapic.model; + +import static org.junit.Assert.assertEquals; + +import com.google.api.FieldInfo.Format; +import com.google.api.generator.engine.ast.TypeNode; +import org.junit.jupiter.api.Test; + +class FieldTest { + + @Test + void shouldAutoPopulate() { + Field FIELD = + Field.builder() + .setName("SampleField") + .setIsRequired(false) + .setFieldInfoFormat(Format.UUID4) + .setType(TypeNode.STRING) + .build(); + + assertEquals(true, FIELD.canBeAutoPopulated()); + } + + @Test + void isRequired_shouldNotAutoPopulate() { + Field FIELD = + Field.builder() + .setName("SampleField") + .setIsRequired(true) + .setFieldInfoFormat(Format.UUID4) + .setType(TypeNode.STRING) + .build(); + + assertEquals(false, FIELD.canBeAutoPopulated()); + } + + @Test + void fieldInfoFormatNotUUID4_shouldNotAutoPopulate() { + Field FIELD = + Field.builder() + .setName("SampleField") + .setIsRequired(true) + .setFieldInfoFormat(Format.IPV6) + .setType(TypeNode.STRING) + .build(); + + assertEquals(false, FIELD.canBeAutoPopulated()); + } + + @Test + void typeNotString_shouldNotAutoPopulate() { + Field FIELD = + Field.builder() + .setName("SampleField") + .setIsRequired(true) + .setFieldInfoFormat(Format.UUID4) + .setType(TypeNode.BOOLEAN) + .build(); + + assertEquals(false, FIELD.canBeAutoPopulated()); + } +} diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/model/GapicServiceConfigTest.java b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/model/GapicServiceConfigTest.java index ca4cd84418..b42e7e9134 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/model/GapicServiceConfigTest.java +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/model/GapicServiceConfigTest.java @@ -34,15 +34,15 @@ import java.util.Map; import java.util.Optional; import java.util.Set; -import org.junit.Test; +import org.junit.jupiter.api.Test; -public class GapicServiceConfigTest { +class GapicServiceConfigTest { private static final double EPSILON = 1e-4; private static final String TESTDATA_DIRECTORY = "src/test/resources/"; @Test - public void serviceConfig_noConfigsFound() { + void serviceConfig_noConfigsFound() { FileDescriptor echoFileDescriptor = EchoOuterClass.getDescriptor(); Service service = parseService(echoFileDescriptor); @@ -70,7 +70,7 @@ public void serviceConfig_noConfigsFound() { } @Test - public void serviceConfig_basic() { + void serviceConfig_basic() { FileDescriptor echoFileDescriptor = EchoOuterClass.getDescriptor(); Service service = parseService(echoFileDescriptor); @@ -124,7 +124,7 @@ public void serviceConfig_basic() { } @Test - public void serviceConfig_withBatchingSettings() { + void serviceConfig_withBatchingSettings() { FileDescriptor echoFileDescriptor = EchoOuterClass.getDescriptor(); Service service = parseService(echoFileDescriptor); @@ -197,7 +197,7 @@ public void serviceConfig_withBatchingSettings() { } @Test - public void serviceConfig_withLroRetrySettings() { + void serviceConfig_withLroRetrySettings() { FileDescriptor echoFileDescriptor = EchoOuterClass.getDescriptor(); Service service = parseService(echoFileDescriptor); diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/model/HttpBindingsTest.java b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/model/HttpBindingsTest.java index f8713e0564..7ca27d167c 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/model/HttpBindingsTest.java +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/model/HttpBindingsTest.java @@ -17,28 +17,28 @@ import com.google.api.generator.engine.ast.TypeNode; import com.google.api.generator.gapic.model.HttpBindings.HttpBinding; import com.google.common.truth.Truth; -import org.junit.Before; -import org.junit.Test; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; -public class HttpBindingsTest { +class HttpBindingsTest { - public Field.Builder fieldBuilder; - public HttpBinding.Builder httpBindingBuilder; + private Field.Builder fieldBuilder; + private HttpBinding.Builder httpBindingBuilder; - @Before - public void setUp() throws Exception { + @BeforeEach + void setUp() throws Exception { fieldBuilder = Field.builder().setName("doesNotMatter").setType(TypeNode.OBJECT); httpBindingBuilder = HttpBinding.builder().setName("doesNotMatter"); } @Test - public void isOptional_shouldReturnFalseIfFieldIsNull() { + void isOptional_shouldReturnFalseIfFieldIsNull() { HttpBinding httpBinding = httpBindingBuilder.build(); Truth.assertThat(httpBinding.isOptional()).isFalse(); } @Test - public void isOptional_shouldReturnFalseIfFieldExistsAndIsOptionalIsFalse() { + void isOptional_shouldReturnFalseIfFieldExistsAndIsOptionalIsFalse() { HttpBinding httpBinding = httpBindingBuilder.setField(fieldBuilder.setIsProto3Optional(false).build()).build(); @@ -46,7 +46,7 @@ public void isOptional_shouldReturnFalseIfFieldExistsAndIsOptionalIsFalse() { } @Test - public void isOptional_shouldReturnTrueIfFieldExistsAndIsOptionalIsTue() { + void isOptional_shouldReturnTrueIfFieldExistsAndIsOptionalIsTue() { HttpBinding httpBinding = httpBindingBuilder.setField(fieldBuilder.setIsProto3Optional(true).build()).build(); @@ -54,13 +54,13 @@ public void isOptional_shouldReturnTrueIfFieldExistsAndIsOptionalIsTue() { } @Test - public void isRepeated_shouldReturnFalseIfFieldIsNull() { + void isRepeated_shouldReturnFalseIfFieldIsNull() { HttpBinding httpBinding = httpBindingBuilder.build(); Truth.assertThat(httpBinding.isRepeated()).isFalse(); } @Test - public void isRepeated_shouldReturnFalseIfFieldExistsAndIsRepeatedIsFalse() { + void isRepeated_shouldReturnFalseIfFieldExistsAndIsRepeatedIsFalse() { HttpBinding httpBinding = httpBindingBuilder.setField(fieldBuilder.setIsRepeated(false).build()).build(); @@ -68,7 +68,7 @@ public void isRepeated_shouldReturnFalseIfFieldExistsAndIsRepeatedIsFalse() { } @Test - public void isRepeated_shouldReturnTrueIfFieldExistsAndIsRepeatedIsTue() { + void isRepeated_shouldReturnTrueIfFieldExistsAndIsRepeatedIsTue() { HttpBinding httpBinding = httpBindingBuilder.setField(fieldBuilder.setIsRepeated(true).build()).build(); @@ -76,13 +76,13 @@ public void isRepeated_shouldReturnTrueIfFieldExistsAndIsRepeatedIsTue() { } @Test - public void isEnum_shouldReturnFalseIfFieldIsNull() { + void isEnum_shouldReturnFalseIfFieldIsNull() { HttpBinding httpBinding = httpBindingBuilder.build(); Truth.assertThat(httpBinding.isEnum()).isFalse(); } @Test - public void isEnum_shouldReturnFalseIfFieldExistsAndIsEnumIsFalse() { + void isEnum_shouldReturnFalseIfFieldExistsAndIsEnumIsFalse() { HttpBinding httpBinding = httpBindingBuilder.setField(fieldBuilder.setIsEnum(false).build()).build(); @@ -90,7 +90,7 @@ public void isEnum_shouldReturnFalseIfFieldExistsAndIsEnumIsFalse() { } @Test - public void isEnum_shouldReturnTrueIfFieldExistsAndIsEnumIsTue() { + void isEnum_shouldReturnTrueIfFieldExistsAndIsEnumIsTue() { HttpBinding httpBinding = httpBindingBuilder.setField(fieldBuilder.setIsEnum(true).build()).build(); diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/model/MessageTest.java b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/model/MessageTest.java index 469c86c212..60d7dda9a7 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/model/MessageTest.java +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/model/MessageTest.java @@ -21,14 +21,14 @@ import com.google.api.generator.engine.ast.VaporReference; import com.google.common.collect.ImmutableMap; import java.util.Map; -import org.junit.Test; +import org.junit.jupiter.api.Test; -public class MessageTest { +class MessageTest { private static final String SUB_FIELD_NAME = "table"; private static final String LEAF_FIELD_NAME = "size"; private static final String SUB_FIELD_TYPE = "TableFieldType"; - public static final VaporReference FIELD_TYPE = + private static final VaporReference FIELD_TYPE = VaporReference.builder().setPakkage("com.google").setName(SUB_FIELD_TYPE).build(); private static final String MESSAGE_NAME = "TestMessage"; private static final Message.Builder testMessageBuilder = @@ -38,7 +38,7 @@ public class MessageTest { .setType(TypeNode.OBJECT); @Test - public void validateField_shouldThrowExceptionIfFieldNameIsEmpty() { + void validateField_shouldThrowExceptionIfFieldNameIsEmpty() { Message message = testMessageBuilder.build(); IllegalStateException illegalStateException = assertThrows( @@ -50,7 +50,7 @@ public void validateField_shouldThrowExceptionIfFieldNameIsEmpty() { } @Test - public void validateField_shouldThrowExceptionIfFieldDoesNotExist() { + void validateField_shouldThrowExceptionIfFieldDoesNotExist() { Message message = testMessageBuilder.build(); String fieldName = "doesNotExist"; NullPointerException nullPointerException = @@ -65,7 +65,7 @@ public void validateField_shouldThrowExceptionIfFieldDoesNotExist() { } @Test - public void validateField_shouldThrowExceptionIfMessageDoesNotExist() { + void validateField_shouldThrowExceptionIfMessageDoesNotExist() { Field subField = Field.builder() .setName(SUB_FIELD_NAME) @@ -92,7 +92,7 @@ public void validateField_shouldThrowExceptionIfMessageDoesNotExist() { } @Test - public void validateField_shouldThrowExceptionIfFieldIsRepeated() { + void validateField_shouldThrowExceptionIfFieldIsRepeated() { Field leafField = Field.builder() .setType(TypeNode.STRING) @@ -103,7 +103,7 @@ public void validateField_shouldThrowExceptionIfFieldIsRepeated() { } @Test - public void validateField_shouldThrowExceptionIfFieldIsOfWrongType() { + void validateField_shouldThrowExceptionIfFieldIsOfWrongType() { Field leafField = Field.builder().setType(TypeNode.BOOLEAN).setName(LEAF_FIELD_NAME).build(); testLeafField(leafField); } @@ -126,7 +126,7 @@ private void testLeafField(Field leafField) { } @Test - public void validateField_shouldNotThrowExceptionIfFieldExist() { + void validateField_shouldNotThrowExceptionIfFieldExist() { Field leafField = Field.builder().setType(TypeNode.STRING).setName(LEAF_FIELD_NAME).build(); Message subMessage = createSubMessage(leafField); Map messageTypes = ImmutableMap.of(FIELD_TYPE.fullName(), subMessage); diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/model/MethodArgumentTest.java b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/model/MethodArgumentTest.java index 691700cb3e..f0f4824c31 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/model/MethodArgumentTest.java +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/model/MethodArgumentTest.java @@ -19,11 +19,11 @@ import com.google.api.generator.engine.ast.TypeNode; import java.util.function.BiFunction; import java.util.function.Function; -import org.junit.Test; +import org.junit.jupiter.api.Test; -public class MethodArgumentTest { +class MethodArgumentTest { @Test - public void compareMethodArguments() { + void compareMethodArguments() { BiFunction methodArgFn = (name, type) -> MethodArgument.builder() diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/model/MethodTest.java b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/model/MethodTest.java index cecee806f9..df6cbbd162 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/model/MethodTest.java +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/model/MethodTest.java @@ -15,16 +15,21 @@ package com.google.api.generator.gapic.model; import static com.google.common.truth.Truth.assertThat; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertThrows; import com.google.api.generator.engine.ast.TypeNode; import com.google.api.generator.gapic.model.HttpBindings.HttpBinding; import com.google.api.generator.gapic.model.HttpBindings.HttpVerb; +import com.google.api.generator.gapic.model.Method.Stream; import com.google.api.generator.gapic.model.RoutingHeaderRule.RoutingHeaderParam; import com.google.common.collect.ImmutableSet; +import java.util.ArrayList; import java.util.Arrays; -import org.junit.Test; +import java.util.List; +import org.junit.jupiter.api.Test; -public class MethodTest { +class MethodTest { private static final Method METHOD = Method.builder() @@ -42,7 +47,7 @@ public class MethodTest { .build(); @Test - public void toStream() { + void toStream() { // Argument order: isClientStreaming, isServerStreaming. assertThat(Method.toStream(false, false)).isEqualTo(Method.Stream.NONE); assertThat(Method.toStream(true, false)).isEqualTo(Method.Stream.CLIENT); @@ -51,22 +56,21 @@ public void toStream() { } @Test - public void hasRoutingHeaders_shouldReturnFalseIfRoutingHeadersIsNull() { + void hasRoutingHeaders_shouldReturnFalseIfRoutingHeadersIsNull() { assertThat(METHOD.hasRoutingHeaderParams()).isFalse(); } @Test - public void hasRoutingHeaders_shouldReturnFalseIfRoutingHeadersIsEmpty() { + void hasRoutingHeaders_shouldReturnFalseIfRoutingHeadersIsEmpty() { Method method = METHOD.toBuilder().setRoutingHeaderRule(RoutingHeaderRule.builder().build()).build(); assertThat(method.hasRoutingHeaderParams()).isFalse(); } @Test - public void hasRoutingHeaders_shouldReturnTrueIfRoutingHeadersIsNotEmpty() { + void hasRoutingHeaders_shouldReturnTrueIfRoutingHeadersIsNotEmpty() { Method method = - METHOD - .toBuilder() + METHOD.toBuilder() .setRoutingHeaderRule( RoutingHeaderRule.builder() .addParam(RoutingHeaderParam.create("table", "routing_id", "")) @@ -76,10 +80,9 @@ public void hasRoutingHeaders_shouldReturnTrueIfRoutingHeadersIsNotEmpty() { } @Test - public void shouldSetParamsExtractor_shouldReturnTrueIfHasRoutingHeaders() { + void shouldSetParamsExtractor_shouldReturnTrueIfHasRoutingHeaders() { Method method = - METHOD - .toBuilder() + METHOD.toBuilder() .setRoutingHeaderRule( RoutingHeaderRule.builder() .addParam(RoutingHeaderParam.create("table", "routing_id", "")) @@ -89,18 +92,16 @@ public void shouldSetParamsExtractor_shouldReturnTrueIfHasRoutingHeaders() { } @Test - public void shouldSetParamsExtractor_shouldReturnTrueIfHasHttpBindingsAndRoutingHeadersIsNull() { + void shouldSetParamsExtractor_shouldReturnTrueIfHasHttpBindingsAndRoutingHeadersIsNull() { Method method = METHOD.toBuilder().setHttpBindings(HTTP_BINDINGS).setRoutingHeaderRule(null).build(); assertThat(method.shouldSetParamsExtractor()).isTrue(); } @Test - public void - shouldSetParamsExtractor_shouldReturnFalseIfHasHttpBindingsAndRoutingHeadersIsEmpty() { + void shouldSetParamsExtractor_shouldReturnFalseIfHasHttpBindingsAndRoutingHeadersIsEmpty() { Method method = - METHOD - .toBuilder() + METHOD.toBuilder() .setHttpBindings(HTTP_BINDINGS) .setRoutingHeaderRule(RoutingHeaderRule.builder().build()) .build(); @@ -108,8 +109,109 @@ public void shouldSetParamsExtractor_shouldReturnTrueIfHasHttpBindingsAndRouting } @Test - public void shouldSetParamsExtractor_shouldReturnFalseIfHasNoHttpBindingsAndNoRoutingHeaders() { + void shouldSetParamsExtractor_shouldReturnFalseIfHasNoHttpBindingsAndNoRoutingHeaders() { Method method = METHOD.toBuilder().setHttpBindings(null).setRoutingHeaderRule(null).build(); assertThat(method.shouldSetParamsExtractor()).isFalse(); } + + @Test + void hasAutoPopulatedFields_shouldReturnTrueIfMethodIsUnary() { + List autoPopulatedFields = Arrays.asList("field1", "field2"); + Method method = METHOD.toBuilder().setAutoPopulatedFields(autoPopulatedFields).build(); + method.toStream(false, false); + assertEquals(true, method.hasAutoPopulatedFields()); + } + + @Test + void hasAutoPopulatedFields_shouldReturnFalseIfMethodIsStreaming() { + List autoPopulatedFields = Arrays.asList("field1", "field2"); + Method method = + METHOD.toBuilder() + .setAutoPopulatedFields(autoPopulatedFields) + .setStream(Stream.SERVER) + .build(); + assertEquals(false, method.hasAutoPopulatedFields()); + + method = + METHOD.toBuilder() + .setAutoPopulatedFields(autoPopulatedFields) + .setStream(Stream.BIDI) + .build(); + assertEquals(false, method.hasAutoPopulatedFields()); + + method = + METHOD.toBuilder() + .setAutoPopulatedFields(autoPopulatedFields) + .setStream(Stream.CLIENT) + .build(); + assertEquals(false, method.hasAutoPopulatedFields()); + } + + @Test + void hasAutoPopulatedFields_shouldReturnFalseIfAutoPopulatedFieldsIsEmpty() { + List autoPopulatedFields = new ArrayList<>(); + Method method = + METHOD.toBuilder() + .setAutoPopulatedFields(autoPopulatedFields) + .setStream(Stream.NONE) + .build(); + method.toStream(false, false); + assertEquals(false, method.hasAutoPopulatedFields()); + } + + @Test + void isSupportedByTransport_shouldReturnTrueIfHasHttpBindingsAndIsRESTEligibleForRESTTransport() { + Method methodNoStreaming = + METHOD.toBuilder().setHttpBindings(HTTP_BINDINGS).setStream(Method.Stream.NONE).build(); + assertThat(methodNoStreaming.isSupportedByTransport(Transport.REST)).isTrue(); + Method methodServerSideStreaming = + METHOD.toBuilder().setHttpBindings(HTTP_BINDINGS).setStream(Method.Stream.SERVER).build(); + assertThat(methodServerSideStreaming.isSupportedByTransport(Transport.REST)).isTrue(); + } + + @Test + void isSupportedByTransport_shouldReturnFalseIfNoHttpBindingsForRESTTransport() { + Method methodNoStreaming = + METHOD.toBuilder().setHttpBindings(null).setStream(Method.Stream.NONE).build(); + assertThat(methodNoStreaming.isSupportedByTransport(Transport.REST)).isFalse(); + Method methodServerSideStreaming = + METHOD.toBuilder().setHttpBindings(null).setStream(Method.Stream.SERVER).build(); + assertThat(methodServerSideStreaming.isSupportedByTransport(Transport.REST)).isFalse(); + } + + @Test + void + isSupportedByTransport_shouldReturnFalseIfHasHttpBindingsAndIsNotRESTEligibleForRESTTransport() { + Method methodClientSideStreaming = + METHOD.toBuilder().setHttpBindings(HTTP_BINDINGS).setStream(Method.Stream.CLIENT).build(); + assertThat(methodClientSideStreaming.isSupportedByTransport(Transport.REST)).isFalse(); + Method methodBiDiStreaming = + METHOD.toBuilder().setHttpBindings(HTTP_BINDINGS).setStream(Method.Stream.BIDI).build(); + assertThat(methodBiDiStreaming.isSupportedByTransport(Transport.REST)).isFalse(); + } + + @Test + void isSupportedByTransport_shouldReturnTrueForGRPCTransport() { + Method methodNoStreaming = + METHOD.toBuilder().setHttpBindings(HTTP_BINDINGS).setStream(Method.Stream.NONE).build(); + assertThat(methodNoStreaming.isSupportedByTransport(Transport.GRPC)).isTrue(); + Method methodBiDiStreaming = + METHOD.toBuilder().setHttpBindings(HTTP_BINDINGS).setStream(Method.Stream.BIDI).build(); + assertThat(methodBiDiStreaming.isSupportedByTransport(Transport.GRPC)).isTrue(); + Method methodNoStreamingNoHttpBindings = + METHOD.toBuilder().setStream(Method.Stream.NONE).build(); + assertThat(methodNoStreamingNoHttpBindings.isSupportedByTransport(Transport.GRPC)).isTrue(); + Method methodBiDiStreamingNoHttpBindings = + METHOD.toBuilder().setStream(Method.Stream.BIDI).build(); + assertThat(methodBiDiStreamingNoHttpBindings.isSupportedByTransport(Transport.GRPC)).isTrue(); + } + + @Test + void isSupportedByTransport_shouldThrowExceptionIfPassedGRPCRESTTransport() { + Method methodClientStreaming = + METHOD.toBuilder().setHttpBindings(HTTP_BINDINGS).setStream(Method.Stream.CLIENT).build(); + assertThrows( + IllegalArgumentException.class, + () -> methodClientStreaming.isSupportedByTransport(Transport.GRPC_REST)); + } } diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/model/RegionTagTest.java b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/model/RegionTagTest.java index e3a96fbd21..f0bdfe79e2 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/model/RegionTagTest.java +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/model/RegionTagTest.java @@ -15,12 +15,12 @@ package com.google.api.generator.gapic.model; import com.google.api.generator.gapic.composer.samplecode.SampleCodeWriter; -import com.google.api.generator.testutils.LineFormatter; +import com.google.api.generator.test.utils.LineFormatter; import java.util.Arrays; import org.junit.Assert; -import org.junit.Test; +import org.junit.jupiter.api.Test; -public class RegionTagTest { +class RegionTagTest { private final String serviceName = "serviceName"; private final String apiVersion = "v1"; private final String apiShortName = "shortName"; @@ -28,7 +28,7 @@ public class RegionTagTest { private final String disambiguation = "disambiguation"; @Test - public void regionTagNoRpcName() { + void regionTagNoRpcName() { Assert.assertThrows( IllegalStateException.class, () -> @@ -42,7 +42,7 @@ public void regionTagNoRpcName() { } @Test - public void regionTagNoServiceName() { + void regionTagNoServiceName() { Assert.assertThrows( IllegalStateException.class, () -> @@ -56,7 +56,7 @@ public void regionTagNoServiceName() { } @Test - public void regionTagValidMissingFields() { + void regionTagValidMissingFields() { RegionTag regionTag = RegionTag.builder().setServiceName(serviceName).setRpcName(rpcName).build(); @@ -67,7 +67,7 @@ public void regionTagValidMissingFields() { } @Test - public void regionTagSanitizeAttributes() { + void regionTagSanitizeAttributes() { String apiVersion = "1.4.0-"; String serviceName = "service_Na@m*.e!{}"; String rpcName = "rpc _Nam^#,e [String]10"; @@ -84,7 +84,7 @@ public void regionTagSanitizeAttributes() { } @Test - public void generateRegionTagsMissingRequiredFields() { + void generateRegionTagsMissingRequiredFields() { RegionTag rtMissingShortName = RegionTag.builder() .setApiVersion(apiVersion) @@ -95,7 +95,7 @@ public void generateRegionTagsMissingRequiredFields() { } @Test - public void generateRegionTagsValidMissingFields() { + void generateRegionTagsValidMissingFields() { RegionTag regionTag = RegionTag.builder() .setApiShortName(apiShortName) @@ -109,7 +109,7 @@ public void generateRegionTagsValidMissingFields() { } @Test - public void generateRegionTagsAllFields() { + void generateRegionTagsAllFields() { RegionTag regionTag = RegionTag.builder() .setApiShortName(apiShortName) @@ -126,7 +126,7 @@ public void generateRegionTagsAllFields() { } @Test - public void generateRegionTagTag() { + void generateRegionTagTag() { RegionTag regionTag = RegionTag.builder() .setApiShortName(apiShortName) diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/model/ResourceNameTest.java b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/model/ResourceNameTest.java index 0cd6620c51..e48c504539 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/model/ResourceNameTest.java +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/model/ResourceNameTest.java @@ -18,9 +18,9 @@ import com.google.common.truth.Truth; import java.util.Arrays; import java.util.Collections; -import org.junit.Test; +import org.junit.jupiter.api.Test; -public class ResourceNameTest { +class ResourceNameTest { private final ResourceName resName = ResourceName.builder() .setVariableName("topic") @@ -31,7 +31,7 @@ public class ResourceNameTest { .build(); @Test - public void getMatchingPattern() { + void getMatchingPattern() { HttpBindings bindings = HttpBindings.builder() .setHttpVerb(HttpVerb.PUT) @@ -45,7 +45,7 @@ public void getMatchingPattern() { } @Test - public void getMatchingPatternFromAdditionalPattern() { + void getMatchingPatternFromAdditionalPattern() { HttpBindings bindings = HttpBindings.builder() .setHttpVerb(HttpVerb.PUT) @@ -59,7 +59,7 @@ public void getMatchingPatternFromAdditionalPattern() { } @Test - public void getMatchingPatternNoMatch() { + void getMatchingPatternNoMatch() { HttpBindings bindings = HttpBindings.builder() .setHttpVerb(HttpVerb.PUT) diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/model/RoutingHeaderParamTest.java b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/model/RoutingHeaderParamTest.java index 8c2d1d361e..9311de8342 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/model/RoutingHeaderParamTest.java +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/model/RoutingHeaderParamTest.java @@ -18,12 +18,12 @@ import com.google.api.generator.gapic.model.RoutingHeaderRule.RoutingHeaderParam; import java.util.List; -import org.junit.Test; +import org.junit.jupiter.api.Test; -public class RoutingHeaderParamTest { +class RoutingHeaderParamTest { @Test - public void getDescendantFieldNames_shouldSplitFieldNameByDot() { + void getDescendantFieldNames_shouldSplitFieldNameByDot() { RoutingHeaderParam routingHeaderParam = RoutingHeaderParam.create("table.name", "name", "/abc/dec"); List descendantFieldNames = routingHeaderParam.getDescendantFieldNames(); diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/model/SampleTest.java b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/model/SampleTest.java index 7b880ba394..9f13646d9a 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/model/SampleTest.java +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/model/SampleTest.java @@ -22,9 +22,9 @@ import java.util.Arrays; import java.util.List; import org.junit.Assert; -import org.junit.Test; +import org.junit.jupiter.api.Test; -public class SampleTest { +class SampleTest { private final RegionTag regionTag = RegionTag.builder().setServiceName("serviceName").setRpcName("rpcName").build(); private final List sampleBody = @@ -33,14 +33,14 @@ public class SampleTest { Arrays.asList(CommentStatement.withComment(BlockComment.withComment("apache license"))); @Test - public void sampleNoRegionTag() { + void sampleNoRegionTag() { Assert.assertThrows( IllegalStateException.class, () -> Sample.builder().setBody(sampleBody).setFileHeader(header).build()); } @Test - public void sampleValidMissingFields() { + void sampleValidMissingFields() { Sample sample = Sample.builder().setRegionTag(regionTag).build(); Assert.assertEquals(ImmutableList.of(), sample.fileHeader()); @@ -50,7 +50,7 @@ public void sampleValidMissingFields() { } @Test - public void sampleWithHeader() { + void sampleWithHeader() { Sample sample = Sample.builder().setRegionTag(regionTag).setBody(sampleBody).build(); Assert.assertEquals(ImmutableList.of(), sample.fileHeader()); @@ -59,7 +59,7 @@ public void sampleWithHeader() { } @Test - public void sampleNameWithRegionTag() { + void sampleNameWithRegionTag() { Sample sample = Sample.builder().setRegionTag(regionTag).build(); Assert.assertEquals("SyncRpcName", sample.name()); @@ -73,7 +73,7 @@ public void sampleNameWithRegionTag() { } @Test - public void sampleNameWithRegionTagCanonical() { + void sampleNameWithRegionTagCanonical() { String disambig = "Disambiguation"; Sample sample = Sample.builder().setRegionTag(regionTag.withOverloadDisambiguation(disambig)).build(); @@ -86,7 +86,7 @@ public void sampleNameWithRegionTagCanonical() { } @Test - public void sampleCanonicalOverload() { + void sampleCanonicalOverload() { String disambig = "Disambiguation"; Sample sample = Sample.builder().setRegionTag(regionTag.withOverloadDisambiguation(disambig)).build(); diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/model/ServiceTest.java b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/model/ServiceTest.java index c6f60b831f..624431fdd8 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/model/ServiceTest.java +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/model/ServiceTest.java @@ -14,62 +14,213 @@ package com.google.api.generator.gapic.model; +import static com.google.common.truth.Truth.assertThat; import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertNull; +import static org.junit.Assert.assertThrows; +import static org.junit.Assert.assertTrue; +import com.google.api.generator.engine.ast.TypeNode; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableSet; import java.util.Arrays; -import org.junit.Test; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; -public class ServiceTest { +class ServiceTest { private static final String SHOWCASE_PACKAGE_NAME = "com.google.showcase.v1beta1"; - private static final Service.Builder testServiceBuilder = - Service.builder() - .setName("Echo") - .setDefaultHost("localhost:7469") - .setOauthScopes(Arrays.asList("https://www.googleapis.com/auth/cloud-platform")) - .setPakkage(SHOWCASE_PACKAGE_NAME) - .setProtoPakkage(SHOWCASE_PACKAGE_NAME) - .setOriginalJavaPackage(SHOWCASE_PACKAGE_NAME) - .setOverriddenName("Echo"); - - @Test - public void apiShortName_shouldReturnApiShortNameIfHostContainsRegionalEndpoint() { + private Service.Builder testServiceBuilder; + + private static final Method.Builder testMethodBuilder = + Method.builder() + .setName("My method") + .setInputType(TypeNode.STRING) + .setOutputType(TypeNode.STRING); + + private static final HttpBindings.Builder testHttpBindingsBuilder = + HttpBindings.builder() + .setPathParameters( + ImmutableSet.of(HttpBindings.HttpBinding.builder().setName("table").build())) + .setPattern("/pattern/test") + .setAdditionalPatterns(Arrays.asList("/extra_pattern/test", "/extra_pattern/hey")) + .setIsAsteriskBody(false) + .setHttpVerb(HttpBindings.HttpVerb.GET); + + @BeforeEach + void init() { + testServiceBuilder = + Service.builder() + .setName("Echo") + .setDefaultHost("localhost:7469") + .setOauthScopes(Arrays.asList("https://www.googleapis.com/auth/cloud-platform")) + .setPakkage(SHOWCASE_PACKAGE_NAME) + .setProtoPakkage(SHOWCASE_PACKAGE_NAME) + .setOriginalJavaPackage(SHOWCASE_PACKAGE_NAME) + .setOverriddenName("Echo"); + } + + @Test + void apiShortName_shouldReturnApiShortNameIfHostContainsRegionalEndpoint() { String defaultHost = "us-east1-pubsub.googleapis.com"; Service testService = testServiceBuilder.setDefaultHost(defaultHost).build(); assertEquals("pubsub", testService.apiShortName()); } @Test - public void apiShortName_shouldReturnApiShortName() { + void apiShortName_shouldReturnApiShortName() { String defaultHost = "logging.googleapis.com"; Service testService = testServiceBuilder.setDefaultHost(defaultHost).build(); assertEquals("logging", testService.apiShortName()); } @Test - public void apiShortName_shouldReturnApiShortNameForIam() { + void apiShortName_shouldReturnApiShortNameForIam() { String defaultHost = "iam-meta-api.googleapis.com"; Service testService = testServiceBuilder.setDefaultHost(defaultHost).build(); assertEquals("iam", testService.apiShortName()); } @Test - public void apiShortName_shouldReturnHostIfNoPeriods() { + void apiShortName_shouldReturnHostIfNoPeriods() { String defaultHost = "logging:7469"; Service testService = testServiceBuilder.setDefaultHost(defaultHost).build(); assertEquals("logging:7469", testService.apiShortName()); } @Test - public void apiVersion_shouldReturnVersionIfMatch() { + void packageVersion_shouldReturnVersionIfMatch() { String protoPackage = "com.google.showcase.v1"; Service testService = testServiceBuilder.setProtoPakkage(protoPackage).build(); - assertEquals("v1", testService.apiVersion()); + assertEquals("v1", testService.packageVersion()); } @Test - public void apiVersion_shouldReturnEmptyIfNoMatch() { + void packageVersion_shouldReturnEmptyIfNoMatch() { String protoPackage = "com.google.showcase"; Service testService = testServiceBuilder.setProtoPakkage(protoPackage).build(); + assertEquals("", testService.packageVersion()); + } + + @Test + void apiVersion_shouldReturnApiVersion() { + String apiVersion = "v1_20230601"; + Service testService = testServiceBuilder.setApiVersion(apiVersion).build(); + assertTrue(testService.hasApiVersion()); + assertEquals(apiVersion, testService.apiVersion()); + } + + @Test + void apiVersion_shouldReturnNoApiVersionWhenNull() { + Service testService = testServiceBuilder.build(); + assertNull(testService.apiVersion()); + assertFalse(testService.hasApiVersion()); + } + + @Test + void apiVersion_shouldReturnNoApiVersionWhenEmpty() { + String apiVersion = ""; + Service testService = testServiceBuilder.setApiVersion(apiVersion).build(); assertEquals("", testService.apiVersion()); + assertFalse(testService.hasApiVersion()); + } + + @Test + void hasAnyEnabledMethodsForTransport_shouldReturnFalseForEmptyMethodListForBothTransports() { + Service testService = testServiceBuilder.setMethods(ImmutableList.of()).build(); + assertThat(testService.hasAnyEnabledMethodsForTransport(Transport.GRPC)).isFalse(); + assertThat(testService.hasAnyEnabledMethodsForTransport(Transport.REST)).isFalse(); + } + + @Test + void hasAnyEnabledMethodsForTransport_shouldReturnTrueForAnyNonEmptyMethodListGRPCTransport() { + Method testMethod1 = + testMethodBuilder + .setStream(Method.Stream.NONE) + .setHttpBindings(testHttpBindingsBuilder.build()) + .build(); + Service testService1 = testServiceBuilder.setMethods(ImmutableList.of(testMethod1)).build(); + assertThat(testService1.hasAnyEnabledMethodsForTransport(Transport.GRPC)).isTrue(); + + Method testMethod2 = + testMethodBuilder + .setStream(Method.Stream.BIDI) + .setHttpBindings(testHttpBindingsBuilder.build()) + .build(); + Service testService2 = testServiceBuilder.setMethods(ImmutableList.of(testMethod2)).build(); + assertThat(testService2.hasAnyEnabledMethodsForTransport(Transport.GRPC)).isTrue(); + + Service testService3 = + testServiceBuilder.setMethods(ImmutableList.of(testMethod1, testMethod2)).build(); + assertThat(testService3.hasAnyEnabledMethodsForTransport(Transport.GRPC)).isTrue(); + } + + @Test + void + hasAnyEnabledMethodsForTransport_shouldReturnTrueForAnyNonEmptyAndValidMethodListRESTTransport() { + Method testMethod1 = + testMethodBuilder + .setStream(Method.Stream.NONE) + .setHttpBindings(testHttpBindingsBuilder.build()) + .build(); + Service testService1 = testServiceBuilder.setMethods(ImmutableList.of(testMethod1)).build(); + assertThat(testService1.hasAnyEnabledMethodsForTransport(Transport.REST)).isTrue(); + + Method testMethod2 = + testMethodBuilder + .setStream(Method.Stream.SERVER) + .setHttpBindings(testHttpBindingsBuilder.build()) + .build(); + Service testService2 = testServiceBuilder.setMethods(ImmutableList.of(testMethod2)).build(); + assertThat(testService2.hasAnyEnabledMethodsForTransport(Transport.REST)).isTrue(); + + Service testService3 = + testServiceBuilder.setMethods(ImmutableList.of(testMethod1, testMethod2)).build(); + assertThat(testService3.hasAnyEnabledMethodsForTransport(Transport.REST)).isTrue(); + } + + @Test + void + hasAnyEnabledMethodsForTransport_shouldReturnFalseForAnyNonEmptyButInvalidMethodListRESTTransport() { + Method testMethod1 = + testMethodBuilder + .setStream(Method.Stream.BIDI) + .setHttpBindings(testHttpBindingsBuilder.build()) + .build(); + Service testService1 = testServiceBuilder.setMethods(ImmutableList.of(testMethod1)).build(); + assertThat(testService1.hasAnyEnabledMethodsForTransport(Transport.REST)).isFalse(); + + Method testMethod2 = + testMethodBuilder + .setStream(Method.Stream.CLIENT) + .setHttpBindings(testHttpBindingsBuilder.build()) + .build(); + Service testService2 = testServiceBuilder.setMethods(ImmutableList.of(testMethod2)).build(); + assertThat(testService2.hasAnyEnabledMethodsForTransport(Transport.REST)).isFalse(); + + Service testService3 = + testServiceBuilder.setMethods(ImmutableList.of(testMethod1, testMethod2)).build(); + assertThat(testService3.hasAnyEnabledMethodsForTransport(Transport.REST)).isFalse(); + } + + @Test + void hasAnyEnabledMethodsForTransport_shouldThrowExceptionForGRPCRESTTransport() { + Service testService = testServiceBuilder.build(); + assertThrows( + IllegalArgumentException.class, + () -> testService.hasAnyEnabledMethodsForTransport(Transport.GRPC_REST)); + } + + @Test + void hostServiceName_googleApisDefaultHost() { + Service service = testServiceBuilder.setDefaultHost("test.googleapis.com").build(); + assertThat(service.hostServiceName()).isEqualTo("test"); + } + + @Test + void hostServiceName_nonGoogleApisDefaultHost() { + // Default Host is localhost:7469 + Service service = testServiceBuilder.build(); + assertThat(service.hostServiceName()).isEqualTo(""); } } diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/model/TransportTest.java b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/model/TransportTest.java new file mode 100644 index 0000000000..f5f4b1ca8a --- /dev/null +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/model/TransportTest.java @@ -0,0 +1,38 @@ +package com.google.api.generator.gapic.model; + +import static com.google.common.truth.Truth.assertThat; +import static org.junit.Assert.assertThrows; + +import java.util.stream.Stream; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.Arguments; +import org.junit.jupiter.params.provider.MethodSource; + +class TransportTest { + + static Stream data() { + return Stream.of( + Arguments.of("grpc", Transport.GRPC), + Arguments.of("Grpc", Transport.GRPC), + Arguments.of("gRPC", Transport.GRPC), + Arguments.of("rest", Transport.REST), + Arguments.of("REST", Transport.REST), + Arguments.of("rESt", Transport.REST), + Arguments.of("grpc+rest", Transport.GRPC_REST), + Arguments.of("gRPC+REST", Transport.GRPC_REST), + Arguments.of("grPc+rEst", Transport.GRPC_REST)); + } + + @ParameterizedTest + @MethodSource("data") + void testParse_returnsValidTransport(String input, Transport expected) { + assertThat(expected).isEqualTo(Transport.parse(input)); + } + + @Test + void testParse_throwsException() { + assertThrows(IllegalArgumentException.class, () -> Transport.parse("invalid transport")); + assertThrows(IllegalArgumentException.class, () -> Transport.parse("grHttpc")); + } +} diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/protoparser/BatchingSettingsConfigParserTest.java b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/protoparser/BatchingSettingsConfigParserTest.java index 3430c2585d..244346766a 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/protoparser/BatchingSettingsConfigParserTest.java +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/protoparser/BatchingSettingsConfigParserTest.java @@ -24,14 +24,14 @@ import java.nio.file.Paths; import java.util.List; import java.util.Optional; -import org.junit.Test; +import org.junit.jupiter.api.Test; -public class BatchingSettingsConfigParserTest { +class BatchingSettingsConfigParserTest { private static final String YAML_DIRECTORY = "src/test/resources/"; @Test - public void parseGapicSettings_plain() { + void parseGapicSettings_plain() { String filename = "datastore_gapic.yaml"; Path path = Paths.get(YAML_DIRECTORY, filename); Optional> settingsOpt = @@ -40,7 +40,7 @@ public void parseGapicSettings_plain() { } @Test - public void parseGapicSettings_noMethodSettings() { + void parseGapicSettings_noMethodSettings() { String filename = "showcase_gapic.yaml"; Path path = Paths.get(YAML_DIRECTORY, filename); Optional> settingsOpt = @@ -49,7 +49,7 @@ public void parseGapicSettings_noMethodSettings() { } @Test - public void parseBatchingSettings_logging() { + void parseBatchingSettings_logging() { String filename = "logging_gapic.yaml"; Path path = Paths.get(YAML_DIRECTORY, filename); Optional> settingsOpt = @@ -82,7 +82,7 @@ public void parseBatchingSettings_logging() { } @Test - public void parseBatchingSettings_pubsub() { + void parseBatchingSettings_pubsub() { String filename = "pubsub_gapic.yaml"; Path path = Paths.get(YAML_DIRECTORY, filename); Optional> settingsOpt = diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/protoparser/GapicLanguageSettingsParserTest.java b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/protoparser/GapicLanguageSettingsParserTest.java index 868231d516..c41b770bdd 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/protoparser/GapicLanguageSettingsParserTest.java +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/protoparser/GapicLanguageSettingsParserTest.java @@ -21,14 +21,14 @@ import java.nio.file.Path; import java.nio.file.Paths; import java.util.Optional; -import org.junit.Test; +import org.junit.jupiter.api.Test; -public class GapicLanguageSettingsParserTest { +class GapicLanguageSettingsParserTest { private static final String YAML_DIRECTORY = "src/test/resources/"; @Test - public void parseLanguageSettings_onlyInterfacePresent() { + void parseLanguageSettings_onlyInterfacePresent() { String filename = "datastore_gapic.yaml"; Path path = Paths.get(YAML_DIRECTORY, filename); Optional settingsOpt = @@ -40,7 +40,7 @@ public void parseLanguageSettings_onlyInterfacePresent() { } @Test - public void parseLanguageSettings_methodNameOverridesPresent() { + void parseLanguageSettings_methodNameOverridesPresent() { String filename = "logging_gapic.yaml"; Path path = Paths.get(YAML_DIRECTORY, filename); Optional settingsOpt = diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/protoparser/GapicLroRetrySettingsParserTest.java b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/protoparser/GapicLroRetrySettingsParserTest.java index 0c7f8e7d82..0ecdc78fbe 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/protoparser/GapicLroRetrySettingsParserTest.java +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/protoparser/GapicLroRetrySettingsParserTest.java @@ -22,15 +22,15 @@ import java.nio.file.Paths; import java.util.List; import java.util.Optional; -import org.junit.Test; +import org.junit.jupiter.api.Test; -public class GapicLroRetrySettingsParserTest { +class GapicLroRetrySettingsParserTest { private static final double DELTA = 0.0001; private static final String YAML_DIRECTORY = "src/test/resources/"; @Test - public void parseLroRetrySettings_methodsPresentNoLroRetrySettings() { + void parseLroRetrySettings_methodsPresentNoLroRetrySettings() { String filename = "datastore_gapic.yaml"; Path path = Paths.get(YAML_DIRECTORY, filename); Optional> settingsOpt = @@ -39,7 +39,7 @@ public void parseLroRetrySettings_methodsPresentNoLroRetrySettings() { } @Test - public void parseGapicSettings_noMethodSettings() { + void parseGapicSettings_noMethodSettings() { String filename = "showcase_gapic.yaml"; Path path = Paths.get(YAML_DIRECTORY, filename); Optional> settingsOpt = @@ -48,7 +48,7 @@ public void parseGapicSettings_noMethodSettings() { } @Test - public void parseLroRetrySettings_lroRetrySettingsPresent() { + void parseLroRetrySettings_lroRetrySettingsPresent() { String filename = "dataproc_gapic.yaml"; Path path = Paths.get(YAML_DIRECTORY, filename); Optional> settingsOpt = diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/protoparser/HttpRuleParserTest.java b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/protoparser/HttpRuleParserTest.java index 5269e1d982..77a0440319 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/protoparser/HttpRuleParserTest.java +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/protoparser/HttpRuleParserTest.java @@ -31,12 +31,12 @@ import java.util.HashSet; import java.util.Map; import java.util.stream.Collectors; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; -public class HttpRuleParserTest { +class HttpRuleParserTest { @Test - public void parseHttpAnnotation_basic() { + void parseHttpAnnotation_basic() { FileDescriptor testingFileDescriptor = TestingOuterClass.getDescriptor(); ServiceDescriptor testingService = testingFileDescriptor.getServices().get(0); assertEquals("Testing", testingService.getName()); @@ -61,7 +61,7 @@ public void parseHttpAnnotation_basic() { } @Test - public void parseHttpAnnotation_multipleBindings() { + void parseHttpAnnotation_multipleBindings() { FileDescriptor testingFileDescriptor = TestingOuterClass.getDescriptor(); ServiceDescriptor testingService = testingFileDescriptor.getServices().get(0); assertEquals("Testing", testingService.getName()); @@ -81,7 +81,7 @@ public void parseHttpAnnotation_multipleBindings() { } @Test - public void parseHttpAnnotation_missingFieldFromMessage() { + void parseHttpAnnotation_missingFieldFromMessage() { FileDescriptor testingFileDescriptor = TestingOuterClass.getDescriptor(); ServiceDescriptor testingService = testingFileDescriptor.getServices().get(0); assertEquals("Testing", testingService.getName()); @@ -97,8 +97,7 @@ public void parseHttpAnnotation_missingFieldFromMessage() { } @Test - public void - parseHttpAnnotation_shouldPutAllFieldsIntoQueryParamsIfPathParamAndBodyAreNotConfigured() { + void parseHttpAnnotation_shouldPutAllFieldsIntoQueryParamsIfPathParamAndBodyAreNotConfigured() { FileDescriptor fileDescriptor = HttpRuleParserTestingOuterClass.getDescriptor(); ServiceDescriptor serviceDescriptor = fileDescriptor.getServices().get(0); assertEquals("HttpRuleParserTesting", serviceDescriptor.getName()); @@ -124,7 +123,7 @@ public void parseHttpAnnotation_missingFieldFromMessage() { Truth.assertThat(new HashSet<>(actual.queryParameters())).containsExactly(expected1, expected2); } - @Ignore + @Disabled @Test // request // / \ @@ -137,8 +136,8 @@ public void parseHttpAnnotation_missingFieldFromMessage() { // will then serialize all sub fields to query params. // We need to either traverse all the leaf level fields and exclude field in the generator or pass // the excluded fields to gax-java. Re-enable this test once - // https://github.com/googleapis/gapic-generator-java/issues/1041 is fixed - public void parseHttpAnnotation_shouldExcludeFieldsFromQueryParamsIfPathParamsAreConfigured() { + // https://github.com/googleapis/sdk-platform-java/issues/1041 is fixed + void parseHttpAnnotation_shouldExcludeFieldsFromQueryParamsIfPathParamsAreConfigured() { FileDescriptor fileDescriptor = HttpRuleParserTestingOuterClass.getDescriptor(); ServiceDescriptor serviceDescriptor = fileDescriptor.getServices().get(0); assertEquals("HttpRuleParserTesting", serviceDescriptor.getName()); diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/protoparser/MethodSignatureParserTest.java b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/protoparser/MethodSignatureParserTest.java index 68a2bbc66b..10bb943c6c 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/protoparser/MethodSignatureParserTest.java +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/protoparser/MethodSignatureParserTest.java @@ -28,12 +28,12 @@ import java.util.function.BiFunction; import java.util.function.Function; import java.util.stream.Collectors; -import org.junit.Test; +import org.junit.jupiter.api.Test; -public class MethodSignatureParserTest { +class MethodSignatureParserTest { @Test - public void flattenMethodSignatures_basic() { + void flattenMethodSignatures_basic() { String fooName = "fooName"; TypeNode fooTypeOne = TypeNode.withReference( @@ -70,7 +70,7 @@ public void flattenMethodSignatures_basic() { } @Test - public void flattenMethodSignatures_oneToMany() { + void flattenMethodSignatures_oneToMany() { String fooName = "fooName"; String anInt = "anInt"; @@ -110,7 +110,7 @@ public void flattenMethodSignatures_oneToMany() { } @Test - public void flattenMethodSignatures_manyToOne() { + void flattenMethodSignatures_manyToOne() { String fooName = "fooName"; String anInt = "anInt"; @@ -150,7 +150,7 @@ public void flattenMethodSignatures_manyToOne() { } @Test - public void flattenMethodSignatures_manyToMany() { + void flattenMethodSignatures_manyToMany() { String fooName = "fooName"; String barName = "barName"; String anInt = "anInt"; diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/protoparser/ParserTest.java b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/protoparser/ParserTest.java index 428b5156d9..e6325ded69 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/protoparser/ParserTest.java +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/protoparser/ParserTest.java @@ -15,30 +15,50 @@ package com.google.api.generator.gapic.protoparser; import static com.google.common.truth.Truth.assertThat; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertThrows; -import static org.junit.Assert.assertTrue; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertNull; +import static org.junit.jupiter.api.Assertions.assertThrows; +import static org.junit.jupiter.api.Assertions.assertTrue; +import com.google.api.ClientLibrarySettings; +import com.google.api.CommonLanguageSettings; +import com.google.api.FieldInfo.Format; +import com.google.api.JavaSettings; +import com.google.api.MethodSettings; +import com.google.api.Publishing; +import com.google.api.PythonSettings; +import com.google.api.SelectiveGapicGeneration; +import com.google.api.Service; import com.google.api.generator.engine.ast.ConcreteReference; import com.google.api.generator.engine.ast.Reference; import com.google.api.generator.engine.ast.TypeNode; import com.google.api.generator.engine.ast.VaporReference; import com.google.api.generator.gapic.model.Field; +import com.google.api.generator.gapic.model.GapicContext; import com.google.api.generator.gapic.model.Message; import com.google.api.generator.gapic.model.Method; import com.google.api.generator.gapic.model.MethodArgument; import com.google.api.generator.gapic.model.ResourceName; import com.google.api.generator.gapic.model.ResourceReference; import com.google.api.generator.gapic.model.Transport; +import com.google.api.generator.gapic.protoparser.Parser.SelectiveGapicType; +import com.google.api.version.test.ApiVersionTestingOuterClass; +import com.google.auto.populate.field.AutoPopulateFieldTestingOuterClass; import com.google.bookshop.v1beta1.BookshopProto; +import com.google.cloud.bigquery.v2.JobProto; import com.google.common.collect.ImmutableList; +import com.google.common.truth.Truth; import com.google.protobuf.Descriptors.FileDescriptor; import com.google.protobuf.Descriptors.MethodDescriptor; import com.google.protobuf.Descriptors.ServiceDescriptor; +import com.google.protobuf.compiler.PluginProtos.CodeGeneratorRequest; +import com.google.selective.generate.v1beta1.SelectiveApiGenerationOuterClass; import com.google.showcase.v1beta1.EchoOuterClass; import com.google.showcase.v1beta1.TestingOuterClass; import com.google.testgapic.v1beta1.LockerProto; +import java.nio.file.Path; +import java.nio.file.Paths; import java.util.Arrays; import java.util.Collections; import java.util.HashSet; @@ -46,24 +66,33 @@ import java.util.Map; import java.util.Optional; import java.util.Set; -import org.junit.Before; -import org.junit.Test; +import java.util.stream.Collectors; +import org.junit.Assert; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; -public class ParserTest { +class ParserTest { private static final String ECHO_PACKAGE = "com.google.showcase.v1beta1"; // TODO(miraleung): Backfill with more tests (e.g. field, message, methods) for Parser.java. private ServiceDescriptor echoService; private FileDescriptor echoFileDescriptor; - @Before - public void setUp() { + private static final String YAML_DIRECTORY = "src/test/resources/"; + + private Optional serviceYamlProtoOpt; + + @BeforeEach + void setUp() { echoFileDescriptor = EchoOuterClass.getDescriptor(); echoService = echoFileDescriptor.getServices().get(0); + String yamlFilename = "echo_v1beta1.yaml"; + Path yamlPath = Paths.get(YAML_DIRECTORY, yamlFilename); + serviceYamlProtoOpt = ServiceYamlParser.parse(yamlPath.toString()); assertEquals("Echo", echoService.getName()); } @Test - public void parseMessages_basic() { + void parseMessages_basic() { // TODO(miraleung): Add more tests for oneofs and other message-parsing edge cases. Map messageTypes = Parser.parseMessages(echoFileDescriptor); @@ -99,7 +128,7 @@ public void parseMessages_basic() { } @Test - public void parseMessages_fieldNameConflicts() { + void parseMessages_fieldNameConflicts() { FileDescriptor bookshopFileDescriptor = BookshopProto.getDescriptor(); Map messageTypes = Parser.parseMessages(bookshopFileDescriptor); Message requestMessage = messageTypes.get("com.google.bookshop.v1beta1.GetBookRequest"); @@ -110,7 +139,7 @@ public void parseMessages_fieldNameConflicts() { } @Test - public void parseMethods_basic() { + void parseMethods_basic() { Map messageTypes = Parser.parseMessages(echoFileDescriptor); Map resourceNames = Parser.parseResourceNames(echoFileDescriptor); Set outputResourceNames = new HashSet<>(); @@ -118,18 +147,21 @@ public void parseMethods_basic() { Parser.parseMethods( echoService, ECHO_PACKAGE, + ECHO_PACKAGE, messageTypes, resourceNames, Optional.empty(), + serviceYamlProtoOpt, outputResourceNames, Transport.GRPC); - assertEquals(10, methods.size()); + assertEquals(11, methods.size()); // Methods should appear in the same order as in the protobuf file. Method echoMethod = methods.get(0); assertEquals(echoMethod.name(), "Echo"); assertEquals(echoMethod.stream(), Method.Stream.NONE); + assertEquals(false, echoMethod.hasAutoPopulatedFields()); // Detailed method signature parsing tests are in a separate unit test. List> methodSignatures = echoMethod.methodSignatures(); @@ -157,18 +189,21 @@ public void parseMethods_basic() { TypeNode.withReference(createStatusReference()), ImmutableList.of(), expandMethod.methodSignatures().get(0).get(1)); + assertEquals(false, expandMethod.hasAutoPopulatedFields()); Method collectMethod = methods.get(2); assertEquals("Collect", collectMethod.name()); assertEquals(Method.Stream.CLIENT, collectMethod.stream()); + assertEquals(false, collectMethod.hasAutoPopulatedFields()); Method chatMethod = methods.get(3); assertEquals("Chat", chatMethod.name()); assertEquals(Method.Stream.BIDI, chatMethod.stream()); + assertEquals(false, chatMethod.hasAutoPopulatedFields()); } @Test - public void parseMethods_basicLro() { + void parseMethods_basicLro() { Map messageTypes = Parser.parseMessages(echoFileDescriptor); Map resourceNames = Parser.parseResourceNames(echoFileDescriptor); Set outputResourceNames = new HashSet<>(); @@ -176,13 +211,15 @@ public void parseMethods_basicLro() { Parser.parseMethods( echoService, ECHO_PACKAGE, + ECHO_PACKAGE, messageTypes, resourceNames, Optional.empty(), + Optional.empty(), outputResourceNames, Transport.GRPC); - assertEquals(10, methods.size()); + assertEquals(11, methods.size()); // Methods should appear in the same order as in the protobuf file. Method waitMethod = methods.get(7); @@ -195,7 +232,7 @@ public void parseMethods_basicLro() { } @Test - public void parseLro_missingResponseType() { + void parseLro_missingResponseType() { Map messageTypes = Parser.parseMessages(echoFileDescriptor); MethodDescriptor waitMethodDescriptor = echoService.getMethods().get(7); assertEquals("Wait", waitMethodDescriptor.getName()); @@ -205,7 +242,7 @@ public void parseLro_missingResponseType() { } @Test - public void parseLro_missingMetadataType() { + void parseLro_missingMetadataType() { Map messageTypes = Parser.parseMessages(echoFileDescriptor); MethodDescriptor waitMethodDescriptor = echoService.getMethods().get(7); assertEquals("Wait", waitMethodDescriptor.getName()); @@ -215,7 +252,7 @@ public void parseLro_missingMetadataType() { } @Test - public void parseMethodSignatures_empty() { + void parseMethodSignatures_empty() { // TODO(miraleung): Move this to MethodSignatureParserTest. MethodDescriptor methodDescriptor = echoService.getMethods().get(5); assertEquals("PagedExpand", methodDescriptor.getName()); @@ -236,7 +273,7 @@ public void parseMethodSignatures_empty() { } @Test - public void parseMethodSignatures_validArgstAndEmptyString() { + void parseMethodSignatures_validArgstAndEmptyString() { // TODO(miraleung): Move this to MethodSignatureParserTest. MethodDescriptor methodDescriptor = echoService.getMethods().get(0); assertEquals("Echo", methodDescriptor.getName()); @@ -259,7 +296,7 @@ public void parseMethodSignatures_validArgstAndEmptyString() { } @Test - public void parseMethodSignatures_basic() { + void parseMethodSignatures_basic() { MethodDescriptor echoMethodDescriptor = echoService.getMethods().get(0); TypeNode inputType = TypeParser.parseType(echoMethodDescriptor.getInputType()); Map messageTypes = Parser.parseMessages(echoFileDescriptor); @@ -338,7 +375,51 @@ public void parseMethodSignatures_basic() { } @Test - public void parseMessagesAndResourceNames_update() { + void parsePageSizeFieldName_basic() { + MethodDescriptor methodDescriptor = echoService.getMethods().get(5); + assertEquals("PagedExpand", methodDescriptor.getName()); + Map messageTypes = Parser.parseMessages(echoFileDescriptor); + String pageSizeFieldName = + Parser.parsePageSizeFieldName(methodDescriptor, messageTypes, Transport.GRPC); + assertEquals("page_size", pageSizeFieldName); + } + + @Test + void parsePageSizeFieldName_grpcLegacy() { + MethodDescriptor methodDescriptor = echoService.getMethods().get(10); + assertEquals("PagedExpandLegacy", methodDescriptor.getName()); + Map messageTypes = Parser.parseMessages(echoFileDescriptor); + String pageSizeFieldName = + Parser.parsePageSizeFieldName(methodDescriptor, messageTypes, Transport.GRPC); + assertNull(pageSizeFieldName); + } + + @Test + void parsePageSizeFieldName_restLegacy() { + MethodDescriptor methodDescriptor = echoService.getMethods().get(10); + assertEquals("PagedExpandLegacy", methodDescriptor.getName()); + Map messageTypes = Parser.parseMessages(echoFileDescriptor); + String pageSizeFieldName = + Parser.parsePageSizeFieldName(methodDescriptor, messageTypes, Transport.REST); + assertEquals("max_results", pageSizeFieldName); + } + + @Test + void parsePageSizeFieldName_bigqueryLegacy() { + FileDescriptor bqJobFileDescriptor = JobProto.getDescriptor(); + ServiceDescriptor jobService = bqJobFileDescriptor.getServices().get(0); + MethodDescriptor deleteJobMethodDescriptor = jobService.getMethods().get(0); + assertEquals("DeleteJob", deleteJobMethodDescriptor.getName()); + MethodDescriptor listJobsMethodDescriptor = jobService.getMethods().get(1); + assertEquals("ListJobs", listJobsMethodDescriptor.getName()); + Map messageTypes = Parser.parseMessages(bqJobFileDescriptor); + String pageSizeFieldName = + Parser.parsePageSizeFieldName(listJobsMethodDescriptor, messageTypes, Transport.GRPC); + assertEquals("max_results", pageSizeFieldName); + } + + @Test + void parseMessagesAndResourceNames_update() { FileDescriptor lockerServiceFileDescriptor = LockerProto.getDescriptor(); Map messageTypes = Parser.parseMessages(lockerServiceFileDescriptor); @@ -358,7 +439,7 @@ public void parseMessagesAndResourceNames_update() { } @Test - public void parseMessages_fieldsHaveResourceReferences() { + void parseMessages_fieldsHaveResourceReferences() { FileDescriptor lockerServiceFileDescriptor = LockerProto.getDescriptor(); Map messageTypes = Parser.parseMessages(lockerServiceFileDescriptor); @@ -400,7 +481,7 @@ public void parseMessages_fieldsHaveResourceReferences() { } @Test - public void parseFields_mapType() { + void parseFields_mapType() { FileDescriptor testingFileDescriptor = TestingOuterClass.getDescriptor(); ServiceDescriptor testingService = testingFileDescriptor.getServices().get(0); assertEquals(testingService.getName(), "Testing"); @@ -419,7 +500,133 @@ public void parseFields_mapType() { } @Test - public void parseResourceNames_inputTypeHasReferenceNotInMethodSignature() { + void parseFields_autoPopulated() { + Map messageTypes = + Parser.parseMessages(AutoPopulateFieldTestingOuterClass.getDescriptor()); + Message message = + messageTypes.get("com.google.auto.populate.field.AutoPopulateFieldTestingEchoRequest"); + Field field = message.fieldMap().get("request_id"); + assertEquals(false, field.isRequired()); + assertEquals(Format.UUID4, field.fieldInfoFormat()); + field = message.fieldMap().get("second_request_id"); + assertEquals(false, field.isRequired()); + assertEquals(Format.UUID4, field.fieldInfoFormat()); + field = message.fieldMap().get("third_request_id"); + assertEquals(false, field.isRequired()); + assertEquals(Format.UUID4, field.fieldInfoFormat()); + field = message.fieldMap().get("fourth_request_id"); + assertEquals(false, field.isRequired()); + assertEquals(Format.IPV4_OR_IPV6, field.fieldInfoFormat()); + field = message.fieldMap().get("fifth_request_id"); + assertEquals(false, field.isRequired()); + assertEquals(Format.UUID4, field.fieldInfoFormat()); + field = message.fieldMap().get("sixth_request_id"); + assertEquals(true, field.isRequired()); + assertEquals(Format.UUID4, field.fieldInfoFormat()); + + message = + messageTypes.get("com.google.auto.populate.field.AutoPopulateFieldTestingExpandRequest"); + field = message.fieldMap().get("request_id"); + assertEquals(false, field.isRequired()); + assertEquals(Format.UUID4, field.fieldInfoFormat()); + } + + @Test + void parseAutoPopulatedMethodsAndFields_exists() { + String yamlFilename = "auto_populate_field_testing.yaml"; + Path yamlPath = Paths.get(YAML_DIRECTORY, yamlFilename); + Map> autoPopulatedMethodsWithFields = + Parser.parseAutoPopulatedMethodsAndFields(ServiceYamlParser.parse(yamlPath.toString())); + + assertEquals( + true, + autoPopulatedMethodsWithFields.containsKey( + "google.auto.populate.field.AutoPopulateFieldTesting.AutoPopulateFieldTestingEcho")); + assertEquals( + Arrays.asList( + "request_id", + "second_request_id", + "third_request_id", + "fourth_request_id", + "non_existent_field"), + autoPopulatedMethodsWithFields.get( + "google.auto.populate.field.AutoPopulateFieldTesting.AutoPopulateFieldTestingEcho")); + } + + @Test + void parseAutoPopulatedMethodsAndFields_doesNotExist() { + String yamlFilename = "logging.yaml"; + Path yamlPath = Paths.get(YAML_DIRECTORY, yamlFilename); + Optional serviceYamlProtoOpt_Null = ServiceYamlParser.parse(yamlPath.toString()); + + Map> autoPopulatedMethodsWithFields = + Parser.parseAutoPopulatedMethodsAndFields(serviceYamlProtoOpt_Null); + assertEquals(true, autoPopulatedMethodsWithFields.isEmpty()); + } + + @Test + void parseAutoPopulatedMethodsAndFields_returnsEmptyMapIfServiceYamlIsNull() { + assertEquals(true, Parser.parseAutoPopulatedMethodsAndFields(Optional.empty()).isEmpty()); + } + + @Test + void parseAutoPopulatedMethodsAndFields_returnsMapOfMethodsAndAutoPopulatedFields() { + MethodSettings testMethodSettings = + MethodSettings.newBuilder() + .setSelector("test_method") + .addAutoPopulatedFields("test_field") + .addAutoPopulatedFields("test_field_2") + .build(); + MethodSettings testMethodSettings2 = + MethodSettings.newBuilder() + .setSelector("test_method_2") + .addAutoPopulatedFields("test_field_3") + .build(); + MethodSettings testMethodSettings3 = + MethodSettings.newBuilder().setSelector("test_method_3").build(); + Publishing testPublishing = + Publishing.newBuilder() + .addMethodSettings(testMethodSettings) + .addMethodSettings(testMethodSettings2) + .addMethodSettings(testMethodSettings3) + .build(); + Optional testService = + Optional.of(Service.newBuilder().setPublishing(testPublishing).build()); + Truth.assertThat(Parser.parseAutoPopulatedMethodsAndFields(testService).get("test_method")) + .containsExactly("test_field", "test_field_2"); + Truth.assertThat(Parser.parseAutoPopulatedMethodsAndFields(testService).get("test_method_2")) + .containsExactly("test_field_3"); + Truth.assertThat(Parser.parseAutoPopulatedMethodsAndFields(testService).get("test_method_3")) + .isEmpty(); + Truth.assertThat( + Parser.parseAutoPopulatedMethodsAndFields(testService).containsKey("test_method_4")) + .isEqualTo(false); + } + + @Test + void hasMethodSettings_shouldReturnFalseIfServiceYamlDoesNotExist() { + assertEquals(false, Parser.hasMethodSettings(Optional.empty())); + } + + @Test + void hasMethodSettings_shouldReturnFalseIfServiceYamlDoesNotHavePublishing() { + assertEquals(false, Parser.hasMethodSettings(Optional.of(Service.newBuilder().build()))); + } + + @Test + void hasMethodSettings_shouldReturnTrueIfServiceYamlHasNonEmptyMethodSettings() { + MethodSettings testMethodSettings = + MethodSettings.newBuilder().setSelector("test_method").build(); + Publishing testPublishing = + Publishing.newBuilder().addMethodSettings(testMethodSettings).build(); + assertEquals( + true, + Parser.hasMethodSettings( + Optional.of(Service.newBuilder().setPublishing(testPublishing).build()))); + } + + @Test + void parseResourceNames_inputTypeHasReferenceNotInMethodSignature() { FileDescriptor testingFileDescriptor = TestingOuterClass.getDescriptor(); ServiceDescriptor testingService = testingFileDescriptor.getServices().get(0); assertEquals(testingService.getName(), "Testing"); @@ -440,7 +647,7 @@ public void parseResourceNames_inputTypeHasReferenceNotInMethodSignature() { } @Test - public void sanitizeDefaultHost_basic() { + void sanitizeDefaultHost_basic() { String defaultHost = "localhost:1234"; assertEquals(defaultHost, Parser.sanitizeDefaultHost(defaultHost)); @@ -449,7 +656,7 @@ public void sanitizeDefaultHost_basic() { } @Test - public void parseNestedProtoTypeName() { + void parseNestedProtoTypeName() { assertEquals("MutateJobMetadata", Parser.parseNestedProtoTypeName("MutateJobMetadata")); assertEquals( "MutateJob.MutateJobMetadata", @@ -460,6 +667,325 @@ public void parseNestedProtoTypeName() { "google.ads.googleads.v3.resources.MutateJob.MutateJobMetadata")); } + @Test + void testParse_noServices_returnsEmptyGapicContext() { + GapicContext result = Parser.parse(CodeGeneratorRequest.newBuilder().build()); + assertEquals(GapicContext.EMPTY, result); + } + + @Test + void testParseServiceJavaPackage_emptyRequest_noop() { + assertThat(Parser.parseServiceJavaPackage(CodeGeneratorRequest.newBuilder().build())).isEmpty(); + } + + @Test + void parseServiceApiVersionTest() { + FileDescriptor apiVersionFileDescriptor = ApiVersionTestingOuterClass.getDescriptor(); + Map messageTypes = Parser.parseMessages(apiVersionFileDescriptor); + Map resourceNames = Parser.parseResourceNames(apiVersionFileDescriptor); + List services = + Parser.parseService( + apiVersionFileDescriptor, + messageTypes, + resourceNames, + Optional.empty(), + new HashSet<>()); + com.google.api.generator.gapic.model.Service parsedEchoService = services.get(0); + + assertEquals("EchoWithVersion", parsedEchoService.overriddenName()); + assertTrue(parsedEchoService.hasApiVersion()); + assertEquals("fake_version", parsedEchoService.apiVersion()); + } + + @Test + void parseServiceWithoutApiVersionTest() { + FileDescriptor apiVersionFileDescriptor = ApiVersionTestingOuterClass.getDescriptor(); + Map messageTypes = Parser.parseMessages(apiVersionFileDescriptor); + Map resourceNames = Parser.parseResourceNames(apiVersionFileDescriptor); + List services = + Parser.parseService( + apiVersionFileDescriptor, + messageTypes, + resourceNames, + Optional.empty(), + new HashSet<>()); + com.google.api.generator.gapic.model.Service parsedEchoWithoutVersionService = services.get(1); + + assertNull(parsedEchoWithoutVersionService.apiVersion()); + assertFalse(parsedEchoWithoutVersionService.hasApiVersion()); + assertEquals("EchoWithoutVersion", parsedEchoWithoutVersionService.overriddenName()); + } + + @Test + void parseServiceWithEmptyApiVersionTest() { + FileDescriptor apiVersionFileDescriptor = ApiVersionTestingOuterClass.getDescriptor(); + Map messageTypes = Parser.parseMessages(apiVersionFileDescriptor); + Map resourceNames = Parser.parseResourceNames(apiVersionFileDescriptor); + List services = + Parser.parseService( + apiVersionFileDescriptor, + messageTypes, + resourceNames, + Optional.empty(), + new HashSet<>()); + com.google.api.generator.gapic.model.Service parsedEchoWithEmptyVersionService = + services.get(2); + + assertEquals("EchoWithEmptyVersion", parsedEchoWithEmptyVersionService.overriddenName()); + assertEquals("", parsedEchoWithEmptyVersionService.apiVersion()); + assertFalse(parsedEchoWithEmptyVersionService.hasApiVersion()); + } + + @Test + void testServiceWithoutApiVersionParsed() { + FileDescriptor bookshopFileDescriptor = BookshopProto.getDescriptor(); + Map messageTypes = Parser.parseMessages(bookshopFileDescriptor); + Map resourceNames = Parser.parseResourceNames(bookshopFileDescriptor); + List services = + Parser.parseService( + bookshopFileDescriptor, messageTypes, resourceNames, Optional.empty(), new HashSet<>()); + com.google.api.generator.gapic.model.Service parsedBookshopService = services.get(0); + assertNull(parsedBookshopService.apiVersion()); + } + + @Test + void parseServiceWithNoMethodsTest() { + FileDescriptor fileDescriptor = + com.google.api.service.without.methods.test.ServiceWithNoMethodsOuterClass.getDescriptor(); + Map messageTypes = Parser.parseMessages(fileDescriptor); + Map resourceNames = Parser.parseResourceNames(fileDescriptor); + List services = + Parser.parseService( + fileDescriptor, messageTypes, resourceNames, Optional.empty(), new HashSet<>()); + assertEquals(1, services.size()); + assertEquals("EchoWithMethods", services.get(0).overriddenName()); + } + + @Test + void selectiveGenerationTest_shouldExcludeUnusedResourceNames() { + FileDescriptor fileDescriptor = SelectiveApiGenerationOuterClass.getDescriptor(); + Map messageTypes = Parser.parseMessages(fileDescriptor); + Map resourceNames = Parser.parseResourceNames(fileDescriptor); + + String serviceYamlFilename = "selective_api_generation_v1beta1.yaml"; + String testFilesDirectory = "src/test/resources/"; + Path serviceYamlPath = Paths.get(testFilesDirectory, serviceYamlFilename); + Optional serviceYamlOpt = + ServiceYamlParser.parse(serviceYamlPath.toString()); + Assert.assertTrue(serviceYamlOpt.isPresent()); + + Set helperResourceNames = new HashSet<>(); + Parser.parseService( + fileDescriptor, messageTypes, resourceNames, serviceYamlOpt, helperResourceNames); + // resource Name Foobarbaz is not present + assertEquals(2, helperResourceNames.size()); + assertTrue( + helperResourceNames.stream() + .map(ResourceName::variableName) + .collect(Collectors.toSet()) + .containsAll(ImmutableList.of("foobar", "anythingGoes"))); + } + + @Test + void selectiveGenerationTest_shouldGenerateOnlySelectiveMethodsWithGenerateOmittedFalse() { + FileDescriptor fileDescriptor = SelectiveApiGenerationOuterClass.getDescriptor(); + Map messageTypes = Parser.parseMessages(fileDescriptor); + Map resourceNames = Parser.parseResourceNames(fileDescriptor); + + // test with service yaml file to show usage of this feature, test itself + // can be done without this file and build a Service object from code. + String serviceYamlFilename = "selective_api_generation_v1beta1.yaml"; + String testFilesDirectory = "src/test/resources/"; + Path serviceYamlPath = Paths.get(testFilesDirectory, serviceYamlFilename); + Optional serviceYamlOpt = + ServiceYamlParser.parse(serviceYamlPath.toString()); + Assert.assertTrue(serviceYamlOpt.isPresent()); + + List services = + Parser.parseService( + fileDescriptor, messageTypes, resourceNames, serviceYamlOpt, new HashSet<>()); + assertEquals(1, services.size()); + assertEquals("EchoServiceShouldGeneratePartialUsual", services.get(0).overriddenName()); + assertEquals(3, services.get(0).methods().size()); + for (Method method : services.get(0).methods()) { + assertTrue(method.name().contains("ShouldGenerate")); + assertFalse(method.isInternalApi()); + } + } + + @Test + void selectiveGenerationTest_shouldGenerateOmittedAsInternalWithGenerateOmittedTrue() { + FileDescriptor fileDescriptor = SelectiveApiGenerationOuterClass.getDescriptor(); + Map messageTypes = Parser.parseMessages(fileDescriptor); + Map resourceNames = Parser.parseResourceNames(fileDescriptor); + + // test with service yaml file to show usage of this feature, test itself + // can be done without this file and build a Service object from code. + String serviceYamlFilename = "selective_api_generation_generate_omitted_v1beta1.yaml"; + String testFilesDirectory = "src/test/resources/"; + Path serviceYamlPath = Paths.get(testFilesDirectory, serviceYamlFilename); + Optional serviceYamlOpt = + ServiceYamlParser.parse(serviceYamlPath.toString()); + Assert.assertTrue(serviceYamlOpt.isPresent()); + + List services = + Parser.parseService( + fileDescriptor, messageTypes, resourceNames, serviceYamlOpt, new HashSet<>()); + + assertEquals(3, services.size()); + // Tests a service with public methods only. + assertEquals("EchoServiceShouldGenerateAllAsUsual", services.get(0).overriddenName()); + assertEquals(3, services.get(0).methods().size()); + for (Method method : services.get(0).methods()) { + assertFalse(method.isInternalApi()); + } + + // Tests a service with partial public methods and partial internal methods. + assertEquals("EchoServiceShouldGeneratePartialUsual", services.get(1).overriddenName()); + assertEquals(5, services.get(1).methods().size()); + for (Method method : services.get(1).methods()) { + if (method.name().contains("ShouldGenerateAsUsual")) { + assertFalse(method.isInternalApi()); + } else { + assertTrue(method.isInternalApi()); + } + } + // Tests a service with internal methods only. + assertEquals("EchoServiceShouldGenerateAllInternal", services.get(2).overriddenName()); + assertEquals(2, services.get(2).methods().size()); + for (Method method : services.get(2).methods()) { + assertTrue(method.isInternalApi()); + } + } + + @Test + void selectiveGenerationTest_shouldGenerateAsPublicIfNoPublishingSectionInServiceYaml() { + Service service = + Service.newBuilder() + .setTitle("Selective generation testing with no publishing section") + .build(); + Publishing publishing = service.getPublishing(); + Assert.assertEquals(0, publishing.getLibrarySettingsCount()); + + FileDescriptor fileDescriptor = SelectiveApiGenerationOuterClass.getDescriptor(); + List methods = fileDescriptor.getServices().get(0).getMethods(); + String protoPackage = "google.selective.generate.v1beta1"; + + assertEquals( + Parser.getMethodSelectiveGapicType(methods.get(0), Optional.of(service), protoPackage), + SelectiveGapicType.PUBLIC); + } + + @Test + void selectiveGenerationTest_shouldGenerateAsPublicWhenProtoPackageMismatch() { + String protoPackage = "google.selective.generate.v1beta1"; + + // situation where service yaml has different version stated + ClientLibrarySettings clientLibrarySettings = + ClientLibrarySettings.newBuilder().setVersion("google.selective.generate.v1").build(); + Publishing publishing = + Publishing.newBuilder().addLibrarySettings(clientLibrarySettings).build(); + Service service = + Service.newBuilder() + .setTitle( + "Selective generation test when proto package " + + "does not match library_settings version from service yaml") + .setPublishing(publishing) + .build(); + + FileDescriptor fileDescriptor = SelectiveApiGenerationOuterClass.getDescriptor(); + List methods = fileDescriptor.getServices().get(0).getMethods(); + + assertEquals( + Parser.getMethodSelectiveGapicType(methods.get(0), Optional.of(service), protoPackage), + SelectiveGapicType.PUBLIC); + } + + @Test + void selectiveGenerationTest_shouldGenerateAsPublicIfNoJavaSectionInServiceYaml() { + String protoPackage = "google.selective.generate.v1beta1"; + + // situation where service yaml has other language settings but no + // java settings in library_settings. + ClientLibrarySettings clientLibrarySettings = + ClientLibrarySettings.newBuilder() + .setVersion(protoPackage) + .setPythonSettings(PythonSettings.newBuilder().build()) + .build(); + Publishing publishing = + Publishing.newBuilder().addLibrarySettings(clientLibrarySettings).build(); + Service service = + Service.newBuilder() + .setTitle( + "Selective generation test when no java section in " + + "library_settings from service yaml") + .setPublishing(publishing) + .build(); + + Assert.assertEquals(1, publishing.getLibrarySettingsCount()); + + FileDescriptor fileDescriptor = SelectiveApiGenerationOuterClass.getDescriptor(); + List methods = fileDescriptor.getServices().get(0).getMethods(); + + assertEquals( + Parser.getMethodSelectiveGapicType(methods.get(0), Optional.of(service), protoPackage), + SelectiveGapicType.PUBLIC); + } + + @Test + void selectiveGenerationTest_shouldGenerateAsPublicIfMethodInList() { + String protoPackage = "google.selective.generate.v1beta1"; + String methodsAllowList = + "google.selective.generate.v1beta1.EchoServiceShouldGeneratePartialUsual.EchoShouldGenerateAsUsual"; + Service service = + createServiceWithSelectiveGapicConfiguration(protoPackage, methodsAllowList, true); + + FileDescriptor fileDescriptor = SelectiveApiGenerationOuterClass.getDescriptor(); + // methodToGenerate from fileDescriptor: + // google.selective.generate.v1beta1.EchoServiceShouldGeneratePartialUsual.EchoShouldGenerateAsUsual + MethodDescriptor methodToGenerate = fileDescriptor.getServices().get(1).getMethods().get(0); + + assertEquals( + Parser.getMethodSelectiveGapicType(methodToGenerate, Optional.of(service), protoPackage), + SelectiveGapicType.PUBLIC); + } + + @Test + void selectiveGenerationTest_shouldGenerateAsInternalIfMethodNotInListWithGenerateOmittedTrue() { + String protoPackage = "google.selective.generate.v1beta1"; + String methodsAllowList = + "google.selective.generate.v1beta1.EchoServiceShouldGeneratePartialUsual.EchoShouldGenerateAsUsual"; + Service service = + createServiceWithSelectiveGapicConfiguration(protoPackage, methodsAllowList, true); + + FileDescriptor fileDescriptor = SelectiveApiGenerationOuterClass.getDescriptor(); + // methodToGenerate from fileDescriptor: + // google.selective.generate.v1beta1.EchoServiceShouldGeneratePartialUsual.ChatShouldGenerateAsInternal + MethodDescriptor methodToGenerate = fileDescriptor.getServices().get(1).getMethods().get(3); + + assertEquals( + Parser.getMethodSelectiveGapicType(methodToGenerate, Optional.of(service), protoPackage), + SelectiveGapicType.INTERNAL); + } + + @Test + void selectiveGenerationTest_shouldGenerateAsHiddenIfMethodNotInListWithGenerateOmittedFalse() { + String protoPackage = "google.selective.generate.v1beta1"; + String methodsAllowList = + "google.selective.generate.v1beta1.EchoServiceShouldGeneratePartialUsual.EchoShouldGenerateAsUsual"; + Service service = + createServiceWithSelectiveGapicConfiguration(protoPackage, methodsAllowList, false); + + FileDescriptor fileDescriptor = SelectiveApiGenerationOuterClass.getDescriptor(); + // methodToGenerate from fileDescriptor: + // google.selective.generate.v1beta1.EchoServiceShouldGeneratePartialUsual.ChatShouldGenerateAsInternal + MethodDescriptor methodToGenerate = fileDescriptor.getServices().get(1).getMethods().get(3); + + assertEquals( + Parser.getMethodSelectiveGapicType(methodToGenerate, Optional.of(service), protoPackage), + SelectiveGapicType.HIDDEN); + } + private void assertMethodArgumentEquals( String name, TypeNode type, List nestedFields, MethodArgument argument) { assertEquals(name, argument.name()); @@ -470,4 +996,33 @@ private void assertMethodArgumentEquals( private static Reference createStatusReference() { return VaporReference.builder().setName("Status").setPakkage("com.google.rpc").build(); } + + private static Service createServiceWithSelectiveGapicConfiguration( + String protoPackage, String methodsAllowList, boolean generateOmittedAsInternal) { + // Create a service with method allow-list and generateOmittedAsInternal flag. + JavaSettings java_settings = + JavaSettings.newBuilder() + .setLibraryPackage("com.google.foobar.v1") + .putServiceClassNames("com.google.foo.v1.BarService", "BazService") + .setCommon( + CommonLanguageSettings.newBuilder() + .setSelectiveGapicGeneration( + SelectiveGapicGeneration.newBuilder() + .addMethods(methodsAllowList) + .setGenerateOmittedAsInternal(generateOmittedAsInternal))) + .build(); + ClientLibrarySettings clientLibrarySettings = + ClientLibrarySettings.newBuilder() + .setVersion(protoPackage) + .setJavaSettings(java_settings) + .build(); + Publishing publishing = + Publishing.newBuilder().addLibrarySettings(clientLibrarySettings).build(); + Service service = + Service.newBuilder() + .setTitle("Selective generation test") + .setPublishing(publishing) + .build(); + return service; + } } diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/protoparser/PatternParserTest.java b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/protoparser/PatternParserTest.java index 764c719af7..1ba2dd7d95 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/protoparser/PatternParserTest.java +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/protoparser/PatternParserTest.java @@ -17,22 +17,22 @@ import static com.google.common.truth.Truth.assertThat; import java.util.Set; -import org.junit.Test; +import org.junit.jupiter.api.Test; -public class PatternParserTest { +class PatternParserTest { @Test - public void getPattenBindings_shouldReturnEmptySetIfPatternIsEmpty() { + void getPattenBindings_shouldReturnEmptySetIfPatternIsEmpty() { assertThat(PatternParser.getPatternBindings("")).isEmpty(); } @Test - public void getPattenBindings_shouldFilterOutUnboundVariables() { + void getPattenBindings_shouldFilterOutUnboundVariables() { Set actual = PatternParser.getPatternBindings("{routing_id=projects/*}/**"); assertThat(actual).hasSize(1); } @Test - public void getPattenBindings_shouldReturnBindingsInNatualOrder() { + void getPattenBindings_shouldReturnBindingsInNatualOrder() { Set actual = PatternParser.getPatternBindings("{routing_id=projects/*}/{name=instance/*}"); assertThat(actual).containsExactly("name", "routing_id").inOrder(); diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/protoparser/PluginArgumentParserTest.java b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/protoparser/PluginArgumentParserTest.java index bebe828f71..848b92f776 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/protoparser/PluginArgumentParserTest.java +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/protoparser/PluginArgumentParserTest.java @@ -22,11 +22,11 @@ import com.google.protobuf.compiler.PluginProtos.CodeGeneratorRequest; import java.util.Arrays; -import org.junit.Test; +import org.junit.jupiter.api.Test; -public class PluginArgumentParserTest { +class PluginArgumentParserTest { @Test - public void parseJsonPath_onlyOnePresent() { + void parseJsonPath_onlyOnePresent() { String jsonPath = "/tmp/grpc_service_config.json"; assertEquals( jsonPath, @@ -34,7 +34,7 @@ public void parseJsonPath_onlyOnePresent() { } @Test - public void parseJsonPath_returnsFirstOneFound() { + void parseJsonPath_returnsFirstOneFound() { String jsonPathOne = "/tmp/foobar_grpc_service_config.json"; String jsonPathTwo = "/tmp/some_other_grpc_service_config.json"; assertEquals( @@ -49,7 +49,7 @@ public void parseJsonPath_returnsFirstOneFound() { } @Test - public void parseJsonPath_similarFileAppearsFirst() { + void parseJsonPath_similarFileAppearsFirst() { String jsonPath = "/tmp/foo_grpc_service_config.json"; String gapicPath = "/tmp/something_gapic.yaml"; String rawArgument = @@ -65,7 +65,7 @@ public void parseJsonPath_similarFileAppearsFirst() { } @Test - public void parseJsonPath_argumentHasSpaces() { + void parseJsonPath_argumentHasSpaces() { String jsonPath = "/tmp/foo_grpc_service_config.json"; String gapicPath = "/tmp/something_gapic.yaml"; String rawArgument = @@ -81,7 +81,7 @@ public void parseJsonPath_argumentHasSpaces() { } @Test - public void parseJsonPath_restAreEmpty() { + void parseJsonPath_restAreEmpty() { String jsonPath = "/tmp/foobar_grpc_service_config.json"; String gapicPath = ""; String rawArgument = @@ -90,14 +90,14 @@ public void parseJsonPath_restAreEmpty() { } @Test - public void parseJsonPath_noneFound() { + void parseJsonPath_noneFound() { String gapicPath = "/tmp/something_gapic.yaml"; String rawArgument = String.join(",", Arrays.asList(gapicPath)); assertFalse(PluginArgumentParser.parseJsonConfigPath(rawArgument).isPresent()); } @Test - public void parseGapicYamlPath_onlyOnePresent() { + void parseGapicYamlPath_onlyOnePresent() { String gapicPath = "/tmp/something_gapic.yaml"; assertEquals( gapicPath, @@ -105,7 +105,7 @@ public void parseGapicYamlPath_onlyOnePresent() { } @Test - public void parseGapicYamlPath_returnsFirstOneFound() { + void parseGapicYamlPath_returnsFirstOneFound() { String gapicPathOne = "/tmp/something_gapic.yaml"; String gapicPathTwo = "/tmp/other_gapic.yaml"; assertEquals( @@ -119,7 +119,7 @@ public void parseGapicYamlPath_returnsFirstOneFound() { } @Test - public void parseGapicYamlPath_similarFileAppearsFirst() { + void parseGapicYamlPath_similarFileAppearsFirst() { String jsonPath = "/tmp/foo_grpc_service_config.json"; String gapicPath = "/tmp/something_gapic.yaml"; String rawArgument = @@ -134,7 +134,7 @@ public void parseGapicYamlPath_similarFileAppearsFirst() { } @Test - public void parseGapicYamlPath_restAreEmpty() { + void parseGapicYamlPath_restAreEmpty() { String jsonPath = ""; String gapicPath = "/tmp/something_gapic.yaml"; String rawArgument = @@ -143,7 +143,7 @@ public void parseGapicYamlPath_restAreEmpty() { } @Test - public void parseGapicYamlPath_noneFound() { + void parseGapicYamlPath_noneFound() { String jsonPath = "/tmp/foo_grpc_service_config.json"; String gapicPath = ""; String rawArgument = @@ -152,7 +152,7 @@ public void parseGapicYamlPath_noneFound() { } @Test - public void parseServiceYamlPath_onlyOnePresent() { + void parseServiceYamlPath_onlyOnePresent() { String servicePath = "/tmp/something.yaml"; assertEquals( servicePath, @@ -160,7 +160,7 @@ public void parseServiceYamlPath_onlyOnePresent() { } @Test - public void parseServiceYamlPath_returnsFirstOneFound() { + void parseServiceYamlPath_returnsFirstOneFound() { String servicePathOne = "/tmp/something.yaml"; String servicePathTwo = "/tmp/other.yaml"; assertEquals( @@ -174,7 +174,7 @@ public void parseServiceYamlPath_returnsFirstOneFound() { } @Test - public void parseServiceYamlPath_gapicFilePresent() { + void parseServiceYamlPath_gapicFilePresent() { String gapicPath = "/tmp/something_gapic.yaml"; String servicePath = "/tmp/something.yaml"; // Both passed under the service yaml flag. @@ -203,7 +203,7 @@ public void parseServiceYamlPath_gapicFilePresent() { } @Test - public void parseServiceYamlPath_similarFileAppearsFirst() { + void parseServiceYamlPath_similarFileAppearsFirst() { String jsonPath = "/tmp/foo_grpc_service_config.json"; String gapicPath = "/tmp/something_gapic.yaml"; String servicePath = "/tmp/something.yaml"; @@ -220,7 +220,7 @@ public void parseServiceYamlPath_similarFileAppearsFirst() { } @Test - public void parseServiceYamlPath_noneFound() { + void parseServiceYamlPath_noneFound() { String jsonPath = "/tmp/foo_grpc_service_config.json"; String gapicPath = ""; String rawArgument = @@ -229,7 +229,7 @@ public void parseServiceYamlPath_noneFound() { } @Test - public void hasMetadataFlag() { + void hasMetadataFlag() { CodeGeneratorRequest request = CodeGeneratorRequest.newBuilder() .setParameter(String.join(",", KEY_METADATA, "does-not-matter")) @@ -238,7 +238,7 @@ public void hasMetadataFlag() { } @Test - public void hasNumericEnumFlag() { + void hasNumericEnumFlag() { CodeGeneratorRequest request = CodeGeneratorRequest.newBuilder() .setParameter(String.join(",", KEY_NUMERIC_ENUM, "does-not-matter")) @@ -247,7 +247,7 @@ public void hasNumericEnumFlag() { } @Test - public void hasFlag_noneFound() { + void hasFlag_noneFound() { String jsonPath = "/tmp/foo_grpc_service_config.json"; String gapicPath = ""; String rawArgument = @@ -261,7 +261,7 @@ public void hasFlag_noneFound() { } @Test - public void hasFlag_flagFound() { + void hasFlag_flagFound() { String jsonPath = "/tmp/foo_grpc_service_config.json"; String gapicPath = ""; String rawArgument = @@ -269,6 +269,28 @@ public void hasFlag_flagFound() { assertTrue(PluginArgumentParser.hasFlag(rawArgument, KEY_METADATA)); } + @Test + void parseRepo() { + String repo = "googleapis/sdk-platform-java"; + String rawArgument = String.format("repo=%s", repo); + assertEquals( + repo, + PluginArgumentParser.parseRepo( + CodeGeneratorRequest.newBuilder().setParameter(rawArgument).build()) + .get()); + } + + @Test + void parseArtifact() { + String artifact = "com.google.cloud:google-cloud-library"; + String rawArgument = String.format("artifact=%s", artifact); + assertEquals( + artifact, + PluginArgumentParser.parseArtifact( + CodeGeneratorRequest.newBuilder().setParameter(rawArgument).build()) + .get()); + } + private static String createGrpcServiceConfig(String path) { return String.format("%s=%s", PluginArgumentParser.KEY_GRPC_SERVICE_CONFIG, path); } diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/protoparser/ResourceNameParserTest.java b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/protoparser/ResourceNameParserTest.java index 04b6622b5a..d10cf818b3 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/protoparser/ResourceNameParserTest.java +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/protoparser/ResourceNameParserTest.java @@ -31,21 +31,21 @@ import java.util.List; import java.util.Map; import java.util.Optional; -import org.junit.Before; -import org.junit.Test; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; -public class ResourceNameParserTest { +class ResourceNameParserTest { private static final String MAIN_PACKAGE = "com.google.testgapic.v1beta1"; private FileDescriptor lockerServiceFileDescriptor; - @Before - public void setUp() { + @BeforeEach + void setUp() { lockerServiceFileDescriptor = LockerProto.getDescriptor(); } @Test - public void parseResourceNames_basicOnePattern() { + void parseResourceNames_basicOnePattern() { Map typeStringsToResourceNames = ResourceNameParser.parseResourceNamesFromFile(lockerServiceFileDescriptor); assertEquals(4, typeStringsToResourceNames.size()); @@ -63,7 +63,7 @@ public void parseResourceNames_basicOnePattern() { } @Test - public void parseResourceNames_basicTwoPatterns() { + void parseResourceNames_basicTwoPatterns() { Map typeStringsToResourceNames = ResourceNameParser.parseResourceNamesFromFile(lockerServiceFileDescriptor); assertEquals(4, typeStringsToResourceNames.size()); @@ -81,7 +81,7 @@ public void parseResourceNames_basicTwoPatterns() { } @Test - public void parseResourceNames_wildcard() { + void parseResourceNames_wildcard() { Map typeStringsToResourceNames = ResourceNameParser.parseResourceNamesFromFile(lockerServiceFileDescriptor); assertEquals(4, typeStringsToResourceNames.size()); @@ -101,7 +101,7 @@ public void parseResourceNames_wildcard() { } @Test - public void parseResourceNames_deletedTopic() { + void parseResourceNames_deletedTopic() { Map typeStringsToResourceNames = ResourceNameParser.parseResourceNamesFromFile(lockerServiceFileDescriptor); assertEquals(4, typeStringsToResourceNames.size()); @@ -117,7 +117,7 @@ public void parseResourceNames_deletedTopic() { } @Test - public void parseResourceNames_messageResourceDefinition() { + void parseResourceNames_messageResourceDefinition() { String pakkage = TypeParser.getPackage(lockerServiceFileDescriptor); List messageDescriptors = lockerServiceFileDescriptor.getMessageTypes(); Map typeStringsToResourceNames = @@ -137,7 +137,7 @@ public void parseResourceNames_messageResourceDefinition() { } @Test - public void parseResourceNames_badMessageResourceNameDefinitionMissingNameField() { + void parseResourceNames_badMessageResourceNameDefinitionMissingNameField() { FileDescriptor protoFileDescriptor = BadMessageResnameDefProto.getDescriptor(); List messageDescriptors = protoFileDescriptor.getMessageTypes(); Descriptor messageDescriptor = messageDescriptors.get(0); @@ -149,7 +149,7 @@ public void parseResourceNames_badMessageResourceNameDefinitionMissingNameField( } @Test - public void parseResourceNameFromMessage_basicResourceDefinition() { + void parseResourceNameFromMessage_basicResourceDefinition() { String pakkage = TypeParser.getPackage(lockerServiceFileDescriptor); List messageDescriptors = lockerServiceFileDescriptor.getMessageTypes(); Descriptor documentMessageDescriptor = messageDescriptors.get(0); @@ -161,7 +161,7 @@ public void parseResourceNameFromMessage_basicResourceDefinition() { } @Test - public void parseResourceNamesFromMessage_noResourceDefinition() { + void parseResourceNamesFromMessage_noResourceDefinition() { String pakkage = TypeParser.getPackage(lockerServiceFileDescriptor); List messageDescriptors = lockerServiceFileDescriptor.getMessageTypes(); Descriptor folderMessageDescriptor = messageDescriptors.get(1); @@ -172,7 +172,7 @@ public void parseResourceNamesFromMessage_noResourceDefinition() { } @Test - public void parseResourceNameFromMessage_nonNameResourceReferenceField() { + void parseResourceNameFromMessage_nonNameResourceReferenceField() { String pakkage = TypeParser.getPackage(lockerServiceFileDescriptor); List messageDescriptors = lockerServiceFileDescriptor.getMessageTypes(); Descriptor binderMessageDescriptor = messageDescriptors.get(2); @@ -184,7 +184,7 @@ public void parseResourceNameFromMessage_nonNameResourceReferenceField() { } @Test - public void parseResourceNamesFromMessage_noNameOrResourceReferenceField() { + void parseResourceNamesFromMessage_noNameOrResourceReferenceField() { FileDescriptor protoFileDescriptor = BadMessageResnameDefProto.getDescriptor(); String pakkage = TypeParser.getPackage(protoFileDescriptor); List messageDescriptors = protoFileDescriptor.getMessageTypes(); @@ -197,14 +197,14 @@ public void parseResourceNamesFromMessage_noNameOrResourceReferenceField() { } @Test - public void getVariableName_basicPattern() { + void getVariableName_basicPattern() { Optional nameOpt = ResourceNameParser.getVariableNameFromPattern("projects/{project}"); assertTrue(nameOpt.isPresent()); assertEquals("project", nameOpt.get()); } @Test - public void getVariableName_basicPatternLonger() { + void getVariableName_basicPatternLonger() { Optional nameOpt = ResourceNameParser.getVariableNameFromPattern( "projects/{project}/billingAccounts/{billing_account}"); @@ -213,7 +213,7 @@ public void getVariableName_basicPatternLonger() { } @Test - public void getVariableName_differentCasedName() { + void getVariableName_differentCasedName() { Optional nameOpt = ResourceNameParser.getVariableNameFromPattern( "projects/{project}/billingAccounts/{billingAccOunt}"); @@ -222,7 +222,7 @@ public void getVariableName_differentCasedName() { } @Test - public void getVariableName_singletonEnding() { + void getVariableName_singletonEnding() { Optional nameOpt = ResourceNameParser.getVariableNameFromPattern("projects/{project}/cmekSettings"); assertTrue(nameOpt.isPresent()); @@ -230,7 +230,7 @@ public void getVariableName_singletonEnding() { } @Test - public void getVariableName_onlyLiterals() { + void getVariableName_onlyLiterals() { Optional nameOpt = ResourceNameParser.getVariableNameFromPattern("projects/project/locations/location"); assertTrue(nameOpt.isPresent()); @@ -238,7 +238,7 @@ public void getVariableName_onlyLiterals() { } @Test - public void getVariableName_deletedTopic() { + void getVariableName_deletedTopic() { Optional nameOpt = ResourceNameParser.getVariableNameFromPattern(ResourceNameConstants.DELETED_TOPIC_LITERAL); assertTrue(nameOpt.isPresent()); @@ -246,7 +246,7 @@ public void getVariableName_deletedTopic() { } @Test - public void getVariableName_wildcard() { + void getVariableName_wildcard() { Optional nameOpt = ResourceNameParser.getVariableNameFromPattern(ResourceNameConstants.WILDCARD_PATTERN); assertFalse(nameOpt.isPresent()); diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/protoparser/ResourceReferenceParserTest.java b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/protoparser/ResourceReferenceParserTest.java index b5f1725d4c..950a555587 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/protoparser/ResourceReferenceParserTest.java +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/protoparser/ResourceReferenceParserTest.java @@ -26,21 +26,21 @@ import java.util.HashMap; import java.util.Map; import java.util.Optional; -import org.junit.Before; -import org.junit.Test; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; -public class ResourceReferenceParserTest { +class ResourceReferenceParserTest { private static final String MAIN_PACKAGE = "com.google.testgapic.v1beta1"; private FileDescriptor lockerServiceFileDescriptor; - @Before - public void setUp() { + @BeforeEach + void setUp() { lockerServiceFileDescriptor = LockerProto.getDescriptor(); } @Test - public void parseParentResourceName_createFromPattern() { + void parseParentResourceName_createFromPattern() { String resourceNamePackage = String.format("%s.common", MAIN_PACKAGE); String domainName = "cloudbilling.googleapis.com"; String description = "This is the resource name description"; @@ -76,7 +76,7 @@ public void parseParentResourceName_createFromPattern() { } @Test - public void parseParentResourceName_parentResourceNameExists() { + void parseParentResourceName_parentResourceNameExists() { Map typeStringsToResourceNames = ResourceNameParser.parseResourceNamesFromFile(lockerServiceFileDescriptor); @@ -103,7 +103,7 @@ public void parseParentResourceName_parentResourceNameExists() { } @Test - public void parseParentResourceName_badPattern() { + void parseParentResourceName_badPattern() { Optional parentResourceNameOpt = ResourceReferenceParser.parseParentResourceName( "projects/{project}/billingAccounts", @@ -117,19 +117,19 @@ public void parseParentResourceName_badPattern() { } @Test - public void resolvePackages_resourcePackageIsSubpackageOfService() { + void resolvePackages_resourcePackageIsSubpackageOfService() { String resourcePackage = "com.google.testgapic.v1beta1.common"; assertEquals( resourcePackage, ResourceReferenceParser.resolvePackages(resourcePackage, MAIN_PACKAGE)); } @Test - public void resolvePackages_resourcePackageIsSameAsService() { + void resolvePackages_resourcePackageIsSameAsService() { assertEquals(MAIN_PACKAGE, ResourceReferenceParser.resolvePackages(MAIN_PACKAGE, MAIN_PACKAGE)); } @Test - public void resolvePackages_resourcePackageIsNotSubpackageOfService() { + void resolvePackages_resourcePackageIsNotSubpackageOfService() { assertEquals( MAIN_PACKAGE, ResourceReferenceParser.resolvePackages("com.google.cloud", MAIN_PACKAGE)); } diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/protoparser/RoutingRuleParserTest.java b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/protoparser/RoutingRuleParserTest.java index 0908d79080..02e8bf1902 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/protoparser/RoutingRuleParserTest.java +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/protoparser/RoutingRuleParserTest.java @@ -25,9 +25,9 @@ import com.google.protobuf.Descriptors.MethodDescriptor; import com.google.protobuf.Descriptors.ServiceDescriptor; import java.util.Map; -import org.junit.Test; +import org.junit.jupiter.api.Test; -public class RoutingRuleParserTest { +class RoutingRuleParserTest { private static final FileDescriptor TESTING_FILE_DESCRIPTOR = RoutingRuleParserTestingOuterClass.getDescriptor(); @@ -35,13 +35,13 @@ public class RoutingRuleParserTest { TESTING_FILE_DESCRIPTOR.getServices().get(0); @Test - public void parse_shouldReturnNullRoutingHeadersIfMethodHasNoRoutingRules() { + void parse_shouldReturnNullRoutingHeadersIfMethodHasNoRoutingRules() { RoutingHeaderRule actual = getRoutingHeaders(0); assertThat(actual).isNull(); } @Test - public void parse_shouldSetPathTemplateToWildcardIfNotDefined() { + void parse_shouldSetPathTemplateToWildcardIfNotDefined() { RoutingHeaderRule actual = getRoutingHeaders(1); RoutingHeaderParam expected = RoutingHeaderParam.create("name", "name", String.format("{%s=**}", "name")); @@ -49,7 +49,7 @@ public void parse_shouldSetPathTemplateToWildcardIfNotDefined() { } @Test - public void parse_shouldThrowExceptionIfPathTemplateHasZeroNamedSegment() { + void parse_shouldThrowExceptionIfPathTemplateHasZeroNamedSegment() { IllegalArgumentException illegalArgumentException = assertThrows(IllegalArgumentException.class, () -> getRoutingHeaders(2)); assertThat(illegalArgumentException.getMessage()) @@ -60,7 +60,7 @@ public void parse_shouldThrowExceptionIfPathTemplateHasZeroNamedSegment() { } @Test - public void parse_shouldThrowExceptionIfPathTemplateHasMoreThanOneNamedSegment() { + void parse_shouldThrowExceptionIfPathTemplateHasMoreThanOneNamedSegment() { IllegalArgumentException illegalArgumentException = assertThrows(IllegalArgumentException.class, () -> getRoutingHeaders(3)); assertThat(illegalArgumentException.getMessage()) @@ -71,7 +71,7 @@ public void parse_shouldThrowExceptionIfPathTemplateHasMoreThanOneNamedSegment() } @Test - public void parse_shouldParseRoutingRulesWithOneParameter() { + void parse_shouldParseRoutingRulesWithOneParameter() { RoutingHeaderRule actual = getRoutingHeaders(4); RoutingHeaderParam expected = RoutingHeaderParam.create("name", "rename", "/v1beta1/{rename=tests/*}"); @@ -79,7 +79,7 @@ public void parse_shouldParseRoutingRulesWithOneParameter() { } @Test - public void parse_shouldParseRoutingRulesWithMultipleParameter() { + void parse_shouldParseRoutingRulesWithMultipleParameter() { RoutingHeaderRule actual = getRoutingHeaders(5); RoutingHeaderParam expectedHeader1 = RoutingHeaderParam.create("name", "rename", "/v1beta1/{rename=tests/*}"); @@ -91,7 +91,7 @@ public void parse_shouldParseRoutingRulesWithMultipleParameter() { } @Test - public void parse_shouldParseRoutingRulesWithNestedFields() { + void parse_shouldParseRoutingRulesWithNestedFields() { RoutingHeaderRule actual = getRoutingHeaders(6); RoutingHeaderParam expectedHeader1 = RoutingHeaderParam.create("account.name", "rename", "/v1beta1/{rename=tests/*}"); @@ -99,7 +99,7 @@ public void parse_shouldParseRoutingRulesWithNestedFields() { } @Test - public void parse_shouldThrowExceptionIfFieldValidationFailed() { + void parse_shouldThrowExceptionIfFieldValidationFailed() { assertThrows(Exception.class, () -> getRoutingHeaders(7)); } diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/protoparser/ServiceConfigParserTest.java b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/protoparser/ServiceConfigParserTest.java index 8a27f7fd4f..80b28ed12c 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/protoparser/ServiceConfigParserTest.java +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/protoparser/ServiceConfigParserTest.java @@ -25,15 +25,15 @@ import java.nio.file.Path; import java.nio.file.Paths; import java.util.Optional; -import org.junit.Test; +import org.junit.jupiter.api.Test; -public class ServiceConfigParserTest { +class ServiceConfigParserTest { private static final String JSON_DIRECTORY = "src/test/resources/"; private static final double EPSILON = 1e-4; @Test - public void parseServiceConfig_basic() { + void parseServiceConfig_basic() { String jsonFilename = "retrying_grpc_service_config.json"; Path jsonPath = Paths.get(JSON_DIRECTORY, jsonFilename); Optional configOpt = ServiceConfigParser.parseFile(jsonPath.toString()); @@ -60,7 +60,7 @@ public void parseServiceConfig_basic() { } @Test - public void parseServiceConfig_showcase() { + void parseServiceConfig_showcase() { String jsonFilename = "showcase_grpc_service_config.json"; Path jsonPath = Paths.get(JSON_DIRECTORY, jsonFilename); Optional configOpt = ServiceConfigParser.parseFile(jsonPath.toString()); @@ -79,7 +79,7 @@ public void parseServiceConfig_showcase() { } @Test - public void parseBadServiceConfig_missingFile() { + void parseBadServiceConfig_missingFile() { String jsonFilename = "does_not_exist_grpc_service_config.json"; Path jsonPath = Paths.get(JSON_DIRECTORY, jsonFilename); Optional configOpt = ServiceConfigParser.parseFile(jsonPath.toString()); @@ -87,7 +87,7 @@ public void parseBadServiceConfig_missingFile() { } @Test - public void parseBadServiceConfig_malformedJson() { + void parseBadServiceConfig_malformedJson() { String jsonFilename = "malformed_grpc_service_config.json"; Path jsonPath = Paths.get(JSON_DIRECTORY, jsonFilename); Optional configOpt = ServiceConfigParser.parseFile(jsonPath.toString()); @@ -95,7 +95,7 @@ public void parseBadServiceConfig_malformedJson() { } @Test - public void parseBadServiceConfig_badProtoFields() { + void parseBadServiceConfig_badProtoFields() { String jsonFilename = "bad_proto_fields_grpc_service_config.json"; Path jsonPath = Paths.get(JSON_DIRECTORY, jsonFilename); Optional configOpt = ServiceConfigParser.parseFile(jsonPath.toString()); @@ -103,7 +103,7 @@ public void parseBadServiceConfig_badProtoFields() { } @Test - public void parseBadServiceConfig_nullOrEmptyPath() { + void parseBadServiceConfig_nullOrEmptyPath() { Optional configOpt = ServiceConfigParser.parseFile(null); assertFalse(configOpt.isPresent()); diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/protoparser/ServiceYamlParserTest.java b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/protoparser/ServiceYamlParserTest.java index 8df9ddcf84..a9270e2113 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/protoparser/ServiceYamlParserTest.java +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/protoparser/ServiceYamlParserTest.java @@ -17,17 +17,21 @@ import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertTrue; +import com.google.api.MethodSettings; +import com.google.api.Publishing; +import com.google.common.truth.Truth; import java.nio.file.Path; import java.nio.file.Paths; +import java.util.List; import java.util.Optional; -import org.junit.Test; +import org.junit.jupiter.api.Test; -public class ServiceYamlParserTest { +class ServiceYamlParserTest { private static final String YAML_DIRECTORY = "src/test/resources/"; @Test - public void parseServiceYaml_basic() { + void parseServiceYaml_basic() { String yamlFilename = "logging.yaml"; Path yamlPath = Paths.get(YAML_DIRECTORY, yamlFilename); Optional serviceYamlProtoOpt = @@ -37,4 +41,37 @@ public void parseServiceYaml_basic() { com.google.api.Service serviceYamlProto = serviceYamlProtoOpt.get(); assertEquals("logging.googleapis.com", serviceYamlProto.getName()); } + + // TODO: Add more scenarios (e.g. null MethodSettings, null PublishingSettings, incorrect + // FieldNames, etc.) + @Test + void parseServiceYaml_autoPopulatedFields() { + String yamlFilename = "auto_populate_field_testing.yaml"; + Path yamlPath = Paths.get(YAML_DIRECTORY, yamlFilename); + Optional serviceYamlProtoOpt = + ServiceYamlParser.parse(yamlPath.toString()); + assertTrue(serviceYamlProtoOpt.isPresent()); + + com.google.api.Service serviceYamlProto = serviceYamlProtoOpt.get(); + assertEquals("autopopulatefieldtesting.googleapis.com", serviceYamlProto.getName()); + + Publishing publishingSettings = serviceYamlProto.getPublishing(); + List methodSettings = publishingSettings.getMethodSettingsList(); + Truth.assertThat(methodSettings.size() == 2); + Truth.assertThat(methodSettings.get(0).getSelector()) + .isEqualTo( + "google.auto.populate.field.AutoPopulateFieldTesting.AutoPopulateFieldTestingEcho"); + Truth.assertThat(methodSettings.get(0).getAutoPopulatedFieldsList()) + .containsExactly( + "request_id", + "second_request_id", + "third_request_id", + "fourth_request_id", + "non_existent_field"); + Truth.assertThat(methodSettings.get(1).getSelector()) + .isEqualTo( + "google.auto.populate.field.AutoPopulateFieldTesting.AutoPopulateFieldTestingExpand"); + Truth.assertThat(methodSettings.get(1).getAutoPopulatedFieldsList()) + .containsExactly("request_id"); + } } diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/protoparser/SourceCodeInfoParserTest.java b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/protoparser/SourceCodeInfoParserTest.java index 40b9eb12f0..c9e40a8274 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/protoparser/SourceCodeInfoParserTest.java +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/protoparser/SourceCodeInfoParserTest.java @@ -32,10 +32,10 @@ import java.nio.file.Paths; import java.util.ArrayList; import java.util.List; -import org.junit.Before; -import org.junit.Test; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; -public class SourceCodeInfoParserTest { +class SourceCodeInfoParserTest { private static final String BASIC_PROTO = "basic.proto"; private static final String PROTO_DESCRIPTOR_SET = "test-proto.descriptorset"; @@ -43,14 +43,14 @@ public class SourceCodeInfoParserTest { private SourceCodeInfoParser parser; private FileDescriptor protoFile; - @Before - public void setUp() throws Exception { + @BeforeEach + void setUp() throws Exception { parser = new SourceCodeInfoParser(); protoFile = buildFileDescriptor(); } @Test - public void getServiceInfo() { + void getServiceInfo() { SourceCodeInfoLocation location = parser.getLocation(protoFile.findServiceByName("FooService")); assertEquals( "This is a service description.\n It takes up multiple lines, like so.", @@ -61,7 +61,7 @@ public void getServiceInfo() { } @Test - public void getMethodInfo() { + void getMethodInfo() { ServiceDescriptor service = protoFile.findServiceByName("FooService"); SourceCodeInfoLocation location = parser.getLocation(service.findMethodByName("FooMethod")); assertEquals( @@ -74,7 +74,7 @@ public void getMethodInfo() { } @Test - public void getOuterMessageInfo() { + void getOuterMessageInfo() { Descriptor message = protoFile.findMessageTypeByName("FooMessage"); SourceCodeInfoLocation location = parser.getLocation(message); assertEquals( @@ -95,7 +95,7 @@ public void getOuterMessageInfo() { } @Test - public void getInnerMessageInfo() { + void getInnerMessageInfo() { Descriptor message = protoFile.findMessageTypeByName("FooMessage"); assertThat(message).isNotNull(); message = message.findNestedTypeByName("BarMessage"); @@ -113,7 +113,7 @@ public void getInnerMessageInfo() { } @Test - public void getOuterEnumInfo() { + void getOuterEnumInfo() { EnumDescriptor protoEnum = protoFile.findEnumTypeByName("OuterEnum"); SourceCodeInfoLocation location = parser.getLocation(protoEnum); assertEquals("This is an outer enum.", location.getLeadingComments()); @@ -124,7 +124,7 @@ public void getOuterEnumInfo() { } @Test - public void getInnerEnumInfo() { + void getInnerEnumInfo() { Descriptor message = protoFile.findMessageTypeByName("FooMessage"); EnumDescriptor protoEnum = message.findEnumTypeByName("FoodEnum"); SourceCodeInfoLocation location = parser.getLocation(protoEnum); @@ -138,7 +138,7 @@ public void getInnerEnumInfo() { } @Test - public void getOnoeofInfo() { + void getOnoeofInfo() { Descriptor message = protoFile.findMessageTypeByName("FooMessage"); OneofDescriptor protoOneof = message.getOneofs().get(0); SourceCodeInfoLocation location = parser.getLocation(protoOneof); diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/protoparser/TypeParserTest.java b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/protoparser/TypeParserTest.java index a79460e915..aea2c9cfc1 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/protoparser/TypeParserTest.java +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/protoparser/TypeParserTest.java @@ -14,21 +14,39 @@ package com.google.api.generator.gapic.protoparser; +import static com.google.common.truth.Truth.assertThat; import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertThrows; import com.google.api.generator.engine.ast.Reference; +import com.google.api.generator.gapic.model.LongrunningOperation; +import com.google.api.generator.gapic.model.Message; +import com.google.cloud.location.LocationsProto; +import com.google.protobuf.DescriptorProtos; import com.google.protobuf.Descriptors.Descriptor; import com.google.protobuf.Descriptors.FileDescriptor; import com.google.protobuf.Descriptors.MethodDescriptor; import com.google.protobuf.Descriptors.ServiceDescriptor; import com.google.showcase.v1beta1.EchoOuterClass; +import com.google.test.collisions.CollisionsOuterClass; import com.google.testgapic.v1beta1.NestedMessageProto; -import org.junit.Test; +import java.util.Map; +import org.junit.jupiter.api.Test; -public class TypeParserTest { +class TypeParserTest { // TODO(miraleung): Backfill with more tests (e.g. field, message, methods) for Parser.java. + + private static final FileDescriptor COLLISIONS_FILE_DESCRIPTOR = + CollisionsOuterClass.getDescriptor(); + private static final FileDescriptor DESCRIPTOR_PROTOS_FILE_DESCRIPTOR = + DescriptorProtos.getDescriptor(); + private static final FileDescriptor LOCATION_PROTO_FILE_DESCRIPTOR = + LocationsProto.getDescriptor(); + private static final ServiceDescriptor COLLISIONS_SERVICE = + COLLISIONS_FILE_DESCRIPTOR.getServices().get(0); + @Test - public void parseMessageType_basic() { + void parseMessageType_basic() { FileDescriptor echoFileDescriptor = EchoOuterClass.getDescriptor(); ServiceDescriptor echoService = echoFileDescriptor.getServices().get(0); assertEquals("Echo", echoService.getName()); @@ -39,7 +57,7 @@ public void parseMessageType_basic() { } @Test - public void parseMessageType_nested() { + void parseMessageType_nested() { FileDescriptor fileDescriptor = NestedMessageProto.getDescriptor(); Descriptor messageDescriptor = fileDescriptor.getMessageTypes().get(0); assertEquals("Outer", messageDescriptor.getName()); @@ -51,4 +69,73 @@ public void parseMessageType_nested() { Reference reference = TypeParser.parseMessageReference(messageDescriptor); assertEquals("com.google.testgapic.v1beta1.Outer.Middle.Inner", reference.fullName()); } + + @Test + void parseLroResponseMetadataType_shortName_shouldMatchSamePackage() { + Map messageTypes = Parser.parseMessages(COLLISIONS_FILE_DESCRIPTOR); + messageTypes.putAll(Parser.parseMessages(DESCRIPTOR_PROTOS_FILE_DESCRIPTOR)); + messageTypes.putAll(Parser.parseMessages(LOCATION_PROTO_FILE_DESCRIPTOR)); + MethodDescriptor shouldUseSamePackageTypesLro = COLLISIONS_SERVICE.getMethods().get(0); + + assertEquals(COLLISIONS_SERVICE.getName(), "Collisions"); + assertThat(messageTypes) + .containsKey("com.google.protobuf.DescriptorProtos.GeneratedCodeInfo.Annotation"); + assertThat(messageTypes) + .containsKey("com.google.protobuf.DescriptorProtos.SourceCodeInfo.Location"); + assertThat(messageTypes).containsKey("com.google.cloud.location.Location"); + + LongrunningOperation testLro = + Parser.parseLro( + TypeParser.getPackage(COLLISIONS_FILE_DESCRIPTOR), + shouldUseSamePackageTypesLro, + messageTypes); + + assertThat(testLro.responseType().reference().fullName()) + .isEqualTo("com.google.test.collisions.Annotation"); + assertThat(testLro.metadataType().reference().fullName()) + .isEqualTo("com.google.test.collisions.Location"); + } + + @Test + void parseLroResponseMetadataType_shortName_shouldNotMatch() { + Map messageTypes = Parser.parseMessages(COLLISIONS_FILE_DESCRIPTOR); + messageTypes.putAll(Parser.parseMessages(DESCRIPTOR_PROTOS_FILE_DESCRIPTOR)); + MethodDescriptor shortNameMatchShouldThrowLro = COLLISIONS_SERVICE.getMethods().get(1); + + assertEquals(COLLISIONS_SERVICE.getName(), "Collisions"); + assertThat(messageTypes) + .containsKey("com.google.protobuf.DescriptorProtos.ExtensionRangeOptions.Declaration"); + + assertThrows( + NullPointerException.class, + () -> + Parser.parseLro( + TypeParser.getPackage(COLLISIONS_FILE_DESCRIPTOR), + shortNameMatchShouldThrowLro, + messageTypes)); + } + + @Test + void parseLroResponseMetadataType_shortName_withFullyQualifiedCollision() { + Map messageTypes = Parser.parseMessages(COLLISIONS_FILE_DESCRIPTOR); + messageTypes.putAll(Parser.parseMessages(DESCRIPTOR_PROTOS_FILE_DESCRIPTOR)); + messageTypes.putAll(Parser.parseMessages(LOCATION_PROTO_FILE_DESCRIPTOR)); + MethodDescriptor fullNameForDifferentPackageLro = COLLISIONS_SERVICE.getMethods().get(2); + + assertEquals(COLLISIONS_SERVICE.getName(), "Collisions"); + assertThat(messageTypes).containsKey("com.google.cloud.location.Location"); + assertThat(messageTypes) + .containsKey("com.google.protobuf.DescriptorProtos.SourceCodeInfo.Location"); + + LongrunningOperation testLro = + Parser.parseLro( + TypeParser.getPackage(COLLISIONS_FILE_DESCRIPTOR), + fullNameForDifferentPackageLro, + messageTypes); + + assertThat(testLro.responseType().reference().fullName()) + .isEqualTo("com.google.cloud.location.Location"); + assertThat(testLro.metadataType().reference().fullName()) + .isEqualTo("com.google.test.collisions.Location"); + } } diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/protowriter/WriterTest.java b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/protowriter/WriterTest.java new file mode 100644 index 0000000000..c366d2085e --- /dev/null +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/protowriter/WriterTest.java @@ -0,0 +1,147 @@ +package com.google.api.generator.gapic.protowriter; + +import static com.google.common.truth.Truth.assertThat; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNull; +import static org.junit.jupiter.api.Assertions.assertThrows; +import static org.junit.jupiter.api.Assertions.assertTrue; + +import com.google.api.generator.engine.ast.PackageInfoDefinition; +import com.google.api.generator.gapic.model.GapicClass; +import com.google.api.generator.gapic.model.GapicContext; +import com.google.api.generator.gapic.model.GapicPackageInfo; +import com.google.api.generator.gapic.model.ReflectConfig; +import com.google.common.collect.ImmutableList; +import com.google.common.reflect.TypeToken; +import com.google.gson.Gson; +import com.google.protobuf.ByteString; +import com.google.protobuf.compiler.PluginProtos.CodeGeneratorResponse; +import java.io.File; +import java.io.IOException; +import java.io.InputStreamReader; +import java.io.Reader; +import java.nio.file.Files; +import java.nio.file.Path; +import java.util.Collections; +import java.util.Enumeration; +import java.util.List; +import java.util.jar.JarEntry; +import java.util.jar.JarFile; +import java.util.jar.JarOutputStream; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.io.TempDir; + +class WriterTest { + private static final TypeToken> REFLECT_CONFIG_JSON_FORMAT = + new TypeToken>() {}; + + @TempDir Path tempDir; + private JarOutputStream jarOutputStream; + private File file; + + @BeforeEach + void createJarOutputStream() throws IOException { + Path path = tempDir.resolve("test.jar"); + jarOutputStream = new JarOutputStream(Files.newOutputStream(path)); + file = path.toFile(); + } + + private void closeJarOutputStream() throws IOException { + jarOutputStream.finish(); + jarOutputStream.flush(); + jarOutputStream.close(); + } + + @AfterEach + void assertJarOutputStream_isClosed() { + assertThrows( + IOException.class, () -> jarOutputStream.putNextEntry(new JarEntry("should.fail"))); + } + + @Test + void reflectConfig_notWritten_ifEmptyInput() throws IOException { + Writer.writeReflectConfigFile("com.google", Collections.emptyList(), jarOutputStream); + + closeJarOutputStream(); + + try (JarFile jarFile = new JarFile(file)) { + assertThat(jarFile.entries().hasMoreElements()).isFalse(); + } + } + + @Test + void reflectConfig_isWritten() throws IOException { + Writer.writeReflectConfigFile( + "com.google", + Collections.singletonList(new ReflectConfig("com.google.Class")), + jarOutputStream); + + closeJarOutputStream(); + + try (JarFile jarFile = new JarFile(file)) { + Enumeration entries = jarFile.entries(); + assertThat(entries.hasMoreElements()).isTrue(); + JarEntry entry = entries.nextElement(); + assertThat(entries.hasMoreElements()).isFalse(); + + try (Reader reader = new InputStreamReader(jarFile.getInputStream(entry))) { + List configs = + new Gson().fromJson(reader, REFLECT_CONFIG_JSON_FORMAT.getType()); + + assertThat(configs).hasSize(1); + ReflectConfig config = configs.get(0); + assertEquals("com.google.Class", config.getName()); + } + } + } + + @Test + void write_emptyGapicContext_writesNoBytes() throws IOException { + ByteString.Output output = ByteString.newOutput(); + CodeGeneratorResponse response = + Writer.write( + GapicContext.EMPTY, + Collections.emptyList(), + null, + Collections.emptyList(), + "temp-codegen.srcjar", + jarOutputStream, + output); + assertTrue(output.size() == 0); + closeJarOutputStream(); + } + + @Test + void write_emptyGapicContextAndFilledPackageInfo_succeeds() throws IOException { + ByteString.Output output = ByteString.newOutput(); + CodeGeneratorResponse response = + Writer.write( + GapicContext.EMPTY, + ImmutableList.of(GapicClass.createNonGeneratedGapicClass()), + GapicPackageInfo.with(PackageInfoDefinition.builder().setPakkage("com.test").build()), + Collections.emptyList(), + "temp-codegen.srcjar", + jarOutputStream, + output); + assertTrue(output.size() == 0); + closeJarOutputStream(); + } + + @Test + void productionWrite_emptyGapicContext_succeeds() throws IOException { + // This is a special case test to confirm the production function works as expected. + // We don't need the output stream + jarOutputStream.close(); + + CodeGeneratorResponse result = + Writer.write( + GapicContext.EMPTY, + ImmutableList.of(GapicClass.createNonGeneratedGapicClass()), + GapicPackageInfo.with(PackageInfoDefinition.builder().setPakkage("com.test").build()), + Collections.emptyList(), + "temp-codegen.srcjar"); + assertNull(result); + } +} diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/utils/JavaStyleTest.java b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/utils/JavaStyleTest.java index fec084555c..30b55801f7 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/utils/JavaStyleTest.java +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/utils/JavaStyleTest.java @@ -17,11 +17,11 @@ import static com.google.common.truth.Truth.assertThat; import static org.junit.Assert.assertEquals; -import org.junit.Test; +import org.junit.jupiter.api.Test; -public class JavaStyleTest { +class JavaStyleTest { @Test - public void emptyOrNull() { + void emptyOrNull() { String value = ""; assertEquals("", JavaStyle.toLowerCamelCase(value)); assertEquals("", JavaStyle.toUpperCamelCase(value)); @@ -32,42 +32,42 @@ public void emptyOrNull() { } @Test - public void singleWord() { + void singleWord() { String value = "dog"; assertEquals("dog", JavaStyle.toLowerCamelCase(value)); assertEquals("Dog", JavaStyle.toUpperCamelCase(value)); } @Test - public void fromLowerSnake() { + void fromLowerSnake() { String value = "factory_decorator_delegate_impl"; assertEquals("factoryDecoratorDelegateImpl", JavaStyle.toLowerCamelCase(value)); assertEquals("FactoryDecoratorDelegateImpl", JavaStyle.toUpperCamelCase(value)); } @Test - public void fromUpperSnake() { + void fromUpperSnake() { String value = "FACTORY_DECORATOR_DELEGATE_IMPL"; assertEquals("factoryDecoratorDelegateImpl", JavaStyle.toLowerCamelCase(value)); assertEquals("FactoryDecoratorDelegateImpl", JavaStyle.toUpperCamelCase(value)); } @Test - public void fromLowerCamelCase() { + void fromLowerCamelCase() { String value = "factoryDecoratorDelegateImpl"; assertEquals("factoryDecoratorDelegateImpl", JavaStyle.toLowerCamelCase(value)); assertEquals("FactoryDecoratorDelegateImpl", JavaStyle.toUpperCamelCase(value)); } @Test - public void fromUpperCamelCase() { + void fromUpperCamelCase() { String value = "FactoryDecoratorDelegateImpl"; assertEquals("factoryDecoratorDelegateImpl", JavaStyle.toLowerCamelCase(value)); assertEquals("FactoryDecoratorDelegateImpl", JavaStyle.toUpperCamelCase(value)); } @Test - public void wordAndNumber() { + void wordAndNumber() { String value = "dog2"; assertEquals("dog2", JavaStyle.toLowerCamelCase(value)); assertEquals("Dog2", JavaStyle.toUpperCamelCase(value)); @@ -77,14 +77,14 @@ public void wordAndNumber() { } @Test - public void upperWordAndNumber() { + void upperWordAndNumber() { String value = "Dog_v2"; assertEquals("dogV2", JavaStyle.toLowerCamelCase(value)); assertEquals("DogV2", JavaStyle.toUpperCamelCase(value)); } @Test - public void upperWordAndCharsAfterDigit() { + void upperWordAndCharsAfterDigit() { String value = "dogV2cc"; assertEquals("dogV2Cc", JavaStyle.toLowerCamelCase(value)); assertEquals("DogV2Cc", JavaStyle.toUpperCamelCase(value)); @@ -103,7 +103,7 @@ public void upperWordAndCharsAfterDigit() { } @Test - public void acronyms() { + void acronyms() { String value = "iam_http_xml_dog"; assertEquals("iamHttpXmlDog", JavaStyle.toLowerCamelCase(value)); assertEquals("IamHttpXmlDog", JavaStyle.toUpperCamelCase(value)); @@ -113,7 +113,7 @@ public void acronyms() { } @Test - public void keyword() { + void keyword() { String value = "import"; assertEquals("import_", JavaStyle.toLowerCamelCase(value)); assertEquals("Import", JavaStyle.toUpperCamelCase(value)); diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/utils/ResourceReferenceUtilsTest.java b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/utils/ResourceReferenceUtilsTest.java index 82147dcbf5..f640f6306b 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/utils/ResourceReferenceUtilsTest.java +++ b/gapic-generator-java/src/test/java/com/google/api/generator/gapic/utils/ResourceReferenceUtilsTest.java @@ -19,47 +19,47 @@ import static org.junit.Assert.assertTrue; import java.util.Optional; -import org.junit.Test; +import org.junit.jupiter.api.Test; -public class ResourceReferenceUtilsTest { +class ResourceReferenceUtilsTest { @Test - public void parseParentPattern_basic() { + void parseParentPattern_basic() { String parentPattern = "projects/{project}"; String pattern = String.format("%s/folders/{folder}", parentPattern); assertEquals(parentPattern, ResourceReferenceUtils.parseParentPattern(pattern).get()); } @Test - public void parseParentPattern_wildcard() { + void parseParentPattern_wildcard() { Optional parentPatternOpt = ResourceReferenceUtils.parseParentPattern(ResourceNameConstants.WILDCARD_PATTERN); assertFalse(parentPatternOpt.isPresent()); } @Test - public void parseParentPattern_deletedTopicLiteral() { + void parseParentPattern_deletedTopicLiteral() { Optional parentPatternOpt = ResourceReferenceUtils.parseParentPattern(ResourceNameConstants.DELETED_TOPIC_LITERAL); assertFalse(parentPatternOpt.isPresent()); } @Test - public void parseParentPattern_noParents() { + void parseParentPattern_noParents() { Optional parentPatternOpt = ResourceReferenceUtils.parseParentPattern("projects/{project}"); assertFalse(parentPatternOpt.isPresent()); } @Test - public void parseParentPattern_insufficientPathComponents() { + void parseParentPattern_insufficientPathComponents() { Optional parentPatternOpt = ResourceReferenceUtils.parseParentPattern("projects/foobars/{foobar}"); assertFalse(parentPatternOpt.isPresent()); } @Test - public void parseParentPattern_lastComponentIsNotAVariable() { + void parseParentPattern_lastComponentIsNotAVariable() { Optional parentPatternOpt = ResourceReferenceUtils.parseParentPattern("projects/{project}/foobars"); assertTrue(parentPatternOpt.isPresent()); diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/test/framework/Assert.java b/gapic-generator-java/src/test/java/com/google/api/generator/test/framework/Assert.java index 276ad41d50..a644908154 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/test/framework/Assert.java +++ b/gapic-generator-java/src/test/java/com/google/api/generator/test/framework/Assert.java @@ -37,7 +37,8 @@ public class Assert { public static void assertCodeEquals(Path goldenPath, String codegen) { List diffList = Differ.diff(goldenPath, codegen); if (!diffList.isEmpty()) { - throw new AssertionFailedError("Differences found: \n" + String.join("\n", diffList)); + throw new AssertionFailedError( + "Differences found in: " + goldenPath + ": \n" + String.join("\n", diffList)); } } @@ -60,8 +61,8 @@ public static void assertEmptySamples(List samples) { public static void assertGoldenClass(Class clazz, GapicClass gapicClass, String fileName) { JavaWriterVisitor visitor = new JavaWriterVisitor(); gapicClass.classDefinition().accept(visitor); - Utils.saveCodegenToFile(clazz, fileName, visitor.write()); - Path goldenFilePath = Paths.get(Utils.getGoldenDir(clazz), fileName); + GoldenFileWriter.saveCodegenToFile(clazz, fileName, visitor.write()); + Path goldenFilePath = Paths.get(GoldenFileWriter.getGoldenDir(clazz), fileName); Assert.assertCodeEquals(goldenFilePath, visitor.write()); } @@ -70,7 +71,7 @@ public static void assertGoldenSamples( for (Sample sample : samples) { String fileName = sample.name() + ".golden"; String goldenSampleDir = - Utils.getGoldenDir(clazz) + "/samples/" + sampleDirName.toLowerCase() + "/"; + GoldenFileWriter.getGoldenDir(clazz) + "/samples/" + sampleDirName.toLowerCase() + "/"; Path goldenFilePath = Paths.get(goldenSampleDir, fileName); sample = sample @@ -79,7 +80,8 @@ public static void assertGoldenSamples( String sampleString = SampleCodeWriter.writeExecutableSample(sample, packkage + ".samples"); - Utils.saveSampleCodegenToFile(clazz, sampleDirName.toLowerCase(), fileName, sampleString); + GoldenFileWriter.saveSampleCodegenToFile( + clazz, sampleDirName.toLowerCase(), fileName, sampleString); assertCodeEquals(goldenFilePath, sampleString); } } diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/test/framework/Differ.java b/gapic-generator-java/src/test/java/com/google/api/generator/test/framework/Differ.java index eea5c7b937..4de2eff275 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/test/framework/Differ.java +++ b/gapic-generator-java/src/test/java/com/google/api/generator/test/framework/Differ.java @@ -23,10 +23,10 @@ import java.util.Arrays; import java.util.List; -public class Differ { +class Differ { private static final String LINE_SPLITTER = "\\r?\\n"; - public static List diff(Path goldenFilePath, String codegen) { + static List diff(Path goldenFilePath, String codegen) { List revised = Arrays.asList(codegen.split(LINE_SPLITTER)); List original = null; try { @@ -38,7 +38,7 @@ public static List diff(Path goldenFilePath, String codegen) { return diffTwoStringLists(original, revised); } - public static List diff(String expectedStr, String actualStr) { + static List diff(String expectedStr, String actualStr) { List revised = Arrays.asList(actualStr.split(LINE_SPLITTER)); List original = Arrays.asList(expectedStr.split(LINE_SPLITTER)); return diffTwoStringLists(original, revised); @@ -60,7 +60,7 @@ private static class GoldenFileReadException extends RuntimeException { private static final long serialVersionUID = 7423787084310530945L; - public GoldenFileReadException(String errorMessage, Throwable cause) { + GoldenFileReadException(String errorMessage, Throwable cause) { super(errorMessage, cause); } } @@ -69,7 +69,7 @@ private static class ComputeDiffException extends RuntimeException { private static final long serialVersionUID = -7480557222244987342L; - public ComputeDiffException(String errorMessage, Throwable cause) { + ComputeDiffException(String errorMessage, Throwable cause) { super(errorMessage, cause); } } diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/test/framework/GoldenFileWriter.java b/gapic-generator-java/src/test/java/com/google/api/generator/test/framework/GoldenFileWriter.java new file mode 100644 index 0000000000..a4409cc5a9 --- /dev/null +++ b/gapic-generator-java/src/test/java/com/google/api/generator/test/framework/GoldenFileWriter.java @@ -0,0 +1,77 @@ +// 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. + +package com.google.api.generator.test.framework; + +import java.io.FileWriter; +import java.io.IOException; +import java.nio.file.Path; +import java.nio.file.Paths; + +public class GoldenFileWriter { + + /** + * Save the generated code from JUnit test to a file for updating goldens. The relative path + * `com/google/..` which is identical with the location of goldens files which will help us easily + * replace the original goldens. For example: + * `src/test/java/com/google/api/generator/gapic/composer/ComposerTest.java` will save the + * generated code into a file called `ComposerTest.golden` at + * `src/test/java/com/google/api/generator/gapic/composer/goldens/ComposerTest.golden`. + * + * @param clazz the test class. + * @param fileName the name of saved file, usually a test method name with suffix `.golden` + * @param codegen the generated code from JUnit test + */ + public static void saveCodegenToFile(Class clazz, String fileName, String codegen) { + if (System.getProperty("updateUnitGoldens") == null) { + return; + } + + String relativeGoldenDir = getTestoutGoldenDir(clazz); + saveCodeToFile(relativeGoldenDir, fileName, codegen); + } + + public static void saveSampleCodegenToFile( + Class clazz, String sampleDir, String fileName, String codegen) { + String relativeGoldenDir = getTestoutGoldenDir(clazz) + "/samples/" + sampleDir; + saveCodeToFile(relativeGoldenDir, fileName, codegen); + } + + private static void saveCodeToFile(String relativeGoldenDir, String fileName, String codegen) { + Path testOutputDir = Paths.get("src", "test", "java", relativeGoldenDir); + testOutputDir.toFile().mkdirs(); + try (FileWriter myWriter = new FileWriter(testOutputDir.resolve(fileName).toFile())) { + myWriter.write(codegen); + } catch (IOException e) { + throw new SaveCodegenToFileException( + String.format( + "Error occurred when saving codegen to file %s/%s", relativeGoldenDir, fileName)); + } + } + + private static String getTestoutGoldenDir(Class clazz) { + return clazz.getPackage().getName().replace(".", "/") + "/goldens/"; + } + + public static String getGoldenDir(Class clazz) { + return "src/test/java/" + getTestoutGoldenDir(clazz); + } + + public static class SaveCodegenToFileException extends RuntimeException { + + public SaveCodegenToFileException(String errorMessage) { + super(errorMessage); + } + } +} diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/test/framework/SingleJUnitTestRunner.java b/gapic-generator-java/src/test/java/com/google/api/generator/test/framework/SingleJUnitTestRunner.java index d5d3fb35fc..cfae012866 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/test/framework/SingleJUnitTestRunner.java +++ b/gapic-generator-java/src/test/java/com/google/api/generator/test/framework/SingleJUnitTestRunner.java @@ -18,10 +18,10 @@ import org.junit.runner.Request; import org.junit.runner.Result; -public class SingleJUnitTestRunner { +class SingleJUnitTestRunner { // SingleJUnitTestRunner runs single JUnit test whose class name is passed through `args`. // This is used to prepare codegen for updating goldens files. - public static void main(String... args) { + static void main(String... args) { // Check whether the test class name is passed correctly e.g. // `com.google.api.generator.gapic.composer.ComposerTest` if (args.length < 1) { @@ -41,14 +41,14 @@ public static void main(String... args) { } } - public static class JUnitClassNotFoundException extends RuntimeException { - public JUnitClassNotFoundException(String errorMessage) { + static class JUnitClassNotFoundException extends RuntimeException { + JUnitClassNotFoundException(String errorMessage) { super(errorMessage); } } - public static class MissingRequiredArgException extends RuntimeException { - public MissingRequiredArgException(String errorMessage) { + static class MissingRequiredArgException extends RuntimeException { + MissingRequiredArgException(String errorMessage) { super(errorMessage); } } diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/test/framework/Utils.java b/gapic-generator-java/src/test/java/com/google/api/generator/test/framework/Utils.java deleted file mode 100644 index 5960b722ef..0000000000 --- a/gapic-generator-java/src/test/java/com/google/api/generator/test/framework/Utils.java +++ /dev/null @@ -1,83 +0,0 @@ -// Copyright 2020 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// 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.google.api.generator.test.framework; - -import java.io.FileWriter; -import java.io.IOException; -import java.nio.file.Path; -import java.nio.file.Paths; - -public class Utils { - - /** - * Save the generated code from JUnit test to a file for updating goldens. The relative path - * `com/google/..` which is identical with the location of goldens files which will help us easily - * replace the original goldens. For example: - * `src/test/java/com/google/api/generator/gapic/composer/ComposerTest.java` will save the - * generated code into a file called `ComposerTest.golden` at - * `src/test/java/com/google/api/generator/gapic/composer/goldens/ComposerTest.golden`. - * - * @param clazz the test class. - * @param fileName the name of saved file, usually a test method name with suffix `.golden` - * @param codegen the generated code from JUnit test - */ - public static void saveCodegenToFile(Class clazz, String fileName, String codegen) { - String relativeGoldenDir = getTestoutGoldenDir(clazz); - saveCodeToFile(relativeGoldenDir, fileName, codegen); - } - - public static void saveSampleCodegenToFile( - Class clazz, String sampleDir, String fileName, String codegen) { - String relativeGoldenDir = getTestoutGoldenDir(clazz) + "/samples/" + sampleDir; - saveCodeToFile(relativeGoldenDir, fileName, codegen); - } - - private static void saveCodeToFile(String relativeGoldenDir, String fileName, String codegen) { - Path testOutputDir = Paths.get("src", "test", "java", relativeGoldenDir); - - // Auto-detect project workspace when running `bazel run //:update_TargetTest`. - // TODO: remove when we don't use Bazel. - String workspaceDir = System.getenv("BUILD_WORKSPACE_DIRECTORY"); - if (workspaceDir != null) { - testOutputDir = Paths.get(workspaceDir).resolve(testOutputDir); - } else if (System.getProperty("updateUnitGoldens") == null) { - return; - } - - testOutputDir.toFile().mkdirs(); - try (FileWriter myWriter = new FileWriter(testOutputDir.resolve(fileName).toFile())) { - myWriter.write(codegen); - } catch (IOException e) { - throw new SaveCodegenToFileException( - String.format( - "Error occurred when saving codegen to file %s/%s", relativeGoldenDir, fileName)); - } - } - - private static String getTestoutGoldenDir(Class clazz) { - return clazz.getPackage().getName().replace(".", "/") + "/goldens/"; - } - - public static String getGoldenDir(Class clazz) { - return "src/test/java/" + getTestoutGoldenDir(clazz); - } - - public static class SaveCodegenToFileException extends RuntimeException { - - public SaveCodegenToFileException(String errorMessage) { - super(errorMessage); - } - } -} diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/test/protoloader/GrpcRestTestProtoLoader.java b/gapic-generator-java/src/test/java/com/google/api/generator/test/protoloader/GrpcRestTestProtoLoader.java new file mode 100644 index 0000000000..653b9b16cd --- /dev/null +++ b/gapic-generator-java/src/test/java/com/google/api/generator/test/protoloader/GrpcRestTestProtoLoader.java @@ -0,0 +1,132 @@ +// 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. + +package com.google.api.generator.test.protoloader; + +import static com.google.common.truth.Truth.assertThat; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertTrue; + +import com.google.api.generator.gapic.model.GapicContext; +import com.google.api.generator.gapic.model.GapicServiceConfig; +import com.google.api.generator.gapic.model.Message; +import com.google.api.generator.gapic.model.ResourceName; +import com.google.api.generator.gapic.model.Service; +import com.google.api.generator.gapic.model.Transport; +import com.google.api.generator.gapic.protoparser.Parser; +import com.google.api.generator.gapic.protoparser.ServiceConfigParser; +import com.google.api.generator.gapic.protoparser.ServiceYamlParser; +import com.google.longrunning.OperationsProto; +import com.google.protobuf.Descriptors.FileDescriptor; +import com.google.protobuf.Descriptors.ServiceDescriptor; +import com.google.protobuf.StructProto; +import com.google.showcase.grpcrest.v1beta1.EchoGrpcrest; +import com.google.showcase.v1beta1.WickedOuterClass; +import java.nio.file.Path; +import java.nio.file.Paths; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Optional; +import java.util.Set; + +public class GrpcRestTestProtoLoader extends TestProtoLoader { + private static final GrpcRestTestProtoLoader INSTANCE = new GrpcRestTestProtoLoader(); + private static final String ECHO_SERVICE_REPOSITORY = "googleapis/sdk-platform-java"; + private static final String ECHO_SERVICE_ARTIFACT = "com.google.cloud:gapic-showcase"; + + protected GrpcRestTestProtoLoader() { + super(Transport.GRPC_REST, "src/test/resources/"); + } + + public static GrpcRestTestProtoLoader instance() { + return INSTANCE; + } + + @Override + public GapicContext parseShowcaseEcho() { + FileDescriptor echoFileDescriptor = EchoGrpcrest.getDescriptor(); + + ServiceDescriptor echoServiceDescriptor = echoFileDescriptor.getServices().get(0); + assertEquals("Echo", echoServiceDescriptor.getName()); + + String serviceYamlFileName = "echo_v1beta1.yaml"; + Path serviceYamlPath = Paths.get(getTestFilesDirectory(), serviceYamlFileName); + Optional serviceYamlOpt = + ServiceYamlParser.parse(serviceYamlPath.toString()); + assertThat(serviceYamlOpt.isPresent()).isTrue(); + com.google.api.Service service = serviceYamlOpt.get(); + + Map messageTypes = Parser.parseMessages(echoFileDescriptor); + messageTypes.putAll(Parser.parseMessages(OperationsProto.getDescriptor())); + messageTypes.putAll(Parser.parseMessages(StructProto.getDescriptor())); + + Map resourceNames = Parser.parseResourceNames(echoFileDescriptor); + Set outputResourceNames = new HashSet<>(); + List services = + Parser.parseService( + echoFileDescriptor, messageTypes, resourceNames, serviceYamlOpt, outputResourceNames); + + String jsonFilename = "showcase_grpc_service_config.json"; + Path jsonPath = Paths.get(getTestFilesDirectory(), jsonFilename); + Optional configOpt = ServiceConfigParser.parse(jsonPath.toString()); + assertTrue(configOpt.isPresent()); + GapicServiceConfig config = configOpt.get(); + + return GapicContext.builder() + .setMessages(messageTypes) + .setResourceNames(resourceNames) + .setServices(services) + .setServiceConfig(config) + .setServiceYamlProto(service) + .setHelperResourceNames(outputResourceNames) + .setTransport(getTransport()) + .setRepo(ECHO_SERVICE_REPOSITORY) + .setArtifact(ECHO_SERVICE_ARTIFACT) + .build(); + } + + public GapicContext parseShowcaseWicked() { + FileDescriptor fileDescriptor = WickedOuterClass.getDescriptor(); + ServiceDescriptor messagingService = fileDescriptor.getServices().get(0); + assertEquals("Wicked", messagingService.getName()); + + Map messageTypes = Parser.parseMessages(fileDescriptor); + messageTypes.putAll(Parser.parseMessages(OperationsProto.getDescriptor())); + messageTypes.putAll(Parser.parseMessages(StructProto.getDescriptor())); + + Map resourceNames = Parser.parseResourceNames(fileDescriptor); + Set outputResourceNames = new HashSet<>(); + List services = + Parser.parseService( + fileDescriptor, messageTypes, resourceNames, Optional.empty(), outputResourceNames); + + String jsonFilename = "showcase_grpc_service_config.json"; + Path jsonPath = Paths.get(getTestFilesDirectory(), jsonFilename); + Optional configOpt = ServiceConfigParser.parse(jsonPath.toString()); + assertTrue(configOpt.isPresent()); + GapicServiceConfig config = configOpt.get(); + + return GapicContext.builder() + .setMessages(messageTypes) + .setResourceNames(resourceNames) + .setServices(services) + .setServiceConfig(config) + .setHelperResourceNames(outputResourceNames) + .setTransport(getTransport()) + .setRepo(ECHO_SERVICE_REPOSITORY) + .setArtifact(ECHO_SERVICE_ARTIFACT) + .build(); + } +} diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/GrpcTestProtoLoader.java b/gapic-generator-java/src/test/java/com/google/api/generator/test/protoloader/GrpcTestProtoLoader.java similarity index 88% rename from gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/GrpcTestProtoLoader.java rename to gapic-generator-java/src/test/java/com/google/api/generator/test/protoloader/GrpcTestProtoLoader.java index c6249121e5..324cf9a580 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/GrpcTestProtoLoader.java +++ b/gapic-generator-java/src/test/java/com/google/api/generator/test/protoloader/GrpcTestProtoLoader.java @@ -12,9 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. -package com.google.api.generator.gapic.composer.grpc; +package com.google.api.generator.test.protoloader; -import com.google.api.generator.gapic.composer.common.TestProtoLoader; import com.google.api.generator.gapic.model.Transport; public class GrpcTestProtoLoader extends TestProtoLoader { diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/test/protoloader/RestTestProtoLoader.java b/gapic-generator-java/src/test/java/com/google/api/generator/test/protoloader/RestTestProtoLoader.java new file mode 100644 index 0000000000..63938fcaad --- /dev/null +++ b/gapic-generator-java/src/test/java/com/google/api/generator/test/protoloader/RestTestProtoLoader.java @@ -0,0 +1,159 @@ +// 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. + +package com.google.api.generator.test.protoloader; + +import static com.google.common.truth.Truth.assertThat; +import static org.junit.Assert.assertEquals; + +import com.google.api.generator.gapic.model.GapicContext; +import com.google.api.generator.gapic.model.GapicServiceConfig; +import com.google.api.generator.gapic.model.Message; +import com.google.api.generator.gapic.model.ResourceName; +import com.google.api.generator.gapic.model.Service; +import com.google.api.generator.gapic.model.Transport; +import com.google.api.generator.gapic.protoparser.Parser; +import com.google.api.generator.gapic.protoparser.ServiceConfigParser; +import com.google.api.generator.gapic.protoparser.ServiceYamlParser; +import com.google.api.version.test.ApiVersionTestingOuterClass; +import com.google.longrunning.OperationsProto; +import com.google.protobuf.Descriptors.FileDescriptor; +import com.google.protobuf.Descriptors.ServiceDescriptor; +import com.google.protobuf.StructProto; +import com.google.showcase.v1beta1.ComplianceOuterClass; +import com.google.showcase.v1beta1.EchoOuterClass; +import java.nio.file.Path; +import java.nio.file.Paths; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Optional; +import java.util.Set; + +public class RestTestProtoLoader extends TestProtoLoader { + private static final RestTestProtoLoader INSTANCE = new RestTestProtoLoader(); + + protected RestTestProtoLoader() { + super(Transport.REST, "src/test/resources/"); + } + + public static RestTestProtoLoader instance() { + return INSTANCE; + } + + public GapicContext parseCompliance() { + FileDescriptor complianceFileDescriptor = ComplianceOuterClass.getDescriptor(); + ServiceDescriptor complianceServiceDescriptor = complianceFileDescriptor.getServices().get(0); + assertThat(complianceServiceDescriptor.getName()).isEqualTo("Compliance"); + + Map messageTypes = Parser.parseMessages(complianceFileDescriptor); + Map resourceNames = Parser.parseResourceNames(complianceFileDescriptor); + Set outputResourceNames = new HashSet<>(); + List services = + Parser.parseService( + complianceFileDescriptor, + messageTypes, + resourceNames, + Optional.empty(), + outputResourceNames); + + String jsonFilename = "showcase_grpc_service_config.json"; + Path jsonPath = Paths.get(getTestFilesDirectory(), jsonFilename); + Optional configOpt = ServiceConfigParser.parse(jsonPath.toString()); + assertThat(configOpt.isPresent()).isTrue(); + GapicServiceConfig config = configOpt.get(); + + return GapicContext.builder() + .setMessages(messageTypes) + .setResourceNames(resourceNames) + .setServices(services) + .setServiceConfig(config) + .setHelperResourceNames(outputResourceNames) + .setTransport(getTransport()) + .setRestNumericEnumsEnabled(true) + .build(); + } + + public GapicContext parseEcho() { + FileDescriptor echoFileDescriptor = EchoOuterClass.getDescriptor(); + ServiceDescriptor echoServiceDescriptor = echoFileDescriptor.getServices().get(0); + assertThat(echoServiceDescriptor.getName()).isEqualTo("Echo"); + + String serviceYamlFileName = "echo_v1beta1.yaml"; + Path serviceYamlPath = Paths.get(getTestFilesDirectory(), serviceYamlFileName); + Optional serviceYamlOpt = + ServiceYamlParser.parse(serviceYamlPath.toString()); + assertThat(serviceYamlOpt.isPresent()).isTrue(); + com.google.api.Service service = serviceYamlOpt.get(); + + Map messageTypes = Parser.parseMessages(echoFileDescriptor); + messageTypes.putAll(Parser.parseMessages(OperationsProto.getDescriptor())); + messageTypes.putAll(Parser.parseMessages(StructProto.getDescriptor())); + Map resourceNames = Parser.parseResourceNames(echoFileDescriptor); + Set outputResourceNames = new HashSet<>(); + List services = + Parser.parseService( + echoFileDescriptor, messageTypes, resourceNames, serviceYamlOpt, outputResourceNames); + + String jsonFilename = "showcase_grpc_service_config.json"; + Path jsonPath = Paths.get(getTestFilesDirectory(), jsonFilename); + Optional configOpt = ServiceConfigParser.parse(jsonPath.toString()); + assertThat(configOpt.isPresent()).isTrue(); + GapicServiceConfig config = configOpt.get(); + + return GapicContext.builder() + .setMessages(messageTypes) + .setResourceNames(resourceNames) + .setServices(services) + .setServiceConfig(config) + .setServiceYamlProto(service) + .setHelperResourceNames(outputResourceNames) + .setTransport(getTransport()) + .setRestNumericEnumsEnabled(true) + .build(); + } + + public GapicContext parseApiVersionTesting() { + FileDescriptor testingFileDescriptor = ApiVersionTestingOuterClass.getDescriptor(); + ServiceDescriptor testingService = testingFileDescriptor.getServices().get(0); + assertEquals(testingService.getName(), "EchoWithVersion"); + + Map messageTypes = Parser.parseMessages(testingFileDescriptor); + Map resourceNames = Parser.parseResourceNames(testingFileDescriptor); + Set outputResourceNames = new HashSet<>(); + List services = + Parser.parseService( + testingFileDescriptor, + messageTypes, + resourceNames, + Optional.empty(), + outputResourceNames); + + String jsonFilename = "showcase_grpc_service_config.json"; + Path jsonPath = Paths.get(getTestFilesDirectory(), jsonFilename); + Optional configOpt = ServiceConfigParser.parse(jsonPath.toString()); + assertThat(configOpt.isPresent()).isTrue(); + GapicServiceConfig config = configOpt.get(); + + return GapicContext.builder() + .setMessages(messageTypes) + .setResourceNames(resourceNames) + .setServices(services) + .setServiceConfig(config) + .setHelperResourceNames(outputResourceNames) + .setTransport(getTransport()) + .setRestNumericEnumsEnabled(true) + .build(); + } +} diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/test/protoloader/TestProtoLoader.java b/gapic-generator-java/src/test/java/com/google/api/generator/test/protoloader/TestProtoLoader.java new file mode 100644 index 0000000000..a4c4a3afb5 --- /dev/null +++ b/gapic-generator-java/src/test/java/com/google/api/generator/test/protoloader/TestProtoLoader.java @@ -0,0 +1,610 @@ +// 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. + +package com.google.api.generator.test.protoloader; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertTrue; + +import com.google.api.generator.gapic.model.GapicBatchingSettings; +import com.google.api.generator.gapic.model.GapicContext; +import com.google.api.generator.gapic.model.GapicServiceConfig; +import com.google.api.generator.gapic.model.Message; +import com.google.api.generator.gapic.model.ResourceName; +import com.google.api.generator.gapic.model.Service; +import com.google.api.generator.gapic.model.Transport; +import com.google.api.generator.gapic.protoparser.BatchingSettingsConfigParser; +import com.google.api.generator.gapic.protoparser.Parser; +import com.google.api.generator.gapic.protoparser.ServiceConfigParser; +import com.google.api.generator.gapic.protoparser.ServiceYamlParser; +import com.google.api.version.test.ApiVersionTestingOuterClass; +import com.google.auto.populate.field.AutoPopulateFieldTestingOuterClass; +import com.google.bookshop.v1beta1.BookshopProto; +import com.google.cloud.bigquery.v2.JobProto; +import com.google.explicit.dynamic.routing.header.ExplicitDynamicRoutingHeaderTestingOuterClass; +import com.google.extractor.testing.ResourceNameExtractorTestingOuterClass; +import com.google.logging.v2.LogEntryProto; +import com.google.logging.v2.LoggingConfigProto; +import com.google.logging.v2.LoggingMetricsProto; +import com.google.logging.v2.LoggingProto; +import com.google.protobuf.Descriptors.FileDescriptor; +import com.google.protobuf.Descriptors.ServiceDescriptor; +import com.google.pubsub.v1.PubsubProto; +import com.google.selective.generate.v1beta1.SelectiveApiGenerationOuterClass; +import com.google.showcase.v1beta1.EchoOuterClass; +import com.google.showcase.v1beta1.IdentityOuterClass; +import com.google.showcase.v1beta1.MessagingOuterClass; +import com.google.showcase.v1beta1.TestingOuterClass; +import com.google.test.callablenamingtype.CallableNameType; +import com.google.testdata.v1.DeprecatedServiceOuterClass; +import com.google.testgapic.v1beta1.NestedMessageProto; +import com.google.types.testing.TypesTestingProto; +import google.cloud.CommonResources; +import java.nio.file.Path; +import java.nio.file.Paths; +import java.util.Arrays; +import java.util.Collections; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Optional; +import java.util.Set; +import java.util.stream.Collectors; + +public class TestProtoLoader { + + private static final TestProtoLoader INSTANCE = + new TestProtoLoader(Transport.GRPC, "src/test/resources/"); + private static final String ECHO_SERVICE_DESCRIPTION = + "This service is used showcase the four main types of rpcs - unary, server\n" + + " side streaming, client side streaming, and bidirectional streaming. This\n" + + " service also exposes methods that explicitly implement server delay, and\n" + + " paginated calls. Set the 'showcase-trailer' metadata key on any method\n" + + " to have the values echoed in the response trailers."; + private static final String ECHO_SERVICE_REPOSITORY = "googleapis/sdk-platform-java"; + private static final String ECHO_SERVICE_ARTIFACT = "com.google.cloud:gapic-showcase"; + private static final String LOGGING_SERVICE_ARTIFACT = "com.google.cloud:google-cloud-logging"; + private final String testFilesDirectory; + private final Transport transport; + + protected TestProtoLoader(Transport transport, String testFilesDirectory) { + this.testFilesDirectory = testFilesDirectory; + this.transport = transport; + } + + public static TestProtoLoader instance() { + return INSTANCE; + } + + public GapicContext parseDeprecatedService() { + FileDescriptor fileDescriptor = DeprecatedServiceOuterClass.getDescriptor(); + ServiceDescriptor serviceDescriptor = fileDescriptor.getServices().get(0); + assertEquals("DeprecatedService", serviceDescriptor.getName()); + + Map messageTypes = Parser.parseMessages(fileDescriptor); + Map resourceNames = new HashMap<>(); + Set outputResourceNames = new HashSet<>(); + List services = + Parser.parseService( + fileDescriptor, messageTypes, resourceNames, Optional.empty(), outputResourceNames); + + String jsonFilename = "deprecated_service_grpc_service_config.json"; + Path jsonPath = Paths.get(testFilesDirectory, jsonFilename); + Optional configOpt = ServiceConfigParser.parse(jsonPath.toString()); + assertTrue(configOpt.isPresent()); + GapicServiceConfig config = configOpt.get(); + + return GapicContext.builder() + .setMessages(messageTypes) + .setResourceNames(resourceNames) + .setServices(services) + .setServiceConfig(config) + .setHelperResourceNames(outputResourceNames) + .setTransport(transport) + .build(); + } + + public GapicContext parseBookshopService() { + FileDescriptor fileDescriptor = BookshopProto.getDescriptor(); + ServiceDescriptor serviceDescriptor = fileDescriptor.getServices().get(0); + assertEquals("Bookshop", serviceDescriptor.getName()); + + Map messageTypes = Parser.parseMessages(fileDescriptor); + Map resourceNames = new HashMap<>(); + Set outputResourceNames = new HashSet<>(); + List services = + Parser.parseService( + fileDescriptor, messageTypes, resourceNames, Optional.empty(), outputResourceNames); + + String jsonFilename = "bookshop_grpc_service_config.json"; + Path jsonPath = Paths.get(testFilesDirectory, jsonFilename); + Optional configOpt = ServiceConfigParser.parse(jsonPath.toString()); + assertTrue(configOpt.isPresent()); + GapicServiceConfig config = configOpt.get(); + + return GapicContext.builder() + .setMessages(messageTypes) + .setResourceNames(resourceNames) + .setServices(services) + .setServiceConfig(config) + .setHelperResourceNames(outputResourceNames) + .setTransport(transport) + .build(); + } + + public GapicContext parseNestedMessage() { + FileDescriptor fileDescriptor = TypesTestingProto.getDescriptor(); + ServiceDescriptor serviceDescriptor = fileDescriptor.getServices().get(0); + assertEquals("NestedMessageService", serviceDescriptor.getName()); + Map messageTypes = Parser.parseMessages(fileDescriptor); + + FileDescriptor messageFileDescriptor = NestedMessageProto.getDescriptor(); + messageTypes.putAll(Parser.parseMessages(messageFileDescriptor)); + + Map resourceNames = new HashMap<>(); + Set outputResourceNames = new HashSet<>(); + List services = + Parser.parseService( + fileDescriptor, messageTypes, resourceNames, Optional.empty(), outputResourceNames); + + return GapicContext.builder() + .setMessages(messageTypes) + .setResourceNames(resourceNames) + .setServices(services) + .setHelperResourceNames(outputResourceNames) + .setTransport(transport) + .build(); + } + + public GapicContext parseShowcaseEcho() { + FileDescriptor echoFileDescriptor = EchoOuterClass.getDescriptor(); + ServiceDescriptor echoServiceDescriptor = echoFileDescriptor.getServices().get(0); + assertEquals("Echo", echoServiceDescriptor.getName()); + + String serviceYamlFilename = "echo_v1beta1.yaml"; + Path serviceYamlPath = Paths.get(testFilesDirectory, serviceYamlFilename); + Optional serviceYamlOpt = + ServiceYamlParser.parse(serviceYamlPath.toString()); + assertTrue(serviceYamlOpt.isPresent()); + + Map messageTypes = Parser.parseMessages(echoFileDescriptor); + Map resourceNames = Parser.parseResourceNames(echoFileDescriptor); + Set outputResourceNames = new HashSet<>(); + List services = + Parser.parseService( + echoFileDescriptor, messageTypes, resourceNames, serviceYamlOpt, outputResourceNames); + + // Explicitly adds service description, since this is not parsed from source code location + // in test protos, as it would from a protoc CodeGeneratorRequest + List servicesWithDescription = + services.stream() + .map(s -> s.toBuilder().setDescription(ECHO_SERVICE_DESCRIPTION).build()) + .collect(Collectors.toList()); + + String jsonFilename = "showcase_grpc_service_config.json"; + Path jsonPath = Paths.get(testFilesDirectory, jsonFilename); + Optional configOpt = ServiceConfigParser.parse(jsonPath.toString()); + assertTrue(configOpt.isPresent()); + GapicServiceConfig config = configOpt.get(); + + return GapicContext.builder() + .setMessages(messageTypes) + .setResourceNames(resourceNames) + .setServices(servicesWithDescription) + .setServiceConfig(config) + .setHelperResourceNames(outputResourceNames) + .setTransport(transport) + .setRepo(ECHO_SERVICE_REPOSITORY) + .setArtifact(ECHO_SERVICE_ARTIFACT) + .build(); + } + + public GapicContext parseShowcaseIdentity() { + FileDescriptor fileDescriptor = IdentityOuterClass.getDescriptor(); + ServiceDescriptor identityService = fileDescriptor.getServices().get(0); + assertEquals("Identity", identityService.getName()); + + Map messageTypes = Parser.parseMessages(fileDescriptor); + Map resourceNames = Parser.parseResourceNames(fileDescriptor); + Set outputResourceNames = new HashSet<>(); + List services = + Parser.parseService( + fileDescriptor, messageTypes, resourceNames, Optional.empty(), outputResourceNames); + + return GapicContext.builder() + .setMessages(messageTypes) + .setResourceNames(resourceNames) + .setServices(services) + .setHelperResourceNames(outputResourceNames) + .setTransport(transport) + .build(); + } + + public GapicContext parseShowcaseMessaging() { + FileDescriptor fileDescriptor = MessagingOuterClass.getDescriptor(); + ServiceDescriptor messagingService = fileDescriptor.getServices().get(0); + assertEquals("Messaging", messagingService.getName()); + + Map messageTypes = Parser.parseMessages(fileDescriptor); + Map resourceNames = Parser.parseResourceNames(fileDescriptor); + Set outputResourceNames = new HashSet<>(); + List services = + Parser.parseService( + fileDescriptor, messageTypes, resourceNames, Optional.empty(), outputResourceNames); + + return GapicContext.builder() + .setMessages(messageTypes) + .setResourceNames(resourceNames) + .setServices(services) + .setHelperResourceNames(outputResourceNames) + .setTransport(transport) + .build(); + } + + public GapicContext parseShowcaseTesting() { + FileDescriptor testingFileDescriptor = TestingOuterClass.getDescriptor(); + ServiceDescriptor testingService = testingFileDescriptor.getServices().get(0); + assertEquals("Testing", testingService.getName()); + + Map messageTypes = Parser.parseMessages(testingFileDescriptor); + Map resourceNames = Parser.parseResourceNames(testingFileDescriptor); + Set outputResourceNames = new HashSet<>(); + List services = + Parser.parseService( + testingFileDescriptor, + messageTypes, + resourceNames, + Optional.empty(), + outputResourceNames); + + return GapicContext.builder() + .setMessages(messageTypes) + .setResourceNames(resourceNames) + .setServices(services) + .setHelperResourceNames(outputResourceNames) + .setTransport(transport) + .build(); + } + + public GapicContext parseExplicitDynamicRoutingHeaderTesting() { + FileDescriptor testingFileDescriptor = + ExplicitDynamicRoutingHeaderTestingOuterClass.getDescriptor(); + ServiceDescriptor testingService = testingFileDescriptor.getServices().get(0); + assertEquals("ExplicitDynamicRoutingHeaderTesting", testingService.getName()); + + Map messageTypes = Parser.parseMessages(testingFileDescriptor); + Map resourceNames = Parser.parseResourceNames(testingFileDescriptor); + Set outputResourceNames = new HashSet<>(); + List services = + Parser.parseService( + testingFileDescriptor, + messageTypes, + resourceNames, + Optional.empty(), + outputResourceNames); + + return GapicContext.builder() + .setMessages(messageTypes) + .setResourceNames(resourceNames) + .setServices(services) + .setHelperResourceNames(outputResourceNames) + .setTransport(transport) + .build(); + } + + public GapicContext parseApiVersionTesting() { + FileDescriptor testingFileDescriptor = ApiVersionTestingOuterClass.getDescriptor(); + ServiceDescriptor testingService = testingFileDescriptor.getServices().get(0); + assertEquals("EchoWithVersion", testingService.getName()); + + Map messageTypes = Parser.parseMessages(testingFileDescriptor); + Map resourceNames = Parser.parseResourceNames(testingFileDescriptor); + Set outputResourceNames = new HashSet<>(); + List services = + Parser.parseService( + testingFileDescriptor, + messageTypes, + resourceNames, + Optional.empty(), + outputResourceNames); + String jsonFilename = "showcase_grpc_service_config.json"; + Path jsonPath = Paths.get(testFilesDirectory, jsonFilename); + Optional configOpt = ServiceConfigParser.parse(jsonPath.toString()); + assertTrue(configOpt.isPresent()); + GapicServiceConfig config = configOpt.get(); + + return GapicContext.builder() + .setMessages(messageTypes) + .setResourceNames(resourceNames) + .setServices(services) + .setServiceConfig(config) + .setHelperResourceNames(outputResourceNames) + .setTransport(transport) + .build(); + } + + public GapicContext parseAutoPopulateFieldTesting() { + FileDescriptor autopopulationFileDescriptor = + AutoPopulateFieldTestingOuterClass.getDescriptor(); + ServiceDescriptor autopopulationServiceDescriptor = + autopopulationFileDescriptor.getServices().get(0); + assertEquals("AutoPopulateFieldTesting", autopopulationServiceDescriptor.getName()); + + String serviceYamlFilename = "auto_populate_field_testing.yaml"; + Path serviceYamlPath = Paths.get(testFilesDirectory, serviceYamlFilename); + Optional serviceYamlOpt = + ServiceYamlParser.parse(serviceYamlPath.toString()); + assertTrue(serviceYamlOpt.isPresent()); + + Map messageTypes = Parser.parseMessages(autopopulationFileDescriptor); + Map resourceNames = + Parser.parseResourceNames(autopopulationFileDescriptor); + Set outputResourceNames = new HashSet<>(); + List services = + Parser.parseService( + autopopulationFileDescriptor, + messageTypes, + resourceNames, + serviceYamlOpt, + outputResourceNames); + + return GapicContext.builder() + .setMessages(messageTypes) + .setResourceNames(resourceNames) + .setServices(services) + .setHelperResourceNames(outputResourceNames) + .setTransport(transport) + .build(); + } + + public GapicContext parseSelectiveGenerationTesting() { + FileDescriptor selectiveGenerationFileDescriptor = + SelectiveApiGenerationOuterClass.getDescriptor(); + ServiceDescriptor selectiveGenerationServiceDescriptor = + selectiveGenerationFileDescriptor.getServices().get(1); + assertEquals( + "EchoServiceShouldGeneratePartialUsual", selectiveGenerationServiceDescriptor.getName()); + + String serviceYamlFilename = "selective_api_generation_generate_omitted_v1beta1.yaml"; + Path serviceYamlPath = Paths.get(testFilesDirectory, serviceYamlFilename); + Optional serviceYamlOpt = + ServiceYamlParser.parse(serviceYamlPath.toString()); + assertTrue(serviceYamlOpt.isPresent()); + + Map messageTypes = Parser.parseMessages(selectiveGenerationFileDescriptor); + Map resourceNames = + Parser.parseResourceNames(selectiveGenerationFileDescriptor); + Set outputResourceNames = new HashSet<>(); + List services = + Parser.parseService( + selectiveGenerationFileDescriptor, + messageTypes, + resourceNames, + serviceYamlOpt, + outputResourceNames); + + String jsonFilename = "selective_api_generation_grpc_service_config.json"; + Path jsonPath = Paths.get(testFilesDirectory, jsonFilename); + Optional configOpt = ServiceConfigParser.parse(jsonPath.toString()); + assertTrue(configOpt.isPresent()); + GapicServiceConfig config = configOpt.get(); + return GapicContext.builder() + .setMessages(messageTypes) + .setResourceNames(resourceNames) + .setServices(services) + .setHelperResourceNames(outputResourceNames) + .setServiceYamlProto(serviceYamlOpt.orElse(null)) + .setGapicMetadataEnabled(true) + .setServiceConfig(config) + .setTransport(transport) + .build(); + } + + public GapicContext parsePubSubPublisher() { + FileDescriptor serviceFileDescriptor = PubsubProto.getDescriptor(); + FileDescriptor commonResourcesFileDescriptor = CommonResources.getDescriptor(); + ServiceDescriptor serviceDescriptor = serviceFileDescriptor.getServices().get(0); + assertEquals("Publisher", serviceDescriptor.getName()); + + Map resourceNames = new HashMap<>(); + resourceNames.putAll(Parser.parseResourceNames(serviceFileDescriptor)); + resourceNames.putAll(Parser.parseResourceNames(commonResourcesFileDescriptor)); + Map messageTypes = Parser.parseMessages(serviceFileDescriptor); + + Set outputResourceNames = new HashSet<>(); + List services = + Parser.parseService( + serviceFileDescriptor, + messageTypes, + resourceNames, + Optional.empty(), + outputResourceNames); + + String filename = "pubsub_gapic.yaml"; + Path path = Paths.get(getTestFilesDirectory(), filename); + Optional> batchingSettingsOpt = + BatchingSettingsConfigParser.parse(Optional.of(path.toString())); + assertTrue(batchingSettingsOpt.isPresent()); + + String jsonFilename = "pubsub_grpc_service_config.json"; + Path jsonPath = Paths.get(getTestFilesDirectory(), jsonFilename); + Optional configOpt = ServiceConfigParser.parse(jsonPath.toString()); + assertTrue(configOpt.isPresent()); + GapicServiceConfig config = configOpt.get(); + config.setBatchingSettings(batchingSettingsOpt); + + return GapicContext.builder() + .setMessages(messageTypes) + .setResourceNames(resourceNames) + .setServices(services) + .setServiceConfig(config) + .setHelperResourceNames(outputResourceNames) + .setTransport(transport) + .build(); + } + + public GapicContext parseLogging() { + FileDescriptor serviceFileDescriptor = LoggingProto.getDescriptor(); + ServiceDescriptor serviceDescriptor = serviceFileDescriptor.getServices().get(0); + assertEquals("LoggingServiceV2", serviceDescriptor.getName()); + + List protoFiles = + Arrays.asList( + serviceFileDescriptor, + LogEntryProto.getDescriptor(), + LoggingConfigProto.getDescriptor(), + LoggingMetricsProto.getDescriptor()); + + Map resourceNames = new HashMap<>(); + Map messageTypes = new HashMap<>(); + for (FileDescriptor fileDescriptor : protoFiles) { + resourceNames.putAll(Parser.parseResourceNames(fileDescriptor)); + messageTypes.putAll(Parser.parseMessages(fileDescriptor)); + } + + // Additional resource names. + FileDescriptor commonResourcesFileDescriptor = CommonResources.getDescriptor(); + resourceNames.putAll(Parser.parseResourceNames(commonResourcesFileDescriptor)); + + Set outputResourceNames = new HashSet<>(); + List services = + Parser.parseService( + serviceFileDescriptor, + messageTypes, + resourceNames, + Optional.empty(), + outputResourceNames); + + String filename = "logging_gapic.yaml"; + Path path = Paths.get(getTestFilesDirectory(), filename); + Optional> batchingSettingsOpt = + BatchingSettingsConfigParser.parse(Optional.of(path.toString())); + assertTrue(batchingSettingsOpt.isPresent()); + + String jsonFilename = "logging_grpc_service_config.json"; + Path jsonPath = Paths.get(getTestFilesDirectory(), jsonFilename); + Optional configOpt = ServiceConfigParser.parse(jsonPath.toString()); + assertTrue(configOpt.isPresent()); + GapicServiceConfig config = configOpt.get(); + config.setBatchingSettings(batchingSettingsOpt); + + return GapicContext.builder() + .setMessages(messageTypes) + .setResourceNames(resourceNames) + .setServices(services) + .setServiceConfig(config) + .setHelperResourceNames(outputResourceNames) + .setTransport(transport) + .setArtifact(LOGGING_SERVICE_ARTIFACT) + .build(); + } + + public GapicContext parseCallabeNameType() { + FileDescriptor serviceFileDescriptor = CallableNameType.getDescriptor(); + ServiceDescriptor serviceDescriptor = serviceFileDescriptor.getServices().get(0); + assertEquals("CallableNameTypeService", serviceDescriptor.getName()); + + List protoFiles = Collections.singletonList(serviceFileDescriptor); + + Map resourceNames = new HashMap<>(); + Map messageTypes = new HashMap<>(); + for (FileDescriptor fileDescriptor : protoFiles) { + resourceNames.putAll(Parser.parseResourceNames(fileDescriptor)); + messageTypes.putAll(Parser.parseMessages(fileDescriptor)); + } + + // Additional resource names. + FileDescriptor commonResourcesFileDescriptor = CommonResources.getDescriptor(); + resourceNames.putAll(Parser.parseResourceNames(commonResourcesFileDescriptor)); + + Set outputResourceNames = new HashSet<>(); + List services = + Parser.parseService( + serviceFileDescriptor, + messageTypes, + resourceNames, + Optional.empty(), + outputResourceNames); + + return GapicContext.builder() + .setMessages(messageTypes) + .setResourceNames(resourceNames) + .setServices(services) + .setHelperResourceNames(outputResourceNames) + .setTransport(transport) + .build(); + } + + public GapicContext parseBigqueryService() { + FileDescriptor bigqueryFileDescriptor = JobProto.getDescriptor(); + ServiceDescriptor biqqueryServiceDescriptor = bigqueryFileDescriptor.getServices().get(0); + assertEquals("JobService", biqqueryServiceDescriptor.getName()); + + Map messageTypes = Parser.parseMessages(bigqueryFileDescriptor); + Map resourceNames = Parser.parseResourceNames(bigqueryFileDescriptor); + Set outputResourceNames = new HashSet<>(); + List services = + Parser.parseService( + bigqueryFileDescriptor, + messageTypes, + resourceNames, + Optional.empty(), + outputResourceNames); + + String jsonFilename = "bigquery_v2_service_config.json"; + Path jsonPath = Paths.get(testFilesDirectory, jsonFilename); + Optional configOpt = ServiceConfigParser.parse(jsonPath.toString()); + assertTrue(configOpt.isPresent()); + GapicServiceConfig config = configOpt.get(); + + return GapicContext.builder() + .setMessages(messageTypes) + .setResourceNames(resourceNames) + .setServices(services) + .setServiceConfig(config) + .setHelperResourceNames(outputResourceNames) + .setTransport(transport) + .build(); + } + + public GapicContext parseResourceNameExtractorTesting() { + FileDescriptor fileDescriptor = ResourceNameExtractorTestingOuterClass.getDescriptor(); + ServiceDescriptor serviceDescriptor = fileDescriptor.getServices().get(0); + assertEquals("ResourceNameExtractorTesting", serviceDescriptor.getName()); + + Map messageTypes = Parser.parseMessages(fileDescriptor); + Map resourceNames = Parser.parseResourceNames(fileDescriptor); + Set outputResourceNames = new HashSet<>(); + List services = + Parser.parseService( + fileDescriptor, messageTypes, resourceNames, Optional.empty(), outputResourceNames); + + return GapicContext.builder() + .setMessages(messageTypes) + .setResourceNames(resourceNames) + .setServices(services) + .setHelperResourceNames(outputResourceNames) + .setTransport(transport) + .build(); + } + + public String getTestFilesDirectory() { + return testFilesDirectory; + } + + public Transport getTransport() { + return transport; + } +} diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/testutils/LineFormatter.java b/gapic-generator-java/src/test/java/com/google/api/generator/test/utils/LineFormatter.java similarity index 94% rename from gapic-generator-java/src/test/java/com/google/api/generator/testutils/LineFormatter.java rename to gapic-generator-java/src/test/java/com/google/api/generator/test/utils/LineFormatter.java index c587a08455..13a59f9f02 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/testutils/LineFormatter.java +++ b/gapic-generator-java/src/test/java/com/google/api/generator/test/utils/LineFormatter.java @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package com.google.api.generator.testutils; +package com.google.api.generator.test.utils; public class LineFormatter { public static String lines(String... lines) { diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/test/utils/TestExprBuilder.java b/gapic-generator-java/src/test/java/com/google/api/generator/test/utils/TestExprBuilder.java new file mode 100644 index 0000000000..64ec8b9a62 --- /dev/null +++ b/gapic-generator-java/src/test/java/com/google/api/generator/test/utils/TestExprBuilder.java @@ -0,0 +1,42 @@ +// 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. + +package com.google.api.generator.test.utils; + +import com.google.api.generator.engine.ast.StringObjectValue; +import com.google.api.generator.engine.ast.TypeNode; +import com.google.api.generator.engine.ast.TypeNode.TypeKind; +import com.google.api.generator.engine.ast.ValueExpr; +import com.google.api.generator.engine.ast.VaporReference; +import com.google.api.generator.engine.ast.Variable; +import com.google.api.generator.engine.ast.VariableExpr; + +public class TestExprBuilder { + + public static ValueExpr generateStringValueExpr(String value) { + return ValueExpr.builder().setValue(StringObjectValue.withValue(value)).build(); + } + + public static VariableExpr generateClassValueExpr(String clazzName) { + return VariableExpr.builder() + .setVariable(Variable.builder().setType(TypeNode.CLASS_OBJECT).setName("class").build()) + .setStaticReferenceType( + TypeNode.builder() + .setReference( + VaporReference.builder().setName(clazzName).setPakkage("com.test").build()) + .setTypeKind(TypeKind.OBJECT) + .build()) + .build(); + } +} diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/util/TestUtils.java b/gapic-generator-java/src/test/java/com/google/api/generator/util/TestUtils.java deleted file mode 100644 index ee509e0fee..0000000000 --- a/gapic-generator-java/src/test/java/com/google/api/generator/util/TestUtils.java +++ /dev/null @@ -1,42 +0,0 @@ -// 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. - -package com.google.api.generator.util; - -import com.google.api.generator.engine.ast.StringObjectValue; -import com.google.api.generator.engine.ast.TypeNode; -import com.google.api.generator.engine.ast.TypeNode.TypeKind; -import com.google.api.generator.engine.ast.ValueExpr; -import com.google.api.generator.engine.ast.VaporReference; -import com.google.api.generator.engine.ast.Variable; -import com.google.api.generator.engine.ast.VariableExpr; - -public class TestUtils { - - public static ValueExpr generateStringValueExpr(String value) { - return ValueExpr.builder().setValue(StringObjectValue.withValue(value)).build(); - } - - public static VariableExpr generateClassValueExpr(String clazzName) { - return VariableExpr.builder() - .setVariable(Variable.builder().setType(TypeNode.CLASS_OBJECT).setName("class").build()) - .setStaticReferenceType( - TypeNode.builder() - .setReference( - VaporReference.builder().setName(clazzName).setPakkage("com.test").build()) - .setTypeKind(TypeKind.OBJECT) - .build()) - .build(); - } -} diff --git a/gapic-generator-java/src/test/java/com/google/api/generator/util/TrieTest.java b/gapic-generator-java/src/test/java/com/google/api/generator/util/TrieTest.java index 8769e522cb..726c9a1d64 100644 --- a/gapic-generator-java/src/test/java/com/google/api/generator/util/TrieTest.java +++ b/gapic-generator-java/src/test/java/com/google/api/generator/util/TrieTest.java @@ -18,16 +18,16 @@ import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertTrue; -import com.google.api.generator.testutils.LineFormatter; +import com.google.api.generator.test.utils.LineFormatter; import java.util.Arrays; import java.util.List; import java.util.function.BiFunction; import java.util.function.Function; -import org.junit.Test; +import org.junit.jupiter.api.Test; -public class TrieTest { +class TrieTest { @Test - public void insertAndSearch_stringTrie() { + void insertAndSearch_stringTrie() { Trie trie = new Trie<>(); Function> wordToCharListFn = w -> Arrays.asList(w.split("(?!^)")); @@ -46,7 +46,7 @@ public void insertAndSearch_stringTrie() { } @Test - public void insertAndSearch_multiStringTrie() { + void insertAndSearch_multiStringTrie() { Trie trie = new Trie<>(); assertFalse(trie.search(Arrays.asList("user", "identity", "name"))); @@ -67,7 +67,7 @@ public void insertAndSearch_multiStringTrie() { } @Test - public void dfsTraverseAndReduce_emptyTrie() { + void dfsTraverseAndReduce_emptyTrie() { // Add up points in the tree, where each parent gets (num child node points) * 2 + 1. Function parentPreprocFn = nodeVal -> new Integer(0); BiFunction leafReduceFn = @@ -81,7 +81,7 @@ public void dfsTraverseAndReduce_emptyTrie() { } @Test - public void dfsTraverseAndReduce_singleNodeTrie() { + void dfsTraverseAndReduce_singleNodeTrie() { // Add up points in the tree, where each parent gets (num child node points) * 2 + 1. Function parentPreprocFn = nodeVal -> new Integer(0); BiFunction leafReduceFn = @@ -96,7 +96,7 @@ public void dfsTraverseAndReduce_singleNodeTrie() { } @Test - public void dfsTraverseAndReduce_oneParentOneChildBranchTrie() { + void dfsTraverseAndReduce_oneParentOneChildBranchTrie() { Function toUpperCaseFn = s -> s.substring(0, 1).toUpperCase() + s.substring(1); Function parentPreprocFn = nodeVal -> @@ -137,7 +137,7 @@ public void dfsTraverseAndReduce_oneParentOneChildBranchTrie() { } @Test - public void dfsTraverseAndReduce_oneDeepBranchTrie() { + void dfsTraverseAndReduce_oneDeepBranchTrie() { // Add up points in the tree, where each parent gets (num child node points) * 2 + 1. int simpleBaseValue = 0; Function simpleParentPreprocFn = nodeVal -> new Integer(0); @@ -195,7 +195,7 @@ public void dfsTraverseAndReduce_oneDeepBranchTrie() { } @Test - public void dfsTraverseAndReduce_depthAndBreathTrie() { + void dfsTraverseAndReduce_depthAndBreathTrie() { Function toUpperCaseFn = s -> s.substring(0, 1).toUpperCase() + s.substring(1); Function parentPreprocFn = nodeVal -> diff --git a/gapic-generator-java/src/test/proto/api_version_testing.proto b/gapic-generator-java/src/test/proto/api_version_testing.proto new file mode 100644 index 0000000000..f815a7633e --- /dev/null +++ b/gapic-generator-java/src/test/proto/api_version_testing.proto @@ -0,0 +1,264 @@ +// 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 +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT 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"; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/field_info.proto"; +import "google/api/resource.proto"; +import "google/longrunning/operations.proto"; +import "google/protobuf/duration.proto"; +import "google/protobuf/timestamp.proto"; +import "google/rpc/status.proto"; + +package google.api.version.test.v1; + +option java_package = "com.google.api.version.test"; +option java_multiple_files = true; +option java_outer_classname = "ApiVersionTestingOuterClass"; + +option (google.api.resource_definition) = { + type: "showcase.googleapis.com/AnythingGoes" + pattern: "*" +}; +// This proto is used to test scenarios related to api_version feature. +// api_version is set on service level, so this proto includes various services +// to test different scenarios. + +// This service is used to test when api_version string is provided. +service EchoWithVersion { + // This service is meant to only run locally on the port 7469 (keypad digits + // for "show"). + option (google.api.default_host) = "localhost:7469"; + option (google.api.api_version) = "fake_version"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform"; + + // This method simply echos the request. This method is showcases unary rpcs. + rpc EchoWithVersionMethod(EchoRequest) returns (EchoResponse) { + option (google.api.http) = { + post: "/v1beta1/echo:echo" + body: "*" + }; + option (google.api.method_signature) = "content"; + option (google.api.method_signature) = "error"; + option (google.api.method_signature) = "content,severity"; + option (google.api.method_signature) = "name"; + option (google.api.method_signature) = "parent"; + option (google.api.method_signature) = ""; + } +} + +// This service is used to test when api_version is not provided. +service EchoWithoutVersion { + // This service is meant to only run locally on the port 7469 (keypad digits + // for "show"). + option (google.api.default_host) = "localhost:7469"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform"; + + // This method simply echos the request. This method is showcases unary rpcs. + rpc Echo(EchoRequest) returns (EchoResponse) { + option (google.api.http) = { + post: "/v1beta1/echo:echo" + body: "*" + }; + option (google.api.method_signature) = "content"; + option (google.api.method_signature) = "error"; + option (google.api.method_signature) = "content,severity"; + option (google.api.method_signature) = "name"; + option (google.api.method_signature) = "parent"; + option (google.api.method_signature) = ""; + } +} + +// This service is to test api_version is empty. +service EchoWithEmptyVersion { + // This service is meant to only run locally on the port 7469 (keypad digits + // for "show"). + option (google.api.default_host) = "localhost:7469"; + option (google.api.api_version) = ""; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform"; + + // This method simply echos the request. This method is showcases unary rpcs. + rpc Echo(EchoRequest) returns (EchoResponse) { + option (google.api.http) = { + post: "/v1beta1/echo:echo" + body: "*" + }; + option (google.api.method_signature) = "content"; + option (google.api.method_signature) = "error"; + option (google.api.method_signature) = "content,severity"; + option (google.api.method_signature) = "name"; + option (google.api.method_signature) = "parent"; + option (google.api.method_signature) = ""; + } +} + +// A severity enum used to test enum capabilities in GAPIC surfaces +enum Severity { + UNNECESSARY = 0; + NECESSARY = 1; + URGENT = 2; + CRITICAL = 3; +} + +message Foobar { + option (google.api.resource) = { + type: "showcase.googleapis.com/Foobar" + pattern: "projects/{project}/foobars/{foobar}" + pattern: "projects/{project}/chocolate/variants/{variant}/foobars/{foobar}" + pattern: "foobars/{foobar}" + pattern: "bar_foos/{bar_foo}/foobars/{foobar}" + pattern: "*" + }; + + string name = 1; + string info = 2; +} + +// The request message used for the Echo, Collect and Chat methods. +// If content or opt are set in this message then the request will succeed. +// If status is set in this message +// then the status will be returned as an error. +message EchoRequest { + string name = 5 [ + (google.api.resource_reference).type = "showcase.googleapis.com/Foobar", + (google.api.field_behavior) = REQUIRED + ]; + + string parent = 6 [ + (google.api.resource_reference).child_type = + "showcase.googleapis.com/AnythingGoes", + (google.api.field_behavior) = REQUIRED + ]; + + oneof response { + // The content to be echoed by the server. + string content = 1; + + // The error to be thrown by the server. + google.rpc.Status error = 2; + } + + // The severity to be echoed by the server. + Severity severity = 3; + + Foobar foobar = 4; +} + +// The response message for the Echo methods. +message EchoResponse { + // The content specified in the request. + string content = 1; + + // The severity specified in the request. + Severity severity = 2; +} + +// Tests name collisions with java.lang.Object. +message Object { + // The content specified in the request. + string content = 1; +} + +// The request message for the Expand method. +message ExpandRequest { + // The content that will be split into words and returned on the stream. + string content = 1; + + // The error that is thrown after all words are sent on the stream. + google.rpc.Status error = 2; + + string info = 3; + +} + +// The request for the PagedExpand method. +message PagedExpandRequest { + // The string to expand. + string content = 1 [(google.api.field_behavior) = REQUIRED]; + + // The amount of words to returned in each page. + int32 page_size = 2; + + // The position of the page to be returned. + string page_token = 3; +} + +// The response for the PagedExpand method. +message PagedExpandResponse { + // The words that were expanded. + repeated EchoResponse responses = 1; + + // The next page token. + string next_page_token = 2; +} + +// The request for Wait method. +message WaitRequest { + oneof end { + // The time that this operation will complete. + google.protobuf.Timestamp end_time = 1; + + // The duration of this operation. + google.protobuf.Duration ttl = 4; + } + + oneof response { + // The error that will be returned by the server. If this code is specified + // to be the OK rpc code, an empty response will be returned. + google.rpc.Status error = 2; + + // The response to be returned on operation completion. + WaitResponse success = 3; + } +} + +// The result of the Wait operation. +message WaitResponse { + // This content of the result. + string content = 1; +} + +// The metadata for Wait operation. +message WaitMetadata { + // The time that this operation will complete. + google.protobuf.Timestamp end_time = 1; +} + +// The request for Block method. +message BlockRequest { + // The amount of time to block before returning a response. + google.protobuf.Duration response_delay = 1; + + oneof response { + // The error that will be returned by the server. If this code is specified + // to be the OK rpc code, an empty response will be returned. + google.rpc.Status error = 2; + + // The response to be returned that will signify successful method call. + BlockResponse success = 3; + } +} + +// The response for Block method. +message BlockResponse { + // This content can contain anything, the server will not depend on a value + // here. + string content = 1; +} diff --git a/gapic-generator-java/src/test/proto/auto_populate_field_testing.proto b/gapic-generator-java/src/test/proto/auto_populate_field_testing.proto new file mode 100644 index 0000000000..aa5b291180 --- /dev/null +++ b/gapic-generator-java/src/test/proto/auto_populate_field_testing.proto @@ -0,0 +1,144 @@ +// 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 +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT 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"; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/field_info.proto"; +import "google/api/resource.proto"; +import "google/longrunning/operations.proto"; +import "google/protobuf/duration.proto"; +import "google/protobuf/timestamp.proto"; +import "google/rpc/status.proto"; +import "google/protobuf/empty.proto"; + +package google.auto.populate.field; + +option java_package = "com.google.auto.populate.field"; +option java_multiple_files = true; + +// This service is meant for testing all scenarios related to +// the field AutoPopulateFieldTesting feature, including but not limited to the example in gapic-showcase's echo.proto +service AutoPopulateFieldTesting { + option (google.api.default_host) = "localhost:7469"; + + // This unary method simply echoes the request. request_id and second_request_id *should* be autopopulated on the request if not set. + rpc AutoPopulateFieldTestingEcho(AutoPopulateFieldTestingEchoRequest) returns (AutoPopulateFieldTestingEchoResponse) { + option (google.api.http) = { + post: "/v1beta1/AutoPopulateFieldTesting:echo" + body: "*" + }; + } + + // This server-side streaming method splits the given content into words and will pass each word back + // through the stream. This method should not have any autopopulated fields. + rpc AutoPopulateFieldTestingExpand(AutoPopulateFieldTestingExpandRequest) returns (stream AutoPopulateFieldTestingEchoResponse) { + option (google.api.http) = { + post: "/v1beta1/AutoPopulateFieldTesting:expand" + body: "*" + }; + } + + // This client-side streaming method will collect the words given to it. When the stream is closed + // by the client, this method will return the a concatenation of the strings + // passed to it. This method should not have any autopopulated fields. + rpc AutoPopulateFieldTestingCollect(stream AutoPopulateFieldTestingEchoRequest) returns (AutoPopulateFieldTestingEchoResponse) { + option (google.api.http) = { + post: "/v1beta1/AutoPopulateFieldTesting:collect" + body: "*" + }; + } + + // This bidirectional streaming method, upon receiving a request on the stream, will pass the same + // content back on the stream. This method should not have any autopopulated fields. + rpc AutoPopulateFieldTestingChat(stream AutoPopulateFieldTestingEchoRequest) returns (stream AutoPopulateFieldTestingEchoResponse); +} + +// The request message used for the AutoPopulateFieldTestingEcho, AutoPopulateFieldTestingCollect and AutoPopulateFieldTestingChat methods. +// If content or opt are set in this message then the request will succeed. +// If status is set in this message then the status will be returned as an +// error. +message AutoPopulateFieldTestingEchoRequest { + oneof response { + // The content to be echoed by the server. + string content = 1; + + // The error to be thrown by the server. + google.rpc.Status error = 2; + } + + // Based on go/client-populate-request-id-design; subject to change + string request_id = 3 [ + (google.api.field_info).format = UUID4 + ]; + + // This field is added to test that AutoPopulateFieldTesting works for multiple fields + string second_request_id = 8 [ + (google.api.field_behavior) = OPTIONAL, + (google.api.field_info).format = UUID4 + ]; + + // This field is added to test that AutoPopulateFieldTesting should not populate this field since it is not of type String + bool third_request_id = 9 [ + (google.api.field_info).format = UUID4 + ]; + + // This field is added to test that AutoPopulateFieldTesting should not populate this field since it is not annotated with UUID4 format + string fourth_request_id = 10 [ + (google.api.field_info).format = IPV4_OR_IPV6 + ]; + + // This field is added to test that AutoPopulateFieldTesting should not populate this field since it is not designated in the service_yaml + string fifth_request_id = 11 [ + (google.api.field_info).format = UUID4 + ]; + + // This field is added to test that AutoPopulateFieldTesting should not populate this field since it marked as Required + string sixth_request_id = 12 [ + (google.api.field_info).format = UUID4, + (google.api.field_behavior) = REQUIRED + ]; +} + +// The response message for the AutoPopulateFieldTesting service methods. +message AutoPopulateFieldTestingEchoResponse { + // The content specified in the request. + string content = 1; + + // The request ID specified or autopopulated in the request. + string request_id = 2; + + // The second request ID specified or autopopulated in the request. + string second_request_id = 3; +} + +// The request message for the AutoPopulateFieldTestingExpand method. +message AutoPopulateFieldTestingExpandRequest { + // The content that will be split into words and returned on the stream. + string content = 1; + + // The error that is thrown after all words are sent on the stream. + google.rpc.Status error = 2; + + //The wait time between each server streaming messages + google.protobuf.Duration stream_wait_time = 3; + + // This field is added to test that AutoPopulateFieldTesting should not populate this field since it is not used in a unary method, even though it is otherwise configured correctly. + string request_id = 4 [ + (google.api.field_behavior) = OPTIONAL, + (google.api.field_info).format = UUID4 + ]; +} diff --git a/gapic-generator-java/src/test/proto/bigquery_jobs.proto b/gapic-generator-java/src/test/proto/bigquery_jobs.proto new file mode 100644 index 0000000000..9d6da3c8d9 --- /dev/null +++ b/gapic-generator-java/src/test/proto/bigquery_jobs.proto @@ -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 +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.bigquery.v2; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/protobuf/empty.proto"; +import "google/protobuf/struct.proto"; +import "google/protobuf/wrappers.proto"; + +option java_outer_classname = "JobProto"; +option java_package = "com.google.cloud.bigquery.v2"; + +service JobService { + option (google.api.default_host) = "bigquery.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/bigquery," + "https://www.googleapis.com/auth/cloud-platform," + "https://www.googleapis.com/auth/cloud-platform.read-only," + "https://www.googleapis.com/auth/devstorage.full_control," + "https://www.googleapis.com/auth/devstorage.read_only," + "https://www.googleapis.com/auth/devstorage.read_write"; + + // Requests the deletion of the metadata of a job. This call returns when the + // job's metadata is deleted. + rpc DeleteJob(DeleteJobRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/bigquery/v2/projects/{project_id=*}/jobs/{job_id=*}/delete" + }; + } + + // Lists all jobs that you started in the specified project. Job information + // is available for a six month period after creation. The job list is sorted + // in reverse chronological order, by job creation time. Requires the Can View + // project role, or the Is Owner project role if you set the allUsers + // property. + rpc ListJobs(ListJobsRequest) returns (JobList) { + option (google.api.http) = { + get: "/bigquery/v2/projects/{project_id=*}/jobs" + }; + } +} + +// Simplified BigQuery Jobs service ListJobsRequest for testing. +message ListJobsRequest { + // Project ID of the jobs to list. + string project_id = 1; + + // The maximum number of results to return in a single response page. + // Leverage the page tokens to iterate through the entire collection. + google.protobuf.Int32Value max_results = 3; + + // Page token, returned by a previous call, to request the next page of + // results. + string page_token = 6; +} + +// Describes the format of a jobs deletion request. +message DeleteJobRequest { + // Required. Project ID of the job for which metadata is to be deleted. + string project_id = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. Job ID of the job for which metadata is to be deleted. If this is + // a parent job which has child jobs, the metadata from all child jobs will be + // deleted as well. Direct deletion of the metadata of child jobs is not + // allowed. + string job_id = 2 [(google.api.field_behavior) = REQUIRED]; + + // The geographic location of the job. Required. + // + // For more information, see how to + // [specify + // locations](https://cloud.google.com/bigquery/docs/locations#specify_locations). + string location = 3; +} + +// Simplified ListFormatJob for testing. +message ListFormatJob { + // Unique opaque ID of the job. + string id = 1; +} + +// Simplified JobList response for testing. +message JobList { + // A hash of this page of results. + string etag = 1; + + // The resource type of the response. + string kind = 2; + + // A token to request the next page of results. + string next_page_token = 3; + + // List of jobs that were requested. + repeated ListFormatJob jobs = 4; +} \ No newline at end of file diff --git a/gapic-generator-java/src/test/proto/callable_name_type.proto b/gapic-generator-java/src/test/proto/callable_name_type.proto new file mode 100644 index 0000000000..0b896f6bbf --- /dev/null +++ b/gapic-generator-java/src/test/proto/callable_name_type.proto @@ -0,0 +1,75 @@ +// 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 +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT 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"; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/longrunning/operations.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; + +package google.test.naming; + +option java_package = "com.google.test.callablenamingtype"; +option java_multiple_files = true; + +// This service exercises two scenarios where the RPC name previously would attempt +// to generate the incorrect type of RPC: +// 1. Unary RPCs that ended with `Operation` would be assumed to be an LRO +// 2. Unary (non-paged) RPCs that ended `Paged` would be assumed to be Paged +service CallableNameTypeService { + + option (google.api.default_host) = "localhost:7469"; + + // The generator should not parse this RPC as an LRO and should not generate + // an operation callable for this + rpc GetApiOperation(GetApiOperationRequest) returns (ApiOperation) { + option (google.api.http) = { + get: "/v1/{name=apiOperations/*}" + }; + option (google.api.method_signature) = "name"; + } + + // The generator should not parse this as a Paged callable and should not + // generate a paged callable for this + rpc ApiPaged(GetApiOperationRequest) returns (ApiOperation) { + option (google.api.http) = { + get: "/v1/{name=apiOperations/*}" + }; + option (google.api.method_signature) = "name"; + } +} + +message GetApiOperationRequest { + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "testing.com/ApiOperation" + } + ]; +} + +message ApiOperation { + option (google.api.resource) = { + type: "testing.com/ApiOperation" + pattern: "apiOperations/{operation}" + plural: "apiOperations" + singular: "apiOperation" + }; + + string name = 1; +} + + diff --git a/gapic-generator-java/src/test/proto/collisions.proto b/gapic-generator-java/src/test/proto/collisions.proto new file mode 100644 index 0000000000..296469c19d --- /dev/null +++ b/gapic-generator-java/src/test/proto/collisions.proto @@ -0,0 +1,89 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT 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"; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/longrunning/operations.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; + +package google.showcase.v1beta1; + +option java_package = "com.google.test.collisions"; +option java_multiple_files = true; + +// This service exercises scenarios where short names of types +// exhibit ambiguity or collide with other types +service Collisions { + + option (google.api.default_host) = "localhost:7469"; + + rpc shouldUseSamePackageTypesLro(Request) returns (google.longrunning.Operation) { + option (google.longrunning.operation_info) = { + // collision with google.protobuf.DescriptorProtos.GeneratedCodeInfo.Annotation + response_type: "Annotation" + // collision with google.cloud.location.Location; + metadata_type: "Location" + }; + } + + rpc shortNameMatchShouldThrowLro(Request) returns (google.longrunning.Operation) { + option (google.longrunning.operation_info) = { + // collision with google.protobuf.DescriptorProtos.GeneratedCodeInfo.Annotation + response_type: "Annotation" + // collision with google.protobuf.DescriptorProtos.ExtensionRangeOptions.Declaration + // not a valid short name specification (no such type exist in same package) + metadata_type: "Declaration" + }; + } + + rpc fullNameForDifferentPackageLro(Request) returns (google.longrunning.Operation) { + option (google.longrunning.operation_info) = { + // fully qualified name should match google.cloud.location.Location + response_type: "google.cloud.location.Location" + // short name only should match Location message defined below + metadata_type: "Location" + }; + } +} + +message Request { + string name = 1; + Annotation annotation = 2; + Location location = 3; +} + +message Annotation { + string name = 1; +} + +message Location { + string name = 1; +} + +message Resource { + option (google.api.resource) = { + type: "config.googleapis.com/Resource" + pattern: "projects/{project}/locations/{location}/deployments/{deployment}/revisions/{revision}/resources/{resource}" + }; + + // Resource name of the Resource. + // Format: + // `projects/{project}/locations/{location}/deployments/{deployment}/revisions/{revision}/resources/{resource}` + string name = 1 [ + (google.api.field_behavior) = OUTPUT_ONLY + ]; +} diff --git a/gapic-generator-java/src/test/proto/echo.proto b/gapic-generator-java/src/test/proto/echo.proto index ea262faf32..28052e26c6 100644 --- a/gapic-generator-java/src/test/proto/echo.proto +++ b/gapic-generator-java/src/test/proto/echo.proto @@ -17,6 +17,7 @@ syntax = "proto3"; import "google/api/annotations.proto"; import "google/api/client.proto"; import "google/api/field_behavior.proto"; +import "google/api/field_info.proto"; import "google/api/resource.proto"; import "google/longrunning/operations.proto"; import "google/protobuf/duration.proto"; @@ -139,6 +140,16 @@ service Echo { body: "*" }; } + + // This is similar to the PagedExpand except that it uses + // max_results instead of page_size, as some legacy APIs still + // do. New APIs should NOT use this pattern. + rpc PagedExpandLegacy(PagedExpandLegacyRequest) returns (PagedExpandResponse) { + option (google.api.http) = { + post: "/v1beta1/echo:pagedExpandLegacy" + body: "*" + }; + } } // A severity enum used to test enum capabilities in GAPIC surfaces @@ -217,6 +228,7 @@ message ExpandRequest { google.rpc.Status error = 2; string info = 3; + } // The request for the PagedExpand method. @@ -293,3 +305,19 @@ message BlockResponse { // here. string content = 1; } + +// The request for the PagedExpandLegacy method. This is a pattern used by some legacy APIs. New +// APIs should NOT use this pattern, but rather something like PagedExpandRequest which conforms to +// aip.dev/158. +message PagedExpandLegacyRequest { + // The string to expand. + string content = 1 [(google.api.field_behavior) = REQUIRED]; + + // The number of words to returned in each page. + // (-- aip.dev/not-precedent: This is a legacy, non-standard pattern that + // violates aip.dev/158. Ordinarily, this should be page_size. --) + int32 max_results = 2; + + // The position of the page to be returned. + string page_token = 3; +} diff --git a/gapic-generator-java/src/test/proto/echo_grpcrest.proto b/gapic-generator-java/src/test/proto/echo_grpcrest.proto index 61efb8fd65..e02b4e35db 100644 --- a/gapic-generator-java/src/test/proto/echo_grpcrest.proto +++ b/gapic-generator-java/src/test/proto/echo_grpcrest.proto @@ -23,6 +23,7 @@ import "google/protobuf/duration.proto"; import "google/protobuf/struct.proto"; import "google/protobuf/timestamp.proto"; import "google/rpc/status.proto"; +import "google/protobuf/field_mask.proto"; package google.showcase.grpcrest.v1beta1; @@ -46,6 +47,7 @@ service Echo { option (google.api.default_host) = "localhost:7469"; option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform"; + option (google.api.api_version) = "foo_version_for_tests"; // This method simply echos the request. This method is showcases unary rpcs. rpc Echo(EchoRequest) returns (EchoResponse) { @@ -145,11 +147,20 @@ service Echo { } rpc NoBinding(EchoRequest) returns (EchoResponse); -} -// Generator should not fail when encounter a service without methods -service EchoEmpy { - option (google.api.default_host) = "localhost:7469"; + //The request message contains a field name that is a Java keyword(case), + //the field is also a resource and used in http annotations + rpc UpdateCase(UpdateCaseRequest) returns (Case) { + option (google.api.http) = { + patch: "/v2beta/{case.name=projects/*/cases/*}" + body: "case" + additional_bindings { + patch: "/v2beta/{case.name=organizations/*/cases/*}" + body: "case" + } + }; + option (google.api.method_signature) = "case,update_mask"; + } } // A severity enum used to test enum capabilities in GAPIC surfaces @@ -160,6 +171,27 @@ enum Severity { CRITICAL = 3; } +message UpdateCaseRequest { + Case case = 1 [(google.api.field_behavior) = REQUIRED]; + + google.protobuf.FieldMask update_mask = 2; +} + +message Case { + option (google.api.resource) = { + type: "cloudsupport.googleapis.com/Case" + pattern: "organizations/{organization}/cases/{case}" + pattern: "projects/{project}/cases/{case}" + }; + + // The resource name for the case. + string name = 1; + + string display_name = 2; + + string description = 3; +} + message Foobar { option (google.api.resource) = { type: "showcase.googleapis.com/Foobar" diff --git a/gapic-generator-java/src/test/proto/explicit_dynamic_routing_header_testing.proto b/gapic-generator-java/src/test/proto/explicit_dynamic_routing_header_testing.proto index cbe9526a7b..8ac8873243 100644 --- a/gapic-generator-java/src/test/proto/explicit_dynamic_routing_header_testing.proto +++ b/gapic-generator-java/src/test/proto/explicit_dynamic_routing_header_testing.proto @@ -265,9 +265,37 @@ service ExplicitDynamicRoutingHeaderTesting { } }; } + + // This method echoes the request. This method exercises + // including a non-proto3-optional enum field in the URL path while sending the + // entire request object in the REST body. + rpc ImplicitRoutingHeaderWithEnumTest(EnumRequest) returns (EnumResponse) { + option (google.api.http) = { + post: "/v1beta1/{info.enum_test}" + body: "*" + }; + } +} + +message EnumRequest { + string name = 1; + EnumMessage info = 2; } +message EnumResponse { + EnumRequest request = 1; +} +message EnumMessage { + enum EnumValues { + ENUM_VALUE_1 = 0; + ENUM_VALUE_2 = 1; + ENUM_VALUE_3 = 2; + ENUM_VALUE_4 = 3; + } + // scalar types + EnumValues enum_test = 22; +} // Example message: // diff --git a/gapic-generator-java/src/test/proto/http_rule_parser_testing.proto b/gapic-generator-java/src/test/proto/http_rule_parser_testing.proto index d9946e2134..9a5b6f0420 100644 --- a/gapic-generator-java/src/test/proto/http_rule_parser_testing.proto +++ b/gapic-generator-java/src/test/proto/http_rule_parser_testing.proto @@ -39,7 +39,7 @@ service HttpRuleParserTesting { }; } - //TODO: Add more test cases once https://github.com/googleapis/gapic-generator-java/issues/1041 is fixed + //TODO: Add more test cases once https://github.com/googleapis/sdk-platform-java/issues/1041 is fixed } enum Continent { diff --git a/gapic-generator-java/src/test/proto/resource_name_extractor_testing.proto b/gapic-generator-java/src/test/proto/resource_name_extractor_testing.proto new file mode 100644 index 0000000000..f339db4b93 --- /dev/null +++ b/gapic-generator-java/src/test/proto/resource_name_extractor_testing.proto @@ -0,0 +1,71 @@ +syntax = "proto3"; + +package google.extractor.testing; + +option java_multiple_files = true; +option java_outer_classname = "ResourceNameExtractorTestingOuterClass"; +option java_package = "com.google.extractor.testing"; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/resource.proto"; + +service ResourceNameExtractorTesting { + option (google.api.default_host) = "extractor.googleapis.com"; + + rpc GetFoo(GetFooRequest) returns (Foo) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/foos/*}" + }; + option (google.api.method_signature) = "name"; + } + + rpc GetBar(GetBarRequest) returns (Bar) { + option (google.api.http) = { + get: "/v1/{bar=projects/*/locations/*/bars/*}" + }; + option (google.api.method_signature) = "bar"; + } + + rpc ListFoos(ListFoosRequest) returns (ListFoosResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*}/foos" + }; + option (google.api.method_signature) = "parent"; + } +} + +message Foo { + option (google.api.resource) = { + type: "extractor.googleapis.com/Foo" + pattern: "projects/{project}/locations/{location}/foos/{foo}" + }; + string name = 1; +} + +message Bar { + string name = 1; +} + +message GetFooRequest { + string name = 1 [ + (google.api.resource_reference) = { + type: "extractor.googleapis.com/Foo" + } + ]; +} + +message GetBarRequest { + string bar = 1; +} +message ListFoosRequest { + string parent = 1 [ + (google.api.resource_reference) = { + child_type: "extractor.googleapis.com/Foo" + } + ]; +} + +message ListFoosResponse { + repeated Foo foos = 1; +} diff --git a/gapic-generator-java/src/test/proto/selective_api_generation.proto b/gapic-generator-java/src/test/proto/selective_api_generation.proto new file mode 100644 index 0000000000..e75ee58134 --- /dev/null +++ b/gapic-generator-java/src/test/proto/selective_api_generation.proto @@ -0,0 +1,189 @@ +// 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 +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT 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"; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/field_info.proto"; +import "google/api/resource.proto"; +import "google/longrunning/operations.proto"; +import "google/protobuf/duration.proto"; +import "google/protobuf/timestamp.proto"; +import "google/rpc/status.proto"; + +package google.selective.generate.v1beta1; + +option java_package = "com.google.selective.generate.v1beta1"; +option java_multiple_files = true; +option java_outer_classname = "SelectiveApiGenerationOuterClass"; + +// resource not tied to message +option (google.api.resource_definition) = { + type: "showcase.googleapis.com/AnythingGoes" + pattern: "*" +}; + +// This proto is used to test selective api generation +// covered scenarios: +// - A service with several rpcs, all of them should be generated as public methods +// - A service with several rpcs, part of them should be generated as public methods +// - A service with several rpcs, none of them should be generated as public methods +// This proto should be tested side-by-side with yaml files: +// - selective_api_generation_v1beta1.yaml or - selective_api_generation_generate_omitted_v1beta1.yaml + +service EchoServiceShouldGenerateAllAsUsual { + option (google.api.default_host) = "localhost:7469"; + + rpc EchoShouldGenerateAsUsual(EchoRequest) returns (EchoResponse) { + option (google.api.http) = { + post: "/v1beta1/echo:echo" + body: "*" + }; + option (google.api.method_signature) = "name"; + option (google.api.method_signature) = ""; + } + + rpc ChatShouldGenerateAsUsual(stream EchoRequest) returns (stream EchoResponse); + + rpc ChatAgainShouldGenerateAsUsual(stream EchoRequest) returns (stream EchoResponse) { + option (google.api.method_signature) = "content"; + } +} + +service EchoServiceShouldGeneratePartialUsual { + option (google.api.default_host) = "localhost:7469"; + + rpc EchoShouldGenerateAsUsual(EchoRequest) returns (EchoResponse) { + option (google.api.http) = { + post: "/v1beta1/echo:echo" + body: "*" + }; + option (google.api.method_signature) = "name"; + option (google.api.method_signature) = ""; + } + + rpc ChatShouldGenerateAsUsual(stream EchoRequest) returns (stream EchoResponse); + + rpc ChatAgainShouldGenerateAsUsual(stream EchoRequest) returns (stream EchoResponse) { + option (google.api.method_signature) = "content"; + } + + rpc ChatShouldGenerateAsInternal(EchoRequest) returns (EchoResponse) { + option (google.api.http) = { + post: "/v1beta1/echo:echo" + body: "*" + }; + option (google.api.method_signature) = "name"; + option (google.api.method_signature) = ""; + }; + + rpc EchoShouldGenerateAsInternal(stream EchoRequest) returns (stream EchoResponse); +} + +service EchoServiceShouldGenerateAllInternal { + option (google.api.default_host) = "localhost:7469"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform"; + + rpc EchoShouldGenerateAsInternal(EchoRequest) returns (EchoResponse) { + option (google.api.method_signature) = "content"; + } + + rpc ChatShouldGenerateAsInternal(stream EchoRequest) returns (stream EchoResponse) { + option (google.api.method_signature) = "content"; + } +} + +// resource name used for message EchoRequest. +message Foobar { + option (google.api.resource) = { + type: "showcase.googleapis.com/Foobar" + pattern: "projects/{project}/foobars/{foobar}" + }; + + string name = 1; + string info = 2; +} + +// resource name used only for message EchoRequestWithFoobarbaz. +// should not be generated with selective generation when +// AnExcludedMethod is not config as included. +message Foobarbaz { + option (google.api.resource) = { + type: "showcase.googleapis.com/Foobarbaz" + pattern: "projects/{project}/foobarsbaz/{foobarbaz}" + pattern: "projects/{project}/chocolate/variants/{variant}/foobars/{foobar}" + }; + + string name = 1; + string info = 2; +} + +// RPCs in inclusion list and not in the list both relies on this request message. +message EchoRequest { + string name = 5 [ + (google.api.resource_reference).type = "showcase.googleapis.com/Foobar", + (google.api.field_behavior) = REQUIRED + ]; + + string parent = 6 [ + (google.api.resource_reference).child_type = + "showcase.googleapis.com/AnythingGoes", + (google.api.field_behavior) = REQUIRED + ]; + + oneof response { + // The content to be echoed by the server. + string content = 1; + + // The error to be thrown by the server. + google.rpc.Status error = 2; + } + + Foobar foobar = 4; +} + +// This request message is used by AnExcludedMethod rpc. +// To demonstrate that if AnExcludedMethod is not included in generation, +// then the resource name Foobarbaz, which is only used by this method, +// should not be generated. +message EchoRequestWithFoobarbaz { + string name = 5 [ + (google.api.resource_reference).type = "showcase.googleapis.com/Foobarbaz", + (google.api.field_behavior) = REQUIRED + ]; + + string parent = 6 [ + (google.api.resource_reference).child_type = + "showcase.googleapis.com/AnythingGoes", + (google.api.field_behavior) = REQUIRED + ]; + + oneof response { + // The content to be echoed by the server. + string content = 1; + + // The error to be thrown by the server. + google.rpc.Status error = 2; + } + + Foobarbaz foobar = 4; +} + +message EchoResponse { + // The content specified in the request. + string content = 1; +} diff --git a/gapic-generator-java/src/test/proto/service_with_no_methods.proto b/gapic-generator-java/src/test/proto/service_with_no_methods.proto new file mode 100644 index 0000000000..906ade5dcb --- /dev/null +++ b/gapic-generator-java/src/test/proto/service_with_no_methods.proto @@ -0,0 +1,131 @@ +// 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 +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT 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"; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/field_info.proto"; +import "google/api/resource.proto"; +import "google/longrunning/operations.proto"; +import "google/protobuf/duration.proto"; +import "google/protobuf/timestamp.proto"; +import "google/rpc/status.proto"; + +package google.api.service.without.methods.test.v1; + +option java_package = "com.google.api.service.without.methods.test"; +option java_multiple_files = true; +option java_outer_classname = "ServiceWithNoMethodsOuterClass"; + +option (google.api.resource_definition) = { + type: "showcase.googleapis.com/AnythingGoes" + pattern: "*" +}; +// This proto is used to test scenarios where a service does not have any rpc methods + +// This service is used as control group when it is not empty. +service EchoWithMethods { + // This service is meant to only run locally on the port 7469 (keypad digits + // for "show"). + option (google.api.default_host) = "localhost:7469"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform"; + + // This method simply echos the request. This method is showcases unary rpcs. + rpc EchoWithMethod(EchoRequest) returns (EchoResponse) { + option (google.api.http) = { + post: "/v1beta1/echo:echo" + body: "*" + }; + option (google.api.method_signature) = "content"; + option (google.api.method_signature) = "error"; + option (google.api.method_signature) = "content,severity"; + option (google.api.method_signature) = "name"; + option (google.api.method_signature) = "parent"; + option (google.api.method_signature) = ""; + } +} + +// This service is to test when no method specified. +service EchoWithoutMethods { + // This service is meant to only run locally on the port 7469 (keypad digits + // for "show"). + option (google.api.default_host) = "localhost:7469"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform"; +} + +// A severity enum used to test enum capabilities in GAPIC surfaces +enum Severity { + UNNECESSARY = 0; + NECESSARY = 1; + URGENT = 2; + CRITICAL = 3; +} + +message Foobar { + option (google.api.resource) = { + type: "showcase.googleapis.com/Foobar" + pattern: "projects/{project}/foobars/{foobar}" + pattern: "projects/{project}/chocolate/variants/{variant}/foobars/{foobar}" + pattern: "foobars/{foobar}" + pattern: "bar_foos/{bar_foo}/foobars/{foobar}" + pattern: "*" + }; + + string name = 1; + string info = 2; +} + +// The request message used for the Echo, Collect and Chat methods. +// If content or opt are set in this message then the request will succeed. +// If status is set in this message +// then the status will be returned as an error. +message EchoRequest { + string name = 5 [ + (google.api.resource_reference).type = "showcase.googleapis.com/Foobar", + (google.api.field_behavior) = REQUIRED + ]; + + string parent = 6 [ + (google.api.resource_reference).child_type = + "showcase.googleapis.com/AnythingGoes", + (google.api.field_behavior) = REQUIRED + ]; + + oneof response { + // The content to be echoed by the server. + string content = 1; + + // The error to be thrown by the server. + google.rpc.Status error = 2; + } + + // The severity to be echoed by the server. + Severity severity = 3; + + Foobar foobar = 4; +} + +// The response message for the Echo methods. +message EchoResponse { + // The content specified in the request. + string content = 1; + + // The severity specified in the request. + Severity severity = 2; +} + diff --git a/gapic-generator-java/src/test/proto/types_testing.proto b/gapic-generator-java/src/test/proto/types_testing.proto new file mode 100644 index 0000000000..40ba28c4ec --- /dev/null +++ b/gapic-generator-java/src/test/proto/types_testing.proto @@ -0,0 +1,32 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT 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"; + +import "google/api/client.proto"; +import "nested_message.proto"; + +package google.types.testing; + +option java_package = "com.google.types.testing"; +option java_multiple_files = true; +option java_outer_classname = "TypesTestingProto"; + +// A service to test handling of deeply-nested types +service NestedMessageService { + option (google.api.default_host) = "localhost:7469"; + // Testing with nested message from a different package to require imports in generated code + rpc NestedMessageMethod(google.testgapic.Outer.Middle) returns (google.testgapic.Outer.Middle.Inner); +} + diff --git a/gapic-generator-java/src/test/proto/wicked.proto b/gapic-generator-java/src/test/proto/wicked.proto new file mode 100644 index 0000000000..ea45fee918 --- /dev/null +++ b/gapic-generator-java/src/test/proto/wicked.proto @@ -0,0 +1,49 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT 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"; + +import "google/api/client.proto"; + +package google.showcase.v1beta1; + +option go_package = "github.com/googleapis/gapic-showcase/server/genproto"; +option java_package = "com.google.showcase.v1beta1"; +option java_multiple_files = true; +option ruby_package = "Google::Showcase::V1beta1"; + +// This service is used to show a Service with either non-enabled or non-eligible +// RPCs for HttpJson (Http 1.1). +// Non-Enabled: Missing the (google.api.http) annotation to enabled it +// Non-Eligible: BIDI and Client side streaming are not supported with Http 1.1 +// Service name is reference to `No REST for the Wicked` +service Wicked { + // This service is meant to only run locally on the port 7469 (keypad digits + // for "show"). + option (google.api.default_host) = "localhost:7469"; + + rpc CraftEvilPlan(EvilRequest) returns (EvilResponse); + + rpc BrainstormEvilPlans(stream EvilRequest) returns (stream EvilResponse); + + rpc PersuadeEvilPlan(stream EvilRequest) returns (EvilResponse); +} + +message EvilRequest { + string malicious_idea = 1; +} + +message EvilResponse { + string malicious_plan = 1; +} \ No newline at end of file diff --git a/gapic-generator-java/src/test/resources/auto_populate_field_testing.yaml b/gapic-generator-java/src/test/resources/auto_populate_field_testing.yaml new file mode 100644 index 0000000000..dfb9c24dbb --- /dev/null +++ b/gapic-generator-java/src/test/resources/auto_populate_field_testing.yaml @@ -0,0 +1,24 @@ +type: google.api.Service +config_version: 3 +name: autopopulatefieldtesting.googleapis.com +title: Autopopulate Field Testing API + +apis: +- name: google.auto.populate.field.AutoPopulateFieldTesting + +documentation: + summary: |- + YAML file for auto_populate_field_testing.proto to test request ID autopopulation feature. + +publishing: + method_settings: + - selector: google.auto.populate.field.AutoPopulateFieldTesting.AutoPopulateFieldTestingEcho + auto_populated_fields: + - request_id + - second_request_id + - third_request_id + - fourth_request_id + - non_existent_field + - selector: google.auto.populate.field.AutoPopulateFieldTesting.AutoPopulateFieldTestingExpand + auto_populated_fields: + - request_id \ No newline at end of file diff --git a/gapic-generator-java/src/test/resources/bigquery_v2_service_config.json b/gapic-generator-java/src/test/resources/bigquery_v2_service_config.json new file mode 100644 index 0000000000..8bc947af4e --- /dev/null +++ b/gapic-generator-java/src/test/resources/bigquery_v2_service_config.json @@ -0,0 +1,10 @@ +{ + "methodConfig": [ + { + "name": [ + {"service": "google.cloud.bigquery.v2.JobService"} + ], + "timeout": "5s" + } + ] +} diff --git a/gapic-generator-java/src/test/resources/echo_v1beta1.yaml b/gapic-generator-java/src/test/resources/echo_v1beta1.yaml new file mode 100644 index 0000000000..321758a4ea --- /dev/null +++ b/gapic-generator-java/src/test/resources/echo_v1beta1.yaml @@ -0,0 +1,97 @@ +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +type: google.api.Service +config_version: 3 +name: showcase.googleapis.com +title: Client Libraries Showcase API + +apis: + - name: google.showcase.v1beta1.Compliance + - name: google.showcase.v1beta1.Echo + - name: google.showcase.v1beta1.Identity + - name: google.showcase.v1beta1.Messaging + - name: google.showcase.v1beta1.SequenceService + - name: google.showcase.v1beta1.Testing + # Mix-in services + - name: 'google.cloud.location.Locations' + - name: 'google.iam.v1.IAMPolicy' + - name: 'google.longrunning.Operations' + +documentation: + summary: |- + Showcase represents both a model API and an integration testing surface for + client library generator consumption. + +backend: + rules: + - selector: 'google.cloud.location.Locations.*' + deadline: 60.0 + - selector: 'google.iam.v1.IAMPolicy.*' + deadline: 60.0 + - selector: 'google.longrunning.Operations.*' + deadline: 60.0 + +http: + rules: + - selector: google.cloud.location.Locations.ListLocations + get: '/v1beta1/{name=projects/*}/locations' + - selector: google.cloud.location.Locations.GetLocation + get: '/v1beta1/{name=projects/*/locations/*}' + - selector: google.iam.v1.IAMPolicy.SetIamPolicy + post: '/v1beta1/{resource=users/*}:setIamPolicy' + body: '*' + additional_bindings: + - post: '/v1beta1/{resource=rooms/*}:setIamPolicy' + body: '*' + - post: '/v1beta1/{resource=rooms/*/blurbs/*}:setIamPolicy' + body: '*' + - post: '/v1beta1/{resource=sequences/*}:setIamPolicy' + body: '*' + - selector: google.iam.v1.IAMPolicy.GetIamPolicy + get: '/v1beta1/{resource=users/*}:getIamPolicy' + additional_bindings: + - get: '/v1beta1/{resource=rooms/*}:getIamPolicy' + - get: '/v1beta1/{resource=rooms/*/blurbs/*}:getIamPolicy' + - get: '/v1beta1/{resource=sequences/*}:getIamPolicy' + - selector: google.iam.v1.IAMPolicy.TestIamPermissions + post: '/v1beta1/{resource=users/*}:testIamPermissions' + body: '*' + additional_bindings: + - post: '/v1beta1/{resource=rooms/*}:testIamPermissions' + body: '*' + - post: '/v1beta1/{resource=rooms/*/blurbs/*}:testIamPermissions' + body: '*' + - post: '/v1beta1/{resource=sequences/*}:testIamPermissions' + body: '*' + - selector: google.longrunning.Operations.ListOperations + get: '/v1beta1/operations' + additional_bindings: + - get: '/v1beta2/operations' + - get: '/v1beta3/operations' + - selector: google.longrunning.Operations.GetOperation + get: '/v1beta1/{name=operations/**}' + additional_bindings: + - get: '/v1beta2/{name=operations/**}' + - get: '/v1beta3/{name=operations/**}' + - selector: google.longrunning.Operations.DeleteOperation + delete: '/v1beta1/{name=operations/**}' + additional_bindings: + - delete: '/v1beta2/{name=operations/**}' + - delete: '/v1beta3/{name=operations/**}' + - selector: google.longrunning.Operations.CancelOperation + post: '/v1beta1/{name=operations/**}:cancel' + additional_bindings: + - post: '/v1beta2/{name=operations/**}:cancel' + - post: '/v1beta3/{name=operations/**}:cancel' \ No newline at end of file diff --git a/gapic-generator-java/src/test/resources/selective_api_generation_generate_omitted_v1beta1.yaml b/gapic-generator-java/src/test/resources/selective_api_generation_generate_omitted_v1beta1.yaml new file mode 100644 index 0000000000..74669ff7b6 --- /dev/null +++ b/gapic-generator-java/src/test/resources/selective_api_generation_generate_omitted_v1beta1.yaml @@ -0,0 +1,27 @@ +type: google.api.Service +config_version: 3 +name: selective_api_generation_testing.googleapis.com +title: Selective Generation Testing API + +publishing: + # ... + library_settings: + - version: google.selective.generate.v1beta1 + java_settings: + common: + selective_gapic_generation: + methods: + - google.selective.generate.v1beta1.EchoServiceShouldGenerateAllAsUsual.EchoShouldGenerateAsUsual + - google.selective.generate.v1beta1.EchoServiceShouldGenerateAllAsUsual.ChatShouldGenerateAsUsual + - google.selective.generate.v1beta1.EchoServiceShouldGenerateAllAsUsual.ChatAgainShouldGenerateAsUsual + - google.selective.generate.v1beta1.EchoServiceShouldGeneratePartialUsual.EchoShouldGenerateAsUsual + - google.selective.generate.v1beta1.EchoServiceShouldGeneratePartialUsual.ChatShouldGenerateAsUsual + - google.selective.generate.v1beta1.EchoServiceShouldGeneratePartialUsual.ChatAgainShouldGenerateAsUsual + generate_omitted_as_internal: true + reference_docs_uri: www.abc.net + destinations: + - PACKAGE_MANAGER + python_settings: + common: + destinations: + - PACKAGE_MANAGER diff --git a/gapic-generator-java/src/test/resources/selective_api_generation_v1beta1.yaml b/gapic-generator-java/src/test/resources/selective_api_generation_v1beta1.yaml new file mode 100644 index 0000000000..cd99776e80 --- /dev/null +++ b/gapic-generator-java/src/test/resources/selective_api_generation_v1beta1.yaml @@ -0,0 +1,24 @@ +type: google.api.Service +config_version: 3 +name: selective_api_generation_testing.googleapis.com +title: Selective Generation Testing API + +publishing: + # ... + library_settings: + - version: google.selective.generate.v1beta1 + java_settings: + common: + selective_gapic_generation: + methods: + - google.selective.generate.v1beta1.EchoServiceShouldGeneratePartialUsual.EchoShouldGenerateAsUsual + - google.selective.generate.v1beta1.EchoServiceShouldGeneratePartialUsual.ChatShouldGenerateAsUsual + - google.selective.generate.v1beta1.EchoServiceShouldGeneratePartialUsual.ChatAgainShouldGenerateAsUsual + generate_omitted_as_internal: false + reference_docs_uri: www.abc.net + destinations: + - PACKAGE_MANAGER + python_settings: + common: + destinations: + - PACKAGE_MANAGER diff --git a/gax-java/.github/CODEOWNERS b/gax-java/.github/CODEOWNERS deleted file mode 100644 index a1d58a77c4..0000000000 --- a/gax-java/.github/CODEOWNERS +++ /dev/null @@ -1,7 +0,0 @@ -# Code owners file. -# This file controls who is tagged for review for any given pull request. -# -# For syntax help see: -# https://help.github.com/en/github/creating-cloning-and-archiving-repositories/about-code-owners#codeowners-syntax - -* @googleapis/actools-java @googleapis/yoshi-java @googleapis/cloud-java-team-teamsync diff --git a/gax-java/.github/release-please.yml b/gax-java/.github/release-please.yml deleted file mode 100644 index 27d7ef3a6a..0000000000 --- a/gax-java/.github/release-please.yml +++ /dev/null @@ -1,12 +0,0 @@ -releaseType: java-yoshi -bumpMinorPreMajor: true -handleGHRelease: true -branches: - - releaseType: java-backport - bumpMinorPreMajor: true - handleGHRelease: true - branch: 2.16.x - - releaseType: java-backport - bumpMinorPreMajor: true - handleGHRelease: true - branch: 2.19.x diff --git a/gax-java/.github/release-trigger.yml b/gax-java/.github/release-trigger.yml deleted file mode 100644 index 7fe3622578..0000000000 --- a/gax-java/.github/release-trigger.yml +++ /dev/null @@ -1 +0,0 @@ -enabled: true \ No newline at end of file diff --git a/gax-java/.github/snippet-bot.yml b/gax-java/.github/snippet-bot.yml deleted file mode 100644 index 1488c14ec0..0000000000 --- a/gax-java/.github/snippet-bot.yml +++ /dev/null @@ -1,2 +0,0 @@ -aggregateChecks: false -alwaysCreateStatusCheck: false diff --git a/gax-java/.github/sync-repo-settings.yaml b/gax-java/.github/sync-repo-settings.yaml deleted file mode 100644 index 4ff4f40b14..0000000000 --- a/gax-java/.github/sync-repo-settings.yaml +++ /dev/null @@ -1,45 +0,0 @@ -rebaseMergeAllowed: false -squashMergeAllowed: true -mergeCommitAllowed: false -branchProtectionRules: - - pattern: main - isAdminEnforced: true - requiredApprovingReviewCount: 1 - requiresCodeOwnerReviews: true - requiresStrictStatusChecks: false - requiredStatusCheckContexts: - - bazel - - units (8) - - units (11) - - cla/google - - pattern: 2.16.x - isAdminEnforced: true - requiredApprovingReviewCount: 1 - requiresCodeOwnerReviews: true - requiresStrictStatusChecks: true - requiredStatusCheckContexts: - - bazel - - units (8) - - units (11) - - cla/google - - pattern: 2.19.x - isAdminEnforced: true - requiredApprovingReviewCount: 1 - requiresCodeOwnerReviews: true - requiresStrictStatusChecks: false - requiredStatusCheckContexts: - - bazel - - units (8) - - units (11) - - cla/google -permissionRules: - - team: yoshi-admins - permission: admin - - team: yoshi-java-admins - permission: admin - - team: yoshi-java - permission: push - - team: actools - permission: admin - - team: actools-java - permission: push diff --git a/gax-java/.github/workflows/ci.yaml b/gax-java/.github/workflows/ci.yaml deleted file mode 100644 index b05c1da3d2..0000000000 --- a/gax-java/.github/workflows/ci.yaml +++ /dev/null @@ -1,113 +0,0 @@ -on: - push: - branches: - - main - pull_request: -name: ci -jobs: - clirr: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - uses: actions/setup-java@v3 - with: - distribution: temurin - java-version: 8 - - run: echo "JAVA8_HOME=${JAVA_HOME}" >> $GITHUB_ENV - - uses: actions/setup-java@v3 - with: - distribution: temurin - java-version: 11 - - run: echo "JAVA11_HOME=${JAVA_HOME}" >> $GITHUB_ENV - - run: .kokoro/build.sh - env: - JOB_TYPE: clirr - units-java11: - name: "units (11)" - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - uses: actions/setup-java@v3 - with: - java-version: 11 - distribution: zulu - - run: java -version - - run: .kokoro/build.sh - env: - JOB_TYPE: test - units-java8: - name: "units (8)" - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - # Java 8 tests uses JDK 11 to compile and JDK 8 to run tests. See .kokoro/ - # build.sh for the setup. - - uses: actions/setup-java@v3 - with: - java-version: 8 - distribution: zulu - - run: echo "JAVA8_HOME=${JAVA_HOME}" >> $GITHUB_ENV - - uses: actions/setup-java@v3 - with: - java-version: 11 - distribution: zulu - - run: echo "JAVA11_HOME=${JAVA_HOME}" >> $GITHUB_ENV - - run: printenv - - run: .kokoro/build.sh - env: - JOB_TYPE: test - bazel: - runs-on: ubuntu-latest - # Not using a container. The ubuntu-latest has Bazel 4.2 installed as of - # November 2021. gRPC 1.42 requires Bazel 4. - # https://github.com/grpc/grpc-java/pull/7598 - steps: - - uses: actions/checkout@v2 - - uses: actions/setup-java@v1 - with: - java-version: 8 - - run: java -version - - - name: Bazel File Cache Setup - id: cache-bazel - uses: actions/cache@v3 - with: - path: ~/.cache/bazel - key: ${{ runner.os }}-bazel-20210105-${{ secrets.CACHE_VERSION }} - - - name: Bazel Cache Not Found - if: steps.cache-bazel.outputs.cache-hit != 'true' - run: | - echo "No cache found." - - name: Bazel Cache Found - if: steps.cache-bazel.outputs.cache-hit == 'true' - run: | - echo -n "Cache found. Cache size: " - du -sh ~/.cache/bazel - echo "If the cache seems broken, update the CACHE_VERSION secret in" - echo "https://github.com/googleapis/googleapis-discovery/settings/secrets/actions" - echo "(use any random string, any GUID will work)" - echo "and it will start over with a clean cache." - echo "The old one will disappear after 7 days." - - - name: Run bazel tests - run: | - which bazel - bazel --version - bazel --batch test //... --noshow_progress --test_output=errors - - - uses: actions/upload-artifact@v3 - if: ${{ failure() }} - with: - name: test-artifacts - path: ~/.cache/bazel/*/*/*/gax-java/bazel-out/*/testlogs/* - retention-days: 5 - requirements: - name: "requirements" - runs-on: ubuntu-latest - container: gcr.io/cloud-devrel-public-resources/java8 - steps: - - uses: actions/checkout@v2 - - run: | - python3 --version - python3 -m pip install --require-hashes -r .kokoro/requirements.txt diff --git a/gax-java/.github/workflows/downstream-native-image.yaml b/gax-java/.github/workflows/downstream-native-image.yaml deleted file mode 100644 index 5e0b4431ca..0000000000 --- a/gax-java/.github/workflows/downstream-native-image.yaml +++ /dev/null @@ -1,41 +0,0 @@ -on: - push: - branches: - - main - pull_request: - -# Keeping this file separate as the dependencies check would use more -# repositories than needed this downstream check for GraalVM native image -# compilation. -name: downstream -jobs: - # GraalVM job ensures the compatibility of GraaVM version - graalvm: - runs-on: ubuntu-latest - strategy: - fail-fast: false - matrix: - graalvm: [22.3.0] - java: [11, 17] - repo: - # GAPIC library that doesn't use a real GCP project in integration tests - - orgpolicy - steps: - - uses: actions/checkout@v2 - - uses: stCarolas/setup-maven@v4 - with: - maven-version: 3.8.1 - - uses: ayltai/setup-graalvm@v1 - with: - java-version: ${{matrix.java}} - # When a new version of native-maven-plugin fails to run in a downstream - # library, it's likely to be an incompatibility with the GraalVM version. - # In that case, you need to upgrade the Docker container used in the - # tests in the downstream repositories (not just this value below). - # Example: https://github.com/googleapis/testing-infra-docker/pull/195 - graalvm-version: ${{matrix.graalvm}} - native-image: true - - run: java -version - - run: sudo apt-get update -y - - run: sudo apt-get install libxml2-utils - - run: .kokoro/downstream-client-library-check.sh ${{matrix.repo}} graalvm diff --git a/gax-java/.github/workflows/downstream.yaml b/gax-java/.github/workflows/downstream.yaml deleted file mode 100644 index 45e45fa25e..0000000000 --- a/gax-java/.github/workflows/downstream.yaml +++ /dev/null @@ -1,144 +0,0 @@ -on: - pull_request: - types: [ labeled ] - branches: - - main -name: downstream -jobs: - dependencies: - if: ${{ github.event.label.name == 'downstream-check:run' }} - runs-on: ubuntu-latest - strategy: - fail-fast: false - matrix: - java: [11] - repo: - # This list needs to be updated manually until an automated solution is in place. - - accessapproval - - accesscontextmanager - - aiplatform - - analytics-admin - - analytics-data - - api-gateway - - apigee-connect - - appengine-admin - - area120-tables - - artifact-registry - - asset - - assured-workloads - - automl - - bigquery - - bigqueryconnection - - bigquerydatatransfer - - bigquerymigration - - bigqueryreservation - - bigtable - - billing - - billingbudgets - - binary-authorization - - channel - - cloudbuild - - compute - - contact-center-insights - - container - - containeranalysis - - data-fusion - - datacatalog - - dataflow - - datalabeling - - dataproc - - dataproc-metastore - - datastore - - datastream - - debugger-client - - deploy - - dialogflow - - dialogflow-cx - - dlp - - dms - - dns - - document-ai - - domains - - errorreporting - - essential-contacts - - eventarc - - filestore - - firestore - - functions - - game-servers - - gke-connect-gateway - - gkehub - - gsuite-addons - - iam-admin - - iamcredentials - - iot - - kms - - language - - life-sciences - - logging - - logging-logback - - managed-identities - - mediatranslation - - memcache - - monitoring - - monitoring-dashboards - - network-management - - network-security - - networkconnectivity - - notebooks - - orchestration-airflow - - orgpolicy - - os-config - - os-login - - phishingprotection - - policy-troubleshooter - - private-catalog - - profiler - - pubsublite - - recaptchaenterprise - - recommendations-ai - - recommender - - redis - - resource-settings - - resourcemanager - - retail - - scheduler - - secretmanager - - security-private-ca - - securitycenter - - securitycenter-settings - - service-control - - service-management - - service-usage - - servicedirectory - - shell - - spanner - - spanner-jdbc - - speech - - storage - - storage-nio - - storage-transfer - - talent - - tasks - - texttospeech - - tpu - - trace - - translate - - video-intelligence - - video-transcoder - - vision - - vpcaccess - - webrisk - - websecurityscanner - - workflow-executions - - workflows - steps: - - uses: actions/checkout@v2 - - uses: actions/setup-java@v3 - with: - distribution: zulu - java-version: ${{matrix.java}} - - run: java -version - - run: sudo apt-get update -y - - run: sudo apt-get install libxml2-utils - - run: .kokoro/downstream-client-library-check.sh ${{matrix.repo}} test diff --git a/gax-java/.github/workflows/sonar.yaml b/gax-java/.github/workflows/sonar.yaml deleted file mode 100644 index 1eb2608b83..0000000000 --- a/gax-java/.github/workflows/sonar.yaml +++ /dev/null @@ -1,38 +0,0 @@ -name: Sonar -on: - push: - branches: - - main - pull_request: - types: [opened, synchronize, reopened] -jobs: - sonar-maven: - name: Java 11 Maven Build - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - with: - fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis - - name: Set up JDK 11 - uses: actions/setup-java@v3 - with: - distribution: temurin - java-version: 11 - - name: Cache SonarCloud packages - uses: actions/cache@v3 - with: - path: ~/.sonar/cache - key: ${{ runner.os }}-sonar - restore-keys: ${{ runner.os }}-sonar - - name: Cache Maven packages - uses: actions/cache@v3 - with: - path: ~/.m2/repository - key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }} - restore-keys: ${{ runner.os }}-m2 - - name: Build and analyze - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any - SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} - run: mvn -B verify sonar:sonar -Dsonar.projectKey=googleapis_gax-java -Dsonar.organization=googleapis -Dsonar.host.url=https://sonarcloud.io - diff --git a/gax-java/.gitignore b/gax-java/.gitignore index e6010998cb..05e9d91921 100644 --- a/gax-java/.gitignore +++ b/gax-java/.gitignore @@ -15,6 +15,7 @@ target # IntelliJ .idea +.ijwb *.iml out diff --git a/gax-java/.kokoro/build.sh b/gax-java/.kokoro/build.sh deleted file mode 100755 index a9e909f0d8..0000000000 --- a/gax-java/.kokoro/build.sh +++ /dev/null @@ -1,60 +0,0 @@ -#!/bin/bash -# Copyright 2018 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -set -eo pipefail - -scriptDir=$(realpath $(dirname "${BASH_SOURCE[0]}")) -# cd to the parent directory, i.e. the root of the git repo -cd ${scriptDir}/.. - -echo $JOB_TYPE - -function setJava() { - export JAVA_HOME=$1 - export PATH=${JAVA_HOME}/bin:$PATH -} - -# This project requires compiling the classes in JDK 11 or higher for GraalVM -# classes. Compiling this project with Java 8 or earlier would fail with "class -# file has wrong version 55.0, should be 53.0" and "unrecognized --release 8 -# option" (set in build.gradle). -if [ ! -z "${JAVA11_HOME}" ]; then - setJava "${JAVA11_HOME}" -fi - -mvn -V -B -ntp clean install -DskipTests - -# We ensure the generated class files are compatible with Java 8 -if [ ! -z "${JAVA8_HOME}" ]; then - setJava "${JAVA8_HOME}" -fi - -RETURN_CODE=0 - -case "${JOB_TYPE}" in -test) - # run tests in Java 8 with the source compiled in Java 11 - mvn -V -B -ntp surefire:test - RETURN_CODE=$? - ;; -clirr) - mvn -B -ntp clirr:check - RETURN_CODE=$? - ;; -*) ;; -esac - -echo "exiting with ${RETURN_CODE}" -exit ${RETURN_CODE} \ No newline at end of file diff --git a/gax-java/.kokoro/common.cfg b/gax-java/.kokoro/common.cfg deleted file mode 100644 index e97bed17fc..0000000000 --- a/gax-java/.kokoro/common.cfg +++ /dev/null @@ -1,13 +0,0 @@ -# Format: //devtools/kokoro/config/proto/build.proto - -# Download trampoline resources. These will be in ${KOKORO_GFILE_DIR} -gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/trampoline" - -# All builds use the trampoline script to run in docker. -build_file: "gax-java/.kokoro/trampoline.sh" - -# Tell the trampoline which build file to use. -env_vars: { - key: "TRAMPOLINE_BUILD_FILE" - value: "github/gax-java/.kokoro/build.sh" -} diff --git a/gax-java/.kokoro/downstream-client-library-check.sh b/gax-java/.kokoro/downstream-client-library-check.sh deleted file mode 100755 index 612fd793b4..0000000000 --- a/gax-java/.kokoro/downstream-client-library-check.sh +++ /dev/null @@ -1,99 +0,0 @@ -#!/bin/bash -# 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. - -set -eo pipefail -# Display commands being run. -set -x - -CLIENT_LIBRARY=$1 - -# Example JOB_TYPE: "test" or "graalvm" -export JOB_TYPE=$2 -## 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}"/.. - -# Round 1 -# Publish gax to local maven to make it available for downstream libraries -./gradlew publishToMavenLocal - -# Read current gax version -GAX_VERSION=$( ./gradlew -q :gax:properties | grep '^version: ' | cut -d' ' -f2 ) - -# Round 2 -# Run this gax-java against HEAD of java-shared dependencies - -git clone "https://github.com/googleapis/java-shared-dependencies.git" --depth=1 -pushd java-shared-dependencies/first-party-dependencies - -# replace version -xmllint --shell pom.xml << EOF -setns x=http://maven.apache.org/POM/4.0.0 -cd .//x:artifactId[text()="gax-bom"] -cd ../x:version -set ${GAX_VERSION} -cd ../.. -cd .//x:artifactId[text()="gax-grpc"] -cd ../x:version -set ${GAX_VERSION} -save pom.xml -EOF - -cd .. -mvn verify install -B -V -ntp -fae \ --DskipTests=true \ --Dmaven.javadoc.skip=true \ --Dgcloud.download.skip=true \ --Denforcer.skip=true - -# Namespace (xmlns) prevents xmllint from specifying tag names in XPath -SHARED_DEPS_VERSION=$( sed -e 's/xmlns=".*"//' pom.xml | xmllint --xpath '/project/version/text()' - ) - -if [ -z "${SHARED_DEPS_VERSION}" ]; then - echo "Version is not found in pom.xml" - exit 1 -fi - -# Round 3 -# Run this shared-dependencies BOM against java client libraries -git clone "https://github.com/googleapis/java-${CLIENT_LIBRARY}.git" --depth=1 -pushd java-"${CLIENT_LIBRARY}" - -if [[ $CLIENT_LIBRARY == "bigtable" ]]; then - pushd google-cloud-bigtable-deps-bom -fi - -# replace version -xmllint --shell pom.xml << EOF -setns x=http://maven.apache.org/POM/4.0.0 -cd .//x:artifactId[text()="google-cloud-shared-dependencies"] -cd ../x:version -set ${SHARED_DEPS_VERSION} -save pom.xml -EOF - -if [[ $CLIENT_LIBRARY == "bigtable" ]]; then - popd -fi - -echo "Modification on the shared dependencies BOM:" -git diff -echo - -export INTEGRATION_TEST_ARGS="-Denforcer.skip=true" - -# This reads the JOB_TYPE environmental variable ("test" or "graalvm") -.kokoro/build.sh diff --git a/gax-java/.kokoro/populate-secrets.sh b/gax-java/.kokoro/populate-secrets.sh deleted file mode 100755 index f52514257e..0000000000 --- a/gax-java/.kokoro/populate-secrets.sh +++ /dev/null @@ -1,43 +0,0 @@ -#!/bin/bash -# Copyright 2020 Google LLC. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -set -eo pipefail - -function now { date +"%Y-%m-%d %H:%M:%S" | tr -d '\n' ;} -function msg { println "$*" >&2 ;} -function println { printf '%s\n' "$(now) $*" ;} - - -# Populates requested secrets set in SECRET_MANAGER_KEYS from service account: -# kokoro-trampoline@cloud-devrel-kokoro-resources.iam.gserviceaccount.com -SECRET_LOCATION="${KOKORO_GFILE_DIR}/secret_manager" -msg "Creating folder on disk for secrets: ${SECRET_LOCATION}" -mkdir -p ${SECRET_LOCATION} -for key in $(echo ${SECRET_MANAGER_KEYS} | sed "s/,/ /g") -do - msg "Retrieving secret ${key}" - docker run --entrypoint=gcloud \ - --volume=${KOKORO_GFILE_DIR}:${KOKORO_GFILE_DIR} \ - gcr.io/google.com/cloudsdktool/cloud-sdk \ - secrets versions access latest \ - --project cloud-devrel-kokoro-resources \ - --secret ${key} > \ - "${SECRET_LOCATION}/${key}" - if [[ $? == 0 ]]; then - msg "Secret written to ${SECRET_LOCATION}/${key}" - else - msg "Error retrieving secret ${key}" - fi -done diff --git a/gax-java/.kokoro/release/common.cfg b/gax-java/.kokoro/release/common.cfg deleted file mode 100644 index e86574d518..0000000000 --- a/gax-java/.kokoro/release/common.cfg +++ /dev/null @@ -1,50 +0,0 @@ -# Format: //devtools/kokoro/config/proto/build.proto - -# Download trampoline resources. -gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/trampoline" - -# Use the trampoline script to run in docker. -build_file: "gax-java/.kokoro/trampoline.sh" - -# Configure the docker image for kokoro-trampoline. -env_vars: { - key: "TRAMPOLINE_IMAGE" - # We use JDK 11 to produce Java 8-compatible artifacts - value: "gcr.io/cloud-devrel-kokoro-resources/java11" -} - -before_action { - fetch_keystore { - keystore_resource { - keystore_config_id: 70247 - keyname: "maven-gpg-keyring" - } - } -} - -before_action { - fetch_keystore { - keystore_resource { - keystore_config_id: 70247 - keyname: "maven-gpg-passphrase" - } - } -} - -before_action { - fetch_keystore { - keystore_resource { - keystore_config_id: 70247 - keyname: "maven-gpg-pubkeyring" - } - } -} - -before_action { - fetch_keystore { - keystore_resource { - keystore_config_id: 70247 - keyname: "sonatype-credentials" - } - } -} diff --git a/gax-java/.kokoro/release/common.sh b/gax-java/.kokoro/release/common.sh deleted file mode 100755 index 693bae8bfb..0000000000 --- a/gax-java/.kokoro/release/common.sh +++ /dev/null @@ -1,52 +0,0 @@ -#!/bin/bash -# Copyright 2019 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -set -eo pipefail - -# Get secrets from keystore and set and environment variables -setup_environment_secrets() { - export GPG_PASSPHRASE=$(cat ${KOKORO_KEYSTORE_DIR}/70247_maven-gpg-passphrase) - export GPG_TTY=$(tty) - export GPG_HOMEDIR=/gpg - mkdir $GPG_HOMEDIR - mv ${KOKORO_KEYSTORE_DIR}/70247_maven-gpg-pubkeyring $GPG_HOMEDIR/pubring.gpg - mv ${KOKORO_KEYSTORE_DIR}/70247_maven-gpg-keyring $GPG_HOMEDIR/secring.gpg - export GPG_KEY_ID=$(echo -n $(gpg --with-colons ${GPG_HOMEDIR}/pubring.gpg | awk -F':' '/pub/{ print $5 }')) - export SONATYPE_USERNAME=$(cat ${KOKORO_KEYSTORE_DIR}/70247_sonatype-credentials | cut -f1 -d'|') - export SONATYPE_PASSWORD=$(cat ${KOKORO_KEYSTORE_DIR}/70247_sonatype-credentials | cut -f2 -d'|') -} - -create_settings_xml_file() { - echo " - - - - ossrh - ${SONATYPE_USERNAME} - ${SONATYPE_PASSWORD} - - - sonatype-nexus-staging - ${SONATYPE_USERNAME} - ${SONATYPE_PASSWORD} - - - sonatype-nexus-snapshots - ${SONATYPE_USERNAME} - ${SONATYPE_PASSWORD} - - -" > $1 -} \ No newline at end of file diff --git a/gax-java/.kokoro/release/publish_javadoc11.cfg b/gax-java/.kokoro/release/publish_javadoc11.cfg deleted file mode 100644 index 4bfabf6d00..0000000000 --- a/gax-java/.kokoro/release/publish_javadoc11.cfg +++ /dev/null @@ -1,29 +0,0 @@ -# Format: //devtools/kokoro/config/proto/build.proto - -env_vars: { - key: "STAGING_BUCKET_V2" - value: "docs-staging-v2" -} - -# Configure the docker image for kokoro-trampoline -env_vars: { - key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-kokoro-resources/java11" -} - -env_vars: { - key: "TRAMPOLINE_BUILD_FILE" - value: "github/gax-java/.kokoro/release/publish_javadoc11.sh" -} - -before_action { - fetch_keystore { - keystore_resource { - keystore_config_id: 73713 - keyname: "docuploader_service_account" - } - } -} - -# Downloads docfx doclet resource. This will be in ${KOKORO_GFILE_DIR}/ -gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/docfx" diff --git a/gax-java/.kokoro/release/publish_javadoc11.sh b/gax-java/.kokoro/release/publish_javadoc11.sh deleted file mode 100755 index 2a6fb82911..0000000000 --- a/gax-java/.kokoro/release/publish_javadoc11.sh +++ /dev/null @@ -1,76 +0,0 @@ -#!/bin/bash -# Copyright 2019 Google LLC -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -set -eo pipefail - -if [[ -z "${CREDENTIALS}" ]]; then - CREDENTIALS=${KOKORO_KEYSTORE_DIR}/73713_docuploader_service_account -fi - -if [[ -z "${STAGING_BUCKET_V2}" ]]; then - echo "Need to set STAGING_BUCKET environment variable" - exit 1 -fi - -# work from the git root directory -pushd $(dirname "$0")/../../ - -# install docuploader package -python3 -m pip install --require-hashes -r .kokoro/requirements.txt - -NAME=gax -VERSION=$(grep ${NAME}: versions.txt | cut -d: -f3) - -mvn -B -ntp \ - -DtrimStackTrace=false \ - -Dclirr.skip=true \ - -Denforcer.skip=true \ - -Dcheckstyle.skip=true \ - -Dflatten.skip=true \ - -Danimal.sniffer.skip=true \ - -DskipTests=true \ - -Djacoco.skip=true \ - install - -# build the docs -mvn -B -ntp \ - -P docFX \ - -Dclirr.skip=true \ - -Denforcer.skip=true \ - -Dcheckstyle.skip=true \ - -Dflatten.skip=true \ - -Danimal.sniffer.skip=true \ - javadoc:aggregate - -# copy README to docfx-yml dir and rename index.md -cp README.md target/docfx-yml/index.md - -# copy CHANGELOG to docfx-yml dir and rename history.md -cp CHANGELOG.md target/docfx-yml/history.md - -pushd target/docfx-yml/ - -# create metadata -python3 -m docuploader create-metadata \ - --name ${NAME} \ - --version ${VERSION} \ - --language java - -# upload docs -python3 -m docuploader upload . \ - --credentials ${CREDENTIALS} \ - --staging-bucket ${STAGING_BUCKET_V2} \ - --destination-prefix docfx - -popd \ No newline at end of file diff --git a/gax-java/.kokoro/release/stage.cfg b/gax-java/.kokoro/release/stage.cfg deleted file mode 100644 index b08c759087..0000000000 --- a/gax-java/.kokoro/release/stage.cfg +++ /dev/null @@ -1,17 +0,0 @@ -# Format: //devtools/kokoro/config/proto/build.proto -env_vars: { - key: "TRAMPOLINE_BUILD_FILE" - value: "github/gax-java/.kokoro/release/stage.sh" -} - -action { - define_artifacts { - regex: "github/gax-java/target/nexus-staging/staging/*.properties" - strip_prefix: "github/gax-java" - } -} - -env_vars: { - key: "SECRET_MANAGER_KEYS" - value: "releasetool-publish-reporter-app,releasetool-publish-reporter-googleapis-installation,releasetool-publish-reporter-pem" -} diff --git a/gax-java/.kokoro/release/stage.sh b/gax-java/.kokoro/release/stage.sh deleted file mode 100755 index 5ff691d31a..0000000000 --- a/gax-java/.kokoro/release/stage.sh +++ /dev/null @@ -1,52 +0,0 @@ -#!/bin/bash -# Copyright 2019 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -set -eo pipefail - -if [[ -n "${AUTORELEASE_PR}" ]] -then - # Start the releasetool reporter - requirementsFile=$(realpath $(dirname "${BASH_SOURCE[0]}")/../requirements.txt) - python3 -m pip install --require-hashes -r $requirementsFile - python3 -m releasetool publish-reporter-script > /tmp/publisher-script; source /tmp/publisher-script -fi - -source $(dirname "$0")/common.sh -MAVEN_SETTINGS_FILE=$(realpath $(dirname "$0")/../../)/settings.xml -pushd $(dirname "$0")/../../ - -setup_environment_secrets -create_settings_xml_file "settings.xml" - -mvn clean deploy -B \ - -DskipTests=true \ - -Dclirr.skip=true \ - --settings ${MAVEN_SETTINGS_FILE} \ - -Dgpg.executable=gpg \ - -Dgpg.passphrase=${GPG_PASSPHRASE} \ - -Dgpg.homedir=${GPG_HOMEDIR} \ - -P release - -# The job triggered by Release Please (release-trigger) has this AUTORELEASE_PR -# environment variable. Fusion also lets us to specify this variable. -if [[ -n "${AUTORELEASE_PR}" ]] -then - mvn nexus-staging:release -B \ - -P release-staging-repository \ - -DperformRelease=true \ - --settings=${MAVEN_SETTINGS_FILE} -else - echo "AUTORELEASE_PR is not set. Not releasing." -fi diff --git a/gax-java/.kokoro/requirements.in b/gax-java/.kokoro/requirements.in deleted file mode 100644 index 924f94ae6f..0000000000 --- a/gax-java/.kokoro/requirements.in +++ /dev/null @@ -1,34 +0,0 @@ -gcp-docuploader==0.6.3 -google-crc32c==1.3.0 -googleapis-common-protos==1.56.3 -gcp-releasetool==1.9.1 -cryptography==38.0.3 -cachetools==4.2.4 -cffi==1.15.1 -jeepney==0.7.1 -jinja2==3.0.3 -markupsafe==2.0.1 -keyring==23.4.1 -packaging==21.3 -protobuf==3.19.5 -pyjwt==2.4.0 -pyparsing==3.0.9 -pycparser==2.21 -pyperclip==1.8.2 -python-dateutil==2.8.2 -requests==2.27.1 -certifi==2022.9.24 -importlib-metadata==4.8.3 -zipp==3.6.0 -google_api_core==2.8.2 -google-cloud-storage==2.0.0 -google-resumable-media==2.3.3 -google-cloud-core==2.3.1 -typing-extensions==4.1.1 -urllib3==1.26.12 -zipp==3.6.0 -rsa==4.9 -six==1.16.0 -attrs==22.1.0 -google-auth==2.14.1 -idna==3.4 \ No newline at end of file diff --git a/gax-java/.kokoro/requirements.txt b/gax-java/.kokoro/requirements.txt deleted file mode 100644 index 75b9817b94..0000000000 --- a/gax-java/.kokoro/requirements.txt +++ /dev/null @@ -1,455 +0,0 @@ -# -# This file is autogenerated by pip-compile with python 3.10 -# To update, run: -# -# pip-compile --generate-hashes requirements.in -# -attrs==22.1.0 \ - --hash=sha256:29adc2665447e5191d0e7c568fde78b21f9672d344281d0c6e1ab085429b22b6 \ - --hash=sha256:86efa402f67bf2df34f51a335487cf46b1ec130d02b8d39fd248abfd30da551c - # via - # -r requirements.in - # gcp-releasetool -cachetools==4.2.4 \ - --hash=sha256:89ea6f1b638d5a73a4f9226be57ac5e4f399d22770b92355f92dcb0f7f001693 \ - --hash=sha256:92971d3cb7d2a97efff7c7bb1657f21a8f5fb309a37530537c71b1774189f2d1 - # via - # -r requirements.in - # google-auth -certifi==2022.9.24 \ - --hash=sha256:0d9c601124e5a6ba9712dbc60d9c53c21e34f5f641fe83002317394311bdce14 \ - --hash=sha256:90c1a32f1d68f940488354e36370f6cca89f0f106db09518524c88d6ed83f382 - # via - # -r requirements.in - # requests -cffi==1.15.1 \ - --hash=sha256:00a9ed42e88df81ffae7a8ab6d9356b371399b91dbdf0c3cb1e84c03a13aceb5 \ - --hash=sha256:03425bdae262c76aad70202debd780501fabeaca237cdfddc008987c0e0f59ef \ - --hash=sha256:04ed324bda3cda42b9b695d51bb7d54b680b9719cfab04227cdd1e04e5de3104 \ - --hash=sha256:0e2642fe3142e4cc4af0799748233ad6da94c62a8bec3a6648bf8ee68b1c7426 \ - --hash=sha256:173379135477dc8cac4bc58f45db08ab45d228b3363adb7af79436135d028405 \ - --hash=sha256:198caafb44239b60e252492445da556afafc7d1e3ab7a1fb3f0584ef6d742375 \ - --hash=sha256:1e74c6b51a9ed6589199c787bf5f9875612ca4a8a0785fb2d4a84429badaf22a \ - --hash=sha256:2012c72d854c2d03e45d06ae57f40d78e5770d252f195b93f581acf3ba44496e \ - --hash=sha256:21157295583fe8943475029ed5abdcf71eb3911894724e360acff1d61c1d54bc \ - --hash=sha256:2470043b93ff09bf8fb1d46d1cb756ce6132c54826661a32d4e4d132e1977adf \ - --hash=sha256:285d29981935eb726a4399badae8f0ffdff4f5050eaa6d0cfc3f64b857b77185 \ - --hash=sha256:30d78fbc8ebf9c92c9b7823ee18eb92f2e6ef79b45ac84db507f52fbe3ec4497 \ - --hash=sha256:320dab6e7cb2eacdf0e658569d2575c4dad258c0fcc794f46215e1e39f90f2c3 \ - --hash=sha256:33ab79603146aace82c2427da5ca6e58f2b3f2fb5da893ceac0c42218a40be35 \ - --hash=sha256:3548db281cd7d2561c9ad9984681c95f7b0e38881201e157833a2342c30d5e8c \ - --hash=sha256:3799aecf2e17cf585d977b780ce79ff0dc9b78d799fc694221ce814c2c19db83 \ - --hash=sha256:39d39875251ca8f612b6f33e6b1195af86d1b3e60086068be9cc053aa4376e21 \ - --hash=sha256:3b926aa83d1edb5aa5b427b4053dc420ec295a08e40911296b9eb1b6170f6cca \ - --hash=sha256:3bcde07039e586f91b45c88f8583ea7cf7a0770df3a1649627bf598332cb6984 \ - --hash=sha256:3d08afd128ddaa624a48cf2b859afef385b720bb4b43df214f85616922e6a5ac \ - --hash=sha256:3eb6971dcff08619f8d91607cfc726518b6fa2a9eba42856be181c6d0d9515fd \ - --hash=sha256:40f4774f5a9d4f5e344f31a32b5096977b5d48560c5592e2f3d2c4374bd543ee \ - --hash=sha256:4289fc34b2f5316fbb762d75362931e351941fa95fa18789191b33fc4cf9504a \ - --hash=sha256:470c103ae716238bbe698d67ad020e1db9d9dba34fa5a899b5e21577e6d52ed2 \ - --hash=sha256:4f2c9f67e9821cad2e5f480bc8d83b8742896f1242dba247911072d4fa94c192 \ - --hash=sha256:50a74364d85fd319352182ef59c5c790484a336f6db772c1a9231f1c3ed0cbd7 \ - --hash=sha256:54a2db7b78338edd780e7ef7f9f6c442500fb0d41a5a4ea24fff1c929d5af585 \ - --hash=sha256:5635bd9cb9731e6d4a1132a498dd34f764034a8ce60cef4f5319c0541159392f \ - --hash=sha256:59c0b02d0a6c384d453fece7566d1c7e6b7bae4fc5874ef2ef46d56776d61c9e \ - --hash=sha256:5d598b938678ebf3c67377cdd45e09d431369c3b1a5b331058c338e201f12b27 \ - --hash=sha256:5df2768244d19ab7f60546d0c7c63ce1581f7af8b5de3eb3004b9b6fc8a9f84b \ - --hash=sha256:5ef34d190326c3b1f822a5b7a45f6c4535e2f47ed06fec77d3d799c450b2651e \ - --hash=sha256:6975a3fac6bc83c4a65c9f9fcab9e47019a11d3d2cf7f3c0d03431bf145a941e \ - --hash=sha256:6c9a799e985904922a4d207a94eae35c78ebae90e128f0c4e521ce339396be9d \ - --hash=sha256:70df4e3b545a17496c9b3f41f5115e69a4f2e77e94e1d2a8e1070bc0c38c8a3c \ - --hash=sha256:7473e861101c9e72452f9bf8acb984947aa1661a7704553a9f6e4baa5ba64415 \ - --hash=sha256:8102eaf27e1e448db915d08afa8b41d6c7ca7a04b7d73af6514df10a3e74bd82 \ - --hash=sha256:87c450779d0914f2861b8526e035c5e6da0a3199d8f1add1a665e1cbc6fc6d02 \ - --hash=sha256:8b7ee99e510d7b66cdb6c593f21c043c248537a32e0bedf02e01e9553a172314 \ - --hash=sha256:91fc98adde3d7881af9b59ed0294046f3806221863722ba7d8d120c575314325 \ - --hash=sha256:94411f22c3985acaec6f83c6df553f2dbe17b698cc7f8ae751ff2237d96b9e3c \ - --hash=sha256:98d85c6a2bef81588d9227dde12db8a7f47f639f4a17c9ae08e773aa9c697bf3 \ - --hash=sha256:9ad5db27f9cabae298d151c85cf2bad1d359a1b9c686a275df03385758e2f914 \ - --hash=sha256:a0b71b1b8fbf2b96e41c4d990244165e2c9be83d54962a9a1d118fd8657d2045 \ - --hash=sha256:a0f100c8912c114ff53e1202d0078b425bee3649ae34d7b070e9697f93c5d52d \ - --hash=sha256:a591fe9e525846e4d154205572a029f653ada1a78b93697f3b5a8f1f2bc055b9 \ - --hash=sha256:a5c84c68147988265e60416b57fc83425a78058853509c1b0629c180094904a5 \ - --hash=sha256:a66d3508133af6e8548451b25058d5812812ec3798c886bf38ed24a98216fab2 \ - --hash=sha256:a8c4917bd7ad33e8eb21e9a5bbba979b49d9a97acb3a803092cbc1133e20343c \ - --hash=sha256:b3bbeb01c2b273cca1e1e0c5df57f12dce9a4dd331b4fa1635b8bec26350bde3 \ - --hash=sha256:cba9d6b9a7d64d4bd46167096fc9d2f835e25d7e4c121fb2ddfc6528fb0413b2 \ - --hash=sha256:cc4d65aeeaa04136a12677d3dd0b1c0c94dc43abac5860ab33cceb42b801c1e8 \ - --hash=sha256:ce4bcc037df4fc5e3d184794f27bdaab018943698f4ca31630bc7f84a7b69c6d \ - --hash=sha256:cec7d9412a9102bdc577382c3929b337320c4c4c4849f2c5cdd14d7368c5562d \ - --hash=sha256:d400bfb9a37b1351253cb402671cea7e89bdecc294e8016a707f6d1d8ac934f9 \ - --hash=sha256:d61f4695e6c866a23a21acab0509af1cdfd2c013cf256bbf5b6b5e2695827162 \ - --hash=sha256:db0fbb9c62743ce59a9ff687eb5f4afbe77e5e8403d6697f7446e5f609976f76 \ - --hash=sha256:dd86c085fae2efd48ac91dd7ccffcfc0571387fe1193d33b6394db7ef31fe2a4 \ - --hash=sha256:e00b098126fd45523dd056d2efba6c5a63b71ffe9f2bbe1a4fe1716e1d0c331e \ - --hash=sha256:e229a521186c75c8ad9490854fd8bbdd9a0c9aa3a524326b55be83b54d4e0ad9 \ - --hash=sha256:e263d77ee3dd201c3a142934a086a4450861778baaeeb45db4591ef65550b0a6 \ - --hash=sha256:ed9cb427ba5504c1dc15ede7d516b84757c3e3d7868ccc85121d9310d27eed0b \ - --hash=sha256:fa6693661a4c91757f4412306191b6dc88c1703f780c8234035eac011922bc01 \ - --hash=sha256:fcd131dd944808b5bdb38e6f5b53013c5aa4f334c5cad0c72742f6eba4b73db0 - # via - # -r requirements.in - # cryptography -charset-normalizer==2.0.12 \ - --hash=sha256:2857e29ff0d34db842cd7ca3230549d1a697f96ee6d3fb071cfa6c7393832597 \ - --hash=sha256:6881edbebdb17b39b4eaaa821b438bf6eddffb4468cf344f09f89def34a8b1df - # via requests -click==8.0.4 \ - --hash=sha256:6a7a62563bbfabfda3a38f3023a1db4a35978c0abd76f6c9605ecd6554d6d9b1 \ - --hash=sha256:8458d7b1287c5fb128c90e23381cf99dcde74beaf6c7ff6384ce84d6fe090adb - # via - # gcp-docuploader - # gcp-releasetool -colorlog==6.7.0 \ - --hash=sha256:0d33ca236784a1ba3ff9c532d4964126d8a2c44f1f0cb1d2b0728196f512f662 \ - --hash=sha256:bd94bd21c1e13fac7bd3153f4bc3a7dc0eb0974b8bc2fdf1a989e474f6e582e5 - # via gcp-docuploader -cryptography==38.0.3 \ - --hash=sha256:068147f32fa662c81aebab95c74679b401b12b57494872886eb5c1139250ec5d \ - --hash=sha256:06fc3cc7b6f6cca87bd56ec80a580c88f1da5306f505876a71c8cfa7050257dd \ - --hash=sha256:25c1d1f19729fb09d42e06b4bf9895212292cb27bb50229f5aa64d039ab29146 \ - --hash=sha256:402852a0aea73833d982cabb6d0c3bb582c15483d29fb7085ef2c42bfa7e38d7 \ - --hash=sha256:4e269dcd9b102c5a3d72be3c45d8ce20377b8076a43cbed6f660a1afe365e436 \ - --hash=sha256:5419a127426084933076132d317911e3c6eb77568a1ce23c3ac1e12d111e61e0 \ - --hash=sha256:554bec92ee7d1e9d10ded2f7e92a5d70c1f74ba9524947c0ba0c850c7b011828 \ - --hash=sha256:5e89468fbd2fcd733b5899333bc54d0d06c80e04cd23d8c6f3e0542358c6060b \ - --hash=sha256:65535bc550b70bd6271984d9863a37741352b4aad6fb1b3344a54e6950249b55 \ - --hash=sha256:6ab9516b85bebe7aa83f309bacc5f44a61eeb90d0b4ec125d2d003ce41932d36 \ - --hash=sha256:6addc3b6d593cd980989261dc1cce38263c76954d758c3c94de51f1e010c9a50 \ - --hash=sha256:728f2694fa743a996d7784a6194da430f197d5c58e2f4e278612b359f455e4a2 \ - --hash=sha256:785e4056b5a8b28f05a533fab69febf5004458e20dad7e2e13a3120d8ecec75a \ - --hash=sha256:78cf5eefac2b52c10398a42765bfa981ce2372cbc0457e6bf9658f41ec3c41d8 \ - --hash=sha256:7f836217000342d448e1c9a342e9163149e45d5b5eca76a30e84503a5a96cab0 \ - --hash=sha256:8d41a46251bf0634e21fac50ffd643216ccecfaf3701a063257fe0b2be1b6548 \ - --hash=sha256:984fe150f350a3c91e84de405fe49e688aa6092b3525f407a18b9646f6612320 \ - --hash=sha256:9b24bcff7853ed18a63cfb0c2b008936a9554af24af2fb146e16d8e1aed75748 \ - --hash=sha256:b1b35d9d3a65542ed2e9d90115dfd16bbc027b3f07ee3304fc83580f26e43249 \ - --hash=sha256:b1b52c9e5f8aa2b802d48bd693190341fae201ea51c7a167d69fc48b60e8a959 \ - --hash=sha256:bbf203f1a814007ce24bd4d51362991d5cb90ba0c177a9c08825f2cc304d871f \ - --hash=sha256:be243c7e2bfcf6cc4cb350c0d5cdf15ca6383bbcb2a8ef51d3c9411a9d4386f0 \ - --hash=sha256:bfbe6ee19615b07a98b1d2287d6a6073f734735b49ee45b11324d85efc4d5cbd \ - --hash=sha256:c46837ea467ed1efea562bbeb543994c2d1f6e800785bd5a2c98bc096f5cb220 \ - --hash=sha256:dfb4f4dd568de1b6af9f4cda334adf7d72cf5bc052516e1b2608b683375dd95c \ - --hash=sha256:ed7b00096790213e09eb11c97cc6e2b757f15f3d2f85833cd2d3ec3fe37c1722 - # via - # -r requirements.in - # gcp-releasetool - # secretstorage -gcp-docuploader==0.6.3 \ - --hash=sha256:ba8c9d76b3bbac54b0311c503a373b00edc2dc02d6d54ea9507045adb8e870f7 \ - --hash=sha256:c0f5aaa82ce1854a386197e4e359b120ad6d4e57ae2c812fce42219a3288026b - # via -r requirements.in -gcp-releasetool==1.9.1 \ - --hash=sha256:952f4055d5d986b070ae2a71c4410b250000f9cc5a1e26398fcd55a5bbc5a15f \ - --hash=sha256:d0d3c814a97c1a237517e837d8cfa668ced8df4b882452578ecef4a4e79c583b - # via -r requirements.in -google-api-core==2.8.2 \ - --hash=sha256:06f7244c640322b508b125903bb5701bebabce8832f85aba9335ec00b3d02edc \ - --hash=sha256:93c6a91ccac79079ac6bbf8b74ee75db970cc899278b97d53bc012f35908cf50 - # via - # -r requirements.in - # google-cloud-core - # google-cloud-storage -google-auth==2.14.1 \ - --hash=sha256:f5d8701633bebc12e0deea4df8abd8aff31c28b355360597f7f2ee60f2e4d016 - # via - # -r requirements.in - # gcp-releasetool - # google-api-core - # google-cloud-core - # google-cloud-storage -google-cloud-core==2.3.1 \ - --hash=sha256:113ba4f492467d5bd442c8d724c1a25ad7384045c3178369038840ecdd19346c \ - --hash=sha256:34334359cb04187bdc80ddcf613e462dfd7a3aabbc3fe4d118517ab4b9303d53 - # via - # -r requirements.in - # google-cloud-storage -google-cloud-storage==2.0.0 \ - --hash=sha256:a57a15aead0f9dfbd4381f1bfdbe8bf89818a4bd75bab846cafcefb2db846c47 \ - --hash=sha256:ec4be60bb223a3a960f0d01697d849b86d91cad815a84915a32ed3635e93a5e7 - # via - # -r requirements.in - # gcp-docuploader -google-crc32c==1.3.0 \ - --hash=sha256:04e7c220798a72fd0f08242bc8d7a05986b2a08a0573396187fd32c1dcdd58b3 \ - --hash=sha256:05340b60bf05b574159e9bd940152a47d38af3fb43803ffe71f11d704b7696a6 \ - --hash=sha256:12674a4c3b56b706153a358eaa1018c4137a5a04635b92b4652440d3d7386206 \ - --hash=sha256:127f9cc3ac41b6a859bd9dc4321097b1a4f6aa7fdf71b4f9227b9e3ebffb4422 \ - --hash=sha256:13af315c3a0eec8bb8b8d80b8b128cb3fcd17d7e4edafc39647846345a3f003a \ - --hash=sha256:1926fd8de0acb9d15ee757175ce7242e235482a783cd4ec711cc999fc103c24e \ - --hash=sha256:226f2f9b8e128a6ca6a9af9b9e8384f7b53a801907425c9a292553a3a7218ce0 \ - --hash=sha256:276de6273eb074a35bc598f8efbc00c7869c5cf2e29c90748fccc8c898c244df \ - --hash=sha256:318f73f5484b5671f0c7f5f63741ab020a599504ed81d209b5c7129ee4667407 \ - --hash=sha256:3bbce1be3687bbfebe29abdb7631b83e6b25da3f4e1856a1611eb21854b689ea \ - --hash=sha256:42ae4781333e331a1743445931b08ebdad73e188fd554259e772556fc4937c48 \ - --hash=sha256:58be56ae0529c664cc04a9c76e68bb92b091e0194d6e3c50bea7e0f266f73713 \ - --hash=sha256:5da2c81575cc3ccf05d9830f9e8d3c70954819ca9a63828210498c0774fda1a3 \ - --hash=sha256:6311853aa2bba4064d0c28ca54e7b50c4d48e3de04f6770f6c60ebda1e975267 \ - --hash=sha256:650e2917660e696041ab3dcd7abac160b4121cd9a484c08406f24c5964099829 \ - --hash=sha256:6a4db36f9721fdf391646685ecffa404eb986cbe007a3289499020daf72e88a2 \ - --hash=sha256:779cbf1ce375b96111db98fca913c1f5ec11b1d870e529b1dc7354b2681a8c3a \ - --hash=sha256:7f6fe42536d9dcd3e2ffb9d3053f5d05221ae3bbcefbe472bdf2c71c793e3183 \ - --hash=sha256:891f712ce54e0d631370e1f4997b3f182f3368179198efc30d477c75d1f44942 \ - --hash=sha256:95c68a4b9b7828ba0428f8f7e3109c5d476ca44996ed9a5f8aac6269296e2d59 \ - --hash=sha256:96a8918a78d5d64e07c8ea4ed2bc44354e3f93f46a4866a40e8db934e4c0d74b \ - --hash=sha256:9c3cf890c3c0ecfe1510a452a165431b5831e24160c5fcf2071f0f85ca5a47cd \ - --hash=sha256:9f58099ad7affc0754ae42e6d87443299f15d739b0ce03c76f515153a5cda06c \ - --hash=sha256:a0b9e622c3b2b8d0ce32f77eba617ab0d6768b82836391e4f8f9e2074582bf02 \ - --hash=sha256:a7f9cbea4245ee36190f85fe1814e2d7b1e5f2186381b082f5d59f99b7f11328 \ - --hash=sha256:bab4aebd525218bab4ee615786c4581952eadc16b1ff031813a2fd51f0cc7b08 \ - --hash=sha256:c124b8c8779bf2d35d9b721e52d4adb41c9bfbde45e6a3f25f0820caa9aba73f \ - --hash=sha256:c9da0a39b53d2fab3e5467329ed50e951eb91386e9d0d5b12daf593973c3b168 \ - --hash=sha256:ca60076c388728d3b6ac3846842474f4250c91efbfe5afa872d3ffd69dd4b318 \ - --hash=sha256:cb6994fff247987c66a8a4e550ef374671c2b82e3c0d2115e689d21e511a652d \ - --hash=sha256:d1c1d6236feab51200272d79b3d3e0f12cf2cbb12b208c835b175a21efdb0a73 \ - --hash=sha256:dd7760a88a8d3d705ff562aa93f8445ead54f58fd482e4f9e2bafb7e177375d4 \ - --hash=sha256:dda4d8a3bb0b50f540f6ff4b6033f3a74e8bf0bd5320b70fab2c03e512a62812 \ - --hash=sha256:e0f1ff55dde0ebcfbef027edc21f71c205845585fffe30d4ec4979416613e9b3 \ - --hash=sha256:e7a539b9be7b9c00f11ef16b55486141bc2cdb0c54762f84e3c6fc091917436d \ - --hash=sha256:eb0b14523758e37802f27b7f8cd973f5f3d33be7613952c0df904b68c4842f0e \ - --hash=sha256:ed447680ff21c14aaceb6a9f99a5f639f583ccfe4ce1a5e1d48eb41c3d6b3217 \ - --hash=sha256:f52a4ad2568314ee713715b1e2d79ab55fab11e8b304fd1462ff5cccf4264b3e \ - --hash=sha256:fbd60c6aaa07c31d7754edbc2334aef50601b7f1ada67a96eb1eb57c7c72378f \ - --hash=sha256:fc28e0db232c62ca0c3600884933178f0825c99be4474cdd645e378a10588125 \ - --hash=sha256:fe31de3002e7b08eb20823b3735b97c86c5926dd0581c7710a680b418a8709d4 \ - --hash=sha256:fec221a051150eeddfdfcff162e6db92c65ecf46cb0f7bb1bf812a1520ec026b \ - --hash=sha256:ff71073ebf0e42258a42a0b34f2c09ec384977e7f6808999102eedd5b49920e3 - # via - # -r requirements.in - # google-resumable-media -google-resumable-media==2.3.3 \ - --hash=sha256:27c52620bd364d1c8116eaac4ea2afcbfb81ae9139fb3199652fcac1724bfb6c \ - --hash=sha256:5b52774ea7a829a8cdaa8bd2d4c3d4bc660c91b30857ab2668d0eb830f4ea8c5 - # via - # -r requirements.in - # google-cloud-storage -googleapis-common-protos==1.56.3 \ - --hash=sha256:6f1369b58ed6cf3a4b7054a44ebe8d03b29c309257583a2bbdc064cd1e4a1442 \ - --hash=sha256:87955d7b3a73e6e803f2572a33179de23989ebba725e05ea42f24838b792e461 - # via - # -r requirements.in - # google-api-core -idna==3.4 \ - --hash=sha256:814f528e8dead7d329833b91c5faa87d60bf71824cd12a7530b5526063d02cb4 \ - --hash=sha256:90b77e79eaa3eba6de819a0c442c0b4ceefc341a7a2ab77d7562bf49f425c5c2 - # via - # -r requirements.in - # requests -importlib-metadata==4.8.3 \ - --hash=sha256:65a9576a5b2d58ca44d133c42a241905cc45e34d2c06fd5ba2bafa221e5d7b5e \ - --hash=sha256:766abffff765960fcc18003801f7044eb6755ffae4521c8e8ce8e83b9c9b0668 - # via - # -r requirements.in - # keyring -jeepney==0.7.1 \ - --hash=sha256:1b5a0ea5c0e7b166b2f5895b91a08c14de8915afda4407fb5022a195224958ac \ - --hash=sha256:fa9e232dfa0c498bd0b8a3a73b8d8a31978304dcef0515adc859d4e096f96f4f - # via - # -r requirements.in - # keyring - # secretstorage -jinja2==3.0.3 \ - --hash=sha256:077ce6014f7b40d03b47d1f1ca4b0fc8328a692bd284016f806ed0eaca390ad8 \ - --hash=sha256:611bb273cd68f3b993fabdc4064fc858c5b47a973cb5aa7999ec1ba405c87cd7 - # via - # -r requirements.in - # gcp-releasetool -keyring==23.4.1 \ - --hash=sha256:17e49fb0d6883c2b4445359434dba95aad84aabb29bbff044ad0ed7100232eca \ - --hash=sha256:89cbd74d4683ed164c8082fb38619341097741323b3786905c6dac04d6915a55 - # via - # -r requirements.in - # gcp-releasetool -markupsafe==2.0.1 \ - --hash=sha256:01a9b8ea66f1658938f65b93a85ebe8bc016e6769611be228d797c9d998dd298 \ - --hash=sha256:023cb26ec21ece8dc3907c0e8320058b2e0cb3c55cf9564da612bc325bed5e64 \ - --hash=sha256:0446679737af14f45767963a1a9ef7620189912317d095f2d9ffa183a4d25d2b \ - --hash=sha256:04635854b943835a6ea959e948d19dcd311762c5c0c6e1f0e16ee57022669194 \ - --hash=sha256:0717a7390a68be14b8c793ba258e075c6f4ca819f15edfc2a3a027c823718567 \ - --hash=sha256:0955295dd5eec6cb6cc2fe1698f4c6d84af2e92de33fbcac4111913cd100a6ff \ - --hash=sha256:0d4b31cc67ab36e3392bbf3862cfbadac3db12bdd8b02a2731f509ed5b829724 \ - --hash=sha256:10f82115e21dc0dfec9ab5c0223652f7197feb168c940f3ef61563fc2d6beb74 \ - --hash=sha256:168cd0a3642de83558a5153c8bd34f175a9a6e7f6dc6384b9655d2697312a646 \ - --hash=sha256:1d609f577dc6e1aa17d746f8bd3c31aa4d258f4070d61b2aa5c4166c1539de35 \ - --hash=sha256:1f2ade76b9903f39aa442b4aadd2177decb66525062db244b35d71d0ee8599b6 \ - --hash=sha256:20dca64a3ef2d6e4d5d615a3fd418ad3bde77a47ec8a23d984a12b5b4c74491a \ - --hash=sha256:2a7d351cbd8cfeb19ca00de495e224dea7e7d919659c2841bbb7f420ad03e2d6 \ - --hash=sha256:2d7d807855b419fc2ed3e631034685db6079889a1f01d5d9dac950f764da3dad \ - --hash=sha256:2ef54abee730b502252bcdf31b10dacb0a416229b72c18b19e24a4509f273d26 \ - --hash=sha256:36bc903cbb393720fad60fc28c10de6acf10dc6cc883f3e24ee4012371399a38 \ - --hash=sha256:37205cac2a79194e3750b0af2a5720d95f786a55ce7df90c3af697bfa100eaac \ - --hash=sha256:3c112550557578c26af18a1ccc9e090bfe03832ae994343cfdacd287db6a6ae7 \ - --hash=sha256:3dd007d54ee88b46be476e293f48c85048603f5f516008bee124ddd891398ed6 \ - --hash=sha256:4296f2b1ce8c86a6aea78613c34bb1a672ea0e3de9c6ba08a960efe0b0a09047 \ - --hash=sha256:47ab1e7b91c098ab893b828deafa1203de86d0bc6ab587b160f78fe6c4011f75 \ - --hash=sha256:49e3ceeabbfb9d66c3aef5af3a60cc43b85c33df25ce03d0031a608b0a8b2e3f \ - --hash=sha256:4dc8f9fb58f7364b63fd9f85013b780ef83c11857ae79f2feda41e270468dd9b \ - --hash=sha256:4efca8f86c54b22348a5467704e3fec767b2db12fc39c6d963168ab1d3fc9135 \ - --hash=sha256:53edb4da6925ad13c07b6d26c2a852bd81e364f95301c66e930ab2aef5b5ddd8 \ - --hash=sha256:5855f8438a7d1d458206a2466bf82b0f104a3724bf96a1c781ab731e4201731a \ - --hash=sha256:594c67807fb16238b30c44bdf74f36c02cdf22d1c8cda91ef8a0ed8dabf5620a \ - --hash=sha256:5b6d930f030f8ed98e3e6c98ffa0652bdb82601e7a016ec2ab5d7ff23baa78d1 \ - --hash=sha256:5bb28c636d87e840583ee3adeb78172efc47c8b26127267f54a9c0ec251d41a9 \ - --hash=sha256:60bf42e36abfaf9aff1f50f52644b336d4f0a3fd6d8a60ca0d054ac9f713a864 \ - --hash=sha256:611d1ad9a4288cf3e3c16014564df047fe08410e628f89805e475368bd304914 \ - --hash=sha256:6300b8454aa6930a24b9618fbb54b5a68135092bc666f7b06901f897fa5c2fee \ - --hash=sha256:63f3268ba69ace99cab4e3e3b5840b03340efed0948ab8f78d2fd87ee5442a4f \ - --hash=sha256:6557b31b5e2c9ddf0de32a691f2312a32f77cd7681d8af66c2692efdbef84c18 \ - --hash=sha256:693ce3f9e70a6cf7d2fb9e6c9d8b204b6b39897a2c4a1aa65728d5ac97dcc1d8 \ - --hash=sha256:6a7fae0dd14cf60ad5ff42baa2e95727c3d81ded453457771d02b7d2b3f9c0c2 \ - --hash=sha256:6c4ca60fa24e85fe25b912b01e62cb969d69a23a5d5867682dd3e80b5b02581d \ - --hash=sha256:6fcf051089389abe060c9cd7caa212c707e58153afa2c649f00346ce6d260f1b \ - --hash=sha256:7d91275b0245b1da4d4cfa07e0faedd5b0812efc15b702576d103293e252af1b \ - --hash=sha256:89c687013cb1cd489a0f0ac24febe8c7a666e6e221b783e53ac50ebf68e45d86 \ - --hash=sha256:8d206346619592c6200148b01a2142798c989edcb9c896f9ac9722a99d4e77e6 \ - --hash=sha256:905fec760bd2fa1388bb5b489ee8ee5f7291d692638ea5f67982d968366bef9f \ - --hash=sha256:97383d78eb34da7e1fa37dd273c20ad4320929af65d156e35a5e2d89566d9dfb \ - --hash=sha256:984d76483eb32f1bcb536dc27e4ad56bba4baa70be32fa87152832cdd9db0833 \ - --hash=sha256:99df47edb6bda1249d3e80fdabb1dab8c08ef3975f69aed437cb69d0a5de1e28 \ - --hash=sha256:9f02365d4e99430a12647f09b6cc8bab61a6564363f313126f775eb4f6ef798e \ - --hash=sha256:a30e67a65b53ea0a5e62fe23682cfe22712e01f453b95233b25502f7c61cb415 \ - --hash=sha256:ab3ef638ace319fa26553db0624c4699e31a28bb2a835c5faca8f8acf6a5a902 \ - --hash=sha256:aca6377c0cb8a8253e493c6b451565ac77e98c2951c45f913e0b52facdcff83f \ - --hash=sha256:add36cb2dbb8b736611303cd3bfcee00afd96471b09cda130da3581cbdc56a6d \ - --hash=sha256:b2f4bf27480f5e5e8ce285a8c8fd176c0b03e93dcc6646477d4630e83440c6a9 \ - --hash=sha256:b7f2d075102dc8c794cbde1947378051c4e5180d52d276987b8d28a3bd58c17d \ - --hash=sha256:baa1a4e8f868845af802979fcdbf0bb11f94f1cb7ced4c4b8a351bb60d108145 \ - --hash=sha256:be98f628055368795d818ebf93da628541e10b75b41c559fdf36d104c5787066 \ - --hash=sha256:bf5d821ffabf0ef3533c39c518f3357b171a1651c1ff6827325e4489b0e46c3c \ - --hash=sha256:c47adbc92fc1bb2b3274c4b3a43ae0e4573d9fbff4f54cd484555edbf030baf1 \ - --hash=sha256:cdfba22ea2f0029c9261a4bd07e830a8da012291fbe44dc794e488b6c9bb353a \ - --hash=sha256:d6c7ebd4e944c85e2c3421e612a7057a2f48d478d79e61800d81468a8d842207 \ - --hash=sha256:d7f9850398e85aba693bb640262d3611788b1f29a79f0c93c565694658f4071f \ - --hash=sha256:d8446c54dc28c01e5a2dbac5a25f071f6653e6e40f3a8818e8b45d790fe6ef53 \ - --hash=sha256:deb993cacb280823246a026e3b2d81c493c53de6acfd5e6bfe31ab3402bb37dd \ - --hash=sha256:e0f138900af21926a02425cf736db95be9f4af72ba1bb21453432a07f6082134 \ - --hash=sha256:e9936f0b261d4df76ad22f8fee3ae83b60d7c3e871292cd42f40b81b70afae85 \ - --hash=sha256:f0567c4dc99f264f49fe27da5f735f414c4e7e7dd850cfd8e69f0862d7c74ea9 \ - --hash=sha256:f5653a225f31e113b152e56f154ccbe59eeb1c7487b39b9d9f9cdb58e6c79dc5 \ - --hash=sha256:f826e31d18b516f653fe296d967d700fddad5901ae07c622bb3705955e1faa94 \ - --hash=sha256:f8ba0e8349a38d3001fae7eadded3f6606f0da5d748ee53cc1dab1d6527b9509 \ - --hash=sha256:f9081981fe268bd86831e5c75f7de206ef275defcb82bc70740ae6dc507aee51 \ - --hash=sha256:fa130dd50c57d53368c9d59395cb5526eda596d3ffe36666cd81a44d56e48872 - # via - # -r requirements.in - # jinja2 -packaging==21.3 \ - --hash=sha256:dd47c42927d89ab911e606518907cc2d3a1f38bbd026385970643f9c5b8ecfeb \ - --hash=sha256:ef103e05f519cdc783ae24ea4e2e0f508a9c99b2d4969652eed6a2e1ea5bd522 - # via - # -r requirements.in - # gcp-releasetool -protobuf==3.19.5 \ - --hash=sha256:1867f93b06a183f87696871bb8d1e99ee71dbb69d468ce1f0cc8bf3d30f982f3 \ - --hash=sha256:3c4160b601220627f7e91154e572baf5e161a9c3f445a8242d536ee3d0b7b17c \ - --hash=sha256:4ee2af7051d3b10c8a4fe6fd1a2c69f201fea36aeee7086cf202a692e1b99ee1 \ - --hash=sha256:5266c36cc0af3bb3dbf44f199d225b33da66a9a5c3bdc2b14865ad10eddf0e37 \ - --hash=sha256:5470f892961af464ae6eaf0f3099e2c1190ae8c7f36f174b89491281341f79ca \ - --hash=sha256:66d14b5b90090353efe75c9fb1bf65ef7267383034688d255b500822e37d5c2f \ - --hash=sha256:67efb5d20618020aa9596e17bfc37ca068c28ec0c1507d9507f73c93d46c9855 \ - --hash=sha256:696e6cfab94cc15a14946f2bf72719dced087d437adbd994fff34f38986628bc \ - --hash=sha256:6a02172b9650f819d01fb8e224fc69b0706458fc1ab4f1c669281243c71c1a5e \ - --hash=sha256:950abd6c00e7b51f87ae8b18a0ce4d69fea217f62f171426e77de5061f6d9850 \ - --hash=sha256:9e1d74032f56ff25f417cfe84c8147047732e5059137ca42efad20cbbd25f5e0 \ - --hash=sha256:9e42b1cf2ecd8a1bd161239e693f22035ba99905ae6d7efeac8a0546c7ec1a27 \ - --hash=sha256:9f957ef53e872d58a0afd3bf6d80d48535d28c99b40e75e6634cbc33ea42fd54 \ - --hash=sha256:a89aa0c042e61e11ade320b802d6db4ee5391d8d973e46d3a48172c1597789f8 \ - --hash=sha256:c0f80876a8ff0ae7064084ed094eb86497bd5a3812e6fc96a05318b92301674e \ - --hash=sha256:c44e3282cff74ad18c7e8a0375f407f69ee50c2116364b44492a196293e08b21 \ - --hash=sha256:d249519ba5ecf5dd6b18150c9b6bcde510b273714b696f3923ff8308fc11ae49 \ - --hash=sha256:d3973a2d58aefc7d1230725c2447ce7f86a71cbc094b86a77c6ee1505ac7cdb1 \ - --hash=sha256:dca2284378a5f2a86ffed35c6ac147d14c48b525eefcd1083e5a9ce28dfa8657 \ - --hash=sha256:e63b0b3c42e51c94add62b010366cd4979cb6d5f06158bcae8faac4c294f91e1 \ - --hash=sha256:f2b599a21c9a32e171ec29a2ac54e03297736c578698e11b099d031f79da114b \ - --hash=sha256:f2bde37667b18c2b5280df83bc799204394a5d2d774e4deaf9de0eb741df6833 \ - --hash=sha256:f4f909f4dde413dec435a44b0894956d55bb928ded7d6e3c726556ca4c796e84 \ - --hash=sha256:f976234e20ab2785f54224bcdafa027674e23663b132fa3ca0caa291a6cfbde7 \ - --hash=sha256:f9cebda093c2f6bfed88f1c17cdade09d4d96096421b344026feee236532d4de - # via - # -r requirements.in - # gcp-docuploader - # gcp-releasetool - # google-api-core - # google-cloud-storage - # googleapis-common-protos -pyasn1==0.4.8 \ - --hash=sha256:39c7e2ec30515947ff4e87fb6f456dfc6e84857d34be479c9d4a4ba4bf46aa5d \ - --hash=sha256:aef77c9fb94a3ac588e87841208bdec464471d9871bd5050a287cc9a475cd0ba - # via - # pyasn1-modules - # rsa -pyasn1-modules==0.2.8 \ - --hash=sha256:905f84c712230b2c592c19470d3ca8d552de726050d1d1716282a1f6146be65e \ - --hash=sha256:a50b808ffeb97cb3601dd25981f6b016cbb3d31fbf57a8b8a87428e6158d0c74 - # via google-auth -pycparser==2.21 \ - --hash=sha256:8ee45429555515e1f6b185e78100aea234072576aa43ab53aefcae078162fca9 \ - --hash=sha256:e644fdec12f7872f86c58ff790da456218b10f863970249516d60a5eaca77206 - # via - # -r requirements.in - # cffi -pyjwt==2.4.0 \ - --hash=sha256:72d1d253f32dbd4f5c88eaf1fdc62f3a19f676ccbadb9dbc5d07e951b2b26daf \ - --hash=sha256:d42908208c699b3b973cbeb01a969ba6a96c821eefb1c5bfe4c390c01d67abba - # via - # -r requirements.in - # gcp-releasetool -pyparsing==3.0.9 \ - --hash=sha256:2b020ecf7d21b687f219b71ecad3631f644a47f01403fa1d1036b0c6416d70fb \ - --hash=sha256:5026bae9a10eeaefb61dab2f09052b9f4307d44aee4eda64b309723d8d206bbc - # via - # -r requirements.in - # packaging -pyperclip==1.8.2 \ - --hash=sha256:105254a8b04934f0bc84e9c24eb360a591aaf6535c9def5f29d92af107a9bf57 - # via - # -r requirements.in - # gcp-releasetool -python-dateutil==2.8.2 \ - --hash=sha256:0123cacc1627ae19ddf3c27a5de5bd67ee4586fbdd6440d9748f8abb483d3e86 \ - --hash=sha256:961d03dc3453ebbc59dbdea9e4e11c5651520a876d0f4db161e8674aae935da9 - # via - # -r requirements.in - # gcp-releasetool -requests==2.27.1 \ - --hash=sha256:68d7c56fd5a8999887728ef304a6d12edc7be74f1cfa47714fc8b414525c9a61 \ - --hash=sha256:f22fa1e554c9ddfd16e6e41ac79759e17be9e492b3587efa038054674760e72d - # via - # -r requirements.in - # gcp-releasetool - # google-api-core - # google-cloud-storage -rsa==4.9 \ - --hash=sha256:90260d9058e514786967344d0ef75fa8727eed8a7d2e43ce9f4bcf1b536174f7 \ - --hash=sha256:e38464a49c6c85d7f1351b0126661487a7e0a14a50f1675ec50eb34d4f20ef21 - # via - # -r requirements.in - # google-auth -secretstorage==3.3.3 \ - --hash=sha256:2403533ef369eca6d2ba81718576c5e0f564d5cca1b58f73a8b23e7d4eeebd77 \ - --hash=sha256:f356e6628222568e3af06f2eba8df495efa13b3b63081dafd4f7d9a7b7bc9f99 - # via keyring -six==1.16.0 \ - --hash=sha256:1e61c37477a1626458e36f7b1d82aa5c9b094fa4802892072e49de9c60c4c926 \ - --hash=sha256:8abb2f1d86890a2dfb989f9a77cfcfd3e47c2a354b01111771326f8aa26e0254 - # via - # -r requirements.in - # gcp-docuploader - # google-auth - # python-dateutil -typing-extensions==4.1.1 \ - --hash=sha256:1a9462dcc3347a79b1f1c0271fbe79e844580bb598bafa1ed208b94da3cdcd42 \ - --hash=sha256:21c85e0fe4b9a155d0799430b0ad741cdce7e359660ccbd8b530613e8df88ce2 - # via -r requirements.in -urllib3==1.26.12 \ - --hash=sha256:3fa96cf423e6987997fc326ae8df396db2a8b7c667747d47ddd8ecba91f4a74e \ - --hash=sha256:b930dd878d5a8afb066a637fbb35144fe7901e3b209d1cd4f524bd0e9deee997 - # via - # -r requirements.in - # requests -zipp==3.6.0 \ - --hash=sha256:71c644c5369f4a6e07636f0aa966270449561fcea2e3d6747b8d23efaa9d7832 \ - --hash=sha256:9fe5ea21568a0a70e50f273397638d39b03353731e6cbbb3fd8502a33fec40bc - # via - # -r requirements.in - # importlib-metadata diff --git a/gax-java/.kokoro/trampoline.sh b/gax-java/.kokoro/trampoline.sh deleted file mode 100755 index 9da0f83987..0000000000 --- a/gax-java/.kokoro/trampoline.sh +++ /dev/null @@ -1,26 +0,0 @@ -#!/bin/bash -# Copyright 2018 Google Inc. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -set -eo pipefail -# Always run the cleanup script, regardless of the success of bouncing into -# the container. -function cleanup() { - chmod +x ${KOKORO_GFILE_DIR}/trampoline_cleanup.sh - ${KOKORO_GFILE_DIR}/trampoline_cleanup.sh - echo "cleanup"; -} -trap cleanup EXIT - -$(dirname $0)/populate-secrets.sh # Secret Manager secrets. -python3 "${KOKORO_GFILE_DIR}/trampoline_v1.py" diff --git a/gax-java/.repo-metadata.json b/gax-java/.repo-metadata.json new file mode 100644 index 0000000000..0e04b69bb8 --- /dev/null +++ b/gax-java/.repo-metadata.json @@ -0,0 +1,13 @@ +{ + "api_shortname": "gax", + "name_pretty": "gax", + "product_documentation": "https://github.com/googleapis/sdk-platform-java/blob/main/gax-java/README.md", + "api_description": "Google API Extensions for Java (GAX Java) is a library which aids in the development of client libraries for server APIs, based on GRPC and Google API conventions.", + "client_documentation": "https://cloud.google.com/java/docs/reference/gax/latest/overview", + "language": "java", + "release_level": "stable", + "repo": "googleapis/sdk-platform-java", + "repo_short": "gax-java", + "library_type": "OTHER", + "distribution_name": "com.google.api:gax" +} diff --git a/gax-java/CODE_OF_CONDUCT.md b/gax-java/CODE_OF_CONDUCT.md deleted file mode 100644 index 46b2a08ea6..0000000000 --- a/gax-java/CODE_OF_CONDUCT.md +++ /dev/null @@ -1,43 +0,0 @@ -# Contributor Code of Conduct - -As contributors and maintainers of this project, -and in the interest of fostering an open and welcoming community, -we pledge to respect all people who contribute through reporting issues, -posting feature requests, updating documentation, -submitting pull requests or patches, and other activities. - -We are committed to making participation in this project -a harassment-free experience for everyone, -regardless of level of experience, gender, gender identity and expression, -sexual orientation, disability, personal appearance, -body size, race, ethnicity, age, religion, or nationality. - -Examples of unacceptable behavior by participants include: - -* The use of sexualized language or imagery -* Personal attacks -* Trolling or insulting/derogatory comments -* Public or private harassment -* Publishing other's private information, -such as physical or electronic -addresses, without explicit permission -* Other unethical or unprofessional conduct. - -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. -By adopting this Code of Conduct, -project maintainers commit themselves to fairly and consistently -applying these principles to every aspect of managing this project. -Project maintainers who do not follow or enforce the Code of Conduct -may be permanently removed from the project team. - -This code of conduct applies both within project spaces and in public spaces -when an individual is representing the project or its community. - -Instances of abusive, harassing, or otherwise unacceptable behavior -may be reported by opening an issue -or contacting one or more of the project maintainers. - -This Code of Conduct is adapted from the [Contributor Covenant](http://contributor-covenant.org), version 1.2.0, -available at [http://contributor-covenant.org/version/1/2/0/](http://contributor-covenant.org/version/1/2/0/) diff --git a/gax-java/CONTRIBUTING.md b/gax-java/CONTRIBUTING.md index f39ea3e174..321735f3fd 100644 --- a/gax-java/CONTRIBUTING.md +++ b/gax-java/CONTRIBUTING.md @@ -20,15 +20,7 @@ frustration later on. All submissions, including submissions by project members, require review. We use Github pull requests for this purpose. -### Building -To build GAX: - -```sh -mvn clean install -``` - ### The small print Contributions made by corporations are covered by a different agreement than the one above, the -[Software Grant and Corporate Contributor License Agreement] -(https://cla.developers.google.com/about/google-corporate). +[Software Grant and Corporate Contributor License Agreement](https://cla.developers.google.com/about/google-corporate). diff --git a/gax-java/DEVELOPMENT.md b/gax-java/DEVELOPMENT.md new file mode 100644 index 0000000000..8288ce0ad7 --- /dev/null +++ b/gax-java/DEVELOPMENT.md @@ -0,0 +1,23 @@ +# Development of gax-java + +## Building + +To build GAX: + +```sh +# Go to the repository root +cd gapic-generator-java + +# Install dependency modules to local Maven repository. Note that +# gapic-generator-java module is not a dependency of gax-java +mvn -pl '!gapic-generator-java,!gax-java' install -DskipTests + +# Build and install gax-java +mvn clean install -f gax-java +``` + +## How to see the effect of GAX change in code generation by gapic-generator-java + +To see the effect of GAX changes in local gapic-generator-java invocation, see +"Running the Plugin under googleapis with local gapic-generator-java" in +[gapic-generator-java/DEVELOPMENT.md](../gapic-generator-java/DEVELOPMENT.md) diff --git a/gax-java/LICENSE b/gax-java/LICENSE index 267561bb38..a5c95e3444 100644 --- a/gax-java/LICENSE +++ b/gax-java/LICENSE @@ -1,16 +1,16 @@ -Copyright 2016, Google Inc. All rights reserved. +Copyright 2016 Google LLC Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright + * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above + * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - * Neither the name of Google Inc. nor the names of its + * Neither the name of Google LLC nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. @@ -24,4 +24,4 @@ LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. \ No newline at end of file diff --git a/gax-java/README.md b/gax-java/README.md index a0d1aa77a3..afcd206cc1 100644 --- a/gax-java/README.md +++ b/gax-java/README.md @@ -1,9 +1,7 @@ Google API Extensions for Java ============================== -[![Build Status](https://travis-ci.org/googleapis/gax-java.svg?branch=main)](https://travis-ci.org/googleapis/gax-java) - -- [Documentation](https://googleapis.dev/java/gax/latest/) +- [API Documentation](https://cloud.google.com/java/docs/reference/gax/latest/overview.html) Google API Extensions for Java (GAX Java) is a library which aids in the development of client libraries for server APIs, based on [GRPC](http://grpc.io) @@ -15,7 +13,7 @@ files can use services such as paged list iteration, request batching, and polling of long-running operations to provide a more convenient and idiomatic API surface to callers. -Currently, this library shouldn't be used independently from google-cloud-java, otherwise there is +Currently, this library shouldn't be used independently of google-cloud-java, otherwise there is a high risk of diamond dependency problems, because google-cloud-java uses beta features from this library which can change in breaking ways between versions. See [VERSIONING](#versioning) for more information. @@ -36,30 +34,32 @@ If you are using Maven, add this to your pom.xml file com.google.api gax - 2.8.1 + 2.76.0 com.google.api gax-grpc - 2.8.1 + 2.76.0 ``` If you are using Gradle, add this to your dependencies ```Groovy -compile 'com.google.api:gax:2.8.1', - 'com.google.api:gax-grpc:2.8.1' +compile 'com.google.api:gax:2.76.0', + 'com.google.api:gax-grpc:2.76.0' ``` If you are using SBT, add this to your dependencies ```Scala -libraryDependencies += "com.google.api" % "gax" % "2.8.1" -libraryDependencies += "com.google.api" % "gax-grpc" % "2.8.1" +libraryDependencies += "com.google.api" % "gax" % "2.76.0" +libraryDependencies += "com.google.api" % "gax-grpc" % "2.76.0" ``` [//]: # ({x-version-update-end}) +To find the latest version, see https://search.maven.org/artifact/com.google.api/gax. + Java Versions ------------- @@ -109,6 +109,8 @@ additional qualifications: with this annotation, but methods can be added, thus breaking any code implementing the interface. See the javadocs for more details on other consequences of this annotation. +1. Components marked with `@ObsoleteApi` are stable for usage in the current major version, + but will be marked with `@Deprecated` in a future major version. ### Submodule notes @@ -118,11 +120,9 @@ or `@InternalExtensionOnly` won't break between minor releases. Anything marked - `gax-grpc` is stable (>= 1.0.0), so anything not marked `@BetaApi`, `@InternalApi`, or `@InternalExtensionOnly` won't break between minor releases. Anything marked `@InternalExtensionOnly` can only break extensions between minor releases. -- `gax-httpjson` is beta (0.x.y), so anything may change at any time and the public -API should not be considered stable. There is no difference whether a class is -marked `@BetaApi` or not; that annotation is only present as a reminder. There is -also no difference whether a class is marked `@InternalExtensionOnly` or not; that -only implies that the annotation will still be present in 1.0.0. +- `gax-httpjson` is stable (>= 1.0.0), so anything not marked `@BetaApi`, `@InternalApi`, +or `@InternalExtensionOnly` won't break between minor releases. Anything marked +`@InternalExtensionOnly` can only break extensions between minor releases. ### Feature notes @@ -140,6 +140,12 @@ This repository contains the following java packages. ### gax +Transport-independent part of GAX for Java. +The term "transport" in this context usually means the distinction between gRPC or REST. +Basically all logic, which does not depend explicitly on gRPC or REST goes to this package. +The examples of such transport-agnostic logic, which is in this package: +retries, pagination, batching, utilities and core logic. + - `com.google.api.gax.batching` - Contains general-purpose batching logic. - `com.google.api.gax.core` - Contains core interfaces and classes that are not specific to grpc and could be used in other contexts. @@ -152,6 +158,10 @@ This repository contains the following java packages. ### gax-grpc +This depends on gax module from the above, and has all the gRPC-specific logic, +which could not go to the gax module because of this dependency on gRPC. +Basically it has gRPC-specific implementations of the interfaces and abstract classes defined in gax. + - `com.google.api.gax.grpc` - Contains classes that provide functionality on top of gRPC calls. - `com.google.longrunning` - Contains the mix-in client for long-running operations @@ -159,6 +169,10 @@ This repository contains the following java packages. ### gax-httpjson +This module is very similar to gax-grpc, but depends on REST-specific implementation. +It enables the generated libraries to communicate with the backend services based on HTTP +1.1 protocol. + - `com.google.api.gax.httpjson` - Contains classes that provide functionality on top of http/json calls. diff --git a/gax-java/RELEASING.md b/gax-java/RELEASING.md deleted file mode 100644 index 37e4b20444..0000000000 --- a/gax-java/RELEASING.md +++ /dev/null @@ -1,72 +0,0 @@ -One-time setup -============== - -Set up Sonatype Account ------------------------ -* Sign up for a Sonatype JIRA account [here](https://issues.sonatype.org) -* Click *Sign Up* in the login box, follow instructions - -Get access to repository ------------------------- -* Go to [community support](https://issues.sonatype.org/browse/OSSRH) -* Ask for publish rights by creating an issue similar to [this one](https://issues.sonatype.org/browse/OSSRH-32031) - * You must be logged in to create a new issue - * Use the *Create* button at the top tab - -* Generate the key `gpg --gen-key` - * Keep the defaults, but specify a passphrase - -* Determine your `gpg` version: `gpg --version` - -* Find the ID of your public key - * If you're using GPG version 1.y.z, `gpg --list-secret-keys` - * Look for the line with format `sec 2048R/ABCDEFGH 2015-11-17` - * The `ABCDEFGH` is the ID for your public key - * If you're using GPG version 2.y.z `gpg --list-secret-keys --keyid-format LONG` - * Look for line with format `sec rsa2048/ABCDEFGHIJKLMNOP` - * The `ABCDEFGHIJKLMNOP` is the ID. It is 16-byte long, but Gradle - only support 8-byte keys. Use the *last* 8 bytes of the key when - following the rest of this document. - * `gpg --export-secret-keys > $HOME/.gnupg/secring.gpg` - -* Upload your public key to a public server: `gpg --send-keys --keyserver hkp://pgp.mit.edu ` - -Add deploy credential settings ------------------------- -* Create a settings file at `$HOME/.gradle/gradle.properties` with your key information and your sonatype username/password - -``` -signing.keyId= -signing.password= -signing.secretKeyRingFile=/usr/local/google/home//.gnupg/secring.gpg - -ossrhUsername= -ossrhPassword= -``` - -Install releasetool -------------------- -See [releasetool](https://github.com/googleapis/releasetool) for installation instructions. You will -need python 3.6+ to run this tool. - -To prepare a release -==================== - -Update version and deploy to Sonatype -------------------------------------- -1. Run `releasetool start`. Select "minor" or "patch" for the release type. This will bump the - artifact versions, ask you to edit release notes, and create the release pull request. When - prompted, choose to autorelease. - * Note: be sure to make these notes nice as they will be used for the release notes as well. -2. Request a review on the PR. -3. Submit the PR. -4. Automation will run in the background to handle the release. -5. It will take some time (~10 min to ~8 hours) for the package to transition -6. Automation will publish a new release on Github using releasetool and publish javadocs to - https://googleapis.dev/java/gax/latest. - -Bump development version ------------------------- -1. Run `releasetool start` again, but specify "snapshot" when prompted for the type of release. - This will bump the artifact versions and create a new snapshot pull request. -2. Review and submit the PR. diff --git a/gax-java/SECURITY.md b/gax-java/SECURITY.md deleted file mode 100644 index 8b58ae9c01..0000000000 --- a/gax-java/SECURITY.md +++ /dev/null @@ -1,7 +0,0 @@ -# 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/gax-java/build.gradle b/gax-java/build.gradle deleted file mode 100644 index d6a194c00e..0000000000 --- a/gax-java/build.gradle +++ /dev/null @@ -1,329 +0,0 @@ -import groovy.io.FileType - -plugins { - id 'java' - id 'io.github.gradle-nexus.publish-plugin' version '1.1.0' - - id 'com.diffplug.eclipse.apt' version '3.40.0' apply false - id 'com.dorongold.task-tree' version '2.1.1' apply false - id 'com.github.johnrengelman.shadow' version '7.1.2' apply false - id 'com.github.sherter.google-java-format' version '0.9' apply false - - id 'org.sonarqube' version '3.5.0.2730' -} - -// TODO: Populate this from dependencies.properties version property (for proper Gradle-Bazel sync) -project.version = "2.20.1" // {x-version-update:gax:current} - -allprojects { - group = 'com.google.api' -} - -// Project names not using the default publication configuration -def nonJavaProjects = ['gax-bom'] - -ext { - libraryVendor = 'Google' - - // Load Dependencies shared between Bazel and Gradle build scripts - libraries = new Properties() - file('dependencies.properties').withReader { libraries.load(it) } - // Gradle-specific build script dependencies - libraries.putAll( - 'maven.io_grpc_grpc_bom': "io.grpc:grpc-bom:${libraries['version.io_grpc']}", - 'maven.io_grpc_grpc_core': "io.grpc:grpc-core:${libraries['version.io_grpc']}", - 'maven.io_grpc_grpc_context': "io.grpc:grpc-context:${libraries['version.io_grpc']}", - 'maven.io_grpc_grpc_stub': "io.grpc:grpc-stub:${libraries['version.io_grpc']}", - 'maven.io_grpc_grpc_api': "io.grpc:grpc-api:${libraries['version.io_grpc']}", - 'maven.io_grpc_grpc_auth': "io.grpc:grpc-auth:${libraries['version.io_grpc']}", - 'maven.io_grpc_grpc_protobuf': "io.grpc:grpc-protobuf:${libraries['version.io_grpc']}", - 'maven.io_grpc_grpc_netty_shaded': "io.grpc:grpc-netty-shaded:${libraries['version.io_grpc']}", - 'maven.io_grpc_grpc_alts': "io.grpc:grpc-alts:${libraries['version.io_grpc']}", - 'maven.io_grpc_grpc_googleapis': "io.grpc:grpc-googleapis:${libraries['version.io_grpc']}", - 'maven.com_google_protobuf': "com.google.protobuf:protobuf-java:${libraries['version.com_google_protobuf']}", - 'maven.com_google_protobuf_java_util': "com.google.protobuf:protobuf-java-util:${libraries['version.com_google_protobuf']}") -} - -nexusPublishing { - packageGroup = 'com.google.api' - repositories { - sonatype { - nexusUrl = uri('https://google.oss.sonatype.org/service/local/') - snapshotRepositoryUrl = uri('https://google.oss.sonatype.org/content/repositories/snapshots/') - username = findProperty('ossrhUsername') - password = findProperty('ossrhPassword') - } - } -} - -def javaProjects = subprojects.findAll { !nonJavaProjects.contains(it.name) } -configure(javaProjects) { - apply plugin: 'java-library' - apply plugin: 'eclipse' - apply plugin: 'idea' - apply plugin: 'jacoco' - - apply plugin: 'com.diffplug.eclipse.apt' - apply plugin: 'com.dorongold.task-tree' - apply plugin: 'com.github.johnrengelman.shadow' - apply plugin: 'com.github.sherter.google-java-format' - - sourceCompatibility = 1.8 - targetCompatibility = 1.8 - - // Formatting tasks - // ================ - googleJavaFormat { - toolVersion '1.7' - exclude '.apt_generated*/**' - exclude 'bin/**' - exclude 'build/**' - exclude 'bazel*/**' - } - test.dependsOn verifyGoogleJavaFormat - - task verifyLicense { - doLast { - def licenseText = new File('license-header-javadoc.txt').text - def srcFiles = [] - sourceSets - .collectMany{it.allJava.getSrcDirs()} - .grep{it.exists()} - .each{it.eachFileRecurse(FileType.FILES, {srcFiles << new Tuple(it, it.text)})} - srcFiles = srcFiles - .findAll{it.get(0).path.endsWith('.java')} - .collect{new Tuple(it.get(0), it.get(1).replaceAll('Copyright 20[0-9]{2}', 'Copyright 20xx'))} - .findAll{!it.get(1).startsWith(licenseText)} - if (srcFiles.asList().size() > 0) { - srcFiles.each({println 'missing license: ' + it.get(0)}) - throw new IllegalStateException('Above files do not have licenses') - } - } - } - test.dependsOn verifyLicense - - tasks.withType(JavaCompile) { - options.compilerArgs << '-Xlint:unchecked' << '-Xlint:deprecation' - // This flag is only available in JDK 9+. This flag ensures the generated - // bytecode is compatible with Java 8. (targetCompatibility = 1.8 is not - // sufficient) - options.compilerArgs.addAll(['--release', '8']) - } - - // Dependencies - // ------------ - - repositories { - mavenLocal() - mavenCentral() - } - - configurations { - shadowNoGuava - implementation.exclude group: 'com.google.guava', module: 'guava-jdk5' - } - - jacoco.toolVersion = '0.8.5' - jacocoTestReport { - reports { - xml.required = true - html.required = true - } - afterEvaluate { - getClassDirectories().setFrom files(classDirectories.files.collect { - fileTree(dir: it, exclude: ['**/AutoValue_*']) - }) - } - } - check.dependsOn jacocoTestReport - - - // Source jar - // ---------- - - task sourcesJar(type: Jar, dependsOn: classes) { - archiveClassifier = 'sources' - - from sourceSets.main.allSource, sourceSets.test.allSource - exclude('**/*Test.java') - } - - javadoc.options { - encoding = 'UTF-8' - links 'https://docs.oracle.com/javase/8/docs/api/' - - if (JavaVersion.current().isJava8Compatible()) { - addStringOption('Xdoclint:all,-missing', '-quiet') - } - if (JavaVersion.current().isJava11Compatible()) { - addStringOption('-release', '8') - } - } - - // JavaDocV1 html - // ------- - task javadocJar(type: Jar) { - archiveClassifier = 'javadoc' - from javadoc - } - - // JavaDocV3 - docFX - // ------- - task javadocJarV3(type: Jar) { - archiveClassifier = 'javadoc' - from javadoc - } - - // Test jar - // -------- - - task testlibJar(type: Jar, dependsOn: test) { - archiveClassifier = 'testlib' - from sourceSets.test.output - - include('com/google/api/gax/rpc/testing/**') - include('com/google/api/gax/grpc/testing/**') - include('com/google/api/gax/httpjson/testing/**') - } - - // ShadowJar - // --------- - - shadowJar { - archiveClassifier = 'guavashaded' - relocate 'com.google.common', 'com.google.api.gax.repackaged.com.google.common' - relocate 'io.grpc.stub', 'com.google.api.gax.repackaged.io.grpc.stub' - relocate 'io.grpc.protobuf', 'com.google.api.gax.repackaged.io.grpc.protobuf' - configurations = [project.configurations.shadowNoGuava] - exclude('io/grpc/*') - exclude('io/grpc/internal/**') - exclude('io/grpc/inprocess/**') - exclude('io/grpc/util/**') - } - - // Test Logging - // ------------ - - test { - testLogging { - events 'passed', 'skipped', 'failed', 'standardOut', 'standardError' - exceptionFormat = 'full' - } - } - - // Eclipse annotation processing auto-setup - eclipse.synchronizationTasks eclipseJdtApt, eclipseJdt, eclipseFactorypath -} - -def normalReleasableProjects = subprojects.findAll { - !nonJavaProjects.contains(it.name) -} -configure(normalReleasableProjects) { - apply plugin: 'maven-publish' - apply plugin: 'signing' - - afterEvaluate { - publishing { - publications { - mavenJava(MavenPublication) { - version = project.version - - from components.java - - artifact javadocJar - artifact sourcesJar - artifact testlibJar - - pom { - name = 'GAX (Google Api eXtensions) for Java' - packaging = 'jar' - artifactId = project.name - description = 'Google Api eXtensions for Java' - url = 'https://github.com/googleapis/gax-java' - - scm { - url = 'https://github.com/googleapis/gax-java' - connection = 'scm:git:https://github.com/googleapis/gax-java.git' - } - - licenses { - license { - name = 'BSD' - url = 'https://github.com/googleapis/gax-java/blob/master/LICENSE' - } - } - - developers { - developer { - id = 'GoogleAPIs' - name = 'GoogleAPIs' - email = 'googleapis@googlegroups.com' - url = 'https://github.com/googleapis/gax-java' - organization = 'Google LLC' - organizationUrl = 'https://www.google.com' - } - } - } - } - } - repositories { - maven { - url 'https://google.oss.sonatype.org/service/local/staging/deploy/maven2/' - credentials { - username = findProperty('ossrhUsername') - password = findProperty('ossrhPassword') - } - } - } - } - } - - signing { - required { gradle.taskGraph.hasTask ":${name}:publishToSonatype" } - if (project.hasProperty('signing.gnupg.executable')) { - useGpgCmd() - } - sign publishing.publications - } -} - -javadoc.options { - encoding = 'UTF-8' - links 'https://docs.oracle.com/javase/7/docs/api/' -} - -// JavaDocV1 html -// ------- -task javadocCombined(type: Javadoc) { - source subprojects.collect {project -> project.sourceSets.main.allJava } - classpath = files(subprojects.collect {project -> project.sourceSets.main.compileClasspath}) - destinationDir = file('tmp_docs') -} - -// JavaDocV3 docFX -// ------- -task javadocCombinedV3(type: Javadoc) { - source subprojects.collect {project -> project.sourceSets.main.allJava } - classpath = files(subprojects.collect {project -> project.sourceSets.main.compileClasspath}) - destinationDir = file('tmp_docs/docfx-yml') - - options.addStringOption('encoding', 'UTF-8') - options.addStringOption('doclet', 'com.microsoft.doclet.DocFxDoclet') - options.addStringOption('projectname', 'gax') - options.docletpath = [file(System.getenv('KOKORO_GFILE_DIR') + '/java-docfx-doclet-1.5.0.jar')] - // Newer Gradle 6 passes -notimestamp by default, which the doclet above doesn't understand: - // https://github.com/gradle/gradle/issues/11898 - options.noTimestamp false -} - -clean { - delete 'tmp_docs/' -} - -sonarqube { - properties { - property 'sonar.projectKey', 'googleapis_gax-java' - property 'sonar.organization', 'googleapis' - property 'sonar.host.url', 'https://sonarcloud.io' - } -} diff --git a/gax-java/dependencies.properties b/gax-java/dependencies.properties index 88418e78cd..94482c46e7 100644 --- a/gax-java/dependencies.properties +++ b/gax-java/dependencies.properties @@ -8,76 +8,91 @@ # Versions of oneself # {x-version-update-start:gax:current} -version.gax=2.20.1 +version.gax=2.76.1-SNAPSHOT # {x-version-update-end} # {x-version-update-start:gax:current} -version.gax_grpc=2.20.1 +version.gax_grpc=2.76.1-SNAPSHOT # {x-version-update-end} # {x-version-update-start:gax:current} -version.gax_bom=2.20.1 +version.gax_bom=2.76.1-SNAPSHOT # {x-version-update-end} -# {x-version-update-start:gax-httpjson:current} -version.gax_httpjson=0.105.1 +# {x-version-update-start:gax:current} +version.gax_httpjson=2.76.1-SNAPSHOT # {x-version-update-end} # Versions for dependencies which actual artifacts differ between Bazel and Gradle. # Gradle build depends on prebuilt maven artifacts, while Bazel build depends on Bazel workspaces # with the sources. -version.com_google_protobuf=3.21.10 +# The protobuf version is only used for generating gradle files for showcase module, +# not for self-service clients (from googleapis project). + +version.com_google_protobuf=3.25.8 version.google_java_format=1.15.0 -version.io_grpc=1.51.0 +version.io_grpc=1.76.2 # Maven artifacts. # Note, the actual name of each property matters (bazel build scripts depend on it). # It should be constructed the following way: # 1) Take full artifact id (including the group and classifier (if any) portions) and remove version portion. # 2) Replace all characters which are neither alphabetic nor digits with the underscore ('_') character -maven.com_google_api_grpc_proto_google_common_protos=com.google.api.grpc:proto-google-common-protos:2.11.0 -maven.com_google_api_grpc_grpc_google_common_protos=com.google.api.grpc:grpc-google-common-protos:2.11.0 -maven.com_google_auth_google_auth_library_oauth2_http=com.google.auth:google-auth-library-oauth2-http:1.13.0 -maven.com_google_auth_google_auth_library_credentials=com.google.auth:google-auth-library-credentials:1.13.0 +maven.com_google_api_grpc_proto_google_common_protos=com.google.api.grpc:proto-google-common-protos:2.63.2 +maven.com_google_api_grpc_grpc_google_common_protos=com.google.api.grpc:grpc-google-common-protos:2.63.2 +maven.com_google_auth_google_auth_library_oauth2_http=com.google.auth:google-auth-library-oauth2-http:1.42.1 +maven.com_google_auth_google_auth_library_credentials=com.google.auth:google-auth-library-credentials:1.42.1 +maven.io_opentelemetry_opentelemetry_api=io.opentelemetry:opentelemetry-api:1.51.0 +maven.io_opentelemetry_opentelemetry_context=io.opentelemetry:opentelemetry-context:1.51.0 maven.io_opencensus_opencensus_api=io.opencensus:opencensus-api:0.31.1 maven.io_opencensus_opencensus_contrib_grpc_metrics=io.opencensus:opencensus-contrib-grpc-metrics:0.31.1 maven.io_opencensus_opencensus_contrib_http_util=io.opencensus:opencensus-contrib-http-util:0.31.1 -maven.io_netty_netty_tcnative_boringssl_static=io.netty:netty-tcnative-boringssl-static:2.0.46.Final -maven.io_netty_netty_handler=io.netty:netty-handler:4.1.72.Final -maven.io_netty_netty_common=io.netty:netty-common:4.1.72.Final -maven.io_netty_netty_codec_socks=io.netty:netty-codec-socks:4.1.72.Final -maven.io_netty_netty_codec_http2=io.netty:netty-codec-http2:4.1.72.Final -maven.io_netty_netty_codec_http=io.netty:netty-codec-http:4.1.72.Final -maven.io_netty_netty_codec=io.netty:netty-codec:4.1.72.Final -maven.io_netty_netty_buffer=io.netty:netty-buffer:4.1.72.Final -maven.io_netty_netty_resolver=io.netty:netty-resolver:4.1.72.Final -maven.io_netty_netty_transport=io.netty:netty-transport:4.1.72.Final -maven.io_netty_netty_handler_proxy=io.netty:netty-handler-proxy:4.1.72.Final -maven.io_netty_netty_transport_native_unix_common=io.netty:netty-transport-native-unix-common:4.1.72.Final -maven.io_perfmark_perfmark_api=io.perfmark:perfmark-api:0.25.0 +maven.io_netty_netty_tcnative_boringssl_static=io.netty:netty-tcnative-boringssl-static:2.0.70.Final +maven.io_netty_netty_handler=io.netty:netty-handler:4.1.118.Final +maven.io_netty_netty_common=io.netty:netty-common:4.1.118.Final +maven.io_netty_netty_codec_socks=io.netty:netty-codec-socks:4.1.118.Final +maven.io_netty_netty_codec_http2=io.netty:netty-codec-http2:4.1.118.Final +maven.io_netty_netty_codec_http=io.netty:netty-codec-http:4.1.118.Final +maven.io_netty_netty_codec=io.netty:netty-codec:4.1.118.Final +maven.io_netty_netty_buffer=io.netty:netty-buffer:4.1.118.Final +maven.io_netty_netty_resolver=io.netty:netty-resolver:4.1.118.Final +maven.io_netty_netty_transport=io.netty:netty-transport:4.1.118.Final +maven.io_netty_netty_handler_proxy=io.netty:netty-handler-proxy:4.1.118.Final +maven.io_netty_netty_transport_native_unix_common=io.netty:netty-transport-native-unix-common:4.1.118.Final +maven.io_perfmark_perfmark_api=io.perfmark:perfmark-api:0.27.0 maven.org_apache_tomcat_annotations_api=org.apache.tomcat:annotations-api:6.0.53 -maven.com_google_code_gson_gson=com.google.code.gson:gson:2.10 -maven.com_google_guava_guava=com.google.guava:guava:31.1-jre -maven.com_google_guava_failureaccess=com.google.guava:failureaccess:1.0.1 -maven.org_apache_commons_commons_lang3=org.apache.commons:commons-lang3:3.8.1 +maven.com_google_code_gson_gson=com.google.code.gson:gson:2.12.1 +maven.com_google_guava_guava=com.google.guava:guava:32.1.3-jre +maven.com_google_guava_failureaccess=com.google.guava:failureaccess:1.0.2 +maven.org_apache_commons_commons_lang3=org.apache.commons:commons-lang3:3.17.0 maven.com_google_android_annotations=com.google.android:annotations:4.1.1.4 maven.com_google_code_findbugs_jsr305=com.google.code.findbugs:jsr305:3.0.2 -maven.com_google_errorprone_error_prone_annotations=com.google.errorprone:error_prone_annotations:2.11.0 -maven.com_google_j2objc_j2objc_annotations=com.google.j2objc:j2objc-annotations:1.3 -maven.com_google_auto_value_auto_value=com.google.auto.value:auto-value:1.10.1 -maven.com_google_auto_value_auto_value_annotations=com.google.auto.value:auto-value-annotations:1.10.1 -maven.com_google_api_api_common=com.google.api:api-common:2.3.1 -maven.org_threeten_threetenbp=org.threeten:threetenbp:1.6.4 -maven.com_google_api_grpc_grpc_google_iam_v1=com.google.api.grpc:grpc-google-iam-v1:1.4.0 -maven.com_google_api_grpc_proto_google_iam_v1=com.google.api.grpc:proto-google-iam-v1:1.4.0 -maven.com_google_http_client_google_http_client=com.google.http-client:google-http-client:1.42.3 -maven.com_google_http_client_google_http_client_gson=com.google.http-client:google-http-client-gson:1.42.3 -maven.org_codehaus_mojo_animal_sniffer_annotations=org.codehaus.mojo:animal-sniffer-annotations:1.18 +maven.com_google_errorprone_error_prone_annotations=com.google.errorprone:error_prone_annotations:2.38.0 +maven.com_google_j2objc_j2objc_annotations=com.google.j2objc:j2objc-annotations:2.8 +maven.com_google_auto_value_auto_value=com.google.auto.value:auto-value:1.11.0 +maven.com_google_auto_value_auto_value_annotations=com.google.auto.value:auto-value-annotations:1.11.0 +maven.com_google_api_api_common=com.google.api:api-common:2.55.2 +maven.org_threeten_threetenbp=org.threeten:threetenbp:1.7.0 +maven.com_google_api_grpc_grpc_google_iam_v1=com.google.api.grpc:grpc-google-iam-v1:1.58.2 +maven.com_google_api_grpc_proto_google_iam_v1=com.google.api.grpc:proto-google-iam-v1:1.58.2 +maven.com_google_http_client_google_http_client=com.google.http-client:google-http-client:1.47.1 +maven.com_google_http_client_google_http_client_gson=com.google.http-client:google-http-client-gson:1.47.1 +maven.org_codehaus_mojo_animal_sniffer_annotations=org.codehaus.mojo:animal-sniffer-annotations:1.24 maven.javax_annotation_javax_annotation_api=javax.annotation:javax.annotation-api:1.3.2 -maven.org_graalvm_sdk=org.graalvm.sdk:graal-sdk:22.3.0 +maven.org_graalvm_sdk=org.graalvm.sdk:nativeimage:24.1.2 +maven.org_slf4j_slf4j_api=org.slf4j:slf4j-api:2.0.16 +maven.com_google_protobuf_protobuf_java_util=com.google.protobuf:protobuf-java-util:3.25.5 # Testing maven artifacts maven.junit_junit=junit:junit:4.13.2 -maven.org_mockito_mockito_core=org.mockito:mockito-core:2.28.2 +maven.org_mockito_mockito_core=org.mockito:mockito-core:4.11.0 +maven.org_mockito_mockito_junit_jupiter=org.mockito:mockito-junit-jupiter:4.11.0 maven.org_hamcrest_hamcrest_core=org.hamcrest:hamcrest-core:1.3 -maven.com_google_truth_truth=com.google.truth:truth:1.1.2 +maven.com_google_truth_truth=com.google.truth:truth:1.4.4 maven.com_googlecode_java_diff_utils_diffutils=com.googlecode.java-diff-utils:diffutils:1.3.0 -maven.net_bytebuddy_byte_buddy=net.bytebuddy:byte-buddy:1.9.7 +maven.net_bytebuddy_byte_buddy=net.bytebuddy:byte-buddy:1.17.0 maven.org_objenesis_objenesis=org.objenesis:objenesis:2.6 +maven.org_junit_jupiter_junit_jupiter_api=org.junit.jupiter:junit-jupiter-api:5.11.4 +maven.org_junit_jupiter_junit_jupiter_params=org.junit.jupiter:junit-jupiter-params:5.11.4 +maven.io_opentelemetry_opentelemetry_sdk_testing=io.opentelemetry:opentelemetry-sdk-testing:1.51.0 +maven.io_opentelemetry_opentelemetry_sdk=io.opentelemetry:opentelemetry-sdk:1.51.0 +maven.io_opentelemetry_opentelemetry_sdk_common=io.opentelemetry:opentelemetry-sdk-common:1.51.0 +maven.io_opentelemetry_opentelemetry_sdk_metrics=io.opentelemetry:opentelemetry-sdk-metrics:1.51.0 +maven.com_google_guava_guava_testlib=com.google.guava:guava-testlib:32.1.3-jre diff --git a/gax-java/gax-bom/build.gradle b/gax-java/gax-bom/build.gradle deleted file mode 100644 index 8a9dcd7cf5..0000000000 --- a/gax-java/gax-bom/build.gradle +++ /dev/null @@ -1,81 +0,0 @@ -plugins { - id 'maven-publish' - id 'signing' -} - -archivesBaseName = 'gax-bom' - -project.version = "2.20.1" // {x-version-update:gax:current} - -def mavenJavaDir = "$buildDir/publications/mavenJava" -def mavenJavaBomOutputFile = file(mavenJavaDir + '/pom-default.xml') -def mavenJavaBomAscOutputFile = file(mavenJavaDir + '/pom-default.xml.asc') - -// Copy our pom.xml to the location where a generated POM would go -task copyPom() { - doLast { - new File(mavenJavaDir).mkdirs() - copy { - from 'pom.xml' - into mavenJavaDir - rename 'pom.xml', 'pom-default.xml' - } - } -} - -// We want to use our own pom.xml instead of the generated one, so we disable -// the pom.xml generation and have the publish tasks depend on `copyPom` instead. -tasks.whenTaskAdded { task -> - if (task.name == 'generatePomFileForMavenJavaPublication') { - task.enabled = false - } else if (task.name == 'publishMavenJavaPublicationToMavenLocal') { - task.dependsOn copyPom - } else if (task.name == 'publishMavenJavaPublicationToMavenRepository') { - task.dependsOn copyPom - } else if (task.name == 'publishMavenJavaPublicationToSonatypeRepository') { - task.dependsOn copyPom - } -} - -// We can't use the `publishing` section from the main build.gradle because -// we don't want all the Java artifacts, and we want to use our own pom.xml -// instead of the generated one. -publishing { - publications { - mavenJava(MavenPublication) { - version = project.version - artifact mavenJavaBomOutputFile - } - } - repositories { - maven { - url 'https://google.oss.sonatype.org/service/local/staging/deploy/maven2/' - credentials { - username = findProperty('ossrhUsername') - password = findProperty('ossrhPassword') - } - } - } -} - -signing { - required { gradle.taskGraph.hasTask ":${name}:publishToSonatype" } - if (project.hasProperty('signing.gnupg.executable')) { - useGpgCmd() - } - sign publishing.publications -} - -// Unlike other regular subprojects, pom.asc (signature file) generated by -// signing is not automatically picked up. It may be because gax-bom uses a -// pre-written pom.xml instead of using an auto-generated one. -// https://discuss.gradle.org/t/how-to-publish-artifacts-signatures-asc-files-using-maven-publish-plugin/7422 -task addPomAscFileToPublication { - onlyIf { mavenJavaBomAscOutputFile.exists() } - doLast { - publishing.publications.mavenJava(MavenPublication) { - artifact(mavenJavaBomAscOutputFile) { extension 'pom.asc' } - } - } -} -signMavenJavaPublication.finalizedBy addPomAscFileToPublication diff --git a/gax-java/gax-bom/pom.xml b/gax-java/gax-bom/pom.xml index 0af7a1e44b..30b46afe9b 100644 --- a/gax-java/gax-bom/pom.xml +++ b/gax-java/gax-bom/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.api gax-bom - 2.20.2-SNAPSHOT + 2.76.1-SNAPSHOT pom GAX (Google Api eXtensions) for Java (BOM) Google Api eXtensions for Java (BOM) @@ -11,7 +11,8 @@ com.google.cloud google-cloud-shared-config - 1.5.5 + 1.17.0 + @@ -32,7 +33,7 @@ - BSD + BSD-3-Clause https://github.com/googleapis/gax-java/blob/master/LICENSE @@ -42,34 +43,55 @@ com.google.api gax - 2.20.2-SNAPSHOT + 2.76.1-SNAPSHOT com.google.api gax - 2.20.2-SNAPSHOT + 2.76.1-SNAPSHOT + test-jar + testlib + + + com.google.api + gax + 2.76.1-SNAPSHOT testlib com.google.api gax-grpc - 2.20.2-SNAPSHOT + 2.76.1-SNAPSHOT com.google.api gax-grpc - 2.20.2-SNAPSHOT + 2.76.1-SNAPSHOT + test-jar + testlib + + + com.google.api + gax-grpc + 2.76.1-SNAPSHOT testlib com.google.api gax-httpjson - 0.105.2-SNAPSHOT + 2.76.1-SNAPSHOT + + + com.google.api + gax-httpjson + 2.76.1-SNAPSHOT + test-jar + testlib com.google.api gax-httpjson - 0.105.2-SNAPSHOT + 2.76.1-SNAPSHOT testlib diff --git a/gax-java/gax-grpc/BUILD.bazel b/gax-java/gax-grpc/BUILD.bazel index f1dfe02fc6..be224ff3f8 100644 --- a/gax-java/gax-grpc/BUILD.bazel +++ b/gax-java/gax-grpc/BUILD.bazel @@ -35,8 +35,9 @@ _COMPILE_DEPS = [ ] _TEST_COMPILE_DEPS = [ - "@junit_junit//jar", + "@org_junit_jupiter_junit_jupiter_api//jar", "@org_mockito_mockito_core//jar", + "@org_mockito_mockito_junit_jupiter//jar", "@com_google_truth_truth//jar", "@io_grpc_grpc_java//core:inprocess", "@com_google_api_grpc_grpc_google_common_protos//jar", diff --git a/gax-java/gax-grpc/build.gradle b/gax-java/gax-grpc/build.gradle deleted file mode 100644 index 5c5c868076..0000000000 --- a/gax-java/gax-grpc/build.gradle +++ /dev/null @@ -1,50 +0,0 @@ -archivesBaseName = 'gax-grpc' - -// TODO: Populate this from dependencies.properties version property (for proper Gradle-Bazel sync) -project.version = "2.20.1" // {x-version-update:gax-grpc:current} - -dependencies { - api(project(':gax'), - libraries['maven.com_google_api_api_common'], - libraries['maven.com_google_api_grpc_proto_google_common_protos'], - libraries['maven.com_google_auth_google_auth_library_credentials'], - libraries['maven.com_google_guava_guava'], - libraries['maven.io_grpc_grpc_api'], - libraries['maven.org_threeten_threetenbp']) - - implementation(libraries['maven.com_google_auth_google_auth_library_oauth2_http'], - libraries['maven.com_google_code_findbugs_jsr305'], - libraries['maven.io_grpc_grpc_alts'], - libraries['maven.io_grpc_grpc_auth'], - libraries['maven.io_grpc_grpc_netty_shaded'], - libraries['maven.io_grpc_grpc_protobuf'], - libraries['maven.io_grpc_grpc_stub']) - - runtimeOnly libraries['maven.io_grpc_grpc_googleapis'] - - compileOnly(libraries['maven.com_google_auto_value_auto_value'], - libraries['maven.org_graalvm_sdk']) - - testImplementation( project(':gax').sourceSets.test.output, - libraries['maven.junit_junit'], - libraries['maven.org_mockito_mockito_core'], - libraries['maven.com_google_truth_truth'], - libraries['maven.com_google_api_grpc_grpc_google_common_protos']) - - annotationProcessor libraries['maven.com_google_auto_value_auto_value'] - - shadowNoGuava libraries['maven.com_google_guava_guava'], - libraries['maven.io_grpc_grpc_stub'], - libraries['maven.io_grpc_grpc_protobuf'] -} - -jar { - manifest { - attributes 'Specification-Title': project.name, - 'Specification-Version': project.version, - 'Specification-Vendor': libraryVendor, - 'Implementation-Title': project.name, - 'Implementation-Version': project.version, - 'Implementation-Vendor': libraryVendor - } -} diff --git a/gax-java/gax-grpc/clirr-ignored-differences.xml b/gax-java/gax-grpc/clirr-ignored-differences.xml new file mode 100644 index 0000000000..8b595b0a85 --- /dev/null +++ b/gax-java/gax-grpc/clirr-ignored-differences.xml @@ -0,0 +1,10 @@ + + + + + + 7013 + com/google/api/gax/grpc/GrpcTransportChannel + boolean isDirectPath() + + diff --git a/gax-java/gax-grpc/pom.xml b/gax-java/gax-grpc/pom.xml index 7f9e8dae30..83da91ef3d 100644 --- a/gax-java/gax-grpc/pom.xml +++ b/gax-java/gax-grpc/pom.xml @@ -3,7 +3,7 @@ 4.0.0 gax-grpc - 2.20.2-SNAPSHOT + 2.76.1-SNAPSHOT jar GAX (Google Api eXtensions) for Java (gRPC) Google Api eXtensions for Java (gRPC) @@ -11,7 +11,7 @@ com.google.api gax-parent - 2.20.2-SNAPSHOT + 2.76.1-SNAPSHOT @@ -39,6 +39,10 @@ io.grpc grpc-api + + io.grpc + grpc-inprocess + org.threeten threetenbp @@ -80,7 +84,7 @@ org.graalvm.sdk - graal-sdk + nativeimage provided @@ -88,8 +92,19 @@ auto-value-annotations provided + + + org.slf4j + slf4j-api + true + + + io.grpc + grpc-s2a + test + com.google.api.grpc grpc-google-common-protos @@ -124,6 +139,30 @@ + + org.apache.maven.plugins + maven-surefire-plugin + + + !InstantiatingGrpcChannelProviderTest#testLogDirectPathMisconfig_AttemptDirectPathNotSetAndAttemptDirectPathXdsSetViaEnv_warns + + + + + envVarTest + + + + org.apache.maven.plugins + maven-surefire-plugin + + InstantiatingGrpcChannelProviderTest#testLogDirectPathMisconfig_AttemptDirectPathNotSetAndAttemptDirectPathXdsSetViaEnv_warns + + + + + + \ No newline at end of file diff --git a/gax-java/gax-grpc/src/main/java/com/google/api/gax/grpc/CallOptionsUtil.java b/gax-java/gax-grpc/src/main/java/com/google/api/gax/grpc/CallOptionsUtil.java index f36da0d4d9..9d6e85bdaa 100644 --- a/gax-java/gax-grpc/src/main/java/com/google/api/gax/grpc/CallOptionsUtil.java +++ b/gax-java/gax-grpc/src/main/java/com/google/api/gax/grpc/CallOptionsUtil.java @@ -29,6 +29,7 @@ */ package com.google.api.gax.grpc; +import com.google.api.gax.rpc.internal.Headers; import com.google.common.base.Preconditions; import com.google.common.collect.ImmutableMap; import io.grpc.CallOptions; @@ -45,7 +46,7 @@ class CallOptionsUtil { "gax_dynamic_headers", Collections., String>emptyMap()); // this is the header name, it is transferred over the wire static Metadata.Key REQUEST_PARAMS_HEADER_KEY = - Metadata.Key.of("x-goog-request-params", Metadata.ASCII_STRING_MARSHALLER); + Metadata.Key.of(Headers.DYNAMIC_ROUTING_HEADER_KEY, Metadata.ASCII_STRING_MARSHALLER); private static final CallOptions.Key METADATA_HANDLER_CALL_OPTION_KEY = CallOptions.Key.createWithDefault("gax_metadata_handler", null); diff --git a/gax-java/gax-grpc/src/main/java/com/google/api/gax/grpc/ChannelPool.java b/gax-java/gax-grpc/src/main/java/com/google/api/gax/grpc/ChannelPool.java index 5215b4d9bc..74e1751db9 100644 --- a/gax-java/gax-grpc/src/main/java/com/google/api/gax/grpc/ChannelPool.java +++ b/gax-java/gax-grpc/src/main/java/com/google/api/gax/grpc/ChannelPool.java @@ -30,6 +30,7 @@ package com.google.api.gax.grpc; import com.google.api.core.InternalApi; +import com.google.api.gax.core.FixedExecutorProvider; import com.google.common.annotations.VisibleForTesting; import com.google.common.base.Preconditions; import com.google.common.collect.ImmutableList; @@ -45,15 +46,17 @@ import java.io.IOException; import java.util.ArrayList; import java.util.List; +import java.util.concurrent.CancellationException; import java.util.concurrent.Executors; import java.util.concurrent.ScheduledExecutorService; +import java.util.concurrent.ScheduledFuture; import java.util.concurrent.TimeUnit; import java.util.concurrent.atomic.AtomicBoolean; import java.util.concurrent.atomic.AtomicInteger; import java.util.concurrent.atomic.AtomicReference; import java.util.logging.Level; import java.util.logging.Logger; -import org.threeten.bp.Duration; +import javax.annotation.Nullable; /** * A {@link ManagedChannel} that will send requests round-robin via a set of channels. @@ -66,21 +69,32 @@ *

        Package-private for internal use. */ class ChannelPool extends ManagedChannel { - private static final Logger LOG = Logger.getLogger(ChannelPool.class.getName()); - private static final Duration REFRESH_PERIOD = Duration.ofMinutes(50); + @VisibleForTesting static final Logger LOG = Logger.getLogger(ChannelPool.class.getName()); + private static final java.time.Duration REFRESH_PERIOD = java.time.Duration.ofMinutes(50); private final ChannelPoolSettings settings; private final ChannelFactory channelFactory; - private final ScheduledExecutorService executor; + private final FixedExecutorProvider backgroundExecutorProvider; + + private ScheduledFuture refreshFuture = null; + private ScheduledFuture resizeFuture = null; private final Object entryWriteLock = new Object(); @VisibleForTesting final AtomicReference> entries = new AtomicReference<>(); private final AtomicInteger indexTicker = new AtomicInteger(); private final String authority; - static ChannelPool create(ChannelPoolSettings settings, ChannelFactory channelFactory) + static ChannelPool create( + ChannelPoolSettings settings, + ChannelFactory channelFactory, + @Nullable ScheduledExecutorService backgroundExecutor) throws IOException { - return new ChannelPool(settings, channelFactory, Executors.newSingleThreadScheduledExecutor()); + + FixedExecutorProvider executorProvider = + backgroundExecutor == null + ? FixedExecutorProvider.create(Executors.newSingleThreadScheduledExecutor(), true) + : FixedExecutorProvider.create(backgroundExecutor, false); + return new ChannelPool(settings, channelFactory, executorProvider); } /** @@ -88,16 +102,17 @@ static ChannelPool create(ChannelPoolSettings settings, ChannelFactory channelFa * * @param settings options for controling the ChannelPool sizing behavior * @param channelFactory method to create the channels - * @param executor periodically refreshes the channels + * @param executorProvider provides the executor that periodically refreshes the channels */ @VisibleForTesting ChannelPool( ChannelPoolSettings settings, ChannelFactory channelFactory, - ScheduledExecutorService executor) + FixedExecutorProvider executorProvider) throws IOException { this.settings = settings; this.channelFactory = channelFactory; + this.backgroundExecutorProvider = executorProvider; ImmutableList.Builder initialListBuilder = ImmutableList.builder(); @@ -107,21 +122,26 @@ static ChannelPool create(ChannelPoolSettings settings, ChannelFactory channelFa entries.set(initialListBuilder.build()); authority = entries.get().get(0).channel.authority(); - this.executor = executor; if (!settings.isStaticSize()) { - executor.scheduleAtFixedRate( - this::resizeSafely, - ChannelPoolSettings.RESIZE_INTERVAL.getSeconds(), - ChannelPoolSettings.RESIZE_INTERVAL.getSeconds(), - TimeUnit.SECONDS); + resizeFuture = + backgroundExecutorProvider + .getExecutor() + .scheduleAtFixedRate( + this::resizeSafely, + ChannelPoolSettings.RESIZE_INTERVAL.getSeconds(), + ChannelPoolSettings.RESIZE_INTERVAL.getSeconds(), + TimeUnit.SECONDS); } if (settings.isPreemptiveRefreshEnabled()) { - executor.scheduleAtFixedRate( - this::refreshSafely, - REFRESH_PERIOD.getSeconds(), - REFRESH_PERIOD.getSeconds(), - TimeUnit.SECONDS); + refreshFuture = + backgroundExecutorProvider + .getExecutor() + .scheduleAtFixedRate( + this::refreshSafely, + REFRESH_PERIOD.getSeconds(), + REFRESH_PERIOD.getSeconds(), + TimeUnit.SECONDS); } } @@ -150,14 +170,27 @@ Channel getChannel(int affinity) { /** {@inheritDoc} */ @Override public ManagedChannel shutdown() { + LOG.fine("Initiating graceful shutdown due to explicit request"); + + // Resize and refresh tasks can block on channel priming. We don't need + // to wait for the channels to be ready since we're shutting down the + // pool. Allowing interrupt to speed it up. + if (resizeFuture != null) { + resizeFuture.cancel(true); + } + if (refreshFuture != null) { + refreshFuture.cancel(true); + } + List localEntries = entries.get(); for (Entry entry : localEntries) { entry.channel.shutdown(); } - if (executor != null) { - // shutdownNow will cancel scheduled tasks - executor.shutdownNow(); + + if (backgroundExecutorProvider.shouldAutoClose()) { + backgroundExecutorProvider.getExecutor().shutdown(); } + return this; } @@ -170,7 +203,7 @@ public boolean isShutdown() { return false; } } - return executor == null || executor.isShutdown(); + return true; } /** {@inheritDoc} */ @@ -182,19 +215,28 @@ public boolean isTerminated() { return false; } } - - return executor == null || executor.isTerminated(); + return true; } /** {@inheritDoc} */ @Override public ManagedChannel shutdownNow() { + LOG.fine("Initiating immediate shutdown due to explicit request"); + + if (resizeFuture != null) { + resizeFuture.cancel(true); + } + if (refreshFuture != null) { + refreshFuture.cancel(true); + } + List localEntries = entries.get(); for (Entry entry : localEntries) { entry.channel.shutdownNow(); } - if (executor != null) { - executor.shutdownNow(); + + if (backgroundExecutorProvider.shouldAutoClose()) { + backgroundExecutorProvider.getExecutor().shutdownNow(); } return this; } @@ -211,10 +253,6 @@ public boolean awaitTermination(long timeout, TimeUnit unit) throws InterruptedE } entry.channel.awaitTermination(awaitTimeNanos, TimeUnit.NANOSECONDS); } - if (executor != null) { - long awaitTimeNanos = endTimeNanos - System.nanoTime(); - executor.awaitTermination(awaitTimeNanos, TimeUnit.NANOSECONDS); - } return isTerminated(); } @@ -354,6 +392,7 @@ void refresh() { // - then thread2 will shut down channel that thread1 will put back into circulation (after it // replaces the list) synchronized (entryWriteLock) { + LOG.fine("Refreshing all channels"); ArrayList newEntries = new ArrayList<>(entries.get()); for (int i = 0; i < newEntries.size(); i++) { @@ -414,9 +453,25 @@ private Entry getEntry(int affinity) { } /** Bundles a gRPC {@link ManagedChannel} with some usage accounting. */ - private static class Entry { + static class Entry { private final ManagedChannel channel; - private final AtomicInteger outstandingRpcs = new AtomicInteger(0); + + /** + * The primary purpose of keeping a count for outstanding RPCs is to track when a channel is + * safe to close. In grpc, initialization & starting of rpcs is split between 2 methods: + * Channel#newCall() and ClientCall#start. gRPC already has a mechanism to safely close channels + * that have rpcs that have been started. However, it does not protect calls that have been + * created but not started. In the sequence: Channel#newCall() Channel#shutdown() + * ClientCall#Start(), gRpc will error out the call telling the caller that the channel is + * shutdown. + * + *

        Hence, the increment of outstanding RPCs has to happen when the ClientCall is initialized, + * as part of Channel#newCall(), not after the ClientCall is started. The decrement of + * outstanding RPCs has to happen when the ClientCall is closed or the ClientCall failed to + * start. + */ + @VisibleForTesting final AtomicInteger outstandingRpcs = new AtomicInteger(0); + private final AtomicInteger maxOutstanding = new AtomicInteger(); // Flag that the channel should be closed once all of the outstanding RPC complete. @@ -463,7 +518,7 @@ private boolean retain() { private void release() { int newCount = outstandingRpcs.decrementAndGet(); if (newCount < 0) { - throw new IllegalStateException("Bug: reference count is negative!: " + newCount); + LOG.log(Level.WARNING, "Bug! Reference count is negative (" + newCount + ")!"); } // Must check outstandingRpcs after shutdownRequested (in reverse order of retain()) to ensure @@ -517,7 +572,10 @@ public ClientCall newCall( /** ClientCall wrapper that makes sure to decrement the outstanding RPC count on completion. */ static class ReleasingClientCall extends SimpleForwardingClientCall { + @Nullable private CancellationException cancellationException; final Entry entry; + private final AtomicBoolean wasClosed = new AtomicBoolean(); + private final AtomicBoolean wasReleased = new AtomicBoolean(); public ReleasingClientCall(ClientCall delegate, Entry entry) { super(delegate); @@ -526,23 +584,51 @@ public ReleasingClientCall(ClientCall delegate, Entry entry) { @Override public void start(Listener responseListener, Metadata headers) { + if (cancellationException != null) { + throw new IllegalStateException("Call is already cancelled", cancellationException); + } try { super.start( new SimpleForwardingClientCallListener(responseListener) { @Override public void onClose(Status status, Metadata trailers) { + if (!wasClosed.compareAndSet(false, true)) { + LOG.log( + Level.WARNING, + "Call is being closed more than once. Please make sure that onClose() is not being manually called."); + return; + } try { super.onClose(status, trailers); } finally { - entry.release(); + if (wasReleased.compareAndSet(false, true)) { + entry.release(); + } else { + LOG.log( + Level.WARNING, + "Entry was released before the call is closed. This may be due to an exception on start of the call."); + } } } }, headers); } catch (Exception e) { // In case start failed, make sure to release - entry.release(); + if (wasReleased.compareAndSet(false, true)) { + entry.release(); + } else { + LOG.log( + Level.WARNING, + "The entry is already released. This indicates that onClose() has already been called previously"); + } + throw e; } } + + @Override + public void cancel(@Nullable String message, @Nullable Throwable cause) { + this.cancellationException = new CancellationException(message); + super.cancel(message, cause); + } } } diff --git a/gax-java/gax-grpc/src/main/java/com/google/api/gax/grpc/ChannelPoolSettings.java b/gax-java/gax-grpc/src/main/java/com/google/api/gax/grpc/ChannelPoolSettings.java index 19e62782a8..ebdc48cdd6 100644 --- a/gax-java/gax-grpc/src/main/java/com/google/api/gax/grpc/ChannelPoolSettings.java +++ b/gax-java/gax-grpc/src/main/java/com/google/api/gax/grpc/ChannelPoolSettings.java @@ -57,6 +57,7 @@ public abstract class ChannelPoolSettings { /** How often to check and possibly resize the {@link ChannelPool}. */ static final Duration RESIZE_INTERVAL = Duration.ofMinutes(1); + /** The maximum number of channels that can be added or removed at a time. */ static final int MAX_RESIZE_DELTA = 2; diff --git a/gax-java/gax-grpc/src/main/java/com/google/api/gax/grpc/GrpcCallContext.java b/gax-java/gax-grpc/src/main/java/com/google/api/gax/grpc/GrpcCallContext.java index 5f33c36448..7ff7c54de6 100644 --- a/gax-java/gax-grpc/src/main/java/com/google/api/gax/grpc/GrpcCallContext.java +++ b/gax-java/gax-grpc/src/main/java/com/google/api/gax/grpc/GrpcCallContext.java @@ -29,16 +29,26 @@ */ package com.google.api.gax.grpc; +import static com.google.api.gax.util.TimeConversionUtils.toJavaTimeDuration; +import static com.google.api.gax.util.TimeConversionUtils.toThreetenDuration; + import com.google.api.core.BetaApi; +import com.google.api.core.InternalApi; +import com.google.api.core.ObsoleteApi; import com.google.api.gax.retrying.RetrySettings; import com.google.api.gax.rpc.ApiCallContext; +import com.google.api.gax.rpc.ApiExceptionFactory; +import com.google.api.gax.rpc.EndpointContext; import com.google.api.gax.rpc.StatusCode; import com.google.api.gax.rpc.TransportChannel; +import com.google.api.gax.rpc.UnauthenticatedException; +import com.google.api.gax.rpc.UnavailableException; import com.google.api.gax.rpc.internal.ApiCallContextOptions; import com.google.api.gax.rpc.internal.Headers; import com.google.api.gax.tracing.ApiTracer; import com.google.api.gax.tracing.BaseApiTracer; import com.google.auth.Credentials; +import com.google.auth.Retryable; import com.google.common.base.Preconditions; import com.google.common.collect.ImmutableMap; import com.google.common.collect.ImmutableSet; @@ -47,14 +57,15 @@ import io.grpc.Channel; import io.grpc.Deadline; import io.grpc.Metadata; +import io.grpc.Status; import io.grpc.auth.MoreCallCredentials; +import java.io.IOException; import java.util.List; import java.util.Map; import java.util.Objects; import java.util.Set; import javax.annotation.Nonnull; import javax.annotation.Nullable; -import org.threeten.bp.Duration; /** * GrpcCallContext encapsulates context data used to make a grpc call. @@ -66,22 +77,31 @@ */ @BetaApi("Reference ApiCallContext instead - this class is likely to experience breaking changes") public final class GrpcCallContext implements ApiCallContext { - static final CallOptions.Key TRACER_KEY = CallOptions.Key.create("gax.tracer"); + private static final GrpcStatusCode UNAUTHENTICATED_STATUS_CODE = + GrpcStatusCode.of(Status.Code.UNAUTHENTICATED); + + // This field is made public for handwritten libraries to easily access the tracer from + // CallOptions + public static final CallOptions.Key TRACER_KEY = CallOptions.Key.create("gax.tracer"); private final Channel channel; + @Nullable private final Credentials credentials; private final CallOptions callOptions; - @Nullable private final Duration timeout; - @Nullable private final Duration streamWaitTimeout; - @Nullable private final Duration streamIdleTimeout; + @Nullable private final java.time.Duration timeout; + @Nullable private final java.time.Duration streamWaitTimeout; + @Nullable private final java.time.Duration streamIdleTimeout; @Nullable private final Integer channelAffinity; @Nullable private final RetrySettings retrySettings; @Nullable private final ImmutableSet retryableCodes; private final ImmutableMap> extraHeaders; private final ApiCallContextOptions options; + private final EndpointContext endpointContext; + private final boolean isDirectPath; /** Returns an empty instance with a null channel and default {@link CallOptions}. */ public static GrpcCallContext createDefault() { return new GrpcCallContext( + null, null, CallOptions.DEFAULT, null, @@ -91,13 +111,16 @@ public static GrpcCallContext createDefault() { ImmutableMap.>of(), ApiCallContextOptions.getDefaultOptions(), null, - null); + null, + null, + false); } /** Returns an instance with the given channel and {@link CallOptions}. */ public static GrpcCallContext of(Channel channel, CallOptions callOptions) { return new GrpcCallContext( channel, + null, callOptions, null, null, @@ -106,22 +129,31 @@ public static GrpcCallContext of(Channel channel, CallOptions callOptions) { ImmutableMap.>of(), ApiCallContextOptions.getDefaultOptions(), null, - null); + null, + null, + false); } private GrpcCallContext( Channel channel, + @Nullable Credentials credentials, CallOptions callOptions, - @Nullable Duration timeout, - @Nullable Duration streamWaitTimeout, - @Nullable Duration streamIdleTimeout, + @Nullable java.time.Duration timeout, + @Nullable java.time.Duration streamWaitTimeout, + @Nullable java.time.Duration streamIdleTimeout, @Nullable Integer channelAffinity, ImmutableMap> extraHeaders, ApiCallContextOptions options, @Nullable RetrySettings retrySettings, - @Nullable Set retryableCodes) { + @Nullable Set retryableCodes, + @Nullable EndpointContext endpointContext, + boolean isDirectPath) { this.channel = channel; - this.callOptions = Preconditions.checkNotNull(callOptions); + this.credentials = credentials; + Preconditions.checkNotNull(callOptions); + // CallCredentials is stripped from CallOptions because CallCredentials are attached + // to ChannelCredentials in DirectPath flows. Adding it again would duplicate the headers. + this.callOptions = isDirectPath ? callOptions.withCallCredentials(null) : callOptions; this.timeout = timeout; this.streamWaitTimeout = streamWaitTimeout; this.streamIdleTimeout = streamIdleTimeout; @@ -130,6 +162,11 @@ private GrpcCallContext( this.options = Preconditions.checkNotNull(options); this.retrySettings = retrySettings; this.retryableCodes = retryableCodes == null ? null : ImmutableSet.copyOf(retryableCodes); + // Attempt to create an empty, non-functioning EndpointContext by default. The client will have + // a valid EndpointContext with user configurations after the client has been initialized. + this.endpointContext = + endpointContext == null ? EndpointContext.getDefaultInstance() : endpointContext; + this.isDirectPath = isDirectPath; } /** @@ -158,7 +195,20 @@ public GrpcCallContext nullToSelf(ApiCallContext inputContext) { public GrpcCallContext withCredentials(Credentials newCredentials) { Preconditions.checkNotNull(newCredentials); CallCredentials callCredentials = MoreCallCredentials.from(newCredentials); - return withCallOptions(callOptions.withCallCredentials(callCredentials)); + return new GrpcCallContext( + channel, + newCredentials, + callOptions.withCallCredentials(callCredentials), + timeout, + streamWaitTimeout, + streamIdleTimeout, + channelAffinity, + extraHeaders, + options, + retrySettings, + retryableCodes, + endpointContext, + isDirectPath); } @Override @@ -169,11 +219,50 @@ public GrpcCallContext withTransportChannel(TransportChannel inputChannel) { "Expected GrpcTransportChannel, got " + inputChannel.getClass().getName()); } GrpcTransportChannel transportChannel = (GrpcTransportChannel) inputChannel; - return withChannel(transportChannel.getChannel()); + return new GrpcCallContext( + transportChannel.getChannel(), + credentials, + callOptions, + timeout, + streamWaitTimeout, + streamIdleTimeout, + channelAffinity, + extraHeaders, + options, + retrySettings, + retryableCodes, + endpointContext, + transportChannel.isDirectPath()); + } + + @Override + public GrpcCallContext withEndpointContext(EndpointContext endpointContext) { + Preconditions.checkNotNull(endpointContext); + return new GrpcCallContext( + channel, + credentials, + callOptions, + timeout, + streamWaitTimeout, + streamIdleTimeout, + channelAffinity, + extraHeaders, + options, + retrySettings, + retryableCodes, + endpointContext, + isDirectPath); } + /** This method is obsolete. Use {@link #withTimeoutDuration(java.time.Duration)} instead. */ @Override - public GrpcCallContext withTimeout(@Nullable Duration timeout) { + @ObsoleteApi("Use withTimeoutDuration(java.time.Duration) instead") + public GrpcCallContext withTimeout(@Nullable org.threeten.bp.Duration timeout) { + return withTimeoutDuration(toJavaTimeDuration(timeout)); + } + + @Override + public GrpcCallContext withTimeoutDuration(@Nullable java.time.Duration timeout) { // Default RetrySettings use 0 for RPC timeout. Treat that as disabled timeouts. if (timeout != null && (timeout.isZero() || timeout.isNegative())) { timeout = null; @@ -186,6 +275,7 @@ public GrpcCallContext withTimeout(@Nullable Duration timeout) { return new GrpcCallContext( channel, + credentials, callOptions, timeout, streamWaitTimeout, @@ -194,24 +284,47 @@ public GrpcCallContext withTimeout(@Nullable Duration timeout) { extraHeaders, options, retrySettings, - retryableCodes); + retryableCodes, + endpointContext, + isDirectPath); + } + + /** This method is obsolete. Use {@link #getTimeoutDuration()} instead. */ + @Nullable + @Override + @ObsoleteApi("Use getTimeoutDuration() instead") + public org.threeten.bp.Duration getTimeout() { + return toThreetenDuration(getTimeoutDuration()); } @Nullable @Override - public Duration getTimeout() { + public java.time.Duration getTimeoutDuration() { return timeout; } + /** + * This method is obsolete. Use {@link #withStreamWaitTimeoutDuration(java.time.Duration)} + * instead. + */ @Override - public GrpcCallContext withStreamWaitTimeout(@Nullable Duration streamWaitTimeout) { + @ObsoleteApi("Use withStreamWaitTimeoutDuration(java.time.Duration) instead") + public GrpcCallContext withStreamWaitTimeout( + @Nullable org.threeten.bp.Duration streamWaitTimeout) { + return withStreamWaitTimeoutDuration(toJavaTimeDuration(streamWaitTimeout)); + } + + @Override + public GrpcCallContext withStreamWaitTimeoutDuration( + @Nullable java.time.Duration streamWaitTimeout) { if (streamWaitTimeout != null) { Preconditions.checkArgument( - streamWaitTimeout.compareTo(Duration.ZERO) >= 0, "Invalid timeout: < 0 s"); + streamWaitTimeout.compareTo(java.time.Duration.ZERO) >= 0, "Invalid timeout: < 0 s"); } return new GrpcCallContext( channel, + credentials, callOptions, timeout, streamWaitTimeout, @@ -220,18 +333,33 @@ public GrpcCallContext withStreamWaitTimeout(@Nullable Duration streamWaitTimeou extraHeaders, options, retrySettings, - retryableCodes); + retryableCodes, + endpointContext, + isDirectPath); } + /** + * This method is obsolete. Use {@link #withStreamIdleTimeoutDuration(java.time.Duration)} + * instead. + */ @Override - public GrpcCallContext withStreamIdleTimeout(@Nullable Duration streamIdleTimeout) { + @ObsoleteApi("Use withStreamIdleTimeoutDuration(java.time.Duration) instead") + public GrpcCallContext withStreamIdleTimeout( + @Nullable org.threeten.bp.Duration streamIdleTimeout) { + return withStreamIdleTimeoutDuration(toJavaTimeDuration(streamIdleTimeout)); + } + + @Override + public GrpcCallContext withStreamIdleTimeoutDuration( + @Nullable java.time.Duration streamIdleTimeout) { if (streamIdleTimeout != null) { Preconditions.checkArgument( - streamIdleTimeout.compareTo(Duration.ZERO) >= 0, "Invalid timeout: < 0 s"); + streamIdleTimeout.compareTo(java.time.Duration.ZERO) >= 0, "Invalid timeout: < 0 s"); } return new GrpcCallContext( channel, + credentials, callOptions, timeout, streamWaitTimeout, @@ -240,13 +368,16 @@ public GrpcCallContext withStreamIdleTimeout(@Nullable Duration streamIdleTimeou extraHeaders, options, retrySettings, - retryableCodes); + retryableCodes, + endpointContext, + isDirectPath); } @BetaApi("The surface for channel affinity is not stable yet and may change in the future.") public GrpcCallContext withChannelAffinity(@Nullable Integer affinity) { return new GrpcCallContext( channel, + credentials, callOptions, timeout, streamWaitTimeout, @@ -255,7 +386,9 @@ public GrpcCallContext withChannelAffinity(@Nullable Integer affinity) { extraHeaders, options, retrySettings, - retryableCodes); + retryableCodes, + endpointContext, + isDirectPath); } @BetaApi("The surface for extra headers is not stable yet and may change in the future.") @@ -266,6 +399,7 @@ public GrpcCallContext withExtraHeaders(Map> extraHeaders) Headers.mergeHeaders(this.extraHeaders, extraHeaders); return new GrpcCallContext( channel, + credentials, callOptions, timeout, streamWaitTimeout, @@ -274,7 +408,9 @@ public GrpcCallContext withExtraHeaders(Map> extraHeaders) newExtraHeaders, options, retrySettings, - retryableCodes); + retryableCodes, + endpointContext, + isDirectPath); } @Override @@ -286,6 +422,7 @@ public RetrySettings getRetrySettings() { public GrpcCallContext withRetrySettings(RetrySettings retrySettings) { return new GrpcCallContext( channel, + credentials, callOptions, timeout, streamWaitTimeout, @@ -294,7 +431,9 @@ public GrpcCallContext withRetrySettings(RetrySettings retrySettings) { extraHeaders, options, retrySettings, - retryableCodes); + retryableCodes, + endpointContext, + isDirectPath); } @Override @@ -306,6 +445,7 @@ public Set getRetryableCodes() { public GrpcCallContext withRetryableCodes(Set retryableCodes) { return new GrpcCallContext( channel, + credentials, callOptions, timeout, streamWaitTimeout, @@ -314,7 +454,9 @@ public GrpcCallContext withRetryableCodes(Set retryableCodes) { extraHeaders, options, retrySettings, - retryableCodes); + retryableCodes, + endpointContext, + isDirectPath); } @Override @@ -329,6 +471,11 @@ public ApiCallContext merge(ApiCallContext inputCallContext) { } GrpcCallContext grpcCallContext = (GrpcCallContext) inputCallContext; + Credentials newCredentials = grpcCallContext.credentials; + if (newCredentials == null) { + newCredentials = credentials; + } + Channel newChannel = grpcCallContext.channel; if (newChannel == null) { newChannel = channel; @@ -339,6 +486,8 @@ public ApiCallContext merge(ApiCallContext inputCallContext) { newDeadline = callOptions.getDeadline(); } + boolean newIsDirectPath = grpcCallContext.isDirectPath; + CallCredentials newCallCredentials = grpcCallContext.callOptions.getCredentials(); if (newCallCredentials == null) { newCallCredentials = callOptions.getCredentials(); @@ -349,17 +498,17 @@ public ApiCallContext merge(ApiCallContext inputCallContext) { newTracer = callOptions.getOption(TRACER_KEY); } - Duration newTimeout = grpcCallContext.timeout; + java.time.Duration newTimeout = grpcCallContext.timeout; if (newTimeout == null) { newTimeout = timeout; } - Duration newStreamWaitTimeout = grpcCallContext.streamWaitTimeout; + java.time.Duration newStreamWaitTimeout = grpcCallContext.streamWaitTimeout; if (newStreamWaitTimeout == null) { newStreamWaitTimeout = streamWaitTimeout; } - Duration newStreamIdleTimeout = grpcCallContext.streamIdleTimeout; + java.time.Duration newStreamIdleTimeout = grpcCallContext.streamIdleTimeout; if (newStreamIdleTimeout == null) { newStreamIdleTimeout = streamIdleTimeout; } @@ -394,8 +543,11 @@ public ApiCallContext merge(ApiCallContext inputCallContext) { newCallOptions = newCallOptions.withOption(TRACER_KEY, newTracer); } + // The EndpointContext is not updated as there should be no reason for a user + // to update this. return new GrpcCallContext( newChannel, + newCredentials, newCallOptions, newTimeout, newStreamWaitTimeout, @@ -404,7 +556,9 @@ public ApiCallContext merge(ApiCallContext inputCallContext) { newExtraHeaders, newOptions, newRetrySettings, - newRetryableCodes); + newRetryableCodes, + endpointContext, + newIsDirectPath); } /** The {@link Channel} set on this context. */ @@ -417,25 +571,41 @@ public CallOptions getCallOptions() { return callOptions; } + /** This method is obsolete. Use {@link #getStreamWaitTimeoutDuration()} instead. */ + @Override + @Nullable + @ObsoleteApi("Use getStreamWaitTimeoutDuration() instead") + public org.threeten.bp.Duration getStreamWaitTimeout() { + return toThreetenDuration(getStreamWaitTimeoutDuration()); + } + /** * The stream wait timeout set for this context. * - * @see ApiCallContext#withStreamWaitTimeout(Duration) + * @see ApiCallContext#withStreamWaitTimeoutDuration(java.time.Duration) */ @Override @Nullable - public Duration getStreamWaitTimeout() { + public java.time.Duration getStreamWaitTimeoutDuration() { return streamWaitTimeout; } + /** This method is obsolete. Use {@link #getStreamIdleTimeoutDuration()} instead. */ + @Override + @Nullable + @ObsoleteApi("Use getStreamIdleTimeoutDuration() instead") + public org.threeten.bp.Duration getStreamIdleTimeout() { + return toThreetenDuration(getStreamIdleTimeoutDuration()); + } + /** * The stream idle timeout set for this context. * - * @see ApiCallContext#withStreamIdleTimeout(Duration) + * @see ApiCallContext#withStreamIdleTimeoutDuration(java.time.Duration) */ @Override @Nullable - public Duration getStreamIdleTimeout() { + public java.time.Duration getStreamIdleTimeoutDuration() { return streamIdleTimeout; } @@ -452,10 +622,15 @@ public Map> getExtraHeaders() { return extraHeaders; } - /** Returns a new instance with the channel set to the given channel. */ + /** + * This method is obsolete. Use {@link #withTransportChannel()} instead. Returns a new instance + * with the channel set to the given channel. + */ + @ObsoleteApi("Use withTransportChannel() instead") public GrpcCallContext withChannel(Channel newChannel) { return new GrpcCallContext( newChannel, + credentials, callOptions, timeout, streamWaitTimeout, @@ -464,13 +639,16 @@ public GrpcCallContext withChannel(Channel newChannel) { extraHeaders, options, retrySettings, - retryableCodes); + retryableCodes, + endpointContext, + isDirectPath); } /** Returns a new instance with the call options set to the given call options. */ public GrpcCallContext withCallOptions(CallOptions newCallOptions) { return new GrpcCallContext( channel, + credentials, newCallOptions, timeout, streamWaitTimeout, @@ -479,7 +657,9 @@ public GrpcCallContext withCallOptions(CallOptions newCallOptions) { extraHeaders, options, retrySettings, - retryableCodes); + retryableCodes, + endpointContext, + isDirectPath); } public GrpcCallContext withRequestParamsDynamicHeaderOption(String requestParams) { @@ -513,6 +693,7 @@ public GrpcCallContext withOption(Key key, T value) { ApiCallContextOptions newOptions = options.withOption(key, value); return new GrpcCallContext( channel, + credentials, callOptions, timeout, streamWaitTimeout, @@ -521,7 +702,9 @@ public GrpcCallContext withOption(Key key, T value) { extraHeaders, newOptions, retrySettings, - retryableCodes); + retryableCodes, + endpointContext, + isDirectPath); } /** {@inheritDoc} */ @@ -530,10 +713,49 @@ public T getOption(Key key) { return options.getOption(key); } + /** + * Validate the Universe Domain to ensure that the user configured Universe Domain and the + * Credentials' Universe Domain match. An exception will be raised if there are any issues when + * trying to validate (i.e. unable to access the universe domain). + * + * @throws UnauthenticatedException Thrown if the universe domain that the user configured does + * not match the Credential's universe domain. + * @throws UnavailableException If client library is unable to retrieve the universe domain from + * the Credentials and the RPC is configured to retry Unavailable exceptions, the client + * library will attempt to retry with the RPC's defined retry bounds. If the retry bounds have + * been exceeded and the library is still unable to retrieve the universe domain, the + * exception will be thrown back to the user. + */ + @InternalApi + public void validateUniverseDomain() { + try { + endpointContext.validateUniverseDomain(credentials, UNAUTHENTICATED_STATUS_CODE); + } catch (IOException e) { + // Check if it is an Auth Exception (All instances of IOException from endpointContext's + // `validateUniverseDomain()` call should be an Auth Exception). + if (e instanceof Retryable) { + Retryable retryable = (Retryable) e; + // Keep the behavior the same as gRPC-Java. Mark as Auth Exceptions as Unavailable + throw ApiExceptionFactory.createException( + EndpointContext.UNABLE_TO_RETRIEVE_CREDENTIALS_ERROR_MESSAGE, + e, + GrpcStatusCode.of(Status.Code.UNAVAILABLE), + retryable.isRetryable()); + } + // This exception below should never be raised as all IOExceptions should be caught above. + throw ApiExceptionFactory.createException( + EndpointContext.UNABLE_TO_RETRIEVE_CREDENTIALS_ERROR_MESSAGE, + e, + UNAUTHENTICATED_STATUS_CODE, + false); + } + } + @Override public int hashCode() { return Objects.hash( channel, + credentials, callOptions, timeout, streamWaitTimeout, @@ -542,7 +764,8 @@ public int hashCode() { extraHeaders, options, retrySettings, - retryableCodes); + retryableCodes, + endpointContext); } @Override @@ -556,6 +779,7 @@ public boolean equals(Object o) { GrpcCallContext that = (GrpcCallContext) o; return Objects.equals(channel, that.channel) + && Objects.equals(credentials, that.credentials) && Objects.equals(callOptions, that.callOptions) && Objects.equals(timeout, that.timeout) && Objects.equals(streamWaitTimeout, that.streamWaitTimeout) @@ -564,7 +788,8 @@ public boolean equals(Object o) { && Objects.equals(extraHeaders, that.extraHeaders) && Objects.equals(options, that.options) && Objects.equals(retrySettings, that.retrySettings) - && Objects.equals(retryableCodes, that.retryableCodes); + && Objects.equals(retryableCodes, that.retryableCodes) + && Objects.equals(endpointContext, that.endpointContext); } Metadata getMetadata() { diff --git a/gax-java/gax-grpc/src/main/java/com/google/api/gax/grpc/GrpcCallSettings.java b/gax-java/gax-grpc/src/main/java/com/google/api/gax/grpc/GrpcCallSettings.java index a5aef3d69f..7f2cc2826a 100644 --- a/gax-java/gax-grpc/src/main/java/com/google/api/gax/grpc/GrpcCallSettings.java +++ b/gax-java/gax-grpc/src/main/java/com/google/api/gax/grpc/GrpcCallSettings.java @@ -30,18 +30,24 @@ package com.google.api.gax.grpc; import com.google.api.core.BetaApi; +import com.google.api.gax.rpc.RequestMutator; import com.google.api.gax.rpc.RequestParamsExtractor; +import com.google.api.gax.rpc.ResourceNameExtractor; import io.grpc.MethodDescriptor; /** Grpc-specific settings for creating callables. */ public class GrpcCallSettings { private final MethodDescriptor methodDescriptor; private final RequestParamsExtractor paramsExtractor; + private final ResourceNameExtractor resourceNameExtractor; + private final RequestMutator requestMutator; private final boolean alwaysAwaitTrailers; private GrpcCallSettings(Builder builder) { this.methodDescriptor = builder.methodDescriptor; this.paramsExtractor = builder.paramsExtractor; + this.resourceNameExtractor = builder.resourceNameExtractor; + this.requestMutator = builder.requestMutator; this.alwaysAwaitTrailers = builder.shouldAwaitTrailers; } @@ -53,6 +59,18 @@ public RequestParamsExtractor getParamsExtractor() { return paramsExtractor; } + /** + * Gets the extractor capable of extracting the destination resource name from the RPC request. + */ + @BetaApi + ResourceNameExtractor getResourceNameExtractor() { + return resourceNameExtractor; + } + + public RequestMutator getRequestMutator() { + return requestMutator; + } + @BetaApi public boolean shouldAwaitTrailers() { return alwaysAwaitTrailers; @@ -76,6 +94,9 @@ public Builder toBuilder() { public static class Builder { private MethodDescriptor methodDescriptor; private RequestParamsExtractor paramsExtractor; + private ResourceNameExtractor resourceNameExtractor; + + private RequestMutator requestMutator; private boolean shouldAwaitTrailers; private Builder() {} @@ -83,6 +104,8 @@ private Builder() {} private Builder(GrpcCallSettings settings) { this.methodDescriptor = settings.methodDescriptor; this.paramsExtractor = settings.paramsExtractor; + this.resourceNameExtractor = settings.resourceNameExtractor; + this.requestMutator = settings.requestMutator; this.shouldAwaitTrailers = settings.alwaysAwaitTrailers; } @@ -98,6 +121,21 @@ public Builder setParamsExtractor( return this; } + /** + * Sets the extractor capable of extracting the destination resource name from the RPC request. + */ + @BetaApi + public Builder setResourceNameExtractor( + ResourceNameExtractor resourceNameExtractor) { + this.resourceNameExtractor = resourceNameExtractor; + return this; + } + + public Builder setRequestMutator(RequestMutator requestMutator) { + this.requestMutator = requestMutator; + return this; + } + @BetaApi public Builder setShouldAwaitTrailers(boolean b) { this.shouldAwaitTrailers = b; diff --git a/gax-java/gax-grpc/src/main/java/com/google/api/gax/grpc/GrpcCallableFactory.java b/gax-java/gax-grpc/src/main/java/com/google/api/gax/grpc/GrpcCallableFactory.java index 8a0c4e0b37..3c79868bf1 100644 --- a/gax-java/gax-grpc/src/main/java/com/google/api/gax/grpc/GrpcCallableFactory.java +++ b/gax-java/gax-grpc/src/main/java/com/google/api/gax/grpc/GrpcCallableFactory.java @@ -29,13 +29,13 @@ */ package com.google.api.gax.grpc; -import com.google.api.core.InternalApi; import com.google.api.gax.longrunning.OperationSnapshot; import com.google.api.gax.rpc.BatchingCallSettings; import com.google.api.gax.rpc.BidiStreamingCallable; import com.google.api.gax.rpc.Callables; import com.google.api.gax.rpc.ClientContext; import com.google.api.gax.rpc.ClientStreamingCallable; +import com.google.api.gax.rpc.LibraryMetadata; import com.google.api.gax.rpc.LongRunningClient; import com.google.api.gax.rpc.OperationCallSettings; import com.google.api.gax.rpc.OperationCallable; @@ -46,6 +46,7 @@ import com.google.api.gax.rpc.StreamingCallSettings; import com.google.api.gax.rpc.UnaryCallSettings; import com.google.api.gax.rpc.UnaryCallable; +import com.google.api.gax.tracing.ApiTracerContext; import com.google.api.gax.tracing.SpanName; import com.google.api.gax.tracing.TracedBatchingCallable; import com.google.api.gax.tracing.TracedBidiCallable; @@ -54,19 +55,15 @@ import com.google.api.gax.tracing.TracedOperationInitialCallable; import com.google.api.gax.tracing.TracedServerStreamingCallable; import com.google.api.gax.tracing.TracedUnaryCallable; -import com.google.common.base.Preconditions; +import com.google.common.annotations.VisibleForTesting; import com.google.common.collect.ImmutableSet; import com.google.longrunning.Operation; import com.google.longrunning.stub.OperationsStub; import io.grpc.MethodDescriptor; -import java.util.regex.Matcher; -import java.util.regex.Pattern; import javax.annotation.Nonnull; /** Class with utility methods to create grpc-based direct callables. */ public class GrpcCallableFactory { - // Used to extract service and method name from a grpc MethodDescriptor. - private static final Pattern FULL_METHOD_NAME_REGEX = Pattern.compile("^.*?([^./]+)/([^./]+)$"); private GrpcCallableFactory() {} @@ -85,7 +82,13 @@ public static UnaryCallable createBas GrpcRawCallableFactory.createUnaryCallable( grpcCallSettings, callSettings.getRetryableCodes()); - callable = Callables.retrying(callable, callSettings, clientContext); + if (grpcCallSettings.getRequestMutator() != null) { + callable = + Callables.retrying( + callable, callSettings, clientContext, grpcCallSettings.getRequestMutator()); + } else { + callable = Callables.retrying(callable, callSettings, clientContext); + } return callable; } @@ -106,7 +109,8 @@ public static UnaryCallable createUna new TracedUnaryCallable<>( callable, clientContext.getTracerFactory(), - getSpanName(grpcCallSettings.getMethodDescriptor())); + getApiTracerContext(grpcCallSettings.getMethodDescriptor()), + grpcCallSettings.getResourceNameExtractor()); return callable.withDefaultCallContext(clientContext.getDefaultCallContext()); } @@ -155,7 +159,7 @@ public static UnaryCallable createBat new TracedBatchingCallable<>( baseCallable, clientContext.getTracerFactory(), - getSpanName(grpcCallSettings.getMethodDescriptor()), + getApiTracerContext(grpcCallSettings.getMethodDescriptor()), batchingCallSettings.getBatchingDescriptor()); UnaryCallable batchingCallable = @@ -181,7 +185,8 @@ OperationCallable createOperationCallable( ClientContext clientContext, OperationsStub operationsStub) { - SpanName initialSpanName = getSpanName(grpcCallSettings.getMethodDescriptor()); + ApiTracerContext tracerContext = getApiTracerContext(grpcCallSettings.getMethodDescriptor()); + SpanName initialSpanName = SpanName.of(tracerContext); SpanName operationSpanName = SpanName.of(initialSpanName.getClientName(), initialSpanName.getMethodName() + "Operation"); @@ -231,7 +236,7 @@ BidiStreamingCallable createBidiStreamingCallable( new TracedBidiCallable<>( callable, clientContext.getTracerFactory(), - getSpanName(grpcCallSettings.getMethodDescriptor())); + getApiTracerContext(grpcCallSettings.getMethodDescriptor())); return callable.withDefaultCallContext(clientContext.getDefaultCallContext()); } @@ -289,7 +294,7 @@ ServerStreamingCallable createServerStreamingCallable( new TracedServerStreamingCallable<>( callable, clientContext.getTracerFactory(), - getSpanName(grpcCallSettings.getMethodDescriptor())); + getApiTracerContext(grpcCallSettings.getMethodDescriptor())); return callable.withDefaultCallContext(clientContext.getDefaultCallContext()); } @@ -317,16 +322,17 @@ ClientStreamingCallable createClientStreamingCallable( new TracedClientStreamingCallable<>( callable, clientContext.getTracerFactory(), - getSpanName(grpcCallSettings.getMethodDescriptor())); + getApiTracerContext(grpcCallSettings.getMethodDescriptor())); return callable.withDefaultCallContext(clientContext.getDefaultCallContext()); } - @InternalApi("Visible for testing") - static SpanName getSpanName(@Nonnull MethodDescriptor methodDescriptor) { - Matcher matcher = FULL_METHOD_NAME_REGEX.matcher(methodDescriptor.getFullMethodName()); - - Preconditions.checkArgument(matcher.matches(), "Invalid fullMethodName"); - return SpanName.of(matcher.group(1), matcher.group(2)); + @VisibleForTesting + static ApiTracerContext getApiTracerContext(@Nonnull MethodDescriptor methodDescriptor) { + return ApiTracerContext.newBuilder() + .setFullMethodName(methodDescriptor.getFullMethodName()) + .setTransport(ApiTracerContext.Transport.GRPC) + .setLibraryMetadata(LibraryMetadata.empty()) + .build(); } } diff --git a/gax-java/gax-grpc/src/main/java/com/google/api/gax/grpc/GrpcClientCalls.java b/gax-java/gax-grpc/src/main/java/com/google/api/gax/grpc/GrpcClientCalls.java index bc72f6f1f1..e797842c9e 100644 --- a/gax-java/gax-grpc/src/main/java/com/google/api/gax/grpc/GrpcClientCalls.java +++ b/gax-java/gax-grpc/src/main/java/com/google/api/gax/grpc/GrpcClientCalls.java @@ -57,7 +57,8 @@ class GrpcClientCalls { private static final Logger LOGGER = Logger.getLogger(GrpcDirectCallable.class.getName()); - private GrpcClientCalls() {}; + private GrpcClientCalls() {} + ; public static ClientCall newCall( MethodDescriptor descriptor, ApiCallContext context) { @@ -74,9 +75,9 @@ public static ClientCall newCall( Preconditions.checkNotNull(callOptions); // Try to convert the timeout into a deadline and use it if it occurs before the actual deadline - if (grpcContext.getTimeout() != null) { + if (grpcContext.getTimeoutDuration() != null) { Deadline newDeadline = - Deadline.after(grpcContext.getTimeout().toMillis(), TimeUnit.MILLISECONDS); + Deadline.after(grpcContext.getTimeoutDuration().toMillis(), TimeUnit.MILLISECONDS); Deadline oldDeadline = callOptions.getDeadline(); if (oldDeadline == null || newDeadline.isBefore(oldDeadline)) { @@ -95,6 +96,10 @@ public static ClientCall newCall( channel = ClientInterceptors.intercept(channel, interceptor); } + // Validate the Universe Domain prior to the call. Only allow the call to go through + // if the Universe Domain is valid. + grpcContext.validateUniverseDomain(); + try (Scope ignored = grpcContext.getTracer().inScope()) { return channel.newCall(descriptor, callOptions); } diff --git a/gax-java/gax-grpc/src/main/java/com/google/api/gax/grpc/GrpcDirectCallable.java b/gax-java/gax-grpc/src/main/java/com/google/api/gax/grpc/GrpcDirectCallable.java index 5b6a5f1bad..33041145dd 100644 --- a/gax-java/gax-grpc/src/main/java/com/google/api/gax/grpc/GrpcDirectCallable.java +++ b/gax-java/gax-grpc/src/main/java/com/google/api/gax/grpc/GrpcDirectCallable.java @@ -30,6 +30,7 @@ package com.google.api.gax.grpc; import com.google.api.core.ApiFuture; +import com.google.api.core.InternalApi; import com.google.api.core.ListenableFutureToApiFuture; import com.google.api.gax.rpc.ApiCallContext; import com.google.api.gax.rpc.UnaryCallable; @@ -43,6 +44,7 @@ * *

        Package-private for internal use. */ +@InternalApi class GrpcDirectCallable extends UnaryCallable { private final MethodDescriptor descriptor; private final boolean awaitTrailers; diff --git a/gax-java/gax-grpc/src/main/java/com/google/api/gax/grpc/GrpcDirectStreamController.java b/gax-java/gax-grpc/src/main/java/com/google/api/gax/grpc/GrpcDirectStreamController.java index e7b52b8089..83c09d4804 100644 --- a/gax-java/gax-grpc/src/main/java/com/google/api/gax/grpc/GrpcDirectStreamController.java +++ b/gax-java/gax-grpc/src/main/java/com/google/api/gax/grpc/GrpcDirectStreamController.java @@ -53,7 +53,7 @@ public void run() {} private final ClientCall clientCall; private final ResponseObserver responseObserver; private final Runnable onReady; - private boolean hasStarted; + private volatile boolean hasStarted; private boolean autoflowControl = true; private int numRequested; private volatile CancellationException cancellationException; @@ -88,7 +88,6 @@ public void disableAutoInboundFlowControl() { @Override public void request(int count) { Preconditions.checkState(!autoflowControl, "Autoflow control is enabled."); - // Buffer the requested count in case the consumer requested responses in the onStart() if (!hasStarted) { numRequested += count; @@ -110,10 +109,10 @@ void startBidi() { private void startCommon() { responseObserver.onStart(this); - this.hasStarted = true; - clientCall.start(new ResponseObserverAdapter(), new Metadata()); + this.hasStarted = true; + if (autoflowControl) { clientCall.request(1); } else if (numRequested > 0) { diff --git a/gax-java/gax-grpc/src/main/java/com/google/api/gax/grpc/GrpcLoggingInterceptor.java b/gax-java/gax-grpc/src/main/java/com/google/api/gax/grpc/GrpcLoggingInterceptor.java new file mode 100644 index 0000000000..9c305261cb --- /dev/null +++ b/gax-java/gax-grpc/src/main/java/com/google/api/gax/grpc/GrpcLoggingInterceptor.java @@ -0,0 +1,136 @@ +/* + * Copyright 2025 Google LLC + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Google LLC nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +package com.google.api.gax.grpc; + +import static com.google.api.gax.logging.LoggingUtils.executeWithTryCatch; +import static com.google.api.gax.logging.LoggingUtils.logRequest; +import static com.google.api.gax.logging.LoggingUtils.logResponse; +import static com.google.api.gax.logging.LoggingUtils.recordResponseHeaders; +import static com.google.api.gax.logging.LoggingUtils.recordResponsePayload; +import static com.google.api.gax.logging.LoggingUtils.recordServiceRpcAndRequestHeaders; + +import com.google.api.core.InternalApi; +import com.google.api.gax.logging.LogData; +import com.google.api.gax.logging.LoggerProvider; +import io.grpc.CallOptions; +import io.grpc.Channel; +import io.grpc.ClientCall; +import io.grpc.ClientInterceptor; +import io.grpc.ForwardingClientCall; +import io.grpc.ForwardingClientCallListener.SimpleForwardingClientCallListener; +import io.grpc.Metadata; +import io.grpc.MethodDescriptor; +import io.grpc.Status; +import java.util.HashMap; +import java.util.Map; + +@InternalApi +public class GrpcLoggingInterceptor implements ClientInterceptor { + + private static final LoggerProvider LOGGER_PROVIDER = + LoggerProvider.forClazz(GrpcLoggingInterceptor.class); + + ClientCall.Listener currentListener; // expose for test setup + + @Override + public ClientCall interceptCall( + MethodDescriptor method, CallOptions callOptions, Channel next) { + + return new ForwardingClientCall.SimpleForwardingClientCall( + next.newCall(method, callOptions)) { + LogData.Builder logDataBuilder = LogData.builder(); + + @Override + public void start(Listener responseListener, Metadata headers) { + recordServiceRpcAndRequestHeaders( + method.getServiceName(), + method.getFullMethodName(), + null, // endpoint is for http request only + metadataHeadersToMap(headers), + logDataBuilder, + LOGGER_PROVIDER); + SimpleForwardingClientCallListener responseLoggingListener = + new SimpleForwardingClientCallListener(responseListener) { + @Override + public void onHeaders(Metadata headers) { + recordResponseHeaders( + metadataHeadersToMap(headers), logDataBuilder, LOGGER_PROVIDER); + super.onHeaders(headers); + } + + @Override + public void onMessage(RespT message) { + recordResponsePayload(message, logDataBuilder, LOGGER_PROVIDER); + super.onMessage(message); + } + + @Override + public void onClose(Status status, Metadata trailers) { + logResponse(status.getCode().toString(), logDataBuilder, LOGGER_PROVIDER); + super.onClose(status, trailers); + } + }; + currentListener = responseLoggingListener; + super.start(responseLoggingListener, headers); + } + + @Override + public void sendMessage(ReqT message) { + logRequest(message, logDataBuilder, LOGGER_PROVIDER); + super.sendMessage(message); + } + }; + } + + // Helper methods for logging + private static Map metadataHeadersToMap(Metadata headers) { + + Map headersMap = new HashMap<>(); + executeWithTryCatch( + () -> { + for (String key : headers.keys()) { + // grpc header values can be either ASCII strings or binary + // https://grpc.io/docs/guides/metadata/#overview + // this condition identified binary headers and skip for logging + if (key.endsWith(Metadata.BINARY_HEADER_SUFFIX)) { + continue; + } + Metadata.Key metadataKey = + Metadata.Key.of(key, Metadata.ASCII_STRING_MARSHALLER); + String headerValue = headers.get(metadataKey); + + headersMap.put(key, headerValue); + } + }); + + return headersMap; + } +} diff --git a/gax-java/gax-grpc/src/main/java/com/google/api/gax/grpc/GrpcRawCallableFactory.java b/gax-java/gax-grpc/src/main/java/com/google/api/gax/grpc/GrpcRawCallableFactory.java index 1375fe9fb5..318f096291 100644 --- a/gax-java/gax-grpc/src/main/java/com/google/api/gax/grpc/GrpcRawCallableFactory.java +++ b/gax-java/gax-grpc/src/main/java/com/google/api/gax/grpc/GrpcRawCallableFactory.java @@ -99,6 +99,7 @@ ServerStreamingCallable createServerStreamingCallable( } return new GrpcExceptionServerStreamingCallable<>(callable, retryableCodes); } + /** * Create a client-streaming callable object with grpc-specific functionality. Designed for use by * generated code. diff --git a/gax-java/gax-grpc/src/main/java/com/google/api/gax/grpc/GrpcServerStreamingRequestParamCallable.java b/gax-java/gax-grpc/src/main/java/com/google/api/gax/grpc/GrpcServerStreamingRequestParamCallable.java index 5e0a59851e..27b4c56454 100644 --- a/gax-java/gax-grpc/src/main/java/com/google/api/gax/grpc/GrpcServerStreamingRequestParamCallable.java +++ b/gax-java/gax-grpc/src/main/java/com/google/api/gax/grpc/GrpcServerStreamingRequestParamCallable.java @@ -51,8 +51,7 @@ class GrpcServerStreamingRequestParamCallable ServerStreamingCallable callable, RequestParamsExtractor paramsExtractor) { this.callable = Preconditions.checkNotNull(callable); - this.paramsEncoder = - new RequestUrlParamsEncoder<>(Preconditions.checkNotNull(paramsExtractor), false); + this.paramsEncoder = new RequestUrlParamsEncoder<>(Preconditions.checkNotNull(paramsExtractor)); } @Override @@ -62,8 +61,14 @@ public void call( } private ApiCallContext contextWithParamsEncoder(RequestT request, ApiCallContext inputContext) { - return GrpcCallContext.createDefault() - .nullToSelf(inputContext) - .withRequestParamsDynamicHeaderOption(paramsEncoder.encode(request)); + ApiCallContext newCallContext = inputContext; + String encodedHeader = paramsEncoder.encode(request); + if (!encodedHeader.isEmpty()) { + newCallContext = + GrpcCallContext.createDefault() + .nullToSelf(inputContext) + .withRequestParamsDynamicHeaderOption(encodedHeader); + } + return newCallContext; } } diff --git a/gax-java/gax-grpc/src/main/java/com/google/api/gax/grpc/GrpcTransportChannel.java b/gax-java/gax-grpc/src/main/java/com/google/api/gax/grpc/GrpcTransportChannel.java index 9e63bb2a63..2fa0908f17 100644 --- a/gax-java/gax-grpc/src/main/java/com/google/api/gax/grpc/GrpcTransportChannel.java +++ b/gax-java/gax-grpc/src/main/java/com/google/api/gax/grpc/GrpcTransportChannel.java @@ -60,6 +60,8 @@ public GrpcCallContext getEmptyCallContext() { /** The channel in use. */ abstract ManagedChannel getManagedChannel(); + public abstract boolean isDirectPath(); + public Channel getChannel() { return getManagedChannel(); } @@ -100,7 +102,7 @@ public void close() { } public static Builder newBuilder() { - return new AutoValue_GrpcTransportChannel.Builder(); + return new AutoValue_GrpcTransportChannel.Builder().setDirectPath(false); } public static GrpcTransportChannel create(ManagedChannel channel) { @@ -111,6 +113,8 @@ public static GrpcTransportChannel create(ManagedChannel channel) { public abstract static class Builder { public abstract Builder setManagedChannel(ManagedChannel value); + abstract Builder setDirectPath(boolean value); + public abstract GrpcTransportChannel build(); } } diff --git a/gax-java/gax-grpc/src/main/java/com/google/api/gax/grpc/GrpcUnaryRequestParamCallable.java b/gax-java/gax-grpc/src/main/java/com/google/api/gax/grpc/GrpcUnaryRequestParamCallable.java index 9eb78aca0d..22bbd8409b 100644 --- a/gax-java/gax-grpc/src/main/java/com/google/api/gax/grpc/GrpcUnaryRequestParamCallable.java +++ b/gax-java/gax-grpc/src/main/java/com/google/api/gax/grpc/GrpcUnaryRequestParamCallable.java @@ -51,16 +51,19 @@ class GrpcUnaryRequestParamCallable UnaryCallable callable, RequestParamsExtractor paramsExtractor) { this.callable = Preconditions.checkNotNull(callable); - this.paramsEncoder = - new RequestUrlParamsEncoder<>(Preconditions.checkNotNull(paramsExtractor), false); + this.paramsEncoder = new RequestUrlParamsEncoder<>(Preconditions.checkNotNull(paramsExtractor)); } @Override public ApiFuture futureCall(RequestT request, ApiCallContext inputContext) { - GrpcCallContext newCallContext = - GrpcCallContext.createDefault() - .nullToSelf(inputContext) - .withRequestParamsDynamicHeaderOption(paramsEncoder.encode(request)); + ApiCallContext newCallContext = inputContext; + String encodedHeader = paramsEncoder.encode(request); + if (!encodedHeader.isEmpty()) { + newCallContext = + GrpcCallContext.createDefault() + .nullToSelf(inputContext) + .withRequestParamsDynamicHeaderOption(encodedHeader); + } return callable.futureCall(request, newCallContext); } diff --git a/gax-java/gax-grpc/src/main/java/com/google/api/gax/grpc/InstantiatingGrpcChannelProvider.java b/gax-java/gax-grpc/src/main/java/com/google/api/gax/grpc/InstantiatingGrpcChannelProvider.java index 40e2bd1399..c4543d9867 100644 --- a/gax-java/gax-grpc/src/main/java/com/google/api/gax/grpc/InstantiatingGrpcChannelProvider.java +++ b/gax-java/gax-grpc/src/main/java/com/google/api/gax/grpc/InstantiatingGrpcChannelProvider.java @@ -29,27 +29,39 @@ */ package com.google.api.gax.grpc; +import static com.google.api.gax.util.TimeConversionUtils.toJavaTimeDuration; +import static com.google.api.gax.util.TimeConversionUtils.toThreetenDuration; + import com.google.api.core.ApiFunction; import com.google.api.core.BetaApi; import com.google.api.core.InternalApi; -import com.google.api.core.InternalExtensionOnly; +import com.google.api.core.ObsoleteApi; import com.google.api.gax.core.ExecutorProvider; import com.google.api.gax.rpc.FixedHeaderProvider; import com.google.api.gax.rpc.HeaderProvider; import com.google.api.gax.rpc.TransportChannel; import com.google.api.gax.rpc.TransportChannelProvider; import com.google.api.gax.rpc.internal.EnvironmentProvider; -import com.google.api.gax.rpc.mtls.MtlsProvider; +import com.google.api.gax.rpc.mtls.CertificateBasedAccess; +import com.google.auth.ApiKeyCredentials; import com.google.auth.Credentials; +import com.google.auth.mtls.CertificateSourceUnavailableException; +import com.google.auth.mtls.DefaultMtlsProviderFactory; +import com.google.auth.mtls.MtlsProvider; import com.google.auth.oauth2.ComputeEngineCredentials; +import com.google.auth.oauth2.SecureSessionAgent; +import com.google.auth.oauth2.SecureSessionAgentConfig; import com.google.common.annotations.VisibleForTesting; import com.google.common.base.Preconditions; +import com.google.common.base.Strings; import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; import com.google.common.io.Files; import io.grpc.CallCredentials; import io.grpc.ChannelCredentials; +import io.grpc.CompositeChannelCredentials; import io.grpc.Grpc; +import io.grpc.InsecureChannelCredentials; import io.grpc.ManagedChannel; import io.grpc.ManagedChannelBuilder; import io.grpc.TlsChannelCredentials; @@ -57,16 +69,21 @@ import io.grpc.auth.MoreCallCredentials; import java.io.File; import java.io.IOException; +import java.lang.reflect.Method; import java.nio.charset.StandardCharsets; import java.security.GeneralSecurityException; import java.security.KeyStore; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; import java.util.Map; import java.util.concurrent.Executor; import java.util.concurrent.ScheduledExecutorService; import java.util.concurrent.TimeUnit; +import java.util.logging.Level; +import java.util.logging.Logger; import javax.annotation.Nullable; import javax.net.ssl.KeyManagerFactory; -import org.threeten.bp.Duration; /** * InstantiatingGrpcChannelProvider is a TransportChannelProvider which constructs a gRPC @@ -80,12 +97,31 @@ *

        The client lib header and generator header values are used to form a value that goes into the * http header of requests to the service. */ -@InternalExtensionOnly public final class InstantiatingGrpcChannelProvider implements TransportChannelProvider { - static final String DIRECT_PATH_ENV_VAR = "GOOGLE_CLOUD_ENABLE_DIRECT_PATH"; - private static final String DIRECT_PATH_ENV_DISABLE_DIRECT_PATH = - "GOOGLE_CLOUD_DISABLE_DIRECT_PATH"; - private static final String DIRECT_PATH_ENV_ENABLE_XDS = "GOOGLE_CLOUD_ENABLE_DIRECT_PATH_XDS"; + + private static String systemProductName; + + @VisibleForTesting + static final Logger LOG = Logger.getLogger(InstantiatingGrpcChannelProvider.class.getName()); + + static final String DIRECT_PATH_ENV_DISABLE_DIRECT_PATH = "GOOGLE_CLOUD_DISABLE_DIRECT_PATH"; + + @VisibleForTesting + static final String DIRECT_PATH_ENV_ENABLE_XDS = "GOOGLE_CLOUD_ENABLE_DIRECT_PATH_XDS"; + + // The public portion of the mTLS MDS root certificate is stored for performing + // cert verification when establishing an mTLS connection with the MDS. See + // {@link this + // for more information.} + private static final String MTLS_MDS_ROOT_PATH = "/run/google-mds-mtls/root.crt"; + // The mTLS MDS credentials are formatted as the concatenation of a PEM-encoded certificate chain + // followed by a PEM-encoded private key. See + // {@link this + // for more information.} + private static final String MTLS_MDS_CERT_CHAIN_AND_KEY_PATH = "/run/google-mds-mtls/client.key"; + static final long DIRECT_PATH_KEEP_ALIVE_TIME_SECONDS = 3600; static final long DIRECT_PATH_KEEP_ALIVE_TIMEOUT_SECONDS = 20; static final String GCE_PRODUCTION_NAME_PRIOR_2016 = "Google"; @@ -93,8 +129,11 @@ public final class InstantiatingGrpcChannelProvider implements TransportChannelP private final int processorCount; private final Executor executor; + @Nullable private final ScheduledExecutorService backgroundExecutor; private final HeaderProvider headerProvider; + private final boolean useS2A; private final String endpoint; + private final String mtlsEndpoint; // TODO: remove. envProvider currently provides DirectPath environment variable, and is only used // during initial rollout for DirectPath. This provider will be removed once the DirectPath // environment is not used. @@ -102,26 +141,84 @@ public final class InstantiatingGrpcChannelProvider implements TransportChannelP @Nullable private final GrpcInterceptorProvider interceptorProvider; @Nullable private final Integer maxInboundMessageSize; @Nullable private final Integer maxInboundMetadataSize; - @Nullable private final Duration keepAliveTime; - @Nullable private final Duration keepAliveTimeout; + @Nullable private final java.time.Duration keepAliveTime; + @Nullable private final java.time.Duration keepAliveTimeout; @Nullable private final Boolean keepAliveWithoutCalls; private final ChannelPoolSettings channelPoolSettings; @Nullable private final Credentials credentials; + @Nullable private final CallCredentials altsCallCredentials; + @Nullable private final CallCredentials mtlsS2ACallCredentials; @Nullable private final ChannelPrimer channelPrimer; @Nullable private final Boolean attemptDirectPath; + @Nullable private final Boolean attemptDirectPathXds; @Nullable private final Boolean allowNonDefaultServiceAccount; @VisibleForTesting final ImmutableMap directPathServiceConfig; @Nullable private final MtlsProvider mtlsProvider; + private final CertificateBasedAccess certificateBasedAccess; + @Nullable private final SecureSessionAgent s2aConfigProvider; + private final List allowedHardBoundTokenTypes; + @VisibleForTesting final Map headersWithDuplicatesRemoved = new HashMap<>(); @Nullable private final ApiFunction channelConfigurator; + // This is initialized once for the lifetime of the application. This enables re-using + // channels to S2A. + private static volatile ChannelCredentials s2aChannelCredentials; + + /** + * Resets the s2aChannelCredentials of the {@link InstantiatingGrpcChannelProvider} class for + * testing purposes. + * + *

        This should only be called from tests. + */ + @VisibleForTesting + static void resetS2AChannelCredentials() { + synchronized (InstantiatingGrpcChannelProvider.class) { + s2aChannelCredentials = null; + } + } + + /** + * Returns the s2aChannelCredentials of the {@link InstantiatingGrpcChannelProvider} class for + * testing purposes. + * + *

        This should only be called from tests. + */ + @VisibleForTesting + static ChannelCredentials getS2AChannelCredentials() { + return s2aChannelCredentials; + } + + /* + * Experimental feature + * + *

        {@link HardBoundTokenTypes} specifies if hard bound tokens should be used if DirectPath + * or S2A is used to estabilsh a connection to Google APIs. + * + */ + @InternalApi + public enum HardBoundTokenTypes { + // If DirectPath is used to create the channel, use hard ALTS-bound tokens for requests sent on + // that channel. + ALTS, + // If MTLS via S2A is used to create the channel, use hard MTLS-bound tokens for requests sent + // on that channel. + MTLS_S2A + } + private InstantiatingGrpcChannelProvider(Builder builder) { this.processorCount = builder.processorCount; this.executor = builder.executor; + this.backgroundExecutor = builder.backgroundExecutor; this.headerProvider = builder.headerProvider; + this.useS2A = builder.useS2A; this.endpoint = builder.endpoint; + this.mtlsEndpoint = builder.mtlsEndpoint; + this.allowedHardBoundTokenTypes = builder.allowedHardBoundTokenTypes; this.mtlsProvider = builder.mtlsProvider; + this.certificateBasedAccess = builder.certificateBasedAccess; + this.s2aConfigProvider = builder.s2aConfigProvider; this.envProvider = builder.envProvider; this.interceptorProvider = builder.interceptorProvider; this.maxInboundMessageSize = builder.maxInboundMessageSize; @@ -132,8 +229,11 @@ private InstantiatingGrpcChannelProvider(Builder builder) { this.channelPoolSettings = builder.channelPoolSettings; this.channelConfigurator = builder.channelConfigurator; this.credentials = builder.credentials; + this.altsCallCredentials = builder.altsCallCredentials; + this.mtlsS2ACallCredentials = builder.mtlsS2ACallCredentials; this.channelPrimer = builder.channelPrimer; this.attemptDirectPath = builder.attemptDirectPath; + this.attemptDirectPathXds = builder.attemptDirectPathXds; this.allowNonDefaultServiceAccount = builder.allowNonDefaultServiceAccount; this.directPathServiceConfig = builder.directPathServiceConfig == null @@ -141,6 +241,19 @@ private InstantiatingGrpcChannelProvider(Builder builder) { : builder.directPathServiceConfig; } + /** + * Package-Private constructor that is only visible for testing DirectPath functionality inside + * tests. This overrides the computed systemProductName when the class is initialized to help + * configure the result of {@link #isOnComputeEngine()} check. + * + *

        If productName is null, that represents the result of an IOException + */ + @VisibleForTesting + InstantiatingGrpcChannelProvider(Builder builder, String productName) { + this(builder); + systemProductName = productName; + } + /** * @deprecated If executor is not set, this channel provider will create channels with default * grpc executor. @@ -162,6 +275,16 @@ public TransportChannelProvider withExecutor(Executor executor) { return toBuilder().setExecutor(executor).build(); } + @Override + public boolean needsBackgroundExecutor() { + return backgroundExecutor == null; + } + + @Override + public TransportChannelProvider withBackgroundExecutor(ScheduledExecutorService executor) { + return toBuilder().setBackgroundExecutor(executor).build(); + } + @Override public boolean needsHeaders() { return headerProvider == null; @@ -182,6 +305,12 @@ public boolean needsEndpoint() { return endpoint == null; } + @InternalApi("This public method is used by Gax to help configure the MTLS endpoint for S2A") + @Override + public boolean needsMtlsEndpoint() { + return mtlsEndpoint == null; + } + /** * Specify the endpoint the channel should connect to. * @@ -196,14 +325,45 @@ public TransportChannelProvider withEndpoint(String endpoint) { return toBuilder().setEndpoint(endpoint).build(); } - /** @deprecated Please modify pool settings via {@link #toBuilder()} */ + /** + * Specify the mTLS endpoint the channel should connect to when using S2A. + * + *

        The value of {@code mtlsEndpoint} must be of the form {@code host:port}. + * + * @param mtlsEndpoint The mtTLS endpoint to connect to + * @return A new {@link InstantiatingGrpcChannelProvider} with the specified mTLS endpoint + * configured + */ + @InternalApi("This public method is used by Gax to help configure the MTLS endpoint for S2A") + @Override + public TransportChannelProvider withMtlsEndpoint(String mtlsEndpoint) { + validateEndpoint(mtlsEndpoint); + return toBuilder().setMtlsEndpoint(mtlsEndpoint).build(); + } + + /** + * Specify whether or not to use S2A. + * + * @param useS2A + * @return A new {@link InstantiatingGrpcChannelProvider} with useS2A set. + */ + @Override + public TransportChannelProvider withUseS2A(boolean useS2A) { + return toBuilder().setUseS2A(useS2A).build(); + } + + /** + * @deprecated Please modify pool settings via {@link #toBuilder()} + */ @Deprecated @Override public boolean acceptsPoolSize() { return true; } - /** @deprecated Please modify pool settings via {@link #toBuilder()} */ + /** + * @deprecated Please modify pool settings via {@link #toBuilder()} + */ @Deprecated @Override public TransportChannelProvider withPoolSize(int size) { @@ -227,19 +387,23 @@ public TransportChannel getTransportChannel() throws IOException { } else if (needsEndpoint()) { throw new IllegalStateException("getTransportChannel() called when needsEndpoint() is true"); } else { + logDirectPathMisconfig(); return createChannel(); } } private TransportChannel createChannel() throws IOException { - return GrpcTransportChannel.create( - ChannelPool.create( - channelPoolSettings, InstantiatingGrpcChannelProvider.this::createSingleChannel)); + return GrpcTransportChannel.newBuilder() + .setManagedChannel( + ChannelPool.create( + channelPoolSettings, + InstantiatingGrpcChannelProvider.this::createSingleChannel, + backgroundExecutor)) + .setDirectPath(this.canUseDirectPath()) + .build(); } - // TODO(mohanli): Use attemptDirectPath as the only indicator once setAttemptDirectPath is adapted - // and the env var is removed from client environment. - private boolean isDirectPathEnabled(String serviceAddress) { + private boolean isDirectPathEnabled() { String disableDirectPathEnv = envProvider.getenv(DIRECT_PATH_ENV_DISABLE_DIRECT_PATH); boolean isDirectPathDisabled = Boolean.parseBoolean(disableDirectPathEnv); if (isDirectPathDisabled) { @@ -249,20 +413,85 @@ private boolean isDirectPathEnabled(String serviceAddress) { if (attemptDirectPath != null) { return attemptDirectPath; } - // Only check DIRECT_PATH_ENV_VAR when attemptDirectPath is not set. - String whiteList = envProvider.getenv(DIRECT_PATH_ENV_VAR); - if (whiteList == null) { - return false; + return false; + } + + private boolean isDirectPathXdsEnabledViaBuilderOption() { + return Boolean.TRUE.equals(attemptDirectPathXds); + } + + private boolean isDirectPathXdsEnabledViaEnv() { + String directPathXdsEnv = envProvider.getenv(DIRECT_PATH_ENV_ENABLE_XDS); + return Boolean.parseBoolean(directPathXdsEnv); + } + + /** + * This method tells if Direct Path xDS was enabled. There are two ways of enabling it: via + * environment variable (by setting GOOGLE_CLOUD_ENABLE_DIRECT_PATH_XDS=true) or when building + * this channel provider (via the {@link Builder#setAttemptDirectPathXds()} method). + * + * @return true if Direct Path xDS was either enabled via env var or via builder option + */ + @InternalApi + public boolean isDirectPathXdsEnabled() { + return isDirectPathXdsEnabledViaEnv() || isDirectPathXdsEnabledViaBuilderOption(); + } + + // This method should be called once per client initialization, hence can not be called in the + // builder or createSingleChannel, only in getTransportChannel which creates the first channel + // for a client. + private void logDirectPathMisconfig() { + if (!isDirectPathXdsEnabled()) { + return; } - for (String service : whiteList.split(",")) { - if (!service.isEmpty() && serviceAddress.contains(service)) { - return true; + + Level level = isOnComputeEngine() ? Level.WARNING : Level.FINE; + + if (!isDirectPathEnabled()) { + // This misconfiguration occurs when Direct Path xDS is enabled, but Direct Path is not + // Direct Path xDS can be enabled two ways: via environment variable or via builder. + // Case 1: Direct Path is only enabled via xDS env var. We will _warn_ the user that this is + // a misconfiguration if they intended to set the env var. + if (isDirectPathXdsEnabledViaEnv()) { + LOG.log( + level, + "Env var " + + DIRECT_PATH_ENV_ENABLE_XDS + + " was found and set to TRUE, but DirectPath was not enabled for this client. If this is intended for " + + "this client, please note that this is a misconfiguration and set the attemptDirectPath option as well."); + } + // Case 2: Direct Path xDS was enabled via Builder. Direct Path Traffic Director must be set + // (enabled with `setAttemptDirectPath(true)`) along with xDS. + // Here we warn the user about this. + else if (isDirectPathXdsEnabledViaBuilderOption()) { + LOG.log( + level, + "DirectPath is misconfigured. The DirectPath XDS option was set, but the attemptDirectPath option was not. Please set both the attemptDirectPath and attemptDirectPathXds options."); + } + } else { + // Case 3: credential is not correctly set + if (!isCredentialDirectPathCompatible()) { + LOG.log( + level, + "DirectPath is misconfigured. Please make sure the credential is an instance of " + + ComputeEngineCredentials.class.getName() + + " ."); + } + // Case 4: not running on GCE + if (!isOnComputeEngine()) { + LOG.log( + level, + "DirectPath is misconfigured. DirectPath is only available in a GCE environment."); } } - return false; } - private boolean isNonDefaultServiceAccountAllowed() { + @VisibleForTesting + boolean isCredentialDirectPathCompatible() { + // DirectPath requires a call credential during gRPC channel construction. + if (needsCredentials()) { + return false; + } if (allowNonDefaultServiceAccount != null && allowNonDefaultServiceAccount) { return true; } @@ -271,25 +500,45 @@ private boolean isNonDefaultServiceAccountAllowed() { // DirectPath should only be used on Compute Engine. // Notice Windows is supported for now. + @VisibleForTesting static boolean isOnComputeEngine() { String osName = System.getProperty("os.name"); if ("Linux".equals(osName)) { - try { - String result = - Files.asCharSource(new File("/sys/class/dmi/id/product_name"), StandardCharsets.UTF_8) - .readFirstLine(); - return result.contains(GCE_PRODUCTION_NAME_PRIOR_2016) - || result.contains(GCE_PRODUCTION_NAME_AFTER_2016); - } catch (IOException ignored) { - return false; - } + String systemProductName = getSystemProductName(); + // systemProductName will be empty string if not on Compute Engine + return systemProductName.contains(GCE_PRODUCTION_NAME_PRIOR_2016) + || systemProductName.contains(GCE_PRODUCTION_NAME_AFTER_2016); } return false; } + private static String getSystemProductName() { + // The static field systemProductName should only be set in tests + if (systemProductName != null) { + return systemProductName; + } + try { + return Files.asCharSource(new File("/sys/class/dmi/id/product_name"), StandardCharsets.UTF_8) + .readFirstLine(); + } catch (IOException e) { + // If not on Compute Engine, FileNotFoundException will be thrown. Use empty string + // as it won't match with the GCE_PRODUCTION_NAME constants + return ""; + } + } + + // Universe Domain configuration is currently only supported in the GDU + @VisibleForTesting + boolean canUseDirectPathWithUniverseDomain() { + return endpoint.contains(Credentials.GOOGLE_DEFAULT_UNIVERSE); + } + @VisibleForTesting ChannelCredentials createMtlsChannelCredentials() throws IOException, GeneralSecurityException { - if (mtlsProvider.useMtlsClientCertificate()) { + if (mtlsProvider == null) { + return null; + } + if (certificateBasedAccess.useMtlsClientCertificate()) { KeyStore mtlsKeyStore = mtlsProvider.getKeyStore(); if (mtlsKeyStore != null) { KeyManagerFactory factory = @@ -301,12 +550,155 @@ ChannelCredentials createMtlsChannelCredentials() throws IOException, GeneralSec return null; } - private ManagedChannel createSingleChannel() throws IOException { - GrpcHeaderInterceptor headerInterceptor = - new GrpcHeaderInterceptor(headerProvider.getHeaders()); - GrpcMetadataHandlerInterceptor metadataHandlerInterceptor = - new GrpcMetadataHandlerInterceptor(); + /** + * Create the S2A-Secured Channel credentials. Load the API using reflection. Once the S2A API is + * stable in gRPC-Java, all callers of this method can simply use the S2A APIs directly and this + * method can be deleted. + * + * @param s2aAddress the address of the S2A server used to secure the connection. + * @param s2aChannelCredentials the credentials to be used when connecting to the S2A. + * @return {@code ChannelCredentials} instance. + */ + ChannelCredentials buildS2AChannelCredentials( + String s2aAddress, ChannelCredentials s2aChannelCredentials) { + try { + // Load the S2A API. + Class s2aChannelCreds = Class.forName("io.grpc.s2a.S2AChannelCredentials"); + Class s2aChannelCredsBuilder = Class.forName("io.grpc.s2a.S2AChannelCredentials$Builder"); + + // Load and invoke the S2A API methods. + Class[] partypes = new Class[2]; + partypes[0] = String.class; + partypes[1] = ChannelCredentials.class; + Method newBuilder = s2aChannelCreds.getMethod("newBuilder", partypes); + Object arglist[] = new Object[2]; + arglist[0] = s2aAddress; + arglist[1] = s2aChannelCredentials; + Object retObjBuilder = newBuilder.invoke(null, arglist); + Method build = s2aChannelCredsBuilder.getMethod("build", null); + Object retObjCreds = build.invoke(retObjBuilder, null); + return (ChannelCredentials) retObjCreds; + } catch (Throwable t) { + LOG.log( + Level.WARNING, + "Falling back to default (TLS without S2A) because S2A APIs cannot be used: " + + t.getMessage()); + return null; + } + } + + /** + * This method creates {@link TlsChannelCredentials} to be used by the client to establish an mTLS + * connection to S2A. Returns null if any of {@param trustBundle}, {@param privateKey} or {@param + * certChain} are missing. + * + * @param trustBundle the trust bundle to be used to establish the client -> S2A mTLS connection + * @param privateKey the client's private key to be used to establish the client -> S2A mtls + * connection + * @param certChain the client's cert chain to be used to establish the client -> S2A mtls + * connection + * @return {@link ChannelCredentials} to use to create an mtls connection between client and S2A + * @throws IOException on error + */ + @VisibleForTesting + ChannelCredentials createMtlsToS2AChannelCredentials( + File trustBundle, File privateKey, File certChain) throws IOException { + if (trustBundle == null || privateKey == null || certChain == null) { + return null; + } + return TlsChannelCredentials.newBuilder() + .keyManager(privateKey, certChain) + .trustManager(trustBundle) + .build(); + } + /** + * This method creates {@link ChannelCredentials} to be used by client to establish a plaintext + * connection to S2A. if {@param plaintextAddress} is not present, returns null. + * + * @param plaintextAddress the address to reach S2A which accepts plaintext connections + * @return {@link ChannelCredentials} to use to create a plaintext connection between client and + * S2A + */ + ChannelCredentials createPlaintextToS2AChannelCredentials(String plaintextAddress) { + if (Strings.isNullOrEmpty(plaintextAddress)) { + return null; + } + return buildS2AChannelCredentials(plaintextAddress, InsecureChannelCredentials.create()); + } + + /** + * This method creates gRPC {@link ChannelCredentials} configured to use S2A to estbalish a mTLS + * connection. First, the address of S2A is discovered by using the {@link S2A} utility to learn + * the {@code mtlsAddress} to reach S2A and the {@code plaintextAddress} to reach S2A. Prefer to + * use the {@code mtlsAddress} address to reach S2A if it is non-empty and the MTLS-MDS + * credentials can successfully be discovered and used to create {@link TlsChannelCredentials}. If + * there is any failure using mTLS-to-S2A, fallback to using a plaintext connection to S2A using + * the {@code plaintextAddress}. If {@code plaintextAddress} is not available, this function + * returns null; in this case S2A will not be used, and a TLS connection to the service will be + * established. + * + * @return {@link ChannelCredentials} configured to use S2A to create mTLS connection. + */ + ChannelCredentials createS2ASecuredChannelCredentials() { + if (s2aChannelCredentials == null) { + // s2aChannelCredentials is initialized once and shared by all instances of the class. + // To prevent a race on initialization, the object initialization is synchronized on the class + // object. + synchronized (InstantiatingGrpcChannelProvider.class) { + if (s2aChannelCredentials != null) { + return s2aChannelCredentials; + } + SecureSessionAgentConfig config = s2aConfigProvider.getConfig(); + String plaintextAddress = config.getPlaintextAddress(); + String mtlsAddress = config.getMtlsAddress(); + if (Strings.isNullOrEmpty(mtlsAddress)) { + // Fallback to plaintext connection to S2A. + LOG.log( + Level.INFO, + "Cannot establish an mTLS connection to S2A because autoconfig endpoint did not return a mtls address to reach S2A."); + s2aChannelCredentials = createPlaintextToS2AChannelCredentials(plaintextAddress); + return s2aChannelCredentials; + } + // Currently, MTLS to MDS is only available on GCE. See: + // https://cloud.google.com/compute/docs/metadata/overview#https-mds + // Try to load MTLS-MDS creds. + File rootFile = new File(MTLS_MDS_ROOT_PATH); + File certKeyFile = new File(MTLS_MDS_CERT_CHAIN_AND_KEY_PATH); + if (rootFile.isFile() && certKeyFile.isFile()) { + // Try to connect to S2A using mTLS. + ChannelCredentials mtlsToS2AChannelCredentials = null; + try { + mtlsToS2AChannelCredentials = + createMtlsToS2AChannelCredentials(rootFile, certKeyFile, certKeyFile); + } catch (IOException ignore) { + // Fallback to plaintext-to-S2A connection on error. + LOG.log( + Level.WARNING, + "Cannot establish an mTLS connection to S2A due to error creating MTLS to MDS TlsChannelCredentials credentials, falling back to plaintext connection to S2A: " + + ignore.getMessage()); + s2aChannelCredentials = createPlaintextToS2AChannelCredentials(plaintextAddress); + return s2aChannelCredentials; + } + s2aChannelCredentials = + buildS2AChannelCredentials(mtlsAddress, mtlsToS2AChannelCredentials); + return s2aChannelCredentials; + } else { + // Fallback to plaintext-to-S2A connection if MTLS-MDS creds do not exist. + LOG.log( + Level.INFO, + "Cannot establish an mTLS connection to S2A because MTLS to MDS credentials do not" + + " exist on filesystem, falling back to plaintext connection to S2A"); + s2aChannelCredentials = createPlaintextToS2AChannelCredentials(plaintextAddress); + return s2aChannelCredentials; + } + } + } + return s2aChannelCredentials; + } + + @InternalApi("For internal use by google-cloud-java clients only") + public ManagedChannelBuilder createChannelBuilder() throws IOException { int colon = endpoint.lastIndexOf(':'); if (colon < 0) { throw new IllegalStateException("invalid endpoint - should have been validated: " + endpoint); @@ -317,15 +709,19 @@ private ManagedChannel createSingleChannel() throws IOException { ManagedChannelBuilder builder; // Check DirectPath traffic. - boolean isDirectPathXdsEnabled = false; - if (isDirectPathEnabled(serviceAddress) - && isNonDefaultServiceAccountAllowed() - && isOnComputeEngine()) { + boolean useDirectPathXds = false; + if (canUseDirectPath()) { CallCredentials callCreds = MoreCallCredentials.from(credentials); + // altsCallCredentials may be null and GoogleDefaultChannelCredentials + // will solely use callCreds. Otherwise it uses altsCallCredentials + // for DirectPath connections and callCreds for CloudPath fallbacks. ChannelCredentials channelCreds = - GoogleDefaultChannelCredentials.newBuilder().callCredentials(callCreds).build(); - isDirectPathXdsEnabled = Boolean.parseBoolean(envProvider.getenv(DIRECT_PATH_ENV_ENABLE_XDS)); - if (isDirectPathXdsEnabled) { + GoogleDefaultChannelCredentials.newBuilder() + .callCredentials(callCreds) + .altsCallCredentials(altsCallCredentials) + .build(); + useDirectPathXds = isDirectPathXdsEnabled(); + if (useDirectPathXds) { // google-c2p: CloudToProd(C2P) Directpath. This scheme is defined in // io.grpc.googleapis.GoogleCloudToProdNameResolverProvider. // This resolver target must not have a port number. @@ -341,24 +737,58 @@ && isOnComputeEngine()) { } else { ChannelCredentials channelCredentials; try { + // Try and create credentials via DCA. See https://google.aip.dev/auth/4114. channelCredentials = createMtlsChannelCredentials(); } catch (GeneralSecurityException e) { throw new IOException(e); } if (channelCredentials != null) { + // Create the channel using channel credentials created via DCA. builder = Grpc.newChannelBuilder(endpoint, channelCredentials); } else { - builder = ManagedChannelBuilder.forAddress(serviceAddress, port); + // Could not create channel credentials via DCA. In accordance with + // https://google.aip.dev/auth/4115, if credentials not available through + // DCA, try mTLS with credentials held by the S2A (Secure Session Agent). + if (useS2A) { + channelCredentials = createS2ASecuredChannelCredentials(); + } + if (channelCredentials != null) { + // Create the channel using S2A-secured channel credentials. + if (mtlsS2ACallCredentials != null) { + // Set {@code mtlsS2ACallCredentials} to be per-RPC call credentials, + // which will be used to fetch MTLS_S2A hard bound tokens from the metdata server. + channelCredentials = + CompositeChannelCredentials.create(channelCredentials, mtlsS2ACallCredentials); + } + // Connect to the MTLS endpoint when using S2A because S2A is used to perform an MTLS + // handshake. + builder = Grpc.newChannelBuilder(mtlsEndpoint, channelCredentials); + } else { + // Use default if we cannot initialize channel credentials via DCA or S2A. + builder = ManagedChannelBuilder.forAddress(serviceAddress, port); + } } } // google-c2p resolver requires service config lookup - if (!isDirectPathXdsEnabled) { + if (!useDirectPathXds) { // See https://github.com/googleapis/gapic-generator/issues/2816 builder.disableServiceConfigLookUp(); } - builder = - builder + return builder; + } + + @InternalApi("For internal use by google-cloud-java clients only") + public ManagedChannelBuilder createDecoratedChannelBuilder() throws IOException { + GrpcHeaderInterceptor headerInterceptor = + new GrpcHeaderInterceptor(headersWithDuplicatesRemoved); + + GrpcMetadataHandlerInterceptor metadataHandlerInterceptor = + new GrpcMetadataHandlerInterceptor(); + + ManagedChannelBuilder builder = + createChannelBuilder() .intercept(new GrpcChannelUUIDInterceptor()) + .intercept(new GrpcLoggingInterceptor()) .intercept(headerInterceptor) .intercept(metadataHandlerInterceptor) .userAgent(headerInterceptor.getUserAgentHeader()) @@ -386,6 +816,12 @@ && isOnComputeEngine()) { builder = channelConfigurator.apply(builder); } + return builder; + } + + private ManagedChannel createSingleChannel() throws IOException { + ManagedChannelBuilder builder = createDecoratedChannelBuilder(); + ManagedChannel managedChannel = builder.build(); if (channelPrimer != null) { channelPrimer.primeChannel(managedChannel); @@ -393,18 +829,71 @@ && isOnComputeEngine()) { return managedChannel; } + /* Remove provided headers that will also get set by {@link com.google.auth.ApiKeyCredentials}. They will be added as part of the grpc call when performing auth + * {@link io.grpc.auth.GoogleAuthLibraryCallCredentials#applyRequestMetadata}. GRPC does not dedup headers {@link https://github.com/grpc/grpc-java/blob/a140e1bb0cfa662bcdb7823d73320eb8d49046f1/api/src/main/java/io/grpc/Metadata.java#L504} so we must before initiating the call. + * + * Note: This is specific for ApiKeyCredentials as duplicate API key headers causes a failure on the back end. At this time we are not sure of the behavior for other credentials. + */ + private void removeApiKeyCredentialDuplicateHeaders() { + if (headerProvider != null) { + headersWithDuplicatesRemoved.putAll(headerProvider.getHeaders()); + } + if (credentials != null && credentials instanceof ApiKeyCredentials) { + try { + Map> credentialRequestMetatData = credentials.getRequestMetadata(); + if (credentialRequestMetatData != null) { + headersWithDuplicatesRemoved.keySet().removeAll(credentialRequestMetatData.keySet()); + } + } catch (IOException e) { + // unreachable, there is no scenario that getRequestMetatData for ApiKeyCredentials will + // throw an IOException + } + } + } + + /** + * Marked as Internal Api and intended for internal use. DirectPath must be enabled via the + * settings and a few other configurations/settings must also be valid for the request to go + * through DirectPath. + * + *

        Checks: 1. Credentials are compatible 2.Running on Compute Engine 3. Universe Domain is + * configured to for the Google Default Universe + * + * @return if DirectPath is enabled for the client AND if the configurations are valid + */ + @InternalApi + public boolean canUseDirectPath() { + return isDirectPathEnabled() + && isCredentialDirectPathCompatible() + && isOnComputeEngine() + && canUseDirectPathWithUniverseDomain(); + } + /** The endpoint to be used for the channel. */ + @Override public String getEndpoint() { return endpoint; } + /** This method is obsolete. Use {@link #getKeepAliveTimeDuration()} instead. */ + @ObsoleteApi("Use getKeepAliveTimeDuration() instead") + public org.threeten.bp.Duration getKeepAliveTime() { + return toThreetenDuration(getKeepAliveTimeDuration()); + } + /** The time without read activity before sending a keepalive ping. */ - public Duration getKeepAliveTime() { + public java.time.Duration getKeepAliveTimeDuration() { return keepAliveTime; } + /** This method is obsolete. Use {@link #getKeepAliveTimeoutDuration()} instead */ + @ObsoleteApi("Use getKeepAliveTimeoutDuration() instead") + public org.threeten.bp.Duration getKeepAliveTimeout() { + return toThreetenDuration(getKeepAliveTimeoutDuration()); + } + /** The time without read activity after sending a keepalive ping. */ - public Duration getKeepAliveTimeout() { + public java.time.Duration getKeepAliveTimeoutDuration() { return keepAliveTimeout; } @@ -419,6 +908,17 @@ public Integer getMaxInboundMetadataSize() { return maxInboundMetadataSize; } + /** The configured channel pool settings used for gRPC's ChannelProvider */ + @BetaApi("Channel pool sizing api is not yet stable") + public ChannelPoolSettings getChannelPoolSettings() { + return channelPoolSettings; + } + + /** Gets the background executor for channel refresh and resize. */ + ScheduledExecutorService getBackgroundExecutor() { + return backgroundExecutor; + } + @Override public boolean shouldAutoClose() { return true; @@ -435,35 +935,47 @@ public static Builder newBuilder() { public static final class Builder { @Deprecated private int processorCount; private Executor executor; + private ScheduledExecutorService backgroundExecutor; private HeaderProvider headerProvider; private String endpoint; + private String mtlsEndpoint; + private boolean useS2A; private EnvironmentProvider envProvider; - private MtlsProvider mtlsProvider = new MtlsProvider(); + private SecureSessionAgent s2aConfigProvider = SecureSessionAgent.create(); + @Nullable private MtlsProvider mtlsProvider; + private CertificateBasedAccess certificateBasedAccess; @Nullable private GrpcInterceptorProvider interceptorProvider; @Nullable private Integer maxInboundMessageSize; @Nullable private Integer maxInboundMetadataSize; - @Nullable private Duration keepAliveTime; - @Nullable private Duration keepAliveTimeout; + @Nullable private java.time.Duration keepAliveTime; + @Nullable private java.time.Duration keepAliveTimeout; @Nullable private Boolean keepAliveWithoutCalls; @Nullable private ApiFunction channelConfigurator; @Nullable private Credentials credentials; + @Nullable private CallCredentials altsCallCredentials; + @Nullable private CallCredentials mtlsS2ACallCredentials; @Nullable private ChannelPrimer channelPrimer; private ChannelPoolSettings channelPoolSettings; @Nullable private Boolean attemptDirectPath; + @Nullable private Boolean attemptDirectPathXds; @Nullable private Boolean allowNonDefaultServiceAccount; @Nullable private ImmutableMap directPathServiceConfig; + private List allowedHardBoundTokenTypes; private Builder() { processorCount = Runtime.getRuntime().availableProcessors(); envProvider = System::getenv; channelPoolSettings = ChannelPoolSettings.staticallySized(1); + allowedHardBoundTokenTypes = new ArrayList<>(); } private Builder(InstantiatingGrpcChannelProvider provider) { this.processorCount = provider.processorCount; this.executor = provider.executor; + this.backgroundExecutor = provider.backgroundExecutor; this.headerProvider = provider.headerProvider; this.endpoint = provider.endpoint; + this.useS2A = provider.useS2A; this.envProvider = provider.envProvider; this.interceptorProvider = provider.interceptorProvider; this.maxInboundMessageSize = provider.maxInboundMessageSize; @@ -473,12 +985,18 @@ private Builder(InstantiatingGrpcChannelProvider provider) { this.keepAliveWithoutCalls = provider.keepAliveWithoutCalls; this.channelConfigurator = provider.channelConfigurator; this.credentials = provider.credentials; + this.altsCallCredentials = provider.altsCallCredentials; + this.mtlsS2ACallCredentials = provider.mtlsS2ACallCredentials; this.channelPrimer = provider.channelPrimer; this.channelPoolSettings = provider.channelPoolSettings; this.attemptDirectPath = provider.attemptDirectPath; + this.attemptDirectPathXds = provider.attemptDirectPathXds; this.allowNonDefaultServiceAccount = provider.allowNonDefaultServiceAccount; + this.allowedHardBoundTokenTypes = provider.allowedHardBoundTokenTypes; this.directPathServiceConfig = provider.directPathServiceConfig; this.mtlsProvider = provider.mtlsProvider; + this.certificateBasedAccess = provider.certificateBasedAccess; + this.s2aConfigProvider = provider.s2aConfigProvider; } /** @@ -506,12 +1024,23 @@ public Builder setExecutor(Executor executor) { return this; } - /** @deprecated Please use {@link #setExecutor(Executor)}. */ + /** + * @deprecated Please use {@link #setExecutor(Executor)}. + */ @Deprecated public Builder setExecutorProvider(ExecutorProvider executorProvider) { return setExecutor((Executor) executorProvider.getExecutor()); } + /** + * Sets the background executor for this TransportChannelProvider. The life cycle of the + * executor should be managed by the caller. + */ + public Builder setBackgroundExecutor(ScheduledExecutorService executor) { + this.backgroundExecutor = executor; + return this; + } + /** * Sets the HeaderProvider for this TransportChannelProvider. * @@ -531,12 +1060,53 @@ public Builder setEndpoint(String endpoint) { return this; } + /** Sets the mTLS Endpoint used to reach the service, eg "localhost:8080". */ + @InternalApi("This public method is used by Gax to help configure the MTLS endpoint for S2A") + public Builder setMtlsEndpoint(String mtlsEndpoint) { + validateEndpoint(mtlsEndpoint); + this.mtlsEndpoint = mtlsEndpoint; + return this; + } + + Builder setUseS2A(boolean useS2A) { + this.useS2A = useS2A; + return this; + } + + /* + * Sets the allowed hard bound token types for this TransportChannelProvider. + * + *

        The list of + * {@link HardBoundTokenTypes} indicates for which methods of connecting to Google APIs hard bound tokens should + * be used. This is optional; if it is not provided, bearer tokens will be used. + */ + @InternalApi + public Builder setAllowHardBoundTokenTypes(List allowedValues) { + this.allowedHardBoundTokenTypes = + Preconditions.checkNotNull( + allowedValues, "List of allowed HardBoundTokenTypes cannot be null"); + ; + return this; + } + @VisibleForTesting Builder setMtlsProvider(MtlsProvider mtlsProvider) { this.mtlsProvider = mtlsProvider; return this; } + @VisibleForTesting + Builder setCertificateBasedAccess(CertificateBasedAccess certificateBasedAccess) { + this.certificateBasedAccess = certificateBasedAccess; + return this; + } + + @VisibleForTesting + Builder setS2AConfigProvider(SecureSessionAgent s2aConfigProvider) { + this.s2aConfigProvider = s2aConfigProvider; + return this; + } + /** * Sets the GrpcInterceptorProvider for this TransportChannelProvider. * @@ -579,25 +1149,54 @@ public Integer getMaxInboundMetadataSize() { return maxInboundMetadataSize; } + /** + * This method is obsolete. Use {@link #setKeepAliveTimeDuration(java.time.Duration)} instead. + */ + @ObsoleteApi("Use setKeepAliveTimeDuration(java.time.Duration) instead") + public Builder setKeepAliveTime(org.threeten.bp.Duration duration) { + return setKeepAliveTimeDuration(toJavaTimeDuration(duration)); + } + /** The time without read activity before sending a keepalive ping. */ - public Builder setKeepAliveTime(Duration duration) { + public Builder setKeepAliveTimeDuration(java.time.Duration duration) { this.keepAliveTime = duration; return this; } + /** This method is obsolete. Use {@link #getKeepAliveTimeDuration()} instead. */ + @ObsoleteApi("Use getKeepAliveTimeDuration() instead") + public org.threeten.bp.Duration getKeepAliveTime() { + return toThreetenDuration(getKeepAliveTimeDuration()); + } + /** The time without read activity before sending a keepalive ping. */ - public Duration getKeepAliveTime() { + public java.time.Duration getKeepAliveTimeDuration() { return keepAliveTime; } + /** + * This method is obsolete. Use {@link #setKeepAliveTimeoutDuration(java.time.Duration)} + * instead. + */ + @ObsoleteApi("Use setKeepAliveTimeoutDuration(java.time.Duration) instead") + public Builder setKeepAliveTimeout(org.threeten.bp.Duration duration) { + return setKeepAliveTimeoutDuration(toJavaTimeDuration(duration)); + } + /** The time without read activity after sending a keepalive ping. */ - public Builder setKeepAliveTimeout(Duration duration) { + public Builder setKeepAliveTimeoutDuration(java.time.Duration duration) { this.keepAliveTimeout = duration; return this; } + /** This method is obsolete. Use {@link #getKeepAliveTimeoutDuration()} instead */ + @ObsoleteApi("Use getKeepAliveTimeoutDuration() instead") + public org.threeten.bp.Duration getKeepAliveTimeout() { + return toThreetenDuration(getKeepAliveTimeoutDuration()); + } + /** The time without read activity after sending a keepalive ping. */ - public Duration getKeepAliveTimeout() { + public java.time.Duration getKeepAliveTimeoutDuration() { return keepAliveTimeout; } @@ -612,26 +1211,34 @@ public Boolean getKeepAliveWithoutCalls() { return keepAliveWithoutCalls; } - /** @deprecated Please use {@link #setChannelPoolSettings(ChannelPoolSettings)} */ + /** + * @deprecated Please use {@link #setChannelPoolSettings(ChannelPoolSettings)} + */ @Deprecated public int getPoolSize() { return channelPoolSettings.getInitialChannelCount(); } - /** @deprecated Please use {@link #setChannelPoolSettings(ChannelPoolSettings)} */ + /** + * @deprecated Please use {@link #setChannelPoolSettings(ChannelPoolSettings)} + */ @Deprecated public Builder setPoolSize(int poolSize) { channelPoolSettings = ChannelPoolSettings.staticallySized(poolSize); return this; } - /** @deprecated Please use {@link #setChannelPoolSettings(ChannelPoolSettings)} */ + /** + * @deprecated Please use {@link #setChannelPoolSettings(ChannelPoolSettings)} + */ @Deprecated public Builder setChannelsPerCpu(double multiplier) { return setChannelsPerCpu(multiplier, 100); } - /** @deprecated Please use {@link #setChannelPoolSettings(ChannelPoolSettings)} */ + /** + * @deprecated Please use {@link #setChannelPoolSettings(ChannelPoolSettings)} + */ @Deprecated public Builder setChannelsPerCpu(double multiplier, int maxChannels) { Preconditions.checkArgument(multiplier > 0, "multiplier must be positive"); @@ -684,6 +1291,19 @@ public Builder setAllowNonDefaultServiceAccount(boolean allowNonDefaultServiceAc return this; } + /** Use DirectPath xDS. Only valid if DirectPath is attempted. */ + @InternalApi("For internal use by google-cloud-java clients only") + public Builder setAttemptDirectPathXds() { + this.attemptDirectPathXds = true; + return this; + } + + @VisibleForTesting + Builder setEnvProvider(EnvironmentProvider envProvider) { + this.envProvider = envProvider; + return this; + } + /** * Sets a service config for direct path. If direct path is not enabled, the provided service * config will be ignored. @@ -699,8 +1319,102 @@ public Builder setDirectPathServiceConfig(Map serviceConfig) { return this; } + boolean isMtlsS2AHardBoundTokensEnabled() { + // If S2A cannot be used, the list of allowed hard bound token types is empty or doesn't + // contain + // {@code HardBoundTokenTypes.MTLS_S2A}, the {@code credentials} are null or not of type + // {@code + // ComputeEngineCredentials} then {@code HardBoundTokenTypes.MTLS_S2A} hard bound tokens + // should + // not + // be used. {@code HardBoundTokenTypes.MTLS_S2A} hard bound tokens can only be used on MTLS + // channels established using S2A and when tokens from MDS (i.e {@code + // ComputeEngineCredentials} + // are being used. + if (!this.useS2A + || this.allowedHardBoundTokenTypes.isEmpty() + || this.credentials == null + || !(this.credentials instanceof ComputeEngineCredentials)) { + return false; + } + return allowedHardBoundTokenTypes.stream() + .anyMatch(val -> val.equals(HardBoundTokenTypes.MTLS_S2A)); + } + + boolean isDirectPathBoundTokenEnabled() { + // If the list of allowed hard bound token types is empty or doesn't contain + // {@code HardBoundTokenTypes.ALTS}, the {@code credentials} are null or not of type + // {@code ComputeEngineCredentials} then DirectPath hard bound tokens should not be used. + // DirectPath hard bound tokens should only be used on ALTS channels. + if (allowedHardBoundTokenTypes.isEmpty() + || this.credentials == null + || !(credentials instanceof ComputeEngineCredentials)) return false; + return allowedHardBoundTokenTypes.stream() + .anyMatch(val -> val.equals(HardBoundTokenTypes.ALTS)); + } + + CallCredentials createHardBoundTokensCallCredentials( + ComputeEngineCredentials.GoogleAuthTransport googleAuthTransport, + ComputeEngineCredentials.BindingEnforcement bindingEnforcement) { + ComputeEngineCredentials.Builder credsBuilder = + ((ComputeEngineCredentials) credentials).toBuilder(); + // We only set scopes and HTTP transport factory from the original credentials because + // only those are used in gRPC CallCredentials to fetch request metadata. We create a new + // credential + // via {@code newBuilder} as opposed to {@code toBuilder} because we don't want a reference to + // the + // access token held by {@code credentials}; we want this new credential to fetch a new access + // token + // from MDS using the {@param googleAuthTransport} and {@param bindingEnforcement}. + return MoreCallCredentials.from( + ComputeEngineCredentials.newBuilder() + .setScopes(credsBuilder.getScopes()) + .setHttpTransportFactory(credsBuilder.getHttpTransportFactory()) + .setGoogleAuthTransport(googleAuthTransport) + .setBindingEnforcement(bindingEnforcement) + .build()); + } + public InstantiatingGrpcChannelProvider build() { - return new InstantiatingGrpcChannelProvider(this); + if (certificateBasedAccess == null) { + certificateBasedAccess = CertificateBasedAccess.createWithSystemEnv(); + } + if (certificateBasedAccess.useMtlsClientCertificate()) { + if (mtlsProvider == null) { + // Attempt to create default MtlsProvider from environment. + try { + mtlsProvider = DefaultMtlsProviderFactory.create(); + } catch (CertificateSourceUnavailableException e) { + // This is okay. Leave mtlsProvider as null so that we will not auto-upgrade + // to mTLS endpoints. See https://google.aip.dev/auth/4114. + } catch (IOException e) { + LOG.log( + Level.WARNING, + "DefaultMtlsProviderFactory encountered unexpected IOException: " + e.getMessage()); + LOG.log( + Level.WARNING, + "mTLS configuration was detected on the device, but mTLS failed to initialize. Falling back to non-mTLS channel."); + } + } + } + + if (isMtlsS2AHardBoundTokensEnabled()) { + // Set a {@code ComputeEngineCredentials} instance to be per-RPC call credentials, + // which will be used to fetch MTLS_S2A hard bound tokens from the metdata server. + this.mtlsS2ACallCredentials = + createHardBoundTokensCallCredentials( + ComputeEngineCredentials.GoogleAuthTransport.MTLS, + ComputeEngineCredentials.BindingEnforcement.ON); + } + if (isDirectPathBoundTokenEnabled()) { + this.altsCallCredentials = + createHardBoundTokensCallCredentials( + ComputeEngineCredentials.GoogleAuthTransport.ALTS, null); + } + InstantiatingGrpcChannelProvider instantiatingGrpcChannelProvider = + new InstantiatingGrpcChannelProvider(this); + instantiatingGrpcChannelProvider.removeApiKeyCredentialDuplicateHeaders(); + return instantiatingGrpcChannelProvider; } /** @@ -724,7 +1438,7 @@ public ApiFunction getChannelConfi } private static ImmutableMap getDefaultDirectPathServiceConfig() { - // When channel pooling is enabled, force the pick_first grpclb strategy. + // When channel pooling is enabled, force the pick_first strategy. // This is necessary to avoid the multiplicative effect of creating channel pool with // `poolSize` number of `ManagedChannel`s, each with a `subSetting` number of number of // subchannels. @@ -733,13 +1447,8 @@ public ApiFunction getChannelConfi ImmutableMap pickFirstStrategy = ImmutableMap.of("pick_first", ImmutableMap.of()); - ImmutableMap childPolicy = - ImmutableMap.of("childPolicy", ImmutableList.of(pickFirstStrategy)); - - ImmutableMap grpcLbPolicy = - ImmutableMap.of("grpclb", childPolicy); - - return ImmutableMap.of("loadBalancingConfig", ImmutableList.of(grpcLbPolicy)); + return ImmutableMap.of( + "loadBalancingConfig", ImmutableList.of(pickFirstStrategy)); } private static void validateEndpoint(String endpoint) { diff --git a/gax-java/gax-grpc/src/main/java/com/google/api/gax/grpc/nativeimage/GrpcNettyFeature.java b/gax-java/gax-grpc/src/main/java/com/google/api/gax/grpc/nativeimage/GrpcNettyFeature.java index c2cf0a28d2..88266332dc 100644 --- a/gax-java/gax-grpc/src/main/java/com/google/api/gax/grpc/nativeimage/GrpcNettyFeature.java +++ b/gax-java/gax-grpc/src/main/java/com/google/api/gax/grpc/nativeimage/GrpcNettyFeature.java @@ -78,6 +78,33 @@ private static void loadGrpcNettyClasses(BeforeAnalysisAccess access) { registerClassForReflection(access, "io.grpc.netty.shaded.io.netty.util.ReferenceCountUtil"); registerClassForReflection( access, "io.grpc.netty.shaded.io.netty.buffer.AbstractByteBufAllocator"); + registerForUnsafeFieldAccess( + access, "io.grpc.netty.shaded.io.netty.buffer.AbstractReferenceCountedByteBuf", "refCnt"); + registerForUnsafeFieldAccess( + access, "io.grpc.netty.shaded.io.netty.util.AbstractReferenceCounted", "refCnt"); + registerClassForReflection(access, "io.grpc.netty.shaded.io.netty.channel.DefaultFileRegion"); + registerClassForReflection( + access, "io.grpc.netty.shaded.io.netty.channel.unix.PeerCredentials"); + registerClassForReflection( + access, "io.grpc.netty.shaded.io.netty.channel.DefaultChannelPipeline"); + registerClassForReflection( + access, "io.grpc.netty.shaded.io.grpc.netty.WriteBufferingAndExceptionHandler"); + registerClassForReflection( + access, "io.grpc.netty.shaded.io.netty.channel.ProtocolNegotiators"); + registerClassForReflection(access, "io.grpc.netty.shaded.io.netty.handler.ssl.SslHandler"); + registerClassForReflection(access, "io.grpc.netty.shaded.io.grpc.netty.NettyClientHandler"); + registerClassForReflection( + access, "io.grpc.netty.shaded.io.netty.channel.DefaultChannelPipeline$HeadContext"); + registerClassForReflection( + access, "io.grpc.netty.shaded.io.netty.channel.DefaultChannelPipeline$TailContext"); + registerClassForReflection( + access, "io.grpc.netty.shaded.io.grpc.netty.ProtocolNegotiators$WaitUntilActiveHandler"); + registerClassForReflection( + access, "io.grpc.netty.shaded.io.grpc.netty.ProtocolNegotiators$ClientTlsHandler"); + registerClassForReflection( + access, "io.grpc.netty.shaded.io.grpc.netty.ProtocolNegotiators$GrpcNegotiationHandler"); + registerClassForReflection( + access, "io.grpc.netty.shaded.io.netty.channel.ChannelHandlerMask"); // Epoll Libraries registerClassForReflection(access, "io.grpc.netty.shaded.io.netty.channel.epoll.Epoll"); @@ -89,6 +116,24 @@ private static void loadGrpcNettyClasses(BeforeAnalysisAccess access) { access, "io.grpc.netty.shaded.io.netty.channel.epoll.EpollServerSocketChannel"); registerForReflectiveInstantiation( access, "io.grpc.netty.shaded.io.netty.channel.epoll.EpollSocketChannel"); + registerClassForReflection( + access, + "io.grpc.netty.shaded.io.netty.channel.epoll.NativeDatagramPacketArray$NativeDatagramPacket"); + + // tcnative + registerClassForReflection( + access, "io.grpc.netty.shaded.io.netty.internal.tcnative.CertificateCallback"); + registerClassForReflection( + access, "io.grpc.netty.shaded.io.netty.internal.tcnative.CertificateCallbackTask"); + registerClassForReflection( + access, "io.grpc.netty.shaded.io.netty.internal.tcnative.SSLContext"); + registerClassForReflection( + access, "io.grpc.netty.shaded.io.netty.internal.tcnative.SSLPrivateKeyMethodDecryptTask"); + registerClassForReflection( + access, "io.grpc.netty.shaded.io.netty.internal.tcnative.SSLPrivateKeyMethodSignTask"); + registerClassForReflection( + access, "io.grpc.netty.shaded.io.netty.internal.tcnative.SSLPrivateKeyMethodTask"); + registerClassForReflection(access, "io.grpc.netty.shaded.io.netty.internal.tcnative.SSLTask"); // Unsafe field accesses registerForUnsafeFieldAccess( @@ -103,6 +148,21 @@ private static void loadGrpcNettyClasses(BeforeAnalysisAccess access) { access, NETTY_SHADED_PACKAGE + "org.jctools.queues.MpscArrayQueueConsumerIndexField", "consumerIndex"); + registerForUnsafeFieldAccess( + access, + NETTY_SHADED_PACKAGE + + "org.jctools.queues.unpadded.MpscUnpaddedArrayQueueProducerIndexField", + "producerIndex"); + registerForUnsafeFieldAccess( + access, + NETTY_SHADED_PACKAGE + + "org.jctools.queues.unpadded.MpscUnpaddedArrayQueueProducerLimitField", + "producerLimit"); + registerForUnsafeFieldAccess( + access, + NETTY_SHADED_PACKAGE + + "org.jctools.queues.unpadded.MpscUnpaddedArrayQueueConsumerIndexField", + "consumerIndex"); registerForUnsafeFieldAccess( access, NETTY_SHADED_PACKAGE + "org.jctools.queues.BaseMpscLinkedArrayQueueProducerFields", @@ -115,6 +175,21 @@ private static void loadGrpcNettyClasses(BeforeAnalysisAccess access) { access, NETTY_SHADED_PACKAGE + "org.jctools.queues.BaseMpscLinkedArrayQueueConsumerFields", "consumerIndex"); + registerForUnsafeFieldAccess( + access, + NETTY_SHADED_PACKAGE + + "org.jctools.queues.unpadded.BaseMpscLinkedUnpaddedArrayQueueProducerFields", + "producerIndex"); + registerForUnsafeFieldAccess( + access, + NETTY_SHADED_PACKAGE + + "org.jctools.queues.unpadded.BaseMpscLinkedUnpaddedArrayQueueColdProducerFields", + "producerLimit"); + registerForUnsafeFieldAccess( + access, + NETTY_SHADED_PACKAGE + + "org.jctools.queues.unpadded.BaseMpscLinkedUnpaddedArrayQueueConsumerFields", + "consumerIndex"); } } @@ -122,7 +197,7 @@ private static void loadGrpcNettyClasses(BeforeAnalysisAccess access) { private static void loadMiscClasses(BeforeAnalysisAccess access) { registerClassHierarchyForReflection(access, "com.google.protobuf.DescriptorProtos"); registerClassForReflection(access, "com.google.api.FieldBehavior"); - + registerClassForReflection(access, "java.time.Instant"); registerForUnsafeFieldAccess(access, "javax.net.ssl.SSLContext", "contextSpi"); } } diff --git a/gax-java/gax-grpc/src/main/java/com/google/api/gax/grpc/nativeimage/ProtobufMessageFeature.java b/gax-java/gax-grpc/src/main/java/com/google/api/gax/grpc/nativeimage/ProtobufMessageFeature.java deleted file mode 100644 index edea6dee7a..0000000000 --- a/gax-java/gax-grpc/src/main/java/com/google/api/gax/grpc/nativeimage/ProtobufMessageFeature.java +++ /dev/null @@ -1,117 +0,0 @@ -/* - * Copyright 2022 Google LLC - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following disclaimer - * in the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Google LLC nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -package com.google.api.gax.grpc.nativeimage; - -import com.google.api.gax.nativeimage.NativeImageUtils; -import java.lang.reflect.Method; -import java.util.Arrays; -import java.util.List; -import org.graalvm.nativeimage.hosted.Feature; -import org.graalvm.nativeimage.hosted.RuntimeReflection; - -/** - * A optional feature which registers reflective usages of the GRPC Protobuf libraries. - * - *

        This feature is only needed if you need to access proto objects reflectively (such as - * printing/logging proto objects). - */ -final class ProtobufMessageFeature implements Feature { - - // Proto classes to check on the classpath. - private static final String PROTO_MESSAGE_CLASS = "com.google.protobuf.GeneratedMessageV3"; - private static final String PROTO_ENUM_CLASS = "com.google.protobuf.ProtocolMessageEnum"; - private static final String ENUM_VAL_DESCRIPTOR_CLASS = - "com.google.protobuf.Descriptors$EnumValueDescriptor"; - - // Prefixes of methods accessed reflectively by - // com.google.protobuf.GeneratedMessageV3$ReflectionInvoker - private static final List METHOD_ACCESSOR_PREFIXES = - Arrays.asList("get", "set", "has", "add", "clear", "newBuilder"); - - @Override - public void beforeAnalysis(BeforeAnalysisAccess access) { - Class protoMessageClass = access.findClassByName(PROTO_MESSAGE_CLASS); - if (protoMessageClass != null) { - Method internalAccessorMethod = - NativeImageUtils.getMethodOrFail(protoMessageClass, "internalGetFieldAccessorTable"); - - // Finds every class whose `internalGetFieldAccessorTable()` is reached and registers it. - // `internalGetFieldAccessorTable()` is used downstream to access the class reflectively. - access.registerMethodOverrideReachabilityHandler( - (duringAccess, method) -> { - registerFieldAccessors(method.getDeclaringClass()); - registerFieldAccessors(getBuilderClass(method.getDeclaringClass())); - }, - internalAccessorMethod); - } - - Class protoEnumClass = access.findClassByName(PROTO_ENUM_CLASS); - if (protoEnumClass != null) { - // Finds every reachable proto enum class and registers specific methods for reflection. - access.registerSubtypeReachabilityHandler( - (duringAccess, subtypeClass) -> { - if (!PROTO_ENUM_CLASS.equals(subtypeClass.getName())) { - Method method = - NativeImageUtils.getMethodOrFail( - subtypeClass, - "valueOf", - duringAccess.findClassByName(ENUM_VAL_DESCRIPTOR_CLASS)); - RuntimeReflection.register(method); - - method = NativeImageUtils.getMethodOrFail(subtypeClass, "getValueDescriptor"); - RuntimeReflection.register(method); - } - }, - protoEnumClass); - } - } - - /** Given a proto class, registers the public accessor methods for the provided proto class. */ - private static void registerFieldAccessors(Class protoClass) { - for (Method method : protoClass.getMethods()) { - boolean hasAccessorPrefix = - METHOD_ACCESSOR_PREFIXES.stream().anyMatch(prefix -> method.getName().startsWith(prefix)); - if (hasAccessorPrefix) { - RuntimeReflection.register(method); - } - } - } - - /** Given a proto class, returns the Builder nested class. */ - private static Class getBuilderClass(Class protoClass) { - for (Class clazz : protoClass.getClasses()) { - if (clazz.getName().endsWith("Builder")) { - return clazz; - } - } - return null; - } -} diff --git a/gax-java/gax-grpc/src/main/java/com/google/longrunning/stub/OperationsStubSettings.java b/gax-java/gax-grpc/src/main/java/com/google/longrunning/stub/OperationsStubSettings.java index 85da6db5c1..47c3a981b8 100644 --- a/gax-java/gax-grpc/src/main/java/com/google/longrunning/stub/OperationsStubSettings.java +++ b/gax-java/gax-grpc/src/main/java/com/google/longrunning/stub/OperationsStubSettings.java @@ -63,7 +63,6 @@ import com.google.longrunning.WaitOperationRequest; import com.google.protobuf.Empty; import java.io.IOException; -import org.threeten.bp.Duration; /** Settings class to configure an instance of {@link OperationsStub}. */ public class OperationsStubSettings extends StubSettings { @@ -243,13 +242,13 @@ public static class Builder extends StubSettings.Builder", + "parameterTypes": [] + } + ] + }, + { + "name": "com.sun.jndi.dns.DnsContextFactory" + }, + { + "name": "io.grpc.internal.DnsNameResolverProvider" + }, + { + "name": "io.grpc.internal.JndiResourceResolverFactory", + "methods": [ + { + "name": "", + "parameterTypes": [] + } + ] + }, + { + "name": "io.grpc.internal.PickFirstLoadBalancerProvider" + }, + { + "name": "io.grpc.util.SecretRoundRobinLoadBalancerProvider$Provider", + "methods": [ + { + "name": "", + "parameterTypes": [] + } + ] + }, + { + "name": "java.io.FileDescriptor" + }, + { + "name": "java.lang.Exception" + }, + { + "name": "java.lang.IllegalArgumentException" + }, + { + "name": "java.lang.NullPointerException" + }, + { + "name": "java.lang.Object", + "allDeclaredFields": true, + "queryAllDeclaredMethods": true + }, + { + "name": "java.lang.OutOfMemoryError" + }, + { + "name": "java.lang.String" + }, + { + "name": "java.lang.Throwable", + "methods": [ + { + "name": "addSuppressed", + "parameterTypes": [ + "java.lang.Throwable" + ] + } + ] + }, + { + "name": "java.nio.Bits", + "fields": [ + { + "name": "UNALIGNED" + } + ] + }, + { + "name": "java.nio.Buffer", + "fields": [ + { + "name": "address" + } + ] + }, + { + "name": "java.nio.ByteBuffer", + "methods": [ + { + "name": "alignedSlice", + "parameterTypes": [ + "int" + ] + } + ] + }, + { + "name": "java.nio.DirectByteBuffer", + "methods": [ + { + "name": "", + "parameterTypes": [ + "long", + "int" + ] + } + ] + }, + { + "name": "java.nio.channels.FileChannel" + }, + { + "name": "java.security.AlgorithmParametersSpi" + }, + { + "name": "java.security.KeyStoreSpi" + }, + { + "name": "java.security.MessageDigestSpi" + }, + { + "name": "java.security.SecureRandomParameters" + }, + { + "name": "java.sql.Date" + }, + { + "name": "java.time.Duration", + "allDeclaredFields": true + }, + { + "name": "java.util.AbstractMap", + "allDeclaredFields": true + }, + { + "name": "java.util.concurrent.atomic.LongAdder", + "queryAllPublicConstructors": true, + "methods": [ + { + "name": "", + "parameterTypes": [] + }, + { + "name": "add", + "parameterTypes": [ + "long" + ] + }, + { + "name": "sum", + "parameterTypes": [] + } + ] + }, + { + "name": "javax.naming.directory.InitialDirContext" + }, + { + "name": "javax.security.auth.x500.X500Principal", + "fields": [ + { + "name": "thisX500Name" + } + ], + "methods": [ + { + "name": "", + "parameterTypes": [ + "sun.security.x509.X500Name" + ] + } + ] + }, + { + "name": "jdk.internal.misc.Unsafe", + "methods": [ + { + "name": "getUnsafe", + "parameterTypes": [] + } + ] + }, + { + "name": "sun.misc.Unsafe", + "fields": [ + { + "name": "theUnsafe" + } + ], + "methods": [ + { + "name": "copyMemory", + "parameterTypes": [ + "java.lang.Object", + "long", + "java.lang.Object", + "long", + "long" + ] + }, + { + "name": "getAndAddLong", + "parameterTypes": [ + "java.lang.Object", + "long", + "long" + ] + }, + { + "name": "getAndSetObject", + "parameterTypes": [ + "java.lang.Object", + "long", + "java.lang.Object" + ] + }, + { + "name": "invokeCleaner", + "parameterTypes": [ + "java.nio.ByteBuffer" + ] + }, + { + "name": "storeFence", + "parameterTypes": [] + } + ] + }, + { + "name": "sun.nio.ch.SelectorImpl", + "fields": [ + { + "name": "publicSelectedKeys" + }, + { + "name": "selectedKeys" + } + ] + }, + { + "name" : "com.google.auth.oauth2.ServiceAccountCredentials", + "allDeclaredConstructors" : true, + "allPublicConstructors" : true, + "allDeclaredMethods" : true, + "allPublicMethods" : true, + "allDeclaredFields" : true, + "allPublicFields" : true, + "queryAllPublicConstructors" : true, + "queryAllDeclaredConstructors" : true, + "queryAllPublicMethods" : true, + "queryAllDeclaredMethods" : true + }, + { + "name" : "org.apache.commons.pool2.impl.DefaultEvictionPolicy", + "allDeclaredConstructors" : true, + "allPublicConstructors" : true, + "allDeclaredMethods" : true, + "allPublicMethods" : true, + "allDeclaredFields" : true, + "allPublicFields" : true, + "queryAllPublicConstructors" : true, + "queryAllDeclaredConstructors" : true, + "queryAllPublicMethods" : true, + "queryAllDeclaredMethods" : true + }, + { + "name" : "java.nio.channels.spi.SelectorProvider", + "allDeclaredConstructors" : true, + "allPublicConstructors" : true, + "allDeclaredMethods" : true, + "allPublicMethods" : true, + "allDeclaredFields" : true, + "allPublicFields" : true, + "queryAllPublicConstructors" : true, + "queryAllDeclaredConstructors" : true, + "queryAllPublicMethods" : true, + "queryAllDeclaredMethods" : true + } +] diff --git a/gax-java/gax-grpc/src/test/java/com/google/api/gax/grpc/CallOptionsUtilTest.java b/gax-java/gax-grpc/src/test/java/com/google/api/gax/grpc/CallOptionsUtilTest.java index 26a6b925f8..e9bba5d63d 100644 --- a/gax-java/gax-grpc/src/test/java/com/google/api/gax/grpc/CallOptionsUtilTest.java +++ b/gax-java/gax-grpc/src/test/java/com/google/api/gax/grpc/CallOptionsUtilTest.java @@ -29,19 +29,20 @@ */ package com.google.api.gax.grpc; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertSame; -import static org.junit.Assert.assertTrue; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertSame; +import static org.junit.jupiter.api.Assertions.assertThrows; +import static org.junit.jupiter.api.Assertions.assertTrue; import com.google.common.collect.ImmutableMap; import io.grpc.CallOptions; import io.grpc.Metadata.Key; import java.util.Map; -import org.junit.Test; +import org.junit.jupiter.api.Test; -public class CallOptionsUtilTest { +class CallOptionsUtilTest { @Test - public void testPutAndGetDynamicHeaderOption() { + void testPutAndGetDynamicHeaderOption() { String encodedRequestParams = "param1=value¶m2.param3=value23"; CallOptions options = CallOptionsUtil.putRequestParamsDynamicHeaderOption( @@ -54,7 +55,7 @@ public void testPutAndGetDynamicHeaderOption() { } @Test - public void testPutAndGetDynamicHeaderOptionEmpty() { + void testPutAndGetDynamicHeaderOptionEmpty() { CallOptions options = CallOptionsUtil.putRequestParamsDynamicHeaderOption(CallOptions.DEFAULT, ""); assertSame(CallOptions.DEFAULT, options); @@ -62,8 +63,10 @@ public void testPutAndGetDynamicHeaderOptionEmpty() { assertTrue(headers.isEmpty()); } - @Test(expected = NullPointerException.class) - public void testPutAndGetHeaderOptionNull() { - CallOptionsUtil.putRequestParamsDynamicHeaderOption(CallOptions.DEFAULT, null); + @Test + void testPutAndGetHeaderOptionNull() { + assertThrows( + NullPointerException.class, + () -> CallOptionsUtil.putRequestParamsDynamicHeaderOption(CallOptions.DEFAULT, null)); } } diff --git a/gax-java/gax-grpc/src/test/java/com/google/api/gax/grpc/ChannelPoolTest.java b/gax-java/gax-grpc/src/test/java/com/google/api/gax/grpc/ChannelPoolTest.java index 1bf4726532..55a99c1481 100644 --- a/gax-java/gax-grpc/src/test/java/com/google/api/gax/grpc/ChannelPoolTest.java +++ b/gax-java/gax-grpc/src/test/java/com/google/api/gax/grpc/ChannelPoolTest.java @@ -29,11 +29,24 @@ */ package com.google.api.gax.grpc; +import static com.google.api.gax.grpc.testing.FakeServiceGrpc.METHOD_RECOGNIZE; +import static com.google.api.gax.grpc.testing.FakeServiceGrpc.METHOD_SERVER_STREAMING_RECOGNIZE; import static com.google.common.truth.Truth.assertThat; +import com.google.api.core.ApiFuture; +import com.google.api.gax.core.FixedExecutorProvider; import com.google.api.gax.grpc.testing.FakeChannelFactory; import com.google.api.gax.grpc.testing.FakeMethodDescriptor; -import com.google.api.gax.grpc.testing.FakeServiceGrpc; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.EndpointContext; +import com.google.api.gax.rpc.ResponseObserver; +import com.google.api.gax.rpc.ServerStreamingCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.api.gax.rpc.StreamController; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.api.gax.util.FakeLogHandler; +import com.google.auth.Credentials; import com.google.common.collect.ImmutableList; import com.google.common.collect.Lists; import com.google.type.Color; @@ -49,46 +62,60 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.List; +import java.util.concurrent.CancellationException; import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; import java.util.concurrent.ScheduledExecutorService; import java.util.concurrent.ScheduledFuture; import java.util.concurrent.TimeUnit; import java.util.concurrent.atomic.AtomicInteger; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.junit.runners.JUnit4; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; import org.mockito.ArgumentCaptor; import org.mockito.Mockito; import org.mockito.stubbing.Answer; -@RunWith(JUnit4.class) -public class ChannelPoolTest { +class ChannelPoolTest { + private static final int DEFAULT_AWAIT_TERMINATION_SEC = 10; + private ChannelPool pool; + + @AfterEach + void cleanup() throws InterruptedException { + if (pool != null) { + pool.shutdown(); + pool.awaitTermination(DEFAULT_AWAIT_TERMINATION_SEC, TimeUnit.SECONDS); + } + } + @Test - public void testAuthority() throws IOException { + void testAuthority() throws IOException { ManagedChannel sub1 = Mockito.mock(ManagedChannel.class); ManagedChannel sub2 = Mockito.mock(ManagedChannel.class); Mockito.when(sub1.authority()).thenReturn("myAuth"); - ChannelPool pool = + pool = ChannelPool.create( ChannelPoolSettings.staticallySized(2), - new FakeChannelFactory(Arrays.asList(sub1, sub2))); + new FakeChannelFactory(Arrays.asList(sub1, sub2)), + null); assertThat(pool.authority()).isEqualTo("myAuth"); } @Test - public void testRoundRobin() throws IOException { + void testRoundRobin() throws IOException { ManagedChannel sub1 = Mockito.mock(ManagedChannel.class); ManagedChannel sub2 = Mockito.mock(ManagedChannel.class); Mockito.when(sub1.authority()).thenReturn("myAuth"); ArrayList channels = Lists.newArrayList(sub1, sub2); - ChannelPool pool = + pool = ChannelPool.create( - ChannelPoolSettings.staticallySized(channels.size()), new FakeChannelFactory(channels)); + ChannelPoolSettings.staticallySized(channels.size()), + new FakeChannelFactory(channels), + null); verifyTargetChannel(pool, channels, sub1); verifyTargetChannel(pool, channels, sub2); @@ -97,7 +124,7 @@ public void testRoundRobin() throws IOException { private void verifyTargetChannel( ChannelPool pool, List channels, ManagedChannel targetChannel) { - MethodDescriptor methodDescriptor = FakeServiceGrpc.METHOD_RECOGNIZE; + MethodDescriptor methodDescriptor = METHOD_RECOGNIZE; CallOptions callOptions = CallOptions.DEFAULT; @SuppressWarnings("unchecked") ClientCall expectedClientCall = Mockito.mock(ClientCall.class); @@ -118,12 +145,12 @@ private void verifyTargetChannel( } @Test - public void ensureEvenDistribution() throws InterruptedException, IOException { + void ensureEvenDistribution() throws InterruptedException, IOException { int numChannels = 10; final ManagedChannel[] channels = new ManagedChannel[numChannels]; final AtomicInteger[] counts = new AtomicInteger[numChannels]; - final MethodDescriptor methodDescriptor = FakeServiceGrpc.METHOD_RECOGNIZE; + final MethodDescriptor methodDescriptor = METHOD_RECOGNIZE; final CallOptions callOptions = CallOptions.DEFAULT; @SuppressWarnings("unchecked") final ClientCall clientCall = Mockito.mock(ClientCall.class); @@ -142,10 +169,11 @@ public void ensureEvenDistribution() throws InterruptedException, IOException { }); } - final ChannelPool pool = + pool = ChannelPool.create( ChannelPoolSettings.staticallySized(numChannels), - new FakeChannelFactory(Arrays.asList(channels))); + new FakeChannelFactory(Arrays.asList(channels)), + null); int numThreads = 20; final int numPerThread = 1000; @@ -171,24 +199,25 @@ public void ensureEvenDistribution() throws InterruptedException, IOException { // Test channelPrimer is called same number of times as poolSize if executorService is set to null @Test - public void channelPrimerShouldCallPoolConstruction() throws IOException { + void channelPrimerShouldCallPoolConstruction() throws IOException { ChannelPrimer mockChannelPrimer = Mockito.mock(ChannelPrimer.class); ManagedChannel channel1 = Mockito.mock(ManagedChannel.class); ManagedChannel channel2 = Mockito.mock(ManagedChannel.class); - ChannelPool.create( - ChannelPoolSettings.staticallySized(2) - .toBuilder() - .setPreemptiveRefreshEnabled(true) - .build(), - new FakeChannelFactory(Arrays.asList(channel1, channel2), mockChannelPrimer)); + pool = + ChannelPool.create( + ChannelPoolSettings.staticallySized(2).toBuilder() + .setPreemptiveRefreshEnabled(true) + .build(), + new FakeChannelFactory(Arrays.asList(channel1, channel2), mockChannelPrimer), + null); Mockito.verify(mockChannelPrimer, Mockito.times(2)) .primeChannel(Mockito.any(ManagedChannel.class)); } // Test channelPrimer is called periodically, if there's an executorService @Test - public void channelPrimerIsCalledPeriodically() throws IOException { + void channelPrimerIsCalledPeriodically() throws IOException { ChannelPrimer mockChannelPrimer = Mockito.mock(ChannelPrimer.class); ManagedChannel channel1 = Mockito.mock(ManagedChannel.class); ManagedChannel channel2 = Mockito.mock(ManagedChannel.class); @@ -198,6 +227,7 @@ public void channelPrimerIsCalledPeriodically() throws IOException { ScheduledExecutorService scheduledExecutorService = Mockito.mock(ScheduledExecutorService.class); + FixedExecutorProvider provider = FixedExecutorProvider.create(scheduledExecutorService); Answer extractChannelRefresher = invocation -> { @@ -213,13 +243,13 @@ public void channelPrimerIsCalledPeriodically() throws IOException { FakeChannelFactory channelFactory = new FakeChannelFactory(Arrays.asList(channel1, channel2, channel3), mockChannelPrimer); - new ChannelPool( - ChannelPoolSettings.staticallySized(1) - .toBuilder() - .setPreemptiveRefreshEnabled(true) - .build(), - channelFactory, - scheduledExecutorService); + pool = + new ChannelPool( + ChannelPoolSettings.staticallySized(1).toBuilder() + .setPreemptiveRefreshEnabled(true) + .build(), + channelFactory, + provider); // 1 call during the creation Mockito.verify(mockChannelPrimer, Mockito.times(1)) .primeChannel(Mockito.any(ManagedChannel.class)); @@ -238,12 +268,12 @@ public void channelPrimerIsCalledPeriodically() throws IOException { // ---- // call should be allowed to complete and the channel should not be shutdown @Test - public void callShouldCompleteAfterCreation() throws IOException { + void callShouldCompleteAfterCreation() throws IOException { ManagedChannel underlyingChannel = Mockito.mock(ManagedChannel.class); ManagedChannel replacementChannel = Mockito.mock(ManagedChannel.class); FakeChannelFactory channelFactory = new FakeChannelFactory(ImmutableList.of(underlyingChannel, replacementChannel)); - ChannelPool pool = ChannelPool.create(ChannelPoolSettings.staticallySized(1), channelFactory); + pool = ChannelPool.create(ChannelPoolSettings.staticallySized(1), channelFactory, null); // create a mock call when new call comes to the underlying channel MockClientCall mockClientCall = new MockClientCall<>(1, Status.OK); @@ -286,13 +316,13 @@ public void callShouldCompleteAfterCreation() throws IOException { // call should be allowed to complete and the channel should not be shutdown @Test - public void callShouldCompleteAfterStarted() throws IOException { + void callShouldCompleteAfterStarted() throws IOException { final ManagedChannel underlyingChannel = Mockito.mock(ManagedChannel.class); ManagedChannel replacementChannel = Mockito.mock(ManagedChannel.class); FakeChannelFactory channelFactory = new FakeChannelFactory(ImmutableList.of(underlyingChannel, replacementChannel)); - ChannelPool pool = ChannelPool.create(ChannelPoolSettings.staticallySized(1), channelFactory); + pool = ChannelPool.create(ChannelPoolSettings.staticallySized(1), channelFactory, null); // create a mock call when new call comes to the underlying channel MockClientCall mockClientCall = new MockClientCall<>(1, Status.OK); @@ -331,13 +361,13 @@ public void callShouldCompleteAfterStarted() throws IOException { // Channel should be shutdown after a refresh all the calls have completed @Test - public void channelShouldShutdown() throws IOException { + void channelShouldShutdown() throws IOException { ManagedChannel underlyingChannel = Mockito.mock(ManagedChannel.class); ManagedChannel replacementChannel = Mockito.mock(ManagedChannel.class); FakeChannelFactory channelFactory = new FakeChannelFactory(ImmutableList.of(underlyingChannel, replacementChannel)); - ChannelPool pool = ChannelPool.create(ChannelPoolSettings.staticallySized(1), channelFactory); + pool = ChannelPool.create(ChannelPoolSettings.staticallySized(1), channelFactory, null); // create a mock call when new call comes to the underlying channel MockClientCall mockClientCall = new MockClientCall<>(1, Status.OK); @@ -374,13 +404,14 @@ public void channelShouldShutdown() throws IOException { } @Test - public void channelRefreshShouldSwapChannels() throws IOException { + void channelRefreshShouldSwapChannels() throws IOException { ManagedChannel underlyingChannel1 = Mockito.mock(ManagedChannel.class); ManagedChannel underlyingChannel2 = Mockito.mock(ManagedChannel.class); // mock executor service to capture the runnable scheduled, so we can invoke it when we want to ScheduledExecutorService scheduledExecutorService = Mockito.mock(ScheduledExecutorService.class); + FixedExecutorProvider provider = FixedExecutorProvider.create(scheduledExecutorService); Mockito.doReturn(null) .when(scheduledExecutorService) @@ -389,14 +420,13 @@ public void channelRefreshShouldSwapChannels() throws IOException { FakeChannelFactory channelFactory = new FakeChannelFactory(ImmutableList.of(underlyingChannel1, underlyingChannel2)); - ChannelPool pool = + pool = new ChannelPool( - ChannelPoolSettings.staticallySized(1) - .toBuilder() + ChannelPoolSettings.staticallySized(1).toBuilder() .setPreemptiveRefreshEnabled(true) .build(), channelFactory, - scheduledExecutorService); + provider); Mockito.reset(underlyingChannel1); pool.newCall(FakeMethodDescriptor.create(), CallOptions.DEFAULT); @@ -414,8 +444,9 @@ public void channelRefreshShouldSwapChannels() throws IOException { } @Test - public void channelCountShouldNotChangeWhenOutstandingRpcsAreWithinLimits() throws Exception { + void channelCountShouldNotChangeWhenOutstandingRpcsAreWithinLimits() throws Exception { ScheduledExecutorService executor = Mockito.mock(ScheduledExecutorService.class); + FixedExecutorProvider provider = FixedExecutorProvider.create(executor); List channels = new ArrayList<>(); List> startedCalls = new ArrayList<>(); @@ -436,7 +467,7 @@ public void channelCountShouldNotChangeWhenOutstandingRpcsAreWithinLimits() thro return channel; }; - ChannelPool pool = + pool = new ChannelPool( ChannelPoolSettings.builder() .setInitialChannelCount(2) @@ -444,14 +475,13 @@ public void channelCountShouldNotChangeWhenOutstandingRpcsAreWithinLimits() thro .setMaxRpcsPerChannel(2) .build(), channelFactory, - executor); + provider); assertThat(pool.entries.get()).hasSize(2); // Start the minimum number of for (int i = 0; i < 2; i++) { ClientCalls.futureUnaryCall( - pool.newCall(FakeServiceGrpc.METHOD_RECOGNIZE, CallOptions.DEFAULT), - Color.getDefaultInstance()); + pool.newCall(METHOD_RECOGNIZE, CallOptions.DEFAULT), Color.getDefaultInstance()); } pool.resize(); assertThat(pool.entries.get()).hasSize(2); @@ -459,14 +489,13 @@ public void channelCountShouldNotChangeWhenOutstandingRpcsAreWithinLimits() thro // Add enough RPCs to be just at the brink of expansion for (int i = startedCalls.size(); i < 4; i++) { ClientCalls.futureUnaryCall( - pool.newCall(FakeServiceGrpc.METHOD_RECOGNIZE, CallOptions.DEFAULT), - Color.getDefaultInstance()); + pool.newCall(METHOD_RECOGNIZE, CallOptions.DEFAULT), Color.getDefaultInstance()); } pool.resize(); assertThat(pool.entries.get()).hasSize(2); // Add another RPC to push expansion - pool.newCall(FakeServiceGrpc.METHOD_RECOGNIZE, CallOptions.DEFAULT); + pool.newCall(METHOD_RECOGNIZE, CallOptions.DEFAULT); pool.resize(); assertThat(pool.entries.get()).hasSize(4); // += ChannelPool::MAX_RESIZE_DELTA assertThat(startedCalls).hasSize(5); @@ -495,8 +524,9 @@ public void channelCountShouldNotChangeWhenOutstandingRpcsAreWithinLimits() thro } @Test - public void removedIdleChannelsAreShutdown() throws Exception { + void removedIdleChannelsAreShutdown() throws Exception { ScheduledExecutorService executor = Mockito.mock(ScheduledExecutorService.class); + FixedExecutorProvider provider = FixedExecutorProvider.create(executor); List channels = new ArrayList<>(); List> startedCalls = new ArrayList<>(); @@ -517,7 +547,7 @@ public void removedIdleChannelsAreShutdown() throws Exception { return channel; }; - ChannelPool pool = + pool = new ChannelPool( ChannelPoolSettings.builder() .setInitialChannelCount(2) @@ -525,7 +555,7 @@ public void removedIdleChannelsAreShutdown() throws Exception { .setMaxRpcsPerChannel(2) .build(), channelFactory, - executor); + provider); assertThat(pool.entries.get()).hasSize(2); // With no outstanding RPCs, the pool should shrink @@ -535,8 +565,9 @@ public void removedIdleChannelsAreShutdown() throws Exception { } @Test - public void removedActiveChannelsAreShutdown() throws Exception { + void removedActiveChannelsAreShutdown() throws Exception { ScheduledExecutorService executor = Mockito.mock(ScheduledExecutorService.class); + FixedExecutorProvider provider = FixedExecutorProvider.create(executor); List channels = new ArrayList<>(); List> startedCalls = new ArrayList<>(); @@ -557,7 +588,7 @@ public void removedActiveChannelsAreShutdown() throws Exception { return channel; }; - ChannelPool pool = + pool = new ChannelPool( ChannelPoolSettings.builder() .setInitialChannelCount(2) @@ -565,14 +596,13 @@ public void removedActiveChannelsAreShutdown() throws Exception { .setMaxRpcsPerChannel(2) .build(), channelFactory, - executor); + provider); assertThat(pool.entries.get()).hasSize(2); // Start 2 RPCs for (int i = 0; i < 2; i++) { ClientCalls.futureUnaryCall( - pool.newCall(FakeServiceGrpc.METHOD_RECOGNIZE, CallOptions.DEFAULT), - Color.getDefaultInstance()); + pool.newCall(METHOD_RECOGNIZE, CallOptions.DEFAULT), Color.getDefaultInstance()); } // Complete the first one @SuppressWarnings("unchecked") @@ -595,4 +625,116 @@ public void removedActiveChannelsAreShutdown() throws Exception { // Now the channel should be closed Mockito.verify(channels.get(1), Mockito.times(1)).shutdown(); } + + @Test + void testReleasingClientCallCancelEarly() throws IOException { + ClientCall mockClientCall = Mockito.mock(ClientCall.class); + Mockito.doAnswer(invocation -> null).when(mockClientCall).cancel(Mockito.any(), Mockito.any()); + ManagedChannel fakeChannel = Mockito.mock(ManagedChannel.class); + Mockito.when(fakeChannel.newCall(Mockito.any(), Mockito.any())).thenReturn(mockClientCall); + ChannelPoolSettings channelPoolSettings = ChannelPoolSettings.staticallySized(1); + ChannelFactory factory = new FakeChannelFactory(ImmutableList.of(fakeChannel)); + pool = ChannelPool.create(channelPoolSettings, factory, null); + + EndpointContext endpointContext = Mockito.mock(EndpointContext.class); + Mockito.doNothing() + .when(endpointContext) + .validateUniverseDomain(Mockito.any(Credentials.class), Mockito.any(GrpcStatusCode.class)); + + ClientContext context = + ClientContext.newBuilder() + .setTransportChannel(GrpcTransportChannel.create(pool)) + .setDefaultCallContext( + GrpcCallContext.of(pool, CallOptions.DEFAULT).withEndpointContext(endpointContext)) + .build(); + ServerStreamingCallSettings settings = + ServerStreamingCallSettings.newBuilder().build(); + ServerStreamingCallable streamingCallable = + GrpcCallableFactory.createServerStreamingCallable( + GrpcCallSettings.create(METHOD_SERVER_STREAMING_RECOGNIZE), settings, context); + Color request = Color.newBuilder().setRed(0.5f).build(); + + IllegalStateException e = + Assertions.assertThrows( + IllegalStateException.class, + () -> + streamingCallable.call( + request, + new ResponseObserver() { + @Override + public void onStart(StreamController controller) { + controller.cancel(); + } + + @Override + public void onResponse(Object response) {} + + @Override + public void onError(Throwable t) {} + + @Override + public void onComplete() {} + })); + assertThat(e.getCause()).isInstanceOf(CancellationException.class); + assertThat(e.getMessage()).isEqualTo("Call is already cancelled"); + } + + @Test + void testDoubleRelease() throws Exception { + FakeLogHandler logHandler = new FakeLogHandler(); + ChannelPool.LOG.addHandler(logHandler); + + try { + // Create a fake channel pool thats backed by mock channels that simply record invocations + ClientCall mockClientCall = Mockito.mock(ClientCall.class); + ManagedChannel fakeChannel = Mockito.mock(ManagedChannel.class); + Mockito.when(fakeChannel.newCall(Mockito.any(), Mockito.any())).thenReturn(mockClientCall); + ChannelPoolSettings channelPoolSettings = ChannelPoolSettings.staticallySized(1); + ChannelFactory factory = new FakeChannelFactory(ImmutableList.of(fakeChannel)); + + pool = ChannelPool.create(channelPoolSettings, factory, null); + + EndpointContext endpointContext = Mockito.mock(EndpointContext.class); + Mockito.doNothing() + .when(endpointContext) + .validateUniverseDomain( + Mockito.any(Credentials.class), Mockito.any(GrpcStatusCode.class)); + + // Construct a fake callable to use the channel pool + ClientContext context = + ClientContext.newBuilder() + .setTransportChannel(GrpcTransportChannel.create(pool)) + .setDefaultCallContext( + GrpcCallContext.of(pool, CallOptions.DEFAULT) + .withEndpointContext(endpointContext)) + .build(); + + UnaryCallSettings settings = + UnaryCallSettings.newUnaryCallSettingsBuilder().build(); + UnaryCallable callable = + GrpcCallableFactory.createUnaryCallable( + GrpcCallSettings.create(METHOD_RECOGNIZE), settings, context); + + // Start the RPC + ApiFuture rpcFuture = + callable.futureCall(Color.getDefaultInstance(), context.getDefaultCallContext()); + + // Get the server side listener and intentionally close it twice + ArgumentCaptor> clientCallListenerCaptor = + ArgumentCaptor.forClass(ClientCall.Listener.class); + Mockito.verify(mockClientCall).start(clientCallListenerCaptor.capture(), Mockito.any()); + clientCallListenerCaptor.getValue().onClose(Status.INTERNAL, new Metadata()); + clientCallListenerCaptor.getValue().onClose(Status.UNKNOWN, new Metadata()); + + // Ensure that the channel pool properly logged the double call and kept the refCount correct + assertThat(logHandler.getAllMessages()) + .contains( + "Call is being closed more than once. Please make sure that onClose() is not being manually called."); + assertThat(pool.entries.get()).hasSize(1); + ChannelPool.Entry entry = pool.entries.get().get(0); + assertThat(entry.outstandingRpcs.get()).isEqualTo(0); + } finally { + ChannelPool.LOG.removeHandler(logHandler); + } + } } diff --git a/gax-java/gax-grpc/src/test/java/com/google/api/gax/grpc/GaxGrpcPropertiesTest.java b/gax-java/gax-grpc/src/test/java/com/google/api/gax/grpc/GaxGrpcPropertiesTest.java index 4174312272..651b17e712 100644 --- a/gax-java/gax-grpc/src/test/java/com/google/api/gax/grpc/GaxGrpcPropertiesTest.java +++ b/gax-java/gax-grpc/src/test/java/com/google/api/gax/grpc/GaxGrpcPropertiesTest.java @@ -29,31 +29,28 @@ */ package com.google.api.gax.grpc; -import static org.junit.Assert.assertNotNull; -import static org.junit.Assert.assertTrue; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertTrue; import java.util.regex.Pattern; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.junit.runners.JUnit4; +import org.junit.jupiter.api.Test; -@RunWith(JUnit4.class) -public class GaxGrpcPropertiesTest { +class GaxGrpcPropertiesTest { @Test - public void testGrpcVersion() { + void testGrpcVersion() { String grpcVersion = GaxGrpcProperties.getGrpcVersion(); assertTrue(Pattern.compile("^\\d+\\.\\d+\\.\\d+").matcher(grpcVersion).find()); } @Test - public void testGaxGrpcVersion() { + void testGaxGrpcVersion() { String gaxGrpcVersion = GaxGrpcProperties.getGaxGrpcVersion(); assertNotNull(gaxGrpcVersion); } @Test - public void testDefaultHeaderPattern() { + void testDefaultHeaderPattern() { assertTrue( GaxGrpcProperties.getDefaultApiClientHeaderPattern() .matcher("gl-java/1.8_00 gapic/1.2.3-alpha gax/1.5.0 grpc/1.7.0") diff --git a/gax-java/gax-grpc/src/test/java/com/google/api/gax/grpc/GrpcApiExceptionFactoryTest.java b/gax-java/gax-grpc/src/test/java/com/google/api/gax/grpc/GrpcApiExceptionFactoryTest.java index bb8febef54..e4e86d589d 100644 --- a/gax-java/gax-grpc/src/test/java/com/google/api/gax/grpc/GrpcApiExceptionFactoryTest.java +++ b/gax-java/gax-grpc/src/test/java/com/google/api/gax/grpc/GrpcApiExceptionFactoryTest.java @@ -44,13 +44,10 @@ import io.grpc.StatusException; import io.grpc.StatusRuntimeException; import java.util.Collections; -import org.junit.Before; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.junit.runners.JUnit4; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; -@RunWith(JUnit4.class) -public class GrpcApiExceptionFactoryTest { +class GrpcApiExceptionFactoryTest { private static final ErrorInfo ERROR_INFO = ErrorInfo.newBuilder() @@ -72,13 +69,13 @@ public class GrpcApiExceptionFactoryTest { private GrpcApiExceptionFactory factory; - @Before - public void setUp() throws Exception { + @BeforeEach + void setUp() throws Exception { factory = new GrpcApiExceptionFactory(Collections.emptySet()); } @Test - public void create_shouldCreateApiExceptionWithErrorDetailsForStatusException() { + void create_shouldCreateApiExceptionWithErrorDetailsForStatusException() { Metadata trailers = new Metadata(); Status status = Status.newBuilder().addAllDetails(RAW_ERROR_MESSAGES).build(); trailers.put( @@ -91,7 +88,7 @@ public void create_shouldCreateApiExceptionWithErrorDetailsForStatusException() } @Test - public void create_shouldCreateApiExceptionWithErrorDetailsForStatusRuntimeException() { + void create_shouldCreateApiExceptionWithErrorDetailsForStatusRuntimeException() { Metadata trailers = new Metadata(); Status status = Status.newBuilder().addAllDetails(RAW_ERROR_MESSAGES).build(); trailers.put( @@ -104,7 +101,7 @@ public void create_shouldCreateApiExceptionWithErrorDetailsForStatusRuntimeExcep } @Test - public void create_shouldCreateApiExceptionWithNoErrorDetailsIfMetadataIsNull() { + void create_shouldCreateApiExceptionWithNoErrorDetailsIfMetadataIsNull() { StatusRuntimeException statusException = new StatusRuntimeException(GRPC_STATUS, null); ApiException actual = factory.create(statusException); @@ -113,7 +110,7 @@ public void create_shouldCreateApiExceptionWithNoErrorDetailsIfMetadataIsNull() } @Test - public void create_shouldCreateApiExceptionWithNoErrorDetailsIfMetadataDoesNotHaveErrorDetails() { + void create_shouldCreateApiExceptionWithNoErrorDetailsIfMetadataDoesNotHaveErrorDetails() { StatusRuntimeException statusException = new StatusRuntimeException(GRPC_STATUS, new Metadata()); @@ -123,7 +120,7 @@ public void create_shouldCreateApiExceptionWithNoErrorDetailsIfMetadataDoesNotHa } @Test - public void create_shouldCreateApiExceptionWithNoErrorDetailsIfStatusIsMalformed() { + void create_shouldCreateApiExceptionWithNoErrorDetailsIfStatusIsMalformed() { Metadata trailers = new Metadata(); Status status = Status.newBuilder().addDetails(Any.pack(ERROR_INFO)).build(); byte[] bytes = status.toByteArray(); diff --git a/gax-java/gax-grpc/src/test/java/com/google/api/gax/grpc/GrpcCallContextTest.java b/gax-java/gax-grpc/src/test/java/com/google/api/gax/grpc/GrpcCallContextTest.java index 4e563225e5..5f30ed58c9 100644 --- a/gax-java/gax-grpc/src/test/java/com/google/api/gax/grpc/GrpcCallContextTest.java +++ b/gax-java/gax-grpc/src/test/java/com/google/api/gax/grpc/GrpcCallContextTest.java @@ -29,9 +29,10 @@ */ package com.google.api.gax.grpc; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotNull; -import static org.junit.Assert.assertNull; +import static com.google.api.gax.util.TimeConversionTestUtils.testDurationMethod; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertNull; import com.google.api.gax.retrying.RetrySettings; import com.google.api.gax.rpc.ApiCallContext; @@ -41,32 +42,32 @@ import com.google.api.gax.rpc.testing.FakeTransportChannel; import com.google.api.gax.tracing.ApiTracer; import com.google.auth.Credentials; +import com.google.auth.oauth2.GoogleCredentials; import com.google.common.collect.ImmutableMap; import com.google.common.truth.Truth; +import io.grpc.CallCredentials; import io.grpc.CallOptions; import io.grpc.ManagedChannel; import io.grpc.Metadata.Key; +import io.grpc.auth.MoreCallCredentials; +import java.io.IOException; import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.Set; -import org.junit.Assert; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.junit.runners.JUnit4; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; import org.mockito.Mockito; -import org.threeten.bp.Duration; -@RunWith(JUnit4.class) -public class GrpcCallContextTest { +class GrpcCallContextTest { @Test - public void testNullToSelfWrongType() { + void testNullToSelfWrongType() { try { GrpcCallContext.createDefault().nullToSelf(FakeCallContext.createDefault()); - Assert.fail("GrpcCallContext should have thrown an exception"); + Assertions.fail("GrpcCallContext should have thrown an exception"); } catch (IllegalArgumentException expected) { Truth.assertThat(expected) .hasMessageThat() @@ -75,7 +76,7 @@ public void testNullToSelfWrongType() { } @Test - public void testWithCredentials() { + void testWithCredentials() { Credentials credentials = Mockito.mock(Credentials.class); GrpcCallContext emptyContext = GrpcCallContext.createDefault(); assertNull(emptyContext.getCallOptions().getCredentials()); @@ -84,7 +85,7 @@ public void testWithCredentials() { } @Test - public void testWithTransportChannel() { + void testWithTransportChannel() { ManagedChannel channel = Mockito.mock(ManagedChannel.class); GrpcCallContext context = GrpcCallContext.createDefault().withTransportChannel(GrpcTransportChannel.create(channel)); @@ -92,21 +93,41 @@ public void testWithTransportChannel() { } @Test - public void testWithTransportChannelWrongType() { + void testWithTransportChannelWrongType() { FakeChannel channel = new FakeChannel(); try { GrpcCallContext.createDefault().withTransportChannel(FakeTransportChannel.create(channel)); - Assert.fail("GrpcCallContext should have thrown an exception"); + Assertions.fail("GrpcCallContext should have thrown an exception"); } catch (IllegalArgumentException expected) { Truth.assertThat(expected).hasMessageThat().contains("Expected GrpcTransportChannel"); } } @Test - public void testMergeWrongType() { + void testWithTransportChannelIsDirectPath() { + ManagedChannel channel = Mockito.mock(ManagedChannel.class); + Credentials credentials = Mockito.mock(GoogleCredentials.class); + GrpcCallContext context = GrpcCallContext.createDefault().withCredentials(credentials); + assertNotNull(context.getCallOptions().getCredentials()); + context = + context.withTransportChannel( + GrpcTransportChannel.newBuilder() + .setDirectPath(true) + .setManagedChannel(channel) + .build()); + assertNull(context.getCallOptions().getCredentials()); + + // Call credentials from the call options will be stripped. + context.withCallOptions( + CallOptions.DEFAULT.withCallCredentials(MoreCallCredentials.from(credentials))); + assertNull(context.getCallOptions().getCredentials()); + } + + @Test + void testMergeWrongType() { try { GrpcCallContext.createDefault().merge(FakeCallContext.createDefault()); - Assert.fail("GrpcCallContext should have thrown an exception"); + Assertions.fail("GrpcCallContext should have thrown an exception"); } catch (IllegalArgumentException expected) { Truth.assertThat(expected) .hasMessageThat() @@ -115,7 +136,7 @@ public void testMergeWrongType() { } @Test - public void testWithRequestParamsDynamicHeaderOption() { + void testWithRequestParamsDynamicHeaderOption() { String encodedRequestParams = "param1=value¶m2.param3=value23"; GrpcCallContext context = GrpcCallContext.createDefault().withRequestParamsDynamicHeaderOption(encodedRequestParams); @@ -129,145 +150,186 @@ public void testWithRequestParamsDynamicHeaderOption() { @Test public void testWithTimeout() { - assertNull(GrpcCallContext.createDefault().withTimeout(null).getTimeout()); + final long millis = 15; + GrpcCallContext context = GrpcCallContext.createDefault(); + testDurationMethod( + millis, + jt -> context.withTimeoutDuration(jt), + tt -> context.withTimeout(tt), + c -> c.getTimeoutDuration(), + c -> c.getTimeout()); } @Test - public void testWithNegativeTimeout() { - assertNull(GrpcCallContext.createDefault().withTimeout(Duration.ofSeconds(-1L)).getTimeout()); + void testWithNegativeTimeout() { + assertNull( + GrpcCallContext.createDefault() + .withTimeoutDuration(java.time.Duration.ofSeconds(-1L)) + .getTimeoutDuration()); } @Test - public void testWithZeroTimeout() { - assertNull(GrpcCallContext.createDefault().withTimeout(Duration.ofSeconds(0L)).getTimeout()); + void testWithZeroTimeout() { + assertNull( + GrpcCallContext.createDefault() + .withTimeoutDuration(java.time.Duration.ofSeconds(0L)) + .getTimeoutDuration()); } @Test - public void testWithShorterTimeout() { + void testWithShorterTimeout() { GrpcCallContext ctxWithLongTimeout = - GrpcCallContext.createDefault().withTimeout(Duration.ofSeconds(10)); + GrpcCallContext.createDefault().withTimeoutDuration(java.time.Duration.ofSeconds(10)); // Sanity check - Truth.assertThat(ctxWithLongTimeout.getTimeout()).isEqualTo(Duration.ofSeconds(10)); + Truth.assertThat(ctxWithLongTimeout.getTimeoutDuration()) + .isEqualTo(java.time.Duration.ofSeconds(10)); // Shorten the timeout and make sure it changed - GrpcCallContext ctxWithShorterTimeout = ctxWithLongTimeout.withTimeout(Duration.ofSeconds(5)); - Truth.assertThat(ctxWithShorterTimeout.getTimeout()).isEqualTo(Duration.ofSeconds(5)); + GrpcCallContext ctxWithShorterTimeout = + ctxWithLongTimeout.withTimeoutDuration(java.time.Duration.ofSeconds(5)); + Truth.assertThat(ctxWithShorterTimeout.getTimeoutDuration()) + .isEqualTo(java.time.Duration.ofSeconds(5)); } @Test - public void testWithLongerTimeout() { + void testWithLongerTimeout() { GrpcCallContext ctxWithShortTimeout = - GrpcCallContext.createDefault().withTimeout(Duration.ofSeconds(5)); + GrpcCallContext.createDefault().withTimeoutDuration(java.time.Duration.ofSeconds(5)); // Sanity check - Truth.assertThat(ctxWithShortTimeout.getTimeout()).isEqualTo(Duration.ofSeconds(5)); + Truth.assertThat(ctxWithShortTimeout.getTimeoutDuration()) + .isEqualTo(java.time.Duration.ofSeconds(5)); // Try to extend the timeout and verify that it was ignored GrpcCallContext ctxWithUnchangedTimeout = - ctxWithShortTimeout.withTimeout(Duration.ofSeconds(10)); - Truth.assertThat(ctxWithUnchangedTimeout.getTimeout()).isEqualTo(Duration.ofSeconds(5)); + ctxWithShortTimeout.withTimeoutDuration(java.time.Duration.ofSeconds(10)); + Truth.assertThat(ctxWithUnchangedTimeout.getTimeoutDuration()) + .isEqualTo(java.time.Duration.ofSeconds(5)); } @Test - public void testMergeWithNullTimeout() { - Duration timeout = Duration.ofSeconds(10); - GrpcCallContext baseContext = GrpcCallContext.createDefault().withTimeout(timeout); + void testMergeWithNullTimeout() { + java.time.Duration timeout = java.time.Duration.ofSeconds(10); + GrpcCallContext baseContext = GrpcCallContext.createDefault().withTimeoutDuration(timeout); GrpcCallContext defaultOverlay = GrpcCallContext.createDefault(); - Truth.assertThat(baseContext.merge(defaultOverlay).getTimeout()).isEqualTo(timeout); + Truth.assertThat(baseContext.merge(defaultOverlay).getTimeoutDuration()).isEqualTo(timeout); - GrpcCallContext explicitNullOverlay = GrpcCallContext.createDefault().withTimeout(null); - Truth.assertThat(baseContext.merge(explicitNullOverlay).getTimeout()).isEqualTo(timeout); + java.time.Duration callContextTimeout = null; + GrpcCallContext explicitNullOverlay = + GrpcCallContext.createDefault().withTimeoutDuration(callContextTimeout); + Truth.assertThat(baseContext.merge(explicitNullOverlay).getTimeoutDuration()) + .isEqualTo(timeout); } @Test - public void testMergeWithTimeout() { - Duration timeout = Duration.ofSeconds(19); + void testMergeWithTimeout() { + java.time.Duration timeout = java.time.Duration.ofSeconds(19); GrpcCallContext ctx1 = GrpcCallContext.createDefault(); - GrpcCallContext ctx2 = GrpcCallContext.createDefault().withTimeout(timeout); + GrpcCallContext ctx2 = GrpcCallContext.createDefault().withTimeoutDuration(timeout); - Truth.assertThat(ctx1.merge(ctx2).getTimeout()).isEqualTo(timeout); + Truth.assertThat(ctx1.merge(ctx2).getTimeoutDuration()).isEqualTo(timeout); } @Test - public void testWithStreamingWaitTimeout() { - Duration timeout = Duration.ofSeconds(15); - GrpcCallContext context = GrpcCallContext.createDefault().withStreamWaitTimeout(timeout); - Truth.assertThat(context.getStreamWaitTimeout()).isEqualTo(timeout); + void testWithStreamingWaitTimeout() { + final long millis = 15; + GrpcCallContext context = GrpcCallContext.createDefault(); + testDurationMethod( + millis, + jt -> context.withStreamWaitTimeoutDuration(jt), + tt -> context.withStreamWaitTimeout(tt), + c -> c.getStreamWaitTimeoutDuration(), + c -> c.getStreamWaitTimeout()); } @Test - public void testMergeWithNullStreamingWaitTimeout() { - Duration timeout = Duration.ofSeconds(10); - GrpcCallContext baseContext = GrpcCallContext.createDefault().withStreamWaitTimeout(timeout); + void testMergeWithNullStreamingWaitTimeout() { + java.time.Duration timeout = java.time.Duration.ofSeconds(10); + GrpcCallContext baseContext = + GrpcCallContext.createDefault().withStreamWaitTimeoutDuration(timeout); GrpcCallContext defaultOverlay = GrpcCallContext.createDefault(); - Truth.assertThat(baseContext.merge(defaultOverlay).getStreamWaitTimeout()).isEqualTo(timeout); + Truth.assertThat(baseContext.merge(defaultOverlay).getStreamWaitTimeoutDuration()) + .isEqualTo(timeout); + java.time.Duration streamWaitTimeout = null; GrpcCallContext explicitNullOverlay = - GrpcCallContext.createDefault().withStreamWaitTimeout(null); - Truth.assertThat(baseContext.merge(explicitNullOverlay).getStreamWaitTimeout()) + GrpcCallContext.createDefault().withStreamWaitTimeoutDuration(streamWaitTimeout); + Truth.assertThat(baseContext.merge(explicitNullOverlay).getStreamWaitTimeoutDuration()) .isEqualTo(timeout); } @Test - public void testWithZeroStreamingWaitTimeout() { - Duration timeout = Duration.ZERO; + void testWithZeroStreamingWaitTimeout() { + java.time.Duration timeout = java.time.Duration.ZERO; Truth.assertThat( - GrpcCallContext.createDefault().withStreamWaitTimeout(timeout).getStreamWaitTimeout()) + GrpcCallContext.createDefault() + .withStreamWaitTimeoutDuration(timeout) + .getStreamWaitTimeoutDuration()) .isEqualTo(timeout); } @Test - public void testMergeWithStreamingWaitTimeout() { - Duration timeout = Duration.ofSeconds(19); + void testMergeWithStreamingWaitTimeout() { + java.time.Duration timeout = java.time.Duration.ofSeconds(19); GrpcCallContext ctx1 = GrpcCallContext.createDefault(); - GrpcCallContext ctx2 = GrpcCallContext.createDefault().withStreamWaitTimeout(timeout); + GrpcCallContext ctx2 = GrpcCallContext.createDefault().withStreamWaitTimeoutDuration(timeout); - Truth.assertThat(ctx1.merge(ctx2).getStreamWaitTimeout()).isEqualTo(timeout); + Truth.assertThat(ctx1.merge(ctx2).getStreamWaitTimeoutDuration()).isEqualTo(timeout); } @Test - public void testWithStreamingIdleTimeout() { - Duration timeout = Duration.ofSeconds(15); - GrpcCallContext context = GrpcCallContext.createDefault().withStreamIdleTimeout(timeout); - Truth.assertThat(context.getStreamIdleTimeout()).isEqualTo(timeout); + void testWithStreamingIdleTimeout() { + final long millis = 15; + GrpcCallContext context = GrpcCallContext.createDefault(); + testDurationMethod( + millis, + jt -> context.withStreamIdleTimeoutDuration(jt), + tt -> context.withStreamIdleTimeout(tt), + c -> c.getStreamIdleTimeoutDuration(), + c -> c.getStreamIdleTimeout()); } @Test - public void testMergeWithNullStreamingIdleTimeout() { - Duration timeout = Duration.ofSeconds(10); - GrpcCallContext baseContext = GrpcCallContext.createDefault().withStreamIdleTimeout(timeout); + void testMergeWithNullStreamingIdleTimeout() { + java.time.Duration timeout = java.time.Duration.ofSeconds(10); + GrpcCallContext baseContext = + GrpcCallContext.createDefault().withStreamIdleTimeoutDuration(timeout); GrpcCallContext defaultOverlay = GrpcCallContext.createDefault(); - Truth.assertThat(baseContext.merge(defaultOverlay).getStreamIdleTimeout()).isEqualTo(timeout); + Truth.assertThat(baseContext.merge(defaultOverlay).getStreamIdleTimeoutDuration()) + .isEqualTo(timeout); + java.time.Duration idleTimeout = null; GrpcCallContext explicitNullOverlay = - GrpcCallContext.createDefault().withStreamIdleTimeout(null); - Truth.assertThat(baseContext.merge(explicitNullOverlay).getStreamIdleTimeout()) + GrpcCallContext.createDefault().withStreamIdleTimeoutDuration(idleTimeout); + Truth.assertThat(baseContext.merge(explicitNullOverlay).getStreamIdleTimeoutDuration()) .isEqualTo(timeout); } @Test - public void testWithZeroStreamingIdleTimeout() { - Duration timeout = Duration.ZERO; + void testWithZeroStreamingIdleTimeout() { + java.time.Duration timeout = java.time.Duration.ZERO; Truth.assertThat( - GrpcCallContext.createDefault().withStreamIdleTimeout(timeout).getStreamIdleTimeout()) + GrpcCallContext.createDefault() + .withStreamIdleTimeoutDuration(timeout) + .getStreamIdleTimeoutDuration()) .isEqualTo(timeout); } @Test - public void testMergeWithStreamingIdleTimeout() { - Duration timeout = Duration.ofSeconds(19); + void testMergeWithStreamingIdleTimeout() { + java.time.Duration timeout = java.time.Duration.ofSeconds(19); GrpcCallContext ctx1 = GrpcCallContext.createDefault(); - GrpcCallContext ctx2 = GrpcCallContext.createDefault().withStreamIdleTimeout(timeout); + GrpcCallContext ctx2 = GrpcCallContext.createDefault().withStreamIdleTimeoutDuration(timeout); - Truth.assertThat(ctx1.merge(ctx2).getStreamIdleTimeout()).isEqualTo(timeout); + Truth.assertThat(ctx1.merge(ctx2).getStreamIdleTimeoutDuration()).isEqualTo(timeout); } @Test - public void testMergeWithCustomCallOptions() { + void testMergeWithCustomCallOptions() { CallOptions.Key key = CallOptions.Key.createWithDefault("somekey", "somedefault"); GrpcCallContext ctx1 = GrpcCallContext.createDefault(); GrpcCallContext ctx2 = @@ -282,7 +344,26 @@ public void testMergeWithCustomCallOptions() { } @Test - public void testWithExtraHeaders() { + void testMergeWithIsDirectPath() { + ManagedChannel channel = Mockito.mock(ManagedChannel.class); + CallCredentials callCredentials = Mockito.mock(CallCredentials.class); + GrpcCallContext ctx1 = + GrpcCallContext.createDefault() + .withCallOptions(CallOptions.DEFAULT.withCallCredentials(callCredentials)); + GrpcCallContext ctx2 = + GrpcCallContext.createDefault() + .withTransportChannel( + GrpcTransportChannel.newBuilder() + .setDirectPath(true) + .setManagedChannel(channel) + .build()); + + GrpcCallContext merged = (GrpcCallContext) ctx1.merge(ctx2); + assertNull(merged.getCallOptions().getCredentials()); + } + + @Test + void testWithExtraHeaders() { Map> extraHeaders = createTestExtraHeaders("key1", "value1", "key1", "value2"); GrpcCallContext ctx = GrpcCallContext.createDefault().withExtraHeaders(extraHeaders); @@ -297,7 +378,7 @@ public void testWithExtraHeaders() { } @Test - public void testMergeWithExtraHeaders() { + void testMergeWithExtraHeaders() { Map> extraHeaders1 = createTestExtraHeaders("key1", "value1", "key1", "value2"); GrpcCallContext ctx1 = GrpcCallContext.createDefault().withExtraHeaders(extraHeaders1); @@ -315,7 +396,7 @@ public void testMergeWithExtraHeaders() { } @Test - public void testMergeWithTracer() { + void testMergeWithTracer() { ApiTracer explicitTracer = Mockito.mock(ApiTracer.class); GrpcCallContext ctxWithExplicitTracer = GrpcCallContext.createDefault().withTracer(explicitTracer); @@ -337,7 +418,7 @@ public void testMergeWithTracer() { } @Test - public void testWithRetrySettings() { + void testWithRetrySettings() { RetrySettings retrySettings = Mockito.mock(RetrySettings.class); GrpcCallContext emptyContext = GrpcCallContext.createDefault(); assertNull(emptyContext.getRetrySettings()); @@ -346,7 +427,7 @@ public void testWithRetrySettings() { } @Test - public void testWithRetryableCodes() { + void testWithRetryableCodes() { Set codes = Collections.singleton(StatusCode.Code.UNAVAILABLE); GrpcCallContext emptyContext = GrpcCallContext.createDefault(); assertNull(emptyContext.getRetryableCodes()); @@ -355,7 +436,7 @@ public void testWithRetryableCodes() { } @Test - public void testWithOptions() { + void testWithOptions() { GrpcCallContext emptyCallContext = GrpcCallContext.createDefault(); ApiCallContext.Key contextKey1 = ApiCallContext.Key.create("testKey1"); ApiCallContext.Key contextKey2 = ApiCallContext.Key.create("testKey2"); @@ -373,7 +454,7 @@ public void testWithOptions() { } @Test - public void testMergeOptions() { + void testMergeOptions() throws IOException { GrpcCallContext emptyCallContext = GrpcCallContext.createDefault(); ApiCallContext.Key contextKey1 = ApiCallContext.Key.create("testKey1"); ApiCallContext.Key contextKey2 = ApiCallContext.Key.create("testKey2"); diff --git a/gax-java/gax-grpc/src/test/java/com/google/api/gax/grpc/GrpcCallableFactoryTest.java b/gax-java/gax-grpc/src/test/java/com/google/api/gax/grpc/GrpcCallableFactoryTest.java index 2ebe93b7f7..f261daf603 100644 --- a/gax-java/gax-grpc/src/test/java/com/google/api/gax/grpc/GrpcCallableFactoryTest.java +++ b/gax-java/gax-grpc/src/test/java/com/google/api/gax/grpc/GrpcCallableFactoryTest.java @@ -35,12 +35,15 @@ import com.google.api.gax.grpc.testing.FakeServiceImpl; import com.google.api.gax.grpc.testing.InProcessServer; import com.google.api.gax.retrying.RetrySettings; +import com.google.api.gax.rpc.ApiCallContext; import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.EndpointContext; import com.google.api.gax.rpc.InvalidArgumentException; import com.google.api.gax.rpc.ServerStreamingCallSettings; import com.google.api.gax.rpc.ServerStreamingCallable; import com.google.api.gax.rpc.StatusCode.Code; import com.google.api.gax.tracing.SpanName; +import com.google.auth.Credentials; import com.google.common.collect.ImmutableList; import com.google.common.truth.Truth; import com.google.type.Color; @@ -52,43 +55,45 @@ import io.grpc.MethodDescriptor.MethodType; import io.grpc.inprocess.InProcessChannelBuilder; import java.util.List; -import org.junit.After; -import org.junit.Before; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.junit.runners.JUnit4; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; import org.mockito.Mockito; -import org.threeten.bp.Duration; -@RunWith(JUnit4.class) -public class GrpcCallableFactoryTest { +class GrpcCallableFactoryTest { private InProcessServer inprocessServer; private ManagedChannel channel; private ClientContext clientContext; - @Before - public void setUp() throws Exception { + @BeforeEach + void setUp() throws Exception { String serverName = "fakeservice"; FakeServiceImpl serviceImpl = new FakeServiceImpl(); inprocessServer = new InProcessServer<>(serviceImpl, serverName); inprocessServer.start(); channel = InProcessChannelBuilder.forName(serverName).directExecutor().usePlaintext().build(); + EndpointContext endpointContext = Mockito.mock(EndpointContext.class); + Mockito.doNothing() + .when(endpointContext) + .validateUniverseDomain(Mockito.any(Credentials.class), Mockito.any(GrpcStatusCode.class)); clientContext = ClientContext.newBuilder() .setTransportChannel(GrpcTransportChannel.create(channel)) - .setDefaultCallContext(GrpcCallContext.of(channel, CallOptions.DEFAULT)) + .setDefaultCallContext( + GrpcCallContext.of(channel, CallOptions.DEFAULT) + .withEndpointContext(endpointContext)) .build(); } - @After - public void tearDown() { + @AfterEach + void tearDown() { channel.shutdown(); inprocessServer.stop(); } @Test - public void createServerStreamingCallableRetryableExceptions() { + void createServerStreamingCallableRetryableExceptions() { GrpcCallSettings grpcCallSettings = GrpcCallSettings.create(FakeServiceGrpc.METHOD_STREAMING_RECOGNIZE_ERROR); @@ -97,7 +102,7 @@ public void createServerStreamingCallableRetryableExceptions() { ServerStreamingCallSettings.newBuilder() .setRetrySettings( RetrySettings.newBuilder() - .setTotalTimeout(Duration.ofSeconds(1)) + .setTotalTimeoutDuration(java.time.Duration.ofSeconds(1)) .setMaxAttempts(1) .build()) .build(); @@ -106,11 +111,10 @@ public void createServerStreamingCallableRetryableExceptions() { GrpcCallableFactory.createServerStreamingCallable( grpcCallSettings, nonRetryableSettings, clientContext); + ApiCallContext defaultCallContext = clientContext.getDefaultCallContext(); Throwable actualError = null; try { - nonRetryableCallable - .first() - .call(Color.getDefaultInstance(), clientContext.getDefaultCallContext()); + nonRetryableCallable.first().call(Color.getDefaultInstance(), defaultCallContext); } catch (Throwable e) { actualError = e; } @@ -123,7 +127,7 @@ public void createServerStreamingCallableRetryableExceptions() { .setRetryableCodes(Code.INVALID_ARGUMENT) .setRetrySettings( RetrySettings.newBuilder() - .setTotalTimeout(Duration.ofSeconds(1)) + .setTotalTimeoutDuration(java.time.Duration.ofSeconds(1)) .setMaxAttempts(1) .build()) .build(); @@ -134,9 +138,7 @@ public void createServerStreamingCallableRetryableExceptions() { Throwable actualError2 = null; try { - retryableCallable - .first() - .call(Color.getDefaultInstance(), clientContext.getDefaultCallContext()); + retryableCallable.first().call(Color.getDefaultInstance(), defaultCallContext); } catch (Throwable e) { actualError2 = e; } @@ -145,7 +147,7 @@ public void createServerStreamingCallableRetryableExceptions() { } @Test - public void testGetSpanName() { + void testGetSpanName() { @SuppressWarnings("unchecked") MethodDescriptor descriptor = MethodDescriptor.newBuilder() @@ -155,12 +157,12 @@ public void testGetSpanName() { .setResponseMarshaller(Mockito.mock(Marshaller.class)) .build(); - SpanName actualSpanName = GrpcCallableFactory.getSpanName(descriptor); + SpanName actualSpanName = SpanName.of(GrpcCallableFactory.getApiTracerContext(descriptor)); assertThat(actualSpanName).isEqualTo(SpanName.of("Bigtable", "ReadRows")); } @Test - public void testGetSpanNameUnqualified() { + void testGetSpanNameUnqualified() { @SuppressWarnings("unchecked") MethodDescriptor descriptor = MethodDescriptor.newBuilder() @@ -170,12 +172,12 @@ public void testGetSpanNameUnqualified() { .setResponseMarshaller(Mockito.mock(Marshaller.class)) .build(); - SpanName actualSpanName = GrpcCallableFactory.getSpanName(descriptor); + SpanName actualSpanName = SpanName.of(GrpcCallableFactory.getApiTracerContext(descriptor)); assertThat(actualSpanName).isEqualTo(SpanName.of("UnqualifiedService", "ReadRows")); } @Test - public void testGetSpanNameInvalid() { + void testGetSpanNameInvalid() { List invalidNames = ImmutableList.of("BareMethod", "/MethodWithoutService"); for (String invalidName : invalidNames) { @@ -190,7 +192,7 @@ public void testGetSpanNameInvalid() { IllegalArgumentException actualError = null; try { - SpanName spanName = GrpcCallableFactory.getSpanName(descriptor); + SpanName spanName = SpanName.of(GrpcCallableFactory.getApiTracerContext(descriptor)); Truth.assertWithMessage( "Invalid method descriptor should not have a valid span name: %s should not generate the spanName: %s", invalidName, spanName) diff --git a/gax-java/gax-grpc/src/test/java/com/google/api/gax/grpc/GrpcClientCallsTest.java b/gax-java/gax-grpc/src/test/java/com/google/api/gax/grpc/GrpcClientCallsTest.java index fcdea5afe9..37c29d63da 100644 --- a/gax-java/gax-grpc/src/test/java/com/google/api/gax/grpc/GrpcClientCallsTest.java +++ b/gax-java/gax-grpc/src/test/java/com/google/api/gax/grpc/GrpcClientCallsTest.java @@ -30,10 +30,16 @@ package com.google.api.gax.grpc; import static com.google.common.truth.Truth.assertThat; +import static org.junit.jupiter.api.Assertions.assertThrows; import static org.mockito.Mockito.verify; import com.google.api.gax.grpc.testing.FakeChannelFactory; import com.google.api.gax.grpc.testing.FakeServiceGrpc; +import com.google.api.gax.rpc.EndpointContext; +import com.google.api.gax.rpc.UnauthenticatedException; +import com.google.api.gax.rpc.UnavailableException; +import com.google.auth.Credentials; +import com.google.auth.Retryable; import com.google.common.collect.ImmutableList; import com.google.common.truth.Truth; import com.google.type.Color; @@ -45,20 +51,59 @@ import io.grpc.ManagedChannel; import io.grpc.Metadata; import io.grpc.MethodDescriptor; +import io.grpc.Status; import java.io.IOException; import java.util.Arrays; import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.concurrent.TimeUnit; -import org.junit.Test; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; import org.mockito.ArgumentCaptor; import org.mockito.Mockito; -import org.threeten.bp.Duration; -public class GrpcClientCallsTest { +class GrpcClientCallsTest { + + // Auth Library's GoogleAuthException is package-private. Copy basic functionality for tests + private static class GoogleAuthException extends IOException implements Retryable { + + private final boolean isRetryable; + + private GoogleAuthException(boolean isRetryable) { + this.isRetryable = isRetryable; + } + + @Override + public boolean isRetryable() { + return isRetryable; + } + + @Override + public int getRetryCount() { + return 0; + } + } + + private GrpcCallContext defaultCallContext; + private EndpointContext endpointContext; + private Credentials credentials; + private Channel mockChannel; + + @BeforeEach + void setUp() throws IOException { + credentials = Mockito.mock(Credentials.class); + endpointContext = Mockito.mock(EndpointContext.class); + mockChannel = Mockito.mock(Channel.class); + + defaultCallContext = GrpcCallContext.createDefault().withEndpointContext(endpointContext); + Mockito.doNothing() + .when(endpointContext) + .validateUniverseDomain(Mockito.any(Credentials.class), Mockito.any(GrpcStatusCode.class)); + } + @Test - public void testAffinity() throws IOException { + void testAffinity() throws IOException { MethodDescriptor descriptor = FakeServiceGrpc.METHOD_RECOGNIZE; @SuppressWarnings("unchecked") @@ -77,8 +122,9 @@ public void testAffinity() throws IOException { Channel pool = ChannelPool.create( ChannelPoolSettings.staticallySized(2), - new FakeChannelFactory(Arrays.asList(channel0, channel1))); - GrpcCallContext context = GrpcCallContext.createDefault().withChannel(pool); + new FakeChannelFactory(Arrays.asList(channel0, channel1)), + null); + GrpcCallContext context = defaultCallContext.withChannel(pool); ClientCall gotCallA = GrpcClientCalls.newCall(descriptor, context.withChannelAffinity(0)); @@ -92,7 +138,7 @@ public void testAffinity() throws IOException { } @Test - public void testExtraHeaders() { + void testExtraHeaders() throws IOException { Metadata emptyHeaders = new Metadata(); final Map> extraHeaders = new HashMap<>(); extraHeaders.put( @@ -128,12 +174,12 @@ public void testExtraHeaders() { .thenReturn(mockClientCall); GrpcCallContext context = - GrpcCallContext.createDefault().withChannel(mockChannel).withExtraHeaders(extraHeaders); + defaultCallContext.withChannel(mockChannel).withExtraHeaders(extraHeaders); GrpcClientCalls.newCall(descriptor, context).start(mockListener, emptyHeaders); } @Test - public void testTimeoutToDeadlineConversion() { + void testTimeoutToDeadlineConversion() throws IOException { MethodDescriptor descriptor = FakeServiceGrpc.METHOD_RECOGNIZE; @SuppressWarnings("unchecked") @@ -149,11 +195,11 @@ public void testTimeoutToDeadlineConversion() { Mockito.when(mockChannel.newCall(Mockito.eq(descriptor), capturedCallOptions.capture())) .thenReturn(mockClientCall); - Duration timeout = Duration.ofSeconds(10); + java.time.Duration timeout = java.time.Duration.ofSeconds(10); Deadline minExpectedDeadline = Deadline.after(timeout.getSeconds(), TimeUnit.SECONDS); GrpcCallContext context = - GrpcCallContext.createDefault().withChannel(mockChannel).withTimeout(timeout); + defaultCallContext.withChannel(mockChannel).withTimeoutDuration(timeout); GrpcClientCalls.newCall(descriptor, context).start(mockListener, new Metadata()); @@ -164,7 +210,7 @@ public void testTimeoutToDeadlineConversion() { } @Test - public void testTimeoutAfterDeadline() { + void testTimeoutAfterDeadline() throws IOException { MethodDescriptor descriptor = FakeServiceGrpc.METHOD_RECOGNIZE; @SuppressWarnings("unchecked") @@ -182,13 +228,13 @@ public void testTimeoutAfterDeadline() { // Configure a timeout that occurs after the grpc deadline Deadline priorDeadline = Deadline.after(5, TimeUnit.SECONDS); - Duration timeout = Duration.ofSeconds(10); + java.time.Duration timeout = java.time.Duration.ofSeconds(10); GrpcCallContext context = - GrpcCallContext.createDefault() + defaultCallContext .withChannel(mockChannel) .withCallOptions(CallOptions.DEFAULT.withDeadline(priorDeadline)) - .withTimeout(timeout); + .withTimeoutDuration(timeout); GrpcClientCalls.newCall(descriptor, context).start(mockListener, new Metadata()); @@ -197,7 +243,7 @@ public void testTimeoutAfterDeadline() { } @Test - public void testTimeoutBeforeDeadline() { + void testTimeoutBeforeDeadline() throws IOException { MethodDescriptor descriptor = FakeServiceGrpc.METHOD_RECOGNIZE; @SuppressWarnings("unchecked") @@ -214,15 +260,15 @@ public void testTimeoutBeforeDeadline() { .thenReturn(mockClientCall); // Configure a timeout that occurs before the grpc deadline - Duration timeout = Duration.ofSeconds(5); + java.time.Duration timeout = java.time.Duration.ofSeconds(5); Deadline subsequentDeadline = Deadline.after(10, TimeUnit.SECONDS); Deadline minExpectedDeadline = Deadline.after(timeout.getSeconds(), TimeUnit.SECONDS); GrpcCallContext context = - GrpcCallContext.createDefault() + defaultCallContext .withChannel(mockChannel) .withCallOptions(CallOptions.DEFAULT.withDeadline(subsequentDeadline)) - .withTimeout(timeout); + .withTimeoutDuration(timeout); GrpcClientCalls.newCall(descriptor, context).start(mockListener, new Metadata()); @@ -232,4 +278,66 @@ public void testTimeoutBeforeDeadline() { Truth.assertThat(capturedCallOptions.getValue().getDeadline()).isAtLeast(minExpectedDeadline); Truth.assertThat(capturedCallOptions.getValue().getDeadline()).isAtMost(maxExpectedDeadline); } + + @Test + void testValidUniverseDomain() throws IOException { + GrpcCallContext context = + GrpcCallContext.createDefault() + .withChannel(mockChannel) + .withCredentials(credentials) + .withEndpointContext(endpointContext); + + CallOptions callOptions = context.getCallOptions(); + + MethodDescriptor descriptor = FakeServiceGrpc.METHOD_RECOGNIZE; + GrpcClientCalls.newCall(descriptor, context); + Mockito.verify(mockChannel, Mockito.times(1)).newCall(descriptor, callOptions); + } + + // This test is when the universe domain does not match + @Test + void testInvalidUniverseDomain() throws IOException { + Mockito.doThrow( + new UnauthenticatedException( + null, GrpcStatusCode.of(Status.Code.UNAUTHENTICATED), false)) + .when(endpointContext) + .validateUniverseDomain(Mockito.any(Credentials.class), Mockito.any(GrpcStatusCode.class)); + GrpcCallContext context = + GrpcCallContext.createDefault() + .withChannel(mockChannel) + .withCredentials(credentials) + .withEndpointContext(endpointContext); + + CallOptions callOptions = context.getCallOptions(); + + MethodDescriptor descriptor = FakeServiceGrpc.METHOD_RECOGNIZE; + UnauthenticatedException exception = + assertThrows( + UnauthenticatedException.class, () -> GrpcClientCalls.newCall(descriptor, context)); + assertThat(exception.getStatusCode().getCode()).isEqualTo(GrpcStatusCode.Code.UNAUTHENTICATED); + Mockito.verify(mockChannel, Mockito.never()).newCall(descriptor, callOptions); + } + + // This test is when the MDS is unable to return a valid universe domain + @Test + void testUniverseDomainNotReady_shouldRetry() throws IOException { + Mockito.doThrow(new GoogleAuthException(true)) + .when(endpointContext) + .validateUniverseDomain(Mockito.any(Credentials.class), Mockito.any(GrpcStatusCode.class)); + GrpcCallContext context = + GrpcCallContext.createDefault() + .withChannel(mockChannel) + .withCredentials(credentials) + .withEndpointContext(endpointContext); + + CallOptions callOptions = context.getCallOptions(); + + MethodDescriptor descriptor = FakeServiceGrpc.METHOD_RECOGNIZE; + UnavailableException exception = + assertThrows( + UnavailableException.class, () -> GrpcClientCalls.newCall(descriptor, context)); + assertThat(exception.getStatusCode().getCode()).isEqualTo(GrpcStatusCode.Code.UNAVAILABLE); + Truth.assertThat(exception.isRetryable()).isTrue(); + Mockito.verify(mockChannel, Mockito.never()).newCall(descriptor, callOptions); + } } diff --git a/gax-java/gax-grpc/src/test/java/com/google/api/gax/grpc/GrpcDirectServerStreamingCallableTest.java b/gax-java/gax-grpc/src/test/java/com/google/api/gax/grpc/GrpcDirectServerStreamingCallableTest.java index e5084b753b..d969f81b42 100644 --- a/gax-java/gax-grpc/src/test/java/com/google/api/gax/grpc/GrpcDirectServerStreamingCallableTest.java +++ b/gax-java/gax-grpc/src/test/java/com/google/api/gax/grpc/GrpcDirectServerStreamingCallableTest.java @@ -36,6 +36,7 @@ import com.google.api.gax.grpc.testing.InProcessServer; import com.google.api.gax.rpc.ApiException; import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.EndpointContext; import com.google.api.gax.rpc.ResponseObserver; import com.google.api.gax.rpc.ServerStream; import com.google.api.gax.rpc.ServerStreamingCallSettings; @@ -44,6 +45,7 @@ import com.google.api.gax.rpc.StatusCode; import com.google.api.gax.rpc.StreamController; import com.google.api.gax.rpc.testing.FakeCallContext; +import com.google.auth.Credentials; import com.google.common.collect.Lists; import com.google.common.truth.Truth; import com.google.type.Color; @@ -57,15 +59,13 @@ import java.util.concurrent.CancellationException; import java.util.concurrent.CountDownLatch; import java.util.concurrent.TimeUnit; -import org.junit.After; -import org.junit.Assert; -import org.junit.Before; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.junit.runners.JUnit4; - -@RunWith(JUnit4.class) -public class GrpcDirectServerStreamingCallableTest { +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.mockito.Mockito; + +class GrpcDirectServerStreamingCallableTest { private static final Color DEFAULT_REQUEST = Color.newBuilder().setRed(0.5f).build(); private static final Color ASYNC_REQUEST = DEFAULT_REQUEST.toBuilder().setGreen(1000).build(); private static final Color ERROR_REQUEST = Color.newBuilder().setRed(-1).build(); @@ -78,18 +78,25 @@ public class GrpcDirectServerStreamingCallableTest { private ServerStreamingCallSettings streamingCallSettings; private ServerStreamingCallable streamingCallable; - @Before - public void setUp() throws InstantiationException, IllegalAccessException, IOException { + @BeforeEach + void setUp() throws InstantiationException, IllegalAccessException, IOException { String serverName = "fakeservice"; FakeServiceImpl serviceImpl = new FakeServiceImpl(); inprocessServer = new InProcessServer<>(serviceImpl, serverName); inprocessServer.start(); + EndpointContext endpointContext = Mockito.mock(EndpointContext.class); + Mockito.doNothing() + .when(endpointContext) + .validateUniverseDomain(Mockito.any(Credentials.class), Mockito.any(GrpcStatusCode.class)); + channel = InProcessChannelBuilder.forName(serverName).directExecutor().usePlaintext().build(); clientContext = ClientContext.newBuilder() .setTransportChannel(GrpcTransportChannel.create(channel)) - .setDefaultCallContext(GrpcCallContext.of(channel, CallOptions.DEFAULT)) + .setDefaultCallContext( + GrpcCallContext.of(channel, CallOptions.DEFAULT) + .withEndpointContext(endpointContext)) .build(); streamingCallSettings = ServerStreamingCallSettings.newBuilder().build(); streamingCallable = @@ -99,20 +106,19 @@ public void setUp() throws InstantiationException, IllegalAccessException, IOExc clientContext); } - @After - public void tearDown() { + @AfterEach + void tearDown() { channel.shutdown(); inprocessServer.stop(); } @Test - public void testBadContext() { + void testBadContext() { streamingCallable = GrpcCallableFactory.createServerStreamingCallable( GrpcCallSettings.create(METHOD_SERVER_STREAMING_RECOGNIZE), streamingCallSettings, - clientContext - .toBuilder() + clientContext.toBuilder() .setDefaultCallContext(FakeCallContext.createDefault()) .build()); @@ -120,7 +126,7 @@ public void testBadContext() { MoneyObserver observer = new MoneyObserver(true, latch); try { streamingCallable.call(DEFAULT_REQUEST, observer); - Assert.fail("Callable should have thrown an exception"); + Assertions.fail("Callable should have thrown an exception"); } catch (IllegalArgumentException expected) { Truth.assertThat(expected) .hasMessageThat() @@ -129,7 +135,7 @@ public void testBadContext() { } @Test - public void testServerStreamingStart() { + void testServerStreamingStart() { CountDownLatch latch = new CountDownLatch(1); MoneyObserver moneyObserver = new MoneyObserver(true, latch); @@ -139,7 +145,7 @@ public void testServerStreamingStart() { } @Test - public void testServerStreaming() throws Exception { + void testServerStreaming() throws Exception { CountDownLatch latch = new CountDownLatch(2); MoneyObserver moneyObserver = new MoneyObserver(true, latch); @@ -151,7 +157,7 @@ public void testServerStreaming() throws Exception { } @Test - public void testManualFlowControl() throws Exception { + void testManualFlowControl() throws Exception { CountDownLatch latch = new CountDownLatch(2); MoneyObserver moneyObserver = new MoneyObserver(false, latch); @@ -170,7 +176,7 @@ public void testManualFlowControl() throws Exception { } @Test - public void testCancelClientCall() throws Exception { + void testCancelClientCall() throws Exception { CountDownLatch latch = new CountDownLatch(1); MoneyObserver moneyObserver = new MoneyObserver(false, latch); @@ -185,7 +191,7 @@ public void testCancelClientCall() throws Exception { } @Test - public void testOnResponseError() throws Throwable { + void testOnResponseError() throws Throwable { CountDownLatch latch = new CountDownLatch(1); MoneyObserver moneyObserver = new MoneyObserver(true, latch); @@ -201,7 +207,7 @@ public void testOnResponseError() throws Throwable { } @Test - public void testObserverErrorCancelsCall() throws Throwable { + void testObserverErrorCancelsCall() throws Throwable { final RuntimeException expectedCause = new RuntimeException("some error"); final SettableApiFuture actualErrorF = SettableApiFuture.create(); @@ -240,7 +246,7 @@ protected void onCompleteImpl() { } @Test - public void testBlockingServerStreaming() { + void testBlockingServerStreaming() { Color request = Color.newBuilder().setRed(0.5f).build(); ServerStream response = streamingCallable.call(request); List responseData = Lists.newArrayList(response); diff --git a/gax-java/gax-grpc/src/test/java/com/google/api/gax/grpc/GrpcDirectStreamControllerTest.java b/gax-java/gax-grpc/src/test/java/com/google/api/gax/grpc/GrpcDirectStreamControllerTest.java new file mode 100644 index 0000000000..2359dc5d28 --- /dev/null +++ b/gax-java/gax-grpc/src/test/java/com/google/api/gax/grpc/GrpcDirectStreamControllerTest.java @@ -0,0 +1,166 @@ +/* + * Copyright 2023 Google LLC + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Google LLC nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +package com.google.api.gax.grpc; + +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.NoCredentialsProvider; +import com.google.api.gax.grpc.testing.FakeServiceGrpc; +import com.google.api.gax.retrying.RetrySettings; +import com.google.api.gax.retrying.StreamResumptionStrategy; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.DeadlineExceededException; +import com.google.api.gax.rpc.FixedTransportChannelProvider; +import com.google.api.gax.rpc.ServerStreamingCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.api.gax.rpc.StatusCode; +import com.google.api.gax.rpc.StubSettings; +import com.google.type.Color; +import com.google.type.Money; +import io.grpc.ManagedChannel; +import io.grpc.ManagedChannelBuilder; +import io.grpc.Server; +import io.grpc.ServerBuilder; +import io.grpc.Status; +import io.grpc.stub.StreamObserver; +import java.util.ArrayList; +import java.util.List; +import java.util.concurrent.TimeUnit; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.Timeout; + +class GrpcDirectStreamControllerTest { + private static final int DEFAULT_AWAIT_TERMINATION_SEC = 10; + + @Test + @Timeout(180) + void testRetryNoRaceCondition() throws Exception { + Server server = ServerBuilder.forPort(1234).addService(new FakeService()).build().start(); + ManagedChannel channel = + ManagedChannelBuilder.forAddress("localhost", 1234).usePlaintext().build(); + StreamResumptionStrategy resumptionStrategy = + new StreamResumptionStrategy() { + @Nonnull + @Override + public StreamResumptionStrategy createNew() { + return this; + } + + @Nonnull + @Override + public Money processResponse(Money response) { + return response; + } + + @Nullable + @Override + public Color getResumeRequest(Color originalRequest) { + return originalRequest; + } + + @Override + public boolean canResume() { + return true; + } + }; + // Set up retry settings. Set total timeout to 1 minute to limit the total runtime of this + // test. Set retry delay to 1 ms so the retries will be scheduled in a loop with no delays. + ServerStreamingCallSettings callSettings = + ServerStreamingCallSettings.newBuilder() + .setResumptionStrategy(resumptionStrategy) + .setRetryableCodes(StatusCode.Code.DEADLINE_EXCEEDED) + .setRetrySettings( + RetrySettings.newBuilder() + .setTotalTimeoutDuration(java.time.Duration.ofMinutes(1)) + .setInitialRpcTimeoutDuration(java.time.Duration.ofMillis(1)) + .setMaxRpcTimeoutDuration(java.time.Duration.ofMillis(1)) + .setInitialRetryDelayDuration(java.time.Duration.ofMillis(1)) + .setMaxRetryDelayDuration(java.time.Duration.ofMillis(1)) + .build()) + .build(); + // Store a list of resources to manually close at the end of the test + List backgroundResourceList = new ArrayList<>(); + try { + GrpcTransportChannel transportChannel = GrpcTransportChannel.create(channel); + backgroundResourceList.add(transportChannel); + + StubSettings.Builder builder = + new StubSettings.Builder() { + @Override + public StubSettings build() { + return new StubSettings(this) { + @Override + public Builder toBuilder() { + throw new IllegalStateException(); + } + }; + } + }; + + builder + .setEndpoint("localhost:1234") + .setCredentialsProvider(NoCredentialsProvider.create()) + .setTransportChannelProvider(FixedTransportChannelProvider.create(transportChannel)); + + ClientContext clientContext = ClientContext.create(builder.build()); + backgroundResourceList.addAll(clientContext.getBackgroundResources()); + // GrpcCallableFactory's createServerStreamingCallable creates a retrying callable + ServerStreamingCallable callable = + GrpcCallableFactory.createServerStreamingCallable( + GrpcCallSettings.create(FakeServiceGrpc.METHOD_SERVER_STREAMING_RECOGNIZE), + callSettings, + clientContext); + + Color request = Color.newBuilder().getDefaultInstanceForType(); + for (Money money : callable.call(request, clientContext.getDefaultCallContext())) {} + } catch (DeadlineExceededException e) { + // Ignore this error + } finally { + // Shutdown all the resources + server.shutdown(); + server.awaitTermination(DEFAULT_AWAIT_TERMINATION_SEC, TimeUnit.SECONDS); + channel.shutdown(); + channel.awaitTermination(DEFAULT_AWAIT_TERMINATION_SEC, TimeUnit.SECONDS); + for (BackgroundResource backgroundResource : backgroundResourceList) { + backgroundResource.shutdown(); + backgroundResource.awaitTermination(DEFAULT_AWAIT_TERMINATION_SEC, TimeUnit.SECONDS); + } + } + } + + class FakeService extends FakeServiceGrpc.FakeServiceImplBase { + @Override + public void serverStreamingRecognize(Color request, StreamObserver responseObserver) { + responseObserver.onNext(Money.getDefaultInstance()); + responseObserver.onError(Status.DEADLINE_EXCEEDED.asException()); + } + } +} diff --git a/gax-java/gax-grpc/src/test/java/com/google/api/gax/grpc/GrpcDirectStreamingCallableTest.java b/gax-java/gax-grpc/src/test/java/com/google/api/gax/grpc/GrpcDirectStreamingCallableTest.java index 95d4550b03..d41d4cd005 100644 --- a/gax-java/gax-grpc/src/test/java/com/google/api/gax/grpc/GrpcDirectStreamingCallableTest.java +++ b/gax-java/gax-grpc/src/test/java/com/google/api/gax/grpc/GrpcDirectStreamingCallableTest.java @@ -42,7 +42,9 @@ import com.google.api.gax.rpc.ClientContext; import com.google.api.gax.rpc.ClientStream; import com.google.api.gax.rpc.ClientStreamingCallable; +import com.google.api.gax.rpc.EndpointContext; import com.google.api.gax.rpc.StatusCode.Code; +import com.google.auth.Credentials; import com.google.type.Color; import com.google.type.Money; import io.grpc.CallOptions; @@ -53,41 +55,45 @@ import java.io.IOException; import java.util.concurrent.CountDownLatch; import java.util.concurrent.TimeUnit; -import org.junit.After; -import org.junit.Before; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.junit.runners.JUnit4; - -@RunWith(JUnit4.class) -public class GrpcDirectStreamingCallableTest { +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.mockito.Mockito; + +class GrpcDirectStreamingCallableTest { private InProcessServer inprocessServer; private ManagedChannel channel; private FakeServiceImpl serviceImpl; private ClientContext clientContext; - @Before - public void setUp() throws InstantiationException, IllegalAccessException, IOException { + @BeforeEach + void setUp() throws InstantiationException, IllegalAccessException, IOException { String serverName = "fakeservice"; serviceImpl = new FakeServiceImpl(); inprocessServer = new InProcessServer<>(serviceImpl, serverName); inprocessServer.start(); channel = InProcessChannelBuilder.forName(serverName).directExecutor().usePlaintext().build(); + EndpointContext endpointContext = Mockito.mock(EndpointContext.class); + Mockito.doNothing() + .when(endpointContext) + .validateUniverseDomain(Mockito.any(Credentials.class), Mockito.any(GrpcStatusCode.class)); clientContext = ClientContext.newBuilder() .setTransportChannel(GrpcTransportChannel.create(channel)) - .setDefaultCallContext(GrpcCallContext.of(channel, CallOptions.DEFAULT)) + .setDefaultCallContext( + GrpcCallContext.of(channel, CallOptions.DEFAULT) + .withEndpointContext(endpointContext)) .build(); } - @After - public void tearDown() { + @AfterEach + void tearDown() { channel.shutdown(); inprocessServer.stop(); } @Test - public void testBidiStreaming() throws Exception { + void testBidiStreaming() throws Exception { BidiStreamingCallable streamingCallable = GrpcCallableFactory.createBidiStreamingCallable( GrpcCallSettings.create(METHOD_STREAMING_RECOGNIZE), null, clientContext); @@ -109,7 +115,7 @@ public void testBidiStreaming() throws Exception { } @Test - public void testBidiStreamingServerError() throws Exception { + void testBidiStreamingServerError() throws Exception { BidiStreamingCallable streamingCallable = GrpcCallableFactory.createBidiStreamingCallable( GrpcCallSettings.create(METHOD_STREAMING_RECOGNIZE_ERROR), null, clientContext); @@ -132,7 +138,7 @@ public void testBidiStreamingServerError() throws Exception { } @Test - public void testBidiStreamingClientError() throws Exception { + void testBidiStreamingClientError() throws Exception { BidiStreamingCallable streamingCallable = GrpcCallableFactory.createBidiStreamingCallable( GrpcCallSettings.create(METHOD_STREAMING_RECOGNIZE_ERROR), null, clientContext); @@ -159,7 +165,7 @@ public void testBidiStreamingClientError() throws Exception { } @Test - public void testClientStreaming() throws Exception { + void testClientStreaming() throws Exception { ClientStreamingCallable streamingCallable = GrpcCallableFactory.createClientStreamingCallable( GrpcCallSettings.create(METHOD_CLIENT_STREAMING_RECOGNIZE), null, clientContext); @@ -205,5 +211,6 @@ public void onError(Throwable t) { public void onCompleted() { completed = true; } - }; + } + ; } diff --git a/gax-java/gax-grpc/src/test/java/com/google/api/gax/grpc/GrpcHeaderInterceptorTest.java b/gax-java/gax-grpc/src/test/java/com/google/api/gax/grpc/GrpcHeaderInterceptorTest.java index cf49ddbcb6..0f2fcab003 100644 --- a/gax-java/gax-grpc/src/test/java/com/google/api/gax/grpc/GrpcHeaderInterceptorTest.java +++ b/gax-java/gax-grpc/src/test/java/com/google/api/gax/grpc/GrpcHeaderInterceptorTest.java @@ -29,7 +29,7 @@ */ package com.google.api.gax.grpc; -import static org.junit.Assert.assertEquals; +import static org.junit.jupiter.api.Assertions.assertEquals; import static org.mockito.ArgumentMatchers.any; import static org.mockito.ArgumentMatchers.same; import static org.mockito.Mockito.mock; @@ -45,18 +45,15 @@ import io.grpc.Metadata; import io.grpc.MethodDescriptor; import java.util.Map; -import org.junit.Before; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.junit.runners.JUnit4; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; import org.mockito.ArgumentCaptor; import org.mockito.Mock; import org.mockito.Mockito; import org.mockito.MockitoAnnotations; /** Tests for {@link GrpcHeaderInterceptor}. */ -@RunWith(JUnit4.class) -public class GrpcHeaderInterceptorTest { +class GrpcHeaderInterceptorTest { @Mock private Channel channel; @@ -65,15 +62,15 @@ public class GrpcHeaderInterceptorTest { private static final MethodDescriptor method = FakeMethodDescriptor.create(); /** Sets up mocks. */ - @Before - public void setUp() { + @BeforeEach + void setUp() { MockitoAnnotations.initMocks(this); when(channel.newCall(Mockito.>any(), any(CallOptions.class))) .thenReturn(call); } @Test - public void testInterceptor() { + void testInterceptor() { Map data = ImmutableMap.of("x-goog-api-client", "abcd", "user-agent", "defg"); GrpcHeaderInterceptor interceptor = new GrpcHeaderInterceptor(data); Channel intercepted = ClientInterceptors.intercept(channel, interceptor); diff --git a/gax-java/gax-grpc/src/test/java/com/google/api/gax/grpc/GrpcLoggingInterceptorTest.java b/gax-java/gax-grpc/src/test/java/com/google/api/gax/grpc/GrpcLoggingInterceptorTest.java new file mode 100644 index 0000000000..fad4cd468b --- /dev/null +++ b/gax-java/gax-grpc/src/test/java/com/google/api/gax/grpc/GrpcLoggingInterceptorTest.java @@ -0,0 +1,104 @@ +/* + * Copyright 2025 Google LLC + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Google LLC nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +package com.google.api.gax.grpc; + +import static org.mockito.ArgumentMatchers.any; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.spy; +import static org.mockito.Mockito.verify; +import static org.mockito.Mockito.when; + +import com.google.api.gax.grpc.testing.FakeMethodDescriptor; +import io.grpc.CallOptions; +import io.grpc.Channel; +import io.grpc.ClientCall; +import io.grpc.ClientInterceptors; +import io.grpc.Metadata; +import io.grpc.MethodDescriptor; +import io.grpc.Status; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; +import org.mockito.Mock; +import org.mockito.Mockito; +import org.mockito.junit.jupiter.MockitoExtension; + +@ExtendWith(MockitoExtension.class) +class GrpcLoggingInterceptorTest { + @Mock private Channel channel; + + @Mock private ClientCall call; + + private static final MethodDescriptor method = FakeMethodDescriptor.create(); + + @Test + void testInterceptor_basic() { + when(channel.newCall(Mockito.>any(), any(CallOptions.class))) + .thenReturn(call); + GrpcLoggingInterceptor interceptor = new GrpcLoggingInterceptor(); + Channel intercepted = ClientInterceptors.intercept(channel, interceptor); + @SuppressWarnings("unchecked") + ClientCall.Listener listener = mock(ClientCall.Listener.class); + ClientCall interceptedCall = intercepted.newCall(method, CallOptions.DEFAULT); + // Simulate starting the call + interceptedCall.start(listener, new Metadata()); + // Verify that the underlying call's start() method is invoked + verify(call).start(any(ClientCall.Listener.class), any(Metadata.class)); + + // Simulate sending a message + String requestMessage = "test request"; + interceptedCall.sendMessage(requestMessage); + // Verify that the underlying call's sendMessage() method is invoked + verify(call).sendMessage(requestMessage); + } + + @Test + void testInterceptor_responseListener() { + when(channel.newCall(Mockito.>any(), any(CallOptions.class))) + .thenReturn(call); + GrpcLoggingInterceptor interceptor = spy(new GrpcLoggingInterceptor()); + Channel intercepted = ClientInterceptors.intercept(channel, interceptor); + @SuppressWarnings("unchecked") + ClientCall.Listener listener = mock(ClientCall.Listener.class); + ClientCall interceptedCall = intercepted.newCall(method, CallOptions.DEFAULT); + interceptedCall.start(listener, new Metadata()); + + // Simulate respond interceptor calls + Metadata responseHeaders = new Metadata(); + responseHeaders.put( + Metadata.Key.of("test-header", Metadata.ASCII_STRING_MARSHALLER), "header-value"); + interceptor.currentListener.onHeaders(responseHeaders); + + interceptor.currentListener.onMessage(null); + + Status status = Status.OK; + interceptor.currentListener.onClose(status, new Metadata()); + } +} diff --git a/gax-java/gax-grpc/src/test/java/com/google/api/gax/grpc/GrpcLongRunningClientTest.java b/gax-java/gax-grpc/src/test/java/com/google/api/gax/grpc/GrpcLongRunningClientTest.java index dc38795054..27af7de75c 100644 --- a/gax-java/gax-grpc/src/test/java/com/google/api/gax/grpc/GrpcLongRunningClientTest.java +++ b/gax-java/gax-grpc/src/test/java/com/google/api/gax/grpc/GrpcLongRunningClientTest.java @@ -44,15 +44,12 @@ import com.google.longrunning.Operation; import com.google.longrunning.stub.OperationsStub; import com.google.protobuf.Empty; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.junit.runners.JUnit4; +import org.junit.jupiter.api.Test; -@RunWith(JUnit4.class) -public class GrpcLongRunningClientTest { +class GrpcLongRunningClientTest { @Test - public void get() { + void get() { OperationsStub operationsStub = mock(OperationsStub.class); when(operationsStub.getOperationCallable()) .thenReturn( @@ -75,7 +72,7 @@ public ApiFuture futureCall( } @Test - public void cancel() { + void cancel() { OperationsStub operationsStub = mock(OperationsStub.class); when(operationsStub.cancelOperationCallable()) .thenReturn( @@ -96,7 +93,7 @@ public ApiFuture futureCall( } @Test - public void delete() { + void delete() { OperationsStub operationsStub = mock(OperationsStub.class); when(operationsStub.deleteOperationCallable()) .thenReturn( diff --git a/gax-java/gax-grpc/src/test/java/com/google/api/gax/grpc/GrpcLongRunningTest.java b/gax-java/gax-grpc/src/test/java/com/google/api/gax/grpc/GrpcLongRunningTest.java index 7149f23ba7..ac88e4acec 100644 --- a/gax-java/gax-grpc/src/test/java/com/google/api/gax/grpc/GrpcLongRunningTest.java +++ b/gax-java/gax-grpc/src/test/java/com/google/api/gax/grpc/GrpcLongRunningTest.java @@ -42,11 +42,13 @@ import com.google.api.gax.longrunning.OperationTimedPollAlgorithm; import com.google.api.gax.retrying.RetrySettings; import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.EndpointContext; import com.google.api.gax.rpc.OperationCallSettings; import com.google.api.gax.rpc.OperationCallable; import com.google.api.gax.rpc.TransportChannel; import com.google.api.gax.rpc.TransportChannelProvider; import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.auth.Credentials; import com.google.longrunning.Operation; import com.google.longrunning.OperationsSettings; import com.google.longrunning.stub.GrpcOperationsStub; @@ -64,26 +66,23 @@ import io.grpc.Status.Code; import java.io.IOException; import java.util.concurrent.TimeUnit; -import org.junit.Before; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.junit.runners.JUnit4; -import org.threeten.bp.Duration; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.mockito.Mockito; -@RunWith(JUnit4.class) -public class GrpcLongRunningTest { +class GrpcLongRunningTest { private static final RetrySettings FAST_RETRY_SETTINGS = RetrySettings.newBuilder() - .setInitialRetryDelay(Duration.ofMillis(1L)) + .setInitialRetryDelayDuration(java.time.Duration.ofMillis(1L)) .setRetryDelayMultiplier(1) - .setMaxRetryDelay(Duration.ofMillis(1L)) - .setInitialRpcTimeout(Duration.ofMillis(1L)) + .setMaxRetryDelayDuration(java.time.Duration.ofMillis(1L)) + .setInitialRpcTimeoutDuration(java.time.Duration.ofMillis(1L)) .setMaxAttempts(0) .setJittered(false) .setRpcTimeoutMultiplier(1) - .setMaxRpcTimeout(Duration.ofMillis(1L)) - .setTotalTimeout(Duration.ofMillis(5L)) + .setMaxRpcTimeoutDuration(java.time.Duration.ofMillis(1L)) + .setTotalTimeoutDuration(java.time.Duration.ofMillis(5L)) .build(); private ManagedChannel channel; @@ -95,13 +94,15 @@ public class GrpcLongRunningTest { private FakeApiClock clock; private OperationTimedPollAlgorithm pollingAlgorithm; - @Before - public void setUp() throws IOException { + @BeforeEach + void setUp() throws IOException { channel = mock(ManagedChannel.class); TransportChannelProvider operationsChannelProvider = mock(TransportChannelProvider.class); TransportChannel transportChannel = GrpcTransportChannel.newBuilder().setManagedChannel(channel).build(); when(operationsChannelProvider.getTransportChannel()).thenReturn(transportChannel); + when(operationsChannelProvider.withUseS2A(Mockito.any(boolean.class))) + .thenReturn(operationsChannelProvider); clock = new FakeApiClock(0L); executor = RecordingScheduler.create(clock); @@ -133,18 +134,25 @@ public void setUp() throws IOException { .setPollingAlgorithm(pollingAlgorithm) .build(); + EndpointContext endpointContext = Mockito.mock(EndpointContext.class); + Mockito.doNothing() + .when(endpointContext) + .validateUniverseDomain(Mockito.any(Credentials.class), Mockito.any(GrpcStatusCode.class)); + initialContext = ClientContext.newBuilder() .setTransportChannel( GrpcTransportChannel.newBuilder().setManagedChannel(channel).build()) .setExecutor(executor) - .setDefaultCallContext(GrpcCallContext.of(channel, CallOptions.DEFAULT)) + .setDefaultCallContext( + GrpcCallContext.of(channel, CallOptions.DEFAULT) + .withEndpointContext(endpointContext)) .setClock(clock) .build(); } @Test - public void testCall() { + void testCall() throws IOException { Color resp = getColor(1.0f); Money meta = getMoney("UAH"); Operation resultOperation = getOperation("testCall", resp, meta, true); @@ -154,13 +162,19 @@ public void testCall() { GrpcCallableFactory.createOperationCallable( createGrpcSettings(), callSettings, initialContext, operationsStub); - Color response = callable.call(2, GrpcCallContext.createDefault()); + EndpointContext endpointContext = Mockito.mock(EndpointContext.class); + Mockito.doNothing() + .when(endpointContext) + .validateUniverseDomain(Mockito.any(Credentials.class), Mockito.any(GrpcStatusCode.class)); + + Color response = + callable.call(2, GrpcCallContext.createDefault().withEndpointContext(endpointContext)); assertThat(response).isEqualTo(resp); assertThat(executor.getIterationsCount()).isEqualTo(0); } @Test - public void testFutureCallPollDoneOnFirst() throws Exception { + void testFutureCallPollDoneOnFirst() throws Exception { String opName = "testFutureCallPollDoneOnFirst"; Color resp = getColor(0.5f); Money meta = getMoney("UAH"); diff --git a/gax-java/gax-grpc/src/test/java/com/google/api/gax/grpc/GrpcMetadataHandlerInterceptorTest.java b/gax-java/gax-grpc/src/test/java/com/google/api/gax/grpc/GrpcMetadataHandlerInterceptorTest.java index f8306fddfa..bfcfaad960 100644 --- a/gax-java/gax-grpc/src/test/java/com/google/api/gax/grpc/GrpcMetadataHandlerInterceptorTest.java +++ b/gax-java/gax-grpc/src/test/java/com/google/api/gax/grpc/GrpcMetadataHandlerInterceptorTest.java @@ -29,8 +29,8 @@ */ package com.google.api.gax.grpc; -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertTrue; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertTrue; import static org.mockito.ArgumentMatchers.any; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.verify; @@ -44,18 +44,15 @@ import io.grpc.Metadata; import io.grpc.MethodDescriptor; import io.grpc.Status; -import org.junit.Before; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.junit.runners.JUnit4; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; import org.mockito.ArgumentCaptor; import org.mockito.Mock; import org.mockito.Mockito; import org.mockito.MockitoAnnotations; /** Tests for {@link GrpcHeaderInterceptor}. */ -@RunWith(JUnit4.class) -public class GrpcMetadataHandlerInterceptorTest { +class GrpcMetadataHandlerInterceptorTest { private static class MutableBoolean { private volatile boolean value = false; @@ -67,15 +64,15 @@ private static class MutableBoolean { private static final MethodDescriptor method = FakeMethodDescriptor.create(); /** Sets up mocks. */ - @Before - public void setUp() { + @BeforeEach + void setUp() { MockitoAnnotations.initMocks(this); when(channel.newCall(Mockito.>any(), any(CallOptions.class))) .thenReturn(call); } @Test - public void testInterceptor() { + void testInterceptor() { final MutableBoolean metadataHandlerCalled = new MutableBoolean(); final MutableBoolean trailingMetadataHandlerCalled = new MutableBoolean(); diff --git a/gax-java/gax-grpc/src/test/java/com/google/api/gax/grpc/GrpcResponseMetadataTest.java b/gax-java/gax-grpc/src/test/java/com/google/api/gax/grpc/GrpcResponseMetadataTest.java index 80b041a376..bc294ef50e 100644 --- a/gax-java/gax-grpc/src/test/java/com/google/api/gax/grpc/GrpcResponseMetadataTest.java +++ b/gax-java/gax-grpc/src/test/java/com/google/api/gax/grpc/GrpcResponseMetadataTest.java @@ -33,8 +33,10 @@ import com.google.api.gax.grpc.testing.FakeServiceGrpc.FakeServiceImplBase; import com.google.api.gax.grpc.testing.InProcessServer; import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.EndpointContext; import com.google.api.gax.rpc.UnaryCallSettings; import com.google.api.gax.rpc.UnaryCallable; +import com.google.auth.Credentials; import com.google.type.Color; import com.google.type.Money; import io.grpc.CallOptions; @@ -49,18 +51,14 @@ import io.grpc.Status; import io.grpc.inprocess.InProcessChannelBuilder; import io.grpc.stub.StreamObserver; -import org.junit.After; -import org.junit.Assert; -import org.junit.Before; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.junit.runners.JUnit4; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; import org.mockito.Mockito; -import org.mockito.invocation.InvocationOnMock; import org.mockito.stubbing.Answer; -@RunWith(JUnit4.class) -public class GrpcResponseMetadataTest { +class GrpcResponseMetadataTest { private static final String HEADER_KEY = "inprocessheaderkey"; private static final String HEADER_VALUE = "inprocessheadervalue"; @@ -73,25 +71,23 @@ public class GrpcResponseMetadataTest { private Metadata requestHeaders = null; - @Before - public void setUp() throws Exception { + @BeforeEach + void setUp() throws Exception { String serverName = "fakeservice"; FakeServiceImplBase serviceImpl = Mockito.mock(FakeServiceImplBase.class); Mockito.doAnswer( - new Answer() { - @Override - public Void answer(InvocationOnMock invocation) { - Color color = invocation.getArgument(0); - StreamObserver observer = invocation.getArgument(1); - observer.onNext( - Money.newBuilder() - .setCurrencyCode("USD") - .setUnits((long) (color.getRed() * 255)) - .build()); - observer.onCompleted(); - return null; - } - }) + (Answer) + invocation -> { + Color color = invocation.getArgument(0); + StreamObserver observer = invocation.getArgument(1); + observer.onNext( + Money.newBuilder() + .setCurrencyCode("USD") + .setUnits((long) (color.getRed() * 255)) + .build()); + observer.onCompleted(); + return null; + }) .when(serviceImpl) .recognize(Mockito.any(), Mockito.>any()); requestHeaders = null; @@ -133,21 +129,29 @@ public void close(Status status, Metadata trailers) { .usePlaintext() .intercept(new GrpcMetadataHandlerInterceptor()) .build(); + + EndpointContext endpointContext = Mockito.mock(EndpointContext.class); + Mockito.doNothing() + .when(endpointContext) + .validateUniverseDomain(Mockito.any(Credentials.class), Mockito.any(GrpcStatusCode.class)); + clientContext = ClientContext.newBuilder() .setTransportChannel(GrpcTransportChannel.create(channel)) - .setDefaultCallContext(GrpcCallContext.of(channel, CallOptions.DEFAULT)) + .setDefaultCallContext( + GrpcCallContext.of(channel, CallOptions.DEFAULT) + .withEndpointContext(endpointContext)) .build(); } - @After - public void tearDown() { + @AfterEach + void tearDown() { channel.shutdown(); inprocessServer.stop(); } @Test - public void testResponseMetadataUnaryCall() { + void testResponseMetadataUnaryCall() { GrpcCallSettings grpcCallSettings = GrpcCallSettings.create(FakeServiceGrpc.METHOD_RECOGNIZE); @@ -157,19 +161,19 @@ public void testResponseMetadataUnaryCall() { UnaryCallable callable = GrpcCallableFactory.createUnaryCallable(grpcCallSettings, callSettings, clientContext); - Assert.assertNull(requestHeaders); + Assertions.assertNull(requestHeaders); GrpcResponseMetadata responseMetadata = new GrpcResponseMetadata(); callable.call(Color.getDefaultInstance(), responseMetadata.createContextWithHandlers()); - Assert.assertNotNull(requestHeaders); + Assertions.assertNotNull(requestHeaders); Metadata metadata = responseMetadata.getMetadata(); Metadata trailingMetadata = responseMetadata.getTrailingMetadata(); - Assert.assertEquals( + Assertions.assertEquals( metadata.get(Key.of(HEADER_KEY, Metadata.ASCII_STRING_MARSHALLER)), HEADER_VALUE); - Assert.assertEquals( + Assertions.assertEquals( trailingMetadata.get(Key.of(TRAILER_KEY, Metadata.ASCII_STRING_MARSHALLER)), TRAILER_VALUE); } } diff --git a/gax-java/gax-grpc/src/test/java/com/google/api/gax/grpc/GrpcStatusCodeTest.java b/gax-java/gax-grpc/src/test/java/com/google/api/gax/grpc/GrpcStatusCodeTest.java index f078a4a927..d93b9730c4 100644 --- a/gax-java/gax-grpc/src/test/java/com/google/api/gax/grpc/GrpcStatusCodeTest.java +++ b/gax-java/gax-grpc/src/test/java/com/google/api/gax/grpc/GrpcStatusCodeTest.java @@ -32,14 +32,11 @@ import com.google.api.gax.rpc.StatusCode; import com.google.common.truth.Truth; import io.grpc.Status; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.junit.runners.JUnit4; +import org.junit.jupiter.api.Test; -@RunWith(JUnit4.class) -public class GrpcStatusCodeTest { +class GrpcStatusCodeTest { @Test - public void testGrpcCodeToStatusCode() { + void testGrpcCodeToStatusCode() { testCodes(StatusCode.Code.OK, Status.Code.OK); testCodes(StatusCode.Code.CANCELLED, Status.Code.CANCELLED); testCodes(StatusCode.Code.UNKNOWN, Status.Code.UNKNOWN); diff --git a/gax-java/gax-grpc/src/test/java/com/google/api/gax/grpc/GrpcTransportChannelTest.java b/gax-java/gax-grpc/src/test/java/com/google/api/gax/grpc/GrpcTransportChannelTest.java new file mode 100644 index 0000000000..f762c3899e --- /dev/null +++ b/gax-java/gax-grpc/src/test/java/com/google/api/gax/grpc/GrpcTransportChannelTest.java @@ -0,0 +1,48 @@ +/* + * Copyright 2024 Google LLC + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Google LLC nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +package com.google.api.gax.grpc; + +import static org.junit.jupiter.api.Assertions.assertFalse; + +import io.grpc.ManagedChannel; +import org.junit.jupiter.api.Test; +import org.mockito.Mockito; + +class GrpcTransportChannelTest { + + @Test + void testBuilderDefaults() { + ManagedChannel channel = Mockito.mock(ManagedChannel.class); + GrpcTransportChannel grpcTransportChannel = + GrpcTransportChannel.newBuilder().setManagedChannel(channel).build(); + assertFalse(grpcTransportChannel.isDirectPath()); + } +} diff --git a/gax-java/gax-grpc/src/test/java/com/google/api/gax/grpc/GrpcTransportDescriptorTest.java b/gax-java/gax-grpc/src/test/java/com/google/api/gax/grpc/GrpcTransportDescriptorTest.java index 456d4e73b9..51a2cd0eaf 100644 --- a/gax-java/gax-grpc/src/test/java/com/google/api/gax/grpc/GrpcTransportDescriptorTest.java +++ b/gax-java/gax-grpc/src/test/java/com/google/api/gax/grpc/GrpcTransportDescriptorTest.java @@ -29,7 +29,7 @@ */ package com.google.api.gax.grpc; -import static org.junit.Assert.fail; +import static org.junit.jupiter.api.Assertions.fail; import com.google.api.core.ApiFuture; import com.google.api.core.ApiFutures; @@ -48,17 +48,14 @@ import io.grpc.StatusException; import io.grpc.StatusRuntimeException; import java.util.Collections; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.junit.runners.JUnit4; +import org.junit.jupiter.api.Test; -@RunWith(JUnit4.class) -public class GrpcTransportDescriptorTest { +class GrpcTransportDescriptorTest { private static boolean NOT_RETRYABLE = false; private static boolean IS_RETRYABLE = true; @Test - public void translateException_StatusException_noRetry() { + void translateException_StatusException_noRetry() { Throwable originalException = new StatusException(Status.INVALID_ARGUMENT); GrpcExceptionCallable exceptionCallable = new GrpcExceptionCallable<>( @@ -73,7 +70,7 @@ public void translateException_StatusException_noRetry() { } @Test - public void translateException_StatusException_withRetry() { + void translateException_StatusException_withRetry() { Throwable originalException = new StatusException(Status.UNAVAILABLE); GrpcExceptionCallable exceptionCallable = new GrpcExceptionCallable<>( @@ -88,7 +85,7 @@ public void translateException_StatusException_withRetry() { } @Test - public void translateException_StatusRuntimeException_noRetry() { + void translateException_StatusRuntimeException_noRetry() { Throwable originalException = new StatusRuntimeException(Status.INVALID_ARGUMENT); GrpcExceptionCallable exceptionCallable = new GrpcExceptionCallable<>( @@ -103,7 +100,7 @@ public void translateException_StatusRuntimeException_noRetry() { } @Test - public void translateException_StatusRuntimeException_withRetry() { + void translateException_StatusRuntimeException_withRetry() { Throwable originalException = new StatusRuntimeException(Status.UNAVAILABLE); GrpcExceptionCallable exceptionCallable = new GrpcExceptionCallable<>( @@ -118,7 +115,7 @@ public void translateException_StatusRuntimeException_withRetry() { } @Test - public void translateException_cancelled() { + void translateException_cancelled() { GrpcExceptionCallable exceptionCallable = new GrpcExceptionCallable<>(inactiveCallable(), Collections.emptySet()); ApiFuture result = exceptionCallable.futureCall(0); @@ -129,7 +126,7 @@ public void translateException_cancelled() { } @Test - public void translateException_ApiException() { + void translateException_ApiException() { Throwable originalException = new RuntimeException("stuff went wrong"); Throwable apiException = new DataLossException( @@ -147,7 +144,7 @@ public void translateException_ApiException() { } @Test - public void translateException_RuntimeException() { + void translateException_RuntimeException() { Throwable originalException = new RuntimeException("stuff went wrong"); GrpcExceptionCallable exceptionCallable = new GrpcExceptionCallable<>( @@ -179,7 +176,7 @@ public ApiFuture futureCall(Integer request, ApiCallContext context) { }; } - public void assertInnerExceptionIsInstanceOf( + void assertInnerExceptionIsInstanceOf( Throwable thrownException, Class clazz, boolean retryable, Throwable originalException) { Truth.assertThat(thrownException).isInstanceOf(clazz); ApiException apiException = (ApiException) thrownException; diff --git a/gax-java/gax-grpc/src/test/java/com/google/api/gax/grpc/InstantiatingGrpcChannelProviderTest.java b/gax-java/gax-grpc/src/test/java/com/google/api/gax/grpc/InstantiatingGrpcChannelProviderTest.java index 654fc57b8e..c7f0bbcd1d 100644 --- a/gax-java/gax-grpc/src/test/java/com/google/api/gax/grpc/InstantiatingGrpcChannelProviderTest.java +++ b/gax-java/gax-grpc/src/test/java/com/google/api/gax/grpc/InstantiatingGrpcChannelProviderTest.java @@ -29,25 +29,43 @@ */ package com.google.api.gax.grpc; +import static com.google.api.gax.grpc.InstantiatingGrpcChannelProvider.GCE_PRODUCTION_NAME_AFTER_2016; +import static com.google.api.gax.util.TimeConversionTestUtils.testDurationMethod; import static com.google.common.base.Preconditions.checkArgument; import static com.google.common.truth.Truth.assertThat; -import static org.junit.Assert.assertEquals; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNull; +import static org.junit.jupiter.api.Assertions.assertThrows; import com.google.api.core.ApiFunction; import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider.Builder; +import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider.HardBoundTokenTypes; +import com.google.api.gax.rpc.FixedHeaderProvider; import com.google.api.gax.rpc.HeaderProvider; +import com.google.api.gax.rpc.TransportChannel; import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.internal.EnvironmentProvider; import com.google.api.gax.rpc.mtls.AbstractMtlsTransportChannelTest; -import com.google.api.gax.rpc.mtls.MtlsProvider; +import com.google.api.gax.rpc.mtls.CertificateBasedAccess; +import com.google.auth.ApiKeyCredentials; +import com.google.auth.Credentials; +import com.google.auth.http.AuthHttpConstants; +import com.google.auth.mtls.MtlsProvider; import com.google.auth.oauth2.CloudShellCredentials; import com.google.auth.oauth2.ComputeEngineCredentials; +import com.google.auth.oauth2.SecureSessionAgent; +import com.google.auth.oauth2.SecureSessionAgentConfig; import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; +import com.google.common.truth.Truth; import io.grpc.ManagedChannel; import io.grpc.ManagedChannelBuilder; +import io.grpc.TlsChannelCredentials; import io.grpc.alts.ComputeEngineChannelBuilder; +import java.io.File; import java.io.IOException; import java.security.GeneralSecurityException; +import java.time.Duration; import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; @@ -56,19 +74,48 @@ import java.util.concurrent.Executor; import java.util.concurrent.ScheduledExecutorService; import java.util.concurrent.ScheduledThreadPoolExecutor; +import java.util.concurrent.TimeUnit; +import java.util.function.Function; +import java.util.logging.Handler; +import java.util.logging.Level; +import java.util.logging.LogRecord; +import java.util.stream.Collectors; import javax.annotation.Nullable; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.junit.runners.JUnit4; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; import org.mockito.ArgumentCaptor; import org.mockito.Mockito; -import org.threeten.bp.Duration; -@RunWith(JUnit4.class) -public class InstantiatingGrpcChannelProviderTest extends AbstractMtlsTransportChannelTest { +class InstantiatingGrpcChannelProviderTest extends AbstractMtlsTransportChannelTest { + private static final String DEFAULT_ENDPOINT = "test.googleapis.com:443"; + private static final String API_KEY_HEADER_VALUE = "fake_api_key_2"; + private static final String API_KEY_AUTH_HEADER_KEY = "x-goog-api-key"; + private static String originalOSName; + private ComputeEngineCredentials computeEngineCredentials; + private CertificateBasedAccess certificateBasedAccess; + + @BeforeAll + public static void setupClass() { + originalOSName = System.getProperty("os.name"); + } + + @BeforeEach + public void setup() throws IOException { + computeEngineCredentials = Mockito.mock(ComputeEngineCredentials.class); + certificateBasedAccess = + new CertificateBasedAccess( + name -> name.equals("GOOGLE_API_USE_MTLS_ENDPOINT") ? "never" : "false"); + } + + @AfterEach + public void cleanup() { + System.setProperty("os.name", originalOSName); + } @Test - public void testEndpoint() { + void testEndpoint() { String endpoint = "localhost:8080"; InstantiatingGrpcChannelProvider.Builder builder = InstantiatingGrpcChannelProvider.newBuilder(); @@ -79,43 +126,72 @@ public void testEndpoint() { assertEquals(provider.getEndpoint(), endpoint); } - @Test(expected = IllegalArgumentException.class) - public void testEndpointNoPort() { - InstantiatingGrpcChannelProvider.newBuilder().setEndpoint("localhost"); + @Test + void testEndpointNoPort() { + assertThrows( + IllegalArgumentException.class, + () -> InstantiatingGrpcChannelProvider.newBuilder().setEndpoint("localhost")); } - @Test(expected = IllegalArgumentException.class) - public void testEndpointBadPort() { - InstantiatingGrpcChannelProvider.newBuilder().setEndpoint("localhost:abcd"); + @Test + void testEndpointBadPort() { + assertThrows( + IllegalArgumentException.class, + () -> InstantiatingGrpcChannelProvider.newBuilder().setEndpoint("localhost:abcd")); } @Test - public void testKeepAlive() { - Duration keepaliveTime = Duration.ofSeconds(1); - Duration keepaliveTimeout = Duration.ofSeconds(2); - boolean keepaliveWithoutCalls = true; - - InstantiatingGrpcChannelProvider provider = - InstantiatingGrpcChannelProvider.newBuilder() - .setKeepAliveTime(keepaliveTime) - .setKeepAliveTimeout(keepaliveTimeout) - .setKeepAliveWithoutCalls(keepaliveWithoutCalls) - .build(); - - assertEquals(provider.getKeepAliveTime(), keepaliveTime); - assertEquals(provider.getKeepAliveTimeout(), keepaliveTimeout); - assertEquals(provider.getKeepAliveWithoutCalls(), keepaliveWithoutCalls); + void testKeepAlive() { + final long millis = 15; + InstantiatingGrpcChannelProvider.Builder builder = + InstantiatingGrpcChannelProvider.newBuilder(); + Function javaTimeProviderSupplier = + jt -> + builder + .setKeepAliveTimeDuration(jt) + .setKeepAliveTimeoutDuration(jt) + .setKeepAliveWithoutCalls(Boolean.TRUE) + .build(); + Function threetenProviderSupplier = + tt -> + builder + .setKeepAliveTime(tt) + .setKeepAliveTimeout(tt) + .setKeepAliveWithoutCalls(Boolean.TRUE) + .build(); + testDurationMethod( + millis, + javaTimeProviderSupplier, + threetenProviderSupplier, + c -> c.getKeepAliveTimeDuration(), + c -> c.getKeepAliveTime()); + testDurationMethod( + millis, + javaTimeProviderSupplier, + threetenProviderSupplier, + c -> c.getKeepAliveTimeoutDuration(), + c -> c.getKeepAliveTimeout()); + assertEquals( + Boolean.TRUE, + javaTimeProviderSupplier + .apply(java.time.Duration.ofMillis(millis)) + .getKeepAliveWithoutCalls()); + assertEquals( + Boolean.TRUE, + threetenProviderSupplier + .apply(org.threeten.bp.Duration.ofMillis(millis)) + .getKeepAliveWithoutCalls()); } @Test - public void testMaxInboundMetadataSize() { + void testMaxInboundMetadataSize() { InstantiatingGrpcChannelProvider provider = InstantiatingGrpcChannelProvider.newBuilder().setMaxInboundMetadataSize(4096).build(); assertThat(provider.getMaxInboundMetadataSize()).isEqualTo(4096); } @Test - public void testCpuPoolSize() { + void testCpuPoolSize() { // happy path Builder builder = InstantiatingGrpcChannelProvider.newBuilder().setProcessorCount(2); builder.setChannelsPerCpu(2.5); @@ -132,12 +208,13 @@ public void testCpuPoolSize() { } @Test - public void testWithPoolSize() throws IOException { + void testWithPoolSize() throws IOException { ScheduledExecutorService executor = new ScheduledThreadPoolExecutor(1); executor.shutdown(); TransportChannelProvider provider = InstantiatingGrpcChannelProvider.newBuilder() + .setCertificateBasedAccess(certificateBasedAccess) .build() .withExecutor((Executor) executor) .withHeaders(Collections.emptyMap()) @@ -152,14 +229,18 @@ public void testWithPoolSize() throws IOException { } @Test - public void testToBuilder() { - Duration keepaliveTime = Duration.ofSeconds(1); - Duration keepaliveTimeout = Duration.ofSeconds(2); + void testToBuilder() { + java.time.Duration keepaliveTime = java.time.Duration.ofSeconds(1); + java.time.Duration keepaliveTimeout = java.time.Duration.ofSeconds(2); ApiFunction channelConfigurator = builder -> { throw new UnsupportedOperationException(); }; - Map directPathServiceConfig = ImmutableMap.of("loadbalancingConfig", "grpclb"); + Map directPathServiceConfig = ImmutableMap.of("loadBalancingConfig", "pick_first"); + List hardBoundTokenTypes = + new ArrayList<>(); + hardBoundTokenTypes.add(InstantiatingGrpcChannelProvider.HardBoundTokenTypes.ALTS); + hardBoundTokenTypes.add(InstantiatingGrpcChannelProvider.HardBoundTokenTypes.MTLS_S2A); InstantiatingGrpcChannelProvider provider = InstantiatingGrpcChannelProvider.newBuilder() @@ -167,12 +248,13 @@ public void testToBuilder() { .setEndpoint("fake.endpoint:443") .setMaxInboundMessageSize(12345678) .setMaxInboundMetadataSize(4096) - .setKeepAliveTime(keepaliveTime) - .setKeepAliveTimeout(keepaliveTimeout) - .setKeepAliveWithoutCalls(true) + .setKeepAliveTimeDuration(keepaliveTime) + .setKeepAliveTimeoutDuration(keepaliveTimeout) + .setKeepAliveWithoutCalls(Boolean.TRUE) .setChannelConfigurator(channelConfigurator) .setChannelsPerCpu(2.5) .setDirectPathServiceConfig(directPathServiceConfig) + .setAllowHardBoundTokenTypes(hardBoundTokenTypes) .build(); InstantiatingGrpcChannelProvider.Builder builder = provider.toBuilder(); @@ -180,20 +262,20 @@ public void testToBuilder() { assertThat(builder.getEndpoint()).isEqualTo("fake.endpoint:443"); assertThat(builder.getMaxInboundMessageSize()).isEqualTo(12345678); assertThat(builder.getMaxInboundMetadataSize()).isEqualTo(4096); - assertThat(builder.getKeepAliveTime()).isEqualTo(keepaliveTime); - assertThat(builder.getKeepAliveTimeout()).isEqualTo(keepaliveTimeout); + assertThat(builder.getKeepAliveTimeDuration()).isEqualTo(keepaliveTime); + assertThat(builder.getKeepAliveTimeoutDuration()).isEqualTo(keepaliveTimeout); assertThat(builder.getChannelConfigurator()).isEqualTo(channelConfigurator); assertThat(builder.getPoolSize()).isEqualTo(5); assertThat(builder.build().directPathServiceConfig).isEqualTo(directPathServiceConfig); } @Test - public void testWithInterceptors() throws Exception { + void testWithInterceptors() throws Exception { testWithInterceptors(1); } @Test - public void testWithInterceptorsAndMultipleChannels() throws Exception { + void testWithInterceptorsAndMultipleChannels() throws Exception { testWithInterceptors(5); } @@ -202,6 +284,7 @@ private void testWithInterceptors(int numChannels) throws Exception { InstantiatingGrpcChannelProvider channelProvider = InstantiatingGrpcChannelProvider.newBuilder() + .setCertificateBasedAccess(certificateBasedAccess) .setEndpoint("localhost:8080") .setPoolSize(numChannels) .setHeaderProvider(Mockito.mock(HeaderProvider.class)) @@ -215,7 +298,7 @@ private void testWithInterceptors(int numChannels) throws Exception { } @Test - public void testChannelConfigurator() throws IOException { + void testChannelConfigurator() throws IOException { final int numChannels = 5; // Create a mock configurator that will insert mock channels @@ -235,6 +318,7 @@ public void testChannelConfigurator() throws IOException { // Invoke the provider InstantiatingGrpcChannelProvider.newBuilder() + .setCertificateBasedAccess(certificateBasedAccess) .setEndpoint("localhost:8080") .setHeaderProvider(Mockito.mock(HeaderProvider.class)) .setExecutor(Mockito.mock(Executor.class)) @@ -250,12 +334,13 @@ public void testChannelConfigurator() throws IOException { } @Test - public void testWithGCECredentials() throws IOException { + void testWithGCECredentials() throws IOException { ScheduledExecutorService executor = new ScheduledThreadPoolExecutor(1); executor.shutdown(); TransportChannelProvider provider = InstantiatingGrpcChannelProvider.newBuilder() + .setCertificateBasedAccess(certificateBasedAccess) .setAttemptDirectPath(true) .build() .withExecutor((Executor) executor) @@ -274,7 +359,57 @@ public void testWithGCECredentials() throws IOException { } @Test - public void testWithNonGCECredentials() throws IOException { + void testDirectPathXdsDisableByDefault() throws IOException { + InstantiatingGrpcChannelProvider provider = + InstantiatingGrpcChannelProvider.newBuilder().setAttemptDirectPath(true).build(); + + assertThat(provider.isDirectPathXdsEnabled()).isFalse(); + } + + @Test + void testDirectPathDisallowNullCredentials() throws IOException { + InstantiatingGrpcChannelProvider provider = + InstantiatingGrpcChannelProvider.newBuilder().build(); + + assertThat(provider.isCredentialDirectPathCompatible()).isFalse(); + } + + @Test + void testDirectPathWithGDUEndpoint() { + InstantiatingGrpcChannelProvider provider = + InstantiatingGrpcChannelProvider.newBuilder() + .setAttemptDirectPath(true) + .setAttemptDirectPathXds() + .setEndpoint(DEFAULT_ENDPOINT) + .build(); + assertThat(provider.canUseDirectPathWithUniverseDomain()).isTrue(); + } + + @Test + void testDirectPathWithNonGDUEndpoint() { + InstantiatingGrpcChannelProvider provider = + InstantiatingGrpcChannelProvider.newBuilder() + .setAttemptDirectPath(true) + .setAttemptDirectPathXds() + .setEndpoint("test.random.com:443") + .build(); + assertThat(provider.canUseDirectPathWithUniverseDomain()).isFalse(); + } + + @Test + void testDirectPathXdsEnabled() throws IOException { + InstantiatingGrpcChannelProvider provider = + InstantiatingGrpcChannelProvider.newBuilder() + .setAttemptDirectPath(true) + .setAttemptDirectPathXds() + .setEndpoint(DEFAULT_ENDPOINT) + .build(); + + assertThat(provider.isDirectPathXdsEnabled()).isTrue(); + } + + @Test + void testWithNonGCECredentials() throws IOException { ScheduledExecutorService executor = new ScheduledThreadPoolExecutor(1); executor.shutdown(); @@ -289,6 +424,7 @@ public void testWithNonGCECredentials() throws IOException { InstantiatingGrpcChannelProvider.newBuilder() .setAttemptDirectPath(true) .setChannelConfigurator(channelConfigurator) + .setCertificateBasedAccess(certificateBasedAccess) .build() .withExecutor((Executor) executor) .withHeaders(Collections.emptyMap()) @@ -302,7 +438,7 @@ public void testWithNonGCECredentials() throws IOException { } @Test - public void testWithDirectPathDisabled() throws IOException { + void testWithDirectPathDisabled() throws IOException { ScheduledExecutorService executor = new ScheduledThreadPoolExecutor(1); executor.shutdown(); @@ -317,6 +453,7 @@ public void testWithDirectPathDisabled() throws IOException { InstantiatingGrpcChannelProvider.newBuilder() .setAttemptDirectPath(false) .setChannelConfigurator(channelConfigurator) + .setCertificateBasedAccess(certificateBasedAccess) .build() .withExecutor((Executor) executor) .withHeaders(Collections.emptyMap()) @@ -330,7 +467,7 @@ public void testWithDirectPathDisabled() throws IOException { } @Test - public void testWithNoDirectPathFlagSet() throws IOException { + void testWithNoDirectPathFlagSet() throws IOException { ScheduledExecutorService executor = new ScheduledThreadPoolExecutor(1); executor.shutdown(); @@ -344,6 +481,7 @@ public void testWithNoDirectPathFlagSet() throws IOException { TransportChannelProvider provider = InstantiatingGrpcChannelProvider.newBuilder() .setChannelConfigurator(channelConfigurator) + .setCertificateBasedAccess(certificateBasedAccess) .build() .withExecutor((Executor) executor) .withHeaders(Collections.emptyMap()) @@ -357,12 +495,13 @@ public void testWithNoDirectPathFlagSet() throws IOException { } @Test - public void testWithIPv6Address() throws IOException { + void testWithIPv6Address() throws IOException { ScheduledExecutorService executor = new ScheduledThreadPoolExecutor(1); executor.shutdown(); TransportChannelProvider provider = InstantiatingGrpcChannelProvider.newBuilder() + .setCertificateBasedAccess(certificateBasedAccess) .build() .withExecutor((Executor) executor) .withHeaders(Collections.emptyMap()) @@ -375,7 +514,7 @@ public void testWithIPv6Address() throws IOException { // Test that if ChannelPrimer is provided, it is called during creation @Test - public void testWithPrimeChannel() throws IOException { + void testWithPrimeChannel() throws IOException { // create channelProvider with different pool sizes to verify ChannelPrimer is called the // correct number of times for (int poolSize = 1; poolSize < 5; poolSize++) { @@ -388,6 +527,7 @@ public void testWithPrimeChannel() throws IOException { .setHeaderProvider(Mockito.mock(HeaderProvider.class)) .setExecutor(Mockito.mock(Executor.class)) .setChannelPrimer(mockChannelPrimer) + .setCertificateBasedAccess(certificateBasedAccess) .build(); provider.getTransportChannel().shutdownNow(); @@ -399,20 +539,18 @@ public void testWithPrimeChannel() throws IOException { } @Test - public void testWithDefaultDirectPathServiceConfig() { + void testWithDefaultDirectPathServiceConfig() { InstantiatingGrpcChannelProvider provider = - InstantiatingGrpcChannelProvider.newBuilder().build(); + InstantiatingGrpcChannelProvider.newBuilder() + .setCertificateBasedAccess(certificateBasedAccess) + .build(); ImmutableMap defaultServiceConfig = provider.directPathServiceConfig; List> lbConfigs = getAsObjectList(defaultServiceConfig, "loadBalancingConfig"); assertThat(lbConfigs).hasSize(1); Map lbConfig = lbConfigs.get(0); - Map grpclb = getAsObject(lbConfig, "grpclb"); - List> childPolicies = getAsObjectList(grpclb, "childPolicy"); - assertThat(childPolicies).hasSize(1); - Map childPolicy = childPolicies.get(0); - assertThat(childPolicy.keySet()).containsExactly("pick_first"); + assertThat(lbConfig.keySet()).containsExactly("pick_first"); } @Nullable @@ -452,20 +590,21 @@ public void testWithDefaultDirectPathServiceConfig() { } @Test - public void testWithCustomDirectPathServiceConfig() { + void testWithCustomDirectPathServiceConfig() { ImmutableMap pickFirstStrategy = ImmutableMap.of("round_robin", ImmutableMap.of()); ImmutableMap childPolicy = ImmutableMap.of( "childPolicy", ImmutableList.of(pickFirstStrategy), "foo", "bar"); - ImmutableMap grpcLbPolicy = - ImmutableMap.of("grpclb", childPolicy); + ImmutableMap customLbPolicy = + ImmutableMap.of("my_custom_lb", childPolicy); Map passedServiceConfig = new HashMap<>(); - passedServiceConfig.put("loadBalancingConfig", ImmutableList.of(grpcLbPolicy)); + passedServiceConfig.put("loadBalancingConfig", ImmutableList.of(customLbPolicy)); InstantiatingGrpcChannelProvider provider = InstantiatingGrpcChannelProvider.newBuilder() .setDirectPathServiceConfig(passedServiceConfig) + .setCertificateBasedAccess(certificateBasedAccess) .build(); ImmutableMap defaultServiceConfig = provider.directPathServiceConfig; @@ -473,15 +612,726 @@ public void testWithCustomDirectPathServiceConfig() { } @Override - protected Object getMtlsObjectFromTransportChannel(MtlsProvider provider) + protected Object getMtlsObjectFromTransportChannel( + MtlsProvider provider, CertificateBasedAccess certificateBasedAccess) throws IOException, GeneralSecurityException { InstantiatingGrpcChannelProvider channelProvider = InstantiatingGrpcChannelProvider.newBuilder() .setEndpoint("localhost:8080") .setMtlsProvider(provider) + .setCertificateBasedAccess(certificateBasedAccess) .setHeaderProvider(Mockito.mock(HeaderProvider.class)) .setExecutor(Mockito.mock(Executor.class)) .build(); return channelProvider.createMtlsChannelCredentials(); } + + private InstantiatingGrpcChannelProvider.Builder + createChannelProviderBuilderForDirectPathLogTests() { + return InstantiatingGrpcChannelProvider.newBuilder() + .setHeaderProvider(Mockito.mock(HeaderProvider.class)) + .setExecutor(Mockito.mock(Executor.class)) + .setEndpoint("localhost:8080"); + } + + private void createAndCloseTransportChannel(InstantiatingGrpcChannelProvider provider) + throws Exception { + TransportChannel transportChannel = provider.getTransportChannel(); + transportChannel.close(); + transportChannel.awaitTermination(10, TimeUnit.SECONDS); + } + + @Test + void + testLogDirectPathMisconfig_AttemptDirectPathNotSetAndAttemptDirectPathXdsSetViaBuilder_warns() + throws Exception { + FakeLogHandler logHandler = new FakeLogHandler(); + InstantiatingGrpcChannelProvider.LOG.setLevel(Level.FINE); + InstantiatingGrpcChannelProvider.LOG.addHandler(logHandler); + InstantiatingGrpcChannelProvider provider = + createChannelProviderBuilderForDirectPathLogTests() + .setAttemptDirectPathXds() + .setCertificateBasedAccess(certificateBasedAccess) + .build(); + createAndCloseTransportChannel(provider); + assertThat(logHandler.getAllMessages()) + .contains( + "DirectPath is misconfigured. The DirectPath XDS option was set, but the attemptDirectPath option was not. Please set both the attemptDirectPath and attemptDirectPathXds options."); + InstantiatingGrpcChannelProvider.LOG.removeHandler(logHandler); + } + + @Test + void testLogDirectPathMisconfig_AttemptDirectPathNotSetAndAttemptDirectPathXdsSetViaEnv_warns() + throws Exception { + FakeLogHandler logHandler = new FakeLogHandler(); + InstantiatingGrpcChannelProvider.LOG.setLevel(Level.FINE); + InstantiatingGrpcChannelProvider.LOG.addHandler(logHandler); + + InstantiatingGrpcChannelProvider provider = + createChannelProviderBuilderForDirectPathLogTests() + .setCertificateBasedAccess(certificateBasedAccess) + .build(); + createAndCloseTransportChannel(provider); + assertThat(logHandler.getAllMessages()) + .contains( + "Env var GOOGLE_CLOUD_ENABLE_DIRECT_PATH_XDS was found and set to TRUE, but DirectPath was not enabled for this client. If this is intended for " + + "this client, please note that this is a misconfiguration and set the attemptDirectPath option as well."); + InstantiatingGrpcChannelProvider.LOG.removeHandler(logHandler); + } + + @Test + void testLogDirectPathMisconfig_shouldNotLogInTheBuilder() { + FakeLogHandler logHandler = new FakeLogHandler(); + InstantiatingGrpcChannelProvider.LOG.setLevel(Level.FINE); + InstantiatingGrpcChannelProvider.LOG.addHandler(logHandler); + InstantiatingGrpcChannelProvider.newBuilder() + .setAttemptDirectPathXds() + .setAttemptDirectPath(true) + .setCertificateBasedAccess(certificateBasedAccess) + .build(); + + assertThat(logHandler.getAllMessages()).isEmpty(); + InstantiatingGrpcChannelProvider.LOG.removeHandler(logHandler); + } + + @Test + void testLogDirectPathMisconfigWrongCredential() throws Exception { + FakeLogHandler logHandler = new FakeLogHandler(); + InstantiatingGrpcChannelProvider.LOG.setLevel(Level.FINE); + InstantiatingGrpcChannelProvider.LOG.addHandler(logHandler); + InstantiatingGrpcChannelProvider provider = + InstantiatingGrpcChannelProvider.newBuilder() + .setAttemptDirectPathXds() + .setAttemptDirectPath(true) + .setHeaderProvider(Mockito.mock(HeaderProvider.class)) + .setExecutor(Mockito.mock(Executor.class)) + .setEndpoint(DEFAULT_ENDPOINT) + .setCertificateBasedAccess(certificateBasedAccess) + .build(); + + TransportChannel transportChannel = provider.getTransportChannel(); + + assertThat(logHandler.getAllMessages()) + .contains( + "DirectPath is misconfigured. Please make sure the credential is an instance of" + + " com.google.auth.oauth2.ComputeEngineCredentials ."); + InstantiatingGrpcChannelProvider.LOG.removeHandler(logHandler); + + transportChannel.close(); + transportChannel.awaitTermination(10, TimeUnit.SECONDS); + } + + @Test + void testLogDirectPathMisconfigNotOnGCE() throws Exception { + FakeLogHandler logHandler = new FakeLogHandler(); + InstantiatingGrpcChannelProvider.LOG.setLevel(Level.FINE); + InstantiatingGrpcChannelProvider.LOG.addHandler(logHandler); + InstantiatingGrpcChannelProvider provider = + InstantiatingGrpcChannelProvider.newBuilder() + .setAttemptDirectPathXds() + .setAttemptDirectPath(true) + .setAllowNonDefaultServiceAccount(true) + .setHeaderProvider(Mockito.mock(HeaderProvider.class)) + .setExecutor(Mockito.mock(Executor.class)) + .setEndpoint(DEFAULT_ENDPOINT) + .setCertificateBasedAccess(certificateBasedAccess) + .build(); + + TransportChannel transportChannel = provider.getTransportChannel(); + + if (!InstantiatingGrpcChannelProvider.isOnComputeEngine()) { + assertThat(logHandler.getAllMessages()) + .contains( + "DirectPath is misconfigured. DirectPath is only available in a GCE environment."); + } + InstantiatingGrpcChannelProvider.LOG.removeHandler(logHandler); + + transportChannel.close(); + transportChannel.awaitTermination(10, TimeUnit.SECONDS); + } + + @Test + public void canUseDirectPath_happyPath() throws IOException { + System.setProperty("os.name", "Linux"); + EnvironmentProvider envProvider = Mockito.mock(EnvironmentProvider.class); + Mockito.when( + envProvider.getenv( + InstantiatingGrpcChannelProvider.DIRECT_PATH_ENV_DISABLE_DIRECT_PATH)) + .thenReturn("false"); + InstantiatingGrpcChannelProvider.Builder builder = + InstantiatingGrpcChannelProvider.newBuilder() + .setCertificateBasedAccess(certificateBasedAccess) + .setAttemptDirectPath(true) + .setCredentials(computeEngineCredentials) + .setEndpoint(DEFAULT_ENDPOINT) + .setEnvProvider(envProvider) + .setHeaderProvider(Mockito.mock(HeaderProvider.class)); + Truth.assertThat(builder.isDirectPathBoundTokenEnabled()).isFalse(); + InstantiatingGrpcChannelProvider provider = + new InstantiatingGrpcChannelProvider(builder, GCE_PRODUCTION_NAME_AFTER_2016); + Truth.assertThat(provider.canUseDirectPath()).isTrue(); + + // verify this info is passed correctly to transport channel + TransportChannel transportChannel = provider.getTransportChannel(); + Truth.assertThat(((GrpcTransportChannel) transportChannel).isDirectPath()).isTrue(); + transportChannel.shutdownNow(); + } + + @Test + public void canUseDirectPath_boundTokenNotEnabledWithNonComputeCredentials() { + System.setProperty("os.name", "Linux"); + Credentials credentials = Mockito.mock(Credentials.class); + EnvironmentProvider envProvider = Mockito.mock(EnvironmentProvider.class); + Mockito.when( + envProvider.getenv( + InstantiatingGrpcChannelProvider.DIRECT_PATH_ENV_DISABLE_DIRECT_PATH)) + .thenReturn("false"); + InstantiatingGrpcChannelProvider.Builder builder = + InstantiatingGrpcChannelProvider.newBuilder() + .setCertificateBasedAccess(certificateBasedAccess) + .setAttemptDirectPath(true) + .setAllowHardBoundTokenTypes(Collections.singletonList(HardBoundTokenTypes.ALTS)) + .setCredentials(credentials) + .setEndpoint(DEFAULT_ENDPOINT) + .setEnvProvider(envProvider); + Truth.assertThat(builder.isDirectPathBoundTokenEnabled()).isFalse(); + InstantiatingGrpcChannelProvider provider = + new InstantiatingGrpcChannelProvider(builder, GCE_PRODUCTION_NAME_AFTER_2016); + Truth.assertThat(provider.canUseDirectPath()).isFalse(); + } + + @Test + public void canUseDirectPath_happyPathWithBoundToken() throws IOException { + System.setProperty("os.name", "Linux"); + EnvironmentProvider envProvider = Mockito.mock(EnvironmentProvider.class); + Mockito.when( + envProvider.getenv( + InstantiatingGrpcChannelProvider.DIRECT_PATH_ENV_DISABLE_DIRECT_PATH)) + .thenReturn("false"); + // verify the credentials gets called and returns a non-null builder. + Mockito.when(computeEngineCredentials.toBuilder()) + .thenReturn(ComputeEngineCredentials.newBuilder()); + InstantiatingGrpcChannelProvider.Builder builder = + InstantiatingGrpcChannelProvider.newBuilder() + .setCertificateBasedAccess(certificateBasedAccess) + .setAttemptDirectPath(true) + .setCredentials(computeEngineCredentials) + .setAllowHardBoundTokenTypes(Collections.singletonList(HardBoundTokenTypes.ALTS)) + .setEndpoint(DEFAULT_ENDPOINT) + .setEnvProvider(envProvider) + .setHeaderProvider(Mockito.mock(HeaderProvider.class)); + Truth.assertThat(builder.isDirectPathBoundTokenEnabled()).isTrue(); + InstantiatingGrpcChannelProvider provider = + new InstantiatingGrpcChannelProvider(builder, GCE_PRODUCTION_NAME_AFTER_2016); + Truth.assertThat(provider.canUseDirectPath()).isTrue(); + + // verify this info is passed correctly to transport channel + TransportChannel transportChannel = provider.getTransportChannel(); + Truth.assertThat(((GrpcTransportChannel) transportChannel).isDirectPath()).isTrue(); + transportChannel.shutdownNow(); + } + + @Test + public void canUseDirectPath_directPathEnvVarDisabled() throws IOException { + System.setProperty("os.name", "Linux"); + EnvironmentProvider envProvider = Mockito.mock(EnvironmentProvider.class); + Mockito.when( + envProvider.getenv( + InstantiatingGrpcChannelProvider.DIRECT_PATH_ENV_DISABLE_DIRECT_PATH)) + .thenReturn("true"); + InstantiatingGrpcChannelProvider.Builder builder = + InstantiatingGrpcChannelProvider.newBuilder() + .setCertificateBasedAccess(certificateBasedAccess) + .setAttemptDirectPath(true) + .setCredentials(computeEngineCredentials) + .setEndpoint(DEFAULT_ENDPOINT) + .setEnvProvider(envProvider) + .setHeaderProvider(Mockito.mock(HeaderProvider.class)); + InstantiatingGrpcChannelProvider provider = + new InstantiatingGrpcChannelProvider(builder, GCE_PRODUCTION_NAME_AFTER_2016); + Truth.assertThat(provider.canUseDirectPath()).isFalse(); + + // verify this info is passed correctly to transport channel + TransportChannel transportChannel = provider.getTransportChannel(); + Truth.assertThat(((GrpcTransportChannel) transportChannel).isDirectPath()).isFalse(); + transportChannel.shutdownNow(); + } + + @Test + public void canUseDirectPath_directPathEnvVarNotSet_attemptDirectPathIsTrue() { + System.setProperty("os.name", "Linux"); + InstantiatingGrpcChannelProvider.Builder builder = + InstantiatingGrpcChannelProvider.newBuilder() + .setCertificateBasedAccess(certificateBasedAccess) + .setAttemptDirectPath(true) + .setCredentials(computeEngineCredentials) + .setEndpoint(DEFAULT_ENDPOINT); + InstantiatingGrpcChannelProvider provider = + new InstantiatingGrpcChannelProvider(builder, GCE_PRODUCTION_NAME_AFTER_2016); + Truth.assertThat(provider.canUseDirectPath()).isTrue(); + } + + @Test + public void canUseDirectPath_directPathEnvVarNotSet_attemptDirectPathIsFalse() { + System.setProperty("os.name", "Linux"); + InstantiatingGrpcChannelProvider.Builder builder = + InstantiatingGrpcChannelProvider.newBuilder() + .setCertificateBasedAccess(certificateBasedAccess) + .setAttemptDirectPath(false) + .setCredentials(computeEngineCredentials) + .setEndpoint(DEFAULT_ENDPOINT); + InstantiatingGrpcChannelProvider provider = + new InstantiatingGrpcChannelProvider(builder, GCE_PRODUCTION_NAME_AFTER_2016); + Truth.assertThat(provider.canUseDirectPath()).isFalse(); + } + + @Test + public void canUseDirectPath_nonComputeCredentials() { + System.setProperty("os.name", "Linux"); + Credentials credentials = Mockito.mock(Credentials.class); + EnvironmentProvider envProvider = Mockito.mock(EnvironmentProvider.class); + Mockito.when( + envProvider.getenv( + InstantiatingGrpcChannelProvider.DIRECT_PATH_ENV_DISABLE_DIRECT_PATH)) + .thenReturn("false"); + InstantiatingGrpcChannelProvider.Builder builder = + InstantiatingGrpcChannelProvider.newBuilder() + .setCertificateBasedAccess(certificateBasedAccess) + .setAttemptDirectPath(true) + .setCredentials(credentials) + .setEndpoint(DEFAULT_ENDPOINT) + .setEnvProvider(envProvider); + InstantiatingGrpcChannelProvider provider = + new InstantiatingGrpcChannelProvider(builder, GCE_PRODUCTION_NAME_AFTER_2016); + Truth.assertThat(provider.canUseDirectPath()).isFalse(); + } + + @Test + public void canUseDirectPath_isNotOnComputeEngine_invalidOsNameSystemProperty() { + System.setProperty("os.name", "Not Linux"); + EnvironmentProvider envProvider = Mockito.mock(EnvironmentProvider.class); + Mockito.when( + envProvider.getenv( + InstantiatingGrpcChannelProvider.DIRECT_PATH_ENV_DISABLE_DIRECT_PATH)) + .thenReturn("false"); + InstantiatingGrpcChannelProvider.Builder builder = + InstantiatingGrpcChannelProvider.newBuilder() + .setCertificateBasedAccess(certificateBasedAccess) + .setAttemptDirectPath(true) + .setCredentials(computeEngineCredentials) + .setEndpoint(DEFAULT_ENDPOINT) + .setEnvProvider(envProvider); + InstantiatingGrpcChannelProvider provider = + new InstantiatingGrpcChannelProvider(builder, GCE_PRODUCTION_NAME_AFTER_2016); + Truth.assertThat(provider.canUseDirectPath()).isFalse(); + } + + @Test + public void canUseDirectPath_isNotOnComputeEngine_invalidSystemProductName() { + System.setProperty("os.name", "Linux"); + EnvironmentProvider envProvider = Mockito.mock(EnvironmentProvider.class); + Mockito.when( + envProvider.getenv( + InstantiatingGrpcChannelProvider.DIRECT_PATH_ENV_DISABLE_DIRECT_PATH)) + .thenReturn("false"); + InstantiatingGrpcChannelProvider.Builder builder = + InstantiatingGrpcChannelProvider.newBuilder() + .setCertificateBasedAccess(certificateBasedAccess) + .setAttemptDirectPath(true) + .setCredentials(computeEngineCredentials) + .setEndpoint(DEFAULT_ENDPOINT) + .setEnvProvider(envProvider); + InstantiatingGrpcChannelProvider provider = + new InstantiatingGrpcChannelProvider(builder, "testing"); + Truth.assertThat(provider.canUseDirectPath()).isFalse(); + } + + @Test + public void canUseDirectPath_isNotOnComputeEngine_unableToGetSystemProductName() { + System.setProperty("os.name", "Linux"); + EnvironmentProvider envProvider = Mockito.mock(EnvironmentProvider.class); + Mockito.when( + envProvider.getenv( + InstantiatingGrpcChannelProvider.DIRECT_PATH_ENV_DISABLE_DIRECT_PATH)) + .thenReturn("false"); + InstantiatingGrpcChannelProvider.Builder builder = + InstantiatingGrpcChannelProvider.newBuilder() + .setAttemptDirectPath(true) + .setCredentials(computeEngineCredentials) + .setEndpoint(DEFAULT_ENDPOINT) + .setCertificateBasedAccess(certificateBasedAccess) + .setEnvProvider(envProvider); + InstantiatingGrpcChannelProvider provider = new InstantiatingGrpcChannelProvider(builder, ""); + Truth.assertThat(provider.canUseDirectPath()).isFalse(); + } + + @Test + public void canUseDirectPath_nonGDUUniverseDomain() { + System.setProperty("os.name", "Linux"); + EnvironmentProvider envProvider = Mockito.mock(EnvironmentProvider.class); + Mockito.when( + envProvider.getenv( + InstantiatingGrpcChannelProvider.DIRECT_PATH_ENV_DISABLE_DIRECT_PATH)) + .thenReturn("false"); + String nonGDUEndpoint = "test.random.com:443"; + InstantiatingGrpcChannelProvider.Builder builder = + InstantiatingGrpcChannelProvider.newBuilder() + .setCertificateBasedAccess(certificateBasedAccess) + .setAttemptDirectPath(true) + .setCredentials(computeEngineCredentials) + .setEndpoint(nonGDUEndpoint) + .setEnvProvider(envProvider); + InstantiatingGrpcChannelProvider provider = + new InstantiatingGrpcChannelProvider(builder, GCE_PRODUCTION_NAME_AFTER_2016); + Truth.assertThat(provider.canUseDirectPath()).isFalse(); + } + + @Test + void providerInitializedWithNonConflictingHeaders_retainsHeaders() { + InstantiatingGrpcChannelProvider.Builder builder = + InstantiatingGrpcChannelProvider.newBuilder() + .setHeaderProvider(getHeaderProviderWithApiKeyHeader()) + .setEndpoint("test.random.com:443"); + + InstantiatingGrpcChannelProvider provider = builder.build(); + + assertEquals(1, provider.headersWithDuplicatesRemoved.size()); + assertEquals( + API_KEY_HEADER_VALUE, provider.headersWithDuplicatesRemoved.get(API_KEY_AUTH_HEADER_KEY)); + } + + @Test + void providersInitializedWithConflictingApiKeyCredentialHeaders_removesDuplicates() { + String correctApiKey = "fake_api_key"; + ApiKeyCredentials apiKeyCredentials = ApiKeyCredentials.create(correctApiKey); + InstantiatingGrpcChannelProvider.Builder builder = + InstantiatingGrpcChannelProvider.newBuilder() + .setCertificateBasedAccess(certificateBasedAccess) + .setCredentials(apiKeyCredentials) + .setHeaderProvider(getHeaderProviderWithApiKeyHeader()) + .setEndpoint("test.random.com:443"); + + InstantiatingGrpcChannelProvider provider = builder.build(); + + assertEquals(0, provider.headersWithDuplicatesRemoved.size()); + assertNull(provider.headersWithDuplicatesRemoved.get(API_KEY_AUTH_HEADER_KEY)); + } + + @Test + void providersInitializedWithConflictingNonApiKeyCredentialHeaders_doesNotRemoveDuplicates() { + String authProvidedHeader = "Bearer token"; + Map header = new HashMap<>(); + header.put(AuthHttpConstants.AUTHORIZATION, authProvidedHeader); + InstantiatingGrpcChannelProvider.Builder builder = + InstantiatingGrpcChannelProvider.newBuilder() + .setCertificateBasedAccess(certificateBasedAccess) + .setCredentials(computeEngineCredentials) + .setHeaderProvider(FixedHeaderProvider.create(header)) + .setEndpoint("test.random.com:443"); + + InstantiatingGrpcChannelProvider provider = builder.build(); + + assertEquals(1, provider.headersWithDuplicatesRemoved.size()); + assertEquals( + authProvidedHeader, + provider.headersWithDuplicatesRemoved.get(AuthHttpConstants.AUTHORIZATION)); + } + + @Test + void buildProvider_handlesNullHeaderProvider() { + InstantiatingGrpcChannelProvider.Builder builder = + InstantiatingGrpcChannelProvider.newBuilder().setEndpoint("test.random.com:443"); + + InstantiatingGrpcChannelProvider provider = builder.build(); + + assertEquals(0, provider.headersWithDuplicatesRemoved.size()); + } + + @Test + void buildProvider_handlesNullCredentialsMetadataRequest() throws IOException { + Credentials credentials = Mockito.mock(Credentials.class); + Mockito.when(credentials.getRequestMetadata()).thenReturn(null); + InstantiatingGrpcChannelProvider.Builder builder = + InstantiatingGrpcChannelProvider.newBuilder() + .setCertificateBasedAccess(certificateBasedAccess) + .setHeaderProvider(getHeaderProviderWithApiKeyHeader()) + .setEndpoint("test.random.com:443"); + + InstantiatingGrpcChannelProvider provider = builder.build(); + + assertEquals(1, provider.headersWithDuplicatesRemoved.size()); + assertEquals( + API_KEY_HEADER_VALUE, provider.headersWithDuplicatesRemoved.get(API_KEY_AUTH_HEADER_KEY)); + } + + @Test + void buildProvider_handlesErrorRetrievingCredentialsMetadataRequest() throws IOException { + Credentials credentials = Mockito.mock(Credentials.class); + Mockito.when(credentials.getRequestMetadata()) + .thenThrow(new IOException("Error getting request metadata")); + InstantiatingGrpcChannelProvider.Builder builder = + InstantiatingGrpcChannelProvider.newBuilder() + .setCertificateBasedAccess(certificateBasedAccess) + .setHeaderProvider(getHeaderProviderWithApiKeyHeader()) + .setEndpoint("test.random.com:443"); + InstantiatingGrpcChannelProvider provider = builder.build(); + + assertEquals(1, provider.headersWithDuplicatesRemoved.size()); + assertEquals( + API_KEY_HEADER_VALUE, provider.headersWithDuplicatesRemoved.get(API_KEY_AUTH_HEADER_KEY)); + } + + private FixedHeaderProvider getHeaderProviderWithApiKeyHeader() { + Map header = new HashMap<>(); + header.put(API_KEY_AUTH_HEADER_KEY, API_KEY_HEADER_VALUE); + return FixedHeaderProvider.create(header); + } + + @Test + void createPlaintextToS2AChannelCredentials_emptyPlaintextAddress_returnsNull() { + InstantiatingGrpcChannelProvider provider = + InstantiatingGrpcChannelProvider.newBuilder().build(); + assertThat(provider.createPlaintextToS2AChannelCredentials("")).isNull(); + } + + @Test + void createPlaintextToS2AChannelCredentials_success() { + InstantiatingGrpcChannelProvider provider = + InstantiatingGrpcChannelProvider.newBuilder().build(); + assertThat(provider.createPlaintextToS2AChannelCredentials("localhost:8080")).isNotNull(); + } + + @Test + void createMtlsToS2AChannelCredentials_missingAllFiles_throws() throws IOException { + InstantiatingGrpcChannelProvider provider = + InstantiatingGrpcChannelProvider.newBuilder().build(); + assertThat(provider.createMtlsToS2AChannelCredentials(null, null, null)).isNull(); + } + + @Test + void createMtlsToS2AChannelCredentials_missingRootFile_throws() throws IOException { + InstantiatingGrpcChannelProvider provider = + InstantiatingGrpcChannelProvider.newBuilder().build(); + File privateKey = new File("src/test/resources/client_key.pem"); + File certChain = new File("src/test/resources/client_cert.pem"); + assertThat(provider.createMtlsToS2AChannelCredentials(null, privateKey, certChain)).isNull(); + } + + @Test + void createMtlsToS2AChannelCredentials_missingKeyFile_throws() throws IOException { + InstantiatingGrpcChannelProvider provider = + InstantiatingGrpcChannelProvider.newBuilder().build(); + File trustBundle = new File("src/test/resources/root_cert.pem"); + File certChain = new File("src/test/resources/client_cert.pem"); + assertThat(provider.createMtlsToS2AChannelCredentials(trustBundle, null, certChain)).isNull(); + } + + @Test + void createMtlsToS2AChannelCredentials_missingCertChainFile_throws() throws IOException { + InstantiatingGrpcChannelProvider provider = + InstantiatingGrpcChannelProvider.newBuilder().build(); + File trustBundle = new File("src/test/resources/root_cert.pem"); + File privateKey = new File("src/test/resources/client_key.pem"); + assertThat(provider.createMtlsToS2AChannelCredentials(trustBundle, privateKey, null)).isNull(); + } + + @Test + void createMtlsToS2AChannelCredentials_success() throws IOException { + InstantiatingGrpcChannelProvider provider = + InstantiatingGrpcChannelProvider.newBuilder().build(); + File trustBundle = new File("src/test/resources/root_cert.pem"); + File privateKey = new File("src/test/resources/client_key.pem"); + File certChain = new File("src/test/resources/client_cert.pem"); + assertEquals( + provider.createMtlsToS2AChannelCredentials(trustBundle, privateKey, certChain).getClass(), + TlsChannelCredentials.class); + } + + @Test + void createS2ASecuredChannelCredentials_bothS2AAddressesNull_returnsNull() { + InstantiatingGrpcChannelProvider.resetS2AChannelCredentials(); + SecureSessionAgent s2aConfigProvider = Mockito.mock(SecureSessionAgent.class); + SecureSessionAgentConfig config = SecureSessionAgentConfig.createBuilder().build(); + Mockito.when(s2aConfigProvider.getConfig()).thenReturn(config); + InstantiatingGrpcChannelProvider provider = + InstantiatingGrpcChannelProvider.newBuilder() + .setS2AConfigProvider(s2aConfigProvider) + .build(); + assertThat(provider.createS2ASecuredChannelCredentials()).isNull(); + } + + @Test + void + createS2ASecuredChannelCredentials_mtlsS2AAddressNull_returnsPlaintextToS2AS2AChannelCredentials() { + InstantiatingGrpcChannelProvider.resetS2AChannelCredentials(); + SecureSessionAgent s2aConfigProvider = Mockito.mock(SecureSessionAgent.class); + SecureSessionAgentConfig config = + SecureSessionAgentConfig.createBuilder().setPlaintextAddress("localhost:8080").build(); + Mockito.when(s2aConfigProvider.getConfig()).thenReturn(config); + FakeLogHandler logHandler = new FakeLogHandler(); + InstantiatingGrpcChannelProvider.LOG.addHandler(logHandler); + InstantiatingGrpcChannelProvider provider = + InstantiatingGrpcChannelProvider.newBuilder() + .setS2AConfigProvider(s2aConfigProvider) + .build(); + assertThat(provider.createS2ASecuredChannelCredentials()).isNotNull(); + assertThat(logHandler.getAllMessages()) + .contains( + "Cannot establish an mTLS connection to S2A because autoconfig endpoint did not return a mtls address to reach S2A."); + InstantiatingGrpcChannelProvider.LOG.removeHandler(logHandler); + } + + @Test + void + createTwoS2ASecuredChannelCredentials_mtlsS2AAddressNull_returnsSamePlaintextToS2AS2AChannelCredentials() { + InstantiatingGrpcChannelProvider.resetS2AChannelCredentials(); + SecureSessionAgent s2aConfigProvider = Mockito.mock(SecureSessionAgent.class); + SecureSessionAgentConfig config = + SecureSessionAgentConfig.createBuilder().setPlaintextAddress("localhost:8080").build(); + Mockito.when(s2aConfigProvider.getConfig()).thenReturn(config); + InstantiatingGrpcChannelProvider provider = + InstantiatingGrpcChannelProvider.newBuilder() + .setS2AConfigProvider(s2aConfigProvider) + .build(); + assertThat(provider.createS2ASecuredChannelCredentials()).isNotNull(); + InstantiatingGrpcChannelProvider provider2 = + InstantiatingGrpcChannelProvider.newBuilder() + .setS2AConfigProvider(s2aConfigProvider) + .build(); + assertThat(provider2.createS2ASecuredChannelCredentials()).isNotNull(); + assertEquals(provider.getS2AChannelCredentials(), provider2.getS2AChannelCredentials()); + } + + @Test + void createS2ASecuredChannelCredentials_returnsPlaintextToS2AS2AChannelCredentials() { + InstantiatingGrpcChannelProvider.resetS2AChannelCredentials(); + SecureSessionAgent s2aConfigProvider = Mockito.mock(SecureSessionAgent.class); + SecureSessionAgentConfig config = + SecureSessionAgentConfig.createBuilder() + .setMtlsAddress("localhost:8080") + .setPlaintextAddress("localhost:8080") + .build(); + Mockito.when(s2aConfigProvider.getConfig()).thenReturn(config); + FakeLogHandler logHandler = new FakeLogHandler(); + InstantiatingGrpcChannelProvider.LOG.addHandler(logHandler); + InstantiatingGrpcChannelProvider provider = + InstantiatingGrpcChannelProvider.newBuilder() + .setS2AConfigProvider(s2aConfigProvider) + .build(); + assertThat(provider.createS2ASecuredChannelCredentials()).isNotNull(); + assertThat(logHandler.getAllMessages()) + .contains( + "Cannot establish an mTLS connection to S2A because MTLS to MDS credentials do not exist on filesystem, falling back to plaintext connection to S2A"); + InstantiatingGrpcChannelProvider.LOG.removeHandler(logHandler); + } + + @Test + void isMtlsS2AHardBoundTokensEnabled_useS2AFalse() { + InstantiatingGrpcChannelProvider.Builder providerBuilder = + InstantiatingGrpcChannelProvider.newBuilder() + .setUseS2A(false) + .setAllowHardBoundTokenTypes( + Collections.singletonList( + InstantiatingGrpcChannelProvider.HardBoundTokenTypes.MTLS_S2A)) + .setCredentials(computeEngineCredentials); + Truth.assertThat(providerBuilder.isMtlsS2AHardBoundTokensEnabled()).isFalse(); + } + + @Test + void isMtlsS2AHardBoundTokensEnabled_hardBoundTokenTypesEmpty() { + InstantiatingGrpcChannelProvider.Builder providerBuilder = + InstantiatingGrpcChannelProvider.newBuilder() + .setUseS2A(true) + .setAllowHardBoundTokenTypes(new ArrayList<>()) + .setCredentials(computeEngineCredentials); + Truth.assertThat(providerBuilder.isMtlsS2AHardBoundTokensEnabled()).isFalse(); + } + + @Test + void isMtlsS2AHardBoundTokensEnabled_nullCreds() { + InstantiatingGrpcChannelProvider.Builder providerBuilder = + InstantiatingGrpcChannelProvider.newBuilder() + .setUseS2A(true) + .setAllowHardBoundTokenTypes( + Collections.singletonList( + InstantiatingGrpcChannelProvider.HardBoundTokenTypes.MTLS_S2A)) + .setCredentials(null); + Truth.assertThat(providerBuilder.isMtlsS2AHardBoundTokensEnabled()).isFalse(); + } + + @Test + void isMtlsS2AHardBoundTokensEnabled_notComputeEngineCreds() { + InstantiatingGrpcChannelProvider.Builder providerBuilder = + InstantiatingGrpcChannelProvider.newBuilder() + .setUseS2A(true) + .setAllowHardBoundTokenTypes( + Collections.singletonList( + InstantiatingGrpcChannelProvider.HardBoundTokenTypes.MTLS_S2A)) + .setCredentials(CloudShellCredentials.create(3000)); + Truth.assertThat(providerBuilder.isMtlsS2AHardBoundTokensEnabled()).isFalse(); + } + + @Test + void isMtlsS2AHardBoundTokensEnabled_mtlsS2ANotInList() { + InstantiatingGrpcChannelProvider.Builder providerBuilder = + InstantiatingGrpcChannelProvider.newBuilder() + .setUseS2A(true) + .setAllowHardBoundTokenTypes( + Collections.singletonList( + InstantiatingGrpcChannelProvider.HardBoundTokenTypes.ALTS)) + .setCredentials(computeEngineCredentials); + Truth.assertThat(providerBuilder.isMtlsS2AHardBoundTokensEnabled()).isFalse(); + } + + @Test + void isMtlsS2AHardBoundTokensEnabled_mtlsS2ATokenAllowedInList() { + List allowHardBoundTokenTypes = + new ArrayList<>(); + allowHardBoundTokenTypes.add(InstantiatingGrpcChannelProvider.HardBoundTokenTypes.MTLS_S2A); + allowHardBoundTokenTypes.add(InstantiatingGrpcChannelProvider.HardBoundTokenTypes.ALTS); + + InstantiatingGrpcChannelProvider.Builder providerBuilder = + InstantiatingGrpcChannelProvider.newBuilder() + .setUseS2A(true) + .setAllowHardBoundTokenTypes(allowHardBoundTokenTypes) + .setCredentials(computeEngineCredentials); + Truth.assertThat(providerBuilder.isMtlsS2AHardBoundTokensEnabled()).isTrue(); + } + + @Test + void testDefaultBuilderNeedsBackgroundExecutor() { + InstantiatingGrpcChannelProvider provider = + InstantiatingGrpcChannelProvider.newBuilder().build(); + + assertThat(provider.needsBackgroundExecutor()).isTrue(); + } + + @Test + void testSettingBackgroundExecutor() { + ScheduledExecutorService mockExecutor = Mockito.mock(ScheduledExecutorService.class); + InstantiatingGrpcChannelProvider provider = + InstantiatingGrpcChannelProvider.newBuilder().setBackgroundExecutor(mockExecutor).build(); + + assertThat(provider.getBackgroundExecutor()).isEqualTo(mockExecutor); + } + + private static class FakeLogHandler extends Handler { + + List records = new ArrayList<>(); + + @Override + public void publish(LogRecord record) { + records.add(record); + } + + @Override + public void flush() {} + + @Override + public void close() throws SecurityException {} + + List getAllMessages() { + return records.stream().map(LogRecord::getMessage).collect(Collectors.toList()); + } + } } diff --git a/gax-java/gax-grpc/src/test/java/com/google/api/gax/grpc/ProtoOperationTransformersTest.java b/gax-java/gax-grpc/src/test/java/com/google/api/gax/grpc/ProtoOperationTransformersTest.java index 5ac43f1417..19122ff653 100644 --- a/gax-java/gax-grpc/src/test/java/com/google/api/gax/grpc/ProtoOperationTransformersTest.java +++ b/gax-java/gax-grpc/src/test/java/com/google/api/gax/grpc/ProtoOperationTransformersTest.java @@ -29,7 +29,7 @@ */ package com.google.api.gax.grpc; -import static org.junit.Assert.assertThrows; +import static org.junit.jupiter.api.Assertions.assertThrows; import com.google.api.gax.grpc.ProtoOperationTransformers.MetadataTransformer; import com.google.api.gax.grpc.ProtoOperationTransformers.ResponseTransformer; @@ -43,14 +43,11 @@ import com.google.type.Color; import com.google.type.Money; import io.grpc.Status.Code; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.junit.runners.JUnit4; +import org.junit.jupiter.api.Test; -@RunWith(JUnit4.class) -public class ProtoOperationTransformersTest { +class ProtoOperationTransformersTest { @Test - public void testAnyResponseTransformer() { + void testAnyResponseTransformer() { ResponseTransformer transformer = ResponseTransformer.create(Money.class); Money inputMoney = Money.newBuilder().setCurrencyCode("USD").build(); OperationSnapshot operationSnapshot = @@ -60,7 +57,7 @@ public void testAnyResponseTransformer() { } @Test - public void testAnyResponseTransformer_exception() { + void testAnyResponseTransformer_exception() { ResponseTransformer transformer = ResponseTransformer.create(Money.class); Money inputMoney = Money.newBuilder().setCurrencyCode("USD").build(); Status status = Status.newBuilder().setCode(Code.UNAVAILABLE.value()).build(); @@ -75,7 +72,7 @@ public void testAnyResponseTransformer_exception() { } @Test - public void testAnyResponseTransformer_mismatchedTypes() { + void testAnyResponseTransformer_mismatchedTypes() { ResponseTransformer transformer = ResponseTransformer.create(Money.class); Status status = Status.newBuilder().setCode(Code.OK.value()).build(); OperationSnapshot operationSnapshot = @@ -90,7 +87,7 @@ public void testAnyResponseTransformer_mismatchedTypes() { } @Test - public void testAnyMetadataTransformer() { + void testAnyMetadataTransformer() { MetadataTransformer transformer = MetadataTransformer.create(Money.class); Money inputMoney = Money.newBuilder().setCurrencyCode("USD").build(); OperationSnapshot operationSnapshot = @@ -100,7 +97,7 @@ public void testAnyMetadataTransformer() { } @Test - public void testAnyMetadataTransformer_mismatchedTypes() { + void testAnyMetadataTransformer_mismatchedTypes() { MetadataTransformer transformer = MetadataTransformer.create(Money.class); Status status = Status.newBuilder().setCode(Code.OK.value()).build(); OperationSnapshot operationSnapshot = diff --git a/gax-java/gax-grpc/src/test/java/com/google/api/gax/grpc/SettingsTest.java b/gax-java/gax-grpc/src/test/java/com/google/api/gax/grpc/SettingsTest.java index e24e36c686..a1ab8a8e8e 100644 --- a/gax-java/gax-grpc/src/test/java/com/google/api/gax/grpc/SettingsTest.java +++ b/gax-java/gax-grpc/src/test/java/com/google/api/gax/grpc/SettingsTest.java @@ -29,7 +29,8 @@ */ package com.google.api.gax.grpc; -import static org.junit.Assert.assertEquals; +import static com.google.api.gax.util.TimeConversionTestUtils.testDurationMethod; +import static org.junit.jupiter.api.Assertions.assertEquals; import com.google.api.gax.batching.BatchingSettings; import com.google.api.gax.core.CredentialsProvider; @@ -50,22 +51,20 @@ 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.mtls.MtlsProvider; import com.google.auth.Credentials; +import com.google.auth.mtls.MtlsProvider; 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.common.truth.Truth; import java.io.IOException; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.junit.runners.JUnit4; +import java.util.function.Function; +import java.util.function.Supplier; +import org.junit.jupiter.api.Test; import org.mockito.Mockito; -import org.threeten.bp.Duration; -@RunWith(JUnit4.class) -public class SettingsTest { +class SettingsTest { interface FakePagedListResponse extends PagedListResponse {} @@ -84,7 +83,7 @@ private static class FakeStubSettings extends StubSettings { public static final int DEFAULT_SERVICE_PORT = 443; public static final String DEFAULT_SERVICE_ENDPOINT = DEFAULT_SERVICE_ADDRESS + ':' + DEFAULT_SERVICE_PORT; - public static final MtlsProvider DEFAULT_MTLS_PROVIDER = new MtlsProvider(); + public static final MtlsProvider DEFAULT_MTLS_PROVIDER = null; public static final ImmutableList DEFAULT_SERVICE_SCOPES = ImmutableList.builder() .add("https://www.googleapis.com/auth/pubsub") @@ -112,13 +111,13 @@ private static class FakeStubSettings extends StubSettings { RetrySettings settings = null; settings = RetrySettings.newBuilder() - .setInitialRetryDelay(Duration.ofMillis(100L)) + .setInitialRetryDelayDuration(java.time.Duration.ofMillis(100L)) .setRetryDelayMultiplier(1.2) - .setMaxRetryDelay(Duration.ofMillis(1000L)) - .setInitialRpcTimeout(Duration.ofMillis(2000L)) + .setMaxRetryDelayDuration(java.time.Duration.ofMillis(1000L)) + .setInitialRpcTimeoutDuration(java.time.Duration.ofMillis(2000L)) .setRpcTimeoutMultiplier(1.5) - .setMaxRpcTimeout(Duration.ofMillis(30000L)) - .setTotalTimeout(Duration.ofMillis(45000L)) + .setMaxRpcTimeoutDuration(java.time.Duration.ofMillis(30000L)) + .setTotalTimeoutDuration(java.time.Duration.ofMillis(45000L)) .build(); definitions.put("default", settings); RETRY_PARAM_DEFINITIONS = definitions.build(); @@ -224,7 +223,7 @@ private static Builder createDefault() { BatchingSettings.newBuilder() .setElementCountThreshold(800L) .setRequestByteThreshold(8388608L) - .setDelayThreshold(Duration.ofMillis(100)) + .setDelayThresholdDuration(java.time.Duration.ofMillis(100)) .build()); builder .fakeMethodBatching() @@ -265,7 +264,7 @@ public BatchingCallSettings.Builder fakeMethodBatching() { // ==== @Test - public void customCredentials() throws IOException { + void customCredentials() throws IOException { Credentials credentials = Mockito.mock(Credentials.class); FakeStubSettings settings = @@ -287,7 +286,7 @@ public void customCredentials() throws IOException { } @Test - public void channelCustomCredentialScopes() throws IOException { + void channelCustomCredentialScopes() throws IOException { ImmutableList inputScopes = ImmutableList.builder().add("https://www.googleapis.com/auth/fakeservice").build(); @@ -319,7 +318,7 @@ public void channelCustomCredentialScopes() throws IOException { // ==== @Test - public void callSettingsToBuilder() { + void callSettingsToBuilder() { UnaryCallSettings.Builder builderA = UnaryCallSettings.newUnaryCallSettingsBuilder(); UnaryCallSettings settingsA = builderA.build(); UnaryCallSettings.Builder builderB = settingsA.toBuilder(); @@ -329,19 +328,19 @@ public void callSettingsToBuilder() { } @Test - public void unaryCallSettingsBuilderBuildDoesNotFailUnsetProperties() { + void unaryCallSettingsBuilderBuildDoesNotFailUnsetProperties() { UnaryCallSettings.Builder builder = UnaryCallSettings.newUnaryCallSettingsBuilder(); builder.build(); } @Test - public void callSettingsBuildFromTimeoutNoRetries() { - Duration timeout = Duration.ofMillis(60000); + void callSettingsBuildFromTimeoutNoRetries() { + java.time.Duration timeout = java.time.Duration.ofMillis(60000); UnaryCallSettings.Builder builderA = UnaryCallSettings.newUnaryCallSettingsBuilder(); - builderA.setSimpleTimeoutNoRetries(timeout); + builderA.setSimpleTimeoutNoRetriesDuration(timeout); UnaryCallSettings settingsA = builderA.build(); UnaryCallSettings.Builder builderB = @@ -350,17 +349,37 @@ public void callSettingsBuildFromTimeoutNoRetries() { .setRetryableCodes() .setRetrySettings( RetrySettings.newBuilder() - .setTotalTimeout(timeout) - .setInitialRetryDelay(Duration.ZERO) + .setTotalTimeoutDuration(timeout) + .setInitialRetryDelayDuration(java.time.Duration.ZERO) .setRetryDelayMultiplier(1) - .setMaxRetryDelay(Duration.ZERO) - .setInitialRpcTimeout(timeout) + .setMaxRetryDelayDuration(java.time.Duration.ZERO) + .setInitialRpcTimeoutDuration(timeout) .setRpcTimeoutMultiplier(1) - .setMaxRpcTimeout(timeout) + .setMaxRpcTimeoutDuration(timeout) .setMaxAttempts(1) .build()); UnaryCallSettings settingsB = builderB.build(); - assertEquals("UnaryCallSettings", settingsA, settingsB); + assertEquals(settingsA, settingsB, "UnaryCallSettings"); + } + + @Test + public void testWatchDogCheckInterval_backportMethodsBehaveCorrectly() { + final Function, StubSettings> build = + createBuilder -> { + try { + return createBuilder.get().build(); + } catch (IOException e) { + throw new RuntimeException(e); + } + }; + testDurationMethod( + 123l, + jt -> + build.apply( + () -> FakeStubSettings.newBuilder().setStreamWatchdogCheckIntervalDuration(jt)), + tt -> build.apply(() -> FakeStubSettings.newBuilder().setStreamWatchdogCheckInterval(tt)), + ss -> ss.getStreamWatchdogCheckIntervalDuration(), + ss -> ss.getStreamWatchdogCheckInterval()); } } diff --git a/gax-java/gax-grpc/src/test/java/com/google/api/gax/grpc/TimeoutTest.java b/gax-java/gax-grpc/src/test/java/com/google/api/gax/grpc/TimeoutTest.java index 3b0d8ebc5f..ab0848e6ff 100644 --- a/gax-java/gax-grpc/src/test/java/com/google/api/gax/grpc/TimeoutTest.java +++ b/gax-java/gax-grpc/src/test/java/com/google/api/gax/grpc/TimeoutTest.java @@ -35,6 +35,7 @@ import com.google.api.gax.retrying.RetrySettings; import com.google.api.gax.rpc.ApiException; import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.EndpointContext; import com.google.api.gax.rpc.RequestParamsExtractor; import com.google.api.gax.rpc.ServerStreamingCallSettings; import com.google.api.gax.rpc.ServerStreamingCallable; @@ -43,6 +44,7 @@ import com.google.api.gax.rpc.UnaryCallSettings; import com.google.api.gax.rpc.UnaryCallable; import com.google.api.gax.rpc.testing.FakeStatusCode; +import com.google.auth.Credentials; import com.google.common.collect.ImmutableSet; import io.grpc.CallOptions; import io.grpc.ClientCall; @@ -51,22 +53,19 @@ import io.grpc.MethodDescriptor; import io.grpc.MethodDescriptor.Marshaller; import io.grpc.MethodDescriptor.MethodType; +import java.io.IOException; import java.util.concurrent.TimeUnit; -import org.junit.Rule; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.junit.runners.JUnit4; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; import org.mockito.ArgumentCaptor; import org.mockito.ArgumentMatchers; import org.mockito.Mock; import org.mockito.Mockito; -import org.mockito.junit.MockitoJUnit; -import org.mockito.junit.MockitoRule; -import org.mockito.quality.Strictness; -import org.threeten.bp.Duration; +import org.mockito.junit.jupiter.MockitoExtension; -@RunWith(JUnit4.class) -public class TimeoutTest { +@ExtendWith(MockitoExtension.class) +class TimeoutTest { private static final String CALL_OPTIONS_AUTHORITY = "RETRYING_TEST"; private static final int DEADLINE_IN_DAYS = 7; private static final int DEADLINE_IN_MINUTES = 10; @@ -74,29 +73,40 @@ public class TimeoutTest { private static final ImmutableSet emptyRetryCodes = ImmutableSet.of(); private static final ImmutableSet retryUnknownCode = ImmutableSet.of(StatusCode.Code.UNKNOWN); - private static final Duration totalTimeout = Duration.ofDays(DEADLINE_IN_DAYS); - private static final Duration maxRpcTimeout = Duration.ofMinutes(DEADLINE_IN_MINUTES); - private static final Duration initialRpcTimeout = Duration.ofSeconds(DEADLINE_IN_SECONDS); - private static final GrpcCallContext defaultCallContext = GrpcCallContext.createDefault(); + private static final java.time.Duration totalTimeout = + java.time.Duration.ofDays(DEADLINE_IN_DAYS); + private static final java.time.Duration maxRpcTimeout = + java.time.Duration.ofMinutes(DEADLINE_IN_MINUTES); + private static final java.time.Duration initialRpcTimeout = + java.time.Duration.ofSeconds(DEADLINE_IN_SECONDS); + private static GrpcCallContext defaultCallContext; - @Rule public MockitoRule mockitoRule = MockitoJUnit.rule().strictness(Strictness.STRICT_STUBS); @Mock private Marshaller stringMarshaller; @Mock private RequestParamsExtractor paramsExtractor; @Mock private ManagedChannel managedChannel; + @BeforeAll + public static void setUp() throws IOException { + EndpointContext endpointContext = Mockito.mock(EndpointContext.class); + Mockito.doNothing() + .when(endpointContext) + .validateUniverseDomain(Mockito.any(Credentials.class), Mockito.any(GrpcStatusCode.class)); + defaultCallContext = GrpcCallContext.createDefault().withEndpointContext(endpointContext); + } + @Test - public void testNonRetryUnarySettings() { + void testNonRetryUnarySettings() { RetrySettings retrySettings = RetrySettings.newBuilder() - .setTotalTimeout(totalTimeout) - .setInitialRetryDelay(Duration.ZERO) + .setTotalTimeoutDuration(totalTimeout) + .setInitialRetryDelayDuration(java.time.Duration.ZERO) .setRetryDelayMultiplier(1.0) - .setMaxRetryDelay(Duration.ZERO) + .setMaxRetryDelayDuration(java.time.Duration.ZERO) .setMaxAttempts(1) .setJittered(true) - .setInitialRpcTimeout(initialRpcTimeout) + .setInitialRpcTimeoutDuration(initialRpcTimeout) .setRpcTimeoutMultiplier(1.0) - .setMaxRpcTimeout(maxRpcTimeout) + .setMaxRpcTimeoutDuration(maxRpcTimeout) .build(); CallOptions callOptionsUsed = setupUnaryCallable(retrySettings, emptyRetryCodes, defaultCallContext); @@ -111,25 +121,24 @@ public void testNonRetryUnarySettings() { } @Test - public void testNonRetryUnarySettingsContextWithRetry() { + void testNonRetryUnarySettingsContextWithRetry() { RetrySettings retrySettings = RetrySettings.newBuilder() - .setTotalTimeout(totalTimeout) - .setInitialRetryDelay(Duration.ZERO) + .setTotalTimeoutDuration(totalTimeout) + .setInitialRetryDelayDuration(java.time.Duration.ZERO) .setRetryDelayMultiplier(1.0) - .setMaxRetryDelay(Duration.ZERO) + .setMaxRetryDelayDuration(java.time.Duration.ZERO) .setMaxAttempts(1) .setJittered(true) - .setInitialRpcTimeout(initialRpcTimeout) + .setInitialRpcTimeoutDuration(initialRpcTimeout) .setRpcTimeoutMultiplier(1.0) - .setMaxRpcTimeout(maxRpcTimeout) + .setMaxRpcTimeoutDuration(maxRpcTimeout) .build(); - Duration newTimeout = Duration.ofSeconds(5); + java.time.Duration newTimeout = java.time.Duration.ofSeconds(5); RetrySettings contextRetrySettings = - retrySettings - .toBuilder() - .setInitialRpcTimeout(newTimeout) - .setMaxRpcTimeout(newTimeout) + retrySettings.toBuilder() + .setInitialRpcTimeoutDuration(newTimeout) + .setMaxRpcTimeoutDuration(newTimeout) .setMaxAttempts(3) .build(); GrpcCallContext retryingContext = @@ -151,17 +160,17 @@ public void testNonRetryUnarySettingsContextWithRetry() { } @Test - public void testNonRetryUnarySettingsWithoutInitialRpcTimeout() { + void testNonRetryUnarySettingsWithoutInitialRpcTimeout() { RetrySettings retrySettings = RetrySettings.newBuilder() - .setTotalTimeout(totalTimeout) - .setInitialRetryDelay(Duration.ZERO) + .setTotalTimeoutDuration(totalTimeout) + .setInitialRetryDelayDuration(java.time.Duration.ZERO) .setRetryDelayMultiplier(1.0) - .setMaxRetryDelay(Duration.ZERO) + .setMaxRetryDelayDuration(java.time.Duration.ZERO) .setMaxAttempts(1) .setJittered(true) .setRpcTimeoutMultiplier(1.0) - .setMaxRpcTimeout(maxRpcTimeout) + .setMaxRpcTimeoutDuration(maxRpcTimeout) .build(); CallOptions callOptionsUsed = setupUnaryCallable(retrySettings, emptyRetryCodes, defaultCallContext); @@ -176,17 +185,16 @@ public void testNonRetryUnarySettingsWithoutInitialRpcTimeout() { } @Test - public void testNonRetryUnarySettingsWithoutIndividualRpcTimeout() { + void testNonRetryUnarySettingsWithoutIndividualRpcTimeout() { RetrySettings retrySettings = RetrySettings.newBuilder() - .setTotalTimeout(totalTimeout) - .setInitialRetryDelay(Duration.ZERO) + .setTotalTimeoutDuration(totalTimeout) + .setInitialRetryDelayDuration(java.time.Duration.ZERO) .setRetryDelayMultiplier(1.0) - .setMaxRetryDelay(Duration.ZERO) + .setMaxRetryDelayDuration(java.time.Duration.ZERO) .setMaxAttempts(1) .setJittered(true) .setRpcTimeoutMultiplier(1.0) - .setRpcTimeoutMultiplier(1.0) .build(); CallOptions callOptionsUsed = setupUnaryCallable(retrySettings, emptyRetryCodes, defaultCallContext); @@ -201,18 +209,18 @@ public void testNonRetryUnarySettingsWithoutIndividualRpcTimeout() { } @Test - public void testNonRetryServerStreamingSettings() { + void testNonRetryServerStreamingSettings() { RetrySettings retrySettings = RetrySettings.newBuilder() - .setTotalTimeout(totalTimeout) - .setInitialRetryDelay(Duration.ZERO) + .setTotalTimeoutDuration(totalTimeout) + .setInitialRetryDelayDuration(java.time.Duration.ZERO) .setRetryDelayMultiplier(1.0) - .setMaxRetryDelay(Duration.ZERO) + .setMaxRetryDelayDuration(java.time.Duration.ZERO) .setMaxAttempts(1) .setJittered(true) - .setInitialRpcTimeout(initialRpcTimeout) + .setInitialRpcTimeoutDuration(initialRpcTimeout) .setRpcTimeoutMultiplier(1.0) - .setMaxRpcTimeout(maxRpcTimeout) + .setMaxRpcTimeoutDuration(maxRpcTimeout) .build(); CallOptions callOptionsUsed = setupServerStreamingCallable(retrySettings, emptyRetryCodes, defaultCallContext); @@ -227,22 +235,26 @@ public void testNonRetryServerStreamingSettings() { } @Test - public void testNonRetryServerStreamingSettingsContextWithRetry() { + void testNonRetryServerStreamingSettingsContextWithRetry() { RetrySettings retrySettings = RetrySettings.newBuilder() - .setTotalTimeout(totalTimeout) - .setInitialRetryDelay(Duration.ZERO) + .setTotalTimeoutDuration(totalTimeout) + .setInitialRetryDelayDuration(java.time.Duration.ZERO) .setRetryDelayMultiplier(1.0) - .setMaxRetryDelay(Duration.ZERO) + .setMaxRetryDelayDuration(java.time.Duration.ZERO) .setMaxAttempts(1) .setJittered(true) - .setInitialRpcTimeout(initialRpcTimeout) + .setInitialRpcTimeoutDuration(initialRpcTimeout) .setRpcTimeoutMultiplier(1.0) - .setMaxRpcTimeout(maxRpcTimeout) + .setMaxRpcTimeoutDuration(maxRpcTimeout) .build(); - Duration newTimeout = Duration.ofSeconds(5); + java.time.Duration newTimeout = java.time.Duration.ofSeconds(5); RetrySettings contextRetrySettings = - retrySettings.toBuilder().setTotalTimeout(newTimeout).setMaxAttempts(3).build(); + retrySettings.toBuilder() + .setInitialRpcTimeoutDuration(newTimeout) + .setMaxRpcTimeoutDuration(newTimeout) + .setMaxAttempts(3) + .build(); GrpcCallContext retryingContext = defaultCallContext .withRetrySettings(contextRetrySettings) @@ -262,17 +274,17 @@ public void testNonRetryServerStreamingSettingsContextWithRetry() { } @Test - public void testNonRetryServerStreamingSettingsWithoutInitialRpcTimeout() { + void testNonRetryServerStreamingSettingsWithoutInitialRpcTimeout() { RetrySettings retrySettings = RetrySettings.newBuilder() - .setTotalTimeout(totalTimeout) - .setInitialRetryDelay(Duration.ZERO) + .setTotalTimeoutDuration(totalTimeout) + .setInitialRetryDelayDuration(java.time.Duration.ZERO) .setRetryDelayMultiplier(1.0) - .setMaxRetryDelay(Duration.ZERO) + .setMaxRetryDelayDuration(java.time.Duration.ZERO) .setMaxAttempts(1) .setJittered(true) .setRpcTimeoutMultiplier(1.0) - .setMaxRpcTimeout(maxRpcTimeout) + .setMaxRpcTimeoutDuration(maxRpcTimeout) .build(); CallOptions callOptionsUsed = setupServerStreamingCallable(retrySettings, emptyRetryCodes, defaultCallContext); @@ -287,17 +299,16 @@ public void testNonRetryServerStreamingSettingsWithoutInitialRpcTimeout() { } @Test - public void testNonRetryServerStreamingSettingsWithoutIndividualRpcTimeout() { + void testNonRetryServerStreamingSettingsWithoutIndividualRpcTimeout() { RetrySettings retrySettings = RetrySettings.newBuilder() - .setTotalTimeout(totalTimeout) - .setInitialRetryDelay(Duration.ZERO) + .setTotalTimeoutDuration(totalTimeout) + .setInitialRetryDelayDuration(java.time.Duration.ZERO) .setRetryDelayMultiplier(1.0) - .setMaxRetryDelay(Duration.ZERO) + .setMaxRetryDelayDuration(java.time.Duration.ZERO) .setMaxAttempts(1) .setJittered(true) .setRpcTimeoutMultiplier(1.0) - .setRpcTimeoutMultiplier(1.0) .build(); CallOptions callOptionsUsed = setupServerStreamingCallable(retrySettings, emptyRetryCodes, defaultCallContext); @@ -438,7 +449,7 @@ private CallOptions setupServerStreamingCallable( * codebase must continue to support Java 7 and up, in alignment with client libraries that depend * on gax-java. */ - private int toSecondsPart(Duration duration) { + private int toSecondsPart(java.time.Duration duration) { return (int) (duration.getSeconds() - TimeUnit.MINUTES.toSeconds(1) diff --git a/gax-java/gax-grpc/src/test/java/com/google/api/gax/grpc/testing/FakeServiceImpl.java b/gax-java/gax-grpc/src/test/java/com/google/api/gax/grpc/testing/FakeServiceImpl.java index 298e847837..adb7c951fb 100644 --- a/gax-java/gax-grpc/src/test/java/com/google/api/gax/grpc/testing/FakeServiceImpl.java +++ b/gax-java/gax-grpc/src/test/java/com/google/api/gax/grpc/testing/FakeServiceImpl.java @@ -81,17 +81,14 @@ public void serverStreamingRecognize( // because the InProcessServer uses a direct executor and will buffer the results ignoring // cancellation Runnable runnable = - new Runnable() { - @Override - public void run() { - try { - Thread.sleep((long) color.getGreen()); - } catch (InterruptedException e) { - Thread.interrupted(); - return; - } + () -> { + try { + Thread.sleep((long) color.getGreen()); responseObserver.onNext(convert(color)); responseObserver.onCompleted(); + } catch (Exception e) { + Thread.interrupted(); + responseObserver.onError(e); } }; @@ -107,9 +104,10 @@ public StreamObserver clientStreamingRecognize(StreamObserver resp } private static Money convert(Color color) { - Money result = - Money.newBuilder().setCurrencyCode("USD").setUnits((long) (color.getRed() * 255)).build(); - return result; + return Money.newBuilder() + .setCurrencyCode("USD") + .setUnits((long) (color.getRed() * 255)) + .build(); } private static class RequestStreamObserver implements StreamObserver { @@ -133,5 +131,6 @@ public void onError(Throwable throwable) { public void onCompleted() { responseObserver.onCompleted(); } - }; + } + ; } diff --git a/gax-java/gax-grpc/src/test/java/com/google/api/gax/grpc/testing/MockServiceHelperTest.java b/gax-java/gax-grpc/src/test/java/com/google/api/gax/grpc/testing/MockServiceHelperTest.java index 585f8ec65f..c851e93c7b 100644 --- a/gax-java/gax-grpc/src/test/java/com/google/api/gax/grpc/testing/MockServiceHelperTest.java +++ b/gax-java/gax-grpc/src/test/java/com/google/api/gax/grpc/testing/MockServiceHelperTest.java @@ -29,8 +29,9 @@ */ package com.google.api.gax.grpc.testing; -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertThrows; import static org.mockito.Mockito.times; import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; @@ -41,15 +42,12 @@ import io.grpc.ServerServiceDefinition; import java.io.IOException; import java.util.Arrays; -import org.junit.Before; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.junit.runners.JUnit4; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; import org.mockito.Mock; import org.mockito.MockitoAnnotations; /** Tests for {@link MockServiceHelper}. */ -@RunWith(JUnit4.class) public class MockServiceHelperTest { @Mock private MockGrpcService grpcService; @Mock private MockGrpcService grpcService2; @@ -57,8 +55,8 @@ public class MockServiceHelperTest { @Mock private Server server; /** Sets up mocks. */ - @Before - public void setUp() { + @BeforeEach + void setUp() { MockitoAnnotations.initMocks(this); when(grpcService.getServiceDefinition()) .thenReturn(ServerServiceDefinition.builder("fake-service").build()); @@ -67,28 +65,28 @@ public void setUp() { } @Test - public void testGetService() { + void testGetService() { MockServiceHelper serviceHelper = new MockServiceHelper(server, "fake-address", grpcService); Truth.assertThat(serviceHelper.getService()).isSameInstanceAs(grpcService); Truth.assertThat(serviceHelper.getServices().size()).isEqualTo(1); } - @Test(expected = IllegalStateException.class) - public void testGetServiceInvalid() { + @Test + void testGetServiceInvalid() { MockServiceHelper serviceHelper = new MockServiceHelper(server, "fake-address2", Arrays.asList(grpcService, grpcService2)); - serviceHelper.getService(); + assertThrows(IllegalStateException.class, serviceHelper::getService); } @Test - public void testStart() throws IOException { + void testStart() throws IOException { MockServiceHelper serviceHelper = new MockServiceHelper(server, "fake-address", grpcService); serviceHelper.start(); verify(server, times(1)).start(); } @Test - public void testReset() { + void testReset() { MockServiceHelper serviceHelper = new MockServiceHelper("fake-address", grpcService); serviceHelper.reset(); verify(grpcService, times(1)).getServiceDefinition(); @@ -96,7 +94,7 @@ public void testReset() { } @Test - public void testCreateChannelProvider() throws Exception { + void testCreateChannelProvider() throws Exception { MockServiceHelper serviceHelper = new MockServiceHelper("fake-address", grpcService); TransportChannel channel = serviceHelper.createChannelProvider().getTransportChannel(); assertNotNull(channel); diff --git a/gax-java/gax-grpc/src/test/java/com/google/api/gax/grpc/testing/MockStreamObserver.java b/gax-java/gax-grpc/src/test/java/com/google/api/gax/grpc/testing/MockStreamObserver.java index ce86cff5a0..68d9889f2a 100644 --- a/gax-java/gax-grpc/src/test/java/com/google/api/gax/grpc/testing/MockStreamObserver.java +++ b/gax-java/gax-grpc/src/test/java/com/google/api/gax/grpc/testing/MockStreamObserver.java @@ -56,6 +56,7 @@ public void onError(Throwable t) { public void onCompleted() { future.set(actualMessages); } + // Returns the SettableFuture object which can be used to retrieve received messages. public SettableApiFuture> future() { return future; diff --git a/gax-java/gax-grpc/src/test/java/com/google/longrunning/OperationsClientTest.java b/gax-java/gax-grpc/src/test/java/com/google/longrunning/OperationsClientTest.java index 0c5eaa302f..d438a8c4f4 100644 --- a/gax-java/gax-grpc/src/test/java/com/google/longrunning/OperationsClientTest.java +++ b/gax-java/gax-grpc/src/test/java/com/google/longrunning/OperationsClientTest.java @@ -29,6 +29,9 @@ */ package com.google.longrunning; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertThrows; + import com.google.api.gax.core.NoCredentialsProvider; import com.google.api.gax.grpc.testing.LocalChannelProvider; import com.google.api.gax.grpc.testing.MockGrpcService; @@ -44,20 +47,19 @@ import java.io.IOException; import java.util.Arrays; import java.util.List; -import org.junit.After; -import org.junit.AfterClass; -import org.junit.Assert; -import org.junit.Before; -import org.junit.BeforeClass; -import org.junit.Test; - -public class OperationsClientTest { +import org.junit.jupiter.api.AfterAll; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; + +class OperationsClientTest { private static MockOperations mockOperations; private static MockServiceHelper serviceHelper; private OperationsClient client; private LocalChannelProvider channelProvider; - @BeforeClass + @BeforeAll public static void startStaticServer() { mockOperations = new MockOperations(); serviceHelper = @@ -65,13 +67,13 @@ public static void startStaticServer() { serviceHelper.start(); } - @AfterClass + @AfterAll public static void stopServer() { serviceHelper.stop(); } - @Before - public void setUp() throws IOException { + @BeforeEach + void setUp() throws IOException { serviceHelper.reset(); channelProvider = serviceHelper.createChannelProvider(); OperationsSettings settings = @@ -82,14 +84,14 @@ public void setUp() throws IOException { client = OperationsClient.create(settings); } - @After - public void tearDown() { + @AfterEach + void tearDown() { client.close(); } @Test @SuppressWarnings("all") - public void getOperationTest() { + void getOperationTest() { String name2 = "name2-1052831874"; boolean done = true; Operation expectedResponse = Operation.newBuilder().setName(name2).setDone(done).build(); @@ -98,34 +100,32 @@ public void getOperationTest() { String name = "name3373707"; Operation actualResponse = client.getOperation(name); - Assert.assertEquals(expectedResponse, actualResponse); + assertEquals(expectedResponse, actualResponse); List actualRequests = mockOperations.getRequests(); - Assert.assertEquals(1, actualRequests.size()); + assertEquals(1, actualRequests.size()); GetOperationRequest actualRequest = (GetOperationRequest) actualRequests.get(0); - Assert.assertEquals(name, actualRequest.getName()); + assertEquals(name, actualRequest.getName()); } @Test @SuppressWarnings("all") - public void getOperationExceptionTest() throws Exception { + void getOperationExceptionTest() throws Exception { StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); mockOperations.addException(exception); - try { - String name = "name3373707"; - - client.getOperation(name); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception - } + String name = "name3373707"; + assertThrows( + InvalidArgumentException.class, + () -> { + client.getOperation(name); + }); } @Test @SuppressWarnings("all") - public void listOperationsTest() { + void listOperationsTest() { String nextPageToken = ""; Operation operationsElement = Operation.newBuilder().build(); List operations = Arrays.asList(operationsElement); @@ -142,37 +142,35 @@ public void listOperationsTest() { ListOperationsPagedResponse pagedListResponse = client.listOperations(name, filter); List resources = Lists.newArrayList(pagedListResponse.iterateAll()); - Assert.assertEquals(1, resources.size()); - Assert.assertEquals(expectedResponse.getOperationsList().get(0), resources.get(0)); + assertEquals(1, resources.size()); + assertEquals(expectedResponse.getOperationsList().get(0), resources.get(0)); List actualRequests = mockOperations.getRequests(); - Assert.assertEquals(1, actualRequests.size()); + assertEquals(1, actualRequests.size()); ListOperationsRequest actualRequest = (ListOperationsRequest) actualRequests.get(0); - Assert.assertEquals(name, actualRequest.getName()); - Assert.assertEquals(filter, actualRequest.getFilter()); + assertEquals(name, actualRequest.getName()); + assertEquals(filter, actualRequest.getFilter()); } @Test @SuppressWarnings("all") - public void listOperationsExceptionTest() throws Exception { + void listOperationsExceptionTest() throws Exception { StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); mockOperations.addException(exception); - try { - String name = "name3373707"; - String filter = "filter-1274492040"; - - client.listOperations(name, filter); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception - } + String name = "name3373707"; + String filter = "filter-1274492040"; + assertThrows( + InvalidArgumentException.class, + () -> { + client.listOperations(name, filter); + }); } @Test @SuppressWarnings("all") - public void cancelOperationTest() { + void cancelOperationTest() { Empty expectedResponse = Empty.newBuilder().build(); mockOperations.addResponse(expectedResponse); @@ -181,31 +179,29 @@ public void cancelOperationTest() { client.cancelOperation(name); List actualRequests = mockOperations.getRequests(); - Assert.assertEquals(1, actualRequests.size()); + assertEquals(1, actualRequests.size()); CancelOperationRequest actualRequest = (CancelOperationRequest) actualRequests.get(0); - Assert.assertEquals(name, actualRequest.getName()); + assertEquals(name, actualRequest.getName()); } @Test @SuppressWarnings("all") - public void cancelOperationExceptionTest() throws Exception { + void cancelOperationExceptionTest() throws Exception { StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); mockOperations.addException(exception); - try { - String name = "name3373707"; - - client.cancelOperation(name); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception - } + String name = "name3373707"; + assertThrows( + InvalidArgumentException.class, + () -> { + client.cancelOperation(name); + }); } @Test @SuppressWarnings("all") - public void deleteOperationTest() { + void deleteOperationTest() { Empty expectedResponse = Empty.newBuilder().build(); mockOperations.addResponse(expectedResponse); @@ -214,31 +210,29 @@ public void deleteOperationTest() { client.deleteOperation(name); List actualRequests = mockOperations.getRequests(); - Assert.assertEquals(1, actualRequests.size()); + assertEquals(1, actualRequests.size()); DeleteOperationRequest actualRequest = (DeleteOperationRequest) actualRequests.get(0); - Assert.assertEquals(name, actualRequest.getName()); + assertEquals(name, actualRequest.getName()); } @Test @SuppressWarnings("all") - public void deleteOperationExceptionTest() throws Exception { + void deleteOperationExceptionTest() throws Exception { StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); mockOperations.addException(exception); - try { - String name = "name3373707"; - - client.deleteOperation(name); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception - } + String name = "name3373707"; + assertThrows( + InvalidArgumentException.class, + () -> { + client.deleteOperation(name); + }); } @Test @SuppressWarnings("all") - public void waitOperationTest() { + void waitOperationTest() { String name2 = "name2-1052831874"; boolean done = true; Operation expectedResponse = Operation.newBuilder().setName(name2).setDone(done).build(); @@ -250,31 +244,29 @@ public void waitOperationTest() { WaitOperationRequest.newBuilder().setName(name).setTimeout(timeout).build(); Operation actualResponse = client.waitOperation(request); - Assert.assertEquals(expectedResponse, actualResponse); + assertEquals(expectedResponse, actualResponse); List actualRequests = mockOperations.getRequests(); - Assert.assertEquals(1, actualRequests.size()); + assertEquals(1, actualRequests.size()); WaitOperationRequest actualRequest = (WaitOperationRequest) actualRequests.get(0); - Assert.assertEquals(name, actualRequest.getName()); + assertEquals(name, actualRequest.getName()); } @Test @SuppressWarnings("all") - public void waitOperationExceptionTest() throws Exception { + void waitOperationExceptionTest() throws Exception { StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); mockOperations.addException(exception); - try { - String name = "name3373707"; - Duration timeout = Duration.newBuilder().setSeconds(5).build(); - WaitOperationRequest request = - WaitOperationRequest.newBuilder().setName(name).setTimeout(timeout).build(); - - client.waitOperation(request); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception - } + String name = "name3373707"; + Duration timeout = Duration.newBuilder().setSeconds(5).build(); + WaitOperationRequest request = + WaitOperationRequest.newBuilder().setName(name).setTimeout(timeout).build(); + assertThrows( + InvalidArgumentException.class, + () -> { + client.waitOperation(request); + }); } } diff --git a/gax-java/gax-grpc/src/test/resources/README.md b/gax-java/gax-grpc/src/test/resources/README.md new file mode 100644 index 0000000000..77cf45111b --- /dev/null +++ b/gax-java/gax-grpc/src/test/resources/README.md @@ -0,0 +1,29 @@ +# Regenerate certificates and keys for testing mTLS-S2A +Below are the commands which can be used to regenerate the certs used in tests. This is the same process +used to generate test certs for S2A client in grpc-java: https://github.com/grpc/grpc-java/blob/master/s2a/src/test/resources/README.md + +Create root CA + +``` +openssl req -x509 -sha256 -days 7305 -newkey rsa:2048 -keyout root_key.pem -out +root_cert.pem +``` + +Generate private key + +``` +openssl genrsa -out client_key.pem 2048 +``` + +Generate CSR (set Common Name to localhost, leave all +other fields blank) + +``` +openssl req -key client_key.pem -new -out client.csr -config config.cnf +``` + +Sign CSR for client + +``` +openssl x509 -req -CA root_cert.pem -CAkey root_key.pem -in client.csr -out client_cert.pem -days 7305 +``` \ No newline at end of file diff --git a/gax-java/gax-grpc/src/test/resources/client_cert.pem b/gax-java/gax-grpc/src/test/resources/client_cert.pem new file mode 100644 index 0000000000..837f8bb501 --- /dev/null +++ b/gax-java/gax-grpc/src/test/resources/client_cert.pem @@ -0,0 +1,20 @@ +-----BEGIN CERTIFICATE----- +MIIDPTCCAiWgAwIBAgIUaarddwSWeE4jDC9kwxEr446ehqUwDQYJKoZIhvcNAQEL +BQAwWTELMAkGA1UEBhMCQVUxEzARBgNVBAgMClNvbWUtU3RhdGUxITAfBgNVBAoM +GEludGVybmV0IFdpZGdpdHMgUHR5IEx0ZDESMBAGA1UEAwwJbG9jYWxob3N0MB4X +DTI0MTAwMTIxNTk1NFoXDTQ0MTAwMTIxNTk1NFowFDESMBAGA1UEAwwJbG9jYWxo +b3N0MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAxlNsldt7yAU4KRuS +2D2/FjNIE1US5olBm4HteTr++41WaELZJqNLRPPp052jEQU3aKSYNGZvUUO6buu7 +eFpz2SBNUVMyvmzzocjVAyyf4NQvDazYHWOb+/YCeUppTRWriz4V5sn47qJTQ8cd +CGrTFeLHxUjx4nh/OiqVXP/KnF3EqPEuqph0ky7+GirnJgPRe+C5ERuGkJye8dmP +yWGA2lSS6MeDe7JZTAMi08bAn7BuNpeBkOzz1msGGI9PnUanUs7GOPWTDdcQAVY8 +KMvHCuGaNMGpb4rOR2mm8LlbAbpTPz8Pkw4QtMCLkgsrz2CzXpVwnLsU7nDXJAIO +B155lQIDAQABo0IwQDAdBgNVHQ4EFgQUSZEyIHLzkIw7AwkBaUjYfIrGVR4wHwYD +VR0jBBgwFoAUcq3dtxAVA410YWyM0B4e+4umbiwwDQYJKoZIhvcNAQELBQADggEB +AAz0bZ4ayrZLhA45xn0yvdpdqiCtiWikCRtxgE7VXHg/ziZJVMpBpAhbIGO5tIyd +lttnRXHwz5DUwKiba4/bCEFe229BshQEql5qaqcbGbFfSly11WeqqnwR1N7c8Gpv +pD9sVrx22seN0rTUk87MY/S7mzCxHqAx35zm/LTW3pWcgCTMKFHy4Gt4mpTnXkNA +WkhP2OhW5RLiu6Whi0BEdb2TGG1+ctamgijKXb+gJeef5ehlHXG8eU862KF5UlEA +NeQKBm/PpQxOMe0NdpatjN8QRoczku0Itiodng+OZ1o+2iSNG988uFRb3CUSnjtE +R/HL6ULAFzo59EpIYxruU/w= +-----END CERTIFICATE----- \ No newline at end of file diff --git a/gax-java/gax-grpc/src/test/resources/client_key.pem b/gax-java/gax-grpc/src/test/resources/client_key.pem new file mode 100644 index 0000000000..38b93eb65c --- /dev/null +++ b/gax-java/gax-grpc/src/test/resources/client_key.pem @@ -0,0 +1,28 @@ +-----BEGIN PRIVATE KEY----- +MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQDGU2yV23vIBTgp +G5LYPb8WM0gTVRLmiUGbge15Ov77jVZoQtkmo0tE8+nTnaMRBTdopJg0Zm9RQ7pu +67t4WnPZIE1RUzK+bPOhyNUDLJ/g1C8NrNgdY5v79gJ5SmlNFauLPhXmyfjuolND +xx0IatMV4sfFSPHieH86KpVc/8qcXcSo8S6qmHSTLv4aKucmA9F74LkRG4aQnJ7x +2Y/JYYDaVJLox4N7sllMAyLTxsCfsG42l4GQ7PPWawYYj0+dRqdSzsY49ZMN1xAB +Vjwoy8cK4Zo0walvis5HaabwuVsBulM/Pw+TDhC0wIuSCyvPYLNelXCcuxTucNck +Ag4HXnmVAgMBAAECggEAKuW9jXaBgiS63o1jyFkmvWcPNntG0M2sfrXuRzQfFgse +vwOCk8xrSflWQNsOe+58ayp6746ekl3LdBWSIbiy6SqG/sm3pp/LXNmjVYHv/QH4 +QYV643R5t1ihdVnGiBFhXwdpVleme/tpdjYZzgnJKak5W69o/nrgzhSK5ShAy2xM +j0XXbgdqG+4JxPb5BZmjHHfXAXUfgSORMdfArkbgFBRc9wL/6JVTXjeAMy5WX9qe +5UQsSOYkwc9P2snifC/jdIhjHQOkkx59O0FgukJEFZPoagVG1duWQbnNDr7QVHCJ +jV6dg9tIT4SXD3uPSPbgNGlRUseIakCzrhHARJuA2wKBgQD/h8zoh0KaqKyViCYw +XKOFpm1pAFnp2GiDOblxNubNFAXEWnC+FlkvO/z1s0zVuYELUqfxcYMSXJFEVelK +rfjZtoC5oxqWGqLo9iCj7pa8t+ipulYcLt2SWc7eZPD4T4lzeEf1Qz77aKcz34sa +dv9lzQkDvhR/Mv1VeEGFHiq2VwKBgQDGsLcTGH5Yxs//LRSY8TigBkQEDrH5NvXu +2jtAzZhy1Yhsoa5eiZkhnnzM6+n05ovfZLcy6s7dnwP1Y+C79vs+DKMBsodtDG5z +YpsB0VrXYa6P6pCqkcz0Bz9xdo5sOhAK3AKnX6jd29XBDdeYsw/lxHLG24wProTD +cCYFqtaj8wKBgQCaqKT68DL9zK14a8lBaDCIyexaqx3AjXzkP+Hfhi03XrEG4P5v +7rLYBeTbCUSt7vMN2V9QoTWFvYUm6SCkVJvTmcRblz6WL1T+z0l+LwAJBP7LC77m +m+77j2PH8yxt/iXhP6G97o+GNxdMLDbTM8bs5KZaH4fkXQY73uc5HMMZTQKBgEZS +7blYhf+t/ph2wD+RwVUCYrh86wkmJs2veCFro3WhlnO8lhbn5Mc9bTaqmVgQ8ZjT +8POYoDdYvPHxs+1TcYF4v4kuQziZmc5FLE/sZZauADb38tQsXrpQhmgGakpsEpmF +XXsYJJDB6lo2KATn+8x7R5SSyHQUdPEnlI2U9ft5AoGBAJw0NJiM1EzRS8xq0DmO +AvQaPjo01o2hH6wghws8gDQwrj0eHraHgVi7zo0VkaHJbO7ahKPudset3N7owJhA +CUAPPRtv5wn0amAyNz77f1dz4Gys3AkcchflqhbEaQpzKYx4kX0adclur4WJ/DVm +P7DI977SHCVB4FVMbXMEkBjN +-----END PRIVATE KEY----- \ No newline at end of file diff --git a/gax-java/gax-grpc/src/test/resources/root_cert.pem b/gax-java/gax-grpc/src/test/resources/root_cert.pem new file mode 100644 index 0000000000..ccd0a46bc2 --- /dev/null +++ b/gax-java/gax-grpc/src/test/resources/root_cert.pem @@ -0,0 +1,22 @@ +-----BEGIN CERTIFICATE----- +MIIDkzCCAnugAwIBAgIUWemeXZdfqcqkP8/Eyj74oTJtoNQwDQYJKoZIhvcNAQEL +BQAwWTELMAkGA1UEBhMCQVUxEzARBgNVBAgMClNvbWUtU3RhdGUxITAfBgNVBAoM +GEludGVybmV0IFdpZGdpdHMgUHR5IEx0ZDESMBAGA1UEAwwJbG9jYWxob3N0MB4X +DTI0MTAwMTIxNTkxMVoXDTQ0MTAwMTIxNTkxMVowWTELMAkGA1UEBhMCQVUxEzAR +BgNVBAgMClNvbWUtU3RhdGUxITAfBgNVBAoMGEludGVybmV0IFdpZGdpdHMgUHR5 +IEx0ZDESMBAGA1UEAwwJbG9jYWxob3N0MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8A +MIIBCgKCAQEAt3A04hy5lljv86Nu0LLQZ2hA+fcImHjt1p1Mxgcta/5oxfVLcerE +ZH+DAQLDtWzp9Up/vI57MM419GIL8Iszk7hnZRS/HWJ+2jewZJtz4i/g15dLr6+1 +uabMdPOWos60BwcLMxKEe6lJO1mV4z9d4NH4mAuMIHyM+ty0Klp9MfeDJtYEh0+z +AxJUHCixDTsnKJro7My7A3ZT7bvaMfXxS7XN6qlRgBfiCmXo/GKTFfmfBW/EZGkG +XOCxE2D79wYNhC41Q/ix0kwjEeOj2vgGFoiyblSdHdzvRXzsoQTEiZSM8lJDR2IT +ZbpgbBlknMU6efNWlS8P5damB9ZWXg3x4wIDAQABo1MwUTAdBgNVHQ4EFgQUcq3d +txAVA410YWyM0B4e+4umbiwwHwYDVR0jBBgwFoAUcq3dtxAVA410YWyM0B4e+4um +biwwDwYDVR0TAQH/BAUwAwEB/zANBgkqhkiG9w0BAQsFAAOCAQEApZvaI9y7vjX/ +RRdvwf2Db9KlTE9nuVQ3AsrmG9Ml0p2X6U5aTetxdYBo2PuaaYHheF03JOH8zjpL +UfFzvbi52DPbfFAaDw/6NIAenXlg492leNvUFNjGGRyJO9R5/aDfv40/fT3Em5G5 +DnR8SeGQ9tI1t6xBBT+d+/MilSiEKVu8IIF/p0SwvEyR4pKo6wFVZR0ZiIj2v/FZ +P5Qk0Xhb+slpmaR3Wtx/mPl9Wb3kpPD4CAwhWDqFkKJql9/n9FvMjdwlCQKQGB26 +ZDXY3C0UTdktK5biNWRgAUVJEWBX6Q2amrxQHIn2d9RJ8uxCME/KBAntK+VxZE78 +w0JOvQ4Dpw== +-----END CERTIFICATE----- \ No newline at end of file diff --git a/gax-java/gax-httpjson/BUILD.bazel b/gax-java/gax-httpjson/BUILD.bazel index 0ddf20181d..1e134e6770 100644 --- a/gax-java/gax-httpjson/BUILD.bazel +++ b/gax-java/gax-httpjson/BUILD.bazel @@ -11,6 +11,7 @@ _COMPILE_DEPS = [ "@com_google_code_gson_gson//jar", "@com_google_guava_guava//jar", "@com_google_code_findbugs_jsr305//jar", + "@com_google_errorprone_error_prone_annotations//jar", "@org_threeten_threetenbp//jar", "@com_google_http_client_google_http_client//jar", "@com_google_auth_google_auth_library_oauth2_http//jar", @@ -27,8 +28,9 @@ _COMPILE_DEPS = [ ] _TEST_COMPILE_DEPS = [ - "@junit_junit//jar", + "@org_junit_jupiter_junit_jupiter_api//jar", "@org_mockito_mockito_core//jar", + "@org_mockito_mockito_junit_jupiter//jar", "@com_google_truth_truth//jar", "//gax:gax_testlib", "@com_googlecode_java_diff_utils_diffutils//jar", diff --git a/gax-java/gax-httpjson/build.gradle b/gax-java/gax-httpjson/build.gradle deleted file mode 100644 index d16bf0fed6..0000000000 --- a/gax-java/gax-httpjson/build.gradle +++ /dev/null @@ -1,43 +0,0 @@ -archivesBaseName = 'gax-httpjson' - -// TODO: Populate this from dependencies.properties version property (for proper Gradle-Bazel sync) -project.version = "0.105.1" // {x-version-update:gax-httpjson:current} - -dependencies { - api(project(':gax'), - libraries['maven.com_google_api_api_common'], - libraries['maven.com_google_api_grpc_proto_google_common_protos'], - libraries['maven.com_google_auth_google_auth_library_credentials'], - libraries['maven.com_google_code_gson_gson'], - libraries['maven.com_google_guava_guava'], - libraries['maven.com_google_http_client_google_http_client'], - libraries['maven.com_google_protobuf'], - libraries['maven.org_threeten_threetenbp']) - - implementation(libraries['maven.com_google_auth_google_auth_library_oauth2_http'], - libraries['maven.com_google_code_findbugs_jsr305'], - libraries['maven.com_google_http_client_google_http_client_gson'], - libraries['maven.com_google_protobuf_java_util']) - - compileOnly libraries['maven.com_google_auto_value_auto_value'] - - testImplementation(project(':gax').sourceSets.test.output, - libraries['maven.junit_junit'], - libraries['maven.org_mockito_mockito_core'], - libraries['maven.com_google_truth_truth']) - - annotationProcessor libraries['maven.com_google_auto_value_auto_value'] - - shadowNoGuava libraries['maven.com_google_guava_guava'] -} - -jar { - manifest { - attributes 'Specification-Title': project.name, - 'Specification-Version': project.version, - 'Specification-Vendor': libraryVendor, - 'Implementation-Title': project.name, - 'Implementation-Version': project.version, - 'Implementation-Vendor': libraryVendor - } -} diff --git a/gax-java/gax-httpjson/pom.xml b/gax-java/gax-httpjson/pom.xml index 9e192cccae..259b360ba4 100644 --- a/gax-java/gax-httpjson/pom.xml +++ b/gax-java/gax-httpjson/pom.xml @@ -3,7 +3,7 @@ 4.0.0 gax-httpjson - 0.105.2-SNAPSHOT + 2.76.1-SNAPSHOT jar GAX (Google Api eXtensions) for Java (HTTP JSON) Google Api eXtensions for Java (HTTP JSON) @@ -11,7 +11,7 @@ com.google.api gax-parent - 2.20.2-SNAPSHOT + 2.76.1-SNAPSHOT @@ -78,6 +78,12 @@ auto-value-annotations provided + + + org.slf4j + slf4j-api + true + @@ -111,4 +117,4 @@ - \ No newline at end of file + diff --git a/gax-java/gax-httpjson/src/main/java/com/google/api/gax/httpjson/ApiMethodDescriptor.java b/gax-java/gax-httpjson/src/main/java/com/google/api/gax/httpjson/ApiMethodDescriptor.java index 6952f48859..69e2e0fff7 100644 --- a/gax-java/gax-httpjson/src/main/java/com/google/api/gax/httpjson/ApiMethodDescriptor.java +++ b/gax-java/gax-httpjson/src/main/java/com/google/api/gax/httpjson/ApiMethodDescriptor.java @@ -29,11 +29,9 @@ */ package com.google.api.gax.httpjson; -import com.google.api.core.BetaApi; import com.google.auto.value.AutoValue; import javax.annotation.Nullable; -@BetaApi @AutoValue /* Method descriptor for messages to be transmitted over HTTP. */ public abstract class ApiMethodDescriptor { diff --git a/gax-java/gax-httpjson/src/main/java/com/google/api/gax/httpjson/FieldsExtractor.java b/gax-java/gax-httpjson/src/main/java/com/google/api/gax/httpjson/FieldsExtractor.java index 024e8d3d1e..aa42604596 100644 --- a/gax-java/gax-httpjson/src/main/java/com/google/api/gax/httpjson/FieldsExtractor.java +++ b/gax-java/gax-httpjson/src/main/java/com/google/api/gax/httpjson/FieldsExtractor.java @@ -33,6 +33,7 @@ * A functional interface to be implemented for each request message to extract specific fields from * it. For advanced usage only. */ +@FunctionalInterface public interface FieldsExtractor { ParamsT extract(RequestT request); } diff --git a/gax-java/gax-httpjson/src/main/java/com/google/api/gax/httpjson/ForwardingHttpJsonClientCall.java b/gax-java/gax-httpjson/src/main/java/com/google/api/gax/httpjson/ForwardingHttpJsonClientCall.java index 8539b2b505..09e97a61c8 100644 --- a/gax-java/gax-httpjson/src/main/java/com/google/api/gax/httpjson/ForwardingHttpJsonClientCall.java +++ b/gax-java/gax-httpjson/src/main/java/com/google/api/gax/httpjson/ForwardingHttpJsonClientCall.java @@ -29,14 +29,12 @@ */ package com.google.api.gax.httpjson; -import com.google.api.core.BetaApi; import javax.annotation.Nullable; /** * A {@link HttpJsonClientCall} which forwards all of its methods to another {@link * HttpJsonClientCall}. */ -@BetaApi public abstract class ForwardingHttpJsonClientCall extends HttpJsonClientCall { diff --git a/gax-java/gax-httpjson/src/main/java/com/google/api/gax/httpjson/ForwardingHttpJsonClientCallListener.java b/gax-java/gax-httpjson/src/main/java/com/google/api/gax/httpjson/ForwardingHttpJsonClientCallListener.java index 8c64b957f6..1d6eb2599a 100644 --- a/gax-java/gax-httpjson/src/main/java/com/google/api/gax/httpjson/ForwardingHttpJsonClientCallListener.java +++ b/gax-java/gax-httpjson/src/main/java/com/google/api/gax/httpjson/ForwardingHttpJsonClientCallListener.java @@ -30,13 +30,10 @@ package com.google.api.gax.httpjson; -import com.google.api.core.BetaApi; - /** * A {@link HttpJsonClientCall.Listener} which forwards all of its methods to another {@link * HttpJsonClientCall.Listener}. */ -@BetaApi public abstract class ForwardingHttpJsonClientCallListener extends HttpJsonClientCall.Listener { diff --git a/gax-java/gax-httpjson/src/main/java/com/google/api/gax/httpjson/GaxHttpJsonProperties.java b/gax-java/gax-httpjson/src/main/java/com/google/api/gax/httpjson/GaxHttpJsonProperties.java index fab63c320c..a12f771fdc 100644 --- a/gax-java/gax-httpjson/src/main/java/com/google/api/gax/httpjson/GaxHttpJsonProperties.java +++ b/gax-java/gax-httpjson/src/main/java/com/google/api/gax/httpjson/GaxHttpJsonProperties.java @@ -36,7 +36,7 @@ @InternalApi public class GaxHttpJsonProperties { private static final Pattern DEFAULT_API_CLIENT_HEADER_PATTERN = - Pattern.compile("gl-java/.+ gapic/.* gax/.+ rest/.*"); + Pattern.compile("gl-java/.+ gapic/.*?--protobuf-.+ gax/.+ rest/.*"); /** Returns default api client header pattern (to facilitate testing) */ public static Pattern getDefaultApiClientHeaderPattern() { diff --git a/gax-java/gax-httpjson/src/main/java/com/google/api/gax/httpjson/HttpJsonApiExceptionFactory.java b/gax-java/gax-httpjson/src/main/java/com/google/api/gax/httpjson/HttpJsonApiExceptionFactory.java index a48f0b5a24..55c9a68b52 100644 --- a/gax-java/gax-httpjson/src/main/java/com/google/api/gax/httpjson/HttpJsonApiExceptionFactory.java +++ b/gax-java/gax-httpjson/src/main/java/com/google/api/gax/httpjson/HttpJsonApiExceptionFactory.java @@ -32,9 +32,11 @@ import com.google.api.client.http.HttpResponseException; import com.google.api.gax.rpc.ApiException; import com.google.api.gax.rpc.ApiExceptionFactory; +import com.google.api.gax.rpc.ErrorDetails; import com.google.api.gax.rpc.StatusCode; import com.google.api.gax.rpc.StatusCode.Code; import com.google.common.collect.ImmutableSet; +import com.google.rpc.Status; import java.util.Set; import java.util.concurrent.CancellationException; @@ -51,7 +53,21 @@ ApiException create(Throwable throwable) { StatusCode statusCode = HttpJsonStatusCode.of(e.getStatusCode()); boolean canRetry = retryableCodes.contains(statusCode.getCode()); String message = e.getStatusMessage(); - return createApiException(throwable, statusCode, message, canRetry); + Status status = HttpJsonErrorParser.parseStatus(e.getContent()); + + if (!status.getMessage().isEmpty()) { + message = status.getMessage(); + } + + ErrorDetails errorDetails = + ErrorDetails.builder().setRawErrorMessages(status.getDetailsList()).build(); + + if (message == null) { + message = throwable.toString(); + } + + return ApiExceptionFactory.createException( + message, throwable, statusCode, canRetry, errorDetails); } else if (throwable instanceof HttpJsonStatusRuntimeException) { HttpJsonStatusRuntimeException e = (HttpJsonStatusRuntimeException) throwable; StatusCode statusCode = HttpJsonStatusCode.of(e.getStatusCode()); diff --git a/gax-java/gax-httpjson/src/main/java/com/google/api/gax/httpjson/HttpJsonCallContext.java b/gax-java/gax-httpjson/src/main/java/com/google/api/gax/httpjson/HttpJsonCallContext.java index 469435d607..2b2d675a2a 100644 --- a/gax-java/gax-httpjson/src/main/java/com/google/api/gax/httpjson/HttpJsonCallContext.java +++ b/gax-java/gax-httpjson/src/main/java/com/google/api/gax/httpjson/HttpJsonCallContext.java @@ -29,11 +29,19 @@ */ package com.google.api.gax.httpjson; +import static com.google.api.gax.util.TimeConversionUtils.toJavaTimeDuration; +import static com.google.api.gax.util.TimeConversionUtils.toThreetenDuration; + import com.google.api.core.BetaApi; +import com.google.api.core.InternalApi; +import com.google.api.core.ObsoleteApi; import com.google.api.gax.retrying.RetrySettings; import com.google.api.gax.rpc.ApiCallContext; +import com.google.api.gax.rpc.ApiExceptionFactory; +import com.google.api.gax.rpc.EndpointContext; import com.google.api.gax.rpc.StatusCode; import com.google.api.gax.rpc.TransportChannel; +import com.google.api.gax.rpc.UnauthenticatedException; import com.google.api.gax.rpc.internal.ApiCallContextOptions; import com.google.api.gax.rpc.internal.Headers; import com.google.api.gax.tracing.ApiTracer; @@ -42,14 +50,13 @@ import com.google.common.base.Preconditions; import com.google.common.collect.ImmutableMap; import com.google.common.collect.ImmutableSet; +import java.io.IOException; import java.util.List; import java.util.Map; import java.util.Objects; import java.util.Set; import javax.annotation.Nonnull; import javax.annotation.Nullable; -import org.threeten.bp.Duration; -import org.threeten.bp.Instant; /** * HttpJsonCallContext encapsulates context data used to make an http-json call. @@ -59,18 +66,20 @@ * copies of the object, but with one field changed. The immutability and thread safety of the * arguments solely depends on the arguments themselves. */ -@BetaApi("Reference ApiCallContext instead - this class is likely to experience breaking changes") public final class HttpJsonCallContext implements ApiCallContext { + private static final HttpJsonStatusCode UNAUTHENTICATED_STATUS_CODE = + HttpJsonStatusCode.of(StatusCode.Code.UNAUTHENTICATED); private final HttpJsonChannel channel; private final HttpJsonCallOptions callOptions; - @Nullable private final Duration timeout; - @Nullable private final Duration streamWaitTimeout; - @Nullable private final Duration streamIdleTimeout; + @Nullable private final java.time.Duration timeout; + @Nullable private final java.time.Duration streamWaitTimeout; + @Nullable private final java.time.Duration streamIdleTimeout; private final ImmutableMap> extraHeaders; private final ApiCallContextOptions options; private final ApiTracer tracer; @Nullable private final RetrySettings retrySettings; @Nullable private final ImmutableSet retryableCodes; + private final EndpointContext endpointContext; /** Returns an empty instance. */ public static HttpJsonCallContext createDefault() { @@ -84,6 +93,7 @@ public static HttpJsonCallContext createDefault() { ApiCallContextOptions.getDefaultOptions(), null, null, + null, null); } @@ -98,20 +108,22 @@ public static HttpJsonCallContext of(HttpJsonChannel channel, HttpJsonCallOption ApiCallContextOptions.getDefaultOptions(), null, null, + null, null); } private HttpJsonCallContext( HttpJsonChannel channel, HttpJsonCallOptions callOptions, - Duration timeout, - Duration streamWaitTimeout, - Duration streamIdleTimeout, + java.time.Duration timeout, + java.time.Duration streamWaitTimeout, + java.time.Duration streamIdleTimeout, ImmutableMap> extraHeaders, ApiCallContextOptions options, ApiTracer tracer, RetrySettings defaultRetrySettings, - Set defaultRetryableCodes) { + Set defaultRetryableCodes, + @Nullable EndpointContext endpointContext) { this.channel = channel; this.callOptions = callOptions; this.timeout = timeout; @@ -123,6 +135,10 @@ private HttpJsonCallContext( this.retrySettings = defaultRetrySettings; this.retryableCodes = defaultRetryableCodes == null ? null : ImmutableSet.copyOf(defaultRetryableCodes); + // Attempt to create an empty, non-functioning EndpointContext by default. The client will have + // a valid EndpointContext with user configurations after the client has been initialized. + this.endpointContext = + endpointContext == null ? EndpointContext.getDefaultInstance() : endpointContext; } /** @@ -167,17 +183,17 @@ public HttpJsonCallContext merge(ApiCallContext inputCallContext) { // Do deep merge of callOptions HttpJsonCallOptions newCallOptions = callOptions.merge(httpJsonCallContext.callOptions); - Duration newTimeout = httpJsonCallContext.timeout; + java.time.Duration newTimeout = httpJsonCallContext.timeout; if (newTimeout == null) { newTimeout = this.timeout; } - Duration newStreamWaitTimeout = httpJsonCallContext.streamWaitTimeout; + java.time.Duration newStreamWaitTimeout = httpJsonCallContext.streamWaitTimeout; if (newStreamWaitTimeout == null) { newStreamWaitTimeout = streamWaitTimeout; } - Duration newStreamIdleTimeout = httpJsonCallContext.streamIdleTimeout; + java.time.Duration newStreamIdleTimeout = httpJsonCallContext.streamIdleTimeout; if (newStreamIdleTimeout == null) { newStreamIdleTimeout = streamIdleTimeout; } @@ -202,6 +218,8 @@ public HttpJsonCallContext merge(ApiCallContext inputCallContext) { newRetryableCodes = this.retryableCodes; } + // The EndpointContext is not updated as there should be no reason for a user + // to update this. return new HttpJsonCallContext( newChannel, newCallOptions, @@ -212,7 +230,8 @@ public HttpJsonCallContext merge(ApiCallContext inputCallContext) { newOptions, newTracer, newRetrySettings, - newRetryableCodes); + newRetryableCodes, + endpointContext); } @Override @@ -233,8 +252,32 @@ public HttpJsonCallContext withTransportChannel(TransportChannel inputChannel) { return withChannel(transportChannel.getChannel()); } + /** This method is obsolete. Use {@link #withTimeoutDuration(java.time.Duration)} instead. */ + @Override + @ObsoleteApi("Use withTimeoutDuration(java.time.Duration) instead") + public HttpJsonCallContext withTimeout(org.threeten.bp.Duration timeout) { + return withTimeoutDuration(toJavaTimeDuration(timeout)); + } + + @Override + public HttpJsonCallContext withEndpointContext(EndpointContext endpointContext) { + Preconditions.checkNotNull(endpointContext); + return new HttpJsonCallContext( + this.channel, + this.callOptions, + this.timeout, + this.streamWaitTimeout, + this.streamIdleTimeout, + this.extraHeaders, + this.options, + this.tracer, + this.retrySettings, + this.retryableCodes, + endpointContext); + } + @Override - public HttpJsonCallContext withTimeout(Duration timeout) { + public HttpJsonCallContext withTimeoutDuration(java.time.Duration timeout) { // Default RetrySettings use 0 for RPC timeout. Treat that as disabled timeouts. if (timeout != null && (timeout.isZero() || timeout.isNegative())) { timeout = null; @@ -255,20 +298,41 @@ public HttpJsonCallContext withTimeout(Duration timeout) { this.options, this.tracer, this.retrySettings, - this.retryableCodes); + this.retryableCodes, + this.endpointContext); + } + + /** This method is obsolete. Use {@link #getTimeoutDuration()} instead. */ + @Nullable + @Override + @ObsoleteApi("Use getTimeoutDuration instead") + public org.threeten.bp.Duration getTimeout() { + return toThreetenDuration(getTimeoutDuration()); } @Nullable @Override - public Duration getTimeout() { + public java.time.Duration getTimeoutDuration() { return timeout; } + /** + * This method is obsolete. Use {@link #withStreamWaitTimeoutDuration(java.time.Duration)} + * instead. + */ + @Override + @ObsoleteApi("Use withStreamWaitTimeoutDuration(java.time.Duration) instead") + public HttpJsonCallContext withStreamWaitTimeout( + @Nullable org.threeten.bp.Duration streamWaitTimeout) { + return withStreamWaitTimeoutDuration(toJavaTimeDuration(streamWaitTimeout)); + } + @Override - public HttpJsonCallContext withStreamWaitTimeout(@Nullable Duration streamWaitTimeout) { + public HttpJsonCallContext withStreamWaitTimeoutDuration( + @Nullable java.time.Duration streamWaitTimeout) { if (streamWaitTimeout != null) { Preconditions.checkArgument( - streamWaitTimeout.compareTo(Duration.ZERO) >= 0, "Invalid timeout: < 0 s"); + streamWaitTimeout.compareTo(java.time.Duration.ZERO) >= 0, "Invalid timeout: < 0 s"); } return new HttpJsonCallContext( @@ -281,25 +345,46 @@ public HttpJsonCallContext withStreamWaitTimeout(@Nullable Duration streamWaitTi this.options, this.tracer, this.retrySettings, - this.retryableCodes); + this.retryableCodes, + this.endpointContext); + } + + /** This method is obsolete. Use {@link #getStreamWaitTimeoutDuration()} instead. */ + @Override + @Nullable + @ObsoleteApi("Use getStreamWaitTimeoutDuration() instead") + public org.threeten.bp.Duration getStreamWaitTimeout() { + return toThreetenDuration(getStreamWaitTimeoutDuration()); } /** * The stream wait timeout set for this context. * - * @see ApiCallContext#withStreamWaitTimeout(Duration) + * @see ApiCallContext#withStreamWaitTimeoutDuration(java.time.Duration) */ @Override @Nullable - public Duration getStreamWaitTimeout() { + public java.time.Duration getStreamWaitTimeoutDuration() { return streamWaitTimeout; } + /** + * This method is obsolete. Use {@link #withStreamIdleTimeoutDuration(java.time.Duration)} + * instead. + */ @Override - public HttpJsonCallContext withStreamIdleTimeout(@Nullable Duration streamIdleTimeout) { + @ObsoleteApi("Use withStreamIdleTimeoutDuration(java.time.Duration) instead") + public HttpJsonCallContext withStreamIdleTimeout( + @Nullable org.threeten.bp.Duration streamIdleTimeout) { + return withStreamIdleTimeoutDuration(toJavaTimeDuration(streamIdleTimeout)); + } + + @Override + public HttpJsonCallContext withStreamIdleTimeoutDuration( + @Nullable java.time.Duration streamIdleTimeout) { if (streamIdleTimeout != null) { Preconditions.checkArgument( - streamIdleTimeout.compareTo(Duration.ZERO) >= 0, "Invalid timeout: < 0 s"); + streamIdleTimeout.compareTo(java.time.Duration.ZERO) >= 0, "Invalid timeout: < 0 s"); } return new HttpJsonCallContext( @@ -312,17 +397,26 @@ public HttpJsonCallContext withStreamIdleTimeout(@Nullable Duration streamIdleTi this.options, this.tracer, this.retrySettings, - this.retryableCodes); + this.retryableCodes, + this.endpointContext); + } + + /** This method is obsolete. Use {@link #getStreamIdleTimeoutDuration()} instead. */ + @Override + @Nullable + @ObsoleteApi("Use getStreamIdleTimeoutDuration() instead") + public org.threeten.bp.Duration getStreamIdleTimeout() { + return toThreetenDuration(getStreamIdleTimeoutDuration()); } /** * The stream idle timeout set for this context. * - * @see ApiCallContext#withStreamIdleTimeout(Duration) + * @see ApiCallContext#withStreamIdleTimeoutDuration(java.time.Duration) */ @Override @Nullable - public Duration getStreamIdleTimeout() { + public java.time.Duration getStreamIdleTimeoutDuration() { return streamIdleTimeout; } @@ -342,7 +436,8 @@ public ApiCallContext withExtraHeaders(Map> extraHeaders) { this.options, this.tracer, this.retrySettings, - this.retryableCodes); + this.retryableCodes, + this.endpointContext); } @BetaApi("The surface for extra headers is not stable yet and may change in the future.") @@ -365,7 +460,8 @@ public ApiCallContext withOption(Key key, T value) { newOptions, this.tracer, this.retrySettings, - this.retryableCodes); + this.retryableCodes, + this.endpointContext); } /** {@inheritDoc} */ @@ -374,6 +470,31 @@ public T getOption(Key key) { return options.getOption(key); } + /** + * Validate the Universe Domain to ensure that the user configured Universe Domain and the + * Credentials' Universe Domain match. An exception will be raised if there are any issues when + * trying to validate (i.e. unable to access the universe domain). + * + * @throws UnauthenticatedException Thrown if the universe domain that the user configured does + * not match the Credential's universe domain or if the client library is unable to retrieve + * the Universe Domain from the Credentials. + */ + @InternalApi + public void validateUniverseDomain() { + try { + endpointContext.validateUniverseDomain( + getCallOptions().getCredentials(), UNAUTHENTICATED_STATUS_CODE); + } catch (IOException e) { + // All instances of IOException from endpointContext's `validateUniverseDomain()` + // call should be an Auth Exception + throw ApiExceptionFactory.createException( + EndpointContext.UNABLE_TO_RETRIEVE_CREDENTIALS_ERROR_MESSAGE, + e, + UNAUTHENTICATED_STATUS_CODE, + false); + } + } + public HttpJsonChannel getChannel() { return channel; } @@ -384,7 +505,7 @@ public HttpJsonCallOptions getCallOptions() { @Deprecated @Nullable - public Instant getDeadline() { + public org.threeten.bp.Instant getDeadline() { return getCallOptions() != null ? getCallOptions().getDeadline() : null; } @@ -411,7 +532,8 @@ public HttpJsonCallContext withRetrySettings(RetrySettings retrySettings) { this.options, this.tracer, retrySettings, - this.retryableCodes); + this.retryableCodes, + this.endpointContext); } @Override @@ -431,7 +553,8 @@ public HttpJsonCallContext withRetryableCodes(Set retryableCode this.options, this.tracer, this.retrySettings, - retryableCodes); + retryableCodes, + this.endpointContext); } public HttpJsonCallContext withChannel(HttpJsonChannel newChannel) { @@ -445,7 +568,8 @@ public HttpJsonCallContext withChannel(HttpJsonChannel newChannel) { this.options, this.tracer, this.retrySettings, - this.retryableCodes); + this.retryableCodes, + this.endpointContext); } public HttpJsonCallContext withCallOptions(HttpJsonCallOptions newCallOptions) { @@ -459,11 +583,12 @@ public HttpJsonCallContext withCallOptions(HttpJsonCallOptions newCallOptions) { this.options, this.tracer, this.retrySettings, - this.retryableCodes); + this.retryableCodes, + this.endpointContext); } @Deprecated - public HttpJsonCallContext withDeadline(Instant newDeadline) { + public HttpJsonCallContext withDeadline(org.threeten.bp.Instant newDeadline) { HttpJsonCallOptions.Builder builder = callOptions != null ? callOptions.toBuilder() : HttpJsonCallOptions.newBuilder(); return withCallOptions(builder.setDeadline(newDeadline).build()); @@ -493,7 +618,8 @@ public HttpJsonCallContext withTracer(@Nonnull ApiTracer newTracer) { this.options, newTracer, this.retrySettings, - this.retryableCodes); + this.retryableCodes, + this.endpointContext); } @Override @@ -512,7 +638,8 @@ public boolean equals(Object o) { && Objects.equals(this.options, that.options) && Objects.equals(this.tracer, that.tracer) && Objects.equals(this.retrySettings, that.retrySettings) - && Objects.equals(this.retryableCodes, that.retryableCodes); + && Objects.equals(this.retryableCodes, that.retryableCodes) + && Objects.equals(this.endpointContext, that.endpointContext); } @Override @@ -525,6 +652,7 @@ public int hashCode() { options, tracer, retrySettings, - retryableCodes); + retryableCodes, + endpointContext); } } diff --git a/gax-java/gax-httpjson/src/main/java/com/google/api/gax/httpjson/HttpJsonCallOptions.java b/gax-java/gax-httpjson/src/main/java/com/google/api/gax/httpjson/HttpJsonCallOptions.java index dbb3cb6259..4c2d8ae55e 100644 --- a/gax-java/gax-httpjson/src/main/java/com/google/api/gax/httpjson/HttpJsonCallOptions.java +++ b/gax-java/gax-httpjson/src/main/java/com/google/api/gax/httpjson/HttpJsonCallOptions.java @@ -29,21 +29,41 @@ */ package com.google.api.gax.httpjson; -import com.google.api.core.BetaApi; +import static com.google.api.gax.util.TimeConversionUtils.toJavaTimeDuration; +import static com.google.api.gax.util.TimeConversionUtils.toJavaTimeInstant; +import static com.google.api.gax.util.TimeConversionUtils.toThreetenDuration; +import static com.google.api.gax.util.TimeConversionUtils.toThreetenInstant; + +import com.google.api.core.ObsoleteApi; import com.google.auth.Credentials; import com.google.auto.value.AutoValue; import com.google.protobuf.TypeRegistry; import javax.annotation.Nullable; -import org.threeten.bp.Instant; /** Options for an http-json call, including deadline and credentials. */ -@BetaApi @AutoValue public abstract class HttpJsonCallOptions { public static final HttpJsonCallOptions DEFAULT = newBuilder().build(); + /** This method is obsolete. Use {@link #getTimeoutDuration()} instead. */ + @Nullable + @ObsoleteApi("Use getTimeoutDuration() instead") + public final org.threeten.bp.Duration getTimeout() { + return toThreetenDuration(getTimeoutDuration()); + } + + @Nullable + public abstract java.time.Duration getTimeoutDuration(); + + /** This method is obsolete. Use {@link #getDeadlineInstant()} instead. */ + @Nullable + @ObsoleteApi("Use getDeadlineInstant() instead") + public final org.threeten.bp.Instant getDeadline() { + return toThreetenInstant(getDeadlineInstant()); + } + @Nullable - public abstract Instant getDeadline(); + public abstract java.time.Instant getDeadlineInstant(); @Nullable public abstract Credentials getCredentials(); @@ -64,9 +84,16 @@ public HttpJsonCallOptions merge(HttpJsonCallOptions inputOptions) { Builder builder = this.toBuilder(); - Instant newDeadline = inputOptions.getDeadline(); + java.time.Instant newDeadline = inputOptions.getDeadlineInstant(); if (newDeadline != null) { - builder.setDeadline(newDeadline); + builder.setDeadlineInstant(newDeadline); + } + + if (inputOptions.getTimeout() != null) { + java.time.Duration newTimeout = inputOptions.getTimeoutDuration(); + if (newTimeout != null) { + builder.setTimeoutDuration(newTimeout); + } } Credentials newCredentials = inputOptions.getCredentials(); @@ -84,7 +111,21 @@ public HttpJsonCallOptions merge(HttpJsonCallOptions inputOptions) { @AutoValue.Builder public abstract static class Builder { - public abstract Builder setDeadline(Instant value); + /** This method is obsolete. Use {@link #setTimeoutDuration(java.time.Duration)} instead. */ + @ObsoleteApi("Use setTimeoutDuration(java.time.Duration) instead") + public final Builder setTimeout(org.threeten.bp.Duration value) { + return setTimeoutDuration(toJavaTimeDuration(value)); + } + + public abstract Builder setTimeoutDuration(java.time.Duration value); + + /** This method is obsolete. Use {@link #setDeadlineInstant(java.time.Instant)} instead. */ + @ObsoleteApi("Use setDeadlineInstant(java.time.Instant) instead") + public final Builder setDeadline(org.threeten.bp.Instant value) { + return setDeadlineInstant(toJavaTimeInstant(value)); + } + + public abstract Builder setDeadlineInstant(java.time.Instant value); public abstract Builder setCredentials(Credentials value); diff --git a/gax-java/gax-httpjson/src/main/java/com/google/api/gax/httpjson/HttpJsonCallSettings.java b/gax-java/gax-httpjson/src/main/java/com/google/api/gax/httpjson/HttpJsonCallSettings.java index ac013ed74a..835fe5c923 100644 --- a/gax-java/gax-httpjson/src/main/java/com/google/api/gax/httpjson/HttpJsonCallSettings.java +++ b/gax-java/gax-httpjson/src/main/java/com/google/api/gax/httpjson/HttpJsonCallSettings.java @@ -29,23 +29,49 @@ */ package com.google.api.gax.httpjson; +import com.google.api.core.BetaApi; +import com.google.api.gax.rpc.RequestMutator; +import com.google.api.gax.rpc.RequestParamsExtractor; +import com.google.api.gax.rpc.ResourceNameExtractor; import com.google.protobuf.TypeRegistry; /** HTTP-specific settings for creating callables. */ public class HttpJsonCallSettings { private final ApiMethodDescriptor methodDescriptor; + private final RequestParamsExtractor paramsExtractor; + private final ResourceNameExtractor resourceNameExtractor; + + private final RequestMutator requestMutator; private final TypeRegistry typeRegistry; - private HttpJsonCallSettings( - ApiMethodDescriptor methodDescriptor, TypeRegistry typeRegistry) { - this.methodDescriptor = methodDescriptor; - this.typeRegistry = typeRegistry; + private HttpJsonCallSettings(Builder builder) { + this.methodDescriptor = builder.methodDescriptor; + this.paramsExtractor = builder.paramsExtractor; + this.resourceNameExtractor = builder.resourceNameExtractor; + this.requestMutator = builder.requestMutator; + this.typeRegistry = builder.typeRegistry; } public ApiMethodDescriptor getMethodDescriptor() { return methodDescriptor; } + public RequestParamsExtractor getParamsExtractor() { + return paramsExtractor; + } + + /** + * Gets the extractor capable of extracting the destination resource name from the RPC request. + */ + @BetaApi + ResourceNameExtractor getResourceNameExtractor() { + return resourceNameExtractor; + } + + public RequestMutator getRequestMutator() { + return requestMutator; + } + public TypeRegistry getTypeRegistry() { return typeRegistry; } @@ -66,13 +92,21 @@ public Builder toBuilder() { } public static class Builder { + + private RequestMutator requestMutator; private ApiMethodDescriptor methodDescriptor; + private RequestParamsExtractor paramsExtractor; + private ResourceNameExtractor resourceNameExtractor; private TypeRegistry typeRegistry; private Builder() {} private Builder(HttpJsonCallSettings settings) { this.methodDescriptor = settings.methodDescriptor; + this.paramsExtractor = settings.paramsExtractor; + this.resourceNameExtractor = settings.resourceNameExtractor; + this.requestMutator = settings.requestMutator; + this.typeRegistry = settings.typeRegistry; } public Builder setMethodDescriptor( @@ -81,13 +115,33 @@ public Builder setMethodDescriptor( return this; } + public Builder setParamsExtractor( + RequestParamsExtractor paramsExtractor) { + this.paramsExtractor = paramsExtractor; + return this; + } + + /** + * Sets the extractor capable of extracting the destination resource name from the RPC request. + */ + public Builder setResourceNameExtractor( + ResourceNameExtractor resourceNameExtractor) { + this.resourceNameExtractor = resourceNameExtractor; + return this; + } + + public Builder setRequestMutator(RequestMutator requestMutator) { + this.requestMutator = requestMutator; + return this; + } + public Builder setTypeRegistry(TypeRegistry typeRegistry) { this.typeRegistry = typeRegistry; return this; } public HttpJsonCallSettings build() { - return new HttpJsonCallSettings<>(methodDescriptor, typeRegistry); + return new HttpJsonCallSettings<>(this); } } } diff --git a/gax-java/gax-httpjson/src/main/java/com/google/api/gax/httpjson/HttpJsonCallableFactory.java b/gax-java/gax-httpjson/src/main/java/com/google/api/gax/httpjson/HttpJsonCallableFactory.java index 6131c911f8..447fc46dd9 100644 --- a/gax-java/gax-httpjson/src/main/java/com/google/api/gax/httpjson/HttpJsonCallableFactory.java +++ b/gax-java/gax-httpjson/src/main/java/com/google/api/gax/httpjson/HttpJsonCallableFactory.java @@ -29,11 +29,12 @@ */ package com.google.api.gax.httpjson; -import com.google.api.core.InternalApi; +import com.google.api.core.ObsoleteApi; import com.google.api.gax.longrunning.OperationSnapshot; import com.google.api.gax.rpc.BatchingCallSettings; import com.google.api.gax.rpc.Callables; import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.LibraryMetadata; import com.google.api.gax.rpc.LongRunningClient; import com.google.api.gax.rpc.OperationCallSettings; import com.google.api.gax.rpc.OperationCallable; @@ -42,28 +43,51 @@ import com.google.api.gax.rpc.ServerStreamingCallable; import com.google.api.gax.rpc.UnaryCallSettings; import com.google.api.gax.rpc.UnaryCallable; -import com.google.api.gax.tracing.SpanName; +import com.google.api.gax.tracing.ApiTracerContext; import com.google.api.gax.tracing.TracedUnaryCallable; -import com.google.common.base.Preconditions; -import java.util.regex.Matcher; -import java.util.regex.Pattern; import javax.annotation.Nonnull; /** Class with utility methods to create http/json-based direct callables. */ public class HttpJsonCallableFactory { - // Used to extract service and method name from a grpc MethodDescriptor. - // fullMethodName has the format: service.resource.action - // For example: compute.instances.addAccessConfig - private static final Pattern FULL_METHOD_NAME_REGEX = Pattern.compile("^(.+)\\.(.+)$"); private HttpJsonCallableFactory() {} private static UnaryCallable createDirectUnaryCallable( HttpJsonCallSettings httpJsonCallSettings) { - return new HttpJsonDirectCallable( - httpJsonCallSettings.getMethodDescriptor(), httpJsonCallSettings.getTypeRegistry()); + UnaryCallable callable = + new HttpJsonDirectCallable<>( + httpJsonCallSettings.getMethodDescriptor(), httpJsonCallSettings.getTypeRegistry()); + + if (httpJsonCallSettings.getParamsExtractor() != null) { + callable = + new HttpJsonUnaryRequestParamCallable<>( + callable, httpJsonCallSettings.getParamsExtractor()); + } + return callable; + } + + /** Create httpJson UnaryCallable with request mutator. */ + static UnaryCallable createUnaryCallable( + UnaryCallable innerCallable, + UnaryCallSettings callSettings, + HttpJsonCallSettings httpJsonCallSettings, + ClientContext clientContext) { + UnaryCallable callable = + new HttpJsonExceptionCallable<>(innerCallable, callSettings.getRetryableCodes()); + callable = + Callables.retrying( + callable, callSettings, clientContext, httpJsonCallSettings.getRequestMutator()); + callable = + new TracedUnaryCallable<>( + callable, + clientContext.getTracerFactory(), + getApiTracerContext(httpJsonCallSettings.getMethodDescriptor()), + httpJsonCallSettings.getResourceNameExtractor()); + return callable.withDefaultCallContext(clientContext.getDefaultCallContext()); } + /** Use {@link #createUnaryCallable createUnaryCallable} method instead. */ + @ObsoleteApi("Please use other httpJson UnaryCallable method instead") static UnaryCallable createUnaryCallable( UnaryCallable innerCallable, UnaryCallSettings callSettings, @@ -88,7 +112,9 @@ public static UnaryCallable createBas ClientContext clientContext) { UnaryCallable callable = createDirectUnaryCallable(httpJsonCallSettings); callable = new HttpJsonExceptionCallable<>(callable, callSettings.getRetryableCodes()); - callable = Callables.retrying(callable, callSettings, clientContext); + callable = + Callables.retrying( + callable, callSettings, clientContext, httpJsonCallSettings.getRequestMutator()); return callable; } @@ -109,13 +135,7 @@ public static UnaryCallable createUna UnaryCallable innerCallable = createDirectUnaryCallable(httpJsonCallSettings); - innerCallable = - new TracedUnaryCallable<>( - innerCallable, - clientContext.getTracerFactory(), - getSpanName(httpJsonCallSettings.getMethodDescriptor())); - - return createUnaryCallable(innerCallable, callSettings, clientContext); + return createUnaryCallable(innerCallable, callSettings, httpJsonCallSettings, clientContext); } /** @@ -133,7 +153,8 @@ UnaryCallable createPagedCallable( PagedCallSettings pagedCallSettings, ClientContext clientContext) { UnaryCallable callable = createDirectUnaryCallable(httpJsonCallSettings); - callable = createUnaryCallable(callable, pagedCallSettings, clientContext); + callable = + createUnaryCallable(callable, pagedCallSettings, httpJsonCallSettings, clientContext); UnaryCallable pagedCallable = Callables.paged(callable, pagedCallSettings); return pagedCallable.withDefaultCallContext(clientContext.getDefaultCallContext()); @@ -154,7 +175,8 @@ public static UnaryCallable createBat BatchingCallSettings batchingCallSettings, ClientContext clientContext) { UnaryCallable callable = createDirectUnaryCallable(httpJsonCallSettings); - callable = createUnaryCallable(callable, batchingCallSettings, clientContext); + callable = + createUnaryCallable(callable, batchingCallSettings, httpJsonCallSettings, clientContext); callable = Callables.batching(callable, batchingCallSettings, clientContext); return callable.withDefaultCallContext(clientContext.getDefaultCallContext()); } @@ -180,6 +202,12 @@ ServerStreamingCallable createServerStreamingCallable( ServerStreamingCallable callable = new HttpJsonDirectServerStreamingCallable<>(httpJsoncallSettings.getMethodDescriptor()); + if (httpJsoncallSettings.getParamsExtractor() != null) { + callable = + new HttpJsonServerStreamingRequestParamCallable<>( + callable, httpJsoncallSettings.getParamsExtractor()); + } + callable = new HttpJsonExceptionServerStreamingCallable<>( callable, streamingCallSettings.getRetryableCodes()); @@ -192,11 +220,13 @@ ServerStreamingCallable createServerStreamingCallable( return callable.withDefaultCallContext(clientContext.getDefaultCallContext()); } - @InternalApi("Visible for testing") - static SpanName getSpanName(@Nonnull ApiMethodDescriptor methodDescriptor) { - Matcher matcher = FULL_METHOD_NAME_REGEX.matcher(methodDescriptor.getFullMethodName()); - - Preconditions.checkArgument(matcher.matches(), "Invalid fullMethodName"); - return SpanName.of(matcher.group(1), matcher.group(2)); + static ApiTracerContext getApiTracerContext(@Nonnull ApiMethodDescriptor methodDescriptor) { + return ApiTracerContext.newBuilder() + .setFullMethodName(methodDescriptor.getFullMethodName()) + .setHttpMethod(methodDescriptor.getHttpMethod()) + .setHttpPathTemplate(methodDescriptor.getRequestFormatter().getPathTemplate().toRawString()) + .setTransport(ApiTracerContext.Transport.HTTP) + .setLibraryMetadata(LibraryMetadata.empty()) + .build(); } } diff --git a/gax-java/gax-httpjson/src/main/java/com/google/api/gax/httpjson/HttpJsonChannel.java b/gax-java/gax-httpjson/src/main/java/com/google/api/gax/httpjson/HttpJsonChannel.java index 96db96b469..bea8c5ea80 100644 --- a/gax-java/gax-httpjson/src/main/java/com/google/api/gax/httpjson/HttpJsonChannel.java +++ b/gax-java/gax-httpjson/src/main/java/com/google/api/gax/httpjson/HttpJsonChannel.java @@ -29,10 +29,7 @@ */ package com.google.api.gax.httpjson; -import com.google.api.core.BetaApi; - /** HttpJsonChannel contains the functionality to issue http-json calls. */ -@BetaApi public interface HttpJsonChannel { HttpJsonClientCall newCall( ApiMethodDescriptor methodDescriptor, HttpJsonCallOptions callOptions); diff --git a/gax-java/gax-httpjson/src/main/java/com/google/api/gax/httpjson/HttpJsonClientCall.java b/gax-java/gax-httpjson/src/main/java/com/google/api/gax/httpjson/HttpJsonClientCall.java index 16ecd67952..e70a6eb857 100644 --- a/gax-java/gax-httpjson/src/main/java/com/google/api/gax/httpjson/HttpJsonClientCall.java +++ b/gax-java/gax-httpjson/src/main/java/com/google/api/gax/httpjson/HttpJsonClientCall.java @@ -29,7 +29,6 @@ */ package com.google.api.gax.httpjson; -import com.google.api.core.BetaApi; import javax.annotation.Nullable; // This class mimics the structure and behavior of the corresponding ClientCall from gRPC package as @@ -58,7 +57,6 @@ * @param type of message sent to the server * @param type of message received one or more times from the server */ -@BetaApi public abstract class HttpJsonClientCall { /** * Callbacks for receiving metadata, response messages and completion status from the server. @@ -67,7 +65,6 @@ public abstract class HttpJsonClientCall { * not required to be thread-safe, but they must not be thread-hostile. The caller is free to call * an instance from multiple threads, but only one call simultaneously. */ - @BetaApi public abstract static class Listener { /** * The response headers have been received. Headers always precede messages. diff --git a/gax-java/gax-httpjson/src/main/java/com/google/api/gax/httpjson/HttpJsonClientCallImpl.java b/gax-java/gax-httpjson/src/main/java/com/google/api/gax/httpjson/HttpJsonClientCallImpl.java index 9f52712b2e..df9a507519 100644 --- a/gax-java/gax-httpjson/src/main/java/com/google/api/gax/httpjson/HttpJsonClientCallImpl.java +++ b/gax-java/gax-httpjson/src/main/java/com/google/api/gax/httpjson/HttpJsonClientCallImpl.java @@ -33,7 +33,9 @@ import com.google.api.gax.httpjson.ApiMethodDescriptor.MethodType; import com.google.api.gax.httpjson.HttpRequestRunnable.ResultListener; import com.google.api.gax.httpjson.HttpRequestRunnable.RunnableResult; +import com.google.api.gax.rpc.StatusCode; import com.google.common.base.Preconditions; +import com.google.errorprone.annotations.concurrent.GuardedBy; import java.io.IOException; import java.io.InputStreamReader; import java.io.Reader; @@ -42,8 +44,10 @@ import java.util.Queue; import java.util.concurrent.CancellationException; import java.util.concurrent.Executor; +import java.util.concurrent.ScheduledExecutorService; +import java.util.concurrent.ScheduledFuture; +import java.util.concurrent.TimeUnit; import javax.annotation.Nullable; -import javax.annotation.concurrent.GuardedBy; /** * This class serves as main implementation of {@link HttpJsonClientCall} for REST transport and is @@ -88,6 +92,7 @@ final class HttpJsonClientCallImpl private final ApiMethodDescriptor methodDescriptor; private final HttpTransport httpTransport; private final Executor executor; + private final ScheduledExecutorService deadlineCancellationExecutor; // // Request-specific data (provided by client code) before we get a response. @@ -114,19 +119,28 @@ final class HttpJsonClientCallImpl private ProtoMessageJsonStreamIterator responseStreamIterator; @GuardedBy("lock") - private boolean closed; + private volatile boolean closed; + + // Store the timeout future created by the deadline schedule executor. The future + // can be cancelled if a response (either an error or valid payload) has been + // received before the timeout. This value may be null if the RPC does not have a + // timeout. + @GuardedBy("lock") + private volatile ScheduledFuture timeoutFuture; HttpJsonClientCallImpl( ApiMethodDescriptor methodDescriptor, String endpoint, HttpJsonCallOptions callOptions, HttpTransport httpTransport, - Executor executor) { + Executor executor, + ScheduledExecutorService deadlineCancellationExecutor) { this.methodDescriptor = methodDescriptor; this.endpoint = endpoint; this.callOptions = callOptions; this.httpTransport = httpTransport; this.executor = executor; + this.deadlineCancellationExecutor = deadlineCancellationExecutor; this.closed = false; } @@ -160,7 +174,43 @@ public void start(Listener responseListener, HttpJsonMetadata request Preconditions.checkState(this.listener == null, "The call is already started"); this.listener = responseListener; this.requestHeaders = requestHeaders; + + // Use the timeout duration value instead of calculating the future Instant + // Only schedule the deadline if the RPC timeout has been set in the RetrySettings + java.time.Duration timeout = callOptions.getTimeoutDuration(); + if (timeout != null) { + // The future timeout value is guaranteed to not be a negative value as the + // RetryAlgorithm will not retry + long timeoutMs = timeout.toMillis(); + // Assign the scheduled future so that it can be cancelled if the timeout task + // is not needed (response received prior to timeout) + timeoutFuture = + this.deadlineCancellationExecutor.schedule( + this::timeout, timeoutMs, TimeUnit.MILLISECONDS); + } + } + } + + // Notify the FutureListener that the there is a timeout exception from this RPC + // call (DEADLINE_EXCEEDED). For retrying RPCs, this code is returned for every attempt + // that exceeds the timeout. The RetryAlgorithm will check both the timing and code to + // ensure another attempt is made. + private void timeout() { + // There is a race between the deadline scheduler and response being returned from + // the server. The deadline scheduler has priority as it will clear out the pending + // notifications queue and add the DEADLINE_EXCEEDED event once it is able to obtain + // the lock. + synchronized (lock) { + close( + StatusCode.Code.DEADLINE_EXCEEDED.getHttpStatusCode(), + "Deadline exceeded", + new HttpJsonStatusRuntimeException( + StatusCode.Code.DEADLINE_EXCEEDED.getHttpStatusCode(), "Deadline exceeded", null), + true); } + + // trigger delivery loop if not already running + deliver(); } @Override @@ -260,9 +310,10 @@ private void deliver() { throw new InterruptedException("Message delivery has been interrupted"); } - // All listeners must be called under delivery loop (but outside the lock) to ensure that no - // two notifications come simultaneously from two different threads and that we do not go - // indefinitely deep in the stack if delivery logic is called recursively via listeners. + // All listeners must be called under delivery loop (but outside the lock) to ensure that + // no two notifications come simultaneously from two different threads and that we do not + // go indefinitely deep in the stack if delivery logic is called recursively via + // listeners. notifyListeners(); // The synchronized block around message reading and cancellation notification processing @@ -302,7 +353,7 @@ private void deliver() { inDelivery = false; break; } else { - // We still have some stuff in notiticationTasksQueue so continue the loop, most + // We still have some stuff in notificationTasksQueue so continue the loop, most // likely we will finally terminate on the next cycle. continue; } @@ -319,8 +370,8 @@ private void deliver() { // can do in such an unlikely situation (otherwise we would stay forever in the delivery // loop). synchronized (lock) { - // Close the call immediately marking it cancelled. If already closed close() will have no - // effect. + // Close the call immediately marking it cancelled. If already closed, close() will have + // no effect. close(ex.getStatusCode(), ex.getMessage(), ex, true); } } @@ -352,7 +403,7 @@ private boolean consumeMessageFromStream() throws IOException { boolean allMessagesConsumed; Reader responseReader; if (methodDescriptor.getType() == MethodType.SERVER_STREAMING) { - // Lazily initialize responseStreamIterator in case if it is a server steraming response + // Lazily initialize responseStreamIterator in case if it is a server streaming response if (responseStreamIterator == null) { responseStreamIterator = new ProtoMessageJsonStreamIterator( @@ -384,12 +435,22 @@ private boolean consumeMessageFromStream() throws IOException { @GuardedBy("lock") private void close( - int statusCode, String message, Throwable cause, boolean terminateImmediatelly) { + int statusCode, String message, Throwable cause, boolean terminateImmediately) { try { if (closed) { return; } closed = true; + + // Cancel the timeout future if there is a timeout associated with the RPC + if (timeoutFuture != null) { + // The timeout method also invokes close() and the second invocation of close() + // will be guarded by the closed check above. No need to interrupt the timeout + // task as running the timeout task is quick. + timeoutFuture.cancel(false); + timeoutFuture = null; + } + // Best effort task cancellation (to not be confused with task's thread interruption). // If the task is in blocking I/O waiting for the server response, it will keep waiting for // the response from the server, but once response is received the task will exit silently. @@ -399,12 +460,12 @@ private void close( requestRunnable = null; } - HttpJsonMetadata.Builder meatadaBuilder = HttpJsonMetadata.newBuilder(); + HttpJsonMetadata.Builder metadataBuilder = HttpJsonMetadata.newBuilder(); if (runnableResult != null && runnableResult.getTrailers() != null) { - meatadaBuilder = runnableResult.getTrailers().toBuilder(); + metadataBuilder = runnableResult.getTrailers().toBuilder(); } - meatadaBuilder.setException(cause); - meatadaBuilder.setStatusMessage(message); + metadataBuilder.setException(cause); + metadataBuilder.setStatusMessage(message); if (responseStreamIterator != null) { responseStreamIterator.close(); } @@ -415,7 +476,7 @@ private void close( // onClose() suppresses all other pending notifications. // there should be no place in the code which inserts something in this queue before checking // the `closed` flag under the lock and refusing to insert anything if `closed == true`. - if (terminateImmediatelly) { + if (terminateImmediately) { // This usually means we are cancelling the call before processing the response in full. // It may happen if a user explicitly cancels the call or in response to an unexpected // exception either from server or a call listener execution. @@ -423,11 +484,11 @@ private void close( } pendingNotifications.offer( - new OnCloseNotificationTask<>(listener, statusCode, meatadaBuilder.build())); + new OnCloseNotificationTask<>(listener, statusCode, metadataBuilder.build())); } catch (Throwable e) { // suppress stream closing exceptions in favor of the actual call closing cause. This method - // should not throw, otherwise we may stuck in an infinite loop of exception processing. + // should not throw, otherwise we may be stuck in an infinite loop of exception processing. } } diff --git a/gax-java/gax-httpjson/src/main/java/com/google/api/gax/httpjson/HttpJsonClientCalls.java b/gax-java/gax-httpjson/src/main/java/com/google/api/gax/httpjson/HttpJsonClientCalls.java index 1b6ab41d7f..c98d00afb9 100644 --- a/gax-java/gax-httpjson/src/main/java/com/google/api/gax/httpjson/HttpJsonClientCalls.java +++ b/gax-java/gax-httpjson/src/main/java/com/google/api/gax/httpjson/HttpJsonClientCalls.java @@ -34,11 +34,9 @@ import com.google.api.gax.rpc.ApiCallContext; import java.util.logging.Level; import java.util.logging.Logger; -import javax.annotation.Nonnull; -import org.threeten.bp.Instant; /** - * {@code HttpJsonClientCalls} creates a new {@code HttpJsonClientCAll} from the given call context. + * {@code HttpJsonClientCalls} creates a new {@code HttpJsonClientCall} from the given call context. * *

        Package-private for internal use. */ @@ -50,25 +48,47 @@ public static HttpJsonClientCall newC HttpJsonCallContext httpJsonContext = HttpJsonCallContext.createDefault().nullToSelf(context); - // Try to convert the timeout into a deadline and use it if it occurs before the actual deadline - if (httpJsonContext.getTimeout() != null) { - @Nonnull Instant newDeadline = Instant.now().plus(httpJsonContext.getTimeout()); + // Use the context's timeout instead of calculating a future deadline with the System clock. + // The timeout value is calculated from TimedAttemptSettings which accounts for the + // TotalTimeout value set in the RetrySettings. + if (httpJsonContext.getTimeoutDuration() != null) { HttpJsonCallOptions callOptions = httpJsonContext.getCallOptions(); - if (callOptions.getDeadline() == null || newDeadline.isBefore(callOptions.getDeadline())) { - callOptions = callOptions.toBuilder().setDeadline(newDeadline).build(); - httpJsonContext = httpJsonContext.withCallOptions(callOptions); + // HttpJsonChannel expects the HttpJsonCallOptions and we store the timeout duration + // inside the HttpJsonCallOptions + // Note: There is manual conversion between threetenbp's Duration and java.util.Duration + // This is temporary here as we plan to migrate to java.util.Duration + if (callOptions.getTimeoutDuration() == null + || httpJsonContext + .getTimeoutDuration() + .compareTo( + java.time.Duration.ofMillis(callOptions.getTimeoutDuration().toMillis())) + < 0) { + callOptions = + callOptions.toBuilder() + .setTimeoutDuration( + java.time.Duration.ofMillis(httpJsonContext.getTimeoutDuration().toMillis())) + .build(); } + httpJsonContext = httpJsonContext.withCallOptions(callOptions); } + // Validate the Universe Domain prior to the call. Only allow the call to go through + // if the Universe Domain is valid. + httpJsonContext.validateUniverseDomain(); + // TODO: add headers interceptor logic return httpJsonContext.getChannel().newCall(methodDescriptor, httpJsonContext.getCallOptions()); } static ApiFuture futureUnaryCall( - HttpJsonClientCall clientCall, RequestT request) { + HttpJsonClientCall clientCall, + RequestT request, + HttpJsonCallContext context) { // Start the call HttpJsonFuture future = new HttpJsonFuture<>(clientCall); - clientCall.start(new FutureListener<>(future), HttpJsonMetadata.newBuilder().build()); + clientCall.start( + new FutureListener<>(future), + HttpJsonMetadata.newBuilder().build().withHeaders(context.getExtraHeaders())); // Send the request try { diff --git a/gax-java/gax-httpjson/src/main/java/com/google/api/gax/httpjson/HttpJsonClientInterceptor.java b/gax-java/gax-httpjson/src/main/java/com/google/api/gax/httpjson/HttpJsonClientInterceptor.java index 446fe09f29..08dbe2970b 100644 --- a/gax-java/gax-httpjson/src/main/java/com/google/api/gax/httpjson/HttpJsonClientInterceptor.java +++ b/gax-java/gax-httpjson/src/main/java/com/google/api/gax/httpjson/HttpJsonClientInterceptor.java @@ -29,8 +29,6 @@ */ package com.google.api.gax.httpjson; -import com.google.api.core.BetaApi; - /** * Interface for intercepting outgoing calls before they are dispatched by a {@link * HttpJsonChannel}. @@ -38,7 +36,6 @@ *

        The interceptor may be called for multiple {@link HttpJsonClientCall calls} by one or more * threads without completing the previous ones first. The implementations must be thread-safe. */ -@BetaApi public interface HttpJsonClientInterceptor { /** * Intercept {@link HttpJsonClientCall} creation by the {@code next} {@link HttpJsonChannel}. diff --git a/gax-java/gax-httpjson/src/main/java/com/google/api/gax/httpjson/HttpJsonDirectCallable.java b/gax-java/gax-httpjson/src/main/java/com/google/api/gax/httpjson/HttpJsonDirectCallable.java index c631ca60c8..abf3290067 100644 --- a/gax-java/gax-httpjson/src/main/java/com/google/api/gax/httpjson/HttpJsonDirectCallable.java +++ b/gax-java/gax-httpjson/src/main/java/com/google/api/gax/httpjson/HttpJsonDirectCallable.java @@ -65,7 +65,7 @@ public ApiFuture futureCall(RequestT request, ApiCallContext inputCon HttpJsonClientCall clientCall = HttpJsonClientCalls.newCall(descriptor, context); - return HttpJsonClientCalls.futureUnaryCall(clientCall, request); + return HttpJsonClientCalls.futureUnaryCall(clientCall, request, context); } @Override diff --git a/gax-java/gax-httpjson/src/main/java/com/google/api/gax/httpjson/HttpJsonDirectServerStreamingCallable.java b/gax-java/gax-httpjson/src/main/java/com/google/api/gax/httpjson/HttpJsonDirectServerStreamingCallable.java index ed3bebde31..2f98ac177e 100644 --- a/gax-java/gax-httpjson/src/main/java/com/google/api/gax/httpjson/HttpJsonDirectServerStreamingCallable.java +++ b/gax-java/gax-httpjson/src/main/java/com/google/api/gax/httpjson/HttpJsonDirectServerStreamingCallable.java @@ -64,6 +64,6 @@ public void call( HttpJsonClientCall call = HttpJsonClientCalls.newCall(descriptor, context); HttpJsonDirectStreamController controller = new HttpJsonDirectStreamController<>(call, responseObserver); - controller.start(request); + controller.start(request, context); } } diff --git a/gax-java/gax-httpjson/src/main/java/com/google/api/gax/httpjson/HttpJsonDirectStreamController.java b/gax-java/gax-httpjson/src/main/java/com/google/api/gax/httpjson/HttpJsonDirectStreamController.java index 5f56390f04..9e1b23b257 100644 --- a/gax-java/gax-httpjson/src/main/java/com/google/api/gax/httpjson/HttpJsonDirectStreamController.java +++ b/gax-java/gax-httpjson/src/main/java/com/google/api/gax/httpjson/HttpJsonDirectStreamController.java @@ -29,6 +29,7 @@ */ package com.google.api.gax.httpjson; +import com.google.api.gax.rpc.ApiCallContext; import com.google.api.gax.rpc.ResponseObserver; import com.google.api.gax.rpc.StreamController; import com.google.common.base.Preconditions; @@ -80,10 +81,12 @@ public void request(int count) { } } - void start(RequestT request) { + void start(RequestT request, ApiCallContext context) { responseObserver.onStart(this); this.hasStarted = true; - clientCall.start(new ResponseObserverAdapter(), HttpJsonMetadata.newBuilder().build()); + clientCall.start( + new ResponseObserverAdapter(), + HttpJsonMetadata.newBuilder().build().withHeaders(context.getExtraHeaders())); if (autoflowControl) { clientCall.request(1); diff --git a/gax-java/gax-httpjson/src/main/java/com/google/api/gax/httpjson/HttpJsonErrorParser.java b/gax-java/gax-httpjson/src/main/java/com/google/api/gax/httpjson/HttpJsonErrorParser.java new file mode 100644 index 0000000000..329a7542b9 --- /dev/null +++ b/gax-java/gax-httpjson/src/main/java/com/google/api/gax/httpjson/HttpJsonErrorParser.java @@ -0,0 +1,122 @@ +/* + * Copyright 2026 Google LLC + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Google LLC nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +package com.google.api.gax.httpjson; + +import com.google.api.core.InternalApi; +import com.google.api.gax.rpc.ErrorDetails; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParser; +import com.google.gson.JsonSyntaxException; +import com.google.protobuf.InvalidProtocolBufferException; +import com.google.protobuf.TypeRegistry; +import com.google.protobuf.util.JsonFormat; +import com.google.rpc.BadRequest; +import com.google.rpc.DebugInfo; +import com.google.rpc.ErrorInfo; +import com.google.rpc.Help; +import com.google.rpc.LocalizedMessage; +import com.google.rpc.PreconditionFailure; +import com.google.rpc.QuotaFailure; +import com.google.rpc.RequestInfo; +import com.google.rpc.ResourceInfo; +import com.google.rpc.RetryInfo; +import com.google.rpc.Status; + +/** + * Utility for parsing Google Cloud error responses from JSON. + * + *

        This parser extracts {@link ErrorDetails} from a standard Google Cloud error response JSON + * payload as defined in AIP-193. The payload typically + * contains a top-level "error" object with a "details" list. + */ +@InternalApi +class HttpJsonErrorParser { + + private static final TypeRegistry STANDARD_ERROR_TYPES = + TypeRegistry.newBuilder() + .add(ErrorInfo.getDescriptor()) + .add(RetryInfo.getDescriptor()) + .add(DebugInfo.getDescriptor()) + .add(QuotaFailure.getDescriptor()) + .add(PreconditionFailure.getDescriptor()) + .add(BadRequest.getDescriptor()) + .add(RequestInfo.getDescriptor()) + .add(ResourceInfo.getDescriptor()) + .add(Help.getDescriptor()) + .add(LocalizedMessage.getDescriptor()) + .build(); + private static final JsonFormat.Parser JSON_PARSER = + JsonFormat.parser().ignoringUnknownFields().usingTypeRegistry(STANDARD_ERROR_TYPES); + + /** + * Parses the given JSON error payload into {@link Status}. + * + * @param errorJson The JSON string representing a Google Cloud error response. + * @return A {@link Status} message containing the parsed error information. Returns {@link + * Status#getDefaultInstance()} if the input is null, empty, or invalid. + */ + static Status parseStatus(String errorJson) { + if (errorJson == null || errorJson.isEmpty()) { + return Status.getDefaultInstance(); + } + + JsonElement jsonElement; + try { + jsonElement = JsonParser.parseString(errorJson); + } catch (JsonSyntaxException e) { + return Status.getDefaultInstance(); + } + + if (!jsonElement.isJsonObject()) { + return Status.getDefaultInstance(); + } + JsonObject root = jsonElement.getAsJsonObject(); + if (!root.has("error")) { + return Status.getDefaultInstance(); + } + + JsonElement errorElement = root.get("error"); + if (!errorElement.isJsonObject()) { + return Status.getDefaultInstance(); + } + + Status.Builder statusBuilder = Status.newBuilder(); + try { + JSON_PARSER.merge(errorElement.toString(), statusBuilder); + } catch (InvalidProtocolBufferException e) { + return Status.getDefaultInstance(); + } + + return statusBuilder.build(); + } +} diff --git a/gax-java/gax-httpjson/src/main/java/com/google/api/gax/httpjson/HttpJsonHeaderEnhancer.java b/gax-java/gax-httpjson/src/main/java/com/google/api/gax/httpjson/HttpJsonHeaderEnhancer.java index 897fecf8f2..0efa599b8b 100644 --- a/gax-java/gax-httpjson/src/main/java/com/google/api/gax/httpjson/HttpJsonHeaderEnhancer.java +++ b/gax-java/gax-httpjson/src/main/java/com/google/api/gax/httpjson/HttpJsonHeaderEnhancer.java @@ -30,10 +30,8 @@ package com.google.api.gax.httpjson; import com.google.api.client.http.HttpHeaders; -import com.google.api.core.BetaApi; /** Interface for functionality to enhance headers for an http-json call. */ -@BetaApi public interface HttpJsonHeaderEnhancer { void enhance(HttpHeaders headers); } diff --git a/gax-java/gax-httpjson/src/main/java/com/google/api/gax/httpjson/HttpJsonHeaderEnhancers.java b/gax-java/gax-httpjson/src/main/java/com/google/api/gax/httpjson/HttpJsonHeaderEnhancers.java index 3d3deda300..074cfc29b2 100644 --- a/gax-java/gax-httpjson/src/main/java/com/google/api/gax/httpjson/HttpJsonHeaderEnhancers.java +++ b/gax-java/gax-httpjson/src/main/java/com/google/api/gax/httpjson/HttpJsonHeaderEnhancers.java @@ -30,10 +30,8 @@ package com.google.api.gax.httpjson; import com.google.api.client.http.HttpHeaders; -import com.google.api.core.BetaApi; /** Utility class that creates instances of {@link HttpJsonHeaderEnhancer}. */ -@BetaApi public class HttpJsonHeaderEnhancers { private HttpJsonHeaderEnhancers() {} diff --git a/gax-java/gax-httpjson/src/main/java/com/google/api/gax/httpjson/HttpJsonInterceptorProvider.java b/gax-java/gax-httpjson/src/main/java/com/google/api/gax/httpjson/HttpJsonInterceptorProvider.java index 4c5ddb4750..e8bb906d69 100644 --- a/gax-java/gax-httpjson/src/main/java/com/google/api/gax/httpjson/HttpJsonInterceptorProvider.java +++ b/gax-java/gax-httpjson/src/main/java/com/google/api/gax/httpjson/HttpJsonInterceptorProvider.java @@ -29,12 +29,9 @@ */ package com.google.api.gax.httpjson; -import com.google.api.core.BetaApi; import java.util.List; /** Provider of custom REST ClientInterceptors. */ -@BetaApi( - "The surface for adding custom interceptors is not stable yet and may change in the future.") public interface HttpJsonInterceptorProvider { /** diff --git a/gax-java/gax-httpjson/src/main/java/com/google/api/gax/httpjson/HttpJsonLoggingInterceptor.java b/gax-java/gax-httpjson/src/main/java/com/google/api/gax/httpjson/HttpJsonLoggingInterceptor.java new file mode 100644 index 0000000000..5a1b1b8c2b --- /dev/null +++ b/gax-java/gax-httpjson/src/main/java/com/google/api/gax/httpjson/HttpJsonLoggingInterceptor.java @@ -0,0 +1,116 @@ +/* + * Copyright 2025 Google LLC + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Google LLC nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +package com.google.api.gax.httpjson; + +import static com.google.api.gax.logging.LoggingUtils.logRequest; +import static com.google.api.gax.logging.LoggingUtils.logResponse; +import static com.google.api.gax.logging.LoggingUtils.recordResponseHeaders; +import static com.google.api.gax.logging.LoggingUtils.recordResponsePayload; +import static com.google.api.gax.logging.LoggingUtils.recordServiceRpcAndRequestHeaders; + +import com.google.api.core.InternalApi; +import com.google.api.gax.httpjson.ForwardingHttpJsonClientCall.SimpleForwardingHttpJsonClientCall; +import com.google.api.gax.httpjson.ForwardingHttpJsonClientCallListener.SimpleForwardingHttpJsonClientCallListener; +import com.google.api.gax.logging.LogData; +import com.google.api.gax.logging.LoggerProvider; +import java.util.HashMap; +import java.util.Map; + +@InternalApi +public class HttpJsonLoggingInterceptor implements HttpJsonClientInterceptor { + + private static final LoggerProvider LOGGER_PROVIDER = + LoggerProvider.forClazz(HttpJsonLoggingInterceptor.class); + + @Override + public HttpJsonClientCall interceptCall( + ApiMethodDescriptor method, + HttpJsonCallOptions callOptions, + HttpJsonChannel next) { + + String endpoint = ((ManagedHttpJsonChannel) next).getEndpoint(); + + return new SimpleForwardingHttpJsonClientCall(next.newCall(method, callOptions)) { + + LogData.Builder logDataBuilder = LogData.builder(); + + @Override + public void start( + HttpJsonClientCall.Listener responseListener, HttpJsonMetadata headers) { + recordServiceRpcAndRequestHeaders( + null, // service name is not available for http requests + method.getFullMethodName(), + endpoint, + httpJsonMetadataToMap(headers), + logDataBuilder, + LOGGER_PROVIDER); + + Listener forwardingResponseListener = + new SimpleForwardingHttpJsonClientCallListener(responseListener) { + + @Override + public void onHeaders(HttpJsonMetadata responseHeaders) { + recordResponseHeaders( + httpJsonMetadataToMap(responseHeaders), logDataBuilder, LOGGER_PROVIDER); + super.onHeaders(responseHeaders); + } + + @Override + public void onMessage(RespT message) { + recordResponsePayload(message, logDataBuilder, LOGGER_PROVIDER); + super.onMessage(message); + } + + @Override + public void onClose(int statusCode, HttpJsonMetadata trailers) { + logResponse(String.valueOf(statusCode), logDataBuilder, LOGGER_PROVIDER); + super.onClose(statusCode, trailers); + } + }; + super.start(forwardingResponseListener, headers); + } + + @Override + public void sendMessage(ReqT message) { + logRequest(message, logDataBuilder, LOGGER_PROVIDER); + super.sendMessage(message); + } + }; + } + + // Helper methods for logging, + + private static Map httpJsonMetadataToMap(HttpJsonMetadata headers) { + Map headersMap = new HashMap<>(); + headers.getHeaders().forEach((key, value) -> headersMap.put(key, value.toString())); + return headersMap; + } +} diff --git a/gax-java/gax-httpjson/src/main/java/com/google/api/gax/httpjson/HttpJsonMetadata.java b/gax-java/gax-httpjson/src/main/java/com/google/api/gax/httpjson/HttpJsonMetadata.java index 9fef6db5c5..558217a9b0 100644 --- a/gax-java/gax-httpjson/src/main/java/com/google/api/gax/httpjson/HttpJsonMetadata.java +++ b/gax-java/gax-httpjson/src/main/java/com/google/api/gax/httpjson/HttpJsonMetadata.java @@ -29,15 +29,15 @@ */ package com.google.api.gax.httpjson; -import com.google.api.core.BetaApi; import com.google.api.core.InternalExtensionOnly; import com.google.auto.value.AutoValue; import java.util.Collections; +import java.util.HashMap; +import java.util.List; import java.util.Map; import javax.annotation.Nullable; @AutoValue -@BetaApi @InternalExtensionOnly public abstract class HttpJsonMetadata { public abstract Map getHeaders(); @@ -54,6 +54,22 @@ public static HttpJsonMetadata.Builder newBuilder() { return new AutoValue_HttpJsonMetadata.Builder().setHeaders(Collections.emptyMap()); } + public HttpJsonMetadata withHeaders(Map> headers) { + Map extraHeaders = new HashMap<>(); + for (Map.Entry> entrySet : headers.entrySet()) { + // HeaderValueList is always non-null. Check that it contains at least one value. + // Should only ever contain one value, but take the first one if there are multiple. + // TODO(https://github.com/googleapis/sdk-platform-java/issues/1752): + // Investigate how to better support extraHeaders + List headerValueList = entrySet.getValue(); + if (headerValueList.isEmpty()) { + continue; + } + extraHeaders.put(entrySet.getKey(), headerValueList.get(0)); + } + return toBuilder().setHeaders(extraHeaders).build(); + } + @AutoValue.Builder abstract static class Builder { abstract Builder setHeaders(Map headers); diff --git a/gax-java/gax-httpjson/src/main/java/com/google/api/gax/httpjson/HttpJsonOperationSnapshot.java b/gax-java/gax-httpjson/src/main/java/com/google/api/gax/httpjson/HttpJsonOperationSnapshot.java index 1e616a31a2..599f2e231c 100644 --- a/gax-java/gax-httpjson/src/main/java/com/google/api/gax/httpjson/HttpJsonOperationSnapshot.java +++ b/gax-java/gax-httpjson/src/main/java/com/google/api/gax/httpjson/HttpJsonOperationSnapshot.java @@ -29,7 +29,6 @@ */ package com.google.api.gax.httpjson; -import com.google.api.core.BetaApi; import com.google.api.core.InternalApi; import com.google.api.gax.longrunning.OperationSnapshot; import com.google.api.gax.rpc.StatusCode; @@ -41,7 +40,6 @@ * *

        Public for technical reasons. For internal use only. */ -@BetaApi @InternalApi public class HttpJsonOperationSnapshot implements OperationSnapshot { private final String name; diff --git a/gax-java/gax-httpjson/src/main/java/com/google/api/gax/httpjson/HttpJsonOperationSnapshotCallable.java b/gax-java/gax-httpjson/src/main/java/com/google/api/gax/httpjson/HttpJsonOperationSnapshotCallable.java index 58f99064ac..c0a61a5213 100644 --- a/gax-java/gax-httpjson/src/main/java/com/google/api/gax/httpjson/HttpJsonOperationSnapshotCallable.java +++ b/gax-java/gax-httpjson/src/main/java/com/google/api/gax/httpjson/HttpJsonOperationSnapshotCallable.java @@ -34,7 +34,6 @@ import com.google.api.core.ApiFunction; import com.google.api.core.ApiFuture; import com.google.api.core.ApiFutures; -import com.google.api.core.BetaApi; import com.google.api.core.InternalApi; import com.google.api.gax.longrunning.OperationSnapshot; import com.google.api.gax.rpc.ApiCallContext; @@ -46,7 +45,6 @@ * *

        Public for technical reasons. For internal use only. */ -@BetaApi @InternalApi public class HttpJsonOperationSnapshotCallable extends UnaryCallable { diff --git a/gax-java/gax-httpjson/src/main/java/com/google/api/gax/httpjson/HttpJsonServerStreamingRequestParamCallable.java b/gax-java/gax-httpjson/src/main/java/com/google/api/gax/httpjson/HttpJsonServerStreamingRequestParamCallable.java new file mode 100644 index 0000000000..7b1d615961 --- /dev/null +++ b/gax-java/gax-httpjson/src/main/java/com/google/api/gax/httpjson/HttpJsonServerStreamingRequestParamCallable.java @@ -0,0 +1,69 @@ +/* + * Copyright 2023 Google LLC + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Google LLC nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +package com.google.api.gax.httpjson; + +import com.google.api.gax.rpc.ApiCallContext; +import com.google.api.gax.rpc.RequestParamsExtractor; +import com.google.api.gax.rpc.RequestUrlParamsEncoder; +import com.google.api.gax.rpc.ResponseObserver; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.api.gax.rpc.internal.Headers; +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; + +public class HttpJsonServerStreamingRequestParamCallable + extends ServerStreamingCallable { + private final ServerStreamingCallable callable; + private final RequestUrlParamsEncoder paramsEncoder; + + HttpJsonServerStreamingRequestParamCallable( + ServerStreamingCallable callable, + RequestParamsExtractor paramsExtractor) { + this.callable = Preconditions.checkNotNull(callable); + this.paramsEncoder = new RequestUrlParamsEncoder<>(Preconditions.checkNotNull(paramsExtractor)); + } + + @Override + public void call( + RequestT request, ResponseObserver responseObserver, ApiCallContext context) { + ApiCallContext newCallContext = context; + String encodedHeader = paramsEncoder.encode(request); + if (!encodedHeader.isEmpty()) { + newCallContext = + HttpJsonCallContext.createDefault() + .nullToSelf(context) + .withExtraHeaders( + ImmutableMap.of( + Headers.DYNAMIC_ROUTING_HEADER_KEY, ImmutableList.of(encodedHeader))); + } + callable.call(request, responseObserver, newCallContext); + } +} diff --git a/gax-java/gax-httpjson/src/main/java/com/google/api/gax/httpjson/HttpJsonStatusCode.java b/gax-java/gax-httpjson/src/main/java/com/google/api/gax/httpjson/HttpJsonStatusCode.java index 617496eb57..ab680db169 100644 --- a/gax-java/gax-httpjson/src/main/java/com/google/api/gax/httpjson/HttpJsonStatusCode.java +++ b/gax-java/gax-httpjson/src/main/java/com/google/api/gax/httpjson/HttpJsonStatusCode.java @@ -29,13 +29,11 @@ */ package com.google.api.gax.httpjson; -import com.google.api.core.BetaApi; import com.google.api.core.InternalExtensionOnly; import com.google.api.gax.rpc.StatusCode; import java.util.Objects; /** A failure code specific to an HTTP call. */ -@BetaApi @InternalExtensionOnly public class HttpJsonStatusCode implements StatusCode { private final int httpStatus; diff --git a/gax-java/gax-httpjson/src/main/java/com/google/api/gax/httpjson/HttpJsonUnaryRequestParamCallable.java b/gax-java/gax-httpjson/src/main/java/com/google/api/gax/httpjson/HttpJsonUnaryRequestParamCallable.java new file mode 100644 index 0000000000..3770872e87 --- /dev/null +++ b/gax-java/gax-httpjson/src/main/java/com/google/api/gax/httpjson/HttpJsonUnaryRequestParamCallable.java @@ -0,0 +1,74 @@ +/* + * Copyright 2023 Google LLC + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Google LLC nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +package com.google.api.gax.httpjson; + +import com.google.api.core.ApiFuture; +import com.google.api.gax.rpc.ApiCallContext; +import com.google.api.gax.rpc.RequestParamsExtractor; +import com.google.api.gax.rpc.RequestUrlParamsEncoder; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.api.gax.rpc.internal.Headers; +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; + +/** + * A {@code UnaryCallable} that extracts values from the fields of the request and inserts them into + * headers. + * + *

        Package-private for internal usage. + */ +class HttpJsonUnaryRequestParamCallable + extends UnaryCallable { + private final UnaryCallable callable; + private final RequestUrlParamsEncoder paramsEncoder; + + public HttpJsonUnaryRequestParamCallable( + UnaryCallable callable, + RequestParamsExtractor paramsExtractor) { + this.callable = Preconditions.checkNotNull(callable); + this.paramsEncoder = new RequestUrlParamsEncoder<>(Preconditions.checkNotNull(paramsExtractor)); + } + + @Override + public ApiFuture futureCall(RequestT request, ApiCallContext context) { + ApiCallContext newCallContext = context; + String encodedHeader = paramsEncoder.encode(request); + if (!encodedHeader.isEmpty()) { + newCallContext = + HttpJsonCallContext.createDefault() + .nullToSelf(context) + .withExtraHeaders( + ImmutableMap.of( + Headers.DYNAMIC_ROUTING_HEADER_KEY, ImmutableList.of(encodedHeader))); + } + return callable.futureCall(request, newCallContext); + } +} diff --git a/gax-java/gax-httpjson/src/main/java/com/google/api/gax/httpjson/HttpRequestFormatter.java b/gax-java/gax-httpjson/src/main/java/com/google/api/gax/httpjson/HttpRequestFormatter.java index a60bf08e9f..c85307d4cd 100644 --- a/gax-java/gax-httpjson/src/main/java/com/google/api/gax/httpjson/HttpRequestFormatter.java +++ b/gax-java/gax-httpjson/src/main/java/com/google/api/gax/httpjson/HttpRequestFormatter.java @@ -29,7 +29,6 @@ */ package com.google.api.gax.httpjson; -import com.google.api.core.BetaApi; import com.google.api.pathtemplate.PathTemplate; import java.util.Collections; import java.util.List; @@ -52,7 +51,6 @@ public interface HttpRequestFormatter { PathTemplate getPathTemplate(); /** Additional (alternative) path templates for endpoint URL path. */ - @BetaApi default List getAdditionalPathTemplates() { return Collections.emptyList(); } diff --git a/gax-java/gax-httpjson/src/main/java/com/google/api/gax/httpjson/HttpRequestRunnable.java b/gax-java/gax-httpjson/src/main/java/com/google/api/gax/httpjson/HttpRequestRunnable.java index 2edb4ceb2e..2738844bd0 100644 --- a/gax-java/gax-httpjson/src/main/java/com/google/api/gax/httpjson/HttpRequestRunnable.java +++ b/gax-java/gax-httpjson/src/main/java/com/google/api/gax/httpjson/HttpRequestRunnable.java @@ -56,8 +56,6 @@ import java.util.Map; import java.util.Map.Entry; import javax.annotation.Nullable; -import org.threeten.bp.Duration; -import org.threeten.bp.Instant; /** A runnable object that creates and executes an HTTP request. */ class HttpRequestRunnable implements Runnable { @@ -100,24 +98,22 @@ void cancel() { @Override public void run() { - HttpResponse httpResponse = null; RunnableResult.Builder result = RunnableResult.builder(); HttpJsonMetadata.Builder trailers = HttpJsonMetadata.newBuilder(); - HttpRequest httpRequest = null; + HttpResponse httpResponse = null; try { // Check if already cancelled before even creating a request if (cancelled) { return; } - httpRequest = createHttpRequest(); + HttpRequest httpRequest = createHttpRequest(); // Check if already cancelled before sending the request; if (cancelled) { return; } - httpResponse = httpRequest.execute(); - // Check if already cancelled before sending the request; + // Check if already cancelled before trying to construct and read the response if (cancelled) { httpResponse.disconnect(); return; @@ -145,6 +141,9 @@ public void run() { } trailers.setException(e); } finally { + // If cancelled, `close()` in HttpJsonClientCallImpl has already been invoked + // and returned a DEADLINE_EXCEEDED error back so there is no need to set + // a result back. if (!cancelled) { resultListener.setResult(result.setTrailers(trailers.build()).build()); } @@ -172,7 +171,7 @@ HttpRequest createHttpRequest() throws IOException { jsonFactory.createJsonParser(requestBody).parse(tokenRequest); jsonHttpContent = new JsonHttpContent(jsonFactory, tokenRequest) - .setMediaType((new HttpMediaType("application/json"))); + .setMediaType((new HttpMediaType("application/json; charset=utf-8"))); } else { // Force underlying HTTP lib to set Content-Length header to avoid 411s. // See EmptyContent.java. @@ -191,16 +190,6 @@ HttpRequest createHttpRequest() throws IOException { HttpRequest httpRequest = buildRequest(requestFactory, url, jsonHttpContent); - Instant deadline = httpJsonCallOptions.getDeadline(); - if (deadline != null) { - long readTimeout = Duration.between(Instant.now(), deadline).toMillis(); - if (httpRequest.getReadTimeout() > 0 - && httpRequest.getReadTimeout() < readTimeout - && readTimeout < Integer.MAX_VALUE) { - httpRequest.setReadTimeout((int) readTimeout); - } - } - for (Map.Entry entry : headers.getHeaders().entrySet()) { HttpHeadersUtils.setHeader( httpRequest.getHeaders(), entry.getKey(), (String) entry.getValue()); @@ -243,9 +232,35 @@ private HttpRequest buildRequest( HttpHeadersUtils.setHeader( httpRequest.getHeaders(), "X-HTTP-Method-Override", originalHttpMethod); } + + java.time.Duration timeout = httpJsonCallOptions.getTimeoutDuration(); + if (timeout != null) { + long timeoutMs = timeout.toMillis(); + + // Read timeout is the timeout between reading two data packets and not total timeout + // HttpJsonClientCallsImpl implements a deadlineCancellationExecutor to cancel the + // RPC when it exceeds the RPC timeout + if (shouldUpdateTimeout(httpRequest.getReadTimeout(), timeoutMs)) { + httpRequest.setReadTimeout((int) timeoutMs); + } + + // Connect timeout is the time allowed for establishing the connection. + // This is updated to match the RPC timeout as we do not want a shorter + // connect timeout to preemptively throw a ConnectExcepetion before + // we've reached the RPC timeout + if (shouldUpdateTimeout(httpRequest.getConnectTimeout(), timeoutMs)) { + httpRequest.setConnectTimeout((int) timeoutMs); + } + } return httpRequest; } + private boolean shouldUpdateTimeout(int currentTimeoutMs, long newTimeoutMs) { + return currentTimeoutMs > 0 + && currentTimeoutMs < newTimeoutMs + && newTimeoutMs < Integer.MAX_VALUE; + } + // This will be frequently executed, so avoiding using regexps if not necessary. private String normalizeEndpoint(String rawEndpoint) { String normalized = rawEndpoint; diff --git a/gax-java/gax-httpjson/src/main/java/com/google/api/gax/httpjson/InstantiatingHttpJsonChannelProvider.java b/gax-java/gax-httpjson/src/main/java/com/google/api/gax/httpjson/InstantiatingHttpJsonChannelProvider.java index 57b0ff1284..daf94a498c 100644 --- a/gax-java/gax-httpjson/src/main/java/com/google/api/gax/httpjson/InstantiatingHttpJsonChannelProvider.java +++ b/gax-java/gax-httpjson/src/main/java/com/google/api/gax/httpjson/InstantiatingHttpJsonChannelProvider.java @@ -31,14 +31,16 @@ import com.google.api.client.http.HttpTransport; import com.google.api.client.http.javanet.NetHttpTransport; -import com.google.api.core.BetaApi; import com.google.api.core.InternalExtensionOnly; import com.google.api.gax.core.ExecutorProvider; import com.google.api.gax.rpc.FixedHeaderProvider; import com.google.api.gax.rpc.HeaderProvider; import com.google.api.gax.rpc.TransportChannelProvider; -import com.google.api.gax.rpc.mtls.MtlsProvider; +import com.google.api.gax.rpc.mtls.CertificateBasedAccess; import com.google.auth.Credentials; +import com.google.auth.mtls.CertificateSourceUnavailableException; +import com.google.auth.mtls.DefaultMtlsProviderFactory; +import com.google.auth.mtls.MtlsProvider; import com.google.common.annotations.VisibleForTesting; import java.io.IOException; import java.security.GeneralSecurityException; @@ -46,6 +48,9 @@ import java.util.Map; import java.util.concurrent.Executor; import java.util.concurrent.ScheduledExecutorService; +import java.util.logging.Level; +import java.util.logging.Logger; +import javax.annotation.Nullable; /** * InstantiatingHttpJsonChannelProvider is a TransportChannelProvider which constructs a {@link @@ -59,16 +64,19 @@ *

        The client lib header and generator header values are used to form a value that goes into the * http header of requests to the service. */ -@BetaApi @InternalExtensionOnly public final class InstantiatingHttpJsonChannelProvider implements TransportChannelProvider { + @VisibleForTesting + static final Logger LOG = Logger.getLogger(InstantiatingHttpJsonChannelProvider.class.getName()); + private final Executor executor; private final HeaderProvider headerProvider; private final HttpJsonInterceptorProvider interceptorProvider; private final String endpoint; private final HttpTransport httpTransport; - private final MtlsProvider mtlsProvider; + @Nullable private final MtlsProvider mtlsProvider; + private final CertificateBasedAccess certificateBasedAccess; private InstantiatingHttpJsonChannelProvider( Executor executor, @@ -76,13 +84,15 @@ private InstantiatingHttpJsonChannelProvider( HttpJsonInterceptorProvider interceptorProvider, String endpoint, HttpTransport httpTransport, - MtlsProvider mtlsProvider) { + MtlsProvider mtlsProvider, + CertificateBasedAccess certificateBasedAccess) { this.executor = executor; this.headerProvider = headerProvider; this.interceptorProvider = interceptorProvider; this.endpoint = endpoint; this.httpTransport = httpTransport; this.mtlsProvider = mtlsProvider; + this.certificateBasedAccess = certificateBasedAccess; } /** @@ -126,14 +136,18 @@ public TransportChannelProvider withEndpoint(String endpoint) { return toBuilder().setEndpoint(endpoint).build(); } - /** @deprecated REST transport channel doesn't support channel pooling */ + /** + * @deprecated REST transport channel doesn't support channel pooling + */ @Deprecated @Override public boolean acceptsPoolSize() { return false; } - /** @deprecated REST transport channel doesn't support channel pooling */ + /** + * @deprecated REST transport channel doesn't support channel pooling + */ @Deprecated @Override public TransportChannelProvider withPoolSize(int size) { @@ -171,7 +185,10 @@ public TransportChannelProvider withCredentials(Credentials credentials) { } HttpTransport createHttpTransport() throws IOException, GeneralSecurityException { - if (mtlsProvider.useMtlsClientCertificate()) { + if (mtlsProvider == null) { + return null; + } + if (certificateBasedAccess.useMtlsClientCertificate()) { KeyStore mtlsKeyStore = mtlsProvider.getKeyStore(); if (mtlsKeyStore != null) { return new NetHttpTransport.Builder().trustCertificates(null, mtlsKeyStore, "").build(); @@ -186,6 +203,8 @@ private HttpJsonTransportChannel createChannel() throws IOException, GeneralSecu httpTransportToUse = createHttpTransport(); } + // Pass the executor to the ManagedChannel. If no executor was provided (or null), + // the channel will use a default executor for the calls. ManagedHttpJsonChannel channel = ManagedHttpJsonChannel.newBuilder() .setEndpoint(endpoint) @@ -196,6 +215,7 @@ private HttpJsonTransportChannel createChannel() throws IOException, GeneralSecu HttpJsonClientInterceptor headerInterceptor = new HttpJsonHeaderInterceptor(headerProvider.getHeaders()); + channel = new ManagedHttpJsonInterceptorChannel(channel, new HttpJsonLoggingInterceptor()); channel = new ManagedHttpJsonInterceptorChannel(channel, headerInterceptor); if (interceptorProvider != null && interceptorProvider.getInterceptors() != null) { for (HttpJsonClientInterceptor interceptor : interceptorProvider.getInterceptors()) { @@ -207,6 +227,7 @@ private HttpJsonTransportChannel createChannel() throws IOException, GeneralSecu } /** The endpoint to be used for the channel. */ + @Override public String getEndpoint() { return endpoint; } @@ -231,7 +252,8 @@ public static final class Builder { private HttpJsonInterceptorProvider interceptorProvider; private String endpoint; private HttpTransport httpTransport; - private MtlsProvider mtlsProvider = new MtlsProvider(); + private MtlsProvider mtlsProvider; + private CertificateBasedAccess certificateBasedAccess; private Builder() {} @@ -241,6 +263,7 @@ private Builder(InstantiatingHttpJsonChannelProvider provider) { this.endpoint = provider.endpoint; this.httpTransport = provider.httpTransport; this.mtlsProvider = provider.mtlsProvider; + this.certificateBasedAccess = provider.certificateBasedAccess; this.interceptorProvider = provider.interceptorProvider; } @@ -257,7 +280,9 @@ public Builder setExecutor(Executor executor) { return this; } - /** @deprecated Please use {@link #setExecutor(Executor)}. */ + /** + * @deprecated Please use {@link #setExecutor(Executor)}. + */ @Deprecated public Builder setExecutorProvider(ExecutorProvider executorProvider) { return setExecutor((Executor) executorProvider.getExecutor()); @@ -309,9 +334,42 @@ Builder setMtlsProvider(MtlsProvider mtlsProvider) { return this; } + @VisibleForTesting + Builder setCertificateBasedAccess(CertificateBasedAccess certificateBasedAccess) { + this.certificateBasedAccess = certificateBasedAccess; + return this; + } + public InstantiatingHttpJsonChannelProvider build() { + if (certificateBasedAccess == null) { + certificateBasedAccess = CertificateBasedAccess.createWithSystemEnv(); + } + if (certificateBasedAccess.useMtlsClientCertificate()) { + if (mtlsProvider == null) { + // Attempt to create default MtlsProvider from environment. + try { + mtlsProvider = DefaultMtlsProviderFactory.create(); + } catch (CertificateSourceUnavailableException e) { + // This is okay. Leave mtlsProvider as null so that we will not auto-upgrade + // to mTLS endpoints. See https://google.aip.dev/auth/4114. + } catch (IOException e) { + LOG.log( + Level.WARNING, + "DefaultMtlsProviderFactory encountered unexpected IOException: " + e.getMessage()); + LOG.log( + Level.WARNING, + "mTLS configuration was detected on the device, but mTLS failed to initialize. Falling back to non-mTLS channel."); + } + } + } return new InstantiatingHttpJsonChannelProvider( - executor, headerProvider, interceptorProvider, endpoint, httpTransport, mtlsProvider); + executor, + headerProvider, + interceptorProvider, + endpoint, + httpTransport, + mtlsProvider, + certificateBasedAccess); } } } diff --git a/gax-java/gax-httpjson/src/main/java/com/google/api/gax/httpjson/ManagedHttpJsonChannel.java b/gax-java/gax-httpjson/src/main/java/com/google/api/gax/httpjson/ManagedHttpJsonChannel.java index 6fb4200d30..bd3bed8556 100644 --- a/gax-java/gax-httpjson/src/main/java/com/google/api/gax/httpjson/ManagedHttpJsonChannel.java +++ b/gax-java/gax-httpjson/src/main/java/com/google/api/gax/httpjson/ManagedHttpJsonChannel.java @@ -31,38 +31,46 @@ import com.google.api.client.http.HttpTransport; import com.google.api.client.http.javanet.NetHttpTransport; -import com.google.api.core.BetaApi; import com.google.api.gax.core.BackgroundResource; import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.common.annotations.VisibleForTesting; import com.google.common.base.Preconditions; import java.io.IOException; import java.util.concurrent.Executor; import java.util.concurrent.ExecutorService; +import java.util.concurrent.Executors; +import java.util.concurrent.ScheduledExecutorService; import java.util.concurrent.TimeUnit; import javax.annotation.Nullable; /** Implementation of HttpJsonChannel which can issue http-json calls. */ -@BetaApi public class ManagedHttpJsonChannel implements HttpJsonChannel, BackgroundResource { - private static final ExecutorService DEFAULT_EXECUTOR = - InstantiatingExecutorProvider.newBuilder().build().getExecutor(); - private final Executor executor; + private final boolean usingDefaultExecutor; private final String endpoint; private final HttpTransport httpTransport; - + private final ScheduledExecutorService deadlineScheduledExecutorService; private boolean isTransportShutdown; protected ManagedHttpJsonChannel() { - this(null, null, null); + this(null, true, null, null); + } + + String getEndpoint() { + return endpoint; } private ManagedHttpJsonChannel( - Executor executor, String endpoint, @Nullable HttpTransport httpTransport) { + Executor executor, + boolean usingDefaultExecutor, + String endpoint, + @Nullable HttpTransport httpTransport) { this.executor = executor; + this.usingDefaultExecutor = usingDefaultExecutor; this.endpoint = endpoint; this.httpTransport = httpTransport == null ? new NetHttpTransport() : httpTransport; + this.deadlineScheduledExecutorService = Executors.newSingleThreadScheduledExecutor(); } @Override @@ -70,48 +78,113 @@ public HttpJsonClientCall newCall( ApiMethodDescriptor methodDescriptor, HttpJsonCallOptions callOptions) { return new HttpJsonClientCallImpl<>( - methodDescriptor, endpoint, callOptions, httpTransport, executor); + methodDescriptor, + endpoint, + callOptions, + httpTransport, + executor, + deadlineScheduledExecutorService); + } + + @VisibleForTesting + Executor getExecutor() { + return executor; } @Override public synchronized void shutdown() { + // Calling shutdown/ shutdownNow() twice should no-op if (isTransportShutdown) { return; } try { + // Only shutdown the executor if it was created by Gax. External executors + // should be managed by the user. + if (shouldManageExecutor()) { + ((ExecutorService) executor).shutdown(); + } + deadlineScheduledExecutorService.shutdown(); httpTransport.shutdown(); isTransportShutdown = true; } catch (IOException e) { - e.printStackTrace(); + // TODO: Log this scenario once we implemented the Cloud SDK logging. + // Swallow error if httpTransport shutdown fails } } @Override public boolean isShutdown() { - return isTransportShutdown; + // TODO(lawrenceqiu): Expose an isShutdown() method for HttpTransport + boolean isShutdown = isTransportShutdown && deadlineScheduledExecutorService.isShutdown(); + // Check that the Gax's ExecutorService is shutdown as well + if (shouldManageExecutor()) { + isShutdown = isShutdown && ((ExecutorService) executor).isShutdown(); + } + return isShutdown; } @Override public boolean isTerminated() { - return isTransportShutdown; + boolean isTerminated = deadlineScheduledExecutorService.isTerminated(); + // Check that the Gax's ExecutorService is terminated as well + if (shouldManageExecutor()) { + isTerminated = isTerminated && ((ExecutorService) executor).isTerminated(); + } + return isTerminated; } @Override public void shutdownNow() { - shutdown(); + // Calling shutdown/ shutdownNow() twice should no-op + if (isTransportShutdown) { + return; + } + try { + // Only shutdown the executor if it was created by Gax. External executors + // should be managed by the user. + if (shouldManageExecutor()) { + ((ExecutorService) executor).shutdownNow(); + } + deadlineScheduledExecutorService.shutdownNow(); + httpTransport.shutdown(); + isTransportShutdown = true; + } catch (IOException e) { + // TODO: Log this scenario once we implemented the Cloud SDK logging. + // Swallow error if httpTransport shutdown fails + } } @Override public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { - // TODO - return false; + long endTimeNanos = System.nanoTime() + unit.toNanos(duration); + long awaitTimeNanos = endTimeNanos - System.nanoTime(); + if (awaitTimeNanos <= 0) { + return false; + } + // Only awaitTermination for the executor if it was created by Gax. External executors + // should be managed by the user. + if (usingDefaultExecutor && executor instanceof ExecutorService) { + boolean terminated = ((ExecutorService) executor).awaitTermination(awaitTimeNanos, unit); + // Termination duration has elapsed + if (!terminated) { + return false; + } + } + awaitTimeNanos = endTimeNanos - System.nanoTime(); + return deadlineScheduledExecutorService.awaitTermination(awaitTimeNanos, unit); + } + + private boolean shouldManageExecutor() { + return usingDefaultExecutor && executor instanceof ExecutorService; } @Override - public void close() {} + public void close() { + shutdown(); + } public static Builder newBuilder() { - return new Builder().setExecutor(DEFAULT_EXECUTOR); + return new Builder(); } public static class Builder { @@ -119,11 +192,14 @@ public static class Builder { private Executor executor; private String endpoint; private HttpTransport httpTransport; + private boolean usingDefaultExecutor; - private Builder() {} + private Builder() { + this.usingDefaultExecutor = false; + } public Builder setExecutor(Executor executor) { - this.executor = executor == null ? DEFAULT_EXECUTOR : executor; + this.executor = executor; return this; } @@ -140,8 +216,20 @@ public Builder setHttpTransport(HttpTransport httpTransport) { public ManagedHttpJsonChannel build() { Preconditions.checkNotNull(endpoint); + // If the executor provided for this channel is null, gax will provide a + // default executor to used for the calls. Only the default executor's + // lifecycle will be managed by the channel. Any external executor needs to + // managed by the user. + if (executor == null) { + executor = InstantiatingExecutorProvider.newIOBuilder().build().getExecutor(); + usingDefaultExecutor = true; + } + return new ManagedHttpJsonChannel( - executor, endpoint, httpTransport == null ? new NetHttpTransport() : httpTransport); + executor, + usingDefaultExecutor, + endpoint, + httpTransport == null ? new NetHttpTransport() : httpTransport); } } } diff --git a/gax-java/gax-httpjson/src/main/java/com/google/api/gax/httpjson/ManagedHttpJsonInterceptorChannel.java b/gax-java/gax-httpjson/src/main/java/com/google/api/gax/httpjson/ManagedHttpJsonInterceptorChannel.java index 05321e2fd7..3e71031f1c 100644 --- a/gax-java/gax-httpjson/src/main/java/com/google/api/gax/httpjson/ManagedHttpJsonInterceptorChannel.java +++ b/gax-java/gax-httpjson/src/main/java/com/google/api/gax/httpjson/ManagedHttpJsonInterceptorChannel.java @@ -29,10 +29,9 @@ */ package com.google.api.gax.httpjson; -import com.google.api.core.BetaApi; +import com.google.common.annotations.VisibleForTesting; import java.util.concurrent.TimeUnit; -@BetaApi class ManagedHttpJsonInterceptorChannel extends ManagedHttpJsonChannel { private final ManagedHttpJsonChannel channel; @@ -45,6 +44,11 @@ class ManagedHttpJsonInterceptorChannel extends ManagedHttpJsonChannel { this.interceptor = interceptor; } + @VisibleForTesting + ManagedHttpJsonChannel getChannel() { + return channel; + } + @Override public HttpJsonClientCall newCall( ApiMethodDescriptor methodDescriptor, HttpJsonCallOptions callOptions) { diff --git a/gax-java/gax-httpjson/src/main/java/com/google/api/gax/httpjson/ProtoMessageRequestFormatter.java b/gax-java/gax-httpjson/src/main/java/com/google/api/gax/httpjson/ProtoMessageRequestFormatter.java index f04a16edbc..aa3db693f5 100644 --- a/gax-java/gax-httpjson/src/main/java/com/google/api/gax/httpjson/ProtoMessageRequestFormatter.java +++ b/gax-java/gax-httpjson/src/main/java/com/google/api/gax/httpjson/ProtoMessageRequestFormatter.java @@ -29,7 +29,6 @@ */ package com.google.api.gax.httpjson; -import com.google.api.core.BetaApi; import com.google.api.core.InternalApi; import com.google.api.pathtemplate.PathTemplate; import com.google.protobuf.Message; @@ -95,13 +94,32 @@ public String getRequestBody(RequestT apiMessage) { return requestBodyExtractor.extract(apiMessage); } - /* {@inheritDoc} */ + /** + * Returns the relative URL path created from the path parameters from the given message. Attempts + * to match the with the default PathTemplate. If there is not match, it attempts to match with + * the templates in the additionalPathTemplates. + * + * @param apiMessage Request object to extract fields from + * @return Path of a matching valid URL or the default Path URL + */ @Override public String getPath(RequestT apiMessage) { - return pathTemplate.instantiate(pathVarsExtractor.extract(apiMessage)); + Map pathVarsMap = pathVarsExtractor.extract(apiMessage); + String path = pathTemplate.instantiate(pathVarsMap); + if (pathTemplate.matches(path)) { + return path; + } + for (PathTemplate additionalPathTemplate : additionalPathTemplates) { + String additionalPath = additionalPathTemplate.instantiate(pathVarsMap); + if (additionalPathTemplate.matches(additionalPath)) { + return additionalPath; + } + } + // If there are no matches, we return the default path, this is for backwards compatibility. + // TODO: Log this scenario once we implemented the Cloud SDK logging. + return path; } - @BetaApi @Override public List getAdditionalPathTemplates() { return additionalPathTemplates; @@ -141,12 +159,17 @@ public Builder setPath( return this; } - @BetaApi public Builder setAdditionalPaths(String... rawAdditionalPaths) { this.rawAdditionalPaths = Arrays.asList(rawAdditionalPaths); return this; } + @InternalApi + public Builder updateRawPath(String rawPath) { + this.rawPath = rawPath; + return this; + } + @InternalApi public Builder updateRawPath(String target, String replacement) { this.rawPath = this.rawPath.replace(target, replacement); diff --git a/gax-java/gax-httpjson/src/main/java/com/google/api/gax/httpjson/ProtoRestSerializer.java b/gax-java/gax-httpjson/src/main/java/com/google/api/gax/httpjson/ProtoRestSerializer.java index 0c5158f76e..af4068c438 100644 --- a/gax-java/gax-httpjson/src/main/java/com/google/api/gax/httpjson/ProtoRestSerializer.java +++ b/gax-java/gax-httpjson/src/main/java/com/google/api/gax/httpjson/ProtoRestSerializer.java @@ -29,7 +29,6 @@ */ package com.google.api.gax.httpjson; -import com.google.api.core.BetaApi; import com.google.common.collect.ImmutableList; import com.google.gson.JsonElement; import com.google.gson.JsonParser; @@ -50,7 +49,6 @@ * URL path parameters, and query parameters. It deserializes JSON responses into response protobuf * message. */ -@BetaApi public class ProtoRestSerializer { private final TypeRegistry registry; diff --git a/gax-java/gax-httpjson/src/main/java/com/google/api/gax/httpjson/RestSerializationException.java b/gax-java/gax-httpjson/src/main/java/com/google/api/gax/httpjson/RestSerializationException.java index 7f5252595d..cbf1372387 100644 --- a/gax-java/gax-httpjson/src/main/java/com/google/api/gax/httpjson/RestSerializationException.java +++ b/gax-java/gax-httpjson/src/main/java/com/google/api/gax/httpjson/RestSerializationException.java @@ -29,13 +29,10 @@ */ package com.google.api.gax.httpjson; -import com.google.api.core.BetaApi; - /** * An exception thrown when a protobuf message cannot be serialized/deserialized for REST * interactions. */ -@BetaApi public class RestSerializationException extends RuntimeException { private static final long serialVersionUID = -6485633460933364916L; diff --git a/gax-java/gax-httpjson/src/main/java/com/google/api/gax/httpjson/longrunning/OperationsClient.java b/gax-java/gax-httpjson/src/main/java/com/google/api/gax/httpjson/longrunning/OperationsClient.java index fe5093c19a..71982aacd0 100644 --- a/gax-java/gax-httpjson/src/main/java/com/google/api/gax/httpjson/longrunning/OperationsClient.java +++ b/gax-java/gax-httpjson/src/main/java/com/google/api/gax/httpjson/longrunning/OperationsClient.java @@ -32,7 +32,6 @@ import com.google.api.core.ApiFunction; import com.google.api.core.ApiFuture; import com.google.api.core.ApiFutures; -import com.google.api.core.BetaApi; import com.google.api.gax.core.BackgroundResource; import com.google.api.gax.httpjson.longrunning.stub.OperationsStub; import com.google.api.gax.httpjson.longrunning.stub.OperationsStubSettings; @@ -120,7 +119,6 @@ * *

        Please refer to the GitHub repository's samples for more quickstart code snippets. */ -@BetaApi public class OperationsClient implements BackgroundResource { private final OperationsSettings settings; private final OperationsStub stub; @@ -163,7 +161,6 @@ protected OperationsClient(OperationsSettings settings) throws IOException { this.stub = ((OperationsStubSettings) settings.getStubSettings()).createStub(); } - @BetaApi("A restructuring of stub classes is planned, so this may break in the future") protected OperationsClient(OperationsStub stub) { this.settings = null; this.stub = stub; @@ -173,7 +170,6 @@ public final OperationsSettings getSettings() { return settings; } - @BetaApi("A restructuring of stub classes is planned, so this may break in the future") public OperationsStub getStub() { return stub; } diff --git a/gax-java/gax-httpjson/src/main/java/com/google/api/gax/httpjson/longrunning/OperationsSettings.java b/gax-java/gax-httpjson/src/main/java/com/google/api/gax/httpjson/longrunning/OperationsSettings.java index 58aff3d7cd..99cbc48d92 100644 --- a/gax-java/gax-httpjson/src/main/java/com/google/api/gax/httpjson/longrunning/OperationsSettings.java +++ b/gax-java/gax-httpjson/src/main/java/com/google/api/gax/httpjson/longrunning/OperationsSettings.java @@ -32,7 +32,6 @@ import static com.google.api.gax.httpjson.longrunning.OperationsClient.ListOperationsPagedResponse; import com.google.api.core.ApiFunction; -import com.google.api.core.BetaApi; import com.google.api.gax.core.GoogleCredentialsProvider; import com.google.api.gax.core.InstantiatingExecutorProvider; import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; @@ -84,7 +83,6 @@ * OperationsSettings operationsSettings = operationsSettingsBuilder.build(); * } */ -@BetaApi public class OperationsSettings extends ClientSettings { /** Returns the object with the settings used for calls to listOperations. */ diff --git a/gax-java/gax-httpjson/src/main/java/com/google/api/gax/httpjson/longrunning/stub/HttpJsonOperationsCallableFactory.java b/gax-java/gax-httpjson/src/main/java/com/google/api/gax/httpjson/longrunning/stub/HttpJsonOperationsCallableFactory.java index 9d8a435d8a..176e6e98c6 100644 --- a/gax-java/gax-httpjson/src/main/java/com/google/api/gax/httpjson/longrunning/stub/HttpJsonOperationsCallableFactory.java +++ b/gax-java/gax-httpjson/src/main/java/com/google/api/gax/httpjson/longrunning/stub/HttpJsonOperationsCallableFactory.java @@ -29,7 +29,6 @@ */ package com.google.api.gax.httpjson.longrunning.stub; -import com.google.api.core.BetaApi; import com.google.api.gax.core.BackgroundResource; import com.google.api.gax.httpjson.HttpJsonCallSettings; import com.google.api.gax.httpjson.HttpJsonCallableFactory; @@ -49,7 +48,6 @@ * *

        This class is for advanced usage. */ -@BetaApi public class HttpJsonOperationsCallableFactory implements HttpJsonStubCallableFactory { diff --git a/gax-java/gax-httpjson/src/main/java/com/google/api/gax/httpjson/longrunning/stub/HttpJsonOperationsStub.java b/gax-java/gax-httpjson/src/main/java/com/google/api/gax/httpjson/longrunning/stub/HttpJsonOperationsStub.java index 5759c41726..f185b98fe2 100644 --- a/gax-java/gax-httpjson/src/main/java/com/google/api/gax/httpjson/longrunning/stub/HttpJsonOperationsStub.java +++ b/gax-java/gax-httpjson/src/main/java/com/google/api/gax/httpjson/longrunning/stub/HttpJsonOperationsStub.java @@ -29,6 +29,7 @@ */ package com.google.api.gax.httpjson.longrunning.stub; +import com.google.api.HttpRule; import com.google.api.client.http.HttpMethods; import com.google.api.core.InternalApi; import com.google.api.gax.core.BackgroundResource; @@ -45,6 +46,8 @@ import com.google.api.gax.rpc.ClientContext; import com.google.api.gax.rpc.LongRunningClient; import com.google.api.gax.rpc.UnaryCallable; +import com.google.common.annotations.VisibleForTesting; +import com.google.common.collect.ImmutableList; import com.google.longrunning.CancelOperationRequest; import com.google.longrunning.DeleteOperationRequest; import com.google.longrunning.GetOperationRequest; @@ -52,28 +55,31 @@ import com.google.longrunning.ListOperationsResponse; import com.google.longrunning.Operation; import com.google.protobuf.Empty; -import com.google.protobuf.Message; import com.google.protobuf.TypeRegistry; import java.io.IOException; -import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.concurrent.TimeUnit; -import java.util.regex.Matcher; -import java.util.regex.Pattern; // AUTO-GENERATED DOCUMENTATION AND CLASS. /** * REST stub implementation for the Operations service API. * *

        This class is for advanced usage and reflects the underlying API directly. + * + *

        Note: This OperationsClient was originally auto-generated by the generator. There has been a + * few handwritten changes since then and has not been regenerated. */ public class HttpJsonOperationsStub extends OperationsStub { - private static final Pattern CLIENT_PACKAGE_VERSION_PATTERN = - Pattern.compile("\\.(?v\\d+[a-zA-Z]*\\d*[a-zA-Z]*\\d*)\\.[\\w.]*stub"); - - private static final ApiMethodDescriptor + private static final String LRO_LIST_OPERATIONS = "google.longrunning.Operations.ListOperations"; + private static final String LRO_GET_OPERATION = "google.longrunning.Operations.GetOperation"; + private static final String LRO_DELETE_OPERATION = + "google.longrunning.Operations.DeleteOperation"; + private static final String LRO_CANCEL_OPERATION = + "google.longrunning.Operations.CancelOperation"; + + private ApiMethodDescriptor listOperationsMethodDescriptor = ApiMethodDescriptor.newBuilder() .setFullMethodName("google.longrunning.Operations/ListOperations") @@ -107,85 +113,82 @@ public class HttpJsonOperationsStub extends OperationsStub { .build()) .build(); - private static final ApiMethodDescriptor - getOperationMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("google.longrunning.Operations/GetOperation") - .setHttpMethod(HttpMethods.GET) - .setRequestFormatter( - ProtoMessageRequestFormatter.newBuilder() - .setPath( - "/v1/{name=**/operations/*}", - request -> { - Map fields = new HashMap<>(); - ProtoRestSerializer serializer = - ProtoRestSerializer.create(); - serializer.putPathParam(fields, "name", request.getName()); - return fields; - }) - .setQueryParamsExtractor(request -> new HashMap<>()) - .setRequestBodyExtractor(request -> null) - .build()) - .setResponseParser( - ProtoMessageResponseParser.newBuilder() - .setDefaultInstance(Operation.getDefaultInstance()) - .build()) - .setOperationSnapshotFactory( - (request, response) -> HttpJsonOperationSnapshot.create(response)) - .setPollingRequestFactory( - compoundOperationId -> - GetOperationRequest.newBuilder().setName(compoundOperationId).build()) - .build(); - - private static final ApiMethodDescriptor - deleteOperationMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("google.longrunning.Operations/DeleteOperation") - .setHttpMethod(HttpMethods.DELETE) - .setRequestFormatter( - ProtoMessageRequestFormatter.newBuilder() - .setPath( - "/v1/{name=**/operations/*}", - request -> { - Map fields = new HashMap<>(); - ProtoRestSerializer serializer = - ProtoRestSerializer.create(); - serializer.putPathParam(fields, "name", request.getName()); - return fields; - }) - .setQueryParamsExtractor(request -> new HashMap<>()) - .setRequestBodyExtractor(request -> null) - .build()) - .setResponseParser( - ProtoMessageResponseParser.newBuilder() - .setDefaultInstance(Empty.getDefaultInstance()) - .build()) - .build(); - - private static final ApiMethodDescriptor - cancelOperationMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("google.longrunning.Operations/CancelOperation") - .setHttpMethod(HttpMethods.POST) - .setRequestFormatter( - ProtoMessageRequestFormatter.newBuilder() - .setPath( - "/v1/{name=**/operations/*}:cancel", - request -> { - Map fields = new HashMap<>(); - ProtoRestSerializer serializer = - ProtoRestSerializer.create(); - serializer.putPathParam(fields, "name", request.getName()); - return fields; - }) - .setQueryParamsExtractor(request -> new HashMap<>()) - .setRequestBodyExtractor(request -> null) - .build()) - .setResponseParser( - ProtoMessageResponseParser.newBuilder() - .setDefaultInstance(Empty.getDefaultInstance()) - .build()) - .build(); + private ApiMethodDescriptor getOperationMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.longrunning.Operations/GetOperation") + .setHttpMethod(HttpMethods.GET) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{name=**/operations/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor(request -> new HashMap<>()) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Operation.getDefaultInstance()) + .build()) + .setOperationSnapshotFactory( + (request, response) -> HttpJsonOperationSnapshot.create(response)) + .setPollingRequestFactory( + compoundOperationId -> + GetOperationRequest.newBuilder().setName(compoundOperationId).build()) + .build(); + + private ApiMethodDescriptor deleteOperationMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.longrunning.Operations/DeleteOperation") + .setHttpMethod(HttpMethods.DELETE) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{name=**/operations/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor(request -> new HashMap<>()) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Empty.getDefaultInstance()) + .build()) + .build(); + + private ApiMethodDescriptor cancelOperationMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.longrunning.Operations/CancelOperation") + .setHttpMethod(HttpMethods.POST) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{name=**/operations/*}:cancel", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor(request -> new HashMap<>()) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Empty.getDefaultInstance()) + .build()) + .build(); private final UnaryCallable listOperationsCallable; private final UnaryCallable @@ -196,7 +199,6 @@ public class HttpJsonOperationsStub extends OperationsStub { private final LongRunningClient longRunningClient; private final BackgroundResource backgroundResources; - private final HttpJsonStubCallableFactory callableFactory; public static final HttpJsonOperationsStub create(OperationsStubSettings settings) throws IOException { @@ -226,6 +228,20 @@ public static final HttpJsonOperationsStub create( OperationsStubSettings.newBuilder().build(), clientContext, callableFactory, typeRegistry); } + public static final HttpJsonOperationsStub create( + ClientContext clientContext, + HttpJsonStubCallableFactory callableFactory, + TypeRegistry typeRegistry, + Map customHttpBindings) + throws IOException { + return new HttpJsonOperationsStub( + OperationsStubSettings.newBuilder().build(), + clientContext, + callableFactory, + typeRegistry, + customHttpBindings); + } + /** * Constructs an instance of HttpJsonOperationsStub, using the given settings. This is protected * so that it is easy to make a subclass, but otherwise, the static factory methods should be @@ -237,7 +253,8 @@ protected HttpJsonOperationsStub(OperationsStubSettings settings, ClientContext settings, clientContext, new HttpJsonOperationsCallableFactory(), - TypeRegistry.getEmptyTypeRegistry()); + TypeRegistry.getEmptyTypeRegistry(), + new HashMap<>()); } /** @@ -251,36 +268,36 @@ protected HttpJsonOperationsStub( HttpJsonStubCallableFactory callableFactory, TypeRegistry typeRegistry) throws IOException { - this.callableFactory = callableFactory; - - Matcher packageMatcher = - CLIENT_PACKAGE_VERSION_PATTERN.matcher(callableFactory.getClass().getPackage().getName()); + this(settings, clientContext, callableFactory, typeRegistry, new HashMap<>()); + } - String apiVersion = packageMatcher.find() ? packageMatcher.group("version") : null; + private HttpJsonOperationsStub( + OperationsStubSettings settings, + ClientContext clientContext, + HttpJsonStubCallableFactory callableFactory, + TypeRegistry typeRegistry, + Map customHttpBindings) { + updateDefaultApiMethodDescriptors(customHttpBindings); HttpJsonCallSettings listOperationsTransportSettings = HttpJsonCallSettings.newBuilder() - .setMethodDescriptor( - getApiVersionedMethodDescriptor(listOperationsMethodDescriptor, apiVersion)) + .setMethodDescriptor(listOperationsMethodDescriptor) .setTypeRegistry(typeRegistry) .build(); HttpJsonCallSettings getOperationTransportSettings = HttpJsonCallSettings.newBuilder() - .setMethodDescriptor( - getApiVersionedMethodDescriptor(getOperationMethodDescriptor, apiVersion)) + .setMethodDescriptor(getOperationMethodDescriptor) .setTypeRegistry(typeRegistry) .build(); HttpJsonCallSettings deleteOperationTransportSettings = HttpJsonCallSettings.newBuilder() - .setMethodDescriptor( - getApiVersionedMethodDescriptor(deleteOperationMethodDescriptor, apiVersion)) + .setMethodDescriptor(deleteOperationMethodDescriptor) .setTypeRegistry(typeRegistry) .build(); HttpJsonCallSettings cancelOperationTransportSettings = HttpJsonCallSettings.newBuilder() - .setMethodDescriptor( - getApiVersionedMethodDescriptor(cancelOperationMethodDescriptor, apiVersion)) + .setMethodDescriptor(cancelOperationMethodDescriptor) .setTypeRegistry(typeRegistry) .build(); @@ -309,32 +326,123 @@ protected HttpJsonOperationsStub( backgroundResources = new BackgroundResourceAggregation(clientContext.getBackgroundResources()); } - private static - ApiMethodDescriptor getApiVersionedMethodDescriptor( - ApiMethodDescriptor methodDescriptor, String apiVersion) { - if (apiVersion == null) { - return methodDescriptor; + /* OperationsClient's RPCs are mapped to GET/POST/DELETE and this function only expects those HttpVerbs to be used */ + private String getValueBasedOnPatternCase(HttpRule httpRule) { + switch (httpRule.getPatternCase().getNumber()) { + case 2: + return httpRule.getGet(); + case 4: + return httpRule.getPost(); + case 5: + return httpRule.getDelete(); + default: + throw new IllegalArgumentException( + "Operations HttpRule should only contain GET/POST/DELETE. Invalid: " + + httpRule.getSelector()); + } + } + + /* This is to allow libraries to customize the Operation MethodDescriptors from the service yaml file */ + private void updateDefaultApiMethodDescriptors( + Map customOperationHttpBindings) { + if (customOperationHttpBindings.containsKey(LRO_LIST_OPERATIONS)) { + listOperationsMethodDescriptor = + listOperationsMethodDescriptor.toBuilder() + .setRequestFormatter( + ((ProtoMessageRequestFormatter) + listOperationsMethodDescriptor.getRequestFormatter()) + .toBuilder() + .updateRawPath( + customOperationHttpBindings.get(LRO_LIST_OPERATIONS).getGet()) + .setAdditionalPaths( + customOperationHttpBindings + .get(LRO_LIST_OPERATIONS) + .getAdditionalBindingsList() + .stream() + .map(this::getValueBasedOnPatternCase) + .toArray(String[]::new)) + .build()) + .build(); } - ApiMethodDescriptor.Builder descriptorBuilder = - methodDescriptor.toBuilder(); - ProtoMessageRequestFormatter requestFormatter = - (ProtoMessageRequestFormatter) descriptorBuilder.getRequestFormatter(); + if (customOperationHttpBindings.containsKey(LRO_GET_OPERATION)) { + getOperationMethodDescriptor = + getOperationMethodDescriptor.toBuilder() + .setRequestFormatter( + ((ProtoMessageRequestFormatter) + getOperationMethodDescriptor.getRequestFormatter()) + .toBuilder() + .updateRawPath( + customOperationHttpBindings.get(LRO_GET_OPERATION).getGet()) + .setAdditionalPaths( + customOperationHttpBindings + .get(LRO_GET_OPERATION) + .getAdditionalBindingsList() + .stream() + .map(this::getValueBasedOnPatternCase) + .toArray(String[]::new)) + .build()) + .build(); + } - return descriptorBuilder - .setRequestFormatter( - requestFormatter.toBuilder().updateRawPath("/v1/", '/' + apiVersion + '/').build()) - .build(); + if (customOperationHttpBindings.containsKey(LRO_DELETE_OPERATION)) { + deleteOperationMethodDescriptor = + deleteOperationMethodDescriptor.toBuilder() + .setRequestFormatter( + ((ProtoMessageRequestFormatter) + deleteOperationMethodDescriptor.getRequestFormatter()) + .toBuilder() + .updateRawPath( + customOperationHttpBindings.get(LRO_DELETE_OPERATION).getDelete()) + .setAdditionalPaths( + customOperationHttpBindings + .get(LRO_DELETE_OPERATION) + .getAdditionalBindingsList() + .stream() + .map(this::getValueBasedOnPatternCase) + .toArray(String[]::new)) + .build()) + .build(); + } + + if (customOperationHttpBindings.containsKey(LRO_CANCEL_OPERATION)) { + cancelOperationMethodDescriptor = + cancelOperationMethodDescriptor.toBuilder() + .setRequestFormatter( + ((ProtoMessageRequestFormatter) + cancelOperationMethodDescriptor.getRequestFormatter()) + .toBuilder() + .updateRawPath( + customOperationHttpBindings.get(LRO_CANCEL_OPERATION).getPost()) + .setAdditionalPaths( + customOperationHttpBindings + .get(LRO_CANCEL_OPERATION) + .getAdditionalBindingsList() + .stream() + .map(this::getValueBasedOnPatternCase) + .toArray(String[]::new)) + .build()) + .build(); + } + } + + /* + This function returns the list of method descriptors (custom or default). + This is meant to be called only for tests. + */ + @VisibleForTesting + @InternalApi + public List getAllMethodDescriptors() { + return ImmutableList.of( + listOperationsMethodDescriptor, + getOperationMethodDescriptor, + deleteOperationMethodDescriptor, + cancelOperationMethodDescriptor); } @InternalApi public static List getMethodDescriptors() { - List methodDescriptors = new ArrayList<>(); - methodDescriptors.add(listOperationsMethodDescriptor); - methodDescriptors.add(getOperationMethodDescriptor); - methodDescriptors.add(deleteOperationMethodDescriptor); - methodDescriptors.add(cancelOperationMethodDescriptor); - return methodDescriptors; + return ImmutableList.of(); } @Override diff --git a/gax-java/gax-httpjson/src/main/java/com/google/api/gax/httpjson/longrunning/stub/OperationsStubSettings.java b/gax-java/gax-httpjson/src/main/java/com/google/api/gax/httpjson/longrunning/stub/OperationsStubSettings.java index 5f327a1091..b1664088a5 100644 --- a/gax-java/gax-httpjson/src/main/java/com/google/api/gax/httpjson/longrunning/stub/OperationsStubSettings.java +++ b/gax-java/gax-httpjson/src/main/java/com/google/api/gax/httpjson/longrunning/stub/OperationsStubSettings.java @@ -65,7 +65,6 @@ import com.google.protobuf.Empty; import java.io.IOException; import java.util.List; -import org.threeten.bp.Duration; // AUTO-GENERATED DOCUMENTATION AND CLASS. /** @@ -293,13 +292,13 @@ public static class Builder extends StubSettings.Builder headersMap = @@ -120,7 +120,7 @@ public void testSetHeaders() { } @Test - public void testGetUserAgentValue() { + void testGetUserAgentValue() { Map headersMap = ImmutableMap.of( "Custom-Header", "CustomHeader", "User-Agent", "this is me", "accept", "Accept"); diff --git a/gax-java/gax-httpjson/src/test/java/com/google/api/gax/httpjson/HttpJsonApiExceptionFactoryTest.java b/gax-java/gax-httpjson/src/test/java/com/google/api/gax/httpjson/HttpJsonApiExceptionFactoryTest.java new file mode 100644 index 0000000000..2c7d01c47b --- /dev/null +++ b/gax-java/gax-httpjson/src/test/java/com/google/api/gax/httpjson/HttpJsonApiExceptionFactoryTest.java @@ -0,0 +1,151 @@ +/* + * Copyright 2026 Google LLC + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Google LLC nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +package com.google.api.gax.httpjson; + +import static com.google.common.truth.Truth.assertThat; + +import com.google.api.client.http.HttpHeaders; +import com.google.api.client.http.HttpResponseException; +import com.google.api.gax.rpc.ApiException; +import com.google.api.gax.rpc.ErrorDetails; +import com.google.api.gax.rpc.StatusCode.Code; +import com.google.common.collect.ImmutableSet; +import org.junit.jupiter.api.Test; + +class HttpJsonApiExceptionFactoryTest { + + @Test + void testCreate_withAllFieldsPresent() { + String payload = + "{\n" + + " \"error\": {\n" + + " \"code\": 7,\n" + + " \"message\": \"The caller does not have permission\",\n" + + " \"details\": [\n" + + " {\n" + + " \"@type\": \"type.googleapis.com/google.rpc.ErrorInfo\",\n" + + " \"reason\": \"SERVICE_DISABLED\",\n" + + " \"domain\": \"googleapis.com\",\n" + + " \"metadata\": {\n" + + " \"service\": \"pubsub.googleapis.com\"\n" + + " }\n" + + " }\n" + + " ]\n" + + " }\n" + + "}"; + + HttpResponseException exception = + new HttpResponseException.Builder(403, "Forbidden", new HttpHeaders()) + .setContent(payload) + .build(); + + HttpJsonApiExceptionFactory factory = + new HttpJsonApiExceptionFactory(ImmutableSet.of(Code.UNAVAILABLE)); + ApiException apiException = factory.create(exception); + + // The status code should be derived from the JSON code (7), ignoring HTTP code (403). + assertThat(apiException.getStatusCode().getCode()).isEqualTo(Code.PERMISSION_DENIED); + assertThat(apiException.isRetryable()).isFalse(); + // The message should be overridden by the JSON message + assertThat(apiException.getMessage()).contains("The caller does not have permission"); + + ErrorDetails details = apiException.getErrorDetails(); + assertThat(details).isNotNull(); + assertThat(details.getErrorInfo()).isNotNull(); + assertThat(details.getErrorInfo().getReason()).isEqualTo("SERVICE_DISABLED"); + assertThat(details.getErrorInfo().getDomain()).isEqualTo("googleapis.com"); + assertThat(details.getErrorInfo().getMetadataMap().get("service")) + .isEqualTo("pubsub.googleapis.com"); + } + + @Test + void testCreate_withOkStatusNoMessageNoDetails() { + String payload = "{\n \"error\": {\n \"code\": 0\n }\n}"; + + HttpResponseException exception = + new HttpResponseException.Builder(403, "Forbidden", new HttpHeaders()) + .setContent(payload) + .build(); + + HttpJsonApiExceptionFactory factory = + new HttpJsonApiExceptionFactory(ImmutableSet.of(Code.UNAVAILABLE)); + ApiException apiException = factory.create(exception); + + // Because code is 0 (OK), it falls back to the HTTP status code (403 -> PERMISSION_DENIED). + assertThat(apiException.getStatusCode().getCode()).isEqualTo(Code.PERMISSION_DENIED); + assertThat(apiException.isRetryable()).isFalse(); + // Because there is no message in the payload, it falls back to the HTTP status message. + assertThat(apiException.getMessage()).contains("Forbidden"); + // Details are unconditionally built, but empty. + assertThat(apiException.getErrorDetails()).isNotNull(); + assertThat(apiException.getErrorDetails().getErrorInfo()).isNull(); + } + + @Test + void testCreate_withMessageOverridesHttpStatusMessage() { + String payload = + "{\n" + + " \"error\": {\n" + + " \"message\": \"Custom detailed error message from server\"\n" + + " }\n" + + "}"; + + // Transport layer returned generic "Bad Request" phrase + HttpResponseException exception = + new HttpResponseException.Builder(400, "Bad Request", new HttpHeaders()) + .setContent(payload) + .build(); + + HttpJsonApiExceptionFactory factory = + new HttpJsonApiExceptionFactory(ImmutableSet.of(Code.UNAVAILABLE)); + ApiException apiException = factory.create(exception); + + assertThat(apiException.getMessage()).contains("Custom detailed error message from server"); + assertThat(apiException.getMessage()).doesNotContain("Bad Request"); + } + + @Test + void testCreate_withoutErrorDetails() { + HttpResponseException exception = + new HttpResponseException.Builder(503, "Service Unavailable", new HttpHeaders()) + .setContent("plain text error") + .build(); + + HttpJsonApiExceptionFactory factory = + new HttpJsonApiExceptionFactory(ImmutableSet.of(Code.UNAVAILABLE)); + ApiException apiException = factory.create(exception); + + assertThat(apiException.getStatusCode().getCode()).isEqualTo(Code.UNAVAILABLE); + assertThat(apiException.isRetryable()).isTrue(); + // Plain text error parsing will still generate an empty ErrorDetails + assertThat(apiException.getErrorDetails()).isNotNull(); + assertThat(apiException.getErrorDetails().getErrorInfo()).isNull(); + } +} diff --git a/gax-java/gax-httpjson/src/test/java/com/google/api/gax/httpjson/HttpJsonCallContextTest.java b/gax-java/gax-httpjson/src/test/java/com/google/api/gax/httpjson/HttpJsonCallContextTest.java index fc872d3529..156b4bb039 100644 --- a/gax-java/gax-httpjson/src/test/java/com/google/api/gax/httpjson/HttpJsonCallContextTest.java +++ b/gax-java/gax-httpjson/src/test/java/com/google/api/gax/httpjson/HttpJsonCallContextTest.java @@ -29,10 +29,12 @@ */ package com.google.api.gax.httpjson; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotNull; -import static org.junit.Assert.assertNull; -import static org.junit.Assert.assertTrue; +import static com.google.api.gax.util.TimeConversionTestUtils.testDurationMethod; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertNull; +import static org.junit.jupiter.api.Assertions.assertThrows; +import static org.junit.jupiter.api.Assertions.assertTrue; import com.google.api.gax.retrying.RetrySettings; import com.google.api.gax.rpc.ApiCallContext; @@ -49,30 +51,23 @@ import java.util.List; import java.util.Map; import java.util.Set; -import org.junit.Assert; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.junit.runners.JUnit4; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; import org.mockito.Mockito; -import org.threeten.bp.Duration; -@RunWith(JUnit4.class) -public class HttpJsonCallContextTest { +class HttpJsonCallContextTest { @Test - public void testNullToSelfWrongType() { - try { - HttpJsonCallContext.createDefault().nullToSelf(FakeCallContext.createDefault()); - Assert.fail("HttpJsonCallContext should have thrown an exception"); - } catch (IllegalArgumentException expected) { - Truth.assertThat(expected) - .hasMessageThat() - .contains("context must be an instance of HttpJsonCallContext"); - } + void testNullToSelfWrongType() { + IllegalArgumentException actual = + assertThrows( + IllegalArgumentException.class, + () -> HttpJsonCallContext.createDefault().nullToSelf(FakeCallContext.createDefault())); + assertTrue(actual.getMessage().contains("context must be an instance of HttpJsonCallContext")); } @Test - public void testWithCredentials() { + void testWithCredentials() { Credentials credentials = Mockito.mock(Credentials.class); HttpJsonCallContext emptyContext = HttpJsonCallContext.createDefault(); assertNull(emptyContext.getCredentials()); @@ -81,7 +76,7 @@ public void testWithCredentials() { } @Test - public void testWithTransportChannel() { + void testWithTransportChannel() { ManagedHttpJsonChannel channel = Mockito.mock(ManagedHttpJsonChannel.class); HttpJsonCallContext context = @@ -92,22 +87,22 @@ public void testWithTransportChannel() { } @Test - public void testWithTransportChannelWrongType() { + void testWithTransportChannelWrongType() { try { FakeChannel channel = new FakeChannel(); HttpJsonCallContext.createDefault() .withTransportChannel(FakeTransportChannel.create(channel)); - Assert.fail("HttpJsonCallContext should have thrown an exception"); + Assertions.fail("HttpJsonCallContext should have thrown an exception"); } catch (IllegalArgumentException expected) { Truth.assertThat(expected).hasMessageThat().contains("Expected HttpJsonTransportChannel"); } } @Test - public void testMergeWrongType() { + void testMergeWrongType() { try { HttpJsonCallContext.createDefault().merge(FakeCallContext.createDefault()); - Assert.fail("HttpJsonCallContext should have thrown an exception"); + Assertions.fail("HttpJsonCallContext should have thrown an exception"); } catch (IllegalArgumentException expected) { Truth.assertThat(expected) .hasMessageThat() @@ -116,73 +111,127 @@ public void testMergeWrongType() { } @Test - public void testWithTimeout() { - assertNull(HttpJsonCallContext.createDefault().withTimeout(null).getTimeout()); + void testStreamIdleTimeout() { + final long millis = 3; + final HttpJsonCallContext defaultContext = HttpJsonCallContext.createDefault(); + testDurationMethod( + millis, + jt -> defaultContext.withStreamIdleTimeoutDuration(jt), + tt -> defaultContext.withStreamIdleTimeout(tt), + c -> c.getStreamIdleTimeoutDuration(), + c -> c.getStreamIdleTimeout()); + } + + @Test + public void testStreamWaitTimeout() { + final long millis = 3; + final HttpJsonCallContext defaultContext = HttpJsonCallContext.createDefault(); + testDurationMethod( + millis, + jt -> defaultContext.withStreamWaitTimeoutDuration(jt), + tt -> defaultContext.withStreamWaitTimeout(tt), + c -> c.getStreamWaitTimeoutDuration(), + c -> c.getStreamWaitTimeout()); } @Test - public void testWithNegativeTimeout() { + public void testTimeout() { + final long millis = 3; + final HttpJsonCallContext defaultContext = HttpJsonCallContext.createDefault(); + testDurationMethod( + millis, + jt -> defaultContext.withTimeoutDuration(jt), + tt -> defaultContext.withTimeout(tt), + c -> c.getTimeoutDuration(), + c -> c.getTimeout()); + } + + @Test + public void testNullTimeout() { + final HttpJsonCallContext defaultContext = HttpJsonCallContext.createDefault(); + testDurationMethod( + null, + jt -> defaultContext.withTimeoutDuration(jt), + tt -> defaultContext.withTimeout(tt), + c -> c.getTimeoutDuration(), + c -> c.getTimeout()); + } + + @Test + void testWithNegativeTimeout() { assertNull( - HttpJsonCallContext.createDefault().withTimeout(Duration.ofSeconds(-1L)).getTimeout()); + HttpJsonCallContext.createDefault() + .withTimeoutDuration(java.time.Duration.ofSeconds(-1L)) + .getTimeoutDuration()); } @Test - public void testWithZeroTimeout() { + void testWithZeroTimeout() { assertNull( - HttpJsonCallContext.createDefault().withTimeout(Duration.ofSeconds(0L)).getTimeout()); + HttpJsonCallContext.createDefault() + .withTimeoutDuration(java.time.Duration.ofSeconds(0L)) + .getTimeoutDuration()); } @Test - public void testWithShorterTimeout() { + void testWithShorterTimeout() { HttpJsonCallContext ctxWithLongTimeout = - HttpJsonCallContext.createDefault().withTimeout(Duration.ofSeconds(10)); + HttpJsonCallContext.createDefault().withTimeoutDuration(java.time.Duration.ofSeconds(10)); // Sanity check - Truth.assertThat(ctxWithLongTimeout.getTimeout()).isEqualTo(Duration.ofSeconds(10)); + Truth.assertThat(ctxWithLongTimeout.getTimeoutDuration()) + .isEqualTo(java.time.Duration.ofSeconds(10)); // Shorten the timeout and make sure it changed HttpJsonCallContext ctxWithShorterTimeout = - ctxWithLongTimeout.withTimeout(Duration.ofSeconds(5)); - Truth.assertThat(ctxWithShorterTimeout.getTimeout()).isEqualTo(Duration.ofSeconds(5)); + ctxWithLongTimeout.withTimeoutDuration(java.time.Duration.ofSeconds(5)); + Truth.assertThat(ctxWithShorterTimeout.getTimeoutDuration()) + .isEqualTo(java.time.Duration.ofSeconds(5)); } @Test - public void testWithLongerTimeout() { + void testWithLongerTimeout() { HttpJsonCallContext ctxWithShortTimeout = - HttpJsonCallContext.createDefault().withTimeout(Duration.ofSeconds(5)); + HttpJsonCallContext.createDefault().withTimeoutDuration(java.time.Duration.ofSeconds(5)); // Sanity check - Truth.assertThat(ctxWithShortTimeout.getTimeout()).isEqualTo(Duration.ofSeconds(5)); + Truth.assertThat(ctxWithShortTimeout.getTimeoutDuration()) + .isEqualTo(java.time.Duration.ofSeconds(5)); // Try to extend the timeout and verify that it was ignored HttpJsonCallContext ctxWithUnchangedTimeout = - ctxWithShortTimeout.withTimeout(Duration.ofSeconds(10)); - Truth.assertThat(ctxWithUnchangedTimeout.getTimeout()).isEqualTo(Duration.ofSeconds(5)); + ctxWithShortTimeout.withTimeoutDuration(java.time.Duration.ofSeconds(10)); + Truth.assertThat(ctxWithUnchangedTimeout.getTimeoutDuration()) + .isEqualTo(java.time.Duration.ofSeconds(5)); } @Test - public void testMergeWithNullTimeout() { - Duration timeout = Duration.ofSeconds(10); - HttpJsonCallContext baseContext = HttpJsonCallContext.createDefault().withTimeout(timeout); + void testMergeWithNullTimeout() { + java.time.Duration timeout = java.time.Duration.ofSeconds(10); + HttpJsonCallContext baseContext = + HttpJsonCallContext.createDefault().withTimeoutDuration(timeout); HttpJsonCallContext defaultOverlay = HttpJsonCallContext.createDefault(); - Truth.assertThat(baseContext.merge(defaultOverlay).getTimeout()).isEqualTo(timeout); + Truth.assertThat(baseContext.merge(defaultOverlay).getTimeoutDuration()).isEqualTo(timeout); - HttpJsonCallContext explicitNullOverlay = HttpJsonCallContext.createDefault().withTimeout(null); - Truth.assertThat(baseContext.merge(explicitNullOverlay).getTimeout()).isEqualTo(timeout); + java.time.Duration callContextTimeout = null; + HttpJsonCallContext explicitNullOverlay = + HttpJsonCallContext.createDefault().withTimeoutDuration(callContextTimeout); + Truth.assertThat(baseContext.merge(explicitNullOverlay).getTimeoutDuration()) + .isEqualTo(timeout); } @Test - public void testMergeWithTimeout() { - Duration timeout = Duration.ofSeconds(19); + void testMergeWithTimeout() { + java.time.Duration timeout = java.time.Duration.ofSeconds(19); HttpJsonCallContext ctx1 = HttpJsonCallContext.createDefault(); - HttpJsonCallContext ctx2 = HttpJsonCallContext.createDefault().withTimeout(timeout); + HttpJsonCallContext ctx2 = HttpJsonCallContext.createDefault().withTimeoutDuration(timeout); - Truth.assertThat(ctx1.merge(ctx2).getTimeout()).isEqualTo(timeout); + Truth.assertThat(ctx1.merge(ctx2).getTimeoutDuration()).isEqualTo(timeout); } @Test - public void testMergeWithTracer() { + void testMergeWithTracer() { ApiTracer explicitTracer = Mockito.mock(ApiTracer.class); HttpJsonCallContext ctxWithExplicitTracer = HttpJsonCallContext.createDefault().withTracer(explicitTracer); @@ -204,7 +253,7 @@ public void testMergeWithTracer() { } @Test - public void testWithRetrySettings() { + void testWithRetrySettings() { RetrySettings retrySettings = Mockito.mock(RetrySettings.class); HttpJsonCallContext emptyContext = HttpJsonCallContext.createDefault(); assertNull(emptyContext.getRetrySettings()); @@ -213,7 +262,7 @@ public void testWithRetrySettings() { } @Test - public void testWithRetryableCodes() { + void testWithRetryableCodes() { Set codes = Collections.singleton(StatusCode.Code.UNAVAILABLE); HttpJsonCallContext emptyContext = HttpJsonCallContext.createDefault(); assertNull(emptyContext.getRetryableCodes()); @@ -222,7 +271,7 @@ public void testWithRetryableCodes() { } @Test - public void testWithExtraHeaders() { + void testWithExtraHeaders() { Map> headers = ImmutableMap.of("k", Arrays.asList("v")); ApiCallContext emptyContext = HttpJsonCallContext.createDefault(); assertTrue(emptyContext.getExtraHeaders().isEmpty()); @@ -231,7 +280,7 @@ public void testWithExtraHeaders() { } @Test - public void testWithOptions() { + void testWithOptions() { ApiCallContext emptyCallContext = HttpJsonCallContext.createDefault(); ApiCallContext.Key contextKey1 = ApiCallContext.Key.create("testKey1"); ApiCallContext.Key contextKey2 = ApiCallContext.Key.create("testKey2"); @@ -249,7 +298,7 @@ public void testWithOptions() { } @Test - public void testMergeOptions() { + void testMergeOptions() { ApiCallContext emptyCallContext = HttpJsonCallContext.createDefault(); ApiCallContext.Key contextKey1 = ApiCallContext.Key.create("testKey1"); ApiCallContext.Key contextKey2 = ApiCallContext.Key.create("testKey2"); diff --git a/gax-java/gax-httpjson/src/test/java/com/google/api/gax/httpjson/HttpJsonCallOptionsTest.java b/gax-java/gax-httpjson/src/test/java/com/google/api/gax/httpjson/HttpJsonCallOptionsTest.java new file mode 100644 index 0000000000..c6aa69d4d8 --- /dev/null +++ b/gax-java/gax-httpjson/src/test/java/com/google/api/gax/httpjson/HttpJsonCallOptionsTest.java @@ -0,0 +1,61 @@ +/* + * Copyright 2024 Google LLC + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Google LLC nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +package com.google.api.gax.httpjson; + +import static com.google.api.gax.util.TimeConversionTestUtils.testDurationMethod; +import static com.google.api.gax.util.TimeConversionTestUtils.testInstantMethod; + +import org.junit.jupiter.api.Test; + +public class HttpJsonCallOptionsTest { + private final HttpJsonCallOptions.Builder OPTIONS_BUILDER = HttpJsonCallOptions.newBuilder(); + + @Test + public void testDeadline() { + final long millis = 3; + testInstantMethod( + millis, + jt -> OPTIONS_BUILDER.setDeadlineInstant(jt), + tt -> OPTIONS_BUILDER.setDeadline(tt), + c -> c.build().getDeadlineInstant(), + c -> c.build().getDeadline()); + } + + @Test + public void testTimeout() { + final long millis = 3; + testDurationMethod( + millis, + jt -> OPTIONS_BUILDER.setTimeoutDuration(jt), + tt -> OPTIONS_BUILDER.setTimeout(tt), + c -> c.build().getTimeoutDuration(), + c -> c.build().getTimeout()); + } +} diff --git a/gax-java/gax-httpjson/src/test/java/com/google/api/gax/httpjson/HttpJsonCallableFactoryTest.java b/gax-java/gax-httpjson/src/test/java/com/google/api/gax/httpjson/HttpJsonCallableFactoryTest.java index 4d0785f242..28fb585f7b 100644 --- a/gax-java/gax-httpjson/src/test/java/com/google/api/gax/httpjson/HttpJsonCallableFactoryTest.java +++ b/gax-java/gax-httpjson/src/test/java/com/google/api/gax/httpjson/HttpJsonCallableFactoryTest.java @@ -33,25 +33,31 @@ import static com.google.common.truth.Truth.assertWithMessage; import com.google.api.client.http.HttpMethods; +import com.google.api.gax.tracing.ApiTracerContext; import com.google.api.gax.tracing.SpanName; +import com.google.api.pathtemplate.PathTemplate; import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; import java.util.List; import java.util.Map; import java.util.Map.Entry; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.junit.runners.JUnit4; +import org.junit.jupiter.api.Test; import org.mockito.Mockito; -@RunWith(JUnit4.class) -public class HttpJsonCallableFactoryTest { +class HttpJsonCallableFactoryTest { + private HttpRequestFormatter createMockRequestFormatter() { + HttpRequestFormatter formatter = Mockito.mock(HttpRequestFormatter.class); + PathTemplate template = PathTemplate.create("/test/path/template"); + Mockito.when(formatter.getPathTemplate()).thenReturn(template); + return formatter; + } + @Test - public void testGetSpanName() { + void testGetApiTracerContext() { Map validNames = ImmutableMap.of( - "compute.projects.disableXpnHost", SpanName.of("compute.projects", "disableXpnHost"), - "client.method", SpanName.of("client", "method")); + "google.cloud.service.v1.CoolService/CoolRPC", SpanName.of("CoolService", "CoolRPC"), + "CoolService/CoolRPC", SpanName.of("CoolService", "CoolRPC")); for (Entry entry : validNames.entrySet()) { @SuppressWarnings("unchecked") @@ -59,17 +65,19 @@ public void testGetSpanName() { ApiMethodDescriptor.newBuilder() .setFullMethodName(entry.getKey()) .setHttpMethod(HttpMethods.POST) - .setRequestFormatter(Mockito.mock(HttpRequestFormatter.class)) + .setRequestFormatter(createMockRequestFormatter()) .setResponseParser(Mockito.mock(HttpResponseParser.class)) .build(); - SpanName actualSpanName = HttpJsonCallableFactory.getSpanName(descriptor); - assertThat(actualSpanName).isEqualTo(entry.getValue()); + ApiTracerContext context = HttpJsonCallableFactory.getApiTracerContext(descriptor); + SpanName actual = SpanName.of(context); + assertThat(actual.getClientName()).isEqualTo(entry.getValue().getClientName()); + assertThat(actual.getMethodName()).isEqualTo(entry.getValue().getMethodName()); } } @Test - public void testGetSpanNameInvalid() { + void testGetApiTracerContextInvalid() { List invalidNames = ImmutableList.of("no_split", ".no_client"); for (String invalidName : invalidNames) { @@ -78,16 +86,16 @@ public void testGetSpanNameInvalid() { ApiMethodDescriptor.newBuilder() .setFullMethodName(invalidName) .setHttpMethod(HttpMethods.POST) - .setRequestFormatter(Mockito.mock(HttpRequestFormatter.class)) + .setRequestFormatter(createMockRequestFormatter()) .setResponseParser(Mockito.mock(HttpResponseParser.class)) .build(); IllegalArgumentException actualError = null; try { - SpanName spanName = HttpJsonCallableFactory.getSpanName(descriptor); + ApiTracerContext context = HttpJsonCallableFactory.getApiTracerContext(descriptor); + SpanName.of(context); assertWithMessage( - "Invalid method descriptor should not have a valid span name: %s should not generate the spanName: %s", - invalidName, spanName) + "Invalid method descriptor should not have a valid client name: %s", invalidName) .fail(); } catch (IllegalArgumentException e) { actualError = e; diff --git a/gax-java/gax-httpjson/src/test/java/com/google/api/gax/httpjson/HttpJsonClientCallImplTest.java b/gax-java/gax-httpjson/src/test/java/com/google/api/gax/httpjson/HttpJsonClientCallImplTest.java new file mode 100644 index 0000000000..2853e79ad5 --- /dev/null +++ b/gax-java/gax-httpjson/src/test/java/com/google/api/gax/httpjson/HttpJsonClientCallImplTest.java @@ -0,0 +1,138 @@ +/* + * Copyright 2024 Google LLC + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Google LLC nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +package com.google.api.gax.httpjson; + +import com.google.api.client.http.HttpTransport; +import com.google.common.truth.Truth; +import com.google.protobuf.TypeRegistry; +import java.io.ByteArrayInputStream; +import java.io.InputStream; +import java.io.Reader; +import java.util.concurrent.Executor; +import java.util.concurrent.ScheduledThreadPoolExecutor; +import java.util.concurrent.TimeUnit; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; +import org.mockito.Mock; +import org.mockito.Mockito; +import org.mockito.junit.jupiter.MockitoExtension; + +@ExtendWith(MockitoExtension.class) +class HttpJsonClientCallImplTest { + @Mock private ApiMethodDescriptor apiMethodDescriptor; + @Mock private HttpResponseParser httpResponseParser; + @Mock private HttpJsonCallOptions httpJsonCallOptions; + @Mock private TypeRegistry typeRegistry; + @Mock private HttpTransport httpTransport; + @Mock private Executor executor; + @Mock private HttpJsonClientCall.Listener listener; + + @Test + void responseReceived_noCancellationTask() { + ScheduledThreadPoolExecutor deadlineSchedulerExecutor = new ScheduledThreadPoolExecutor(1); + // Null timeout means no timeout task created + Mockito.when(httpJsonCallOptions.getTimeoutDuration()).thenReturn(null); + + HttpJsonClientCallImpl httpJsonClientCall = + new HttpJsonClientCallImpl<>( + apiMethodDescriptor, + "", + httpJsonCallOptions, + httpTransport, + executor, + deadlineSchedulerExecutor); + httpJsonClientCall.start(listener, HttpJsonMetadata.newBuilder().build()); + // No timeout task in the work queue + Truth.assertThat(deadlineSchedulerExecutor.getQueue().size()).isEqualTo(0); + // Follows the numMessages requested from HttpJsonClientCalls.futureUnaryCall() + httpJsonClientCall.request(2); + httpJsonClientCall.setResult( + HttpRequestRunnable.RunnableResult.builder() + .setStatusCode(200) + .setTrailers(HttpJsonMetadata.newBuilder().build()) + .build()); + Truth.assertThat(deadlineSchedulerExecutor.getQueue().size()).isEqualTo(0); + deadlineSchedulerExecutor.shutdown(); + // Scheduler is not waiting for any task and should terminate immediately + Truth.assertThat(deadlineSchedulerExecutor.isTerminated()).isTrue(); + } + + @Test + void responseReceived_cancellationTaskExists_isCancelledProperly() throws InterruptedException { + ScheduledThreadPoolExecutor deadlineSchedulerExecutor = new ScheduledThreadPoolExecutor(1); + // SetRemoveOnCancelPolicy will immediately remove the task from the work queue + // when the task is cancelled + deadlineSchedulerExecutor.setRemoveOnCancelPolicy(true); + + // Setting a timeout for this call will enqueue a timeout task + Mockito.when(httpJsonCallOptions.getTimeoutDuration()) + .thenReturn(java.time.Duration.ofMinutes(10)); + + String response = "Content"; + InputStream inputStream = new ByteArrayInputStream(response.getBytes()); + Mockito.when(httpJsonCallOptions.getTypeRegistry()).thenReturn(typeRegistry); + Mockito.when(apiMethodDescriptor.getResponseParser()).thenReturn(httpResponseParser); + Mockito.when( + httpResponseParser.parse(Mockito.any(Reader.class), Mockito.any(TypeRegistry.class))) + .thenReturn(response); + HttpJsonClientCallImpl httpJsonClientCall = + new HttpJsonClientCallImpl<>( + apiMethodDescriptor, + "", + httpJsonCallOptions, + httpTransport, + executor, + deadlineSchedulerExecutor); + httpJsonClientCall.start(listener, HttpJsonMetadata.newBuilder().build()); + // The timeout task is scheduled for 10 minutes from invocation. The task should be + // populated in the work queue, scheduled to run, but not active yet. + Truth.assertThat(deadlineSchedulerExecutor.getQueue().size()).isEqualTo(1); + // Follows the numMessages requested from HttpJsonClientCalls.futureUnaryCall() + httpJsonClientCall.request(2); + httpJsonClientCall.setResult( + HttpRequestRunnable.RunnableResult.builder() + .setStatusCode(200) + .setTrailers(HttpJsonMetadata.newBuilder().build()) + .setResponseContent(inputStream) + .build()); + // After the result is received, `close()` should have run and removed the timeout task + // Expect that there are no tasks in the queue and no active tasks + Truth.assertThat(deadlineSchedulerExecutor.getQueue().size()).isEqualTo(0); + deadlineSchedulerExecutor.shutdown(); + + // Ideally, this test wouldn't need to awaitTermination. Given the machine this test + // is running on, we can't guarantee that isTerminated is true immediately. The point + // of this test is that it doesn't wait the full timeout duration (10 min) to terminate + // and rather is able to terminate after we invoke shutdown on the deadline scheduler. + deadlineSchedulerExecutor.awaitTermination(5, TimeUnit.SECONDS); + // Scheduler is not waiting for any task and should terminate quickly + Truth.assertThat(deadlineSchedulerExecutor.isTerminated()).isTrue(); + } +} diff --git a/gax-java/gax-httpjson/src/test/java/com/google/api/gax/httpjson/HttpJsonClientCallsTest.java b/gax-java/gax-httpjson/src/test/java/com/google/api/gax/httpjson/HttpJsonClientCallsTest.java new file mode 100644 index 0000000000..7e2d9cb946 --- /dev/null +++ b/gax-java/gax-httpjson/src/test/java/com/google/api/gax/httpjson/HttpJsonClientCallsTest.java @@ -0,0 +1,142 @@ +/* + * Copyright 2024 Google LLC + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Google LLC nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +package com.google.api.gax.httpjson; + +import static com.google.common.truth.Truth.assertThat; +import static org.junit.jupiter.api.Assertions.assertThrows; + +import com.google.api.gax.rpc.EndpointContext; +import com.google.api.gax.rpc.StatusCode; +import com.google.api.gax.rpc.UnauthenticatedException; +import com.google.auth.Credentials; +import com.google.auth.Retryable; +import java.io.IOException; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.mockito.Mockito; + +class HttpJsonClientCallsTest { + + // Auth Library's GoogleAuthException is package-private. Copy basic functionality for tests + private static class GoogleAuthException extends IOException implements Retryable { + + private final boolean isRetryable; + + private GoogleAuthException(boolean isRetryable) { + this.isRetryable = isRetryable; + } + + @Override + public boolean isRetryable() { + return isRetryable; + } + + @Override + public int getRetryCount() { + return 0; + } + } + + private Credentials credentials; + private EndpointContext endpointContext; + private HttpJsonChannel mockChannel; + private ApiMethodDescriptor descriptor; + private HttpJsonCallOptions callOptions; + private HttpJsonCallContext callContext; + + @BeforeEach + void setUp() throws IOException { + credentials = Mockito.mock(Credentials.class); + endpointContext = Mockito.mock(EndpointContext.class); + mockChannel = Mockito.mock(HttpJsonChannel.class); + descriptor = Mockito.mock(ApiMethodDescriptor.class); + callOptions = Mockito.mock(HttpJsonCallOptions.class); + + callContext = + HttpJsonCallContext.of(mockChannel, callOptions) + .withEndpointContext(endpointContext) + .withChannel(mockChannel); + + Mockito.when(callOptions.getCredentials()).thenReturn(credentials); + Mockito.doNothing() + .when(endpointContext) + .validateUniverseDomain( + Mockito.any(Credentials.class), Mockito.any(HttpJsonStatusCode.class)); + } + + @Test + void testValidUniverseDomain() { + HttpJsonClientCalls.newCall(descriptor, callContext); + Mockito.verify(mockChannel, Mockito.times(1)).newCall(descriptor, callOptions); + } + + // This test is when the universe domain does not match + @Test + void testInvalidUniverseDomain() throws IOException { + Mockito.doThrow( + new UnauthenticatedException( + null, HttpJsonStatusCode.of(StatusCode.Code.UNAUTHENTICATED), false)) + .when(endpointContext) + .validateUniverseDomain( + Mockito.any(Credentials.class), Mockito.any(HttpJsonStatusCode.class)); + + UnauthenticatedException exception = + assertThrows( + UnauthenticatedException.class, + () -> HttpJsonClientCalls.newCall(descriptor, callContext)); + assertThat(exception.getStatusCode().getCode()) + .isEqualTo(HttpJsonStatusCode.Code.UNAUTHENTICATED); + Mockito.verify(mockChannel, Mockito.never()).newCall(descriptor, callOptions); + } + + // This test is when the MDS is unable to return a valid universe domain + @Test + void testUniverseDomainNotReady_shouldRetry() throws IOException { + Mockito.doThrow(new GoogleAuthException(true)) + .when(endpointContext) + .validateUniverseDomain( + Mockito.any(Credentials.class), Mockito.any(HttpJsonStatusCode.class)); + HttpJsonCallContext context = + HttpJsonCallContext.createDefault() + .withChannel(mockChannel) + .withCredentials(credentials) + .withEndpointContext(endpointContext); + + HttpJsonCallOptions callOptions = context.getCallOptions(); + + UnauthenticatedException exception = + assertThrows( + UnauthenticatedException.class, + () -> HttpJsonClientCalls.newCall(descriptor, callContext)); + assertThat(exception.getStatusCode().getCode()) + .isEqualTo(HttpJsonStatusCode.Code.UNAUTHENTICATED); + Mockito.verify(mockChannel, Mockito.never()).newCall(descriptor, callOptions); + } +} diff --git a/gax-java/gax-httpjson/src/test/java/com/google/api/gax/httpjson/HttpJsonClientInterceptorTest.java b/gax-java/gax-httpjson/src/test/java/com/google/api/gax/httpjson/HttpJsonClientInterceptorTest.java index 6e081fb75f..85146ceb07 100644 --- a/gax-java/gax-httpjson/src/test/java/com/google/api/gax/httpjson/HttpJsonClientInterceptorTest.java +++ b/gax-java/gax-httpjson/src/test/java/com/google/api/gax/httpjson/HttpJsonClientInterceptorTest.java @@ -34,6 +34,8 @@ import com.google.api.gax.httpjson.ForwardingHttpJsonClientCall.SimpleForwardingHttpJsonClientCall; import com.google.api.gax.httpjson.ForwardingHttpJsonClientCallListener.SimpleForwardingHttpJsonClientCallListener; import com.google.api.gax.httpjson.testing.MockHttpService; +import com.google.api.gax.rpc.EndpointContext; +import com.google.auth.Credentials; import com.google.protobuf.Field; import com.google.protobuf.Field.Cardinality; import java.io.IOException; @@ -44,17 +46,14 @@ import java.util.concurrent.ExecutionException; import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; -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; -import org.threeten.bp.Duration; - -@RunWith(JUnit4.class) -public class HttpJsonClientInterceptorTest { +import org.junit.jupiter.api.AfterAll; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.mockito.Mockito; + +class HttpJsonClientInterceptorTest { private static class CapturingClientInterceptor implements HttpJsonClientInterceptor { // Manually capturing arguments instead of using Mockito. This is intentional, as this @@ -140,7 +139,7 @@ public void onClose(int statusCode, HttpJsonMetadata trailers) { private CapturingClientInterceptor interceptor; private ManagedHttpJsonChannel channel; - @BeforeClass + @BeforeAll public static void initialize() { executorService = Executors.newFixedThreadPool( @@ -152,13 +151,13 @@ public static void initialize() { }); } - @AfterClass + @AfterAll public static void destroy() { executorService.shutdownNow(); } - @Before - public void setUp() throws IOException { + @BeforeEach + void setUp() throws IOException { interceptor = new CapturingClientInterceptor(); channel = InstantiatingHttpJsonChannelProvider.newBuilder() @@ -172,20 +171,27 @@ public void setUp() throws IOException { .getManagedChannel(); } - @After - public void tearDown() { + @AfterEach + void tearDown() { MOCK_SERVICE.reset(); } @Test - public void testCustomInterceptor() throws ExecutionException, InterruptedException { + void testCustomInterceptor() throws ExecutionException, InterruptedException, IOException { HttpJsonDirectCallable callable = new HttpJsonDirectCallable<>(FAKE_METHOD_DESCRIPTOR); + EndpointContext endpointContext = Mockito.mock(EndpointContext.class); + Mockito.doNothing() + .when(endpointContext) + .validateUniverseDomain( + Mockito.any(Credentials.class), Mockito.any(HttpJsonStatusCode.class)); + HttpJsonCallContext callContext = HttpJsonCallContext.createDefault() .withChannel(channel) - .withTimeout(Duration.ofSeconds(30)); + .withTimeoutDuration(java.time.Duration.ofSeconds(30)) + .withEndpointContext(endpointContext); Field request; Field expectedResponse; diff --git a/gax-java/gax-httpjson/src/test/java/com/google/api/gax/httpjson/HttpJsonDirectCallableTest.java b/gax-java/gax-httpjson/src/test/java/com/google/api/gax/httpjson/HttpJsonDirectCallableTest.java index 2e9d5cb082..447a8354f1 100644 --- a/gax-java/gax-httpjson/src/test/java/com/google/api/gax/httpjson/HttpJsonDirectCallableTest.java +++ b/gax-java/gax-httpjson/src/test/java/com/google/api/gax/httpjson/HttpJsonDirectCallableTest.java @@ -35,10 +35,13 @@ import com.google.api.gax.httpjson.testing.MockHttpService; import com.google.api.gax.rpc.ApiException; import com.google.api.gax.rpc.ApiExceptionFactory; +import com.google.api.gax.rpc.EndpointContext; import com.google.api.gax.rpc.StatusCode.Code; import com.google.api.gax.rpc.testing.FakeStatusCode; +import com.google.auth.Credentials; import com.google.protobuf.Field; import com.google.protobuf.Field.Cardinality; +import java.io.IOException; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -46,17 +49,14 @@ import java.util.concurrent.ExecutionException; import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; -import org.junit.After; -import org.junit.AfterClass; -import org.junit.Assert; -import org.junit.BeforeClass; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.junit.runners.JUnit4; -import org.threeten.bp.Duration; - -@RunWith(JUnit4.class) -public class HttpJsonDirectCallableTest { +import org.junit.jupiter.api.AfterAll; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Test; +import org.mockito.Mockito; + +class HttpJsonDirectCallableTest { private static final ApiMethodDescriptor FAKE_METHOD_DESCRIPTOR = ApiMethodDescriptor.newBuilder() @@ -94,7 +94,9 @@ public class HttpJsonDirectCallableTest { private static final MockHttpService MOCK_SERVICE = new MockHttpService(Collections.singletonList(FAKE_METHOD_DESCRIPTOR), "google.com:443"); - private final ManagedHttpJsonChannel channel = + private static ExecutorService executorService; + + private static final ManagedHttpJsonChannel channel = new ManagedHttpJsonInterceptorChannel( ManagedHttpJsonChannel.newBuilder() .setEndpoint("google.com:443") @@ -103,10 +105,10 @@ public class HttpJsonDirectCallableTest { .build(), new HttpJsonHeaderInterceptor(Collections.singletonMap("header-key", "headerValue"))); - private static ExecutorService executorService; + private static HttpJsonCallContext defaultCallContext; - @BeforeClass - public static void initialize() { + @BeforeAll + public static void initialize() throws IOException { executorService = Executors.newFixedThreadPool( 2, @@ -115,35 +117,40 @@ public static void initialize() { t.setDaemon(true); return t; }); + EndpointContext endpointContext = Mockito.mock(EndpointContext.class); + Mockito.doNothing() + .when(endpointContext) + .validateUniverseDomain( + Mockito.any(Credentials.class), Mockito.any(HttpJsonStatusCode.class)); + defaultCallContext = + HttpJsonCallContext.createDefault() + .withChannel(channel) + .withTimeoutDuration(java.time.Duration.ofSeconds(30)) + .withEndpointContext(endpointContext); } - @AfterClass + @AfterAll public static void destroy() { executorService.shutdownNow(); } - @After - public void tearDown() { + @AfterEach + void tearDown() { MOCK_SERVICE.reset(); } @Test - public void testSuccessfulUnaryResponse() throws ExecutionException, InterruptedException { + void testSuccessfulUnaryResponse() throws ExecutionException, InterruptedException { HttpJsonDirectCallable callable = new HttpJsonDirectCallable<>(FAKE_METHOD_DESCRIPTOR); - HttpJsonCallContext callContext = - HttpJsonCallContext.createDefault() - .withChannel(channel) - .withTimeout(Duration.ofSeconds(30)); - Field request; Field expectedResponse; request = expectedResponse = createTestMessage(2); MOCK_SERVICE.addResponse(expectedResponse); - Field actualResponse = callable.futureCall(request, callContext).get(); + Field actualResponse = callable.futureCall(request, defaultCallContext).get(); assertThat(actualResponse).isEqualTo(expectedResponse); assertThat(MOCK_SERVICE.getRequestPaths().size()).isEqualTo(1); @@ -162,13 +169,11 @@ public void testSuccessfulUnaryResponse() throws ExecutionException, Interrupted * @throws ExecutionException */ @Test - public void testSuccessfulMultipleResponsesForUnaryCall() + void testSuccessfulMultipleResponsesForUnaryCall() throws InterruptedException, ExecutionException { HttpJsonDirectCallable callable = new HttpJsonDirectCallable<>(FAKE_METHOD_DESCRIPTOR); - HttpJsonCallContext callContext = HttpJsonCallContext.createDefault().withChannel(channel); - Field request = createTestMessage(2); Field expectedResponse = createTestMessage(2); Field otherResponse = createTestMessage(10); @@ -176,7 +181,7 @@ public void testSuccessfulMultipleResponsesForUnaryCall() MOCK_SERVICE.addResponse(otherResponse); MOCK_SERVICE.addResponse(otherResponse); - Field actualResponse = callable.futureCall(request, callContext).get(); + Field actualResponse = callable.futureCall(request, defaultCallContext).get(); assertThat(actualResponse).isEqualTo(expectedResponse); assertThat(MOCK_SERVICE.getRequestPaths().size()).isEqualTo(1); String headerValue = MOCK_SERVICE.getRequestHeaders().get("header-key").iterator().next(); @@ -194,13 +199,10 @@ public void testSuccessfulMultipleResponsesForUnaryCall() * @throws ExecutionException */ @Test - public void testErrorMultipleResponsesForUnaryCall() - throws InterruptedException, ExecutionException { + void testErrorMultipleResponsesForUnaryCall() throws InterruptedException, ExecutionException { HttpJsonDirectCallable callable = new HttpJsonDirectCallable<>(FAKE_METHOD_DESCRIPTOR); - HttpJsonCallContext callContext = HttpJsonCallContext.createDefault().withChannel(channel); - Field request = createTestMessage(2); Field expectedResponse = createTestMessage(2); Field randomResponse1 = createTestMessage(10); @@ -209,7 +211,7 @@ public void testErrorMultipleResponsesForUnaryCall() MOCK_SERVICE.addResponse(expectedResponse); MOCK_SERVICE.addResponse(randomResponse2); - Field actualResponse = callable.futureCall(request, callContext).get(); + Field actualResponse = callable.futureCall(request, defaultCallContext).get(); // Gax returns the first response for Unary Call assertThat(actualResponse).isEqualTo(randomResponse1); assertThat(actualResponse).isNotEqualTo(expectedResponse); @@ -224,20 +226,18 @@ public void testErrorMultipleResponsesForUnaryCall() * @throws InterruptedException */ @Test - public void testErrorUnaryResponse() throws InterruptedException { + void testErrorUnaryResponse() throws InterruptedException { HttpJsonDirectCallable callable = new HttpJsonDirectCallable<>(FAKE_METHOD_DESCRIPTOR); - HttpJsonCallContext callContext = HttpJsonCallContext.createDefault().withChannel(channel); - ApiException exception = ApiExceptionFactory.createException( new Exception(), FakeStatusCode.of(Code.NOT_FOUND), false); MOCK_SERVICE.addException(exception); try { - callable.futureCall(createTestMessage(2), callContext).get(); - Assert.fail("No exception raised"); + callable.futureCall(createTestMessage(2), defaultCallContext).get(); + Assertions.fail("No exception raised"); } catch (ExecutionException e) { HttpResponseException respExp = (HttpResponseException) e.getCause(); assertThat(respExp.getStatusCode()).isEqualTo(400); @@ -253,17 +253,15 @@ public void testErrorUnaryResponse() throws InterruptedException { * @throws InterruptedException */ @Test - public void testErrorNullContentSuccessfulResponse() throws InterruptedException { + void testErrorNullContentSuccessfulResponse() throws InterruptedException { HttpJsonDirectCallable callable = new HttpJsonDirectCallable<>(FAKE_METHOD_DESCRIPTOR); - HttpJsonCallContext callContext = HttpJsonCallContext.createDefault().withChannel(channel); - MOCK_SERVICE.addNullResponse(); try { - callable.futureCall(createTestMessage(2), callContext).get(); - Assert.fail("No exception raised"); + callable.futureCall(createTestMessage(2), defaultCallContext).get(); + Assertions.fail("No exception raised"); } catch (ExecutionException e) { HttpJsonStatusRuntimeException respExp = (HttpJsonStatusRuntimeException) e.getCause(); assertThat(respExp.getStatusCode()).isEqualTo(200); @@ -279,16 +277,15 @@ public void testErrorNullContentSuccessfulResponse() throws InterruptedException * @throws InterruptedException */ @Test - public void testErrorNullContentFailedResponse() throws InterruptedException { + void testErrorNullContentFailedResponse() throws InterruptedException { HttpJsonDirectCallable callable = new HttpJsonDirectCallable<>(FAKE_METHOD_DESCRIPTOR); - HttpJsonCallContext callContext = HttpJsonCallContext.createDefault().withChannel(channel); MOCK_SERVICE.addNullResponse(400); try { - callable.futureCall(createTestMessage(2), callContext).get(); - Assert.fail("No exception raised"); + callable.futureCall(createTestMessage(2), defaultCallContext).get(); + Assertions.fail("No exception raised"); } catch (ExecutionException e) { HttpResponseException respExp = (HttpResponseException) e.getCause(); assertThat(respExp.getStatusCode()).isEqualTo(400); @@ -302,20 +299,18 @@ public void testErrorNullContentFailedResponse() throws InterruptedException { * @throws InterruptedException */ @Test - public void testErrorNon2xxOr4xxResponse() throws InterruptedException { + void testErrorNon2xxOr4xxResponse() throws InterruptedException { HttpJsonDirectCallable callable = new HttpJsonDirectCallable<>(FAKE_METHOD_DESCRIPTOR); - HttpJsonCallContext callContext = HttpJsonCallContext.createDefault().withChannel(channel); - ApiException exception = ApiExceptionFactory.createException( new Exception(), FakeStatusCode.of(Code.INTERNAL), false); MOCK_SERVICE.addException(500, exception); try { - callable.futureCall(createTestMessage(2), callContext).get(); - Assert.fail("No exception raised"); + callable.futureCall(createTestMessage(2), defaultCallContext).get(); + Assertions.fail("No exception raised"); } catch (ExecutionException e) { HttpResponseException respExp = (HttpResponseException) e.getCause(); assertThat(respExp.getStatusCode()).isEqualTo(500); @@ -323,6 +318,34 @@ public void testErrorNon2xxOr4xxResponse() throws InterruptedException { } } + /** + * Expectation is that an RPC that exceeds the Timeout value set will receive a DEADLINE_EXCEEDED + * response back. In this test, the call has a timeout value that is smaller than the time it + * takes for the mock service to return a response. + * + * @throws InterruptedException + */ + @Test + void testDeadlineExceededResponse() throws InterruptedException { + HttpJsonDirectCallable callable = + new HttpJsonDirectCallable<>(FAKE_METHOD_DESCRIPTOR); + + HttpJsonCallContext callContext = + defaultCallContext.withTimeoutDuration(java.time.Duration.ofSeconds(3)); + + Field response = createTestMessage(10); + MOCK_SERVICE.addResponse(response, java.time.Duration.ofSeconds(5)); + + try { + callable.futureCall(createTestMessage(10), callContext).get(); + Assertions.fail("No exception raised"); + } catch (ExecutionException e) { + HttpJsonStatusRuntimeException respExp = (HttpJsonStatusRuntimeException) e.getCause(); + assertThat(respExp.getStatusCode()).isEqualTo(504); + assertThat(respExp.getMessage()).isEqualTo("Deadline exceeded"); + } + } + private Field createTestMessage(int number) { return Field.newBuilder() // "echo" service .setName("john/imTheBestField") diff --git a/gax-java/gax-httpjson/src/test/java/com/google/api/gax/httpjson/HttpJsonDirectServerStreamingCallableTest.java b/gax-java/gax-httpjson/src/test/java/com/google/api/gax/httpjson/HttpJsonDirectServerStreamingCallableTest.java index fe02406020..eeb73882a2 100644 --- a/gax-java/gax-httpjson/src/test/java/com/google/api/gax/httpjson/HttpJsonDirectServerStreamingCallableTest.java +++ b/gax-java/gax-httpjson/src/test/java/com/google/api/gax/httpjson/HttpJsonDirectServerStreamingCallableTest.java @@ -34,6 +34,8 @@ import com.google.api.gax.httpjson.testing.MockHttpService; import com.google.api.gax.rpc.ApiException; import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.DeadlineExceededException; +import com.google.api.gax.rpc.EndpointContext; import com.google.api.gax.rpc.ResponseObserver; import com.google.api.gax.rpc.ServerStream; import com.google.api.gax.rpc.ServerStreamingCallSettings; @@ -43,11 +45,13 @@ import com.google.api.gax.rpc.StatusCode.Code; import com.google.api.gax.rpc.StreamController; import com.google.api.gax.rpc.testing.FakeCallContext; +import com.google.auth.Credentials; import com.google.common.collect.Lists; import com.google.common.truth.Truth; import com.google.protobuf.Field; import com.google.type.Color; import com.google.type.Money; +import java.io.IOException; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -57,55 +61,13 @@ import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; import java.util.concurrent.TimeUnit; -import org.junit.After; -import org.junit.AfterClass; -import org.junit.Assert; -import org.junit.Before; -import org.junit.BeforeClass; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.junit.runners.JUnit4; - -@RunWith(JUnit4.class) -public class HttpJsonDirectServerStreamingCallableTest { - private static final ApiMethodDescriptor METHOD_SERVER_STREAMING_RECOGNIZE = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("google.cloud.v1.Fake/ServerStreamingRecognize") - .setHttpMethod("POST") - .setRequestFormatter( - ProtoMessageRequestFormatter.newBuilder() - .setPath( - "/fake/v1/recognize/{blue}", - request -> { - Map fields = new HashMap<>(); - ProtoRestSerializer serializer = ProtoRestSerializer.create(); - serializer.putPathParam(fields, "blue", request.getBlue()); - return fields; - }) - .setQueryParamsExtractor( - request -> { - Map> fields = new HashMap<>(); - ProtoRestSerializer serializer = ProtoRestSerializer.create(); - serializer.putQueryParam(fields, "red", request.getRed()); - return fields; - }) - .setRequestBodyExtractor( - request -> - ProtoRestSerializer.create() - .toBody( - "*", request.toBuilder().clearBlue().clearRed().build(), false)) - .build()) - .setResponseParser( - ProtoMessageResponseParser.newBuilder() - .setDefaultInstance(Money.getDefaultInstance()) - .build()) - .setType(MethodType.SERVER_STREAMING) - .build(); - - private static final MockHttpService MOCK_SERVICE = - new MockHttpService( - Collections.singletonList(METHOD_SERVER_STREAMING_RECOGNIZE), "google.com:443"); +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.mockito.Mockito; +class HttpJsonDirectServerStreamingCallableTest { private static final Color DEFAULT_REQUEST = Color.newBuilder().setRed(0.5f).build(); private static final Color ASYNC_REQUEST = DEFAULT_REQUEST.toBuilder().setGreen(1000).build(); private static final Color ERROR_REQUEST = Color.newBuilder().setRed(-1).build(); @@ -114,60 +76,103 @@ public class HttpJsonDirectServerStreamingCallableTest { private static final Money DEFAULTER_RESPONSE = Money.newBuilder().setCurrencyCode("UAH").setUnits(255).build(); - private ClientContext clientContext; private ServerStreamingCallSettings streamingCallSettings; private ServerStreamingCallable streamingCallable; - private static ExecutorService executorService; - - @BeforeClass - public static void initialize() { - executorService = Executors.newFixedThreadPool(2); - } + private ManagedHttpJsonChannel channel; + private ClientContext clientContext; + private ExecutorService executorService; + private MockHttpService mockService; + ApiMethodDescriptor methodServerStreamingRecognize; - @AfterClass - public static void destroy() { - executorService.shutdownNow(); + @BeforeEach + void initialize() throws IOException { + initialize(java.time.Duration.ofSeconds(30)); } - @Before - public void setUp() { - ManagedHttpJsonChannel channel = + void initialize(java.time.Duration timeout) throws IOException { + this.methodServerStreamingRecognize = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.v1.Fake/ServerStreamingRecognize") + .setHttpMethod("POST") + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/fake/v1/recognize/{blue}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = ProtoRestSerializer.create(); + serializer.putPathParam(fields, "blue", request.getBlue()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "red", request.getRed()); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody( + "*", request.toBuilder().clearBlue().clearRed().build(), false)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Money.getDefaultInstance()) + .build()) + .setType(MethodType.SERVER_STREAMING) + .build(); + this.mockService = + new MockHttpService( + Collections.singletonList(methodServerStreamingRecognize), "google.com:443"); + executorService = Executors.newFixedThreadPool(2); + channel = new ManagedHttpJsonInterceptorChannel( ManagedHttpJsonChannel.newBuilder() .setEndpoint("google.com:443") .setExecutor(executorService) - .setHttpTransport(MOCK_SERVICE) + .setHttpTransport(mockService) .build(), new HttpJsonHeaderInterceptor(Collections.singletonMap("header-key", "headerValue"))); - + EndpointContext endpointContext = Mockito.mock(EndpointContext.class); + Mockito.doNothing() + .when(endpointContext) + .validateUniverseDomain( + Mockito.any(Credentials.class), Mockito.any(HttpJsonStatusCode.class)); clientContext = ClientContext.newBuilder() .setTransportChannel(HttpJsonTransportChannel.create(channel)) - .setDefaultCallContext(HttpJsonCallContext.of(channel, HttpJsonCallOptions.DEFAULT)) + .setDefaultCallContext( + HttpJsonCallContext.of(channel, HttpJsonCallOptions.DEFAULT) + .withTimeoutDuration(timeout) + .withEndpointContext(endpointContext)) .build(); + streamingCallSettings = ServerStreamingCallSettings.newBuilder().build(); streamingCallable = HttpJsonCallableFactory.createServerStreamingCallable( - HttpJsonCallSettings.create(METHOD_SERVER_STREAMING_RECOGNIZE), + HttpJsonCallSettings.create(methodServerStreamingRecognize), streamingCallSettings, clientContext); } - @After - public void tearDown() { - MOCK_SERVICE.reset(); + @AfterEach + void destroy() throws InterruptedException { + executorService.shutdown(); + channel.shutdown(); } @Test - public void testBadContext() { - MOCK_SERVICE.addResponse(new Money[] {DEFAULT_RESPONSE}); - streamingCallable = + void testBadContext() { + mockService.addResponse(new Money[] {DEFAULT_RESPONSE}); + // Create a local callable with a bad context + ServerStreamingCallable streamingCallable = HttpJsonCallableFactory.createServerStreamingCallable( - HttpJsonCallSettings.create(METHOD_SERVER_STREAMING_RECOGNIZE), + HttpJsonCallSettings.create(this.methodServerStreamingRecognize), streamingCallSettings, - clientContext - .toBuilder() + clientContext.toBuilder() .setDefaultCallContext(FakeCallContext.createDefault()) .build()); @@ -176,7 +181,7 @@ public void testBadContext() { MoneyObserver observer = new MoneyObserver(true, latch); try { streamingCallable.call(DEFAULT_REQUEST, observer); - Assert.fail("Callable should have thrown an exception"); + Assertions.fail("Callable should have thrown an exception"); } catch (IllegalArgumentException expected) { Truth.assertThat(expected) .hasMessageThat() @@ -185,24 +190,19 @@ public void testBadContext() { } @Test - public void testServerStreamingStart() throws InterruptedException { - MOCK_SERVICE.addResponse(new Money[] {DEFAULT_RESPONSE}); + void testServerStreamingStart() throws InterruptedException { + mockService.addResponse(new Money[] {DEFAULT_RESPONSE}); CountDownLatch latch = new CountDownLatch(1); MoneyObserver moneyObserver = new MoneyObserver(true, latch); streamingCallable.call(DEFAULT_REQUEST, moneyObserver); Truth.assertThat(moneyObserver.controller).isNotNull(); - // wait for the task to complete, otherwise it may interfere with other tests, since they share - // the same MockService and unfinished request in this tes may start readind messages designated - // for other tests. - Truth.assertThat(latch.await(2, TimeUnit.SECONDS)).isTrue(); } @Test - public void testServerStreaming() throws InterruptedException { - - MOCK_SERVICE.addResponse(new Money[] {DEFAULT_RESPONSE, DEFAULTER_RESPONSE}); + void testServerStreaming() throws InterruptedException { + mockService.addResponse(new Money[] {DEFAULT_RESPONSE, DEFAULTER_RESPONSE}); CountDownLatch latch = new CountDownLatch(3); MoneyObserver moneyObserver = new MoneyObserver(true, latch); @@ -215,8 +215,8 @@ public void testServerStreaming() throws InterruptedException { } @Test - public void testManualFlowControl() throws Exception { - MOCK_SERVICE.addResponse(new Money[] {DEFAULT_RESPONSE}); + void testManualFlowControl() throws Exception { + mockService.addResponse(new Money[] {DEFAULT_RESPONSE}); CountDownLatch latch = new CountDownLatch(2); MoneyObserver moneyObserver = new MoneyObserver(false, latch); @@ -235,8 +235,8 @@ public void testManualFlowControl() throws Exception { } @Test - public void testCancelClientCall() throws Exception { - MOCK_SERVICE.addResponse(new Money[] {DEFAULT_RESPONSE}); + void testCancelClientCall() throws Exception { + mockService.addResponse(new Money[] {DEFAULT_RESPONSE}); CountDownLatch latch = new CountDownLatch(1); MoneyObserver moneyObserver = new MoneyObserver(false, latch); @@ -251,29 +251,33 @@ public void testCancelClientCall() throws Exception { } @Test - public void testOnResponseError() throws Throwable { - MOCK_SERVICE.addException(404, new RuntimeException("some error")); + void testOnResponseError() throws Throwable { + mockService.addException(404, new RuntimeException("some error")); CountDownLatch latch = new CountDownLatch(1); MoneyObserver moneyObserver = new MoneyObserver(true, latch); streamingCallable.call(ERROR_REQUEST, moneyObserver); - Truth.assertThat(latch.await(1000, TimeUnit.MILLISECONDS)).isTrue(); + Truth.assertThat(latch.await(60, TimeUnit.SECONDS)).isTrue(); Truth.assertThat(moneyObserver.error).isInstanceOf(ApiException.class); Truth.assertThat(((ApiException) moneyObserver.error).getStatusCode().getCode()) .isEqualTo(Code.NOT_FOUND); + Truth.assertThat(moneyObserver.error) .hasMessageThat() - .isEqualTo( - "com.google.api.client.http.HttpResponseException: 404\n" - + "POST https://google.com:443/fake/v1/recognize/0.0?red=-1.0\n" - + "java.lang.RuntimeException: some error"); + .contains("com.google.api.client.http.HttpResponseException: 404"); + Truth.assertThat(moneyObserver.error) + .hasMessageThat() + .contains("POST https://google.com:443/fake/v1/recognize/0.0?red=-1.0"); + Truth.assertThat(moneyObserver.error) + .hasMessageThat() + .contains("java.lang.RuntimeException: some error"); } @Test - public void testObserverErrorCancelsCall() throws Throwable { - MOCK_SERVICE.addResponse(new Money[] {DEFAULT_RESPONSE}); + void testObserverErrorCancelsCall() throws Throwable { + mockService.addResponse(new Money[] {DEFAULT_RESPONSE}); final RuntimeException expectedCause = new RuntimeException("some error"); final SettableApiFuture actualErrorF = SettableApiFuture.create(); @@ -312,8 +316,8 @@ protected void onCompleteImpl() { } @Test - public void testBlockingServerStreaming() { - MOCK_SERVICE.addResponse(new Money[] {DEFAULT_RESPONSE}); + void testBlockingServerStreaming() { + mockService.addResponse(new Money[] {DEFAULT_RESPONSE}); Color request = Color.newBuilder().setRed(0.5f).build(); ServerStream response = streamingCallable.call(request); List responseData = Lists.newArrayList(response); @@ -322,6 +326,29 @@ public void testBlockingServerStreaming() { Truth.assertThat(responseData).containsExactly(expected); } + // This test ensures that the server-side streaming does not exceed the timeout value + @Test + void testDeadlineExceededServerStreaming() throws InterruptedException, IOException { + // set a low timeout to trigger deadline-exceeded sooner + initialize(java.time.Duration.ofSeconds(1)); + + mockService.addResponse( + new Money[] {DEFAULT_RESPONSE, DEFAULTER_RESPONSE}, java.time.Duration.ofSeconds(30)); + Color request = Color.newBuilder().setRed(0.5f).build(); + CountDownLatch latch = new CountDownLatch(1); + MoneyObserver moneyObserver = new MoneyObserver(false, latch); + + streamingCallable.call(request, moneyObserver); + + moneyObserver.controller.request(2); + // Set the latch's await time to above the context's timeout value to ensure that + // the latch has been released. + Truth.assertThat(latch.await(30, TimeUnit.SECONDS)).isTrue(); + + Truth.assertThat(moneyObserver.error).isInstanceOf(DeadlineExceededException.class); + Truth.assertThat(moneyObserver.error).hasMessageThat().isEqualTo("Deadline exceeded"); + } + static class MoneyObserver extends StateCheckingResponseObserver { private final boolean autoFlowControl; private final CountDownLatch latch; diff --git a/gax-java/gax-httpjson/src/test/java/com/google/api/gax/httpjson/HttpJsonErrorParserTest.java b/gax-java/gax-httpjson/src/test/java/com/google/api/gax/httpjson/HttpJsonErrorParserTest.java new file mode 100644 index 0000000000..56c7235d2a --- /dev/null +++ b/gax-java/gax-httpjson/src/test/java/com/google/api/gax/httpjson/HttpJsonErrorParserTest.java @@ -0,0 +1,138 @@ +/* + * Copyright 2026 Google LLC + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Google LLC nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +package com.google.api.gax.httpjson; + +import static com.google.common.truth.Truth.assertThat; + +import com.google.api.gax.rpc.ErrorDetails; +import com.google.rpc.ErrorInfo; +import org.junit.jupiter.api.Test; + +/** Tests for {@link HttpJsonErrorParser}. */ +class HttpJsonErrorParserTest { + + @Test + void parseStatus_success() { + String payload = + "{\n" + + " \"error\": {\n" + + " \"code\": 401,\n" + + " \"message\": \"Request is missing required authentication credential.\",\n" + + " \"status\": \"UNAUTHENTICATED\",\n" + + " \"details\": [\n" + + " {\n" + + " \"@type\": \"type.googleapis.com/google.rpc.ErrorInfo\",\n" + + " \"reason\": \"SERVICE_DISABLED\",\n" + + " \"domain\": \"googleapis.com\",\n" + + " \"metadata\": {\n" + + " \"service\": \"pubsub.googleapis.com\"\n" + + " }\n" + + " }\n" + + " ]\n" + + " }\n" + + "}"; + + com.google.rpc.Status status = HttpJsonErrorParser.parseStatus(payload); + assertThat(status).isNotNull(); + assertThat(status.getCode()).isEqualTo(401); + assertThat(status.getMessage()) + .isEqualTo("Request is missing required authentication credential."); + + ErrorDetails errorDetails = + ErrorDetails.builder().setRawErrorMessages(status.getDetailsList()).build(); + ErrorInfo errorInfo = errorDetails.getErrorInfo(); + assertThat(errorInfo).isNotNull(); + assertThat(errorInfo.getReason()).isEqualTo("SERVICE_DISABLED"); + assertThat(errorInfo.getDomain()).isEqualTo("googleapis.com"); + assertThat(errorInfo.getMetadataMap().get("service")).isEqualTo("pubsub.googleapis.com"); + } + + @Test + void parseStatus_noErrorInfo() { + String payload = + "{\n" + + " \"error\": {\n" + + " \"details\": [\n" + + " {\n" + + " \"@type\": \"type.googleapis.com/google.rpc.RetryInfo\"\n" + + " }\n" + + " ]\n" + + " }\n" + + "}"; + + com.google.rpc.Status status = HttpJsonErrorParser.parseStatus(payload); + assertThat(status).isNotNull(); + ErrorDetails errorDetails = + ErrorDetails.builder().setRawErrorMessages(status.getDetailsList()).build(); + assertThat(errorDetails.getRetryInfo()).isNotNull(); + } + + @Test + void parseStatus_emptyPayload() { + assertThat(HttpJsonErrorParser.parseStatus("")) + .isEqualTo(com.google.rpc.Status.getDefaultInstance()); + assertThat(HttpJsonErrorParser.parseStatus(null)) + .isEqualTo(com.google.rpc.Status.getDefaultInstance()); + } + + @Test + void parseStatus_invalidJson() { + assertThat(HttpJsonErrorParser.parseStatus("{invalid")) + .isEqualTo(com.google.rpc.Status.getDefaultInstance()); + } + + @Test + void parseStatus_noErrorObject() { + String payload = "{\"foo\": \"bar\"}"; + assertThat(HttpJsonErrorParser.parseStatus(payload)) + .isEqualTo(com.google.rpc.Status.getDefaultInstance()); + } + + @Test + void parseStatus_noDetails() { + String payload = "{\"error\": {}}"; + assertThat(HttpJsonErrorParser.parseStatus(payload)) + .isEqualTo(com.google.rpc.Status.getDefaultInstance()); + } + + @Test + void parseStatus_garbageInError() { + String payload = "{\"error\": \"not-an-object\"}"; + assertThat(HttpJsonErrorParser.parseStatus(payload)) + .isEqualTo(com.google.rpc.Status.getDefaultInstance()); + } + + @Test + void parseStatus_arrayInError() { + String payload = "{\"error\": []}"; + assertThat(HttpJsonErrorParser.parseStatus(payload)) + .isEqualTo(com.google.rpc.Status.getDefaultInstance()); + } +} diff --git a/gax-java/gax-httpjson/src/test/java/com/google/api/gax/httpjson/HttpJsonLoggingInterceptorTest.java b/gax-java/gax-httpjson/src/test/java/com/google/api/gax/httpjson/HttpJsonLoggingInterceptorTest.java new file mode 100644 index 0000000000..c7e134b5ce --- /dev/null +++ b/gax-java/gax-httpjson/src/test/java/com/google/api/gax/httpjson/HttpJsonLoggingInterceptorTest.java @@ -0,0 +1,48 @@ +/* + * Copyright 2025 Google LLC + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Google LLC nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +package com.google.api.gax.httpjson; + +import static org.mockito.Mockito.mock; + +import com.google.api.gax.httpjson.ApiMethodDescriptor.MethodType; + +class HttpJsonLoggingInterceptorTest { + + @SuppressWarnings("unchecked") + private static final ApiMethodDescriptor method = + ApiMethodDescriptor.newBuilder() + .setType(MethodType.UNARY) + .setRequestFormatter(mock(HttpRequestFormatter.class)) + .setRequestFormatter(mock(HttpRequestFormatter.class)) + .setFullMethodName("FakeClient/fake-method") + .setResponseParser(mock(HttpResponseParser.class)) + .build(); +} diff --git a/gax-java/gax-httpjson/src/test/java/com/google/api/gax/httpjson/HttpJsonLongRunningClientTest.java b/gax-java/gax-httpjson/src/test/java/com/google/api/gax/httpjson/HttpJsonLongRunningClientTest.java index 702f327a6b..0858ae350c 100644 --- a/gax-java/gax-httpjson/src/test/java/com/google/api/gax/httpjson/HttpJsonLongRunningClientTest.java +++ b/gax-java/gax-httpjson/src/test/java/com/google/api/gax/httpjson/HttpJsonLongRunningClientTest.java @@ -30,7 +30,7 @@ package com.google.api.gax.httpjson; import static com.google.common.truth.Truth.assertThat; -import static org.junit.Assert.assertNull; +import static org.junit.jupiter.api.Assertions.assertNull; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; @@ -42,17 +42,17 @@ import com.google.common.truth.Truth; import com.google.protobuf.Field; import com.google.protobuf.Option; -import org.junit.Assert; -import org.junit.Before; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; -public class HttpJsonLongRunningClientTest { +class HttpJsonLongRunningClientTest { private OperationSnapshotFactory operationSnapFact; private PollingRequestFactory

        Server streaming RPCs interpret RPC timeouts a bit differently. For server streaming RPCs, the * RPC timeout gets converted into a wait timeout {@link - * com.google.api.gax.rpc.ApiCallContext#withStreamWaitTimeout(Duration)}. + * com.google.api.gax.rpc.ApiCallContext#withStreamWaitTimeoutDuration(java.time.Duration)}. + * + *

        In Cloud Client Libraries, Retry and LRO Retry Settings may be configured for each RPC in a + * service. These values are chosen by the service teams and may be found by looking at the + * {Service}StubSettings.java file in each library. The default values listed below for each + * configuration are the default values for the RetrySettings class if there are no RPC specific + * configurations from the Service Team. */ @AutoValue public abstract class RetrySettings implements Serializable { private static final long serialVersionUID = 8258475264439710899L; + /** This method is obsolete. Use {@link #getTotalTimeoutDuration()} instead */ + @ObsoleteApi("Use getTotalTimeoutDuration() instead") + public org.threeten.bp.Duration getTotalTimeout() { + return toThreetenDuration(getTotalTimeoutDuration()); + } + ; + /** * TotalTimeout has ultimate control over how long the logic should keep trying the remote call - * until it gives up completely. The higher the total timeout, the more retries can be attempted. - * The default value is {@code Duration.ZERO}. + * until it gives up completely. The higher the total timeout, the more retries and polls can be + * attempted. If this value is {@code Duration.ZERO}, then the logic will instead use the number + * of attempts to determine retries. In the event that both maxAttempts and totalTimeout values + * are both 0, the logic will not retry. If this value is non-{@code Duration.ZERO}, and the retry + * duration has reaches the timeout value, the logic will give up retrying even the number of + * attempts is lower than the maxAttempts value. + * + *

        If there are no configurations, Retries have the default timeout value of {@code + * Duration.ZERO} and LROs have a default total timeout value of {@code Duration.ofMillis(300000)} + * (5 minutes). */ - public abstract Duration getTotalTimeout(); + public abstract java.time.Duration getTotalTimeoutDuration(); + + /** This method is obsolete. Use {@link #getInitialRetryDelayDuration()} instead */ + @ObsoleteApi("Use getInitialRetryDelayDuration() instead") + public org.threeten.bp.Duration getInitialRetryDelay() { + return toThreetenDuration(getInitialRetryDelayDuration()); + } /** - * InitialRetryDelay controls the delay before the first retry. Subsequent retries will use this - * value adjusted according to the RetryDelayMultiplier. The default value is {@code - * Duration.ZERO}. + * InitialRetryDelay controls the delay before the first retry/ poll. Subsequent retries and polls + * will use this value adjusted according to the RetryDelayMultiplier. + * + *

        If there are no configurations, Retries have the default initial retry delay value of {@code + * Duration.ZERO} and LROs have a default initial poll delay value of {@code + * Duration.ofMillis(5000)} (5 seconds). */ - public abstract Duration getInitialRetryDelay(); + public abstract java.time.Duration getInitialRetryDelayDuration(); /** - * RetryDelayMultiplier controls the change in retry delay. The retry delay of the previous call - * is multiplied by the RetryDelayMultiplier to calculate the retry delay for the next call. The - * default value is {@code 1.0}. + * RetryDelayMultiplier controls the change in delay before the next retry or poll. The retry + * delay of the previous call is multiplied by the RetryDelayMultiplier to calculate the retry + * delay for the next call. + * + *

        If there are no configurations, Retries have the default retry delay multiplier value of + * {@code 1.0} and LROs have a default retry delay multiplier of {@code 1.5}. */ public abstract double getRetryDelayMultiplier(); + /** This method is obsolete. Use {@link #getMaxRetryDelayDuration()} instead */ + @ObsoleteApi("Use getMaxRetryDelayDuration()") + public org.threeten.bp.Duration getMaxRetryDelay() { + return toThreetenDuration(getMaxRetryDelayDuration()); + } + /** * MaxRetryDelay puts a limit on the value of the retry delay, so that the RetryDelayMultiplier - * can't increase the retry delay higher than this amount. The default value is {@code - * Duration.ZERO}. + * can't increase the retry delay higher than this amount. + * + *

        If there are no configurations, Retries have the default max retry delay value of {@code + * Duration.ZERO} and LROs have a default max poll retry delay value of {@code + * Duration.ofMillis(45000)} (45 seconds). */ - public abstract Duration getMaxRetryDelay(); + public abstract java.time.Duration getMaxRetryDelayDuration(); /** - * MaxAttempts defines the maximum number of attempts to perform. The default value is {@code 0}. - * If this value is greater than 0, and the number of attempts reaches this limit, the logic will - * give up retrying even if the total retry time is still lower than TotalTimeout. + * MaxAttempts defines the maximum number of retry attempts to perform. If this value is set to 0, + * the logic will instead use the totalTimeout value to determine retries. In the event that both + * the maxAttempts and totalTimeout values are both 0, the logic will not retry. If this value is + * greater than 0, and the number of attempts exceeds this limit, the logic will give up retrying + * even if the total retry time is still lower than totalTimeout. + * + *

        If there are no configurations, Retries and LROs have the default max attempt value of + * {@code 0}. LRO polling does not use this value by default. + * + *

        The first RPC invocation will be considered attempt #0. Subsequent calls (retries) will + * increment the number of attempts and the number of attempts will not exceed this value. */ public abstract int getMaxAttempts(); @@ -121,38 +174,62 @@ public abstract class RetrySettings implements Serializable { @VisibleForTesting public abstract boolean isJittered(); + /** This method is obsolete. Use {@link #getInitialRpcTimeoutDuration()} instead */ + @ObsoleteApi("Use getInitialRpcTimeoutDuration() instead") + public final org.threeten.bp.Duration getInitialRpcTimeout() { + return toThreetenDuration(getInitialRpcTimeoutDuration()); + } + /** * InitialRpcTimeout controls the timeout for the initial RPC. Subsequent calls will use this - * value adjusted according to the RpcTimeoutMultiplier. The default value is {@code - * Duration.ZERO}. + * value adjusted according to the RpcTimeoutMultiplier. RPC Timeout value of {@code + * Duration.ZERO} allows the RPC to continue indefinitely (until it hits a Connect Timeout or the + * connection has been terminated). + * + *

        {@link #getTotalTimeout()} caps how long the logic should keep trying the RPC until it gives + * up completely. If {@link #getTotalTimeout()} is set, initialRpcTimeout should be <= + * totalTimeout. + * + *

        If there are no configurations, Retries have the default initial RPC timeout value of {@code + * Duration.ZERO}. LRO polling does not use the Initial RPC Timeout value. */ - public abstract Duration getInitialRpcTimeout(); + public abstract java.time.Duration getInitialRpcTimeoutDuration(); /** * RpcTimeoutMultiplier controls the change in RPC timeout. The timeout of the previous call is - * multiplied by the RpcTimeoutMultiplier to calculate the timeout for the next call. The default - * value is {@code 1.0}. + * multiplied by the RpcTimeoutMultiplier to calculate the timeout for the next call. + * + *

        If there are no configurations, Retries have the default RPC Timeout Multiplier value of + * {@code 1.0}. LRO polling does not use the RPC Timeout Multiplier value. */ public abstract double getRpcTimeoutMultiplier(); + /** This method is obsolete. Use {@link #getMaxRpcTimeoutDuration()} instead */ + @ObsoleteApi("Use getMaxRpcTimeoutDuration() instead") + public final org.threeten.bp.Duration getMaxRpcTimeout() { + return toThreetenDuration(getMaxRpcTimeoutDuration()); + } + /** * MaxRpcTimeout puts a limit on the value of the RPC timeout, so that the RpcTimeoutMultiplier - * can't increase the RPC timeout higher than this amount. The default value is {@code - * Duration.ZERO}. + * can't increase the RPC timeout higher than this amount. + * + *

        If there are no configurations, Retries have the default Max RPC Timeout value of {@code + * Duration.ZERO}. LRO polling does not use the Max RPC Timeout value. */ - public abstract Duration getMaxRpcTimeout(); + public abstract java.time.Duration getMaxRpcTimeoutDuration(); public static Builder newBuilder() { return new AutoValue_RetrySettings.Builder() - .setTotalTimeout(Duration.ZERO) - .setInitialRetryDelay(Duration.ZERO) + .setTotalTimeoutDuration(java.time.Duration.ZERO) + .setInitialRetryDelayDuration(java.time.Duration.ZERO) .setRetryDelayMultiplier(1.0) - .setMaxRetryDelay(Duration.ZERO) + .setMaxRetryDelayDuration(java.time.Duration.ZERO) .setMaxAttempts(0) .setJittered(true) - .setInitialRpcTimeout(Duration.ZERO) + .setInitialRpcTimeoutDuration(java.time.Duration.ZERO) .setRpcTimeoutMultiplier(1.0) - .setMaxRpcTimeout(Duration.ZERO); + .setMaxRpcTimeoutDuration(java.time.Duration.ZERO); } public abstract Builder toBuilder(); @@ -164,38 +241,86 @@ public static Builder newBuilder() { @AutoValue.Builder public abstract static class Builder { + /** This method is obsolete. Use {@link #setTotalTimeoutDuration(java.time.Duration)} instead */ + @ObsoleteApi("Use setTotalTimeoutDuration(java.time.Duration) instead") + public final Builder setTotalTimeout(org.threeten.bp.Duration totalTimeout) { + return setTotalTimeoutDuration(toJavaTimeDuration(totalTimeout)); + } + /** * TotalTimeout has ultimate control over how long the logic should keep trying the remote call - * until it gives up completely. The higher the total timeout, the more retries can be - * attempted. The default value is {@code Duration.ZERO}. + * until it gives up completely. The higher the total timeout, the more retries and polls can be + * attempted. If this value is {@code Duration.ZERO}, then the logic will instead use the number + * of attempts to determine retries. In the event that both maxAttempts and totalTimeout values + * are both 0, the logic will not retry. If this value is non-{@code Duration.ZERO}, and the + * retry duration has reaches the timeout value, the logic will give up retrying even the number + * of attempts is lower than the maxAttempts value. + * + *

        If there are no configurations, Retries have the default timeout value of {@code + * Duration.ZERO} and LROs have a default total timeout value of {@code + * Duration.ofMillis(300000)} (5 minutes). + */ + public abstract Builder setTotalTimeoutDuration(java.time.Duration totalTimeout); + + /** + * This method is obsolete. Use {@link #setInitialRetryDelayDuration(java.time.Duration)} + * instead */ - public abstract Builder setTotalTimeout(Duration totalTimeout); + @ObsoleteApi("Use setInitialRetryDelayDuration(java.time.Duration) instead") + public final Builder setInitialRetryDelay(org.threeten.bp.Duration initialDelay) { + return setInitialRetryDelayDuration(toJavaTimeDuration(initialDelay)); + } /** - * InitialRetryDelay controls the delay before the first retry. Subsequent retries will use this - * value adjusted according to the RetryDelayMultiplier. The default value is {@code - * Duration.ZERO}. + * InitialRetryDelay controls the delay before the first retry/ poll. Subsequent retries and + * polls will use this value adjusted according to the RetryDelayMultiplier. + * + *

        If there are no configurations, Retries have the default initial retry delay value of + * {@code Duration.ZERO} and LROs have a default initial poll delay value of {@code + * Duration.ofMillis(5000)} (5 seconds). */ - public abstract Builder setInitialRetryDelay(Duration initialDelay); + public abstract Builder setInitialRetryDelayDuration(java.time.Duration initialDelay); /** - * RetryDelayMultiplier controls the change in retry delay. The retry delay of the previous call - * is multiplied by the RetryDelayMultiplier to calculate the retry delay for the next call. The - * default value is {@code 1.0}. + * RetryDelayMultiplier controls the change in delay before the next retry or poll. The retry + * delay of the previous call is multiplied by the RetryDelayMultiplier to calculate the retry + * delay for the next call. + * + *

        If there are no configurations, Retries have the default retry delay multiplier value of + * {@code 1.0} and LROs have a default retry delay multiplier of {@code 1.5}. */ public abstract Builder setRetryDelayMultiplier(double multiplier); + /** + * This method is obsolete. Use {@link #setMaxRetryDelayDuration(java.time.Duration)} instead + */ + @ObsoleteApi("Use setMaxRetryDelayDuration(java.time.Duration) instead") + public final Builder setMaxRetryDelay(org.threeten.bp.Duration maxDelay) { + return setMaxRetryDelayDuration(toJavaTimeDuration(maxDelay)); + } + /** * MaxRetryDelay puts a limit on the value of the retry delay, so that the RetryDelayMultiplier - * can't increase the retry delay higher than this amount. The default value is {@code - * Duration.ZERO}. + * can't increase the retry delay higher than this amount. + * + *

        If there are no configurations, Retries have the default max retry delay value of {@code + * Duration.ZERO} and LROs have a default max poll retry delay value of {@code + * Duration.ofMillis(45000)} (45 seconds). */ - public abstract Builder setMaxRetryDelay(Duration maxDelay); + public abstract Builder setMaxRetryDelayDuration(java.time.Duration maxDelay); /** - * MaxAttempts defines the maximum number of attempts to perform. The default value is {@code - * 0}. If this value is greater than 0, and the number of attempts reaches this limit, the logic - * will give up retrying even if the total retry time is still lower than TotalTimeout. + * MaxAttempts defines the maximum number of retry attempts to perform. If this value is set to + * 0, the logic will instead use the totalTimeout value to determine retries. In the event that + * both the maxAttempts and totalTimeout values are both 0, the logic will not retry. If this + * value is greater than 0, and the number of attempts exceeds this limit, the logic will give + * up retrying even if the total retry time is still lower than totalTimeout. + * + *

        If there are no configurations, Retries and LROs have the default max attempt value of + * {@code 0}. LRO polling does not use this value by default. + * + *

        The first RPC invocation will be considered attempt #0. Subsequent calls (retries) will + * increment the number of attempts and the number of attempts will not exceed this value. */ public abstract Builder setMaxAttempts(int maxAttempts); @@ -213,51 +338,115 @@ public abstract static class Builder { @VisibleForTesting public abstract Builder setJittered(boolean jittered); + /** + * This method is obsolete. Use {@link #setInitialRpcTimeoutDuration(java.time.Duration)} + * instead + */ + @ObsoleteApi("Use setInitialRpcTimeoutDuration(java.time.Duration) instead") + public final Builder setInitialRpcTimeout(org.threeten.bp.Duration initialTimeout) { + return setInitialRpcTimeoutDuration(toJavaTimeDuration(initialTimeout)); + } + /** * InitialRpcTimeout controls the timeout for the initial RPC. Subsequent calls will use this - * value adjusted according to the RpcTimeoutMultiplier. The default value is {@code - * Duration.ZERO}. + * value adjusted according to the RpcTimeoutMultiplier. RPC Timeout value of {@code + * Duration.ZERO} allows the RPC to continue indefinitely (until it hits a Connect Timeout or + * the connection has been terminated). + * + *

        {@link #getTotalTimeout()} caps how long the logic should keep trying the RPC until it + * gives up completely. If {@link #getTotalTimeout()} is set, initialRpcTimeout should be <= + * totalTimeout. + * + *

        If there are no configurations, Retries have the default initial RPC timeout value of + * {@code Duration.ZERO}. LRO polling does not use the Initial RPC Timeout value. */ - public abstract Builder setInitialRpcTimeout(Duration initialTimeout); + public abstract Builder setInitialRpcTimeoutDuration(java.time.Duration initialTimeout); /** - * See the class documentation of {@link RetrySettings} for a description of what this value - * does. The default value is {@code 1.0}. + * RpcTimeoutMultiplier controls the change in RPC timeout. The timeout of the previous call is + * multiplied by the RpcTimeoutMultiplier to calculate the timeout for the next call. + * + *

        If there are no configurations, Retries have the default RPC Timeout Multiplier value of + * {@code 1.0}. LRO polling does not use the RPC Timeout Multiplier value. */ public abstract Builder setRpcTimeoutMultiplier(double multiplier); + /** + * This method is obsolete. Use {@link #setMaxRpcTimeoutDuration(java.time.Duration)} instead + */ + @ObsoleteApi("Use setMaxRpcTimeoutDuration(java.time.Duration) instead") + public final Builder setMaxRpcTimeout(org.threeten.bp.Duration maxTimeout) { + return setMaxRpcTimeoutDuration(toJavaTimeDuration(maxTimeout)); + } + /** * MaxRpcTimeout puts a limit on the value of the RPC timeout, so that the RpcTimeoutMultiplier - * can't increase the RPC timeout higher than this amount. The default value is {@code - * Duration.ZERO}. + * can't increase the RPC timeout higher than this amount. + * + *

        If there are no configurations, Retries have the default Max RPC Timeout value of {@code + * Duration.ZERO}. LRO polling does not use the Max RPC Timeout value. */ - public abstract Builder setMaxRpcTimeout(Duration maxTimeout); + public abstract Builder setMaxRpcTimeoutDuration(java.time.Duration maxTimeout); + + /** This method is obsolete. Use {@link #getTotalTimeoutDuration()} instead */ + @ObsoleteApi("Use getTotalTimeoutDuration() instead") + public final org.threeten.bp.Duration getTotalTimeout() { + return toThreetenDuration(getTotalTimeoutDuration()); + } /** * TotalTimeout has ultimate control over how long the logic should keep trying the remote call - * until it gives up completely. The higher the total timeout, the more retries can be - * attempted. The default value is {@code Duration.ZERO}. + * until it gives up completely. The higher the total timeout, the more retries and polls can be + * attempted. If this value is {@code Duration.ZERO}, then the logic will instead use the number + * of attempts to determine retries. In the event that both maxAttempts and totalTimeout values + * are both 0, the logic will not retry. If this value is non-{@code Duration.ZERO}, and the + * retry duration has reaches the timeout value, the logic will give up retrying even the number + * of attempts is lower than the maxAttempts value. + * + *

        If there are no configurations, Retries have the default timeout value of {@code + * Duration.ZERO} and LROs have a default total timeout value of {@code + * Duration.ofMillis(300000)} (5 minutes). */ - public abstract Duration getTotalTimeout(); + public abstract java.time.Duration getTotalTimeoutDuration(); + + /** This method is obsolete. Use {@link #getInitialRetryDelayDuration()} instead */ + @ObsoleteApi("Use getInitialRetryDelayDuration() instead") + public final org.threeten.bp.Duration getInitialRetryDelay() { + return toThreetenDuration(getInitialRetryDelayDuration()); + } /** - * InitialRetryDelay controls the delay before the first retry. Subsequent retries will use this - * value adjusted according to the RetryDelayMultiplier. The default value is {@code - * Duration.ZERO}. + * InitialRetryDelay controls the delay before the first retry/ poll. Subsequent retries and + * polls will use this value adjusted according to the RetryDelayMultiplier. + * + *

        If there are no configurations, Retries have the default initial retry delay value of + * {@code Duration.ZERO} and LROs have a default initial poll delay value of {@code + * Duration.ofMillis(5000)} (5 seconds). */ - public abstract Duration getInitialRetryDelay(); + public abstract java.time.Duration getInitialRetryDelayDuration(); /** - * RetryDelayMultiplier controls the change in retry delay. The retry delay of the previous call - * is multiplied by the RetryDelayMultiplier to calculate the retry delay for the next call. The - * default value is {@code 1.0}. + * RetryDelayMultiplier controls the change in delay before the next retry or poll. The retry + * delay of the previous call is multiplied by the RetryDelayMultiplier to calculate the retry + * delay for the next call. + * + *

        If there are no configurations, Retries have the default retry delay multiplier value of + * {@code 1.0} and LROs have a default retry delay multiplier of {@code 1.5}. */ public abstract double getRetryDelayMultiplier(); /** - * MaxAttempts defines the maximum number of attempts to perform. The default value is {@code - * 0}. If this value is greater than 0, and the number of attempts reaches this limit, the logic - * will give up retrying even if the total retry time is still lower than TotalTimeout. + * MaxAttempts defines the maximum number of retry attempts to perform. If this value is set to + * 0, the logic will instead use the totalTimeout value to determine retries. In the event that + * both the maxAttempts and totalTimeout values are both 0, the logic will not retry. If this + * value is greater than 0, and the number of attempts exceeds this limit, the logic will give + * up retrying even if the total retry time is still lower than totalTimeout. + * + *

        If there are no configurations, Retries and LROs have the default max attempt value of + * {@code 0}. LRO polling does not use this value by default. + * + *

        The first RPC invocation will be considered attempt #0. Subsequent calls (retries) will + * increment the number of attempts and the number of attempts will not exceed this value. */ public abstract int getMaxAttempts(); @@ -271,31 +460,73 @@ public abstract static class Builder { */ public abstract boolean isJittered(); + /** This method is obsolete. Use {@link #getMaxRetryDelayDuration()} instead */ + @ObsoleteApi("Use getMaxRetryDelayDuration() instead") + public final org.threeten.bp.Duration getMaxRetryDelay() { + return toThreetenDuration(getMaxRetryDelayDuration()); + } + /** * MaxRetryDelay puts a limit on the value of the retry delay, so that the RetryDelayMultiplier - * can't increase the retry delay higher than this amount. The default value is {@code - * Duration.ZERO}. + * can't increase the retry delay higher than this amount. + * + *

        If there are no configurations, Retries have the default max retry delay value of {@code + * Duration.ZERO} and LROs have a default max poll retry delay value of {@code + * Duration.ofMillis(45000)} (45 seconds). */ - public abstract Duration getMaxRetryDelay(); + public abstract java.time.Duration getMaxRetryDelayDuration(); + + /** This method is obsolete. Use {@link #getInitialRpcTimeoutDuration()} instead */ + @ObsoleteApi("Use getInitialRpcTimeoutDuration() instead") + public final org.threeten.bp.Duration getInitialRpcTimeout() { + return toThreetenDuration(getInitialRpcTimeoutDuration()); + } /** * InitialRpcTimeout controls the timeout for the initial RPC. Subsequent calls will use this - * value adjusted according to the RpcTimeoutMultiplier. The default value is {@code - * Duration.ZERO}. + * value adjusted according to the RpcTimeoutMultiplier. RPC Timeout value of {@code + * Duration.ZERO} allows the RPC to continue indefinitely (until it hits a Connect Timeout or + * the connection has been terminated). + * + *

        {@link #getTotalTimeout()} caps how long the logic should keep trying the RPC until it + * gives up completely. If {@link #getTotalTimeout()} is set, initialRpcTimeout should be <= + * totalTimeout. + * + *

        If there are no configurations, Retries have the default initial RPC timeout value of + * {@code Duration.ZERO}. LRO polling does not use the Initial RPC Timeout value. */ - public abstract Duration getInitialRpcTimeout(); + public abstract java.time.Duration getInitialRpcTimeoutDuration(); /** - * See the class documentation of {@link RetrySettings} for a description of what this value - * does. The default value is {@code 1.0}. + * RpcTimeoutMultiplier controls the change in RPC timeout. The timeout of the previous call is + * multiplied by the RpcTimeoutMultiplier to calculate the timeout for the next call. + * + *

        If there are no configurations, Retries have the default RPC Timeout Multiplier value of + * {@code 1.0}. LRO polling does not use the RPC Timeout Multiplier value. */ public abstract double getRpcTimeoutMultiplier(); + /** This method is obsolete. Use {@link #getMaxRpcTimeoutDuration()} instead */ + @ObsoleteApi("Use getMaxRpcTimeoutDuration() instead") + public final org.threeten.bp.Duration getMaxRpcTimeout() { + return toThreetenDuration(getMaxRpcTimeoutDuration()); + } + /** * MaxRpcTimeout puts a limit on the value of the RPC timeout, so that the RpcTimeoutMultiplier * can't increase the RPC timeout higher than this amount. + * + *

        If there are no configurations, Retries have the default Max RPC Timeout value of {@code + * Duration.ZERO}. LRO polling does not use the Max RPC Timeout value. */ - public abstract Duration getMaxRpcTimeout(); + public abstract java.time.Duration getMaxRpcTimeoutDuration(); + + /** This method is obsolete. Use {@link #setLogicalTimeout(java.time.Duration)} instead. */ + @BetaApi + @ObsoleteApi("Use setLogicalTimeout(java.time.Duration) instead") + public Builder setLogicalTimeout(org.threeten.bp.Duration timeout) { + return setLogicalTimeout(toJavaTimeDuration(timeout)); + } /** * Configures the timeout settings with the given timeout such that the logical call will take @@ -307,36 +538,36 @@ public abstract static class Builder { * setter is respected. */ @BetaApi - public Builder setLogicalTimeout(Duration timeout) { + public Builder setLogicalTimeout(java.time.Duration timeout) { return setRpcTimeoutMultiplier(1) - .setInitialRpcTimeout(timeout) - .setMaxRpcTimeout(timeout) - .setTotalTimeout(timeout); + .setInitialRpcTimeoutDuration(timeout) + .setMaxRpcTimeoutDuration(timeout) + .setTotalTimeoutDuration(timeout); } abstract RetrySettings autoBuild(); public RetrySettings build() { RetrySettings params = autoBuild(); - if (params.getTotalTimeout().toMillis() < 0) { + if (params.getTotalTimeoutDuration().toMillis() < 0) { throw new IllegalStateException("total timeout must not be negative"); } - if (params.getInitialRetryDelay().toMillis() < 0) { + if (params.getInitialRetryDelayDuration().toMillis() < 0) { throw new IllegalStateException("initial retry delay must not be negative"); } if (params.getRetryDelayMultiplier() < 1.0) { throw new IllegalStateException("retry delay multiplier must be at least 1"); } - if (params.getMaxRetryDelay().compareTo(params.getInitialRetryDelay()) < 0) { + if (params.getMaxRetryDelayDuration().compareTo(params.getInitialRetryDelayDuration()) < 0) { throw new IllegalStateException("max retry delay must not be shorter than initial delay"); } if (params.getMaxAttempts() < 0) { throw new IllegalStateException("max attempts must be non-negative"); } - if (params.getInitialRpcTimeout().toMillis() < 0) { + if (params.getInitialRpcTimeoutDuration().toMillis() < 0) { throw new IllegalStateException("initial rpc timeout must not be negative"); } - if (params.getMaxRpcTimeout().compareTo(params.getInitialRpcTimeout()) < 0) { + if (params.getMaxRpcTimeoutDuration().compareTo(params.getInitialRpcTimeoutDuration()) < 0) { throw new IllegalStateException("max rpc timeout must not be shorter than initial timeout"); } if (params.getRpcTimeoutMultiplier() < 1.0) { @@ -346,28 +577,28 @@ public RetrySettings build() { } public RetrySettings.Builder merge(RetrySettings.Builder newSettings) { - if (newSettings.getTotalTimeout() != null) { - setTotalTimeout(newSettings.getTotalTimeout()); + if (newSettings.getTotalTimeoutDuration() != null) { + setTotalTimeoutDuration(newSettings.getTotalTimeoutDuration()); } - if (newSettings.getInitialRetryDelay() != null) { - setInitialRetryDelay(newSettings.getInitialRetryDelay()); + if (newSettings.getInitialRetryDelayDuration() != null) { + setInitialRetryDelayDuration(newSettings.getInitialRetryDelayDuration()); } if (newSettings.getRetryDelayMultiplier() >= 1) { setRetryDelayMultiplier(newSettings.getRetryDelayMultiplier()); } - if (newSettings.getMaxRetryDelay() != null) { - setMaxRetryDelay(newSettings.getMaxRetryDelay()); + if (newSettings.getMaxRetryDelayDuration() != null) { + setMaxRetryDelayDuration(newSettings.getMaxRetryDelayDuration()); } setMaxAttempts(newSettings.getMaxAttempts()); setJittered(newSettings.isJittered()); - if (newSettings.getInitialRpcTimeout() != null) { - setInitialRpcTimeout(newSettings.getInitialRpcTimeout()); + if (newSettings.getInitialRpcTimeoutDuration() != null) { + setInitialRpcTimeoutDuration(newSettings.getInitialRpcTimeoutDuration()); } if (newSettings.getRpcTimeoutMultiplier() >= 1) { setRpcTimeoutMultiplier(newSettings.getRpcTimeoutMultiplier()); } - if (newSettings.getMaxRpcTimeout() != null) { - setMaxRpcTimeout(newSettings.getMaxRpcTimeout()); + if (newSettings.getMaxRpcTimeoutDuration() != null) { + setMaxRpcTimeoutDuration(newSettings.getMaxRpcTimeoutDuration()); } return this; } diff --git a/gax-java/gax/src/main/java/com/google/api/gax/retrying/ScheduledRetryingExecutor.java b/gax-java/gax/src/main/java/com/google/api/gax/retrying/ScheduledRetryingExecutor.java index b6ee0a0c19..c796ebd090 100644 --- a/gax-java/gax/src/main/java/com/google/api/gax/retrying/ScheduledRetryingExecutor.java +++ b/gax-java/gax/src/main/java/com/google/api/gax/retrying/ScheduledRetryingExecutor.java @@ -115,7 +115,7 @@ public ApiFuture submit(RetryingFuture retryingFuture) { ListenableFuture attemptFuture = scheduler.schedule( retryingFuture.getCallable(), - retryingFuture.getAttemptSettings().getRandomizedRetryDelay().toMillis(), + retryingFuture.getAttemptSettings().getRandomizedRetryDelayDuration().toMillis(), TimeUnit.MILLISECONDS); return new ListenableFutureToApiFuture<>(attemptFuture); } catch (RejectedExecutionException e) { diff --git a/gax-java/gax/src/main/java/com/google/api/gax/retrying/StreamingRetryAlgorithm.java b/gax-java/gax/src/main/java/com/google/api/gax/retrying/StreamingRetryAlgorithm.java index 272fe3ba18..dc147f4c7e 100644 --- a/gax-java/gax/src/main/java/com/google/api/gax/retrying/StreamingRetryAlgorithm.java +++ b/gax-java/gax/src/main/java/com/google/api/gax/retrying/StreamingRetryAlgorithm.java @@ -102,8 +102,7 @@ public TimedAttemptSettings createNextAttempt( // If we have made progress in the last attempt, then reset the delays if (attemptException.hasSeenResponses()) { previousSettings = - createFirstAttempt(context) - .toBuilder() + createFirstAttempt(context).toBuilder() .setFirstAttemptStartTimeNanos(previousSettings.getFirstAttemptStartTimeNanos()) .setOverallAttemptCount(previousSettings.getOverallAttemptCount()) .build(); diff --git a/gax-java/gax/src/main/java/com/google/api/gax/retrying/TimedAttemptSettings.java b/gax-java/gax/src/main/java/com/google/api/gax/retrying/TimedAttemptSettings.java index 2f9028a2ef..7b6a09b685 100644 --- a/gax-java/gax/src/main/java/com/google/api/gax/retrying/TimedAttemptSettings.java +++ b/gax-java/gax/src/main/java/com/google/api/gax/retrying/TimedAttemptSettings.java @@ -29,9 +29,12 @@ */ package com.google.api.gax.retrying; +import static com.google.api.gax.util.TimeConversionUtils.toJavaTimeDuration; +import static com.google.api.gax.util.TimeConversionUtils.toThreetenDuration; + import com.google.api.core.ApiClock; +import com.google.api.core.ObsoleteApi; import com.google.auto.value.AutoValue; -import org.threeten.bp.Duration; /** Timed attempt execution settings. Defines time-specific properties of a retry attempt. */ @AutoValue @@ -40,20 +43,38 @@ public abstract class TimedAttemptSettings { /** Returns global (attempt-independent) retry settings. */ public abstract RetrySettings getGlobalSettings(); + /** This method is obsolete. Use {@link #getRetryDelayDuration()} instead */ + @ObsoleteApi("Use getRetryDelayDuration() instead") + public final org.threeten.bp.Duration getRetryDelay() { + return toThreetenDuration(getRetryDelayDuration()); + } + /** * Returns the calculated retry delay. Note that the actual delay used for retry scheduling may be * different (randomized, based on this value). */ - public abstract Duration getRetryDelay(); + public abstract java.time.Duration getRetryDelayDuration(); + + /** This method is obsolete. Use {@link #getRpcTimeoutDuration()} instead */ + @ObsoleteApi("Use getRpcTimeoutDuration() instead") + public final org.threeten.bp.Duration getRpcTimeout() { + return toThreetenDuration(getRpcTimeoutDuration()); + } /** Returns rpc timeout used for this attempt. */ - public abstract Duration getRpcTimeout(); + public abstract java.time.Duration getRpcTimeoutDuration(); + + /** This method is obsolete. Use {@link #getRandomizedRetryDelayDuration()} instead */ + @ObsoleteApi("Use getRandomizedRetryDelayDuration() instead") + public final org.threeten.bp.Duration getRandomizedRetryDelay() { + return toThreetenDuration(getRandomizedRetryDelayDuration()); + } /** * Returns randomized attempt delay. By default this value is calculated based on the {@code * retryDelay} value, and is used as the actual attempt execution delay. */ - public abstract Duration getRandomizedRetryDelay(); + public abstract java.time.Duration getRandomizedRetryDelayDuration(); /** * The attempt count. It is a zero-based value (first attempt will have this value set to 0). For @@ -85,20 +106,41 @@ public abstract static class Builder { /** Sets global (attempt-independent) retry settings. */ public abstract Builder setGlobalSettings(RetrySettings value); + /** This method is obsolete. Use {@link #setRetryDelayDuration(java.time.Duration)} instead. */ + @ObsoleteApi("Use setRetryDelayDuration(java.time.Duration) instead") + public final Builder setRetryDelay(org.threeten.bp.Duration value) { + return setRetryDelayDuration(toJavaTimeDuration(value)); + } + /** * Sets the calculated retry delay. Note that the actual delay used for retry scheduling may be * different (randomized, based on this value). */ - public abstract Builder setRetryDelay(Duration value); + public abstract Builder setRetryDelayDuration(java.time.Duration value); + + /** This method is obsolete. Use {@link #setRpcTimeoutDuration(java.time.Duration)} instead. */ + @ObsoleteApi("Use setRpcTimeoutDuration(java.time.Duration) instead") + public final Builder setRpcTimeout(org.threeten.bp.Duration value) { + return setRpcTimeoutDuration(toJavaTimeDuration(value)); + } /** Sets rpc timeout used for this attempt. */ - public abstract Builder setRpcTimeout(Duration value); + public abstract Builder setRpcTimeoutDuration(java.time.Duration value); + + /** + * This method is obsolete. Use {@link #setRandomizedRetryDelayDuration(java.time.Duration)} + * instead. + */ + @ObsoleteApi("Use setRandomizedRetryDelayDuration(java.time.Duration) instead") + public final Builder setRandomizedRetryDelay(org.threeten.bp.Duration value) { + return setRandomizedRetryDelayDuration(toJavaTimeDuration(value)); + } /** - * Sets randomized attempt delay. By default this value is calculated based on the {@code + * Sets randomized attempt delay. By default, this value is calculated based on the {@code * retryDelay} value, and is used as the actual attempt execution delay. */ - public abstract Builder setRandomizedRetryDelay(Duration value); + public abstract Builder setRandomizedRetryDelayDuration(java.time.Duration value); /** * Set the attempt count. It is a zero-based value (first attempt will have this value set to diff --git a/gax-java/gax/src/main/java/com/google/api/gax/rpc/AbortedException.java b/gax-java/gax/src/main/java/com/google/api/gax/rpc/AbortedException.java index 4cd2e31b6e..57b1b222c1 100644 --- a/gax-java/gax/src/main/java/com/google/api/gax/rpc/AbortedException.java +++ b/gax-java/gax/src/main/java/com/google/api/gax/rpc/AbortedException.java @@ -47,4 +47,13 @@ public AbortedException( Throwable cause, StatusCode statusCode, boolean retryable, ErrorDetails errorDetails) { super(cause, statusCode, retryable, errorDetails); } + + public AbortedException( + String message, + Throwable cause, + StatusCode statusCode, + boolean retryable, + ErrorDetails errorDetails) { + super(message, cause, statusCode, retryable, errorDetails); + } } diff --git a/gax-java/gax/src/main/java/com/google/api/gax/rpc/AlreadyExistsException.java b/gax-java/gax/src/main/java/com/google/api/gax/rpc/AlreadyExistsException.java index 6ee118898c..91a61bb89b 100644 --- a/gax-java/gax/src/main/java/com/google/api/gax/rpc/AlreadyExistsException.java +++ b/gax-java/gax/src/main/java/com/google/api/gax/rpc/AlreadyExistsException.java @@ -47,4 +47,13 @@ public AlreadyExistsException( Throwable cause, StatusCode statusCode, boolean retryable, ErrorDetails errorDetails) { super(cause, statusCode, retryable, errorDetails); } + + public AlreadyExistsException( + String message, + Throwable cause, + StatusCode statusCode, + boolean retryable, + ErrorDetails errorDetails) { + super(message, cause, statusCode, retryable, errorDetails); + } } diff --git a/gax-java/gax/src/main/java/com/google/api/gax/rpc/ApiCallContext.java b/gax-java/gax/src/main/java/com/google/api/gax/rpc/ApiCallContext.java index 5a34b58e39..09af475e48 100644 --- a/gax-java/gax/src/main/java/com/google/api/gax/rpc/ApiCallContext.java +++ b/gax-java/gax/src/main/java/com/google/api/gax/rpc/ApiCallContext.java @@ -31,6 +31,7 @@ import com.google.api.core.BetaApi; import com.google.api.core.InternalExtensionOnly; +import com.google.api.core.ObsoleteApi; import com.google.api.gax.retrying.RetrySettings; import com.google.api.gax.retrying.RetryingContext; import com.google.api.gax.rpc.StatusCode.Code; @@ -42,7 +43,6 @@ import java.util.Set; import javax.annotation.Nonnull; import javax.annotation.Nullable; -import org.threeten.bp.Duration; /** * Context for an API call. @@ -63,6 +63,13 @@ public interface ApiCallContext extends RetryingContext { /** Returns a new ApiCallContext with the given channel set. */ ApiCallContext withTransportChannel(TransportChannel channel); + /** Returns a new ApiCallContext with the given Endpoint Context. */ + ApiCallContext withEndpointContext(EndpointContext endpointContext); + + /** This method is obsolete. Use {@link #withTimeoutDuration(java.time.Duration)} instead. */ + @ObsoleteApi("Use withTimeoutDuration(java.time.Duration) instead") + ApiCallContext withTimeout(@Nullable org.threeten.bp.Duration timeout); + /** * Returns a new ApiCallContext with the given timeout set. * @@ -75,11 +82,23 @@ public interface ApiCallContext extends RetryingContext { *

        If a method has default {@link com.google.api.gax.retrying.RetrySettings}, the max attempts * and/or total timeout is still respected when scheduling each RPC attempt. */ - ApiCallContext withTimeout(@Nullable Duration timeout); + ApiCallContext withTimeoutDuration(@Nullable java.time.Duration timeout); + + /** This method is obsolete. Use {@link #getTimeoutDuration()} instead. */ + @Nullable + @ObsoleteApi("Use getTimeoutDuration() instead") + org.threeten.bp.Duration getTimeout(); /** Returns the configured per-RPC timeout. */ @Nullable - Duration getTimeout(); + java.time.Duration getTimeoutDuration(); + + /** + * This method is obsolete. Use {@link #withStreamWaitTimeoutDuration(java.time.Duration)} + * instead. + */ + @ObsoleteApi("Use withStreamWaitTimeoutDuration(java.time.Duration) instead") + ApiCallContext withStreamWaitTimeout(@Nullable org.threeten.bp.Duration streamWaitTimeout); /** * Returns a new ApiCallContext with the given stream timeout set. @@ -92,21 +111,33 @@ public interface ApiCallContext extends RetryingContext { * server or connection stalls. When the timeout has been reached, the stream will be closed with * a retryable {@link WatchdogTimeoutException} and a status of {@link StatusCode.Code#ABORTED}. * - *

        A value of {@link Duration#ZERO}, disables the streaming wait timeout and a null value will - * use the default in the callable. + *

        A value of {@link java.time.Duration#ZERO}, disables the streaming wait timeout and a null + * value will use the default in the callable. * *

        Please note that this timeout is best effort and the maximum resolution is configured in - * {@link StubSettings#getStreamWatchdogCheckInterval()}. + * {@link StubSettings#getStreamWatchdogCheckIntervalDuration()}. */ - ApiCallContext withStreamWaitTimeout(@Nullable Duration streamWaitTimeout); + ApiCallContext withStreamWaitTimeoutDuration(@Nullable java.time.Duration streamWaitTimeout); + + /** This method is obsolete. Use {@link #getStreamWaitTimeoutDuration()} instead. */ + @Nullable + @ObsoleteApi("Use getStreamWaitTimeoutDuration() instead") + org.threeten.bp.Duration getStreamWaitTimeout(); /** * Return the stream wait timeout set for this context. * - * @see #withStreamWaitTimeout(Duration) + * @see #withStreamWaitTimeoutDuration(java.time.Duration) */ @Nullable - Duration getStreamWaitTimeout(); + java.time.Duration getStreamWaitTimeoutDuration(); + + /** + * This method is obsolete. Use {@link #withStreamIdleTimeoutDuration(java.time.Duration)} + * instead. + */ + @ObsoleteApi("Use withStreamIdleTimeoutDuration(java.time.Duration) instead") + ApiCallContext withStreamIdleTimeout(@Nullable org.threeten.bp.Duration streamIdleTimeout); /** * Returns a new ApiCallContext with the given stream idle timeout set. @@ -115,26 +146,31 @@ public interface ApiCallContext extends RetryingContext { * amount of timeout that can pass between a message being received by {@link * ResponseObserver#onResponse(Object)} and demand being signaled via {@link * StreamController#request(int)}. Please note that this timeout is best effort and the maximum - * resolution configured in {@link StubSettings#getStreamWatchdogCheckInterval()}. This is useful - * to clean up streams that were partially read but never closed. When the timeout has been + * resolution configured in {@link StubSettings#getStreamWatchdogCheckIntervalDuration()}. This is + * useful to clean up streams that were partially read but never closed. When the timeout has been * reached, the stream will be closed with a nonretryable {@link WatchdogTimeoutException} and a * status of {@link StatusCode.Code#ABORTED}. * - *

        A value of {@link Duration#ZERO}, disables the streaming idle timeout and a null value will - * use the default in the callable. + *

        A value of {@link java.time.Duration#ZERO}, disables the streaming idle timeout and a null + * value will use the default in the callable. * *

        Please note that this timeout is best effort and the maximum resolution is configured in - * {@link StubSettings#getStreamWatchdogCheckInterval()}. + * {@link StubSettings#getStreamWatchdogCheckIntervalDuration()}. */ - ApiCallContext withStreamIdleTimeout(@Nullable Duration streamIdleTimeout); + ApiCallContext withStreamIdleTimeoutDuration(@Nullable java.time.Duration streamIdleTimeout); + + /** This method is obsolete. Use {@link #getStreamIdleTimeoutDuration()} instead. */ + @Nullable + @ObsoleteApi("Use getStreamIdleTimeoutDuration() instead") + org.threeten.bp.Duration getStreamIdleTimeout(); /** * The stream idle timeout set for this context. * - * @see #withStreamIdleTimeout(Duration) + * @see #withStreamIdleTimeoutDuration(java.time.Duration) */ @Nullable - Duration getStreamIdleTimeout(); + java.time.Duration getStreamIdleTimeoutDuration(); /** * The {@link ApiTracer} that was previously set for this context. @@ -190,7 +226,7 @@ public interface ApiCallContext extends RetryingContext { * } * * Setting a logical call timeout for the context can be done similarly with {@link - * RetrySettings.Builder#setLogicalTimeout(Duration timeout)}. + * RetrySettings.Builder#setLogicalTimeout(java.time.Duration timeout)}. * *

        Example usage: * diff --git a/gax-java/gax/src/main/java/com/google/api/gax/rpc/ApiClientHeaderProvider.java b/gax-java/gax/src/main/java/com/google/api/gax/rpc/ApiClientHeaderProvider.java index 34d00d0f3a..6421181a1f 100644 --- a/gax-java/gax/src/main/java/com/google/api/gax/rpc/ApiClientHeaderProvider.java +++ b/gax-java/gax/src/main/java/com/google/api/gax/rpc/ApiClientHeaderProvider.java @@ -33,6 +33,8 @@ import com.google.common.collect.ImmutableMap; import java.io.Serializable; import java.util.Map; +import java.util.regex.Matcher; +import java.util.regex.Pattern; /** * Implementation of HeaderProvider that provides headers describing the API client library making @@ -41,6 +43,9 @@ public class ApiClientHeaderProvider implements HeaderProvider, Serializable { private static final long serialVersionUID = -8876627296793342119L; static final String QUOTA_PROJECT_ID_HEADER_KEY = "x-goog-user-project"; + static final String PROTOBUF_HEADER_VERSION_KEY = "protobuf"; + + public static final String API_VERSION_HEADER_KEY = "x-goog-api-version"; private final Map headers; @@ -55,8 +60,12 @@ protected ApiClientHeaderProvider(Builder builder) { appendToken(apiClientHeaderValue, builder.getGeneratedLibToken()); appendToken(apiClientHeaderValue, builder.getGeneratedRuntimeToken()); appendToken(apiClientHeaderValue, builder.getTransportToken()); + appendToken(apiClientHeaderValue, builder.protobufRuntimeToken); + if (apiClientHeaderValue.length() > 0) { - headersBuilder.put(builder.getApiClientHeaderKey(), apiClientHeaderValue.toString()); + headersBuilder.put( + builder.getApiClientHeaderKey(), + checkAndAppendProtobufVersionIfNecessary(apiClientHeaderValue)); } } @@ -68,9 +77,28 @@ protected ApiClientHeaderProvider(Builder builder) { headersBuilder.put(QUOTA_PROJECT_ID_HEADER_KEY, builder.getQuotaProjectIdToken()); } + if (builder.getApiVersionToken() != null) { + headersBuilder.put(API_VERSION_HEADER_KEY, builder.getApiVersionToken()); + } this.headers = headersBuilder.build(); } + private static String checkAndAppendProtobufVersionIfNecessary( + StringBuilder apiClientHeaderValue) { + // TODO(b/366417603): appending protobuf version to existing client library token until resolved + Pattern pattern = Pattern.compile("(gccl|gapic)\\S*"); + Matcher matcher = pattern.matcher(apiClientHeaderValue); + if (matcher.find() && GaxProperties.getProtobufVersion() != null) { + return apiClientHeaderValue.substring(0, matcher.end()) + + "--" + + PROTOBUF_HEADER_VERSION_KEY + + "-" + + GaxProperties.getProtobufVersion() + + apiClientHeaderValue.substring(matcher.end()); + } + return apiClientHeaderValue.toString(); + } + @Override public Map getHeaders() { return headers; @@ -105,10 +133,13 @@ public static class Builder { private String generatedRuntimeToken; private String transportToken; private String quotaProjectIdToken; + private final String protobufRuntimeToken; private String resourceHeaderKey; private String resourceToken; + private String apiVersionToken; + protected Builder() { // Initialize with default values apiClientHeaderKey = getDefaultApiClientHeaderKey(); @@ -118,9 +149,11 @@ protected Builder() { setClientRuntimeToken(GaxProperties.getGaxVersion()); transportToken = null; quotaProjectIdToken = null; - resourceHeaderKey = getDefaultResourceHeaderKey(); resourceToken = null; + apiVersionToken = null; + protobufRuntimeToken = + constructToken(PROTOBUF_HEADER_VERSION_KEY, GaxProperties.getProtobufVersion()); } public String getApiClientHeaderKey() { @@ -177,7 +210,9 @@ public Builder setTransportToken(String name, String version) { return this; } - /** @return the quotaProjectIdToken used for quota and billing purposes. */ + /** + * @return the quotaProjectIdToken used for quota and billing purposes. + */ public String getQuotaProjectIdToken() { return quotaProjectIdToken; } @@ -206,6 +241,15 @@ public Builder setResourceToken(String resourceToken) { return this; } + public String getApiVersionToken() { + return apiVersionToken; + } + + public Builder setApiVersionToken(String apiVersionToken) { + this.apiVersionToken = apiVersionToken; + return this; + } + private String constructToken(String name, String version) { if (version == null) { return null; diff --git a/gax-java/gax/src/main/java/com/google/api/gax/rpc/ApiException.java b/gax-java/gax/src/main/java/com/google/api/gax/rpc/ApiException.java index 3722b894ee..be8d26811e 100644 --- a/gax-java/gax/src/main/java/com/google/api/gax/rpc/ApiException.java +++ b/gax-java/gax/src/main/java/com/google/api/gax/rpc/ApiException.java @@ -60,6 +60,18 @@ public ApiException( this.errorDetails = errorDetails; } + public ApiException( + String message, + Throwable cause, + StatusCode statusCode, + boolean retryable, + ErrorDetails errorDetails) { + super(message, cause); + this.statusCode = Preconditions.checkNotNull(statusCode); + this.retryable = retryable; + this.errorDetails = errorDetails; + } + /** Returns whether the failed request can be retried. */ public boolean isRetryable() { return retryable; diff --git a/gax-java/gax/src/main/java/com/google/api/gax/rpc/ApiExceptionFactory.java b/gax-java/gax/src/main/java/com/google/api/gax/rpc/ApiExceptionFactory.java index 4ca5f41c7b..2cc836b295 100644 --- a/gax-java/gax/src/main/java/com/google/api/gax/rpc/ApiExceptionFactory.java +++ b/gax-java/gax/src/main/java/com/google/api/gax/rpc/ApiExceptionFactory.java @@ -83,40 +83,50 @@ public static ApiException createException( public static ApiException createException( Throwable cause, StatusCode statusCode, boolean retryable, ErrorDetails errorDetails) { + return createException( + cause == null ? null : cause.toString(), cause, statusCode, retryable, errorDetails); + } + + public static ApiException createException( + String message, + Throwable cause, + StatusCode statusCode, + boolean retryable, + ErrorDetails errorDetails) { switch (statusCode.getCode()) { case CANCELLED: - return new CancelledException(cause, statusCode, retryable, errorDetails); + return new CancelledException(message, cause, statusCode, retryable, errorDetails); case NOT_FOUND: - return new NotFoundException(cause, statusCode, retryable, errorDetails); + return new NotFoundException(message, cause, statusCode, retryable, errorDetails); case INVALID_ARGUMENT: - return new InvalidArgumentException(cause, statusCode, retryable, errorDetails); + return new InvalidArgumentException(message, cause, statusCode, retryable, errorDetails); case DEADLINE_EXCEEDED: - return new DeadlineExceededException(cause, statusCode, retryable, errorDetails); + return new DeadlineExceededException(message, cause, statusCode, retryable, errorDetails); case ALREADY_EXISTS: - return new AlreadyExistsException(cause, statusCode, retryable, errorDetails); + return new AlreadyExistsException(message, cause, statusCode, retryable, errorDetails); case PERMISSION_DENIED: - return new PermissionDeniedException(cause, statusCode, retryable, errorDetails); + return new PermissionDeniedException(message, cause, statusCode, retryable, errorDetails); case RESOURCE_EXHAUSTED: - return new ResourceExhaustedException(cause, statusCode, retryable, errorDetails); + return new ResourceExhaustedException(message, cause, statusCode, retryable, errorDetails); case FAILED_PRECONDITION: - return new FailedPreconditionException(cause, statusCode, retryable, errorDetails); + return new FailedPreconditionException(message, cause, statusCode, retryable, errorDetails); case ABORTED: - return new AbortedException(cause, statusCode, retryable, errorDetails); + return new AbortedException(message, cause, statusCode, retryable, errorDetails); case OUT_OF_RANGE: - return new OutOfRangeException(cause, statusCode, retryable, errorDetails); + return new OutOfRangeException(message, cause, statusCode, retryable, errorDetails); case UNIMPLEMENTED: - return new UnimplementedException(cause, statusCode, retryable, errorDetails); + return new UnimplementedException(message, cause, statusCode, retryable, errorDetails); case INTERNAL: - return new InternalException(cause, statusCode, retryable, errorDetails); + return new InternalException(message, cause, statusCode, retryable, errorDetails); case UNAVAILABLE: - return new UnavailableException(cause, statusCode, retryable, errorDetails); + return new UnavailableException(message, cause, statusCode, retryable, errorDetails); case DATA_LOSS: - return new DataLossException(cause, statusCode, retryable, errorDetails); + return new DataLossException(message, cause, statusCode, retryable, errorDetails); case UNAUTHENTICATED: - return new UnauthenticatedException(cause, statusCode, retryable, errorDetails); + return new UnauthenticatedException(message, cause, statusCode, retryable, errorDetails); case UNKNOWN: // Fall through. default: - return new UnknownException(cause, statusCode, retryable, errorDetails); + return new UnknownException(message, cause, statusCode, retryable, errorDetails); } } } diff --git a/gax-java/gax/src/main/java/com/google/api/gax/rpc/AttemptCallable.java b/gax-java/gax/src/main/java/com/google/api/gax/rpc/AttemptCallable.java index 6b419f1d49..1fb461c5bb 100644 --- a/gax-java/gax/src/main/java/com/google/api/gax/rpc/AttemptCallable.java +++ b/gax-java/gax/src/main/java/com/google/api/gax/rpc/AttemptCallable.java @@ -35,7 +35,6 @@ import com.google.api.gax.retrying.RetryingFuture; import com.google.common.base.Preconditions; import java.util.concurrent.Callable; -import org.threeten.bp.Duration; /** * A callable representing an attempt to make an RPC call. This class is used from {@link @@ -70,9 +69,9 @@ public ResponseT call() { try { // Set the RPC timeout if the caller did not provide their own. - Duration rpcTimeout = externalFuture.getAttemptSettings().getRpcTimeout(); - if (!rpcTimeout.isZero() && callContext.getTimeout() == null) { - callContext = callContext.withTimeout(rpcTimeout); + java.time.Duration rpcTimeout = externalFuture.getAttemptSettings().getRpcTimeoutDuration(); + if (!rpcTimeout.isZero() && callContext.getTimeoutDuration() == null) { + callContext = callContext.withTimeoutDuration(rpcTimeout); } externalFuture.setAttemptFuture(new NonCancellableFuture()); diff --git a/gax-java/gax/src/main/java/com/google/api/gax/rpc/BatcherFactory.java b/gax-java/gax/src/main/java/com/google/api/gax/rpc/BatcherFactory.java index 8ac8093998..e324a21760 100644 --- a/gax-java/gax/src/main/java/com/google/api/gax/rpc/BatcherFactory.java +++ b/gax-java/gax/src/main/java/com/google/api/gax/rpc/BatcherFactory.java @@ -113,7 +113,7 @@ private ThresholdBatcher> createBatcher(PartitionKey return ThresholdBatcher.>newBuilder() .setThresholds(getThresholds(batchingSettings)) .setExecutor(executor) - .setMaxDelay(batchingSettings.getDelayThreshold()) + .setMaxDelayDuration(batchingSettings.getDelayThresholdDuration()) .setReceiver(processor) .setFlowController(batchingFlowController) .setBatchMerger(new BatchMergerImpl()) diff --git a/gax-java/gax/src/main/java/com/google/api/gax/rpc/BidiStreamingCallable.java b/gax-java/gax/src/main/java/com/google/api/gax/rpc/BidiStreamingCallable.java index c973675881..38efb2da37 100644 --- a/gax-java/gax/src/main/java/com/google/api/gax/rpc/BidiStreamingCallable.java +++ b/gax-java/gax/src/main/java/com/google/api/gax/rpc/BidiStreamingCallable.java @@ -100,15 +100,7 @@ public void call(final BidiStreamObserver bidiObserver) { /** Listens to server responses and send requests when the network is free. */ public void call( final BidiStreamObserver bidiObserver, ApiCallContext context) { - internalCall( - bidiObserver, - new ClientStreamReadyObserver() { - @Override - public void onReady(ClientStream stream) { - bidiObserver.onReady(stream); - } - }, - context); + internalCall(bidiObserver, bidiObserver, context); } /** @@ -183,11 +175,8 @@ public ClientStream splitCall( ResponseObserver responseObserver, ApiCallContext context) { return internalCall( responseObserver, - new ClientStreamReadyObserver() { - @Override - public void onReady(ClientStream stream) { - // no op - } + stream -> { + // no op }, context); } diff --git a/gax-java/gax/src/main/java/com/google/api/gax/rpc/Callables.java b/gax-java/gax/src/main/java/com/google/api/gax/rpc/Callables.java index 413a11649c..ab06d28aa6 100644 --- a/gax-java/gax/src/main/java/com/google/api/gax/rpc/Callables.java +++ b/gax-java/gax/src/main/java/com/google/api/gax/rpc/Callables.java @@ -51,19 +51,61 @@ public class Callables { private Callables() {} + /** + * Create a callable object that represents a Unary API method. Designed for use by generated + * code. + * + * @param innerCallable the callable to issue calls + * @param callSettings {@link UnaryCallSettings} to configure the unary call-related settings + * with. + * @param clientContext {@link ClientContext} to use to connect to the service. + * @return {@link UnaryCallable} callable object. + */ public static UnaryCallable retrying( UnaryCallable innerCallable, UnaryCallSettings callSettings, ClientContext clientContext) { + ScheduledRetryingExecutor retryingExecutor = + getRetryingExecutor(callSettings, clientContext); + return new RetryingCallable<>( + clientContext.getDefaultCallContext(), innerCallable, retryingExecutor); + } + + /** + * Create a callable object that represents a Unary API method that contains a Request Mutator. + * Designed for use by generated code. + * + * @param innerCallable the callable to issue calls + * @param callSettings {@link UnaryCallSettings} to configure the unary call-related settings + * with. + * @param clientContext {@link ClientContext} to use to connect to the service. + * @param requestMutator {@link RequestMutator} to modify the request. Currently only used for + * autopopulated fields. + * @return {@link UnaryCallable} callable object. + */ + public static UnaryCallable retrying( + UnaryCallable innerCallable, + UnaryCallSettings callSettings, + ClientContext clientContext, + RequestMutator requestMutator) { + + ScheduledRetryingExecutor retryingExecutor = + getRetryingExecutor(callSettings, clientContext); + return new RetryingCallable<>( + clientContext.getDefaultCallContext(), innerCallable, retryingExecutor, requestMutator); + } + + private static ScheduledRetryingExecutor getRetryingExecutor( + UnaryCallSettings callSettings, ClientContext clientContext) { UnaryCallSettings settings = callSettings; if (areRetriesDisabled(settings.getRetryableCodes(), settings.getRetrySettings())) { // When retries are disabled, the total timeout can be treated as the rpc timeout. settings = - settings - .toBuilder() - .setSimpleTimeoutNoRetries(settings.getRetrySettings().getTotalTimeout()) + settings.toBuilder() + .setSimpleTimeoutNoRetriesDuration( + settings.getRetrySettings().getTotalTimeoutDuration()) .build(); } @@ -73,8 +115,7 @@ public static UnaryCallable retrying( new ExponentialRetryAlgorithm(settings.getRetrySettings(), clientContext.getClock())); ScheduledRetryingExecutor retryingExecutor = new ScheduledRetryingExecutor<>(retryAlgorithm, clientContext.getExecutor()); - return new RetryingCallable<>( - clientContext.getDefaultCallContext(), innerCallable, retryingExecutor); + return retryingExecutor; } public static ServerStreamingCallable retrying( @@ -86,9 +127,9 @@ public static ServerStreamingCallable if (areRetriesDisabled(settings.getRetryableCodes(), settings.getRetrySettings())) { // When retries are disabled, the total timeout can be treated as the rpc timeout. settings = - settings - .toBuilder() - .setSimpleTimeoutNoRetries(settings.getRetrySettings().getTotalTimeout()) + settings.toBuilder() + .setSimpleTimeoutNoRetriesDuration( + settings.getRetrySettings().getTotalTimeoutDuration()) .build(); } @@ -115,7 +156,8 @@ public static ServerStreamingCallable callable.withDefaultCallContext( clientContext .getDefaultCallContext() - .withStreamIdleTimeout(callSettings.getIdleTimeout())); + .withStreamIdleTimeoutDuration(callSettings.getIdleTimeoutDuration()) + .withStreamWaitTimeoutDuration(callSettings.getWaitTimeoutDuration())); return callable; } @@ -230,6 +272,7 @@ private static boolean areRetriesDisabled( Collection retryableCodes, RetrySettings retrySettings) { return retrySettings.getMaxAttempts() == 1 || retryableCodes.isEmpty() - || (retrySettings.getMaxAttempts() == 0 && retrySettings.getTotalTimeout().isZero()); + || (retrySettings.getMaxAttempts() == 0 + && retrySettings.getTotalTimeoutDuration().isZero()); } } diff --git a/gax-java/gax/src/main/java/com/google/api/gax/rpc/CancelledException.java b/gax-java/gax/src/main/java/com/google/api/gax/rpc/CancelledException.java index 7bc15f04c3..f966c00315 100644 --- a/gax-java/gax/src/main/java/com/google/api/gax/rpc/CancelledException.java +++ b/gax-java/gax/src/main/java/com/google/api/gax/rpc/CancelledException.java @@ -44,4 +44,13 @@ public CancelledException( Throwable cause, StatusCode statusCode, boolean retryable, ErrorDetails errorDetails) { super(cause, statusCode, retryable, errorDetails); } + + public CancelledException( + String message, + Throwable cause, + StatusCode statusCode, + boolean retryable, + ErrorDetails errorDetails) { + super(message, cause, statusCode, retryable, errorDetails); + } } diff --git a/gax-java/gax/src/main/java/com/google/api/gax/rpc/CheckingAttemptCallable.java b/gax-java/gax/src/main/java/com/google/api/gax/rpc/CheckingAttemptCallable.java index 17670a5e7a..6e307d1f81 100644 --- a/gax-java/gax/src/main/java/com/google/api/gax/rpc/CheckingAttemptCallable.java +++ b/gax-java/gax/src/main/java/com/google/api/gax/rpc/CheckingAttemptCallable.java @@ -35,7 +35,6 @@ import com.google.api.gax.retrying.RetryingFuture; import com.google.common.base.Preconditions; import java.util.concurrent.Callable; -import org.threeten.bp.Duration; /** * A callable representing an attempt to check the status of something by issuing a call to a @@ -66,9 +65,9 @@ public ResponseT call() { ApiCallContext callContext = originalCallContext; try { - Duration rpcTimeout = externalFuture.getAttemptSettings().getRpcTimeout(); + java.time.Duration rpcTimeout = externalFuture.getAttemptSettings().getRpcTimeoutDuration(); if (!rpcTimeout.isZero()) { - callContext = callContext.withTimeout(rpcTimeout); + callContext = callContext.withTimeoutDuration(rpcTimeout); } externalFuture.setAttemptFuture(new NonCancellableFuture()); diff --git a/gax-java/gax/src/main/java/com/google/api/gax/rpc/ClientContext.java b/gax-java/gax/src/main/java/com/google/api/gax/rpc/ClientContext.java index 45a54e5491..43fdd848b6 100644 --- a/gax-java/gax/src/main/java/com/google/api/gax/rpc/ClientContext.java +++ b/gax-java/gax/src/main/java/com/google/api/gax/rpc/ClientContext.java @@ -29,22 +29,33 @@ */ package com.google.api.gax.rpc; +import static com.google.api.gax.util.TimeConversionUtils.toJavaTimeDuration; +import static com.google.api.gax.util.TimeConversionUtils.toThreetenDuration; + +import com.google.api.client.util.Strings; import com.google.api.core.ApiClock; import com.google.api.core.BetaApi; import com.google.api.core.NanoClock; +import com.google.api.core.ObsoleteApi; import com.google.api.gax.core.BackgroundResource; import com.google.api.gax.core.ExecutorAsBackgroundResource; import com.google.api.gax.core.ExecutorProvider; import com.google.api.gax.rpc.internal.QuotaProjectIdHidingCredentials; -import com.google.api.gax.rpc.mtls.MtlsProvider; +import com.google.api.gax.tracing.ApiTracerContext; import com.google.api.gax.tracing.ApiTracerFactory; import com.google.api.gax.tracing.BaseApiTracerFactory; +import com.google.api.gax.tracing.SpanTracerFactory; +import com.google.auth.ApiKeyCredentials; +import com.google.auth.CredentialTypeForMetrics; import com.google.auth.Credentials; +import com.google.auth.oauth2.GdchCredentials; import com.google.auto.value.AutoValue; +import com.google.common.annotations.VisibleForTesting; import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; import com.google.common.collect.Sets; import java.io.IOException; +import java.net.URI; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -54,7 +65,6 @@ import java.util.concurrent.ScheduledExecutorService; import javax.annotation.Nonnull; import javax.annotation.Nullable; -import org.threeten.bp.Duration; /** * Encapsulates client state, including executor, credentials, and transport channel. @@ -95,8 +105,18 @@ public abstract class ClientContext { @Nullable public abstract Watchdog getStreamWatchdog(); + /** This method is obsolete. Use {@link #getStreamWatchdogCheckIntervalDuration()} instead. */ + @Nonnull + @ObsoleteApi("Use getStreamWatchdogCheckIntervalDuration() instead") + public final org.threeten.bp.Duration getStreamWatchdogCheckInterval() { + return toThreetenDuration(getStreamWatchdogCheckIntervalDuration()); + } + @Nonnull - public abstract Duration getStreamWatchdogCheckInterval(); + public abstract java.time.Duration getStreamWatchdogCheckIntervalDuration(); + + @Nullable + public abstract String getUniverseDomain(); @Nullable public abstract String getEndpoint(); @@ -104,11 +124,22 @@ public abstract class ClientContext { @Nullable public abstract String getQuotaProjectId(); + /** Package-Private as this is to be shared to StubSettings */ + abstract EndpointContext getEndpointContext(); + /** Gets the {@link ApiTracerFactory} that will be used to generate traces for operations. */ @BetaApi("The surface for tracing is not stable yet and may change in the future.") @Nonnull public abstract ApiTracerFactory getTracerFactory(); + /** + * Gets the API audience used when creating a Client that uses {@link + * com.google.auth.oauth2.GdchCredentials} + */ + @Nullable + public abstract String getGdchApiAudience(); + + /** Create a new ClientContext with default values */ public static Builder newBuilder() { return new AutoValue_ClientContext.Builder() .setBackgroundResources(Collections.emptyList()) @@ -117,9 +148,13 @@ public static Builder newBuilder() { .setInternalHeaders(Collections.emptyMap()) .setClock(NanoClock.getDefaultClock()) .setStreamWatchdog(null) - .setStreamWatchdogCheckInterval(Duration.ZERO) + .setStreamWatchdogCheckIntervalDuration(java.time.Duration.ZERO) .setTracerFactory(BaseApiTracerFactory.getInstance()) - .setQuotaProjectId(null); + .setQuotaProjectId(null) + .setGdchApiAudience(null) + // Attempt to create an empty, non-functioning EndpointContext by default. This is + // not exposed to the user via getters/setters. + .setEndpointContext(EndpointContext.getDefaultInstance()); } public abstract Builder toBuilder(); @@ -132,29 +167,6 @@ public static ClientContext create(ClientSettings settings) throws IOException { return create(settings.getStubSettings()); } - /** Returns the endpoint that should be used. See https://google.aip.dev/auth/4114. */ - static String getEndpoint( - String endpoint, - String mtlsEndpoint, - boolean switchToMtlsEndpointAllowed, - MtlsProvider mtlsProvider) - throws IOException { - if (switchToMtlsEndpointAllowed) { - switch (mtlsProvider.getMtlsEndpointUsagePolicy()) { - case ALWAYS: - return mtlsEndpoint; - case NEVER: - return endpoint; - default: - if (mtlsProvider.useMtlsClientCertificate() && mtlsProvider.getKeyStore() != null) { - return mtlsEndpoint; - } - return endpoint; - } - } - return endpoint; - } - /** * Instantiates the executor, credentials, and transport context based on the given client * settings. @@ -165,9 +177,28 @@ public static ClientContext create(StubSettings settings) throws IOException { ExecutorProvider backgroundExecutorProvider = settings.getBackgroundExecutorProvider(); final ScheduledExecutorService backgroundExecutor = backgroundExecutorProvider.getExecutor(); - Credentials credentials = settings.getCredentialsProvider().getCredentials(); + // A valid EndpointContext should have been created in the StubSettings + EndpointContext endpointContext = settings.getEndpointContext(); + String endpoint = endpointContext.resolvedEndpoint(); + Credentials credentials = getCredentials(settings); + // check if need to adjust credentials/endpoint/endpointContext for GDC-H + String settingsGdchApiAudience = settings.getGdchApiAudience(); + boolean usingGDCH = credentials instanceof GdchCredentials; + if (usingGDCH) { + // Can only determine if the GDC-H is being used via the Credentials. The Credentials object + // is resolved in the ClientContext and must be passed to the EndpointContext. Rebuild the + // endpointContext only on GDC-H flows. + endpointContext = endpointContext.withGDCH(); + // Resolve the new endpoint with the GDC-H flow + endpoint = endpointContext.resolvedEndpoint(); + // We recompute the GdchCredentials with the audience + credentials = getGdchCredentials(settingsGdchApiAudience, endpoint, credentials); + } else if (!Strings.isNullOrEmpty(settingsGdchApiAudience)) { + throw new IllegalArgumentException( + "GDC-H API audience can only be set when using GdchCredentials"); + } - if (settings.getQuotaProjectId() != null) { + if (settings.getQuotaProjectId() != null && credentials != null) { // If the quotaProjectId is set, wrap original credentials with correct quotaProjectId as // QuotaProjectIdHidingCredentials. // Ensure that a custom set quota project id takes priority over one detected by credentials. @@ -180,24 +211,28 @@ public static ClientContext create(StubSettings settings) throws IOException { // executor can only be set from TransportChannelProvider#withExecutor directly, and a provider // will have a default executor if it needs one. if (transportChannelProvider.needsExecutor() && settings.getExecutorProvider() != null) { - transportChannelProvider = transportChannelProvider.withExecutor(backgroundExecutor); + transportChannelProvider = + transportChannelProvider.withExecutor(settings.getExecutorProvider().getExecutor()); } - Map headers = getHeadersFromSettings(settings); + if (transportChannelProvider.needsBackgroundExecutor()) { + transportChannelProvider = + transportChannelProvider.withBackgroundExecutor(backgroundExecutor); + } + Map headers = getHeaders(settings, credentials); if (transportChannelProvider.needsHeaders()) { transportChannelProvider = transportChannelProvider.withHeaders(headers); } if (transportChannelProvider.needsCredentials() && credentials != null) { transportChannelProvider = transportChannelProvider.withCredentials(credentials); } - String endpoint = - getEndpoint( - settings.getEndpoint(), - settings.getMtlsEndpoint(), - settings.getSwitchToMtlsEndpointAllowed(), - new MtlsProvider()); if (transportChannelProvider.needsEndpoint()) { transportChannelProvider = transportChannelProvider.withEndpoint(endpoint); } + transportChannelProvider = transportChannelProvider.withUseS2A(endpointContext.useS2A()); + if (transportChannelProvider.needsMtlsEndpoint() && endpointContext.mtlsEndpoint() != null) { + transportChannelProvider = + transportChannelProvider.withMtlsEndpoint(endpointContext.mtlsEndpoint()); + } TransportChannel transportChannel = transportChannelProvider.getTransportChannel(); ApiCallContext defaultCallContext = @@ -205,6 +240,7 @@ public static ClientContext create(StubSettings settings) throws IOException { if (credentials != null) { defaultCallContext = defaultCallContext.withCredentials(credentials); } + defaultCallContext = defaultCallContext.withEndpointContext(endpointContext); WatchdogProvider watchdogProvider = settings.getStreamWatchdogProvider(); @Nullable Watchdog watchdog = null; @@ -212,7 +248,8 @@ public static ClientContext create(StubSettings settings) throws IOException { if (watchdogProvider != null) { if (watchdogProvider.needsCheckInterval()) { watchdogProvider = - watchdogProvider.withCheckInterval(settings.getStreamWatchdogCheckInterval()); + watchdogProvider.withCheckIntervalDuration( + settings.getStreamWatchdogCheckIntervalDuration()); } if (watchdogProvider.needsClock()) { watchdogProvider = watchdogProvider.withClock(clock); @@ -234,6 +271,16 @@ public static ClientContext create(StubSettings settings) throws IOException { if (watchdogProvider != null && watchdogProvider.shouldAutoClose()) { backgroundResources.add(watchdog); } + ApiTracerContext apiTracerContext = + ApiTracerContext.newBuilder() + .setServerAddress(endpointContext.resolvedServerAddress()) + .setServerPort(endpointContext.resolvedServerPort()) + .setLibraryMetadata(settings.getLibraryMetadata()) + .build(); + ApiTracerFactory apiTracerFactory = settings.getTracerFactory(); + if (apiTracerFactory instanceof SpanTracerFactory) { + apiTracerFactory = apiTracerFactory.withContext(apiTracerContext); + } return newBuilder() .setBackgroundResources(backgroundResources.build()) @@ -244,19 +291,61 @@ public static ClientContext create(StubSettings settings) throws IOException { .setInternalHeaders(ImmutableMap.copyOf(settings.getInternalHeaderProvider().getHeaders())) .setClock(clock) .setDefaultCallContext(defaultCallContext) + .setUniverseDomain(settings.getUniverseDomain()) .setEndpoint(settings.getEndpoint()) .setQuotaProjectId(settings.getQuotaProjectId()) .setStreamWatchdog(watchdog) - .setStreamWatchdogCheckInterval(settings.getStreamWatchdogCheckInterval()) - .setTracerFactory(settings.getTracerFactory()) + .setStreamWatchdogCheckIntervalDuration(settings.getStreamWatchdogCheckIntervalDuration()) + .setTracerFactory(apiTracerFactory) + .setEndpointContext(endpointContext) .build(); } + /** Determines which credentials to use. API key overrides credentials provided by provider. */ + private static Credentials getCredentials(StubSettings settings) throws IOException { + Credentials credentials; + if (settings.getApiKey() != null) { + // if API key exists it becomes the default credential + credentials = ApiKeyCredentials.create(settings.getApiKey()); + } else { + credentials = settings.getCredentialsProvider().getCredentials(); + } + return credentials; + } + + /** + * Constructs a new {@link com.google.auth.Credentials} object based on credentials provided with + * a GDC-H audience + */ + @VisibleForTesting + static GdchCredentials getGdchCredentials( + String settingsGdchApiAudience, String endpoint, Credentials credentials) throws IOException { + String audienceString; + if (!Strings.isNullOrEmpty(settingsGdchApiAudience)) { + audienceString = settingsGdchApiAudience; + } else if (!Strings.isNullOrEmpty(endpoint)) { + audienceString = endpoint; + } else { + throw new IllegalArgumentException("Could not infer GDCH api audience from settings"); + } + + URI gdchAudienceUri; + try { + gdchAudienceUri = URI.create(audienceString); + } catch (IllegalArgumentException ex) { // thrown when passing a malformed uri string + throw new IllegalArgumentException("The GDC-H API audience string is not a valid URI", ex); + } + return ((GdchCredentials) credentials).createWithGdchAudience(gdchAudienceUri); + } + /** * Getting a header map from HeaderProvider and InternalHeaderProvider from settings with Quota * Project Id. + * + *

        Then if credentials is present and its type for metrics is not {@code + * CredentialTypeForMetrics.DO_NOT_SEND}, append this type info to x-goog-api-client header. */ - private static Map getHeadersFromSettings(StubSettings settings) { + private static Map getHeaders(StubSettings settings, Credentials credentials) { // Resolve conflicts when merging headers from multiple sources Map userHeaders = settings.getHeaderProvider().getHeaders(); Map internalHeaders = settings.getInternalHeaderProvider().getHeaders(); @@ -283,6 +372,20 @@ private static Map getHeadersFromSettings(StubSettings settings) effectiveHeaders.putAll(userHeaders); effectiveHeaders.putAll(conflictResolution); + return appendCredentialTypeToHeaderIfPresent(effectiveHeaders, credentials); + } + + private static Map appendCredentialTypeToHeaderIfPresent( + Map effectiveHeaders, Credentials credentials) { + CredentialTypeForMetrics credentialTypeForMetrics = + credentials == null + ? CredentialTypeForMetrics.DO_NOT_SEND + : credentials.getMetricsCredentialType(); + if (credentialTypeForMetrics != CredentialTypeForMetrics.DO_NOT_SEND) { + effectiveHeaders.computeIfPresent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + (key, value) -> value + " cred-type/" + credentialTypeForMetrics.getLabel()); + } return ImmutableMap.copyOf(effectiveHeaders); } @@ -309,13 +412,24 @@ public abstract static class Builder { public abstract Builder setDefaultCallContext(ApiCallContext defaultCallContext); + public abstract Builder setUniverseDomain(String universeDomain); + public abstract Builder setEndpoint(String endpoint); public abstract Builder setQuotaProjectId(String QuotaProjectId); public abstract Builder setStreamWatchdog(Watchdog watchdog); - public abstract Builder setStreamWatchdogCheckInterval(Duration duration); + /** + * This method is obsolete. Use {@link + * #setStreamWatchdogCheckIntervalDuration(java.time.Duration)} instead. + */ + @ObsoleteApi("Use setStreamWatchdogCheckIntervalDuration(java.time.Duration) instead") + public final Builder setStreamWatchdogCheckInterval(org.threeten.bp.Duration duration) { + return setStreamWatchdogCheckIntervalDuration(toJavaTimeDuration(duration)); + } + + public abstract Builder setStreamWatchdogCheckIntervalDuration(java.time.Duration duration); /** * Set the {@link ApiTracerFactory} that will be used to generate traces for operations. @@ -325,6 +439,20 @@ public abstract static class Builder { @BetaApi("The surface for tracing is not stable yet and may change in the future.") public abstract Builder setTracerFactory(ApiTracerFactory tracerFactory); + /** + * Sets the API audience used by {@link com.google.auth.oauth2.GdchCredentials} It cannot be + * used if other type of {@link com.google.auth.Credentials} is used + * + *

        If the provided credentials already contain an api audience, it will be overriden by this + * one + * + * @param gdchApiAudience the audience to be used - must be a valid URI string + */ + public abstract Builder setGdchApiAudience(String gdchApiAudience); + + /** Package-Private as this is to be shared to StubSettings */ + abstract Builder setEndpointContext(EndpointContext endpointContext); + public abstract ClientContext build(); } } diff --git a/gax-java/gax/src/main/java/com/google/api/gax/rpc/ClientSettings.java b/gax-java/gax/src/main/java/com/google/api/gax/rpc/ClientSettings.java index a1097a4100..c1e41b82e6 100644 --- a/gax-java/gax/src/main/java/com/google/api/gax/rpc/ClientSettings.java +++ b/gax-java/gax/src/main/java/com/google/api/gax/rpc/ClientSettings.java @@ -29,8 +29,11 @@ */ package com.google.api.gax.rpc; +import static com.google.api.gax.util.TimeConversionUtils.toJavaTimeDuration; + import com.google.api.core.ApiClock; import com.google.api.core.ApiFunction; +import com.google.api.core.ObsoleteApi; import com.google.api.gax.core.CredentialsProvider; import com.google.api.gax.core.ExecutorProvider; import com.google.common.base.MoreObjects; @@ -38,7 +41,6 @@ import java.util.concurrent.Executor; import javax.annotation.Nonnull; import javax.annotation.Nullable; -import org.threeten.bp.Duration; /** * A base settings class to configure a client class. @@ -63,7 +65,9 @@ public final StubSettings getStubSettings() { return stubSettings; } - /** @deprecated Please use {@link #getBackgroundExecutorProvider()} */ + /** + * @deprecated Please use {@link #getBackgroundExecutorProvider()} + */ @Deprecated public final ExecutorProvider getExecutorProvider() { return stubSettings.getExecutorProvider(); @@ -93,6 +97,10 @@ public final ApiClock getClock() { return stubSettings.getClock(); } + public final String getUniverseDomain() { + return stubSettings.getUniverseDomain(); + } + public final String getEndpoint() { return stubSettings.getEndpoint(); } @@ -106,11 +114,28 @@ public final WatchdogProvider getWatchdogProvider() { return stubSettings.getStreamWatchdogProvider(); } + /** Gets the API Key that should be used for authentication. */ + public final String getApiKey() { + return stubSettings.getApiKey(); + } + + /** This method is obsolete. Use {@link #getWatchdogCheckIntervalDuration()} instead. */ @Nonnull - public final Duration getWatchdogCheckInterval() { + @ObsoleteApi("Use getWatchdogCheckIntervalDuration() instead") + public final org.threeten.bp.Duration getWatchdogCheckInterval() { return stubSettings.getStreamWatchdogCheckInterval(); } + @Nonnull + public final java.time.Duration getWatchdogCheckIntervalDuration() { + return stubSettings.getStreamWatchdogCheckIntervalDuration(); + } + + /** Gets the GDCH API audience that was previously set in this Builder */ + public final String getGdchApiAudience() { + return stubSettings.getGdchApiAudience(); + } + public String toString() { return MoreObjects.toStringHelper(this) .add("executorProvider", getExecutorProvider()) @@ -120,10 +145,13 @@ public String toString() { .add("headerProvider", getHeaderProvider()) .add("internalHeaderProvider", getInternalHeaderProvider()) .add("clock", getClock()) + .add("universeDomain", getUniverseDomain()) .add("endpoint", getEndpoint()) .add("quotaProjectId", getQuotaProjectId()) .add("watchdogProvider", getWatchdogProvider()) .add("watchdogCheckInterval", getWatchdogCheckInterval()) + .add("gdchApiAudience", getGdchApiAudience()) + .add("apiKey", getApiKey()) .toString(); } @@ -235,6 +263,12 @@ public B setClock(ApiClock clock) { return self(); } + /** Sets the Universe Domain to configure the resolved endpoint */ + public B setUniverseDomain(String universeDomain) { + stubSettings.setUniverseDomain(universeDomain); + return self(); + } + public B setEndpoint(String endpoint) { stubSettings.setEndpoint(endpoint); return self(); @@ -250,8 +284,44 @@ public B setWatchdogProvider(@Nullable WatchdogProvider watchdogProvider) { return self(); } - public B setWatchdogCheckInterval(@Nullable Duration checkInterval) { - stubSettings.setStreamWatchdogCheckInterval(checkInterval); + /** + * This method is obsolete. Use {@link #setWatchdogCheckIntervalDuration(java.time.Duration)} + * instead. + */ + @ObsoleteApi("Use setWatchdogCheckIntervalDuration(java.time.Duration) instead") + public B setWatchdogCheckInterval(@Nullable org.threeten.bp.Duration checkInterval) { + return setWatchdogCheckIntervalDuration(toJavaTimeDuration(checkInterval)); + } + + public B setWatchdogCheckIntervalDuration(@Nullable java.time.Duration checkInterval) { + stubSettings.setStreamWatchdogCheckIntervalDuration(checkInterval); + return self(); + } + + /** + * Sets the GDC-H api audience. This is intended only to be used with {@link + * com.google.auth.oauth2.GdchCredentials} If this field is set and other type of {@link + * com.google.auth.Credentials} is used then an {@link IllegalArgumentException} will be thrown. + * If the provided credentials already have an api audience, then it will be overriden by this + * audience + */ + public B setGdchApiAudience(@Nullable String gdchApiAudience) { + stubSettings.setGdchApiAudience(gdchApiAudience); + return self(); + } + + /** + * Sets the API key. The API key will get translated to an {@link + * com.google.auth.ApiKeyCredentials} and stored in {@link ClientContext}. + * + *

        API Key authorization is not supported for every product. Please check the documentation + * for each product to confirm if it is supported. + * + *

        Note: If you set an API key and {@link CredentialsProvider} in the same ClientSettings the + * API key will override any credentials provided. + */ + public B setApiKey(String apiKey) { + stubSettings.setApiKey(apiKey); return self(); } @@ -317,11 +387,29 @@ public WatchdogProvider getWatchdogProvider() { return stubSettings.getStreamWatchdogProvider(); } + /** Gets the API Key that was previously set on this Builder. */ + public String getApiKey() { + return stubSettings.getApiKey(); + } + + /** This method is obsolete. Use {@link #getWatchdogCheckIntervalDuration()} instead */ @Nullable - public Duration getWatchdogCheckInterval() { + @ObsoleteApi("Use getWatchdogCheckIntervalDuration() instead") + public org.threeten.bp.Duration getWatchdogCheckInterval() { return stubSettings.getStreamWatchdogCheckInterval(); } + @Nullable + public java.time.Duration getWatchdogCheckIntervalDuration() { + return stubSettings.getStreamWatchdogCheckIntervalDuration(); + } + + /** Gets the GDCH API audience that was previously set in this Builder */ + @Nullable + public String getGdchApiAudience() { + return stubSettings.getGdchApiAudience(); + } + /** Applies the given settings updater function to the given method settings builders. */ protected static void applyToAllUnaryMethods( Iterable> methodSettingsBuilders, @@ -343,7 +431,9 @@ public String toString() { .add("endpoint", getEndpoint()) .add("quotaProjectId", getQuotaProjectId()) .add("watchdogProvider", getWatchdogProvider()) - .add("watchdogCheckInterval", getWatchdogCheckInterval()) + .add("watchdogCheckInterval", getWatchdogCheckIntervalDuration()) + .add("gdchApiAudience", getGdchApiAudience()) + .add("apiKey", getApiKey()) .toString(); } } diff --git a/gax-java/gax/src/main/java/com/google/api/gax/rpc/ClientStreamReadyObserver.java b/gax-java/gax/src/main/java/com/google/api/gax/rpc/ClientStreamReadyObserver.java index 0347524512..d0c9f32d5b 100644 --- a/gax-java/gax/src/main/java/com/google/api/gax/rpc/ClientStreamReadyObserver.java +++ b/gax-java/gax/src/main/java/com/google/api/gax/rpc/ClientStreamReadyObserver.java @@ -30,6 +30,7 @@ package com.google.api.gax.rpc; /** A callback used to report that the {@link ClientStream} is ready to send more messages. */ +@FunctionalInterface public interface ClientStreamReadyObserver { void onReady(ClientStream stream); } diff --git a/gax-java/gax/src/main/java/com/google/api/gax/rpc/DataLossException.java b/gax-java/gax/src/main/java/com/google/api/gax/rpc/DataLossException.java index e3d9a8107c..f64d83c786 100644 --- a/gax-java/gax/src/main/java/com/google/api/gax/rpc/DataLossException.java +++ b/gax-java/gax/src/main/java/com/google/api/gax/rpc/DataLossException.java @@ -44,4 +44,13 @@ public DataLossException( Throwable cause, StatusCode statusCode, boolean retryable, ErrorDetails errorDetails) { super(cause, statusCode, retryable, errorDetails); } + + public DataLossException( + String message, + Throwable cause, + StatusCode statusCode, + boolean retryable, + ErrorDetails errorDetails) { + super(message, cause, statusCode, retryable, errorDetails); + } } diff --git a/gax-java/gax/src/main/java/com/google/api/gax/rpc/DeadlineExceededException.java b/gax-java/gax/src/main/java/com/google/api/gax/rpc/DeadlineExceededException.java index 37b5d8db00..1ac5a4cdcd 100644 --- a/gax-java/gax/src/main/java/com/google/api/gax/rpc/DeadlineExceededException.java +++ b/gax-java/gax/src/main/java/com/google/api/gax/rpc/DeadlineExceededException.java @@ -49,4 +49,13 @@ public DeadlineExceededException( Throwable cause, StatusCode statusCode, boolean retryable, ErrorDetails errorDetails) { super(cause, statusCode, retryable, errorDetails); } + + public DeadlineExceededException( + String message, + Throwable cause, + StatusCode statusCode, + boolean retryable, + ErrorDetails errorDetails) { + super(message, cause, statusCode, retryable, errorDetails); + } } diff --git a/gax-java/gax/src/main/java/com/google/api/gax/rpc/EndpointContext.java b/gax-java/gax/src/main/java/com/google/api/gax/rpc/EndpointContext.java new file mode 100644 index 0000000000..09e105cceb --- /dev/null +++ b/gax-java/gax/src/main/java/com/google/api/gax/rpc/EndpointContext.java @@ -0,0 +1,475 @@ +/* + * Copyright 2023 Google LLC + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Google LLC nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +package com.google.api.gax.rpc; + +import com.google.api.core.InternalApi; +import com.google.api.gax.rpc.internal.EnvironmentProvider; +import com.google.api.gax.rpc.mtls.CertificateBasedAccess; +import com.google.auth.Credentials; +import com.google.auth.mtls.CertificateSourceUnavailableException; +import com.google.auth.mtls.DefaultMtlsProviderFactory; +import com.google.auth.mtls.MtlsProvider; +import com.google.auth.oauth2.ComputeEngineCredentials; +import com.google.auto.value.AutoValue; +import com.google.common.annotations.VisibleForTesting; +import com.google.common.base.Strings; +import com.google.common.net.HostAndPort; +import java.io.IOException; +import java.util.logging.Level; +import java.util.logging.Logger; +import javax.annotation.Nullable; + +/** + * EndpointContext is an internal class used by the client library to resolve the endpoint. It is + * created once the library is initialized should not be updated manually. + * + *

        Contains the fields required to resolve the endpoint and Universe Domain + */ +@InternalApi +@AutoValue +public abstract class EndpointContext { + + @VisibleForTesting static final Logger LOG = Logger.getLogger(EndpointContext.class.getName()); + + private static final EndpointContext INSTANCE; + + // static block initialization for exception handling + static { + try { + INSTANCE = EndpointContext.newBuilder().setServiceName("").build(); + } catch (IOException e) { + throw new RuntimeException("Unable to create a default empty EndpointContext", e); + } + } + + public static final String GOOGLE_CLOUD_UNIVERSE_DOMAIN = "GOOGLE_CLOUD_UNIVERSE_DOMAIN"; + public static final String INVALID_UNIVERSE_DOMAIN_ERROR_TEMPLATE = + "The configured universe domain (%s) does not match the universe domain found in the credentials (%s). If you haven't configured the universe domain explicitly, `googleapis.com` is the default."; + public static final String UNABLE_TO_RETRIEVE_CREDENTIALS_ERROR_MESSAGE = + "Unable to retrieve the Universe Domain from the Credentials."; + // This environment variable is a temporary measure. It will be removed when the feature is + // non-experimental. + static final String S2A_ENV_ENABLE_USE_S2A = "EXPERIMENTAL_GOOGLE_API_USE_S2A_JAVA"; + + public static EndpointContext getDefaultInstance() { + return INSTANCE; + } + + /** + * ServiceName is host URI for Google Cloud Services. It follows the format of + * `{ServiceName}.googleapis.com`. For example, speech.googleapis.com would have a ServiceName of + * speech and cloudasset.googleapis.com would have a ServiceName of cloudasset. + */ + @Nullable + public abstract String serviceName(); + + /** + * Universe Domain is the domain for Google Cloud Services. It follows the format of + * `{ServiceName}.{UniverseDomain}`. For example, speech.googleapis.com would have a Universe + * Domain value of `googleapis.com` and cloudasset.test.com would have a Universe Domain of + * `test.com`. If this value is not set, this will default to `googleapis.com`. + */ + @Nullable + public abstract String universeDomain(); + + /** + * ClientSettingsEndpoint is the endpoint value set via the ClientSettings/StubSettings classes. + */ + @Nullable + public abstract String clientSettingsEndpoint(); + + /** + * TransportChannelProviderEndpoint is the endpoint value set via the TransportChannelProvider + * class. + */ + @Nullable + public abstract String transportChannelProviderEndpoint(); + + abstract boolean useS2A(); + + @Nullable + abstract EnvironmentProvider envProvider(); + + @Nullable + public abstract String mtlsEndpoint(); + + public abstract boolean switchToMtlsEndpointAllowed(); + + @Nullable + public abstract MtlsProvider mtlsProvider(); + + @Nullable + abstract CertificateBasedAccess certificateBasedAccess(); + + public abstract boolean usingGDCH(); + + abstract String resolvedUniverseDomain(); + + public abstract String resolvedEndpoint(); + + public abstract String resolvedServerAddress(); + + @Nullable + public abstract Integer resolvedServerPort(); + + public abstract Builder toBuilder(); + + public static Builder newBuilder() { + return new AutoValue_EndpointContext.Builder() + .setSwitchToMtlsEndpointAllowed(false) + .setUsingGDCH(false) + .setEnvProvider(System::getenv); + } + + /** Configure the existing EndpointContext to be using GDC-H */ + EndpointContext withGDCH() throws IOException { + return toBuilder().setUsingGDCH(true).build(); + } + + /** + * Check that the User configured universe domain matches the Credentials' universe domain. The + * status code parameter is passed in to this method as it's a limitation of Gax's modules. The + * transport-neutral module does have access the transport-specific modules (which contain the + * implementation of the StatusCode). This method is scoped to be internal and should be not be + * accessed by users. + * + * @param credentials Auth Library Credentials + * @param invalidUniverseDomainStatusCode Transport-specific Status Code to be returned if the + * Universe Domain is invalid. For both transports, this is defined to be Unauthorized. + * @throws IOException Implementation of Auth's Retryable interface which tells the client library + * whether the RPC should be retried or not. + */ + public void validateUniverseDomain( + Credentials credentials, StatusCode invalidUniverseDomainStatusCode) throws IOException { + if (usingGDCH()) { + // GDC-H has no universe domain, return + return; + } + // (TODO: b/349488459) - Disable automatic requests to MDS until 01/2025 + // If MDS is required for Universe Domain, do not do any validation + if (credentials instanceof ComputeEngineCredentials) { + return; + } + String credentialsUniverseDomain = Credentials.GOOGLE_DEFAULT_UNIVERSE; + // If credentials is not NoCredentialsProvider, use the Universe Domain inside Credentials + if (credentials != null) { + credentialsUniverseDomain = credentials.getUniverseDomain(); + } + if (!resolvedUniverseDomain().equals(credentialsUniverseDomain)) { + throw ApiExceptionFactory.createException( + new Throwable( + String.format( + EndpointContext.INVALID_UNIVERSE_DOMAIN_ERROR_TEMPLATE, + resolvedUniverseDomain(), + credentialsUniverseDomain)), + invalidUniverseDomainStatusCode, + false); + } + } + + @AutoValue.Builder + public abstract static class Builder { + /** + * ServiceName is host URI for Google Cloud Services. It follows the format of + * `{ServiceName}.googleapis.com`. For example, speech.googleapis.com would have a ServiceName + * of speech and cloudasset.googleapis.com would have a ServiceName of cloudasset. + */ + public abstract Builder setServiceName(String serviceName); + + /** + * Universe Domain is the domain for Google Cloud Services. It follows the format of + * `{ServiceName}.{UniverseDomain}`. For example, speech.googleapis.com would have a Universe + * Domain value of `googleapis.com` and cloudasset.test.com would have a Universe Domain of + * `test.com`. If this value is not set, this will default to `googleapis.com`. + */ + public abstract Builder setUniverseDomain(String universeDomain); + + /** + * ClientSettingsEndpoint is the endpoint value set via the ClientSettings/StubSettings classes. + */ + public abstract Builder setClientSettingsEndpoint(String clientSettingsEndpoint); + + /** + * TransportChannelProviderEndpoint is the endpoint value set via the TransportChannelProvider + * class. + */ + public abstract Builder setTransportChannelProviderEndpoint(String transportChannelEndpoint); + + public abstract Builder setMtlsEndpoint(String mtlsEndpoint); + + public abstract Builder setSwitchToMtlsEndpointAllowed(boolean switchToMtlsEndpointAllowed); + + public abstract Builder setMtlsProvider(MtlsProvider mtlsProvider); + + abstract Builder setCertificateBasedAccess(CertificateBasedAccess certificateBasedAccess); + + public abstract Builder setUsingGDCH(boolean usingGDCH); + + public abstract Builder setResolvedEndpoint(String resolvedEndpoint); + + public abstract Builder setResolvedServerAddress(String serverAddress); + + public abstract Builder setResolvedServerPort(Integer serverPort); + + public abstract Builder setResolvedUniverseDomain(String resolvedUniverseDomain); + + abstract Builder setUseS2A(boolean useS2A); + + abstract Builder setEnvProvider(EnvironmentProvider envProvider); + + abstract String serviceName(); + + abstract String universeDomain(); + + abstract String clientSettingsEndpoint(); + + abstract String transportChannelProviderEndpoint(); + + abstract boolean useS2A(); + + abstract EnvironmentProvider envProvider(); + + abstract String mtlsEndpoint(); + + abstract boolean switchToMtlsEndpointAllowed(); + + @Nullable + abstract MtlsProvider mtlsProvider(); + + abstract CertificateBasedAccess certificateBasedAccess(); + + abstract boolean usingGDCH(); + + abstract String resolvedUniverseDomain(); + + abstract String resolvedEndpoint(); + + abstract EndpointContext autoBuild(); + + private String determineUniverseDomain() { + String universeDomain = universeDomain(); + if (usingGDCH()) { + // GDC-H has no concept of Universe Domain. User should not set a custom value + if (universeDomain != null) { + throw new IllegalArgumentException( + "Universe domain configuration is incompatible with GDC-H"); + } + return Credentials.GOOGLE_DEFAULT_UNIVERSE; + } + // Check for "" (empty string) + if (universeDomain != null && universeDomain.isEmpty()) { + throw new IllegalArgumentException("The universe domain value cannot be empty."); + } + // If the universe domain wasn't configured explicitly in the settings, check the + // environment variable for the value + if (universeDomain == null) { + universeDomain = System.getenv(GOOGLE_CLOUD_UNIVERSE_DOMAIN); + } + // If the universe domain is configured by the user, the universe domain will either be + // from the settings or from the env var. The value from ClientSettings has priority. + return universeDomain != null ? universeDomain : Credentials.GOOGLE_DEFAULT_UNIVERSE; + } + + /** Determines the fully resolved endpoint and universe domain values */ + private String determineEndpoint() throws IOException { + CertificateBasedAccess certificateBasedAccess = + certificateBasedAccess() == null + ? CertificateBasedAccess.createWithSystemEnv() + : certificateBasedAccess(); + MtlsProvider mtlsProvider = mtlsProvider(); + + // Only attempt to create a default MtlsProvider if client certificate usage is enabled. + if (certificateBasedAccess.useMtlsClientCertificate()) { + if (mtlsProvider == null) { + try { + mtlsProvider = DefaultMtlsProviderFactory.create(); + } catch (CertificateSourceUnavailableException e) { + // This is okay. Leave mtlsProvider as null; + } catch (IOException e) { + LOG.log( + Level.WARNING, + "DefaultMtlsProviderFactory encountered unexpected IOException: " + e.getMessage()); + LOG.log( + Level.WARNING, + "mTLS configuration was detected on the device, but mTLS failed to initialize. Falling back to non-mTLS channel."); + } + } + } + + // TransportChannelProvider's endpoint will override the ClientSettings' endpoint + String customEndpoint = + transportChannelProviderEndpoint() == null + ? clientSettingsEndpoint() + : transportChannelProviderEndpoint(); + + // GDC-H has a separate flow + if (usingGDCH()) { + if (customEndpoint == null) { + return buildEndpointTemplate(serviceName(), resolvedUniverseDomain()); + } + return customEndpoint; + } + + // If user does not provide a custom endpoint, build one with the universe domain + if (Strings.isNullOrEmpty(customEndpoint)) { + customEndpoint = buildEndpointTemplate(serviceName(), resolvedUniverseDomain()); + } + + String endpoint = + mtlsEndpointResolver( + customEndpoint, + mtlsEndpoint(), + switchToMtlsEndpointAllowed(), + mtlsProvider, + certificateBasedAccess); + + // Check if mTLS is configured with non-GDU + if (endpoint.equals(mtlsEndpoint()) + && !resolvedUniverseDomain().equals(Credentials.GOOGLE_DEFAULT_UNIVERSE)) { + throw new IllegalArgumentException( + "mTLS is not supported in any universe other than googleapis.com"); + } + + return endpoint; + } + + /** Determine if S2A can be used */ + @VisibleForTesting + boolean shouldUseS2A() { + // If mTLS endpoint is not available, skip S2A + if (Strings.isNullOrEmpty(mtlsEndpoint())) { + return false; + } + + // If EXPERIMENTAL_GOOGLE_API_USE_S2A_JAVA is not set to true, skip S2A. + String s2AEnv = envProvider().getenv(S2A_ENV_ENABLE_USE_S2A); + boolean s2AEnabled = Boolean.parseBoolean(s2AEnv); + if (!s2AEnabled) { + return false; + } + + // Skip S2A when using GDC-H + if (usingGDCH()) { + return false; + } + + // If a custom endpoint is being used, skip S2A. + if ((!Strings.isNullOrEmpty(clientSettingsEndpoint()) + && !buildEndpointTemplate(serviceName(), resolvedUniverseDomain()) + .contains(clientSettingsEndpoint())) + || (!Strings.isNullOrEmpty(transportChannelProviderEndpoint()) + && !buildEndpointTemplate(serviceName(), resolvedUniverseDomain()) + .contains(transportChannelProviderEndpoint()))) { + return false; + } + + // mTLS via S2A is not supported in any universe other than googleapis.com. + return mtlsEndpoint().contains(Credentials.GOOGLE_DEFAULT_UNIVERSE); + } + + private String parseServerAddress(String endpoint) { + if (endpoint.isEmpty()) { + return endpoint; + } + HostAndPort hostAndPort = parseServerHostAndPort(endpoint); + if (hostAndPort == null) { + return null; + } + return hostAndPort.getHost(); + } + + private Integer parseServerPort(String endpoint) { + if (endpoint.isEmpty()) { + return null; + } + HostAndPort hostAndPort = parseServerHostAndPort(endpoint); + if (!hostAndPort.hasPort()) { + return null; + } + return hostAndPort.getPort(); + } + + private HostAndPort parseServerHostAndPort(String endpoint) { + String hostPort = endpoint; + if (hostPort.contains("://")) { + // Strip the scheme if present. HostAndPort doesn't support schemes. + hostPort = hostPort.substring(hostPort.indexOf("://") + 3); + } + try { + return HostAndPort.fromString(hostPort); + } catch (IllegalArgumentException e) { + // Fallback for cases HostAndPort can't handle. + return null; + } + } + + // Default to port 443 for HTTPS. Using HTTP requires explicitly setting the endpoint + private String buildEndpointTemplate(String serviceName, String resolvedUniverseDomain) { + return serviceName + "." + resolvedUniverseDomain + ":443"; + } + + // Follows https://google.aip.dev/auth/4114 for resolving the endpoint + @VisibleForTesting + String mtlsEndpointResolver( + String endpoint, + String mtlsEndpoint, + boolean switchToMtlsEndpointAllowed, + MtlsProvider mtlsProvider, + CertificateBasedAccess certificateBasedAccess) + throws IOException { + if (switchToMtlsEndpointAllowed && certificateBasedAccess != null && mtlsProvider != null) { + switch (certificateBasedAccess.getMtlsEndpointUsagePolicy()) { + case ALWAYS: + return mtlsEndpoint; + case NEVER: + return endpoint; + default: + if (certificateBasedAccess.useMtlsClientCertificate() + && mtlsProvider.getKeyStore() != null) { + return mtlsEndpoint; + } + return endpoint; + } + } + return endpoint; + } + + public EndpointContext build() throws IOException { + // The Universe Domain is used to resolve the Endpoint. It should be resolved first + setResolvedUniverseDomain(determineUniverseDomain()); + String endpoint = determineEndpoint(); + setResolvedEndpoint(endpoint); + setResolvedServerAddress(parseServerAddress(resolvedEndpoint())); + setResolvedServerPort(parseServerPort(resolvedEndpoint())); + setUseS2A(shouldUseS2A()); + return autoBuild(); + } + } +} diff --git a/gax-java/gax/src/main/java/com/google/api/gax/rpc/ErrorDetails.java b/gax-java/gax/src/main/java/com/google/api/gax/rpc/ErrorDetails.java index 09c924b59f..45ba427b6e 100644 --- a/gax-java/gax/src/main/java/com/google/api/gax/rpc/ErrorDetails.java +++ b/gax-java/gax/src/main/java/com/google/api/gax/rpc/ErrorDetails.java @@ -126,6 +126,15 @@ public LocalizedMessage getLocalizedMessage() { return unpack(LocalizedMessage.class); } + /** + * Attempt to unpack a non-default error message type {@code T}. The first occurrence of a {@code + * T} is returned, null otherwise. + */ + @Nullable + public T getMessage(Class messageClass) { + return unpack(messageClass); + } + /** This is a list of raw/unparsed error messages that returns from server. */ @Nullable abstract List getRawErrorMessages(); diff --git a/gax-java/gax/src/main/java/com/google/api/gax/rpc/FailedPreconditionException.java b/gax-java/gax/src/main/java/com/google/api/gax/rpc/FailedPreconditionException.java index e1b3ec75e9..56655d3a24 100644 --- a/gax-java/gax/src/main/java/com/google/api/gax/rpc/FailedPreconditionException.java +++ b/gax-java/gax/src/main/java/com/google/api/gax/rpc/FailedPreconditionException.java @@ -48,4 +48,13 @@ public FailedPreconditionException( Throwable cause, StatusCode statusCode, boolean retryable, ErrorDetails errorDetails) { super(cause, statusCode, retryable, errorDetails); } + + public FailedPreconditionException( + String message, + Throwable cause, + StatusCode statusCode, + boolean retryable, + ErrorDetails errorDetails) { + super(message, cause, statusCode, retryable, errorDetails); + } } diff --git a/gax-java/gax/src/main/java/com/google/api/gax/rpc/FixedTransportChannelProvider.java b/gax-java/gax/src/main/java/com/google/api/gax/rpc/FixedTransportChannelProvider.java index 0bf6205dd9..daa1019105 100644 --- a/gax-java/gax/src/main/java/com/google/api/gax/rpc/FixedTransportChannelProvider.java +++ b/gax-java/gax/src/main/java/com/google/api/gax/rpc/FixedTransportChannelProvider.java @@ -89,14 +89,18 @@ public TransportChannelProvider withEndpoint(String endpoint) { "FixedTransportChannelProvider doesn't need an endpoint"); } - /** @deprecated FixedTransportChannelProvider doesn't support ChannelPool configuration */ + /** + * @deprecated FixedTransportChannelProvider doesn't support ChannelPool configuration + */ @Deprecated @Override public boolean acceptsPoolSize() { return false; } - /** @deprecated FixedTransportChannelProvider doesn't support ChannelPool configuration */ + /** + * @deprecated FixedTransportChannelProvider doesn't support ChannelPool configuration + */ @Deprecated @Override public TransportChannelProvider withPoolSize(int size) { diff --git a/gax-java/gax/src/main/java/com/google/api/gax/rpc/FixedWatchdogProvider.java b/gax-java/gax/src/main/java/com/google/api/gax/rpc/FixedWatchdogProvider.java index a1fd245b5f..170e820c03 100644 --- a/gax-java/gax/src/main/java/com/google/api/gax/rpc/FixedWatchdogProvider.java +++ b/gax-java/gax/src/main/java/com/google/api/gax/rpc/FixedWatchdogProvider.java @@ -31,10 +31,11 @@ import com.google.api.core.ApiClock; import com.google.api.core.InternalApi; +import com.google.api.core.ObsoleteApi; +import java.time.Duration; import java.util.concurrent.ScheduledExecutorService; import javax.annotation.Nonnull; import javax.annotation.Nullable; -import org.threeten.bp.Duration; /** * A watchdog provider which always returns the same watchdog instance provided to the provider @@ -70,8 +71,15 @@ public boolean needsCheckInterval() { return false; } + /** This method is obsolete. Use {@link #withCheckIntervalDuration(Duration)} instead. */ @Override - public WatchdogProvider withCheckInterval(Duration checkInterval) { + @ObsoleteApi("Use withCheckIntervalDuration(java.time.Duration) instead") + public WatchdogProvider withCheckInterval(org.threeten.bp.Duration checkInterval) { + throw new UnsupportedOperationException("FixedWatchdogProvider doesn't need a checkInterval"); + } + + @Override + public WatchdogProvider withCheckIntervalDuration(java.time.Duration checkInterval) { throw new UnsupportedOperationException("FixedWatchdogProvider doesn't need a checkInterval"); } diff --git a/gax-java/gax/src/main/java/com/google/api/gax/rpc/InstantiatingWatchdogProvider.java b/gax-java/gax/src/main/java/com/google/api/gax/rpc/InstantiatingWatchdogProvider.java index a069c49c84..5b06f882a3 100644 --- a/gax-java/gax/src/main/java/com/google/api/gax/rpc/InstantiatingWatchdogProvider.java +++ b/gax-java/gax/src/main/java/com/google/api/gax/rpc/InstantiatingWatchdogProvider.java @@ -29,13 +29,15 @@ */ package com.google.api.gax.rpc; +import static com.google.api.gax.util.TimeConversionUtils.toJavaTimeDuration; + import com.google.api.core.ApiClock; import com.google.api.core.InternalApi; +import com.google.api.core.ObsoleteApi; import com.google.common.base.Preconditions; import java.util.concurrent.ScheduledExecutorService; import javax.annotation.Nonnull; import javax.annotation.Nullable; -import org.threeten.bp.Duration; /** * A watchdog provider which instantiates a new provider on every request. @@ -47,7 +49,7 @@ public final class InstantiatingWatchdogProvider implements WatchdogProvider { @Nullable private final ApiClock clock; @Nullable private final ScheduledExecutorService executor; - @Nullable private final Duration checkInterval; + @Nullable private final java.time.Duration checkInterval; public static WatchdogProvider create() { return new InstantiatingWatchdogProvider(null, null, null); @@ -56,7 +58,7 @@ public static WatchdogProvider create() { private InstantiatingWatchdogProvider( @Nullable ApiClock clock, @Nullable ScheduledExecutorService executor, - @Nullable Duration checkInterval) { + @Nullable java.time.Duration checkInterval) { this.clock = clock; this.executor = executor; this.checkInterval = checkInterval; @@ -78,8 +80,17 @@ public boolean needsCheckInterval() { return checkInterval == null; } + /** + * This method is obsolete. Use {@link #withCheckIntervalDuration(java.time.Duration)} instead. + */ + @Override + @ObsoleteApi("Use withCheckIntervalDuration(java.time.Duration) instead") + public WatchdogProvider withCheckInterval(@Nonnull org.threeten.bp.Duration checkInterval) { + return withCheckIntervalDuration(toJavaTimeDuration(checkInterval)); + } + @Override - public WatchdogProvider withCheckInterval(@Nonnull Duration checkInterval) { + public WatchdogProvider withCheckIntervalDuration(@Nonnull java.time.Duration checkInterval) { return new InstantiatingWatchdogProvider( clock, executor, Preconditions.checkNotNull(checkInterval)); } @@ -108,7 +119,7 @@ public Watchdog getWatchdog() { return null; } - return Watchdog.create(clock, checkInterval, executor); + return Watchdog.createDuration(clock, checkInterval, executor); } @Override diff --git a/gax-java/gax/src/main/java/com/google/api/gax/rpc/InternalException.java b/gax-java/gax/src/main/java/com/google/api/gax/rpc/InternalException.java index 3d5763f060..af2c9fa80e 100644 --- a/gax-java/gax/src/main/java/com/google/api/gax/rpc/InternalException.java +++ b/gax-java/gax/src/main/java/com/google/api/gax/rpc/InternalException.java @@ -47,4 +47,13 @@ public InternalException( Throwable cause, StatusCode statusCode, boolean retryable, ErrorDetails errorDetails) { super(cause, statusCode, retryable, errorDetails); } + + public InternalException( + String message, + Throwable cause, + StatusCode statusCode, + boolean retryable, + ErrorDetails errorDetails) { + super(message, cause, statusCode, retryable, errorDetails); + } } diff --git a/gax-java/gax/src/main/java/com/google/api/gax/rpc/InvalidArgumentException.java b/gax-java/gax/src/main/java/com/google/api/gax/rpc/InvalidArgumentException.java index 6b0ccc6f61..430640b976 100644 --- a/gax-java/gax/src/main/java/com/google/api/gax/rpc/InvalidArgumentException.java +++ b/gax-java/gax/src/main/java/com/google/api/gax/rpc/InvalidArgumentException.java @@ -48,4 +48,13 @@ public InvalidArgumentException( Throwable cause, StatusCode statusCode, boolean retryable, ErrorDetails errorDetails) { super(cause, statusCode, retryable, errorDetails); } + + public InvalidArgumentException( + String message, + Throwable cause, + StatusCode statusCode, + boolean retryable, + ErrorDetails errorDetails) { + super(message, cause, statusCode, retryable, errorDetails); + } } diff --git a/gax-java/gax/src/main/java/com/google/api/gax/rpc/LibraryMetadata.java b/gax-java/gax/src/main/java/com/google/api/gax/rpc/LibraryMetadata.java new file mode 100644 index 0000000000..eb8c48f5fe --- /dev/null +++ b/gax-java/gax/src/main/java/com/google/api/gax/rpc/LibraryMetadata.java @@ -0,0 +1,100 @@ +/* + * Copyright 2026 Google LLC + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Google LLC nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +package com.google.api.gax.rpc; + +import com.google.api.core.BetaApi; +import com.google.api.core.InternalApi; +import com.google.auto.value.AutoValue; +import javax.annotation.Nullable; + +/** + * A context object that contains information about the GAPIC library. + * + *

        For internal use only. + */ +@InternalApi +@BetaApi +@AutoValue +public abstract class LibraryMetadata { + + /** + * Returns the repository of the client library. + * + *

        Example: "googleapis/google-cloud-java". This maps to the {@code gcp.client.repo} attribute. + * + * @return the repository, or {@code null} if not set + */ + @Nullable + public abstract String repository(); + + /** + * Returns the artifact name of the client library. + * + *

        Example: "google-cloud-vision". This maps to the {@code gcp.client.artifact} attribute. + * + * @return the artifact name, or {@code null} if not set + */ + @Nullable + public abstract String artifactName(); + + /** + * Returns the version of the client library. + * + *

        Example: {@code "2.74.1"}. This maps to the {@code gcp.client.version} attribute. + * + * @return the version, or {@code null} if not set + */ + @Nullable + public abstract String version(); + + public static LibraryMetadata empty() { + return newBuilder().build(); + } + + public boolean isEmpty() { + return repository() == null && artifactName() == null && version() == null; + } + + public static LibraryMetadata.Builder newBuilder() { + return new AutoValue_LibraryMetadata.Builder(); + } + + @AutoValue.Builder + public abstract static class Builder { + public abstract Builder setRepository(@Nullable String repository); + + public abstract Builder setArtifactName(@Nullable String artifactName); + + public abstract Builder setVersion(@Nullable String libraryVersion); + + public abstract LibraryMetadata build(); + } +} diff --git a/gax-java/gax/src/main/java/com/google/api/gax/rpc/NotFoundException.java b/gax-java/gax/src/main/java/com/google/api/gax/rpc/NotFoundException.java index ce8b0b1d7e..86e86a32af 100644 --- a/gax-java/gax/src/main/java/com/google/api/gax/rpc/NotFoundException.java +++ b/gax-java/gax/src/main/java/com/google/api/gax/rpc/NotFoundException.java @@ -44,4 +44,13 @@ public NotFoundException( Throwable cause, StatusCode statusCode, boolean retryable, ErrorDetails errorDetails) { super(cause, statusCode, retryable, errorDetails); } + + public NotFoundException( + String message, + Throwable cause, + StatusCode statusCode, + boolean retryable, + ErrorDetails errorDetails) { + super(message, cause, statusCode, retryable, errorDetails); + } } diff --git a/gax-java/gax/src/main/java/com/google/api/gax/rpc/OutOfRangeException.java b/gax-java/gax/src/main/java/com/google/api/gax/rpc/OutOfRangeException.java index 33ecb38cab..10e68e12fb 100644 --- a/gax-java/gax/src/main/java/com/google/api/gax/rpc/OutOfRangeException.java +++ b/gax-java/gax/src/main/java/com/google/api/gax/rpc/OutOfRangeException.java @@ -47,4 +47,13 @@ public OutOfRangeException( Throwable cause, StatusCode statusCode, boolean retryable, ErrorDetails errorDetails) { super(cause, statusCode, retryable, errorDetails); } + + public OutOfRangeException( + String message, + Throwable cause, + StatusCode statusCode, + boolean retryable, + ErrorDetails errorDetails) { + super(message, cause, statusCode, retryable, errorDetails); + } } diff --git a/gax-java/gax/src/main/java/com/google/api/gax/rpc/PermissionDeniedException.java b/gax-java/gax/src/main/java/com/google/api/gax/rpc/PermissionDeniedException.java index c9e7515976..14e92d9d4f 100644 --- a/gax-java/gax/src/main/java/com/google/api/gax/rpc/PermissionDeniedException.java +++ b/gax-java/gax/src/main/java/com/google/api/gax/rpc/PermissionDeniedException.java @@ -44,4 +44,13 @@ public PermissionDeniedException( Throwable cause, StatusCode statusCode, boolean retryable, ErrorDetails errorDetails) { super(cause, statusCode, retryable, errorDetails); } + + public PermissionDeniedException( + String message, + Throwable cause, + StatusCode statusCode, + boolean retryable, + ErrorDetails errorDetails) { + super(message, cause, statusCode, retryable, errorDetails); + } } diff --git a/gax-java/gax/src/main/java/com/google/api/gax/rpc/RequestMutator.java b/gax-java/gax/src/main/java/com/google/api/gax/rpc/RequestMutator.java new file mode 100644 index 0000000000..d26949d87d --- /dev/null +++ b/gax-java/gax/src/main/java/com/google/api/gax/rpc/RequestMutator.java @@ -0,0 +1,52 @@ +/* + * Copyright 2024 Google LLC + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Google LLC nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +package com.google.api.gax.rpc; + +import com.google.api.core.InternalApi; + +/** + * A request mutator takes a {@code request} message, applies some Function to it, and then returns + * the modified {@code request} message. This is currently only used for autopopulation of the + * request ID. + * + *

        Implementations of this interface are expected to be autogenerated. + * + * @param request message type + */ +@InternalApi("For use by transport-specific implementations") +@FunctionalInterface +public interface RequestMutator { + /** + * Applies a Function to {@code request} message + * + * @param request request message + */ + RequestT apply(RequestT request); +} diff --git a/gax-java/gax/src/main/java/com/google/api/gax/rpc/RequestParamsBuilder.java b/gax-java/gax/src/main/java/com/google/api/gax/rpc/RequestParamsBuilder.java index 4f234f0ce3..9e3914309c 100644 --- a/gax-java/gax/src/main/java/com/google/api/gax/rpc/RequestParamsBuilder.java +++ b/gax-java/gax/src/main/java/com/google/api/gax/rpc/RequestParamsBuilder.java @@ -40,7 +40,6 @@ */ @BetaApi public class RequestParamsBuilder { - private final ImmutableMap.Builder paramsBuilder; private RequestParamsBuilder() { @@ -63,7 +62,7 @@ public static RequestParamsBuilder create() { * @param pathTemplate {@link PathTemplate} the path template used for match-and-extract */ public void add(String fieldValue, String headerKey, PathTemplate pathTemplate) { - if (fieldValue == null) { + if (checkInvalidHeaderValues(headerKey, fieldValue)) { return; } Map matchedValues = pathTemplate.match(fieldValue); @@ -72,6 +71,25 @@ public void add(String fieldValue, String headerKey, PathTemplate pathTemplate) } } + /** + * Add an entry to paramsBuilder with key-value pairing of (headerKey, fieldValue). The only + * validation done is to ensure the headerKey and fieldValue are not null and non-empty. This + * method is used for implicit routing headers (backwards compatibility). + * + * @param headerKey the header key for the routing header param + * @param fieldValue the field value from a request + */ + public void add(String headerKey, String fieldValue) { + if (checkInvalidHeaderValues(headerKey, fieldValue)) { + return; + } + paramsBuilder.put(headerKey, fieldValue); + } + + private boolean checkInvalidHeaderValues(String headerKey, String fieldValue) { + return headerKey == null || headerKey.isEmpty() || fieldValue == null || fieldValue.isEmpty(); + } + public Map build() { return paramsBuilder.buildKeepingLast(); } diff --git a/gax-java/gax/src/main/java/com/google/api/gax/rpc/RequestUrlParamsEncoder.java b/gax-java/gax/src/main/java/com/google/api/gax/rpc/RequestUrlParamsEncoder.java index 6bb1da2509..58762f6c74 100644 --- a/gax-java/gax/src/main/java/com/google/api/gax/rpc/RequestUrlParamsEncoder.java +++ b/gax-java/gax/src/main/java/com/google/api/gax/rpc/RequestUrlParamsEncoder.java @@ -31,46 +31,41 @@ import static com.google.common.base.Preconditions.checkNotNull; +import com.google.api.client.util.escape.PercentEscaper; import com.google.api.core.InternalApi; -import java.io.UnsupportedEncodingException; -import java.net.URLDecoder; -import java.net.URLEncoder; +import com.google.common.annotations.VisibleForTesting; import java.util.Map; /** * The request params encoder, which encodes URL-encoded parameters in one URL parameters string. - * This class expects that name-value pairs, returned from parameters extractor are already - * URL-encoded and can perform optional validation of that, but does not encode the name-value pairs - * themselves. * * @param request message type */ @InternalApi("For use by transport-specific implementations") public class RequestUrlParamsEncoder implements RequestParamsEncoder { - private static final String STR_ENCODING = "UTF-8"; - + // Per RFC 3986 Section 2.3, these are the four unreserved characters that don't need to be + // encoded + private static final PercentEscaper PERCENT_ESCAPER = new PercentEscaper("._-~"); private final RequestParamsExtractor paramsExtractor; - private final boolean validateExtractedParameters; /** * Creates the encoder. * * @param paramsExtractor parameters extractor which returns already URL-encoded key-value pairs - * @param validateExtractedParameters {@code true} if this class should validate that the - * extracted parameters are URL-encoded, {@code false} otherwise */ - public RequestUrlParamsEncoder( - RequestParamsExtractor paramsExtractor, boolean validateExtractedParameters) { + public RequestUrlParamsEncoder(RequestParamsExtractor paramsExtractor) { this.paramsExtractor = checkNotNull(paramsExtractor); - this.validateExtractedParameters = validateExtractedParameters; } /** * Encodes the {@code request} in a form of a URL parameters string, for example {@code * "param1=value+1¶m2=value2%26"}. This method may optionally validate that the name-value - * paris are URL-encoded, but it will not perform the actual encoding of them (it will only - * concatenate the valid individual name-value pairs in a valid URL parameters string). This is - * so, because in most practical cases the name-value paris are already URL-encoded. + * paris are URL-encoded. It will URL encode the key and values if there are any non-allowed + * characters. It will then concatenate the valid individual name-value pairs in a valid URL + * parameters string. + * + *

        Note: This will url-encode the key and values during concatenation. Double url-encoding may + * occur if the input has values that are already url-encoded. * * @param request request message * @throws IllegalArgumentException if is not @@ -86,37 +81,18 @@ public String encode(RequestT request) { if (sb.length() > 0) { sb.append("&"); } - String name = entry.getKey(); - String value = entry.getValue(); - if (name == null) { - throw new IllegalArgumentException("Request parameter name cannot be null"); - } - - // Let the server decide if the value is required. - // Empty value is allowed. - if (value != null) { - if (!isValid(name, value)) { - throw new IllegalArgumentException( - "Invalid url-encoded request parameter name-value pair: " + name + "=" + value); - } - sb.append(name).append("=").append(value); - } + // RequestParamsExtractor checks that the values are non-null and non-empty + String encodedKey = percentEncodeString(entry.getKey()); + String encodedValue = percentEncodeString(entry.getValue()); + sb.append(encodedKey).append("=").append(encodedValue); } return sb.toString(); } - // Not sure if we need this at all. - private boolean isValid(String name, String value) { - try { - // hoping that encode/decode do not lose information in the middle - // (at least for practical use cases) - return !validateExtractedParameters - || name.equals(URLEncoder.encode(URLDecoder.decode(name, STR_ENCODING), STR_ENCODING)) - && value.equals( - URLEncoder.encode(URLDecoder.decode(value, STR_ENCODING), STR_ENCODING)); - } catch (UnsupportedEncodingException e) { - return false; - } + // Percent encode the value passed in. + @VisibleForTesting + String percentEncodeString(String value) { + return PERCENT_ESCAPER.escape(value); } } diff --git a/gax-java/gax/src/main/java/com/google/api/gax/rpc/ResourceExhaustedException.java b/gax-java/gax/src/main/java/com/google/api/gax/rpc/ResourceExhaustedException.java index 2561c54ce7..069100bb0d 100644 --- a/gax-java/gax/src/main/java/com/google/api/gax/rpc/ResourceExhaustedException.java +++ b/gax-java/gax/src/main/java/com/google/api/gax/rpc/ResourceExhaustedException.java @@ -47,4 +47,13 @@ public ResourceExhaustedException( Throwable cause, StatusCode statusCode, boolean retryable, ErrorDetails errorDetails) { super(cause, statusCode, retryable, errorDetails); } + + public ResourceExhaustedException( + String message, + Throwable cause, + StatusCode statusCode, + boolean retryable, + ErrorDetails errorDetails) { + super(message, cause, statusCode, retryable, errorDetails); + } } diff --git a/gax-java/gax/src/main/java/com/google/api/gax/rpc/ResourceNameExtractor.java b/gax-java/gax/src/main/java/com/google/api/gax/rpc/ResourceNameExtractor.java new file mode 100644 index 0000000000..328d1c4174 --- /dev/null +++ b/gax-java/gax/src/main/java/com/google/api/gax/rpc/ResourceNameExtractor.java @@ -0,0 +1,54 @@ +/* + * Copyright 2026 Google LLC + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Google LLC nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +package com.google.api.gax.rpc; + +import com.google.api.core.InternalApi; +import com.google.api.gax.tracing.ObservabilityAttributes; + +/** + * A resource name extractor takes a request message and extracts the resource name from it. This + * value is used primarily for tracing. It is added to spans as an attribute, labeled as + * gcp.resource.destination.id (See {@link + * ObservabilityAttributes#DESTINATION_RESOURCE_ID_ATTRIBUTE}). + * + *

        Implementations of this interface are expected to be autogenerated. + * + * @param request message type + */ +@InternalApi("For use by transport-specific implementations") +public interface ResourceNameExtractor { + /** + * Extracts the resource name from the {@code request}. + * + * @param request request message + * @return the resource name extracted from the request + */ + String extract(RequestT request); +} diff --git a/gax-java/gax/src/main/java/com/google/api/gax/rpc/RetryingCallable.java b/gax-java/gax/src/main/java/com/google/api/gax/rpc/RetryingCallable.java index 0a92794a20..e4fe13295a 100644 --- a/gax-java/gax/src/main/java/com/google/api/gax/rpc/RetryingCallable.java +++ b/gax-java/gax/src/main/java/com/google/api/gax/rpc/RetryingCallable.java @@ -43,20 +43,35 @@ class RetryingCallable extends UnaryCallable callable; private final RetryingExecutorWithContext executor; + private final RequestMutator requestMutator; + RetryingCallable( ApiCallContext callContextPrototype, UnaryCallable callable, RetryingExecutorWithContext executor) { + this(callContextPrototype, callable, executor, null); + } + + RetryingCallable( + ApiCallContext callContextPrototype, + UnaryCallable callable, + RetryingExecutorWithContext executor, + RequestMutator requestMutator) { this.callContextPrototype = Preconditions.checkNotNull(callContextPrototype); this.callable = Preconditions.checkNotNull(callable); this.executor = Preconditions.checkNotNull(executor); + this.requestMutator = requestMutator; } @Override public RetryingFuture futureCall(RequestT request, ApiCallContext inputContext) { ApiCallContext context = callContextPrototype.nullToSelf(inputContext); + RequestT modifiedRequest = request; + if (this.requestMutator != null) { + modifiedRequest = requestMutator.apply(request); + } AttemptCallable retryCallable = - new AttemptCallable<>(callable, request, context); + new AttemptCallable<>(callable, modifiedRequest, context); RetryingFuture retryingFuture = executor.createFuture(retryCallable, inputContext); retryCallable.setExternalFuture(retryingFuture); diff --git a/gax-java/gax/src/main/java/com/google/api/gax/rpc/ServerStream.java b/gax-java/gax/src/main/java/com/google/api/gax/rpc/ServerStream.java index 518c68523c..d1f9848631 100644 --- a/gax-java/gax/src/main/java/com/google/api/gax/rpc/ServerStream.java +++ b/gax-java/gax/src/main/java/com/google/api/gax/rpc/ServerStream.java @@ -31,6 +31,8 @@ import com.google.api.core.InternalApi; import java.util.Iterator; +import java.util.stream.Stream; +import java.util.stream.StreamSupport; import javax.annotation.Nonnull; /** @@ -89,6 +91,15 @@ public Iterator iterator() { return iterator; } + /** + * Returns a sequential {@code Stream} with server responses as its source. + * + * @return a sequential {@code Stream} over the elements in server responses + */ + public Stream stream() { + return StreamSupport.stream(this.spliterator(), false); + } + /** * Returns true if the next call to the iterator's hasNext() or next() is guaranteed to be * nonblocking. diff --git a/gax-java/gax/src/main/java/com/google/api/gax/rpc/ServerStreamingAttemptCallable.java b/gax-java/gax/src/main/java/com/google/api/gax/rpc/ServerStreamingAttemptCallable.java index 0c71d12420..da0c8de632 100644 --- a/gax-java/gax/src/main/java/com/google/api/gax/rpc/ServerStreamingAttemptCallable.java +++ b/gax-java/gax/src/main/java/com/google/api/gax/rpc/ServerStreamingAttemptCallable.java @@ -34,10 +34,9 @@ import com.google.api.gax.retrying.ServerStreamingAttemptException; import com.google.api.gax.retrying.StreamResumptionStrategy; import com.google.common.base.Preconditions; +import com.google.errorprone.annotations.concurrent.GuardedBy; import java.util.concurrent.Callable; import java.util.concurrent.CancellationException; -import javax.annotation.concurrent.GuardedBy; -import org.threeten.bp.Duration; /** * A callable that generates Server Streaming attempts. At any one time, it is responsible for at @@ -181,15 +180,6 @@ public void cancel() { } isStarted = true; - // Propagate the totalTimeout as the overall stream deadline, so long as the user - // has not provided a timeout via the ApiCallContext. If they have, retain it. - Duration totalTimeout = - outerRetryingFuture.getAttemptSettings().getGlobalSettings().getTotalTimeout(); - - if (totalTimeout != null && context != null && context.getTimeout() == null) { - context = context.withTimeout(totalTimeout); - } - // Call the inner callable call(); } @@ -218,13 +208,11 @@ public Void call() { ApiCallContext attemptContext = context; - // Set the streamWaitTimeout to the attempt RPC Timeout, only if the context - // does not already have a timeout set by a user via withStreamWaitTimeout. - if (!outerRetryingFuture.getAttemptSettings().getRpcTimeout().isZero() - && attemptContext.getStreamWaitTimeout() == null) { + if (!outerRetryingFuture.getAttemptSettings().getRpcTimeoutDuration().isZero() + && attemptContext.getTimeoutDuration() == null) { attemptContext = - attemptContext.withStreamWaitTimeout( - outerRetryingFuture.getAttemptSettings().getRpcTimeout()); + attemptContext.withTimeoutDuration( + outerRetryingFuture.getAttemptSettings().getRpcTimeoutDuration()); } attemptContext diff --git a/gax-java/gax/src/main/java/com/google/api/gax/rpc/ServerStreamingCallSettings.java b/gax-java/gax/src/main/java/com/google/api/gax/rpc/ServerStreamingCallSettings.java index eb9373e0c3..cbba46485f 100644 --- a/gax-java/gax/src/main/java/com/google/api/gax/rpc/ServerStreamingCallSettings.java +++ b/gax-java/gax/src/main/java/com/google/api/gax/rpc/ServerStreamingCallSettings.java @@ -29,6 +29,10 @@ */ package com.google.api.gax.rpc; +import static com.google.api.gax.util.TimeConversionUtils.toJavaTimeDuration; +import static com.google.api.gax.util.TimeConversionUtils.toThreetenDuration; + +import com.google.api.core.ObsoleteApi; import com.google.api.gax.retrying.RetrySettings; import com.google.api.gax.retrying.SimpleStreamResumptionStrategy; import com.google.api.gax.retrying.StreamResumptionStrategy; @@ -37,9 +41,9 @@ import com.google.common.base.Preconditions; import com.google.common.collect.ImmutableSet; import com.google.common.collect.Sets; +import java.time.Duration; import java.util.Set; import javax.annotation.Nonnull; -import org.threeten.bp.Duration; /** * A settings class to configure a {@link ServerStreamingCallable}. @@ -47,9 +51,11 @@ *

        This class includes settings that are applicable to all server streaming calls, which * currently just includes retries and watchdog timers. * - *

        The watchdog timer is configured via {@code idleTimeout}. The watchdog will terminate any - * stream that has not has seen any demand (via {@link StreamController#request(int)}) in the - * configured interval. To turn off idle checks, set the interval to {@link Duration#ZERO}. + *

        The watchdog timer is configured via {@code idleTimeout} and {@code waitTimeout}. The watchdog + * will terminate any stream that has not has seen any demand (via {@link + * StreamController#request(int)}) in the configured interval or has not seen a message from the + * server in {@code waitTimeout}. To turn off idle checks, set the interval to {@link + * java.time.Duration#ZERO}. * *

        Retry configuration allows for the stream to be restarted and resumed. It is composed of 3 * parts: the retryable codes, the retry settings and the stream resumption strategy. The retryable @@ -65,7 +71,7 @@ *

      • RPC timeouts apply to the time interval between caller demanding more responses via {@link * StreamController#request(int)} and the {@link ResponseObserver} receiving the message. *
      • RPC timeouts are best effort and are checked once every {@link - * StubSettings#getStreamWatchdogCheckInterval()}. + * StubSettings#getStreamWatchdogCheckIntervalDuration()}. *
      • Attempt counts are reset as soon as a response is received. This means that max attempts is * the maximum number of failures in a row. *
      • totalTimeout still applies to the entire stream. @@ -78,13 +84,15 @@ public final class ServerStreamingCallSettings @Nonnull private final RetrySettings retrySettings; @Nonnull private final StreamResumptionStrategy resumptionStrategy; - @Nonnull private final Duration idleTimeout; + @Nonnull private final java.time.Duration idleTimeout; + @Nonnull private final java.time.Duration waitTimeout; private ServerStreamingCallSettings(Builder builder) { this.retryableCodes = ImmutableSet.copyOf(builder.retryableCodes); this.retrySettings = builder.retrySettingsBuilder.build(); this.resumptionStrategy = builder.resumptionStrategy; this.idleTimeout = builder.idleTimeout; + this.waitTimeout = builder.waitTimeout; } /** @@ -114,15 +122,38 @@ public StreamResumptionStrategy getResumptionStrategy() { return resumptionStrategy; } + /** This method is obsolete. Use {@link #getIdleTimeoutDuration()} instead. */ + @Nonnull + @ObsoleteApi("Use getIdleTimeoutDuration() instead") + public org.threeten.bp.Duration getIdleTimeout() { + return toThreetenDuration(getIdleTimeoutDuration()); + } + /** * See the class documentation of {@link ServerStreamingCallSettings} for a description of what * the {@link #idleTimeout} does. */ @Nonnull - public Duration getIdleTimeout() { + public java.time.Duration getIdleTimeoutDuration() { return idleTimeout; } + /** This method is obsolete. Use {@link #getWaitTimeoutDuration()} instead. */ + @Nonnull + @ObsoleteApi("Use getWaitTimeoutDuration() instead") + public org.threeten.bp.Duration getWaitTimeout() { + return toThreetenDuration(getWaitTimeoutDuration()); + } + + /** + * See the class documentation of {@link ServerStreamingCallSettings} for a description of what + * the {@link #waitTimeout} does. + */ + @Nonnull + public java.time.Duration getWaitTimeoutDuration() { + return waitTimeout; + } + public Builder toBuilder() { return new Builder<>(this); } @@ -135,6 +166,7 @@ public static Builder newBuilder() { public String toString() { return MoreObjects.toStringHelper(this) .add("idleTimeout", idleTimeout) + .add("waitTimeout", waitTimeout) .add("retryableCodes", retryableCodes) .add("retrySettings", retrySettings) .toString(); @@ -146,7 +178,9 @@ public static class Builder @Nonnull private RetrySettings.Builder retrySettingsBuilder; @Nonnull private StreamResumptionStrategy resumptionStrategy; - @Nonnull private Duration idleTimeout; + @Nonnull private java.time.Duration idleTimeout; + + @Nonnull private java.time.Duration waitTimeout; /** Initialize the builder with default settings */ private Builder() { @@ -154,7 +188,8 @@ private Builder() { this.retrySettingsBuilder = RetrySettings.newBuilder(); this.resumptionStrategy = new SimpleStreamResumptionStrategy<>(); - this.idleTimeout = Duration.ZERO; + this.idleTimeout = java.time.Duration.ZERO; + this.waitTimeout = java.time.Duration.ZERO; } private Builder(ServerStreamingCallSettings settings) { @@ -164,6 +199,7 @@ private Builder(ServerStreamingCallSettings settings) { this.resumptionStrategy = settings.resumptionStrategy; this.idleTimeout = settings.idleTimeout; + this.waitTimeout = settings.waitTimeout; } /** @@ -224,18 +260,29 @@ public RetrySettings getRetrySettings() { return retrySettingsBuilder.build(); } + /** + * This method is obsolete. Use {@link #setSimpleTimeoutNoRetriesDuration(java.time.Duration)} + * instead. + */ + @ObsoleteApi("Use setSimpleTimeoutNoRetriesDuration(java.time.Duration) instead") + public Builder setSimpleTimeoutNoRetries( + @Nonnull org.threeten.bp.Duration timeout) { + return setSimpleTimeoutNoRetriesDuration(toJavaTimeDuration(timeout)); + } + /** Disables retries and sets the overall timeout. */ - public Builder setSimpleTimeoutNoRetries(@Nonnull Duration timeout) { + public Builder setSimpleTimeoutNoRetriesDuration( + @Nonnull java.time.Duration timeout) { setRetryableCodes(); setRetrySettings( RetrySettings.newBuilder() - .setTotalTimeout(timeout) - .setInitialRetryDelay(Duration.ZERO) + .setTotalTimeoutDuration(timeout) + .setInitialRetryDelayDuration(java.time.Duration.ZERO) .setRetryDelayMultiplier(1) - .setMaxRetryDelay(Duration.ZERO) - .setInitialRpcTimeout(Duration.ZERO) + .setMaxRetryDelayDuration(java.time.Duration.ZERO) + .setInitialRpcTimeoutDuration(timeout) .setRpcTimeoutMultiplier(1) - .setMaxRpcTimeout(Duration.ZERO) + .setMaxRpcTimeoutDuration(timeout) .setMaxAttempts(1) .build()); @@ -258,20 +305,64 @@ public StreamResumptionStrategy getResumptionStrategy() { return resumptionStrategy; } + /** This method is obsolete. Use {@link #getIdleTimeoutDuration()} instead. */ @Nonnull - public Duration getIdleTimeout() { + @ObsoleteApi("Use getIdleTimeoutDuration() instead") + public org.threeten.bp.Duration getIdleTimeout() { + return toThreetenDuration(getIdleTimeoutDuration()); + } + + @Nonnull + public java.time.Duration getIdleTimeoutDuration() { return idleTimeout; } + /** This method is obsolete. Use {@link #setIdleTimeoutDuration(Duration)} instead. */ + @ObsoleteApi("Use setIdleTimeoutDuration(java.time.Duration) instead") + public Builder setIdleTimeout( + @Nonnull org.threeten.bp.Duration idleTimeout) { + return setIdleTimeoutDuration(toJavaTimeDuration(idleTimeout)); + } + /** - * See the class documentation of {@link ServerStreamingCallSettings} for a description of what - * the {@link #idleTimeout} does. {@link Duration#ZERO} disables the watchdog. + * Set how long to wait before considering the stream orphaned by the user and closing it. + * {@link java.time.Duration#ZERO} disables the check for abandoned streams. */ - public Builder setIdleTimeout(@Nonnull Duration idleTimeout) { + public Builder setIdleTimeoutDuration( + @Nonnull java.time.Duration idleTimeout) { this.idleTimeout = Preconditions.checkNotNull(idleTimeout); return this; } + /** This method is obsolete. Use {@link #getWaitTimeoutDuration()} instead. */ + @Nonnull + @ObsoleteApi("Use getWaitTimeoutDuration() instead") + public org.threeten.bp.Duration getWaitTimeout() { + return toThreetenDuration(getWaitTimeoutDuration()); + } + + @Nonnull + public java.time.Duration getWaitTimeoutDuration() { + return waitTimeout; + } + + /** This method is obsolete. Use {@link #setWaitTimeoutDuration(java.time.Duration)} instead. */ + @ObsoleteApi("Use setWaitTimeoutDuration(java.time.Duration) instead") + public Builder setWaitTimeout( + @Nonnull org.threeten.bp.Duration waitTimeout) { + return setWaitTimeoutDuration(toJavaTimeDuration(waitTimeout)); + } + + /** + * Set the maximum amount of time to wait for the next message from the server. {@link + * java.time.Duration#ZERO} disables the check for abandoned streams. + */ + public Builder setWaitTimeoutDuration( + @Nonnull java.time.Duration waitTimeout) { + this.waitTimeout = waitTimeout; + return this; + } + @Override public ServerStreamingCallSettings build() { return new ServerStreamingCallSettings<>(this); diff --git a/gax-java/gax/src/main/java/com/google/api/gax/rpc/StateCheckingResponseObserver.java b/gax-java/gax/src/main/java/com/google/api/gax/rpc/StateCheckingResponseObserver.java index d787f434dc..46e76bd05d 100644 --- a/gax-java/gax/src/main/java/com/google/api/gax/rpc/StateCheckingResponseObserver.java +++ b/gax-java/gax/src/main/java/com/google/api/gax/rpc/StateCheckingResponseObserver.java @@ -43,7 +43,7 @@ public abstract class StateCheckingResponseObserver implements ResponseObserv * ensuring consistent state. */ public final void onStart(StreamController controller) { - Preconditions.checkState(!isStarted, getClass() + " is already started."); + Preconditions.checkState(!isStarted, "%s is already started.", getClass()); isStarted = true; onStartImpl(controller); @@ -56,7 +56,7 @@ public final void onStart(StreamController controller) { * consistent state. */ public final void onResponse(V response) { - Preconditions.checkState(!isClosed, getClass() + " received a response after being closed."); + Preconditions.checkState(!isClosed, "%s received a response after being closed.", getClass()); onResponseImpl(response); } @@ -67,7 +67,7 @@ public final void onResponse(V response) { * state. */ public final void onComplete() { - Preconditions.checkState(!isClosed, getClass() + " tried to double close."); + Preconditions.checkState(!isClosed, "%s tried to double close.", getClass()); isClosed = true; onCompleteImpl(); } @@ -79,20 +79,28 @@ public final void onComplete() { * consistent state. */ public final void onError(Throwable t) { - Preconditions.checkState(!isClosed, getClass() + " received error after being closed", t); + Preconditions.checkState(!isClosed, "%s received error after being closed", t, getClass()); isClosed = true; onErrorImpl(t); } - /** @see #onStart(StreamController) */ + /** + * @see #onStart(StreamController) + */ protected abstract void onStartImpl(StreamController controller); - /** @see #onResponse(Object) */ + /** + * @see #onResponse(Object) + */ protected abstract void onResponseImpl(V response); - /** @see #onErrorImpl(Throwable) */ + /** + * @see #onErrorImpl(Throwable) + */ protected abstract void onErrorImpl(Throwable t); - /** @see #onComplete() */ + /** + * @see #onComplete() + */ protected abstract void onCompleteImpl(); } diff --git a/gax-java/gax/src/main/java/com/google/api/gax/rpc/StubSettings.java b/gax-java/gax/src/main/java/com/google/api/gax/rpc/StubSettings.java index 877b03e29f..4b2444bb47 100644 --- a/gax-java/gax/src/main/java/com/google/api/gax/rpc/StubSettings.java +++ b/gax-java/gax/src/main/java/com/google/api/gax/rpc/StubSettings.java @@ -29,10 +29,15 @@ */ package com.google.api.gax.rpc; +import static com.google.api.gax.util.TimeConversionUtils.toJavaTimeDuration; +import static com.google.api.gax.util.TimeConversionUtils.toThreetenDuration; + import com.google.api.core.ApiClock; import com.google.api.core.ApiFunction; import com.google.api.core.BetaApi; +import com.google.api.core.InternalApi; import com.google.api.core.NanoClock; +import com.google.api.core.ObsoleteApi; import com.google.api.gax.core.CredentialsProvider; import com.google.api.gax.core.ExecutorProvider; import com.google.api.gax.core.FixedCredentialsProvider; @@ -48,7 +53,6 @@ import java.util.concurrent.Executor; import javax.annotation.Nonnull; import javax.annotation.Nullable; -import org.threeten.bp.Duration; /** * A base settings class to configure a client stub class. @@ -70,14 +74,15 @@ public abstract class StubSettings> { private final HeaderProvider internalHeaderProvider; private final TransportChannelProvider transportChannelProvider; private final ApiClock clock; - private final String endpoint; - private final String mtlsEndpoint; private final String quotaProjectId; + @Nullable private final String gdchApiAudience; @Nullable private final WatchdogProvider streamWatchdogProvider; - @Nonnull private final Duration streamWatchdogCheckInterval; + @Nonnull private final java.time.Duration streamWatchdogCheckInterval; @Nonnull private final ApiTracerFactory tracerFactory; // Track if deprecated setExecutorProvider is called private boolean deprecatedExecutorProviderSet; + @Nonnull private final EndpointContext endpointContext; + private final String apiKey; /** * Indicate when creating transport whether it is allowed to use mTLS endpoint instead of the @@ -95,17 +100,41 @@ protected StubSettings(Builder builder) { this.headerProvider = builder.headerProvider; this.internalHeaderProvider = builder.internalHeaderProvider; this.clock = builder.clock; - this.endpoint = builder.endpoint; - this.mtlsEndpoint = builder.mtlsEndpoint; this.switchToMtlsEndpointAllowed = builder.switchToMtlsEndpointAllowed; this.quotaProjectId = builder.quotaProjectId; this.streamWatchdogProvider = builder.streamWatchdogProvider; this.streamWatchdogCheckInterval = builder.streamWatchdogCheckInterval; this.tracerFactory = builder.tracerFactory; this.deprecatedExecutorProviderSet = builder.deprecatedExecutorProviderSet; + this.gdchApiAudience = builder.gdchApiAudience; + this.endpointContext = buildEndpointContext(builder); + this.apiKey = builder.apiKey; } - /** @deprecated Please use {@link #getBackgroundExecutorProvider()}. */ + /** + * Attempt to build the EndpointContext from the Builder based on all the user configurations + * passed in. + * + * @throws RuntimeException if there is an issue building the EndpointContext + */ + private EndpointContext buildEndpointContext(Builder builder) { + try { + return EndpointContext.newBuilder() + .setServiceName(getServiceName()) + .setClientSettingsEndpoint(builder.clientSettingsEndpoint) + .setTransportChannelProviderEndpoint(builder.transportChannelProviderEndpoint) + .setMtlsEndpoint(builder.mtlsEndpoint) + .setSwitchToMtlsEndpointAllowed(builder.switchToMtlsEndpointAllowed) + .setUniverseDomain(builder.universeDomain) + .build(); + } catch (IOException e) { + throw new RuntimeException(e); + } + } + + /** + * @deprecated Please use {@link #getBackgroundExecutorProvider()}. + */ @Deprecated public final ExecutorProvider getExecutorProvider() { return deprecatedExecutorProviderSet ? backgroundExecutorProvider : null; @@ -135,12 +164,42 @@ public final ApiClock getClock() { return clock; } - public final String getEndpoint() { - return endpoint; + /** + * Marked with Internal Api and meant to overriden by the generated subclasses. This getter is + * used to set the serviceName to the EndpointContext. The value in generated StubSettings + * subclasses comes from the proto files. + * + *

        This should be effectively treated as an abstract method. + */ + @InternalApi + protected String getServiceName() { + return ""; + } + + /** + * @return the fully resolved universe domain used by the client + */ + public final String getUniverseDomain() { + return endpointContext.resolvedUniverseDomain(); + } + + /** + * @return the fully resolved endpoint used by the client + */ + public String getEndpoint() { + return endpointContext.resolvedEndpoint(); + } + + /** + * @return the newly created EndpointContext + */ + @InternalApi + final EndpointContext getEndpointContext() { + return endpointContext; } public final String getMtlsEndpoint() { - return mtlsEndpoint; + return endpointContext.mtlsEndpoint(); } /** Limit the visibility to this package only since only this package needs it. */ @@ -157,8 +216,15 @@ public final WatchdogProvider getStreamWatchdogProvider() { return streamWatchdogProvider; } + /** This method is obsolete. Use {@link #getStreamWatchdogCheckIntervalDuration()} instead. */ @Nonnull - public final Duration getStreamWatchdogCheckInterval() { + @ObsoleteApi("Use getStreamWatchdogCheckIntervalDuration() instead") + public final org.threeten.bp.Duration getStreamWatchdogCheckInterval() { + return toThreetenDuration(getStreamWatchdogCheckIntervalDuration()); + } + + @Nonnull + public final java.time.Duration getStreamWatchdogCheckIntervalDuration() { return streamWatchdogCheckInterval; } @@ -172,6 +238,27 @@ public ApiTracerFactory getTracerFactory() { return tracerFactory; } + /** Gets the GDCH API audience to be used with {@link com.google.auth.oauth2.GdchCredentials} */ + @Nullable + public final String getGdchApiAudience() { + return gdchApiAudience; + } + + /** Gets the API Key that should be used for authentication. */ + public final String getApiKey() { + return apiKey; + } + + /** + * Returns the {@link LibraryMetadata} for the client library. + * + *

        This should be effectively treated as an abstract method. + */ + @InternalApi + protected LibraryMetadata getLibraryMetadata() { + return LibraryMetadata.empty(); + } + @Override public String toString() { return MoreObjects.toStringHelper(this) @@ -181,13 +268,16 @@ public String toString() { .add("headerProvider", headerProvider) .add("internalHeaderProvider", internalHeaderProvider) .add("clock", clock) - .add("endpoint", endpoint) - .add("mtlsEndpoint", mtlsEndpoint) + .add("universeDomain", endpointContext.resolvedUniverseDomain()) + .add("endpoint", endpointContext.resolvedEndpoint()) + .add("mtlsEndpoint", endpointContext.mtlsEndpoint()) .add("switchToMtlsEndpointAllowed", switchToMtlsEndpointAllowed) .add("quotaProjectId", quotaProjectId) .add("streamWatchdogProvider", streamWatchdogProvider) .add("streamWatchdogCheckInterval", streamWatchdogCheckInterval) .add("tracerFactory", tracerFactory) + .add("gdchApiAudience", gdchApiAudience) + .add("apiKey", apiKey) .toString(); } @@ -202,13 +292,18 @@ public abstract static class Builder< private HeaderProvider internalHeaderProvider; private TransportChannelProvider transportChannelProvider; private ApiClock clock; - private String endpoint; + private String clientSettingsEndpoint; + private String transportChannelProviderEndpoint; private String mtlsEndpoint; private String quotaProjectId; + @Nullable private String gdchApiAudience; @Nullable private WatchdogProvider streamWatchdogProvider; - @Nonnull private Duration streamWatchdogCheckInterval; + @Nonnull private java.time.Duration streamWatchdogCheckInterval; @Nonnull private ApiTracerFactory tracerFactory; private boolean deprecatedExecutorProviderSet; + private String universeDomain; + private final EndpointContext endpointContext; + private String apiKey; /** * Indicate when creating transport whether it is allowed to use mTLS endpoint instead of the @@ -226,14 +321,27 @@ protected Builder(StubSettings settings) { this.headerProvider = settings.headerProvider; this.internalHeaderProvider = settings.internalHeaderProvider; this.clock = settings.clock; - this.endpoint = settings.endpoint; - this.mtlsEndpoint = settings.mtlsEndpoint; this.switchToMtlsEndpointAllowed = settings.switchToMtlsEndpointAllowed; this.quotaProjectId = settings.quotaProjectId; this.streamWatchdogProvider = settings.streamWatchdogProvider; this.streamWatchdogCheckInterval = settings.streamWatchdogCheckInterval; this.tracerFactory = settings.tracerFactory; this.deprecatedExecutorProviderSet = settings.deprecatedExecutorProviderSet; + this.gdchApiAudience = settings.gdchApiAudience; + this.apiKey = settings.apiKey; + + // The follow settings will be set to the original user configurations as the + // EndpointContext will be rebuilt in the constructor. + this.clientSettingsEndpoint = settings.getEndpointContext().clientSettingsEndpoint(); + this.transportChannelProviderEndpoint = + settings.getEndpointContext().transportChannelProviderEndpoint(); + this.mtlsEndpoint = settings.getEndpointContext().mtlsEndpoint(); + this.switchToMtlsEndpointAllowed = + settings.getEndpointContext().switchToMtlsEndpointAllowed(); + this.universeDomain = settings.getEndpointContext().universeDomain(); + // Store the EndpointContext that was already created. This is used to return the state + // of the EndpointContext prior to any new modifications + this.endpointContext = settings.getEndpointContext(); } /** Get Quota Project ID from Client Context * */ @@ -261,13 +369,23 @@ protected Builder(ClientContext clientContext) { this.headerProvider = new NoHeaderProvider(); this.internalHeaderProvider = new NoHeaderProvider(); this.clock = NanoClock.getDefaultClock(); - this.endpoint = null; - this.mtlsEndpoint = null; this.quotaProjectId = null; this.streamWatchdogProvider = InstantiatingWatchdogProvider.create(); - this.streamWatchdogCheckInterval = Duration.ofSeconds(10); + this.streamWatchdogCheckInterval = java.time.Duration.ofSeconds(10); this.tracerFactory = BaseApiTracerFactory.getInstance(); this.deprecatedExecutorProviderSet = false; + this.gdchApiAudience = null; + + this.clientSettingsEndpoint = null; + this.transportChannelProviderEndpoint = null; + this.mtlsEndpoint = null; + this.switchToMtlsEndpointAllowed = false; + this.universeDomain = null; + this.apiKey = null; + // Attempt to create an empty, non-functioning EndpointContext by default. The client will + // have + // a valid EndpointContext with user configurations after the client has been initialized. + this.endpointContext = EndpointContext.getDefaultInstance(); } else { ExecutorProvider fixedExecutorProvider = FixedExecutorProvider.create(clientContext.getExecutor()); @@ -280,15 +398,25 @@ protected Builder(ClientContext clientContext) { this.internalHeaderProvider = FixedHeaderProvider.create(clientContext.getInternalHeaders()); this.clock = clientContext.getClock(); - this.endpoint = clientContext.getEndpoint(); - if (this.endpoint != null) { - this.mtlsEndpoint = this.endpoint.replace("googleapis.com", "mtls.googleapis.com"); - } this.streamWatchdogProvider = FixedWatchdogProvider.create(clientContext.getStreamWatchdog()); - this.streamWatchdogCheckInterval = clientContext.getStreamWatchdogCheckInterval(); + this.streamWatchdogCheckInterval = clientContext.getStreamWatchdogCheckIntervalDuration(); this.tracerFactory = clientContext.getTracerFactory(); this.quotaProjectId = getQuotaProjectIdFromClientContext(clientContext); + this.gdchApiAudience = clientContext.getGdchApiAudience(); + + // The follow settings will be set to the original user configurations as the + // EndpointContext will be rebuilt in the constructor. + this.clientSettingsEndpoint = clientContext.getEndpointContext().clientSettingsEndpoint(); + this.transportChannelProviderEndpoint = + clientContext.getEndpointContext().transportChannelProviderEndpoint(); + this.mtlsEndpoint = clientContext.getEndpointContext().mtlsEndpoint(); + this.switchToMtlsEndpointAllowed = + clientContext.getEndpointContext().switchToMtlsEndpointAllowed(); + this.universeDomain = clientContext.getEndpointContext().universeDomain(); + // Store the EndpointContext that was already created. This is used to return the state + // of the EndpointContext prior to any new modifications + this.endpointContext = clientContext.getEndpointContext(); } } @@ -378,6 +506,7 @@ protected B setInternalHeaderProvider(HeaderProvider internalHeaderProvider) { */ public B setTransportChannelProvider(TransportChannelProvider transportChannelProvider) { this.transportChannelProvider = transportChannelProvider; + this.transportChannelProviderEndpoint = transportChannelProvider.getEndpoint(); return self(); } @@ -401,11 +530,17 @@ public B setClock(ApiClock clock) { return self(); } + public B setUniverseDomain(String universeDomain) { + this.universeDomain = universeDomain; + return self(); + } + public B setEndpoint(String endpoint) { - this.endpoint = endpoint; + this.clientSettingsEndpoint = endpoint; this.switchToMtlsEndpointAllowed = false; - if (this.endpoint != null && this.mtlsEndpoint == null) { - this.mtlsEndpoint = this.endpoint.replace("googleapis.com", "mtls.googleapis.com"); + if (this.clientSettingsEndpoint != null && this.mtlsEndpoint == null) { + this.mtlsEndpoint = + this.clientSettingsEndpoint.replace("googleapis.com", "mtls.googleapis.com"); } return self(); } @@ -425,16 +560,37 @@ public B setQuotaProjectId(String quotaProjectId) { return self(); } + /** + * This method is obsolete. Use {@link + * #setStreamWatchdogCheckIntervalDuration(java.time.Duration)} instead. + */ + @ObsoleteApi("Use setStreamWatchdogCheckIntervalDuration(java.time.Duration) instead") + public B setStreamWatchdogCheckInterval(@Nonnull org.threeten.bp.Duration checkInterval) { + return setStreamWatchdogCheckIntervalDuration(toJavaTimeDuration(checkInterval)); + } + /** * Sets how often the {@link Watchdog} will check ongoing streaming RPCs. Defaults to 10 secs. - * Use {@link Duration#ZERO} to disable. + * Use {@link java.time.Duration#ZERO} to disable. */ - public B setStreamWatchdogCheckInterval(@Nonnull Duration checkInterval) { + public B setStreamWatchdogCheckIntervalDuration(@Nonnull java.time.Duration checkInterval) { Preconditions.checkNotNull(checkInterval); this.streamWatchdogCheckInterval = checkInterval; return self(); } + /** + * Sets the API audience used by {@link com.google.auth.oauth2.GdchCredentials} It cannot be + * used if other type of {@link com.google.auth.Credentials} is used. If the provided + * credentials already have an api audience set, then it will be overriden by this audience + * + * @param gdchApiAudience the audience to be used - must be a valid URI string + */ + public B setGdchApiAudience(String gdchApiAudience) { + this.gdchApiAudience = gdchApiAudience; + return self(); + } + /** * Configures the {@link ApiTracerFactory} that will be used to generate traces. * @@ -447,7 +603,24 @@ public B setTracerFactory(@Nonnull ApiTracerFactory tracerFactory) { return self(); } - /** @deprecated Please use {@link #getBackgroundExecutorProvider()}. */ + /** + * Sets the API key. The API key will get translated to an {@link + * com.google.auth.ApiKeyCredentials} and stored in {@link ClientContext}. + * + *

        API Key authorization is not supported for every product. Please check the documentation + * for each product to confirm if it is supported. + * + *

        Note: If you set an API key and {@link CredentialsProvider} in the same ClientSettings the + * API key will override any credentials provided. + */ + public B setApiKey(String apiKey) { + this.apiKey = apiKey; + return self(); + } + + /** + * @deprecated Please use {@link #getBackgroundExecutorProvider()}. + */ @Deprecated public ExecutorProvider getExecutorProvider() { return deprecatedExecutorProviderSet ? backgroundExecutorProvider : null; @@ -489,8 +662,24 @@ public ApiClock getClock() { return clock; } + /** Gets the API Key that was previously set on this Builder. */ + public final String getApiKey() { + return apiKey; + } + + /** + * @return the resolved endpoint when the Builder was created. If invoked after + * `StubSettings.newBuilder()` is called, it will return the clientSettingsEndpoint value. + * If other parameters are then set in the builder, the resolved endpoint is not + * automatically updated. The resolved endpoint will only be recomputed when the + * StubSettings is built again. + */ public String getEndpoint() { - return endpoint; + // For the `StubSettings.newBuilder()` case + if (endpointContext.equals(EndpointContext.getDefaultInstance())) { + return clientSettingsEndpoint; + } + return endpointContext.resolvedEndpoint(); } public String getMtlsEndpoint() { @@ -502,9 +691,15 @@ public String getQuotaProjectId() { return quotaProjectId; } + /** This method is obsolete. Use {@link #getStreamWatchdogCheckIntervalDuration()} instead */ + @ObsoleteApi("Use getStreamWatchdogCheckIntervalDuration() instead") + public org.threeten.bp.Duration getStreamWatchdogCheckInterval() { + return toThreetenDuration(getStreamWatchdogCheckIntervalDuration()); + } + @Nonnull - public Duration getStreamWatchdogCheckInterval() { - return streamWatchdogCheckInterval; + public java.time.Duration getStreamWatchdogCheckIntervalDuration() { + return Preconditions.checkNotNull(streamWatchdogCheckInterval); } @BetaApi("The surface for tracing is not stable yet and may change in the future.") @@ -513,6 +708,11 @@ public ApiTracerFactory getTracerFactory() { return tracerFactory; } + /** Gets the GDCH API audience that was previously set in this Builder */ + public String getGdchApiAudience() { + return gdchApiAudience; + } + /** Applies the given settings updater function to the given method settings builders. */ protected static void applyToAllUnaryMethods( Iterable> methodSettingsBuilders, @@ -533,13 +733,15 @@ public String toString() { .add("headerProvider", headerProvider) .add("internalHeaderProvider", internalHeaderProvider) .add("clock", clock) - .add("endpoint", endpoint) + .add("universeDomain", universeDomain) + .add("endpoint", clientSettingsEndpoint) .add("mtlsEndpoint", mtlsEndpoint) .add("switchToMtlsEndpointAllowed", switchToMtlsEndpointAllowed) .add("quotaProjectId", quotaProjectId) .add("streamWatchdogProvider", streamWatchdogProvider) .add("streamWatchdogCheckInterval", streamWatchdogCheckInterval) .add("tracerFactory", tracerFactory) + .add("gdchApiAudience", gdchApiAudience) .toString(); } } diff --git a/gax-java/gax/src/main/java/com/google/api/gax/rpc/TransportChannelProvider.java b/gax-java/gax/src/main/java/com/google/api/gax/rpc/TransportChannelProvider.java index b2acd458f0..cc2ebdb064 100644 --- a/gax-java/gax/src/main/java/com/google/api/gax/rpc/TransportChannelProvider.java +++ b/gax-java/gax/src/main/java/com/google/api/gax/rpc/TransportChannelProvider.java @@ -73,10 +73,25 @@ public interface TransportChannelProvider { /** Sets the executor to use when constructing a new {@link TransportChannel}. */ TransportChannelProvider withExecutor(Executor executor); - /** @deprecated Please use {@link #withExecutor(Executor)}. */ + /** + * @deprecated Please use {@link #withExecutor(Executor)}. + */ @Deprecated TransportChannelProvider withExecutor(ScheduledExecutorService executor); + /** + * True if the TransportProvider needs a background executor. The background executor can be used + * for refreshing channels, resizing the channel pool etc. + */ + default boolean needsBackgroundExecutor() { + return false; + } + + /** Sets the background executor when constructing a new {@link TransportChannel}. */ + default TransportChannelProvider withBackgroundExecutor(ScheduledExecutorService executor) { + return this; + } + /** True if the TransportProvider has no headers provided. */ boolean needsHeaders(); @@ -97,6 +112,27 @@ public interface TransportChannelProvider { */ TransportChannelProvider withEndpoint(String endpoint); + /** True for gRPC transport provider which has no mtlsEndpoint set. */ + default boolean needsMtlsEndpoint() { + return false; + } + + /** + * Sets the mTLS endpoint to use when constructing a new {@link TransportChannel} using S2A. + * + *

        This method should only be called if {@link #needsMtlsEndpoint()} returns true. + */ + default TransportChannelProvider withMtlsEndpoint(String mtlsEndpoint) { + return this; + } + + /** Sets whether to use S2A when constructing a new {@link TransportChannel}. */ + @BetaApi( + "The S2A feature is not stable yet and may change in the future. https://github.com/grpc/grpc-java/issues/11533.") + default TransportChannelProvider withUseS2A(boolean useS2A) { + return this; + } + /** * Reports whether this provider allows pool size customization. * @@ -142,4 +178,13 @@ public interface TransportChannelProvider { *

        This string can be used for identifying transports for switching logic. */ String getTransportName(); + + /** + * User set custom endpoint for the Transport Channel Provider + * + *

        This is the unresolved endpoint used by GAPICs + */ + default String getEndpoint() { + return null; + } } diff --git a/gax-java/gax/src/main/java/com/google/api/gax/rpc/UnaryCallSettings.java b/gax-java/gax/src/main/java/com/google/api/gax/rpc/UnaryCallSettings.java index c8f2811449..f985650a59 100644 --- a/gax-java/gax/src/main/java/com/google/api/gax/rpc/UnaryCallSettings.java +++ b/gax-java/gax/src/main/java/com/google/api/gax/rpc/UnaryCallSettings.java @@ -29,13 +29,15 @@ */ package com.google.api.gax.rpc; +import static com.google.api.gax.util.TimeConversionUtils.toJavaTimeDuration; + import com.google.api.core.InternalExtensionOnly; +import com.google.api.core.ObsoleteApi; import com.google.api.gax.retrying.RetrySettings; import com.google.common.base.MoreObjects; import com.google.common.collect.ImmutableSet; import com.google.common.collect.Sets; import java.util.Set; -import org.threeten.bp.Duration; /** * A base settings class to configure a UnaryCallable. An instance of UnaryCallSettings is not @@ -194,19 +196,29 @@ public UnaryCallSettings.Builder setRetrySettings( return this; } - /** Disables retries and sets the RPC timeout. */ + /** + * This method is obsolete. Use {@link #setSimpleTimeoutNoRetriesDuration(java.time.Duration)} + * instead. + */ + @ObsoleteApi("Use setSimpleTimeoutNoRetriesDuration(java.time.Duration) instead") public UnaryCallSettings.Builder setSimpleTimeoutNoRetries( - Duration timeout) { + org.threeten.bp.Duration timeout) { + return setSimpleTimeoutNoRetriesDuration(toJavaTimeDuration(timeout)); + } + + /** Disables retries and sets the RPC timeout. */ + public UnaryCallSettings.Builder setSimpleTimeoutNoRetriesDuration( + java.time.Duration timeout) { setRetryableCodes(); setRetrySettings( RetrySettings.newBuilder() - .setTotalTimeout(timeout) - .setInitialRetryDelay(Duration.ZERO) + .setTotalTimeoutDuration(timeout) + .setInitialRetryDelayDuration(java.time.Duration.ZERO) .setRetryDelayMultiplier(1) - .setMaxRetryDelay(Duration.ZERO) - .setInitialRpcTimeout(timeout) + .setMaxRetryDelayDuration(java.time.Duration.ZERO) + .setInitialRpcTimeoutDuration(timeout) .setRpcTimeoutMultiplier(1) - .setMaxRpcTimeout(timeout) + .setMaxRpcTimeoutDuration(timeout) .setMaxAttempts(1) .build()); return this; diff --git a/gax-java/gax/src/main/java/com/google/api/gax/rpc/UnauthenticatedException.java b/gax-java/gax/src/main/java/com/google/api/gax/rpc/UnauthenticatedException.java index 6daeece5a9..9f6954d65a 100644 --- a/gax-java/gax/src/main/java/com/google/api/gax/rpc/UnauthenticatedException.java +++ b/gax-java/gax/src/main/java/com/google/api/gax/rpc/UnauthenticatedException.java @@ -47,4 +47,13 @@ public UnauthenticatedException( Throwable cause, StatusCode statusCode, boolean retryable, ErrorDetails errorDetails) { super(cause, statusCode, retryable, errorDetails); } + + public UnauthenticatedException( + String message, + Throwable cause, + StatusCode statusCode, + boolean retryable, + ErrorDetails errorDetails) { + super(message, cause, statusCode, retryable, errorDetails); + } } diff --git a/gax-java/gax/src/main/java/com/google/api/gax/rpc/UnavailableException.java b/gax-java/gax/src/main/java/com/google/api/gax/rpc/UnavailableException.java index 96fbc8d280..7b564e085f 100644 --- a/gax-java/gax/src/main/java/com/google/api/gax/rpc/UnavailableException.java +++ b/gax-java/gax/src/main/java/com/google/api/gax/rpc/UnavailableException.java @@ -47,4 +47,13 @@ public UnavailableException( Throwable cause, StatusCode statusCode, boolean retryable, ErrorDetails errorDetails) { super(cause, statusCode, retryable, errorDetails); } + + public UnavailableException( + String message, + Throwable cause, + StatusCode statusCode, + boolean retryable, + ErrorDetails errorDetails) { + super(message, cause, statusCode, retryable, errorDetails); + } } diff --git a/gax-java/gax/src/main/java/com/google/api/gax/rpc/UnimplementedException.java b/gax-java/gax/src/main/java/com/google/api/gax/rpc/UnimplementedException.java index 8e042f4414..8c6c2f77f3 100644 --- a/gax-java/gax/src/main/java/com/google/api/gax/rpc/UnimplementedException.java +++ b/gax-java/gax/src/main/java/com/google/api/gax/rpc/UnimplementedException.java @@ -46,4 +46,13 @@ public UnimplementedException( Throwable cause, StatusCode statusCode, boolean retryable, ErrorDetails errorDetails) { super(cause, statusCode, retryable, errorDetails); } + + public UnimplementedException( + String message, + Throwable cause, + StatusCode statusCode, + boolean retryable, + ErrorDetails errorDetails) { + super(message, cause, statusCode, retryable, errorDetails); + } } diff --git a/gax-java/gax/src/main/java/com/google/api/gax/rpc/UnknownException.java b/gax-java/gax/src/main/java/com/google/api/gax/rpc/UnknownException.java index a3ebe35991..f6fe80138c 100644 --- a/gax-java/gax/src/main/java/com/google/api/gax/rpc/UnknownException.java +++ b/gax-java/gax/src/main/java/com/google/api/gax/rpc/UnknownException.java @@ -49,4 +49,13 @@ public UnknownException( Throwable cause, StatusCode statusCode, boolean retryable, ErrorDetails errorDetails) { super(cause, statusCode, retryable, errorDetails); } + + public UnknownException( + String message, + Throwable cause, + StatusCode statusCode, + boolean retryable, + ErrorDetails errorDetails) { + super(message, cause, statusCode, retryable, errorDetails); + } } diff --git a/gax-java/gax/src/main/java/com/google/api/gax/rpc/Watchdog.java b/gax-java/gax/src/main/java/com/google/api/gax/rpc/Watchdog.java index 8ca97876ca..f80a8a9034 100644 --- a/gax-java/gax/src/main/java/com/google/api/gax/rpc/Watchdog.java +++ b/gax-java/gax/src/main/java/com/google/api/gax/rpc/Watchdog.java @@ -29,9 +29,15 @@ */ package com.google.api.gax.rpc; +import static com.google.api.gax.util.TimeConversionUtils.toJavaTimeDuration; +import static com.google.api.gax.util.TimeConversionUtils.toThreetenDuration; + import com.google.api.core.ApiClock; +import com.google.api.core.ObsoleteApi; import com.google.api.gax.core.BackgroundResource; +import com.google.common.annotations.VisibleForTesting; import com.google.common.base.Preconditions; +import com.google.errorprone.annotations.concurrent.GuardedBy; import java.util.Iterator; import java.util.Map.Entry; import java.util.concurrent.CancellationException; @@ -44,8 +50,6 @@ import java.util.logging.Level; import java.util.logging.Logger; import javax.annotation.Nonnull; -import javax.annotation.concurrent.GuardedBy; -import org.threeten.bp.Duration; /** * Prevents the streams from hanging indefinitely. This middleware garbage collects idle streams in @@ -71,19 +75,32 @@ public final class Watchdog implements Runnable, BackgroundResource { private final ConcurrentHashMap openStreams = new ConcurrentHashMap<>(); private final ApiClock clock; - private final Duration scheduleInterval; + private final java.time.Duration scheduleInterval; private final ScheduledExecutorService executor; private ScheduledFuture future; - /** returns a Watchdog which is scheduled at the provided interval. */ + /** + * This method is obsolete. Use {@link #createDuration(ApiClock, java.time.Duration, + * ScheduledExecutorService)} instead. + */ + @ObsoleteApi("Use create(ApiClock, java.time.Duration, ScheduledExecutorService) instead") public static Watchdog create( - ApiClock clock, Duration scheduleInterval, ScheduledExecutorService executor) { + ApiClock clock, + org.threeten.bp.Duration scheduleInterval, + ScheduledExecutorService executor) { + return createDuration(clock, toJavaTimeDuration(scheduleInterval), executor); + } + + /** returns a Watchdog which is scheduled at the provided interval. */ + public static Watchdog createDuration( + ApiClock clock, java.time.Duration scheduleInterval, ScheduledExecutorService executor) { Watchdog watchdog = new Watchdog(clock, scheduleInterval, executor); watchdog.start(); return watchdog; } - private Watchdog(ApiClock clock, Duration scheduleInterval, ScheduledExecutorService executor) { + private Watchdog( + ApiClock clock, java.time.Duration scheduleInterval, ScheduledExecutorService executor) { this.clock = Preconditions.checkNotNull(clock, "clock can't be null"); this.scheduleInterval = scheduleInterval; this.executor = executor; @@ -95,11 +112,25 @@ private void start() { this, scheduleInterval.toMillis(), scheduleInterval.toMillis(), TimeUnit.MILLISECONDS); } - /** Wraps the target observer with timing constraints. */ + /** + * This method is obsolete. Use {@link #watchDuration(ResponseObserver, java.time.Duration, + * java.time.Duration)} instead. + */ + @ObsoleteApi( + "Use watchDuration(ResponseObserver, java.time.Duration, java.time.Duration) instead") public ResponseObserver watch( ResponseObserver innerObserver, - @Nonnull Duration waitTimeout, - @Nonnull Duration idleTimeout) { + @Nonnull org.threeten.bp.Duration waitTimeout, + @Nonnull org.threeten.bp.Duration idleTimeout) { + return watchDuration( + innerObserver, toJavaTimeDuration(waitTimeout), toJavaTimeDuration(idleTimeout)); + } + + /** Wraps the target observer with timing constraints. */ + public ResponseObserver watchDuration( + ResponseObserver innerObserver, + @Nonnull java.time.Duration waitTimeout, + @Nonnull java.time.Duration idleTimeout) { Preconditions.checkNotNull(innerObserver, "innerObserver can't be null"); Preconditions.checkNotNull(waitTimeout, "waitTimeout can't be null"); Preconditions.checkNotNull(idleTimeout, "idleTimeout can't be null"); @@ -171,6 +202,16 @@ public void close() { shutdown(); } + @VisibleForTesting + java.time.Duration getScheduleIntervalDuration() { + return this.scheduleInterval; + } + + @VisibleForTesting + org.threeten.bp.Duration getScheduleInterval() { + return toThreetenDuration(this.scheduleInterval); + } + enum State { /** Stream has been started, but doesn't have any outstanding requests. */ IDLE, @@ -185,16 +226,19 @@ enum State { class WatchdogStream extends StateCheckingResponseObserver { private final Object lock = new Object(); - private final Duration waitTimeout; - private final Duration idleTimeout; + private final java.time.Duration waitTimeout; + private final java.time.Duration idleTimeout; private boolean hasStarted; private boolean autoAutoFlowControl = true; private final ResponseObserver outerResponseObserver; private volatile StreamController innerController; + // When a stream is created it has automatic inbound flow control enabled. The stream + // won't wait for the caller to request a message. Setting the default to WAITING + // to reflect this state. @GuardedBy("lock") - private State state = State.IDLE; + private State state = State.WAITING; @GuardedBy("lock") private int pendingCount = 0; @@ -205,7 +249,9 @@ class WatchdogStream extends StateCheckingResponseObserver private volatile Throwable error; WatchdogStream( - ResponseObserver responseObserver, Duration waitTimeout, Duration idleTimeout) { + ResponseObserver responseObserver, + java.time.Duration waitTimeout, + java.time.Duration idleTimeout) { this.waitTimeout = waitTimeout; this.idleTimeout = idleTimeout; this.outerResponseObserver = responseObserver; @@ -220,6 +266,16 @@ public void onStartImpl(StreamController controller) { public void disableAutoInboundFlowControl() { Preconditions.checkState( !hasStarted, "Can't disable automatic flow control after the stream has started"); + + // Adding the lock only to satisfy the annotation. It doesn't matter because before + // the stream is started, this is only accessed by the caller. + synchronized (lock) { + // When auto flow control is disabled, caller needs to call onRequest() to request a + // message. Setting the state to IDLE because now we're waiting for caller to call + // onRequest(). + state = State.IDLE; + } + autoAutoFlowControl = false; innerController.disableAutoInboundFlowControl(); } diff --git a/gax-java/gax/src/main/java/com/google/api/gax/rpc/WatchdogProvider.java b/gax-java/gax/src/main/java/com/google/api/gax/rpc/WatchdogProvider.java index db3fb20bb7..a31fc7b6f4 100644 --- a/gax-java/gax/src/main/java/com/google/api/gax/rpc/WatchdogProvider.java +++ b/gax-java/gax/src/main/java/com/google/api/gax/rpc/WatchdogProvider.java @@ -29,10 +29,12 @@ */ package com.google.api.gax.rpc; +import static com.google.api.gax.util.TimeConversionUtils.toThreetenDuration; + import com.google.api.core.ApiClock; +import com.google.api.core.ObsoleteApi; import java.util.concurrent.ScheduledExecutorService; import javax.annotation.Nonnull; -import org.threeten.bp.Duration; public interface WatchdogProvider { boolean needsClock(); @@ -41,7 +43,15 @@ public interface WatchdogProvider { boolean needsCheckInterval(); - WatchdogProvider withCheckInterval(Duration checkInterval); + /** + * This method is obsolete. Use {@link #withCheckIntervalDuration(java.time.Duration)} instead. + */ + @ObsoleteApi("Use withCheckIntervalDuration(java.time.Duration) instead") + WatchdogProvider withCheckInterval(org.threeten.bp.Duration checkInterval); + + default WatchdogProvider withCheckIntervalDuration(java.time.Duration checkInterval) { + return withCheckInterval(toThreetenDuration(checkInterval)); + } boolean needsExecutor(); diff --git a/gax-java/gax/src/main/java/com/google/api/gax/rpc/WatchdogServerStreamingCallable.java b/gax-java/gax/src/main/java/com/google/api/gax/rpc/WatchdogServerStreamingCallable.java index cc3dfec829..443bf11dd5 100644 --- a/gax-java/gax/src/main/java/com/google/api/gax/rpc/WatchdogServerStreamingCallable.java +++ b/gax-java/gax/src/main/java/com/google/api/gax/rpc/WatchdogServerStreamingCallable.java @@ -31,7 +31,6 @@ import com.google.common.base.MoreObjects; import com.google.common.base.Preconditions; -import org.threeten.bp.Duration; /** * A callable that uses a {@link Watchdog} to monitor streams. @@ -62,10 +61,12 @@ public void call( RequestT request, ResponseObserver responseObserver, ApiCallContext context) { // If the caller never configured the timeouts, disable them - Duration waitTimeout = MoreObjects.firstNonNull(context.getStreamWaitTimeout(), Duration.ZERO); - Duration idleTimeout = MoreObjects.firstNonNull(context.getStreamIdleTimeout(), Duration.ZERO); + java.time.Duration waitTimeout = + MoreObjects.firstNonNull(context.getStreamWaitTimeoutDuration(), java.time.Duration.ZERO); + java.time.Duration idleTimeout = + MoreObjects.firstNonNull(context.getStreamIdleTimeoutDuration(), java.time.Duration.ZERO); - responseObserver = watchdog.watch(responseObserver, waitTimeout, idleTimeout); + responseObserver = watchdog.watchDuration(responseObserver, waitTimeout, idleTimeout); inner.call(request, responseObserver, context); } } diff --git a/gax-java/gax/src/main/java/com/google/api/gax/rpc/internal/Headers.java b/gax-java/gax/src/main/java/com/google/api/gax/rpc/internal/Headers.java index ddd6600362..49d4c049ab 100644 --- a/gax-java/gax/src/main/java/com/google/api/gax/rpc/internal/Headers.java +++ b/gax-java/gax/src/main/java/com/google/api/gax/rpc/internal/Headers.java @@ -38,6 +38,8 @@ @InternalApi public class Headers { + public static final String DYNAMIC_ROUTING_HEADER_KEY = "x-goog-request-params"; + public static ImmutableMap> mergeHeaders( Map> oldHeaders, Map> newHeaders) { ImmutableMap.Builder> headersBuilder = ImmutableMap.builder(); diff --git a/gax-java/gax/src/main/java/com/google/api/gax/rpc/internal/QuotaProjectIdHidingCredentials.java b/gax-java/gax/src/main/java/com/google/api/gax/rpc/internal/QuotaProjectIdHidingCredentials.java index 51bbade9a0..8c9d2c5799 100644 --- a/gax-java/gax/src/main/java/com/google/api/gax/rpc/internal/QuotaProjectIdHidingCredentials.java +++ b/gax-java/gax/src/main/java/com/google/api/gax/rpc/internal/QuotaProjectIdHidingCredentials.java @@ -89,4 +89,9 @@ public boolean hasRequestMetadataOnly() { public void refresh() throws IOException { this.wrappedCredentials.refresh(); } + + @Override + public String getUniverseDomain() throws IOException { + return this.wrappedCredentials.getUniverseDomain(); + } } diff --git a/gax-java/gax/src/main/java/com/google/api/gax/rpc/mtls/CertificateBasedAccess.java b/gax-java/gax/src/main/java/com/google/api/gax/rpc/mtls/CertificateBasedAccess.java new file mode 100644 index 0000000000..6f722bff60 --- /dev/null +++ b/gax-java/gax/src/main/java/com/google/api/gax/rpc/mtls/CertificateBasedAccess.java @@ -0,0 +1,83 @@ +/* + * Copyright 2025 Google LLC + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Google LLC nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +package com.google.api.gax.rpc.mtls; + +import com.google.api.core.InternalApi; +import com.google.api.gax.rpc.internal.EnvironmentProvider; + +/** + * Utility class for handling certificate-based access configurations. + * + *

        This class handles the processing of GOOGLE_API_USE_CLIENT_CERTIFICATE and + * GOOGLE_API_USE_MTLS_ENDPOINT environment variables according to https://google.aip.dev/auth/4114 + */ +@InternalApi +public class CertificateBasedAccess { + + private final EnvironmentProvider envProvider; + + /** The EnvironmentProvider mechanism supports env var injection for unit tests. */ + public CertificateBasedAccess(EnvironmentProvider envProvider) { + this.envProvider = envProvider; + } + + public static CertificateBasedAccess createWithSystemEnv() { + return new CertificateBasedAccess(System::getenv); + } + + /** + * The policy for mutual TLS endpoint usage. NEVER means always use regular endpoint; ALWAYS means + * always use mTLS endpoint; AUTO means auto switch to mTLS endpoint if client certificate exists + * and should be used. + */ + public enum MtlsEndpointUsagePolicy { + NEVER, + AUTO, + ALWAYS; + } + + /** Returns if mutual TLS client certificate should be used. */ + public boolean useMtlsClientCertificate() { + String useClientCertificate = envProvider.getenv("GOOGLE_API_USE_CLIENT_CERTIFICATE"); + return "true".equals(useClientCertificate); + } + + /** Returns the current mutual TLS endpoint usage policy. */ + public MtlsEndpointUsagePolicy getMtlsEndpointUsagePolicy() { + String mtlsEndpointUsagePolicy = envProvider.getenv("GOOGLE_API_USE_MTLS_ENDPOINT"); + if ("never".equals(mtlsEndpointUsagePolicy)) { + return MtlsEndpointUsagePolicy.NEVER; + } else if ("always".equals(mtlsEndpointUsagePolicy)) { + return MtlsEndpointUsagePolicy.ALWAYS; + } + return MtlsEndpointUsagePolicy.AUTO; + } +} diff --git a/gax-java/gax/src/main/java/com/google/api/gax/rpc/mtls/ContextAwareMetadataJson.java b/gax-java/gax/src/main/java/com/google/api/gax/rpc/mtls/ContextAwareMetadataJson.java index 25d7d27de7..9e92ac5ce0 100644 --- a/gax-java/gax/src/main/java/com/google/api/gax/rpc/mtls/ContextAwareMetadataJson.java +++ b/gax-java/gax/src/main/java/com/google/api/gax/rpc/mtls/ContextAwareMetadataJson.java @@ -1,5 +1,5 @@ /* - * Copyright 2021 Google LLC + * Copyright 2025 Google LLC * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are @@ -32,12 +32,18 @@ import com.google.api.client.json.GenericJson; import com.google.api.client.util.Key; -import com.google.api.core.BetaApi; import com.google.common.collect.ImmutableList; import java.util.List; -/** Data class representing context_aware_metadata.json file. */ -@BetaApi +/** + * Data class representing context_aware_metadata.json file. + * + *

        This class is deprecated. It has been replaced by + * com.google.auth.mtls.ContextAwareMetadataJson from the Java auth library. + * + *

        Note: This class is for Google cloud internal use only. + */ +@Deprecated public class ContextAwareMetadataJson extends GenericJson { /** Cert provider command */ @Key("cert_provider_command") diff --git a/gax-java/gax/src/main/java/com/google/api/gax/rpc/mtls/MtlsProvider.java b/gax-java/gax/src/main/java/com/google/api/gax/rpc/mtls/MtlsProvider.java index c24fc80d6f..88e423c47c 100644 --- a/gax-java/gax/src/main/java/com/google/api/gax/rpc/mtls/MtlsProvider.java +++ b/gax-java/gax/src/main/java/com/google/api/gax/rpc/mtls/MtlsProvider.java @@ -48,8 +48,14 @@ /** * Provider class for mutual TLS. It is used to configure the mutual TLS in the transport with the * default client certificate on device. + * + *

        This class is deprecated. It has been replaced by com.google.auth.mtls.SecureConnectProvider + * from the Java auth library. + * + *

        Note: This class is for Google cloud internal use only. */ @BetaApi +@Deprecated public class MtlsProvider { interface ProcessProvider { public Process createProcess(InputStream metadata) throws IOException; diff --git a/gax-java/gax/src/main/java/com/google/api/gax/tracing/ApiTracer.java b/gax-java/gax/src/main/java/com/google/api/gax/tracing/ApiTracer.java index 3176be4b92..97f8e017db 100644 --- a/gax-java/gax/src/main/java/com/google/api/gax/tracing/ApiTracer.java +++ b/gax-java/gax/src/main/java/com/google/api/gax/tracing/ApiTracer.java @@ -29,8 +29,10 @@ */ package com.google.api.gax.tracing; +import static com.google.api.gax.util.TimeConversionUtils.toThreetenDuration; + import com.google.api.core.InternalApi; -import org.threeten.bp.Duration; +import com.google.api.core.ObsoleteApi; /** * Implementations of this class trace the logical flow of a google cloud client. @@ -49,19 +51,26 @@ public interface ApiTracer { * between clients using gax and external resources to share the same implementation of the * tracing. For example OpenCensus will install a thread local that can read by the GRPC. */ - Scope inScope(); + default Scope inScope() { + return () -> { + // noop + }; + } + ; /** * Signals that the overall operation has finished successfully. The tracer is now considered * closed and should no longer be used. */ - void operationSucceeded(); + default void operationSucceeded() {} + ; /** * Signals that the operation was cancelled by the user. The tracer is now considered closed and * should no longer be used. */ - void operationCancelled(); + default void operationCancelled() {} + ; /** * Signals that the overall operation has failed and no further attempts will be made. The tracer @@ -69,14 +78,16 @@ public interface ApiTracer { * * @param error the final error that caused the operation to fail. */ - void operationFailed(Throwable error); + default void operationFailed(Throwable error) {} + ; /** * Annotates the operation with selected connection id from the {@code ChannelPool}. * * @param id the local connection identifier of the selected connection. */ - void connectionSelected(String id); + default void connectionSelected(String id) {} + ; /** * Adds an annotation that an attempt is about to start. In general this should occur at the very @@ -86,7 +97,8 @@ public interface ApiTracer { * @deprecated Please use {@link #attemptStarted(Object, int)} instead. */ @Deprecated - void attemptStarted(int attemptNumber); + default void attemptStarted(int attemptNumber) {} + ; /** * Adds an annotation that an attempt is about to start with additional information from the @@ -96,13 +108,24 @@ public interface ApiTracer { * @param attemptNumber the zero based sequential attempt number. * @param request request of this attempt. */ - void attemptStarted(Object request, int attemptNumber); + default void attemptStarted(Object request, int attemptNumber) {} + ; /** Adds an annotation that the attempt succeeded. */ - void attemptSucceeded(); + default void attemptSucceeded() {} + ; /** Add an annotation that the attempt was cancelled by the user. */ - void attemptCancelled(); + default void attemptCancelled() {} + ; + + /** + * This method is obsolete. Use {@link #attemptFailedDuration(Throwable, java.time.Duration)} + * instead. + */ + @ObsoleteApi("Use attemptFailedDuration(Throwable, java.time.Duration) instead") + default void attemptFailed(Throwable error, org.threeten.bp.Duration delay) {} + ; /** * Adds an annotation that the attempt failed, but another attempt will be made after the delay. @@ -110,7 +133,14 @@ public interface ApiTracer { * @param error the transient error that caused the attempt to fail. * @param delay the amount of time to wait before the next attempt will start. */ - void attemptFailed(Throwable error, Duration delay); + default void attemptFailedDuration(Throwable error, java.time.Duration delay) { + // Defaults to do the same as attemptFailed(Throwable, org.threeten.bp.Duration). This + // is because customers may have older/legacy code that directly implements + // attemptFailed(Throwable, org.threeten.bp.Duration)} and their overridden logic should be + // invoked in gax. + attemptFailed(error, toThreetenDuration(delay)); + } + ; /** * Adds an annotation that the attempt failed and that no further attempts will be made because @@ -118,7 +148,8 @@ public interface ApiTracer { * * @param error the last error received before retries were exhausted. */ - void attemptFailedRetriesExhausted(Throwable error); + default void attemptFailedRetriesExhausted(Throwable error) {} + ; /** * Adds an annotation that the attempt failed and that no further attempts will be made because @@ -126,26 +157,31 @@ public interface ApiTracer { * * @param error the error that caused the final attempt to fail. */ - void attemptPermanentFailure(Throwable error); + default void attemptPermanentFailure(Throwable error) {} + ; /** * Signals that the initial RPC for the long running operation failed. * * @param error the error that caused the long running operation fail. */ - void lroStartFailed(Throwable error); + default void lroStartFailed(Throwable error) {} + ; /** * Signals that the initial RPC successfully started the long running operation. The long running * operation will now be polled for completion. */ - void lroStartSucceeded(); + default void lroStartSucceeded() {} + ; /** Adds an annotation that a streaming response has been received. */ - void responseReceived(); + default void responseReceived() {} + ; /** Adds an annotation that a streaming request has been sent. */ - void requestSent(); + default void requestSent() {} + ; /** * Adds an annotation that a batch of writes has been flushed. @@ -153,7 +189,8 @@ public interface ApiTracer { * @param elementCount the number of elements in the batch. * @param requestSize the size of the batch in bytes. */ - void batchRequestSent(long elementCount, long requestSize); + default void batchRequestSent(long elementCount, long requestSize) {} + ; /** * A context class to be used with {@link #inScope()} and a try-with-resources block. Closing a diff --git a/gax-java/gax/src/main/java/com/google/api/gax/tracing/ApiTracerContext.java b/gax-java/gax/src/main/java/com/google/api/gax/tracing/ApiTracerContext.java new file mode 100644 index 0000000000..d6f7566c74 --- /dev/null +++ b/gax-java/gax/src/main/java/com/google/api/gax/tracing/ApiTracerContext.java @@ -0,0 +1,323 @@ +/* + * Copyright 2026 Google LLC + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Google LLC nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +package com.google.api.gax.tracing; + +import com.google.api.core.InternalApi; +import com.google.api.gax.rpc.LibraryMetadata; +import com.google.api.gax.tracing.ApiTracerFactory.OperationType; +import com.google.auto.value.AutoValue; +import com.google.common.base.Strings; +import java.util.HashMap; +import java.util.Map; +import javax.annotation.Nullable; + +/** + * A context object that contains information used to infer attributes that are common for all + * {@link ApiTracer}s. + * + *

        For internal use only. + */ +@InternalApi +@AutoValue +public abstract class ApiTracerContext { + + public enum Transport { + GRPC("grpc"), + HTTP("http"); + + private final String label; + + Transport(String label) { + this.label = label; + } + } + + /** + * Returns the server address of the RPC. + * + *

        Example: "pubsub.googleapis.com". This maps to the {@code server.address} attribute. + * + * @return the server address, or {@code null} if not set + */ + @Nullable + abstract String serverAddress(); + + /** + * Returns the server port of the RPC. + * + *

        Example: 1337. This maps to the {@code server.port} attribute. + * + * @return the server port, or {@code null} if not set + */ + @Nullable + public abstract Integer serverPort(); + + /** + * Returns the library metadata associated with the RPC. + * + *

        See {@link LibraryMetadata} for examples of how this maps to observability attributes. + * + * @return the library metadata + */ + abstract LibraryMetadata libraryMetadata(); + + /** + * Returns the RPC system name based on the transport. + * + *

        Example: "grpc" or "http". This maps to the {@code rpc.system.name} attribute. + * + * @return the RPC system name, or {@code null} if the transport is not set + */ + @Nullable + String rpcSystemName() { + if (transport() == null) { + return null; + } + return transport().label; + } + + /** + * Returns the full name of the RPC method. Used in gRPC requests. + * + *

        This is typically in the format "package.Service/Method" + * + *

        Example: "google.pubsub.v1.Publisher/Publish". This maps to the {@code rpc.method} + * attribute. + * + * @return the full method name, or {@code null} if not set + */ + @Nullable + abstract String fullMethodName(); + + /** + * Returns the transport protocol used for the RPC. + * + *

        Example: {@link Transport#GRPC}. This is used to derive the {@code rpc.system.name} + * attribute (e.g., "grpc"). + * + * @return the transport protocol, or {@code null} if not set + */ + @Nullable + abstract Transport transport(); + + /** + * Returns the type of operation the {@link ApiTracer} is tracing. + * + * @return the operation type, or {@code null} if not set + */ + @Nullable + public abstract OperationType operationType(); + + /** + * Returns the HTTP method used for the RPC, in case the RPC is an HttpJson method. + * + *

        Example: {@code PATCH}. + * + * @return the HTTP method, or {@code null} if not set + */ + @Nullable + abstract String httpMethod(); + + /** + * Returns the HTTP path template used for the RPC, in case the RPC is an HttpJson method. + * + *

        Example: {@code /users/{user_id}/get}. + * + * @return the HTTP path template, or {@code null} if not set + */ + @Nullable + abstract String httpPathTemplate(); + + /** The service name of a client (e.g. "bigtable", "spanner"). */ + @Nullable + public abstract String serviceName(); + + /** The url domain of the request (e.g. "pubsub.googleapis.com"). */ + @Nullable + public abstract String urlDomain(); + + /** The destination resource id of the request (e.g. projects/p/locations/l/topics/t). */ + @Nullable + public abstract String destinationResourceId(); + + /** + * @return a map of attributes to be included in attempt-level spans + */ + public Map getAttemptAttributes() { + Map attributes = new HashMap<>(); + if (!Strings.isNullOrEmpty(serverAddress())) { + attributes.put(ObservabilityAttributes.SERVER_ADDRESS_ATTRIBUTE, serverAddress()); + } + if (serverPort() != null) { + attributes.put(ObservabilityAttributes.SERVER_PORT_ATTRIBUTE, serverPort()); + } + if (rpcSystemName() != null) { + attributes.put(ObservabilityAttributes.RPC_SYSTEM_NAME_ATTRIBUTE, rpcSystemName()); + } + if (!libraryMetadata().isEmpty()) { + if (!Strings.isNullOrEmpty(libraryMetadata().repository())) { + attributes.put(ObservabilityAttributes.REPO_ATTRIBUTE, libraryMetadata().repository()); + } + if (!Strings.isNullOrEmpty(libraryMetadata().artifactName())) { + attributes.put( + ObservabilityAttributes.ARTIFACT_ATTRIBUTE, libraryMetadata().artifactName()); + } + if (!Strings.isNullOrEmpty(libraryMetadata().version())) { + attributes.put(ObservabilityAttributes.VERSION_ATTRIBUTE, libraryMetadata().version()); + } + } + if (transport() == Transport.GRPC && !Strings.isNullOrEmpty(fullMethodName())) { + attributes.put(ObservabilityAttributes.GRPC_RPC_METHOD_ATTRIBUTE, fullMethodName()); + } + if (transport() == Transport.HTTP) { + if (!Strings.isNullOrEmpty(httpMethod())) { + attributes.put(ObservabilityAttributes.HTTP_METHOD_ATTRIBUTE, httpMethod()); + } + if (!Strings.isNullOrEmpty(httpPathTemplate())) { + attributes.put(ObservabilityAttributes.HTTP_URL_TEMPLATE_ATTRIBUTE, httpPathTemplate()); + } + } + if (!Strings.isNullOrEmpty(destinationResourceId())) { + attributes.put( + ObservabilityAttributes.DESTINATION_RESOURCE_ID_ATTRIBUTE, destinationResourceId()); + } + return attributes; + } + + Map getMetricsAttributes() { + Map attributes = new HashMap<>(); + if (!Strings.isNullOrEmpty(serverAddress())) { + attributes.put(ObservabilityAttributes.SERVER_ADDRESS_ATTRIBUTE, serverAddress()); + } + if (serverPort() != null) { + attributes.put(ObservabilityAttributes.SERVER_PORT_ATTRIBUTE, serverPort()); + } + if (!Strings.isNullOrEmpty(serviceName())) { + attributes.put(ObservabilityAttributes.GCP_CLIENT_SERVICE_ATTRIBUTE, serviceName()); + } + if (!Strings.isNullOrEmpty(rpcSystemName())) { + attributes.put(ObservabilityAttributes.RPC_SYSTEM_NAME_ATTRIBUTE, rpcSystemName()); + } + if (!Strings.isNullOrEmpty(fullMethodName())) { + attributes.put(ObservabilityAttributes.GRPC_RPC_METHOD_ATTRIBUTE, fullMethodName()); + } + if (transport() == Transport.HTTP) { + if (!Strings.isNullOrEmpty(urlDomain())) { + attributes.put(ObservabilityAttributes.URL_DOMAIN_ATTRIBUTE, urlDomain()); + } + if (!Strings.isNullOrEmpty(httpPathTemplate())) { + attributes.put(ObservabilityAttributes.URL_TEMPLATE_ATTRIBUTE, httpPathTemplate()); + } + } + return attributes; + } + + /** + * Merges this context with another context. The values in the other context take precedence. + * + * @param other the other context to merge with + * @return a new {@link ApiTracerContext} with merged values + */ + ApiTracerContext merge(ApiTracerContext other) { + Builder builder = toBuilder(); + if (!Strings.isNullOrEmpty(other.serverAddress())) { + builder.setServerAddress(other.serverAddress()); + } + if (other.serverPort() != null) { + builder.setServerPort(other.serverPort()); + } + if (!other.libraryMetadata().isEmpty()) { + builder.setLibraryMetadata(other.libraryMetadata()); + } + if (!Strings.isNullOrEmpty(other.fullMethodName())) { + builder.setFullMethodName(other.fullMethodName()); + } + if (other.transport() != null) { + builder.setTransport(other.transport()); + } + if (!Strings.isNullOrEmpty(other.httpMethod())) { + builder.setHttpMethod(other.httpMethod()); + } + if (!Strings.isNullOrEmpty(other.httpPathTemplate())) { + builder.setHttpPathTemplate(other.httpPathTemplate()); + } + if (other.operationType() != null) { + builder.setOperationType(other.operationType()); + } + if (!Strings.isNullOrEmpty(other.serviceName())) { + builder.setServiceName(other.serviceName()); + } + if (!Strings.isNullOrEmpty(other.urlDomain())) { + builder.setUrlDomain(other.urlDomain()); + } + if (other.destinationResourceId() != null) { + builder.setDestinationResourceId(other.destinationResourceId()); + } + return builder.build(); + } + + public static ApiTracerContext empty() { + return newBuilder().setLibraryMetadata(LibraryMetadata.empty()).build(); + } + + public static Builder newBuilder() { + return new AutoValue_ApiTracerContext.Builder(); + } + + public abstract Builder toBuilder(); + + @AutoValue.Builder + public abstract static class Builder { + public abstract Builder setServerAddress(@Nullable String serverAddress); + + public abstract Builder setLibraryMetadata(LibraryMetadata gapicProperties); + + public abstract Builder setFullMethodName(@Nullable String rpcMethod); + + public abstract Builder setTransport(@Nullable Transport transport); + + public abstract Builder setOperationType(@Nullable OperationType operationType); + + public abstract Builder setServerPort(@Nullable Integer serverPort); + + public abstract Builder setHttpMethod(@Nullable String httpMethod); + + public abstract Builder setHttpPathTemplate(@Nullable String rawString); + + public abstract Builder setServiceName(@Nullable String serviceName); + + public abstract Builder setUrlDomain(@Nullable String urlDomain); + + public abstract Builder setDestinationResourceId(@Nullable String destinationResourceId); + + public abstract ApiTracerContext build(); + } +} diff --git a/gax-java/gax/src/main/java/com/google/api/gax/tracing/ApiTracerFactory.java b/gax-java/gax/src/main/java/com/google/api/gax/tracing/ApiTracerFactory.java index bb8345b88c..2d763440db 100644 --- a/gax-java/gax/src/main/java/com/google/api/gax/tracing/ApiTracerFactory.java +++ b/gax-java/gax/src/main/java/com/google/api/gax/tracing/ApiTracerFactory.java @@ -61,4 +61,33 @@ enum OperationType { * @param operationType the type of operation that the tracer will trace */ ApiTracer newTracer(ApiTracer parent, SpanName spanName, OperationType operationType); + + /** + * Create a new {@link ApiTracer} that will be a child of the current context. + * + * @param parent the parent of this tracer + * @param tracerContext the method-definition-specific tracer context + */ + default ApiTracer newTracer(ApiTracer parent, ApiTracerContext tracerContext) { + SpanName spanName = SpanName.of(tracerContext); + return newTracer(parent, spanName, tracerContext.operationType()); + } + + /** + * @return the {@link ApiTracerContext} for this factory + */ + default ApiTracerContext getApiTracerContext() { + return ApiTracerContext.empty(); + } + + /** + * Returns a new {@link ApiTracerFactory} that will use the provided context to infer attributes + * for all tracers created by the factory. + * + * @param context an {@link ApiTracerContext} object containing information to construct + * attributes + */ + default ApiTracerFactory withContext(ApiTracerContext context) { + return this; + } } diff --git a/gax-java/gax/src/main/java/com/google/api/gax/tracing/BaseApiTracer.java b/gax-java/gax/src/main/java/com/google/api/gax/tracing/BaseApiTracer.java index 538708b879..cffa4c744e 100644 --- a/gax-java/gax/src/main/java/com/google/api/gax/tracing/BaseApiTracer.java +++ b/gax-java/gax/src/main/java/com/google/api/gax/tracing/BaseApiTracer.java @@ -30,10 +30,13 @@ package com.google.api.gax.tracing; import com.google.api.core.InternalApi; -import org.threeten.bp.Duration; +import com.google.api.core.ObsoleteApi; /** - * A base implementation of {@link ApiTracer} that does nothing. + * A base implementation of {@link ApiTracer} that does nothing. With the deprecation of Java 7 + * support, all the methods in {@link ApiTracer} are now made default, we no longer need a base + * class that does nothing. This class should be removed once all the references to it are removed + * in Google Cloud Client Libraries. * *

        For internal use only. */ @@ -100,8 +103,13 @@ public void attemptCancelled() { // noop } + /** + * This method is obsolete. Use {@link #attemptFailedDuration(Throwable, java.time.Duration)} + * instead. + */ @Override - public void attemptFailed(Throwable error, Duration delay) { + @ObsoleteApi("Use attemptFailedDuration(Throwable, java.time.Duration) instead") + public void attemptFailed(Throwable error, org.threeten.bp.Duration delay) { // noop } diff --git a/gax-java/gax/src/main/java/com/google/api/gax/tracing/GoldenSignalsMetricsRecorder.java b/gax-java/gax/src/main/java/com/google/api/gax/tracing/GoldenSignalsMetricsRecorder.java new file mode 100644 index 0000000000..299a2cdb33 --- /dev/null +++ b/gax-java/gax/src/main/java/com/google/api/gax/tracing/GoldenSignalsMetricsRecorder.java @@ -0,0 +1,72 @@ +/* + * Copyright 2026 Google LLC + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Google LLC nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +package com.google.api.gax.tracing; + +import io.opentelemetry.api.OpenTelemetry; +import io.opentelemetry.api.metrics.DoubleHistogram; +import io.opentelemetry.api.metrics.Meter; +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +/** + * This class takes an OpenTelemetry object, and creates instruments (meters, histograms etc.) from + * it for recording golden signal metrics. There must be only one instance of + * GoldenSignalsMetricsRecorder per client, all the methods in this class are expected to be called + * from multiple threads, hence they need to be thread safe. + */ +class GoldenSignalsMetricsRecorder { + static final String CLIENT_REQUEST_DURATION_METRIC_NAME = "gcp.client.request.duration"; + static final String CLIENT_REQUEST_DURATION_METRIC_DESCRIPTION = + "Measures the total time taken for a logical client request, including any retries, backoff, and pre/post-processing"; + + static final List BOUNDARIES = + Arrays.asList( + 0.0, 0.0001, 0.0005, 0.0010, 0.005, 0.010, 0.050, 0.100, 0.5, 1.0, 5.0, 10.0, 60.0, 300.0, + 900.0, 3600.0); + final DoubleHistogram clientRequestDurationRecorder; + + GoldenSignalsMetricsRecorder(OpenTelemetry openTelemetry, String libraryName) { + Meter meter = openTelemetry.meterBuilder(libraryName).build(); + + this.clientRequestDurationRecorder = + meter + .histogramBuilder(CLIENT_REQUEST_DURATION_METRIC_NAME) + .setDescription(CLIENT_REQUEST_DURATION_METRIC_DESCRIPTION) + .setUnit("s") + .setExplicitBucketBoundariesAdvice(BOUNDARIES) + .build(); + } + + void recordOperationLatency(double operationLatency, Map attributes) { + clientRequestDurationRecorder.record( + operationLatency, ObservabilityUtils.toOtelAttributes(attributes)); + } +} diff --git a/gax-java/gax/src/main/java/com/google/api/gax/tracing/GoldenSignalsMetricsTracer.java b/gax-java/gax/src/main/java/com/google/api/gax/tracing/GoldenSignalsMetricsTracer.java new file mode 100644 index 0000000000..21d9d7093b --- /dev/null +++ b/gax-java/gax/src/main/java/com/google/api/gax/tracing/GoldenSignalsMetricsTracer.java @@ -0,0 +1,95 @@ +/* + * Copyright 2026 Google LLC + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Google LLC nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +package com.google.api.gax.tracing; + +import static com.google.api.gax.tracing.ObservabilityAttributes.RPC_RESPONSE_STATUS_ATTRIBUTE; + +import com.google.api.gax.rpc.StatusCode; +import com.google.common.annotations.VisibleForTesting; +import com.google.common.base.Stopwatch; +import com.google.common.base.Ticker; +import java.util.HashMap; +import java.util.Map; +import java.util.concurrent.TimeUnit; + +/** + * This class computes golden signal metrics that can be observed in the lifecycle of an RPC + * operation. The responsibility of recording metrics should delegate to {@link + * GoldenSignalsMetricsRecorder}, hence this class should not have any knowledge about the + * observability framework (e.g. OpenTelemetry). + */ +class GoldenSignalsMetricsTracer implements ApiTracer { + private final Stopwatch clientRequestTimer; + private final GoldenSignalsMetricsRecorder metricsRecorder; + private final Map attributes; + + GoldenSignalsMetricsTracer( + GoldenSignalsMetricsRecorder metricsRecorder, ApiTracerContext apiTracerContext) { + this.clientRequestTimer = Stopwatch.createStarted(); + this.metricsRecorder = metricsRecorder; + this.attributes = apiTracerContext.getMetricsAttributes(); + } + + @VisibleForTesting + GoldenSignalsMetricsTracer( + GoldenSignalsMetricsRecorder metricsRecorder, + ApiTracerContext apiTracerContext, + Ticker ticker) { + this.clientRequestTimer = Stopwatch.createStarted(ticker); + this.metricsRecorder = metricsRecorder; + this.attributes = new HashMap<>(apiTracerContext.getMetricsAttributes()); + } + + /** + * The concept of "operation" and "client request" are the same. They both represent the total + * time taken for a logical client request, including any retries, backoff, and + * pre/post-processing + */ + @Override + public void operationSucceeded() { + attributes.put(RPC_RESPONSE_STATUS_ATTRIBUTE, StatusCode.Code.OK.toString()); + metricsRecorder.recordOperationLatency( + clientRequestTimer.elapsed(TimeUnit.NANOSECONDS) / 1_000_000_000.0, attributes); + } + + @Override + public void operationCancelled() { + attributes.put(RPC_RESPONSE_STATUS_ATTRIBUTE, StatusCode.Code.CANCELLED.toString()); + metricsRecorder.recordOperationLatency( + clientRequestTimer.elapsed(TimeUnit.NANOSECONDS) / 1_000_000_000.0, attributes); + } + + @Override + public void operationFailed(Throwable error) { + attributes.put(RPC_RESPONSE_STATUS_ATTRIBUTE, ObservabilityUtils.extractStatus(error)); + metricsRecorder.recordOperationLatency( + clientRequestTimer.elapsed(TimeUnit.NANOSECONDS) / 1_000_000_000.0, attributes); + } +} diff --git a/gax-java/gax/src/main/java/com/google/api/gax/tracing/GoldenSignalsMetricsTracerFactory.java b/gax-java/gax/src/main/java/com/google/api/gax/tracing/GoldenSignalsMetricsTracerFactory.java new file mode 100644 index 0000000000..53b8998a86 --- /dev/null +++ b/gax-java/gax/src/main/java/com/google/api/gax/tracing/GoldenSignalsMetricsTracerFactory.java @@ -0,0 +1,83 @@ +/* + * Copyright 2026 Google LLC + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Google LLC nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +package com.google.api.gax.tracing; + +import com.google.api.core.BetaApi; +import com.google.api.core.InternalApi; +import io.opentelemetry.api.OpenTelemetry; + +/** + * A {@link ApiTracerFactory} to build instances of {@link GoldenSignalsMetricsTracer}. + * + *

        This class is expected to be initialized once during client initialization. + */ +@BetaApi +@InternalApi +public class GoldenSignalsMetricsTracerFactory implements ApiTracerFactory { + + private ApiTracerContext clientLevelTracerContext; + private final OpenTelemetry openTelemetry; + private GoldenSignalsMetricsRecorder metricsRecorder; + + public GoldenSignalsMetricsTracerFactory(OpenTelemetry openTelemetry) { + this.openTelemetry = openTelemetry; + this.clientLevelTracerContext = ApiTracerContext.empty(); + } + + @Override + public ApiTracer newTracer(ApiTracer parent, SpanName spanName, OperationType operationType) { + if (metricsRecorder == null) { + // This should never happen, in case it happens, create a no-op api tracer to not block + // regular requests. + return new BaseApiTracer(); + } + return new GoldenSignalsMetricsTracer(metricsRecorder, clientLevelTracerContext); + } + + @Override + public ApiTracer newTracer(ApiTracer parent, ApiTracerContext methodLevelTracerContext) { + if (metricsRecorder == null) { + // This should never happen, in case it happens, create a no-op api tracer to not block + // regular requests. + return new BaseApiTracer(); + } + ApiTracerContext mergedTracerContext = clientLevelTracerContext.merge(methodLevelTracerContext); + return new GoldenSignalsMetricsTracer(metricsRecorder, mergedTracerContext); + } + + @Override + public ApiTracerFactory withContext(ApiTracerContext context) { + this.clientLevelTracerContext = context; + this.metricsRecorder = + new GoldenSignalsMetricsRecorder( + openTelemetry, clientLevelTracerContext.libraryMetadata().artifactName()); + return this; + } +} diff --git a/gax-java/gax/src/main/java/com/google/api/gax/tracing/MethodName.java b/gax-java/gax/src/main/java/com/google/api/gax/tracing/MethodName.java new file mode 100644 index 0000000000..1581c0ed38 --- /dev/null +++ b/gax-java/gax/src/main/java/com/google/api/gax/tracing/MethodName.java @@ -0,0 +1,65 @@ +/* + * Copyright 2024 Google LLC + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Google LLC nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +package com.google.api.gax.tracing; + +import com.google.api.core.BetaApi; +import com.google.api.core.InternalApi; +import com.google.api.gax.rpc.StubSettings; +import com.google.auto.value.AutoValue; + +/** A value class to represent the name of the RPC method in an {@link ApiTracer}. */ +@BetaApi +@InternalApi +@AutoValue +public abstract class MethodName { + /** + * Creates a new instance of the RPC method name. + * + * @param serviceName The name of the service. In general this will be GAPIC generated service + * name {@link StubSettings#getServiceName()}. However, in some cases, when the GAPIC + * generated service is wrapped, this will be overridden to specify the manually written + * wrapper's name. + * @param methodName The name of the logical operation being traced. + */ + public static MethodName of(String serviceName, String methodName) { + return new AutoValue_MethodName(serviceName, methodName); + } + + /** The name of the service. ie BigtableData */ + public abstract String getServiceName(); + + /** The name of the logical operation being traced. ie. ReadRows. */ + public abstract String getMethodName(); + + @Override + public String toString() { + return getServiceName() + "." + getMethodName(); + } +} diff --git a/gax-java/gax/src/main/java/com/google/api/gax/tracing/MetricsRecorder.java b/gax-java/gax/src/main/java/com/google/api/gax/tracing/MetricsRecorder.java new file mode 100644 index 0000000000..d2e221fb5b --- /dev/null +++ b/gax-java/gax/src/main/java/com/google/api/gax/tracing/MetricsRecorder.java @@ -0,0 +1,61 @@ +/* + * Copyright 2024 Google LLC + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Google LLC nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +package com.google.api.gax.tracing; + +import com.google.api.core.BetaApi; +import com.google.api.core.InternalApi; +import java.util.Map; + +/** + * Provides an interface for metrics recording. The implementer is expected to use an observability + * framework, e.g. OpenTelemetry. There should be only one instance of MetricsRecorder per client, + * all the methods in this class are expected to be called from multiple threads, hence the + * implementation must be thread safe. + */ +@BetaApi +@InternalApi +public interface MetricsRecorder { + + /** Records the latency of an RPC attempt */ + default void recordAttemptLatency(double attemptLatency, Map attributes) {} + + /** Records the count of RPC attempts */ + default void recordAttemptCount(long count, Map attributes) {} + + /** + * Records the total end-to-end latency for an operation, including the initial RPC attempts and + * subsequent retries. + */ + default void recordOperationLatency(double operationLatency, Map attributes) {} + + /** Records the count of operations */ + default void recordOperationCount(long count, Map attributes) {} +} diff --git a/gax-java/gax/src/main/java/com/google/api/gax/tracing/MetricsTracer.java b/gax-java/gax/src/main/java/com/google/api/gax/tracing/MetricsTracer.java new file mode 100644 index 0000000000..e9ad908c21 --- /dev/null +++ b/gax-java/gax/src/main/java/com/google/api/gax/tracing/MetricsTracer.java @@ -0,0 +1,242 @@ +/* + * Copyright 2024 Google LLC + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Google LLC nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +package com.google.api.gax.tracing; + +import static com.google.api.gax.util.TimeConversionUtils.toJavaTimeDuration; + +import com.google.api.core.BetaApi; +import com.google.api.core.InternalApi; +import com.google.api.core.ObsoleteApi; +import com.google.api.gax.rpc.StatusCode; +import com.google.common.annotations.VisibleForTesting; +import com.google.common.base.Stopwatch; +import java.util.HashMap; +import java.util.Map; +import java.util.concurrent.TimeUnit; +import java.util.concurrent.atomic.AtomicBoolean; + +/** + * This class computes generic metrics that can be observed in the lifecycle of an RPC operation. + * The responsibility of recording metrics should delegate to {@link MetricsRecorder}, hence this + * class should not have any knowledge about the observability framework used for metrics recording. + * method_name and language will be autopopulated attributes. Default value of language is 'Java'. + */ +@BetaApi +@InternalApi +public class MetricsTracer implements ApiTracer { + public static final String METHOD_ATTRIBUTE = "method"; + public static final String LANGUAGE_ATTRIBUTE = "language"; + public static final String STATUS_ATTRIBUTE = "status"; + public static final String DEFAULT_LANGUAGE = "Java"; + private static final String OPERATION_FINISHED_STATUS_MESSAGE = + "Operation has already been completed"; + private Stopwatch attemptTimer; + private final Stopwatch operationTimer = Stopwatch.createStarted(); + // These are RPC specific attributes and pertain to a specific API Trace + private final Map attributes = new HashMap<>(); + private final MetricsRecorder metricsRecorder; + private final AtomicBoolean operationFinished; + + public MetricsTracer(MethodName methodName, MetricsRecorder metricsRecorder) { + this.attributes.put(METHOD_ATTRIBUTE, methodName.toString()); + this.attributes.put(LANGUAGE_ATTRIBUTE, DEFAULT_LANGUAGE); + this.metricsRecorder = metricsRecorder; + this.operationFinished = new AtomicBoolean(); + } + + /** + * Signals that the overall operation has finished successfully. The tracer is now considered + * closed and should no longer be used. Successful operation adds "OK" value to the status + * attribute key. + * + * @throws IllegalStateException if an operation completion call has already been invoked + */ + @Override + public void operationSucceeded() { + if (operationFinished.getAndSet(true)) { + throw new IllegalStateException(OPERATION_FINISHED_STATUS_MESSAGE); + } + attributes.put(STATUS_ATTRIBUTE, StatusCode.Code.OK.toString()); + metricsRecorder.recordOperationLatency( + operationTimer.elapsed(TimeUnit.MILLISECONDS), attributes); + metricsRecorder.recordOperationCount(1, attributes); + } + + /** + * Signals that the operation was cancelled by the user. The tracer is now considered closed and + * should no longer be used. Cancelled operation adds "CANCELLED" value to the status attribute + * key. + * + * @throws IllegalStateException if an operation completion call has already been invoked + */ + @Override + public void operationCancelled() { + if (operationFinished.getAndSet(true)) { + throw new IllegalStateException(OPERATION_FINISHED_STATUS_MESSAGE); + } + attributes.put(STATUS_ATTRIBUTE, StatusCode.Code.CANCELLED.toString()); + metricsRecorder.recordOperationLatency( + operationTimer.elapsed(TimeUnit.MILLISECONDS), attributes); + metricsRecorder.recordOperationCount(1, attributes); + } + + /** + * Signals that the operation was cancelled by the user. The tracer is now considered closed and + * should no longer be used. Failed operation extracts the error from the throwable and adds it to + * the status attribute key. + * + * @throws IllegalStateException if an operation completion call has already been invoked + */ + @Override + public void operationFailed(Throwable error) { + if (operationFinished.getAndSet(true)) { + throw new IllegalStateException(OPERATION_FINISHED_STATUS_MESSAGE); + } + attributes.put(STATUS_ATTRIBUTE, ObservabilityUtils.extractStatus(error)); + metricsRecorder.recordOperationLatency( + operationTimer.elapsed(TimeUnit.MILLISECONDS), attributes); + metricsRecorder.recordOperationCount(1, attributes); + } + + /** + * Adds an annotation that an attempt is about to start with additional information from the + * request. In general this should occur at the very start of the operation. The attemptNumber is + * zero based. So the initial attempt will be 0. When the attempt starts, the attemptTimer starts + * the stopwatch. + * + * @param attemptNumber the zero based sequential attempt number. + * @param request request of this attempt. + */ + @Override + public void attemptStarted(Object request, int attemptNumber) { + attemptTimer = Stopwatch.createStarted(); + } + + /** + * Adds an annotation that the attempt succeeded. Successful attempt add "OK" value to the status + * attribute key. + */ + @Override + public void attemptSucceeded() { + attributes.put(STATUS_ATTRIBUTE, StatusCode.Code.OK.toString()); + metricsRecorder.recordAttemptLatency(attemptTimer.elapsed(TimeUnit.MILLISECONDS), attributes); + metricsRecorder.recordAttemptCount(1, attributes); + } + + /** + * Add an annotation that the attempt was cancelled by the user. Cancelled attempt add "CANCELLED" + * to the status attribute key. + */ + @Override + public void attemptCancelled() { + attributes.put(STATUS_ATTRIBUTE, StatusCode.Code.CANCELLED.toString()); + metricsRecorder.recordAttemptLatency(attemptTimer.elapsed(TimeUnit.MILLISECONDS), attributes); + metricsRecorder.recordAttemptCount(1, attributes); + } + + /** + * Adds an annotation that the attempt failed, but another attempt will be made after the delay. + * + * @param error the error that caused the attempt to fail. + * @param delay the amount of time to wait before the next attempt will start. + *

        Failed attempt extracts the error from the throwable and adds it to the status attribute + * key. + */ + @Override + public void attemptFailedDuration(Throwable error, java.time.Duration delay) { + attributes.put(STATUS_ATTRIBUTE, ObservabilityUtils.extractStatus(error)); + metricsRecorder.recordAttemptLatency(attemptTimer.elapsed(TimeUnit.MILLISECONDS), attributes); + metricsRecorder.recordAttemptCount(1, attributes); + } + + /** + * This method is obsolete. Use {@link #attemptFailedDuration(Throwable, java.time.Duration)} + * instead. + */ + @Override + @ObsoleteApi("Use attemptFailedDuration(Throwable, java.time.Duration) instead") + public void attemptFailed(Throwable error, org.threeten.bp.Duration delay) { + attemptFailedDuration(error, toJavaTimeDuration(delay)); + } + + /** + * Adds an annotation that the attempt failed and that no further attempts will be made because + * retry limits have been reached. This extracts the error from the throwable and adds it to the + * status attribute key. + * + * @param error the last error received before retries were exhausted. + */ + @Override + public void attemptFailedRetriesExhausted(Throwable error) { + attributes.put(STATUS_ATTRIBUTE, ObservabilityUtils.extractStatus(error)); + metricsRecorder.recordAttemptLatency(attemptTimer.elapsed(TimeUnit.MILLISECONDS), attributes); + metricsRecorder.recordAttemptCount(1, attributes); + } + + /** + * Adds an annotation that the attempt failed and that no further attempts will be made because + * the last error was not retryable. This extracts the error from the throwable and adds it to the + * status attribute key. + * + * @param error the error that caused the final attempt to fail. + */ + @Override + public void attemptPermanentFailure(Throwable error) { + attributes.put(STATUS_ATTRIBUTE, ObservabilityUtils.extractStatus(error)); + metricsRecorder.recordAttemptLatency(attemptTimer.elapsed(TimeUnit.MILLISECONDS), attributes); + metricsRecorder.recordAttemptCount(1, attributes); + } + + /** + * Add attributes that will be attached to all metrics. This is expected to be called by + * handwritten client teams to add additional attributes that are not supposed be collected by + * Gax. + */ + public void addAttributes(String key, String value) { + attributes.put(key, value); + } + ; + + /** + * Add attributes that will be attached to all metrics. This is expected to be called by + * handwritten client teams to add additional attributes that are not supposed be collected by + * Gax. + */ + public void addAttributes(Map attributes) { + this.attributes.putAll(attributes); + } + ; + + @VisibleForTesting + Map getAttributes() { + return attributes; + } +} diff --git a/gax-java/gax/src/main/java/com/google/api/gax/tracing/MetricsTracerFactory.java b/gax-java/gax/src/main/java/com/google/api/gax/tracing/MetricsTracerFactory.java new file mode 100644 index 0000000000..3f826040a4 --- /dev/null +++ b/gax-java/gax/src/main/java/com/google/api/gax/tracing/MetricsTracerFactory.java @@ -0,0 +1,77 @@ +/* + * Copyright 2024 Google LLC + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Google LLC nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +package com.google.api.gax.tracing; + +import com.google.api.core.BetaApi; +import com.google.api.core.InternalApi; +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import java.util.Map; + +/** + * A {@link ApiTracerFactory} to build instances of {@link MetricsTracer}. + * + *

        This class wraps the {@link MetricsRecorder} and pass it to {@link MetricsTracer}. It will be + * used to record metrics in {@link MetricsTracer}. + * + *

        This class is expected to be initialized once during client initialization. + */ +@BetaApi +@InternalApi +public class MetricsTracerFactory implements ApiTracerFactory { + protected MetricsRecorder metricsRecorder; + + /** Mapping of client attributes that are set for every MetricsTracer */ + private final Map attributes; + + /** Creates a MetricsTracerFactory with no additional client level attributes. */ + public MetricsTracerFactory(MetricsRecorder metricsRecorder) { + this(metricsRecorder, ImmutableMap.of()); + } + + /** + * Pass in a Map of client level attributes which will be added to every single MetricsTracer + * created from the ApiTracerFactory. + */ + public MetricsTracerFactory(MetricsRecorder metricsRecorder, Map attributes) { + this.metricsRecorder = metricsRecorder; + this.attributes = ImmutableMap.copyOf(attributes); + } + + @Override + public ApiTracer newTracer(ApiTracer parent, SpanName spanName, OperationType operationType) { + Preconditions.checkNotNull(operationType, "operationType cannot be null."); + MetricsTracer metricsTracer = + new MetricsTracer( + MethodName.of(spanName.getClientName(), spanName.getMethodName()), metricsRecorder); + attributes.forEach(metricsTracer::addAttributes); + return metricsTracer; + } +} diff --git a/gax-java/gax/src/main/java/com/google/api/gax/tracing/ObservabilityAttributes.java b/gax-java/gax/src/main/java/com/google/api/gax/tracing/ObservabilityAttributes.java new file mode 100644 index 0000000000..64095fde00 --- /dev/null +++ b/gax-java/gax/src/main/java/com/google/api/gax/tracing/ObservabilityAttributes.java @@ -0,0 +1,96 @@ +/* + * Copyright 2026 Google LLC + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Google LLC nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +package com.google.api.gax.tracing; + +import com.google.api.core.BetaApi; +import com.google.api.core.InternalApi; + +/** + * Utility class with common attribute names in app-centric observability. + * + *

        For internal use only. + */ +@InternalApi +@BetaApi +public class ObservabilityAttributes { + /** The address of the server being called (e.g., "pubsub.googleapis.com"). */ + public static final String SERVER_ADDRESS_ATTRIBUTE = "server.address"; + + /** The port of the server being called (e.g., 443). */ + public static final String SERVER_PORT_ATTRIBUTE = "server.port"; + + /** The repository of the client library (e.g., "googleapis/google-cloud-java"). */ + public static final String REPO_ATTRIBUTE = "gcp.client.repo"; + + /** The artifact name of the client library (e.g., "google-cloud-vision"). */ + public static final String ARTIFACT_ATTRIBUTE = "gcp.client.artifact"; + + /** The version of the client library (e.g., "1.2.3"). */ + public static final String VERSION_ATTRIBUTE = "gcp.client.version"; + + /** The full RPC method name, including package, service, and method. */ + public static final String GRPC_RPC_METHOD_ATTRIBUTE = "rpc.method"; + + /** The RPC system name, e.g. 'grpc' or 'http'. */ + public static final String RPC_SYSTEM_NAME_ATTRIBUTE = "rpc.system.name"; + + /** The HTTP method of the request (e.g., "GET"). Only used in HTTP transport. */ + public static final String HTTP_METHOD_ATTRIBUTE = "http.request.method"; + + /** + * The HTTP URL template of the request (e.g. "/v1/{name}:access"). Only used in HTTP transport. + */ + public static final String HTTP_URL_TEMPLATE_ATTRIBUTE = "url.template"; + + /** + * The error codes of the request. The value will be the string representation of the canonical + * gRPC status code (e.g., "OK", "INTERNAL"). + */ + public static final String RPC_RESPONSE_STATUS_ATTRIBUTE = "rpc.response.status_code"; + + /** The service name of a client (e.g. "bigtable", "spanner"). */ + public static final String GCP_CLIENT_SERVICE_ATTRIBUTE = "gcp.client.service"; + + /** The url domain of the request (e.g. "pubsub.googleapis.com"). */ + public static final String URL_DOMAIN_ATTRIBUTE = "url.domain"; + + /** The url template of the request (e.g. /v1/{name}:access). */ + public static final String URL_TEMPLATE_ATTRIBUTE = "url.template"; + + /** The resend count of the request. Only used in HTTP transport. */ + public static final String HTTP_RESEND_COUNT_ATTRIBUTE = "http.request.resend_count"; + + /** The resend count of the request. Only used in gRPC transport. */ + public static final String GRPC_RESEND_COUNT_ATTRIBUTE = "gcp.grpc.resend_count"; + + /** The destination resource id of the request (e.g. projects/p/locations/l/topics/t). */ + public static final String DESTINATION_RESOURCE_ID_ATTRIBUTE = "gcp.resource.destination.id"; +} diff --git a/gax-java/gax/src/main/java/com/google/api/gax/tracing/ObservabilityUtils.java b/gax-java/gax/src/main/java/com/google/api/gax/tracing/ObservabilityUtils.java new file mode 100644 index 0000000000..2487964370 --- /dev/null +++ b/gax-java/gax/src/main/java/com/google/api/gax/tracing/ObservabilityUtils.java @@ -0,0 +1,76 @@ +/* + * Copyright 2026 Google LLC + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Google LLC nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +package com.google.api.gax.tracing; + +import com.google.api.gax.rpc.ApiException; +import com.google.api.gax.rpc.StatusCode; +import io.opentelemetry.api.common.Attributes; +import io.opentelemetry.api.common.AttributesBuilder; +import java.util.Map; +import java.util.concurrent.CancellationException; +import javax.annotation.Nullable; + +class ObservabilityUtils { + + /** Function to extract the status of the error as a string */ + static String extractStatus(@Nullable Throwable error) { + final String statusString; + + if (error == null) { + return StatusCode.Code.OK.toString(); + } else if (error instanceof CancellationException) { + statusString = StatusCode.Code.CANCELLED.toString(); + } else if (error instanceof ApiException) { + statusString = ((ApiException) error).getStatusCode().getCode().toString(); + } else { + statusString = StatusCode.Code.UNKNOWN.toString(); + } + + return statusString; + } + + static Attributes toOtelAttributes(Map attributes) { + AttributesBuilder attributesBuilder = Attributes.builder(); + if (attributes == null) { + return attributesBuilder.build(); + } + attributes.forEach( + (k, v) -> { + if (v instanceof String) { + attributesBuilder.put(k, (String) v); + } else if (v instanceof Long) { + attributesBuilder.put(k, (Long) v); + } else if (v instanceof Integer) { + attributesBuilder.put(k, (long) (Integer) v); + } + }); + return attributesBuilder.build(); + } +} diff --git a/gax-java/gax/src/main/java/com/google/api/gax/tracing/OpenTelemetryMetricsRecorder.java b/gax-java/gax/src/main/java/com/google/api/gax/tracing/OpenTelemetryMetricsRecorder.java new file mode 100644 index 0000000000..1da633d60d --- /dev/null +++ b/gax-java/gax/src/main/java/com/google/api/gax/tracing/OpenTelemetryMetricsRecorder.java @@ -0,0 +1,165 @@ +/* + * Copyright 2024 Google LLC + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Google LLC nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +package com.google.api.gax.tracing; + +import com.google.api.core.BetaApi; +import com.google.api.core.InternalApi; +import com.google.api.gax.core.GaxProperties; +import com.google.common.base.Preconditions; +import io.opentelemetry.api.OpenTelemetry; +import io.opentelemetry.api.common.Attributes; +import io.opentelemetry.api.common.AttributesBuilder; +import io.opentelemetry.api.metrics.DoubleHistogram; +import io.opentelemetry.api.metrics.LongCounter; +import io.opentelemetry.api.metrics.Meter; +import java.util.Map; + +/** + * OpenTelemetry implementation of recording metrics. This implementation collections the + * measurements related to the lifecyle of an RPC. + * + *

        For the Otel implementation, an attempt is a single RPC invocation and an operation is the + * collection of all the attempts made before a response is returned (either as a success or an + * error). A single call (i.e. `EchoClient.echo()`) should have an operation_count of 1 and may have + * an attempt_count of 1+ (depending on the retry configurations). + */ +@BetaApi +@InternalApi +public class OpenTelemetryMetricsRecorder implements MetricsRecorder { + + public static final String GAX_METER_NAME = "gax-java"; + private final DoubleHistogram attemptLatencyRecorder; + private final DoubleHistogram operationLatencyRecorder; + private final LongCounter operationCountRecorder; + private final LongCounter attemptCountRecorder; + + /** + * Creates the following instruments for the following metrics: + * + *

          + *
        • Attempt Latency: Histogram + *
        • Operation Latency: Histogram + *
        • Attempt Count: Counter + *
        • Operation Count: Counter + *
        + * + * @param openTelemetry OpenTelemetry instance + * @param serviceName Service Name + */ + public OpenTelemetryMetricsRecorder(OpenTelemetry openTelemetry, String serviceName) { + Meter meter = + openTelemetry + .meterBuilder(GAX_METER_NAME) + .setInstrumentationVersion(GaxProperties.getGaxVersion()) + .build(); + this.attemptLatencyRecorder = + meter + .histogramBuilder(serviceName + "/attempt_latency") + .setDescription("Time an individual attempt took") + .setUnit("ms") + .build(); + this.operationLatencyRecorder = + meter + .histogramBuilder(serviceName + "/operation_latency") + .setDescription( + "Total time until final operation success or failure, including retries and backoff.") + .setUnit("ms") + .build(); + this.attemptCountRecorder = + meter + .counterBuilder(serviceName + "/attempt_count") + .setDescription("Number of Attempts") + .setUnit("1") + .build(); + this.operationCountRecorder = + meter + .counterBuilder(serviceName + "/operation_count") + .setDescription("Number of Operations") + .setUnit("1") + .build(); + } + + /** + * Record the latency for an individual attempt. Data is stored in a Histogram. + * + * @param attemptLatency Attempt Latency in ms + * @param attributes Map of the attributes to store + */ + @Override + public void recordAttemptLatency(double attemptLatency, Map attributes) { + attemptLatencyRecorder.record(attemptLatency, toOtelAttributes(attributes)); + } + + /** + * Record an attempt made. The attempt count number is stored in a LongCounter. + * + *

        The count should be set as 1 every time this is invoked (each retry attempt) + * + * @param count The number of attempts made + * @param attributes Map of the attributes to store + */ + @Override + public void recordAttemptCount(long count, Map attributes) { + attemptCountRecorder.add(count, toOtelAttributes(attributes)); + } + + /** + * Record the latency for the entire operation. This is the latency for the entire RPC, including + * all the retry attempts + * + * @param operationLatency Operation Latency in ms + * @param attributes Map of the attributes to store + */ + @Override + public void recordOperationLatency(double operationLatency, Map attributes) { + operationLatencyRecorder.record(operationLatency, toOtelAttributes(attributes)); + } + + /** + * Record an operation made. The operation count number is stored in a LongCounter. + * + *

        The operation count should always be 1 and this should be invoked once. + * + * @param count The number of operations made + * @param attributes Map of the attributes to store + */ + @Override + public void recordOperationCount(long count, Map attributes) { + operationCountRecorder.add(count, toOtelAttributes(attributes)); + } + + static Attributes toOtelAttributes(Map attributes) { + Preconditions.checkNotNull(attributes, "Attributes map cannot be null"); + AttributesBuilder attributesBuilder = Attributes.builder(); + attributes.forEach(attributesBuilder::put); + return attributesBuilder.build(); + } +} diff --git a/gax-java/gax/src/main/java/com/google/api/gax/tracing/OpencensusTracer.java b/gax-java/gax/src/main/java/com/google/api/gax/tracing/OpencensusTracer.java index ea4c5f9039..c9f6b7cfc7 100644 --- a/gax-java/gax/src/main/java/com/google/api/gax/tracing/OpencensusTracer.java +++ b/gax-java/gax/src/main/java/com/google/api/gax/tracing/OpencensusTracer.java @@ -29,8 +29,11 @@ */ package com.google.api.gax.tracing; +import static com.google.api.gax.util.TimeConversionUtils.toJavaTimeDuration; + import com.google.api.core.BetaApi; import com.google.api.core.InternalApi; +import com.google.api.core.ObsoleteApi; import com.google.api.gax.rpc.ApiException; import com.google.api.gax.rpc.StatusCode; import com.google.api.gax.rpc.StatusCode.Code; @@ -47,7 +50,6 @@ import java.util.Map; import java.util.concurrent.atomic.AtomicLong; import javax.annotation.Nonnull; -import org.threeten.bp.Duration; /** * Implementation of {@link ApiTracer} that uses OpenCensus. @@ -342,7 +344,7 @@ public void attemptCancelled() { /** {@inheritDoc} */ @Override - public void attemptFailed(Throwable error, Duration delay) { + public void attemptFailedDuration(Throwable error, java.time.Duration delay) { Map attributes = baseAttemptAttributes(); attributes.put("delay ms", AttributeValue.longAttributeValue(delay.toMillis())); populateError(attributes, error); @@ -357,6 +359,16 @@ public void attemptFailed(Throwable error, Duration delay) { lastConnectionId = null; } + /** + * This method is obsolete. Use {@link #attemptFailedDuration(Throwable, java.time.Duration)} + * instead. + */ + @Override + @ObsoleteApi("Use attemptFailedDuration(Throwable, java.time.Duration) instead") + public void attemptFailed(Throwable error, org.threeten.bp.Duration delay) { + attemptFailedDuration(error, toJavaTimeDuration(delay)); + } + /** {@inheritDoc} */ @Override public void attemptFailedRetriesExhausted(Throwable error) { diff --git a/gax-java/gax/src/main/java/com/google/api/gax/tracing/OpencensusTracerFactory.java b/gax-java/gax/src/main/java/com/google/api/gax/tracing/OpencensusTracerFactory.java index b9966b1f51..46021b4c69 100644 --- a/gax-java/gax/src/main/java/com/google/api/gax/tracing/OpencensusTracerFactory.java +++ b/gax-java/gax/src/main/java/com/google/api/gax/tracing/OpencensusTracerFactory.java @@ -96,6 +96,7 @@ public OpencensusTracerFactory(Map spanAttributes) { /** {@inheritDoc } */ @Override public ApiTracer newTracer(ApiTracer parent, SpanName spanName, OperationType operationType) { + Preconditions.checkNotNull(operationType, "operationType cannot be null."); // Default to the current in context span. This is used for outermost tracers that inherit // the caller's parent span. Span parentSpan = internalTracer.getCurrentSpan(); diff --git a/gax-java/gax/src/main/java/com/google/api/gax/tracing/SpanName.java b/gax-java/gax/src/main/java/com/google/api/gax/tracing/SpanName.java index da62d7c5aa..efbc91fe89 100644 --- a/gax-java/gax/src/main/java/com/google/api/gax/tracing/SpanName.java +++ b/gax-java/gax/src/main/java/com/google/api/gax/tracing/SpanName.java @@ -32,12 +32,17 @@ import com.google.api.core.BetaApi; import com.google.api.core.InternalApi; import com.google.auto.value.AutoValue; +import com.google.common.base.Preconditions; +import java.util.regex.Matcher; +import java.util.regex.Pattern; /** A value class to represent the name of the operation in an {@link ApiTracer}. */ @BetaApi("Surface for tracing is not yet stable") @InternalApi("For google-cloud-java client use only") @AutoValue public abstract class SpanName { + private static final Pattern FULL_METHOD_NAME_REGEX = Pattern.compile("^.*?([^./]+)/([^./]+)$"); + /** * Creates a new instance of the name. * @@ -50,6 +55,31 @@ public static SpanName of(String clientName, String methodName) { return new AutoValue_SpanName(clientName, methodName); } + /** + * Returns a new {@link SpanName} parsed from the given {@link ApiTracerContext} + * + *

        This is extracted from {@link ApiTracerContext#fullMethodName()} using the {@link + * #FULL_METHOD_NAME_REGEX} + * + *

          + *
        • If {@code fullMethodName()} is "google.pubsub.v1.Publisher/Publish", the client name is + * "Publisher". + *
        • If {@code fullMethodName()} is "google.pubsub.v1.Publisher/Publish", the base method name + * is "Publish". + *
        + * + * @return a new {@link SpanName} with the parsed client name and method name + */ + public static SpanName of(ApiTracerContext apiTracerContext) { + Preconditions.checkState(apiTracerContext.fullMethodName() != null, "rpcMethod must be set"); + + Matcher matcher = FULL_METHOD_NAME_REGEX.matcher(apiTracerContext.fullMethodName()); + + Preconditions.checkArgument( + matcher.matches(), "Invalid rpcMethod: " + apiTracerContext.fullMethodName()); + return new AutoValue_SpanName(matcher.group(1), matcher.group(2)); + } + /** The name of the client. ie BigtableData */ public abstract String getClientName(); diff --git a/gax-java/gax/src/main/java/com/google/api/gax/tracing/SpanTracer.java b/gax-java/gax/src/main/java/com/google/api/gax/tracing/SpanTracer.java new file mode 100644 index 0000000000..a2690359dd --- /dev/null +++ b/gax-java/gax/src/main/java/com/google/api/gax/tracing/SpanTracer.java @@ -0,0 +1,163 @@ +/* + * Copyright 2026 Google LLC + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Google LLC nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +package com.google.api.gax.tracing; + +import com.google.api.core.BetaApi; +import com.google.api.core.InternalApi; +import io.opentelemetry.api.trace.Span; +import io.opentelemetry.api.trace.SpanBuilder; +import io.opentelemetry.api.trace.SpanKind; +import io.opentelemetry.api.trace.Tracer; +import java.util.HashMap; +import java.util.Map; + +/** An implementation of {@link ApiTracer} that uses OpenTelemetry to record traces. */ +@BetaApi +@InternalApi +public class SpanTracer implements ApiTracer { + public static final String LANGUAGE_ATTRIBUTE = "gcp.client.language"; + + public static final String DEFAULT_LANGUAGE = "Java"; + + private final Tracer tracer; + private final Map attemptAttributes; + private final String attemptSpanName; + private final ApiTracerContext apiTracerContext; + private Span attemptSpan; + + /** + * Creates a new instance of {@code SpanTracer}. + * + * @param tracer the {@link Tracer} to use for recording spans + * @param apiTracerContext the {@link ApiTracerContext} to use for recording spans + */ + public SpanTracer(Tracer tracer, ApiTracerContext apiTracerContext) { + this.tracer = tracer; + this.apiTracerContext = apiTracerContext; + this.attemptSpanName = resolveAttemptSpanName(apiTracerContext); + this.attemptAttributes = new HashMap<>(); + buildAttributes(); + } + + /** + * Creates a new instance of {@code SpanTracer} with an explicitly provided span name. + * + * @param tracer the {@link Tracer} to use for recording spans + * @param apiTracerContext the {@link ApiTracerContext} to use for recording spans + * @param attemptSpanName the name of the individual attempt spans + */ + @InternalApi + SpanTracer(Tracer tracer, ApiTracerContext apiTracerContext, String attemptSpanName) { + this.tracer = tracer; + this.attemptSpanName = attemptSpanName; + this.apiTracerContext = apiTracerContext; + this.attemptAttributes = new HashMap<>(); + buildAttributes(); + } + + private static String resolveAttemptSpanName(ApiTracerContext apiTracerContext) { + if (apiTracerContext.transport() == ApiTracerContext.Transport.GRPC) { + // gRPC Uses the full method name as span name. + return apiTracerContext.fullMethodName(); + } else if (apiTracerContext.httpMethod() == null + || apiTracerContext.httpPathTemplate() == null) { + // HTTP method name without necessary components defaults to the full method name + return apiTracerContext.fullMethodName(); + } else { + // We construct the span name with HTTP method and path template. + return String.format( + "%s %s", apiTracerContext.httpMethod(), apiTracerContext.httpPathTemplate()); + } + } + + private void buildAttributes() { + this.attemptAttributes.put(LANGUAGE_ATTRIBUTE, DEFAULT_LANGUAGE); + this.attemptAttributes.putAll(this.apiTracerContext.getAttemptAttributes()); + } + + @Override + public void attemptStarted(Object request, int attemptNumber) { + Map currentAttemptAttributes = new HashMap<>(this.attemptAttributes); + + if (attemptNumber > 0) { + ApiTracerContext.Transport transport = apiTracerContext.transport(); + if (transport == ApiTracerContext.Transport.GRPC) { + currentAttemptAttributes.put( + ObservabilityAttributes.GRPC_RESEND_COUNT_ATTRIBUTE, (long) attemptNumber); + } else if (transport == ApiTracerContext.Transport.HTTP) { + currentAttemptAttributes.put( + ObservabilityAttributes.HTTP_RESEND_COUNT_ATTRIBUTE, (long) attemptNumber); + } + } + + SpanBuilder spanBuilder = tracer.spanBuilder(attemptSpanName); + + // Attempt spans are of the CLIENT kind + spanBuilder.setSpanKind(SpanKind.CLIENT); + + // Pass the combined attributes to the new SpanBuilder method + spanBuilder.setAllAttributes(ObservabilityUtils.toOtelAttributes(currentAttemptAttributes)); + + this.attemptSpan = spanBuilder.startSpan(); + } + + @Override + public void attemptSucceeded() { + endAttempt(); + } + + @Override + public void attemptCancelled() { + endAttempt(); + } + + @Override + public void attemptFailedDuration(Throwable error, java.time.Duration delay) { + endAttempt(); + } + + @Override + public void attemptFailedRetriesExhausted(Throwable error) { + endAttempt(); + } + + @Override + public void attemptPermanentFailure(Throwable error) { + endAttempt(); + } + + private void endAttempt() { + if (attemptSpan != null) { + attemptSpan.end(); + attemptSpan = null; + } + } +} diff --git a/gax-java/gax/src/main/java/com/google/api/gax/tracing/SpanTracerFactory.java b/gax-java/gax/src/main/java/com/google/api/gax/tracing/SpanTracerFactory.java new file mode 100644 index 0000000000..f891795564 --- /dev/null +++ b/gax-java/gax/src/main/java/com/google/api/gax/tracing/SpanTracerFactory.java @@ -0,0 +1,94 @@ +/* + * Copyright 2026 Google LLC + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Google LLC nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +package com.google.api.gax.tracing; + +import com.google.api.core.BetaApi; +import com.google.api.core.InternalApi; +import com.google.common.annotations.VisibleForTesting; +import io.opentelemetry.api.OpenTelemetry; +import io.opentelemetry.api.trace.Tracer; + +/** + * A {@link ApiTracerFactory} to build instances of {@link SpanTracer}. + * + *

        This class wraps the {@link Tracer} and pass it to {@link SpanTracer}. It will be used to + * record traces in {@link SpanTracer}. + * + *

        This class is expected to be initialized once during client initialization. + */ +@BetaApi +@InternalApi +public class SpanTracerFactory implements ApiTracerFactory { + private final Tracer tracer; + + private final ApiTracerContext apiTracerContext; + + /** Creates a SpanTracerFactory */ + public SpanTracerFactory(OpenTelemetry openTelemetry) { + this(openTelemetry.getTracer("gax-java"), ApiTracerContext.empty()); + } + + /** + * Pass in a Map of client level attributes which will be added to every single SpanTracer created + * from the ApiTracerFactory. This is package private since span attributes are determined + * internally. + */ + @VisibleForTesting + SpanTracerFactory(Tracer tracer, ApiTracerContext apiTracerContext) { + this.tracer = tracer; + this.apiTracerContext = apiTracerContext; + } + + @Override + public ApiTracer newTracer(ApiTracer parent, SpanName spanName, OperationType operationType) { + // TODO(diegomarquezp): this is a placeholder for span names and will be adjusted as the + // feature is developed. + String attemptSpanName = spanName.getClientName() + "/" + spanName.getMethodName() + "/attempt"; + + return new SpanTracer(tracer, this.apiTracerContext, attemptSpanName); + } + + @Override + public ApiTracer newTracer(ApiTracer parent, ApiTracerContext apiTracerContext) { + ApiTracerContext mergedContext = this.apiTracerContext.merge(apiTracerContext); + return new SpanTracer(tracer, mergedContext); + } + + @Override + public ApiTracerContext getApiTracerContext() { + return apiTracerContext; + } + + @Override + public ApiTracerFactory withContext(ApiTracerContext context) { + return new SpanTracerFactory(tracer, apiTracerContext.merge(context)); + } +} diff --git a/gax-java/gax/src/main/java/com/google/api/gax/tracing/TracedBatchingCallable.java b/gax-java/gax/src/main/java/com/google/api/gax/tracing/TracedBatchingCallable.java index 0cfb7df086..bc00db0f1c 100644 --- a/gax-java/gax/src/main/java/com/google/api/gax/tracing/TracedBatchingCallable.java +++ b/gax-java/gax/src/main/java/com/google/api/gax/tracing/TracedBatchingCallable.java @@ -38,6 +38,7 @@ import com.google.api.gax.rpc.UnaryCallable; import com.google.api.gax.tracing.ApiTracerFactory.OperationType; import com.google.common.util.concurrent.MoreExecutors; +import javax.annotation.Nullable; /** * This callable wraps a batching callable chain in a {@link ApiTracer}. @@ -50,6 +51,7 @@ public class TracedBatchingCallable extends UnaryCallable { private final ApiTracerFactory tracerFactory; private final SpanName spanName; + @Nullable private final ApiTracerContext apiTracerContext; private final BatchingDescriptor batchingDescriptor; private final UnaryCallable innerCallable; @@ -62,14 +64,32 @@ public TracedBatchingCallable( this.spanName = spanName; this.batchingDescriptor = batchingDescriptor; this.innerCallable = innerCallable; + this.apiTracerContext = null; + } + + public TracedBatchingCallable( + UnaryCallable innerCallable, + ApiTracerFactory tracerFactory, + ApiTracerContext apiTracerContext, + BatchingDescriptor batchingDescriptor) { + this.tracerFactory = tracerFactory; + this.apiTracerContext = + apiTracerContext.toBuilder().setOperationType(OperationType.Batching).build(); + this.batchingDescriptor = batchingDescriptor; + this.innerCallable = innerCallable; + this.spanName = SpanName.of(apiTracerContext); } @Override public ApiFuture futureCall(RequestT request, ApiCallContext context) { // NOTE: This will be invoked asynchronously outside of the original caller's thread. // So this start a top level tracer. - ApiTracer tracer = - tracerFactory.newTracer(context.getTracer(), spanName, OperationType.Batching); + ApiTracer tracer; + if (apiTracerContext != null) { + tracer = tracerFactory.newTracer(context.getTracer(), apiTracerContext); + } else { + tracer = tracerFactory.newTracer(context.getTracer(), spanName, OperationType.Batching); + } TraceFinisher finisher = new TraceFinisher<>(tracer); try { diff --git a/gax-java/gax/src/main/java/com/google/api/gax/tracing/TracedBidiCallable.java b/gax-java/gax/src/main/java/com/google/api/gax/tracing/TracedBidiCallable.java index fd2172752d..0be23594a4 100644 --- a/gax-java/gax/src/main/java/com/google/api/gax/tracing/TracedBidiCallable.java +++ b/gax-java/gax/src/main/java/com/google/api/gax/tracing/TracedBidiCallable.java @@ -41,6 +41,7 @@ import java.util.concurrent.CancellationException; import java.util.concurrent.atomic.AtomicBoolean; import javax.annotation.Nonnull; +import javax.annotation.Nullable; /** * A wrapper callable that will wrap a callable chain in a trace. @@ -54,6 +55,7 @@ public class TracedBidiCallable @Nonnull private final ApiTracerFactory tracerFactory; @Nonnull private final SpanName spanName; + @Nullable private final ApiTracerContext apiTracerContext; @Nonnull private final BidiStreamingCallable innerCallable; public TracedBidiCallable( @@ -63,6 +65,20 @@ public TracedBidiCallable( this.tracerFactory = Preconditions.checkNotNull(tracerFactory, "tracerFactory can't be null"); this.spanName = Preconditions.checkNotNull(spanName, "spanName can't be null"); this.innerCallable = Preconditions.checkNotNull(innerCallable, "innerCallable can't be null"); + this.apiTracerContext = null; + } + + public TracedBidiCallable( + @Nonnull BidiStreamingCallable innerCallable, + @Nonnull ApiTracerFactory tracerFactory, + @Nonnull ApiTracerContext apiTracerContext) { + this.tracerFactory = Preconditions.checkNotNull(tracerFactory, "tracerFactory can't be null"); + this.apiTracerContext = + Preconditions.checkNotNull(apiTracerContext, "apiTracerContext can't be null").toBuilder() + .setOperationType(OperationType.BidiStreaming) + .build(); + this.innerCallable = Preconditions.checkNotNull(innerCallable, "innerCallable can't be null"); + this.spanName = SpanName.of(this.apiTracerContext); } @Override @@ -71,8 +87,12 @@ public ClientStream internalCall( ClientStreamReadyObserver onReady, ApiCallContext context) { - ApiTracer tracer = - tracerFactory.newTracer(context.getTracer(), spanName, OperationType.BidiStreaming); + ApiTracer tracer; + if (apiTracerContext != null) { + tracer = tracerFactory.newTracer(context.getTracer(), apiTracerContext); + } else { + tracer = tracerFactory.newTracer(context.getTracer(), spanName, OperationType.BidiStreaming); + } context = context.withTracer(tracer); AtomicBoolean wasCancelled = new AtomicBoolean(); diff --git a/gax-java/gax/src/main/java/com/google/api/gax/tracing/TracedClientStreamingCallable.java b/gax-java/gax/src/main/java/com/google/api/gax/tracing/TracedClientStreamingCallable.java index 773efe2dea..62141aa239 100644 --- a/gax-java/gax/src/main/java/com/google/api/gax/tracing/TracedClientStreamingCallable.java +++ b/gax-java/gax/src/main/java/com/google/api/gax/tracing/TracedClientStreamingCallable.java @@ -39,6 +39,7 @@ import java.util.concurrent.CancellationException; import java.util.concurrent.atomic.AtomicReference; import javax.annotation.Nonnull; +import javax.annotation.Nullable; /** * A wrapper callable that will wrap a callable chain in a trace. @@ -55,6 +56,7 @@ public class TracedClientStreamingCallable private final ClientStreamingCallable innerCallable; private final ApiTracerFactory tracerFactory; private final SpanName spanName; + @Nullable private final ApiTracerContext apiTracerContext; public TracedClientStreamingCallable( @Nonnull ClientStreamingCallable innerCallable, @@ -63,14 +65,33 @@ public TracedClientStreamingCallable( this.tracerFactory = Preconditions.checkNotNull(tracerFactory, "tracerFactory can't be null"); this.spanName = Preconditions.checkNotNull(spanName, "spanName can't be null"); this.innerCallable = Preconditions.checkNotNull(innerCallable, "innerCallable can't be null"); + this.apiTracerContext = null; + } + + public TracedClientStreamingCallable( + @Nonnull ClientStreamingCallable innerCallable, + @Nonnull ApiTracerFactory tracerFactory, + @Nonnull ApiTracerContext apiTracerContext) { + this.tracerFactory = Preconditions.checkNotNull(tracerFactory, "tracerFactory can't be null"); + this.apiTracerContext = + Preconditions.checkNotNull(apiTracerContext, "apiTracerContext can't be null").toBuilder() + .setOperationType(OperationType.ClientStreaming) + .build(); + this.innerCallable = Preconditions.checkNotNull(innerCallable, "innerCallable can't be null"); + this.spanName = SpanName.of(this.apiTracerContext); } @Override public ApiStreamObserver clientStreamingCall( ApiStreamObserver responseObserver, ApiCallContext context) { - ApiTracer tracer = - tracerFactory.newTracer(context.getTracer(), spanName, OperationType.ClientStreaming); + ApiTracer tracer; + if (apiTracerContext != null) { + tracer = tracerFactory.newTracer(context.getTracer(), apiTracerContext); + } else { + tracer = + tracerFactory.newTracer(context.getTracer(), spanName, OperationType.ClientStreaming); + } context = context.withTracer(tracer); // Shared state that allows the response observer to know that the error it received was diff --git a/gax-java/gax/src/main/java/com/google/api/gax/tracing/TracedServerStreamingCallable.java b/gax-java/gax/src/main/java/com/google/api/gax/tracing/TracedServerStreamingCallable.java index e46520e616..0ee03ce7d2 100644 --- a/gax-java/gax/src/main/java/com/google/api/gax/tracing/TracedServerStreamingCallable.java +++ b/gax-java/gax/src/main/java/com/google/api/gax/tracing/TracedServerStreamingCallable.java @@ -37,6 +37,7 @@ import com.google.api.gax.tracing.ApiTracerFactory.OperationType; import com.google.common.base.Preconditions; import javax.annotation.Nonnull; +import javax.annotation.Nullable; /** * A wrapper callable that will wrap a callable chain in a trace. @@ -50,6 +51,7 @@ public final class TracedServerStreamingCallable @Nonnull private final ApiTracerFactory tracerFactory; @Nonnull private final SpanName spanName; + @Nullable private final ApiTracerContext apiTracerContext; @Nonnull private final ServerStreamingCallable innerCallable; public TracedServerStreamingCallable( @@ -59,14 +61,33 @@ public TracedServerStreamingCallable( this.tracerFactory = Preconditions.checkNotNull(tracerFactory, "tracerFactory can't be null"); this.spanName = Preconditions.checkNotNull(spanName, "spanName can't be null"); this.innerCallable = Preconditions.checkNotNull(innerCallable, "innerCallable can't be null"); + this.apiTracerContext = null; + } + + public TracedServerStreamingCallable( + @Nonnull ServerStreamingCallable innerCallable, + @Nonnull ApiTracerFactory tracerFactory, + @Nonnull ApiTracerContext apiTracerContext) { + this.tracerFactory = Preconditions.checkNotNull(tracerFactory, "tracerFactory can't be null"); + this.apiTracerContext = + Preconditions.checkNotNull(apiTracerContext, "apiTracerContext can't be null").toBuilder() + .setOperationType(OperationType.ServerStreaming) + .build(); + this.innerCallable = Preconditions.checkNotNull(innerCallable, "innerCallable can't be null"); + this.spanName = SpanName.of(this.apiTracerContext); } @Override public void call( RequestT request, ResponseObserver responseObserver, ApiCallContext context) { - ApiTracer tracer = - tracerFactory.newTracer(context.getTracer(), spanName, OperationType.ServerStreaming); + ApiTracer tracer; + if (apiTracerContext != null) { + tracer = tracerFactory.newTracer(context.getTracer(), apiTracerContext); + } else { + tracer = + tracerFactory.newTracer(context.getTracer(), spanName, OperationType.ServerStreaming); + } TracedResponseObserver tracedObserver = new TracedResponseObserver<>(tracer, responseObserver); diff --git a/gax-java/gax/src/main/java/com/google/api/gax/tracing/TracedUnaryCallable.java b/gax-java/gax/src/main/java/com/google/api/gax/tracing/TracedUnaryCallable.java index b7d628dcf3..99fe33c99f 100644 --- a/gax-java/gax/src/main/java/com/google/api/gax/tracing/TracedUnaryCallable.java +++ b/gax-java/gax/src/main/java/com/google/api/gax/tracing/TracedUnaryCallable.java @@ -34,9 +34,13 @@ import com.google.api.core.BetaApi; import com.google.api.core.InternalApi; import com.google.api.gax.rpc.ApiCallContext; +import com.google.api.gax.rpc.ResourceNameExtractor; import com.google.api.gax.rpc.UnaryCallable; import com.google.api.gax.tracing.ApiTracerFactory.OperationType; +import com.google.common.annotations.VisibleForTesting; +import com.google.common.base.Strings; import com.google.common.util.concurrent.MoreExecutors; +import javax.annotation.Nullable; /** * This callable wraps a callable chain in a {@link ApiTracer}. @@ -49,6 +53,8 @@ public class TracedUnaryCallable extends UnaryCallable innerCallable; private final ApiTracerFactory tracerFactory; private final SpanName spanName; + @Nullable private final ApiTracerContext apiTracerContext; + @Nullable private final ResourceNameExtractor resourceNameExtractor; public TracedUnaryCallable( UnaryCallable innerCallable, @@ -57,6 +63,21 @@ public TracedUnaryCallable( this.innerCallable = innerCallable; this.tracerFactory = tracerFactory; this.spanName = spanName; + this.apiTracerContext = null; + this.resourceNameExtractor = null; + } + + public TracedUnaryCallable( + UnaryCallable innerCallable, + ApiTracerFactory tracerFactory, + ApiTracerContext apiTracerContext, + @Nullable ResourceNameExtractor resourceNameExtractor) { + this.innerCallable = innerCallable; + this.tracerFactory = tracerFactory; + this.apiTracerContext = + apiTracerContext.toBuilder().setOperationType(OperationType.Unary).build(); + this.spanName = SpanName.of(apiTracerContext); + this.resourceNameExtractor = resourceNameExtractor; } /** @@ -67,7 +88,13 @@ public TracedUnaryCallable( */ @Override public ApiFuture futureCall(RequestT request, ApiCallContext context) { - ApiTracer tracer = tracerFactory.newTracer(context.getTracer(), spanName, OperationType.Unary); + ApiTracer tracer; + if (apiTracerContext != null) { + ApiTracerContext finalContext = extractResourceNameToApiTracerContext(request); + tracer = tracerFactory.newTracer(context.getTracer(), finalContext); + } else { + tracer = tracerFactory.newTracer(context.getTracer(), spanName, OperationType.Unary); + } TraceFinisher finisher = new TraceFinisher<>(tracer); try { @@ -81,4 +108,15 @@ public ApiFuture futureCall(RequestT request, ApiCallContext context) throw e; } } + + @VisibleForTesting + ApiTracerContext extractResourceNameToApiTracerContext(RequestT request) { + ApiTracerContext finalContext = apiTracerContext; + String resourceName = + resourceNameExtractor != null ? resourceNameExtractor.extract(request) : null; + if (!Strings.isNullOrEmpty(resourceName)) { + finalContext = finalContext.toBuilder().setDestinationResourceId(resourceName).build(); + } + return finalContext; + } } diff --git a/gax-java/gax/src/main/java/com/google/api/gax/util/TimeConversionUtils.java b/gax-java/gax/src/main/java/com/google/api/gax/util/TimeConversionUtils.java new file mode 100644 index 0000000000..5ee39874b7 --- /dev/null +++ b/gax-java/gax/src/main/java/com/google/api/gax/util/TimeConversionUtils.java @@ -0,0 +1,61 @@ +/* + * Copyright 2023 Google LLC + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Google LLC nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +package com.google.api.gax.util; + +public class TimeConversionUtils { + public static java.time.Duration toJavaTimeDuration(org.threeten.bp.Duration source) { + if (source == null) { + return null; + } + return java.time.Duration.ofSeconds(source.getSeconds(), source.getNano()); + } + + public static org.threeten.bp.Duration toThreetenDuration(java.time.Duration source) { + if (source == null) { + return null; + } + return org.threeten.bp.Duration.ofSeconds(source.getSeconds(), source.getNano()); + } + + public static java.time.Instant toJavaTimeInstant(org.threeten.bp.Instant source) { + if (source == null) { + return null; + } + return java.time.Instant.ofEpochSecond(source.getEpochSecond(), source.getNano()); + } + + public static org.threeten.bp.Instant toThreetenInstant(java.time.Instant source) { + if (source == null) { + return null; + } + return org.threeten.bp.Instant.ofEpochSecond(source.getEpochSecond(), source.getNano()); + } +} diff --git a/gax-java/gax/src/main/resources/META-INF/native-image/com.google.api/gax/native-image.properties b/gax-java/gax/src/main/resources/META-INF/native-image/com.google.api/gax/native-image.properties index d411aa2e5e..5d11a38791 100644 --- a/gax-java/gax/src/main/resources/META-INF/native-image/com.google.api/gax/native-image.properties +++ b/gax-java/gax/src/main/resources/META-INF/native-image/com.google.api/gax/native-image.properties @@ -1,8 +1,15 @@ Args = --enable-url-protocols=https,http \ --initialize-at-build-time=org.conscrypt,\ - org.slf4j.LoggerFactory,\ - org.junit.platform.engine.TestTag \ ---initialize-at-run-time=com.google.api.client.googleapis.services.AbstractGoogleClientRequest$ApiClientVersion \ + org.junit.platform.engine.TestTag,\ + com.google.api.gax.core.GaxProperties,\ + com.google.common.base.Platform,\ + com.google.common.base.Platform$JdkPatternCompiler,\ + com.google.common.collect.ImmutableMapEntry,\ + com.google.common.collect.RegularImmutableList,\ + com.google.common.collect.ImmutableMapEntry$NonTerminalImmutableMapEntry,\ + com.google.common.collect.SingletonImmutableBiMap,\ + com.google.protobuf.RuntimeVersion,\ + com.google.protobuf.RuntimeVersion$RuntimeDomain \ --features=com.google.api.gax.nativeimage.OpenCensusFeature,\ com.google.api.gax.nativeimage.GoogleJsonClientFeature \ --add-modules=jdk.httpserver diff --git a/gax-java/gax/src/main/resources/META-INF/native-image/com.google.api/gax/reflect-config.json b/gax-java/gax/src/main/resources/META-INF/native-image/com.google.api/gax/reflect-config.json new file mode 100644 index 0000000000..3a38d53361 --- /dev/null +++ b/gax-java/gax/src/main/resources/META-INF/native-image/com.google.api/gax/reflect-config.json @@ -0,0 +1,10 @@ +[ + { + "name": "com.google.protobuf.RuntimeVersion", + "fields" : [ + { "name" : "MAJOR" }, + { "name" : "MINOR" }, + { "name" : "PATCH" } + ] + } +] \ No newline at end of file diff --git a/gax-java/gax/src/test/java/com/google/api/gax/batching/AssertByPolling.java b/gax-java/gax/src/test/java/com/google/api/gax/batching/AssertByPolling.java new file mode 100644 index 0000000000..4bd2b8e5b2 --- /dev/null +++ b/gax-java/gax/src/test/java/com/google/api/gax/batching/AssertByPolling.java @@ -0,0 +1,65 @@ +/* + * Copyright 2023 Google LLC + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Google LLC nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +package com.google.api.gax.batching; + +import static java.util.concurrent.TimeUnit.MILLISECONDS; + +import com.google.common.base.Stopwatch; +import java.util.Objects; + +/** + * Blocks the current thread to poll the given assertion every 10ms until it's successful or the + * timeout is exceeded. Expected usage: + * + *

        {@code
        + * assertByPolling(java.time.Duration.ofSeconds(2), () -> assertThat(...));
        + * }
        + */ +class AssertByPolling { + + public static void assertByPolling(java.time.Duration timeout, Runnable assertion) + throws InterruptedException { + Objects.requireNonNull(timeout, "Timeout must not be null"); + Stopwatch stopwatch = Stopwatch.createStarted(); + while (true) { + try { + assertion.run(); + return; // Success + + } catch (AssertionError err) { + if (stopwatch.elapsed(MILLISECONDS) < timeout.toMillis()) { + MILLISECONDS.sleep(10); + } else { + throw new AssertionError("Timeout waiting for successful assertion.", err); + } + } + } + } +} diff --git a/gax-java/gax/src/test/java/com/google/api/gax/batching/AssertByPollingTest.java b/gax-java/gax/src/test/java/com/google/api/gax/batching/AssertByPollingTest.java new file mode 100644 index 0000000000..6a71efceac --- /dev/null +++ b/gax-java/gax/src/test/java/com/google/api/gax/batching/AssertByPollingTest.java @@ -0,0 +1,87 @@ +/* + * Copyright 2023 Google LLC + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Google LLC nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +package com.google.api.gax.batching; + +import static com.google.api.gax.batching.AssertByPolling.assertByPolling; + +import com.google.common.truth.Truth; +import java.util.concurrent.TimeUnit; +import java.util.concurrent.atomic.AtomicInteger; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; + +class AssertByPollingTest { + + @Test + void testFailsWhenTimeoutExceeded() { + AssertionError error = + Assertions.assertThrows( + AssertionError.class, + () -> + assertByPolling( + java.time.Duration.ofNanos(2), () -> Truth.assertThat(1).isAtLeast(2))); + + Throwable cause = error.getCause(); + Truth.assertThat(cause).isInstanceOf(AssertionError.class); + // Error provides original assertion failure that never came true. + Truth.assertThat(cause.getMessage()).contains("expected to be at least"); + } + + @Test + void testImmediateSuccessSucceedsRegardlessOfTimeout() throws InterruptedException { + Runnable succeedsAfter1ms = + () -> { + try { + TimeUnit.MILLISECONDS.sleep(1); + } catch (InterruptedException ex) { + throw new RuntimeException(ex); + } + }; + java.time.Duration timeout = java.time.Duration.ofNanos(0); + assertByPolling(timeout, succeedsAfter1ms); + } + + @Test + void testSucceedsAfterInitialFailure() throws InterruptedException { + AtomicInteger attempt = new AtomicInteger(1); + AtomicInteger numFailures = new AtomicInteger(0); + Runnable succeedsSecondTime = + () -> { + if (attempt.getAndIncrement() < 2) { + numFailures.incrementAndGet(); + Assertions.fail(); + } + }; + + java.time.Duration timeout = java.time.Duration.ofMillis(300); + assertByPolling(timeout, succeedsSecondTime); + Truth.assertThat(numFailures.get()).isEqualTo(1); + } +} diff --git a/gax-java/gax/src/test/java/com/google/api/gax/batching/BatcherImplTest.java b/gax-java/gax/src/test/java/com/google/api/gax/batching/BatcherImplTest.java index b503e28da8..1d77df8e0f 100644 --- a/gax-java/gax/src/test/java/com/google/api/gax/batching/BatcherImplTest.java +++ b/gax-java/gax/src/test/java/com/google/api/gax/batching/BatcherImplTest.java @@ -33,8 +33,14 @@ import static com.google.api.gax.rpc.testing.FakeBatchableApi.callLabeledIntSquarer; import static com.google.common.truth.Truth.assertThat; import static com.google.common.truth.Truth.assertWithMessage; +import static org.junit.jupiter.api.Assertions.assertThrows; +import static org.mockito.ArgumentMatchers.any; +import static org.mockito.ArgumentMatchers.eq; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; +import com.google.api.core.AbstractApiFuture; import com.google.api.core.ApiFuture; import com.google.api.core.ApiFutures; import com.google.api.core.SettableApiFuture; @@ -46,13 +52,17 @@ import com.google.api.gax.rpc.testing.FakeBatchableApi.LabeledIntList; import com.google.api.gax.rpc.testing.FakeBatchableApi.LabeledIntSquarerCallable; import com.google.api.gax.rpc.testing.FakeBatchableApi.SquarerBatchingDescriptorV2; +import com.google.api.gax.rpc.testing.FakeCallContext; import com.google.common.base.Stopwatch; import com.google.common.collect.ImmutableList; import com.google.common.collect.Queues; +import java.time.Duration; import java.util.ArrayList; +import java.util.Collections; import java.util.List; import java.util.Queue; import java.util.concurrent.Callable; +import java.util.concurrent.CancellationException; import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ConcurrentMap; import java.util.concurrent.ExecutionException; @@ -69,19 +79,16 @@ import java.util.logging.Level; import java.util.logging.LogRecord; import java.util.logging.Logger; -import org.junit.After; -import org.junit.AfterClass; -import org.junit.Assert; -import org.junit.Test; -import org.junit.function.ThrowingRunnable; -import org.junit.runner.RunWith; -import org.junit.runners.JUnit4; +import org.junit.jupiter.api.AfterAll; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.Timeout; import org.mockito.ArgumentCaptor; import org.mockito.Mockito; -import org.threeten.bp.Duration; -@RunWith(JUnit4.class) -public class BatcherImplTest { +class BatcherImplTest { + + private static final Logger logger = Logger.getLogger(BatcherImplTest.class.getName()); private static final ScheduledExecutorService EXECUTOR = Executors.newSingleThreadScheduledExecutor(); @@ -92,11 +99,11 @@ public class BatcherImplTest { BatchingSettings.newBuilder() .setElementCountThreshold(1000L) .setRequestByteThreshold(1000L) - .setDelayThreshold(Duration.ofSeconds(1)) + .setDelayThresholdDuration(java.time.Duration.ofSeconds(1000)) .build(); - @After - public void tearDown() throws InterruptedException { + @AfterEach + void tearDown() throws InterruptedException { if (underTest != null) { try { // Close the batcher to avoid warnings of orphaned batchers @@ -107,14 +114,15 @@ public void tearDown() throws InterruptedException { } } - @AfterClass + @AfterAll public static void tearDownExecutor() throws InterruptedException { EXECUTOR.shutdown(); EXECUTOR.awaitTermination(100, TimeUnit.MILLISECONDS); } + /** The accumulated results in the test are resolved when {@link Batcher#flush()} is called. */ @Test - public void testResultsAreResolvedAfterFlush() throws Exception { + void testResultsAreResolvedAfterFlush() throws Exception { underTest = createDefaultBatcherImpl(batchingSettings, null); Future result = underTest.add(4); assertThat(result.isDone()).isFalse(); @@ -127,8 +135,22 @@ public void testResultsAreResolvedAfterFlush() throws Exception { } @Test - public void testSendOutstanding() { + void testSendOutstanding() { final AtomicInteger callableCounter = new AtomicInteger(); + ScheduledExecutorService mockExecutor = mock(ScheduledExecutorService.class); + BatchingSettings mockBatchingSettings = mock(BatchingSettings.class); + java.time.Duration mockDelayThresholdDuration = java.time.Duration.ofSeconds(1000L); + when(mockBatchingSettings.getDelayThresholdDuration()).thenReturn(mockDelayThresholdDuration); + when(mockBatchingSettings.getRequestByteThreshold()).thenReturn(1000L); + when(mockBatchingSettings.getElementCountThreshold()).thenReturn(1000L); + when(mockBatchingSettings.getFlowControlSettings()) + .thenReturn(batchingSettings.getFlowControlSettings()); + when(mockExecutor.scheduleWithFixedDelay( + any(Runnable.class), + eq(mockDelayThresholdDuration.toMillis()), + eq(mockDelayThresholdDuration.toMillis()), + any(TimeUnit.class))) + .thenReturn(mock(ScheduledFuture.class)); underTest = new BatcherImpl<>( @@ -142,8 +164,8 @@ public ApiFuture> futureCall( } }, labeledIntList, - batchingSettings, - EXECUTOR); + mockBatchingSettings, + mockExecutor); // Empty Batcher underTest.sendOutstanding(); @@ -154,11 +176,17 @@ public ApiFuture> futureCall( underTest.add(4); underTest.sendOutstanding(); assertThat(callableCounter.get()).isEqualTo(1); + verify(mockExecutor) + .scheduleWithFixedDelay( + any(Runnable.class), + eq(mockDelayThresholdDuration.toMillis()), + eq(mockDelayThresholdDuration.toMillis()), + any(TimeUnit.class)); } /** Element results are resolved after batch is closed. */ @Test - public void testWhenBatcherIsClose() throws Exception { + void testWhenBatcherIsClose() throws Exception { Future result; try (Batcher batcher = createDefaultBatcherImpl(batchingSettings, null)) { result = batcher.add(5); @@ -169,7 +197,7 @@ public void testWhenBatcherIsClose() throws Exception { /** Validates exception when batch is called after {@link Batcher#close()}. */ @Test - public void testNoElementAdditionAfterClose() throws Exception { + void testNoElementAdditionAfterClose() throws Exception { underTest = createDefaultBatcherImpl(batchingSettings, null); underTest.close(); Throwable addOnClosedError = null; @@ -186,26 +214,18 @@ public void testNoElementAdditionAfterClose() throws Exception { /** Validates exception when batch is called after {@link Batcher#close()}. */ @Test - public void testNoElementAdditionAfterCloseAsync() throws Exception { + void testNoElementAdditionAfterCloseAsync() throws Exception { underTest = createDefaultBatcherImpl(batchingSettings, null); underTest.add(1); underTest.closeAsync(); - IllegalStateException e = - Assert.assertThrows( - IllegalStateException.class, - new ThrowingRunnable() { - @Override - public void run() throws Throwable { - underTest.add(1); - } - }); + IllegalStateException e = assertThrows(IllegalStateException.class, () -> underTest.add(1)); assertThat(e).hasMessageThat().matches("Cannot add elements on a closed batcher"); } @Test - public void testCloseAsyncNonblocking() throws ExecutionException, InterruptedException { + void testCloseAsyncNonblocking() throws ExecutionException, InterruptedException { final SettableApiFuture> innerFuture = SettableApiFuture.create(); UnaryCallable> unaryCallable = @@ -233,9 +253,110 @@ public ApiFuture> futureCall( closeFuture.get(); } + @Test + void testCloseTimeout() throws ExecutionException, InterruptedException { + final String futureToStringMsg = "some descriptive message about this future"; + MySettableApiFuture> innerFuture = new MySettableApiFuture<>(futureToStringMsg); + + UnaryCallable> unaryCallable = + new UnaryCallable>() { + @Override + public ApiFuture> futureCall( + LabeledIntList request, ApiCallContext context) { + return innerFuture; + } + }; + underTest = + new BatcherImpl<>( + SQUARER_BATCHING_DESC_V2, unaryCallable, labeledIntList, batchingSettings, EXECUTOR); + + underTest.add(1); + + Stopwatch stopwatch = Stopwatch.createStarted(); + + TimeoutException closeException = + assertThrows(TimeoutException.class, () -> underTest.close(Duration.ofMillis(10))); + + // resolve the future to allow batcher to close + innerFuture.set(ImmutableList.of(1)); + + assertThat(stopwatch.elapsed()).isAtMost(java.time.Duration.ofSeconds(1)); + System.out.println(); + assertThat(closeException) + .hasMessageThat() + .matches(".*Outstanding batches.*" + futureToStringMsg + ".*elements=1.*"); + } + + @Test + void testCloseTimeoutPreventsAdd() throws ExecutionException, InterruptedException { + final String futureToStringMsg = "some descriptive message about this future"; + MySettableApiFuture> innerFuture = new MySettableApiFuture<>(futureToStringMsg); + + UnaryCallable> unaryCallable = + new UnaryCallable>() { + @Override + public ApiFuture> futureCall( + LabeledIntList request, ApiCallContext context) { + return innerFuture; + } + }; + underTest = + new BatcherImpl<>( + SQUARER_BATCHING_DESC_V2, unaryCallable, labeledIntList, batchingSettings, EXECUTOR); + + underTest.add(1); + + try { + underTest.close(Duration.ofMillis(10)); + } catch (TimeoutException ignored) { + // ignored + } + + // Even though the close operation timed out, the batcher should be in a closed state + // and reject new additions + assertThrows(IllegalStateException.class, () -> underTest.add(2)); + + // resolve the future to allow batcher to close + innerFuture.set(ImmutableList.of(1)); + } + + @Test + void testCancelOutstanding() throws ExecutionException, InterruptedException { + SettableApiFuture> innerFuture = SettableApiFuture.create(); + + UnaryCallable> unaryCallable = + new UnaryCallable>() { + @Override + public ApiFuture> futureCall( + LabeledIntList request, ApiCallContext context) { + return innerFuture; + } + }; + underTest = + new BatcherImpl<>( + SQUARER_BATCHING_DESC_V2, unaryCallable, labeledIntList, batchingSettings, EXECUTOR); + + ApiFuture elementF = underTest.add(1); + + // Initial close will timeout + TimeoutException firstCloseException = + assertThrows(TimeoutException.class, () -> underTest.close(Duration.ofMillis(10))); + assertThat(firstCloseException).hasMessageThat().contains("Timed out"); + + underTest.cancelOutstanding(); + + BatchingException finalCloseException = + assertThrows(BatchingException.class, () -> underTest.close(Duration.ofSeconds(1))); + assertThat(finalCloseException).hasMessageThat().contains("Batching finished"); + + // element future should resolve to a cancelled future + ExecutionException elementException = assertThrows(ExecutionException.class, elementF::get); + assertThat(elementException).hasCauseThat().isInstanceOf(CancellationException.class); + } + /** Verifies exception occurred at RPC is propagated to element results */ @Test - public void testResultFailureAfterRPCFailure() throws Exception { + void testResultFailureAfterRPCFailure() throws Exception { final Exception fakeError = new RuntimeException(); UnaryCallable> unaryCallable = new UnaryCallable>() { @@ -276,7 +397,7 @@ public ApiFuture> futureCall( /** Resolves future results when {@link BatchingDescriptor#splitResponse} throws exception. */ @Test - public void testExceptionInDescriptor() throws InterruptedException { + void testExceptionInDescriptor() throws InterruptedException { final RuntimeException fakeError = new RuntimeException("internal exception"); BatchingDescriptor> descriptor = new SquarerBatchingDescriptorV2() { @@ -315,7 +436,7 @@ public void splitResponse( /** Resolves future results when {@link BatchingDescriptor#splitException} throws exception */ @Test - public void testExceptionInDescriptorErrorHandling() throws InterruptedException { + void testExceptionInDescriptorErrorHandling() throws InterruptedException { final RuntimeException fakeError = new RuntimeException("internal exception"); BatchingDescriptor> descriptor = new SquarerBatchingDescriptorV2() { @@ -354,35 +475,38 @@ public void splitException( } @Test - public void testWhenElementCountExceeds() throws Exception { + void testWhenElementCountExceeds() throws Exception { BatchingSettings settings = batchingSettings.toBuilder().setElementCountThreshold(2L).build(); testElementTriggers(settings); } @Test - public void testWhenElementBytesExceeds() throws Exception { + void testWhenElementBytesExceeds() throws Exception { BatchingSettings settings = batchingSettings.toBuilder().setRequestByteThreshold(2L).build(); testElementTriggers(settings); } @Test - public void testWhenThresholdIsDisabled() throws Exception { + void testWhenThresholdIsDisabled() throws Exception { BatchingSettings settings = BatchingSettings.newBuilder() .setElementCountThreshold(null) .setRequestByteThreshold(null) - .setDelayThreshold(null) + .setDelayThresholdDuration(null) .build(); underTest = createDefaultBatcherImpl(settings, null); Future result = underTest.add(2); + underTest.add(3); assertThat(result.isDone()).isTrue(); assertThat(result.get()).isEqualTo(4); } @Test - public void testWhenDelayThresholdExceeds() throws Exception { + void testWhenDelayThresholdExceeds() throws Exception { BatchingSettings settings = - batchingSettings.toBuilder().setDelayThreshold(Duration.ofMillis(100)).build(); + batchingSettings.toBuilder() + .setDelayThresholdDuration(java.time.Duration.ofMillis(100)) + .build(); underTest = createDefaultBatcherImpl(settings, null); Future result = underTest.add(6); assertThat(result.isDone()).isFalse(); @@ -390,8 +514,9 @@ public void testWhenDelayThresholdExceeds() throws Exception { } /** Validates that the elements are not leaking to multiple batches */ - @Test(timeout = 500) - public void testElementsNotLeaking() throws Exception { + @Test + @Timeout(value = 500, unit = TimeUnit.MILLISECONDS) + void testElementsNotLeaking() throws Exception { ExecutorService singleThreadExecutor = Executors.newSingleThreadExecutor(); ScheduledExecutorService multiThreadExecutor = Executors.newScheduledThreadPool(20); @@ -413,29 +538,25 @@ public ApiFuture> futureCall( } }; BatchingSettings settings = - batchingSettings.toBuilder().setDelayThreshold(Duration.ofMillis(50)).build(); + batchingSettings.toBuilder() + .setDelayThresholdDuration(java.time.Duration.ofMillis(50)) + .build(); try (final BatcherImpl> batcherTest = new BatcherImpl<>(SQUARER_BATCHING_DESC_V2, callable, labeledIntList, settings, EXECUTOR)) { final Callable addElement = - new Callable() { - @Override - public Void call() throws Exception { - int counter = 0; - while (!isDuplicateElement.get() && counter < 10_000) { - batcherTest.add(counter++); - } - return null; + () -> { + int counter = 0; + while (!isDuplicateElement.get() && counter < 10_000) { + batcherTest.add(counter++); } + return null; }; final Callable sendBatch = - new Callable() { - @Override - public Void call() throws InterruptedException { - batcherTest.flush(); - return null; - } + () -> { + batcherTest.flush(); + return null; }; // Started sequential element addition @@ -454,10 +575,12 @@ public Void call() throws InterruptedException { /** Validates ongoing runnable is cancelled once Batcher is GCed. */ @Test - public void testPushCurrentBatchRunnable() throws Exception { + void testPushCurrentBatchRunnable() throws Exception { long DELAY_TIME = 50L; BatchingSettings settings = - batchingSettings.toBuilder().setDelayThreshold(Duration.ofMillis(DELAY_TIME)).build(); + batchingSettings.toBuilder() + .setDelayThresholdDuration(java.time.Duration.ofMillis(DELAY_TIME)) + .build(); BatcherImpl> batcher = createDefaultBatcherImpl(settings, null); @@ -490,7 +613,7 @@ public void testPushCurrentBatchRunnable() throws Exception { } @Test - public void testEmptyBatchesAreNeverSent() throws Exception { + void testEmptyBatchesAreNeverSent() throws Exception { UnaryCallable> callable = new UnaryCallable>() { @Override @@ -507,7 +630,7 @@ public ApiFuture> futureCall( /** To confirm the partial failures in Batching does not mark whole batch failed */ @Test - public void testPartialFailureWithSplitResponse() throws Exception { + void testPartialFailureWithSplitResponse() throws Exception { SquarerBatchingDescriptorV2 descriptor = new SquarerBatchingDescriptorV2() { @Override @@ -553,7 +676,7 @@ public void splitResponse( } @Test - public void testPartialFailureInResultProcessing() throws Exception { + void testPartialFailureInResultProcessing() throws Exception { final Queue queue = Queues.newArrayBlockingQueue(3); queue.add(new NullPointerException()); queue.add(new RuntimeException()); @@ -609,7 +732,7 @@ public void splitResponse( *

        Note:This test cannot run concurrently with other tests that use Batchers. */ @Test - public void testUnclosedBatchersAreLogged() throws Exception { + void testUnclosedBatchersAreLogged() throws Exception { final long DELAY_TIME = 30L; int actualRemaining = 0; for (int retry = 0; retry < 3; retry++) { @@ -682,7 +805,7 @@ public boolean isLoggable(LogRecord record) { *

        Note:This test cannot run concurrently with other tests that use Batchers. */ @Test - public void testClosedBatchersAreNotLogged() throws Exception { + void testClosedBatchersAreNotLogged() throws Exception { // Clean out the existing instances final long DELAY_TIME = 30L; int actualRemaining = 0; @@ -743,7 +866,7 @@ public boolean isLoggable(LogRecord record) { } @Test - public void testCloseRace() throws ExecutionException, InterruptedException, TimeoutException { + void testCloseRace() throws ExecutionException, InterruptedException, TimeoutException { int iterations = 1_000_000; ExecutorService executor = Executors.newFixedThreadPool(100); @@ -767,24 +890,15 @@ public ApiFuture> futureCall( batcher.add(1); - executor.execute( - new Runnable() { - @Override - public void run() { - result.set(ImmutableList.of(1)); - } - }); + executor.execute(() -> result.set(ImmutableList.of(1))); Future f = executor.submit( - new Runnable() { - @Override - public void run() { - try { - batcher.close(); - } catch (InterruptedException e) { - Thread.currentThread().interrupt(); - throw new RuntimeException(e); - } + () -> { + try { + batcher.close(); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new RuntimeException(e); } }); @@ -806,7 +920,7 @@ public void run() { } @Test - public void testConstructors() throws InterruptedException { + void testConstructors() throws InterruptedException { try (BatcherImpl batcher1 = createDefaultBatcherImpl(batchingSettings, null)) { assertThat(batcher1.getFlowController()).isNotNull(); assertThat(batcher1.getFlowController().getLimitExceededBehavior()) @@ -829,7 +943,8 @@ public void testConstructors() throws InterruptedException { } @Test - public void testThrottlingBlocking() throws Exception { + @Timeout(60) + void testThrottlingBlocking() throws Exception { BatchingSettings settings = BatchingSettings.newBuilder() .setElementCountThreshold(1L) @@ -843,7 +958,7 @@ public void testThrottlingBlocking() throws Exception { .build()); ExecutorService executor = Executors.newFixedThreadPool(2); - ApiCallContext callContext = Mockito.mock(ApiCallContext.class); + ApiCallContext callContext = mock(ApiCallContext.class); ArgumentCaptor> key = ArgumentCaptor.forClass(ApiCallContext.Key.class); ArgumentCaptor value = ArgumentCaptor.forClass(Long.class); @@ -860,30 +975,58 @@ public void testThrottlingBlocking() throws Exception { flowController, callContext)) { flowController.reserve(1, 1); + List batcherAddThreadHolder = Collections.synchronizedList(new ArrayList<>()); Future future = executor.submit( - new Runnable() { - @Override - public void run() { - batcher.add(1); - } + () -> { + batcherAddThreadHolder.add(Thread.currentThread()); + batcher.add(1); + logger.fine("Called batcher.add(1)"); }); - // Add a little delay ensuring that the next step starts after batcher.add(1) - Thread.sleep(10); + + // Wait until batcher.add blocks (Thread.State.WAITING) and the batcher starts the + // stopwatch for total_throttled_time. Without this proper waiting, the + // Thread.sleep(throttledTime) below may start before the stopwatch starts, + // resulting in a shorter total_throttled_time at the verification of throttledTime + // at the end of the test. + // https://github.com/googleapis/sdk-platform-java/issues/1193 + do { + Thread.sleep(10); + } while (batcherAddThreadHolder.isEmpty() + || batcherAddThreadHolder.get(0).getState() != Thread.State.WAITING); + + long beforeGetCall = System.currentTimeMillis(); executor.submit( () -> { try { Thread.sleep(throttledTime); + logger.fine("Calling flowController.release"); flowController.release(1, 1); + logger.fine("Called flowController.release"); } catch (InterruptedException e) { } }); try { + logger.fine("Calling future.get(10 ms)"); future.get(10, TimeUnit.MILLISECONDS); - assertWithMessage("adding elements to batcher should be blocked by FlowControlled").fail(); + long afterGetCall = System.currentTimeMillis(); + long actualWaitTimeMs = afterGetCall - beforeGetCall; + + logger.fine("future.get(10 ms) unexpectedly returned. Wait time: " + actualWaitTimeMs); + // In a flaky test troubleshooting + // (https://github.com/googleapis/sdk-platform-java/issues/1931), we observed that + // "future.get" method did not throw TimeoutException in this multithreaded test. + // It's because the thread calling "future.get" was not being run (i.e. in the wait queue of + // CPUs) in a timely manner. + // To avoid the flakiness, as long as the "future.get" does not return before the specified + // timeout, this assertion is considered as good. + assertWithMessage("adding elements to batcher should be blocked by FlowControlled") + .that(actualWaitTimeMs) + .isAtLeast(10); } catch (TimeoutException e) { // expected + logger.fine("future.get(10 ms) timed out expectedly."); } try { @@ -893,11 +1036,18 @@ public void run() { } // Mockito recommends using verify() as the ONLY way to interact with Argument - // captors - otherwise it may incur in unexpected behaviour - Mockito.verify(callContext).withOption(key.capture(), value.capture()); + // captors - otherwise it may incur in unexpected behaviour. + // The callContext.withOption method is called by BatcherImpl.sendOutstanding() method via + // BatcherImpl$PushCurrentBatchRunnable in another thread. Technically, there's no guarantee + // that the thread calls the withOption method within a certain timeframe. 1000 ms just works + // fine to prevent false positives. + // https://github.com/googleapis/sdk-platform-java/issues/1193 + Mockito.verify(callContext, Mockito.timeout(1000)).withOption(key.capture(), value.capture()); // Verify that throttled time is recorded in ApiCallContext assertThat(key.getValue()).isSameInstanceAs(Batcher.THROTTLED_TIME_KEY); + // Because this test waited for throttledTime before flowController.release() method, + // the recorded total_throttled_time should be higher than or equal to that. assertThat(value.getValue()).isAtLeast(throttledTime); } finally { executor.shutdownNow(); @@ -905,7 +1055,7 @@ public void run() { } @Test - public void testThrottlingNonBlocking() throws Exception { + void testThrottlingNonBlocking() throws Exception { BatchingSettings settings = BatchingSettings.newBuilder() .setElementCountThreshold(1L) @@ -931,12 +1081,113 @@ public void testThrottlingNonBlocking() throws Exception { } } + /** + * If the batcher's unary callable throws an exception when obtaining a response, then the + * response .get() should throw the exception + */ + @Test + void testAddDoesNotHangIfExceptionThrowStartingACall() { + BatchingDescriptor batchingDescriptor = + new BatchingDescriptor() { + @Override + public BatchingRequestBuilder newRequestBuilder(Object o) { + return new BatchingRequestBuilder() { + @Override + public void add(Object o) {} + + @Override + public Object build() { + return new Object(); + } + }; + } + + @Override + public void splitResponse(Object o, List> list) { + for (BatchEntry e : list) { + e.getResultFuture().set(new Object()); + } + } + + @Override + public void splitException(Throwable throwable, List> list) { + for (BatchEntry e : list) { + e.getResultFuture().setException(new RuntimeException("fake")); + } + } + + @Override + public long countBytes(Object o) { + return 1; + } + }; + + UnaryCallable unaryCallable = + new UnaryCallable() { + @Override + public ApiFuture futureCall(Object o, ApiCallContext apiCallContext) { + throw new RuntimeException("this should bubble up"); + } + }; + Object prototype = new Object(); + BatchingSettings batchingSettings = + BatchingSettings.newBuilder() + .setDelayThresholdDuration(java.time.Duration.ofSeconds(1)) + .setElementCountThreshold(100L) + .setRequestByteThreshold(100L) + .setFlowControlSettings(FlowControlSettings.getDefaultInstance()) + .build(); + ScheduledExecutorService executor = Executors.newScheduledThreadPool(2); + FlowController flowController = new FlowController(batchingSettings.getFlowControlSettings()); + ApiCallContext callContext = FakeCallContext.createDefault(); + + BatcherImpl batcher = + new BatcherImpl<>( + batchingDescriptor, + unaryCallable, + prototype, + batchingSettings, + executor, + flowController, + callContext); + + ApiFuture f = batcher.add(new Object()); + assertThrows(ExecutionException.class, f::get); + // bubbles up + assertThrows(RuntimeException.class, batcher::close); + } + + @Test + void testDefaultShouldFlush() { + BatchResource resource = + DefaultBatchResource.builder().setElementCount(2).setByteCount(2).build(); + + assertThat(resource.shouldFlush(2, 2)).isFalse(); + assertThat(resource.shouldFlush(1, 1)).isTrue(); + } + + @Test + void testDefaultBatchResourceAdd() { + BatchResource resource = + DefaultBatchResource.builder().setElementCount(1).setByteCount(1).build(); + + BatchResource newResource = + resource.add(DefaultBatchResource.builder().setElementCount(1).setByteCount(1).build()); + + // Make sure add doesn't modify the old object + assertThat(resource.getElementCount()).isEqualTo(1); + assertThat(resource.getByteCount()).isEqualTo(1); + assertThat(newResource.getElementCount()).isEqualTo(2); + assertThat(newResource.getByteCount()).isEqualTo(2); + } + private void testElementTriggers(BatchingSettings settings) throws Exception { underTest = createDefaultBatcherImpl(settings, null); Future result = underTest.add(4); assertThat(result.isDone()).isFalse(); - // After this element is added, the batch triggers sendOutstanding(). Future anotherResult = underTest.add(5); + // After this element is added, the batch triggers sendOutstanding(). + underTest.add(6); // Both the elements should be resolved now. assertThat(result.isDone()).isTrue(); assertThat(result.get()).isEqualTo(16); @@ -953,4 +1204,27 @@ private BatcherImpl> createDefau EXECUTOR, flowController); } + + private static class MySettableApiFuture extends AbstractApiFuture { + private final String desc; + + MySettableApiFuture(String desc) { + this.desc = desc; + } + + @Override + public boolean set(T value) { + return super.set(value); + } + + @Override + public boolean setException(Throwable throwable) { + return super.setException(throwable); + } + + @Override + public String toString() { + return desc; + } + } } diff --git a/gax-java/gax/src/test/java/com/google/api/gax/batching/BatcherStatsTest.java b/gax-java/gax/src/test/java/com/google/api/gax/batching/BatcherStatsTest.java index 1a95e4d3cb..3f69f09188 100644 --- a/gax-java/gax/src/test/java/com/google/api/gax/batching/BatcherStatsTest.java +++ b/gax-java/gax/src/test/java/com/google/api/gax/batching/BatcherStatsTest.java @@ -36,26 +36,26 @@ import com.google.api.gax.rpc.StatusCode; import com.google.api.gax.rpc.testing.FakeStatusCode; import com.google.common.collect.ImmutableList; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.junit.runners.JUnit4; +import org.junit.jupiter.api.Test; -@RunWith(JUnit4.class) -public class BatcherStatsTest { +class BatcherStatsTest { @Test - public void testWhenNoException() { + void testWhenNoException() { BatcherStats batcherStats = new BatcherStats(); assertThat(batcherStats.asException()).isNull(); } @Test - public void testRequestFailuresOnly() { + void testRequestFailuresOnly() { BatcherStats batcherStats = new BatcherStats(); batcherStats.recordBatchFailure( ApiExceptionFactory.createException( - new RuntimeException(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false)); + "fake api error", + new RuntimeException(), + FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), + false)); batcherStats.recordBatchFailure(new RuntimeException("Request failed")); @@ -65,10 +65,14 @@ public void testRequestFailuresOnly() { assertThat(exception).hasMessageThat().contains("1 RuntimeException"); assertThat(exception).hasMessageThat().contains("1 ApiException(1 INVALID_ARGUMENT)"); assertThat(exception).hasMessageThat().contains("and 0 partial failures."); + assertThat(exception) + .hasMessageThat() + .contains( + "com.google.api.gax.rpc.InvalidArgumentException: fake api error, java.lang.RuntimeException: Request failed."); } @Test - public void testEntryFailureOnly() { + void testEntryFailureOnly() { BatcherStats batcherStats = new BatcherStats(); SettableApiFuture batchOneResult = SettableApiFuture.create(); @@ -79,7 +83,10 @@ public void testEntryFailureOnly() { SettableApiFuture batchTwoResult = SettableApiFuture.create(); batchTwoResult.setException( ApiExceptionFactory.createException( - new RuntimeException(), FakeStatusCode.of(StatusCode.Code.UNAVAILABLE), false)); + "fake entry error", + new RuntimeException(), + FakeStatusCode.of(StatusCode.Code.UNAVAILABLE), + false)); batcherStats.recordBatchElementsCompletion( ImmutableList.of(BatchEntry.create(2, batchTwoResult))); @@ -89,10 +96,14 @@ public void testEntryFailureOnly() { .contains("The 2 partial failures contained 2 entries that failed with:"); assertThat(ex).hasMessageThat().contains("1 ApiException(1 UNAVAILABLE)"); assertThat(ex).hasMessageThat().contains("1 IllegalStateException"); + assertThat(ex) + .hasMessageThat() + .contains( + "Sample of entry errors: java.lang.IllegalStateException: local element failure, com.google.api.gax.rpc.UnavailableException: fake entry error."); } @Test - public void testRequestAndEntryFailures() { + void testRequestAndEntryFailures() { BatcherStats batcherStats = new BatcherStats(); batcherStats.recordBatchFailure(new RuntimeException("Batch failure")); @@ -110,6 +121,8 @@ public void testRequestAndEntryFailures() { .contains( "Batching finished with 1 batches failed to apply due to: 1 RuntimeException and 1 " + "partial failures. The 1 partial failures contained 1 entries that failed with:" - + " 1 ApiException(1 ALREADY_EXISTS)."); + + " 1 ApiException(1 ALREADY_EXISTS)." + + " Sample of RPC errors: java.lang.RuntimeException: Batch failure." + + " Sample of entry errors: com.google.api.gax.rpc.AlreadyExistsException: java.lang.RuntimeException."); } } diff --git a/gax-java/gax/src/test/java/com/google/api/gax/batching/BatchingCallSettingsTest.java b/gax-java/gax/src/test/java/com/google/api/gax/batching/BatchingCallSettingsTest.java index 51339dfa15..2b1e66ad60 100644 --- a/gax-java/gax/src/test/java/com/google/api/gax/batching/BatchingCallSettingsTest.java +++ b/gax-java/gax/src/test/java/com/google/api/gax/batching/BatchingCallSettingsTest.java @@ -38,19 +38,15 @@ import com.google.common.collect.ImmutableSet; import java.util.List; import java.util.Set; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.junit.runners.JUnit4; -import org.threeten.bp.Duration; +import org.junit.jupiter.api.Test; -@RunWith(JUnit4.class) -public class BatchingCallSettingsTest { +class BatchingCallSettingsTest { private static final BatchingSettings BATCHING_SETTINGS = BatchingSettings.newBuilder() .setElementCountThreshold(10L) .setRequestByteThreshold(20L) - .setDelayThreshold(Duration.ofMillis(5)) + .setDelayThresholdDuration(java.time.Duration.ofMillis(5)) .setFlowControlSettings( FlowControlSettings.newBuilder() .setMaxOutstandingElementCount(100L) @@ -60,7 +56,7 @@ public class BatchingCallSettingsTest { .build(); @Test - public void testEmptyBuilder() { + void testEmptyBuilder() { BatchingCallSettings.Builder> builder = BatchingCallSettings.newBuilder(SQUARER_BATCHING_DESC_V2); assertThat(builder.getBatchingSettings()).isNull(); @@ -69,7 +65,7 @@ public void testEmptyBuilder() { } @Test - public void testBuilder() { + void testBuilder() { BatchingCallSettings.Builder> builder = BatchingCallSettings.newBuilder(SQUARER_BATCHING_DESC_V2); @@ -87,11 +83,11 @@ public void testBuilder() { } @Test - public void testBuilderFromSettings() { + void testBuilderFromSettings() { BatchingCallSettings.Builder> builder = BatchingCallSettings.newBuilder(SQUARER_BATCHING_DESC_V2); RetrySettings retrySettings = - RetrySettings.newBuilder().setTotalTimeout(Duration.ofMinutes(1)).build(); + RetrySettings.newBuilder().setTotalTimeoutDuration(java.time.Duration.ofMinutes(1)).build(); builder .setBatchingSettings(BATCHING_SETTINGS) .setRetryableCodes(StatusCode.Code.UNAVAILABLE, StatusCode.Code.UNAUTHENTICATED) @@ -107,7 +103,7 @@ public void testBuilderFromSettings() { } @Test - public void testMandatorySettings() { + void testMandatorySettings() { Exception actualEx = null; try { BatchingCallSettings.newBuilder(null); @@ -125,7 +121,7 @@ public void testMandatorySettings() { } @Test - public void testToString() { + void testToString() { RetrySettings retrySettings = RetrySettings.newBuilder().build(); Set retryCodes = ImmutableSet.of(StatusCode.Code.UNAUTHENTICATED); BatchingCallSettings> batchingCallSettings = diff --git a/gax-java/gax/src/test/java/com/google/api/gax/batching/BatchingSettingsTest.java b/gax-java/gax/src/test/java/com/google/api/gax/batching/BatchingSettingsTest.java new file mode 100644 index 0000000000..69dadb5397 --- /dev/null +++ b/gax-java/gax/src/test/java/com/google/api/gax/batching/BatchingSettingsTest.java @@ -0,0 +1,49 @@ +/* + * Copyright 2024 Google LLC + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Google LLC nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +package com.google.api.gax.batching; + +import static com.google.api.gax.util.TimeConversionTestUtils.testDurationMethod; + +import org.junit.jupiter.api.Test; + +public class BatchingSettingsTest { + + private static final BatchingSettings.Builder SETTINGS_BUILDER = BatchingSettings.newBuilder(); + + @Test + public void testDelayThreshold() { + testDurationMethod( + 123l, + jt -> SETTINGS_BUILDER.setDelayThresholdDuration(jt).build(), + tt -> SETTINGS_BUILDER.setDelayThreshold(tt).build(), + o -> o.getDelayThresholdDuration(), + o -> o.getDelayThreshold()); + } +} diff --git a/gax-java/gax/src/test/java/com/google/api/gax/batching/DynamicFlowControlSettingsTest.java b/gax-java/gax/src/test/java/com/google/api/gax/batching/DynamicFlowControlSettingsTest.java index afbf8ce1ea..9b626da7c0 100644 --- a/gax-java/gax/src/test/java/com/google/api/gax/batching/DynamicFlowControlSettingsTest.java +++ b/gax-java/gax/src/test/java/com/google/api/gax/batching/DynamicFlowControlSettingsTest.java @@ -30,20 +30,17 @@ package com.google.api.gax.batching; import static com.google.common.truth.Truth.assertThat; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNull; -import static org.junit.Assert.fail; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNull; +import static org.junit.jupiter.api.Assertions.fail; import com.google.api.gax.batching.FlowController.LimitExceededBehavior; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.junit.runners.JUnit4; +import org.junit.jupiter.api.Test; -@RunWith(JUnit4.class) -public class DynamicFlowControlSettingsTest { +class DynamicFlowControlSettingsTest { @Test - public void testEmptyBuilder() { + void testEmptyBuilder() { DynamicFlowControlSettings.Builder builder = DynamicFlowControlSettings.newBuilder(); DynamicFlowControlSettings settings = builder.build(); assertNull(settings.getInitialOutstandingElementCount()); @@ -56,7 +53,7 @@ public void testEmptyBuilder() { } @Test - public void testPartialSettingsIgnored() { + void testPartialSettingsIgnored() { // If behavior is ignore, build shouldn't throw exceptions even when only one of the bytes or // element limits is set DynamicFlowControlSettings.Builder builder = @@ -72,7 +69,7 @@ public void testPartialSettingsIgnored() { } @Test - public void testBuilder() { + void testBuilder() { DynamicFlowControlSettings.Builder builder = DynamicFlowControlSettings.newBuilder() .setInitialOutstandingElementCount(5L) @@ -91,7 +88,7 @@ public void testBuilder() { } @Test - public void testValidElementCountSettings() { + void testValidElementCountSettings() { DynamicFlowControlSettings.Builder builder = DynamicFlowControlSettings.newBuilder() .setInitialOutstandingElementCount(5L) @@ -104,7 +101,7 @@ public void testValidElementCountSettings() { } @Test - public void testValidRequestByteSettings() { + void testValidRequestByteSettings() { DynamicFlowControlSettings.Builder builder = DynamicFlowControlSettings.newBuilder() .setInitialOutstandingRequestBytes(500L) @@ -117,7 +114,7 @@ public void testValidRequestByteSettings() { } @Test - public void testInvalidPartialSettings() { + void testInvalidPartialSettings() { DynamicFlowControlSettings.Builder builder = DynamicFlowControlSettings.newBuilder().setInitialOutstandingElementCount(1L); try { @@ -136,7 +133,7 @@ public void testInvalidPartialSettings() { } @Test - public void testInvalidArguments() { + void testInvalidArguments() { testInvalidElementCount(-1, -5, 10); testInvalidElementCount(5, -1, 10); testInvalidElementCount(5, 0, 10); diff --git a/gax-java/gax/src/test/java/com/google/api/gax/batching/FlowControlEventStatsTest.java b/gax-java/gax/src/test/java/com/google/api/gax/batching/FlowControlEventStatsTest.java index 4dcb0c4ffe..4b883374f0 100644 --- a/gax-java/gax/src/test/java/com/google/api/gax/batching/FlowControlEventStatsTest.java +++ b/gax-java/gax/src/test/java/com/google/api/gax/batching/FlowControlEventStatsTest.java @@ -29,23 +29,20 @@ */ package com.google.api.gax.batching; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotNull; -import static org.junit.Assert.assertNull; -import static org.junit.Assert.fail; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertNull; +import static org.junit.jupiter.api.Assertions.fail; import com.google.api.gax.batching.FlowControlEventStats.FlowControlEvent; import com.google.api.gax.batching.FlowController.MaxOutstandingRequestBytesReachedException; import java.util.concurrent.TimeUnit; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.junit.runners.JUnit4; +import org.junit.jupiter.api.Test; -@RunWith(JUnit4.class) -public class FlowControlEventStatsTest { +class FlowControlEventStatsTest { @Test - public void testCreateEvent() { + void testCreateEvent() { long timestamp = 12345, throttledTimeMs = 5000; FlowControlEvent event = FlowControlEvent.createReserveDelayed(timestamp, throttledTimeMs); assertEquals(event.getTimestampMs(), event.getTimestampMs()); @@ -69,7 +66,7 @@ public void testCreateEvent() { } @Test - public void testGetLastEvent() { + void testGetLastEvent() { FlowControlEventStats stats = new FlowControlEventStats(); long currentTime = System.currentTimeMillis(); diff --git a/gax-java/gax/src/test/java/com/google/api/gax/batching/FlowControllerTest.java b/gax-java/gax/src/test/java/com/google/api/gax/batching/FlowControllerTest.java index cb82d28db3..c91b5b17ae 100644 --- a/gax-java/gax/src/test/java/com/google/api/gax/batching/FlowControllerTest.java +++ b/gax-java/gax/src/test/java/com/google/api/gax/batching/FlowControllerTest.java @@ -29,13 +29,14 @@ */ package com.google.api.gax.batching; +import static com.google.api.gax.batching.AssertByPolling.assertByPolling; import static com.google.common.truth.Truth.assertThat; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertNotNull; -import static org.junit.Assert.assertNull; -import static org.junit.Assert.assertTrue; -import static org.junit.Assert.fail; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertNull; +import static org.junit.jupiter.api.Assertions.assertTrue; +import static org.junit.jupiter.api.Assertions.fail; import com.google.api.gax.batching.FlowController.FlowControlException; import com.google.api.gax.batching.FlowController.LimitExceededBehavior; @@ -51,16 +52,14 @@ import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeoutException; import java.util.concurrent.atomic.AtomicInteger; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.junit.runners.JUnit4; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.Timeout; /** Tests for {@link FlowController}. */ -@RunWith(JUnit4.class) -public class FlowControllerTest { +class FlowControllerTest { @Test - public void testReserveRelease_ok() throws Exception { + void testReserveRelease_ok() throws Exception { FlowController flowController = new FlowController( FlowControlSettings.newBuilder() @@ -74,7 +73,7 @@ public void testReserveRelease_ok() throws Exception { } @Test - public void testInvalidArguments() throws Exception { + void testInvalidArguments() throws Exception { FlowController flowController = new FlowController( FlowControlSettings.newBuilder() @@ -113,7 +112,7 @@ public void testInvalidArguments() throws Exception { } @Test - public void testReserveRelease_noLimits_ok() throws Exception { + void testReserveRelease_noLimits_ok() throws Exception { FlowController flowController = new FlowController( FlowControlSettings.newBuilder() @@ -125,7 +124,7 @@ public void testReserveRelease_noLimits_ok() throws Exception { } @Test - public void testReserveRelease_ignore_ok() throws Exception { + void testReserveRelease_ignore_ok() throws Exception { FlowController flowController = new FlowController( FlowControlSettings.newBuilder() @@ -139,7 +138,7 @@ public void testReserveRelease_ignore_ok() throws Exception { } @Test - public void testReserveRelease_blockedByElementCount() throws Exception { + void testReserveRelease_blockedByElementCount() throws Exception { FlowController flowController = new FlowController( FlowControlSettings.newBuilder() @@ -152,7 +151,7 @@ public void testReserveRelease_blockedByElementCount() throws Exception { } @Test - public void testReserveRelease_blockedByElementCount_noBytesLimit() throws Exception { + void testReserveRelease_blockedByElementCount_noBytesLimit() throws Exception { FlowController flowController = new FlowController( FlowControlSettings.newBuilder() @@ -164,7 +163,7 @@ public void testReserveRelease_blockedByElementCount_noBytesLimit() throws Excep } @Test - public void testReserveRelease_blockedByNumberOfBytes() throws Exception { + void testReserveRelease_blockedByNumberOfBytes() throws Exception { FlowController flowController = new FlowController( FlowControlSettings.newBuilder() @@ -177,7 +176,7 @@ public void testReserveRelease_blockedByNumberOfBytes() throws Exception { } @Test - public void testReserveRelease_blockedByNumberOfBytes_noElementCountLimit() throws Exception { + void testReserveRelease_blockedByNumberOfBytes_noElementCountLimit() throws Exception { FlowController flowController = new FlowController( FlowControlSettings.newBuilder() @@ -198,15 +197,12 @@ private static void testBlockingReserveRelease( Future finished = Executors.newCachedThreadPool() .submit( - new Runnable() { - @Override - public void run() { - try { - permitsReserved.set(null); - flowController.reserve(maxElementCount, maxNumBytes); - } catch (FlowController.FlowControlException e) { - throw new AssertionError(e); - } + () -> { + try { + permitsReserved.set(null); + flowController.reserve(maxElementCount, maxNumBytes); + } catch (FlowControlException e) { + throw new AssertionError(e); } }); @@ -219,7 +215,7 @@ public void run() { } @Test - public void testReserveRelease_rejectedByElementCount() throws Exception { + void testReserveRelease_rejectedByElementCount() throws Exception { FlowController flowController = new FlowController( FlowControlSettings.newBuilder() @@ -236,7 +232,7 @@ public void testReserveRelease_rejectedByElementCount() throws Exception { } @Test - public void testReserveRelease_rejectedByElementCount_noBytesLimit() throws Exception { + void testReserveRelease_rejectedByElementCount_noBytesLimit() throws Exception { FlowController flowController = new FlowController( FlowControlSettings.newBuilder() @@ -249,7 +245,7 @@ public void testReserveRelease_rejectedByElementCount_noBytesLimit() throws Exce } @Test - public void testReserveRelease_rejectedByNumberOfBytes() throws Exception { + void testReserveRelease_rejectedByNumberOfBytes() throws Exception { FlowController flowController = new FlowController( FlowControlSettings.newBuilder() @@ -266,7 +262,7 @@ public void testReserveRelease_rejectedByNumberOfBytes() throws Exception { } @Test - public void testReserveRelease_rejectedByNumberOfBytes_noElementCountLimit() throws Exception { + void testReserveRelease_rejectedByNumberOfBytes_noElementCountLimit() throws Exception { FlowController flowController = new FlowController( FlowControlSettings.newBuilder() @@ -279,7 +275,7 @@ public void testReserveRelease_rejectedByNumberOfBytes_noElementCountLimit() thr } @Test - public void testRestoreAfterFail() throws FlowController.FlowControlException { + void testRestoreAfterFail() throws FlowController.FlowControlException { FlowController flowController = new FlowController( FlowControlSettings.newBuilder() @@ -300,7 +296,7 @@ public void testRestoreAfterFail() throws FlowController.FlowControlException { } @Test - public void testConstructedByDynamicFlowControlSetting() { + void testConstructedByDynamicFlowControlSetting() { FlowController flowController = new FlowController( DynamicFlowControlSettings.newBuilder() @@ -340,7 +336,7 @@ public void testConstructedByDynamicFlowControlSetting() { } @Test - public void testIncreaseThresholds_blocking() throws Exception { + void testIncreaseThresholds_blocking() throws Exception { FlowController flowController = new FlowController( DynamicFlowControlSettings.newBuilder() @@ -373,7 +369,7 @@ public void testIncreaseThresholds_blocking() throws Exception { } @Test - public void testDecreaseThresholds_blocking() throws Exception { + void testDecreaseThresholds_blocking() throws Exception { FlowController flowController = new FlowController( DynamicFlowControlSettings.newBuilder() @@ -406,7 +402,7 @@ public void testDecreaseThresholds_blocking() throws Exception { } @Test - public void testIncreaseThresholds_nonBlocking() throws Exception { + void testIncreaseThresholds_nonBlocking() throws Exception { FlowController flowController = new FlowController( DynamicFlowControlSettings.newBuilder() @@ -445,7 +441,7 @@ public void testIncreaseThresholds_nonBlocking() throws Exception { } @Test - public void testDecreaseThresholds_nonBlocking() throws Exception { + void testDecreaseThresholds_nonBlocking() throws Exception { FlowController flowController = new FlowController( DynamicFlowControlSettings.newBuilder() @@ -505,7 +501,7 @@ private void testRejectedReserveRelease( } @Test - public void testConcurrentUpdateThresholds_blocking() throws Exception { + void testConcurrentUpdateThresholds_blocking() throws Exception { int initialValue = 5000; FlowController flowController = new FlowController( @@ -522,10 +518,10 @@ public void testConcurrentUpdateThresholds_blocking() throws Exception { final AtomicInteger totalDecreased = new AtomicInteger(0); final AtomicInteger releasedCounter = new AtomicInteger(0); - List reserveThreads = + List> reserveThreads = testConcurrentUpdates( flowController, 100, 100, 10, totalIncreased, totalDecreased, releasedCounter); - for (Future t : reserveThreads) { + for (Future t : reserveThreads) { t.get(200, TimeUnit.MILLISECONDS); } assertEquals(reserveThreads.size(), releasedCounter.get()); @@ -539,7 +535,7 @@ public void testConcurrentUpdateThresholds_blocking() throws Exception { } @Test - public void testConcurrentUpdateThresholds_nonBlocking() throws Exception { + void testConcurrentUpdateThresholds_nonBlocking() throws Exception { int initialValue = 5000; FlowController flowController = new FlowController( @@ -555,10 +551,10 @@ public void testConcurrentUpdateThresholds_nonBlocking() throws Exception { AtomicInteger totalIncreased = new AtomicInteger(0); AtomicInteger totalDecreased = new AtomicInteger(0); AtomicInteger releasedCounter = new AtomicInteger(0); - List reserveThreads = + List> reserveThreads = testConcurrentUpdates( flowController, 100, 100, 100, totalIncreased, totalDecreased, releasedCounter); - for (Future t : reserveThreads) { + for (Future t : reserveThreads) { t.get(200, TimeUnit.MILLISECONDS); } assertEquals(reserveThreads.size(), releasedCounter.get()); @@ -580,7 +576,7 @@ public void testConcurrentUpdateThresholds_nonBlocking() throws Exception { } @Test - public void testNumberOfBytesOutOfBoundaryWontDeadlock() throws Exception { + void testNumberOfBytesOutOfBoundaryWontDeadlock() throws Exception { // Test the special case where in FlowController#reserve, to avoid deadlocks, it allows // reserving byte size greater than current request bytes limit. int initial = 50; @@ -596,19 +592,19 @@ public void testNumberOfBytesOutOfBoundaryWontDeadlock() throws Exception { // will be blocked by reserve 10 Thread t = new Thread( - new Runnable() { - @Override - public void run() { - try { - flowController.reserve(0, 100); - } catch (FlowControlException e) { - } + () -> { + try { + flowController.reserve(0, 100); + } catch (FlowControlException e) { + throw new AssertionError(e); } }); t.start(); + // wait for thread to start, and check it should be blocked - Thread.sleep(50); - assertEquals(State.WAITING, t.getState()); + assertByPolling( + java.time.Duration.ofMillis(200), () -> assertEquals(State.WAITING, t.getState())); + // increase and decrease should not be blocked int increase = 5, decrease = 20; flowController.decreaseThresholds(0, decrease); @@ -623,8 +619,9 @@ public void run() { testBlockingReserveRelease(flowController, 0, expectedNewThreshold); } - @Test(timeout = 500) - public void testElementCountsOutOfBoundaryWontDeadlock() throws Exception { + @Test + @Timeout(value = 500, unit = TimeUnit.MILLISECONDS) + void testElementCountsOutOfBoundaryWontDeadlock() throws Exception { // Test the special case where in FlowController#reserve, to avoid deadlocks, it allows // reserving byte size greater than current request bytes limit. final int initial = 50; @@ -641,19 +638,19 @@ public void testElementCountsOutOfBoundaryWontDeadlock() throws Exception { .build()); Thread t = new Thread( - new Runnable() { - @Override - public void run() { - try { - flowController.reserve(initial + 10, 10); - } catch (FlowControlException e) { - } + () -> { + try { + flowController.reserve(initial + 10, 10); + } catch (FlowControlException e) { + throw new AssertionError(e); } }); t.start(); + // wait for thread to start, and check it should be blocked - Thread.sleep(50); - assertEquals(State.WAITING, t.getState()); + assertByPolling( + java.time.Duration.ofMillis(200), () -> assertEquals(State.WAITING, t.getState())); + // increase and decrease should not be blocked int increase = 5, decrease = 20; flowController.decreaseThresholds(decrease, 0); @@ -667,7 +664,7 @@ public void run() { } @Test - public void testFlowControlBlockEventIsRecorded() throws Exception { + void testFlowControlBlockEventIsRecorded() throws Exception { // Test when reserve is blocked for at least FlowController#RESERVE_FLOW_CONTROL_THRESHOLD_MS, // FlowController will record the FlowControlEvent in FlowControlEventStats final FlowController flowController = @@ -682,14 +679,11 @@ public void testFlowControlBlockEventIsRecorded() throws Exception { .setLimitExceededBehavior(LimitExceededBehavior.Block) .build()); Runnable runnable = - new Runnable() { - @Override - public void run() { - try { - flowController.reserve(1, 1); - } catch (FlowController.FlowControlException e) { - throw new AssertionError(e); - } + () -> { + try { + flowController.reserve(1, 1); + } catch (FlowControlException e) { + throw new AssertionError(e); } }; // blocked by element. Reserve all 5 elements first, reserve in the runnable will be blocked @@ -734,7 +728,7 @@ public void run() { .isAtLeast(currentTime); } - private List testConcurrentUpdates( + private List> testConcurrentUpdates( final FlowController flowController, final int increaseStepRange, final int decreaseStepRange, @@ -745,37 +739,28 @@ private List testConcurrentUpdates( throws InterruptedException, TimeoutException, ExecutionException { final Random random = new Random(); Runnable increaseRunnable = - new Runnable() { - @Override - public void run() { - int increase = random.nextInt(increaseStepRange) + 1; - flowController.increaseThresholds(increase, increase); - totalIncreased.addAndGet(increase); - } + () -> { + int increase = random.nextInt(increaseStepRange) + 1; + flowController.increaseThresholds(increase, increase); + totalIncreased.addAndGet(increase); }; Runnable decreaseRunnable = - new Runnable() { - @Override - public void run() { - int decrease = random.nextInt(decreaseStepRange) + 1; - flowController.decreaseThresholds(decrease, decrease); - totalDecreased.addAndGet(decrease); - } + () -> { + int decrease = random.nextInt(decreaseStepRange) + 1; + flowController.decreaseThresholds(decrease, decrease); + totalDecreased.addAndGet(decrease); }; Runnable reserveReleaseRunnable = - new Runnable() { - @Override - public void run() { - try { - flowController.reserve(reserve, reserve); - flowController.release(reserve, reserve); - releasedCounter.incrementAndGet(); - } catch (Exception e) { - } + () -> { + try { + flowController.reserve(reserve, reserve); + flowController.release(reserve, reserve); + releasedCounter.incrementAndGet(); + } catch (Exception e) { } }; - List updateFuture = new ArrayList<>(); - List reserveReleaseFuture = new ArrayList<>(); + List> updateFuture = new ArrayList<>(); + List> reserveReleaseFuture = new ArrayList<>(); ExecutorService executors = Executors.newFixedThreadPool(10); ExecutorService reserveExecutor = Executors.newFixedThreadPool(10); for (int i = 0; i < 5; i++) { @@ -783,7 +768,7 @@ public void run() { updateFuture.add(executors.submit(decreaseRunnable)); reserveReleaseFuture.add(reserveExecutor.submit(reserveReleaseRunnable)); } - for (Future t : updateFuture) { + for (Future t : updateFuture) { t.get(50, TimeUnit.MILLISECONDS); } executors.shutdown(); diff --git a/gax-java/gax/src/test/java/com/google/api/gax/batching/Semaphore64Test.java b/gax-java/gax/src/test/java/com/google/api/gax/batching/Semaphore64Test.java index a0a8a89aa8..96fe3c81e9 100644 --- a/gax-java/gax/src/test/java/com/google/api/gax/batching/Semaphore64Test.java +++ b/gax-java/gax/src/test/java/com/google/api/gax/batching/Semaphore64Test.java @@ -29,27 +29,29 @@ */ package com.google.api.gax.batching; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertTrue; -import static org.junit.Assert.fail; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertThrows; +import static org.junit.jupiter.api.Assertions.assertTrue; +import static org.junit.jupiter.api.Assertions.fail; import java.util.LinkedList; import java.util.List; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.junit.runners.JUnit4; +import java.util.concurrent.TimeUnit; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.Timeout; -@RunWith(JUnit4.class) -public class Semaphore64Test { - @Test(expected = IllegalArgumentException.class) - public void testNegative() { +class Semaphore64Test { + + @Test + void testNegative() { Semaphore64 semaphore = new BlockingSemaphore(1); - semaphore.acquire(-1); + + assertThrows(IllegalArgumentException.class, () -> semaphore.acquire(-1)); } @Test - public void testReturning() { + void testReturning() { Semaphore64 semaphore = new NonBlockingSemaphore(1); assertTrue(semaphore.acquire(1)); assertFalse(semaphore.acquire(1)); @@ -57,19 +59,13 @@ public void testReturning() { assertTrue(semaphore.acquire(1)); } - @Test(timeout = 500) - public void testBlocking() throws InterruptedException { + @Test + @Timeout(value = 500, unit = TimeUnit.MILLISECONDS) + void testBlocking() throws InterruptedException { final Semaphore64 semaphore = new BlockingSemaphore(1); semaphore.acquire(1); - Thread t = - new Thread( - new Runnable() { - @Override - public void run() { - semaphore.acquire(1); - } - }); + Thread t = new Thread(() -> semaphore.acquire(1)); t.start(); Thread.sleep(50); @@ -80,7 +76,7 @@ public void run() { } @Test - public void testReducePermitLimitNonBlocking() { + void testReducePermitLimitNonBlocking() { final Semaphore64 semaphore = new NonBlockingSemaphore(5); semaphore.reducePermitLimit(3); assertFalse(semaphore.acquire(3)); @@ -88,21 +84,15 @@ public void testReducePermitLimitNonBlocking() { assertEquals(2, semaphore.getPermitLimit()); } - @Test(timeout = 500) - public void testReducePermitLimitBlocking() throws InterruptedException { + @Test + @Timeout(value = 500, unit = TimeUnit.MILLISECONDS) + void testReducePermitLimitBlocking() throws InterruptedException { final Semaphore64 semaphore = new BlockingSemaphore(2); semaphore.reducePermitLimit(1); semaphore.acquire(1); - Thread t = - new Thread( - new Runnable() { - @Override - public void run() { - semaphore.acquire(1); - } - }); + Thread t = new Thread(() -> semaphore.acquire(1)); t.start(); Thread.sleep(50); @@ -115,7 +105,7 @@ public void run() { } @Test - public void testAcquirePartialNonBlocking() { + void testAcquirePartialNonBlocking() { Semaphore64 semaphore = new NonBlockingSemaphore(5); assertTrue(semaphore.acquirePartial(6)); assertFalse(semaphore.acquire(1)); @@ -126,18 +116,12 @@ public void testAcquirePartialNonBlocking() { assertEquals(5, semaphore.getPermitLimit()); } - @Test(timeout = 500) - public void testAcquirePartialBlocking() throws Exception { + @Test + @Timeout(value = 500, unit = TimeUnit.MILLISECONDS) + void testAcquirePartialBlocking() throws Exception { final Semaphore64 semaphore = new BlockingSemaphore(5); semaphore.acquirePartial(6); - Thread t1 = - new Thread( - new Runnable() { - @Override - public void run() { - semaphore.acquire(1); - } - }); + Thread t1 = new Thread(() -> semaphore.acquire(1)); t1.start(); // wait for thread to start Thread.sleep(100); @@ -146,14 +130,7 @@ public void run() { t1.join(); // now there should be 4 permits available, acquiring 6 should block - Thread t2 = - new Thread( - new Runnable() { - @Override - public void run() { - semaphore.acquirePartial(6); - } - }); + Thread t2 = new Thread(() -> semaphore.acquirePartial(6)); t2.start(); // wait fo thread to start Thread.sleep(100); @@ -163,7 +140,7 @@ public void run() { } @Test - public void testIncreasePermitLimitNonBlocking() { + void testIncreasePermitLimitNonBlocking() { Semaphore64 semaphore = new NonBlockingSemaphore(1); assertFalse(semaphore.acquire(2)); semaphore.increasePermitLimit(1); @@ -173,18 +150,12 @@ public void testIncreasePermitLimitNonBlocking() { assertEquals(2, semaphore.getPermitLimit()); } - @Test(timeout = 500) - public void testIncreasePermitLimitBlocking() throws Exception { + @Test + @Timeout(value = 500, unit = TimeUnit.MILLISECONDS) + void testIncreasePermitLimitBlocking() throws Exception { final Semaphore64 semaphore = new BlockingSemaphore(1); semaphore.acquire(1); - Thread t = - new Thread( - new Runnable() { - @Override - public void run() { - semaphore.acquire(1); - } - }); + Thread t = new Thread(() -> semaphore.acquire(1)); t.start(); Thread.sleep(50); @@ -198,20 +169,18 @@ public void run() { assertEquals(2, semaphore.getPermitLimit()); } - @Test(timeout = 500) - public void testReleaseWontOverflowNonBlocking() throws Exception { + @Test + @Timeout(value = 500, unit = TimeUnit.MILLISECONDS) + void testReleaseWontOverflowNonBlocking() throws Exception { final Semaphore64 semaphore = new NonBlockingSemaphore(10); List threads = new LinkedList<>(); for (int i = 0; i < 20; i++) { final int id = i; Thread t = new Thread( - new Runnable() { - @Override - public void run() { - semaphore.acquire(5); - semaphore.release(6); - } + () -> { + semaphore.acquire(5); + semaphore.release(6); }); threads.add(t); } @@ -227,8 +196,9 @@ public void run() { assertTrue(semaphore.acquire(10)); } - @Test(timeout = 500) - public void testReleaseWontOverflowBlocking() throws Exception { + @Test + @Timeout(value = 500, unit = TimeUnit.MILLISECONDS) + void testReleaseWontOverflowBlocking() throws Exception { final Semaphore64 semaphore = new BlockingSemaphore(10); semaphore.acquire(5); semaphore.release(6); @@ -236,21 +206,14 @@ public void testReleaseWontOverflowBlocking() throws Exception { assertEquals(10, semaphore.getPermitLimit()); semaphore.acquire(10); semaphore.release(10); - Thread t = - new Thread( - new Runnable() { - @Override - public void run() { - semaphore.acquire(11); - } - }); + Thread t = new Thread(() -> semaphore.acquire(11)); t.start(); Thread.sleep(100); assertTrue(t.isAlive()); } @Test - public void testPermitLimitUnderflowNonBlocking() { + void testPermitLimitUnderflowNonBlocking() { Semaphore64 semaphore = new NonBlockingSemaphore(10); try { semaphore.reducePermitLimit(10); @@ -262,8 +225,9 @@ public void testPermitLimitUnderflowNonBlocking() { assertTrue(semaphore.acquire(10)); } - @Test(timeout = 500) - public void testPermitLimitUnderflowBlocking() throws Exception { + @Test + @Timeout(value = 500, unit = TimeUnit.MILLISECONDS) + void testPermitLimitUnderflowBlocking() throws Exception { final Semaphore64 semaphore = new BlockingSemaphore(10); try { semaphore.reducePermitLimit(10); @@ -273,14 +237,7 @@ public void testPermitLimitUnderflowBlocking() throws Exception { assertEquals(10, semaphore.getPermitLimit()); semaphore.acquire(10); semaphore.release(10); - Thread t = - new Thread( - new Runnable() { - @Override - public void run() { - semaphore.acquire(11); - } - }); + Thread t = new Thread(() -> semaphore.acquire(11)); t.start(); Thread.sleep(100); assertTrue(t.isAlive()); diff --git a/gax-java/gax/src/test/java/com/google/api/gax/batching/ThresholdBatcherTest.java b/gax-java/gax/src/test/java/com/google/api/gax/batching/ThresholdBatcherTest.java index 45eaa84b7f..f87b772d3b 100644 --- a/gax-java/gax/src/test/java/com/google/api/gax/batching/ThresholdBatcherTest.java +++ b/gax-java/gax/src/test/java/com/google/api/gax/batching/ThresholdBatcherTest.java @@ -30,21 +30,31 @@ package com.google.api.gax.batching; import static com.google.common.truth.Truth.assertThat; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertThrows; +import static org.mockito.ArgumentMatchers.any; +import static org.mockito.ArgumentMatchers.anyLong; +import static org.mockito.ArgumentMatchers.eq; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.times; +import static org.mockito.Mockito.verify; +import static org.mockito.Mockito.when; import com.google.api.core.ApiFutures; import com.google.api.gax.batching.FlowController.FlowControlException; import com.google.api.gax.batching.FlowController.LimitExceededBehavior; +import com.google.common.collect.ImmutableList; +import java.util.AbstractMap.SimpleEntry; import java.util.ArrayList; import java.util.Arrays; import java.util.List; import java.util.concurrent.ExecutionException; import java.util.concurrent.ScheduledExecutorService; +import java.util.concurrent.ScheduledFuture; import java.util.concurrent.ScheduledThreadPoolExecutor; -import org.junit.Assert; -import org.junit.Test; -import org.threeten.bp.Duration; +import org.junit.jupiter.api.Test; -public class ThresholdBatcherTest { +class ThresholdBatcherTest { private static final ScheduledExecutorService EXECUTOR = new ScheduledThreadPoolExecutor(1); @@ -113,7 +123,7 @@ private static SimpleBatch fromInteger(Integer integer) { return batch; } - public void merge(SimpleBatch t) { + void merge(SimpleBatch t) { integers.addAll(t.integers); } @@ -123,6 +133,7 @@ private List getIntegers() { } private static class SimpleBatchMerger implements BatchMerger { + @Override public void merge(SimpleBatch batch, SimpleBatch newBatch) { batch.merge(newBatch); @@ -134,14 +145,30 @@ private static ThresholdBatcher.Builder createSimpleBatcherBuidler( return ThresholdBatcher.newBuilder() .setThresholds(BatchingThresholds.create(100)) .setExecutor(EXECUTOR) - .setMaxDelay(Duration.ofMillis(10000)) + .setMaxDelayDuration(java.time.Duration.ofMillis(10000)) .setReceiver(receiver) .setFlowController(ThresholdBatcherTest.getDisabledBatchingFlowController()) .setBatchMerger(new SimpleBatchMerger()); } + private static SimpleEntry + createSimpleBatcherBuilderWithMockExecutor(long customThreshold) { + AccumulatingBatchReceiver receiver = + new AccumulatingBatchReceiver<>(ApiFutures.immediateFuture(null)); + ScheduledExecutorService executor = mock(ScheduledThreadPoolExecutor.class); + when(executor.schedule((Runnable) any(), anyLong(), any())) + .thenReturn(mock(ScheduledFuture.class)); + BatchingThreshold threshold = new NumericThreshold<>(customThreshold, e -> 1); + + ThresholdBatcher.Builder builder = + createSimpleBatcherBuidler(receiver) + .setExecutor(executor) + .setThresholds(ImmutableList.of(threshold)); + return new SimpleEntry<>(builder, executor); + } + @Test - public void testAdd() throws Exception { + void testAdd() throws Exception { AccumulatingBatchReceiver receiver = new AccumulatingBatchReceiver<>(ApiFutures.immediateFuture(null)); ThresholdBatcher batcher = createSimpleBatcherBuidler(receiver).build(); @@ -156,7 +183,7 @@ public void testAdd() throws Exception { } @Test - public void testBatching() throws Exception { + void testBatching() throws Exception { AccumulatingBatchReceiver receiver = new AccumulatingBatchReceiver<>(ApiFutures.immediateFuture(null)); ThresholdBatcher batcher = @@ -190,11 +217,13 @@ public void testBatching() throws Exception { } @Test - public void testBatchingWithDelay() throws Exception { + void testBatchingWithDelay() throws Exception { AccumulatingBatchReceiver receiver = new AccumulatingBatchReceiver<>(ApiFutures.immediateFuture(null)); ThresholdBatcher batcher = - createSimpleBatcherBuidler(receiver).setMaxDelay(Duration.ofMillis(100)).build(); + createSimpleBatcherBuidler(receiver) + .setMaxDelayDuration(java.time.Duration.ofMillis(100)) + .build(); batcher.add(SimpleBatch.fromInteger(3)); batcher.add(SimpleBatch.fromInteger(5)); @@ -215,24 +244,23 @@ public void testBatchingWithDelay() throws Exception { } @Test - public void testExceptionWithNullFlowController() { - try { - ThresholdBatcher.newBuilder() - .setThresholds(BatchingThresholds.create(100)) - .setExecutor(EXECUTOR) - .setMaxDelay(Duration.ofMillis(10000)) - .setReceiver( - new AccumulatingBatchReceiver(ApiFutures.immediateFuture(null))) - .setBatchMerger(new SimpleBatchMerger()) - .build(); - Assert.fail("ThresholdBatcher should have thrown an exception"); - } catch (NullPointerException expected) { - assertThat(expected).isInstanceOf(NullPointerException.class); - } + void testExceptionWithNullFlowController() { + assertThrows( + NullPointerException.class, + () -> + ThresholdBatcher.newBuilder() + .setThresholds(BatchingThresholds.create(100)) + .setExecutor(EXECUTOR) + .setMaxDelayDuration(java.time.Duration.ofMillis(10000)) + .setReceiver( + new AccumulatingBatchReceiver( + ApiFutures.immediateFuture(null))) + .setBatchMerger(new SimpleBatchMerger()) + .build()); } @Test - public void testBatchingWithFlowControl() throws Exception { + void testBatchingWithFlowControl() throws Exception { AccumulatingBatchReceiver receiver = new AccumulatingBatchReceiver<>(ApiFutures.immediateFuture(null)); ThresholdBatcher batcher = @@ -274,7 +302,7 @@ public void testBatchingWithFlowControl() throws Exception { } @Test - public void testBatchingFlowControlExceptionRecovery() throws Exception { + void testBatchingFlowControlExceptionRecovery() throws Exception { AccumulatingBatchReceiver receiver = new AccumulatingBatchReceiver<>(ApiFutures.immediateFuture(null)); ThresholdBatcher batcher = @@ -293,11 +321,9 @@ public void testBatchingFlowControlExceptionRecovery() throws Exception { batcher.add(SimpleBatch.fromInteger(3)); batcher.add(SimpleBatch.fromInteger(5)); batcher.add(SimpleBatch.fromInteger(7)); - try { - batcher.add(SimpleBatch.fromInteger(9)); - Assert.fail("expected exception"); - } catch (FlowControlException e) { - } + + assertThrows(FlowControlException.class, () -> batcher.add(SimpleBatch.fromInteger(9))); + batcher.pushCurrentBatch().get(); assertThat(receiver.getBatches()).hasSize(1); batcher.add(SimpleBatch.fromInteger(11)); @@ -318,7 +344,7 @@ public void testBatchingFlowControlExceptionRecovery() throws Exception { } @Test - public void testBatchingFailedRPC() throws Exception { + void testBatchingFailedRPC() throws Exception { Exception ex = new IllegalStateException("does nothing, unsuccessfully"); AccumulatingBatchReceiver receiver = new AccumulatingBatchReceiver<>(ApiFutures.immediateFailedFuture(ex)); @@ -336,13 +362,11 @@ public void testBatchingFailedRPC() throws Exception { assertThat(trackedFlowController.getBytesReleased()).isEqualTo(0); batcher.add(SimpleBatch.fromInteger(3)); - try { - batcher.pushCurrentBatch().get(); - Assert.fail("expected exception"); - } catch (Exception e) { - assertThat(e).isInstanceOf(ExecutionException.class); - assertThat(e).hasCauseThat().isSameInstanceAs(ex); - } + + ExecutionException actualException = + assertThrows(ExecutionException.class, () -> batcher.pushCurrentBatch().get()); + assertEquals(actualException.getCause(), ex); + assertThat(receiver.getBatches()).hasSize(1); List> expected = Arrays.asList(Arrays.asList(3)); @@ -357,4 +381,28 @@ public void testBatchingFailedRPC() throws Exception { assertThat(trackedFlowController.getBytesReserved()) .isEqualTo(trackedFlowController.getBytesReleased()); } + + @Test + public void testMaxDelay() throws FlowControlException { + + final long MILLIS = 123l; + final SimpleBatch TEST_BATCH = SimpleBatch.fromInteger(1); + java.time.Duration javaTimeDuration = java.time.Duration.ofMillis(MILLIS); + org.threeten.bp.Duration threetenDuration = org.threeten.bp.Duration.ofMillis(MILLIS); + + SimpleEntry container = + createSimpleBatcherBuilderWithMockExecutor(1000l); + ThresholdBatcher.Builder builder = container.getKey(); + ScheduledExecutorService executor = container.getValue(); + + builder.setMaxDelayDuration(javaTimeDuration).build().add(TEST_BATCH); + verify(executor, times(1)).schedule((Runnable) any(), eq(MILLIS), any()); + + container = createSimpleBatcherBuilderWithMockExecutor(1000l); + builder = container.getKey(); + executor = container.getValue(); + + builder.setMaxDelay(threetenDuration).build().add(TEST_BATCH); + verify(executor, times(1)).schedule((Runnable) any(), eq(MILLIS), any()); + } } diff --git a/gax-java/gax/src/test/java/com/google/api/gax/core/DistributionTest.java b/gax-java/gax/src/test/java/com/google/api/gax/core/DistributionTest.java index 7e6cb8a6aa..498056dc5f 100644 --- a/gax-java/gax/src/test/java/com/google/api/gax/core/DistributionTest.java +++ b/gax-java/gax/src/test/java/com/google/api/gax/core/DistributionTest.java @@ -30,14 +30,16 @@ package com.google.api.gax.core; import static com.google.common.truth.Truth.assertThat; +import static org.junit.jupiter.api.Assertions.assertThrows; import java.util.Arrays; import java.util.Collections; -import org.junit.Test; +import org.junit.jupiter.api.Test; + +class DistributionTest { -public class DistributionTest { @Test - public void testPercentile() { + void testPercentile() { // These tests come from examples in // https://en.wikipedia.org/wiki/Percentile#The_nearest-rank_method Distribution dist; @@ -62,18 +64,18 @@ public void testPercentile() { assertThat(dist.getPercentile(100)).isEqualTo(20); } - @Test(expected = IllegalArgumentException.class) - public void testZeroMaxValue() { - new Distribution(0); + @Test + void testZeroMaxValue() { + assertThrows(IllegalArgumentException.class, () -> new Distribution(0)); } - @Test(expected = IllegalArgumentException.class) - public void testNegativeMaxValue() { - new Distribution(-1); + @Test + void testNegativeMaxValue() { + assertThrows(IllegalArgumentException.class, () -> new Distribution(-1)); } @Test - public void testOverflowMaxValue() { + void testOverflowMaxValue() { // Record value greater than maxValue-1 is OK. We record maxValue-1 instead. Distribution dist = new Distribution(10); dist.record(10); diff --git a/gax-java/gax/src/test/java/com/google/api/gax/core/GaxPropertiesTest.java b/gax-java/gax/src/test/java/com/google/api/gax/core/GaxPropertiesTest.java index 27d942e691..6560df4bc1 100644 --- a/gax-java/gax/src/test/java/com/google/api/gax/core/GaxPropertiesTest.java +++ b/gax-java/gax/src/test/java/com/google/api/gax/core/GaxPropertiesTest.java @@ -29,38 +29,203 @@ */ package com.google.api.gax.core; -import static org.graalvm.nativeimage.ImageInfo.PROPERTY_IMAGE_CODE_KEY; -import static org.graalvm.nativeimage.ImageInfo.PROPERTY_IMAGE_CODE_VALUE_RUNTIME; -import static org.junit.Assert.assertTrue; +import static com.google.api.gax.core.GaxProperties.getBundleVersion; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertTrue; +import com.google.common.base.Strings; +import com.google.protobuf.Any; +import java.io.IOException; +import java.util.Optional; import java.util.regex.Pattern; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.junit.runners.JUnit4; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.Test; -@RunWith(JUnit4.class) -public class GaxPropertiesTest { +class GaxPropertiesTest { @Test - public void testGaxVersion() { - String gaxVersion = GaxProperties.getGaxVersion(); - assertTrue(Pattern.compile("^\\d+\\.\\d+\\.\\d+").matcher(gaxVersion).find()); - String[] versionComponents = gaxVersion.split("\\."); + void testGaxVersion() { + Version version = readVersion(GaxProperties.getGaxVersion()); + + assertTrue(version.major >= 1); + if (version.major == 1) { + assertTrue(version.minor >= 56); + } + } + + private static String originalJavaVersion = System.getProperty("java.version"); + private static String originalJavaVendor = System.getProperty("java.vendor"); + private static String originalJavaVendorVersion = System.getProperty("java.vendor.version"); + + @AfterEach + void cleanup() { + if (Strings.isNullOrEmpty(originalJavaVersion)) { + System.clearProperty("java.version"); + } else { + System.setProperty("java.version", originalJavaVersion); + } + + if (Strings.isNullOrEmpty(originalJavaVendor)) { + System.clearProperty("java.vendor"); + } else { + System.setProperty("java.vendor", originalJavaVendor); + } + + if (Strings.isNullOrEmpty(originalJavaVendorVersion)) { + System.clearProperty("java.vendor.version"); + } else { + System.setProperty("java.vendor.version", originalJavaVendorVersion); + } + } + + @Test + void testGetJavaRuntimeInfo_graalVM() { + // This case is one of major Java vendors + System.setProperty("java.version", "17.0.3"); + System.setProperty("java.vendor", "GraalVM Community"); + System.setProperty("java.vendor.version", "GraalVM CE 22.1.0"); + + String runtimeInfo = GaxProperties.getRuntimeVersion(); + assertEquals("17.0.3__GraalVM-Community__GraalVM-CE-22.1.0", runtimeInfo); + } + + @Test + void testGetJavaRuntimeInfo_temurin() { + // This case is one of major Java vendors + System.setProperty("java.version", "11.0.19"); + System.setProperty("java.vendor", "Eclipse Adoptium"); + System.setProperty("java.vendor.version", "Temurin-11.0.19+7"); + + String runtimeInfo = GaxProperties.getRuntimeVersion(); + assertEquals("11.0.19__Eclipse-Adoptium__Temurin-11.0.19-7", runtimeInfo); + } + + @Test + void testGetJavaRuntimeInfo_coretto() { + // This case is one of major Java vendors + System.setProperty("java.version", "11.0.19"); + System.setProperty("java.vendor", "Amazon.com Inc."); + System.setProperty("java.vendor.version", "Corretto-11.0.19.7.1"); + + String runtimeInfo = GaxProperties.getRuntimeVersion(); + assertEquals("11.0.19__Amazon.com-Inc.__Corretto-11.0.19.7.1", runtimeInfo); + } + + @Test + void testGetJavaRuntimeInfo_specialCharacters() { + // testing for unsupported characters and spaces + System.setProperty("java.version", "20%^.&0~.1#45`*"); + System.setProperty("java.vendor", "A^!@#$*B()[]{} C ~%& D-E ?"); + System.setProperty("java.vendor.version", "1!@%$@#.AB!346.9^"); + + String runtimeInfo = GaxProperties.getRuntimeVersion(); + assertEquals("20--.-0-.1-45--__A------B-------C-----D-E--__1------.AB-346.9-", runtimeInfo); + } + + @Test + void testGetJavaRuntimeInfo_nullVendorVersion() { + // testing for null java.vendor.version + System.setProperty("java.version", "20.0.1"); + System.setProperty("java.vendor", "Oracle"); + System.clearProperty("java.vendor.version"); + + String runtimeInfo = GaxProperties.getRuntimeVersion(); + assertEquals("20.0.1__Oracle", runtimeInfo); + } + + @Test + void testGetJavaRuntimeInfo_nullVendorAndVendorVersion() { + // testing for null java.vendor and java.vendor.version + System.setProperty("java.version", "20.0.1"); + System.clearProperty("java.vendor"); + System.clearProperty("java.vendor.version"); + + String runtimeInfo = GaxProperties.getRuntimeVersion(); + assertEquals("20.0.1", runtimeInfo); + } + + @Test + void testGetJavaRuntimeInfo_nullJavaVersion() { + // testing for null java.version + // We don't expect this case to happen, however we don't want the method to fail when it really + // happens. + + System.clearProperty("java.version"); + System.setProperty("java.vendor", "oracle"); + System.setProperty("java.vendor.version", "20.0.1"); + + String runtimeInfo = GaxProperties.getRuntimeVersion(); + assertEquals("null__oracle__20.0.1", runtimeInfo); + } + + @Test + public void testGetProtobufVersion() throws IOException { + assertTrue( + Pattern.compile("^\\d+\\.\\d+\\.\\d+").matcher(GaxProperties.getProtobufVersion()).find()); + } + + @Test + public void testGetBundleVersion_noManifestFile() throws IOException { + Optional version = getBundleVersion(GaxProperties.class); + + assertFalse(version.isPresent()); + } + + @Test + void testGetProtobufVersion_success() { + String version = + GaxProperties.getProtobufVersion( + Any.class, "com.google.api.gax.core.GaxPropertiesTest$RuntimeVersion"); + + assertEquals("3.13.6", version); + } + + @Test + void testGetProtobufVersion_classNotFoundException() throws Exception { + String version = GaxProperties.getProtobufVersion(Any.class, "foo.NonExistantClass"); + + assertTrue(Pattern.compile("^\\d+\\.\\d+\\.\\d+").matcher(version).find()); + } + + @Test + void testgetProtobufVersion_noSuchFieldException() throws Exception { + String version = GaxProperties.getProtobufVersion(Any.class, "java.lang.Class"); + + assertTrue(Pattern.compile("^\\d+\\.\\d+\\.\\d+").matcher(version).find()); + } + + @Test + void testGetProtobufVersion_noManifest() throws Exception { + String version = GaxProperties.getProtobufVersion(GaxProperties.class, "foo.NonExistantClass"); + + assertEquals("3", version); + } + + private Version readVersion(String version) { + assertTrue(Pattern.compile("^\\d+\\.\\d+\\.\\d+").matcher(version).find()); + String[] versionComponents = version.split("\\."); // This test was added in version 1.56.0, so check that the major and minor numbers are greater // than that. int major = Integer.parseInt(versionComponents[0]); int minor = Integer.parseInt(versionComponents[1]); + return new Version(major, minor); + } - assertTrue(major >= 1); - if (major == 1) { - assertTrue(minor >= 56); + private static class Version { + public int major; + public int minor; + + public Version(int major, int minor) { + this.major = major; + this.minor = minor; } } - @Test - public void testGetVersion_nativeImage() { - System.setProperty(PROPERTY_IMAGE_CODE_KEY, PROPERTY_IMAGE_CODE_VALUE_RUNTIME); - String javaVersion = GaxProperties.getJavaVersion(); - assertTrue(javaVersion.endsWith("-graalvm")); + // Test class that emulates com.google.protobuf.RuntimeVersion for reflection lookup of fields + class RuntimeVersion { + public static final int MAJOR = 3; + public static final int MINOR = 13; + public static final int PATCH = 6; } } diff --git a/gax-java/gax/src/test/java/com/google/api/gax/core/GoogleCredentialsProviderTest.java b/gax-java/gax/src/test/java/com/google/api/gax/core/GoogleCredentialsProviderTest.java index 9cea58f6a3..927e4a118b 100644 --- a/gax-java/gax/src/test/java/com/google/api/gax/core/GoogleCredentialsProviderTest.java +++ b/gax-java/gax/src/test/java/com/google/api/gax/core/GoogleCredentialsProviderTest.java @@ -30,20 +30,17 @@ package com.google.api.gax.core; import static com.google.common.truth.Truth.assertThat; -import static org.junit.Assert.assertTrue; +import static org.junit.jupiter.api.Assertions.assertTrue; import com.google.auth.Credentials; import com.google.auth.oauth2.ServiceAccountCredentials; import com.google.auth.oauth2.ServiceAccountJwtAccessCredentials; import com.google.common.collect.ImmutableList; import java.security.PrivateKey; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.junit.runners.JUnit4; +import org.junit.jupiter.api.Test; import org.mockito.Mockito; -@RunWith(JUnit4.class) -public class GoogleCredentialsProviderTest { +class GoogleCredentialsProviderTest { ServiceAccountCredentials CreateServiceAccountCredentials() { return ServiceAccountCredentials.newBuilder() .setClientId("fake-client-id") @@ -54,7 +51,7 @@ ServiceAccountCredentials CreateServiceAccountCredentials() { } @Test - public void serviceAccountReplacedWithJwtTokens() throws Exception { + void serviceAccountReplacedWithJwtTokens() throws Exception { ServiceAccountCredentials serviceAccountCredentials = CreateServiceAccountCredentials(); GoogleCredentialsProvider provider = @@ -71,10 +68,55 @@ public void serviceAccountReplacedWithJwtTokens() throws Exception { assertThat(jwtCreds.getClientEmail()).isEqualTo(serviceAccountCredentials.getClientEmail()); assertThat(jwtCreds.getPrivateKeyId()).isEqualTo(serviceAccountCredentials.getPrivateKeyId()); assertThat(jwtCreds.getPrivateKey()).isEqualTo(serviceAccountCredentials.getPrivateKey()); + assertThat(jwtCreds.getUniverseDomain()).isEqualTo(Credentials.GOOGLE_DEFAULT_UNIVERSE); } @Test - public void noJwtWithoutScopeMatch() throws Exception { + void serviceAccountReplacedWithJwtTokens_setEmptyDomain() throws Exception { + ServiceAccountCredentials serviceAccountCredentials = + CreateServiceAccountCredentials().toBuilder().setUniverseDomain("").build(); + + GoogleCredentialsProvider provider = + GoogleCredentialsProvider.newBuilder() + .setScopesToApply(ImmutableList.of("scope1", "scope2")) + .setJwtEnabledScopes(ImmutableList.of("scope1")) + .setOAuth2Credentials(serviceAccountCredentials) + .build(); + + Credentials credentials = provider.getCredentials(); + assertThat(credentials).isInstanceOf(ServiceAccountJwtAccessCredentials.class); + ServiceAccountJwtAccessCredentials jwtCreds = (ServiceAccountJwtAccessCredentials) credentials; + assertThat(jwtCreds.getClientId()).isEqualTo(serviceAccountCredentials.getClientId()); + assertThat(jwtCreds.getClientEmail()).isEqualTo(serviceAccountCredentials.getClientEmail()); + assertThat(jwtCreds.getPrivateKeyId()).isEqualTo(serviceAccountCredentials.getPrivateKeyId()); + assertThat(jwtCreds.getPrivateKey()).isEqualTo(serviceAccountCredentials.getPrivateKey()); + assertThat(jwtCreds.getUniverseDomain()).isEqualTo(Credentials.GOOGLE_DEFAULT_UNIVERSE); + } + + @Test + void serviceAccountReplacedWithJwtTokens_customUniverseDomain() throws Exception { + ServiceAccountCredentials serviceAccountCredentials = + CreateServiceAccountCredentials().toBuilder().setUniverseDomain("example.com").build(); + + GoogleCredentialsProvider provider = + GoogleCredentialsProvider.newBuilder() + .setScopesToApply(ImmutableList.of("scope1", "scope2")) + .setJwtEnabledScopes(ImmutableList.of("scope1")) + .setOAuth2Credentials(serviceAccountCredentials) + .build(); + + Credentials credentials = provider.getCredentials(); + assertThat(credentials).isInstanceOf(ServiceAccountJwtAccessCredentials.class); + ServiceAccountJwtAccessCredentials jwtCreds = (ServiceAccountJwtAccessCredentials) credentials; + assertThat(jwtCreds.getClientId()).isEqualTo(serviceAccountCredentials.getClientId()); + assertThat(jwtCreds.getClientEmail()).isEqualTo(serviceAccountCredentials.getClientEmail()); + assertThat(jwtCreds.getPrivateKeyId()).isEqualTo(serviceAccountCredentials.getPrivateKeyId()); + assertThat(jwtCreds.getPrivateKey()).isEqualTo(serviceAccountCredentials.getPrivateKey()); + assertThat(jwtCreds.getUniverseDomain()).isEqualTo("example.com"); + } + + @Test + void noJwtWithoutScopeMatch() throws Exception { ServiceAccountCredentials serviceAccountCredentials = CreateServiceAccountCredentials(); GoogleCredentialsProvider provider = @@ -97,10 +139,12 @@ public void noJwtWithoutScopeMatch() throws Exception { assertThat(serviceAccountCredentials2.getPrivateKey()) .isEqualTo(serviceAccountCredentials.getPrivateKey()); assertThat(serviceAccountCredentials2.getScopes()).containsExactly("scope1", "scope2"); + assertThat(serviceAccountCredentials2.getUniverseDomain()) + .isEqualTo(Credentials.GOOGLE_DEFAULT_UNIVERSE); } @Test - public void useJwtAccessWithScope() throws Exception { + void useJwtAccessWithScope() throws Exception { ServiceAccountCredentials serviceAccountCredentials = CreateServiceAccountCredentials(); GoogleCredentialsProvider provider = @@ -123,5 +167,7 @@ public void useJwtAccessWithScope() throws Exception { assertThat(serviceAccountCredentials2.getPrivateKey()) .isEqualTo(serviceAccountCredentials.getPrivateKey()); assertTrue(serviceAccountCredentials2.getUseJwtAccessWithScope()); + assertThat(serviceAccountCredentials2.getUniverseDomain()) + .isEqualTo(Credentials.GOOGLE_DEFAULT_UNIVERSE); } } diff --git a/gax-java/gax/src/test/java/com/google/api/gax/core/RecordingScheduler.java b/gax-java/gax/src/test/java/com/google/api/gax/core/RecordingScheduler.java index 6d8cf9119b..d495cf0d63 100644 --- a/gax-java/gax/src/test/java/com/google/api/gax/core/RecordingScheduler.java +++ b/gax-java/gax/src/test/java/com/google/api/gax/core/RecordingScheduler.java @@ -43,11 +43,10 @@ import org.mockito.Mockito; import org.mockito.invocation.InvocationOnMock; import org.mockito.stubbing.Answer; -import org.threeten.bp.Duration; public abstract class RecordingScheduler implements ScheduledExecutorService { - public abstract List getSleepDurations(); + public abstract List getSleepDurations(); public abstract int getIterationsCount(); @@ -56,7 +55,7 @@ public static RecordingScheduler create(final FakeApiClock clock) { // mock class fields: final ScheduledExecutorService executor = new ScheduledThreadPoolExecutor(1); - final List sleepDurations = new ArrayList<>(); + final List sleepDurations = new ArrayList<>(); final AtomicInteger iterationsCount = new AtomicInteger(0); // mock class methods: @@ -71,7 +70,8 @@ public ScheduledFuture answer(InvocationOnMock invocation) throws Throwable { Long delay = (Long) args[1]; TimeUnit unit = (TimeUnit) args[2]; iterationsCount.incrementAndGet(); - sleepDurations.add(Duration.ofMillis(TimeUnit.MILLISECONDS.convert(delay, unit))); + sleepDurations.add( + java.time.Duration.ofMillis(TimeUnit.MILLISECONDS.convert(delay, unit))); clock.incrementNanoTime(TimeUnit.NANOSECONDS.convert(delay, unit)); return executor.schedule(runnable, 0, TimeUnit.NANOSECONDS); } @@ -87,7 +87,7 @@ public List answer(InvocationOnMock invocation) throws Throwable { } }); - // List getSleepDurations() + // List getSleepDurations() when(mock.getSleepDurations()).thenReturn(sleepDurations); // int getIterationsCount() diff --git a/gax-java/gax/src/test/java/com/google/api/gax/logging/LogDataTest.java b/gax-java/gax/src/test/java/com/google/api/gax/logging/LogDataTest.java new file mode 100644 index 0000000000..ff19dcd958 --- /dev/null +++ b/gax-java/gax/src/test/java/com/google/api/gax/logging/LogDataTest.java @@ -0,0 +1,86 @@ +/* + * Copyright 2025 Google LLC + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Google LLC nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +package com.google.api.gax.logging; + +import static com.google.common.truth.Truth.assertThat; + +import com.google.common.collect.ImmutableMap; +import java.util.Map; +import org.junit.jupiter.api.Test; + +class LogDataTest { + + @Test + void toMapResponse_correctlyConvertsData() { + Map responsePayload = ImmutableMap.of("key", "value", "key2", 123); + LogData logData = + LogData.builder() + .serviceName("MyService") + .rpcName("myMethod") + .requestHeaders(ImmutableMap.of("fake header", "item")) + .requestId("abcd") + .responsePayload(responsePayload) + .build(); + + Map expectedMap = + ImmutableMap.of( + "serviceName", "MyService", + "rpcName", "myMethod", + "response.payload", responsePayload, + "requestId", "abcd"); + + assertThat(logData.toMapResponse()).isEqualTo(expectedMap); + } + + @Test + void toMapRequest_correctlyConvertsData() { + Map header = ImmutableMap.of("fake header", "item"); + LogData logData = + LogData.builder() + .serviceName("MyService") + .rpcName("myMethod") + .requestHeaders(header) + .requestId("abcd") + .httpUrl("url") + .responsePayload(ImmutableMap.of("key", "value", "key2", 123)) + .build(); + + Map expectedMap = + ImmutableMap.of( + "serviceName", "MyService", + "rpcName", "myMethod", + "request.headers", header, + "requestId", "abcd", + "request.url", "url"); + + assertThat(logData.toMapRequest()).isEqualTo(expectedMap); + } +} diff --git a/gax-java/gax/src/test/java/com/google/api/gax/logging/LoggerProviderTest.java b/gax-java/gax/src/test/java/com/google/api/gax/logging/LoggerProviderTest.java new file mode 100644 index 0000000000..b16e94e538 --- /dev/null +++ b/gax-java/gax/src/test/java/com/google/api/gax/logging/LoggerProviderTest.java @@ -0,0 +1,62 @@ +/* + * Copyright 2025 Google LLC + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Google LLC nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +package com.google.api.gax.logging; + +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertNotSame; +import static org.junit.jupiter.api.Assertions.assertSame; + +import org.junit.jupiter.api.Test; +import org.slf4j.Logger; + +class LoggerProviderTest { + + @Test + void testGetLogger_CreatesLoggerOnce() { + Class testClass = this.getClass(); + LoggerProvider provider = LoggerProvider.forClazz(testClass); + Logger logger1 = provider.getLogger(); + Logger logger2 = provider.getLogger(); + + assertNotNull(logger1); + assertSame(logger1, logger2); + } + + @Test + void testForClazz_ReturnsNewInstance() { + Class testClass1 = this.getClass(); + Class testClass2 = String.class; + LoggerProvider provider1 = LoggerProvider.forClazz(testClass1); + LoggerProvider provider2 = LoggerProvider.forClazz(testClass2); + + assertNotSame(provider1, provider2); + } +} diff --git a/gax-java/gax/src/test/java/com/google/api/gax/logging/LoggingEnabledTest.java b/gax-java/gax/src/test/java/com/google/api/gax/logging/LoggingEnabledTest.java new file mode 100644 index 0000000000..2d755a6ecc --- /dev/null +++ b/gax-java/gax/src/test/java/com/google/api/gax/logging/LoggingEnabledTest.java @@ -0,0 +1,73 @@ +/* + * Copyright 2025 Google LLC + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Google LLC nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +package com.google.api.gax.logging; + +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.when; + +import com.google.api.gax.logging.Slf4jUtils.LoggerFactoryProvider; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import org.slf4j.ILoggerFactory; +import org.slf4j.Logger; +import org.slf4j.helpers.NOPLogger; +import org.slf4j.helpers.NOPLoggerFactory; + +// These tests should only run when env GOOGLE_SDK_JAVA_LOGGING = true +// it is excluded by default and only included for `envVarTest` profile +class LoggingEnabledTest { + + @Test + void testIsLoggingEnabled_true() { + Assertions.assertTrue(LoggingUtils.isLoggingEnabled()); + } + + @Test + void testGetLogger_loggingEnabled_slf4jBindingPresent() { + // should get ILoggerFactory from TestServiceProvider + Logger logger = Slf4jUtils.getLogger(Slf4jUtilsTest.class); + Assertions.assertInstanceOf(Logger.class, logger); + Assertions.assertNotEquals(NOPLogger.class, logger.getClass()); + } + + @Test + void testGetLogger_loggingEnabled_noBinding_shouldGetNOPLogger() { + // Create a mock LoggerFactoryProvider, mimic SLF4J's behavior to return NOPLoggerFactory when + // no binding + LoggerFactoryProvider mockLoggerFactoryProvider = mock(LoggerFactoryProvider.class); + ILoggerFactory nopLoggerFactory = new NOPLoggerFactory(); + when(mockLoggerFactoryProvider.getLoggerFactory()).thenReturn(nopLoggerFactory); + + Logger logger = Slf4jUtils.getLogger(Slf4jUtilsTest.class, mockLoggerFactoryProvider); + + Assertions.assertInstanceOf(NOPLogger.class, logger); + } +} diff --git a/gax-java/gax/src/test/java/com/google/api/gax/logging/LoggingUtilsTest.java b/gax-java/gax/src/test/java/com/google/api/gax/logging/LoggingUtilsTest.java new file mode 100644 index 0000000000..e3acf17637 --- /dev/null +++ b/gax-java/gax/src/test/java/com/google/api/gax/logging/LoggingUtilsTest.java @@ -0,0 +1,122 @@ +/* + * Copyright 2025 Google LLC + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Google LLC nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +package com.google.api.gax.logging; + +import static org.junit.jupiter.api.Assertions.assertDoesNotThrow; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.mockito.ArgumentMatchers.any; +import static org.mockito.ArgumentMatchers.anyString; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.never; +import static org.mockito.Mockito.verify; +import static org.mockito.Mockito.when; + +import com.google.api.gax.logging.LoggingUtils.ThrowingRunnable; +import java.util.Collections; +import java.util.Map; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.Test; +import org.mockito.Mockito; +import org.slf4j.Logger; + +class LoggingUtilsTest { + + @Test + void testIsLoggingEnabled_defaultToFalse() { + assertFalse(LoggingUtils.isLoggingEnabled()); + } + + @Test + void testExecuteWithTryCatch_noException() { + assertDoesNotThrow( + () -> + LoggingUtils.executeWithTryCatch( + () -> { + // Some code that should not throw an exception + int x = 5; + int y = 10; + int z = x + y; + assertEquals(15, z); + })); + } + + @Test + void testExecuteWithTryCatch_WithException() throws Throwable { + ThrowingRunnable action = Mockito.mock(ThrowingRunnable.class); + Mockito.doThrow(new RuntimeException("Test Exception")).when(action).run(); + assertDoesNotThrow(() -> LoggingUtils.executeWithTryCatch(action)); + // Verify that the action was executed (despite the exception) + verify(action).run(); + } + + @Test + void testExecuteWithTryCatch_WithNoSuchMethodError() throws Throwable { + ThrowingRunnable action = Mockito.mock(ThrowingRunnable.class); + Mockito.doThrow(new NoSuchMethodError("Test Error")).when(action).run(); + assertDoesNotThrow(() -> LoggingUtils.executeWithTryCatch(action)); + // Verify that the action was executed (despite the error) + verify(action).run(); + } + + @AfterEach + void tearDown() { + LoggingUtils.setLoggingEnabled(false); + } + + @Test + void testLogActionableError_loggingDisabled() { + LoggingUtils.setLoggingEnabled(false); + LoggerProvider loggerProvider = mock(LoggerProvider.class); + + LoggingUtils.logActionableError( + Collections.emptyMap(), loggerProvider, "message"); + + verify(loggerProvider, never()).getLogger(); + } + + @Test + void testLogActionableError_success() { + LoggingUtils.setLoggingEnabled(true); + LoggerProvider loggerProvider = mock(LoggerProvider.class); + Logger logger = mock(Logger.class); + when(loggerProvider.getLogger()).thenReturn(logger); + + org.slf4j.spi.LoggingEventBuilder eventBuilder = mock(org.slf4j.spi.LoggingEventBuilder.class); + when(logger.atDebug()).thenReturn(eventBuilder); + when(eventBuilder.addKeyValue(anyString(), any())).thenReturn(eventBuilder); + + Map context = Collections.singletonMap("key", "value"); + LoggingUtils.logActionableError(context, loggerProvider, "message"); + + verify(loggerProvider).getLogger(); + } +} diff --git a/gax-java/gax/src/test/java/com/google/api/gax/logging/Slf4jUtilsTest.java b/gax-java/gax/src/test/java/com/google/api/gax/logging/Slf4jUtilsTest.java new file mode 100644 index 0000000000..b40ca1bc2c --- /dev/null +++ b/gax-java/gax/src/test/java/com/google/api/gax/logging/Slf4jUtilsTest.java @@ -0,0 +1,367 @@ +/* + * Copyright 2025 Google LLC + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Google LLC nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +package com.google.api.gax.logging; + +import static com.google.api.gax.logging.Slf4jLoggingHelpers.messageToMapWithGson; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertTrue; +import static org.mockito.ArgumentMatchers.anyMap; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.never; +import static org.mockito.Mockito.verify; +import static org.mockito.Mockito.when; + +import com.google.protobuf.Field; +import com.google.protobuf.Field.Cardinality; +import com.google.protobuf.InvalidProtocolBufferException; +import com.google.protobuf.Option; +import java.util.HashMap; +import java.util.Map; +import org.junit.jupiter.api.Test; +import org.mockito.Mockito; +import org.slf4j.Logger; +import org.slf4j.event.Level; +import org.slf4j.helpers.NOPLogger; + +class Slf4jUtilsTest { + + // This test should only run GOOGLE_SDK_JAVA_LOGGING != true + @Test + void testGetLogger_loggingDisabled_shouldGetNOPLogger() { + Logger logger = Slf4jUtils.getLogger(Slf4jUtilsTest.class); + assertEquals(NOPLogger.class, logger.getClass()); + assertFalse(logger.isInfoEnabled()); + assertFalse(logger.isDebugEnabled()); + } + + // These tests does not require GOOGLE_SDK_JAVA_LOGGING + @Test + void testLog_slf4J2xLogger() { + Map contextMap = new HashMap<>(); + contextMap.put("key1", "value"); + contextMap.put("key2", 123); + String message = "Test message"; + TestLogger testLogger = new TestLogger("test-logger"); + Slf4jUtils.log(testLogger, org.slf4j.event.Level.DEBUG, contextMap, message); + + assertEquals(message, testLogger.messageList.get(0)); + + assertEquals("value", testLogger.keyValuePairsMap.get("key1")); + assertEquals(123, testLogger.keyValuePairsMap.get("key2")); + } + + @Test + void testLogWithMDC_InfoLevel_VerifyMDC() { + // this test relies on TestMDCApapter and TestServiceProvider + TestLogger testLogger = new TestLogger("test-logger"); + Map contextMap = new HashMap<>(); + contextMap.put("key1", "value1"); + contextMap.put("key2", 123); + String message = "Test message"; + + // need a service provider + Slf4jUtils.logWithMDC(testLogger, Level.INFO, contextMap, message); + + Map mdcMap = testLogger.MDCMap; + + assertEquals(2, mdcMap.size()); + assertEquals("value1", mdcMap.get("key1")); + assertEquals("123", mdcMap.get("key2")); + + assertEquals(message, testLogger.messageList.get(0)); + } + + @Test + void testLogWithMDC_DEBUG() { + TestLogger testLogger = new TestLogger("test-logger"); + Slf4jUtils.logWithMDC(testLogger, Level.DEBUG, new HashMap<>(), "test message"); + + assertEquals(Level.DEBUG, testLogger.level); + } + + @Test + void testLogWithMDC_TRACE() { + TestLogger testLogger = new TestLogger("test-logger"); + Slf4jUtils.logWithMDC(testLogger, Level.TRACE, new HashMap<>(), "test message"); + + assertEquals(Level.TRACE, testLogger.level); + } + + @Test + void testLogWithMDC_WARN() { + TestLogger testLogger = new TestLogger("test-logger"); + Slf4jUtils.logWithMDC(testLogger, Level.WARN, new HashMap<>(), "test message"); + + assertEquals(Level.WARN, testLogger.level); + } + + @Test + void testLogWithMDC_ERROR() { + TestLogger testLogger = new TestLogger("test-logger"); + Slf4jUtils.logWithMDC(testLogger, Level.ERROR, new HashMap<>(), "test message"); + + assertEquals(Level.ERROR, testLogger.level); + } + + @Test + void testMessageToMap_ValidMessage() throws InvalidProtocolBufferException { + Field field = + Field.newBuilder() + .setNumber(2) + .setName("field_name1") + .addOptions(Option.newBuilder().setName("opt_name1").build()) + .addOptions(Option.newBuilder().setName("opt_name2").build()) + .setCardinality(Cardinality.CARDINALITY_OPTIONAL) + .build(); + + Map map = messageToMapWithGson(field); + + assertEquals("field_name1", map.get("name")); + assertEquals(2.0, map.get("number")); // Gson converts ints to doubles by default + } + + @Test + void testRecordServiceRpcAndRequestHeaders_infoEnabled() { + String serviceName = "testService"; + String rpcName = "testRpc"; + String endpoint = "http://test.com/endpoint"; + Map requestHeaders = new HashMap<>(); + requestHeaders.put("header1", "value1"); + requestHeaders.put("header2", "value2"); + + LogData.Builder logDataBuilder = LogData.builder(); + + TestLogger testLogger = new TestLogger("test-logger", true, true); + + Slf4jLoggingHelpers.recordServiceRpcAndRequestHeaders( + serviceName, + rpcName, + endpoint, + requestHeaders, + logDataBuilder, + setUpLoggerProviderMock(testLogger)); + + LogData logData = logDataBuilder.build(); + assertEquals(serviceName, logData.serviceName()); + assertEquals(rpcName, logData.rpcName()); + assertEquals(endpoint, logData.httpUrl()); + assertEquals(requestHeaders, logData.requestHeaders()); + } + + LoggerProvider setUpLoggerProviderMock(TestLogger testLogger) { + LoggerProvider loggerProvider = mock(LoggerProvider.class); + when(loggerProvider.getLogger()).thenReturn(testLogger); + return loggerProvider; + } + + @Test + void testRecordServiceRpcAndRequestHeaders_infoDisabled() { + String serviceName = "testService"; + String rpcName = "testRpc"; + String endpoint = "http://test.com/endpoint"; + Map requestHeaders = new HashMap<>(); + requestHeaders.put("header1", "value1"); + requestHeaders.put("header2", "value2"); + + LogData.Builder logDataBuilder = LogData.builder(); + + TestLogger testLogger = new TestLogger("test-logger", false, false); + + LoggerProvider loggerProvider = setUpLoggerProviderMock(testLogger); + Slf4jLoggingHelpers.recordServiceRpcAndRequestHeaders( + serviceName, rpcName, endpoint, requestHeaders, logDataBuilder, loggerProvider); + + LogData logData = logDataBuilder.build(); + assertEquals(null, logData.serviceName()); + assertEquals(null, logData.rpcName()); + assertEquals(null, logData.httpUrl()); + assertEquals(null, logData.requestHeaders()); + } + + @Test + void testRecordResponseHeaders_debugEnabled() { + Map responseHeaders = new HashMap<>(); + responseHeaders.put("header1", "value1"); + responseHeaders.put("header2", "value2"); + + LogData.Builder logDataBuilder = LogData.builder(); + TestLogger testLogger = new TestLogger("test-logger", true, true); + + Slf4jLoggingHelpers.recordResponseHeaders( + responseHeaders, logDataBuilder, setUpLoggerProviderMock(testLogger)); + + LogData logData = logDataBuilder.build(); + assertEquals(responseHeaders, logData.responseHeaders()); + } + + @Test + void testRecordResponseHeaders_debugDisabled() { + Map responseHeaders = new HashMap<>(); + responseHeaders.put("header1", "value1"); + responseHeaders.put("header2", "value2"); + + LogData.Builder logDataBuilder = LogData.builder(); + TestLogger testLogger = new TestLogger("test-logger", true, false); + + Slf4jLoggingHelpers.recordResponseHeaders( + responseHeaders, logDataBuilder, setUpLoggerProviderMock(testLogger)); + + LogData logData = logDataBuilder.build(); + assertEquals(null, logData.responseHeaders()); + } + + @Test + void testRecordResponsePayload_debugEnabled() { + + Field field = + Field.newBuilder() + .setName("field_name1") + .addOptions(Option.newBuilder().setName("opt_name1").build()) + .addOptions(Option.newBuilder().setName("opt_name2").build()) + .build(); + + LogData.Builder logDataBuilder = LogData.builder(); + TestLogger testLogger = new TestLogger("test-logger", true, true); + + Slf4jLoggingHelpers.recordResponsePayload( + field, logDataBuilder, setUpLoggerProviderMock(testLogger)); + + LogData logData = logDataBuilder.build(); + assertEquals(2, logData.responsePayload().size()); + assertEquals("field_name1", logData.responsePayload().get("name")); + assertEquals( + "[{name=opt_name1}, {name=opt_name2}]", + logData.responsePayload().get("options").toString()); + } + + @Test + void testLogRequest_infoEnabled_debugDisabled() { + Object message = new Object(); // not used in info path + LogData.Builder logDataBuilder = Mockito.mock(LogData.Builder.class); + + LogData.Builder testLogDataBuilder = + LogData.builder().serviceName("service-name").rpcName("rpc-name"); + when(logDataBuilder.build()).thenReturn(testLogDataBuilder.build()); + + TestLogger testLogger = new TestLogger("test", true, false); + Slf4jLoggingHelpers.logRequest(message, logDataBuilder, setUpLoggerProviderMock(testLogger)); + + assertEquals(2, testLogger.keyValuePairsMap.size()); + assertEquals("Sending request", testLogger.messageList.get(0)); + verify(logDataBuilder, never()).requestPayload(anyMap()); // Ensure debug path is not taken + + assertEquals(Level.INFO, testLogger.level); + } + + @Test + void testLogRequest_debugEnabled() throws InvalidProtocolBufferException { + Field field = + Field.newBuilder() + .setName("field_name1") + .addOptions(Option.newBuilder().setName("opt_name1").build()) + .addOptions(Option.newBuilder().setName("opt_name2").build()) + .build(); + + LogData.Builder logDataBuilder = Mockito.mock(LogData.Builder.class); + LogData.Builder testLogDataBuilder = + LogData.builder() + .serviceName("service-name") + .rpcName("rpc-name") + .requestPayload(Slf4jLoggingHelpers.messageToMapWithGson(field)); + when(logDataBuilder.build()).thenReturn(testLogDataBuilder.build()); + + TestLogger testLogger = new TestLogger("test-logger", true, true); + + Slf4jLoggingHelpers.logRequest(field, logDataBuilder, setUpLoggerProviderMock(testLogger)); + + verify(logDataBuilder).requestPayload(Slf4jLoggingHelpers.messageToMapWithGson(field)); + + assertEquals(3, testLogger.keyValuePairsMap.size()); + assertEquals(2, ((Map) testLogger.keyValuePairsMap.get("request.payload")).size()); + assertEquals("Sending request", testLogger.messageList.get(0)); + + assertEquals(Level.DEBUG, testLogger.level); + } + + @Test + void testLogResponse_infoEnabled_debugDisabled() { + String status = "OK"; + Map responseData = new HashMap<>(); + + LogData.Builder logDataBuilder = Mockito.mock(LogData.Builder.class); + LogData.Builder testLogDataBuilder = + LogData.builder() + .serviceName("service-name") + .rpcName("rpc-name") + .responsePayload(responseData); + when(logDataBuilder.build()).thenReturn(testLogDataBuilder.build()); + TestLogger testLogger = new TestLogger("test-logger", true, false); + + Slf4jLoggingHelpers.logResponse(status, logDataBuilder, setUpLoggerProviderMock(testLogger)); + + verify(logDataBuilder).responseStatus(status); + assertEquals("Received response", (testLogger).messageList.get(0)); + assertEquals(3, (testLogger).keyValuePairsMap.size()); + assertTrue((testLogger).keyValuePairsMap.containsKey("response.payload")); + assertEquals(Level.INFO, (testLogger).level); + } + + @Test + void testLogResponse_infoEnabled_debugEnabled() { + String status = "OK"; + Map responseData = new HashMap<>(); + + LogData.Builder logDataBuilder = Mockito.mock(LogData.Builder.class); + LogData.Builder testLogDataBuilder = + LogData.builder() + .serviceName("service-name") + .rpcName("rpc-name") + .responsePayload(responseData); + when(logDataBuilder.build()).thenReturn(testLogDataBuilder.build()); + TestLogger testLogger = new TestLogger("test-logger", true, true); + + Slf4jLoggingHelpers.logResponse(status, logDataBuilder, setUpLoggerProviderMock(testLogger)); + + verify(logDataBuilder).responseStatus(status); + assertEquals("Received response", (testLogger).messageList.get(0)); + assertEquals(3, (testLogger).keyValuePairsMap.size()); + assertTrue((testLogger).keyValuePairsMap.containsKey("response.payload")); + + assertEquals(Level.DEBUG, (testLogger).level); + } + + @Test + void testCheckIfClazzAvailable() { + assertFalse(Slf4jUtils.checkIfClazzAvailable("fake.class.should.not.be.in.classpath")); + assertTrue(Slf4jUtils.checkIfClazzAvailable("org.slf4j.event.KeyValuePair")); + } +} diff --git a/gax-java/gax/src/test/java/com/google/api/gax/logging/TestLogger.java b/gax-java/gax/src/test/java/com/google/api/gax/logging/TestLogger.java new file mode 100644 index 0000000000..3ee7e513cd --- /dev/null +++ b/gax-java/gax/src/test/java/com/google/api/gax/logging/TestLogger.java @@ -0,0 +1,301 @@ +/* + * Copyright 2025 Google LLC + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Google LLC nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +package com.google.api.gax.logging; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import org.slf4j.Logger; +import org.slf4j.MDC; +import org.slf4j.Marker; +import org.slf4j.event.KeyValuePair; +import org.slf4j.event.Level; +import org.slf4j.event.LoggingEvent; +import org.slf4j.spi.LoggingEventAware; + +/** Logger implementation for testing purposes only. Only implemented methods used in tests. */ +public class TestLogger implements Logger, LoggingEventAware { + Map MDCMap = new HashMap<>(); + List messageList = new ArrayList<>(); + Level level; + + Map keyValuePairsMap = new HashMap<>(); + + private String loggerName; + private boolean infoEnabled; + private boolean debugEnabled; + + public TestLogger(String name) { + loggerName = name; + infoEnabled = true; + debugEnabled = true; + } + + public TestLogger(String name, boolean info, boolean debug) { + loggerName = name; + infoEnabled = info; + debugEnabled = debug; + } + + @Override + public String getName() { + return loggerName; + } + + @Override + public boolean isTraceEnabled() { + return false; + } + + @Override + public void trace(String msg) { + level = Level.TRACE; + } + + @Override + public void trace(String format, Object arg) {} + + @Override + public void trace(String format, Object arg1, Object arg2) {} + + @Override + public void trace(String format, Object... arguments) {} + + @Override + public void trace(String msg, Throwable t) {} + + @Override + public boolean isTraceEnabled(Marker marker) { + return false; + } + + @Override + public void trace(Marker marker, String msg) {} + + @Override + public void trace(Marker marker, String format, Object arg) {} + + @Override + public void trace(Marker marker, String format, Object arg1, Object arg2) {} + + @Override + public void trace(Marker marker, String format, Object... argArray) {} + + @Override + public void trace(Marker marker, String msg, Throwable t) {} + + @Override + public boolean isDebugEnabled() { + return debugEnabled; + } + + @Override + public void debug(String msg) { + Map currentMDC = MDC.getCopyOfContextMap(); + MDCMap.putAll(currentMDC); + messageList.add(msg); + level = Level.DEBUG; + } + + @Override + public void debug(String format, Object arg) {} + + @Override + public void debug(String format, Object arg1, Object arg2) {} + + @Override + public void debug(String format, Object... arguments) {} + + @Override + public void debug(String msg, Throwable t) {} + + @Override + public boolean isDebugEnabled(Marker marker) { + return false; + } + + @Override + public void debug(Marker marker, String msg) {} + + @Override + public void debug(Marker marker, String format, Object arg) {} + + @Override + public void debug(Marker marker, String format, Object arg1, Object arg2) {} + + @Override + public void debug(Marker marker, String format, Object... arguments) {} + + @Override + public void debug(Marker marker, String msg, Throwable t) {} + + @Override + public boolean isInfoEnabled() { + return infoEnabled; + } + + @Override + public void info(String msg) { + // access MDC content here before it is cleared. + // TestMDCAdapter is set up via TestServiceProvider + // to allow MDC values recorded and copied for testing here + Map currentMDC = MDC.getCopyOfContextMap(); + MDCMap.putAll(currentMDC); + messageList.add(msg); + } + + @Override + public void info(String format, Object arg) {} + + @Override + public void info(String format, Object arg1, Object arg2) {} + + @Override + public void info(String format, Object... arguments) {} + + @Override + public void info(String msg, Throwable t) {} + + @Override + public boolean isInfoEnabled(Marker marker) { + return false; + } + + @Override + public void info(Marker marker, String msg) {} + + @Override + public void info(Marker marker, String format, Object arg) {} + + @Override + public void info(Marker marker, String format, Object arg1, Object arg2) {} + + @Override + public void info(Marker marker, String format, Object... arguments) {} + + @Override + public void info(Marker marker, String msg, Throwable t) {} + + @Override + public boolean isWarnEnabled() { + return false; + } + + @Override + public void warn(String msg) { + level = Level.WARN; + } + + @Override + public void warn(String format, Object arg) {} + + @Override + public void warn(String format, Object... arguments) {} + + @Override + public void warn(String format, Object arg1, Object arg2) {} + + @Override + public void warn(String msg, Throwable t) {} + + @Override + public boolean isWarnEnabled(Marker marker) { + return false; + } + + @Override + public void warn(Marker marker, String msg) {} + + @Override + public void warn(Marker marker, String format, Object arg) {} + + @Override + public void warn(Marker marker, String format, Object arg1, Object arg2) {} + + @Override + public void warn(Marker marker, String format, Object... arguments) {} + + @Override + public void warn(Marker marker, String msg, Throwable t) {} + + @Override + public boolean isErrorEnabled() { + return false; + } + + @Override + public void error(String msg) { + level = Level.ERROR; + } + + @Override + public void error(String format, Object arg) {} + + @Override + public void error(String format, Object arg1, Object arg2) {} + + @Override + public void error(String format, Object... arguments) {} + + @Override + public void error(String msg, Throwable t) {} + + @Override + public boolean isErrorEnabled(Marker marker) { + return false; + } + + @Override + public void error(Marker marker, String msg) {} + + @Override + public void error(Marker marker, String format, Object arg) {} + + @Override + public void error(Marker marker, String format, Object arg1, Object arg2) {} + + @Override + public void error(Marker marker, String format, Object... arguments) {} + + @Override + public void error(Marker marker, String msg, Throwable t) {} + + @Override + public void log(LoggingEvent event) { + messageList.add(event.getMessage()); + level = event.getLevel(); + List keyValuePairs = event.getKeyValuePairs(); + for (KeyValuePair pair : keyValuePairs) { + keyValuePairsMap.put(pair.key, pair.value); + } + } +} diff --git a/gax-java/gax/src/test/java/com/google/api/gax/logging/TestMDCAdapter.java b/gax-java/gax/src/test/java/com/google/api/gax/logging/TestMDCAdapter.java new file mode 100644 index 0000000000..b1b5d379cc --- /dev/null +++ b/gax-java/gax/src/test/java/com/google/api/gax/logging/TestMDCAdapter.java @@ -0,0 +1,86 @@ +/* + * Copyright 2025 Google LLC + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Google LLC nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +package com.google.api.gax.logging; + +import java.util.Deque; +import java.util.HashMap; +import java.util.Map; +import org.slf4j.spi.MDCAdapter; + +/** + * this adapter is for unit test only. It is set up via TestServiceProvider to test behavior when + * LogWithMDC + */ +public class TestMDCAdapter implements MDCAdapter { + Map mdcValues = new HashMap<>(); + + @Override + public void put(String key, String val) { + mdcValues.put(key, val); + } + + @Override + public String get(String key) { + return ""; + } + + @Override + public void remove(String key) {} + + @Override + public void clear() { + mdcValues.clear(); + } + + @Override + public Map getCopyOfContextMap() { + return mdcValues; + } + + @Override + public void setContextMap(Map contextMap) {} + + @Override + public void pushByKey(String key, String value) {} + + @Override + public String popByKey(String key) { + return ""; + } + + @Override + public Deque getCopyOfDequeByKey(String key) { + return null; + } + + @Override + public void clearDequeByKey(String key) {} +} diff --git a/gax-java/gax/src/test/java/com/google/api/gax/logging/TestServiceProvider.java b/gax-java/gax/src/test/java/com/google/api/gax/logging/TestServiceProvider.java new file mode 100644 index 0000000000..69cc43ba2a --- /dev/null +++ b/gax-java/gax/src/test/java/com/google/api/gax/logging/TestServiceProvider.java @@ -0,0 +1,73 @@ +/* + * Copyright 2025 Google LLC + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Google LLC nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +package com.google.api.gax.logging; + +import static org.mockito.ArgumentMatchers.anyString; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.when; + +import org.slf4j.ILoggerFactory; +import org.slf4j.IMarkerFactory; +import org.slf4j.spi.MDCAdapter; +import org.slf4j.spi.SLF4JServiceProvider; + +/** + * This provider is made discoverable to SFL4J's LoggerFactory in + * resources/META-INF/services/org.slf4j.spi.SLF4JServiceProvider + */ +public class TestServiceProvider implements SLF4JServiceProvider { + + @Override + public ILoggerFactory getLoggerFactory() { + // mock behavior when provider present + ILoggerFactory mockLoggerFactory = mock(ILoggerFactory.class); + when(mockLoggerFactory.getLogger(anyString())).thenReturn(new TestLogger("test-logger")); + return mockLoggerFactory; + } + + @Override + public IMarkerFactory getMarkerFactory() { + return null; + } + + @Override + public MDCAdapter getMDCAdapter() { + return new TestMDCAdapter(); + } + + @Override + public String getRequestedApiVersion() { + return ""; + } + + @Override + public void initialize() {} +} diff --git a/gax-java/gax/src/test/java/com/google/api/gax/longrunning/OperationFuturesTest.java b/gax-java/gax/src/test/java/com/google/api/gax/longrunning/OperationFuturesTest.java index 9b9ea96a56..c98aec4323 100644 --- a/gax-java/gax/src/test/java/com/google/api/gax/longrunning/OperationFuturesTest.java +++ b/gax-java/gax/src/test/java/com/google/api/gax/longrunning/OperationFuturesTest.java @@ -31,7 +31,8 @@ import static com.google.common.truth.Truth.assertThat; import static com.google.common.util.concurrent.MoreExecutors.directExecutor; -import static org.junit.Assert.fail; +import static org.junit.jupiter.api.Assertions.assertThrows; +import static org.junit.jupiter.api.Assertions.fail; import com.google.api.core.AbstractApiFuture; import com.google.api.core.ApiFunction; @@ -48,21 +49,24 @@ import java.util.concurrent.Callable; import java.util.concurrent.ExecutionException; import java.util.concurrent.TimeUnit; -import org.junit.Test; +import org.junit.jupiter.api.Test; -public class OperationFuturesTest { - @Test(expected = IllegalArgumentException.class) - public void testNotDone() { - OperationFutures.immediateOperationFuture( - FakeOperationSnapshot.newBuilder() - .setName("required") - .setDone(false) - .setErrorCode(FakeStatusCode.of(StatusCode.Code.OK)) - .build()); +class OperationFuturesTest { + @Test + void testNotDone() { + assertThrows( + IllegalArgumentException.class, + () -> + OperationFutures.immediateOperationFuture( + FakeOperationSnapshot.newBuilder() + .setName("required") + .setDone(false) + .setErrorCode(FakeStatusCode.of(Code.OK)) + .build())); } @Test - public void testCompleted() throws Exception { + void testCompleted() throws Exception { OperationFuture future = OperationFutures.immediateOperationFuture( FakeOperationSnapshot.newBuilder() @@ -78,7 +82,7 @@ public void testCompleted() throws Exception { } @Test - public void testFailed() throws Exception { + void testFailed() throws Exception { OperationFuture future = OperationFutures.immediateOperationFuture( FakeOperationSnapshot.newBuilder() @@ -98,7 +102,7 @@ public void testFailed() throws Exception { } @Test - public void testTransform() throws Exception { + void testTransform() throws Exception { // Test dependencies. MockRetryingFuture pollingFuture = new MockRetryingFuture<>(); SettableApiFuture initialFuture = SettableApiFuture.create(); diff --git a/gax-java/gax/src/test/java/com/google/api/gax/longrunning/OperationTimedPollAlgorithmTest.java b/gax-java/gax/src/test/java/com/google/api/gax/longrunning/OperationTimedPollAlgorithmTest.java new file mode 100644 index 0000000000..022a788672 --- /dev/null +++ b/gax-java/gax/src/test/java/com/google/api/gax/longrunning/OperationTimedPollAlgorithmTest.java @@ -0,0 +1,114 @@ +/* + * Copyright 2023 Google LLC + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Google LLC nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +package com.google.api.gax.longrunning; + +import static org.junit.jupiter.api.Assertions.assertThrows; +import static org.junit.jupiter.api.Assertions.assertTrue; +import static org.junit.jupiter.api.Assertions.fail; + +import com.google.api.gax.core.FakeApiClock; +import com.google.api.gax.retrying.RetrySettings; +import com.google.api.gax.retrying.TimedAttemptSettings; +import com.google.api.gax.util.FakeLogHandler; +import java.util.concurrent.CancellationException; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.threeten.bp.Duration; + +class OperationTimedPollAlgorithmTest { + + private static final RetrySettings FAST_RETRY_SETTINGS = + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(1L)) + .setRetryDelayMultiplier(1) + .setMaxRetryDelay(Duration.ofMillis(1L)) + .setInitialRpcTimeout(Duration.ofMillis(1L)) + .setMaxAttempts(0) + .setJittered(false) + .setRpcTimeoutMultiplier(1) + .setMaxRpcTimeout(Duration.ofMillis(1L)) + .setTotalTimeout(Duration.ofMillis(5L)) + .build(); + private TimedAttemptSettings timedAttemptSettings; + private FakeApiClock clock; + + private FakeLogHandler logHandler; + + @BeforeEach + void setUp() { + logHandler = new FakeLogHandler(); + OperationTimedPollAlgorithm.LOGGER.addHandler(logHandler); + clock = new FakeApiClock(System.nanoTime()); + timedAttemptSettings = + TimedAttemptSettings.newBuilder() + .setGlobalSettings(FAST_RETRY_SETTINGS) + .setRetryDelay(Duration.ofMillis(1l)) + .setRpcTimeout(Duration.ofMillis(1l)) + .setRandomizedRetryDelay(Duration.ofMillis(1l)) + .setAttemptCount(0) + .setFirstAttemptStartTimeNanos(clock.nanoTime()) + .build(); + } + + @AfterEach + void tearDown() { + OperationTimedPollAlgorithm.LOGGER.removeHandler(logHandler); + // redundant null assignment for readability - a new log handler will be used + logHandler = null; + } + + @Test + void testAlgorithmThatShouldRetry_doesNotLogTimeoutHelpMessage() { + OperationTimedPollAlgorithm algorithm = + OperationTimedPollAlgorithm.create(FAST_RETRY_SETTINGS, clock); + try { + algorithm.shouldRetry(timedAttemptSettings); + } catch (CancellationException ex) { + fail("Unexpected unsuccessful shouldRetry()"); + } + assertTrue( + logHandler.getAllMessages().stream() + .noneMatch( + entry -> entry.contains(OperationTimedPollAlgorithm.LRO_TROUBLESHOOTING_LINK))); + } + + @Test + void testAlgorithmThatShouldNotRetry_logsTimeoutHelpMessage() { + OperationTimedPollAlgorithm algorithm = + OperationTimedPollAlgorithm.create(FAST_RETRY_SETTINGS, clock); + clock.incrementNanoTime(1 * 1000 * 1000 * 1000); // force rpc timeout + assertThrows(CancellationException.class, () -> algorithm.shouldRetry(timedAttemptSettings)); + assertTrue( + logHandler.getAllMessages().stream() + .anyMatch( + entry -> entry.contains(OperationTimedPollAlgorithm.LRO_TROUBLESHOOTING_LINK))); + } +} diff --git a/gax-java/gax/src/test/java/com/google/api/gax/paging/PagesTest.java b/gax-java/gax/src/test/java/com/google/api/gax/paging/PagesTest.java index 8bf7d5bfb1..e265b20d09 100644 --- a/gax-java/gax/src/test/java/com/google/api/gax/paging/PagesTest.java +++ b/gax-java/gax/src/test/java/com/google/api/gax/paging/PagesTest.java @@ -31,11 +31,11 @@ import static com.google.common.truth.Truth.assertThat; -import org.junit.Test; +import org.junit.jupiter.api.Test; -public class PagesTest { +class PagesTest { @Test - public void testEmpty() { + void testEmpty() { assertThat(Pages.empty().iterateAll()).isEmpty(); } } diff --git a/gax-java/gax/src/test/java/com/google/api/gax/retrying/AbstractRetryingExecutorTest.java b/gax-java/gax/src/test/java/com/google/api/gax/retrying/AbstractRetryingExecutorTest.java index e376a7c7ad..c618096736 100644 --- a/gax-java/gax/src/test/java/com/google/api/gax/retrying/AbstractRetryingExecutorTest.java +++ b/gax-java/gax/src/test/java/com/google/api/gax/retrying/AbstractRetryingExecutorTest.java @@ -31,12 +31,12 @@ import static com.google.api.gax.retrying.FailingCallable.FAILING_RETRY_SETTINGS; import static com.google.api.gax.retrying.FailingCallable.FAST_RETRY_SETTINGS; -import static junit.framework.TestCase.assertFalse; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotNull; -import static org.junit.Assert.assertNull; -import static org.junit.Assert.assertSame; -import static org.junit.Assert.assertTrue; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertNull; +import static org.junit.jupiter.api.Assertions.assertSame; +import static org.junit.jupiter.api.Assertions.assertTrue; import static org.mockito.ArgumentMatchers.eq; import static org.mockito.Mockito.any; import static org.mockito.Mockito.anyInt; @@ -50,36 +50,46 @@ import com.google.api.gax.rpc.testing.FakeCallContext; import com.google.api.gax.tracing.ApiTracer; import com.google.common.base.Stopwatch; -import java.util.Arrays; -import java.util.Collection; import java.util.concurrent.CancellationException; import java.util.concurrent.ExecutionException; +import java.util.concurrent.Executors; +import java.util.concurrent.ScheduledExecutorService; import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeoutException; import java.util.concurrent.atomic.AtomicInteger; -import org.junit.Before; -import org.junit.Rule; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.junit.runners.Parameterized; -import org.junit.runners.Parameterized.Parameter; -import org.junit.runners.Parameterized.Parameters; +import java.util.stream.Stream; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.extension.ExtendWith; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.Arguments; +import org.junit.jupiter.params.provider.MethodSource; import org.mockito.Mock; -import org.mockito.junit.MockitoJUnit; -import org.mockito.junit.MockitoRule; -import org.threeten.bp.Duration; +import org.mockito.junit.jupiter.MockitoExtension; -@RunWith(Parameterized.class) +@ExtendWith(MockitoExtension.class) public abstract class AbstractRetryingExecutorTest { - @Parameters(name = "Custom retry settings: {0}") - public static Collection data() { - return Arrays.asList(new Object[][] {{false}, {true}}); + private static final int DEFAULT_AWAIT_TERMINATION_SEC = 10; + + // This is the default executor service for RetryingExecutor tests unless + // a local executor is specifically used + ScheduledExecutorService scheduledExecutorService; + + @BeforeEach + void setup() { + scheduledExecutorService = Executors.newSingleThreadScheduledExecutor(); } - @Parameter public boolean withCustomRetrySettings; + @AfterEach + void cleanup() throws InterruptedException { + scheduledExecutorService.shutdownNow(); + scheduledExecutorService.awaitTermination(DEFAULT_AWAIT_TERMINATION_SEC, TimeUnit.SECONDS); + } - @Rule public final MockitoRule mockitoRule = MockitoJUnit.rule(); + public static Stream data() { + return Stream.of(Arguments.of(false), Arguments.of(true)); + } @Mock protected ApiTracer tracer; protected RetryingContext retryingContext; @@ -90,7 +100,7 @@ protected abstract RetryingExecutorWithContext getExecutor( protected abstract RetryAlgorithm getAlgorithm( RetrySettings retrySettings, int apocalypseCountDown, RuntimeException apocalypseException); - protected void busyWaitForInitialResult(RetryingFuture future, Duration timeout) + protected void busyWaitForInitialResult(RetryingFuture future, java.time.Duration timeout) throws TimeoutException { Stopwatch watch = Stopwatch.createStarted(); while (future.peekAttemptResult() == null) { @@ -100,8 +110,7 @@ protected void busyWaitForInitialResult(RetryingFuture future, Duration t } } - @Before - public void setUp() { + void setUp(boolean withCustomRetrySettings) { if (withCustomRetrySettings) { retryingContext = FakeCallContext.createDefault().withTracer(tracer).withRetrySettings(FAST_RETRY_SETTINGS); @@ -110,16 +119,17 @@ public void setUp() { } } - private RetrySettings getDefaultRetrySettings() { - return withCustomRetrySettings ? FAILING_RETRY_SETTINGS : FAST_RETRY_SETTINGS; - } - - @Test - public void testSuccess() throws Exception { + @ParameterizedTest + @MethodSource("data") + void testSuccess(boolean withCustomRetrySettings) throws Exception { + setUp(withCustomRetrySettings); FailingCallable callable = new FailingCallable(0, "request", "SUCCESS", tracer); RetryingExecutorWithContext executor = - getExecutor(getAlgorithm(getDefaultRetrySettings(), 0, null)); + getExecutor( + getAlgorithm( + withCustomRetrySettings ? FAILING_RETRY_SETTINGS : FAST_RETRY_SETTINGS, 0, null)); RetryingFuture future = executor.createFuture(callable, retryingContext); + callable.setExternalFuture(future); future.setAttemptFuture(executor.submit(future)); assertFutureSuccess(future); @@ -130,29 +140,40 @@ public void testSuccess() throws Exception { verifyNoMoreInteractions(tracer); } - @Test - public void testSuccessWithFailures() throws Exception { + @ParameterizedTest + @MethodSource("data") + void testSuccessWithFailures(boolean withCustomRetrySettings) throws Exception { + setUp(withCustomRetrySettings); FailingCallable callable = new FailingCallable(5, "request", "SUCCESS", tracer); RetryingExecutorWithContext executor = - getExecutor(getAlgorithm(getDefaultRetrySettings(), 0, null)); + getExecutor( + getAlgorithm( + withCustomRetrySettings ? FAILING_RETRY_SETTINGS : FAST_RETRY_SETTINGS, 0, null)); RetryingFuture future = executor.createFuture(callable, retryingContext); + callable.setExternalFuture(future); future.setAttemptFuture(executor.submit(future)); assertFutureSuccess(future); assertEquals(5, future.getAttemptSettings().getAttemptCount()); verify(tracer, times(6)).attemptStarted(eq("request"), anyInt()); - verify(tracer, times(5)).attemptFailed(any(Throwable.class), any(Duration.class)); + verify(tracer, times(5)) + .attemptFailedDuration(any(Throwable.class), any(java.time.Duration.class)); verify(tracer, times(1)).attemptSucceeded(); verifyNoMoreInteractions(tracer); } - @Test - public void testSuccessWithFailuresPeekGetAttempt() throws Exception { + @ParameterizedTest + @MethodSource("data") + void testSuccessWithFailuresPeekGetAttempt(boolean withCustomRetrySettings) throws Exception { + setUp(withCustomRetrySettings); FailingCallable callable = new FailingCallable(5, "request", "SUCCESS", tracer); RetryingExecutorWithContext executor = - getExecutor(getAlgorithm(getDefaultRetrySettings(), 0, null)); + getExecutor( + getAlgorithm( + withCustomRetrySettings ? FAILING_RETRY_SETTINGS : FAST_RETRY_SETTINGS, 0, null)); RetryingFuture future = executor.createFuture(callable, retryingContext); + callable.setExternalFuture(future); assertNull(future.peekAttemptResult()); assertSame(future.peekAttemptResult(), future.peekAttemptResult()); @@ -173,36 +194,47 @@ public void testSuccessWithFailuresPeekGetAttempt() throws Exception { assertEquals(5, future.getAttemptSettings().getAttemptCount()); } - @Test - public void testMaxRetriesExceeded() throws Exception { + @ParameterizedTest + @MethodSource("data") + void testMaxRetriesExceeded(boolean withCustomRetrySettings) throws Exception { + setUp(withCustomRetrySettings); FailingCallable callable = new FailingCallable(6, "request", "FAILURE", tracer); RetryingExecutorWithContext executor = - getExecutor(getAlgorithm(getDefaultRetrySettings(), 0, null)); + getExecutor( + getAlgorithm( + withCustomRetrySettings ? FAILING_RETRY_SETTINGS : FAST_RETRY_SETTINGS, 0, null)); RetryingFuture future = executor.createFuture(callable, retryingContext); + callable.setExternalFuture(future); future.setAttemptFuture(executor.submit(future)); assertFutureFail(future, CustomException.class); assertEquals(5, future.getAttemptSettings().getAttemptCount()); verify(tracer, times(6)).attemptStarted(eq("request"), anyInt()); - verify(tracer, times(5)).attemptFailed(any(Throwable.class), any(Duration.class)); + verify(tracer, times(5)) + .attemptFailedDuration(any(Throwable.class), any(java.time.Duration.class)); verify(tracer, times(1)).attemptFailedRetriesExhausted(any(Throwable.class)); verifyNoMoreInteractions(tracer); } - @Test - public void testTotalTimeoutExceeded() throws Exception { + @ParameterizedTest + @MethodSource("data") + void testTotalTimeoutExceeded(boolean withCustomRetrySettings) throws Exception { + setUp(withCustomRetrySettings); RetrySettings retrySettings = - FAST_RETRY_SETTINGS - .toBuilder() - .setInitialRetryDelay(Duration.ofMillis(Integer.MAX_VALUE)) - .setMaxRetryDelay(Duration.ofMillis(Integer.MAX_VALUE)) + FAST_RETRY_SETTINGS.toBuilder() + .setInitialRetryDelayDuration(java.time.Duration.ofMillis(Integer.MAX_VALUE)) + .setMaxRetryDelayDuration(java.time.Duration.ofMillis(Integer.MAX_VALUE)) .build(); boolean useContextRetrySettings = retryingContext.getRetrySettings() != null; RetryingExecutorWithContext executor = getExecutor( getAlgorithm( - useContextRetrySettings ? getDefaultRetrySettings() : retrySettings, 0, null)); + useContextRetrySettings + ? withCustomRetrySettings ? FAILING_RETRY_SETTINGS : FAST_RETRY_SETTINGS + : retrySettings, + 0, + null)); FailingCallable callable = new FailingCallable(6, "request", "FAILURE", tracer); RetryingContext context; if (useContextRetrySettings) { @@ -211,6 +243,7 @@ public void testTotalTimeoutExceeded() throws Exception { context = FakeCallContext.createDefault().withTracer(tracer); } RetryingFuture future = executor.createFuture(callable, context); + callable.setExternalFuture(future); future.setAttemptFuture(executor.submit(future)); assertFutureFail(future, CustomException.class); @@ -221,38 +254,47 @@ public void testTotalTimeoutExceeded() throws Exception { verifyNoMoreInteractions(tracer); } - @Test - public void testCancelOuterFutureBeforeStart() throws Exception { - FailingCallable callable = new FailingCallable(4, "request", "SUCCESS", tracer); + @ParameterizedTest + @MethodSource("data") + void testCancelOuterFutureBeforeStart(boolean withCustomRetrySettings) { + setUp(withCustomRetrySettings); + FailingCallable callable = new FailingCallable(0, "request", "FAILURE", tracer); RetrySettings retrySettings = - FAST_RETRY_SETTINGS - .toBuilder() - .setInitialRetryDelay(Duration.ofMillis(1_000L)) - .setMaxRetryDelay(Duration.ofMillis(1_000L)) - .setTotalTimeout(Duration.ofMillis(10_0000L)) + FAST_RETRY_SETTINGS.toBuilder() + .setInitialRetryDelayDuration(java.time.Duration.ofMillis(1_000L)) + .setMaxRetryDelayDuration(java.time.Duration.ofMillis(1_000L)) + .setTotalTimeoutDuration(java.time.Duration.ofMillis(10_000L)) .build(); RetryingExecutorWithContext executor = getExecutor(getAlgorithm(retrySettings, 0, null)); RetryingFuture future = executor.createFuture(callable, retryingContext); + callable.setExternalFuture(future); boolean res = future.cancel(false); - assertTrue(res); + assertTrue(future.isCancelled()); future.setAttemptFuture(executor.submit(future)); - - assertFutureCancel(future); assertEquals(0, future.getAttemptSettings().getAttemptCount()); + // Tracer should have 0 interactions as the externalFuture has already been cancelled + // FailingCallable should exit immediately and no tracer logic should be invoked verifyNoMoreInteractions(tracer); } - @Test - public void testCancelByRetryingAlgorithm() throws Exception { + @ParameterizedTest + @MethodSource("data") + void testCancelByRetryingAlgorithm(boolean withCustomRetrySettings) throws Exception { + setUp(withCustomRetrySettings); FailingCallable callable = new FailingCallable(6, "request", "FAILURE", tracer); RetryingExecutorWithContext executor = - getExecutor(getAlgorithm(getDefaultRetrySettings(), 5, new CancellationException())); + getExecutor( + getAlgorithm( + withCustomRetrySettings ? FAILING_RETRY_SETTINGS : FAST_RETRY_SETTINGS, + 5, + new CancellationException())); RetryingFuture future = executor.createFuture(callable, retryingContext); + callable.setExternalFuture(future); future.setAttemptFuture(executor.submit(future)); assertFutureCancel(future); @@ -260,18 +302,26 @@ public void testCancelByRetryingAlgorithm() throws Exception { verify(tracer, times(5)).attemptStarted(eq("request"), anyInt()); // Pre-apocalypse failures - verify(tracer, times(4)).attemptFailed(any(Throwable.class), any(Duration.class)); + verify(tracer, times(4)) + .attemptFailedDuration(any(Throwable.class), any(java.time.Duration.class)); // Apocalypse failure verify(tracer, times(1)).attemptFailedRetriesExhausted(any(CancellationException.class)); verifyNoMoreInteractions(tracer); } - @Test - public void testUnexpectedExceptionFromRetryAlgorithm() throws Exception { + @ParameterizedTest + @MethodSource("data") + void testUnexpectedExceptionFromRetryAlgorithm(boolean withCustomRetrySettings) throws Exception { + setUp(withCustomRetrySettings); FailingCallable callable = new FailingCallable(6, "request", "FAILURE", tracer); RetryingExecutorWithContext executor = - getExecutor(getAlgorithm(getDefaultRetrySettings(), 5, new RuntimeException())); + getExecutor( + getAlgorithm( + withCustomRetrySettings ? FAILING_RETRY_SETTINGS : FAST_RETRY_SETTINGS, + 5, + new RuntimeException())); RetryingFuture future = executor.createFuture(callable, retryingContext); + callable.setExternalFuture(future); future.setAttemptFuture(executor.submit(future)); assertFutureFail(future, RuntimeException.class); @@ -279,19 +329,21 @@ public void testUnexpectedExceptionFromRetryAlgorithm() throws Exception { verify(tracer, times(5)).attemptStarted(eq("request"), anyInt()); // Pre-apocalypse failures - verify(tracer, times(4)).attemptFailed(any(Throwable.class), any(Duration.class)); + verify(tracer, times(4)) + .attemptFailedDuration(any(Throwable.class), any(java.time.Duration.class)); // Apocalypse failure verify(tracer, times(1)).attemptPermanentFailure(any(RuntimeException.class)); verifyNoMoreInteractions(tracer); } - @Test - public void testPollExceptionByPollAlgorithm() throws Exception { + @ParameterizedTest + @MethodSource("data") + void testPollExceptionByPollAlgorithm(boolean withCustomRetrySettings) throws Exception { + setUp(withCustomRetrySettings); RetrySettings retrySettings = - FAST_RETRY_SETTINGS - .toBuilder() - .setInitialRetryDelay(Duration.ofMillis(Integer.MAX_VALUE)) - .setMaxRetryDelay(Duration.ofMillis(Integer.MAX_VALUE)) + FAST_RETRY_SETTINGS.toBuilder() + .setInitialRetryDelayDuration(java.time.Duration.ofMillis(Integer.MAX_VALUE)) + .setMaxRetryDelayDuration(java.time.Duration.ofMillis(Integer.MAX_VALUE)) .build(); boolean useContextRetrySettings = retryingContext.getRetrySettings() != null; @@ -299,7 +351,9 @@ public void testPollExceptionByPollAlgorithm() throws Exception { new RetryAlgorithm<>( new TestResultRetryAlgorithm(0, null), new ExponentialPollAlgorithm( - useContextRetrySettings ? getDefaultRetrySettings() : retrySettings, + useContextRetrySettings + ? withCustomRetrySettings ? FAILING_RETRY_SETTINGS : FAST_RETRY_SETTINGS + : retrySettings, NanoClock.getDefaultClock())); RetryingExecutorWithContext executor = getExecutor(retryAlgorithm); @@ -311,6 +365,7 @@ public void testPollExceptionByPollAlgorithm() throws Exception { context = FakeCallContext.createDefault().withTracer(tracer); } RetryingFuture future = executor.createFuture(callable, context); + callable.setExternalFuture(future); future.setAttemptFuture(executor.submit(future)); assertFutureFail(future, PollException.class); @@ -323,6 +378,7 @@ public void testPollExceptionByPollAlgorithm() throws Exception { protected static class TestResultRetryAlgorithm extends BasicResultRetryAlgorithm { + private AtomicInteger apocalypseCountDown; private RuntimeException apocalypseException; diff --git a/gax-java/gax/src/test/java/com/google/api/gax/retrying/BasicRetryingFutureTest.java b/gax-java/gax/src/test/java/com/google/api/gax/retrying/BasicRetryingFutureTest.java index c95cda7ebf..5342f02965 100644 --- a/gax-java/gax/src/test/java/com/google/api/gax/retrying/BasicRetryingFutureTest.java +++ b/gax-java/gax/src/test/java/com/google/api/gax/retrying/BasicRetryingFutureTest.java @@ -30,37 +30,34 @@ package com.google.api.gax.retrying; import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.times; import com.google.api.gax.tracing.ApiTracer; import java.lang.reflect.Field; import java.util.concurrent.Callable; import java.util.logging.Level; import java.util.logging.Logger; -import org.junit.After; -import org.junit.Before; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.junit.runners.JUnit4; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; import org.mockito.ArgumentMatchers; import org.mockito.Mockito; -import org.threeten.bp.Duration; -@RunWith(JUnit4.class) -public class BasicRetryingFutureTest { +class BasicRetryingFutureTest { private Level logLevel; - @Before - public void setUp() throws Exception { + @BeforeEach + void setUp() throws Exception { logLevel = getLoggerInstance().getLevel(); } - @After - public void tearDown() throws Exception { + @AfterEach + void tearDown() throws Exception { getLoggerInstance().setLevel(logLevel); } @Test - public void testHandleAttemptDoesNotThrowNPEWhenLogLevelLowerThanFiner() throws Exception { + void testHandleAttemptDoesNotThrowNPEWhenLogLevelLowerThanFiner() throws Exception { @SuppressWarnings("unchecked") Callable callable = mock(Callable.class); @SuppressWarnings("unchecked") @@ -68,6 +65,9 @@ public void testHandleAttemptDoesNotThrowNPEWhenLogLevelLowerThanFiner() throws RetryingContext retryingContext = mock(RetryingContext.class); ApiTracer tracer = mock(ApiTracer.class); TimedAttemptSettings timedAttemptSettings = mock(TimedAttemptSettings.class); + java.time.Duration testDuration = java.time.Duration.ofMillis(123); + Mockito.when(timedAttemptSettings.getRandomizedRetryDelayDuration()).thenReturn(testDuration); + Mockito.when(timedAttemptSettings.getRetryDelayDuration()).thenReturn(testDuration); Mockito.when(retryingContext.getTracer()).thenReturn(tracer); @@ -96,12 +96,17 @@ public void testHandleAttemptDoesNotThrowNPEWhenLogLevelLowerThanFiner() throws future.handleAttempt(null, null); Mockito.verify(tracer) - .attemptFailed(ArgumentMatchers.any(), ArgumentMatchers.any()); + .attemptFailedDuration(ArgumentMatchers.isNull(), ArgumentMatchers.eq(testDuration)); + Mockito.verify(timedAttemptSettings, times(1)).getRetryDelayDuration(); + + Mockito.verify(tracer) + .attemptFailedDuration( + ArgumentMatchers.any(), ArgumentMatchers.any()); Mockito.verifyNoMoreInteractions(tracer); } @Test - public void testUsesRetryingContext() throws Exception { + void testUsesRetryingContext() throws Exception { @SuppressWarnings("unchecked") Callable callable = mock(Callable.class); @SuppressWarnings("unchecked") diff --git a/gax-java/gax/src/test/java/com/google/api/gax/retrying/DirectRetryingExecutorTest.java b/gax-java/gax/src/test/java/com/google/api/gax/retrying/DirectRetryingExecutorTest.java index b8a990fbb5..28c0154e91 100644 --- a/gax-java/gax/src/test/java/com/google/api/gax/retrying/DirectRetryingExecutorTest.java +++ b/gax-java/gax/src/test/java/com/google/api/gax/retrying/DirectRetryingExecutorTest.java @@ -30,11 +30,8 @@ package com.google.api.gax.retrying; import com.google.api.core.CurrentMillisClock; -import org.junit.runner.RunWith; -import org.mockito.junit.MockitoJUnitRunner; -@RunWith(MockitoJUnitRunner.class) -public class DirectRetryingExecutorTest extends AbstractRetryingExecutorTest { +class DirectRetryingExecutorTest extends AbstractRetryingExecutorTest { @Override protected RetryingExecutorWithContext getExecutor(RetryAlgorithm retryAlgorithm) { diff --git a/gax-java/gax/src/test/java/com/google/api/gax/retrying/ExponentialRetryAlgorithmTest.java b/gax-java/gax/src/test/java/com/google/api/gax/retrying/ExponentialRetryAlgorithmTest.java index b81c8c95bd..6b9c2176aa 100644 --- a/gax-java/gax/src/test/java/com/google/api/gax/retrying/ExponentialRetryAlgorithmTest.java +++ b/gax-java/gax/src/test/java/com/google/api/gax/retrying/ExponentialRetryAlgorithmTest.java @@ -30,129 +30,169 @@ package com.google.api.gax.retrying; import static com.google.common.truth.Truth.assertThat; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertTrue; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertTrue; import com.google.api.gax.core.FakeApiClock; import com.google.api.gax.rpc.testing.FakeCallContext; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.junit.runners.JUnit4; -import org.threeten.bp.Duration; +import org.junit.jupiter.api.Test; -@RunWith(JUnit4.class) -public class ExponentialRetryAlgorithmTest { +class ExponentialRetryAlgorithmTest { private final FakeApiClock clock = new FakeApiClock(0L); private final RetrySettings retrySettings = RetrySettings.newBuilder() .setMaxAttempts(6) - .setInitialRetryDelay(Duration.ofMillis(1L)) + .setInitialRetryDelayDuration(java.time.Duration.ofMillis(1L)) .setRetryDelayMultiplier(2.0) - .setMaxRetryDelay(Duration.ofMillis(8L)) - .setInitialRpcTimeout(Duration.ofMillis(1L)) + .setMaxRetryDelayDuration(java.time.Duration.ofMillis(8L)) + .setInitialRpcTimeoutDuration(java.time.Duration.ofMillis(1L)) .setRpcTimeoutMultiplier(2.0) - .setMaxRpcTimeout(Duration.ofMillis(8L)) - .setTotalTimeout(Duration.ofMillis(200L)) + .setMaxRpcTimeoutDuration(java.time.Duration.ofMillis(8L)) + .setTotalTimeoutDuration(java.time.Duration.ofMillis(200L)) .build(); private final ExponentialRetryAlgorithm algorithm = new ExponentialRetryAlgorithm(retrySettings, clock); private final RetrySettings retrySettingsOverride = RetrySettings.newBuilder() .setMaxAttempts(3) - .setInitialRetryDelay(Duration.ofMillis(2L)) + .setInitialRetryDelayDuration(java.time.Duration.ofMillis(2L)) .setRetryDelayMultiplier(3.0) - .setMaxRetryDelay(Duration.ofMillis(18L)) - .setInitialRpcTimeout(Duration.ofMillis(2L)) + .setMaxRetryDelayDuration(java.time.Duration.ofMillis(18L)) + .setInitialRpcTimeoutDuration(java.time.Duration.ofMillis(2L)) .setRpcTimeoutMultiplier(3.0) - .setMaxRpcTimeout(Duration.ofMillis(18L)) - .setTotalTimeout(Duration.ofMillis(300L)) + .setMaxRpcTimeoutDuration(java.time.Duration.ofMillis(18L)) + .setTotalTimeoutDuration(java.time.Duration.ofMillis(300L)) .build(); private final RetryingContext retryingContext = FakeCallContext.createDefault().withRetrySettings(retrySettingsOverride); @Test - public void testCreateFirstAttempt() { + void testCreateFirstAttempt() { TimedAttemptSettings attempt = algorithm.createFirstAttempt(); // Checking only the most core values, to not make this test too implementation specific. assertEquals(0, attempt.getAttemptCount()); assertEquals(0, attempt.getOverallAttemptCount()); - assertEquals(Duration.ZERO, attempt.getRetryDelay()); - assertEquals(Duration.ZERO, attempt.getRandomizedRetryDelay()); - assertEquals(Duration.ofMillis(1L), attempt.getRpcTimeout()); - assertEquals(Duration.ZERO, attempt.getRetryDelay()); + assertEquals(java.time.Duration.ZERO, attempt.getRetryDelayDuration()); + assertEquals(java.time.Duration.ZERO, attempt.getRandomizedRetryDelayDuration()); + assertEquals(java.time.Duration.ofMillis(1L), attempt.getRpcTimeoutDuration()); + assertEquals(java.time.Duration.ZERO, attempt.getRetryDelayDuration()); } @Test - public void testCreateFirstAttemptOverride() { + void testCreateFirstAttemptOverride() { TimedAttemptSettings attempt = algorithm.createFirstAttempt(retryingContext); // Checking only the most core values, to not make this test too implementation specific. assertEquals(0, attempt.getAttemptCount()); assertEquals(0, attempt.getOverallAttemptCount()); - assertEquals(Duration.ZERO, attempt.getRetryDelay()); - assertEquals(Duration.ZERO, attempt.getRandomizedRetryDelay()); - assertEquals(retrySettingsOverride.getInitialRpcTimeout(), attempt.getRpcTimeout()); - assertEquals(Duration.ZERO, attempt.getRetryDelay()); + assertEquals(java.time.Duration.ZERO, attempt.getRetryDelayDuration()); + assertEquals(java.time.Duration.ZERO, attempt.getRandomizedRetryDelayDuration()); + assertEquals( + retrySettingsOverride.getInitialRpcTimeoutDuration(), attempt.getRpcTimeoutDuration()); + assertEquals(java.time.Duration.ZERO, attempt.getRetryDelayDuration()); } @Test - public void testCreateNextAttempt() { + void testCreateFirstAttemptHasCorrectTimeout() { + long rpcTimeout = 100; + long totalTimeout = 10; + RetrySettings retrySettings = + RetrySettings.newBuilder() + .setMaxAttempts(6) + .setInitialRetryDelayDuration(java.time.Duration.ofMillis(1L)) + .setRetryDelayMultiplier(2.0) + .setMaxRetryDelayDuration(java.time.Duration.ofMillis(8L)) + .setInitialRpcTimeoutDuration(java.time.Duration.ofMillis(rpcTimeout)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeoutDuration(java.time.Duration.ofMillis(rpcTimeout)) + .setTotalTimeoutDuration(java.time.Duration.ofMillis(totalTimeout)) + .build(); + + ExponentialRetryAlgorithm algorithm = new ExponentialRetryAlgorithm(retrySettings, clock); + + TimedAttemptSettings attempt = algorithm.createFirstAttempt(); + assertEquals(java.time.Duration.ofMillis(totalTimeout), attempt.getRpcTimeoutDuration()); + + long overrideRpcTimeout = 100; + long overrideTotalTimeout = 20; + RetrySettings retrySettingsOverride = + retrySettings.toBuilder() + .setInitialRpcTimeoutDuration(java.time.Duration.ofMillis(overrideRpcTimeout)) + .setMaxRpcTimeoutDuration(java.time.Duration.ofMillis(overrideRpcTimeout)) + .setTotalTimeoutDuration(java.time.Duration.ofMillis(overrideTotalTimeout)) + .build(); + RetryingContext retryingContext = + FakeCallContext.createDefault().withRetrySettings(retrySettingsOverride); + attempt = algorithm.createFirstAttempt(retryingContext); + assertEquals( + java.time.Duration.ofMillis(overrideTotalTimeout), attempt.getRpcTimeoutDuration()); + + RetrySettings noTotalTimeout = + retrySettings.toBuilder().setTotalTimeoutDuration(java.time.Duration.ZERO).build(); + + algorithm = new ExponentialRetryAlgorithm(noTotalTimeout, clock); + attempt = algorithm.createFirstAttempt(); + assertEquals(attempt.getRpcTimeout(), retrySettings.getInitialRpcTimeout()); + } + + @Test + void testCreateNextAttempt() { TimedAttemptSettings firstAttempt = algorithm.createFirstAttempt(); TimedAttemptSettings secondAttempt = algorithm.createNextAttempt(firstAttempt); // Checking only the most core values, to not make this test too implementation specific. assertEquals(1, secondAttempt.getAttemptCount()); assertEquals(1, secondAttempt.getOverallAttemptCount()); - assertEquals(Duration.ofMillis(1L), secondAttempt.getRetryDelay()); - assertEquals(Duration.ofMillis(2L), secondAttempt.getRpcTimeout()); + assertEquals(java.time.Duration.ofMillis(1L), secondAttempt.getRetryDelayDuration()); + assertEquals(java.time.Duration.ofMillis(2L), secondAttempt.getRpcTimeoutDuration()); TimedAttemptSettings thirdAttempt = algorithm.createNextAttempt(secondAttempt); assertEquals(2, thirdAttempt.getAttemptCount()); - assertEquals(Duration.ofMillis(2L), thirdAttempt.getRetryDelay()); - assertEquals(Duration.ofMillis(4L), thirdAttempt.getRpcTimeout()); + assertEquals(java.time.Duration.ofMillis(2L), thirdAttempt.getRetryDelayDuration()); + assertEquals(java.time.Duration.ofMillis(4L), thirdAttempt.getRpcTimeoutDuration()); } @Test - public void testCreateNextAttemptOverride() { + void testCreateNextAttemptOverride() { TimedAttemptSettings firstAttempt = algorithm.createFirstAttempt(retryingContext); TimedAttemptSettings secondAttempt = algorithm.createNextAttempt(firstAttempt); // Checking only the most core values, to not make this test too implementation specific. assertEquals(1, secondAttempt.getAttemptCount()); assertEquals(1, secondAttempt.getOverallAttemptCount()); - assertEquals(Duration.ofMillis(2L), secondAttempt.getRetryDelay()); - assertEquals(Duration.ofMillis(6L), secondAttempt.getRpcTimeout()); + assertEquals(java.time.Duration.ofMillis(2L), secondAttempt.getRetryDelayDuration()); + assertEquals(java.time.Duration.ofMillis(6L), secondAttempt.getRpcTimeoutDuration()); TimedAttemptSettings thirdAttempt = algorithm.createNextAttempt(secondAttempt); assertEquals(2, thirdAttempt.getAttemptCount()); - assertEquals(Duration.ofMillis(6L), thirdAttempt.getRetryDelay()); - assertEquals(Duration.ofMillis(18L), thirdAttempt.getRpcTimeout()); + assertEquals(java.time.Duration.ofMillis(6L), thirdAttempt.getRetryDelayDuration()); + assertEquals(java.time.Duration.ofMillis(18L), thirdAttempt.getRpcTimeoutDuration()); } @Test - public void testTruncateToTotalTimeout() { + void testTruncateToTotalTimeout() { RetrySettings timeoutSettings = - retrySettings - .toBuilder() - .setInitialRpcTimeout(Duration.ofSeconds(4L)) - .setMaxRpcTimeout(Duration.ofSeconds(4L)) - .setTotalTimeout(Duration.ofSeconds(4L)) + retrySettings.toBuilder() + .setInitialRpcTimeoutDuration(java.time.Duration.ofSeconds(4L)) + .setMaxRpcTimeoutDuration(java.time.Duration.ofSeconds(4L)) + .setTotalTimeoutDuration(java.time.Duration.ofSeconds(4L)) .build(); ExponentialRetryAlgorithm timeoutAlg = new ExponentialRetryAlgorithm(timeoutSettings, clock); TimedAttemptSettings firstAttempt = timeoutAlg.createFirstAttempt(); TimedAttemptSettings secondAttempt = timeoutAlg.createNextAttempt(firstAttempt); - assertThat(secondAttempt.getRpcTimeout()).isAtLeast(firstAttempt.getRpcTimeout()); - assertThat(secondAttempt.getRpcTimeout()).isAtMost(Duration.ofSeconds(4L)); + assertThat(secondAttempt.getRpcTimeoutDuration()) + .isAtLeast(firstAttempt.getRpcTimeoutDuration()); + assertThat(secondAttempt.getRpcTimeoutDuration()).isAtMost(java.time.Duration.ofSeconds(4L)); TimedAttemptSettings thirdAttempt = timeoutAlg.createNextAttempt(secondAttempt); - assertThat(thirdAttempt.getRpcTimeout()).isAtMost(Duration.ofSeconds(4L)); + assertThat(thirdAttempt.getRpcTimeoutDuration()).isAtMost(java.time.Duration.ofSeconds(4L)); } @Test - public void testShouldRetryTrue() { + void testShouldRetryTrue() { TimedAttemptSettings attempt = algorithm.createFirstAttempt(); for (int i = 0; i < 2; i++) { attempt = algorithm.createNextAttempt(attempt); @@ -162,7 +202,7 @@ public void testShouldRetryTrue() { } @Test - public void testShouldRetryFalseOnMaxAttempts() { + void testShouldRetryFalseOnMaxAttempts() { TimedAttemptSettings attempt = algorithm.createFirstAttempt(); for (int i = 0; i < 6; i++) { assertTrue(algorithm.shouldRetry(attempt)); @@ -172,15 +212,26 @@ public void testShouldRetryFalseOnMaxAttempts() { assertFalse(algorithm.shouldRetry(attempt)); } + // First attempt runs at 0ms + // Second attempt runs at 60ms if shouldRetry is true + // - RPC timeout is 2ms and Time Left is 140ms (shouldRetry == true) + // Third attempt runs at 60ms if shouldRetry is true + // - RPC timeout is 4ms and Time Left is 120ms (shouldRetry == true) + // Fourth attempt runs at 60ms if shouldRetry is true + // - RPC timeout is 8ms and Time Left is 20ms (shouldRetry == true) + // Fifth attempt runs at 60ms if shouldRetry is true + // - RPC timeout is 8ms and Time Left is -40ms (shouldRetry == false) @Test - public void testShouldRetryFalseOnMaxTimeout() { + void testShouldRetryFalseOnMaxTimeout() { + // Simulate each attempt with 60ms of clock time. + // "attempt" = RPC Timeout + createNextAttempt() and shouldRetry() TimedAttemptSettings attempt = algorithm.createFirstAttempt(); - for (int i = 0; i < 4; i++) { + clock.incrementNanoTime(java.time.Duration.ofMillis(60L).toNanos()); + for (int i = 0; i < 3; i++) { assertTrue(algorithm.shouldRetry(attempt)); attempt = algorithm.createNextAttempt(attempt); - clock.incrementNanoTime(Duration.ofMillis(60L).toNanos()); + clock.incrementNanoTime(java.time.Duration.ofMillis(60L).toNanos()); } - assertFalse(algorithm.shouldRetry(attempt)); } } diff --git a/gax-java/gax/src/test/java/com/google/api/gax/retrying/FailingCallable.java b/gax-java/gax/src/test/java/com/google/api/gax/retrying/FailingCallable.java index 9b7524ec6a..5fb8a2892b 100644 --- a/gax-java/gax/src/test/java/com/google/api/gax/retrying/FailingCallable.java +++ b/gax-java/gax/src/test/java/com/google/api/gax/retrying/FailingCallable.java @@ -30,33 +30,33 @@ package com.google.api.gax.retrying; import com.google.api.gax.tracing.ApiTracer; +import com.google.common.base.Preconditions; import java.util.concurrent.Callable; import java.util.concurrent.CountDownLatch; import java.util.concurrent.atomic.AtomicInteger; -import org.threeten.bp.Duration; class FailingCallable implements Callable { static final RetrySettings FAST_RETRY_SETTINGS = RetrySettings.newBuilder() .setMaxAttempts(6) - .setInitialRetryDelay(Duration.ofMillis(8L)) + .setInitialRetryDelayDuration(java.time.Duration.ofMillis(8L)) .setRetryDelayMultiplier(1) - .setMaxRetryDelay(Duration.ofMillis(8L)) - .setInitialRpcTimeout(Duration.ofMillis(8L)) + .setMaxRetryDelayDuration(java.time.Duration.ofMillis(8L)) + .setInitialRpcTimeoutDuration(java.time.Duration.ofMillis(8L)) .setRpcTimeoutMultiplier(1) - .setMaxRpcTimeout(Duration.ofMillis(8L)) - .setTotalTimeout(Duration.ofMillis(400L)) + .setMaxRpcTimeoutDuration(java.time.Duration.ofMillis(8L)) + .setTotalTimeoutDuration(java.time.Duration.ofMillis(400L)) .build(); static final RetrySettings FAILING_RETRY_SETTINGS = RetrySettings.newBuilder() .setMaxAttempts(2) - .setInitialRetryDelay(Duration.ofNanos(1L)) + .setInitialRetryDelayDuration(java.time.Duration.ofNanos(1L)) .setRetryDelayMultiplier(1) - .setMaxRetryDelay(Duration.ofNanos(1L)) - .setInitialRpcTimeout(Duration.ofNanos(1L)) + .setMaxRetryDelayDuration(java.time.Duration.ofNanos(1L)) + .setInitialRpcTimeoutDuration(java.time.Duration.ofNanos(1L)) .setRpcTimeoutMultiplier(1) - .setMaxRpcTimeout(Duration.ofNanos(1L)) - .setTotalTimeout(Duration.ofNanos(1L)) + .setMaxRpcTimeoutDuration(java.time.Duration.ofNanos(1L)) + .setTotalTimeoutDuration(java.time.Duration.ofNanos(1L)) .build(); private AtomicInteger attemptsCount = new AtomicInteger(0); @@ -66,6 +66,8 @@ class FailingCallable implements Callable { private final String result; private final CountDownLatch firstAttemptFinished = new CountDownLatch(1); + private volatile RetryingFuture externalFuture; + FailingCallable(int expectedFailuresCount, String request, String result, ApiTracer tracer) { this.request = request; this.tracer = tracer; @@ -73,6 +75,14 @@ class FailingCallable implements Callable { this.result = result; } + // ExternalFuture should always be passed in when using the FailingCallable + // to accurately mimic the behavior of AttemptCallable. We use the external + // future to check that the future is done and that none of the callable's + // logic is run. + void setExternalFuture(RetryingFuture externalFuture) { + this.externalFuture = Preconditions.checkNotNull(externalFuture); + } + CountDownLatch getFirstAttemptFinishedLatch() { return firstAttemptFinished; } @@ -80,6 +90,12 @@ CountDownLatch getFirstAttemptFinishedLatch() { @Override public String call() throws Exception { try { + // Assumption is that externalFuture is always passed in. + // No null check to confirm so that the test will fail if + // the externalFuture is not passed in + if (externalFuture.isDone()) { + return null; + } int attemptNumber = attemptsCount.getAndIncrement(); tracer.attemptStarted(request, attemptNumber); diff --git a/gax-java/gax/src/test/java/com/google/api/gax/retrying/NoopRetryingContextTest.java b/gax-java/gax/src/test/java/com/google/api/gax/retrying/NoopRetryingContextTest.java index 23a00470d6..a574a157a8 100644 --- a/gax-java/gax/src/test/java/com/google/api/gax/retrying/NoopRetryingContextTest.java +++ b/gax-java/gax/src/test/java/com/google/api/gax/retrying/NoopRetryingContextTest.java @@ -29,31 +29,28 @@ */ package com.google.api.gax.retrying; -import static org.junit.Assert.assertNull; -import static org.junit.Assert.assertSame; +import static org.junit.jupiter.api.Assertions.assertNull; +import static org.junit.jupiter.api.Assertions.assertSame; import com.google.api.gax.tracing.BaseApiTracer; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.junit.runners.JUnit4; +import org.junit.jupiter.api.Test; -@RunWith(JUnit4.class) -public class NoopRetryingContextTest { +class NoopRetryingContextTest { @Test - public void testGetTracer() { + void testGetTracer() { RetryingContext context = NoopRetryingContext.create(); assertSame(BaseApiTracer.getInstance(), context.getTracer()); } @Test - public void testGetRetrySettings() { + void testGetRetrySettings() { RetryingContext context = NoopRetryingContext.create(); assertNull(context.getRetrySettings()); } @Test - public void testGetRetryableCodes() { + void testGetRetryableCodes() { RetryingContext context = NoopRetryingContext.create(); assertNull(context.getRetryableCodes()); } diff --git a/gax-java/gax/src/test/java/com/google/api/gax/retrying/RetryAlgorithmTest.java b/gax-java/gax/src/test/java/com/google/api/gax/retrying/RetryAlgorithmTest.java index a08cdee7f6..bdb89f1943 100644 --- a/gax-java/gax/src/test/java/com/google/api/gax/retrying/RetryAlgorithmTest.java +++ b/gax-java/gax/src/test/java/com/google/api/gax/retrying/RetryAlgorithmTest.java @@ -29,21 +29,18 @@ */ package com.google.api.gax.retrying; -import static org.junit.Assert.assertFalse; +import static org.junit.jupiter.api.Assertions.assertFalse; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.junit.runners.JUnit4; +import org.junit.jupiter.api.Test; @SuppressWarnings({"unchecked", "deprecation"}) -@RunWith(JUnit4.class) -public class RetryAlgorithmTest { +class RetryAlgorithmTest { @Test - public void testCreateFirstAttempt() { + void testCreateFirstAttempt() { TimedRetryAlgorithm timedAlgorithm = mock(TimedRetryAlgorithm.class); RetryAlgorithm algorithm = new RetryAlgorithm<>(mock(ResultRetryAlgorithm.class), timedAlgorithm); @@ -53,7 +50,7 @@ public void testCreateFirstAttempt() { } @Test - public void testCreateFirstAttemptWithUnusedContext() { + void testCreateFirstAttemptWithUnusedContext() { TimedRetryAlgorithm timedAlgorithm = mock(TimedRetryAlgorithm.class); RetryAlgorithm algorithm = new RetryAlgorithm<>(mock(ResultRetryAlgorithm.class), timedAlgorithm); @@ -64,7 +61,7 @@ public void testCreateFirstAttemptWithUnusedContext() { } @Test - public void testCreateFirstAttemptWithContext() { + void testCreateFirstAttemptWithContext() { TimedRetryAlgorithmWithContext timedAlgorithm = mock(TimedRetryAlgorithmWithContext.class); RetryAlgorithm algorithm = new RetryAlgorithm<>(mock(ResultRetryAlgorithmWithContext.class), timedAlgorithm); @@ -75,7 +72,7 @@ public void testCreateFirstAttemptWithContext() { } @Test - public void testCreateFirstAttemptWithNullContext() { + void testCreateFirstAttemptWithNullContext() { TimedRetryAlgorithmWithContext timedAlgorithm = mock(TimedRetryAlgorithmWithContext.class); RetryAlgorithm algorithm = new RetryAlgorithm<>(mock(ResultRetryAlgorithmWithContext.class), timedAlgorithm); @@ -85,7 +82,7 @@ public void testCreateFirstAttemptWithNullContext() { } @Test - public void testNextAttempt() { + void testNextAttempt() { ResultRetryAlgorithm resultAlgorithm = mock(ResultRetryAlgorithm.class); TimedRetryAlgorithm timedAlgorithm = mock(TimedRetryAlgorithm.class); RetryAlgorithm algorithm = new RetryAlgorithm<>(resultAlgorithm, timedAlgorithm); @@ -99,7 +96,7 @@ public void testNextAttempt() { } @Test - public void testNextAttemptWithContext() { + void testNextAttemptWithContext() { ResultRetryAlgorithmWithContext resultAlgorithm = mock(ResultRetryAlgorithmWithContext.class); TimedRetryAlgorithmWithContext timedAlgorithm = mock(TimedRetryAlgorithmWithContext.class); @@ -115,7 +112,7 @@ public void testNextAttemptWithContext() { } @Test - public void testShouldRetry() { + void testShouldRetry() { ResultRetryAlgorithm resultAlgorithm = mock(ResultRetryAlgorithm.class); TimedRetryAlgorithm timedAlgorithm = mock(TimedRetryAlgorithm.class); RetryAlgorithm algorithm = new RetryAlgorithm<>(resultAlgorithm, timedAlgorithm); @@ -129,7 +126,7 @@ public void testShouldRetry() { } @Test - public void testShouldRetry_usesTimedAlgorithm() { + void testShouldRetry_usesTimedAlgorithm() { ResultRetryAlgorithm resultAlgorithm = mock(ResultRetryAlgorithm.class); TimedRetryAlgorithm timedAlgorithm = mock(TimedRetryAlgorithm.class); RetryAlgorithm algorithm = new RetryAlgorithm<>(resultAlgorithm, timedAlgorithm); @@ -144,7 +141,7 @@ public void testShouldRetry_usesTimedAlgorithm() { } @Test - public void testShouldRetryWithContext() { + void testShouldRetryWithContext() { ResultRetryAlgorithmWithContext resultAlgorithm = mock(ResultRetryAlgorithmWithContext.class); TimedRetryAlgorithmWithContext timedAlgorithm = mock(TimedRetryAlgorithmWithContext.class); @@ -160,7 +157,7 @@ public void testShouldRetryWithContext() { } @Test - public void testShouldRetryWithContext_usesTimedAlgorithm() { + void testShouldRetryWithContext_usesTimedAlgorithm() { ResultRetryAlgorithmWithContext resultAlgorithm = mock(ResultRetryAlgorithmWithContext.class); TimedRetryAlgorithmWithContext timedAlgorithm = mock(TimedRetryAlgorithmWithContext.class); @@ -177,7 +174,7 @@ public void testShouldRetryWithContext_usesTimedAlgorithm() { } @Test - public void testShouldRetry_noPreviousSettings() { + void testShouldRetry_noPreviousSettings() { ResultRetryAlgorithm resultAlgorithm = mock(ResultRetryAlgorithm.class); TimedRetryAlgorithm timedAlgorithm = mock(TimedRetryAlgorithm.class); RetryAlgorithm algorithm = new RetryAlgorithm<>(resultAlgorithm, timedAlgorithm); @@ -190,7 +187,7 @@ public void testShouldRetry_noPreviousSettings() { } @Test - public void testShouldRetryWithContext_noPreviousSettings() { + void testShouldRetryWithContext_noPreviousSettings() { ResultRetryAlgorithmWithContext resultAlgorithm = mock(ResultRetryAlgorithmWithContext.class); TimedRetryAlgorithmWithContext timedAlgorithm = mock(TimedRetryAlgorithmWithContext.class); diff --git a/gax-java/gax/src/test/java/com/google/api/gax/retrying/RetrySettingsTest.java b/gax-java/gax/src/test/java/com/google/api/gax/retrying/RetrySettingsTest.java index 8bcdea4cc8..fa22880ca3 100644 --- a/gax-java/gax/src/test/java/com/google/api/gax/retrying/RetrySettingsTest.java +++ b/gax-java/gax/src/test/java/com/google/api/gax/retrying/RetrySettingsTest.java @@ -29,50 +29,110 @@ */ package com.google.api.gax.retrying; +import static com.google.api.gax.util.TimeConversionTestUtils.testDurationMethod; + import com.google.common.truth.Truth; -import org.junit.Test; -import org.threeten.bp.Duration; +import org.junit.jupiter.api.Test; -public class RetrySettingsTest { +class RetrySettingsTest { + private static final RetrySettings.Builder DEFAULT_BUILDER = + RetrySettings.newBuilder() + .setMaxRpcTimeoutDuration(java.time.Duration.ofMillis(5000l)) + .setMaxRetryDelayDuration(java.time.Duration.ofMillis(5000l)); @Test - public void retrySettingsSetLogicalTimeout() { - Duration timeout = Duration.ofMillis(60000); + void retrySettingsSetLogicalTimeout() { + java.time.Duration timeout = java.time.Duration.ofMillis(60000); RetrySettings retrySettings = RetrySettings.newBuilder().setLogicalTimeout(timeout).build(); Truth.assertThat(retrySettings.getRpcTimeoutMultiplier()).isEqualTo(1); - Truth.assertThat(retrySettings.getInitialRpcTimeout()).isEqualTo(timeout); - Truth.assertThat(retrySettings.getMaxRpcTimeout()).isEqualTo(timeout); - Truth.assertThat(retrySettings.getTotalTimeout()).isEqualTo(timeout); + Truth.assertThat(retrySettings.getInitialRpcTimeoutDuration()).isEqualTo(timeout); + Truth.assertThat(retrySettings.getMaxRpcTimeoutDuration()).isEqualTo(timeout); + Truth.assertThat(retrySettings.getTotalTimeoutDuration()).isEqualTo(timeout); } @Test - public void retrySettingsMerge() { + void retrySettingsMerge() { RetrySettings.Builder builder = RetrySettings.newBuilder() - .setTotalTimeout(Duration.ofMillis(45000)) - .setInitialRpcTimeout(Duration.ofMillis(2000)) + .setTotalTimeoutDuration(java.time.Duration.ofMillis(45000)) + .setInitialRpcTimeoutDuration(java.time.Duration.ofMillis(2000)) .setRpcTimeoutMultiplier(1.5) - .setMaxRpcTimeout(Duration.ofMillis(30000)) - .setInitialRetryDelay(Duration.ofMillis(100)) + .setMaxRpcTimeoutDuration(java.time.Duration.ofMillis(30000)) + .setInitialRetryDelayDuration(java.time.Duration.ofMillis(100)) .setRetryDelayMultiplier(1.2) - .setMaxRetryDelay(Duration.ofMillis(1000)); + .setMaxRetryDelayDuration(java.time.Duration.ofMillis(1000)); RetrySettings.Builder mergedBuilder = RetrySettings.newBuilder(); mergedBuilder.merge(builder); RetrySettings settingsA = builder.build(); RetrySettings settingsB = mergedBuilder.build(); - Truth.assertThat(settingsA.getTotalTimeout()).isEqualTo(settingsB.getTotalTimeout()); - Truth.assertThat(settingsA.getInitialRetryDelay()).isEqualTo(settingsB.getInitialRetryDelay()); + Truth.assertThat(settingsA.getTotalTimeoutDuration()) + .isEqualTo(settingsB.getTotalTimeoutDuration()); + Truth.assertThat(settingsA.getInitialRetryDelayDuration()) + .isEqualTo(settingsB.getInitialRetryDelayDuration()); Truth.assertThat(settingsA.getRpcTimeoutMultiplier()) .isWithin(0) .of(settingsB.getRpcTimeoutMultiplier()); - Truth.assertThat(settingsA.getMaxRpcTimeout()).isEqualTo(settingsB.getMaxRpcTimeout()); - Truth.assertThat(settingsA.getInitialRetryDelay()).isEqualTo(settingsB.getInitialRetryDelay()); + Truth.assertThat(settingsA.getMaxRpcTimeoutDuration()) + .isEqualTo(settingsB.getMaxRpcTimeoutDuration()); + Truth.assertThat(settingsA.getInitialRetryDelayDuration()) + .isEqualTo(settingsB.getInitialRetryDelayDuration()); Truth.assertThat(settingsA.getRetryDelayMultiplier()) .isWithin(0) .of(settingsB.getRetryDelayMultiplier()); - Truth.assertThat(settingsA.getMaxRetryDelay()).isEqualTo(settingsB.getMaxRetryDelay()); + Truth.assertThat(settingsA.getMaxRetryDelayDuration()) + .isEqualTo(settingsB.getMaxRetryDelayDuration()); + } + + @Test + public void testTotalTimeout() { + testDurationMethod( + 123l, + jt -> DEFAULT_BUILDER.setTotalTimeoutDuration(jt).build(), + tt -> DEFAULT_BUILDER.setTotalTimeout(tt).build(), + rs -> rs.getTotalTimeoutDuration(), + rs -> rs.getTotalTimeout()); + } + + @Test + public void testInitialRetryDelay() { + testDurationMethod( + 123l, + jt -> DEFAULT_BUILDER.setInitialRetryDelayDuration(jt).build(), + tt -> DEFAULT_BUILDER.setInitialRetryDelay(tt).build(), + rs -> rs.getInitialRetryDelayDuration(), + rs -> rs.getInitialRetryDelay()); + } + + @Test + public void testMaxRetryDelay() { + testDurationMethod( + 123l, + jt -> DEFAULT_BUILDER.setMaxRetryDelayDuration(jt).build(), + tt -> DEFAULT_BUILDER.setMaxRetryDelay(tt).build(), + rs -> rs.getMaxRetryDelayDuration(), + rs -> rs.getMaxRetryDelay()); + } + + @Test + public void testInitialRpcTimeout() { + testDurationMethod( + 123l, + jt -> DEFAULT_BUILDER.setInitialRpcTimeoutDuration(jt).build(), + tt -> DEFAULT_BUILDER.setInitialRpcTimeout(tt).build(), + rs -> rs.getInitialRpcTimeoutDuration(), + rs -> rs.getInitialRpcTimeout()); + } + + @Test + public void testMaxRpcTimeout() { + testDurationMethod( + 123l, + jt -> DEFAULT_BUILDER.setMaxRpcTimeoutDuration(jt).build(), + tt -> DEFAULT_BUILDER.setMaxRpcTimeout(tt).build(), + rs -> rs.getMaxRpcTimeoutDuration(), + rs -> rs.getMaxRpcTimeout()); } } diff --git a/gax-java/gax/src/test/java/com/google/api/gax/retrying/ScheduledRetryingExecutorTest.java b/gax-java/gax/src/test/java/com/google/api/gax/retrying/ScheduledRetryingExecutorTest.java index 76793ec98f..7d57733c50 100644 --- a/gax-java/gax/src/test/java/com/google/api/gax/retrying/ScheduledRetryingExecutorTest.java +++ b/gax-java/gax/src/test/java/com/google/api/gax/retrying/ScheduledRetryingExecutorTest.java @@ -30,12 +30,12 @@ package com.google.api.gax.retrying; import static com.google.api.gax.retrying.FailingCallable.FAST_RETRY_SETTINGS; -import static junit.framework.TestCase.assertFalse; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotNull; -import static org.junit.Assert.assertNull; -import static org.junit.Assert.assertSame; -import static org.junit.Assert.assertTrue; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertNull; +import static org.junit.jupiter.api.Assertions.assertSame; +import static org.junit.jupiter.api.Assertions.assertTrue; import com.google.api.core.ApiFuture; import com.google.api.core.NanoClock; @@ -47,21 +47,17 @@ import java.util.concurrent.Future; import java.util.concurrent.RejectedExecutionException; import java.util.concurrent.ScheduledExecutorService; -import org.junit.After; -import org.junit.Test; +import org.junit.jupiter.api.Test; import org.mockito.Mockito; -import org.threeten.bp.Duration; -// @RunWith(MockitoJUnitRunner.class) -public class ScheduledRetryingExecutorTest extends AbstractRetryingExecutorTest { - private ScheduledExecutorService scheduler = Executors.newSingleThreadScheduledExecutor(); +class ScheduledRetryingExecutorTest extends AbstractRetryingExecutorTest { // Number of test runs, essential for multithreaded tests. private static final int EXECUTIONS_COUNT = 5; @Override protected RetryingExecutorWithContext getExecutor(RetryAlgorithm retryAlgorithm) { - return getRetryingExecutor(retryAlgorithm, scheduler); + return getRetryingExecutor(retryAlgorithm, scheduledExecutorService); } @Override @@ -77,30 +73,24 @@ private RetryingExecutorWithContext getRetryingExecutor( return new ScheduledRetryingExecutor<>(retryAlgorithm, scheduler); } - @After - public void after() { - scheduler.shutdownNow(); - } - @Test - public void testSuccessWithFailuresPeekAttempt() throws Exception { + void testSuccessWithFailuresPeekAttempt() throws Exception { + RetrySettings retrySettings = + FAST_RETRY_SETTINGS.toBuilder() + .setTotalTimeoutDuration(java.time.Duration.ofMillis(1000L)) + .setMaxAttempts(100) + .build(); for (int executionsCount = 0; executionsCount < EXECUTIONS_COUNT; executionsCount++) { - final int maxRetries = 100; - ScheduledExecutorService localExecutor = Executors.newSingleThreadScheduledExecutor(); FailingCallable callable = new FailingCallable(15, "request", "SUCCESS", tracer); - RetrySettings retrySettings = - FAST_RETRY_SETTINGS - .toBuilder() - .setTotalTimeout(Duration.ofMillis(1000L)) - .setMaxAttempts(maxRetries) - .build(); - RetryingExecutorWithContext executor = - getRetryingExecutor(getAlgorithm(retrySettings, 0, null), localExecutor); + getRetryingExecutor(getAlgorithm(retrySettings, 0, null), scheduledExecutorService); RetryingFuture future = - executor.createFuture(callable, FakeCallContext.createDefault().withTracer(tracer)); + executor.createFuture( + callable, + FakeCallContext.createDefault().withTracer(tracer).withRetrySettings(retrySettings)); + callable.setExternalFuture(future); assertNull(future.peekAttemptResult()); assertSame(future.peekAttemptResult(), future.peekAttemptResult()); @@ -129,28 +119,28 @@ public void testSuccessWithFailuresPeekAttempt() throws Exception { assertFutureSuccess(future); assertEquals(15, future.getAttemptSettings().getAttemptCount()); assertTrue(failedAttempts > 0); - localExecutor.shutdownNow(); } } @Test - public void testSuccessWithFailuresGetAttempt() throws Exception { + void testSuccessWithFailuresGetAttempt() throws Exception { + int maxRetries = 100; + RetrySettings retrySettings = + FAST_RETRY_SETTINGS.toBuilder() + .setTotalTimeoutDuration(java.time.Duration.ofMillis(1000L)) + .setMaxAttempts(maxRetries) + .build(); for (int executionsCount = 0; executionsCount < EXECUTIONS_COUNT; executionsCount++) { - final int maxRetries = 100; - ScheduledExecutorService localExecutor = Executors.newSingleThreadScheduledExecutor(); FailingCallable callable = new FailingCallable(15, "request", "SUCCESS", tracer); - RetrySettings retrySettings = - FAST_RETRY_SETTINGS - .toBuilder() - .setTotalTimeout(Duration.ofMillis(1000L)) - .setMaxAttempts(maxRetries) - .build(); RetryingExecutorWithContext executor = - getRetryingExecutor(getAlgorithm(retrySettings, 0, null), localExecutor); + getRetryingExecutor(getAlgorithm(retrySettings, 0, null), scheduledExecutorService); RetryingFuture future = - executor.createFuture(callable, FakeCallContext.createDefault().withTracer(tracer)); + executor.createFuture( + callable, + FakeCallContext.createDefault().withTracer(tracer).withRetrySettings(retrySettings)); + callable.setExternalFuture(future); assertNull(future.peekAttemptResult()); assertSame(future.getAttemptResult(), future.getAttemptResult()); @@ -181,142 +171,135 @@ public void testSuccessWithFailuresGetAttempt() throws Exception { assertTrue(future.isDone()); assertFutureSuccess(future); assertEquals(15, future.getAttemptSettings().getAttemptCount()); - assertTrue("checks is equal to " + checks, checks > 1 && checks <= maxRetries); - localExecutor.shutdownNow(); + assertTrue(checks > 1 && checks <= maxRetries, "checks is equal to " + checks); } } @Test - public void testCancelGetAttempt() throws Exception { - for (int executionsCount = 0; executionsCount < EXECUTIONS_COUNT; executionsCount++) { - ScheduledExecutorService localExecutor = Executors.newSingleThreadScheduledExecutor(); - final int maxRetries = 100; - - FailingCallable callable = new FailingCallable(maxRetries - 1, "request", "SUCCESS", tracer); - RetrySettings retrySettings = - FAST_RETRY_SETTINGS - .toBuilder() - .setTotalTimeout(Duration.ofMillis(1000L)) - .setMaxAttempts(maxRetries) - .build(); + void testCancelGetAttempt() throws Exception { + int maxRetries = 100; + RetrySettings retrySettings = + FAST_RETRY_SETTINGS.toBuilder() + .setInitialRpcTimeoutDuration(java.time.Duration.ofMillis(50L)) + .setMaxRpcTimeoutDuration(java.time.Duration.ofMillis(50L)) + .setTotalTimeoutDuration(java.time.Duration.ofMillis(5000L)) + .setMaxAttempts(maxRetries) + .build(); + FailingCallable callable = new FailingCallable(maxRetries - 1, "request", "SUCCESS", tracer); - RetryingExecutorWithContext executor = - getRetryingExecutor(getAlgorithm(retrySettings, 0, null), localExecutor); - RetryingFuture future = executor.createFuture(callable, retryingContext); + RetryingExecutorWithContext executor = + getRetryingExecutor(getAlgorithm(retrySettings, 0, null), scheduledExecutorService); + RetryingFuture future = + executor.createFuture( + callable, + FakeCallContext.createDefault().withTracer(tracer).withRetrySettings(retrySettings)); + callable.setExternalFuture(future); - assertNull(future.peekAttemptResult()); - assertSame(future.getAttemptResult(), future.getAttemptResult()); - assertFalse(future.getAttemptResult().isDone()); - assertFalse(future.getAttemptResult().isCancelled()); + assertNull(future.peekAttemptResult()); + assertSame(future.getAttemptResult(), future.getAttemptResult()); + assertFalse(future.getAttemptResult().isDone()); + assertFalse(future.getAttemptResult().isCancelled()); - future.setAttemptFuture(executor.submit(future)); + future.setAttemptFuture(executor.submit(future)); - CustomException exception; - CancellationException cancellationException = null; - int checks = 0; - int failedCancelations = 0; - do { - exception = null; - checks++; - Future attemptResult = future.getAttemptResult(); - try { - attemptResult.get(); - assertNotNull(future.peekAttemptResult()); - } catch (CancellationException e) { - cancellationException = e; - } catch (ExecutionException e) { - exception = (CustomException) e.getCause(); - } - assertTrue(attemptResult.isDone()); - if (!future.cancel(true)) { - failedCancelations++; - } - } while (exception != null && checks < maxRetries); + CustomException exception; + CancellationException cancellationException = null; + int checks = 0; + do { + exception = null; + checks++; + Future attemptResult = future.getAttemptResult(); + try { + attemptResult.get(); + assertNotNull(future.peekAttemptResult()); + } catch (CancellationException e) { + cancellationException = e; + } catch (ExecutionException e) { + exception = (CustomException) e.getCause(); + } + future.cancel(true); + assertTrue(attemptResult.isDone()); + } while (exception != null && checks < maxRetries); - assertTrue(future.isDone()); - assertNotNull(cancellationException); - // future.cancel(true) may return false sometimes, which is ok. Also, the every cancellation - // of - // an already cancelled future should return false (this is what -1 means here) - assertEquals(2, checks - (failedCancelations - 1)); - assertTrue(future.getAttemptSettings().getAttemptCount() > 0); - assertFutureCancel(future); - localExecutor.shutdownNow(); - } + assertTrue(future.isDone()); + assertNotNull(cancellationException); + assertTrue(future.getAttemptSettings().getAttemptCount() > 0); + assertFutureCancel(future); } @Test - public void testCancelOuterFutureAfterStart() throws Exception { + void testCancelOuterFutureAfterStart() throws Exception { + RetrySettings retrySettings = + FAST_RETRY_SETTINGS.toBuilder() + // These params were selected to ensure that future tries to run and fail (at least + // once) but does not complete before it is cancelled. Assuming no computation time, + // it would take 2500 + 10000 + 10000 + 10000 = 32500ms for the future to complete, + // which should + // be more than enough time to cancel the future. + .setInitialRetryDelayDuration(java.time.Duration.ofMillis(2500L)) + .setMaxRetryDelayDuration(java.time.Duration.ofMillis(10000L)) + .setRetryDelayMultiplier(4.0) + .setTotalTimeoutDuration(java.time.Duration.ofMillis(60000L)) + // Set this test to not use jitter as the randomized retry delay (RRD) may introduce + // flaky results. For example, if every RRD value is calculated to be a small value + // (i.e. 2ms), four retries would result a "SUCCESS" result after 8ms, far below + // both the sleep value (150ms) and timeout (60000ms). This could potentially result + // in the future.cancel() returning false as you can't cancel a future that has + // already succeeded. The possibility of having each of the four retries produce a + // tiny RRD value is small, but not impossible. + .setJittered(false) + .build(); for (int executionsCount = 0; executionsCount < EXECUTIONS_COUNT; executionsCount++) { - ScheduledExecutorService localExecutor = Executors.newSingleThreadScheduledExecutor(); - FailingCallable callable = new FailingCallable(4, "requset", "SUCCESS", tracer); - RetrySettings retrySettings = - FAST_RETRY_SETTINGS - .toBuilder() - .setInitialRetryDelay(Duration.ofMillis(1_000L)) - .setMaxRetryDelay(Duration.ofMillis(1_000L)) - .setTotalTimeout(Duration.ofMillis(10_0000L)) - .build(); + FailingCallable callable = new FailingCallable(4, "request", "SUCCESS", tracer); RetryingExecutorWithContext executor = - getRetryingExecutor(getAlgorithm(retrySettings, 0, null), localExecutor); + getRetryingExecutor(getAlgorithm(retrySettings, 0, null), scheduledExecutorService); RetryingFuture future = - executor.createFuture(callable, FakeCallContext.createDefault().withTracer(tracer)); + executor.createFuture( + callable, + FakeCallContext.createDefault().withTracer(tracer).withRetrySettings(retrySettings)); + callable.setExternalFuture(future); future.setAttemptFuture(executor.submit(future)); - Thread.sleep(30L); + // The test sleeps a duration long enough to ensure that the future has been submitted for + // execution + Thread.sleep(150L); boolean res = future.cancel(false); assertTrue(res); assertFutureCancel(future); + + // Verify that the cancelled future is traced. Every attempt increases the number + // of cancellation attempts from the tracer. + Mockito.verify(tracer, Mockito.times(executionsCount + 1)).attemptCancelled(); + + // Assert that future has at least been attempted once + // i.e. The future from executor.submit() has been run by the ScheduledExecutor + assertTrue(future.getAttemptSettings().getAttemptCount() > 0); assertTrue(future.getAttemptSettings().getAttemptCount() < 4); - localExecutor.shutdownNow(); } } @Test - public void testCancelIsTraced() throws Exception { - ScheduledExecutorService localExecutor = Executors.newSingleThreadScheduledExecutor(); - FailingCallable callable = new FailingCallable(4, "request", "SUCCESS", tracer); + void testCancelProxiedFutureAfterStart() throws Exception { RetrySettings retrySettings = - FAST_RETRY_SETTINGS - .toBuilder() - .setInitialRetryDelay(Duration.ofMillis(1_000L)) - .setMaxRetryDelay(Duration.ofMillis(1_000L)) - .setTotalTimeout(Duration.ofMillis(10_0000L)) + FAST_RETRY_SETTINGS.toBuilder() + .setInitialRetryDelayDuration(java.time.Duration.ofMillis(1_000L)) + .setMaxRetryDelayDuration(java.time.Duration.ofMillis(1_000L)) + .setTotalTimeoutDuration(java.time.Duration.ofMillis(10_0000L)) .build(); - RetryingExecutorWithContext executor = - getRetryingExecutor(getAlgorithm(retrySettings, 0, null), localExecutor); - RetryingFuture future = - executor.createFuture(callable, FakeCallContext.createDefault().withTracer(tracer)); - future.setAttemptFuture(executor.submit(future)); - - Thread.sleep(30L); - - boolean res = future.cancel(false); - assertTrue(res); - assertFutureCancel(future); - - Mockito.verify(tracer).attemptCancelled(); - localExecutor.shutdownNow(); - } - - @Test - public void testCancelProxiedFutureAfterStart() throws Exception { // this is a heavy test, which takes a lot of time, so only few executions. for (int executionsCount = 0; executionsCount < 2; executionsCount++) { + // Use a test local executor for this test case due to the reasons listed below ScheduledExecutorService localExecutor = Executors.newSingleThreadScheduledExecutor(); FailingCallable callable = new FailingCallable(5, "request", "SUCCESS", tracer); - RetrySettings retrySettings = - FAST_RETRY_SETTINGS - .toBuilder() - .setInitialRetryDelay(Duration.ofMillis(1_000L)) - .setMaxRetryDelay(Duration.ofMillis(1_000L)) - .setTotalTimeout(Duration.ofMillis(10_0000L)) - .build(); + RetryingExecutorWithContext executor = getRetryingExecutor(getAlgorithm(retrySettings, 0, null), localExecutor); RetryingFuture future = - executor.createFuture(callable, FakeCallContext.createDefault().withTracer(tracer)); + executor.createFuture( + callable, + FakeCallContext.createDefault().withTracer(tracer).withRetrySettings(retrySettings)); + callable.setExternalFuture(future); future.setAttemptFuture(executor.submit(future)); Thread.sleep(50L); @@ -324,8 +307,8 @@ public void testCancelProxiedFutureAfterStart() throws Exception { // Note that shutdownNow() will not cancel internal FutureTasks automatically, which // may potentially cause another thread handing on RetryingFuture#get() call forever. // Canceling the tasks returned by shutdownNow() also does not help, because of missing - // feature - // in guava's ListenableScheduledFuture, which does not cancel itself, when its delegate is + // feature in guava's ListenableScheduledFuture, which does not cancel itself, when its + // delegate is // canceled. // So only the graceful shutdown() is supported properly. localExecutor.shutdown(); diff --git a/gax-java/gax/src/test/java/com/google/api/gax/retrying/TimedAttemptSettingsTest.java b/gax-java/gax/src/test/java/com/google/api/gax/retrying/TimedAttemptSettingsTest.java new file mode 100644 index 0000000000..af0c1e1b35 --- /dev/null +++ b/gax-java/gax/src/test/java/com/google/api/gax/retrying/TimedAttemptSettingsTest.java @@ -0,0 +1,75 @@ +/* + * Copyright 2024 Google LLC + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Google LLC nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +package com.google.api.gax.retrying; + +import static com.google.api.gax.util.TimeConversionTestUtils.testDurationMethod; + +import org.junit.jupiter.api.Test; + +public class TimedAttemptSettingsTest { + + private static final TimedAttemptSettings.Builder SETTINGS_BUILDER = + TimedAttemptSettings.newBuilder() + .setGlobalSettings(RetrySettings.newBuilder().build()) + .setRpcTimeoutDuration(java.time.Duration.ofMillis(5000l)) + .setRandomizedRetryDelayDuration(java.time.Duration.ofMillis(5000l)) + .setAttemptCount(123) + .setFirstAttemptStartTimeNanos(123l); + + @Test + public void testRetryDelay() { + testDurationMethod( + 123l, + jt -> SETTINGS_BUILDER.setRetryDelayDuration(jt).build(), + tt -> SETTINGS_BUILDER.setRetryDelay(tt).build(), + o -> o.getRetryDelayDuration(), + o -> o.getRetryDelay()); + } + + @Test + public void testRandomizedRetryDelay() { + testDurationMethod( + 123l, + jt -> SETTINGS_BUILDER.setRandomizedRetryDelayDuration(jt).build(), + tt -> SETTINGS_BUILDER.setRandomizedRetryDelay(tt).build(), + o -> o.getRandomizedRetryDelayDuration(), + o -> o.getRandomizedRetryDelay()); + } + + @Test + public void testRpcTimeout() { + testDurationMethod( + 123l, + jt -> SETTINGS_BUILDER.setRpcTimeoutDuration(jt).build(), + tt -> SETTINGS_BUILDER.setRpcTimeout(tt).build(), + o -> o.getRpcTimeoutDuration(), + o -> o.getRpcTimeout()); + } +} diff --git a/gax-java/gax/src/test/java/com/google/api/gax/rpc/ApiClientHeaderProviderTest.java b/gax-java/gax/src/test/java/com/google/api/gax/rpc/ApiClientHeaderProviderTest.java index f60c3c0760..8dcf74fd8a 100644 --- a/gax-java/gax/src/test/java/com/google/api/gax/rpc/ApiClientHeaderProviderTest.java +++ b/gax-java/gax/src/test/java/com/google/api/gax/rpc/ApiClientHeaderProviderTest.java @@ -31,34 +31,32 @@ import static com.google.common.truth.Truth.assertThat; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.junit.runners.JUnit4; +import org.junit.jupiter.api.Test; -@RunWith(JUnit4.class) -public class ApiClientHeaderProviderTest { +class ApiClientHeaderProviderTest { private static final String X_GOOG_API_CLIENT = "x-goog-api-client"; private static final String CLOUD_RESOURCE_PREFIX = "google-cloud-resource-prefix"; @Test - public void testServiceHeaderDefault() { + void testServiceHeaderDefault() { ApiClientHeaderProvider provider = ApiClientHeaderProvider.newBuilder().build(); assertThat(provider.getHeaders().size()).isEqualTo(1); - assertThat(provider.getHeaders().get(X_GOOG_API_CLIENT)).matches("^gl-java/.* gax/.*$"); + assertThat(provider.getHeaders().get(X_GOOG_API_CLIENT)) + .matches("^gl-java/.* gax/.* protobuf/.*"); } @Test - public void testServiceHeaderManual() { + void testServiceHeaderManual() { ApiClientHeaderProvider provider = ApiClientHeaderProvider.newBuilder().setClientLibToken("gccl", "1.2.3").build(); assertThat(provider.getHeaders().size()).isEqualTo(1); assertThat(provider.getHeaders().get(X_GOOG_API_CLIENT)) - .matches("^gl-java/.* gccl/1\\.2\\.3 gax/.*$"); + .matches("^gl-java/.* gccl/1\\.2\\.3--protobuf-.* gax/.* protobuf/.*"); } @Test - public void testServiceHeaderManualGapic() { + void testServiceHeaderManualGapic() { ApiClientHeaderProvider provider = ApiClientHeaderProvider.newBuilder() .setTransportToken("grpc", "1.2.3") @@ -67,11 +65,12 @@ public void testServiceHeaderManualGapic() { .build(); assertThat(provider.getHeaders().size()).isEqualTo(1); assertThat(provider.getHeaders().get(X_GOOG_API_CLIENT)) - .matches("^gl-java/.* gccl/4\\.5\\.6 gapic/7\\.8\\.9 gax/.* grpc/1\\.2\\.3$"); + .matches( + "^gl-java/.* gccl/4\\.5\\.6--protobuf-.* gapic/7\\.8\\.9 gax/.* grpc/1\\.2\\.3 protobuf/.*"); } @Test - public void testServiceHeaderManualGrpc() { + void testServiceHeaderManualGrpc() { ApiClientHeaderProvider provider = ApiClientHeaderProvider.newBuilder() .setTransportToken("grpc", "1.2.3") @@ -79,11 +78,11 @@ public void testServiceHeaderManualGrpc() { .build(); assertThat(provider.getHeaders().size()).isEqualTo(1); assertThat(provider.getHeaders().get(X_GOOG_API_CLIENT)) - .matches("^gl-java/.* gccl/4\\.5\\.6 gax/.* grpc/1\\.2\\.3$"); + .matches("^gl-java/.* gccl/4\\.5\\.6--protobuf-.* gax/.* grpc/1\\.2\\.3 protobuf/.*"); } @Test - public void testServiceHeaderGapic() { + void testServiceHeaderGapic() { ApiClientHeaderProvider provider = ApiClientHeaderProvider.newBuilder() .setTransportToken("grpc", "1.2.3") @@ -91,11 +90,11 @@ public void testServiceHeaderGapic() { .build(); assertThat(provider.getHeaders().size()).isEqualTo(1); assertThat(provider.getHeaders().get(X_GOOG_API_CLIENT)) - .matches("^gl-java/.* gapic/4\\.5\\.6 gax/.* grpc/1\\.2\\.3$"); + .matches("^gl-java/.* gapic/4\\.5\\.6--protobuf-.* gax/.* grpc/1\\.2\\.3 protobuf/.*"); } @Test - public void testCloudResourcePrefixHeader() { + void testCloudResourcePrefixHeader() { ApiClientHeaderProvider provider = ApiClientHeaderProvider.newBuilder() .setTransportToken("grpc", "1.2.3") @@ -104,12 +103,12 @@ public void testCloudResourcePrefixHeader() { .build(); assertThat(provider.getHeaders().size()).isEqualTo(2); assertThat(provider.getHeaders().get(X_GOOG_API_CLIENT)) - .matches("^gl-java/.* gapic/4\\.5\\.6 gax/.* grpc/1\\.2\\.3$"); + .matches("^gl-java/.* gapic/4\\.5\\.6--protobuf-.* gax/.* grpc/1\\.2\\.3 protobuf/.*"); assertThat(provider.getHeaders().get(CLOUD_RESOURCE_PREFIX)).isEqualTo("test-prefix"); } @Test - public void testCustomHeaderKeys() { + void testCustomHeaderKeys() { ApiClientHeaderProvider provider = ApiClientHeaderProvider.newBuilder() .setTransportToken("grpc", "1.2.3") @@ -120,12 +119,12 @@ public void testCustomHeaderKeys() { .build(); assertThat(provider.getHeaders().size()).isEqualTo(2); assertThat(provider.getHeaders().get("custom-header1")) - .matches("^gl-java/.* gapic/4\\.5\\.6 gax/.* grpc/1\\.2\\.3$"); + .matches("^gl-java/.* gapic/4\\.5\\.6--protobuf-.* gax/.* grpc/1\\.2\\.3 protobuf/.*"); assertThat(provider.getHeaders().get("custom-header2")).isEqualTo("test-prefix"); } @Test - public void testQuotaProjectHeader() { + void testQuotaProjectHeader() { String quotaProjectHeaderValue = "quota-project-id-value"; ApiClientHeaderProvider provider = ApiClientHeaderProvider.newBuilder() @@ -134,8 +133,40 @@ public void testQuotaProjectHeader() { .build(); assertThat(provider.getHeaders().size()).isEqualTo(2); assertThat(provider.getHeaders().get(X_GOOG_API_CLIENT)) - .matches("^gl-java/.* gccl/1\\.2\\.3 gax/.*$"); + .matches("^gl-java/.* gccl/1\\.2\\.3--protobuf-.* gax/.* protobuf/.*"); assertThat(provider.getHeaders().get(ApiClientHeaderProvider.QUOTA_PROJECT_ID_HEADER_KEY)) .matches(quotaProjectHeaderValue); } + + @Test + void testApiVersionHeader() { + ApiClientHeaderProvider provider = + ApiClientHeaderProvider.newBuilder().setApiVersionToken("fake-version-string").build(); + assertThat(provider.getHeaders().size()).isEqualTo(2); + assertThat(provider.getHeaders().get(ApiClientHeaderProvider.API_VERSION_HEADER_KEY)) + .matches("fake-version-string"); + + ApiClientHeaderProvider emptyProvider = + ApiClientHeaderProvider.newBuilder().setApiVersionToken("").build(); + assertThat( + emptyProvider.getHeaders().get(ApiClientHeaderProvider.API_VERSION_HEADER_KEY).isEmpty()); + } + + @Test + void testNonGapicGeneratedLibToken_doesNotAppendProtobufVersion() { + ApiClientHeaderProvider provider = + ApiClientHeaderProvider.newBuilder().setGeneratedLibToken("other-token", "1.2.3").build(); + + assertThat(provider.getHeaders().get(X_GOOG_API_CLIENT)) + .matches("^gl-java/.* other-token/1.2.3 gax/.* protobuf/.*"); + } + + @Test + void testNonGcclGeneratedLibToken_doesNotAppendProtobufVersion() { + ApiClientHeaderProvider provider = + ApiClientHeaderProvider.newBuilder().setClientLibToken("other-token", "1.2.3").build(); + + assertThat(provider.getHeaders().get(X_GOOG_API_CLIENT)) + .matches("^gl-java/.* other-token/1.2.3 gax/.* protobuf/.*"); + } } diff --git a/gax-java/gax/src/test/java/com/google/api/gax/rpc/ApiExceptionFactoryTest.java b/gax-java/gax/src/test/java/com/google/api/gax/rpc/ApiExceptionFactoryTest.java index 52e2244219..372a2262bc 100644 --- a/gax-java/gax/src/test/java/com/google/api/gax/rpc/ApiExceptionFactoryTest.java +++ b/gax-java/gax/src/test/java/com/google/api/gax/rpc/ApiExceptionFactoryTest.java @@ -32,35 +32,32 @@ import com.google.api.gax.rpc.StatusCode.Code; import com.google.api.gax.rpc.testing.FakeStatusCode; import com.google.common.truth.Truth; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.junit.runners.JUnit4; +import org.junit.jupiter.api.Test; -@RunWith(JUnit4.class) -public class ApiExceptionFactoryTest { +class ApiExceptionFactoryTest { @Test - public void cancelled() { + void cancelled() { Truth.assertThat(createException(Code.CANCELLED)).isInstanceOf(CancelledException.class); Truth.assertThat(createExceptionWithMessage(Code.CANCELLED)) .isInstanceOf(CancelledException.class); } @Test - public void notFound() { + void notFound() { Truth.assertThat(createException(Code.NOT_FOUND)).isInstanceOf(NotFoundException.class); Truth.assertThat(createExceptionWithMessage(Code.NOT_FOUND)) .isInstanceOf(NotFoundException.class); } @Test - public void unknown() { + void unknown() { Truth.assertThat(createException(Code.UNKNOWN)).isInstanceOf(UnknownException.class); Truth.assertThat(createExceptionWithMessage(Code.UNKNOWN)).isInstanceOf(UnknownException.class); } @Test - public void invalidArgument() { + void invalidArgument() { Truth.assertThat(createException(Code.INVALID_ARGUMENT)) .isInstanceOf(InvalidArgumentException.class); Truth.assertThat(createExceptionWithMessage(Code.INVALID_ARGUMENT)) @@ -68,7 +65,7 @@ public void invalidArgument() { } @Test - public void deadlineExceeded() { + void deadlineExceeded() { Truth.assertThat(createException(Code.DEADLINE_EXCEEDED)) .isInstanceOf(DeadlineExceededException.class); Truth.assertThat(createExceptionWithMessage(Code.DEADLINE_EXCEEDED)) @@ -76,7 +73,7 @@ public void deadlineExceeded() { } @Test - public void alreadyExists() { + void alreadyExists() { Truth.assertThat(createException(Code.ALREADY_EXISTS)) .isInstanceOf(AlreadyExistsException.class); Truth.assertThat(createExceptionWithMessage(Code.ALREADY_EXISTS)) @@ -84,7 +81,7 @@ public void alreadyExists() { } @Test - public void permissionDenied() { + void permissionDenied() { Truth.assertThat(createException(Code.PERMISSION_DENIED)) .isInstanceOf(PermissionDeniedException.class); Truth.assertThat(createExceptionWithMessage(Code.PERMISSION_DENIED)) @@ -92,7 +89,7 @@ public void permissionDenied() { } @Test - public void resourceExhausted() { + void resourceExhausted() { Truth.assertThat(createException(Code.RESOURCE_EXHAUSTED)) .isInstanceOf(ResourceExhaustedException.class); Truth.assertThat(createExceptionWithMessage(Code.RESOURCE_EXHAUSTED)) @@ -100,7 +97,7 @@ public void resourceExhausted() { } @Test - public void failedPrecondition() { + void failedPrecondition() { Truth.assertThat(createException(Code.FAILED_PRECONDITION)) .isInstanceOf(FailedPreconditionException.class); Truth.assertThat(createExceptionWithMessage(Code.FAILED_PRECONDITION)) @@ -108,41 +105,41 @@ public void failedPrecondition() { } @Test - public void aborted() { + void aborted() { Truth.assertThat(createException(Code.ABORTED)).isInstanceOf(AbortedException.class); Truth.assertThat(createExceptionWithMessage(Code.ABORTED)).isInstanceOf(AbortedException.class); } @Test - public void outOfRange() { + void outOfRange() { Truth.assertThat(createException(Code.OUT_OF_RANGE)).isInstanceOf(OutOfRangeException.class); Truth.assertThat(createExceptionWithMessage(Code.OUT_OF_RANGE)) .isInstanceOf(OutOfRangeException.class); } @Test - public void internal() { + void internal() { Truth.assertThat(createException(Code.INTERNAL)).isInstanceOf(InternalException.class); Truth.assertThat(createExceptionWithMessage(Code.INTERNAL)) .isInstanceOf(InternalException.class); } @Test - public void unavailable() { + void unavailable() { Truth.assertThat(createException(Code.UNAVAILABLE)).isInstanceOf(UnavailableException.class); Truth.assertThat(createExceptionWithMessage(Code.UNAVAILABLE)) .isInstanceOf(UnavailableException.class); } @Test - public void dataLoss() { + void dataLoss() { Truth.assertThat(createException(Code.DATA_LOSS)).isInstanceOf(DataLossException.class); Truth.assertThat(createExceptionWithMessage(Code.DATA_LOSS)) .isInstanceOf(DataLossException.class); } @Test - public void unauthenticated() { + void unauthenticated() { Truth.assertThat(createException(Code.UNAUTHENTICATED)) .isInstanceOf(UnauthenticatedException.class); Truth.assertThat(createExceptionWithMessage(Code.UNAUTHENTICATED)) @@ -150,7 +147,7 @@ public void unauthenticated() { } @Test - public void unimplemented() { + void unimplemented() { Truth.assertThat(createException(Code.UNIMPLEMENTED)) .isInstanceOf(UnimplementedException.class); Truth.assertThat(createExceptionWithMessage(Code.UNIMPLEMENTED)) @@ -158,7 +155,7 @@ public void unimplemented() { } @Test - public void unknown_default() { + void unknown_default() { Truth.assertThat(createException(Code.OK)).isInstanceOf(UnknownException.class); Truth.assertThat(createExceptionWithMessage(Code.OK)).isInstanceOf(UnknownException.class); } diff --git a/gax-java/gax/src/test/java/com/google/api/gax/rpc/ApiExceptionTest.java b/gax-java/gax/src/test/java/com/google/api/gax/rpc/ApiExceptionTest.java index 85bf2d9ec5..c55d8dae2e 100644 --- a/gax-java/gax/src/test/java/com/google/api/gax/rpc/ApiExceptionTest.java +++ b/gax-java/gax/src/test/java/com/google/api/gax/rpc/ApiExceptionTest.java @@ -36,12 +36,9 @@ import com.google.protobuf.Any; import com.google.rpc.ErrorInfo; import java.util.Collections; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.junit.runners.JUnit4; +import org.junit.jupiter.api.Test; -@RunWith(JUnit4.class) -public class ApiExceptionTest { +class ApiExceptionTest { private static final ErrorDetails ERROR_DETAILS_WITH_NO_ERROR_INFO = ErrorDetails.builder().setRawErrorMessages(Collections.emptyList()).build(); @@ -65,49 +62,49 @@ public class ApiExceptionTest { private ApiException apiException; @Test - public void getReason_shouldReturnNullIfErrorDetailsIsNull() { + void getReason_shouldReturnNullIfErrorDetailsIsNull() { apiException = new ApiException(null, STATUS_CODE, false, null); Truth.assertThat(apiException.getReason()).isNull(); } @Test - public void getReason_shouldReturnNullIfErrorInfoIsNull() { + void getReason_shouldReturnNullIfErrorInfoIsNull() { apiException = new ApiException(null, STATUS_CODE, false, ERROR_DETAILS_WITH_NO_ERROR_INFO); Truth.assertThat(apiException.getReason()).isNull(); } @Test - public void getReason_shouldReturnReasonIfAvailable() { + void getReason_shouldReturnReasonIfAvailable() { apiException = new ApiException(null, STATUS_CODE, false, ERROR_DETAILS_WITH_ERROR_INFO); Truth.assertThat(apiException.getReason()).isEqualTo(REASON); } @Test - public void getDomain_shouldReturnNullIfErrorInfoIsNull() { + void getDomain_shouldReturnNullIfErrorInfoIsNull() { apiException = new ApiException(null, STATUS_CODE, false, ERROR_DETAILS_WITH_NO_ERROR_INFO); Truth.assertThat(apiException.getDomain()).isNull(); } @Test - public void getDomain_shouldReturnDomainIfAvailable() { + void getDomain_shouldReturnDomainIfAvailable() { apiException = new ApiException(null, STATUS_CODE, false, ERROR_DETAILS_WITH_ERROR_INFO); Truth.assertThat(apiException.getDomain()).isEqualTo(DOMAIN); } @Test - public void getMetadata_shouldReturnNullIfErrorInfoIsNull() { + void getMetadata_shouldReturnNullIfErrorInfoIsNull() { apiException = new ApiException(null, STATUS_CODE, false, ERROR_DETAILS_WITH_NO_ERROR_INFO); Truth.assertThat(apiException.getMetadata()).isNull(); } @Test - public void getMetadata_shouldReturnMetadataIfAvailable() { + void getMetadata_shouldReturnMetadataIfAvailable() { apiException = new ApiException(null, STATUS_CODE, false, ERROR_DETAILS_WITH_ERROR_INFO); Truth.assertThat(apiException.getMetadata()).containsExactly(METADATA_KEY, METADATA_VALUE); diff --git a/gax-java/gax/src/test/java/com/google/api/gax/rpc/ApiExceptionsTest.java b/gax-java/gax/src/test/java/com/google/api/gax/rpc/ApiExceptionsTest.java index 411f21b2b1..803537e026 100644 --- a/gax-java/gax/src/test/java/com/google/api/gax/rpc/ApiExceptionsTest.java +++ b/gax-java/gax/src/test/java/com/google/api/gax/rpc/ApiExceptionsTest.java @@ -30,6 +30,7 @@ package com.google.api.gax.rpc; import static com.google.common.truth.Truth.assertThat; +import static org.junit.jupiter.api.Assertions.assertThrows; import com.google.api.core.ApiFutures; import com.google.api.core.ListenableFutureToApiFuture; @@ -40,52 +41,44 @@ import com.google.common.util.concurrent.UncheckedExecutionException; import java.io.IOException; import java.util.concurrent.Executors; -import org.junit.Assert; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.junit.runners.JUnit4; +import org.junit.jupiter.api.Test; -@RunWith(JUnit4.class) -public class ApiExceptionsTest { +class ApiExceptionsTest { @Test - public void noException() { + void noException() { Integer result = ApiExceptions.callAndTranslateApiException(ApiFutures.immediateFuture(2)); assertThat(result).isEqualTo(2); } @Test - public void throwsApiException() { + void throwsApiException() { Exception throwable = new UnavailableException(null, FakeStatusCode.of(StatusCode.Code.UNAVAILABLE), false); - try { - ApiExceptions.callAndTranslateApiException(ApiFutures.immediateFailedFuture(throwable)); - Assert.fail("ApiExceptions should have thrown an exception"); - } catch (ApiException expected) { - assertThat(expected).isSameInstanceAs(throwable); - } + + assertThrows( + UnavailableException.class, + () -> + ApiExceptions.callAndTranslateApiException( + ApiFutures.immediateFailedFuture(throwable))); } @Test - public void throwsIOException() { - try { - ApiExceptions.callAndTranslateApiException( - ApiFutures.immediateFailedFuture(new IOException())); - Assert.fail("ApiExceptions should have thrown an exception"); - } catch (UncheckedExecutionException expected) { - assertThat(expected).hasCauseThat().isInstanceOf(IOException.class); - } + void throwsIOException() { + assertThrows( + UncheckedExecutionException.class, + () -> + ApiExceptions.callAndTranslateApiException( + ApiFutures.immediateFailedFuture(new IOException()))); } @Test - public void throwsRuntimeException() { - try { - ApiExceptions.callAndTranslateApiException( - ApiFutures.immediateFailedFuture(new IllegalArgumentException())); - Assert.fail("ApiExceptions should have thrown an exception"); - } catch (IllegalArgumentException expected) { - assertThat(expected).isInstanceOf(IllegalArgumentException.class); - } + void throwsRuntimeException() { + assertThrows( + IllegalArgumentException.class, + () -> + ApiExceptions.callAndTranslateApiException( + ApiFutures.immediateFailedFuture(new IllegalArgumentException()))); } /** @@ -93,7 +86,7 @@ public void throwsRuntimeException() { * stacktrace will be preserved as a suppressed RuntimeException. */ @Test - public void containsCurrentStacktrace() { + void containsCurrentStacktrace() { final String currentMethod = "containsCurrentStacktrace"; // Throw an error in an executor, which will cause it to lose the current stack frame @@ -102,23 +95,18 @@ public void containsCurrentStacktrace() { ListenableFuture futureError = executor.submit( - new Runnable() { - @Override - public void run() { - throw new IllegalArgumentException(); - } - }); + (Runnable) + () -> { + throw new IllegalArgumentException(); + }); ListenableFutureToApiFuture futureErrorWrapper = new ListenableFutureToApiFuture<>(futureError); executor.shutdown(); // Unwrap the future - Exception actualError = null; - try { - ApiExceptions.callAndTranslateApiException(futureErrorWrapper); - } catch (Exception e) { - actualError = e; - } + Exception actualError = + assertThrows( + Exception.class, () -> ApiExceptions.callAndTranslateApiException(futureErrorWrapper)); // Sanity check that the current stack trace is not in the exception assertThat(actualError).isNotNull(); diff --git a/gax-java/gax/src/test/java/com/google/api/gax/rpc/ApiResultRetryAlgorithmTest.java b/gax-java/gax/src/test/java/com/google/api/gax/rpc/ApiResultRetryAlgorithmTest.java index 4e04c1a0b2..6810044731 100644 --- a/gax-java/gax/src/test/java/com/google/api/gax/rpc/ApiResultRetryAlgorithmTest.java +++ b/gax-java/gax/src/test/java/com/google/api/gax/rpc/ApiResultRetryAlgorithmTest.java @@ -29,8 +29,8 @@ */ package com.google.api.gax.rpc; -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertTrue; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertTrue; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; @@ -38,19 +38,16 @@ import com.google.api.gax.rpc.testing.FakeStatusCode; import com.google.common.collect.Sets; import java.util.Collections; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.junit.runners.JUnit4; +import org.junit.jupiter.api.Test; -@RunWith(JUnit4.class) -public class ApiResultRetryAlgorithmTest { +class ApiResultRetryAlgorithmTest { @Test - public void testShouldRetryNoContext() { + void testShouldRetryNoContext() { ApiException nonRetryable = - new ApiException(null, new FakeStatusCode(Code.INTERNAL), /* retryable = */ false); + new ApiException(null, new FakeStatusCode(Code.INTERNAL), /* retryable= */ false); ApiException retryable = - new ApiException(null, new FakeStatusCode(Code.UNAVAILABLE), /* retryable = */ true); + new ApiException(null, new FakeStatusCode(Code.UNAVAILABLE), /* retryable= */ true); ApiResultRetryAlgorithm algorithm = new ApiResultRetryAlgorithm<>(); assertFalse(algorithm.shouldRetry(nonRetryable, null)); @@ -58,16 +55,16 @@ public void testShouldRetryNoContext() { } @Test - public void testShouldRetryWithContextWithoutRetryableCodes() { + void testShouldRetryWithContextWithoutRetryableCodes() { ApiCallContext context = mock(ApiCallContext.class); // No retryable codes in the call context, means that the retry algorithm should fall back to // its default implementation. when(context.getRetryableCodes()).thenReturn(null); ApiException nonRetryable = - new ApiException(null, new FakeStatusCode(Code.UNAVAILABLE), /* retryable = */ false); + new ApiException(null, new FakeStatusCode(Code.UNAVAILABLE), /* retryable= */ false); ApiException retryable = - new ApiException(null, new FakeStatusCode(Code.UNAVAILABLE), /* retryable = */ true); + new ApiException(null, new FakeStatusCode(Code.UNAVAILABLE), /* retryable= */ true); ApiResultRetryAlgorithm algorithm = new ApiResultRetryAlgorithm<>(); assertFalse(algorithm.shouldRetry(context, nonRetryable, null)); @@ -75,7 +72,7 @@ public void testShouldRetryWithContextWithoutRetryableCodes() { } @Test - public void testShouldRetryWithContextWithRetryableCodes() { + void testShouldRetryWithContextWithRetryableCodes() { ApiCallContext context = mock(ApiCallContext.class); when(context.getRetryableCodes()) .thenReturn( @@ -89,9 +86,9 @@ public void testShouldRetryWithContextWithRetryableCodes() { // The return value of isRetryable() will be ignored, as UNAVAILABLE has been added as a // retryable code to the call context. ApiException unavailableException = - new ApiException(null, new FakeStatusCode(Code.UNAVAILABLE), /* retryable = */ false); + new ApiException(null, new FakeStatusCode(Code.UNAVAILABLE), /* retryable= */ false); ApiException dataLossException = - new ApiException(null, new FakeStatusCode(Code.DATA_LOSS), /* retryable = */ true); + new ApiException(null, new FakeStatusCode(Code.DATA_LOSS), /* retryable= */ true); ApiResultRetryAlgorithm algorithm = new ApiResultRetryAlgorithm<>(); assertTrue(algorithm.shouldRetry(context, unavailableException, null)); @@ -99,13 +96,13 @@ public void testShouldRetryWithContextWithRetryableCodes() { } @Test - public void testShouldRetryWithContextWithEmptyRetryableCodes() { + void testShouldRetryWithContextWithEmptyRetryableCodes() { ApiCallContext context = mock(ApiCallContext.class); // This will effectively make the RPC non-retryable. when(context.getRetryableCodes()).thenReturn(Collections.emptySet()); ApiException unavailableException = - new ApiException(null, new FakeStatusCode(Code.UNAVAILABLE), /* retryable = */ true); + new ApiException(null, new FakeStatusCode(Code.UNAVAILABLE), /* retryable= */ true); ApiResultRetryAlgorithm algorithm = new ApiResultRetryAlgorithm<>(); assertFalse(algorithm.shouldRetry(context, unavailableException, null)); diff --git a/gax-java/gax/src/test/java/com/google/api/gax/rpc/AttemptCallableTest.java b/gax-java/gax/src/test/java/com/google/api/gax/rpc/AttemptCallableTest.java index 3b16b568d0..f06ccdf2c6 100644 --- a/gax-java/gax/src/test/java/com/google/api/gax/rpc/AttemptCallableTest.java +++ b/gax-java/gax/src/test/java/com/google/api/gax/rpc/AttemptCallableTest.java @@ -30,34 +30,37 @@ package com.google.api.gax.rpc; import static com.google.common.truth.Truth.assertThat; +import static org.mockito.ArgumentMatchers.any; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.when; import com.google.api.core.SettableApiFuture; import com.google.api.gax.retrying.RetrySettings; import com.google.api.gax.retrying.RetryingFuture; import com.google.api.gax.retrying.TimedAttemptSettings; import com.google.api.gax.rpc.testing.FakeCallContext; -import org.junit.Before; -import org.junit.Test; -import org.junit.runner.RunWith; +import com.google.api.gax.tracing.ApiTracer; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; import org.mockito.ArgumentCaptor; import org.mockito.Mock; import org.mockito.Mockito; import org.mockito.invocation.InvocationOnMock; -import org.mockito.junit.MockitoJUnitRunner; +import org.mockito.junit.jupiter.MockitoExtension; import org.mockito.stubbing.Answer; -import org.threeten.bp.Duration; -@RunWith(MockitoJUnitRunner.class) -public class AttemptCallableTest { +@ExtendWith(MockitoExtension.class) +class AttemptCallableTest { @Mock UnaryCallable mockInnerCallable; ArgumentCaptor capturedCallContext; @Mock RetryingFuture mockExternalFuture; TimedAttemptSettings currentAttemptSettings; - @Before - public void setUp() { + @BeforeEach + void setUp() { capturedCallContext = ArgumentCaptor.forClass(ApiCallContext.class); - Mockito.when(mockInnerCallable.futureCall(Mockito.anyString(), capturedCallContext.capture())) + when(mockInnerCallable.futureCall(Mockito.anyString(), capturedCallContext.capture())) .thenReturn(SettableApiFuture.create()); currentAttemptSettings = @@ -66,12 +69,12 @@ public void setUp() { .setAttemptCount(0) .setOverallAttemptCount(0) .setFirstAttemptStartTimeNanos(0) - .setRetryDelay(Duration.ofSeconds(1)) - .setRandomizedRetryDelay(Duration.ofSeconds(1)) - .setRpcTimeout(Duration.ZERO) + .setRetryDelayDuration(java.time.Duration.ofSeconds(1)) + .setRandomizedRetryDelayDuration(java.time.Duration.ofSeconds(1)) + .setRpcTimeoutDuration(java.time.Duration.ZERO) .build(); - Mockito.when(mockExternalFuture.getAttemptSettings()) + when(mockExternalFuture.getAttemptSettings()) .thenAnswer( new Answer() { @Override @@ -82,34 +85,41 @@ public TimedAttemptSettings answer(InvocationOnMock invocation) throws Throwable } @Test - public void testRpcTimeout() { + void testRpcTimeout() { + FakeCallContext callContext = mock(FakeCallContext.class); + when(callContext.getTimeoutDuration()).thenReturn(null); + when(callContext.withTimeoutDuration(any(java.time.Duration.class))).thenReturn(callContext); + when(callContext.getTracer()).thenReturn(mock(ApiTracer.class)); AttemptCallable callable = - new AttemptCallable<>(mockInnerCallable, "fake-request", FakeCallContext.createDefault()); + new AttemptCallable<>(mockInnerCallable, "fake-request", callContext); callable.setExternalFuture(mockExternalFuture); // Make sure that the rpc timeout is set - Duration timeout = Duration.ofSeconds(10); - currentAttemptSettings = currentAttemptSettings.toBuilder().setRpcTimeout(timeout).build(); + java.time.Duration timeout = java.time.Duration.ofSeconds(10); + currentAttemptSettings = + currentAttemptSettings.toBuilder().setRpcTimeoutDuration(timeout).build(); callable.call(); - assertThat(capturedCallContext.getValue().getTimeout()).isEqualTo(timeout); + Mockito.verify(callContext).withTimeoutDuration(timeout); - // Make sure that subsequent attempts can extend the time out - Duration longerTimeout = Duration.ofSeconds(20); + // Make sure that subsequent attempts can extend the timeout + java.time.Duration longerTimeout = java.time.Duration.ofSeconds(20); currentAttemptSettings = - currentAttemptSettings.toBuilder().setRpcTimeout(longerTimeout).build(); + currentAttemptSettings.toBuilder().setRpcTimeoutDuration(longerTimeout).build(); callable.call(); - assertThat(capturedCallContext.getValue().getTimeout()).isEqualTo(longerTimeout); + Mockito.verify(callContext).withTimeoutDuration(longerTimeout); } @Test - public void testRpcTimeoutIsNotErased() { - Duration callerTimeout = Duration.ofMillis(10); - ApiCallContext callerCallContext = FakeCallContext.createDefault().withTimeout(callerTimeout); + void testRpcTimeoutIsNotErased() { + java.time.Duration callerTimeout = java.time.Duration.ofMillis(10); + ApiCallContext callerCallContext = + FakeCallContext.createDefault().withTimeoutDuration(callerTimeout); - Duration timeout = Duration.ofMillis(5); - currentAttemptSettings = currentAttemptSettings.toBuilder().setRpcTimeout(timeout).build(); + java.time.Duration timeout = java.time.Duration.ofMillis(5); + currentAttemptSettings = + currentAttemptSettings.toBuilder().setRpcTimeoutDuration(timeout).build(); AttemptCallable callable = new AttemptCallable<>(mockInnerCallable, "fake-request", callerCallContext); @@ -117,6 +127,6 @@ public void testRpcTimeoutIsNotErased() { callable.call(); - assertThat(capturedCallContext.getValue().getTimeout()).isEqualTo(callerTimeout); + assertThat(capturedCallContext.getValue().getTimeoutDuration()).isEqualTo(callerTimeout); } } diff --git a/gax-java/gax/src/test/java/com/google/api/gax/rpc/AuthCallableTest.java b/gax-java/gax/src/test/java/com/google/api/gax/rpc/AuthCallableTest.java index c0f2f269ec..da93693530 100644 --- a/gax-java/gax/src/test/java/com/google/api/gax/rpc/AuthCallableTest.java +++ b/gax-java/gax/src/test/java/com/google/api/gax/rpc/AuthCallableTest.java @@ -38,18 +38,15 @@ import com.google.common.truth.Truth; import java.util.concurrent.CancellationException; import java.util.concurrent.ExecutionException; -import org.junit.Before; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.junit.runners.JUnit4; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; import org.mockito.Mockito; -@RunWith(JUnit4.class) -public class AuthCallableTest { +class AuthCallableTest { private ClientContext clientContext; - @Before - public void setUp() { + @BeforeEach + void setUp() { clientContext = ClientContext.newBuilder() .setDefaultCallContext(FakeCallContext.createDefault()) @@ -58,7 +55,7 @@ public void setUp() { } @Test - public void testAuth() throws InterruptedException, ExecutionException, CancellationException { + void testAuth() throws InterruptedException, ExecutionException, CancellationException { StashCallable stash = new StashCallable<>(42); Truth.assertThat(stash.getContext()).isNull(); diff --git a/gax-java/gax/src/test/java/com/google/api/gax/rpc/BatchExecutorTest.java b/gax-java/gax/src/test/java/com/google/api/gax/rpc/BatchExecutorTest.java index b55ce9ff2f..718d11a527 100644 --- a/gax-java/gax/src/test/java/com/google/api/gax/rpc/BatchExecutorTest.java +++ b/gax-java/gax/src/test/java/com/google/api/gax/rpc/BatchExecutorTest.java @@ -29,17 +29,16 @@ */ package com.google.api.gax.rpc; +import static org.junit.jupiter.api.Assertions.assertThrows; + import com.google.api.gax.batching.PartitionKey; import com.google.api.gax.batching.RequestBuilder; import java.util.ArrayList; import java.util.Collection; import java.util.List; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.junit.runners.JUnit4; +import org.junit.jupiter.api.Test; -@RunWith(JUnit4.class) -public class BatchExecutorTest { +class BatchExecutorTest { BatchingDescriptor, Integer> integerDescriptor = new BatchingDescriptor, Integer>() { @@ -87,7 +86,7 @@ public long countBytes(List request) { }; @Test - public void testValidate() { + void testValidate() { BatchExecutor, Integer> executor = new BatchExecutor, Integer>(integerDescriptor, new PartitionKey(0)); List request = new ArrayList(); @@ -97,14 +96,14 @@ public void testValidate() { executor.validateBatch(batchingContextOk); } - @Test(expected = IllegalArgumentException.class) - public void testValidateFailure() { + @Test + void testValidateFailure() { BatchExecutor, Integer> executor = new BatchExecutor, Integer>(integerDescriptor, new PartitionKey(0)); List request = new ArrayList<>(); request.add(3); Batch, Integer> batchingContextOk = new Batch<>(integerDescriptor, request, null, null); - executor.validateBatch(batchingContextOk); + assertThrows(IllegalArgumentException.class, () -> executor.validateBatch(batchingContextOk)); } } diff --git a/gax-java/gax/src/test/java/com/google/api/gax/rpc/BatchTest.java b/gax-java/gax/src/test/java/com/google/api/gax/rpc/BatchTest.java index 44a2401e9b..3f28e2a449 100644 --- a/gax-java/gax/src/test/java/com/google/api/gax/rpc/BatchTest.java +++ b/gax-java/gax/src/test/java/com/google/api/gax/rpc/BatchTest.java @@ -40,16 +40,13 @@ import com.google.common.truth.Truth; import java.util.ArrayList; import java.util.List; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.junit.runners.JUnit4; +import org.junit.jupiter.api.Test; import org.mockito.Mockito; -@RunWith(JUnit4.class) -public class BatchTest { +class BatchTest { @Test - public void testConstructor() { + void testConstructor() { LabeledIntList request = new LabeledIntList("lable", 2); Batch> batch = createBatch(request); @@ -60,7 +57,7 @@ public void testConstructor() { } @Test - public void testMerge() { + void testMerge() { LabeledIntList request1 = new LabeledIntList("lable", 1); Batch> batch1 = createBatch(request1); @@ -73,7 +70,7 @@ public void testMerge() { } @Test - public void testMergeStartEmpty() { + void testMergeStartEmpty() { LabeledIntList request1 = new LabeledIntList("lable", new ArrayList()); Batch> batch1 = createBatch(request1, null); Truth.assertThat(batch1.getCallable()).isNull(); @@ -89,7 +86,7 @@ public void testMergeStartEmpty() { } @Test - public void testBatchElementCounter() { + void testBatchElementCounter() { ElementCounter>> counter = new BatchElementCounter<>(SQUARER_BATCHING_DESC); LabeledIntList request = new LabeledIntList("lable", 3); @@ -99,7 +96,7 @@ public void testBatchElementCounter() { } @Test - public void testBatchByteCounter() { + void testBatchByteCounter() { ElementCounter>> counter = new BatchByteCounter<>(); LabeledIntList request = new LabeledIntList("lable", 3); Batch> batch = createBatch(request); @@ -108,7 +105,7 @@ public void testBatchByteCounter() { } @Test - public void testBatchMergerImpl() { + void testBatchMergerImpl() { LabeledIntList request1 = new LabeledIntList("lable", 1); Batch> batch1 = createBatch(request1); diff --git a/gax-java/gax/src/test/java/com/google/api/gax/rpc/BatchedFutureTest.java b/gax-java/gax/src/test/java/com/google/api/gax/rpc/BatchedFutureTest.java index 55ed0c2260..438ac1c3d7 100644 --- a/gax-java/gax/src/test/java/com/google/api/gax/rpc/BatchedFutureTest.java +++ b/gax-java/gax/src/test/java/com/google/api/gax/rpc/BatchedFutureTest.java @@ -36,14 +36,11 @@ import com.google.api.core.ApiFutures; import com.google.common.truth.Truth; import java.util.concurrent.TimeUnit; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.junit.runners.JUnit4; +import org.junit.jupiter.api.Test; -@RunWith(JUnit4.class) -public class BatchedFutureTest { +class BatchedFutureTest { @Test - public void testSet() throws Exception { + void testSet() throws Exception { BatchedFuture future = BatchedFuture.create(); Truth.assertThat(future.isDone()).isFalse(); future.set(42); @@ -53,7 +50,7 @@ public void testSet() throws Exception { } @Test - public void testTransform() throws Exception { + void testTransform() throws Exception { BatchedFuture inputFuture = BatchedFuture.create(); ApiFuture transformedFuture = ApiFutures.transform( diff --git a/gax-java/gax/src/test/java/com/google/api/gax/rpc/BatchedRequestIssuerTest.java b/gax-java/gax/src/test/java/com/google/api/gax/rpc/BatchedRequestIssuerTest.java index 293252afc1..281c0572bf 100644 --- a/gax-java/gax/src/test/java/com/google/api/gax/rpc/BatchedRequestIssuerTest.java +++ b/gax-java/gax/src/test/java/com/google/api/gax/rpc/BatchedRequestIssuerTest.java @@ -29,15 +29,18 @@ */ package com.google.api.gax.rpc; +import static org.junit.jupiter.api.Assertions.assertInstanceOf; +import static org.junit.jupiter.api.Assertions.assertThrows; +import static org.junit.jupiter.api.Assertions.assertTrue; + import com.google.common.truth.Truth; import java.util.concurrent.ExecutionException; -import org.junit.Assert; -import org.junit.Test; +import org.junit.jupiter.api.Test; -public class BatchedRequestIssuerTest { +class BatchedRequestIssuerTest { @Test - public void test() throws Exception { + void test() throws Exception { BatchedFuture batchedFuture = BatchedFuture.create(); BatchedRequestIssuer issuer = new BatchedRequestIssuer<>(batchedFuture, 2); issuer.setResponse(1); @@ -50,7 +53,7 @@ public void test() throws Exception { } @Test - public void testNullResult() throws Exception { + void testNullResult() throws Exception { BatchedFuture batchedFuture = BatchedFuture.create(); BatchedRequestIssuer issuer = new BatchedRequestIssuer<>(batchedFuture, 2); issuer.setResponse(null); @@ -63,7 +66,7 @@ public void testNullResult() throws Exception { } @Test - public void testException() throws Exception { + void testException() throws Exception { Exception thrownException = new IllegalArgumentException("bad!"); BatchedFuture batchedFuture = BatchedFuture.create(); @@ -74,57 +77,53 @@ public void testException() throws Exception { issuer.sendResult(); Truth.assertThat(batchedFuture.isDone()).isTrue(); - try { - batchedFuture.get(); - Assert.fail("BatchedFuture should have thrown an exception"); - } catch (ExecutionException e) { - Truth.assertThat(e.getCause()).isInstanceOf(IllegalArgumentException.class); - } + + ExecutionException actual = assertThrows(ExecutionException.class, batchedFuture::get); + assertInstanceOf(IllegalArgumentException.class, actual.getCause()); } @Test - public void testNoResult() { - try { - BatchedFuture batchedFuture = BatchedFuture.create(); - BatchedRequestIssuer issuer = new BatchedRequestIssuer<>(batchedFuture, 2); - issuer.sendResult(); - Assert.fail("BatchedFuture should have thrown an exception"); - } catch (IllegalStateException expected) { - Truth.assertThat(expected) - .hasMessageThat() - .contains("Neither response nor exception were set in BatchedRequestIssuer"); - } + void testNoResult() { + BatchedFuture batchedFuture = BatchedFuture.create(); + BatchedRequestIssuer issuer = new BatchedRequestIssuer<>(batchedFuture, 2); + + IllegalStateException actual = assertThrows(IllegalStateException.class, issuer::sendResult); + assertTrue( + actual + .getMessage() + .contains("Neither response nor exception were set in BatchedRequestIssuer")); } @Test - public void testResponseAndException() { - try { - Exception thrownException = new IllegalArgumentException("bad!"); - BatchedFuture batchedFuture = BatchedFuture.create(); - BatchedRequestIssuer issuer = new BatchedRequestIssuer<>(batchedFuture, 2); - issuer.setResponse(1); - issuer.setException(thrownException); - Assert.fail("BatchedFuture should have thrown an exception"); - } catch (IllegalStateException expected) { - Truth.assertThat(expected) - .hasMessageThat() - .contains("Cannot set both exception and response"); - } + void testResponseAndException() { + Exception thrownException = new IllegalArgumentException("bad!"); + BatchedFuture batchedFuture = BatchedFuture.create(); + BatchedRequestIssuer issuer = new BatchedRequestIssuer<>(batchedFuture, 2); + + IllegalStateException actual = + assertThrows( + IllegalStateException.class, + () -> { + issuer.setResponse(1); + issuer.setException(thrownException); + }); + + assertTrue(actual.getMessage().contains("Cannot set both exception and response")); } @Test - public void testExceptionAndResponse() { - try { - Exception thrownException = new IllegalArgumentException("bad!"); - BatchedFuture batchedFuture = BatchedFuture.create(); - BatchedRequestIssuer issuer = new BatchedRequestIssuer<>(batchedFuture, 2); - issuer.setException(thrownException); - issuer.setResponse(1); - Assert.fail("BatchedFuture should have thrown an exception"); - } catch (IllegalStateException expected) { - Truth.assertThat(expected) - .hasMessageThat() - .contains("Cannot set both exception and response"); - } + void testExceptionAndResponse() { + Exception thrownException = new IllegalArgumentException("bad!"); + BatchedFuture batchedFuture = BatchedFuture.create(); + BatchedRequestIssuer issuer = new BatchedRequestIssuer<>(batchedFuture, 2); + + IllegalStateException actual = + assertThrows( + IllegalStateException.class, + () -> { + issuer.setException(thrownException); + issuer.setResponse(1); + }); + assertTrue(actual.getMessage().contains("Cannot set both exception and response")); } } diff --git a/gax-java/gax/src/test/java/com/google/api/gax/rpc/BatcherFactoryTest.java b/gax-java/gax/src/test/java/com/google/api/gax/rpc/BatcherFactoryTest.java index 254ba2831c..8ece5dedde 100644 --- a/gax-java/gax/src/test/java/com/google/api/gax/rpc/BatcherFactoryTest.java +++ b/gax-java/gax/src/test/java/com/google/api/gax/rpc/BatcherFactoryTest.java @@ -42,35 +42,31 @@ import java.util.List; import java.util.concurrent.ScheduledExecutorService; import java.util.concurrent.ScheduledThreadPoolExecutor; -import org.junit.After; -import org.junit.Before; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.junit.runners.JUnit4; -import org.threeten.bp.Duration; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.mockito.Mockito; -@RunWith(JUnit4.class) -public class BatcherFactoryTest { +class BatcherFactoryTest { private ScheduledExecutorService batchingExecutor; - @Before - public void setUp() { + @BeforeEach + void setUp() { batchingExecutor = new ScheduledThreadPoolExecutor(1); } - @After - public void tearDown() { + @AfterEach + void tearDown() { batchingExecutor.shutdownNow(); } @Test - public void testGetPushingBatcher() { - BatchingSettings batchingSettings = - BatchingSettings.newBuilder() - .setDelayThreshold(Duration.ofSeconds(1)) - .setElementCountThreshold(2L) - .setRequestByteThreshold(1000L) - .build(); + void testGetPushingBatcher() { + final java.time.Duration delayThreshold = java.time.Duration.ofSeconds(1); + BatchingSettings batchingSettings = Mockito.mock(BatchingSettings.class); + Mockito.when(batchingSettings.getDelayThresholdDuration()).thenReturn(delayThreshold); + Mockito.when(batchingSettings.getElementCountThreshold()).thenReturn(2L); + Mockito.when(batchingSettings.getRequestByteThreshold()).thenReturn(1000L); FlowControlSettings flowControlSettings = FlowControlSettings.newBuilder() .setLimitExceededBehavior(LimitExceededBehavior.Ignore) @@ -90,6 +86,8 @@ public void testGetPushingBatcher() { ThresholdBatcher>> batcherBar = batcherFactory.getPushingBatcher(new PartitionKey("bar")); + Mockito.verify(batchingSettings, Mockito.times(2)).getDelayThresholdDuration(); + Truth.assertThat(batcherFoo).isSameInstanceAs(batcherFoo2); Truth.assertThat(batcherFoo).isNotSameInstanceAs(batcherBar); } diff --git a/gax-java/gax/src/test/java/com/google/api/gax/rpc/BatchingCallSettingsTest.java b/gax-java/gax/src/test/java/com/google/api/gax/rpc/BatchingCallSettingsTest.java index baafb1044e..b51a39b351 100644 --- a/gax-java/gax/src/test/java/com/google/api/gax/rpc/BatchingCallSettingsTest.java +++ b/gax-java/gax/src/test/java/com/google/api/gax/rpc/BatchingCallSettingsTest.java @@ -36,17 +36,13 @@ import com.google.common.collect.Sets; import com.google.common.truth.Truth; import java.util.Set; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.junit.runners.JUnit4; +import org.junit.jupiter.api.Test; import org.mockito.Mockito; -import org.threeten.bp.Duration; -@RunWith(JUnit4.class) -public class BatchingCallSettingsTest { +class BatchingCallSettingsTest { @Test - public void testEmptyBuilder() { + void testEmptyBuilder() { @SuppressWarnings("unchecked") BatchingDescriptor batchingDescriptor = Mockito.mock(BatchingDescriptor.class); @@ -72,7 +68,7 @@ public void testEmptyBuilder() { } @Test - public void testBuilder() { + void testBuilder() { @SuppressWarnings("unchecked") BatchingDescriptor batchingDescriptor = Mockito.mock(BatchingDescriptor.class); @@ -85,11 +81,11 @@ public void testBuilder() { Set retryCodes = Sets.newHashSet(Code.UNAVAILABLE); RetrySettings retrySettings = RetrySettings.newBuilder() - .setInitialRetryDelay(Duration.ofMillis(5)) - .setMaxRetryDelay(Duration.ofSeconds(1)) + .setInitialRetryDelayDuration(java.time.Duration.ofMillis(5)) + .setMaxRetryDelayDuration(java.time.Duration.ofSeconds(1)) .setRetryDelayMultiplier(2) - .setInitialRpcTimeout(Duration.ofMillis(100)) - .setMaxRpcTimeout(Duration.ofMillis(200)) + .setInitialRpcTimeoutDuration(java.time.Duration.ofMillis(100)) + .setMaxRpcTimeoutDuration(java.time.Duration.ofMillis(200)) .setRpcTimeoutMultiplier(1.1) .setJittered(true) .setMaxAttempts(10) @@ -116,7 +112,7 @@ public void testBuilder() { } @Test - public void testBuilderFromSettings() throws Exception { + void testBuilderFromSettings() throws Exception { @SuppressWarnings("unchecked") BatchingDescriptor batchingDescriptor = Mockito.mock(BatchingDescriptor.class); @@ -129,11 +125,11 @@ public void testBuilderFromSettings() throws Exception { Set retryCodes = Sets.newHashSet(Code.UNAVAILABLE); RetrySettings retrySettings = RetrySettings.newBuilder() - .setInitialRetryDelay(Duration.ofMillis(5)) - .setMaxRetryDelay(Duration.ofSeconds(1)) + .setInitialRetryDelayDuration(java.time.Duration.ofMillis(5)) + .setMaxRetryDelayDuration(java.time.Duration.ofSeconds(1)) .setRetryDelayMultiplier(2) - .setInitialRpcTimeout(Duration.ofMillis(100)) - .setMaxRpcTimeout(Duration.ofMillis(200)) + .setInitialRpcTimeoutDuration(java.time.Duration.ofMillis(100)) + .setMaxRpcTimeoutDuration(java.time.Duration.ofMillis(200)) .setRpcTimeoutMultiplier(1.1) .setJittered(true) .setMaxAttempts(10) @@ -155,7 +151,7 @@ public void testBuilderFromSettings() throws Exception { } @Test - public void testNoFlowControlSettings() throws Exception { + void testNoFlowControlSettings() throws Exception { @SuppressWarnings("unchecked") BatchingDescriptor batchingDescriptor = Mockito.mock(BatchingDescriptor.class); @@ -173,7 +169,7 @@ public void testNoFlowControlSettings() throws Exception { } @Test - public void testToString() { + void testToString() { @SuppressWarnings("unchecked") BatchingDescriptor batchingDescriptor = Mockito.mock(BatchingDescriptor.class); diff --git a/gax-java/gax/src/test/java/com/google/api/gax/rpc/BatchingCallableTest.java b/gax-java/gax/src/test/java/com/google/api/gax/rpc/BatchingCallableTest.java index a0234a441a..f31098ef2f 100644 --- a/gax-java/gax/src/test/java/com/google/api/gax/rpc/BatchingCallableTest.java +++ b/gax-java/gax/src/test/java/com/google/api/gax/rpc/BatchingCallableTest.java @@ -42,33 +42,29 @@ import java.util.List; import java.util.concurrent.ScheduledExecutorService; import java.util.concurrent.ScheduledThreadPoolExecutor; -import org.junit.After; -import org.junit.Before; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.junit.runners.JUnit4; -import org.threeten.bp.Duration; - -@RunWith(JUnit4.class) -public class BatchingCallableTest { +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; + +class BatchingCallableTest { private ScheduledExecutorService batchingExecutor; - @Before - public void setUp() { + @BeforeEach + void setUp() { batchingExecutor = new ScheduledThreadPoolExecutor(2); } - @After - public void tearDown() { + @AfterEach + void tearDown() { batchingExecutor.shutdownNow(); } @Test - public void testBatchedCall() throws Exception { + void testBatchedCall() throws Exception { BatchingSettings batchingSettings = BatchingSettings.newBuilder() - .setDelayThreshold(Duration.ofSeconds(10)) + .setDelayThresholdDuration(java.time.Duration.ofSeconds(10)) .setElementCountThreshold(2L) .setRequestByteThreshold(1000L) .build(); @@ -108,7 +104,7 @@ public void testBatchedCall() throws Exception { } @Test - public void testUnbatchedCall() throws Exception { + void testUnbatchedCall() throws Exception { BatchingSettings batchingSettings = BatchingSettings.newBuilder().setIsEnabled(false).build(); FlowControlSettings flowControlSettings = diff --git a/gax-java/gax/src/test/java/com/google/api/gax/rpc/BatchingTest.java b/gax-java/gax/src/test/java/com/google/api/gax/rpc/BatchingTest.java index 2b4a075963..675a51d72f 100644 --- a/gax-java/gax/src/test/java/com/google/api/gax/rpc/BatchingTest.java +++ b/gax-java/gax/src/test/java/com/google/api/gax/rpc/BatchingTest.java @@ -31,6 +31,7 @@ import static com.google.api.gax.rpc.testing.FakeBatchableApi.SQUARER_BATCHING_DESC; import static com.google.api.gax.rpc.testing.FakeBatchableApi.callLabeledIntSquarer; +import static org.junit.jupiter.api.Assertions.assertThrows; import com.google.api.core.ApiFuture; import com.google.api.gax.batching.BatchingSettings; @@ -48,22 +49,17 @@ import java.util.concurrent.ExecutionException; import java.util.concurrent.ScheduledExecutorService; import java.util.concurrent.ScheduledThreadPoolExecutor; -import org.junit.After; -import org.junit.Assert; -import org.junit.Before; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.junit.runners.JUnit4; -import org.threeten.bp.Duration; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; -@RunWith(JUnit4.class) -public class BatchingTest { +class BatchingTest { private ScheduledExecutorService batchingExecutor; private ClientContext clientContext; - @Before - public void setUp() { + @BeforeEach + void setUp() { batchingExecutor = new ScheduledThreadPoolExecutor(1); clientContext = ClientContext.newBuilder() @@ -73,16 +69,16 @@ public void setUp() { .build(); } - @After - public void teardown() { + @AfterEach + void teardown() { batchingExecutor.shutdownNow(); } @Test - public void batching() throws Exception { + void batching() throws Exception { BatchingSettings batchingSettings = BatchingSettings.newBuilder() - .setDelayThreshold(Duration.ofSeconds(1)) + .setDelayThresholdDuration(java.time.Duration.ofSeconds(1)) .setElementCountThreshold(2L) .build(); BatchingCallSettings> batchingCallSettings = @@ -99,10 +95,10 @@ public void batching() throws Exception { } @Test - public void batchingWithFlowControl() throws Exception { + void batchingWithFlowControl() throws Exception { BatchingSettings batchingSettings = BatchingSettings.newBuilder() - .setDelayThreshold(Duration.ofSeconds(1)) + .setDelayThresholdDuration(java.time.Duration.ofSeconds(1)) .setElementCountThreshold(4L) .setRequestByteThreshold(null) .setFlowControlSettings( @@ -160,7 +156,7 @@ public void batchingWithFlowControl() throws Exception { } @Test - public void batchingDisabled() throws Exception { + void batchingDisabled() throws Exception { BatchingSettings batchingSettings = BatchingSettings.newBuilder().setIsEnabled(false).build(); BatchingCallSettings> batchingCallSettings = @@ -177,10 +173,10 @@ public void batchingDisabled() throws Exception { } @Test - public void batchingWithBlockingCallThreshold() throws Exception { + void batchingWithBlockingCallThreshold() throws Exception { BatchingSettings batchingSettings = BatchingSettings.newBuilder() - .setDelayThreshold(Duration.ofSeconds(1)) + .setDelayThresholdDuration(java.time.Duration.ofSeconds(1)) .setElementCountThreshold(2L) .build(); BatchingCallSettings> batchingCallSettings = @@ -206,10 +202,10 @@ public ApiFuture> futureCall(LabeledIntList request, ApiCallContex }; @Test - public void batchingException() throws Exception { + void batchingException() throws Exception { BatchingSettings batchingSettings = BatchingSettings.newBuilder() - .setDelayThreshold(Duration.ofSeconds(1)) + .setDelayThresholdDuration(java.time.Duration.ofSeconds(1)) .setElementCountThreshold(2L) .build(); BatchingCallSettings> batchingCallSettings = @@ -221,17 +217,7 @@ public void batchingException() throws Exception { callLabeledIntExceptionThrower, batchingCallSettings, clientContext); ApiFuture> f1 = callable.futureCall(new LabeledIntList("one", 1, 2)); ApiFuture> f2 = callable.futureCall(new LabeledIntList("one", 3, 4)); - try { - f1.get(); - Assert.fail("Expected exception from batching call"); - } catch (ExecutionException e) { - // expected - } - try { - f2.get(); - Assert.fail("Expected exception from batching call"); - } catch (ExecutionException e) { - // expected - } + assertThrows(ExecutionException.class, f1::get); + assertThrows(ExecutionException.class, f2::get); } } diff --git a/gax-java/gax/src/test/java/com/google/api/gax/rpc/BidiStreamingCallableTest.java b/gax-java/gax/src/test/java/com/google/api/gax/rpc/BidiStreamingCallableTest.java index 76ecb1d519..da98235d74 100644 --- a/gax-java/gax/src/test/java/com/google/api/gax/rpc/BidiStreamingCallableTest.java +++ b/gax-java/gax/src/test/java/com/google/api/gax/rpc/BidiStreamingCallableTest.java @@ -44,9 +44,9 @@ import java.util.Iterator; import java.util.List; import java.util.concurrent.CountDownLatch; -import org.junit.Test; +import org.junit.jupiter.api.Test; -public class BidiStreamingCallableTest { +class BidiStreamingCallableTest { private ClientContext clientContext = ClientContext.newBuilder() .setDefaultCallContext(FakeCallContext.createDefault()) @@ -54,7 +54,7 @@ public class BidiStreamingCallableTest { .build(); @Test - public void bidiStreaming_ResponseObserver() { + void bidiStreaming_ResponseObserver() { BidiStreamingStashCallable callIntList = new BidiStreamingStashCallable<>(Arrays.asList(0, 1, 2)); @@ -77,7 +77,7 @@ public void bidiStreaming_ResponseObserver() { } @Test - public void bidiStreaming_BidiStreamObserver() throws InterruptedException { + void bidiStreaming_BidiStreamObserver() throws InterruptedException { BidiStreamingStashCallable callIntList = new BidiStreamingStashCallable<>(Arrays.asList(0, 1, 2)); diff --git a/gax-java/gax/src/test/java/com/google/api/gax/rpc/CallableTest.java b/gax-java/gax/src/test/java/com/google/api/gax/rpc/CallableTest.java index eaa0be04c7..55cb2f3024 100644 --- a/gax-java/gax/src/test/java/com/google/api/gax/rpc/CallableTest.java +++ b/gax-java/gax/src/test/java/com/google/api/gax/rpc/CallableTest.java @@ -29,28 +29,31 @@ */ package com.google.api.gax.rpc; +import static org.junit.jupiter.api.Assertions.assertEquals; import static org.mockito.ArgumentMatchers.any; import static org.mockito.ArgumentMatchers.anyString; +import static org.mockito.ArgumentMatchers.eq; import static org.mockito.Mockito.atLeastOnce; +import static org.mockito.Mockito.doReturn; import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; +import com.google.api.core.ApiClock; +import com.google.api.core.ApiFuture; import com.google.api.core.SettableApiFuture; import com.google.api.gax.retrying.RetrySettings; import com.google.api.gax.rpc.testing.FakeCallContext; -import org.junit.Rule; -import org.junit.Test; +import java.util.concurrent.ScheduledExecutorService; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; +import org.mockito.ArgumentCaptor; import org.mockito.Mock; +import org.mockito.Mockito; import org.mockito.Spy; -import org.mockito.junit.MockitoJUnit; -import org.mockito.junit.MockitoRule; -import org.mockito.quality.Strictness; -import org.threeten.bp.Duration; +import org.mockito.junit.jupiter.MockitoExtension; -public class CallableTest { - - @Rule - public final MockitoRule mockitoRule = MockitoJUnit.rule().strictness(Strictness.STRICT_STUBS); +@ExtendWith(MockitoExtension.class) +class CallableTest { @Mock private UnaryCallable innerCallable; private SettableApiFuture innerResult; @@ -59,9 +62,9 @@ public class CallableTest { private RetrySettings retrySettings = RetrySettings.newBuilder() - .setInitialRpcTimeout(Duration.ofMillis(5L)) - .setMaxRpcTimeout(Duration.ofMillis(5L)) - .setTotalTimeout(Duration.ofMillis(10L)) + .setInitialRpcTimeoutDuration(java.time.Duration.ofMillis(5L)) + .setMaxRpcTimeoutDuration(java.time.Duration.ofMillis(5L)) + .setTotalTimeoutDuration(java.time.Duration.ofMillis(10L)) .build(); @Spy private ApiCallContext callContext = FakeCallContext.createDefault(); @@ -74,75 +77,126 @@ public class CallableTest { ClientContext.newBuilder().setDefaultCallContext(callContext).build(); @Test - public void testNonRetriedCallable() throws Exception { + void testNonRetriedCallable() throws Exception { innerResult = SettableApiFuture.create(); when(innerCallable.futureCall(anyString(), any(ApiCallContext.class))).thenReturn(innerResult); - Duration timeout = Duration.ofMillis(5L); + java.time.Duration timeout = java.time.Duration.ofMillis(5L); + String initialRequest = "Is your refrigerator running?"; + String modifiedRequest = "What about now?"; + + RequestMutator requestMutator = (request -> modifiedRequest); UnaryCallSettings callSettings = - UnaryCallSettings.newUnaryCallSettingsBuilder().setSimpleTimeoutNoRetries(timeout).build(); + UnaryCallSettings.newUnaryCallSettingsBuilder() + .setSimpleTimeoutNoRetriesDuration(timeout) + .build(); UnaryCallable callable = - Callables.retrying(innerCallable, callSettings, clientContext); - innerResult.set("No, my refrigerator is not running!"); + Callables.retrying(innerCallable, callSettings, clientContext, requestMutator); + String expectedResponse = "No, my refrigerator is not running!"; + innerResult.set(expectedResponse); - callable.futureCall("Is your refrigerator running?", callContext); + ApiFuture futureResponse = callable.futureCall(initialRequest, callContext); + + ArgumentCaptor argumentCaptor = ArgumentCaptor.forClass(String.class); + verify(innerCallable).futureCall(argumentCaptor.capture(), any(ApiCallContext.class)); + String expectedRequest = "What about now?"; + assertEquals(expectedRequest, argumentCaptor.getValue()); verify(callContext, atLeastOnce()).getRetrySettings(); - verify(callContext).getTimeout(); - verify(callContext).withTimeout(timeout); + verify(callContext).getTimeoutDuration(); + verify(callContext).withTimeoutDuration(timeout); + assertEquals(expectedResponse, futureResponse.get()); } @Test - public void testNonRetriedCallableWithRetrySettings() throws Exception { + void testNonRetriedCallableWithRetrySettings() throws Exception { innerResult = SettableApiFuture.create(); when(innerCallable.futureCall(anyString(), any(ApiCallContext.class))).thenReturn(innerResult); + String initialRequest = "Is your refrigerator running?"; + String modifiedRequest = "What about now?"; + RequestMutator requestMutator = (request -> modifiedRequest); + UnaryCallSettings callSettings = UnaryCallSettings.newUnaryCallSettingsBuilder() - .setSimpleTimeoutNoRetries(Duration.ofMillis(10L)) + .setSimpleTimeoutNoRetriesDuration(java.time.Duration.ofMillis(10L)) .build(); UnaryCallable callable = - Callables.retrying(innerCallable, callSettings, clientContext); - innerResult.set("No, my refrigerator is not running!"); + Callables.retrying(innerCallable, callSettings, clientContext, requestMutator); + String expectedResponse = "No, my refrigerator is not running!"; + innerResult.set(expectedResponse); - Duration timeout = retrySettings.getInitialRpcTimeout(); + java.time.Duration timeout = retrySettings.getInitialRpcTimeoutDuration(); - callable.futureCall("Is your refrigerator running?", callContextWithRetrySettings); + ApiFuture futureResponse = + callable.futureCall(initialRequest, callContextWithRetrySettings); + + ArgumentCaptor argumentCaptor = ArgumentCaptor.forClass(String.class); + verify(innerCallable).futureCall(argumentCaptor.capture(), any(ApiCallContext.class)); + String expectedRequest = "What about now?"; + assertEquals(expectedRequest, argumentCaptor.getValue()); verify(callContextWithRetrySettings, atLeastOnce()).getRetrySettings(); - verify(callContextWithRetrySettings).getTimeout(); - verify(callContextWithRetrySettings).withTimeout(timeout); + verify(callContextWithRetrySettings).getTimeoutDuration(); + verify(callContextWithRetrySettings).withTimeoutDuration(timeout); + assertEquals(expectedResponse, futureResponse.get()); } @Test - public void testNonRetriedServerStreamingCallable() throws Exception { - Duration timeout = Duration.ofMillis(5L); + void testNonRetriedServerStreamingCallable() throws Exception { + java.time.Duration timeout = java.time.Duration.ofMillis(5L); ServerStreamingCallSettings callSettings = - ServerStreamingCallSettings.newBuilder().setSimpleTimeoutNoRetries(timeout).build(); + ServerStreamingCallSettings.newBuilder().setSimpleTimeoutNoRetriesDuration(timeout).build(); ServerStreamingCallable callable = Callables.retrying(innerServerStreamingCallable, callSettings, clientContext); callable.call("Is your refrigerator running?", callContext); verify(callContext, atLeastOnce()).getRetrySettings(); - verify(callContext).getTimeout(); - verify(callContext).withTimeout(timeout); + verify(callContext).getTimeoutDuration(); + verify(callContext).withTimeoutDuration(timeout); } @Test - public void testNonRetriedServerStreamingCallableWithRetrySettings() throws Exception { + void testNonRetriedServerStreamingCallableWithRetrySettings() throws Exception { ServerStreamingCallSettings callSettings = ServerStreamingCallSettings.newBuilder() - .setSimpleTimeoutNoRetries(Duration.ofMillis(10L)) + .setSimpleTimeoutNoRetriesDuration(java.time.Duration.ofMillis(10L)) .build(); ServerStreamingCallable callable = Callables.retrying(innerServerStreamingCallable, callSettings, clientContext); - Duration timeout = retrySettings.getTotalTimeout(); + java.time.Duration timeout = retrySettings.getInitialRpcTimeoutDuration(); callable.call("Is your refrigerator running?", callContextWithRetrySettings); verify(callContextWithRetrySettings, atLeastOnce()).getRetrySettings(); - verify(callContextWithRetrySettings).getTimeout(); - verify(callContextWithRetrySettings).withTimeout(timeout); + verify(callContextWithRetrySettings).getTimeoutDuration(); + verify(callContextWithRetrySettings).withTimeoutDuration(timeout); + } + + @Test + void testWatched_usesJavaTimeMethods() { + java.time.Duration timeout = java.time.Duration.ofMillis(5L); + doReturn(callContext).when(callContext).withStreamIdleTimeoutDuration(eq(timeout)); + Watchdog watchdog = + Watchdog.createDuration( + Mockito.mock(ApiClock.class), + java.time.Duration.ZERO, + Mockito.mock(ScheduledExecutorService.class)); + ClientContext clientContext = + ClientContext.newBuilder() + .setStreamWatchdog(watchdog) + .setDefaultCallContext(callContext) + .build(); + ServerStreamingCallSettings callSettings = + ServerStreamingCallSettings.newBuilder() + .setIdleTimeoutDuration(timeout) + .setWaitTimeoutDuration(timeout) + .build(); + ServerStreamingCallable callable = + Callables.retrying(innerServerStreamingCallable, callSettings, clientContext); + Callables.watched(callable, callSettings, clientContext); + verify(callContext, atLeastOnce()).withStreamIdleTimeoutDuration(eq(timeout)); + verify(callContext, atLeastOnce()).withStreamWaitTimeoutDuration(eq(timeout)); } } diff --git a/gax-java/gax/src/test/java/com/google/api/gax/rpc/CancellationHelpers.java b/gax-java/gax/src/test/java/com/google/api/gax/rpc/CancellationHelpers.java index 446090bac4..b42a9ef51f 100644 --- a/gax-java/gax/src/test/java/com/google/api/gax/rpc/CancellationHelpers.java +++ b/gax-java/gax/src/test/java/com/google/api/gax/rpc/CancellationHelpers.java @@ -37,23 +37,20 @@ * CancellationHelpers provides helpers for cancellation tests which perform cancellation in a * deterministic way. */ -public class CancellationHelpers { +class CancellationHelpers { public static void cancelInThreadAfterLatchCountDown( final ApiFuture resultFuture, final CountDownLatch latch) { Thread t = new Thread( - new Runnable() { - @Override - public void run() { - try { - latch.await(); - while (!resultFuture.cancel(true) && !resultFuture.isDone()) { - LockSupport.parkNanos(1000L); - } - } catch (InterruptedException e) { - Thread.currentThread().interrupt(); + () -> { + try { + latch.await(); + while (!resultFuture.cancel(true) && !resultFuture.isDone()) { + LockSupport.parkNanos(1000L); } + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); } }); t.start(); diff --git a/gax-java/gax/src/test/java/com/google/api/gax/rpc/CancellationTest.java b/gax-java/gax/src/test/java/com/google/api/gax/rpc/CancellationTest.java index bb36d863cd..0e24287131 100644 --- a/gax-java/gax/src/test/java/com/google/api/gax/rpc/CancellationTest.java +++ b/gax-java/gax/src/test/java/com/google/api/gax/rpc/CancellationTest.java @@ -46,49 +46,45 @@ import java.util.concurrent.CancellationException; import java.util.concurrent.CountDownLatch; import java.util.concurrent.ScheduledThreadPoolExecutor; -import org.junit.After; -import org.junit.Assert; -import org.junit.Before; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.junit.runners.JUnit4; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; import org.mockito.Mockito; -import org.threeten.bp.Duration; -@RunWith(JUnit4.class) -public class CancellationTest { +class CancellationTest { @SuppressWarnings("unchecked") private UnaryCallable callInt = Mockito.mock(UnaryCallable.class); private static final RetrySettings FAST_RETRY_SETTINGS = RetrySettings.newBuilder() - .setInitialRetryDelay(Duration.ofMillis(2L)) + .setInitialRetryDelayDuration(java.time.Duration.ofMillis(2L)) .setRetryDelayMultiplier(1) - .setMaxRetryDelay(Duration.ofMillis(2L)) - .setInitialRpcTimeout(Duration.ofMillis(2L)) + .setMaxRetryDelayDuration(java.time.Duration.ofMillis(2L)) + .setInitialRpcTimeoutDuration(java.time.Duration.ofMillis(2L)) .setRpcTimeoutMultiplier(1) - .setMaxRpcTimeout(Duration.ofMillis(2L)) - .setTotalTimeout(Duration.ofMillis(20L)) + .setMaxRpcTimeoutDuration(java.time.Duration.ofMillis(2L)) + .setTotalTimeoutDuration(java.time.Duration.ofMillis(20L)) .build(); private static final RetrySettings SLOW_RETRY_SETTINGS = RetrySettings.newBuilder() - .setInitialRetryDelay(Duration.ofMillis(3000L)) + .setInitialRetryDelayDuration(java.time.Duration.ofMillis(3000L)) .setRetryDelayMultiplier(1) - .setMaxRetryDelay(Duration.ofMillis(3000L)) - .setInitialRpcTimeout(Duration.ofMillis(3000L)) + .setMaxRetryDelayDuration(java.time.Duration.ofMillis(3000L)) + .setInitialRpcTimeoutDuration(java.time.Duration.ofMillis(3000L)) .setRpcTimeoutMultiplier(1) - .setMaxRpcTimeout(Duration.ofMillis(3000L)) - .setTotalTimeout(Duration.ofMillis(3000L)) + .setMaxRpcTimeoutDuration(java.time.Duration.ofMillis(3000L)) + .setTotalTimeoutDuration(java.time.Duration.ofMillis(3000L)) .build(); private FakeApiClock fakeClock; private RecordingScheduler executor; private ClientContext clientContext; - @Before - public void resetClock() { + @BeforeEach + void resetClock() { fakeClock = new FakeApiClock(System.nanoTime()); executor = RecordingScheduler.create(fakeClock); clientContext = @@ -100,13 +96,13 @@ public void resetClock() { .build(); } - @After - public void teardown() { + @AfterEach + void teardown() { executor.shutdownNow(); } @Test - public void cancellationBeforeGetOnRetryingCallable() throws Exception { + void cancellationBeforeGetOnRetryingCallable() throws Exception { try { Mockito.when(callInt.futureCall((Integer) Mockito.any(), (ApiCallContext) Mockito.any())) .thenReturn(SettableApiFuture.create()); @@ -119,7 +115,7 @@ public void cancellationBeforeGetOnRetryingCallable() throws Exception { ApiFuture resultFuture = callable.futureCall(0); resultFuture.cancel(true); resultFuture.get(); - Assert.fail("Callable should have thrown an exception"); + Assertions.fail("Callable should have thrown an exception"); } catch (CancellationException expected) { Truth.assertThat(expected).hasMessageThat().contains("Task was cancelled"); } @@ -169,7 +165,7 @@ public ApiFuture futureCall(RequestT request, ApiCallContext context) } @Test - public void cancellationDuringFirstCall() throws Exception { + void cancellationDuringFirstCall() throws Exception { CancellationTrackingFuture innerFuture = CancellationTrackingFuture.create(); CountDownLatch callIssuedLatch = new CountDownLatch(1); UnaryCallable innerCallable = @@ -196,7 +192,7 @@ public void cancellationDuringFirstCall() throws Exception { } @Test - public void cancellationDuringRetryDelay() throws Exception { + void cancellationDuringRetryDelay() throws Exception { Throwable throwable = new UnavailableException(null, FakeStatusCode.of(StatusCode.Code.UNAVAILABLE), true); CancellationTrackingFuture innerFuture = CancellationTrackingFuture.create(); @@ -229,7 +225,7 @@ public void cancellationDuringRetryDelay() throws Exception { } @Test - public void cancellationDuringSecondCall() throws Exception { + void cancellationDuringSecondCall() throws Exception { Throwable throwable = new UnavailableException(null, FakeStatusCode.of(StatusCode.Code.UNAVAILABLE), true); ApiFuture failingFuture = RetryingTest.immediateFailedFuture(throwable); diff --git a/gax-java/gax/src/test/java/com/google/api/gax/rpc/CheckingAttemptCallableTest.java b/gax-java/gax/src/test/java/com/google/api/gax/rpc/CheckingAttemptCallableTest.java index 92554616bc..5d7e905af6 100644 --- a/gax-java/gax/src/test/java/com/google/api/gax/rpc/CheckingAttemptCallableTest.java +++ b/gax-java/gax/src/test/java/com/google/api/gax/rpc/CheckingAttemptCallableTest.java @@ -30,35 +30,34 @@ package com.google.api.gax.rpc; import static com.google.common.truth.Truth.assertThat; +import static org.mockito.Mockito.verify; import com.google.api.core.SettableApiFuture; import com.google.api.gax.retrying.RetrySettings; import com.google.api.gax.retrying.RetryingFuture; import com.google.api.gax.retrying.TimedAttemptSettings; import com.google.api.gax.rpc.testing.FakeCallContext; -import org.junit.Before; -import org.junit.Test; -import org.junit.runner.RunWith; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; import org.mockito.ArgumentCaptor; +import org.mockito.ArgumentMatchers; import org.mockito.Mock; import org.mockito.Mockito; import org.mockito.invocation.InvocationOnMock; -import org.mockito.junit.MockitoJUnitRunner; +import org.mockito.junit.jupiter.MockitoExtension; import org.mockito.stubbing.Answer; -import org.threeten.bp.Duration; -@RunWith(MockitoJUnitRunner.class) -public class CheckingAttemptCallableTest { +@ExtendWith(MockitoExtension.class) +class CheckingAttemptCallableTest { @Mock UnaryCallable mockInnerCallable; ArgumentCaptor capturedCallContext; @Mock RetryingFuture mockExternalFuture; TimedAttemptSettings currentAttemptSettings; - @Before - public void setUp() { + @BeforeEach + void setUp() { capturedCallContext = ArgumentCaptor.forClass(ApiCallContext.class); - Mockito.when(mockInnerCallable.futureCall(Mockito.any(), capturedCallContext.capture())) - .thenReturn(SettableApiFuture.create()); currentAttemptSettings = TimedAttemptSettings.newBuilder() @@ -66,9 +65,9 @@ public void setUp() { .setAttemptCount(0) .setOverallAttemptCount(0) .setFirstAttemptStartTimeNanos(0) - .setRetryDelay(Duration.ofSeconds(1)) - .setRandomizedRetryDelay(Duration.ofSeconds(1)) - .setRpcTimeout(Duration.ZERO) + .setRetryDelayDuration(java.time.Duration.ofSeconds(1)) + .setRandomizedRetryDelayDuration(java.time.Duration.ofSeconds(1)) + .setRpcTimeoutDuration(java.time.Duration.ZERO) .build(); Mockito.when(mockExternalFuture.getAttemptSettings()) @@ -82,24 +81,45 @@ public TimedAttemptSettings answer(InvocationOnMock invocation) throws Throwable } @Test - public void testRpcTimeout() { + void testRpcTimeout_gtZero_succeeds() { + Mockito.when(mockInnerCallable.futureCall(Mockito.any(), capturedCallContext.capture())) + .thenReturn(SettableApiFuture.create()); CheckingAttemptCallable callable = new CheckingAttemptCallable<>(mockInnerCallable, FakeCallContext.createDefault()); callable.setExternalFuture(mockExternalFuture); // Make sure that the rpc timeout is set - Duration timeout = Duration.ofSeconds(10); - currentAttemptSettings = currentAttemptSettings.toBuilder().setRpcTimeout(timeout).build(); + java.time.Duration timeout = java.time.Duration.ofSeconds(10); + currentAttemptSettings = + currentAttemptSettings.toBuilder().setRpcTimeoutDuration(timeout).build(); + + callable.call(); + + assertThat(capturedCallContext.getValue().getTimeoutDuration()).isEqualTo(timeout); + // Make sure that subsequent attempts can extend the timeout + java.time.Duration longerTimeout = java.time.Duration.ofSeconds(20); + currentAttemptSettings = + currentAttemptSettings.toBuilder().setRpcTimeoutDuration(longerTimeout).build(); callable.call(); + assertThat(capturedCallContext.getValue().getTimeoutDuration()).isEqualTo(longerTimeout); + } - assertThat(capturedCallContext.getValue().getTimeout()).isEqualTo(timeout); + @Test + void testRpcTimeout_gtZero_callsWithTimeoutDuration() { + FakeCallContext callContext = Mockito.spy(FakeCallContext.createDefault()); + Mockito.doReturn(callContext).when(callContext).withTimeoutDuration(ArgumentMatchers.any()); + CheckingAttemptCallable callable = + new CheckingAttemptCallable<>(Mockito.mock(UnaryCallable.class), callContext); + callable.setExternalFuture(mockExternalFuture); - // Make sure that subsequent attempts can extend the time out - Duration longerTimeout = Duration.ofSeconds(20); + // Make sure that the rpc timeout is set + java.time.Duration timeout = java.time.Duration.ofSeconds(10); currentAttemptSettings = - currentAttemptSettings.toBuilder().setRpcTimeout(longerTimeout).build(); + currentAttemptSettings.toBuilder().setRpcTimeoutDuration(timeout).build(); + callable.call(); - assertThat(capturedCallContext.getValue().getTimeout()).isEqualTo(longerTimeout); + + verify(callContext).withTimeoutDuration(timeout); } } diff --git a/gax-java/gax/src/test/java/com/google/api/gax/rpc/ClientContextTest.java b/gax-java/gax/src/test/java/com/google/api/gax/rpc/ClientContextTest.java index 7fe418dd68..d3c202d99e 100644 --- a/gax-java/gax/src/test/java/com/google/api/gax/rpc/ClientContextTest.java +++ b/gax-java/gax/src/test/java/com/google/api/gax/rpc/ClientContextTest.java @@ -29,11 +29,17 @@ */ package com.google.api.gax.rpc; +import static com.google.api.gax.util.TimeConversionTestUtils.testDurationMethod; import static com.google.common.truth.Truth.assertThat; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertTrue; -import static org.junit.Assert.fail; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertNotSame; +import static org.junit.jupiter.api.Assertions.assertThrows; +import static org.junit.jupiter.api.Assertions.assertTrue; +import static org.mockito.Mockito.times; +import static org.mockito.Mockito.verify; +import static org.mockito.Mockito.when; import com.google.api.core.ApiClock; import com.google.api.gax.core.BackgroundResource; @@ -41,32 +47,37 @@ import com.google.api.gax.core.ExecutorProvider; import com.google.api.gax.core.FixedCredentialsProvider; import com.google.api.gax.core.FixedExecutorProvider; -import com.google.api.gax.rpc.mtls.MtlsProvider; -import com.google.api.gax.rpc.mtls.MtlsProvider.MtlsEndpointUsagePolicy; +import com.google.api.gax.core.NoCredentialsProvider; +import com.google.api.gax.rpc.testing.FakeCallContext; import com.google.api.gax.rpc.testing.FakeChannel; import com.google.api.gax.rpc.testing.FakeClientSettings; -import com.google.api.gax.rpc.testing.FakeMtlsProvider; import com.google.api.gax.rpc.testing.FakeStubSettings; import com.google.api.gax.rpc.testing.FakeTransportChannel; +import com.google.api.gax.tracing.ApiTracerFactory; +import com.google.api.gax.tracing.SpanTracerFactory; +import com.google.auth.ApiKeyCredentials; +import com.google.auth.CredentialTypeForMetrics; import com.google.auth.Credentials; +import com.google.auth.oauth2.ComputeEngineCredentials; +import com.google.auth.oauth2.GdchCredentials; import com.google.auth.oauth2.GoogleCredentials; import com.google.common.collect.ImmutableMap; import com.google.common.truth.Truth; import java.io.IOException; +import java.net.URI; import java.util.Collections; import java.util.List; import java.util.Map; import java.util.concurrent.Executor; import java.util.concurrent.ScheduledExecutorService; import java.util.concurrent.ScheduledThreadPoolExecutor; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.junit.runners.JUnit4; +import org.junit.jupiter.api.Test; import org.mockito.Mockito; -import org.threeten.bp.Duration; -@RunWith(JUnit4.class) -public class ClientContextTest { +class ClientContextTest { + private static final String DEFAULT_UNIVERSE_DOMAIN = "googleapis.com"; + private static final String DEFAULT_ENDPOINT = "https://foo.googleapis.com"; + private static final String DEFAULT_MTLS_ENDPOINT = "https://foo.mtls.googleapis.com"; private static class InterceptingExecutor extends ScheduledThreadPoolExecutor { boolean shutdownCalled = false; @@ -106,19 +117,25 @@ private static class FakeTransportProvider implements TransportChannelProvider { final boolean shouldAutoClose; final Map headers; final Credentials credentials; + final String endpoint; + final String mtlsEndpoint; FakeTransportProvider( FakeTransportChannel transport, Executor executor, boolean shouldAutoClose, Map headers, - Credentials credentials) { + Credentials credentials, + String endpoint, + String mtlsEndpoint) { this.transport = transport; this.executor = executor; this.shouldAutoClose = shouldAutoClose; this.headers = headers; this.transport.setHeaders(headers); this.credentials = credentials; + this.endpoint = endpoint; + this.mtlsEndpoint = mtlsEndpoint; } @Override @@ -139,7 +156,13 @@ public TransportChannelProvider withExecutor(ScheduledExecutorService executor) @Override public TransportChannelProvider withExecutor(Executor executor) { return new FakeTransportProvider( - this.transport, executor, this.shouldAutoClose, this.headers, this.credentials); + this.transport, + executor, + this.shouldAutoClose, + this.headers, + this.credentials, + this.endpoint, + this.mtlsEndpoint); } @Override @@ -150,17 +173,35 @@ public boolean needsHeaders() { @Override public TransportChannelProvider withHeaders(Map headers) { return new FakeTransportProvider( - this.transport, this.executor, this.shouldAutoClose, headers, this.credentials); + this.transport, + this.executor, + this.shouldAutoClose, + headers, + this.credentials, + this.endpoint, + this.mtlsEndpoint); } @Override public boolean needsEndpoint() { - return false; + return true; + } + + @Override + public String getEndpoint() { + return endpoint; } @Override public TransportChannelProvider withEndpoint(String endpoint) { - return this; + return new FakeTransportProvider( + this.transport, + this.executor, + this.shouldAutoClose, + this.headers, + this.credentials, + endpoint, + this.mtlsEndpoint); } @Override @@ -176,9 +217,6 @@ public TransportChannelProvider withPoolSize(int size) { @Override public TransportChannel getTransportChannel() throws IOException { - if (needsCredentials()) { - throw new IllegalStateException("Needs Credentials"); - } transport.setExecutor(executor); return transport; } @@ -196,33 +234,61 @@ public boolean needsCredentials() { @Override public TransportChannelProvider withCredentials(Credentials credentials) { return new FakeTransportProvider( - this.transport, this.executor, this.shouldAutoClose, this.headers, credentials); + this.transport, + this.executor, + this.shouldAutoClose, + this.headers, + credentials, + this.endpoint, + this.mtlsEndpoint); + } + + @Override + public boolean needsMtlsEndpoint() { + return this.mtlsEndpoint == null; + } + + @Override + public TransportChannelProvider withMtlsEndpoint(String mtlsEndpoint) { + // Throws an exception if this is passed with a null value. This should never + // happen as GAPICs should always have a default mtlsEndpoint value + if (mtlsEndpoint == null) { + throw new IllegalArgumentException("mtlsEndpoint is null"); + } + return new FakeTransportProvider( + this.transport, + this.executor, + this.shouldAutoClose, + this.headers, + this.credentials, + this.endpoint, + mtlsEndpoint); } } @Test - public void testNoAutoCloseContextNeedsNoExecutor() throws Exception { + void testNoAutoCloseContextNeedsNoExecutor() throws Exception { runTest(false, false, false, false); } @Test - public void testWithAutoCloseContextNeedsNoExecutor() throws Exception { + void testWithAutoCloseContextNeedsNoExecutor() throws Exception { runTest(true, false, false, false); } @Test - public void testWithAutoCloseContextNeedsExecutor() throws Exception { + void testWithAutoCloseContextNeedsExecutor() throws Exception { runTest(true, true, false, false); } @Test - public void testNeedsHeaders() throws Exception { + void testNeedsHeaders() throws Exception { runTest(false, false, true, false); } - @Test(expected = IllegalArgumentException.class) - public void testNeedsHeadersCollision() throws Exception { - runTest(false, false, true, true); + @Test + void testNeedsHeadersCollision() throws Exception { + assertThrows(IllegalArgumentException.class, () -> runTest(false, false, true, true)); } private void runTest( @@ -243,21 +309,23 @@ private void runTest( contextNeedsExecutor ? null : executor, shouldAutoClose, needHeaders ? null : headers, - null); + null, + DEFAULT_ENDPOINT, + DEFAULT_MTLS_ENDPOINT); Credentials credentials = Mockito.mock(Credentials.class); ApiClock clock = Mockito.mock(ApiClock.class); Watchdog watchdog = - Watchdog.create( + Watchdog.createDuration( Mockito.mock(ApiClock.class), - Duration.ZERO, + java.time.Duration.ZERO, Mockito.mock(ScheduledExecutorService.class)); - Duration watchdogCheckInterval = Duration.ofSeconds(11); + java.time.Duration watchdogCheckInterval = java.time.Duration.ofSeconds(11); builder.setExecutorProvider(executorProvider); builder.setTransportChannelProvider(transportProvider); builder.setCredentialsProvider(FixedCredentialsProvider.create(credentials)); builder.setWatchdogProvider(FixedWatchdogProvider.create(watchdog)); - builder.setWatchdogCheckInterval(watchdogCheckInterval); + builder.setWatchdogCheckIntervalDuration(watchdogCheckInterval); builder.setClock(clock); HeaderProvider headerProvider = Mockito.mock(HeaderProvider.class); @@ -284,7 +352,7 @@ private void runTest( Truth.assertThat(clientContext.getCredentials()).isSameInstanceAs(credentials); Truth.assertThat(clientContext.getClock()).isSameInstanceAs(clock); Truth.assertThat(clientContext.getStreamWatchdog()).isSameInstanceAs(watchdog); - Truth.assertThat(clientContext.getStreamWatchdogCheckInterval()) + Truth.assertThat(clientContext.getStreamWatchdogCheckIntervalDuration()) .isEqualTo(watchdogCheckInterval); Truth.assertThat(clientContext.getHeaders()).isEqualTo(ImmutableMap.of("k1", "v1")); @@ -311,13 +379,14 @@ private void runTest( } @Test - public void testWatchdogProvider() throws IOException { + void testWatchdogProvider() throws IOException { FakeClientSettings.Builder builder = new FakeClientSettings.Builder(); InterceptingExecutor executor = new InterceptingExecutor(1); FakeTransportChannel transportChannel = FakeTransportChannel.create(new FakeChannel()); FakeTransportProvider transportProvider = - new FakeTransportProvider(transportChannel, executor, true, null, null); + new FakeTransportProvider( + transportChannel, executor, true, null, null, DEFAULT_ENDPOINT, DEFAULT_MTLS_ENDPOINT); ApiClock clock = Mockito.mock(ApiClock.class); builder.setClock(clock); @@ -326,13 +395,13 @@ public void testWatchdogProvider() throws IOException { builder.setExecutorProvider(new FakeExecutorProvider(executor, true)); builder.setTransportChannelProvider(transportProvider); - Duration watchdogCheckInterval = Duration.ofSeconds(11); + java.time.Duration watchdogCheckInterval = java.time.Duration.ofSeconds(11); builder.setWatchdogProvider( InstantiatingWatchdogProvider.create() .withClock(clock) - .withCheckInterval(watchdogCheckInterval) + .withCheckIntervalDuration(watchdogCheckInterval) .withExecutor(executor)); - builder.setWatchdogCheckInterval(watchdogCheckInterval); + builder.setWatchdogCheckIntervalDuration(watchdogCheckInterval); HeaderProvider headerProvider = Mockito.mock(HeaderProvider.class); Mockito.when(headerProvider.getHeaders()).thenReturn(ImmutableMap.of("k1", "v1")); @@ -348,7 +417,7 @@ public void testWatchdogProvider() throws IOException { } @Test - public void testMergeHeaders_getQuotaProjectIdFromHeadersProvider() throws IOException { + void testMergeHeaders_getQuotaProjectIdFromHeadersProvider() throws IOException { final String QUOTA_PROJECT_ID_KEY = "x-goog-user-project"; final String QUOTA_PROJECT_ID_FROM_SETTINGS = "quota_project_id_from_settings"; FakeClientSettings.Builder builder = new FakeClientSettings.Builder(); @@ -356,7 +425,8 @@ public void testMergeHeaders_getQuotaProjectIdFromHeadersProvider() throws IOExc InterceptingExecutor executor = new InterceptingExecutor(1); FakeTransportChannel transportChannel = FakeTransportChannel.create(new FakeChannel()); FakeTransportProvider transportProvider = - new FakeTransportProvider(transportChannel, executor, true, null, null); + new FakeTransportProvider( + transportChannel, executor, true, null, null, DEFAULT_ENDPOINT, DEFAULT_MTLS_ENDPOINT); HeaderProvider headerProvider = Mockito.mock(HeaderProvider.class); Mockito.when(headerProvider.getHeaders()).thenReturn(ImmutableMap.of("header_k1", "v1")); @@ -382,7 +452,7 @@ public void testMergeHeaders_getQuotaProjectIdFromHeadersProvider() throws IOExc } @Test - public void testMergeHeaders_getQuotaProjectIdFromSettings() throws IOException { + void testMergeHeaders_getQuotaProjectIdFromSettings() throws IOException { final String QUOTA_PROJECT_ID_KEY = "x-goog-user-project"; final String QUOTA_PROJECT_ID_FROM_HEADERS = "quota_project_id_from_headers"; final String QUOTA_PROJECT_ID_FROM_INTERNAL_HEADERS = "quota_project_id_from_internal_headers"; @@ -392,7 +462,8 @@ public void testMergeHeaders_getQuotaProjectIdFromSettings() throws IOException InterceptingExecutor executor = new InterceptingExecutor(1); FakeTransportChannel transportChannel = FakeTransportChannel.create(new FakeChannel()); FakeTransportProvider transportProvider = - new FakeTransportProvider(transportChannel, executor, true, null, null); + new FakeTransportProvider( + transportChannel, executor, true, null, null, DEFAULT_ENDPOINT, DEFAULT_MTLS_ENDPOINT); HeaderProvider headerProvider = new HeaderProvider() { @@ -431,14 +502,15 @@ public Map getHeaders() { } @Test - public void testMergeHeaders_noQuotaProjectIdSet() throws IOException { + void testMergeHeaders_noQuotaProjectIdSet() throws IOException { final String QUOTA_PROJECT_ID_KEY = "x-goog-user-project"; FakeClientSettings.Builder builder = new FakeClientSettings.Builder(); InterceptingExecutor executor = new InterceptingExecutor(1); FakeTransportChannel transportChannel = FakeTransportChannel.create(new FakeChannel()); FakeTransportProvider transportProvider = - new FakeTransportProvider(transportChannel, executor, true, null, null); + new FakeTransportProvider( + transportChannel, executor, true, null, null, DEFAULT_ENDPOINT, DEFAULT_MTLS_ENDPOINT); HeaderProvider headerProvider = Mockito.mock(HeaderProvider.class); Mockito.when(headerProvider.getHeaders()).thenReturn(ImmutableMap.of("header_k1", "v1")); @@ -461,7 +533,7 @@ public void testMergeHeaders_noQuotaProjectIdSet() throws IOException { } @Test - public void testHidingQuotaProjectId_quotaSetFromSetting() throws IOException { + void testHidingQuotaProjectId_quotaSetFromSetting() throws IOException { final String QUOTA_PROJECT_ID_KEY = "x-goog-user-project"; final String QUOTA_PROJECT_ID_FROM_CREDENTIALS_VALUE = "quota_project_id_from_credentials"; FakeClientSettings.Builder builder = new FakeClientSettings.Builder(); @@ -469,7 +541,8 @@ public void testHidingQuotaProjectId_quotaSetFromSetting() throws IOException { InterceptingExecutor executor = new InterceptingExecutor(1); FakeTransportChannel transportChannel = FakeTransportChannel.create(new FakeChannel()); FakeTransportProvider transportProvider = - new FakeTransportProvider(transportChannel, executor, true, null, null); + new FakeTransportProvider( + transportChannel, executor, true, null, null, DEFAULT_ENDPOINT, DEFAULT_MTLS_ENDPOINT); Map> metaDataWithQuota = ImmutableMap.of( "k1", @@ -504,13 +577,14 @@ public Credentials getCredentials() throws IOException { } @Test - public void testHidingQuotaProjectId_noQuotaSetFromSetting() throws IOException { + void testHidingQuotaProjectId_noQuotaSetFromSetting() throws IOException { FakeClientSettings.Builder builder = new FakeClientSettings.Builder(); InterceptingExecutor executor = new InterceptingExecutor(1); FakeTransportChannel transportChannel = FakeTransportChannel.create(new FakeChannel()); FakeTransportProvider transportProvider = - new FakeTransportProvider(transportChannel, executor, true, null, null); + new FakeTransportProvider( + transportChannel, executor, true, null, null, DEFAULT_ENDPOINT, DEFAULT_MTLS_ENDPOINT); Map> metaData = ImmutableMap.of("k1", Collections.singletonList("v1")); final Credentials credentialsWithoutQuotaProjectId = Mockito.mock(GoogleCredentials.class); Mockito.when(credentialsWithoutQuotaProjectId.getRequestMetadata(null)).thenReturn(metaData); @@ -534,10 +608,42 @@ public Credentials getCredentials() throws IOException { } @Test - public void testUserAgentInternalOnly() throws Exception { + void testQuotaProjectId_worksWithNullCredentials() throws IOException { + final String QUOTA_PROJECT_ID = "quota_project_id"; + + final InterceptingExecutor executor = new InterceptingExecutor(1); + final FakeTransportChannel transportChannel = FakeTransportChannel.create(new FakeChannel()); + final FakeTransportProvider transportProvider = + new FakeTransportProvider( + transportChannel, + executor, + true, + null, + Mockito.mock(Credentials.class), + DEFAULT_ENDPOINT, + DEFAULT_MTLS_ENDPOINT); + + final FakeClientSettings.Builder settingsBuilder = new FakeClientSettings.Builder(); + + settingsBuilder + .setTransportChannelProvider(transportProvider) + .setCredentialsProvider(NoCredentialsProvider.create()) + .setQuotaProjectId(QUOTA_PROJECT_ID); + + assertThat(ClientContext.create(settingsBuilder.build()).getCredentials()).isNull(); + } + + @Test + void testUserAgentInternalOnly() throws Exception { TransportChannelProvider transportChannelProvider = new FakeTransportProvider( - FakeTransportChannel.create(new FakeChannel()), null, true, null, null); + FakeTransportChannel.create(new FakeChannel()), + null, + true, + null, + null, + DEFAULT_ENDPOINT, + DEFAULT_MTLS_ENDPOINT); ClientSettings.Builder builder = new FakeClientSettings.Builder() @@ -557,10 +663,16 @@ public void testUserAgentInternalOnly() throws Exception { } @Test - public void testUserAgentExternalOnly() throws Exception { + void testUserAgentExternalOnly() throws Exception { TransportChannelProvider transportChannelProvider = new FakeTransportProvider( - FakeTransportChannel.create(new FakeChannel()), null, true, null, null); + FakeTransportChannel.create(new FakeChannel()), + null, + true, + null, + null, + DEFAULT_ENDPOINT, + DEFAULT_MTLS_ENDPOINT); ClientSettings.Builder builder = new FakeClientSettings.Builder() @@ -580,10 +692,16 @@ public void testUserAgentExternalOnly() throws Exception { } @Test - public void testUserAgentConcat() throws Exception { + void testUserAgentConcat() throws Exception { TransportChannelProvider transportChannelProvider = new FakeTransportProvider( - FakeTransportChannel.create(new FakeChannel()), null, true, null, null); + FakeTransportChannel.create(new FakeChannel()), + null, + true, + null, + null, + DEFAULT_ENDPOINT, + DEFAULT_MTLS_ENDPOINT); ClientSettings.Builder builder = new FakeClientSettings.Builder() @@ -604,125 +722,122 @@ public void testUserAgentConcat() throws Exception { .containsEntry("user-agent", "user-supplied-agent internal-agent"); } - private static String endpoint = "https://foo.googleapis.com"; - private static String mtlsEndpoint = "https://foo.mtls.googleapis.com"; - @Test - public void testAutoUseMtlsEndpoint() throws IOException { - // Test the case client certificate exists and mTLS endpoint is selected. - boolean switchToMtlsEndpointAllowed = true; - MtlsProvider provider = - new FakeMtlsProvider( - true, - MtlsEndpointUsagePolicy.AUTO, - FakeMtlsProvider.createTestMtlsKeyStore(), - "", - false); - String endpointSelected = - ClientContext.getEndpoint(endpoint, mtlsEndpoint, switchToMtlsEndpointAllowed, provider); - assertEquals(mtlsEndpoint, endpointSelected); - } - - @Test - public void testEndpointNotOverridable() throws IOException { - // Test the case that switching to mTLS endpoint is not allowed so the original endpoint is - // selected. - boolean switchToMtlsEndpointAllowed = false; - MtlsProvider provider = - new FakeMtlsProvider( - true, - MtlsEndpointUsagePolicy.AUTO, - FakeMtlsProvider.createTestMtlsKeyStore(), - "", - false); - String endpointSelected = - ClientContext.getEndpoint(endpoint, mtlsEndpoint, switchToMtlsEndpointAllowed, provider); - assertEquals(endpoint, endpointSelected); + void testApiClientHeaderAppendsCredType() throws Exception { + GoogleCredentials googleCredentials = Mockito.mock(GoogleCredentials.class); + when(googleCredentials.getMetricsCredentialType()) + .thenReturn(CredentialTypeForMetrics.USER_CREDENTIALS); + + Map headers = + setupTestForCredentialTokenUsageMetricsAndGetTransportChannelHeaders( + FixedCredentialsProvider.create(googleCredentials), + FixedHeaderProvider.create("x-goog-api-client", "internal-agent")); + + assertThat(headers).containsEntry("x-goog-api-client", "internal-agent cred-type/u"); } @Test - public void testNoClientCertificate() throws IOException { - // Test the case that client certificates doesn't exists so the original endpoint is selected. - boolean switchToMtlsEndpointAllowed = true; - MtlsProvider provider = - new FakeMtlsProvider(true, MtlsEndpointUsagePolicy.AUTO, null, "", false); - String endpointSelected = - ClientContext.getEndpoint(endpoint, mtlsEndpoint, switchToMtlsEndpointAllowed, provider); - assertEquals(endpoint, endpointSelected); + void testApiClientHeaderDoNotAppendsCredType_whenNoApiClientHeader() throws Exception { + GoogleCredentials googleCredentials = Mockito.mock(GoogleCredentials.class); + when(googleCredentials.getMetricsCredentialType()) + .thenReturn(CredentialTypeForMetrics.USER_CREDENTIALS); + + Map headers = + setupTestForCredentialTokenUsageMetricsAndGetTransportChannelHeaders( + FixedCredentialsProvider.create(googleCredentials), + FixedHeaderProvider.create("some-other-header", "internal-agent")); + + assertThat(headers).doesNotContainKey("x-goog-api-client"); + assertThat(headers).containsEntry("some-other-header", "internal-agent"); } @Test - public void testAlwaysUseMtlsEndpoint() throws IOException { - // Test the case that mTLS endpoint is always used. - boolean switchToMtlsEndpointAllowed = true; - MtlsProvider provider = - new FakeMtlsProvider(false, MtlsEndpointUsagePolicy.ALWAYS, null, "", false); - String endpointSelected = - ClientContext.getEndpoint(endpoint, mtlsEndpoint, switchToMtlsEndpointAllowed, provider); - assertEquals(mtlsEndpoint, endpointSelected); + void testApiClientHeaderDoNotAppendsCredType_whenNullCredentials() throws IOException { + Map headers = + setupTestForCredentialTokenUsageMetricsAndGetTransportChannelHeaders( + NoCredentialsProvider.create(), + FixedHeaderProvider.create("x-goog-api-client", "internal-agent")); + + assertThat(headers).containsKey("x-goog-api-client"); + assertThat(headers.get("x-goog-api-client")).doesNotContain("cred-type/"); } @Test - public void testNeverUseMtlsEndpoint() throws IOException { - // Test the case that mTLS endpoint is never used. - boolean switchToMtlsEndpointAllowed = true; - MtlsProvider provider = - new FakeMtlsProvider( + void testApiClientHeaderDoNotAppendsCredType_whenCredTypeDoNotSend() throws Exception { + GoogleCredentials googleCredentials = Mockito.mock(GoogleCredentials.class); + when(googleCredentials.getMetricsCredentialType()) + .thenReturn(CredentialTypeForMetrics.DO_NOT_SEND); + + Map headers = + setupTestForCredentialTokenUsageMetricsAndGetTransportChannelHeaders( + FixedCredentialsProvider.create(googleCredentials), + FixedHeaderProvider.create("x-goog-api-client", "internal-agent")); + + assertThat(headers).containsKey("x-goog-api-client"); + assertThat(headers.get("x-goog-api-client")).doesNotContain("cred-type/"); + } + + private Map setupTestForCredentialTokenUsageMetricsAndGetTransportChannelHeaders( + CredentialsProvider credentialsProvider, HeaderProvider headerProvider) throws IOException { + TransportChannelProvider transportChannelProvider = + new FakeTransportProvider( + FakeTransportChannel.create(new FakeChannel()), + null, true, - MtlsEndpointUsagePolicy.NEVER, - FakeMtlsProvider.createTestMtlsKeyStore(), - "", - false); - String endpointSelected = - ClientContext.getEndpoint(endpoint, mtlsEndpoint, switchToMtlsEndpointAllowed, provider); - assertEquals(endpoint, endpointSelected); - } - - @Test - public void testGetKeyStoreThrows() throws IOException { - // Test the case that getKeyStore throws exceptions. - try { - boolean switchToMtlsEndpointAllowed = true; - MtlsProvider provider = - new FakeMtlsProvider(true, MtlsEndpointUsagePolicy.AUTO, null, "", true); - ClientContext.getEndpoint(endpoint, mtlsEndpoint, switchToMtlsEndpointAllowed, provider); - fail("should throw an exception"); - } catch (IOException e) { - assertTrue( - "expected getKeyStore to throw an exception", - e.getMessage().contains("getKeyStore throws exception")); - } + null, + null, + DEFAULT_ENDPOINT, + DEFAULT_MTLS_ENDPOINT); + + ClientSettings.Builder builder = + new FakeClientSettings.Builder() + .setExecutorProvider( + FixedExecutorProvider.create(Mockito.mock(ScheduledExecutorService.class))) + .setTransportChannelProvider(transportChannelProvider) + .setCredentialsProvider(credentialsProvider) + .setInternalHeaderProvider(headerProvider); + + ClientContext clientContext = ClientContext.create(builder.build()); + FakeTransportChannel transportChannel = + (FakeTransportChannel) clientContext.getTransportChannel(); + return transportChannel.getHeaders(); } @Test - public void testSwitchToMtlsEndpointAllowed() throws IOException { - StubSettings settings = new FakeStubSettings.Builder().setEndpoint(endpoint).build(); + void testSwitchToMtlsEndpointAllowed() throws IOException { + StubSettings settings = new FakeStubSettings.Builder().setEndpoint(DEFAULT_ENDPOINT).build(); assertFalse(settings.getSwitchToMtlsEndpointAllowed()); - assertEquals(endpoint, settings.getEndpoint()); + assertEquals(DEFAULT_ENDPOINT, settings.getEndpoint()); settings = new FakeStubSettings.Builder() - .setEndpoint(endpoint) + .setEndpoint(DEFAULT_ENDPOINT) .setSwitchToMtlsEndpointAllowed(true) .build(); assertTrue(settings.getSwitchToMtlsEndpointAllowed()); - assertEquals(endpoint, settings.getEndpoint()); + assertEquals(DEFAULT_ENDPOINT, settings.getEndpoint()); // Test setEndpoint sets the switchToMtlsEndpointAllowed value to false. settings = new FakeStubSettings.Builder() .setSwitchToMtlsEndpointAllowed(true) - .setEndpoint(endpoint) + .setEndpoint(DEFAULT_ENDPOINT) .build(); assertFalse(settings.getSwitchToMtlsEndpointAllowed()); - assertEquals(endpoint, settings.getEndpoint()); + assertEquals(DEFAULT_ENDPOINT, settings.getEndpoint()); } @Test - public void testExecutorSettings() throws Exception { + void testExecutorSettings() throws Exception { TransportChannelProvider transportChannelProvider = new FakeTransportProvider( - FakeTransportChannel.create(new FakeChannel()), null, true, null, null); + FakeTransportChannel.create(new FakeChannel()), + null, + true, + null, + null, + DEFAULT_ENDPOINT, + DEFAULT_MTLS_ENDPOINT); ClientSettings.Builder builder = new FakeClientSettings.Builder() @@ -764,9 +879,432 @@ public void testExecutorSettings() throws Exception { builder.setExecutorProvider(executorProvider); builder.setTransportChannelProvider( new FakeTransportProvider( - FakeTransportChannel.create(new FakeChannel()), null, true, null, null)); + FakeTransportChannel.create(new FakeChannel()), + null, + true, + null, + null, + DEFAULT_ENDPOINT, + DEFAULT_MTLS_ENDPOINT)); context = ClientContext.create(builder.build()); transportChannel = (FakeTransportChannel) context.getTransportChannel(); assertThat(transportChannel.getExecutor()).isSameInstanceAs(executorProvider.getExecutor()); } + + private GdchCredentials getMockGdchCredentials() throws IOException { + GdchCredentials creds = Mockito.mock(GdchCredentials.class); + + // GdchCredentials builder is mocked to accept a well-formed uri + GdchCredentials.Builder gdchCredsBuilder = Mockito.mock(GdchCredentials.Builder.class); + Mockito.when(gdchCredsBuilder.setGdchAudience(Mockito.any(URI.class))) + .thenReturn(gdchCredsBuilder); + Mockito.when(gdchCredsBuilder.build()).thenReturn(creds); + Mockito.when(creds.toBuilder()).thenReturn(gdchCredsBuilder); + Mockito.when(creds.createWithGdchAudience(Mockito.any())) + .thenAnswer((uri) -> getMockGdchCredentials()); + return creds; + } + + private TransportChannelProvider getFakeTransportChannelProvider() { + return new FakeTransportProvider( + FakeTransportChannel.create(new FakeChannel()), + null, + true, + null, + null, + DEFAULT_ENDPOINT, + DEFAULT_MTLS_ENDPOINT); + } + + // EndpointContext will construct a valid endpoint if nothing is provided + @Test + void testCreateClientContext_withGdchCredentialNoAudienceNoEndpoint() throws IOException { + TransportChannelProvider transportChannelProvider = + new FakeTransportProvider( + FakeTransportChannel.create(new FakeChannel()), null, true, null, null, null, null); + Credentials creds = getMockGdchCredentials(); + + CredentialsProvider provider = FixedCredentialsProvider.create(creds); + StubSettings settings = new FakeStubSettings.Builder().setGdchApiAudience(null).build(); + FakeClientSettings.Builder clientSettingsBuilder = new FakeClientSettings.Builder(settings); + clientSettingsBuilder.setCredentialsProvider(provider); + clientSettingsBuilder.setTransportChannelProvider(transportChannelProvider); + + ClientContext context = ClientContext.create(clientSettingsBuilder.build()); + + Credentials fromContext = context.getCredentials(); + Credentials fromProvider = provider.getCredentials(); + assertNotNull(fromProvider); + assertNotNull(fromContext); + assertThat(fromContext).isInstanceOf(GdchCredentials.class); + assertThat(fromProvider).isInstanceOf(GdchCredentials.class); + assertNotSame(fromContext, fromProvider); + verify((GdchCredentials) fromProvider, times(1)) + .createWithGdchAudience(URI.create("test.googleapis.com:443")); + } + + @Test + void testCreateClientContext_withGdchCredentialNoAudienceEmptyEndpoint_throws() + throws IOException { + TransportChannelProvider transportChannelProvider = + new FakeTransportProvider( + FakeTransportChannel.create(new FakeChannel()), null, true, null, null, null, null); + Credentials creds = getMockGdchCredentials(); + + CredentialsProvider provider = FixedCredentialsProvider.create(creds); + StubSettings settings = + new FakeStubSettings.Builder().setGdchApiAudience(null).setEndpoint("").build(); + FakeClientSettings.Builder clientSettingsBuilder = new FakeClientSettings.Builder(settings); + clientSettingsBuilder.setCredentialsProvider(provider); + clientSettingsBuilder.setTransportChannelProvider(transportChannelProvider); + + // should throw + IllegalArgumentException ex = + assertThrows( + IllegalArgumentException.class, + () -> ClientContext.create(clientSettingsBuilder.build())); + assertEquals("Could not infer GDCH api audience from settings", ex.getMessage()); + } + + @Test + void testCreateClientContext_withGdchCredentialWithoutAudienceWithEndpoint_correct() + throws IOException { + TransportChannelProvider transportChannelProvider = + new FakeTransportProvider( + FakeTransportChannel.create(new FakeChannel()), null, true, null, null, null, null); + Credentials creds = getMockGdchCredentials(); + + // it should correctly create a client context with gdch creds and null audience + CredentialsProvider provider = FixedCredentialsProvider.create(creds); + StubSettings settings = + new FakeStubSettings.Builder() + .setGdchApiAudience(null) + .setEndpoint("test-endpoint") + .build(); + FakeClientSettings.Builder clientSettingsBuilder = new FakeClientSettings.Builder(settings); + clientSettingsBuilder.setCredentialsProvider(provider); + clientSettingsBuilder.setTransportChannelProvider(transportChannelProvider); + + // should not throw + ClientContext context = ClientContext.create(clientSettingsBuilder.build()); + + Credentials fromContext = context.getCredentials(); + Credentials fromProvider = provider.getCredentials(); + assertNotNull(fromProvider); + assertNotNull(fromContext); + assertThat(fromContext).isInstanceOf(GdchCredentials.class); + assertThat(fromProvider).isInstanceOf(GdchCredentials.class); + assertNotSame(fromContext, fromProvider); + verify((GdchCredentials) fromProvider, times(1)) + .createWithGdchAudience(URI.create("test-endpoint")); + } + + @Test + void testCreateClientContext_withGdchCredentialAndValidAudience() throws IOException { + Credentials creds = getMockGdchCredentials(); + CredentialsProvider provider = FixedCredentialsProvider.create(creds); + TransportChannelProvider transportChannelProvider = getFakeTransportChannelProvider(); + + // it should throw if both apiAudience and GDC-H creds are set but apiAudience is not a valid + // uri + StubSettings settings = + new FakeStubSettings.Builder() + .setEndpoint("test-endpoint") + .setGdchApiAudience("valid-uri") + .build(); + ClientSettings.Builder clientSettingsBuilder = new FakeClientSettings.Builder(settings); + clientSettingsBuilder.setCredentialsProvider(provider); + clientSettingsBuilder.setTransportChannelProvider(transportChannelProvider); + ClientContext context = ClientContext.create(clientSettingsBuilder.build()); + Credentials fromContext = context.getCredentials(); + Credentials fromProvider = provider.getCredentials(); + assertNotNull(fromProvider); + assertNotNull(fromContext); + // using an audience should have made the context to recreate the credentials + assertNotSame(fromContext, fromProvider); + verify((GdchCredentials) fromProvider, times(1)) + .createWithGdchAudience(URI.create("valid-uri")); + verify((GdchCredentials) fromProvider, times(0)) + .createWithGdchAudience(URI.create("test-endpoint")); + } + + @Test + void testCreateClientContext_withGdchCredentialAndInvalidAudience_throws() throws IOException { + TransportChannelProvider transportChannelProvider = getFakeTransportChannelProvider(); + Credentials creds = getMockGdchCredentials(); + CredentialsProvider provider = FixedCredentialsProvider.create(creds); + + // it should throw if both apiAudience and GDC-H creds are set but apiAudience is not a valid + // uri + StubSettings settings = + new FakeStubSettings.Builder() + .setGdchApiAudience("$invalid-uri:") + .setEndpoint("test-endpoint") + .build(); + ClientSettings.Builder clientSettingsBuilder = new FakeClientSettings.Builder(settings); + clientSettingsBuilder.setCredentialsProvider(provider); + clientSettingsBuilder.setTransportChannelProvider(transportChannelProvider); + final ClientSettings withGdchCredentialsAndMalformedApiAudience = clientSettingsBuilder.build(); + // should throw + String exMessage = + assertThrows( + IllegalArgumentException.class, + () -> ClientContext.create(withGdchCredentialsAndMalformedApiAudience)) + .getMessage(); + assertThat(exMessage).contains("The GDC-H API audience string is not a valid URI"); + + Credentials fromProvider = provider.getCredentials(); + verify((GdchCredentials) fromProvider, times(0)) + .createWithGdchAudience(URI.create("test-endpoint")); + } + + @Test + void testCreateClientContext_withNonGdchCredentialAndAnyAudience_throws() throws IOException { + TransportChannelProvider transportChannelProvider = getFakeTransportChannelProvider(); + + // it should throw if apiAudience is set but not using GDC-H creds + StubSettings settings = + new FakeStubSettings.Builder().setGdchApiAudience("audience:test").build(); + Credentials creds = Mockito.mock(ComputeEngineCredentials.class); + CredentialsProvider provider = FixedCredentialsProvider.create(creds); + ClientSettings.Builder clientSettingsBuilder = new FakeClientSettings.Builder(settings); + clientSettingsBuilder.setCredentialsProvider(provider); + clientSettingsBuilder.setTransportChannelProvider(transportChannelProvider); + final ClientSettings withComputeCredentials = clientSettingsBuilder.build(); + // should throw + String exMessage = + assertThrows( + IllegalArgumentException.class, () -> ClientContext.create(withComputeCredentials)) + .getMessage(); + assertThat(exMessage).contains("GDC-H API audience can only be set when using GdchCredentials"); + } + + @Test + void testCreateClientContext_SetEndpointViaClientSettings() throws IOException { + TransportChannelProvider transportChannelProvider = + new FakeTransportProvider( + FakeTransportChannel.create(new FakeChannel()), null, true, null, null, null, null); + StubSettings settings = + new FakeStubSettings.Builder() + .setEndpoint(DEFAULT_ENDPOINT) + .setUniverseDomain(DEFAULT_UNIVERSE_DOMAIN) + .build(); + ClientSettings.Builder clientSettingsBuilder = new FakeClientSettings.Builder(settings); + clientSettingsBuilder.setTransportChannelProvider(transportChannelProvider); + clientSettingsBuilder.setCredentialsProvider( + FixedCredentialsProvider.create(Mockito.mock(Credentials.class))); + ClientSettings clientSettings = clientSettingsBuilder.build(); + ClientContext clientContext = ClientContext.create(clientSettings); + assertThat(clientContext.getEndpoint()).isEqualTo(DEFAULT_ENDPOINT); + assertThat(clientContext.getUniverseDomain()).isEqualTo(DEFAULT_UNIVERSE_DOMAIN); + } + + @Test + void testCreateClientContext_SetEndpointViaTransportChannelProvider() throws IOException { + String transportChannelProviderEndpoint = "transport.endpoint.com"; + TransportChannelProvider transportChannelProvider = + new FakeTransportProvider( + FakeTransportChannel.create(new FakeChannel()), + null, + true, + null, + null, + transportChannelProviderEndpoint, + DEFAULT_MTLS_ENDPOINT); + StubSettings settings = + new FakeStubSettings.Builder() + .setEndpoint(null) + .setUniverseDomain(DEFAULT_UNIVERSE_DOMAIN) + .build(); + ClientSettings.Builder clientSettingsBuilder = new FakeClientSettings.Builder(settings); + clientSettingsBuilder.setTransportChannelProvider(transportChannelProvider); + clientSettingsBuilder.setCredentialsProvider( + FixedCredentialsProvider.create(Mockito.mock(Credentials.class))); + ClientSettings clientSettings = clientSettingsBuilder.build(); + ClientContext clientContext = ClientContext.create(clientSettings); + assertThat(clientContext.getEndpoint()).isEqualTo(transportChannelProviderEndpoint); + assertThat(clientContext.getUniverseDomain()).isEqualTo(DEFAULT_UNIVERSE_DOMAIN); + } + + @Test + void testCreateClientContext_SetEndpointViaClientSettingsAndTransportChannelProvider() + throws IOException { + String clientSettingsEndpoint = "clientSettingsEndpoint.com"; + String transportChannelProviderEndpoint = "transportChannelProviderEndpoint.com"; + TransportChannelProvider transportChannelProvider = + new FakeTransportProvider( + FakeTransportChannel.create(new FakeChannel()), + null, + true, + null, + null, + transportChannelProviderEndpoint, + DEFAULT_MTLS_ENDPOINT); + StubSettings settings = + new FakeStubSettings.Builder() + .setEndpoint(clientSettingsEndpoint) + .setUniverseDomain(DEFAULT_UNIVERSE_DOMAIN) + .build(); + ClientSettings.Builder clientSettingsBuilder = new FakeClientSettings.Builder(settings); + clientSettingsBuilder.setTransportChannelProvider(transportChannelProvider); + clientSettingsBuilder.setCredentialsProvider( + FixedCredentialsProvider.create(Mockito.mock(Credentials.class))); + ClientSettings clientSettings = clientSettingsBuilder.build(); + ClientContext clientContext = ClientContext.create(clientSettings); + // ClientContext.getEndpoint() is the resolved endpoint. If both the client settings + // and transport channel provider's endpoints are set, the resolved endpoint will be + // the transport channel provider's endpoint. + assertThat(clientContext.getEndpoint()).isEqualTo(transportChannelProviderEndpoint); + assertThat(clientContext.getUniverseDomain()).isEqualTo(DEFAULT_UNIVERSE_DOMAIN); + } + + @Test + void testCreateClientContext_doNotSetUniverseDomain() throws IOException { + TransportChannelProvider transportChannelProvider = + new FakeTransportProvider( + FakeTransportChannel.create(new FakeChannel()), null, true, null, null, null, null); + StubSettings settings = + new FakeStubSettings.Builder() + .setEndpoint(null) + .setUniverseDomain(DEFAULT_UNIVERSE_DOMAIN) + .build(); + ClientSettings.Builder clientSettingsBuilder = new FakeClientSettings.Builder(settings); + clientSettingsBuilder.setTransportChannelProvider(transportChannelProvider); + clientSettingsBuilder.setCredentialsProvider( + FixedCredentialsProvider.create(Mockito.mock(Credentials.class))); + ClientSettings clientSettings = clientSettingsBuilder.build(); + ClientContext clientContext = ClientContext.create(clientSettings); + assertThat(clientContext.getUniverseDomain()).isEqualTo(DEFAULT_UNIVERSE_DOMAIN); + } + + @Test + void testCreateClientContext_setUniverseDomain() throws IOException { + TransportChannelProvider transportChannelProvider = + new FakeTransportProvider( + FakeTransportChannel.create(new FakeChannel()), null, true, null, null, null, null); + String universeDomain = "testdomain.com"; + StubSettings settings = + new FakeStubSettings.Builder().setEndpoint(null).setUniverseDomain(universeDomain).build(); + ClientSettings.Builder clientSettingsBuilder = new FakeClientSettings.Builder(settings); + clientSettingsBuilder.setTransportChannelProvider(transportChannelProvider); + clientSettingsBuilder.setCredentialsProvider( + FixedCredentialsProvider.create(Mockito.mock(Credentials.class))); + ClientSettings clientSettings = clientSettingsBuilder.build(); + ClientContext clientContext = ClientContext.create(clientSettings); + assertThat(clientContext.getUniverseDomain()).isEqualTo(universeDomain); + } + + @Test + public void testStreamWatchdogInterval_backportMethodsBehaveCorrectly() { + final ClientContext.Builder builder = + ClientContext.newBuilder().setDefaultCallContext(FakeCallContext.createDefault()); + testDurationMethod( + 123L, + jt -> builder.setStreamWatchdogCheckIntervalDuration(jt).build(), + tt -> builder.setStreamWatchdogCheckInterval(tt).build(), + ct -> ct.getStreamWatchdogCheckIntervalDuration(), + ct -> ct.getStreamWatchdogCheckInterval()); + } + + @Test + void testSetApiKey_createsApiCredentials() throws IOException { + String apiKey = "key"; + FakeStubSettings.Builder builder = new FakeStubSettings.Builder(); + InterceptingExecutor executor = new InterceptingExecutor(1); + FakeTransportChannel transportChannel = FakeTransportChannel.create(new FakeChannel()); + FakeTransportProvider transportProvider = + new FakeTransportProvider( + transportChannel, + executor, + true, + ImmutableMap.of(), + null, + DEFAULT_ENDPOINT, + DEFAULT_MTLS_ENDPOINT); + builder.setTransportChannelProvider(transportProvider); + HeaderProvider headerProvider = Mockito.mock(HeaderProvider.class); + Mockito.when(headerProvider.getHeaders()).thenReturn(ImmutableMap.of()); + builder.setHeaderProvider(headerProvider); + builder.setApiKey(apiKey); + + ClientContext context = ClientContext.create(builder.build()); + + FakeCallContext fakeCallContext = (FakeCallContext) context.getDefaultCallContext(); + assertThat(fakeCallContext.getCredentials()).isInstanceOf(ApiKeyCredentials.class); + } + + @Test + void testSetApiKey_withDefaultCredentials_overridesCredentials() throws IOException { + String apiKey = "key"; + FakeStubSettings.Builder builder = FakeStubSettings.newBuilder(); + InterceptingExecutor executor = new InterceptingExecutor(1); + FakeTransportChannel transportChannel = FakeTransportChannel.create(new FakeChannel()); + FakeTransportProvider transportProvider = + new FakeTransportProvider( + transportChannel, + executor, + true, + ImmutableMap.of(), + null, + DEFAULT_ENDPOINT, + DEFAULT_MTLS_ENDPOINT); + builder.setTransportChannelProvider(transportProvider); + HeaderProvider headerProvider = Mockito.mock(HeaderProvider.class); + Mockito.when(headerProvider.getHeaders()).thenReturn(ImmutableMap.of()); + builder.setHeaderProvider(headerProvider); + builder.setApiKey(apiKey); + + ClientContext context = ClientContext.create(builder.build()); + + FakeCallContext fakeCallContext = (FakeCallContext) context.getDefaultCallContext(); + assertThat(fakeCallContext.getCredentials()).isInstanceOf(ApiKeyCredentials.class); + } + + // This test case is added to cover a special case with BigTable. BigTable's EnhancedStubSettings + // wrappers do not directly inherit from the generated StubSettings. The wrappers must directly + // set the endpoint values since they are set in the generated StubSettings. This test case mimics + // the old behavior where BigTable doesn't set an mtlsEndpoint value. + @Test + void test_nullMtlsEndpointIsNotPassedToTransportChannel() throws IOException { + // Set the mtlsEndpoint in the TransportChannelProvider as null. This configures the + // ClientContext to attempt to pass the mtlsEndpoint over. + TransportChannelProvider transportChannelProvider = + new FakeTransportProvider( + FakeTransportChannel.create(new FakeChannel()), null, true, null, null, null, null); + // TransportChannelProvider would try to get the resolved mtlsEndpoint + Truth.assertThat(transportChannelProvider.needsMtlsEndpoint()).isTrue(); + + StubSettings settings = + new FakeStubSettings.Builder() + .setEndpoint(DEFAULT_ENDPOINT) + // Set this to be null so that the resolved mtls endpoint is null + // This resolved value should not be passed to the TransportChannelProvider + .setMtlsEndpoint(null) + .build(); + ClientSettings.Builder clientSettingsBuilder = new FakeClientSettings.Builder(settings); + clientSettingsBuilder.setTransportChannelProvider(transportChannelProvider); + ClientSettings clientSettings = clientSettingsBuilder.build(); + + // This call should not result in an exception being thrown as a null resolved mtlsEndpoint + // is not passed to the TransportChannelProvider + ClientContext.create(clientSettings); + } + + @Test + void testCreate_withTracerFactoryReturningNullWithContext() throws IOException { + FakeStubSettings.Builder builder = FakeStubSettings.newBuilder(); + builder.setTransportChannelProvider(getFakeTransportChannelProvider()); + builder.setCredentialsProvider( + FixedCredentialsProvider.create(Mockito.mock(Credentials.class))); + + ApiTracerFactory apiTracerFactory = Mockito.mock(SpanTracerFactory.class); + Mockito.doReturn(apiTracerFactory).when(apiTracerFactory).withContext(Mockito.any()); + + FakeStubSettings settings = Mockito.spy(builder.build()); + Mockito.doReturn(apiTracerFactory).when(settings).getTracerFactory(); + + ClientContext context = ClientContext.create(settings); + assertThat(context.getTracerFactory()).isSameInstanceAs(apiTracerFactory); + verify(apiTracerFactory, times(1)).withContext(Mockito.any()); + } } diff --git a/gax-java/gax/src/test/java/com/google/api/gax/rpc/ClientSettingsTest.java b/gax-java/gax/src/test/java/com/google/api/gax/rpc/ClientSettingsTest.java index b39d59cbd5..394d893b48 100644 --- a/gax-java/gax/src/test/java/com/google/api/gax/rpc/ClientSettingsTest.java +++ b/gax-java/gax/src/test/java/com/google/api/gax/rpc/ClientSettingsTest.java @@ -29,10 +29,10 @@ */ package com.google.api.gax.rpc; -import static org.junit.Assert.fail; +import static com.google.api.gax.util.TimeConversionTestUtils.testDurationMethod; +import static org.junit.jupiter.api.Assertions.fail; import com.google.api.core.ApiClock; -import com.google.api.core.ApiFunction; import com.google.api.core.NanoClock; import com.google.api.gax.core.CredentialsProvider; import com.google.api.gax.core.ExecutorProvider; @@ -44,6 +44,7 @@ import com.google.api.gax.rpc.testing.FakeClientSettings; import com.google.auth.Credentials; import com.google.auth.oauth2.GoogleCredentials; +import com.google.auth.oauth2.ServiceAccountCredentials; import com.google.common.collect.ImmutableMap; import com.google.common.truth.Truth; import java.io.ByteArrayInputStream; @@ -54,14 +55,12 @@ import java.util.List; import java.util.Map; import java.util.concurrent.ScheduledExecutorService; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.junit.runners.JUnit4; +import java.util.function.Function; +import java.util.function.Supplier; +import org.junit.jupiter.api.Test; import org.mockito.Mockito; -import org.threeten.bp.Duration; -@RunWith(JUnit4.class) -public class ClientSettingsTest { +class ClientSettingsTest { private static final String QUOTA_PROJECT_ID_KEY = "x-goog-user-project"; private static final String QUOTA_PROJECT_ID_FROM_HEADER_VALUE = "quota_project_id_from_headers"; private static final String QUOTA_PROJECT_ID_FROM_BUILDERS = "quota_project_id_from_builders"; @@ -71,7 +70,7 @@ public class ClientSettingsTest { "quota_project_id_from_credentials"; private static final String QUOTA_PROJECT_ID_FROM_CONTEXT = "quota_project_id_from_client_context"; - private static final String JSON_KEY_QUOTA_PROJECT_ID = + private static final String SA_JSON_KEY_QUOTA_PROJECT_ID = "{\n" + " \"private_key_id\": \"somekeyid\",\n" + " \"private_key\": \"-----BEGIN PRIVATE KEY-----\\nMIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggS" @@ -104,10 +103,10 @@ public class ClientSettingsTest { + "}"; private static final GoogleCredentials credentialsWithQuotaProject = - loadCredentials(JSON_KEY_QUOTA_PROJECT_ID); + loadServiceAccountCredentials(SA_JSON_KEY_QUOTA_PROJECT_ID); @Test - public void testEmptyBuilder() throws Exception { + void testEmptyBuilder() throws Exception { FakeClientSettings.Builder builder = new FakeClientSettings.Builder(); Truth.assertThat(builder.getExecutorProvider()).isNull(); Truth.assertThat(builder.getBackgroundExecutorProvider()) @@ -119,8 +118,10 @@ public void testEmptyBuilder() throws Exception { Truth.assertThat(builder.getInternalHeaderProvider()).isInstanceOf(NoHeaderProvider.class); Truth.assertThat(builder.getWatchdogProvider()) .isInstanceOf(InstantiatingWatchdogProvider.class); - Truth.assertThat(builder.getWatchdogCheckInterval()).isGreaterThan(Duration.ZERO); + Truth.assertThat(builder.getWatchdogCheckIntervalDuration()) + .isGreaterThan(java.time.Duration.ZERO); Truth.assertThat(builder.getQuotaProjectId()).isNull(); + Truth.assertThat(builder.getApiKey()).isNull(); FakeClientSettings settings = builder.build(); Truth.assertThat(settings.getExecutorProvider()) @@ -137,7 +138,8 @@ public void testEmptyBuilder() throws Exception { .isSameInstanceAs(builder.getInternalHeaderProvider()); Truth.assertThat(settings.getWatchdogProvider()) .isInstanceOf(InstantiatingWatchdogProvider.class); - Truth.assertThat(settings.getWatchdogCheckInterval()).isGreaterThan(Duration.ZERO); + Truth.assertThat(settings.getWatchdogCheckIntervalDuration()) + .isGreaterThan(java.time.Duration.ZERO); Truth.assertThat((settings.getQuotaProjectId())).isSameInstanceAs(builder.getQuotaProjectId()); String settingsString = settings.toString(); @@ -150,10 +152,11 @@ public void testEmptyBuilder() throws Exception { Truth.assertThat(settingsString).contains("watchdogProvider"); Truth.assertThat(settingsString).contains("watchdogCheckInterval"); Truth.assertThat(settingsString).contains(("quotaProjectId")); + Truth.assertThat(settingsString).contains(("apiKey")); } @Test - public void testBuilder() throws Exception { + void testBuilder() throws Exception { FakeClientSettings.Builder builder = new FakeClientSettings.Builder(); ExecutorProvider executorProvider = Mockito.mock(ExecutorProvider.class); @@ -163,8 +166,9 @@ public void testBuilder() throws Exception { HeaderProvider headerProvider = Mockito.mock(HeaderProvider.class); HeaderProvider internalHeaderProvider = Mockito.mock(HeaderProvider.class); WatchdogProvider watchdogProvider = Mockito.mock(WatchdogProvider.class); - Duration watchdogCheckInterval = Duration.ofSeconds(13); + java.time.Duration watchdogCheckInterval = java.time.Duration.ofSeconds(13); String quotaProjectId = "test_quota_project_id"; + String apiKey = "api_key"; builder.setExecutorProvider(executorProvider); builder.setTransportChannelProvider(transportProvider); @@ -173,8 +177,9 @@ public void testBuilder() throws Exception { builder.setInternalHeaderProvider(internalHeaderProvider); builder.setClock(clock); builder.setWatchdogProvider(watchdogProvider); - builder.setWatchdogCheckInterval(watchdogCheckInterval); + builder.setWatchdogCheckIntervalDuration(watchdogCheckInterval); builder.setQuotaProjectId(quotaProjectId); + builder.setApiKey(apiKey); // For backward compatibility, backgroundExecutorProvider is set to executorProvider Truth.assertThat(builder.getExecutorProvider()).isSameInstanceAs(executorProvider); @@ -185,8 +190,10 @@ public void testBuilder() throws Exception { Truth.assertThat(builder.getHeaderProvider()).isSameInstanceAs(headerProvider); Truth.assertThat(builder.getInternalHeaderProvider()).isSameInstanceAs(internalHeaderProvider); Truth.assertThat(builder.getWatchdogProvider()).isSameInstanceAs(watchdogProvider); - Truth.assertThat(builder.getWatchdogCheckInterval()).isSameInstanceAs(watchdogCheckInterval); + Truth.assertThat(builder.getWatchdogCheckIntervalDuration()) + .isSameInstanceAs(watchdogCheckInterval); Truth.assertThat(builder.getQuotaProjectId()).isEqualTo(quotaProjectId); + Truth.assertThat(builder.getApiKey()).isEqualTo(apiKey); String builderString = builder.toString(); Truth.assertThat(builderString).contains("executorProvider"); @@ -199,20 +206,23 @@ public void testBuilder() throws Exception { Truth.assertThat(builderString).contains("watchdogProvider"); Truth.assertThat(builderString).contains("watchdogCheckInterval"); Truth.assertThat(builderString).contains("quotaProjectId"); + Truth.assertThat(builderString).contains("apiKey"); } @Test - public void testBuilderFromClientContext() throws Exception { + void testBuilderFromClientContext() throws Exception { final String QUOTA_PROJECT_ID_FROM_CONTEXT = "some_quota_project_id_from_context"; ApiClock clock = Mockito.mock(ApiClock.class); - ApiCallContext callContext = FakeCallContext.createDefault(); + EndpointContext endpointContext = Mockito.mock(EndpointContext.class); + ApiCallContext callContext = + FakeCallContext.createDefault().withEndpointContext(endpointContext); Map headers = Collections.singletonMap("spiffykey", "spiffyvalue"); Watchdog watchdog = - Watchdog.create( + Watchdog.createDuration( Mockito.mock(ApiClock.class), - Duration.ZERO, + java.time.Duration.ZERO, Mockito.mock(ScheduledExecutorService.class)); - Duration watchdogCheckInterval = Duration.ofSeconds(12); + java.time.Duration watchdogCheckInterval = java.time.Duration.ofSeconds(12); ClientContext clientContext = ClientContext.newBuilder() @@ -223,7 +233,7 @@ public void testBuilderFromClientContext() throws Exception { .setDefaultCallContext(callContext) .setHeaders(headers) .setStreamWatchdog(watchdog) - .setStreamWatchdogCheckInterval(watchdogCheckInterval) + .setStreamWatchdogCheckIntervalDuration(watchdogCheckInterval) .setQuotaProjectId(QUOTA_PROJECT_ID_FROM_CONTEXT) .build(); @@ -242,12 +252,12 @@ public void testBuilderFromClientContext() throws Exception { .containsEntry("spiffykey", "spiffyvalue"); Truth.assertThat(builder.getWatchdogProvider()).isInstanceOf(FixedWatchdogProvider.class); Truth.assertThat(builder.getWatchdogProvider().getWatchdog()).isSameInstanceAs(watchdog); - Truth.assertThat(builder.getWatchdogCheckInterval()).isEqualTo(watchdogCheckInterval); + Truth.assertThat(builder.getWatchdogCheckIntervalDuration()).isEqualTo(watchdogCheckInterval); Truth.assertThat(builder.getQuotaProjectId()).isEqualTo(QUOTA_PROJECT_ID_FROM_CONTEXT); } @Test - public void testBuilderFromSettings() throws Exception { + void testBuilderFromSettings() throws Exception { FakeClientSettings.Builder builder = new FakeClientSettings.Builder(); ExecutorProvider executorProvider = Mockito.mock(ExecutorProvider.class); @@ -257,7 +267,7 @@ public void testBuilderFromSettings() throws Exception { HeaderProvider headerProvider = Mockito.mock(HeaderProvider.class); HeaderProvider internalHeaderProvider = Mockito.mock(HeaderProvider.class); WatchdogProvider watchdogProvider = Mockito.mock(WatchdogProvider.class); - Duration watchdogCheckInterval = Duration.ofSeconds(14); + java.time.Duration watchdogCheckInterval = java.time.Duration.ofSeconds(14); String quotaProjectId = "test_builder_from_settings_quotaProjectId"; builder.setExecutorProvider(executorProvider); @@ -267,7 +277,7 @@ public void testBuilderFromSettings() throws Exception { builder.setHeaderProvider(headerProvider); builder.setInternalHeaderProvider(internalHeaderProvider); builder.setWatchdogProvider(watchdogProvider); - builder.setWatchdogCheckInterval(watchdogCheckInterval); + builder.setWatchdogCheckIntervalDuration(watchdogCheckInterval); builder.setQuotaProjectId(quotaProjectId); FakeClientSettings settings = builder.build(); @@ -282,12 +292,13 @@ public void testBuilderFromSettings() throws Exception { Truth.assertThat(newBuilder.getInternalHeaderProvider()) .isSameInstanceAs(internalHeaderProvider); Truth.assertThat(newBuilder.getWatchdogProvider()).isSameInstanceAs(watchdogProvider); - Truth.assertThat(newBuilder.getWatchdogCheckInterval()).isEqualTo(watchdogCheckInterval); + Truth.assertThat(newBuilder.getWatchdogCheckIntervalDuration()) + .isEqualTo(watchdogCheckInterval); Truth.assertThat(newBuilder.getQuotaProjectId()).isEqualTo(quotaProjectId); } @Test - public void testApplyToAllUnaryMethods() throws Exception { + void testApplyToAllUnaryMethods() throws Exception { List> builders = new ArrayList<>(); builders.add(UnaryCallSettings.newUnaryCallSettingsBuilder()); builders.add(UnaryCallSettings.newUnaryCallSettingsBuilder()); @@ -295,17 +306,14 @@ public void testApplyToAllUnaryMethods() throws Exception { final int[] count = {0}; ClientSettings.Builder.applyToAllUnaryMethods( builders, - new ApiFunction, Void>() { - @Override - public Void apply(UnaryCallSettings.Builder input) { - if (count[0] == 0) { - input.setRetryableCodes(StatusCode.Code.UNAVAILABLE); - } else { - input.setRetryableCodes(StatusCode.Code.DEADLINE_EXCEEDED); - } - count[0] += 1; - return null; + input -> { + if (count[0] == 0) { + input.setRetryableCodes(StatusCode.Code.UNAVAILABLE); + } else { + input.setRetryableCodes(StatusCode.Code.DEADLINE_EXCEEDED); } + count[0] += 1; + return null; }); Truth.assertThat(builders.get(0).getRetryableCodes()) @@ -314,10 +322,10 @@ public Void apply(UnaryCallSettings.Builder input) { .containsExactly(StatusCode.Code.DEADLINE_EXCEEDED); } - static GoogleCredentials loadCredentials(String credentialFile) { + static GoogleCredentials loadServiceAccountCredentials(String serviceAccountCredentialFile) { try { - InputStream keyStream = new ByteArrayInputStream(credentialFile.getBytes()); - return GoogleCredentials.fromStream(keyStream); + InputStream keyStream = new ByteArrayInputStream(serviceAccountCredentialFile.getBytes()); + return ServiceAccountCredentials.fromStream(keyStream); } catch (IOException e) { fail("Couldn't create fake JSON credentials."); } @@ -325,7 +333,7 @@ static GoogleCredentials loadCredentials(String credentialFile) { } @Test - public void testBuilderFromSettings_QuotaProjectId() { + void testBuilderFromSettings_QuotaProjectId() { CredentialsProvider credentialsProvider_no_quota = Mockito.mock(CredentialsProvider.class); HeaderProvider headerProvider_no_quota = Mockito.mock(HeaderProvider.class); @@ -441,8 +449,10 @@ public Credentials getCredentials() throws IOException { } @Test - public void testBuilderFromClientContext_QuotaProjectId() { - ApiCallContext callContext = FakeCallContext.createDefault(); + void testBuilderFromClientContext_QuotaProjectId() { + EndpointContext endpointContext = Mockito.mock(EndpointContext.class); + ApiCallContext callContext = + FakeCallContext.createDefault().withEndpointContext(endpointContext); ClientContext clientContextQuotaOnly = ClientContext.newBuilder() @@ -542,4 +552,25 @@ public void testBuilderFromClientContext_QuotaProjectId() { Truth.assertThat(builderQuotaFromAllSources.getQuotaProjectId()) .isEqualTo(QUOTA_PROJECT_ID_FROM_CONTEXT); } + + @Test + public void testWatchdogCheckInterval_backportMethodsBehaveCorrectly() { + final ClientSettings.Builder builder = new FakeClientSettings.Builder(); + // this helper lambda goes around the possible IOException thrown by + // ClientSettings.Builder.build() + final Function, ClientSettings> createClientSettings = + fn -> { + try { + return fn.get().build(); + } catch (IOException e) { + throw new RuntimeException(e); + } + }; + testDurationMethod( + 123l, + jt -> createClientSettings.apply(() -> builder.setWatchdogCheckIntervalDuration(jt)), + tt -> createClientSettings.apply(() -> builder.setWatchdogCheckInterval(tt)), + cs -> cs.getWatchdogCheckIntervalDuration(), + cs -> cs.getWatchdogCheckInterval()); + } } diff --git a/gax-java/gax/src/test/java/com/google/api/gax/rpc/EndpointContextTest.java b/gax-java/gax/src/test/java/com/google/api/gax/rpc/EndpointContextTest.java new file mode 100644 index 0000000000..99a8f63fcf --- /dev/null +++ b/gax-java/gax/src/test/java/com/google/api/gax/rpc/EndpointContextTest.java @@ -0,0 +1,686 @@ +/* + * Copyright 2023 Google LLC + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Google LLC nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +package com.google.api.gax.rpc; + +import static org.junit.jupiter.api.Assertions.assertDoesNotThrow; +import static org.junit.jupiter.api.Assertions.assertThrows; + +import com.google.api.gax.core.NoCredentialsProvider; +import com.google.api.gax.rpc.internal.EnvironmentProvider; +import com.google.api.gax.rpc.mtls.CertificateBasedAccess; +import com.google.api.gax.rpc.testing.FakeMtlsProvider; +import com.google.auth.Credentials; +import com.google.auth.mtls.MtlsProvider; +import com.google.auth.oauth2.ComputeEngineCredentials; +import com.google.common.truth.Truth; +import io.grpc.Status; +import java.io.IOException; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.mockito.Mockito; + +class EndpointContextTest { + private static final String DEFAULT_ENDPOINT = "test.googleapis.com:443"; + private static final String DEFAULT_MTLS_ENDPOINT = "test.mtls.googleapis.com:443"; + private EndpointContext.Builder defaultEndpointContextBuilder; + private StatusCode statusCode; + + @BeforeEach + void setUp() throws IOException { + MtlsProvider mtlsProvider = + new FakeMtlsProvider(FakeMtlsProvider.createTestMtlsKeyStore(), "", false); + defaultEndpointContextBuilder = + EndpointContext.newBuilder() + .setServiceName("test") + .setUniverseDomain(Credentials.GOOGLE_DEFAULT_UNIVERSE) + .setClientSettingsEndpoint(DEFAULT_ENDPOINT) + .setMtlsEndpoint(DEFAULT_MTLS_ENDPOINT) + .setMtlsProvider(mtlsProvider); + statusCode = Mockito.mock(StatusCode.class); + Mockito.when(statusCode.getCode()).thenReturn(StatusCode.Code.UNAUTHENTICATED); + Mockito.when(statusCode.getTransportCode()).thenReturn(Status.Code.UNAUTHENTICATED); + } + + @Test + void mtlsEndpointResolver_switchToMtlsAllowedIsFalse() throws IOException { + boolean throwExceptionForGetKeyStore = false; + MtlsProvider mtlsProvider = + new FakeMtlsProvider( + FakeMtlsProvider.createTestMtlsKeyStore(), "", throwExceptionForGetKeyStore); + boolean switchToMtlsEndpointAllowed = false; + CertificateBasedAccess certificateBasedAccess = + new CertificateBasedAccess( + name -> name.equals("GOOGLE_API_USE_MTLS_ENDPOINT") ? "auto" : "true"); + Truth.assertThat( + defaultEndpointContextBuilder.mtlsEndpointResolver( + DEFAULT_ENDPOINT, + DEFAULT_MTLS_ENDPOINT, + switchToMtlsEndpointAllowed, + mtlsProvider, + certificateBasedAccess)) + .isEqualTo(DEFAULT_ENDPOINT); + } + + @Test + void mtlsEndpointResolver_switchToMtlsAllowedIsTrue_mtlsUsageAuto() throws IOException { + boolean throwExceptionForGetKeyStore = false; + MtlsProvider mtlsProvider = + new FakeMtlsProvider( + FakeMtlsProvider.createTestMtlsKeyStore(), "", throwExceptionForGetKeyStore); + boolean switchToMtlsEndpointAllowed = true; + CertificateBasedAccess certificateBasedAccess = + new CertificateBasedAccess( + name -> name.equals("GOOGLE_API_USE_MTLS_ENDPOINT") ? "auto" : "true"); + Truth.assertThat( + defaultEndpointContextBuilder.mtlsEndpointResolver( + DEFAULT_ENDPOINT, + DEFAULT_MTLS_ENDPOINT, + switchToMtlsEndpointAllowed, + mtlsProvider, + certificateBasedAccess)) + .isEqualTo(DEFAULT_MTLS_ENDPOINT); + } + + @Test + void mtlsEndpointResolver_switchToMtlsAllowedIsTrue_mtlsUsageAlways() throws IOException { + boolean throwExceptionForGetKeyStore = false; + MtlsProvider mtlsProvider = + new FakeMtlsProvider( + FakeMtlsProvider.createTestMtlsKeyStore(), "", throwExceptionForGetKeyStore); + boolean switchToMtlsEndpointAllowed = true; + CertificateBasedAccess certificateBasedAccess = + new CertificateBasedAccess( + name -> name.equals("GOOGLE_API_USE_MTLS_ENDPOINT") ? "always" : "true"); + Truth.assertThat( + defaultEndpointContextBuilder.mtlsEndpointResolver( + DEFAULT_ENDPOINT, + DEFAULT_MTLS_ENDPOINT, + switchToMtlsEndpointAllowed, + mtlsProvider, + certificateBasedAccess)) + .isEqualTo(DEFAULT_MTLS_ENDPOINT); + } + + @Test + void mtlsEndpointResolver_switchToMtlsAllowedIsTrue_mtlsUsageNever() throws IOException { + boolean throwExceptionForGetKeyStore = false; + MtlsProvider mtlsProvider = + new FakeMtlsProvider( + FakeMtlsProvider.createTestMtlsKeyStore(), "", throwExceptionForGetKeyStore); + boolean switchToMtlsEndpointAllowed = true; + CertificateBasedAccess certificateBasedAccess = + new CertificateBasedAccess( + name -> name.equals("GOOGLE_API_USE_MTLS_ENDPOINT") ? "never" : "true"); + Truth.assertThat( + defaultEndpointContextBuilder.mtlsEndpointResolver( + DEFAULT_ENDPOINT, + DEFAULT_MTLS_ENDPOINT, + switchToMtlsEndpointAllowed, + mtlsProvider, + certificateBasedAccess)) + .isEqualTo(DEFAULT_ENDPOINT); + } + + @Test + void mtlsEndpointResolver_switchToMtlsAllowedIsTrue_useCertificateIsFalse_nullMtlsKeystore() + throws IOException { + boolean throwExceptionForGetKeyStore = false; + MtlsProvider mtlsProvider = new FakeMtlsProvider(null, "", throwExceptionForGetKeyStore); + boolean switchToMtlsEndpointAllowed = true; + CertificateBasedAccess certificateBasedAccess = + new CertificateBasedAccess( + name -> name.equals("GOOGLE_API_USE_MTLS_ENDPOINT") ? "auto" : "false"); + Truth.assertThat( + defaultEndpointContextBuilder.mtlsEndpointResolver( + DEFAULT_ENDPOINT, + DEFAULT_MTLS_ENDPOINT, + switchToMtlsEndpointAllowed, + mtlsProvider, + certificateBasedAccess)) + .isEqualTo(DEFAULT_ENDPOINT); + } + + @Test + void mtlsEndpointResolver_getKeyStore_throwsIOException() throws IOException { + boolean throwExceptionForGetKeyStore = true; + MtlsProvider mtlsProvider = new FakeMtlsProvider(null, "", throwExceptionForGetKeyStore); + boolean switchToMtlsEndpointAllowed = true; + CertificateBasedAccess certificateBasedAccess = + new CertificateBasedAccess( + name -> name.equals("GOOGLE_API_USE_MTLS_ENDPOINT") ? "auto" : "true"); + assertThrows( + IOException.class, + () -> + defaultEndpointContextBuilder.mtlsEndpointResolver( + DEFAULT_ENDPOINT, + DEFAULT_MTLS_ENDPOINT, + switchToMtlsEndpointAllowed, + mtlsProvider, + certificateBasedAccess)); + } + + @Test + void endpointContextBuild_noUniverseDomain_usesClientSettingsEndpoint() throws IOException { + EndpointContext endpointContext = + defaultEndpointContextBuilder.setClientSettingsEndpoint(DEFAULT_ENDPOINT).build(); + Truth.assertThat(endpointContext.resolvedEndpoint()).isEqualTo(DEFAULT_ENDPOINT); + Truth.assertThat(endpointContext.resolvedUniverseDomain()) + .isEqualTo(Credentials.GOOGLE_DEFAULT_UNIVERSE); + } + + @Test + void endpointContextBuild_noUniverseDomain_usesTransportChannelProviderEndpoint() + throws IOException { + String transportChannelProviderEndpoint = "random.endpoint.com:443"; + EndpointContext endpointContext = + defaultEndpointContextBuilder + .setClientSettingsEndpoint(null) + .setTransportChannelProviderEndpoint(transportChannelProviderEndpoint) + .build(); + Truth.assertThat(endpointContext.resolvedEndpoint()) + .isEqualTo(transportChannelProviderEndpoint); + Truth.assertThat(endpointContext.resolvedUniverseDomain()) + .isEqualTo(Credentials.GOOGLE_DEFAULT_UNIVERSE); + } + + @Test + void endpointContextBuild_noUniverseDomain_overrideUsesTransportChannelProviderEndpoint() + throws IOException { + String transportChannelProviderEndpoint = "random.endpoint.com"; + EndpointContext endpointContext = + defaultEndpointContextBuilder + .setClientSettingsEndpoint(DEFAULT_ENDPOINT) + .setTransportChannelProviderEndpoint(transportChannelProviderEndpoint) + .build(); + Truth.assertThat(endpointContext.resolvedEndpoint()) + .isEqualTo(transportChannelProviderEndpoint); + Truth.assertThat(endpointContext.resolvedUniverseDomain()) + .isEqualTo(Credentials.GOOGLE_DEFAULT_UNIVERSE); + } + + @Test + void endpointContextBuild_emptyStringUniverseDomain_throwsIllegalArgumentException() { + EndpointContext.Builder endpointContextBuilder = + defaultEndpointContextBuilder.setUniverseDomain(""); + IllegalArgumentException exception = + assertThrows(IllegalArgumentException.class, endpointContextBuilder::build); + Truth.assertThat(exception.getMessage()) + .isEqualTo("The universe domain value cannot be empty."); + } + + @Test + void endpointContextBuild_GDUUniverseDomain() throws IOException { + EndpointContext endpointContext = defaultEndpointContextBuilder.build(); + Truth.assertThat(endpointContext.resolvedEndpoint()).isEqualTo(DEFAULT_ENDPOINT); + Truth.assertThat(endpointContext.resolvedUniverseDomain()) + .isEqualTo(Credentials.GOOGLE_DEFAULT_UNIVERSE); + } + + @Test + void endpointContextBuild_nonGDUUniverseDomain() throws IOException { + String universeDomain = "random.com"; + EndpointContext endpointContext = + defaultEndpointContextBuilder.setUniverseDomain(universeDomain).build(); + Truth.assertThat(endpointContext.resolvedEndpoint()).isEqualTo(DEFAULT_ENDPOINT); + Truth.assertThat(endpointContext.resolvedUniverseDomain()).isEqualTo(universeDomain); + } + + @Test + void endpointContextBuild_noUniverseDomain_noEndpoints() throws IOException { + String expectedEndpoint = "random.googleapis.com:443"; + EndpointContext endpointContext = + defaultEndpointContextBuilder + .setServiceName("random") + .setClientSettingsEndpoint(null) + .setTransportChannelProviderEndpoint(null) + .build(); + Truth.assertThat(endpointContext.resolvedEndpoint()).isEqualTo(expectedEndpoint); + Truth.assertThat(endpointContext.resolvedUniverseDomain()) + .isEqualTo(Credentials.GOOGLE_DEFAULT_UNIVERSE); + } + + @Test + void endpointContextBuild_mtlsConfigured_GDU() throws IOException { + MtlsProvider mtlsProvider = + new FakeMtlsProvider(FakeMtlsProvider.createTestMtlsKeyStore(), "", false); + CertificateBasedAccess certificateBasedAccess = + new CertificateBasedAccess( + name -> name.equals("GOOGLE_API_USE_MTLS_ENDPOINT") ? "always" : "true"); + EndpointContext endpointContext = + defaultEndpointContextBuilder + .setClientSettingsEndpoint(null) + .setTransportChannelProviderEndpoint(null) + .setSwitchToMtlsEndpointAllowed(true) + .setMtlsProvider(mtlsProvider) + .setCertificateBasedAccess(certificateBasedAccess) + .build(); + Truth.assertThat(endpointContext.resolvedEndpoint()).isEqualTo(DEFAULT_MTLS_ENDPOINT); + Truth.assertThat(endpointContext.resolvedUniverseDomain()) + .isEqualTo(Credentials.GOOGLE_DEFAULT_UNIVERSE); + } + + @Test + void endpointContextBuild_mtlsConfigured_nonGDU_throwsIllegalArgumentException() + throws IOException { + MtlsProvider mtlsProvider = + new FakeMtlsProvider(FakeMtlsProvider.createTestMtlsKeyStore(), "", false); + CertificateBasedAccess certificateBasedAccess = + new CertificateBasedAccess( + name -> name.equals("GOOGLE_API_USE_MTLS_ENDPOINT") ? "always" : "true"); + EndpointContext.Builder endpointContextBuilder = + defaultEndpointContextBuilder + .setUniverseDomain("random.com") + .setClientSettingsEndpoint(null) + .setTransportChannelProviderEndpoint(null) + .setSwitchToMtlsEndpointAllowed(true) + .setMtlsProvider(mtlsProvider) + .setCertificateBasedAccess(certificateBasedAccess); + IllegalArgumentException exception = + assertThrows(IllegalArgumentException.class, endpointContextBuilder::build); + Truth.assertThat(exception.getMessage()) + .isEqualTo("mTLS is not supported in any universe other than googleapis.com"); + } + + @Test + void endpointContextBuild_gdchFlow_setUniverseDomain() throws IOException { + EndpointContext.Builder endpointContextBuilder = + defaultEndpointContextBuilder.setUsingGDCH(true); + IllegalArgumentException exception = + assertThrows(IllegalArgumentException.class, endpointContextBuilder::build); + Truth.assertThat(exception.getMessage()) + .isEqualTo("Universe domain configuration is incompatible with GDC-H"); + } + + @Test + void endpointContextBuild_gdchFlow_noUniverseDomain_noCustomEndpoint() throws IOException { + EndpointContext endpointContext = + defaultEndpointContextBuilder + .setUniverseDomain(null) + .setUsingGDCH(true) + .setClientSettingsEndpoint(null) + .build(); + Truth.assertThat(endpointContext.resolvedEndpoint()).isEqualTo(DEFAULT_ENDPOINT); + Truth.assertThat(endpointContext.resolvedUniverseDomain()) + .isEqualTo(Credentials.GOOGLE_DEFAULT_UNIVERSE); + } + + @Test + void endpointContextBuild_gdchFlow_noUniverseDomain_customEndpoint() throws IOException { + String clientSettingsEndpoint = "random.endpoint.com:443"; + EndpointContext endpointContext = + defaultEndpointContextBuilder + .setUniverseDomain(null) + .setUsingGDCH(true) + .setClientSettingsEndpoint(clientSettingsEndpoint) + .build(); + Truth.assertThat(endpointContext.resolvedEndpoint()).isEqualTo(clientSettingsEndpoint); + Truth.assertThat(endpointContext.resolvedUniverseDomain()) + .isEqualTo(Credentials.GOOGLE_DEFAULT_UNIVERSE); + } + + // This Universe Domain should match the `GOOGLE_CLOUD_UNIVERSE_DOMAIN` Env Var + // For this test running locally or in CI, check that the Env Var is set properly. + // This test should only run when the maven profile `EnvVarTest` is enabled. + @Test + void endpointContextBuild_universeDomainEnvVarSet() throws IOException { + String envVarUniverseDomain = "random.com"; + EndpointContext endpointContext = + defaultEndpointContextBuilder + .setUniverseDomain(null) + .setClientSettingsEndpoint(null) + .build(); + Truth.assertThat(endpointContext.resolvedEndpoint()).isEqualTo("test.random.com:443"); + Truth.assertThat(endpointContext.resolvedUniverseDomain()).isEqualTo(envVarUniverseDomain); + } + + // This Universe Domain should match the `GOOGLE_CLOUD_UNIVERSE_DOMAIN` Env Var + // For this test running locally or in CI, check that the Env Var is set properly. + // This test should only run when the maven profile `EnvVarTest` is enabled. + @Test + void endpointContextBuild_multipleUniverseDomainConfigurations_clientSettingsHasPriority() + throws IOException { + // This test has `GOOGLE_CLOUD_UNIVERSE_DOMAIN` = `random.com` + String clientSettingsUniverseDomain = "clientSettingsUniverseDomain.com"; + EndpointContext endpointContext = + defaultEndpointContextBuilder + .setUniverseDomain(clientSettingsUniverseDomain) + .setClientSettingsEndpoint(null) + .build(); + Truth.assertThat(endpointContext.resolvedEndpoint()) + .isEqualTo("test.clientSettingsUniverseDomain.com:443"); + // Client Settings Universe Domain (if set) takes priority + Truth.assertThat(endpointContext.resolvedUniverseDomain()) + .isEqualTo(clientSettingsUniverseDomain); + } + + @Test + void endpointContextBuild_shouldUseS2A_tlsEndpoint() throws IOException { + EnvironmentProvider envProvider = Mockito.mock(EnvironmentProvider.class); + Mockito.when(envProvider.getenv(EndpointContext.S2A_ENV_ENABLE_USE_S2A)).thenReturn("true"); + defaultEndpointContextBuilder = + defaultEndpointContextBuilder + .setEnvProvider(envProvider) + .setResolvedUniverseDomain(Credentials.GOOGLE_DEFAULT_UNIVERSE) + .setClientSettingsEndpoint("") + .setTransportChannelProviderEndpoint("") + .setUsingGDCH(false); + EndpointContext endpointContext = defaultEndpointContextBuilder.build(); + Truth.assertThat(defaultEndpointContextBuilder.shouldUseS2A()).isTrue(); + Truth.assertThat(endpointContext.resolvedEndpoint()).isEqualTo(DEFAULT_ENDPOINT); + } + + @Test + void hasValidUniverseDomain_gdchFlow_anyCredentials() throws IOException { + Credentials noCredentials = NoCredentialsProvider.create().getCredentials(); + Credentials validCredentials = Mockito.mock(Credentials.class); + EndpointContext endpointContext = + defaultEndpointContextBuilder.setUniverseDomain(null).setUsingGDCH(true).build(); + endpointContext.validateUniverseDomain(noCredentials, statusCode); + endpointContext.validateUniverseDomain(validCredentials, statusCode); + } + + @Test + void hasValidUniverseDomain_noCredentials_inGDU() throws IOException { + Credentials noCredentials = NoCredentialsProvider.create().getCredentials(); + EndpointContext endpointContext = defaultEndpointContextBuilder.build(); + endpointContext.validateUniverseDomain(noCredentials, statusCode); + } + + @Test + void hasValidUniverseDomain_noCredentials_nonGDU() throws IOException { + Credentials noCredentials = NoCredentialsProvider.create().getCredentials(); + EndpointContext endpointContext = + defaultEndpointContextBuilder.setUniverseDomain("test.com").build(); + assertThrows( + UnauthenticatedException.class, + () -> endpointContext.validateUniverseDomain(noCredentials, statusCode)); + } + + @Test + void hasValidUniverseDomain_credentialsInGDU_configInGDU() throws IOException { + Credentials credentials = Mockito.mock(Credentials.class); + Mockito.when(credentials.getUniverseDomain()).thenReturn(Credentials.GOOGLE_DEFAULT_UNIVERSE); + EndpointContext endpointContext = defaultEndpointContextBuilder.build(); + endpointContext.validateUniverseDomain(credentials, statusCode); + } + + // Non-GDU Universe Domain could be any domain, but this test refers uses `test.com` + @Test + void hasValidUniverseDomain_credentialsNonGDU_configInGDU() throws IOException { + Credentials credentials = Mockito.mock(Credentials.class); + Mockito.when(credentials.getUniverseDomain()).thenReturn("test.com"); + EndpointContext endpointContext = defaultEndpointContextBuilder.build(); + assertThrows( + UnauthenticatedException.class, + () -> endpointContext.validateUniverseDomain(credentials, statusCode)); + } + + // Non-GDU Universe Domain could be any domain, but this test refers uses `test.com` + @Test + void hasValidUniverseDomain_credentialsNonGDU_configNonGDU() throws IOException { + Credentials credentials = Mockito.mock(Credentials.class); + Mockito.when(credentials.getUniverseDomain()).thenReturn("test.com"); + EndpointContext endpointContext = + defaultEndpointContextBuilder.setUniverseDomain("test.com").build(); + endpointContext.validateUniverseDomain(credentials, statusCode); + } + + // Non-GDU Universe Domain could be any domain, but this test refers uses `test.com` + @Test + void hasValidUniverseDomain_credentialsInGDU_configNonGDU() throws IOException { + Credentials credentials = Mockito.mock(Credentials.class); + Mockito.when(credentials.getUniverseDomain()).thenReturn(Credentials.GOOGLE_DEFAULT_UNIVERSE); + EndpointContext endpointContext = + defaultEndpointContextBuilder.setUniverseDomain("test.com").build(); + assertThrows( + UnauthenticatedException.class, + () -> endpointContext.validateUniverseDomain(credentials, statusCode)); + } + + // (TODO: b/349488459) - Disable automatic requests to MDS until 01/2025 + // Test is to ensure that no validation is being run for ComputeEngineCredentials + @Test + void hasValidUniverseDomain_computeEngineCredentials_noValidationOnUniverseDomain() + throws IOException { + Credentials credentials = Mockito.mock(ComputeEngineCredentials.class); + Mockito.when(credentials.getUniverseDomain()).thenReturn(Credentials.GOOGLE_DEFAULT_UNIVERSE); + EndpointContext endpointContext = + defaultEndpointContextBuilder + // Set a custom Universe Domain that doesn't match + .setUniverseDomain("test.com") + .build(); + assertDoesNotThrow(() -> endpointContext.validateUniverseDomain(credentials, statusCode)); + } + + @Test + void shouldUseS2A_envVarNotSet_returnsFalse() throws IOException { + EnvironmentProvider envProvider = Mockito.mock(EnvironmentProvider.class); + Mockito.when(envProvider.getenv(EndpointContext.S2A_ENV_ENABLE_USE_S2A)).thenReturn("false"); + defaultEndpointContextBuilder = + defaultEndpointContextBuilder + .setEnvProvider(envProvider) + .setResolvedUniverseDomain(Credentials.GOOGLE_DEFAULT_UNIVERSE) + .setClientSettingsEndpoint("") + .setTransportChannelProviderEndpoint("") + .setUsingGDCH(false); + Truth.assertThat(defaultEndpointContextBuilder.shouldUseS2A()).isFalse(); + } + + @Test + void shouldUseS2A_UsingGDCH_returnsFalse() throws IOException { + EnvironmentProvider envProvider = Mockito.mock(EnvironmentProvider.class); + Mockito.when(envProvider.getenv(EndpointContext.S2A_ENV_ENABLE_USE_S2A)).thenReturn("true"); + defaultEndpointContextBuilder = + defaultEndpointContextBuilder + .setEnvProvider(envProvider) + .setResolvedUniverseDomain(Credentials.GOOGLE_DEFAULT_UNIVERSE) + .setClientSettingsEndpoint("") + .setTransportChannelProviderEndpoint("") + .setUsingGDCH(true); + Truth.assertThat(defaultEndpointContextBuilder.shouldUseS2A()).isFalse(); + } + + @Test + void shouldUseS2A_customEndpointSetViaClientSettings_returnsFalse() throws IOException { + EnvironmentProvider envProvider = Mockito.mock(EnvironmentProvider.class); + Mockito.when(envProvider.getenv(EndpointContext.S2A_ENV_ENABLE_USE_S2A)).thenReturn("true"); + defaultEndpointContextBuilder = + defaultEndpointContextBuilder + .setEnvProvider(envProvider) + .setResolvedUniverseDomain(Credentials.GOOGLE_DEFAULT_UNIVERSE) + .setClientSettingsEndpoint("test.endpoint.com:443") + .setTransportChannelProviderEndpoint("") + .setUsingGDCH(false); + Truth.assertThat(defaultEndpointContextBuilder.shouldUseS2A()).isFalse(); + } + + @Test + void shouldUseS2A_customEndpointSetViaTransportChannelProvider_returnsFalse() throws IOException { + EnvironmentProvider envProvider = Mockito.mock(EnvironmentProvider.class); + Mockito.when(envProvider.getenv(EndpointContext.S2A_ENV_ENABLE_USE_S2A)).thenReturn("true"); + defaultEndpointContextBuilder = + defaultEndpointContextBuilder + .setEnvProvider(envProvider) + .setResolvedUniverseDomain(Credentials.GOOGLE_DEFAULT_UNIVERSE) + .setClientSettingsEndpoint("") + .setTransportChannelProviderEndpoint("test.endpoint.com:443") + .setUsingGDCH(false); + Truth.assertThat(defaultEndpointContextBuilder.shouldUseS2A()).isFalse(); + } + + @Test + void shouldUseS2A_mtlsEndpointNull_returnsFalse() throws IOException { + EnvironmentProvider envProvider = Mockito.mock(EnvironmentProvider.class); + Mockito.when(envProvider.getenv(EndpointContext.S2A_ENV_ENABLE_USE_S2A)).thenReturn("true"); + defaultEndpointContextBuilder = + defaultEndpointContextBuilder + .setEnvProvider(envProvider) + .setResolvedUniverseDomain(Credentials.GOOGLE_DEFAULT_UNIVERSE) + .setClientSettingsEndpoint("") + .setTransportChannelProviderEndpoint("") + .setUsingGDCH(false) + .setMtlsEndpoint(null); + Truth.assertThat(defaultEndpointContextBuilder.shouldUseS2A()).isFalse(); + } + + @Test + void shouldUseS2A_mtlsEndpointEmpty_returnsFalse() throws IOException { + EnvironmentProvider envProvider = Mockito.mock(EnvironmentProvider.class); + Mockito.when(envProvider.getenv(EndpointContext.S2A_ENV_ENABLE_USE_S2A)).thenReturn("true"); + defaultEndpointContextBuilder = + defaultEndpointContextBuilder + .setEnvProvider(envProvider) + .setResolvedUniverseDomain(Credentials.GOOGLE_DEFAULT_UNIVERSE) + .setClientSettingsEndpoint("") + .setTransportChannelProviderEndpoint("") + .setMtlsEndpoint("") + .setUsingGDCH(false); + Truth.assertThat(defaultEndpointContextBuilder.shouldUseS2A()).isFalse(); + } + + @Test + void shouldUseS2A_mtlsEndpointNotGoogleDefaultUniverse_returnsFalse() throws IOException { + EnvironmentProvider envProvider = Mockito.mock(EnvironmentProvider.class); + Mockito.when(envProvider.getenv(EndpointContext.S2A_ENV_ENABLE_USE_S2A)).thenReturn("true"); + defaultEndpointContextBuilder = + defaultEndpointContextBuilder + .setEnvProvider(envProvider) + .setResolvedUniverseDomain(Credentials.GOOGLE_DEFAULT_UNIVERSE) + .setClientSettingsEndpoint("") + .setTransportChannelProviderEndpoint("") + .setMtlsEndpoint("test.mtls.abcd.com:443") + .setUsingGDCH(false); + Truth.assertThat(defaultEndpointContextBuilder.shouldUseS2A()).isFalse(); + } + + @Test + void shouldUseS2A_success() throws IOException { + EnvironmentProvider envProvider = Mockito.mock(EnvironmentProvider.class); + Mockito.when(envProvider.getenv(EndpointContext.S2A_ENV_ENABLE_USE_S2A)).thenReturn("true"); + defaultEndpointContextBuilder = + defaultEndpointContextBuilder + .setEnvProvider(envProvider) + .setResolvedUniverseDomain(Credentials.GOOGLE_DEFAULT_UNIVERSE) + .setClientSettingsEndpoint("") + .setTransportChannelProviderEndpoint("") + .setUsingGDCH(false); + Truth.assertThat(defaultEndpointContextBuilder.shouldUseS2A()).isTrue(); + } + + @Test + void endpointContextBuild_resolvesServerAddress() throws IOException { + String endpoint = "http://localhost:7469"; + EndpointContext endpointContext = + defaultEndpointContextBuilder + .setClientSettingsEndpoint(endpoint) + .setTransportChannelProviderEndpoint(null) + .build(); + Truth.assertThat(endpointContext.resolvedServerAddress()).isEqualTo("localhost"); + + endpoint = "localhost:7469"; + endpointContext = + defaultEndpointContextBuilder + .setClientSettingsEndpoint(endpoint) + .setTransportChannelProviderEndpoint(null) + .build(); + Truth.assertThat(endpointContext.resolvedServerAddress()).isEqualTo("localhost"); + + endpoint = "test.googleapis.com:443"; + endpointContext = + defaultEndpointContextBuilder + .setClientSettingsEndpoint(endpoint) + .setTransportChannelProviderEndpoint(null) + .build(); + Truth.assertThat(endpointContext.resolvedServerAddress()).isEqualTo("test.googleapis.com"); + + // IPv6 literal with port + endpoint = "[2001:db8::1]:443"; + endpointContext = + defaultEndpointContextBuilder + .setClientSettingsEndpoint(endpoint) + .setTransportChannelProviderEndpoint(null) + .build(); + Truth.assertThat(endpointContext.resolvedServerAddress()).isEqualTo("2001:db8::1"); + + // Bare IPv6 literal (no port) + endpoint = "2001:db8::1"; + endpointContext = + defaultEndpointContextBuilder + .setClientSettingsEndpoint(endpoint) + .setTransportChannelProviderEndpoint(null) + .build(); + Truth.assertThat(endpointContext.resolvedServerAddress()).isEqualTo("2001:db8::1"); + } + + @Test + void endpointContextBuild_resolvesPort() throws IOException { + String endpoint = "http://localhost:7469"; + EndpointContext endpointContext = + defaultEndpointContextBuilder + .setClientSettingsEndpoint(endpoint) + .setTransportChannelProviderEndpoint(null) + .build(); + Truth.assertThat(endpointContext.resolvedServerPort()).isEqualTo(7469); + + endpoint = "localhost:7469"; + endpointContext = + defaultEndpointContextBuilder + .setClientSettingsEndpoint(endpoint) + .setTransportChannelProviderEndpoint(null) + .build(); + Truth.assertThat(endpointContext.resolvedServerPort()).isEqualTo(7469); + + endpoint = "test.googleapis.com:443"; + endpointContext = + defaultEndpointContextBuilder + .setClientSettingsEndpoint(endpoint) + .setTransportChannelProviderEndpoint(null) + .build(); + Truth.assertThat(endpointContext.resolvedServerPort()).isEqualTo(443); + + // IPv6 literal with port + endpoint = "[2001:db8::1]:443"; + endpointContext = + defaultEndpointContextBuilder + .setClientSettingsEndpoint(endpoint) + .setTransportChannelProviderEndpoint(null) + .build(); + Truth.assertThat(endpointContext.resolvedServerPort()).isEqualTo(443); + + // Bare IPv6 literal (no port) + endpoint = "2001:db8::1"; + endpointContext = + defaultEndpointContextBuilder + .setClientSettingsEndpoint(endpoint) + .setTransportChannelProviderEndpoint(null) + .build(); + Truth.assertThat(endpointContext.resolvedServerPort()).isNull(); + } +} diff --git a/gax-java/gax/src/test/java/com/google/api/gax/rpc/ErrorDetailsTest.java b/gax-java/gax/src/test/java/com/google/api/gax/rpc/ErrorDetailsTest.java index 8edef41bf7..90d05e5e3b 100644 --- a/gax-java/gax/src/test/java/com/google/api/gax/rpc/ErrorDetailsTest.java +++ b/gax-java/gax/src/test/java/com/google/api/gax/rpc/ErrorDetailsTest.java @@ -29,7 +29,7 @@ */ package com.google.api.gax.rpc; -import static org.junit.Assert.assertThrows; +import static org.junit.jupiter.api.Assertions.assertThrows; import com.google.common.collect.ImmutableList; import com.google.common.truth.Truth; @@ -50,13 +50,10 @@ import com.google.rpc.ResourceInfo; import com.google.rpc.RetryInfo; import java.util.Collections; -import org.junit.Before; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.junit.runners.JUnit4; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; -@RunWith(JUnit4.class) -public class ErrorDetailsTest { +class ErrorDetailsTest { private static final ErrorInfo ERROR_INFO = ErrorInfo.newBuilder() @@ -124,10 +121,13 @@ public class ErrorDetailsTest { private static final LocalizedMessage LOCALIZED_MESSAGE = LocalizedMessage.newBuilder().setLocale("en").setMessage("nothing").build(); + private static final Duration DURATION_MESSAGE = + Duration.newBuilder().setSeconds(12345).setNanos(54321).build(); + ErrorDetails errorDetails; - @Before - public void setUp() throws Exception { + @BeforeEach + void setUp() throws Exception { ImmutableList rawErrorMessages = ImmutableList.of( Any.pack(ERROR_INFO), @@ -139,20 +139,21 @@ public void setUp() throws Exception { Any.pack(REQUEST_INFO), Any.pack(RESOURCE_INFO), Any.pack(HELP), - Any.pack(LOCALIZED_MESSAGE)); + Any.pack(LOCALIZED_MESSAGE), + Any.pack(DURATION_MESSAGE)); errorDetails = ErrorDetails.builder().setRawErrorMessages(rawErrorMessages).build(); } @Test - public void unpack_shouldReturnNullIfRawErrorMessagesIsNull() { + void unpack_shouldReturnNullIfRawErrorMessagesIsNull() { errorDetails = ErrorDetails.builder().setRawErrorMessages(null).build(); Truth.assertThat(errorDetails.unpack(ErrorInfo.class)).isNull(); } @Test - public void unpack_shouldReturnNullIfErrorMessageTypeDoesNotExist() { + void unpack_shouldReturnNullIfErrorMessageTypeDoesNotExist() { errorDetails = ErrorDetails.builder().setRawErrorMessages(ImmutableList.of(Any.pack(ERROR_INFO))).build(); @@ -160,7 +161,7 @@ public void unpack_shouldReturnNullIfErrorMessageTypeDoesNotExist() { } @Test - public void unpack_shouldThrowExceptionIfUnpackingErrorMassageFailed() { + void unpack_shouldThrowExceptionIfUnpackingErrorMassageFailed() { Any malformedErrorType = Any.newBuilder() .setTypeUrl("type.googleapis.com/google.rpc.ErrorInfo") @@ -178,57 +179,62 @@ public void unpack_shouldThrowExceptionIfUnpackingErrorMassageFailed() { } @Test - public void unpack_shouldReturnDesiredErrorMessageTypeIfItExist() { + void unpack_shouldReturnDesiredErrorMessageTypeIfItExist() { Truth.assertThat(errorDetails.unpack(ErrorInfo.class)).isEqualTo(ERROR_INFO); } @Test - public void errorInfo_shouldUnpackErrorInfoProtoMessage() { + void errorInfo_shouldUnpackErrorInfoProtoMessage() { Truth.assertThat(errorDetails.getErrorInfo()).isEqualTo(ERROR_INFO); } @Test - public void retryInfo_shouldUnpackRetryInfoProtoMessage() { + void retryInfo_shouldUnpackRetryInfoProtoMessage() { Truth.assertThat(errorDetails.getRetryInfo()).isEqualTo(RETRY_INFO); } @Test - public void debugInfo_shouldUnpackDebugInfoProtoMessage() { + void debugInfo_shouldUnpackDebugInfoProtoMessage() { Truth.assertThat(errorDetails.getDebugInfo()).isEqualTo(DEBUG_INFO); } @Test - public void quotaFailure_shouldUnpackQuotaFailureProtoMessage() { + void quotaFailure_shouldUnpackQuotaFailureProtoMessage() { Truth.assertThat(errorDetails.getQuotaFailure()).isEqualTo(QUOTA_FAILURE); } @Test - public void preconditionFailure_shouldUnpackPreconditionFailureProtoMessage() { + void preconditionFailure_shouldUnpackPreconditionFailureProtoMessage() { Truth.assertThat(errorDetails.getPreconditionFailure()).isEqualTo(PRECONDITION_FAILURE); } @Test - public void badRequest_shouldUnpackBadRequestProtoMessage() { + void badRequest_shouldUnpackBadRequestProtoMessage() { Truth.assertThat(errorDetails.getBadRequest()).isEqualTo(BAD_REQUEST); } @Test - public void requestInfo_shouldUnpackRequestInfoProtoMessage() { + void requestInfo_shouldUnpackRequestInfoProtoMessage() { Truth.assertThat(errorDetails.getRequestInfo()).isEqualTo(REQUEST_INFO); } @Test - public void resourceInfo_shouldUnpackResourceInfoProtoMessage() { + void resourceInfo_shouldUnpackResourceInfoProtoMessage() { Truth.assertThat(errorDetails.getResourceInfo()).isEqualTo(RESOURCE_INFO); } @Test - public void help_shouldUnpackHelpProtoMessage() { + void help_shouldUnpackHelpProtoMessage() { Truth.assertThat(errorDetails.getHelp()).isEqualTo(HELP); } @Test - public void localizedMessage_shouldUnpackLocalizedMessageProtoMessage() { + void localizedMessage_shouldUnpackLocalizedMessageProtoMessage() { Truth.assertThat(errorDetails.getHelp()).isEqualTo(HELP); } + + @Test + void getMessage_duration_shouldUnpackDurationProtoMessage() { + Truth.assertThat(errorDetails.getMessage(Duration.class)).isEqualTo(DURATION_MESSAGE); + } } diff --git a/gax-java/gax/src/test/java/com/google/api/gax/rpc/FirstElementCallableTest.java b/gax-java/gax/src/test/java/com/google/api/gax/rpc/FirstElementCallableTest.java index e26ce719e1..1bae2ab0b1 100644 --- a/gax-java/gax/src/test/java/com/google/api/gax/rpc/FirstElementCallableTest.java +++ b/gax-java/gax/src/test/java/com/google/api/gax/rpc/FirstElementCallableTest.java @@ -36,24 +36,21 @@ import java.util.concurrent.CancellationException; import java.util.concurrent.ExecutionException; import java.util.concurrent.TimeUnit; -import org.junit.Before; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.junit.runners.JUnit4; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; -@RunWith(JUnit4.class) -public class FirstElementCallableTest { +class FirstElementCallableTest { private MockServerStreamingCallable upstream; private FirstElementCallable callable; - @Before - public void setup() { + @BeforeEach + void setup() { upstream = new MockServerStreamingCallable<>(); callable = new FirstElementCallable<>(upstream); } @Test - public void testHappyPath() throws InterruptedException, ExecutionException { + void testHappyPath() throws InterruptedException, ExecutionException { ApiFuture result = callable.futureCall("request"); MockServerStreamingCall call = upstream.popLastCall(); @@ -67,7 +64,7 @@ public void testHappyPath() throws InterruptedException, ExecutionException { } @Test - public void testEarlyTermination() throws Exception { + void testEarlyTermination() throws Exception { ApiFuture result = callable.futureCall("request"); MockServerStreamingCall call = upstream.popLastCall(); @@ -99,7 +96,7 @@ public void testEarlyTermination() throws Exception { } @Test - public void testNoResults() throws Exception { + void testNoResults() throws Exception { ApiFuture result = callable.futureCall("request"); MockServerStreamingCall call = upstream.popLastCall(); @@ -110,7 +107,7 @@ public void testNoResults() throws Exception { } @Test - public void testErrorAfterResultIsIgnored() throws Exception { + void testErrorAfterResultIsIgnored() throws Exception { ApiFuture result = callable.futureCall("request"); MockServerStreamingCall call = upstream.popLastCall(); diff --git a/gax-java/gax/src/test/java/com/google/api/gax/rpc/FixedHeaderProviderTest.java b/gax-java/gax/src/test/java/com/google/api/gax/rpc/FixedHeaderProviderTest.java index 8bffbed0e9..de6b506ec3 100644 --- a/gax-java/gax/src/test/java/com/google/api/gax/rpc/FixedHeaderProviderTest.java +++ b/gax-java/gax/src/test/java/com/google/api/gax/rpc/FixedHeaderProviderTest.java @@ -30,29 +30,30 @@ package com.google.api.gax.rpc; -import static org.junit.Assert.assertEquals; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertThrows; import com.google.common.collect.ImmutableMap; import java.util.Map; -import org.junit.Test; +import org.junit.jupiter.api.Test; -public class FixedHeaderProviderTest { +class FixedHeaderProviderTest { @Test - public void testCreateSuccess() { + void testCreateSuccess() { Map headers = ImmutableMap.of("User-Agent", "hello1", "Custom-Header", "hello2"); FixedHeaderProvider headerProvider = FixedHeaderProvider.create(headers); assertEquals(headers, headerProvider.getHeaders()); } - @Test(expected = IllegalArgumentException.class) - public void testCreateFail() { + @Test + void testCreateFail() { Map headers = ImmutableMap.of("User-Agent", "hello1", "user-agent", "hello2"); - FixedHeaderProvider.create(headers); + assertThrows(IllegalArgumentException.class, () -> FixedHeaderProvider.create(headers)); } @Test - public void testCreateVarargSuccess() { + void testCreateVarargSuccess() { Map headers = ImmutableMap.of("User-Agent", "hello1", "Custom-Header", "hello2"); FixedHeaderProvider headerProvider = @@ -60,13 +61,17 @@ public void testCreateVarargSuccess() { assertEquals(headers, headerProvider.getHeaders()); } - @Test(expected = IllegalArgumentException.class) - public void testCreateVarargFail() { - FixedHeaderProvider.create("User-Agent", "hello1", "user-agent", "hello2"); + @Test + void testCreateVarargFail() { + assertThrows( + IllegalArgumentException.class, + () -> FixedHeaderProvider.create("User-Agent", "hello1", "user-agent", "hello2")); } - @Test(expected = IllegalArgumentException.class) - public void testCreateVarargOddNumberOfParamsFail() { - FixedHeaderProvider.create("User-Agent", "hello1", "Custom-Header"); + @Test + void testCreateVarargOddNumberOfParamsFail() { + assertThrows( + IllegalArgumentException.class, + () -> FixedHeaderProvider.create("User-Agent", "hello1", "Custom-Header")); } } diff --git a/gax-java/gax/src/test/java/com/google/api/gax/rpc/FixedTransportChannelProviderTest.java b/gax-java/gax/src/test/java/com/google/api/gax/rpc/FixedTransportChannelProviderTest.java index 66187657dd..be05aa3f01 100644 --- a/gax-java/gax/src/test/java/com/google/api/gax/rpc/FixedTransportChannelProviderTest.java +++ b/gax-java/gax/src/test/java/com/google/api/gax/rpc/FixedTransportChannelProviderTest.java @@ -35,14 +35,11 @@ import com.google.common.truth.Truth; import java.util.Collections; import java.util.concurrent.ScheduledThreadPoolExecutor; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.junit.runners.JUnit4; +import org.junit.jupiter.api.Test; -@RunWith(JUnit4.class) -public class FixedTransportChannelProviderTest { +class FixedTransportChannelProviderTest { @Test - public void testBasic() throws Exception { + void testBasic() throws Exception { TransportChannel transportChannel = FakeTransportChannel.create(new FakeChannel()); FixedTransportChannelProvider provider = FixedTransportChannelProvider.create(transportChannel); diff --git a/gax-java/gax/src/test/java/com/google/api/gax/rpc/FixedWatchdogProviderTest.java b/gax-java/gax/src/test/java/com/google/api/gax/rpc/FixedWatchdogProviderTest.java index 9fb9659371..eb0355d90b 100644 --- a/gax-java/gax/src/test/java/com/google/api/gax/rpc/FixedWatchdogProviderTest.java +++ b/gax-java/gax/src/test/java/com/google/api/gax/rpc/FixedWatchdogProviderTest.java @@ -30,29 +30,26 @@ package com.google.api.gax.rpc; import static com.google.common.truth.Truth.assertThat; +import static org.junit.jupiter.api.Assertions.assertThrows; import com.google.api.core.ApiClock; import java.util.concurrent.ScheduledExecutorService; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.junit.runners.JUnit4; +import org.junit.jupiter.api.Test; import org.mockito.Mockito; -import org.threeten.bp.Duration; -@RunWith(JUnit4.class) -public class FixedWatchdogProviderTest { +class FixedWatchdogProviderTest { @Test - public void testNull() { + void testNull() { WatchdogProvider provider = FixedWatchdogProvider.create(null); assertThat(provider.getWatchdog()).isNull(); } @Test - public void testSameInstance() { + void testSameInstance() { Watchdog watchdog = - Watchdog.create( + Watchdog.createDuration( Mockito.mock(ApiClock.class), - Duration.ZERO, + java.time.Duration.ZERO, Mockito.mock(ScheduledExecutorService.class)); WatchdogProvider provider = FixedWatchdogProvider.create(watchdog); @@ -60,11 +57,11 @@ public void testSameInstance() { } @Test - public void testNoModifications() { + void testNoModifications() { Watchdog watchdog = - Watchdog.create( + Watchdog.createDuration( Mockito.mock(ApiClock.class), - Duration.ZERO, + java.time.Duration.ZERO, Mockito.mock(ScheduledExecutorService.class)); WatchdogProvider provider = FixedWatchdogProvider.create(watchdog); @@ -75,7 +72,7 @@ public void testNoModifications() { Throwable actualError = null; try { - provider.withCheckInterval(Duration.ofSeconds(10)); + provider.withCheckIntervalDuration(java.time.Duration.ofSeconds(10)); } catch (Throwable t) { actualError = t; } @@ -97,4 +94,18 @@ public void testNoModifications() { } assertThat(actualError).isInstanceOf(UnsupportedOperationException.class); } + + @Test + public void testWithCheckInterval_backportMethodsBehaveTheSame() { + assertThrows( + UnsupportedOperationException.class, + () -> + FixedWatchdogProvider.create(null) + .withCheckIntervalDuration(java.time.Duration.ofMillis(123l))); + assertThrows( + UnsupportedOperationException.class, + () -> + FixedWatchdogProvider.create(null) + .withCheckInterval(org.threeten.bp.Duration.ofMillis(123l))); + } } diff --git a/gax-java/gax/src/test/java/com/google/api/gax/rpc/InstantiatingWatchdogProviderTest.java b/gax-java/gax/src/test/java/com/google/api/gax/rpc/InstantiatingWatchdogProviderTest.java index 0607dc7179..2bceba43a1 100644 --- a/gax-java/gax/src/test/java/com/google/api/gax/rpc/InstantiatingWatchdogProviderTest.java +++ b/gax-java/gax/src/test/java/com/google/api/gax/rpc/InstantiatingWatchdogProviderTest.java @@ -29,26 +29,26 @@ */ package com.google.api.gax.rpc; +import static com.google.api.gax.util.TimeConversionTestUtils.testDurationMethod; import static com.google.common.truth.Truth.assertThat; import com.google.api.core.ApiClock; import java.util.concurrent.ScheduledExecutorService; import java.util.concurrent.TimeUnit; -import org.junit.Test; -import org.junit.runner.RunWith; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; import org.mockito.Mock; import org.mockito.Mockito; -import org.mockito.junit.MockitoJUnitRunner; -import org.threeten.bp.Duration; +import org.mockito.junit.jupiter.MockitoExtension; -@RunWith(MockitoJUnitRunner.class) -public class InstantiatingWatchdogProviderTest { +@ExtendWith(MockitoExtension.class) +class InstantiatingWatchdogProviderTest { @Mock private ScheduledExecutorService executor; @Mock private ApiClock clock; - private Duration checkInterval = Duration.ofSeconds(11); + private java.time.Duration checkInterval = java.time.Duration.ofSeconds(11); @Test - public void happyPath() { + void happyPath() { WatchdogProvider provider = InstantiatingWatchdogProvider.create(); assertThat(provider.needsExecutor()).isTrue(); @@ -58,7 +58,7 @@ public void happyPath() { provider = provider.withClock(clock); assertThat(provider.needsCheckInterval()).isTrue(); - provider = provider.withCheckInterval(checkInterval); + provider = provider.withCheckIntervalDuration(checkInterval); assertThat(provider.shouldAutoClose()).isTrue(); @@ -69,9 +69,11 @@ public void happyPath() { } @Test - public void requiresExecutor() { + void requiresExecutor() { WatchdogProvider provider = - InstantiatingWatchdogProvider.create().withCheckInterval(checkInterval).withClock(clock); + InstantiatingWatchdogProvider.create() + .withCheckIntervalDuration(checkInterval) + .withClock(clock); Throwable actualError = null; try { @@ -83,7 +85,7 @@ public void requiresExecutor() { } @Test - public void requiresCheckInterval() { + void requiresCheckInterval() { WatchdogProvider provider = InstantiatingWatchdogProvider.create().withExecutor(executor).withClock(clock); @@ -97,11 +99,11 @@ public void requiresCheckInterval() { } @Test - public void requiresClock() { + void requiresClock() { WatchdogProvider provider = InstantiatingWatchdogProvider.create() .withExecutor(executor) - .withCheckInterval(checkInterval); + .withCheckIntervalDuration(checkInterval); Throwable actualError = null; try { @@ -111,4 +113,17 @@ public void requiresClock() { } assertThat(actualError).isInstanceOf(IllegalStateException.class); } + + @Test + public void testCheckInterval_backportMethodsBehaveCorrectly() { + final InstantiatingWatchdogProvider baseProvider = + (InstantiatingWatchdogProvider) + InstantiatingWatchdogProvider.create().withClock(clock).withExecutor(executor); + testDurationMethod( + 123l, + jt -> baseProvider.withCheckIntervalDuration(jt), + tt -> baseProvider.withCheckInterval(tt), + wp -> wp.getWatchdog().getScheduleIntervalDuration(), + wp -> wp.getWatchdog().getScheduleInterval()); + } } diff --git a/gax-java/gax/src/test/java/com/google/api/gax/rpc/OperationCallSettingsTest.java b/gax-java/gax/src/test/java/com/google/api/gax/rpc/OperationCallSettingsTest.java index f3f9f603b1..4c1157a25b 100644 --- a/gax-java/gax/src/test/java/com/google/api/gax/rpc/OperationCallSettingsTest.java +++ b/gax-java/gax/src/test/java/com/google/api/gax/rpc/OperationCallSettingsTest.java @@ -34,16 +34,13 @@ import com.google.api.gax.retrying.TimedRetryAlgorithm; import com.google.api.gax.rpc.StatusCode.Code; import com.google.common.truth.Truth; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.junit.runners.JUnit4; +import org.junit.jupiter.api.Test; import org.mockito.Mockito; -@RunWith(JUnit4.class) -public class OperationCallSettingsTest { +class OperationCallSettingsTest { @Test - public void testEmptyBuilder() { + void testEmptyBuilder() { OperationCallSettings.Builder builder = OperationCallSettings.newBuilder(); Truth.assertThat(builder.getResponseTransformer()).isNull(); @@ -53,7 +50,7 @@ public void testEmptyBuilder() { } @Test - public void testBuilder() { + void testBuilder() { OperationCallSettings.Builder builder = OperationCallSettings.newBuilder(); @@ -82,7 +79,7 @@ public void testBuilder() { } @Test - public void testBuilderFromSettings() throws Exception { + void testBuilderFromSettings() throws Exception { OperationCallSettings.Builder builder = OperationCallSettings.newBuilder(); diff --git a/gax-java/gax/src/test/java/com/google/api/gax/rpc/OperationCallableImplTest.java b/gax-java/gax/src/test/java/com/google/api/gax/rpc/OperationCallableImplTest.java index 5779f72f71..eb6340f7f0 100644 --- a/gax-java/gax/src/test/java/com/google/api/gax/rpc/OperationCallableImplTest.java +++ b/gax-java/gax/src/test/java/com/google/api/gax/rpc/OperationCallableImplTest.java @@ -66,43 +66,41 @@ import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeoutException; import java.util.concurrent.locks.LockSupport; -import org.junit.After; -import org.junit.Before; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.junit.runners.JUnit4; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; import org.mockito.ArgumentCaptor; import org.mockito.Mockito; -import org.threeten.bp.Duration; -@RunWith(JUnit4.class) -public class OperationCallableImplTest { +class OperationCallableImplTest { private static final RetrySettings FAST_RETRY_SETTINGS = RetrySettings.newBuilder() - .setInitialRetryDelay(Duration.ofMillis(2L)) + .setInitialRetryDelayDuration(java.time.Duration.ofMillis(2L)) .setRetryDelayMultiplier(1) - .setMaxRetryDelay(Duration.ofMillis(2L)) - .setInitialRpcTimeout(Duration.ofMillis(2L)) + .setMaxRetryDelayDuration(java.time.Duration.ofMillis(2L)) + .setInitialRpcTimeoutDuration(java.time.Duration.ofMillis(2L)) .setRpcTimeoutMultiplier(1) - .setMaxRpcTimeout(Duration.ofMillis(2L)) - .setTotalTimeout(Duration.ofMillis(10L)) + .setMaxRpcTimeoutDuration(java.time.Duration.ofMillis(2L)) + .setTotalTimeoutDuration(java.time.Duration.ofMillis(10L)) .build(); private static final RetrySettings FAST_RECHECKING_SETTINGS = RetrySettings.newBuilder() - .setInitialRetryDelay(Duration.ofMillis(1L)) + .setInitialRetryDelayDuration(java.time.Duration.ofMillis(1L)) .setRetryDelayMultiplier(1) - .setMaxRetryDelay(Duration.ofMillis(1L)) - .setInitialRpcTimeout( - Duration.ZERO) // supposed to be ignored, but are not actually, so we set to zero + .setMaxRetryDelayDuration(java.time.Duration.ofMillis(1L)) + .setInitialRpcTimeoutDuration( + java.time.Duration + .ZERO) // supposed to be ignored, but are not actually, so we set to zero .setMaxAttempts(0) .setJittered(false) .setRpcTimeoutMultiplier( 1) // supposed to be ignored, but are not actually, so we set to one - .setMaxRpcTimeout( - Duration.ZERO) // supposed to be ignored, but are not actually, so we set to zero - .setTotalTimeout(Duration.ofMillis(5L)) + .setMaxRpcTimeoutDuration( + java.time.Duration + .ZERO) // supposed to be ignored, but are not actually, so we set to zero + .setTotalTimeoutDuration(java.time.Duration.ofMillis(5L)) .build(); private FakeChannel initialChannel; @@ -114,8 +112,8 @@ public class OperationCallableImplTest { private FakeApiClock clock; private OperationTimedPollAlgorithm pollingAlgorithm; - @Before - public void setUp() throws IOException { + @BeforeEach + void setUp() throws IOException { initialChannel = mock(FakeChannel.class); pollTransportChannel = mock(TransportChannel.class); TransportChannelProvider operationsChannelProvider = mock(TransportChannelProvider.class); @@ -191,13 +189,13 @@ public Currency apply(OperationSnapshot operationSnapshot) { } } - @After - public void tearDown() { + @AfterEach + void tearDown() { executor.shutdown(); } @Test - public void testCall() { + void testCall() { Color resp = getColor(1.0f); Currency meta = Currency.getInstance("UAH"); OperationSnapshot resultOperation = getOperation("testCall", resp, null, meta, true); @@ -215,7 +213,7 @@ public void testCall() { } @Test - public void testResumeFutureCall() throws Exception { + void testResumeFutureCall() throws Exception { String opName = "testResumeFutureCall"; Color resp = getColor(0.5f); Currency meta = Currency.getInstance("UAH"); @@ -234,7 +232,7 @@ public void testResumeFutureCall() throws Exception { } @Test - public void testCancelOperation() throws Exception { + void testCancelOperation() throws Exception { String opName = "testCancelOperation"; LongRunningClient longRunningClient = mockCancelOperation(StatusCode.Code.OK); @@ -248,7 +246,7 @@ public void testCancelOperation() throws Exception { } @Test - public void testFutureCallInitialDone() throws Exception { + void testFutureCallInitialDone() throws Exception { String opName = "testFutureCallInitialDone"; Color resp = getColor(0.5f); Currency meta = Currency.getInstance("UAH"); @@ -269,7 +267,7 @@ public void testFutureCallInitialDone() throws Exception { } @Test - public void testFutureCallInitialError() throws Exception { + void testFutureCallInitialError() throws Exception { String opName = "testFutureCallInitialError"; Color resp = getColor(1.0f); Currency meta = Currency.getInstance("UAH"); @@ -290,7 +288,7 @@ public void testFutureCallInitialError() throws Exception { } @Test - public void testFutureCallInitialDoneWithError() throws Exception { + void testFutureCallInitialDoneWithError() throws Exception { String opName = "testFutureCallInitialDoneWithError"; StatusCode errorCode = FakeStatusCode.of(StatusCode.Code.ALREADY_EXISTS); Currency meta = Currency.getInstance("UAH"); @@ -320,7 +318,7 @@ public void testFutureCallInitialDoneWithError() throws Exception { } @Test - public void testFutureCallInitialDoneWrongType() throws Exception { + void testFutureCallInitialDoneWrongType() throws Exception { String opName = "testFutureCallInitialDoneWrongType"; Currency resp = Currency.getInstance("USD"); Currency meta = Currency.getInstance("UAH"); @@ -345,7 +343,7 @@ public void testFutureCallInitialDoneWrongType() throws Exception { } @Test - public void testFutureCallInitialDoneMetaWrongType() throws Exception { + void testFutureCallInitialDoneMetaWrongType() throws Exception { String opName = "testFutureCallInitialDoneMetaWrongType"; Color resp = getColor(1.0f); Color meta = getColor(1.0f); @@ -366,7 +364,7 @@ public void testFutureCallInitialDoneMetaWrongType() throws Exception { } @Test - public void testFutureCallInitialCancel() throws Exception { + void testFutureCallInitialCancel() throws Exception { String opName = "testFutureCallInitialCancel"; OperationSnapshot initialOperation = getOperation(opName, null, null, null, false); OperationSnapshot resultOperation = getOperation(opName, null, null, null, false); @@ -402,7 +400,7 @@ public void testFutureCallInitialCancel() throws Exception { } @Test - public void testFutureCallInitialOperationUnexpectedFail() throws Exception { + void testFutureCallInitialOperationUnexpectedFail() throws Exception { String opName = "testFutureCallInitialOperationUnexpectedFail"; OperationSnapshot initialOperation = getOperation(opName, null, null, null, false); OperationSnapshot resultOperation = getOperation(opName, null, null, null, false); @@ -425,7 +423,7 @@ public void testFutureCallInitialOperationUnexpectedFail() throws Exception { } @Test - public void testFutureCallPollDoneOnFirst() throws Exception { + void testFutureCallPollDoneOnFirst() throws Exception { String opName = "testFutureCallPollDoneOnFirst"; Color resp = getColor(0.5f); Currency meta = Currency.getInstance("UAH"); @@ -447,7 +445,7 @@ public void testFutureCallPollDoneOnFirst() throws Exception { } @Test - public void testFutureCallPollDoneOnSecond() throws Exception { + void testFutureCallPollDoneOnSecond() throws Exception { String opName = "testFutureCallPollDoneOnSecond"; Color resp = getColor(0.5f); Currency meta1 = Currency.getInstance("UAH"); @@ -472,22 +470,21 @@ public void testFutureCallPollDoneOnSecond() throws Exception { } @Test - public void testFutureCallPollRPCTimeout() throws Exception { + void testFutureCallPollRPCTimeout() throws Exception { String opName = "testFutureCallPollRPCTimeout"; pollingAlgorithm = OperationTimedPollAlgorithm.create( - FAST_RECHECKING_SETTINGS - .toBuilder() + FAST_RECHECKING_SETTINGS.toBuilder() // Update the polling algorithm to set per-RPC timeouts instead of the default zero. // // This is non-standard, as these fields have been documented as "should be ignored" // for LRO polling. They are not actually ignored in code, so they changing them // here has an actual affect. This test verifies that they work as such, but in // practice generated clients set the RPC timeouts to 0 to be ignored. - .setInitialRpcTimeout(Duration.ofMillis(100)) - .setMaxRpcTimeout(Duration.ofSeconds(1)) + .setInitialRpcTimeoutDuration(java.time.Duration.ofMillis(100)) + .setMaxRpcTimeoutDuration(java.time.Duration.ofSeconds(1)) .setRpcTimeoutMultiplier(2) - .setTotalTimeout(Duration.ofSeconds(5L)) + .setTotalTimeoutDuration(java.time.Duration.ofSeconds(5L)) .build(), clock); callSettings = callSettings.toBuilder().setPollingAlgorithm(pollingAlgorithm).build(); @@ -521,19 +518,22 @@ public void testFutureCallPollRPCTimeout() throws Exception { callable.futureCall(2, FakeCallContext.createDefault()).get(10, TimeUnit.SECONDS); - List actualTimeouts = Lists.newArrayList(); + List actualTimeouts = Lists.newArrayList(); for (ApiCallContext callContext : callContextCaptor.getAllValues()) { - actualTimeouts.add(callContext.getTimeout()); + actualTimeouts.add(callContext.getTimeoutDuration()); } - List expectedTimeouts = - Lists.newArrayList(Duration.ofMillis(100), Duration.ofMillis(200), Duration.ofMillis(400)); + List expectedTimeouts = + Lists.newArrayList( + java.time.Duration.ofMillis(100), + java.time.Duration.ofMillis(200), + java.time.Duration.ofMillis(400)); assertThat(actualTimeouts).isEqualTo(expectedTimeouts); } @Test - public void testFutureCallContextPropagation() throws Exception { + void testFutureCallContextPropagation() throws Exception { String opName = "testFutureCallContextPropagation"; Color resp = getColor(0.5f); @@ -558,15 +558,17 @@ public void testFutureCallContextPropagation() throws Exception { FakeCallableFactory.createOperationCallable( initialCallable, callSettings, initialContext, longRunningClient); - ApiCallContext callContext = FakeCallContext.createDefault().withTimeout(Duration.ofMillis(10)); + ApiCallContext callContext = + FakeCallContext.createDefault().withTimeoutDuration(java.time.Duration.ofMillis(10)); callable.futureCall(2, callContext).get(10, TimeUnit.SECONDS); - assertThat(callContextCaptor.getValue().getTimeout()).isEqualTo(Duration.ofMillis(10)); + assertThat(callContextCaptor.getValue().getTimeoutDuration()) + .isEqualTo(java.time.Duration.ofMillis(10)); } @Test - public void testFutureCallPollDoneOnMany() throws Exception { + void testFutureCallPollDoneOnMany() throws Exception { final int iterationsCount = 1000; String opName = "testFutureCallPollDoneOnMany"; Color resp = getColor(0.5f); @@ -585,9 +587,8 @@ public void testFutureCallPollDoneOnMany() throws Exception { pollingAlgorithm = OperationTimedPollAlgorithm.create( - FAST_RECHECKING_SETTINGS - .toBuilder() - .setTotalTimeout(Duration.ofMillis(iterationsCount)) + FAST_RECHECKING_SETTINGS.toBuilder() + .setTotalTimeoutDuration(java.time.Duration.ofMillis(iterationsCount)) .build(), clock); callSettings = callSettings.toBuilder().setPollingAlgorithm(pollingAlgorithm).build(); @@ -606,7 +607,7 @@ public void testFutureCallPollDoneOnMany() throws Exception { } @Test - public void testFutureCallPollError() throws Exception { + void testFutureCallPollError() throws Exception { String opName = "testFutureCallPollError"; Currency meta = Currency.getInstance("UAH"); Color resp = getColor(1.0f); @@ -628,7 +629,7 @@ public void testFutureCallPollError() throws Exception { } @Test - public void testFutureCallPollDoneWithError() throws Exception { + void testFutureCallPollDoneWithError() throws Exception { String opName = "testFutureCallPollDoneWithError"; Currency meta = Currency.getInstance("UAH"); Color resp = getColor(1.0f); @@ -661,7 +662,7 @@ public void testFutureCallPollDoneWithError() throws Exception { } @Test - public void testFutureCallPollCancelOnTimeoutExceeded() throws Exception { + void testFutureCallPollCancelOnTimeoutExceeded() throws Exception { String opName = "testFutureCallPollCancelOnPollingTimeoutExceeded"; OperationSnapshot initialOperation = getOperation(opName, null, null, null, false); OperationSnapshot resultOperation = getOperation(opName, null, null, null, false); @@ -680,7 +681,7 @@ public void testFutureCallPollCancelOnTimeoutExceeded() throws Exception { } @Test - public void testFutureCallPollCancelOnLongTimeoutExceeded() throws Exception { + void testFutureCallPollCancelOnLongTimeoutExceeded() throws Exception { final int iterationsCount = 1000; String opName = "testFutureCallPollCancelOnLongTimeoutExceeded"; OperationSnapshot initialOperation = getOperation(opName, null, null, null, false); @@ -695,7 +696,9 @@ public void testFutureCallPollCancelOnLongTimeoutExceeded() throws Exception { pollingAlgorithm = OperationTimedPollAlgorithm.create( - FAST_RECHECKING_SETTINGS.toBuilder().setTotalTimeout(Duration.ofMillis(1000L)).build(), + FAST_RECHECKING_SETTINGS.toBuilder() + .setTotalTimeoutDuration(java.time.Duration.ofMillis(1000L)) + .build(), clock); callSettings = callSettings.toBuilder().setPollingAlgorithm(pollingAlgorithm).build(); @@ -711,7 +714,7 @@ public void testFutureCallPollCancelOnLongTimeoutExceeded() throws Exception { } @Test - public void testFutureCancelImmediately() throws Exception { + void testFutureCancelImmediately() throws Exception { int iterationsCount = 3; String opName = "testCancelImmediately"; Color resp = getColor(0.5f); @@ -747,7 +750,7 @@ public void testFutureCancelImmediately() throws Exception { } @Test - public void testFutureCancelInTheMiddle() throws Exception { + void testFutureCancelInTheMiddle() throws Exception { int iterationsCount = 1000; String opName = "testCancelInTheMiddle"; Color resp = getColor(0.5f); @@ -779,7 +782,7 @@ public void testFutureCancelInTheMiddle() throws Exception { } @Test - public void testInitialServerSideCancel() throws Exception { + void testInitialServerSideCancel() throws Exception { String opName = "testInitialServerSideCancel"; StatusCode errorCode = FakeStatusCode.of(StatusCode.Code.CANCELLED); Currency meta = Currency.getInstance("UAH"); @@ -808,7 +811,7 @@ public void testInitialServerSideCancel() throws Exception { } @Test - public void testPollServerSideCancel() throws Exception { + void testPollServerSideCancel() throws Exception { String opName = "testPollServerSideCancel"; StatusCode errorCode = FakeStatusCode.of(StatusCode.Code.CANCELLED); Currency meta = Currency.getInstance("UAH"); @@ -840,7 +843,7 @@ public void testPollServerSideCancel() throws Exception { } @Test - public void call() { + void call() { ApiCallContext defaultCallContext = FakeCallContext.createDefault(); OperationStashCallable stashCallable = new OperationStashCallable(); OperationCallable callable = @@ -852,7 +855,7 @@ public void call() { } @Test - public void callWithContext() { + void callWithContext() { FakeChannel channel = new FakeChannel(); Credentials credentials = Mockito.mock(Credentials.class); ApiCallContext context = @@ -869,7 +872,7 @@ public void callWithContext() { } @Test - public void callResume() throws Exception { + void callResume() throws Exception { ApiCallContext defaultCallContext = FakeCallContext.createDefault(); OperationStashCallable stashCallable = new OperationStashCallable(); OperationCallable callable = @@ -883,7 +886,7 @@ public void callResume() throws Exception { } @Test - public void callResumeWithContext() throws Exception { + void callResumeWithContext() throws Exception { FakeChannel channel = new FakeChannel(); Credentials credentials = Mockito.mock(Credentials.class); ApiCallContext context = @@ -902,7 +905,7 @@ public void callResumeWithContext() throws Exception { } @Test - public void callCancel() throws Exception { + void callCancel() throws Exception { ApiCallContext defaultCallContext = FakeCallContext.createDefault(); OperationStashCallable stashCallable = new OperationStashCallable(); OperationCallable callable = @@ -916,7 +919,7 @@ public void callCancel() throws Exception { } @Test - public void callCancelWithContext() throws Exception { + void callCancelWithContext() throws Exception { FakeChannel channel = new FakeChannel(); Credentials credentials = Mockito.mock(Credentials.class); ApiCallContext context = @@ -1165,8 +1168,8 @@ private UnaryCallable mockGetOpSnapshotC public ApiFuture futureCall(RequestT request, ApiCallContext context) { FakeCallContext fakeCallContext = (FakeCallContext) context; if (fakeCallContext != null - && fakeCallContext.getTimeout() != null - && fakeCallContext.getTimeout().isZero()) { + && fakeCallContext.getTimeoutDuration() != null + && fakeCallContext.getTimeoutDuration().isZero()) { throw new DeadlineExceededException( "Invalid timeout of 0 s", null, @@ -1255,48 +1258,48 @@ private void assertExceptionMatchesCode(FakeStatusCode code, Throwable exception case CANCELLED: expectedClass = CancelledException.class; break; - // case NOT_FOUND: - // expectedClass = NotFoundException.class; - // break; + // case NOT_FOUND: + // expectedClass = NotFoundException.class; + // break; case UNKNOWN: expectedClass = UnknownException.class; break; - // case INVALID_ARGUMENT: - // expectedClass = InvalidArgumentException.class; - // break; + // case INVALID_ARGUMENT: + // expectedClass = InvalidArgumentException.class; + // break; case DEADLINE_EXCEEDED: expectedClass = DeadlineExceededException.class; break; case ALREADY_EXISTS: expectedClass = AlreadyExistsException.class; break; - // case PERMISSION_DENIED: - // expectedClass = PermissionDeniedException.class; - // break; - // case RESOURCE_EXHAUSTED: - // expectedClass = ResourceExhaustedException.class; - // break; + // case PERMISSION_DENIED: + // expectedClass = PermissionDeniedException.class; + // break; + // case RESOURCE_EXHAUSTED: + // expectedClass = ResourceExhaustedException.class; + // break; case FAILED_PRECONDITION: expectedClass = FailedPreconditionException.class; break; - // case ABORTED: - // expectedClass = AbortedException.class; - // break; - // case OUT_OF_RANGE: - // expectedClass = OutOfRangeException.class; - // break; - // case INTERNAL: - // expectedClass = InternalException.class; - // break; + // case ABORTED: + // expectedClass = AbortedException.class; + // break; + // case OUT_OF_RANGE: + // expectedClass = OutOfRangeException.class; + // break; + // case INTERNAL: + // expectedClass = InternalException.class; + // break; case UNAVAILABLE: expectedClass = UnavailableException.class; break; - // case DATA_LOSS: - // expectedClass = DataLossException.class; - // break; - // case UNAUTHENTICATED: - // expectedClass = UnauthenticatedException.class; - // break; + // case DATA_LOSS: + // expectedClass = DataLossException.class; + // break; + // case UNAUTHENTICATED: + // expectedClass = UnauthenticatedException.class; + // break; default: expectedClass = ApiException.class; diff --git a/gax-java/gax/src/test/java/com/google/api/gax/rpc/PagedCallSettingsTest.java b/gax-java/gax/src/test/java/com/google/api/gax/rpc/PagedCallSettingsTest.java index 25c6b8064f..71b8af6490 100644 --- a/gax-java/gax/src/test/java/com/google/api/gax/rpc/PagedCallSettingsTest.java +++ b/gax-java/gax/src/test/java/com/google/api/gax/rpc/PagedCallSettingsTest.java @@ -34,17 +34,13 @@ import com.google.common.collect.Sets; import com.google.common.truth.Truth; import java.util.Set; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.junit.runners.JUnit4; +import org.junit.jupiter.api.Test; import org.mockito.Mockito; -import org.threeten.bp.Duration; -@RunWith(JUnit4.class) -public class PagedCallSettingsTest { +class PagedCallSettingsTest { @Test - public void testEmptyBuilder() { + void testEmptyBuilder() { @SuppressWarnings("unchecked") PagedListResponseFactory pagedListResponseFactory = Mockito.mock(PagedListResponseFactory.class); @@ -65,7 +61,7 @@ public void testEmptyBuilder() { } @Test - public void testBuilder() { + void testBuilder() { @SuppressWarnings("unchecked") PagedListResponseFactory pagedListResponseFactory = Mockito.mock(PagedListResponseFactory.class); @@ -75,11 +71,11 @@ public void testBuilder() { Set retryCodes = Sets.newHashSet(Code.UNAVAILABLE); RetrySettings retrySettings = RetrySettings.newBuilder() - .setInitialRetryDelay(Duration.ofMillis(5)) - .setMaxRetryDelay(Duration.ofSeconds(1)) + .setInitialRetryDelayDuration(java.time.Duration.ofMillis(5)) + .setMaxRetryDelayDuration(java.time.Duration.ofSeconds(1)) .setRetryDelayMultiplier(2) - .setInitialRpcTimeout(Duration.ofMillis(100)) - .setMaxRpcTimeout(Duration.ofMillis(200)) + .setInitialRpcTimeoutDuration(java.time.Duration.ofMillis(100)) + .setMaxRpcTimeoutDuration(java.time.Duration.ofMillis(200)) .setRpcTimeoutMultiplier(1.1) .setJittered(true) .setMaxAttempts(10) @@ -98,7 +94,7 @@ public void testBuilder() { } @Test - public void testBuilderFromSettings() throws Exception { + void testBuilderFromSettings() throws Exception { @SuppressWarnings("unchecked") PagedListResponseFactory pagedListResponseFactory = Mockito.mock(PagedListResponseFactory.class); @@ -108,11 +104,11 @@ public void testBuilderFromSettings() throws Exception { Set retryCodes = Sets.newHashSet(Code.UNAVAILABLE); RetrySettings retrySettings = RetrySettings.newBuilder() - .setInitialRetryDelay(Duration.ofMillis(5)) - .setMaxRetryDelay(Duration.ofSeconds(1)) + .setInitialRetryDelayDuration(java.time.Duration.ofMillis(5)) + .setMaxRetryDelayDuration(java.time.Duration.ofSeconds(1)) .setRetryDelayMultiplier(2) - .setInitialRpcTimeout(Duration.ofMillis(100)) - .setMaxRpcTimeout(Duration.ofMillis(200)) + .setInitialRpcTimeoutDuration(java.time.Duration.ofMillis(100)) + .setMaxRpcTimeoutDuration(java.time.Duration.ofMillis(200)) .setRpcTimeoutMultiplier(1.1) .setJittered(true) .setMaxAttempts(10) diff --git a/gax-java/gax/src/test/java/com/google/api/gax/rpc/PagedCallableTest.java b/gax-java/gax/src/test/java/com/google/api/gax/rpc/PagedCallableTest.java index de1dfaf6b6..bbec56d695 100644 --- a/gax-java/gax/src/test/java/com/google/api/gax/rpc/PagedCallableTest.java +++ b/gax-java/gax/src/test/java/com/google/api/gax/rpc/PagedCallableTest.java @@ -38,15 +38,12 @@ import java.util.Arrays; import java.util.Collections; import java.util.List; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.junit.runners.JUnit4; +import org.junit.jupiter.api.Test; -@RunWith(JUnit4.class) -public class PagedCallableTest { +class PagedCallableTest { @Test - public void futureCall() { + void futureCall() { List> results = Arrays.asList( Arrays.asList(0, 1, 2), Arrays.asList(3, 4), Collections.emptyList()); @@ -62,7 +59,7 @@ public void futureCall() { } @Test - public void testToString() { + void testToString() { PagedStashCallable stash = new PagedStashCallable(null); PagedCallable, ListIntegersPagedResponse> pagedCallable = new PagedCallable<>(stash, new ListIntegersPagedResponseFactory()); diff --git a/gax-java/gax/src/test/java/com/google/api/gax/rpc/PagingTest.java b/gax-java/gax/src/test/java/com/google/api/gax/rpc/PagingTest.java index e1655b6bf7..84a4e4ae79 100644 --- a/gax-java/gax/src/test/java/com/google/api/gax/rpc/PagingTest.java +++ b/gax-java/gax/src/test/java/com/google/api/gax/rpc/PagingTest.java @@ -29,6 +29,8 @@ */ package com.google.api.gax.rpc; +import static org.junit.jupiter.api.Assertions.assertThrows; + import com.google.api.core.ApiFutures; import com.google.api.gax.paging.FixedSizeCollection; import com.google.api.gax.paging.Page; @@ -44,19 +46,16 @@ import java.util.Arrays; import java.util.Collections; import java.util.List; -import org.junit.Before; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.junit.runners.JUnit4; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; import org.mockito.ArgumentCaptor; import org.mockito.Mockito; -@RunWith(JUnit4.class) -public class PagingTest { +class PagingTest { private ClientContext clientContext; - @Before - public void setUp() { + @BeforeEach + void setUp() { clientContext = ClientContext.newBuilder() .setDefaultCallContext(FakeCallContext.createDefault()) @@ -68,7 +67,7 @@ public void setUp() { UnaryCallable> callIntList = Mockito.mock(UnaryCallable.class); @Test - public void nonPaged() { + void nonPaged() { ArgumentCaptor requestCapture = ArgumentCaptor.forClass(Integer.class); Mockito.when(callIntList.futureCall(requestCapture.capture(), (ApiCallContext) Mockito.any())) .thenReturn(ApiFutures.immediateFuture(Arrays.asList(0, 1, 2))) @@ -86,7 +85,7 @@ public void nonPaged() { } @Test - public void paged() { + void paged() { ArgumentCaptor requestCapture = ArgumentCaptor.forClass(Integer.class); Mockito.when(callIntList.futureCall(requestCapture.capture(), (ApiCallContext) Mockito.any())) .thenReturn(ApiFutures.immediateFuture(Arrays.asList(0, 1, 2))) @@ -104,7 +103,7 @@ public void paged() { } @Test - public void pagedByPage() { + void pagedByPage() { ArgumentCaptor requestCapture = ArgumentCaptor.forClass(Integer.class); Mockito.when(callIntList.futureCall(requestCapture.capture(), (ApiCallContext) Mockito.any())) .thenReturn(ApiFutures.immediateFuture(Arrays.asList(0, 1, 2))) @@ -134,7 +133,55 @@ public void pagedByPage() { } @Test - public void pagedByFixedSizeCollection() { + void streamValues_streamIsCorrectPerPage() { + ArgumentCaptor requestCapture = ArgumentCaptor.forClass(Integer.class); + Mockito.when(callIntList.futureCall(requestCapture.capture(), Mockito.any())) + .thenReturn(ApiFutures.immediateFuture(Arrays.asList(0, 1, 2))) + .thenReturn(ApiFutures.immediateFuture(Arrays.asList(3, 4))) + .thenReturn(ApiFutures.immediateFuture(Collections.emptyList())); + + Page page = + FakeCallableFactory.createPagedCallable( + callIntList, + PagedCallSettings.newBuilder(new ListIntegersPagedResponseFactory()).build(), + clientContext) + .call(0) + .getPage(); + + Truth.assertThat(page.streamValues().count()).isEqualTo(3); + Truth.assertThat(page.hasNextPage()).isTrue(); + + page = page.getNextPage(); + Truth.assertThat(page.streamValues().count()).isEqualTo(2); + Truth.assertThat(page.hasNextPage()).isTrue(); + + page = page.getNextPage(); + Truth.assertThat(page.streamValues().count()).isEqualTo(0); + Truth.assertThat(page.hasNextPage()).isFalse(); + Truth.assertThat(page.getNextPage()).isNull(); + } + + @Test + void streamAll_streamIsCorrectInAllPages() { + ArgumentCaptor requestCapture = ArgumentCaptor.forClass(Integer.class); + Mockito.when(callIntList.futureCall(requestCapture.capture(), Mockito.any())) + .thenReturn(ApiFutures.immediateFuture(Arrays.asList(0, 1, 2))) + .thenReturn(ApiFutures.immediateFuture(Arrays.asList(3, 4))) + .thenReturn(ApiFutures.immediateFuture(Collections.emptyList())); + + Page page = + FakeCallableFactory.createPagedCallable( + callIntList, + PagedCallSettings.newBuilder(new ListIntegersPagedResponseFactory()).build(), + clientContext) + .call(0) + .getPage(); + + Truth.assertThat(page.streamAll().count()).isEqualTo(5); + } + + @Test + void pagedByFixedSizeCollection() { ArgumentCaptor requestCapture = ArgumentCaptor.forClass(Integer.class); Mockito.when(callIntList.futureCall(requestCapture.capture(), (ApiCallContext) Mockito.any())) .thenReturn(ApiFutures.immediateFuture(Arrays.asList(0, 1, 2))) @@ -156,32 +203,38 @@ public void pagedByFixedSizeCollection() { Truth.assertThat(requestCapture.getAllValues()).containsExactly(0, 2, 4, 7).inOrder(); } - @Test(expected = ValidationException.class) - public void pagedFixedSizeCollectionTooManyElements() { + @Test + void pagedFixedSizeCollectionTooManyElements() { Mockito.when(callIntList.futureCall((Integer) Mockito.any(), (ApiCallContext) Mockito.any())) .thenReturn(ApiFutures.immediateFuture(Arrays.asList(0, 1, 2))) .thenReturn(ApiFutures.immediateFuture(Arrays.asList(3, 4))) .thenReturn(ApiFutures.immediateFuture(Collections.emptyList())); - FakeCallableFactory.createPagedCallable( - callIntList, - PagedCallSettings.newBuilder(new ListIntegersPagedResponseFactory()).build(), - clientContext) - .call(0) - .expandToFixedSizeCollection(4); + assertThrows( + ValidationException.class, + () -> + FakeCallableFactory.createPagedCallable( + callIntList, + PagedCallSettings.newBuilder(new ListIntegersPagedResponseFactory()).build(), + clientContext) + .call(0) + .expandToFixedSizeCollection(4)); } - @Test(expected = ValidationException.class) - public void pagedFixedSizeCollectionTooSmallCollectionSize() { + @Test + void pagedFixedSizeCollectionTooSmallCollectionSize() { Mockito.when(callIntList.futureCall((Integer) Mockito.any(), (ApiCallContext) Mockito.any())) .thenReturn(ApiFutures.immediateFuture(Arrays.asList(0, 1))) .thenReturn(ApiFutures.immediateFuture(Collections.emptyList())); - FakeCallableFactory.createPagedCallable( - callIntList, - PagedCallSettings.newBuilder(new ListIntegersPagedResponseFactory()).build(), - clientContext) - .call(0) - .expandToFixedSizeCollection(2); + assertThrows( + ValidationException.class, + () -> + FakeCallableFactory.createPagedCallable( + callIntList, + PagedCallSettings.newBuilder(new ListIntegersPagedResponseFactory()).build(), + clientContext) + .call(0) + .expandToFixedSizeCollection(2)); } } diff --git a/gax-java/gax/src/test/java/com/google/api/gax/rpc/RequestParamsBuilderTest.java b/gax-java/gax/src/test/java/com/google/api/gax/rpc/RequestParamsBuilderTest.java index 30f4d7e628..7cdfbc1542 100644 --- a/gax-java/gax/src/test/java/com/google/api/gax/rpc/RequestParamsBuilderTest.java +++ b/gax-java/gax/src/test/java/com/google/api/gax/rpc/RequestParamsBuilderTest.java @@ -34,23 +34,20 @@ import com.google.api.pathtemplate.PathTemplate; import java.util.Map; -import org.junit.Before; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.junit.runners.JUnit4; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; -@RunWith(JUnit4.class) -public class RequestParamsBuilderTest { +class RequestParamsBuilderTest { private RequestParamsBuilder requestParamsBuilder; - @Before - public void setUp() { + @BeforeEach + void setUp() { requestParamsBuilder = RequestParamsBuilder.create(); } @Test - public void add_happyPath() { + void add_happyPath() { Map actual = getRoutingHeaders( "projects/**/{table_location=instances/*}", @@ -59,7 +56,30 @@ public void add_happyPath() { } @Test - public void build_shouldKeepLastEntryIfMultipleEntriesHaveTheSameKeyRatherThanErrorOut() { + void add_twoParams_happyPath() { + requestParamsBuilder.add("table_location", "instances/living_room"); + Map actual = requestParamsBuilder.build(); + assertThat(actual).containsExactly("table_location", "instances/living_room"); + } + + @Test + void add_containsNonEncodedHeaderAndValue() { + PathTemplate pathTemplate = PathTemplate.create("projects/**/{table$$_++location=instances/*}"); + requestParamsBuilder.add( + "projects/my_cozy_home/instances/living_room", "table$$_++location", pathTemplate); + Map actual = requestParamsBuilder.build(); + assertThat(actual).containsExactly("table$$_++location", "instances/living_room"); + } + + @Test + void add_twoParams_containsNonEncodedHeaderAndValue() { + requestParamsBuilder.add("table$$_++location", "instances/living_room"); + Map actual = requestParamsBuilder.build(); + assertThat(actual).containsExactly("table$$_++location", "instances/living_room"); + } + + @Test + void build_shouldKeepLastEntryIfMultipleEntriesHaveTheSameKeyRatherThanErrorOut() { requestParamsBuilder.add( "projects/my_cozy_home/instances/living_room", "table_location", @@ -85,24 +105,68 @@ public void build_shouldKeepLastEntryIfMultipleEntriesHaveTheSameKeyRatherThanEr } @Test - public void add_matchedValuesWithNoRoutingHeaderKey() { + void add_matchedValuesWithNoRoutingHeaderKey() { Map actual = getRoutingHeaders("projects/**", "projects/my_cozy_home/"); assertThat(actual).isEmpty(); } @Test - public void add_emptyMatchedValues() { + void add_emptyMatchedValues() { Map actual = getRoutingHeaders("projects/**/{table_location=instances/*}", "projects/does_not_matter"); assertThat(actual).isEmpty(); } @Test - public void add_nullFieldValue() { + void add_nullFieldValue() { Map actual = getRoutingHeaders("projects/**", null); assertThat(actual).isEmpty(); } + @Test + void addWithTwoParams_nullFieldValue() { + requestParamsBuilder.add("test", null); + Map actual = requestParamsBuilder.build(); + assertThat(actual).isEmpty(); + } + + @Test + void add_emptyString_noMatches() { + // protobuf's default value for string is empty string. The `**` pathtemplate would match + // for empty string if it's not explicitly filtered out + Map actual = getRoutingHeaders("{table_location=**}", ""); + assertThat(actual).isEmpty(); + } + + @Test + void addWithTwoParams_emptyString_noMatches() { + // protobuf's default value for string is empty string. The `**` pathtemplate would match + // for empty string if it's not explicitly filtered out + Map actual = getRoutingHeaders("{table_location=**}", ""); + assertThat(actual).isEmpty(); + } + + @Test + void add_nullHeader_noMatches() { + requestParamsBuilder.add(null, "projects/does_not_matter"); + Map actual = requestParamsBuilder.build(); + assertThat(actual).isEmpty(); + } + + @Test + void addWithTwoParams_nullHeader_noMatches() { + requestParamsBuilder.add(null, "hello"); + Map actual = requestParamsBuilder.build(); + assertThat(actual).isEmpty(); + } + + @Test + void addWithTwoParams_emptyHeader_noMatches() { + requestParamsBuilder.add("", "hello"); + Map actual = requestParamsBuilder.build(); + assertThat(actual).isEmpty(); + } + private Map getRoutingHeaders(String patternString, String fieldValue) { PathTemplate pathTemplate = PathTemplate.create(patternString); requestParamsBuilder.add(fieldValue, "table_location", pathTemplate); diff --git a/gax-java/gax/src/test/java/com/google/api/gax/rpc/RequestUrlParamsEncoderTest.java b/gax-java/gax/src/test/java/com/google/api/gax/rpc/RequestUrlParamsEncoderTest.java index 3239bd148f..42f10db6d3 100644 --- a/gax-java/gax/src/test/java/com/google/api/gax/rpc/RequestUrlParamsEncoderTest.java +++ b/gax-java/gax/src/test/java/com/google/api/gax/rpc/RequestUrlParamsEncoderTest.java @@ -30,99 +30,100 @@ package com.google.api.gax.rpc; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertEquals; import static org.mockito.Mockito.when; import com.google.common.collect.ImmutableMap; import java.util.Collections; import java.util.Map; -import org.junit.Test; +import org.junit.jupiter.api.Test; import org.mockito.Mockito; -public class RequestUrlParamsEncoderTest { +class RequestUrlParamsEncoderTest { - @Test - public void testEncodeValidationSuccess() throws Exception { - @SuppressWarnings("unchecked") - RequestParamsExtractor extractor = - getMockExtractor(2, ImmutableMap.of("param1", "value+1", "param2", "value+2+%26")); + private final String key = "key"; - RequestUrlParamsEncoder encoder = new RequestUrlParamsEncoder<>(extractor, true); - String encodedParams = encoder.encode(2); - - assertEquals("param1=value+1¶m2=value+2+%26", encodedParams); - } + @Test + void testEncode() { + RequestParamsExtractor extractor = getMockExtractor(ImmutableMap.of("param", "value")); + RequestUrlParamsEncoder encoder = new RequestUrlParamsEncoder<>(extractor); + String encodedParams = encoder.encode(key); - @Test(expected = IllegalArgumentException.class) - public void testEncodeValidationFail() throws Exception { - RequestParamsExtractor extractor = - getMockExtractor(1, ImmutableMap.of("param1", "value+1", "param2", "value+2+&")); - RequestUrlParamsEncoder encoder = new RequestUrlParamsEncoder<>(extractor, true); - encoder.encode(1); + assertEquals("param=value", encodedParams); } @Test - public void testEncodeNoValidationSuccess() throws Exception { - RequestParamsExtractor extractor = - getMockExtractor(1, ImmutableMap.of("param1", "value+1", "param2", "value+2+&")); - RequestUrlParamsEncoder encoder = new RequestUrlParamsEncoder<>(extractor, false); - String encodedParams = encoder.encode(1); - - assertEquals("param1=value+1¶m2=value+2+&", encodedParams); - } + void testEncode_multipleEntriesConcatenation() { + RequestParamsExtractor extractor = + getMockExtractor(ImmutableMap.of("param1", "value1", "param2", "value2")); + RequestUrlParamsEncoder encoder = new RequestUrlParamsEncoder<>(extractor); + String encodedParams = encoder.encode(key); - @Test(expected = IllegalArgumentException.class) - public void testEncodeNullName() throws Exception { - RequestParamsExtractor extractor = - getMockExtractor(1, Collections.singletonMap((String) null, "value1")); - RequestUrlParamsEncoder encoder = new RequestUrlParamsEncoder<>(extractor, false); - encoder.encode(1); + assertEquals("param1=value1¶m2=value2", encodedParams); } @Test - public void testEncodeNullValue() throws Exception { - RequestParamsExtractor extractor = - getMockExtractor(1, Collections.singletonMap("param1", (String) null)); - RequestUrlParamsEncoder encoder = new RequestUrlParamsEncoder<>(extractor, false); - String encodedParams = encoder.encode(1); - assertEquals("", encodedParams); - } + void testEncode_multipleEntriesConcatenation_encodedKeyAndValues() { + RequestParamsExtractor extractor = + getMockExtractor(ImmutableMap.of("param1!@#", "value+1", "param2()", "value+2+&")); + RequestUrlParamsEncoder encoder = new RequestUrlParamsEncoder<>(extractor); + String encodedParams = encoder.encode(key); - @Test - public void testEncodeEmptyValue() throws Exception { - RequestParamsExtractor extractor = - getMockExtractor(1, Collections.singletonMap("param1", "")); - RequestUrlParamsEncoder encoder = new RequestUrlParamsEncoder<>(extractor, false); - String encodedParams = encoder.encode(1); - assertEquals("param1=", encodedParams); + assertEquals("param1%21%40%23=value%2B1¶m2%28%29=value%2B2%2B%26", encodedParams); } @Test - public void testEncodeNullAndEmptyParams() throws Exception { - RequestParamsExtractor extractor = - getMockExtractor(1, Collections.emptyMap()); - RequestUrlParamsEncoder encoder = new RequestUrlParamsEncoder<>(extractor, false); - String encodedParams = encoder.encode(1); + void testEncodeEmptyMap() { + RequestParamsExtractor extractor = getMockExtractor(Collections.emptyMap()); + RequestUrlParamsEncoder encoder = new RequestUrlParamsEncoder<>(extractor); + String encodedParams = encoder.encode(key); assertEquals("", encodedParams); - - extractor = getMockExtractor(1, null); - encoder = new RequestUrlParamsEncoder<>(extractor, false); - NullPointerException exception = null; - try { - encoder.encode(1); - } catch (NullPointerException e) { - exception = e; - } - assertNotNull(exception); } - private RequestParamsExtractor getMockExtractor( - Integer input, Map output) { + private RequestParamsExtractor getMockExtractor(Map output) { @SuppressWarnings("unchecked") - RequestParamsExtractor extractor = - (RequestParamsExtractor) Mockito.mock(RequestParamsExtractor.class); - when(extractor.extract(input)).thenReturn(output); + RequestParamsExtractor extractor = + (RequestParamsExtractor) Mockito.mock(RequestParamsExtractor.class); + when(extractor.extract(key)).thenReturn(output); return extractor; } + + @Test + void percentEncodeString_shouldEncodeAllSpecialCharacter() { + String[] specialCharactersToEncode = { + "xy", "x/y", "x;y", "(xy)", "x-y", "x_y", "x+y", "x%y", "x.y", "x~y", "x?y", "x&y", "x#y", + "[xy]", "x$y", "x y", "x\\y", "x😀y", "x€y", "x,y", "x=y" + }; + + String[] expectedEncodedSpecialCharacters = { + "xy", + "x%2Fy", + "x%3By", + "%28xy%29", + "x-y", + "x_y", + "x%2By", + "x%25y", + "x.y", + "x~y", + "x%3Fy", + "x%26y", + "x%23y", + "%5Bxy%5D", + "x%24y", + "x%20y", + "x%5Cy", + "x%F0%9F%98%80y", + "x%E2%82%ACy", + "x%2Cy", + "x%3Dy" + }; + RequestUrlParamsEncoder encoder = + new RequestUrlParamsEncoder<>(getMockExtractor(Collections.emptyMap())); + + for (int i = 0; i < specialCharactersToEncode.length; i++) { + String actual = encoder.percentEncodeString(specialCharactersToEncode[i]); + assertEquals(actual, expectedEncodedSpecialCharacters[i]); + } + } } diff --git a/gax-java/gax/src/test/java/com/google/api/gax/rpc/RetryingCallableTest.java b/gax-java/gax/src/test/java/com/google/api/gax/rpc/RetryingCallableTest.java new file mode 100644 index 0000000000..b7d1a01153 --- /dev/null +++ b/gax-java/gax/src/test/java/com/google/api/gax/rpc/RetryingCallableTest.java @@ -0,0 +1,74 @@ +/* + * Copyright 2024 Google LLC + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Google LLC nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +package com.google.api.gax.rpc; + +import static org.mockito.Mockito.when; + +import com.google.api.gax.retrying.RetrySettings; +import com.google.api.gax.retrying.RetryingExecutorWithContext; +import com.google.api.gax.retrying.RetryingFuture; +import com.google.api.gax.retrying.TimedAttemptSettings; +import com.google.api.gax.rpc.testing.FakeCallContext; +import java.util.concurrent.Callable; +import org.junit.jupiter.api.Test; +import org.mockito.Mockito; +import org.threeten.bp.Duration; +import org.threeten.bp.temporal.ChronoUnit; + +class RetryingCallableTest { + @Test + void futureCall() { + FakeCallContext fakeCallContext = FakeCallContext.createDefault(); + UnaryCallable innerCallable = Mockito.mock(UnaryCallable.class); + RetryingExecutorWithContext executor = Mockito.mock(RetryingExecutorWithContext.class); + RetryingFuture retryingFuture = Mockito.mock(RetryingFuture.class); + TimedAttemptSettings fakeAttemptSettings = + TimedAttemptSettings.newBuilder() + .setRpcTimeout(Duration.of(1, ChronoUnit.SECONDS)) + .setAttemptCount(3) + .setGlobalSettings(RetrySettings.newBuilder().build()) + .setRetryDelay(Duration.of(1, ChronoUnit.SECONDS)) + .setRandomizedRetryDelay(Duration.of(1, ChronoUnit.SECONDS)) + .setFirstAttemptStartTimeNanos(5) + .build(); + + when(retryingFuture.getAttemptSettings()).thenReturn(fakeAttemptSettings); + when(executor.createFuture(Mockito.any(Callable.class), Mockito.eq(fakeCallContext))) + .thenReturn(retryingFuture); + Integer modifiedRequest = 5; + RequestMutator requestMutator = request -> modifiedRequest; + RetryingCallable retryingCallable = + new RetryingCallable<>(fakeCallContext, innerCallable, executor, requestMutator); + + retryingCallable.futureCall(1, fakeCallContext); + Mockito.verify(innerCallable) + .futureCall(Mockito.eq(modifiedRequest), Mockito.any(ApiCallContext.class)); + } +} diff --git a/gax-java/gax/src/test/java/com/google/api/gax/rpc/RetryingTest.java b/gax-java/gax/src/test/java/com/google/api/gax/rpc/RetryingTest.java index b58bd2c2c4..92c2874344 100644 --- a/gax-java/gax/src/test/java/com/google/api/gax/rpc/RetryingTest.java +++ b/gax-java/gax/src/test/java/com/google/api/gax/rpc/RetryingTest.java @@ -29,8 +29,9 @@ */ package com.google.api.gax.rpc; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.fail; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertThrows; +import static org.junit.jupiter.api.Assertions.fail; import com.google.api.core.ApiFuture; import com.google.api.core.ApiFutures; @@ -48,17 +49,12 @@ import com.google.common.truth.Truth; import com.google.common.util.concurrent.Futures; import com.google.common.util.concurrent.UncheckedExecutionException; -import org.junit.After; -import org.junit.Assert; -import org.junit.Before; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.junit.runners.JUnit4; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; import org.mockito.Mockito; -import org.threeten.bp.Duration; -@RunWith(JUnit4.class) -public class RetryingTest { +class RetryingTest { @SuppressWarnings("unchecked") private UnaryCallable callInt = Mockito.mock(UnaryCallable.class); @@ -69,28 +65,28 @@ public class RetryingTest { private static final RetrySettings FAST_RETRY_SETTINGS = RetrySettings.newBuilder() - .setInitialRetryDelay(Duration.ofMillis(2L)) + .setInitialRetryDelayDuration(java.time.Duration.ofMillis(2L)) .setRetryDelayMultiplier(1) - .setMaxRetryDelay(Duration.ofMillis(2L)) - .setInitialRpcTimeout(Duration.ofMillis(2L)) + .setMaxRetryDelayDuration(java.time.Duration.ofMillis(2L)) + .setInitialRpcTimeoutDuration(java.time.Duration.ofMillis(2L)) .setRpcTimeoutMultiplier(1) - .setMaxRpcTimeout(Duration.ofMillis(2L)) - .setTotalTimeout(Duration.ofMillis(10L)) + .setMaxRpcTimeoutDuration(java.time.Duration.ofMillis(2L)) + .setTotalTimeoutDuration(java.time.Duration.ofMillis(10L)) .build(); private static final RetrySettings FAILING_RETRY_SETTINGS = RetrySettings.newBuilder() .setMaxAttempts(2) - .setInitialRetryDelay(Duration.ofNanos(0L)) + .setInitialRetryDelayDuration(java.time.Duration.ofNanos(0L)) .setRetryDelayMultiplier(1) - .setMaxRetryDelay(Duration.ofMillis(0L)) - .setInitialRpcTimeout(Duration.ofNanos(1L)) + .setMaxRetryDelayDuration(java.time.Duration.ofMillis(0L)) + .setInitialRpcTimeoutDuration(java.time.Duration.ofNanos(1L)) .setRpcTimeoutMultiplier(1) - .setMaxRpcTimeout(Duration.ofNanos(1L)) - .setTotalTimeout(Duration.ofNanos(1L)) + .setMaxRpcTimeoutDuration(java.time.Duration.ofNanos(1L)) + .setTotalTimeoutDuration(java.time.Duration.ofNanos(1L)) .build(); - @Before - public void resetClock() { + @BeforeEach + void resetClock() { fakeClock = new FakeApiClock(System.nanoTime()); executor = RecordingScheduler.create(fakeClock); clientContext = @@ -102,8 +98,8 @@ public void resetClock() { .build(); } - @After - public void teardown() { + @AfterEach + void teardown() { executor.shutdownNow(); } @@ -112,7 +108,7 @@ static ApiFuture immediateFailedFuture(Throwable t) { } @Test - public void retry() { + void retry() { Throwable throwable = new UnavailableException(null, FakeStatusCode.of(StatusCode.Code.UNAVAILABLE), true); Mockito.when(callInt.futureCall((Integer) Mockito.any(), (ApiCallContext) Mockito.any())) @@ -125,7 +121,7 @@ public void retry() { } @Test - public void retryUsingContext() { + void retryUsingContext() { Throwable throwable = new UnavailableException(null, FakeStatusCode.of(StatusCode.Code.INTERNAL), false); Mockito.when(callInt.futureCall(Mockito.any(), Mockito.any())) @@ -141,8 +137,8 @@ public void retryUsingContext() { .withRetryableCodes(Sets.newHashSet(StatusCode.Code.INTERNAL))); } - @Test(expected = ApiException.class) - public void retryTotalTimeoutExceeded() { + @Test + void retryTotalTimeoutExceeded() { Throwable throwable = new UnavailableException(null, FakeStatusCode.of(StatusCode.Code.UNAVAILABLE), true); Mockito.when(callInt.futureCall((Integer) Mockito.any(), (ApiCallContext) Mockito.any())) @@ -150,17 +146,16 @@ public void retryTotalTimeoutExceeded() { .thenReturn(ApiFutures.immediateFuture(2)); RetrySettings retrySettings = - FAST_RETRY_SETTINGS - .toBuilder() - .setInitialRetryDelay(Duration.ofMillis(Integer.MAX_VALUE)) - .setMaxRetryDelay(Duration.ofMillis(Integer.MAX_VALUE)) + FAST_RETRY_SETTINGS.toBuilder() + .setInitialRetryDelayDuration(java.time.Duration.ofMillis(Integer.MAX_VALUE)) + .setMaxRetryDelayDuration(java.time.Duration.ofMillis(Integer.MAX_VALUE)) .build(); - assertRetrying(retrySettings); + assertThrows(ApiException.class, () -> assertRetrying(retrySettings)); } @Test - public void retryUsingContextTotalTimeoutExceeded() { + void retryUsingContextTotalTimeoutExceeded() { Throwable throwable = new UnavailableException(null, FakeStatusCode.of(StatusCode.Code.INTERNAL), false); Mockito.when(callInt.futureCall((Integer) Mockito.any(), (ApiCallContext) Mockito.any())) @@ -168,10 +163,9 @@ public void retryUsingContextTotalTimeoutExceeded() { .thenReturn(ApiFutures.immediateFuture(2)); RetrySettings retrySettings = - FAST_RETRY_SETTINGS - .toBuilder() - .setInitialRetryDelay(Duration.ofMillis(Integer.MAX_VALUE)) - .setMaxRetryDelay(Duration.ofMillis(Integer.MAX_VALUE)) + FAST_RETRY_SETTINGS.toBuilder() + .setInitialRetryDelayDuration(java.time.Duration.ofMillis(Integer.MAX_VALUE)) + .setMaxRetryDelayDuration(java.time.Duration.ofMillis(Integer.MAX_VALUE)) .build(); try { @@ -186,20 +180,21 @@ public void retryUsingContextTotalTimeoutExceeded() { } } - @Test(expected = ApiException.class) - public void retryMaxAttemptsExceeded() { + @Test + void retryMaxAttemptsExceeded() { Throwable throwable = new UnavailableException(null, FakeStatusCode.of(StatusCode.Code.UNAVAILABLE), true); Mockito.when(callInt.futureCall((Integer) Mockito.any(), (ApiCallContext) Mockito.any())) .thenReturn(RetryingTest.immediateFailedFuture(throwable)) .thenReturn(RetryingTest.immediateFailedFuture(throwable)) .thenReturn(ApiFutures.immediateFuture(2)); - - assertRetrying(FAST_RETRY_SETTINGS.toBuilder().setMaxAttempts(2).build()); + assertThrows( + ApiException.class, + () -> assertRetrying(FAST_RETRY_SETTINGS.toBuilder().setMaxAttempts(2).build())); } @Test - public void retryUsingContextMaxAttemptsExceeded() { + void retryUsingContextMaxAttemptsExceeded() { Throwable throwable = new UnavailableException(null, FakeStatusCode.of(StatusCode.Code.INTERNAL), false); Mockito.when(callInt.futureCall((Integer) Mockito.any(), (ApiCallContext) Mockito.any())) @@ -220,7 +215,7 @@ public void retryUsingContextMaxAttemptsExceeded() { } @Test - public void retryWithinMaxAttempts() { + void retryWithinMaxAttempts() { Throwable throwable = new UnavailableException(null, FakeStatusCode.of(StatusCode.Code.UNAVAILABLE), true); Mockito.when(callInt.futureCall((Integer) Mockito.any(), (ApiCallContext) Mockito.any())) @@ -232,7 +227,7 @@ public void retryWithinMaxAttempts() { } @Test - public void retryUsingContextWithinMaxAttempts() { + void retryUsingContextWithinMaxAttempts() { Throwable throwable = new UnavailableException(null, FakeStatusCode.of(StatusCode.Code.INTERNAL), false); Mockito.when(callInt.futureCall((Integer) Mockito.any(), (ApiCallContext) Mockito.any())) @@ -248,7 +243,7 @@ public void retryUsingContextWithinMaxAttempts() { } @Test - public void retryWithOnlyMaxAttempts() { + void retryWithOnlyMaxAttempts() { Throwable throwable = new UnavailableException(null, FakeStatusCode.of(StatusCode.Code.UNAVAILABLE), true); Mockito.when(callInt.futureCall(Mockito.any(), Mockito.any())) @@ -264,7 +259,7 @@ public void retryWithOnlyMaxAttempts() { } @Test - public void retryUsingContextWithOnlyMaxAttempts() { + void retryUsingContextWithOnlyMaxAttempts() { Throwable throwable = new UnavailableException(null, FakeStatusCode.of(StatusCode.Code.INTERNAL), false); Mockito.when(callInt.futureCall(Mockito.any(), Mockito.any())) @@ -284,7 +279,7 @@ public void retryUsingContextWithOnlyMaxAttempts() { } @Test - public void retryWithoutRetrySettings() { + void retryWithoutRetrySettings() { Mockito.when(callInt.futureCall(Mockito.any(), Mockito.any())) .thenReturn(ApiFutures.immediateFuture(2)); @@ -295,7 +290,7 @@ public void retryWithoutRetrySettings() { } @Test - public void retryUsingContextWithoutRetrySettings() { + void retryUsingContextWithoutRetrySettings() { Mockito.when(callInt.futureCall(Mockito.any(), Mockito.any())) .thenReturn(ApiFutures.immediateFuture(2)); @@ -307,7 +302,7 @@ public void retryUsingContextWithoutRetrySettings() { } @Test - public void retryOnStatusUnknown() { + void retryOnStatusUnknown() { Throwable throwable = new UnknownException(null, FakeStatusCode.of(StatusCode.Code.UNKNOWN), true); Mockito.when(callInt.futureCall((Integer) Mockito.any(), (ApiCallContext) Mockito.any())) @@ -320,58 +315,46 @@ public void retryOnStatusUnknown() { } @Test - public void retryOnUnexpectedException() { + void retryOnUnexpectedException() { Throwable throwable = new UnknownException("foobar", null, FakeStatusCode.of(StatusCode.Code.UNKNOWN), false); Mockito.when(callInt.futureCall((Integer) Mockito.any(), (ApiCallContext) Mockito.any())) .thenReturn(RetryingTest.immediateFailedFuture(throwable)); - try { - assertRetrying(FAST_RETRY_SETTINGS); - Assert.fail("Callable should have thrown an exception"); - } catch (ApiException expected) { - Truth.assertThat(expected).isSameInstanceAs(throwable); - } + assertThrows(UnknownException.class, () -> assertRetrying(FAST_RETRY_SETTINGS)); } @Test - public void retryNoRecover() { + void retryNoRecover() { Throwable throwable = new FailedPreconditionException( "foobar", null, FakeStatusCode.of(StatusCode.Code.FAILED_PRECONDITION), false); Mockito.when(callInt.futureCall((Integer) Mockito.any(), (ApiCallContext) Mockito.any())) .thenReturn(RetryingTest.immediateFailedFuture(throwable)) .thenReturn(ApiFutures.immediateFuture(2)); - try { - assertRetrying(FAST_RETRY_SETTINGS); - Assert.fail("Callable should have thrown an exception"); - } catch (ApiException expected) { - Truth.assertThat(expected).isSameInstanceAs(throwable); - } + assertThrows(FailedPreconditionException.class, () -> assertRetrying(FAST_RETRY_SETTINGS)); } @Test - public void retryUsingContextNoRecover() { + void retryUsingContextNoRecover() { Throwable throwable = new FailedPreconditionException( "foobar", null, FakeStatusCode.of(StatusCode.Code.FAILED_PRECONDITION), false); Mockito.when(callInt.futureCall((Integer) Mockito.any(), (ApiCallContext) Mockito.any())) .thenReturn(RetryingTest.immediateFailedFuture(throwable)) .thenReturn(ApiFutures.immediateFuture(2)); - try { - assertRetryingUsingContext( - FAILING_RETRY_SETTINGS, - FakeCallContext.createDefault() - .withRetrySettings(FAST_RETRY_SETTINGS) - .withRetryableCodes( - Sets.newHashSet(Code.UNAVAILABLE, Code.DEADLINE_EXCEEDED, Code.UNKNOWN))); - Assert.fail("Callable should have thrown an exception"); - } catch (ApiException expected) { - Truth.assertThat(expected).isSameInstanceAs(throwable); - } + assertThrows( + FailedPreconditionException.class, + () -> + assertRetryingUsingContext( + FAILING_RETRY_SETTINGS, + FakeCallContext.createDefault() + .withRetrySettings(FAST_RETRY_SETTINGS) + .withRetryableCodes( + Sets.newHashSet(Code.UNAVAILABLE, Code.DEADLINE_EXCEEDED, Code.UNKNOWN)))); } @Test - public void retryKeepFailing() { + void retryKeepFailing() { Throwable throwable = new UnavailableException( "foobar", null, FakeStatusCode.of(StatusCode.Code.UNAVAILABLE), true); @@ -382,16 +365,14 @@ public void retryKeepFailing() { FakeCallableFactory.createUnaryCallable(callInt, callSettings, clientContext); // Need to advance time inside the call. ApiFuture future = callable.futureCall(1); - try { - Futures.getUnchecked(future); - Assert.fail("Callable should have thrown an exception"); - } catch (UncheckedExecutionException expected) { - Truth.assertThat(expected).hasCauseThat().isSameInstanceAs(throwable); - } + + UncheckedExecutionException actual = + assertThrows(UncheckedExecutionException.class, () -> Futures.getUnchecked(future)); + assertEquals(actual.getCause(), throwable); } @Test - public void testKnownStatusCode() { + void testKnownStatusCode() { ImmutableSet retryable = ImmutableSet.of(StatusCode.Code.UNAVAILABLE); Mockito.when(callInt.futureCall((Integer) Mockito.any(), (ApiCallContext) Mockito.any())) .thenReturn( @@ -404,16 +385,12 @@ public void testKnownStatusCode() { .build(); UnaryCallable callable = FakeCallableFactory.createUnaryCallable(callInt, callSettings, clientContext); - try { - callable.call(1); - Assert.fail("Callable should have thrown an exception"); - } catch (FailedPreconditionException expected) { - Truth.assertThat(expected.getMessage()).isEqualTo("known"); - } + + assertThrows(FailedPreconditionException.class, () -> callable.call(1)); } @Test - public void testUnknownStatusCode() { + void testUnknownStatusCode() { ImmutableSet retryable = ImmutableSet.of(); Mockito.when(callInt.futureCall((Integer) Mockito.any(), (ApiCallContext) Mockito.any())) .thenReturn(RetryingTest.immediateFailedFuture(new RuntimeException("unknown"))); @@ -423,12 +400,8 @@ public void testUnknownStatusCode() { .build(); UnaryCallable callable = FakeCallableFactory.createUnaryCallable(callInt, callSettings, clientContext); - try { - callable.call(1); - Assert.fail("Callable should have thrown an exception"); - } catch (RuntimeException expected) { - Truth.assertThat(expected).isInstanceOf(RuntimeException.class); - } + + assertThrows(RuntimeException.class, () -> callable.call(1)); } public static UnaryCallSettings createSettings(RetrySettings retrySettings) { diff --git a/gax-java/gax/src/test/java/com/google/api/gax/rpc/ServerStreamTest.java b/gax-java/gax/src/test/java/com/google/api/gax/rpc/ServerStreamTest.java index b0cdc30ce1..a87173ebd2 100644 --- a/gax-java/gax/src/test/java/com/google/api/gax/rpc/ServerStreamTest.java +++ b/gax-java/gax/src/test/java/com/google/api/gax/rpc/ServerStreamTest.java @@ -35,26 +35,23 @@ import java.util.Iterator; import java.util.List; import java.util.NoSuchElementException; -import java.util.concurrent.Callable; import java.util.concurrent.CancellationException; import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; import java.util.concurrent.Future; import java.util.concurrent.TimeUnit; -import org.junit.After; -import org.junit.Before; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.junit.runners.JUnit4; - -@RunWith(JUnit4.class) -public class ServerStreamTest { +import java.util.stream.Collectors; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; + +class ServerStreamTest { private ServerStream stream; private MockStreamController controller; private ExecutorService executor; - @Before - public void setUp() { + @BeforeEach + void setUp() { stream = new ServerStream<>(); controller = new MockStreamController<>(stream.observer()); @@ -62,47 +59,62 @@ public void setUp() { executor = Executors.newCachedThreadPool(); } - @After - public void tearDown() { + @AfterEach + void tearDown() { executor.shutdownNow(); } @Test - public void testEmptyStream() { + void testEmptyStream() { stream.observer().onComplete(); Truth.assertThat(Lists.newArrayList(stream)).isEmpty(); } @Test - public void testMultipleItemStream() throws Exception { + void testMultipleItemStream() throws Exception { Future producerFuture = executor.submit( - new Callable() { - @Override - public Void call() { - for (int i = 0; i < 5; i++) { - int requestCount = controller.popLastPull(); - - Truth.assertWithMessage("ServerStream should request one item at a time") - .that(requestCount) - .isEqualTo(1); - - stream.observer().onResponse(i); - } - stream.observer().onComplete(); - return null; + () -> { + for (int i = 0; i < 5; i++) { + int requestCount = controller.popLastPull(); + + Truth.assertWithMessage("ServerStream should request one item at a time") + .that(requestCount) + .isEqualTo(1); + + stream.observer().onResponse(i); } + stream.observer().onComplete(); + return null; }); - Future> consumerFuture = + Future> consumerFuture = executor.submit(() -> Lists.newArrayList(stream)); + + producerFuture.get(60, TimeUnit.SECONDS); + List results = consumerFuture.get(); + Truth.assertThat(results).containsExactly(0, 1, 2, 3, 4); + } + + @Test + void testMultipleItemStreamMethod() throws Exception { + Future producerFuture = executor.submit( - new Callable>() { - @Override - public List call() { - return Lists.newArrayList(stream); + () -> { + for (int i = 0; i < 5; i++) { + int requestCount = controller.popLastPull(); + + Truth.assertWithMessage("ServerStream should request one item at a time") + .that(requestCount) + .isEqualTo(1); + + stream.observer().onResponse(i); } + stream.observer().onComplete(); + return null; }); + Future> consumerFuture = + executor.submit(() -> stream.stream().collect(Collectors.toList())); producerFuture.get(60, TimeUnit.SECONDS); List results = consumerFuture.get(); @@ -110,20 +122,17 @@ public List call() { } @Test - public void testEarlyTermination() throws Exception { + void testEarlyTermination() throws Exception { Future taskFuture = executor.submit( - new Callable() { - @Override - public Void call() { - int i = 0; - while (controller.popLastPull() > 0) { - stream.observer().onResponse(i++); - } - controller.waitForCancel(); - stream.observer().onError(new CancellationException("cancelled")); - return null; + () -> { + int i = 0; + while (controller.popLastPull() > 0) { + stream.observer().onResponse(i++); } + controller.waitForCancel(); + stream.observer().onError(new CancellationException("cancelled")); + return null; }); List results = Lists.newArrayList(); @@ -141,7 +150,7 @@ public Void call() { } @Test - public void testErrorPropagation() { + void testErrorPropagation() { ClassCastException e = new ClassCastException("fake error"); stream.observer().onError(e); @@ -158,7 +167,7 @@ public void testErrorPropagation() { } @Test - public void testNoErrorsBetweenHasNextAndNext() { + void testNoErrorsBetweenHasNextAndNext() { Iterator it = stream.iterator(); controller.popLastPull(); @@ -180,7 +189,7 @@ public void testNoErrorsBetweenHasNextAndNext() { } @Test - public void testReady() { + void testReady() { Iterator it = stream.iterator(); Truth.assertThat(stream.isReceiveReady()).isFalse(); @@ -193,7 +202,7 @@ public void testReady() { } @Test - public void testNextAfterEOF() { + void testNextAfterEOF() { Iterator it = stream.iterator(); stream.observer().onComplete(); @@ -210,7 +219,7 @@ public void testNextAfterEOF() { } @Test - public void testAfterError() { + void testAfterError() { Iterator it = stream.iterator(); RuntimeException expectError = new RuntimeException("my upstream error"); diff --git a/gax-java/gax/src/test/java/com/google/api/gax/rpc/ServerStreamingAttemptCallableTest.java b/gax-java/gax/src/test/java/com/google/api/gax/rpc/ServerStreamingAttemptCallableTest.java index a0c8b833f3..b0b0de4554 100644 --- a/gax-java/gax/src/test/java/com/google/api/gax/rpc/ServerStreamingAttemptCallableTest.java +++ b/gax-java/gax/src/test/java/com/google/api/gax/rpc/ServerStreamingAttemptCallableTest.java @@ -48,24 +48,21 @@ import java.util.concurrent.CancellationException; import java.util.concurrent.ExecutionException; import java.util.concurrent.TimeUnit; -import org.junit.Before; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.junit.runners.JUnit4; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; import org.mockito.Mockito; -import org.threeten.bp.Duration; -@RunWith(JUnit4.class) -public class ServerStreamingAttemptCallableTest { +class ServerStreamingAttemptCallableTest { private MockServerStreamingCallable innerCallable; private AccumulatingObserver observer; private FakeRetryingFuture fakeRetryingFuture; private StreamResumptionStrategy resumptionStrategy; - private static Duration totalTimeout = Duration.ofHours(1); + private static java.time.Duration totalTimeout = java.time.Duration.ofHours(1); + private static final java.time.Duration attemptTimeout = java.time.Duration.ofMinutes(1); private FakeCallContext mockedCallContext; - @Before - public void setUp() { + @BeforeEach + void setUp() { innerCallable = new MockServerStreamingCallable<>(); observer = new AccumulatingObserver(true); resumptionStrategy = new MyStreamResumptionStrategy(); @@ -88,21 +85,22 @@ private ServerStreamingAttemptCallable createCallable(ApiCallCon } @Test - public void testUserProvidedContextTimeout() { + void testUserProvidedContextTimeout() { // Mock up the ApiCallContext as if the user provided a timeout and streamWaitTimeout. Mockito.doReturn(BaseApiTracer.getInstance()).when(mockedCallContext).getTracer(); - Mockito.doReturn(Duration.ofHours(5)).when(mockedCallContext).getTimeout(); - Mockito.doReturn(Duration.ofHours(5)).when(mockedCallContext).getStreamWaitTimeout(); + Mockito.doReturn(java.time.Duration.ofHours(5)).when(mockedCallContext).getTimeoutDuration(); + Mockito.doReturn(java.time.Duration.ofHours(5)) + .when(mockedCallContext) + .getStreamWaitTimeoutDuration(); ServerStreamingAttemptCallable callable = createCallable(mockedCallContext); callable.start(); // Ensure that the callable did not overwrite the user provided timeouts - Mockito.verify(mockedCallContext, Mockito.times(1)).getTimeout(); - Mockito.verify(mockedCallContext, Mockito.never()).withTimeout(totalTimeout); - Mockito.verify(mockedCallContext, Mockito.times(1)).getStreamWaitTimeout(); + Mockito.verify(mockedCallContext, Mockito.times(1)).getTimeoutDuration(); + Mockito.verify(mockedCallContext, Mockito.never()).withTimeoutDuration(totalTimeout); Mockito.verify(mockedCallContext, Mockito.never()) - .withStreamWaitTimeout(Mockito.any(Duration.class)); + .withStreamWaitTimeoutDuration(Mockito.any(java.time.Duration.class)); // Should notify outer observer Truth.assertThat(observer.controller).isNotNull(); @@ -123,26 +121,23 @@ public void testUserProvidedContextTimeout() { } @Test - public void testNoUserProvidedContextTimeout() { + void testNoUserProvidedContextTimeout() { // Mock up the ApiCallContext as if the user did not provide custom timeouts. Mockito.doReturn(BaseApiTracer.getInstance()).when(mockedCallContext).getTracer(); - Mockito.doReturn(null).when(mockedCallContext).getTimeout(); - Mockito.doReturn(null).when(mockedCallContext).getStreamWaitTimeout(); - Mockito.doReturn(mockedCallContext).when(mockedCallContext).withTimeout(totalTimeout); + Mockito.doReturn(null).when(mockedCallContext).getTimeoutDuration(); + Mockito.doReturn(null).when(mockedCallContext).getStreamWaitTimeoutDuration(); + Mockito.doReturn(mockedCallContext).when(mockedCallContext).withTimeoutDuration(attemptTimeout); Mockito.doReturn(mockedCallContext) .when(mockedCallContext) - .withStreamWaitTimeout(Mockito.any(Duration.class)); + .withStreamWaitTimeoutDuration(Mockito.any(java.time.Duration.class)); ServerStreamingAttemptCallable callable = createCallable(mockedCallContext); callable.start(); // Ensure that the callable configured the timeouts via the Settings in the // absence of user-defined timeouts. - Mockito.verify(mockedCallContext, Mockito.times(1)).getTimeout(); - Mockito.verify(mockedCallContext, Mockito.times(1)).withTimeout(totalTimeout); - Mockito.verify(mockedCallContext, Mockito.times(1)).getStreamWaitTimeout(); - Mockito.verify(mockedCallContext, Mockito.times(1)) - .withStreamWaitTimeout(Mockito.any(Duration.class)); + Mockito.verify(mockedCallContext, Mockito.times(1)).getTimeoutDuration(); + Mockito.verify(mockedCallContext, Mockito.times(1)).withTimeoutDuration(attemptTimeout); // Should notify outer observer Truth.assertThat(observer.controller).isNotNull(); @@ -163,7 +158,7 @@ public void testNoUserProvidedContextTimeout() { } @Test - public void testNoErrorsAutoFlow() { + void testNoErrorsAutoFlow() { ServerStreamingAttemptCallable callable = createCallable(); callable.start(); @@ -186,7 +181,7 @@ public void testNoErrorsAutoFlow() { } @Test - public void testNoErrorsManualFlow() { + void testNoErrorsManualFlow() { observer = new AccumulatingObserver(false); ServerStreamingAttemptCallable callable = createCallable(); callable.start(); @@ -218,7 +213,7 @@ public void testNoErrorsManualFlow() { @Test @SuppressWarnings("ConstantConditions") - public void testInitialRetry() { + void testInitialRetry() { resumptionStrategy = new MyStreamResumptionStrategy(); ServerStreamingAttemptCallable callable = createCallable(); callable.start(); @@ -253,7 +248,7 @@ public void testInitialRetry() { @Test @SuppressWarnings("ConstantConditions") - public void testMidRetry() { + void testMidRetry() { resumptionStrategy = new MyStreamResumptionStrategy(); ServerStreamingAttemptCallable callable = createCallable(); callable.start(); @@ -295,7 +290,7 @@ public void testMidRetry() { } @Test - public void testRequestCountIsPreserved() { + void testRequestCountIsPreserved() { observer = new AccumulatingObserver(false); ServerStreamingAttemptCallable callable = createCallable(); callable.start(); @@ -324,7 +319,7 @@ public void testRequestCountIsPreserved() { } @Test - public void testCancel() { + void testCancel() { observer = new AccumulatingObserver(false); ServerStreamingAttemptCallable callable = createCallable(); callable.start(); @@ -373,7 +368,7 @@ public void testCancel() { } @Test - public void testResponseSubstitution() { + void testResponseSubstitution() { resumptionStrategy = new MyStreamResumptionStrategy() { @Override @@ -476,13 +471,14 @@ private static class FakeRetryingFuture extends AbstractApiFuture this.attemptCallable = attemptCallable; attemptSettings = TimedAttemptSettings.newBuilder() - .setGlobalSettings(RetrySettings.newBuilder().setTotalTimeout(totalTimeout).build()) + .setGlobalSettings( + RetrySettings.newBuilder().setTotalTimeoutDuration(totalTimeout).build()) .setFirstAttemptStartTimeNanos(0) .setAttemptCount(0) .setOverallAttemptCount(0) - .setRandomizedRetryDelay(Duration.ofMillis(1)) - .setRetryDelay(Duration.ofMillis(1)) - .setRpcTimeout(Duration.ofMinutes(1)) + .setRandomizedRetryDelayDuration(java.time.Duration.ofMillis(1)) + .setRetryDelayDuration(java.time.Duration.ofMillis(1)) + .setRpcTimeoutDuration(java.time.Duration.ofMinutes(1)) .build(); } diff --git a/gax-java/gax/src/test/java/com/google/api/gax/rpc/ServerStreamingCallSettingsTest.java b/gax-java/gax/src/test/java/com/google/api/gax/rpc/ServerStreamingCallSettingsTest.java index a14268f8d5..9ce548b8d9 100644 --- a/gax-java/gax/src/test/java/com/google/api/gax/rpc/ServerStreamingCallSettingsTest.java +++ b/gax-java/gax/src/test/java/com/google/api/gax/rpc/ServerStreamingCallSettingsTest.java @@ -29,21 +29,18 @@ */ package com.google.api.gax.rpc; +import static com.google.api.gax.util.TimeConversionTestUtils.testDurationMethod; import static com.google.common.truth.Truth.assertThat; import com.google.api.gax.retrying.RetrySettings; import com.google.api.gax.rpc.StatusCode.Code; import com.google.common.collect.ImmutableSet; import java.util.Set; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.junit.runners.JUnit4; -import org.threeten.bp.Duration; +import org.junit.jupiter.api.Test; -@RunWith(JUnit4.class) -public class ServerStreamingCallSettingsTest { +class ServerStreamingCallSettingsTest { @Test - public void retryableCodesAreNotLost() { + void retryableCodesAreNotLost() { Set codes = ImmutableSet.of(Code.UNAVAILABLE, Code.RESOURCE_EXHAUSTED); ServerStreamingCallSettings.Builder builder = ServerStreamingCallSettings.newBuilder(); @@ -55,7 +52,7 @@ public void retryableCodesAreNotLost() { } @Test - public void retryableCodesVarArgs() { + void retryableCodesVarArgs() { ServerStreamingCallSettings.Builder builder = ServerStreamingCallSettings.newBuilder().setRetryableCodes(Code.UNKNOWN, Code.ABORTED); @@ -63,14 +60,14 @@ public void retryableCodesVarArgs() { } @Test - public void retryableSettingsAreNotLost() { + void retryableSettingsAreNotLost() { RetrySettings retrySettings = RetrySettings.newBuilder() - .setInitialRetryDelay(Duration.ofMillis(5)) - .setMaxRetryDelay(Duration.ofSeconds(1)) + .setInitialRetryDelayDuration(java.time.Duration.ofMillis(5)) + .setMaxRetryDelayDuration(java.time.Duration.ofSeconds(1)) .setRetryDelayMultiplier(2) - .setInitialRpcTimeout(Duration.ofMillis(100)) - .setMaxRpcTimeout(Duration.ofMillis(200)) + .setInitialRpcTimeoutDuration(java.time.Duration.ofMillis(100)) + .setMaxRpcTimeoutDuration(java.time.Duration.ofMillis(200)) .setRpcTimeoutMultiplier(1.1) .setJittered(true) .setMaxAttempts(10) @@ -86,27 +83,41 @@ public void retryableSettingsAreNotLost() { } @Test - public void idleTimeoutIsNotLost() { - Duration idleTimeout = Duration.ofSeconds(5); + void idleTimeoutIsNotLost() { + java.time.Duration idleTimeout = java.time.Duration.ofSeconds(5); ServerStreamingCallSettings.Builder builder = ServerStreamingCallSettings.newBuilder(); - builder.setIdleTimeout(idleTimeout); + builder.setIdleTimeoutDuration(idleTimeout); - assertThat(builder.getIdleTimeout()).isEqualTo(idleTimeout); - assertThat(builder.build().getIdleTimeout()).isEqualTo(idleTimeout); - assertThat(builder.build().toBuilder().getIdleTimeout()).isEqualTo(idleTimeout); + assertThat(builder.getIdleTimeoutDuration()).isEqualTo(idleTimeout); + assertThat(builder.build().getIdleTimeoutDuration()).isEqualTo(idleTimeout); + assertThat(builder.build().toBuilder().getIdleTimeoutDuration()).isEqualTo(idleTimeout); } @Test - public void testRetrySettingsBuilder() { + void waitTimeoutIsNotLost() { + java.time.Duration waitTimeout = java.time.Duration.ofSeconds(5); + + ServerStreamingCallSettings.Builder builder = + ServerStreamingCallSettings.newBuilder(); + + builder.setWaitTimeoutDuration(waitTimeout); + + assertThat(builder.getWaitTimeoutDuration()).isEqualTo(waitTimeout); + assertThat(builder.build().getWaitTimeoutDuration()).isEqualTo(waitTimeout); + assertThat(builder.build().toBuilder().getWaitTimeoutDuration()).isEqualTo(waitTimeout); + } + + @Test + void testRetrySettingsBuilder() { RetrySettings initialSettings = RetrySettings.newBuilder() - .setInitialRetryDelay(Duration.ofMillis(5)) - .setMaxRetryDelay(Duration.ofSeconds(1)) + .setInitialRetryDelayDuration(java.time.Duration.ofMillis(5)) + .setMaxRetryDelayDuration(java.time.Duration.ofSeconds(1)) .setRetryDelayMultiplier(2) - .setInitialRpcTimeout(Duration.ofMillis(100)) - .setMaxRpcTimeout(Duration.ofMillis(200)) + .setInitialRpcTimeoutDuration(java.time.Duration.ofMillis(100)) + .setMaxRpcTimeoutDuration(java.time.Duration.ofMillis(200)) .setRpcTimeoutMultiplier(1.1) .setJittered(true) .setMaxAttempts(10) @@ -115,26 +126,49 @@ public void testRetrySettingsBuilder() { ServerStreamingCallSettings.Builder builder = ServerStreamingCallSettings.newBuilder().setRetrySettings(initialSettings); - builder.retrySettings().setMaxRetryDelay(Duration.ofMinutes(1)); + builder.retrySettings().setMaxRetryDelayDuration(java.time.Duration.ofMinutes(1)); - assertThat(builder.getRetrySettings().getMaxRetryDelay()).isEqualTo(Duration.ofMinutes(1)); - assertThat(builder.build().getRetrySettings().getMaxRetryDelay()) - .isEqualTo(Duration.ofMinutes(1)); + assertThat(builder.getRetrySettings().getMaxRetryDelayDuration()) + .isEqualTo(java.time.Duration.ofMinutes(1)); + assertThat(builder.build().getRetrySettings().getMaxRetryDelayDuration()) + .isEqualTo(java.time.Duration.ofMinutes(1)); } @Test - public void testToString() { + void testToString() { RetrySettings retrySettings = RetrySettings.newBuilder().build(); Set retryableCodes = ImmutableSet.of(StatusCode.Code.DEADLINE_EXCEEDED); - Duration idleTime = Duration.ofSeconds(100); + java.time.Duration idleTime = java.time.Duration.ofSeconds(100); ServerStreamingCallSettings serverCallSettings = ServerStreamingCallSettings.newBuilder() .setRetrySettings(retrySettings) .setRetryableCodes(retryableCodes) - .setIdleTimeout(idleTime) + .setIdleTimeoutDuration(idleTime) .build(); assertThat(serverCallSettings.toString()).contains("idleTimeout=" + idleTime); assertThat(serverCallSettings.toString()).contains("retryableCodes=" + retryableCodes); assertThat(serverCallSettings.toString()).contains("retrySettings=" + retrySettings); } + + @Test + public void testIdleTimeout_backportMethodsBehaveCorrectly() { + final ServerStreamingCallSettings.Builder builder = ServerStreamingCallSettings.newBuilder(); + testDurationMethod( + 123l, + jt -> builder.setIdleTimeoutDuration(jt).build(), + tt -> builder.setIdleTimeout(tt).build(), + cs -> cs.getIdleTimeoutDuration(), + cs -> cs.getIdleTimeout()); + } + + @Test + public void testWaitTimeout_backportMethodsBehaveCorrectly() { + final ServerStreamingCallSettings.Builder builder = ServerStreamingCallSettings.newBuilder(); + testDurationMethod( + 123l, + jt -> builder.setWaitTimeoutDuration(jt).build(), + tt -> builder.setWaitTimeout(tt).build(), + cs -> cs.getWaitTimeoutDuration(), + cs -> cs.getWaitTimeout()); + } } diff --git a/gax-java/gax/src/test/java/com/google/api/gax/rpc/ServerStreamingCallableTest.java b/gax-java/gax/src/test/java/com/google/api/gax/rpc/ServerStreamingCallableTest.java index ca292257fc..226f00c5d0 100644 --- a/gax-java/gax/src/test/java/com/google/api/gax/rpc/ServerStreamingCallableTest.java +++ b/gax-java/gax/src/test/java/com/google/api/gax/rpc/ServerStreamingCallableTest.java @@ -40,18 +40,15 @@ import com.google.common.truth.Truth; import java.util.Arrays; import java.util.List; -import org.junit.Before; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.junit.runners.JUnit4; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; import org.mockito.Mockito; -@RunWith(JUnit4.class) -public class ServerStreamingCallableTest { +class ServerStreamingCallableTest { private ClientContext clientContext; - @Before - public void setUp() { + @BeforeEach + void setUp() { clientContext = ClientContext.newBuilder() .setDefaultCallContext(FakeCallContext.createDefault()) @@ -60,7 +57,7 @@ public void setUp() { } @Test - public void serverStreaming() { + void serverStreaming() { ServerStreamingStashCallable callIntList = new ServerStreamingStashCallable<>(Arrays.asList(0, 1, 2)); @@ -79,7 +76,7 @@ public void serverStreaming() { } @Test - public void testServerStreamingCall() { + void testServerStreamingCall() { ApiCallContext defaultCallContext = FakeCallContext.createDefault(); ServerStreamingStashCallable stashCallable = new ServerStreamingStashCallable<>(); @@ -96,7 +93,7 @@ public void testServerStreamingCall() { } @Test - public void testServerStreamingCallWithContext() { + void testServerStreamingCallWithContext() { FakeChannel channel = new FakeChannel(); Credentials credentials = Mockito.mock(Credentials.class); ApiCallContext context = @@ -117,7 +114,7 @@ public void testServerStreamingCallWithContext() { } @Test - public void blockingServerStreaming() { + void blockingServerStreaming() { ServerStreamingStashCallable callIntList = new ServerStreamingStashCallable<>(Arrays.asList(0, 1, 2)); @@ -131,7 +128,7 @@ public void blockingServerStreaming() { } @Test - public void testIteratedServerStreamingCall() { + void testIteratedServerStreamingCall() { ApiCallContext defaultCallContext = FakeCallContext.createDefault(); ServerStreamingStashCallable stashCallable = new ServerStreamingStashCallable<>(); @@ -144,7 +141,7 @@ public void testIteratedServerStreamingCall() { } @Test - public void testIteratedServerStreamingCallWithContext() { + void testIteratedServerStreamingCallWithContext() { FakeChannel channel = new FakeChannel(); Credentials credentials = Mockito.mock(Credentials.class); ApiCallContext context = @@ -162,7 +159,7 @@ public void testIteratedServerStreamingCallWithContext() { } @Test - public void testFirstElementCall() { + void testFirstElementCall() { ServerStreamingStashCallable callIntList = new ServerStreamingStashCallable<>(Arrays.asList(0, 1, 2)); @@ -178,7 +175,7 @@ public void testFirstElementCall() { } @Test - public void testFirstElementCallWithDefaultContext() { + void testFirstElementCallWithDefaultContext() { ApiCallContext defaultCallContext = FakeCallContext.createDefault(); final StashCallable stashFirstCallable = new StashCallable<>(11); @@ -200,7 +197,7 @@ public UnaryCallable first() { } @Test - public void testFirstElementCallWithContext() { + void testFirstElementCallWithContext() { FakeChannel channel = new FakeChannel(); Credentials credentials = Mockito.mock(Credentials.class); ApiCallContext context = @@ -219,7 +216,7 @@ public void testFirstElementCallWithContext() { } @Test - public void testAllElementCall() { + void testAllElementCall() { ServerStreamingStashCallable callIntList = new ServerStreamingStashCallable<>(Arrays.asList(0, 1, 2)); @@ -235,7 +232,7 @@ public void testAllElementCall() { } @Test - public void testAllElementCallWithDefaultContext() { + void testAllElementCallWithDefaultContext() { ApiCallContext defaultCallContext = FakeCallContext.createDefault(); ServerStreamingStashCallable stashCallable = new ServerStreamingStashCallable<>(); @@ -249,7 +246,7 @@ public void testAllElementCallWithDefaultContext() { } @Test - public void testAllElementCallWithContext() { + void testAllElementCallWithContext() { FakeChannel channel = new FakeChannel(); Credentials credentials = Mockito.mock(Credentials.class); ApiCallContext context = diff --git a/gax-java/gax/src/test/java/com/google/api/gax/rpc/SpoolingCallableTest.java b/gax-java/gax/src/test/java/com/google/api/gax/rpc/SpoolingCallableTest.java index c968c2c878..8d03f1137b 100644 --- a/gax-java/gax/src/test/java/com/google/api/gax/rpc/SpoolingCallableTest.java +++ b/gax-java/gax/src/test/java/com/google/api/gax/rpc/SpoolingCallableTest.java @@ -36,25 +36,22 @@ import java.util.List; import java.util.concurrent.CancellationException; import java.util.concurrent.ExecutionException; -import org.junit.Assert; -import org.junit.Before; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.junit.runners.JUnit4; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; -@RunWith(JUnit4.class) -public class SpoolingCallableTest { +class SpoolingCallableTest { private MockServerStreamingCallable upstream; private SpoolingCallable callable; - @Before - public void setup() { + @BeforeEach + void setup() { upstream = new MockServerStreamingCallable<>(); callable = new SpoolingCallable<>(upstream); } @Test - public void testHappyPath() throws InterruptedException, ExecutionException { + void testHappyPath() throws InterruptedException, ExecutionException { ApiFuture> result = callable.futureCall("request"); MockServerStreamingCall call = upstream.popLastCall(); @@ -68,7 +65,7 @@ public void testHappyPath() throws InterruptedException, ExecutionException { } @Test - public void testEarlyTermination() throws Exception { + void testEarlyTermination() throws Exception { ApiFuture> result = callable.futureCall("request"); MockServerStreamingCall call = upstream.popLastCall(); @@ -88,14 +85,14 @@ public void testEarlyTermination() throws Exception { // However the inner cancellation exception will be masked by an outer CancellationException try { result.get(); - Assert.fail("Callable should have thrown an exception"); + Assertions.fail("Callable should have thrown an exception"); } catch (CancellationException expected) { Truth.assertThat(expected).hasMessageThat().contains("Task was cancelled."); } } @Test - public void testNoResults() throws Exception { + void testNoResults() throws Exception { ApiFuture> result = callable.futureCall("request"); MockServerStreamingCall call = upstream.popLastCall(); diff --git a/gax-java/gax/src/test/java/com/google/api/gax/rpc/StreamingCallableTest.java b/gax-java/gax/src/test/java/com/google/api/gax/rpc/StreamingCallableTest.java index f946aff92a..325badeaed 100644 --- a/gax-java/gax/src/test/java/com/google/api/gax/rpc/StreamingCallableTest.java +++ b/gax-java/gax/src/test/java/com/google/api/gax/rpc/StreamingCallableTest.java @@ -29,7 +29,7 @@ */ package com.google.api.gax.rpc; -import static org.junit.Assert.assertSame; +import static org.junit.jupiter.api.Assertions.assertSame; import com.google.api.gax.retrying.RetrySettings; import com.google.api.gax.rpc.StatusCode.Code; @@ -46,18 +46,15 @@ import java.util.ArrayList; import java.util.List; import java.util.Set; -import org.junit.Before; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.junit.runners.JUnit4; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; import org.mockito.Mockito; -@RunWith(JUnit4.class) -public class StreamingCallableTest { +class StreamingCallableTest { private ClientContext clientContext; - @Before - public void setUp() { + @BeforeEach + void setUp() { clientContext = ClientContext.newBuilder() .setDefaultCallContext(FakeCallContext.createDefault()) @@ -97,7 +94,7 @@ public List getValues() { } @Test - public void clientStreaming() { + void clientStreaming() { ClientStreamingStashCallable callIntList = new ClientStreamingStashCallable<>(100); @@ -122,7 +119,7 @@ public void clientStreaming() { @Test @SuppressWarnings("unchecked") - public void testClientStreamingCall() { + void testClientStreamingCall() { ApiCallContext defaultCallContext = FakeCallContext.createDefault(); ClientStreamingStashCallable stashCallable = new ClientStreamingStashCallable<>(); @@ -136,7 +133,7 @@ public void testClientStreamingCall() { @Test @SuppressWarnings("unchecked") - public void testClientStreamingCallWithContext() { + void testClientStreamingCallWithContext() { FakeChannel channel = new FakeChannel(); Credentials credentials = Mockito.mock(Credentials.class); RetrySettings retrySettings = Mockito.mock(RetrySettings.class); diff --git a/gax-java/gax/src/test/java/com/google/api/gax/rpc/StreamingRetryAlgorithmTest.java b/gax-java/gax/src/test/java/com/google/api/gax/rpc/StreamingRetryAlgorithmTest.java index 7400007231..066e7ab4df 100644 --- a/gax-java/gax/src/test/java/com/google/api/gax/rpc/StreamingRetryAlgorithmTest.java +++ b/gax-java/gax/src/test/java/com/google/api/gax/rpc/StreamingRetryAlgorithmTest.java @@ -42,40 +42,36 @@ import com.google.api.gax.retrying.ServerStreamingAttemptException; import com.google.api.gax.retrying.StreamingRetryAlgorithm; import com.google.api.gax.retrying.TimedAttemptSettings; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.junit.runners.JUnit4; +import org.junit.jupiter.api.Test; import org.mockito.Mockito; -import org.threeten.bp.Duration; -@RunWith(JUnit4.class) -public class StreamingRetryAlgorithmTest { +class StreamingRetryAlgorithmTest { private static final RetrySettings DEFAULT_RETRY_SETTINGS = RetrySettings.newBuilder() - .setInitialRetryDelay(Duration.ofMillis(10L)) - .setInitialRpcTimeout(Duration.ofMillis(100L)) + .setInitialRetryDelayDuration(java.time.Duration.ofMillis(10L)) + .setInitialRpcTimeoutDuration(java.time.Duration.ofMillis(100L)) .setMaxAttempts(10) - .setMaxRetryDelay(Duration.ofSeconds(10L)) - .setMaxRpcTimeout(Duration.ofSeconds(30L)) + .setMaxRetryDelayDuration(java.time.Duration.ofSeconds(10L)) + .setMaxRpcTimeoutDuration(java.time.Duration.ofSeconds(30L)) .setRetryDelayMultiplier(1.4) .setRpcTimeoutMultiplier(1.5) - .setTotalTimeout(Duration.ofMinutes(10L)) + .setTotalTimeoutDuration(java.time.Duration.ofMinutes(10L)) .build(); private static final RetrySettings CONTEXT_RETRY_SETTINGS = RetrySettings.newBuilder() - .setInitialRetryDelay(Duration.ofMillis(20L)) - .setInitialRpcTimeout(Duration.ofMillis(200L)) + .setInitialRetryDelayDuration(java.time.Duration.ofMillis(20L)) + .setInitialRpcTimeoutDuration(java.time.Duration.ofMillis(200L)) .setMaxAttempts(10) - .setMaxRetryDelay(Duration.ofSeconds(20L)) - .setMaxRpcTimeout(Duration.ofSeconds(60L)) + .setMaxRetryDelayDuration(java.time.Duration.ofSeconds(20L)) + .setMaxRpcTimeoutDuration(java.time.Duration.ofSeconds(60L)) .setRetryDelayMultiplier(2.4) .setRpcTimeoutMultiplier(2.5) - .setTotalTimeout(Duration.ofMinutes(20L)) + .setTotalTimeoutDuration(java.time.Duration.ofMinutes(20L)) .build(); @Test - public void testFirstAttemptUsesDefaultSettings() { + void testFirstAttemptUsesDefaultSettings() { RetryingContext context = mock(RetryingContext.class); BasicResultRetryAlgorithm resultAlgorithm = new BasicResultRetryAlgorithm<>(); ExponentialRetryAlgorithm timedAlgorithm = @@ -86,11 +82,12 @@ public void testFirstAttemptUsesDefaultSettings() { TimedAttemptSettings attempt = algorithm.createFirstAttempt(context); assertThat(attempt.getGlobalSettings()).isSameInstanceAs(DEFAULT_RETRY_SETTINGS); - assertThat(attempt.getRpcTimeout()).isEqualTo(DEFAULT_RETRY_SETTINGS.getInitialRpcTimeout()); + assertThat(attempt.getRpcTimeoutDuration()) + .isEqualTo(DEFAULT_RETRY_SETTINGS.getInitialRpcTimeoutDuration()); } @Test - public void testFirstAttemptUsesContextSettings() { + void testFirstAttemptUsesContextSettings() { RetryingContext context = mock(RetryingContext.class); when(context.getRetrySettings()).thenReturn(CONTEXT_RETRY_SETTINGS); BasicResultRetryAlgorithm resultAlgorithm = new BasicResultRetryAlgorithm<>(); @@ -102,11 +99,12 @@ public void testFirstAttemptUsesContextSettings() { TimedAttemptSettings attempt = algorithm.createFirstAttempt(context); assertThat(attempt.getGlobalSettings()).isSameInstanceAs(CONTEXT_RETRY_SETTINGS); - assertThat(attempt.getRpcTimeout()).isEqualTo(CONTEXT_RETRY_SETTINGS.getInitialRpcTimeout()); + assertThat(attempt.getRpcTimeoutDuration()) + .isEqualTo(CONTEXT_RETRY_SETTINGS.getInitialRpcTimeoutDuration()); } @Test - public void testNextAttemptReturnsNullWhenShouldNotRetry() { + void testNextAttemptReturnsNullWhenShouldNotRetry() { RetryingContext context = mock(RetryingContext.class); @SuppressWarnings("unchecked") BasicResultRetryAlgorithm resultAlgorithm = mock(BasicResultRetryAlgorithm.class); @@ -128,7 +126,7 @@ public void testNextAttemptReturnsNullWhenShouldNotRetry() { } @Test - public void testNextAttemptReturnsResultAlgorithmSettingsWhenShouldRetry() { + void testNextAttemptReturnsResultAlgorithmSettingsWhenShouldRetry() { RetryingContext context = mock(RetryingContext.class); @SuppressWarnings("unchecked") BasicResultRetryAlgorithm resultAlgorithm = mock(BasicResultRetryAlgorithm.class); @@ -153,7 +151,7 @@ public void testNextAttemptReturnsResultAlgorithmSettingsWhenShouldRetry() { } @Test - public void testNextAttemptResetsTimedSettings() { + void testNextAttemptResetsTimedSettings() { RetryingContext context = mock(RetryingContext.class); BasicResultRetryAlgorithm resultAlgorithm = new BasicResultRetryAlgorithm<>(); @@ -175,11 +173,11 @@ public void testNextAttemptResetsTimedSettings() { assertThat(third.getFirstAttemptStartTimeNanos()) .isEqualTo(first.getFirstAttemptStartTimeNanos()); // The timeout values are reset to the second call. - assertThat(third.getRpcTimeout()).isEqualTo(second.getRpcTimeout()); + assertThat(third.getRpcTimeoutDuration()).isEqualTo(second.getRpcTimeoutDuration()); } @Test - public void testShouldNotRetryIfAttemptIsNonResumable() { + void testShouldNotRetryIfAttemptIsNonResumable() { RetryingContext context = mock(RetryingContext.class); ServerStreamingAttemptException exception = mock(ServerStreamingAttemptException.class); @@ -205,7 +203,7 @@ public void testShouldNotRetryIfAttemptIsNonResumable() { } @Test - public void testShouldRetryIfAllSayYes() { + void testShouldRetryIfAllSayYes() { RetryingContext context = mock(RetryingContext.class); ServerStreamingAttemptException exception = mock(ServerStreamingAttemptException.class); diff --git a/gax-java/gax/src/test/java/com/google/api/gax/rpc/TranslatingUnaryCallableTest.java b/gax-java/gax/src/test/java/com/google/api/gax/rpc/TranslatingUnaryCallableTest.java index af95341430..1061a72f23 100644 --- a/gax-java/gax/src/test/java/com/google/api/gax/rpc/TranslatingUnaryCallableTest.java +++ b/gax-java/gax/src/test/java/com/google/api/gax/rpc/TranslatingUnaryCallableTest.java @@ -33,15 +33,12 @@ import com.google.api.core.ApiFuture; import com.google.api.core.ApiFutures; import com.google.common.truth.Truth; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.junit.runners.JUnit4; +import org.junit.jupiter.api.Test; -@RunWith(JUnit4.class) -public class TranslatingUnaryCallableTest { +class TranslatingUnaryCallableTest { @Test - public void translate() throws Exception { + void translate() throws Exception { TranslatingUnaryCallable callable = TranslatingUnaryCallable.create( new UnaryCallable() { diff --git a/gax-java/gax/src/test/java/com/google/api/gax/rpc/UnaryCallSettingsTest.java b/gax-java/gax/src/test/java/com/google/api/gax/rpc/UnaryCallSettingsTest.java index 6838d57252..a69efb22c3 100644 --- a/gax-java/gax/src/test/java/com/google/api/gax/rpc/UnaryCallSettingsTest.java +++ b/gax-java/gax/src/test/java/com/google/api/gax/rpc/UnaryCallSettingsTest.java @@ -29,35 +29,33 @@ */ package com.google.api.gax.rpc; +import static com.google.api.gax.util.TimeConversionTestUtils.testDurationMethod; import static com.google.common.truth.Truth.assertThat; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotEquals; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotEquals; import com.google.api.gax.retrying.RetrySettings; import com.google.common.collect.ImmutableSet; import java.util.Set; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.junit.runners.JUnit4; -import org.threeten.bp.Duration; +import org.junit.jupiter.api.Test; -@RunWith(JUnit4.class) -public class UnaryCallSettingsTest { +class UnaryCallSettingsTest { @Test - public void testSetSimpleTimeoutNoRetries() { + void testSetSimpleTimeoutNoRetries() { UnaryCallSettings.Builder builder = new UnaryCallSettings.Builder(); - builder.setSimpleTimeoutNoRetries(Duration.ofSeconds(13)); + builder.setSimpleTimeoutNoRetriesDuration(java.time.Duration.ofSeconds(13)); assertThat(builder.getRetryableCodes().size()).isEqualTo(0); assertThat(builder.getRetrySettings().getMaxAttempts()).isEqualTo(1); - assertThat(builder.getRetrySettings().getTotalTimeout()).isEqualTo(Duration.ofSeconds(13)); + assertThat(builder.getRetrySettings().getTotalTimeoutDuration()) + .isEqualTo(java.time.Duration.ofSeconds(13)); } @Test - public void testEquals() { + void testEquals() { UnaryCallSettings.Builder builder = new UnaryCallSettings.Builder(); - builder.setSimpleTimeoutNoRetries(Duration.ofSeconds(13)); + builder.setSimpleTimeoutNoRetriesDuration(java.time.Duration.ofSeconds(13)); UnaryCallSettings settings13 = builder.build(); assertEquals(settings13, settings13); @@ -66,7 +64,7 @@ public void testEquals() { assertEquals(settings13.hashCode(), settings13.hashCode()); UnaryCallSettings.Builder builder5 = new UnaryCallSettings.Builder(); - builder5.setSimpleTimeoutNoRetries(Duration.ofSeconds(5)); + builder5.setSimpleTimeoutNoRetriesDuration(java.time.Duration.ofSeconds(5)); UnaryCallSettings settings5 = builder5.build(); assertNotEquals(settings13, settings5); @@ -74,14 +72,14 @@ public void testEquals() { } @Test - public void testEquals_retrySettings() { + void testEquals_retrySettings() { RetrySettings initialSettings = RetrySettings.newBuilder() - .setInitialRetryDelay(Duration.ofMillis(5)) - .setMaxRetryDelay(Duration.ofSeconds(1)) + .setInitialRetryDelayDuration(java.time.Duration.ofMillis(5)) + .setMaxRetryDelayDuration(java.time.Duration.ofSeconds(1)) .setRetryDelayMultiplier(2) - .setInitialRpcTimeout(Duration.ofMillis(100)) - .setMaxRpcTimeout(Duration.ofMillis(200)) + .setInitialRpcTimeoutDuration(java.time.Duration.ofMillis(100)) + .setMaxRpcTimeoutDuration(java.time.Duration.ofMillis(200)) .setRpcTimeoutMultiplier(1.1) .setJittered(true) .setMaxAttempts(10) @@ -97,7 +95,7 @@ public void testEquals_retrySettings() { } @Test - public void testEquals_retryableCodes() { + void testEquals_retryableCodes() { UnaryCallSettings.Builder builder = new UnaryCallSettings.Builder(); UnaryCallSettings settingsNoCodes = builder.build(); @@ -111,14 +109,14 @@ public void testEquals_retryableCodes() { } @Test - public void testRetrySettingsBuilder() { + void testRetrySettingsBuilder() { RetrySettings initialSettings = RetrySettings.newBuilder() - .setInitialRetryDelay(Duration.ofMillis(5)) - .setMaxRetryDelay(Duration.ofSeconds(1)) + .setInitialRetryDelayDuration(java.time.Duration.ofMillis(5)) + .setMaxRetryDelayDuration(java.time.Duration.ofSeconds(1)) .setRetryDelayMultiplier(2) - .setInitialRpcTimeout(Duration.ofMillis(100)) - .setMaxRpcTimeout(Duration.ofMillis(200)) + .setInitialRpcTimeoutDuration(java.time.Duration.ofMillis(100)) + .setMaxRpcTimeoutDuration(java.time.Duration.ofMillis(200)) .setRpcTimeoutMultiplier(1.1) .setJittered(true) .setMaxAttempts(10) @@ -127,15 +125,16 @@ public void testRetrySettingsBuilder() { UnaryCallSettings.Builder builder = new UnaryCallSettings.Builder().setRetrySettings(initialSettings); - builder.retrySettings().setMaxRetryDelay(Duration.ofMinutes(1)); + builder.retrySettings().setMaxRetryDelayDuration(java.time.Duration.ofMinutes(1)); - assertThat(builder.getRetrySettings().getMaxRetryDelay()).isEqualTo(Duration.ofMinutes(1)); - assertThat(builder.build().getRetrySettings().getMaxRetryDelay()) - .isEqualTo(Duration.ofMinutes(1)); + assertThat(builder.getRetrySettings().getMaxRetryDelayDuration()) + .isEqualTo(java.time.Duration.ofMinutes(1)); + assertThat(builder.build().getRetrySettings().getMaxRetryDelayDuration()) + .isEqualTo(java.time.Duration.ofMinutes(1)); } @Test - public void testToString() { + void testToString() { RetrySettings retrySettings = RetrySettings.newBuilder().build(); Set retryableCodes = ImmutableSet.of(StatusCode.Code.DEADLINE_EXCEEDED); UnaryCallSettings unaryCallSettings = @@ -146,4 +145,17 @@ public void testToString() { assertThat(unaryCallSettings.toString()).contains("retryableCodes=" + retryableCodes); assertThat(unaryCallSettings.toString()).contains("retrySettings=" + retrySettings); } + + @Test + public void testWatchDogCheckInterval_backportMethodsBehaveCorrectly() { + testDurationMethod( + 123l, + jt -> + UnaryCallSettings.newUnaryCallSettingsBuilder() + .setSimpleTimeoutNoRetriesDuration(jt) + .build(), + tt -> UnaryCallSettings.newUnaryCallSettingsBuilder().setSimpleTimeoutNoRetries(tt).build(), + ucs -> ucs.getRetrySettings().getTotalTimeoutDuration(), + ucs -> ucs.getRetrySettings().getTotalTimeout()); + } } diff --git a/gax-java/gax/src/test/java/com/google/api/gax/rpc/UnaryCallableTest.java b/gax-java/gax/src/test/java/com/google/api/gax/rpc/UnaryCallableTest.java index 0e16545d4b..c554690156 100644 --- a/gax-java/gax/src/test/java/com/google/api/gax/rpc/UnaryCallableTest.java +++ b/gax-java/gax/src/test/java/com/google/api/gax/rpc/UnaryCallableTest.java @@ -30,10 +30,10 @@ package com.google.api.gax.rpc; import static com.google.common.truth.Truth.assertThat; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotNull; -import static org.junit.Assert.assertNull; -import static org.junit.Assert.assertSame; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertNull; +import static org.junit.jupiter.api.Assertions.assertSame; import com.google.api.gax.retrying.RetrySettings; import com.google.api.gax.rpc.testing.FakeCallContext; @@ -42,17 +42,14 @@ import com.google.auth.Credentials; import com.google.common.collect.ImmutableSet; import java.util.Set; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.junit.runners.JUnit4; +import org.junit.jupiter.api.Test; import org.mockito.Mockito; /** Tests for {@link UnaryCallable}. */ -@RunWith(JUnit4.class) -public class UnaryCallableTest { +class UnaryCallableTest { @Test - public void simpleCall() throws Exception { + void simpleCall() throws Exception { StashCallable stashCallable = new StashCallable<>(1); Integer response = stashCallable.call(2, FakeCallContext.createDefault()); @@ -63,7 +60,7 @@ public void simpleCall() throws Exception { } @Test - public void call() throws Exception { + void call() throws Exception { ApiCallContext defaultCallContext = FakeCallContext.createDefault(); StashCallable stashCallable = new StashCallable<>(1); UnaryCallable callable = @@ -76,7 +73,7 @@ public void call() throws Exception { } @Test - public void callWithContext() throws Exception { + void callWithContext() throws Exception { FakeChannel channel = new FakeChannel(); Credentials credentials = Mockito.mock(Credentials.class); RetrySettings retrySettings = Mockito.mock(RetrySettings.class); diff --git a/gax-java/gax/src/test/java/com/google/api/gax/rpc/WatchdogTest.java b/gax-java/gax/src/test/java/com/google/api/gax/rpc/WatchdogTest.java index e20218452c..fbcf5c3f2b 100644 --- a/gax-java/gax/src/test/java/com/google/api/gax/rpc/WatchdogTest.java +++ b/gax-java/gax/src/test/java/com/google/api/gax/rpc/WatchdogTest.java @@ -45,46 +45,42 @@ import java.util.concurrent.ScheduledFuture; import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeoutException; -import org.junit.Before; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.junit.runners.JUnit4; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; import org.mockito.Mockito; -import org.threeten.bp.Duration; -@RunWith(JUnit4.class) -public class WatchdogTest { +class WatchdogTest { private static final ScheduledExecutorService EXECUTOR = Executors.newScheduledThreadPool(1); private FakeApiClock clock; - private final Duration checkInterval = Duration.ofMillis(1000); - private Duration waitTime = Duration.ofSeconds(10); - private Duration idleTime = Duration.ofMinutes(5); + private final java.time.Duration checkInterval = java.time.Duration.ofMillis(1000); + private java.time.Duration waitTime = java.time.Duration.ofSeconds(10); + private java.time.Duration idleTime = java.time.Duration.ofMinutes(5); private Watchdog watchdog; private MockServerStreamingCallable callable; private AccumulatingObserver innerObserver; private MockServerStreamingCall call; - @Before - public void setUp() { + @BeforeEach + void setUp() { clock = new FakeApiClock(0); - watchdog = Watchdog.create(clock, checkInterval, EXECUTOR); + watchdog = Watchdog.createDuration(clock, checkInterval, EXECUTOR); callable = new MockServerStreamingCallable<>(); innerObserver = new AccumulatingObserver<>(); - callable.call("request", watchdog.watch(innerObserver, waitTime, idleTime)); + callable.call("request", watchdog.watchDuration(innerObserver, waitTime, idleTime)); call = callable.popLastCall(); } @Test - public void testRequestPassthrough() throws Exception { + void testRequestPassthrough() throws Exception { innerObserver.controller.get().request(1); assertThat(call.getController().popLastPull()).isEqualTo(1); } @Test - public void testWaitTimeout() throws Exception { + void testWaitTimeout() throws Exception { innerObserver.controller.get(1, TimeUnit.MILLISECONDS).request(1); clock.incrementNanoTime(waitTime.toNanos() - 1); @@ -108,7 +104,7 @@ public void testWaitTimeout() throws Exception { } @Test - public void testIdleTimeout() throws InterruptedException { + void testIdleTimeout() throws InterruptedException { clock.incrementNanoTime(idleTime.toNanos() - 1); watchdog.run(); assertThat(call.getController().isCancelled()).isFalse(); @@ -130,10 +126,10 @@ public void testIdleTimeout() throws InterruptedException { } @Test - public void testTimedOutBeforeStart() throws InterruptedException { + void testTimedOutBeforeStart() throws InterruptedException { MockServerStreamingCallable callable1 = new MockServerStreamingCallable<>(); AccumulatingObserver downstreamObserver1 = new AccumulatingObserver<>(); - ResponseObserver observer = watchdog.watch(downstreamObserver1, waitTime, idleTime); + ResponseObserver observer = watchdog.watchDuration(downstreamObserver1, waitTime, idleTime); clock.incrementNanoTime(idleTime.toNanos() + 1); // This should not remove callable1 from watched list watchdog.run(); @@ -155,16 +151,42 @@ public void testTimedOutBeforeStart() throws InterruptedException { } @Test - public void testMultiple() throws Exception { + void testTimedOutBeforeResponse() throws InterruptedException { + MockServerStreamingCallable autoFlowControlCallable = + new MockServerStreamingCallable<>(); + AutoFlowControlObserver downstreamObserver = new AutoFlowControlObserver<>(); + + autoFlowControlCallable.call( + "request", watchdog.watchDuration(downstreamObserver, waitTime, idleTime)); + MockServerStreamingCall call1 = autoFlowControlCallable.popLastCall(); + + clock.incrementNanoTime(idleTime.toNanos() + 1); + watchdog.run(); + assertThat(downstreamObserver.done.isDone()).isFalse(); + assertThat(call1.getController().isCancelled()).isTrue(); + call1.getController().getObserver().onError(new CancellationException("cancelled")); + + Throwable actualError = null; + try { + downstreamObserver.done.get(); + } catch (ExecutionException e) { + actualError = e.getCause(); + } + assertThat(actualError).isInstanceOf(WatchdogTimeoutException.class); + assertThat(actualError.getMessage()).contains("waiting for next response"); + } + + @Test + void testMultiple() throws Exception { // Start stream1 AccumulatingObserver downstreamObserver1 = new AccumulatingObserver<>(); - callable.call("request", watchdog.watch(downstreamObserver1, waitTime, idleTime)); + callable.call("request", watchdog.watchDuration(downstreamObserver1, waitTime, idleTime)); MockServerStreamingCall call1 = callable.popLastCall(); downstreamObserver1.controller.get().request(1); // Start stream2 AccumulatingObserver downstreamObserver2 = new AccumulatingObserver<>(); - callable.call("req2", watchdog.watch(downstreamObserver2, waitTime, idleTime)); + callable.call("req2", watchdog.watchDuration(downstreamObserver2, waitTime, idleTime)); MockServerStreamingCall call2 = callable.popLastCall(); downstreamObserver2.controller.get().request(1); @@ -194,10 +216,10 @@ public void testMultiple() throws Exception { @Test @SuppressWarnings("unchecked") - public void testWatchdogBeingClosed() { + void testWatchdogBeingClosed() { ScheduledFuture future = Mockito.mock(ScheduledFuture.class); ScheduledExecutorService mockExecutor = getMockExecutorService(future); - Watchdog underTest = Watchdog.create(clock, checkInterval, mockExecutor); + Watchdog underTest = Watchdog.createDuration(clock, checkInterval, mockExecutor); assertThat(underTest).isInstanceOf(BackgroundResource.class); underTest.close(); @@ -214,12 +236,12 @@ public void testWatchdogBeingClosed() { } @Test - public void awaitTermination_shouldReturnTrueIfFutureIsDone() throws Exception { + void awaitTermination_shouldReturnTrueIfFutureIsDone() throws Exception { int duration = 1000; TimeUnit timeUnit = TimeUnit.MILLISECONDS; ScheduledFuture future = Mockito.mock(ScheduledFuture.class); ScheduledExecutorService mockExecutor = getMockExecutorService(future); - Watchdog watchdog = Watchdog.create(clock, checkInterval, mockExecutor); + Watchdog watchdog = Watchdog.createDuration(clock, checkInterval, mockExecutor); watchdog.shutdown(); boolean actual = watchdog.awaitTermination(duration, timeUnit); @@ -228,13 +250,13 @@ public void awaitTermination_shouldReturnTrueIfFutureIsDone() throws Exception { } @Test - public void awaitTermination_shouldReturnFalseIfGettingFutureTimedOut() throws Exception { + void awaitTermination_shouldReturnFalseIfGettingFutureTimedOut() throws Exception { int duration = 1000; TimeUnit timeUnit = TimeUnit.MILLISECONDS; ScheduledFuture future = Mockito.mock(ScheduledFuture.class); Mockito.doThrow(new TimeoutException()).when(future).get(duration, timeUnit); ScheduledExecutorService mockExecutor = getMockExecutorService(future); - Watchdog watchdog = Watchdog.create(clock, checkInterval, mockExecutor); + Watchdog watchdog = Watchdog.createDuration(clock, checkInterval, mockExecutor); boolean actual = watchdog.awaitTermination(duration, timeUnit); @@ -242,13 +264,13 @@ public void awaitTermination_shouldReturnFalseIfGettingFutureTimedOut() throws E } @Test - public void awaitTermination_shouldReturnTrueIfFutureIsAlreadyCancelled() throws Exception { + void awaitTermination_shouldReturnTrueIfFutureIsAlreadyCancelled() throws Exception { int duration = 1000; TimeUnit timeUnit = TimeUnit.MILLISECONDS; ScheduledFuture future = Mockito.mock(ScheduledFuture.class); Mockito.doThrow(new CancellationException()).when(future).get(duration, timeUnit); ScheduledExecutorService mockExecutor = getMockExecutorService(future); - Watchdog watchdog = Watchdog.create(clock, checkInterval, mockExecutor); + Watchdog watchdog = Watchdog.createDuration(clock, checkInterval, mockExecutor); boolean actual = watchdog.awaitTermination(duration, timeUnit); @@ -256,7 +278,7 @@ public void awaitTermination_shouldReturnTrueIfFutureIsAlreadyCancelled() throws } @Test - public void awaitTermination_shouldReturnFalseIfGettingFutureThrowsExecutionException() + void awaitTermination_shouldReturnFalseIfGettingFutureThrowsExecutionException() throws Exception { int duration = 1000; TimeUnit timeUnit = TimeUnit.MILLISECONDS; @@ -265,7 +287,7 @@ public void awaitTermination_shouldReturnFalseIfGettingFutureThrowsExecutionExce .when(future) .get(duration, timeUnit); ScheduledExecutorService mockExecutor = getMockExecutorService(future); - Watchdog watchdog = Watchdog.create(clock, checkInterval, mockExecutor); + Watchdog watchdog = Watchdog.createDuration(clock, checkInterval, mockExecutor); boolean actual = watchdog.awaitTermination(duration, timeUnit); @@ -310,4 +332,30 @@ public void onComplete() { done.set(null); } } + + static class AutoFlowControlObserver implements ResponseObserver { + SettableApiFuture controller = SettableApiFuture.create(); + Queue responses = Queues.newLinkedBlockingDeque(); + SettableApiFuture done = SettableApiFuture.create(); + + @Override + public void onStart(StreamController controller) { + this.controller.set(controller); + } + + @Override + public void onResponse(T response) { + responses.add(response); + } + + @Override + public void onError(Throwable t) { + done.setException(t); + } + + @Override + public void onComplete() { + done.set(null); + } + } } diff --git a/gax-java/gax/src/test/java/com/google/api/gax/rpc/internal/ApiCallContextOptionsTest.java b/gax-java/gax/src/test/java/com/google/api/gax/rpc/internal/ApiCallContextOptionsTest.java index cf4f785bbb..bbfd71b9a7 100644 --- a/gax-java/gax/src/test/java/com/google/api/gax/rpc/internal/ApiCallContextOptionsTest.java +++ b/gax-java/gax/src/test/java/com/google/api/gax/rpc/internal/ApiCallContextOptionsTest.java @@ -32,19 +32,16 @@ import static com.google.common.truth.Truth.assertThat; import com.google.api.gax.rpc.ApiCallContext; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.junit.runners.JUnit4; +import org.junit.jupiter.api.Test; -@RunWith(JUnit4.class) -public class ApiCallContextOptionsTest { +class ApiCallContextOptionsTest { private static final ApiCallContext.Key INTEGER_KEY = ApiCallContext.Key.create("key1"); private static final ApiCallContext.Key STRING_KEY = ApiCallContext.Key.create("key2"); private static final ApiCallContext.Key DOUBLE_KEY = ApiCallContext.Key.create("key3"); @Test - public void testWithOption() { + void testWithOption() { ApiCallContextOptions options = ApiCallContextOptions.getDefaultOptions() .withOption(INTEGER_KEY, 1) @@ -61,7 +58,7 @@ public void testWithOption() { } @Test - public void testMergeEmpty() { + void testMergeEmpty() { ApiCallContextOptions options = ApiCallContextOptions.getDefaultOptions() .withOption(INTEGER_KEY, 1) @@ -79,7 +76,7 @@ public void testMergeEmpty() { } @Test - public void testMergeDifferentKeys() { + void testMergeDifferentKeys() { ApiCallContextOptions options1 = ApiCallContextOptions.getDefaultOptions() .withOption(INTEGER_KEY, 1) @@ -93,7 +90,7 @@ public void testMergeDifferentKeys() { } @Test - public void testMergeDuplicateKeys() { + void testMergeDuplicateKeys() { ApiCallContextOptions options1 = ApiCallContextOptions.getDefaultOptions() .withOption(INTEGER_KEY, 1) diff --git a/gax-java/gax/src/test/java/com/google/api/gax/rpc/internal/HeadersTest.java b/gax-java/gax/src/test/java/com/google/api/gax/rpc/internal/HeadersTest.java index ebcb9bd39f..7fba059a7d 100644 --- a/gax-java/gax/src/test/java/com/google/api/gax/rpc/internal/HeadersTest.java +++ b/gax-java/gax/src/test/java/com/google/api/gax/rpc/internal/HeadersTest.java @@ -36,15 +36,12 @@ import java.util.HashMap; import java.util.List; import java.util.Map; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.junit.runners.JUnit4; +import org.junit.jupiter.api.Test; -@RunWith(JUnit4.class) -public class HeadersTest { +class HeadersTest { @Test - public void testMergeHeaders() { + void testMergeHeaders() { Map> headers1 = createHeaders("key1", "value1", "key1", "value2"); Map> headers2 = createHeaders("key1", "value2", "key2", "value2"); Map> mergedHeaders = Headers.mergeHeaders(headers1, headers2); @@ -54,7 +51,7 @@ public void testMergeHeaders() { } @Test - public void testMergeHeadersEmpty() { + void testMergeHeadersEmpty() { Map> headers1 = createHeaders(); Map> headers2 = createHeaders("key1", "value1", "key2", "value2"); Map> mergedHeaders = Headers.mergeHeaders(headers1, headers2); diff --git a/gax-java/gax/src/test/java/com/google/api/gax/rpc/internal/QuotaProjectIdHidingCredentialsTest.java b/gax-java/gax/src/test/java/com/google/api/gax/rpc/internal/QuotaProjectIdHidingCredentialsTest.java index af36e0a5b7..0d9d357115 100644 --- a/gax-java/gax/src/test/java/com/google/api/gax/rpc/internal/QuotaProjectIdHidingCredentialsTest.java +++ b/gax-java/gax/src/test/java/com/google/api/gax/rpc/internal/QuotaProjectIdHidingCredentialsTest.java @@ -29,6 +29,10 @@ */ package com.google.api.gax.rpc.internal; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertTrue; + import com.google.auth.Credentials; import com.google.auth.oauth2.GoogleCredentials; import com.google.common.collect.ImmutableMap; @@ -36,20 +40,16 @@ import java.util.Collections; import java.util.List; import java.util.Map; -import org.junit.Assert; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.junit.runners.JUnit4; +import org.junit.jupiter.api.Test; import org.mockito.Mockito; -@RunWith(JUnit4.class) -public class QuotaProjectIdHidingCredentialsTest { +class QuotaProjectIdHidingCredentialsTest { private static final String QUOTA_PROJECT_ID_KEY = "x-goog-user-project"; private static final String QUOTA_PROJECT_ID_FROM_CREDENTIALS_VALUE = "quota_project_id_from_credentials"; @Test - public void quotaProjectIdHidingCredentials_getRequestMetadata() throws IOException { + void quotaProjectIdHidingCredentials_getRequestMetadata() throws IOException { // Credentials with quota project id Map> metaDataWithQuota = ImmutableMap.of( @@ -65,9 +65,9 @@ public void quotaProjectIdHidingCredentials_getRequestMetadata() throws IOExcept Map> metaDataHidingQuota = quotaProjectIdHidingCredentials.getRequestMetadata(); - Assert.assertTrue(metaDataWithQuota.containsKey(QUOTA_PROJECT_ID_KEY)); - Assert.assertFalse(metaDataHidingQuota.containsKey(QUOTA_PROJECT_ID_KEY)); - Assert.assertEquals(metaDataWithQuota.size() - 1, metaDataHidingQuota.size()); + assertTrue(metaDataWithQuota.containsKey(QUOTA_PROJECT_ID_KEY)); + assertFalse(metaDataHidingQuota.containsKey(QUOTA_PROJECT_ID_KEY)); + assertEquals(metaDataWithQuota.size() - 1, metaDataHidingQuota.size()); // Credentials without quota project id Map> metaDataWithoutQuota = @@ -80,12 +80,11 @@ public void quotaProjectIdHidingCredentials_getRequestMetadata() throws IOExcept Map> metaDataHidingQuotaWithout = quotaProjectIdHidingCredentials.getRequestMetadata(); - Assert.assertEquals( - quotaProjectIdHidingCredentialsWithout.getRequestMetadata(), metaDataWithoutQuota); + assertEquals(quotaProjectIdHidingCredentialsWithout.getRequestMetadata(), metaDataWithoutQuota); } @Test - public void quotaProjectIdHidingCredentials_getAuthenticationType() throws IOException { + void quotaProjectIdHidingCredentials_getAuthenticationType() throws IOException { final String mockType = "mock_type"; Credentials credentials = Mockito.mock(GoogleCredentials.class); Mockito.when(credentials.getAuthenticationType()).thenReturn(mockType); @@ -96,10 +95,21 @@ public void quotaProjectIdHidingCredentials_getAuthenticationType() throws IOExc new QuotaProjectIdHidingCredentials(credentials); quotaProjectIdHidingCredentials.refresh(); - Assert.assertEquals(quotaProjectIdHidingCredentials.getAuthenticationType(), mockType); - Assert.assertTrue(quotaProjectIdHidingCredentials.hasRequestMetadata()); - Assert.assertFalse(quotaProjectIdHidingCredentials.hasRequestMetadataOnly()); + assertEquals(quotaProjectIdHidingCredentials.getAuthenticationType(), mockType); + assertTrue(quotaProjectIdHidingCredentials.hasRequestMetadata()); + assertFalse(quotaProjectIdHidingCredentials.hasRequestMetadataOnly()); Mockito.verify(credentials, Mockito.atLeastOnce()).refresh(); } + + @Test + void quotaProjectIdHidingCredentials_getUniverseDomain() throws IOException { + Credentials credentials = Mockito.mock(GoogleCredentials.class); + Mockito.when(credentials.getUniverseDomain()).thenReturn("example.com"); + + QuotaProjectIdHidingCredentials quotaProjectIdHidingCredentials = + new QuotaProjectIdHidingCredentials(credentials); + + assertEquals(quotaProjectIdHidingCredentials.getUniverseDomain(), "example.com"); + } } diff --git a/gax-java/gax/src/test/java/com/google/api/gax/rpc/mtls/AbstractMtlsTransportChannelTest.java b/gax-java/gax/src/test/java/com/google/api/gax/rpc/mtls/AbstractMtlsTransportChannelTest.java index a75c7b8128..bea4674b76 100644 --- a/gax-java/gax/src/test/java/com/google/api/gax/rpc/mtls/AbstractMtlsTransportChannelTest.java +++ b/gax-java/gax/src/test/java/com/google/api/gax/rpc/mtls/AbstractMtlsTransportChannelTest.java @@ -30,16 +30,16 @@ package com.google.api.gax.rpc.mtls; -import static org.junit.Assert.assertNotNull; -import static org.junit.Assert.assertNull; -import static org.junit.Assert.assertTrue; -import static org.junit.Assert.fail; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertNull; +import static org.junit.jupiter.api.Assertions.assertThrows; +import static org.junit.jupiter.api.Assertions.assertTrue; -import com.google.api.gax.rpc.mtls.MtlsProvider.MtlsEndpointUsagePolicy; import com.google.api.gax.rpc.testing.FakeMtlsProvider; +import com.google.auth.mtls.MtlsProvider; import java.io.IOException; import java.security.GeneralSecurityException; -import org.junit.Test; +import org.junit.jupiter.api.Test; public abstract class AbstractMtlsTransportChannelTest { /** @@ -48,47 +48,49 @@ public abstract class AbstractMtlsTransportChannelTest { * GrpcTransportChannel, the mTLS object is the ChannelCredentials. The transport channel is mTLS * if and only if the related mTLS object is not null. */ - protected abstract Object getMtlsObjectFromTransportChannel(MtlsProvider provider) + protected abstract Object getMtlsObjectFromTransportChannel( + MtlsProvider provider, CertificateBasedAccess certificateBasedAccess) throws IOException, GeneralSecurityException; @Test - public void testNotUseClientCertificate() throws IOException, GeneralSecurityException { - MtlsProvider provider = - new FakeMtlsProvider(false, MtlsEndpointUsagePolicy.AUTO, null, "", false); - assertNull(getMtlsObjectFromTransportChannel(provider)); + void testNotUseClientCertificate() throws IOException, GeneralSecurityException { + CertificateBasedAccess certificateBasedAccess = + new CertificateBasedAccess( + name -> name.equals("GOOGLE_API_USE_MTLS_ENDPOINT") ? "auto" : "false"); + MtlsProvider provider = new FakeMtlsProvider(null, "", false); + assertNull(getMtlsObjectFromTransportChannel(provider, certificateBasedAccess)); } @Test - public void testUseClientCertificate() throws IOException, GeneralSecurityException { + void testUseClientCertificate() throws IOException, GeneralSecurityException { + CertificateBasedAccess certificateBasedAccess = + new CertificateBasedAccess( + name -> name.equals("GOOGLE_API_USE_MTLS_ENDPOINT") ? "auto" : "true"); MtlsProvider provider = - new FakeMtlsProvider( - true, - MtlsEndpointUsagePolicy.AUTO, - FakeMtlsProvider.createTestMtlsKeyStore(), - "", - false); - assertNotNull(getMtlsObjectFromTransportChannel(provider)); + new FakeMtlsProvider(FakeMtlsProvider.createTestMtlsKeyStore(), "", false); + assertNotNull(getMtlsObjectFromTransportChannel(provider, certificateBasedAccess)); } @Test - public void testNoClientCertificate() throws IOException, GeneralSecurityException { - MtlsProvider provider = - new FakeMtlsProvider(true, MtlsEndpointUsagePolicy.AUTO, null, "", false); - assertNull(getMtlsObjectFromTransportChannel(provider)); + void testNoClientCertificate() throws IOException, GeneralSecurityException { + CertificateBasedAccess certificateBasedAccess = + new CertificateBasedAccess( + name -> name.equals("GOOGLE_API_USE_MTLS_ENDPOINT") ? "auto" : "true"); + MtlsProvider provider = new FakeMtlsProvider(null, "", false); + assertNull(getMtlsObjectFromTransportChannel(provider, certificateBasedAccess)); } @Test - public void testGetKeyStoreThrows() throws GeneralSecurityException { + void testGetKeyStoreThrows() throws GeneralSecurityException { // Test the case where provider.getKeyStore() throws. - MtlsProvider provider = - new FakeMtlsProvider(true, MtlsEndpointUsagePolicy.AUTO, null, "", true); - try { - getMtlsObjectFromTransportChannel(provider); - fail("should throw an exception"); - } catch (IOException e) { - assertTrue( - "expected getKeyStore to throw an exception", - e.getMessage().contains("getKeyStore throws exception")); - } + CertificateBasedAccess certificateBasedAccess = + new CertificateBasedAccess( + name -> name.equals("GOOGLE_API_USE_MTLS_ENDPOINT") ? "auto" : "true"); + MtlsProvider provider = new FakeMtlsProvider(null, "", true); + IOException actual = + assertThrows( + IOException.class, + () -> getMtlsObjectFromTransportChannel(provider, certificateBasedAccess)); + assertTrue(actual.getMessage().contains("getKeyStore throws exception")); } } diff --git a/gax-java/gax/src/test/java/com/google/api/gax/rpc/mtls/CertificateBasedAccessTest.java b/gax-java/gax/src/test/java/com/google/api/gax/rpc/mtls/CertificateBasedAccessTest.java new file mode 100644 index 0000000000..e328e0af47 --- /dev/null +++ b/gax-java/gax/src/test/java/com/google/api/gax/rpc/mtls/CertificateBasedAccessTest.java @@ -0,0 +1,83 @@ +/* + * Copyright 2021 Google LLC + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Google LLC nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +package com.google.api.gax.rpc.mtls; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertTrue; + +import org.junit.jupiter.api.Test; + +class CertificateBasedAccessTest { + + @Test + void testUseMtlsEndpointAlways() { + CertificateBasedAccess cba = + new CertificateBasedAccess( + name -> name.equals("GOOGLE_API_USE_MTLS_ENDPOINT") ? "always" : "false"); + assertEquals( + CertificateBasedAccess.MtlsEndpointUsagePolicy.ALWAYS, cba.getMtlsEndpointUsagePolicy()); + } + + @Test + void testUseMtlsEndpointAuto() { + CertificateBasedAccess cba = + new CertificateBasedAccess( + name -> name.equals("GOOGLE_API_USE_MTLS_ENDPOINT") ? "auto" : "false"); + assertEquals( + CertificateBasedAccess.MtlsEndpointUsagePolicy.AUTO, cba.getMtlsEndpointUsagePolicy()); + } + + @Test + void testUseMtlsEndpointNever() { + CertificateBasedAccess cba = + new CertificateBasedAccess( + name -> name.equals("GOOGLE_API_USE_MTLS_ENDPOINT") ? "never" : "false"); + assertEquals( + CertificateBasedAccess.MtlsEndpointUsagePolicy.NEVER, cba.getMtlsEndpointUsagePolicy()); + } + + @Test + void testUseMtlsClientCertificateTrue() { + CertificateBasedAccess cba = + new CertificateBasedAccess( + name -> name.equals("GOOGLE_API_USE_CLIENT_CERTIFICATE") ? "true" : "auto"); + assertTrue(cba.useMtlsClientCertificate()); + } + + @Test + void testUseMtlsClientCertificateFalse() { + CertificateBasedAccess cba = + new CertificateBasedAccess( + name -> name.equals("GOOGLE_API_USE_CLIENT_CERTIFICATE") ? "false" : "auto"); + assertFalse(cba.useMtlsClientCertificate()); + } +} diff --git a/gax-java/gax/src/test/java/com/google/api/gax/rpc/mtls/MtlsProviderTest.java b/gax-java/gax/src/test/java/com/google/api/gax/rpc/mtls/MtlsProviderTest.java deleted file mode 100644 index 49be7aab5b..0000000000 --- a/gax-java/gax/src/test/java/com/google/api/gax/rpc/mtls/MtlsProviderTest.java +++ /dev/null @@ -1,215 +0,0 @@ -/* - * Copyright 2021 Google LLC - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following disclaimer - * in the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Google LLC nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -package com.google.api.gax.rpc.mtls; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertNull; -import static org.junit.Assert.assertTrue; -import static org.junit.Assert.fail; - -import java.io.IOException; -import java.io.InputStream; -import java.io.OutputStream; -import java.security.GeneralSecurityException; -import java.util.List; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.junit.runners.JUnit4; - -@RunWith(JUnit4.class) -public class MtlsProviderTest { - private static class TestCertProviderCommandProcess extends Process { - private boolean runForever; - private int exitValue; - - public TestCertProviderCommandProcess(int exitValue, boolean runForever) { - this.runForever = runForever; - this.exitValue = exitValue; - } - - @Override - public OutputStream getOutputStream() { - return null; - } - - @Override - public InputStream getInputStream() { - return null; - } - - @Override - public InputStream getErrorStream() { - return null; - } - - @Override - public int waitFor() throws InterruptedException { - return 0; - } - - @Override - public int exitValue() { - if (runForever) { - throw new IllegalThreadStateException(); - } - return exitValue; - } - - @Override - public void destroy() {} - } - - static class TestProcessProvider implements MtlsProvider.ProcessProvider { - private int exitCode; - - public TestProcessProvider(int exitCode) { - this.exitCode = exitCode; - } - - @Override - public Process createProcess(InputStream metadata) throws IOException { - return new TestCertProviderCommandProcess(exitCode, false); - } - } - - @Test - public void testUseMtlsEndpointAlways() { - MtlsProvider mtlsProvider = - new MtlsProvider( - name -> name.equals("GOOGLE_API_USE_MTLS_ENDPOINT") ? "always" : "false", - new TestProcessProvider(0), - "/path/to/missing/file"); - assertEquals( - MtlsProvider.MtlsEndpointUsagePolicy.ALWAYS, mtlsProvider.getMtlsEndpointUsagePolicy()); - } - - @Test - public void testUseMtlsEndpointAuto() { - MtlsProvider mtlsProvider = - new MtlsProvider( - name -> name.equals("GOOGLE_API_USE_MTLS_ENDPOINT") ? "auto" : "false", - new TestProcessProvider(0), - "/path/to/missing/file"); - assertEquals( - MtlsProvider.MtlsEndpointUsagePolicy.AUTO, mtlsProvider.getMtlsEndpointUsagePolicy()); - } - - @Test - public void testUseMtlsEndpointNever() { - MtlsProvider mtlsProvider = - new MtlsProvider( - name -> name.equals("GOOGLE_API_USE_MTLS_ENDPOINT") ? "never" : "false", - new TestProcessProvider(0), - "/path/to/missing/file"); - assertEquals( - MtlsProvider.MtlsEndpointUsagePolicy.NEVER, mtlsProvider.getMtlsEndpointUsagePolicy()); - } - - @Test - public void testUseMtlsClientCertificateTrue() { - MtlsProvider mtlsProvider = - new MtlsProvider( - name -> name.equals("GOOGLE_API_USE_MTLS_ENDPOINT") ? "auto" : "true", - new TestProcessProvider(0), - "/path/to/missing/file"); - assertTrue(mtlsProvider.useMtlsClientCertificate()); - } - - @Test - public void testUseMtlsClientCertificateFalse() { - MtlsProvider mtlsProvider = - new MtlsProvider( - name -> name.equals("GOOGLE_API_USE_MTLS_ENDPOINT") ? "auto" : "false", - new TestProcessProvider(0), - "/path/to/missing/file"); - assertFalse(mtlsProvider.useMtlsClientCertificate()); - } - - @Test - public void testGetKeyStore() throws IOException { - MtlsProvider mtlsProvider = - new MtlsProvider( - name -> name.equals("GOOGLE_API_USE_MTLS_ENDPOINT") ? "always" : "false", - new TestProcessProvider(0), - "/path/to/missing/file"); - assertNull(mtlsProvider.getKeyStore()); - } - - @Test - public void testGetKeyStoreNonZeroExitCode() - throws IOException, InterruptedException, GeneralSecurityException { - try { - InputStream metadata = - this.getClass() - .getClassLoader() - .getResourceAsStream("com/google/api/gax/rpc/mtls/mtlsCertAndKey.pem"); - MtlsProvider.getKeyStore(metadata, new TestProcessProvider(1)); - fail("should throw an exception"); - } catch (IOException e) { - assertTrue( - "expected to fail with nonzero exit code", - e.getMessage().contains("Cert provider command failed with exit code: 1")); - } - } - - @Test - public void testExtractCertificateProviderCommand() throws IOException { - InputStream inputStream = - this.getClass() - .getClassLoader() - .getResourceAsStream("com/google/api/gax/rpc/mtls/mtls_context_aware_metadata.json"); - List command = MtlsProvider.extractCertificateProviderCommand(inputStream); - assertEquals(2, command.size()); - assertEquals("some_binary", command.get(0)); - assertEquals("some_argument", command.get(1)); - } - - @Test - public void testRunCertificateProviderCommandSuccess() throws IOException, InterruptedException { - Process certCommandProcess = new TestCertProviderCommandProcess(0, false); - int exitValue = MtlsProvider.runCertificateProviderCommand(certCommandProcess, 100); - assertEquals(0, exitValue); - } - - @Test - public void testRunCertificateProviderCommandTimeout() throws InterruptedException { - Process certCommandProcess = new TestCertProviderCommandProcess(0, true); - try { - MtlsProvider.runCertificateProviderCommand(certCommandProcess, 100); - fail("should throw an exception"); - } catch (IOException e) { - assertTrue( - "expected to fail with timeout", - e.getMessage().contains("cert provider command timed out")); - } - } -} diff --git a/gax-java/gax/src/test/java/com/google/api/gax/rpc/testing/FakeCallContext.java b/gax-java/gax/src/test/java/com/google/api/gax/rpc/testing/FakeCallContext.java index 84d40e11cc..1cdefe435d 100644 --- a/gax-java/gax/src/test/java/com/google/api/gax/rpc/testing/FakeCallContext.java +++ b/gax-java/gax/src/test/java/com/google/api/gax/rpc/testing/FakeCallContext.java @@ -29,10 +29,14 @@ */ package com.google.api.gax.rpc.testing; +import static com.google.api.gax.util.TimeConversionUtils.toJavaTimeDuration; +import static com.google.api.gax.util.TimeConversionUtils.toThreetenDuration; + import com.google.api.core.InternalApi; import com.google.api.gax.retrying.RetrySettings; import com.google.api.gax.rpc.ApiCallContext; import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.EndpointContext; import com.google.api.gax.rpc.StatusCode; import com.google.api.gax.rpc.TransportChannel; import com.google.api.gax.rpc.internal.ApiCallContextOptions; @@ -48,32 +52,33 @@ import java.util.Set; import javax.annotation.Nonnull; import javax.annotation.Nullable; -import org.threeten.bp.Duration; @InternalApi("for testing") public class FakeCallContext implements ApiCallContext { private final Credentials credentials; private final FakeChannel channel; - private final Duration timeout; - private final Duration streamWaitTimeout; - private final Duration streamIdleTimeout; + private final java.time.Duration timeout; + private final java.time.Duration streamWaitTimeout; + private final java.time.Duration streamIdleTimeout; private final ImmutableMap> extraHeaders; private final ApiCallContextOptions options; private final ApiTracer tracer; private final RetrySettings retrySettings; private final ImmutableSet retryableCodes; + private final EndpointContext endpointContext; private FakeCallContext( Credentials credentials, FakeChannel channel, - Duration timeout, - Duration streamWaitTimeout, - Duration streamIdleTimeout, + java.time.Duration timeout, + java.time.Duration streamWaitTimeout, + java.time.Duration streamIdleTimeout, ImmutableMap> extraHeaders, ApiCallContextOptions options, ApiTracer tracer, RetrySettings retrySettings, - Set retryableCodes) { + Set retryableCodes, + EndpointContext endpointContext) { this.credentials = credentials; this.channel = channel; this.timeout = timeout; @@ -84,6 +89,8 @@ private FakeCallContext( this.tracer = tracer; this.retrySettings = retrySettings; this.retryableCodes = retryableCodes == null ? null : ImmutableSet.copyOf(retryableCodes); + this.endpointContext = + endpointContext == null ? EndpointContext.getDefaultInstance() : endpointContext; } public static FakeCallContext createDefault() { @@ -97,6 +104,7 @@ public static FakeCallContext createDefault() { ApiCallContextOptions.getDefaultOptions(), null, null, + null, null); } @@ -138,17 +146,17 @@ public ApiCallContext merge(ApiCallContext inputCallContext) { newCallCredentials = credentials; } - Duration newTimeout = fakeCallContext.timeout; + java.time.Duration newTimeout = fakeCallContext.timeout; if (newTimeout == null) { newTimeout = timeout; } - Duration newStreamWaitTimeout = fakeCallContext.streamWaitTimeout; + java.time.Duration newStreamWaitTimeout = fakeCallContext.streamWaitTimeout; if (newStreamWaitTimeout == null) { newStreamWaitTimeout = streamWaitTimeout; } - Duration newStreamIdleTimeout = fakeCallContext.streamIdleTimeout; + java.time.Duration newStreamIdleTimeout = fakeCallContext.streamIdleTimeout; if (newStreamIdleTimeout == null) { newStreamIdleTimeout = streamIdleTimeout; } @@ -183,7 +191,8 @@ public ApiCallContext merge(ApiCallContext inputCallContext) { newOptions, newTracer, newRetrySettings, - newRetryableCodes); + newRetryableCodes, + endpointContext); } public RetrySettings getRetrySettings() { @@ -201,7 +210,8 @@ public FakeCallContext withRetrySettings(RetrySettings retrySettings) { this.options, this.tracer, retrySettings, - this.retryableCodes); + this.retryableCodes, + this.endpointContext); } public Set getRetryableCodes() { @@ -219,7 +229,8 @@ public FakeCallContext withRetryableCodes(Set retryableCodes) { this.options, this.tracer, this.retrySettings, - retryableCodes); + retryableCodes, + this.endpointContext); } public Credentials getCredentials() { @@ -231,19 +242,31 @@ public FakeChannel getChannel() { } @Override - public Duration getTimeout() { + public java.time.Duration getTimeoutDuration() { return timeout; } + @Override + public ApiCallContext withStreamWaitTimeout( + @Nullable org.threeten.bp.Duration streamWaitTimeout) { + return withStreamWaitTimeoutDuration(toJavaTimeDuration(streamWaitTimeout)); + } + @Nullable @Override - public Duration getStreamWaitTimeout() { + public java.time.Duration getStreamWaitTimeoutDuration() { return streamWaitTimeout; } + @Override + public ApiCallContext withStreamIdleTimeout( + @Nullable org.threeten.bp.Duration streamIdleTimeout) { + return withStreamIdleTimeoutDuration(toJavaTimeDuration(streamIdleTimeout)); + } + @Nullable @Override - public Duration getStreamIdleTimeout() { + public java.time.Duration getStreamIdleTimeoutDuration() { return streamIdleTimeout; } @@ -259,7 +282,8 @@ public FakeCallContext withCredentials(Credentials credentials) { this.options, this.tracer, this.retrySettings, - this.retryableCodes); + this.retryableCodes, + this.endpointContext); } @Override @@ -273,6 +297,28 @@ public FakeCallContext withTransportChannel(TransportChannel inputChannel) { return withChannel(transportChannel.getChannel()); } + @Override + public FakeCallContext withEndpointContext(EndpointContext endpointContext) { + Preconditions.checkNotNull(endpointContext); + return new FakeCallContext( + this.credentials, + this.channel, + this.timeout, + this.streamWaitTimeout, + this.streamIdleTimeout, + this.extraHeaders, + this.options, + this.tracer, + this.retrySettings, + this.retryableCodes, + endpointContext); + } + + @Override + public FakeCallContext withTimeout(@Nullable org.threeten.bp.Duration timeout) { + return withTimeoutDuration(toJavaTimeDuration(timeout)); + } + public FakeCallContext withChannel(FakeChannel channel) { return new FakeCallContext( this.credentials, @@ -284,11 +330,12 @@ public FakeCallContext withChannel(FakeChannel channel) { this.options, this.tracer, this.retrySettings, - this.retryableCodes); + this.retryableCodes, + this.endpointContext); } @Override - public FakeCallContext withTimeout(Duration timeout) { + public FakeCallContext withTimeoutDuration(java.time.Duration timeout) { // Default RetrySettings use 0 for RPC timeout. Treat that as disabled timeouts. if (timeout != null && (timeout.isZero() || timeout.isNegative())) { timeout = null; @@ -309,11 +356,19 @@ public FakeCallContext withTimeout(Duration timeout) { this.options, this.tracer, this.retrySettings, - this.retryableCodes); + this.retryableCodes, + this.endpointContext); + } + + @Nullable + @Override + public org.threeten.bp.Duration getTimeout() { + return toThreetenDuration(getTimeoutDuration()); } @Override - public ApiCallContext withStreamWaitTimeout(@Nullable Duration streamWaitTimeout) { + public ApiCallContext withStreamWaitTimeoutDuration( + @Nullable java.time.Duration streamWaitTimeout) { return new FakeCallContext( this.credentials, this.channel, @@ -324,11 +379,19 @@ public ApiCallContext withStreamWaitTimeout(@Nullable Duration streamWaitTimeout this.options, this.tracer, this.retrySettings, - this.retryableCodes); + this.retryableCodes, + this.endpointContext); + } + + @Nullable + @Override + public org.threeten.bp.Duration getStreamWaitTimeout() { + return toThreetenDuration(getStreamWaitTimeoutDuration()); } @Override - public ApiCallContext withStreamIdleTimeout(@Nullable Duration streamIdleTimeout) { + public ApiCallContext withStreamIdleTimeoutDuration( + @Nullable java.time.Duration streamIdleTimeout) { Preconditions.checkNotNull(streamIdleTimeout); return new FakeCallContext( this.credentials, @@ -340,7 +403,14 @@ public ApiCallContext withStreamIdleTimeout(@Nullable Duration streamIdleTimeout this.options, this.tracer, this.retrySettings, - this.retryableCodes); + this.retryableCodes, + this.endpointContext); + } + + @Nullable + @Override + public org.threeten.bp.Duration getStreamIdleTimeout() { + return toThreetenDuration(getStreamIdleTimeoutDuration()); } @Override @@ -358,7 +428,8 @@ public ApiCallContext withExtraHeaders(Map> extraHeaders) { this.options, this.tracer, this.retrySettings, - this.retryableCodes); + this.retryableCodes, + this.endpointContext); } @Override @@ -380,7 +451,8 @@ public ApiCallContext withOption(Key key, T value) { newOptions, tracer, retrySettings, - retryableCodes); + retryableCodes, + this.endpointContext); } @Override @@ -414,7 +486,8 @@ public ApiCallContext withTracer(@Nonnull ApiTracer tracer) { this.options, tracer, this.retrySettings, - this.retryableCodes); + this.retryableCodes, + this.endpointContext); } public static FakeCallContext create(ClientContext clientContext) { diff --git a/gax-java/gax/src/test/java/com/google/api/gax/rpc/testing/FakeMtlsProvider.java b/gax-java/gax/src/test/java/com/google/api/gax/rpc/testing/FakeMtlsProvider.java index e5f5c3a91a..abe374dac6 100644 --- a/gax-java/gax/src/test/java/com/google/api/gax/rpc/testing/FakeMtlsProvider.java +++ b/gax-java/gax/src/test/java/com/google/api/gax/rpc/testing/FakeMtlsProvider.java @@ -32,42 +32,24 @@ import com.google.api.client.util.SecurityUtils; import com.google.api.core.InternalApi; -import com.google.api.gax.rpc.mtls.MtlsProvider; +import com.google.auth.mtls.MtlsProvider; import java.io.IOException; import java.io.InputStream; import java.security.GeneralSecurityException; import java.security.KeyStore; @InternalApi("for testing") -public class FakeMtlsProvider extends MtlsProvider { - private boolean useClientCertificate; - private MtlsEndpointUsagePolicy mtlsEndpointUsagePolicy; +public class FakeMtlsProvider implements MtlsProvider { private KeyStore keyStore; private boolean throwExceptionForGetKeyStore; public FakeMtlsProvider( - boolean useClientCertificate, - MtlsEndpointUsagePolicy mtlsEndpointUsagePolicy, - KeyStore keystore, - String keyStorePassword, - boolean throwExceptionForGetKeyStore) { + KeyStore keystore, String keyStorePassword, boolean throwExceptionForGetKeyStore) { super(); - this.useClientCertificate = useClientCertificate; - this.mtlsEndpointUsagePolicy = mtlsEndpointUsagePolicy; this.keyStore = keystore; this.throwExceptionForGetKeyStore = throwExceptionForGetKeyStore; } - @Override - public boolean useMtlsClientCertificate() { - return useClientCertificate; - } - - @Override - public MtlsEndpointUsagePolicy getMtlsEndpointUsagePolicy() { - return mtlsEndpointUsagePolicy; - } - @Override public KeyStore getKeyStore() throws IOException { if (throwExceptionForGetKeyStore) { @@ -76,6 +58,11 @@ public KeyStore getKeyStore() throws IOException { return keyStore; } + @Override + public boolean isAvailable() throws IOException { + return true; + } + public static KeyStore createTestMtlsKeyStore() throws IOException { try { InputStream certAndKey = diff --git a/gax-java/gax/src/test/java/com/google/api/gax/rpc/testing/FakeStubSettings.java b/gax-java/gax/src/test/java/com/google/api/gax/rpc/testing/FakeStubSettings.java index 2c41d75a47..4004a24404 100644 --- a/gax-java/gax/src/test/java/com/google/api/gax/rpc/testing/FakeStubSettings.java +++ b/gax-java/gax/src/test/java/com/google/api/gax/rpc/testing/FakeStubSettings.java @@ -30,17 +30,31 @@ package com.google.api.gax.rpc.testing; import com.google.api.core.InternalApi; +import com.google.api.gax.core.GoogleCredentialsProvider; import com.google.api.gax.rpc.ClientContext; import com.google.api.gax.rpc.StubSettings; +import com.google.common.collect.ImmutableList; import java.io.IOException; @InternalApi("for testing") public class FakeStubSettings extends StubSettings { + private static final ImmutableList DEFAULT_SERVICE_SCOPES = + ImmutableList.builder().build(); + private FakeStubSettings(Builder builder) throws IOException { super(builder); } + public static Builder newBuilder() { + return Builder.createDefault(); + } + + @Override + public String getServiceName() { + return "test"; + } + @Override public StubSettings.Builder toBuilder() { return new Builder(this); @@ -64,5 +78,20 @@ public Builder() { public com.google.api.gax.rpc.testing.FakeStubSettings build() throws IOException { return new com.google.api.gax.rpc.testing.FakeStubSettings(this); } + + /** Returns default settings values. */ + public static Builder createDefault() { + Builder builder = new Builder(((ClientContext) null)); + builder.setCredentialsProvider(defaultCredentialsProviderBuilder()); + return builder; + } + + /** Returns default credentials provider. */ + public static GoogleCredentialsProvider defaultCredentialsProviderBuilder() { + return GoogleCredentialsProvider.newBuilder() + .setScopesToApply(DEFAULT_SERVICE_SCOPES) + .setUseJwtAccessWithScope(true) + .build(); + } } } diff --git a/gax-java/gax/src/test/java/com/google/api/gax/tracing/ApiTracerContextTest.java b/gax-java/gax/src/test/java/com/google/api/gax/tracing/ApiTracerContextTest.java new file mode 100644 index 0000000000..b465dfbebe --- /dev/null +++ b/gax-java/gax/src/test/java/com/google/api/gax/tracing/ApiTracerContextTest.java @@ -0,0 +1,410 @@ +/* + * Copyright 2026 Google LLC + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Google LLC nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +package com.google.api.gax.tracing; + +import static com.google.common.truth.Truth.assertThat; + +import com.google.api.gax.rpc.LibraryMetadata; +import java.util.Map; +import org.junit.jupiter.api.Test; + +class ApiTracerContextTest { + + @Test + void testGetAttemptAttributes_serverAddress() { + ApiTracerContext context = + ApiTracerContext.newBuilder() + .setLibraryMetadata(LibraryMetadata.empty()) + .setServerAddress("test-address") + .build(); + Map attributes = context.getAttemptAttributes(); + + assertThat(attributes) + .containsEntry(ObservabilityAttributes.SERVER_ADDRESS_ATTRIBUTE, "test-address"); + } + + @Test + void testGetAttemptAttributes_repo() { + LibraryMetadata libraryMetadata = + LibraryMetadata.newBuilder().setRepository("test-repo").build(); + ApiTracerContext context = + ApiTracerContext.newBuilder().setLibraryMetadata(libraryMetadata).build(); + Map attributes = context.getAttemptAttributes(); + + assertThat(attributes).containsEntry(ObservabilityAttributes.REPO_ATTRIBUTE, "test-repo"); + } + + @Test + void testGetAttemptAttributes_artifact() { + LibraryMetadata libraryMetadata = + LibraryMetadata.newBuilder().setArtifactName("test-artifact").build(); + ApiTracerContext context = + ApiTracerContext.newBuilder().setLibraryMetadata(libraryMetadata).build(); + Map attributes = context.getAttemptAttributes(); + + assertThat(attributes) + .containsEntry(ObservabilityAttributes.ARTIFACT_ATTRIBUTE, "test-artifact"); + } + + @Test + void testGetAttemptAttributes_version() { + LibraryMetadata libraryMetadata = LibraryMetadata.newBuilder().setVersion("1.2.3").build(); + ApiTracerContext context = + ApiTracerContext.newBuilder().setLibraryMetadata(libraryMetadata).build(); + Map attributes = context.getAttemptAttributes(); + + assertThat(attributes).containsEntry(ObservabilityAttributes.VERSION_ATTRIBUTE, "1.2.3"); + } + + @Test + void testGetAttemptAttributes_httpMethod() { + ApiTracerContext context = + ApiTracerContext.newBuilder() + .setLibraryMetadata(LibraryMetadata.empty()) + .setTransport(ApiTracerContext.Transport.HTTP) + .setHttpMethod("POST") + .build(); + Map attributes = context.getAttemptAttributes(); + + assertThat(attributes).containsEntry(ObservabilityAttributes.HTTP_METHOD_ATTRIBUTE, "POST"); + } + + @Test + void testGetAttemptAttributes_httpMethod_notHttpTransport() { + ApiTracerContext context = + ApiTracerContext.newBuilder() + .setLibraryMetadata(LibraryMetadata.empty()) + .setTransport(ApiTracerContext.Transport.GRPC) + .setHttpMethod("POST") + .build(); + Map attributes = context.getAttemptAttributes(); + + assertThat(attributes).doesNotContainKey(ObservabilityAttributes.HTTP_METHOD_ATTRIBUTE); + } + + @Test + void testGetAttemptAttributes_fullMethodName_noTransport_notPresent() { + ApiTracerContext context = + ApiTracerContext.newBuilder() + .setLibraryMetadata(LibraryMetadata.empty()) + .setFullMethodName("google.pubsub.v1.Publisher/Publish") + .build(); + Map attributes = context.getAttemptAttributes(); + + assertThat(attributes).doesNotContainKey(ObservabilityAttributes.GRPC_RPC_METHOD_ATTRIBUTE); + } + + @Test + void testGetAttemptAttributes_fullMethodName_grpcTransport_present() { + ApiTracerContext context = + ApiTracerContext.newBuilder() + .setLibraryMetadata(LibraryMetadata.empty()) + .setFullMethodName("google.pubsub.v1.Publisher/Publish") + .setTransport(ApiTracerContext.Transport.GRPC) + .build(); + Map attributes = context.getAttemptAttributes(); + + assertThat(attributes) + .containsEntry( + ObservabilityAttributes.GRPC_RPC_METHOD_ATTRIBUTE, + "google.pubsub.v1.Publisher/Publish"); + } + + @Test + void testGetAttemptAttributes_rpcSystemName() { + ApiTracerContext context = + ApiTracerContext.newBuilder() + .setLibraryMetadata(LibraryMetadata.empty()) + .setTransport(ApiTracerContext.Transport.GRPC) + .build(); + Map attributes = context.getAttemptAttributes(); + + assertThat(attributes).containsEntry(ObservabilityAttributes.RPC_SYSTEM_NAME_ATTRIBUTE, "grpc"); + } + + @Test + void testGetAttemptAttributes_httpPathTemplate() { + ApiTracerContext context = + ApiTracerContext.newBuilder() + .setLibraryMetadata(LibraryMetadata.empty()) + .setTransport(ApiTracerContext.Transport.HTTP) + .setHttpPathTemplate("the-template") + .build(); + Map attributes = context.getAttemptAttributes(); + + assertThat(attributes) + .containsEntry(ObservabilityAttributes.HTTP_URL_TEMPLATE_ATTRIBUTE, "the-template"); + } + + @Test + void testGetAttemptAttributes_empty() { + ApiTracerContext context = ApiTracerContext.empty(); + Map attributes = context.getAttemptAttributes(); + + assertThat(attributes).isEmpty(); + } + + @Test + void testGetAttemptAttributes_emptyStrings() { + LibraryMetadata libraryMetadata = + LibraryMetadata.newBuilder().setRepository("").setArtifactName("").setVersion("").build(); + ApiTracerContext context = + ApiTracerContext.newBuilder() + .setLibraryMetadata(libraryMetadata) + .setServerAddress("") + .build(); + Map attributes = context.getAttemptAttributes(); + + assertThat(attributes).isEmpty(); + } + + @Test + void testGetMetricsAttributes_serverPort() { + ApiTracerContext context = + ApiTracerContext.newBuilder() + .setLibraryMetadata(LibraryMetadata.empty()) + .setServerPort(8080) + .build(); + Map attributes = context.getMetricsAttributes(); + + assertThat(attributes).containsEntry(ObservabilityAttributes.SERVER_PORT_ATTRIBUTE, 8080); + } + + @Test + void testGetMetricsAttributes_rpcSystemName() { + ApiTracerContext context = + ApiTracerContext.newBuilder() + .setLibraryMetadata(LibraryMetadata.empty()) + .setTransport(ApiTracerContext.Transport.GRPC) + .build(); + Map attributes = context.getMetricsAttributes(); + + assertThat(attributes).containsEntry(ObservabilityAttributes.RPC_SYSTEM_NAME_ATTRIBUTE, "grpc"); + } + + @Test + void testGetMetricsAttributes_fullMethodName() { + ApiTracerContext context = + ApiTracerContext.newBuilder() + .setLibraryMetadata(LibraryMetadata.empty()) + .setFullMethodName("google.pubsub.v1.Publisher/Publish") + .build(); + Map attributes = context.getMetricsAttributes(); + + assertThat(attributes) + .containsEntry( + ObservabilityAttributes.GRPC_RPC_METHOD_ATTRIBUTE, + "google.pubsub.v1.Publisher/Publish"); + } + + @Test + void testGetMetricsAttributes_serverAddress() { + ApiTracerContext context = + ApiTracerContext.newBuilder() + .setLibraryMetadata(LibraryMetadata.empty()) + .setServerAddress("test-metrics-address") + .build(); + Map attributes = context.getMetricsAttributes(); + + assertThat(attributes) + .containsEntry(ObservabilityAttributes.SERVER_ADDRESS_ATTRIBUTE, "test-metrics-address"); + } + + @Test + void testGetMetricsAttributes_serviceName() { + ApiTracerContext context = + ApiTracerContext.newBuilder() + .setLibraryMetadata(LibraryMetadata.empty()) + .setServiceName("test-service") + .build(); + Map attributes = context.getMetricsAttributes(); + + assertThat(attributes) + .containsEntry(ObservabilityAttributes.GCP_CLIENT_SERVICE_ATTRIBUTE, "test-service"); + } + + @Test + void testGetMetricsAttributes_urlDomain() { + ApiTracerContext context = + ApiTracerContext.newBuilder() + .setLibraryMetadata(LibraryMetadata.empty()) + .setTransport(ApiTracerContext.Transport.HTTP) + .setUrlDomain("test-domain.com") + .build(); + Map attributes = context.getMetricsAttributes(); + + assertThat(attributes) + .containsEntry(ObservabilityAttributes.URL_DOMAIN_ATTRIBUTE, "test-domain.com"); + } + + @Test + void testGetMetricsAttributes_urlTemplate() { + ApiTracerContext context = + ApiTracerContext.newBuilder() + .setLibraryMetadata(LibraryMetadata.empty()) + .setTransport(ApiTracerContext.Transport.HTTP) + .setHttpPathTemplate("/v1/test/{template}") + .build(); + Map attributes = context.getMetricsAttributes(); + + assertThat(attributes) + .containsEntry(ObservabilityAttributes.URL_TEMPLATE_ATTRIBUTE, "/v1/test/{template}"); + } + + @Test + void testGetAttemptAttributes_destinationResourceId() { + ApiTracerContext context = + ApiTracerContext.newBuilder() + .setLibraryMetadata(LibraryMetadata.empty()) + .setDestinationResourceId("projects/123/instances/abc") + .build(); + Map attributes = context.getAttemptAttributes(); + + assertThat(attributes) + .containsEntry( + ObservabilityAttributes.DESTINATION_RESOURCE_ID_ATTRIBUTE, + "projects/123/instances/abc"); + } + + @Test + void testGetMetricsAttributes_urlDomain_notHttp() { + ApiTracerContext context = + ApiTracerContext.newBuilder() + .setLibraryMetadata(LibraryMetadata.empty()) + .setTransport(ApiTracerContext.Transport.GRPC) + .setUrlDomain("test-domain.com") + .build(); + Map attributes = context.getMetricsAttributes(); + + assertThat(attributes).doesNotContainKey(ObservabilityAttributes.URL_DOMAIN_ATTRIBUTE); + } + + @Test + void testGetMetricsAttributes_urlTemplate_notHttp() { + ApiTracerContext context = + ApiTracerContext.newBuilder() + .setLibraryMetadata(LibraryMetadata.empty()) + .setTransport(ApiTracerContext.Transport.GRPC) + .setHttpPathTemplate("/v1/test/{template}") + .build(); + Map attributes = context.getMetricsAttributes(); + + assertThat(attributes).doesNotContainKey(ObservabilityAttributes.URL_TEMPLATE_ATTRIBUTE); + } + + @Test + void testMerge() { + LibraryMetadata metadata = LibraryMetadata.newBuilder().setRepository("repo").build(); + ApiTracerContext context1 = + ApiTracerContext.newBuilder() + .setServerAddress("address1") + .setLibraryMetadata(metadata) + .setFullMethodName("method1") + .setTransport(ApiTracerContext.Transport.HTTP) + .build(); + + LibraryMetadata metadata2 = LibraryMetadata.newBuilder().setArtifactName("artifact").build(); + ApiTracerContext context2 = + ApiTracerContext.newBuilder() + .setServerAddress("address2") + .setLibraryMetadata(metadata2) + .setFullMethodName("method2") + .setTransport(ApiTracerContext.Transport.GRPC) + .build(); + + ApiTracerContext merged = context1.merge(context2); + + assertThat(merged.serverAddress()).isEqualTo("address2"); + assertThat(merged.libraryMetadata().artifactName()).isEqualTo("artifact"); + // Note: LibraryMetadata.merge is not called in ApiTracerContext.merge, it replaces it if not + // empty. + assertThat(merged.libraryMetadata().repository()).isNull(); + assertThat(merged.fullMethodName()).isEqualTo("method2"); + assertThat(merged.transport()).isEqualTo(ApiTracerContext.Transport.GRPC); + } + + @Test + void testMerge_destinationResourceId() { + ApiTracerContext context1 = + ApiTracerContext.newBuilder() + .setLibraryMetadata(LibraryMetadata.empty()) + .setDestinationResourceId("name1") + .build(); + + ApiTracerContext context2 = + ApiTracerContext.newBuilder() + .setLibraryMetadata(LibraryMetadata.empty()) + .setDestinationResourceId("name2") + .build(); + + ApiTracerContext merged = context1.merge(context2); + assertThat(merged.destinationResourceId()).isEqualTo("name2"); + + ApiTracerContext context3 = + ApiTracerContext.newBuilder().setLibraryMetadata(LibraryMetadata.empty()).build(); + ApiTracerContext merged2 = context1.merge(context3); + assertThat(merged2.destinationResourceId()) + .isEqualTo("name1"); // Should retain old if new is null/empty + } + + @Test + void testMerge_emptyOther() { + ApiTracerContext context1 = + ApiTracerContext.newBuilder() + .setServerAddress("address1") + .setLibraryMetadata(LibraryMetadata.newBuilder().setRepository("repo").build()) + .setFullMethodName("method1") + .setTransport(ApiTracerContext.Transport.HTTP) + .build(); + + ApiTracerContext merged = context1.merge(ApiTracerContext.empty()); + + assertThat(merged).isEqualTo(context1); + } + + @Test + void testMerge_httpFields() { + ApiTracerContext context1 = + ApiTracerContext.newBuilder() + .setLibraryMetadata(LibraryMetadata.empty()) + .setHttpMethod("GET") + .build(); + ApiTracerContext context2 = + ApiTracerContext.newBuilder() + .setLibraryMetadata(LibraryMetadata.empty()) + .setHttpPathTemplate("v1/projects/{project}") + .build(); + + ApiTracerContext merged = context1.merge(context2); + assertThat(merged.httpMethod()).isEqualTo("GET"); + assertThat(merged.httpPathTemplate()).isEqualTo("v1/projects/{project}"); + } +} diff --git a/gax-java/gax/src/test/java/com/google/api/gax/tracing/BaseApiTracerTest.java b/gax-java/gax/src/test/java/com/google/api/gax/tracing/BaseApiTracerTest.java new file mode 100644 index 0000000000..8397efbb7d --- /dev/null +++ b/gax-java/gax/src/test/java/com/google/api/gax/tracing/BaseApiTracerTest.java @@ -0,0 +1,162 @@ +/* + * Copyright 2024 Google LLC + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Google LLC nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +package com.google.api.gax.tracing; + +import org.junit.jupiter.api.Test; + +public class BaseApiTracerTest { + + @Test + public void testInScope() { + BaseApiTracer tracer = new BaseApiTracer(); + ApiTracer.Scope scope = tracer.inScope(); + scope.close(); + // No-op, so nothing to verify. + } + + @Test + public void testOperationSucceeded() { + BaseApiTracer tracer = new BaseApiTracer(); + tracer.operationSucceeded(); + // No-op, so nothing to verify. + } + + @Test + public void testOperationCancelled() { + BaseApiTracer tracer = new BaseApiTracer(); + tracer.operationCancelled(); + // No-op, so nothing to verify. + } + + @Test + public void testOperationFailed() { + BaseApiTracer tracer = new BaseApiTracer(); + tracer.operationFailed(new RuntimeException()); + // No-op, so nothing to verify. + } + + @Test + public void testConnectionSelected() { + BaseApiTracer tracer = new BaseApiTracer(); + tracer.connectionSelected("test-connection"); + // No-op, so nothing to verify. + } + + @Test + public void testAttemptStarted() { + BaseApiTracer tracer = new BaseApiTracer(); + tracer.attemptStarted(1); + // No-op, so nothing to verify. + } + + @Test + public void testAttemptStartedWithRequest() { + BaseApiTracer tracer = new BaseApiTracer(); + tracer.attemptStarted(new Object(), 1); + // No-op, so nothing to verify. + } + + @Test + public void testAttemptSucceeded() { + BaseApiTracer tracer = new BaseApiTracer(); + tracer.attemptSucceeded(); + // No-op, so nothing to verify. + } + + @Test + public void testAttemptCancelled() { + BaseApiTracer tracer = new BaseApiTracer(); + tracer.attemptCancelled(); + // No-op, so nothing to verify. + } + + @Test + public void testAttemptFailedDuration() { + BaseApiTracer tracer = new BaseApiTracer(); + tracer.attemptFailedDuration(new RuntimeException(), java.time.Duration.ofMillis(100)); + // No-op, so nothing to verify. + } + + @Test + public void testAttemptFailed() { + BaseApiTracer tracer = new BaseApiTracer(); + tracer.attemptFailed(new RuntimeException(), org.threeten.bp.Duration.ofMillis(100)); + // No-op, so nothing to verify. + } + + @Test + public void testAttemptFailedRetriesExhausted() { + BaseApiTracer tracer = new BaseApiTracer(); + tracer.attemptFailedRetriesExhausted(new RuntimeException()); + // No-op, so nothing to verify. + } + + @Test + public void testAttemptPermanentFailure() { + BaseApiTracer tracer = new BaseApiTracer(); + tracer.attemptPermanentFailure(new RuntimeException()); + // No-op, so nothing to verify. + } + + @Test + public void testLroStartFailed() { + BaseApiTracer tracer = new BaseApiTracer(); + tracer.lroStartFailed(new RuntimeException()); + // No-op, so nothing to verify. + } + + @Test + public void testLroStartSucceeded() { + BaseApiTracer tracer = new BaseApiTracer(); + tracer.lroStartSucceeded(); + // No-op, so nothing to verify. + } + + @Test + public void testResponseReceived() { + BaseApiTracer tracer = new BaseApiTracer(); + tracer.responseReceived(); + // No-op, so nothing to verify. + } + + @Test + public void testRequestSent() { + BaseApiTracer tracer = new BaseApiTracer(); + tracer.requestSent(); + // No-op, so nothing to verify. + } + + @Test + public void testBatchRequestSent() { + BaseApiTracer tracer = new BaseApiTracer(); + tracer.batchRequestSent(10, 100); + // No-op, so nothing to verify. + } +} diff --git a/gax-java/gax/src/test/java/com/google/api/gax/tracing/GoldenSignalsMetricsRecorderTest.java b/gax-java/gax/src/test/java/com/google/api/gax/tracing/GoldenSignalsMetricsRecorderTest.java new file mode 100644 index 0000000000..3476e64a72 --- /dev/null +++ b/gax-java/gax/src/test/java/com/google/api/gax/tracing/GoldenSignalsMetricsRecorderTest.java @@ -0,0 +1,117 @@ +/* + * Copyright 2026 Google LLC + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Google LLC nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +package com.google.api.gax.tracing; + +import static com.google.api.gax.tracing.GoldenSignalsMetricsRecorder.BOUNDARIES; +import static com.google.api.gax.tracing.GoldenSignalsMetricsRecorder.CLIENT_REQUEST_DURATION_METRIC_DESCRIPTION; +import static com.google.api.gax.tracing.GoldenSignalsMetricsRecorder.CLIENT_REQUEST_DURATION_METRIC_NAME; +import static com.google.common.truth.Truth.assertThat; + +import com.google.common.collect.ImmutableMap; +import io.opentelemetry.api.OpenTelemetry; +import io.opentelemetry.api.common.AttributeKey; +import io.opentelemetry.api.common.Attributes; +import io.opentelemetry.sdk.OpenTelemetrySdk; +import io.opentelemetry.sdk.metrics.SdkMeterProvider; +import io.opentelemetry.sdk.metrics.data.MetricData; +import io.opentelemetry.sdk.testing.exporter.InMemoryMetricReader; +import java.util.Collection; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; + +class GoldenSignalsMetricsRecorderTest { + private static final String ARTIFACT_NAME = "test-library"; + private static final String ATTRIBUTE_1 = "attribute_1"; + private static final String VALUE_1 = "value_1"; + + private InMemoryMetricReader metricReader; + + private GoldenSignalsMetricsRecorder recorder; + + @BeforeEach + void setUp() { + metricReader = InMemoryMetricReader.create(); + SdkMeterProvider meterProvider = + SdkMeterProvider.builder().registerMetricReader(metricReader).build(); + OpenTelemetry openTelemetry = + OpenTelemetrySdk.builder().setMeterProvider(meterProvider).build(); + recorder = new GoldenSignalsMetricsRecorder(openTelemetry, ARTIFACT_NAME); + } + + @Test + void recordOperationLatency_shouldRecordMeterInfo() { + recorder.recordOperationLatency(0.012, ImmutableMap.of(ATTRIBUTE_1, VALUE_1)); + + Collection metrics = metricReader.collectAllMetrics(); + assertThat(metrics).hasSize(1); + MetricData metricData = metrics.iterator().next(); + + assertThat(metricData.getName()).isEqualTo(CLIENT_REQUEST_DURATION_METRIC_NAME); + assertThat(metricData.getDescription()).isEqualTo(CLIENT_REQUEST_DURATION_METRIC_DESCRIPTION); + assertThat(metricData.getUnit()).isEqualTo("s"); + assertThat(metricData.getInstrumentationScopeInfo().getName()).isEqualTo(ARTIFACT_NAME); + } + + @Test + void recordOperationLatency_shouldRecordWithBoundaries() { + recorder.recordOperationLatency(0.012, ImmutableMap.of(ATTRIBUTE_1, VALUE_1)); + + Collection metrics = metricReader.collectAllMetrics(); + assertThat(metrics).hasSize(1); + MetricData metricData = metrics.iterator().next(); + + assertThat(metricData.getHistogramData().getPoints().iterator().next().getBoundaries()) + .isEqualTo(BOUNDARIES); + } + + @Test + void recordOperationLatency_shouldRecordMetrics() { + recorder.recordOperationLatency(0.012, ImmutableMap.of(ATTRIBUTE_1, VALUE_1)); + + Collection metrics = metricReader.collectAllMetrics(); + assertThat(metrics).hasSize(1); + MetricData metricData = metrics.iterator().next(); + + assertThat(metricData.getHistogramData().getPoints()).hasSize(1); + assertThat(metricData.getHistogramData().getPoints().iterator().next().getMax()).isNonZero(); + } + + @Test + void recordOperationLatency_shouldRecordMetricAttributes() { + recorder.recordOperationLatency(0.012, ImmutableMap.of(ATTRIBUTE_1, VALUE_1)); + + Collection metrics = metricReader.collectAllMetrics(); + assertThat(metrics).hasSize(1); + MetricData metricData = metrics.iterator().next(); + + assertThat(metricData.getHistogramData().getPoints().iterator().next().getAttributes()) + .isEqualTo(Attributes.of(AttributeKey.stringKey(ATTRIBUTE_1), VALUE_1)); + } +} diff --git a/gax-java/gax/src/test/java/com/google/api/gax/tracing/GoldenSignalsMetricsTracerFactoryTest.java b/gax-java/gax/src/test/java/com/google/api/gax/tracing/GoldenSignalsMetricsTracerFactoryTest.java new file mode 100644 index 0000000000..9726101c07 --- /dev/null +++ b/gax-java/gax/src/test/java/com/google/api/gax/tracing/GoldenSignalsMetricsTracerFactoryTest.java @@ -0,0 +1,87 @@ +/* + * Copyright 2026 Google LLC + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Google LLC nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +package com.google.api.gax.tracing; + +import static com.google.common.truth.Truth.assertThat; +import static org.mockito.Answers.RETURNS_DEEP_STUBS; +import static org.mockito.Mockito.*; + +import io.opentelemetry.api.OpenTelemetry; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; + +class GoldenSignalsMetricsTracerFactoryTest { + + private GoldenSignalsMetricsTracerFactory tracerFactory; + + @BeforeEach + void setUp() { + tracerFactory = new GoldenSignalsMetricsTracerFactory(OpenTelemetry.noop()); + } + + @Test + void newTracerWithSpanName_shouldCreateTracer_ifMetricsRecorderIsNotNull() { + tracerFactory.withContext(ApiTracerContext.empty()); + ApiTracer actual = + tracerFactory.newTracer( + mock(ApiTracer.class), mock(SpanName.class), ApiTracerFactory.OperationType.Unary); + assertThat(actual).isInstanceOf(GoldenSignalsMetricsTracer.class); + } + + @Test + void newTracerWithSpanName_shouldCreateBaseTracer_ifMetricsRecorderIsNull() { + ApiTracer actual = + tracerFactory.newTracer( + mock(ApiTracer.class), mock(SpanName.class), ApiTracerFactory.OperationType.Unary); + assertThat(actual).isInstanceOf(BaseApiTracer.class); + } + + @Test + void newTracerWithApiTracerContext_shouldMergeApiTracerContext() { + ApiTracerContext clientLevelTracerContext = mock(ApiTracerContext.class, RETURNS_DEEP_STUBS); + ApiTracerContext methodLevelTracerContext = mock(ApiTracerContext.class); + when(clientLevelTracerContext.libraryMetadata().artifactName()).thenReturn("does not matter"); + when(clientLevelTracerContext.merge(methodLevelTracerContext)) + .thenReturn(clientLevelTracerContext); + + tracerFactory.withContext(clientLevelTracerContext); + ApiTracer actual = tracerFactory.newTracer(mock(ApiTracer.class), methodLevelTracerContext); + + verify(clientLevelTracerContext).merge(methodLevelTracerContext); + assertThat(actual).isInstanceOf(GoldenSignalsMetricsTracer.class); + } + + @Test + void newTracerWithApiTracerContext_shouldCreateBaseTracer_ifMetricsRecorderIsNull() { + ApiTracer actual = tracerFactory.newTracer(mock(ApiTracer.class), mock(ApiTracerContext.class)); + + assertThat(actual).isInstanceOf(BaseApiTracer.class); + } +} diff --git a/gax-java/gax/src/test/java/com/google/api/gax/tracing/GoldenSignalsMetricsTracerTest.java b/gax-java/gax/src/test/java/com/google/api/gax/tracing/GoldenSignalsMetricsTracerTest.java new file mode 100644 index 0000000000..1d70445a3e --- /dev/null +++ b/gax-java/gax/src/test/java/com/google/api/gax/tracing/GoldenSignalsMetricsTracerTest.java @@ -0,0 +1,169 @@ +/* + * Copyright 2026 Google LLC + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Google LLC nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +package com.google.api.gax.tracing; + +import static com.google.api.gax.tracing.ObservabilityAttributes.RPC_RESPONSE_STATUS_ATTRIBUTE; +import static com.google.common.truth.Truth.assertThat; + +import com.google.api.gax.rpc.ApiException; +import com.google.api.gax.rpc.StatusCode; +import com.google.api.gax.rpc.testing.FakeStatusCode; +import com.google.common.testing.FakeTicker; +import io.opentelemetry.api.OpenTelemetry; +import io.opentelemetry.api.common.AttributeKey; +import io.opentelemetry.api.common.Attributes; +import io.opentelemetry.sdk.OpenTelemetrySdk; +import io.opentelemetry.sdk.metrics.SdkMeterProvider; +import io.opentelemetry.sdk.metrics.data.MetricData; +import io.opentelemetry.sdk.testing.exporter.InMemoryMetricReader; +import java.util.Collection; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; + +class GoldenSignalsMetricsTracerTest { + private static final String ARTIFACT_NAME = "test-library"; + public static final int TEST_REQUEST_DURATION_NANO = 2345698; + public static final double EXPECTED_REQUEST_DURATION_SECOND = 2345698 / 1_000_000_000.0; + + private InMemoryMetricReader metricReader; + + private GoldenSignalsMetricsTracer tracer; + + private FakeTicker ticker; + + @BeforeEach + void setUp() { + metricReader = InMemoryMetricReader.create(); + SdkMeterProvider meterProvider = + SdkMeterProvider.builder().registerMetricReader(metricReader).build(); + OpenTelemetry openTelemetry = + OpenTelemetrySdk.builder().setMeterProvider(meterProvider).build(); + ticker = new FakeTicker(); + tracer = + new GoldenSignalsMetricsTracer( + new GoldenSignalsMetricsRecorder(openTelemetry, ARTIFACT_NAME), + ApiTracerContext.empty(), + ticker); + } + + @Test + void operationSucceeded_shouldRecordsDuration() { + ticker.advance(TEST_REQUEST_DURATION_NANO); + tracer.operationSucceeded(); + + Collection metrics = metricReader.collectAllMetrics(); + assertThat(metrics).hasSize(1); + MetricData metricData = metrics.iterator().next(); + + assertThat(metricData.getHistogramData().getPoints()).hasSize(1); + assertThat(metricData.getHistogramData().getPoints().iterator().next().getMax()) + .isEqualTo(EXPECTED_REQUEST_DURATION_SECOND); + } + + @Test + void operationSucceeded_shouldRecordsOKStatus() { + tracer.operationSucceeded(); + + Collection metrics = metricReader.collectAllMetrics(); + assertThat(metrics).hasSize(1); + MetricData metricData = metrics.iterator().next(); + + assertThat(metricData.getHistogramData().getPoints()).hasSize(1); + assertThat(metricData.getHistogramData().getPoints().iterator().next().getAttributes()) + .isEqualTo( + Attributes.of( + AttributeKey.stringKey(RPC_RESPONSE_STATUS_ATTRIBUTE), + StatusCode.Code.OK.toString())); + } + + @Test + void operationCancelled_shouldRecordsDuration() { + ticker.advance(TEST_REQUEST_DURATION_NANO); + tracer.operationCancelled(); + + Collection metrics = metricReader.collectAllMetrics(); + assertThat(metrics).hasSize(1); + MetricData metricData = metrics.iterator().next(); + + assertThat(metricData.getHistogramData().getPoints()).hasSize(1); + assertThat(metricData.getHistogramData().getPoints().iterator().next().getMax()) + .isEqualTo(EXPECTED_REQUEST_DURATION_SECOND); + } + + @Test + void operationCancelled_shouldRecordsOKStatus() { + tracer.operationCancelled(); + + Collection metrics = metricReader.collectAllMetrics(); + assertThat(metrics).hasSize(1); + MetricData metricData = metrics.iterator().next(); + + assertThat(metricData.getHistogramData().getPoints()).hasSize(1); + assertThat(metricData.getHistogramData().getPoints().iterator().next().getAttributes()) + .isEqualTo( + Attributes.of( + AttributeKey.stringKey(RPC_RESPONSE_STATUS_ATTRIBUTE), + StatusCode.Code.CANCELLED.toString())); + } + + @Test + void operationFailed_shouldRecordsDuration() { + ticker.advance(TEST_REQUEST_DURATION_NANO); + ApiException error = + new ApiException("test error", null, new FakeStatusCode(StatusCode.Code.INTERNAL), false); + tracer.operationFailed(error); + + Collection metrics = metricReader.collectAllMetrics(); + assertThat(metrics).hasSize(1); + MetricData metricData = metrics.iterator().next(); + + assertThat(metricData.getHistogramData().getPoints()).hasSize(1); + assertThat(metricData.getHistogramData().getPoints().iterator().next().getMax()) + .isEqualTo(EXPECTED_REQUEST_DURATION_SECOND); + } + + @Test + void operationFailed_shouldRecordsOKStatus() { + ApiException error = + new ApiException("test error", null, new FakeStatusCode(StatusCode.Code.INTERNAL), false); + tracer.operationFailed(error); + + Collection metrics = metricReader.collectAllMetrics(); + assertThat(metrics).hasSize(1); + MetricData metricData = metrics.iterator().next(); + + assertThat(metricData.getHistogramData().getPoints()).hasSize(1); + assertThat(metricData.getHistogramData().getPoints().iterator().next().getAttributes()) + .isEqualTo( + Attributes.of( + AttributeKey.stringKey(RPC_RESPONSE_STATUS_ATTRIBUTE), + StatusCode.Code.INTERNAL.toString())); + } +} diff --git a/gax-java/gax/src/test/java/com/google/api/gax/tracing/MetricsTestUtils.java b/gax-java/gax/src/test/java/com/google/api/gax/tracing/MetricsTestUtils.java new file mode 100644 index 0000000000..fd9477becb --- /dev/null +++ b/gax-java/gax/src/test/java/com/google/api/gax/tracing/MetricsTestUtils.java @@ -0,0 +1,51 @@ +/* + * Copyright 2024 Google LLC + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Google LLC nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +package com.google.api.gax.tracing; + +import static org.junit.jupiter.api.Assertions.fail; + +import java.lang.reflect.Method; + +public class MetricsTestUtils { + public static void reportFailedAttempt(ApiTracer tracer, Exception ex, Object delayValue) { + try { + final String methodName = + delayValue.getClass().getName().startsWith("java.time") + ? "attemptFailedDuration" + : "attemptFailed"; + Method attemptFailed = + tracer.getClass().getDeclaredMethod(methodName, Throwable.class, delayValue.getClass()); + attemptFailed.invoke(tracer, ex, delayValue); + } catch (Exception e) { + fail(); + throw new RuntimeException(e); + } + } +} diff --git a/gax-java/gax/src/test/java/com/google/api/gax/tracing/MetricsTracerFactoryTest.java b/gax-java/gax/src/test/java/com/google/api/gax/tracing/MetricsTracerFactoryTest.java new file mode 100644 index 0000000000..28a621f5f8 --- /dev/null +++ b/gax-java/gax/src/test/java/com/google/api/gax/tracing/MetricsTracerFactoryTest.java @@ -0,0 +1,99 @@ +/* + * Copyright 2024 Google LLC + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Google LLC nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +package com.google.api.gax.tracing; + +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.when; + +import com.google.api.gax.tracing.ApiTracerFactory.OperationType; +import com.google.common.collect.ImmutableMap; +import com.google.common.truth.Truth; +import java.util.Map; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.mockito.Mock; + +class MetricsTracerFactoryTest { + private static final int DEFAULT_ATTRIBUTES_COUNT = 2; + + @Mock private MetricsRecorder metricsRecorder; + @Mock private ApiTracer parent; + private SpanName spanName; + private MetricsTracerFactory metricsTracerFactory; + + @BeforeEach + void setUp() { + // Create an instance of MetricsTracerFactory with the mocked MetricsRecorder + metricsTracerFactory = new MetricsTracerFactory(metricsRecorder); + + spanName = mock(SpanName.class); + when(spanName.getClientName()).thenReturn("testService"); + when(spanName.getMethodName()).thenReturn("testMethod"); + } + + @Test + void testNewTracer_notNull() { + // Call the newTracer method + ApiTracer apiTracer = metricsTracerFactory.newTracer(parent, spanName, OperationType.Unary); + + // Assert that the apiTracer created has expected type and not null + Truth.assertThat(apiTracer).isNotNull(); + Truth.assertThat(apiTracer).isInstanceOf(MetricsTracer.class); + } + + @Test + void testNewTracer_hasCorrectNumberAttributes_hasDefaultAttributes() { + MetricsTracer metricsTracer = + (MetricsTracer) metricsTracerFactory.newTracer(parent, spanName, OperationType.Unary); + Map attributes = metricsTracer.getAttributes(); + Truth.assertThat(attributes.size()).isEqualTo(DEFAULT_ATTRIBUTES_COUNT); + Truth.assertThat(attributes.get(MetricsTracer.METHOD_ATTRIBUTE)) + .isEqualTo("testService.testMethod"); + Truth.assertThat(attributes.get(MetricsTracer.LANGUAGE_ATTRIBUTE)) + .isEqualTo(MetricsTracer.DEFAULT_LANGUAGE); + } + + @Test + void testClientAttributes_additionalClientAttributes() { + Map clientAttributes = + ImmutableMap.of("attribute1", "value1", "attribute2", "value2"); + MetricsTracerFactory metricsTracerFactory = + new MetricsTracerFactory(metricsRecorder, clientAttributes); + + MetricsTracer metricsTracer = + (MetricsTracer) metricsTracerFactory.newTracer(parent, spanName, OperationType.Unary); + Map attributes = metricsTracer.getAttributes(); + Truth.assertThat(attributes.size()) + .isEqualTo(DEFAULT_ATTRIBUTES_COUNT + clientAttributes.size()); + // Default attributes already tested above + Truth.assertThat(attributes.containsKey("attribute1")).isTrue(); + Truth.assertThat(attributes.containsKey("attribute2")).isTrue(); + } +} diff --git a/gax-java/gax/src/test/java/com/google/api/gax/tracing/MetricsTracerTest.java b/gax-java/gax/src/test/java/com/google/api/gax/tracing/MetricsTracerTest.java new file mode 100644 index 0000000000..b16820c624 --- /dev/null +++ b/gax-java/gax/src/test/java/com/google/api/gax/tracing/MetricsTracerTest.java @@ -0,0 +1,241 @@ +/* + * Copyright 2024 Google LLC + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Google LLC nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +package com.google.api.gax.tracing; + +import static com.google.api.gax.tracing.MetricsTestUtils.reportFailedAttempt; +import static com.google.common.truth.Truth.assertThat; +import static org.junit.jupiter.api.Assertions.assertThrows; +import static org.mockito.ArgumentMatchers.anyDouble; +import static org.mockito.Mockito.eq; +import static org.mockito.Mockito.verify; +import static org.mockito.Mockito.verifyNoMoreInteractions; + +import com.google.api.gax.rpc.ApiException; +import com.google.api.gax.rpc.DeadlineExceededException; +import com.google.api.gax.rpc.NotFoundException; +import com.google.api.gax.rpc.StatusCode.Code; +import com.google.api.gax.rpc.testing.FakeStatusCode; +import com.google.common.collect.ImmutableMap; +import java.util.HashMap; +import java.util.Map; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; +import org.mockito.Mock; +import org.mockito.junit.jupiter.MockitoExtension; + +@ExtendWith(MockitoExtension.class) +class MetricsTracerTest { + private static final String DEFAULT_METHOD_NAME = "fake_service.fake_method"; + + private MetricsTracer metricsTracer; + @Mock private MetricsRecorder metricsRecorder; + + @BeforeEach + void setUp() { + metricsTracer = + new MetricsTracer(MethodName.of("fake_service", "fake_method"), metricsRecorder); + } + + private ImmutableMap getAttributes(Code statusCode) { + return ImmutableMap.of( + MetricsTracer.STATUS_ATTRIBUTE, + statusCode.toString(), + MetricsTracer.METHOD_ATTRIBUTE, + DEFAULT_METHOD_NAME, + MetricsTracer.LANGUAGE_ATTRIBUTE, + MetricsTracer.DEFAULT_LANGUAGE); + } + + @Test + void testOperationSucceeded_recordsAttributes() { + metricsTracer.operationSucceeded(); + + Map attributes = getAttributes(Code.OK); + + verify(metricsRecorder).recordOperationCount(1, attributes); + verify(metricsRecorder).recordOperationLatency(anyDouble(), eq(attributes)); + + verifyNoMoreInteractions(metricsRecorder); + } + + @Test + void testOperationFailed_recordsAttributes() { + ApiException error0 = + new NotFoundException( + "invalid argument", null, new FakeStatusCode(Code.INVALID_ARGUMENT), false); + metricsTracer.operationFailed(error0); + + Map attributes = getAttributes(Code.INVALID_ARGUMENT); + + verify(metricsRecorder).recordOperationCount(1, attributes); + verify(metricsRecorder).recordOperationLatency(anyDouble(), eq(attributes)); + + verifyNoMoreInteractions(metricsRecorder); + } + + @Test + void testOperationCancelled_recordsAttributes() { + metricsTracer.operationCancelled(); + + Map attributes = getAttributes(Code.CANCELLED); + + verify(metricsRecorder).recordOperationCount(1, attributes); + verify(metricsRecorder).recordOperationLatency(anyDouble(), eq(attributes)); + + verifyNoMoreInteractions(metricsRecorder); + } + + @Test + void testAttemptSucceeded_recordsAttributes() { + // initialize mock-request + Object mockSuccessfulRequest = new Object(); + + // Attempt #1 + metricsTracer.attemptStarted(mockSuccessfulRequest, 0); + metricsTracer.attemptSucceeded(); + + Map attributes = getAttributes(Code.OK); + + verify(metricsRecorder).recordAttemptCount(1, attributes); + verify(metricsRecorder).recordAttemptLatency(anyDouble(), eq(attributes)); + + verifyNoMoreInteractions(metricsRecorder); + } + + @Test + void testAttemptFailed_usingJavaTime_recordsAttributes() { + testAttemptFailed_recordsAttributes(java.time.Duration.ofMillis(2)); + } + + @Test + public void testAttemptFailed_usingThreeten_recordsAttributes() { + testAttemptFailed_recordsAttributes(org.threeten.bp.Duration.ofMillis(2)); + } + + public void testAttemptFailed_recordsAttributes(final Object attemptFailedValue) { + // initialize mock-request + Object mockFailedRequest = new Object(); + + // Attempt #1 + metricsTracer.attemptStarted(mockFailedRequest, 0); + ApiException error0 = + new NotFoundException( + "invalid argument", null, new FakeStatusCode(Code.INVALID_ARGUMENT), false); + reportFailedAttempt(metricsTracer, error0, attemptFailedValue); + + Map attributes = getAttributes(Code.INVALID_ARGUMENT); + + verify(metricsRecorder).recordAttemptCount(1, attributes); + verify(metricsRecorder).recordAttemptLatency(anyDouble(), eq(attributes)); + + verifyNoMoreInteractions(metricsRecorder); + } + + @Test + void testAttemptCancelled_recordsAttributes() { + // initialize mock-request + Object mockCancelledRequest = new Object(); + // Attempt #1 + metricsTracer.attemptStarted(mockCancelledRequest, 0); + metricsTracer.attemptCancelled(); + + Map attributes = getAttributes(Code.CANCELLED); + + verify(metricsRecorder).recordAttemptCount(1, attributes); + verify(metricsRecorder).recordAttemptLatency(anyDouble(), eq(attributes)); + + verifyNoMoreInteractions(metricsRecorder); + } + + @Test + void testAttemptFailedRetriesExhausted_recordsAttributes() { + // initialize mock-request + Object mockRequest = new Object(); + // Attempt #1 + metricsTracer.attemptStarted(mockRequest, 0); + ApiException error0 = + new DeadlineExceededException( + "deadline exceeded", null, new FakeStatusCode(Code.DEADLINE_EXCEEDED), false); + metricsTracer.attemptFailedRetriesExhausted(error0); + + Map attributes = getAttributes(Code.DEADLINE_EXCEEDED); + + verify(metricsRecorder).recordAttemptCount(1, attributes); + verify(metricsRecorder).recordAttemptLatency(anyDouble(), eq(attributes)); + + verifyNoMoreInteractions(metricsRecorder); + } + + @Test + void testAttemptPermanentFailure_recordsAttributes() { + // initialize mock-request + Object mockRequest = new Object(); + // Attempt #1 + metricsTracer.attemptStarted(mockRequest, 0); + ApiException error0 = + new NotFoundException("not found", null, new FakeStatusCode(Code.NOT_FOUND), false); + metricsTracer.attemptFailedRetriesExhausted(error0); + + Map attributes = getAttributes(Code.NOT_FOUND); + + verify(metricsRecorder).recordAttemptCount(1, attributes); + verify(metricsRecorder).recordAttemptLatency(anyDouble(), eq(attributes)); + + verifyNoMoreInteractions(metricsRecorder); + } + + @Test + void testMultipleOperationCalls_throwsError() { + metricsTracer.operationSucceeded(); + IllegalStateException exception1 = + assertThrows(IllegalStateException.class, () -> metricsTracer.operationCancelled()); + assertThat(exception1.getMessage()).isEqualTo("Operation has already been completed"); + IllegalStateException exception2 = + assertThrows(IllegalStateException.class, () -> metricsTracer.operationSucceeded()); + assertThat(exception2.getMessage()).isEqualTo("Operation has already been completed"); + } + + @Test + void testAddAttributes_recordsAttributes() { + metricsTracer.addAttributes("FakeTableId", "12345"); + assertThat(metricsTracer.getAttributes().get("FakeTableId")).isEqualTo("12345"); + } + + @Test + void testAddAttributes_recordsAttributesWithMap() { + Map attributes = new HashMap<>(); + attributes.put("FakeTableId", "12345"); + attributes.put("FakeInstanceId", "67890"); + metricsTracer.addAttributes(attributes); + assertThat(metricsTracer.getAttributes().get("FakeTableId")).isEqualTo("12345"); + assertThat(metricsTracer.getAttributes().get("FakeInstanceId")).isEqualTo("67890"); + } +} diff --git a/gax-java/gax/src/test/java/com/google/api/gax/tracing/ObservabilityUtilsTest.java b/gax-java/gax/src/test/java/com/google/api/gax/tracing/ObservabilityUtilsTest.java new file mode 100644 index 0000000000..0af3be4746 --- /dev/null +++ b/gax-java/gax/src/test/java/com/google/api/gax/tracing/ObservabilityUtilsTest.java @@ -0,0 +1,121 @@ +/* + * Copyright 2026 Google LLC + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Google LLC nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +package com.google.api.gax.tracing; + +import static com.google.common.truth.Truth.assertThat; + +import com.google.api.gax.rpc.ApiException; +import com.google.api.gax.rpc.StatusCode; +import com.google.api.gax.rpc.testing.FakeStatusCode; +import com.google.common.collect.ImmutableMap; +import com.google.common.truth.Truth; +import io.opentelemetry.api.common.AttributeKey; +import io.opentelemetry.api.common.Attributes; +import java.util.Map; +import org.junit.jupiter.api.Test; + +class ObservabilityUtilsTest { + @Test + void testExtractStatus_errorConversion_apiExceptions() { + ApiException error = + new ApiException( + "fake_error", null, new FakeStatusCode(StatusCode.Code.INVALID_ARGUMENT), false); + String errorCode = ObservabilityUtils.extractStatus(error); + assertThat(errorCode).isEqualTo(StatusCode.Code.INVALID_ARGUMENT.toString()); + } + + @Test + void testExtractStatus_errorConversion_noError() { + // test "OK", which corresponds to a "null" error. + String successCode = ObservabilityUtils.extractStatus(null); + assertThat(successCode).isEqualTo(StatusCode.Code.OK.toString()); + } + + @Test + void testExtractStatus_errorConversion_unknownException() { + // test "UNKNOWN" + Throwable unknownException = new RuntimeException(); + String errorCode2 = ObservabilityUtils.extractStatus(unknownException); + assertThat(errorCode2).isEqualTo(StatusCode.Code.UNKNOWN.toString()); + } + + @Test + void testToOtelAttributes_shouldMapStringAttributes() { + String attribute1 = "attribute_1"; + String attribute2 = "attribute_2"; + String attribute1Value = "Today is a good day"; + String attribute2Value = "Does not matter"; + Map attributes = + ImmutableMap.of(attribute1, attribute1Value, attribute2, attribute2Value); + + Attributes otelAttributes = ObservabilityUtils.toOtelAttributes(attributes); + + Truth.assertThat(otelAttributes.get(AttributeKey.stringKey(attribute1))) + .isEqualTo(attribute1Value); + Truth.assertThat(otelAttributes.get(AttributeKey.stringKey(attribute2))) + .isEqualTo(attribute2Value); + } + + @Test + void testToOtelAttributes_urlTemplateAttribute() { + String urlTemplateValue = "/blogs/{blog}/posts/{post}"; + Map attributes = + ImmutableMap.of(ObservabilityAttributes.HTTP_URL_TEMPLATE_ATTRIBUTE, urlTemplateValue); + + Attributes otelAttributes = ObservabilityUtils.toOtelAttributes(attributes); + + Truth.assertThat( + otelAttributes.get( + AttributeKey.stringKey(ObservabilityAttributes.HTTP_URL_TEMPLATE_ATTRIBUTE))) + .isEqualTo(urlTemplateValue); + } + + @Test + void testToOtelAttributes_shouldMapIntAttributes() { + String attribute1 = "attribute_1"; + String attribute2 = "attribute_2"; + int attribute1Value = 23; + int attribute2Value = 81; + Map attributes = + ImmutableMap.of(attribute1, attribute1Value, attribute2, attribute2Value); + + Attributes otelAttributes = ObservabilityUtils.toOtelAttributes(attributes); + + Truth.assertThat(otelAttributes.get(AttributeKey.longKey(attribute1))) + .isEqualTo((long) attribute1Value); + Truth.assertThat(otelAttributes.get(AttributeKey.longKey(attribute2))) + .isEqualTo((long) attribute2Value); + } + + @Test + void testToOtelAttributes_shouldReturnEmptyAttributes_nullInput() { + assertThat(ObservabilityUtils.toOtelAttributes(null)).isEqualTo(Attributes.empty()); + } +} diff --git a/gax-java/gax/src/test/java/com/google/api/gax/tracing/OpenTelemetryMetricsRecorderTest.java b/gax-java/gax/src/test/java/com/google/api/gax/tracing/OpenTelemetryMetricsRecorderTest.java new file mode 100644 index 0000000000..1c7c69604e --- /dev/null +++ b/gax-java/gax/src/test/java/com/google/api/gax/tracing/OpenTelemetryMetricsRecorderTest.java @@ -0,0 +1,184 @@ +/* + * Copyright 2024 Google LLC + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Google LLC nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +package com.google.api.gax.tracing; + +import static org.mockito.Mockito.verify; +import static org.mockito.Mockito.verifyNoMoreInteractions; + +import com.google.common.collect.ImmutableMap; +import com.google.rpc.Code; +import io.opentelemetry.api.OpenTelemetry; +import io.opentelemetry.api.common.Attributes; +import io.opentelemetry.api.metrics.DoubleHistogram; +import io.opentelemetry.api.metrics.DoubleHistogramBuilder; +import io.opentelemetry.api.metrics.LongCounter; +import io.opentelemetry.api.metrics.LongCounterBuilder; +import io.opentelemetry.api.metrics.Meter; +import io.opentelemetry.api.metrics.MeterBuilder; +import java.util.Map; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; +import org.mockito.Mock; +import org.mockito.Mockito; +import org.mockito.junit.jupiter.MockitoExtension; + +@ExtendWith(MockitoExtension.class) +class OpenTelemetryMetricsRecorderTest { + private static final String SERVICE_NAME = "OtelRecorderTest"; + private static final String ATTEMPT_COUNT = SERVICE_NAME + "/attempt_count"; + private static final String OPERATION_COUNT = SERVICE_NAME + "/operation_count"; + private static final String ATTEMPT_LATENCY = SERVICE_NAME + "/attempt_latency"; + private static final String OPERATION_LATENCY = SERVICE_NAME + "/operation_latency"; + private static final String DEFAULT_METHOD_NAME = "fake_service.fake_method"; + + private OpenTelemetryMetricsRecorder otelMetricsRecorder; + @Mock private OpenTelemetry openTelemetry; + @Mock private Meter meter; + @Mock private MeterBuilder meterBuilder; + @Mock private LongCounter attemptCountRecorder; + @Mock private LongCounterBuilder attemptCountRecorderBuilder; + @Mock private DoubleHistogramBuilder attemptLatencyRecorderBuilder; + @Mock private DoubleHistogram attemptLatencyRecorder; + @Mock private DoubleHistogram operationLatencyRecorder; + @Mock private DoubleHistogramBuilder operationLatencyRecorderBuilder; + @Mock private LongCounter operationCountRecorder; + @Mock private LongCounterBuilder operationCountRecorderBuilder; + + @BeforeEach + void setUp() { + Mockito.when(openTelemetry.meterBuilder(Mockito.anyString())).thenReturn(meterBuilder); + Mockito.when(meterBuilder.setInstrumentationVersion(Mockito.anyString())) + .thenReturn(meterBuilder); + Mockito.when(meterBuilder.build()).thenReturn(meter); + // setup mocks for all the recorders using chained mocking + setupAttemptCountRecorder(); + setupAttemptLatencyRecorder(); + setupOperationLatencyRecorder(); + setupOperationCountRecorder(); + + otelMetricsRecorder = new OpenTelemetryMetricsRecorder(openTelemetry, SERVICE_NAME); + } + + private Map getAttributes(Code statusCode) { + return ImmutableMap.of( + "status", + statusCode.toString(), + "method_name", + DEFAULT_METHOD_NAME, + "language", + MetricsTracer.DEFAULT_LANGUAGE); + } + + @Test + void testAttemptCountRecorder_recordsAttributes() { + Map attributes = getAttributes(Code.OK); + + Attributes otelAttributes = OpenTelemetryMetricsRecorder.toOtelAttributes(attributes); + otelMetricsRecorder.recordAttemptCount(1, attributes); + + verify(attemptCountRecorder).add(1, otelAttributes); + verifyNoMoreInteractions(attemptCountRecorder); + } + + @Test + void testAttemptLatencyRecorder_recordsAttributes() { + Map attributes = getAttributes(Code.NOT_FOUND); + + Attributes otelAttributes = OpenTelemetryMetricsRecorder.toOtelAttributes(attributes); + otelMetricsRecorder.recordAttemptLatency(1.1, attributes); + + verify(attemptLatencyRecorder).record(1.1, otelAttributes); + verifyNoMoreInteractions(attemptLatencyRecorder); + } + + @Test + void testOperationCountRecorder_recordsAttributes() { + Map attributes = getAttributes(Code.OK); + + Attributes otelAttributes = OpenTelemetryMetricsRecorder.toOtelAttributes(attributes); + otelMetricsRecorder.recordOperationCount(1, attributes); + + verify(operationCountRecorder).add(1, otelAttributes); + verifyNoMoreInteractions(operationCountRecorder); + } + + @Test + void testOperationLatencyRecorder_recordsAttributes() { + Map attributes = getAttributes(Code.INVALID_ARGUMENT); + + Attributes otelAttributes = OpenTelemetryMetricsRecorder.toOtelAttributes(attributes); + otelMetricsRecorder.recordOperationLatency(1.7, attributes); + + verify(operationLatencyRecorder).record(1.7, otelAttributes); + verifyNoMoreInteractions(operationLatencyRecorder); + } + + private void setupAttemptCountRecorder() { + // Configure chained mocking for AttemptCountRecorder + Mockito.when(meter.counterBuilder(ATTEMPT_COUNT)).thenReturn(attemptCountRecorderBuilder); + Mockito.when(attemptCountRecorderBuilder.setDescription(Mockito.anyString())) + .thenReturn(attemptCountRecorderBuilder); + Mockito.when(attemptCountRecorderBuilder.setUnit(Mockito.anyString())) + .thenReturn(attemptCountRecorderBuilder); + Mockito.when(attemptCountRecorderBuilder.build()).thenReturn(attemptCountRecorder); + } + + private void setupOperationCountRecorder() { + // Configure chained mocking for operationCountRecorder + Mockito.when(meter.counterBuilder(OPERATION_COUNT)).thenReturn(operationCountRecorderBuilder); + Mockito.when(operationCountRecorderBuilder.setDescription(Mockito.anyString())) + .thenReturn(operationCountRecorderBuilder); + Mockito.when(operationCountRecorderBuilder.setUnit("1")) + .thenReturn(operationCountRecorderBuilder); + Mockito.when(operationCountRecorderBuilder.build()).thenReturn(operationCountRecorder); + } + + private void setupAttemptLatencyRecorder() { + // Configure chained mocking for attemptLatencyRecorder + Mockito.when(meter.histogramBuilder(ATTEMPT_LATENCY)).thenReturn(attemptLatencyRecorderBuilder); + Mockito.when(attemptLatencyRecorderBuilder.setDescription(Mockito.anyString())) + .thenReturn(attemptLatencyRecorderBuilder); + Mockito.when(attemptLatencyRecorderBuilder.setUnit(Mockito.anyString())) + .thenReturn(attemptLatencyRecorderBuilder); + Mockito.when(attemptLatencyRecorderBuilder.build()).thenReturn(attemptLatencyRecorder); + } + + private void setupOperationLatencyRecorder() { + // Configure chained mocking for operationLatencyRecorder + Mockito.when(meter.histogramBuilder(OPERATION_LATENCY)) + .thenReturn(operationLatencyRecorderBuilder); + Mockito.when(operationLatencyRecorderBuilder.setDescription(Mockito.anyString())) + .thenReturn(operationLatencyRecorderBuilder); + Mockito.when(operationLatencyRecorderBuilder.setUnit("ms")) + .thenReturn(operationLatencyRecorderBuilder); + Mockito.when(operationLatencyRecorderBuilder.build()).thenReturn(operationLatencyRecorder); + } +} diff --git a/gax-java/gax/src/test/java/com/google/api/gax/tracing/OpencensusTracerFactoryTest.java b/gax-java/gax/src/test/java/com/google/api/gax/tracing/OpencensusTracerFactoryTest.java index 457492acfd..5656e6a892 100644 --- a/gax-java/gax/src/test/java/com/google/api/gax/tracing/OpencensusTracerFactoryTest.java +++ b/gax-java/gax/src/test/java/com/google/api/gax/tracing/OpencensusTracerFactoryTest.java @@ -47,25 +47,21 @@ import io.opencensus.trace.Tracer; import io.opencensus.trace.unsafe.ContextUtils; import java.util.Map; -import org.junit.Before; -import org.junit.Rule; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.junit.runners.JUnit4; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; import org.mockito.Mock; -import org.mockito.junit.MockitoJUnit; -import org.mockito.junit.MockitoRule; +import org.mockito.junit.jupiter.MockitoExtension; -@RunWith(JUnit4.class) -public class OpencensusTracerFactoryTest { - @Rule public final MockitoRule mockitoRule = MockitoJUnit.rule(); +@ExtendWith(MockitoExtension.class) +class OpencensusTracerFactoryTest { @Mock private Tracer internalTracer; @Mock private SpanBuilder spanBuilder; @Mock private Span span; private final Map defaultSpanAttributes = ImmutableMap.of(); - @Before - public void setUp() { + @BeforeEach + void setUp() { when(internalTracer.spanBuilderWithExplicitParent(anyString(), nullable(Span.class))) .thenReturn(spanBuilder); @@ -75,7 +71,7 @@ public void setUp() { } @Test - public void testSpanNamePassthrough() { + void testSpanNamePassthrough() { OpencensusTracerFactory factory = new OpencensusTracerFactory(internalTracer, ImmutableMap.of()); @@ -87,7 +83,7 @@ public void testSpanNamePassthrough() { } @Test - public void testImplicitParentSpan() { + void testImplicitParentSpan() { OpencensusTracerFactory factory = new OpencensusTracerFactory(internalTracer, defaultSpanAttributes); @@ -107,7 +103,7 @@ public void testImplicitParentSpan() { } @Test - public void testExplicitParent() { + void testExplicitParent() { OpencensusTracerFactory factory = new OpencensusTracerFactory(internalTracer, defaultSpanAttributes); @@ -121,7 +117,7 @@ public void testExplicitParent() { } @Test - public void testExplicitParentOverridesImplicit() { + void testExplicitParentOverridesImplicit() { OpencensusTracerFactory factory = new OpencensusTracerFactory(internalTracer, defaultSpanAttributes); @@ -141,7 +137,7 @@ public void testExplicitParentOverridesImplicit() { } @Test - public void testSpanAttributes() { + void testSpanAttributes() { OpencensusTracerFactory factory = new OpencensusTracerFactory(internalTracer, ImmutableMap.of("gax.version", "1.2.3")); diff --git a/gax-java/gax/src/test/java/com/google/api/gax/tracing/OpencensusTracerTest.java b/gax-java/gax/src/test/java/com/google/api/gax/tracing/OpencensusTracerTest.java index 8cf6f82fa9..8c495623cc 100644 --- a/gax-java/gax/src/test/java/com/google/api/gax/tracing/OpencensusTracerTest.java +++ b/gax-java/gax/src/test/java/com/google/api/gax/tracing/OpencensusTracerTest.java @@ -29,6 +29,7 @@ */ package com.google.api.gax.tracing; +import static com.google.api.gax.tracing.MetricsTestUtils.reportFailedAttempt; import static com.google.common.truth.Truth.assertThat; import static org.mockito.Mockito.eq; import static org.mockito.Mockito.verify; @@ -49,23 +50,16 @@ import io.opencensus.trace.Status.CanonicalCode; import io.opencensus.trace.Tracer; import java.util.Map; -import org.junit.Before; -import org.junit.Rule; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.junit.runners.JUnit4; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; import org.mockito.ArgumentCaptor; import org.mockito.Captor; import org.mockito.Mock; -import org.mockito.junit.MockitoJUnit; -import org.mockito.junit.MockitoRule; -import org.mockito.quality.Strictness; -import org.threeten.bp.Duration; +import org.mockito.junit.jupiter.MockitoExtension; -@RunWith(JUnit4.class) -public class OpencensusTracerTest { - @Rule - public final MockitoRule mockitoRule = MockitoJUnit.rule().strictness(Strictness.STRICT_STUBS); +@ExtendWith(MockitoExtension.class) +class OpencensusTracerTest { @Mock private Tracer internalTracer; @Mock private Span span; @@ -73,19 +67,28 @@ public class OpencensusTracerTest { private OpencensusTracer tracer; - @Before - public void setUp() { + @BeforeEach + void setUp() { tracer = new OpencensusTracer(internalTracer, span, OperationType.Unary); } @Test - public void testUnarySuccessExample() { + void testUnarySuccessExample_javaTime() { + testUnarySuccessExample(java.time.Duration.ofMillis(5)); + } + + @Test + public void testUnarySuccessExample_threeten() { + testUnarySuccessExample(org.threeten.bp.Duration.ofMillis(5)); + } + + public void testUnarySuccessExample(Object attemptFailedValue) { tracer.attemptStarted(0); tracer.connectionSelected("1"); ApiException error0 = new DeadlineExceededException( "deadline exceeded", null, new FakeStatusCode(Code.DEADLINE_EXCEEDED), true); - tracer.attemptFailed(error0, Duration.ofMillis(5)); + reportFailedAttempt(tracer, error0, attemptFailedValue); tracer.attemptStarted(1); tracer.connectionSelected("2"); @@ -119,7 +122,7 @@ public void testUnarySuccessExample() { } @Test - public void testBatchExample() { + void testBatchExample() { tracer.batchRequestSent(100, 1000); tracer.attemptStarted(0); tracer.connectionSelected("1"); @@ -131,12 +134,21 @@ public void testBatchExample() { } @Test - public void testLongRunningExample() { + void testLongRunningExample_javaTime() { + testLongRunningExample(java.time.Duration.ofMillis(5)); + } + + @Test + public void testLongRunningExample_threeten() { + testLongRunningExample(org.threeten.bp.Duration.ofMillis(5)); + } + + public void testLongRunningExample(Object attemptFailedValue) { tracer = new OpencensusTracer(internalTracer, span, OperationType.LongRunning); // Initial poll of the initial rpc tracer.attemptStarted(0); - tracer.attemptFailed(null, Duration.ofMillis(5)); + reportFailedAttempt(tracer, null, attemptFailedValue); // Initial rpc finished tracer.lroStartSucceeded(); @@ -170,7 +182,7 @@ public void testLongRunningExample() { } @Test - public void testRetriesExhaustedExample() { + void testRetriesExhaustedExample() { tracer.attemptStarted(0); tracer.connectionSelected("1"); ApiException error0 = @@ -201,7 +213,7 @@ public void testRetriesExhaustedExample() { } @Test - public void testCancellationExample() { + void testCancellationExample() { tracer.attemptStarted(0); tracer.connectionSelected("1"); tracer.attemptCancelled(); @@ -226,7 +238,7 @@ public void testCancellationExample() { } @Test - public void testFailureExample() { + void testFailureExample() { tracer.attemptStarted(0); tracer.connectionSelected("1"); ApiException error0 = @@ -255,12 +267,21 @@ public void testFailureExample() { } @Test - public void testResponseCount() { + void testResponseCount_javaTime() { + testResponseCount(java.time.Duration.ofMillis(5)); + } + + @Test + public void testResponseCount_threeten() { + testResponseCount(java.time.Duration.ofMillis(5)); + } + + public void testResponseCount(Object attemptFailedValue) { // Initial attempt got 2 messages, then failed tracer.attemptStarted(0); tracer.responseReceived(); tracer.responseReceived(); - tracer.attemptFailed(new RuntimeException(), Duration.ofMillis(1)); + reportFailedAttempt(tracer, new RuntimeException(), attemptFailedValue); // Next attempt got 1 message, then successfully finished the attempt and the logical operation. tracer.attemptStarted(1); @@ -283,12 +304,21 @@ public void testResponseCount() { } @Test - public void testRequestCount() { + void testRequestCount_javaTime() { + testRequestCount(java.time.Duration.ofMillis(2)); + } + + @Test + public void testRequestCount_threeten() { + testRequestCount(org.threeten.bp.Duration.ofMillis(2)); + } + + public void testRequestCount(Object attemptFailedValue) { // Initial attempt sent 2 messages, then failed tracer.attemptStarted(0); tracer.requestSent(); tracer.requestSent(); - tracer.attemptFailed(new RuntimeException(), Duration.ofMillis(1)); + reportFailedAttempt(tracer, new RuntimeException(), attemptFailedValue); // Next attempt sent 1 message, then successfully finished the attempt and the logical // operation. @@ -312,9 +342,18 @@ public void testRequestCount() { } @Test - public void testAttemptNumber() { + void testAttemptNumber_javaTime() { + testAttemptNumber(java.time.Duration.ofMillis(5)); + } + + @Test + public void testAttemptNumber_threeten() { + testAttemptNumber(org.threeten.bp.Duration.ofMillis(5)); + } + + public void testAttemptNumber(Object attemptFailedValue) { tracer.attemptStarted(0); - tracer.attemptFailed(new RuntimeException(), Duration.ofMillis(1)); + reportFailedAttempt(tracer, new RuntimeException(), attemptFailedValue); tracer.attemptStarted(1); tracer.attemptSucceeded(); tracer.operationSucceeded(); @@ -334,12 +373,13 @@ public void testAttemptNumber() { } @Test - public void testStatusCode() { + void testStatusCode() { tracer.attemptStarted(0); - tracer.attemptFailed( + reportFailedAttempt( + tracer, new DeadlineExceededException( "deadline exceeded", null, new FakeStatusCode(Code.DEADLINE_EXCEEDED), true), - Duration.ofMillis(1)); + java.time.Duration.ofMillis(1)); tracer.attemptStarted(1); ApiException permanentError = @@ -359,7 +399,7 @@ public void testStatusCode() { } @Test - public void testErrorConversion() { + void testErrorConversion() { for (Code code : Code.values()) { ApiException error = new ApiException("fake message", null, new FakeStatusCode(code), false); Status opencensusStatus = OpencensusTracer.convertErrorToStatus(error); @@ -369,7 +409,7 @@ public void testErrorConversion() { } @Test - public void testStreamingErrorConversion() { + void testStreamingErrorConversion() { ServerStreamingAttemptException error = new ServerStreamingAttemptException( new DeadlineExceededException( diff --git a/gax-java/gax/src/test/java/com/google/api/gax/tracing/SpanTracerFactoryTest.java b/gax-java/gax/src/test/java/com/google/api/gax/tracing/SpanTracerFactoryTest.java new file mode 100644 index 0000000000..6054c67ca7 --- /dev/null +++ b/gax-java/gax/src/test/java/com/google/api/gax/tracing/SpanTracerFactoryTest.java @@ -0,0 +1,296 @@ +/* + * Copyright 2026 Google LLC + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Google LLC nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +package com.google.api.gax.tracing; + +import static com.google.common.truth.Truth.assertThat; +import static org.mockito.ArgumentMatchers.any; +import static org.mockito.ArgumentMatchers.anyString; +import static org.mockito.Mockito.atLeastOnce; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.verify; +import static org.mockito.Mockito.when; + +import com.google.api.gax.rpc.LibraryMetadata; +import com.google.api.gax.tracing.ApiTracerContext.Transport; +import com.google.api.gax.tracing.ApiTracerFactory.OperationType; +import io.opentelemetry.api.common.AttributeKey; +import io.opentelemetry.api.common.Attributes; +import io.opentelemetry.api.trace.Span; +import io.opentelemetry.api.trace.SpanBuilder; +import io.opentelemetry.api.trace.Tracer; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.CsvSource; +import org.junit.jupiter.params.provider.ValueSource; +import org.mockito.ArgumentCaptor; + +class SpanTracerFactoryTest { + private Tracer tracer; + private SpanBuilder spanBuilder; + private Span span; + + @BeforeEach + void setUp() { + tracer = mock(Tracer.class); + spanBuilder = mock(SpanBuilder.class); + span = mock(Span.class); + when(tracer.spanBuilder(anyString())).thenReturn(spanBuilder); + when(spanBuilder.setSpanKind(any())).thenReturn(spanBuilder); + when(spanBuilder.setAllAttributes(any(Attributes.class))).thenReturn(spanBuilder); + when(spanBuilder.startSpan()).thenReturn(span); + } + + @ParameterizedTest + @ValueSource(booleans = {false, true}) + void testNewTracer_createsSpanTracer(boolean useContext) { + SpanTracerFactory factory = new SpanTracerFactory(tracer, ApiTracerContext.empty()); + ApiTracer tracerInstance; + if (useContext) { + ApiTracerContext context = + ApiTracerContext.newBuilder() + .setFullMethodName("service/method") + .setTransport(Transport.GRPC) + .setLibraryMetadata(LibraryMetadata.empty()) + .build(); + tracerInstance = factory.newTracer(null, context); + } else { + tracerInstance = + factory.newTracer(null, SpanName.of("service", "method"), OperationType.Unary); + } + assertThat(tracerInstance).isInstanceOf(SpanTracer.class); + } + + @ParameterizedTest + @ValueSource(booleans = {false, true}) + void testNewTracer_addsAttributes(boolean useContext) { + ApiTracerFactory factory = new SpanTracerFactory(tracer, ApiTracerContext.empty()); + factory = + factory.withContext( + ApiTracerContext.newBuilder() + .setLibraryMetadata(LibraryMetadata.empty()) + .setServerAddress("test-address") + .build()); + ApiTracer tracerInstance; + if (useContext) { + ApiTracerContext context = + ApiTracerContext.newBuilder() + .setFullMethodName("service/method") + .setTransport(Transport.GRPC) + .setLibraryMetadata(LibraryMetadata.empty()) + .build(); + tracerInstance = factory.newTracer(null, context); + } else { + tracerInstance = + factory.newTracer(null, SpanName.of("service", "method"), OperationType.Unary); + } + + tracerInstance.attemptStarted(null, 1); + + ArgumentCaptor attributesCaptor = ArgumentCaptor.forClass(Attributes.class); + verify(spanBuilder, atLeastOnce()).setAllAttributes(attributesCaptor.capture()); + + Attributes attemptAttributes = attributesCaptor.getValue(); + assertThat(attemptAttributes.asMap()) + .containsEntry(AttributeKey.stringKey("server.address"), "test-address"); + } + + @ParameterizedTest + @ValueSource(booleans = {false, true}) + void testWithContext_addsInferredAttributes(boolean useContext) { + ApiTracerContext context = + ApiTracerContext.newBuilder() + .setLibraryMetadata(LibraryMetadata.empty()) + .setServerAddress("example.com") + .build(); + + SpanTracerFactory factory = new SpanTracerFactory(tracer, ApiTracerContext.empty()); + ApiTracerFactory factoryWithContext = factory.withContext(context); + + ApiTracer tracerInstance; + if (useContext) { + ApiTracerContext callContext = + ApiTracerContext.newBuilder() + .setFullMethodName("service/method") + .setTransport(Transport.GRPC) + .setLibraryMetadata(LibraryMetadata.empty()) + .build(); + tracerInstance = factoryWithContext.newTracer(null, callContext); + } else { + tracerInstance = + factoryWithContext.newTracer(null, SpanName.of("service", "method"), OperationType.Unary); + } + + tracerInstance.attemptStarted(null, 1); + + ArgumentCaptor attributesCaptor = ArgumentCaptor.forClass(Attributes.class); + verify(spanBuilder, atLeastOnce()).setAllAttributes(attributesCaptor.capture()); + + Attributes attemptAttributes = attributesCaptor.getValue(); + assertThat(attemptAttributes.asMap()) + .containsEntry( + AttributeKey.stringKey(ObservabilityAttributes.SERVER_ADDRESS_ATTRIBUTE), + "example.com"); + } + + @ParameterizedTest + @ValueSource(booleans = {false, true}) + void testWithContext_noEndpointContext_doesNotAddServerAddressAttribute(boolean useContext) { + ApiTracerContext context = ApiTracerContext.empty(); + + SpanTracerFactory factory = new SpanTracerFactory(tracer, ApiTracerContext.empty()); + ApiTracerFactory factoryWithContext = factory.withContext(context); + + ApiTracer tracerInstance; + if (useContext) { + ApiTracerContext callContext = + ApiTracerContext.newBuilder() + .setFullMethodName("service/method") + .setTransport(Transport.GRPC) + .setLibraryMetadata(LibraryMetadata.empty()) + .build(); + tracerInstance = factoryWithContext.newTracer(null, callContext); + } else { + tracerInstance = + factoryWithContext.newTracer(null, SpanName.of("service", "method"), OperationType.Unary); + } + + tracerInstance.attemptStarted(null, 1); + + ArgumentCaptor attributesCaptor = ArgumentCaptor.forClass(Attributes.class); + verify(spanBuilder, atLeastOnce()).setAllAttributes(attributesCaptor.capture()); + + Attributes attemptAttributes = attributesCaptor.getValue(); + assertThat(attemptAttributes.asMap()) + .doesNotContainKey( + AttributeKey.stringKey(ObservabilityAttributes.SERVER_ADDRESS_ATTRIBUTE)); + } + + @Test + void testNewTracer_withContext_grpc_usesFullMethodName() { + ApiTracerContext context = + ApiTracerContext.newBuilder() + .setFullMethodName("google.cloud.v1.Service/Method") + .setTransport(Transport.GRPC) + .setLibraryMetadata(LibraryMetadata.empty()) + .build(); + + SpanTracerFactory factory = new SpanTracerFactory(tracer, ApiTracerContext.empty()); + ApiTracer tracerInstance = factory.newTracer(null, context); + + tracerInstance.attemptStarted(null, 1); + + verify(tracer).spanBuilder("google.cloud.v1.Service/Method"); + } + + @ParameterizedTest + @CsvSource({ + "POST, v1/projects/{project}/methods, POST v1/projects/{project}/methods", + "GET, v1/projects/{project}/methods/{method}, GET v1/projects/{project}/methods/{method}", + "DELETE, v1/projects/{project}/methods/{method}, DELETE v1/projects/{project}/methods/{method}", + "PATCH, v1/projects/{project}/methods/{method}, PATCH v1/projects/{project}/methods/{method}" + }) + void testNewTracer_withContext_http_usesHttpMethodAndPathTemplate( + String httpMethod, String httpPathTemplate, String expectedSpanName) { + ApiTracerContext context = + ApiTracerContext.newBuilder() + .setFullMethodName("google.cloud.v1.Service.Method") + .setTransport(Transport.HTTP) + .setHttpMethod(httpMethod) + .setHttpPathTemplate(httpPathTemplate) + .setLibraryMetadata(LibraryMetadata.empty()) + .build(); + + SpanTracerFactory factory = new SpanTracerFactory(tracer, ApiTracerContext.empty()); + ApiTracer tracerInstance = factory.newTracer(null, context); + + tracerInstance.attemptStarted(null, 1); + + verify(tracer).spanBuilder(expectedSpanName); + } + + @Test + void testNewTracer_withContext_http_noHttpMethodOrPathTemplate_usesFullMethodName() { + ApiTracerContext context = + ApiTracerContext.newBuilder() + .setFullMethodName("google.cloud.v1.Service.Method") + .setTransport(Transport.HTTP) + .setLibraryMetadata(LibraryMetadata.empty()) + .build(); + + SpanTracerFactory factory = new SpanTracerFactory(tracer, ApiTracerContext.empty()); + ApiTracer tracerInstance = factory.newTracer(null, context); + + tracerInstance.attemptStarted(null, 1); + + verify(tracer).spanBuilder("google.cloud.v1.Service.Method"); + } + + @Test + void testNewTracer_withSpanName_usesPlaceholder() { + SpanTracerFactory factory = new SpanTracerFactory(tracer, ApiTracerContext.empty()); + ApiTracer tracerInstance = + factory.newTracer(null, SpanName.of("Service", "Method"), OperationType.Unary); + + tracerInstance.attemptStarted(null, 1); + + verify(tracer).spanBuilder("Service/Method/attempt"); + } + + @Test + void testNewTracer_mergesFactoryContext() { + ApiTracerContext apiTracerContext = + ApiTracerContext.newBuilder() + .setServerAddress("factory-address") + .setLibraryMetadata(LibraryMetadata.empty()) + .build(); + SpanTracerFactory factory = new SpanTracerFactory(tracer, apiTracerContext); + + ApiTracerContext callContext = + ApiTracerContext.newBuilder() + .setFullMethodName("Service/Method") + .setTransport(Transport.GRPC) + .setLibraryMetadata(LibraryMetadata.empty()) + .build(); + + ApiTracer tracerInstance = factory.newTracer(null, callContext); + tracerInstance.attemptStarted(null, 1); + + ArgumentCaptor attributesCaptor = ArgumentCaptor.forClass(Attributes.class); + verify(spanBuilder).setAllAttributes(attributesCaptor.capture()); + + Attributes attributes = attributesCaptor.getValue(); + assertThat(attributes.asMap()) + .containsEntry(AttributeKey.stringKey("server.address"), "factory-address"); + assertThat(attributes.asMap()) + .containsEntry(AttributeKey.stringKey("rpc.method"), "Service/Method"); + } +} diff --git a/gax-java/gax/src/test/java/com/google/api/gax/tracing/SpanTracerTest.java b/gax-java/gax/src/test/java/com/google/api/gax/tracing/SpanTracerTest.java new file mode 100644 index 0000000000..3e9fc53ce5 --- /dev/null +++ b/gax-java/gax/src/test/java/com/google/api/gax/tracing/SpanTracerTest.java @@ -0,0 +1,189 @@ +/* + * Copyright 2026 Google LLC + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Google LLC nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +package com.google.api.gax.tracing; + +import static com.google.common.truth.Truth.assertThat; +import static org.mockito.ArgumentMatchers.any; +import static org.mockito.ArgumentMatchers.anyString; +import static org.mockito.Mockito.verify; +import static org.mockito.Mockito.when; + +import io.opentelemetry.api.common.Attributes; +import io.opentelemetry.api.trace.Span; +import io.opentelemetry.api.trace.SpanBuilder; +import io.opentelemetry.api.trace.SpanKind; +import io.opentelemetry.api.trace.Tracer; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; +import org.mockito.ArgumentCaptor; +import org.mockito.Mock; +import org.mockito.junit.jupiter.MockitoExtension; + +@ExtendWith(MockitoExtension.class) +class SpanTracerTest { + @Mock private Tracer tracer; + @Mock private SpanBuilder spanBuilder; + @Mock private Span span; + private SpanTracer spanTracer; + private static final String ATTEMPT_SPAN_NAME = "Service/Method/attempt"; + + @BeforeEach + void setUp() { + when(tracer.spanBuilder(anyString())).thenReturn(spanBuilder); + when(spanBuilder.setSpanKind(any(SpanKind.class))).thenReturn(spanBuilder); + when(spanBuilder.setAllAttributes(any(Attributes.class))).thenReturn(spanBuilder); + when(spanBuilder.startSpan()).thenReturn(span); + spanTracer = new SpanTracer(tracer, ApiTracerContext.empty(), ATTEMPT_SPAN_NAME); + } + + @Test + void testAttemptLifecycle_startsAndEndsAttemptSpan() { + spanTracer.attemptStarted(new Object(), 1); + spanTracer.attemptSucceeded(); + + verify(tracer).spanBuilder(ATTEMPT_SPAN_NAME); + verify(spanBuilder).setSpanKind(SpanKind.CLIENT); + verify(span).end(); + } + + @Test + void testAttemptStarted_includesLanguageAttribute() { + spanTracer.attemptStarted(new Object(), 1); + + ArgumentCaptor attributesCaptor = ArgumentCaptor.forClass(Attributes.class); + verify(spanBuilder).setAllAttributes(attributesCaptor.capture()); + + assertThat(attributesCaptor.getValue().asMap()) + .containsEntry( + io.opentelemetry.api.common.AttributeKey.stringKey(SpanTracer.LANGUAGE_ATTRIBUTE), + SpanTracer.DEFAULT_LANGUAGE); + } + + @Test + void testAttemptStarted_noRetryAttributes_grpc() { + ApiTracerContext grpcContext = + ApiTracerContext.newBuilder() + .setLibraryMetadata(com.google.api.gax.rpc.LibraryMetadata.empty()) + .setTransport(ApiTracerContext.Transport.GRPC) + .build(); + SpanTracer grpcTracer = new SpanTracer(tracer, grpcContext, ATTEMPT_SPAN_NAME); + + // Initial attempt, attemptNumber is 0 + grpcTracer.attemptStarted(new Object(), 0); + ArgumentCaptor attributesCaptor = ArgumentCaptor.forClass(Attributes.class); + verify(spanBuilder).setAllAttributes(attributesCaptor.capture()); + assertThat(attributesCaptor.getValue().asMap()) + .doesNotContainKey( + io.opentelemetry.api.common.AttributeKey.longKey( + ObservabilityAttributes.GRPC_RESEND_COUNT_ATTRIBUTE)); + assertThat(attributesCaptor.getValue().asMap()) + .doesNotContainKey( + io.opentelemetry.api.common.AttributeKey.longKey( + ObservabilityAttributes.HTTP_RESEND_COUNT_ATTRIBUTE)); + } + + @Test + void testAttemptStarted_retryAttributes_grpc() { + ApiTracerContext grpcContext = + ApiTracerContext.newBuilder() + .setLibraryMetadata(com.google.api.gax.rpc.LibraryMetadata.empty()) + .setTransport(ApiTracerContext.Transport.GRPC) + .build(); + SpanTracer grpcTracer = new SpanTracer(tracer, grpcContext, ATTEMPT_SPAN_NAME); + + // N-th retry, attemptNumber is 5 + grpcTracer.attemptStarted(new Object(), 5); + ArgumentCaptor attributesCaptor = ArgumentCaptor.forClass(Attributes.class); + verify(spanBuilder).setAllAttributes(attributesCaptor.capture()); + java.util.Map, Object> capturedAttributes = + attributesCaptor.getValue().asMap(); + assertThat(capturedAttributes) + .containsEntry( + io.opentelemetry.api.common.AttributeKey.longKey( + ObservabilityAttributes.GRPC_RESEND_COUNT_ATTRIBUTE), + 5L); + assertThat(capturedAttributes) + .doesNotContainKey( + io.opentelemetry.api.common.AttributeKey.longKey( + ObservabilityAttributes.HTTP_RESEND_COUNT_ATTRIBUTE)); + } + + @Test + void testAttemptStarted_noRetryAttributes_http() { + ApiTracerContext httpContext = + ApiTracerContext.newBuilder() + .setLibraryMetadata(com.google.api.gax.rpc.LibraryMetadata.empty()) + .setTransport(ApiTracerContext.Transport.HTTP) + .build(); + SpanTracer httpTracer = new SpanTracer(tracer, httpContext, ATTEMPT_SPAN_NAME); + + // Initial attempt, attemptNumber is 0 + httpTracer.attemptStarted(new Object(), 0); + ArgumentCaptor attributesCaptor = ArgumentCaptor.forClass(Attributes.class); + verify(spanBuilder).setAllAttributes(attributesCaptor.capture()); + java.util.Map, Object> capturedAttributes = + attributesCaptor.getValue().asMap(); + assertThat(capturedAttributes) + .doesNotContainKey( + io.opentelemetry.api.common.AttributeKey.longKey( + ObservabilityAttributes.GRPC_RESEND_COUNT_ATTRIBUTE)); + assertThat(capturedAttributes) + .doesNotContainKey( + io.opentelemetry.api.common.AttributeKey.longKey( + ObservabilityAttributes.HTTP_RESEND_COUNT_ATTRIBUTE)); + } + + @Test + void testAttemptStarted_retryAttributes_http() { + ApiTracerContext httpContext = + ApiTracerContext.newBuilder() + .setLibraryMetadata(com.google.api.gax.rpc.LibraryMetadata.empty()) + .setTransport(ApiTracerContext.Transport.HTTP) + .build(); + SpanTracer httpTracer = new SpanTracer(tracer, httpContext, ATTEMPT_SPAN_NAME); + + // N-th retry, attemptNumber is 5 + httpTracer.attemptStarted(new Object(), 5); + ArgumentCaptor attributesCaptor = ArgumentCaptor.forClass(Attributes.class); + verify(spanBuilder).setAllAttributes(attributesCaptor.capture()); + java.util.Map, Object> capturedAttributes = + attributesCaptor.getValue().asMap(); + assertThat(capturedAttributes) + .doesNotContainKey( + io.opentelemetry.api.common.AttributeKey.longKey( + ObservabilityAttributes.GRPC_RESEND_COUNT_ATTRIBUTE)); + assertThat(capturedAttributes) + .containsEntry( + io.opentelemetry.api.common.AttributeKey.longKey( + ObservabilityAttributes.HTTP_RESEND_COUNT_ATTRIBUTE), + 5L); + } +} diff --git a/gax-java/gax/src/test/java/com/google/api/gax/tracing/TraceFinisherTest.java b/gax-java/gax/src/test/java/com/google/api/gax/tracing/TraceFinisherTest.java index 5aa94f6511..850b87ce5b 100644 --- a/gax-java/gax/src/test/java/com/google/api/gax/tracing/TraceFinisherTest.java +++ b/gax-java/gax/src/test/java/com/google/api/gax/tracing/TraceFinisherTest.java @@ -35,22 +35,17 @@ import com.google.api.core.ApiFuture; import com.google.api.core.ApiFutures; import com.google.common.util.concurrent.MoreExecutors; -import org.junit.Rule; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.junit.runners.JUnit4; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; import org.mockito.Mock; -import org.mockito.junit.MockitoJUnit; -import org.mockito.junit.MockitoRule; -import org.mockito.quality.Strictness; +import org.mockito.junit.jupiter.MockitoExtension; -@RunWith(JUnit4.class) -public class TraceFinisherTest { - @Rule public MockitoRule mockitoRule = MockitoJUnit.rule().strictness(Strictness.STRICT_STUBS); +@ExtendWith(MockitoExtension.class) +class TraceFinisherTest { @Mock private ApiTracer mockTracer; @Test - public void testSuccess() { + void testSuccess() { ApiFuture future = ApiFutures.immediateFuture("result"); ApiFutures.addCallback( future, new TraceFinisher(mockTracer), MoreExecutors.directExecutor()); @@ -59,7 +54,7 @@ public void testSuccess() { } @Test - public void testCancellation() { + void testCancellation() { ApiFuture future = ApiFutures.immediateCancelledFuture(); ApiFutures.addCallback( future, new TraceFinisher(mockTracer), MoreExecutors.directExecutor()); @@ -68,7 +63,7 @@ public void testCancellation() { } @Test - public void testFailure() { + void testFailure() { RuntimeException expectedError = new RuntimeException("fake"); ApiFuture future = ApiFutures.immediateFailedFuture(expectedError); ApiFutures.addCallback( diff --git a/gax-java/gax/src/test/java/com/google/api/gax/tracing/TracedBatchingCallableTest.java b/gax-java/gax/src/test/java/com/google/api/gax/tracing/TracedBatchingCallableTest.java index 6488dde286..c560657b11 100644 --- a/gax-java/gax/src/test/java/com/google/api/gax/tracing/TracedBatchingCallableTest.java +++ b/gax-java/gax/src/test/java/com/google/api/gax/tracing/TracedBatchingCallableTest.java @@ -30,6 +30,7 @@ package com.google.api.gax.tracing; +import static com.google.common.truth.Truth.assertThat; import static org.mockito.ArgumentMatchers.any; import static org.mockito.ArgumentMatchers.anyString; import static org.mockito.ArgumentMatchers.eq; @@ -41,22 +42,29 @@ import com.google.api.core.SettableApiFuture; import com.google.api.gax.rpc.ApiCallContext; import com.google.api.gax.rpc.BatchingDescriptor; +import com.google.api.gax.rpc.LibraryMetadata; import com.google.api.gax.rpc.UnaryCallable; import com.google.api.gax.rpc.testing.FakeCallContext; +import com.google.api.gax.tracing.ApiTracerContext.Transport; import com.google.api.gax.tracing.ApiTracerFactory.OperationType; -import org.junit.Before; -import org.junit.Rule; -import org.junit.Test; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.ValueSource; +import org.mockito.ArgumentCaptor; import org.mockito.Mock; -import org.mockito.junit.MockitoJUnit; -import org.mockito.junit.MockitoRule; -import org.mockito.quality.Strictness; +import org.mockito.junit.jupiter.MockitoExtension; -public class TracedBatchingCallableTest { +@ExtendWith(MockitoExtension.class) +class TracedBatchingCallableTest { private static final SpanName SPAN_NAME = SpanName.of("FakeClient", "FakeRpc"); - - @Rule - public final MockitoRule mockitoRule = MockitoJUnit.rule().strictness(Strictness.STRICT_STUBS); + private static final ApiTracerContext TRACER_CONTEXT = + ApiTracerContext.newBuilder() + .setFullMethodName("FakeClient/FakeRpc") + .setTransport(Transport.GRPC) + .setLibraryMetadata(LibraryMetadata.empty()) + .setOperationType(OperationType.Batching) + .build(); @Mock private ApiTracerFactory tracerFactory; @Mock private ApiTracer tracer; @@ -67,33 +75,72 @@ public class TracedBatchingCallableTest { private TracedBatchingCallable tracedBatchingCallable; private FakeCallContext callContext; - @Before - public void setUp() { + void init(boolean useContext) { // Wire the mock tracer factory - when(tracerFactory.newTracer( - any(ApiTracer.class), any(SpanName.class), eq(OperationType.Batching))) - .thenReturn(tracer); + if (useContext) { + when(tracerFactory.newTracer(any(ApiTracer.class), any(ApiTracerContext.class))) + .thenReturn(tracer); + tracedBatchingCallable = + new TracedBatchingCallable<>( + innerCallable, tracerFactory, TRACER_CONTEXT, batchingDescriptor); + } else { + when(tracerFactory.newTracer( + any(ApiTracer.class), any(SpanName.class), eq(OperationType.Batching))) + .thenReturn(tracer); + tracedBatchingCallable = + new TracedBatchingCallable<>(innerCallable, tracerFactory, SPAN_NAME, batchingDescriptor); + } // Wire the mock inner callable // This is a very hacky mock, the actual batching infrastructure is completely omitted here. innerResult = SettableApiFuture.create(); when(innerCallable.futureCall(anyString(), any(ApiCallContext.class))).thenReturn(innerResult); - // Build the system under test - tracedBatchingCallable = - new TracedBatchingCallable<>(innerCallable, tracerFactory, SPAN_NAME, batchingDescriptor); callContext = FakeCallContext.createDefault(); } - @Test - public void testRootTracerCreated() { + @ParameterizedTest + @ValueSource(booleans = {false, true}) + void testRootTracerCreated(boolean useContext) { + init(useContext); tracedBatchingCallable.futureCall("test", callContext); - verify(tracerFactory, times(1)) - .newTracer(callContext.getTracer(), SPAN_NAME, OperationType.Batching); + if (useContext) { + verify(tracerFactory, times(1)).newTracer(callContext.getTracer(), TRACER_CONTEXT); + } else { + verify(tracerFactory, times(1)) + .newTracer(callContext.getTracer(), SPAN_NAME, OperationType.Batching); + } } @Test - public void testBatchAttributesStamped() { + void testOperationTypeIsSet() { + when(tracerFactory.newTracer(any(ApiTracer.class), any(ApiTracerContext.class))) + .thenReturn(tracer); + tracedBatchingCallable = + new TracedBatchingCallable<>( + innerCallable, tracerFactory, TRACER_CONTEXT, batchingDescriptor); + ApiTracerContext contextWithWrongType = + TRACER_CONTEXT.toBuilder().setOperationType(OperationType.Unary).build(); + + tracedBatchingCallable = + new TracedBatchingCallable<>( + innerCallable, tracerFactory, contextWithWrongType, batchingDescriptor); + + innerResult = SettableApiFuture.create(); + when(innerCallable.futureCall(anyString(), any(ApiCallContext.class))).thenReturn(innerResult); + + tracedBatchingCallable.futureCall("test", FakeCallContext.createDefault()); + + ArgumentCaptor contextCaptor = + ArgumentCaptor.forClass(ApiTracerContext.class); + verify(tracerFactory).newTracer(any(ApiTracer.class), contextCaptor.capture()); + assertThat(contextCaptor.getValue().operationType()).isEqualTo(OperationType.Batching); + } + + @ParameterizedTest + @ValueSource(booleans = {false, true}) + void testBatchAttributesStamped(boolean useContext) { + init(useContext); when(batchingDescriptor.countElements(anyString())).thenReturn(10L); when(batchingDescriptor.countBytes(anyString())).thenReturn(20L); @@ -101,16 +148,20 @@ public void testBatchAttributesStamped() { verify(tracer).batchRequestSent(10, 20); } - @Test - public void testOperationFinish() { + @ParameterizedTest + @ValueSource(booleans = {false, true}) + void testOperationFinish(boolean useContext) { + init(useContext); innerResult.set("successful result"); tracedBatchingCallable.futureCall("test", callContext); verify(tracer, times(1)).operationSucceeded(); } - @Test - public void testOperationFailed() { + @ParameterizedTest + @ValueSource(booleans = {false, true}) + void testOperationFailed(boolean useContext) { + init(useContext); RuntimeException fakeError = new RuntimeException("fake error"); innerResult.setException(fakeError); tracedBatchingCallable.futureCall("test", callContext); @@ -118,8 +169,10 @@ public void testOperationFailed() { verify(tracer, times(1)).operationFailed(fakeError); } - @Test - public void testSyncError() { + @ParameterizedTest + @ValueSource(booleans = {false, true}) + void testSyncError(boolean useContext) { + init(useContext); RuntimeException fakeError = new RuntimeException("fake error"); // Reset the irrelevant expectations from setup. (only needed to silence the warnings). diff --git a/gax-java/gax/src/test/java/com/google/api/gax/tracing/TracedBidiCallableTest.java b/gax-java/gax/src/test/java/com/google/api/gax/tracing/TracedBidiCallableTest.java index 93a007f731..d44dfe51a4 100644 --- a/gax-java/gax/src/test/java/com/google/api/gax/tracing/TracedBidiCallableTest.java +++ b/gax-java/gax/src/test/java/com/google/api/gax/tracing/TracedBidiCallableTest.java @@ -30,6 +30,7 @@ package com.google.api.gax.tracing; import static com.google.common.truth.Truth.assertThat; +import static org.mockito.ArgumentMatchers.any; import static org.mockito.Mockito.times; import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; @@ -40,26 +41,33 @@ import com.google.api.gax.rpc.BidiStreamingCallable; import com.google.api.gax.rpc.ClientStream; import com.google.api.gax.rpc.ClientStreamReadyObserver; +import com.google.api.gax.rpc.LibraryMetadata; import com.google.api.gax.rpc.ResponseObserver; import com.google.api.gax.rpc.StreamController; import com.google.api.gax.rpc.testing.FakeCallContext; +import com.google.api.gax.tracing.ApiTracerContext.Transport; import com.google.api.gax.tracing.ApiTracerFactory.OperationType; import java.util.ArrayList; import java.util.List; import java.util.concurrent.CancellationException; -import org.junit.Before; -import org.junit.Rule; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.junit.runners.JUnit4; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.ValueSource; +import org.mockito.ArgumentCaptor; import org.mockito.Mock; -import org.mockito.junit.MockitoJUnit; -import org.mockito.junit.MockitoRule; +import org.mockito.junit.jupiter.MockitoExtension; -@RunWith(JUnit4.class) -public class TracedBidiCallableTest { +@ExtendWith(MockitoExtension.class) +class TracedBidiCallableTest { private static final SpanName SPAN_NAME = SpanName.of("fake-client", "fake-method"); - public @Rule MockitoRule mockitoRule = MockitoJUnit.rule(); + private static final ApiTracerContext TRACER_CONTEXT = + ApiTracerContext.newBuilder() + .setFullMethodName("fake-client/fake-method") + .setTransport(Transport.GRPC) + .setLibraryMetadata(LibraryMetadata.empty()) + .setOperationType(OperationType.BidiStreaming) + .build(); private FakeBidiObserver outerObserver; private FakeCallContext outerCallContext; @@ -73,28 +81,62 @@ public class TracedBidiCallableTest { private FakeBidiCallable innerCallable; private FakeStreamController innerController; - @Before - public void setUp() { + void init(boolean useContext) { outerObserver = new FakeBidiObserver(); outerCallContext = FakeCallContext.createDefault(); - when(tracerFactory.newTracer(parentTracer, SPAN_NAME, OperationType.BidiStreaming)) - .thenReturn(tracer); + if (useContext) { + when(tracerFactory.newTracer(any(ApiTracer.class), any(ApiTracerContext.class))) + .thenReturn(tracer); + } else { + when(tracerFactory.newTracer(parentTracer, SPAN_NAME, OperationType.BidiStreaming)) + .thenReturn(tracer); + } innerCallable = new FakeBidiCallable(); innerController = new FakeStreamController(); - tracedCallable = new TracedBidiCallable<>(innerCallable, tracerFactory, SPAN_NAME); + if (useContext) { + tracedCallable = new TracedBidiCallable<>(innerCallable, tracerFactory, TRACER_CONTEXT); + } else { + tracedCallable = new TracedBidiCallable<>(innerCallable, tracerFactory, SPAN_NAME); + } } - @Test - public void testTracerCreated() { + @ParameterizedTest + @ValueSource(booleans = {false, true}) + void testTracerCreated(boolean useContext) { + init(useContext); tracedCallable.call(outerObserver, outerCallContext); - verify(tracerFactory, times(1)).newTracer(parentTracer, SPAN_NAME, OperationType.BidiStreaming); + if (useContext) { + verify(tracerFactory, times(1)).newTracer(parentTracer, TRACER_CONTEXT); + } else { + verify(tracerFactory, times(1)) + .newTracer(parentTracer, SPAN_NAME, OperationType.BidiStreaming); + } } @Test - public void testOperationCancelled() { + void testOperationTypeIsSet() { + init(true); + ApiTracerContext contextWithWrongType = + TRACER_CONTEXT.toBuilder().setOperationType(OperationType.Unary).build(); + + innerCallable = new FakeBidiCallable(); + tracedCallable = new TracedBidiCallable<>(innerCallable, tracerFactory, contextWithWrongType); + + tracedCallable.call(new FakeBidiObserver(), FakeCallContext.createDefault()); + + ArgumentCaptor contextCaptor = + ArgumentCaptor.forClass(ApiTracerContext.class); + verify(tracerFactory).newTracer(any(ApiTracer.class), contextCaptor.capture()); + assertThat(contextCaptor.getValue().operationType()).isEqualTo(OperationType.BidiStreaming); + } + + @ParameterizedTest + @ValueSource(booleans = {false, true}) + void testOperationCancelled(boolean useContext) { + init(useContext); tracedCallable.call(outerObserver, outerCallContext); outerObserver.clientStream.closeSendWithError(new CancellationException()); innerCallable.responseObserver.onError( @@ -104,8 +146,10 @@ public void testOperationCancelled() { assertThat(outerObserver.complete).isTrue(); } - @Test - public void testOperationCancelled2() { + @ParameterizedTest + @ValueSource(booleans = {false, true}) + void testOperationCancelled2(boolean useContext) { + init(useContext); BidiStream stream = tracedCallable.call(outerCallContext); stream.cancel(); @@ -115,8 +159,10 @@ public void testOperationCancelled2() { verify(tracer, times(1)).operationCancelled(); } - @Test - public void testOperationFinished() { + @ParameterizedTest + @ValueSource(booleans = {false, true}) + void testOperationFinished(boolean useContext) { + init(useContext); tracedCallable.call(outerObserver, outerCallContext); innerCallable.responseObserver.onComplete(); @@ -124,8 +170,10 @@ public void testOperationFinished() { assertThat(outerObserver.complete).isTrue(); } - @Test - public void testOperationFailed() { + @ParameterizedTest + @ValueSource(booleans = {false, true}) + void testOperationFailed(boolean useContext) { + init(useContext); RuntimeException expectedException = new RuntimeException("fake"); tracedCallable.call(outerObserver, outerCallContext); @@ -136,8 +184,10 @@ public void testOperationFailed() { assertThat(outerObserver.error).isEqualTo(expectedException); } - @Test - public void testSyncError() { + @ParameterizedTest + @ValueSource(booleans = {false, true}) + void testSyncError(boolean useContext) { + init(useContext); RuntimeException expectedException = new RuntimeException("fake"); innerCallable.syncError = expectedException; @@ -150,8 +200,10 @@ public void testSyncError() { verify(tracer, times(1)).operationFailed(expectedException); } - @Test - public void testRequestNotify() { + @ParameterizedTest + @ValueSource(booleans = {false, true}) + void testRequestNotify(boolean useContext) { + init(useContext); tracedCallable.call(outerObserver, outerCallContext); outerObserver.clientStream.send("request1"); outerObserver.clientStream.send("request2"); @@ -160,8 +212,10 @@ public void testRequestNotify() { assertThat(innerCallable.clientStream.sent).containsExactly("request1", "request2"); } - @Test - public void testRequestNotify2() { + @ParameterizedTest + @ValueSource(booleans = {false, true}) + void testRequestNotify2(boolean useContext) { + init(useContext); BidiStream stream = tracedCallable.call(outerCallContext); stream.send("request1"); stream.send("request2"); @@ -170,8 +224,10 @@ public void testRequestNotify2() { assertThat(innerCallable.clientStream.sent).containsExactly("request1", "request2"); } - @Test - public void testResponseNotify() { + @ParameterizedTest + @ValueSource(booleans = {false, true}) + void testResponseNotify(boolean useContext) { + init(useContext); tracedCallable.call(outerObserver, outerCallContext); innerCallable.responseObserver.onResponse("response1"); diff --git a/gax-java/gax/src/test/java/com/google/api/gax/tracing/TracedCallableTest.java b/gax-java/gax/src/test/java/com/google/api/gax/tracing/TracedCallableTest.java index 834b357e4d..86c72fbd33 100644 --- a/gax-java/gax/src/test/java/com/google/api/gax/tracing/TracedCallableTest.java +++ b/gax-java/gax/src/test/java/com/google/api/gax/tracing/TracedCallableTest.java @@ -47,24 +47,16 @@ import com.google.api.gax.rpc.UnaryCallable; import com.google.api.gax.rpc.testing.FakeCallContext; import com.google.api.gax.tracing.ApiTracerFactory.OperationType; -import org.junit.Before; -import org.junit.Rule; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.junit.runners.JUnit4; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; import org.mockito.Mock; -import org.mockito.junit.MockitoJUnit; -import org.mockito.junit.MockitoRule; -import org.mockito.quality.Strictness; -import org.threeten.bp.Duration; +import org.mockito.junit.jupiter.MockitoExtension; -@RunWith(JUnit4.class) -public class TracedCallableTest { +@ExtendWith(MockitoExtension.class) +class TracedCallableTest { private static final SpanName SPAN_NAME = SpanName.of("FakeClient", "FakeRpc"); - @Rule - public final MockitoRule mockitoRule = MockitoJUnit.rule().strictness(Strictness.STRICT_STUBS); - @Mock private ApiTracerFactory tracerFactory; private ApiTracer parentTracer; @Mock private ApiTracer tracer; @@ -74,8 +66,8 @@ public class TracedCallableTest { private ApiCallContext callContext; private ClientContext clientContext; - @Before - public void setUp() { + @BeforeEach + void setUp() { parentTracer = BaseApiTracer.getInstance(); // Wire the mock tracer factory @@ -99,11 +91,11 @@ public UnaryCallable setupTracedUnaryCallable( } @Test - public void testNonRetriedCallable() throws Exception { + void testNonRetriedCallable() throws Exception { // Verify that callables configured to not retry have the appropriate tracer interactions. UnaryCallSettings callSettings = UnaryCallSettings.newUnaryCallSettingsBuilder() - .setSimpleTimeoutNoRetries(Duration.ofMillis(5L)) + .setSimpleTimeoutNoRetriesDuration(java.time.Duration.ofMillis(5L)) .build(); UnaryCallable callable = setupTracedUnaryCallable(callSettings); innerResult.set("No, my refrigerator is not running!"); diff --git a/gax-java/gax/src/test/java/com/google/api/gax/tracing/TracedClientStreamingCallableTest.java b/gax-java/gax/src/test/java/com/google/api/gax/tracing/TracedClientStreamingCallableTest.java index cfee1c2a70..5e0b2b4ff4 100644 --- a/gax-java/gax/src/test/java/com/google/api/gax/tracing/TracedClientStreamingCallableTest.java +++ b/gax-java/gax/src/test/java/com/google/api/gax/tracing/TracedClientStreamingCallableTest.java @@ -30,6 +30,7 @@ package com.google.api.gax.tracing; import static com.google.common.truth.Truth.assertThat; +import static org.mockito.ArgumentMatchers.any; import static org.mockito.Mockito.times; import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; @@ -38,29 +39,35 @@ import com.google.api.gax.rpc.ApiStreamObserver; import com.google.api.gax.rpc.CancelledException; import com.google.api.gax.rpc.ClientStreamingCallable; +import com.google.api.gax.rpc.LibraryMetadata; import com.google.api.gax.rpc.StatusCode.Code; import com.google.api.gax.rpc.testing.FakeCallContext; import com.google.api.gax.rpc.testing.FakeStatusCode; +import com.google.api.gax.tracing.ApiTracerContext.Transport; import com.google.api.gax.tracing.ApiTracerFactory.OperationType; import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; import com.google.common.collect.Lists; import java.util.List; import java.util.concurrent.CancellationException; -import org.junit.Before; -import org.junit.Rule; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.junit.runners.JUnit4; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.ValueSource; +import org.mockito.ArgumentCaptor; import org.mockito.Mock; -import org.mockito.junit.MockitoJUnit; -import org.mockito.junit.MockitoRule; -import org.mockito.quality.Strictness; +import org.mockito.junit.jupiter.MockitoExtension; -@RunWith(JUnit4.class) -public class TracedClientStreamingCallableTest { +@ExtendWith(MockitoExtension.class) +class TracedClientStreamingCallableTest { private static final SpanName SPAN_NAME = SpanName.of("fake-client", "fake-method"); - public @Rule MockitoRule mockitoRule = MockitoJUnit.rule().strictness(Strictness.STRICT_STUBS); + private static final ApiTracerContext TRACER_CONTEXT = + ApiTracerContext.newBuilder() + .setFullMethodName("fake-client/fake-method") + .setTransport(Transport.GRPC) + .setLibraryMetadata(LibraryMetadata.empty()) + .setOperationType(OperationType.ClientStreaming) + .build(); @Mock private ApiTracerFactory tracerFactory; private ApiTracer parentTracer = BaseApiTracer.getInstance(); @@ -71,26 +78,58 @@ public class TracedClientStreamingCallableTest { private FakeStreamObserver outerResponseObsever; private FakeCallContext callContext; - @Before - public void setUp() { - when(tracerFactory.newTracer(parentTracer, SPAN_NAME, OperationType.ClientStreaming)) - .thenReturn(tracer); - innerCallable = new FakeClientCallable(); - tracedCallable = new TracedClientStreamingCallable<>(innerCallable, tracerFactory, SPAN_NAME); + void init(boolean useContext) { outerResponseObsever = new FakeStreamObserver(); callContext = FakeCallContext.createDefault(); + innerCallable = new FakeClientCallable(); + if (useContext) { + when(tracerFactory.newTracer(any(ApiTracer.class), any(ApiTracerContext.class))) + .thenReturn(tracer); + tracedCallable = + new TracedClientStreamingCallable<>(innerCallable, tracerFactory, TRACER_CONTEXT); + } else { + when(tracerFactory.newTracer(parentTracer, SPAN_NAME, OperationType.ClientStreaming)) + .thenReturn(tracer); + tracedCallable = new TracedClientStreamingCallable<>(innerCallable, tracerFactory, SPAN_NAME); + } } - @Test - public void testTracerCreated() { + @ParameterizedTest + @ValueSource(booleans = {false, true}) + void testTracerCreated(boolean useContext) { + init(useContext); tracedCallable.clientStreamingCall(outerResponseObsever, callContext); - verify(tracerFactory, times(1)) - .newTracer(parentTracer, SPAN_NAME, OperationType.ClientStreaming); + if (useContext) { + verify(tracerFactory, times(1)).newTracer(parentTracer, TRACER_CONTEXT); + } else { + verify(tracerFactory, times(1)) + .newTracer(parentTracer, SPAN_NAME, OperationType.ClientStreaming); + } } @Test - public void testCallContextPropagated() { + void testOperationTypeIsSet() { + init(true); + ApiTracerContext contextWithWrongType = + TRACER_CONTEXT.toBuilder().setOperationType(OperationType.Unary).build(); + + innerCallable = new FakeClientCallable(); + tracedCallable = + new TracedClientStreamingCallable<>(innerCallable, tracerFactory, contextWithWrongType); + + tracedCallable.clientStreamingCall(new FakeStreamObserver(), FakeCallContext.createDefault()); + + ArgumentCaptor contextCaptor = + ArgumentCaptor.forClass(ApiTracerContext.class); + verify(tracerFactory).newTracer(any(ApiTracer.class), contextCaptor.capture()); + assertThat(contextCaptor.getValue().operationType()).isEqualTo(OperationType.ClientStreaming); + } + + @ParameterizedTest + @ValueSource(booleans = {false, true}) + void testCallContextPropagated(boolean useContext) { + init(useContext); ImmutableMap> extraHeaders = ImmutableMap.>of("header1", ImmutableList.of("value1")); @@ -100,8 +139,10 @@ public void testCallContextPropagated() { assertThat(innerCallable.callContext.getExtraHeaders()).isEqualTo(extraHeaders); } - @Test - public void testOperationCancelled() { + @ParameterizedTest + @ValueSource(booleans = {false, true}) + void testOperationCancelled(boolean useContext) { + init(useContext); ApiStreamObserver clientStream = tracedCallable.clientStreamingCall(outerResponseObsever, callContext); @@ -116,8 +157,10 @@ public void testOperationCancelled() { verify(tracer, times(1)).operationCancelled(); } - @Test - public void testOperationFinished() { + @ParameterizedTest + @ValueSource(booleans = {false, true}) + void testOperationFinished(boolean useContext) { + init(useContext); tracedCallable.clientStreamingCall(outerResponseObsever, callContext); innerCallable.responseObserver.onNext("ignored"); innerCallable.responseObserver.onCompleted(); @@ -125,8 +168,10 @@ public void testOperationFinished() { verify(tracer, times(1)).operationSucceeded(); } - @Test - public void testOperationFailed() { + @ParameterizedTest + @ValueSource(booleans = {false, true}) + void testOperationFailed(boolean useContext) { + init(useContext); RuntimeException expectedError = new RuntimeException("fake error"); tracedCallable.clientStreamingCall(outerResponseObsever, callContext); innerCallable.responseObserver.onError(expectedError); @@ -134,8 +179,10 @@ public void testOperationFailed() { verify(tracer, times(1)).operationFailed(expectedError); } - @Test - public void testSyncError() { + @ParameterizedTest + @ValueSource(booleans = {false, true}) + void testSyncError(boolean useContext) { + init(useContext); RuntimeException expectedError = new RuntimeException("fake error"); innerCallable.syncError = expectedError; @@ -148,8 +195,10 @@ public void testSyncError() { verify(tracer, times(1)).operationFailed(expectedError); } - @Test - public void testRequestNotify() { + @ParameterizedTest + @ValueSource(booleans = {false, true}) + void testRequestNotify(boolean useContext) { + init(useContext); ApiStreamObserver requestStream = tracedCallable.clientStreamingCall(outerResponseObsever, callContext); diff --git a/gax-java/gax/src/test/java/com/google/api/gax/tracing/TracedOperationCallableTest.java b/gax-java/gax/src/test/java/com/google/api/gax/tracing/TracedOperationCallableTest.java index 80efd1f475..f8b008c1ae 100644 --- a/gax-java/gax/src/test/java/com/google/api/gax/tracing/TracedOperationCallableTest.java +++ b/gax-java/gax/src/test/java/com/google/api/gax/tracing/TracedOperationCallableTest.java @@ -47,24 +47,17 @@ import com.google.api.gax.rpc.OperationCallable; import com.google.api.gax.rpc.testing.FakeCallContext; import com.google.api.gax.tracing.ApiTracerFactory.OperationType; -import org.junit.Before; -import org.junit.Rule; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.junit.runners.JUnit4; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; import org.mockito.Mock; import org.mockito.Mockito; -import org.mockito.junit.MockitoJUnit; -import org.mockito.junit.MockitoRule; -import org.mockito.quality.Strictness; +import org.mockito.junit.jupiter.MockitoExtension; -@RunWith(JUnit4.class) -public class TracedOperationCallableTest { +@ExtendWith(MockitoExtension.class) +class TracedOperationCallableTest { private static final SpanName SPAN_NAME = SpanName.of("FakeClient", "FakeOperation"); - @Rule - public final MockitoRule mockitoRule = MockitoJUnit.rule().strictness(Strictness.STRICT_STUBS); - @Mock private ApiTracerFactory tracerFactory; private ApiTracer parentTracer; @Mock private ApiTracer tracer; @@ -74,8 +67,8 @@ public class TracedOperationCallableTest { private TracedOperationCallable tracedOperationCallable; private FakeCallContext callContext; - @Before - public void setUp() { + @BeforeEach + void setUp() { parentTracer = BaseApiTracer.getInstance(); // Wire the mock tracer factory @@ -94,13 +87,13 @@ public void setUp() { } @Test - public void testTracerCreated() { + void testTracerCreated() { tracedOperationCallable.futureCall("test", callContext); verify(tracerFactory, times(1)).newTracer(parentTracer, SPAN_NAME, OperationType.LongRunning); } @Test - public void testOperationFinish() { + void testOperationFinish() { innerResult.set("successful result"); tracedOperationCallable.futureCall("test", callContext); @@ -108,14 +101,14 @@ public void testOperationFinish() { } @Test - public void testOperationCancelled() { + void testOperationCancelled() { innerResult.cancel(true); tracedOperationCallable.futureCall("test", callContext); verify(tracer, times(1)).operationCancelled(); } @Test - public void testExternalOperationCancel() { + void testExternalOperationCancel() { Mockito.reset(innerCallable, tracerFactory); when(tracerFactory.newTracer( @@ -136,7 +129,7 @@ public void testExternalOperationCancel() { } @Test - public void testOperationFailed() { + void testOperationFailed() { RuntimeException fakeError = new RuntimeException("fake error"); innerResult.setException(fakeError); tracedOperationCallable.futureCall("test", callContext); @@ -145,7 +138,7 @@ public void testOperationFailed() { } @Test - public void testSyncError() { + void testSyncError() { RuntimeException fakeError = new RuntimeException("fake error"); // Reset the irrelevant expectations from setup. (only needed to silence the warnings). diff --git a/gax-java/gax/src/test/java/com/google/api/gax/tracing/TracedServerStreamingCallableTest.java b/gax-java/gax/src/test/java/com/google/api/gax/tracing/TracedServerStreamingCallableTest.java index 660e525b52..8236a717d0 100644 --- a/gax-java/gax/src/test/java/com/google/api/gax/tracing/TracedServerStreamingCallableTest.java +++ b/gax-java/gax/src/test/java/com/google/api/gax/tracing/TracedServerStreamingCallableTest.java @@ -49,25 +49,21 @@ import com.google.api.gax.rpc.testing.MockStreamingApi.MockServerStreamingCall; import com.google.api.gax.rpc.testing.MockStreamingApi.MockServerStreamingCallable; import com.google.api.gax.tracing.ApiTracerFactory.OperationType; -import org.junit.Before; -import org.junit.Rule; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.junit.runners.JUnit4; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.ValueSource; import org.mockito.Mock; -import org.mockito.junit.MockitoJUnit; -import org.mockito.junit.MockitoRule; -import org.mockito.quality.Strictness; +import org.mockito.junit.jupiter.MockitoExtension; -@RunWith(JUnit4.class) -public class TracedServerStreamingCallableTest { +@ExtendWith(MockitoExtension.class) +class TracedServerStreamingCallableTest { private static final SpanName SPAN_NAME = SpanName.of("FakeClient", "FakeRpc"); - @Rule - public final MockitoRule mockitoRule = MockitoJUnit.rule().strictness(Strictness.STRICT_STUBS); - @Mock private ApiTracerFactory tracerFactory; @Mock private ApiTracer tracer; + @Mock private ApiTracerContext tracerContext; + @Mock private ApiTracerContext.Builder tracerContextBuilder; private MockServerStreamingCallable innerCallable; private TracedServerStreamingCallable tracedCallable; @@ -75,30 +71,54 @@ public class TracedServerStreamingCallableTest { private ApiCallContext callContext; @Mock private ApiTracer parentTracer; - @Before - public void setUp() { - // Wire the mock tracer factory - when(tracerFactory.newTracer( - any(ApiTracer.class), any(SpanName.class), eq(OperationType.ServerStreaming))) - .thenReturn(tracer); + void init(boolean useContext) { innerCallable = new MockServerStreamingCallable<>(); + // Wire the mock tracer factory + if (useContext) { + when(tracerContext.toBuilder()).thenReturn(tracerContextBuilder); + when(tracerContextBuilder.setOperationType(any())).thenReturn(tracerContextBuilder); + when(tracerContextBuilder.build()).thenReturn(tracerContext); + when(tracerFactory.newTracer(any(ApiTracer.class), any(ApiTracerContext.class))) + .thenReturn(tracer); + when(tracerContext.fullMethodName()).thenReturn("FakeClient/FakeRpc"); + tracedCallable = + new TracedServerStreamingCallable<>(innerCallable, tracerFactory, tracerContext); + } else { + when(tracerFactory.newTracer( + any(ApiTracer.class), any(SpanName.class), eq(OperationType.ServerStreaming))) + .thenReturn(tracer); + tracedCallable = new TracedServerStreamingCallable<>(innerCallable, tracerFactory, SPAN_NAME); + } responseObserver = new MockResponseObserver<>(true); callContext = FakeCallContext.createDefault().withTracer(parentTracer); + } - // Build the system under test - tracedCallable = new TracedServerStreamingCallable<>(innerCallable, tracerFactory, SPAN_NAME); + @ParameterizedTest + @ValueSource(booleans = {false, true}) + void testTracerCreated(boolean useContext) { + init(useContext); + tracedCallable.call("test", responseObserver, callContext); + if (useContext) { + verify(tracerFactory, times(1)).newTracer(parentTracer, tracerContext); + } else { + verify(tracerFactory, times(1)) + .newTracer(parentTracer, SPAN_NAME, OperationType.ServerStreaming); + } } @Test - public void testTracerCreated() { + void testOperationTypeIsSet() { + init(true); tracedCallable.call("test", responseObserver, callContext); - verify(tracerFactory, times(1)) - .newTracer(parentTracer, SPAN_NAME, OperationType.ServerStreaming); + + verify(tracerContextBuilder).setOperationType(OperationType.ServerStreaming); } - @Test - public void testResponseNotify() { + @ParameterizedTest + @ValueSource(booleans = {false, true}) + void testResponseNotify(boolean useContext) { + init(useContext); tracedCallable.call("test", responseObserver, callContext); MockServerStreamingCall innerCall = innerCallable.popLastCall(); @@ -110,8 +130,10 @@ public void testResponseNotify() { verify(tracer, times(2)).responseReceived(); } - @Test - public void testOperationCancelled() { + @ParameterizedTest + @ValueSource(booleans = {false, true}) + void testOperationCancelled(boolean useContext) { + init(useContext); tracedCallable.call("test", responseObserver, callContext); responseObserver.getController().cancel(); @@ -126,8 +148,10 @@ public void testOperationCancelled() { verify(tracer, times(1)).operationCancelled(); } - @Test - public void testOperationFinish() { + @ParameterizedTest + @ValueSource(booleans = {false, true}) + void testOperationFinish(boolean useContext) { + init(useContext); tracedCallable.call("test", responseObserver, callContext); MockServerStreamingCall innerCall = innerCallable.popLastCall(); @@ -137,8 +161,10 @@ public void testOperationFinish() { verify(tracer, times(1)).operationSucceeded(); } - @Test - public void testOperationFail() { + @ParameterizedTest + @ValueSource(booleans = {false, true}) + void testOperationFail(boolean useContext) { + init(useContext); RuntimeException expectedError = new RuntimeException("expected error"); tracedCallable.call("test", responseObserver, callContext); @@ -150,9 +176,11 @@ public void testOperationFail() { verify(tracer, times(1)).operationFailed(expectedError); } - @Test + @ParameterizedTest + @ValueSource(booleans = {false, true}) @SuppressWarnings("unchecked") - public void testSyncError() { + void testSyncError(boolean useContext) { + init(useContext); RuntimeException expectedError = new RuntimeException("expected error"); // Create a broken inner callable @@ -165,7 +193,12 @@ public void testSyncError() { any(ApiCallContext.class)); // Recreate the tracedCallable using the new inner callable - tracedCallable = new TracedServerStreamingCallable<>(innerCallable, tracerFactory, SPAN_NAME); + if (useContext) { + tracedCallable = + new TracedServerStreamingCallable<>(innerCallable, tracerFactory, tracerContext); + } else { + tracedCallable = new TracedServerStreamingCallable<>(innerCallable, tracerFactory, SPAN_NAME); + } try { tracedCallable.call("test", responseObserver, callContext); diff --git a/gax-java/gax/src/test/java/com/google/api/gax/tracing/TracedUnaryCallableTest.java b/gax-java/gax/src/test/java/com/google/api/gax/tracing/TracedUnaryCallableTest.java index 9d066bdb47..15e637ebff 100644 --- a/gax-java/gax/src/test/java/com/google/api/gax/tracing/TracedUnaryCallableTest.java +++ b/gax-java/gax/src/test/java/com/google/api/gax/tracing/TracedUnaryCallableTest.java @@ -29,6 +29,7 @@ */ package com.google.api.gax.tracing; +import static com.google.common.truth.Truth.assertThat; import static org.mockito.Mockito.any; import static org.mockito.Mockito.anyString; import static org.mockito.Mockito.eq; @@ -39,25 +40,29 @@ import com.google.api.core.SettableApiFuture; import com.google.api.gax.rpc.ApiCallContext; +import com.google.api.gax.rpc.LibraryMetadata; import com.google.api.gax.rpc.UnaryCallable; import com.google.api.gax.rpc.testing.FakeCallContext; +import com.google.api.gax.tracing.ApiTracerContext.Transport; import com.google.api.gax.tracing.ApiTracerFactory.OperationType; -import org.junit.Before; -import org.junit.Rule; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.junit.runners.JUnit4; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.ValueSource; +import org.mockito.ArgumentCaptor; import org.mockito.Mock; -import org.mockito.junit.MockitoJUnit; -import org.mockito.junit.MockitoRule; -import org.mockito.quality.Strictness; +import org.mockito.junit.jupiter.MockitoExtension; -@RunWith(JUnit4.class) -public class TracedUnaryCallableTest { +@ExtendWith(MockitoExtension.class) +class TracedUnaryCallableTest { private static final SpanName SPAN_NAME = SpanName.of("FakeClient", "FakeRpc"); - - @Rule - public final MockitoRule mockitoRule = MockitoJUnit.rule().strictness(Strictness.STRICT_STUBS); + private static final ApiTracerContext TRACER_CONTEXT = + ApiTracerContext.newBuilder() + .setFullMethodName("FakeClient/FakeRpc") + .setTransport(Transport.GRPC) + .setLibraryMetadata(LibraryMetadata.empty()) + .setOperationType(OperationType.Unary) + .build(); @Mock private ApiTracerFactory tracerFactory; private ApiTracer parentTracer; @@ -68,47 +73,87 @@ public class TracedUnaryCallableTest { private TracedUnaryCallable tracedUnaryCallable; private FakeCallContext callContext; - @Before - public void setUp() { + void init(boolean useContext) { parentTracer = BaseApiTracer.getInstance(); // Wire the mock tracer factory - when(tracerFactory.newTracer( - any(ApiTracer.class), any(SpanName.class), eq(OperationType.Unary))) - .thenReturn(tracer); + if (useContext) { + when(tracerFactory.newTracer(any(ApiTracer.class), any(ApiTracerContext.class))) + .thenReturn(tracer); + tracedUnaryCallable = + new TracedUnaryCallable<>(innerCallable, tracerFactory, TRACER_CONTEXT, null); + } else { + when(tracerFactory.newTracer( + any(ApiTracer.class), any(SpanName.class), eq(OperationType.Unary))) + .thenReturn(tracer); + tracedUnaryCallable = new TracedUnaryCallable<>(innerCallable, tracerFactory, SPAN_NAME); + } // Wire the mock inner callable innerResult = SettableApiFuture.create(); when(innerCallable.futureCall(anyString(), any(ApiCallContext.class))).thenReturn(innerResult); - // Build the system under test - tracedUnaryCallable = new TracedUnaryCallable<>(innerCallable, tracerFactory, SPAN_NAME); callContext = FakeCallContext.createDefault(); } - @Test - public void testTracerCreated() { + @ParameterizedTest + @ValueSource(booleans = {false, true}) + void testTracerCreated(boolean useContext) { + init(useContext); tracedUnaryCallable.futureCall("test", callContext); - verify(tracerFactory, times(1)).newTracer(parentTracer, SPAN_NAME, OperationType.Unary); + if (useContext) { + verify(tracerFactory, times(1)).newTracer(parentTracer, TRACER_CONTEXT); + } else { + verify(tracerFactory, times(1)).newTracer(parentTracer, SPAN_NAME, OperationType.Unary); + } } @Test - public void testOperationFinish() { + void testOperationTypeIsSet() { + when(tracerFactory.newTracer(any(ApiTracer.class), any(ApiTracerContext.class))) + .thenReturn(tracer); + tracedUnaryCallable = + new TracedUnaryCallable<>(innerCallable, tracerFactory, TRACER_CONTEXT, null); + ApiTracerContext contextWithWrongType = + TRACER_CONTEXT.toBuilder().setOperationType(OperationType.BidiStreaming).build(); + + tracedUnaryCallable = + new TracedUnaryCallable<>(innerCallable, tracerFactory, contextWithWrongType, null); + + innerResult = SettableApiFuture.create(); + when(innerCallable.futureCall(anyString(), any(ApiCallContext.class))).thenReturn(innerResult); + + tracedUnaryCallable.futureCall("test", FakeCallContext.createDefault()); + + ArgumentCaptor contextCaptor = + ArgumentCaptor.forClass(ApiTracerContext.class); + verify(tracerFactory).newTracer(any(ApiTracer.class), contextCaptor.capture()); + assertThat(contextCaptor.getValue().operationType()).isEqualTo(OperationType.Unary); + } + + @ParameterizedTest + @ValueSource(booleans = {false, true}) + void testOperationFinish(boolean useContext) { + init(useContext); innerResult.set("successful result"); tracedUnaryCallable.futureCall("test", callContext); verify(tracer, times(1)).operationSucceeded(); } - @Test - public void testOperationCancelled() { + @ParameterizedTest + @ValueSource(booleans = {false, true}) + void testOperationCancelled(boolean useContext) { + init(useContext); innerResult.cancel(true); tracedUnaryCallable.futureCall("test", callContext); verify(tracer, times(1)).operationCancelled(); } - @Test - public void testOperationFailed() { + @ParameterizedTest + @ValueSource(booleans = {false, true}) + void testOperationFailed(boolean useContext) { + init(useContext); RuntimeException fakeError = new RuntimeException("fake error"); innerResult.setException(fakeError); tracedUnaryCallable.futureCall("test", callContext); @@ -116,8 +161,10 @@ public void testOperationFailed() { verify(tracer, times(1)).operationFailed(fakeError); } - @Test - public void testSyncError() { + @ParameterizedTest + @ValueSource(booleans = {false, true}) + void testSyncError(boolean useContext) { + init(useContext); RuntimeException fakeError = new RuntimeException("fake error"); // Reset the irrelevant expectations from setup. (only needed to silence the warnings). @@ -136,4 +183,55 @@ public void testSyncError() { verify(tracer, times(1)).operationFailed(fakeError); } + + @Test + void testResourceNameExtractorUsed() { + // Wire up tracerFactory capturing + when(tracerFactory.newTracer(any(ApiTracer.class), any(ApiTracerContext.class))) + .thenReturn(tracer); + + innerResult = SettableApiFuture.create(); + when(innerCallable.futureCall(anyString(), any(ApiCallContext.class))).thenReturn(innerResult); + + // Initialize TracedUnaryCallable with an extractor + tracedUnaryCallable = + new TracedUnaryCallable<>( + innerCallable, tracerFactory, TRACER_CONTEXT, request -> "extracted-resource-name"); + + tracedUnaryCallable.futureCall("test-request", FakeCallContext.createDefault()); + + ArgumentCaptor contextCaptor = + ArgumentCaptor.forClass(ApiTracerContext.class); + verify(tracerFactory).newTracer(any(ApiTracer.class), contextCaptor.capture()); + + // Verify the extractor was triggered and injected the field + assertThat(contextCaptor.getValue().destinationResourceId()) + .isEqualTo("extracted-resource-name"); + } + + @Test + void testExtractResourceNameToApiTracerContext_nullExtractor() { + tracedUnaryCallable = + new TracedUnaryCallable<>(innerCallable, tracerFactory, TRACER_CONTEXT, null); + ApiTracerContext context = tracedUnaryCallable.extractResourceNameToApiTracerContext("request"); + assertThat(context).isEqualTo(TRACER_CONTEXT); + } + + @Test + void testExtractResourceNameToApiTracerContext_extractorReturnsNull() { + tracedUnaryCallable = + new TracedUnaryCallable<>(innerCallable, tracerFactory, TRACER_CONTEXT, request -> null); + ApiTracerContext context = tracedUnaryCallable.extractResourceNameToApiTracerContext("request"); + assertThat(context).isEqualTo(TRACER_CONTEXT); + } + + @Test + void testExtractResourceNameToApiTracerContext_extractorReturnsResourceId() { + tracedUnaryCallable = + new TracedUnaryCallable<>( + innerCallable, tracerFactory, TRACER_CONTEXT, request -> "extracted-id"); + ApiTracerContext context = tracedUnaryCallable.extractResourceNameToApiTracerContext("request"); + assertThat(context).isNotSameInstanceAs(TRACER_CONTEXT); + assertThat(context.destinationResourceId()).isEqualTo("extracted-id"); + } } diff --git a/gax-java/gax/src/test/java/com/google/api/gax/util/FakeLogHandler.java b/gax-java/gax/src/test/java/com/google/api/gax/util/FakeLogHandler.java new file mode 100644 index 0000000000..f6dbef78ea --- /dev/null +++ b/gax-java/gax/src/test/java/com/google/api/gax/util/FakeLogHandler.java @@ -0,0 +1,59 @@ +/* + * Copyright 2023 Google LLC + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Google LLC nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +package com.google.api.gax.util; + +import java.util.ArrayList; +import java.util.List; +import java.util.logging.Handler; +import java.util.logging.LogRecord; +import java.util.stream.Collectors; + +/* + * Convenience class that stores the log entries produced by any logger + * It can then be inspected - its entries are a list log records + */ +public class FakeLogHandler extends Handler { + List records = new ArrayList<>(); + + @Override + public void publish(LogRecord record) { + records.add(record); + } + + @Override + public void flush() {} + + @Override + public void close() throws SecurityException {} + + public List getAllMessages() { + return records.stream().map(LogRecord::getMessage).collect(Collectors.toList()); + } +} diff --git a/gax-java/gax/src/test/java/com/google/api/gax/util/TimeConversionTestUtils.java b/gax-java/gax/src/test/java/com/google/api/gax/util/TimeConversionTestUtils.java new file mode 100644 index 0000000000..bc49bec95e --- /dev/null +++ b/gax-java/gax/src/test/java/com/google/api/gax/util/TimeConversionTestUtils.java @@ -0,0 +1,153 @@ +/* + * Copyright 2024 Google LLC + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Google LLC nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +package com.google.api.gax.util; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNull; + +import java.util.function.Function; + +public class TimeConversionTestUtils { + + /** + * Confirms that the behavior of getters and setters of an Instant property (both {@link + * java.time.Instant} and {@link org.threeten.bp.Instant}) is the same. + * + * @param testValue the value in millis to be tested + * @param javaTimeTargetSupplier a supplier of a {@link Target} that is created using an {@link + * java.time.Instant} + * @param threetenTargetSupplier a supplier of a {@link Target} that is created using an {@link + * org.threeten.bp.Instant} + * @param javaTimeGetter a getter of the {@link java.time.Instant} obtained from the instance of + * {@link Target} + * @param threetenGetter a getter of the {{@link org.threeten.bp.Instant} obtained from the + * instance of {@link Target} + * @param the type of the target containing the Instant property + */ + public static void testInstantMethod( + Long testValue, + Function javaTimeTargetSupplier, + Function threetenTargetSupplier, + Function javaTimeGetter, + Function threetenGetter) { + Function javaTimeTester = value -> value.toEpochMilli(); + Function threetenTester = value -> value.toEpochMilli(); + java.time.Instant javaTimeSupplierValue = + testValue == null ? null : java.time.Instant.ofEpochMilli(testValue); + org.threeten.bp.Instant threetenSupplierValue = + testValue == null ? null : org.threeten.bp.Instant.ofEpochMilli(testValue); + testTimeObjectMethod( + testValue, + javaTimeSupplierValue, + javaTimeTargetSupplier, + javaTimeGetter, + threetenGetter, + javaTimeTester, + threetenTester); + testTimeObjectMethod( + testValue, + threetenSupplierValue, + threetenTargetSupplier, + javaTimeGetter, + threetenGetter, + javaTimeTester, + threetenTester); + } + + /** + * Confirms that the behavior of getters and setters of a Duration property (both {@link + * java.time.Duration} and {@link org.threeten.bp.Duration}) is the same. + * + * @param testValue the value in millis to be tested + * @param javaTimeTargetSupplier a supplier of a {@link Target} that is created using an {@link + * java.time.Duration} + * @param threetenTargetSupplier a supplier of a {@link Target} that is created using an {@link + * org.threeten.bp.Duration} + * @param javaTimeGetter a getter of the {@link java.time.Duration} obtained from the instance of + * {@link Target} + * @param threetenGetter a getter of the {{@link org.threeten.bp.Duration} obtained from the + * instance of {@link Target} + * @param the type of the target containing the Duration property + */ + public static void testDurationMethod( + Long testValue, + Function javaTimeTargetSupplier, + Function threetenTargetSupplier, + Function javaTimeGetter, + Function threetenGetter) { + Function javaTimeTester = value -> value.toMillis(); + Function threetenTester = value -> value.toMillis(); + java.time.Duration javaTimeSupplierValue = + testValue == null ? null : java.time.Duration.ofMillis(testValue); + org.threeten.bp.Duration threetenSupplierValue = + testValue == null ? null : org.threeten.bp.Duration.ofMillis(testValue); + testTimeObjectMethod( + testValue, + javaTimeSupplierValue, + javaTimeTargetSupplier, + javaTimeGetter, + threetenGetter, + javaTimeTester, + threetenTester); + testTimeObjectMethod( + testValue, + threetenSupplierValue, + threetenTargetSupplier, + javaTimeGetter, + threetenGetter, + javaTimeTester, + threetenTester); + } + + /** + * Contains the common implementation of {@link #testInstantMethod(Long, Function, Function, + * Function, Function)} and {@link #testDurationMethod(Long, Function, Function, Function, + * Function)} and performs the corresponding assertions. + */ + private static void testTimeObjectMethod( + Long testValue, + SupplierType targetSupplierValue, + Function targetSupplier, + Function javaTimeGetter, + Function threetenGetter, + Function javaTimeTester, + Function threetenTester) { + Target target = targetSupplier.apply(targetSupplierValue); + JavaTime javaTimeValue = javaTimeGetter.apply(target); + Threeten threetenValue = threetenGetter.apply(target); + if (testValue == null) { + assertNull(javaTimeValue); + assertNull(threetenValue); + } else { + assertEquals(testValue.longValue(), javaTimeTester.apply(javaTimeValue).longValue()); + assertEquals(testValue.longValue(), threetenTester.apply(threetenValue).longValue()); + } + } +} diff --git a/gax-java/gax/src/test/java/com/google/api/gax/util/TimeConversionUtilsTest.java b/gax-java/gax/src/test/java/com/google/api/gax/util/TimeConversionUtilsTest.java new file mode 100644 index 0000000000..d8f2d16d7c --- /dev/null +++ b/gax-java/gax/src/test/java/com/google/api/gax/util/TimeConversionUtilsTest.java @@ -0,0 +1,118 @@ +/* + * Copyright 2024 Google LLC + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Google LLC nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +package com.google.api.gax.util; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNull; + +import org.junit.jupiter.api.Test; + +public class TimeConversionUtilsTest { + + // 0.999999999 seconds (1 second - 1 nano) - we need to subtract the nano or the Duration would + // overflow otherwise + final long MAX_DURATION_NANOS = + 1 * 1000 /*=1 micro*/ * 1000 /*=1 milli*/ * 1000 /*=1 second*/ - 1; + + // Arbitrary durations/instants to confirm conversion works as expected + final org.threeten.bp.Duration ttDuration = org.threeten.bp.Duration.ofMillis(123); + final org.threeten.bp.Instant ttInstant = org.threeten.bp.Instant.ofEpochMilli(123); + final java.time.Duration jtDuration = java.time.Duration.ofMillis(345); + final java.time.Instant jtInstant = java.time.Instant.ofEpochMilli(345); + + @Test + void testToJavaTimeDuration_validInput_succeeds() { + assertEquals( + ttDuration.toMillis(), TimeConversionUtils.toJavaTimeDuration(ttDuration).toMillis()); + assertNull(TimeConversionUtils.toJavaTimeDuration(null)); + } + + @Test + void testToThreetenTimeDuration_validInput_succeeds() { + assertEquals( + jtDuration.toMillis(), TimeConversionUtils.toThreetenDuration(jtDuration).toMillis()); + assertNull(TimeConversionUtils.toThreetenDuration(null)); + } + + @Test + void testToJavaTimeInstant_validInput_succeeds() { + assertEquals( + ttInstant.toEpochMilli(), TimeConversionUtils.toJavaTimeInstant(ttInstant).toEpochMilli()); + assertNull(TimeConversionUtils.toJavaTimeInstant(null)); + } + + @Test + void testToThreetenTimeInstant_validInput_succeeds() { + assertEquals( + jtInstant.toEpochMilli(), TimeConversionUtils.toThreetenInstant(jtInstant).toEpochMilli()); + assertNull(TimeConversionUtils.toThreetenInstant(null)); + } + + @Test + void testToThreeteenInstant_bigInput_doesNotOverflow() { + // defaults to MAX_SECONDS plus the max value of long for the nanos part + java.time.Instant jtInstant = java.time.Instant.MAX; + org.threeten.bp.Instant ttInstant = TimeConversionUtils.toThreetenInstant(jtInstant); + assertEquals(jtInstant.getEpochSecond(), ttInstant.getEpochSecond()); + assertEquals(jtInstant.getNano(), ttInstant.getNano()); + } + + @Test + void testToJavaTimeInstant_bigInput_doesNotOverflow() { + // defaults to MAX_SECONDS plus the max value of long for the nanos part + org.threeten.bp.Instant ttInstant = org.threeten.bp.Instant.MAX; + java.time.Instant jtInstant = TimeConversionUtils.toJavaTimeInstant(ttInstant); + assertEquals(jtInstant.getEpochSecond(), ttInstant.getEpochSecond()); + assertEquals(jtInstant.getNano(), ttInstant.getNano()); + } + + @Test + void testToThreeteenDuration_bigInput_doesNotOverflow() { + // we use the max long value for the seconds part and an arbitrary int for the nanos part, so we + // can confirm that both components are preserved + java.time.Duration jtDuration = + java.time.Duration.ofSeconds(Long.MAX_VALUE, MAX_DURATION_NANOS); + org.threeten.bp.Duration ttDuration = TimeConversionUtils.toThreetenDuration(jtDuration); + assertEquals(jtDuration.getSeconds(), ttDuration.getSeconds()); + assertEquals(jtDuration.getNano(), ttDuration.getNano()); + } + + @Test + void testToJavaTimeDuration_bigInput_doesNotOverflow() { + // we use the max long value for the seconds part and an arbitrary int for the nanos part, so we + // can confirm that both components are preserved + org.threeten.bp.Duration ttDuration = + org.threeten.bp.Duration.ofSeconds(Long.MAX_VALUE, MAX_DURATION_NANOS); + java.time.Duration jtDuration = TimeConversionUtils.toJavaTimeDuration(ttDuration); + assertEquals(jtDuration.getSeconds(), ttDuration.getSeconds()); + assertEquals(jtDuration.getNano(), ttDuration.getNano()); + } +} diff --git a/gax-java/gax/src/test/resources/META-INF/native-image/com.google.api/gax/native-image.properties b/gax-java/gax/src/test/resources/META-INF/native-image/com.google.api/gax/native-image.properties new file mode 100644 index 0000000000..0c966978c2 --- /dev/null +++ b/gax-java/gax/src/test/resources/META-INF/native-image/com.google.api/gax/native-image.properties @@ -0,0 +1,9 @@ +Args=--initialize-at-build-time=java.lang.annotation.Annotation,\ + org.junit.experimental.categories.Category,\ + org.junit.experimental.categories.CategoryValidator,\ + org.junit.Ignore,\ + org.junit.runner.RunWith,\ + org.junit.runners.model.FrameworkField,\ + org.junit.validator.AnnotationValidator,\ + org.junit.vintage.engine.discovery.FilterableIgnoringRunnerDecorator,\ + org.junit.vintage.engine.discovery.IgnoringRunnerDecorator \ No newline at end of file diff --git a/gax-java/gax/src/test/resources/META-INF/services/org.slf4j.spi.SLF4JServiceProvider b/gax-java/gax/src/test/resources/META-INF/services/org.slf4j.spi.SLF4JServiceProvider new file mode 100644 index 0000000000..de8b02c7be --- /dev/null +++ b/gax-java/gax/src/test/resources/META-INF/services/org.slf4j.spi.SLF4JServiceProvider @@ -0,0 +1 @@ +com.google.api.gax.logging.TestServiceProvider \ No newline at end of file diff --git a/gax-java/gax_java.bzl b/gax-java/gax_java.bzl index 83e11815c0..c9974575f4 100644 --- a/gax-java/gax_java.bzl +++ b/gax-java/gax_java.bzl @@ -26,13 +26,15 @@ # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +load("@rules_java//java:defs.bzl", "java_test") + def java_tests(name, srcs, runtime_deps, size): classNames = [] for src in srcs: # convert .java file path to fully qualified class name className = src[(src.index("/com/") + 1):-5].replace("/", ".") classNames.append(className) - native.java_test( + java_test( name = className, test_class = className, runtime_deps = runtime_deps, @@ -77,7 +79,7 @@ google_java_format_verification = rule( "srcs": attr.label_list(allow_files = True), "formatter": attr.label( executable = True, - cfg = "host", + cfg = "exec", ), }, outputs = {"output_file": "%{name}.txt"}, diff --git a/gax-java/gradle/wrapper/gradle-wrapper.jar b/gax-java/gradle/wrapper/gradle-wrapper.jar deleted file mode 100644 index 943f0cbfa7..0000000000 Binary files a/gax-java/gradle/wrapper/gradle-wrapper.jar and /dev/null differ diff --git a/gax-java/gradle/wrapper/gradle-wrapper.properties b/gax-java/gradle/wrapper/gradle-wrapper.properties deleted file mode 100644 index f398c33c4b..0000000000 --- a/gax-java/gradle/wrapper/gradle-wrapper.properties +++ /dev/null @@ -1,6 +0,0 @@ -distributionBase=GRADLE_USER_HOME -distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.6-bin.zip -networkTimeout=10000 -zipStoreBase=GRADLE_USER_HOME -zipStorePath=wrapper/dists diff --git a/gax-java/gradlew b/gax-java/gradlew deleted file mode 100755 index 65dcd68d65..0000000000 --- a/gax-java/gradlew +++ /dev/null @@ -1,244 +0,0 @@ -#!/bin/sh - -# -# Copyright © 2015-2021 the original authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -############################################################################## -# -# Gradle start up script for POSIX generated by Gradle. -# -# Important for running: -# -# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is -# noncompliant, but you have some other compliant shell such as ksh or -# bash, then to run this script, type that shell name before the whole -# command line, like: -# -# ksh Gradle -# -# Busybox and similar reduced shells will NOT work, because this script -# requires all of these POSIX shell features: -# * functions; -# * expansions «$var», «${var}», «${var:-default}», «${var+SET}», -# «${var#prefix}», «${var%suffix}», and «$( cmd )»; -# * compound commands having a testable exit status, especially «case»; -# * various built-in commands including «command», «set», and «ulimit». -# -# Important for patching: -# -# (2) This script targets any POSIX shell, so it avoids extensions provided -# by Bash, Ksh, etc; in particular arrays are avoided. -# -# The "traditional" practice of packing multiple parameters into a -# space-separated string is a well documented source of bugs and security -# problems, so this is (mostly) avoided, by progressively accumulating -# options in "$@", and eventually passing that to Java. -# -# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS, -# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly; -# see the in-line comments for details. -# -# There are tweaks for specific operating systems such as AIX, CygWin, -# Darwin, MinGW, and NonStop. -# -# (3) This script is generated from the Groovy template -# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt -# within the Gradle project. -# -# You can find Gradle at https://github.com/gradle/gradle/. -# -############################################################################## - -# Attempt to set APP_HOME - -# Resolve links: $0 may be a link -app_path=$0 - -# Need this for daisy-chained symlinks. -while - APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path - [ -h "$app_path" ] -do - ls=$( ls -ld "$app_path" ) - link=${ls#*' -> '} - case $link in #( - /*) app_path=$link ;; #( - *) app_path=$APP_HOME$link ;; - esac -done - -# This is normally unused -# shellcheck disable=SC2034 -APP_BASE_NAME=${0##*/} -APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit - -# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' - -# Use the maximum available, or set MAX_FD != -1 to use that value. -MAX_FD=maximum - -warn () { - echo "$*" -} >&2 - -die () { - echo - echo "$*" - echo - exit 1 -} >&2 - -# OS specific support (must be 'true' or 'false'). -cygwin=false -msys=false -darwin=false -nonstop=false -case "$( uname )" in #( - CYGWIN* ) cygwin=true ;; #( - Darwin* ) darwin=true ;; #( - MSYS* | MINGW* ) msys=true ;; #( - NONSTOP* ) nonstop=true ;; -esac - -CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar - - -# Determine the Java command to use to start the JVM. -if [ -n "$JAVA_HOME" ] ; then - if [ -x "$JAVA_HOME/jre/sh/java" ] ; then - # IBM's JDK on AIX uses strange locations for the executables - JAVACMD=$JAVA_HOME/jre/sh/java - else - JAVACMD=$JAVA_HOME/bin/java - fi - if [ ! -x "$JAVACMD" ] ; then - die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME - -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." - fi -else - JAVACMD=java - which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. - -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." -fi - -# Increase the maximum file descriptors if we can. -if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then - case $MAX_FD in #( - max*) - # In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. - # shellcheck disable=SC3045 - MAX_FD=$( ulimit -H -n ) || - warn "Could not query maximum file descriptor limit" - esac - case $MAX_FD in #( - '' | soft) :;; #( - *) - # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. - # shellcheck disable=SC3045 - ulimit -n "$MAX_FD" || - warn "Could not set maximum file descriptor limit to $MAX_FD" - esac -fi - -# Collect all arguments for the java command, stacking in reverse order: -# * args from the command line -# * the main class name -# * -classpath -# * -D...appname settings -# * --module-path (only if needed) -# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables. - -# For Cygwin or MSYS, switch paths to Windows format before running java -if "$cygwin" || "$msys" ; then - APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) - CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) - - JAVACMD=$( cygpath --unix "$JAVACMD" ) - - # Now convert the arguments - kludge to limit ourselves to /bin/sh - for arg do - if - case $arg in #( - -*) false ;; # don't mess with options #( - /?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath - [ -e "$t" ] ;; #( - *) false ;; - esac - then - arg=$( cygpath --path --ignore --mixed "$arg" ) - fi - # Roll the args list around exactly as many times as the number of - # args, so each arg winds up back in the position where it started, but - # possibly modified. - # - # NB: a `for` loop captures its iteration list before it begins, so - # changing the positional parameters here affects neither the number of - # iterations, nor the values presented in `arg`. - shift # remove old arg - set -- "$@" "$arg" # push replacement arg - done -fi - -# Collect all arguments for the java command; -# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of -# shell script including quotes and variable substitutions, so put them in -# double quotes to make sure that they get re-expanded; and -# * put everything else in single quotes, so that it's not re-expanded. - -set -- \ - "-Dorg.gradle.appname=$APP_BASE_NAME" \ - -classpath "$CLASSPATH" \ - org.gradle.wrapper.GradleWrapperMain \ - "$@" - -# Stop when "xargs" is not available. -if ! command -v xargs >/dev/null 2>&1 -then - die "xargs is not available" -fi - -# Use "xargs" to parse quoted args. -# -# With -n1 it outputs one arg per line, with the quotes and backslashes removed. -# -# In Bash we could simply go: -# -# readarray ARGS < <( xargs -n1 <<<"$var" ) && -# set -- "${ARGS[@]}" "$@" -# -# but POSIX shell has neither arrays nor command substitution, so instead we -# post-process each arg (as a line of input to sed) to backslash-escape any -# character that might be a shell metacharacter, then use eval to reverse -# that process (while maintaining the separation between arguments), and wrap -# the whole thing up as a single "set" statement. -# -# This will of course break if any of these variables contains a newline or -# an unmatched quote. -# - -eval "set -- $( - printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | - xargs -n1 | - sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | - tr '\n' ' ' - )" '"$@"' - -exec "$JAVACMD" "$@" diff --git a/gax-java/gradlew.bat b/gax-java/gradlew.bat deleted file mode 100644 index 6689b85bee..0000000000 --- a/gax-java/gradlew.bat +++ /dev/null @@ -1,92 +0,0 @@ -@rem -@rem Copyright 2015 the original author or authors. -@rem -@rem Licensed under the Apache License, Version 2.0 (the "License"); -@rem you may not use this file except in compliance with the License. -@rem You may obtain a copy of the License at -@rem -@rem https://www.apache.org/licenses/LICENSE-2.0 -@rem -@rem Unless required by applicable law or agreed to in writing, software -@rem distributed under the License is distributed on an "AS IS" BASIS, -@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -@rem See the License for the specific language governing permissions and -@rem limitations under the License. -@rem - -@if "%DEBUG%"=="" @echo off -@rem ########################################################################## -@rem -@rem Gradle startup script for Windows -@rem -@rem ########################################################################## - -@rem Set local scope for the variables with windows NT shell -if "%OS%"=="Windows_NT" setlocal - -set DIRNAME=%~dp0 -if "%DIRNAME%"=="" set DIRNAME=. -@rem This is normally unused -set APP_BASE_NAME=%~n0 -set APP_HOME=%DIRNAME% - -@rem Resolve any "." and ".." in APP_HOME to make it shorter. -for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi - -@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" - -@rem Find java.exe -if defined JAVA_HOME goto findJavaFromJavaHome - -set JAVA_EXE=java.exe -%JAVA_EXE% -version >NUL 2>&1 -if %ERRORLEVEL% equ 0 goto execute - -echo. -echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. - -goto fail - -:findJavaFromJavaHome -set JAVA_HOME=%JAVA_HOME:"=% -set JAVA_EXE=%JAVA_HOME%/bin/java.exe - -if exist "%JAVA_EXE%" goto execute - -echo. -echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. - -goto fail - -:execute -@rem Setup the command line - -set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar - - -@rem Execute Gradle -"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* - -:end -@rem End local scope for the variables with windows NT shell -if %ERRORLEVEL% equ 0 goto mainEnd - -:fail -rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of -rem the _cmd.exe /c_ return code! -set EXIT_CODE=%ERRORLEVEL% -if %EXIT_CODE% equ 0 set EXIT_CODE=1 -if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE% -exit /b %EXIT_CODE% - -:mainEnd -if "%OS%"=="Windows_NT" endlocal - -:omega diff --git a/gax-java/license-checks.xml b/gax-java/license-checks.xml index 362833222e..67ed8d317b 100644 --- a/gax-java/license-checks.xml +++ b/gax-java/license-checks.xml @@ -5,6 +5,6 @@ - + \ No newline at end of file diff --git a/gax-java/pom.xml b/gax-java/pom.xml index e546b9e08e..a303096dc4 100644 --- a/gax-java/pom.xml +++ b/gax-java/pom.xml @@ -4,15 +4,14 @@ com.google.api gax-parent pom - 2.20.2-SNAPSHOT + 2.76.1-SNAPSHOT GAX (Google Api eXtensions) for Java (Parent) - https://github.com/googleapis/gax-java Google Api eXtensions for Java (Parent) - com.google.cloud + com.google.api gapic-generator-java-pom-parent - 2.12.1-SNAPSHOT + 2.68.1-SNAPSHOT ../gapic-generator-java-pom-parent @@ -26,14 +25,9 @@ - - scm:git:https://github.com/googleapis/gax-java.git - https://github.com/googleapis/gax-java - - - BSD + BSD-3-Clause https://github.com/googleapis/gax-java/blob/master/LICENSE @@ -42,7 +36,6 @@ UTF-8 1.8 1.8 - 1.10.1 @@ -57,7 +50,7 @@ com.google.api api-common - 2.3.2-SNAPSHOT + 2.59.1-SNAPSHOT com.google.auth @@ -69,7 +62,7 @@ org.threeten threetenbp - 1.6.5 + ${threetenbp.version} com.google.code.findbugs @@ -102,37 +95,27 @@ auto-value ${auto-value.version} - - junit - junit - 4.13.2 - - - org.mockito - mockito-core - 4.11.0 - com.google.api gax - 2.20.2-SNAPSHOT + 2.76.1-SNAPSHOT com.google.api gax - 2.20.2-SNAPSHOT + 2.76.1-SNAPSHOT test-jar testlib com.google.api.grpc proto-google-common-protos - 2.11.1-SNAPSHOT + 2.67.1-SNAPSHOT com.google.api.grpc grpc-google-common-protos - 2.11.1-SNAPSHOT + 2.67.1-SNAPSHOT io.grpc @@ -147,14 +130,14 @@ ${gson.version} - org.graalvm.sdk - graal-sdk - 22.3.0 + org.slf4j + slf4j-api + ${slf4j.version} com.google.http-client google-http-client-bom - 1.42.3 + ${google.http-client.version} pom import @@ -165,14 +148,36 @@ pom import + + io.opentelemetry + opentelemetry-bom + ${opentelemetry.version} + pom + import + + + org.mockito + mockito-bom + ${mockito.version} + pom + import + - + + - junit - junit + org.junit.jupiter + junit-jupiter-engine + ${junit.version} + test + + + org.junit.jupiter + junit-jupiter-params + ${junit.version} test @@ -180,10 +185,15 @@ mockito-core test + + org.mockito + mockito-junit-jupiter + test + com.google.truth truth - 1.1.3 + 1.4.4 org.checkerframework @@ -238,7 +248,7 @@ - com.coveo + com.spotify.fmt fmt-maven-plugin @@ -262,7 +272,7 @@ org.sonatype.plugins nexus-staging-maven-plugin - 1.6.13 + 1.7.0 true sonatype-nexus-staging diff --git a/gax-java/renovate.json b/gax-java/renovate.json deleted file mode 100644 index f70cbde965..0000000000 --- a/gax-java/renovate.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "extends": [ - "config:base" - ], - "ignorePaths": [".kokoro/requirements.txt"], - "regexManagers": [ - { - "fileMatch": ["^dependencies\\.properties$"], - "matchStrings": ["=(?.*?):(?.*?)\\n"], - "datasourceTemplate": "maven" - }, - { - "fileMatch": ["^dependencies\\.properties$"], - "matchStrings": ["version\\.com_google_protobuf=(?.*?)\\n"], - "depNameTemplate": "com.google.protobuf:protobuf-java", - "datasourceTemplate": "maven" - }, - { - "fileMatch": ["^dependencies\\.properties$"], - "matchStrings": ["version\\.google_java_format=(?.*?)\\n"], - "depNameTemplate": "com.google.googlejavaformat:google-java-format", - "datasourceTemplate": "maven" - }, - { - "fileMatch": ["^dependencies\\.properties$"], - "matchStrings": ["version\\.io_grpc=(?.*?)\\n"], - "depNameTemplate": "io.grpc:grpc-core", - "datasourceTemplate": "maven" - } - ] -} diff --git a/gax-java/settings.gradle b/gax-java/settings.gradle deleted file mode 100644 index 52f23d4bfd..0000000000 --- a/gax-java/settings.gradle +++ /dev/null @@ -1,4 +0,0 @@ -include "gax" -include "gax-bom" -include "gax-grpc" -include "gax-httpjson" diff --git a/generation_config.yaml b/generation_config.yaml new file mode 100644 index 0000000000..1463b4e076 --- /dev/null +++ b/generation_config.yaml @@ -0,0 +1,53 @@ +googleapis_commitish: 5f6048b0222ddc57826fbbd254ea3197e2db82f3 +# the libraries are ordered with respect to library name, which is +# java-{library.library_name} or java-{library.api-shortname} when +# library.library_name is not defined. +libraries: +- api_shortname: showcase + excluded_poms: gapic-showcase-bom + name_pretty: Showcase + api_description: Showcase module + product_documentation: https://cloud.google.com/dummy + distribution_name: com.google.cloud:gapic-showcase + library_type: OTHER + GAPICs: + - proto_path: schema/google/showcase/v1beta1 +- api_shortname: common-protos + name_pretty: Common Protos + product_documentation: https://github.com/googleapis/api-common-protos + api_description: Protobuf classes for Google's common protos. + release_level: stable + client_documentation: https://cloud.google.com/java/docs/reference/proto-google-common-protos/latest/history + distribution_name: com.google.api.grpc:proto-google-common-protos + excluded_dependencies: "proto-google-common-protos,grpc-google-common-protos,proto-google-common-protos-parent" + excluded_poms: "proto-google-common-protos-bom,proto-google-common-protos" + library_type: OTHER + GAPICs: + - proto_path: google/api + - proto_path: google/apps/card/v1 + - proto_path: google/cloud + - proto_path: google/cloud/audit + - proto_path: google/cloud/location + - proto_path: google/geo/type + - proto_path: google/logging/type + - proto_path: google/longrunning + - proto_path: google/rpc + - proto_path: google/rpc/context + - proto_path: google/shopping/type + - proto_path: google/type +- api_shortname: iam + name_pretty: IAM + product_documentation: https://cloud.google.com/iam + api_description: Manages access control for Google Cloud Platform resources + release_level: stable + client_documentation: https://cloud.google.com/java/docs/reference/proto-google-iam-v1/latest/overview + distribution_name: com.google.api.grpc:proto-google-iam-v1 + excluded_dependencies: "grpc-google-iam-v1" + excluded_poms: "proto-google-iam-v1-bom,google-iam-policy,proto-google-iam-v1" + library_type: OTHER + GAPICs: + - proto_path: google/iam/v1 + - proto_path: google/iam/v2 + - proto_path: google/iam/v2beta + - proto_path: google/iam/v3 + - proto_path: google/iam/v3beta \ No newline at end of file diff --git a/hermetic_build/DEVELOPMENT.md b/hermetic_build/DEVELOPMENT.md new file mode 100644 index 0000000000..9d0eb5f6ce --- /dev/null +++ b/hermetic_build/DEVELOPMENT.md @@ -0,0 +1,253 @@ +> [!IMPORTANT] +> All examples assume you are inside the repository root folder. + + +# Linting + +When contributing, ensure your changes to python code have a valid format. + +``` +python -m pip install black +black {source_file_or_directory} +``` + +# Install package dependencies + +```shell +python -m pip install --require-hashes -r hermetic_build/common/requirements.txt +python -m pip install hermetic_build/common +python -m pip install --require-hashes -r hermetic_build/library_generation/requirements.txt +python -m pip install hermetic_build/library_generation +python -m pip install --require-hashes -r hermetic_build/release_note_generation/requirements.txt +python -m pip install hermetic_build/release_note_generation +``` + +# Run the integration tests + +The integration tests build the docker image declared in +`.cloudbuild/library_generation/library_generation.Dockerfile`, pull API +definitions and GAPIC repositories, generate the libraries and compare the +results with the source code declared in a "golden branch" of the repo. + +The integration tests are running in Cloud Build rather than GitHub workflow +because the workflow doesn't have permission to pull images from Airlock. + +The Cloud Build job is defined in `.cloudbuild/library_generation/cloudbuild-library-generation-integration-test.yaml` and runs in every pull request. + +# Run the unit tests + +There is one unit test file per component. +Every unit test script ends with `unit_tests.py`. +To avoid specifying them individually, we can use the following command: + +```shell +python -m unittest discover -s hermetic_build -p "*unit_tests.py" +``` + +> [!NOTE] +> The output of this command may look erratic during the first 30 seconds. +> This is normal. After the tests are done, an "OK" message should be shown. + +# Run the library generation scripts in your local environment + +Although the scripts are designed to run in a Docker container, you can also +run them directly. +This section explains how to run the entrypoint script +(`hermetic_build/library_generation/cli/entry_point.py`). + +## Assumptions made by the scripts + +### The Hermetic Build's well-known folder +Located in `${HOME}/.library_generation`, this folder is assumed by the scripts +to contain certain tools. + +Developers must make sure this folder is properly configured before running the +scripts locally. +Note that this relies on the `HOME` environment variable which is always defined +as per [POSIX env var definition](https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap08.html). + +#### Put the gapic-generator-java jar in its well-known location + +1. Run the following command to install gapic-generator-java. + + ```shell + mvn install -B -ntp -DskipTests -Dclirr.skip -Dcheckstyle.skip + ``` + This will generate a jar located in `~/.m2/repository/com/google/api/gapic-generator-java/{version}/gapic-generator-java-{version}.jar` + +2. Move the jar into its well-known location. + + ```shell + mv /path/to/jar "${HOME}/.library_generation/gapic-generator-java.jar" + ``` + +#### Put the protobuf compiler in its well-known location +1. Download protobuf compiler from [GitHub releases](https://github.com/protocolbuffers/protobuf/releases). +2. Move the folder into its well-know location. + + ```shell + unzip /path/to/zipfile -d "${HOME}/.library_generation/" + ``` +#### Put the GRPC plugin in its well-known location +1. Download GRPC plugin from [Maven Central](https://central.sonatype.com/artifact/io.grpc/protoc-gen-grpc-java/versions). +2. Move the folder into its well-know location. + + ```shell + mv /path/to/protoc-gen-grpc-java.exe "${HOME}/.library_generation/protoc-gen-grpc-java.exe" + ``` + +#### Put the java formatter jar in its well-known location + +1. Download google-java-format-{version}-all-deps.jar from [Maven Central](https://central.sonatype.com/artifact/com.google.googlejavaformat/google-java-format) +or [GitHub releases](https://github.com/google/google-java-format/releases). +2. Move the jar into its well-known location. + + ```shell + mv /path/to/jar "${HOME}/.library_generation/google-java-format.jar" + ``` + +## Installing prerequisites + +In order to run the generation scripts directly, there are a few tools we +need to install beforehand. + +### Install the owl-bot CLI + +This requires node.js to be installed. +Check this [installation guide](https://github.com/nvm-sh/nvm?tab=readme-ov-file#install--update-script) +for NVM, Node.js's version manager. + +After you install it, you can install the owl-bot CLI with the following +commands: + +```shell +git clone https://github.com/googleapis/repo-automation-bots +cd repo-automation-bots/packages/owl-bot +npm i && npm run compile && npm link +owl-bot copy-code --version +``` + +The key step is `npm link`, which will make the command available in you current +shell session. + +If you get a permission denied error when running the command `owl-bot`, try +relinking owl-bot by running `npm unlink -g` and re-running the steps above. + +## Run the script +The entrypoint script (`hermetic_build/library_generation/cli/entry_point.py`) +allows you to generate a GAPIC repository with a given api definition (proto, +service yaml). + +### Download the api definition +For example, from googleapis + +```shell +git clone https://github.com/googleapis/googleapis +export api_definitions_path="$(pwd)/googleapis" +``` + +### Download the repo +For example, google-cloud-java +```shell +git clone https://github.com/googleapis/google-cloud-java +export path_to_repo="$(pwd)/google-cloud-java" +``` + +### Install the scripts + +You can skip this step if you've installed the packages in [Install package dependencies](#install-package-dependencies). +Use the `--editable` flag for your changes to take effect as soon as you modify any file inside +the package. + +```shell +python -m pip install --require-hashes -r hermetic_build/common/requirements.txt +python -m pip install --editable hermetic_build/common +python -m pip install --require-hashes -r hermetic_build/library_generation/requirements.txt +python -m pip install --editable hermetic_build/library_generation +``` + +### Run the script + +```shell +python hermetic_build/library_generation/cli/entry_point.py generate \ + --repository-path="${path_to_repo}" \ + --api-definitions-path="${api_definitions_path}" +``` + +# Build the image from source + +1. Run the following command to build the image from source + + ```shell + DOCKER_BUILDKIT=1 docker build \ + -f .cloudbuild/library_generation/library_generation.Dockerfile \ + -t local:image-tag \ + . + ``` + Please note that the build only works when using the new [Docker BuildKit](https://docs.docker.com/build/buildkit/) + (enabled through the `DOCKER_BUILDKIT` variable). + +2. Set the version of gapic-generator-java + + ```shell + LOCAL_GENERATOR_VERSION=$(mvn \ + org.apache.maven.plugins:maven-help-plugin:evaluate \ + -Dexpression=project.version \ + -pl gapic-generator-java \ + -DforceStdout \ + -q) + ``` + +3. Run the image + + ```shell + # Assume you want to generate the library in the current working directory + # and the generation configuration is in the same directory. + docker run \ + --rm \ + --quiet \ + -u "$(id -u):$(id -g)" \ + -v "$(pwd):/workspace" \ + -v /path/to/api-definitions:/workspace/apis \ + -e GENERATOR_VERSION="${LOCAL_GENERATOR_VERSION}" \ + local:image-tag \ + --generation-config-path=/workspace/generation_config_file \ + --library-names=apigee-connect,asset \ + --repository-path=/workspace \ + --api-definitions-path=/workspace/apis + ``` + +# Debugging tips +## Debug the scripts +Especially on local setups, consider adding the `xtrace` (`set -x`) flag to + - `hermetic_build/library_generation/generate_library.sh` + - `hermetic_build/library_generation/utils/utilities.sh` + +This will allow you to observe how the tools you prepared in `~/.library_generation` are being used. + + +## Debug the library generation container +If you are working on changing the way the containers are created, you may want +to inspect the containers to check the setup. +It would be convenient in such case to have a text editor/viewer available. +You can achieve this by modifying the Dockerfile as follows: + +```dockerfile +# install OS tools +RUN apk update && apk add \ + unzip curl rsync openjdk11 jq bash nodejs npm git less vim +``` + +We add `less` and `vim` as text tools for further inspection. + +You can also run a shell in a new container by running: + +```shell +docker run \ + --rm \ + -it \ + -u $(id -u):$(id -g) \ + -v /path/to/google-cloud-java:/workspace \ + --entrypoint="bash" \ + $(cat image-id) +``` diff --git a/hermetic_build/README.md b/hermetic_build/README.md new file mode 100644 index 0000000000..2b5cc5239e --- /dev/null +++ b/hermetic_build/README.md @@ -0,0 +1,412 @@ +> [!IMPORTANT] +> All scripts/examples assume you are inside the repository root folder. + +# Generate a repository containing GAPIC Client Libraries + +Running the docker image built from `hermetic_build/library_generation` +directory, you can generate a repository containing GAPIC client libraries (a +monorepo, for example, google-cloud-java) from a configuration file. + +## Environment + +- OS: Linux +- Docker + +## Prerequisites + +### Generation configuration + +A generation configuration file is required to generate GAPIC Client Libraries. + +Please refer to [Generation configuration](#configuration-to-generate-a-repository) +for more information. + +### versions.txt + +In order to generate a version for each library, a `versions.txt` has to exist +in `repository-path`. +Please refer to [Repository path](#repository-path-repository-path-optional) +for more information. + +## Parameters to generate a repository using the docker image + +### Generation configuration yaml (`generation-config-path`), optional + +An absolute or relative path to a configuration file containing parameters to +generate the repository. +Please refer to [Configuration to generate a repository](#configuration-to-generate-a-repository) +for more information. + +The default value is `$(pwd)/generation_config.yaml`, i.e., `generation_config.yaml` +in the current working directory. + +This will raise `FileNotFoundError` if the specified generation config does not +exist or, in case `generation-config-path` is not specified, the default +generation config does not exist. + +### Repository path (`repository-path`), optional + +The path to where the generated repository goes. + +The default value is the current working directory when running the script. +For example, `cd google-cloud-java && python /path/to/entry_point.py ...` without +specifying the `--repository_path` option will modify the `google-cloud-java` +repository the user `cd`'d into. + +Note that `versions.txt` has to exist in `repository_path` in order to generate +the right version for each library. +Please refer go/java-client-releasing#versionstxt-manifest for more info +of versions.txt. + +### A list of library names (`library-names`), optional + +A list of library names that will be generated, separated by comma. +The library name of a library is the value of `library_name` or `api_shortname`, +if `library_name` is not specified, in the generation configuration. + +If not specified, all libraries in the generation +configuration will be generated. + +### Api definitions path (`api-definitions-path`), optional + +The path to where the api definition (proto, service yaml) resides. + +The default value is the current working directory when running the script. + +**Note that you need not only the protos defined the service, but also the +transitive dependencies of those protos.** +Any missing dependencies will cause `File not found` error. + +For example, if your service is defined in `example_service.proto` and it +imports `google/api/annotations.proto`, you need the `annotations.proto` resides +in a folder that has the exact structure of the import statement (`google/api` +in this case), and set `api_definitions_path` to the path contains the root +folder (`google` in this case). + +## Output + +### GAPIC libraries + +For each module (e.g. `google-cloud-java/java-asset`), the following +files/folders will be created/modified: + +| Name | Notes | +|:------------------------------------|:-------------------------------------------------------------------------| +| google-*/ | Source code generated by gapic-generator-java | +| google-*/pom.xml | Only be generated if it does not exist | +| grpc-*/ | Source code generated by grpc generator, one per each version | +| grpc-*/pom.xml | Only be generated if it does not exist | +| proto-*/ | Source code generated by Protobuf default compiler, one per each version | +| proto-*/pom.xml | Only be generated if it does not exist | +| samples/snippets/generated/ | Only be generated if `include_samples` is set to true | +| google-*-bom/pom.xml | Library BOM, only be generated if it does not exist | +| pom.xml | Library parent BOM, only be generated if it does not exist | +| .repo-metadata.json | Always generated from inputs | +| .OwlBot-hermetic.yaml | Only be generated from a template if it does not exist | +| owlbot.py | Only be generated from a template if it does not exist | +| README.md | Always generated from inputs | +| gapic-libraries-bom/pom.xml | Always generated from inputs | +| pom.xml (repo root dir) | Always generated from inputs | +| versions.txt | New entries will be added if they don’t exist | + +## Configuration to generate a repository + +There are three levels of parameters in the configuration: repository level, +library level and GAPIC level. + +### Repository level parameters + +The repository level parameters define the version of API definition (proto) +and tools. +They are shared by library level parameters. + +| Name | Required | Notes | +|:------------------------|:--------:|:------------------------------------------| +| gapic_generator_version | No | set through env variable if not specified | +| googleapis_commitish | Yes | | +| libraries_bom_version | No | empty string if not specified | + +### Library level parameters + +The library level parameters define how to generate a (multi-versions) GAPIC +library. +They are shared by all GAPICs of a library. + +| Name | Required | Notes | +|:----------------------|:--------:|:------------------------------------------------------------------------------------------------------------------------------------------| +| api_shortname | Yes | | +| api_description | Yes | | +| name_pretty | Yes | | +| product_docs | Yes | | +| library_type | No | `GAPIC_AUTO` if not specified | +| release_level | No | `preview` if not specified | +| api_id | No | `{api_shortname}.googleapis.com` if not specified | +| api_reference | No | | +| codeowner_team | No | | +| client_documentation | No | | +| distribution_name | No | `{group_id}:google-{cloud_prefix}{library_name}` if not specified | +| excluded_poms | No | | +| excluded_dependencies | No | | +| googleapis_commitish | No | use repository level `googleapis_commitish` if not specified. | +| group_id | No | `com.google.cloud` if not specified | +| issue_tracker | No | | +| library_name | No | `api_shortname` is not specified. This value should be unique among all libraries. | +| rest_documentation | No | | +| rpc_documentation | No | | +| cloud_api | No | `true` if not specified | +| requires_billing | No | `true` if not specified | +| transport | No | must be one of `grpc`, `rest` or `both`. This value would only be used for generating .repo-metadata.json and relevant sections in README | + + +Note that `cloud_prefix` is `cloud-` if `cloud_api` is `true`; empty otherwise. + +### GAPIC level parameters + +The GAPIC level parameters define how to generate a GAPIC library. + +| Name | Required | Notes | +|:-----------|:--------:|:------------------------------------------| +| proto_path | Yes | versioned proto_path starts with `google` | + +### An example of generation configuration + +```yaml +gapic_generator_version: 2.34.0 +googleapis_commitish: 1a45bf7393b52407188c82e63101db7dc9c72026 +libraries_bom_version: 26.37.0 +libraries: + - api_shortname: apigeeconnect + name_pretty: Apigee Connect + product_documentation: "https://cloud.google.com/apigee/docs/hybrid/v1.3/apigee-connect/" + api_description: "allows the Apigee hybrid management plane to connect securely to the MART service in the runtime plane without requiring you to expose the MART endpoint on the internet." + release_level: "stable" + library_name: "apigee-connect" + GAPICs: + - proto_path: google/cloud/apigeeconnect/v1 + + - api_shortname: cloudasset + name_pretty: Cloud Asset Inventory + product_documentation: "https://cloud.google.com/resource-manager/docs/cloud-asset-inventory/overview" + api_description: "provides inventory services based on a time series database. This database keeps a five week history of Google Cloud asset metadata. The Cloud Asset Inventory export service allows you to export all asset metadata at a certain timestamp or export event change history during a timeframe." + library_name: "asset" + client_documentation: "https://cloud.google.com/java/docs/reference/google-cloud-asset/latest/overview" + distribution_name: "com.google.cloud:google-cloud-asset" + release_level: "stable" + issue_tracker: "https://issuetracker.google.com/issues/new?component=187210&template=0" + api_reference: "https://cloud.google.com/resource-manager/docs/cloud-asset-inventory/overview" + GAPICs: + - proto_path: google/cloud/asset/v1 + - proto_path: google/cloud/asset/v1p1beta1 + - proto_path: google/cloud/asset/v1p2beta1 + - proto_path: google/cloud/asset/v1p5beta1 + - proto_path: google/cloud/asset/v1p7beta1 +``` + +# Run the library generation image + +1. Download the API definitions to a local directory, e.g., from [googleapis](https://github.com/googleapis/googleapis). + +2. Run the docker image. + ```shell + # Assume you want to generate the library in the current working directory + # and the generation configuration is in the same directory. + docker run \ + --rm \ + --quiet \ + -u "$(id -u):$(id -g)" \ + -v "$(pwd):/workspace" \ + -v /path/to/api_definition:/workspace/apis \ + gcr.io/cloud-devrel-public-resources/java-library-generation:image-tag + ``` + + * `-u "$(id -u)":"$(id -g)"` makes docker run the container impersonating + yourself. + This avoids folder ownership changes since it runs as root by default. + * `-v "$(pwd):/workspace"` maps the host machine's current working directory + to the /workspace folder. + The image is configured to perform changes in this directory. + * `-v /path/to/api_definition:/workspace/apis` maps the host machine's API + definitions folder to `/workspace/apis` folder. + +3. An advanced example: + ```shell + docker run \ + --rm \ + --quiet \ + -u "$(id -u):$(id -g)" \ + -v "$(pwd):/workspace" \ + -v /path/to/api_definition:/workspace/apis \ + gcr.io/cloud-devrel-public-resources/java-library-generation:image-tag \ + --generation-config-path=/workspace/generation_config_file \ + --library-names=apigee-connect,asset \ + --repository-path=/workspace \ + --api-definitions-path=/workspace/apis + ``` + + * `--generation-config-path=/workspace/generation_config_file` set the + generation configuration to `/workspace/generation_config_file`. + * `--api-definitions-path=/workspace/apis` set the API definition path to + `/workspace/apis`. + +To debug the image, please refer to [development guide](DEVELOPMENT.md#debug-the-library-generation-container) +for more info. + +## An example to generate a repository using the docker image + +If you run the docker image with the example [configuration](#an-example-of-generation-configuration) +shown above, the repository structure is: +``` +$repository_path +|_gapic-libraries-bom +| |_pom.xml +|_java-apigee-connect +| |_google-cloud-apigee-connect +| | |_src +| | |_pom.xml +| |_google-cloud-apigee-connect-bom +| | |_pom.xml +| |_grpc-google-cloud-apigee-connect-v1 +| | |_src +| | |_pom.xml +| |_proto-google-cloud-apigee-connect-v1 +| | |_src +| | |_pom.xml +| |_samples +| | |_snippets +| | | |_generated +| |_.OwlBot-hermetic.yaml +| |_.repo-metadata.json +| |_owlbot.py +| |_pom.xml +| |_README.md +|_java-asset +| |_google-cloud-asset +| | |_src +| | |_pom.xml +| |_google-cloud-asset-bom +| | |_pom.xml +| |_grpc-google-cloud-asset-v1 +| | |_src +| | |_pom.xml +| |_grpc-google-cloud-asset-v1p1beta1 +| | |_src +| | |_pom.xml +| |_grpc-google-cloud-asset-v1p2beta1 +| | |_src +| | |_pom.xml +| |_grpc-google-cloud-asset-v1p5beta1 +| | |_src +| | |_pom.xml +| |_grpc-google-cloud-asset-v1p7beta1 +| | |_src +| | |_pom.xml +| |_proto-google-cloud-asset-v1 +| | |_src +| | |_pom.xml +| |_proto-google-cloud-asset-v1p1beta1 +| | |_src +| | |_pom.xml +| |_proto-google-cloud-asset-v1p2beta1 +| | |_src +| | |_pom.xml +| |_proto-google-cloud-asset-v1p5beta1 +| | |_src +| | |_pom.xml +| |_proto-google-cloud-asset-v1p7beta1 +| | |_src +| | |_pom.xml +| |_samples +| | |_snippets +| | | |_generated +| |_.OwlBot-hermetic.yaml +| |_.repo-metadata.json +| |_owlbot.py +| |_pom.xml +| |_README.md +|_pom.xml +|_versions.txt +``` + +# Generate release notes from API definition changes + +The script, `hermetic_build/release_note_generation/cli/generate_release_note.py` +allows you to generate a file containing release notes from API definition +changes in [googleapis](https://github.com/googleapis/googleapis) GitHub +repository. + +## Environment + +- OS: Linux +- Python (3.12.0 or above) + +## Parameters to generate a release note + +### Baseline generation configuration path (`baseline-generation-config-path`) + +Absolute or relative path to a generation configuration. +Please refer to [Configuration to generate a repository](#configuration-to-generate-a-repository) +for more information. + +Note that the `googleapis_commitish` in this configuration is used to retrieve +the first commit, exclusively, to generate the release notes. + +### Current generation configuration path (`current-generation-config-path`) + +Absolute or relative path to a generation configuration. +The release notes will be generated from commits that are related to the +libraries specified in this configuration. +Please refer to [Configuration to generate a repository](#configuration-to-generate-a-repository) +for more information. + +Note that the `googleapis_commitish` entry in this configuration is used to +retrieve the last commit, inclusively, to generate the release notes. + +### Repository path (`repository-path`), optional + +The path to which the file, `pr_description.txt` containing the release notes +will be sent. +If not specified, the file will be generated to the current working directory. + +## Generate a release notes file in a local environment + +1. Install python (>= 3.12.0). +It is recommended to create a python virtual environment through the +[official guide](https://packaging.python.org/en/latest/guides/installing-using-pip-and-virtual-environments/#create-and-use-virtual-environments). + +2. Run the following commands to install python packages + ```shell + cd /path/to/sdk-platform-java + pip install --require-hashes -r hermetic_build/common/requirements.txt + pip install hermetic_build/common + pip install --require-hashes -r hermetic_build/release_note_generation/requirements.txt + pip install hermetic_build/release_note_generation + ``` +3. Run the following commands to generate a release note + ```shell + cd /path/to/sdk-platform-java + python hermetic_build/release_note_generation/cli/generate_release_note.py generate \ + --baseline-generation-config-path=/path/to/baseline_generation_config \ + --current-generation-config-path=/path/to/current_generation_config \ + --repository-path=/path/to/send/release_note + ``` + +# OwlBot Java Postprocessor + +We have transferred the +[implementation](https://github.com/googleapis/synthtool/tree/59fe44fde9866a26e7ee4e4450fd79f67f8cf599/docker/owlbot/java) +of Java Owlbot Postprocessor into `sdk-platform-java/hermetic_build/library_generation`. + +## Reflecting changes in synthtool/docker/owlbot/java into this repository +The transfer was not a verbatim copy, it rather had modifications: + * `format-source.sh` was replaced by a call to `mvn fmt:format` + * `entrypoint.sh` was modified to have input arguments and slightly modified + the way the helper scripts are called + * Other helper scripts were modified to have input arguments. + * `fix_poms.py` modified the way the monorepo is detected + +All these modifications imply that whenever we want to reflect a change from the +original owlbot in synthtool we may be better off modifying the affected source +files one by one. The mapping is from +[`synthtool/docker/owlbot/java`](https://github.com/googleapis/synthtool/tree/59fe44fde9866a26e7ee4e4450fd79f67f8cf599/docker/owlbot/java) +to +[`sdk-platform-java/library_generation/owlbot`](https://github.com/googleapis/sdk-platform-java/tree/move-java-owlbot/library_generation/owlbot) diff --git a/java-common-protos/.github/snippet-bot.yml b/hermetic_build/common/__init__.py similarity index 100% rename from java-common-protos/.github/snippet-bot.yml rename to hermetic_build/common/__init__.py diff --git a/hermetic_build/common/cli/get_changed_libraries.py b/hermetic_build/common/cli/get_changed_libraries.py new file mode 100644 index 0000000000..0cc8a6cb34 --- /dev/null +++ b/hermetic_build/common/cli/get_changed_libraries.py @@ -0,0 +1,85 @@ +# 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 +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Setup logging +import logging +import sys + +logging.basicConfig(level=logging.DEBUG, stream=sys.stderr) + +import os +import click + +from common.model.generation_config import GenerationConfig +from common.utils.generation_config_comparator import compare_config + + +@click.group(invoke_without_command=False) +@click.pass_context +@click.version_option(message="%(version)s") +def main(ctx): + pass + + +@main.command() +@click.option( + "--baseline-generation-config-path", + required=True, + type=str, + help=""" + Absolute or relative path to a generation_config.yaml. + This config file is used for computing changed library list. + """, +) +@click.option( + "--current-generation-config-path", + required=True, + type=str, + help=""" + Absolute or relative path to a generation_config.yaml that contains the + metadata about library generation. + """, +) +def create( + baseline_generation_config_path: str, + current_generation_config_path: str, +) -> None: + """ + Compares baseline generation config with current generation config and + generates changed library names (a comma separated string) based on current + generation config. + """ + baseline_generation_config_path = os.path.abspath(baseline_generation_config_path) + if not os.path.isfile(baseline_generation_config_path): + raise FileNotFoundError( + f"{baseline_generation_config_path} does not exist. " + "A valid generation config has to be passed in as " + "baseline-generation-config-path." + ) + current_generation_config_path = os.path.abspath(current_generation_config_path) + if not os.path.isfile(current_generation_config_path): + raise FileNotFoundError( + f"{current_generation_config_path} does not exist. " + "A valid generation config has to be passed in as " + "current-generation-config-path." + ) + config_change = compare_config( + baseline_config=GenerationConfig.from_yaml(baseline_generation_config_path), + current_config=GenerationConfig.from_yaml(current_generation_config_path), + ) + click.echo(",".join(config_change.get_changed_libraries())) + + +if __name__ == "__main__": + main() diff --git a/hermetic_build/common/model/config_change.py b/hermetic_build/common/model/config_change.py new file mode 100644 index 0000000000..401d943ff6 --- /dev/null +++ b/hermetic_build/common/model/config_change.py @@ -0,0 +1,199 @@ +# 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 +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT 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 tempfile +from enum import Enum +from typing import Optional +from git import Commit, Repo +from common.model.gapic_inputs import parse_build_str +from common.model.generation_config import GenerationConfig +from common.model.library_config import LibraryConfig +from common.utils.proto_path_utils import find_versioned_proto_path + +INSERTIONS = "insertions" +LINES = "lines" + + +class ChangeType(Enum): + GOOGLEAPIS_COMMIT = 1 + REPO_LEVEL_CHANGE = 2 + LIBRARIES_ADDITION = 3 + # As of Mar. 2024, we decide not to produce this type of change because we + # still need to manually remove the libray. + # LIBRARIES_REMOVAL = 4 + LIBRARY_LEVEL_CHANGE = 5 + GAPIC_ADDITION = 6 + # As of Mar. 2024, we decide not to produce this type of change because we + # still need to manually remove the libray. + # GAPIC_REMOVAL = 7 + + +class HashLibrary: + """ + Data class to group a LibraryConfig object and its hash value together. + """ + + def __init__(self, hash_value: int, library: LibraryConfig): + self.hash_value = hash_value + self.library = library + + +class LibraryChange: + def __init__(self, changed_param: str, current_value: str, library_name: str = ""): + self.changed_param = changed_param + self.current_value = current_value + self.library_name = library_name + + +class QualifiedCommit: + def __init__(self, commit: Commit, libraries: set[str]): + self.commit = commit + self.libraries = libraries + + +class ConfigChange: + + def __init__( + self, + change_to_libraries: dict[ChangeType, list[LibraryChange]], + baseline_config: GenerationConfig, + current_config: GenerationConfig, + ): + self.change_to_libraries = change_to_libraries + self.baseline_config = baseline_config + self.current_config = current_config + + def get_changed_libraries(self) -> list[str]: + """ + Returns a unique, sorted list of library name of changed libraries. + + :return: library names of change libraries. + """ + if ChangeType.REPO_LEVEL_CHANGE in self.change_to_libraries: + return [ + library.get_library_name() for library in self.current_config.libraries + ] + library_names = set() + for change_type, library_changes in self.change_to_libraries.items(): + if change_type == ChangeType.GOOGLEAPIS_COMMIT: + library_names.update(self.__get_library_names_from_qualified_commits()) + else: + library_names.update( + [library_change.library_name for library_change in library_changes] + ) + return sorted(list(library_names)) + + def get_qualified_commits( + self, + repo_url: str = "https://github.com/googleapis/googleapis.git", + ) -> list[QualifiedCommit]: + """ + Returns qualified commits from configuration change. + + A qualified commit is a commit that changes at least one file (excluding + BUILD.bazel) within a versioned proto path in the given proto_paths. + :param repo_url: the repository contains the commit history. + :return: QualifiedCommit objects. + """ + with tempfile.TemporaryDirectory(ignore_cleanup_errors=True) as tmp_dir: + # We include blobs to avoid unexpected missing git objects when computing + # a diff. + # See https://github.com/googleapis/sdk-platform-java/issues/3745 + repo = Repo.clone_from(url=repo_url, to_path=tmp_dir) + commit = repo.commit(self.current_config.googleapis_commitish) + proto_paths = self.current_config.get_proto_path_to_library_name() + qualified_commits = [] + while str(commit.hexsha) != self.baseline_config.googleapis_commitish: + qualified_commit = ConfigChange.__create_qualified_commit( + proto_paths=proto_paths, commit=commit + ) + if qualified_commit is not None: + qualified_commits.append(qualified_commit) + commit_parents = commit.parents + if len(commit_parents) == 0: + break + commit = commit_parents[0] + repo.close() + return qualified_commits + + def __get_library_names_from_qualified_commits(self) -> list[str]: + qualified_commits = self.get_qualified_commits() + library_names = [] + for qualified_commit in qualified_commits: + library_names.extend(qualified_commit.libraries) + return library_names + + @staticmethod + def __create_qualified_commit( + proto_paths: dict[str, str], commit: Commit + ) -> Optional[QualifiedCommit]: + """ + Returns a qualified commit from the given Commit object; otherwise None. + + :param proto_paths: a mapping from versioned proto_path to library_name + :param commit: a GitHub commit object. + :return: qualified commits. + """ + libraries = set() + for file_path, changes in commit.stats.files.items(): + versioned_proto_path = find_versioned_proto_path(file_path) + if versioned_proto_path in proto_paths: + if ( + file_path.endswith("BUILD.bazel") + # Qualify a commit if the commit only added BUILD.bazel + # because it's very unlikely that a commit added BUILD.bazel + # without adding proto files. Therefore, the commit is + # qualified duo to the proto change eventually. + and (not ConfigChange.__is_added(changes)) + and ( + not ConfigChange.__is_qualified_build_change( + commit=commit, build_file_path=file_path + ) + ) + ): + continue + # Even though a commit usually only changes one + # library, we don't want to miss generating a + # library because the commit may change multiple + # libraries. + libraries.add(proto_paths[versioned_proto_path]) + if len(libraries) == 0: + return None + return QualifiedCommit(commit=commit, libraries=libraries) + + @staticmethod + def __is_added(changes: dict[str, int]) -> bool: + return changes[INSERTIONS] == changes[LINES] + + @staticmethod + def __is_qualified_build_change(commit: Commit, build_file_path: str) -> bool: + """ + Checks if the given commit containing a BUILD.bazel change is a + qualified commit. + + The commit is a qualified commit if the + :class:`library_generation.model.gapic_inputs.GapicInputs` objects + parsed from the commit and its parent are different, since there are + changes in fields that used in library generation. + + :param commit: a GitHub commit object. + :param build_file_path: the path of the BUILD.bazel + :return: True if the commit is a qualified commit; False otherwise. + """ + versioned_proto_path = find_versioned_proto_path(build_file_path) + build = str((commit.tree / build_file_path).data_stream.read()) + parent_commit = commit.parents[0] + parent_build = str((parent_commit.tree / build_file_path).data_stream.read()) + inputs = parse_build_str(build, versioned_proto_path) + parent_inputs = parse_build_str(parent_build, versioned_proto_path) + return inputs != parent_inputs diff --git a/hermetic_build/common/model/gapic_config.py b/hermetic_build/common/model/gapic_config.py new file mode 100644 index 0000000000..3bbba39454 --- /dev/null +++ b/hermetic_build/common/model/gapic_config.py @@ -0,0 +1,99 @@ +#!/usr/bin/env python3 +# 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. +import re +from typing import Optional + +ALPHA_VERSION = "alpha" +BETA_VERSION = "beta" + + +class GapicConfig: + """ + Class that represents a GAPICs single entry, inside a `LibraryConfig` in + a generation_config.yaml + """ + + def __init__(self, proto_path: str): + self.proto_path = proto_path + self.version = self.__parse_version() + + def is_stable(self): + return ( + self.version + and (ALPHA_VERSION not in self.version) + and (BETA_VERSION not in self.version) + ) + + def get_version(self): + return self.version + + def __parse_version(self) -> Optional[str]: + version_regex = re.compile(r"^v[1-9]+(p[1-9]+)*(alpha|beta)?.*") + for directory in self.proto_path.split("/"): + if version_regex.search(directory): + return directory + return None + + def __eq__(self, other) -> bool: + if not isinstance(other, GapicConfig): + return False + return self.proto_path == other.proto_path + + def __lt__(self, other) -> bool: + if not isinstance(other, GapicConfig): + raise ValueError( + f"Type {type(other)} can't be comparable " f"with GapicConfig." + ) + + self_version = self.get_version() + other_version = other.get_version() + self_dirs = self.proto_path.split("/") + other_dirs = other.proto_path.split("/") + # Case 1: if both of the configs don't have a version in proto_path, + # the one with lower depth is smaller. + if (not self_version) and (not other_version): + return len(self_dirs) < len(other_dirs) + # Case 2: if only one config has a version in proto_path, it is smaller + # than the other one. + if self_version and (not other_version): + return True + if (not self_version) and other_version: + return False + # Two configs both have a version in proto_path. + self_stable = self.is_stable() + other_stable = other.is_stable() + # Case 3, if only config has a stable version in proto_path, it is + # smaller than the other one. + if self_stable and (not other_stable): + return True + if (not self_stable) and other_stable: + return False + # Case 4, if two configs have a non-stable version in proto_path, + # the one with higher version is smaller. + # Note that using string comparison may lead unexpected result, + # e.g., v1beta10 is smaller than v1beta2. + # In reality, however, there's unlikely that a library has >10 beta + # versions. + if (not self_stable) and (not other_stable): + return self_version > other_version + # Two configs both have a stable version in proto_path. + # Case 5, if two configs have different depth in proto_path, the one + # with lower depth is smaller. + if len(self_dirs) != len(other_dirs): + return len(self_dirs) < len(other_dirs) + # Case 6, the config with higher stable version is smaller. + self_num = int(self_version[1:]) + other_num = int(other_version[1:]) + return self_num > other_num diff --git a/hermetic_build/common/model/gapic_inputs.py b/hermetic_build/common/model/gapic_inputs.py new file mode 100644 index 0000000000..5c07777965 --- /dev/null +++ b/hermetic_build/common/model/gapic_inputs.py @@ -0,0 +1,196 @@ +#!/usr/bin/env python3 +# 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. + +from pathlib import Path +import re + +proto_library_pattern = r""" +proto_library_with_info\( +(.*?) +\) +""" +gapic_pattern = r""" +java_gapic_library\( +(.*?) +\) +""" +assembly_pattern = r""" +java_gapic_assembly_gradle_pkg\( +(.*?) +\) +""" +# match a line which the first character is "#". +comment_pattern = r"^\s*\#+" +pattern_to_proto = { + r"//google/cloud:common_resources_proto": "google/cloud/common_resources.proto", + r"//google/cloud/location:location_proto": "google/cloud/location/locations.proto", + r"//google/iam/v1:iam_policy_proto": "google/iam/v1/iam_policy.proto", +} +transport_pattern = r"transport = \"(.*?)\"" +rest_pattern = r"rest_numeric_enums = True" +gapic_yaml_pattern = r"gapic_yaml = \"(.*?)\"" +service_config_pattern = r"grpc_service_config = \"(.*?)\"" +service_yaml_pattern = r"service_yaml = \"(.*?)\"" +include_samples_pattern = r"include_samples = True" + + +class GapicInputs: + """ + A data class containing inputs to invoke generate_library.sh to generate + a GAPIC library. + """ + + def __init__( + self, + proto_only="true", + additional_protos="google/cloud/common_resources.proto", + transport="grpc", + rest_numeric_enum="", + gapic_yaml="", + service_config="", + service_yaml="", + include_samples="true", + ): + self.proto_only = proto_only + self.additional_protos = additional_protos + self.transport = transport + self.rest_numeric_enum = rest_numeric_enum + self.gapic_yaml = gapic_yaml + self.service_config = service_config + self.service_yaml = service_yaml + self.include_samples = include_samples + + def __eq__(self, other): + if not isinstance(other, GapicInputs): + return False + return ( + self.proto_only == other.proto_only + and self.additional_protos == other.additional_protos + and self.transport == other.transport + and self.rest_numeric_enum == other.rest_numeric_enum + and self.gapic_yaml == other.gapic_yaml + and self.service_config == other.service_config + and self.service_yaml == other.service_yaml + and self.include_samples == other.include_samples + ) + + +def parse( + build_path: Path, versioned_path: str, build_file_name: str = "BUILD.bazel" +) -> GapicInputs: + """ + Utility function to parse inputs of generate_library.sh from BUILD.bazel. + :param build_path: the file path of BUILD.bazel + :param versioned_path: a versioned path in googleapis repository, e.g., + google/cloud/asset/v1. + :param build_file_name: the name of the build file. + :return: an GapicInputs object. + """ + with open(f"{build_path}/{build_file_name}") as build: + content = build.read() + return parse_build_str(build_str=content, versioned_path=versioned_path) + + +def parse_build_str(build_str: str, versioned_path: str) -> GapicInputs: + proto_library_target = re.compile( + proto_library_pattern, re.DOTALL | re.VERBOSE + ).findall(build_str) + additional_protos = "" + if len(proto_library_target) > 0: + additional_protos = __parse_additional_protos(proto_library_target[0]) + gapic_target = re.compile(gapic_pattern, re.DOTALL | re.VERBOSE).findall(build_str) + assembly_target = re.compile(assembly_pattern, re.DOTALL | re.VERBOSE).findall( + build_str + ) + include_samples = "false" + if len(assembly_target) > 0: + include_samples = __parse_include_samples(assembly_target[0]) + if len(gapic_target) == 0: + return GapicInputs( + additional_protos=additional_protos, include_samples=include_samples + ) + + transport = __parse_transport(gapic_target[0]) + rest_numeric_enum = __parse_rest_numeric_enums(gapic_target[0]) + gapic_yaml = __parse_gapic_yaml(gapic_target[0], versioned_path) + service_config = __parse_service_config(gapic_target[0], versioned_path) + service_yaml = __parse_service_yaml(gapic_target[0], versioned_path) + + return GapicInputs( + proto_only="false", + additional_protos=additional_protos, + transport=transport, + rest_numeric_enum=rest_numeric_enum, + gapic_yaml=gapic_yaml, + service_config=service_config, + service_yaml=service_yaml, + include_samples=include_samples, + ) + + +def __parse_additional_protos(proto_library_target: str) -> str: + res = [" "] + lines = proto_library_target.split("\n") + for line in lines: + if len(re.findall(comment_pattern, line)) != 0: + # skip a line which the first charactor is "#" since it's + # a comment. + continue + for pattern in pattern_to_proto: + if len(re.findall(pattern, line)) == 0: + continue + res.append(pattern_to_proto[pattern]) + return " ".join(res) + + +def __parse_transport(gapic_target: str) -> str: + transport = re.findall(transport_pattern, gapic_target) + return transport[0] if len(transport) != 0 else "grpc" + + +def __parse_rest_numeric_enums(gapic_target: str) -> str: + rest_numeric_enums = re.findall(rest_pattern, gapic_target) + return "true" if len(rest_numeric_enums) != 0 else "false" + + +def __parse_gapic_yaml(gapic_target: str, versioned_path: str) -> str: + gapic_yaml = re.findall(gapic_yaml_pattern, gapic_target) + return f"{versioned_path}/{gapic_yaml[0]}" if len(gapic_yaml) != 0 else "" + + +def __parse_service_config(gapic_target: str, versioned_path: str) -> str: + service_config = re.findall(service_config_pattern, gapic_target) + return ( + f"{versioned_path}/{service_config[0]}".replace(":", "") + if len(service_config) != 0 + else "" + ) + + +def __parse_service_yaml(gapic_target: str, versioned_path: str) -> str: + service_yaml = re.findall(service_yaml_pattern, gapic_target) + if len(service_yaml) == 0: + return "" + res = str(service_yaml[0]) + if res.startswith("//"): + # special case if the service config starts with "//", is a Bazel + # target with an absolute path. + return res.replace("//", "").replace(":", "/") + return f"{versioned_path}/{res}" + + +def __parse_include_samples(assembly_target: str) -> str: + include_samples = re.findall(include_samples_pattern, assembly_target) + return "true" if len(include_samples) != 0 else "false" diff --git a/hermetic_build/common/model/generation_config.py b/hermetic_build/common/model/generation_config.py new file mode 100644 index 0000000000..fabbde41cc --- /dev/null +++ b/hermetic_build/common/model/generation_config.py @@ -0,0 +1,192 @@ +#!/usr/bin/env python3 +# 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. +import os + +import yaml +from typing import Optional +from common.model.library_config import LibraryConfig +from common.model.gapic_config import GapicConfig + +REPO_LEVEL_PARAMETER = "Repo level parameter" +LIBRARY_LEVEL_PARAMETER = "Library level parameter" +GAPIC_LEVEL_PARAMETER = "GAPIC level parameter" +COMMON_PROTOS_LIBRARY_NAME = "common-protos" +GAPIC_GENERATOR_VERSION = "gapic_generator_version" +LIBRARIES_BOM_VERSION = "libraries_bom_version" +GENERATOR_VERSION_ENV_KEY = "GENERATOR_VERSION" + + +class GenerationConfig: + """ + Class that represents the root of a generation_config.yaml + """ + + def __init__( + self, + googleapis_commitish: str, + libraries: list[LibraryConfig], + gapic_generator_version: Optional[str] = None, + libraries_bom_version: Optional[str] = None, + ): + self.googleapis_commitish = googleapis_commitish + self.libraries_bom_version = ( + libraries_bom_version if libraries_bom_version else "" + ) + self.gapic_generator_version = GenerationConfig.__set_generator_version( + gapic_generator_version + ) + self.libraries = libraries + # explicit set to None so that we can compute the + # value in getter. + self.__contains_common_protos = None + self.__validate() + + def get_proto_path_to_library_name(self) -> dict[str, str]: + """ + Get versioned proto_path to library_name mapping from configuration. + + :return: versioned proto_path to library_name mapping + """ + paths = {} + for library in self.libraries: + for gapic_config in library.gapic_configs: + paths[gapic_config.proto_path] = library.get_library_name() + return paths + + def is_monorepo(self) -> bool: + return len(self.libraries) > 1 + + def contains_common_protos(self) -> bool: + if self.__contains_common_protos is None: + self.__contains_common_protos = False + for library in self.libraries: + if library.get_library_name() == COMMON_PROTOS_LIBRARY_NAME: + self.__contains_common_protos = True + break + return self.__contains_common_protos + + @staticmethod + def __set_generator_version(gapic_generator_version: Optional[str]) -> str: + if gapic_generator_version is not None: + return gapic_generator_version + # if the generator version is not set through generation config, + # get it from environment variable. + gapic_generator_version = os.getenv(GENERATOR_VERSION_ENV_KEY) + if not gapic_generator_version: + raise ValueError( + f"Environment variable {GENERATOR_VERSION_ENV_KEY}" + f" is not set when the generator version is not" + f" specified in the generation config." + ) + return gapic_generator_version + + def __validate(self) -> None: + seen_library_names = dict() + for library in self.libraries: + library_name = library.get_library_name() + if library_name in seen_library_names: + raise ValueError( + f"Both {library.name_pretty} and " + f"{seen_library_names.get(library_name)} have the same " + f"library name: {library_name}, please update one of the " + f"library to have a different library name." + ) + seen_library_names[library_name] = library.name_pretty + + @staticmethod + def from_yaml(path_to_yaml: str) -> "GenerationConfig": + """ + Parses a yaml located in path_to_yaml. + :param path_to_yaml: the path to the configuration file + :return the parsed configuration represented by the "model" classes + """ + with open(path_to_yaml, "r") as file_stream: + config = yaml.safe_load(file_stream) + + libraries = _required(config, "libraries", REPO_LEVEL_PARAMETER) + if not libraries: + raise ValueError(f"Library is None in {path_to_yaml}.") + + parsed_libraries = list() + for library in libraries: + gapics = _required(library, "GAPICs") + + parsed_gapics = list() + if not gapics: + raise ValueError(f"GAPICs is None in {library}.") + for gapic in gapics: + proto_path = _required(gapic, "proto_path", GAPIC_LEVEL_PARAMETER) + new_gapic = GapicConfig(proto_path) + parsed_gapics.append(new_gapic) + + new_library = LibraryConfig( + api_shortname=_required(library, "api_shortname"), + api_description=_required(library, "api_description"), + name_pretty=_required(library, "name_pretty"), + product_documentation=_required(library, "product_documentation"), + gapic_configs=parsed_gapics, + library_type=_optional(library, "library_type", "GAPIC_AUTO"), + release_level=_optional(library, "release_level", "preview"), + api_id=_optional(library, "api_id", None), + api_reference=_optional(library, "api_reference", None), + codeowner_team=_optional(library, "codeowner_team", None), + excluded_poms=_optional(library, "excluded_poms", None), + excluded_dependencies=_optional(library, "excluded_dependencies", None), + client_documentation=_optional(library, "client_documentation", None), + distribution_name=_optional(library, "distribution_name", None), + googleapis_commitish=_optional(library, "googleapis_commitish", None), + group_id=_optional(library, "group_id", "com.google.cloud"), + issue_tracker=_optional(library, "issue_tracker", None), + library_name=_optional(library, "library_name", None), + rest_documentation=_optional(library, "rest_documentation", None), + rpc_documentation=_optional(library, "rpc_documentation", None), + cloud_api=_optional(library, "cloud_api", True), + requires_billing=_optional(library, "requires_billing", True), + extra_versioned_modules=_optional( + library, "extra_versioned_modules", None + ), + recommended_package=_optional(library, "recommended_package", None), + min_java_version=_optional(library, "min_java_version", None), + transport=_optional(library, "transport", None), + ) + parsed_libraries.append(new_library) + + parsed_config = GenerationConfig( + googleapis_commitish=_required( + config, "googleapis_commitish", REPO_LEVEL_PARAMETER + ), + gapic_generator_version=_optional(config, GAPIC_GENERATOR_VERSION, None), + libraries_bom_version=_optional(config, LIBRARIES_BOM_VERSION, None), + libraries=parsed_libraries, + ) + + return parsed_config + + +def _required(config: dict, key: str, level: str = LIBRARY_LEVEL_PARAMETER): + if key not in config: + message = ( + f"{level}, {key}, is not found in {config} in yaml." + if level != REPO_LEVEL_PARAMETER + else f"{level}, {key}, is not found in yaml." + ) + raise ValueError(message) + return config[key] + + +def _optional(config: dict, key: str, default: any): + if key not in config: + return default + return config[key] diff --git a/hermetic_build/common/model/library_config.py b/hermetic_build/common/model/library_config.py new file mode 100644 index 0000000000..dde5c24feb --- /dev/null +++ b/hermetic_build/common/model/library_config.py @@ -0,0 +1,211 @@ +#!/usr/bin/env python3 +# 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. +from hashlib import sha256 +from typing import Optional +from common.model.gapic_config import GapicConfig +from common.model.gapic_inputs import GapicInputs + +MAVEN_COORDINATE_SEPARATOR = ":" + + +class LibraryConfig: + """ + Class that represents a library in a generation_config.yaml file + """ + + def __init__( + self, + api_shortname: str, + api_description: str, + name_pretty: str, + product_documentation: str, + gapic_configs: list[GapicConfig], + library_type: Optional[str] = None, + release_level: Optional[str] = None, + api_id: Optional[str] = None, + api_reference: Optional[str] = None, + codeowner_team: Optional[str] = None, + client_documentation: Optional[str] = None, + distribution_name: Optional[str] = None, + excluded_dependencies: Optional[str] = None, + excluded_poms: Optional[str] = None, + googleapis_commitish: Optional[str] = None, + group_id: Optional[str] = "com.google.cloud", + issue_tracker: Optional[str] = None, + library_name: Optional[str] = None, + rest_documentation: Optional[str] = None, + rpc_documentation: Optional[str] = None, + cloud_api: Optional[bool] = True, + requires_billing: Optional[bool] = True, + extra_versioned_modules: Optional[str] = None, + recommended_package: Optional[str] = None, + min_java_version: Optional[int] = None, + transport: Optional[str] = None, + ): + self.api_shortname = api_shortname + self.api_description = api_description + self.name_pretty = name_pretty + self.product_documentation = product_documentation + self.gapic_configs = gapic_configs + self.library_type = library_type if library_type else "GAPIC_AUTO" + self.release_level = release_level if release_level else "preview" + self.api_id = api_id + self.api_reference = api_reference + self.codeowner_team = codeowner_team + self.excluded_dependencies = excluded_dependencies + self.excluded_poms = excluded_poms + self.client_documentation = client_documentation + self.googleapis_commitish = googleapis_commitish + self.group_id = group_id + self.issue_tracker = issue_tracker + self.library_name = library_name + self.rest_documentation = rest_documentation + self.rpc_documentation = rpc_documentation + self.cloud_api = cloud_api + self.requires_billing = requires_billing + self.extra_versioned_modules = extra_versioned_modules + self.recommended_package = recommended_package + self.min_java_version = min_java_version + self.distribution_name = self.__get_distribution_name(distribution_name) + self.transport = self.__validate_transport(transport) + + def set_gapic_configs(self, gapic_configs: list[GapicConfig]) -> None: + """ + Sets the gapic_configs for the library. + + Args: + gapic_configs: The new list of GapicConfig objects. + """ + self.gapic_configs = gapic_configs + + def get_library_name(self) -> str: + """ + Return the library name of a given LibraryConfig object + :return: the library name + """ + return self.library_name if self.library_name else self.api_shortname + + def get_sorted_gapic_configs(self) -> list[GapicConfig]: + return sorted(self.gapic_configs) + + def get_maven_coordinate(self) -> str: + """ + Returns the Maven coordinate (group_id:artifact_id) of the library + """ + return self.distribution_name + + def get_artifact_id(self) -> str: + """ + Returns the artifact ID of the library + """ + return self.get_maven_coordinate().split(MAVEN_COORDINATE_SEPARATOR)[-1] + + def get_transport(self, gapic_inputs: GapicInputs) -> str: + """ + Returns the transport of the library. If directly set in library config, return it. + Otherwise, return the transport inferred from gapic_inputs. This value is only + used for postprocessing - the generation still infers the transport from BUILD + files. + """ + return self.transport if self.transport is not None else gapic_inputs.transport + + def __get_distribution_name(self, distribution_name: Optional[str]) -> str: + LibraryConfig.__check_distribution_name(distribution_name) + if distribution_name: + return distribution_name + cloud_prefix = "cloud-" if self.cloud_api else "" + library_name = self.get_library_name() + return f"{self.group_id}:google-{cloud_prefix}{library_name}" + + def __validate_transport(self, transport: str): + if transport not in [None, "grpc", "rest", "both"]: + raise ValueError( + "allowed values for library.transport: grpc, rest, both and None" + ) + return transport + + @staticmethod + def __check_distribution_name(distribution_name: str) -> None: + if not distribution_name: + return + sections = distribution_name.split(MAVEN_COORDINATE_SEPARATOR) + if len(sections) != 2: + raise ValueError(f"{distribution_name} is not a valid distribution name.") + + def __eq__(self, other): + return ( + self.api_shortname == other.api_shortname + and self.api_description == other.api_description + and self.name_pretty == other.name_pretty + and self.product_documentation == other.product_documentation + and self.gapic_configs == other.gapic_configs + and self.library_type == other.library_type + and self.release_level == other.release_level + and self.api_id == other.api_id + and self.api_reference == other.api_reference + and self.codeowner_team == other.codeowner_team + and self.excluded_dependencies == other.excluded_dependencies + and self.excluded_poms == other.excluded_poms + and self.client_documentation == other.client_documentation + and self.distribution_name == other.distribution_name + and self.googleapis_commitish == other.googleapis_commitish + and self.group_id == other.group_id + and self.issue_tracker == other.issue_tracker + and self.library_name == other.library_name + and self.rest_documentation == other.rest_documentation + and self.rpc_documentation == other.rpc_documentation + and self.cloud_api == other.cloud_api + and self.requires_billing == other.requires_billing + and self.extra_versioned_modules == other.extra_versioned_modules + and self.recommended_package == other.recommended_package + and self.min_java_version == other.min_java_version + and self.transport == other.transport + ) + + def __hash__(self): + m = sha256() + m.update( + str( + [ + self.api_shortname, + self.api_description, + self.name_pretty, + self.product_documentation, + self.library_type, + self.release_level, + self.api_id, + self.api_reference, + self.codeowner_team, + self.excluded_dependencies, + self.excluded_poms, + self.client_documentation, + self.distribution_name, + self.googleapis_commitish, + self.group_id, + self.issue_tracker, + self.library_name, + self.rest_documentation, + self.rpc_documentation, + self.cloud_api, + self.requires_billing, + self.extra_versioned_modules, + self.recommended_package, + self.min_java_version, + self.transport, + ] + + [config.proto_path for config in self.gapic_configs] + ).encode("utf-8") + ) + return int(m.hexdigest(), 16) diff --git a/hermetic_build/common/requirements.in b/hermetic_build/common/requirements.in new file mode 100644 index 0000000000..395bee76c6 --- /dev/null +++ b/hermetic_build/common/requirements.in @@ -0,0 +1,4 @@ +black==26.3.1 +GitPython==3.1.43 +parameterized==0.9.0 +PyYAML==6.0.2 \ No newline at end of file diff --git a/hermetic_build/common/requirements.txt b/hermetic_build/common/requirements.txt new file mode 100644 index 0000000000..6e779a0314 --- /dev/null +++ b/hermetic_build/common/requirements.txt @@ -0,0 +1,170 @@ +# +# This file is autogenerated by pip-compile with Python 3.12 +# by the following command: +# +# pip-compile --generate-hashes hermetic_build/common/requirements.in +# +black==26.3.1 \ + --hash=sha256:0126ae5b7c09957da2bdbd91a9ba1207453feada9e9fe51992848658c6c8e01c \ + --hash=sha256:0f76ff19ec5297dd8e66eb64deda23631e642c9393ab592826fd4bdc97a4bce7 \ + --hash=sha256:28ef38aee69e4b12fda8dba75e21f9b4f979b490c8ac0baa7cb505369ac9e1ff \ + --hash=sha256:2bd5aa94fc267d38bb21a70d7410a89f1a1d318841855f698746f8e7f51acd1b \ + --hash=sha256:2c50f5063a9641c7eed7795014ba37b0f5fa227f3d408b968936e24bc0566b07 \ + --hash=sha256:2d6bfaf7fd0993b420bed691f20f9492d53ce9a2bcccea4b797d34e947318a78 \ + --hash=sha256:41cd2012d35b47d589cb8a16faf8a32ef7a336f56356babd9fcf70939ad1897f \ + --hash=sha256:474c27574d6d7037c1bc875a81d9be0a9a4f9ee95e62800dab3cfaadbf75acd5 \ + --hash=sha256:5602bdb96d52d2d0672f24f6ffe5218795736dd34807fd0fd55ccd6bf206168b \ + --hash=sha256:5e9d0d86df21f2e1677cc4bd090cd0e446278bcbbe49bf3659c308c3e402843e \ + --hash=sha256:5ed0ca58586c8d9a487352a96b15272b7fa55d139fc8496b519e78023a8dab0a \ + --hash=sha256:6c54a4a82e291a1fee5137371ab488866b7c86a3305af4026bdd4dc78642e1ac \ + --hash=sha256:6e131579c243c98f35bce64a7e08e87fb2d610544754675d4a0e73a070a5aa3a \ + --hash=sha256:855822d90f884905362f602880ed8b5df1b7e3ee7d0db2502d4388a954cc8c54 \ + --hash=sha256:86a8b5035fce64f5dcd1b794cf8ec4d31fe458cf6ce3986a30deb434df82a1d2 \ + --hash=sha256:8a33d657f3276328ce00e4d37fe70361e1ec7614da5d7b6e78de5426cb56332f \ + --hash=sha256:92c0ec1f2cc149551a2b7b47efc32c866406b6891b0ee4625e95967c8f4acfb1 \ + --hash=sha256:9a5e9f45e5d5e1c5b5c29b3bd4265dcc90e8b92cf4534520896ed77f791f4da5 \ + --hash=sha256:afc622538b430aa4c8c853f7f63bc582b3b8030fd8c80b70fb5fa5b834e575c2 \ + --hash=sha256:b07fc0dab849d24a80a29cfab8d8a19187d1c4685d8a5e6385a5ce323c1f015f \ + --hash=sha256:b5e6f89631eb88a7302d416594a32faeee9fb8fb848290da9d0a5f2903519fc1 \ + --hash=sha256:bf9bf162ed91a26f1adba8efda0b573bc6924ec1408a52cc6f82cb73ec2b142c \ + --hash=sha256:c7e72339f841b5a237ff14f7d3880ddd0fc7f98a1199e8c4327f9a4f478c1839 \ + --hash=sha256:ddb113db38838eb9f043623ba274cfaf7d51d5b0c22ecb30afe58b1bb8322983 \ + --hash=sha256:dfdd51fc3e64ea4f35873d1b3fb25326773d55d2329ff8449139ebaad7357efb \ + --hash=sha256:f1cd08e99d2f9317292a311dfe578fd2a24b15dbce97792f9c4d752275c1fa56 \ + --hash=sha256:f89f2ab047c76a9c03f78d0d66ca519e389519902fa27e7a91117ef7611c0568 + # via -r requirements.in +click==8.1.7 \ + --hash=sha256:ae74fb96c20a0277a1d615f1e4d73c8414f5a98db8b799a7931d1582f3390c28 \ + --hash=sha256:ca9853ad459e787e2192211578cc907e7594e294c7ccc834310722b41b9ca6de + # via black +gitdb==4.0.11 \ + --hash=sha256:81a3407ddd2ee8df444cbacea00e2d038e40150acfa3001696fe0dcf1d3adfa4 \ + --hash=sha256:bf5421126136d6d0af55bc1e7c1af1c397a34f5b7bd79e776cd3e89785c2b04b + # via gitpython +gitpython==3.1.43 \ + --hash=sha256:35f314a9f878467f5453cc1fee295c3e18e52f1b99f10f6cf5b1682e968a9e7c \ + --hash=sha256:eec7ec56b92aad751f9912a73404bc02ba212a23adb2c7098ee668417051a1ff + # via -r requirements.in +mypy-extensions==1.0.0 \ + --hash=sha256:4392f6c0eb8a5668a69e23d168ffa70f0be9ccfd32b5cc2d26a34ae5b844552d \ + --hash=sha256:75dbf8955dc00442a438fc4d0666508a9a97b6bd41aa2f0ffe9d2f2725af0782 + # via black +packaging==24.2 \ + --hash=sha256:09abb1bccd265c01f4a3aa3f7a7db064b36514d2cba19a2f694fe6150451a759 \ + --hash=sha256:c228a6dc5e932d346bc5739379109d49e8853dd8223571c7c5b55260edc0b97f + # via black +parameterized==0.9.0 \ + --hash=sha256:4e0758e3d41bea3bbd05ec14fc2c24736723f243b28d702081aef438c9372b1b \ + --hash=sha256:7fc905272cefa4f364c1a3429cbbe9c0f98b793988efb5bf90aac80f08db09b1 + # via -r requirements.in +pathspec==1.0.4 \ + --hash=sha256:0210e2ae8a21a9137c0d470578cb0e595af87edaa6ebf12ff176f14a02e0e645 \ + --hash=sha256:fb6ae2fd4e7c921a165808a552060e722767cfa526f99ca5156ed2ce45a5c723 + # via black +platformdirs==4.3.6 \ + --hash=sha256:357fb2acbc885b0419afd3ce3ed34564c13c9b95c89360cd9563f73aa5e2b907 \ + --hash=sha256:73e575e1408ab8103900836b97580d5307456908a03e92031bab39e4554cc3fb + # via black +pytokens==0.4.1 \ + --hash=sha256:0fc71786e629cef478cbf29d7ea1923299181d0699dbe7c3c0f4a583811d9fc1 \ + --hash=sha256:11edda0942da80ff58c4408407616a310adecae1ddd22eef8c692fe266fa5009 \ + --hash=sha256:140709331e846b728475786df8aeb27d24f48cbcf7bcd449f8de75cae7a45083 \ + --hash=sha256:24afde1f53d95348b5a0eb19488661147285ca4dd7ed752bbc3e1c6242a304d1 \ + --hash=sha256:26cef14744a8385f35d0e095dc8b3a7583f6c953c2e3d269c7f82484bf5ad2de \ + --hash=sha256:27b83ad28825978742beef057bfe406ad6ed524b2d28c252c5de7b4a6dd48fa2 \ + --hash=sha256:292052fe80923aae2260c073f822ceba21f3872ced9a68bb7953b348e561179a \ + --hash=sha256:29d1d8fb1030af4d231789959f21821ab6325e463f0503a61d204343c9b355d1 \ + --hash=sha256:2a44ed93ea23415c54f3face3b65ef2b844d96aeb3455b8a69b3df6beab6acc5 \ + --hash=sha256:30f51edd9bb7f85c748979384165601d028b84f7bd13fe14d3e065304093916a \ + --hash=sha256:34bcc734bd2f2d5fe3b34e7b3c0116bfb2397f2d9666139988e7a3eb5f7400e3 \ + --hash=sha256:3ad72b851e781478366288743198101e5eb34a414f1d5627cdd585ca3b25f1db \ + --hash=sha256:3f901fe783e06e48e8cbdc82d631fca8f118333798193e026a50ce1b3757ea68 \ + --hash=sha256:42f144f3aafa5d92bad964d471a581651e28b24434d184871bd02e3a0d956037 \ + --hash=sha256:4a14d5f5fc78ce85e426aa159489e2d5961acf0e47575e08f35584009178e321 \ + --hash=sha256:4a58d057208cb9075c144950d789511220b07636dd2e4708d5645d24de666bdc \ + --hash=sha256:4e691d7f5186bd2842c14813f79f8884bb03f5995f0575272009982c5ac6c0f7 \ + --hash=sha256:5502408cab1cb18e128570f8d598981c68a50d0cbd7c61312a90507cd3a1276f \ + --hash=sha256:584c80c24b078eec1e227079d56dc22ff755e0ba8654d8383b2c549107528918 \ + --hash=sha256:5ad948d085ed6c16413eb5fec6b3e02fa00dc29a2534f088d3302c47eb59adf9 \ + --hash=sha256:670d286910b531c7b7e3c0b453fd8156f250adb140146d234a82219459b9640c \ + --hash=sha256:682fa37ff4d8e95f7df6fe6fe6a431e8ed8e788023c6bcc0f0880a12eab80ad1 \ + --hash=sha256:6d6c4268598f762bc8e91f5dbf2ab2f61f7b95bdc07953b602db879b3c8c18e1 \ + --hash=sha256:79fc6b8699564e1f9b521582c35435f1bd32dd06822322ec44afdeba666d8cb3 \ + --hash=sha256:8bdb9d0ce90cbf99c525e75a2fa415144fd570a1ba987380190e8b786bc6ef9b \ + --hash=sha256:8fcb9ba3709ff77e77f1c7022ff11d13553f3c30299a9fe246a166903e9091eb \ + --hash=sha256:941d4343bf27b605e9213b26bfa1c4bf197c9c599a9627eb7305b0defcfe40c1 \ + --hash=sha256:967cf6e3fd4adf7de8fc73cd3043754ae79c36475c1c11d514fc72cf5490094a \ + --hash=sha256:970b08dd6b86058b6dc07efe9e98414f5102974716232d10f32ff39701e841c4 \ + --hash=sha256:97f50fd18543be72da51dd505e2ed20d2228c74e0464e4262e4899797803d7fa \ + --hash=sha256:9bd7d7f544d362576be74f9d5901a22f317efc20046efe2034dced238cbbfe78 \ + --hash=sha256:add8bf86b71a5d9fb5b89f023a80b791e04fba57960aa790cc6125f7f1d39dfe \ + --hash=sha256:b35d7e5ad269804f6697727702da3c517bb8a5228afa450ab0fa787732055fc9 \ + --hash=sha256:b49750419d300e2b5a3813cf229d4e5a4c728dae470bcc89867a9ad6f25a722d \ + --hash=sha256:d31b97b3de0f61571a124a00ffe9a81fb9939146c122c11060725bd5aea79975 \ + --hash=sha256:d70e77c55ae8380c91c0c18dea05951482e263982911fc7410b1ffd1dadd3440 \ + --hash=sha256:d9907d61f15bf7261d7e775bd5d7ee4d2930e04424bab1972591918497623a16 \ + --hash=sha256:da5baeaf7116dced9c6bb76dc31ba04a2dc3695f3d9f74741d7910122b456edc \ + --hash=sha256:dc74c035f9bfca0255c1af77ddd2d6ae8419012805453e4b0e7513e17904545d \ + --hash=sha256:dcafc12c30dbaf1e2af0490978352e0c4041a7cde31f4f81435c2a5e8b9cabb6 \ + --hash=sha256:ee44d0f85b803321710f9239f335aafe16553b39106384cef8e6de40cb4ef2f6 \ + --hash=sha256:f66a6bbe741bd431f6d741e617e0f39ec7257ca1f89089593479347cc4d13324 + # via black +pyyaml==6.0.2 \ + --hash=sha256:01179a4a8559ab5de078078f37e5c1a30d76bb88519906844fd7bdea1b7729ff \ + --hash=sha256:0833f8694549e586547b576dcfaba4a6b55b9e96098b36cdc7ebefe667dfed48 \ + --hash=sha256:0a9a2848a5b7feac301353437eb7d5957887edbf81d56e903999a75a3d743086 \ + --hash=sha256:0b69e4ce7a131fe56b7e4d770c67429700908fc0752af059838b1cfb41960e4e \ + --hash=sha256:0ffe8360bab4910ef1b9e87fb812d8bc0a308b0d0eef8c8f44e0254ab3b07133 \ + --hash=sha256:11d8f3dd2b9c1207dcaf2ee0bbbfd5991f571186ec9cc78427ba5bd32afae4b5 \ + --hash=sha256:17e311b6c678207928d649faa7cb0d7b4c26a0ba73d41e99c4fff6b6c3276484 \ + --hash=sha256:1e2120ef853f59c7419231f3bf4e7021f1b936f6ebd222406c3b60212205d2ee \ + --hash=sha256:1f71ea527786de97d1a0cc0eacd1defc0985dcf6b3f17bb77dcfc8c34bec4dc5 \ + --hash=sha256:23502f431948090f597378482b4812b0caae32c22213aecf3b55325e049a6c68 \ + --hash=sha256:24471b829b3bf607e04e88d79542a9d48bb037c2267d7927a874e6c205ca7e9a \ + --hash=sha256:29717114e51c84ddfba879543fb232a6ed60086602313ca38cce623c1d62cfbf \ + --hash=sha256:2e99c6826ffa974fe6e27cdb5ed0021786b03fc98e5ee3c5bfe1fd5015f42b99 \ + --hash=sha256:39693e1f8320ae4f43943590b49779ffb98acb81f788220ea932a6b6c51004d8 \ + --hash=sha256:3ad2a3decf9aaba3d29c8f537ac4b243e36bef957511b4766cb0057d32b0be85 \ + --hash=sha256:3b1fdb9dc17f5a7677423d508ab4f243a726dea51fa5e70992e59a7411c89d19 \ + --hash=sha256:41e4e3953a79407c794916fa277a82531dd93aad34e29c2a514c2c0c5fe971cc \ + --hash=sha256:43fa96a3ca0d6b1812e01ced1044a003533c47f6ee8aca31724f78e93ccc089a \ + --hash=sha256:50187695423ffe49e2deacb8cd10510bc361faac997de9efef88badc3bb9e2d1 \ + --hash=sha256:5ac9328ec4831237bec75defaf839f7d4564be1e6b25ac710bd1a96321cc8317 \ + --hash=sha256:5d225db5a45f21e78dd9358e58a98702a0302f2659a3c6cd320564b75b86f47c \ + --hash=sha256:6395c297d42274772abc367baaa79683958044e5d3835486c16da75d2a694631 \ + --hash=sha256:688ba32a1cffef67fd2e9398a2efebaea461578b0923624778664cc1c914db5d \ + --hash=sha256:68ccc6023a3400877818152ad9a1033e3db8625d899c72eacb5a668902e4d652 \ + --hash=sha256:70b189594dbe54f75ab3a1acec5f1e3faa7e8cf2f1e08d9b561cb41b845f69d5 \ + --hash=sha256:797b4f722ffa07cc8d62053e4cff1486fa6dc094105d13fea7b1de7d8bf71c9e \ + --hash=sha256:7c36280e6fb8385e520936c3cb3b8042851904eba0e58d277dca80a5cfed590b \ + --hash=sha256:7e7401d0de89a9a855c839bc697c079a4af81cf878373abd7dc625847d25cbd8 \ + --hash=sha256:80bab7bfc629882493af4aa31a4cfa43a4c57c83813253626916b8c7ada83476 \ + --hash=sha256:82d09873e40955485746739bcb8b4586983670466c23382c19cffecbf1fd8706 \ + --hash=sha256:8388ee1976c416731879ac16da0aff3f63b286ffdd57cdeb95f3f2e085687563 \ + --hash=sha256:8824b5a04a04a047e72eea5cec3bc266db09e35de6bdfe34c9436ac5ee27d237 \ + --hash=sha256:8b9c7197f7cb2738065c481a0461e50ad02f18c78cd75775628afb4d7137fb3b \ + --hash=sha256:9056c1ecd25795207ad294bcf39f2db3d845767be0ea6e6a34d856f006006083 \ + --hash=sha256:936d68689298c36b53b29f23c6dbb74de12b4ac12ca6cfe0e047bedceea56180 \ + --hash=sha256:9b22676e8097e9e22e36d6b7bda33190d0d400f345f23d4065d48f4ca7ae0425 \ + --hash=sha256:a4d3091415f010369ae4ed1fc6b79def9416358877534caf6a0fdd2146c87a3e \ + --hash=sha256:a8786accb172bd8afb8be14490a16625cbc387036876ab6ba70912730faf8e1f \ + --hash=sha256:a9f8c2e67970f13b16084e04f134610fd1d374bf477b17ec1599185cf611d725 \ + --hash=sha256:bc2fa7c6b47d6bc618dd7fb02ef6fdedb1090ec036abab80d4681424b84c1183 \ + --hash=sha256:c70c95198c015b85feafc136515252a261a84561b7b1d51e3384e0655ddf25ab \ + --hash=sha256:cc1c1159b3d456576af7a3e4d1ba7e6924cb39de8f67111c735f6fc832082774 \ + --hash=sha256:ce826d6ef20b1bc864f0a68340c8b3287705cae2f8b4b1d932177dcc76721725 \ + --hash=sha256:d584d9ec91ad65861cc08d42e834324ef890a082e591037abe114850ff7bbc3e \ + --hash=sha256:d7fded462629cfa4b685c5416b949ebad6cec74af5e2d42905d41e257e0869f5 \ + --hash=sha256:d84a1718ee396f54f3a086ea0a66d8e552b2ab2017ef8b420e92edbc841c352d \ + --hash=sha256:d8e03406cac8513435335dbab54c0d385e4a49e4945d2909a581c83647ca0290 \ + --hash=sha256:e10ce637b18caea04431ce14fabcf5c64a1c61ec9c56b071a4b7ca131ca52d44 \ + --hash=sha256:ec031d5d2feb36d1d1a24380e4db6d43695f3748343d99434e6f5f9156aaa2ed \ + --hash=sha256:ef6107725bd54b262d6dedcc2af448a266975032bc85ef0172c5f059da6325b4 \ + --hash=sha256:efdca5630322a10774e8e98e1af481aad470dd62c3170801852d752aa7a783ba \ + --hash=sha256:f753120cb8181e736c57ef7636e83f31b9c0d1722c516f7e86cf15b7aa57ff12 \ + --hash=sha256:ff3824dc5261f50c9b0dfb3be22b4567a6f938ccce4587b38952d85fd9e9afe4 + # via -r requirements.in +smmap==5.0.2 \ + --hash=sha256:26ea65a03958fa0c8a1c7e8c7a58fdc77221b8910f6be2131affade476898ad5 \ + --hash=sha256:b30115f0def7d7531d22a0fb6502488d879e75b260a9db4d0819cfb25403af5e + # via gitdb diff --git a/hermetic_build/common/setup.py b/hermetic_build/common/setup.py new file mode 100755 index 0000000000..8c3c663ada --- /dev/null +++ b/hermetic_build/common/setup.py @@ -0,0 +1,14 @@ +""" +Package information of library_generation python scripts +""" + +from setuptools import setup + +setup( + name="common", + version="0.1", + python_requires=">=3.12", + package_dir={ + "common": ".", + }, +) diff --git a/java-iam/.github/snippet-bot.yml b/hermetic_build/common/tests/__init__.py similarity index 100% rename from java-iam/.github/snippet-bot.yml rename to hermetic_build/common/tests/__init__.py diff --git a/hermetic_build/common/tests/cli/__init__.py b/hermetic_build/common/tests/cli/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/hermetic_build/common/tests/cli/config_change_unit_tests.py b/hermetic_build/common/tests/cli/config_change_unit_tests.py new file mode 100644 index 0000000000..e3bdd753de --- /dev/null +++ b/hermetic_build/common/tests/cli/config_change_unit_tests.py @@ -0,0 +1,71 @@ +# 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 +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT 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 +from click.testing import CliRunner +import unittest + +from common.cli.get_changed_libraries import create + +script_dir = os.path.dirname(os.path.realpath(__file__)) +test_resource_dir = os.path.join(script_dir, "..", "resources", "cli") + + +class GetChangedLibrariesTest(unittest.TestCase): + def test_entry_point_without_baseline_config_raise_system_exception(self): + os.chdir(script_dir) + runner = CliRunner() + # noinspection PyTypeChecker + result = runner.invoke(create) + self.assertEqual(2, result.exit_code) + self.assertEqual(SystemExit, result.exc_info[0]) + + def test_entry_point_without_current_config_raise_system_exception(self): + os.chdir(script_dir) + runner = CliRunner() + # noinspection PyTypeChecker + result = runner.invoke( + create, ["--baseline-generation-config-path=/invalid/path/file"] + ) + self.assertEqual(2, result.exit_code) + self.assertEqual(SystemExit, result.exc_info[0]) + + def test_entry_point_with_invalid_baseline_config_raise_file_exception(self): + os.chdir(script_dir) + runner = CliRunner() + # noinspection PyTypeChecker + result = runner.invoke( + create, + [ + "--baseline-generation-config-path=/invalid/path/file", + "--current-generation-config-path=/invalid/path/file", + ], + ) + self.assertEqual(1, result.exit_code) + self.assertEqual(FileNotFoundError, result.exc_info[0]) + self.assertRegex(result.exception.args[0], "baseline-generation-config-path") + + def test_entry_point_with_invalid_current_config_raise_file_exception(self): + os.chdir(script_dir) + runner = CliRunner() + # noinspection PyTypeChecker + result = runner.invoke( + create, + [ + f"--baseline-generation-config-path={test_resource_dir}/empty_config.yaml", + "--current-generation-config-path=/invalid/path/file", + ], + ) + self.assertEqual(1, result.exit_code) + self.assertEqual(FileNotFoundError, result.exc_info[0]) + self.assertRegex(result.exception.args[0], "current-generation-config-path") diff --git a/hermetic_build/common/tests/model/__init__.py b/hermetic_build/common/tests/model/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/hermetic_build/common/tests/model/config_change_unit_tests.py b/hermetic_build/common/tests/model/config_change_unit_tests.py new file mode 100644 index 0000000000..3cae76626c --- /dev/null +++ b/hermetic_build/common/tests/model/config_change_unit_tests.py @@ -0,0 +1,328 @@ +# 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 +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT 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 unittest + +from common.model.config_change import ChangeType +from common.model.config_change import ConfigChange +from common.model.config_change import LibraryChange +from common.model.gapic_config import GapicConfig +from common.model.generation_config import GenerationConfig +from common.model.library_config import LibraryConfig + + +class ConfigChangeTest(unittest.TestCase): + def test_get_changed_libraries_with_repo_level_change_returns_all_libraries_changed( + self, + ): + config_change = ConfigChange( + change_to_libraries={ + ChangeType.REPO_LEVEL_CHANGE: [], + # add a library level change to verify this type of change has + # no impact on the result. + ChangeType.LIBRARY_LEVEL_CHANGE: [ + LibraryChange( + changed_param="test", + current_value="test", + library_name="test-library", + ) + ], + }, + baseline_config=ConfigChangeTest.__get_a_gen_config(), + current_config=ConfigChangeTest.__get_a_gen_config( + googleapis_commitish="", + libraries=[ + ConfigChangeTest.__get_a_library_config( + library_name="gke-backup", + gapic_configs=[ + GapicConfig(proto_path="google/cloud/gkebackup/v1") + ], + ), + ConfigChangeTest.__get_a_library_config( + library_name="test-library", + gapic_configs=[ + GapicConfig(proto_path="google/cloud/gkebackup/v1") + ], + ), + ], + ), + ) + self.assertEqual( + ["gke-backup", "test-library"], + config_change.get_changed_libraries(), + ) + + def test_get_changed_libraries_with_library_level_change_returns_list(self): + config_change = ConfigChange( + change_to_libraries={ + ChangeType.LIBRARY_LEVEL_CHANGE: [ + LibraryChange( + changed_param="test", + current_value="test", + library_name="a-library", + ), + LibraryChange( + changed_param="test", + current_value="test", + library_name="another-library", + ), + ], + ChangeType.LIBRARIES_ADDITION: [ + LibraryChange( + changed_param="test", + current_value="test", + library_name="new-library", + ), + ], + ChangeType.GAPIC_ADDITION: [ + LibraryChange( + changed_param="test", + current_value="test", + library_name="library-with-new-version", + ), + ], + }, + baseline_config=ConfigChangeTest.__get_a_gen_config(), + current_config=ConfigChangeTest.__get_a_gen_config(), + ) + self.assertEqual( + ["a-library", "another-library", "library-with-new-version", "new-library"], + config_change.get_changed_libraries(), + ) + + def test_get_changed_libraries_with_duplicated_library_name_returns_unique_name( + self, + ): + config_change = ConfigChange( + change_to_libraries={ + ChangeType.LIBRARY_LEVEL_CHANGE: [ + LibraryChange( + changed_param="a-param", + current_value="new_test", + library_name="a-library", + ), + LibraryChange( + changed_param="another-param", + current_value="new_value", + library_name="a-library", + ), + ], + }, + baseline_config=ConfigChangeTest.__get_a_gen_config(), + current_config=ConfigChangeTest.__get_a_gen_config(), + ) + self.assertEqual( + ["a-library"], + config_change.get_changed_libraries(), + ) + + def test_get_changed_libraries_with_mix_changes_returns_list(self): + baseline_commit = "277145d108819fa30fbed3a7cbbb50f91eb6155e" + latest_commit = "8984ddb508dea0e673b724c58338e810b1d8aee3" + config_change = ConfigChange( + change_to_libraries={ + ChangeType.GOOGLEAPIS_COMMIT: [], + ChangeType.LIBRARY_LEVEL_CHANGE: [ + LibraryChange( + changed_param="test", + current_value="test", + library_name="a-library", + ) + ], + ChangeType.LIBRARIES_ADDITION: [ + LibraryChange( + changed_param="test", + current_value="test", + library_name="new-library", + ), + ], + }, + baseline_config=ConfigChangeTest.__get_a_gen_config( + googleapis_commitish=baseline_commit + ), + current_config=ConfigChangeTest.__get_a_gen_config( + googleapis_commitish=latest_commit, + libraries=[ + ConfigChangeTest.__get_a_library_config( + library_name="gke-backup", + gapic_configs=[ + GapicConfig(proto_path="google/cloud/gkebackup/v1") + ], + ), + ], + ), + ) + + self.assertEqual( + ["a-library", "gke-backup", "new-library"], + sorted(config_change.get_changed_libraries()), + ) + + def test_get_qualified_commits_success(self): + baseline_commit = "277145d108819fa30fbed3a7cbbb50f91eb6155e" + latest_commit = "8984ddb508dea0e673b724c58338e810b1d8aee3" + gke_backup_commit = "b8691edb3f1d3c1583aa9cd89240eb359eebe9c7" + aiplatform_commit = "b82095baef02e525bee7bb1c48911c33b66acdf0" + network_management_commit = "efad09c9f0d46ae0786d810a88024363e06c6ca3" + config_change = ConfigChange( + change_to_libraries={}, + baseline_config=ConfigChangeTest.__get_a_gen_config( + googleapis_commitish=baseline_commit + ), + current_config=ConfigChangeTest.__get_a_gen_config( + googleapis_commitish=latest_commit, + libraries=[ + ConfigChangeTest.__get_a_library_config( + library_name="gke-backup", + gapic_configs=[ + GapicConfig(proto_path="google/cloud/gkebackup/v1") + ], + ), + ConfigChangeTest.__get_a_library_config( + library_name="aiplatform", + gapic_configs=[ + GapicConfig(proto_path="google/cloud/aiplatform/v1beta1") + ], + ), + ConfigChangeTest.__get_a_library_config( + library_name="network-management", + gapic_configs=[ + GapicConfig(proto_path="google/cloud/networkmanagement/v1"), + GapicConfig( + proto_path="google/cloud/networkmanagement/v1beta1" + ), + ], + ), + ], + ), + ) + qualified_commits = config_change.get_qualified_commits() + self.assertEqual(3, len(qualified_commits)) + self.assertEqual({"gke-backup"}, qualified_commits[0].libraries) + self.assertEqual( + gke_backup_commit, + qualified_commits[0].commit.hexsha, + ) + self.assertEqual({"aiplatform"}, qualified_commits[1].libraries) + self.assertEqual( + aiplatform_commit, + qualified_commits[1].commit.hexsha, + ) + self.assertEqual({"network-management"}, qualified_commits[2].libraries) + self.assertEqual( + network_management_commit, + qualified_commits[2].commit.hexsha, + ) + + def test_get_qualified_commits_rest_numeric_enum_change_returns_a_qualified_commit( + self, + ): + baseline_commit = "45694d2bad602c52170096072d325aa644d550e5" + latest_commit = "758f0d1217d9c7fe398aa5efb1057ce4b6409e55" + config_change = ConfigChange( + change_to_libraries={}, + baseline_config=ConfigChangeTest.__get_a_gen_config( + googleapis_commitish=baseline_commit + ), + current_config=ConfigChangeTest.__get_a_gen_config( + googleapis_commitish=latest_commit, + libraries=[ + ConfigChangeTest.__get_a_library_config( + library_name="container", + gapic_configs=[GapicConfig(proto_path="google/container/v1")], + ) + ], + ), + ) + # one commit between latest_commit and baseline_commit which only + # changed BUILD.bazel. + # this commit changed `rest_numeric_enums`. + self.assertTrue(len(config_change.get_qualified_commits()) == 1) + + def test_get_qualified_commits_irrelevant_build_field_change_returns_empty_list( + self, + ): + baseline_commit = "bdda0174f68a738518ec311e05e6fd9bbe19cd78" + latest_commit = "c9a5050ef225b0011603e1109cf53ab1de0a8e53" + config_change = ConfigChange( + change_to_libraries={}, + baseline_config=ConfigChangeTest.__get_a_gen_config( + googleapis_commitish=baseline_commit + ), + current_config=ConfigChangeTest.__get_a_gen_config( + googleapis_commitish=latest_commit, + libraries=[ + ConfigChangeTest.__get_a_library_config( + library_name="chat", + gapic_configs=[GapicConfig(proto_path="google/chat/v1")], + ) + ], + ), + ) + # one commit between latest_commit and baseline_commit which only + # changed BUILD.bazel. + # this commit didn't change fields used in library generation. + self.assertTrue(len(config_change.get_qualified_commits()) == 0) + + def test_get_qualified_commits_add_build_file_returns_a_qualified_commit(self): + baseline_commit = "d007ca1b3cc820651530d44d5388533047ae1414" + latest_commit = "05d889e7dfe087fc2ddc9de9579f01d4e1c2f35e" + config_change = ConfigChange( + change_to_libraries={}, + baseline_config=ConfigChangeTest.__get_a_gen_config( + googleapis_commitish=baseline_commit + ), + current_config=ConfigChangeTest.__get_a_gen_config( + googleapis_commitish=latest_commit, + libraries=[ + ConfigChangeTest.__get_a_library_config( + library_name="cloudcontrolspartner", + gapic_configs=[ + GapicConfig( + proto_path="google/cloud/cloudcontrolspartner/v1" + ) + ], + ) + ], + ), + ) + # one commit between latest_commit and baseline_commit which added + # google/cloud/cloudcontrolspartner/v1. + self.assertTrue(len(config_change.get_qualified_commits()) == 1) + + @staticmethod + def __get_a_gen_config( + googleapis_commitish="", libraries: list[LibraryConfig] = None + ) -> GenerationConfig: + if libraries is None: + libraries = [] + return GenerationConfig( + gapic_generator_version="", + googleapis_commitish=googleapis_commitish, + libraries=libraries, + ) + + @staticmethod + def __get_a_library_config( + library_name: str, gapic_configs: list[GapicConfig] = None + ) -> LibraryConfig: + if gapic_configs is None: + gapic_configs = [] + return LibraryConfig( + api_shortname="existing_library", + api_description="", + name_pretty="", + product_documentation="", + gapic_configs=gapic_configs, + library_name=library_name, + ) diff --git a/hermetic_build/common/tests/model/gapic_config_unit_tests.py b/hermetic_build/common/tests/model/gapic_config_unit_tests.py new file mode 100644 index 0000000000..864b2556e4 --- /dev/null +++ b/hermetic_build/common/tests/model/gapic_config_unit_tests.py @@ -0,0 +1,122 @@ +# 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 +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT 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 unittest + +from common.model.gapic_config import GapicConfig + + +class GapicConfigTest(unittest.TestCase): + def test_get_version_returns_none(self): + self.assertIsNone(GapicConfig(proto_path="example/dir1/dir2").get_version()) + + def test_get_version_returns_non_stable_version(self): + self.assertEqual( + "v2p2beta1", + GapicConfig(proto_path="example/dir1/dir2/v2p2beta1").get_version(), + ) + self.assertEqual( + "v2beta1", + GapicConfig(proto_path="example/dir1/dir2/v2beta1").get_version(), + ) + + def test_get_version_returns_stable_version(self): + self.assertEqual( + "v20", + GapicConfig(proto_path="example/dir1/dir2/v20").get_version(), + ) + + def test_is_stable_with_no_version_returns_false(self): + self.assertFalse( + GapicConfig(proto_path="example/dir1/dir2/non_version").is_stable(), + ) + + def test_is_stable_with_non_stable_version_returns_false(self): + self.assertFalse( + GapicConfig(proto_path="example/dir1/dir2/v20alpha").is_stable(), + ) + self.assertFalse( + GapicConfig(proto_path="example/dir1/dir2/v20beta2").is_stable(), + ) + + def test_is_stable_with_stable_version_returns_true(self): + self.assertTrue( + GapicConfig(proto_path="example/dir1/dir2/v30").is_stable(), + ) + + def test_compare_configs_without_a_version(self): + config_len_3 = GapicConfig(proto_path="example/dir1/dir2") + config_len_4 = GapicConfig(proto_path="example/dir1/dir2/dir3") + self.assertLess( + config_len_3, + config_len_4, + "config_len_3 should be smaller since it has a lower depth.", + ) + + def test_compare_configs_only_one_has_a_stable_version(self): + versioned_config = GapicConfig(proto_path="example/dir1/dir2/dir3/dir4/v1") + non_versioned_config = GapicConfig(proto_path="example/dir1/dir2/dir3") + self.assertLess( + versioned_config, + non_versioned_config, + "versioned_config should be smaller since it has a version.", + ) + + def test_compare_configs_only_one_has_a_non_stable_version(self): + non_stable_versioned_config = GapicConfig( + proto_path="example/dir1/dir2/dir3/dir4/v1beta" + ) + non_versioned_config = GapicConfig(proto_path="example/dir1/dir2/dir3") + self.assertLess( + non_stable_versioned_config, + non_versioned_config, + "non_stable_versioned_config should be smaller since it has a version.", + ) + + def test_compare_configs_one_has_non_stable_and_one_has_stable_version(self): + stable_versioned_config = GapicConfig( + proto_path="example/dir1/dir2/dir3/dir4/v1" + ) + non_stable_versioned_config = GapicConfig(proto_path="example/dir1/dir2/v2beta") + self.assertLess( + stable_versioned_config, + non_stable_versioned_config, + "stable_versioned_config should be smaller since it has a stable version.", + ) + + def test_compare_configs_two_have_non_stable_version(self): + v3p2beta = GapicConfig(proto_path="example/dir1/dir2/dir3/dir4/v3p2beta") + v2p4beta = GapicConfig(proto_path="example/dir1/dir2/v2p4beta") + self.assertLess( + v3p2beta, + v2p4beta, + "v3p2beta should be smaller since it has a higher version.", + ) + + def test_compare_configs_two_have_stable_version_different_depth(self): + v3 = GapicConfig(proto_path="example/dir1/dir2/v3") + v4 = GapicConfig(proto_path="example/dir1/dir2/dir3/dir4/v4") + self.assertLess( + v3, + v4, + "v3 should be smaller since it has lower depth", + ) + + def test_compare_configs_two_have_stable_version_same_depth(self): + v4 = GapicConfig(proto_path="example/dir1/dir2/v4") + v3 = GapicConfig(proto_path="example/dir1/dir2/v3") + self.assertLess( + v4, + v3, + "v4 should be smaller since it has a higher version", + ) diff --git a/hermetic_build/common/tests/model/gapic_inputs_unit_tests.py b/hermetic_build/common/tests/model/gapic_inputs_unit_tests.py new file mode 100644 index 0000000000..41e9e7d233 --- /dev/null +++ b/hermetic_build/common/tests/model/gapic_inputs_unit_tests.py @@ -0,0 +1,132 @@ +import os +import unittest +from pathlib import Path + +from parameterized import parameterized +from common.model.gapic_inputs import parse + +script_dir = os.path.dirname(os.path.realpath(__file__)) +resources_dir = os.path.join(script_dir, "..", "resources") +build_file = Path(os.path.join(resources_dir, "misc")).resolve() + + +class UtilitiesTest(unittest.TestCase): + @parameterized.expand( + [ + ("BUILD_no_additional_protos.bazel", " "), + ("BUILD_common_resources.bazel", " google/cloud/common_resources.proto"), + ("BUILD_comment_common_resources.bazel", " "), + ("BUILD_locations.bazel", " google/cloud/location/locations.proto"), + ("BUILD_comment_locations.bazel", " "), + ("BUILD_iam_policy.bazel", " google/iam/v1/iam_policy.proto"), + ("BUILD_comment_iam_policy.bazel", " "), + ( + "BUILD_iam_locations.bazel", + " google/cloud/location/locations.proto google/iam/v1/iam_policy.proto", + ), + ] + ) + def test_gapic_inputs_parse_additional_protos(self, build_name, expected): + parsed = parse(build_file, "", build_name) + self.assertEqual( + expected, + parsed.additional_protos, + ) + + def test_gapic_inputs_parse_grpc_only_succeeds(self): + parsed = parse(build_file, "", "BUILD_grpc.bazel") + self.assertEqual("grpc", parsed.transport) + + def test_gapic_inputs_parse_grpc_rest_succeeds(self): + parsed = parse(build_file, "", "BUILD_grpc_rest.bazel") + self.assertEqual("grpc+rest", parsed.transport) + + def test_gapic_inputs_parse_rest_succeeds(self): + parsed = parse(build_file, "", "BUILD_rest.bazel") + self.assertEqual("rest", parsed.transport) + + def test_gapic_inputs_parse_empty_include_samples_succeeds(self): + parsed = parse(build_file, "", "BUILD_include_samples_empty.bazel") + self.assertEqual("false", parsed.include_samples) + + def test_gapic_inputs_parse_include_samples_false_succeeds(self): + parsed = parse(build_file, "", "BUILD_include_samples_false.bazel") + self.assertEqual("false", parsed.include_samples) + + def test_gapic_inputs_parse_include_samples_true_succeeds(self): + parsed = parse(build_file, "", "BUILD_include_samples_true.bazel") + self.assertEqual("true", parsed.include_samples) + + def test_gapic_inputs_parse_empty_rest_numeric_enums_succeeds(self): + parsed = parse(build_file, "", "BUILD_rest_numeric_enums_empty.bazel") + self.assertEqual("false", parsed.rest_numeric_enum) + + def test_gapic_inputs_parse_rest_numeric_enums_false_succeeds(self): + parsed = parse(build_file, "", "BUILD_rest_numeric_enums_false.bazel") + self.assertEqual("false", parsed.rest_numeric_enum) + + def test_gapic_inputs_parse_rest_numeric_enums_true_succeeds(self): + parsed = parse(build_file, "", "BUILD_rest_numeric_enums_true.bazel") + self.assertEqual("true", parsed.rest_numeric_enum) + + def test_gapic_inputs_parse_no_gapic_library_returns_proto_only_true(self): + # include_samples_empty only has a gradle assembly rule + parsed = parse(build_file, "", "BUILD_include_samples_empty.bazel") + self.assertEqual("true", parsed.proto_only) + + def test_gapic_inputs_parse_with_gapic_library_returns_proto_only_false(self): + # rest.bazel has a java_gapic_library rule + parsed = parse(build_file, "", "BUILD_rest.bazel") + self.assertEqual("false", parsed.proto_only) + + def test_gapic_inputs_parse_gapic_yaml_succeeds(self): + parsed = parse(build_file, "test/versioned/path", "BUILD_gapic_yaml.bazel") + self.assertEqual("test/versioned/path/test_gapic_yaml.yaml", parsed.gapic_yaml) + + def test_gapic_inputs_parse_no_gapic_yaml_returns_empty_string(self): + parsed = parse(build_file, "test/versioned/path", "BUILD_no_gapic_yaml.bazel") + self.assertEqual("", parsed.gapic_yaml) + + def test_gapic_inputs_parse_service_config_succeeds(self): + parsed = parse(build_file, "test/versioned/path", "BUILD_service_config.bazel") + self.assertEqual( + "test/versioned/path/test_service_config.json", parsed.service_config + ) + + def test_gapic_inputs_parse_service_yaml_relative_target(self): + parsed = parse( + build_file, + "google/cloud/compute/v1", + "BUILD_service_config_relative_target.bazel", + ) + self.assertEqual( + "google/cloud/compute/v1/compute_grpc_service_config.json", + parsed.service_config, + ) + + def test_gapic_inputs_parse_no_service_config_returns_empty_string(self): + parsed = parse( + build_file, "test/versioned/path", "BUILD_no_service_config.bazel" + ) + self.assertEqual("", parsed.service_config) + + def test_gapic_inputs_parse_service_yaml_succeeds(self): + parsed = parse(build_file, "test/versioned/path", "BUILD_service_yaml.bazel") + self.assertEqual( + "test/versioned/path/test_service_yaml.yaml", parsed.service_yaml + ) + + def test_gapic_inputs_parse_service_yaml_absolute_target(self): + parsed = parse(build_file, "", "BUILD_service_yaml_absolute_target.bazel") + self.assertEqual( + "google/cloud/videointelligence/videointelligence_v1p3beta1.yaml", + parsed.service_yaml, + ) + + def test_gapic_inputs_parse_no_service_yaml_returns_empty_string(self): + parsed = parse(build_file, "test/versioned/path", "BUILD_no_service_yaml.bazel") + self.assertEqual("", parsed.service_yaml) + + def test_gapic_inputs_parse_proto_only_returns_grpc(self): + parsed = parse(build_file, "test/versioned/path", "BUILD_proto_only.bazel") + self.assertEqual("grpc", parsed.transport) diff --git a/hermetic_build/common/tests/model/generation_config_unit_tests.py b/hermetic_build/common/tests/model/generation_config_unit_tests.py new file mode 100644 index 0000000000..2b89a1acc8 --- /dev/null +++ b/hermetic_build/common/tests/model/generation_config_unit_tests.py @@ -0,0 +1,258 @@ +# 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 +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT 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 unittest +from pathlib import Path +from common.model.generation_config import GenerationConfig +from common.model.library_config import LibraryConfig + +script_dir = os.path.dirname(os.path.realpath(__file__)) +resources_dir = os.path.join(script_dir, "..", "resources") +test_config_dir = Path(os.path.join(resources_dir, "test-config")).resolve() + +library_1 = LibraryConfig( + api_shortname="a_library", + api_description="", + name_pretty="", + product_documentation="", + gapic_configs=[], +) +library_2 = LibraryConfig( + api_shortname="another_library", + api_description="", + name_pretty="", + product_documentation="", + gapic_configs=[], +) +common_protos_library = LibraryConfig( + api_shortname="common-protos", + api_description="", + name_pretty="", + product_documentation="", + gapic_configs=[], +) + + +class GenerationConfigTest(unittest.TestCase): + def test_generation_config_default_value(self): + config = GenerationConfig( + gapic_generator_version="", + googleapis_commitish="", + libraries=[], + ) + self.assertEqual("", config.libraries_bom_version) + + def test_generation_config_with_generator_version_env_raise_exception(self): + self.assertRaisesRegex( + ValueError, + "Environment variable GENERATOR_VERSION is not set", + GenerationConfig, + googleapis_commitish="", + libraries=[], + ) + + def test_generation_config_set_generator_version_from_env(self): + os.environ["GENERATOR_VERSION"] = "1.2.3" + config = GenerationConfig( + googleapis_commitish="", + libraries=[], + ) + self.assertEqual("1.2.3", config.gapic_generator_version) + os.environ.pop("GENERATOR_VERSION") + + def test_from_yaml_succeeds(self): + config = GenerationConfig.from_yaml(f"{test_config_dir}/generation_config.yaml") + self.assertEqual("2.34.0", config.gapic_generator_version) + self.assertEqual( + "1a45bf7393b52407188c82e63101db7dc9c72026", config.googleapis_commitish + ) + self.assertEqual("26.37.0", config.libraries_bom_version) + library = config.libraries[0] + self.assertEqual("cloudasset", library.api_shortname) + self.assertEqual("Cloud Asset Inventory", library.name_pretty) + self.assertEqual( + "https://cloud.google.com/resource-manager/docs/cloud-asset-inventory/overview", + library.product_documentation, + ) + self.assertEqual( + "provides inventory services based on a time series database.", + library.api_description, + ) + self.assertEqual("asset", library.library_name) + self.assertEqual("@googleapis/analytics-dpe", library.codeowner_team) + self.assertEqual( + "proto-google-iam-v1-bom,google-iam-policy,proto-google-iam-v1", + library.excluded_poms, + ) + self.assertEqual("google-iam-policy", library.excluded_dependencies) + gapics = library.gapic_configs + self.assertEqual(5, len(gapics)) + self.assertEqual("google/cloud/asset/v1", gapics[0].proto_path) + self.assertEqual("google/cloud/asset/v1p1beta1", gapics[1].proto_path) + self.assertEqual("google/cloud/asset/v1p2beta1", gapics[2].proto_path) + self.assertEqual("google/cloud/asset/v1p5beta1", gapics[3].proto_path) + self.assertEqual("google/cloud/asset/v1p7beta1", gapics[4].proto_path) + + def test_get_proto_path_to_library_name_success(self): + paths = GenerationConfig.from_yaml( + f"{test_config_dir}/generation_config.yaml" + ).get_proto_path_to_library_name() + self.assertEqual( + { + "google/cloud/asset/v1": "asset", + "google/cloud/asset/v1p1beta1": "asset", + "google/cloud/asset/v1p2beta1": "asset", + "google/cloud/asset/v1p5beta1": "asset", + "google/cloud/asset/v1p7beta1": "asset", + }, + paths, + ) + + def test_is_monorepo_with_one_library_returns_false(self): + config = GenerationConfig( + gapic_generator_version="", + googleapis_commitish="", + libraries=[library_1], + ) + self.assertFalse(config.is_monorepo()) + + def test_is_monorepo_with_two_libraries_returns_true(self): + config = GenerationConfig( + gapic_generator_version="", + googleapis_commitish="", + libraries=[library_1, library_2], + ) + self.assertTrue(config.is_monorepo()) + + def test_contains_common_protos_with_common_protos_returns_true(self): + config = GenerationConfig( + gapic_generator_version="", + googleapis_commitish="", + libraries=[library_1, library_2, common_protos_library], + ) + self.assertTrue(config.contains_common_protos()) + + def test_contains_common_protos_without_common_protos_returns_false(self): + config = GenerationConfig( + gapic_generator_version="", + googleapis_commitish="", + libraries=[library_1, library_2], + ) + self.assertFalse(config.contains_common_protos()) + + def test_validate_with_duplicate_library_name_raise_exception(self): + self.assertRaisesRegex( + ValueError, + "the same library name", + GenerationConfig, + gapic_generator_version="", + googleapis_commitish="", + libraries=[ + LibraryConfig( + api_shortname="secretmanager", + name_pretty="Secret API", + product_documentation="", + api_description="", + gapic_configs=list(), + ), + LibraryConfig( + api_shortname="another-secret", + name_pretty="Another Secret API", + product_documentation="", + api_description="", + gapic_configs=list(), + library_name="secretmanager", + ), + ], + ) + + def test_from_yaml_without_googleapis_commitish_raise_exception(self): + self.assertRaisesRegex( + ValueError, + "Repo level parameter, googleapis_commitish", + GenerationConfig.from_yaml, + f"{test_config_dir}/config_without_googleapis.yaml", + ) + + def test_from_yaml_without_libraries_raise_exception(self): + self.assertRaisesRegex( + ValueError, + "Repo level parameter, libraries", + GenerationConfig.from_yaml, + f"{test_config_dir}/config_without_libraries.yaml", + ) + + def test_from_yaml_without_api_shortname_raise_exception(self): + self.assertRaisesRegex( + ValueError, + "Library level parameter, api_shortname", + GenerationConfig.from_yaml, + f"{test_config_dir}/config_without_api_shortname.yaml", + ) + + def test_from_yaml_without_api_description_raise_exception(self): + self.assertRaisesRegex( + ValueError, + r"Library level parameter, api_description.*'api_shortname': 'apigeeconnect'.*", + GenerationConfig.from_yaml, + f"{test_config_dir}/config_without_api_description.yaml", + ) + + def test_from_yaml_without_name_pretty_raise_exception(self): + self.assertRaisesRegex( + ValueError, + r"Library level parameter, name_pretty.*'api_shortname': 'apigeeconnect'.*", + GenerationConfig.from_yaml, + f"{test_config_dir}/config_without_name_pretty.yaml", + ) + + def test_from_yaml_without_product_documentation_raise_exception(self): + self.assertRaisesRegex( + ValueError, + r"Library level parameter, product_documentation.*'api_shortname': 'apigeeconnect'.*", + GenerationConfig.from_yaml, + f"{test_config_dir}/config_without_product_docs.yaml", + ) + + def test_from_yaml_without_gapics_raise_exception(self): + self.assertRaisesRegex( + ValueError, + "Library level parameter, GAPICs.*'api_shortname': 'apigeeconnect'.*", + GenerationConfig.from_yaml, + f"{test_config_dir}/config_without_gapics_key.yaml", + ) + + def test_from_yaml_without_proto_path_raise_exception(self): + self.assertRaisesRegex( + ValueError, + "GAPIC level parameter, proto_path", + GenerationConfig.from_yaml, + f"{test_config_dir}/config_without_proto_path.yaml", + ) + + def test_from_yaml_with_zero_library_raise_exception(self): + self.assertRaisesRegex( + ValueError, + "Library is None", + GenerationConfig.from_yaml, + f"{test_config_dir}/config_without_library_value.yaml", + ) + + def test_from_yaml_with_zero_proto_path_raise_exception(self): + self.assertRaisesRegex( + ValueError, + r"GAPICs is None in.*'api_shortname': 'apigeeconnect'.*", + GenerationConfig.from_yaml, + f"{test_config_dir}/config_without_gapics_value.yaml", + ) diff --git a/hermetic_build/common/tests/model/library_config_unit_tests.py b/hermetic_build/common/tests/model/library_config_unit_tests.py new file mode 100644 index 0000000000..4935979ffa --- /dev/null +++ b/hermetic_build/common/tests/model/library_config_unit_tests.py @@ -0,0 +1,122 @@ +# 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 +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT 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 unittest + +from common.model.gapic_config import GapicConfig +from common.model.library_config import LibraryConfig + + +class LibraryConfigTest(unittest.TestCase): + def test_get_library_returns_library_name(self): + library = LibraryConfig( + api_shortname="secret", + name_pretty="", + product_documentation="", + api_description="", + gapic_configs=list(), + library_name="secretmanager", + ) + self.assertEqual("secretmanager", library.get_library_name()) + + def test_get_library_returns_api_shortname(self): + library = LibraryConfig( + api_shortname="secret", + name_pretty="", + product_documentation="", + api_description="", + gapic_configs=list(), + ) + self.assertEqual("secret", library.get_library_name()) + + def test_get_sorted_gapic_configs_returns_correct_order(self): + v1beta1 = GapicConfig(proto_path="google/spanner/v1beta1") + v1 = GapicConfig(proto_path="google/spanner/v1") + v1alpha1 = GapicConfig(proto_path="google/spanner/v1alpha") + v2 = GapicConfig(proto_path="google/spanner/v2") + admin_v2 = GapicConfig(proto_path="google/spanner/admin/v2") + non_versioned = GapicConfig(proto_path="google/spanner/type") + library = LibraryConfig( + api_shortname="secret", + name_pretty="", + product_documentation="", + api_description="", + gapic_configs=[v1alpha1, v1, v2, admin_v2, non_versioned, v1beta1], + ) + self.assertEqual( + [ + v2, + v1, + admin_v2, + v1beta1, + v1alpha1, + non_versioned, + ], + library.get_sorted_gapic_configs(), + ) + + def test_init_invalid_distribution_name_raise_value_error(self): + self.assertRaisesRegex( + ValueError, + "fake-distribution-name is not a valid distribution name.", + LibraryConfig, + api_shortname="baremetalsolution", + name_pretty="Bare Metal Solution", + product_documentation="https://cloud.google.com/bare-metal/docs", + api_description="example api description", + gapic_configs=list(), + distribution_name="fake-distribution-name", + ) + + def test_get_distribution_name_cloud_api(self): + library = LibraryConfig( + api_shortname="baremetalsolution", + name_pretty="Bare Metal Solution", + product_documentation="https://cloud.google.com/bare-metal/docs", + api_description="example api description", + gapic_configs=list(), + ) + self.assertEqual( + "com.google.cloud:google-cloud-baremetalsolution", + library.get_maven_coordinate(), + ) + self.assertEqual("google-cloud-baremetalsolution", library.get_artifact_id()) + + def test_get_distribution_name_non_cloud_api(self): + library = LibraryConfig( + api_shortname="baremetalsolution", + name_pretty="Bare Metal Solution", + product_documentation="https://cloud.google.com/bare-metal/docs", + api_description="example api description", + gapic_configs=list(), + cloud_api=False, + group_id="com.example", + ) + self.assertEqual( + "com.example:google-baremetalsolution", library.get_maven_coordinate() + ) + self.assertEqual("google-baremetalsolution", library.get_artifact_id()) + + def test_get_distribution_name_with_distribution_name(self): + library = LibraryConfig( + api_shortname="baremetalsolution", + name_pretty="Bare Metal Solution", + product_documentation="https://cloud.google.com/bare-metal/docs", + api_description="example api description", + gapic_configs=list(), + distribution_name="com.example:baremetalsolution", + ) + self.assertEqual( + "com.example:baremetalsolution", library.get_maven_coordinate() + ) + self.assertEqual("baremetalsolution", library.get_artifact_id()) diff --git a/hermetic_build/common/tests/resources/cli/empty_config.yaml b/hermetic_build/common/tests/resources/cli/empty_config.yaml new file mode 100644 index 0000000000..e69de29bb2 diff --git a/hermetic_build/common/tests/resources/misc/BUILD_additional_protos_in_gapic.bazel b/hermetic_build/common/tests/resources/misc/BUILD_additional_protos_in_gapic.bazel new file mode 100644 index 0000000000..cb124dbbc7 --- /dev/null +++ b/hermetic_build/common/tests/resources/misc/BUILD_additional_protos_in_gapic.bazel @@ -0,0 +1,6 @@ +java_gapic_library( + deps = [ + "//google/cloud/location:location_java_proto", + "//google/iam/v1:iam_java_proto" + ], +) diff --git a/hermetic_build/common/tests/resources/misc/BUILD_comment_common_resources.bazel b/hermetic_build/common/tests/resources/misc/BUILD_comment_common_resources.bazel new file mode 100644 index 0000000000..126ffdb7ca --- /dev/null +++ b/hermetic_build/common/tests/resources/misc/BUILD_comment_common_resources.bazel @@ -0,0 +1,5 @@ +proto_library_with_info( + deps = [ + #"//google/cloud:common_resources_proto", + ] +) \ No newline at end of file diff --git a/hermetic_build/common/tests/resources/misc/BUILD_comment_iam_policy.bazel b/hermetic_build/common/tests/resources/misc/BUILD_comment_iam_policy.bazel new file mode 100644 index 0000000000..a9a2c1ca75 --- /dev/null +++ b/hermetic_build/common/tests/resources/misc/BUILD_comment_iam_policy.bazel @@ -0,0 +1,5 @@ +proto_library_with_info( + deps = [ + # "//google/iam/v1:iam_policy_proto", + ] +) \ No newline at end of file diff --git a/hermetic_build/common/tests/resources/misc/BUILD_comment_locations.bazel b/hermetic_build/common/tests/resources/misc/BUILD_comment_locations.bazel new file mode 100644 index 0000000000..8b96e3ab81 --- /dev/null +++ b/hermetic_build/common/tests/resources/misc/BUILD_comment_locations.bazel @@ -0,0 +1,5 @@ +proto_library_with_info( + deps = [ + # "//google/cloud/location:location_proto", + ] +) \ No newline at end of file diff --git a/hermetic_build/common/tests/resources/misc/BUILD_common_resources.bazel b/hermetic_build/common/tests/resources/misc/BUILD_common_resources.bazel new file mode 100644 index 0000000000..9b749e6ad5 --- /dev/null +++ b/hermetic_build/common/tests/resources/misc/BUILD_common_resources.bazel @@ -0,0 +1,5 @@ +proto_library_with_info( + deps = [ + "//google/cloud:common_resources_proto", + ] +) \ No newline at end of file diff --git a/hermetic_build/common/tests/resources/misc/BUILD_gapic_yaml.bazel b/hermetic_build/common/tests/resources/misc/BUILD_gapic_yaml.bazel new file mode 100644 index 0000000000..b55f4550d8 --- /dev/null +++ b/hermetic_build/common/tests/resources/misc/BUILD_gapic_yaml.bazel @@ -0,0 +1,3 @@ +java_gapic_library( + gapic_yaml = "test_gapic_yaml.yaml", +) diff --git a/hermetic_build/common/tests/resources/misc/BUILD_grpc.bazel b/hermetic_build/common/tests/resources/misc/BUILD_grpc.bazel new file mode 100644 index 0000000000..3e59a9bd35 --- /dev/null +++ b/hermetic_build/common/tests/resources/misc/BUILD_grpc.bazel @@ -0,0 +1,5 @@ +# this file is only used in testing `get_transport_from_BUILD` in utilities.sh + +java_gapic_library( + transport = "grpc", +) diff --git a/hermetic_build/common/tests/resources/misc/BUILD_grpc_rest.bazel b/hermetic_build/common/tests/resources/misc/BUILD_grpc_rest.bazel new file mode 100644 index 0000000000..8a98e7e646 --- /dev/null +++ b/hermetic_build/common/tests/resources/misc/BUILD_grpc_rest.bazel @@ -0,0 +1,5 @@ +# this file is only used in testing `get_transport_from_BUILD` in utilities.sh + +java_gapic_library( + transport = "grpc+rest", +) diff --git a/hermetic_build/common/tests/resources/misc/BUILD_iam_locations.bazel b/hermetic_build/common/tests/resources/misc/BUILD_iam_locations.bazel new file mode 100644 index 0000000000..d0c971da7c --- /dev/null +++ b/hermetic_build/common/tests/resources/misc/BUILD_iam_locations.bazel @@ -0,0 +1,6 @@ +proto_library_with_info( + deps = [ + "//google/cloud/location:location_proto", + "//google/iam/v1:iam_policy_proto", + ] +) \ No newline at end of file diff --git a/hermetic_build/common/tests/resources/misc/BUILD_iam_policy.bazel b/hermetic_build/common/tests/resources/misc/BUILD_iam_policy.bazel new file mode 100644 index 0000000000..af5d4a32f8 --- /dev/null +++ b/hermetic_build/common/tests/resources/misc/BUILD_iam_policy.bazel @@ -0,0 +1,5 @@ +proto_library_with_info( + deps = [ + "//google/iam/v1:iam_policy_proto", + ] +) \ No newline at end of file diff --git a/hermetic_build/common/tests/resources/misc/BUILD_include_samples_empty.bazel b/hermetic_build/common/tests/resources/misc/BUILD_include_samples_empty.bazel new file mode 100644 index 0000000000..b9d4cd56e0 --- /dev/null +++ b/hermetic_build/common/tests/resources/misc/BUILD_include_samples_empty.bazel @@ -0,0 +1,5 @@ +# this file is only used in testing `get_include_samples_from_BUILD` in utilities.sh + +java_gapic_assembly_gradle_pkg( + +) diff --git a/hermetic_build/common/tests/resources/misc/BUILD_include_samples_false.bazel b/hermetic_build/common/tests/resources/misc/BUILD_include_samples_false.bazel new file mode 100644 index 0000000000..8e95c3d2a6 --- /dev/null +++ b/hermetic_build/common/tests/resources/misc/BUILD_include_samples_false.bazel @@ -0,0 +1,5 @@ +# this file is only used in testing `get_include_samples_from_BUILD` in utilities.sh + +java_gapic_assembly_gradle_pkg( + include_samples = False, +) diff --git a/hermetic_build/common/tests/resources/misc/BUILD_include_samples_true.bazel b/hermetic_build/common/tests/resources/misc/BUILD_include_samples_true.bazel new file mode 100644 index 0000000000..bac72b678f --- /dev/null +++ b/hermetic_build/common/tests/resources/misc/BUILD_include_samples_true.bazel @@ -0,0 +1,5 @@ +# this file is only used in testing `get_include_samples_from_BUILD` in utilities.sh + +java_gapic_assembly_gradle_pkg( + include_samples = True, +) diff --git a/hermetic_build/common/tests/resources/misc/BUILD_locations.bazel b/hermetic_build/common/tests/resources/misc/BUILD_locations.bazel new file mode 100644 index 0000000000..29ee14fdba --- /dev/null +++ b/hermetic_build/common/tests/resources/misc/BUILD_locations.bazel @@ -0,0 +1,5 @@ +proto_library_with_info( + deps = [ + "//google/cloud/location:location_proto", + ] +) \ No newline at end of file diff --git a/hermetic_build/common/tests/resources/misc/BUILD_no_additional_protos.bazel b/hermetic_build/common/tests/resources/misc/BUILD_no_additional_protos.bazel new file mode 100644 index 0000000000..a22257cad4 --- /dev/null +++ b/hermetic_build/common/tests/resources/misc/BUILD_no_additional_protos.bazel @@ -0,0 +1,4 @@ +proto_library_with_info( + deps = [ + ] +) \ No newline at end of file diff --git a/hermetic_build/common/tests/resources/misc/BUILD_no_gapic_yaml.bazel b/hermetic_build/common/tests/resources/misc/BUILD_no_gapic_yaml.bazel new file mode 100644 index 0000000000..1e9462aa30 --- /dev/null +++ b/hermetic_build/common/tests/resources/misc/BUILD_no_gapic_yaml.bazel @@ -0,0 +1,3 @@ +java_gapic_library( + gapic_yaml = None +) diff --git a/hermetic_build/common/tests/resources/misc/BUILD_no_service_config.bazel b/hermetic_build/common/tests/resources/misc/BUILD_no_service_config.bazel new file mode 100644 index 0000000000..dbde6de05c --- /dev/null +++ b/hermetic_build/common/tests/resources/misc/BUILD_no_service_config.bazel @@ -0,0 +1,3 @@ +java_gapic_library( + grpc_service_config = None +) diff --git a/hermetic_build/common/tests/resources/misc/BUILD_no_service_yaml.bazel b/hermetic_build/common/tests/resources/misc/BUILD_no_service_yaml.bazel new file mode 100644 index 0000000000..05bae16d5d --- /dev/null +++ b/hermetic_build/common/tests/resources/misc/BUILD_no_service_yaml.bazel @@ -0,0 +1,3 @@ +java_gapic_library( + service_yaml = None +) diff --git a/hermetic_build/common/tests/resources/misc/BUILD_proto_only.bazel b/hermetic_build/common/tests/resources/misc/BUILD_proto_only.bazel new file mode 100644 index 0000000000..26bcea6126 --- /dev/null +++ b/hermetic_build/common/tests/resources/misc/BUILD_proto_only.bazel @@ -0,0 +1,16 @@ +java_gapic_assembly_gradle_pkg( + name = "google-api-java", + transport = "grpc+rest", + deps = [ + "annotations_proto", + "auth_proto", + "backend_proto", + "billing_proto", + "client_proto", + "config_change_proto", + "consumer_proto", + "context_proto", + "control_proto", + "distribution_proto", + ], +) \ No newline at end of file diff --git a/hermetic_build/common/tests/resources/misc/BUILD_rest.bazel b/hermetic_build/common/tests/resources/misc/BUILD_rest.bazel new file mode 100644 index 0000000000..9dff694297 --- /dev/null +++ b/hermetic_build/common/tests/resources/misc/BUILD_rest.bazel @@ -0,0 +1,5 @@ +# this file is only used in testing `get_transport_from_BUILD` in utilities.sh + +java_gapic_library( + transport = "rest", +) diff --git a/hermetic_build/common/tests/resources/misc/BUILD_rest_numeric_enums_empty.bazel b/hermetic_build/common/tests/resources/misc/BUILD_rest_numeric_enums_empty.bazel new file mode 100644 index 0000000000..992b91e52c --- /dev/null +++ b/hermetic_build/common/tests/resources/misc/BUILD_rest_numeric_enums_empty.bazel @@ -0,0 +1,5 @@ +# this file is only used in testing `get_rest_numeric_enums_from_BUILD` in utilities.sh + +java_gapic_library( + +) diff --git a/hermetic_build/common/tests/resources/misc/BUILD_rest_numeric_enums_false.bazel b/hermetic_build/common/tests/resources/misc/BUILD_rest_numeric_enums_false.bazel new file mode 100644 index 0000000000..a446c6b2a7 --- /dev/null +++ b/hermetic_build/common/tests/resources/misc/BUILD_rest_numeric_enums_false.bazel @@ -0,0 +1,5 @@ +# this file is only used in testing `get_rest_numeric_enums_from_BUILD` in utilities.sh + +java_gapic_library( + rest_numeric_enums = False +) diff --git a/hermetic_build/common/tests/resources/misc/BUILD_rest_numeric_enums_true.bazel b/hermetic_build/common/tests/resources/misc/BUILD_rest_numeric_enums_true.bazel new file mode 100644 index 0000000000..c4d7fefeb4 --- /dev/null +++ b/hermetic_build/common/tests/resources/misc/BUILD_rest_numeric_enums_true.bazel @@ -0,0 +1,5 @@ +# this file is only used in testing `get_rest_numeric_enums_from_BUILD` in utilities.sh + +java_gapic_library( + rest_numeric_enums = True +) diff --git a/hermetic_build/common/tests/resources/misc/BUILD_service_config.bazel b/hermetic_build/common/tests/resources/misc/BUILD_service_config.bazel new file mode 100644 index 0000000000..097d1bb6bd --- /dev/null +++ b/hermetic_build/common/tests/resources/misc/BUILD_service_config.bazel @@ -0,0 +1,3 @@ +java_gapic_library( + grpc_service_config = "test_service_config.json" +) diff --git a/hermetic_build/common/tests/resources/misc/BUILD_service_config_relative_target.bazel b/hermetic_build/common/tests/resources/misc/BUILD_service_config_relative_target.bazel new file mode 100644 index 0000000000..ccd59af2fb --- /dev/null +++ b/hermetic_build/common/tests/resources/misc/BUILD_service_config_relative_target.bazel @@ -0,0 +1,3 @@ +java_gapic_library( + grpc_service_config = ":compute_grpc_service_config.json" +) diff --git a/hermetic_build/common/tests/resources/misc/BUILD_service_yaml.bazel b/hermetic_build/common/tests/resources/misc/BUILD_service_yaml.bazel new file mode 100644 index 0000000000..f7e4c91f4e --- /dev/null +++ b/hermetic_build/common/tests/resources/misc/BUILD_service_yaml.bazel @@ -0,0 +1,3 @@ +java_gapic_library( + service_yaml = "test_service_yaml.yaml" +) diff --git a/hermetic_build/common/tests/resources/misc/BUILD_service_yaml_absolute_target.bazel b/hermetic_build/common/tests/resources/misc/BUILD_service_yaml_absolute_target.bazel new file mode 100644 index 0000000000..ded899dff7 --- /dev/null +++ b/hermetic_build/common/tests/resources/misc/BUILD_service_yaml_absolute_target.bazel @@ -0,0 +1,3 @@ +java_gapic_library( + service_yaml = "//google/cloud/videointelligence:videointelligence_v1p3beta1.yaml", +) \ No newline at end of file diff --git a/hermetic_build/common/tests/resources/misc/BUILD_target_with_nested_parenthesis.bazel b/hermetic_build/common/tests/resources/misc/BUILD_target_with_nested_parenthesis.bazel new file mode 100644 index 0000000000..49d7dba943 --- /dev/null +++ b/hermetic_build/common/tests/resources/misc/BUILD_target_with_nested_parenthesis.bazel @@ -0,0 +1,13 @@ +proto_library_with_info( + # this comment should not indicate an end of a pattern match ) + deps = [ + "//google/cloud/location:location_proto", + ] +) + +java_gapic_library( + # this comment should not indicate an end of a pattern match ) + deps = [ + "//google/iam/v1:iam_java_proto" + ], +) diff --git a/hermetic_build/common/tests/resources/misc/TESTWORKSPACE b/hermetic_build/common/tests/resources/misc/TESTWORKSPACE new file mode 100644 index 0000000000..60b3036d9d --- /dev/null +++ b/hermetic_build/common/tests/resources/misc/TESTWORKSPACE @@ -0,0 +1,133 @@ +# test workspace file obtained from sdk-platform-java + +workspace(name = "gapic_generator_java") + +load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") + +# gax-java and its transitive dependencies must be imported before +# gapic-generator-java dependencies to match the order in googleapis repository, +# which in its turn, prioritizes actual generated clients runtime dependencies +# over the generator dependencies. +local_repository( + name = "com_google_api_gax_java", + path = "gax-java", +) + +load("@com_google_api_gax_java//:repository_rules.bzl", "com_google_api_gax_java_properties") + +com_google_api_gax_java_properties( + name = "com_google_api_gax_java_properties", + file = "@com_google_api_gax_java//:dependencies.properties", +) + +load("@com_google_api_gax_java//:repositories.bzl", "com_google_api_gax_java_repositories") + +com_google_api_gax_java_repositories() + +_googleapis_commit = "7438480b2a1bc6371d748e974f7a3647f90c4e8d" + +http_archive( + name = "com_google_googleapis", + strip_prefix = "googleapis-%s" % _googleapis_commit, + urls = [ + "https://github.com/googleapis/googleapis/archive/%s.zip" % _googleapis_commit, + ], +) + +# protobuf +RULES_JVM_EXTERNAL_TAG = "4.5" + +RULES_JVM_EXTERNAL_SHA = "b17d7388feb9bfa7f2fa09031b32707df529f26c91ab9e5d909eb1676badd9a6" + +http_archive( + name = "rules_jvm_external", + sha256 = RULES_JVM_EXTERNAL_SHA, + strip_prefix = "rules_jvm_external-%s" % RULES_JVM_EXTERNAL_TAG, + url = "https://github.com/bazelbuild/rules_jvm_external/archive/%s.zip" % RULES_JVM_EXTERNAL_TAG, +) + +load("@rules_jvm_external//:repositories.bzl", "rules_jvm_external_deps") + +rules_jvm_external_deps() + +load("@rules_jvm_external//:setup.bzl", "rules_jvm_external_setup") + +rules_jvm_external_setup() + +load("@com_google_protobuf//:protobuf_deps.bzl", "PROTOBUF_MAVEN_ARTIFACTS", "protobuf_deps") +load("@rules_jvm_external//:defs.bzl", "maven_install") + +maven_install( + artifacts = PROTOBUF_MAVEN_ARTIFACTS, + repositories = ["https://repo.maven.apache.org/maven2/"], +) + +_gapic_generator_java_version = "2.25.1-SNAPSHOT" # {x-version-update:gapic-generator-java:current} + +maven_install( + artifacts = [ + "com.google.api:gapic-generator-java:" + _gapic_generator_java_version, + ], + fail_on_missing_checksum = False, + repositories = [ + "m2Local", + "https://repo.maven.apache.org/maven2/", + ], +) + +protobuf_deps() + +# Bazel rules. +_rules_gapic_version = "0.5.5" + +http_archive( + name = "rules_gapic", + strip_prefix = "rules_gapic-%s" % _rules_gapic_version, + urls = ["https://github.com/googleapis/rules_gapic/archive/v%s.tar.gz" % _rules_gapic_version], +) + +# Java dependencies. +load("@com_google_googleapis//:repository_rules.bzl", "switched_rules_by_language") + +switched_rules_by_language( + name = "com_google_googleapis_imports", + gapic = True, + grpc = True, + java = True, +) + +load("@io_grpc_grpc_java//:repositories.bzl", "grpc_java_repositories") + +grpc_java_repositories() + +_disco_to_proto3_converter_commit = "ce8d8732120cdfb5bf4847c3238b5be8acde87e3" + +http_archive( + name = "com_google_disco_to_proto3_converter", + strip_prefix = "disco-to-proto3-converter-%s" % _disco_to_proto3_converter_commit, + urls = ["https://github.com/googleapis/disco-to-proto3-converter/archive/%s.zip" % _disco_to_proto3_converter_commit], +) + +# Showcase +_showcase_version = "0.28.2" + +http_archive( + name = "com_google_gapic_showcase", + strip_prefix = "gapic-showcase-%s" % _showcase_version, + urls = [ + "https://github.com/googleapis/gapic-showcase/archive/refs/tags/v%s.zip" % _showcase_version, + ], +) + +http_archive( + name = "rules_pkg", + sha256 = "8a298e832762eda1830597d64fe7db58178aa84cd5926d76d5b744d6558941c2", + urls = [ + "https://mirror.bazel.build/github.com/bazelbuild/rules_pkg/releases/download/0.7.0/rules_pkg-0.7.0.tar.gz", + "https://github.com/bazelbuild/rules_pkg/releases/download/0.7.0/rules_pkg-0.7.0.tar.gz", + ], +) + +load("@rules_pkg//:deps.bzl", "rules_pkg_dependencies") + +rules_pkg_dependencies() diff --git a/hermetic_build/common/tests/resources/misc/versions.txt b/hermetic_build/common/tests/resources/misc/versions.txt new file mode 100644 index 0000000000..e4258504e4 --- /dev/null +++ b/hermetic_build/common/tests/resources/misc/versions.txt @@ -0,0 +1,9 @@ +# test versions.txt obtained from sdk-platform-java + +gapic-generator-java:2.25.0:2.25.1-SNAPSHOT +api-common:2.16.0:2.16.1-SNAPSHOT +gax:2.33.0:2.33.1-SNAPSHOT +gax-grpc:2.34.0:2.33.1-SNAPSHOT +gax-httpjson:0.118.0:0.118.1-SNAPSHOT +proto-google-common-protos:2.24.0:2.24.1-SNAPSHOT +grpc-google-common-protos:2.24.0:2.24.1-SNAPSHOT diff --git a/hermetic_build/common/tests/resources/test-config/config_without_api_description.yaml b/hermetic_build/common/tests/resources/test-config/config_without_api_description.yaml new file mode 100644 index 0000000000..79ff135067 --- /dev/null +++ b/hermetic_build/common/tests/resources/test-config/config_without_api_description.yaml @@ -0,0 +1,5 @@ +gapic_generator_version: 2.34.0 +libraries: + - api_shortname: apigeeconnect + GAPICs: + - proto_path: google/cloud/apigeeconnect/v1 diff --git a/hermetic_build/common/tests/resources/test-config/config_without_api_shortname.yaml b/hermetic_build/common/tests/resources/test-config/config_without_api_shortname.yaml new file mode 100644 index 0000000000..ec8206be61 --- /dev/null +++ b/hermetic_build/common/tests/resources/test-config/config_without_api_shortname.yaml @@ -0,0 +1,4 @@ +gapic_generator_version: 2.34.0 +libraries: + - GAPICs: + - proto_path: google/cloud/apigeeconnect/v1 diff --git a/hermetic_build/common/tests/resources/test-config/config_without_gapics_key.yaml b/hermetic_build/common/tests/resources/test-config/config_without_gapics_key.yaml new file mode 100644 index 0000000000..739a4d9239 --- /dev/null +++ b/hermetic_build/common/tests/resources/test-config/config_without_gapics_key.yaml @@ -0,0 +1,3 @@ +gapic_generator_version: 2.34.0 +libraries: + - api_shortname: apigeeconnect diff --git a/hermetic_build/common/tests/resources/test-config/config_without_gapics_value.yaml b/hermetic_build/common/tests/resources/test-config/config_without_gapics_value.yaml new file mode 100644 index 0000000000..ec49e4a669 --- /dev/null +++ b/hermetic_build/common/tests/resources/test-config/config_without_gapics_value.yaml @@ -0,0 +1,4 @@ +gapic_generator_version: 2.34.0 +libraries: + - api_shortname: apigeeconnect + GAPICs: diff --git a/hermetic_build/common/tests/resources/test-config/config_without_googleapis.yaml b/hermetic_build/common/tests/resources/test-config/config_without_googleapis.yaml new file mode 100644 index 0000000000..e5a00ca4ee --- /dev/null +++ b/hermetic_build/common/tests/resources/test-config/config_without_googleapis.yaml @@ -0,0 +1,8 @@ +gapic_generator_version: 2.34.0 +libraries: + - api_shortname: apigeeconnect + name_pretty: Apigee Connect + api_description: "allows the Apigee hybrid management" + product_documentation: "https://cloud.google.com/apigee/docs/hybrid/v1.3/apigee-connect/" + GAPICs: + - proto_path: google/cloud/apigeeconnect/v1 diff --git a/hermetic_build/common/tests/resources/test-config/config_without_libraries.yaml b/hermetic_build/common/tests/resources/test-config/config_without_libraries.yaml new file mode 100644 index 0000000000..dbbe2ea318 --- /dev/null +++ b/hermetic_build/common/tests/resources/test-config/config_without_libraries.yaml @@ -0,0 +1 @@ +gapic_generator_version: 2.34.0 diff --git a/hermetic_build/common/tests/resources/test-config/config_without_library_value.yaml b/hermetic_build/common/tests/resources/test-config/config_without_library_value.yaml new file mode 100644 index 0000000000..174a293000 --- /dev/null +++ b/hermetic_build/common/tests/resources/test-config/config_without_library_value.yaml @@ -0,0 +1,2 @@ +gapic_generator_version: 2.34.0 +libraries: diff --git a/hermetic_build/common/tests/resources/test-config/config_without_name_pretty.yaml b/hermetic_build/common/tests/resources/test-config/config_without_name_pretty.yaml new file mode 100644 index 0000000000..f8612ad9ca --- /dev/null +++ b/hermetic_build/common/tests/resources/test-config/config_without_name_pretty.yaml @@ -0,0 +1,6 @@ +gapic_generator_version: 2.34.0 +libraries: + - api_shortname: apigeeconnect + api_description: "allows the Apigee hybrid management" + GAPICs: + - proto_path: google/cloud/apigeeconnect/v1 diff --git a/hermetic_build/common/tests/resources/test-config/config_without_product_docs.yaml b/hermetic_build/common/tests/resources/test-config/config_without_product_docs.yaml new file mode 100644 index 0000000000..e3921d2c0d --- /dev/null +++ b/hermetic_build/common/tests/resources/test-config/config_without_product_docs.yaml @@ -0,0 +1,7 @@ +gapic_generator_version: 2.34.0 +libraries: + - api_shortname: apigeeconnect + name_pretty: Apigee Connect + api_description: "allows the Apigee hybrid management" + GAPICs: + - proto_path: google/cloud/apigeeconnect/v1 diff --git a/hermetic_build/common/tests/resources/test-config/config_without_proto_path.yaml b/hermetic_build/common/tests/resources/test-config/config_without_proto_path.yaml new file mode 100644 index 0000000000..e37b0cef63 --- /dev/null +++ b/hermetic_build/common/tests/resources/test-config/config_without_proto_path.yaml @@ -0,0 +1,4 @@ +gapic_generator_version: 2.34.0 +libraries: + - GAPICs: + - random_key: diff --git a/hermetic_build/common/tests/resources/test-config/generation_config.yaml b/hermetic_build/common/tests/resources/test-config/generation_config.yaml new file mode 100644 index 0000000000..94fb1c8337 --- /dev/null +++ b/hermetic_build/common/tests/resources/test-config/generation_config.yaml @@ -0,0 +1,23 @@ +gapic_generator_version: 2.34.0 +googleapis_commitish: 1a45bf7393b52407188c82e63101db7dc9c72026 +libraries_bom_version: 26.37.0 +libraries: + - api_shortname: cloudasset + name_pretty: Cloud Asset Inventory + product_documentation: "https://cloud.google.com/resource-manager/docs/cloud-asset-inventory/overview" + api_description: "provides inventory services based on a time series database." + library_name: "asset" + client_documentation: "https://cloud.google.com/java/docs/reference/google-cloud-asset/latest/overview" + distribution_name: "com.google.cloud:google-cloud-asset" + release_level: "stable" + issue_tracker: "https://issuetracker.google.com/issues/new?component=187210&template=0" + api_reference: "https://cloud.google.com/resource-manager/docs/cloud-asset-inventory/overview" + codeowner_team: "@googleapis/analytics-dpe" + excluded_poms: proto-google-iam-v1-bom,google-iam-policy,proto-google-iam-v1 + excluded_dependencies: google-iam-policy + GAPICs: + - proto_path: google/cloud/asset/v1 + - proto_path: google/cloud/asset/v1p1beta1 + - proto_path: google/cloud/asset/v1p2beta1 + - proto_path: google/cloud/asset/v1p5beta1 + - proto_path: google/cloud/asset/v1p7beta1 diff --git a/hermetic_build/common/tests/utils/__init__.py b/hermetic_build/common/tests/utils/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/hermetic_build/common/tests/utils/generation_config_comparator_unit_tests.py b/hermetic_build/common/tests/utils/generation_config_comparator_unit_tests.py new file mode 100644 index 0000000000..4d45c6531c --- /dev/null +++ b/hermetic_build/common/tests/utils/generation_config_comparator_unit_tests.py @@ -0,0 +1,502 @@ +# 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 +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT 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 unittest + +from common.model.gapic_config import GapicConfig +from common.model.generation_config import GenerationConfig +from common.model.library_config import LibraryConfig +from common.utils.generation_config_comparator import ChangeType +from common.utils.generation_config_comparator import compare_config + + +class GenerationConfigComparatorTest(unittest.TestCase): + def setUp(self) -> None: + self.baseline_library = LibraryConfig( + api_shortname="existing_library", + api_description="", + name_pretty="", + product_documentation="", + gapic_configs=[], + ) + self.current_library = LibraryConfig( + api_shortname="existing_library", + api_description="", + name_pretty="", + product_documentation="", + gapic_configs=[], + ) + self.baseline_config = GenerationConfig( + gapic_generator_version="", + googleapis_commitish="", + libraries=[self.baseline_library], + ) + self.current_config = GenerationConfig( + gapic_generator_version="", + googleapis_commitish="", + libraries=[self.current_library], + ) + + def test_compare_config_not_change(self): + result = compare_config( + baseline_config=self.baseline_config, + current_config=self.current_config, + ) + self.assertTrue(len(result.change_to_libraries) == 0) + + def test_compare_config_googleapis_update(self): + self.baseline_config.googleapis_commitish = ( + "1a45bf7393b52407188c82e63101db7dc9c72026" + ) + self.current_config.googleapis_commitish = ( + "1e6517ef4f949191c9e471857cf5811c8abcab84" + ) + result = compare_config( + baseline_config=self.baseline_config, + current_config=self.current_config, + ) + self.assertEqual({ChangeType.GOOGLEAPIS_COMMIT: []}, result.change_to_libraries) + + def test_compare_config_generator_update(self): + self.baseline_config.gapic_generator_version = "1.2.3" + self.current_config.gapic_generator_version = "1.2.4" + result = compare_config( + baseline_config=self.baseline_config, + current_config=self.current_config, + ) + self.assertTrue( + len(result.change_to_libraries[ChangeType.REPO_LEVEL_CHANGE]) == 1 + ) + config_change = result.change_to_libraries[ChangeType.REPO_LEVEL_CHANGE][0] + self.assertEqual("gapic_generator_version", config_change.changed_param) + self.assertEqual("1.2.4", config_change.current_value) + + def test_compare_config_libraries_bom_update(self): + self.baseline_config.libraries_bom_version = "26.36.0" + self.current_config.libraries_bom_version = "26.37.0" + result = compare_config( + baseline_config=self.baseline_config, + current_config=self.current_config, + ) + self.assertTrue( + len(result.change_to_libraries[ChangeType.REPO_LEVEL_CHANGE]) == 1 + ) + config_change = result.change_to_libraries[ChangeType.REPO_LEVEL_CHANGE][0] + self.assertEqual("libraries_bom_version", config_change.changed_param) + self.assertEqual("26.37.0", config_change.current_value) + + def test_compare_protobuf_update(self): + self.baseline_config.protoc_version = "3.25.2" + self.current_config.protoc_version = "3.27.0" + result = compare_config( + baseline_config=self.baseline_config, + current_config=self.current_config, + ) + self.assertTrue( + len(result.change_to_libraries[ChangeType.REPO_LEVEL_CHANGE]) == 1 + ) + config_change = result.change_to_libraries[ChangeType.REPO_LEVEL_CHANGE][0] + self.assertEqual("protoc_version", config_change.changed_param) + self.assertEqual("3.27.0", config_change.current_value) + + def test_compare_config_grpc_update(self): + self.baseline_config.grpc_version = "1.60.0" + self.current_config.grpc_version = "1.61.0" + result = compare_config( + baseline_config=self.baseline_config, + current_config=self.current_config, + ) + self.assertTrue( + len(result.change_to_libraries[ChangeType.REPO_LEVEL_CHANGE]) == 1 + ) + config_change = result.change_to_libraries[ChangeType.REPO_LEVEL_CHANGE][0] + self.assertEqual("grpc_version", config_change.changed_param) + self.assertEqual("1.61.0", config_change.current_value) + + def test_compare_config_template_excludes_update(self): + self.baseline_config.template_excludes = [".github/*", ".kokoro/*"] + self.current_config.template_excludes = [ + ".github/*", + ".kokoro/*", + "samples/*", + "CODE_OF_CONDUCT.md", + ] + result = compare_config( + baseline_config=self.baseline_config, + current_config=self.current_config, + ) + self.assertTrue( + len(result.change_to_libraries[ChangeType.REPO_LEVEL_CHANGE]) == 1 + ) + config_change = result.change_to_libraries[ChangeType.REPO_LEVEL_CHANGE][0] + self.assertEqual("template_excludes", config_change.changed_param) + self.assertEqual( + [ + ".github/*", + ".kokoro/*", + "samples/*", + "CODE_OF_CONDUCT.md", + ], + config_change.current_value, + ) + + def test_compare_config_library_addition(self): + self.current_config.libraries.append( + LibraryConfig( + api_shortname="new_library", + api_description="", + name_pretty="", + product_documentation="", + gapic_configs=[], + ) + ) + result = compare_config( + baseline_config=self.baseline_config, + current_config=self.current_config, + ) + self.assertTrue( + len(result.change_to_libraries[ChangeType.LIBRARIES_ADDITION]) == 1 + ) + config_change = result.change_to_libraries[ChangeType.LIBRARIES_ADDITION][0] + self.assertEqual("new_library", config_change.library_name) + + def test_compare_config_library_removal_does_not_have_repo_or_library_level_change( + self, + ): + self.current_config.libraries = [] + result = compare_config( + baseline_config=self.baseline_config, + current_config=self.current_config, + ) + self.assertTrue( + len(result.change_to_libraries[ChangeType.REPO_LEVEL_CHANGE]) == 0 + ) + self.assertTrue( + len(result.change_to_libraries[ChangeType.LIBRARY_LEVEL_CHANGE]) == 0 + ) + + def test_compare_config_api_shortname_update_without_library_name(self): + self.current_config.libraries[0].api_shortname = "new_api_shortname" + result = compare_config( + baseline_config=self.baseline_config, + current_config=self.current_config, + ) + self.assertTrue( + len(result.change_to_libraries[ChangeType.LIBRARIES_ADDITION]) == 1 + ) + config_change = result.change_to_libraries[ChangeType.LIBRARIES_ADDITION][0] + self.assertEqual("new_api_shortname", config_change.library_name) + + def test_compare_config_api_shortname_update_with_library_name_raise_error(self): + self.baseline_config.libraries[0].library_name = "old_library_name" + self.current_config.libraries[0].library_name = "old_library_name" + self.current_config.libraries[0].api_shortname = "new_api_shortname" + self.assertRaisesRegex( + ValueError, + r"api_shortname.*library_name", + compare_config, + self.baseline_config, + self.current_config, + ) + + def test_compare_config_library_name_update(self): + self.current_config.libraries[0].library_name = "new_library_name" + result = compare_config( + baseline_config=self.baseline_config, + current_config=self.current_config, + ) + self.assertTrue( + len(result.change_to_libraries[ChangeType.LIBRARIES_ADDITION]) == 1 + ) + config_change = result.change_to_libraries[ChangeType.LIBRARIES_ADDITION][0] + self.assertEqual("new_library_name", config_change.library_name) + + def test_compare_config_api_description_update(self): + self.current_config.libraries[0].api_description = "updated description" + result = compare_config( + baseline_config=self.baseline_config, + current_config=self.current_config, + ) + self.assertTrue( + len(result.change_to_libraries[ChangeType.LIBRARY_LEVEL_CHANGE]) == 1 + ) + config_change = result.change_to_libraries[ChangeType.LIBRARY_LEVEL_CHANGE][0] + self.assertEqual("api_description", config_change.changed_param) + self.assertEqual("updated description", config_change.current_value) + self.assertEqual("existing_library", config_change.library_name) + + def test_compare_config_name_pretty_update(self): + self.current_config.libraries[0].name_pretty = "new name" + result = compare_config( + baseline_config=self.baseline_config, + current_config=self.current_config, + ) + self.assertTrue( + len(result.change_to_libraries[ChangeType.LIBRARY_LEVEL_CHANGE]) == 1 + ) + config_change = result.change_to_libraries[ChangeType.LIBRARY_LEVEL_CHANGE][0] + self.assertEqual("name_pretty", config_change.changed_param) + self.assertEqual("new name", config_change.current_value) + self.assertEqual("existing_library", config_change.library_name) + + def test_compare_config_product_docs_update(self): + self.current_config.libraries[0].product_documentation = "new docs" + result = compare_config( + baseline_config=self.baseline_config, + current_config=self.current_config, + ) + self.assertTrue( + len(result.change_to_libraries[ChangeType.LIBRARY_LEVEL_CHANGE]) == 1 + ) + config_change = result.change_to_libraries[ChangeType.LIBRARY_LEVEL_CHANGE][0] + self.assertEqual("product_documentation", config_change.changed_param) + self.assertEqual("new docs", config_change.current_value) + self.assertEqual("existing_library", config_change.library_name) + + def test_compare_config_library_type_update(self): + self.current_config.libraries[0].library_type = "GAPIC_COMBO" + result = compare_config( + baseline_config=self.baseline_config, + current_config=self.current_config, + ) + self.assertTrue( + len(result.change_to_libraries[ChangeType.LIBRARY_LEVEL_CHANGE]) == 1 + ) + config_change = result.change_to_libraries[ChangeType.LIBRARY_LEVEL_CHANGE][0] + self.assertEqual("library_type", config_change.changed_param) + self.assertEqual("GAPIC_COMBO", config_change.current_value) + self.assertEqual("existing_library", config_change.library_name) + + def test_compare_config_release_level_update(self): + self.current_config.libraries[0].release_level = "STABLE" + result = compare_config( + baseline_config=self.baseline_config, + current_config=self.current_config, + ) + self.assertTrue( + len(result.change_to_libraries[ChangeType.LIBRARY_LEVEL_CHANGE]) == 1 + ) + config_change = result.change_to_libraries[ChangeType.LIBRARY_LEVEL_CHANGE][0] + self.assertEqual("release_level", config_change.changed_param) + self.assertEqual("STABLE", config_change.current_value) + self.assertEqual("existing_library", config_change.library_name) + + def test_compare_config_api_id_update(self): + self.current_config.libraries[0].api_id = "new_id" + result = compare_config( + baseline_config=self.baseline_config, + current_config=self.current_config, + ) + self.assertTrue( + len(result.change_to_libraries[ChangeType.LIBRARY_LEVEL_CHANGE]) == 1 + ) + config_change = result.change_to_libraries[ChangeType.LIBRARY_LEVEL_CHANGE][0] + self.assertEqual("api_id", config_change.changed_param) + self.assertEqual("new_id", config_change.current_value) + self.assertEqual("existing_library", config_change.library_name) + + def test_compare_config_api_reference_update(self): + self.current_config.libraries[0].api_reference = "new api_reference" + result = compare_config( + baseline_config=self.baseline_config, + current_config=self.current_config, + ) + self.assertTrue( + len(result.change_to_libraries[ChangeType.LIBRARY_LEVEL_CHANGE]) == 1 + ) + config_change = result.change_to_libraries[ChangeType.LIBRARY_LEVEL_CHANGE][0] + self.assertEqual("api_reference", config_change.changed_param) + self.assertEqual("new api_reference", config_change.current_value) + self.assertEqual("existing_library", config_change.library_name) + + def test_compare_config_code_owner_team_update(self): + self.current_config.libraries[0].codeowner_team = "new team" + result = compare_config( + baseline_config=self.baseline_config, + current_config=self.current_config, + ) + self.assertTrue( + len(result.change_to_libraries[ChangeType.LIBRARY_LEVEL_CHANGE]) == 1 + ) + config_change = result.change_to_libraries[ChangeType.LIBRARY_LEVEL_CHANGE][0] + self.assertEqual("codeowner_team", config_change.changed_param) + self.assertEqual("new team", config_change.current_value) + self.assertEqual("existing_library", config_change.library_name) + + def test_compare_config_excluded_deps_update(self): + self.current_config.libraries[0].excluded_dependencies = "group:artifact" + result = compare_config( + baseline_config=self.baseline_config, + current_config=self.current_config, + ) + self.assertTrue( + len(result.change_to_libraries[ChangeType.LIBRARY_LEVEL_CHANGE]) == 1 + ) + config_change = result.change_to_libraries[ChangeType.LIBRARY_LEVEL_CHANGE][0] + self.assertEqual("excluded_dependencies", config_change.changed_param) + self.assertEqual("group:artifact", config_change.current_value) + self.assertEqual("existing_library", config_change.library_name) + + def test_compare_config_excluded_poms_update(self): + self.current_config.libraries[0].excluded_poms = "pom.xml" + result = compare_config( + baseline_config=self.baseline_config, + current_config=self.current_config, + ) + self.assertTrue( + len(result.change_to_libraries[ChangeType.LIBRARY_LEVEL_CHANGE]) == 1 + ) + config_change = result.change_to_libraries[ChangeType.LIBRARY_LEVEL_CHANGE][0] + self.assertEqual("excluded_poms", config_change.changed_param) + self.assertEqual("pom.xml", config_change.current_value) + self.assertEqual("existing_library", config_change.library_name) + + def test_compare_config_client_docs_update(self): + self.current_config.libraries[0].client_documentation = "new client docs" + result = compare_config( + baseline_config=self.baseline_config, + current_config=self.current_config, + ) + self.assertTrue( + len(result.change_to_libraries[ChangeType.LIBRARY_LEVEL_CHANGE]) == 1 + ) + config_change = result.change_to_libraries[ChangeType.LIBRARY_LEVEL_CHANGE][0] + self.assertEqual("client_documentation", config_change.changed_param) + self.assertEqual("new client docs", config_change.current_value) + self.assertEqual("existing_library", config_change.library_name) + + def test_compare_config_distribution_name_update(self): + self.current_config.libraries[0].distribution_name = "new_group:new_artifact" + result = compare_config( + baseline_config=self.baseline_config, + current_config=self.current_config, + ) + self.assertTrue( + len(result.change_to_libraries[ChangeType.LIBRARY_LEVEL_CHANGE]) == 1 + ) + config_change = result.change_to_libraries[ChangeType.LIBRARY_LEVEL_CHANGE][0] + self.assertEqual("distribution_name", config_change.changed_param) + self.assertEqual("new_group:new_artifact", config_change.current_value) + self.assertEqual("existing_library", config_change.library_name) + + def test_compare_config_group_id_update(self): + self.current_config.libraries[0].group_id = "new_group" + result = compare_config( + baseline_config=self.baseline_config, + current_config=self.current_config, + ) + self.assertTrue( + len(result.change_to_libraries[ChangeType.LIBRARY_LEVEL_CHANGE]) == 1 + ) + config_change = result.change_to_libraries[ChangeType.LIBRARY_LEVEL_CHANGE][0] + self.assertEqual("group_id", config_change.changed_param) + self.assertEqual("new_group", config_change.current_value) + self.assertEqual("existing_library", config_change.library_name) + + def test_compare_config_issue_tracker_update(self): + self.current_config.libraries[0].issue_tracker = "new issue tracker" + result = compare_config( + baseline_config=self.baseline_config, + current_config=self.current_config, + ) + self.assertTrue( + len(result.change_to_libraries[ChangeType.LIBRARY_LEVEL_CHANGE]) == 1 + ) + config_change = result.change_to_libraries[ChangeType.LIBRARY_LEVEL_CHANGE][0] + self.assertEqual("issue_tracker", config_change.changed_param) + self.assertEqual("new issue tracker", config_change.current_value) + self.assertEqual("existing_library", config_change.library_name) + + def test_compare_config_rest_docs_update(self): + self.current_config.libraries[0].rest_documentation = "new rest docs" + result = compare_config( + baseline_config=self.baseline_config, + current_config=self.current_config, + ) + self.assertTrue( + len(result.change_to_libraries[ChangeType.LIBRARY_LEVEL_CHANGE]) == 1 + ) + config_change = result.change_to_libraries[ChangeType.LIBRARY_LEVEL_CHANGE][0] + self.assertEqual("rest_documentation", config_change.changed_param) + self.assertEqual("new rest docs", config_change.current_value) + self.assertEqual("existing_library", config_change.library_name) + + def test_compare_config_rpc_docs_update(self): + self.current_config.libraries[0].rpc_documentation = "new rpc docs" + result = compare_config( + baseline_config=self.baseline_config, + current_config=self.current_config, + ) + self.assertTrue( + len(result.change_to_libraries[ChangeType.LIBRARY_LEVEL_CHANGE]) == 1 + ) + config_change = result.change_to_libraries[ChangeType.LIBRARY_LEVEL_CHANGE][0] + self.assertEqual("rpc_documentation", config_change.changed_param) + self.assertEqual("new rpc docs", config_change.current_value) + self.assertEqual("existing_library", config_change.library_name) + + def test_compare_config_cloud_api_update(self): + self.current_config.libraries[0].cloud_api = False + result = compare_config( + baseline_config=self.baseline_config, + current_config=self.current_config, + ) + self.assertTrue( + len(result.change_to_libraries[ChangeType.LIBRARY_LEVEL_CHANGE]) == 1 + ) + config_change = result.change_to_libraries[ChangeType.LIBRARY_LEVEL_CHANGE][0] + self.assertEqual("cloud_api", config_change.changed_param) + self.assertEqual(False, config_change.current_value) + self.assertEqual("existing_library", config_change.library_name) + + def test_compare_config_requires_billing_update(self): + self.current_config.libraries[0].requires_billing = False + result = compare_config( + baseline_config=self.baseline_config, + current_config=self.current_config, + ) + self.assertTrue( + len(result.change_to_libraries[ChangeType.LIBRARY_LEVEL_CHANGE]) == 1 + ) + config_change = result.change_to_libraries[ChangeType.LIBRARY_LEVEL_CHANGE][0] + self.assertEqual("requires_billing", config_change.changed_param) + self.assertEqual(False, config_change.current_value) + self.assertEqual("existing_library", config_change.library_name) + + def test_compare_config_extra_versioned_mod_update(self): + self.current_config.libraries[0].extra_versioned_modules = "extra module" + result = compare_config( + baseline_config=self.baseline_config, + current_config=self.current_config, + ) + self.assertTrue( + len(result.change_to_libraries[ChangeType.LIBRARY_LEVEL_CHANGE]) == 1 + ) + config_change = result.change_to_libraries[ChangeType.LIBRARY_LEVEL_CHANGE][0] + self.assertEqual("extra_versioned_modules", config_change.changed_param) + self.assertEqual("extra module", config_change.current_value) + self.assertEqual("existing_library", config_change.library_name) + + def test_compare_config_version_addition(self): + self.current_config.libraries[0].gapic_configs = [ + GapicConfig(proto_path="google/new/library/v1") + ] + result = compare_config( + baseline_config=self.baseline_config, + current_config=self.current_config, + ) + self.assertTrue(len(result.change_to_libraries[ChangeType.GAPIC_ADDITION]) == 1) + config_change = result.change_to_libraries[ChangeType.GAPIC_ADDITION][0] + self.assertEqual("", config_change.changed_param) + self.assertEqual("google/new/library/v1", config_change.current_value) + self.assertEqual("existing_library", config_change.library_name) diff --git a/hermetic_build/common/tests/utils/proto_path_utils_unit_tests.py b/hermetic_build/common/tests/utils/proto_path_utils_unit_tests.py new file mode 100644 index 0000000000..80d7797571 --- /dev/null +++ b/hermetic_build/common/tests/utils/proto_path_utils_unit_tests.py @@ -0,0 +1,57 @@ +#!/usr/bin/env python3 +# 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. +import os +import unittest +from pathlib import Path +from common.utils.proto_path_utils import find_versioned_proto_path +from common.utils.proto_path_utils import ends_with_version + +script_dir = os.path.dirname(os.path.realpath(__file__)) +resources_dir = os.path.join(script_dir, "..", "resources") +test_config_dir = Path(os.path.join(resources_dir, "test-config")).resolve() + + +class ProtoPathsUtilsTest(unittest.TestCase): + def test_find_versioned_proto_path_nested_version_success(self): + proto_path = "google/cloud/aiplatform/v1/schema/predict/params/image_classification.proto" + expected = "google/cloud/aiplatform/v1" + self.assertEqual(expected, find_versioned_proto_path(proto_path)) + + def test_find_versioned_proto_path_success(self): + proto_path = "google/cloud/asset/v1p2beta1/assets.proto" + expected = "google/cloud/asset/v1p2beta1" + self.assertEqual(expected, find_versioned_proto_path(proto_path)) + + def test_find_versioned_proto_without_version_return_itself(self): + proto_path = "google/type/color.proto" + expected = "google/type/color.proto" + self.assertEqual(expected, find_versioned_proto_path(proto_path)) + + def test_ends_with_version_valid(self): + self.assertTrue(ends_with_version("google/cloud/gsuiteaddons/v1")) + self.assertTrue(ends_with_version("google/iam/v1beta")) + self.assertTrue(ends_with_version("google/iam/v2betav1")) + self.assertTrue(ends_with_version("google/cloud/alloydb/connectors/v1alpha")) + self.assertTrue(ends_with_version("v1")) + self.assertTrue(ends_with_version("anything/v123")) + + def test_ends_with_version_invalid(self): + self.assertFalse(ends_with_version("google/apps/script/type")) + self.assertFalse(ends_with_version("google/apps/script/type/docs")) + self.assertFalse( + ends_with_version("google/cloud/alloydb/connectors/v123/something") + ) + self.assertFalse(ends_with_version("")) + self.assertFalse(ends_with_version("noVersion")) diff --git a/hermetic_build/common/utils/generation_config_comparator.py b/hermetic_build/common/utils/generation_config_comparator.py new file mode 100644 index 0000000000..f41299ddc2 --- /dev/null +++ b/hermetic_build/common/utils/generation_config_comparator.py @@ -0,0 +1,284 @@ +# 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 +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +from collections import defaultdict +from typing import Any +from typing import Dict +from typing import List +from common.model.config_change import ChangeType +from common.model.config_change import ConfigChange +from common.model.config_change import LibraryChange +from common.model.config_change import HashLibrary +from common.model.gapic_config import GapicConfig +from common.model.generation_config import GenerationConfig +from common.model.library_config import LibraryConfig + + +def compare_config( + baseline_config: GenerationConfig, current_config: GenerationConfig +) -> ConfigChange: + """ + Compare two GenerationConfig object and output a mapping from ConfigChange + to a list of ConfigChange objects. + All libraries in the current configuration will be affected if one of the + repository level parameters is changed. + + :param baseline_config: the baseline GenerationConfig object + :param current_config: the current GenerationConfig object + :return: a ConfigChange objects. + """ + diff = defaultdict(list[LibraryChange]) + # Exclude `libraries` because an empty library list (e.g., by library + # removal) will cause this parameter appears in the sorted param list, + # which leads to unequal list of parameters. + excluded_params = {"libraries"} + baseline_params = __convert_params_to_sorted_list( + obj=baseline_config, excluded_params=excluded_params + ) + current_params = __convert_params_to_sorted_list( + obj=current_config, excluded_params=excluded_params + ) + + for baseline_param, current_param in zip(baseline_params, current_params): + if baseline_param == current_param: + continue + if baseline_param[0] == "googleapis_commitish": + diff[ChangeType.GOOGLEAPIS_COMMIT] = [] + else: + config_change = LibraryChange( + changed_param=current_param[0], + current_value=current_param[1], + ) + diff[ChangeType.REPO_LEVEL_CHANGE].append(config_change) + + __compare_libraries( + diff=diff, + baseline_library_configs=baseline_config.libraries, + current_library_configs=current_config.libraries, + ) + return ConfigChange( + change_to_libraries=diff, + baseline_config=baseline_config, + current_config=current_config, + ) + + +def __compare_libraries( + diff: Dict[ChangeType, list[LibraryChange]], + baseline_library_configs: List[LibraryConfig], + current_library_configs: List[LibraryConfig], +) -> None: + """ + Compare two lists of LibraryConfig and put the difference into a + given Dict. + + :param diff: a mapping from ConfigChange to a list of ConfigChange objects. + :param baseline_library_configs: a list of LibraryConfig object. + :param current_library_configs: a list of LibraryConfig object. + """ + baseline_libraries = __convert_to_hashed_library_dict(baseline_library_configs) + current_libraries = __convert_to_hashed_library_dict(current_library_configs) + changed_libraries = [] + # 1st round comparison. + for library_name, hash_library in baseline_libraries.items(): + # 1. find any library removed from baseline_libraries. + # a library is removed from baseline_libraries if the library_name + # is not in current_libraries. + # please see the reason of comment out these lines of code in the + # comment of ChangeType.LIBRARIES_REMOVAL. + # if library_name not in current_libraries: + # config_change = ConfigChange( + # changed_param="", current_value="", library_name=library_name + # ) + # diff[ChangeType.LIBRARIES_REMOVAL].append(config_change) + + # 2. find any library that exists in both configs but at least one + # parameter is changed, which means the hash value is different. + if ( + library_name in current_libraries + and hash_library.hash_value != current_libraries[library_name].hash_value + ): + changed_libraries.append(library_name) + # 2nd round comparison. + for library_name in current_libraries: + # find any library added to current_libraries. + # a library is added to current_libraries if the library_name + # is not in baseline_libraries. + if library_name not in baseline_libraries: + config_change = LibraryChange( + changed_param="", current_value="", library_name=library_name + ) + diff[ChangeType.LIBRARIES_ADDITION].append(config_change) + # 3rd round comparison. + __compare_changed_libraries( + diff=diff, + baseline_libraries=baseline_libraries, + current_libraries=current_libraries, + changed_libraries=changed_libraries, + ) + + +def __convert_to_hashed_library_dict( + libraries: List[LibraryConfig], +) -> Dict[str, HashLibrary]: + """ + Convert a list of LibraryConfig objects to a Dict. + For each library object, the key is the library_name of the object, the + value is a HashLibrary object. + + :param libraries: a list of LibraryConfig object. + :return: a mapping from library_name to HashLibrary object. + """ + return { + library.get_library_name(): HashLibrary(hash(library), library) + for library in libraries + } + + +def __compare_changed_libraries( + diff: Dict[ChangeType, list[LibraryChange]], + baseline_libraries: Dict[str, HashLibrary], + current_libraries: Dict[str, HashLibrary], + changed_libraries: List[str], +) -> None: + """ + Compare each library with the same library_name to find what parameters are + changed. + + :param diff: a mapping from ConfigChange to a list of ConfigChange objects. + :param baseline_libraries: a mapping from library_name to HashLibrary + object. + :param current_libraries: a mapping from library_name to HashLibrary object. + :param changed_libraries: a list of library_name of changed libraries. + :raise ValueError: if api_shortname of a library is changed but library_name + remains the same. + """ + for library_name in changed_libraries: + baseline_library = baseline_libraries[library_name].library + current_library = current_libraries[library_name].library + baseline_params = __convert_params_to_sorted_list(baseline_library) + current_params = __convert_params_to_sorted_list(current_library) + for baseline_param, current_param in zip(baseline_params, current_params): + if baseline_param == current_param: + continue + if baseline_param[0] == "api_shortname": + raise ValueError( + f"{library_name}: api_shortname must not change when library_name remains the same." + ) + else: + config_change = LibraryChange( + changed_param=current_param[0], + current_value=current_param[1], + library_name=library_name, + ) + diff[ChangeType.LIBRARY_LEVEL_CHANGE].append(config_change) + + # compare gapic_configs + baseline_gapic_configs = baseline_library.gapic_configs + current_gapic_configs = current_library.gapic_configs + __compare_gapic_configs( + diff=diff, + library_name=library_name, + baseline_gapic_configs=baseline_gapic_configs, + current_gapic_configs=current_gapic_configs, + ) + + +def __compare_gapic_configs( + diff: Dict[ChangeType, list[LibraryChange]], + library_name: str, + baseline_gapic_configs: List[GapicConfig], + current_gapic_configs: List[GapicConfig], +) -> None: + baseline_proto_paths = {config.proto_path for config in baseline_gapic_configs} + current_proto_paths = {config.proto_path for config in current_gapic_configs} + # 1st round of comparison, find any versioned proto_path is removed + # from baseline gapic configs. + # please see the reason of comment out these lines of code in the + # comment of ChangeType.GAPIC_REMOVAL. + # for proto_path in baseline_proto_paths: + # if proto_path in current_proto_paths: + # continue + # config_change = ConfigChange( + # changed_param="", current_value=proto_path, library_name=library_name + # ) + # diff[ChangeType.GAPIC_REMOVAL].append(config_change) + + # 2nd round of comparison, find any versioned proto_path is added + # to current gapic configs. + for proto_path in current_proto_paths: + if proto_path in baseline_proto_paths: + continue + config_change = LibraryChange( + changed_param="", current_value=proto_path, library_name=library_name + ) + diff[ChangeType.GAPIC_ADDITION].append(config_change) + + +def __convert_params_to_sorted_list(obj: Any, excluded_params=None) -> List[tuple]: + """ + Convert the parameter and its value of a given object to a sorted list of + tuples. + + Only the following types of parameters will be considered: + + - str + - bool + - list[str] + - None + + Note that built-in params, e.g., __str__, and methods will be skipped. + + :param obj: an object. + :param excluded_params: excluded params. + :return: a sorted list of tuples. + """ + if excluded_params is None: + excluded_params = set() + param_and_values = [] + for param, value in vars(obj).items(): + if ( + param in excluded_params + or param.startswith("__") # skip built-in params + or callable(getattr(obj, param)) # skip methods + # skip if the type of param is not one of the following types + # 1. str + # 2. bool + # 3. list[str] + # 4. None + or not ( + isinstance(getattr(obj, param), str) + or isinstance(getattr(obj, param), bool) + or __is_list_of_str(obj=obj, param=param) + or getattr(obj, param) is None + ) + ): + continue + param_and_values.append((param, value)) + return sorted(param_and_values) + + +def __is_list_of_str(obj: Any, param: str) -> bool: + """ + Returns True if the type of param of a given object is a list of str; False + otherwise. + + This method is a workaround of https://bugs.python.org/issue28339. + """ + value = getattr(obj, param) + if not isinstance(value, list): + return False + for v in value: + if not isinstance(v, str): + return False + return True diff --git a/hermetic_build/common/utils/proto_path_utils.py b/hermetic_build/common/utils/proto_path_utils.py new file mode 100644 index 0000000000..e28b4b0870 --- /dev/null +++ b/hermetic_build/common/utils/proto_path_utils.py @@ -0,0 +1,51 @@ +#!/usr/bin/env python3 +# 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. +import re + + +def find_versioned_proto_path(proto_path: str) -> str: + """ + Returns a versioned proto_path from a given proto_path; or proto_path itself + if it doesn't contain a versioned proto_path. + :param proto_path: a proto file path + :return: the versioned proto_path + """ + version_regex = re.compile(r"^v[1-9].*") + directories = proto_path.split("/") + for directory in directories: + result = version_regex.search(directory) + if result: + version = result[0] + idx = proto_path.find(version) + return proto_path[:idx] + version + return proto_path + + +def ends_with_version(proto_path: str) -> bool: + """ + Checks if a given proto_path string ends with a version identifier. + + :param proto_path: The proto_path string to check. + + :return: + True if the proto_path ends with a version, False otherwise. + """ + version_regex = re.compile(r"^v[1-9].*") + parts = proto_path.rsplit("/", 1) + if len(parts) > 1: + last_part = parts[1] + else: + last_part = parts[0] + return bool(version_regex.match(last_part)) diff --git a/hermetic_build/library_generation/__init__.py b/hermetic_build/library_generation/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/hermetic_build/library_generation/cli/entry_point.py b/hermetic_build/library_generation/cli/entry_point.py new file mode 100644 index 0000000000..417944c218 --- /dev/null +++ b/hermetic_build/library_generation/cli/entry_point.py @@ -0,0 +1,266 @@ +# 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 +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT 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 sys +from typing import Optional +import click as click +import shutil +from pathlib import Path +from library_generation.generate_repo import generate_from_yaml +from common.model.generation_config import GenerationConfig + + +@click.group(invoke_without_command=False) +@click.pass_context +@click.version_option(message="%(version)s") +def main(ctx): + pass + + +@main.command() +@click.option( + "--generation-config-path", + required=False, + default=None, + type=str, + help=""" + Absolute or relative path to a generation_config.yaml that contains the + metadata about library generation. + When not set, will use generation_config.yaml from --generation-input. + When neither this or --generation-input is set default to + generation_config.yaml in the current working directory + """, +) +@click.option( + "--generation-input", + required=False, + default=None, + type=str, + help=""" + Absolute or relative path to a input folder that contains + generation_config.yaml and versions.txt. + This is only used when --generation-config-path is not set. + When neither this or --generation-config-path is set default to + generation_config.yaml in the current working directory + """, +) +@click.option( + "--library-names", + required=False, + type=str, + default=None, + show_default=True, + help=""" + A list of library names that will be generated, separated by comma. + The library name of a library is the value of library_name or api_shortname, + if library_name is not specified, in the generation configuration. + + If neither --library-names or --api-path specified, all libraries in the + generation configuration will be generated. + """, +) +@click.option( + "--api-path", + required=False, + type=str, + default=None, + show_default=True, + help=""" + Path within the API root (e.g. googleapis) to the API to + generate/build/configure etc. This is expected to be a major-versioned + API directory, e.g. google/cloud/functions/v2. + + Takes precedence over --library-names when specidied. + If neither --library-names or --api-path specified, all libraries in the + generation configuration will be generated. + """, +) +@click.option( + "--repository-path", + "--output", + type=str, + default=".", + show_default=True, + help=""" + The repository path to which the generated files + will be sent. + If not specified, the repository will be generated to the current working + directory. + """, +) +@click.option( + "--api-definitions-path", + "--api-root", + type=str, + default=".", + show_default=True, + help=""" + The path to which the api definition (proto and service yaml) and its + dependencies resides. + If not specified, the path is the current working directory. + """, +) +def generate( + generation_config_path: Optional[str], + generation_input: Optional[str], + library_names: Optional[str], + api_path: Optional[str], + repository_path: str, + api_definitions_path: str, +): + """ + Generate libraries based on a generation config. + + If the `generation-config-path` is not specified the default generation + config, `$(pwd)/generation_config.yaml`, will be used. + + If `library_names` is specified, only libraries whose name can be found in + the generation config will be generated; otherwise all libraries in the + generation config will be generated. + + :raise FileNotFoundError if the specified generation config does not exist + or, in case `generation-config-path` is not specified, the default + generation config does not exist. + """ + __generate_repo_impl( + generation_config_path=generation_config_path, + generation_input=generation_input, + library_names=library_names, + api_path=api_path, + repository_path=repository_path, + api_definitions_path=api_definitions_path, + ) + + +def __generate_repo_impl( + generation_config_path: Optional[str], + generation_input: Optional[str], + library_names: Optional[str], + api_path: Optional[str], + repository_path: str, + api_definitions_path: str, +): + """ + Implementation method for generate(). + The decoupling of generate and __generate_repo_impl is + meant to allow testing of this implementation function. + """ + + # only use generation_input when generation_config_path is not provided and + # generation_input provided. generation_config_path should be deprecated after + # migration to 1pp. + default_generation_config_path = f"{os.getcwd()}/generation_config.yaml" + if generation_config_path is None and generation_input is not None: + print( + "generation_config_path is not provided, using generation-input folder provided" + ) + generation_config_path = f"{generation_input}/generation_config.yaml" + # copy versions.txt from generation_input to repository_path + # override if present. + _copy_versions_file(generation_input, repository_path) + if generation_config_path is None and generation_input is None: + print("Using default generation config path") + generation_config_path = default_generation_config_path + generation_config_path = os.path.abspath(generation_config_path) + if not os.path.isfile(generation_config_path): + raise FileNotFoundError( + f"Generation config {generation_config_path} does not exist." + ) + repository_path = os.path.abspath(repository_path) + api_definitions_path = os.path.abspath(api_definitions_path) + generation_config = GenerationConfig.from_yaml(generation_config_path) + include_library_names = _parse_library_name_from( + includes=library_names, generation_config=generation_config + ) + generate_from_yaml( + config=generation_config, + repository_path=repository_path, + api_definitions_path=api_definitions_path, + target_library_names=include_library_names, + target_api_path=api_path, + ) + + +def _copy_versions_file(generation_input_path, repository_path): + """ + Copies the versions.txt file from the generation_input folder to the repository_path. + Overrides the destination file if it already exists. + + Args: + generation_input_path (str): The path to the generation_input folder. + repository_path (str): The path to the repository folder. + """ + source_file = Path(generation_input_path) / "versions.txt" + destination_file = Path(repository_path) / "versions.txt" + + if not source_file.exists(): + destination_file.touch() + print( + f"generation-input does not contain versions.txt. " + f"Created empty versions file: {source_file}" + ) + return + try: + shutil.copy2(source_file, destination_file) + print(f"Copied '{source_file}' to '{destination_file}'") + except Exception as e: + print(f"An error occurred while copying the versions.txt: {e}") + raise # Re-raises the caught exception + + +def _needs_full_repo_generation(generation_config: GenerationConfig) -> bool: + """ + Whether you should need a full repo generation, i.e., generate all + libraries in the generation configuration. + """ + return ( + not generation_config.is_monorepo() + or generation_config.contains_common_protos() + ) + + +def _parse_library_name_from( + includes: Optional[str], generation_config: GenerationConfig +) -> Optional[list[str]]: + if includes is None or _needs_full_repo_generation(generation_config): + return None + return [library_name.strip() for library_name in includes.split(",")] + + +@main.command() +@click.option( + "--generation-config-path", + required=False, + type=str, + help=""" + Absolute or relative path to a generation_config.yaml. + Default to generation_config.yaml in the current working directory. + """, +) +def validate_generation_config(generation_config_path: str) -> None: + """ + Validate the given generation configuration. + """ + if generation_config_path is None: + generation_config_path = "generation_config.yaml" + try: + GenerationConfig.from_yaml(os.path.abspath(generation_config_path)) + print(f"{generation_config_path} is validated without any errors.") + except ValueError as err: + print(err) + sys.exit(1) + + +if __name__ == "__main__": + main() diff --git a/hermetic_build/library_generation/cli/generate_monorepo_gapic_bom.py b/hermetic_build/library_generation/cli/generate_monorepo_gapic_bom.py new file mode 100644 index 0000000000..b26a02c17f --- /dev/null +++ b/hermetic_build/library_generation/cli/generate_monorepo_gapic_bom.py @@ -0,0 +1,49 @@ +# 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 +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT 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 click as click + +from library_generation.utils.pom_generator import generate_gapic_bom + + +@click.group(invoke_without_command=False) +@click.pass_context +@click.version_option(message="%(version)s") +def main(ctx): + pass + + +@main.command() +@click.option( + "--repository-path", + required=True, + type=str, + help=""" + Path to which the generated pom.xml goes. + """, +) +@click.option( + "--versions-file", + required=True, + type=str, + help=""" + The file containing version of libraries. + Throw FileNotFoundError if the file doesn't exist. + """, +) +def generate(repository_path: str, versions_file: str) -> None: + generate_gapic_bom(repository_path=repository_path, versions_file=versions_file) + + +if __name__ == "__main__": + main() diff --git a/hermetic_build/library_generation/cli/generate_monorepo_root_pom.py b/hermetic_build/library_generation/cli/generate_monorepo_root_pom.py new file mode 100644 index 0000000000..8f129b63f0 --- /dev/null +++ b/hermetic_build/library_generation/cli/generate_monorepo_root_pom.py @@ -0,0 +1,39 @@ +# 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 +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT 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 click as click +from library_generation.utils.pom_generator import generate_root_pom + + +@click.group(invoke_without_command=False) +@click.pass_context +@click.version_option(message="%(version)s") +def main(ctx): + pass + + +@main.command() +@click.option( + "--repository-path", + required=True, + type=str, + help=""" + Path to which the generated pom.xml goes. + """, +) +def generate(repository_path: str) -> None: + generate_root_pom(repository_path=repository_path) + + +if __name__ == "__main__": + main() diff --git a/hermetic_build/library_generation/dockerignore b/hermetic_build/library_generation/dockerignore new file mode 100644 index 0000000000..7e978caea9 --- /dev/null +++ b/hermetic_build/library_generation/dockerignore @@ -0,0 +1,6 @@ +README.md +**/__pycache__/ +**/*.egg-info/ +**/output/ +**/build/ +**/google-cloud-java/ diff --git a/hermetic_build/library_generation/gapic-generator-java-wrapper b/hermetic_build/library_generation/gapic-generator-java-wrapper new file mode 100755 index 0000000000..3f1e7bd2e7 --- /dev/null +++ b/hermetic_build/library_generation/gapic-generator-java-wrapper @@ -0,0 +1,7 @@ +#!/usr/bin/env bash +set -e +wrapper_dir=$(dirname "$(realpath "${BASH_SOURCE[0]}")") +source "${wrapper_dir}/utils/utilities.sh" + +# Wrap gapic-generator-java.jar because protoc requires the plugin to be executable. +exec java -classpath "$(get_gapic_generator_location)" com.google.api.generator.Main diff --git a/hermetic_build/library_generation/generate_composed_library.py b/hermetic_build/library_generation/generate_composed_library.py new file mode 100755 index 0000000000..e9d14685c9 --- /dev/null +++ b/hermetic_build/library_generation/generate_composed_library.py @@ -0,0 +1,168 @@ +#!/usr/bin/env python3 +# 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. + +""" +This script allows generation of libraries that are composed of more than one +service version. It is achieved by calling `generate_library.sh` without +postprocessing for all service versions and then calling +postprocess_library.sh at the end, once all libraries are ready. + +Prerequisites +- Needs a folder named `output` in current working directory. This folder +is automatically detected by `generate_library.sh` and this script ensures it +contains the necessary folders and files, specifically: + - A "google" folder found in the googleapis/googleapis repository + - A "grafeas" folder found in the googleapis/googleapis repository +Note: googleapis repo is found in https://github.com/googleapis/googleapis. +""" + +import os +from pathlib import Path +from typing import List +import library_generation.utils.utilities as util +from common.model.generation_config import GenerationConfig +from common.model.gapic_config import GapicConfig +from common.model.gapic_inputs import GapicInputs +from common.model.library_config import LibraryConfig +from common.model.gapic_inputs import parse as parse_build_file +from library_generation.model.repo_config import RepoConfig + +script_dir = os.path.dirname(os.path.realpath(__file__)) + + +def generate_composed_library( + config: GenerationConfig, + library_path: str, + library: LibraryConfig, + repo_config: RepoConfig, +) -> None: + """ + Generate libraries composed of more than one service or service version + + :param config: a GenerationConfig object representing a parsed configuration + yaml + :param library_path: the path to which the generated file goes + :param library: a LibraryConfig object contained inside config, passed here + for convenience and to prevent all libraries to be processed + :param repo_config: + :return None + """ + output_folder = repo_config.output_folder + owlbot_cli_source_folder = util.sh_util("mktemp -d") + os.makedirs(f"{library_path}", exist_ok=True) + for gapic in library.get_sorted_gapic_configs(): + build_file_folder = Path(f"{output_folder}/{gapic.proto_path}").resolve() + print(f"build_file_folder: {build_file_folder}") + gapic_inputs = parse_build_file(build_file_folder, gapic.proto_path) + # generate postprocessing prerequisite files (.repo-metadata.json, .OwlBot-hermetic.yaml, + # owlbot.py) here because transport is parsed from BUILD.bazel, + # which lives in a versioned proto_path. The value of transport will be + # overridden by the config object if specified. Note that this override + # does not affect library generation but instead used only for + # generating postprocessing files such as README. + util.generate_postprocessing_prerequisite_files( + config=config, + library=library, + proto_path=util.remove_version_from(gapic.proto_path), + library_path=library_path, + transport=library.get_transport(gapic_inputs), + ) + temp_destination_path = f"java-{gapic.proto_path.replace('/','-')}" + effective_arguments = _construct_effective_arg( + base_arguments=[], + gapic=gapic, + gapic_inputs=gapic_inputs, + temp_destination_path=temp_destination_path, + generation_config=config, + library=library, + ) + print("arguments: ") + print(effective_arguments) + print(f"Generating library from {gapic.proto_path} to {library_path}") + util.run_process_and_print_output( + ["bash", f"{script_dir}/generate_library.sh", *effective_arguments], + "Library generation", + ) + + util.sh_util( + f'build_owlbot_cli_source_folder "{library_path}"' + + f' "{owlbot_cli_source_folder}" "{output_folder}/{temp_destination_path}"' + + f' "{gapic.proto_path}"', + cwd=output_folder, + ) + + library_version = repo_config.get_library_version( + artifact_id=library.get_artifact_id() + ) + # call postprocess library + util.run_process_and_print_output( + [ + f"{script_dir}/postprocess_library.sh", + f"{library_path}", + "", + repo_config.versions_file, + owlbot_cli_source_folder, + str(config.is_monorepo()).lower(), + config.libraries_bom_version, + library_version, + ], + "Library postprocessing", + ) + + +def _construct_effective_arg( + base_arguments: List[str], + gapic: GapicConfig, + gapic_inputs: GapicInputs, + temp_destination_path: str, + generation_config: GenerationConfig, + library: LibraryConfig, +) -> List[str]: + """ + Construct arguments consist attributes of a GAPIC library which used in + generate_library.sh + :param base_arguments: arguments consist of tooling versions + :param gapic: an object of GapicConfig + :param gapic_inputs: an object of GapicInput + :param temp_destination_path: the path to which the generated library goes + :return: arguments containing attributes to generate a GAPIC library + """ + arguments = list(base_arguments) + arguments += util.create_argument("proto_path", gapic) + arguments += [ + "--proto_only", + gapic_inputs.proto_only, + "--gapic_additional_protos", + gapic_inputs.additional_protos, + "--transport", + gapic_inputs.transport, + "--rest_numeric_enums", + gapic_inputs.rest_numeric_enum, + "--gapic_yaml", + gapic_inputs.gapic_yaml, + "--service_config", + gapic_inputs.service_config, + "--service_yaml", + gapic_inputs.service_yaml, + "--include_samples", + gapic_inputs.include_samples, + "--repo", + util.get_library_repository(generation_config, library), + "--artifact", + library.distribution_name, + ] + arguments += ["--destination_path", temp_destination_path] + + return arguments diff --git a/hermetic_build/library_generation/generate_library.sh b/hermetic_build/library_generation/generate_library.sh new file mode 100755 index 0000000000..e7c5896ea7 --- /dev/null +++ b/hermetic_build/library_generation/generate_library.sh @@ -0,0 +1,276 @@ +#!/usr/bin/env bash + +set -eo pipefail + +# parse input parameters +while [[ $# -gt 0 ]]; do +key="$1" +case $key in + -p|--proto_path) + proto_path="$2" + shift + ;; + -d|--destination_path) + destination_path="$2" + shift + ;; + --proto_only) + proto_only="$2" + shift + ;; + --gapic_additional_protos) + gapic_additional_protos="$2" + shift + ;; + --transport) + transport="$2" + shift + ;; + --rest_numeric_enums) + rest_numeric_enums="$2" + shift + ;; + --gapic_yaml) + gapic_yaml="$2" + shift + ;; + --service_config) + service_config="$2" + shift + ;; + --service_yaml) + service_yaml="$2" + shift + ;; + --include_samples) + include_samples="$2" + shift + ;; + --os_architecture) + os_architecture="$2" + shift + ;; + --repo) + repo="$2" + shift + ;; + --artifact) + artifact="$2" + shift + ;; + *) + echo "Invalid option: [$1]" + exit 1 + ;; +esac +shift # past argument or value +done + +script_dir=$(dirname "$(readlink -f "$0")") +# source utility functions +source "${script_dir}"/utils/utilities.sh +output_folder="$(get_output_folder)" + +if [ -z "${proto_only}" ]; then + proto_only="false" +fi + +if [ -z "${gapic_additional_protos}" ]; then + gapic_additional_protos="google/cloud/common_resources.proto" +fi + +if [ -z "${transport}" ]; then + transport="grpc" +fi + +if [ -z "${rest_numeric_enums}" ]; then + rest_numeric_enums="true" +fi + +if [ -z "${gapic_yaml}" ]; then + gapic_yaml="" +fi + +if [ -z "${service_config}" ]; then + service_config="" +fi + +if [ -z "${service_yaml}" ]; then + service_yaml="" +fi + +if [ -z "${include_samples}" ]; then + include_samples="true" +fi + +if [ -z "${os_architecture}" ]; then + os_architecture=$(detect_os_architecture) +fi + +if [ -z "${repo}" ]; then + repo="" +fi + +if [ -z "${artifact}" ]; then + artifact="" +fi + +temp_destination_path="${output_folder}/temp_preprocessed-$RANDOM" +mkdir -p "${output_folder}/${destination_path}" +if [ -d "${temp_destination_path}" ]; then + # we don't want the preprocessed sources of a previous run + rm -r "${temp_destination_path}" +fi +mkdir -p "${temp_destination_path}" +##################### Section 0 ##################### +# prepare tooling +##################################################### +# the order of services entries in gapic_metadata.json is relevant to the +# order of proto file, sort the proto files with respect to their bytes to +# get a fixed order. +folder_name=$(extract_folder_name "${destination_path}") +pushd "${output_folder}" +find_depth="" +case "${proto_path}" in + "google/api" | "google/cloud" | "google/rpc") + find_depth="-maxdepth 1" + ;; +esac +proto_files=$(find "${proto_path}" ${find_depth} -type f -name "*.proto" | LC_COLLATE=C sort) +# include or exclude certain protos in grpc plugin and gapic generator java. +case "${proto_path}" in + "google/cloud") + # this proto is excluded from //google/cloud:google-apps-script-type-java + removed_proto="google/cloud/common_resources.proto" + proto_files="${proto_files//${removed_proto}/}" + ;; + "google/cloud/aiplatform/v1beta1"*) + # this proto is excluded from //google/cloud/aiplatform/v1beta1/schema:schema_proto + removed_proto="google/cloud/aiplatform/v1beta1/schema/io_format.proto" + proto_files="${proto_files//${removed_proto}/}" + ;; + "google/cloud/filestore"*) + # this proto is included in //google/cloud/filestore/v1:google-cloud-filestore-v1-java + # and //google/cloud/filestore/v1beta1:google-cloud-filestore-v1-java + proto_files="${proto_files} google/cloud/common/operation_metadata.proto" + ;; + "google/cloud/oslogin"*) + # this proto is included in //google/cloud/oslogin/v1:google-cloud-oslogin-v1-java + # and //google/cloud/oslogin/v1beta1:google-cloud-oslogin-v1-java + proto_files="${proto_files} google/cloud/oslogin/common/common.proto" + ;; + "google/cloud/visionai/v1"*) + # this proto is excluded in //google/cloud/visionai/v1:google-cloud-visionai-v1-java + # we can remove this exclusion after cl/631529749 is submitted. + removed_proto="google/cloud/visionai/v1/prediction.proto" + proto_files="${proto_files//${removed_proto}/}" + ;; + "google/rpc") + # this proto is excluded from //google/rpc:google-rpc-java + removed_proto="google/rpc/http.proto" + proto_files="${proto_files//${removed_proto}/}" + ;; +esac + +protoc_path=$(get_protoc_location) +##################### Section 1 ##################### +# generate grpc-*/ +##################################################### +if [[ ! "${transport}" == "rest" ]]; then + # do not need to generate grpc-* if the transport is `rest`. + "${protoc_path}"/protoc "--plugin=protoc-gen-rpc-plugin=$(get_grpc_plugin_location)" \ + "--rpc-plugin_out=:${temp_destination_path}/java_grpc.jar" \ + ${proto_files} # Do not quote because this variable should not be treated as one long string. + # unzip java_grpc.jar to grpc-*/src/main/java + unzip_src_files "grpc" "${temp_destination_path}" + # remove empty files in grpc-*/src/main/java + remove_empty_files "grpc" "${temp_destination_path}" + # remove grpc version in *ServiceGrpc.java file so the content is identical with bazel build. + remove_grpc_version "${temp_destination_path}" +fi +###################### Section 2 ##################### +## generate gapic-*/, part of proto-*/, samples/ +###################################################### +if [[ "${proto_only}" == "false" ]]; then + "$protoc_path"/protoc --experimental_allow_proto3_optional \ + "--plugin=protoc-gen-java_gapic=${script_dir}/gapic-generator-java-wrapper" \ + "--java_gapic_out=metadata:${temp_destination_path}/java_gapic_srcjar_raw.srcjar.zip" \ + "--java_gapic_opt=$(get_gapic_opts "${transport}" "${rest_numeric_enums}" "${gapic_yaml}" "${service_config}" "${service_yaml}" "${repo}" "${artifact}")" \ + ${proto_files} ${gapic_additional_protos} + + unzip -o -q "${temp_destination_path}/java_gapic_srcjar_raw.srcjar.zip" -d "${temp_destination_path}" + # Sync'\''d to the output file name in Writer.java. + unzip -o -q "${temp_destination_path}/temp-codegen.srcjar" -d "${temp_destination_path}/java_gapic_srcjar" + # Resource name source files. + proto_dir=${temp_destination_path}/java_gapic_srcjar/proto/src/main/java + if [ ! -d "${proto_dir}" ]; then + # Some APIs don't have resource name helpers, like BigQuery v2. + # Create an empty file so we can finish building. Gating the resource name rule definition + # on file existences go against Bazel's design patterns, so we'll simply delete all empty + # files during the final packaging process (see java_gapic_pkg.bzl) + mkdir -p "${proto_dir}" + touch "${proto_dir}"/PlaceholderFile.java + fi + # move java_gapic_srcjar/src/main to gapic-*/src. + mv_src_files "gapic" "main" "${temp_destination_path}" + # remove empty files in gapic-*/src/main/java + remove_empty_files "gapic" "${temp_destination_path}" + # move java_gapic_srcjar/src/test to gapic-*/src + mv_src_files "gapic" "test" "${temp_destination_path}" + if [ "${include_samples}" == "true" ]; then + # move java_gapic_srcjar/samples/snippets to samples/snippets + mv_src_files "samples" "main" "${temp_destination_path}" + fi +fi +##################### Section 3 ##################### +# generate proto-*/ +##################################################### +# exclude certain protos to java compiler. +case "${proto_path}" in + "google/cloud/aiplatform/v1beta1"*) + # these protos are excluded from //google/cloud/aiplatform/v1beta1:google-cloud-aiplatform-v1beta1-java + prefix="google/cloud/aiplatform/v1beta1/schema" + protos="${prefix}/annotation_payload.proto ${prefix}/annotation_spec_color.proto ${prefix}/data_item_payload.proto ${prefix}/dataset_metadata.proto ${prefix}/geometry.proto" + for removed_proto in ${protos}; do + proto_files="${proto_files//${removed_proto}/}" + done + ;; +esac +"$protoc_path"/protoc "--java_out=${temp_destination_path}/java_proto.jar" ${proto_files} +if [[ "${proto_only}" == "false" ]]; then + # move java_gapic_srcjar/proto/src/main/java (generated resource name helper class) + # to proto-*/src/main + mv_src_files "proto" "main" "${temp_destination_path}" +fi +# unzip java_proto.jar to proto-*/src/main/java +unzip_src_files "proto" "${temp_destination_path}" +# remove empty files in proto-*/src/main/java +remove_empty_files "proto" "${temp_destination_path}" +case "${proto_path}" in + "google/cloud/aiplatform/v1beta1"*) + prefix="google/cloud/aiplatform/v1beta1/schema" + protos="${prefix}/annotation_payload.proto ${prefix}/annotation_spec_color.proto ${prefix}/data_item_payload.proto ${prefix}/dataset_metadata.proto ${prefix}/geometry.proto" + for added_proto in ${protos}; do + proto_files="${proto_files} ${added_proto}" + done + ;; +esac +# copy proto files to proto-*/src/main/proto +for proto_src in ${proto_files}; do + if [[ "${proto_src}" == "google/cloud/common/operation_metadata.proto" ]]; then + continue + fi + mkdir -p "${temp_destination_path}/proto-${folder_name}/src/main/proto" + rsync -R "${proto_src}" "${temp_destination_path}/proto-${folder_name}/src/main/proto" +done +popd # output_folder +##################### Section 4 ##################### +# rm tar files +##################################################### +pushd "${temp_destination_path}" +rm -rf java_gapic_srcjar java_gapic_srcjar_raw.srcjar.zip java_grpc.jar java_proto.jar temp-codegen.srcjar +popd # destination path + +cp -r ${temp_destination_path}/* "${output_folder}/${destination_path}" +rm -rf "${temp_destination_path}" +exit 0 diff --git a/hermetic_build/library_generation/generate_repo.py b/hermetic_build/library_generation/generate_repo.py new file mode 100755 index 0000000000..634ddffd38 --- /dev/null +++ b/hermetic_build/library_generation/generate_repo.py @@ -0,0 +1,154 @@ +#!/usr/bin/env python3 +# 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. +import copy +import shutil +from pathlib import Path +from typing import Optional +import library_generation.utils.utilities as util +from common.model.generation_config import GenerationConfig +from common.model.library_config import LibraryConfig +from common.utils.proto_path_utils import ends_with_version +from library_generation.generate_composed_library import generate_composed_library +from library_generation.utils.monorepo_postprocessor import monorepo_postprocessing + +from common.model.gapic_config import GapicConfig + + +def generate_from_yaml( + config: GenerationConfig, + repository_path: str, + api_definitions_path: str, + target_library_names: Optional[list[str]], + target_api_path: Optional[str] = None, +) -> None: + """ + Based on the generation config, generates libraries via + generate_composed_library.py + + :param config: a GenerationConfig object. + :param repository_path: The repository path to which the generated files + will be sent. + :param api_definitions_path: The path to where the api definition resides. + :param target_library_names: a list of libraries to be generated. + If specified, only the library whose library_name is in target_library_names + will be generated. + If specified with an empty list, then no library will be generated. + If not specified, all libraries in the configuration yaml will be generated. + """ + target_libraries = get_target_libraries( + config=config, + target_library_names=target_library_names, + target_api_path=target_api_path, + ) + repo_config = util.prepare_repo( + gen_config=config, library_config=target_libraries, repo_path=repository_path + ) + # copy api definition to output folder. + shutil.copytree(api_definitions_path, repo_config.output_folder, dirs_exist_ok=True) + for library_path, library in repo_config.get_libraries().items(): + print(f"generating library {library.get_library_name()}") + generate_composed_library( + config=config, + library_path=library_path, + library=library, + repo_config=repo_config, + ) + + if not config.is_monorepo() or config.contains_common_protos(): + return + + monorepo_postprocessing( + repository_path=repository_path, versions_file=repo_config.versions_file + ) + + # cleanup temp output folder + try: + shutil.rmtree(Path(repo_config.output_folder)) + print(f"Directory {repo_config.output_folder} and its contents removed.") + except OSError as e: + print(f"Error: {e} - Failed to remove directory {repo_config.output_folder}.") + raise + + +def get_target_libraries( + config: GenerationConfig, + target_library_names: list[str] = None, + target_api_path: Optional[str] = None, +) -> list[LibraryConfig]: + """ + Returns LibraryConfig objects whose library_name is in target_library_names. + + :param config: a GenerationConfig object. + :param target_library_names: library_name of target libraries. + If not specified, all libraries in the given config will be returned. + :return: LibraryConfig objects. + """ + if target_api_path is None: + return _get_target_libraries_from_name(config, target_library_names) + return _get_target_libraries_from_api_path(config, target_api_path) + + +def _get_target_libraries_from_name( + config: GenerationConfig, target_library_names: list[str] = None +) -> list[LibraryConfig]: + """ + Returns LibraryConfig objects whose library_name is in target_library_names. + + :param config: a GenerationConfig object. + :param target_library_names: library_name of target libraries. + If not specified, all libraries in the given config will be returned. + :return: LibraryConfig objects. + """ + if target_library_names is None: + return config.libraries + target_libraries = set(target_library_names) + return [ + library + for library in config.libraries + if library.get_library_name() in target_libraries + ] + + +def _get_target_libraries_from_api_path( + config: GenerationConfig, target_api_path: Optional[str] = None +) -> list[LibraryConfig]: + """ + Retrieves a copy of the LibraryConfig objects that contain the specified + target API path, without other proto_path versions that were not specified. + dependency proto_paths are kept. + + :param config: The GenerationConfig object. + :param target_api_path: The target proto path to search for. + + :return: + A list of LibraryConfig objects matching the target API path, or an + empty list if no matches are found. + """ + if not ends_with_version(target_api_path): + raise ValueError("api_path is not ending with a version is not supported") + target_libraries = [] + for library in config.libraries: + target_library = copy.deepcopy(library) + gapic_config_list = [] + for item in library.gapic_configs: + if item.proto_path == target_api_path or not ends_with_version( + item.proto_path + ): + gapic_config_list.append(GapicConfig(item.proto_path)) + if gapic_config_list: + target_library.set_gapic_configs(gapic_config_list) + target_libraries.append(target_library) + return target_libraries + return [] diff --git a/hermetic_build/library_generation/model/bom_config.py b/hermetic_build/library_generation/model/bom_config.py new file mode 100644 index 0000000000..b562407eb7 --- /dev/null +++ b/hermetic_build/library_generation/model/bom_config.py @@ -0,0 +1,45 @@ +#!/usr/bin/env python3 +# 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. + + +class BomConfig: + """ + Class that represents an entry in dependencyManagement section. + """ + + def __init__( + self, + group_id: str, + artifact_id: str, + version: str, + version_annotation: str, + is_import: bool = True, + ): + self.group_id = group_id + self.artifact_id = artifact_id + self.version = version + self.version_annotation = version_annotation + self.is_import = is_import + + def __lt__(self, another): + return self.group_id < another.group_id or ( + self.group_id == another.group_id and self.artifact_id < another.artifact_id + ) + + def __eq__(self, another): + return ( + self.group_id == another.group_id + and self.artifact_id == another.artifact_id + ) diff --git a/hermetic_build/library_generation/model/repo_config.py b/hermetic_build/library_generation/model/repo_config.py new file mode 100644 index 0000000000..e9af0a9820 --- /dev/null +++ b/hermetic_build/library_generation/model/repo_config.py @@ -0,0 +1,79 @@ +#!/usr/bin/env python3 +# 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. +from common.model.library_config import LibraryConfig + +GRPC_PREFIX = "grpc-" +PROTO_PREFIX = "proto-" +NEW_CLIENT_VERSION = "0.0.0" + + +class RepoConfig: + """ + Class that represents a generated repository + """ + + def __init__( + self, + output_folder: str, + libraries: dict[str, LibraryConfig], + versions_file: str, + ): + """ + Init a RepoConfig object + + :param output_folder: the path to which the generated repo goes + :param libraries: a mapping from library_path to LibraryConfig object + :param versions_file: the path of versions.txt used in post-processing + """ + self.output_folder = output_folder + self.libraries = libraries + self.versions_file = versions_file + self.library_versions = self.__parse_versions() + + def get_libraries(self) -> dict[str, LibraryConfig]: + return self.libraries + + def get_library_version(self, artifact_id: str) -> str: + """ + Returns the version of a given artifact ID. + If the artifact ID is not managed, i.e., a new client, returns `0.0.0`. + + :param artifact_id: the Maven artifact ID. + :return: the version of the artifact. + """ + return self.library_versions.get(artifact_id, NEW_CLIENT_VERSION) + + def __parse_versions(self) -> dict[str, str]: + """ + For a given versions.txt file (defined in self.versions_file) + creates a map of artifact-id to its version + + :return: a map "artifact-id -> version" + """ + library_versions = dict() + with open(self.versions_file) as f: + for line in f.readlines(): + sections = line.split(":") + # skip comments and empty lines. + if len(sections) != 3: + continue + artifact_id = sections[0] + released_version = sections[1] + if artifact_id.startswith(GRPC_PREFIX) or artifact_id.startswith( + PROTO_PREFIX + ): + continue + library_versions[artifact_id] = released_version + return library_versions diff --git a/hermetic_build/library_generation/owlbot/bin/entrypoint.sh b/hermetic_build/library_generation/owlbot/bin/entrypoint.sh new file mode 100755 index 0000000000..3118f32a2b --- /dev/null +++ b/hermetic_build/library_generation/owlbot/bin/entrypoint.sh @@ -0,0 +1,78 @@ +#!/bin/bash +# Copyright 2023 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT 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 is the entrypoint script for java owlbot. This is not intended to be +# called directly but rather be called from postproces_library.sh +# For reference, the positional arguments are +# 1: scripts_root: location of the root of the library_generation scripts. When +# in a Docker container, this value should be /src/ +# 2: versions_file: points to a versions.txt containing versions to be applied +# both to README and pom.xml files +# 3: is_monorepo: whether we are postprocessing a monorepo +# 4: libraries_bom_version: used to render the readme +# 5: library_version: used to render the readme + +# The scripts assumes the CWD is the folder where postprocessing is going to be +# applied + +set -ex +scripts_root=$1 +versions_file=$2 +is_monorepo=$3 +libraries_bom_version=$4 +library_version=$5 + +if [[ "${is_monorepo}" == "true" ]]; then + mv owl-bot-staging/* temp + rm -rf owl-bot-staging/ + mv temp owl-bot-staging +fi + +# templates as well as retrieving files from owl-bot-staging +echo "Retrieving files from owl-bot-staging directory..." +if [ -f "owlbot.py" ] +then + # we copy the templates to a temp folder because we need to do a special + # modification regarding libraries_bom_version that can't be handled by the + # synthtool library considering the way owlbot.py files are written + export SYNTHTOOL_TEMPLATES="${scripts_root}/owlbot/templates" + export SYNTHTOOL_LIBRARIES_BOM_VERSION="${libraries_bom_version}" + export SYNTHTOOL_LIBRARY_VERSION="${library_version}" + # defaults to run owlbot.py + python3 owlbot.py + unset SYNTHTOOL_TEMPLATES + unset SYNTHTOOL_LIBRARIES_BOM_VERSION + unset SYNTHTOOL_LIBRARY_VERSION +fi +echo "...done" + +# write or restore pom.xml files +echo "Generating missing pom.xml..." +python3 "${scripts_root}/owlbot/src/fix_poms.py" "${versions_file}" "${is_monorepo}" +echo "...done" + +# write or restore clirr-ignored-differences.xml +echo "Generating clirr-ignored-differences.xml..." +"${scripts_root}"/owlbot/bin/write_clirr_ignore.sh "${scripts_root}" +echo "...done" + +# fix license headers +echo "Fixing missing license headers..." +python3 "${scripts_root}/owlbot/src/fix-license-headers.py" +echo "...done" + +echo "Reformatting source..." +"${scripts_root}"/owlbot/bin/format_source.sh "${scripts_root}" +echo "...done" diff --git a/hermetic_build/library_generation/owlbot/bin/format_source.sh b/hermetic_build/library_generation/owlbot/bin/format_source.sh new file mode 100755 index 0000000000..efc51b8940 --- /dev/null +++ b/hermetic_build/library_generation/owlbot/bin/format_source.sh @@ -0,0 +1,50 @@ +#!/bin/bash +# Copyright 2023 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT 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 -e + +# Why OwlBot Java postprocessor does not use the formatter defined in pom.xml? +# It's because the postprocessor runs in a privileged (albeit limited) +# environment. We limit the risk of running somebody else's malicious Maven +# plugin code in the environment. + +# Find all the java files relative to the current directory and format them +# using google-java-format +scripts_root=$1 + +source "${scripts_root}/utils/utilities.sh" +list="$(find . -name '*.java' -not -path ".*/samples/snippets/generated/**/*" )" +tmp_file=$(mktemp) + +for file in $list; +do + if [[ $file =~ .*/samples/snippets/src/main/java/com/example/firestore/Quickstart.java ]]; + then + echo "File skipped formatting: $file" + elif [[ $file =~ .*/samples/snippets/src/.*/java/com/example/spanner/.*.java ]]; + then + echo "File skipped formatting: $file" + elif [[ $file =~ .*/test-jdk17/java/com/google/cloud/firestore/.*java ]]; + then + echo "File skipped formatting: $file" + else + echo $file >> $tmp_file + fi +done + +# use formatter downloaded in the Dockerfile. +cat $tmp_file | xargs java -jar "$(get_java_formatter_location)" --replace + +rm $tmp_file diff --git a/hermetic_build/library_generation/owlbot/bin/write_clirr_ignore.sh b/hermetic_build/library_generation/owlbot/bin/write_clirr_ignore.sh new file mode 100755 index 0000000000..d6925ef354 --- /dev/null +++ b/hermetic_build/library_generation/owlbot/bin/write_clirr_ignore.sh @@ -0,0 +1,34 @@ +#!/bin/bash +# Copyright 2023 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT 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 -e + +scripts_root=$1 +templates_dir=$(realpath $(dirname "${BASH_SOURCE[0]}")/../templates/clirr) + +# restore default clirr-ignored-differences.xml for protos if the file does not exist +for dir in `ls -d proto-google-*` +do + if [ ! -f "${dir}/clirr-ignored-differences.xml" ] + then + tmp_dir=$(mktemp -d -t ci-XXXXXXXXXX) + pushd ${dir} + pushd src/main/java + find * -name *OrBuilder.java | xargs dirname | sort -u | jq -Rns ' (inputs | rtrimstr("\n") | split("\n") ) as $data | {proto_paths: $data}' > ${tmp_dir}/paths.json + popd + python3 "${scripts_root}/owlbot/src/gen-template.py" --data=${tmp_dir}/paths.json --folder=${templates_dir} + popd + fi +done diff --git a/hermetic_build/library_generation/owlbot/src/fix-license-headers.py b/hermetic_build/library_generation/owlbot/src/fix-license-headers.py new file mode 100644 index 0000000000..6ca944bc69 --- /dev/null +++ b/hermetic_build/library_generation/owlbot/src/fix-license-headers.py @@ -0,0 +1,29 @@ +# Copyright 2023 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +from pathlib import Path +import glob +from synthtool.languages import java + +root = Path(".").resolve() + +# Until the generator generates license headers on generated proto +# classes, add the license headers in +for path in glob.glob("proto-*"): + java.fix_proto_headers(root / path) + +# Until the generator generates license headers on generated grpc +# classes, add the license headers in +for path in glob.glob("grpc-*"): + java.fix_grpc_headers(root / path, "unused") diff --git a/hermetic_build/library_generation/owlbot/src/fix_poms.py b/hermetic_build/library_generation/owlbot/src/fix_poms.py new file mode 100644 index 0000000000..9ee7514a4d --- /dev/null +++ b/hermetic_build/library_generation/owlbot/src/fix_poms.py @@ -0,0 +1,611 @@ +# Copyright 2023 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT 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 sys +import glob +import json +from xml.etree.ElementTree import ElementTree + +from lxml import etree +import os +import re +from typing import List, Mapping +from library_generation.owlbot.src.poms import module, templates + + +def load_versions(filename: str, default_group_id: str) -> Mapping[str, module.Module]: + if not os.path.isfile(filename): + return {} + modules = {} + with open(filename, "r") as fp: + for line in fp: + line = line.strip() + if line.startswith("#"): + continue + + parts = line.split(":") + if len(parts) == 3: + artifact_id = parts[0] + group_id = ( + # For artifact id starts with `proto-` or `grpc-`, we + # need special treatments to append `.api.grpc` suffix + # to its corresponding group id. + # For other artifact id, keep the existing group id. + # Other than the two aforementioned artifact id, do not + # assume artifact id always starts with `google-`. Known + # exception is ad-manager. + __proto_group_id(default_group_id) + if artifact_id.startswith("proto-") + or artifact_id.startswith("grpc-") + else default_group_id + ) + modules[artifact_id] = module.Module( + group_id=group_id, + artifact_id=artifact_id, + release_version=parts[1], + version=parts[2], + ) + return modules + + +def _find_dependency_index(dependencies, group_id, artifact_id) -> int: + try: + return next( + i + for i, x in enumerate(dependencies.getchildren()) + if _dependency_matches(x, group_id, artifact_id) + ) + except StopIteration: + return -1 + + +def _dependency_matches(node, group_id, artifact_id) -> bool: + artifact_node = node.find("{http://maven.apache.org/POM/4.0.0}artifactId") + group_node = node.find("{http://maven.apache.org/POM/4.0.0}groupId") + + if artifact_node is None or group_node is None: + return False + + return artifact_node.text.startswith(artifact_id) and group_node.text.startswith( + group_id + ) + + +def _is_cloud_client(existing_modules: List[module.Module]) -> bool: + proto_modules_len = 0 + grpc_modules_len = 0 + for artifact in existing_modules: + if artifact.startswith("proto-"): + proto_modules_len += 1 + if artifact.startswith("grpc-"): + grpc_modules_len += 1 + return proto_modules_len > 0 or grpc_modules_len > 0 + + +def update_cloud_pom( + filename: str, + proto_modules: List[module.Module], + grpc_modules: List[module.Module], + is_monorepo: bool, +): + tree = etree.parse(filename) + root = tree.getroot() + dependencies = root.find("{http://maven.apache.org/POM/4.0.0}dependencies") + + existing_dependencies = [ + m.find("{http://maven.apache.org/POM/4.0.0}artifactId").text + for m in dependencies + if m.find("{http://maven.apache.org/POM/4.0.0}artifactId") is not None + ] + + if is_monorepo: + _set_test_scoped_deps(dependencies) + + try: + grpc_index = _find_dependency_index( + dependencies, "com.google.api.grpc", "grpc-" + ) + except StopIteration: + grpc_index = _find_dependency_index(dependencies, "junit", "junit") + # insert grpc dependencies after junit + for m in grpc_modules: + if m.artifact_id not in existing_dependencies: + print(f"adding new test dependency {m.artifact_id}") + new_dependency = etree.Element( + "{http://maven.apache.org/POM/4.0.0}dependency" + ) + new_dependency.tail = "\n " + new_dependency.text = "\n " + new_group = etree.Element("{http://maven.apache.org/POM/4.0.0}groupId") + new_group.text = m.group_id + new_group.tail = "\n " + new_artifact = etree.Element( + "{http://maven.apache.org/POM/4.0.0}artifactId" + ) + new_artifact.text = m.artifact_id + new_artifact.tail = "\n " + new_scope = etree.Element("{http://maven.apache.org/POM/4.0.0}scope") + new_scope.text = "test" + new_scope.tail = "\n " + new_dependency.append(new_group) + new_dependency.append(new_artifact) + new_dependency.append(new_scope) + dependencies.insert(grpc_index + 1, new_dependency) + + try: + proto_index = _find_dependency_index( + dependencies, "com.google.api.grpc", "proto-" + ) + except StopIteration: + print("after protobuf") + proto_index = _find_dependency_index( + dependencies, "com.google.protobuf", "protobuf-java" + ) + # insert proto dependencies after protobuf-java + for m in proto_modules: + if m.artifact_id not in existing_dependencies: + if re.match(r"proto-.*-v\d+.*", m.artifact_id): + print(f"adding new dependency {m.artifact_id}") + new_dependency = etree.Element( + "{http://maven.apache.org/POM/4.0.0}dependency" + ) + new_dependency.tail = "\n " + new_dependency.text = "\n " + new_group = etree.Element("{http://maven.apache.org/POM/4.0.0}groupId") + new_group.text = m.group_id + new_group.tail = "\n " + new_artifact = etree.Element( + "{http://maven.apache.org/POM/4.0.0}artifactId" + ) + new_artifact.text = m.artifact_id + new_artifact.tail = "\n " + new_dependency.append(new_group) + new_dependency.append(new_artifact) + dependencies.insert(proto_index + 1, new_dependency) + + tree.write(filename, pretty_print=True, xml_declaration=True, encoding="utf-8") + + +def _set_test_scoped_deps(dependencies: list[ElementTree]) -> None: + """ + As of July 2024, we have two dependencies that should be declared as + test-scoped in a monorepo: grpc-google-common-protos and grpc-google-iam-v1. + HW libraries are treated as usual + :param dependencies: List of XML Objects representing a + """ + TEST_SCOPED_DEPENDENCIES = ["grpc-google-common-protos", "grpc-google-iam-v1"] + print( + 'converting dependencies "grpc-google-common-protos" and "grpc-google-iam-v1" to test-scoped' + ) + for d in dependencies: + artifact_query = "{http://maven.apache.org/POM/4.0.0}artifactId" + scope_query = "{http://maven.apache.org/POM/4.0.0}scope" + current_scope = d.find(scope_query) + artifact_id_elem = d.find(artifact_query) + if artifact_id_elem is None: + continue + artifact_id = artifact_id_elem.text + is_test_scoped = ( + current_scope.text == "test" if current_scope is not None else False + ) + if artifact_id in TEST_SCOPED_DEPENDENCIES and not is_test_scoped: + new_scope = etree.Element(scope_query) + new_scope.text = "test" + if current_scope is not None: + d.replace(current_scope, new_scope) + else: + d.append(new_scope) + new_scope.tail = "\n " + new_scope.getprevious().tail = "\n " + + +def update_parent_pom(filename: str, modules: List[module.Module]): + tree = etree.parse(filename) + root = tree.getroot() + + # BEGIN: update modules + existing = root.find("{http://maven.apache.org/POM/4.0.0}modules") + + module_names = [m.artifact_id for m in modules] + extra_modules = [ + m.text for i, m in enumerate(existing) if m.text not in module_names + ] + + modules_to_write = module_names + extra_modules + num_modules = len(modules_to_write) + + existing.clear() + existing.text = "\n " + for index, m in enumerate(modules_to_write): + new_module = etree.Element("{http://maven.apache.org/POM/4.0.0}module") + new_module.text = m + if index == num_modules - 1: + new_module.tail = "\n " + else: + new_module.tail = "\n " + existing.append(new_module) + + existing.tail = "\n\n " + # END: update modules + + # BEGIN: update versions in dependencyManagement + dependencies = root.find( + "{http://maven.apache.org/POM/4.0.0}dependencyManagement" + ).find("{http://maven.apache.org/POM/4.0.0}dependencies") + + existing_dependencies = [ + m.find("{http://maven.apache.org/POM/4.0.0}artifactId").text + for m in dependencies + if m.find("{http://maven.apache.org/POM/4.0.0}artifactId") is not None + ] + insert_index = 1 + + num_modules = len(modules) + + for index, m in enumerate(modules): + if m.artifact_id in existing_dependencies: + continue + + new_dependency = etree.Element("{http://maven.apache.org/POM/4.0.0}dependency") + new_dependency.tail = "\n " + new_dependency.text = "\n " + new_group = etree.Element("{http://maven.apache.org/POM/4.0.0}groupId") + new_group.text = m.group_id + new_group.tail = "\n " + new_artifact = etree.Element("{http://maven.apache.org/POM/4.0.0}artifactId") + new_artifact.text = m.artifact_id + new_artifact.tail = "\n " + new_version = etree.Element("{http://maven.apache.org/POM/4.0.0}version") + new_version.text = m.version + comment = etree.Comment(" {x-version-update:" + m.artifact_id + ":current} ") + comment.tail = "\n " + new_dependency.append(new_group) + new_dependency.append(new_artifact) + new_dependency.append(new_version) + new_dependency.append(comment) + new_dependency.tail = "\n " + dependencies.insert(1, new_dependency) + + # END: update versions in dependencyManagement + + tree.write(filename, pretty_print=True, xml_declaration=True, encoding="utf-8") + + +def update_bom_pom(filename: str, modules: List[module.Module]): + tree = etree.parse(filename) + root = tree.getroot() + existing = root.find( + "{http://maven.apache.org/POM/4.0.0}dependencyManagement" + ).find("{http://maven.apache.org/POM/4.0.0}dependencies") + + num_modules = len(modules) + + existing.clear() + existing.text = "\n " + for index, m in enumerate(modules): + new_dependency = etree.Element("{http://maven.apache.org/POM/4.0.0}dependency") + new_dependency.tail = "\n " + new_dependency.text = "\n " + new_group = etree.Element("{http://maven.apache.org/POM/4.0.0}groupId") + new_group.text = m.group_id + new_group.tail = "\n " + new_artifact = etree.Element("{http://maven.apache.org/POM/4.0.0}artifactId") + new_artifact.text = m.artifact_id + new_artifact.tail = "\n " + new_version = etree.Element("{http://maven.apache.org/POM/4.0.0}version") + new_version.text = m.version + comment = etree.Comment(" {x-version-update:" + m.artifact_id + ":current} ") + comment.tail = "\n " + new_dependency.append(new_group) + new_dependency.append(new_artifact) + new_dependency.append(new_version) + new_dependency.append(comment) + + if index == num_modules - 1: + new_dependency.tail = "\n " + else: + new_dependency.tail = "\n " + existing.append(new_dependency) + + existing.tail = "\n " + + tree.write(filename, pretty_print=True, xml_declaration=True, encoding="utf-8") + + +# When generating non-cloud client library, the group id of proto/grpc artifacts +# is prefixed with `{main_artifact_group_id}.api.grpc`, rather than +# `com.google.api.grpc`. +# https://github.com/googleapis/google-cloud-java/issues/9125 +# However, some exceptions are com.google.area120 and com.google.analytics. +# https://github.com/googleapis/google-cloud-java/issues/9304 +def __proto_group_id(main_artifact_group_id: str) -> str: + prefix = "com.google" + list_of_group_id = [ + "com.google.cloud", + "com.google.area120", + "com.google.analytics", + ] + if main_artifact_group_id not in list_of_group_id: + prefix = main_artifact_group_id + return f"{prefix}.api.grpc" + + +def __get_monorepo_version(versions: str) -> str: + """ + Returns the current version of google-cloud-java in the given version file + :param versions: the versions.txt + :return: the current version of google-cloud-java + """ + with open(versions, "r") as f: + for line in f.readlines(): + if "google-cloud-java" in line: + return line.split(":")[-1].strip() + + +def main(versions_file, monorepo): + print(f"working directory: {os.getcwd()}") + with open(".repo-metadata.json", "r") as fp: + repo_metadata = json.load(fp) + group_id, artifact_id = repo_metadata["distribution_name"].split(":") + name = repo_metadata["name_pretty"] + existing_modules = load_versions(versions_file, group_id) + print(f"monorepo? {monorepo}") + + # extra modules that need to be manages in versions.txt + if "extra_versioned_modules" in repo_metadata: + extra_managed_modules = repo_metadata["extra_versioned_modules"].split(",") + else: + extra_managed_modules = "" + + # list of modules to be excluded from added to poms + if "excluded_dependencies" in repo_metadata: + excluded_dependencies_list = repo_metadata["excluded_dependencies"].split(",") + else: + excluded_dependencies_list = "" + + # list of poms that have to be excluded from post processing + if "excluded_poms" in repo_metadata: + excluded_poms_list = repo_metadata["excluded_poms"].split(",") + else: + excluded_poms_list = "" + + # Missing Case 1: When this library ('java-XXX' module) is new. + if artifact_id not in existing_modules: + existing_modules[artifact_id] = module.Module( + group_id=group_id, + artifact_id=artifact_id, + version="0.0.1-SNAPSHOT", + release_version="0.0.0", + ) + main_module = existing_modules[artifact_id] + + # Artifact ID is part of distribution name field in .repo-metadata.json + if artifact_id in [ + "grafeas", + "google-cloud-dns", + "google-cloud-notification", + "google-iam-policy", + ]: + # There are special libraries that are not automatically generated + print( + f"Skipping a special case library {artifact_id} that do not have " + " the standard module structure." + ) + return + + parent_artifact_id = f"{artifact_id}-parent" + + if parent_artifact_id not in existing_modules: + existing_modules[parent_artifact_id] = module.Module( + group_id=group_id, + artifact_id=parent_artifact_id, + version=main_module.version, + release_version=main_module.release_version, + ) + parent_module = existing_modules[parent_artifact_id] + + required_dependencies = {} + for dependency_module in existing_modules: + if dependency_module in excluded_dependencies_list: + continue + dep_artifact_id = existing_modules[dependency_module].artifact_id + if monorepo and not os.path.isdir(dep_artifact_id): + # In monorepo, existing_modules are loaded from the root + # versions.txt and thus includes irrelevant artifacts + continue + required_dependencies[dependency_module] = existing_modules[dependency_module] + + # Missing Case 2: There's a new proto-XXX and grpc-XXX directory. It's a new + # version in the proto file to a library. Both a new library and existing + # library. + for path in glob.glob("proto-*"): + if not path in existing_modules: + existing_modules[path] = module.Module( + group_id=__proto_group_id(group_id), + artifact_id=path, + version=main_module.version, + release_version=main_module.release_version, + ) + if ( + path not in excluded_dependencies_list + and path not in main_module.artifact_id + ): + required_dependencies[path] = module.Module( + group_id=__proto_group_id(group_id), + artifact_id=path, + version=main_module.version, + release_version=main_module.release_version, + ) + if not os.path.isfile(f"{path}/pom.xml"): + print(f"creating missing proto pom: {path}") + templates.render( + template_name="proto_pom.xml.j2", + output_name=f"{path}/pom.xml", + module=required_dependencies[path], + parent_module=parent_module, + main_module=main_module, + monorepo=monorepo, + ) + if ( + path not in excluded_dependencies_list + and path not in main_module.artifact_id + ): + required_dependencies[path] = module.Module( + group_id=__proto_group_id(group_id), + artifact_id=path, + version=main_module.version, + release_version=main_module.release_version, + ) + + for path in glob.glob("grpc-*"): + if not path in existing_modules: + existing_modules[path] = module.Module( + group_id=__proto_group_id(group_id), + artifact_id=path, + version=main_module.version, + release_version=main_module.release_version, + ) + if ( + path not in excluded_dependencies_list + and path not in main_module.artifact_id + ): + required_dependencies[path] = module.Module( + group_id=__proto_group_id(group_id), + artifact_id=path, + version=main_module.version, + release_version=main_module.release_version, + ) + + if not os.path.isfile(f"{path}/pom.xml"): + proto_artifact_id = path.replace("grpc-", "proto-") + print(f"creating missing grpc pom: {path}") + templates.render( + template_name="grpc_pom.xml.j2", + output_name=f"{path}/pom.xml", + module=required_dependencies[path], + parent_module=parent_module, + main_module=main_module, + proto_module=existing_modules[proto_artifact_id], + monorepo=monorepo, + ) + if ( + path not in excluded_dependencies_list + and path not in main_module.artifact_id + ): + required_dependencies[path] = module.Module( + group_id=__proto_group_id(group_id), + artifact_id=path, + version=main_module.version, + release_version=main_module.release_version, + ) + proto_modules = [ + module + for module in required_dependencies.values() + if module.artifact_id.startswith("proto-") + and module.artifact_id not in parent_artifact_id + ] + grpc_modules = [ + module + for module in required_dependencies.values() + if module.artifact_id.startswith("grpc-") + and module.artifact_id not in parent_artifact_id + ] + if main_module in grpc_modules or main_module in proto_modules: + modules = grpc_modules + proto_modules + else: + modules = [main_module] + grpc_modules + proto_modules + + if not _is_cloud_client(existing_modules): + print("no proto or grpc modules - probably not a cloud client") + return + + if os.path.isfile(f"{artifact_id}/pom.xml"): + print("updating modules in cloud pom.xml") + if artifact_id not in excluded_poms_list: + update_cloud_pom( + f"{artifact_id}/pom.xml", proto_modules, grpc_modules, monorepo + ) + elif artifact_id not in excluded_poms_list: + print("creating missing cloud pom.xml") + templates.render( + template_name="cloud_pom.xml.j2", + output_name=f"{artifact_id}/pom.xml", + module=main_module, + parent_module=parent_module, + repo=repo_metadata["repo"], + name=name, + description=repo_metadata["api_description"], + proto_modules=proto_modules, + grpc_modules=grpc_modules, + monorepo=monorepo, + ) + + if os.path.isfile(f"{artifact_id}-bom/pom.xml"): + print("updating modules in bom pom.xml") + if artifact_id + "-bom" not in excluded_poms_list: + update_bom_pom(f"{artifact_id}-bom/pom.xml", modules) + elif artifact_id + "-bom" not in excluded_poms_list: + print("creating missing bom pom.xml") + monorepo_version = __get_monorepo_version(versions_file) if monorepo else "" + templates.render( + template_name="bom_pom.xml.j2", + output_name=f"{artifact_id}-bom/pom.xml", + repo=repo_metadata["repo"], + name=name, + modules=modules, + main_module=main_module, + monorepo=monorepo, + monorepo_version=monorepo_version, + ) + + if os.path.isfile("pom.xml"): + print("updating modules in parent pom.xml") + update_parent_pom("pom.xml", modules) + else: + print("creating missing parent pom.xml") + monorepo_version = __get_monorepo_version(versions_file) if monorepo else "" + templates.render( + template_name="parent_pom.xml.j2", + output_name="./pom.xml", + repo=repo_metadata["repo"], + modules=modules, + main_module=main_module, + name=name, + monorepo=monorepo, + monorepo_version=monorepo_version, + ) + + print(f"updating modules in {versions_file}") + existing_modules.pop(parent_artifact_id) + + # add extra modules to versions.txt + for dependency_module in extra_managed_modules: + if dependency_module not in existing_modules: + existing_modules[dependency_module] = module.Module( + group_id=__proto_group_id(group_id), + artifact_id=dependency_module, + version=main_module.version, + release_version=main_module.release_version, + ) + templates.render( + template_name="versions.txt.j2", + output_name=versions_file, + modules=existing_modules.values(), + ) + + +if __name__ == "__main__": + versions_file = sys.argv[1] + monorepo = True if sys.argv[2].lower() == "true" else False + main(versions_file, monorepo) diff --git a/hermetic_build/library_generation/owlbot/src/gen-template.py b/hermetic_build/library_generation/owlbot/src/gen-template.py new file mode 100644 index 0000000000..30f8c43529 --- /dev/null +++ b/hermetic_build/library_generation/owlbot/src/gen-template.py @@ -0,0 +1,84 @@ +# Copyright 2023 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT 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 glob +import json +from typing import List +import os +from pathlib import Path + +import click +import jinja2 + + +@click.command() +@click.option( + "--folder", + help="Path to folder of templates", +) +@click.option("--file", help="Path to template file") +@click.option( + "--data", + help="Path to JSON file with template values", + multiple=True, + required=True, +) +@click.option( + "--output", + help="Path to output", + default=".", +) +def main(folder: str, file: str, data: List[str], output: str): + """Generate templates""" + variables = {} + for data_file in data: + with open(data_file, "r") as fp: + variables = {**variables, **json.load(fp)} + + if folder is not None: + location = Path(folder) + filenames = glob.glob(f"{folder}/**/*.j2", recursive=True) + elif file is not None: + location = Path(file).parent + filenames = [f"{file}.j2"] + else: + raise Exception("Need to specify either folder or file") + + output_path = Path(output) + + env = jinja2.Environment( + loader=jinja2.FileSystemLoader(str(location)), + autoescape=False, + keep_trailing_newline=True, + ) + + for filename in filenames: + template_name = Path(filename).relative_to(location) + template = env.get_template(str(template_name)) + output = template.stream(**variables) + + destination = output_path / os.path.splitext(template_name)[0] + destination.parent.mkdir(parents=True, exist_ok=True) + + with destination.open("w") as fp: + output.dump(fp) + + # Copy file mode over + source_path = Path(template.filename) + mode = source_path.stat().st_mode + destination.chmod(mode) + + +if __name__ == "__main__": + main() diff --git a/hermetic_build/library_generation/owlbot/src/poms/.gitignore b/hermetic_build/library_generation/owlbot/src/poms/.gitignore new file mode 100644 index 0000000000..c18dd8d83c --- /dev/null +++ b/hermetic_build/library_generation/owlbot/src/poms/.gitignore @@ -0,0 +1 @@ +__pycache__/ diff --git a/hermetic_build/library_generation/owlbot/src/poms/module.py b/hermetic_build/library_generation/owlbot/src/poms/module.py new file mode 100644 index 0000000000..b4274ea969 --- /dev/null +++ b/hermetic_build/library_generation/owlbot/src/poms/module.py @@ -0,0 +1,54 @@ +# Copyright 2023 Google LLC +# +# Licensed under the Apache License, Version 2.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. + +import attr +from lxml import etree +import os +from typing import List, Optional + + +@attr.s(auto_attribs=True) +class Module: + group_id: str + artifact_id: str + version: str + release_version: Optional[str] + + +def read_module(pom: str) -> Module: + tree = etree.parse(pom) + artifact_id = tree.find("{http://maven.apache.org/POM/4.0.0}artifactId").text + version = tree.find("{http://maven.apache.org/POM/4.0.0}version").text + group_id = ( + "com.google.cloud" + if artifact_id.startswith("google-cloud") + else "com.google.api.grpc" + ) + return Module( + group_id=group_id, + artifact_id=artifact_id, + version=version, + ) + + +def read_modules(service: str) -> List[Module]: + thedir = f"workspace/java-{service}/" + modules = [] + for name in os.listdir(thedir): + dir = os.path.join(thedir, name) + pom = os.path.join(dir, "pom.xml") + if os.path.exists(pom): + modules.append(read_module(pom)) + + return modules diff --git a/hermetic_build/library_generation/owlbot/src/poms/templates.py b/hermetic_build/library_generation/owlbot/src/poms/templates.py new file mode 100644 index 0000000000..d100a2bc5d --- /dev/null +++ b/hermetic_build/library_generation/owlbot/src/poms/templates.py @@ -0,0 +1,35 @@ +# Copyright 2023 Google LLC +# +# Licensed under the Apache License, Version 2.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. + +from jinja2 import Environment, FileSystemLoader +import os +import pathlib + +root_directory = pathlib.Path( + os.path.realpath(os.path.dirname(os.path.realpath(__file__))) +).parent.parent +print(root_directory) +jinja_env = Environment( + loader=FileSystemLoader(str(root_directory / "templates" / "poms")), + keep_trailing_newline=True, +) + + +def render(template_name: str, output_name: str, **kwargs): + template = jinja_env.get_template(template_name) + t = template.stream(kwargs) + directory = os.path.dirname(output_name) + if not os.path.isdir(directory): + os.makedirs(directory) + t.dump(str(output_name)) diff --git a/hermetic_build/library_generation/owlbot/synthtool/__init__.py b/hermetic_build/library_generation/owlbot/synthtool/__init__.py new file mode 100644 index 0000000000..e2d44deaf0 --- /dev/null +++ b/hermetic_build/library_generation/owlbot/synthtool/__init__.py @@ -0,0 +1,32 @@ +# 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 +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +"""Synthtool synthesizes libraries from disparate sources.""" + +from synthtool.transforms import ( + move, + replace, + get_staging_dirs, + remove_staging_dirs, +) + +copy = move + +__all__ = [ + "copy", + "move", + "replace", + "get_staging_dirs", + "remove_staging_dirs", +] diff --git a/hermetic_build/library_generation/owlbot/synthtool/_tracked_paths.py b/hermetic_build/library_generation/owlbot/synthtool/_tracked_paths.py new file mode 100644 index 0000000000..d6806b1384 --- /dev/null +++ b/hermetic_build/library_generation/owlbot/synthtool/_tracked_paths.py @@ -0,0 +1,38 @@ +# 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 +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +"""Tracked paths. + +This is a bit of a hack (imported from original synthtool library). +""" + +import pathlib + +_tracked_paths = [] + + +def add(path): + _tracked_paths.append(pathlib.Path(path)) + # Reverse sort the list, so that the deepest paths get matched first. + _tracked_paths.sort(key=lambda s: -len(str(s))) + + +def relativize(path): + path = pathlib.Path(path) + for tracked_path in _tracked_paths: + try: + return path.relative_to(tracked_path) + except ValueError: + pass + raise ValueError(f"The root for {path} is not tracked.") diff --git a/hermetic_build/library_generation/owlbot/synthtool/gcp/common.py b/hermetic_build/library_generation/owlbot/synthtool/gcp/common.py new file mode 100644 index 0000000000..5cd648be36 --- /dev/null +++ b/hermetic_build/library_generation/owlbot/synthtool/gcp/common.py @@ -0,0 +1,146 @@ +# 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 +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT 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 json +import os +import sys +import yaml +from pathlib import Path +from typing import Dict, List, Optional +import logging + +from synthtool import _tracked_paths +from synthtool.sources import templates + +logger = logging.getLogger() +logger.setLevel(logging.DEBUG) +# Originally brought from gcp/partials.py. +# These are the default locations to look up +_DEFAULT_PARTIAL_FILES = [ + ".readme-partials.yml", + ".readme-partials.yaml", + ".integration-partials.yaml", +] + + +class CommonTemplates: + def __init__(self, template_path: Optional[Path] = None): + local_templates = os.environ.get("SYNTHTOOL_TEMPLATES") + if local_templates is None: + logger.error("env var SYNTHTOOL_TEMPLATES must be set") + sys.exit(1) + logger.debug(f"Using local templates at {local_templates}") + self._template_root = Path(local_templates) + self._templates = templates.Templates(self._template_root) + self.excludes = [] # type: List[str] + + def _generic_library(self, directory: str, relative_dir=None, **kwargs) -> Path: + # load common repo meta information (metadata that's not language specific). + if "metadata" in kwargs: + self._load_generic_metadata(kwargs["metadata"], relative_dir=relative_dir) + # if no samples were found, don't attempt to render a + # samples/README.md. + if "samples" not in kwargs["metadata"] or not kwargs["metadata"]["samples"]: + self.excludes.append("samples/README.md") + + t = templates.TemplateGroup(self._template_root / directory, self.excludes) + + result = t.render(**kwargs) + _tracked_paths.add(result) + + return result + + def java_library(self, **kwargs) -> Path: + # kwargs["metadata"] is required to load values from .repo-metadata.json + if "metadata" not in kwargs: + kwargs["metadata"] = {} + return self._generic_library("java_library", **kwargs) + + def render(self, template_name: str, **kwargs) -> Path: + template = self._templates.render(template_name, **kwargs) + _tracked_paths.add(template) + return template + + def _load_generic_metadata(self, metadata: Dict, relative_dir=None): + """ + loads additional meta information from .repo-metadata.json. + """ + metadata["partials"] = load_partials() + + # Loads repo metadata information from the default location if it + # hasn't already been set. Some callers may have already loaded repo + # metadata, so we don't need to do it again or overwrite it. Also, only + # set the "repo" key. + if "repo" not in metadata: + metadata["repo"] = _load_repo_metadata(relative_dir=relative_dir) + + +def _load_repo_metadata( + relative_dir=None, metadata_file: str = "./.repo-metadata.json" +) -> Dict: + """Parse a metadata JSON file into a Dict. + + Currently, the defined fields are: + * `name` - The service's API name + * `name_pretty` - The service's API title. This will be used for generating titles on READMEs + * `product_documentation` - The product documentation on cloud.google.com + * `client_documentation` - The client library reference documentation + * `issue_tracker` - The public issue tracker for the product + * `release_level` - The release level of the client library. One of: alpha, beta, + ga, deprecated, preview, stable + * `language` - The repo language. One of dotnet, go, java, nodejs, php, python, ruby + * `repo` - The GitHub repo in the format {owner}/{repo} + * `distribution_name` - The language-idiomatic package/distribution name + * `api_id` - The API ID associated with the service. Fully qualified identifier use to + enable a service in the cloud platform (e.g. monitoring.googleapis.com) + * `requires_billing` - Whether or not the API requires billing to be configured on the + customer's acocunt + + Args: + metadata_file (str, optional): Path to the metadata json file + + Returns: + A dictionary of metadata. This may not necessarily include all the defined fields above. + """ + if relative_dir is not None: + if os.path.exists(Path(relative_dir, metadata_file).resolve()): + with open(Path(relative_dir, metadata_file).resolve()) as f: + return json.load(f) + elif os.path.exists(metadata_file): + with open(metadata_file) as f: + return json.load(f) + return {} + + +def load_partials(files: List[str] = []) -> Dict: + """ + hand-crafted artisanal markdown can be provided in a .readme-partials.yml. + The following fields are currently supported: + + body: custom body to include in the usage section of the document. + samples_body: an optional body to place below the table of contents + in samples/README.md. + introduction: a more thorough introduction than metadata["description"]. + title: provide markdown to use as a custom title. + deprecation_warning: a warning to indicate that the library has been + deprecated and a pointer to an alternate option + """ + result: Dict[str, Dict] = {} + cwd_path = Path(os.getcwd()) + for file in files + _DEFAULT_PARTIAL_FILES: + partials_file = cwd_path / file + if os.path.exists(partials_file): + with open(partials_file) as f: + result.update(yaml.load(f, Loader=yaml.SafeLoader)) + return result diff --git a/hermetic_build/library_generation/owlbot/synthtool/gcp/samples.py b/hermetic_build/library_generation/owlbot/synthtool/gcp/samples.py new file mode 100644 index 0000000000..760fc06574 --- /dev/null +++ b/hermetic_build/library_generation/owlbot/synthtool/gcp/samples.py @@ -0,0 +1,91 @@ +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import glob +import logging +import re +import os +import yaml +from typing import List, Dict + +logger = logging.getLogger() +logger.setLevel(logging.DEBUG) + + +def _read_sample_metadata_comment(sample_file: str) -> Dict: + """Additional meta-information can be provided through embedded comments: + + // sample-metadata: + // title: ACL (Access Control) + // description: Demonstrates setting access control rules. + // usage: node iam.js --help + """ + sample_metadata = {} # type: Dict[str, str] + with open(sample_file) as f: + contents = f.read() + match = re.search( + r"(?P// *sample-metadata:([^\n]+|\n//)+)", contents, re.DOTALL + ) + if match: + # the metadata yaml is stored in a comments, remove the + # prefix so that we can parse the yaml contained. + sample_metadata_string = re.sub(r"((#|//) ?)", "", match.group("metadata")) + try: + sample_metadata = yaml.load( + sample_metadata_string, Loader=yaml.SafeLoader + )["sample-metadata"] + except yaml.scanner.ScannerError: + # warn and continue on bad metadata + logger.warning(f"bad metadata detected in {sample_file}") + return sample_metadata + + +def _sample_metadata(file: str) -> Dict[str, str]: + metadata = { + "title": _decamelize(os.path.splitext(os.path.basename(file))[0]), + "file": file, + } + return {**metadata, **_read_sample_metadata_comment(file)} + + +def all_samples(sample_globs: List[str]) -> List[Dict[str, str]]: + """Walks samples directory and builds up samples data-structure + + Args: + sample_globs: (List[str]): List of path globs to search for samples + + Returns: + A list of sample metadata in the format: + { + "title": "Requester Pays", + "file": "samples/requesterPays.js" + } + The file path is the relative path from the repository root. + """ + files = [] + for sample_glob in sample_globs: + for file in glob.glob(sample_glob, recursive=True): + files.append(file) + return [_sample_metadata(file) for file in sorted(files)] + + +def _decamelize(value: str): + """Parser to convert fooBar.js to Foo Bar.""" + if not value: + return "" + str_decamelize = re.sub("^.", value[0].upper(), value) # apple -> Apple. + str_decamelize = re.sub( + "([A-Z]+)([A-Z])([a-z0-9])", r"\1 \2\3", str_decamelize + ) # ACLBatman -> ACL Batman. + return re.sub("([a-z0-9])([A-Z])", r"\1 \2", str_decamelize) # FooBar -> Foo Bar. diff --git a/hermetic_build/library_generation/owlbot/synthtool/gcp/snippets.py b/hermetic_build/library_generation/owlbot/synthtool/gcp/snippets.py new file mode 100644 index 0000000000..5db00656b5 --- /dev/null +++ b/hermetic_build/library_generation/owlbot/synthtool/gcp/snippets.py @@ -0,0 +1,124 @@ +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import glob +import os +import re +from typing import Dict, List + +OPEN_SNIPPET_REGEX = r".*\[START ([a-z0-9_]+)\].*$" +CLOSE_SNIPPET_REGEX = r".*\[END ([a-z0-9_]+)\].*$" +OPEN_EXCLUDE_REGEX = r".*\[START_EXCLUDE\].*$" +CLOSE_EXCLUDE_REGEX = r".*\[END_EXCLUDE\].*$" + + +def _trim_leading_whitespace(lines: List[str]) -> List[str]: + """Trims leading, plain spaces from the snippet content. Finds the minimum + number of leading spaces, ignoring empty lines, and removes that number of + spaces from each line. + + Args: + lines (List[str]): Lines of content. These lines are newline terminated. + + Returns: + List of trimmed lines. + """ + + def number_of_leading_spaces(input: str) -> int: + return len(input) - len(input.lstrip(" ")) + + def is_empty_line(input: str) -> bool: + if re.match(r"^\s*$", input): + return True + return False + + leading_spaces = [ + number_of_leading_spaces(line) for line in lines if not is_empty_line(line) + ] + max_leading_spaces = min(leading_spaces) + return [ + "\n" if is_empty_line(line) else line[max_leading_spaces:] for line in lines + ] + + +def all_snippets_from_file(sample_file: str) -> Dict[str, str]: + """Reads in a sample file and parse out all contained snippets. + + Args: + sample_file (str): Sample file to parse. + + Returns: + Dictionary of snippet name to snippet code. + """ + if not os.path.exists(sample_file): + return {} + + snippet_lines = {} # type: Dict[str, List[str]] + open_snippets = set() + with open(sample_file) as f: + excluding = False + # Iterate over each line: + # - If the line matches an opening snippet tag, add that snippet tag to + # the set of open tags. + # - If the line matches a closing snippet tag, remove that snippet tag + # from the set of open tags. + # - If the line matches an opening exclude tag, record that we excluding + # content. + # - If the line matches a closing exclude tag, record that we are capturing + # content again. + # - Otherwise, if we are not excluding content, add the line to each of the + # open snippets + # + # This allows us to handle parsing nested or interleaved snippets and ignore + # blocks of code in the snippets + for line in f: + open_match = re.match(pattern=OPEN_SNIPPET_REGEX, string=line) + close_match = re.match(pattern=CLOSE_SNIPPET_REGEX, string=line) + open_exclude_match = re.match(pattern=OPEN_EXCLUDE_REGEX, string=line) + close_exclude_match = re.match(pattern=CLOSE_EXCLUDE_REGEX, string=line) + if open_match and not excluding: + open_snippets.add(open_match[1]) + if not open_match[1] in snippet_lines: + snippet_lines[open_match[1]] = [] + elif close_match and not excluding: + open_snippets.discard(close_match[1]) + elif open_exclude_match: + excluding = True + elif close_exclude_match: + excluding = False + elif not excluding: + for snippet in open_snippets: + snippet_lines[snippet].append(line) + + return { + snippet: "".join(_trim_leading_whitespace(lines)) + for snippet, lines in snippet_lines.items() + } + + +def all_snippets(snippet_globs: List[str]) -> Dict[str, str]: + """Walks the samples directory and parses snippets from each file. + + Args: + snippet_globs (List[str]): List of path globs to expand. + + Returns: + Dictionary of snippet name to snippet code. + """ + snippets = {} + for snippet_glob in snippet_globs: + for file in glob.glob(snippet_glob, recursive=True): + for snippet, code in all_snippets_from_file(file).items(): + snippets[snippet] = code + return snippets diff --git a/hermetic_build/library_generation/owlbot/synthtool/languages/java.py b/hermetic_build/library_generation/owlbot/synthtool/languages/java.py new file mode 100644 index 0000000000..c8e10e926e --- /dev/null +++ b/hermetic_build/library_generation/owlbot/synthtool/languages/java.py @@ -0,0 +1,580 @@ +# 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 +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT 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 xml.etree.ElementTree as ET +import re +import yaml +import synthtool as s +import synthtool.gcp as gcp +import logging +from synthtool.gcp import common, samples, snippets +from pathlib import Path +from typing import Any, Optional, Dict, Iterable, List +from datetime import date + +logger = logging.getLogger() +logger.setLevel(logging.DEBUG) + +JAR_DOWNLOAD_URL = "https://github.com/google/google-java-format/releases/download/google-java-format-{version}/google-java-format-{version}-all-deps.jar" +DEFAULT_FORMAT_VERSION = "1.7" + +PROTOBUF_HEADER = "// Generated by the protocol buffer compiler. DO NOT EDIT!" +BAD_LICENSE = """/\\* + \\* Copyright \\d{4} Google LLC + \\* + \\* Licensed under the Apache License, Version 2.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. + \\*/ +""" +DEFAULT_MIN_SUPPORTED_JAVA_VERSION = 8 +METADATA = "metadata" +LIBRARIES_BOM_VERSION = "libraries_bom_version" +LIBRARIES_BOM_VERSION_ENV_KEY = "SYNTHTOOL_LIBRARIES_BOM_VERSION" +HEADER_REGEX = re.compile("\\* Copyright \\d{4} Google LLC") +LIBRARY_VERSION = "library_version" +LIBRARY_VERSION_ENV_KEY = "SYNTHTOOL_LIBRARY_VERSION" + + +def _get_good_license(): + current_year = int(os.getenv("CURRENT_YEAR_OVERRIDE", date.today().year)) + good_license = f"""/* + * Copyright {current_year} Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +""" + return good_license + + +def _file_has_header(path: Path) -> bool: + """Return true if the file already contains a license header.""" + with open(path, "rt") as fp: + for line in fp: + if HEADER_REGEX.search(line): + return True + return False + + +def _filter_no_header(paths: Iterable[Path]) -> Iterable[Path]: + """Return a subset of files that do not already have a header.""" + for path in paths: + anchor = Path(path.anchor) + remainder = str(path.relative_to(path.anchor)) + for file in anchor.glob(remainder): + if not _file_has_header(file): + yield file + + +def fix_proto_headers(proto_root: Path) -> None: + """Helper to ensure that generated proto classes have appropriate license headers. + + If the file does not already contain a license header, inject one at the top of the file. + Some resource name classes may contain malformed license headers. In those cases, replace + those with our standard license header. + """ + s.replace( + _filter_no_header([proto_root / "src/**/*.java"]), + PROTOBUF_HEADER, + f"{_get_good_license()}{PROTOBUF_HEADER}", + ) + # https://github.com/googleapis/gapic-generator/issues/3074 + s.replace( + [proto_root / "src/**/*Name.java", proto_root / "src/**/*Names.java"], + BAD_LICENSE, + _get_good_license(), + ) + + +def fix_grpc_headers(grpc_root: Path, package_name: str = "unused") -> None: + """Helper to ensure that generated grpc stub classes have appropriate license headers. + + If the file does not already contain a license header, inject one at the top of the file. + """ + s.replace( + _filter_no_header([grpc_root / "src/**/*.java"]), + "^package (.*);", + f"{_get_good_license()}package \\1;", + ) + + +def version_from_maven_metadata(metadata: str) -> Optional[str]: + """Helper function to parse the latest released version from the Maven + metadata XML file. + + Args: + metadata (str): The XML contents of the Maven metadata file + + Returns: + The latest version of the artifact as a string or None + """ + root = ET.fromstring(metadata) + latest = root.find("./versioning/latest") + if latest is not None: + return latest.text + + return None + + +def _merge_release_please(destination_text: str): + handle_gh_release_key = "handleGHRelease" + branches_key = "branches" + config = yaml.safe_load(destination_text) + if handle_gh_release_key in config: + return destination_text + + config[handle_gh_release_key] = True + + if branches_key in config: + for branch in config[branches_key]: + branch[handle_gh_release_key] = True + return yaml.dump(config) + + +def _merge_common_templates( + source_text: str, destination_text: str, file_path: Path +) -> str: + # keep any existing pom.xml + if file_path.match("pom.xml") or file_path.match("sync-repo-settings.yaml"): + logger.debug(f"existing pom file found ({file_path}) - keeping the existing") + return destination_text + + if file_path.match("release-please.yml"): + return _merge_release_please(destination_text) + + # by default return the newly generated content + return source_text + + +def _common_template_metadata() -> Dict[str, Any]: + metadata = {} # type: Dict[str, Any] + repo_metadata = common._load_repo_metadata() + if repo_metadata: + metadata["repo"] = repo_metadata + + metadata["samples"] = samples.all_samples(["samples/**/src/main/java/**/*.java"]) + metadata["snippets"] = snippets.all_snippets( + ["samples/**/src/main/java/**/*.java", "samples/**/pom.xml"] + ) + if repo_metadata and "min_java_version" in repo_metadata: + metadata["min_java_version"] = repo_metadata["min_java_version"] + else: + metadata["min_java_version"] = DEFAULT_MIN_SUPPORTED_JAVA_VERSION + + return metadata + + +def common_templates( + excludes: List[str] = [], + template_path: Optional[Path] = None, + **kwargs, +) -> None: + """Generate common templates for a Java Library + + Fetches information about the repository from the .repo-metadata.json file, + information about the latest artifact versions and copies the files into + their expected location. + + Args: + :param excludes: List of template paths to ignore + :param template_path: + :param kwargs: Additional options for CommonTemplates.java_library() + """ + metadata = _common_template_metadata() + kwargs[METADATA] = metadata + + # Generate flat to tell this repository is a split repo that have migrated + # to monorepo. The owlbot.py in the monorepo sets monorepo=True. + monorepo = kwargs.get("monorepo", False) + kwargs["monorepo"] = monorepo + split_repo = not monorepo + repo_metadata = metadata["repo"] + repo_short = repo_metadata["repo_short"] + if os.getenv(LIBRARIES_BOM_VERSION_ENV_KEY, default=None) is not None: + kwargs[METADATA][LIBRARIES_BOM_VERSION] = os.getenv( + LIBRARIES_BOM_VERSION_ENV_KEY + ) + kwargs[METADATA][LIBRARY_VERSION] = os.getenv(LIBRARY_VERSION_ENV_KEY) + # Special libraries that are not GAPIC_AUTO but in the monorepo + special_libs_in_monorepo = [ + "java-translate", + "java-dns", + "java-notification", + "java-resourcemanager", + ] + kwargs["migrated_split_repo"] = split_repo and ( + repo_metadata["library_type"] == "GAPIC_AUTO" + or (repo_short and repo_short in special_libs_in_monorepo) + ) + logger.info( + "monorepo: {}, split_repo: {}, library_type: {}," + " repo_short: {}, migrated_split_repo: {}".format( + monorepo, + split_repo, + repo_metadata["library_type"], + repo_short, + kwargs["migrated_split_repo"], + ) + ) + + templates = gcp.common.CommonTemplates(template_path=template_path).java_library( + **kwargs + ) + + s.copy([templates], excludes=excludes, merge=_merge_common_templates) + + +def custom_templates(files: List[str], **kwargs) -> None: + """Generate custom template files + + Fetches information about the repository from the .repo-metadata.json file, + information about the latest artifact versions and copies the files into + their expected location. + + Args: + files (List[str], optional): List of template paths to include + **kwargs: Additional options for CommonTemplates.render() + """ + kwargs["metadata"] = _common_template_metadata() + kwargs["metadata"]["partials"] = common.load_partials() + for file in files: + template = gcp.CommonTemplates().render(file, **kwargs) + s.copy([template]) + + +def remove_method(filename: str, signature: str): + """Helper to remove an entire method. + + Goes line-by-line to detect the start of the block. Determines + the end of the block by a closing brace at the same indentation + level. This requires the file to be correctly formatted. + + Example: consider the following class: + + class Example { + public void main(String[] args) { + System.out.println("Hello World"); + } + + public String foo() { + return "bar"; + } + } + + To remove the `main` method above, use: + + remove_method('path/to/file', 'public void main(String[] args)') + + Args: + filename (str): Path to source file + signature (str): Full signature of the method to remove. Example: + `public void main(String[] args)`. + """ + lines = [] + leading_regex = None + with open(filename, "r") as fp: + line = fp.readline() + while line: + # for each line, try to find the matching + regex = re.compile("(\\s*)" + re.escape(signature) + ".*") + match = regex.match(line) + if match: + leading_regex = re.compile(match.group(1) + "}") + line = fp.readline() + continue + + # not in a ignore block - preserve the line + if not leading_regex: + lines.append(line) + line = fp.readline() + continue + + # detect the closing tag based on the leading spaces + match = leading_regex.match(line) + if match: + # block is closed, resume capturing content + leading_regex = None + + line = fp.readline() + + with open(filename, "w") as fp: + for line in lines: + # print(line) + fp.write(line) + + +def copy_and_rename_method(filename: str, signature: str, before: str, after: str): + """Helper to make a copy an entire method and rename it. + + Goes line-by-line to detect the start of the block. Determines + the end of the block by a closing brace at the same indentation + level. This requires the file to be correctly formatted. + The method is copied over and renamed in the method signature. + The calls to both methods are separate and unaffected. + + Example: consider the following class: + + class Example { + public void main(String[] args) { + System.out.println("Hello World"); + } + + public String foo() { + return "bar"; + } + } + + To copy and rename the `main` method above, use: + + copy_and_rename_method('path/to/file', 'public void main(String[] args)', + 'main', 'foo1') + + Args: + filename (str): Path to source file + signature (str): Full signature of the method to remove. Example: + `public void main(String[] args)`. + before (str): name of the method to be copied + after (str): new name of the copied method + """ + lines = [] + method = [] + leading_regex = None + with open(filename, "r") as fp: + line = fp.readline() + while line: + # for each line, try to find the matching + regex = re.compile("(\\s*)" + re.escape(signature) + ".*") + match = regex.match(line) + if match: + leading_regex = re.compile(match.group(1) + "}") + lines.append(line) + method.append(line.replace(before, after)) + line = fp.readline() + continue + + lines.append(line) + # not in a ignore block - preserve the line + if leading_regex: + method.append(line) + else: + line = fp.readline() + continue + + # detect the closing tag based on the leading spaces + match = leading_regex.match(line) + if match: + # block is closed, resume capturing content + leading_regex = None + lines.append("\n") + lines.extend(method) + + line = fp.readline() + + with open(filename, "w") as fp: + for line in lines: + # print(line) + fp.write(line) + + +def add_javadoc(filename: str, signature: str, javadoc_type: str, content: List[str]): + """Helper to add a javadoc annoatation to a method. + + Goes line-by-line to detect the start of the block. + Then finds the existing method comment (if it exists). If the + comment already exists, it will append the javadoc annotation + to the javadoc block. Otherwise, it will create a new javadoc + comment block. + + Example: consider the following class: + + class Example { + public void main(String[] args) { + System.out.println("Hello World"); + } + + public String foo() { + return "bar"; + } + } + + To add a javadoc annotation the `main` method above, use: + + add_javadoc('path/to/file', 'public void main(String[] args)', + 'deprecated', 'Please use foo instead.') + + Args: + filename (str): Path to source file + signature (str): Full signature of the method to remove. Example: + `public void main(String[] args)`. + javadoc_type (str): The type of javadoc annotation. Example: `deprecated`. + content (List[str]): The javadoc lines + """ + lines: List[str] = [] + annotations: List[str] = [] + with open(filename, "r") as fp: + line = fp.readline() + while line: + # for each line, try to find the matching + regex = re.compile("(\\s*)" + re.escape(signature) + ".*") + match = regex.match(line) + if match: + leading_spaces = len(line) - len(line.lstrip()) + indent = leading_spaces * " " + last_line = lines.pop() + while last_line.lstrip() and last_line.lstrip()[0] == "@": + annotations.append(last_line) + last_line = lines.pop() + if last_line.strip() == "*/": + first = True + for content_line in content: + if first: + lines.append( + indent + + " * @" + + javadoc_type + + " " + + content_line + + "\n" + ) + first = False + else: + lines.append(indent + " * " + content_line + "\n") + lines.append(last_line) + else: + lines.append(last_line) + lines.append(indent + "/**\n") + first = True + for content_line in content: + if first: + lines.append( + indent + + " * @" + + javadoc_type + + " " + + content_line + + "\n" + ) + first = False + else: + lines.append(indent + " * " + content_line + "\n") + lines.append(indent + " */\n") + lines.extend(annotations[::-1]) + lines.append(line) + line = fp.readline() + + with open(filename, "w") as fp: + for line in lines: + # print(line) + fp.write(line) + + +def annotate_method(filename: str, signature: str, annotation: str): + """Helper to add an annotation to a method. + + Goes line-by-line to detect the start of the block. + Then adds the annotation above the found method signature. + + Example: consider the following class: + + class Example { + public void main(String[] args) { + System.out.println("Hello World"); + } + + public String foo() { + return "bar"; + } + } + + To add an annotation the `main` method above, use: + + annotate_method('path/to/file', 'public void main(String[] args)', + '@Generated()') + + Args: + filename (str): Path to source file + signature (str): Full signature of the method to remove. Example: + `public void main(String[] args)`. + annotation (str): Full annotation. Example: `@Deprecated` + """ + lines: List[str] = [] + with open(filename, "r") as fp: + line = fp.readline() + while line: + # for each line, try to find the matching + regex = re.compile("(\\s*)" + re.escape(signature) + ".*") + match = regex.match(line) + if match: + leading_spaces = len(line) - len(line.lstrip()) + indent = leading_spaces * " " + lines.append(indent + annotation + "\n") + lines.append(line) + line = fp.readline() + + with open(filename, "w") as fp: + for line in lines: + # print(line) + fp.write(line) + + +def deprecate_method(filename: str, signature: str, alternative: str): + """Helper to deprecate a method. + + Goes line-by-line to detect the start of the block. + Then adds the deprecation comment before the method signature. + The @Deprecation annotation is also added. + + Example: consider the following class: + + class Example { + public void main(String[] args) { + System.out.println("Hello World"); + } + + public String foo() { + return "bar"; + } + } + + To deprecate the `main` method above, use: + + deprecate_method('path/to/file', 'public void main(String[] args)', + DEPRECATION_WARNING.format(new_method="foo")) + + Args: + filename (str): Path to source file + signature (str): Full signature of the method to remove. Example: + `public void main(String[] args)`. + alternative: DEPRECATION WARNING: multiline javadoc comment with user + specified leading open/close comment tags + """ + add_javadoc(filename, signature, "deprecated", alternative.splitlines()) + annotate_method(filename, signature, "@Deprecated") diff --git a/hermetic_build/library_generation/owlbot/synthtool/sources/templates.py b/hermetic_build/library_generation/owlbot/synthtool/sources/templates.py new file mode 100644 index 0000000000..216f1d0a5a --- /dev/null +++ b/hermetic_build/library_generation/owlbot/synthtool/sources/templates.py @@ -0,0 +1,78 @@ +# 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 +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +from typing import Union, List +from pathlib import Path +import jinja2 +import tempfile + +PathOrStr = Union[str, Path] + + +def _make_env(location): + env = jinja2.Environment( + loader=jinja2.FileSystemLoader(str(location)), + autoescape=False, + keep_trailing_newline=True, + ) + return env + + +def _render_to_path(env, template_name, dest, params): + template = env.get_template(template_name) + + output = template.stream(**params) + + if template_name.endswith(".j2"): + template_name = template.name[:-3] + + dest = dest / template_name + dest.parent.mkdir(parents=True, exist_ok=True) + + with dest.open("w") as fh: + output.dump(fh) + + # Copy file mode over + source_path = Path(template.filename) + mode = source_path.stat().st_mode + dest.chmod(mode) + + return dest + + +class Templates: + def __init__(self, location: PathOrStr) -> None: + self.env = _make_env(location) + self.source_path = Path(location) + self.dir = Path(tempfile.mkdtemp()) + + def render(self, template_name: str, subdir: PathOrStr = ".", **kwargs) -> Path: + return _render_to_path(self.env, template_name, self.dir / subdir, kwargs) + + +class TemplateGroup: + def __init__(self, location: PathOrStr, excludes: List[str] = []) -> None: + self.env = _make_env(location) + self.dir = Path(tempfile.mkdtemp()) + self.excludes = excludes + + def render(self, subdir: PathOrStr = ".", **kwargs) -> Path: + for template_name in self.env.list_templates(): + if template_name not in self.excludes: + print(template_name) + _render_to_path(self.env, template_name, self.dir / subdir, kwargs) + else: + print(f"Skipping: {template_name}") + + return self.dir diff --git a/hermetic_build/library_generation/owlbot/synthtool/transforms.py b/hermetic_build/library_generation/owlbot/synthtool/transforms.py new file mode 100644 index 0000000000..cf87995847 --- /dev/null +++ b/hermetic_build/library_generation/owlbot/synthtool/transforms.py @@ -0,0 +1,314 @@ +# 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 +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +from pathlib import Path +import shutil +from typing import Callable, Iterable, Union, List, Optional +import os +import re +import sys +import logging + +from synthtool import _tracked_paths + +PathOrStr = Union[str, Path] +ListOfPathsOrStrs = Iterable[Union[str, Path]] + +logger = logging.getLogger() +logger.setLevel(logging.DEBUG) + + +class MissingSourceError(Exception): + pass + + +def _expand_paths(paths: ListOfPathsOrStrs, root: PathOrStr = None) -> Iterable[Path]: + """Given a list of globs/paths, expands them into a flat sequence, + expanding globs as necessary.""" + if paths is None: + return [] + + if isinstance(paths, (str, Path)): + paths = [paths] + + if root is None: + root = Path(".") + + # ensure root is a path + root = Path(root) + + # record name of synth script so we don't try to do transforms on it + synth_script_name = sys.argv[0] + + for path in paths: + if isinstance(path, Path): + if path.is_absolute(): + anchor = Path(path.anchor) + remainder = str(path.relative_to(path.anchor)) + yield from anchor.glob(remainder) + else: + yield from root.glob(str(path)) + else: + yield from ( + p + for p in root.glob(path) + if p.absolute() != Path(synth_script_name).absolute() + ) + + +def _filter_files(paths: Iterable[Path]) -> Iterable[Path]: + """Returns only the paths that are files (no directories).""" + + return (path for path in paths if path.is_file() and os.access(path, os.W_OK)) + + +def _merge_file( + source_path: Path, dest_path: Path, merge: Callable[[str, str, Path], str] +): + """ + Writes to the destination the result of merging the source with the + existing destination contents, using the given merge function. + + The merge function must take three arguments: the source contents, the + old destination contents, and a Path to the file to be written. + """ + + with source_path.open("r") as source_file: + source_text = source_file.read() + + with dest_path.open("r+") as dest_file: + dest_text = dest_file.read() + + final_text = merge(source_text, dest_text, dest_path) + + # use the source file's file permission mode + os.chmod(dest_path, os.stat(source_path).st_mode) + if final_text != dest_text: + dest_file.seek(0) + dest_file.write(final_text) + dest_file.truncate() + else: + dest_path.touch() + + +def _copy_dir_to_existing_dir( + source: Path, + destination: Path, + excludes: ListOfPathsOrStrs = None, + merge: Callable[[str, str, Path], str] = None, +) -> bool: + """ + copies files over existing files to an existing directory + this function does not copy empty directories. + + Returns: True if any files were copied, False otherwise. + """ + copied = False + + if not excludes: + excludes = [] + for root, _, files in os.walk(source): + for name in files: + rel_path = str(Path(root).relative_to(source)) + dest_dir = destination / rel_path + dest_path = dest_dir / name + exclude = [ + e + for e in excludes + if ( + Path(e) == _tracked_paths.relativize(root) + or Path(e) == _tracked_paths.relativize(Path(root) / name) + ) + ] + if not exclude: + os.makedirs(str(dest_dir), exist_ok=True) + source_path = Path(os.path.join(root, name)) + if merge is not None and dest_path.is_file(): + try: + _merge_file(source_path, dest_path, merge) + except Exception: + logger.exception( + "_merge_file failed for %s, fall back to copy", + source_path, + ) + shutil.copy2(str(source_path), str(dest_path)) + else: + shutil.copy2(str(source_path), str(dest_path)) + copied = True + + return copied + + +def move( + sources: ListOfPathsOrStrs, + destination: PathOrStr = None, + excludes: ListOfPathsOrStrs = None, + merge: Callable[[str, str, Path], str] = None, + required: bool = False, +) -> bool: + """ + copy file(s) at source to current directory, preserving file mode. + + Args: + sources (ListOfPathsOrStrs): Glob pattern(s) to copy + destination (PathOrStr): Destination folder for copied files + excludes (ListOfPathsOrStrs): Glob pattern(s) of files to skip + merge (Callable[[str, str, Path], str]): Callback function for merging files + if there is an existing file. + required (bool): If required and no source files are copied, throws a MissingSourceError + + Returns: + True if any files were copied, False otherwise. + """ + copied = False + + for source in _expand_paths(sources): + if destination is None: + canonical_destination = _tracked_paths.relativize(source) + else: + canonical_destination = Path(destination) + + if excludes: + excludes = [ + _tracked_paths.relativize(e) for e in _expand_paths(excludes, source) + ] + else: + excludes = [] + if source.is_dir(): + copied = copied or _copy_dir_to_existing_dir( + source, canonical_destination, excludes=excludes, merge=merge + ) + elif source not in excludes: + # copy individual file + if merge is not None and canonical_destination.is_file(): + try: + _merge_file(source, canonical_destination, merge) + except Exception: + logger.exception( + "_merge_file failed for %s, fall back to copy", source + ) + shutil.copy2(source, canonical_destination) + else: + shutil.copy2(source, canonical_destination) + copied = True + + if not copied: + if required: + raise MissingSourceError( + f"No files in sources {sources} were copied. Does the source " + f"contain files?" + ) + else: + logger.warning( + f"No files in sources {sources} were copied. Does the source " + f"contain files?" + ) + + return copied + + +def _replace_in_file(path, expr, replacement): + try: + with path.open("r+") as fh: + return _replace_in_file_handle(fh, expr, replacement) + except UnicodeDecodeError: + pass # It's a binary file. Try again with a binary regular expression. + flags = expr.flags & ~re.UNICODE + expr = re.compile(expr.pattern.encode(), flags) + with path.open("rb+") as fh: + return _replace_in_file_handle(fh, expr, replacement.encode()) + + +def _replace_in_file_handle(fh, expr, replacement): + content = fh.read() + content, count = expr.subn(replacement, content) + + # Don't bother writing the file if we didn't change + # anything. + if count: + fh.seek(0) + fh.write(content) + fh.truncate() + return count + + +def replace( + sources: ListOfPathsOrStrs, before: str, after: str, flags: int = re.MULTILINE +) -> int: + """Replaces occurrences of before with after in all the given sources. + + Returns: + The number of times the text was found and replaced across all files. + """ + expr = re.compile(before, flags=flags or 0) + paths = _filter_files(_expand_paths(sources, ".")) + + if not paths: + logger.warning(f"No files were found in sources {sources} for replace()") + + count_replaced = 0 + for path in paths: + replaced = _replace_in_file(path, expr, after) + count_replaced += replaced + if replaced: + logger.info(f"Replaced {before!r} in {path}.") + + if not count_replaced: + logger.warning( + f"No replacements made in {sources} for pattern {before}, maybe " + "replacement is no longer needed?" + ) + return count_replaced + + +def get_staging_dirs( + default_version: Optional[str] = None, staging_path: Optional[str] = None +) -> List[Path]: + """Returns the list of directories, one per version, copied from + https://github.com/googleapis/googleapis-gen. Will return in lexical sorting + order with the exception of the default_version which will be last (if specified). + + Args: + default_version: the default version of the API. The directory for this version + will be the last item in the returned list if specified. + staging_path: the path to the staging directory. + + Returns: the empty list if no file were copied. + """ + + if staging_path: + staging = Path(staging_path) + else: + staging = Path("owl-bot-staging") + if staging.is_dir(): + # Collect the subdirectories of the staging directory. + versions = [v.name for v in staging.iterdir() if v.is_dir()] + # Reorder the versions so the default version always comes last. + versions = [v for v in versions if v != default_version] + versions.sort() + if default_version is not None: + versions += [default_version] + dirs = [staging / v for v in versions] + for dir in dirs: + _tracked_paths.add(dir) + return dirs + else: + return [] + + +def remove_staging_dirs(): + """Removes all the staging directories.""" + staging = Path("owl-bot-staging") + if staging.is_dir(): + shutil.rmtree(staging) diff --git a/hermetic_build/library_generation/owlbot/templates/clirr/clirr-ignored-differences.xml.j2 b/hermetic_build/library_generation/owlbot/templates/clirr/clirr-ignored-differences.xml.j2 new file mode 100644 index 0000000000..3fc907802f --- /dev/null +++ b/hermetic_build/library_generation/owlbot/templates/clirr/clirr-ignored-differences.xml.j2 @@ -0,0 +1,80 @@ + + + +{% for proto_path in proto_paths %} + 7012 + {{proto_path}}/*OrBuilder + * get*(*) + + + 7012 + {{proto_path}}/*OrBuilder + boolean contains*(*) + + + 7012 + {{proto_path}}/*OrBuilder + boolean has*(*) + + + + 7006 + {{proto_path}}/** + * getDefaultInstanceForType() + ** + + + 7006 + {{proto_path}}/** + * addRepeatedField(*) + ** + + + 7006 + {{proto_path}}/** + * clear() + ** + + + 7006 + {{proto_path}}/** + * clearField(*) + ** + + + 7006 + {{proto_path}}/** + * clearOneof(*) + ** + + + 7006 + {{proto_path}}/** + * clone() + ** + + + 7006 + {{proto_path}}/** + * mergeUnknownFields(*) + ** + + + 7006 + {{proto_path}}/** + * setField(*) + ** + + + 7006 + {{proto_path}}/** + * setRepeatedField(*) + ** + + + 7006 + {{proto_path}}/** + * setUnknownFields(*) + ** + {% endfor %} + diff --git a/hermetic_build/library_generation/owlbot/templates/java_library/.github/ISSUE_TEMPLATE/bug_report.md b/hermetic_build/library_generation/owlbot/templates/java_library/.github/ISSUE_TEMPLATE/bug_report.md new file mode 100644 index 0000000000..c7539a6878 --- /dev/null +++ b/hermetic_build/library_generation/owlbot/templates/java_library/.github/ISSUE_TEMPLATE/bug_report.md @@ -0,0 +1,56 @@ +--- +name: Bug report +about: Create a report to help us improve + +--- +{% if migrated_split_repo %} +:bus: This library has moved to +[google-cloud-java/{{ metadata['repo']['repo_short'] }}]( +https://github.com/googleapis/google-cloud-java/tree/main/{{ metadata['repo']['repo_short'] }}). +This repository will be archived in the future. +{% endif %} +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/{{metadata['repo']['repo_short']}}/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. {{metadata['repo']['name']}} 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/hermetic_build/library_generation/owlbot/templates/java_library/.github/ISSUE_TEMPLATE/feature_request.md b/hermetic_build/library_generation/owlbot/templates/java_library/.github/ISSUE_TEMPLATE/feature_request.md new file mode 100644 index 0000000000..f89a7dc59e --- /dev/null +++ b/hermetic_build/library_generation/owlbot/templates/java_library/.github/ISSUE_TEMPLATE/feature_request.md @@ -0,0 +1,26 @@ +--- +name: Feature request +about: Suggest an idea for this library + +--- +{% if migrated_split_repo %} +:bus: This library has moved to +[google-cloud-java/{{ metadata['repo']['repo_short'] }}]( +https://github.com/googleapis/google-cloud-java/tree/main/{{ metadata['repo']['repo_short'] }}). +This repository will be archived in the future. +{% endif %} +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/api-common-java/.github/ISSUE_TEMPLATE/support_request.md b/hermetic_build/library_generation/owlbot/templates/java_library/.github/ISSUE_TEMPLATE/support_request.md similarity index 100% rename from api-common-java/.github/ISSUE_TEMPLATE/support_request.md rename to hermetic_build/library_generation/owlbot/templates/java_library/.github/ISSUE_TEMPLATE/support_request.md diff --git a/hermetic_build/library_generation/owlbot/templates/java_library/.github/PULL_REQUEST_TEMPLATE.md b/hermetic_build/library_generation/owlbot/templates/java_library/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 0000000000..b3640828ab --- /dev/null +++ b/hermetic_build/library_generation/owlbot/templates/java_library/.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/{{ metadata['repo']['repo'] }}/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-common-protos/.github/auto-label.yaml b/hermetic_build/library_generation/owlbot/templates/java_library/.github/auto-label.yaml similarity index 100% rename from java-common-protos/.github/auto-label.yaml rename to hermetic_build/library_generation/owlbot/templates/java_library/.github/auto-label.yaml diff --git a/api-common-java/.github/blunderbuss.yml b/hermetic_build/library_generation/owlbot/templates/java_library/.github/blunderbuss.yml similarity index 100% rename from api-common-java/.github/blunderbuss.yml rename to hermetic_build/library_generation/owlbot/templates/java_library/.github/blunderbuss.yml diff --git a/hermetic_build/library_generation/owlbot/templates/java_library/.github/dependabot.yml b/hermetic_build/library_generation/owlbot/templates/java_library/.github/dependabot.yml new file mode 100644 index 0000000000..203f9eaccf --- /dev/null +++ b/hermetic_build/library_generation/owlbot/templates/java_library/.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/hermetic_build/library_generation/owlbot/templates/java_library/.github/generated-files-bot.yml b/hermetic_build/library_generation/owlbot/templates/java_library/.github/generated-files-bot.yml new file mode 100644 index 0000000000..e58cdcbad6 --- /dev/null +++ b/hermetic_build/library_generation/owlbot/templates/java_library/.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/hermetic_build/library_generation/owlbot/templates/java_library/.github/release-please.yml b/hermetic_build/library_generation/owlbot/templates/java_library/.github/release-please.yml new file mode 100644 index 0000000000..8ca7f9cabc --- /dev/null +++ b/hermetic_build/library_generation/owlbot/templates/java_library/.github/release-please.yml @@ -0,0 +1,3 @@ +bumpMinorPreMajor: true +handleGHRelease: true +releaseType: java-yoshi diff --git a/hermetic_build/library_generation/owlbot/templates/java_library/.github/release-trigger.yml b/hermetic_build/library_generation/owlbot/templates/java_library/.github/release-trigger.yml new file mode 100644 index 0000000000..5056d3a13b --- /dev/null +++ b/hermetic_build/library_generation/owlbot/templates/java_library/.github/release-trigger.yml @@ -0,0 +1,2 @@ +enabled: true +multiScmName: {{ metadata['repo']['repo_short'] }} diff --git a/hermetic_build/library_generation/owlbot/templates/java_library/.github/scripts/update_generation_config.sh b/hermetic_build/library_generation/owlbot/templates/java_library/.github/scripts/update_generation_config.sh new file mode 100644 index 0000000000..74d0e6cc41 --- /dev/null +++ b/hermetic_build/library_generation/owlbot/templates/java_library/.github/scripts/update_generation_config.sh @@ -0,0 +1,187 @@ +#!/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}") + + # 1. Extract all version tags + # 2. Strip the XML tags to leave just the version numbers + # 3. Filter for strictly numbers.numbers.numbers (e.g., 2.54.0) + # 4. Sort by version (V) and take the last one (tail -n 1) + latest=$(echo "${xml_content}" \ + | grep -oE '[0-9]+\.[0-9]+\.[0-9]+' \ + | sed -E 's/<[^>]+>//g' \ + | sort -V \ + | tail -n 1) + + 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/hermetic_build/library_generation/owlbot/templates/java_library/.github/snippet-bot.yml b/hermetic_build/library_generation/owlbot/templates/java_library/.github/snippet-bot.yml new file mode 100644 index 0000000000..e69de29bb2 diff --git a/hermetic_build/library_generation/owlbot/templates/java_library/.github/sync-repo-settings.yaml b/hermetic_build/library_generation/owlbot/templates/java_library/.github/sync-repo-settings.yaml new file mode 100644 index 0000000000..f1c3e6d096 --- /dev/null +++ b/hermetic_build/library_generation/owlbot/templates/java_library/.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/hermetic_build/library_generation/owlbot/templates/java_library/.github/trusted-contribution.yml b/hermetic_build/library_generation/owlbot/templates/java_library/.github/trusted-contribution.yml new file mode 100644 index 0000000000..88d3ac9bf1 --- /dev/null +++ b/hermetic_build/library_generation/owlbot/templates/java_library/.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/hermetic_build/library_generation/owlbot/templates/java_library/.github/workflows/approve-readme.yaml b/hermetic_build/library_generation/owlbot/templates/java_library/.github/workflows/approve-readme.yaml new file mode 100644 index 0000000000..bbef6d37cc --- /dev/null +++ b/hermetic_build/library_generation/owlbot/templates/java_library/.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/hermetic_build/library_generation/owlbot/templates/java_library/.github/workflows/ci.yaml b/hermetic_build/library_generation/owlbot/templates/java_library/.github/workflows/ci.yaml new file mode 100644 index 0000000000..a2d2c16129 --- /dev/null +++ b/hermetic_build/library_generation/owlbot/templates/java_library/.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/hermetic_build/library_generation/owlbot/templates/java_library/.github/workflows/renovate_config_check.yaml b/hermetic_build/library_generation/owlbot/templates/java_library/.github/workflows/renovate_config_check.yaml new file mode 100644 index 0000000000..47b9e87c98 --- /dev/null +++ b/hermetic_build/library_generation/owlbot/templates/java_library/.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/hermetic_build/library_generation/owlbot/templates/java_library/.github/workflows/samples.yaml b/hermetic_build/library_generation/owlbot/templates/java_library/.github/workflows/samples.yaml new file mode 100644 index 0000000000..186fd8bcfc --- /dev/null +++ b/hermetic_build/library_generation/owlbot/templates/java_library/.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/hermetic_build/library_generation/owlbot/templates/java_library/.github/workflows/update_generation_config.yaml b/hermetic_build/library_generation/owlbot/templates/java_library/.github/workflows/update_generation_config.yaml new file mode 100644 index 0000000000..165f54c6d1 --- /dev/null +++ b/hermetic_build/library_generation/owlbot/templates/java_library/.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: +{% raw %} +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_GITHUB_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_GITHUB_TOKEN }} +{% endraw %} diff --git a/hermetic_build/library_generation/owlbot/templates/java_library/.kokoro/build.sh b/hermetic_build/library_generation/owlbot/templates/java_library/.kokoro/build.sh new file mode 100755 index 0000000000..5223b6b6ae --- /dev/null +++ b/hermetic_build/library_generation/owlbot/templates/java_library/.kokoro/build.sh @@ -0,0 +1,141 @@ +#!/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 +{% if metadata['repo']['api_shortname'] == 'storage' %} + +export TEST_UNIVERSE_DOMAIN_CREDENTIAL=$(realpath ${KOKORO_GFILE_DIR}/secret_manager/client-library-test-universe-domain-credential) +export TEST_UNIVERSE_DOMAIN=$(gcloud secrets versions access latest --project cloud-devrel-kokoro-resources --secret=client-library-test-universe-domain) +export TEST_UNIVERSE_PROJECT_ID=$(gcloud secrets versions access latest --project cloud-devrel-kokoro-resources --secret=client-library-test-universe-project-id) +export TEST_UNIVERSE_LOCATION=$(gcloud secrets versions access latest --project cloud-devrel-kokoro-resources --secret=client-library-test-universe-storage-location) +{% endif %} + +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-{{ metadata['repo']['api_shortname'] }} +fi + +echo "exiting with ${RETURN_CODE}" +exit ${RETURN_CODE} diff --git a/hermetic_build/library_generation/owlbot/templates/java_library/.kokoro/common.cfg b/hermetic_build/library_generation/owlbot/templates/java_library/.kokoro/common.cfg new file mode 100644 index 0000000000..653d0e51ec --- /dev/null +++ b/hermetic_build/library_generation/owlbot/templates/java_library/.kokoro/common.cfg @@ -0,0 +1,19 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# Download trampoline resources. +gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/trampoline" + +# Use the trampoline script to run in docker. +build_file: "synthtool/.kokoro/trampoline.sh" + +# Configure the docker image for kokoro-trampoline. +env_vars: { + key: "TRAMPOLINE_IMAGE" + value: "gcr.io/cloud-devrel-kokoro-resources/python" +} + +# Tell the trampoline which build file to use. +env_vars: { + key: "TRAMPOLINE_BUILD_FILE" + value: "github/synthtool/.kokoro/build.sh" +} diff --git a/hermetic_build/library_generation/owlbot/templates/java_library/.kokoro/continuous.cfg b/hermetic_build/library_generation/owlbot/templates/java_library/.kokoro/continuous.cfg new file mode 100644 index 0000000000..18a4c35325 --- /dev/null +++ b/hermetic_build/library_generation/owlbot/templates/java_library/.kokoro/continuous.cfg @@ -0,0 +1 @@ +# Format: //devtools/kokoro/config/proto/build.proto diff --git a/hermetic_build/library_generation/owlbot/templates/java_library/.kokoro/presubmit.cfg b/hermetic_build/library_generation/owlbot/templates/java_library/.kokoro/presubmit.cfg new file mode 100644 index 0000000000..18a4c35325 --- /dev/null +++ b/hermetic_build/library_generation/owlbot/templates/java_library/.kokoro/presubmit.cfg @@ -0,0 +1 @@ +# Format: //devtools/kokoro/config/proto/build.proto diff --git a/hermetic_build/library_generation/owlbot/templates/java_library/.kokoro/presubmit/graalvm-native-a.cfg b/hermetic_build/library_generation/owlbot/templates/java_library/.kokoro/presubmit/graalvm-native-a.cfg new file mode 100644 index 0000000000..f40cd366d1 --- /dev/null +++ b/hermetic_build/library_generation/owlbot/templates/java_library/.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.58.1-SNAPSHOT" # {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/hermetic_build/library_generation/owlbot/templates/java_library/.kokoro/presubmit/graalvm-native-b.cfg b/hermetic_build/library_generation/owlbot/templates/java_library/.kokoro/presubmit/graalvm-native-b.cfg new file mode 100644 index 0000000000..beada8529d --- /dev/null +++ b/hermetic_build/library_generation/owlbot/templates/java_library/.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.58.1-SNAPSHOT" # {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/hermetic_build/library_generation/owlbot/templates/java_library/.kokoro/presubmit/graalvm-native-c.cfg b/hermetic_build/library_generation/owlbot/templates/java_library/.kokoro/presubmit/graalvm-native-c.cfg new file mode 100644 index 0000000000..8f7178f104 --- /dev/null +++ b/hermetic_build/library_generation/owlbot/templates/java_library/.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.58.1-SNAPSHOT" # {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/hermetic_build/library_generation/owlbot/templates/java_library/.kokoro/trampoline.sh b/hermetic_build/library_generation/owlbot/templates/java_library/.kokoro/trampoline.sh new file mode 100755 index 0000000000..0efc3be388 --- /dev/null +++ b/hermetic_build/library_generation/owlbot/templates/java_library/.kokoro/trampoline.sh @@ -0,0 +1,24 @@ +#!/bin/bash +# Copyright 2017 Google Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +set -eo pipefail +# Always run the cleanup script, regardless of the success of bouncing into +# the container. +function cleanup() { + chmod +x ${KOKORO_GFILE_DIR}/trampoline_cleanup.sh + ${KOKORO_GFILE_DIR}/trampoline_cleanup.sh + echo "cleanup"; +} +trap cleanup EXIT +python3 "${KOKORO_GFILE_DIR}/trampoline_v1.py" diff --git a/api-common-java/CODE_OF_CONDUCT.md b/hermetic_build/library_generation/owlbot/templates/java_library/CODE_OF_CONDUCT.md similarity index 100% rename from api-common-java/CODE_OF_CONDUCT.md rename to hermetic_build/library_generation/owlbot/templates/java_library/CODE_OF_CONDUCT.md diff --git a/hermetic_build/library_generation/owlbot/templates/java_library/CONTRIBUTING.md b/hermetic_build/library_generation/owlbot/templates/java_library/CONTRIBUTING.md new file mode 100644 index 0000000000..ff092b68e3 --- /dev/null +++ b/hermetic_build/library_generation/owlbot/templates/java_library/CONTRIBUTING.md @@ -0,0 +1,92 @@ +# 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 + +All code samples must be in compliance with the [java sample formatting guide][3]. +Code Samples must be bundled in separate Maven modules. + +The samples must be separate from the primary project for a few reasons: +1. Primary projects have a minimum Java version of Java 8 whereas samples can have + Java version of Java 11. Due to this we need the ability to + selectively exclude samples from a build run. +2. Many code samples depend on external GCP services and need + credentials to access the service. +3. Code samples are not released as Maven artifacts and must be excluded from + release builds. + +### Building + +```bash +mvn clean verify +``` + +Some samples require access to GCP services and require a service account: + +```bash +export GOOGLE_APPLICATION_CREDENTIALS=/path/to/service/account.json +mvn clean verify +``` + +### 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.spotify.fmt:fmt-maven-plugin:format +``` + +[1]: https://cloud.google.com/docs/authentication/getting-started#creating_a_service_account +[2]: https://maven.apache.org/settings.html#Active_Profiles +[3]: https://github.com/GoogleCloudPlatform/java-docs-samples/blob/main/SAMPLE_FORMAT.md \ No newline at end of file diff --git a/java-common-protos/LICENSE b/hermetic_build/library_generation/owlbot/templates/java_library/LICENSE similarity index 100% rename from java-common-protos/LICENSE rename to hermetic_build/library_generation/owlbot/templates/java_library/LICENSE diff --git a/hermetic_build/library_generation/owlbot/templates/java_library/README.md b/hermetic_build/library_generation/owlbot/templates/java_library/README.md new file mode 100644 index 0000000000..b9250b638c --- /dev/null +++ b/hermetic_build/library_generation/owlbot/templates/java_library/README.md @@ -0,0 +1,268 @@ +{% set group_id = metadata['repo']['distribution_name'].split(':')|first -%} +{% set artifact_id = metadata['repo']['distribution_name'].split(':')|last -%} +{% set version = metadata['library_version'] -%} +{% set repo_short = metadata['repo']['repo'].split('/')|last -%} + +# Google {{ metadata['repo']['name_pretty'] }} Client for Java + +Java idiomatic client for [{{metadata['repo']['name_pretty']}}][product-docs]. + +[![Maven][maven-version-image]][maven-version-link] +![Stability][stability-image] + +- [Product Documentation][product-docs] +- [Client Library Documentation][javadocs] +{% if 'partials' in metadata and metadata['partials']['deprecation_warning'] -%} +{{ metadata['partials']['deprecation_warning'] }} +{% elif metadata['repo']['release_level'] in ['preview'] %} +> Note: This client is a work-in-progress, and may occasionally +> make backwards-incompatible changes. +{% endif %} +{% if migrated_split_repo %} +:bus: In October 2022, this library has moved to +[google-cloud-java/{{ metadata['repo']['repo_short'] }}]( +https://github.com/googleapis/google-cloud-java/tree/main/{{ metadata['repo']['repo_short'] }}). +This repository will be archived in the future. +Future releases will appear in the new repository (https://github.com/googleapis/google-cloud-java/releases). +The Maven artifact coordinates (`{{ group_id }}:{{ artifact_id }}`) remain the same. +{% endif %} +## Quickstart + +{% if 'snippets' in metadata and metadata['snippets'][metadata['repo']['api_shortname'] + '_install_with_bom'] -%} +If you are using Maven with [BOM][libraries-bom], add this to your pom.xml file: + +```xml +{{ metadata['snippets'][metadata['repo']['api_shortname'] + '_install_with_bom'] }} +``` + +If you are using Maven without the BOM, add this to your dependencies: +{% elif monorepo and (group_id == "com.google.cloud" or group_id == "com.google.analytics" or group_id == "com.google.area120") %} +If you are using Maven with [BOM][libraries-bom], add this to your pom.xml file: + +```xml + + + + com.google.cloud + libraries-bom + {{ metadata['libraries_bom_version'] }} + pom + import + + + + + + + {{ group_id }} + {{ artifact_id }} + + +``` + +If you are using Maven without the BOM, add this to your dependencies: +{% else %} +If you are using Maven, add this to your pom.xml file: +{% endif %} + +```xml +{% if 'snippets' in metadata and metadata['snippets'][metadata['repo']['api_shortname'] + '_install_without_bom'] -%} +{{ metadata['snippets'][metadata['repo']['api_shortname'] + '_install_without_bom'] }} +{% else -%} + + {{ group_id }} + {{ artifact_id }} + {{ version }} + +{% endif -%} +``` + +{% if 'snippets' in metadata and metadata['snippets'][metadata['repo']['api_shortname'] + '_install_with_bom'] -%} +If you are using Gradle 5.x or later, add this to your dependencies: + +```Groovy +implementation platform('com.google.cloud:libraries-bom:{{metadata['libraries_bom_version']}}') + +implementation '{{ group_id }}:{{ artifact_id }}' +``` +{% endif -%} + +If you are using Gradle without BOM, add this to your dependencies: + +```Groovy +implementation '{{ group_id }}:{{ artifact_id }}:{{ version }}' +``` + +If you are using SBT, add this to your dependencies: + +```Scala +libraryDependencies += "{{ group_id }}" % "{{ artifact_id }}" % "{{ version }}" +``` + +## 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 {{metadata['repo']['name_pretty']}} APIs, and the authenticated principal must have the [IAM role(s)][predefined-iam-roles] required to access GCP resources using the {{metadata['repo']['name_pretty']}} API calls. + +## Getting Started + +### Prerequisites + +You will need a [Google Cloud Platform Console][developer-console] project with the {{metadata['repo']['name_pretty']}} [API enabled][enable-api]. +{% if metadata['repo']['requires_billing'] %}You will need to [enable billing][enable-billing] to use Google {{metadata['repo']['name_pretty']}}.{% endif %} +[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 `{{ artifact_id }}` library. See the [Quickstart](#quickstart) section +to add `{{ artifact_id }}` as a dependency in your code. + +## About {{metadata['repo']['name_pretty']}} + +{% if 'partials' in metadata and metadata['partials']['about'] -%} +{{ metadata['partials']['about'] }} +{% else %} +[{{ metadata['repo']['name_pretty'] }}][product-docs] {{ metadata['repo']['api_description'] }} + +See the [{{metadata['repo']['name_pretty']}} client library docs][javadocs] to learn how to +use this {{metadata['repo']['name_pretty']}} Client Library. +{% endif %} + +{% if 'partials' in metadata and metadata['partials']['custom_content'] -%} +{{ metadata['partials']['custom_content'] }} +{% endif %} + +{% if metadata['samples']|length %} +## Samples + +Samples are in the [`samples/`](https://github.com/{{ metadata['repo']['repo'] }}/tree/main/samples) directory. + +| Sample | Source Code | Try it | +| --------------------------- | --------------------------------- | ------ | +{% for sample in metadata['samples'] %}| {{ sample.title }} | [source code](https://github.com/{{ metadata['repo']['repo'] }}/blob/main/{{ sample.file }}) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/{{ metadata['repo']['repo'] }}&page=editor&open_in_editor={{ sample.file }}) | +{% endfor %} +{% endif %} + +## Troubleshooting + +To get help, follow the instructions in the [shared Troubleshooting document][troubleshooting]. + +{% if metadata['repo']['transport'] -%} +## Transport + +{% if metadata['repo']['transport'] == 'grpc' -%} +{{metadata['repo']['name_pretty']}} uses gRPC for the transport layer. +{% elif metadata['repo']['transport'] == 'http' -%} +{{metadata['repo']['name_pretty']}} uses HTTP/JSON for the transport layer. +{% elif metadata['repo']['transport'] == 'both' -%} +{{metadata['repo']['name_pretty']}} uses both gRPC and HTTP/JSON for the transport layer. +{% endif %} +{% endif -%} + +## Supported Java Versions + +Java {{ metadata['min_java_version'] }} 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 + +{% if 'partials' in metadata and metadata['partials']['versioning'] -%} +{{ metadata['partials']['versioning'] }} +{% else %} +This library follows [Semantic Versioning](http://semver.org/). + +{% if metadata['repo']['release_level'] in ['preview'] %} +It is currently in major version zero (``0.y.z``), which means that anything may change at any time +and the public API should not be considered stable. +{% endif %}{% endif %} + +## Contributing + +{% if 'partials' in metadata and metadata['partials']['contributing'] -%} +{{ metadata['partials']['contributing'] }} +{% else %} +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. +{% endif %} + +## License + +Apache 2.0 - See [LICENSE][license] for more information. + +Java is a registered trademark of Oracle and/or its affiliates. + +[product-docs]: {{metadata['repo']['product_documentation']}} +[javadocs]: {{metadata['repo']['client_documentation']}} +[stability-image]: https://img.shields.io/badge/stability-{% if metadata['repo']['release_level'] == 'stable' %}stable-green{% elif metadata['repo']['release_level'] == 'preview' %}preview-yellow{% else %}unknown-red{% endif %} +[maven-version-image]: https://img.shields.io/maven-central/v/{{ group_id }}/{{ artifact_id }}.svg +[maven-version-link]: https://central.sonatype.com/artifact/{{ group_id }}/{{ artifact_id }}/{{ version }} +[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/{{metadata['repo']['repo']}}/blob/main/CONTRIBUTING.md +[code-of-conduct]: https://github.com/{{metadata['repo']['repo']}}/blob/main/CODE_OF_CONDUCT.md#contributor-code-of-conduct +[license]: https://github.com/{{metadata['repo']['repo']}}/blob/main/LICENSE +{% if metadata['repo']['requires_billing'] %}[enable-billing]: https://cloud.google.com/apis/docs/getting-started#enabling_billing{% endif %} +{% if metadata['repo']['api_id'] %}[enable-api]: https://console.cloud.google.com/flows/enableapi?apiid={{ metadata['repo']['api_id'] }}{% endif %} +[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/api-common-java/SECURITY.md b/hermetic_build/library_generation/owlbot/templates/java_library/SECURITY.md similarity index 100% rename from api-common-java/SECURITY.md rename to hermetic_build/library_generation/owlbot/templates/java_library/SECURITY.md diff --git a/java-common-protos/java.header b/hermetic_build/library_generation/owlbot/templates/java_library/java.header similarity index 100% rename from java-common-protos/java.header rename to hermetic_build/library_generation/owlbot/templates/java_library/java.header diff --git a/java-iam/license-checks.xml b/hermetic_build/library_generation/owlbot/templates/java_library/license-checks.xml similarity index 100% rename from java-iam/license-checks.xml rename to hermetic_build/library_generation/owlbot/templates/java_library/license-checks.xml diff --git a/hermetic_build/library_generation/owlbot/templates/java_library/renovate.json b/hermetic_build/library_generation/owlbot/templates/java_library/renovate.json new file mode 100644 index 0000000000..d06023793d --- /dev/null +++ b/hermetic_build/library_generation/owlbot/templates/java_library/renovate.json @@ -0,0 +1,101 @@ +{% if migrated_split_repo %} +{ + "enabled": false, +{% else %} +{ +{% endif %} + "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": [ + "^{{metadata['repo']['distribution_name']}}", + "^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/hermetic_build/library_generation/owlbot/templates/java_library/samples/install-without-bom/pom.xml b/hermetic_build/library_generation/owlbot/templates/java_library/samples/install-without-bom/pom.xml new file mode 100644 index 0000000000..95c15422bf --- /dev/null +++ b/hermetic_build/library_generation/owlbot/templates/java_library/samples/install-without-bom/pom.xml @@ -0,0 +1,87 @@ +{% set group_id = metadata['repo']['distribution_name'].split(':')|first -%} +{% set artifact_id = metadata['repo']['distribution_name'].split(':')|last -%} +{% set version = metadata['library_version'] -%} + + + 4.0.0 + com.google.cloud + {{metadata['repo']['name']}}-install-without-bom + jar + Google {{metadata['repo']['name_pretty']}} Install Without Bom + https://github.com/{{metadata['repo']['repo']}} + + + + com.google.cloud.samples + shared-configuration + 1.2.0 + + + + 1.8 + 1.8 + UTF-8 + + + + + + + {{ group_id }} + {{ artifact_id }} + {{ version }} + + + + + junit + junit + 4.13.2 + test + + + com.google.truth + truth + 1.1.3 + test + + + + + + + + org.codehaus.mojo + build-helper-maven-plugin + 3.3.0 + + + add-snippets-source + + add-source + + + + ../snippets/src/main/java + + + + + add-snippets-tests + + add-test-source + + + + ../snippets/src/test/java + + + + + + + + diff --git a/hermetic_build/library_generation/owlbot/templates/java_library/samples/pom.xml b/hermetic_build/library_generation/owlbot/templates/java_library/samples/pom.xml new file mode 100644 index 0000000000..5fc52b1526 --- /dev/null +++ b/hermetic_build/library_generation/owlbot/templates/java_library/samples/pom.xml @@ -0,0 +1,56 @@ + + + 4.0.0 + com.google.cloud + google-cloud-{{metadata['repo']['name']}}-samples + 0.0.1-SNAPSHOT + pom + Google {{metadata['repo']['name_pretty']}} Samples Parent + https://github.com/{{metadata['repo']['repo']}} + + Java idiomatic client for Google Cloud Platform services. + + + + + com.google.cloud.samples + shared-configuration + 1.2.2 + + + + 1.8 + 1.8 + UTF-8 + + + + install-without-bom + snapshot + snippets + + + + + + org.apache.maven.plugins + maven-deploy-plugin + 3.1.3 + + true + + + + org.sonatype.plugins + nexus-staging-maven-plugin + 1.7.0 + + true + + + + + diff --git a/hermetic_build/library_generation/owlbot/templates/java_library/samples/snapshot/pom.xml b/hermetic_build/library_generation/owlbot/templates/java_library/samples/snapshot/pom.xml new file mode 100644 index 0000000000..f5bbc2554a --- /dev/null +++ b/hermetic_build/library_generation/owlbot/templates/java_library/samples/snapshot/pom.xml @@ -0,0 +1,86 @@ +{% set group_id = metadata['repo']['distribution_name'].split(':')|first -%} +{% set artifact_id = metadata['repo']['distribution_name'].split(':')|last -%} +{% set version = metadata['library_version'] -%} + + + 4.0.0 + com.google.cloud + {{metadata['repo']['name']}}-snapshot + jar + Google {{metadata['repo']['name_pretty']}} Snapshot Samples + https://github.com/{{metadata['repo']['repo']}} + + + + com.google.cloud.samples + shared-configuration + 1.2.0 + + + + 1.8 + 1.8 + UTF-8 + + + + + + {{ group_id }} + {{ artifact_id }} + {{ version }} + + + + + junit + junit + 4.13.2 + test + + + com.google.truth + truth + 1.1.3 + test + + + + + + + + org.codehaus.mojo + build-helper-maven-plugin + 3.3.0 + + + add-snippets-source + + add-source + + + + ../snippets/src/main/java + + + + + add-snippets-tests + + add-test-source + + + + ../snippets/src/test/java + + + + + + + + diff --git a/hermetic_build/library_generation/owlbot/templates/java_library/samples/snippets/pom.xml b/hermetic_build/library_generation/owlbot/templates/java_library/samples/snippets/pom.xml new file mode 100644 index 0000000000..e636801f41 --- /dev/null +++ b/hermetic_build/library_generation/owlbot/templates/java_library/samples/snippets/pom.xml @@ -0,0 +1,50 @@ +{% set group_id = metadata['repo']['distribution_name'].split(':')|first -%} +{% set artifact_id = metadata['repo']['distribution_name'].split(':')|last -%} +{% set version = metadata['library_version'] -%} + + + 4.0.0 + com.google.cloud + {{metadata['repo']['name']}}-snippets + jar + Google {{metadata['repo']['name_pretty']}} Snippets + https://github.com/{{metadata['repo']['repo']}} + + + + com.google.cloud.samples + shared-configuration + 1.2.0 + + + + 1.8 + 1.8 + UTF-8 + + + + + + {{ group_id }} + {{ artifact_id }} + {{ version }} + + + + junit + junit + 4.13.2 + test + + + com.google.truth + truth + 1.1.3 + test + + + diff --git a/hermetic_build/library_generation/owlbot/templates/poms/bom_pom.xml.j2 b/hermetic_build/library_generation/owlbot/templates/poms/bom_pom.xml.j2 new file mode 100644 index 0000000000..ddcef5226f --- /dev/null +++ b/hermetic_build/library_generation/owlbot/templates/poms/bom_pom.xml.j2 @@ -0,0 +1,41 @@ + + + 4.0.0 + {{main_module.group_id}} + {{main_module.artifact_id}}-bom + {{main_module.version}} + pom + {% if monorepo -%} + + com.google.cloud + google-cloud-pom-parent + {{ monorepo_version }} + ../../google-cloud-pom-parent/pom.xml + + {%- else -%} + + com.google.cloud + google-cloud-shared-config + 1.5.3 + + {%- endif %} + + Google {{name}} BOM + + BOM for {{name}} + + + + true + + + + {% for module in modules %} + + {{module.group_id}} + {{module.artifact_id}} + {{module.version}} + {% endfor %} + + + diff --git a/hermetic_build/library_generation/owlbot/templates/poms/cloud_pom.xml.j2 b/hermetic_build/library_generation/owlbot/templates/poms/cloud_pom.xml.j2 new file mode 100644 index 0000000000..d0ae8cd7c5 --- /dev/null +++ b/hermetic_build/library_generation/owlbot/templates/poms/cloud_pom.xml.j2 @@ -0,0 +1,156 @@ + + + 4.0.0 + {{module.group_id}} + {{module.artifact_id}} + {{module.version}} + jar + Google {{name}} + {%- if not monorepo %} + https://github.com/{{repo}} + {%- endif %} + {{name}} {{description}} + + {{parent_module.group_id}} + {{parent_module.artifact_id}} + {{parent_module.version}} + + + {{module.artifact_id}} + + + + io.grpc + grpc-api + + + io.grpc + grpc-stub + + + io.grpc + grpc-protobuf + + + com.google.api + api-common + + + com.google.protobuf + protobuf-java + + + com.google.api.grpc + proto-google-common-protos + +{% for module in proto_modules %} + + {{module.group_id}} + {{module.artifact_id}} + {% endfor %} + + com.google.guava + guava + + + com.google.api + gax + + + com.google.api + gax-grpc + + + com.google.api + gax-httpjson + + + com.google.api.grpc + proto-google-iam-v1 + +{%- if not monorepo %} + + com.google.api.grpc + grpc-google-common-protos + + + com.google.api.grpc + grpc-google-iam-v1 + +{%- endif %} + + org.threeten + threetenbp + + + +{%- if monorepo %} + + com.google.api.grpc + grpc-google-common-protos + test + + + com.google.api.grpc + grpc-google-iam-v1 + test + +{%- endif %} + + junit + junit + test + +{% for module in grpc_modules %} + + {{module.group_id}} + {{module.artifact_id}} + test + {% endfor %} + + + com.google.api + gax + testlib + test + + + com.google.api + gax-grpc + testlib + test + + + com.google.api + gax-httpjson + testlib + test + + + + {%- if not monorepo %} + + + java9 + + [9,) + + + + javax.annotation + javax.annotation-api + + + + + + + + + org.codehaus.mojo + flatten-maven-plugin + + + + {%- endif %} + diff --git a/hermetic_build/library_generation/owlbot/templates/poms/grpc_pom.xml.j2 b/hermetic_build/library_generation/owlbot/templates/poms/grpc_pom.xml.j2 new file mode 100644 index 0000000000..514861e7a7 --- /dev/null +++ b/hermetic_build/library_generation/owlbot/templates/poms/grpc_pom.xml.j2 @@ -0,0 +1,71 @@ + + 4.0.0 + {{module.group_id}} + {{module.artifact_id}} + {{module.version}} + {{module.artifact_id}} + GRPC library for {{main_module.artifact_id}} + + {{parent_module.group_id}} + {{parent_module.artifact_id}} + {{parent_module.version}} + + + + io.grpc + grpc-api + + + io.grpc + grpc-stub + + + io.grpc + grpc-protobuf + + + com.google.protobuf + protobuf-java + + + com.google.api.grpc + proto-google-common-protos + + + {{proto_module.group_id}} + {{proto_module.artifact_id}} + + + com.google.guava + guava + + + + {%- if not monorepo %} + + + java9 + + [9,) + + + + javax.annotation + javax.annotation-api + + + + + + + + + org.codehaus.mojo + flatten-maven-plugin + + + + {%- endif %} + diff --git a/hermetic_build/library_generation/owlbot/templates/poms/parent_pom.xml.j2 b/hermetic_build/library_generation/owlbot/templates/poms/parent_pom.xml.j2 new file mode 100644 index 0000000000..dcf922340e --- /dev/null +++ b/hermetic_build/library_generation/owlbot/templates/poms/parent_pom.xml.j2 @@ -0,0 +1,51 @@ + + + 4.0.0 + {{main_module.group_id}} + {{main_module.artifact_id}}-parent + pom + {{main_module.version}} + Google {{name}} Parent + + Java idiomatic client for Google Cloud Platform services. + + + {% if monorepo -%} + + com.google.cloud + google-cloud-jar-parent + {{ monorepo_version }} + ../google-cloud-jar-parent/pom.xml + + {%- else -%} + + com.google.cloud + google-cloud-shared-config + 1.5.3 + + {%- endif %} + + + UTF-8 + UTF-8 + github + {{main_module.artifact_id}}-parent + + + + +{% for module in modules %} + {{module.group_id}} + {{module.artifact_id}} + {{module.version}} + +{% endfor %} + + + + +{% for module in modules %} {{module.artifact_id}} +{% endfor %} {{main_module.artifact_id}}-bom + + + diff --git a/hermetic_build/library_generation/owlbot/templates/poms/proto_pom.xml.j2 b/hermetic_build/library_generation/owlbot/templates/poms/proto_pom.xml.j2 new file mode 100644 index 0000000000..886cd02663 --- /dev/null +++ b/hermetic_build/library_generation/owlbot/templates/poms/proto_pom.xml.j2 @@ -0,0 +1,48 @@ + + 4.0.0 + {{module.group_id}} + {{module.artifact_id}} + {{module.version}} + {{module.artifact_id}} + Proto library for {{main_module.artifact_id}} + + {{parent_module.group_id}} + {{parent_module.artifact_id}} + {{parent_module.version}} + + + + com.google.protobuf + protobuf-java + + + com.google.api.grpc + proto-google-common-protos + + + com.google.api.grpc + proto-google-iam-v1 + + + com.google.api + api-common + + + com.google.guava + guava + + + + {%- if not monorepo %} + + + + org.codehaus.mojo + flatten-maven-plugin + + + + {%- endif %} + diff --git a/hermetic_build/library_generation/owlbot/templates/poms/versions.txt.j2 b/hermetic_build/library_generation/owlbot/templates/poms/versions.txt.j2 new file mode 100644 index 0000000000..2ebaf85d34 --- /dev/null +++ b/hermetic_build/library_generation/owlbot/templates/poms/versions.txt.j2 @@ -0,0 +1,4 @@ +# Format: +# module:released-version:current-version +{% for module in modules %} +{{module.artifact_id}}:{% if module.release_version %}{{module.release_version}}{% else %}{{module.version}}{% endif %}:{{module.version}}{% endfor %} diff --git a/hermetic_build/library_generation/postprocess_library.sh b/hermetic_build/library_generation/postprocess_library.sh new file mode 100755 index 0000000000..eeec07156e --- /dev/null +++ b/hermetic_build/library_generation/postprocess_library.sh @@ -0,0 +1,111 @@ +#!/bin/bash +# +# Main functions to interact with owlbot post-processor + +# Runs the java owlbot post-processor. The resulting post-processed +# library gets stored in the $postprocessing_target argument +# Arguments +# 1 - postprocessing_target: path where the postprocessor will run. This folder +# has the following requirements +# - a .repo-metadata.json file must be present +# - an owlbot.py file must be present +# - an .OwlBot-hermetic.yaml file must be present +# 2 - preprocessed_sources_path: used to transfer the raw grpc, proto and gapic +# libraries into the postprocessing_target via copy-code +# 3 - versions_file: path to file containing versions to be applied to the poms +# 4 - owlbot_cli_source_folder: alternative folder with a structure exactly like +# googleapis-gen. It will be used instead of preprocessed_sources_path if +# 5 - is_monorepo: whether this library is a monorepo, which implies slightly +# different logic +# 6 - libraries_bom_version: used by our implementation of owlbot to render the +# readme +# 7 - library_version: used by our implementation of owlbot to render the +# readme +set -exo pipefail +scripts_root=$(dirname "$(readlink -f "$0")") + +postprocessing_target=$1 +preprocessed_sources_path=$2 +versions_file=$3 +owlbot_cli_source_folder=$4 +is_monorepo=$5 +libraries_bom_version=$6 +library_version=$7 +owlbot_yaml_file_name=".OwlBot-hermetic.yaml" + +source "${scripts_root}"/utils/utilities.sh + +declare -a required_inputs=("postprocessing_target" "versions_file" "is_monorepo") +for required_input in "${required_inputs[@]}"; do + if [[ -z "${!required_input}" ]]; then + echo "missing required ${required_input} argument, please specify one" + exit 1 + fi +done + +for owlbot_file in ".repo-metadata.json" "owlbot.py" "${owlbot_yaml_file_name}" +do + if [[ $(find "${postprocessing_target}" -name "${owlbot_file}" | wc -l) -eq 0 ]]; then + echo "necessary file for postprocessing '${owlbot_file}' was not found in postprocessing_target" + echo "please provide a postprocessing_target folder that is compatible with the OwlBot Java postprocessor" + exit 1 + fi +done + +if [[ -z "${owlbot_cli_source_folder}" ]]; then + owlbot_cli_source_folder=$(mktemp -d) + build_owlbot_cli_source_folder "${postprocessing_target}" "${owlbot_cli_source_folder}" "${preprocessed_sources_path}" +fi + + +# we determine the location of the .OwlBot-hermetic.yaml file by checking if the target +# folder is a monorepo folder or not +if [[ "${is_monorepo}" == "true" ]]; then + # the deep-remove-regex and deep-preserve-regex of the .OwlBot-hermetic.yaml + # files in the monorepo libraries assume that `copy-code` is run + # from the root of the monorepo. However, we call `copy-code` from inside each + # library, so a path like `/java-asset/google-.*/src` will not have + # any effect. We solve this by creating a temporary owlbot yaml with + # the patched paths. + # For example, we convert + # - "/java-asset/google-.*/src" + # to + # - "/google-.*/src" + + library_name=$(basename "${postprocessing_target}") + cat "${postprocessing_target}/${owlbot_yaml_file_name}" \ + | sed "s/- \"\/${library_name}/ - \"/" \ + > "${postprocessing_target}/.OwlBot.hermetic.yaml" + owlbot_yaml_relative_path=".OwlBot.hermetic.yaml" +else + owlbot_yaml_relative_path=".github/${owlbot_yaml_file_name}" +fi + +# Default values for running copy-code directly from host +repo_workspace="/workspace" +preprocessed_libraries_binding="${owlbot_cli_source_folder}" + +pushd "${postprocessing_target}" + +owl-bot copy-code \ + --source-repo-commit-hash=none \ + --source-repo="${owlbot_cli_source_folder}" \ + --config-file="${owlbot_yaml_relative_path}" + + +# clean the custom owlbot yaml +if [[ "${is_monorepo}" == "true" ]]; then + rm "${postprocessing_target}/.OwlBot.hermetic.yaml" +fi + +# run the postprocessor +echo 'running owl-bot post-processor' +pushd "${postprocessing_target}" +bash "${scripts_root}/owlbot/bin/entrypoint.sh" \ + "${scripts_root}" \ + "${versions_file}" \ + "${is_monorepo}" \ + "${libraries_bom_version}" \ + "${library_version}" + +popd # postprocessing_target diff --git a/hermetic_build/library_generation/requirements.in b/hermetic_build/library_generation/requirements.in new file mode 100644 index 0000000000..9ad0df45e0 --- /dev/null +++ b/hermetic_build/library_generation/requirements.in @@ -0,0 +1,5 @@ +attrs==24.2.0 +click==8.1.7 +jinja2==3.1.6 +lxml==5.3.0 +PyYAML==6.0.2 \ No newline at end of file diff --git a/hermetic_build/library_generation/requirements.txt b/hermetic_build/library_generation/requirements.txt new file mode 100644 index 0000000000..db09961924 --- /dev/null +++ b/hermetic_build/library_generation/requirements.txt @@ -0,0 +1,276 @@ +# +# This file is autogenerated by pip-compile with Python 3.12 +# by the following command: +# +# pip-compile --generate-hashes hermetic_build/library_generation/requirements.in +# +attrs==24.2.0 \ + --hash=sha256:5cfb1b9148b5b086569baec03f20d7b6bf3bcacc9a42bebf87ffaaca362f6346 \ + --hash=sha256:81921eb96de3191c8258c199618104dd27ac608d9366f5e35d011eae1867ede2 + # via -r requirements.in +click==8.1.7 \ + --hash=sha256:ae74fb96c20a0277a1d615f1e4d73c8414f5a98db8b799a7931d1582f3390c28 \ + --hash=sha256:ca9853ad459e787e2192211578cc907e7594e294c7ccc834310722b41b9ca6de + # via -r requirements.in +jinja2==3.1.6 \ + --hash=sha256:0137fb05990d35f1275a587e9aee6d56da821fc83491a0fb838183be43f66d6d \ + --hash=sha256:85ece4451f492d0c13c5dd7c13a64681a86afae63a5f347908daf103ce6d2f67 + # via -r requirements.in +lxml==5.3.0 \ + --hash=sha256:01220dca0d066d1349bd6a1726856a78f7929f3878f7e2ee83c296c69495309e \ + --hash=sha256:02ced472497b8362c8e902ade23e3300479f4f43e45f4105c85ef43b8db85229 \ + --hash=sha256:052d99051e77a4f3e8482c65014cf6372e61b0a6f4fe9edb98503bb5364cfee3 \ + --hash=sha256:07da23d7ee08577760f0a71d67a861019103e4812c87e2fab26b039054594cc5 \ + --hash=sha256:094cb601ba9f55296774c2d57ad68730daa0b13dc260e1f941b4d13678239e70 \ + --hash=sha256:0a7056921edbdd7560746f4221dca89bb7a3fe457d3d74267995253f46343f15 \ + --hash=sha256:0c120f43553ec759f8de1fee2f4794452b0946773299d44c36bfe18e83caf002 \ + --hash=sha256:0d7b36afa46c97875303a94e8f3ad932bf78bace9e18e603f2085b652422edcd \ + --hash=sha256:0fdf3a3059611f7585a78ee10399a15566356116a4288380921a4b598d807a22 \ + --hash=sha256:109fa6fede314cc50eed29e6e56c540075e63d922455346f11e4d7a036d2b8cf \ + --hash=sha256:146173654d79eb1fc97498b4280c1d3e1e5d58c398fa530905c9ea50ea849b22 \ + --hash=sha256:1473427aff3d66a3fa2199004c3e601e6c4500ab86696edffdbc84954c72d832 \ + --hash=sha256:1483fd3358963cc5c1c9b122c80606a3a79ee0875bcac0204149fa09d6ff2727 \ + --hash=sha256:168f2dfcfdedf611eb285efac1516c8454c8c99caf271dccda8943576b67552e \ + --hash=sha256:17e8d968d04a37c50ad9c456a286b525d78c4a1c15dd53aa46c1d8e06bf6fa30 \ + --hash=sha256:18feb4b93302091b1541221196a2155aa296c363fd233814fa11e181adebc52f \ + --hash=sha256:1afe0a8c353746e610bd9031a630a95bcfb1a720684c3f2b36c4710a0a96528f \ + --hash=sha256:1d04f064bebdfef9240478f7a779e8c5dc32b8b7b0b2fc6a62e39b928d428e51 \ + --hash=sha256:1fdc9fae8dd4c763e8a31e7630afef517eab9f5d5d31a278df087f307bf601f4 \ + --hash=sha256:1ffc23010330c2ab67fac02781df60998ca8fe759e8efde6f8b756a20599c5de \ + --hash=sha256:20094fc3f21ea0a8669dc4c61ed7fa8263bd37d97d93b90f28fc613371e7a875 \ + --hash=sha256:213261f168c5e1d9b7535a67e68b1f59f92398dd17a56d934550837143f79c42 \ + --hash=sha256:218c1b2e17a710e363855594230f44060e2025b05c80d1f0661258142b2add2e \ + --hash=sha256:23e0553b8055600b3bf4a00b255ec5c92e1e4aebf8c2c09334f8368e8bd174d6 \ + --hash=sha256:25f1b69d41656b05885aa185f5fdf822cb01a586d1b32739633679699f220391 \ + --hash=sha256:2b3778cb38212f52fac9fe913017deea2fdf4eb1a4f8e4cfc6b009a13a6d3fcc \ + --hash=sha256:2bc9fd5ca4729af796f9f59cd8ff160fe06a474da40aca03fcc79655ddee1a8b \ + --hash=sha256:2c226a06ecb8cdef28845ae976da407917542c5e6e75dcac7cc33eb04aaeb237 \ + --hash=sha256:2c3406b63232fc7e9b8783ab0b765d7c59e7c59ff96759d8ef9632fca27c7ee4 \ + --hash=sha256:2c86bf781b12ba417f64f3422cfc302523ac9cd1d8ae8c0f92a1c66e56ef2e86 \ + --hash=sha256:2d9b8d9177afaef80c53c0a9e30fa252ff3036fb1c6494d427c066a4ce6a282f \ + --hash=sha256:2dec2d1130a9cda5b904696cec33b2cfb451304ba9081eeda7f90f724097300a \ + --hash=sha256:2dfab5fa6a28a0b60a20638dc48e6343c02ea9933e3279ccb132f555a62323d8 \ + --hash=sha256:2ecdd78ab768f844c7a1d4a03595038c166b609f6395e25af9b0f3f26ae1230f \ + --hash=sha256:315f9542011b2c4e1d280e4a20ddcca1761993dda3afc7a73b01235f8641e903 \ + --hash=sha256:36aef61a1678cb778097b4a6eeae96a69875d51d1e8f4d4b491ab3cfb54b5a03 \ + --hash=sha256:384aacddf2e5813a36495233b64cb96b1949da72bef933918ba5c84e06af8f0e \ + --hash=sha256:3879cc6ce938ff4eb4900d901ed63555c778731a96365e53fadb36437a131a99 \ + --hash=sha256:3c174dc350d3ec52deb77f2faf05c439331d6ed5e702fc247ccb4e6b62d884b7 \ + --hash=sha256:3eb44520c4724c2e1a57c0af33a379eee41792595023f367ba3952a2d96c2aab \ + --hash=sha256:406246b96d552e0503e17a1006fd27edac678b3fcc9f1be71a2f94b4ff61528d \ + --hash=sha256:41ce1f1e2c7755abfc7e759dc34d7d05fd221723ff822947132dc934d122fe22 \ + --hash=sha256:423b121f7e6fa514ba0c7918e56955a1d4470ed35faa03e3d9f0e3baa4c7e492 \ + --hash=sha256:44264ecae91b30e5633013fb66f6ddd05c006d3e0e884f75ce0b4755b3e3847b \ + --hash=sha256:482c2f67761868f0108b1743098640fbb2a28a8e15bf3f47ada9fa59d9fe08c3 \ + --hash=sha256:4b0c7a688944891086ba192e21c5229dea54382f4836a209ff8d0a660fac06be \ + --hash=sha256:4c1fefd7e3d00921c44dc9ca80a775af49698bbfd92ea84498e56acffd4c5469 \ + --hash=sha256:4e109ca30d1edec1ac60cdbe341905dc3b8f55b16855e03a54aaf59e51ec8c6f \ + --hash=sha256:501d0d7e26b4d261fca8132854d845e4988097611ba2531408ec91cf3fd9d20a \ + --hash=sha256:516f491c834eb320d6c843156440fe7fc0d50b33e44387fcec5b02f0bc118a4c \ + --hash=sha256:51806cfe0279e06ed8500ce19479d757db42a30fd509940b1701be9c86a5ff9a \ + --hash=sha256:562e7494778a69086f0312ec9689f6b6ac1c6b65670ed7d0267e49f57ffa08c4 \ + --hash=sha256:56b9861a71575f5795bde89256e7467ece3d339c9b43141dbdd54544566b3b94 \ + --hash=sha256:5b8f5db71b28b8c404956ddf79575ea77aa8b1538e8b2ef9ec877945b3f46442 \ + --hash=sha256:5c2fb570d7823c2bbaf8b419ba6e5662137f8166e364a8b2b91051a1fb40ab8b \ + --hash=sha256:5c54afdcbb0182d06836cc3d1be921e540be3ebdf8b8a51ee3ef987537455f84 \ + --hash=sha256:5d6a6972b93c426ace71e0be9a6f4b2cfae9b1baed2eed2006076a746692288c \ + --hash=sha256:609251a0ca4770e5a8768ff902aa02bf636339c5a93f9349b48eb1f606f7f3e9 \ + --hash=sha256:62d172f358f33a26d6b41b28c170c63886742f5b6772a42b59b4f0fa10526cb1 \ + --hash=sha256:62f7fdb0d1ed2065451f086519865b4c90aa19aed51081979ecd05a21eb4d1be \ + --hash=sha256:658f2aa69d31e09699705949b5fc4719cbecbd4a97f9656a232e7d6c7be1a367 \ + --hash=sha256:65ab5685d56914b9a2a34d67dd5488b83213d680b0c5d10b47f81da5a16b0b0e \ + --hash=sha256:68934b242c51eb02907c5b81d138cb977b2129a0a75a8f8b60b01cb8586c7b21 \ + --hash=sha256:68b87753c784d6acb8a25b05cb526c3406913c9d988d51f80adecc2b0775d6aa \ + --hash=sha256:69959bd3167b993e6e710b99051265654133a98f20cec1d9b493b931942e9c16 \ + --hash=sha256:6a7095eeec6f89111d03dabfe5883a1fd54da319c94e0fb104ee8f23616b572d \ + --hash=sha256:6b038cc86b285e4f9fea2ba5ee76e89f21ed1ea898e287dc277a25884f3a7dfe \ + --hash=sha256:6ba0d3dcac281aad8a0e5b14c7ed6f9fa89c8612b47939fc94f80b16e2e9bc83 \ + --hash=sha256:6e91cf736959057f7aac7adfc83481e03615a8e8dd5758aa1d95ea69e8931dba \ + --hash=sha256:6ee8c39582d2652dcd516d1b879451500f8db3fe3607ce45d7c5957ab2596040 \ + --hash=sha256:6f651ebd0b21ec65dfca93aa629610a0dbc13dbc13554f19b0113da2e61a4763 \ + --hash=sha256:71a8dd38fbd2f2319136d4ae855a7078c69c9a38ae06e0c17c73fd70fc6caad8 \ + --hash=sha256:74068c601baff6ff021c70f0935b0c7bc528baa8ea210c202e03757c68c5a4ff \ + --hash=sha256:7437237c6a66b7ca341e868cda48be24b8701862757426852c9b3186de1da8a2 \ + --hash=sha256:747a3d3e98e24597981ca0be0fd922aebd471fa99d0043a3842d00cdcad7ad6a \ + --hash=sha256:74bcb423462233bc5d6066e4e98b0264e7c1bed7541fff2f4e34fe6b21563c8b \ + --hash=sha256:78d9b952e07aed35fe2e1a7ad26e929595412db48535921c5013edc8aa4a35ce \ + --hash=sha256:7b1cd427cb0d5f7393c31b7496419da594fe600e6fdc4b105a54f82405e6626c \ + --hash=sha256:7d3d1ca42870cdb6d0d29939630dbe48fa511c203724820fc0fd507b2fb46577 \ + --hash=sha256:7e2f58095acc211eb9d8b5771bf04df9ff37d6b87618d1cbf85f92399c98dae8 \ + --hash=sha256:7f41026c1d64043a36fda21d64c5026762d53a77043e73e94b71f0521939cc71 \ + --hash=sha256:81b4e48da4c69313192d8c8d4311e5d818b8be1afe68ee20f6385d0e96fc9512 \ + --hash=sha256:86a6b24b19eaebc448dc56b87c4865527855145d851f9fc3891673ff97950540 \ + --hash=sha256:874a216bf6afaf97c263b56371434e47e2c652d215788396f60477540298218f \ + --hash=sha256:89e043f1d9d341c52bf2af6d02e6adde62e0a46e6755d5eb60dc6e4f0b8aeca2 \ + --hash=sha256:8c72e9563347c7395910de6a3100a4840a75a6f60e05af5e58566868d5eb2d6a \ + --hash=sha256:8dc2c0395bea8254d8daebc76dcf8eb3a95ec2a46fa6fae5eaccee366bfe02ce \ + --hash=sha256:8f0de2d390af441fe8b2c12626d103540b5d850d585b18fcada58d972b74a74e \ + --hash=sha256:92e67a0be1639c251d21e35fe74df6bcc40cba445c2cda7c4a967656733249e2 \ + --hash=sha256:94d6c3782907b5e40e21cadf94b13b0842ac421192f26b84c45f13f3c9d5dc27 \ + --hash=sha256:97acf1e1fd66ab53dacd2c35b319d7e548380c2e9e8c54525c6e76d21b1ae3b1 \ + --hash=sha256:9ada35dd21dc6c039259596b358caab6b13f4db4d4a7f8665764d616daf9cc1d \ + --hash=sha256:9c52100e2c2dbb0649b90467935c4b0de5528833c76a35ea1a2691ec9f1ee7a1 \ + --hash=sha256:9e41506fec7a7f9405b14aa2d5c8abbb4dbbd09d88f9496958b6d00cb4d45330 \ + --hash=sha256:9e4b47ac0f5e749cfc618efdf4726269441014ae1d5583e047b452a32e221920 \ + --hash=sha256:9fb81d2824dff4f2e297a276297e9031f46d2682cafc484f49de182aa5e5df99 \ + --hash=sha256:a0eabd0a81625049c5df745209dc7fcef6e2aea7793e5f003ba363610aa0a3ff \ + --hash=sha256:a3d819eb6f9b8677f57f9664265d0a10dd6551d227afb4af2b9cd7bdc2ccbf18 \ + --hash=sha256:a87de7dd873bf9a792bf1e58b1c3887b9264036629a5bf2d2e6579fe8e73edff \ + --hash=sha256:aa617107a410245b8660028a7483b68e7914304a6d4882b5ff3d2d3eb5948d8c \ + --hash=sha256:aac0bbd3e8dd2d9c45ceb82249e8bdd3ac99131a32b4d35c8af3cc9db1657179 \ + --hash=sha256:ab6dd83b970dc97c2d10bc71aa925b84788c7c05de30241b9e96f9b6d9ea3080 \ + --hash=sha256:ace2c2326a319a0bb8a8b0e5b570c764962e95818de9f259ce814ee666603f19 \ + --hash=sha256:ae5fe5c4b525aa82b8076c1a59d642c17b6e8739ecf852522c6321852178119d \ + --hash=sha256:b11a5d918a6216e521c715b02749240fb07ae5a1fefd4b7bf12f833bc8b4fe70 \ + --hash=sha256:b1c8c20847b9f34e98080da785bb2336ea982e7f913eed5809e5a3c872900f32 \ + --hash=sha256:b369d3db3c22ed14c75ccd5af429086f166a19627e84a8fdade3f8f31426e52a \ + --hash=sha256:b710bc2b8292966b23a6a0121f7a6c51d45d2347edcc75f016ac123b8054d3f2 \ + --hash=sha256:bd96517ef76c8654446fc3db9242d019a1bb5fe8b751ba414765d59f99210b79 \ + --hash=sha256:c00f323cc00576df6165cc9d21a4c21285fa6b9989c5c39830c3903dc4303ef3 \ + --hash=sha256:c162b216070f280fa7da844531169be0baf9ccb17263cf5a8bf876fcd3117fa5 \ + --hash=sha256:c1a69e58a6bb2de65902051d57fde951febad631a20a64572677a1052690482f \ + --hash=sha256:c1f794c02903c2824fccce5b20c339a1a14b114e83b306ff11b597c5f71a1c8d \ + --hash=sha256:c24037349665434f375645fa9d1f5304800cec574d0310f618490c871fd902b3 \ + --hash=sha256:c300306673aa0f3ed5ed9372b21867690a17dba38c68c44b287437c362ce486b \ + --hash=sha256:c56a1d43b2f9ee4786e4658c7903f05da35b923fb53c11025712562d5cc02753 \ + --hash=sha256:c6379f35350b655fd817cd0d6cbeef7f265f3ae5fedb1caae2eb442bbeae9ab9 \ + --hash=sha256:c802e1c2ed9f0c06a65bc4ed0189d000ada8049312cfeab6ca635e39c9608957 \ + --hash=sha256:cb83f8a875b3d9b458cada4f880fa498646874ba4011dc974e071a0a84a1b033 \ + --hash=sha256:cf120cce539453ae086eacc0130a324e7026113510efa83ab42ef3fcfccac7fb \ + --hash=sha256:dd36439be765e2dde7660212b5275641edbc813e7b24668831a5c8ac91180656 \ + --hash=sha256:dd5350b55f9fecddc51385463a4f67a5da829bc741e38cf689f38ec9023f54ab \ + --hash=sha256:df5c7333167b9674aa8ae1d4008fa4bc17a313cc490b2cca27838bbdcc6bb15b \ + --hash=sha256:e63601ad5cd8f860aa99d109889b5ac34de571c7ee902d6812d5d9ddcc77fa7d \ + --hash=sha256:e92ce66cd919d18d14b3856906a61d3f6b6a8500e0794142338da644260595cd \ + --hash=sha256:e99f5507401436fdcc85036a2e7dc2e28d962550afe1cbfc07c40e454256a859 \ + --hash=sha256:ea2e2f6f801696ad7de8aec061044d6c8c0dd4037608c7cab38a9a4d316bfb11 \ + --hash=sha256:eafa2c8658f4e560b098fe9fc54539f86528651f61849b22111a9b107d18910c \ + --hash=sha256:ecd4ad8453ac17bc7ba3868371bffb46f628161ad0eefbd0a855d2c8c32dd81a \ + --hash=sha256:ee70d08fd60c9565ba8190f41a46a54096afa0eeb8f76bd66f2c25d3b1b83005 \ + --hash=sha256:eec1bb8cdbba2925bedc887bc0609a80e599c75b12d87ae42ac23fd199445654 \ + --hash=sha256:ef0c1fe22171dd7c7c27147f2e9c3e86f8bdf473fed75f16b0c2e84a5030ce80 \ + --hash=sha256:f2901429da1e645ce548bf9171784c0f74f0718c3f6150ce166be39e4dd66c3e \ + --hash=sha256:f422a209d2455c56849442ae42f25dbaaba1c6c3f501d58761c619c7836642ec \ + --hash=sha256:f65e5120863c2b266dbcc927b306c5b78e502c71edf3295dfcb9501ec96e5fc7 \ + --hash=sha256:f7d4a670107d75dfe5ad080bed6c341d18c4442f9378c9f58e5851e86eb79965 \ + --hash=sha256:f914c03e6a31deb632e2daa881fe198461f4d06e57ac3d0e05bbcab8eae01945 \ + --hash=sha256:fb66442c2546446944437df74379e9cf9e9db353e61301d1a0e26482f43f0dd8 + # via -r requirements.in +markupsafe==3.0.2 \ + --hash=sha256:0bff5e0ae4ef2e1ae4fdf2dfd5b76c75e5c2fa4132d05fc1b0dabcd20c7e28c4 \ + --hash=sha256:0f4ca02bea9a23221c0182836703cbf8930c5e9454bacce27e767509fa286a30 \ + --hash=sha256:1225beacc926f536dc82e45f8a4d68502949dc67eea90eab715dea3a21c1b5f0 \ + --hash=sha256:131a3c7689c85f5ad20f9f6fb1b866f402c445b220c19fe4308c0b147ccd2ad9 \ + --hash=sha256:15ab75ef81add55874e7ab7055e9c397312385bd9ced94920f2802310c930396 \ + --hash=sha256:1a9d3f5f0901fdec14d8d2f66ef7d035f2157240a433441719ac9a3fba440b13 \ + --hash=sha256:1c99d261bd2d5f6b59325c92c73df481e05e57f19837bdca8413b9eac4bd8028 \ + --hash=sha256:1e084f686b92e5b83186b07e8a17fc09e38fff551f3602b249881fec658d3eca \ + --hash=sha256:2181e67807fc2fa785d0592dc2d6206c019b9502410671cc905d132a92866557 \ + --hash=sha256:2cb8438c3cbb25e220c2ab33bb226559e7afb3baec11c4f218ffa7308603c832 \ + --hash=sha256:3169b1eefae027567d1ce6ee7cae382c57fe26e82775f460f0b2778beaad66c0 \ + --hash=sha256:3809ede931876f5b2ec92eef964286840ed3540dadf803dd570c3b7e13141a3b \ + --hash=sha256:38a9ef736c01fccdd6600705b09dc574584b89bea478200c5fbf112a6b0d5579 \ + --hash=sha256:3d79d162e7be8f996986c064d1c7c817f6df3a77fe3d6859f6f9e7be4b8c213a \ + --hash=sha256:444dcda765c8a838eaae23112db52f1efaf750daddb2d9ca300bcae1039adc5c \ + --hash=sha256:48032821bbdf20f5799ff537c7ac3d1fba0ba032cfc06194faffa8cda8b560ff \ + --hash=sha256:4aa4e5faecf353ed117801a068ebab7b7e09ffb6e1d5e412dc852e0da018126c \ + --hash=sha256:52305740fe773d09cffb16f8ed0427942901f00adedac82ec8b67752f58a1b22 \ + --hash=sha256:569511d3b58c8791ab4c2e1285575265991e6d8f8700c7be0e88f86cb0672094 \ + --hash=sha256:57cb5a3cf367aeb1d316576250f65edec5bb3be939e9247ae594b4bcbc317dfb \ + --hash=sha256:5b02fb34468b6aaa40dfc198d813a641e3a63b98c2b05a16b9f80b7ec314185e \ + --hash=sha256:6381026f158fdb7c72a168278597a5e3a5222e83ea18f543112b2662a9b699c5 \ + --hash=sha256:6af100e168aa82a50e186c82875a5893c5597a0c1ccdb0d8b40240b1f28b969a \ + --hash=sha256:6c89876f41da747c8d3677a2b540fb32ef5715f97b66eeb0c6b66f5e3ef6f59d \ + --hash=sha256:6e296a513ca3d94054c2c881cc913116e90fd030ad1c656b3869762b754f5f8a \ + --hash=sha256:70a87b411535ccad5ef2f1df5136506a10775d267e197e4cf531ced10537bd6b \ + --hash=sha256:7e94c425039cde14257288fd61dcfb01963e658efbc0ff54f5306b06054700f8 \ + --hash=sha256:846ade7b71e3536c4e56b386c2a47adf5741d2d8b94ec9dc3e92e5e1ee1e2225 \ + --hash=sha256:88416bd1e65dcea10bc7569faacb2c20ce071dd1f87539ca2ab364bf6231393c \ + --hash=sha256:88b49a3b9ff31e19998750c38e030fc7bb937398b1f78cfa599aaef92d693144 \ + --hash=sha256:8c4e8c3ce11e1f92f6536ff07154f9d49677ebaaafc32db9db4620bc11ed480f \ + --hash=sha256:8e06879fc22a25ca47312fbe7c8264eb0b662f6db27cb2d3bbbc74b1df4b9b87 \ + --hash=sha256:9025b4018f3a1314059769c7bf15441064b2207cb3f065e6ea1e7359cb46db9d \ + --hash=sha256:93335ca3812df2f366e80509ae119189886b0f3c2b81325d39efdb84a1e2ae93 \ + --hash=sha256:9778bd8ab0a994ebf6f84c2b949e65736d5575320a17ae8984a77fab08db94cf \ + --hash=sha256:9e2d922824181480953426608b81967de705c3cef4d1af983af849d7bd619158 \ + --hash=sha256:a123e330ef0853c6e822384873bef7507557d8e4a082961e1defa947aa59ba84 \ + --hash=sha256:a904af0a6162c73e3edcb969eeeb53a63ceeb5d8cf642fade7d39e7963a22ddb \ + --hash=sha256:ad10d3ded218f1039f11a75f8091880239651b52e9bb592ca27de44eed242a48 \ + --hash=sha256:b424c77b206d63d500bcb69fa55ed8d0e6a3774056bdc4839fc9298a7edca171 \ + --hash=sha256:b5a6b3ada725cea8a5e634536b1b01c30bcdcd7f9c6fff4151548d5bf6b3a36c \ + --hash=sha256:ba8062ed2cf21c07a9e295d5b8a2a5ce678b913b45fdf68c32d95d6c1291e0b6 \ + --hash=sha256:ba9527cdd4c926ed0760bc301f6728ef34d841f405abf9d4f959c478421e4efd \ + --hash=sha256:bbcb445fa71794da8f178f0f6d66789a28d7319071af7a496d4d507ed566270d \ + --hash=sha256:bcf3e58998965654fdaff38e58584d8937aa3096ab5354d493c77d1fdd66d7a1 \ + --hash=sha256:c0ef13eaeee5b615fb07c9a7dadb38eac06a0608b41570d8ade51c56539e509d \ + --hash=sha256:cabc348d87e913db6ab4aa100f01b08f481097838bdddf7c7a84b7575b7309ca \ + --hash=sha256:cdb82a876c47801bb54a690c5ae105a46b392ac6099881cdfb9f6e95e4014c6a \ + --hash=sha256:cfad01eed2c2e0c01fd0ecd2ef42c492f7f93902e39a42fc9ee1692961443a29 \ + --hash=sha256:d16a81a06776313e817c951135cf7340a3e91e8c1ff2fac444cfd75fffa04afe \ + --hash=sha256:d8213e09c917a951de9d09ecee036d5c7d36cb6cb7dbaece4c71a60d79fb9798 \ + --hash=sha256:e07c3764494e3776c602c1e78e298937c3315ccc9043ead7e685b7f2b8d47b3c \ + --hash=sha256:e17c96c14e19278594aa4841ec148115f9c7615a47382ecb6b82bd8fea3ab0c8 \ + --hash=sha256:e444a31f8db13eb18ada366ab3cf45fd4b31e4db1236a4448f68778c1d1a5a2f \ + --hash=sha256:e6a2a455bd412959b57a172ce6328d2dd1f01cb2135efda2e4576e8a23fa3b0f \ + --hash=sha256:eaa0a10b7f72326f1372a713e73c3f739b524b3af41feb43e4921cb529f5929a \ + --hash=sha256:eb7972a85c54febfb25b5c4b4f3af4dcc731994c7da0d8a0b4a6eb0640e1d178 \ + --hash=sha256:ee55d3edf80167e48ea11a923c7386f4669df67d7994554387f84e7d8b0a2bf0 \ + --hash=sha256:f3818cb119498c0678015754eba762e0d61e5b52d34c8b13d770f0719f7b1d79 \ + --hash=sha256:f8b3d067f2e40fe93e1ccdd6b2e1d16c43140e76f02fb1319a05cf2b79d99430 \ + --hash=sha256:fcabf5ff6eea076f859677f5f0b6b5c1a51e70a376b0579e0eadef8db48c6b50 + # via jinja2 +pyyaml==6.0.2 \ + --hash=sha256:01179a4a8559ab5de078078f37e5c1a30d76bb88519906844fd7bdea1b7729ff \ + --hash=sha256:0833f8694549e586547b576dcfaba4a6b55b9e96098b36cdc7ebefe667dfed48 \ + --hash=sha256:0a9a2848a5b7feac301353437eb7d5957887edbf81d56e903999a75a3d743086 \ + --hash=sha256:0b69e4ce7a131fe56b7e4d770c67429700908fc0752af059838b1cfb41960e4e \ + --hash=sha256:0ffe8360bab4910ef1b9e87fb812d8bc0a308b0d0eef8c8f44e0254ab3b07133 \ + --hash=sha256:11d8f3dd2b9c1207dcaf2ee0bbbfd5991f571186ec9cc78427ba5bd32afae4b5 \ + --hash=sha256:17e311b6c678207928d649faa7cb0d7b4c26a0ba73d41e99c4fff6b6c3276484 \ + --hash=sha256:1e2120ef853f59c7419231f3bf4e7021f1b936f6ebd222406c3b60212205d2ee \ + --hash=sha256:1f71ea527786de97d1a0cc0eacd1defc0985dcf6b3f17bb77dcfc8c34bec4dc5 \ + --hash=sha256:23502f431948090f597378482b4812b0caae32c22213aecf3b55325e049a6c68 \ + --hash=sha256:24471b829b3bf607e04e88d79542a9d48bb037c2267d7927a874e6c205ca7e9a \ + --hash=sha256:29717114e51c84ddfba879543fb232a6ed60086602313ca38cce623c1d62cfbf \ + --hash=sha256:2e99c6826ffa974fe6e27cdb5ed0021786b03fc98e5ee3c5bfe1fd5015f42b99 \ + --hash=sha256:39693e1f8320ae4f43943590b49779ffb98acb81f788220ea932a6b6c51004d8 \ + --hash=sha256:3ad2a3decf9aaba3d29c8f537ac4b243e36bef957511b4766cb0057d32b0be85 \ + --hash=sha256:3b1fdb9dc17f5a7677423d508ab4f243a726dea51fa5e70992e59a7411c89d19 \ + --hash=sha256:41e4e3953a79407c794916fa277a82531dd93aad34e29c2a514c2c0c5fe971cc \ + --hash=sha256:43fa96a3ca0d6b1812e01ced1044a003533c47f6ee8aca31724f78e93ccc089a \ + --hash=sha256:50187695423ffe49e2deacb8cd10510bc361faac997de9efef88badc3bb9e2d1 \ + --hash=sha256:5ac9328ec4831237bec75defaf839f7d4564be1e6b25ac710bd1a96321cc8317 \ + --hash=sha256:5d225db5a45f21e78dd9358e58a98702a0302f2659a3c6cd320564b75b86f47c \ + --hash=sha256:6395c297d42274772abc367baaa79683958044e5d3835486c16da75d2a694631 \ + --hash=sha256:688ba32a1cffef67fd2e9398a2efebaea461578b0923624778664cc1c914db5d \ + --hash=sha256:68ccc6023a3400877818152ad9a1033e3db8625d899c72eacb5a668902e4d652 \ + --hash=sha256:70b189594dbe54f75ab3a1acec5f1e3faa7e8cf2f1e08d9b561cb41b845f69d5 \ + --hash=sha256:797b4f722ffa07cc8d62053e4cff1486fa6dc094105d13fea7b1de7d8bf71c9e \ + --hash=sha256:7c36280e6fb8385e520936c3cb3b8042851904eba0e58d277dca80a5cfed590b \ + --hash=sha256:7e7401d0de89a9a855c839bc697c079a4af81cf878373abd7dc625847d25cbd8 \ + --hash=sha256:80bab7bfc629882493af4aa31a4cfa43a4c57c83813253626916b8c7ada83476 \ + --hash=sha256:82d09873e40955485746739bcb8b4586983670466c23382c19cffecbf1fd8706 \ + --hash=sha256:8388ee1976c416731879ac16da0aff3f63b286ffdd57cdeb95f3f2e085687563 \ + --hash=sha256:8824b5a04a04a047e72eea5cec3bc266db09e35de6bdfe34c9436ac5ee27d237 \ + --hash=sha256:8b9c7197f7cb2738065c481a0461e50ad02f18c78cd75775628afb4d7137fb3b \ + --hash=sha256:9056c1ecd25795207ad294bcf39f2db3d845767be0ea6e6a34d856f006006083 \ + --hash=sha256:936d68689298c36b53b29f23c6dbb74de12b4ac12ca6cfe0e047bedceea56180 \ + --hash=sha256:9b22676e8097e9e22e36d6b7bda33190d0d400f345f23d4065d48f4ca7ae0425 \ + --hash=sha256:a4d3091415f010369ae4ed1fc6b79def9416358877534caf6a0fdd2146c87a3e \ + --hash=sha256:a8786accb172bd8afb8be14490a16625cbc387036876ab6ba70912730faf8e1f \ + --hash=sha256:a9f8c2e67970f13b16084e04f134610fd1d374bf477b17ec1599185cf611d725 \ + --hash=sha256:bc2fa7c6b47d6bc618dd7fb02ef6fdedb1090ec036abab80d4681424b84c1183 \ + --hash=sha256:c70c95198c015b85feafc136515252a261a84561b7b1d51e3384e0655ddf25ab \ + --hash=sha256:cc1c1159b3d456576af7a3e4d1ba7e6924cb39de8f67111c735f6fc832082774 \ + --hash=sha256:ce826d6ef20b1bc864f0a68340c8b3287705cae2f8b4b1d932177dcc76721725 \ + --hash=sha256:d584d9ec91ad65861cc08d42e834324ef890a082e591037abe114850ff7bbc3e \ + --hash=sha256:d7fded462629cfa4b685c5416b949ebad6cec74af5e2d42905d41e257e0869f5 \ + --hash=sha256:d84a1718ee396f54f3a086ea0a66d8e552b2ab2017ef8b420e92edbc841c352d \ + --hash=sha256:d8e03406cac8513435335dbab54c0d385e4a49e4945d2909a581c83647ca0290 \ + --hash=sha256:e10ce637b18caea04431ce14fabcf5c64a1c61ec9c56b071a4b7ca131ca52d44 \ + --hash=sha256:ec031d5d2feb36d1d1a24380e4db6d43695f3748343d99434e6f5f9156aaa2ed \ + --hash=sha256:ef6107725bd54b262d6dedcc2af448a266975032bc85ef0172c5f059da6325b4 \ + --hash=sha256:efdca5630322a10774e8e98e1af481aad470dd62c3170801852d752aa7a783ba \ + --hash=sha256:f753120cb8181e736c57ef7636e83f31b9c0d1722c516f7e86cf15b7aa57ff12 \ + --hash=sha256:ff3824dc5261f50c9b0dfb3be22b4567a6f938ccce4587b38952d85fd9e9afe4 + # via -r requirements.in diff --git a/hermetic_build/library_generation/setup.py b/hermetic_build/library_generation/setup.py new file mode 100755 index 0000000000..cce0a27d8b --- /dev/null +++ b/hermetic_build/library_generation/setup.py @@ -0,0 +1,34 @@ +""" +Package information of library_generation python scripts +""" + +from setuptools import setup + +setup( + name="library_generation", + version="0.1", + python_requires=">=3.12", + package_dir={ + "library_generation": ".", + "synthtool": "owlbot/synthtool", + }, + package_data={ + "library_generation": [ + "generate_library.sh", + "postprocess_library.sh", + "utils/utilities.sh", + "templates/*.j2", + "gapic-generator-java-wrapper", + "owlbot/bin/*.sh", + "owlbot/src/*.py", + "owlbot/src/poms/*.py", + "owlbot/templates/clirr/*.j2", + "owlbot/templates/poms/*.j2", + "owlbot/templates/java_library/.github/**/*", + "owlbot/templates/java_library/**/*", + "owlbot/templates/java_library/.kokoro/build.sh", + "owlbot/templates/java_library/.kokoro/presubmit/graalvm-*.cfg", + ], + "synthtool": ["owlbot/synthtool/**/*"], + }, +) diff --git a/hermetic_build/library_generation/templates/gapic-libraries-bom.xml.j2 b/hermetic_build/library_generation/templates/gapic-libraries-bom.xml.j2 new file mode 100644 index 0000000000..45dbdf42ce --- /dev/null +++ b/hermetic_build/library_generation/templates/gapic-libraries-bom.xml.j2 @@ -0,0 +1,37 @@ + + + 4.0.0 + com.google.cloud + gapic-libraries-bom + pom + {{ monorepo_version }} + Google Cloud Java BOM + + BOM for the libraries in google-cloud-java repository. Users should not + depend on this artifact explicitly because this BOM is an implementation + detail of the Libraries BOM. + + + + google-cloud-pom-parent + com.google.cloud + {{ monorepo_version }} + ../google-cloud-pom-parent/pom.xml + + + + + {%- for bom_config in bom_configs %} + + {{ bom_config.group_id }} + {{ bom_config.artifact_id }} + {{ bom_config.version }} + {%- if bom_config.is_import %} + pom + import + {%- endif %} + + {%- endfor %} + + + diff --git a/hermetic_build/library_generation/templates/owlbot.py.j2 b/hermetic_build/library_generation/templates/owlbot.py.j2 new file mode 100644 index 0000000000..7657d2d422 --- /dev/null +++ b/hermetic_build/library_generation/templates/owlbot.py.j2 @@ -0,0 +1,30 @@ +# 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 +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import synthtool as s +{% if should_include_templates %}from synthtool.languages import java{% endif %} + +for library in s.get_staging_dirs(): + # put any special-case replacements here + s.move(library) + +s.remove_staging_dirs(){% if should_include_templates %} +java.common_templates( + monorepo=True,{% if template_excludes %} + excludes=[ + {%- for exclude in template_excludes %} + "{{ exclude }}", + {%- endfor %} + ],{% endif %} +){% endif %} \ No newline at end of file diff --git a/hermetic_build/library_generation/templates/owlbot.yaml.monorepo.j2 b/hermetic_build/library_generation/templates/owlbot.yaml.monorepo.j2 new file mode 100644 index 0000000000..37096be0ee --- /dev/null +++ b/hermetic_build/library_generation/templates/owlbot.yaml.monorepo.j2 @@ -0,0 +1,37 @@ +# 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. + +{% if artifact_id %} +deep-remove-regex: +- "/{{ module_name }}/grpc-google-.*/src" +- "/{{ module_name }}/proto-google-.*/src" +- "/{{ module_name }}/google-.*/src" +- "/{{ module_name }}/samples/snippets/generated" + +deep-preserve-regex: +- "/{{ module_name }}/google-.*/src/test/java/com/google/cloud/.*/v.*/it/IT.*Test.java" +- "/{{ module_name }}/google-.*/src/main/java/com/google/cloud/.*/v.*/stub/Version.java" + +deep-copy-regex: +- source: "/{{ proto_path }}/(v.*)/.*-java/proto-google-.*/src" + dest: "/owl-bot-staging/{{ module_name }}/$1/proto-{{ artifact_id }}-$1/src" +- source: "/{{ proto_path }}/(v.*)/.*-java/grpc-google-.*/src" + dest: "/owl-bot-staging/{{ module_name }}/$1/grpc-{{ artifact_id }}-$1/src" +- source: "/{{ proto_path }}/(v.*)/.*-java/gapic-google-.*/src" + dest: "/owl-bot-staging/{{ module_name }}/$1/{{ artifact_id }}/src" +- source: "/{{ proto_path }}/(v.*)/.*-java/samples/snippets/generated" + dest: "/owl-bot-staging/{{ module_name }}/$1/samples/snippets/generated" +{%- endif %} + +api-name: {{ api_shortname }} diff --git a/hermetic_build/library_generation/templates/root-pom.xml.j2 b/hermetic_build/library_generation/templates/root-pom.xml.j2 new file mode 100644 index 0000000000..56704aa4e4 --- /dev/null +++ b/hermetic_build/library_generation/templates/root-pom.xml.j2 @@ -0,0 +1,88 @@ + + + 4.0.0 + google-cloud-java + com.google.cloud + 0.201.0 + pom + + + true + + + + gapic-libraries-bom + google-cloud-jar-parent + google-cloud-pom-parent + {%- for module in modules %} + {{ module }} + {%- endfor %} + + + + + + + org.apache.maven.plugins + maven-deploy-plugin + 3.1.3 + + true + + + + + + + + release-staging-repository + + + + !gpg.executable + + + + + sonatype-nexus-snapshots + https://google.oss.sonatype.org/content/repositories/snapshots + + + sonatype-nexus-staging + https://google.oss.sonatype.org/service/local/staging/deploy/maven2/ + + + + + + + org.sonatype.plugins + nexus-staging-maven-plugin + 1.7.0 + true + + sonatype-nexus-staging + https://google.oss.sonatype.org/ + false + + + + + + + release-non-google-oss-sonatype + + + + org.sonatype.plugins + nexus-staging-maven-plugin + + ossrh + https://oss.sonatype.org/ + + + + + + + diff --git a/hermetic_build/library_generation/tests/__init__.py b/hermetic_build/library_generation/tests/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/hermetic_build/library_generation/tests/cli/__init__.py b/hermetic_build/library_generation/tests/cli/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/hermetic_build/library_generation/tests/cli/entry_point_unit_tests.py b/hermetic_build/library_generation/tests/cli/entry_point_unit_tests.py new file mode 100644 index 0000000000..83a4932805 --- /dev/null +++ b/hermetic_build/library_generation/tests/cli/entry_point_unit_tests.py @@ -0,0 +1,325 @@ +# 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 +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT 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 shutil +import unittest +from pathlib import Path +from unittest.mock import patch, ANY +from click.testing import CliRunner +from library_generation.cli.entry_point import ( + generate, + validate_generation_config, + __generate_repo_impl as generate_impl, +) +from common.model.generation_config import GenerationConfig + +script_dir = os.path.dirname(os.path.realpath(__file__)) +test_resource_dir = os.path.join(script_dir, "..", "resources", "test-config") + + +class EntryPointTest(unittest.TestCase): + def test_entry_point_without_default_config_raise_file_exception(self): + os.chdir(script_dir) + runner = CliRunner() + # noinspection PyTypeChecker + result = runner.invoke(generate) + self.assertEqual(1, result.exit_code) + self.assertEqual(FileNotFoundError, result.exc_info[0]) + self.assertRegex( + result.exception.args[0], "generation_config.yaml does not exist." + ) + + def test_entry_point_with_invalid_config_raise_file_exception(self): + os.chdir(script_dir) + runner = CliRunner() + # noinspection PyTypeChecker + result = runner.invoke( + generate, ["--generation-config-path=/non-existent/file"] + ) + self.assertEqual(1, result.exit_code) + self.assertEqual(FileNotFoundError, result.exc_info[0]) + self.assertRegex(result.exception.args[0], "/non-existent/file does not exist.") + + def test_entry_point_with_invalid_generation_input_raise_file_exception( + self, + ): + os.chdir(script_dir) + runner = CliRunner() + # noinspection PyTypeChecker + result = runner.invoke(generate, ["--generation-input=/non-existent/folder"]) + self.assertEqual(1, result.exit_code) + self.assertEqual(FileNotFoundError, result.exc_info[0]) + self.assertRegex( + result.exception.args[0], + "/non-existent/folder/generation_config.yaml does not exist.", + ) + + def test_validate_generation_config_succeeds( + self, + ): + runner = CliRunner() + # noinspection PyTypeChecker + result = runner.invoke( + validate_generation_config, + [f"--generation-config-path={test_resource_dir}/generation_config.yaml"], + ) + self.assertEqual(0, result.exit_code) + + def test_validate_generation_config_with_duplicate_library_name_raise_file_exception( + self, + ): + runner = CliRunner() + # noinspection PyTypeChecker + result = runner.invoke( + validate_generation_config, + [ + f"--generation-config-path={test_resource_dir}/generation_config_with_duplicate_library_name.yaml" + ], + ) + self.assertEqual(1, result.exit_code) + self.assertEqual(SystemExit, result.exc_info[0]) + self.assertRegex( + result.output, + "have the same library name", + ) + + @patch("library_generation.cli.entry_point.generate_from_yaml") + def test_generate_non_monorepo_without_library_names_full_generation( + self, + generate_from_yaml, + ): + """ + this tests confirms the behavior of generation of non monorepos + (HW libraries). generate() should call generate_from_yaml() + with target_library_names=None in order to trigger the full generation + """ + config_path = f"{test_resource_dir}/generation_config.yaml" + self.assertFalse(GenerationConfig.from_yaml(config_path).is_monorepo()) + # we call the implementation method directly since click + # does special handling when a method is annotated with @main.command() + generate_impl( + generation_config_path=config_path, + generation_input=None, + library_names=None, + api_path=None, + repository_path=".", + api_definitions_path=".", + ) + generate_from_yaml.assert_called_with( + config=ANY, + repository_path=ANY, + api_definitions_path=ANY, + target_library_names=None, + target_api_path=None, + ) + + @patch("library_generation.cli.entry_point.generate_from_yaml") + def test_generate_non_monorepo_with_library_names_full_generation( + self, + generate_from_yaml, + ): + """ + this tests confirms the behavior of generation of non monorepos + (HW libraries). + generate() should call generate_from_yaml() with + target_library_names equals includes. + """ + config_path = f"{test_resource_dir}/generation_config.yaml" + self.assertFalse(GenerationConfig.from_yaml(config_path).is_monorepo()) + # we call the implementation method directly since click + # does special handling when a method is annotated with @main.command() + generate_impl( + generation_config_path=config_path, + generation_input=None, + library_names="non-existent-library", + api_path=None, + repository_path=".", + api_definitions_path=".", + ) + generate_from_yaml.assert_called_with( + config=ANY, + repository_path=ANY, + api_definitions_path=ANY, + target_library_names=None, + target_api_path=None, + ) + + @patch("library_generation.cli.entry_point.generate_from_yaml") + def test_generate_monorepo_with_common_protos_without_library_names_triggers_full_generation( + self, + generate_from_yaml, + ): + """ + this tests confirms the behavior of generation of a monorepo with + common protos. + generate() should call generate_from_yaml() with + target_library_names=None in order to trigger the full generation + """ + config_path = f"{test_resource_dir}/monorepo_with_common_protos.yaml" + self.assertTrue(GenerationConfig.from_yaml(config_path).is_monorepo()) + # we call the implementation method directly since click + # does special handling when a method is annotated with @main.command() + generate_impl( + generation_config_path=config_path, + generation_input=None, + library_names=None, + api_path=None, + repository_path=".", + api_definitions_path=".", + ) + generate_from_yaml.assert_called_with( + config=ANY, + repository_path=ANY, + api_definitions_path=ANY, + target_library_names=None, + target_api_path=None, + ) + + @patch("library_generation.cli.entry_point.generate_from_yaml") + def test_generate_monorepo_with_common_protos_with_library_names_triggers_full_generation( + self, + generate_from_yaml, + ): + """ + this tests confirms the behavior of generation of a monorepo with + common protos. + target_library_names is the same as includes. + """ + config_path = f"{test_resource_dir}/monorepo_with_common_protos.yaml" + self.assertTrue(GenerationConfig.from_yaml(config_path).is_monorepo()) + # we call the implementation method directly since click + # does special handling when a method is annotated with @main.command() + generate_impl( + generation_config_path=config_path, + generation_input=None, + library_names="iam,non-existent-library", + api_path=None, + repository_path=".", + api_definitions_path=".", + ) + generate_from_yaml.assert_called_with( + config=ANY, + repository_path=ANY, + api_definitions_path=ANY, + target_library_names=None, + target_api_path=None, + ) + + @patch("library_generation.cli.entry_point.generate_from_yaml") + def test_generate_monorepo_without_library_names_trigger_full_generation( + self, + generate_from_yaml, + ): + """ + this tests confirms the behavior of generation of a monorepo without + common protos. + generate() should call generate_from_yaml() with + target_library_names=changed libraries which does not trigger the full + generation. + """ + config_path = f"{test_resource_dir}/monorepo_without_common_protos.yaml" + self.assertTrue(GenerationConfig.from_yaml(config_path).is_monorepo()) + # we call the implementation method directly since click + # does special handling when a method is annotated with @main.command() + generate_impl( + generation_config_path=config_path, + generation_input=None, + library_names=None, + api_path=None, + repository_path=".", + api_definitions_path=".", + ) + generate_from_yaml.assert_called_with( + config=ANY, + repository_path=ANY, + api_definitions_path=ANY, + target_library_names=None, + target_api_path=None, + ) + + @patch("library_generation.cli.entry_point.generate_from_yaml") + def test_generate_monorepo_with_library_names_trigger_selective_generation( + self, + generate_from_yaml, + ): + """ + this tests confirms the behavior of generation of a monorepo without + common protos. + generate() should call generate_from_yaml() with + target_library_names=changed libraries which does not trigger the full + generation. + """ + config_path = f"{test_resource_dir}/monorepo_without_common_protos.yaml" + self.assertTrue(GenerationConfig.from_yaml(config_path).is_monorepo()) + # we call the implementation method directly since click + # does special handling when a method is annotated with @main.command() + generate_impl( + generation_config_path=config_path, + generation_input=None, + library_names="asset", + api_path=None, + repository_path=".", + api_definitions_path=".", + ) + generate_from_yaml.assert_called_with( + config=ANY, + repository_path=ANY, + api_definitions_path=ANY, + target_library_names=["asset"], + target_api_path=None, + ) + + @patch("library_generation.cli.entry_point.generate_from_yaml") + @patch("common.model.generation_config.GenerationConfig.from_yaml") + def test_generate_provide_generation_input( + self, + mock_from_yaml, + mock_generate_from_yaml, + ): + """ + This test confirms that when no generation_config_path and + only generation_input is provided, it looks inside this path + for generation config and creates versions file when not exists + """ + config_path = f"{test_resource_dir}/generation_config.yaml" + self._create_folder_in_current_dir("test-output") + # we call the implementation method directly since click + # does special handling when a method is annotated with @main.command() + generate_impl( + generation_config_path=None, + generation_input=test_resource_dir, + library_names="asset", + api_path=None, + repository_path="./test-output", + api_definitions_path=".", + ) + mock_from_yaml.assert_called_with(os.path.abspath(config_path)) + self.assertTrue(os.path.exists(f"test-output/versions.txt")) + + def tearDown(self): + # clean up after + if os.path.exists("./output"): + shutil.rmtree(Path("./output")) + if os.path.exists("./test-output"): + shutil.rmtree(Path("./test-output")) + + def _create_folder_in_current_dir(self, folder_name): + """Creates a folder in the current directory.""" + try: + os.makedirs( + folder_name, exist_ok=True + ) # exist_ok prevents errors if folder exists + print(f"Folder '{folder_name}' created successfully.") + except OSError as e: + print(f"Error creating folder '{folder_name}': {e}") diff --git a/hermetic_build/library_generation/tests/cli/versions.txt b/hermetic_build/library_generation/tests/cli/versions.txt new file mode 100644 index 0000000000..e69de29bb2 diff --git a/hermetic_build/library_generation/tests/compare_poms.py b/hermetic_build/library_generation/tests/compare_poms.py new file mode 100644 index 0000000000..b4d2947166 --- /dev/null +++ b/hermetic_build/library_generation/tests/compare_poms.py @@ -0,0 +1,131 @@ +""" +Utility to compare the contents of two XML files. +This focuses on the tree structure of both XML files, meaning that element order and whitespace will be disregarded. +The only comparison points are: element path (e.g. project/dependencies) and element text +There is a special case for `dependency`, where the maven coordinates are prepared as well +""" + +from library_generation.utils.utilities import eprint +import xml.etree.ElementTree as et +from collections import Counter +import sys +import os + +current = os.path.dirname(os.path.realpath(__file__)) +parent = os.path.dirname(current) +sys.path.append(parent) + + +def get_text_from_element(node, element_name, namespace): + """ + Convenience method to access a node's child elements via path and get + its text. + """ + child = node.find(namespace + element_name) + return child.text if child is not None else "" + + +def print_counter(counter): + """ + Convenience method to pretty print the contents of a Counter (or dict) + """ + for key, value in counter.items(): + eprint(f"{key}: {value}") + + +def append_to_element_list(node, path, elements): + """ + Recursively traverses a node tree and appends element text to a given + `elements` array. If the element tag is `dependency` + then the maven coordinates for its children will be computed as well + """ + namespace_start, namespace_end, tag_name = node.tag.rpartition("}") + namespace = namespace_start + namespace_end + if tag_name == "dependency": + group_id = get_text_from_element(node, "groupId", namespace) + artifact_id = get_text_from_element(node, "artifactId", namespace) + artifact_str = "" + artifact_str += group_id + artifact_str += ":" + artifact_id + elements.append(path + "/" + tag_name + "=" + artifact_str) + if node.text and len(node.text.strip()) > 0: + elements.append(path + "/" + tag_name + "=" + node.text) + + if tag_name == "version": + # versions may be yet to be processed, we disregard them + return elements + + for child in node: + child_path = path + "/" + tag_name + append_to_element_list(child, child_path, elements) + + return elements + + +def compare_xml(expected, actual, print_trees): + """ + compares two XMLs for content differences + the argument print_whole_trees determines if both trees should be printed + """ + try: + expected_tree = et.parse(expected) + actual_tree = et.parse(actual) + except et.ParseError as e: + eprint(f"Error parsing XML") + raise e + except FileNotFoundError as e: + eprint(f"Error reading file") + raise e + + expected_elements = [] + actual_elements = [] + + append_to_element_list(expected_tree.getroot(), "/", expected_elements) + append_to_element_list(actual_tree.getroot(), "/", actual_elements) + + expected_counter = Counter(expected_elements) + actual_counter = Counter(actual_elements) + intersection = expected_counter & actual_counter + only_in_expected = expected_counter - intersection + only_in_actual = actual_counter - intersection + if print_trees: + eprint("expected") + print_counter(actual_counter) + eprint("actual") + print_counter(expected_counter) + if len(only_in_expected) > 0 or len(only_in_actual) > 0: + eprint("only in " + expected) + print_counter(only_in_expected) + eprint("only in " + actual) + print_counter(only_in_actual) + return True + return False + + +def compare_pom_in_subdir(base_dir: str, subdir: str) -> bool: + golden = os.path.join(base_dir, subdir, "pom-golden.xml") + pom = os.path.join(base_dir, subdir, "pom.xml") + return compare_xml( + golden, + pom, + False, + ) + + +if __name__ == "__main__": + if len(sys.argv) != 4: + eprint( + "Usage: python compare_xml.py " + ) + sys.exit(1) + + file1 = sys.argv[1] + file2 = sys.argv[2] + print_whole_trees = sys.argv[3] + has_diff = compare_xml(file1, file2, print_whole_trees) + + if has_diff: + eprint(f"The poms are different") + sys.exit(1) + eprint("The XML files are the same.") + sys.exit(0) diff --git a/hermetic_build/library_generation/tests/generate_library_unit_tests.py b/hermetic_build/library_generation/tests/generate_library_unit_tests.py new file mode 100644 index 0000000000..de3b73d0e3 --- /dev/null +++ b/hermetic_build/library_generation/tests/generate_library_unit_tests.py @@ -0,0 +1,201 @@ +# 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 +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT 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 subprocess +import unittest +import os +from library_generation.utils.utilities import ( + run_process_and_print_output as bash_call, + run_process_and_get_output_string as get_bash_call_output, +) +from library_generation.generate_composed_library import _construct_effective_arg +from common.model.gapic_config import GapicConfig +from common.model.gapic_inputs import GapicInputs +from common.model.generation_config import GenerationConfig +from common.model.library_config import LibraryConfig + +script_dir = os.path.dirname(os.path.realpath(__file__)) + + +class GenerateLibraryUnitTests(unittest.TestCase): + """ + Confirms the correct behavior of `library_generation/utils/utilities.sh`. + + Note that there is an already existing, shell-based, test suite for + generate_library.sh, but these tests will soon be transferred to this one as + an effort to unify the implementation of the Hermetic Build scripts as + python-only. New tests for `utilities.sh` should be added in this file. + """ + + TEST_ARCHITECTURE = "linux-x86_64" + + def setUp(self): + # we create a simulated home folder that has a fake generator jar + # in its well-known location + self.simulated_home = get_bash_call_output("mktemp -d") + bash_call(f"mkdir {self.simulated_home}/.library_generation") + # We create a per-test directory where all output files will be created into. + # Each folder will be deleted after its corresponding test finishes. + test_dir = get_bash_call_output("mktemp -d") + self.output_folder = self._run_command_and_get_sdout( + "get_output_folder", + cwd=test_dir, + ) + bash_call(f"mkdir {self.output_folder}") + + def tearDown(self): + bash_call(f"rm -rf {self.simulated_home}") + + def _run_command(self, command, **kwargs): + env = os.environ.copy() + env["HOME"] = self.simulated_home + if "cwd" not in kwargs: + kwargs["cwd"] = self.output_folder + return bash_call( + [ + "bash", + "-exc", + f"source {script_dir}/../utils/utilities.sh " + f"&& {command}", + ], + exit_on_fail=False, + env=env, + **kwargs, + ) + + def _run_command_and_get_sdout(self, command, **kwargs): + return self._run_command( + command, stderr=subprocess.PIPE, **kwargs + ).stdout.decode()[:-1] + + def test_get_generator_location_with_env_returns_env(self): + os.environ["GAPIC_GENERATOR_LOCATION"] = "/gapic-generator-java" + result = self._run_command_and_get_sdout("get_gapic_generator_location") + self.assertEqual("/gapic-generator-java", result) + os.environ.pop("GAPIC_GENERATOR_LOCATION") + + def test_get_generator_location_without_env_with_local_returns_local(self): + bash_call( + f"touch {self.simulated_home}/.library_generation/gapic-generator-java.jar" + ) + result = self._run_command_and_get_sdout("get_gapic_generator_location") + self.assertEqual( + f"{self.simulated_home}/.library_generation/gapic-generator-java.jar", + result, + ) + + def test_get_generator_location_with_no_env_no_local_file_failed(self): + result = self._run_command("get_gapic_generator_location") + self.assertEqual(1, result.returncode) + self.assertRegex(result.stdout.decode(), "Can't find GAPIC generator in") + + def test_get_protoc_location_with_env_returns_env(self): + os.environ["DOCKER_PROTOC_LOCATION"] = "/protoc" + result = self._run_command_and_get_sdout("get_protoc_location") + self.assertEqual("/protoc", result) + os.environ.pop("DOCKER_PROTOC_LOCATION") + + def test_get_protoc_location_without_env_with_local_returns_local(self): + bash_call(f"mkdir -p {self.simulated_home}/.library_generation/bin") + result = self._run_command_and_get_sdout("get_protoc_location") + self.assertEqual( + f"{self.simulated_home}/.library_generation/bin", + result, + ) + + def test_get_protoc_location_with_no_env_no_local_file_failed(self): + result = self._run_command("get_protoc_location") + self.assertEqual(1, result.returncode) + self.assertRegex(result.stdout.decode(), "Can't find protoc in") + + def test_get_grpc_plugin_location_with_env_returns_env(self): + os.environ["DOCKER_GRPC_LOCATION"] = "/grpc" + result = self._run_command_and_get_sdout("get_grpc_plugin_location") + self.assertEqual("/grpc", result) + os.environ.pop("DOCKER_GRPC_LOCATION") + + def test_get_grpc_plugin_location_without_env_with_local_returns_local(self): + bash_call( + f"touch {self.simulated_home}/.library_generation/protoc-gen-grpc-java.exe" + ) + result = self._run_command_and_get_sdout("get_grpc_plugin_location") + self.assertEqual( + f"{self.simulated_home}/.library_generation/protoc-gen-grpc-java.exe", + result, + ) + + def test_get_grpc_plugin_location_with_no_env_no_local_file_failed(self): + result = self._run_command("get_grpc_plugin_location") + self.assertEqual(1, result.returncode) + self.assertRegex(result.stdout.decode(), "Can't find grpc plugin in") + + def test_get_formatter_location_with_env_returns_env(self): + os.environ["JAVA_FORMATTER_LOCATION"] = "/java-formatter" + result = self._run_command_and_get_sdout("get_java_formatter_location") + self.assertEqual("/java-formatter", result) + os.environ.pop("JAVA_FORMATTER_LOCATION") + + def test_get_formatter_location_without_env_with_local_returns_local(self): + bash_call( + f"touch {self.simulated_home}/.library_generation/google-java-format.jar" + ) + result = self._run_command_and_get_sdout("get_java_formatter_location") + self.assertEqual( + f"{self.simulated_home}/.library_generation/google-java-format.jar", + result, + ) + + def test_get_formatter_location_with_no_env_no_local_file_failed(self): + result = self._run_command("get_java_formatter_location") + self.assertEqual(1, result.returncode) + self.assertRegex(result.stdout.decode(), "Can't find Java formatter in") + + def test_construct_effective_arg_confirm_repo_and_artifact(self): + gapic_config = GapicConfig(proto_path="google/cloud/test/v1") + gapic_inputs = GapicInputs( + proto_only="false", + additional_protos="google/cloud/common_resources.proto", + transport="grpc", + rest_numeric_enum="true", + gapic_yaml="google/cloud/test/v1/test_gapic.yaml", + service_config="google/cloud/test/v1/test_service_config.json", + service_yaml="google/cloud/test/v1/test.yaml", + include_samples="true", + ) + library_config = LibraryConfig( + api_shortname="test", + name_pretty="Test API", + product_documentation="https://cloud.google.com/test", + api_description="Test API description", + gapic_configs=[gapic_config], + library_name="test-library", + distribution_name="com.google.cloud:google-cloud-test-library", + ) + generation_config = GenerationConfig( + gapic_generator_version="2.34.0", + googleapis_commitish="main", + libraries=[library_config], + ) + + effective_args = _construct_effective_arg( + base_arguments=[], + gapic=gapic_config, + gapic_inputs=gapic_inputs, + temp_destination_path="temp", + generation_config=generation_config, + library=library_config, + ) + + self.assertIn("--repo", effective_args) + self.assertIn("googleapis/java-test-library", effective_args) + self.assertIn("--artifact", effective_args) + self.assertIn("com.google.cloud:google-cloud-test-library", effective_args) diff --git a/hermetic_build/library_generation/tests/generate_library_unit_tests.sh b/hermetic_build/library_generation/tests/generate_library_unit_tests.sh new file mode 100755 index 0000000000..3ea71a8e9d --- /dev/null +++ b/hermetic_build/library_generation/tests/generate_library_unit_tests.sh @@ -0,0 +1,244 @@ +#!/usr/bin/env bash + +set -xeo pipefail + +# Unit tests against ../utilities.sh +script_dir=$(dirname "$(readlink -f "$0")") +source "${script_dir}"/test_utilities.sh + +# we simulate a properly prepared environment (i.e. generator jar in its +# well-known location). Tests confirming the opposite case will make sure this +# environment is restored +readonly SIMULATED_HOME=$(mktemp -d) +mkdir "${SIMULATED_HOME}/.library_generation" +touch "${SIMULATED_HOME}/.library_generation/gapic-generator-java.jar" +touch "${SIMULATED_HOME}/.library_generation/google-java-format.jar" +HOME="${SIMULATED_HOME}" source "${script_dir}"/../utils/utilities.sh + +# Unit tests +extract_folder_name_test() { + local path="google/cloud/aiplatform/v1/google-cloud-aiplatform-v1-java" + local folder_name + folder_name=$(extract_folder_name "${path}") + assertEquals "google-cloud-aiplatform-v1-java" "${folder_name}" +} + +get_gapic_opts_with_rest_test() { + local proto_path="${script_dir}/resources/gapic_options" + local transport="grpc" + local rest_numeric_enums="true" + local repo="googleapis/google-cloud-java" + local artifact="google-cloud-library" + local gapic_opts + gapic_opts="$(get_gapic_opts "${transport}" "${rest_numeric_enums}" "" "" "" "${repo}" "${artifact}")" + assertEquals \ + "transport=grpc,rest-numeric-enums,grpc-service-config=${proto_path}/example_grpc_service_config.json,gapic-config=${proto_path}/example_gapic.yaml,api-service-config=${proto_path}/example.yaml,repo=${repo},artifact=${artifact}" \ + "${gapic_opts}" +} + +get_gapic_opts_without_rest_test() { + local proto_path="${script_dir}/resources/gapic_options" + local transport="grpc" + local rest_numeric_enums="false" + local repo="googleapis/google-cloud-java" + local artifact="google-cloud-library" + local gapic_opts + gapic_opts="$(get_gapic_opts "${transport}" "${rest_numeric_enums}" "" "" "" "${repo}" "${artifact}")" + assertEquals \ + "transport=grpc,,grpc-service-config=${proto_path}/example_grpc_service_config.json,gapic-config=${proto_path}/example_gapic.yaml,api-service-config=${proto_path}/example.yaml,repo=${repo},artifact=${artifact}" \ + "$gapic_opts" +} + +get_gapic_opts_with_non_default_test() { + local proto_path="${script_dir}/resources/gapic_options" + local transport="grpc" + local rest_numeric_enums="false" + local repo="googleapis/google-cloud-java" + local artifact="google-cloud-library" + local gapic_opts + gapic_opts="$(get_gapic_opts "${transport}" "${rest_numeric_enums}" "${proto_path}/example_gapic.yaml" "${proto_path}/example_grpc_service_config.json" "${proto_path}/example.yaml" "${repo}" "${artifact}")" + assertEquals \ + "transport=grpc,,grpc-service-config=${proto_path}/example_grpc_service_config.json,gapic-config=${proto_path}/example_gapic.yaml,api-service-config=${proto_path}/example.yaml,repo=${repo},artifact=${artifact}" \ + "$gapic_opts" +} + +remove_grpc_version_test() { + local destination_path="${script_dir}/resources/gapic_options" + cp "${destination_path}/QueryServiceGrpc_copy.java" "${destination_path}/QueryServiceGrpc.java" + remove_grpc_version "${destination_path}" + local res=0 + if ! grep -q 'value = "by gRPC proto compiler",' "${destination_path}/QueryServiceGrpc.java"; then + echo "Error: grpc version is not removed." + res=1 + fi + + assertEquals 0 $((res)) + rm "${destination_path}/QueryServiceGrpc.java" +} + +download_protoc_succeed_with_valid_version_linux_test() { + download_protoc "23.2" "linux-x86_64" + assertFileOrDirectoryExists "bin" + rm -rf "bin" +} + +download_protoc_succeed_with_valid_version_macos_test() { + download_protoc "23.2" "osx-x86_64" + assertFileOrDirectoryExists "bin" + rm -rf "bin" +} + +download_protoc_failed_with_invalid_version_linux_test() { + local res=0 + $(download_protoc "22.99" "linux-x86_64") || res=$? + assertEquals 1 $((res)) +} + +download_protoc_failed_with_invalid_arch_test() { + local res=0 + $(download_protoc "23.2" "customized-x86_64") || res=$? + assertEquals 1 $((res)) +} + +download_grpc_plugin_succeed_with_valid_version_linux_test() { + download_grpc_plugin "1.55.1" "linux-x86_64" + assertFileOrDirectoryExists "protoc-gen-grpc-java.exe" + rm "protoc-gen-grpc-java.exe" +} + +download_grpc_plugin_succeed_with_valid_version_macos_test() { + download_grpc_plugin "1.55.1" "osx-x86_64" + assertFileOrDirectoryExists "protoc-gen-grpc-java.exe" + rm "protoc-gen-grpc-java.exe" +} + +download_grpc_plugin_failed_with_invalid_version_linux_test() { + local res=0 + $(download_grpc_plugin "0.99.0" "linux-x86_64") || res=$? + assertEquals 1 $((res)) +} + +download_grpc_plugin_failed_with_invalid_arch_test() { + local res=0 + $(download_grpc_plugin "1.55.1" "customized-x86_64") || res=$? + assertEquals 1 $((res)) +} + +generate_library_failed_with_invalid_generator_version() { + local destination="google-cloud-alloydb-v1-java" + local res=0 + cd "${script_dir}/resources" + bash "${script_dir}"/../generate_library.sh \ + -p google/cloud/alloydb/v1 \ + -d ../"${destination}" \ + --protoc_version 23.2 \ + --grpc_version 1.55.1 \ + --transport grpc+rest \ + --rest_numeric_enums true || res=$? + assertEquals 1 $((res)) + # still need to clean up potential downloaded tooling. + cleanup "${destination}" +} + +generate_library_failed_with_invalid_protoc_version() { + local destination="google-cloud-alloydb-v1-java" + local res=0 + cd "${script_dir}/resources" + bash "${script_dir}"/../generate_library.sh \ + -p google/cloud/alloydb/v1 \ + -d ../"${destination}" \ + --protoc_version 22.99 \ + --grpc_version 1.55.1 \ + --transport grpc+rest \ + --rest_numeric_enums true || res=$? + assertEquals 1 $((res)) + # still need to clean up potential downloaded tooling. + cleanup "${destination}" +} + +generate_library_failed_with_invalid_grpc_version() { + local destination="google-cloud-alloydb-v1-java" + local res=0 + cd "${script_dir}/resources" + bash "${script_dir}"/../generate_library.sh \ + -p google/cloud/alloydb/v1 \ + -d ../output/"${destination}" \ + --grpc_version 0.99.0 \ + --transport grpc+rest \ + --rest_numeric_enums true || res=$? + assertEquals 1 $((res)) + # still need to clean up potential downloaded tooling. + cleanup "${destination}" +} + +copy_directory_if_exists_valid_folder_succeeds() { + local source_folder="${script_dir}/resources" + local destination="${script_dir}/test_destination_folder" + mkdir -p "${destination}" + copy_directory_if_exists "${source_folder}" "gapic" "${destination}/copied-folder" + n_matching_folders=$(ls "${destination}" | grep -e 'copied-folder' | wc -l) + rm -rf "${destination}" + assertEquals 1 ${n_matching_folders} +} + +copy_directory_if_exists_invalid_folder_does_not_copy() { + local source_folder="${script_dir}/non-existent" + local destination="${script_dir}/test_destination_folder" + mkdir -p "${destination}" + copy_directory_if_exists "${source_folder}" "gapic" "${destination}/copied-folder" + n_matching_folders=$(ls "${destination}" | grep -e 'copied-folder' | wc -l) || res=$? + rm -rf "${destination}" + assertEquals 0 ${n_matching_folders} +} + +get_proto_path_from_preprocessed_sources_valid_library_succeeds() { + local sources="${script_dir}/resources/proto_path_library" + local proto_path=$(get_proto_path_from_preprocessed_sources "${sources}") + assertEquals "google/cloud/test/v1" ${proto_path} +} + +get_proto_path_from_preprocessed_sources_empty_library_fails() { + local sources=$(mktemp -d) + ( + get_proto_path_from_preprocessed_sources "${sources}" + ) || res=$? + assertEquals 1 ${res} +} + +get_proto_path_from_preprocessed_sources_multiple_proto_dirs_fails() { + local sources="${script_dir}/resources/proto_path_library_multiple_protos" + ( + get_proto_path_from_preprocessed_sources "${sources}" + ) || res=$? + assertEquals 1 ${res} +} + +# Execute tests. +# One line per test. +test_list=( + extract_folder_name_test + get_gapic_opts_with_rest_test + get_gapic_opts_without_rest_test + get_gapic_opts_with_non_default_test + remove_grpc_version_test + download_protoc_succeed_with_valid_version_linux_test + download_protoc_succeed_with_valid_version_macos_test + download_protoc_failed_with_invalid_version_linux_test + download_protoc_failed_with_invalid_arch_test + download_grpc_plugin_succeed_with_valid_version_linux_test + download_grpc_plugin_succeed_with_valid_version_macos_test + download_grpc_plugin_failed_with_invalid_version_linux_test + download_grpc_plugin_failed_with_invalid_arch_test + generate_library_failed_with_invalid_generator_version + generate_library_failed_with_invalid_protoc_version + generate_library_failed_with_invalid_grpc_version + copy_directory_if_exists_valid_folder_succeeds + copy_directory_if_exists_invalid_folder_does_not_copy + get_proto_path_from_preprocessed_sources_valid_library_succeeds + get_proto_path_from_preprocessed_sources_empty_library_fails + get_proto_path_from_preprocessed_sources_multiple_proto_dirs_fails +) + +pushd "${script_dir}" +execute_tests "${test_list[@]}" +popd diff --git a/hermetic_build/library_generation/tests/generate_repo_unit_tests.py b/hermetic_build/library_generation/tests/generate_repo_unit_tests.py new file mode 100644 index 0000000000..ca61eec2f4 --- /dev/null +++ b/hermetic_build/library_generation/tests/generate_repo_unit_tests.py @@ -0,0 +1,148 @@ +#!/usr/bin/env python3 +# 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. +import unittest + +from library_generation.generate_repo import get_target_libraries +from common.model.generation_config import GenerationConfig +from common.model.library_config import LibraryConfig + +from common.model.gapic_config import GapicConfig + + +class GenerateRepoTest(unittest.TestCase): + def test_get_target_library_returns_selected_libraries(self): + one_library = GenerateRepoTest.__get_an_empty_library_config() + one_library.api_shortname = "one_library" + another_library = GenerateRepoTest.__get_an_empty_library_config() + another_library.api_shortname = "another_library" + config = GenerateRepoTest.__get_an_empty_generation_config() + config.libraries.extend([one_library, another_library]) + target_libraries = get_target_libraries(config, ["another_library"]) + self.assertEqual([another_library], target_libraries) + + def test_get_target_library_given_null_returns_all_libraries(self): + one_library = GenerateRepoTest.__get_an_empty_library_config() + one_library.api_shortname = "one_library" + another_library = GenerateRepoTest.__get_an_empty_library_config() + another_library.api_shortname = "another_library" + config = GenerateRepoTest.__get_an_empty_generation_config() + config.libraries.extend([one_library, another_library]) + target_libraries = get_target_libraries(config) + self.assertEqual([one_library, another_library], target_libraries) + + def test_get_target_library_given_an_non_existent_library_returns_only_existing_libraries( + self, + ): + one_library = GenerateRepoTest.__get_an_empty_library_config() + one_library.api_shortname = "one_library" + another_library = GenerateRepoTest.__get_an_empty_library_config() + another_library.api_shortname = "another_library" + config = GenerateRepoTest.__get_an_empty_generation_config() + config.libraries.extend([one_library, another_library]) + target_libraries = get_target_libraries( + config, ["one_library", "another_library", "non_existent_library"] + ) + self.assertEqual([one_library, another_library], target_libraries) + + def test_get_target_library_returns_selected_api_path(self): + one_library = GenerateRepoTest.__get_an_empty_library_config() + one_library.api_shortname = "one_library" + one_library.gapic_configs = [GapicConfig("google/cloud/one/library/v1")] + another_library = GenerateRepoTest.__get_an_empty_library_config() + another_library.api_shortname = "another_library" + another_library_gapic_config = list() + another_library_gapic_config.append( + GapicConfig("google/cloud/another/library/v1") + ) + another_library_gapic_config.append( + GapicConfig("google/cloud/another/library/v2") + ) + another_library.gapic_configs = another_library_gapic_config + config = GenerateRepoTest.__get_an_empty_generation_config() + config.libraries.extend([one_library, another_library]) + target_libraries = get_target_libraries( + config, target_api_path="google/cloud/another/library/v2" + ) + another_library_v1 = GenerateRepoTest.__get_an_empty_library_config() + another_library_v1.api_shortname = "another_library" + another_library_v1.gapic_configs = [ + GapicConfig("google/cloud/another/library/v2") + ] + + self.assertEqual([another_library_v1], target_libraries) + + def test_get_target_library_returns_selected_api_path_plus_dep(self): + one_library = GenerateRepoTest.__get_an_empty_library_config() + one_library.api_shortname = "one_library" + one_library.gapic_configs = [GapicConfig("google/cloud/one/library/v1")] + another_library = GenerateRepoTest.__get_an_empty_library_config() + another_library.api_shortname = "another_library" + another_library_gapic_config = list() + another_library_gapic_config.append( + GapicConfig("google/cloud/another/library/v1") + ) + another_library_gapic_config.append( + GapicConfig("google/cloud/another/library/v2") + ) + another_library_gapic_config.append( + GapicConfig("google/cloud/another/library/type") + ) + another_library.gapic_configs = another_library_gapic_config + config = GenerateRepoTest.__get_an_empty_generation_config() + config.libraries.extend([one_library, another_library]) + target_libraries = get_target_libraries( + config, target_api_path="google/cloud/another/library/v2" + ) + another_library_v1 = GenerateRepoTest.__get_an_empty_library_config() + another_library_v1.api_shortname = "another_library" + another_library_v1.gapic_configs = [ + GapicConfig("google/cloud/another/library/v2"), + GapicConfig("google/cloud/another/library/type"), + ] + + self.assertEqual([another_library_v1], target_libraries) + + def test_get_target_library_invalid_target_api_path(self): + """ + Tests when the api_path is invalid and sys.exit is called. + """ + config = GenerateRepoTest.__get_an_empty_library_config() + with self.assertRaises(ValueError) as context: + _target_libraries = get_target_libraries( + config, target_api_path="google/cloud/another/library/type" + ) + + self.assertEqual( + str(context.exception), + "api_path is not ending with a version is not supported", + ) + + @staticmethod + def __get_an_empty_generation_config() -> GenerationConfig: + return GenerationConfig( + gapic_generator_version="", + googleapis_commitish="", + libraries=[], + ) + + @staticmethod + def __get_an_empty_library_config() -> LibraryConfig: + return LibraryConfig( + api_shortname="", + name_pretty="", + api_description="", + product_documentation="", + gapic_configs=[], + ) diff --git a/hermetic_build/library_generation/tests/model/__init__.py b/hermetic_build/library_generation/tests/model/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/hermetic_build/library_generation/tests/model/repo_config_unit_tests.py b/hermetic_build/library_generation/tests/model/repo_config_unit_tests.py new file mode 100644 index 0000000000..12d28fe254 --- /dev/null +++ b/hermetic_build/library_generation/tests/model/repo_config_unit_tests.py @@ -0,0 +1,56 @@ +# 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 +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT 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 unittest + +from library_generation.model.repo_config import RepoConfig + +script_dir = os.path.dirname(os.path.realpath(__file__)) +versions_file = os.path.join(script_dir, "..", "resources", "misc", "versions.txt") + + +class RepoConfigTest(unittest.TestCase): + def test_get_library_versions_with_existing_library(self): + repo_config = RepoConfig( + output_folder="test", libraries=dict(), versions_file=versions_file + ) + self.assertEqual( + "2.25.0", + repo_config.get_library_version("gapic-generator-java"), + ) + self.assertEqual( + "2.16.0", + repo_config.get_library_version("api-common"), + ) + self.assertEqual( + "2.33.0", + repo_config.get_library_version("gax"), + ) + self.assertEqual( + "2.34.0", + repo_config.get_library_version("gax-grpc"), + ) + self.assertEqual( + "0.118.0", + repo_config.get_library_version("gax-httpjson"), + ) + + def test_get_library_versions_with_new_library(self): + repo_config = RepoConfig( + output_folder="test", libraries=dict(), versions_file=versions_file + ) + self.assertEqual( + "0.0.0", + repo_config.get_library_version("example-artifact"), + ) diff --git a/hermetic_build/library_generation/tests/owlbot/__init__.py b/hermetic_build/library_generation/tests/owlbot/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/hermetic_build/library_generation/tests/owlbot/fix_poms_unit_tests.py b/hermetic_build/library_generation/tests/owlbot/fix_poms_unit_tests.py new file mode 100644 index 0000000000..2e66454827 --- /dev/null +++ b/hermetic_build/library_generation/tests/owlbot/fix_poms_unit_tests.py @@ -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 +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT 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 shutil +import unittest +from library_generation.owlbot.src.fix_poms import main +from library_generation.tests.compare_poms import compare_pom_in_subdir + +script_dir = os.path.dirname(os.path.realpath(__file__)) +resources_dir = os.path.join(script_dir, "..", "resources", "test-owlbot") + + +class FixPomsTest(unittest.TestCase): + def test_update_poms_group_id_does_not_start_with_google_correctly(self): + ad_manager_resource = os.path.join(resources_dir, "java-admanager") + versions_file = os.path.join(ad_manager_resource, "versions.txt") + os.chdir(ad_manager_resource) + sub_dirs = ["ad-manager", "ad-manager-bom", "proto-ad-manager-v1", "."] + for sub_dir in sub_dirs: + self.__copy__golden(ad_manager_resource, sub_dir) + main(versions_file, "true") + for sub_dir in sub_dirs: + self.assertFalse(compare_pom_in_subdir(ad_manager_resource, sub_dir)) + for sub_dir in sub_dirs: + self.__remove_file_in_subdir(ad_manager_resource, sub_dir) + + @classmethod + def __copy__golden(cls, base_dir: str, subdir: str): + golden = os.path.join(base_dir, subdir, "pom-golden.xml") + pom = os.path.join(base_dir, subdir, "pom.xml") + shutil.copyfile(golden, pom) + + @classmethod + def __remove_file_in_subdir(cls, base_dir: str, subdir: str): + pom = os.path.join(base_dir, subdir, "pom.xml") + os.unlink(pom) diff --git a/hermetic_build/library_generation/tests/owlbot/java_unit_tests.py b/hermetic_build/library_generation/tests/owlbot/java_unit_tests.py new file mode 100644 index 0000000000..975487c308 --- /dev/null +++ b/hermetic_build/library_generation/tests/owlbot/java_unit_tests.py @@ -0,0 +1,300 @@ +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import os +import shutil +import tempfile +import unittest +import xml.etree.ElementTree as elementTree +from unittest import mock + +import yaml +from pathlib import Path +from synthtool.languages import java +from library_generation.tests.owlbot import util + +TEST_OWLBOT = Path(__file__).parent.parent / "resources" / "test-owlbot" +FIXTURES = Path(__file__).parent.parent / "resources" / "test-owlbot" / "fixtures" +TEMPLATES_PATH = Path(__file__).parent.parent.parent / "owlbot" / "templates" +CURRENT_YEAR_OVERRIDE = "2025" + +SAMPLE_METADATA = """ + + com.google.cloud + libraries-bom + + 3.3.0 + 3.3.0 + + 1.0.0 + 1.1.0 + 1.1.1 + 1.2.0 + 2.0.0 + 2.1.0 + 2.2.0 + 2.2.1 + 2.3.0 + 2.4.0 + 2.5.0 + 2.6.0 + 2.7.0 + 2.7.1 + 2.8.0 + 2.9.0 + 3.0.0 + 3.1.0 + 3.1.1 + 3.2.0 + 3.3.0 + + 20191218182827 + + +""" + + +class JavaUnitTests(unittest.TestCase): + def test_version_from_maven_metadata(self): + self.assertEqual("3.3.0", java.version_from_maven_metadata(SAMPLE_METADATA)) + + @mock.patch.dict(os.environ, {"SYNTHTOOL_TEMPLATES": f"{TEMPLATES_PATH}"}) + def test_working_common_templates(self): + def assert_valid_xml(file): + try: + elementTree.parse(file) + except elementTree.ParseError: + self.fail(f"unable to parse XML: {file}") + + def assert_valid_yaml(file): + with open(file, "r") as stream: + try: + yaml.safe_load(stream) + except yaml.YAMLError: + self.fail(f"unable to parse YAML: {file}") + + with util.copied_fixtures_dir( + FIXTURES / "java_templates" / "standard" + ) as workdir: + # generate the common templates + java.common_templates(template_path=TEMPLATES_PATH) + self.assertTrue(os.path.isfile("renovate.json")) + + # lint xml, yaml files + # use os.walk because glob ignores hidden directories + for dirpath, _, filenames in os.walk(workdir): + for file in filenames: + _, ext = os.path.splitext(file) + if ext == ".xml": + assert_valid_xml(os.path.join(dirpath, file)) + elif ext == ".yaml" or ext == ".yml": + assert_valid_yaml(os.path.join(dirpath, file)) + + def test_remove_method(self): + with tempfile.TemporaryDirectory() as tempdir: + cwd = os.getcwd() + os.chdir(TEST_OWLBOT) + shutil.copyfile("testdata/SampleClass.java", tempdir + "/SampleClass.java") + + java.remove_method( + tempdir + "/SampleClass.java", "public static void foo()" + ) + java.remove_method(tempdir + "/SampleClass.java", "public void asdf()") + self.assert_matches_golden( + "testdata/SampleClassGolden.java", tempdir + "/SampleClass.java" + ) + os.chdir(cwd) + + def test_copy_and_rename_method(self): + with tempfile.TemporaryDirectory() as tempdir: + cwd = os.getcwd() + os.chdir(TEST_OWLBOT) + shutil.copyfile("testdata/SampleClass.java", tempdir + "/SampleClass.java") + + java.copy_and_rename_method( + tempdir + "/SampleClass.java", + "public static void foo()", + "foo", + "foobar", + ) + java.copy_and_rename_method( + tempdir + "/SampleClass.java", "public void asdf()", "asdf", "xyz" + ) + self.assert_matches_golden( + "testdata/SampleCopyMethodGolden.java", + tempdir + "/SampleClass.java", + ) + os.chdir(cwd) + + def test_deprecate_method(self): + with tempfile.TemporaryDirectory() as tempdir: + cwd = os.getcwd() + os.chdir(TEST_OWLBOT) + shutil.copyfile( + "testdata/SampleDeprecateClass.java", + tempdir + "/SampleDeprecateClass.java", + ) + deprecation_warning = """This method will be removed in the next major version.\nUse {{@link #{new_method}()}} instead""" + additional_comment = ( + """{new_method} has the same functionality as foobar.""" + ) + java.deprecate_method( + tempdir + "/SampleDeprecateClass.java", + "public void foo(String bar)", + deprecation_warning.format(new_method="sample"), + ) + + # adding a comment when a javadoc and annotation already exists + java.deprecate_method( + tempdir + "/SampleDeprecateClass.java", + "public void bar(String bar)", + deprecation_warning.format(new_method="sample"), + ) + java.deprecate_method( + tempdir + "/SampleDeprecateClass.java", + "public void cat(String bar)", + additional_comment.format(new_method="sample"), + ) + + self.assert_matches_golden( + "testdata/SampleDeprecateMethodGolden.java", + tempdir + "/SampleDeprecateClass.java", + ) + os.chdir(cwd) + + @mock.patch.dict(os.environ, {"CURRENT_YEAR_OVERRIDE": CURRENT_YEAR_OVERRIDE}) + def test_fix_proto_license(self): + with tempfile.TemporaryDirectory() as tempdir: + cwd = os.getcwd() + os.chdir(TEST_OWLBOT) + temppath = Path(tempdir).resolve() + os.mkdir(temppath / "src") + shutil.copyfile( + "testdata/src/foo/FooProto.java", temppath / "src/FooProto.java" + ) + + java.fix_proto_headers(temppath) + self.assert_matches_golden( + "testdata/FooProtoGolden.java", temppath / "src/FooProto.java" + ) + os.chdir(cwd) + + @mock.patch.dict(os.environ, {"CURRENT_YEAR_OVERRIDE": CURRENT_YEAR_OVERRIDE}) + def test_fix_proto_license_idempotent(self): + with tempfile.TemporaryDirectory() as tempdir: + cwd = os.getcwd() + os.chdir(TEST_OWLBOT) + temppath = Path(tempdir).resolve() + os.mkdir(temppath / "src") + shutil.copyfile( + "testdata/src/foo/FooProto.java", temppath / "src/FooProto.java" + ) + + # run the header fix twice + java.fix_proto_headers(temppath) + java.fix_proto_headers(temppath) + self.assert_matches_golden( + "testdata/FooProtoGolden.java", temppath / "src/FooProto.java" + ) + os.chdir(cwd) + + @mock.patch.dict(os.environ, {"CURRENT_YEAR_OVERRIDE": CURRENT_YEAR_OVERRIDE}) + def test_fix_grpc_license(self): + with tempfile.TemporaryDirectory() as tempdir: + cwd = os.getcwd() + os.chdir(TEST_OWLBOT) + temppath = Path(tempdir).resolve() + os.mkdir(temppath / "src") + shutil.copyfile( + "testdata/src/foo/FooGrpc.java", temppath / "src/FooGrpc.java" + ) + + java.fix_grpc_headers(temppath) + self.assert_matches_golden( + "testdata/FooGrpcGolden.java", temppath / "src/FooGrpc.java" + ) + os.chdir(cwd) + + @mock.patch.dict(os.environ, {"CURRENT_YEAR_OVERRIDE": CURRENT_YEAR_OVERRIDE}) + def test_fix_grpc_license_idempotent(self): + with tempfile.TemporaryDirectory() as tempdir: + cwd = os.getcwd() + os.chdir(TEST_OWLBOT) + temppath = Path(tempdir).resolve() + os.mkdir(temppath / "src") + shutil.copyfile( + "testdata/src/foo/FooGrpc.java", temppath / "src/FooGrpc.java" + ) + + # run the header fix twice + java.fix_grpc_headers(temppath) + java.fix_grpc_headers(temppath) + self.assert_matches_golden( + "testdata/FooGrpcGolden.java", temppath / "src/FooGrpc.java" + ) + os.chdir(cwd) + + @mock.patch.dict(os.environ, {"SYNTHTOOL_TEMPLATES": f"{TEMPLATES_PATH}"}) + def test_release_please_handle_releases(self): + with util.copied_fixtures_dir( + FIXTURES / "java_templates" / "release-please-update" + ): + # generate the common templates + java.common_templates(template_path=TEMPLATES_PATH) + + self.assertTrue(os.path.isfile(".github/release-please.yml")) + with open(".github/release-please.yml") as fp: + self.assertEqual( + fp.read(), + """branches: +- branch: 1.127.12-sp + bumpMinorPreMajor: true + handleGHRelease: true + releaseType: java-lts +bumpMinorPreMajor: true +handleGHRelease: true +releaseType: java-yoshi +""", + ) + + @mock.patch.dict( + os.environ, + { + "SYNTHTOOL_TEMPLATES": f"{TEMPLATES_PATH}", + "SYNTHTOOL_LIBRARY_VERSION": "1.2.3", + }, + ) + def test_render_readme_success(self): + golden_path = os.path.abspath(f"{TEST_OWLBOT}/testdata/README-golden.md") + with util.copied_fixtures_dir(FIXTURES / "java_templates" / "render-readme"): + # This method needs read .repo-metadata.json to render templates. + # The file is located in FIXTURES/java_templates/render-readme. + java.common_templates( + template_path=TEMPLATES_PATH, + ) + self.assertTrue(os.path.isfile("README.md")) + self.assert_matches_golden(golden_path, "README.md") + + def assert_matches_golden(self, expected, actual): + matching_lines = 0 + with open(actual, "rt") as fp: + with open(expected, "rt") as golden: + while True: + matching_lines += 1 + log_line = fp.readline() + expected = golden.readline() + self.assertEqual(repr(log_line), repr(expected)) + if not log_line: + break + assert matching_lines > 0 diff --git a/hermetic_build/library_generation/tests/owlbot/util.py b/hermetic_build/library_generation/tests/owlbot/util.py new file mode 100644 index 0000000000..da54846768 --- /dev/null +++ b/hermetic_build/library_generation/tests/owlbot/util.py @@ -0,0 +1,126 @@ +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import contextlib +import subprocess +import os +import pathlib +import shutil +import sys +import tempfile +import typing + + +def make_working_repo(working_dir: str, default_branch: str = "main"): + """Create a local repo that resembles a real repo. + + Specifically, it has a history of synth.py changes that actually change the + generated output. + """ + subprocess.check_call(["git", "init"], cwd=working_dir) + subprocess.check_call(["git", "checkout", "-b", default_branch], cwd=working_dir) + subprocess.check_call( + [ + "git", + "remote", + "add", + "origin", + "https://github.com/googleapis/nodejs-vision.git", + ] + ) + working_path = pathlib.Path(working_dir) + # The simplest possible synth.py. It generates one file with one line of text. + template = """import time +import json +import uuid +import subprocess + +# comment + +with open("generated.txt", "wt") as f: + f.write("a\\n") +metadata = { "updateTime": str(uuid.uuid4()), + "sources": [ + { + "git": { + "name": ".", + "remote": "https://github.com/googleapis/synthtool.git", + "sha": subprocess.run(["git", "log", "-1", "--pretty=%H"], universal_newlines=True, stdout=subprocess.PIPE).stdout.strip(), + } + }] +} +with open("synth.metadata", "wt") as f: + json.dump(metadata, f) +""" + # Write version a. + synth_py_path = working_path / "synth.py" + synth_py_path.write_text(template) + subprocess.check_call([sys.executable, str(synth_py_path)], cwd=working_dir) + subprocess.check_call(["git", "add", "-A"], cwd=working_dir) + subprocess.check_call(["git", "commit", "-m", "a"], cwd=working_dir) + + # Write version b. + text = template.replace('"a\\n"', '"b\\n"') + synth_py_path.write_text(text) + subprocess.check_call(["git", "commit", "-am", "b"], cwd=working_dir) + + # Write a version that has no effect on output. + text = text.replace("# comment", "# a different comment") + synth_py_path.write_text(text) + subprocess.check_call(["git", "commit", "-am", "comment"], cwd=working_dir) + + # Write version c. + text = text.replace('"b\\n"', '"c\\n"') + synth_py_path.write_text(text) + subprocess.check_call( + ["git", "commit", "-am", "c subject\n\nbody line 1\nbody line 2"], + cwd=working_dir, + ) + + return text + + +@contextlib.contextmanager +def chdir(path: typing.Union[pathlib.Path, str]): + """Context Manager to change the current working directory and restore the + previous working directory after completing the context. + + Args: + path (pathlib.Path, str) - The new current working directory. + Yields: + pathlib.Path - The new current working directory. + """ + old_cwd = os.getcwd() + os.chdir(str(path)) + try: + yield pathlib.Path(path) + finally: + os.chdir(old_cwd) + + +@contextlib.contextmanager +def copied_fixtures_dir(source: pathlib.Path): + """Context Manager to copy from a fixtures directory into a new temporary directory + and change the current working directory to that copy. Restores the original + current working directory after completing the context. + + Args: + source (pathlib.Path) - The directory to copy. + Yields: + pathlib.Path - The temporary directory with the copied contents. + """ + with tempfile.TemporaryDirectory() as tempdir: + workdir = shutil.copytree(source, pathlib.Path(tempdir) / "workspace") + with chdir(workdir): + yield workdir diff --git a/hermetic_build/library_generation/tests/resources/gapic_options/QueryServiceGrpc_copy.java b/hermetic_build/library_generation/tests/resources/gapic_options/QueryServiceGrpc_copy.java new file mode 100644 index 0000000000..cf2bf2b0ee --- /dev/null +++ b/hermetic_build/library_generation/tests/resources/gapic_options/QueryServiceGrpc_copy.java @@ -0,0 +1,9 @@ +/** + * This file is only used in testing `remove_grpc_version` in utilities.sh. + */ +@javax.annotation.processing.Generated( + value = "by gRPC proto compiler 1.55.1", + comments = "Source: google/monitoring/v3/query_service.proto") +public final class QueryServiceGrpc_copy { + +} diff --git a/hermetic_build/library_generation/tests/resources/gapic_options/example.yaml b/hermetic_build/library_generation/tests/resources/gapic_options/example.yaml new file mode 100644 index 0000000000..7bd824910e --- /dev/null +++ b/hermetic_build/library_generation/tests/resources/gapic_options/example.yaml @@ -0,0 +1 @@ +# this file is only used in testing `get_gapic_opts` in utilities.sh diff --git a/hermetic_build/library_generation/tests/resources/gapic_options/example_gapic.legacy.yaml b/hermetic_build/library_generation/tests/resources/gapic_options/example_gapic.legacy.yaml new file mode 100644 index 0000000000..7da8426f34 --- /dev/null +++ b/hermetic_build/library_generation/tests/resources/gapic_options/example_gapic.legacy.yaml @@ -0,0 +1 @@ +# this file is only used in testing `get_gapic_opts` in utilities.sh \ No newline at end of file diff --git a/hermetic_build/library_generation/tests/resources/gapic_options/example_gapic.yaml b/hermetic_build/library_generation/tests/resources/gapic_options/example_gapic.yaml new file mode 100644 index 0000000000..7bd824910e --- /dev/null +++ b/hermetic_build/library_generation/tests/resources/gapic_options/example_gapic.yaml @@ -0,0 +1 @@ +# this file is only used in testing `get_gapic_opts` in utilities.sh diff --git a/hermetic_build/library_generation/tests/resources/gapic_options/example_gapic_legacy.yaml b/hermetic_build/library_generation/tests/resources/gapic_options/example_gapic_legacy.yaml new file mode 100644 index 0000000000..7da8426f34 --- /dev/null +++ b/hermetic_build/library_generation/tests/resources/gapic_options/example_gapic_legacy.yaml @@ -0,0 +1 @@ +# this file is only used in testing `get_gapic_opts` in utilities.sh \ No newline at end of file diff --git a/hermetic_build/library_generation/tests/resources/gapic_options/example_grpc_service_config.json b/hermetic_build/library_generation/tests/resources/gapic_options/example_grpc_service_config.json new file mode 100644 index 0000000000..947c390835 --- /dev/null +++ b/hermetic_build/library_generation/tests/resources/gapic_options/example_grpc_service_config.json @@ -0,0 +1,3 @@ +{ + "comment": "this file is only used in testing `get_gapic_opts` in utilities.sh" +} diff --git a/hermetic_build/library_generation/tests/resources/goldens/.OwlBot-hermetic-golden.yaml b/hermetic_build/library_generation/tests/resources/goldens/.OwlBot-hermetic-golden.yaml new file mode 100644 index 0000000000..5aa364f72c --- /dev/null +++ b/hermetic_build/library_generation/tests/resources/goldens/.OwlBot-hermetic-golden.yaml @@ -0,0 +1,36 @@ +# 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-bare-metal-solution/grpc-google-.*/src" +- "/java-bare-metal-solution/proto-google-.*/src" +- "/java-bare-metal-solution/google-.*/src" +- "/java-bare-metal-solution/samples/snippets/generated" + +deep-preserve-regex: +- "/java-bare-metal-solution/google-.*/src/test/java/com/google/cloud/.*/v.*/it/IT.*Test.java" +- "/java-bare-metal-solution/google-.*/src/main/java/com/google/cloud/.*/v.*/stub/Version.java" + +deep-copy-regex: +- source: "/google/cloud/baremetalsolution/(v.*)/.*-java/proto-google-.*/src" + dest: "/owl-bot-staging/java-bare-metal-solution/$1/proto-google-cloud-bare-metal-solution-$1/src" +- source: "/google/cloud/baremetalsolution/(v.*)/.*-java/grpc-google-.*/src" + dest: "/owl-bot-staging/java-bare-metal-solution/$1/grpc-google-cloud-bare-metal-solution-$1/src" +- source: "/google/cloud/baremetalsolution/(v.*)/.*-java/gapic-google-.*/src" + dest: "/owl-bot-staging/java-bare-metal-solution/$1/google-cloud-bare-metal-solution/src" +- source: "/google/cloud/baremetalsolution/(v.*)/.*-java/samples/snippets/generated" + dest: "/owl-bot-staging/java-bare-metal-solution/$1/samples/snippets/generated" + +api-name: baremetalsolution \ No newline at end of file diff --git a/hermetic_build/library_generation/tests/resources/goldens/.repo-metadata-custom-transport-golden.json b/hermetic_build/library_generation/tests/resources/goldens/.repo-metadata-custom-transport-golden.json new file mode 100644 index 0000000000..2cccd4b889 --- /dev/null +++ b/hermetic_build/library_generation/tests/resources/goldens/.repo-metadata-custom-transport-golden.json @@ -0,0 +1,16 @@ +{ + "api_shortname": "secretmanager", + "name_pretty": "Secret Management", + "product_documentation": "https://cloud.google.com/solutions/secrets-management/", + "api_description": "allows you to encrypt, store, manage, and audit infrastructure and application-level secrets.", + "client_documentation": "https://cloud.google.com/java/docs/reference/google-cloud-secretmanager/latest/overview", + "release_level": "preview", + "transport": "http", + "language": "java", + "repo": "googleapis/google-cloud-java", + "repo_short": "java-secretmanager", + "distribution_name": "com.google.cloud:google-cloud-secretmanager", + "api_id": "secretmanager.googleapis.com", + "library_type": "GAPIC_AUTO", + "requires_billing": true +} \ No newline at end of file diff --git a/hermetic_build/library_generation/tests/resources/goldens/.repo-metadata-monorepo-golden.json b/hermetic_build/library_generation/tests/resources/goldens/.repo-metadata-monorepo-golden.json new file mode 100644 index 0000000000..0b3bbc2b55 --- /dev/null +++ b/hermetic_build/library_generation/tests/resources/goldens/.repo-metadata-monorepo-golden.json @@ -0,0 +1,20 @@ +{ + "api_shortname": "baremetalsolution", + "name_pretty": "Bare Metal Solution", + "product_documentation": "https://cloud.google.com/bare-metal/docs", + "api_description": "Bring your Oracle workloads to Google Cloud with Bare Metal Solution and jumpstart your cloud journey with minimal risk.", + "client_documentation": "https://cloud.google.com/java/docs/reference/google-cloud-bare-metal-solution/latest/overview", + "release_level": "preview", + "transport": "grpc", + "language": "java", + "repo": "googleapis/google-cloud-java", + "repo_short": "java-bare-metal-solution", + "distribution_name": "com.google.cloud:google-cloud-bare-metal-solution", + "api_id": "baremetalsolution.googleapis.com", + "library_type": "GAPIC_AUTO", + "requires_billing": true, + "rest_documentation": "https://cloud.google.com/bare-metal/docs/reference/rest", + "rpc_documentation": "https://cloud.google.com/bare-metal/docs/reference/rpc", + "recommended_package": "com.google.example", + "min_java_version": 8 +} \ No newline at end of file diff --git a/hermetic_build/library_generation/tests/resources/goldens/.repo-metadata-non-monorepo-golden.json b/hermetic_build/library_generation/tests/resources/goldens/.repo-metadata-non-monorepo-golden.json new file mode 100644 index 0000000000..b39c297a85 --- /dev/null +++ b/hermetic_build/library_generation/tests/resources/goldens/.repo-metadata-non-monorepo-golden.json @@ -0,0 +1,21 @@ +{ + "api_shortname": "baremetalsolution", + "name_pretty": "Bare Metal Solution", + "product_documentation": "https://cloud.google.com/bare-metal/docs", + "api_description": "Bring your Oracle workloads to Google Cloud with Bare Metal Solution and jumpstart your cloud journey with minimal risk.", + "client_documentation": "https://cloud.google.com/java/docs/reference/google-cloud-bare-metal-solution/latest/overview", + "release_level": "preview", + "transport": "grpc", + "language": "java", + "repo": "googleapis/java-bare-metal-solution", + "repo_short": "java-bare-metal-solution", + "distribution_name": "com.google.cloud:google-cloud-bare-metal-solution", + "api_id": "baremetalsolution.googleapis.com", + "library_type": "GAPIC_COMBO", + "requires_billing": true, + "rest_documentation": "https://cloud.google.com/bare-metal/docs/reference/rest", + "rpc_documentation": "https://cloud.google.com/bare-metal/docs/reference/rpc", + "extra_versioned_modules": "test-module", + "recommended_package": "com.google.example", + "min_java_version": 8 +} \ No newline at end of file diff --git a/hermetic_build/library_generation/tests/resources/goldens/.repo-metadata-proto-only-golden.json b/hermetic_build/library_generation/tests/resources/goldens/.repo-metadata-proto-only-golden.json new file mode 100644 index 0000000000..7730cd6987 --- /dev/null +++ b/hermetic_build/library_generation/tests/resources/goldens/.repo-metadata-proto-only-golden.json @@ -0,0 +1,19 @@ +{ + "api_shortname": "baremetalsolution", + "name_pretty": "Bare Metal Solution", + "product_documentation": "https://cloud.google.com/bare-metal/docs", + "api_description": "Bring your Oracle workloads to Google Cloud with Bare Metal Solution and jumpstart your cloud journey with minimal risk.", + "client_documentation": "https://cloud.google.com/java/docs/reference/google-cloud-bare-metal-solution/latest/overview", + "release_level": "preview", + "transport": "grpc", + "language": "java", + "repo": "googleapis/sdk-platform-java", + "repo_short": "java-bare-metal-solution", + "distribution_name": "com.google.cloud:google-cloud-bare-metal-solution", + "library_type": "OTHER", + "requires_billing": true, + "rest_documentation": "https://cloud.google.com/bare-metal/docs/reference/rest", + "rpc_documentation": "https://cloud.google.com/bare-metal/docs/reference/rpc", + "recommended_package": "com.google.example", + "min_java_version": 8 +} \ No newline at end of file diff --git a/hermetic_build/library_generation/tests/resources/goldens/owlbot-golden.py b/hermetic_build/library_generation/tests/resources/goldens/owlbot-golden.py new file mode 100644 index 0000000000..6da4795433 --- /dev/null +++ b/hermetic_build/library_generation/tests/resources/goldens/owlbot-golden.py @@ -0,0 +1,38 @@ +# 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 +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import synthtool as s +from synthtool.languages import java + +for library in s.get_staging_dirs(): + # put any special-case replacements here + s.move(library) + +s.remove_staging_dirs() +java.common_templates( + monorepo=True, + excludes=[ + ".github/*", + ".kokoro/*", + "samples/*", + "CODE_OF_CONDUCT.md", + "CONTRIBUTING.md", + "LICENSE", + "SECURITY.md", + "java.header", + "license-checks.xml", + "renovate.json", + ".gitignore", + ], +) \ No newline at end of file diff --git a/hermetic_build/library_generation/tests/resources/integration/google-cloud-java/generation_config.yaml b/hermetic_build/library_generation/tests/resources/integration/google-cloud-java/generation_config.yaml new file mode 100644 index 0000000000..d71f3863ec --- /dev/null +++ b/hermetic_build/library_generation/tests/resources/integration/google-cloud-java/generation_config.yaml @@ -0,0 +1,44 @@ +gapic_generator_version: 2.38.1 +googleapis_commitish: 4ce0ff67a3d4509be641cbe47a35844ddc1268fc +libraries_bom_version: 26.37.0 +libraries: + - api_shortname: apigeeconnect + name_pretty: Apigee Connect + product_documentation: "https://cloud.google.com/apigee/docs/hybrid/v1.3/apigee-connect/" + api_description: "allows the Apigee hybrid management plane to connect securely to the MART service in the runtime plane without requiring you to expose the MART endpoint on the internet." + release_level: "stable" + library_name: "apigee-connect" + GAPICs: + - proto_path: google/cloud/apigeeconnect/v1 + + - api_shortname: alloydb + name_pretty: AlloyDB + product_documentation: https://cloud.google.com/alloydb/ + api_description: AlloyDB is a fully managed, PostgreSQL-compatible database service + with industry-leading performance, availability, and scale. + rest_documentation: https://cloud.google.com/alloydb/docs/reference/rest + GAPICs: + - proto_path: google/cloud/alloydb/v1 + - proto_path: google/cloud/alloydb/v1alpha + - proto_path: google/cloud/alloydb/v1beta + + - api_shortname: alloydb + name_pretty: AlloyDB connectors + product_documentation: https://cloud.google.com/alloydb/docs + api_description: AlloyDB is a fully-managed, PostgreSQL-compatible database for + demanding transactional workloads. It provides enterprise-grade performance and + availability while maintaining 100% compatibility with open-source PostgreSQL. + library_name: alloydb-connectors + rest_documentation: https://cloud.google.com/alloydb/docs/reference/rest + GAPICs: + - proto_path: google/cloud/alloydb/connectors/v1 + - proto_path: google/cloud/alloydb/connectors/v1alpha + - proto_path: google/cloud/alloydb/connectors/v1beta + + - api_shortname: cloudcontrolspartner + name_pretty: Cloud Controls Partner API + product_documentation: https://cloud.google.com/sovereign-controls-by-partners/docs/sovereign-partners + api_description: Provides insights about your customers and their Assured Workloads based on your Sovereign Controls by Partners offering. + GAPICs: + - proto_path: google/cloud/cloudcontrolspartner/v1 + - proto_path: google/cloud/cloudcontrolspartner/v1beta diff --git a/hermetic_build/library_generation/tests/resources/integration/google-cloud-java/pr-description-golden.txt b/hermetic_build/library_generation/tests/resources/integration/google-cloud-java/pr-description-golden.txt new file mode 100644 index 0000000000..cb855dcd52 --- /dev/null +++ b/hermetic_build/library_generation/tests/resources/integration/google-cloud-java/pr-description-golden.txt @@ -0,0 +1,54 @@ +This pull request is generated with proto changes between [googleapis/googleapis@a17d4ca](https://github.com/googleapis/googleapis/commit/a17d4caf184b050d50cacf2b0d579ce72c31ce74) (exclusive) and [googleapis/googleapis@4ce0ff6](https://github.com/googleapis/googleapis/commit/4ce0ff67a3d4509be641cbe47a35844ddc1268fc) (inclusive). + +BEGIN_COMMIT_OVERRIDE +BEGIN_NESTED_COMMIT +docs: [cloudcontrolspartner] update documentation URL + +PiperOrigin-RevId: 612723053 + +Source Link: [googleapis/googleapis@7659dd2](https://github.com/googleapis/googleapis/commit/7659dd2244563fd902b681bdcadbe5385b8d3462) +END_NESTED_COMMIT +BEGIN_NESTED_COMMIT +feat: [cloudcontrolspartner] added CloudControlsPartner API + +PiperOrigin-RevId: 612632640 + +Source Link: [googleapis/googleapis@05d889e](https://github.com/googleapis/googleapis/commit/05d889e7dfe087fc2ddc9de9579f01d4e1c2f35e) +END_NESTED_COMMIT +BEGIN_NESTED_COMMIT +feat: [alloydb] support for obtaining the public IP address of an Instance +feat: [alloydb] support for getting PSC DNS name from the GetConnectionInfo API +feat: [alloydb] add PSC cluster and instance configuration settings to enable/disable PSC and obtain the PSC endpoint name +feat: [alloydb] add new API to list the databases in a project and location +docs: [alloydb] clarified read pool config is for read pool type instances + +PiperOrigin-RevId: 610475013 + +Source Link: [googleapis/googleapis@aa16fda](https://github.com/googleapis/googleapis/commit/aa16fdad909bc33e2d4ff04cfde56a46d0e52b13) +END_NESTED_COMMIT +BEGIN_NESTED_COMMIT +feat: [alloydb] support for obtaining the public IP address of an Instance +feat: [alloydb] support for getting PSC DNS name from the GetConnectionInfo API + +PiperOrigin-RevId: 610415824 + +Source Link: [googleapis/googleapis@0733fdb](https://github.com/googleapis/googleapis/commit/0733fdb5f745192f9f3c95f8d08039286567cbcc) +END_NESTED_COMMIT +BEGIN_NESTED_COMMIT +docs: [cloudcontrolspartner] Updated comment for method `ListCustomers` in service `CloudControlsPartnerCore` +docs: [cloudcontrolspartner] Updated comment for field `location` in message `.google.cloud.cloudcontrolspartner.v1beta.Workload` +docs: [cloudcontrolspartner] Updated a comment for field `partner_project_id` in message `.google.cloud.cloudcontrolspartner.v1beta.Partner` +docs: [cloudcontrolspartner] Updated documentation URL + +PiperOrigin-RevId: 609026905 + +Source Link: [googleapis/googleapis@9e35c62](https://github.com/googleapis/googleapis/commit/9e35c620157d7b11cb5b2e5d0249c5caaee824f3) +END_NESTED_COMMIT +BEGIN_NESTED_COMMIT +feat: [cloudcontrolspartner] added CloudControlsPartner API + +PiperOrigin-RevId: 606720708 + +Source Link: [googleapis/googleapis@36dedd0](https://github.com/googleapis/googleapis/commit/36dedd0d9020c19d1c8259003c2fe9656ada7471) +END_NESTED_COMMIT +END_COMMIT_OVERRIDE \ No newline at end of file diff --git a/hermetic_build/library_generation/tests/resources/integration/java-bigtable/generation_config.yaml b/hermetic_build/library_generation/tests/resources/integration/java-bigtable/generation_config.yaml new file mode 100644 index 0000000000..c6912c8125 --- /dev/null +++ b/hermetic_build/library_generation/tests/resources/integration/java-bigtable/generation_config.yaml @@ -0,0 +1,22 @@ +gapic_generator_version: 2.37.0 +protoc_version: 25.2 +googleapis_commitish: 9868a57470a969ffa1d21194a5c05d7a6e4e98cc +libraries: +- api_shortname: bigtable + name_pretty: Cloud Bigtable + api_description: "Java idiomatic client for Cloud Bigtable." + product_documentation: "https://cloud.google.com/bigtable" + client_documentation: "https://cloud.google.com/java/docs/reference/google-cloud-bigtable/latest/history" + issue_tracker: "https://issuetracker.google.com/savedsearches/559777" + release_level: "stable" + language: "java" + repo: "googleapis/java-bigtable" + repo_short: "java-bigtable" + distribution_name: "com.google.cloud:google-cloud-bigtable" + excluded_poms: "google-cloud-bigtable-bom" + extra_versioned_modules: "google-cloud-bigtable-emulator,google-cloud-bigtable-emulator-core" + codeowner_team: "@googleapis/api-bigtable @googleapis/api-bigtable-partners" + library_type: GAPIC_COMBO + GAPICs: + - proto_path: google/bigtable/admin/v2 + - proto_path: google/bigtable/v2 diff --git a/hermetic_build/library_generation/tests/resources/integration/java-bigtable/pr-description-golden.txt b/hermetic_build/library_generation/tests/resources/integration/java-bigtable/pr-description-golden.txt new file mode 100644 index 0000000000..2dcdbc7756 --- /dev/null +++ b/hermetic_build/library_generation/tests/resources/integration/java-bigtable/pr-description-golden.txt @@ -0,0 +1,18 @@ +This pull request is generated with proto changes between googleapis commit 679060c64136e85b52838f53cfe612ce51e60d1d (exclusive) and fc3043ebe12fb6bc1729c175e1526c859ce751d8 (inclusive). +Qualified commits are: +[googleapis/googleapis@fbcfef0](https://github.com/googleapis/googleapis/commit/fbcfef09510b842774530989889ed1584a8b5acb) +[googleapis/googleapis@63d2a60](https://github.com/googleapis/googleapis/commit/63d2a60056ad5b156c05c7fb13138fc886c3b739) +BEGIN_COMMIT_OVERRIDE +BEGIN_NESTED_COMMIT +fix: extend timeouts for deleting snapshots, backups and tables + +PiperOrigin-RevId: 605388988 + +END_NESTED_COMMIT +BEGIN_NESTED_COMMIT +chore: update retry settings for backup rpcs + +PiperOrigin-RevId: 605367937 + +END_NESTED_COMMIT +END_COMMIT_OVERRIDE \ No newline at end of file diff --git a/hermetic_build/library_generation/tests/resources/misc/versions.txt b/hermetic_build/library_generation/tests/resources/misc/versions.txt new file mode 100644 index 0000000000..e4258504e4 --- /dev/null +++ b/hermetic_build/library_generation/tests/resources/misc/versions.txt @@ -0,0 +1,9 @@ +# test versions.txt obtained from sdk-platform-java + +gapic-generator-java:2.25.0:2.25.1-SNAPSHOT +api-common:2.16.0:2.16.1-SNAPSHOT +gax:2.33.0:2.33.1-SNAPSHOT +gax-grpc:2.34.0:2.33.1-SNAPSHOT +gax-httpjson:0.118.0:0.118.1-SNAPSHOT +proto-google-common-protos:2.24.0:2.24.1-SNAPSHOT +grpc-google-common-protos:2.24.0:2.24.1-SNAPSHOT diff --git a/hermetic_build/library_generation/tests/resources/proto_path_library/proto-test-library/src/main/proto/google/cloud/test/v1/empty.proto b/hermetic_build/library_generation/tests/resources/proto_path_library/proto-test-library/src/main/proto/google/cloud/test/v1/empty.proto new file mode 100644 index 0000000000..e69de29bb2 diff --git a/hermetic_build/library_generation/tests/resources/proto_path_library_multiple_protos/proto-1/fake.proto b/hermetic_build/library_generation/tests/resources/proto_path_library_multiple_protos/proto-1/fake.proto new file mode 100644 index 0000000000..e69de29bb2 diff --git a/hermetic_build/library_generation/tests/resources/proto_path_library_multiple_protos/proto-2/fake.proto b/hermetic_build/library_generation/tests/resources/proto_path_library_multiple_protos/proto-2/fake.proto new file mode 100644 index 0000000000..e69de29bb2 diff --git a/hermetic_build/library_generation/tests/resources/test-config/generation_config.yaml b/hermetic_build/library_generation/tests/resources/test-config/generation_config.yaml new file mode 100644 index 0000000000..168c8fd9a5 --- /dev/null +++ b/hermetic_build/library_generation/tests/resources/test-config/generation_config.yaml @@ -0,0 +1,24 @@ +gapic_generator_version: 2.34.0 +protoc_version: 25.2 +googleapis_commitish: 1a45bf7393b52407188c82e63101db7dc9c72026 +libraries_bom_version: 26.37.0 +libraries: + - api_shortname: cloudasset + name_pretty: Cloud Asset Inventory + product_documentation: "https://cloud.google.com/resource-manager/docs/cloud-asset-inventory/overview" + api_description: "provides inventory services based on a time series database." + library_name: "asset" + client_documentation: "https://cloud.google.com/java/docs/reference/google-cloud-asset/latest/overview" + distribution_name: "com.google.cloud:google-cloud-asset" + release_level: "stable" + issue_tracker: "https://issuetracker.google.com/issues/new?component=187210&template=0" + api_reference: "https://cloud.google.com/resource-manager/docs/cloud-asset-inventory/overview" + codeowner_team: "@googleapis/analytics-dpe" + excluded_poms: proto-google-iam-v1-bom,google-iam-policy,proto-google-iam-v1 + excluded_dependencies: google-iam-policy + GAPICs: + - proto_path: google/cloud/asset/v1 + - proto_path: google/cloud/asset/v1p1beta1 + - proto_path: google/cloud/asset/v1p2beta1 + - proto_path: google/cloud/asset/v1p5beta1 + - proto_path: google/cloud/asset/v1p7beta1 diff --git a/hermetic_build/library_generation/tests/resources/test-config/generation_config_library_modified.yaml b/hermetic_build/library_generation/tests/resources/test-config/generation_config_library_modified.yaml new file mode 100644 index 0000000000..f9ae96693b --- /dev/null +++ b/hermetic_build/library_generation/tests/resources/test-config/generation_config_library_modified.yaml @@ -0,0 +1,14 @@ +gapic_generator_version: 2.34.0 +googleapis_commitish: 1a45bf7393b52407188c82e63101db7dc9c72026 +libraries_bom_version: 26.37.0 +libraries: + - api_shortname: cloudasset + name_pretty: Cloud Asset Inventory + product_documentation: "https://cloud.google.com/resource-manager/docs/cloud-asset-inventory/overview" + api_description: "provides inventory services based on a time series database." + GAPICs: + - proto_path: google/cloud/asset/v1 + - proto_path: google/cloud/asset/v1p1beta1 + - proto_path: google/cloud/asset/v1p2beta1 + - proto_path: google/cloud/asset/v1p5beta1 + - proto_path: google/cloud/asset/v1p7beta1 diff --git a/hermetic_build/library_generation/tests/resources/test-config/generation_config_with_duplicate_library_name.yaml b/hermetic_build/library_generation/tests/resources/test-config/generation_config_with_duplicate_library_name.yaml new file mode 100644 index 0000000000..c5613f4308 --- /dev/null +++ b/hermetic_build/library_generation/tests/resources/test-config/generation_config_with_duplicate_library_name.yaml @@ -0,0 +1,51 @@ +gapic_generator_version: 2.34.0 +protoc_version: 25.2 +googleapis_commitish: 1a45bf7393b52407188c82e63101db7dc9c72026 +libraries_bom_version: 26.37.0 +owlbot_cli_image: sha256:623647ee79ac605858d09e60c1382a716c125fb776f69301b72de1cd35d49409 +synthtool_commitish: 6612ab8f3afcd5e292aecd647f0fa68812c9f5b5 +template_excludes: + - ".github/*" + - ".kokoro/*" + - "samples/*" + - "CODE_OF_CONDUCT.md" + - "CONTRIBUTING.md" + - "LICENSE" + - "SECURITY.md" + - "java.header" + - "license-checks.xml" + - "renovate.json" + - ".gitignore" +libraries: + - api_shortname: cloudasset + name_pretty: Cloud Asset + product_documentation: "https://cloud.google.com/resource-manager/docs/cloud-asset-inventory/overview" + api_description: "provides inventory services based on a time series database." + library_name: "asset" + client_documentation: "https://cloud.google.com/java/docs/reference/google-cloud-asset/latest/overview" + distribution_name: "com.google.cloud:google-cloud-asset" + release_level: "stable" + issue_tracker: "https://issuetracker.google.com/issues/new?component=187210&template=0" + api_reference: "https://cloud.google.com/resource-manager/docs/cloud-asset-inventory/overview" + codeowner_team: "@googleapis/analytics-dpe" + excluded_poms: proto-google-iam-v1-bom,google-iam-policy,proto-google-iam-v1 + excluded_dependencies: google-iam-policy + GAPICs: + - proto_path: google/cloud/asset/v1 + - proto_path: google/cloud/asset/v1p1beta1 + - proto_path: google/cloud/asset/v1p2beta1 + - proto_path: google/cloud/asset/v1p5beta1 + - proto_path: google/cloud/asset/v1p7beta1 + + - api_shortname: another-cloudasset + name_pretty: Cloud Asset Inventory + product_documentation: "https://cloud.google.com/resource-manager/docs/cloud-asset-inventory/overview" + api_description: "provides inventory services based on a time series database." + library_name: "asset" + client_documentation: "https://cloud.google.com/java/docs/reference/google-cloud-asset/latest/overview" + distribution_name: "com.google.cloud:google-cloud-asset" + release_level: "stable" + issue_tracker: "https://issuetracker.google.com/issues/new?component=187210&template=0" + api_reference: "https://cloud.google.com/resource-manager/docs/cloud-asset-inventory/overview" + GAPICs: + - proto_path: google/cloud/asset/v1 diff --git a/hermetic_build/library_generation/tests/resources/test-config/monorepo_baseline.yaml b/hermetic_build/library_generation/tests/resources/test-config/monorepo_baseline.yaml new file mode 100644 index 0000000000..c2c4fd4a3b --- /dev/null +++ b/hermetic_build/library_generation/tests/resources/test-config/monorepo_baseline.yaml @@ -0,0 +1,30 @@ +gapic_generator_version: 2.34.0 +googleapis_commitish: 1a45bf7393b52407188c82e63101db7dc9c72026 +libraries_bom_version: 26.37.0 +libraries: + - api_shortname: cloudasset + name_pretty: Cloud Asset Inventory + product_documentation: "https://cloud.google.com/resource-manager/docs/cloud-asset-inventory/overview" + api_description: "provides inventory services based on a time series database." + library_name: "asset" + client_documentation: "https://cloud.google.com/java/docs/reference/google-cloud-asset/latest/overview" + distribution_name: "com.google.cloud:google-cloud-asset" + release_level: preview + GAPICs: + - proto_path: google/cloud/asset/v1 + - proto_path: google/cloud/asset/v1p1beta1 + - proto_path: google/cloud/asset/v1p2beta1 + - proto_path: google/cloud/asset/v1p5beta1 + - proto_path: google/cloud/asset/v1p7beta1 + - api_shortname: cloudbuild + name_pretty: Cloud Build + product_documentation: https://cloud.google.com/cloud-build/ + api_description: lets you build software quickly across all languages. Get complete + control over defining custom workflows for building, testing, and deploying across + multiple environments such as VMs, serverless, Kubernetes, or Firebase. + release_level: stable + distribution_name: com.google.cloud:google-cloud-build + issue_tracker: https://issuetracker.google.com/savedsearches/5226584 + GAPICs: + - proto_path: google/devtools/cloudbuild/v1 + - proto_path: google/devtools/cloudbuild/v2 diff --git a/hermetic_build/library_generation/tests/resources/test-config/monorepo_current.yaml b/hermetic_build/library_generation/tests/resources/test-config/monorepo_current.yaml new file mode 100644 index 0000000000..3ee2c8be2c --- /dev/null +++ b/hermetic_build/library_generation/tests/resources/test-config/monorepo_current.yaml @@ -0,0 +1,30 @@ +gapic_generator_version: 2.34.0 +googleapis_commitish: 1a45bf7393b52407188c82e63101db7dc9c72026 +libraries_bom_version: 26.37.0 +libraries: + - api_shortname: cloudasset + name_pretty: Cloud Asset Inventory + product_documentation: "https://cloud.google.com/resource-manager/docs/cloud-asset-inventory/overview" + api_description: "provides inventory services based on a time series database." + library_name: "asset" + client_documentation: "https://cloud.google.com/java/docs/reference/google-cloud-asset/latest/overview" + distribution_name: "com.google.cloud:google-cloud-asset" + release_level: stable + GAPICs: + - proto_path: google/cloud/asset/v1 + - proto_path: google/cloud/asset/v1p1beta1 + - proto_path: google/cloud/asset/v1p2beta1 + - proto_path: google/cloud/asset/v1p5beta1 + - proto_path: google/cloud/asset/v1p7beta1 + - api_shortname: cloudbuild + name_pretty: Cloud Build + product_documentation: https://cloud.google.com/cloud-build/ + api_description: lets you build software quickly across all languages. Get complete + control over defining custom workflows for building, testing, and deploying across + multiple environments such as VMs, serverless, Kubernetes, or Firebase. + release_level: stable + distribution_name: com.google.cloud:google-cloud-build + issue_tracker: https://issuetracker.google.com/savedsearches/5226584 + GAPICs: + - proto_path: google/devtools/cloudbuild/v1 + - proto_path: google/devtools/cloudbuild/v2 diff --git a/hermetic_build/library_generation/tests/resources/test-config/monorepo_with_common_protos.yaml b/hermetic_build/library_generation/tests/resources/test-config/monorepo_with_common_protos.yaml new file mode 100644 index 0000000000..6d4c94444a --- /dev/null +++ b/hermetic_build/library_generation/tests/resources/test-config/monorepo_with_common_protos.yaml @@ -0,0 +1,43 @@ +googleapis_commitish: 6a474b31c53cc1797710206824a17b364a835d2d +gapic_generator_version: 2.34.0 +# the libraries are ordered with respect to library name, which is +# java-{library.library_name} or java-{library.api-shortname} when +# library.library_name is not defined. +libraries: +- api_shortname: common-protos + name_pretty: Common Protos + product_documentation: https://github.com/googleapis/api-common-protos + api_description: Protobuf classes for Google's common protos. + release_level: stable + client_documentation: https://cloud.google.com/java/docs/reference/proto-google-common-protos/latest/history + distribution_name: com.google.api.grpc:proto-google-common-protos + excluded_dependencies: "proto-google-common-protos,grpc-google-common-protos,proto-google-common-protos-parent" + excluded_poms: "proto-google-common-protos-bom,proto-google-common-protos" + library_type: OTHER + GAPICs: + - proto_path: google/api + - proto_path: google/apps/card/v1 + - proto_path: google/cloud + - proto_path: google/cloud/audit + - proto_path: google/cloud/location + - proto_path: google/geo/type + - proto_path: google/logging/type + - proto_path: google/longrunning + - proto_path: google/rpc + - proto_path: google/rpc/context + - proto_path: google/shopping/type + - proto_path: google/type +- api_shortname: iam + name_pretty: IAM + product_documentation: https://cloud.google.com/iam + api_description: Manages access control for Google Cloud Platform resources + release_level: stable + client_documentation: https://cloud.google.com/java/docs/reference/proto-google-iam-v1/latest/overview + distribution_name: com.google.api.grpc:proto-google-iam-v1 + excluded_dependencies: "grpc-google-iam-v1" + excluded_poms: "proto-google-iam-v1-bom,google-iam-policy,proto-google-iam-v1" + library_type: OTHER + GAPICs: + - proto_path: google/iam/v1 + - proto_path: google/iam/v2 + - proto_path: google/iam/v2beta \ No newline at end of file diff --git a/hermetic_build/library_generation/tests/resources/test-config/monorepo_without_common_protos.yaml b/hermetic_build/library_generation/tests/resources/test-config/monorepo_without_common_protos.yaml new file mode 100644 index 0000000000..ca21ccfb01 --- /dev/null +++ b/hermetic_build/library_generation/tests/resources/test-config/monorepo_without_common_protos.yaml @@ -0,0 +1,33 @@ +gapic_generator_version: 2.34.0 +protoc_version: 25.2 +googleapis_commitish: 1a45bf7393b52407188c82e63101db7dc9c72026 +libraries_bom_version: 26.37.0 +libraries: + - api_shortname: cloudasset + name_pretty: Cloud Asset Inventory + product_documentation: "https://cloud.google.com/resource-manager/docs/cloud-asset-inventory/overview" + api_description: "provides inventory services based on a time series database." + library_name: "asset" + client_documentation: "https://cloud.google.com/java/docs/reference/google-cloud-asset/latest/overview" + distribution_name: "com.google.cloud:google-cloud-asset" + release_level: "stable" + issue_tracker: "https://issuetracker.google.com/issues/new?component=187210&template=0" + api_reference: "https://cloud.google.com/resource-manager/docs/cloud-asset-inventory/overview" + GAPICs: + - proto_path: google/cloud/asset/v1 + - proto_path: google/cloud/asset/v1p1beta1 + - proto_path: google/cloud/asset/v1p2beta1 + - proto_path: google/cloud/asset/v1p5beta1 + - proto_path: google/cloud/asset/v1p7beta1 + - api_shortname: cloudbuild + name_pretty: Cloud Build + product_documentation: https://cloud.google.com/cloud-build/ + api_description: lets you build software quickly across all languages. Get complete + control over defining custom workflows for building, testing, and deploying across + multiple environments such as VMs, serverless, Kubernetes, or Firebase. + release_level: stable + distribution_name: com.google.cloud:google-cloud-build + issue_tracker: https://issuetracker.google.com/savedsearches/5226584 + GAPICs: + - proto_path: google/devtools/cloudbuild/v1 + - proto_path: google/devtools/cloudbuild/v2 diff --git a/hermetic_build/library_generation/tests/resources/test-owlbot/fixtures/java_templates/release-please-update/.github/release-please.yml b/hermetic_build/library_generation/tests/resources/test-owlbot/fixtures/java_templates/release-please-update/.github/release-please.yml new file mode 100644 index 0000000000..807174cce1 --- /dev/null +++ b/hermetic_build/library_generation/tests/resources/test-owlbot/fixtures/java_templates/release-please-update/.github/release-please.yml @@ -0,0 +1,6 @@ +releaseType: java-yoshi +bumpMinorPreMajor: true +branches: +- releaseType: java-lts + bumpMinorPreMajor: true + branch: 1.127.12-sp \ No newline at end of file diff --git a/hermetic_build/library_generation/tests/resources/test-owlbot/fixtures/java_templates/release-please-update/.repo-metadata.json b/hermetic_build/library_generation/tests/resources/test-owlbot/fixtures/java_templates/release-please-update/.repo-metadata.json new file mode 100644 index 0000000000..840e69ca7a --- /dev/null +++ b/hermetic_build/library_generation/tests/resources/test-owlbot/fixtures/java_templates/release-please-update/.repo-metadata.json @@ -0,0 +1,18 @@ +{ + "api_shortname": "cloudasset", + "name_pretty": "Cloud Asset Inventory", + "product_documentation": "https://cloud.google.com/resource-manager/docs/cloud-asset-inventory/overview", + "api_reference": "https://cloud.google.com/resource-manager/docs/cloud-asset-inventory/overview", + "api_description": "provides inventory services based on a time series database. This database keeps a five week history of Google Cloud asset metadata. The Cloud Asset Inventory export service allows you to export all asset metadata at a certain timestamp or export event change history during a timeframe.", + "client_documentation": "https://googleapis.dev/java/google-cloud-asset/latest/index.html", + "issue_tracker": "https://issuetracker.google.com/issues/new?component=187210&template=0", + "release_level": "stable", + "transport": "grpc", + "requires_billing": true, + "language": "java", + "repo": "googleapis/java-asset", + "repo_short": "java-asset", + "distribution_name": "com.google.cloud:google-cloud-asset", + "library_type": "GAPIC_AUTO", + "api_id": "cloudasset.googleapis.com" +} \ No newline at end of file diff --git a/hermetic_build/library_generation/tests/resources/test-owlbot/fixtures/java_templates/render-readme/.repo-metadata.json b/hermetic_build/library_generation/tests/resources/test-owlbot/fixtures/java_templates/render-readme/.repo-metadata.json new file mode 100644 index 0000000000..840e69ca7a --- /dev/null +++ b/hermetic_build/library_generation/tests/resources/test-owlbot/fixtures/java_templates/render-readme/.repo-metadata.json @@ -0,0 +1,18 @@ +{ + "api_shortname": "cloudasset", + "name_pretty": "Cloud Asset Inventory", + "product_documentation": "https://cloud.google.com/resource-manager/docs/cloud-asset-inventory/overview", + "api_reference": "https://cloud.google.com/resource-manager/docs/cloud-asset-inventory/overview", + "api_description": "provides inventory services based on a time series database. This database keeps a five week history of Google Cloud asset metadata. The Cloud Asset Inventory export service allows you to export all asset metadata at a certain timestamp or export event change history during a timeframe.", + "client_documentation": "https://googleapis.dev/java/google-cloud-asset/latest/index.html", + "issue_tracker": "https://issuetracker.google.com/issues/new?component=187210&template=0", + "release_level": "stable", + "transport": "grpc", + "requires_billing": true, + "language": "java", + "repo": "googleapis/java-asset", + "repo_short": "java-asset", + "distribution_name": "com.google.cloud:google-cloud-asset", + "library_type": "GAPIC_AUTO", + "api_id": "cloudasset.googleapis.com" +} \ No newline at end of file diff --git a/hermetic_build/library_generation/tests/resources/test-owlbot/fixtures/java_templates/standard/.repo-metadata.json b/hermetic_build/library_generation/tests/resources/test-owlbot/fixtures/java_templates/standard/.repo-metadata.json new file mode 100644 index 0000000000..840e69ca7a --- /dev/null +++ b/hermetic_build/library_generation/tests/resources/test-owlbot/fixtures/java_templates/standard/.repo-metadata.json @@ -0,0 +1,18 @@ +{ + "api_shortname": "cloudasset", + "name_pretty": "Cloud Asset Inventory", + "product_documentation": "https://cloud.google.com/resource-manager/docs/cloud-asset-inventory/overview", + "api_reference": "https://cloud.google.com/resource-manager/docs/cloud-asset-inventory/overview", + "api_description": "provides inventory services based on a time series database. This database keeps a five week history of Google Cloud asset metadata. The Cloud Asset Inventory export service allows you to export all asset metadata at a certain timestamp or export event change history during a timeframe.", + "client_documentation": "https://googleapis.dev/java/google-cloud-asset/latest/index.html", + "issue_tracker": "https://issuetracker.google.com/issues/new?component=187210&template=0", + "release_level": "stable", + "transport": "grpc", + "requires_billing": true, + "language": "java", + "repo": "googleapis/java-asset", + "repo_short": "java-asset", + "distribution_name": "com.google.cloud:google-cloud-asset", + "library_type": "GAPIC_AUTO", + "api_id": "cloudasset.googleapis.com" +} \ No newline at end of file diff --git a/hermetic_build/library_generation/tests/resources/test-owlbot/java-admanager/.repo-metadata.json b/hermetic_build/library_generation/tests/resources/test-owlbot/java-admanager/.repo-metadata.json new file mode 100644 index 0000000000..1c680ddfea --- /dev/null +++ b/hermetic_build/library_generation/tests/resources/test-owlbot/java-admanager/.repo-metadata.json @@ -0,0 +1,16 @@ +{ + "api_shortname": "admanager", + "name_pretty": "Google Ad Manager API", + "product_documentation": "https://developers.google.com/ad-manager/api/beta", + "api_description": "The Ad Manager API enables an app to integrate with Google Ad Manager. You can read Ad Manager data and run reports using the API.", + "client_documentation": "https://cloud.google.com/java/docs/reference/ad-manager/latest/overview", + "release_level": "preview", + "transport": "http", + "language": "java", + "repo": "googleapis/google-cloud-java", + "repo_short": "java-admanager", + "distribution_name": "com.google.api-ads:ad-manager", + "api_id": "admanager.googleapis.com", + "library_type": "GAPIC_AUTO", + "requires_billing": true +} \ No newline at end of file diff --git a/hermetic_build/library_generation/tests/resources/test-owlbot/java-admanager/ad-manager-bom/pom-golden.xml b/hermetic_build/library_generation/tests/resources/test-owlbot/java-admanager/ad-manager-bom/pom-golden.xml new file mode 100644 index 0000000000..2adae69c60 --- /dev/null +++ b/hermetic_build/library_generation/tests/resources/test-owlbot/java-admanager/ad-manager-bom/pom-golden.xml @@ -0,0 +1,38 @@ + + + 4.0.0 + com.google.api-ads + ad-manager-bom + 0.2.0-SNAPSHOT + pom + + com.google.cloud + google-cloud-pom-parent + 1.37.0-SNAPSHOT + ../../google-cloud-pom-parent/pom.xml + + + Google Google Ad Manager API BOM + + BOM for Google Ad Manager API + + + + true + + + + + + com.google.api-ads + ad-manager + 0.2.0-SNAPSHOT + + + com.google.api-ads.api.grpc + proto-ad-manager-v1 + 0.2.0-SNAPSHOT + + + + diff --git a/hermetic_build/library_generation/tests/resources/test-owlbot/java-admanager/ad-manager/pom-golden.xml b/hermetic_build/library_generation/tests/resources/test-owlbot/java-admanager/ad-manager/pom-golden.xml new file mode 100644 index 0000000000..4c8a8a8343 --- /dev/null +++ b/hermetic_build/library_generation/tests/resources/test-owlbot/java-admanager/ad-manager/pom-golden.xml @@ -0,0 +1,110 @@ + + + 4.0.0 + com.google.api-ads + ad-manager + 0.2.0-SNAPSHOT + jar + Google Google Ad Manager API + Google Ad Manager API The Ad Manager API enables an app to integrate with Google Ad Manager. You can read Ad Manager data and run reports using the API. + + com.google.api-ads + ad-manager-parent + 0.2.0-SNAPSHOT + + + ad-manager + + + + io.grpc + grpc-api + + + io.grpc + grpc-stub + + + io.grpc + grpc-protobuf + + + com.google.api + api-common + + + com.google.protobuf + protobuf-java + + + com.google.api.grpc + proto-google-common-protos + + + + com.google.api-ads.api.grpc + proto-ad-manager-v1 + + + com.google.guava + guava + + + com.google.api + gax + + + com.google.api + gax-grpc + + + com.google.api + gax-httpjson + + + com.google.api.grpc + grpc-google-common-protos + test + + + com.google.api.grpc + proto-google-iam-v1 + + + com.google.api.grpc + grpc-google-iam-v1 + test + + + org.threeten + threetenbp + + + + + junit + junit + test + + + + + com.google.api + gax + testlib + test + + + com.google.api + gax-grpc + testlib + test + + + com.google.api + gax-httpjson + testlib + test + + + diff --git a/hermetic_build/library_generation/tests/resources/test-owlbot/java-admanager/pom-golden.xml b/hermetic_build/library_generation/tests/resources/test-owlbot/java-admanager/pom-golden.xml new file mode 100644 index 0000000000..669d294ae7 --- /dev/null +++ b/hermetic_build/library_generation/tests/resources/test-owlbot/java-admanager/pom-golden.xml @@ -0,0 +1,49 @@ + + + 4.0.0 + com.google.api-ads + ad-manager-parent + pom + 0.2.0-SNAPSHOT + Google Google Ad Manager API Parent + + Java idiomatic client for Google Cloud Platform services. + + + + com.google.cloud + google-cloud-jar-parent + 1.37.0-SNAPSHOT + ../google-cloud-jar-parent/pom.xml + + + + UTF-8 + UTF-8 + github + ad-manager-parent + + + + + + com.google.api-ads + ad-manager + 0.2.0-SNAPSHOT + + + com.google.api-ads.api.grpc + proto-ad-manager-v1 + 0.2.0-SNAPSHOT + + + + + + + ad-manager + proto-ad-manager-v1 + ad-manager-bom + + + diff --git a/hermetic_build/library_generation/tests/resources/test-owlbot/java-admanager/proto-ad-manager-v1/pom-golden.xml b/hermetic_build/library_generation/tests/resources/test-owlbot/java-admanager/proto-ad-manager-v1/pom-golden.xml new file mode 100644 index 0000000000..eef103e533 --- /dev/null +++ b/hermetic_build/library_generation/tests/resources/test-owlbot/java-admanager/proto-ad-manager-v1/pom-golden.xml @@ -0,0 +1,37 @@ + + 4.0.0 + com.google.api-ads.api.grpc + proto-ad-manager-v1 + 0.2.0-SNAPSHOT + proto-ad-manager-v1 + Proto library for ad-manager + + com.google.api-ads + ad-manager-parent + 0.2.0-SNAPSHOT + + + + com.google.protobuf + protobuf-java + + + com.google.api.grpc + proto-google-common-protos + + + com.google.api.grpc + proto-google-iam-v1 + + + com.google.api + api-common + + + com.google.guava + guava + + + diff --git a/hermetic_build/library_generation/tests/resources/test-owlbot/java-admanager/versions.txt b/hermetic_build/library_generation/tests/resources/test-owlbot/java-admanager/versions.txt new file mode 100644 index 0000000000..3f073728f3 --- /dev/null +++ b/hermetic_build/library_generation/tests/resources/test-owlbot/java-admanager/versions.txt @@ -0,0 +1,6 @@ +# Format: +# module:released-version:current-version + +google-cloud-java:1.36.0:1.37.0-SNAPSHOT +ad-manager:0.1.0:0.2.0-SNAPSHOT +proto-ad-manager-v1:0.1.0:0.2.0-SNAPSHOT diff --git a/hermetic_build/library_generation/tests/resources/test-owlbot/testdata/FooGrpcGolden.java b/hermetic_build/library_generation/tests/resources/test-owlbot/testdata/FooGrpcGolden.java new file mode 100644 index 0000000000..be407421e6 --- /dev/null +++ b/hermetic_build/library_generation/tests/resources/test-owlbot/testdata/FooGrpcGolden.java @@ -0,0 +1,22 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package foo; + +// This class is intentionally missing a license header + +class FooGrpc { + +} diff --git a/hermetic_build/library_generation/tests/resources/test-owlbot/testdata/FooProtoGolden.java b/hermetic_build/library_generation/tests/resources/test-owlbot/testdata/FooProtoGolden.java new file mode 100644 index 0000000000..3f5a90bc7e --- /dev/null +++ b/hermetic_build/library_generation/tests/resources/test-owlbot/testdata/FooProtoGolden.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: foo/foo_proto.proto + +package foo; + +// This class is intentionally missing a license header + +class FooProto { + +} \ No newline at end of file diff --git a/hermetic_build/library_generation/tests/resources/test-owlbot/testdata/README-golden.md b/hermetic_build/library_generation/tests/resources/test-owlbot/testdata/README-golden.md new file mode 100644 index 0000000000..f0e6beb0c8 --- /dev/null +++ b/hermetic_build/library_generation/tests/resources/test-owlbot/testdata/README-golden.md @@ -0,0 +1,183 @@ +# Google Cloud Asset Inventory Client for Java + +Java idiomatic client for [Cloud Asset Inventory][product-docs]. + +[![Maven][maven-version-image]][maven-version-link] +![Stability][stability-image] + +- [Product Documentation][product-docs] +- [Client Library Documentation][javadocs] + + +:bus: In October 2022, this library has moved to +[google-cloud-java/java-asset]( +https://github.com/googleapis/google-cloud-java/tree/main/java-asset). +This repository will be archived in the future. +Future releases will appear in the new repository (https://github.com/googleapis/google-cloud-java/releases). +The Maven artifact coordinates (`com.google.cloud:google-cloud-asset`) remain the same. + +## Quickstart + + +If you are using Maven, add this to your pom.xml file: + + +```xml + + com.google.cloud + google-cloud-asset + 1.2.3 + +``` + +If you are using Gradle without BOM, add this to your dependencies: + +```Groovy +implementation 'com.google.cloud:google-cloud-asset:1.2.3' +``` + +If you are using SBT, add this to your dependencies: + +```Scala +libraryDependencies += "com.google.cloud" % "google-cloud-asset" % "1.2.3" +``` + +## 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 Asset Inventory APIs, and the authenticated principal must have the [IAM role(s)][predefined-iam-roles] required to access GCP resources using the Cloud Asset Inventory API calls. + +## Getting Started + +### Prerequisites + +You will need a [Google Cloud Platform Console][developer-console] project with the Cloud Asset Inventory [API enabled][enable-api]. +You will need to [enable billing][enable-billing] to use Google Cloud Asset Inventory. +[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-asset` library. See the [Quickstart](#quickstart) section +to add `google-cloud-asset` as a dependency in your code. + +## About Cloud Asset Inventory + + +[Cloud Asset Inventory][product-docs] provides inventory services based on a time series database. This database keeps a five week history of Google Cloud asset metadata. The Cloud Asset Inventory export service allows you to export all asset metadata at a certain timestamp or export event change history during a timeframe. + +See the [Cloud Asset Inventory client library docs][javadocs] to learn how to +use this Cloud Asset Inventory Client Library. + + + + + + +## Troubleshooting + +To get help, follow the instructions in the [shared Troubleshooting document][troubleshooting]. + +## Transport + +Cloud Asset Inventory 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. + +Java is a registered trademark of Oracle and/or its affiliates. + +[product-docs]: https://cloud.google.com/resource-manager/docs/cloud-asset-inventory/overview +[javadocs]: https://googleapis.dev/java/google-cloud-asset/latest/index.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-asset.svg +[maven-version-link]: https://central.sonatype.com/artifact/com.google.cloud/google-cloud-asset/1.2.3 +[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/java-asset/blob/main/CONTRIBUTING.md +[code-of-conduct]: https://github.com/googleapis/java-asset/blob/main/CODE_OF_CONDUCT.md#contributor-code-of-conduct +[license]: https://github.com/googleapis/java-asset/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=cloudasset.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/hermetic_build/library_generation/tests/resources/test-owlbot/testdata/SampleClass.java b/hermetic_build/library_generation/tests/resources/test-owlbot/testdata/SampleClass.java new file mode 100644 index 0000000000..849548b9da --- /dev/null +++ b/hermetic_build/library_generation/tests/resources/test-owlbot/testdata/SampleClass.java @@ -0,0 +1,29 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package dlp; + +class ExampleClass { + public static void foo() { + System.out.println("bar"); + } + + public static class InnerClass { + public void asdf() { + System.out.println("qwer"); + } + } +} diff --git a/hermetic_build/library_generation/tests/resources/test-owlbot/testdata/SampleClassGolden.java b/hermetic_build/library_generation/tests/resources/test-owlbot/testdata/SampleClassGolden.java new file mode 100644 index 0000000000..dbe1fe9d18 --- /dev/null +++ b/hermetic_build/library_generation/tests/resources/test-owlbot/testdata/SampleClassGolden.java @@ -0,0 +1,23 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package dlp; + +class ExampleClass { + + public static class InnerClass { + } +} diff --git a/hermetic_build/library_generation/tests/resources/test-owlbot/testdata/SampleCopyMethodGolden.java b/hermetic_build/library_generation/tests/resources/test-owlbot/testdata/SampleCopyMethodGolden.java new file mode 100644 index 0000000000..02ce855bc9 --- /dev/null +++ b/hermetic_build/library_generation/tests/resources/test-owlbot/testdata/SampleCopyMethodGolden.java @@ -0,0 +1,37 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package dlp; + +class ExampleClass { + public static void foo() { + System.out.println("bar"); + } + + public static void foobar() { + System.out.println("bar"); + } + + public static class InnerClass { + public void asdf() { + System.out.println("qwer"); + } + + public void xyz() { + System.out.println("qwer"); + } + } +} diff --git a/hermetic_build/library_generation/tests/resources/test-owlbot/testdata/SampleDeprecateClass.java b/hermetic_build/library_generation/tests/resources/test-owlbot/testdata/SampleDeprecateClass.java new file mode 100644 index 0000000000..d2ae795106 --- /dev/null +++ b/hermetic_build/library_generation/tests/resources/test-owlbot/testdata/SampleDeprecateClass.java @@ -0,0 +1,40 @@ +/* + * Copyright 2021 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +class ExampleClass { + public void cat(String bar) { + for (int i = 0; i < 3; i++) { + System.out.println("this is a test " + bar); + } + } + + @Beta + @Generated() + public void foo(String bar) { + for (int i = 0; i < 3; i++) { + System.out.println("this is a test " + bar); + } + } + + /** + * This is an existing comment. + */ + public void bar(String bar) { + for (int i = 0; i < 3; i++) { + System.out.println("this is a test " + bar); + } + } +} diff --git a/hermetic_build/library_generation/tests/resources/test-owlbot/testdata/SampleDeprecateMethodGolden.java b/hermetic_build/library_generation/tests/resources/test-owlbot/testdata/SampleDeprecateMethodGolden.java new file mode 100644 index 0000000000..a5107d9ce6 --- /dev/null +++ b/hermetic_build/library_generation/tests/resources/test-owlbot/testdata/SampleDeprecateMethodGolden.java @@ -0,0 +1,52 @@ +/* + * 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. + */ + +class ExampleClass { + /** + * @deprecated sample has the same functionality as foobar. + */ + @Deprecated + public void cat(String bar) { + for (int i = 0; i < 3; i++) { + System.out.println("this is a test " + bar); + } + } + + /** + * @deprecated This method will be removed in the next major version. + * Use {@link #sample()} instead + */ + @Beta + @Generated() + @Deprecated + public void foo(String bar) { + for (int i = 0; i < 3; i++) { + System.out.println("this is a test " + bar); + } + } + + /** + * This is an existing comment. + * @deprecated This method will be removed in the next major version. + * Use {@link #sample()} instead + */ + @Deprecated + public void bar(String bar) { + for (int i = 0; i < 3; i++) { + System.out.println("this is a test " + bar); + } + } +} diff --git a/hermetic_build/library_generation/tests/resources/test-owlbot/testdata/src/foo/FooGrpc.java b/hermetic_build/library_generation/tests/resources/test-owlbot/testdata/src/foo/FooGrpc.java new file mode 100644 index 0000000000..be6abc0d64 --- /dev/null +++ b/hermetic_build/library_generation/tests/resources/test-owlbot/testdata/src/foo/FooGrpc.java @@ -0,0 +1,7 @@ +package foo; + +// This class is intentionally missing a license header + +class FooGrpc { + +} diff --git a/hermetic_build/library_generation/tests/resources/test-owlbot/testdata/src/foo/FooProto.java b/hermetic_build/library_generation/tests/resources/test-owlbot/testdata/src/foo/FooProto.java new file mode 100644 index 0000000000..c3aee1cffe --- /dev/null +++ b/hermetic_build/library_generation/tests/resources/test-owlbot/testdata/src/foo/FooProto.java @@ -0,0 +1,10 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: foo/foo_proto.proto + +package foo; + +// This class is intentionally missing a license header + +class FooProto { + +} \ No newline at end of file diff --git a/hermetic_build/library_generation/tests/resources/test_monorepo_postprocessing/gapic-libraries-bom/pom-golden.xml b/hermetic_build/library_generation/tests/resources/test_monorepo_postprocessing/gapic-libraries-bom/pom-golden.xml new file mode 100644 index 0000000000..304ee9b892 --- /dev/null +++ b/hermetic_build/library_generation/tests/resources/test_monorepo_postprocessing/gapic-libraries-bom/pom-golden.xml @@ -0,0 +1,45 @@ + + + 4.0.0 + com.google.cloud + gapic-libraries-bom + pom + 1.29.0-SNAPSHOT + Google Cloud Java BOM + + BOM for the libraries in google-cloud-java repository. Users should not + depend on this artifact explicitly because this BOM is an implementation + detail of the Libraries BOM. + + + + google-cloud-pom-parent + com.google.cloud + 1.29.0-SNAPSHOT + ../google-cloud-pom-parent/pom.xml + + + + + + com.google.cloud + google-cloud-dns + 2.33.0-SNAPSHOT + + + com.google.cloud + google-cloud-service-control-bom + 1.35.0-SNAPSHOT + pom + import + + + com.google.cloud + google-cloud-tasks-bom + 2.35.0-SNAPSHOT + pom + import + + + + \ No newline at end of file diff --git a/hermetic_build/library_generation/tests/resources/test_monorepo_postprocessing/java-dns/pom.xml b/hermetic_build/library_generation/tests/resources/test_monorepo_postprocessing/java-dns/pom.xml new file mode 100644 index 0000000000..28bdaad76b --- /dev/null +++ b/hermetic_build/library_generation/tests/resources/test_monorepo_postprocessing/java-dns/pom.xml @@ -0,0 +1,9 @@ + + + 4.0.0 + com.google.cloud + google-cloud-dns + jar + 2.33.0-SNAPSHOT + Google Cloud DNS Parent + diff --git a/hermetic_build/library_generation/tests/resources/test_monorepo_postprocessing/java-service-control/google-cloud-service-control-bom/pom.xml b/hermetic_build/library_generation/tests/resources/test_monorepo_postprocessing/java-service-control/google-cloud-service-control-bom/pom.xml new file mode 100644 index 0000000000..483838475d --- /dev/null +++ b/hermetic_build/library_generation/tests/resources/test_monorepo_postprocessing/java-service-control/google-cloud-service-control-bom/pom.xml @@ -0,0 +1,8 @@ + + + 4.0.0 + com.google.cloud + google-cloud-service-control-bom + 1.35.0-SNAPSHOT + pom + diff --git a/hermetic_build/library_generation/tests/resources/test_monorepo_postprocessing/java-tasks/google-cloud-tasks-bom/pom.xml b/hermetic_build/library_generation/tests/resources/test_monorepo_postprocessing/java-tasks/google-cloud-tasks-bom/pom.xml new file mode 100644 index 0000000000..3138a26ce7 --- /dev/null +++ b/hermetic_build/library_generation/tests/resources/test_monorepo_postprocessing/java-tasks/google-cloud-tasks-bom/pom.xml @@ -0,0 +1,8 @@ + + + 4.0.0 + com.google.cloud + google-cloud-tasks-bom + 2.35.0-SNAPSHOT + pom + diff --git a/hermetic_build/library_generation/tests/resources/test_monorepo_postprocessing/pom-golden.xml b/hermetic_build/library_generation/tests/resources/test_monorepo_postprocessing/pom-golden.xml new file mode 100644 index 0000000000..d7c0a1f6a1 --- /dev/null +++ b/hermetic_build/library_generation/tests/resources/test_monorepo_postprocessing/pom-golden.xml @@ -0,0 +1,88 @@ + + + 4.0.0 + google-cloud-java + com.google.cloud + 0.201.0 + pom + + + true + + + + gapic-libraries-bom + google-cloud-jar-parent + google-cloud-pom-parent + java-dns + java-service-control + java-tasks + + + + + + + org.apache.maven.plugins + maven-deploy-plugin + 3.1.3 + + true + + + + + + + + release-staging-repository + + + + !gpg.executable + + + + + sonatype-nexus-snapshots + https://google.oss.sonatype.org/content/repositories/snapshots + + + sonatype-nexus-staging + https://google.oss.sonatype.org/service/local/staging/deploy/maven2/ + + + + + + + org.sonatype.plugins + nexus-staging-maven-plugin + 1.7.0 + true + + sonatype-nexus-staging + https://google.oss.sonatype.org/ + false + + + + + + + release-non-google-oss-sonatype + + + + org.sonatype.plugins + nexus-staging-maven-plugin + + ossrh + https://oss.sonatype.org/ + + + + + + + \ No newline at end of file diff --git a/hermetic_build/library_generation/tests/resources/test_monorepo_postprocessing/versions.txt b/hermetic_build/library_generation/tests/resources/test_monorepo_postprocessing/versions.txt new file mode 100644 index 0000000000..6a537f4a39 --- /dev/null +++ b/hermetic_build/library_generation/tests/resources/test_monorepo_postprocessing/versions.txt @@ -0,0 +1,4 @@ +# Format: +# module:released-version:current-version + +google-cloud-java:1.28.0:1.29.0-SNAPSHOT diff --git a/hermetic_build/library_generation/tests/resources/test_mv_src/gapic/destination/java_gapic_srcjar/src/main/java/example_main.txt b/hermetic_build/library_generation/tests/resources/test_mv_src/gapic/destination/java_gapic_srcjar/src/main/java/example_main.txt new file mode 100644 index 0000000000..e69de29bb2 diff --git a/hermetic_build/library_generation/tests/resources/test_mv_src/gapic/destination/java_gapic_srcjar/src/test/java/example_test.txt b/hermetic_build/library_generation/tests/resources/test_mv_src/gapic/destination/java_gapic_srcjar/src/test/java/example_test.txt new file mode 100644 index 0000000000..e69de29bb2 diff --git a/hermetic_build/library_generation/tests/resources/test_mv_src/proto/destination/java_gapic_srcjar/proto/src/main/java/example_proto_main.txt b/hermetic_build/library_generation/tests/resources/test_mv_src/proto/destination/java_gapic_srcjar/proto/src/main/java/example_proto_main.txt new file mode 100644 index 0000000000..e69de29bb2 diff --git a/hermetic_build/library_generation/tests/resources/test_mv_src/samples/destination_com/java_gapic_srcjar/samples/snippets/generated/src/main/java/com/example_com_sample.txt b/hermetic_build/library_generation/tests/resources/test_mv_src/samples/destination_com/java_gapic_srcjar/samples/snippets/generated/src/main/java/com/example_com_sample.txt new file mode 100644 index 0000000000..e69de29bb2 diff --git a/hermetic_build/library_generation/tests/resources/test_mv_src/samples/destination_io/java_gapic_srcjar/samples/snippets/generated/src/main/java/io/example_io_sample.txt b/hermetic_build/library_generation/tests/resources/test_mv_src/samples/destination_io/java_gapic_srcjar/samples/snippets/generated/src/main/java/io/example_io_sample.txt new file mode 100644 index 0000000000..e69de29bb2 diff --git a/hermetic_build/library_generation/tests/test_utilities.sh b/hermetic_build/library_generation/tests/test_utilities.sh new file mode 100755 index 0000000000..bbcdee1ebc --- /dev/null +++ b/hermetic_build/library_generation/tests/test_utilities.sh @@ -0,0 +1,129 @@ +#!/usr/bin/env bash + +set -xeo pipefail +test_utilities_script_dir=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) + +# Utility functions commonly used in test cases. + +# Variables used to generate final result +total_num=0 +succeed_num=0 +failed_num=0 +failed_tests="" + +############# Helper functions, they shouldn't be called outside this file ############# +__test_executed() { + total_num=$((1 + total_num)) +} + +__test_succeed() { + succeed_num=$((1 + succeed_num)) +} + +__test_failed() { + failed_test=$1 + failed_num=$((1 + failed_num)) + failed_tests="${failed_tests} ${failed_test}" +} + + +############# Functions used in test execution. They can only be called once per test ############# + +assertEquals() { + local expected=$1 + local actual=$2 + if [[ "${expected}" == "${actual}" ]]; then + __test_succeed + return + fi + + echo "Error: expected ${expected}, got ${actual} instead." + __test_failed "${ut}" +} + +assertFileOrDirectoryExists() { + local expected_file=$1 + if [ -d "${expected_file}" ]|| [ -f "${expected_file}" ]; then + __test_succeed + return + fi + + echo "Error: ${expected_file} does not exist." + __test_failed "${ut}" +} + +# Clean up generated files, tooling when testing `generate_library.sh`. +cleanup() { + local library_directory=$1 + rm -rf ../"${library_directory}" \ + google/protobuf \ + protobuf-* \ + gapic-generator-java-*.jar \ + gapic-generator-java-pom-parent-*.pom \ + protoc-gen-grpc-*.exe +} + +execute_tests() { + local test_list=("$@") + for ut in "${test_list[@]}"; do + echo "========== Execute ${ut} ==========" + __test_executed + "${ut}" + done + + echo "Test result: ${total_num} tests executed, ${succeed_num} succeed, ${failed_num} failed." + if [[ "${total_num}" == "${succeed_num}" ]]; then + echo "All tests passed." + exit + fi + + echo "Test failed." + echo "Failed test(s): ${failed_tests}." + exit 1 +} + +############# Utility functions used in `generate_library_integration_tests.sh` ############# + +# Obtains a version from a bazel WORKSPACE file +# +# versions look like "_ggj_version="1.2.3" +# It will return 1.2.3 for such example + +# performs a deep structural comparison between the current pom in a git +# folder and the one at HEAD. +# This function is OS-dependent, so it sources the main utilities script to +# perform detection +compare_poms() { + target_dir=$1 + source "${test_utilities_script_dir}/../utilities.sh" + os_architecture=$(detect_os_architecture) + pushd "${target_dir}" &> /dev/null + find . -name 'pom.xml' -exec cp {} {}.new \; + find . -name 'pom.xml' -exec git checkout HEAD -- {} \; + # compare_poms.py exits with non-zero if diffs are found + set -e + result=0 + if [ "${os_architecture}" == "linux-x86_64" ]; then + find . -name 'pom.xml' -print0 | xargs -i -0 python3 "${test_utilities_script_dir}/compare_poms.py" {} {}.new false || result=$? + else + find . -name 'pom.xml' -print0 | xargs -I{} -0 python3 "${test_utilities_script_dir}/compare_poms.py" {} {}.new false || result=$? + fi + popd &> /dev/null # target_dir + echo ${result} +} + +# computes the `destination_path` variable by inspecting the contents of the +# googleapis-gen at $proto_path. +compute_destination_path() { + local proto_path=$1 + local output_folder=$2 + pushd "${output_folder}" &> /dev/null + local destination_path=$(find "googleapis-gen/${proto_path}" -maxdepth 1 -name 'google-*-java' \ + | rev \ + | cut -d'/' -f1 \ + | rev + ) + popd &> /dev/null # output_folder + echo "${destination_path}" +} + diff --git a/hermetic_build/library_generation/tests/test_utils.py b/hermetic_build/library_generation/tests/test_utils.py new file mode 100644 index 0000000000..890cd95362 --- /dev/null +++ b/hermetic_build/library_generation/tests/test_utils.py @@ -0,0 +1,40 @@ +# 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 +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT 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 unittest +from difflib import unified_diff +from pathlib import Path + +from typing import List + + +class FileComparator(unittest.TestCase): + def compare_files(self, expect: str, actual: str): + with open(expect, "r") as f: + expected_lines = f.readlines() + with open(actual, "r") as f: + actual_lines = f.readlines() + + diff = list(unified_diff(expected_lines, actual_lines)) + self.assertEqual( + first=[], second=diff, msg="Unexpected file contents:\n" + "".join(diff) + ) + + +def cleanup(files: List[str]): + for file in files: + path = Path(file).resolve() + if path.is_file(): + path.unlink() + elif path.is_dir(): + path.rmdir() diff --git a/hermetic_build/library_generation/tests/utilities_unit_tests.py b/hermetic_build/library_generation/tests/utilities_unit_tests.py new file mode 100644 index 0000000000..ed8ac0b6be --- /dev/null +++ b/hermetic_build/library_generation/tests/utilities_unit_tests.py @@ -0,0 +1,401 @@ +#!/usr/bin/env python3 +# 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. +""" +Unit tests for python scripts +""" + +import shutil +import unittest +import os +import io +import contextlib +from pathlib import Path +from library_generation.utils import utilities as util +from common.model.gapic_config import GapicConfig +from common.model.gapic_inputs import GapicInputs +from common.model.generation_config import GenerationConfig +from common.model.library_config import LibraryConfig +from library_generation.tests.test_utils import FileComparator +from library_generation.tests.test_utils import cleanup + +script_dir = os.path.dirname(os.path.realpath(__file__)) +resources_dir = os.path.join(script_dir, "resources") +file_comparator = FileComparator() +library_1 = LibraryConfig( + api_shortname="baremetalsolution", + name_pretty="Bare Metal Solution", + product_documentation="https://cloud.google.com/bare-metal/docs", + api_description="Bring your Oracle workloads to Google Cloud with Bare Metal Solution and jumpstart your cloud journey with minimal risk.", + gapic_configs=list(), + library_name="bare-metal-solution", + rest_documentation="https://cloud.google.com/bare-metal/docs/reference/rest", + rpc_documentation="https://cloud.google.com/bare-metal/docs/reference/rpc", + recommended_package="com.google.example", + min_java_version=8, +) +library_2 = LibraryConfig( + api_shortname="secretmanager", + name_pretty="Secret Management", + product_documentation="https://cloud.google.com/solutions/secrets-management/", + api_description="allows you to encrypt, store, manage, and audit infrastructure and application-level secrets.", + gapic_configs=list(), +) +common_protos = LibraryConfig( + api_shortname="common-protos", + name_pretty="Common Protos", + product_documentation="", + api_description="example description", + gapic_configs=list(), +) +test_library_with_custom_transport = LibraryConfig( + api_shortname="secretmanager", + name_pretty="Secret Management", + product_documentation="https://cloud.google.com/solutions/secrets-management/", + api_description="allows you to encrypt, store, manage, and audit infrastructure and application-level secrets.", + gapic_configs=list(), + transport="rest", +) + + +class UtilitiesTest(unittest.TestCase): + """ + Unit tests for utilities.py + """ + + CONFIGURATION_YAML_PATH = os.path.join( + script_dir, + "resources", + "integration", + "google-cloud-java", + "generation_config.yaml", + ) + + def test_create_argument_valid_container_succeeds(self): + container_value = "google/test/v1" + container = GapicConfig(container_value) + argument_key = "proto_path" + result = util.create_argument(argument_key, container) + self.assertEqual([f"--{argument_key}", container_value], result) + + def test_create_argument_empty_container_returns_empty_list(self): + container = dict() + argument_key = "proto_path" + result = util.create_argument(argument_key, container) + self.assertEqual([], result) + + def test_create_argument_none_container_fails(self): + container = None + argument_key = "proto_path" + result = util.create_argument(argument_key, container) + self.assertEqual([], result) + + def test_sh_util_existent_function_succeeds(self): + result = util.sh_util("extract_folder_name path/to/folder_name") + self.assertEqual("folder_name", result) + + def test_sh_util_nonexistent_function_fails(self): + with self.assertRaises(RuntimeError): + result = util.sh_util("nonexistent_function") + + def test_mv_src_files_gapic_main_succeeds(self): + previous_dir = os.getcwd() + os.chdir(f"{resources_dir}/test_mv_src/gapic") + os.environ["folder_name"] = "example" + util.sh_util("mv_src_files gapic main destination") + self.assertTrue( + os.path.isfile("destination/gapic-example/src/main/java/example_main.txt") + ) + shutil.rmtree("destination/gapic-example") + os.chdir(previous_dir) + + def test_mv_src_files_gapic_test_succeeds(self): + previous_dir = os.getcwd() + os.chdir(f"{resources_dir}/test_mv_src/gapic") + os.environ["folder_name"] = "example" + util.sh_util("mv_src_files gapic test destination") + self.assertTrue( + os.path.isfile("destination/gapic-example/src/test/java/example_test.txt") + ) + shutil.rmtree("destination/gapic-example") + os.chdir(previous_dir) + + def test_mv_src_files_proto_main_succeeds(self): + previous_dir = os.getcwd() + os.chdir(f"{resources_dir}/test_mv_src/proto") + os.environ["folder_name"] = "example" + util.sh_util("mv_src_files proto main destination") + self.assertTrue( + os.path.isfile( + "destination/proto-example/src/main/java/example_proto_main.txt" + ) + ) + shutil.rmtree("destination/proto-example") + os.chdir(previous_dir) + + def test_mv_src_files_sample_suffix_io_succeeds(self): + previous_dir = os.getcwd() + os.chdir(f"{resources_dir}/test_mv_src/samples") + util.sh_util("mv_src_files samples main destination_io") + self.assertTrue( + os.path.isfile( + "destination_io/samples/snippets/generated/io/example_io_sample.txt" + ) + ) + shutil.rmtree("destination_io/samples") + os.chdir(previous_dir) + + def test_mv_src_files_sample_suffix_com_succeeds(self): + previous_dir = os.getcwd() + os.chdir(f"{resources_dir}/test_mv_src/samples") + util.sh_util("mv_src_files samples main destination_com") + self.assertTrue( + os.path.isfile( + "destination_com/samples/snippets/generated/com/example_com_sample.txt" + ) + ) + shutil.rmtree("destination_com/samples") + os.chdir(previous_dir) + + def test_eprint_valid_input_succeeds(self): + test_input = "This is some test input" + # create a stdio capture object + stderr_capture = io.StringIO() + # run eprint() with the capture object + with contextlib.redirect_stderr(stderr_capture): + util.eprint(test_input) + result = stderr_capture.getvalue() + # print() appends a `\n` each time it's called + self.assertEqual(test_input + "\n", result) + + def test_get_library_repository_with_common_protos_returns_sdk_platform_java(self): + config = self.__get_a_gen_config(3) + library = common_protos + result = util.get_library_repository(config, library) + self.assertEqual("googleapis/sdk-platform-java", result) + + def test_get_library_repository_with_monorepo_returns_google_cloud_java(self): + config = self.__get_a_gen_config(2) + library = library_1 + result = util.get_library_repository(config, library) + self.assertEqual("googleapis/google-cloud-java", result) + + def test_get_library_repository_with_split_repo_returns_library_repo(self): + config = self.__get_a_gen_config(1) + library = library_1 + result = util.get_library_repository(config, library) + self.assertEqual("googleapis/java-bare-metal-solution", result) + + def test_generate_postprocessing_prerequisite_files_non_monorepo_success(self): + library_path = self.__setup_postprocessing_prerequisite_files( + combination=1, library_type="GAPIC_COMBO" + ) + + file_comparator.compare_files( + f"{library_path}/.repo-metadata.json", + f"{library_path}/.repo-metadata-non-monorepo-golden.json", + ) + # since this is a single library, we treat this as HW repository, + # meaning that the owlbot yaml will be inside a .github folder + file_comparator.compare_files( + f"{library_path}/.github/.OwlBot-hermetic.yaml", + f"{library_path}/.OwlBot-hermetic-golden.yaml", + ) + file_comparator.compare_files( + f"{library_path}/owlbot.py", f"{library_path}/owlbot-golden.py" + ) + self.__remove_postprocessing_prerequisite_files( + path=library_path, is_monorepo=False + ) + + def test_generate_postprocessing_prerequisite_files_monorepo_success(self): + library_path = self.__setup_postprocessing_prerequisite_files(combination=2) + + file_comparator.compare_files( + f"{library_path}/.repo-metadata.json", + f"{library_path}/.repo-metadata-monorepo-golden.json", + ) + file_comparator.compare_files( + f"{library_path}/.OwlBot-hermetic.yaml", + f"{library_path}/.OwlBot-hermetic-golden.yaml", + ) + file_comparator.compare_files( + f"{library_path}/owlbot.py", f"{library_path}/owlbot-golden.py" + ) + self.__remove_postprocessing_prerequisite_files(path=library_path) + + def test_generate_postprocessing_prerequisite_files_proto_only_repo_success(self): + library_path = self.__setup_postprocessing_prerequisite_files( + combination=3, library_type="OTHER" + ) + + file_comparator.compare_files( + f"{library_path}/.repo-metadata.json", + f"{library_path}/.repo-metadata-proto-only-golden.json", + ) + file_comparator.compare_files( + f"{library_path}/.OwlBot-hermetic.yaml", + f"{library_path}/.OwlBot-hermetic-golden.yaml", + ) + file_comparator.compare_files( + f"{library_path}/owlbot.py", f"{library_path}/owlbot-golden.py" + ) + self.__remove_postprocessing_prerequisite_files(path=library_path) + + def test_generate_postprocessing_prerequisite_files__custom_transport_set_in_config__success( + self, + ): + """ + This test generates files for `test_library_with_custom_transport`, which + has an explicit value for transport declared (http). This is expected to + override the value obtained in BUILD.bazel via gapic_inputs.parse(). For + testing purposes, we test with a default GapicInputs object, whose transport + is set to "grpc". + """ + library_path = self.__setup_postprocessing_prerequisite_files( + combination=2, library=test_library_with_custom_transport + ) + + file_comparator.compare_files( + f"{library_path}/.repo-metadata.json", + f"{library_path}/.repo-metadata-custom-transport-golden.json", + ) + self.__remove_postprocessing_prerequisite_files(path=library_path) + + def test_create__library_invalid_transport__fails( + self, + ): + with self.assertRaises(ValueError): + test_library_with_invalid_transport = LibraryConfig( + api_shortname="secretmanager", + name_pretty="Secret Management", + product_documentation="https://cloud.google.com/solutions/secrets-management/", + api_description="allows you to encrypt, store, manage, and audit infrastructure and application-level secrets.", + gapic_configs=list(), + transport="http", + ) + + def test_prepare_repo_monorepo_success(self): + gen_config = self.__get_a_gen_config(2) + repo_config = util.prepare_repo( + gen_config=gen_config, + library_config=gen_config.libraries, + repo_path=f"{resources_dir}/misc", + ) + self.assertEqual("output", Path(repo_config.output_folder).name) + library_path = sorted([Path(key).name for key in repo_config.libraries]) + self.assertEqual( + ["java-bare-metal-solution", "java-secretmanager"], library_path + ) + + def test_prepare_repo_monorepo_failed(self): + gen_config = self.__get_a_gen_config(2) + self.assertRaises( + FileNotFoundError, + util.prepare_repo, + gen_config, + gen_config.libraries, + f"{resources_dir}/non-exist", + ) + + def test_prepare_repo_split_repo_success(self): + gen_config = self.__get_a_gen_config(1) + repo_config = util.prepare_repo( + gen_config=gen_config, + library_config=gen_config.libraries, + repo_path=f"{resources_dir}/misc", + ) + self.assertEqual("output", Path(repo_config.output_folder).name) + library_path = sorted([Path(key).name for key in repo_config.libraries]) + self.assertEqual(["misc"], library_path) + shutil.rmtree(repo_config.output_folder) + + def __setup_postprocessing_prerequisite_files( + self, + combination: int, + library_type: str = "GAPIC_AUTO", + library: LibraryConfig = library_1, + ) -> str: + library_path = f"{resources_dir}/goldens" + files = [ + f"{library_path}/.repo-metadata.json", + f"{library_path}/.OwlBot-hermetic.yaml", + f"{library_path}/owlbot.py", + ] + cleanup(files) + library.library_type = library_type + config = self.__get_a_gen_config(combination, library_type=library_type) + proto_path = "google/cloud/baremetalsolution/v2" + gapic_inputs = GapicInputs() # defaults to transport=grpc + transport = library.get_transport(gapic_inputs) + util.generate_postprocessing_prerequisite_files( + config=config, + library=library, + proto_path=proto_path, + transport=transport, + library_path=library_path, + ) + return library_path + + @staticmethod + def __get_a_gen_config( + combination: int, library_type: str = "GAPIC_AUTO" + ) -> GenerationConfig: + """ + Returns an object of GenerationConfig with one to three of + LibraryConfig objects. Other attributes are set to empty str. + + :param combination: combination of LibraryConfig objects associated with + the GenerationConfig. Only support 1, 2 or 3. + :return: an object of GenerationConfig + """ + if combination == 1: + libraries = [library_1] + elif combination == 2: + libraries = [library_1, library_2] + else: + libraries = [library_1, common_protos] + + # update libraries with custom configuration (for now, only + # library_type) + for library in libraries: + library.library_type = library_type + if combination == 1: + # treat this as a HW library case to generate a real-life + # repo-metadata + library.extra_versioned_modules = "test-module" + else: + library.extra_versioned_modules = None + + return GenerationConfig( + gapic_generator_version="", + googleapis_commitish="", + libraries=libraries, + ) + + @staticmethod + def __remove_postprocessing_prerequisite_files( + path: str, is_monorepo: bool = True + ) -> None: + os.remove(f"{path}/.repo-metadata.json") + os.remove(f"{path}/owlbot.py") + if is_monorepo: + os.remove(f"{path}/.OwlBot-hermetic.yaml") + return + if os.path.isdir(f"{path}/.github"): + shutil.rmtree(f"{path}/.github", ignore_errors=True) + + +if __name__ == "__main__": + unittest.main() diff --git a/hermetic_build/library_generation/tests/utils/__init__.py b/hermetic_build/library_generation/tests/utils/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/hermetic_build/library_generation/tests/utils/monorepo_postprocessor_unit_tests.py b/hermetic_build/library_generation/tests/utils/monorepo_postprocessor_unit_tests.py new file mode 100644 index 0000000000..b95708c2ff --- /dev/null +++ b/hermetic_build/library_generation/tests/utils/monorepo_postprocessor_unit_tests.py @@ -0,0 +1,46 @@ +# 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 +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT 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 unittest + +from library_generation.tests.test_utils import FileComparator +from library_generation.tests.test_utils import cleanup +from library_generation.utils.monorepo_postprocessor import monorepo_postprocessing + +script_dir = os.path.dirname(os.path.realpath(__file__)) +resources_dir = os.path.join(script_dir, "..", "resources") +file_comparator = FileComparator() + + +class MonorepoPostprocessorTest(unittest.TestCase): + def test_monorepo_postprocessing_valid_repository_success(self): + repository_path = f"{resources_dir}/test_monorepo_postprocessing" + versions_file = f"{repository_path}/versions.txt" + files = [ + f"{repository_path}/pom.xml", + f"{repository_path}/gapic-libraries-bom/pom.xml", + ] + cleanup(files) + monorepo_postprocessing( + repository_path=repository_path, versions_file=versions_file + ) + file_comparator.compare_files( + expect=f"{repository_path}/pom-golden.xml", + actual=f"{repository_path}/pom.xml", + ) + file_comparator.compare_files( + expect=f"{repository_path}/gapic-libraries-bom/pom-golden.xml", + actual=f"{repository_path}/gapic-libraries-bom/pom.xml", + ) + cleanup(files) diff --git a/hermetic_build/library_generation/tests/utils/pom_generator_unit_tests.py b/hermetic_build/library_generation/tests/utils/pom_generator_unit_tests.py new file mode 100644 index 0000000000..7a829e58aa --- /dev/null +++ b/hermetic_build/library_generation/tests/utils/pom_generator_unit_tests.py @@ -0,0 +1,32 @@ +# 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 +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT 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 unittest + +from library_generation.utils.pom_generator import get_version_from + +script_dir = os.path.dirname(os.path.realpath(__file__)) +resources_dir = os.path.join(script_dir, "..", "resources") + + +class PomGeneratorTest(unittest.TestCase): + def test_get_version_from_returns_current(self): + versions_file = f"{resources_dir}/misc/versions.txt" + artifact = "gax-grpc" + self.assertEqual("2.33.1-SNAPSHOT", get_version_from(versions_file, artifact)) + + def test_get_version_from_returns_released(self): + versions_file = f"{resources_dir}/misc/versions.txt" + artifact = "gax-grpc" + self.assertEqual("2.34.0", get_version_from(versions_file, artifact, True)) diff --git a/hermetic_build/library_generation/tests/utils/proto_path_utils_unit_tests.py b/hermetic_build/library_generation/tests/utils/proto_path_utils_unit_tests.py new file mode 100644 index 0000000000..76b663c6cf --- /dev/null +++ b/hermetic_build/library_generation/tests/utils/proto_path_utils_unit_tests.py @@ -0,0 +1,32 @@ +#!/usr/bin/env python3 +# 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. +import os +import unittest +from pathlib import Path +from library_generation.utils.proto_path_utils import remove_version_from + +script_dir = os.path.dirname(os.path.realpath(__file__)) +resources_dir = os.path.join(script_dir, "..", "resources") +test_config_dir = Path(os.path.join(resources_dir, "test-config")).resolve() + + +class ProtoPathsUtilsTest(unittest.TestCase): + def test_remove_version_from_returns_non_versioned_path(self): + proto_path = "google/cloud/aiplatform/v1" + self.assertEqual("google/cloud/aiplatform", remove_version_from(proto_path)) + + def test_remove_version_from_returns_self(self): + proto_path = "google/cloud/aiplatform" + self.assertEqual("google/cloud/aiplatform", remove_version_from(proto_path)) diff --git a/hermetic_build/library_generation/utils/file_render.py b/hermetic_build/library_generation/utils/file_render.py new file mode 100644 index 0000000000..5c68445753 --- /dev/null +++ b/hermetic_build/library_generation/utils/file_render.py @@ -0,0 +1,24 @@ +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT 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 +from jinja2 import Environment, FileSystemLoader + +script_dir = os.path.dirname(os.path.realpath(__file__)) +jinja_env = Environment(loader=FileSystemLoader(f"{script_dir}/../templates")) + + +def render(template_name: str, output_name: str, **kwargs): + template = jinja_env.get_template(template_name) + t = template.stream(kwargs) + directory = os.path.dirname(output_name) + if not os.path.isdir(directory): + os.makedirs(directory) + t.dump(str(output_name)) diff --git a/hermetic_build/library_generation/utils/monorepo_postprocessor.py b/hermetic_build/library_generation/utils/monorepo_postprocessor.py new file mode 100644 index 0000000000..cd522b83b5 --- /dev/null +++ b/hermetic_build/library_generation/utils/monorepo_postprocessor.py @@ -0,0 +1,29 @@ +# 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 +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +from library_generation.utils.pom_generator import generate_gapic_bom +from library_generation.utils.pom_generator import generate_root_pom + + +def monorepo_postprocessing( + repository_path: str, + versions_file: str, +) -> None: + """ + Perform repository level post-processing + :param repository_path: the path of the repository + :param versions_file: the versions_txt contains version of modules + :return: None + """ + generate_root_pom(repository_path=repository_path) + generate_gapic_bom(repository_path=repository_path, versions_file=versions_file) diff --git a/hermetic_build/library_generation/utils/pom_generator.py b/hermetic_build/library_generation/utils/pom_generator.py new file mode 100644 index 0000000000..6894574b82 --- /dev/null +++ b/hermetic_build/library_generation/utils/pom_generator.py @@ -0,0 +1,167 @@ +# 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 +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +from pathlib import Path + +from lxml import etree +from typing import List + +from library_generation.model.bom_config import BomConfig +from library_generation.utils.file_render import render + +project_tag = "{http://maven.apache.org/POM/4.0.0}" +group_id_tag = "groupId" +artifact_tag = "artifactId" +version_tag = "version" + + +def generate_root_pom(repository_path: str) -> None: + print("Regenerating root pom.xml") + modules = __search_for_java_modules(repository_path) + render( + template_name="root-pom.xml.j2", + output_name=f"{repository_path}/pom.xml", + modules=modules, + ) + + +def generate_gapic_bom(repository_path: str, versions_file: str) -> None: + print("Regenerating gapic-libraries-bom") + bom_configs = __search_for_bom_artifact(repository_path) + monorepo_version = get_version_from( + versions_file=versions_file, + artifact_id="google-cloud-java", + ) + render( + template_name="gapic-libraries-bom.xml.j2", + output_name=f"{repository_path}/gapic-libraries-bom/pom.xml", + monorepo_version=monorepo_version, + bom_configs=bom_configs, + ) + + +def get_version_from( + versions_file: str, artifact_id: str, is_released: bool = False +) -> str: + """ + Get version of a given artifact from versions.txt + :param versions_file: the path of version.txt + :param artifact_id: the artifact id + :param is_released: whether returns the released or current version + :return: the version of the artifact + """ + index = 1 if is_released else 2 + with open(versions_file, "r") as f: + for line in f.readlines(): + if artifact_id in line: + return line.split(":")[index].strip() + + +MODULE_ALLOWLIST = set( + [ + "google-auth-library-java", + "sdk-platform-java", + ] +) + + +def __search_for_java_modules( + repository_path: str, +) -> List[str]: + repo = Path(repository_path).resolve() + modules = [] + for sub_dir in repo.iterdir(): + if sub_dir.is_dir() and ( + sub_dir.name.startswith("java-") or sub_dir.name in MODULE_ALLOWLIST + ): + modules.append(sub_dir.name) + return sorted(modules) + + +def __search_for_bom_artifact( + repository_path: str, +) -> List[BomConfig]: + repo = Path(repository_path).resolve() + module_exclusions = ["gapic-libraries-bom"] + group_id_inclusions = [ + "com.google.cloud", + "com.google.analytics", + "com.google.area120", + ] + bom_configs = [] + for module in repo.iterdir(): + if module.is_file() or module.name in module_exclusions: + continue + for sub_module in module.iterdir(): + if sub_module.is_dir() and sub_module.name.endswith("-bom"): + root = etree.parse(f"{sub_module}/pom.xml").getroot() + group_id = root.find(f"{project_tag}{group_id_tag}").text + if group_id not in group_id_inclusions: + continue + artifact_id = root.find(f"{project_tag}{artifact_tag}").text + version = root.find(f"{project_tag}{version_tag}").text + index = artifact_id.rfind("-") + version_annotation = artifact_id[:index] + bom_configs.append( + BomConfig( + group_id=group_id, + artifact_id=artifact_id, + version=version, + version_annotation=version_annotation, + ) + ) + # handle edge case: java-grafeas + bom_configs += __handle_special_bom( + repository_path=repository_path, + module="java-grafeas", + group_id="io.grafeas", + artifact_id="grafeas", + ) + # handle edge case: java-dns + bom_configs += __handle_special_bom( + repository_path=repository_path, + module="java-dns", + group_id="com.google.cloud", + artifact_id="google-cloud-dns", + ) + # handle edge case: java-notification + bom_configs += __handle_special_bom( + repository_path=repository_path, + module="java-notification", + group_id="com.google.cloud", + artifact_id="google-cloud-notification", + ) + + return sorted(bom_configs) + + +def __handle_special_bom( + repository_path: str, + module: str, + group_id: str, + artifact_id: str, +) -> List[BomConfig]: + pom = f"{repository_path}/{module}/pom.xml" + if not Path(pom).exists(): + return [] + root = etree.parse(pom).getroot() + version = root.find(f"{project_tag}{version_tag}").text + return [ + BomConfig( + group_id=group_id, + artifact_id=artifact_id, + version=version, + version_annotation=artifact_id, + is_import=False, + ) + ] diff --git a/hermetic_build/library_generation/utils/proto_path_utils.py b/hermetic_build/library_generation/utils/proto_path_utils.py new file mode 100644 index 0000000000..27e3f8aa38 --- /dev/null +++ b/hermetic_build/library_generation/utils/proto_path_utils.py @@ -0,0 +1,29 @@ +#!/usr/bin/env python3 +# 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. +import re + + +def remove_version_from(proto_path: str) -> str: + """ + Remove the version of a proto_path + :param proto_path: versioned proto_path + :return: the proto_path without version + """ + version_pattern = "^v[1-9]" + index = proto_path.rfind("/") + version = proto_path[index + 1 :] + if re.match(version_pattern, version): + return proto_path[:index] + return proto_path diff --git a/hermetic_build/library_generation/utils/utilities.py b/hermetic_build/library_generation/utils/utilities.py new file mode 100755 index 0000000000..d1d44e21bf --- /dev/null +++ b/hermetic_build/library_generation/utils/utilities.py @@ -0,0 +1,322 @@ +# 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 +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT 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 json +import sys +import subprocess +import os +from pathlib import Path +from typing import Any + +from common.model.generation_config import GenerationConfig +from common.model.library_config import LibraryConfig +from typing import List +from library_generation.model.repo_config import RepoConfig +from library_generation.utils.file_render import render +from library_generation.utils.proto_path_utils import remove_version_from + +script_dir = os.path.dirname(os.path.realpath(__file__)) +SDK_PLATFORM_JAVA = "googleapis/sdk-platform-java" + + +def create_argument(arg_key: str, arg_container: object) -> List[str]: + """ + Generates a list of two elements [argument, value], or returns + an empty array if arg_val is None + """ + arg_val = getattr(arg_container, arg_key, None) + if arg_val is not None: + return [f"--{arg_key}", f"{arg_val}"] + return [] + + +def run_process_and_print_output( + arguments: List[str] | str, job_name: str = "Job", exit_on_fail=True, **kwargs +) -> Any: + """ + Runs a process with the given "arguments" list and prints its output. + If the process fails, then the whole program exits + :param arguments: list of strings or string containing the arguments + :param job_name: optional job name to be printed + :param exit_on_fail: True if the main program should exit when the + subprocess exits with non-zero. Used for testing. + :param kwargs: passed to the underlying subprocess.run() call + """ + # split "arguments" if passed as a single string + if isinstance(arguments, str): + arguments = arguments.split(" ") + if "stderr" not in kwargs: + kwargs["stderr"] = subprocess.STDOUT + proc_info = subprocess.run(arguments, stdout=subprocess.PIPE, **kwargs) + print(proc_info.stdout.decode(), end="", flush=True) + print( + f"{job_name} {'finished successfully' if proc_info.returncode == 0 else 'failed'}" + ) + if exit_on_fail and proc_info.returncode != 0: + sys.exit(1) + return proc_info + + +def run_process_and_get_output_string( + arguments: List[str] | str, job_name: str = "Job", exit_on_fail=True, **kwargs +) -> Any: + """ + Wrapper of run_process_and_print_output() that returns the merged + stdout and stderr in a single string without its trailing newline char. + """ + return run_process_and_print_output( + arguments, job_name, exit_on_fail, stderr=subprocess.PIPE, **kwargs + ).stdout.decode()[:-1] + + +def sh_util(statement: str, **kwargs) -> str: + """ + Calls a function defined in library_generation/utils/utilities.sh + """ + if "stdout" not in kwargs: + kwargs["stdout"] = subprocess.PIPE + if "stderr" not in kwargs: + kwargs["stderr"] = subprocess.PIPE + output = "" + with subprocess.Popen( + [ + "bash", + "-exc", + f"source {script_dir}/utilities.sh && {statement}", + ], + **kwargs, + ) as proc: + print("command stderr:") + for line in proc.stderr: + print(line.decode(), end="", flush=True) + print("command stdout:") + for line in proc.stdout: + print(line.decode(), end="", flush=True) + output += line.decode() + proc.wait() + if proc.returncode != 0: + raise RuntimeError( + f"function {statement} failed with exit code {proc.returncode}" + ) + # captured stdout may contain a newline at the end, we remove it + if len(output) > 0 and output[-1] == "\n": + output = output[:-1] + return output + + +def eprint(*args, **kwargs): + """ + prints to stderr + """ + print(*args, file=sys.stderr, **kwargs) + + +def prepare_repo( + gen_config: GenerationConfig, + library_config: List[LibraryConfig], + repo_path: str, + language: str = "java", +) -> RepoConfig: + """ + Gather information of the generated repository. + + :param gen_config: a GenerationConfig object representing a parsed + configuration yaml + :param library_config: a LibraryConfig object contained inside config, + passed here for convenience and to prevent all libraries to be processed + :param repo_path: the path to which the generated repository goes + :param language: programming language of the library + :return: a RepoConfig object contained repository information + :raise FileNotFoundError if there's no versions.txt in repo_path + :raise ValueError if two libraries have the same library_name + """ + output_folder = sh_util("get_output_folder") + print(f"output_folder: {output_folder}") + os.makedirs(output_folder, exist_ok=True) + libraries = {} + for library in library_config: + library_name = f"{language}-{library.get_library_name()}" + library_path = ( + f"{repo_path}/{library_name}" + if gen_config.is_monorepo() + else f"{repo_path}" + ) + # use absolute path because docker requires absolute path + # in volume name. + absolute_library_path = str(Path(library_path).resolve()) + libraries[absolute_library_path] = library + # remove existing .repo-metadata.json + json_name = ".repo-metadata.json" + if os.path.exists(f"{absolute_library_path}/{json_name}"): + os.remove(f"{absolute_library_path}/{json_name}") + versions_file = Path(repo_path) / "versions.txt" + if not versions_file.exists(): + versions_file.touch() + print(f"Created empty versions file: {versions_file}") + return RepoConfig( + output_folder=output_folder, + libraries=libraries, + versions_file=str(versions_file), + ) + + +def get_library_repository( + config: GenerationConfig, library: LibraryConfig, language: str = "java" +): + """ + Obtains the repository identifier (e.g. googleapis/java-bigtable) depending on + whether it's a monorepo (google-cloud-java or sdk-platform-java if has common-protos) or not. + + :return: string representing the repository + """ + if config.contains_common_protos(): + repo = SDK_PLATFORM_JAVA + elif config.is_monorepo(): + repo = "googleapis/google-cloud-java" + else: + repo = f"googleapis/{language}-{library.get_library_name()}" + return repo + + +def generate_postprocessing_prerequisite_files( + config: GenerationConfig, + library: LibraryConfig, + proto_path: str, + transport: str, + library_path: str, + language: str = "java", +) -> None: + """ + Generates the postprocessing prerequisite files for a library. + + :param config: a GenerationConfig object representing a parsed configuration + yaml + :param library: the library configuration + :param proto_path: the path from the root of googleapis to the location of the service + protos. If the path contains a version, it will be removed + :param transport: transport supported by the library + :param library_path: the path to which the generated file goes + :param language: programming language of the library + :return: None + """ + repo = get_library_repository(config, library) + library_name = library.get_library_name() + artifact_id = library.get_artifact_id() + api_id = ( + library.api_id if library.api_id else f"{library.api_shortname}.googleapis.com" + ) + client_documentation = ( + library.client_documentation + if library.client_documentation + else f"https://cloud.google.com/{language}/docs/reference/{artifact_id}/latest/overview" + ) + + # The mapping is needed because transport in .repo-metadata.json + # is one of grpc, http and both, + if transport == "grpc": + converted_transport = "grpc" + elif transport == "rest": + converted_transport = "http" + else: + converted_transport = "both" + + repo_metadata = { + "api_shortname": library.api_shortname, + "name_pretty": library.name_pretty, + "product_documentation": library.product_documentation, + "api_description": library.api_description, + "client_documentation": client_documentation, + "release_level": library.release_level, + "transport": converted_transport, + "language": language, + "repo": repo, + "repo_short": f"{language}-{library_name}", + "distribution_name": library.get_maven_coordinate(), + "api_id": api_id, + "library_type": library.library_type, + "requires_billing": library.requires_billing, + } + + # this removal is for java-common-protos and java-iam in + # sdk-platform-java + if repo == SDK_PLATFORM_JAVA: + repo_metadata.pop("api_id") + + if library.api_reference: + repo_metadata["api_reference"] = library.api_reference + if library.codeowner_team: + repo_metadata["codeowner_team"] = library.codeowner_team + if library.excluded_dependencies: + repo_metadata["excluded_dependencies"] = library.excluded_dependencies + if library.excluded_poms: + repo_metadata["excluded_poms"] = library.excluded_poms + if library.issue_tracker: + repo_metadata["issue_tracker"] = library.issue_tracker + if library.rest_documentation: + repo_metadata["rest_documentation"] = library.rest_documentation + if library.rpc_documentation: + repo_metadata["rpc_documentation"] = library.rpc_documentation + if library.extra_versioned_modules: + repo_metadata["extra_versioned_modules"] = library.extra_versioned_modules + if library.recommended_package: + repo_metadata["recommended_package"] = library.recommended_package + if library.min_java_version: + repo_metadata["min_java_version"] = library.min_java_version + + # generate .repo-meta.json + json_file = ".repo-metadata.json" + # .repo-metadata.json is removed before generating the first version of + # a library. This check ensures no duplicated generation. + if not os.path.exists(f"{library_path}/{json_file}"): + with open(f"{library_path}/{json_file}", "w") as fp: + json.dump(repo_metadata, fp, indent=2) + + # generate .OwlBot-hermetic.yaml + owlbot_yaml_file = ".OwlBot-hermetic.yaml" + path_to_owlbot_yaml_file = ( + f"{library_path}/{owlbot_yaml_file}" + if config.is_monorepo() + else f"{library_path}/.github/{owlbot_yaml_file}" + ) + if not os.path.exists(path_to_owlbot_yaml_file): + render( + template_name="owlbot.yaml.monorepo.j2", + output_name=path_to_owlbot_yaml_file, + artifact_id=artifact_id, + proto_path=remove_version_from(proto_path), + module_name=repo_metadata["repo_short"], + api_shortname=library.api_shortname, + ) + + # generate owlbot.py + py_file = "owlbot.py" + template_excludes = [ + ".github/*", + ".kokoro/*", + "samples/*", + "CODE_OF_CONDUCT.md", + "CONTRIBUTING.md", + "LICENSE", + "SECURITY.md", + "java.header", + "license-checks.xml", + "renovate.json", + ".gitignore", + ] + if not os.path.exists(f"{library_path}/{py_file}"): + render( + template_name="owlbot.py.j2", + output_name=f"{library_path}/{py_file}", + should_include_templates=True, + template_excludes=template_excludes, + ) diff --git a/hermetic_build/library_generation/utils/utilities.sh b/hermetic_build/library_generation/utils/utilities.sh new file mode 100755 index 0000000000..873a0b2de3 --- /dev/null +++ b/hermetic_build/library_generation/utils/utilities.sh @@ -0,0 +1,335 @@ +#!/usr/bin/env bash + +set -eo pipefail +utilities_script_dir=$(dirname "$(realpath "${BASH_SOURCE[0]}")") + +# Utility functions used in `generate_library.sh` and showcase generation. +extract_folder_name() { + local destination_path=$1 + local folder_name=${destination_path##*/} + echo "${folder_name}" +} + +remove_empty_files() { + local category=$1 + local destination_path=$2 + local file_num + find "${destination_path}/${category}-${folder_name}/src/main/java" -type f -size 0 | while read -r f; do rm -f "${f}"; done + # remove the directory if the directory has no files. + file_num=$(find "${destination_path}/${category}-${folder_name}" -type f | wc -l | sed 's/^[[:space:]]*//;s/[[:space:]]*$//') + if [[ "${file_num}" == 0 ]]; then + rm -rf "${destination_path}/${category}-${folder_name}" + fi + + if [ -d "${destination_path}/${category}-${folder_name}/src/main/java/samples" ]; then + mv "${destination_path}/${category}-${folder_name}/src/main/java/samples" "${destination_path}/${category}-${folder_name}" + fi +} + +# Move generated files to folders in destination_path. +mv_src_files() { + local category=$1 # one of gapic, proto, samples + local type=$2 # one of main, test + local destination_path=$3 + if [ "${category}" == "samples" ]; then + src_suffix="samples/snippets/generated/src/main/java" + folder_suffix="samples/snippets/generated" + mkdir -p "${destination_path}/${folder_suffix}" + cp -r "${destination_path}/java_gapic_srcjar/${src_suffix}"/* "${destination_path}/${folder_suffix}" + elif [ "${category}" == "proto" ]; then + src_suffix="${category}/src/${type}/java" + folder_suffix="${category}-${folder_name}/src/${type}" + else + src_suffix="src/${type}" + folder_suffix="${category}-${folder_name}/src" + fi + + if [ "${category}" == "samples" ]; then + return + fi + + mkdir -p "${destination_path}/${folder_suffix}" + cp -r "${destination_path}/java_gapic_srcjar/${src_suffix}" "${destination_path}/${folder_suffix}" + rm -r -f "${destination_path}/${folder_suffix}/java/META-INF" +} + +# unzip jar file +unzip_src_files() { + local category=$1 + local destination_path=$2 + local jar_file=java_${category}.jar + mkdir -p "${destination_path}/${category}-${folder_name}/src/main/java" + unzip -q -o "${destination_path}/${jar_file}" -d "${destination_path}/${category}-${folder_name}/src/main/java" + rm -r -f "${destination_path}/${category}-${folder_name}/src/main/java/META-INF" +} + +# get gapic options from .yaml and .json files from proto_path. +get_gapic_opts() { + local transport=$1 + local rest_numeric_enums=$2 + local gapic_yaml=$3 + local service_config=$4 + local service_yaml=$5 + local repo=$6 + local artifact=$7 + if [ "${rest_numeric_enums}" == "true" ]; then + rest_numeric_enums="rest-numeric-enums" + else + rest_numeric_enums="" + fi + # If any of the gapic options is empty (default value), try to search for + # it in proto_path. + if [[ "${gapic_yaml}" == "" ]]; then + gapic_yaml=$(find "${proto_path}" -type f -name "*gapic.yaml") + fi + + if [[ "${service_config}" == "" ]]; then + service_config=$(find "${proto_path}" -type f -name "*service_config.json") + fi + + if [[ "${service_yaml}" == "" ]]; then + service_yaml=$(find "${proto_path}" -maxdepth 1 -type f \( -name "*.yaml" ! -name "*gapic*.yaml" \)) + fi + echo "transport=${transport},${rest_numeric_enums},grpc-service-config=${service_config},gapic-config=${gapic_yaml},api-service-config=${service_yaml},repo=${repo},artifact=${artifact}" +} + +remove_grpc_version() { + local destination_path=$1 + find "${destination_path}" -type f -name "*Grpc.java" -exec \ + sed -i.bak 's/value = \"by gRPC proto compiler.*/value = \"by gRPC proto compiler\",/g' {} \; -exec rm {}.bak \; +} + +download_protoc() { + local protoc_version=$1 + local os_architecture=$2 + + download_from \ + "https://github.com/protocolbuffers/protobuf/releases/download/v${protoc_version}/protoc-${protoc_version}-${os_architecture}.zip" \ + "protoc-${protoc_version}.zip" \ + "GitHub" + unzip -o -q "protoc-${protoc_version}.zip" + rm "protoc-${protoc_version}.zip" "readme.txt" +} + +download_grpc_plugin() { + local grpc_version=$1 + local os_architecture=$2 + grpc_filename="protoc-gen-grpc-java.exe" + # download protoc-gen-grpc-java plugin from Google maven central mirror. + download_from \ + "https://maven-central.storage-download.googleapis.com/maven2/io/grpc/protoc-gen-grpc-java/${grpc_version}/protoc-gen-grpc-java-${grpc_version}-${os_architecture}.exe" \ + "${grpc_filename}" + chmod +x "${grpc_filename}" +} + +download_from() { + local url=$1 + local save_as=$2 + local repo=$3 + # fail-fast, 30 seconds at most, retry 2 times + curl -LJ -o "${save_as}" --fail -m 30 --retry 2 "$url" || download_fail "${save_as}" "${repo}" +} + +# copies the specified file in $1 to $2 +# will return "true" if the copy was successful +copy_from() { + local local_repo=$1 + local save_as=$2 + copy_successful=$(cp "${local_repo}" "${save_as}" && echo "true" || echo "false") + echo "${copy_successful}" +} + +download_fail() { + local artifact=$1 + local repo=${2:-"maven central mirror"} + >&2 echo "Fail to download ${artifact} from ${repo} repository. Please install ${artifact} first if you want to use a non-published artifact." + exit 1 +} + +# gets the output folder where all sources and dependencies will be located. +get_output_folder() { + if [[ $(basename $(pwd)) != "output" ]]; then + echo "$(pwd)/output" + else + echo $(pwd) + fi +} + +detect_os_architecture() { + local os_type + local os_architecture + os_type=$(uname -sm) + case "${os_type}" in + *"Linux x86_64"*) + os_architecture="linux-x86_64" + ;; + *"Darwin x86_64"*) + os_architecture="osx-x86_64" + ;; + *) + os_architecture="osx-aarch_64" + ;; + esac + echo "${os_architecture}" +} + + +# copies $1 as a folder as $2 only if $1 exists +copy_directory_if_exists() { + local base_folder=$1 + local folder_prefix=$2 + local destination_folder=$3 + if [ ! -d "${base_folder}" ]; then + return + fi + pushd "${base_folder}" + if [[ $(find . -maxdepth 1 -type d -name "${folder_prefix}*" | wc -l ) -gt 0 ]]; then + cp -r ${base_folder}/${folder_prefix}* "${destination_folder}" + fi + popd # base_folder +} + +# computes proto_path from a given folder of GAPIC sources +# It will inspect the proto library to compute the path +get_proto_path_from_preprocessed_sources() { + set -e + local sources=$1 + pushd "${sources}" > /dev/null + local proto_library + proto_library=$(find . -maxdepth 1 -type d -name 'proto-*' | sed 's/\.\///') + local found_libraries + found_libraries=$(echo "${proto_library}" | wc -l) + if [[ -z ${proto_library} ]]; then + echo "no proto libraries found in the supplied sources path" + exit 1 + elif [ ${found_libraries} -gt 1 ]; then + echo "more than one proto library found in the supplied sources path" + echo "cannot decide for a service version" + exit 1 + fi + pushd "$(pwd)/${proto_library}/src/main/proto" > /dev/null + local result=$(find . -type f -name '*.proto' | head -n 1 | xargs dirname | sed 's/\.\///') + popd > /dev/null # proto_library + popd > /dev/null # sources + echo "${result}" +} + +# for a pre-processed library stored in $preprocessed_sources_path, a folder +# tree is built on $target_folder so it looks like a googleapis-gen folder and +# is therefore consumable by OwlBot CLI +build_owlbot_cli_source_folder() { + local postprocessing_target=$1 + local target_folder=$2 + local preprocessed_sources_path=$3 + local proto_path=$4 + if [[ -z "${proto_path}" ]]; then + proto_path=$(get_proto_path_from_preprocessed_sources "${preprocessed_sources_path}") + fi + owlbot_staging_folder="${postprocessing_target}/owl-bot-staging" + mkdir -p "${owlbot_staging_folder}" + + # By default (thanks to generation templates), .OwlBot-hermetic.yaml `deep-copy` section + # references a wildcard pattern matching a folder + # ending with `-java` at the leaf of proto_path. We then use a generated-java + # folder that will be picked up by copy-code + mkdir -p "${target_folder}/${proto_path}/generated-java" + copy_directory_if_exists "${preprocessed_sources_path}" "proto" \ + "${target_folder}/${proto_path}/generated-java/proto-google-cloud-library" + copy_directory_if_exists "${preprocessed_sources_path}" "grpc" \ + "${target_folder}/${proto_path}/generated-java/grpc-google-cloud-library" + copy_directory_if_exists "${preprocessed_sources_path}" "gapic" \ + "${target_folder}/${proto_path}/generated-java/gapic-google-cloud-library" + copy_directory_if_exists "${preprocessed_sources_path}" "samples" \ + "${target_folder}/${proto_path}/generated-java/samples" + pushd "${target_folder}" + # create an empty commit so owl-bot-copy can process this as a repo + # (it cannot process non-git-repositories) + git init + git commit --allow-empty -m 'empty commit' + popd # target_folder +} + +# Convenience function to clone only the necessary folders from a git repository +sparse_clone() { + repo_url=$1 + paths=$2 + commitish=$3 + clone_dir=$(basename "${repo_url%.*}") + rm -rf "${clone_dir}" + git clone -n --depth=1 --no-single-branch --filter=tree:0 "${repo_url}" + pushd "${clone_dir}" + if [ -n "${commitish}" ]; then + git checkout "${commitish}" + fi + git sparse-checkout set --no-cone ${paths} + git checkout + popd +} + +# calls a function in utilities.py. THe first argument is the function name, the +# rest of the arguments are the positional arguments to such function +py_util() { + python3 "${utilities_script_dir}/utilities.py" "$@" +} + +get_gapic_generator_location() { + local generator_location + generator_location="${HOME}/.library_generation/gapic-generator-java.jar" + if [[ -n "${GAPIC_GENERATOR_LOCATION}" ]]; then + echo "${GAPIC_GENERATOR_LOCATION}" + elif [[ -f "${generator_location}" ]]; then + echo "${generator_location}" + else + echo "Can't find GAPIC generator in ${generator_location}." + exit 1 + fi +} + +get_protoc_location() { + local protoc_location + protoc_location="${HOME}/.library_generation/bin" + if [[ -n "${DOCKER_PROTOC_LOCATION}" ]]; then + echo "${DOCKER_PROTOC_LOCATION}" + elif [[ -d "${protoc_location}" ]]; then + echo "${protoc_location}" + else + echo "Can't find protoc in ${protoc_location}." + exit 1 + fi +} + +get_grpc_plugin_location() { + local grpc_location + grpc_location="${HOME}/.library_generation/protoc-gen-grpc-java.exe" + if [[ -n "${DOCKER_GRPC_LOCATION}" ]]; then + echo "${DOCKER_GRPC_LOCATION}" + elif [[ -f "${grpc_location}" ]]; then + echo "${grpc_location}" + else + echo "Can't find grpc plugin in ${grpc_location}." + exit 1 + fi +} + +get_java_formatter_location() { + local formatter_location + formatter_location="${HOME}/.library_generation/google-java-format.jar" + if [[ -n "${JAVA_FORMATTER_LOCATION}" ]]; then + echo "${JAVA_FORMATTER_LOCATION}" + elif [[ -f "${formatter_location}" ]]; then + echo "${formatter_location}" + else + echo "Can't find Java formatter in ${formatter_location}." + exit 1 + fi +} + +error_if_not_exists() { + local required_tool=$1 + if [[ ! -f "${required_tool}" ]]; then + >&2 echo "File ${required_tool} not found in the filesystem. " + >&2 echo "Please configure your environment and store the " + >&2 echo "required tools in this location." + exit 1 + fi +} diff --git a/hermetic_build/release_note_generation/__init__.py b/hermetic_build/release_note_generation/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/hermetic_build/release_note_generation/cli/generate_release_note.py b/hermetic_build/release_note_generation/cli/generate_release_note.py new file mode 100644 index 0000000000..2dd35ebf82 --- /dev/null +++ b/hermetic_build/release_note_generation/cli/generate_release_note.py @@ -0,0 +1,99 @@ +# 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 +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT 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 +from typing import Optional +import click as click +from release_note_generation.generate_pr_description import generate_pr_descriptions +from common.model.generation_config import GenerationConfig +from common.utils.generation_config_comparator import compare_config + + +@click.group(invoke_without_command=False) +@click.pass_context +@click.version_option(message="%(version)s") +def main(ctx): + pass + + +@main.command() +@click.option( + "--baseline-generation-config-path", + required=False, + default=None, + type=str, + help=""" + Absolute or relative path to a generation_config.yaml. + This config file is used for commit history generation, not library + generation. + """, +) +@click.option( + "--current-generation-config-path", + required=False, + default=None, + type=str, + help=""" + Absolute or relative path to a generation_config.yaml that contains the + metadata about library generation. + """, +) +@click.option( + "--repository-path", + type=str, + default=".", + show_default=True, + help=""" + The path where the file `pr_description.txt`, which contains the release + notes, will be sent. + If not specified, the file will be generated to the current working + directory. + """, +) +def generate( + baseline_generation_config_path: Optional[str], + current_generation_config_path: Optional[str], + repository_path: str, +) -> None: + if ( + baseline_generation_config_path is None + or current_generation_config_path is None + ): + print( + "One of the generation configs is not specified, do not generate " + "the description." + ) + return + baseline_generation_config_path = os.path.abspath(baseline_generation_config_path) + current_generation_config_path = os.path.abspath(current_generation_config_path) + if not ( + os.path.isfile(baseline_generation_config_path) + and os.path.isfile(current_generation_config_path) + ): + print( + "One of the generation configs does not exist, do not generate " + "the description." + ) + return + config_change = compare_config( + baseline_config=GenerationConfig.from_yaml(baseline_generation_config_path), + current_config=GenerationConfig.from_yaml(current_generation_config_path), + ) + generate_pr_descriptions( + config_change=config_change, + description_path=os.path.abspath(repository_path), + ) + + +if __name__ == "__main__": + main() diff --git a/hermetic_build/release_note_generation/commit_message_formatter.py b/hermetic_build/release_note_generation/commit_message_formatter.py new file mode 100644 index 0000000000..c86c1df192 --- /dev/null +++ b/hermetic_build/release_note_generation/commit_message_formatter.py @@ -0,0 +1,127 @@ +# 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 +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT 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 re +from git import Commit + +from common.model.config_change import ConfigChange, ChangeType +from common.model.generation_config import ( + GAPIC_GENERATOR_VERSION, + LIBRARIES_BOM_VERSION, +) + +PARAM_TO_COMMIT_MESSAGE = { + GAPIC_GENERATOR_VERSION: "fix(deps): update the Java code generator (gapic-generator-java) to", + LIBRARIES_BOM_VERSION: "chore: update the libraries_bom version to", +} + + +def format_commit_message(commits: dict[Commit, str], is_monorepo: bool) -> list[str]: + """ + Format commit messages. Add library_name to conventional commit messages if + is_monorepo is True; otherwise no op. + + :param commits: a mapping from commit to library_name. + :param is_monorepo: whether it's monorepo or not. + :return: formatted commit messages. + """ + all_commits = [] + # please see go/java-client-releasing#conventional-commit-messages + # for conventional commit. + type_regex = re.compile(r"(feat|fix|docs|deps|test|samples|chore)!?:.*") + for commit, library_name in commits.items(): + # a commit message may contain multiple lines, we need to + # add library_name for each line. + messages = [] + for message_line in commit.message.split("\n"): + # add library name to a conventional commit message; + # otherwise no op. + if type_regex.search(message_line): + commit_type, _, summary = message_line.partition(":") + formatted_message = ( + f"{commit_type}: [{library_name}]{str(summary).rstrip()}" + if is_monorepo + else f"{commit_type}:{str(summary).rstrip()}" + ) + messages.append(formatted_message) + else: + messages.append(message_line) + all_commits.extend(wrap_googleapis_commit(commit, messages)) + return all_commits + + +def format_repo_level_change(config_change: ConfigChange) -> list[str]: + """ + Format commit messages regarding repo-level changes. + + :param config_change: + :return: commit messages regarding repo-level changes. + """ + messages = [] + for repo_level_change in config_change.change_to_libraries.get( + ChangeType.REPO_LEVEL_CHANGE, [] + ): + message = f"chore: update repo-level parameter {repo_level_change.changed_param} to {repo_level_change.current_value}" + if repo_level_change.changed_param in PARAM_TO_COMMIT_MESSAGE: + message = f"{PARAM_TO_COMMIT_MESSAGE.get(repo_level_change.changed_param)} {repo_level_change.current_value}" + messages.extend(__wrap_nested_commit([message])) + return messages + + +def wrap_googleapis_commit(commit: Commit, messages: list[str]) -> list[str]: + """ + Wrap message between `BEGIN_NESTED_COMMIT` and `BEGIN_NESTED_COMMIT`. + + :param commit: a GitHub commit. + :param messages: a (multi-line) commit message, one line per item. + :return: wrapped messages. + """ + messages.append(f"Source Link: {commit_link(commit)}") + return __wrap_nested_commit(messages) + + +def wrap_override_commit(messages: list[str]) -> list[str]: + """ + Wrap message between `BEGIN_COMMIT_OVERRIDE` and `END_COMMIT_OVERRIDE`. + + :param messages: a (multi-line) commit message, one line per item. + :return: wrapped messages. + """ + result = ["BEGIN_COMMIT_OVERRIDE"] + result.extend(messages) + result.append("END_COMMIT_OVERRIDE") + return result + + +def commit_link(commit: Commit) -> str: + """ + Create a link to the commit in Markdown format. + + :param commit: a GitHub commit. + :return: a link in Markdown format. + """ + short_sha = commit.hexsha[:7] + return f"[googleapis/googleapis@{short_sha}](https://github.com/googleapis/googleapis/commit/{commit.hexsha})" + + +def __wrap_nested_commit(messages: list[str]) -> list[str]: + """ + Wrap message between `BEGIN_NESTED_COMMIT` and `BEGIN_NESTED_COMMIT`. + + :param messages: a (multi-line) commit message, one line per item. + :return: wrapped messages. + """ + result = ["BEGIN_NESTED_COMMIT"] + result.extend(messages) + result.append("END_NESTED_COMMIT") + return result diff --git a/hermetic_build/release_note_generation/generate_pr_description.py b/hermetic_build/release_note_generation/generate_pr_description.py new file mode 100755 index 0000000000..f47985ad82 --- /dev/null +++ b/hermetic_build/release_note_generation/generate_pr_description.py @@ -0,0 +1,192 @@ +#!/usr/bin/env python3 +# 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. +import calendar +import os +import shutil +from typing import Dict +from git import Commit, Repo + +from common.model.config_change import ConfigChange +from common.utils.proto_path_utils import find_versioned_proto_path +from release_note_generation.commit_message_formatter import ( + format_commit_message, + format_repo_level_change, + commit_link, + wrap_override_commit, +) + +EMPTY_MESSAGE = "" + + +def generate_pr_descriptions( + config_change: ConfigChange, + description_path: str, + repo_url: str = "https://github.com/googleapis/googleapis.git", +) -> None: + """ + Generate pull request description from configuration comparison result. + + The pull request description contains repo-level changes, if applicable, + and googleapis commit from baseline config (exclusive) to current config + (inclusive). + + The pull request description will be generated into + description_path/pr_description.txt. + + No pr_description.txt will be generated if no changes in the configurations. + + :param config_change: a ConfigChange object, containing changes in baseline + and current generation configurations. + :param description_path: the path to which the pull request description + file goes. + :param repo_url: the GitHub repository from which retrieves the commit + history. + """ + repo_level_message = format_repo_level_change(config_change) + paths = config_change.current_config.get_proto_path_to_library_name() + description = get_repo_level_commit_messages( + repo_url=repo_url, + current_commit_sha=config_change.current_config.googleapis_commitish, + baseline_commit_sha=config_change.baseline_config.googleapis_commitish, + paths=paths, + is_monorepo=config_change.current_config.is_monorepo(), + repo_level_message=repo_level_message, + ) + + if description == EMPTY_MESSAGE: + print("Empty commit messages, skip creating pull request description.") + return + + description_file = f"{description_path}/pr_description.txt" + print(f"Writing pull request description to {description_file}") + with open(description_file, "w+") as f: + f.write(description) + + +def get_repo_level_commit_messages( + repo_url: str, + current_commit_sha: str, + baseline_commit_sha: str, + paths: Dict[str, str], + is_monorepo: bool, + repo_level_message: list[str], +) -> str: + """ + Combine commit messages of a repository from latest_commit to + baseline_commit. Only commits which change files in a pre-defined + file paths will be considered. + Note that baseline_commit should be an ancestor of or the same as + latest_commit. + + :param repo_url: the url of the repository. + :param current_commit_sha: the newest commit to be considered in + selecting commit message. + :param baseline_commit_sha: the oldest commit to be considered in + selecting commit message. This commit should be an ancestor of + :param paths: a mapping from file paths to library_name. + :param is_monorepo: whether to generate commit messages in a monorepo. + :param repo_level_message: commit messages regarding repo-level changes. + :return: commit messages. + :raise ValueError: if current_commit is older than or equal to + baseline_commit. + """ + tmp_dir = "/tmp/repo" + shutil.rmtree(tmp_dir, ignore_errors=True) + os.mkdir(tmp_dir) + repo = Repo.clone_from(repo_url, tmp_dir) + current_commit = repo.commit(current_commit_sha) + baseline_commit = repo.commit(baseline_commit_sha) + current_commit_time = __get_commit_timestamp(current_commit) + baseline_commit_time = __get_commit_timestamp(baseline_commit) + if current_commit_time < baseline_commit_time: + raise ValueError( + f"current_commit ({current_commit_sha[:7]}, committed on " + f"{current_commit_time}) should be newer than or equal to " + f"baseline_commit ({baseline_commit_sha[:7]}, committed on " + f"{baseline_commit_time}) (is this branch up to date with " + f"the base branch?)." + ) + qualified_commits = {} + commit = current_commit + while str(commit.hexsha) != baseline_commit_sha: + commit_and_name = __filter_qualified_commit(paths=paths, commit=commit) + if commit_and_name != (): + qualified_commits[commit_and_name[0]] = commit_and_name[1] + commit_parents = commit.parents + if len(commit_parents) == 0: + break + commit = commit_parents[0] + shutil.rmtree(tmp_dir, ignore_errors=True) + + return __combine_commit_messages( + current_commit=current_commit, + baseline_commit=baseline_commit, + commits=qualified_commits, + is_monorepo=is_monorepo, + repo_level_message=repo_level_message, + ) + + +def __filter_qualified_commit(paths: Dict[str, str], commit: Commit) -> (Commit, str): + """ + Returns a tuple of a commit and libray_name. + A qualified commit means at least one file, excluding BUILD.bazel, changes + in that commit is within the versioned proto_path in paths. + + :param paths: a mapping from versioned proto_path to library_name. + :param commit: a commit under consideration. + :return: a tuple of a commit and library_name if the commit is + qualified; otherwise an empty tuple. + """ + for file in commit.stats.files.keys(): + versioned_proto_path = find_versioned_proto_path(file) + if versioned_proto_path in paths and (not file.endswith("BUILD.bazel")): + return commit, paths[versioned_proto_path] + return () + + +def __combine_commit_messages( + current_commit: Commit, + baseline_commit: Commit, + commits: Dict[Commit, str], + is_monorepo: bool, + repo_level_message: list[str], +) -> str: + description = [] + if current_commit != baseline_commit: + description.append( + f"This pull request is generated with proto changes between " + f"{commit_link(baseline_commit)} (exclusive) " + f"and {commit_link(current_commit)} (inclusive).\n", + ) + commit_message = repo_level_message + commit_message.extend( + format_commit_message(commits=commits, is_monorepo=is_monorepo) + ) + if len(commit_message) == 0: + return EMPTY_MESSAGE + description.extend(wrap_override_commit(commit_message)) + return "\n".join(description) + + +def __get_commit_timestamp(commit: Commit) -> int: + """ + # Convert datetime to UTC timestamp. For more info: + # https://stackoverflow.com/questions/5067218/get-utc-timestamp-in-python-with-datetime + + :param commit: a Commit object + :return: the timestamp of the commit + """ + return calendar.timegm(commit.committed_datetime.utctimetuple()) diff --git a/hermetic_build/release_note_generation/requirements.in b/hermetic_build/release_note_generation/requirements.in new file mode 100644 index 0000000000..4c9d8e47d7 --- /dev/null +++ b/hermetic_build/release_note_generation/requirements.in @@ -0,0 +1,2 @@ +click==8.1.7 +GitPython==3.1.43 \ No newline at end of file diff --git a/hermetic_build/release_note_generation/requirements.txt b/hermetic_build/release_note_generation/requirements.txt new file mode 100644 index 0000000000..66fc4abe33 --- /dev/null +++ b/hermetic_build/release_note_generation/requirements.txt @@ -0,0 +1,22 @@ +# +# This file is autogenerated by pip-compile with Python 3.12 +# by the following command: +# +# pip-compile --generate-hashes hermetic_build/release_note_generation/requirements.in +# +click==8.1.7 \ + --hash=sha256:ae74fb96c20a0277a1d615f1e4d73c8414f5a98db8b799a7931d1582f3390c28 \ + --hash=sha256:ca9853ad459e787e2192211578cc907e7594e294c7ccc834310722b41b9ca6de + # via -r hermetic_build/release_note_generation/requirements.in +gitdb==4.0.11 \ + --hash=sha256:81a3407ddd2ee8df444cbacea00e2d038e40150acfa3001696fe0dcf1d3adfa4 \ + --hash=sha256:bf5421126136d6d0af55bc1e7c1af1c397a34f5b7bd79e776cd3e89785c2b04b + # via gitpython +GitPython==3.1.44 \ + --hash=sha256:9e0e10cda9bed1ee64bc9a6de50e7e38a9c9943241cd7f585f6df3ed28011110 \ + --hash=sha256:c87e30b26253bf5418b01b0660f818967f3c503193838337fe5e573331249269 + # via -r hermetic_build/release_note_generation/requirements.in +smmap==5.0.2 \ + --hash=sha256:26ea65a03958fa0c8a1c7e8c7a58fdc77221b8910f6be2131affade476898ad5 \ + --hash=sha256:b30115f0def7d7531d22a0fb6502488d879e75b260a9db4d0819cfb25403af5e + # via gitdb diff --git a/hermetic_build/release_note_generation/setup.py b/hermetic_build/release_note_generation/setup.py new file mode 100755 index 0000000000..71728c7ef2 --- /dev/null +++ b/hermetic_build/release_note_generation/setup.py @@ -0,0 +1,14 @@ +""" +Package information of library_generation python scripts +""" + +from setuptools import setup + +setup( + name="release_note_generation", + version="0.1", + python_requires=">=3.12", + package_dir={ + "release_note_generation": ".", + }, +) diff --git a/hermetic_build/release_note_generation/tests/__init__.py b/hermetic_build/release_note_generation/tests/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/hermetic_build/release_note_generation/tests/cli/__init__.py b/hermetic_build/release_note_generation/tests/cli/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/hermetic_build/release_note_generation/tests/cli/generate_release_note_unit_tests.py b/hermetic_build/release_note_generation/tests/cli/generate_release_note_unit_tests.py new file mode 100644 index 0000000000..e1ee1e31e8 --- /dev/null +++ b/hermetic_build/release_note_generation/tests/cli/generate_release_note_unit_tests.py @@ -0,0 +1,71 @@ +# 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 +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT 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 unittest +from click.testing import CliRunner +from release_note_generation.cli.generate_release_note import generate + +script_dir = os.path.dirname(os.path.realpath(__file__)) +resource_dir = os.path.join(script_dir, "..", "resources", "test_generate_release_note") + + +class GenerateReleaseNoteTest(unittest.TestCase): + def test_gen_release_note_with_no_baseline_config_does_not_generate_note(self): + runner = CliRunner() + # noinspection PyTypeChecker + result = runner.invoke(generate) + self.assertEqual(0, result.exit_code) + self.assertFalse(os.path.isfile("pr_description.txt")) + + def test_gen_release_note_with_no_current_config_does_not_generate_note(self): + runner = CliRunner() + # noinspection PyTypeChecker + result = runner.invoke( + generate, ["--baseline-generation-config-path=any_config"] + ) + self.assertEqual(0, result.exit_code) + self.assertFalse(os.path.isfile("pr_description.txt")) + + def test_gen_release_note_with_nonexistent_baseline_config_does_not_generate_note( + self, + ): + runner = CliRunner() + # noinspection PyTypeChecker + result = runner.invoke( + generate, + [ + "--baseline-generation-config-path=non_existent_config", + "--current-generation-config-path=not_relevant", + ], + ) + self.assertEqual(0, result.exit_code) + self.assertFalse(os.path.isfile("pr_description.txt")) + + def test_gen_release_note_with_nonexistent_current_config_does_not_generate_note( + self, + ): + cwd = os.getcwd() + os.chdir(resource_dir) + runner = CliRunner() + # noinspection PyTypeChecker + result = runner.invoke( + generate, + [ + "--baseline-generation-config-path=empty_gen_config.yaml", + "--current-generation-config-path=non_existent_config", + ], + ) + self.assertEqual(0, result.exit_code) + self.assertFalse(os.path.isfile("pr_description.txt")) + os.chdir(cwd) diff --git a/hermetic_build/release_note_generation/tests/commit_message_formatter_unit_tests.py b/hermetic_build/release_note_generation/tests/commit_message_formatter_unit_tests.py new file mode 100644 index 0000000000..b7891495ee --- /dev/null +++ b/hermetic_build/release_note_generation/tests/commit_message_formatter_unit_tests.py @@ -0,0 +1,198 @@ +# 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 +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT 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 unittest +from unittest.mock import patch +from common.model.config_change import ( + ConfigChange, + ChangeType, + LibraryChange, +) +from common.model.generation_config import GenerationConfig +from release_note_generation.commit_message_formatter import ( + format_commit_message, + commit_link, + format_repo_level_change, + wrap_googleapis_commit, + wrap_override_commit, +) + +gen_config = GenerationConfig( + gapic_generator_version="1.2.3", googleapis_commitish="123abc", libraries=[] +) + + +class CommitMessageFormatterTest(unittest.TestCase): + def test_format_commit_message_should_add_library_name_for_conventional_commit( + self, + ): + with patch("git.Commit") as mock_commit: + commit = mock_commit.return_value + commit.message = "feat: a commit message\nPiperOrigin-RevId: 123456" + commit.hexsha = "1234567abcdefg" + commits = {commit: "example_library"} + self.assertEqual( + [ + "BEGIN_NESTED_COMMIT", + "feat: [example_library] a commit message", + "PiperOrigin-RevId: 123456", + "Source Link: [googleapis/googleapis@1234567](https://github.com/googleapis/googleapis/commit/1234567abcdefg)", + "END_NESTED_COMMIT", + ], + format_commit_message(commits, True), + ) + + def test_format_commit_message_should_add_library_name_for_mutliline_conventional_commit( + self, + ): + with patch("git.Commit") as mock_commit: + commit = mock_commit.return_value + commit.message = "feat: a commit message\nfix: an another commit message\nPiperOrigin-RevId: 123456" + commit.hexsha = "1234567abcdefg" + commits = {commit: "example_library"} + self.assertEqual( + [ + "BEGIN_NESTED_COMMIT", + "feat: [example_library] a commit message", + "fix: [example_library] an another commit message", + "PiperOrigin-RevId: 123456", + "Source Link: [googleapis/googleapis@1234567](https://github.com/googleapis/googleapis/commit/1234567abcdefg)", + "END_NESTED_COMMIT", + ], + format_commit_message(commits, True), + ) + + def test_format_commit_message_should_not_add_library_name_for_nonconvnentional_commit( + self, + ): + with patch("git.Commit") as mock_commit: + commit = mock_commit.return_value + commit.message = "PiperOrigin-RevId: 123456" + commit.hexsha = "1234567abcdefg" + commits = {commit: "example_library"} + self.assertEqual( + [ + "BEGIN_NESTED_COMMIT", + "PiperOrigin-RevId: 123456", + "Source Link: [googleapis/googleapis@1234567](https://github.com/googleapis/googleapis/commit/1234567abcdefg)", + "END_NESTED_COMMIT", + ], + format_commit_message(commits, True), + ) + + def test_format_commit_message_should_not_add_library_name_if_not_monorepo(self): + with patch("git.Commit") as mock_commit: + commit = mock_commit.return_value + commit.message = "feat: a commit message\nPiperOrigin-RevId: 123456" + commit.hexsha = "1234567abcdefg" + commits = {commit: "example_library"} + self.assertEqual( + [ + "BEGIN_NESTED_COMMIT", + "feat: a commit message", + "PiperOrigin-RevId: 123456", + "Source Link: [googleapis/googleapis@1234567](https://github.com/googleapis/googleapis/commit/1234567abcdefg)", + "END_NESTED_COMMIT", + ], + format_commit_message(commits, False), + ) + + def test_format_commit_message_should_not_add_library_name_for_multiline_commit_if_not_monorepo( + self, + ): + with patch("git.Commit") as mock_commit: + commit = mock_commit.return_value + commit.message = "feat: a commit message\nfix: an another commit message\nPiperOrigin-RevId: 123456" + commit.hexsha = "1234567abcdefg" + commits = {commit: "example_library"} + self.assertEqual( + [ + "BEGIN_NESTED_COMMIT", + "feat: a commit message", + "fix: an another commit message", + "PiperOrigin-RevId: 123456", + "Source Link: [googleapis/googleapis@1234567](https://github.com/googleapis/googleapis/commit/1234567abcdefg)", + "END_NESTED_COMMIT", + ], + format_commit_message(commits, False), + ) + + def test_wrap_nested_commit_success(self): + with patch("git.Commit") as mock_commit: + commit = mock_commit.return_value + commit.hexsha = "1234567abcdefg" + messages = ["a commit message", "another message"] + self.assertEqual( + [ + "BEGIN_NESTED_COMMIT", + "a commit message", + "another message", + "Source Link: [googleapis/googleapis@1234567](https://github.com/googleapis/googleapis/commit/1234567abcdefg)", + "END_NESTED_COMMIT", + ], + wrap_googleapis_commit(commit, messages), + ) + + def test_wrap_override_commit_success(self): + messages = ["a commit message", "another message"] + self.assertEqual( + [ + "BEGIN_COMMIT_OVERRIDE", + "a commit message", + "another message", + "END_COMMIT_OVERRIDE", + ], + wrap_override_commit(messages), + ) + + def test_commit_link_success(self): + with patch("git.Commit") as mock_commit: + commit = mock_commit.return_value + commit.hexsha = "1234567abcdefg" + self.assertEqual( + "[googleapis/googleapis@1234567](https://github.com/googleapis/googleapis/commit/1234567abcdefg)", + commit_link(commit), + ) + + def test_format_repo_level_change_success(self): + config_change = ConfigChange( + change_to_libraries={ + ChangeType.REPO_LEVEL_CHANGE: [ + LibraryChange( + changed_param="gapic_generator_version", current_value="1.2.3" + ), + LibraryChange( + changed_param="libraries_bom_version", current_value="2.3.4" + ), + LibraryChange( + changed_param="protoc_version", current_value="3.4.5" + ), + ] + }, + baseline_config=gen_config, + current_config=gen_config, + ) + self.assertEqual( + [ + "BEGIN_NESTED_COMMIT", + "fix(deps): update the Java code generator (gapic-generator-java) to 1.2.3", + "END_NESTED_COMMIT", + "BEGIN_NESTED_COMMIT", + "chore: update the libraries_bom version to 2.3.4", + "END_NESTED_COMMIT", + "BEGIN_NESTED_COMMIT", + "chore: update repo-level parameter protoc_version to 3.4.5", + "END_NESTED_COMMIT", + ], + format_repo_level_change(config_change), + ) diff --git a/hermetic_build/release_note_generation/tests/generate_pr_description_unit_tests.py b/hermetic_build/release_note_generation/tests/generate_pr_description_unit_tests.py new file mode 100644 index 0000000000..9659af5b2d --- /dev/null +++ b/hermetic_build/release_note_generation/tests/generate_pr_description_unit_tests.py @@ -0,0 +1,269 @@ +# 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 +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT 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 unittest +from filecmp import cmp +from release_note_generation.generate_pr_description import ( + get_repo_level_commit_messages, + generate_pr_descriptions, +) +from common.model.config_change import ( + ConfigChange, + ChangeType, + LibraryChange, +) +from common.model.gapic_config import GapicConfig +from common.model.generation_config import GenerationConfig +from common.model.library_config import LibraryConfig + +script_dir = os.path.dirname(os.path.realpath(__file__)) +resources_dir = os.path.join(script_dir, "resources", "goldens") + + +class GeneratePrDescriptionTest(unittest.TestCase): + def test_get_commit_messages_current_is_older_raise_exception(self): + # committed on April 1st, 2024 + current_commit = "36441693dddaf0ed73951ad3a15c215a332756aa" + # committed on April 2nd, 2024 + baseline_commit = "d5020fff4cbe108bdf506074791c56cff7840bef" + self.assertRaisesRegex( + ValueError, + "newer than", + get_repo_level_commit_messages, + "https://github.com/googleapis/googleapis.git", + current_commit, + baseline_commit, + {}, + True, + [], + ) + + def test_get_commit_messages_with_same_current_and_baseline_returns_empty_message( + self, + ): + # committed on April 1st, 2024 + current_commit = "36441693dddaf0ed73951ad3a15c215a332756aa" + baseline_commit = "36441693dddaf0ed73951ad3a15c215a332756aa" + self.assertEqual( + "", + get_repo_level_commit_messages( + "https://github.com/googleapis/googleapis.git", + current_commit, + baseline_commit, + {}, + True, + [], + ), + ) + + def test_generate_pr_description_with_no_change_in_config(self): + commit_sha = "36441693dddaf0ed73951ad3a15c215a332756aa" + config = GenerationConfig( + gapic_generator_version="", + googleapis_commitish=commit_sha, + libraries_bom_version="", + # use empty libraries to make sure no qualified commit between + # two commit sha. + libraries=[], + ) + pr_description_path = os.path.join(os.getcwd(), "no_config_change") + generate_pr_descriptions( + config_change=ConfigChange( + change_to_libraries={}, + baseline_config=config, + current_config=config, + ), + description_path=pr_description_path, + ) + self.assertFalse(os.path.isfile(f"{pr_description_path}/pr_description.txt")) + + def test_generate_pr_description_does_not_create_pr_description_without_qualified_commit( + self, + ): + # committed on May 22nd, 2024 + old_commit_sha = "30717c0b0c9966906880703208a4c820411565c4" + # committed on May 23rd, 2024 + new_commit_sha = "eeed69d446a90eb4a4a2d1762c49d637075390c1" + pr_description_path = os.path.join(os.getcwd(), "no_qualified_commit") + generate_pr_descriptions( + config_change=ConfigChange( + change_to_libraries={}, + baseline_config=GenerationConfig( + gapic_generator_version="", + googleapis_commitish=old_commit_sha, + # use empty libraries to make sure no qualified commit between + # two commit sha. + libraries=[], + ), + current_config=GenerationConfig( + gapic_generator_version="", + googleapis_commitish=new_commit_sha, + # use empty libraries to make sure no qualified commit between + # two commit sha. + libraries=[], + ), + ), + description_path=pr_description_path, + ) + self.assertFalse(os.path.isfile(f"{pr_description_path}/pr_description.txt")) + + def test_generate_pr_description_with_combined_message( + self, + ): + # no other commits between these two commits. + baseline_commit_sha = "3b6f144d47b0a1d2115ab2445ec06e80cc324a44" + documentai_commit_sha = "0cea7170404bec3d994f43db4fa292f5034cbe9a" + cwd = os.getcwd() + library = LibraryConfig( + api_shortname="documentai", + api_description="", + name_pretty="", + product_documentation="", + gapic_configs=[GapicConfig(proto_path="google/cloud/documentai/v1")], + ) + generate_pr_descriptions( + config_change=ConfigChange( + change_to_libraries={ + ChangeType.REPO_LEVEL_CHANGE: [ + LibraryChange( + changed_param="gapic_generator_version", + current_value="1.2.3", + ), + LibraryChange( + changed_param="libraries_bom_version", current_value="2.3.4" + ), + ], + ChangeType.GOOGLEAPIS_COMMIT: [], + }, + baseline_config=GenerationConfig( + gapic_generator_version="", + googleapis_commitish=baseline_commit_sha, + libraries=[library], + ), + current_config=GenerationConfig( + gapic_generator_version="1.2.3", + googleapis_commitish=documentai_commit_sha, + libraries_bom_version="2.3.4", + libraries=[library], + ), + ), + description_path=cwd, + ) + self.assertTrue(os.path.isfile(f"{cwd}/pr_description.txt")) + self.assertTrue( + cmp( + f"{resources_dir}/pr_description-golden.txt", + f"{cwd}/pr_description.txt", + ), + "The generated PR description does not match the expected golden file", + ) + os.remove(f"{cwd}/pr_description.txt") + + def test_generate_pr_description_with_repo_level_change_without_qualified_commit( + self, + ): + # no other commits between these two commits. + baseline_commit_sha = "3b6f144d47b0a1d2115ab2445ec06e80cc324a44" + current_commit_sha = "0cea7170404bec3d994f43db4fa292f5034cbe9a" + cwd = os.getcwd() + library = LibraryConfig( + api_shortname="example_library", + api_description="", + name_pretty="", + product_documentation="", + gapic_configs=[GapicConfig(proto_path="google/example/v1")], + ) + generate_pr_descriptions( + config_change=ConfigChange( + change_to_libraries={ + ChangeType.REPO_LEVEL_CHANGE: [ + LibraryChange( + changed_param="gapic_generator_version", + current_value="1.2.3", + ), + LibraryChange( + changed_param="libraries_bom_version", current_value="2.3.4" + ), + ], + ChangeType.GOOGLEAPIS_COMMIT: [], + }, + baseline_config=GenerationConfig( + gapic_generator_version="", + googleapis_commitish=baseline_commit_sha, + libraries=[library], + ), + current_config=GenerationConfig( + gapic_generator_version="1.2.3", + googleapis_commitish=current_commit_sha, + libraries_bom_version="2.3.4", + libraries=[library], + ), + ), + description_path=cwd, + ) + self.assertTrue(os.path.isfile(f"{cwd}/pr_description.txt")) + self.assertTrue( + cmp( + f"{resources_dir}/repo_level_and_no_qualified_commit_pr_description-golden.txt", + f"{cwd}/pr_description.txt", + ), + "The generated PR description does not match the expected golden file", + ) + os.remove(f"{cwd}/pr_description.txt") + + def test_generate_pr_description_create_description_with_only_repo_level_change( + self, + ): + commit_sha = "3b6f144d47b0a1d2115ab2445ec06e80cc324a44" + cwd = os.getcwd() + library = LibraryConfig( + api_shortname="documentai", + api_description="", + name_pretty="", + product_documentation="", + gapic_configs=[GapicConfig(proto_path="google/cloud/documentai/v1")], + ) + generate_pr_descriptions( + config_change=ConfigChange( + change_to_libraries={ + ChangeType.REPO_LEVEL_CHANGE: [ + LibraryChange( + changed_param="gapic_generator_version", + current_value="1.2.3", + ) + ], + ChangeType.GOOGLEAPIS_COMMIT: [], + }, + baseline_config=GenerationConfig( + gapic_generator_version="1.2.2", + googleapis_commitish=commit_sha, + libraries=[library], + ), + current_config=GenerationConfig( + gapic_generator_version="1.2.3", + googleapis_commitish=commit_sha, + libraries=[library], + ), + ), + description_path=cwd, + ) + self.assertTrue(os.path.isfile(f"{cwd}/pr_description.txt")) + self.assertTrue( + cmp( + f"{resources_dir}/repo_level_only_pr_description-golden.txt", + f"{cwd}/pr_description.txt", + ), + "The generated PR description does not match the expected golden file", + ) + os.remove(f"{cwd}/pr_description.txt") diff --git a/hermetic_build/release_note_generation/tests/resources/goldens/pr_description-golden.txt b/hermetic_build/release_note_generation/tests/resources/goldens/pr_description-golden.txt new file mode 100644 index 0000000000..1a0f874936 --- /dev/null +++ b/hermetic_build/release_note_generation/tests/resources/goldens/pr_description-golden.txt @@ -0,0 +1,17 @@ +This pull request is generated with proto changes between [googleapis/googleapis@3b6f144](https://github.com/googleapis/googleapis/commit/3b6f144d47b0a1d2115ab2445ec06e80cc324a44) (exclusive) and [googleapis/googleapis@0cea717](https://github.com/googleapis/googleapis/commit/0cea7170404bec3d994f43db4fa292f5034cbe9a) (inclusive). + +BEGIN_COMMIT_OVERRIDE +BEGIN_NESTED_COMMIT +fix(deps): update the Java code generator (gapic-generator-java) to 1.2.3 +END_NESTED_COMMIT +BEGIN_NESTED_COMMIT +chore: update the libraries_bom version to 2.3.4 +END_NESTED_COMMIT +BEGIN_NESTED_COMMIT +feat: Make Layout Parser generally available in V1 + +PiperOrigin-RevId: 638924855 + +Source Link: [googleapis/googleapis@0cea717](https://github.com/googleapis/googleapis/commit/0cea7170404bec3d994f43db4fa292f5034cbe9a) +END_NESTED_COMMIT +END_COMMIT_OVERRIDE \ No newline at end of file diff --git a/hermetic_build/release_note_generation/tests/resources/goldens/repo_level_and_no_qualified_commit_pr_description-golden.txt b/hermetic_build/release_note_generation/tests/resources/goldens/repo_level_and_no_qualified_commit_pr_description-golden.txt new file mode 100644 index 0000000000..81f7c0c4d2 --- /dev/null +++ b/hermetic_build/release_note_generation/tests/resources/goldens/repo_level_and_no_qualified_commit_pr_description-golden.txt @@ -0,0 +1,10 @@ +This pull request is generated with proto changes between [googleapis/googleapis@3b6f144](https://github.com/googleapis/googleapis/commit/3b6f144d47b0a1d2115ab2445ec06e80cc324a44) (exclusive) and [googleapis/googleapis@0cea717](https://github.com/googleapis/googleapis/commit/0cea7170404bec3d994f43db4fa292f5034cbe9a) (inclusive). + +BEGIN_COMMIT_OVERRIDE +BEGIN_NESTED_COMMIT +fix(deps): update the Java code generator (gapic-generator-java) to 1.2.3 +END_NESTED_COMMIT +BEGIN_NESTED_COMMIT +chore: update the libraries_bom version to 2.3.4 +END_NESTED_COMMIT +END_COMMIT_OVERRIDE \ No newline at end of file diff --git a/hermetic_build/release_note_generation/tests/resources/goldens/repo_level_only_pr_description-golden.txt b/hermetic_build/release_note_generation/tests/resources/goldens/repo_level_only_pr_description-golden.txt new file mode 100644 index 0000000000..f89901f8c1 --- /dev/null +++ b/hermetic_build/release_note_generation/tests/resources/goldens/repo_level_only_pr_description-golden.txt @@ -0,0 +1,5 @@ +BEGIN_COMMIT_OVERRIDE +BEGIN_NESTED_COMMIT +fix(deps): update the Java code generator (gapic-generator-java) to 1.2.3 +END_NESTED_COMMIT +END_COMMIT_OVERRIDE \ No newline at end of file diff --git a/hermetic_build/release_note_generation/tests/resources/test_generate_release_note/empty_gen_config.yaml b/hermetic_build/release_note_generation/tests/resources/test_generate_release_note/empty_gen_config.yaml new file mode 100644 index 0000000000..e69de29bb2 diff --git a/java-common-protos/.OwlBot-hermetic.yaml b/java-common-protos/.OwlBot-hermetic.yaml new file mode 100644 index 0000000000..1aed221695 --- /dev/null +++ b/java-common-protos/.OwlBot-hermetic.yaml @@ -0,0 +1,71 @@ +# 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. + + +deep-remove-regex: +- "/java-common-protos/grpc-google-.*/src" +- "/java-common-protos/proto-google-.*/src" +- "/java-common-protos/google-.*/src" + +deep-preserve-regex: +- "/java-common-protos/google-.*/src/test/java/com/google/cloud/.*/v.*/it/IT.*Test.java" + +deep-copy-regex: +- source: "/google/api/.*-java/proto-google-.*/src" + dest: "/owl-bot-staging/java-common-protos/v1/proto-google-common-protos/src" + +- source: "/google/cloud/audit/.*-java/proto-google-.*/src" + dest: "/owl-bot-staging/java-common-protos/v1/proto-google-common-protos/src" + +# For geo common protos +- source: "/google/geo/type/.*-java/proto-google-.*/src" + dest: "/owl-bot-staging/java-common-protos/v1/proto-google-common-protos/src" + +# For shopping common protos +- source: "/google/shopping/type/.*-java/proto-google-.*/src" + dest: "/owl-bot-staging/java-common-protos/v1/proto-google-common-protos/src" + +# It is only used once in https://github.com/googleapis/googleapis/blob/master/google/chat/v1/BUILD.bazel#L47, +# and technically not a common proto, maybe a violation of AIP-215 if it is not. +# However, it's better to put it here so that we don't have to manually add it to BUILD.bazel file and hermetic build scripts. +- source: "/google/apps/card/v1/.*-java/proto-google-.*/src" + dest: "/owl-bot-staging/java-common-protos/v1/proto-google-common-protos/src" + +- source: "/google/logging/type/.*-java/proto-google-.*/src" + dest: "/owl-bot-staging/java-common-protos/v1/proto-google-common-protos/src" + +- source: "/google/longrunning/.*-java/proto-google-.*/src" + dest: "/owl-bot-staging/java-common-protos/v1/proto-google-common-protos/src" + +- source: "/google/rpc/.*-java/proto-google-.*/src" + dest: "/owl-bot-staging/java-common-protos/v1/proto-google-common-protos/src" + +- source: "/google/rpc/context/.*-java/proto-google-.*/src" + dest: "/owl-bot-staging/java-common-protos/v1/proto-google-common-protos/src" + +- source: "/google/type/.*-java/proto-google-.*/src" + dest: "/owl-bot-staging/java-common-protos/v1/proto-google-common-protos/src" + +- source: "/google/cloud/.*-java/proto-google-.*/src" + dest: "/owl-bot-staging/java-common-protos/v1/proto-google-common-protos/src" + +- source: "/google/cloud/location/.*-java/proto-google-.*/src" + dest: "/owl-bot-staging/java-common-protos/v1/proto-google-common-protos/src" + +- source: "/google/cloud/location/.*-java/grpc-google-.*/src" + dest: "/owl-bot-staging/java-common-protos/v1/grpc-google-common-protos/src" + +- source: "/google/longrunning/.*-java/grpc-google-.*/src" + dest: "/owl-bot-staging/java-common-protos/v1/grpc-google-common-protos/src" +api-name: common-protos diff --git a/java-common-protos/.OwlBot.yaml b/java-common-protos/.OwlBot.yaml deleted file mode 100644 index 4aa7962d4f..0000000000 --- a/java-common-protos/.OwlBot.yaml +++ /dev/null @@ -1,60 +0,0 @@ -# Copyright 2021 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - - -deep-remove-regex: -- "/java-common-protos/grpc-google-.*/src" -- "/java-common-protos/proto-google-.*/src" -- "/java-common-protos/google-.*/src" - -deep-preserve-regex: -- "/java-common-protos/google-.*/src/test/java/com/google/cloud/.*/v.*/it/IT.*Test.java" - -deep-copy-regex: -- source: "/google/api/google-api-java/proto-google-api-java/src" - dest: "/owl-bot-staging/java-common-protos/v1/proto-google-common-protos/src" - -- source: "/google/cloud/audit/google-cloud-audit-java/proto-google-cloud-audit-java/src" - dest: "/owl-bot-staging/java-common-protos/v1/proto-google-common-protos/src" - -- source: "/google/geo/type/google-geo-type-java/proto-google-geo-type-java/src" - dest: "/owl-bot-staging/java-common-protos/v1/proto-google-common-protos/src" - -- source: "/google/logging/type/google-logging-type-java/proto-google-logging-type-java/src" - dest: "/owl-bot-staging/java-common-protos/v1/proto-google-common-protos/src" - -- source: "/google/longrunning/google-longrunning-java/proto-google-longrunning-java/src" - dest: "/owl-bot-staging/java-common-protos/v1/proto-google-common-protos/src" - -- source: "/google/rpc/google-rpc-java/proto-google-rpc-java/src" - dest: "/owl-bot-staging/java-common-protos/v1/proto-google-common-protos/src" - -- source: "/google/rpc/context/google-context-java/proto-google-context-java/src" - dest: "/owl-bot-staging/java-common-protos/v1/proto-google-common-protos/src" - -- source: "/google/type/google-type-java/proto-google-type-java/src" - dest: "/owl-bot-staging/java-common-protos/v1/proto-google-common-protos/src" - -- source: "/google/cloud/google-apps-script-type-java/proto-google-apps-script-type-java/src" - dest: "/owl-bot-staging/java-common-protos/v1/proto-google-common-protos/src" - -- source: "/google/cloud/location/google-cloud-location-java/proto-google-cloud-location-java/src" - dest: "/owl-bot-staging/java-common-protos/v1/proto-google-common-protos/src" - -- source: "/google/cloud/location/google-cloud-location-java/grpc-google-cloud-location-java/src" - dest: "/owl-bot-staging/java-common-protos/v1/grpc-google-common-protos/src" - -- source: "/google/longrunning/google-longrunning-java/grpc-google-longrunning-java/src" - dest: "/owl-bot-staging/java-common-protos/v1/grpc-google-common-protos/src" -api-name: common-protos diff --git a/java-common-protos/.github/CODEOWNERS b/java-common-protos/.github/CODEOWNERS deleted file mode 100644 index db2d8ad174..0000000000 --- a/java-common-protos/.github/CODEOWNERS +++ /dev/null @@ -1,13 +0,0 @@ -# Code owners file. -# This file controls who is tagged for review for any given pull request. - -# For syntax help see: -# https://help.github.com/en/github/creating-cloning-and-archiving-repositories/about-code-owners#codeowners-syntax - -* @googleapis/yoshi-java - -# The java-samples-reviewers team is the default owner for samples changes -samples/**/*.java @googleapis/java-samples-reviewers - -# Generated snippets should not be owned by samples reviewers -samples/snippets/generated/ @googleapis/yoshi-java diff --git a/java-common-protos/.github/ISSUE_TEMPLATE/bug_report.md b/java-common-protos/.github/ISSUE_TEMPLATE/bug_report.md deleted file mode 100644 index 9bfcd1fe02..0000000000 --- a/java-common-protos/.github/ISSUE_TEMPLATE/bug_report.md +++ /dev/null @@ -1,51 +0,0 @@ ---- -name: Bug report -about: Create a report to help us improve - ---- - -Thanks for stopping by to let us know something could be better! - -**PLEASE READ**: If you have a support contract with Google, please create an issue in the [support console](https://cloud.google.com/support/) instead of filing on GitHub. This will ensure a timely response. - -Please run down the following list and make sure you've tried the usual "quick fixes": - - - Search the issues already opened: https://github.com/googleapis/java-common-protos/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-common-protos/.github/ISSUE_TEMPLATE/feature_request.md b/java-common-protos/.github/ISSUE_TEMPLATE/feature_request.md deleted file mode 100644 index 754e30c68a..0000000000 --- a/java-common-protos/.github/ISSUE_TEMPLATE/feature_request.md +++ /dev/null @@ -1,21 +0,0 @@ ---- -name: Feature request -about: Suggest an idea for this library - ---- - -Thanks for stopping by to let us know something could be better! - -**PLEASE READ**: If you have a support contract with Google, please create an issue in the [support console](https://cloud.google.com/support/) instead of filing on GitHub. This will ensure a timely response. - -**Is your feature request related to a problem? Please describe.** -What the problem is. Example: I'm always frustrated when [...] - -**Describe the solution you'd like** -What you want to happen. - -**Describe alternatives you've considered** -Any alternative solutions or features you've considered. - -**Additional context** -Any other context or screenshots about the feature request. diff --git a/java-common-protos/.github/ISSUE_TEMPLATE/support_request.md b/java-common-protos/.github/ISSUE_TEMPLATE/support_request.md deleted file mode 100644 index 9958690321..0000000000 --- a/java-common-protos/.github/ISSUE_TEMPLATE/support_request.md +++ /dev/null @@ -1,7 +0,0 @@ ---- -name: Support request -about: If you have a support contract with Google, please create an issue in the Google Cloud Support console. - ---- - -**PLEASE READ**: If you have a support contract with Google, please create an issue in the [support console](https://cloud.google.com/support/) instead of filing on GitHub. This will ensure a timely response. diff --git a/java-common-protos/.github/PULL_REQUEST_TEMPLATE.md b/java-common-protos/.github/PULL_REQUEST_TEMPLATE.md deleted file mode 100644 index 7d3626fbb5..0000000000 --- a/java-common-protos/.github/PULL_REQUEST_TEMPLATE.md +++ /dev/null @@ -1,10 +0,0 @@ -Thank you for opening a Pull Request! Before submitting your PR, there are a few things you can do to make sure it goes smoothly: -- [ ] Make sure to open an issue as a [bug/issue](https://github.com/googleapis/java-common-protos/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-common-protos/.github/blunderbuss.yml b/java-common-protos/.github/blunderbuss.yml deleted file mode 100644 index 2176b05432..0000000000 --- a/java-common-protos/.github/blunderbuss.yml +++ /dev/null @@ -1,7 +0,0 @@ -# Configuration for the Blunderbuss GitHub app. For more info see -# https://github.com/googleapis/repo-automation-bots/tree/main/packages/blunderbuss -assign_prs_by: -- labels: - - samples - to: - - googleapis/java-samples-reviewers \ No newline at end of file diff --git a/java-common-protos/.github/generated-files-bot.yml b/java-common-protos/.github/generated-files-bot.yml deleted file mode 100644 index c644a24e11..0000000000 --- a/java-common-protos/.github/generated-files-bot.yml +++ /dev/null @@ -1,12 +0,0 @@ -externalManifests: -- type: json - file: 'synth.metadata' - jsonpath: '$.generatedFiles[*]' -- type: json - file: '.github/readme/synth.metadata/synth.metadata' - jsonpath: '$.generatedFiles[*]' -ignoreAuthors: -- 'renovate-bot' -- 'yoshi-automation' -- 'release-please[bot]' -- 'gcf-owl-bot[bot]' diff --git a/java-common-protos/.github/release-please.yml b/java-common-protos/.github/release-please.yml deleted file mode 100644 index 7f2d2a1348..0000000000 --- a/java-common-protos/.github/release-please.yml +++ /dev/null @@ -1,20 +0,0 @@ -bumpMinorPreMajor: true -handleGHRelease: true -releaseType: java-yoshi -branches: - - bumpMinorPreMajor: true - handleGHRelease: true - releaseType: java-yoshi - branch: java7 - - bumpMinorPreMajor: true - handleGHRelease: true - releaseType: java-backport - branch: 2.6.x - - bumpMinorPreMajor: true - handleGHRelease: true - releaseType: java-backport - branch: 2.8.x - - bumpMinorPreMajor: true - handleGHRelease: true - releaseType: java-backport - branch: 2.10.x diff --git a/java-common-protos/.github/release-trigger.yml b/java-common-protos/.github/release-trigger.yml deleted file mode 100644 index d4ca94189e..0000000000 --- a/java-common-protos/.github/release-trigger.yml +++ /dev/null @@ -1 +0,0 @@ -enabled: true diff --git a/java-common-protos/.github/sync-repo-settings.yaml b/java-common-protos/.github/sync-repo-settings.yaml deleted file mode 100644 index 6f36909ee3..0000000000 --- a/java-common-protos/.github/sync-repo-settings.yaml +++ /dev/null @@ -1,86 +0,0 @@ -rebaseMergeAllowed: false -squashMergeAllowed: true -mergeCommitAllowed: false -branchProtectionRules: - - pattern: main - isAdminEnforced: true - requiredApprovingReviewCount: 1 - requiresCodeOwnerReviews: true - requiresStrictStatusChecks: false - requiredStatusCheckContexts: - - dependencies (8) - - dependencies (11) - - lint - - clirr - - units (8) - - units (11) - - 'Kokoro - Test: Integration' - - cla/google - - OwlBot Post Processor - - pattern: java7 - isAdminEnforced: true - requiredApprovingReviewCount: 1 - requiresCodeOwnerReviews: true - requiresStrictStatusChecks: false - requiredStatusCheckContexts: - - dependencies (8) - - dependencies (11) - - lint - - clirr - - units (7) - - units (8) - - units (11) - - 'Kokoro - Test: Integration' - - cla/google - - pattern: 2.6.x - isAdminEnforced: true - requiredApprovingReviewCount: 1 - requiresCodeOwnerReviews: true - requiresStrictStatusChecks: false - requiredStatusCheckContexts: - - dependencies (8) - - dependencies (11) - - lint - - clirr - - units (8) - - units (11) - - 'Kokoro - Test: Integration' - - cla/google - - OwlBot Post Processor - - pattern: 2.8.x - isAdminEnforced: true - requiredApprovingReviewCount: 1 - requiresCodeOwnerReviews: true - requiresStrictStatusChecks: false - requiredStatusCheckContexts: - - dependencies (8) - - dependencies (11) - - lint - - clirr - - units (8) - - units (11) - - 'Kokoro - Test: Integration' - - cla/google - - OwlBot Post Processor - - pattern: 2.10.x - isAdminEnforced: true - requiredApprovingReviewCount: 1 - requiresCodeOwnerReviews: true - requiresStrictStatusChecks: false - requiredStatusCheckContexts: - - dependencies (8) - - dependencies (11) - - lint - - clirr - - units (8) - - units (11) - - 'Kokoro - Test: Integration' - - cla/google - - OwlBot Post Processor -permissionRules: - - team: yoshi-admins - permission: admin - - team: yoshi-java-admins - permission: admin - - team: yoshi-java - permission: push diff --git a/java-common-protos/.github/trusted-contribution.yml b/java-common-protos/.github/trusted-contribution.yml deleted file mode 100644 index a0ba1f7d90..0000000000 --- a/java-common-protos/.github/trusted-contribution.yml +++ /dev/null @@ -1,3 +0,0 @@ -trustedContributors: -- renovate-bot -- gcf-owl-bot[bot] diff --git a/java-common-protos/.github/workflows/approve-readme.yaml b/java-common-protos/.github/workflows/approve-readme.yaml deleted file mode 100644 index f5fc7d5169..0000000000 --- a/java-common-protos/.github/workflows/approve-readme.yaml +++ /dev/null @@ -1,69 +0,0 @@ -# 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@v6 - 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-common-protos/.github/workflows/auto-release.yaml b/java-common-protos/.github/workflows/auto-release.yaml deleted file mode 100644 index 7a106d007e..0000000000 --- a/java-common-protos/.github/workflows/auto-release.yaml +++ /dev/null @@ -1,103 +0,0 @@ -# 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-release -jobs: - approve: - runs-on: ubuntu-latest - if: contains(github.head_ref, 'release-please') - steps: - - uses: actions/github-script@v6 - with: - github-token: ${{secrets.YOSHI_APPROVER_TOKEN}} - debug: true - script: | - // only approve PRs from release-please[bot] - if (context.payload.pull_request.user.login !== "release-please[bot]") { - return; - } - - // only approve PRs like "chore(main): release " - if ( !context.payload.pull_request.title.startsWith("chore(main): release") ) { - return; - } - - // only approve PRs with pom.xml and versions.txt changes - const filesPromise = github.rest.pulls.listFiles.endpoint({ - owner: context.repo.owner, - repo: context.repo.repo, - pull_number: context.payload.pull_request.number, - }); - const changed_files = await github.paginate(filesPromise) - - if ( changed_files.length < 1 ) { - console.log( "Not proceeding since PR is empty!" ) - return; - } - - if ( !changed_files.some(v => v.filename.includes("pom")) || !changed_files.some(v => v.filename.includes("versions.txt")) ) { - console.log( "PR file changes do not have pom.xml or versions.txt -- something is wrong. PTAL!" ) - return; - } - - // trigger auto-release when - // 1) it is a SNAPSHOT release (auto-generated post regular release) - // 2) there are dependency updates only - // 3) there are no open dependency update PRs in this repo (to avoid multiple releases) - if ( - context.payload.pull_request.body.includes("Fix") || - context.payload.pull_request.body.includes("Build") || - context.payload.pull_request.body.includes("Documentation") || - context.payload.pull_request.body.includes("BREAKING CHANGES") || - context.payload.pull_request.body.includes("Features") - ) { - console.log( "Not auto-releasing since it is not a dependency-update-only release." ); - return; - } - - const promise = github.rest.pulls.list.endpoint({ - owner: context.repo.owner, - repo: context.repo.repo, - state: 'open' - }); - const open_pulls = await github.paginate(promise) - - if ( open_pulls.length > 1 && !context.payload.pull_request.title.includes("SNAPSHOT") ) { - for ( const pull of open_pulls ) { - if ( pull.title.startsWith("deps: update dependency") ) { - console.log( "Not auto-releasing yet since there are dependency update PRs open in this repo." ); - return; - } - } - } - - // approve release PR - await github.rest.pulls.createReview({ - owner: context.repo.owner, - repo: context.repo.repo, - body: 'Rubber stamped release!', - pull_number: context.payload.pull_request.number, - event: 'APPROVE' - }); - - // attach kokoro:force-run and automerge labels - await github.rest.issues.addLabels({ - owner: context.repo.owner, - repo: context.repo.repo, - issue_number: context.payload.pull_request.number, - labels: ['kokoro:force-run', 'automerge'] - }); diff --git a/java-common-protos/.github/workflows/ci.yaml b/java-common-protos/.github/workflows/ci.yaml deleted file mode 100644 index e3bb26e377..0000000000 --- a/java-common-protos/.github/workflows/ci.yaml +++ /dev/null @@ -1,89 +0,0 @@ -# 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: [8, 11, 17] - steps: - - uses: actions/checkout@v3 - - uses: actions/setup-java@v3 - with: - distribution: zulu - java-version: ${{matrix.java}} - - run: java -version - - 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@v3 - - uses: actions/setup-java@v3 - with: - distribution: zulu - java-version: 8 - - run: java -version - - run: .kokoro/build.bat - env: - JOB_TYPE: test - dependencies: - runs-on: ubuntu-latest - strategy: - matrix: - java: [8, 11, 17] - steps: - - uses: actions/checkout@v3 - - uses: actions/setup-java@v3 - with: - distribution: zulu - java-version: ${{matrix.java}} - - run: java -version - - run: .kokoro/dependencies.sh - lint: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - uses: actions/setup-java@v3 - with: - distribution: zulu - java-version: 11 - - run: java -version - - run: .kokoro/build.sh - env: - JOB_TYPE: lint - clirr: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - uses: actions/setup-java@v3 - with: - distribution: zulu - java-version: 8 - - run: java -version - - run: .kokoro/build.sh - env: - JOB_TYPE: clirr diff --git a/java-common-protos/.gitignore b/java-common-protos/.gitignore deleted file mode 100644 index cc0bc34a31..0000000000 --- a/java-common-protos/.gitignore +++ /dev/null @@ -1,17 +0,0 @@ -# Maven -target/ - -# Eclipse -.classpath -.project -.settings - -# Intellij -*.iml -.idea/ - -# python utilities -*.pyc -__pycache__ - -.flattened-pom.xml \ No newline at end of file diff --git a/java-common-protos/.kokoro/build.bat b/java-common-protos/.kokoro/build.bat deleted file mode 100644 index 067cf4a4c4..0000000000 --- a/java-common-protos/.kokoro/build.bat +++ /dev/null @@ -1,18 +0,0 @@ -:: 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-common-protos/.kokoro/build.sh b/java-common-protos/.kokoro/build.sh deleted file mode 100755 index 2740275207..0000000000 --- a/java-common-protos/.kokoro/build.sh +++ /dev/null @@ -1,134 +0,0 @@ -#!/bin/bash -# Copyright 2019 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -set -eo pipefail - -## Get the directory of the build script -scriptDir=$(realpath $(dirname "${BASH_SOURCE[0]}")) -## cd to the parent directory, i.e. the root of the git repo -cd ${scriptDir}/.. - -# include common functions -source ${scriptDir}/common.sh - -# Print out Maven & Java version -mvn -version -echo ${JOB_TYPE} - -# attempt to install 3 times with exponential backoff (starting with 10 seconds) -retry_with_backoff 3 10 \ - mvn install -B -V -ntp \ - -DskipTests=true \ - -Dclirr.skip=true \ - -Denforcer.skip=true \ - -Dmaven.javadoc.skip=true \ - -Dgcloud.download.skip=true \ - -T 1C - -# if GOOGLE_APPLICATION_CREDENTIALS is specified as a relative path, prepend Kokoro root directory onto it -if [[ ! -z "${GOOGLE_APPLICATION_CREDENTIALS}" && "${GOOGLE_APPLICATION_CREDENTIALS}" != /* ]]; then - export GOOGLE_APPLICATION_CREDENTIALS=$(realpath ${KOKORO_GFILE_DIR}/${GOOGLE_APPLICATION_CREDENTIALS}) -fi - -RETURN_CODE=0 -set +e - -case ${JOB_TYPE} in -test) - mvn test -B -ntp -Dclirr.skip=true -Denforcer.skip=true - RETURN_CODE=$? - ;; -lint) - mvn com.coveo:fmt-maven-plugin:check -B -ntp - RETURN_CODE=$? - ;; -javadoc) - mvn javadoc:javadoc javadoc:test-javadoc -B -ntp - RETURN_CODE=$? - ;; -integration) - mvn -B ${INTEGRATION_TEST_ARGS} \ - -ntp \ - -Penable-integration-tests \ - -DtrimStackTrace=false \ - -Dclirr.skip=true \ - -Denforcer.skip=true \ - -fae \ - verify - RETURN_CODE=$? - ;; -graalvm) - # Run Unit and Integration Tests with Native Image - mvn -B ${INTEGRATION_TEST_ARGS} -ntp -Pnative -Penable-integration-tests test - RETURN_CODE=$? - ;; -graalvm17) - # Run Unit and Integration Tests with Native Image - mvn -B ${INTEGRATION_TEST_ARGS} -ntp -Pnative -Penable-integration-tests test - 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 \ - -fae \ - verify - RETURN_CODE=$? - popd - else - echo "no sample pom.xml found - skipping sample tests" - fi - ;; -clirr) - mvn -B -ntp -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-common-protos -fi - -echo "exiting with ${RETURN_CODE}" -exit ${RETURN_CODE} diff --git a/java-common-protos/.kokoro/coerce_logs.sh b/java-common-protos/.kokoro/coerce_logs.sh deleted file mode 100755 index 46edbf7f2f..0000000000 --- a/java-common-protos/.kokoro/coerce_logs.sh +++ /dev/null @@ -1,37 +0,0 @@ -#!/bin/bash -# Copyright 2019 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# This script finds and moves sponge logs so that they can be found by placer -# and are not flagged as flaky by sponge. - -set -eo pipefail - -## Get the directory of the build script -scriptDir=$(realpath $(dirname "${BASH_SOURCE[0]}")) -## cd to the parent directory, i.e. the root of the git repo -cd ${scriptDir}/.. - -job=$(basename ${KOKORO_JOB_NAME}) - -echo "coercing sponge logs..." -for xml in `find . -name *-sponge_log.xml` -do - class=$(basename ${xml} | cut -d- -f2) - dir=$(dirname ${xml})/${job}/${class} - text=$(dirname ${xml})/${class}-sponge_log.txt - mkdir -p ${dir} - mv ${xml} ${dir}/sponge_log.xml - mv ${text} ${dir}/sponge_log.txt -done diff --git a/java-common-protos/.kokoro/common.cfg b/java-common-protos/.kokoro/common.cfg deleted file mode 100644 index 8b2d91d032..0000000000 --- a/java-common-protos/.kokoro/common.cfg +++ /dev/null @@ -1,13 +0,0 @@ -# Format: //devtools/kokoro/config/proto/build.proto - -# Download trampoline resources. These will be in ${KOKORO_GFILE_DIR} -gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/trampoline" - -# All builds use the trampoline script to run in docker. -build_file: "java-common-protos/.kokoro/trampoline.sh" - -# Tell the trampoline which build file to use. -env_vars: { - key: "TRAMPOLINE_BUILD_FILE" - value: "github/java-common-protos/.kokoro/build.sh" -} diff --git a/java-common-protos/.kokoro/common.sh b/java-common-protos/.kokoro/common.sh deleted file mode 100644 index f8f957af11..0000000000 --- a/java-common-protos/.kokoro/common.sh +++ /dev/null @@ -1,60 +0,0 @@ -#!/bin/bash -# Copyright 2020 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -function retry_with_backoff { - attempts_left=$1 - sleep_seconds=$2 - shift 2 - command=$@ - - - # store current flag state - flags=$- - - # allow a failures to continue - set +e - ${command} - exit_code=$? - - # restore "e" flag - if [[ ${flags} =~ e ]] - then set -e - else set +e - fi - - if [[ $exit_code == 0 ]] - then - return 0 - fi - - # failure - if [[ ${attempts_left} > 0 ]] - then - echo "failure (${exit_code}), sleeping ${sleep_seconds}..." - sleep ${sleep_seconds} - new_attempts=$((${attempts_left} - 1)) - new_sleep=$((${sleep_seconds} * 2)) - retry_with_backoff ${new_attempts} ${new_sleep} ${command} - fi - - return $exit_code -} - -## Helper functionss -function now() { date +"%Y-%m-%d %H:%M:%S" | tr -d '\n'; } -function msg() { println "$*" >&2; } -function println() { printf '%s\n' "$(now) $*"; } - -## Helper comment to trigger updated repo dependency release \ No newline at end of file diff --git a/java-common-protos/.kokoro/continuous/common.cfg b/java-common-protos/.kokoro/continuous/common.cfg deleted file mode 100644 index d8e6ffc95f..0000000000 --- a/java-common-protos/.kokoro/continuous/common.cfg +++ /dev/null @@ -1,25 +0,0 @@ -# Format: //devtools/kokoro/config/proto/build.proto - -# Build logs will be here -action { - define_artifacts { - regex: "**/*sponge_log.xml" - regex: "**/*sponge_log.txt" - } -} - -# Download trampoline resources. -gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/trampoline" - -# Use the trampoline script to run in docker. -build_file: "java-common-protos/.kokoro/trampoline.sh" - -env_vars: { - key: "TRAMPOLINE_BUILD_FILE" - value: "github/java-common-protos/.kokoro/build.sh" -} - -env_vars: { - key: "JOB_TYPE" - value: "test" -} diff --git a/java-common-protos/.kokoro/continuous/java8.cfg b/java-common-protos/.kokoro/continuous/java8.cfg deleted file mode 100644 index 495cc7bacd..0000000000 --- a/java-common-protos/.kokoro/continuous/java8.cfg +++ /dev/null @@ -1,12 +0,0 @@ -# Format: //devtools/kokoro/config/proto/build.proto - -# Configure the docker image for kokoro-trampoline. -env_vars: { - key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-kokoro-resources/java8" -} - -env_vars: { - key: "REPORT_COVERAGE" - value: "true" -} diff --git a/java-common-protos/.kokoro/dependencies.sh b/java-common-protos/.kokoro/dependencies.sh deleted file mode 100755 index 3371515e99..0000000000 --- a/java-common-protos/.kokoro/dependencies.sh +++ /dev/null @@ -1,110 +0,0 @@ -#!/bin/bash -# Copyright 2019 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -set -eo pipefail -shopt -s nullglob - -## Get the directory of the build script -scriptDir=$(realpath $(dirname "${BASH_SOURCE[0]}")) -## cd to the parent directory, i.e. the root of the git repo -cd ${scriptDir}/.. - -# include common functions -source ${scriptDir}/common.sh - -# Print out Java -java -version -echo $JOB_TYPE - -function determineMavenOpts() { - local javaVersion=$( - # filter down to the version line, then pull out the version between quotes, - # then trim the version number down to its minimal number (removing any - # update or suffix number). - java -version 2>&1 | grep "version" \ - | sed -E 's/^.*"(.*?)".*$/\1/g' \ - | sed -E 's/^(1\.[0-9]\.0).*$/\1/g' - ) - - 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 - -echo "****************** DEPENDENCY LIST COMPLETENESS CHECK *******************" -## Run dependency list completeness check -function completenessCheck() { - # Output dep list with compile scope generated using the original pom - # Running mvn dependency:list on Java versions that support modules will also include the module of the dependency. - # This is stripped from the output as it is not present in the flattened pom. - # Only dependencies with 'compile' or 'runtime' scope are included from original dependency list. - msg "Generating dependency list using original pom..." - mvn dependency:list -f pom.xml -DexcludeArtifactIds=error_prone_annotations -DincludeScope=runtime -Dsort=true | grep '\[INFO] .*:.*:.*:.*:.*' | sed -e 's/ --.*//' >.org-list.txt - - # Output dep list generated using the flattened pom (only 'compile' and 'runtime' scopes) - msg "Generating dependency list using flattened pom..." - mvn dependency:list -f .flattened-pom.xml -DexcludeArtifactIds=error_prone_annotations -DincludeScope=runtime -Dsort=true | grep '\[INFO] .*:.*:.*:.*:.*' >.new-list.txt - - # Compare two dependency lists - msg "Comparing dependency lists..." - diff .org-list.txt .new-list.txt >.diff.txt - if [[ $? == 0 ]] - then - msg "Success. No diff!" - else - msg "Diff found. See below: " - msg "You can also check .diff.txt file located in $1." - cat .diff.txt - return 1 - fi -} - -# Allow failures to continue running the script -set +e - -error_count=0 -for path in **/.flattened-pom.xml -do - # Check flattened pom in each dir that contains it for completeness - dir=$(dirname "$path") - pushd "$dir" - completenessCheck "$dir" - error_count=$(($error_count + $?)) - popd -done - -if [[ $error_count == 0 ]] -then - msg "All checks passed." - exit 0 -else - msg "Errors found. See log statements above." - exit 1 -fi diff --git a/java-common-protos/.kokoro/nightly/common.cfg b/java-common-protos/.kokoro/nightly/common.cfg deleted file mode 100644 index d8e6ffc95f..0000000000 --- a/java-common-protos/.kokoro/nightly/common.cfg +++ /dev/null @@ -1,25 +0,0 @@ -# Format: //devtools/kokoro/config/proto/build.proto - -# Build logs will be here -action { - define_artifacts { - regex: "**/*sponge_log.xml" - regex: "**/*sponge_log.txt" - } -} - -# Download trampoline resources. -gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/trampoline" - -# Use the trampoline script to run in docker. -build_file: "java-common-protos/.kokoro/trampoline.sh" - -env_vars: { - key: "TRAMPOLINE_BUILD_FILE" - value: "github/java-common-protos/.kokoro/build.sh" -} - -env_vars: { - key: "JOB_TYPE" - value: "test" -} diff --git a/java-common-protos/.kokoro/nightly/integration.cfg b/java-common-protos/.kokoro/nightly/integration.cfg deleted file mode 100644 index a2907a257b..0000000000 --- a/java-common-protos/.kokoro/nightly/integration.cfg +++ /dev/null @@ -1,37 +0,0 @@ -# Format: //devtools/kokoro/config/proto/build.proto - -# Configure the docker image for kokoro-trampoline. -env_vars: { - key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-kokoro-resources/java8" -} - -env_vars: { - key: "JOB_TYPE" - value: "integration" -} -# TODO: remove this after we've migrated all tests and scripts -env_vars: { - key: "GCLOUD_PROJECT" - value: "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-common-protos/.kokoro/nightly/java11-integration.cfg b/java-common-protos/.kokoro/nightly/java11-integration.cfg deleted file mode 100644 index 58049cc38f..0000000000 --- a/java-common-protos/.kokoro/nightly/java11-integration.cfg +++ /dev/null @@ -1,37 +0,0 @@ -# Format: //devtools/kokoro/config/proto/build.proto - -# Configure the docker image for kokoro-trampoline. -env_vars: { - key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-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-common-protos/.kokoro/nightly/java11.cfg b/java-common-protos/.kokoro/nightly/java11.cfg deleted file mode 100644 index 709f2b4c73..0000000000 --- a/java-common-protos/.kokoro/nightly/java11.cfg +++ /dev/null @@ -1,7 +0,0 @@ -# Format: //devtools/kokoro/config/proto/build.proto - -# Configure the docker image for kokoro-trampoline. -env_vars: { - key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-kokoro-resources/java11" -} diff --git a/java-common-protos/.kokoro/nightly/java7.cfg b/java-common-protos/.kokoro/nightly/java7.cfg deleted file mode 100644 index cb24f44eea..0000000000 --- a/java-common-protos/.kokoro/nightly/java7.cfg +++ /dev/null @@ -1,7 +0,0 @@ -# Format: //devtools/kokoro/config/proto/build.proto - -# Configure the docker image for kokoro-trampoline. -env_vars: { - key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-kokoro-resources/java7" -} diff --git a/java-common-protos/.kokoro/nightly/java8-osx.cfg b/java-common-protos/.kokoro/nightly/java8-osx.cfg deleted file mode 100644 index a2205705c0..0000000000 --- a/java-common-protos/.kokoro/nightly/java8-osx.cfg +++ /dev/null @@ -1,3 +0,0 @@ -# Format: //devtools/kokoro/config/proto/build.proto - -build_file: "java-common-protos/.kokoro/build.sh" diff --git a/java-common-protos/.kokoro/nightly/java8-win.cfg b/java-common-protos/.kokoro/nightly/java8-win.cfg deleted file mode 100644 index 55d4ada741..0000000000 --- a/java-common-protos/.kokoro/nightly/java8-win.cfg +++ /dev/null @@ -1,3 +0,0 @@ -# Format: //devtools/kokoro/config/proto/build.proto - -build_file: "java-common-protos/.kokoro/build.bat" diff --git a/java-common-protos/.kokoro/nightly/java8.cfg b/java-common-protos/.kokoro/nightly/java8.cfg deleted file mode 100644 index 495cc7bacd..0000000000 --- a/java-common-protos/.kokoro/nightly/java8.cfg +++ /dev/null @@ -1,12 +0,0 @@ -# Format: //devtools/kokoro/config/proto/build.proto - -# Configure the docker image for kokoro-trampoline. -env_vars: { - key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-kokoro-resources/java8" -} - -env_vars: { - key: "REPORT_COVERAGE" - value: "true" -} diff --git a/java-common-protos/.kokoro/nightly/samples.cfg b/java-common-protos/.kokoro/nightly/samples.cfg deleted file mode 100644 index 9761fd8648..0000000000 --- a/java-common-protos/.kokoro/nightly/samples.cfg +++ /dev/null @@ -1,38 +0,0 @@ -# Format: //devtools/kokoro/config/proto/build.proto - -# Configure the docker image for kokoro-trampoline. -env_vars: { - key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-kokoro-resources/java8" -} - -env_vars: { - key: "JOB_TYPE" - value: "samples" -} - -# TODO: remove this after we've migrated all tests and scripts -env_vars: { - key: "GCLOUD_PROJECT" - value: "java-docs-samples-testing" -} - -env_vars: { - key: "GOOGLE_CLOUD_PROJECT" - value: "java-docs-samples-testing" -} - -env_vars: { - key: "GOOGLE_APPLICATION_CREDENTIALS" - value: "secret_manager/java-docs-samples-service-account" -} - -env_vars: { - key: "SECRET_MANAGER_KEYS" - value: "java-docs-samples-service-account" -} - -env_vars: { - key: "ENABLE_FLAKYBOT" - value: "true" -} diff --git a/java-common-protos/.kokoro/populate-secrets.sh b/java-common-protos/.kokoro/populate-secrets.sh deleted file mode 100755 index f52514257e..0000000000 --- a/java-common-protos/.kokoro/populate-secrets.sh +++ /dev/null @@ -1,43 +0,0 @@ -#!/bin/bash -# Copyright 2020 Google LLC. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -set -eo pipefail - -function now { date +"%Y-%m-%d %H:%M:%S" | tr -d '\n' ;} -function msg { println "$*" >&2 ;} -function println { printf '%s\n' "$(now) $*" ;} - - -# Populates requested secrets set in SECRET_MANAGER_KEYS from service account: -# kokoro-trampoline@cloud-devrel-kokoro-resources.iam.gserviceaccount.com -SECRET_LOCATION="${KOKORO_GFILE_DIR}/secret_manager" -msg "Creating folder on disk for secrets: ${SECRET_LOCATION}" -mkdir -p ${SECRET_LOCATION} -for key in $(echo ${SECRET_MANAGER_KEYS} | sed "s/,/ /g") -do - msg "Retrieving secret ${key}" - docker run --entrypoint=gcloud \ - --volume=${KOKORO_GFILE_DIR}:${KOKORO_GFILE_DIR} \ - gcr.io/google.com/cloudsdktool/cloud-sdk \ - secrets versions access latest \ - --project cloud-devrel-kokoro-resources \ - --secret ${key} > \ - "${SECRET_LOCATION}/${key}" - if [[ $? == 0 ]]; then - msg "Secret written to ${SECRET_LOCATION}/${key}" - else - msg "Error retrieving secret ${key}" - fi -done diff --git a/java-common-protos/.kokoro/presubmit/clirr.cfg b/java-common-protos/.kokoro/presubmit/clirr.cfg deleted file mode 100644 index ec572442e2..0000000000 --- a/java-common-protos/.kokoro/presubmit/clirr.cfg +++ /dev/null @@ -1,13 +0,0 @@ -# Format: //devtools/kokoro/config/proto/build.proto - -# Configure the docker image for kokoro-trampoline. - -env_vars: { - key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-kokoro-resources/java8" -} - -env_vars: { - key: "JOB_TYPE" - value: "clirr" -} \ No newline at end of file diff --git a/java-common-protos/.kokoro/presubmit/common.cfg b/java-common-protos/.kokoro/presubmit/common.cfg deleted file mode 100644 index 28a4e14b40..0000000000 --- a/java-common-protos/.kokoro/presubmit/common.cfg +++ /dev/null @@ -1,34 +0,0 @@ -# Format: //devtools/kokoro/config/proto/build.proto - -# Build logs will be here -action { - define_artifacts { - regex: "**/*sponge_log.xml" - regex: "**/*sponge_log.txt" - } -} - -# Download trampoline resources. -gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/trampoline" - -# Use the trampoline script to run in docker. -build_file: "java-common-protos/.kokoro/trampoline.sh" - -env_vars: { - key: "TRAMPOLINE_BUILD_FILE" - value: "github/java-common-protos/.kokoro/build.sh" -} - -env_vars: { - key: "JOB_TYPE" - value: "test" -} - -before_action { - fetch_keystore { - keystore_resource { - keystore_config_id: 73713 - keyname: "dpebot_codecov_token" - } - } -} diff --git a/java-common-protos/.kokoro/presubmit/dependencies.cfg b/java-common-protos/.kokoro/presubmit/dependencies.cfg deleted file mode 100644 index 5d388a2c58..0000000000 --- a/java-common-protos/.kokoro/presubmit/dependencies.cfg +++ /dev/null @@ -1,12 +0,0 @@ -# Format: //devtools/kokoro/config/proto/build.proto - -# Configure the docker image for kokoro-trampoline. -env_vars: { - key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-kokoro-resources/java8" -} - -env_vars: { - key: "TRAMPOLINE_BUILD_FILE" - value: "github/java-common-protos/.kokoro/dependencies.sh" -} diff --git a/java-common-protos/.kokoro/presubmit/graalvm-native-17.cfg b/java-common-protos/.kokoro/presubmit/graalvm-native-17.cfg deleted file mode 100644 index a3f7fb9d49..0000000000 --- a/java-common-protos/.kokoro/presubmit/graalvm-native-17.cfg +++ /dev/null @@ -1,33 +0,0 @@ -# Format: //devtools/kokoro/config/proto/build.proto - -# Configure the docker image for kokoro-trampoline. -env_vars: { - key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-kokoro-resources/graalvm17" -} - -env_vars: { - key: "JOB_TYPE" - value: "graalvm17" -} - -# 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" -} \ No newline at end of file diff --git a/java-common-protos/.kokoro/presubmit/graalvm-native.cfg b/java-common-protos/.kokoro/presubmit/graalvm-native.cfg deleted file mode 100644 index 4c7225ec92..0000000000 --- a/java-common-protos/.kokoro/presubmit/graalvm-native.cfg +++ /dev/null @@ -1,33 +0,0 @@ -# Format: //devtools/kokoro/config/proto/build.proto - -# Configure the docker image for kokoro-trampoline. -env_vars: { - key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-kokoro-resources/graalvm" -} - -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" -} diff --git a/java-common-protos/.kokoro/presubmit/integration.cfg b/java-common-protos/.kokoro/presubmit/integration.cfg deleted file mode 100644 index dded67a9d5..0000000000 --- a/java-common-protos/.kokoro/presubmit/integration.cfg +++ /dev/null @@ -1,33 +0,0 @@ -# Format: //devtools/kokoro/config/proto/build.proto - -# Configure the docker image for kokoro-trampoline. -env_vars: { - key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-kokoro-resources/java8" -} - -env_vars: { - key: "JOB_TYPE" - value: "integration" -} - -# TODO: remove this after we've migrated all tests and scripts -env_vars: { - key: "GCLOUD_PROJECT" - value: "gcloud-devel" -} - -env_vars: { - key: "GOOGLE_CLOUD_PROJECT" - value: "gcloud-devel" -} - -env_vars: { - key: "GOOGLE_APPLICATION_CREDENTIALS" - value: "secret_manager/java-it-service-account" -} - -env_vars: { - key: "SECRET_MANAGER_KEYS" - value: "java-it-service-account" -} diff --git a/java-common-protos/.kokoro/presubmit/java11.cfg b/java-common-protos/.kokoro/presubmit/java11.cfg deleted file mode 100644 index 709f2b4c73..0000000000 --- a/java-common-protos/.kokoro/presubmit/java11.cfg +++ /dev/null @@ -1,7 +0,0 @@ -# Format: //devtools/kokoro/config/proto/build.proto - -# Configure the docker image for kokoro-trampoline. -env_vars: { - key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-kokoro-resources/java11" -} diff --git a/java-common-protos/.kokoro/presubmit/java7.cfg b/java-common-protos/.kokoro/presubmit/java7.cfg deleted file mode 100644 index cb24f44eea..0000000000 --- a/java-common-protos/.kokoro/presubmit/java7.cfg +++ /dev/null @@ -1,7 +0,0 @@ -# Format: //devtools/kokoro/config/proto/build.proto - -# Configure the docker image for kokoro-trampoline. -env_vars: { - key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-kokoro-resources/java7" -} diff --git a/java-common-protos/.kokoro/presubmit/java8-osx.cfg b/java-common-protos/.kokoro/presubmit/java8-osx.cfg deleted file mode 100644 index a2205705c0..0000000000 --- a/java-common-protos/.kokoro/presubmit/java8-osx.cfg +++ /dev/null @@ -1,3 +0,0 @@ -# Format: //devtools/kokoro/config/proto/build.proto - -build_file: "java-common-protos/.kokoro/build.sh" diff --git a/java-common-protos/.kokoro/presubmit/java8-win.cfg b/java-common-protos/.kokoro/presubmit/java8-win.cfg deleted file mode 100644 index 55d4ada741..0000000000 --- a/java-common-protos/.kokoro/presubmit/java8-win.cfg +++ /dev/null @@ -1,3 +0,0 @@ -# Format: //devtools/kokoro/config/proto/build.proto - -build_file: "java-common-protos/.kokoro/build.bat" diff --git a/java-common-protos/.kokoro/presubmit/java8.cfg b/java-common-protos/.kokoro/presubmit/java8.cfg deleted file mode 100644 index 495cc7bacd..0000000000 --- a/java-common-protos/.kokoro/presubmit/java8.cfg +++ /dev/null @@ -1,12 +0,0 @@ -# Format: //devtools/kokoro/config/proto/build.proto - -# Configure the docker image for kokoro-trampoline. -env_vars: { - key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-kokoro-resources/java8" -} - -env_vars: { - key: "REPORT_COVERAGE" - value: "true" -} diff --git a/java-common-protos/.kokoro/presubmit/linkage-monitor.cfg b/java-common-protos/.kokoro/presubmit/linkage-monitor.cfg deleted file mode 100644 index 1ed21488fa..0000000000 --- a/java-common-protos/.kokoro/presubmit/linkage-monitor.cfg +++ /dev/null @@ -1,12 +0,0 @@ -# Format: //devtools/kokoro/config/proto/build.proto - -# Configure the docker image for kokoro-trampoline. -env_vars: { - key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-kokoro-resources/java8" -} - -env_vars: { - key: "TRAMPOLINE_BUILD_FILE" - value: "github/java-common-protos/.kokoro/linkage-monitor.sh" -} \ No newline at end of file diff --git a/java-common-protos/.kokoro/presubmit/lint.cfg b/java-common-protos/.kokoro/presubmit/lint.cfg deleted file mode 100644 index 6d323c8ae7..0000000000 --- a/java-common-protos/.kokoro/presubmit/lint.cfg +++ /dev/null @@ -1,13 +0,0 @@ -# Format: //devtools/kokoro/config/proto/build.proto - -# Configure the docker image for kokoro-trampoline. - -env_vars: { - key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-kokoro-resources/java8" -} - -env_vars: { - key: "JOB_TYPE" - value: "lint" -} \ No newline at end of file diff --git a/java-common-protos/.kokoro/presubmit/samples.cfg b/java-common-protos/.kokoro/presubmit/samples.cfg deleted file mode 100644 index 01e0960047..0000000000 --- a/java-common-protos/.kokoro/presubmit/samples.cfg +++ /dev/null @@ -1,33 +0,0 @@ -# Format: //devtools/kokoro/config/proto/build.proto - -# Configure the docker image for kokoro-trampoline. -env_vars: { - key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-kokoro-resources/java8" -} - -env_vars: { - key: "JOB_TYPE" - value: "samples" -} - -# TODO: remove this after we've migrated all tests and scripts -env_vars: { - key: "GCLOUD_PROJECT" - value: "java-docs-samples-testing" -} - -env_vars: { - key: "GOOGLE_CLOUD_PROJECT" - value: "java-docs-samples-testing" -} - -env_vars: { - key: "GOOGLE_APPLICATION_CREDENTIALS" - value: "secret_manager/java-docs-samples-service-account" -} - -env_vars: { - key: "SECRET_MANAGER_KEYS" - value: "java-docs-samples-service-account" -} \ No newline at end of file diff --git a/java-common-protos/.kokoro/readme.sh b/java-common-protos/.kokoro/readme.sh deleted file mode 100755 index b6bd70ccb1..0000000000 --- a/java-common-protos/.kokoro/readme.sh +++ /dev/null @@ -1,45 +0,0 @@ -#!/bin/bash -# Copyright 2020 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -set -eo pipefail - -cd ${KOKORO_ARTIFACTS_DIR}/github/java-common-protos - -# 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-common-protos \ - --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-common-protos/.kokoro/release/bump_snapshot.cfg b/java-common-protos/.kokoro/release/bump_snapshot.cfg deleted file mode 100644 index 3de8138d9c..0000000000 --- a/java-common-protos/.kokoro/release/bump_snapshot.cfg +++ /dev/null @@ -1,53 +0,0 @@ -# Format: //devtools/kokoro/config/proto/build.proto - -# Build logs will be here -action { - define_artifacts { - regex: "**/*sponge_log.xml" - } -} - -# Download trampoline resources. -gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/trampoline" - -# Use the trampoline script to run in docker. -build_file: "java-common-protos/.kokoro/trampoline.sh" - -# Configure the docker image for kokoro-trampoline. -env_vars: { - key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-kokoro-resources/node:10-user" -} - -env_vars: { - key: "TRAMPOLINE_BUILD_FILE" - value: "github/java-common-protos/.kokoro/release/bump_snapshot.sh" -} - -# tokens used by release-please to keep an up-to-date release PR. -before_action { - fetch_keystore { - keystore_resource { - keystore_config_id: 73713 - keyname: "github-magic-proxy-key-release-please" - } - } -} - -before_action { - fetch_keystore { - keystore_resource { - keystore_config_id: 73713 - keyname: "github-magic-proxy-token-release-please" - } - } -} - -before_action { - fetch_keystore { - keystore_resource { - keystore_config_id: 73713 - keyname: "github-magic-proxy-url-release-please" - } - } -} diff --git a/java-common-protos/.kokoro/release/common.cfg b/java-common-protos/.kokoro/release/common.cfg deleted file mode 100644 index e676934592..0000000000 --- a/java-common-protos/.kokoro/release/common.cfg +++ /dev/null @@ -1,49 +0,0 @@ -# Format: //devtools/kokoro/config/proto/build.proto - -# Download trampoline resources. -gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/trampoline" - -# Use the trampoline script to run in docker. -build_file: "java-common-protos/.kokoro/trampoline.sh" - -# Configure the docker image for kokoro-trampoline. -env_vars: { - key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-kokoro-resources/java8" -} - -before_action { - fetch_keystore { - keystore_resource { - keystore_config_id: 70247 - keyname: "maven-gpg-keyring" - } - } -} - -before_action { - fetch_keystore { - keystore_resource { - keystore_config_id: 70247 - keyname: "maven-gpg-passphrase" - } - } -} - -before_action { - fetch_keystore { - keystore_resource { - keystore_config_id: 70247 - keyname: "maven-gpg-pubkeyring" - } - } -} - -before_action { - fetch_keystore { - keystore_resource { - keystore_config_id: 70247 - keyname: "sonatype-credentials" - } - } -} diff --git a/java-common-protos/.kokoro/release/common.sh b/java-common-protos/.kokoro/release/common.sh deleted file mode 100755 index 7f78ee414f..0000000000 --- a/java-common-protos/.kokoro/release/common.sh +++ /dev/null @@ -1,50 +0,0 @@ -#!/bin/bash -# Copyright 2018 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -set -eo pipefail - -# Get secrets from keystore and set and environment variables -setup_environment_secrets() { - export GPG_PASSPHRASE=$(cat ${KOKORO_KEYSTORE_DIR}/70247_maven-gpg-passphrase) - export GPG_TTY=$(tty) - export GPG_HOMEDIR=/gpg - mkdir $GPG_HOMEDIR - mv ${KOKORO_KEYSTORE_DIR}/70247_maven-gpg-pubkeyring $GPG_HOMEDIR/pubring.gpg - mv ${KOKORO_KEYSTORE_DIR}/70247_maven-gpg-keyring $GPG_HOMEDIR/secring.gpg - export SONATYPE_USERNAME=$(cat ${KOKORO_KEYSTORE_DIR}/70247_sonatype-credentials | cut -f1 -d'|') - export SONATYPE_PASSWORD=$(cat ${KOKORO_KEYSTORE_DIR}/70247_sonatype-credentials | cut -f2 -d'|') -} - -create_settings_xml_file() { - echo " - - - ossrh - ${SONATYPE_USERNAME} - ${SONATYPE_PASSWORD} - - - sonatype-nexus-staging - ${SONATYPE_USERNAME} - ${SONATYPE_PASSWORD} - - - sonatype-nexus-snapshots - ${SONATYPE_USERNAME} - ${SONATYPE_PASSWORD} - - -" > $1 -} \ No newline at end of file diff --git a/java-common-protos/.kokoro/release/drop.cfg b/java-common-protos/.kokoro/release/drop.cfg deleted file mode 100644 index 1faccd52ec..0000000000 --- a/java-common-protos/.kokoro/release/drop.cfg +++ /dev/null @@ -1,6 +0,0 @@ -# Format: //devtools/kokoro/config/proto/build.proto - -env_vars: { - key: "TRAMPOLINE_BUILD_FILE" - value: "github/java-common-protos/.kokoro/release/drop.sh" -} diff --git a/java-common-protos/.kokoro/release/drop.sh b/java-common-protos/.kokoro/release/drop.sh deleted file mode 100755 index 742ec1a886..0000000000 --- a/java-common-protos/.kokoro/release/drop.sh +++ /dev/null @@ -1,32 +0,0 @@ -#!/bin/bash -# Copyright 2018 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -set -eo pipefail - -# STAGING_REPOSITORY_ID must be set -if [ -z "${STAGING_REPOSITORY_ID}" ]; then - echo "Missing STAGING_REPOSITORY_ID environment variable" - exit 1 -fi - -source $(dirname "$0")/common.sh -pushd $(dirname "$0")/../../ - -setup_environment_secrets -create_settings_xml_file "settings.xml" - -mvn nexus-staging:drop -B \ - --settings=settings.xml \ - -DstagingRepositoryId=${STAGING_REPOSITORY_ID} diff --git a/java-common-protos/.kokoro/release/promote.cfg b/java-common-protos/.kokoro/release/promote.cfg deleted file mode 100644 index 240e75aa5d..0000000000 --- a/java-common-protos/.kokoro/release/promote.cfg +++ /dev/null @@ -1,6 +0,0 @@ -# Format: //devtools/kokoro/config/proto/build.proto - -env_vars: { - key: "TRAMPOLINE_BUILD_FILE" - value: "github/java-common-protos/.kokoro/release/promote.sh" -} diff --git a/java-common-protos/.kokoro/release/promote.sh b/java-common-protos/.kokoro/release/promote.sh deleted file mode 100755 index 3cac3d8a97..0000000000 --- a/java-common-protos/.kokoro/release/promote.sh +++ /dev/null @@ -1,34 +0,0 @@ -#!/bin/bash -# Copyright 2018 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -set -eo pipefail - -# STAGING_REPOSITORY_ID must be set -if [ -z "${STAGING_REPOSITORY_ID}" ]; then - echo "Missing STAGING_REPOSITORY_ID environment variable" - exit 1 -fi - -source $(dirname "$0")/common.sh - -pushd $(dirname "$0")/../../ - -setup_environment_secrets -create_settings_xml_file "settings.xml" - -mvn nexus-staging:release -B \ - -DperformRelease=true \ - --settings=settings.xml \ - -DstagingRepositoryId=${STAGING_REPOSITORY_ID} diff --git a/java-common-protos/.kokoro/release/publish_javadoc.cfg b/java-common-protos/.kokoro/release/publish_javadoc.cfg deleted file mode 100644 index 295aa525a0..0000000000 --- a/java-common-protos/.kokoro/release/publish_javadoc.cfg +++ /dev/null @@ -1,23 +0,0 @@ -# Format: //devtools/kokoro/config/proto/build.proto - -gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/doc-templates/" - -env_vars: { - key: "STAGING_BUCKET" - value: "docs-staging" -} - -env_vars: { - key: "TRAMPOLINE_BUILD_FILE" - value: "github/java-common-protos/.kokoro/release/publish_javadoc.sh" -} - - -before_action { - fetch_keystore { - keystore_resource { - keystore_config_id: 73713 - keyname: "docuploader_service_account" - } - } -} diff --git a/java-common-protos/.kokoro/release/publish_javadoc.sh b/java-common-protos/.kokoro/release/publish_javadoc.sh deleted file mode 100755 index 9d4ce4ae34..0000000000 --- a/java-common-protos/.kokoro/release/publish_javadoc.sh +++ /dev/null @@ -1,53 +0,0 @@ -#!/bin/bash -# Copyright 2019 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -set -eo pipefail - -if [[ -z "${CREDENTIALS}" ]]; then - CREDENTIALS=${KOKORO_KEYSTORE_DIR}/73713_docuploader_service_account -fi - -if [[ -z "${STAGING_BUCKET}" ]]; then - echo "Need to set STAGING_BUCKET environment variable" - exit 1 -fi - -# work from the git root directory -pushd $(dirname "$0")/../../ - -# install docuploader package -python3 -m pip install --require-hashes -r .kokoro/requirements.txt - -# compile all packages -mvn clean install -B -q -DskipTests=true - -export NAME=proto-google-common-protos -export VERSION=$(grep ${NAME}: versions.txt | cut -d: -f3) - -# build the docs -mvn site -B -q - -pushd target/site/apidocs - -# create metadata -python3 -m docuploader create-metadata \ - --name ${NAME} \ - --version ${VERSION} \ - --language java - -# upload docs -python3 -m docuploader upload . \ - --credentials ${CREDENTIALS} \ - --staging-bucket ${STAGING_BUCKET} diff --git a/java-common-protos/.kokoro/release/publish_javadoc11.cfg b/java-common-protos/.kokoro/release/publish_javadoc11.cfg deleted file mode 100644 index b5372c604a..0000000000 --- a/java-common-protos/.kokoro/release/publish_javadoc11.cfg +++ /dev/null @@ -1,30 +0,0 @@ -# Format: //devtools/kokoro/config/proto/build.proto - -# cloud-rad production -env_vars: { - key: "STAGING_BUCKET_V2" - value: "docs-staging-v2" -} - -# Configure the docker image for kokoro-trampoline -env_vars: { - key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-kokoro-resources/java11" -} - -env_vars: { - key: "TRAMPOLINE_BUILD_FILE" - value: "github/java-common-protos/.kokoro/release/publish_javadoc11.sh" -} - -before_action { - fetch_keystore { - keystore_resource { - keystore_config_id: 73713 - keyname: "docuploader_service_account" - } - } -} - -# Downloads docfx doclet resource. This will be in ${KOKORO_GFILE_DIR}/ -gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/docfx" diff --git a/java-common-protos/.kokoro/release/publish_javadoc11.sh b/java-common-protos/.kokoro/release/publish_javadoc11.sh deleted file mode 100755 index 69c00bfb17..0000000000 --- a/java-common-protos/.kokoro/release/publish_javadoc11.sh +++ /dev/null @@ -1,63 +0,0 @@ -#!/bin/bash -# Copyright 2021 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -set -eo pipefail - -if [[ -z "${CREDENTIALS}" ]]; then - CREDENTIALS=${KOKORO_KEYSTORE_DIR}/73713_docuploader_service_account -fi - -if [[ -z "${STAGING_BUCKET_V2}" ]]; then - echo "Need to set STAGING_BUCKET_V2 environment variable" - exit 1 -fi - -# work from the git root directory -pushd $(dirname "$0")/../../ - -# install docuploader package -python3 -m pip install --require-hashes -r .kokoro/requirements.txt - -# compile all packages -mvn clean install -B -q -DskipTests=true - -export NAME=proto-google-common-protos -export VERSION=$(grep ${NAME}: versions.txt | cut -d: -f3) - -# cloud RAD generation -mvn clean javadoc:aggregate -B -q -P docFX -# include CHANGELOG -cp CHANGELOG.md target/docfx-yml/history.md - -pushd target/docfx-yml - -# create metadata -python3 -m docuploader create-metadata \ - --name ${NAME} \ - --version ${VERSION} \ - --xrefs devsite://java/gax \ - --xrefs devsite://java/google-cloud-core \ - --xrefs devsite://java/api-common \ - --xrefs devsite://java/proto-google-common-protos \ - --xrefs devsite://java/google-api-client \ - --xrefs devsite://java/google-http-client \ - --xrefs devsite://java/protobuf \ - --language java - -# upload yml to production bucket -python3 -m docuploader upload . \ - --credentials ${CREDENTIALS} \ - --staging-bucket ${STAGING_BUCKET_V2} \ - --destination-prefix docfx diff --git a/java-common-protos/.kokoro/release/snapshot.cfg b/java-common-protos/.kokoro/release/snapshot.cfg deleted file mode 100644 index 087a62896e..0000000000 --- a/java-common-protos/.kokoro/release/snapshot.cfg +++ /dev/null @@ -1,6 +0,0 @@ -# Format: //devtools/kokoro/config/proto/build.proto - -env_vars: { - key: "TRAMPOLINE_BUILD_FILE" - value: "github/java-common-protos/.kokoro/release/snapshot.sh" -} \ No newline at end of file diff --git a/java-common-protos/.kokoro/release/snapshot.sh b/java-common-protos/.kokoro/release/snapshot.sh deleted file mode 100755 index 1f55b77024..0000000000 --- a/java-common-protos/.kokoro/release/snapshot.sh +++ /dev/null @@ -1,33 +0,0 @@ -#!/bin/bash -# Copyright 2019 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -set -eo pipefail - -source $(dirname "$0")/common.sh -MAVEN_SETTINGS_FILE=$(realpath $(dirname "$0")/../../)/settings.xml -pushd $(dirname "$0")/../../ - -# ensure we're trying to push a snapshot (no-result returns non-zero exit code) -grep SNAPSHOT versions.txt - -setup_environment_secrets -create_settings_xml_file "settings.xml" - -mvn clean deploy -B \ - --settings ${MAVEN_SETTINGS_FILE} \ - -DperformRelease=true \ - -Dgpg.executable=gpg \ - -Dgpg.passphrase=${GPG_PASSPHRASE} \ - -Dgpg.homedir=${GPG_HOMEDIR} diff --git a/java-common-protos/.kokoro/release/stage.cfg b/java-common-protos/.kokoro/release/stage.cfg deleted file mode 100644 index 21a7e3cb58..0000000000 --- a/java-common-protos/.kokoro/release/stage.cfg +++ /dev/null @@ -1,19 +0,0 @@ -# Format: //devtools/kokoro/config/proto/build.proto - -env_vars: { - key: "TRAMPOLINE_BUILD_FILE" - value: "github/java-common-protos/.kokoro/release/stage.sh" -} - -# Need to save the properties file -action { - define_artifacts { - regex: "github/java-common-protos/target/nexus-staging/staging/*.properties" - strip_prefix: "github/java-common-protos" - } -} - -env_vars: { - key: "SECRET_MANAGER_KEYS" - value: "releasetool-publish-reporter-app,releasetool-publish-reporter-googleapis-installation,releasetool-publish-reporter-pem" -} diff --git a/java-common-protos/.kokoro/release/stage.sh b/java-common-protos/.kokoro/release/stage.sh deleted file mode 100755 index 61e714d6ba..0000000000 --- a/java-common-protos/.kokoro/release/stage.sh +++ /dev/null @@ -1,47 +0,0 @@ -#!/bin/bash -# Copyright 2018 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -set -eo pipefail - -# Start the releasetool reporter -requirementsFile=$(realpath $(dirname "${BASH_SOURCE[0]}")/../requirements.txt) -python3 -m pip install --require-hashes -r $requirementsFile -python3 -m releasetool publish-reporter-script > /tmp/publisher-script; source /tmp/publisher-script - -source $(dirname "$0")/common.sh -source $(dirname "$0")/../common.sh -MAVEN_SETTINGS_FILE=$(realpath $(dirname "$0")/../../)/settings.xml -pushd $(dirname "$0")/../../ - -setup_environment_secrets -create_settings_xml_file "settings.xml" - -# attempt to stage 3 times with exponential backoff (starting with 10 seconds) -retry_with_backoff 3 10 \ - mvn clean deploy -B \ - --settings ${MAVEN_SETTINGS_FILE} \ - -DskipTests=true \ - -Dclirr.skip=true \ - -DperformRelease=true \ - -Dgpg.executable=gpg \ - -Dgpg.passphrase=${GPG_PASSPHRASE} \ - -Dgpg.homedir=${GPG_HOMEDIR} - -if [[ -n "${AUTORELEASE_PR}" ]] -then - mvn nexus-staging:release -B \ - -DperformRelease=true \ - --settings=settings.xml -fi diff --git a/java-common-protos/.kokoro/requirements.in b/java-common-protos/.kokoro/requirements.in deleted file mode 100644 index 924f94ae6f..0000000000 --- a/java-common-protos/.kokoro/requirements.in +++ /dev/null @@ -1,34 +0,0 @@ -gcp-docuploader==0.6.3 -google-crc32c==1.3.0 -googleapis-common-protos==1.56.3 -gcp-releasetool==1.9.1 -cryptography==38.0.3 -cachetools==4.2.4 -cffi==1.15.1 -jeepney==0.7.1 -jinja2==3.0.3 -markupsafe==2.0.1 -keyring==23.4.1 -packaging==21.3 -protobuf==3.19.5 -pyjwt==2.4.0 -pyparsing==3.0.9 -pycparser==2.21 -pyperclip==1.8.2 -python-dateutil==2.8.2 -requests==2.27.1 -certifi==2022.9.24 -importlib-metadata==4.8.3 -zipp==3.6.0 -google_api_core==2.8.2 -google-cloud-storage==2.0.0 -google-resumable-media==2.3.3 -google-cloud-core==2.3.1 -typing-extensions==4.1.1 -urllib3==1.26.12 -zipp==3.6.0 -rsa==4.9 -six==1.16.0 -attrs==22.1.0 -google-auth==2.14.1 -idna==3.4 \ No newline at end of file diff --git a/java-common-protos/.kokoro/requirements.txt b/java-common-protos/.kokoro/requirements.txt deleted file mode 100644 index 71fcafc703..0000000000 --- a/java-common-protos/.kokoro/requirements.txt +++ /dev/null @@ -1,456 +0,0 @@ -# -# This file is autogenerated by pip-compile with python 3.10 -# To update, run: -# -# pip-compile --generate-hashes requirements.in -# -attrs==22.1.0 \ - --hash=sha256:29adc2665447e5191d0e7c568fde78b21f9672d344281d0c6e1ab085429b22b6 \ - --hash=sha256:86efa402f67bf2df34f51a335487cf46b1ec130d02b8d39fd248abfd30da551c - # via - # -r requirements.in - # gcp-releasetool -cachetools==4.2.4 \ - --hash=sha256:89ea6f1b638d5a73a4f9226be57ac5e4f399d22770b92355f92dcb0f7f001693 \ - --hash=sha256:92971d3cb7d2a97efff7c7bb1657f21a8f5fb309a37530537c71b1774189f2d1 - # via - # -r requirements.in - # google-auth -certifi==2022.9.24 \ - --hash=sha256:0d9c601124e5a6ba9712dbc60d9c53c21e34f5f641fe83002317394311bdce14 \ - --hash=sha256:90c1a32f1d68f940488354e36370f6cca89f0f106db09518524c88d6ed83f382 - # via - # -r requirements.in - # requests -cffi==1.15.1 \ - --hash=sha256:00a9ed42e88df81ffae7a8ab6d9356b371399b91dbdf0c3cb1e84c03a13aceb5 \ - --hash=sha256:03425bdae262c76aad70202debd780501fabeaca237cdfddc008987c0e0f59ef \ - --hash=sha256:04ed324bda3cda42b9b695d51bb7d54b680b9719cfab04227cdd1e04e5de3104 \ - --hash=sha256:0e2642fe3142e4cc4af0799748233ad6da94c62a8bec3a6648bf8ee68b1c7426 \ - --hash=sha256:173379135477dc8cac4bc58f45db08ab45d228b3363adb7af79436135d028405 \ - --hash=sha256:198caafb44239b60e252492445da556afafc7d1e3ab7a1fb3f0584ef6d742375 \ - --hash=sha256:1e74c6b51a9ed6589199c787bf5f9875612ca4a8a0785fb2d4a84429badaf22a \ - --hash=sha256:2012c72d854c2d03e45d06ae57f40d78e5770d252f195b93f581acf3ba44496e \ - --hash=sha256:21157295583fe8943475029ed5abdcf71eb3911894724e360acff1d61c1d54bc \ - --hash=sha256:2470043b93ff09bf8fb1d46d1cb756ce6132c54826661a32d4e4d132e1977adf \ - --hash=sha256:285d29981935eb726a4399badae8f0ffdff4f5050eaa6d0cfc3f64b857b77185 \ - --hash=sha256:30d78fbc8ebf9c92c9b7823ee18eb92f2e6ef79b45ac84db507f52fbe3ec4497 \ - --hash=sha256:320dab6e7cb2eacdf0e658569d2575c4dad258c0fcc794f46215e1e39f90f2c3 \ - --hash=sha256:33ab79603146aace82c2427da5ca6e58f2b3f2fb5da893ceac0c42218a40be35 \ - --hash=sha256:3548db281cd7d2561c9ad9984681c95f7b0e38881201e157833a2342c30d5e8c \ - --hash=sha256:3799aecf2e17cf585d977b780ce79ff0dc9b78d799fc694221ce814c2c19db83 \ - --hash=sha256:39d39875251ca8f612b6f33e6b1195af86d1b3e60086068be9cc053aa4376e21 \ - --hash=sha256:3b926aa83d1edb5aa5b427b4053dc420ec295a08e40911296b9eb1b6170f6cca \ - --hash=sha256:3bcde07039e586f91b45c88f8583ea7cf7a0770df3a1649627bf598332cb6984 \ - --hash=sha256:3d08afd128ddaa624a48cf2b859afef385b720bb4b43df214f85616922e6a5ac \ - --hash=sha256:3eb6971dcff08619f8d91607cfc726518b6fa2a9eba42856be181c6d0d9515fd \ - --hash=sha256:40f4774f5a9d4f5e344f31a32b5096977b5d48560c5592e2f3d2c4374bd543ee \ - --hash=sha256:4289fc34b2f5316fbb762d75362931e351941fa95fa18789191b33fc4cf9504a \ - --hash=sha256:470c103ae716238bbe698d67ad020e1db9d9dba34fa5a899b5e21577e6d52ed2 \ - --hash=sha256:4f2c9f67e9821cad2e5f480bc8d83b8742896f1242dba247911072d4fa94c192 \ - --hash=sha256:50a74364d85fd319352182ef59c5c790484a336f6db772c1a9231f1c3ed0cbd7 \ - --hash=sha256:54a2db7b78338edd780e7ef7f9f6c442500fb0d41a5a4ea24fff1c929d5af585 \ - --hash=sha256:5635bd9cb9731e6d4a1132a498dd34f764034a8ce60cef4f5319c0541159392f \ - --hash=sha256:59c0b02d0a6c384d453fece7566d1c7e6b7bae4fc5874ef2ef46d56776d61c9e \ - --hash=sha256:5d598b938678ebf3c67377cdd45e09d431369c3b1a5b331058c338e201f12b27 \ - --hash=sha256:5df2768244d19ab7f60546d0c7c63ce1581f7af8b5de3eb3004b9b6fc8a9f84b \ - --hash=sha256:5ef34d190326c3b1f822a5b7a45f6c4535e2f47ed06fec77d3d799c450b2651e \ - --hash=sha256:6975a3fac6bc83c4a65c9f9fcab9e47019a11d3d2cf7f3c0d03431bf145a941e \ - --hash=sha256:6c9a799e985904922a4d207a94eae35c78ebae90e128f0c4e521ce339396be9d \ - --hash=sha256:70df4e3b545a17496c9b3f41f5115e69a4f2e77e94e1d2a8e1070bc0c38c8a3c \ - --hash=sha256:7473e861101c9e72452f9bf8acb984947aa1661a7704553a9f6e4baa5ba64415 \ - --hash=sha256:8102eaf27e1e448db915d08afa8b41d6c7ca7a04b7d73af6514df10a3e74bd82 \ - --hash=sha256:87c450779d0914f2861b8526e035c5e6da0a3199d8f1add1a665e1cbc6fc6d02 \ - --hash=sha256:8b7ee99e510d7b66cdb6c593f21c043c248537a32e0bedf02e01e9553a172314 \ - --hash=sha256:91fc98adde3d7881af9b59ed0294046f3806221863722ba7d8d120c575314325 \ - --hash=sha256:94411f22c3985acaec6f83c6df553f2dbe17b698cc7f8ae751ff2237d96b9e3c \ - --hash=sha256:98d85c6a2bef81588d9227dde12db8a7f47f639f4a17c9ae08e773aa9c697bf3 \ - --hash=sha256:9ad5db27f9cabae298d151c85cf2bad1d359a1b9c686a275df03385758e2f914 \ - --hash=sha256:a0b71b1b8fbf2b96e41c4d990244165e2c9be83d54962a9a1d118fd8657d2045 \ - --hash=sha256:a0f100c8912c114ff53e1202d0078b425bee3649ae34d7b070e9697f93c5d52d \ - --hash=sha256:a591fe9e525846e4d154205572a029f653ada1a78b93697f3b5a8f1f2bc055b9 \ - --hash=sha256:a5c84c68147988265e60416b57fc83425a78058853509c1b0629c180094904a5 \ - --hash=sha256:a66d3508133af6e8548451b25058d5812812ec3798c886bf38ed24a98216fab2 \ - --hash=sha256:a8c4917bd7ad33e8eb21e9a5bbba979b49d9a97acb3a803092cbc1133e20343c \ - --hash=sha256:b3bbeb01c2b273cca1e1e0c5df57f12dce9a4dd331b4fa1635b8bec26350bde3 \ - --hash=sha256:cba9d6b9a7d64d4bd46167096fc9d2f835e25d7e4c121fb2ddfc6528fb0413b2 \ - --hash=sha256:cc4d65aeeaa04136a12677d3dd0b1c0c94dc43abac5860ab33cceb42b801c1e8 \ - --hash=sha256:ce4bcc037df4fc5e3d184794f27bdaab018943698f4ca31630bc7f84a7b69c6d \ - --hash=sha256:cec7d9412a9102bdc577382c3929b337320c4c4c4849f2c5cdd14d7368c5562d \ - --hash=sha256:d400bfb9a37b1351253cb402671cea7e89bdecc294e8016a707f6d1d8ac934f9 \ - --hash=sha256:d61f4695e6c866a23a21acab0509af1cdfd2c013cf256bbf5b6b5e2695827162 \ - --hash=sha256:db0fbb9c62743ce59a9ff687eb5f4afbe77e5e8403d6697f7446e5f609976f76 \ - --hash=sha256:dd86c085fae2efd48ac91dd7ccffcfc0571387fe1193d33b6394db7ef31fe2a4 \ - --hash=sha256:e00b098126fd45523dd056d2efba6c5a63b71ffe9f2bbe1a4fe1716e1d0c331e \ - --hash=sha256:e229a521186c75c8ad9490854fd8bbdd9a0c9aa3a524326b55be83b54d4e0ad9 \ - --hash=sha256:e263d77ee3dd201c3a142934a086a4450861778baaeeb45db4591ef65550b0a6 \ - --hash=sha256:ed9cb427ba5504c1dc15ede7d516b84757c3e3d7868ccc85121d9310d27eed0b \ - --hash=sha256:fa6693661a4c91757f4412306191b6dc88c1703f780c8234035eac011922bc01 \ - --hash=sha256:fcd131dd944808b5bdb38e6f5b53013c5aa4f334c5cad0c72742f6eba4b73db0 - # via - # -r requirements.in - # cryptography -charset-normalizer==2.0.12 \ - --hash=sha256:2857e29ff0d34db842cd7ca3230549d1a697f96ee6d3fb071cfa6c7393832597 \ - --hash=sha256:6881edbebdb17b39b4eaaa821b438bf6eddffb4468cf344f09f89def34a8b1df - # via requests -click==8.0.4 \ - --hash=sha256:6a7a62563bbfabfda3a38f3023a1db4a35978c0abd76f6c9605ecd6554d6d9b1 \ - --hash=sha256:8458d7b1287c5fb128c90e23381cf99dcde74beaf6c7ff6384ce84d6fe090adb - # via - # gcp-docuploader - # gcp-releasetool -colorlog==6.7.0 \ - --hash=sha256:0d33ca236784a1ba3ff9c532d4964126d8a2c44f1f0cb1d2b0728196f512f662 \ - --hash=sha256:bd94bd21c1e13fac7bd3153f4bc3a7dc0eb0974b8bc2fdf1a989e474f6e582e5 - # via gcp-docuploader -cryptography==38.0.3 \ - --hash=sha256:068147f32fa662c81aebab95c74679b401b12b57494872886eb5c1139250ec5d \ - --hash=sha256:06fc3cc7b6f6cca87bd56ec80a580c88f1da5306f505876a71c8cfa7050257dd \ - --hash=sha256:25c1d1f19729fb09d42e06b4bf9895212292cb27bb50229f5aa64d039ab29146 \ - --hash=sha256:402852a0aea73833d982cabb6d0c3bb582c15483d29fb7085ef2c42bfa7e38d7 \ - --hash=sha256:4e269dcd9b102c5a3d72be3c45d8ce20377b8076a43cbed6f660a1afe365e436 \ - --hash=sha256:5419a127426084933076132d317911e3c6eb77568a1ce23c3ac1e12d111e61e0 \ - --hash=sha256:554bec92ee7d1e9d10ded2f7e92a5d70c1f74ba9524947c0ba0c850c7b011828 \ - --hash=sha256:5e89468fbd2fcd733b5899333bc54d0d06c80e04cd23d8c6f3e0542358c6060b \ - --hash=sha256:65535bc550b70bd6271984d9863a37741352b4aad6fb1b3344a54e6950249b55 \ - --hash=sha256:6ab9516b85bebe7aa83f309bacc5f44a61eeb90d0b4ec125d2d003ce41932d36 \ - --hash=sha256:6addc3b6d593cd980989261dc1cce38263c76954d758c3c94de51f1e010c9a50 \ - --hash=sha256:728f2694fa743a996d7784a6194da430f197d5c58e2f4e278612b359f455e4a2 \ - --hash=sha256:785e4056b5a8b28f05a533fab69febf5004458e20dad7e2e13a3120d8ecec75a \ - --hash=sha256:78cf5eefac2b52c10398a42765bfa981ce2372cbc0457e6bf9658f41ec3c41d8 \ - --hash=sha256:7f836217000342d448e1c9a342e9163149e45d5b5eca76a30e84503a5a96cab0 \ - --hash=sha256:8d41a46251bf0634e21fac50ffd643216ccecfaf3701a063257fe0b2be1b6548 \ - --hash=sha256:984fe150f350a3c91e84de405fe49e688aa6092b3525f407a18b9646f6612320 \ - --hash=sha256:9b24bcff7853ed18a63cfb0c2b008936a9554af24af2fb146e16d8e1aed75748 \ - --hash=sha256:b1b35d9d3a65542ed2e9d90115dfd16bbc027b3f07ee3304fc83580f26e43249 \ - --hash=sha256:b1b52c9e5f8aa2b802d48bd693190341fae201ea51c7a167d69fc48b60e8a959 \ - --hash=sha256:bbf203f1a814007ce24bd4d51362991d5cb90ba0c177a9c08825f2cc304d871f \ - --hash=sha256:be243c7e2bfcf6cc4cb350c0d5cdf15ca6383bbcb2a8ef51d3c9411a9d4386f0 \ - --hash=sha256:bfbe6ee19615b07a98b1d2287d6a6073f734735b49ee45b11324d85efc4d5cbd \ - --hash=sha256:c46837ea467ed1efea562bbeb543994c2d1f6e800785bd5a2c98bc096f5cb220 \ - --hash=sha256:dfb4f4dd568de1b6af9f4cda334adf7d72cf5bc052516e1b2608b683375dd95c \ - --hash=sha256:ed7b00096790213e09eb11c97cc6e2b757f15f3d2f85833cd2d3ec3fe37c1722 - # via - # -r requirements.in - # gcp-releasetool - # secretstorage -gcp-docuploader==0.6.3 \ - --hash=sha256:ba8c9d76b3bbac54b0311c503a373b00edc2dc02d6d54ea9507045adb8e870f7 \ - --hash=sha256:c0f5aaa82ce1854a386197e4e359b120ad6d4e57ae2c812fce42219a3288026b - # via -r requirements.in -gcp-releasetool==1.9.1 \ - --hash=sha256:952f4055d5d986b070ae2a71c4410b250000f9cc5a1e26398fcd55a5bbc5a15f \ - --hash=sha256:d0d3c814a97c1a237517e837d8cfa668ced8df4b882452578ecef4a4e79c583b - # via -r requirements.in -google-api-core==2.8.2 \ - --hash=sha256:06f7244c640322b508b125903bb5701bebabce8832f85aba9335ec00b3d02edc \ - --hash=sha256:93c6a91ccac79079ac6bbf8b74ee75db970cc899278b97d53bc012f35908cf50 - # via - # -r requirements.in - # google-cloud-core - # google-cloud-storage -google-auth==2.14.1 \ - --hash=sha256:f5d8701633bebc12e0deea4df8abd8aff31c28b355360597f7f2ee60f2e4d016 - # via - # -r requirements.in - # gcp-releasetool - # google-api-core - # google-cloud-core - # google-cloud-storage -google-cloud-core==2.3.1 \ - --hash=sha256:113ba4f492467d5bd442c8d724c1a25ad7384045c3178369038840ecdd19346c \ - --hash=sha256:34334359cb04187bdc80ddcf613e462dfd7a3aabbc3fe4d118517ab4b9303d53 - # via - # -r requirements.in - # google-cloud-storage -google-cloud-storage==2.0.0 \ - --hash=sha256:a57a15aead0f9dfbd4381f1bfdbe8bf89818a4bd75bab846cafcefb2db846c47 \ - --hash=sha256:ec4be60bb223a3a960f0d01697d849b86d91cad815a84915a32ed3635e93a5e7 - # via - # -r requirements.in - # gcp-docuploader -google-crc32c==1.3.0 \ - --hash=sha256:04e7c220798a72fd0f08242bc8d7a05986b2a08a0573396187fd32c1dcdd58b3 \ - --hash=sha256:05340b60bf05b574159e9bd940152a47d38af3fb43803ffe71f11d704b7696a6 \ - --hash=sha256:12674a4c3b56b706153a358eaa1018c4137a5a04635b92b4652440d3d7386206 \ - --hash=sha256:127f9cc3ac41b6a859bd9dc4321097b1a4f6aa7fdf71b4f9227b9e3ebffb4422 \ - --hash=sha256:13af315c3a0eec8bb8b8d80b8b128cb3fcd17d7e4edafc39647846345a3f003a \ - --hash=sha256:1926fd8de0acb9d15ee757175ce7242e235482a783cd4ec711cc999fc103c24e \ - --hash=sha256:226f2f9b8e128a6ca6a9af9b9e8384f7b53a801907425c9a292553a3a7218ce0 \ - --hash=sha256:276de6273eb074a35bc598f8efbc00c7869c5cf2e29c90748fccc8c898c244df \ - --hash=sha256:318f73f5484b5671f0c7f5f63741ab020a599504ed81d209b5c7129ee4667407 \ - --hash=sha256:3bbce1be3687bbfebe29abdb7631b83e6b25da3f4e1856a1611eb21854b689ea \ - --hash=sha256:42ae4781333e331a1743445931b08ebdad73e188fd554259e772556fc4937c48 \ - --hash=sha256:58be56ae0529c664cc04a9c76e68bb92b091e0194d6e3c50bea7e0f266f73713 \ - --hash=sha256:5da2c81575cc3ccf05d9830f9e8d3c70954819ca9a63828210498c0774fda1a3 \ - --hash=sha256:6311853aa2bba4064d0c28ca54e7b50c4d48e3de04f6770f6c60ebda1e975267 \ - --hash=sha256:650e2917660e696041ab3dcd7abac160b4121cd9a484c08406f24c5964099829 \ - --hash=sha256:6a4db36f9721fdf391646685ecffa404eb986cbe007a3289499020daf72e88a2 \ - --hash=sha256:779cbf1ce375b96111db98fca913c1f5ec11b1d870e529b1dc7354b2681a8c3a \ - --hash=sha256:7f6fe42536d9dcd3e2ffb9d3053f5d05221ae3bbcefbe472bdf2c71c793e3183 \ - --hash=sha256:891f712ce54e0d631370e1f4997b3f182f3368179198efc30d477c75d1f44942 \ - --hash=sha256:95c68a4b9b7828ba0428f8f7e3109c5d476ca44996ed9a5f8aac6269296e2d59 \ - --hash=sha256:96a8918a78d5d64e07c8ea4ed2bc44354e3f93f46a4866a40e8db934e4c0d74b \ - --hash=sha256:9c3cf890c3c0ecfe1510a452a165431b5831e24160c5fcf2071f0f85ca5a47cd \ - --hash=sha256:9f58099ad7affc0754ae42e6d87443299f15d739b0ce03c76f515153a5cda06c \ - --hash=sha256:a0b9e622c3b2b8d0ce32f77eba617ab0d6768b82836391e4f8f9e2074582bf02 \ - --hash=sha256:a7f9cbea4245ee36190f85fe1814e2d7b1e5f2186381b082f5d59f99b7f11328 \ - --hash=sha256:bab4aebd525218bab4ee615786c4581952eadc16b1ff031813a2fd51f0cc7b08 \ - --hash=sha256:c124b8c8779bf2d35d9b721e52d4adb41c9bfbde45e6a3f25f0820caa9aba73f \ - --hash=sha256:c9da0a39b53d2fab3e5467329ed50e951eb91386e9d0d5b12daf593973c3b168 \ - --hash=sha256:ca60076c388728d3b6ac3846842474f4250c91efbfe5afa872d3ffd69dd4b318 \ - --hash=sha256:cb6994fff247987c66a8a4e550ef374671c2b82e3c0d2115e689d21e511a652d \ - --hash=sha256:d1c1d6236feab51200272d79b3d3e0f12cf2cbb12b208c835b175a21efdb0a73 \ - --hash=sha256:dd7760a88a8d3d705ff562aa93f8445ead54f58fd482e4f9e2bafb7e177375d4 \ - --hash=sha256:dda4d8a3bb0b50f540f6ff4b6033f3a74e8bf0bd5320b70fab2c03e512a62812 \ - --hash=sha256:e0f1ff55dde0ebcfbef027edc21f71c205845585fffe30d4ec4979416613e9b3 \ - --hash=sha256:e7a539b9be7b9c00f11ef16b55486141bc2cdb0c54762f84e3c6fc091917436d \ - --hash=sha256:eb0b14523758e37802f27b7f8cd973f5f3d33be7613952c0df904b68c4842f0e \ - --hash=sha256:ed447680ff21c14aaceb6a9f99a5f639f583ccfe4ce1a5e1d48eb41c3d6b3217 \ - --hash=sha256:f52a4ad2568314ee713715b1e2d79ab55fab11e8b304fd1462ff5cccf4264b3e \ - --hash=sha256:fbd60c6aaa07c31d7754edbc2334aef50601b7f1ada67a96eb1eb57c7c72378f \ - --hash=sha256:fc28e0db232c62ca0c3600884933178f0825c99be4474cdd645e378a10588125 \ - --hash=sha256:fe31de3002e7b08eb20823b3735b97c86c5926dd0581c7710a680b418a8709d4 \ - --hash=sha256:fec221a051150eeddfdfcff162e6db92c65ecf46cb0f7bb1bf812a1520ec026b \ - --hash=sha256:ff71073ebf0e42258a42a0b34f2c09ec384977e7f6808999102eedd5b49920e3 - # via - # -r requirements.in - # google-resumable-media -google-resumable-media==2.3.3 \ - --hash=sha256:27c52620bd364d1c8116eaac4ea2afcbfb81ae9139fb3199652fcac1724bfb6c \ - --hash=sha256:5b52774ea7a829a8cdaa8bd2d4c3d4bc660c91b30857ab2668d0eb830f4ea8c5 - # via - # -r requirements.in - # google-cloud-storage -googleapis-common-protos==1.56.3 \ - --hash=sha256:6f1369b58ed6cf3a4b7054a44ebe8d03b29c309257583a2bbdc064cd1e4a1442 \ - --hash=sha256:87955d7b3a73e6e803f2572a33179de23989ebba725e05ea42f24838b792e461 - # via - # -r requirements.in - # google-api-core -idna==3.4 \ - --hash=sha256:814f528e8dead7d329833b91c5faa87d60bf71824cd12a7530b5526063d02cb4 \ - --hash=sha256:90b77e79eaa3eba6de819a0c442c0b4ceefc341a7a2ab77d7562bf49f425c5c2 - # via - # -r requirements.in - # requests -importlib-metadata==4.8.3 \ - --hash=sha256:65a9576a5b2d58ca44d133c42a241905cc45e34d2c06fd5ba2bafa221e5d7b5e \ - --hash=sha256:766abffff765960fcc18003801f7044eb6755ffae4521c8e8ce8e83b9c9b0668 - # via - # -r requirements.in - # keyring -jeepney==0.7.1 \ - --hash=sha256:1b5a0ea5c0e7b166b2f5895b91a08c14de8915afda4407fb5022a195224958ac \ - --hash=sha256:fa9e232dfa0c498bd0b8a3a73b8d8a31978304dcef0515adc859d4e096f96f4f - # via - # -r requirements.in - # keyring - # secretstorage -jinja2==3.0.3 \ - --hash=sha256:077ce6014f7b40d03b47d1f1ca4b0fc8328a692bd284016f806ed0eaca390ad8 \ - --hash=sha256:611bb273cd68f3b993fabdc4064fc858c5b47a973cb5aa7999ec1ba405c87cd7 - # via - # -r requirements.in - # gcp-releasetool -keyring==23.4.1 \ - --hash=sha256:17e49fb0d6883c2b4445359434dba95aad84aabb29bbff044ad0ed7100232eca \ - --hash=sha256:89cbd74d4683ed164c8082fb38619341097741323b3786905c6dac04d6915a55 - # via - # -r requirements.in - # gcp-releasetool -markupsafe==2.0.1 \ - --hash=sha256:01a9b8ea66f1658938f65b93a85ebe8bc016e6769611be228d797c9d998dd298 \ - --hash=sha256:023cb26ec21ece8dc3907c0e8320058b2e0cb3c55cf9564da612bc325bed5e64 \ - --hash=sha256:0446679737af14f45767963a1a9ef7620189912317d095f2d9ffa183a4d25d2b \ - --hash=sha256:04635854b943835a6ea959e948d19dcd311762c5c0c6e1f0e16ee57022669194 \ - --hash=sha256:0717a7390a68be14b8c793ba258e075c6f4ca819f15edfc2a3a027c823718567 \ - --hash=sha256:0955295dd5eec6cb6cc2fe1698f4c6d84af2e92de33fbcac4111913cd100a6ff \ - --hash=sha256:0d4b31cc67ab36e3392bbf3862cfbadac3db12bdd8b02a2731f509ed5b829724 \ - --hash=sha256:10f82115e21dc0dfec9ab5c0223652f7197feb168c940f3ef61563fc2d6beb74 \ - --hash=sha256:168cd0a3642de83558a5153c8bd34f175a9a6e7f6dc6384b9655d2697312a646 \ - --hash=sha256:1d609f577dc6e1aa17d746f8bd3c31aa4d258f4070d61b2aa5c4166c1539de35 \ - --hash=sha256:1f2ade76b9903f39aa442b4aadd2177decb66525062db244b35d71d0ee8599b6 \ - --hash=sha256:20dca64a3ef2d6e4d5d615a3fd418ad3bde77a47ec8a23d984a12b5b4c74491a \ - --hash=sha256:2a7d351cbd8cfeb19ca00de495e224dea7e7d919659c2841bbb7f420ad03e2d6 \ - --hash=sha256:2d7d807855b419fc2ed3e631034685db6079889a1f01d5d9dac950f764da3dad \ - --hash=sha256:2ef54abee730b502252bcdf31b10dacb0a416229b72c18b19e24a4509f273d26 \ - --hash=sha256:36bc903cbb393720fad60fc28c10de6acf10dc6cc883f3e24ee4012371399a38 \ - --hash=sha256:37205cac2a79194e3750b0af2a5720d95f786a55ce7df90c3af697bfa100eaac \ - --hash=sha256:3c112550557578c26af18a1ccc9e090bfe03832ae994343cfdacd287db6a6ae7 \ - --hash=sha256:3dd007d54ee88b46be476e293f48c85048603f5f516008bee124ddd891398ed6 \ - --hash=sha256:4296f2b1ce8c86a6aea78613c34bb1a672ea0e3de9c6ba08a960efe0b0a09047 \ - --hash=sha256:47ab1e7b91c098ab893b828deafa1203de86d0bc6ab587b160f78fe6c4011f75 \ - --hash=sha256:49e3ceeabbfb9d66c3aef5af3a60cc43b85c33df25ce03d0031a608b0a8b2e3f \ - --hash=sha256:4dc8f9fb58f7364b63fd9f85013b780ef83c11857ae79f2feda41e270468dd9b \ - --hash=sha256:4efca8f86c54b22348a5467704e3fec767b2db12fc39c6d963168ab1d3fc9135 \ - --hash=sha256:53edb4da6925ad13c07b6d26c2a852bd81e364f95301c66e930ab2aef5b5ddd8 \ - --hash=sha256:5855f8438a7d1d458206a2466bf82b0f104a3724bf96a1c781ab731e4201731a \ - --hash=sha256:594c67807fb16238b30c44bdf74f36c02cdf22d1c8cda91ef8a0ed8dabf5620a \ - --hash=sha256:5b6d930f030f8ed98e3e6c98ffa0652bdb82601e7a016ec2ab5d7ff23baa78d1 \ - --hash=sha256:5bb28c636d87e840583ee3adeb78172efc47c8b26127267f54a9c0ec251d41a9 \ - --hash=sha256:60bf42e36abfaf9aff1f50f52644b336d4f0a3fd6d8a60ca0d054ac9f713a864 \ - --hash=sha256:611d1ad9a4288cf3e3c16014564df047fe08410e628f89805e475368bd304914 \ - --hash=sha256:6300b8454aa6930a24b9618fbb54b5a68135092bc666f7b06901f897fa5c2fee \ - --hash=sha256:63f3268ba69ace99cab4e3e3b5840b03340efed0948ab8f78d2fd87ee5442a4f \ - --hash=sha256:6557b31b5e2c9ddf0de32a691f2312a32f77cd7681d8af66c2692efdbef84c18 \ - --hash=sha256:693ce3f9e70a6cf7d2fb9e6c9d8b204b6b39897a2c4a1aa65728d5ac97dcc1d8 \ - --hash=sha256:6a7fae0dd14cf60ad5ff42baa2e95727c3d81ded453457771d02b7d2b3f9c0c2 \ - --hash=sha256:6c4ca60fa24e85fe25b912b01e62cb969d69a23a5d5867682dd3e80b5b02581d \ - --hash=sha256:6fcf051089389abe060c9cd7caa212c707e58153afa2c649f00346ce6d260f1b \ - --hash=sha256:7d91275b0245b1da4d4cfa07e0faedd5b0812efc15b702576d103293e252af1b \ - --hash=sha256:89c687013cb1cd489a0f0ac24febe8c7a666e6e221b783e53ac50ebf68e45d86 \ - --hash=sha256:8d206346619592c6200148b01a2142798c989edcb9c896f9ac9722a99d4e77e6 \ - --hash=sha256:905fec760bd2fa1388bb5b489ee8ee5f7291d692638ea5f67982d968366bef9f \ - --hash=sha256:97383d78eb34da7e1fa37dd273c20ad4320929af65d156e35a5e2d89566d9dfb \ - --hash=sha256:984d76483eb32f1bcb536dc27e4ad56bba4baa70be32fa87152832cdd9db0833 \ - --hash=sha256:99df47edb6bda1249d3e80fdabb1dab8c08ef3975f69aed437cb69d0a5de1e28 \ - --hash=sha256:9f02365d4e99430a12647f09b6cc8bab61a6564363f313126f775eb4f6ef798e \ - --hash=sha256:a30e67a65b53ea0a5e62fe23682cfe22712e01f453b95233b25502f7c61cb415 \ - --hash=sha256:ab3ef638ace319fa26553db0624c4699e31a28bb2a835c5faca8f8acf6a5a902 \ - --hash=sha256:aca6377c0cb8a8253e493c6b451565ac77e98c2951c45f913e0b52facdcff83f \ - --hash=sha256:add36cb2dbb8b736611303cd3bfcee00afd96471b09cda130da3581cbdc56a6d \ - --hash=sha256:b2f4bf27480f5e5e8ce285a8c8fd176c0b03e93dcc6646477d4630e83440c6a9 \ - --hash=sha256:b7f2d075102dc8c794cbde1947378051c4e5180d52d276987b8d28a3bd58c17d \ - --hash=sha256:baa1a4e8f868845af802979fcdbf0bb11f94f1cb7ced4c4b8a351bb60d108145 \ - --hash=sha256:be98f628055368795d818ebf93da628541e10b75b41c559fdf36d104c5787066 \ - --hash=sha256:bf5d821ffabf0ef3533c39c518f3357b171a1651c1ff6827325e4489b0e46c3c \ - --hash=sha256:c47adbc92fc1bb2b3274c4b3a43ae0e4573d9fbff4f54cd484555edbf030baf1 \ - --hash=sha256:cdfba22ea2f0029c9261a4bd07e830a8da012291fbe44dc794e488b6c9bb353a \ - --hash=sha256:d6c7ebd4e944c85e2c3421e612a7057a2f48d478d79e61800d81468a8d842207 \ - --hash=sha256:d7f9850398e85aba693bb640262d3611788b1f29a79f0c93c565694658f4071f \ - --hash=sha256:d8446c54dc28c01e5a2dbac5a25f071f6653e6e40f3a8818e8b45d790fe6ef53 \ - --hash=sha256:deb993cacb280823246a026e3b2d81c493c53de6acfd5e6bfe31ab3402bb37dd \ - --hash=sha256:e0f138900af21926a02425cf736db95be9f4af72ba1bb21453432a07f6082134 \ - --hash=sha256:e9936f0b261d4df76ad22f8fee3ae83b60d7c3e871292cd42f40b81b70afae85 \ - --hash=sha256:f0567c4dc99f264f49fe27da5f735f414c4e7e7dd850cfd8e69f0862d7c74ea9 \ - --hash=sha256:f5653a225f31e113b152e56f154ccbe59eeb1c7487b39b9d9f9cdb58e6c79dc5 \ - --hash=sha256:f826e31d18b516f653fe296d967d700fddad5901ae07c622bb3705955e1faa94 \ - --hash=sha256:f8ba0e8349a38d3001fae7eadded3f6606f0da5d748ee53cc1dab1d6527b9509 \ - --hash=sha256:f9081981fe268bd86831e5c75f7de206ef275defcb82bc70740ae6dc507aee51 \ - --hash=sha256:fa130dd50c57d53368c9d59395cb5526eda596d3ffe36666cd81a44d56e48872 - # via - # -r requirements.in - # jinja2 -packaging==21.3 \ - --hash=sha256:dd47c42927d89ab911e606518907cc2d3a1f38bbd026385970643f9c5b8ecfeb \ - --hash=sha256:ef103e05f519cdc783ae24ea4e2e0f508a9c99b2d4969652eed6a2e1ea5bd522 - # via - # -r requirements.in - # gcp-releasetool -protobuf==3.19.5 \ - --hash=sha256:1867f93b06a183f87696871bb8d1e99ee71dbb69d468ce1f0cc8bf3d30f982f3 \ - --hash=sha256:3c4160b601220627f7e91154e572baf5e161a9c3f445a8242d536ee3d0b7b17c \ - --hash=sha256:4ee2af7051d3b10c8a4fe6fd1a2c69f201fea36aeee7086cf202a692e1b99ee1 \ - --hash=sha256:5266c36cc0af3bb3dbf44f199d225b33da66a9a5c3bdc2b14865ad10eddf0e37 \ - --hash=sha256:5470f892961af464ae6eaf0f3099e2c1190ae8c7f36f174b89491281341f79ca \ - --hash=sha256:66d14b5b90090353efe75c9fb1bf65ef7267383034688d255b500822e37d5c2f \ - --hash=sha256:67efb5d20618020aa9596e17bfc37ca068c28ec0c1507d9507f73c93d46c9855 \ - --hash=sha256:696e6cfab94cc15a14946f2bf72719dced087d437adbd994fff34f38986628bc \ - --hash=sha256:6a02172b9650f819d01fb8e224fc69b0706458fc1ab4f1c669281243c71c1a5e \ - --hash=sha256:6eca9ae238ba615d702387a2ddea635d535d769994a9968c09a4ca920c487ab9 \ - --hash=sha256:950abd6c00e7b51f87ae8b18a0ce4d69fea217f62f171426e77de5061f6d9850 \ - --hash=sha256:9e1d74032f56ff25f417cfe84c8147047732e5059137ca42efad20cbbd25f5e0 \ - --hash=sha256:9e42b1cf2ecd8a1bd161239e693f22035ba99905ae6d7efeac8a0546c7ec1a27 \ - --hash=sha256:9f957ef53e872d58a0afd3bf6d80d48535d28c99b40e75e6634cbc33ea42fd54 \ - --hash=sha256:a89aa0c042e61e11ade320b802d6db4ee5391d8d973e46d3a48172c1597789f8 \ - --hash=sha256:c0f80876a8ff0ae7064084ed094eb86497bd5a3812e6fc96a05318b92301674e \ - --hash=sha256:c44e3282cff74ad18c7e8a0375f407f69ee50c2116364b44492a196293e08b21 \ - --hash=sha256:d249519ba5ecf5dd6b18150c9b6bcde510b273714b696f3923ff8308fc11ae49 \ - --hash=sha256:d3973a2d58aefc7d1230725c2447ce7f86a71cbc094b86a77c6ee1505ac7cdb1 \ - --hash=sha256:dca2284378a5f2a86ffed35c6ac147d14c48b525eefcd1083e5a9ce28dfa8657 \ - --hash=sha256:e63b0b3c42e51c94add62b010366cd4979cb6d5f06158bcae8faac4c294f91e1 \ - --hash=sha256:f2b599a21c9a32e171ec29a2ac54e03297736c578698e11b099d031f79da114b \ - --hash=sha256:f2bde37667b18c2b5280df83bc799204394a5d2d774e4deaf9de0eb741df6833 \ - --hash=sha256:f4f909f4dde413dec435a44b0894956d55bb928ded7d6e3c726556ca4c796e84 \ - --hash=sha256:f976234e20ab2785f54224bcdafa027674e23663b132fa3ca0caa291a6cfbde7 \ - --hash=sha256:f9cebda093c2f6bfed88f1c17cdade09d4d96096421b344026feee236532d4de - # via - # -r requirements.in - # gcp-docuploader - # gcp-releasetool - # google-api-core - # google-cloud-storage - # googleapis-common-protos -pyasn1==0.4.8 \ - --hash=sha256:39c7e2ec30515947ff4e87fb6f456dfc6e84857d34be479c9d4a4ba4bf46aa5d \ - --hash=sha256:aef77c9fb94a3ac588e87841208bdec464471d9871bd5050a287cc9a475cd0ba - # via - # pyasn1-modules - # rsa -pyasn1-modules==0.2.8 \ - --hash=sha256:905f84c712230b2c592c19470d3ca8d552de726050d1d1716282a1f6146be65e \ - --hash=sha256:a50b808ffeb97cb3601dd25981f6b016cbb3d31fbf57a8b8a87428e6158d0c74 - # via google-auth -pycparser==2.21 \ - --hash=sha256:8ee45429555515e1f6b185e78100aea234072576aa43ab53aefcae078162fca9 \ - --hash=sha256:e644fdec12f7872f86c58ff790da456218b10f863970249516d60a5eaca77206 - # via - # -r requirements.in - # cffi -pyjwt==2.4.0 \ - --hash=sha256:72d1d253f32dbd4f5c88eaf1fdc62f3a19f676ccbadb9dbc5d07e951b2b26daf \ - --hash=sha256:d42908208c699b3b973cbeb01a969ba6a96c821eefb1c5bfe4c390c01d67abba - # via - # -r requirements.in - # gcp-releasetool -pyparsing==3.0.9 \ - --hash=sha256:2b020ecf7d21b687f219b71ecad3631f644a47f01403fa1d1036b0c6416d70fb \ - --hash=sha256:5026bae9a10eeaefb61dab2f09052b9f4307d44aee4eda64b309723d8d206bbc - # via - # -r requirements.in - # packaging -pyperclip==1.8.2 \ - --hash=sha256:105254a8b04934f0bc84e9c24eb360a591aaf6535c9def5f29d92af107a9bf57 - # via - # -r requirements.in - # gcp-releasetool -python-dateutil==2.8.2 \ - --hash=sha256:0123cacc1627ae19ddf3c27a5de5bd67ee4586fbdd6440d9748f8abb483d3e86 \ - --hash=sha256:961d03dc3453ebbc59dbdea9e4e11c5651520a876d0f4db161e8674aae935da9 - # via - # -r requirements.in - # gcp-releasetool -requests==2.27.1 \ - --hash=sha256:68d7c56fd5a8999887728ef304a6d12edc7be74f1cfa47714fc8b414525c9a61 \ - --hash=sha256:f22fa1e554c9ddfd16e6e41ac79759e17be9e492b3587efa038054674760e72d - # via - # -r requirements.in - # gcp-releasetool - # google-api-core - # google-cloud-storage -rsa==4.9 \ - --hash=sha256:90260d9058e514786967344d0ef75fa8727eed8a7d2e43ce9f4bcf1b536174f7 \ - --hash=sha256:e38464a49c6c85d7f1351b0126661487a7e0a14a50f1675ec50eb34d4f20ef21 - # via - # -r requirements.in - # google-auth -secretstorage==3.3.3 \ - --hash=sha256:2403533ef369eca6d2ba81718576c5e0f564d5cca1b58f73a8b23e7d4eeebd77 \ - --hash=sha256:f356e6628222568e3af06f2eba8df495efa13b3b63081dafd4f7d9a7b7bc9f99 - # via keyring -six==1.16.0 \ - --hash=sha256:1e61c37477a1626458e36f7b1d82aa5c9b094fa4802892072e49de9c60c4c926 \ - --hash=sha256:8abb2f1d86890a2dfb989f9a77cfcfd3e47c2a354b01111771326f8aa26e0254 - # via - # -r requirements.in - # gcp-docuploader - # google-auth - # python-dateutil -typing-extensions==4.1.1 \ - --hash=sha256:1a9462dcc3347a79b1f1c0271fbe79e844580bb598bafa1ed208b94da3cdcd42 \ - --hash=sha256:21c85e0fe4b9a155d0799430b0ad741cdce7e359660ccbd8b530613e8df88ce2 - # via -r requirements.in -urllib3==1.26.12 \ - --hash=sha256:3fa96cf423e6987997fc326ae8df396db2a8b7c667747d47ddd8ecba91f4a74e \ - --hash=sha256:b930dd878d5a8afb066a637fbb35144fe7901e3b209d1cd4f524bd0e9deee997 - # via - # -r requirements.in - # requests -zipp==3.6.0 \ - --hash=sha256:71c644c5369f4a6e07636f0aa966270449561fcea2e3d6747b8d23efaa9d7832 \ - --hash=sha256:9fe5ea21568a0a70e50f273397638d39b03353731e6cbbb3fd8502a33fec40bc - # via - # -r requirements.in - # importlib-metadata diff --git a/java-common-protos/.kokoro/trampoline.sh b/java-common-protos/.kokoro/trampoline.sh deleted file mode 100644 index 8b69b793c9..0000000000 --- a/java-common-protos/.kokoro/trampoline.sh +++ /dev/null @@ -1,26 +0,0 @@ -#!/bin/bash -# Copyright 2018 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -set -eo pipefail -# Always run the cleanup script, regardless of the success of bouncing into -# the container. -function cleanup() { - chmod +x ${KOKORO_GFILE_DIR}/trampoline_cleanup.sh - ${KOKORO_GFILE_DIR}/trampoline_cleanup.sh - echo "cleanup"; -} -trap cleanup EXIT - -$(dirname $0)/populate-secrets.sh # Secret Manager secrets. -python3 "${KOKORO_GFILE_DIR}/trampoline_v1.py" diff --git a/java-common-protos/.repo-metadata.json b/java-common-protos/.repo-metadata.json index d03230ad8c..d519c2765f 100644 --- a/java-common-protos/.repo-metadata.json +++ b/java-common-protos/.repo-metadata.json @@ -1,17 +1,17 @@ { "api_shortname": "common-protos", "name_pretty": "Common Protos", - "product_documentation": "n/a", - "api_description": "n/a", + "product_documentation": "https://github.com/googleapis/api-common-protos", + "api_description": "Protobuf classes for Google's common protos.", "client_documentation": "https://cloud.google.com/java/docs/reference/proto-google-common-protos/latest/history", "release_level": "stable", "transport": "grpc", - "requires_billing": true, "language": "java", - "repo": "googleapis/java-common-protos", + "repo": "googleapis/sdk-platform-java", "repo_short": "java-common-protos", - "library_type": "OTHER", "distribution_name": "com.google.api.grpc:proto-google-common-protos", + "library_type": "OTHER", + "requires_billing": true, "excluded_dependencies": "proto-google-common-protos,grpc-google-common-protos,proto-google-common-protos-parent", "excluded_poms": "proto-google-common-protos-bom,proto-google-common-protos" -} +} \ No newline at end of file diff --git a/java-common-protos/CODE_OF_CONDUCT.md b/java-common-protos/CODE_OF_CONDUCT.md deleted file mode 100644 index 2add2547a8..0000000000 --- a/java-common-protos/CODE_OF_CONDUCT.md +++ /dev/null @@ -1,94 +0,0 @@ - -# 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-common-protos/CONTRIBUTING.md b/java-common-protos/CONTRIBUTING.md deleted file mode 100644 index b65dd279c9..0000000000 --- a/java-common-protos/CONTRIBUTING.md +++ /dev/null @@ -1,92 +0,0 @@ -# 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 - -All code samples must be in compliance with the [java sample formatting guide][3]. -Code Samples must be bundled in separate Maven modules. - -The samples must be separate from the primary project for a few reasons: -1. Primary projects have a minimum Java version of Java 8 whereas samples can have - Java version of Java 11. Due to this we need the ability to - selectively exclude samples from a build run. -2. Many code samples depend on external GCP services and need - credentials to access the service. -3. Code samples are not released as Maven artifacts and must be excluded from - release builds. - -### Building - -```bash -mvn clean verify -``` - -Some samples require access to GCP services and require a service account: - -```bash -export GOOGLE_APPLICATION_CREDENTIALS=/path/to/service/account.json -mvn clean verify -``` - -### 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 -``` - -[1]: https://cloud.google.com/docs/authentication/getting-started#creating_a_service_account -[2]: https://maven.apache.org/settings.html#Active_Profiles -[3]: https://github.com/GoogleCloudPlatform/java-docs-samples/blob/main/SAMPLE_FORMAT.md \ No newline at end of file diff --git a/java-common-protos/README.md b/java-common-protos/README.md index cfbe54dc39..117fda7947 100644 --- a/java-common-protos/README.md +++ b/java-common-protos/README.md @@ -1,22 +1,138 @@ -# Google Common Protos +# Google Common Protos Client for Java -Java protobuf classes for Google's common protos. +Java idiomatic client for [Common Protos][product-docs]. [![Maven][maven-version-image]][maven-version-link] ![Stability][stability-image] +- [Product Documentation][product-docs] - [Client Library Documentation][javadocs] -## Java Versions -Java 7 or above is required for using this client. +## Quickstart + + +If you are using Maven, add this to your pom.xml file: + + +```xml + + com.google.api.grpc + proto-google-common-protos + 2.39.0 + +``` + +If you are using Gradle without BOM, add this to your dependencies: + +```Groovy +implementation 'com.google.api.grpc:proto-google-common-protos:2.39.0' +``` + +If you are using SBT, add this to your dependencies: + +```Scala +libraryDependencies += "com.google.api.grpc" % "proto-google-common-protos" % "2.39.0" +``` + +## 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 Common Protos APIs, and the authenticated principal must have the [IAM role(s)][predefined-iam-roles] required to access GCP resources using the Common Protos API calls. + +## Getting Started + +### Prerequisites + +You will need a [Google Cloud Platform Console][developer-console] project with the Common Protos [API enabled][enable-api]. +You will need to [enable billing][enable-billing] to use Google Common Protos. +[Follow these instructions][create-project] to get your project set up. You will also need to set up the local development environment by +[installing the Google Cloud SDK][cloud-sdk] and running the following commands in command line: +`gcloud auth login` and `gcloud config set project [YOUR PROJECT ID]`. + +### Installation and setup + +You'll need to obtain the `proto-google-common-protos` library. See the [Quickstart](#quickstart) section +to add `proto-google-common-protos` as a dependency in your code. + +## About Common Protos + + +[Common Protos][product-docs] Protobuf classes for Google's common protos. + +See the [Common Protos client library docs][javadocs] to learn how to +use this Common Protos Client Library. + + + + + + +## Troubleshooting + +To get help, follow the instructions in the [shared Troubleshooting document][troubleshooting]. + +## Transport + +Common Protos 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. @@ -25,41 +141,55 @@ Please note that this project is released with a Contributor Code of Conduct. By this project you agree to abide by its terms. See [Code of Conduct][code-of-conduct] for more information. + ## License Apache 2.0 - See [LICENSE][license] for more information. ## CI Status -| Java Version | Status | -| -------------- | --------------------------------------------------------- | -| Java 7 | [![Kokoro CI][kokoro-badge-image-1]][kokoro-badge-link-1] | -| Java 8 | [![Kokoro CI][kokoro-badge-image-2]][kokoro-badge-link-2] | -| Java 8 OSX | [![Kokoro CI][kokoro-badge-image-3]][kokoro-badge-link-3] | -| Java 8 Windows | [![Kokoro CI][kokoro-badge-image-4]][kokoro-badge-link-4] | -| Java 11 | [![Kokoro CI][kokoro-badge-image-5]][kokoro-badge-link-5] | - -[javadocs]: https://cloud.google.com/java/docs/reference/proto-google-common-protos/latest/overview -[kokoro-badge-image-1]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-common-protos/java7.svg -[kokoro-badge-link-1]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-common-protos/java7.html -[kokoro-badge-image-2]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-common-protos/java8.svg -[kokoro-badge-link-2]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-common-protos/java8.html -[kokoro-badge-image-3]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-common-protos/java8-osx.svg -[kokoro-badge-link-3]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-common-protos/java8-osx.html -[kokoro-badge-image-4]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-common-protos/java8-win.svg -[kokoro-badge-link-4]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-common-protos/java8-win.html -[kokoro-badge-image-5]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-common-protos/java11.svg -[kokoro-badge-link-5]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-common-protos/java11.html -[stability-image]: https://img.shields.io/badge/stability-ga-green +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://github.com/googleapis/api-common-protos +[javadocs]: https://cloud.google.com/java/docs/reference/proto-google-common-protos/latest/history +[kokoro-badge-image-1]: http://storage.googleapis.com/cloud-devrel-public/java/badges/sdk-platform-java/java7.svg +[kokoro-badge-link-1]: http://storage.googleapis.com/cloud-devrel-public/java/badges/sdk-platform-java/java7.html +[kokoro-badge-image-2]: http://storage.googleapis.com/cloud-devrel-public/java/badges/sdk-platform-java/java8.svg +[kokoro-badge-link-2]: http://storage.googleapis.com/cloud-devrel-public/java/badges/sdk-platform-java/java8.html +[kokoro-badge-image-3]: http://storage.googleapis.com/cloud-devrel-public/java/badges/sdk-platform-java/java8-osx.svg +[kokoro-badge-link-3]: http://storage.googleapis.com/cloud-devrel-public/java/badges/sdk-platform-java/java8-osx.html +[kokoro-badge-image-4]: http://storage.googleapis.com/cloud-devrel-public/java/badges/sdk-platform-java/java8-win.svg +[kokoro-badge-link-4]: http://storage.googleapis.com/cloud-devrel-public/java/badges/sdk-platform-java/java8-win.html +[kokoro-badge-image-5]: http://storage.googleapis.com/cloud-devrel-public/java/badges/sdk-platform-java/java11.svg +[kokoro-badge-link-5]: http://storage.googleapis.com/cloud-devrel-public/java/badges/sdk-platform-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.api.grpc/proto-google-common-protos.svg [maven-version-link]: https://search.maven.org/search?q=g:com.google.api.grpc%20AND%20a:proto-google-common-protos&core=gav [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-sdk]: https://cloud.google.com/sdk/ [troubleshooting]: https://github.com/googleapis/google-cloud-common/blob/main/troubleshooting/readme.md#troubleshooting -[contributing]: https://github.com/googleapis/java-common-protos/blob/main/CONTRIBUTING.md -[code-of-conduct]: https://github.com/googleapis/java-common-protos/blob/main/CODE_OF_CONDUCT.md#contributor-code-of-conduct -[license]: https://github.com/googleapis/java-common-protos/blob/main/LICENSE +[contributing]: https://github.com/googleapis/sdk-platform-java/blob/main/CONTRIBUTING.md +[code-of-conduct]: https://github.com/googleapis/sdk-platform-java/blob/main/CODE_OF_CONDUCT.md#contributor-code-of-conduct +[license]: https://github.com/googleapis/sdk-platform-java/blob/main/LICENSE [enable-billing]: https://cloud.google.com/apis/docs/getting-started#enabling_billing + [libraries-bom]: https://github.com/GoogleCloudPlatform/cloud-opensource-java/wiki/The-Google-Cloud-Platform-Libraries-BOM +[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-common-protos/SECURITY.md b/java-common-protos/SECURITY.md deleted file mode 100644 index 8b58ae9c01..0000000000 --- a/java-common-protos/SECURITY.md +++ /dev/null @@ -1,7 +0,0 @@ -# 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-common-protos/codecov.yaml b/java-common-protos/codecov.yaml deleted file mode 100644 index 5724ea9478..0000000000 --- a/java-common-protos/codecov.yaml +++ /dev/null @@ -1,4 +0,0 @@ ---- -codecov: - ci: - - source.cloud.google.com diff --git a/java-common-protos/grpc-google-common-protos/build.gradle b/java-common-protos/grpc-google-common-protos/build.gradle deleted file mode 100644 index a9d114462e..0000000000 --- a/java-common-protos/grpc-google-common-protos/build.gradle +++ /dev/null @@ -1,49 +0,0 @@ -buildscript { - repositories { - mavenCentral() - } -} - -apply plugin: 'java' - -description = 'GRPC library for grpc-google-common-protos' -group = 'com.google.api.grpc' -version = '1.17.0' -sourceCompatibility = 1.7 -targetCompatibility = 1.7 - -repositories { - mavenCentral() - mavenLocal() -} - -dependencies { - compile 'io.grpc:grpc-stub:1.51.1' - compile 'io.grpc:grpc-protobuf:1.51.1' - compile project(':proto-google-common-protos') -} - -sourceSets { - main { - java { - srcDir 'src/main/java' - } - } -} - -task javadocJar(type: Jar) { - classifier = 'javadoc' - from javadoc -} - -task sourcesJar(type: Jar) { - classifier = 'sources' - from sourceSets.main.allSource -} - -artifacts { - archives javadocJar, sourcesJar -} - -compileJava.options.encoding = 'UTF-8' -javadoc.options.encoding = 'UTF-8' diff --git a/java-common-protos/grpc-google-common-protos/pom.xml b/java-common-protos/grpc-google-common-protos/pom.xml index 4c53615c96..233e3772e4 100644 --- a/java-common-protos/grpc-google-common-protos/pom.xml +++ b/java-common-protos/grpc-google-common-protos/pom.xml @@ -4,13 +4,13 @@ 4.0.0 com.google.api.grpc grpc-google-common-protos - 2.11.1-SNAPSHOT + 2.67.1-SNAPSHOT grpc-google-common-protos GRPC library for grpc-google-common-protos com.google.api.grpc google-common-protos-parent - 2.11.1-SNAPSHOT + 2.67.1-SNAPSHOT diff --git a/java-common-protos/grpc-google-common-protos/src/main/java/com/google/cloud/location/LocationsGrpc.java b/java-common-protos/grpc-google-common-protos/src/main/java/com/google/cloud/location/LocationsGrpc.java index bce34c309a..1827968c32 100644 --- a/java-common-protos/grpc-google-common-protos/src/main/java/com/google/cloud/location/LocationsGrpc.java +++ b/java-common-protos/grpc-google-common-protos/src/main/java/com/google/cloud/location/LocationsGrpc.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -26,15 +26,12 @@ * [Location.metadata][google.cloud.location.Location.metadata] field. * */ -@javax.annotation.Generated( - value = "by gRPC proto compiler", - comments = "Source: google/cloud/location/locations.proto") @io.grpc.stub.annotations.GrpcGenerated public final class LocationsGrpc { private LocationsGrpc() {} - public static final String SERVICE_NAME = "google.cloud.location.Locations"; + public static final java.lang.String SERVICE_NAME = "google.cloud.location.Locations"; // Static method descriptors that strictly reflect the proto. private static volatile io.grpc.MethodDescriptor< @@ -134,6 +131,19 @@ public LocationsStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOp return LocationsStub.newStub(factory, channel); } + /** Creates a new blocking-style stub that supports all types of calls on the service */ + public static LocationsBlockingV2Stub newBlockingV2Stub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public LocationsBlockingV2Stub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new LocationsBlockingV2Stub(channel, callOptions); + } + }; + return LocationsBlockingV2Stub.newStub(factory, channel); + } + /** * Creates a new blocking-style stub that supports unary and streaming output calls on the service */ @@ -171,7 +181,7 @@ public LocationsFutureStub newStub( * [Location.metadata][google.cloud.location.Location.metadata] field. * */ - public abstract static class LocationsImplBase implements io.grpc.BindableService { + public interface AsyncService { /** * @@ -180,7 +190,7 @@ public abstract static class LocationsImplBase implements io.grpc.BindableServic * Lists information about the supported locations for this service. * */ - public void listLocations( + default void listLocations( com.google.cloud.location.ListLocationsRequest request, io.grpc.stub.StreamObserver responseObserver) { @@ -195,35 +205,33 @@ public void listLocations( * Gets information about a location. * */ - public void getLocation( + default void getLocation( com.google.cloud.location.GetLocationRequest request, io.grpc.stub.StreamObserver responseObserver) { io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( getGetLocationMethod(), responseObserver); } + } + + /** + * Base class for the server implementation of the service Locations. + * + *
        +   * An abstract interface that provides location-related information for
        +   * a service. Service-specific metadata is provided through the
        +   * [Location.metadata][google.cloud.location.Location.metadata] field.
        +   * 
        + */ + public abstract static class LocationsImplBase implements io.grpc.BindableService, AsyncService { @java.lang.Override public final io.grpc.ServerServiceDefinition bindService() { - return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) - .addMethod( - getListLocationsMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - com.google.cloud.location.ListLocationsRequest, - com.google.cloud.location.ListLocationsResponse>( - this, METHODID_LIST_LOCATIONS))) - .addMethod( - getGetLocationMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - com.google.cloud.location.GetLocationRequest, - com.google.cloud.location.Location>(this, METHODID_GET_LOCATION))) - .build(); + return LocationsGrpc.bindService(this); } } /** - * + * A stub to allow clients to do asynchronous rpc calls to service Locations. * *
            * An abstract interface that provides location-related information for
        @@ -276,7 +284,55 @@ public void getLocation(
           }
         
           /**
        +   * A stub to allow clients to do synchronous rpc calls to service Locations.
            *
        +   * 
        +   * An abstract interface that provides location-related information for
        +   * a service. Service-specific metadata is provided through the
        +   * [Location.metadata][google.cloud.location.Location.metadata] field.
        +   * 
        + */ + public static final class LocationsBlockingV2Stub + extends io.grpc.stub.AbstractBlockingStub { + private LocationsBlockingV2Stub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected LocationsBlockingV2Stub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new LocationsBlockingV2Stub(channel, callOptions); + } + + /** + * + * + *
        +     * Lists information about the supported locations for this service.
        +     * 
        + */ + public com.google.cloud.location.ListLocationsResponse listLocations( + com.google.cloud.location.ListLocationsRequest request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getListLocationsMethod(), getCallOptions(), request); + } + + /** + * + * + *
        +     * Gets information about a location.
        +     * 
        + */ + public com.google.cloud.location.Location getLocation( + com.google.cloud.location.GetLocationRequest request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getGetLocationMethod(), getCallOptions(), request); + } + } + + /** + * A stub to allow clients to do limited synchronous rpc calls to service Locations. * *
            * An abstract interface that provides location-related information for
        @@ -324,7 +380,7 @@ public com.google.cloud.location.Location getLocation(
           }
         
           /**
        -   *
        +   * A stub to allow clients to do ListenableFuture-style rpc calls to service Locations.
            *
            * 
            * An abstract interface that provides location-related information for
        @@ -379,10 +435,10 @@ private static final class MethodHandlers
                   io.grpc.stub.ServerCalls.ServerStreamingMethod,
                   io.grpc.stub.ServerCalls.ClientStreamingMethod,
                   io.grpc.stub.ServerCalls.BidiStreamingMethod {
        -    private final LocationsImplBase serviceImpl;
        +    private final AsyncService serviceImpl;
             private final int methodId;
         
        -    MethodHandlers(LocationsImplBase serviceImpl, int methodId) {
        +    MethodHandlers(AsyncService serviceImpl, int methodId) {
               this.serviceImpl = serviceImpl;
               this.methodId = methodId;
             }
        @@ -418,6 +474,24 @@ public io.grpc.stub.StreamObserver invoke(
             }
           }
         
        +  public static final io.grpc.ServerServiceDefinition bindService(AsyncService service) {
        +    return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor())
        +        .addMethod(
        +            getListLocationsMethod(),
        +            io.grpc.stub.ServerCalls.asyncUnaryCall(
        +                new MethodHandlers<
        +                    com.google.cloud.location.ListLocationsRequest,
        +                    com.google.cloud.location.ListLocationsResponse>(
        +                    service, METHODID_LIST_LOCATIONS)))
        +        .addMethod(
        +            getGetLocationMethod(),
        +            io.grpc.stub.ServerCalls.asyncUnaryCall(
        +                new MethodHandlers<
        +                    com.google.cloud.location.GetLocationRequest,
        +                    com.google.cloud.location.Location>(service, METHODID_GET_LOCATION)))
        +        .build();
        +  }
        +
           private abstract static class LocationsBaseDescriptorSupplier
               implements io.grpc.protobuf.ProtoFileDescriptorSupplier,
                   io.grpc.protobuf.ProtoServiceDescriptorSupplier {
        @@ -442,9 +516,9 @@ private static final class LocationsFileDescriptorSupplier
           private static final class LocationsMethodDescriptorSupplier
               extends LocationsBaseDescriptorSupplier
               implements io.grpc.protobuf.ProtoMethodDescriptorSupplier {
        -    private final String methodName;
        +    private final java.lang.String methodName;
         
        -    LocationsMethodDescriptorSupplier(String methodName) {
        +    LocationsMethodDescriptorSupplier(java.lang.String methodName) {
               this.methodName = methodName;
             }
         
        diff --git a/java-common-protos/grpc-google-common-protos/src/main/java/com/google/longrunning/OperationsGrpc.java b/java-common-protos/grpc-google-common-protos/src/main/java/com/google/longrunning/OperationsGrpc.java
        index 551a18438c..c1e9c1971f 100644
        --- a/java-common-protos/grpc-google-common-protos/src/main/java/com/google/longrunning/OperationsGrpc.java
        +++ b/java-common-protos/grpc-google-common-protos/src/main/java/com/google/longrunning/OperationsGrpc.java
        @@ -1,5 +1,5 @@
         /*
        - * Copyright 2020 Google LLC
        + * Copyright 2026 Google LLC
          *
          * Licensed under the Apache License, Version 2.0 (the "License");
          * you may not use this file except in compliance with the License.
        @@ -23,23 +23,20 @@
          * 
          * Manages long-running operations with an API service.
          * When an API method normally takes long time to complete, it can be designed
        - * to return [Operation][google.longrunning.Operation] to the client, and the client can use this
        - * interface to receive the real response asynchronously by polling the
        - * operation resource, or pass the operation resource to another API (such as
        - * Google Cloud Pub/Sub API) to receive the response.  Any API service that
        - * returns long-running operations should implement the `Operations` interface
        - * so developers can have a consistent client experience.
        + * to return [Operation][google.longrunning.Operation] to the client, and the
        + * client can use this interface to receive the real response asynchronously by
        + * polling the operation resource, or pass the operation resource to another API
        + * (such as Pub/Sub API) to receive the response.  Any API service that returns
        + * long-running operations should implement the `Operations` interface so
        + * developers can have a consistent client experience.
          * 
        */ -@javax.annotation.Generated( - value = "by gRPC proto compiler", - comments = "Source: google/longrunning/operations.proto") @io.grpc.stub.annotations.GrpcGenerated public final class OperationsGrpc { private OperationsGrpc() {} - public static final String SERVICE_NAME = "google.longrunning.Operations"; + public static final java.lang.String SERVICE_NAME = "google.longrunning.Operations"; // Static method descriptors that strictly reflect the proto. private static volatile io.grpc.MethodDescriptor< @@ -262,6 +259,19 @@ public OperationsStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callO return OperationsStub.newStub(factory, channel); } + /** Creates a new blocking-style stub that supports all types of calls on the service */ + public static OperationsBlockingV2Stub newBlockingV2Stub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public OperationsBlockingV2Stub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new OperationsBlockingV2Stub(channel, callOptions); + } + }; + return OperationsBlockingV2Stub.newStub(factory, channel); + } + /** * Creates a new blocking-style stub that supports unary and streaming output calls on the service */ @@ -296,15 +306,15 @@ public OperationsFutureStub newStub( *
            * Manages long-running operations with an API service.
            * When an API method normally takes long time to complete, it can be designed
        -   * to return [Operation][google.longrunning.Operation] to the client, and the client can use this
        -   * interface to receive the real response asynchronously by polling the
        -   * operation resource, or pass the operation resource to another API (such as
        -   * Google Cloud Pub/Sub API) to receive the response.  Any API service that
        -   * returns long-running operations should implement the `Operations` interface
        -   * so developers can have a consistent client experience.
        +   * to return [Operation][google.longrunning.Operation] to the client, and the
        +   * client can use this interface to receive the real response asynchronously by
        +   * polling the operation resource, or pass the operation resource to another API
        +   * (such as Pub/Sub API) to receive the response.  Any API service that returns
        +   * long-running operations should implement the `Operations` interface so
        +   * developers can have a consistent client experience.
            * 
        */ - public abstract static class OperationsImplBase implements io.grpc.BindableService { + public interface AsyncService { /** * @@ -312,16 +322,9 @@ public abstract static class OperationsImplBase implements io.grpc.BindableServi *
              * Lists operations that match the specified filter in the request. If the
              * server doesn't support this method, it returns `UNIMPLEMENTED`.
        -     * NOTE: the `name` binding allows API services to override the binding
        -     * to use different resource name schemes, such as `users/*/operations`. To
        -     * override the binding, API services can add a binding such as
        -     * `"/v1/{name=users/*}/operations"` to their service configuration.
        -     * For backwards compatibility, the default name includes the operations
        -     * collection id, however overriding users must ensure the name binding
        -     * is the parent resource, without the operations collection id.
              * 
        */ - public void listOperations( + default void listOperations( com.google.longrunning.ListOperationsRequest request, io.grpc.stub.StreamObserver responseObserver) { @@ -338,7 +341,7 @@ public void listOperations( * service. *
        */ - public void getOperation( + default void getOperation( com.google.longrunning.GetOperationRequest request, io.grpc.stub.StreamObserver responseObserver) { io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( @@ -355,7 +358,7 @@ public void getOperation( * `google.rpc.Code.UNIMPLEMENTED`. *
        */ - public void deleteOperation( + default void deleteOperation( com.google.longrunning.DeleteOperationRequest request, io.grpc.stub.StreamObserver responseObserver) { io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( @@ -374,11 +377,12 @@ public void deleteOperation( * other methods to check whether the cancellation succeeded or whether the * operation completed despite cancellation. On successful cancellation, * the operation is not deleted; instead, it becomes an operation with - * an [Operation.error][google.longrunning.Operation.error] value with a [google.rpc.Status.code][google.rpc.Status.code] of 1, - * corresponding to `Code.CANCELLED`. + * an [Operation.error][google.longrunning.Operation.error] value with a + * [google.rpc.Status.code][google.rpc.Status.code] of `1`, corresponding to + * `Code.CANCELLED`. *
        */ - public void cancelOperation( + default void cancelOperation( com.google.longrunning.CancelOperationRequest request, io.grpc.stub.StreamObserver responseObserver) { io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( @@ -400,63 +404,48 @@ public void cancelOperation( * immediate response is no guarantee that the operation is done. * */ - public void waitOperation( + default void waitOperation( com.google.longrunning.WaitOperationRequest request, io.grpc.stub.StreamObserver responseObserver) { io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( getWaitOperationMethod(), responseObserver); } + } + + /** + * Base class for the server implementation of the service Operations. + * + *
        +   * Manages long-running operations with an API service.
        +   * When an API method normally takes long time to complete, it can be designed
        +   * to return [Operation][google.longrunning.Operation] to the client, and the
        +   * client can use this interface to receive the real response asynchronously by
        +   * polling the operation resource, or pass the operation resource to another API
        +   * (such as Pub/Sub API) to receive the response.  Any API service that returns
        +   * long-running operations should implement the `Operations` interface so
        +   * developers can have a consistent client experience.
        +   * 
        + */ + public abstract static class OperationsImplBase implements io.grpc.BindableService, AsyncService { @java.lang.Override public final io.grpc.ServerServiceDefinition bindService() { - return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) - .addMethod( - getListOperationsMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - com.google.longrunning.ListOperationsRequest, - com.google.longrunning.ListOperationsResponse>( - this, METHODID_LIST_OPERATIONS))) - .addMethod( - getGetOperationMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - com.google.longrunning.GetOperationRequest, com.google.longrunning.Operation>( - this, METHODID_GET_OPERATION))) - .addMethod( - getDeleteOperationMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - com.google.longrunning.DeleteOperationRequest, com.google.protobuf.Empty>( - this, METHODID_DELETE_OPERATION))) - .addMethod( - getCancelOperationMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - com.google.longrunning.CancelOperationRequest, com.google.protobuf.Empty>( - this, METHODID_CANCEL_OPERATION))) - .addMethod( - getWaitOperationMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - com.google.longrunning.WaitOperationRequest, - com.google.longrunning.Operation>(this, METHODID_WAIT_OPERATION))) - .build(); + return OperationsGrpc.bindService(this); } } /** - * + * A stub to allow clients to do asynchronous rpc calls to service Operations. * *
            * Manages long-running operations with an API service.
            * When an API method normally takes long time to complete, it can be designed
        -   * to return [Operation][google.longrunning.Operation] to the client, and the client can use this
        -   * interface to receive the real response asynchronously by polling the
        -   * operation resource, or pass the operation resource to another API (such as
        -   * Google Cloud Pub/Sub API) to receive the response.  Any API service that
        -   * returns long-running operations should implement the `Operations` interface
        -   * so developers can have a consistent client experience.
        +   * to return [Operation][google.longrunning.Operation] to the client, and the
        +   * client can use this interface to receive the real response asynchronously by
        +   * polling the operation resource, or pass the operation resource to another API
        +   * (such as Pub/Sub API) to receive the response.  Any API service that returns
        +   * long-running operations should implement the `Operations` interface so
        +   * developers can have a consistent client experience.
            * 
        */ public static final class OperationsStub extends io.grpc.stub.AbstractAsyncStub { @@ -475,13 +464,6 @@ protected OperationsStub build(io.grpc.Channel channel, io.grpc.CallOptions call *
              * Lists operations that match the specified filter in the request. If the
              * server doesn't support this method, it returns `UNIMPLEMENTED`.
        -     * NOTE: the `name` binding allows API services to override the binding
        -     * to use different resource name schemes, such as `users/*/operations`. To
        -     * override the binding, API services can add a binding such as
        -     * `"/v1/{name=users/*}/operations"` to their service configuration.
        -     * For backwards compatibility, the default name includes the operations
        -     * collection id, however overriding users must ensure the name binding
        -     * is the parent resource, without the operations collection id.
              * 
        */ public void listOperations( @@ -543,8 +525,9 @@ public void deleteOperation( * other methods to check whether the cancellation succeeded or whether the * operation completed despite cancellation. On successful cancellation, * the operation is not deleted; instead, it becomes an operation with - * an [Operation.error][google.longrunning.Operation.error] value with a [google.rpc.Status.code][google.rpc.Status.code] of 1, - * corresponding to `Code.CANCELLED`. + * an [Operation.error][google.longrunning.Operation.error] value with a + * [google.rpc.Status.code][google.rpc.Status.code] of `1`, corresponding to + * `Code.CANCELLED`. * */ public void cancelOperation( @@ -582,17 +565,133 @@ public void waitOperation( } /** + * A stub to allow clients to do synchronous rpc calls to service Operations. * + *
        +   * Manages long-running operations with an API service.
        +   * When an API method normally takes long time to complete, it can be designed
        +   * to return [Operation][google.longrunning.Operation] to the client, and the
        +   * client can use this interface to receive the real response asynchronously by
        +   * polling the operation resource, or pass the operation resource to another API
        +   * (such as Pub/Sub API) to receive the response.  Any API service that returns
        +   * long-running operations should implement the `Operations` interface so
        +   * developers can have a consistent client experience.
        +   * 
        + */ + public static final class OperationsBlockingV2Stub + extends io.grpc.stub.AbstractBlockingStub { + private OperationsBlockingV2Stub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected OperationsBlockingV2Stub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new OperationsBlockingV2Stub(channel, callOptions); + } + + /** + * + * + *
        +     * Lists operations that match the specified filter in the request. If the
        +     * server doesn't support this method, it returns `UNIMPLEMENTED`.
        +     * 
        + */ + public com.google.longrunning.ListOperationsResponse listOperations( + com.google.longrunning.ListOperationsRequest request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getListOperationsMethod(), getCallOptions(), request); + } + + /** + * + * + *
        +     * Gets the latest state of a long-running operation.  Clients can use this
        +     * method to poll the operation result at intervals as recommended by the API
        +     * service.
        +     * 
        + */ + public com.google.longrunning.Operation getOperation( + com.google.longrunning.GetOperationRequest request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getGetOperationMethod(), getCallOptions(), request); + } + + /** + * + * + *
        +     * Deletes a long-running operation. This method indicates that the client is
        +     * no longer interested in the operation result. It does not cancel the
        +     * operation. If the server doesn't support this method, it returns
        +     * `google.rpc.Code.UNIMPLEMENTED`.
        +     * 
        + */ + public com.google.protobuf.Empty deleteOperation( + com.google.longrunning.DeleteOperationRequest request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getDeleteOperationMethod(), getCallOptions(), request); + } + + /** + * + * + *
        +     * Starts asynchronous cancellation on a long-running operation.  The server
        +     * makes a best effort to cancel the operation, but success is not
        +     * guaranteed.  If the server doesn't support this method, it returns
        +     * `google.rpc.Code.UNIMPLEMENTED`.  Clients can use
        +     * [Operations.GetOperation][google.longrunning.Operations.GetOperation] or
        +     * other methods to check whether the cancellation succeeded or whether the
        +     * operation completed despite cancellation. On successful cancellation,
        +     * the operation is not deleted; instead, it becomes an operation with
        +     * an [Operation.error][google.longrunning.Operation.error] value with a
        +     * [google.rpc.Status.code][google.rpc.Status.code] of `1`, corresponding to
        +     * `Code.CANCELLED`.
        +     * 
        + */ + public com.google.protobuf.Empty cancelOperation( + com.google.longrunning.CancelOperationRequest request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getCancelOperationMethod(), getCallOptions(), request); + } + + /** + * + * + *
        +     * Waits until the specified long-running operation is done or reaches at most
        +     * a specified timeout, returning the latest state.  If the operation is
        +     * already done, the latest state is immediately returned.  If the timeout
        +     * specified is greater than the default HTTP/RPC timeout, the HTTP/RPC
        +     * timeout is used.  If the server does not support this method, it returns
        +     * `google.rpc.Code.UNIMPLEMENTED`.
        +     * Note that this method is on a best-effort basis.  It may return the latest
        +     * state before the specified timeout (including immediately), meaning even an
        +     * immediate response is no guarantee that the operation is done.
        +     * 
        + */ + public com.google.longrunning.Operation waitOperation( + com.google.longrunning.WaitOperationRequest request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getWaitOperationMethod(), getCallOptions(), request); + } + } + + /** + * A stub to allow clients to do limited synchronous rpc calls to service Operations. * *
            * Manages long-running operations with an API service.
            * When an API method normally takes long time to complete, it can be designed
        -   * to return [Operation][google.longrunning.Operation] to the client, and the client can use this
        -   * interface to receive the real response asynchronously by polling the
        -   * operation resource, or pass the operation resource to another API (such as
        -   * Google Cloud Pub/Sub API) to receive the response.  Any API service that
        -   * returns long-running operations should implement the `Operations` interface
        -   * so developers can have a consistent client experience.
        +   * to return [Operation][google.longrunning.Operation] to the client, and the
        +   * client can use this interface to receive the real response asynchronously by
        +   * polling the operation resource, or pass the operation resource to another API
        +   * (such as Pub/Sub API) to receive the response.  Any API service that returns
        +   * long-running operations should implement the `Operations` interface so
        +   * developers can have a consistent client experience.
            * 
        */ public static final class OperationsBlockingStub @@ -613,13 +712,6 @@ protected OperationsBlockingStub build( *
              * Lists operations that match the specified filter in the request. If the
              * server doesn't support this method, it returns `UNIMPLEMENTED`.
        -     * NOTE: the `name` binding allows API services to override the binding
        -     * to use different resource name schemes, such as `users/*/operations`. To
        -     * override the binding, API services can add a binding such as
        -     * `"/v1/{name=users/*}/operations"` to their service configuration.
        -     * For backwards compatibility, the default name includes the operations
        -     * collection id, however overriding users must ensure the name binding
        -     * is the parent resource, without the operations collection id.
              * 
        */ public com.google.longrunning.ListOperationsResponse listOperations( @@ -671,8 +763,9 @@ public com.google.protobuf.Empty deleteOperation( * other methods to check whether the cancellation succeeded or whether the * operation completed despite cancellation. On successful cancellation, * the operation is not deleted; instead, it becomes an operation with - * an [Operation.error][google.longrunning.Operation.error] value with a [google.rpc.Status.code][google.rpc.Status.code] of 1, - * corresponding to `Code.CANCELLED`. + * an [Operation.error][google.longrunning.Operation.error] value with a + * [google.rpc.Status.code][google.rpc.Status.code] of `1`, corresponding to + * `Code.CANCELLED`. * */ public com.google.protobuf.Empty cancelOperation( @@ -704,17 +797,17 @@ public com.google.longrunning.Operation waitOperation( } /** - * + * A stub to allow clients to do ListenableFuture-style rpc calls to service Operations. * *
            * Manages long-running operations with an API service.
            * When an API method normally takes long time to complete, it can be designed
        -   * to return [Operation][google.longrunning.Operation] to the client, and the client can use this
        -   * interface to receive the real response asynchronously by polling the
        -   * operation resource, or pass the operation resource to another API (such as
        -   * Google Cloud Pub/Sub API) to receive the response.  Any API service that
        -   * returns long-running operations should implement the `Operations` interface
        -   * so developers can have a consistent client experience.
        +   * to return [Operation][google.longrunning.Operation] to the client, and the
        +   * client can use this interface to receive the real response asynchronously by
        +   * polling the operation resource, or pass the operation resource to another API
        +   * (such as Pub/Sub API) to receive the response.  Any API service that returns
        +   * long-running operations should implement the `Operations` interface so
        +   * developers can have a consistent client experience.
            * 
        */ public static final class OperationsFutureStub @@ -734,13 +827,6 @@ protected OperationsFutureStub build(io.grpc.Channel channel, io.grpc.CallOption *
              * Lists operations that match the specified filter in the request. If the
              * server doesn't support this method, it returns `UNIMPLEMENTED`.
        -     * NOTE: the `name` binding allows API services to override the binding
        -     * to use different resource name schemes, such as `users/*/operations`. To
        -     * override the binding, API services can add a binding such as
        -     * `"/v1/{name=users/*}/operations"` to their service configuration.
        -     * For backwards compatibility, the default name includes the operations
        -     * collection id, however overriding users must ensure the name binding
        -     * is the parent resource, without the operations collection id.
              * 
        */ public com.google.common.util.concurrent.ListenableFuture< @@ -793,8 +879,9 @@ protected OperationsFutureStub build(io.grpc.Channel channel, io.grpc.CallOption * other methods to check whether the cancellation succeeded or whether the * operation completed despite cancellation. On successful cancellation, * the operation is not deleted; instead, it becomes an operation with - * an [Operation.error][google.longrunning.Operation.error] value with a [google.rpc.Status.code][google.rpc.Status.code] of 1, - * corresponding to `Code.CANCELLED`. + * an [Operation.error][google.longrunning.Operation.error] value with a + * [google.rpc.Status.code][google.rpc.Status.code] of `1`, corresponding to + * `Code.CANCELLED`. * */ public com.google.common.util.concurrent.ListenableFuture @@ -836,10 +923,10 @@ private static final class MethodHandlers io.grpc.stub.ServerCalls.ServerStreamingMethod, io.grpc.stub.ServerCalls.ClientStreamingMethod, io.grpc.stub.ServerCalls.BidiStreamingMethod { - private final OperationsImplBase serviceImpl; + private final AsyncService serviceImpl; private final int methodId; - MethodHandlers(OperationsImplBase serviceImpl, int methodId) { + MethodHandlers(AsyncService serviceImpl, int methodId) { this.serviceImpl = serviceImpl; this.methodId = methodId; } @@ -890,6 +977,42 @@ public io.grpc.stub.StreamObserver invoke( } } + public static final io.grpc.ServerServiceDefinition bindService(AsyncService service) { + return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) + .addMethod( + getListOperationsMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.longrunning.ListOperationsRequest, + com.google.longrunning.ListOperationsResponse>( + service, METHODID_LIST_OPERATIONS))) + .addMethod( + getGetOperationMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.longrunning.GetOperationRequest, com.google.longrunning.Operation>( + service, METHODID_GET_OPERATION))) + .addMethod( + getDeleteOperationMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.longrunning.DeleteOperationRequest, com.google.protobuf.Empty>( + service, METHODID_DELETE_OPERATION))) + .addMethod( + getCancelOperationMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.longrunning.CancelOperationRequest, com.google.protobuf.Empty>( + service, METHODID_CANCEL_OPERATION))) + .addMethod( + getWaitOperationMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.longrunning.WaitOperationRequest, com.google.longrunning.Operation>( + service, METHODID_WAIT_OPERATION))) + .build(); + } + private abstract static class OperationsBaseDescriptorSupplier implements io.grpc.protobuf.ProtoFileDescriptorSupplier, io.grpc.protobuf.ProtoServiceDescriptorSupplier { @@ -914,9 +1037,9 @@ private static final class OperationsFileDescriptorSupplier private static final class OperationsMethodDescriptorSupplier extends OperationsBaseDescriptorSupplier implements io.grpc.protobuf.ProtoMethodDescriptorSupplier { - private final String methodName; + private final java.lang.String methodName; - OperationsMethodDescriptorSupplier(String methodName) { + OperationsMethodDescriptorSupplier(java.lang.String methodName) { this.methodName = methodName; } diff --git a/java-common-protos/owlbot.py b/java-common-protos/owlbot.py index 0c9831271e..ffada9aa43 100644 --- a/java-common-protos/owlbot.py +++ b/java-common-protos/owlbot.py @@ -34,9 +34,17 @@ s.move(library) s.remove_staging_dirs() -java.common_templates(excludes=[ - 'README.md', - 'samples/*', - '.github/workflows/samples.yaml', - '.kokoro/dependencies.sh', +java.common_templates(monorepo=True, excludes=[ + ".github/*", + ".kokoro/*", + "samples/*", + "CODE_OF_CONDUCT.md", + "CONTRIBUTING.md", + "LICENSE", + "SECURITY.md", + "java.header", + "license-checks.xml", + "README.md", + "renovate.json", + ".gitignore" ]) diff --git a/java-common-protos/pom.xml b/java-common-protos/pom.xml index c846224ddc..2904f4c3a6 100644 --- a/java-common-protos/pom.xml +++ b/java-common-protos/pom.xml @@ -4,17 +4,16 @@ com.google.api.grpc google-common-protos-parent pom - 2.11.1-SNAPSHOT + 2.67.1-SNAPSHOT Google Common Protos Parent - https://github.com/googleapis/java-iam Java idiomatic client for Google Cloud Platform services. - com.google.cloud + com.google.api gapic-generator-java-pom-parent - 2.12.1-SNAPSHOT + 2.68.1-SNAPSHOT ../gapic-generator-java-pom-parent @@ -32,26 +31,6 @@ Google LLC - - scm:git@github.com:googleapis/java-common-protos.git - scm:git@github.com:googleapis/java-common-protos.git - https://github.com/googleapis/java-common-protos - HEAD - - - https://github.com/googleapis/java-common-protos/issues - GitHub Issues - - - - sonatype-nexus-snapshots - https://google.google.oss.sonatype.org/content/repositories/snapshots - - - sonatype-nexus-staging - https://google.google.oss.sonatype.org/service/local/staging/deploy/maven2/ - - Apache-2.0 @@ -64,12 +43,17 @@ UTF-8 github google-iam-parent - 4.13.2 - 31.1-jre + + com.google.cloud + third-party-dependencies + 3.58.1-SNAPSHOT + pom + import + com.google.protobuf protobuf-bom @@ -80,7 +64,7 @@ com.google.api.grpc grpc-google-common-protos - 2.11.1-SNAPSHOT + 2.67.1-SNAPSHOT io.grpc @@ -92,7 +76,7 @@ com.google.api.grpc proto-google-common-protos - 2.11.1-SNAPSHOT + 2.67.1-SNAPSHOT com.google.guava @@ -124,7 +108,7 @@ org.apache.maven.plugins maven-project-info-reports-plugin - 3.4.1 + 3.8.0 @@ -151,7 +135,6 @@ org.apache.maven.plugins maven-javadoc-plugin - 3.4.1 html @@ -185,4 +168,19 @@ + + + + + showcase-sonar-analysis + + + enableShowcaseTestCoverage + + + + true + + + diff --git a/java-common-protos/proto-google-common-protos/build.gradle b/java-common-protos/proto-google-common-protos/build.gradle deleted file mode 100644 index 5a72944b54..0000000000 --- a/java-common-protos/proto-google-common-protos/build.gradle +++ /dev/null @@ -1,50 +0,0 @@ -buildscript { - repositories { - mavenCentral() - } -} - -apply plugin: 'java' - -description = 'PROTO library for proto-google-common-protos' -group = 'com.google.api.grpc' -version = '1.17.0' -sourceCompatibility = 1.7 -targetCompatibility = 1.7 - -repositories { - mavenCentral() - mavenLocal() -} - -dependencies { - compile 'com.google.protobuf:protobuf-java:3.21.12' -} - -sourceSets { - main { - resources { - srcDir 'src/main/proto' - } - java { - srcDir 'src/main/java' - } - } -} - -task javadocJar(type: Jar) { - classifier = 'javadoc' - from javadoc -} - -task sourcesJar(type: Jar) { - classifier = 'sources' - from sourceSets.main.allSource -} - -artifacts { - archives javadocJar, sourcesJar -} - -compileJava.options.encoding = 'UTF-8' -javadoc.options.encoding = 'UTF-8' diff --git a/java-common-protos/proto-google-common-protos/clirr-ignored-differences.xml b/java-common-protos/proto-google-common-protos/clirr-ignored-differences.xml index 999a997772..60d228eeef 100644 --- a/java-common-protos/proto-google-common-protos/clirr-ignored-differences.xml +++ b/java-common-protos/proto-google-common-protos/clirr-ignored-differences.xml @@ -15,7 +15,18 @@ 7012 com/google/api/*OrBuilder boolean has*(*) - + + + 7012 + com/google/apps/card/*/*OrBuilder + * get*(*) + + + 7012 + com/google/apps/card/*/*OrBuilder + * has*(*) + + 7012 com/google/cloud/audit/*OrBuilder * get*(*) @@ -128,4 +139,66 @@ com/google/type/*OrBuilder boolean has*(*) + + + + 7006 + com/google/** + * getDefaultInstanceForType() + ** + + + 7006 + com/google/** + * addRepeatedField(*) + ** + + + 7006 + com/google/** + * clear() + ** + + + 7006 + com/google/** + * clearField(*) + ** + + + 7006 + com/google/** + * clearOneof(*) + ** + + + 7006 + com/google/** + * clone() + ** + + + 7006 + com/google/** + * mergeUnknownFields(*) + ** + + + 7006 + com/google/** + * setField(*) + ** + + + 7006 + com/google/** + * setRepeatedField(*) + ** + + + 7006 + com/google/** + * setUnknownFields(*) + ** + diff --git a/java-common-protos/proto-google-common-protos/pom.xml b/java-common-protos/proto-google-common-protos/pom.xml index 547c24a2b1..7dceee1f9a 100644 --- a/java-common-protos/proto-google-common-protos/pom.xml +++ b/java-common-protos/proto-google-common-protos/pom.xml @@ -3,13 +3,13 @@ 4.0.0 com.google.api.grpc proto-google-common-protos - 2.11.1-SNAPSHOT + 2.67.1-SNAPSHOT proto-google-common-protos PROTO library for proto-google-common-protos com.google.api.grpc google-common-protos-parent - 2.11.1-SNAPSHOT + 2.67.1-SNAPSHOT diff --git a/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/Advice.java b/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/Advice.java index 05efc2e8ae..f449ff9fc6 100644 --- a/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/Advice.java +++ b/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/Advice.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,9 @@ * limitations under the License. */ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: google/api/config_change.proto +// Protobuf Java Version: 4.33.2 package com.google.api; @@ -28,13 +30,25 @@ * * Protobuf type {@code google.api.Advice} */ -public final class Advice extends com.google.protobuf.GeneratedMessageV3 +@com.google.protobuf.Generated +public final class Advice extends com.google.protobuf.GeneratedMessage implements // @@protoc_insertion_point(message_implements:google.api.Advice) AdviceOrBuilder { private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "Advice"); + } + // Use Advice.newBuilder() to construct. - private Advice(com.google.protobuf.GeneratedMessageV3.Builder builder) { + private Advice(com.google.protobuf.GeneratedMessage.Builder builder) { super(builder); } @@ -42,23 +56,12 @@ private Advice() { description_ = ""; } - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new Advice(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.api.ConfigChangeProto.internal_static_google_api_Advice_descriptor; } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.api.ConfigChangeProto.internal_static_google_api_Advice_fieldAccessorTable .ensureFieldAccessorsInitialized( @@ -66,7 +69,10 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } public static final int DESCRIPTION_FIELD_NUMBER = 2; - private volatile java.lang.Object description_; + + @SuppressWarnings("serial") + private volatile java.lang.Object description_ = ""; + /** * * @@ -91,6 +97,7 @@ public java.lang.String getDescription() { return s; } } + /** * * @@ -130,8 +137,8 @@ public final boolean isInitialized() { @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(description_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 2, description_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(description_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, description_); } getUnknownFields().writeTo(output); } @@ -142,8 +149,8 @@ public int getSerializedSize() { if (size != -1) return size; size = 0; - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(description_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, description_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(description_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, description_); } size += getUnknownFields().getSerializedSize(); memoizedSize = size; @@ -215,38 +222,38 @@ public static com.google.api.Advice parseFrom( public static com.google.api.Advice parseFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); } public static com.google.api.Advice parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } public static com.google.api.Advice parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); } public static com.google.api.Advice parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( PARSER, input, extensionRegistry); } public static com.google.api.Advice parseFrom(com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); } public static com.google.api.Advice parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } @@ -269,10 +276,11 @@ public Builder toBuilder() { } @java.lang.Override - protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { Builder builder = new Builder(parent); return builder; } + /** * * @@ -283,7 +291,7 @@ protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.Build * * Protobuf type {@code google.api.Advice} */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder implements // @@protoc_insertion_point(builder_implements:google.api.Advice) com.google.api.AdviceOrBuilder { @@ -292,7 +300,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.api.ConfigChangeProto.internal_static_google_api_Advice_fieldAccessorTable .ensureFieldAccessorsInitialized( @@ -302,15 +310,15 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { // Construct using com.google.api.Advice.newBuilder() private Builder() {} - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { super(parent); } @java.lang.Override public Builder clear() { super.clear(); + bitField0_ = 0; description_ = ""; - return this; } @@ -336,42 +344,18 @@ public com.google.api.Advice build() { @java.lang.Override public com.google.api.Advice buildPartial() { com.google.api.Advice result = new com.google.api.Advice(this); - result.description_ = description_; + if (bitField0_ != 0) { + buildPartial0(result); + } 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); + private void buildPartial0(com.google.api.Advice result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.description_ = description_; + } } @java.lang.Override @@ -388,6 +372,7 @@ public Builder mergeFrom(com.google.api.Advice other) { if (other == com.google.api.Advice.getDefaultInstance()) return this; if (!other.getDescription().isEmpty()) { description_ = other.description_; + bitField0_ |= 0x00000001; onChanged(); } this.mergeUnknownFields(other.getUnknownFields()); @@ -419,7 +404,7 @@ public Builder mergeFrom( case 18: { description_ = input.readStringRequireUtf8(); - + bitField0_ |= 0x00000001; break; } // case 18 default: @@ -439,7 +424,10 @@ public Builder mergeFrom( return this; } + private int bitField0_; + private java.lang.Object description_ = ""; + /** * * @@ -463,6 +451,7 @@ public java.lang.String getDescription() { return (java.lang.String) ref; } } + /** * * @@ -486,6 +475,7 @@ public com.google.protobuf.ByteString getDescriptionBytes() { return (com.google.protobuf.ByteString) ref; } } + /** * * @@ -503,11 +493,12 @@ public Builder setDescription(java.lang.String value) { if (value == null) { throw new NullPointerException(); } - description_ = value; + bitField0_ |= 0x00000001; onChanged(); return this; } + /** * * @@ -521,11 +512,12 @@ public Builder setDescription(java.lang.String value) { * @return This builder for chaining. */ public Builder clearDescription() { - description_ = getDefaultInstance().getDescription(); + bitField0_ = (bitField0_ & ~0x00000001); onChanged(); return this; } + /** * * @@ -544,23 +536,12 @@ public Builder setDescriptionBytes(com.google.protobuf.ByteString value) { throw new NullPointerException(); } checkByteStringIsUtf8(value); - description_ = 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.api.Advice) } diff --git a/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/AdviceOrBuilder.java b/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/AdviceOrBuilder.java index 313e6ff8d9..b65d8c7786 100644 --- a/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/AdviceOrBuilder.java +++ b/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/AdviceOrBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,10 +14,13 @@ * limitations under the License. */ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: google/api/config_change.proto +// Protobuf Java Version: 4.33.2 package com.google.api; +@com.google.protobuf.Generated public interface AdviceOrBuilder extends // @@protoc_insertion_point(interface_extends:google.api.Advice) @@ -36,6 +39,7 @@ public interface AdviceOrBuilder * @return The description. */ java.lang.String getDescription(); + /** * * diff --git a/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/AnnotationsProto.java b/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/AnnotationsProto.java index fb7f8ed52d..dd50570e1e 100644 --- a/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/AnnotationsProto.java +++ b/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/AnnotationsProto.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,13 +14,26 @@ * limitations under the License. */ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: google/api/annotations.proto +// Protobuf Java Version: 4.33.2 package com.google.api; -public final class AnnotationsProto { +@com.google.protobuf.Generated +public final class AnnotationsProto extends com.google.protobuf.GeneratedFile { private AnnotationsProto() {} + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "AnnotationsProto"); + } + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistryLite registry) { registry.add(com.google.api.AnnotationsProto.http); } @@ -30,6 +43,7 @@ public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry r } public static final int HTTP_FIELD_NUMBER = 72295728; + /** * * @@ -69,7 +83,8 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { com.google.api.HttpProto.getDescriptor(), com.google.protobuf.DescriptorProtos.getDescriptor(), }); - http.internalInit(descriptor.getExtensions().get(0)); + http.internalInit(descriptor.getExtension(0)); + descriptor.resolveAllFeaturesImmutable(); com.google.api.HttpProto.getDescriptor(); com.google.protobuf.DescriptorProtos.getDescriptor(); } diff --git a/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/AuthProto.java b/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/AuthProto.java index 61f9e9c64d..6c2cab7418 100644 --- a/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/AuthProto.java +++ b/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/AuthProto.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,13 +14,26 @@ * limitations under the License. */ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: google/api/auth.proto +// Protobuf Java Version: 4.33.2 package com.google.api; -public final class AuthProto { +@com.google.protobuf.Generated +public final class AuthProto extends com.google.protobuf.GeneratedFile { private AuthProto() {} + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "AuthProto"); + } + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistryLite registry) {} public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry registry) { @@ -29,27 +42,27 @@ public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry r static final com.google.protobuf.Descriptors.Descriptor internal_static_google_api_Authentication_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable internal_static_google_api_Authentication_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_google_api_AuthenticationRule_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable internal_static_google_api_AuthenticationRule_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_google_api_JwtLocation_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable internal_static_google_api_JwtLocation_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_google_api_AuthProvider_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable internal_static_google_api_AuthProvider_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_google_api_OAuthRequirements_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable internal_static_google_api_OAuthRequirements_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_google_api_AuthRequirement_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable internal_static_google_api_AuthRequirement_fieldAccessorTable; public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { @@ -60,75 +73,84 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { static { java.lang.String[] descriptorData = { - "\n\025google/api/auth.proto\022\ngoogle.api\"l\n\016A" - + "uthentication\022-\n\005rules\030\003 \003(\0132\036.google.ap" - + "i.AuthenticationRule\022+\n\tproviders\030\004 \003(\0132" - + "\030.google.api.AuthProvider\"\251\001\n\022Authentica" - + "tionRule\022\020\n\010selector\030\001 \001(\t\022,\n\005oauth\030\002 \001(" - + "\0132\035.google.api.OAuthRequirements\022 \n\030allo" - + "w_without_credential\030\005 \001(\010\0221\n\014requiremen" - + "ts\030\007 \003(\0132\033.google.api.AuthRequirement\"^\n" - + "\013JwtLocation\022\020\n\006header\030\001 \001(\tH\000\022\017\n\005query\030" - + "\002 \001(\tH\000\022\020\n\006cookie\030\004 \001(\tH\000\022\024\n\014value_prefi" - + "x\030\003 \001(\tB\004\n\002in\"\232\001\n\014AuthProvider\022\n\n\002id\030\001 \001" - + "(\t\022\016\n\006issuer\030\002 \001(\t\022\020\n\010jwks_uri\030\003 \001(\t\022\021\n\t" - + "audiences\030\004 \001(\t\022\031\n\021authorization_url\030\005 \001" - + "(\t\022.\n\rjwt_locations\030\006 \003(\0132\027.google.api.J" - + "wtLocation\"-\n\021OAuthRequirements\022\030\n\020canon" - + "ical_scopes\030\001 \001(\t\"9\n\017AuthRequirement\022\023\n\013" - + "provider_id\030\001 \001(\t\022\021\n\taudiences\030\002 \001(\tBk\n\016" - + "com.google.apiB\tAuthProtoP\001ZEgoogle.gola" - + "ng.org/genproto/googleapis/api/serviceco" - + "nfig;serviceconfig\242\002\004GAPIb\006proto3" + "\n" + + "\025google/api/auth.proto\022\n" + + "google.api\"l\n" + + "\016Authentication\022-\n" + + "\005rules\030\003 \003(\0132\036.google.api.AuthenticationRule\022+\n" + + "\tproviders\030\004 \003(\0132\030.google.api.AuthProvider\"\251\001\n" + + "\022AuthenticationRule\022\020\n" + + "\010selector\030\001 \001(\t\022,\n" + + "\005oauth\030\002 \001(\0132\035.google.api.OAuthRequirements\022 \n" + + "\030allow_without_credential\030\005 \001(\010\0221\n" + + "\014requirements\030\007 \003(\0132\033.google.api.AuthRequirement\"^\n" + + "\013JwtLocation\022\020\n" + + "\006header\030\001 \001(\tH\000\022\017\n" + + "\005query\030\002 \001(\tH\000\022\020\n" + + "\006cookie\030\004 \001(\tH\000\022\024\n" + + "\014value_prefix\030\003 \001(\tB\004\n" + + "\002in\"\232\001\n" + + "\014AuthProvider\022\n\n" + + "\002id\030\001 \001(\t\022\016\n" + + "\006issuer\030\002 \001(\t\022\020\n" + + "\010jwks_uri\030\003 \001(\t\022\021\n" + + "\taudiences\030\004 \001(\t\022\031\n" + + "\021authorization_url\030\005 \001(\t\022.\n\r" + + "jwt_locations\030\006 \003(\0132\027.google.api.JwtLocation\"-\n" + + "\021OAuthRequirements\022\030\n" + + "\020canonical_scopes\030\001 \001(\t\"9\n" + + "\017AuthRequirement\022\023\n" + + "\013provider_id\030\001 \001(\t\022\021\n" + + "\taudiences\030\002 \001(\tBk\n" + + "\016com.google.apiB\tAuthProtoP\001ZEgoogle.gola" + + "ng.org/genproto/googleapis/api/serviceconfig;serviceconfig\242\002\004GAPIb\006proto3" }; descriptor = com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( descriptorData, new com.google.protobuf.Descriptors.FileDescriptor[] {}); - internal_static_google_api_Authentication_descriptor = getDescriptor().getMessageTypes().get(0); + internal_static_google_api_Authentication_descriptor = getDescriptor().getMessageType(0); internal_static_google_api_Authentication_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_google_api_Authentication_descriptor, new java.lang.String[] { "Rules", "Providers", }); - internal_static_google_api_AuthenticationRule_descriptor = - getDescriptor().getMessageTypes().get(1); + internal_static_google_api_AuthenticationRule_descriptor = getDescriptor().getMessageType(1); internal_static_google_api_AuthenticationRule_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_google_api_AuthenticationRule_descriptor, new java.lang.String[] { "Selector", "Oauth", "AllowWithoutCredential", "Requirements", }); - internal_static_google_api_JwtLocation_descriptor = getDescriptor().getMessageTypes().get(2); + internal_static_google_api_JwtLocation_descriptor = getDescriptor().getMessageType(2); internal_static_google_api_JwtLocation_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_google_api_JwtLocation_descriptor, new java.lang.String[] { "Header", "Query", "Cookie", "ValuePrefix", "In", }); - internal_static_google_api_AuthProvider_descriptor = getDescriptor().getMessageTypes().get(3); + internal_static_google_api_AuthProvider_descriptor = getDescriptor().getMessageType(3); internal_static_google_api_AuthProvider_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_google_api_AuthProvider_descriptor, new java.lang.String[] { "Id", "Issuer", "JwksUri", "Audiences", "AuthorizationUrl", "JwtLocations", }); - internal_static_google_api_OAuthRequirements_descriptor = - getDescriptor().getMessageTypes().get(4); + internal_static_google_api_OAuthRequirements_descriptor = getDescriptor().getMessageType(4); internal_static_google_api_OAuthRequirements_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_google_api_OAuthRequirements_descriptor, new java.lang.String[] { "CanonicalScopes", }); - internal_static_google_api_AuthRequirement_descriptor = - getDescriptor().getMessageTypes().get(5); + internal_static_google_api_AuthRequirement_descriptor = getDescriptor().getMessageType(5); internal_static_google_api_AuthRequirement_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_google_api_AuthRequirement_descriptor, new java.lang.String[] { "ProviderId", "Audiences", }); + descriptor.resolveAllFeaturesImmutable(); } // @@protoc_insertion_point(outer_class_scope) diff --git a/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/AuthProvider.java b/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/AuthProvider.java index 7cdf1596f1..d5fe62d1e8 100644 --- a/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/AuthProvider.java +++ b/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/AuthProvider.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,9 @@ * limitations under the License. */ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: google/api/auth.proto +// Protobuf Java Version: 4.33.2 package com.google.api; @@ -29,13 +31,25 @@ * * Protobuf type {@code google.api.AuthProvider} */ -public final class AuthProvider extends com.google.protobuf.GeneratedMessageV3 +@com.google.protobuf.Generated +public final class AuthProvider extends com.google.protobuf.GeneratedMessage implements // @@protoc_insertion_point(message_implements:google.api.AuthProvider) AuthProviderOrBuilder { private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "AuthProvider"); + } + // Use AuthProvider.newBuilder() to construct. - private AuthProvider(com.google.protobuf.GeneratedMessageV3.Builder builder) { + private AuthProvider(com.google.protobuf.GeneratedMessage.Builder builder) { super(builder); } @@ -48,23 +62,12 @@ private AuthProvider() { jwtLocations_ = java.util.Collections.emptyList(); } - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new AuthProvider(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.api.AuthProto.internal_static_google_api_AuthProvider_descriptor; } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.api.AuthProto.internal_static_google_api_AuthProvider_fieldAccessorTable .ensureFieldAccessorsInitialized( @@ -72,13 +75,17 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } public static final int ID_FIELD_NUMBER = 1; - private volatile java.lang.Object id_; + + @SuppressWarnings("serial") + private volatile java.lang.Object id_ = ""; + /** * * *
            * The unique identifier of the auth provider. It will be referred to by
            * `AuthRequirement.provider_id`.
        +   *
            * Example: "bookstore_auth".
            * 
        * @@ -98,12 +105,14 @@ public java.lang.String getId() { return s; } } + /** * * *
            * The unique identifier of the auth provider. It will be referred to by
            * `AuthRequirement.provider_id`.
        +   *
            * Example: "bookstore_auth".
            * 
        * @@ -125,7 +134,10 @@ public com.google.protobuf.ByteString getIdBytes() { } public static final int ISSUER_FIELD_NUMBER = 2; - private volatile java.lang.Object issuer_; + + @SuppressWarnings("serial") + private volatile java.lang.Object issuer_ = ""; + /** * * @@ -133,6 +145,7 @@ public com.google.protobuf.ByteString getIdBytes() { * Identifies the principal that issued the JWT. See * https://tools.ietf.org/html/draft-ietf-oauth-json-web-token-32#section-4.1.1 * Usually a URL or an email address. + * * Example: https://securetoken.google.com * Example: 1234567-compute@developer.gserviceaccount.com * @@ -153,6 +166,7 @@ public java.lang.String getIssuer() { return s; } } + /** * * @@ -160,6 +174,7 @@ public java.lang.String getIssuer() { * Identifies the principal that issued the JWT. See * https://tools.ietf.org/html/draft-ietf-oauth-json-web-token-32#section-4.1.1 * Usually a URL or an email address. + * * Example: https://securetoken.google.com * Example: 1234567-compute@developer.gserviceaccount.com * @@ -182,7 +197,10 @@ public com.google.protobuf.ByteString getIssuerBytes() { } public static final int JWKS_URI_FIELD_NUMBER = 3; - private volatile java.lang.Object jwksUri_; + + @SuppressWarnings("serial") + private volatile java.lang.Object jwksUri_ = ""; + /** * * @@ -191,12 +209,13 @@ public com.google.protobuf.ByteString getIssuerBytes() { * [OpenID * Discovery](https://openid.net/specs/openid-connect-discovery-1_0.html#ProviderMetadata). * Optional if the key set document: - * - can be retrieved from - * [OpenID - * Discovery](https://openid.net/specs/openid-connect-discovery-1_0.html) - * of the issuer. - * - can be inferred from the email domain of the issuer (e.g. a Google - * service account). + * - can be retrieved from + * [OpenID + * Discovery](https://openid.net/specs/openid-connect-discovery-1_0.html) + * of the issuer. + * - can be inferred from the email domain of the issuer (e.g. a Google + * service account). + * * Example: https://www.googleapis.com/oauth2/v1/certs * * @@ -216,6 +235,7 @@ public java.lang.String getJwksUri() { return s; } } + /** * * @@ -224,12 +244,13 @@ public java.lang.String getJwksUri() { * [OpenID * Discovery](https://openid.net/specs/openid-connect-discovery-1_0.html#ProviderMetadata). * Optional if the key set document: - * - can be retrieved from - * [OpenID - * Discovery](https://openid.net/specs/openid-connect-discovery-1_0.html) - * of the issuer. - * - can be inferred from the email domain of the issuer (e.g. a Google - * service account). + * - can be retrieved from + * [OpenID + * Discovery](https://openid.net/specs/openid-connect-discovery-1_0.html) + * of the issuer. + * - can be inferred from the email domain of the issuer (e.g. a Google + * service account). + * * Example: https://www.googleapis.com/oauth2/v1/certs * * @@ -251,7 +272,10 @@ public com.google.protobuf.ByteString getJwksUriBytes() { } public static final int AUDIENCES_FIELD_NUMBER = 4; - private volatile java.lang.Object audiences_; + + @SuppressWarnings("serial") + private volatile java.lang.Object audiences_ = ""; + /** * * @@ -260,17 +284,19 @@ public com.google.protobuf.ByteString getJwksUriBytes() { * [audiences](https://tools.ietf.org/html/draft-ietf-oauth-json-web-token-32#section-4.1.3). * that are allowed to access. A JWT containing any of these audiences will * be accepted. When this setting is absent, JWTs with audiences: - * - "https://[service.name]/[google.protobuf.Api.name]" - * - "https://[service.name]/" + * - "https://[service.name]/[google.protobuf.Api.name]" + * - "https://[service.name]/" * will be accepted. * For example, if no audiences are in the setting, LibraryService API will * accept JWTs with the following audiences: - * - - * https://library-example.googleapis.com/google.example.library.v1.LibraryService - * - https://library-example.googleapis.com/ + * - + * https://library-example.googleapis.com/google.example.library.v1.LibraryService + * - https://library-example.googleapis.com/ + * * Example: - * audiences: bookstore_android.apps.googleusercontent.com, - * bookstore_web.apps.googleusercontent.com + * + * audiences: bookstore_android.apps.googleusercontent.com, + * bookstore_web.apps.googleusercontent.com * * * string audiences = 4; @@ -289,6 +315,7 @@ public java.lang.String getAudiences() { return s; } } + /** * * @@ -297,17 +324,19 @@ public java.lang.String getAudiences() { * [audiences](https://tools.ietf.org/html/draft-ietf-oauth-json-web-token-32#section-4.1.3). * that are allowed to access. A JWT containing any of these audiences will * be accepted. When this setting is absent, JWTs with audiences: - * - "https://[service.name]/[google.protobuf.Api.name]" - * - "https://[service.name]/" + * - "https://[service.name]/[google.protobuf.Api.name]" + * - "https://[service.name]/" * will be accepted. * For example, if no audiences are in the setting, LibraryService API will * accept JWTs with the following audiences: - * - - * https://library-example.googleapis.com/google.example.library.v1.LibraryService - * - https://library-example.googleapis.com/ + * - + * https://library-example.googleapis.com/google.example.library.v1.LibraryService + * - https://library-example.googleapis.com/ + * * Example: - * audiences: bookstore_android.apps.googleusercontent.com, - * bookstore_web.apps.googleusercontent.com + * + * audiences: bookstore_android.apps.googleusercontent.com, + * bookstore_web.apps.googleusercontent.com * * * string audiences = 4; @@ -328,7 +357,10 @@ public com.google.protobuf.ByteString getAudiencesBytes() { } public static final int AUTHORIZATION_URL_FIELD_NUMBER = 5; - private volatile java.lang.Object authorizationUrl_; + + @SuppressWarnings("serial") + private volatile java.lang.Object authorizationUrl_ = ""; + /** * * @@ -353,6 +385,7 @@ public java.lang.String getAuthorizationUrl() { return s; } } + /** * * @@ -379,7 +412,10 @@ public com.google.protobuf.ByteString getAuthorizationUrlBytes() { } public static final int JWT_LOCATIONS_FIELD_NUMBER = 6; + + @SuppressWarnings("serial") private java.util.List jwtLocations_; + /** * * @@ -387,18 +423,21 @@ public com.google.protobuf.ByteString getAuthorizationUrlBytes() { * Defines the locations to extract the JWT. For now it is only used by the * Cloud Endpoints to store the OpenAPI extension [x-google-jwt-locations] * (https://cloud.google.com/endpoints/docs/openapi/openapi-extensions#x-google-jwt-locations) + * * JWT locations can be one of HTTP headers, URL query parameters or * cookies. The rule is that the first match wins. + * * If not specified, default to use following 3 locations: - * 1) Authorization: Bearer - * 2) x-goog-iap-jwt-assertion - * 3) access_token query parameter + * 1) Authorization: Bearer + * 2) x-goog-iap-jwt-assertion + * 3) access_token query parameter + * * Default locations can be specified as followings: - * jwt_locations: - * - header: Authorization - * value_prefix: "Bearer " - * - header: x-goog-iap-jwt-assertion - * - query: access_token + * jwt_locations: + * - header: Authorization + * value_prefix: "Bearer " + * - header: x-goog-iap-jwt-assertion + * - query: access_token * * * repeated .google.api.JwtLocation jwt_locations = 6; @@ -407,6 +446,7 @@ public com.google.protobuf.ByteString getAuthorizationUrlBytes() { public java.util.List getJwtLocationsList() { return jwtLocations_; } + /** * * @@ -414,18 +454,21 @@ public java.util.List getJwtLocationsList() { * Defines the locations to extract the JWT. For now it is only used by the * Cloud Endpoints to store the OpenAPI extension [x-google-jwt-locations] * (https://cloud.google.com/endpoints/docs/openapi/openapi-extensions#x-google-jwt-locations) + * * JWT locations can be one of HTTP headers, URL query parameters or * cookies. The rule is that the first match wins. + * * If not specified, default to use following 3 locations: - * 1) Authorization: Bearer - * 2) x-goog-iap-jwt-assertion - * 3) access_token query parameter + * 1) Authorization: Bearer + * 2) x-goog-iap-jwt-assertion + * 3) access_token query parameter + * * Default locations can be specified as followings: - * jwt_locations: - * - header: Authorization - * value_prefix: "Bearer " - * - header: x-goog-iap-jwt-assertion - * - query: access_token + * jwt_locations: + * - header: Authorization + * value_prefix: "Bearer " + * - header: x-goog-iap-jwt-assertion + * - query: access_token * * * repeated .google.api.JwtLocation jwt_locations = 6; @@ -435,6 +478,7 @@ public java.util.List getJwtLocationsList() { getJwtLocationsOrBuilderList() { return jwtLocations_; } + /** * * @@ -442,18 +486,21 @@ public java.util.List getJwtLocationsList() { * Defines the locations to extract the JWT. For now it is only used by the * Cloud Endpoints to store the OpenAPI extension [x-google-jwt-locations] * (https://cloud.google.com/endpoints/docs/openapi/openapi-extensions#x-google-jwt-locations) + * * JWT locations can be one of HTTP headers, URL query parameters or * cookies. The rule is that the first match wins. + * * If not specified, default to use following 3 locations: - * 1) Authorization: Bearer - * 2) x-goog-iap-jwt-assertion - * 3) access_token query parameter + * 1) Authorization: Bearer + * 2) x-goog-iap-jwt-assertion + * 3) access_token query parameter + * * Default locations can be specified as followings: - * jwt_locations: - * - header: Authorization - * value_prefix: "Bearer " - * - header: x-goog-iap-jwt-assertion - * - query: access_token + * jwt_locations: + * - header: Authorization + * value_prefix: "Bearer " + * - header: x-goog-iap-jwt-assertion + * - query: access_token * * * repeated .google.api.JwtLocation jwt_locations = 6; @@ -462,6 +509,7 @@ public java.util.List getJwtLocationsList() { public int getJwtLocationsCount() { return jwtLocations_.size(); } + /** * * @@ -469,18 +517,21 @@ public int getJwtLocationsCount() { * Defines the locations to extract the JWT. For now it is only used by the * Cloud Endpoints to store the OpenAPI extension [x-google-jwt-locations] * (https://cloud.google.com/endpoints/docs/openapi/openapi-extensions#x-google-jwt-locations) + * * JWT locations can be one of HTTP headers, URL query parameters or * cookies. The rule is that the first match wins. + * * If not specified, default to use following 3 locations: - * 1) Authorization: Bearer - * 2) x-goog-iap-jwt-assertion - * 3) access_token query parameter + * 1) Authorization: Bearer + * 2) x-goog-iap-jwt-assertion + * 3) access_token query parameter + * * Default locations can be specified as followings: - * jwt_locations: - * - header: Authorization - * value_prefix: "Bearer " - * - header: x-goog-iap-jwt-assertion - * - query: access_token + * jwt_locations: + * - header: Authorization + * value_prefix: "Bearer " + * - header: x-goog-iap-jwt-assertion + * - query: access_token * * * repeated .google.api.JwtLocation jwt_locations = 6; @@ -489,6 +540,7 @@ public int getJwtLocationsCount() { public com.google.api.JwtLocation getJwtLocations(int index) { return jwtLocations_.get(index); } + /** * * @@ -496,18 +548,21 @@ public com.google.api.JwtLocation getJwtLocations(int index) { * Defines the locations to extract the JWT. For now it is only used by the * Cloud Endpoints to store the OpenAPI extension [x-google-jwt-locations] * (https://cloud.google.com/endpoints/docs/openapi/openapi-extensions#x-google-jwt-locations) + * * JWT locations can be one of HTTP headers, URL query parameters or * cookies. The rule is that the first match wins. + * * If not specified, default to use following 3 locations: - * 1) Authorization: Bearer - * 2) x-goog-iap-jwt-assertion - * 3) access_token query parameter + * 1) Authorization: Bearer + * 2) x-goog-iap-jwt-assertion + * 3) access_token query parameter + * * Default locations can be specified as followings: - * jwt_locations: - * - header: Authorization - * value_prefix: "Bearer " - * - header: x-goog-iap-jwt-assertion - * - query: access_token + * jwt_locations: + * - header: Authorization + * value_prefix: "Bearer " + * - header: x-goog-iap-jwt-assertion + * - query: access_token * * * repeated .google.api.JwtLocation jwt_locations = 6; @@ -531,20 +586,20 @@ public final boolean isInitialized() { @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.GeneratedMessage.isStringEmpty(id_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, id_); } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(issuer_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 2, issuer_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(issuer_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, issuer_); } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(jwksUri_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 3, jwksUri_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(jwksUri_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 3, jwksUri_); } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(audiences_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 4, audiences_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(audiences_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 4, audiences_); } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(authorizationUrl_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 5, authorizationUrl_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(authorizationUrl_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 5, authorizationUrl_); } for (int i = 0; i < jwtLocations_.size(); i++) { output.writeMessage(6, jwtLocations_.get(i)); @@ -558,20 +613,20 @@ public int getSerializedSize() { 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.GeneratedMessage.isStringEmpty(id_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, id_); } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(issuer_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, issuer_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(issuer_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, issuer_); } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(jwksUri_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, jwksUri_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(jwksUri_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(3, jwksUri_); } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(audiences_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, audiences_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(audiences_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(4, audiences_); } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(authorizationUrl_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, authorizationUrl_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(authorizationUrl_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(5, authorizationUrl_); } for (int i = 0; i < jwtLocations_.size(); i++) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(6, jwtLocations_.get(i)); @@ -663,38 +718,38 @@ public static com.google.api.AuthProvider parseFrom( public static com.google.api.AuthProvider parseFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); } public static com.google.api.AuthProvider parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } public static com.google.api.AuthProvider parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); } public static com.google.api.AuthProvider parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( PARSER, input, extensionRegistry); } public static com.google.api.AuthProvider parseFrom(com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); } public static com.google.api.AuthProvider parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } @@ -717,10 +772,11 @@ public Builder toBuilder() { } @java.lang.Override - protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { Builder builder = new Builder(parent); return builder; } + /** * * @@ -732,7 +788,7 @@ protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.Build * * Protobuf type {@code google.api.AuthProvider} */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder implements // @@protoc_insertion_point(builder_implements:google.api.AuthProvider) com.google.api.AuthProviderOrBuilder { @@ -741,7 +797,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.api.AuthProto.internal_static_google_api_AuthProvider_fieldAccessorTable .ensureFieldAccessorsInitialized( @@ -751,30 +807,26 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { // Construct using com.google.api.AuthProvider.newBuilder() private Builder() {} - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { super(parent); } @java.lang.Override public Builder clear() { super.clear(); + bitField0_ = 0; id_ = ""; - issuer_ = ""; - jwksUri_ = ""; - audiences_ = ""; - authorizationUrl_ = ""; - if (jwtLocationsBuilder_ == null) { jwtLocations_ = java.util.Collections.emptyList(); } else { jwtLocations_ = null; jwtLocationsBuilder_.clear(); } - bitField0_ = (bitField0_ & ~0x00000001); + bitField0_ = (bitField0_ & ~0x00000020); return this; } @@ -800,56 +852,43 @@ public com.google.api.AuthProvider build() { @java.lang.Override public com.google.api.AuthProvider buildPartial() { com.google.api.AuthProvider result = new com.google.api.AuthProvider(this); - int from_bitField0_ = bitField0_; - result.id_ = id_; - result.issuer_ = issuer_; - result.jwksUri_ = jwksUri_; - result.audiences_ = audiences_; - result.authorizationUrl_ = authorizationUrl_; + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields(com.google.api.AuthProvider result) { if (jwtLocationsBuilder_ == null) { - if (((bitField0_ & 0x00000001) != 0)) { + if (((bitField0_ & 0x00000020) != 0)) { jwtLocations_ = java.util.Collections.unmodifiableList(jwtLocations_); - bitField0_ = (bitField0_ & ~0x00000001); + bitField0_ = (bitField0_ & ~0x00000020); } result.jwtLocations_ = jwtLocations_; } else { result.jwtLocations_ = jwtLocationsBuilder_.build(); } - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.setField(field, value); } - @java.lang.Override - public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - - @java.lang.Override - public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.addRepeatedField(field, value); + private void buildPartial0(com.google.api.AuthProvider result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.id_ = id_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.issuer_ = issuer_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.jwksUri_ = jwksUri_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.audiences_ = audiences_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.authorizationUrl_ = authorizationUrl_; + } } @java.lang.Override @@ -866,29 +905,34 @@ public Builder mergeFrom(com.google.api.AuthProvider other) { if (other == com.google.api.AuthProvider.getDefaultInstance()) return this; if (!other.getId().isEmpty()) { id_ = other.id_; + bitField0_ |= 0x00000001; onChanged(); } if (!other.getIssuer().isEmpty()) { issuer_ = other.issuer_; + bitField0_ |= 0x00000002; onChanged(); } if (!other.getJwksUri().isEmpty()) { jwksUri_ = other.jwksUri_; + bitField0_ |= 0x00000004; onChanged(); } if (!other.getAudiences().isEmpty()) { audiences_ = other.audiences_; + bitField0_ |= 0x00000008; onChanged(); } if (!other.getAuthorizationUrl().isEmpty()) { authorizationUrl_ = other.authorizationUrl_; + bitField0_ |= 0x00000010; onChanged(); } if (jwtLocationsBuilder_ == null) { if (!other.jwtLocations_.isEmpty()) { if (jwtLocations_.isEmpty()) { jwtLocations_ = other.jwtLocations_; - bitField0_ = (bitField0_ & ~0x00000001); + bitField0_ = (bitField0_ & ~0x00000020); } else { ensureJwtLocationsIsMutable(); jwtLocations_.addAll(other.jwtLocations_); @@ -901,10 +945,10 @@ public Builder mergeFrom(com.google.api.AuthProvider other) { jwtLocationsBuilder_.dispose(); jwtLocationsBuilder_ = null; jwtLocations_ = other.jwtLocations_; - bitField0_ = (bitField0_ & ~0x00000001); + bitField0_ = (bitField0_ & ~0x00000020); jwtLocationsBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders - ? getJwtLocationsFieldBuilder() + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders + ? internalGetJwtLocationsFieldBuilder() : null; } else { jwtLocationsBuilder_.addAllMessages(other.jwtLocations_); @@ -940,31 +984,31 @@ public Builder mergeFrom( case 10: { id_ = input.readStringRequireUtf8(); - + bitField0_ |= 0x00000001; break; } // case 10 case 18: { issuer_ = input.readStringRequireUtf8(); - + bitField0_ |= 0x00000002; break; } // case 18 case 26: { jwksUri_ = input.readStringRequireUtf8(); - + bitField0_ |= 0x00000004; break; } // case 26 case 34: { audiences_ = input.readStringRequireUtf8(); - + bitField0_ |= 0x00000008; break; } // case 34 case 42: { authorizationUrl_ = input.readStringRequireUtf8(); - + bitField0_ |= 0x00000010; break; } // case 42 case 50: @@ -999,12 +1043,14 @@ public Builder mergeFrom( private int bitField0_; private java.lang.Object id_ = ""; + /** * * *
              * The unique identifier of the auth provider. It will be referred to by
              * `AuthRequirement.provider_id`.
        +     *
              * Example: "bookstore_auth".
              * 
        * @@ -1023,12 +1069,14 @@ public java.lang.String getId() { return (java.lang.String) ref; } } + /** * * *
              * The unique identifier of the auth provider. It will be referred to by
              * `AuthRequirement.provider_id`.
        +     *
              * Example: "bookstore_auth".
              * 
        * @@ -1047,12 +1095,14 @@ public com.google.protobuf.ByteString getIdBytes() { return (com.google.protobuf.ByteString) ref; } } + /** * * *
              * The unique identifier of the auth provider. It will be referred to by
              * `AuthRequirement.provider_id`.
        +     *
              * Example: "bookstore_auth".
              * 
        * @@ -1065,17 +1115,19 @@ public Builder setId(java.lang.String value) { if (value == null) { throw new NullPointerException(); } - id_ = value; + bitField0_ |= 0x00000001; onChanged(); return this; } + /** * * *
              * The unique identifier of the auth provider. It will be referred to by
              * `AuthRequirement.provider_id`.
        +     *
              * Example: "bookstore_auth".
              * 
        * @@ -1084,17 +1136,19 @@ public Builder setId(java.lang.String value) { * @return This builder for chaining. */ public Builder clearId() { - id_ = getDefaultInstance().getId(); + bitField0_ = (bitField0_ & ~0x00000001); onChanged(); return this; } + /** * * *
              * The unique identifier of the auth provider. It will be referred to by
              * `AuthRequirement.provider_id`.
        +     *
              * Example: "bookstore_auth".
              * 
        * @@ -1108,13 +1162,14 @@ public Builder setIdBytes(com.google.protobuf.ByteString value) { throw new NullPointerException(); } checkByteStringIsUtf8(value); - id_ = value; + bitField0_ |= 0x00000001; onChanged(); return this; } private java.lang.Object issuer_ = ""; + /** * * @@ -1122,6 +1177,7 @@ public Builder setIdBytes(com.google.protobuf.ByteString value) { * Identifies the principal that issued the JWT. See * https://tools.ietf.org/html/draft-ietf-oauth-json-web-token-32#section-4.1.1 * Usually a URL or an email address. + * * Example: https://securetoken.google.com * Example: 1234567-compute@developer.gserviceaccount.com * @@ -1141,6 +1197,7 @@ public java.lang.String getIssuer() { return (java.lang.String) ref; } } + /** * * @@ -1148,6 +1205,7 @@ public java.lang.String getIssuer() { * Identifies the principal that issued the JWT. See * https://tools.ietf.org/html/draft-ietf-oauth-json-web-token-32#section-4.1.1 * Usually a URL or an email address. + * * Example: https://securetoken.google.com * Example: 1234567-compute@developer.gserviceaccount.com * @@ -1167,6 +1225,7 @@ public com.google.protobuf.ByteString getIssuerBytes() { return (com.google.protobuf.ByteString) ref; } } + /** * * @@ -1174,6 +1233,7 @@ public com.google.protobuf.ByteString getIssuerBytes() { * Identifies the principal that issued the JWT. See * https://tools.ietf.org/html/draft-ietf-oauth-json-web-token-32#section-4.1.1 * Usually a URL or an email address. + * * Example: https://securetoken.google.com * Example: 1234567-compute@developer.gserviceaccount.com * @@ -1187,11 +1247,12 @@ public Builder setIssuer(java.lang.String value) { if (value == null) { throw new NullPointerException(); } - issuer_ = value; + bitField0_ |= 0x00000002; onChanged(); return this; } + /** * * @@ -1199,6 +1260,7 @@ public Builder setIssuer(java.lang.String value) { * Identifies the principal that issued the JWT. See * https://tools.ietf.org/html/draft-ietf-oauth-json-web-token-32#section-4.1.1 * Usually a URL or an email address. + * * Example: https://securetoken.google.com * Example: 1234567-compute@developer.gserviceaccount.com * @@ -1208,11 +1270,12 @@ public Builder setIssuer(java.lang.String value) { * @return This builder for chaining. */ public Builder clearIssuer() { - issuer_ = getDefaultInstance().getIssuer(); + bitField0_ = (bitField0_ & ~0x00000002); onChanged(); return this; } + /** * * @@ -1220,6 +1283,7 @@ public Builder clearIssuer() { * Identifies the principal that issued the JWT. See * https://tools.ietf.org/html/draft-ietf-oauth-json-web-token-32#section-4.1.1 * Usually a URL or an email address. + * * Example: https://securetoken.google.com * Example: 1234567-compute@developer.gserviceaccount.com * @@ -1234,13 +1298,14 @@ public Builder setIssuerBytes(com.google.protobuf.ByteString value) { throw new NullPointerException(); } checkByteStringIsUtf8(value); - issuer_ = value; + bitField0_ |= 0x00000002; onChanged(); return this; } private java.lang.Object jwksUri_ = ""; + /** * * @@ -1249,12 +1314,13 @@ public Builder setIssuerBytes(com.google.protobuf.ByteString value) { * [OpenID * Discovery](https://openid.net/specs/openid-connect-discovery-1_0.html#ProviderMetadata). * Optional if the key set document: - * - can be retrieved from - * [OpenID - * Discovery](https://openid.net/specs/openid-connect-discovery-1_0.html) - * of the issuer. - * - can be inferred from the email domain of the issuer (e.g. a Google - * service account). + * - can be retrieved from + * [OpenID + * Discovery](https://openid.net/specs/openid-connect-discovery-1_0.html) + * of the issuer. + * - can be inferred from the email domain of the issuer (e.g. a Google + * service account). + * * Example: https://www.googleapis.com/oauth2/v1/certs * * @@ -1273,6 +1339,7 @@ public java.lang.String getJwksUri() { return (java.lang.String) ref; } } + /** * * @@ -1281,12 +1348,13 @@ public java.lang.String getJwksUri() { * [OpenID * Discovery](https://openid.net/specs/openid-connect-discovery-1_0.html#ProviderMetadata). * Optional if the key set document: - * - can be retrieved from - * [OpenID - * Discovery](https://openid.net/specs/openid-connect-discovery-1_0.html) - * of the issuer. - * - can be inferred from the email domain of the issuer (e.g. a Google - * service account). + * - can be retrieved from + * [OpenID + * Discovery](https://openid.net/specs/openid-connect-discovery-1_0.html) + * of the issuer. + * - can be inferred from the email domain of the issuer (e.g. a Google + * service account). + * * Example: https://www.googleapis.com/oauth2/v1/certs * * @@ -1305,6 +1373,7 @@ public com.google.protobuf.ByteString getJwksUriBytes() { return (com.google.protobuf.ByteString) ref; } } + /** * * @@ -1313,12 +1382,13 @@ public com.google.protobuf.ByteString getJwksUriBytes() { * [OpenID * Discovery](https://openid.net/specs/openid-connect-discovery-1_0.html#ProviderMetadata). * Optional if the key set document: - * - can be retrieved from - * [OpenID - * Discovery](https://openid.net/specs/openid-connect-discovery-1_0.html) - * of the issuer. - * - can be inferred from the email domain of the issuer (e.g. a Google - * service account). + * - can be retrieved from + * [OpenID + * Discovery](https://openid.net/specs/openid-connect-discovery-1_0.html) + * of the issuer. + * - can be inferred from the email domain of the issuer (e.g. a Google + * service account). + * * Example: https://www.googleapis.com/oauth2/v1/certs * * @@ -1331,11 +1401,12 @@ public Builder setJwksUri(java.lang.String value) { if (value == null) { throw new NullPointerException(); } - jwksUri_ = value; + bitField0_ |= 0x00000004; onChanged(); return this; } + /** * * @@ -1344,12 +1415,13 @@ public Builder setJwksUri(java.lang.String value) { * [OpenID * Discovery](https://openid.net/specs/openid-connect-discovery-1_0.html#ProviderMetadata). * Optional if the key set document: - * - can be retrieved from - * [OpenID - * Discovery](https://openid.net/specs/openid-connect-discovery-1_0.html) - * of the issuer. - * - can be inferred from the email domain of the issuer (e.g. a Google - * service account). + * - can be retrieved from + * [OpenID + * Discovery](https://openid.net/specs/openid-connect-discovery-1_0.html) + * of the issuer. + * - can be inferred from the email domain of the issuer (e.g. a Google + * service account). + * * Example: https://www.googleapis.com/oauth2/v1/certs * * @@ -1358,11 +1430,12 @@ public Builder setJwksUri(java.lang.String value) { * @return This builder for chaining. */ public Builder clearJwksUri() { - jwksUri_ = getDefaultInstance().getJwksUri(); + bitField0_ = (bitField0_ & ~0x00000004); onChanged(); return this; } + /** * * @@ -1371,12 +1444,13 @@ public Builder clearJwksUri() { * [OpenID * Discovery](https://openid.net/specs/openid-connect-discovery-1_0.html#ProviderMetadata). * Optional if the key set document: - * - can be retrieved from - * [OpenID - * Discovery](https://openid.net/specs/openid-connect-discovery-1_0.html) - * of the issuer. - * - can be inferred from the email domain of the issuer (e.g. a Google - * service account). + * - can be retrieved from + * [OpenID + * Discovery](https://openid.net/specs/openid-connect-discovery-1_0.html) + * of the issuer. + * - can be inferred from the email domain of the issuer (e.g. a Google + * service account). + * * Example: https://www.googleapis.com/oauth2/v1/certs * * @@ -1390,13 +1464,14 @@ public Builder setJwksUriBytes(com.google.protobuf.ByteString value) { throw new NullPointerException(); } checkByteStringIsUtf8(value); - jwksUri_ = value; + bitField0_ |= 0x00000004; onChanged(); return this; } private java.lang.Object audiences_ = ""; + /** * * @@ -1405,17 +1480,19 @@ public Builder setJwksUriBytes(com.google.protobuf.ByteString value) { * [audiences](https://tools.ietf.org/html/draft-ietf-oauth-json-web-token-32#section-4.1.3). * that are allowed to access. A JWT containing any of these audiences will * be accepted. When this setting is absent, JWTs with audiences: - * - "https://[service.name]/[google.protobuf.Api.name]" - * - "https://[service.name]/" + * - "https://[service.name]/[google.protobuf.Api.name]" + * - "https://[service.name]/" * will be accepted. * For example, if no audiences are in the setting, LibraryService API will * accept JWTs with the following audiences: - * - - * https://library-example.googleapis.com/google.example.library.v1.LibraryService - * - https://library-example.googleapis.com/ + * - + * https://library-example.googleapis.com/google.example.library.v1.LibraryService + * - https://library-example.googleapis.com/ + * * Example: - * audiences: bookstore_android.apps.googleusercontent.com, - * bookstore_web.apps.googleusercontent.com + * + * audiences: bookstore_android.apps.googleusercontent.com, + * bookstore_web.apps.googleusercontent.com * * * string audiences = 4; @@ -1433,6 +1510,7 @@ public java.lang.String getAudiences() { return (java.lang.String) ref; } } + /** * * @@ -1441,17 +1519,19 @@ public java.lang.String getAudiences() { * [audiences](https://tools.ietf.org/html/draft-ietf-oauth-json-web-token-32#section-4.1.3). * that are allowed to access. A JWT containing any of these audiences will * be accepted. When this setting is absent, JWTs with audiences: - * - "https://[service.name]/[google.protobuf.Api.name]" - * - "https://[service.name]/" + * - "https://[service.name]/[google.protobuf.Api.name]" + * - "https://[service.name]/" * will be accepted. * For example, if no audiences are in the setting, LibraryService API will * accept JWTs with the following audiences: - * - - * https://library-example.googleapis.com/google.example.library.v1.LibraryService - * - https://library-example.googleapis.com/ + * - + * https://library-example.googleapis.com/google.example.library.v1.LibraryService + * - https://library-example.googleapis.com/ + * * Example: - * audiences: bookstore_android.apps.googleusercontent.com, - * bookstore_web.apps.googleusercontent.com + * + * audiences: bookstore_android.apps.googleusercontent.com, + * bookstore_web.apps.googleusercontent.com * * * string audiences = 4; @@ -1469,6 +1549,7 @@ public com.google.protobuf.ByteString getAudiencesBytes() { return (com.google.protobuf.ByteString) ref; } } + /** * * @@ -1477,17 +1558,19 @@ public com.google.protobuf.ByteString getAudiencesBytes() { * [audiences](https://tools.ietf.org/html/draft-ietf-oauth-json-web-token-32#section-4.1.3). * that are allowed to access. A JWT containing any of these audiences will * be accepted. When this setting is absent, JWTs with audiences: - * - "https://[service.name]/[google.protobuf.Api.name]" - * - "https://[service.name]/" + * - "https://[service.name]/[google.protobuf.Api.name]" + * - "https://[service.name]/" * will be accepted. * For example, if no audiences are in the setting, LibraryService API will * accept JWTs with the following audiences: - * - - * https://library-example.googleapis.com/google.example.library.v1.LibraryService - * - https://library-example.googleapis.com/ + * - + * https://library-example.googleapis.com/google.example.library.v1.LibraryService + * - https://library-example.googleapis.com/ + * * Example: - * audiences: bookstore_android.apps.googleusercontent.com, - * bookstore_web.apps.googleusercontent.com + * + * audiences: bookstore_android.apps.googleusercontent.com, + * bookstore_web.apps.googleusercontent.com * * * string audiences = 4; @@ -1499,11 +1582,12 @@ public Builder setAudiences(java.lang.String value) { if (value == null) { throw new NullPointerException(); } - audiences_ = value; + bitField0_ |= 0x00000008; onChanged(); return this; } + /** * * @@ -1512,17 +1596,19 @@ public Builder setAudiences(java.lang.String value) { * [audiences](https://tools.ietf.org/html/draft-ietf-oauth-json-web-token-32#section-4.1.3). * that are allowed to access. A JWT containing any of these audiences will * be accepted. When this setting is absent, JWTs with audiences: - * - "https://[service.name]/[google.protobuf.Api.name]" - * - "https://[service.name]/" + * - "https://[service.name]/[google.protobuf.Api.name]" + * - "https://[service.name]/" * will be accepted. * For example, if no audiences are in the setting, LibraryService API will * accept JWTs with the following audiences: - * - - * https://library-example.googleapis.com/google.example.library.v1.LibraryService - * - https://library-example.googleapis.com/ + * - + * https://library-example.googleapis.com/google.example.library.v1.LibraryService + * - https://library-example.googleapis.com/ + * * Example: - * audiences: bookstore_android.apps.googleusercontent.com, - * bookstore_web.apps.googleusercontent.com + * + * audiences: bookstore_android.apps.googleusercontent.com, + * bookstore_web.apps.googleusercontent.com * * * string audiences = 4; @@ -1530,11 +1616,12 @@ public Builder setAudiences(java.lang.String value) { * @return This builder for chaining. */ public Builder clearAudiences() { - audiences_ = getDefaultInstance().getAudiences(); + bitField0_ = (bitField0_ & ~0x00000008); onChanged(); return this; } + /** * * @@ -1543,17 +1630,19 @@ public Builder clearAudiences() { * [audiences](https://tools.ietf.org/html/draft-ietf-oauth-json-web-token-32#section-4.1.3). * that are allowed to access. A JWT containing any of these audiences will * be accepted. When this setting is absent, JWTs with audiences: - * - "https://[service.name]/[google.protobuf.Api.name]" - * - "https://[service.name]/" + * - "https://[service.name]/[google.protobuf.Api.name]" + * - "https://[service.name]/" * will be accepted. * For example, if no audiences are in the setting, LibraryService API will * accept JWTs with the following audiences: - * - - * https://library-example.googleapis.com/google.example.library.v1.LibraryService - * - https://library-example.googleapis.com/ + * - + * https://library-example.googleapis.com/google.example.library.v1.LibraryService + * - https://library-example.googleapis.com/ + * * Example: - * audiences: bookstore_android.apps.googleusercontent.com, - * bookstore_web.apps.googleusercontent.com + * + * audiences: bookstore_android.apps.googleusercontent.com, + * bookstore_web.apps.googleusercontent.com * * * string audiences = 4; @@ -1566,13 +1655,14 @@ public Builder setAudiencesBytes(com.google.protobuf.ByteString value) { throw new NullPointerException(); } checkByteStringIsUtf8(value); - audiences_ = value; + bitField0_ |= 0x00000008; onChanged(); return this; } private java.lang.Object authorizationUrl_ = ""; + /** * * @@ -1596,6 +1686,7 @@ public java.lang.String getAuthorizationUrl() { return (java.lang.String) ref; } } + /** * * @@ -1619,6 +1710,7 @@ public com.google.protobuf.ByteString getAuthorizationUrlBytes() { return (com.google.protobuf.ByteString) ref; } } + /** * * @@ -1636,11 +1728,12 @@ public Builder setAuthorizationUrl(java.lang.String value) { if (value == null) { throw new NullPointerException(); } - authorizationUrl_ = value; + bitField0_ |= 0x00000010; onChanged(); return this; } + /** * * @@ -1654,11 +1747,12 @@ public Builder setAuthorizationUrl(java.lang.String value) { * @return This builder for chaining. */ public Builder clearAuthorizationUrl() { - authorizationUrl_ = getDefaultInstance().getAuthorizationUrl(); + bitField0_ = (bitField0_ & ~0x00000010); onChanged(); return this; } + /** * * @@ -1677,8 +1771,8 @@ public Builder setAuthorizationUrlBytes(com.google.protobuf.ByteString value) { throw new NullPointerException(); } checkByteStringIsUtf8(value); - authorizationUrl_ = value; + bitField0_ |= 0x00000010; onChanged(); return this; } @@ -1687,13 +1781,13 @@ public Builder setAuthorizationUrlBytes(com.google.protobuf.ByteString value) { java.util.Collections.emptyList(); private void ensureJwtLocationsIsMutable() { - if (!((bitField0_ & 0x00000001) != 0)) { + if (!((bitField0_ & 0x00000020) != 0)) { jwtLocations_ = new java.util.ArrayList(jwtLocations_); - bitField0_ |= 0x00000001; + bitField0_ |= 0x00000020; } } - private com.google.protobuf.RepeatedFieldBuilderV3< + private com.google.protobuf.RepeatedFieldBuilder< com.google.api.JwtLocation, com.google.api.JwtLocation.Builder, com.google.api.JwtLocationOrBuilder> @@ -1706,18 +1800,21 @@ private void ensureJwtLocationsIsMutable() { * Defines the locations to extract the JWT. For now it is only used by the * Cloud Endpoints to store the OpenAPI extension [x-google-jwt-locations] * (https://cloud.google.com/endpoints/docs/openapi/openapi-extensions#x-google-jwt-locations) + * * JWT locations can be one of HTTP headers, URL query parameters or * cookies. The rule is that the first match wins. + * * If not specified, default to use following 3 locations: - * 1) Authorization: Bearer - * 2) x-goog-iap-jwt-assertion - * 3) access_token query parameter + * 1) Authorization: Bearer + * 2) x-goog-iap-jwt-assertion + * 3) access_token query parameter + * * Default locations can be specified as followings: - * jwt_locations: - * - header: Authorization - * value_prefix: "Bearer " - * - header: x-goog-iap-jwt-assertion - * - query: access_token + * jwt_locations: + * - header: Authorization + * value_prefix: "Bearer " + * - header: x-goog-iap-jwt-assertion + * - query: access_token * * * repeated .google.api.JwtLocation jwt_locations = 6; @@ -1729,6 +1826,7 @@ public java.util.List getJwtLocationsList() { return jwtLocationsBuilder_.getMessageList(); } } + /** * * @@ -1736,18 +1834,21 @@ public java.util.List getJwtLocationsList() { * Defines the locations to extract the JWT. For now it is only used by the * Cloud Endpoints to store the OpenAPI extension [x-google-jwt-locations] * (https://cloud.google.com/endpoints/docs/openapi/openapi-extensions#x-google-jwt-locations) + * * JWT locations can be one of HTTP headers, URL query parameters or * cookies. The rule is that the first match wins. + * * If not specified, default to use following 3 locations: - * 1) Authorization: Bearer - * 2) x-goog-iap-jwt-assertion - * 3) access_token query parameter + * 1) Authorization: Bearer + * 2) x-goog-iap-jwt-assertion + * 3) access_token query parameter + * * Default locations can be specified as followings: - * jwt_locations: - * - header: Authorization - * value_prefix: "Bearer " - * - header: x-goog-iap-jwt-assertion - * - query: access_token + * jwt_locations: + * - header: Authorization + * value_prefix: "Bearer " + * - header: x-goog-iap-jwt-assertion + * - query: access_token * * * repeated .google.api.JwtLocation jwt_locations = 6; @@ -1759,6 +1860,7 @@ public int getJwtLocationsCount() { return jwtLocationsBuilder_.getCount(); } } + /** * * @@ -1766,18 +1868,21 @@ public int getJwtLocationsCount() { * Defines the locations to extract the JWT. For now it is only used by the * Cloud Endpoints to store the OpenAPI extension [x-google-jwt-locations] * (https://cloud.google.com/endpoints/docs/openapi/openapi-extensions#x-google-jwt-locations) + * * JWT locations can be one of HTTP headers, URL query parameters or * cookies. The rule is that the first match wins. + * * If not specified, default to use following 3 locations: - * 1) Authorization: Bearer - * 2) x-goog-iap-jwt-assertion - * 3) access_token query parameter + * 1) Authorization: Bearer + * 2) x-goog-iap-jwt-assertion + * 3) access_token query parameter + * * Default locations can be specified as followings: - * jwt_locations: - * - header: Authorization - * value_prefix: "Bearer " - * - header: x-goog-iap-jwt-assertion - * - query: access_token + * jwt_locations: + * - header: Authorization + * value_prefix: "Bearer " + * - header: x-goog-iap-jwt-assertion + * - query: access_token * * * repeated .google.api.JwtLocation jwt_locations = 6; @@ -1789,6 +1894,7 @@ public com.google.api.JwtLocation getJwtLocations(int index) { return jwtLocationsBuilder_.getMessage(index); } } + /** * * @@ -1796,18 +1902,21 @@ public com.google.api.JwtLocation getJwtLocations(int index) { * Defines the locations to extract the JWT. For now it is only used by the * Cloud Endpoints to store the OpenAPI extension [x-google-jwt-locations] * (https://cloud.google.com/endpoints/docs/openapi/openapi-extensions#x-google-jwt-locations) + * * JWT locations can be one of HTTP headers, URL query parameters or * cookies. The rule is that the first match wins. + * * If not specified, default to use following 3 locations: - * 1) Authorization: Bearer - * 2) x-goog-iap-jwt-assertion - * 3) access_token query parameter + * 1) Authorization: Bearer + * 2) x-goog-iap-jwt-assertion + * 3) access_token query parameter + * * Default locations can be specified as followings: - * jwt_locations: - * - header: Authorization - * value_prefix: "Bearer " - * - header: x-goog-iap-jwt-assertion - * - query: access_token + * jwt_locations: + * - header: Authorization + * value_prefix: "Bearer " + * - header: x-goog-iap-jwt-assertion + * - query: access_token * * * repeated .google.api.JwtLocation jwt_locations = 6; @@ -1825,6 +1934,7 @@ public Builder setJwtLocations(int index, com.google.api.JwtLocation value) { } return this; } + /** * * @@ -1832,18 +1942,21 @@ public Builder setJwtLocations(int index, com.google.api.JwtLocation value) { * Defines the locations to extract the JWT. For now it is only used by the * Cloud Endpoints to store the OpenAPI extension [x-google-jwt-locations] * (https://cloud.google.com/endpoints/docs/openapi/openapi-extensions#x-google-jwt-locations) + * * JWT locations can be one of HTTP headers, URL query parameters or * cookies. The rule is that the first match wins. + * * If not specified, default to use following 3 locations: - * 1) Authorization: Bearer - * 2) x-goog-iap-jwt-assertion - * 3) access_token query parameter + * 1) Authorization: Bearer + * 2) x-goog-iap-jwt-assertion + * 3) access_token query parameter + * * Default locations can be specified as followings: - * jwt_locations: - * - header: Authorization - * value_prefix: "Bearer " - * - header: x-goog-iap-jwt-assertion - * - query: access_token + * jwt_locations: + * - header: Authorization + * value_prefix: "Bearer " + * - header: x-goog-iap-jwt-assertion + * - query: access_token * * * repeated .google.api.JwtLocation jwt_locations = 6; @@ -1858,6 +1971,7 @@ public Builder setJwtLocations(int index, com.google.api.JwtLocation.Builder bui } return this; } + /** * * @@ -1865,18 +1979,21 @@ public Builder setJwtLocations(int index, com.google.api.JwtLocation.Builder bui * Defines the locations to extract the JWT. For now it is only used by the * Cloud Endpoints to store the OpenAPI extension [x-google-jwt-locations] * (https://cloud.google.com/endpoints/docs/openapi/openapi-extensions#x-google-jwt-locations) + * * JWT locations can be one of HTTP headers, URL query parameters or * cookies. The rule is that the first match wins. + * * If not specified, default to use following 3 locations: - * 1) Authorization: Bearer - * 2) x-goog-iap-jwt-assertion - * 3) access_token query parameter + * 1) Authorization: Bearer + * 2) x-goog-iap-jwt-assertion + * 3) access_token query parameter + * * Default locations can be specified as followings: - * jwt_locations: - * - header: Authorization - * value_prefix: "Bearer " - * - header: x-goog-iap-jwt-assertion - * - query: access_token + * jwt_locations: + * - header: Authorization + * value_prefix: "Bearer " + * - header: x-goog-iap-jwt-assertion + * - query: access_token * * * repeated .google.api.JwtLocation jwt_locations = 6; @@ -1894,6 +2011,7 @@ public Builder addJwtLocations(com.google.api.JwtLocation value) { } return this; } + /** * * @@ -1901,18 +2019,21 @@ public Builder addJwtLocations(com.google.api.JwtLocation value) { * Defines the locations to extract the JWT. For now it is only used by the * Cloud Endpoints to store the OpenAPI extension [x-google-jwt-locations] * (https://cloud.google.com/endpoints/docs/openapi/openapi-extensions#x-google-jwt-locations) + * * JWT locations can be one of HTTP headers, URL query parameters or * cookies. The rule is that the first match wins. + * * If not specified, default to use following 3 locations: - * 1) Authorization: Bearer - * 2) x-goog-iap-jwt-assertion - * 3) access_token query parameter + * 1) Authorization: Bearer + * 2) x-goog-iap-jwt-assertion + * 3) access_token query parameter + * * Default locations can be specified as followings: - * jwt_locations: - * - header: Authorization - * value_prefix: "Bearer " - * - header: x-goog-iap-jwt-assertion - * - query: access_token + * jwt_locations: + * - header: Authorization + * value_prefix: "Bearer " + * - header: x-goog-iap-jwt-assertion + * - query: access_token * * * repeated .google.api.JwtLocation jwt_locations = 6; @@ -1930,6 +2051,7 @@ public Builder addJwtLocations(int index, com.google.api.JwtLocation value) { } return this; } + /** * * @@ -1937,18 +2059,21 @@ public Builder addJwtLocations(int index, com.google.api.JwtLocation value) { * Defines the locations to extract the JWT. For now it is only used by the * Cloud Endpoints to store the OpenAPI extension [x-google-jwt-locations] * (https://cloud.google.com/endpoints/docs/openapi/openapi-extensions#x-google-jwt-locations) + * * JWT locations can be one of HTTP headers, URL query parameters or * cookies. The rule is that the first match wins. + * * If not specified, default to use following 3 locations: - * 1) Authorization: Bearer - * 2) x-goog-iap-jwt-assertion - * 3) access_token query parameter + * 1) Authorization: Bearer + * 2) x-goog-iap-jwt-assertion + * 3) access_token query parameter + * * Default locations can be specified as followings: - * jwt_locations: - * - header: Authorization - * value_prefix: "Bearer " - * - header: x-goog-iap-jwt-assertion - * - query: access_token + * jwt_locations: + * - header: Authorization + * value_prefix: "Bearer " + * - header: x-goog-iap-jwt-assertion + * - query: access_token * * * repeated .google.api.JwtLocation jwt_locations = 6; @@ -1963,6 +2088,7 @@ public Builder addJwtLocations(com.google.api.JwtLocation.Builder builderForValu } return this; } + /** * * @@ -1970,18 +2096,21 @@ public Builder addJwtLocations(com.google.api.JwtLocation.Builder builderForValu * Defines the locations to extract the JWT. For now it is only used by the * Cloud Endpoints to store the OpenAPI extension [x-google-jwt-locations] * (https://cloud.google.com/endpoints/docs/openapi/openapi-extensions#x-google-jwt-locations) + * * JWT locations can be one of HTTP headers, URL query parameters or * cookies. The rule is that the first match wins. + * * If not specified, default to use following 3 locations: - * 1) Authorization: Bearer - * 2) x-goog-iap-jwt-assertion - * 3) access_token query parameter + * 1) Authorization: Bearer + * 2) x-goog-iap-jwt-assertion + * 3) access_token query parameter + * * Default locations can be specified as followings: - * jwt_locations: - * - header: Authorization - * value_prefix: "Bearer " - * - header: x-goog-iap-jwt-assertion - * - query: access_token + * jwt_locations: + * - header: Authorization + * value_prefix: "Bearer " + * - header: x-goog-iap-jwt-assertion + * - query: access_token * * * repeated .google.api.JwtLocation jwt_locations = 6; @@ -1996,6 +2125,7 @@ public Builder addJwtLocations(int index, com.google.api.JwtLocation.Builder bui } return this; } + /** * * @@ -2003,18 +2133,21 @@ public Builder addJwtLocations(int index, com.google.api.JwtLocation.Builder bui * Defines the locations to extract the JWT. For now it is only used by the * Cloud Endpoints to store the OpenAPI extension [x-google-jwt-locations] * (https://cloud.google.com/endpoints/docs/openapi/openapi-extensions#x-google-jwt-locations) + * * JWT locations can be one of HTTP headers, URL query parameters or * cookies. The rule is that the first match wins. + * * If not specified, default to use following 3 locations: - * 1) Authorization: Bearer - * 2) x-goog-iap-jwt-assertion - * 3) access_token query parameter + * 1) Authorization: Bearer + * 2) x-goog-iap-jwt-assertion + * 3) access_token query parameter + * * Default locations can be specified as followings: - * jwt_locations: - * - header: Authorization - * value_prefix: "Bearer " - * - header: x-goog-iap-jwt-assertion - * - query: access_token + * jwt_locations: + * - header: Authorization + * value_prefix: "Bearer " + * - header: x-goog-iap-jwt-assertion + * - query: access_token * * * repeated .google.api.JwtLocation jwt_locations = 6; @@ -2030,6 +2163,7 @@ public Builder addAllJwtLocations( } return this; } + /** * * @@ -2037,18 +2171,21 @@ public Builder addAllJwtLocations( * Defines the locations to extract the JWT. For now it is only used by the * Cloud Endpoints to store the OpenAPI extension [x-google-jwt-locations] * (https://cloud.google.com/endpoints/docs/openapi/openapi-extensions#x-google-jwt-locations) + * * JWT locations can be one of HTTP headers, URL query parameters or * cookies. The rule is that the first match wins. + * * If not specified, default to use following 3 locations: - * 1) Authorization: Bearer - * 2) x-goog-iap-jwt-assertion - * 3) access_token query parameter + * 1) Authorization: Bearer + * 2) x-goog-iap-jwt-assertion + * 3) access_token query parameter + * * Default locations can be specified as followings: - * jwt_locations: - * - header: Authorization - * value_prefix: "Bearer " - * - header: x-goog-iap-jwt-assertion - * - query: access_token + * jwt_locations: + * - header: Authorization + * value_prefix: "Bearer " + * - header: x-goog-iap-jwt-assertion + * - query: access_token * * * repeated .google.api.JwtLocation jwt_locations = 6; @@ -2056,13 +2193,14 @@ public Builder addAllJwtLocations( public Builder clearJwtLocations() { if (jwtLocationsBuilder_ == null) { jwtLocations_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); + bitField0_ = (bitField0_ & ~0x00000020); onChanged(); } else { jwtLocationsBuilder_.clear(); } return this; } + /** * * @@ -2070,18 +2208,21 @@ public Builder clearJwtLocations() { * Defines the locations to extract the JWT. For now it is only used by the * Cloud Endpoints to store the OpenAPI extension [x-google-jwt-locations] * (https://cloud.google.com/endpoints/docs/openapi/openapi-extensions#x-google-jwt-locations) + * * JWT locations can be one of HTTP headers, URL query parameters or * cookies. The rule is that the first match wins. + * * If not specified, default to use following 3 locations: - * 1) Authorization: Bearer - * 2) x-goog-iap-jwt-assertion - * 3) access_token query parameter + * 1) Authorization: Bearer + * 2) x-goog-iap-jwt-assertion + * 3) access_token query parameter + * * Default locations can be specified as followings: - * jwt_locations: - * - header: Authorization - * value_prefix: "Bearer " - * - header: x-goog-iap-jwt-assertion - * - query: access_token + * jwt_locations: + * - header: Authorization + * value_prefix: "Bearer " + * - header: x-goog-iap-jwt-assertion + * - query: access_token * * * repeated .google.api.JwtLocation jwt_locations = 6; @@ -2096,6 +2237,7 @@ public Builder removeJwtLocations(int index) { } return this; } + /** * * @@ -2103,25 +2245,29 @@ public Builder removeJwtLocations(int index) { * Defines the locations to extract the JWT. For now it is only used by the * Cloud Endpoints to store the OpenAPI extension [x-google-jwt-locations] * (https://cloud.google.com/endpoints/docs/openapi/openapi-extensions#x-google-jwt-locations) + * * JWT locations can be one of HTTP headers, URL query parameters or * cookies. The rule is that the first match wins. + * * If not specified, default to use following 3 locations: - * 1) Authorization: Bearer - * 2) x-goog-iap-jwt-assertion - * 3) access_token query parameter + * 1) Authorization: Bearer + * 2) x-goog-iap-jwt-assertion + * 3) access_token query parameter + * * Default locations can be specified as followings: - * jwt_locations: - * - header: Authorization - * value_prefix: "Bearer " - * - header: x-goog-iap-jwt-assertion - * - query: access_token + * jwt_locations: + * - header: Authorization + * value_prefix: "Bearer " + * - header: x-goog-iap-jwt-assertion + * - query: access_token * * * repeated .google.api.JwtLocation jwt_locations = 6; */ public com.google.api.JwtLocation.Builder getJwtLocationsBuilder(int index) { - return getJwtLocationsFieldBuilder().getBuilder(index); + return internalGetJwtLocationsFieldBuilder().getBuilder(index); } + /** * * @@ -2129,18 +2275,21 @@ public com.google.api.JwtLocation.Builder getJwtLocationsBuilder(int index) { * Defines the locations to extract the JWT. For now it is only used by the * Cloud Endpoints to store the OpenAPI extension [x-google-jwt-locations] * (https://cloud.google.com/endpoints/docs/openapi/openapi-extensions#x-google-jwt-locations) + * * JWT locations can be one of HTTP headers, URL query parameters or * cookies. The rule is that the first match wins. + * * If not specified, default to use following 3 locations: - * 1) Authorization: Bearer - * 2) x-goog-iap-jwt-assertion - * 3) access_token query parameter + * 1) Authorization: Bearer + * 2) x-goog-iap-jwt-assertion + * 3) access_token query parameter + * * Default locations can be specified as followings: - * jwt_locations: - * - header: Authorization - * value_prefix: "Bearer " - * - header: x-goog-iap-jwt-assertion - * - query: access_token + * jwt_locations: + * - header: Authorization + * value_prefix: "Bearer " + * - header: x-goog-iap-jwt-assertion + * - query: access_token * * * repeated .google.api.JwtLocation jwt_locations = 6; @@ -2152,6 +2301,7 @@ public com.google.api.JwtLocationOrBuilder getJwtLocationsOrBuilder(int index) { return jwtLocationsBuilder_.getMessageOrBuilder(index); } } + /** * * @@ -2159,18 +2309,21 @@ public com.google.api.JwtLocationOrBuilder getJwtLocationsOrBuilder(int index) { * Defines the locations to extract the JWT. For now it is only used by the * Cloud Endpoints to store the OpenAPI extension [x-google-jwt-locations] * (https://cloud.google.com/endpoints/docs/openapi/openapi-extensions#x-google-jwt-locations) + * * JWT locations can be one of HTTP headers, URL query parameters or * cookies. The rule is that the first match wins. + * * If not specified, default to use following 3 locations: - * 1) Authorization: Bearer - * 2) x-goog-iap-jwt-assertion - * 3) access_token query parameter + * 1) Authorization: Bearer + * 2) x-goog-iap-jwt-assertion + * 3) access_token query parameter + * * Default locations can be specified as followings: - * jwt_locations: - * - header: Authorization - * value_prefix: "Bearer " - * - header: x-goog-iap-jwt-assertion - * - query: access_token + * jwt_locations: + * - header: Authorization + * value_prefix: "Bearer " + * - header: x-goog-iap-jwt-assertion + * - query: access_token * * * repeated .google.api.JwtLocation jwt_locations = 6; @@ -2183,6 +2336,7 @@ public com.google.api.JwtLocationOrBuilder getJwtLocationsOrBuilder(int index) { return java.util.Collections.unmodifiableList(jwtLocations_); } } + /** * * @@ -2190,26 +2344,30 @@ public com.google.api.JwtLocationOrBuilder getJwtLocationsOrBuilder(int index) { * Defines the locations to extract the JWT. For now it is only used by the * Cloud Endpoints to store the OpenAPI extension [x-google-jwt-locations] * (https://cloud.google.com/endpoints/docs/openapi/openapi-extensions#x-google-jwt-locations) + * * JWT locations can be one of HTTP headers, URL query parameters or * cookies. The rule is that the first match wins. + * * If not specified, default to use following 3 locations: - * 1) Authorization: Bearer - * 2) x-goog-iap-jwt-assertion - * 3) access_token query parameter + * 1) Authorization: Bearer + * 2) x-goog-iap-jwt-assertion + * 3) access_token query parameter + * * Default locations can be specified as followings: - * jwt_locations: - * - header: Authorization - * value_prefix: "Bearer " - * - header: x-goog-iap-jwt-assertion - * - query: access_token + * jwt_locations: + * - header: Authorization + * value_prefix: "Bearer " + * - header: x-goog-iap-jwt-assertion + * - query: access_token * * * repeated .google.api.JwtLocation jwt_locations = 6; */ public com.google.api.JwtLocation.Builder addJwtLocationsBuilder() { - return getJwtLocationsFieldBuilder() + return internalGetJwtLocationsFieldBuilder() .addBuilder(com.google.api.JwtLocation.getDefaultInstance()); } + /** * * @@ -2217,26 +2375,30 @@ public com.google.api.JwtLocation.Builder addJwtLocationsBuilder() { * Defines the locations to extract the JWT. For now it is only used by the * Cloud Endpoints to store the OpenAPI extension [x-google-jwt-locations] * (https://cloud.google.com/endpoints/docs/openapi/openapi-extensions#x-google-jwt-locations) + * * JWT locations can be one of HTTP headers, URL query parameters or * cookies. The rule is that the first match wins. + * * If not specified, default to use following 3 locations: - * 1) Authorization: Bearer - * 2) x-goog-iap-jwt-assertion - * 3) access_token query parameter + * 1) Authorization: Bearer + * 2) x-goog-iap-jwt-assertion + * 3) access_token query parameter + * * Default locations can be specified as followings: - * jwt_locations: - * - header: Authorization - * value_prefix: "Bearer " - * - header: x-goog-iap-jwt-assertion - * - query: access_token + * jwt_locations: + * - header: Authorization + * value_prefix: "Bearer " + * - header: x-goog-iap-jwt-assertion + * - query: access_token * * * repeated .google.api.JwtLocation jwt_locations = 6; */ public com.google.api.JwtLocation.Builder addJwtLocationsBuilder(int index) { - return getJwtLocationsFieldBuilder() + return internalGetJwtLocationsFieldBuilder() .addBuilder(index, com.google.api.JwtLocation.getDefaultInstance()); } + /** * * @@ -2244,54 +2406,46 @@ public com.google.api.JwtLocation.Builder addJwtLocationsBuilder(int index) { * Defines the locations to extract the JWT. For now it is only used by the * Cloud Endpoints to store the OpenAPI extension [x-google-jwt-locations] * (https://cloud.google.com/endpoints/docs/openapi/openapi-extensions#x-google-jwt-locations) + * * JWT locations can be one of HTTP headers, URL query parameters or * cookies. The rule is that the first match wins. + * * If not specified, default to use following 3 locations: - * 1) Authorization: Bearer - * 2) x-goog-iap-jwt-assertion - * 3) access_token query parameter + * 1) Authorization: Bearer + * 2) x-goog-iap-jwt-assertion + * 3) access_token query parameter + * * Default locations can be specified as followings: - * jwt_locations: - * - header: Authorization - * value_prefix: "Bearer " - * - header: x-goog-iap-jwt-assertion - * - query: access_token + * jwt_locations: + * - header: Authorization + * value_prefix: "Bearer " + * - header: x-goog-iap-jwt-assertion + * - query: access_token * * * repeated .google.api.JwtLocation jwt_locations = 6; */ public java.util.List getJwtLocationsBuilderList() { - return getJwtLocationsFieldBuilder().getBuilderList(); + return internalGetJwtLocationsFieldBuilder().getBuilderList(); } - private com.google.protobuf.RepeatedFieldBuilderV3< + private com.google.protobuf.RepeatedFieldBuilder< com.google.api.JwtLocation, com.google.api.JwtLocation.Builder, com.google.api.JwtLocationOrBuilder> - getJwtLocationsFieldBuilder() { + internalGetJwtLocationsFieldBuilder() { if (jwtLocationsBuilder_ == null) { jwtLocationsBuilder_ = - new com.google.protobuf.RepeatedFieldBuilderV3< + new com.google.protobuf.RepeatedFieldBuilder< com.google.api.JwtLocation, com.google.api.JwtLocation.Builder, com.google.api.JwtLocationOrBuilder>( - jwtLocations_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + jwtLocations_, ((bitField0_ & 0x00000020) != 0), getParentForChildren(), isClean()); jwtLocations_ = null; } return jwtLocationsBuilder_; } - @java.lang.Override - public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - // @@protoc_insertion_point(builder_scope:google.api.AuthProvider) } diff --git a/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/AuthProviderOrBuilder.java b/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/AuthProviderOrBuilder.java index 87ac693a46..7c1e741b9a 100644 --- a/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/AuthProviderOrBuilder.java +++ b/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/AuthProviderOrBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,10 +14,13 @@ * limitations under the License. */ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: google/api/auth.proto +// Protobuf Java Version: 4.33.2 package com.google.api; +@com.google.protobuf.Generated public interface AuthProviderOrBuilder extends // @@protoc_insertion_point(interface_extends:google.api.AuthProvider) @@ -29,6 +32,7 @@ public interface AuthProviderOrBuilder *
            * The unique identifier of the auth provider. It will be referred to by
            * `AuthRequirement.provider_id`.
        +   *
            * Example: "bookstore_auth".
            * 
        * @@ -37,12 +41,14 @@ public interface AuthProviderOrBuilder * @return The id. */ java.lang.String getId(); + /** * * *
            * The unique identifier of the auth provider. It will be referred to by
            * `AuthRequirement.provider_id`.
        +   *
            * Example: "bookstore_auth".
            * 
        * @@ -59,6 +65,7 @@ public interface AuthProviderOrBuilder * Identifies the principal that issued the JWT. See * https://tools.ietf.org/html/draft-ietf-oauth-json-web-token-32#section-4.1.1 * Usually a URL or an email address. + * * Example: https://securetoken.google.com * Example: 1234567-compute@developer.gserviceaccount.com * @@ -68,6 +75,7 @@ public interface AuthProviderOrBuilder * @return The issuer. */ java.lang.String getIssuer(); + /** * * @@ -75,6 +83,7 @@ public interface AuthProviderOrBuilder * Identifies the principal that issued the JWT. See * https://tools.ietf.org/html/draft-ietf-oauth-json-web-token-32#section-4.1.1 * Usually a URL or an email address. + * * Example: https://securetoken.google.com * Example: 1234567-compute@developer.gserviceaccount.com * @@ -93,12 +102,13 @@ public interface AuthProviderOrBuilder * [OpenID * Discovery](https://openid.net/specs/openid-connect-discovery-1_0.html#ProviderMetadata). * Optional if the key set document: - * - can be retrieved from - * [OpenID - * Discovery](https://openid.net/specs/openid-connect-discovery-1_0.html) - * of the issuer. - * - can be inferred from the email domain of the issuer (e.g. a Google - * service account). + * - can be retrieved from + * [OpenID + * Discovery](https://openid.net/specs/openid-connect-discovery-1_0.html) + * of the issuer. + * - can be inferred from the email domain of the issuer (e.g. a Google + * service account). + * * Example: https://www.googleapis.com/oauth2/v1/certs * * @@ -107,6 +117,7 @@ public interface AuthProviderOrBuilder * @return The jwksUri. */ java.lang.String getJwksUri(); + /** * * @@ -115,12 +126,13 @@ public interface AuthProviderOrBuilder * [OpenID * Discovery](https://openid.net/specs/openid-connect-discovery-1_0.html#ProviderMetadata). * Optional if the key set document: - * - can be retrieved from - * [OpenID - * Discovery](https://openid.net/specs/openid-connect-discovery-1_0.html) - * of the issuer. - * - can be inferred from the email domain of the issuer (e.g. a Google - * service account). + * - can be retrieved from + * [OpenID + * Discovery](https://openid.net/specs/openid-connect-discovery-1_0.html) + * of the issuer. + * - can be inferred from the email domain of the issuer (e.g. a Google + * service account). + * * Example: https://www.googleapis.com/oauth2/v1/certs * * @@ -138,17 +150,19 @@ public interface AuthProviderOrBuilder * [audiences](https://tools.ietf.org/html/draft-ietf-oauth-json-web-token-32#section-4.1.3). * that are allowed to access. A JWT containing any of these audiences will * be accepted. When this setting is absent, JWTs with audiences: - * - "https://[service.name]/[google.protobuf.Api.name]" - * - "https://[service.name]/" + * - "https://[service.name]/[google.protobuf.Api.name]" + * - "https://[service.name]/" * will be accepted. * For example, if no audiences are in the setting, LibraryService API will * accept JWTs with the following audiences: - * - - * https://library-example.googleapis.com/google.example.library.v1.LibraryService - * - https://library-example.googleapis.com/ + * - + * https://library-example.googleapis.com/google.example.library.v1.LibraryService + * - https://library-example.googleapis.com/ + * * Example: - * audiences: bookstore_android.apps.googleusercontent.com, - * bookstore_web.apps.googleusercontent.com + * + * audiences: bookstore_android.apps.googleusercontent.com, + * bookstore_web.apps.googleusercontent.com * * * string audiences = 4; @@ -156,6 +170,7 @@ public interface AuthProviderOrBuilder * @return The audiences. */ java.lang.String getAudiences(); + /** * * @@ -164,17 +179,19 @@ public interface AuthProviderOrBuilder * [audiences](https://tools.ietf.org/html/draft-ietf-oauth-json-web-token-32#section-4.1.3). * that are allowed to access. A JWT containing any of these audiences will * be accepted. When this setting is absent, JWTs with audiences: - * - "https://[service.name]/[google.protobuf.Api.name]" - * - "https://[service.name]/" + * - "https://[service.name]/[google.protobuf.Api.name]" + * - "https://[service.name]/" * will be accepted. * For example, if no audiences are in the setting, LibraryService API will * accept JWTs with the following audiences: - * - - * https://library-example.googleapis.com/google.example.library.v1.LibraryService - * - https://library-example.googleapis.com/ + * - + * https://library-example.googleapis.com/google.example.library.v1.LibraryService + * - https://library-example.googleapis.com/ + * * Example: - * audiences: bookstore_android.apps.googleusercontent.com, - * bookstore_web.apps.googleusercontent.com + * + * audiences: bookstore_android.apps.googleusercontent.com, + * bookstore_web.apps.googleusercontent.com * * * string audiences = 4; @@ -196,6 +213,7 @@ public interface AuthProviderOrBuilder * @return The authorizationUrl. */ java.lang.String getAuthorizationUrl(); + /** * * @@ -217,23 +235,27 @@ public interface AuthProviderOrBuilder * Defines the locations to extract the JWT. For now it is only used by the * Cloud Endpoints to store the OpenAPI extension [x-google-jwt-locations] * (https://cloud.google.com/endpoints/docs/openapi/openapi-extensions#x-google-jwt-locations) + * * JWT locations can be one of HTTP headers, URL query parameters or * cookies. The rule is that the first match wins. + * * If not specified, default to use following 3 locations: - * 1) Authorization: Bearer - * 2) x-goog-iap-jwt-assertion - * 3) access_token query parameter + * 1) Authorization: Bearer + * 2) x-goog-iap-jwt-assertion + * 3) access_token query parameter + * * Default locations can be specified as followings: - * jwt_locations: - * - header: Authorization - * value_prefix: "Bearer " - * - header: x-goog-iap-jwt-assertion - * - query: access_token + * jwt_locations: + * - header: Authorization + * value_prefix: "Bearer " + * - header: x-goog-iap-jwt-assertion + * - query: access_token * * * repeated .google.api.JwtLocation jwt_locations = 6; */ java.util.List getJwtLocationsList(); + /** * * @@ -241,23 +263,27 @@ public interface AuthProviderOrBuilder * Defines the locations to extract the JWT. For now it is only used by the * Cloud Endpoints to store the OpenAPI extension [x-google-jwt-locations] * (https://cloud.google.com/endpoints/docs/openapi/openapi-extensions#x-google-jwt-locations) + * * JWT locations can be one of HTTP headers, URL query parameters or * cookies. The rule is that the first match wins. + * * If not specified, default to use following 3 locations: - * 1) Authorization: Bearer - * 2) x-goog-iap-jwt-assertion - * 3) access_token query parameter + * 1) Authorization: Bearer + * 2) x-goog-iap-jwt-assertion + * 3) access_token query parameter + * * Default locations can be specified as followings: - * jwt_locations: - * - header: Authorization - * value_prefix: "Bearer " - * - header: x-goog-iap-jwt-assertion - * - query: access_token + * jwt_locations: + * - header: Authorization + * value_prefix: "Bearer " + * - header: x-goog-iap-jwt-assertion + * - query: access_token * * * repeated .google.api.JwtLocation jwt_locations = 6; */ com.google.api.JwtLocation getJwtLocations(int index); + /** * * @@ -265,23 +291,27 @@ public interface AuthProviderOrBuilder * Defines the locations to extract the JWT. For now it is only used by the * Cloud Endpoints to store the OpenAPI extension [x-google-jwt-locations] * (https://cloud.google.com/endpoints/docs/openapi/openapi-extensions#x-google-jwt-locations) + * * JWT locations can be one of HTTP headers, URL query parameters or * cookies. The rule is that the first match wins. + * * If not specified, default to use following 3 locations: - * 1) Authorization: Bearer - * 2) x-goog-iap-jwt-assertion - * 3) access_token query parameter + * 1) Authorization: Bearer + * 2) x-goog-iap-jwt-assertion + * 3) access_token query parameter + * * Default locations can be specified as followings: - * jwt_locations: - * - header: Authorization - * value_prefix: "Bearer " - * - header: x-goog-iap-jwt-assertion - * - query: access_token + * jwt_locations: + * - header: Authorization + * value_prefix: "Bearer " + * - header: x-goog-iap-jwt-assertion + * - query: access_token * * * repeated .google.api.JwtLocation jwt_locations = 6; */ int getJwtLocationsCount(); + /** * * @@ -289,23 +319,27 @@ public interface AuthProviderOrBuilder * Defines the locations to extract the JWT. For now it is only used by the * Cloud Endpoints to store the OpenAPI extension [x-google-jwt-locations] * (https://cloud.google.com/endpoints/docs/openapi/openapi-extensions#x-google-jwt-locations) + * * JWT locations can be one of HTTP headers, URL query parameters or * cookies. The rule is that the first match wins. + * * If not specified, default to use following 3 locations: - * 1) Authorization: Bearer - * 2) x-goog-iap-jwt-assertion - * 3) access_token query parameter + * 1) Authorization: Bearer + * 2) x-goog-iap-jwt-assertion + * 3) access_token query parameter + * * Default locations can be specified as followings: - * jwt_locations: - * - header: Authorization - * value_prefix: "Bearer " - * - header: x-goog-iap-jwt-assertion - * - query: access_token + * jwt_locations: + * - header: Authorization + * value_prefix: "Bearer " + * - header: x-goog-iap-jwt-assertion + * - query: access_token * * * repeated .google.api.JwtLocation jwt_locations = 6; */ java.util.List getJwtLocationsOrBuilderList(); + /** * * @@ -313,18 +347,21 @@ public interface AuthProviderOrBuilder * Defines the locations to extract the JWT. For now it is only used by the * Cloud Endpoints to store the OpenAPI extension [x-google-jwt-locations] * (https://cloud.google.com/endpoints/docs/openapi/openapi-extensions#x-google-jwt-locations) + * * JWT locations can be one of HTTP headers, URL query parameters or * cookies. The rule is that the first match wins. + * * If not specified, default to use following 3 locations: - * 1) Authorization: Bearer - * 2) x-goog-iap-jwt-assertion - * 3) access_token query parameter + * 1) Authorization: Bearer + * 2) x-goog-iap-jwt-assertion + * 3) access_token query parameter + * * Default locations can be specified as followings: - * jwt_locations: - * - header: Authorization - * value_prefix: "Bearer " - * - header: x-goog-iap-jwt-assertion - * - query: access_token + * jwt_locations: + * - header: Authorization + * value_prefix: "Bearer " + * - header: x-goog-iap-jwt-assertion + * - query: access_token * * * repeated .google.api.JwtLocation jwt_locations = 6; diff --git a/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/AuthRequirement.java b/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/AuthRequirement.java index 3bfbcfa23d..5edf30494e 100644 --- a/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/AuthRequirement.java +++ b/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/AuthRequirement.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,9 @@ * limitations under the License. */ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: google/api/auth.proto +// Protobuf Java Version: 4.33.2 package com.google.api; @@ -29,13 +31,25 @@ * * Protobuf type {@code google.api.AuthRequirement} */ -public final class AuthRequirement extends com.google.protobuf.GeneratedMessageV3 +@com.google.protobuf.Generated +public final class AuthRequirement extends com.google.protobuf.GeneratedMessage implements // @@protoc_insertion_point(message_implements:google.api.AuthRequirement) AuthRequirementOrBuilder { private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "AuthRequirement"); + } + // Use AuthRequirement.newBuilder() to construct. - private AuthRequirement(com.google.protobuf.GeneratedMessageV3.Builder builder) { + private AuthRequirement(com.google.protobuf.GeneratedMessage.Builder builder) { super(builder); } @@ -44,23 +58,12 @@ private AuthRequirement() { audiences_ = ""; } - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new AuthRequirement(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.api.AuthProto.internal_static_google_api_AuthRequirement_descriptor; } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.api.AuthProto.internal_static_google_api_AuthRequirement_fieldAccessorTable .ensureFieldAccessorsInitialized( @@ -68,14 +71,19 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } public static final int PROVIDER_ID_FIELD_NUMBER = 1; - private volatile java.lang.Object providerId_; + + @SuppressWarnings("serial") + private volatile java.lang.Object providerId_ = ""; + /** * * *
            * [id][google.api.AuthProvider.id] from authentication provider.
        +   *
            * Example:
        -   *     provider_id: bookstore_auth
        +   *
        +   * provider_id: bookstore_auth
            * 
        * * string provider_id = 1; @@ -94,13 +102,16 @@ public java.lang.String getProviderId() { return s; } } + /** * * *
            * [id][google.api.AuthProvider.id] from authentication provider.
        +   *
            * Example:
        -   *     provider_id: bookstore_auth
        +   *
        +   * provider_id: bookstore_auth
            * 
        * * string provider_id = 1; @@ -121,13 +132,17 @@ public com.google.protobuf.ByteString getProviderIdBytes() { } public static final int AUDIENCES_FIELD_NUMBER = 2; - private volatile java.lang.Object audiences_; + + @SuppressWarnings("serial") + private volatile java.lang.Object audiences_ = ""; + /** * * *
            * NOTE: This will be deprecated soon, once AuthProvider.audiences is
            * implemented and accepted in all the runtime components.
        +   *
            * The list of JWT
            * [audiences](https://tools.ietf.org/html/draft-ietf-oauth-json-web-token-32#section-4.1.3).
            * that are allowed to access. A JWT containing any of these audiences will
        @@ -136,9 +151,11 @@ public com.google.protobuf.ByteString getProviderIdBytes() {
            * will be accepted. For example, if no audiences are in the setting,
            * LibraryService API will only accept JWTs with the following audience
            * "https://library-example.googleapis.com/google.example.library.v1.LibraryService".
        +   *
            * Example:
        -   *     audiences: bookstore_android.apps.googleusercontent.com,
        -   *                bookstore_web.apps.googleusercontent.com
        +   *
        +   * audiences: bookstore_android.apps.googleusercontent.com,
        +   * bookstore_web.apps.googleusercontent.com
            * 
        * * string audiences = 2; @@ -157,12 +174,14 @@ public java.lang.String getAudiences() { return s; } } + /** * * *
            * NOTE: This will be deprecated soon, once AuthProvider.audiences is
            * implemented and accepted in all the runtime components.
        +   *
            * The list of JWT
            * [audiences](https://tools.ietf.org/html/draft-ietf-oauth-json-web-token-32#section-4.1.3).
            * that are allowed to access. A JWT containing any of these audiences will
        @@ -171,9 +190,11 @@ public java.lang.String getAudiences() {
            * will be accepted. For example, if no audiences are in the setting,
            * LibraryService API will only accept JWTs with the following audience
            * "https://library-example.googleapis.com/google.example.library.v1.LibraryService".
        +   *
            * Example:
        -   *     audiences: bookstore_android.apps.googleusercontent.com,
        -   *                bookstore_web.apps.googleusercontent.com
        +   *
        +   * audiences: bookstore_android.apps.googleusercontent.com,
        +   * bookstore_web.apps.googleusercontent.com
            * 
        * * string audiences = 2; @@ -207,11 +228,11 @@ public final boolean isInitialized() { @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(providerId_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, providerId_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(providerId_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, providerId_); } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(audiences_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 2, audiences_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(audiences_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, audiences_); } getUnknownFields().writeTo(output); } @@ -222,11 +243,11 @@ public int getSerializedSize() { if (size != -1) return size; size = 0; - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(providerId_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, providerId_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(providerId_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, providerId_); } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(audiences_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, audiences_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(audiences_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, audiences_); } size += getUnknownFields().getSerializedSize(); memoizedSize = size; @@ -301,38 +322,38 @@ public static com.google.api.AuthRequirement parseFrom( public static com.google.api.AuthRequirement parseFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); } public static com.google.api.AuthRequirement parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } public static com.google.api.AuthRequirement parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); } public static com.google.api.AuthRequirement parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( PARSER, input, extensionRegistry); } public static com.google.api.AuthRequirement parseFrom(com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); } public static com.google.api.AuthRequirement parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } @@ -355,10 +376,11 @@ public Builder toBuilder() { } @java.lang.Override - protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { Builder builder = new Builder(parent); return builder; } + /** * * @@ -370,7 +392,7 @@ protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.Build * * Protobuf type {@code google.api.AuthRequirement} */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder implements // @@protoc_insertion_point(builder_implements:google.api.AuthRequirement) com.google.api.AuthRequirementOrBuilder { @@ -379,7 +401,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.api.AuthProto.internal_static_google_api_AuthRequirement_fieldAccessorTable .ensureFieldAccessorsInitialized( @@ -389,17 +411,16 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { // Construct using com.google.api.AuthRequirement.newBuilder() private Builder() {} - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { super(parent); } @java.lang.Override public Builder clear() { super.clear(); + bitField0_ = 0; providerId_ = ""; - audiences_ = ""; - return this; } @@ -425,43 +446,21 @@ public com.google.api.AuthRequirement build() { @java.lang.Override public com.google.api.AuthRequirement buildPartial() { com.google.api.AuthRequirement result = new com.google.api.AuthRequirement(this); - result.providerId_ = providerId_; - result.audiences_ = audiences_; + if (bitField0_ != 0) { + buildPartial0(result); + } 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); + private void buildPartial0(com.google.api.AuthRequirement result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.providerId_ = providerId_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.audiences_ = audiences_; + } } @java.lang.Override @@ -478,10 +477,12 @@ public Builder mergeFrom(com.google.api.AuthRequirement other) { if (other == com.google.api.AuthRequirement.getDefaultInstance()) return this; if (!other.getProviderId().isEmpty()) { providerId_ = other.providerId_; + bitField0_ |= 0x00000001; onChanged(); } if (!other.getAudiences().isEmpty()) { audiences_ = other.audiences_; + bitField0_ |= 0x00000002; onChanged(); } this.mergeUnknownFields(other.getUnknownFields()); @@ -513,13 +514,13 @@ public Builder mergeFrom( case 10: { providerId_ = input.readStringRequireUtf8(); - + bitField0_ |= 0x00000001; break; } // case 10 case 18: { audiences_ = input.readStringRequireUtf8(); - + bitField0_ |= 0x00000002; break; } // case 18 default: @@ -539,14 +540,19 @@ public Builder mergeFrom( return this; } + private int bitField0_; + private java.lang.Object providerId_ = ""; + /** * * *
              * [id][google.api.AuthProvider.id] from authentication provider.
        +     *
              * Example:
        -     *     provider_id: bookstore_auth
        +     *
        +     * provider_id: bookstore_auth
              * 
        * * string provider_id = 1; @@ -564,13 +570,16 @@ public java.lang.String getProviderId() { return (java.lang.String) ref; } } + /** * * *
              * [id][google.api.AuthProvider.id] from authentication provider.
        +     *
              * Example:
        -     *     provider_id: bookstore_auth
        +     *
        +     * provider_id: bookstore_auth
              * 
        * * string provider_id = 1; @@ -588,13 +597,16 @@ public com.google.protobuf.ByteString getProviderIdBytes() { return (com.google.protobuf.ByteString) ref; } } + /** * * *
              * [id][google.api.AuthProvider.id] from authentication provider.
        +     *
              * Example:
        -     *     provider_id: bookstore_auth
        +     *
        +     * provider_id: bookstore_auth
              * 
        * * string provider_id = 1; @@ -606,18 +618,21 @@ public Builder setProviderId(java.lang.String value) { if (value == null) { throw new NullPointerException(); } - providerId_ = value; + bitField0_ |= 0x00000001; onChanged(); return this; } + /** * * *
              * [id][google.api.AuthProvider.id] from authentication provider.
        +     *
              * Example:
        -     *     provider_id: bookstore_auth
        +     *
        +     * provider_id: bookstore_auth
              * 
        * * string provider_id = 1; @@ -625,18 +640,21 @@ public Builder setProviderId(java.lang.String value) { * @return This builder for chaining. */ public Builder clearProviderId() { - providerId_ = getDefaultInstance().getProviderId(); + bitField0_ = (bitField0_ & ~0x00000001); onChanged(); return this; } + /** * * *
              * [id][google.api.AuthProvider.id] from authentication provider.
        +     *
              * Example:
        -     *     provider_id: bookstore_auth
        +     *
        +     * provider_id: bookstore_auth
              * 
        * * string provider_id = 1; @@ -649,19 +667,21 @@ public Builder setProviderIdBytes(com.google.protobuf.ByteString value) { throw new NullPointerException(); } checkByteStringIsUtf8(value); - providerId_ = value; + bitField0_ |= 0x00000001; onChanged(); return this; } private java.lang.Object audiences_ = ""; + /** * * *
              * NOTE: This will be deprecated soon, once AuthProvider.audiences is
              * implemented and accepted in all the runtime components.
        +     *
              * The list of JWT
              * [audiences](https://tools.ietf.org/html/draft-ietf-oauth-json-web-token-32#section-4.1.3).
              * that are allowed to access. A JWT containing any of these audiences will
        @@ -670,9 +690,11 @@ public Builder setProviderIdBytes(com.google.protobuf.ByteString value) {
              * will be accepted. For example, if no audiences are in the setting,
              * LibraryService API will only accept JWTs with the following audience
              * "https://library-example.googleapis.com/google.example.library.v1.LibraryService".
        +     *
              * Example:
        -     *     audiences: bookstore_android.apps.googleusercontent.com,
        -     *                bookstore_web.apps.googleusercontent.com
        +     *
        +     * audiences: bookstore_android.apps.googleusercontent.com,
        +     * bookstore_web.apps.googleusercontent.com
              * 
        * * string audiences = 2; @@ -690,12 +712,14 @@ public java.lang.String getAudiences() { return (java.lang.String) ref; } } + /** * * *
              * NOTE: This will be deprecated soon, once AuthProvider.audiences is
              * implemented and accepted in all the runtime components.
        +     *
              * The list of JWT
              * [audiences](https://tools.ietf.org/html/draft-ietf-oauth-json-web-token-32#section-4.1.3).
              * that are allowed to access. A JWT containing any of these audiences will
        @@ -704,9 +728,11 @@ public java.lang.String getAudiences() {
              * will be accepted. For example, if no audiences are in the setting,
              * LibraryService API will only accept JWTs with the following audience
              * "https://library-example.googleapis.com/google.example.library.v1.LibraryService".
        +     *
              * Example:
        -     *     audiences: bookstore_android.apps.googleusercontent.com,
        -     *                bookstore_web.apps.googleusercontent.com
        +     *
        +     * audiences: bookstore_android.apps.googleusercontent.com,
        +     * bookstore_web.apps.googleusercontent.com
              * 
        * * string audiences = 2; @@ -724,12 +750,14 @@ public com.google.protobuf.ByteString getAudiencesBytes() { return (com.google.protobuf.ByteString) ref; } } + /** * * *
              * NOTE: This will be deprecated soon, once AuthProvider.audiences is
              * implemented and accepted in all the runtime components.
        +     *
              * The list of JWT
              * [audiences](https://tools.ietf.org/html/draft-ietf-oauth-json-web-token-32#section-4.1.3).
              * that are allowed to access. A JWT containing any of these audiences will
        @@ -738,9 +766,11 @@ public com.google.protobuf.ByteString getAudiencesBytes() {
              * will be accepted. For example, if no audiences are in the setting,
              * LibraryService API will only accept JWTs with the following audience
              * "https://library-example.googleapis.com/google.example.library.v1.LibraryService".
        +     *
              * Example:
        -     *     audiences: bookstore_android.apps.googleusercontent.com,
        -     *                bookstore_web.apps.googleusercontent.com
        +     *
        +     * audiences: bookstore_android.apps.googleusercontent.com,
        +     * bookstore_web.apps.googleusercontent.com
              * 
        * * string audiences = 2; @@ -752,17 +782,19 @@ public Builder setAudiences(java.lang.String value) { if (value == null) { throw new NullPointerException(); } - audiences_ = value; + bitField0_ |= 0x00000002; onChanged(); return this; } + /** * * *
              * NOTE: This will be deprecated soon, once AuthProvider.audiences is
              * implemented and accepted in all the runtime components.
        +     *
              * The list of JWT
              * [audiences](https://tools.ietf.org/html/draft-ietf-oauth-json-web-token-32#section-4.1.3).
              * that are allowed to access. A JWT containing any of these audiences will
        @@ -771,9 +803,11 @@ public Builder setAudiences(java.lang.String value) {
              * will be accepted. For example, if no audiences are in the setting,
              * LibraryService API will only accept JWTs with the following audience
              * "https://library-example.googleapis.com/google.example.library.v1.LibraryService".
        +     *
              * Example:
        -     *     audiences: bookstore_android.apps.googleusercontent.com,
        -     *                bookstore_web.apps.googleusercontent.com
        +     *
        +     * audiences: bookstore_android.apps.googleusercontent.com,
        +     * bookstore_web.apps.googleusercontent.com
              * 
        * * string audiences = 2; @@ -781,17 +815,19 @@ public Builder setAudiences(java.lang.String value) { * @return This builder for chaining. */ public Builder clearAudiences() { - audiences_ = getDefaultInstance().getAudiences(); + bitField0_ = (bitField0_ & ~0x00000002); onChanged(); return this; } + /** * * *
              * NOTE: This will be deprecated soon, once AuthProvider.audiences is
              * implemented and accepted in all the runtime components.
        +     *
              * The list of JWT
              * [audiences](https://tools.ietf.org/html/draft-ietf-oauth-json-web-token-32#section-4.1.3).
              * that are allowed to access. A JWT containing any of these audiences will
        @@ -800,9 +836,11 @@ public Builder clearAudiences() {
              * will be accepted. For example, if no audiences are in the setting,
              * LibraryService API will only accept JWTs with the following audience
              * "https://library-example.googleapis.com/google.example.library.v1.LibraryService".
        +     *
              * Example:
        -     *     audiences: bookstore_android.apps.googleusercontent.com,
        -     *                bookstore_web.apps.googleusercontent.com
        +     *
        +     * audiences: bookstore_android.apps.googleusercontent.com,
        +     * bookstore_web.apps.googleusercontent.com
              * 
        * * string audiences = 2; @@ -815,23 +853,12 @@ public Builder setAudiencesBytes(com.google.protobuf.ByteString value) { throw new NullPointerException(); } checkByteStringIsUtf8(value); - audiences_ = 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.api.AuthRequirement) } diff --git a/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/AuthRequirementOrBuilder.java b/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/AuthRequirementOrBuilder.java index da45b4a941..0b285debdb 100644 --- a/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/AuthRequirementOrBuilder.java +++ b/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/AuthRequirementOrBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,10 +14,13 @@ * limitations under the License. */ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: google/api/auth.proto +// Protobuf Java Version: 4.33.2 package com.google.api; +@com.google.protobuf.Generated public interface AuthRequirementOrBuilder extends // @@protoc_insertion_point(interface_extends:google.api.AuthRequirement) @@ -28,8 +31,10 @@ public interface AuthRequirementOrBuilder * *
            * [id][google.api.AuthProvider.id] from authentication provider.
        +   *
            * Example:
        -   *     provider_id: bookstore_auth
        +   *
        +   * provider_id: bookstore_auth
            * 
        * * string provider_id = 1; @@ -37,13 +42,16 @@ public interface AuthRequirementOrBuilder * @return The providerId. */ java.lang.String getProviderId(); + /** * * *
            * [id][google.api.AuthProvider.id] from authentication provider.
        +   *
            * Example:
        -   *     provider_id: bookstore_auth
        +   *
        +   * provider_id: bookstore_auth
            * 
        * * string provider_id = 1; @@ -58,6 +66,7 @@ public interface AuthRequirementOrBuilder *
            * NOTE: This will be deprecated soon, once AuthProvider.audiences is
            * implemented and accepted in all the runtime components.
        +   *
            * The list of JWT
            * [audiences](https://tools.ietf.org/html/draft-ietf-oauth-json-web-token-32#section-4.1.3).
            * that are allowed to access. A JWT containing any of these audiences will
        @@ -66,9 +75,11 @@ public interface AuthRequirementOrBuilder
            * will be accepted. For example, if no audiences are in the setting,
            * LibraryService API will only accept JWTs with the following audience
            * "https://library-example.googleapis.com/google.example.library.v1.LibraryService".
        +   *
            * Example:
        -   *     audiences: bookstore_android.apps.googleusercontent.com,
        -   *                bookstore_web.apps.googleusercontent.com
        +   *
        +   * audiences: bookstore_android.apps.googleusercontent.com,
        +   * bookstore_web.apps.googleusercontent.com
            * 
        * * string audiences = 2; @@ -76,12 +87,14 @@ public interface AuthRequirementOrBuilder * @return The audiences. */ java.lang.String getAudiences(); + /** * * *
            * NOTE: This will be deprecated soon, once AuthProvider.audiences is
            * implemented and accepted in all the runtime components.
        +   *
            * The list of JWT
            * [audiences](https://tools.ietf.org/html/draft-ietf-oauth-json-web-token-32#section-4.1.3).
            * that are allowed to access. A JWT containing any of these audiences will
        @@ -90,9 +103,11 @@ public interface AuthRequirementOrBuilder
            * will be accepted. For example, if no audiences are in the setting,
            * LibraryService API will only accept JWTs with the following audience
            * "https://library-example.googleapis.com/google.example.library.v1.LibraryService".
        +   *
            * Example:
        -   *     audiences: bookstore_android.apps.googleusercontent.com,
        -   *                bookstore_web.apps.googleusercontent.com
        +   *
        +   * audiences: bookstore_android.apps.googleusercontent.com,
        +   * bookstore_web.apps.googleusercontent.com
            * 
        * * string audiences = 2; diff --git a/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/Authentication.java b/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/Authentication.java index 4977c6c81d..002b74d459 100644 --- a/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/Authentication.java +++ b/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/Authentication.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,9 @@ * limitations under the License. */ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: google/api/auth.proto +// Protobuf Java Version: 4.33.2 package com.google.api; @@ -24,31 +26,45 @@ *
          * `Authentication` defines the authentication configuration for API methods
          * provided by an API service.
        + *
          * Example:
        - *     name: calendar.googleapis.com
        - *     authentication:
        - *       providers:
        - *       - id: google_calendar_auth
        - *         jwks_uri: https://www.googleapis.com/oauth2/v1/certs
        - *         issuer: https://securetoken.google.com
        - *       rules:
        - *       - selector: "*"
        - *         requirements:
        - *           provider_id: google_calendar_auth
        - *       - selector: google.calendar.Delegate
        - *         oauth:
        - *           canonical_scopes: https://www.googleapis.com/auth/calendar.read
        + *
        + * name: calendar.googleapis.com
        + * authentication:
        + * providers:
        + * - id: google_calendar_auth
        + * jwks_uri: https://www.googleapis.com/oauth2/v1/certs
        + * issuer: https://securetoken.google.com
        + * rules:
        + * - selector: "*"
        + * requirements:
        + * provider_id: google_calendar_auth
        + * - selector: google.calendar.Delegate
        + * oauth:
        + * canonical_scopes: https://www.googleapis.com/auth/calendar.read
          * 
        * * Protobuf type {@code google.api.Authentication} */ -public final class Authentication extends com.google.protobuf.GeneratedMessageV3 +@com.google.protobuf.Generated +public final class Authentication extends com.google.protobuf.GeneratedMessage implements // @@protoc_insertion_point(message_implements:google.api.Authentication) AuthenticationOrBuilder { private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "Authentication"); + } + // Use Authentication.newBuilder() to construct. - private Authentication(com.google.protobuf.GeneratedMessageV3.Builder builder) { + private Authentication(com.google.protobuf.GeneratedMessage.Builder builder) { super(builder); } @@ -57,23 +73,12 @@ private Authentication() { providers_ = java.util.Collections.emptyList(); } - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new Authentication(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.api.AuthProto.internal_static_google_api_Authentication_descriptor; } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.api.AuthProto.internal_static_google_api_Authentication_fieldAccessorTable .ensureFieldAccessorsInitialized( @@ -81,12 +86,16 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } public static final int RULES_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") private java.util.List rules_; + /** * * *
            * A list of authentication rules that apply to individual API methods.
        +   *
            * **NOTE:** All service configuration rules follow "last one wins" order.
            * 
        * @@ -96,11 +105,13 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { public java.util.List getRulesList() { return rules_; } + /** * * *
            * A list of authentication rules that apply to individual API methods.
        +   *
            * **NOTE:** All service configuration rules follow "last one wins" order.
            * 
        * @@ -111,11 +122,13 @@ public java.util.List getRulesList() { getRulesOrBuilderList() { return rules_; } + /** * * *
            * A list of authentication rules that apply to individual API methods.
        +   *
            * **NOTE:** All service configuration rules follow "last one wins" order.
            * 
        * @@ -125,11 +138,13 @@ public java.util.List getRulesList() { public int getRulesCount() { return rules_.size(); } + /** * * *
            * A list of authentication rules that apply to individual API methods.
        +   *
            * **NOTE:** All service configuration rules follow "last one wins" order.
            * 
        * @@ -139,11 +154,13 @@ public int getRulesCount() { public com.google.api.AuthenticationRule getRules(int index) { return rules_.get(index); } + /** * * *
            * A list of authentication rules that apply to individual API methods.
        +   *
            * **NOTE:** All service configuration rules follow "last one wins" order.
            * 
        * @@ -155,7 +172,10 @@ public com.google.api.AuthenticationRuleOrBuilder getRulesOrBuilder(int index) { } public static final int PROVIDERS_FIELD_NUMBER = 4; + + @SuppressWarnings("serial") private java.util.List providers_; + /** * * @@ -169,6 +189,7 @@ public com.google.api.AuthenticationRuleOrBuilder getRulesOrBuilder(int index) { public java.util.List getProvidersList() { return providers_; } + /** * * @@ -183,6 +204,7 @@ public java.util.List getProvidersList() { getProvidersOrBuilderList() { return providers_; } + /** * * @@ -196,6 +218,7 @@ public java.util.List getProvidersList() { public int getProvidersCount() { return providers_.size(); } + /** * * @@ -209,6 +232,7 @@ public int getProvidersCount() { public com.google.api.AuthProvider getProviders(int index) { return providers_.get(index); } + /** * * @@ -335,38 +359,38 @@ public static com.google.api.Authentication parseFrom( public static com.google.api.Authentication parseFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); } public static com.google.api.Authentication parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } public static com.google.api.Authentication parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); } public static com.google.api.Authentication parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( PARSER, input, extensionRegistry); } public static com.google.api.Authentication parseFrom(com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); } public static com.google.api.Authentication parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } @@ -389,35 +413,38 @@ public Builder toBuilder() { } @java.lang.Override - protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { Builder builder = new Builder(parent); return builder; } + /** * * *
            * `Authentication` defines the authentication configuration for API methods
            * provided by an API service.
        +   *
            * Example:
        -   *     name: calendar.googleapis.com
        -   *     authentication:
        -   *       providers:
        -   *       - id: google_calendar_auth
        -   *         jwks_uri: https://www.googleapis.com/oauth2/v1/certs
        -   *         issuer: https://securetoken.google.com
        -   *       rules:
        -   *       - selector: "*"
        -   *         requirements:
        -   *           provider_id: google_calendar_auth
        -   *       - selector: google.calendar.Delegate
        -   *         oauth:
        -   *           canonical_scopes: https://www.googleapis.com/auth/calendar.read
        +   *
        +   * name: calendar.googleapis.com
        +   * authentication:
        +   * providers:
        +   * - id: google_calendar_auth
        +   * jwks_uri: https://www.googleapis.com/oauth2/v1/certs
        +   * issuer: https://securetoken.google.com
        +   * rules:
        +   * - selector: "*"
        +   * requirements:
        +   * provider_id: google_calendar_auth
        +   * - selector: google.calendar.Delegate
        +   * oauth:
        +   * canonical_scopes: https://www.googleapis.com/auth/calendar.read
            * 
        * * Protobuf type {@code google.api.Authentication} */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder implements // @@protoc_insertion_point(builder_implements:google.api.Authentication) com.google.api.AuthenticationOrBuilder { @@ -426,7 +453,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.api.AuthProto.internal_static_google_api_Authentication_fieldAccessorTable .ensureFieldAccessorsInitialized( @@ -436,13 +463,14 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { // Construct using com.google.api.Authentication.newBuilder() private Builder() {} - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { super(parent); } @java.lang.Override public Builder clear() { super.clear(); + bitField0_ = 0; if (rulesBuilder_ == null) { rules_ = java.util.Collections.emptyList(); } else { @@ -482,7 +510,15 @@ public com.google.api.Authentication build() { @java.lang.Override public com.google.api.Authentication buildPartial() { com.google.api.Authentication result = new com.google.api.Authentication(this); - int from_bitField0_ = bitField0_; + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields(com.google.api.Authentication result) { if (rulesBuilder_ == null) { if (((bitField0_ & 0x00000001) != 0)) { rules_ = java.util.Collections.unmodifiableList(rules_); @@ -501,41 +537,10 @@ public com.google.api.Authentication buildPartial() { } else { result.providers_ = providersBuilder_.build(); } - onBuilt(); - return result; } - @java.lang.Override - public Builder clone() { - return super.clone(); - } - - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.setField(field, value); - } - - @java.lang.Override - public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - - @java.lang.Override - public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.addRepeatedField(field, value); + private void buildPartial0(com.google.api.Authentication result) { + int from_bitField0_ = bitField0_; } @java.lang.Override @@ -569,8 +574,8 @@ public Builder mergeFrom(com.google.api.Authentication other) { rules_ = other.rules_; bitField0_ = (bitField0_ & ~0x00000001); rulesBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders - ? getRulesFieldBuilder() + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders + ? internalGetRulesFieldBuilder() : null; } else { rulesBuilder_.addAllMessages(other.rules_); @@ -596,8 +601,8 @@ public Builder mergeFrom(com.google.api.Authentication other) { providers_ = other.providers_; bitField0_ = (bitField0_ & ~0x00000002); providersBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders - ? getProvidersFieldBuilder() + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders + ? internalGetProvidersFieldBuilder() : null; } else { providersBuilder_.addAllMessages(other.providers_); @@ -684,7 +689,7 @@ private void ensureRulesIsMutable() { } } - private com.google.protobuf.RepeatedFieldBuilderV3< + private com.google.protobuf.RepeatedFieldBuilder< com.google.api.AuthenticationRule, com.google.api.AuthenticationRule.Builder, com.google.api.AuthenticationRuleOrBuilder> @@ -695,6 +700,7 @@ private void ensureRulesIsMutable() { * *
              * A list of authentication rules that apply to individual API methods.
        +     *
              * **NOTE:** All service configuration rules follow "last one wins" order.
              * 
        * @@ -707,11 +713,13 @@ public java.util.List getRulesList() { return rulesBuilder_.getMessageList(); } } + /** * * *
              * A list of authentication rules that apply to individual API methods.
        +     *
              * **NOTE:** All service configuration rules follow "last one wins" order.
              * 
        * @@ -724,11 +732,13 @@ public int getRulesCount() { return rulesBuilder_.getCount(); } } + /** * * *
              * A list of authentication rules that apply to individual API methods.
        +     *
              * **NOTE:** All service configuration rules follow "last one wins" order.
              * 
        * @@ -741,11 +751,13 @@ public com.google.api.AuthenticationRule getRules(int index) { return rulesBuilder_.getMessage(index); } } + /** * * *
              * A list of authentication rules that apply to individual API methods.
        +     *
              * **NOTE:** All service configuration rules follow "last one wins" order.
              * 
        * @@ -764,11 +776,13 @@ public Builder setRules(int index, com.google.api.AuthenticationRule value) { } return this; } + /** * * *
              * A list of authentication rules that apply to individual API methods.
        +     *
              * **NOTE:** All service configuration rules follow "last one wins" order.
              * 
        * @@ -784,11 +798,13 @@ public Builder setRules(int index, com.google.api.AuthenticationRule.Builder bui } return this; } + /** * * *
              * A list of authentication rules that apply to individual API methods.
        +     *
              * **NOTE:** All service configuration rules follow "last one wins" order.
              * 
        * @@ -807,11 +823,13 @@ public Builder addRules(com.google.api.AuthenticationRule value) { } return this; } + /** * * *
              * A list of authentication rules that apply to individual API methods.
        +     *
              * **NOTE:** All service configuration rules follow "last one wins" order.
              * 
        * @@ -830,11 +848,13 @@ public Builder addRules(int index, com.google.api.AuthenticationRule value) { } return this; } + /** * * *
              * A list of authentication rules that apply to individual API methods.
        +     *
              * **NOTE:** All service configuration rules follow "last one wins" order.
              * 
        * @@ -850,11 +870,13 @@ public Builder addRules(com.google.api.AuthenticationRule.Builder builderForValu } return this; } + /** * * *
              * A list of authentication rules that apply to individual API methods.
        +     *
              * **NOTE:** All service configuration rules follow "last one wins" order.
              * 
        * @@ -870,11 +892,13 @@ public Builder addRules(int index, com.google.api.AuthenticationRule.Builder bui } return this; } + /** * * *
              * A list of authentication rules that apply to individual API methods.
        +     *
              * **NOTE:** All service configuration rules follow "last one wins" order.
              * 
        * @@ -891,11 +915,13 @@ public Builder addAllRules( } return this; } + /** * * *
              * A list of authentication rules that apply to individual API methods.
        +     *
              * **NOTE:** All service configuration rules follow "last one wins" order.
              * 
        * @@ -911,11 +937,13 @@ public Builder clearRules() { } return this; } + /** * * *
              * A list of authentication rules that apply to individual API methods.
        +     *
              * **NOTE:** All service configuration rules follow "last one wins" order.
              * 
        * @@ -931,24 +959,28 @@ public Builder removeRules(int index) { } return this; } + /** * * *
              * A list of authentication rules that apply to individual API methods.
        +     *
              * **NOTE:** All service configuration rules follow "last one wins" order.
              * 
        * * repeated .google.api.AuthenticationRule rules = 3; */ public com.google.api.AuthenticationRule.Builder getRulesBuilder(int index) { - return getRulesFieldBuilder().getBuilder(index); + return internalGetRulesFieldBuilder().getBuilder(index); } + /** * * *
              * A list of authentication rules that apply to individual API methods.
        +     *
              * **NOTE:** All service configuration rules follow "last one wins" order.
              * 
        * @@ -961,11 +993,13 @@ public com.google.api.AuthenticationRuleOrBuilder getRulesOrBuilder(int index) { return rulesBuilder_.getMessageOrBuilder(index); } } + /** * * *
              * A list of authentication rules that apply to individual API methods.
        +     *
              * **NOTE:** All service configuration rules follow "last one wins" order.
              * 
        * @@ -979,56 +1013,62 @@ public com.google.api.AuthenticationRuleOrBuilder getRulesOrBuilder(int index) { return java.util.Collections.unmodifiableList(rules_); } } + /** * * *
              * A list of authentication rules that apply to individual API methods.
        +     *
              * **NOTE:** All service configuration rules follow "last one wins" order.
              * 
        * * repeated .google.api.AuthenticationRule rules = 3; */ public com.google.api.AuthenticationRule.Builder addRulesBuilder() { - return getRulesFieldBuilder() + return internalGetRulesFieldBuilder() .addBuilder(com.google.api.AuthenticationRule.getDefaultInstance()); } + /** * * *
              * A list of authentication rules that apply to individual API methods.
        +     *
              * **NOTE:** All service configuration rules follow "last one wins" order.
              * 
        * * repeated .google.api.AuthenticationRule rules = 3; */ public com.google.api.AuthenticationRule.Builder addRulesBuilder(int index) { - return getRulesFieldBuilder() + return internalGetRulesFieldBuilder() .addBuilder(index, com.google.api.AuthenticationRule.getDefaultInstance()); } + /** * * *
              * A list of authentication rules that apply to individual API methods.
        +     *
              * **NOTE:** All service configuration rules follow "last one wins" order.
              * 
        * * repeated .google.api.AuthenticationRule rules = 3; */ public java.util.List getRulesBuilderList() { - return getRulesFieldBuilder().getBuilderList(); + return internalGetRulesFieldBuilder().getBuilderList(); } - private com.google.protobuf.RepeatedFieldBuilderV3< + private com.google.protobuf.RepeatedFieldBuilder< com.google.api.AuthenticationRule, com.google.api.AuthenticationRule.Builder, com.google.api.AuthenticationRuleOrBuilder> - getRulesFieldBuilder() { + internalGetRulesFieldBuilder() { if (rulesBuilder_ == null) { rulesBuilder_ = - new com.google.protobuf.RepeatedFieldBuilderV3< + new com.google.protobuf.RepeatedFieldBuilder< com.google.api.AuthenticationRule, com.google.api.AuthenticationRule.Builder, com.google.api.AuthenticationRuleOrBuilder>( @@ -1048,7 +1088,7 @@ private void ensureProvidersIsMutable() { } } - private com.google.protobuf.RepeatedFieldBuilderV3< + private com.google.protobuf.RepeatedFieldBuilder< com.google.api.AuthProvider, com.google.api.AuthProvider.Builder, com.google.api.AuthProviderOrBuilder> @@ -1070,6 +1110,7 @@ public java.util.List getProvidersList() { return providersBuilder_.getMessageList(); } } + /** * * @@ -1086,6 +1127,7 @@ public int getProvidersCount() { return providersBuilder_.getCount(); } } + /** * * @@ -1102,6 +1144,7 @@ public com.google.api.AuthProvider getProviders(int index) { return providersBuilder_.getMessage(index); } } + /** * * @@ -1124,6 +1167,7 @@ public Builder setProviders(int index, com.google.api.AuthProvider value) { } return this; } + /** * * @@ -1143,6 +1187,7 @@ public Builder setProviders(int index, com.google.api.AuthProvider.Builder build } return this; } + /** * * @@ -1165,6 +1210,7 @@ public Builder addProviders(com.google.api.AuthProvider value) { } return this; } + /** * * @@ -1187,6 +1233,7 @@ public Builder addProviders(int index, com.google.api.AuthProvider value) { } return this; } + /** * * @@ -1206,6 +1253,7 @@ public Builder addProviders(com.google.api.AuthProvider.Builder builderForValue) } return this; } + /** * * @@ -1225,6 +1273,7 @@ public Builder addProviders(int index, com.google.api.AuthProvider.Builder build } return this; } + /** * * @@ -1245,6 +1294,7 @@ public Builder addAllProviders( } return this; } + /** * * @@ -1264,6 +1314,7 @@ public Builder clearProviders() { } return this; } + /** * * @@ -1283,6 +1334,7 @@ public Builder removeProviders(int index) { } return this; } + /** * * @@ -1293,8 +1345,9 @@ public Builder removeProviders(int index) { * repeated .google.api.AuthProvider providers = 4; */ public com.google.api.AuthProvider.Builder getProvidersBuilder(int index) { - return getProvidersFieldBuilder().getBuilder(index); + return internalGetProvidersFieldBuilder().getBuilder(index); } + /** * * @@ -1311,6 +1364,7 @@ public com.google.api.AuthProviderOrBuilder getProvidersOrBuilder(int index) { return providersBuilder_.getMessageOrBuilder(index); } } + /** * * @@ -1328,6 +1382,7 @@ public com.google.api.AuthProviderOrBuilder getProvidersOrBuilder(int index) { return java.util.Collections.unmodifiableList(providers_); } } + /** * * @@ -1338,9 +1393,10 @@ public com.google.api.AuthProviderOrBuilder getProvidersOrBuilder(int index) { * repeated .google.api.AuthProvider providers = 4; */ public com.google.api.AuthProvider.Builder addProvidersBuilder() { - return getProvidersFieldBuilder() + return internalGetProvidersFieldBuilder() .addBuilder(com.google.api.AuthProvider.getDefaultInstance()); } + /** * * @@ -1351,9 +1407,10 @@ public com.google.api.AuthProvider.Builder addProvidersBuilder() { * repeated .google.api.AuthProvider providers = 4; */ public com.google.api.AuthProvider.Builder addProvidersBuilder(int index) { - return getProvidersFieldBuilder() + return internalGetProvidersFieldBuilder() .addBuilder(index, com.google.api.AuthProvider.getDefaultInstance()); } + /** * * @@ -1364,17 +1421,17 @@ public com.google.api.AuthProvider.Builder addProvidersBuilder(int index) { * repeated .google.api.AuthProvider providers = 4; */ public java.util.List getProvidersBuilderList() { - return getProvidersFieldBuilder().getBuilderList(); + return internalGetProvidersFieldBuilder().getBuilderList(); } - private com.google.protobuf.RepeatedFieldBuilderV3< + private com.google.protobuf.RepeatedFieldBuilder< com.google.api.AuthProvider, com.google.api.AuthProvider.Builder, com.google.api.AuthProviderOrBuilder> - getProvidersFieldBuilder() { + internalGetProvidersFieldBuilder() { if (providersBuilder_ == null) { providersBuilder_ = - new com.google.protobuf.RepeatedFieldBuilderV3< + new com.google.protobuf.RepeatedFieldBuilder< com.google.api.AuthProvider, com.google.api.AuthProvider.Builder, com.google.api.AuthProviderOrBuilder>( @@ -1384,17 +1441,6 @@ public java.util.List getProvidersBuilderLi return providersBuilder_; } - @java.lang.Override - public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - // @@protoc_insertion_point(builder_scope:google.api.Authentication) } diff --git a/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/AuthenticationOrBuilder.java b/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/AuthenticationOrBuilder.java index d7dd35ee0e..3d1fec3ee1 100644 --- a/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/AuthenticationOrBuilder.java +++ b/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/AuthenticationOrBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,10 +14,13 @@ * limitations under the License. */ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: google/api/auth.proto +// Protobuf Java Version: 4.33.2 package com.google.api; +@com.google.protobuf.Generated public interface AuthenticationOrBuilder extends // @@protoc_insertion_point(interface_extends:google.api.Authentication) @@ -28,50 +31,59 @@ public interface AuthenticationOrBuilder * *
            * A list of authentication rules that apply to individual API methods.
        +   *
            * **NOTE:** All service configuration rules follow "last one wins" order.
            * 
        * * repeated .google.api.AuthenticationRule rules = 3; */ java.util.List getRulesList(); + /** * * *
            * A list of authentication rules that apply to individual API methods.
        +   *
            * **NOTE:** All service configuration rules follow "last one wins" order.
            * 
        * * repeated .google.api.AuthenticationRule rules = 3; */ com.google.api.AuthenticationRule getRules(int index); + /** * * *
            * A list of authentication rules that apply to individual API methods.
        +   *
            * **NOTE:** All service configuration rules follow "last one wins" order.
            * 
        * * repeated .google.api.AuthenticationRule rules = 3; */ int getRulesCount(); + /** * * *
            * A list of authentication rules that apply to individual API methods.
        +   *
            * **NOTE:** All service configuration rules follow "last one wins" order.
            * 
        * * repeated .google.api.AuthenticationRule rules = 3; */ java.util.List getRulesOrBuilderList(); + /** * * *
            * A list of authentication rules that apply to individual API methods.
        +   *
            * **NOTE:** All service configuration rules follow "last one wins" order.
            * 
        * @@ -89,6 +101,7 @@ public interface AuthenticationOrBuilder * repeated .google.api.AuthProvider providers = 4; */ java.util.List getProvidersList(); + /** * * @@ -99,6 +112,7 @@ public interface AuthenticationOrBuilder * repeated .google.api.AuthProvider providers = 4; */ com.google.api.AuthProvider getProviders(int index); + /** * * @@ -109,6 +123,7 @@ public interface AuthenticationOrBuilder * repeated .google.api.AuthProvider providers = 4; */ int getProvidersCount(); + /** * * @@ -119,6 +134,7 @@ public interface AuthenticationOrBuilder * repeated .google.api.AuthProvider providers = 4; */ java.util.List getProvidersOrBuilderList(); + /** * * diff --git a/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/AuthenticationRule.java b/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/AuthenticationRule.java index 243ee15bd0..14dedb9ea6 100644 --- a/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/AuthenticationRule.java +++ b/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/AuthenticationRule.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,9 @@ * limitations under the License. */ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: google/api/auth.proto +// Protobuf Java Version: 4.33.2 package com.google.api; @@ -23,23 +25,37 @@ * *
          * Authentication rules for the service.
        + *
          * By default, if a method has any authentication requirements, every request
          * must include a valid credential matching one of the requirements.
          * It's an error to include more than one kind of credential in a single
          * request.
        + *
          * If a method doesn't have any auth requirements, request credentials will be
          * ignored.
          * 
        * * Protobuf type {@code google.api.AuthenticationRule} */ -public final class AuthenticationRule extends com.google.protobuf.GeneratedMessageV3 +@com.google.protobuf.Generated +public final class AuthenticationRule extends com.google.protobuf.GeneratedMessage implements // @@protoc_insertion_point(message_implements:google.api.AuthenticationRule) AuthenticationRuleOrBuilder { private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "AuthenticationRule"); + } + // Use AuthenticationRule.newBuilder() to construct. - private AuthenticationRule(com.google.protobuf.GeneratedMessageV3.Builder builder) { + private AuthenticationRule(com.google.protobuf.GeneratedMessage.Builder builder) { super(builder); } @@ -48,23 +64,12 @@ private AuthenticationRule() { requirements_ = java.util.Collections.emptyList(); } - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new AuthenticationRule(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.api.AuthProto.internal_static_google_api_AuthenticationRule_descriptor; } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.api.AuthProto.internal_static_google_api_AuthenticationRule_fieldAccessorTable .ensureFieldAccessorsInitialized( @@ -72,14 +77,20 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { com.google.api.AuthenticationRule.Builder.class); } + private int bitField0_; public static final int SELECTOR_FIELD_NUMBER = 1; - private volatile java.lang.Object selector_; + + @SuppressWarnings("serial") + private volatile java.lang.Object selector_ = ""; + /** * * *
            * Selects the methods to which this rule applies.
        -   * Refer to [selector][google.api.DocumentationRule.selector] for syntax details.
        +   *
        +   * Refer to [selector][google.api.DocumentationRule.selector] for syntax
        +   * details.
            * 
        * * string selector = 1; @@ -98,12 +109,15 @@ public java.lang.String getSelector() { return s; } } + /** * * *
            * Selects the methods to which this rule applies.
        -   * Refer to [selector][google.api.DocumentationRule.selector] for syntax details.
        +   *
        +   * Refer to [selector][google.api.DocumentationRule.selector] for syntax
        +   * details.
            * 
        * * string selector = 1; @@ -125,6 +139,7 @@ public com.google.protobuf.ByteString getSelectorBytes() { public static final int OAUTH_FIELD_NUMBER = 2; private com.google.api.OAuthRequirements oauth_; + /** * * @@ -138,8 +153,9 @@ public com.google.protobuf.ByteString getSelectorBytes() { */ @java.lang.Override public boolean hasOauth() { - return oauth_ != null; + return ((bitField0_ & 0x00000001) != 0); } + /** * * @@ -155,6 +171,7 @@ public boolean hasOauth() { public com.google.api.OAuthRequirements getOauth() { return oauth_ == null ? com.google.api.OAuthRequirements.getDefaultInstance() : oauth_; } + /** * * @@ -166,11 +183,12 @@ public com.google.api.OAuthRequirements getOauth() { */ @java.lang.Override public com.google.api.OAuthRequirementsOrBuilder getOauthOrBuilder() { - return getOauth(); + return oauth_ == null ? com.google.api.OAuthRequirements.getDefaultInstance() : oauth_; } public static final int ALLOW_WITHOUT_CREDENTIAL_FIELD_NUMBER = 5; - private boolean allowWithoutCredential_; + private boolean allowWithoutCredential_ = false; + /** * * @@ -189,7 +207,10 @@ public boolean getAllowWithoutCredential() { } public static final int REQUIREMENTS_FIELD_NUMBER = 7; + + @SuppressWarnings("serial") private java.util.List requirements_; + /** * * @@ -203,6 +224,7 @@ public boolean getAllowWithoutCredential() { public java.util.List getRequirementsList() { return requirements_; } + /** * * @@ -217,6 +239,7 @@ public java.util.List getRequirementsList() { getRequirementsOrBuilderList() { return requirements_; } + /** * * @@ -230,6 +253,7 @@ public java.util.List getRequirementsList() { public int getRequirementsCount() { return requirements_.size(); } + /** * * @@ -243,6 +267,7 @@ public int getRequirementsCount() { public com.google.api.AuthRequirement getRequirements(int index) { return requirements_.get(index); } + /** * * @@ -271,10 +296,10 @@ public final boolean isInitialized() { @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(selector_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, selector_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(selector_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, selector_); } - if (oauth_ != null) { + if (((bitField0_ & 0x00000001) != 0)) { output.writeMessage(2, getOauth()); } if (allowWithoutCredential_ != false) { @@ -292,10 +317,10 @@ public int getSerializedSize() { if (size != -1) return size; size = 0; - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(selector_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, selector_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(selector_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, selector_); } - if (oauth_ != null) { + if (((bitField0_ & 0x00000001) != 0)) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getOauth()); } if (allowWithoutCredential_ != false) { @@ -390,38 +415,38 @@ public static com.google.api.AuthenticationRule parseFrom( public static com.google.api.AuthenticationRule parseFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); } public static com.google.api.AuthenticationRule parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } public static com.google.api.AuthenticationRule parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); } public static com.google.api.AuthenticationRule parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( PARSER, input, extensionRegistry); } public static com.google.api.AuthenticationRule parseFrom( com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); } public static com.google.api.AuthenticationRule parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } @@ -444,26 +469,29 @@ public Builder toBuilder() { } @java.lang.Override - protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { Builder builder = new Builder(parent); return builder; } + /** * * *
            * Authentication rules for the service.
        +   *
            * By default, if a method has any authentication requirements, every request
            * must include a valid credential matching one of the requirements.
            * It's an error to include more than one kind of credential in a single
            * request.
        +   *
            * If a method doesn't have any auth requirements, request credentials will be
            * ignored.
            * 
        * * Protobuf type {@code google.api.AuthenticationRule} */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder implements // @@protoc_insertion_point(builder_implements:google.api.AuthenticationRule) com.google.api.AuthenticationRuleOrBuilder { @@ -472,7 +500,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.api.AuthProto .internal_static_google_api_AuthenticationRule_fieldAccessorTable @@ -482,32 +510,40 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } // Construct using com.google.api.AuthenticationRule.newBuilder() - private Builder() {} + private Builder() { + maybeForceBuilderInitialization(); + } - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetOauthFieldBuilder(); + internalGetRequirementsFieldBuilder(); + } } @java.lang.Override public Builder clear() { super.clear(); + bitField0_ = 0; selector_ = ""; - - if (oauthBuilder_ == null) { - oauth_ = null; - } else { - oauth_ = null; + oauth_ = null; + if (oauthBuilder_ != null) { + oauthBuilder_.dispose(); oauthBuilder_ = null; } allowWithoutCredential_ = false; - if (requirementsBuilder_ == null) { requirements_ = java.util.Collections.emptyList(); } else { requirements_ = null; requirementsBuilder_.clear(); } - bitField0_ = (bitField0_ & ~0x00000001); + bitField0_ = (bitField0_ & ~0x00000008); return this; } @@ -533,58 +569,40 @@ public com.google.api.AuthenticationRule build() { @java.lang.Override public com.google.api.AuthenticationRule buildPartial() { com.google.api.AuthenticationRule result = new com.google.api.AuthenticationRule(this); - int from_bitField0_ = bitField0_; - result.selector_ = selector_; - if (oauthBuilder_ == null) { - result.oauth_ = oauth_; - } else { - result.oauth_ = oauthBuilder_.build(); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); } - result.allowWithoutCredential_ = allowWithoutCredential_; + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields(com.google.api.AuthenticationRule result) { if (requirementsBuilder_ == null) { - if (((bitField0_ & 0x00000001) != 0)) { + if (((bitField0_ & 0x00000008) != 0)) { requirements_ = java.util.Collections.unmodifiableList(requirements_); - bitField0_ = (bitField0_ & ~0x00000001); + bitField0_ = (bitField0_ & ~0x00000008); } result.requirements_ = requirements_; } else { result.requirements_ = requirementsBuilder_.build(); } - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); } - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.setField(field, value); - } - - @java.lang.Override - public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - - @java.lang.Override - public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.addRepeatedField(field, value); + private void buildPartial0(com.google.api.AuthenticationRule result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.selector_ = selector_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.oauth_ = oauthBuilder_ == null ? oauth_ : oauthBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.allowWithoutCredential_ = allowWithoutCredential_; + } + result.bitField0_ |= to_bitField0_; } @java.lang.Override @@ -601,6 +619,7 @@ public Builder mergeFrom(com.google.api.AuthenticationRule other) { if (other == com.google.api.AuthenticationRule.getDefaultInstance()) return this; if (!other.getSelector().isEmpty()) { selector_ = other.selector_; + bitField0_ |= 0x00000001; onChanged(); } if (other.hasOauth()) { @@ -613,7 +632,7 @@ public Builder mergeFrom(com.google.api.AuthenticationRule other) { if (!other.requirements_.isEmpty()) { if (requirements_.isEmpty()) { requirements_ = other.requirements_; - bitField0_ = (bitField0_ & ~0x00000001); + bitField0_ = (bitField0_ & ~0x00000008); } else { ensureRequirementsIsMutable(); requirements_.addAll(other.requirements_); @@ -626,10 +645,10 @@ public Builder mergeFrom(com.google.api.AuthenticationRule other) { requirementsBuilder_.dispose(); requirementsBuilder_ = null; requirements_ = other.requirements_; - bitField0_ = (bitField0_ & ~0x00000001); + bitField0_ = (bitField0_ & ~0x00000008); requirementsBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders - ? getRequirementsFieldBuilder() + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders + ? internalGetRequirementsFieldBuilder() : null; } else { requirementsBuilder_.addAllMessages(other.requirements_); @@ -665,19 +684,19 @@ public Builder mergeFrom( case 10: { selector_ = input.readStringRequireUtf8(); - + bitField0_ |= 0x00000001; break; } // case 10 case 18: { - input.readMessage(getOauthFieldBuilder().getBuilder(), extensionRegistry); - + input.readMessage(internalGetOauthFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; break; } // case 18 case 40: { allowWithoutCredential_ = input.readBool(); - + bitField0_ |= 0x00000004; break; } // case 40 case 58: @@ -712,12 +731,15 @@ public Builder mergeFrom( private int bitField0_; private java.lang.Object selector_ = ""; + /** * * *
              * Selects the methods to which this rule applies.
        -     * Refer to [selector][google.api.DocumentationRule.selector] for syntax details.
        +     *
        +     * Refer to [selector][google.api.DocumentationRule.selector] for syntax
        +     * details.
              * 
        * * string selector = 1; @@ -735,12 +757,15 @@ public java.lang.String getSelector() { return (java.lang.String) ref; } } + /** * * *
              * Selects the methods to which this rule applies.
        -     * Refer to [selector][google.api.DocumentationRule.selector] for syntax details.
        +     *
        +     * Refer to [selector][google.api.DocumentationRule.selector] for syntax
        +     * details.
              * 
        * * string selector = 1; @@ -758,12 +783,15 @@ public com.google.protobuf.ByteString getSelectorBytes() { return (com.google.protobuf.ByteString) ref; } } + /** * * *
              * Selects the methods to which this rule applies.
        -     * Refer to [selector][google.api.DocumentationRule.selector] for syntax details.
        +     *
        +     * Refer to [selector][google.api.DocumentationRule.selector] for syntax
        +     * details.
              * 
        * * string selector = 1; @@ -775,17 +803,20 @@ public Builder setSelector(java.lang.String value) { if (value == null) { throw new NullPointerException(); } - selector_ = value; + bitField0_ |= 0x00000001; onChanged(); return this; } + /** * * *
              * Selects the methods to which this rule applies.
        -     * Refer to [selector][google.api.DocumentationRule.selector] for syntax details.
        +     *
        +     * Refer to [selector][google.api.DocumentationRule.selector] for syntax
        +     * details.
              * 
        * * string selector = 1; @@ -793,17 +824,20 @@ public Builder setSelector(java.lang.String value) { * @return This builder for chaining. */ public Builder clearSelector() { - selector_ = getDefaultInstance().getSelector(); + bitField0_ = (bitField0_ & ~0x00000001); onChanged(); return this; } + /** * * *
              * Selects the methods to which this rule applies.
        -     * Refer to [selector][google.api.DocumentationRule.selector] for syntax details.
        +     *
        +     * Refer to [selector][google.api.DocumentationRule.selector] for syntax
        +     * details.
              * 
        * * string selector = 1; @@ -816,18 +850,19 @@ public Builder setSelectorBytes(com.google.protobuf.ByteString value) { throw new NullPointerException(); } checkByteStringIsUtf8(value); - selector_ = value; + bitField0_ |= 0x00000001; onChanged(); return this; } private com.google.api.OAuthRequirements oauth_; - private com.google.protobuf.SingleFieldBuilderV3< + private com.google.protobuf.SingleFieldBuilder< com.google.api.OAuthRequirements, com.google.api.OAuthRequirements.Builder, com.google.api.OAuthRequirementsOrBuilder> oauthBuilder_; + /** * * @@ -840,8 +875,9 @@ public Builder setSelectorBytes(com.google.protobuf.ByteString value) { * @return Whether the oauth field is set. */ public boolean hasOauth() { - return oauthBuilder_ != null || oauth_ != null; + return ((bitField0_ & 0x00000002) != 0); } + /** * * @@ -860,6 +896,7 @@ public com.google.api.OAuthRequirements getOauth() { return oauthBuilder_.getMessage(); } } + /** * * @@ -875,13 +912,14 @@ public Builder setOauth(com.google.api.OAuthRequirements value) { throw new NullPointerException(); } oauth_ = value; - onChanged(); } else { oauthBuilder_.setMessage(value); } - + bitField0_ |= 0x00000002; + onChanged(); return this; } + /** * * @@ -894,13 +932,14 @@ public Builder setOauth(com.google.api.OAuthRequirements value) { public Builder setOauth(com.google.api.OAuthRequirements.Builder builderForValue) { if (oauthBuilder_ == null) { oauth_ = builderForValue.build(); - onChanged(); } else { oauthBuilder_.setMessage(builderForValue.build()); } - + bitField0_ |= 0x00000002; + onChanged(); return this; } + /** * * @@ -912,19 +951,23 @@ public Builder setOauth(com.google.api.OAuthRequirements.Builder builderForValue */ public Builder mergeOauth(com.google.api.OAuthRequirements value) { if (oauthBuilder_ == null) { - if (oauth_ != null) { - oauth_ = - com.google.api.OAuthRequirements.newBuilder(oauth_).mergeFrom(value).buildPartial(); + if (((bitField0_ & 0x00000002) != 0) + && oauth_ != null + && oauth_ != com.google.api.OAuthRequirements.getDefaultInstance()) { + getOauthBuilder().mergeFrom(value); } else { oauth_ = value; } - onChanged(); } else { oauthBuilder_.mergeFrom(value); } - + if (oauth_ != null) { + bitField0_ |= 0x00000002; + onChanged(); + } return this; } + /** * * @@ -935,16 +978,16 @@ public Builder mergeOauth(com.google.api.OAuthRequirements value) { * .google.api.OAuthRequirements oauth = 2; */ public Builder clearOauth() { - if (oauthBuilder_ == null) { - oauth_ = null; - onChanged(); - } else { - oauth_ = null; + bitField0_ = (bitField0_ & ~0x00000002); + oauth_ = null; + if (oauthBuilder_ != null) { + oauthBuilder_.dispose(); oauthBuilder_ = null; } - + onChanged(); return this; } + /** * * @@ -955,10 +998,11 @@ public Builder clearOauth() { * .google.api.OAuthRequirements oauth = 2; */ public com.google.api.OAuthRequirements.Builder getOauthBuilder() { - + bitField0_ |= 0x00000002; onChanged(); - return getOauthFieldBuilder().getBuilder(); + return internalGetOauthFieldBuilder().getBuilder(); } + /** * * @@ -975,6 +1019,7 @@ public com.google.api.OAuthRequirementsOrBuilder getOauthOrBuilder() { return oauth_ == null ? com.google.api.OAuthRequirements.getDefaultInstance() : oauth_; } } + /** * * @@ -984,14 +1029,14 @@ public com.google.api.OAuthRequirementsOrBuilder getOauthOrBuilder() { * * .google.api.OAuthRequirements oauth = 2; */ - private com.google.protobuf.SingleFieldBuilderV3< + private com.google.protobuf.SingleFieldBuilder< com.google.api.OAuthRequirements, com.google.api.OAuthRequirements.Builder, com.google.api.OAuthRequirementsOrBuilder> - getOauthFieldBuilder() { + internalGetOauthFieldBuilder() { if (oauthBuilder_ == null) { oauthBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< + new com.google.protobuf.SingleFieldBuilder< com.google.api.OAuthRequirements, com.google.api.OAuthRequirements.Builder, com.google.api.OAuthRequirementsOrBuilder>( @@ -1002,6 +1047,7 @@ public com.google.api.OAuthRequirementsOrBuilder getOauthOrBuilder() { } private boolean allowWithoutCredential_; + /** * * @@ -1018,6 +1064,7 @@ public com.google.api.OAuthRequirementsOrBuilder getOauthOrBuilder() { public boolean getAllowWithoutCredential() { return allowWithoutCredential_; } + /** * * @@ -1034,9 +1081,11 @@ public boolean getAllowWithoutCredential() { public Builder setAllowWithoutCredential(boolean value) { allowWithoutCredential_ = value; + bitField0_ |= 0x00000004; onChanged(); return this; } + /** * * @@ -1050,7 +1099,7 @@ public Builder setAllowWithoutCredential(boolean value) { * @return This builder for chaining. */ public Builder clearAllowWithoutCredential() { - + bitField0_ = (bitField0_ & ~0x00000004); allowWithoutCredential_ = false; onChanged(); return this; @@ -1060,13 +1109,13 @@ public Builder clearAllowWithoutCredential() { java.util.Collections.emptyList(); private void ensureRequirementsIsMutable() { - if (!((bitField0_ & 0x00000001) != 0)) { + if (!((bitField0_ & 0x00000008) != 0)) { requirements_ = new java.util.ArrayList(requirements_); - bitField0_ |= 0x00000001; + bitField0_ |= 0x00000008; } } - private com.google.protobuf.RepeatedFieldBuilderV3< + private com.google.protobuf.RepeatedFieldBuilder< com.google.api.AuthRequirement, com.google.api.AuthRequirement.Builder, com.google.api.AuthRequirementOrBuilder> @@ -1088,6 +1137,7 @@ public java.util.List getRequirementsList() { return requirementsBuilder_.getMessageList(); } } + /** * * @@ -1104,6 +1154,7 @@ public int getRequirementsCount() { return requirementsBuilder_.getCount(); } } + /** * * @@ -1120,6 +1171,7 @@ public com.google.api.AuthRequirement getRequirements(int index) { return requirementsBuilder_.getMessage(index); } } + /** * * @@ -1142,6 +1194,7 @@ public Builder setRequirements(int index, com.google.api.AuthRequirement value) } return this; } + /** * * @@ -1162,6 +1215,7 @@ public Builder setRequirements( } return this; } + /** * * @@ -1184,6 +1238,7 @@ public Builder addRequirements(com.google.api.AuthRequirement value) { } return this; } + /** * * @@ -1206,6 +1261,7 @@ public Builder addRequirements(int index, com.google.api.AuthRequirement value) } return this; } + /** * * @@ -1225,6 +1281,7 @@ public Builder addRequirements(com.google.api.AuthRequirement.Builder builderFor } return this; } + /** * * @@ -1245,6 +1302,7 @@ public Builder addRequirements( } return this; } + /** * * @@ -1265,6 +1323,7 @@ public Builder addAllRequirements( } return this; } + /** * * @@ -1277,13 +1336,14 @@ public Builder addAllRequirements( public Builder clearRequirements() { if (requirementsBuilder_ == null) { requirements_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); + bitField0_ = (bitField0_ & ~0x00000008); onChanged(); } else { requirementsBuilder_.clear(); } return this; } + /** * * @@ -1303,6 +1363,7 @@ public Builder removeRequirements(int index) { } return this; } + /** * * @@ -1313,8 +1374,9 @@ public Builder removeRequirements(int index) { * repeated .google.api.AuthRequirement requirements = 7; */ public com.google.api.AuthRequirement.Builder getRequirementsBuilder(int index) { - return getRequirementsFieldBuilder().getBuilder(index); + return internalGetRequirementsFieldBuilder().getBuilder(index); } + /** * * @@ -1331,6 +1393,7 @@ public com.google.api.AuthRequirementOrBuilder getRequirementsOrBuilder(int inde return requirementsBuilder_.getMessageOrBuilder(index); } } + /** * * @@ -1348,6 +1411,7 @@ public com.google.api.AuthRequirementOrBuilder getRequirementsOrBuilder(int inde return java.util.Collections.unmodifiableList(requirements_); } } + /** * * @@ -1358,9 +1422,10 @@ public com.google.api.AuthRequirementOrBuilder getRequirementsOrBuilder(int inde * repeated .google.api.AuthRequirement requirements = 7; */ public com.google.api.AuthRequirement.Builder addRequirementsBuilder() { - return getRequirementsFieldBuilder() + return internalGetRequirementsFieldBuilder() .addBuilder(com.google.api.AuthRequirement.getDefaultInstance()); } + /** * * @@ -1371,9 +1436,10 @@ public com.google.api.AuthRequirement.Builder addRequirementsBuilder() { * repeated .google.api.AuthRequirement requirements = 7; */ public com.google.api.AuthRequirement.Builder addRequirementsBuilder(int index) { - return getRequirementsFieldBuilder() + return internalGetRequirementsFieldBuilder() .addBuilder(index, com.google.api.AuthRequirement.getDefaultInstance()); } + /** * * @@ -1384,37 +1450,26 @@ public com.google.api.AuthRequirement.Builder addRequirementsBuilder(int index) * repeated .google.api.AuthRequirement requirements = 7; */ public java.util.List getRequirementsBuilderList() { - return getRequirementsFieldBuilder().getBuilderList(); + return internalGetRequirementsFieldBuilder().getBuilderList(); } - private com.google.protobuf.RepeatedFieldBuilderV3< + private com.google.protobuf.RepeatedFieldBuilder< com.google.api.AuthRequirement, com.google.api.AuthRequirement.Builder, com.google.api.AuthRequirementOrBuilder> - getRequirementsFieldBuilder() { + internalGetRequirementsFieldBuilder() { if (requirementsBuilder_ == null) { requirementsBuilder_ = - new com.google.protobuf.RepeatedFieldBuilderV3< + new com.google.protobuf.RepeatedFieldBuilder< com.google.api.AuthRequirement, com.google.api.AuthRequirement.Builder, com.google.api.AuthRequirementOrBuilder>( - requirements_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + requirements_, ((bitField0_ & 0x00000008) != 0), getParentForChildren(), isClean()); requirements_ = null; } return requirementsBuilder_; } - @java.lang.Override - public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - // @@protoc_insertion_point(builder_scope:google.api.AuthenticationRule) } diff --git a/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/AuthenticationRuleOrBuilder.java b/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/AuthenticationRuleOrBuilder.java index 6b307c22f3..353fc9dfe5 100644 --- a/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/AuthenticationRuleOrBuilder.java +++ b/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/AuthenticationRuleOrBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,10 +14,13 @@ * limitations under the License. */ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: google/api/auth.proto +// Protobuf Java Version: 4.33.2 package com.google.api; +@com.google.protobuf.Generated public interface AuthenticationRuleOrBuilder extends // @@protoc_insertion_point(interface_extends:google.api.AuthenticationRule) @@ -28,7 +31,9 @@ public interface AuthenticationRuleOrBuilder * *
            * Selects the methods to which this rule applies.
        -   * Refer to [selector][google.api.DocumentationRule.selector] for syntax details.
        +   *
        +   * Refer to [selector][google.api.DocumentationRule.selector] for syntax
        +   * details.
            * 
        * * string selector = 1; @@ -36,12 +41,15 @@ public interface AuthenticationRuleOrBuilder * @return The selector. */ java.lang.String getSelector(); + /** * * *
            * Selects the methods to which this rule applies.
        -   * Refer to [selector][google.api.DocumentationRule.selector] for syntax details.
        +   *
        +   * Refer to [selector][google.api.DocumentationRule.selector] for syntax
        +   * details.
            * 
        * * string selector = 1; @@ -62,6 +70,7 @@ public interface AuthenticationRuleOrBuilder * @return Whether the oauth field is set. */ boolean hasOauth(); + /** * * @@ -74,6 +83,7 @@ public interface AuthenticationRuleOrBuilder * @return The oauth. */ com.google.api.OAuthRequirements getOauth(); + /** * * @@ -109,6 +119,7 @@ public interface AuthenticationRuleOrBuilder * repeated .google.api.AuthRequirement requirements = 7; */ java.util.List getRequirementsList(); + /** * * @@ -119,6 +130,7 @@ public interface AuthenticationRuleOrBuilder * repeated .google.api.AuthRequirement requirements = 7; */ com.google.api.AuthRequirement getRequirements(int index); + /** * * @@ -129,6 +141,7 @@ public interface AuthenticationRuleOrBuilder * repeated .google.api.AuthRequirement requirements = 7; */ int getRequirementsCount(); + /** * * @@ -139,6 +152,7 @@ public interface AuthenticationRuleOrBuilder * repeated .google.api.AuthRequirement requirements = 7; */ java.util.List getRequirementsOrBuilderList(); + /** * * diff --git a/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/Backend.java b/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/Backend.java index aa0018eae9..d128e6f371 100644 --- a/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/Backend.java +++ b/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/Backend.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,9 @@ * limitations under the License. */ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: google/api/backend.proto +// Protobuf Java Version: 4.33.2 package com.google.api; @@ -27,13 +29,25 @@ * * Protobuf type {@code google.api.Backend} */ -public final class Backend extends com.google.protobuf.GeneratedMessageV3 +@com.google.protobuf.Generated +public final class Backend extends com.google.protobuf.GeneratedMessage implements // @@protoc_insertion_point(message_implements:google.api.Backend) BackendOrBuilder { private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "Backend"); + } + // Use Backend.newBuilder() to construct. - private Backend(com.google.protobuf.GeneratedMessageV3.Builder builder) { + private Backend(com.google.protobuf.GeneratedMessage.Builder builder) { super(builder); } @@ -41,23 +55,12 @@ private Backend() { rules_ = java.util.Collections.emptyList(); } - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new Backend(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.api.BackendProto.internal_static_google_api_Backend_descriptor; } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.api.BackendProto.internal_static_google_api_Backend_fieldAccessorTable .ensureFieldAccessorsInitialized( @@ -65,12 +68,16 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } public static final int RULES_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") private java.util.List rules_; + /** * * *
            * A list of API backend rules that apply to individual API methods.
        +   *
            * **NOTE:** All service configuration rules follow "last one wins" order.
            * 
        * @@ -80,11 +87,13 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { public java.util.List getRulesList() { return rules_; } + /** * * *
            * A list of API backend rules that apply to individual API methods.
        +   *
            * **NOTE:** All service configuration rules follow "last one wins" order.
            * 
        * @@ -94,11 +103,13 @@ public java.util.List getRulesList() { public java.util.List getRulesOrBuilderList() { return rules_; } + /** * * *
            * A list of API backend rules that apply to individual API methods.
        +   *
            * **NOTE:** All service configuration rules follow "last one wins" order.
            * 
        * @@ -108,11 +119,13 @@ public java.util.List getRulesOrB public int getRulesCount() { return rules_.size(); } + /** * * *
            * A list of API backend rules that apply to individual API methods.
        +   *
            * **NOTE:** All service configuration rules follow "last one wins" order.
            * 
        * @@ -122,11 +135,13 @@ public int getRulesCount() { public com.google.api.BackendRule getRules(int index) { return rules_.get(index); } + /** * * *
            * A list of API backend rules that apply to individual API methods.
        +   *
            * **NOTE:** All service configuration rules follow "last one wins" order.
            * 
        * @@ -238,38 +253,38 @@ public static com.google.api.Backend parseFrom( public static com.google.api.Backend parseFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); } public static com.google.api.Backend parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } public static com.google.api.Backend parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); } public static com.google.api.Backend parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( PARSER, input, extensionRegistry); } public static com.google.api.Backend parseFrom(com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); } public static com.google.api.Backend parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } @@ -292,10 +307,11 @@ public Builder toBuilder() { } @java.lang.Override - protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { Builder builder = new Builder(parent); return builder; } + /** * * @@ -305,7 +321,7 @@ protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.Build * * Protobuf type {@code google.api.Backend} */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder implements // @@protoc_insertion_point(builder_implements:google.api.Backend) com.google.api.BackendOrBuilder { @@ -314,7 +330,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.api.BackendProto.internal_static_google_api_Backend_fieldAccessorTable .ensureFieldAccessorsInitialized( @@ -324,13 +340,14 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { // Construct using com.google.api.Backend.newBuilder() private Builder() {} - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { super(parent); } @java.lang.Override public Builder clear() { super.clear(); + bitField0_ = 0; if (rulesBuilder_ == null) { rules_ = java.util.Collections.emptyList(); } else { @@ -363,7 +380,15 @@ public com.google.api.Backend build() { @java.lang.Override public com.google.api.Backend buildPartial() { com.google.api.Backend result = new com.google.api.Backend(this); - int from_bitField0_ = bitField0_; + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields(com.google.api.Backend result) { if (rulesBuilder_ == null) { if (((bitField0_ & 0x00000001) != 0)) { rules_ = java.util.Collections.unmodifiableList(rules_); @@ -373,41 +398,10 @@ public com.google.api.Backend buildPartial() { } else { result.rules_ = rulesBuilder_.build(); } - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.setField(field, value); - } - - @java.lang.Override - public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - - @java.lang.Override - public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); } - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.addRepeatedField(field, value); + private void buildPartial0(com.google.api.Backend result) { + int from_bitField0_ = bitField0_; } @java.lang.Override @@ -441,8 +435,8 @@ public Builder mergeFrom(com.google.api.Backend other) { rules_ = other.rules_; bitField0_ = (bitField0_ & ~0x00000001); rulesBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders - ? getRulesFieldBuilder() + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders + ? internalGetRulesFieldBuilder() : null; } else { rulesBuilder_.addAllMessages(other.rules_); @@ -515,7 +509,7 @@ private void ensureRulesIsMutable() { } } - private com.google.protobuf.RepeatedFieldBuilderV3< + private com.google.protobuf.RepeatedFieldBuilder< com.google.api.BackendRule, com.google.api.BackendRule.Builder, com.google.api.BackendRuleOrBuilder> @@ -526,6 +520,7 @@ private void ensureRulesIsMutable() { * *
              * A list of API backend rules that apply to individual API methods.
        +     *
              * **NOTE:** All service configuration rules follow "last one wins" order.
              * 
        * @@ -538,11 +533,13 @@ public java.util.List getRulesList() { return rulesBuilder_.getMessageList(); } } + /** * * *
              * A list of API backend rules that apply to individual API methods.
        +     *
              * **NOTE:** All service configuration rules follow "last one wins" order.
              * 
        * @@ -555,11 +552,13 @@ public int getRulesCount() { return rulesBuilder_.getCount(); } } + /** * * *
              * A list of API backend rules that apply to individual API methods.
        +     *
              * **NOTE:** All service configuration rules follow "last one wins" order.
              * 
        * @@ -572,11 +571,13 @@ public com.google.api.BackendRule getRules(int index) { return rulesBuilder_.getMessage(index); } } + /** * * *
              * A list of API backend rules that apply to individual API methods.
        +     *
              * **NOTE:** All service configuration rules follow "last one wins" order.
              * 
        * @@ -595,11 +596,13 @@ public Builder setRules(int index, com.google.api.BackendRule value) { } return this; } + /** * * *
              * A list of API backend rules that apply to individual API methods.
        +     *
              * **NOTE:** All service configuration rules follow "last one wins" order.
              * 
        * @@ -615,11 +618,13 @@ public Builder setRules(int index, com.google.api.BackendRule.Builder builderFor } return this; } + /** * * *
              * A list of API backend rules that apply to individual API methods.
        +     *
              * **NOTE:** All service configuration rules follow "last one wins" order.
              * 
        * @@ -638,11 +643,13 @@ public Builder addRules(com.google.api.BackendRule value) { } return this; } + /** * * *
              * A list of API backend rules that apply to individual API methods.
        +     *
              * **NOTE:** All service configuration rules follow "last one wins" order.
              * 
        * @@ -661,11 +668,13 @@ public Builder addRules(int index, com.google.api.BackendRule value) { } return this; } + /** * * *
              * A list of API backend rules that apply to individual API methods.
        +     *
              * **NOTE:** All service configuration rules follow "last one wins" order.
              * 
        * @@ -681,11 +690,13 @@ public Builder addRules(com.google.api.BackendRule.Builder builderForValue) { } return this; } + /** * * *
              * A list of API backend rules that apply to individual API methods.
        +     *
              * **NOTE:** All service configuration rules follow "last one wins" order.
              * 
        * @@ -701,11 +712,13 @@ public Builder addRules(int index, com.google.api.BackendRule.Builder builderFor } return this; } + /** * * *
              * A list of API backend rules that apply to individual API methods.
        +     *
              * **NOTE:** All service configuration rules follow "last one wins" order.
              * 
        * @@ -721,11 +734,13 @@ public Builder addAllRules(java.lang.Iterable * A list of API backend rules that apply to individual API methods. + * * **NOTE:** All service configuration rules follow "last one wins" order. * * @@ -741,11 +756,13 @@ public Builder clearRules() { } return this; } + /** * * *
              * A list of API backend rules that apply to individual API methods.
        +     *
              * **NOTE:** All service configuration rules follow "last one wins" order.
              * 
        * @@ -761,24 +778,28 @@ public Builder removeRules(int index) { } return this; } + /** * * *
              * A list of API backend rules that apply to individual API methods.
        +     *
              * **NOTE:** All service configuration rules follow "last one wins" order.
              * 
        * * repeated .google.api.BackendRule rules = 1; */ public com.google.api.BackendRule.Builder getRulesBuilder(int index) { - return getRulesFieldBuilder().getBuilder(index); + return internalGetRulesFieldBuilder().getBuilder(index); } + /** * * *
              * A list of API backend rules that apply to individual API methods.
        +     *
              * **NOTE:** All service configuration rules follow "last one wins" order.
              * 
        * @@ -791,11 +812,13 @@ public com.google.api.BackendRuleOrBuilder getRulesOrBuilder(int index) { return rulesBuilder_.getMessageOrBuilder(index); } } + /** * * *
              * A list of API backend rules that apply to individual API methods.
        +     *
              * **NOTE:** All service configuration rules follow "last one wins" order.
              * 
        * @@ -808,55 +831,62 @@ public java.util.List getRulesOrB return java.util.Collections.unmodifiableList(rules_); } } + /** * * *
              * A list of API backend rules that apply to individual API methods.
        +     *
              * **NOTE:** All service configuration rules follow "last one wins" order.
              * 
        * * repeated .google.api.BackendRule rules = 1; */ public com.google.api.BackendRule.Builder addRulesBuilder() { - return getRulesFieldBuilder().addBuilder(com.google.api.BackendRule.getDefaultInstance()); + return internalGetRulesFieldBuilder() + .addBuilder(com.google.api.BackendRule.getDefaultInstance()); } + /** * * *
              * A list of API backend rules that apply to individual API methods.
        +     *
              * **NOTE:** All service configuration rules follow "last one wins" order.
              * 
        * * repeated .google.api.BackendRule rules = 1; */ public com.google.api.BackendRule.Builder addRulesBuilder(int index) { - return getRulesFieldBuilder() + return internalGetRulesFieldBuilder() .addBuilder(index, com.google.api.BackendRule.getDefaultInstance()); } + /** * * *
              * A list of API backend rules that apply to individual API methods.
        +     *
              * **NOTE:** All service configuration rules follow "last one wins" order.
              * 
        * * repeated .google.api.BackendRule rules = 1; */ public java.util.List getRulesBuilderList() { - return getRulesFieldBuilder().getBuilderList(); + return internalGetRulesFieldBuilder().getBuilderList(); } - private com.google.protobuf.RepeatedFieldBuilderV3< + private com.google.protobuf.RepeatedFieldBuilder< com.google.api.BackendRule, com.google.api.BackendRule.Builder, com.google.api.BackendRuleOrBuilder> - getRulesFieldBuilder() { + internalGetRulesFieldBuilder() { if (rulesBuilder_ == null) { rulesBuilder_ = - new com.google.protobuf.RepeatedFieldBuilderV3< + new com.google.protobuf.RepeatedFieldBuilder< com.google.api.BackendRule, com.google.api.BackendRule.Builder, com.google.api.BackendRuleOrBuilder>( @@ -866,17 +896,6 @@ public java.util.List getRulesBuilderList() return rulesBuilder_; } - @java.lang.Override - public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - // @@protoc_insertion_point(builder_scope:google.api.Backend) } diff --git a/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/BackendOrBuilder.java b/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/BackendOrBuilder.java index 807191b594..4239798360 100644 --- a/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/BackendOrBuilder.java +++ b/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/BackendOrBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,10 +14,13 @@ * limitations under the License. */ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: google/api/backend.proto +// Protobuf Java Version: 4.33.2 package com.google.api; +@com.google.protobuf.Generated public interface BackendOrBuilder extends // @@protoc_insertion_point(interface_extends:google.api.Backend) @@ -28,50 +31,59 @@ public interface BackendOrBuilder * *
            * A list of API backend rules that apply to individual API methods.
        +   *
            * **NOTE:** All service configuration rules follow "last one wins" order.
            * 
        * * repeated .google.api.BackendRule rules = 1; */ java.util.List getRulesList(); + /** * * *
            * A list of API backend rules that apply to individual API methods.
        +   *
            * **NOTE:** All service configuration rules follow "last one wins" order.
            * 
        * * repeated .google.api.BackendRule rules = 1; */ com.google.api.BackendRule getRules(int index); + /** * * *
            * A list of API backend rules that apply to individual API methods.
        +   *
            * **NOTE:** All service configuration rules follow "last one wins" order.
            * 
        * * repeated .google.api.BackendRule rules = 1; */ int getRulesCount(); + /** * * *
            * A list of API backend rules that apply to individual API methods.
        +   *
            * **NOTE:** All service configuration rules follow "last one wins" order.
            * 
        * * repeated .google.api.BackendRule rules = 1; */ java.util.List getRulesOrBuilderList(); + /** * * *
            * A list of API backend rules that apply to individual API methods.
        +   *
            * **NOTE:** All service configuration rules follow "last one wins" order.
            * 
        * diff --git a/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/BackendProto.java b/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/BackendProto.java index 2c755afd17..d6c715f9db 100644 --- a/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/BackendProto.java +++ b/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/BackendProto.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,13 +14,26 @@ * limitations under the License. */ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: google/api/backend.proto +// Protobuf Java Version: 4.33.2 package com.google.api; -public final class BackendProto { +@com.google.protobuf.Generated +public final class BackendProto extends com.google.protobuf.GeneratedFile { private BackendProto() {} + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "BackendProto"); + } + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistryLite registry) {} public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry registry) { @@ -29,12 +42,16 @@ public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry r static final com.google.protobuf.Descriptors.Descriptor internal_static_google_api_Backend_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable internal_static_google_api_Backend_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_google_api_BackendRule_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable internal_static_google_api_BackendRule_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_api_BackendRule_OverridesByRequestProtocolEntry_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_api_BackendRule_OverridesByRequestProtocolEntry_fieldAccessorTable; public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { return descriptor; @@ -44,35 +61,48 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { static { java.lang.String[] descriptorData = { - "\n\030google/api/backend.proto\022\ngoogle.api\"1" - + "\n\007Backend\022&\n\005rules\030\001 \003(\0132\027.google.api.Ba" - + "ckendRule\"\366\002\n\013BackendRule\022\020\n\010selector\030\001 " - + "\001(\t\022\017\n\007address\030\002 \001(\t\022\020\n\010deadline\030\003 \001(\001\022\030" - + "\n\014min_deadline\030\004 \001(\001B\002\030\001\022\032\n\022operation_de" - + "adline\030\005 \001(\001\022A\n\020path_translation\030\006 \001(\0162\'" - + ".google.api.BackendRule.PathTranslation\022" - + "\026\n\014jwt_audience\030\007 \001(\tH\000\022\026\n\014disable_auth\030" - + "\010 \001(\010H\000\022\020\n\010protocol\030\t \001(\t\"e\n\017PathTransla" - + "tion\022 \n\034PATH_TRANSLATION_UNSPECIFIED\020\000\022\024" - + "\n\020CONSTANT_ADDRESS\020\001\022\032\n\026APPEND_PATH_TO_A" - + "DDRESS\020\002B\020\n\016authenticationBn\n\016com.google" - + ".apiB\014BackendProtoP\001ZEgoogle.golang.org/" - + "genproto/googleapis/api/serviceconfig;se" - + "rviceconfig\242\002\004GAPIb\006proto3" + "\n" + + "\030google/api/backend.proto\022\n" + + "google.api\"1\n" + + "\007Backend\022&\n" + + "\005rules\030\001 \003(\0132\027.google.api.BackendRule\"\262\004\n" + + "\013BackendRule\022\020\n" + + "\010selector\030\001 \001(\t\022\017\n" + + "\007address\030\002 \001(\t\022\020\n" + + "\010deadline\030\003 \001(\001\022\030\n" + + "\014min_deadline\030\004 \001(\001B\002\030\001\022\032\n" + + "\022operation_deadline\030\005 \001(\001\022A\n" + + "\020path_translation\030\006 \001(\0162\'" + + ".google.api.BackendRule.PathTranslation\022\026\n" + + "\014jwt_audience\030\007 \001(\tH\000\022\026\n" + + "\014disable_auth\030\010 \001(\010H\000\022\020\n" + + "\010protocol\030\t \001(\t\022^\n" + + "\035overrides_by_request_protocol\030\n" + + " \003(\01327.google.api.BackendRule.OverridesByRequestProtocolEntry\032Z\n" + + "\037OverridesByRequestProtocolEntry\022\013\n" + + "\003key\030\001 \001(\t\022&\n" + + "\005value\030\002 \001(\0132\027.google.api.BackendRule:\0028\001\"e\n" + + "\017PathTranslation\022 \n" + + "\034PATH_TRANSLATION_UNSPECIFIED\020\000\022\024\n" + + "\020CONSTANT_ADDRESS\020\001\022\032\n" + + "\026APPEND_PATH_TO_ADDRESS\020\002B\020\n" + + "\016authenticationBn\n" + + "\016com.google.apiB\014BackendProtoP\001ZEgoogle.golang.org/genproto/goo" + + "gleapis/api/serviceconfig;serviceconfig\242\002\004GAPIb\006proto3" }; descriptor = com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( descriptorData, new com.google.protobuf.Descriptors.FileDescriptor[] {}); - internal_static_google_api_Backend_descriptor = getDescriptor().getMessageTypes().get(0); + internal_static_google_api_Backend_descriptor = getDescriptor().getMessageType(0); internal_static_google_api_Backend_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_google_api_Backend_descriptor, new java.lang.String[] { "Rules", }); - internal_static_google_api_BackendRule_descriptor = getDescriptor().getMessageTypes().get(1); + internal_static_google_api_BackendRule_descriptor = getDescriptor().getMessageType(1); internal_static_google_api_BackendRule_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_google_api_BackendRule_descriptor, new java.lang.String[] { "Selector", @@ -84,8 +114,18 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "JwtAudience", "DisableAuth", "Protocol", + "OverridesByRequestProtocol", "Authentication", }); + internal_static_google_api_BackendRule_OverridesByRequestProtocolEntry_descriptor = + internal_static_google_api_BackendRule_descriptor.getNestedType(0); + internal_static_google_api_BackendRule_OverridesByRequestProtocolEntry_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_api_BackendRule_OverridesByRequestProtocolEntry_descriptor, + new java.lang.String[] { + "Key", "Value", + }); + descriptor.resolveAllFeaturesImmutable(); } // @@protoc_insertion_point(outer_class_scope) diff --git a/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/BackendRule.java b/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/BackendRule.java index 61295a0f38..f21406c92a 100644 --- a/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/BackendRule.java +++ b/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/BackendRule.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,9 @@ * limitations under the License. */ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: google/api/backend.proto +// Protobuf Java Version: 4.33.2 package com.google.api; @@ -27,13 +29,25 @@ * * Protobuf type {@code google.api.BackendRule} */ -public final class BackendRule extends com.google.protobuf.GeneratedMessageV3 +@com.google.protobuf.Generated +public final class BackendRule extends com.google.protobuf.GeneratedMessage implements // @@protoc_insertion_point(message_implements:google.api.BackendRule) BackendRuleOrBuilder { private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "BackendRule"); + } + // Use BackendRule.newBuilder() to construct. - private BackendRule(com.google.protobuf.GeneratedMessageV3.Builder builder) { + private BackendRule(com.google.protobuf.GeneratedMessage.Builder builder) { super(builder); } @@ -44,23 +58,24 @@ private BackendRule() { protocol_ = ""; } - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new BackendRule(); + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.api.BackendProto.internal_static_google_api_BackendRule_descriptor; } + @SuppressWarnings({"rawtypes"}) @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.api.BackendProto.internal_static_google_api_BackendRule_descriptor; + protected com.google.protobuf.MapFieldReflectionAccessor internalGetMapFieldReflection( + int number) { + switch (number) { + case 10: + return internalGetOverridesByRequestProtocol(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.api.BackendProto.internal_static_google_api_BackendRule_fieldAccessorTable .ensureFieldAccessorsInitialized( @@ -74,6 +89,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { * Path Translation specifies how to combine the backend address with the * request path in order to produce the appropriate forwarding URL for the * request. + * * Path Translation is applicable only to HTTP-based backends. Backends which * do not accept requests over HTTP/HTTPS should leave `path_translation` * unspecified. @@ -93,18 +109,24 @@ public enum PathTranslation implements com.google.protobuf.ProtocolMessageEnum { * appended to the query string. If a query string parameter and a URL * pattern variable have the same name, this may result in duplicate keys in * the query string. + * * # Examples + * * Given the following operation config: - * Method path: /api/company/{cid}/user/{uid} - * Backend address: https://example.cloudfunctions.net/getUser + * + * Method path: /api/company/{cid}/user/{uid} + * Backend address: https://example.cloudfunctions.net/getUser + * * Requests to the following request paths will call the backend at the * translated path: - * Request path: /api/company/widgetworks/user/johndoe - * Translated: - * https://example.cloudfunctions.net/getUser?cid=widgetworks&uid=johndoe - * Request path: /api/company/widgetworks/user/johndoe?timezone=EST - * Translated: - * https://example.cloudfunctions.net/getUser?timezone=EST&cid=widgetworks&uid=johndoe + * + * Request path: /api/company/widgetworks/user/johndoe + * Translated: + * https://example.cloudfunctions.net/getUser?cid=widgetworks&uid=johndoe + * + * Request path: /api/company/widgetworks/user/johndoe?timezone=EST + * Translated: + * https://example.cloudfunctions.net/getUser?timezone=EST&cid=widgetworks&uid=johndoe * * * CONSTANT_ADDRESS = 1; @@ -115,18 +137,24 @@ public enum PathTranslation implements com.google.protobuf.ProtocolMessageEnum { * *
              * The request path will be appended to the backend address.
        +     *
              * # Examples
        +     *
              * Given the following operation config:
        -     *     Method path:        /api/company/{cid}/user/{uid}
        -     *     Backend address:    https://example.appspot.com
        +     *
        +     * Method path:        /api/company/{cid}/user/{uid}
        +     * Backend address:    https://example.appspot.com
        +     *
              * Requests to the following request paths will call the backend at the
              * translated path:
        -     *     Request path: /api/company/widgetworks/user/johndoe
        -     *     Translated:
        -     *     https://example.appspot.com/api/company/widgetworks/user/johndoe
        -     *     Request path: /api/company/widgetworks/user/johndoe?timezone=EST
        -     *     Translated:
        -     *     https://example.appspot.com/api/company/widgetworks/user/johndoe?timezone=EST
        +     *
        +     * Request path: /api/company/widgetworks/user/johndoe
        +     * Translated:
        +     * https://example.appspot.com/api/company/widgetworks/user/johndoe
        +     *
        +     * Request path: /api/company/widgetworks/user/johndoe?timezone=EST
        +     * Translated:
        +     * https://example.appspot.com/api/company/widgetworks/user/johndoe?timezone=EST
              * 
        * * APPEND_PATH_TO_ADDRESS = 2; @@ -135,8 +163,19 @@ public enum PathTranslation implements com.google.protobuf.ProtocolMessageEnum { UNRECOGNIZED(-1), ; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "PathTranslation"); + } + /** PATH_TRANSLATION_UNSPECIFIED = 0; */ public static final int PATH_TRANSLATION_UNSPECIFIED_VALUE = 0; + /** * * @@ -146,40 +185,53 @@ public enum PathTranslation implements com.google.protobuf.ProtocolMessageEnum { * appended to the query string. If a query string parameter and a URL * pattern variable have the same name, this may result in duplicate keys in * the query string. + * * # Examples + * * Given the following operation config: - * Method path: /api/company/{cid}/user/{uid} - * Backend address: https://example.cloudfunctions.net/getUser + * + * Method path: /api/company/{cid}/user/{uid} + * Backend address: https://example.cloudfunctions.net/getUser + * * Requests to the following request paths will call the backend at the * translated path: - * Request path: /api/company/widgetworks/user/johndoe - * Translated: - * https://example.cloudfunctions.net/getUser?cid=widgetworks&uid=johndoe - * Request path: /api/company/widgetworks/user/johndoe?timezone=EST - * Translated: - * https://example.cloudfunctions.net/getUser?timezone=EST&cid=widgetworks&uid=johndoe + * + * Request path: /api/company/widgetworks/user/johndoe + * Translated: + * https://example.cloudfunctions.net/getUser?cid=widgetworks&uid=johndoe + * + * Request path: /api/company/widgetworks/user/johndoe?timezone=EST + * Translated: + * https://example.cloudfunctions.net/getUser?timezone=EST&cid=widgetworks&uid=johndoe * * * CONSTANT_ADDRESS = 1; */ public static final int CONSTANT_ADDRESS_VALUE = 1; + /** * * *
              * The request path will be appended to the backend address.
        +     *
              * # Examples
        +     *
              * Given the following operation config:
        -     *     Method path:        /api/company/{cid}/user/{uid}
        -     *     Backend address:    https://example.appspot.com
        +     *
        +     * Method path:        /api/company/{cid}/user/{uid}
        +     * Backend address:    https://example.appspot.com
        +     *
              * Requests to the following request paths will call the backend at the
              * translated path:
        -     *     Request path: /api/company/widgetworks/user/johndoe
        -     *     Translated:
        -     *     https://example.appspot.com/api/company/widgetworks/user/johndoe
        -     *     Request path: /api/company/widgetworks/user/johndoe?timezone=EST
        -     *     Translated:
        -     *     https://example.appspot.com/api/company/widgetworks/user/johndoe?timezone=EST
        +     *
        +     * Request path: /api/company/widgetworks/user/johndoe
        +     * Translated:
        +     * https://example.appspot.com/api/company/widgetworks/user/johndoe
        +     *
        +     * Request path: /api/company/widgetworks/user/johndoe?timezone=EST
        +     * Translated:
        +     * https://example.appspot.com/api/company/widgetworks/user/johndoe?timezone=EST
              * 
        * * APPEND_PATH_TO_ADDRESS = 2; @@ -245,7 +297,7 @@ public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType return getDescriptor(); } - public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + public static com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { return com.google.api.BackendRule.getDescriptor().getEnumTypes().get(0); } @@ -272,6 +324,8 @@ private PathTranslation(int value) { } private int authenticationCase_ = 0; + + @SuppressWarnings("serial") private java.lang.Object authentication_; public enum AuthenticationCase @@ -286,6 +340,7 @@ public enum AuthenticationCase private AuthenticationCase(int value) { this.value = value; } + /** * @param value The number of the enum to look for. * @return The enum associated with the given number. @@ -319,13 +374,18 @@ public AuthenticationCase getAuthenticationCase() { } public static final int SELECTOR_FIELD_NUMBER = 1; - private volatile java.lang.Object selector_; + + @SuppressWarnings("serial") + private volatile java.lang.Object selector_ = ""; + /** * * *
            * Selects the methods to which this rule applies.
        -   * Refer to [selector][google.api.DocumentationRule.selector] for syntax details.
        +   *
        +   * Refer to [selector][google.api.DocumentationRule.selector] for syntax
        +   * details.
            * 
        * * string selector = 1; @@ -344,12 +404,15 @@ public java.lang.String getSelector() { return s; } } + /** * * *
            * Selects the methods to which this rule applies.
        -   * Refer to [selector][google.api.DocumentationRule.selector] for syntax details.
        +   *
        +   * Refer to [selector][google.api.DocumentationRule.selector] for syntax
        +   * details.
            * 
        * * string selector = 1; @@ -370,24 +433,32 @@ public com.google.protobuf.ByteString getSelectorBytes() { } public static final int ADDRESS_FIELD_NUMBER = 2; - private volatile java.lang.Object address_; + + @SuppressWarnings("serial") + private volatile java.lang.Object address_ = ""; + /** * * *
            * The address of the API backend.
        +   *
            * The scheme is used to determine the backend protocol and security.
            * The following schemes are accepted:
        -   *    SCHEME        PROTOCOL    SECURITY
        -   *    http://       HTTP        None
        -   *    https://      HTTP        TLS
        -   *    grpc://       gRPC        None
        -   *    grpcs://      gRPC        TLS
        +   *
        +   * SCHEME        PROTOCOL    SECURITY
        +   * http://       HTTP        None
        +   * https://      HTTP        TLS
        +   * grpc://       gRPC        None
        +   * grpcs://      gRPC        TLS
        +   *
            * It is recommended to explicitly include a scheme. Leaving out the scheme
            * may cause constrasting behaviors across platforms.
        +   *
            * If the port is unspecified, the default is:
            * - 80 for schemes without TLS
            * - 443 for schemes with TLS
        +   *
            * For HTTP backends, use [protocol][google.api.BackendRule.protocol]
            * to specify the protocol version.
            * 
        @@ -408,23 +479,29 @@ public java.lang.String getAddress() { return s; } } + /** * * *
            * The address of the API backend.
        +   *
            * The scheme is used to determine the backend protocol and security.
            * The following schemes are accepted:
        -   *    SCHEME        PROTOCOL    SECURITY
        -   *    http://       HTTP        None
        -   *    https://      HTTP        TLS
        -   *    grpc://       gRPC        None
        -   *    grpcs://      gRPC        TLS
        +   *
        +   * SCHEME        PROTOCOL    SECURITY
        +   * http://       HTTP        None
        +   * https://      HTTP        TLS
        +   * grpc://       gRPC        None
        +   * grpcs://      gRPC        TLS
        +   *
            * It is recommended to explicitly include a scheme. Leaving out the scheme
            * may cause constrasting behaviors across platforms.
        +   *
            * If the port is unspecified, the default is:
            * - 80 for schemes without TLS
            * - 443 for schemes with TLS
        +   *
            * For HTTP backends, use [protocol][google.api.BackendRule.protocol]
            * to specify the protocol version.
            * 
        @@ -447,7 +524,8 @@ public com.google.protobuf.ByteString getAddressBytes() { } public static final int DEADLINE_FIELD_NUMBER = 3; - private double deadline_; + private double deadline_ = 0D; + /** * * @@ -466,7 +544,8 @@ public double getDeadline() { } public static final int MIN_DEADLINE_FIELD_NUMBER = 4; - private double minDeadline_; + private double minDeadline_ = 0D; + /** * * @@ -477,7 +556,7 @@ public double getDeadline() { * double min_deadline = 4 [deprecated = true]; * * @deprecated google.api.BackendRule.min_deadline is deprecated. See - * google/api/backend.proto;l=123 + * google/api/backend.proto;l=124 * @return The minDeadline. */ @java.lang.Override @@ -487,7 +566,8 @@ public double getMinDeadline() { } public static final int OPERATION_DEADLINE_FIELD_NUMBER = 5; - private double operationDeadline_; + private double operationDeadline_ = 0D; + /** * * @@ -506,7 +586,8 @@ public double getOperationDeadline() { } public static final int PATH_TRANSLATION_FIELD_NUMBER = 6; - private int pathTranslation_; + private int pathTranslation_ = 0; + /** * .google.api.BackendRule.PathTranslation path_translation = 6; * @@ -516,6 +597,7 @@ public double getOperationDeadline() { public int getPathTranslationValue() { return pathTranslation_; } + /** * .google.api.BackendRule.PathTranslation path_translation = 6; * @@ -523,13 +605,13 @@ public int getPathTranslationValue() { */ @java.lang.Override public com.google.api.BackendRule.PathTranslation getPathTranslation() { - @SuppressWarnings("deprecation") com.google.api.BackendRule.PathTranslation result = - com.google.api.BackendRule.PathTranslation.valueOf(pathTranslation_); + com.google.api.BackendRule.PathTranslation.forNumber(pathTranslation_); return result == null ? com.google.api.BackendRule.PathTranslation.UNRECOGNIZED : result; } public static final int JWT_AUDIENCE_FIELD_NUMBER = 7; + /** * * @@ -546,6 +628,7 @@ public com.google.api.BackendRule.PathTranslation getPathTranslation() { public boolean hasJwtAudience() { return authenticationCase_ == 7; } + /** * * @@ -575,6 +658,7 @@ public java.lang.String getJwtAudience() { return s; } } + /** * * @@ -606,6 +690,7 @@ public com.google.protobuf.ByteString getJwtAudienceBytes() { } public static final int DISABLE_AUTH_FIELD_NUMBER = 8; + /** * * @@ -624,6 +709,7 @@ public com.google.protobuf.ByteString getJwtAudienceBytes() { public boolean hasDisableAuth() { return authenticationCase_ == 8; } + /** * * @@ -647,24 +733,32 @@ public boolean getDisableAuth() { } public static final int PROTOCOL_FIELD_NUMBER = 9; - private volatile java.lang.Object protocol_; + + @SuppressWarnings("serial") + private volatile java.lang.Object protocol_ = ""; + /** * * *
            * The protocol used for sending a request to the backend.
            * The supported values are "http/1.1" and "h2".
        +   *
            * The default value is inferred from the scheme in the
            * [address][google.api.BackendRule.address] field:
        -   *    SCHEME        PROTOCOL
        -   *    http://       http/1.1
        -   *    https://      http/1.1
        -   *    grpc://       h2
        -   *    grpcs://      h2
        +   *
        +   * SCHEME        PROTOCOL
        +   * http://       http/1.1
        +   * https://      http/1.1
        +   * grpc://       h2
        +   * grpcs://      h2
        +   *
            * For secure HTTP backends (https://) that support HTTP/2, set this field
            * to "h2" for improved performance.
        +   *
            * Configuring this field to non-default values is only supported for secure
            * HTTP backends. This field will be ignored for all other backends.
        +   *
            * See
            * https://www.iana.org/assignments/tls-extensiontype-values/tls-extensiontype-values.xhtml#alpn-protocol-ids
            * for more details on the supported values.
        @@ -686,23 +780,29 @@ public java.lang.String getProtocol() {
               return s;
             }
           }
        +
           /**
            *
            *
            * 
            * The protocol used for sending a request to the backend.
            * The supported values are "http/1.1" and "h2".
        +   *
            * The default value is inferred from the scheme in the
            * [address][google.api.BackendRule.address] field:
        -   *    SCHEME        PROTOCOL
        -   *    http://       http/1.1
        -   *    https://      http/1.1
        -   *    grpc://       h2
        -   *    grpcs://      h2
        +   *
        +   * SCHEME        PROTOCOL
        +   * http://       http/1.1
        +   * https://      http/1.1
        +   * grpc://       h2
        +   * grpcs://      h2
        +   *
            * For secure HTTP backends (https://) that support HTTP/2, set this field
            * to "h2" for improved performance.
        +   *
            * Configuring this field to non-default values is only supported for secure
            * HTTP backends. This field will be ignored for all other backends.
        +   *
            * See
            * https://www.iana.org/assignments/tls-extensiontype-values/tls-extensiontype-values.xhtml#alpn-protocol-ids
            * for more details on the supported values.
        @@ -725,6 +825,122 @@ public com.google.protobuf.ByteString getProtocolBytes() {
             }
           }
         
        +  public static final int OVERRIDES_BY_REQUEST_PROTOCOL_FIELD_NUMBER = 10;
        +
        +  private static final class OverridesByRequestProtocolDefaultEntryHolder {
        +    static final com.google.protobuf.MapEntry
        +        defaultEntry =
        +            com.google.protobuf.MapEntry
        +                .newDefaultInstance(
        +                    com.google.api.BackendProto
        +                        .internal_static_google_api_BackendRule_OverridesByRequestProtocolEntry_descriptor,
        +                    com.google.protobuf.WireFormat.FieldType.STRING,
        +                    "",
        +                    com.google.protobuf.WireFormat.FieldType.MESSAGE,
        +                    com.google.api.BackendRule.getDefaultInstance());
        +  }
        +
        +  @SuppressWarnings("serial")
        +  private com.google.protobuf.MapField
        +      overridesByRequestProtocol_;
        +
        +  private com.google.protobuf.MapField
        +      internalGetOverridesByRequestProtocol() {
        +    if (overridesByRequestProtocol_ == null) {
        +      return com.google.protobuf.MapField.emptyMapField(
        +          OverridesByRequestProtocolDefaultEntryHolder.defaultEntry);
        +    }
        +    return overridesByRequestProtocol_;
        +  }
        +
        +  public int getOverridesByRequestProtocolCount() {
        +    return internalGetOverridesByRequestProtocol().getMap().size();
        +  }
        +
        +  /**
        +   *
        +   *
        +   * 
        +   * The map between request protocol and the backend address.
        +   * 
        + * + * map<string, .google.api.BackendRule> overrides_by_request_protocol = 10; + */ + @java.lang.Override + public boolean containsOverridesByRequestProtocol(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + return internalGetOverridesByRequestProtocol().getMap().containsKey(key); + } + + /** Use {@link #getOverridesByRequestProtocolMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map + getOverridesByRequestProtocol() { + return getOverridesByRequestProtocolMap(); + } + + /** + * + * + *
        +   * The map between request protocol and the backend address.
        +   * 
        + * + * map<string, .google.api.BackendRule> overrides_by_request_protocol = 10; + */ + @java.lang.Override + public java.util.Map + getOverridesByRequestProtocolMap() { + return internalGetOverridesByRequestProtocol().getMap(); + } + + /** + * + * + *
        +   * The map between request protocol and the backend address.
        +   * 
        + * + * map<string, .google.api.BackendRule> overrides_by_request_protocol = 10; + */ + @java.lang.Override + public /* nullable */ com.google.api.BackendRule getOverridesByRequestProtocolOrDefault( + java.lang.String key, + /* nullable */ + com.google.api.BackendRule defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = + internalGetOverridesByRequestProtocol().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + + /** + * + * + *
        +   * The map between request protocol and the backend address.
        +   * 
        + * + * map<string, .google.api.BackendRule> overrides_by_request_protocol = 10; + */ + @java.lang.Override + public com.google.api.BackendRule getOverridesByRequestProtocolOrThrow(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = + internalGetOverridesByRequestProtocol().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + private byte memoizedIsInitialized = -1; @java.lang.Override @@ -739,11 +955,11 @@ public final boolean isInitialized() { @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(selector_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, selector_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(selector_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, selector_); } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(address_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 2, address_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(address_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, address_); } if (java.lang.Double.doubleToRawLongBits(deadline_) != 0) { output.writeDouble(3, deadline_); @@ -759,14 +975,19 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io output.writeEnum(6, pathTranslation_); } if (authenticationCase_ == 7) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 7, authentication_); + com.google.protobuf.GeneratedMessage.writeString(output, 7, authentication_); } if (authenticationCase_ == 8) { output.writeBool(8, (boolean) ((java.lang.Boolean) authentication_)); } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(protocol_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 9, protocol_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(protocol_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 9, protocol_); } + com.google.protobuf.GeneratedMessage.serializeStringMapTo( + output, + internalGetOverridesByRequestProtocol(), + OverridesByRequestProtocolDefaultEntryHolder.defaultEntry, + 10); getUnknownFields().writeTo(output); } @@ -776,11 +997,11 @@ public int getSerializedSize() { if (size != -1) return size; size = 0; - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(selector_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, selector_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(selector_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, selector_); } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(address_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, address_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(address_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, address_); } if (java.lang.Double.doubleToRawLongBits(deadline_) != 0) { size += com.google.protobuf.CodedOutputStream.computeDoubleSize(3, deadline_); @@ -796,15 +1017,28 @@ public int getSerializedSize() { size += com.google.protobuf.CodedOutputStream.computeEnumSize(6, pathTranslation_); } if (authenticationCase_ == 7) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(7, authentication_); + size += com.google.protobuf.GeneratedMessage.computeStringSize(7, authentication_); } if (authenticationCase_ == 8) { size += com.google.protobuf.CodedOutputStream.computeBoolSize( 8, (boolean) ((java.lang.Boolean) authentication_)); } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(protocol_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(9, protocol_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(protocol_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(9, protocol_); + } + for (java.util.Map.Entry entry : + internalGetOverridesByRequestProtocol().getMap().entrySet()) { + com.google.protobuf.MapEntry + overridesByRequestProtocol__ = + OverridesByRequestProtocolDefaultEntryHolder.defaultEntry + .newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 10, overridesByRequestProtocol__); } size += getUnknownFields().getSerializedSize(); memoizedSize = size; @@ -831,6 +1065,8 @@ public boolean equals(final java.lang.Object obj) { != java.lang.Double.doubleToLongBits(other.getOperationDeadline())) return false; if (pathTranslation_ != other.pathTranslation_) return false; if (!getProtocol().equals(other.getProtocol())) return false; + if (!internalGetOverridesByRequestProtocol() + .equals(other.internalGetOverridesByRequestProtocol())) return false; if (!getAuthenticationCase().equals(other.getAuthenticationCase())) return false; switch (authenticationCase_) { case 7: @@ -876,6 +1112,10 @@ public int hashCode() { hash = (53 * hash) + pathTranslation_; hash = (37 * hash) + PROTOCOL_FIELD_NUMBER; hash = (53 * hash) + getProtocol().hashCode(); + if (!internalGetOverridesByRequestProtocol().getMap().isEmpty()) { + hash = (37 * hash) + OVERRIDES_BY_REQUEST_PROTOCOL_FIELD_NUMBER; + hash = (53 * hash) + internalGetOverridesByRequestProtocol().hashCode(); + } switch (authenticationCase_) { case 7: hash = (37 * hash) + JWT_AUDIENCE_FIELD_NUMBER; @@ -929,38 +1169,38 @@ public static com.google.api.BackendRule parseFrom( public static com.google.api.BackendRule parseFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); } public static com.google.api.BackendRule parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } public static com.google.api.BackendRule parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); } public static com.google.api.BackendRule parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( PARSER, input, extensionRegistry); } public static com.google.api.BackendRule parseFrom(com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); } public static com.google.api.BackendRule parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } @@ -983,10 +1223,11 @@ public Builder toBuilder() { } @java.lang.Override - protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { Builder builder = new Builder(parent); return builder; } + /** * * @@ -996,7 +1237,7 @@ protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.Build * * Protobuf type {@code google.api.BackendRule} */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder implements // @@protoc_insertion_point(builder_implements:google.api.BackendRule) com.google.api.BackendRuleOrBuilder { @@ -1004,8 +1245,30 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.api.BackendProto.internal_static_google_api_BackendRule_descriptor; } + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapFieldReflectionAccessor internalGetMapFieldReflection( + int number) { + switch (number) { + case 10: + return internalGetOverridesByRequestProtocol(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapFieldReflectionAccessor internalGetMutableMapFieldReflection( + int number) { + switch (number) { + case 10: + return internalGetMutableOverridesByRequestProtocol(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.api.BackendProto.internal_static_google_api_BackendRule_fieldAccessorTable .ensureFieldAccessorsInitialized( @@ -1015,27 +1278,22 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { // Construct using com.google.api.BackendRule.newBuilder() private Builder() {} - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { super(parent); } @java.lang.Override public Builder clear() { super.clear(); + bitField0_ = 0; selector_ = ""; - address_ = ""; - deadline_ = 0D; - minDeadline_ = 0D; - operationDeadline_ = 0D; - pathTranslation_ = 0; - protocol_ = ""; - + internalGetMutableOverridesByRequestProtocol().clear(); authenticationCase_ = 0; authentication_ = null; return this; @@ -1063,55 +1321,47 @@ public com.google.api.BackendRule build() { @java.lang.Override public com.google.api.BackendRule buildPartial() { com.google.api.BackendRule result = new com.google.api.BackendRule(this); - result.selector_ = selector_; - result.address_ = address_; - result.deadline_ = deadline_; - result.minDeadline_ = minDeadline_; - result.operationDeadline_ = operationDeadline_; - result.pathTranslation_ = pathTranslation_; - if (authenticationCase_ == 7) { - result.authentication_ = authentication_; + if (bitField0_ != 0) { + buildPartial0(result); } - if (authenticationCase_ == 8) { - result.authentication_ = authentication_; - } - result.protocol_ = protocol_; - result.authenticationCase_ = authenticationCase_; + buildPartialOneofs(result); 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); + private void buildPartial0(com.google.api.BackendRule result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.selector_ = selector_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.address_ = address_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.deadline_ = deadline_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.minDeadline_ = minDeadline_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.operationDeadline_ = operationDeadline_; + } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.pathTranslation_ = pathTranslation_; + } + if (((from_bitField0_ & 0x00000100) != 0)) { + result.protocol_ = protocol_; + } + if (((from_bitField0_ & 0x00000200) != 0)) { + result.overridesByRequestProtocol_ = + internalGetOverridesByRequestProtocol() + .build(OverridesByRequestProtocolDefaultEntryHolder.defaultEntry); + } } - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.addRepeatedField(field, value); + private void buildPartialOneofs(com.google.api.BackendRule result) { + result.authenticationCase_ = authenticationCase_; + result.authentication_ = this.authentication_; } @java.lang.Override @@ -1128,19 +1378,21 @@ public Builder mergeFrom(com.google.api.BackendRule other) { if (other == com.google.api.BackendRule.getDefaultInstance()) return this; if (!other.getSelector().isEmpty()) { selector_ = other.selector_; + bitField0_ |= 0x00000001; onChanged(); } if (!other.getAddress().isEmpty()) { address_ = other.address_; + bitField0_ |= 0x00000002; onChanged(); } - if (other.getDeadline() != 0D) { + if (java.lang.Double.doubleToRawLongBits(other.getDeadline()) != 0) { setDeadline(other.getDeadline()); } - if (other.getMinDeadline() != 0D) { + if (java.lang.Double.doubleToRawLongBits(other.getMinDeadline()) != 0) { setMinDeadline(other.getMinDeadline()); } - if (other.getOperationDeadline() != 0D) { + if (java.lang.Double.doubleToRawLongBits(other.getOperationDeadline()) != 0) { setOperationDeadline(other.getOperationDeadline()); } if (other.pathTranslation_ != 0) { @@ -1148,8 +1400,12 @@ public Builder mergeFrom(com.google.api.BackendRule other) { } if (!other.getProtocol().isEmpty()) { protocol_ = other.protocol_; + bitField0_ |= 0x00000100; onChanged(); } + internalGetMutableOverridesByRequestProtocol() + .mergeFrom(other.internalGetOverridesByRequestProtocol()); + bitField0_ |= 0x00000200; switch (other.getAuthenticationCase()) { case JWT_AUDIENCE: { @@ -1197,37 +1453,37 @@ public Builder mergeFrom( case 10: { selector_ = input.readStringRequireUtf8(); - + bitField0_ |= 0x00000001; break; } // case 10 case 18: { address_ = input.readStringRequireUtf8(); - + bitField0_ |= 0x00000002; break; } // case 18 case 25: { deadline_ = input.readDouble(); - + bitField0_ |= 0x00000004; break; } // case 25 case 33: { minDeadline_ = input.readDouble(); - + bitField0_ |= 0x00000008; break; } // case 33 case 41: { operationDeadline_ = input.readDouble(); - + bitField0_ |= 0x00000010; break; } // case 41 case 48: { pathTranslation_ = input.readEnum(); - + bitField0_ |= 0x00000020; break; } // case 48 case 58: @@ -1246,9 +1502,25 @@ public Builder mergeFrom( case 74: { protocol_ = input.readStringRequireUtf8(); - + bitField0_ |= 0x00000100; break; } // case 74 + case 82: + { + com.google.protobuf.MapEntry + overridesByRequestProtocol__ = + input.readMessage( + OverridesByRequestProtocolDefaultEntryHolder.defaultEntry + .getParserForType(), + extensionRegistry); + internalGetMutableOverridesByRequestProtocol() + .ensureBuilderMap() + .put( + overridesByRequestProtocol__.getKey(), + overridesByRequestProtocol__.getValue()); + bitField0_ |= 0x00000200; + break; + } // case 82 default: { if (!super.parseUnknownField(input, extensionRegistry, tag)) { @@ -1280,13 +1552,18 @@ public Builder clearAuthentication() { return this; } + private int bitField0_; + private java.lang.Object selector_ = ""; + /** * * *
              * Selects the methods to which this rule applies.
        -     * Refer to [selector][google.api.DocumentationRule.selector] for syntax details.
        +     *
        +     * Refer to [selector][google.api.DocumentationRule.selector] for syntax
        +     * details.
              * 
        * * string selector = 1; @@ -1304,12 +1581,15 @@ public java.lang.String getSelector() { return (java.lang.String) ref; } } + /** * * *
              * Selects the methods to which this rule applies.
        -     * Refer to [selector][google.api.DocumentationRule.selector] for syntax details.
        +     *
        +     * Refer to [selector][google.api.DocumentationRule.selector] for syntax
        +     * details.
              * 
        * * string selector = 1; @@ -1327,12 +1607,15 @@ public com.google.protobuf.ByteString getSelectorBytes() { return (com.google.protobuf.ByteString) ref; } } + /** * * *
              * Selects the methods to which this rule applies.
        -     * Refer to [selector][google.api.DocumentationRule.selector] for syntax details.
        +     *
        +     * Refer to [selector][google.api.DocumentationRule.selector] for syntax
        +     * details.
              * 
        * * string selector = 1; @@ -1344,17 +1627,20 @@ public Builder setSelector(java.lang.String value) { if (value == null) { throw new NullPointerException(); } - selector_ = value; + bitField0_ |= 0x00000001; onChanged(); return this; } + /** * * *
              * Selects the methods to which this rule applies.
        -     * Refer to [selector][google.api.DocumentationRule.selector] for syntax details.
        +     *
        +     * Refer to [selector][google.api.DocumentationRule.selector] for syntax
        +     * details.
              * 
        * * string selector = 1; @@ -1362,17 +1648,20 @@ public Builder setSelector(java.lang.String value) { * @return This builder for chaining. */ public Builder clearSelector() { - selector_ = getDefaultInstance().getSelector(); + bitField0_ = (bitField0_ & ~0x00000001); onChanged(); return this; } + /** * * *
              * Selects the methods to which this rule applies.
        -     * Refer to [selector][google.api.DocumentationRule.selector] for syntax details.
        +     *
        +     * Refer to [selector][google.api.DocumentationRule.selector] for syntax
        +     * details.
              * 
        * * string selector = 1; @@ -1385,30 +1674,36 @@ public Builder setSelectorBytes(com.google.protobuf.ByteString value) { throw new NullPointerException(); } checkByteStringIsUtf8(value); - selector_ = value; + bitField0_ |= 0x00000001; onChanged(); return this; } private java.lang.Object address_ = ""; + /** * * *
              * The address of the API backend.
        +     *
              * The scheme is used to determine the backend protocol and security.
              * The following schemes are accepted:
        -     *    SCHEME        PROTOCOL    SECURITY
        -     *    http://       HTTP        None
        -     *    https://      HTTP        TLS
        -     *    grpc://       gRPC        None
        -     *    grpcs://      gRPC        TLS
        +     *
        +     * SCHEME        PROTOCOL    SECURITY
        +     * http://       HTTP        None
        +     * https://      HTTP        TLS
        +     * grpc://       gRPC        None
        +     * grpcs://      gRPC        TLS
        +     *
              * It is recommended to explicitly include a scheme. Leaving out the scheme
              * may cause constrasting behaviors across platforms.
        +     *
              * If the port is unspecified, the default is:
              * - 80 for schemes without TLS
              * - 443 for schemes with TLS
        +     *
              * For HTTP backends, use [protocol][google.api.BackendRule.protocol]
              * to specify the protocol version.
              * 
        @@ -1428,23 +1723,29 @@ public java.lang.String getAddress() { return (java.lang.String) ref; } } + /** * * *
              * The address of the API backend.
        +     *
              * The scheme is used to determine the backend protocol and security.
              * The following schemes are accepted:
        -     *    SCHEME        PROTOCOL    SECURITY
        -     *    http://       HTTP        None
        -     *    https://      HTTP        TLS
        -     *    grpc://       gRPC        None
        -     *    grpcs://      gRPC        TLS
        +     *
        +     * SCHEME        PROTOCOL    SECURITY
        +     * http://       HTTP        None
        +     * https://      HTTP        TLS
        +     * grpc://       gRPC        None
        +     * grpcs://      gRPC        TLS
        +     *
              * It is recommended to explicitly include a scheme. Leaving out the scheme
              * may cause constrasting behaviors across platforms.
        +     *
              * If the port is unspecified, the default is:
              * - 80 for schemes without TLS
              * - 443 for schemes with TLS
        +     *
              * For HTTP backends, use [protocol][google.api.BackendRule.protocol]
              * to specify the protocol version.
              * 
        @@ -1464,23 +1765,29 @@ public com.google.protobuf.ByteString getAddressBytes() { return (com.google.protobuf.ByteString) ref; } } + /** * * *
              * The address of the API backend.
        +     *
              * The scheme is used to determine the backend protocol and security.
              * The following schemes are accepted:
        -     *    SCHEME        PROTOCOL    SECURITY
        -     *    http://       HTTP        None
        -     *    https://      HTTP        TLS
        -     *    grpc://       gRPC        None
        -     *    grpcs://      gRPC        TLS
        +     *
        +     * SCHEME        PROTOCOL    SECURITY
        +     * http://       HTTP        None
        +     * https://      HTTP        TLS
        +     * grpc://       gRPC        None
        +     * grpcs://      gRPC        TLS
        +     *
              * It is recommended to explicitly include a scheme. Leaving out the scheme
              * may cause constrasting behaviors across platforms.
        +     *
              * If the port is unspecified, the default is:
              * - 80 for schemes without TLS
              * - 443 for schemes with TLS
        +     *
              * For HTTP backends, use [protocol][google.api.BackendRule.protocol]
              * to specify the protocol version.
              * 
        @@ -1494,28 +1801,34 @@ public Builder setAddress(java.lang.String value) { if (value == null) { throw new NullPointerException(); } - address_ = value; + bitField0_ |= 0x00000002; onChanged(); return this; } + /** * * *
              * The address of the API backend.
        +     *
              * The scheme is used to determine the backend protocol and security.
              * The following schemes are accepted:
        -     *    SCHEME        PROTOCOL    SECURITY
        -     *    http://       HTTP        None
        -     *    https://      HTTP        TLS
        -     *    grpc://       gRPC        None
        -     *    grpcs://      gRPC        TLS
        +     *
        +     * SCHEME        PROTOCOL    SECURITY
        +     * http://       HTTP        None
        +     * https://      HTTP        TLS
        +     * grpc://       gRPC        None
        +     * grpcs://      gRPC        TLS
        +     *
              * It is recommended to explicitly include a scheme. Leaving out the scheme
              * may cause constrasting behaviors across platforms.
        +     *
              * If the port is unspecified, the default is:
              * - 80 for schemes without TLS
              * - 443 for schemes with TLS
        +     *
              * For HTTP backends, use [protocol][google.api.BackendRule.protocol]
              * to specify the protocol version.
              * 
        @@ -1525,28 +1838,34 @@ public Builder setAddress(java.lang.String value) { * @return This builder for chaining. */ public Builder clearAddress() { - address_ = getDefaultInstance().getAddress(); + bitField0_ = (bitField0_ & ~0x00000002); onChanged(); return this; } + /** * * *
              * The address of the API backend.
        +     *
              * The scheme is used to determine the backend protocol and security.
              * The following schemes are accepted:
        -     *    SCHEME        PROTOCOL    SECURITY
        -     *    http://       HTTP        None
        -     *    https://      HTTP        TLS
        -     *    grpc://       gRPC        None
        -     *    grpcs://      gRPC        TLS
        +     *
        +     * SCHEME        PROTOCOL    SECURITY
        +     * http://       HTTP        None
        +     * https://      HTTP        TLS
        +     * grpc://       gRPC        None
        +     * grpcs://      gRPC        TLS
        +     *
              * It is recommended to explicitly include a scheme. Leaving out the scheme
              * may cause constrasting behaviors across platforms.
        +     *
              * If the port is unspecified, the default is:
              * - 80 for schemes without TLS
              * - 443 for schemes with TLS
        +     *
              * For HTTP backends, use [protocol][google.api.BackendRule.protocol]
              * to specify the protocol version.
              * 
        @@ -1561,13 +1880,14 @@ public Builder setAddressBytes(com.google.protobuf.ByteString value) { throw new NullPointerException(); } checkByteStringIsUtf8(value); - address_ = value; + bitField0_ |= 0x00000002; onChanged(); return this; } private double deadline_; + /** * * @@ -1584,6 +1904,7 @@ public Builder setAddressBytes(com.google.protobuf.ByteString value) { public double getDeadline() { return deadline_; } + /** * * @@ -1600,9 +1921,11 @@ public double getDeadline() { public Builder setDeadline(double value) { deadline_ = value; + bitField0_ |= 0x00000004; onChanged(); return this; } + /** * * @@ -1616,13 +1939,14 @@ public Builder setDeadline(double value) { * @return This builder for chaining. */ public Builder clearDeadline() { - + bitField0_ = (bitField0_ & ~0x00000004); deadline_ = 0D; onChanged(); return this; } private double minDeadline_; + /** * * @@ -1633,7 +1957,7 @@ public Builder clearDeadline() { * double min_deadline = 4 [deprecated = true]; * * @deprecated google.api.BackendRule.min_deadline is deprecated. See - * google/api/backend.proto;l=123 + * google/api/backend.proto;l=124 * @return The minDeadline. */ @java.lang.Override @@ -1641,6 +1965,7 @@ public Builder clearDeadline() { public double getMinDeadline() { return minDeadline_; } + /** * * @@ -1651,7 +1976,7 @@ public double getMinDeadline() { * double min_deadline = 4 [deprecated = true]; * * @deprecated google.api.BackendRule.min_deadline is deprecated. See - * google/api/backend.proto;l=123 + * google/api/backend.proto;l=124 * @param value The minDeadline to set. * @return This builder for chaining. */ @@ -1659,9 +1984,11 @@ public double getMinDeadline() { public Builder setMinDeadline(double value) { minDeadline_ = value; + bitField0_ |= 0x00000008; onChanged(); return this; } + /** * * @@ -1672,18 +1999,19 @@ public Builder setMinDeadline(double value) { * double min_deadline = 4 [deprecated = true]; * * @deprecated google.api.BackendRule.min_deadline is deprecated. See - * google/api/backend.proto;l=123 + * google/api/backend.proto;l=124 * @return This builder for chaining. */ @java.lang.Deprecated public Builder clearMinDeadline() { - + bitField0_ = (bitField0_ & ~0x00000008); minDeadline_ = 0D; onChanged(); return this; } private double operationDeadline_; + /** * * @@ -1700,6 +2028,7 @@ public Builder clearMinDeadline() { public double getOperationDeadline() { return operationDeadline_; } + /** * * @@ -1716,9 +2045,11 @@ public double getOperationDeadline() { public Builder setOperationDeadline(double value) { operationDeadline_ = value; + bitField0_ |= 0x00000010; onChanged(); return this; } + /** * * @@ -1732,13 +2063,14 @@ public Builder setOperationDeadline(double value) { * @return This builder for chaining. */ public Builder clearOperationDeadline() { - + bitField0_ = (bitField0_ & ~0x00000010); operationDeadline_ = 0D; onChanged(); return this; } private int pathTranslation_ = 0; + /** * .google.api.BackendRule.PathTranslation path_translation = 6; * @@ -1748,6 +2080,7 @@ public Builder clearOperationDeadline() { public int getPathTranslationValue() { return pathTranslation_; } + /** * .google.api.BackendRule.PathTranslation path_translation = 6; * @@ -1755,11 +2088,12 @@ public int getPathTranslationValue() { * @return This builder for chaining. */ public Builder setPathTranslationValue(int value) { - pathTranslation_ = value; + bitField0_ |= 0x00000020; onChanged(); return this; } + /** * .google.api.BackendRule.PathTranslation path_translation = 6; * @@ -1767,11 +2101,11 @@ public Builder setPathTranslationValue(int value) { */ @java.lang.Override public com.google.api.BackendRule.PathTranslation getPathTranslation() { - @SuppressWarnings("deprecation") com.google.api.BackendRule.PathTranslation result = - com.google.api.BackendRule.PathTranslation.valueOf(pathTranslation_); + com.google.api.BackendRule.PathTranslation.forNumber(pathTranslation_); return result == null ? com.google.api.BackendRule.PathTranslation.UNRECOGNIZED : result; } + /** * .google.api.BackendRule.PathTranslation path_translation = 6; * @@ -1782,18 +2116,19 @@ public Builder setPathTranslation(com.google.api.BackendRule.PathTranslation val if (value == null) { throw new NullPointerException(); } - + bitField0_ |= 0x00000020; pathTranslation_ = value.getNumber(); onChanged(); return this; } + /** * .google.api.BackendRule.PathTranslation path_translation = 6; * * @return This builder for chaining. */ public Builder clearPathTranslation() { - + bitField0_ = (bitField0_ & ~0x00000020); pathTranslation_ = 0; onChanged(); return this; @@ -1816,6 +2151,7 @@ public Builder clearPathTranslation() { public boolean hasJwtAudience() { return authenticationCase_ == 7; } + /** * * @@ -1846,6 +2182,7 @@ public java.lang.String getJwtAudience() { return (java.lang.String) ref; } } + /** * * @@ -1876,6 +2213,7 @@ public com.google.protobuf.ByteString getJwtAudienceBytes() { return (com.google.protobuf.ByteString) ref; } } + /** * * @@ -1899,6 +2237,7 @@ public Builder setJwtAudience(java.lang.String value) { onChanged(); return this; } + /** * * @@ -1920,6 +2259,7 @@ public Builder clearJwtAudience() { } return this; } + /** * * @@ -1962,6 +2302,7 @@ public Builder setJwtAudienceBytes(com.google.protobuf.ByteString value) { public boolean hasDisableAuth() { return authenticationCase_ == 8; } + /** * * @@ -1982,6 +2323,7 @@ public boolean getDisableAuth() { } return false; } + /** * * @@ -1998,11 +2340,13 @@ public boolean getDisableAuth() { * @return This builder for chaining. */ public Builder setDisableAuth(boolean value) { + authenticationCase_ = 8; authentication_ = value; onChanged(); return this; } + /** * * @@ -2027,23 +2371,29 @@ public Builder clearDisableAuth() { } private java.lang.Object protocol_ = ""; + /** * * *
              * The protocol used for sending a request to the backend.
              * The supported values are "http/1.1" and "h2".
        +     *
              * The default value is inferred from the scheme in the
              * [address][google.api.BackendRule.address] field:
        -     *    SCHEME        PROTOCOL
        -     *    http://       http/1.1
        -     *    https://      http/1.1
        -     *    grpc://       h2
        -     *    grpcs://      h2
        +     *
        +     * SCHEME        PROTOCOL
        +     * http://       http/1.1
        +     * https://      http/1.1
        +     * grpc://       h2
        +     * grpcs://      h2
        +     *
              * For secure HTTP backends (https://) that support HTTP/2, set this field
              * to "h2" for improved performance.
        +     *
              * Configuring this field to non-default values is only supported for secure
              * HTTP backends. This field will be ignored for all other backends.
        +     *
              * See
              * https://www.iana.org/assignments/tls-extensiontype-values/tls-extensiontype-values.xhtml#alpn-protocol-ids
              * for more details on the supported values.
        @@ -2064,23 +2414,29 @@ public java.lang.String getProtocol() {
                 return (java.lang.String) ref;
               }
             }
        +
             /**
              *
              *
              * 
              * The protocol used for sending a request to the backend.
              * The supported values are "http/1.1" and "h2".
        +     *
              * The default value is inferred from the scheme in the
              * [address][google.api.BackendRule.address] field:
        -     *    SCHEME        PROTOCOL
        -     *    http://       http/1.1
        -     *    https://      http/1.1
        -     *    grpc://       h2
        -     *    grpcs://      h2
        +     *
        +     * SCHEME        PROTOCOL
        +     * http://       http/1.1
        +     * https://      http/1.1
        +     * grpc://       h2
        +     * grpcs://      h2
        +     *
              * For secure HTTP backends (https://) that support HTTP/2, set this field
              * to "h2" for improved performance.
        +     *
              * Configuring this field to non-default values is only supported for secure
              * HTTP backends. This field will be ignored for all other backends.
        +     *
              * See
              * https://www.iana.org/assignments/tls-extensiontype-values/tls-extensiontype-values.xhtml#alpn-protocol-ids
              * for more details on the supported values.
        @@ -2101,23 +2457,29 @@ public com.google.protobuf.ByteString getProtocolBytes() {
                 return (com.google.protobuf.ByteString) ref;
               }
             }
        +
             /**
              *
              *
              * 
              * The protocol used for sending a request to the backend.
              * The supported values are "http/1.1" and "h2".
        +     *
              * The default value is inferred from the scheme in the
              * [address][google.api.BackendRule.address] field:
        -     *    SCHEME        PROTOCOL
        -     *    http://       http/1.1
        -     *    https://      http/1.1
        -     *    grpc://       h2
        -     *    grpcs://      h2
        +     *
        +     * SCHEME        PROTOCOL
        +     * http://       http/1.1
        +     * https://      http/1.1
        +     * grpc://       h2
        +     * grpcs://      h2
        +     *
              * For secure HTTP backends (https://) that support HTTP/2, set this field
              * to "h2" for improved performance.
        +     *
              * Configuring this field to non-default values is only supported for secure
              * HTTP backends. This field will be ignored for all other backends.
        +     *
              * See
              * https://www.iana.org/assignments/tls-extensiontype-values/tls-extensiontype-values.xhtml#alpn-protocol-ids
              * for more details on the supported values.
        @@ -2132,28 +2494,34 @@ public Builder setProtocol(java.lang.String value) {
               if (value == null) {
                 throw new NullPointerException();
               }
        -
               protocol_ = value;
        +      bitField0_ |= 0x00000100;
               onChanged();
               return this;
             }
        +
             /**
              *
              *
              * 
              * The protocol used for sending a request to the backend.
              * The supported values are "http/1.1" and "h2".
        +     *
              * The default value is inferred from the scheme in the
              * [address][google.api.BackendRule.address] field:
        -     *    SCHEME        PROTOCOL
        -     *    http://       http/1.1
        -     *    https://      http/1.1
        -     *    grpc://       h2
        -     *    grpcs://      h2
        +     *
        +     * SCHEME        PROTOCOL
        +     * http://       http/1.1
        +     * https://      http/1.1
        +     * grpc://       h2
        +     * grpcs://      h2
        +     *
              * For secure HTTP backends (https://) that support HTTP/2, set this field
              * to "h2" for improved performance.
        +     *
              * Configuring this field to non-default values is only supported for secure
              * HTTP backends. This field will be ignored for all other backends.
        +     *
              * See
              * https://www.iana.org/assignments/tls-extensiontype-values/tls-extensiontype-values.xhtml#alpn-protocol-ids
              * for more details on the supported values.
        @@ -2164,28 +2532,34 @@ public Builder setProtocol(java.lang.String value) {
              * @return This builder for chaining.
              */
             public Builder clearProtocol() {
        -
               protocol_ = getDefaultInstance().getProtocol();
        +      bitField0_ = (bitField0_ & ~0x00000100);
               onChanged();
               return this;
             }
        +
             /**
              *
              *
              * 
              * The protocol used for sending a request to the backend.
              * The supported values are "http/1.1" and "h2".
        +     *
              * The default value is inferred from the scheme in the
              * [address][google.api.BackendRule.address] field:
        -     *    SCHEME        PROTOCOL
        -     *    http://       http/1.1
        -     *    https://      http/1.1
        -     *    grpc://       h2
        -     *    grpcs://      h2
        +     *
        +     * SCHEME        PROTOCOL
        +     * http://       http/1.1
        +     * https://      http/1.1
        +     * grpc://       h2
        +     * grpcs://      h2
        +     *
              * For secure HTTP backends (https://) that support HTTP/2, set this field
              * to "h2" for improved performance.
        +     *
              * Configuring this field to non-default values is only supported for secure
              * HTTP backends. This field will be ignored for all other backends.
        +     *
              * See
              * https://www.iana.org/assignments/tls-extensiontype-values/tls-extensiontype-values.xhtml#alpn-protocol-ids
              * for more details on the supported values.
        @@ -2201,21 +2575,256 @@ public Builder setProtocolBytes(com.google.protobuf.ByteString value) {
                 throw new NullPointerException();
               }
               checkByteStringIsUtf8(value);
        -
               protocol_ = value;
        +      bitField0_ |= 0x00000100;
               onChanged();
               return this;
             }
         
        +    private static final class OverridesByRequestProtocolConverter
        +        implements com.google.protobuf.MapFieldBuilder.Converter<
        +            java.lang.String, com.google.api.BackendRuleOrBuilder, com.google.api.BackendRule> {
        +      @java.lang.Override
        +      public com.google.api.BackendRule build(com.google.api.BackendRuleOrBuilder val) {
        +        if (val instanceof com.google.api.BackendRule) {
        +          return (com.google.api.BackendRule) val;
        +        }
        +        return ((com.google.api.BackendRule.Builder) val).build();
        +      }
        +
        +      @java.lang.Override
        +      public com.google.protobuf.MapEntry
        +          defaultEntry() {
        +        return OverridesByRequestProtocolDefaultEntryHolder.defaultEntry;
        +      }
        +    }
        +    ;
        +
        +    private static final OverridesByRequestProtocolConverter overridesByRequestProtocolConverter =
        +        new OverridesByRequestProtocolConverter();
        +
        +    private com.google.protobuf.MapFieldBuilder<
        +            java.lang.String,
        +            com.google.api.BackendRuleOrBuilder,
        +            com.google.api.BackendRule,
        +            com.google.api.BackendRule.Builder>
        +        overridesByRequestProtocol_;
        +
        +    private com.google.protobuf.MapFieldBuilder<
        +            java.lang.String,
        +            com.google.api.BackendRuleOrBuilder,
        +            com.google.api.BackendRule,
        +            com.google.api.BackendRule.Builder>
        +        internalGetOverridesByRequestProtocol() {
        +      if (overridesByRequestProtocol_ == null) {
        +        return new com.google.protobuf.MapFieldBuilder<>(overridesByRequestProtocolConverter);
        +      }
        +      return overridesByRequestProtocol_;
        +    }
        +
        +    private com.google.protobuf.MapFieldBuilder<
        +            java.lang.String,
        +            com.google.api.BackendRuleOrBuilder,
        +            com.google.api.BackendRule,
        +            com.google.api.BackendRule.Builder>
        +        internalGetMutableOverridesByRequestProtocol() {
        +      if (overridesByRequestProtocol_ == null) {
        +        overridesByRequestProtocol_ =
        +            new com.google.protobuf.MapFieldBuilder<>(overridesByRequestProtocolConverter);
        +      }
        +      bitField0_ |= 0x00000200;
        +      onChanged();
        +      return overridesByRequestProtocol_;
        +    }
        +
        +    public int getOverridesByRequestProtocolCount() {
        +      return internalGetOverridesByRequestProtocol().ensureBuilderMap().size();
        +    }
        +
        +    /**
        +     *
        +     *
        +     * 
        +     * The map between request protocol and the backend address.
        +     * 
        + * + * map<string, .google.api.BackendRule> overrides_by_request_protocol = 10; + */ + @java.lang.Override + public boolean containsOverridesByRequestProtocol(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + return internalGetOverridesByRequestProtocol().ensureBuilderMap().containsKey(key); + } + + /** Use {@link #getOverridesByRequestProtocolMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map + getOverridesByRequestProtocol() { + return getOverridesByRequestProtocolMap(); + } + + /** + * + * + *
        +     * The map between request protocol and the backend address.
        +     * 
        + * + * map<string, .google.api.BackendRule> overrides_by_request_protocol = 10; + */ + @java.lang.Override + public java.util.Map + getOverridesByRequestProtocolMap() { + return internalGetOverridesByRequestProtocol().getImmutableMap(); + } + + /** + * + * + *
        +     * The map between request protocol and the backend address.
        +     * 
        + * + * map<string, .google.api.BackendRule> overrides_by_request_protocol = 10; + */ @java.lang.Override - public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); + public /* nullable */ com.google.api.BackendRule getOverridesByRequestProtocolOrDefault( + java.lang.String key, + /* nullable */ + com.google.api.BackendRule defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = + internalGetMutableOverridesByRequestProtocol().ensureBuilderMap(); + return map.containsKey(key) + ? overridesByRequestProtocolConverter.build(map.get(key)) + : defaultValue; } + /** + * + * + *
        +     * The map between request protocol and the backend address.
        +     * 
        + * + * map<string, .google.api.BackendRule> overrides_by_request_protocol = 10; + */ @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); + public com.google.api.BackendRule getOverridesByRequestProtocolOrThrow(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = + internalGetMutableOverridesByRequestProtocol().ensureBuilderMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return overridesByRequestProtocolConverter.build(map.get(key)); + } + + public Builder clearOverridesByRequestProtocol() { + bitField0_ = (bitField0_ & ~0x00000200); + internalGetMutableOverridesByRequestProtocol().clear(); + return this; + } + + /** + * + * + *
        +     * The map between request protocol and the backend address.
        +     * 
        + * + * map<string, .google.api.BackendRule> overrides_by_request_protocol = 10; + */ + public Builder removeOverridesByRequestProtocol(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + internalGetMutableOverridesByRequestProtocol().ensureBuilderMap().remove(key); + return this; + } + + /** Use alternate mutation accessors instead. */ + @java.lang.Deprecated + public java.util.Map + getMutableOverridesByRequestProtocol() { + bitField0_ |= 0x00000200; + return internalGetMutableOverridesByRequestProtocol().ensureMessageMap(); + } + + /** + * + * + *
        +     * The map between request protocol and the backend address.
        +     * 
        + * + * map<string, .google.api.BackendRule> overrides_by_request_protocol = 10; + */ + public Builder putOverridesByRequestProtocol( + java.lang.String key, com.google.api.BackendRule value) { + if (key == null) { + throw new NullPointerException("map key"); + } + if (value == null) { + throw new NullPointerException("map value"); + } + internalGetMutableOverridesByRequestProtocol().ensureBuilderMap().put(key, value); + bitField0_ |= 0x00000200; + return this; + } + + /** + * + * + *
        +     * The map between request protocol and the backend address.
        +     * 
        + * + * map<string, .google.api.BackendRule> overrides_by_request_protocol = 10; + */ + public Builder putAllOverridesByRequestProtocol( + java.util.Map values) { + for (java.util.Map.Entry e : + values.entrySet()) { + if (e.getKey() == null || e.getValue() == null) { + throw new NullPointerException(); + } + } + internalGetMutableOverridesByRequestProtocol().ensureBuilderMap().putAll(values); + bitField0_ |= 0x00000200; + return this; + } + + /** + * + * + *
        +     * The map between request protocol and the backend address.
        +     * 
        + * + * map<string, .google.api.BackendRule> overrides_by_request_protocol = 10; + */ + public com.google.api.BackendRule.Builder putOverridesByRequestProtocolBuilderIfAbsent( + java.lang.String key) { + java.util.Map builderMap = + internalGetMutableOverridesByRequestProtocol().ensureBuilderMap(); + com.google.api.BackendRuleOrBuilder entry = builderMap.get(key); + if (entry == null) { + entry = com.google.api.BackendRule.newBuilder(); + builderMap.put(key, entry); + } + if (entry instanceof com.google.api.BackendRule) { + entry = ((com.google.api.BackendRule) entry).toBuilder(); + builderMap.put(key, entry); + } + return (com.google.api.BackendRule.Builder) entry; } // @@protoc_insertion_point(builder_scope:google.api.BackendRule) diff --git a/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/BackendRuleOrBuilder.java b/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/BackendRuleOrBuilder.java index a76b090140..1adcf011da 100644 --- a/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/BackendRuleOrBuilder.java +++ b/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/BackendRuleOrBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,10 +14,13 @@ * limitations under the License. */ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: google/api/backend.proto +// Protobuf Java Version: 4.33.2 package com.google.api; +@com.google.protobuf.Generated public interface BackendRuleOrBuilder extends // @@protoc_insertion_point(interface_extends:google.api.BackendRule) @@ -28,7 +31,9 @@ public interface BackendRuleOrBuilder * *
            * Selects the methods to which this rule applies.
        -   * Refer to [selector][google.api.DocumentationRule.selector] for syntax details.
        +   *
        +   * Refer to [selector][google.api.DocumentationRule.selector] for syntax
        +   * details.
            * 
        * * string selector = 1; @@ -36,12 +41,15 @@ public interface BackendRuleOrBuilder * @return The selector. */ java.lang.String getSelector(); + /** * * *
            * Selects the methods to which this rule applies.
        -   * Refer to [selector][google.api.DocumentationRule.selector] for syntax details.
        +   *
        +   * Refer to [selector][google.api.DocumentationRule.selector] for syntax
        +   * details.
            * 
        * * string selector = 1; @@ -55,18 +63,23 @@ public interface BackendRuleOrBuilder * *
            * The address of the API backend.
        +   *
            * The scheme is used to determine the backend protocol and security.
            * The following schemes are accepted:
        -   *    SCHEME        PROTOCOL    SECURITY
        -   *    http://       HTTP        None
        -   *    https://      HTTP        TLS
        -   *    grpc://       gRPC        None
        -   *    grpcs://      gRPC        TLS
        +   *
        +   * SCHEME        PROTOCOL    SECURITY
        +   * http://       HTTP        None
        +   * https://      HTTP        TLS
        +   * grpc://       gRPC        None
        +   * grpcs://      gRPC        TLS
        +   *
            * It is recommended to explicitly include a scheme. Leaving out the scheme
            * may cause constrasting behaviors across platforms.
        +   *
            * If the port is unspecified, the default is:
            * - 80 for schemes without TLS
            * - 443 for schemes with TLS
        +   *
            * For HTTP backends, use [protocol][google.api.BackendRule.protocol]
            * to specify the protocol version.
            * 
        @@ -76,23 +89,29 @@ public interface BackendRuleOrBuilder * @return The address. */ java.lang.String getAddress(); + /** * * *
            * The address of the API backend.
        +   *
            * The scheme is used to determine the backend protocol and security.
            * The following schemes are accepted:
        -   *    SCHEME        PROTOCOL    SECURITY
        -   *    http://       HTTP        None
        -   *    https://      HTTP        TLS
        -   *    grpc://       gRPC        None
        -   *    grpcs://      gRPC        TLS
        +   *
        +   * SCHEME        PROTOCOL    SECURITY
        +   * http://       HTTP        None
        +   * https://      HTTP        TLS
        +   * grpc://       gRPC        None
        +   * grpcs://      gRPC        TLS
        +   *
            * It is recommended to explicitly include a scheme. Leaving out the scheme
            * may cause constrasting behaviors across platforms.
        +   *
            * If the port is unspecified, the default is:
            * - 80 for schemes without TLS
            * - 443 for schemes with TLS
        +   *
            * For HTTP backends, use [protocol][google.api.BackendRule.protocol]
            * to specify the protocol version.
            * 
        @@ -127,7 +146,7 @@ public interface BackendRuleOrBuilder * double min_deadline = 4 [deprecated = true]; * * @deprecated google.api.BackendRule.min_deadline is deprecated. See - * google/api/backend.proto;l=123 + * google/api/backend.proto;l=124 * @return The minDeadline. */ @java.lang.Deprecated @@ -153,6 +172,7 @@ public interface BackendRuleOrBuilder * @return The enum numeric value on the wire for pathTranslation. */ int getPathTranslationValue(); + /** * .google.api.BackendRule.PathTranslation path_translation = 6; * @@ -174,6 +194,7 @@ public interface BackendRuleOrBuilder * @return Whether the jwtAudience field is set. */ boolean hasJwtAudience(); + /** * * @@ -188,6 +209,7 @@ public interface BackendRuleOrBuilder * @return The jwtAudience. */ java.lang.String getJwtAudience(); + /** * * @@ -218,6 +240,7 @@ public interface BackendRuleOrBuilder * @return Whether the disableAuth field is set. */ boolean hasDisableAuth(); + /** * * @@ -240,17 +263,22 @@ public interface BackendRuleOrBuilder *
            * The protocol used for sending a request to the backend.
            * The supported values are "http/1.1" and "h2".
        +   *
            * The default value is inferred from the scheme in the
            * [address][google.api.BackendRule.address] field:
        -   *    SCHEME        PROTOCOL
        -   *    http://       http/1.1
        -   *    https://      http/1.1
        -   *    grpc://       h2
        -   *    grpcs://      h2
        +   *
        +   * SCHEME        PROTOCOL
        +   * http://       http/1.1
        +   * https://      http/1.1
        +   * grpc://       h2
        +   * grpcs://      h2
        +   *
            * For secure HTTP backends (https://) that support HTTP/2, set this field
            * to "h2" for improved performance.
        +   *
            * Configuring this field to non-default values is only supported for secure
            * HTTP backends. This field will be ignored for all other backends.
        +   *
            * See
            * https://www.iana.org/assignments/tls-extensiontype-values/tls-extensiontype-values.xhtml#alpn-protocol-ids
            * for more details on the supported values.
        @@ -261,23 +289,29 @@ public interface BackendRuleOrBuilder
            * @return The protocol.
            */
           java.lang.String getProtocol();
        +
           /**
            *
            *
            * 
            * The protocol used for sending a request to the backend.
            * The supported values are "http/1.1" and "h2".
        +   *
            * The default value is inferred from the scheme in the
            * [address][google.api.BackendRule.address] field:
        -   *    SCHEME        PROTOCOL
        -   *    http://       http/1.1
        -   *    https://      http/1.1
        -   *    grpc://       h2
        -   *    grpcs://      h2
        +   *
        +   * SCHEME        PROTOCOL
        +   * http://       http/1.1
        +   * https://      http/1.1
        +   * grpc://       h2
        +   * grpcs://      h2
        +   *
            * For secure HTTP backends (https://) that support HTTP/2, set this field
            * to "h2" for improved performance.
        +   *
            * Configuring this field to non-default values is only supported for secure
            * HTTP backends. This field will be ignored for all other backends.
        +   *
            * See
            * https://www.iana.org/assignments/tls-extensiontype-values/tls-extensiontype-values.xhtml#alpn-protocol-ids
            * for more details on the supported values.
        @@ -289,5 +323,68 @@ public interface BackendRuleOrBuilder
            */
           com.google.protobuf.ByteString getProtocolBytes();
         
        -  public com.google.api.BackendRule.AuthenticationCase getAuthenticationCase();
        +  /**
        +   *
        +   *
        +   * 
        +   * The map between request protocol and the backend address.
        +   * 
        + * + * map<string, .google.api.BackendRule> overrides_by_request_protocol = 10; + */ + int getOverridesByRequestProtocolCount(); + + /** + * + * + *
        +   * The map between request protocol and the backend address.
        +   * 
        + * + * map<string, .google.api.BackendRule> overrides_by_request_protocol = 10; + */ + boolean containsOverridesByRequestProtocol(java.lang.String key); + + /** Use {@link #getOverridesByRequestProtocolMap()} instead. */ + @java.lang.Deprecated + java.util.Map getOverridesByRequestProtocol(); + + /** + * + * + *
        +   * The map between request protocol and the backend address.
        +   * 
        + * + * map<string, .google.api.BackendRule> overrides_by_request_protocol = 10; + */ + java.util.Map getOverridesByRequestProtocolMap(); + + /** + * + * + *
        +   * The map between request protocol and the backend address.
        +   * 
        + * + * map<string, .google.api.BackendRule> overrides_by_request_protocol = 10; + */ + /* nullable */ + com.google.api.BackendRule getOverridesByRequestProtocolOrDefault( + java.lang.String key, + /* nullable */ + com.google.api.BackendRule defaultValue); + + /** + * + * + *
        +   * The map between request protocol and the backend address.
        +   * 
        + * + * map<string, .google.api.BackendRule> overrides_by_request_protocol = 10; + */ + com.google.api.BackendRule getOverridesByRequestProtocolOrThrow(java.lang.String key); + + com.google.api.BackendRule.AuthenticationCase getAuthenticationCase(); } diff --git a/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/Billing.java b/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/Billing.java index c984725897..1dc108eb72 100644 --- a/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/Billing.java +++ b/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/Billing.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,9 @@ * limitations under the License. */ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: google/api/billing.proto +// Protobuf Java Version: 4.33.2 package com.google.api; @@ -23,45 +25,60 @@ * *
          * Billing related configuration of the service.
        + *
          * The following example shows how to configure monitored resources and metrics
          * for billing, `consumer_destinations` is the only supported destination and
          * the monitored resources need at least one label key
          * `cloud.googleapis.com/location` to indicate the location of the billing
          * usage, using different monitored resources between monitoring and billing is
          * recommended so they can be evolved independently:
        - *     monitored_resources:
        - *     - type: library.googleapis.com/billing_branch
        - *       labels:
        - *       - key: cloud.googleapis.com/location
        - *         description: |
        - *           Predefined label to support billing location restriction.
        - *       - key: city
        - *         description: |
        - *           Custom label to define the city where the library branch is located
        - *           in.
        - *       - key: name
        - *         description: Custom label to define the name of the library branch.
        - *     metrics:
        - *     - name: library.googleapis.com/book/borrowed_count
        - *       metric_kind: DELTA
        - *       value_type: INT64
        - *       unit: "1"
        - *     billing:
        - *       consumer_destinations:
        - *       - monitored_resource: library.googleapis.com/billing_branch
        - *         metrics:
        - *         - library.googleapis.com/book/borrowed_count
        + *
        + *
        + * monitored_resources:
        + * - type: library.googleapis.com/billing_branch
        + * labels:
        + * - key: cloud.googleapis.com/location
        + * description: |
        + * Predefined label to support billing location restriction.
        + * - key: city
        + * description: |
        + * Custom label to define the city where the library branch is located
        + * in.
        + * - key: name
        + * description: Custom label to define the name of the library branch.
        + * metrics:
        + * - name: library.googleapis.com/book/borrowed_count
        + * metric_kind: DELTA
        + * value_type: INT64
        + * unit: "1"
        + * billing:
        + * consumer_destinations:
        + * - monitored_resource: library.googleapis.com/billing_branch
        + * metrics:
        + * - library.googleapis.com/book/borrowed_count
          * 
        * * Protobuf type {@code google.api.Billing} */ -public final class Billing extends com.google.protobuf.GeneratedMessageV3 +@com.google.protobuf.Generated +public final class Billing extends com.google.protobuf.GeneratedMessage implements // @@protoc_insertion_point(message_implements:google.api.Billing) BillingOrBuilder { private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "Billing"); + } + // Use Billing.newBuilder() to construct. - private Billing(com.google.protobuf.GeneratedMessageV3.Builder builder) { + private Billing(com.google.protobuf.GeneratedMessage.Builder builder) { super(builder); } @@ -69,23 +86,12 @@ private Billing() { consumerDestinations_ = java.util.Collections.emptyList(); } - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new Billing(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.api.BillingProto.internal_static_google_api_Billing_descriptor; } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.api.BillingProto.internal_static_google_api_Billing_fieldAccessorTable .ensureFieldAccessorsInitialized( @@ -102,7 +108,8 @@ public interface BillingDestinationOrBuilder * *
              * The monitored resource type. The type must be defined in
        -     * [Service.monitored_resources][google.api.Service.monitored_resources] section.
        +     * [Service.monitored_resources][google.api.Service.monitored_resources]
        +     * section.
              * 
        * * string monitored_resource = 1; @@ -110,12 +117,14 @@ public interface BillingDestinationOrBuilder * @return The monitoredResource. */ java.lang.String getMonitoredResource(); + /** * * *
              * The monitored resource type. The type must be defined in
        -     * [Service.monitored_resources][google.api.Service.monitored_resources] section.
        +     * [Service.monitored_resources][google.api.Service.monitored_resources]
        +     * section.
              * 
        * * string monitored_resource = 1; @@ -129,7 +138,8 @@ public interface BillingDestinationOrBuilder * *
              * Names of the metrics to report to this billing destination.
        -     * Each name must be defined in [Service.metrics][google.api.Service.metrics] section.
        +     * Each name must be defined in
        +     * [Service.metrics][google.api.Service.metrics] section.
              * 
        * * repeated string metrics = 2; @@ -137,12 +147,14 @@ public interface BillingDestinationOrBuilder * @return A list containing the metrics. */ java.util.List getMetricsList(); + /** * * *
              * Names of the metrics to report to this billing destination.
        -     * Each name must be defined in [Service.metrics][google.api.Service.metrics] section.
        +     * Each name must be defined in
        +     * [Service.metrics][google.api.Service.metrics] section.
              * 
        * * repeated string metrics = 2; @@ -150,12 +162,14 @@ public interface BillingDestinationOrBuilder * @return The count of metrics. */ int getMetricsCount(); + /** * * *
              * Names of the metrics to report to this billing destination.
        -     * Each name must be defined in [Service.metrics][google.api.Service.metrics] section.
        +     * Each name must be defined in
        +     * [Service.metrics][google.api.Service.metrics] section.
              * 
        * * repeated string metrics = 2; @@ -164,12 +178,14 @@ public interface BillingDestinationOrBuilder * @return The metrics at the given index. */ java.lang.String getMetrics(int index); + /** * * *
              * Names of the metrics to report to this billing destination.
        -     * Each name must be defined in [Service.metrics][google.api.Service.metrics] section.
        +     * Each name must be defined in
        +     * [Service.metrics][google.api.Service.metrics] section.
              * 
        * * repeated string metrics = 2; @@ -179,6 +195,7 @@ public interface BillingDestinationOrBuilder */ com.google.protobuf.ByteString getMetricsBytes(int index); } + /** * * @@ -189,30 +206,30 @@ public interface BillingDestinationOrBuilder * * Protobuf type {@code google.api.Billing.BillingDestination} */ - public static final class BillingDestination extends com.google.protobuf.GeneratedMessageV3 + public static final class BillingDestination extends com.google.protobuf.GeneratedMessage implements // @@protoc_insertion_point(message_implements:google.api.Billing.BillingDestination) BillingDestinationOrBuilder { private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "BillingDestination"); + } + // Use BillingDestination.newBuilder() to construct. - private BillingDestination(com.google.protobuf.GeneratedMessageV3.Builder builder) { + private BillingDestination(com.google.protobuf.GeneratedMessage.Builder builder) { super(builder); } private BillingDestination() { monitoredResource_ = ""; - metrics_ = com.google.protobuf.LazyStringArrayList.EMPTY; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new BillingDestination(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; + metrics_ = com.google.protobuf.LazyStringArrayList.emptyList(); } public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { @@ -221,7 +238,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.api.BillingProto .internal_static_google_api_Billing_BillingDestination_fieldAccessorTable @@ -231,13 +248,17 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } public static final int MONITORED_RESOURCE_FIELD_NUMBER = 1; - private volatile java.lang.Object monitoredResource_; + + @SuppressWarnings("serial") + private volatile java.lang.Object monitoredResource_ = ""; + /** * * *
              * The monitored resource type. The type must be defined in
        -     * [Service.monitored_resources][google.api.Service.monitored_resources] section.
        +     * [Service.monitored_resources][google.api.Service.monitored_resources]
        +     * section.
              * 
        * * string monitored_resource = 1; @@ -256,12 +277,14 @@ public java.lang.String getMonitoredResource() { return s; } } + /** * * *
              * The monitored resource type. The type must be defined in
        -     * [Service.monitored_resources][google.api.Service.monitored_resources] section.
        +     * [Service.monitored_resources][google.api.Service.monitored_resources]
        +     * section.
              * 
        * * string monitored_resource = 1; @@ -282,13 +305,18 @@ public com.google.protobuf.ByteString getMonitoredResourceBytes() { } public static final int METRICS_FIELD_NUMBER = 2; - private com.google.protobuf.LazyStringList metrics_; + + @SuppressWarnings("serial") + private com.google.protobuf.LazyStringArrayList metrics_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + /** * * *
              * Names of the metrics to report to this billing destination.
        -     * Each name must be defined in [Service.metrics][google.api.Service.metrics] section.
        +     * Each name must be defined in
        +     * [Service.metrics][google.api.Service.metrics] section.
              * 
        * * repeated string metrics = 2; @@ -298,12 +326,14 @@ public com.google.protobuf.ByteString getMonitoredResourceBytes() { public com.google.protobuf.ProtocolStringList getMetricsList() { return metrics_; } + /** * * *
              * Names of the metrics to report to this billing destination.
        -     * Each name must be defined in [Service.metrics][google.api.Service.metrics] section.
        +     * Each name must be defined in
        +     * [Service.metrics][google.api.Service.metrics] section.
              * 
        * * repeated string metrics = 2; @@ -313,12 +343,14 @@ public com.google.protobuf.ProtocolStringList getMetricsList() { public int getMetricsCount() { return metrics_.size(); } + /** * * *
              * Names of the metrics to report to this billing destination.
        -     * Each name must be defined in [Service.metrics][google.api.Service.metrics] section.
        +     * Each name must be defined in
        +     * [Service.metrics][google.api.Service.metrics] section.
              * 
        * * repeated string metrics = 2; @@ -329,12 +361,14 @@ public int getMetricsCount() { public java.lang.String getMetrics(int index) { return metrics_.get(index); } + /** * * *
              * Names of the metrics to report to this billing destination.
        -     * Each name must be defined in [Service.metrics][google.api.Service.metrics] section.
        +     * Each name must be defined in
        +     * [Service.metrics][google.api.Service.metrics] section.
              * 
        * * repeated string metrics = 2; @@ -360,11 +394,11 @@ public final boolean isInitialized() { @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(monitoredResource_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, monitoredResource_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(monitoredResource_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, monitoredResource_); } for (int i = 0; i < metrics_.size(); i++) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 2, metrics_.getRaw(i)); + com.google.protobuf.GeneratedMessage.writeString(output, 2, metrics_.getRaw(i)); } getUnknownFields().writeTo(output); } @@ -375,8 +409,8 @@ public int getSerializedSize() { if (size != -1) return size; size = 0; - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(monitoredResource_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, monitoredResource_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(monitoredResource_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, monitoredResource_); } { int dataSize = 0; @@ -463,38 +497,38 @@ public static com.google.api.Billing.BillingDestination parseFrom( public static com.google.api.Billing.BillingDestination parseFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); } public static com.google.api.Billing.BillingDestination parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } public static com.google.api.Billing.BillingDestination parseDelimitedFrom( java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); } public static com.google.api.Billing.BillingDestination parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( PARSER, input, extensionRegistry); } public static com.google.api.Billing.BillingDestination parseFrom( com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); } public static com.google.api.Billing.BillingDestination parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } @@ -517,11 +551,11 @@ public Builder toBuilder() { } @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { Builder builder = new Builder(parent); return builder; } + /** * * @@ -532,8 +566,7 @@ protected Builder newBuilderForType( * * Protobuf type {@code google.api.Billing.BillingDestination} */ - public static final class Builder - extends com.google.protobuf.GeneratedMessageV3.Builder + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder implements // @@protoc_insertion_point(builder_implements:google.api.Billing.BillingDestination) com.google.api.Billing.BillingDestinationOrBuilder { @@ -543,7 +576,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.api.BillingProto .internal_static_google_api_Billing_BillingDestination_fieldAccessorTable @@ -555,17 +588,16 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { // Construct using com.google.api.Billing.BillingDestination.newBuilder() private Builder() {} - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { super(parent); } @java.lang.Override public Builder clear() { super.clear(); + bitField0_ = 0; monitoredResource_ = ""; - - metrics_ = com.google.protobuf.LazyStringArrayList.EMPTY; - bitField0_ = (bitField0_ & ~0x00000001); + metrics_ = com.google.protobuf.LazyStringArrayList.emptyList(); return this; } @@ -593,50 +625,22 @@ public com.google.api.Billing.BillingDestination build() { public com.google.api.Billing.BillingDestination buildPartial() { com.google.api.Billing.BillingDestination result = new com.google.api.Billing.BillingDestination(this); - int from_bitField0_ = bitField0_; - result.monitoredResource_ = monitoredResource_; - if (((bitField0_ & 0x00000001) != 0)) { - metrics_ = metrics_.getUnmodifiableView(); - bitField0_ = (bitField0_ & ~0x00000001); + if (bitField0_ != 0) { + buildPartial0(result); } - result.metrics_ = metrics_; 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); + private void buildPartial0(com.google.api.Billing.BillingDestination result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.monitoredResource_ = monitoredResource_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + metrics_.makeImmutable(); + result.metrics_ = metrics_; + } } @java.lang.Override @@ -653,12 +657,13 @@ public Builder mergeFrom(com.google.api.Billing.BillingDestination other) { if (other == com.google.api.Billing.BillingDestination.getDefaultInstance()) return this; if (!other.getMonitoredResource().isEmpty()) { monitoredResource_ = other.monitoredResource_; + bitField0_ |= 0x00000001; onChanged(); } if (!other.metrics_.isEmpty()) { if (metrics_.isEmpty()) { metrics_ = other.metrics_; - bitField0_ = (bitField0_ & ~0x00000001); + bitField0_ |= 0x00000002; } else { ensureMetricsIsMutable(); metrics_.addAll(other.metrics_); @@ -694,7 +699,7 @@ public Builder mergeFrom( case 10: { monitoredResource_ = input.readStringRequireUtf8(); - + bitField0_ |= 0x00000001; break; } // case 10 case 18: @@ -724,12 +729,14 @@ public Builder mergeFrom( private int bitField0_; private java.lang.Object monitoredResource_ = ""; + /** * * *
                * The monitored resource type. The type must be defined in
        -       * [Service.monitored_resources][google.api.Service.monitored_resources] section.
        +       * [Service.monitored_resources][google.api.Service.monitored_resources]
        +       * section.
                * 
        * * string monitored_resource = 1; @@ -747,12 +754,14 @@ public java.lang.String getMonitoredResource() { return (java.lang.String) ref; } } + /** * * *
                * The monitored resource type. The type must be defined in
        -       * [Service.monitored_resources][google.api.Service.monitored_resources] section.
        +       * [Service.monitored_resources][google.api.Service.monitored_resources]
        +       * section.
                * 
        * * string monitored_resource = 1; @@ -770,12 +779,14 @@ public com.google.protobuf.ByteString getMonitoredResourceBytes() { return (com.google.protobuf.ByteString) ref; } } + /** * * *
                * The monitored resource type. The type must be defined in
        -       * [Service.monitored_resources][google.api.Service.monitored_resources] section.
        +       * [Service.monitored_resources][google.api.Service.monitored_resources]
        +       * section.
                * 
        * * string monitored_resource = 1; @@ -787,17 +798,19 @@ public Builder setMonitoredResource(java.lang.String value) { if (value == null) { throw new NullPointerException(); } - monitoredResource_ = value; + bitField0_ |= 0x00000001; onChanged(); return this; } + /** * * *
                * The monitored resource type. The type must be defined in
        -       * [Service.monitored_resources][google.api.Service.monitored_resources] section.
        +       * [Service.monitored_resources][google.api.Service.monitored_resources]
        +       * section.
                * 
        * * string monitored_resource = 1; @@ -805,17 +818,19 @@ public Builder setMonitoredResource(java.lang.String value) { * @return This builder for chaining. */ public Builder clearMonitoredResource() { - monitoredResource_ = getDefaultInstance().getMonitoredResource(); + bitField0_ = (bitField0_ & ~0x00000001); onChanged(); return this; } + /** * * *
                * The monitored resource type. The type must be defined in
        -       * [Service.monitored_resources][google.api.Service.monitored_resources] section.
        +       * [Service.monitored_resources][google.api.Service.monitored_resources]
        +       * section.
                * 
        * * string monitored_resource = 1; @@ -828,27 +843,29 @@ public Builder setMonitoredResourceBytes(com.google.protobuf.ByteString value) { throw new NullPointerException(); } checkByteStringIsUtf8(value); - monitoredResource_ = value; + bitField0_ |= 0x00000001; onChanged(); return this; } - private com.google.protobuf.LazyStringList metrics_ = - com.google.protobuf.LazyStringArrayList.EMPTY; + private com.google.protobuf.LazyStringArrayList metrics_ = + com.google.protobuf.LazyStringArrayList.emptyList(); private void ensureMetricsIsMutable() { - if (!((bitField0_ & 0x00000001) != 0)) { + if (!metrics_.isModifiable()) { metrics_ = new com.google.protobuf.LazyStringArrayList(metrics_); - bitField0_ |= 0x00000001; } + bitField0_ |= 0x00000002; } + /** * * *
                * Names of the metrics to report to this billing destination.
        -       * Each name must be defined in [Service.metrics][google.api.Service.metrics] section.
        +       * Each name must be defined in
        +       * [Service.metrics][google.api.Service.metrics] section.
                * 
        * * repeated string metrics = 2; @@ -856,14 +873,17 @@ private void ensureMetricsIsMutable() { * @return A list containing the metrics. */ public com.google.protobuf.ProtocolStringList getMetricsList() { - return metrics_.getUnmodifiableView(); + metrics_.makeImmutable(); + return metrics_; } + /** * * *
                * Names of the metrics to report to this billing destination.
        -       * Each name must be defined in [Service.metrics][google.api.Service.metrics] section.
        +       * Each name must be defined in
        +       * [Service.metrics][google.api.Service.metrics] section.
                * 
        * * repeated string metrics = 2; @@ -873,12 +893,14 @@ public com.google.protobuf.ProtocolStringList getMetricsList() { public int getMetricsCount() { return metrics_.size(); } + /** * * *
                * Names of the metrics to report to this billing destination.
        -       * Each name must be defined in [Service.metrics][google.api.Service.metrics] section.
        +       * Each name must be defined in
        +       * [Service.metrics][google.api.Service.metrics] section.
                * 
        * * repeated string metrics = 2; @@ -889,12 +911,14 @@ public int getMetricsCount() { public java.lang.String getMetrics(int index) { return metrics_.get(index); } + /** * * *
                * Names of the metrics to report to this billing destination.
        -       * Each name must be defined in [Service.metrics][google.api.Service.metrics] section.
        +       * Each name must be defined in
        +       * [Service.metrics][google.api.Service.metrics] section.
                * 
        * * repeated string metrics = 2; @@ -905,12 +929,14 @@ public java.lang.String getMetrics(int index) { public com.google.protobuf.ByteString getMetricsBytes(int index) { return metrics_.getByteString(index); } + /** * * *
                * Names of the metrics to report to this billing destination.
        -       * Each name must be defined in [Service.metrics][google.api.Service.metrics] section.
        +       * Each name must be defined in
        +       * [Service.metrics][google.api.Service.metrics] section.
                * 
        * * repeated string metrics = 2; @@ -925,15 +951,18 @@ public Builder setMetrics(int index, java.lang.String value) { } ensureMetricsIsMutable(); metrics_.set(index, value); + bitField0_ |= 0x00000002; onChanged(); return this; } + /** * * *
                * Names of the metrics to report to this billing destination.
        -       * Each name must be defined in [Service.metrics][google.api.Service.metrics] section.
        +       * Each name must be defined in
        +       * [Service.metrics][google.api.Service.metrics] section.
                * 
        * * repeated string metrics = 2; @@ -947,15 +976,18 @@ public Builder addMetrics(java.lang.String value) { } ensureMetricsIsMutable(); metrics_.add(value); + bitField0_ |= 0x00000002; onChanged(); return this; } + /** * * *
                * Names of the metrics to report to this billing destination.
        -       * Each name must be defined in [Service.metrics][google.api.Service.metrics] section.
        +       * Each name must be defined in
        +       * [Service.metrics][google.api.Service.metrics] section.
                * 
        * * repeated string metrics = 2; @@ -966,15 +998,18 @@ public Builder addMetrics(java.lang.String value) { public Builder addAllMetrics(java.lang.Iterable values) { ensureMetricsIsMutable(); com.google.protobuf.AbstractMessageLite.Builder.addAll(values, metrics_); + bitField0_ |= 0x00000002; onChanged(); return this; } + /** * * *
                * Names of the metrics to report to this billing destination.
        -       * Each name must be defined in [Service.metrics][google.api.Service.metrics] section.
        +       * Each name must be defined in
        +       * [Service.metrics][google.api.Service.metrics] section.
                * 
        * * repeated string metrics = 2; @@ -982,17 +1017,20 @@ public Builder addAllMetrics(java.lang.Iterable values) { * @return This builder for chaining. */ public Builder clearMetrics() { - metrics_ = com.google.protobuf.LazyStringArrayList.EMPTY; - bitField0_ = (bitField0_ & ~0x00000001); + metrics_ = com.google.protobuf.LazyStringArrayList.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + ; onChanged(); return this; } + /** * * *
                * Names of the metrics to report to this billing destination.
        -       * Each name must be defined in [Service.metrics][google.api.Service.metrics] section.
        +       * Each name must be defined in
        +       * [Service.metrics][google.api.Service.metrics] section.
                * 
        * * repeated string metrics = 2; @@ -1007,22 +1045,11 @@ public Builder addMetricsBytes(com.google.protobuf.ByteString value) { checkByteStringIsUtf8(value); ensureMetricsIsMutable(); metrics_.add(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.api.Billing.BillingDestination) } @@ -1076,7 +1103,10 @@ public com.google.api.Billing.BillingDestination getDefaultInstanceForType() { } public static final int CONSUMER_DESTINATIONS_FIELD_NUMBER = 8; + + @SuppressWarnings("serial") private java.util.List consumerDestinations_; + /** * * @@ -1093,6 +1123,7 @@ public com.google.api.Billing.BillingDestination getDefaultInstanceForType() { public java.util.List getConsumerDestinationsList() { return consumerDestinations_; } + /** * * @@ -1110,6 +1141,7 @@ public java.util.List getConsumerDest getConsumerDestinationsOrBuilderList() { return consumerDestinations_; } + /** * * @@ -1126,6 +1158,7 @@ public java.util.List getConsumerDest public int getConsumerDestinationsCount() { return consumerDestinations_.size(); } + /** * * @@ -1142,6 +1175,7 @@ public int getConsumerDestinationsCount() { public com.google.api.Billing.BillingDestination getConsumerDestinations(int index) { return consumerDestinations_.get(index); } + /** * * @@ -1262,38 +1296,38 @@ public static com.google.api.Billing parseFrom( public static com.google.api.Billing parseFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); } public static com.google.api.Billing parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } public static com.google.api.Billing parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); } public static com.google.api.Billing parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( PARSER, input, extensionRegistry); } public static com.google.api.Billing parseFrom(com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); } public static com.google.api.Billing parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } @@ -1316,48 +1350,52 @@ public Builder toBuilder() { } @java.lang.Override - protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { Builder builder = new Builder(parent); return builder; } + /** * * *
            * Billing related configuration of the service.
        +   *
            * The following example shows how to configure monitored resources and metrics
            * for billing, `consumer_destinations` is the only supported destination and
            * the monitored resources need at least one label key
            * `cloud.googleapis.com/location` to indicate the location of the billing
            * usage, using different monitored resources between monitoring and billing is
            * recommended so they can be evolved independently:
        -   *     monitored_resources:
        -   *     - type: library.googleapis.com/billing_branch
        -   *       labels:
        -   *       - key: cloud.googleapis.com/location
        -   *         description: |
        -   *           Predefined label to support billing location restriction.
        -   *       - key: city
        -   *         description: |
        -   *           Custom label to define the city where the library branch is located
        -   *           in.
        -   *       - key: name
        -   *         description: Custom label to define the name of the library branch.
        -   *     metrics:
        -   *     - name: library.googleapis.com/book/borrowed_count
        -   *       metric_kind: DELTA
        -   *       value_type: INT64
        -   *       unit: "1"
        -   *     billing:
        -   *       consumer_destinations:
        -   *       - monitored_resource: library.googleapis.com/billing_branch
        -   *         metrics:
        -   *         - library.googleapis.com/book/borrowed_count
        +   *
        +   *
        +   * monitored_resources:
        +   * - type: library.googleapis.com/billing_branch
        +   * labels:
        +   * - key: cloud.googleapis.com/location
        +   * description: |
        +   * Predefined label to support billing location restriction.
        +   * - key: city
        +   * description: |
        +   * Custom label to define the city where the library branch is located
        +   * in.
        +   * - key: name
        +   * description: Custom label to define the name of the library branch.
        +   * metrics:
        +   * - name: library.googleapis.com/book/borrowed_count
        +   * metric_kind: DELTA
        +   * value_type: INT64
        +   * unit: "1"
        +   * billing:
        +   * consumer_destinations:
        +   * - monitored_resource: library.googleapis.com/billing_branch
        +   * metrics:
        +   * - library.googleapis.com/book/borrowed_count
            * 
        * * Protobuf type {@code google.api.Billing} */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder implements // @@protoc_insertion_point(builder_implements:google.api.Billing) com.google.api.BillingOrBuilder { @@ -1366,7 +1404,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.api.BillingProto.internal_static_google_api_Billing_fieldAccessorTable .ensureFieldAccessorsInitialized( @@ -1376,13 +1414,14 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { // Construct using com.google.api.Billing.newBuilder() private Builder() {} - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { super(parent); } @java.lang.Override public Builder clear() { super.clear(); + bitField0_ = 0; if (consumerDestinationsBuilder_ == null) { consumerDestinations_ = java.util.Collections.emptyList(); } else { @@ -1415,7 +1454,15 @@ public com.google.api.Billing build() { @java.lang.Override public com.google.api.Billing buildPartial() { com.google.api.Billing result = new com.google.api.Billing(this); - int from_bitField0_ = bitField0_; + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields(com.google.api.Billing result) { if (consumerDestinationsBuilder_ == null) { if (((bitField0_ & 0x00000001) != 0)) { consumerDestinations_ = java.util.Collections.unmodifiableList(consumerDestinations_); @@ -1425,41 +1472,10 @@ public com.google.api.Billing buildPartial() { } else { result.consumerDestinations_ = consumerDestinationsBuilder_.build(); } - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); } - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.setField(field, value); - } - - @java.lang.Override - public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - - @java.lang.Override - public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.addRepeatedField(field, value); + private void buildPartial0(com.google.api.Billing result) { + int from_bitField0_ = bitField0_; } @java.lang.Override @@ -1493,8 +1509,8 @@ public Builder mergeFrom(com.google.api.Billing other) { consumerDestinations_ = other.consumerDestinations_; bitField0_ = (bitField0_ & ~0x00000001); consumerDestinationsBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders - ? getConsumerDestinationsFieldBuilder() + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders + ? internalGetConsumerDestinationsFieldBuilder() : null; } else { consumerDestinationsBuilder_.addAllMessages(other.consumerDestinations_); @@ -1571,7 +1587,7 @@ private void ensureConsumerDestinationsIsMutable() { } } - private com.google.protobuf.RepeatedFieldBuilderV3< + private com.google.protobuf.RepeatedFieldBuilder< com.google.api.Billing.BillingDestination, com.google.api.Billing.BillingDestination.Builder, com.google.api.Billing.BillingDestinationOrBuilder> @@ -1596,6 +1612,7 @@ public java.util.List getConsumerDest return consumerDestinationsBuilder_.getMessageList(); } } + /** * * @@ -1615,6 +1632,7 @@ public int getConsumerDestinationsCount() { return consumerDestinationsBuilder_.getCount(); } } + /** * * @@ -1634,6 +1652,7 @@ public com.google.api.Billing.BillingDestination getConsumerDestinations(int ind return consumerDestinationsBuilder_.getMessage(index); } } + /** * * @@ -1660,6 +1679,7 @@ public Builder setConsumerDestinations( } return this; } + /** * * @@ -1683,6 +1703,7 @@ public Builder setConsumerDestinations( } return this; } + /** * * @@ -1708,6 +1729,7 @@ public Builder addConsumerDestinations(com.google.api.Billing.BillingDestination } return this; } + /** * * @@ -1734,6 +1756,7 @@ public Builder addConsumerDestinations( } return this; } + /** * * @@ -1757,6 +1780,7 @@ public Builder addConsumerDestinations( } return this; } + /** * * @@ -1780,6 +1804,7 @@ public Builder addConsumerDestinations( } return this; } + /** * * @@ -1803,6 +1828,7 @@ public Builder addAllConsumerDestinations( } return this; } + /** * * @@ -1825,6 +1851,7 @@ public Builder clearConsumerDestinations() { } return this; } + /** * * @@ -1847,6 +1874,7 @@ public Builder removeConsumerDestinations(int index) { } return this; } + /** * * @@ -1861,8 +1889,9 @@ public Builder removeConsumerDestinations(int index) { */ public com.google.api.Billing.BillingDestination.Builder getConsumerDestinationsBuilder( int index) { - return getConsumerDestinationsFieldBuilder().getBuilder(index); + return internalGetConsumerDestinationsFieldBuilder().getBuilder(index); } + /** * * @@ -1883,6 +1912,7 @@ public com.google.api.Billing.BillingDestinationOrBuilder getConsumerDestination return consumerDestinationsBuilder_.getMessageOrBuilder(index); } } + /** * * @@ -1903,6 +1933,7 @@ public com.google.api.Billing.BillingDestinationOrBuilder getConsumerDestination return java.util.Collections.unmodifiableList(consumerDestinations_); } } + /** * * @@ -1916,9 +1947,10 @@ public com.google.api.Billing.BillingDestinationOrBuilder getConsumerDestination * repeated .google.api.Billing.BillingDestination consumer_destinations = 8; */ public com.google.api.Billing.BillingDestination.Builder addConsumerDestinationsBuilder() { - return getConsumerDestinationsFieldBuilder() + return internalGetConsumerDestinationsFieldBuilder() .addBuilder(com.google.api.Billing.BillingDestination.getDefaultInstance()); } + /** * * @@ -1933,9 +1965,10 @@ public com.google.api.Billing.BillingDestination.Builder addConsumerDestinations */ public com.google.api.Billing.BillingDestination.Builder addConsumerDestinationsBuilder( int index) { - return getConsumerDestinationsFieldBuilder() + return internalGetConsumerDestinationsFieldBuilder() .addBuilder(index, com.google.api.Billing.BillingDestination.getDefaultInstance()); } + /** * * @@ -1950,17 +1983,17 @@ public com.google.api.Billing.BillingDestination.Builder addConsumerDestinations */ public java.util.List getConsumerDestinationsBuilderList() { - return getConsumerDestinationsFieldBuilder().getBuilderList(); + return internalGetConsumerDestinationsFieldBuilder().getBuilderList(); } - private com.google.protobuf.RepeatedFieldBuilderV3< + private com.google.protobuf.RepeatedFieldBuilder< com.google.api.Billing.BillingDestination, com.google.api.Billing.BillingDestination.Builder, com.google.api.Billing.BillingDestinationOrBuilder> - getConsumerDestinationsFieldBuilder() { + internalGetConsumerDestinationsFieldBuilder() { if (consumerDestinationsBuilder_ == null) { consumerDestinationsBuilder_ = - new com.google.protobuf.RepeatedFieldBuilderV3< + new com.google.protobuf.RepeatedFieldBuilder< com.google.api.Billing.BillingDestination, com.google.api.Billing.BillingDestination.Builder, com.google.api.Billing.BillingDestinationOrBuilder>( @@ -1973,17 +2006,6 @@ public com.google.api.Billing.BillingDestination.Builder addConsumerDestinations return consumerDestinationsBuilder_; } - @java.lang.Override - public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - // @@protoc_insertion_point(builder_scope:google.api.Billing) } diff --git a/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/BillingOrBuilder.java b/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/BillingOrBuilder.java index 2828912e18..d5bf33bbe9 100644 --- a/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/BillingOrBuilder.java +++ b/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/BillingOrBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,10 +14,13 @@ * limitations under the License. */ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: google/api/billing.proto +// Protobuf Java Version: 4.33.2 package com.google.api; +@com.google.protobuf.Generated public interface BillingOrBuilder extends // @@protoc_insertion_point(interface_extends:google.api.Billing) @@ -36,6 +39,7 @@ public interface BillingOrBuilder * repeated .google.api.Billing.BillingDestination consumer_destinations = 8; */ java.util.List getConsumerDestinationsList(); + /** * * @@ -49,6 +53,7 @@ public interface BillingOrBuilder * repeated .google.api.Billing.BillingDestination consumer_destinations = 8; */ com.google.api.Billing.BillingDestination getConsumerDestinations(int index); + /** * * @@ -62,6 +67,7 @@ public interface BillingOrBuilder * repeated .google.api.Billing.BillingDestination consumer_destinations = 8; */ int getConsumerDestinationsCount(); + /** * * @@ -76,6 +82,7 @@ public interface BillingOrBuilder */ java.util.List getConsumerDestinationsOrBuilderList(); + /** * * diff --git a/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/BillingProto.java b/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/BillingProto.java index b03896654d..835823862e 100644 --- a/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/BillingProto.java +++ b/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/BillingProto.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,13 +14,26 @@ * limitations under the License. */ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: google/api/billing.proto +// Protobuf Java Version: 4.33.2 package com.google.api; -public final class BillingProto { +@com.google.protobuf.Generated +public final class BillingProto extends com.google.protobuf.GeneratedFile { private BillingProto() {} + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "BillingProto"); + } + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistryLite registry) {} public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry registry) { @@ -29,11 +42,11 @@ public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry r static final com.google.protobuf.Descriptors.Descriptor internal_static_google_api_Billing_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable internal_static_google_api_Billing_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_google_api_Billing_BillingDestination_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable internal_static_google_api_Billing_BillingDestination_fieldAccessorTable; public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { @@ -56,21 +69,22 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { descriptor = com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( descriptorData, new com.google.protobuf.Descriptors.FileDescriptor[] {}); - internal_static_google_api_Billing_descriptor = getDescriptor().getMessageTypes().get(0); + internal_static_google_api_Billing_descriptor = getDescriptor().getMessageType(0); internal_static_google_api_Billing_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_google_api_Billing_descriptor, new java.lang.String[] { "ConsumerDestinations", }); internal_static_google_api_Billing_BillingDestination_descriptor = - internal_static_google_api_Billing_descriptor.getNestedTypes().get(0); + internal_static_google_api_Billing_descriptor.getNestedType(0); internal_static_google_api_Billing_BillingDestination_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_google_api_Billing_BillingDestination_descriptor, new java.lang.String[] { "MonitoredResource", "Metrics", }); + descriptor.resolveAllFeaturesImmutable(); } // @@protoc_insertion_point(outer_class_scope) diff --git a/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/ChangeType.java b/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/ChangeType.java index e8342671d3..af8d7eb827 100644 --- a/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/ChangeType.java +++ b/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/ChangeType.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,9 @@ * limitations under the License. */ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: google/api/config_change.proto +// Protobuf Java Version: 4.33.2 package com.google.api; @@ -28,6 +30,7 @@ * * Protobuf enum {@code google.api.ChangeType} */ +@com.google.protobuf.Generated public enum ChangeType implements com.google.protobuf.ProtocolMessageEnum { /** * @@ -75,6 +78,16 @@ public enum ChangeType implements com.google.protobuf.ProtocolMessageEnum { UNRECOGNIZED(-1), ; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "ChangeType"); + } + /** * * @@ -85,6 +98,7 @@ public enum ChangeType implements com.google.protobuf.ProtocolMessageEnum { * CHANGE_TYPE_UNSPECIFIED = 0; */ public static final int CHANGE_TYPE_UNSPECIFIED_VALUE = 0; + /** * * @@ -96,6 +110,7 @@ public enum ChangeType implements com.google.protobuf.ProtocolMessageEnum { * ADDED = 1; */ public static final int ADDED_VALUE = 1; + /** * * @@ -107,6 +122,7 @@ public enum ChangeType implements com.google.protobuf.ProtocolMessageEnum { * REMOVED = 2; */ public static final int REMOVED_VALUE = 2; + /** * * @@ -179,7 +195,7 @@ public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType return getDescriptor(); } - public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + public static com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { return com.google.api.ConfigChangeProto.getDescriptor().getEnumTypes().get(0); } diff --git a/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/ClientLibraryDestination.java b/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/ClientLibraryDestination.java index 77b7122ab1..c276f50a47 100644 --- a/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/ClientLibraryDestination.java +++ b/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/ClientLibraryDestination.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,9 @@ * limitations under the License. */ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: google/api/client.proto +// Protobuf Java Version: 4.33.2 package com.google.api; @@ -27,6 +29,7 @@ * * Protobuf enum {@code google.api.ClientLibraryDestination} */ +@com.google.protobuf.Generated public enum ClientLibraryDestination implements com.google.protobuf.ProtocolMessageEnum { /** * @@ -63,6 +66,16 @@ public enum ClientLibraryDestination implements com.google.protobuf.ProtocolMess UNRECOGNIZED(-1), ; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "ClientLibraryDestination"); + } + /** * * @@ -74,6 +87,7 @@ public enum ClientLibraryDestination implements com.google.protobuf.ProtocolMess * CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0; */ public static final int CLIENT_LIBRARY_DESTINATION_UNSPECIFIED_VALUE = 0; + /** * * @@ -85,6 +99,7 @@ public enum ClientLibraryDestination implements com.google.protobuf.ProtocolMess * GITHUB = 10; */ public static final int GITHUB_VALUE = 10; + /** * * @@ -156,7 +171,7 @@ public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType return getDescriptor(); } - public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + public static com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { return com.google.api.ClientProto.getDescriptor().getEnumTypes().get(1); } diff --git a/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/ClientLibraryOrganization.java b/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/ClientLibraryOrganization.java index 57545e2131..3d20982c68 100644 --- a/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/ClientLibraryOrganization.java +++ b/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/ClientLibraryOrganization.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,9 @@ * limitations under the License. */ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: google/api/client.proto +// Protobuf Java Version: 4.33.2 package com.google.api; @@ -28,6 +30,7 @@ * * Protobuf enum {@code google.api.ClientLibraryOrganization} */ +@com.google.protobuf.Generated public enum ClientLibraryOrganization implements com.google.protobuf.ProtocolMessageEnum { /** * @@ -79,9 +82,49 @@ public enum ClientLibraryOrganization implements com.google.protobuf.ProtocolMes * STREET_VIEW = 4; */ STREET_VIEW(4), + /** + * + * + *
        +   * Shopping Org.
        +   * 
        + * + * SHOPPING = 5; + */ + SHOPPING(5), + /** + * + * + *
        +   * Geo Org.
        +   * 
        + * + * GEO = 6; + */ + GEO(6), + /** + * + * + *
        +   * Generative AI - https://developers.generativeai.google
        +   * 
        + * + * GENERATIVE_AI = 7; + */ + GENERATIVE_AI(7), UNRECOGNIZED(-1), ; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "ClientLibraryOrganization"); + } + /** * * @@ -92,6 +135,7 @@ public enum ClientLibraryOrganization implements com.google.protobuf.ProtocolMes * CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0; */ public static final int CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED_VALUE = 0; + /** * * @@ -102,6 +146,7 @@ public enum ClientLibraryOrganization implements com.google.protobuf.ProtocolMes * CLOUD = 1; */ public static final int CLOUD_VALUE = 1; + /** * * @@ -112,6 +157,7 @@ public enum ClientLibraryOrganization implements com.google.protobuf.ProtocolMes * ADS = 2; */ public static final int ADS_VALUE = 2; + /** * * @@ -122,6 +168,7 @@ public enum ClientLibraryOrganization implements com.google.protobuf.ProtocolMes * PHOTOS = 3; */ public static final int PHOTOS_VALUE = 3; + /** * * @@ -133,6 +180,39 @@ public enum ClientLibraryOrganization implements com.google.protobuf.ProtocolMes */ public static final int STREET_VIEW_VALUE = 4; + /** + * + * + *
        +   * Shopping Org.
        +   * 
        + * + * SHOPPING = 5; + */ + public static final int SHOPPING_VALUE = 5; + + /** + * + * + *
        +   * Geo Org.
        +   * 
        + * + * GEO = 6; + */ + public static final int GEO_VALUE = 6; + + /** + * + * + *
        +   * Generative AI - https://developers.generativeai.google
        +   * 
        + * + * GENERATIVE_AI = 7; + */ + public static final int GENERATIVE_AI_VALUE = 7; + public final int getNumber() { if (this == UNRECOGNIZED) { throw new java.lang.IllegalArgumentException( @@ -167,6 +247,12 @@ public static ClientLibraryOrganization forNumber(int value) { return PHOTOS; case 4: return STREET_VIEW; + case 5: + return SHOPPING; + case 6: + return GEO; + case 7: + return GENERATIVE_AI; default: return null; } @@ -197,7 +283,7 @@ public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType return getDescriptor(); } - public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + public static com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { return com.google.api.ClientProto.getDescriptor().getEnumTypes().get(0); } diff --git a/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/ClientLibrarySettings.java b/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/ClientLibrarySettings.java index eb90369fb0..ea63b7f72d 100644 --- a/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/ClientLibrarySettings.java +++ b/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/ClientLibrarySettings.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,9 @@ * limitations under the License. */ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: google/api/client.proto +// Protobuf Java Version: 4.33.2 package com.google.api; @@ -27,13 +29,25 @@ * * Protobuf type {@code google.api.ClientLibrarySettings} */ -public final class ClientLibrarySettings extends com.google.protobuf.GeneratedMessageV3 +@com.google.protobuf.Generated +public final class ClientLibrarySettings extends com.google.protobuf.GeneratedMessage implements // @@protoc_insertion_point(message_implements:google.api.ClientLibrarySettings) ClientLibrarySettingsOrBuilder { private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "ClientLibrarySettings"); + } + // Use ClientLibrarySettings.newBuilder() to construct. - private ClientLibrarySettings(com.google.protobuf.GeneratedMessageV3.Builder builder) { + private ClientLibrarySettings(com.google.protobuf.GeneratedMessage.Builder builder) { super(builder); } @@ -42,23 +56,12 @@ private ClientLibrarySettings() { launchStage_ = 0; } - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new ClientLibrarySettings(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.api.ClientProto.internal_static_google_api_ClientLibrarySettings_descriptor; } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.api.ClientProto .internal_static_google_api_ClientLibrarySettings_fieldAccessorTable @@ -67,13 +70,19 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { com.google.api.ClientLibrarySettings.Builder.class); } + private int bitField0_; public static final int VERSION_FIELD_NUMBER = 1; - private volatile java.lang.Object version_; + + @SuppressWarnings("serial") + private volatile java.lang.Object version_ = ""; + /** * * *
        -   * Version of the API to apply these settings to.
        +   * Version of the API to apply these settings to. This is the full protobuf
        +   * package for the API, ending in the version element.
        +   * Examples: "google.cloud.speech.v1" and "google.spanner.admin.database.v1".
            * 
        * * string version = 1; @@ -92,11 +101,14 @@ public java.lang.String getVersion() { return s; } } + /** * * *
        -   * Version of the API to apply these settings to.
        +   * Version of the API to apply these settings to. This is the full protobuf
        +   * package for the API, ending in the version element.
        +   * Examples: "google.cloud.speech.v1" and "google.spanner.admin.database.v1".
            * 
        * * string version = 1; @@ -117,7 +129,8 @@ public com.google.protobuf.ByteString getVersionBytes() { } public static final int LAUNCH_STAGE_FIELD_NUMBER = 2; - private int launchStage_; + private int launchStage_ = 0; + /** * * @@ -133,6 +146,7 @@ public com.google.protobuf.ByteString getVersionBytes() { public int getLaunchStageValue() { return launchStage_; } + /** * * @@ -146,13 +160,13 @@ public int getLaunchStageValue() { */ @java.lang.Override public com.google.api.LaunchStage getLaunchStage() { - @SuppressWarnings("deprecation") - com.google.api.LaunchStage result = com.google.api.LaunchStage.valueOf(launchStage_); + com.google.api.LaunchStage result = com.google.api.LaunchStage.forNumber(launchStage_); return result == null ? com.google.api.LaunchStage.UNRECOGNIZED : result; } public static final int REST_NUMERIC_ENUMS_FIELD_NUMBER = 3; - private boolean restNumericEnums_; + private boolean restNumericEnums_ = false; + /** * * @@ -172,6 +186,7 @@ public boolean getRestNumericEnums() { public static final int JAVA_SETTINGS_FIELD_NUMBER = 21; private com.google.api.JavaSettings javaSettings_; + /** * * @@ -185,8 +200,9 @@ public boolean getRestNumericEnums() { */ @java.lang.Override public boolean hasJavaSettings() { - return javaSettings_ != null; + return ((bitField0_ & 0x00000001) != 0); } + /** * * @@ -202,6 +218,7 @@ public boolean hasJavaSettings() { public com.google.api.JavaSettings getJavaSettings() { return javaSettings_ == null ? com.google.api.JavaSettings.getDefaultInstance() : javaSettings_; } + /** * * @@ -213,11 +230,12 @@ public com.google.api.JavaSettings getJavaSettings() { */ @java.lang.Override public com.google.api.JavaSettingsOrBuilder getJavaSettingsOrBuilder() { - return getJavaSettings(); + return javaSettings_ == null ? com.google.api.JavaSettings.getDefaultInstance() : javaSettings_; } public static final int CPP_SETTINGS_FIELD_NUMBER = 22; private com.google.api.CppSettings cppSettings_; + /** * * @@ -231,8 +249,9 @@ public com.google.api.JavaSettingsOrBuilder getJavaSettingsOrBuilder() { */ @java.lang.Override public boolean hasCppSettings() { - return cppSettings_ != null; + return ((bitField0_ & 0x00000002) != 0); } + /** * * @@ -248,6 +267,7 @@ public boolean hasCppSettings() { public com.google.api.CppSettings getCppSettings() { return cppSettings_ == null ? com.google.api.CppSettings.getDefaultInstance() : cppSettings_; } + /** * * @@ -259,11 +279,12 @@ public com.google.api.CppSettings getCppSettings() { */ @java.lang.Override public com.google.api.CppSettingsOrBuilder getCppSettingsOrBuilder() { - return getCppSettings(); + return cppSettings_ == null ? com.google.api.CppSettings.getDefaultInstance() : cppSettings_; } public static final int PHP_SETTINGS_FIELD_NUMBER = 23; private com.google.api.PhpSettings phpSettings_; + /** * * @@ -277,8 +298,9 @@ public com.google.api.CppSettingsOrBuilder getCppSettingsOrBuilder() { */ @java.lang.Override public boolean hasPhpSettings() { - return phpSettings_ != null; + return ((bitField0_ & 0x00000004) != 0); } + /** * * @@ -294,6 +316,7 @@ public boolean hasPhpSettings() { public com.google.api.PhpSettings getPhpSettings() { return phpSettings_ == null ? com.google.api.PhpSettings.getDefaultInstance() : phpSettings_; } + /** * * @@ -305,11 +328,12 @@ public com.google.api.PhpSettings getPhpSettings() { */ @java.lang.Override public com.google.api.PhpSettingsOrBuilder getPhpSettingsOrBuilder() { - return getPhpSettings(); + return phpSettings_ == null ? com.google.api.PhpSettings.getDefaultInstance() : phpSettings_; } public static final int PYTHON_SETTINGS_FIELD_NUMBER = 24; private com.google.api.PythonSettings pythonSettings_; + /** * * @@ -323,8 +347,9 @@ public com.google.api.PhpSettingsOrBuilder getPhpSettingsOrBuilder() { */ @java.lang.Override public boolean hasPythonSettings() { - return pythonSettings_ != null; + return ((bitField0_ & 0x00000008) != 0); } + /** * * @@ -342,6 +367,7 @@ public com.google.api.PythonSettings getPythonSettings() { ? com.google.api.PythonSettings.getDefaultInstance() : pythonSettings_; } + /** * * @@ -353,11 +379,14 @@ public com.google.api.PythonSettings getPythonSettings() { */ @java.lang.Override public com.google.api.PythonSettingsOrBuilder getPythonSettingsOrBuilder() { - return getPythonSettings(); + return pythonSettings_ == null + ? com.google.api.PythonSettings.getDefaultInstance() + : pythonSettings_; } public static final int NODE_SETTINGS_FIELD_NUMBER = 25; private com.google.api.NodeSettings nodeSettings_; + /** * * @@ -371,8 +400,9 @@ public com.google.api.PythonSettingsOrBuilder getPythonSettingsOrBuilder() { */ @java.lang.Override public boolean hasNodeSettings() { - return nodeSettings_ != null; + return ((bitField0_ & 0x00000010) != 0); } + /** * * @@ -388,6 +418,7 @@ public boolean hasNodeSettings() { public com.google.api.NodeSettings getNodeSettings() { return nodeSettings_ == null ? com.google.api.NodeSettings.getDefaultInstance() : nodeSettings_; } + /** * * @@ -399,11 +430,12 @@ public com.google.api.NodeSettings getNodeSettings() { */ @java.lang.Override public com.google.api.NodeSettingsOrBuilder getNodeSettingsOrBuilder() { - return getNodeSettings(); + return nodeSettings_ == null ? com.google.api.NodeSettings.getDefaultInstance() : nodeSettings_; } public static final int DOTNET_SETTINGS_FIELD_NUMBER = 26; private com.google.api.DotnetSettings dotnetSettings_; + /** * * @@ -417,8 +449,9 @@ public com.google.api.NodeSettingsOrBuilder getNodeSettingsOrBuilder() { */ @java.lang.Override public boolean hasDotnetSettings() { - return dotnetSettings_ != null; + return ((bitField0_ & 0x00000020) != 0); } + /** * * @@ -436,6 +469,7 @@ public com.google.api.DotnetSettings getDotnetSettings() { ? com.google.api.DotnetSettings.getDefaultInstance() : dotnetSettings_; } + /** * * @@ -447,11 +481,14 @@ public com.google.api.DotnetSettings getDotnetSettings() { */ @java.lang.Override public com.google.api.DotnetSettingsOrBuilder getDotnetSettingsOrBuilder() { - return getDotnetSettings(); + return dotnetSettings_ == null + ? com.google.api.DotnetSettings.getDefaultInstance() + : dotnetSettings_; } public static final int RUBY_SETTINGS_FIELD_NUMBER = 27; private com.google.api.RubySettings rubySettings_; + /** * * @@ -465,8 +502,9 @@ public com.google.api.DotnetSettingsOrBuilder getDotnetSettingsOrBuilder() { */ @java.lang.Override public boolean hasRubySettings() { - return rubySettings_ != null; + return ((bitField0_ & 0x00000040) != 0); } + /** * * @@ -482,6 +520,7 @@ public boolean hasRubySettings() { public com.google.api.RubySettings getRubySettings() { return rubySettings_ == null ? com.google.api.RubySettings.getDefaultInstance() : rubySettings_; } + /** * * @@ -493,11 +532,12 @@ public com.google.api.RubySettings getRubySettings() { */ @java.lang.Override public com.google.api.RubySettingsOrBuilder getRubySettingsOrBuilder() { - return getRubySettings(); + return rubySettings_ == null ? com.google.api.RubySettings.getDefaultInstance() : rubySettings_; } public static final int GO_SETTINGS_FIELD_NUMBER = 28; private com.google.api.GoSettings goSettings_; + /** * * @@ -511,8 +551,9 @@ public com.google.api.RubySettingsOrBuilder getRubySettingsOrBuilder() { */ @java.lang.Override public boolean hasGoSettings() { - return goSettings_ != null; + return ((bitField0_ & 0x00000080) != 0); } + /** * * @@ -528,6 +569,7 @@ public boolean hasGoSettings() { public com.google.api.GoSettings getGoSettings() { return goSettings_ == null ? com.google.api.GoSettings.getDefaultInstance() : goSettings_; } + /** * * @@ -539,7 +581,7 @@ public com.google.api.GoSettings getGoSettings() { */ @java.lang.Override public com.google.api.GoSettingsOrBuilder getGoSettingsOrBuilder() { - return getGoSettings(); + return goSettings_ == null ? com.google.api.GoSettings.getDefaultInstance() : goSettings_; } private byte memoizedIsInitialized = -1; @@ -556,8 +598,8 @@ public final boolean isInitialized() { @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(version_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, version_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(version_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, version_); } if (launchStage_ != com.google.api.LaunchStage.LAUNCH_STAGE_UNSPECIFIED.getNumber()) { output.writeEnum(2, launchStage_); @@ -565,28 +607,28 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (restNumericEnums_ != false) { output.writeBool(3, restNumericEnums_); } - if (javaSettings_ != null) { + if (((bitField0_ & 0x00000001) != 0)) { output.writeMessage(21, getJavaSettings()); } - if (cppSettings_ != null) { + if (((bitField0_ & 0x00000002) != 0)) { output.writeMessage(22, getCppSettings()); } - if (phpSettings_ != null) { + if (((bitField0_ & 0x00000004) != 0)) { output.writeMessage(23, getPhpSettings()); } - if (pythonSettings_ != null) { + if (((bitField0_ & 0x00000008) != 0)) { output.writeMessage(24, getPythonSettings()); } - if (nodeSettings_ != null) { + if (((bitField0_ & 0x00000010) != 0)) { output.writeMessage(25, getNodeSettings()); } - if (dotnetSettings_ != null) { + if (((bitField0_ & 0x00000020) != 0)) { output.writeMessage(26, getDotnetSettings()); } - if (rubySettings_ != null) { + if (((bitField0_ & 0x00000040) != 0)) { output.writeMessage(27, getRubySettings()); } - if (goSettings_ != null) { + if (((bitField0_ & 0x00000080) != 0)) { output.writeMessage(28, getGoSettings()); } getUnknownFields().writeTo(output); @@ -598,8 +640,8 @@ public int getSerializedSize() { if (size != -1) return size; size = 0; - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(version_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, version_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(version_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, version_); } if (launchStage_ != com.google.api.LaunchStage.LAUNCH_STAGE_UNSPECIFIED.getNumber()) { size += com.google.protobuf.CodedOutputStream.computeEnumSize(2, launchStage_); @@ -607,28 +649,28 @@ public int getSerializedSize() { if (restNumericEnums_ != false) { size += com.google.protobuf.CodedOutputStream.computeBoolSize(3, restNumericEnums_); } - if (javaSettings_ != null) { + if (((bitField0_ & 0x00000001) != 0)) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(21, getJavaSettings()); } - if (cppSettings_ != null) { + if (((bitField0_ & 0x00000002) != 0)) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(22, getCppSettings()); } - if (phpSettings_ != null) { + if (((bitField0_ & 0x00000004) != 0)) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(23, getPhpSettings()); } - if (pythonSettings_ != null) { + if (((bitField0_ & 0x00000008) != 0)) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(24, getPythonSettings()); } - if (nodeSettings_ != null) { + if (((bitField0_ & 0x00000010) != 0)) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(25, getNodeSettings()); } - if (dotnetSettings_ != null) { + if (((bitField0_ & 0x00000020) != 0)) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(26, getDotnetSettings()); } - if (rubySettings_ != null) { + if (((bitField0_ & 0x00000040) != 0)) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(27, getRubySettings()); } - if (goSettings_ != null) { + if (((bitField0_ & 0x00000080) != 0)) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(28, getGoSettings()); } size += getUnknownFields().getSerializedSize(); @@ -771,38 +813,38 @@ public static com.google.api.ClientLibrarySettings parseFrom( public static com.google.api.ClientLibrarySettings parseFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); } public static com.google.api.ClientLibrarySettings parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } public static com.google.api.ClientLibrarySettings parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); } public static com.google.api.ClientLibrarySettings parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( PARSER, input, extensionRegistry); } public static com.google.api.ClientLibrarySettings parseFrom( com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); } public static com.google.api.ClientLibrarySettings parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } @@ -825,10 +867,11 @@ public Builder toBuilder() { } @java.lang.Override - protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { Builder builder = new Builder(parent); return builder; } + /** * * @@ -838,7 +881,7 @@ protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.Build * * Protobuf type {@code google.api.ClientLibrarySettings} */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder implements // @@protoc_insertion_point(builder_implements:google.api.ClientLibrarySettings) com.google.api.ClientLibrarySettingsOrBuilder { @@ -847,7 +890,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.api.ClientProto .internal_static_google_api_ClientLibrarySettings_fieldAccessorTable @@ -857,67 +900,73 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } // Construct using com.google.api.ClientLibrarySettings.newBuilder() - private Builder() {} + private Builder() { + maybeForceBuilderInitialization(); + } - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetJavaSettingsFieldBuilder(); + internalGetCppSettingsFieldBuilder(); + internalGetPhpSettingsFieldBuilder(); + internalGetPythonSettingsFieldBuilder(); + internalGetNodeSettingsFieldBuilder(); + internalGetDotnetSettingsFieldBuilder(); + internalGetRubySettingsFieldBuilder(); + internalGetGoSettingsFieldBuilder(); + } } @java.lang.Override public Builder clear() { super.clear(); + bitField0_ = 0; version_ = ""; - launchStage_ = 0; - restNumericEnums_ = false; - - if (javaSettingsBuilder_ == null) { - javaSettings_ = null; - } else { - javaSettings_ = null; + javaSettings_ = null; + if (javaSettingsBuilder_ != null) { + javaSettingsBuilder_.dispose(); javaSettingsBuilder_ = null; } - if (cppSettingsBuilder_ == null) { - cppSettings_ = null; - } else { - cppSettings_ = null; + cppSettings_ = null; + if (cppSettingsBuilder_ != null) { + cppSettingsBuilder_.dispose(); cppSettingsBuilder_ = null; } - if (phpSettingsBuilder_ == null) { - phpSettings_ = null; - } else { - phpSettings_ = null; + phpSettings_ = null; + if (phpSettingsBuilder_ != null) { + phpSettingsBuilder_.dispose(); phpSettingsBuilder_ = null; } - if (pythonSettingsBuilder_ == null) { - pythonSettings_ = null; - } else { - pythonSettings_ = null; + pythonSettings_ = null; + if (pythonSettingsBuilder_ != null) { + pythonSettingsBuilder_.dispose(); pythonSettingsBuilder_ = null; } - if (nodeSettingsBuilder_ == null) { - nodeSettings_ = null; - } else { - nodeSettings_ = null; + nodeSettings_ = null; + if (nodeSettingsBuilder_ != null) { + nodeSettingsBuilder_.dispose(); nodeSettingsBuilder_ = null; } - if (dotnetSettingsBuilder_ == null) { - dotnetSettings_ = null; - } else { - dotnetSettings_ = null; + dotnetSettings_ = null; + if (dotnetSettingsBuilder_ != null) { + dotnetSettingsBuilder_.dispose(); dotnetSettingsBuilder_ = null; } - if (rubySettingsBuilder_ == null) { - rubySettings_ = null; - } else { - rubySettings_ = null; + rubySettings_ = null; + if (rubySettingsBuilder_ != null) { + rubySettingsBuilder_.dispose(); rubySettingsBuilder_ = null; } - if (goSettingsBuilder_ == null) { - goSettings_ = null; - } else { - goSettings_ = null; + goSettings_ = null; + if (goSettingsBuilder_ != null) { + goSettingsBuilder_.dispose(); goSettingsBuilder_ = null; } return this; @@ -945,84 +994,65 @@ public com.google.api.ClientLibrarySettings build() { @java.lang.Override public com.google.api.ClientLibrarySettings buildPartial() { com.google.api.ClientLibrarySettings result = new com.google.api.ClientLibrarySettings(this); - result.version_ = version_; - result.launchStage_ = launchStage_; - result.restNumericEnums_ = restNumericEnums_; - if (javaSettingsBuilder_ == null) { - result.javaSettings_ = javaSettings_; - } else { - result.javaSettings_ = javaSettingsBuilder_.build(); + if (bitField0_ != 0) { + buildPartial0(result); } - if (cppSettingsBuilder_ == null) { - result.cppSettings_ = cppSettings_; - } else { - result.cppSettings_ = cppSettingsBuilder_.build(); + onBuilt(); + return result; + } + + private void buildPartial0(com.google.api.ClientLibrarySettings result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.version_ = version_; } - if (phpSettingsBuilder_ == null) { - result.phpSettings_ = phpSettings_; - } else { - result.phpSettings_ = phpSettingsBuilder_.build(); + if (((from_bitField0_ & 0x00000002) != 0)) { + result.launchStage_ = launchStage_; } - if (pythonSettingsBuilder_ == null) { - result.pythonSettings_ = pythonSettings_; - } else { - result.pythonSettings_ = pythonSettingsBuilder_.build(); + if (((from_bitField0_ & 0x00000004) != 0)) { + result.restNumericEnums_ = restNumericEnums_; } - if (nodeSettingsBuilder_ == null) { - result.nodeSettings_ = nodeSettings_; - } else { - result.nodeSettings_ = nodeSettingsBuilder_.build(); + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000008) != 0)) { + result.javaSettings_ = + javaSettingsBuilder_ == null ? javaSettings_ : javaSettingsBuilder_.build(); + to_bitField0_ |= 0x00000001; } - if (dotnetSettingsBuilder_ == null) { - result.dotnetSettings_ = dotnetSettings_; - } else { - result.dotnetSettings_ = dotnetSettingsBuilder_.build(); + if (((from_bitField0_ & 0x00000010) != 0)) { + result.cppSettings_ = + cppSettingsBuilder_ == null ? cppSettings_ : cppSettingsBuilder_.build(); + to_bitField0_ |= 0x00000002; } - if (rubySettingsBuilder_ == null) { - result.rubySettings_ = rubySettings_; - } else { - result.rubySettings_ = rubySettingsBuilder_.build(); + if (((from_bitField0_ & 0x00000020) != 0)) { + result.phpSettings_ = + phpSettingsBuilder_ == null ? phpSettings_ : phpSettingsBuilder_.build(); + to_bitField0_ |= 0x00000004; } - if (goSettingsBuilder_ == null) { - result.goSettings_ = goSettings_; - } else { - result.goSettings_ = goSettingsBuilder_.build(); + if (((from_bitField0_ & 0x00000040) != 0)) { + result.pythonSettings_ = + pythonSettingsBuilder_ == null ? pythonSettings_ : pythonSettingsBuilder_.build(); + to_bitField0_ |= 0x00000008; } - 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); + if (((from_bitField0_ & 0x00000080) != 0)) { + result.nodeSettings_ = + nodeSettingsBuilder_ == null ? nodeSettings_ : nodeSettingsBuilder_.build(); + to_bitField0_ |= 0x00000010; + } + if (((from_bitField0_ & 0x00000100) != 0)) { + result.dotnetSettings_ = + dotnetSettingsBuilder_ == null ? dotnetSettings_ : dotnetSettingsBuilder_.build(); + to_bitField0_ |= 0x00000020; + } + if (((from_bitField0_ & 0x00000200) != 0)) { + result.rubySettings_ = + rubySettingsBuilder_ == null ? rubySettings_ : rubySettingsBuilder_.build(); + to_bitField0_ |= 0x00000040; + } + if (((from_bitField0_ & 0x00000400) != 0)) { + result.goSettings_ = goSettingsBuilder_ == null ? goSettings_ : goSettingsBuilder_.build(); + to_bitField0_ |= 0x00000080; + } + result.bitField0_ |= to_bitField0_; } @java.lang.Override @@ -1039,6 +1069,7 @@ public Builder mergeFrom(com.google.api.ClientLibrarySettings other) { if (other == com.google.api.ClientLibrarySettings.getDefaultInstance()) return this; if (!other.getVersion().isEmpty()) { version_ = other.version_; + bitField0_ |= 0x00000001; onChanged(); } if (other.launchStage_ != 0) { @@ -1100,67 +1131,75 @@ public Builder mergeFrom( case 10: { version_ = input.readStringRequireUtf8(); - + bitField0_ |= 0x00000001; break; } // case 10 case 16: { launchStage_ = input.readEnum(); - + bitField0_ |= 0x00000002; break; } // case 16 case 24: { restNumericEnums_ = input.readBool(); - + bitField0_ |= 0x00000004; break; } // case 24 case 170: { - input.readMessage(getJavaSettingsFieldBuilder().getBuilder(), extensionRegistry); - + input.readMessage( + internalGetJavaSettingsFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000008; break; } // case 170 case 178: { - input.readMessage(getCppSettingsFieldBuilder().getBuilder(), extensionRegistry); - + input.readMessage( + internalGetCppSettingsFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000010; break; } // case 178 case 186: { - input.readMessage(getPhpSettingsFieldBuilder().getBuilder(), extensionRegistry); - + input.readMessage( + internalGetPhpSettingsFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000020; break; } // case 186 case 194: { - input.readMessage(getPythonSettingsFieldBuilder().getBuilder(), extensionRegistry); - + input.readMessage( + internalGetPythonSettingsFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000040; break; } // case 194 case 202: { - input.readMessage(getNodeSettingsFieldBuilder().getBuilder(), extensionRegistry); - + input.readMessage( + internalGetNodeSettingsFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000080; break; } // case 202 case 210: { - input.readMessage(getDotnetSettingsFieldBuilder().getBuilder(), extensionRegistry); - + input.readMessage( + internalGetDotnetSettingsFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000100; break; } // case 210 case 218: { - input.readMessage(getRubySettingsFieldBuilder().getBuilder(), extensionRegistry); - + input.readMessage( + internalGetRubySettingsFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000200; break; } // case 218 case 226: { - input.readMessage(getGoSettingsFieldBuilder().getBuilder(), extensionRegistry); - + input.readMessage( + internalGetGoSettingsFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000400; break; } // case 226 default: @@ -1180,12 +1219,17 @@ public Builder mergeFrom( return this; } + private int bitField0_; + private java.lang.Object version_ = ""; + /** * * *
        -     * Version of the API to apply these settings to.
        +     * Version of the API to apply these settings to. This is the full protobuf
        +     * package for the API, ending in the version element.
        +     * Examples: "google.cloud.speech.v1" and "google.spanner.admin.database.v1".
              * 
        * * string version = 1; @@ -1203,11 +1247,14 @@ public java.lang.String getVersion() { return (java.lang.String) ref; } } + /** * * *
        -     * Version of the API to apply these settings to.
        +     * Version of the API to apply these settings to. This is the full protobuf
        +     * package for the API, ending in the version element.
        +     * Examples: "google.cloud.speech.v1" and "google.spanner.admin.database.v1".
              * 
        * * string version = 1; @@ -1225,11 +1272,14 @@ public com.google.protobuf.ByteString getVersionBytes() { return (com.google.protobuf.ByteString) ref; } } + /** * * *
        -     * Version of the API to apply these settings to.
        +     * Version of the API to apply these settings to. This is the full protobuf
        +     * package for the API, ending in the version element.
        +     * Examples: "google.cloud.speech.v1" and "google.spanner.admin.database.v1".
              * 
        * * string version = 1; @@ -1241,16 +1291,19 @@ public Builder setVersion(java.lang.String value) { if (value == null) { throw new NullPointerException(); } - version_ = value; + bitField0_ |= 0x00000001; onChanged(); return this; } + /** * * *
        -     * Version of the API to apply these settings to.
        +     * Version of the API to apply these settings to. This is the full protobuf
        +     * package for the API, ending in the version element.
        +     * Examples: "google.cloud.speech.v1" and "google.spanner.admin.database.v1".
              * 
        * * string version = 1; @@ -1258,16 +1311,19 @@ public Builder setVersion(java.lang.String value) { * @return This builder for chaining. */ public Builder clearVersion() { - version_ = getDefaultInstance().getVersion(); + bitField0_ = (bitField0_ & ~0x00000001); onChanged(); return this; } + /** * * *
        -     * Version of the API to apply these settings to.
        +     * Version of the API to apply these settings to. This is the full protobuf
        +     * package for the API, ending in the version element.
        +     * Examples: "google.cloud.speech.v1" and "google.spanner.admin.database.v1".
              * 
        * * string version = 1; @@ -1280,13 +1336,14 @@ public Builder setVersionBytes(com.google.protobuf.ByteString value) { throw new NullPointerException(); } checkByteStringIsUtf8(value); - version_ = value; + bitField0_ |= 0x00000001; onChanged(); return this; } private int launchStage_ = 0; + /** * * @@ -1302,6 +1359,7 @@ public Builder setVersionBytes(com.google.protobuf.ByteString value) { public int getLaunchStageValue() { return launchStage_; } + /** * * @@ -1315,11 +1373,12 @@ public int getLaunchStageValue() { * @return This builder for chaining. */ public Builder setLaunchStageValue(int value) { - launchStage_ = value; + bitField0_ |= 0x00000002; onChanged(); return this; } + /** * * @@ -1333,10 +1392,10 @@ public Builder setLaunchStageValue(int value) { */ @java.lang.Override public com.google.api.LaunchStage getLaunchStage() { - @SuppressWarnings("deprecation") - com.google.api.LaunchStage result = com.google.api.LaunchStage.valueOf(launchStage_); + com.google.api.LaunchStage result = com.google.api.LaunchStage.forNumber(launchStage_); return result == null ? com.google.api.LaunchStage.UNRECOGNIZED : result; } + /** * * @@ -1353,11 +1412,12 @@ public Builder setLaunchStage(com.google.api.LaunchStage value) { if (value == null) { throw new NullPointerException(); } - + bitField0_ |= 0x00000002; launchStage_ = value.getNumber(); onChanged(); return this; } + /** * * @@ -1370,13 +1430,14 @@ public Builder setLaunchStage(com.google.api.LaunchStage value) { * @return This builder for chaining. */ public Builder clearLaunchStage() { - + bitField0_ = (bitField0_ & ~0x00000002); launchStage_ = 0; onChanged(); return this; } private boolean restNumericEnums_; + /** * * @@ -1393,6 +1454,7 @@ public Builder clearLaunchStage() { public boolean getRestNumericEnums() { return restNumericEnums_; } + /** * * @@ -1409,9 +1471,11 @@ public boolean getRestNumericEnums() { public Builder setRestNumericEnums(boolean value) { restNumericEnums_ = value; + bitField0_ |= 0x00000004; onChanged(); return this; } + /** * * @@ -1425,18 +1489,19 @@ public Builder setRestNumericEnums(boolean value) { * @return This builder for chaining. */ public Builder clearRestNumericEnums() { - + bitField0_ = (bitField0_ & ~0x00000004); restNumericEnums_ = false; onChanged(); return this; } private com.google.api.JavaSettings javaSettings_; - private com.google.protobuf.SingleFieldBuilderV3< + private com.google.protobuf.SingleFieldBuilder< com.google.api.JavaSettings, com.google.api.JavaSettings.Builder, com.google.api.JavaSettingsOrBuilder> javaSettingsBuilder_; + /** * * @@ -1449,8 +1514,9 @@ public Builder clearRestNumericEnums() { * @return Whether the javaSettings field is set. */ public boolean hasJavaSettings() { - return javaSettingsBuilder_ != null || javaSettings_ != null; + return ((bitField0_ & 0x00000008) != 0); } + /** * * @@ -1471,6 +1537,7 @@ public com.google.api.JavaSettings getJavaSettings() { return javaSettingsBuilder_.getMessage(); } } + /** * * @@ -1486,13 +1553,14 @@ public Builder setJavaSettings(com.google.api.JavaSettings value) { throw new NullPointerException(); } javaSettings_ = value; - onChanged(); } else { javaSettingsBuilder_.setMessage(value); } - + bitField0_ |= 0x00000008; + onChanged(); return this; } + /** * * @@ -1505,13 +1573,14 @@ public Builder setJavaSettings(com.google.api.JavaSettings value) { public Builder setJavaSettings(com.google.api.JavaSettings.Builder builderForValue) { if (javaSettingsBuilder_ == null) { javaSettings_ = builderForValue.build(); - onChanged(); } else { javaSettingsBuilder_.setMessage(builderForValue.build()); } - + bitField0_ |= 0x00000008; + onChanged(); return this; } + /** * * @@ -1523,19 +1592,23 @@ public Builder setJavaSettings(com.google.api.JavaSettings.Builder builderForVal */ public Builder mergeJavaSettings(com.google.api.JavaSettings value) { if (javaSettingsBuilder_ == null) { - if (javaSettings_ != null) { - javaSettings_ = - com.google.api.JavaSettings.newBuilder(javaSettings_).mergeFrom(value).buildPartial(); + if (((bitField0_ & 0x00000008) != 0) + && javaSettings_ != null + && javaSettings_ != com.google.api.JavaSettings.getDefaultInstance()) { + getJavaSettingsBuilder().mergeFrom(value); } else { javaSettings_ = value; } - onChanged(); } else { javaSettingsBuilder_.mergeFrom(value); } - + if (javaSettings_ != null) { + bitField0_ |= 0x00000008; + onChanged(); + } return this; } + /** * * @@ -1546,16 +1619,16 @@ public Builder mergeJavaSettings(com.google.api.JavaSettings value) { * .google.api.JavaSettings java_settings = 21; */ public Builder clearJavaSettings() { - if (javaSettingsBuilder_ == null) { - javaSettings_ = null; - onChanged(); - } else { - javaSettings_ = null; + bitField0_ = (bitField0_ & ~0x00000008); + javaSettings_ = null; + if (javaSettingsBuilder_ != null) { + javaSettingsBuilder_.dispose(); javaSettingsBuilder_ = null; } - + onChanged(); return this; } + /** * * @@ -1566,10 +1639,11 @@ public Builder clearJavaSettings() { * .google.api.JavaSettings java_settings = 21; */ public com.google.api.JavaSettings.Builder getJavaSettingsBuilder() { - + bitField0_ |= 0x00000008; onChanged(); - return getJavaSettingsFieldBuilder().getBuilder(); + return internalGetJavaSettingsFieldBuilder().getBuilder(); } + /** * * @@ -1588,6 +1662,7 @@ public com.google.api.JavaSettingsOrBuilder getJavaSettingsOrBuilder() { : javaSettings_; } } + /** * * @@ -1597,14 +1672,14 @@ public com.google.api.JavaSettingsOrBuilder getJavaSettingsOrBuilder() { * * .google.api.JavaSettings java_settings = 21; */ - private com.google.protobuf.SingleFieldBuilderV3< + private com.google.protobuf.SingleFieldBuilder< com.google.api.JavaSettings, com.google.api.JavaSettings.Builder, com.google.api.JavaSettingsOrBuilder> - getJavaSettingsFieldBuilder() { + internalGetJavaSettingsFieldBuilder() { if (javaSettingsBuilder_ == null) { javaSettingsBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< + new com.google.protobuf.SingleFieldBuilder< com.google.api.JavaSettings, com.google.api.JavaSettings.Builder, com.google.api.JavaSettingsOrBuilder>( @@ -1615,11 +1690,12 @@ public com.google.api.JavaSettingsOrBuilder getJavaSettingsOrBuilder() { } private com.google.api.CppSettings cppSettings_; - private com.google.protobuf.SingleFieldBuilderV3< + private com.google.protobuf.SingleFieldBuilder< com.google.api.CppSettings, com.google.api.CppSettings.Builder, com.google.api.CppSettingsOrBuilder> cppSettingsBuilder_; + /** * * @@ -1632,8 +1708,9 @@ public com.google.api.JavaSettingsOrBuilder getJavaSettingsOrBuilder() { * @return Whether the cppSettings field is set. */ public boolean hasCppSettings() { - return cppSettingsBuilder_ != null || cppSettings_ != null; + return ((bitField0_ & 0x00000010) != 0); } + /** * * @@ -1654,6 +1731,7 @@ public com.google.api.CppSettings getCppSettings() { return cppSettingsBuilder_.getMessage(); } } + /** * * @@ -1669,13 +1747,14 @@ public Builder setCppSettings(com.google.api.CppSettings value) { throw new NullPointerException(); } cppSettings_ = value; - onChanged(); } else { cppSettingsBuilder_.setMessage(value); } - + bitField0_ |= 0x00000010; + onChanged(); return this; } + /** * * @@ -1688,13 +1767,14 @@ public Builder setCppSettings(com.google.api.CppSettings value) { public Builder setCppSettings(com.google.api.CppSettings.Builder builderForValue) { if (cppSettingsBuilder_ == null) { cppSettings_ = builderForValue.build(); - onChanged(); } else { cppSettingsBuilder_.setMessage(builderForValue.build()); } - + bitField0_ |= 0x00000010; + onChanged(); return this; } + /** * * @@ -1706,19 +1786,23 @@ public Builder setCppSettings(com.google.api.CppSettings.Builder builderForValue */ public Builder mergeCppSettings(com.google.api.CppSettings value) { if (cppSettingsBuilder_ == null) { - if (cppSettings_ != null) { - cppSettings_ = - com.google.api.CppSettings.newBuilder(cppSettings_).mergeFrom(value).buildPartial(); + if (((bitField0_ & 0x00000010) != 0) + && cppSettings_ != null + && cppSettings_ != com.google.api.CppSettings.getDefaultInstance()) { + getCppSettingsBuilder().mergeFrom(value); } else { cppSettings_ = value; } - onChanged(); } else { cppSettingsBuilder_.mergeFrom(value); } - + if (cppSettings_ != null) { + bitField0_ |= 0x00000010; + onChanged(); + } return this; } + /** * * @@ -1729,16 +1813,16 @@ public Builder mergeCppSettings(com.google.api.CppSettings value) { * .google.api.CppSettings cpp_settings = 22; */ public Builder clearCppSettings() { - if (cppSettingsBuilder_ == null) { - cppSettings_ = null; - onChanged(); - } else { - cppSettings_ = null; + bitField0_ = (bitField0_ & ~0x00000010); + cppSettings_ = null; + if (cppSettingsBuilder_ != null) { + cppSettingsBuilder_.dispose(); cppSettingsBuilder_ = null; } - + onChanged(); return this; } + /** * * @@ -1749,10 +1833,11 @@ public Builder clearCppSettings() { * .google.api.CppSettings cpp_settings = 22; */ public com.google.api.CppSettings.Builder getCppSettingsBuilder() { - + bitField0_ |= 0x00000010; onChanged(); - return getCppSettingsFieldBuilder().getBuilder(); + return internalGetCppSettingsFieldBuilder().getBuilder(); } + /** * * @@ -1771,6 +1856,7 @@ public com.google.api.CppSettingsOrBuilder getCppSettingsOrBuilder() { : cppSettings_; } } + /** * * @@ -1780,14 +1866,14 @@ public com.google.api.CppSettingsOrBuilder getCppSettingsOrBuilder() { * * .google.api.CppSettings cpp_settings = 22; */ - private com.google.protobuf.SingleFieldBuilderV3< + private com.google.protobuf.SingleFieldBuilder< com.google.api.CppSettings, com.google.api.CppSettings.Builder, com.google.api.CppSettingsOrBuilder> - getCppSettingsFieldBuilder() { + internalGetCppSettingsFieldBuilder() { if (cppSettingsBuilder_ == null) { cppSettingsBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< + new com.google.protobuf.SingleFieldBuilder< com.google.api.CppSettings, com.google.api.CppSettings.Builder, com.google.api.CppSettingsOrBuilder>( @@ -1798,11 +1884,12 @@ public com.google.api.CppSettingsOrBuilder getCppSettingsOrBuilder() { } private com.google.api.PhpSettings phpSettings_; - private com.google.protobuf.SingleFieldBuilderV3< + private com.google.protobuf.SingleFieldBuilder< com.google.api.PhpSettings, com.google.api.PhpSettings.Builder, com.google.api.PhpSettingsOrBuilder> phpSettingsBuilder_; + /** * * @@ -1815,8 +1902,9 @@ public com.google.api.CppSettingsOrBuilder getCppSettingsOrBuilder() { * @return Whether the phpSettings field is set. */ public boolean hasPhpSettings() { - return phpSettingsBuilder_ != null || phpSettings_ != null; + return ((bitField0_ & 0x00000020) != 0); } + /** * * @@ -1837,6 +1925,7 @@ public com.google.api.PhpSettings getPhpSettings() { return phpSettingsBuilder_.getMessage(); } } + /** * * @@ -1852,13 +1941,14 @@ public Builder setPhpSettings(com.google.api.PhpSettings value) { throw new NullPointerException(); } phpSettings_ = value; - onChanged(); } else { phpSettingsBuilder_.setMessage(value); } - + bitField0_ |= 0x00000020; + onChanged(); return this; } + /** * * @@ -1871,13 +1961,14 @@ public Builder setPhpSettings(com.google.api.PhpSettings value) { public Builder setPhpSettings(com.google.api.PhpSettings.Builder builderForValue) { if (phpSettingsBuilder_ == null) { phpSettings_ = builderForValue.build(); - onChanged(); } else { phpSettingsBuilder_.setMessage(builderForValue.build()); } - + bitField0_ |= 0x00000020; + onChanged(); return this; } + /** * * @@ -1889,19 +1980,23 @@ public Builder setPhpSettings(com.google.api.PhpSettings.Builder builderForValue */ public Builder mergePhpSettings(com.google.api.PhpSettings value) { if (phpSettingsBuilder_ == null) { - if (phpSettings_ != null) { - phpSettings_ = - com.google.api.PhpSettings.newBuilder(phpSettings_).mergeFrom(value).buildPartial(); + if (((bitField0_ & 0x00000020) != 0) + && phpSettings_ != null + && phpSettings_ != com.google.api.PhpSettings.getDefaultInstance()) { + getPhpSettingsBuilder().mergeFrom(value); } else { phpSettings_ = value; } - onChanged(); } else { phpSettingsBuilder_.mergeFrom(value); } - + if (phpSettings_ != null) { + bitField0_ |= 0x00000020; + onChanged(); + } return this; } + /** * * @@ -1912,16 +2007,16 @@ public Builder mergePhpSettings(com.google.api.PhpSettings value) { * .google.api.PhpSettings php_settings = 23; */ public Builder clearPhpSettings() { - if (phpSettingsBuilder_ == null) { - phpSettings_ = null; - onChanged(); - } else { - phpSettings_ = null; + bitField0_ = (bitField0_ & ~0x00000020); + phpSettings_ = null; + if (phpSettingsBuilder_ != null) { + phpSettingsBuilder_.dispose(); phpSettingsBuilder_ = null; } - + onChanged(); return this; } + /** * * @@ -1932,10 +2027,11 @@ public Builder clearPhpSettings() { * .google.api.PhpSettings php_settings = 23; */ public com.google.api.PhpSettings.Builder getPhpSettingsBuilder() { - + bitField0_ |= 0x00000020; onChanged(); - return getPhpSettingsFieldBuilder().getBuilder(); + return internalGetPhpSettingsFieldBuilder().getBuilder(); } + /** * * @@ -1954,6 +2050,7 @@ public com.google.api.PhpSettingsOrBuilder getPhpSettingsOrBuilder() { : phpSettings_; } } + /** * * @@ -1963,14 +2060,14 @@ public com.google.api.PhpSettingsOrBuilder getPhpSettingsOrBuilder() { * * .google.api.PhpSettings php_settings = 23; */ - private com.google.protobuf.SingleFieldBuilderV3< + private com.google.protobuf.SingleFieldBuilder< com.google.api.PhpSettings, com.google.api.PhpSettings.Builder, com.google.api.PhpSettingsOrBuilder> - getPhpSettingsFieldBuilder() { + internalGetPhpSettingsFieldBuilder() { if (phpSettingsBuilder_ == null) { phpSettingsBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< + new com.google.protobuf.SingleFieldBuilder< com.google.api.PhpSettings, com.google.api.PhpSettings.Builder, com.google.api.PhpSettingsOrBuilder>( @@ -1981,11 +2078,12 @@ public com.google.api.PhpSettingsOrBuilder getPhpSettingsOrBuilder() { } private com.google.api.PythonSettings pythonSettings_; - private com.google.protobuf.SingleFieldBuilderV3< + private com.google.protobuf.SingleFieldBuilder< com.google.api.PythonSettings, com.google.api.PythonSettings.Builder, com.google.api.PythonSettingsOrBuilder> pythonSettingsBuilder_; + /** * * @@ -1998,8 +2096,9 @@ public com.google.api.PhpSettingsOrBuilder getPhpSettingsOrBuilder() { * @return Whether the pythonSettings field is set. */ public boolean hasPythonSettings() { - return pythonSettingsBuilder_ != null || pythonSettings_ != null; + return ((bitField0_ & 0x00000040) != 0); } + /** * * @@ -2020,6 +2119,7 @@ public com.google.api.PythonSettings getPythonSettings() { return pythonSettingsBuilder_.getMessage(); } } + /** * * @@ -2035,13 +2135,14 @@ public Builder setPythonSettings(com.google.api.PythonSettings value) { throw new NullPointerException(); } pythonSettings_ = value; - onChanged(); } else { pythonSettingsBuilder_.setMessage(value); } - + bitField0_ |= 0x00000040; + onChanged(); return this; } + /** * * @@ -2054,13 +2155,14 @@ public Builder setPythonSettings(com.google.api.PythonSettings value) { public Builder setPythonSettings(com.google.api.PythonSettings.Builder builderForValue) { if (pythonSettingsBuilder_ == null) { pythonSettings_ = builderForValue.build(); - onChanged(); } else { pythonSettingsBuilder_.setMessage(builderForValue.build()); } - + bitField0_ |= 0x00000040; + onChanged(); return this; } + /** * * @@ -2072,21 +2174,23 @@ public Builder setPythonSettings(com.google.api.PythonSettings.Builder builderFo */ public Builder mergePythonSettings(com.google.api.PythonSettings value) { if (pythonSettingsBuilder_ == null) { - if (pythonSettings_ != null) { - pythonSettings_ = - com.google.api.PythonSettings.newBuilder(pythonSettings_) - .mergeFrom(value) - .buildPartial(); + if (((bitField0_ & 0x00000040) != 0) + && pythonSettings_ != null + && pythonSettings_ != com.google.api.PythonSettings.getDefaultInstance()) { + getPythonSettingsBuilder().mergeFrom(value); } else { pythonSettings_ = value; } - onChanged(); } else { pythonSettingsBuilder_.mergeFrom(value); } - + if (pythonSettings_ != null) { + bitField0_ |= 0x00000040; + onChanged(); + } return this; } + /** * * @@ -2097,16 +2201,16 @@ public Builder mergePythonSettings(com.google.api.PythonSettings value) { * .google.api.PythonSettings python_settings = 24; */ public Builder clearPythonSettings() { - if (pythonSettingsBuilder_ == null) { - pythonSettings_ = null; - onChanged(); - } else { - pythonSettings_ = null; + bitField0_ = (bitField0_ & ~0x00000040); + pythonSettings_ = null; + if (pythonSettingsBuilder_ != null) { + pythonSettingsBuilder_.dispose(); pythonSettingsBuilder_ = null; } - + onChanged(); return this; } + /** * * @@ -2117,10 +2221,11 @@ public Builder clearPythonSettings() { * .google.api.PythonSettings python_settings = 24; */ public com.google.api.PythonSettings.Builder getPythonSettingsBuilder() { - + bitField0_ |= 0x00000040; onChanged(); - return getPythonSettingsFieldBuilder().getBuilder(); + return internalGetPythonSettingsFieldBuilder().getBuilder(); } + /** * * @@ -2139,6 +2244,7 @@ public com.google.api.PythonSettingsOrBuilder getPythonSettingsOrBuilder() { : pythonSettings_; } } + /** * * @@ -2148,14 +2254,14 @@ public com.google.api.PythonSettingsOrBuilder getPythonSettingsOrBuilder() { * * .google.api.PythonSettings python_settings = 24; */ - private com.google.protobuf.SingleFieldBuilderV3< + private com.google.protobuf.SingleFieldBuilder< com.google.api.PythonSettings, com.google.api.PythonSettings.Builder, com.google.api.PythonSettingsOrBuilder> - getPythonSettingsFieldBuilder() { + internalGetPythonSettingsFieldBuilder() { if (pythonSettingsBuilder_ == null) { pythonSettingsBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< + new com.google.protobuf.SingleFieldBuilder< com.google.api.PythonSettings, com.google.api.PythonSettings.Builder, com.google.api.PythonSettingsOrBuilder>( @@ -2166,11 +2272,12 @@ public com.google.api.PythonSettingsOrBuilder getPythonSettingsOrBuilder() { } private com.google.api.NodeSettings nodeSettings_; - private com.google.protobuf.SingleFieldBuilderV3< + private com.google.protobuf.SingleFieldBuilder< com.google.api.NodeSettings, com.google.api.NodeSettings.Builder, com.google.api.NodeSettingsOrBuilder> nodeSettingsBuilder_; + /** * * @@ -2183,8 +2290,9 @@ public com.google.api.PythonSettingsOrBuilder getPythonSettingsOrBuilder() { * @return Whether the nodeSettings field is set. */ public boolean hasNodeSettings() { - return nodeSettingsBuilder_ != null || nodeSettings_ != null; + return ((bitField0_ & 0x00000080) != 0); } + /** * * @@ -2205,6 +2313,7 @@ public com.google.api.NodeSettings getNodeSettings() { return nodeSettingsBuilder_.getMessage(); } } + /** * * @@ -2220,13 +2329,14 @@ public Builder setNodeSettings(com.google.api.NodeSettings value) { throw new NullPointerException(); } nodeSettings_ = value; - onChanged(); } else { nodeSettingsBuilder_.setMessage(value); } - + bitField0_ |= 0x00000080; + onChanged(); return this; } + /** * * @@ -2239,13 +2349,14 @@ public Builder setNodeSettings(com.google.api.NodeSettings value) { public Builder setNodeSettings(com.google.api.NodeSettings.Builder builderForValue) { if (nodeSettingsBuilder_ == null) { nodeSettings_ = builderForValue.build(); - onChanged(); } else { nodeSettingsBuilder_.setMessage(builderForValue.build()); } - + bitField0_ |= 0x00000080; + onChanged(); return this; } + /** * * @@ -2257,19 +2368,23 @@ public Builder setNodeSettings(com.google.api.NodeSettings.Builder builderForVal */ public Builder mergeNodeSettings(com.google.api.NodeSettings value) { if (nodeSettingsBuilder_ == null) { - if (nodeSettings_ != null) { - nodeSettings_ = - com.google.api.NodeSettings.newBuilder(nodeSettings_).mergeFrom(value).buildPartial(); + if (((bitField0_ & 0x00000080) != 0) + && nodeSettings_ != null + && nodeSettings_ != com.google.api.NodeSettings.getDefaultInstance()) { + getNodeSettingsBuilder().mergeFrom(value); } else { nodeSettings_ = value; } - onChanged(); } else { nodeSettingsBuilder_.mergeFrom(value); } - + if (nodeSettings_ != null) { + bitField0_ |= 0x00000080; + onChanged(); + } return this; } + /** * * @@ -2280,16 +2395,16 @@ public Builder mergeNodeSettings(com.google.api.NodeSettings value) { * .google.api.NodeSettings node_settings = 25; */ public Builder clearNodeSettings() { - if (nodeSettingsBuilder_ == null) { - nodeSettings_ = null; - onChanged(); - } else { - nodeSettings_ = null; + bitField0_ = (bitField0_ & ~0x00000080); + nodeSettings_ = null; + if (nodeSettingsBuilder_ != null) { + nodeSettingsBuilder_.dispose(); nodeSettingsBuilder_ = null; } - + onChanged(); return this; } + /** * * @@ -2300,10 +2415,11 @@ public Builder clearNodeSettings() { * .google.api.NodeSettings node_settings = 25; */ public com.google.api.NodeSettings.Builder getNodeSettingsBuilder() { - + bitField0_ |= 0x00000080; onChanged(); - return getNodeSettingsFieldBuilder().getBuilder(); + return internalGetNodeSettingsFieldBuilder().getBuilder(); } + /** * * @@ -2322,6 +2438,7 @@ public com.google.api.NodeSettingsOrBuilder getNodeSettingsOrBuilder() { : nodeSettings_; } } + /** * * @@ -2331,14 +2448,14 @@ public com.google.api.NodeSettingsOrBuilder getNodeSettingsOrBuilder() { * * .google.api.NodeSettings node_settings = 25; */ - private com.google.protobuf.SingleFieldBuilderV3< + private com.google.protobuf.SingleFieldBuilder< com.google.api.NodeSettings, com.google.api.NodeSettings.Builder, com.google.api.NodeSettingsOrBuilder> - getNodeSettingsFieldBuilder() { + internalGetNodeSettingsFieldBuilder() { if (nodeSettingsBuilder_ == null) { nodeSettingsBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< + new com.google.protobuf.SingleFieldBuilder< com.google.api.NodeSettings, com.google.api.NodeSettings.Builder, com.google.api.NodeSettingsOrBuilder>( @@ -2349,11 +2466,12 @@ public com.google.api.NodeSettingsOrBuilder getNodeSettingsOrBuilder() { } private com.google.api.DotnetSettings dotnetSettings_; - private com.google.protobuf.SingleFieldBuilderV3< + private com.google.protobuf.SingleFieldBuilder< com.google.api.DotnetSettings, com.google.api.DotnetSettings.Builder, com.google.api.DotnetSettingsOrBuilder> dotnetSettingsBuilder_; + /** * * @@ -2366,8 +2484,9 @@ public com.google.api.NodeSettingsOrBuilder getNodeSettingsOrBuilder() { * @return Whether the dotnetSettings field is set. */ public boolean hasDotnetSettings() { - return dotnetSettingsBuilder_ != null || dotnetSettings_ != null; + return ((bitField0_ & 0x00000100) != 0); } + /** * * @@ -2388,6 +2507,7 @@ public com.google.api.DotnetSettings getDotnetSettings() { return dotnetSettingsBuilder_.getMessage(); } } + /** * * @@ -2403,13 +2523,14 @@ public Builder setDotnetSettings(com.google.api.DotnetSettings value) { throw new NullPointerException(); } dotnetSettings_ = value; - onChanged(); } else { dotnetSettingsBuilder_.setMessage(value); } - + bitField0_ |= 0x00000100; + onChanged(); return this; } + /** * * @@ -2422,13 +2543,14 @@ public Builder setDotnetSettings(com.google.api.DotnetSettings value) { public Builder setDotnetSettings(com.google.api.DotnetSettings.Builder builderForValue) { if (dotnetSettingsBuilder_ == null) { dotnetSettings_ = builderForValue.build(); - onChanged(); } else { dotnetSettingsBuilder_.setMessage(builderForValue.build()); } - + bitField0_ |= 0x00000100; + onChanged(); return this; } + /** * * @@ -2440,21 +2562,23 @@ public Builder setDotnetSettings(com.google.api.DotnetSettings.Builder builderFo */ public Builder mergeDotnetSettings(com.google.api.DotnetSettings value) { if (dotnetSettingsBuilder_ == null) { - if (dotnetSettings_ != null) { - dotnetSettings_ = - com.google.api.DotnetSettings.newBuilder(dotnetSettings_) - .mergeFrom(value) - .buildPartial(); + if (((bitField0_ & 0x00000100) != 0) + && dotnetSettings_ != null + && dotnetSettings_ != com.google.api.DotnetSettings.getDefaultInstance()) { + getDotnetSettingsBuilder().mergeFrom(value); } else { dotnetSettings_ = value; } - onChanged(); } else { dotnetSettingsBuilder_.mergeFrom(value); } - + if (dotnetSettings_ != null) { + bitField0_ |= 0x00000100; + onChanged(); + } return this; } + /** * * @@ -2465,16 +2589,16 @@ public Builder mergeDotnetSettings(com.google.api.DotnetSettings value) { * .google.api.DotnetSettings dotnet_settings = 26; */ public Builder clearDotnetSettings() { - if (dotnetSettingsBuilder_ == null) { - dotnetSettings_ = null; - onChanged(); - } else { - dotnetSettings_ = null; + bitField0_ = (bitField0_ & ~0x00000100); + dotnetSettings_ = null; + if (dotnetSettingsBuilder_ != null) { + dotnetSettingsBuilder_.dispose(); dotnetSettingsBuilder_ = null; } - + onChanged(); return this; } + /** * * @@ -2485,10 +2609,11 @@ public Builder clearDotnetSettings() { * .google.api.DotnetSettings dotnet_settings = 26; */ public com.google.api.DotnetSettings.Builder getDotnetSettingsBuilder() { - + bitField0_ |= 0x00000100; onChanged(); - return getDotnetSettingsFieldBuilder().getBuilder(); + return internalGetDotnetSettingsFieldBuilder().getBuilder(); } + /** * * @@ -2507,6 +2632,7 @@ public com.google.api.DotnetSettingsOrBuilder getDotnetSettingsOrBuilder() { : dotnetSettings_; } } + /** * * @@ -2516,14 +2642,14 @@ public com.google.api.DotnetSettingsOrBuilder getDotnetSettingsOrBuilder() { * * .google.api.DotnetSettings dotnet_settings = 26; */ - private com.google.protobuf.SingleFieldBuilderV3< + private com.google.protobuf.SingleFieldBuilder< com.google.api.DotnetSettings, com.google.api.DotnetSettings.Builder, com.google.api.DotnetSettingsOrBuilder> - getDotnetSettingsFieldBuilder() { + internalGetDotnetSettingsFieldBuilder() { if (dotnetSettingsBuilder_ == null) { dotnetSettingsBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< + new com.google.protobuf.SingleFieldBuilder< com.google.api.DotnetSettings, com.google.api.DotnetSettings.Builder, com.google.api.DotnetSettingsOrBuilder>( @@ -2534,11 +2660,12 @@ public com.google.api.DotnetSettingsOrBuilder getDotnetSettingsOrBuilder() { } private com.google.api.RubySettings rubySettings_; - private com.google.protobuf.SingleFieldBuilderV3< + private com.google.protobuf.SingleFieldBuilder< com.google.api.RubySettings, com.google.api.RubySettings.Builder, com.google.api.RubySettingsOrBuilder> rubySettingsBuilder_; + /** * * @@ -2551,8 +2678,9 @@ public com.google.api.DotnetSettingsOrBuilder getDotnetSettingsOrBuilder() { * @return Whether the rubySettings field is set. */ public boolean hasRubySettings() { - return rubySettingsBuilder_ != null || rubySettings_ != null; + return ((bitField0_ & 0x00000200) != 0); } + /** * * @@ -2573,6 +2701,7 @@ public com.google.api.RubySettings getRubySettings() { return rubySettingsBuilder_.getMessage(); } } + /** * * @@ -2588,13 +2717,14 @@ public Builder setRubySettings(com.google.api.RubySettings value) { throw new NullPointerException(); } rubySettings_ = value; - onChanged(); } else { rubySettingsBuilder_.setMessage(value); } - + bitField0_ |= 0x00000200; + onChanged(); return this; } + /** * * @@ -2607,13 +2737,14 @@ public Builder setRubySettings(com.google.api.RubySettings value) { public Builder setRubySettings(com.google.api.RubySettings.Builder builderForValue) { if (rubySettingsBuilder_ == null) { rubySettings_ = builderForValue.build(); - onChanged(); } else { rubySettingsBuilder_.setMessage(builderForValue.build()); } - + bitField0_ |= 0x00000200; + onChanged(); return this; } + /** * * @@ -2625,19 +2756,23 @@ public Builder setRubySettings(com.google.api.RubySettings.Builder builderForVal */ public Builder mergeRubySettings(com.google.api.RubySettings value) { if (rubySettingsBuilder_ == null) { - if (rubySettings_ != null) { - rubySettings_ = - com.google.api.RubySettings.newBuilder(rubySettings_).mergeFrom(value).buildPartial(); + if (((bitField0_ & 0x00000200) != 0) + && rubySettings_ != null + && rubySettings_ != com.google.api.RubySettings.getDefaultInstance()) { + getRubySettingsBuilder().mergeFrom(value); } else { rubySettings_ = value; } - onChanged(); } else { rubySettingsBuilder_.mergeFrom(value); } - + if (rubySettings_ != null) { + bitField0_ |= 0x00000200; + onChanged(); + } return this; } + /** * * @@ -2648,16 +2783,16 @@ public Builder mergeRubySettings(com.google.api.RubySettings value) { * .google.api.RubySettings ruby_settings = 27; */ public Builder clearRubySettings() { - if (rubySettingsBuilder_ == null) { - rubySettings_ = null; - onChanged(); - } else { - rubySettings_ = null; + bitField0_ = (bitField0_ & ~0x00000200); + rubySettings_ = null; + if (rubySettingsBuilder_ != null) { + rubySettingsBuilder_.dispose(); rubySettingsBuilder_ = null; } - + onChanged(); return this; } + /** * * @@ -2668,10 +2803,11 @@ public Builder clearRubySettings() { * .google.api.RubySettings ruby_settings = 27; */ public com.google.api.RubySettings.Builder getRubySettingsBuilder() { - + bitField0_ |= 0x00000200; onChanged(); - return getRubySettingsFieldBuilder().getBuilder(); + return internalGetRubySettingsFieldBuilder().getBuilder(); } + /** * * @@ -2690,6 +2826,7 @@ public com.google.api.RubySettingsOrBuilder getRubySettingsOrBuilder() { : rubySettings_; } } + /** * * @@ -2699,14 +2836,14 @@ public com.google.api.RubySettingsOrBuilder getRubySettingsOrBuilder() { * * .google.api.RubySettings ruby_settings = 27; */ - private com.google.protobuf.SingleFieldBuilderV3< + private com.google.protobuf.SingleFieldBuilder< com.google.api.RubySettings, com.google.api.RubySettings.Builder, com.google.api.RubySettingsOrBuilder> - getRubySettingsFieldBuilder() { + internalGetRubySettingsFieldBuilder() { if (rubySettingsBuilder_ == null) { rubySettingsBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< + new com.google.protobuf.SingleFieldBuilder< com.google.api.RubySettings, com.google.api.RubySettings.Builder, com.google.api.RubySettingsOrBuilder>( @@ -2717,11 +2854,12 @@ public com.google.api.RubySettingsOrBuilder getRubySettingsOrBuilder() { } private com.google.api.GoSettings goSettings_; - private com.google.protobuf.SingleFieldBuilderV3< + private com.google.protobuf.SingleFieldBuilder< com.google.api.GoSettings, com.google.api.GoSettings.Builder, com.google.api.GoSettingsOrBuilder> goSettingsBuilder_; + /** * * @@ -2734,8 +2872,9 @@ public com.google.api.RubySettingsOrBuilder getRubySettingsOrBuilder() { * @return Whether the goSettings field is set. */ public boolean hasGoSettings() { - return goSettingsBuilder_ != null || goSettings_ != null; + return ((bitField0_ & 0x00000400) != 0); } + /** * * @@ -2754,6 +2893,7 @@ public com.google.api.GoSettings getGoSettings() { return goSettingsBuilder_.getMessage(); } } + /** * * @@ -2769,13 +2909,14 @@ public Builder setGoSettings(com.google.api.GoSettings value) { throw new NullPointerException(); } goSettings_ = value; - onChanged(); } else { goSettingsBuilder_.setMessage(value); } - + bitField0_ |= 0x00000400; + onChanged(); return this; } + /** * * @@ -2788,13 +2929,14 @@ public Builder setGoSettings(com.google.api.GoSettings value) { public Builder setGoSettings(com.google.api.GoSettings.Builder builderForValue) { if (goSettingsBuilder_ == null) { goSettings_ = builderForValue.build(); - onChanged(); } else { goSettingsBuilder_.setMessage(builderForValue.build()); } - + bitField0_ |= 0x00000400; + onChanged(); return this; } + /** * * @@ -2806,19 +2948,23 @@ public Builder setGoSettings(com.google.api.GoSettings.Builder builderForValue) */ public Builder mergeGoSettings(com.google.api.GoSettings value) { if (goSettingsBuilder_ == null) { - if (goSettings_ != null) { - goSettings_ = - com.google.api.GoSettings.newBuilder(goSettings_).mergeFrom(value).buildPartial(); + if (((bitField0_ & 0x00000400) != 0) + && goSettings_ != null + && goSettings_ != com.google.api.GoSettings.getDefaultInstance()) { + getGoSettingsBuilder().mergeFrom(value); } else { goSettings_ = value; } - onChanged(); } else { goSettingsBuilder_.mergeFrom(value); } - + if (goSettings_ != null) { + bitField0_ |= 0x00000400; + onChanged(); + } return this; } + /** * * @@ -2829,16 +2975,16 @@ public Builder mergeGoSettings(com.google.api.GoSettings value) { * .google.api.GoSettings go_settings = 28; */ public Builder clearGoSettings() { - if (goSettingsBuilder_ == null) { - goSettings_ = null; - onChanged(); - } else { - goSettings_ = null; + bitField0_ = (bitField0_ & ~0x00000400); + goSettings_ = null; + if (goSettingsBuilder_ != null) { + goSettingsBuilder_.dispose(); goSettingsBuilder_ = null; } - + onChanged(); return this; } + /** * * @@ -2849,10 +2995,11 @@ public Builder clearGoSettings() { * .google.api.GoSettings go_settings = 28; */ public com.google.api.GoSettings.Builder getGoSettingsBuilder() { - + bitField0_ |= 0x00000400; onChanged(); - return getGoSettingsFieldBuilder().getBuilder(); + return internalGetGoSettingsFieldBuilder().getBuilder(); } + /** * * @@ -2869,6 +3016,7 @@ public com.google.api.GoSettingsOrBuilder getGoSettingsOrBuilder() { return goSettings_ == null ? com.google.api.GoSettings.getDefaultInstance() : goSettings_; } } + /** * * @@ -2878,14 +3026,14 @@ public com.google.api.GoSettingsOrBuilder getGoSettingsOrBuilder() { * * .google.api.GoSettings go_settings = 28; */ - private com.google.protobuf.SingleFieldBuilderV3< + private com.google.protobuf.SingleFieldBuilder< com.google.api.GoSettings, com.google.api.GoSettings.Builder, com.google.api.GoSettingsOrBuilder> - getGoSettingsFieldBuilder() { + internalGetGoSettingsFieldBuilder() { if (goSettingsBuilder_ == null) { goSettingsBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< + new com.google.protobuf.SingleFieldBuilder< com.google.api.GoSettings, com.google.api.GoSettings.Builder, com.google.api.GoSettingsOrBuilder>( @@ -2895,17 +3043,6 @@ public com.google.api.GoSettingsOrBuilder getGoSettingsOrBuilder() { return goSettingsBuilder_; } - @java.lang.Override - public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - // @@protoc_insertion_point(builder_scope:google.api.ClientLibrarySettings) } diff --git a/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/ClientLibrarySettingsOrBuilder.java b/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/ClientLibrarySettingsOrBuilder.java index e4a965bd48..4f417af81a 100644 --- a/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/ClientLibrarySettingsOrBuilder.java +++ b/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/ClientLibrarySettingsOrBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,10 +14,13 @@ * limitations under the License. */ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: google/api/client.proto +// Protobuf Java Version: 4.33.2 package com.google.api; +@com.google.protobuf.Generated public interface ClientLibrarySettingsOrBuilder extends // @@protoc_insertion_point(interface_extends:google.api.ClientLibrarySettings) @@ -27,7 +30,9 @@ public interface ClientLibrarySettingsOrBuilder * * *
        -   * Version of the API to apply these settings to.
        +   * Version of the API to apply these settings to. This is the full protobuf
        +   * package for the API, ending in the version element.
        +   * Examples: "google.cloud.speech.v1" and "google.spanner.admin.database.v1".
            * 
        * * string version = 1; @@ -35,11 +40,14 @@ public interface ClientLibrarySettingsOrBuilder * @return The version. */ java.lang.String getVersion(); + /** * * *
        -   * Version of the API to apply these settings to.
        +   * Version of the API to apply these settings to. This is the full protobuf
        +   * package for the API, ending in the version element.
        +   * Examples: "google.cloud.speech.v1" and "google.spanner.admin.database.v1".
            * 
        * * string version = 1; @@ -60,6 +68,7 @@ public interface ClientLibrarySettingsOrBuilder * @return The enum numeric value on the wire for launchStage. */ int getLaunchStageValue(); + /** * * @@ -99,6 +108,7 @@ public interface ClientLibrarySettingsOrBuilder * @return Whether the javaSettings field is set. */ boolean hasJavaSettings(); + /** * * @@ -111,6 +121,7 @@ public interface ClientLibrarySettingsOrBuilder * @return The javaSettings. */ com.google.api.JavaSettings getJavaSettings(); + /** * * @@ -134,6 +145,7 @@ public interface ClientLibrarySettingsOrBuilder * @return Whether the cppSettings field is set. */ boolean hasCppSettings(); + /** * * @@ -146,6 +158,7 @@ public interface ClientLibrarySettingsOrBuilder * @return The cppSettings. */ com.google.api.CppSettings getCppSettings(); + /** * * @@ -169,6 +182,7 @@ public interface ClientLibrarySettingsOrBuilder * @return Whether the phpSettings field is set. */ boolean hasPhpSettings(); + /** * * @@ -181,6 +195,7 @@ public interface ClientLibrarySettingsOrBuilder * @return The phpSettings. */ com.google.api.PhpSettings getPhpSettings(); + /** * * @@ -204,6 +219,7 @@ public interface ClientLibrarySettingsOrBuilder * @return Whether the pythonSettings field is set. */ boolean hasPythonSettings(); + /** * * @@ -216,6 +232,7 @@ public interface ClientLibrarySettingsOrBuilder * @return The pythonSettings. */ com.google.api.PythonSettings getPythonSettings(); + /** * * @@ -239,6 +256,7 @@ public interface ClientLibrarySettingsOrBuilder * @return Whether the nodeSettings field is set. */ boolean hasNodeSettings(); + /** * * @@ -251,6 +269,7 @@ public interface ClientLibrarySettingsOrBuilder * @return The nodeSettings. */ com.google.api.NodeSettings getNodeSettings(); + /** * * @@ -274,6 +293,7 @@ public interface ClientLibrarySettingsOrBuilder * @return Whether the dotnetSettings field is set. */ boolean hasDotnetSettings(); + /** * * @@ -286,6 +306,7 @@ public interface ClientLibrarySettingsOrBuilder * @return The dotnetSettings. */ com.google.api.DotnetSettings getDotnetSettings(); + /** * * @@ -309,6 +330,7 @@ public interface ClientLibrarySettingsOrBuilder * @return Whether the rubySettings field is set. */ boolean hasRubySettings(); + /** * * @@ -321,6 +343,7 @@ public interface ClientLibrarySettingsOrBuilder * @return The rubySettings. */ com.google.api.RubySettings getRubySettings(); + /** * * @@ -344,6 +367,7 @@ public interface ClientLibrarySettingsOrBuilder * @return Whether the goSettings field is set. */ boolean hasGoSettings(); + /** * * @@ -356,6 +380,7 @@ public interface ClientLibrarySettingsOrBuilder * @return The goSettings. */ com.google.api.GoSettings getGoSettings(); + /** * * diff --git a/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/ClientProto.java b/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/ClientProto.java index 4680c28e0d..47e1f26ea3 100644 --- a/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/ClientProto.java +++ b/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/ClientProto.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,17 +14,31 @@ * limitations under the License. */ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: google/api/client.proto +// Protobuf Java Version: 4.33.2 package com.google.api; -public final class ClientProto { +@com.google.protobuf.Generated +public final class ClientProto extends com.google.protobuf.GeneratedFile { private ClientProto() {} + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "ClientProto"); + } + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistryLite registry) { registry.add(com.google.api.ClientProto.methodSignature); registry.add(com.google.api.ClientProto.defaultHost); registry.add(com.google.api.ClientProto.oauthScopes); + registry.add(com.google.api.ClientProto.apiVersion); } public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry registry) { @@ -32,37 +46,46 @@ public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry r } public static final int METHOD_SIGNATURE_FIELD_NUMBER = 1051; + /** * * *
            * A definition of a client library method signature.
        +   *
            * In client libraries, each proto RPC corresponds to one or more methods
            * which the end user is able to call, and calls the underlying RPC.
            * Normally, this method receives a single argument (a struct or instance
            * corresponding to the RPC request object). Defining this field will
            * add one or more overloads providing flattened or simpler method signatures
            * in some languages.
        +   *
            * The fields on the method signature are provided as a comma-separated
            * string.
        +   *
            * For example, the proto RPC and annotation:
        -   *   rpc CreateSubscription(CreateSubscriptionRequest)
        -   *       returns (Subscription) {
        -   *     option (google.api.method_signature) = "name,topic";
        -   *   }
        +   *
        +   * rpc CreateSubscription(CreateSubscriptionRequest)
        +   * returns (Subscription) {
        +   * option (google.api.method_signature) = "name,topic";
        +   * }
        +   *
            * Would add the following Java overload (in addition to the method accepting
            * the request object):
        -   *   public final Subscription createSubscription(String name, String topic)
        +   *
        +   * public final Subscription createSubscription(String name, String topic)
        +   *
            * The following backwards-compatibility guidelines apply:
        -   *   * Adding this annotation to an unannotated method is backwards
        -   *     compatible.
        -   *   * Adding this annotation to a method which already has existing
        -   *     method signature annotations is backwards compatible if and only if
        -   *     the new method signature annotation is last in the sequence.
        -   *   * Modifying or removing an existing method signature annotation is
        -   *     a breaking change.
        -   *   * Re-ordering existing method signature annotations is a breaking
        -   *     change.
        +   *
        +   * * Adding this annotation to an unannotated method is backwards
        +   * compatible.
        +   * * Adding this annotation to a method which already has existing
        +   * method signature annotations is backwards compatible if and only if
        +   * the new method signature annotation is last in the sequence.
        +   * * Modifying or removing an existing method signature annotation is
        +   * a breaking change.
        +   * * Re-ordering existing method signature annotations is a breaking
        +   * change.
            * 
        * * extend .google.protobuf.MethodOptions { ... } @@ -74,17 +97,20 @@ public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry r java.lang.String.class, null); public static final int DEFAULT_HOST_FIELD_NUMBER = 1049; + /** * * *
            * The hostname for this service.
            * This should be specified with no prefix or protocol.
        +   *
            * Example:
        -   *   service Foo {
        -   *     option (google.api.default_host) = "foo.googleapi.com";
        -   *     ...
        -   *   }
        +   *
        +   * service Foo {
        +   * option (google.api.default_host) = "foo.googleapi.com";
        +   * ...
        +   * }
            * 
        * * extend .google.protobuf.ServiceOptions { ... } @@ -96,25 +122,31 @@ public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry r java.lang.String.class, null); public static final int OAUTH_SCOPES_FIELD_NUMBER = 1050; + /** * * *
            * OAuth scopes needed for the client.
        +   *
            * Example:
        -   *   service Foo {
        -   *     option (google.api.oauth_scopes) = \
        -   *       "https://www.googleapis.com/auth/cloud-platform";
        -   *     ...
        -   *   }
        +   *
        +   * service Foo {
        +   * option (google.api.oauth_scopes) = \
        +   * "https://www.googleapis.com/auth/cloud-platform";
        +   * ...
        +   * }
        +   *
            * If there is more than one scope, use a comma-separated string:
        +   *
            * Example:
        -   *   service Foo {
        -   *     option (google.api.oauth_scopes) = \
        -   *       "https://www.googleapis.com/auth/cloud-platform,"
        -   *       "https://www.googleapis.com/auth/monitoring";
        -   *     ...
        -   *   }
        +   *
        +   * service Foo {
        +   * option (google.api.oauth_scopes) = \
        +   * "https://www.googleapis.com/auth/cloud-platform,"
        +   * "https://www.googleapis.com/auth/monitoring";
        +   * ...
        +   * }
            * 
        * * extend .google.protobuf.ServiceOptions { ... } @@ -125,62 +157,112 @@ public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry r com.google.protobuf.GeneratedMessage.newFileScopedGeneratedExtension( java.lang.String.class, null); + public static final int API_VERSION_FIELD_NUMBER = 525000001; + + /** + * + * + *
        +   * The API version of this service, which should be sent by version-aware
        +   * clients to the service. This allows services to abide by the schema and
        +   * behavior of the service at the time this API version was deployed.
        +   * The format of the API version must be treated as opaque by clients.
        +   * Services may use a format with an apparent structure, but clients must
        +   * not rely on this to determine components within an API version, or attempt
        +   * to construct other valid API versions. Note that this is for upcoming
        +   * functionality and may not be implemented for all services.
        +   *
        +   * Example:
        +   *
        +   * service Foo {
        +   * option (google.api.api_version) = "v1_20230821_preview";
        +   * }
        +   * 
        + * + * extend .google.protobuf.ServiceOptions { ... } + */ + public static final com.google.protobuf.GeneratedMessage.GeneratedExtension< + com.google.protobuf.DescriptorProtos.ServiceOptions, java.lang.String> + apiVersion = + com.google.protobuf.GeneratedMessage.newFileScopedGeneratedExtension( + java.lang.String.class, null); + static final com.google.protobuf.Descriptors.Descriptor internal_static_google_api_CommonLanguageSettings_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable internal_static_google_api_CommonLanguageSettings_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_google_api_ClientLibrarySettings_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable internal_static_google_api_ClientLibrarySettings_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_google_api_Publishing_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable internal_static_google_api_Publishing_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_google_api_JavaSettings_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable internal_static_google_api_JavaSettings_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_google_api_JavaSettings_ServiceClassNamesEntry_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable internal_static_google_api_JavaSettings_ServiceClassNamesEntry_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_google_api_CppSettings_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable internal_static_google_api_CppSettings_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_google_api_PhpSettings_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable internal_static_google_api_PhpSettings_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_google_api_PythonSettings_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable internal_static_google_api_PythonSettings_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_api_PythonSettings_ExperimentalFeatures_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_api_PythonSettings_ExperimentalFeatures_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_google_api_NodeSettings_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable internal_static_google_api_NodeSettings_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_google_api_DotnetSettings_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable internal_static_google_api_DotnetSettings_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_api_DotnetSettings_RenamedServicesEntry_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_api_DotnetSettings_RenamedServicesEntry_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_api_DotnetSettings_RenamedResourcesEntry_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_api_DotnetSettings_RenamedResourcesEntry_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_google_api_RubySettings_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable internal_static_google_api_RubySettings_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_google_api_GoSettings_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable internal_static_google_api_GoSettings_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_api_GoSettings_RenamedServicesEntry_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_api_GoSettings_RenamedServicesEntry_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_google_api_MethodSettings_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable internal_static_google_api_MethodSettings_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_google_api_MethodSettings_LongRunning_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable internal_static_google_api_MethodSettings_LongRunning_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_api_SelectiveGapicGeneration_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_api_SelectiveGapicGeneration_fieldAccessorTable; public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { return descriptor; @@ -190,72 +272,118 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { static { java.lang.String[] descriptorData = { - "\n\027google/api/client.proto\022\ngoogle.api\032\035g" - + "oogle/api/launch_stage.proto\032 google/pro" - + "tobuf/descriptor.proto\032\036google/protobuf/" - + "duration.proto\"p\n\026CommonLanguageSettings" - + "\022\032\n\022reference_docs_uri\030\001 \001(\t\022:\n\014destinat" - + "ions\030\002 \003(\0162$.google.api.ClientLibraryDes" - + "tination\"\373\003\n\025ClientLibrarySettings\022\017\n\007ve" - + "rsion\030\001 \001(\t\022-\n\014launch_stage\030\002 \001(\0162\027.goog" - + "le.api.LaunchStage\022\032\n\022rest_numeric_enums" - + "\030\003 \001(\010\022/\n\rjava_settings\030\025 \001(\0132\030.google.a" - + "pi.JavaSettings\022-\n\014cpp_settings\030\026 \001(\0132\027." - + "google.api.CppSettings\022-\n\014php_settings\030\027" - + " \001(\0132\027.google.api.PhpSettings\0223\n\017python_" - + "settings\030\030 \001(\0132\032.google.api.PythonSettin" - + "gs\022/\n\rnode_settings\030\031 \001(\0132\030.google.api.N" - + "odeSettings\0223\n\017dotnet_settings\030\032 \001(\0132\032.g" - + "oogle.api.DotnetSettings\022/\n\rruby_setting" - + "s\030\033 \001(\0132\030.google.api.RubySettings\022+\n\013go_" - + "settings\030\034 \001(\0132\026.google.api.GoSettings\"\323" - + "\002\n\nPublishing\0223\n\017method_settings\030\002 \003(\0132\032" - + ".google.api.MethodSettings\022\025\n\rnew_issue_" - + "uri\030e \001(\t\022\031\n\021documentation_uri\030f \001(\t\022\026\n\016" - + "api_short_name\030g \001(\t\022\024\n\014github_label\030h \001" - + "(\t\022\036\n\026codeowner_github_teams\030i \003(\t\022\026\n\016do" - + "c_tag_prefix\030j \001(\t\022;\n\014organization\030k \001(\016" - + "2%.google.api.ClientLibraryOrganization\022" - + ";\n\020library_settings\030m \003(\0132!.google.api.C" - + "lientLibrarySettings\"\343\001\n\014JavaSettings\022\027\n" - + "\017library_package\030\001 \001(\t\022L\n\023service_class_" - + "names\030\002 \003(\0132/.google.api.JavaSettings.Se" - + "rviceClassNamesEntry\0222\n\006common\030\003 \001(\0132\".g" - + "oogle.api.CommonLanguageSettings\0328\n\026Serv" - + "iceClassNamesEntry\022\013\n\003key\030\001 \001(\t\022\r\n\005value" - + "\030\002 \001(\t:\0028\001\"A\n\013CppSettings\0222\n\006common\030\001 \001(" - + "\0132\".google.api.CommonLanguageSettings\"A\n" - + "\013PhpSettings\0222\n\006common\030\001 \001(\0132\".google.ap" - + "i.CommonLanguageSettings\"D\n\016PythonSettin" - + "gs\0222\n\006common\030\001 \001(\0132\".google.api.CommonLa" - + "nguageSettings\"B\n\014NodeSettings\0222\n\006common" - + "\030\001 \001(\0132\".google.api.CommonLanguageSettin" - + "gs\"D\n\016DotnetSettings\0222\n\006common\030\001 \001(\0132\".g" - + "oogle.api.CommonLanguageSettings\"B\n\014Ruby" - + "Settings\0222\n\006common\030\001 \001(\0132\".google.api.Co" - + "mmonLanguageSettings\"@\n\nGoSettings\0222\n\006co" - + "mmon\030\001 \001(\0132\".google.api.CommonLanguageSe" - + "ttings\"\260\002\n\016MethodSettings\022\020\n\010selector\030\001 " - + "\001(\t\022<\n\014long_running\030\002 \001(\0132&.google.api.M" - + "ethodSettings.LongRunning\032\315\001\n\013LongRunnin" - + "g\0225\n\022initial_poll_delay\030\001 \001(\0132\031.google.p" - + "rotobuf.Duration\022\035\n\025poll_delay_multiplie" - + "r\030\002 \001(\002\0221\n\016max_poll_delay\030\003 \001(\0132\031.google" - + ".protobuf.Duration\0225\n\022total_poll_timeout" - + "\030\004 \001(\0132\031.google.protobuf.Duration*y\n\031Cli" - + "entLibraryOrganization\022+\n\'CLIENT_LIBRARY" - + "_ORGANIZATION_UNSPECIFIED\020\000\022\t\n\005CLOUD\020\001\022\007" - + "\n\003ADS\020\002\022\n\n\006PHOTOS\020\003\022\017\n\013STREET_VIEW\020\004*g\n\030" - + "ClientLibraryDestination\022*\n&CLIENT_LIBRA" - + "RY_DESTINATION_UNSPECIFIED\020\000\022\n\n\006GITHUB\020\n" - + "\022\023\n\017PACKAGE_MANAGER\020\024:9\n\020method_signatur" - + "e\022\036.google.protobuf.MethodOptions\030\233\010 \003(\t" - + ":6\n\014default_host\022\037.google.protobuf.Servi" - + "ceOptions\030\231\010 \001(\t:6\n\014oauth_scopes\022\037.googl" - + "e.protobuf.ServiceOptions\030\232\010 \001(\tBi\n\016com." - + "google.apiB\013ClientProtoP\001ZAgoogle.golang" - + ".org/genproto/googleapis/api/annotations" - + ";annotations\242\002\004GAPIb\006proto3" + "\n" + + "\027google/api/client.proto\022\n" + + "google.api\032\035google/api/launch_stage.proto\032 google/pro" + + "tobuf/descriptor.proto\032\036google/protobuf/duration.proto\"\276\001\n" + + "\026CommonLanguageSettings\022\036\n" + + "\022reference_docs_uri\030\001 \001(\tB\002\030\001\022:\n" + + "\014destinations\030\002 \003(\0162$.google.api.ClientLibraryDestination\022H\n" + + "\032selective_gapic_generation\030\003" + + " \001(\0132$.google.api.SelectiveGapicGeneration\"\373\003\n" + + "\025ClientLibrarySettings\022\017\n" + + "\007version\030\001 \001(\t\022-\n" + + "\014launch_stage\030\002 \001(\0162\027.google.api.LaunchStage\022\032\n" + + "\022rest_numeric_enums\030\003 \001(\010\022/\n\r" + + "java_settings\030\025 \001(\0132\030.google.api.JavaSettings\022-\n" + + "\014cpp_settings\030\026 \001(\0132\027.google.api.CppSettings\022-\n" + + "\014php_settings\030\027 \001(\0132\027.google.api.PhpSettings\0223\n" + + "\017python_settings\030\030 \001(\0132\032.google.api.PythonSettings\022/\n\r" + + "node_settings\030\031 \001(\0132\030.google.api.NodeSettings\0223\n" + + "\017dotnet_settings\030\032 \001(\0132\032.google.api.DotnetSettings\022/\n\r" + + "ruby_settings\030\033 \001(\0132\030.google.api.RubySettings\022+\n" + + "\013go_settings\030\034 \001(\0132\026.google.api.GoSettings\"\250\003\n\n" + + "Publishing\0223\n" + + "\017method_settings\030\002 \003(\0132\032.google.api.MethodSettings\022\025\n\r" + + "new_issue_uri\030e \001(\t\022\031\n" + + "\021documentation_uri\030f \001(\t\022\026\n" + + "\016api_short_name\030g \001(\t\022\024\n" + + "\014github_label\030h \001(\t\022\036\n" + + "\026codeowner_github_teams\030i \003(\t\022\026\n" + + "\016doc_tag_prefix\030j \001(\t\022;\n" + + "\014organization\030k \001(\0162%.google.api.ClientLibraryOrganization\022;\n" + + "\020library_settings\030m \003(\0132!.google.api.ClientLibrarySettings\022)\n" + + "!proto_reference_documentation_uri\030n \001(\t\022(\n" + + " rest_reference_documentation_uri\030o \001(\t\"\343\001\n" + + "\014JavaSettings\022\027\n" + + "\017library_package\030\001 \001(\t\022L\n" + + "\023service_class_names\030\002" + + " \003(\0132/.google.api.JavaSettings.ServiceClassNamesEntry\0222\n" + + "\006common\030\003 \001(\0132\".google.api.CommonLanguageSettings\0328\n" + + "\026ServiceClassNamesEntry\022\013\n" + + "\003key\030\001 \001(\t\022\r\n" + + "\005value\030\002 \001(\t:\0028\001\"A\n" + + "\013CppSettings\0222\n" + + "\006common\030\001 \001(\0132\".google.api.CommonLanguageSettings\"A\n" + + "\013PhpSettings\0222\n" + + "\006common\030\001 \001(\0132\".google.api.CommonLanguageSettings\"\233\002\n" + + "\016PythonSettings\0222\n" + + "\006common\030\001 \001(\0132\".google.api.CommonLanguageSettings\022N\n" + + "\025experimental_features\030\002" + + " \001(\0132/.google.api.PythonSettings.ExperimentalFeatures\032\204\001\n" + + "\024ExperimentalFeatures\022\035\n" + + "\025rest_async_io_enabled\030\001 \001(\010\022\'\n" + + "\037protobuf_pythonic_types_enabled\030\002 \001(\010\022$\n" + + "\034unversioned_package_disabled\030\003 \001(\010\"B\n" + + "\014NodeSettings\0222\n" + + "\006common\030\001 \001(\0132\".google.api.CommonLanguageSettings\"\252\003\n" + + "\016DotnetSettings\0222\n" + + "\006common\030\001 \001(\0132\".google.api.CommonLanguageSettings\022I\n" + + "\020renamed_services\030\002 \003(\0132" + + "/.google.api.DotnetSettings.RenamedServicesEntry\022K\n" + + "\021renamed_resources\030\003 \003(\01320.go" + + "ogle.api.DotnetSettings.RenamedResourcesEntry\022\031\n" + + "\021ignored_resources\030\004 \003(\t\022 \n" + + "\030forced_namespace_aliases\030\005 \003(\t\022\036\n" + + "\026handwritten_signatures\030\006 \003(\t\0326\n" + + "\024RenamedServicesEntry\022\013\n" + + "\003key\030\001 \001(\t\022\r\n" + + "\005value\030\002 \001(\t:\0028\001\0327\n" + + "\025RenamedResourcesEntry\022\013\n" + + "\003key\030\001 \001(\t\022\r\n" + + "\005value\030\002 \001(\t:\0028\001\"B\n" + + "\014RubySettings\0222\n" + + "\006common\030\001 \001(\0132\".google.api.CommonLanguageSettings\"\277\001\n\n" + + "GoSettings\0222\n" + + "\006common\030\001 \001(\0132\".google.api.CommonLanguageSettings\022E\n" + + "\020renamed_services\030\002" + + " \003(\0132+.google.api.GoSettings.RenamedServicesEntry\0326\n" + + "\024RenamedServicesEntry\022\013\n" + + "\003key\030\001 \001(\t\022\r\n" + + "\005value\030\002 \001(\t:\0028\001\"\317\002\n" + + "\016MethodSettings\022\020\n" + + "\010selector\030\001 \001(\t\022<\n" + + "\014long_running\030\002 \001(\0132&.google.api.MethodSettings.LongRunning\022\035\n" + + "\025auto_populated_fields\030\003 \003(\t\032\315\001\n" + + "\013LongRunning\0225\n" + + "\022initial_poll_delay\030\001 \001(\0132\031.google.protobuf.Duration\022\035\n" + + "\025poll_delay_multiplier\030\002 \001(\002\0221\n" + + "\016max_poll_delay\030\003 \001(\0132\031.google.protobuf.Duration\0225\n" + + "\022total_poll_timeout\030\004 \001(\0132\031.google.protobuf.Duration\"Q\n" + + "\030SelectiveGapicGeneration\022\017\n" + + "\007methods\030\001 \003(\t\022$\n" + + "\034generate_omitted_as_internal\030\002 \001(\010*\243\001\n" + + "\031ClientLibraryOrganization\022+\n" + + "\'CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED\020\000\022\t\n" + + "\005CLOUD\020\001\022\007\n" + + "\003ADS\020\002\022\n\n" + + "\006PHOTOS\020\003\022\017\n" + + "\013STREET_VIEW\020\004\022\014\n" + + "\010SHOPPING\020\005\022\007\n" + + "\003GEO\020\006\022\021\n\r" + + "GENERATIVE_AI\020\007*g\n" + + "\030ClientLibraryDestination\022*\n" + + "&CLIENT_LIBRARY_DESTINATION_UNSPECIFIED\020\000\022\n\n" + + "\006GITHUB\020\n" + + "\022\023\n" + + "\017PACKAGE_MANAGER\020\024:9\n" + + "\020method_signature\022\036.google.protobuf.MethodOptions\030\233\010 \003(\t:6\n" + + "\014default_host\022\037.google.protobuf.ServiceOptions\030\231\010 \001(\t:6\n" + + "\014oauth_scopes\022\037.google.protobuf.ServiceOptions\030\232\010 \001(\t:8\n" + + "\013api_version\022\037.google.protobuf.ServiceOptions\030\301\272\253\372\001 \001(" + + "\tBi\n" + + "\016com.google.apiB\013ClientProtoP\001ZAgoogle.gola" + + "ng.org/genproto/googleapis/api/annotations;annotations\242\002\004GAPIb\006proto3" }; descriptor = com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( @@ -266,17 +394,16 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { com.google.protobuf.DurationProto.getDescriptor(), }); internal_static_google_api_CommonLanguageSettings_descriptor = - getDescriptor().getMessageTypes().get(0); + getDescriptor().getMessageType(0); internal_static_google_api_CommonLanguageSettings_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_google_api_CommonLanguageSettings_descriptor, new java.lang.String[] { - "ReferenceDocsUri", "Destinations", + "ReferenceDocsUri", "Destinations", "SelectiveGapicGeneration", }); - internal_static_google_api_ClientLibrarySettings_descriptor = - getDescriptor().getMessageTypes().get(1); + internal_static_google_api_ClientLibrarySettings_descriptor = getDescriptor().getMessageType(1); internal_static_google_api_ClientLibrarySettings_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_google_api_ClientLibrarySettings_descriptor, new java.lang.String[] { "Version", @@ -291,9 +418,9 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "RubySettings", "GoSettings", }); - internal_static_google_api_Publishing_descriptor = getDescriptor().getMessageTypes().get(2); + internal_static_google_api_Publishing_descriptor = getDescriptor().getMessageType(2); internal_static_google_api_Publishing_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_google_api_Publishing_descriptor, new java.lang.String[] { "MethodSettings", @@ -305,90 +432,138 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "DocTagPrefix", "Organization", "LibrarySettings", + "ProtoReferenceDocumentationUri", + "RestReferenceDocumentationUri", }); - internal_static_google_api_JavaSettings_descriptor = getDescriptor().getMessageTypes().get(3); + internal_static_google_api_JavaSettings_descriptor = getDescriptor().getMessageType(3); internal_static_google_api_JavaSettings_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_google_api_JavaSettings_descriptor, new java.lang.String[] { "LibraryPackage", "ServiceClassNames", "Common", }); internal_static_google_api_JavaSettings_ServiceClassNamesEntry_descriptor = - internal_static_google_api_JavaSettings_descriptor.getNestedTypes().get(0); + internal_static_google_api_JavaSettings_descriptor.getNestedType(0); internal_static_google_api_JavaSettings_ServiceClassNamesEntry_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_google_api_JavaSettings_ServiceClassNamesEntry_descriptor, new java.lang.String[] { "Key", "Value", }); - internal_static_google_api_CppSettings_descriptor = getDescriptor().getMessageTypes().get(4); + internal_static_google_api_CppSettings_descriptor = getDescriptor().getMessageType(4); internal_static_google_api_CppSettings_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_google_api_CppSettings_descriptor, new java.lang.String[] { "Common", }); - internal_static_google_api_PhpSettings_descriptor = getDescriptor().getMessageTypes().get(5); + internal_static_google_api_PhpSettings_descriptor = getDescriptor().getMessageType(5); internal_static_google_api_PhpSettings_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_google_api_PhpSettings_descriptor, new java.lang.String[] { "Common", }); - internal_static_google_api_PythonSettings_descriptor = getDescriptor().getMessageTypes().get(6); + internal_static_google_api_PythonSettings_descriptor = getDescriptor().getMessageType(6); internal_static_google_api_PythonSettings_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_google_api_PythonSettings_descriptor, new java.lang.String[] { - "Common", + "Common", "ExperimentalFeatures", }); - internal_static_google_api_NodeSettings_descriptor = getDescriptor().getMessageTypes().get(7); + internal_static_google_api_PythonSettings_ExperimentalFeatures_descriptor = + internal_static_google_api_PythonSettings_descriptor.getNestedType(0); + internal_static_google_api_PythonSettings_ExperimentalFeatures_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_api_PythonSettings_ExperimentalFeatures_descriptor, + new java.lang.String[] { + "RestAsyncIoEnabled", "ProtobufPythonicTypesEnabled", "UnversionedPackageDisabled", + }); + internal_static_google_api_NodeSettings_descriptor = getDescriptor().getMessageType(7); internal_static_google_api_NodeSettings_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_google_api_NodeSettings_descriptor, new java.lang.String[] { "Common", }); - internal_static_google_api_DotnetSettings_descriptor = getDescriptor().getMessageTypes().get(8); + internal_static_google_api_DotnetSettings_descriptor = getDescriptor().getMessageType(8); internal_static_google_api_DotnetSettings_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_google_api_DotnetSettings_descriptor, new java.lang.String[] { "Common", + "RenamedServices", + "RenamedResources", + "IgnoredResources", + "ForcedNamespaceAliases", + "HandwrittenSignatures", + }); + internal_static_google_api_DotnetSettings_RenamedServicesEntry_descriptor = + internal_static_google_api_DotnetSettings_descriptor.getNestedType(0); + internal_static_google_api_DotnetSettings_RenamedServicesEntry_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_api_DotnetSettings_RenamedServicesEntry_descriptor, + new java.lang.String[] { + "Key", "Value", + }); + internal_static_google_api_DotnetSettings_RenamedResourcesEntry_descriptor = + internal_static_google_api_DotnetSettings_descriptor.getNestedType(1); + internal_static_google_api_DotnetSettings_RenamedResourcesEntry_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_api_DotnetSettings_RenamedResourcesEntry_descriptor, + new java.lang.String[] { + "Key", "Value", }); - internal_static_google_api_RubySettings_descriptor = getDescriptor().getMessageTypes().get(9); + internal_static_google_api_RubySettings_descriptor = getDescriptor().getMessageType(9); internal_static_google_api_RubySettings_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_google_api_RubySettings_descriptor, new java.lang.String[] { "Common", }); - internal_static_google_api_GoSettings_descriptor = getDescriptor().getMessageTypes().get(10); + internal_static_google_api_GoSettings_descriptor = getDescriptor().getMessageType(10); internal_static_google_api_GoSettings_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_google_api_GoSettings_descriptor, new java.lang.String[] { - "Common", + "Common", "RenamedServices", }); - internal_static_google_api_MethodSettings_descriptor = - getDescriptor().getMessageTypes().get(11); + internal_static_google_api_GoSettings_RenamedServicesEntry_descriptor = + internal_static_google_api_GoSettings_descriptor.getNestedType(0); + internal_static_google_api_GoSettings_RenamedServicesEntry_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_api_GoSettings_RenamedServicesEntry_descriptor, + new java.lang.String[] { + "Key", "Value", + }); + internal_static_google_api_MethodSettings_descriptor = getDescriptor().getMessageType(11); internal_static_google_api_MethodSettings_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_google_api_MethodSettings_descriptor, new java.lang.String[] { - "Selector", "LongRunning", + "Selector", "LongRunning", "AutoPopulatedFields", }); internal_static_google_api_MethodSettings_LongRunning_descriptor = - internal_static_google_api_MethodSettings_descriptor.getNestedTypes().get(0); + internal_static_google_api_MethodSettings_descriptor.getNestedType(0); internal_static_google_api_MethodSettings_LongRunning_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_google_api_MethodSettings_LongRunning_descriptor, new java.lang.String[] { "InitialPollDelay", "PollDelayMultiplier", "MaxPollDelay", "TotalPollTimeout", }); - methodSignature.internalInit(descriptor.getExtensions().get(0)); - defaultHost.internalInit(descriptor.getExtensions().get(1)); - oauthScopes.internalInit(descriptor.getExtensions().get(2)); + internal_static_google_api_SelectiveGapicGeneration_descriptor = + getDescriptor().getMessageType(12); + internal_static_google_api_SelectiveGapicGeneration_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_api_SelectiveGapicGeneration_descriptor, + new java.lang.String[] { + "Methods", "GenerateOmittedAsInternal", + }); + methodSignature.internalInit(descriptor.getExtension(0)); + defaultHost.internalInit(descriptor.getExtension(1)); + oauthScopes.internalInit(descriptor.getExtension(2)); + apiVersion.internalInit(descriptor.getExtension(3)); + descriptor.resolveAllFeaturesImmutable(); com.google.api.LaunchStageProto.getDescriptor(); com.google.protobuf.DescriptorProtos.getDescriptor(); com.google.protobuf.DurationProto.getDescriptor(); diff --git a/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/CommonLanguageSettings.java b/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/CommonLanguageSettings.java index b15e50ffb9..03b2954e48 100644 --- a/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/CommonLanguageSettings.java +++ b/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/CommonLanguageSettings.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,9 @@ * limitations under the License. */ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: google/api/client.proto +// Protobuf Java Version: 4.33.2 package com.google.api; @@ -27,30 +29,31 @@ * * Protobuf type {@code google.api.CommonLanguageSettings} */ -public final class CommonLanguageSettings extends com.google.protobuf.GeneratedMessageV3 +@com.google.protobuf.Generated +public final class CommonLanguageSettings extends com.google.protobuf.GeneratedMessage implements // @@protoc_insertion_point(message_implements:google.api.CommonLanguageSettings) CommonLanguageSettingsOrBuilder { private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "CommonLanguageSettings"); + } + // Use CommonLanguageSettings.newBuilder() to construct. - private CommonLanguageSettings(com.google.protobuf.GeneratedMessageV3.Builder builder) { + private CommonLanguageSettings(com.google.protobuf.GeneratedMessage.Builder builder) { super(builder); } private CommonLanguageSettings() { referenceDocsUri_ = ""; - destinations_ = java.util.Collections.emptyList(); - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new CommonLanguageSettings(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; + destinations_ = emptyIntList(); } public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { @@ -58,7 +61,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.api.ClientProto .internal_static_google_api_CommonLanguageSettings_fieldAccessorTable @@ -67,8 +70,12 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { com.google.api.CommonLanguageSettings.Builder.class); } + private int bitField0_; public static final int REFERENCE_DOCS_URI_FIELD_NUMBER = 1; - private volatile java.lang.Object referenceDocsUri_; + + @SuppressWarnings("serial") + private volatile java.lang.Object referenceDocsUri_ = ""; + /** * * @@ -77,11 +84,14 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { * https://cloud.google.com/nodejs/docs/reference/asset/latest *
        * - * string reference_docs_uri = 1; + * string reference_docs_uri = 1 [deprecated = true]; * + * @deprecated google.api.CommonLanguageSettings.reference_docs_uri is deprecated. See + * google/api/client.proto;l=122 * @return The referenceDocsUri. */ @java.lang.Override + @java.lang.Deprecated public java.lang.String getReferenceDocsUri() { java.lang.Object ref = referenceDocsUri_; if (ref instanceof java.lang.String) { @@ -93,6 +103,7 @@ public java.lang.String getReferenceDocsUri() { return s; } } + /** * * @@ -101,11 +112,14 @@ public java.lang.String getReferenceDocsUri() { * https://cloud.google.com/nodejs/docs/reference/asset/latest *
        * - * string reference_docs_uri = 1; + * string reference_docs_uri = 1 [deprecated = true]; * + * @deprecated google.api.CommonLanguageSettings.reference_docs_uri is deprecated. See + * google/api/client.proto;l=122 * @return The bytes for referenceDocsUri. */ @java.lang.Override + @java.lang.Deprecated public com.google.protobuf.ByteString getReferenceDocsUriBytes() { java.lang.Object ref = referenceDocsUri_; if (ref instanceof java.lang.String) { @@ -119,19 +133,22 @@ public com.google.protobuf.ByteString getReferenceDocsUriBytes() { } public static final int DESTINATIONS_FIELD_NUMBER = 2; - private java.util.List destinations_; - private static final com.google.protobuf.Internal.ListAdapter.Converter< - java.lang.Integer, com.google.api.ClientLibraryDestination> + + @SuppressWarnings("serial") + private com.google.protobuf.Internal.IntList destinations_ = emptyIntList(); + + private static final com.google.protobuf.Internal.IntListAdapter.IntConverter< + com.google.api.ClientLibraryDestination> destinations_converter_ = - new com.google.protobuf.Internal.ListAdapter.Converter< - java.lang.Integer, com.google.api.ClientLibraryDestination>() { - public com.google.api.ClientLibraryDestination convert(java.lang.Integer from) { - @SuppressWarnings("deprecation") + new com.google.protobuf.Internal.IntListAdapter.IntConverter< + com.google.api.ClientLibraryDestination>() { + public com.google.api.ClientLibraryDestination convert(int from) { com.google.api.ClientLibraryDestination result = - com.google.api.ClientLibraryDestination.valueOf(from); + com.google.api.ClientLibraryDestination.forNumber(from); return result == null ? com.google.api.ClientLibraryDestination.UNRECOGNIZED : result; } }; + /** * * @@ -145,10 +162,10 @@ public com.google.api.ClientLibraryDestination convert(java.lang.Integer from) { */ @java.lang.Override public java.util.List getDestinationsList() { - return new com.google.protobuf.Internal.ListAdapter< - java.lang.Integer, com.google.api.ClientLibraryDestination>( + return new com.google.protobuf.Internal.IntListAdapter( destinations_, destinations_converter_); } + /** * * @@ -164,6 +181,7 @@ public java.util.List getDestinationsLi public int getDestinationsCount() { return destinations_.size(); } + /** * * @@ -178,8 +196,9 @@ public int getDestinationsCount() { */ @java.lang.Override public com.google.api.ClientLibraryDestination getDestinations(int index) { - return destinations_converter_.convert(destinations_.get(index)); + return destinations_converter_.convert(destinations_.getInt(index)); } + /** * * @@ -195,6 +214,7 @@ public com.google.api.ClientLibraryDestination getDestinations(int index) { public java.util.List getDestinationsValueList() { return destinations_; } + /** * * @@ -209,11 +229,64 @@ public java.util.List getDestinationsValueList() { */ @java.lang.Override public int getDestinationsValue(int index) { - return destinations_.get(index); + return destinations_.getInt(index); } private int destinationsMemoizedSerializedSize; + public static final int SELECTIVE_GAPIC_GENERATION_FIELD_NUMBER = 3; + private com.google.api.SelectiveGapicGeneration selectiveGapicGeneration_; + + /** + * + * + *
        +   * Configuration for which RPCs should be generated in the GAPIC client.
        +   * 
        + * + * .google.api.SelectiveGapicGeneration selective_gapic_generation = 3; + * + * @return Whether the selectiveGapicGeneration field is set. + */ + @java.lang.Override + public boolean hasSelectiveGapicGeneration() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
        +   * Configuration for which RPCs should be generated in the GAPIC client.
        +   * 
        + * + * .google.api.SelectiveGapicGeneration selective_gapic_generation = 3; + * + * @return The selectiveGapicGeneration. + */ + @java.lang.Override + public com.google.api.SelectiveGapicGeneration getSelectiveGapicGeneration() { + return selectiveGapicGeneration_ == null + ? com.google.api.SelectiveGapicGeneration.getDefaultInstance() + : selectiveGapicGeneration_; + } + + /** + * + * + *
        +   * Configuration for which RPCs should be generated in the GAPIC client.
        +   * 
        + * + * .google.api.SelectiveGapicGeneration selective_gapic_generation = 3; + */ + @java.lang.Override + public com.google.api.SelectiveGapicGenerationOrBuilder getSelectiveGapicGenerationOrBuilder() { + return selectiveGapicGeneration_ == null + ? com.google.api.SelectiveGapicGeneration.getDefaultInstance() + : selectiveGapicGeneration_; + } + private byte memoizedIsInitialized = -1; @java.lang.Override @@ -229,15 +302,18 @@ public final boolean isInitialized() { @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { getSerializedSize(); - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(referenceDocsUri_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, referenceDocsUri_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(referenceDocsUri_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, referenceDocsUri_); } if (getDestinationsList().size() > 0) { output.writeUInt32NoTag(18); output.writeUInt32NoTag(destinationsMemoizedSerializedSize); } for (int i = 0; i < destinations_.size(); i++) { - output.writeEnumNoTag(destinations_.get(i)); + output.writeEnumNoTag(destinations_.getInt(i)); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(3, getSelectiveGapicGeneration()); } getUnknownFields().writeTo(output); } @@ -248,14 +324,14 @@ public int getSerializedSize() { if (size != -1) return size; size = 0; - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(referenceDocsUri_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, referenceDocsUri_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(referenceDocsUri_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, referenceDocsUri_); } { int dataSize = 0; for (int i = 0; i < destinations_.size(); i++) { dataSize += - com.google.protobuf.CodedOutputStream.computeEnumSizeNoTag(destinations_.get(i)); + com.google.protobuf.CodedOutputStream.computeEnumSizeNoTag(destinations_.getInt(i)); } size += dataSize; if (!getDestinationsList().isEmpty()) { @@ -264,6 +340,11 @@ public int getSerializedSize() { } destinationsMemoizedSerializedSize = dataSize; } + if (((bitField0_ & 0x00000001) != 0)) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 3, getSelectiveGapicGeneration()); + } size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; @@ -281,6 +362,10 @@ public boolean equals(final java.lang.Object obj) { if (!getReferenceDocsUri().equals(other.getReferenceDocsUri())) return false; if (!destinations_.equals(other.destinations_)) return false; + if (hasSelectiveGapicGeneration() != other.hasSelectiveGapicGeneration()) return false; + if (hasSelectiveGapicGeneration()) { + if (!getSelectiveGapicGeneration().equals(other.getSelectiveGapicGeneration())) return false; + } if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -298,6 +383,10 @@ public int hashCode() { hash = (37 * hash) + DESTINATIONS_FIELD_NUMBER; hash = (53 * hash) + destinations_.hashCode(); } + if (hasSelectiveGapicGeneration()) { + hash = (37 * hash) + SELECTIVE_GAPIC_GENERATION_FIELD_NUMBER; + hash = (53 * hash) + getSelectiveGapicGeneration().hashCode(); + } hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; @@ -339,38 +428,38 @@ public static com.google.api.CommonLanguageSettings parseFrom( public static com.google.api.CommonLanguageSettings parseFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); } public static com.google.api.CommonLanguageSettings parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } public static com.google.api.CommonLanguageSettings parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); } public static com.google.api.CommonLanguageSettings parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( PARSER, input, extensionRegistry); } public static com.google.api.CommonLanguageSettings parseFrom( com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); } public static com.google.api.CommonLanguageSettings parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } @@ -393,10 +482,11 @@ public Builder toBuilder() { } @java.lang.Override - protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { Builder builder = new Builder(parent); return builder; } + /** * * @@ -406,7 +496,7 @@ protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.Build * * Protobuf type {@code google.api.CommonLanguageSettings} */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder implements // @@protoc_insertion_point(builder_implements:google.api.CommonLanguageSettings) com.google.api.CommonLanguageSettingsOrBuilder { @@ -416,7 +506,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.api.ClientProto .internal_static_google_api_CommonLanguageSettings_fieldAccessorTable @@ -426,19 +516,32 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } // Construct using com.google.api.CommonLanguageSettings.newBuilder() - private Builder() {} + private Builder() { + maybeForceBuilderInitialization(); + } - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetSelectiveGapicGenerationFieldBuilder(); + } } @java.lang.Override public Builder clear() { super.clear(); + bitField0_ = 0; referenceDocsUri_ = ""; - - destinations_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); + destinations_ = emptyIntList(); + selectiveGapicGeneration_ = null; + if (selectiveGapicGenerationBuilder_ != null) { + selectiveGapicGenerationBuilder_.dispose(); + selectiveGapicGenerationBuilder_ = null; + } return this; } @@ -466,48 +569,31 @@ public com.google.api.CommonLanguageSettings build() { public com.google.api.CommonLanguageSettings buildPartial() { com.google.api.CommonLanguageSettings result = new com.google.api.CommonLanguageSettings(this); - int from_bitField0_ = bitField0_; - result.referenceDocsUri_ = referenceDocsUri_; - if (((bitField0_ & 0x00000001) != 0)) { - destinations_ = java.util.Collections.unmodifiableList(destinations_); - bitField0_ = (bitField0_ & ~0x00000001); + if (bitField0_ != 0) { + buildPartial0(result); } - result.destinations_ = destinations_; 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); + private void buildPartial0(com.google.api.CommonLanguageSettings result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.referenceDocsUri_ = referenceDocsUri_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + destinations_.makeImmutable(); + result.destinations_ = destinations_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000004) != 0)) { + result.selectiveGapicGeneration_ = + selectiveGapicGenerationBuilder_ == null + ? selectiveGapicGeneration_ + : selectiveGapicGenerationBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + result.bitField0_ |= to_bitField0_; } @java.lang.Override @@ -524,18 +610,23 @@ public Builder mergeFrom(com.google.api.CommonLanguageSettings other) { if (other == com.google.api.CommonLanguageSettings.getDefaultInstance()) return this; if (!other.getReferenceDocsUri().isEmpty()) { referenceDocsUri_ = other.referenceDocsUri_; + bitField0_ |= 0x00000001; onChanged(); } if (!other.destinations_.isEmpty()) { if (destinations_.isEmpty()) { destinations_ = other.destinations_; - bitField0_ = (bitField0_ & ~0x00000001); + destinations_.makeImmutable(); + bitField0_ |= 0x00000002; } else { ensureDestinationsIsMutable(); destinations_.addAll(other.destinations_); } onChanged(); } + if (other.hasSelectiveGapicGeneration()) { + mergeSelectiveGapicGeneration(other.getSelectiveGapicGeneration()); + } this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; @@ -565,28 +656,35 @@ public Builder mergeFrom( case 10: { referenceDocsUri_ = input.readStringRequireUtf8(); - + bitField0_ |= 0x00000001; break; } // case 10 case 16: { int tmpRaw = input.readEnum(); ensureDestinationsIsMutable(); - destinations_.add(tmpRaw); + destinations_.addInt(tmpRaw); break; } // case 16 case 18: { int length = input.readRawVarint32(); - int oldLimit = input.pushLimit(length); + int limit = input.pushLimit(length); + ensureDestinationsIsMutable(); while (input.getBytesUntilLimit() > 0) { - int tmpRaw = input.readEnum(); - ensureDestinationsIsMutable(); - destinations_.add(tmpRaw); + destinations_.addInt(input.readEnum()); } - input.popLimit(oldLimit); + input.popLimit(limit); break; } // case 18 + case 26: + { + input.readMessage( + internalGetSelectiveGapicGenerationFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00000004; + break; + } // case 26 default: { if (!super.parseUnknownField(input, extensionRegistry, tag)) { @@ -607,6 +705,7 @@ public Builder mergeFrom( private int bitField0_; private java.lang.Object referenceDocsUri_ = ""; + /** * * @@ -615,10 +714,13 @@ public Builder mergeFrom( * https://cloud.google.com/nodejs/docs/reference/asset/latest *
        * - * string reference_docs_uri = 1; + * string reference_docs_uri = 1 [deprecated = true]; * + * @deprecated google.api.CommonLanguageSettings.reference_docs_uri is deprecated. See + * google/api/client.proto;l=122 * @return The referenceDocsUri. */ + @java.lang.Deprecated public java.lang.String getReferenceDocsUri() { java.lang.Object ref = referenceDocsUri_; if (!(ref instanceof java.lang.String)) { @@ -630,6 +732,7 @@ public java.lang.String getReferenceDocsUri() { return (java.lang.String) ref; } } + /** * * @@ -638,10 +741,13 @@ public java.lang.String getReferenceDocsUri() { * https://cloud.google.com/nodejs/docs/reference/asset/latest *
        * - * string reference_docs_uri = 1; + * string reference_docs_uri = 1 [deprecated = true]; * + * @deprecated google.api.CommonLanguageSettings.reference_docs_uri is deprecated. See + * google/api/client.proto;l=122 * @return The bytes for referenceDocsUri. */ + @java.lang.Deprecated public com.google.protobuf.ByteString getReferenceDocsUriBytes() { java.lang.Object ref = referenceDocsUri_; if (ref instanceof String) { @@ -653,6 +759,7 @@ public com.google.protobuf.ByteString getReferenceDocsUriBytes() { return (com.google.protobuf.ByteString) ref; } } + /** * * @@ -661,20 +768,24 @@ public com.google.protobuf.ByteString getReferenceDocsUriBytes() { * https://cloud.google.com/nodejs/docs/reference/asset/latest *
        * - * string reference_docs_uri = 1; + * string reference_docs_uri = 1 [deprecated = true]; * + * @deprecated google.api.CommonLanguageSettings.reference_docs_uri is deprecated. See + * google/api/client.proto;l=122 * @param value The referenceDocsUri to set. * @return This builder for chaining. */ + @java.lang.Deprecated public Builder setReferenceDocsUri(java.lang.String value) { if (value == null) { throw new NullPointerException(); } - referenceDocsUri_ = value; + bitField0_ |= 0x00000001; onChanged(); return this; } + /** * * @@ -683,16 +794,20 @@ public Builder setReferenceDocsUri(java.lang.String value) { * https://cloud.google.com/nodejs/docs/reference/asset/latest *
        * - * string reference_docs_uri = 1; + * string reference_docs_uri = 1 [deprecated = true]; * + * @deprecated google.api.CommonLanguageSettings.reference_docs_uri is deprecated. See + * google/api/client.proto;l=122 * @return This builder for chaining. */ + @java.lang.Deprecated public Builder clearReferenceDocsUri() { - referenceDocsUri_ = getDefaultInstance().getReferenceDocsUri(); + bitField0_ = (bitField0_ & ~0x00000001); onChanged(); return this; } + /** * * @@ -701,30 +816,34 @@ public Builder clearReferenceDocsUri() { * https://cloud.google.com/nodejs/docs/reference/asset/latest *
        * - * string reference_docs_uri = 1; + * string reference_docs_uri = 1 [deprecated = true]; * + * @deprecated google.api.CommonLanguageSettings.reference_docs_uri is deprecated. See + * google/api/client.proto;l=122 * @param value The bytes for referenceDocsUri to set. * @return This builder for chaining. */ + @java.lang.Deprecated public Builder setReferenceDocsUriBytes(com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); } checkByteStringIsUtf8(value); - referenceDocsUri_ = value; + bitField0_ |= 0x00000001; onChanged(); return this; } - private java.util.List destinations_ = java.util.Collections.emptyList(); + private com.google.protobuf.Internal.IntList destinations_ = emptyIntList(); private void ensureDestinationsIsMutable() { - if (!((bitField0_ & 0x00000001) != 0)) { - destinations_ = new java.util.ArrayList(destinations_); - bitField0_ |= 0x00000001; + if (!destinations_.isModifiable()) { + destinations_ = makeMutableCopy(destinations_); } + bitField0_ |= 0x00000002; } + /** * * @@ -737,10 +856,10 @@ private void ensureDestinationsIsMutable() { * @return A list containing the destinations. */ public java.util.List getDestinationsList() { - return new com.google.protobuf.Internal.ListAdapter< - java.lang.Integer, com.google.api.ClientLibraryDestination>( - destinations_, destinations_converter_); + return new com.google.protobuf.Internal.IntListAdapter< + com.google.api.ClientLibraryDestination>(destinations_, destinations_converter_); } + /** * * @@ -755,6 +874,7 @@ public java.util.List getDestinationsLi public int getDestinationsCount() { return destinations_.size(); } + /** * * @@ -768,8 +888,9 @@ public int getDestinationsCount() { * @return The destinations at the given index. */ public com.google.api.ClientLibraryDestination getDestinations(int index) { - return destinations_converter_.convert(destinations_.get(index)); + return destinations_converter_.convert(destinations_.getInt(index)); } + /** * * @@ -788,10 +909,11 @@ public Builder setDestinations(int index, com.google.api.ClientLibraryDestinatio throw new NullPointerException(); } ensureDestinationsIsMutable(); - destinations_.set(index, value.getNumber()); + destinations_.setInt(index, value.getNumber()); onChanged(); return this; } + /** * * @@ -809,10 +931,11 @@ public Builder addDestinations(com.google.api.ClientLibraryDestination value) { throw new NullPointerException(); } ensureDestinationsIsMutable(); - destinations_.add(value.getNumber()); + destinations_.addInt(value.getNumber()); onChanged(); return this; } + /** * * @@ -829,11 +952,12 @@ public Builder addAllDestinations( java.lang.Iterable values) { ensureDestinationsIsMutable(); for (com.google.api.ClientLibraryDestination value : values) { - destinations_.add(value.getNumber()); + destinations_.addInt(value.getNumber()); } onChanged(); return this; } + /** * * @@ -846,11 +970,12 @@ public Builder addAllDestinations( * @return This builder for chaining. */ public Builder clearDestinations() { - destinations_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); + destinations_ = emptyIntList(); + bitField0_ = (bitField0_ & ~0x00000002); onChanged(); return this; } + /** * * @@ -863,8 +988,10 @@ public Builder clearDestinations() { * @return A list containing the enum numeric values on the wire for destinations. */ public java.util.List getDestinationsValueList() { - return java.util.Collections.unmodifiableList(destinations_); + destinations_.makeImmutable(); + return destinations_; } + /** * * @@ -878,8 +1005,9 @@ public java.util.List getDestinationsValueList() { * @return The enum numeric value on the wire of destinations at the given index. */ public int getDestinationsValue(int index) { - return destinations_.get(index); + return destinations_.getInt(index); } + /** * * @@ -895,10 +1023,11 @@ public int getDestinationsValue(int index) { */ public Builder setDestinationsValue(int index, int value) { ensureDestinationsIsMutable(); - destinations_.set(index, value); + destinations_.setInt(index, value); onChanged(); return this; } + /** * * @@ -913,10 +1042,11 @@ public Builder setDestinationsValue(int index, int value) { */ public Builder addDestinationsValue(int value) { ensureDestinationsIsMutable(); - destinations_.add(value); + destinations_.addInt(value); onChanged(); return this; } + /** * * @@ -932,21 +1062,206 @@ public Builder addDestinationsValue(int value) { public Builder addAllDestinationsValue(java.lang.Iterable values) { ensureDestinationsIsMutable(); for (int value : values) { - destinations_.add(value); + destinations_.addInt(value); } onChanged(); return this; } - @java.lang.Override - public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); + private com.google.api.SelectiveGapicGeneration selectiveGapicGeneration_; + private com.google.protobuf.SingleFieldBuilder< + com.google.api.SelectiveGapicGeneration, + com.google.api.SelectiveGapicGeneration.Builder, + com.google.api.SelectiveGapicGenerationOrBuilder> + selectiveGapicGenerationBuilder_; + + /** + * + * + *
        +     * Configuration for which RPCs should be generated in the GAPIC client.
        +     * 
        + * + * .google.api.SelectiveGapicGeneration selective_gapic_generation = 3; + * + * @return Whether the selectiveGapicGeneration field is set. + */ + public boolean hasSelectiveGapicGeneration() { + return ((bitField0_ & 0x00000004) != 0); } - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); + /** + * + * + *
        +     * Configuration for which RPCs should be generated in the GAPIC client.
        +     * 
        + * + * .google.api.SelectiveGapicGeneration selective_gapic_generation = 3; + * + * @return The selectiveGapicGeneration. + */ + public com.google.api.SelectiveGapicGeneration getSelectiveGapicGeneration() { + if (selectiveGapicGenerationBuilder_ == null) { + return selectiveGapicGeneration_ == null + ? com.google.api.SelectiveGapicGeneration.getDefaultInstance() + : selectiveGapicGeneration_; + } else { + return selectiveGapicGenerationBuilder_.getMessage(); + } + } + + /** + * + * + *
        +     * Configuration for which RPCs should be generated in the GAPIC client.
        +     * 
        + * + * .google.api.SelectiveGapicGeneration selective_gapic_generation = 3; + */ + public Builder setSelectiveGapicGeneration(com.google.api.SelectiveGapicGeneration value) { + if (selectiveGapicGenerationBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + selectiveGapicGeneration_ = value; + } else { + selectiveGapicGenerationBuilder_.setMessage(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
        +     * Configuration for which RPCs should be generated in the GAPIC client.
        +     * 
        + * + * .google.api.SelectiveGapicGeneration selective_gapic_generation = 3; + */ + public Builder setSelectiveGapicGeneration( + com.google.api.SelectiveGapicGeneration.Builder builderForValue) { + if (selectiveGapicGenerationBuilder_ == null) { + selectiveGapicGeneration_ = builderForValue.build(); + } else { + selectiveGapicGenerationBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
        +     * Configuration for which RPCs should be generated in the GAPIC client.
        +     * 
        + * + * .google.api.SelectiveGapicGeneration selective_gapic_generation = 3; + */ + public Builder mergeSelectiveGapicGeneration(com.google.api.SelectiveGapicGeneration value) { + if (selectiveGapicGenerationBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0) + && selectiveGapicGeneration_ != null + && selectiveGapicGeneration_ + != com.google.api.SelectiveGapicGeneration.getDefaultInstance()) { + getSelectiveGapicGenerationBuilder().mergeFrom(value); + } else { + selectiveGapicGeneration_ = value; + } + } else { + selectiveGapicGenerationBuilder_.mergeFrom(value); + } + if (selectiveGapicGeneration_ != null) { + bitField0_ |= 0x00000004; + onChanged(); + } + return this; + } + + /** + * + * + *
        +     * Configuration for which RPCs should be generated in the GAPIC client.
        +     * 
        + * + * .google.api.SelectiveGapicGeneration selective_gapic_generation = 3; + */ + public Builder clearSelectiveGapicGeneration() { + bitField0_ = (bitField0_ & ~0x00000004); + selectiveGapicGeneration_ = null; + if (selectiveGapicGenerationBuilder_ != null) { + selectiveGapicGenerationBuilder_.dispose(); + selectiveGapicGenerationBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
        +     * Configuration for which RPCs should be generated in the GAPIC client.
        +     * 
        + * + * .google.api.SelectiveGapicGeneration selective_gapic_generation = 3; + */ + public com.google.api.SelectiveGapicGeneration.Builder getSelectiveGapicGenerationBuilder() { + bitField0_ |= 0x00000004; + onChanged(); + return internalGetSelectiveGapicGenerationFieldBuilder().getBuilder(); + } + + /** + * + * + *
        +     * Configuration for which RPCs should be generated in the GAPIC client.
        +     * 
        + * + * .google.api.SelectiveGapicGeneration selective_gapic_generation = 3; + */ + public com.google.api.SelectiveGapicGenerationOrBuilder getSelectiveGapicGenerationOrBuilder() { + if (selectiveGapicGenerationBuilder_ != null) { + return selectiveGapicGenerationBuilder_.getMessageOrBuilder(); + } else { + return selectiveGapicGeneration_ == null + ? com.google.api.SelectiveGapicGeneration.getDefaultInstance() + : selectiveGapicGeneration_; + } + } + + /** + * + * + *
        +     * Configuration for which RPCs should be generated in the GAPIC client.
        +     * 
        + * + * .google.api.SelectiveGapicGeneration selective_gapic_generation = 3; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.api.SelectiveGapicGeneration, + com.google.api.SelectiveGapicGeneration.Builder, + com.google.api.SelectiveGapicGenerationOrBuilder> + internalGetSelectiveGapicGenerationFieldBuilder() { + if (selectiveGapicGenerationBuilder_ == null) { + selectiveGapicGenerationBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.api.SelectiveGapicGeneration, + com.google.api.SelectiveGapicGeneration.Builder, + com.google.api.SelectiveGapicGenerationOrBuilder>( + getSelectiveGapicGeneration(), getParentForChildren(), isClean()); + selectiveGapicGeneration_ = null; + } + return selectiveGapicGenerationBuilder_; } // @@protoc_insertion_point(builder_scope:google.api.CommonLanguageSettings) diff --git a/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/CommonLanguageSettingsOrBuilder.java b/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/CommonLanguageSettingsOrBuilder.java index 98256fa82b..d0112cddac 100644 --- a/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/CommonLanguageSettingsOrBuilder.java +++ b/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/CommonLanguageSettingsOrBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,10 +14,13 @@ * limitations under the License. */ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: google/api/client.proto +// Protobuf Java Version: 4.33.2 package com.google.api; +@com.google.protobuf.Generated public interface CommonLanguageSettingsOrBuilder extends // @@protoc_insertion_point(interface_extends:google.api.CommonLanguageSettings) @@ -31,11 +34,15 @@ public interface CommonLanguageSettingsOrBuilder * https://cloud.google.com/nodejs/docs/reference/asset/latest *
        * - * string reference_docs_uri = 1; + * string reference_docs_uri = 1 [deprecated = true]; * + * @deprecated google.api.CommonLanguageSettings.reference_docs_uri is deprecated. See + * google/api/client.proto;l=122 * @return The referenceDocsUri. */ + @java.lang.Deprecated java.lang.String getReferenceDocsUri(); + /** * * @@ -44,10 +51,13 @@ public interface CommonLanguageSettingsOrBuilder * https://cloud.google.com/nodejs/docs/reference/asset/latest *
        * - * string reference_docs_uri = 1; + * string reference_docs_uri = 1 [deprecated = true]; * + * @deprecated google.api.CommonLanguageSettings.reference_docs_uri is deprecated. See + * google/api/client.proto;l=122 * @return The bytes for referenceDocsUri. */ + @java.lang.Deprecated com.google.protobuf.ByteString getReferenceDocsUriBytes(); /** @@ -62,6 +72,7 @@ public interface CommonLanguageSettingsOrBuilder * @return A list containing the destinations. */ java.util.List getDestinationsList(); + /** * * @@ -74,6 +85,7 @@ public interface CommonLanguageSettingsOrBuilder * @return The count of destinations. */ int getDestinationsCount(); + /** * * @@ -87,6 +99,7 @@ public interface CommonLanguageSettingsOrBuilder * @return The destinations at the given index. */ com.google.api.ClientLibraryDestination getDestinations(int index); + /** * * @@ -99,6 +112,7 @@ public interface CommonLanguageSettingsOrBuilder * @return A list containing the enum numeric values on the wire for destinations. */ java.util.List getDestinationsValueList(); + /** * * @@ -112,4 +126,41 @@ public interface CommonLanguageSettingsOrBuilder * @return The enum numeric value on the wire of destinations at the given index. */ int getDestinationsValue(int index); + + /** + * + * + *
        +   * Configuration for which RPCs should be generated in the GAPIC client.
        +   * 
        + * + * .google.api.SelectiveGapicGeneration selective_gapic_generation = 3; + * + * @return Whether the selectiveGapicGeneration field is set. + */ + boolean hasSelectiveGapicGeneration(); + + /** + * + * + *
        +   * Configuration for which RPCs should be generated in the GAPIC client.
        +   * 
        + * + * .google.api.SelectiveGapicGeneration selective_gapic_generation = 3; + * + * @return The selectiveGapicGeneration. + */ + com.google.api.SelectiveGapicGeneration getSelectiveGapicGeneration(); + + /** + * + * + *
        +   * Configuration for which RPCs should be generated in the GAPIC client.
        +   * 
        + * + * .google.api.SelectiveGapicGeneration selective_gapic_generation = 3; + */ + com.google.api.SelectiveGapicGenerationOrBuilder getSelectiveGapicGenerationOrBuilder(); } diff --git a/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/ConfigChange.java b/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/ConfigChange.java index a4bc124a9d..868360e09f 100644 --- a/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/ConfigChange.java +++ b/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/ConfigChange.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,9 @@ * limitations under the License. */ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: google/api/config_change.proto +// Protobuf Java Version: 4.33.2 package com.google.api; @@ -24,6 +26,7 @@ *
          * Output generated from semantically comparing two versions of a service
          * configuration.
        + *
          * Includes detailed information about a field that have changed with
          * applicable advice about potential consequences for the change, such as
          * backwards-incompatibility.
        @@ -31,13 +34,25 @@
          *
          * Protobuf type {@code google.api.ConfigChange}
          */
        -public final class ConfigChange extends com.google.protobuf.GeneratedMessageV3
        +@com.google.protobuf.Generated
        +public final class ConfigChange extends com.google.protobuf.GeneratedMessage
             implements
             // @@protoc_insertion_point(message_implements:google.api.ConfigChange)
             ConfigChangeOrBuilder {
           private static final long serialVersionUID = 0L;
        +
        +  static {
        +    com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion(
        +        com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC,
        +        /* major= */ 4,
        +        /* minor= */ 33,
        +        /* patch= */ 2,
        +        /* suffix= */ "",
        +        "ConfigChange");
        +  }
        +
           // Use ConfigChange.newBuilder() to construct.
        -  private ConfigChange(com.google.protobuf.GeneratedMessageV3.Builder builder) {
        +  private ConfigChange(com.google.protobuf.GeneratedMessage.Builder builder) {
             super(builder);
           }
         
        @@ -49,23 +64,12 @@ private ConfigChange() {
             advices_ = java.util.Collections.emptyList();
           }
         
        -  @java.lang.Override
        -  @SuppressWarnings({"unused"})
        -  protected java.lang.Object newInstance(UnusedPrivateParameter unused) {
        -    return new ConfigChange();
        -  }
        -
        -  @java.lang.Override
        -  public final com.google.protobuf.UnknownFieldSet getUnknownFields() {
        -    return this.unknownFields;
        -  }
        -
           public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
             return com.google.api.ConfigChangeProto.internal_static_google_api_ConfigChange_descriptor;
           }
         
           @java.lang.Override
        -  protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
        +  protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
               internalGetFieldAccessorTable() {
             return com.google.api.ConfigChangeProto
                 .internal_static_google_api_ConfigChange_fieldAccessorTable
        @@ -74,7 +78,10 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
           }
         
           public static final int ELEMENT_FIELD_NUMBER = 1;
        -  private volatile java.lang.Object element_;
        +
        +  @SuppressWarnings("serial")
        +  private volatile java.lang.Object element_ = "";
        +
           /**
            *
            *
        @@ -106,6 +113,7 @@ public java.lang.String getElement() {
               return s;
             }
           }
        +
           /**
            *
            *
        @@ -139,7 +147,10 @@ public com.google.protobuf.ByteString getElementBytes() {
           }
         
           public static final int OLD_VALUE_FIELD_NUMBER = 2;
        -  private volatile java.lang.Object oldValue_;
        +
        +  @SuppressWarnings("serial")
        +  private volatile java.lang.Object oldValue_ = "";
        +
           /**
            *
            *
        @@ -164,6 +175,7 @@ public java.lang.String getOldValue() {
               return s;
             }
           }
        +
           /**
            *
            *
        @@ -190,7 +202,10 @@ public com.google.protobuf.ByteString getOldValueBytes() {
           }
         
           public static final int NEW_VALUE_FIELD_NUMBER = 3;
        -  private volatile java.lang.Object newValue_;
        +
        +  @SuppressWarnings("serial")
        +  private volatile java.lang.Object newValue_ = "";
        +
           /**
            *
            *
        @@ -215,6 +230,7 @@ public java.lang.String getNewValue() {
               return s;
             }
           }
        +
           /**
            *
            *
        @@ -241,7 +257,8 @@ public com.google.protobuf.ByteString getNewValueBytes() {
           }
         
           public static final int CHANGE_TYPE_FIELD_NUMBER = 4;
        -  private int changeType_;
        +  private int changeType_ = 0;
        +
           /**
            *
            *
        @@ -257,6 +274,7 @@ public com.google.protobuf.ByteString getNewValueBytes() {
           public int getChangeTypeValue() {
             return changeType_;
           }
        +
           /**
            *
            *
        @@ -270,13 +288,15 @@ public int getChangeTypeValue() {
            */
           @java.lang.Override
           public com.google.api.ChangeType getChangeType() {
        -    @SuppressWarnings("deprecation")
        -    com.google.api.ChangeType result = com.google.api.ChangeType.valueOf(changeType_);
        +    com.google.api.ChangeType result = com.google.api.ChangeType.forNumber(changeType_);
             return result == null ? com.google.api.ChangeType.UNRECOGNIZED : result;
           }
         
           public static final int ADVICES_FIELD_NUMBER = 5;
        +
        +  @SuppressWarnings("serial")
           private java.util.List advices_;
        +
           /**
            *
            *
        @@ -291,6 +311,7 @@ public com.google.api.ChangeType getChangeType() {
           public java.util.List getAdvicesList() {
             return advices_;
           }
        +
           /**
            *
            *
        @@ -305,6 +326,7 @@ public java.util.List getAdvicesList() {
           public java.util.List getAdvicesOrBuilderList() {
             return advices_;
           }
        +
           /**
            *
            *
        @@ -319,6 +341,7 @@ public java.util.List getAdvicesOrBuil
           public int getAdvicesCount() {
             return advices_.size();
           }
        +
           /**
            *
            *
        @@ -333,6 +356,7 @@ public int getAdvicesCount() {
           public com.google.api.Advice getAdvices(int index) {
             return advices_.get(index);
           }
        +
           /**
            *
            *
        @@ -362,14 +386,14 @@ public final boolean isInitialized() {
         
           @java.lang.Override
           public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException {
        -    if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(element_)) {
        -      com.google.protobuf.GeneratedMessageV3.writeString(output, 1, element_);
        +    if (!com.google.protobuf.GeneratedMessage.isStringEmpty(element_)) {
        +      com.google.protobuf.GeneratedMessage.writeString(output, 1, element_);
             }
        -    if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(oldValue_)) {
        -      com.google.protobuf.GeneratedMessageV3.writeString(output, 2, oldValue_);
        +    if (!com.google.protobuf.GeneratedMessage.isStringEmpty(oldValue_)) {
        +      com.google.protobuf.GeneratedMessage.writeString(output, 2, oldValue_);
             }
        -    if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(newValue_)) {
        -      com.google.protobuf.GeneratedMessageV3.writeString(output, 3, newValue_);
        +    if (!com.google.protobuf.GeneratedMessage.isStringEmpty(newValue_)) {
        +      com.google.protobuf.GeneratedMessage.writeString(output, 3, newValue_);
             }
             if (changeType_ != com.google.api.ChangeType.CHANGE_TYPE_UNSPECIFIED.getNumber()) {
               output.writeEnum(4, changeType_);
        @@ -386,14 +410,14 @@ public int getSerializedSize() {
             if (size != -1) return size;
         
             size = 0;
        -    if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(element_)) {
        -      size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, element_);
        +    if (!com.google.protobuf.GeneratedMessage.isStringEmpty(element_)) {
        +      size += com.google.protobuf.GeneratedMessage.computeStringSize(1, element_);
             }
        -    if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(oldValue_)) {
        -      size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, oldValue_);
        +    if (!com.google.protobuf.GeneratedMessage.isStringEmpty(oldValue_)) {
        +      size += com.google.protobuf.GeneratedMessage.computeStringSize(2, oldValue_);
             }
        -    if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(newValue_)) {
        -      size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, newValue_);
        +    if (!com.google.protobuf.GeneratedMessage.isStringEmpty(newValue_)) {
        +      size += com.google.protobuf.GeneratedMessage.computeStringSize(3, newValue_);
             }
             if (changeType_ != com.google.api.ChangeType.CHANGE_TYPE_UNSPECIFIED.getNumber()) {
               size += com.google.protobuf.CodedOutputStream.computeEnumSize(4, changeType_);
        @@ -485,38 +509,38 @@ public static com.google.api.ConfigChange parseFrom(
         
           public static com.google.api.ConfigChange parseFrom(java.io.InputStream input)
               throws java.io.IOException {
        -    return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
        +    return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input);
           }
         
           public static com.google.api.ConfigChange parseFrom(
               java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
               throws java.io.IOException {
        -    return com.google.protobuf.GeneratedMessageV3.parseWithIOException(
        +    return com.google.protobuf.GeneratedMessage.parseWithIOException(
                 PARSER, input, extensionRegistry);
           }
         
           public static com.google.api.ConfigChange parseDelimitedFrom(java.io.InputStream input)
               throws java.io.IOException {
        -    return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input);
        +    return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input);
           }
         
           public static com.google.api.ConfigChange parseDelimitedFrom(
               java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
               throws java.io.IOException {
        -    return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(
        +    return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(
                 PARSER, input, extensionRegistry);
           }
         
           public static com.google.api.ConfigChange parseFrom(com.google.protobuf.CodedInputStream input)
               throws java.io.IOException {
        -    return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
        +    return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input);
           }
         
           public static com.google.api.ConfigChange parseFrom(
               com.google.protobuf.CodedInputStream input,
               com.google.protobuf.ExtensionRegistryLite extensionRegistry)
               throws java.io.IOException {
        -    return com.google.protobuf.GeneratedMessageV3.parseWithIOException(
        +    return com.google.protobuf.GeneratedMessage.parseWithIOException(
                 PARSER, input, extensionRegistry);
           }
         
        @@ -539,16 +563,18 @@ public Builder toBuilder() {
           }
         
           @java.lang.Override
        -  protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
        +  protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) {
             Builder builder = new Builder(parent);
             return builder;
           }
        +
           /**
            *
            *
            * 
            * Output generated from semantically comparing two versions of a service
            * configuration.
        +   *
            * Includes detailed information about a field that have changed with
            * applicable advice about potential consequences for the change, such as
            * backwards-incompatibility.
        @@ -556,7 +582,7 @@ protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.Build
            *
            * Protobuf type {@code google.api.ConfigChange}
            */
        -  public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder
        +  public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder
               implements
               // @@protoc_insertion_point(builder_implements:google.api.ConfigChange)
               com.google.api.ConfigChangeOrBuilder {
        @@ -565,7 +591,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
             }
         
             @java.lang.Override
        -    protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
        +    protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
                 internalGetFieldAccessorTable() {
               return com.google.api.ConfigChangeProto
                   .internal_static_google_api_ConfigChange_fieldAccessorTable
        @@ -576,28 +602,25 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
             // Construct using com.google.api.ConfigChange.newBuilder()
             private Builder() {}
         
        -    private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
        +    private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) {
               super(parent);
             }
         
             @java.lang.Override
             public Builder clear() {
               super.clear();
        +      bitField0_ = 0;
               element_ = "";
        -
               oldValue_ = "";
        -
               newValue_ = "";
        -
               changeType_ = 0;
        -
               if (advicesBuilder_ == null) {
                 advices_ = java.util.Collections.emptyList();
               } else {
                 advices_ = null;
                 advicesBuilder_.clear();
               }
        -      bitField0_ = (bitField0_ & ~0x00000001);
        +      bitField0_ = (bitField0_ & ~0x00000010);
               return this;
             }
         
        @@ -623,55 +646,40 @@ public com.google.api.ConfigChange build() {
             @java.lang.Override
             public com.google.api.ConfigChange buildPartial() {
               com.google.api.ConfigChange result = new com.google.api.ConfigChange(this);
        -      int from_bitField0_ = bitField0_;
        -      result.element_ = element_;
        -      result.oldValue_ = oldValue_;
        -      result.newValue_ = newValue_;
        -      result.changeType_ = changeType_;
        +      buildPartialRepeatedFields(result);
        +      if (bitField0_ != 0) {
        +        buildPartial0(result);
        +      }
        +      onBuilt();
        +      return result;
        +    }
        +
        +    private void buildPartialRepeatedFields(com.google.api.ConfigChange result) {
               if (advicesBuilder_ == null) {
        -        if (((bitField0_ & 0x00000001) != 0)) {
        +        if (((bitField0_ & 0x00000010) != 0)) {
                   advices_ = java.util.Collections.unmodifiableList(advices_);
        -          bitField0_ = (bitField0_ & ~0x00000001);
        +          bitField0_ = (bitField0_ & ~0x00000010);
                 }
                 result.advices_ = advices_;
               } else {
                 result.advices_ = advicesBuilder_.build();
               }
        -      onBuilt();
        -      return result;
        -    }
        -
        -    @java.lang.Override
        -    public Builder clone() {
        -      return super.clone();
             }
         
        -    @java.lang.Override
        -    public Builder setField(
        -        com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) {
        -      return super.setField(field, value);
        -    }
        -
        -    @java.lang.Override
        -    public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) {
        -      return super.clearField(field);
        -    }
        -
        -    @java.lang.Override
        -    public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) {
        -      return super.clearOneof(oneof);
        -    }
        -
        -    @java.lang.Override
        -    public Builder setRepeatedField(
        -        com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) {
        -      return super.setRepeatedField(field, index, value);
        -    }
        -
        -    @java.lang.Override
        -    public Builder addRepeatedField(
        -        com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) {
        -      return super.addRepeatedField(field, value);
        +    private void buildPartial0(com.google.api.ConfigChange result) {
        +      int from_bitField0_ = bitField0_;
        +      if (((from_bitField0_ & 0x00000001) != 0)) {
        +        result.element_ = element_;
        +      }
        +      if (((from_bitField0_ & 0x00000002) != 0)) {
        +        result.oldValue_ = oldValue_;
        +      }
        +      if (((from_bitField0_ & 0x00000004) != 0)) {
        +        result.newValue_ = newValue_;
        +      }
        +      if (((from_bitField0_ & 0x00000008) != 0)) {
        +        result.changeType_ = changeType_;
        +      }
             }
         
             @java.lang.Override
        @@ -688,14 +696,17 @@ public Builder mergeFrom(com.google.api.ConfigChange other) {
               if (other == com.google.api.ConfigChange.getDefaultInstance()) return this;
               if (!other.getElement().isEmpty()) {
                 element_ = other.element_;
        +        bitField0_ |= 0x00000001;
                 onChanged();
               }
               if (!other.getOldValue().isEmpty()) {
                 oldValue_ = other.oldValue_;
        +        bitField0_ |= 0x00000002;
                 onChanged();
               }
               if (!other.getNewValue().isEmpty()) {
                 newValue_ = other.newValue_;
        +        bitField0_ |= 0x00000004;
                 onChanged();
               }
               if (other.changeType_ != 0) {
        @@ -705,7 +716,7 @@ public Builder mergeFrom(com.google.api.ConfigChange other) {
                 if (!other.advices_.isEmpty()) {
                   if (advices_.isEmpty()) {
                     advices_ = other.advices_;
        -            bitField0_ = (bitField0_ & ~0x00000001);
        +            bitField0_ = (bitField0_ & ~0x00000010);
                   } else {
                     ensureAdvicesIsMutable();
                     advices_.addAll(other.advices_);
        @@ -718,10 +729,10 @@ public Builder mergeFrom(com.google.api.ConfigChange other) {
                     advicesBuilder_.dispose();
                     advicesBuilder_ = null;
                     advices_ = other.advices_;
        -            bitField0_ = (bitField0_ & ~0x00000001);
        +            bitField0_ = (bitField0_ & ~0x00000010);
                     advicesBuilder_ =
        -                com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders
        -                    ? getAdvicesFieldBuilder()
        +                com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders
        +                    ? internalGetAdvicesFieldBuilder()
                             : null;
                   } else {
                     advicesBuilder_.addAllMessages(other.advices_);
        @@ -757,25 +768,25 @@ public Builder mergeFrom(
                     case 10:
                       {
                         element_ = input.readStringRequireUtf8();
        -
        +                bitField0_ |= 0x00000001;
                         break;
                       } // case 10
                     case 18:
                       {
                         oldValue_ = input.readStringRequireUtf8();
        -
        +                bitField0_ |= 0x00000002;
                         break;
                       } // case 18
                     case 26:
                       {
                         newValue_ = input.readStringRequireUtf8();
        -
        +                bitField0_ |= 0x00000004;
                         break;
                       } // case 26
                     case 32:
                       {
                         changeType_ = input.readEnum();
        -
        +                bitField0_ |= 0x00000008;
                         break;
                       } // case 32
                     case 42:
        @@ -810,6 +821,7 @@ public Builder mergeFrom(
             private int bitField0_;
         
             private java.lang.Object element_ = "";
        +
             /**
              *
              *
        @@ -840,6 +852,7 @@ public java.lang.String getElement() {
                 return (java.lang.String) ref;
               }
             }
        +
             /**
              *
              *
        @@ -870,6 +883,7 @@ public com.google.protobuf.ByteString getElementBytes() {
                 return (com.google.protobuf.ByteString) ref;
               }
             }
        +
             /**
              *
              *
        @@ -894,11 +908,12 @@ public Builder setElement(java.lang.String value) {
               if (value == null) {
                 throw new NullPointerException();
               }
        -
               element_ = value;
        +      bitField0_ |= 0x00000001;
               onChanged();
               return this;
             }
        +
             /**
              *
              *
        @@ -919,11 +934,12 @@ public Builder setElement(java.lang.String value) {
              * @return This builder for chaining.
              */
             public Builder clearElement() {
        -
               element_ = getDefaultInstance().getElement();
        +      bitField0_ = (bitField0_ & ~0x00000001);
               onChanged();
               return this;
             }
        +
             /**
              *
              *
        @@ -949,13 +965,14 @@ public Builder setElementBytes(com.google.protobuf.ByteString value) {
                 throw new NullPointerException();
               }
               checkByteStringIsUtf8(value);
        -
               element_ = value;
        +      bitField0_ |= 0x00000001;
               onChanged();
               return this;
             }
         
             private java.lang.Object oldValue_ = "";
        +
             /**
              *
              *
        @@ -979,6 +996,7 @@ public java.lang.String getOldValue() {
                 return (java.lang.String) ref;
               }
             }
        +
             /**
              *
              *
        @@ -1002,6 +1020,7 @@ public com.google.protobuf.ByteString getOldValueBytes() {
                 return (com.google.protobuf.ByteString) ref;
               }
             }
        +
             /**
              *
              *
        @@ -1019,11 +1038,12 @@ public Builder setOldValue(java.lang.String value) {
               if (value == null) {
                 throw new NullPointerException();
               }
        -
               oldValue_ = value;
        +      bitField0_ |= 0x00000002;
               onChanged();
               return this;
             }
        +
             /**
              *
              *
        @@ -1037,11 +1057,12 @@ public Builder setOldValue(java.lang.String value) {
              * @return This builder for chaining.
              */
             public Builder clearOldValue() {
        -
               oldValue_ = getDefaultInstance().getOldValue();
        +      bitField0_ = (bitField0_ & ~0x00000002);
               onChanged();
               return this;
             }
        +
             /**
              *
              *
        @@ -1060,13 +1081,14 @@ public Builder setOldValueBytes(com.google.protobuf.ByteString value) {
                 throw new NullPointerException();
               }
               checkByteStringIsUtf8(value);
        -
               oldValue_ = value;
        +      bitField0_ |= 0x00000002;
               onChanged();
               return this;
             }
         
             private java.lang.Object newValue_ = "";
        +
             /**
              *
              *
        @@ -1090,6 +1112,7 @@ public java.lang.String getNewValue() {
                 return (java.lang.String) ref;
               }
             }
        +
             /**
              *
              *
        @@ -1113,6 +1136,7 @@ public com.google.protobuf.ByteString getNewValueBytes() {
                 return (com.google.protobuf.ByteString) ref;
               }
             }
        +
             /**
              *
              *
        @@ -1130,11 +1154,12 @@ public Builder setNewValue(java.lang.String value) {
               if (value == null) {
                 throw new NullPointerException();
               }
        -
               newValue_ = value;
        +      bitField0_ |= 0x00000004;
               onChanged();
               return this;
             }
        +
             /**
              *
              *
        @@ -1148,11 +1173,12 @@ public Builder setNewValue(java.lang.String value) {
              * @return This builder for chaining.
              */
             public Builder clearNewValue() {
        -
               newValue_ = getDefaultInstance().getNewValue();
        +      bitField0_ = (bitField0_ & ~0x00000004);
               onChanged();
               return this;
             }
        +
             /**
              *
              *
        @@ -1171,13 +1197,14 @@ public Builder setNewValueBytes(com.google.protobuf.ByteString value) {
                 throw new NullPointerException();
               }
               checkByteStringIsUtf8(value);
        -
               newValue_ = value;
        +      bitField0_ |= 0x00000004;
               onChanged();
               return this;
             }
         
             private int changeType_ = 0;
        +
             /**
              *
              *
        @@ -1193,6 +1220,7 @@ public Builder setNewValueBytes(com.google.protobuf.ByteString value) {
             public int getChangeTypeValue() {
               return changeType_;
             }
        +
             /**
              *
              *
        @@ -1206,11 +1234,12 @@ public int getChangeTypeValue() {
              * @return This builder for chaining.
              */
             public Builder setChangeTypeValue(int value) {
        -
               changeType_ = value;
        +      bitField0_ |= 0x00000008;
               onChanged();
               return this;
             }
        +
             /**
              *
              *
        @@ -1224,10 +1253,10 @@ public Builder setChangeTypeValue(int value) {
              */
             @java.lang.Override
             public com.google.api.ChangeType getChangeType() {
        -      @SuppressWarnings("deprecation")
        -      com.google.api.ChangeType result = com.google.api.ChangeType.valueOf(changeType_);
        +      com.google.api.ChangeType result = com.google.api.ChangeType.forNumber(changeType_);
               return result == null ? com.google.api.ChangeType.UNRECOGNIZED : result;
             }
        +
             /**
              *
              *
        @@ -1244,11 +1273,12 @@ public Builder setChangeType(com.google.api.ChangeType value) {
               if (value == null) {
                 throw new NullPointerException();
               }
        -
        +      bitField0_ |= 0x00000008;
               changeType_ = value.getNumber();
               onChanged();
               return this;
             }
        +
             /**
              *
              *
        @@ -1261,7 +1291,7 @@ public Builder setChangeType(com.google.api.ChangeType value) {
              * @return This builder for chaining.
              */
             public Builder clearChangeType() {
        -
        +      bitField0_ = (bitField0_ & ~0x00000008);
               changeType_ = 0;
               onChanged();
               return this;
        @@ -1270,13 +1300,13 @@ public Builder clearChangeType() {
             private java.util.List advices_ = java.util.Collections.emptyList();
         
             private void ensureAdvicesIsMutable() {
        -      if (!((bitField0_ & 0x00000001) != 0)) {
        +      if (!((bitField0_ & 0x00000010) != 0)) {
                 advices_ = new java.util.ArrayList(advices_);
        -        bitField0_ |= 0x00000001;
        +        bitField0_ |= 0x00000010;
               }
             }
         
        -    private com.google.protobuf.RepeatedFieldBuilderV3<
        +    private com.google.protobuf.RepeatedFieldBuilder<
                     com.google.api.Advice, com.google.api.Advice.Builder, com.google.api.AdviceOrBuilder>
                 advicesBuilder_;
         
        @@ -1297,6 +1327,7 @@ public java.util.List getAdvicesList() {
                 return advicesBuilder_.getMessageList();
               }
             }
        +
             /**
              *
              *
        @@ -1314,6 +1345,7 @@ public int getAdvicesCount() {
                 return advicesBuilder_.getCount();
               }
             }
        +
             /**
              *
              *
        @@ -1331,6 +1363,7 @@ public com.google.api.Advice getAdvices(int index) {
                 return advicesBuilder_.getMessage(index);
               }
             }
        +
             /**
              *
              *
        @@ -1354,6 +1387,7 @@ public Builder setAdvices(int index, com.google.api.Advice value) {
               }
               return this;
             }
        +
             /**
              *
              *
        @@ -1374,6 +1408,7 @@ public Builder setAdvices(int index, com.google.api.Advice.Builder builderForVal
               }
               return this;
             }
        +
             /**
              *
              *
        @@ -1397,6 +1432,7 @@ public Builder addAdvices(com.google.api.Advice value) {
               }
               return this;
             }
        +
             /**
              *
              *
        @@ -1420,6 +1456,7 @@ public Builder addAdvices(int index, com.google.api.Advice value) {
               }
               return this;
             }
        +
             /**
              *
              *
        @@ -1440,6 +1477,7 @@ public Builder addAdvices(com.google.api.Advice.Builder builderForValue) {
               }
               return this;
             }
        +
             /**
              *
              *
        @@ -1460,6 +1498,7 @@ public Builder addAdvices(int index, com.google.api.Advice.Builder builderForVal
               }
               return this;
             }
        +
             /**
              *
              *
        @@ -1480,6 +1519,7 @@ public Builder addAllAdvices(java.lang.Iterable
               }
               return this;
             }
        +
             /**
              *
              *
        @@ -1493,13 +1533,14 @@ public Builder addAllAdvices(java.lang.Iterable
             public Builder clearAdvices() {
               if (advicesBuilder_ == null) {
                 advices_ = java.util.Collections.emptyList();
        -        bitField0_ = (bitField0_ & ~0x00000001);
        +        bitField0_ = (bitField0_ & ~0x00000010);
                 onChanged();
               } else {
                 advicesBuilder_.clear();
               }
               return this;
             }
        +
             /**
              *
              *
        @@ -1520,6 +1561,7 @@ public Builder removeAdvices(int index) {
               }
               return this;
             }
        +
             /**
              *
              *
        @@ -1531,8 +1573,9 @@ public Builder removeAdvices(int index) {
              * repeated .google.api.Advice advices = 5;
              */
             public com.google.api.Advice.Builder getAdvicesBuilder(int index) {
        -      return getAdvicesFieldBuilder().getBuilder(index);
        +      return internalGetAdvicesFieldBuilder().getBuilder(index);
             }
        +
             /**
              *
              *
        @@ -1550,6 +1593,7 @@ public com.google.api.AdviceOrBuilder getAdvicesOrBuilder(int index) {
                 return advicesBuilder_.getMessageOrBuilder(index);
               }
             }
        +
             /**
              *
              *
        @@ -1567,6 +1611,7 @@ public java.util.List getAdvicesOrBuil
                 return java.util.Collections.unmodifiableList(advices_);
               }
             }
        +
             /**
              *
              *
        @@ -1578,8 +1623,10 @@ public java.util.List getAdvicesOrBuil
              * repeated .google.api.Advice advices = 5;
              */
             public com.google.api.Advice.Builder addAdvicesBuilder() {
        -      return getAdvicesFieldBuilder().addBuilder(com.google.api.Advice.getDefaultInstance());
        +      return internalGetAdvicesFieldBuilder()
        +          .addBuilder(com.google.api.Advice.getDefaultInstance());
             }
        +
             /**
              *
              *
        @@ -1591,8 +1638,10 @@ public com.google.api.Advice.Builder addAdvicesBuilder() {
              * repeated .google.api.Advice advices = 5;
              */
             public com.google.api.Advice.Builder addAdvicesBuilder(int index) {
        -      return getAdvicesFieldBuilder().addBuilder(index, com.google.api.Advice.getDefaultInstance());
        +      return internalGetAdvicesFieldBuilder()
        +          .addBuilder(index, com.google.api.Advice.getDefaultInstance());
             }
        +
             /**
              *
              *
        @@ -1604,35 +1653,24 @@ public com.google.api.Advice.Builder addAdvicesBuilder(int index) {
              * repeated .google.api.Advice advices = 5;
              */
             public java.util.List getAdvicesBuilderList() {
        -      return getAdvicesFieldBuilder().getBuilderList();
        +      return internalGetAdvicesFieldBuilder().getBuilderList();
             }
         
        -    private com.google.protobuf.RepeatedFieldBuilderV3<
        +    private com.google.protobuf.RepeatedFieldBuilder<
                     com.google.api.Advice, com.google.api.Advice.Builder, com.google.api.AdviceOrBuilder>
        -        getAdvicesFieldBuilder() {
        +        internalGetAdvicesFieldBuilder() {
               if (advicesBuilder_ == null) {
                 advicesBuilder_ =
        -            new com.google.protobuf.RepeatedFieldBuilderV3<
        +            new com.google.protobuf.RepeatedFieldBuilder<
                         com.google.api.Advice,
                         com.google.api.Advice.Builder,
                         com.google.api.AdviceOrBuilder>(
        -                advices_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean());
        +                advices_, ((bitField0_ & 0x00000010) != 0), getParentForChildren(), isClean());
                 advices_ = null;
               }
               return advicesBuilder_;
             }
         
        -    @java.lang.Override
        -    public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) {
        -      return super.setUnknownFields(unknownFields);
        -    }
        -
        -    @java.lang.Override
        -    public final Builder mergeUnknownFields(
        -        final com.google.protobuf.UnknownFieldSet unknownFields) {
        -      return super.mergeUnknownFields(unknownFields);
        -    }
        -
             // @@protoc_insertion_point(builder_scope:google.api.ConfigChange)
           }
         
        diff --git a/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/ConfigChangeOrBuilder.java b/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/ConfigChangeOrBuilder.java
        index 3d2f557da0..0d8eb7e2f9 100644
        --- a/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/ConfigChangeOrBuilder.java
        +++ b/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/ConfigChangeOrBuilder.java
        @@ -1,5 +1,5 @@
         /*
        - * Copyright 2020 Google LLC
        + * Copyright 2026 Google LLC
          *
          * Licensed under the Apache License, Version 2.0 (the "License");
          * you may not use this file except in compliance with the License.
        @@ -14,10 +14,13 @@
          * limitations under the License.
          */
         // Generated by the protocol buffer compiler.  DO NOT EDIT!
        +// NO CHECKED-IN PROTOBUF GENCODE
         // source: google/api/config_change.proto
        +// Protobuf Java Version: 4.33.2
         
         package com.google.api;
         
        +@com.google.protobuf.Generated
         public interface ConfigChangeOrBuilder
             extends
             // @@protoc_insertion_point(interface_extends:google.api.ConfigChange)
        @@ -43,6 +46,7 @@ public interface ConfigChangeOrBuilder
            * @return The element.
            */
           java.lang.String getElement();
        +
           /**
            *
            *
        @@ -77,6 +81,7 @@ public interface ConfigChangeOrBuilder
            * @return The oldValue.
            */
           java.lang.String getOldValue();
        +
           /**
            *
            *
        @@ -104,6 +109,7 @@ public interface ConfigChangeOrBuilder
            * @return The newValue.
            */
           java.lang.String getNewValue();
        +
           /**
            *
            *
        @@ -130,6 +136,7 @@ public interface ConfigChangeOrBuilder
            * @return The enum numeric value on the wire for changeType.
            */
           int getChangeTypeValue();
        +
           /**
            *
            *
        @@ -154,6 +161,7 @@ public interface ConfigChangeOrBuilder
            * repeated .google.api.Advice advices = 5;
            */
           java.util.List getAdvicesList();
        +
           /**
            *
            *
        @@ -165,6 +173,7 @@ public interface ConfigChangeOrBuilder
            * repeated .google.api.Advice advices = 5;
            */
           com.google.api.Advice getAdvices(int index);
        +
           /**
            *
            *
        @@ -176,6 +185,7 @@ public interface ConfigChangeOrBuilder
            * repeated .google.api.Advice advices = 5;
            */
           int getAdvicesCount();
        +
           /**
            *
            *
        @@ -187,6 +197,7 @@ public interface ConfigChangeOrBuilder
            * repeated .google.api.Advice advices = 5;
            */
           java.util.List getAdvicesOrBuilderList();
        +
           /**
            *
            *
        diff --git a/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/ConfigChangeProto.java b/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/ConfigChangeProto.java
        index d9573bcdfd..4d643a5a03 100644
        --- a/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/ConfigChangeProto.java
        +++ b/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/ConfigChangeProto.java
        @@ -1,5 +1,5 @@
         /*
        - * Copyright 2020 Google LLC
        + * Copyright 2026 Google LLC
          *
          * Licensed under the Apache License, Version 2.0 (the "License");
          * you may not use this file except in compliance with the License.
        @@ -14,13 +14,26 @@
          * limitations under the License.
          */
         // Generated by the protocol buffer compiler.  DO NOT EDIT!
        +// NO CHECKED-IN PROTOBUF GENCODE
         // source: google/api/config_change.proto
        +// Protobuf Java Version: 4.33.2
         
         package com.google.api;
         
        -public final class ConfigChangeProto {
        +@com.google.protobuf.Generated
        +public final class ConfigChangeProto extends com.google.protobuf.GeneratedFile {
           private ConfigChangeProto() {}
         
        +  static {
        +    com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion(
        +        com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC,
        +        /* major= */ 4,
        +        /* minor= */ 33,
        +        /* patch= */ 2,
        +        /* suffix= */ "",
        +        "ConfigChangeProto");
        +  }
        +
           public static void registerAllExtensions(com.google.protobuf.ExtensionRegistryLite registry) {}
         
           public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry registry) {
        @@ -29,11 +42,11 @@ public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry r
         
           static final com.google.protobuf.Descriptors.Descriptor
               internal_static_google_api_ConfigChange_descriptor;
        -  static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
        +  static final com.google.protobuf.GeneratedMessage.FieldAccessorTable
               internal_static_google_api_ConfigChange_fieldAccessorTable;
           static final com.google.protobuf.Descriptors.Descriptor
               internal_static_google_api_Advice_descriptor;
        -  static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
        +  static final com.google.protobuf.GeneratedMessage.FieldAccessorTable
               internal_static_google_api_Advice_fieldAccessorTable;
         
           public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() {
        @@ -59,20 +72,21 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() {
             descriptor =
                 com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom(
                     descriptorData, new com.google.protobuf.Descriptors.FileDescriptor[] {});
        -    internal_static_google_api_ConfigChange_descriptor = getDescriptor().getMessageTypes().get(0);
        +    internal_static_google_api_ConfigChange_descriptor = getDescriptor().getMessageType(0);
             internal_static_google_api_ConfigChange_fieldAccessorTable =
        -        new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
        +        new com.google.protobuf.GeneratedMessage.FieldAccessorTable(
                     internal_static_google_api_ConfigChange_descriptor,
                     new java.lang.String[] {
                       "Element", "OldValue", "NewValue", "ChangeType", "Advices",
                     });
        -    internal_static_google_api_Advice_descriptor = getDescriptor().getMessageTypes().get(1);
        +    internal_static_google_api_Advice_descriptor = getDescriptor().getMessageType(1);
             internal_static_google_api_Advice_fieldAccessorTable =
        -        new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
        +        new com.google.protobuf.GeneratedMessage.FieldAccessorTable(
                     internal_static_google_api_Advice_descriptor,
                     new java.lang.String[] {
                       "Description",
                     });
        +    descriptor.resolveAllFeaturesImmutable();
           }
         
           // @@protoc_insertion_point(outer_class_scope)
        diff --git a/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/ConsumerProto.java b/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/ConsumerProto.java
        index 474e18306c..1c00416f12 100644
        --- a/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/ConsumerProto.java
        +++ b/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/ConsumerProto.java
        @@ -1,5 +1,5 @@
         /*
        - * Copyright 2020 Google LLC
        + * Copyright 2026 Google LLC
          *
          * Licensed under the Apache License, Version 2.0 (the "License");
          * you may not use this file except in compliance with the License.
        @@ -14,13 +14,26 @@
          * limitations under the License.
          */
         // Generated by the protocol buffer compiler.  DO NOT EDIT!
        +// NO CHECKED-IN PROTOBUF GENCODE
         // source: google/api/consumer.proto
        +// Protobuf Java Version: 4.33.2
         
         package com.google.api;
         
        -public final class ConsumerProto {
        +@com.google.protobuf.Generated
        +public final class ConsumerProto extends com.google.protobuf.GeneratedFile {
           private ConsumerProto() {}
         
        +  static {
        +    com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion(
        +        com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC,
        +        /* major= */ 4,
        +        /* minor= */ 33,
        +        /* patch= */ 2,
        +        /* suffix= */ "",
        +        "ConsumerProto");
        +  }
        +
           public static void registerAllExtensions(com.google.protobuf.ExtensionRegistryLite registry) {}
         
           public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry registry) {
        @@ -29,11 +42,11 @@ public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry r
         
           static final com.google.protobuf.Descriptors.Descriptor
               internal_static_google_api_ProjectProperties_descriptor;
        -  static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
        +  static final com.google.protobuf.GeneratedMessage.FieldAccessorTable
               internal_static_google_api_ProjectProperties_fieldAccessorTable;
           static final com.google.protobuf.Descriptors.Descriptor
               internal_static_google_api_Property_descriptor;
        -  static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
        +  static final com.google.protobuf.GeneratedMessage.FieldAccessorTable
               internal_static_google_api_Property_fieldAccessorTable;
         
           public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() {
        @@ -44,35 +57,43 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() {
         
           static {
             java.lang.String[] descriptorData = {
        -      "\n\031google/api/consumer.proto\022\ngoogle.api\""
        -          + "=\n\021ProjectProperties\022(\n\nproperties\030\001 \003(\013"
        -          + "2\024.google.api.Property\"\254\001\n\010Property\022\014\n\004n"
        -          + "ame\030\001 \001(\t\022/\n\004type\030\002 \001(\0162!.google.api.Pro"
        -          + "perty.PropertyType\022\023\n\013description\030\003 \001(\t\""
        -          + "L\n\014PropertyType\022\017\n\013UNSPECIFIED\020\000\022\t\n\005INT6"
        -          + "4\020\001\022\010\n\004BOOL\020\002\022\n\n\006STRING\020\003\022\n\n\006DOUBLE\020\004Bh\n"
        -          + "\016com.google.apiB\rConsumerProtoP\001ZEgoogle"
        -          + ".golang.org/genproto/googleapis/api/serv"
        +      "\n"
        +          + "\031google/api/consumer.proto\022\n"
        +          + "google.api\"=\n"
        +          + "\021ProjectProperties\022(\n\n"
        +          + "properties\030\001 \003(\0132\024.google.api.Property\"\254\001\n"
        +          + "\010Property\022\014\n"
        +          + "\004name\030\001 \001(\t\022/\n"
        +          + "\004type\030\002 \001(\0162!.google.api.Property.PropertyType\022\023\n"
        +          + "\013description\030\003 \001(\t\"L\n"
        +          + "\014PropertyType\022\017\n"
        +          + "\013UNSPECIFIED\020\000\022\t\n"
        +          + "\005INT64\020\001\022\010\n"
        +          + "\004BOOL\020\002\022\n\n"
        +          + "\006STRING\020\003\022\n\n"
        +          + "\006DOUBLE\020\004Bh\n"
        +          + "\016com.google.apiB\r"
        +          + "ConsumerProtoP\001ZEgoogle.golang.org/genproto/googleapis/api/serv"
                   + "iceconfig;serviceconfigb\006proto3"
             };
             descriptor =
                 com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom(
                     descriptorData, new com.google.protobuf.Descriptors.FileDescriptor[] {});
        -    internal_static_google_api_ProjectProperties_descriptor =
        -        getDescriptor().getMessageTypes().get(0);
        +    internal_static_google_api_ProjectProperties_descriptor = getDescriptor().getMessageType(0);
             internal_static_google_api_ProjectProperties_fieldAccessorTable =
        -        new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
        +        new com.google.protobuf.GeneratedMessage.FieldAccessorTable(
                     internal_static_google_api_ProjectProperties_descriptor,
                     new java.lang.String[] {
                       "Properties",
                     });
        -    internal_static_google_api_Property_descriptor = getDescriptor().getMessageTypes().get(1);
        +    internal_static_google_api_Property_descriptor = getDescriptor().getMessageType(1);
             internal_static_google_api_Property_fieldAccessorTable =
        -        new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
        +        new com.google.protobuf.GeneratedMessage.FieldAccessorTable(
                     internal_static_google_api_Property_descriptor,
                     new java.lang.String[] {
                       "Name", "Type", "Description",
                     });
        +    descriptor.resolveAllFeaturesImmutable();
           }
         
           // @@protoc_insertion_point(outer_class_scope)
        diff --git a/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/Context.java b/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/Context.java
        index 90943bb107..6885b3669d 100644
        --- a/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/Context.java
        +++ b/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/Context.java
        @@ -1,5 +1,5 @@
         /*
        - * Copyright 2020 Google LLC
        + * Copyright 2026 Google LLC
          *
          * Licensed under the Apache License, Version 2.0 (the "License");
          * you may not use this file except in compliance with the License.
        @@ -14,7 +14,9 @@
          * limitations under the License.
          */
         // Generated by the protocol buffer compiler.  DO NOT EDIT!
        +// NO CHECKED-IN PROTOBUF GENCODE
         // source: google/api/context.proto
        +// Protobuf Java Version: 4.33.2
         
         package com.google.api;
         
        @@ -23,44 +25,64 @@
          *
          * 
          * `Context` defines which contexts an API requests.
        + *
          * Example:
        - *     context:
        - *       rules:
        - *       - selector: "*"
        - *         requested:
        - *         - google.rpc.context.ProjectContext
        - *         - google.rpc.context.OriginContext
        + *
        + * context:
        + * rules:
        + * - selector: "*"
        + * requested:
        + * - google.rpc.context.ProjectContext
        + * - google.rpc.context.OriginContext
        + *
          * The above specifies that all methods in the API request
          * `google.rpc.context.ProjectContext` and
          * `google.rpc.context.OriginContext`.
        + *
          * Available context types are defined in package
          * `google.rpc.context`.
        + *
          * This also provides mechanism to allowlist any protobuf message extension that
          * can be sent in grpc metadata using “x-goog-ext-<extension_id>-bin” and
          * “x-goog-ext-<extension_id>-jspb” format. For example, list any service
          * specific protobuf types that can appear in grpc metadata as follows in your
          * yaml file:
        + *
          * Example:
        - *     context:
        - *       rules:
        - *        - selector: "google.example.library.v1.LibraryService.CreateBook"
        - *          allowed_request_extensions:
        - *          - google.foo.v1.NewExtension
        - *          allowed_response_extensions:
        - *          - google.foo.v1.NewExtension
        + *
        + * context:
        + * rules:
        + * - selector: "google.example.library.v1.LibraryService.CreateBook"
        + * allowed_request_extensions:
        + * - google.foo.v1.NewExtension
        + * allowed_response_extensions:
        + * - google.foo.v1.NewExtension
        + *
          * You can also specify extension ID instead of fully qualified extension name
          * here.
          * 
        * * Protobuf type {@code google.api.Context} */ -public final class Context extends com.google.protobuf.GeneratedMessageV3 +@com.google.protobuf.Generated +public final class Context extends com.google.protobuf.GeneratedMessage implements // @@protoc_insertion_point(message_implements:google.api.Context) ContextOrBuilder { private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "Context"); + } + // Use Context.newBuilder() to construct. - private Context(com.google.protobuf.GeneratedMessageV3.Builder builder) { + private Context(com.google.protobuf.GeneratedMessage.Builder builder) { super(builder); } @@ -68,23 +90,12 @@ private Context() { rules_ = java.util.Collections.emptyList(); } - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new Context(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.api.ContextProto.internal_static_google_api_Context_descriptor; } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.api.ContextProto.internal_static_google_api_Context_fieldAccessorTable .ensureFieldAccessorsInitialized( @@ -92,12 +103,16 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } public static final int RULES_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") private java.util.List rules_; + /** * * *
            * A list of RPC context rules that apply to individual API methods.
        +   *
            * **NOTE:** All service configuration rules follow "last one wins" order.
            * 
        * @@ -107,11 +122,13 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { public java.util.List getRulesList() { return rules_; } + /** * * *
            * A list of RPC context rules that apply to individual API methods.
        +   *
            * **NOTE:** All service configuration rules follow "last one wins" order.
            * 
        * @@ -121,11 +138,13 @@ public java.util.List getRulesList() { public java.util.List getRulesOrBuilderList() { return rules_; } + /** * * *
            * A list of RPC context rules that apply to individual API methods.
        +   *
            * **NOTE:** All service configuration rules follow "last one wins" order.
            * 
        * @@ -135,11 +154,13 @@ public java.util.List getRulesOrB public int getRulesCount() { return rules_.size(); } + /** * * *
            * A list of RPC context rules that apply to individual API methods.
        +   *
            * **NOTE:** All service configuration rules follow "last one wins" order.
            * 
        * @@ -149,11 +170,13 @@ public int getRulesCount() { public com.google.api.ContextRule getRules(int index) { return rules_.get(index); } + /** * * *
            * A list of RPC context rules that apply to individual API methods.
        +   *
            * **NOTE:** All service configuration rules follow "last one wins" order.
            * 
        * @@ -265,38 +288,38 @@ public static com.google.api.Context parseFrom( public static com.google.api.Context parseFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); } public static com.google.api.Context parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } public static com.google.api.Context parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); } public static com.google.api.Context parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( PARSER, input, extensionRegistry); } public static com.google.api.Context parseFrom(com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); } public static com.google.api.Context parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } @@ -319,47 +342,56 @@ public Builder toBuilder() { } @java.lang.Override - protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { Builder builder = new Builder(parent); return builder; } + /** * * *
            * `Context` defines which contexts an API requests.
        +   *
            * Example:
        -   *     context:
        -   *       rules:
        -   *       - selector: "*"
        -   *         requested:
        -   *         - google.rpc.context.ProjectContext
        -   *         - google.rpc.context.OriginContext
        +   *
        +   * context:
        +   * rules:
        +   * - selector: "*"
        +   * requested:
        +   * - google.rpc.context.ProjectContext
        +   * - google.rpc.context.OriginContext
        +   *
            * The above specifies that all methods in the API request
            * `google.rpc.context.ProjectContext` and
            * `google.rpc.context.OriginContext`.
        +   *
            * Available context types are defined in package
            * `google.rpc.context`.
        +   *
            * This also provides mechanism to allowlist any protobuf message extension that
            * can be sent in grpc metadata using “x-goog-ext-<extension_id>-bin” and
            * “x-goog-ext-<extension_id>-jspb” format. For example, list any service
            * specific protobuf types that can appear in grpc metadata as follows in your
            * yaml file:
        +   *
            * Example:
        -   *     context:
        -   *       rules:
        -   *        - selector: "google.example.library.v1.LibraryService.CreateBook"
        -   *          allowed_request_extensions:
        -   *          - google.foo.v1.NewExtension
        -   *          allowed_response_extensions:
        -   *          - google.foo.v1.NewExtension
        +   *
        +   * context:
        +   * rules:
        +   * - selector: "google.example.library.v1.LibraryService.CreateBook"
        +   * allowed_request_extensions:
        +   * - google.foo.v1.NewExtension
        +   * allowed_response_extensions:
        +   * - google.foo.v1.NewExtension
        +   *
            * You can also specify extension ID instead of fully qualified extension name
            * here.
            * 
        * * Protobuf type {@code google.api.Context} */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder implements // @@protoc_insertion_point(builder_implements:google.api.Context) com.google.api.ContextOrBuilder { @@ -368,7 +400,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.api.ContextProto.internal_static_google_api_Context_fieldAccessorTable .ensureFieldAccessorsInitialized( @@ -378,13 +410,14 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { // Construct using com.google.api.Context.newBuilder() private Builder() {} - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { super(parent); } @java.lang.Override public Builder clear() { super.clear(); + bitField0_ = 0; if (rulesBuilder_ == null) { rules_ = java.util.Collections.emptyList(); } else { @@ -417,7 +450,15 @@ public com.google.api.Context build() { @java.lang.Override public com.google.api.Context buildPartial() { com.google.api.Context result = new com.google.api.Context(this); - int from_bitField0_ = bitField0_; + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields(com.google.api.Context result) { if (rulesBuilder_ == null) { if (((bitField0_ & 0x00000001) != 0)) { rules_ = java.util.Collections.unmodifiableList(rules_); @@ -427,41 +468,10 @@ public com.google.api.Context buildPartial() { } else { result.rules_ = rulesBuilder_.build(); } - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.setField(field, value); } - @java.lang.Override - public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - - @java.lang.Override - public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.addRepeatedField(field, value); + private void buildPartial0(com.google.api.Context result) { + int from_bitField0_ = bitField0_; } @java.lang.Override @@ -495,8 +505,8 @@ public Builder mergeFrom(com.google.api.Context other) { rules_ = other.rules_; bitField0_ = (bitField0_ & ~0x00000001); rulesBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders - ? getRulesFieldBuilder() + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders + ? internalGetRulesFieldBuilder() : null; } else { rulesBuilder_.addAllMessages(other.rules_); @@ -569,7 +579,7 @@ private void ensureRulesIsMutable() { } } - private com.google.protobuf.RepeatedFieldBuilderV3< + private com.google.protobuf.RepeatedFieldBuilder< com.google.api.ContextRule, com.google.api.ContextRule.Builder, com.google.api.ContextRuleOrBuilder> @@ -580,6 +590,7 @@ private void ensureRulesIsMutable() { * *
              * A list of RPC context rules that apply to individual API methods.
        +     *
              * **NOTE:** All service configuration rules follow "last one wins" order.
              * 
        * @@ -592,11 +603,13 @@ public java.util.List getRulesList() { return rulesBuilder_.getMessageList(); } } + /** * * *
              * A list of RPC context rules that apply to individual API methods.
        +     *
              * **NOTE:** All service configuration rules follow "last one wins" order.
              * 
        * @@ -609,11 +622,13 @@ public int getRulesCount() { return rulesBuilder_.getCount(); } } + /** * * *
              * A list of RPC context rules that apply to individual API methods.
        +     *
              * **NOTE:** All service configuration rules follow "last one wins" order.
              * 
        * @@ -626,11 +641,13 @@ public com.google.api.ContextRule getRules(int index) { return rulesBuilder_.getMessage(index); } } + /** * * *
              * A list of RPC context rules that apply to individual API methods.
        +     *
              * **NOTE:** All service configuration rules follow "last one wins" order.
              * 
        * @@ -649,11 +666,13 @@ public Builder setRules(int index, com.google.api.ContextRule value) { } return this; } + /** * * *
              * A list of RPC context rules that apply to individual API methods.
        +     *
              * **NOTE:** All service configuration rules follow "last one wins" order.
              * 
        * @@ -669,11 +688,13 @@ public Builder setRules(int index, com.google.api.ContextRule.Builder builderFor } return this; } + /** * * *
              * A list of RPC context rules that apply to individual API methods.
        +     *
              * **NOTE:** All service configuration rules follow "last one wins" order.
              * 
        * @@ -692,11 +713,13 @@ public Builder addRules(com.google.api.ContextRule value) { } return this; } + /** * * *
              * A list of RPC context rules that apply to individual API methods.
        +     *
              * **NOTE:** All service configuration rules follow "last one wins" order.
              * 
        * @@ -715,11 +738,13 @@ public Builder addRules(int index, com.google.api.ContextRule value) { } return this; } + /** * * *
              * A list of RPC context rules that apply to individual API methods.
        +     *
              * **NOTE:** All service configuration rules follow "last one wins" order.
              * 
        * @@ -735,11 +760,13 @@ public Builder addRules(com.google.api.ContextRule.Builder builderForValue) { } return this; } + /** * * *
              * A list of RPC context rules that apply to individual API methods.
        +     *
              * **NOTE:** All service configuration rules follow "last one wins" order.
              * 
        * @@ -755,11 +782,13 @@ public Builder addRules(int index, com.google.api.ContextRule.Builder builderFor } return this; } + /** * * *
              * A list of RPC context rules that apply to individual API methods.
        +     *
              * **NOTE:** All service configuration rules follow "last one wins" order.
              * 
        * @@ -775,11 +804,13 @@ public Builder addAllRules(java.lang.Iterable * A list of RPC context rules that apply to individual API methods. + * * **NOTE:** All service configuration rules follow "last one wins" order. *
        * @@ -795,11 +826,13 @@ public Builder clearRules() { } return this; } + /** * * *
              * A list of RPC context rules that apply to individual API methods.
        +     *
              * **NOTE:** All service configuration rules follow "last one wins" order.
              * 
        * @@ -815,24 +848,28 @@ public Builder removeRules(int index) { } return this; } + /** * * *
              * A list of RPC context rules that apply to individual API methods.
        +     *
              * **NOTE:** All service configuration rules follow "last one wins" order.
              * 
        * * repeated .google.api.ContextRule rules = 1; */ public com.google.api.ContextRule.Builder getRulesBuilder(int index) { - return getRulesFieldBuilder().getBuilder(index); + return internalGetRulesFieldBuilder().getBuilder(index); } + /** * * *
              * A list of RPC context rules that apply to individual API methods.
        +     *
              * **NOTE:** All service configuration rules follow "last one wins" order.
              * 
        * @@ -845,11 +882,13 @@ public com.google.api.ContextRuleOrBuilder getRulesOrBuilder(int index) { return rulesBuilder_.getMessageOrBuilder(index); } } + /** * * *
              * A list of RPC context rules that apply to individual API methods.
        +     *
              * **NOTE:** All service configuration rules follow "last one wins" order.
              * 
        * @@ -862,55 +901,62 @@ public java.util.List getRulesOrB return java.util.Collections.unmodifiableList(rules_); } } + /** * * *
              * A list of RPC context rules that apply to individual API methods.
        +     *
              * **NOTE:** All service configuration rules follow "last one wins" order.
              * 
        * * repeated .google.api.ContextRule rules = 1; */ public com.google.api.ContextRule.Builder addRulesBuilder() { - return getRulesFieldBuilder().addBuilder(com.google.api.ContextRule.getDefaultInstance()); + return internalGetRulesFieldBuilder() + .addBuilder(com.google.api.ContextRule.getDefaultInstance()); } + /** * * *
              * A list of RPC context rules that apply to individual API methods.
        +     *
              * **NOTE:** All service configuration rules follow "last one wins" order.
              * 
        * * repeated .google.api.ContextRule rules = 1; */ public com.google.api.ContextRule.Builder addRulesBuilder(int index) { - return getRulesFieldBuilder() + return internalGetRulesFieldBuilder() .addBuilder(index, com.google.api.ContextRule.getDefaultInstance()); } + /** * * *
              * A list of RPC context rules that apply to individual API methods.
        +     *
              * **NOTE:** All service configuration rules follow "last one wins" order.
              * 
        * * repeated .google.api.ContextRule rules = 1; */ public java.util.List getRulesBuilderList() { - return getRulesFieldBuilder().getBuilderList(); + return internalGetRulesFieldBuilder().getBuilderList(); } - private com.google.protobuf.RepeatedFieldBuilderV3< + private com.google.protobuf.RepeatedFieldBuilder< com.google.api.ContextRule, com.google.api.ContextRule.Builder, com.google.api.ContextRuleOrBuilder> - getRulesFieldBuilder() { + internalGetRulesFieldBuilder() { if (rulesBuilder_ == null) { rulesBuilder_ = - new com.google.protobuf.RepeatedFieldBuilderV3< + new com.google.protobuf.RepeatedFieldBuilder< com.google.api.ContextRule, com.google.api.ContextRule.Builder, com.google.api.ContextRuleOrBuilder>( @@ -920,17 +966,6 @@ public java.util.List getRulesBuilderList() return rulesBuilder_; } - @java.lang.Override - public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - // @@protoc_insertion_point(builder_scope:google.api.Context) } diff --git a/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/ContextOrBuilder.java b/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/ContextOrBuilder.java index f7018ada23..6ae1b125c1 100644 --- a/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/ContextOrBuilder.java +++ b/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/ContextOrBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,10 +14,13 @@ * limitations under the License. */ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: google/api/context.proto +// Protobuf Java Version: 4.33.2 package com.google.api; +@com.google.protobuf.Generated public interface ContextOrBuilder extends // @@protoc_insertion_point(interface_extends:google.api.Context) @@ -28,50 +31,59 @@ public interface ContextOrBuilder * *
            * A list of RPC context rules that apply to individual API methods.
        +   *
            * **NOTE:** All service configuration rules follow "last one wins" order.
            * 
        * * repeated .google.api.ContextRule rules = 1; */ java.util.List getRulesList(); + /** * * *
            * A list of RPC context rules that apply to individual API methods.
        +   *
            * **NOTE:** All service configuration rules follow "last one wins" order.
            * 
        * * repeated .google.api.ContextRule rules = 1; */ com.google.api.ContextRule getRules(int index); + /** * * *
            * A list of RPC context rules that apply to individual API methods.
        +   *
            * **NOTE:** All service configuration rules follow "last one wins" order.
            * 
        * * repeated .google.api.ContextRule rules = 1; */ int getRulesCount(); + /** * * *
            * A list of RPC context rules that apply to individual API methods.
        +   *
            * **NOTE:** All service configuration rules follow "last one wins" order.
            * 
        * * repeated .google.api.ContextRule rules = 1; */ java.util.List getRulesOrBuilderList(); + /** * * *
            * A list of RPC context rules that apply to individual API methods.
        +   *
            * **NOTE:** All service configuration rules follow "last one wins" order.
            * 
        * diff --git a/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/ContextProto.java b/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/ContextProto.java index c06990e8c2..f1b41258be 100644 --- a/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/ContextProto.java +++ b/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/ContextProto.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,13 +14,26 @@ * limitations under the License. */ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: google/api/context.proto +// Protobuf Java Version: 4.33.2 package com.google.api; -public final class ContextProto { +@com.google.protobuf.Generated +public final class ContextProto extends com.google.protobuf.GeneratedFile { private ContextProto() {} + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "ContextProto"); + } + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistryLite registry) {} public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry registry) { @@ -29,11 +42,11 @@ public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry r static final com.google.protobuf.Descriptors.Descriptor internal_static_google_api_Context_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable internal_static_google_api_Context_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_google_api_ContextRule_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable internal_static_google_api_ContextRule_fieldAccessorTable; public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { @@ -57,16 +70,16 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { descriptor = com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( descriptorData, new com.google.protobuf.Descriptors.FileDescriptor[] {}); - internal_static_google_api_Context_descriptor = getDescriptor().getMessageTypes().get(0); + internal_static_google_api_Context_descriptor = getDescriptor().getMessageType(0); internal_static_google_api_Context_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_google_api_Context_descriptor, new java.lang.String[] { "Rules", }); - internal_static_google_api_ContextRule_descriptor = getDescriptor().getMessageTypes().get(1); + internal_static_google_api_ContextRule_descriptor = getDescriptor().getMessageType(1); internal_static_google_api_ContextRule_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_google_api_ContextRule_descriptor, new java.lang.String[] { "Selector", @@ -75,6 +88,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "AllowedRequestExtensions", "AllowedResponseExtensions", }); + descriptor.resolveAllFeaturesImmutable(); } // @@protoc_insertion_point(outer_class_scope) diff --git a/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/ContextRule.java b/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/ContextRule.java index 8d5ea2c563..315377bf82 100644 --- a/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/ContextRule.java +++ b/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/ContextRule.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,9 @@ * limitations under the License. */ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: google/api/context.proto +// Protobuf Java Version: 4.33.2 package com.google.api; @@ -28,33 +30,34 @@ * * Protobuf type {@code google.api.ContextRule} */ -public final class ContextRule extends com.google.protobuf.GeneratedMessageV3 +@com.google.protobuf.Generated +public final class ContextRule extends com.google.protobuf.GeneratedMessage implements // @@protoc_insertion_point(message_implements:google.api.ContextRule) ContextRuleOrBuilder { private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "ContextRule"); + } + // Use ContextRule.newBuilder() to construct. - private ContextRule(com.google.protobuf.GeneratedMessageV3.Builder builder) { + private ContextRule(com.google.protobuf.GeneratedMessage.Builder builder) { super(builder); } private ContextRule() { selector_ = ""; - requested_ = com.google.protobuf.LazyStringArrayList.EMPTY; - provided_ = com.google.protobuf.LazyStringArrayList.EMPTY; - allowedRequestExtensions_ = com.google.protobuf.LazyStringArrayList.EMPTY; - allowedResponseExtensions_ = com.google.protobuf.LazyStringArrayList.EMPTY; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new ContextRule(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; + requested_ = com.google.protobuf.LazyStringArrayList.emptyList(); + provided_ = com.google.protobuf.LazyStringArrayList.emptyList(); + allowedRequestExtensions_ = com.google.protobuf.LazyStringArrayList.emptyList(); + allowedResponseExtensions_ = com.google.protobuf.LazyStringArrayList.emptyList(); } public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { @@ -62,7 +65,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.api.ContextProto.internal_static_google_api_ContextRule_fieldAccessorTable .ensureFieldAccessorsInitialized( @@ -70,13 +73,18 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } public static final int SELECTOR_FIELD_NUMBER = 1; - private volatile java.lang.Object selector_; + + @SuppressWarnings("serial") + private volatile java.lang.Object selector_ = ""; + /** * * *
            * Selects the methods to which this rule applies.
        -   * Refer to [selector][google.api.DocumentationRule.selector] for syntax details.
        +   *
        +   * Refer to [selector][google.api.DocumentationRule.selector] for syntax
        +   * details.
            * 
        * * string selector = 1; @@ -95,12 +103,15 @@ public java.lang.String getSelector() { return s; } } + /** * * *
            * Selects the methods to which this rule applies.
        -   * Refer to [selector][google.api.DocumentationRule.selector] for syntax details.
        +   *
        +   * Refer to [selector][google.api.DocumentationRule.selector] for syntax
        +   * details.
            * 
        * * string selector = 1; @@ -121,12 +132,17 @@ public com.google.protobuf.ByteString getSelectorBytes() { } public static final int REQUESTED_FIELD_NUMBER = 2; - private com.google.protobuf.LazyStringList requested_; + + @SuppressWarnings("serial") + private com.google.protobuf.LazyStringArrayList requested_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + /** * * *
        -   * A list of full type names of requested contexts.
        +   * A list of full type names of requested contexts, only the requested context
        +   * will be made available to the backend.
            * 
        * * repeated string requested = 2; @@ -136,11 +152,13 @@ public com.google.protobuf.ByteString getSelectorBytes() { public com.google.protobuf.ProtocolStringList getRequestedList() { return requested_; } + /** * * *
        -   * A list of full type names of requested contexts.
        +   * A list of full type names of requested contexts, only the requested context
        +   * will be made available to the backend.
            * 
        * * repeated string requested = 2; @@ -150,11 +168,13 @@ public com.google.protobuf.ProtocolStringList getRequestedList() { public int getRequestedCount() { return requested_.size(); } + /** * * *
        -   * A list of full type names of requested contexts.
        +   * A list of full type names of requested contexts, only the requested context
        +   * will be made available to the backend.
            * 
        * * repeated string requested = 2; @@ -165,11 +185,13 @@ public int getRequestedCount() { public java.lang.String getRequested(int index) { return requested_.get(index); } + /** * * *
        -   * A list of full type names of requested contexts.
        +   * A list of full type names of requested contexts, only the requested context
        +   * will be made available to the backend.
            * 
        * * repeated string requested = 2; @@ -182,12 +204,17 @@ public com.google.protobuf.ByteString getRequestedBytes(int index) { } public static final int PROVIDED_FIELD_NUMBER = 3; - private com.google.protobuf.LazyStringList provided_; + + @SuppressWarnings("serial") + private com.google.protobuf.LazyStringArrayList provided_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + /** * * *
        -   * A list of full type names of provided contexts.
        +   * A list of full type names of provided contexts. It is used to support
        +   * propagating HTTP headers and ETags from the response extension.
            * 
        * * repeated string provided = 3; @@ -197,11 +224,13 @@ public com.google.protobuf.ByteString getRequestedBytes(int index) { public com.google.protobuf.ProtocolStringList getProvidedList() { return provided_; } + /** * * *
        -   * A list of full type names of provided contexts.
        +   * A list of full type names of provided contexts. It is used to support
        +   * propagating HTTP headers and ETags from the response extension.
            * 
        * * repeated string provided = 3; @@ -211,11 +240,13 @@ public com.google.protobuf.ProtocolStringList getProvidedList() { public int getProvidedCount() { return provided_.size(); } + /** * * *
        -   * A list of full type names of provided contexts.
        +   * A list of full type names of provided contexts. It is used to support
        +   * propagating HTTP headers and ETags from the response extension.
            * 
        * * repeated string provided = 3; @@ -226,11 +257,13 @@ public int getProvidedCount() { public java.lang.String getProvided(int index) { return provided_.get(index); } + /** * * *
        -   * A list of full type names of provided contexts.
        +   * A list of full type names of provided contexts. It is used to support
        +   * propagating HTTP headers and ETags from the response extension.
            * 
        * * repeated string provided = 3; @@ -243,7 +276,11 @@ public com.google.protobuf.ByteString getProvidedBytes(int index) { } public static final int ALLOWED_REQUEST_EXTENSIONS_FIELD_NUMBER = 4; - private com.google.protobuf.LazyStringList allowedRequestExtensions_; + + @SuppressWarnings("serial") + private com.google.protobuf.LazyStringArrayList allowedRequestExtensions_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + /** * * @@ -259,6 +296,7 @@ public com.google.protobuf.ByteString getProvidedBytes(int index) { public com.google.protobuf.ProtocolStringList getAllowedRequestExtensionsList() { return allowedRequestExtensions_; } + /** * * @@ -274,6 +312,7 @@ public com.google.protobuf.ProtocolStringList getAllowedRequestExtensionsList() public int getAllowedRequestExtensionsCount() { return allowedRequestExtensions_.size(); } + /** * * @@ -290,6 +329,7 @@ public int getAllowedRequestExtensionsCount() { public java.lang.String getAllowedRequestExtensions(int index) { return allowedRequestExtensions_.get(index); } + /** * * @@ -308,7 +348,11 @@ public com.google.protobuf.ByteString getAllowedRequestExtensionsBytes(int index } public static final int ALLOWED_RESPONSE_EXTENSIONS_FIELD_NUMBER = 5; - private com.google.protobuf.LazyStringList allowedResponseExtensions_; + + @SuppressWarnings("serial") + private com.google.protobuf.LazyStringArrayList allowedResponseExtensions_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + /** * * @@ -324,6 +368,7 @@ public com.google.protobuf.ByteString getAllowedRequestExtensionsBytes(int index public com.google.protobuf.ProtocolStringList getAllowedResponseExtensionsList() { return allowedResponseExtensions_; } + /** * * @@ -339,6 +384,7 @@ public com.google.protobuf.ProtocolStringList getAllowedResponseExtensionsList() public int getAllowedResponseExtensionsCount() { return allowedResponseExtensions_.size(); } + /** * * @@ -355,6 +401,7 @@ public int getAllowedResponseExtensionsCount() { public java.lang.String getAllowedResponseExtensions(int index) { return allowedResponseExtensions_.get(index); } + /** * * @@ -386,21 +433,21 @@ public final boolean isInitialized() { @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(selector_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, selector_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(selector_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, selector_); } for (int i = 0; i < requested_.size(); i++) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 2, requested_.getRaw(i)); + com.google.protobuf.GeneratedMessage.writeString(output, 2, requested_.getRaw(i)); } for (int i = 0; i < provided_.size(); i++) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 3, provided_.getRaw(i)); + com.google.protobuf.GeneratedMessage.writeString(output, 3, provided_.getRaw(i)); } for (int i = 0; i < allowedRequestExtensions_.size(); i++) { - com.google.protobuf.GeneratedMessageV3.writeString( + com.google.protobuf.GeneratedMessage.writeString( output, 4, allowedRequestExtensions_.getRaw(i)); } for (int i = 0; i < allowedResponseExtensions_.size(); i++) { - com.google.protobuf.GeneratedMessageV3.writeString( + com.google.protobuf.GeneratedMessage.writeString( output, 5, allowedResponseExtensions_.getRaw(i)); } getUnknownFields().writeTo(output); @@ -412,8 +459,8 @@ public int getSerializedSize() { if (size != -1) return size; size = 0; - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(selector_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, selector_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(selector_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, selector_); } { int dataSize = 0; @@ -539,38 +586,38 @@ public static com.google.api.ContextRule parseFrom( public static com.google.api.ContextRule parseFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); } public static com.google.api.ContextRule parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } public static com.google.api.ContextRule parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); } public static com.google.api.ContextRule parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( PARSER, input, extensionRegistry); } public static com.google.api.ContextRule parseFrom(com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); } public static com.google.api.ContextRule parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } @@ -593,10 +640,11 @@ public Builder toBuilder() { } @java.lang.Override - protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { Builder builder = new Builder(parent); return builder; } + /** * * @@ -607,7 +655,7 @@ protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.Build * * Protobuf type {@code google.api.ContextRule} */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder implements // @@protoc_insertion_point(builder_implements:google.api.ContextRule) com.google.api.ContextRuleOrBuilder { @@ -616,7 +664,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.api.ContextProto.internal_static_google_api_ContextRule_fieldAccessorTable .ensureFieldAccessorsInitialized( @@ -626,23 +674,19 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { // Construct using com.google.api.ContextRule.newBuilder() private Builder() {} - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { super(parent); } @java.lang.Override public Builder clear() { super.clear(); + bitField0_ = 0; selector_ = ""; - - requested_ = com.google.protobuf.LazyStringArrayList.EMPTY; - bitField0_ = (bitField0_ & ~0x00000001); - provided_ = com.google.protobuf.LazyStringArrayList.EMPTY; - bitField0_ = (bitField0_ & ~0x00000002); - allowedRequestExtensions_ = com.google.protobuf.LazyStringArrayList.EMPTY; - bitField0_ = (bitField0_ & ~0x00000004); - allowedResponseExtensions_ = com.google.protobuf.LazyStringArrayList.EMPTY; - bitField0_ = (bitField0_ & ~0x00000008); + requested_ = com.google.protobuf.LazyStringArrayList.emptyList(); + provided_ = com.google.protobuf.LazyStringArrayList.emptyList(); + allowedRequestExtensions_ = com.google.protobuf.LazyStringArrayList.emptyList(); + allowedResponseExtensions_ = com.google.protobuf.LazyStringArrayList.emptyList(); return this; } @@ -668,63 +712,34 @@ public com.google.api.ContextRule build() { @java.lang.Override public com.google.api.ContextRule buildPartial() { com.google.api.ContextRule result = new com.google.api.ContextRule(this); - int from_bitField0_ = bitField0_; - result.selector_ = selector_; - if (((bitField0_ & 0x00000001) != 0)) { - requested_ = requested_.getUnmodifiableView(); - bitField0_ = (bitField0_ & ~0x00000001); - } - result.requested_ = requested_; - if (((bitField0_ & 0x00000002) != 0)) { - provided_ = provided_.getUnmodifiableView(); - bitField0_ = (bitField0_ & ~0x00000002); + if (bitField0_ != 0) { + buildPartial0(result); } - result.provided_ = provided_; - if (((bitField0_ & 0x00000004) != 0)) { - allowedRequestExtensions_ = allowedRequestExtensions_.getUnmodifiableView(); - bitField0_ = (bitField0_ & ~0x00000004); - } - result.allowedRequestExtensions_ = allowedRequestExtensions_; - if (((bitField0_ & 0x00000008) != 0)) { - allowedResponseExtensions_ = allowedResponseExtensions_.getUnmodifiableView(); - bitField0_ = (bitField0_ & ~0x00000008); - } - result.allowedResponseExtensions_ = allowedResponseExtensions_; 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); + private void buildPartial0(com.google.api.ContextRule result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.selector_ = selector_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + requested_.makeImmutable(); + result.requested_ = requested_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + provided_.makeImmutable(); + result.provided_ = provided_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + allowedRequestExtensions_.makeImmutable(); + result.allowedRequestExtensions_ = allowedRequestExtensions_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + allowedResponseExtensions_.makeImmutable(); + result.allowedResponseExtensions_ = allowedResponseExtensions_; + } } @java.lang.Override @@ -741,12 +756,13 @@ public Builder mergeFrom(com.google.api.ContextRule other) { if (other == com.google.api.ContextRule.getDefaultInstance()) return this; if (!other.getSelector().isEmpty()) { selector_ = other.selector_; + bitField0_ |= 0x00000001; onChanged(); } if (!other.requested_.isEmpty()) { if (requested_.isEmpty()) { requested_ = other.requested_; - bitField0_ = (bitField0_ & ~0x00000001); + bitField0_ |= 0x00000002; } else { ensureRequestedIsMutable(); requested_.addAll(other.requested_); @@ -756,7 +772,7 @@ public Builder mergeFrom(com.google.api.ContextRule other) { if (!other.provided_.isEmpty()) { if (provided_.isEmpty()) { provided_ = other.provided_; - bitField0_ = (bitField0_ & ~0x00000002); + bitField0_ |= 0x00000004; } else { ensureProvidedIsMutable(); provided_.addAll(other.provided_); @@ -766,7 +782,7 @@ public Builder mergeFrom(com.google.api.ContextRule other) { if (!other.allowedRequestExtensions_.isEmpty()) { if (allowedRequestExtensions_.isEmpty()) { allowedRequestExtensions_ = other.allowedRequestExtensions_; - bitField0_ = (bitField0_ & ~0x00000004); + bitField0_ |= 0x00000008; } else { ensureAllowedRequestExtensionsIsMutable(); allowedRequestExtensions_.addAll(other.allowedRequestExtensions_); @@ -776,7 +792,7 @@ public Builder mergeFrom(com.google.api.ContextRule other) { if (!other.allowedResponseExtensions_.isEmpty()) { if (allowedResponseExtensions_.isEmpty()) { allowedResponseExtensions_ = other.allowedResponseExtensions_; - bitField0_ = (bitField0_ & ~0x00000008); + bitField0_ |= 0x00000010; } else { ensureAllowedResponseExtensionsIsMutable(); allowedResponseExtensions_.addAll(other.allowedResponseExtensions_); @@ -812,7 +828,7 @@ public Builder mergeFrom( case 10: { selector_ = input.readStringRequireUtf8(); - + bitField0_ |= 0x00000001; break; } // case 10 case 18: @@ -863,12 +879,15 @@ public Builder mergeFrom( private int bitField0_; private java.lang.Object selector_ = ""; + /** * * *
              * Selects the methods to which this rule applies.
        -     * Refer to [selector][google.api.DocumentationRule.selector] for syntax details.
        +     *
        +     * Refer to [selector][google.api.DocumentationRule.selector] for syntax
        +     * details.
              * 
        * * string selector = 1; @@ -886,12 +905,15 @@ public java.lang.String getSelector() { return (java.lang.String) ref; } } + /** * * *
              * Selects the methods to which this rule applies.
        -     * Refer to [selector][google.api.DocumentationRule.selector] for syntax details.
        +     *
        +     * Refer to [selector][google.api.DocumentationRule.selector] for syntax
        +     * details.
              * 
        * * string selector = 1; @@ -909,12 +931,15 @@ public com.google.protobuf.ByteString getSelectorBytes() { return (com.google.protobuf.ByteString) ref; } } + /** * * *
              * Selects the methods to which this rule applies.
        -     * Refer to [selector][google.api.DocumentationRule.selector] for syntax details.
        +     *
        +     * Refer to [selector][google.api.DocumentationRule.selector] for syntax
        +     * details.
              * 
        * * string selector = 1; @@ -926,17 +951,20 @@ public Builder setSelector(java.lang.String value) { if (value == null) { throw new NullPointerException(); } - selector_ = value; + bitField0_ |= 0x00000001; onChanged(); return this; } + /** * * *
              * Selects the methods to which this rule applies.
        -     * Refer to [selector][google.api.DocumentationRule.selector] for syntax details.
        +     *
        +     * Refer to [selector][google.api.DocumentationRule.selector] for syntax
        +     * details.
              * 
        * * string selector = 1; @@ -944,17 +972,20 @@ public Builder setSelector(java.lang.String value) { * @return This builder for chaining. */ public Builder clearSelector() { - selector_ = getDefaultInstance().getSelector(); + bitField0_ = (bitField0_ & ~0x00000001); onChanged(); return this; } + /** * * *
              * Selects the methods to which this rule applies.
        -     * Refer to [selector][google.api.DocumentationRule.selector] for syntax details.
        +     *
        +     * Refer to [selector][google.api.DocumentationRule.selector] for syntax
        +     * details.
              * 
        * * string selector = 1; @@ -967,26 +998,28 @@ public Builder setSelectorBytes(com.google.protobuf.ByteString value) { throw new NullPointerException(); } checkByteStringIsUtf8(value); - selector_ = value; + bitField0_ |= 0x00000001; onChanged(); return this; } - private com.google.protobuf.LazyStringList requested_ = - com.google.protobuf.LazyStringArrayList.EMPTY; + private com.google.protobuf.LazyStringArrayList requested_ = + com.google.protobuf.LazyStringArrayList.emptyList(); private void ensureRequestedIsMutable() { - if (!((bitField0_ & 0x00000001) != 0)) { + if (!requested_.isModifiable()) { requested_ = new com.google.protobuf.LazyStringArrayList(requested_); - bitField0_ |= 0x00000001; } + bitField0_ |= 0x00000002; } + /** * * *
        -     * A list of full type names of requested contexts.
        +     * A list of full type names of requested contexts, only the requested context
        +     * will be made available to the backend.
              * 
        * * repeated string requested = 2; @@ -994,13 +1027,16 @@ private void ensureRequestedIsMutable() { * @return A list containing the requested. */ public com.google.protobuf.ProtocolStringList getRequestedList() { - return requested_.getUnmodifiableView(); + requested_.makeImmutable(); + return requested_; } + /** * * *
        -     * A list of full type names of requested contexts.
        +     * A list of full type names of requested contexts, only the requested context
        +     * will be made available to the backend.
              * 
        * * repeated string requested = 2; @@ -1010,11 +1046,13 @@ public com.google.protobuf.ProtocolStringList getRequestedList() { public int getRequestedCount() { return requested_.size(); } + /** * * *
        -     * A list of full type names of requested contexts.
        +     * A list of full type names of requested contexts, only the requested context
        +     * will be made available to the backend.
              * 
        * * repeated string requested = 2; @@ -1025,11 +1063,13 @@ public int getRequestedCount() { public java.lang.String getRequested(int index) { return requested_.get(index); } + /** * * *
        -     * A list of full type names of requested contexts.
        +     * A list of full type names of requested contexts, only the requested context
        +     * will be made available to the backend.
              * 
        * * repeated string requested = 2; @@ -1040,11 +1080,13 @@ public java.lang.String getRequested(int index) { public com.google.protobuf.ByteString getRequestedBytes(int index) { return requested_.getByteString(index); } + /** * * *
        -     * A list of full type names of requested contexts.
        +     * A list of full type names of requested contexts, only the requested context
        +     * will be made available to the backend.
              * 
        * * repeated string requested = 2; @@ -1059,14 +1101,17 @@ public Builder setRequested(int index, java.lang.String value) { } ensureRequestedIsMutable(); requested_.set(index, value); + bitField0_ |= 0x00000002; onChanged(); return this; } + /** * * *
        -     * A list of full type names of requested contexts.
        +     * A list of full type names of requested contexts, only the requested context
        +     * will be made available to the backend.
              * 
        * * repeated string requested = 2; @@ -1080,14 +1125,17 @@ public Builder addRequested(java.lang.String value) { } ensureRequestedIsMutable(); requested_.add(value); + bitField0_ |= 0x00000002; onChanged(); return this; } + /** * * *
        -     * A list of full type names of requested contexts.
        +     * A list of full type names of requested contexts, only the requested context
        +     * will be made available to the backend.
              * 
        * * repeated string requested = 2; @@ -1098,14 +1146,17 @@ public Builder addRequested(java.lang.String value) { public Builder addAllRequested(java.lang.Iterable values) { ensureRequestedIsMutable(); com.google.protobuf.AbstractMessageLite.Builder.addAll(values, requested_); + bitField0_ |= 0x00000002; onChanged(); return this; } + /** * * *
        -     * A list of full type names of requested contexts.
        +     * A list of full type names of requested contexts, only the requested context
        +     * will be made available to the backend.
              * 
        * * repeated string requested = 2; @@ -1113,16 +1164,19 @@ public Builder addAllRequested(java.lang.Iterable values) { * @return This builder for chaining. */ public Builder clearRequested() { - requested_ = com.google.protobuf.LazyStringArrayList.EMPTY; - bitField0_ = (bitField0_ & ~0x00000001); + requested_ = com.google.protobuf.LazyStringArrayList.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + ; onChanged(); return this; } + /** * * *
        -     * A list of full type names of requested contexts.
        +     * A list of full type names of requested contexts, only the requested context
        +     * will be made available to the backend.
              * 
        * * repeated string requested = 2; @@ -1137,24 +1191,27 @@ public Builder addRequestedBytes(com.google.protobuf.ByteString value) { checkByteStringIsUtf8(value); ensureRequestedIsMutable(); requested_.add(value); + bitField0_ |= 0x00000002; onChanged(); return this; } - private com.google.protobuf.LazyStringList provided_ = - com.google.protobuf.LazyStringArrayList.EMPTY; + private com.google.protobuf.LazyStringArrayList provided_ = + com.google.protobuf.LazyStringArrayList.emptyList(); private void ensureProvidedIsMutable() { - if (!((bitField0_ & 0x00000002) != 0)) { + if (!provided_.isModifiable()) { provided_ = new com.google.protobuf.LazyStringArrayList(provided_); - bitField0_ |= 0x00000002; } + bitField0_ |= 0x00000004; } + /** * * *
        -     * A list of full type names of provided contexts.
        +     * A list of full type names of provided contexts. It is used to support
        +     * propagating HTTP headers and ETags from the response extension.
              * 
        * * repeated string provided = 3; @@ -1162,13 +1219,16 @@ private void ensureProvidedIsMutable() { * @return A list containing the provided. */ public com.google.protobuf.ProtocolStringList getProvidedList() { - return provided_.getUnmodifiableView(); + provided_.makeImmutable(); + return provided_; } + /** * * *
        -     * A list of full type names of provided contexts.
        +     * A list of full type names of provided contexts. It is used to support
        +     * propagating HTTP headers and ETags from the response extension.
              * 
        * * repeated string provided = 3; @@ -1178,11 +1238,13 @@ public com.google.protobuf.ProtocolStringList getProvidedList() { public int getProvidedCount() { return provided_.size(); } + /** * * *
        -     * A list of full type names of provided contexts.
        +     * A list of full type names of provided contexts. It is used to support
        +     * propagating HTTP headers and ETags from the response extension.
              * 
        * * repeated string provided = 3; @@ -1193,11 +1255,13 @@ public int getProvidedCount() { public java.lang.String getProvided(int index) { return provided_.get(index); } + /** * * *
        -     * A list of full type names of provided contexts.
        +     * A list of full type names of provided contexts. It is used to support
        +     * propagating HTTP headers and ETags from the response extension.
              * 
        * * repeated string provided = 3; @@ -1208,11 +1272,13 @@ public java.lang.String getProvided(int index) { public com.google.protobuf.ByteString getProvidedBytes(int index) { return provided_.getByteString(index); } + /** * * *
        -     * A list of full type names of provided contexts.
        +     * A list of full type names of provided contexts. It is used to support
        +     * propagating HTTP headers and ETags from the response extension.
              * 
        * * repeated string provided = 3; @@ -1227,14 +1293,17 @@ public Builder setProvided(int index, java.lang.String value) { } ensureProvidedIsMutable(); provided_.set(index, value); + bitField0_ |= 0x00000004; onChanged(); return this; } + /** * * *
        -     * A list of full type names of provided contexts.
        +     * A list of full type names of provided contexts. It is used to support
        +     * propagating HTTP headers and ETags from the response extension.
              * 
        * * repeated string provided = 3; @@ -1248,14 +1317,17 @@ public Builder addProvided(java.lang.String value) { } ensureProvidedIsMutable(); provided_.add(value); + bitField0_ |= 0x00000004; onChanged(); return this; } + /** * * *
        -     * A list of full type names of provided contexts.
        +     * A list of full type names of provided contexts. It is used to support
        +     * propagating HTTP headers and ETags from the response extension.
              * 
        * * repeated string provided = 3; @@ -1266,14 +1338,17 @@ public Builder addProvided(java.lang.String value) { public Builder addAllProvided(java.lang.Iterable values) { ensureProvidedIsMutable(); com.google.protobuf.AbstractMessageLite.Builder.addAll(values, provided_); + bitField0_ |= 0x00000004; onChanged(); return this; } + /** * * *
        -     * A list of full type names of provided contexts.
        +     * A list of full type names of provided contexts. It is used to support
        +     * propagating HTTP headers and ETags from the response extension.
              * 
        * * repeated string provided = 3; @@ -1281,16 +1356,19 @@ public Builder addAllProvided(java.lang.Iterable values) { * @return This builder for chaining. */ public Builder clearProvided() { - provided_ = com.google.protobuf.LazyStringArrayList.EMPTY; - bitField0_ = (bitField0_ & ~0x00000002); + provided_ = com.google.protobuf.LazyStringArrayList.emptyList(); + bitField0_ = (bitField0_ & ~0x00000004); + ; onChanged(); return this; } + /** * * *
        -     * A list of full type names of provided contexts.
        +     * A list of full type names of provided contexts. It is used to support
        +     * propagating HTTP headers and ETags from the response extension.
              * 
        * * repeated string provided = 3; @@ -1305,20 +1383,22 @@ public Builder addProvidedBytes(com.google.protobuf.ByteString value) { checkByteStringIsUtf8(value); ensureProvidedIsMutable(); provided_.add(value); + bitField0_ |= 0x00000004; onChanged(); return this; } - private com.google.protobuf.LazyStringList allowedRequestExtensions_ = - com.google.protobuf.LazyStringArrayList.EMPTY; + private com.google.protobuf.LazyStringArrayList allowedRequestExtensions_ = + com.google.protobuf.LazyStringArrayList.emptyList(); private void ensureAllowedRequestExtensionsIsMutable() { - if (!((bitField0_ & 0x00000004) != 0)) { + if (!allowedRequestExtensions_.isModifiable()) { allowedRequestExtensions_ = new com.google.protobuf.LazyStringArrayList(allowedRequestExtensions_); - bitField0_ |= 0x00000004; } + bitField0_ |= 0x00000008; } + /** * * @@ -1332,8 +1412,10 @@ private void ensureAllowedRequestExtensionsIsMutable() { * @return A list containing the allowedRequestExtensions. */ public com.google.protobuf.ProtocolStringList getAllowedRequestExtensionsList() { - return allowedRequestExtensions_.getUnmodifiableView(); + allowedRequestExtensions_.makeImmutable(); + return allowedRequestExtensions_; } + /** * * @@ -1349,6 +1431,7 @@ public com.google.protobuf.ProtocolStringList getAllowedRequestExtensionsList() public int getAllowedRequestExtensionsCount() { return allowedRequestExtensions_.size(); } + /** * * @@ -1365,6 +1448,7 @@ public int getAllowedRequestExtensionsCount() { public java.lang.String getAllowedRequestExtensions(int index) { return allowedRequestExtensions_.get(index); } + /** * * @@ -1381,6 +1465,7 @@ public java.lang.String getAllowedRequestExtensions(int index) { public com.google.protobuf.ByteString getAllowedRequestExtensionsBytes(int index) { return allowedRequestExtensions_.getByteString(index); } + /** * * @@ -1401,9 +1486,11 @@ public Builder setAllowedRequestExtensions(int index, java.lang.String value) { } ensureAllowedRequestExtensionsIsMutable(); allowedRequestExtensions_.set(index, value); + bitField0_ |= 0x00000008; onChanged(); return this; } + /** * * @@ -1423,9 +1510,11 @@ public Builder addAllowedRequestExtensions(java.lang.String value) { } ensureAllowedRequestExtensionsIsMutable(); allowedRequestExtensions_.add(value); + bitField0_ |= 0x00000008; onChanged(); return this; } + /** * * @@ -1442,9 +1531,11 @@ public Builder addAllowedRequestExtensions(java.lang.String value) { public Builder addAllAllowedRequestExtensions(java.lang.Iterable values) { ensureAllowedRequestExtensionsIsMutable(); com.google.protobuf.AbstractMessageLite.Builder.addAll(values, allowedRequestExtensions_); + bitField0_ |= 0x00000008; onChanged(); return this; } + /** * * @@ -1458,11 +1549,13 @@ public Builder addAllAllowedRequestExtensions(java.lang.Iterable values) { ensureAllowedResponseExtensionsIsMutable(); com.google.protobuf.AbstractMessageLite.Builder.addAll(values, allowedResponseExtensions_); + bitField0_ |= 0x00000010; onChanged(); return this; } + /** * * @@ -1636,11 +1742,13 @@ public Builder addAllAllowedResponseExtensions(java.lang.Iterable * Selects the methods to which this rule applies. - * Refer to [selector][google.api.DocumentationRule.selector] for syntax details. + * + * Refer to [selector][google.api.DocumentationRule.selector] for syntax + * details. *
        * * string selector = 1; @@ -36,12 +41,15 @@ public interface ContextRuleOrBuilder * @return The selector. */ java.lang.String getSelector(); + /** * * *
            * Selects the methods to which this rule applies.
        -   * Refer to [selector][google.api.DocumentationRule.selector] for syntax details.
        +   *
        +   * Refer to [selector][google.api.DocumentationRule.selector] for syntax
        +   * details.
            * 
        * * string selector = 1; @@ -54,7 +62,8 @@ public interface ContextRuleOrBuilder * * *
        -   * A list of full type names of requested contexts.
        +   * A list of full type names of requested contexts, only the requested context
        +   * will be made available to the backend.
            * 
        * * repeated string requested = 2; @@ -62,11 +71,13 @@ public interface ContextRuleOrBuilder * @return A list containing the requested. */ java.util.List getRequestedList(); + /** * * *
        -   * A list of full type names of requested contexts.
        +   * A list of full type names of requested contexts, only the requested context
        +   * will be made available to the backend.
            * 
        * * repeated string requested = 2; @@ -74,11 +85,13 @@ public interface ContextRuleOrBuilder * @return The count of requested. */ int getRequestedCount(); + /** * * *
        -   * A list of full type names of requested contexts.
        +   * A list of full type names of requested contexts, only the requested context
        +   * will be made available to the backend.
            * 
        * * repeated string requested = 2; @@ -87,11 +100,13 @@ public interface ContextRuleOrBuilder * @return The requested at the given index. */ java.lang.String getRequested(int index); + /** * * *
        -   * A list of full type names of requested contexts.
        +   * A list of full type names of requested contexts, only the requested context
        +   * will be made available to the backend.
            * 
        * * repeated string requested = 2; @@ -105,7 +120,8 @@ public interface ContextRuleOrBuilder * * *
        -   * A list of full type names of provided contexts.
        +   * A list of full type names of provided contexts. It is used to support
        +   * propagating HTTP headers and ETags from the response extension.
            * 
        * * repeated string provided = 3; @@ -113,11 +129,13 @@ public interface ContextRuleOrBuilder * @return A list containing the provided. */ java.util.List getProvidedList(); + /** * * *
        -   * A list of full type names of provided contexts.
        +   * A list of full type names of provided contexts. It is used to support
        +   * propagating HTTP headers and ETags from the response extension.
            * 
        * * repeated string provided = 3; @@ -125,11 +143,13 @@ public interface ContextRuleOrBuilder * @return The count of provided. */ int getProvidedCount(); + /** * * *
        -   * A list of full type names of provided contexts.
        +   * A list of full type names of provided contexts. It is used to support
        +   * propagating HTTP headers and ETags from the response extension.
            * 
        * * repeated string provided = 3; @@ -138,11 +158,13 @@ public interface ContextRuleOrBuilder * @return The provided at the given index. */ java.lang.String getProvided(int index); + /** * * *
        -   * A list of full type names of provided contexts.
        +   * A list of full type names of provided contexts. It is used to support
        +   * propagating HTTP headers and ETags from the response extension.
            * 
        * * repeated string provided = 3; @@ -165,6 +187,7 @@ public interface ContextRuleOrBuilder * @return A list containing the allowedRequestExtensions. */ java.util.List getAllowedRequestExtensionsList(); + /** * * @@ -178,6 +201,7 @@ public interface ContextRuleOrBuilder * @return The count of allowedRequestExtensions. */ int getAllowedRequestExtensionsCount(); + /** * * @@ -192,6 +216,7 @@ public interface ContextRuleOrBuilder * @return The allowedRequestExtensions at the given index. */ java.lang.String getAllowedRequestExtensions(int index); + /** * * @@ -220,6 +245,7 @@ public interface ContextRuleOrBuilder * @return A list containing the allowedResponseExtensions. */ java.util.List getAllowedResponseExtensionsList(); + /** * * @@ -233,6 +259,7 @@ public interface ContextRuleOrBuilder * @return The count of allowedResponseExtensions. */ int getAllowedResponseExtensionsCount(); + /** * * @@ -247,6 +274,7 @@ public interface ContextRuleOrBuilder * @return The allowedResponseExtensions at the given index. */ java.lang.String getAllowedResponseExtensions(int index); + /** * * diff --git a/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/Control.java b/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/Control.java index 09afa67e0b..060efcaf64 100644 --- a/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/Control.java +++ b/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/Control.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,9 @@ * limitations under the License. */ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: google/api/control.proto +// Protobuf Java Version: 4.33.2 package com.google.api; @@ -23,36 +25,40 @@ * *
          * Selects and configures the service controller used by the service.
        + *
          * Example:
        - *     control:
        - *       environment: servicecontrol.googleapis.com
        + *
        + * control:
        + * environment: servicecontrol.googleapis.com
          * 
        * * Protobuf type {@code google.api.Control} */ -public final class Control extends com.google.protobuf.GeneratedMessageV3 +@com.google.protobuf.Generated +public final class Control extends com.google.protobuf.GeneratedMessage implements // @@protoc_insertion_point(message_implements:google.api.Control) ControlOrBuilder { private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "Control"); + } + // Use Control.newBuilder() to construct. - private Control(com.google.protobuf.GeneratedMessageV3.Builder builder) { + private Control(com.google.protobuf.GeneratedMessage.Builder builder) { super(builder); } private Control() { environment_ = ""; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new Control(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; + methodPolicies_ = java.util.Collections.emptyList(); } public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { @@ -60,7 +66,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.api.ControlProto.internal_static_google_api_Control_fieldAccessorTable .ensureFieldAccessorsInitialized( @@ -68,7 +74,10 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } public static final int ENVIRONMENT_FIELD_NUMBER = 1; - private volatile java.lang.Object environment_; + + @SuppressWarnings("serial") + private volatile java.lang.Object environment_ = ""; + /** * * @@ -94,6 +103,7 @@ public java.lang.String getEnvironment() { return s; } } + /** * * @@ -120,6 +130,82 @@ public com.google.protobuf.ByteString getEnvironmentBytes() { } } + public static final int METHOD_POLICIES_FIELD_NUMBER = 4; + + @SuppressWarnings("serial") + private java.util.List methodPolicies_; + + /** + * + * + *
        +   * Defines policies applying to the API methods of the service.
        +   * 
        + * + * repeated .google.api.MethodPolicy method_policies = 4; + */ + @java.lang.Override + public java.util.List getMethodPoliciesList() { + return methodPolicies_; + } + + /** + * + * + *
        +   * Defines policies applying to the API methods of the service.
        +   * 
        + * + * repeated .google.api.MethodPolicy method_policies = 4; + */ + @java.lang.Override + public java.util.List + getMethodPoliciesOrBuilderList() { + return methodPolicies_; + } + + /** + * + * + *
        +   * Defines policies applying to the API methods of the service.
        +   * 
        + * + * repeated .google.api.MethodPolicy method_policies = 4; + */ + @java.lang.Override + public int getMethodPoliciesCount() { + return methodPolicies_.size(); + } + + /** + * + * + *
        +   * Defines policies applying to the API methods of the service.
        +   * 
        + * + * repeated .google.api.MethodPolicy method_policies = 4; + */ + @java.lang.Override + public com.google.api.MethodPolicy getMethodPolicies(int index) { + return methodPolicies_.get(index); + } + + /** + * + * + *
        +   * Defines policies applying to the API methods of the service.
        +   * 
        + * + * repeated .google.api.MethodPolicy method_policies = 4; + */ + @java.lang.Override + public com.google.api.MethodPolicyOrBuilder getMethodPoliciesOrBuilder(int index) { + return methodPolicies_.get(index); + } + private byte memoizedIsInitialized = -1; @java.lang.Override @@ -134,8 +220,11 @@ public final boolean isInitialized() { @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(environment_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, environment_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(environment_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, environment_); + } + for (int i = 0; i < methodPolicies_.size(); i++) { + output.writeMessage(4, methodPolicies_.get(i)); } getUnknownFields().writeTo(output); } @@ -146,8 +235,11 @@ public int getSerializedSize() { if (size != -1) return size; size = 0; - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(environment_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, environment_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(environment_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, environment_); + } + for (int i = 0; i < methodPolicies_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, methodPolicies_.get(i)); } size += getUnknownFields().getSerializedSize(); memoizedSize = size; @@ -165,6 +257,7 @@ public boolean equals(final java.lang.Object obj) { com.google.api.Control other = (com.google.api.Control) obj; if (!getEnvironment().equals(other.getEnvironment())) return false; + if (!getMethodPoliciesList().equals(other.getMethodPoliciesList())) return false; if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -178,6 +271,10 @@ public int hashCode() { hash = (19 * hash) + getDescriptor().hashCode(); hash = (37 * hash) + ENVIRONMENT_FIELD_NUMBER; hash = (53 * hash) + getEnvironment().hashCode(); + if (getMethodPoliciesCount() > 0) { + hash = (37 * hash) + METHOD_POLICIES_FIELD_NUMBER; + hash = (53 * hash) + getMethodPoliciesList().hashCode(); + } hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; @@ -219,38 +316,38 @@ public static com.google.api.Control parseFrom( public static com.google.api.Control parseFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); } public static com.google.api.Control parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } public static com.google.api.Control parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); } public static com.google.api.Control parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( PARSER, input, extensionRegistry); } public static com.google.api.Control parseFrom(com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); } public static com.google.api.Control parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } @@ -273,23 +370,26 @@ public Builder toBuilder() { } @java.lang.Override - protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { Builder builder = new Builder(parent); return builder; } + /** * * *
            * Selects and configures the service controller used by the service.
        +   *
            * Example:
        -   *     control:
        -   *       environment: servicecontrol.googleapis.com
        +   *
        +   * control:
        +   * environment: servicecontrol.googleapis.com
            * 
        * * Protobuf type {@code google.api.Control} */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder implements // @@protoc_insertion_point(builder_implements:google.api.Control) com.google.api.ControlOrBuilder { @@ -298,7 +398,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.api.ControlProto.internal_static_google_api_Control_fieldAccessorTable .ensureFieldAccessorsInitialized( @@ -308,15 +408,22 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { // Construct using com.google.api.Control.newBuilder() private Builder() {} - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { super(parent); } @java.lang.Override public Builder clear() { super.clear(); + bitField0_ = 0; environment_ = ""; - + if (methodPoliciesBuilder_ == null) { + methodPolicies_ = java.util.Collections.emptyList(); + } else { + methodPolicies_ = null; + methodPoliciesBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000002); return this; } @@ -342,42 +449,31 @@ public com.google.api.Control build() { @java.lang.Override public com.google.api.Control buildPartial() { com.google.api.Control result = new com.google.api.Control(this); - result.environment_ = environment_; + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } 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); + private void buildPartialRepeatedFields(com.google.api.Control result) { + if (methodPoliciesBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0)) { + methodPolicies_ = java.util.Collections.unmodifiableList(methodPolicies_); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.methodPolicies_ = methodPolicies_; + } else { + result.methodPolicies_ = methodPoliciesBuilder_.build(); + } } - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.addRepeatedField(field, value); + private void buildPartial0(com.google.api.Control result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.environment_ = environment_; + } } @java.lang.Override @@ -394,8 +490,36 @@ public Builder mergeFrom(com.google.api.Control other) { if (other == com.google.api.Control.getDefaultInstance()) return this; if (!other.getEnvironment().isEmpty()) { environment_ = other.environment_; + bitField0_ |= 0x00000001; onChanged(); } + if (methodPoliciesBuilder_ == null) { + if (!other.methodPolicies_.isEmpty()) { + if (methodPolicies_.isEmpty()) { + methodPolicies_ = other.methodPolicies_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureMethodPoliciesIsMutable(); + methodPolicies_.addAll(other.methodPolicies_); + } + onChanged(); + } + } else { + if (!other.methodPolicies_.isEmpty()) { + if (methodPoliciesBuilder_.isEmpty()) { + methodPoliciesBuilder_.dispose(); + methodPoliciesBuilder_ = null; + methodPolicies_ = other.methodPolicies_; + bitField0_ = (bitField0_ & ~0x00000002); + methodPoliciesBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders + ? internalGetMethodPoliciesFieldBuilder() + : null; + } else { + methodPoliciesBuilder_.addAllMessages(other.methodPolicies_); + } + } + } this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; @@ -425,9 +549,21 @@ public Builder mergeFrom( case 10: { environment_ = input.readStringRequireUtf8(); - + bitField0_ |= 0x00000001; break; } // case 10 + case 34: + { + com.google.api.MethodPolicy m = + input.readMessage(com.google.api.MethodPolicy.parser(), extensionRegistry); + if (methodPoliciesBuilder_ == null) { + ensureMethodPoliciesIsMutable(); + methodPolicies_.add(m); + } else { + methodPoliciesBuilder_.addMessage(m); + } + break; + } // case 34 default: { if (!super.parseUnknownField(input, extensionRegistry, tag)) { @@ -445,7 +581,10 @@ public Builder mergeFrom( return this; } + private int bitField0_; + private java.lang.Object environment_ = ""; + /** * * @@ -470,6 +609,7 @@ public java.lang.String getEnvironment() { return (java.lang.String) ref; } } + /** * * @@ -494,6 +634,7 @@ public com.google.protobuf.ByteString getEnvironmentBytes() { return (com.google.protobuf.ByteString) ref; } } + /** * * @@ -512,11 +653,12 @@ public Builder setEnvironment(java.lang.String value) { if (value == null) { throw new NullPointerException(); } - environment_ = value; + bitField0_ |= 0x00000001; onChanged(); return this; } + /** * * @@ -531,11 +673,12 @@ public Builder setEnvironment(java.lang.String value) { * @return This builder for chaining. */ public Builder clearEnvironment() { - environment_ = getDefaultInstance().getEnvironment(); + bitField0_ = (bitField0_ & ~0x00000001); onChanged(); return this; } + /** * * @@ -555,21 +698,378 @@ public Builder setEnvironmentBytes(com.google.protobuf.ByteString value) { throw new NullPointerException(); } checkByteStringIsUtf8(value); - environment_ = value; + bitField0_ |= 0x00000001; onChanged(); return this; } - @java.lang.Override - public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); + private java.util.List methodPolicies_ = + java.util.Collections.emptyList(); + + private void ensureMethodPoliciesIsMutable() { + if (!((bitField0_ & 0x00000002) != 0)) { + methodPolicies_ = new java.util.ArrayList(methodPolicies_); + bitField0_ |= 0x00000002; + } } - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); + private com.google.protobuf.RepeatedFieldBuilder< + com.google.api.MethodPolicy, + com.google.api.MethodPolicy.Builder, + com.google.api.MethodPolicyOrBuilder> + methodPoliciesBuilder_; + + /** + * + * + *
        +     * Defines policies applying to the API methods of the service.
        +     * 
        + * + * repeated .google.api.MethodPolicy method_policies = 4; + */ + public java.util.List getMethodPoliciesList() { + if (methodPoliciesBuilder_ == null) { + return java.util.Collections.unmodifiableList(methodPolicies_); + } else { + return methodPoliciesBuilder_.getMessageList(); + } + } + + /** + * + * + *
        +     * Defines policies applying to the API methods of the service.
        +     * 
        + * + * repeated .google.api.MethodPolicy method_policies = 4; + */ + public int getMethodPoliciesCount() { + if (methodPoliciesBuilder_ == null) { + return methodPolicies_.size(); + } else { + return methodPoliciesBuilder_.getCount(); + } + } + + /** + * + * + *
        +     * Defines policies applying to the API methods of the service.
        +     * 
        + * + * repeated .google.api.MethodPolicy method_policies = 4; + */ + public com.google.api.MethodPolicy getMethodPolicies(int index) { + if (methodPoliciesBuilder_ == null) { + return methodPolicies_.get(index); + } else { + return methodPoliciesBuilder_.getMessage(index); + } + } + + /** + * + * + *
        +     * Defines policies applying to the API methods of the service.
        +     * 
        + * + * repeated .google.api.MethodPolicy method_policies = 4; + */ + public Builder setMethodPolicies(int index, com.google.api.MethodPolicy value) { + if (methodPoliciesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureMethodPoliciesIsMutable(); + methodPolicies_.set(index, value); + onChanged(); + } else { + methodPoliciesBuilder_.setMessage(index, value); + } + return this; + } + + /** + * + * + *
        +     * Defines policies applying to the API methods of the service.
        +     * 
        + * + * repeated .google.api.MethodPolicy method_policies = 4; + */ + public Builder setMethodPolicies( + int index, com.google.api.MethodPolicy.Builder builderForValue) { + if (methodPoliciesBuilder_ == null) { + ensureMethodPoliciesIsMutable(); + methodPolicies_.set(index, builderForValue.build()); + onChanged(); + } else { + methodPoliciesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
        +     * Defines policies applying to the API methods of the service.
        +     * 
        + * + * repeated .google.api.MethodPolicy method_policies = 4; + */ + public Builder addMethodPolicies(com.google.api.MethodPolicy value) { + if (methodPoliciesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureMethodPoliciesIsMutable(); + methodPolicies_.add(value); + onChanged(); + } else { + methodPoliciesBuilder_.addMessage(value); + } + return this; + } + + /** + * + * + *
        +     * Defines policies applying to the API methods of the service.
        +     * 
        + * + * repeated .google.api.MethodPolicy method_policies = 4; + */ + public Builder addMethodPolicies(int index, com.google.api.MethodPolicy value) { + if (methodPoliciesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureMethodPoliciesIsMutable(); + methodPolicies_.add(index, value); + onChanged(); + } else { + methodPoliciesBuilder_.addMessage(index, value); + } + return this; + } + + /** + * + * + *
        +     * Defines policies applying to the API methods of the service.
        +     * 
        + * + * repeated .google.api.MethodPolicy method_policies = 4; + */ + public Builder addMethodPolicies(com.google.api.MethodPolicy.Builder builderForValue) { + if (methodPoliciesBuilder_ == null) { + ensureMethodPoliciesIsMutable(); + methodPolicies_.add(builderForValue.build()); + onChanged(); + } else { + methodPoliciesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + + /** + * + * + *
        +     * Defines policies applying to the API methods of the service.
        +     * 
        + * + * repeated .google.api.MethodPolicy method_policies = 4; + */ + public Builder addMethodPolicies( + int index, com.google.api.MethodPolicy.Builder builderForValue) { + if (methodPoliciesBuilder_ == null) { + ensureMethodPoliciesIsMutable(); + methodPolicies_.add(index, builderForValue.build()); + onChanged(); + } else { + methodPoliciesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
        +     * Defines policies applying to the API methods of the service.
        +     * 
        + * + * repeated .google.api.MethodPolicy method_policies = 4; + */ + public Builder addAllMethodPolicies( + java.lang.Iterable values) { + if (methodPoliciesBuilder_ == null) { + ensureMethodPoliciesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, methodPolicies_); + onChanged(); + } else { + methodPoliciesBuilder_.addAllMessages(values); + } + return this; + } + + /** + * + * + *
        +     * Defines policies applying to the API methods of the service.
        +     * 
        + * + * repeated .google.api.MethodPolicy method_policies = 4; + */ + public Builder clearMethodPolicies() { + if (methodPoliciesBuilder_ == null) { + methodPolicies_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + } else { + methodPoliciesBuilder_.clear(); + } + return this; + } + + /** + * + * + *
        +     * Defines policies applying to the API methods of the service.
        +     * 
        + * + * repeated .google.api.MethodPolicy method_policies = 4; + */ + public Builder removeMethodPolicies(int index) { + if (methodPoliciesBuilder_ == null) { + ensureMethodPoliciesIsMutable(); + methodPolicies_.remove(index); + onChanged(); + } else { + methodPoliciesBuilder_.remove(index); + } + return this; + } + + /** + * + * + *
        +     * Defines policies applying to the API methods of the service.
        +     * 
        + * + * repeated .google.api.MethodPolicy method_policies = 4; + */ + public com.google.api.MethodPolicy.Builder getMethodPoliciesBuilder(int index) { + return internalGetMethodPoliciesFieldBuilder().getBuilder(index); + } + + /** + * + * + *
        +     * Defines policies applying to the API methods of the service.
        +     * 
        + * + * repeated .google.api.MethodPolicy method_policies = 4; + */ + public com.google.api.MethodPolicyOrBuilder getMethodPoliciesOrBuilder(int index) { + if (methodPoliciesBuilder_ == null) { + return methodPolicies_.get(index); + } else { + return methodPoliciesBuilder_.getMessageOrBuilder(index); + } + } + + /** + * + * + *
        +     * Defines policies applying to the API methods of the service.
        +     * 
        + * + * repeated .google.api.MethodPolicy method_policies = 4; + */ + public java.util.List + getMethodPoliciesOrBuilderList() { + if (methodPoliciesBuilder_ != null) { + return methodPoliciesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(methodPolicies_); + } + } + + /** + * + * + *
        +     * Defines policies applying to the API methods of the service.
        +     * 
        + * + * repeated .google.api.MethodPolicy method_policies = 4; + */ + public com.google.api.MethodPolicy.Builder addMethodPoliciesBuilder() { + return internalGetMethodPoliciesFieldBuilder() + .addBuilder(com.google.api.MethodPolicy.getDefaultInstance()); + } + + /** + * + * + *
        +     * Defines policies applying to the API methods of the service.
        +     * 
        + * + * repeated .google.api.MethodPolicy method_policies = 4; + */ + public com.google.api.MethodPolicy.Builder addMethodPoliciesBuilder(int index) { + return internalGetMethodPoliciesFieldBuilder() + .addBuilder(index, com.google.api.MethodPolicy.getDefaultInstance()); + } + + /** + * + * + *
        +     * Defines policies applying to the API methods of the service.
        +     * 
        + * + * repeated .google.api.MethodPolicy method_policies = 4; + */ + public java.util.List getMethodPoliciesBuilderList() { + return internalGetMethodPoliciesFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.google.api.MethodPolicy, + com.google.api.MethodPolicy.Builder, + com.google.api.MethodPolicyOrBuilder> + internalGetMethodPoliciesFieldBuilder() { + if (methodPoliciesBuilder_ == null) { + methodPoliciesBuilder_ = + new com.google.protobuf.RepeatedFieldBuilder< + com.google.api.MethodPolicy, + com.google.api.MethodPolicy.Builder, + com.google.api.MethodPolicyOrBuilder>( + methodPolicies_, + ((bitField0_ & 0x00000002) != 0), + getParentForChildren(), + isClean()); + methodPolicies_ = null; + } + return methodPoliciesBuilder_; } // @@protoc_insertion_point(builder_scope:google.api.Control) diff --git a/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/ControlOrBuilder.java b/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/ControlOrBuilder.java index c50ef6031a..c92523c0f8 100644 --- a/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/ControlOrBuilder.java +++ b/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/ControlOrBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,10 +14,13 @@ * limitations under the License. */ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: google/api/control.proto +// Protobuf Java Version: 4.33.2 package com.google.api; +@com.google.protobuf.Generated public interface ControlOrBuilder extends // @@protoc_insertion_point(interface_extends:google.api.Control) @@ -37,6 +40,7 @@ public interface ControlOrBuilder * @return The environment. */ java.lang.String getEnvironment(); + /** * * @@ -51,4 +55,59 @@ public interface ControlOrBuilder * @return The bytes for environment. */ com.google.protobuf.ByteString getEnvironmentBytes(); + + /** + * + * + *
        +   * Defines policies applying to the API methods of the service.
        +   * 
        + * + * repeated .google.api.MethodPolicy method_policies = 4; + */ + java.util.List getMethodPoliciesList(); + + /** + * + * + *
        +   * Defines policies applying to the API methods of the service.
        +   * 
        + * + * repeated .google.api.MethodPolicy method_policies = 4; + */ + com.google.api.MethodPolicy getMethodPolicies(int index); + + /** + * + * + *
        +   * Defines policies applying to the API methods of the service.
        +   * 
        + * + * repeated .google.api.MethodPolicy method_policies = 4; + */ + int getMethodPoliciesCount(); + + /** + * + * + *
        +   * Defines policies applying to the API methods of the service.
        +   * 
        + * + * repeated .google.api.MethodPolicy method_policies = 4; + */ + java.util.List getMethodPoliciesOrBuilderList(); + + /** + * + * + *
        +   * Defines policies applying to the API methods of the service.
        +   * 
        + * + * repeated .google.api.MethodPolicy method_policies = 4; + */ + com.google.api.MethodPolicyOrBuilder getMethodPoliciesOrBuilder(int index); } diff --git a/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/ControlProto.java b/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/ControlProto.java index f315b5ddd4..9b821b3a92 100644 --- a/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/ControlProto.java +++ b/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/ControlProto.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,13 +14,26 @@ * limitations under the License. */ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: google/api/control.proto +// Protobuf Java Version: 4.33.2 package com.google.api; -public final class ControlProto { +@com.google.protobuf.Generated +public final class ControlProto extends com.google.protobuf.GeneratedFile { private ControlProto() {} + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "ControlProto"); + } + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistryLite registry) {} public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry registry) { @@ -29,7 +42,7 @@ public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry r static final com.google.protobuf.Descriptors.Descriptor internal_static_google_api_Control_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable internal_static_google_api_Control_fieldAccessorTable; public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { @@ -40,22 +53,29 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { static { java.lang.String[] descriptorData = { - "\n\030google/api/control.proto\022\ngoogle.api\"\036" - + "\n\007Control\022\023\n\013environment\030\001 \001(\tBn\n\016com.go" - + "ogle.apiB\014ControlProtoP\001ZEgoogle.golang." - + "org/genproto/googleapis/api/serviceconfi" - + "g;serviceconfig\242\002\004GAPIb\006proto3" + "\n\030google/api/control.proto\022\ngoogle.api\032\027" + + "google/api/policy.proto\"Q\n\007Control\022\023\n\013en" + + "vironment\030\001 \001(\t\0221\n\017method_policies\030\004 \003(\013" + + "2\030.google.api.MethodPolicyBn\n\016com.google" + + ".apiB\014ControlProtoP\001ZEgoogle.golang.org/" + + "genproto/googleapis/api/serviceconfig;se" + + "rviceconfig\242\002\004GAPIb\006proto3" }; descriptor = com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( - descriptorData, new com.google.protobuf.Descriptors.FileDescriptor[] {}); - internal_static_google_api_Control_descriptor = getDescriptor().getMessageTypes().get(0); + descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + com.google.api.PolicyProto.getDescriptor(), + }); + internal_static_google_api_Control_descriptor = getDescriptor().getMessageType(0); internal_static_google_api_Control_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_google_api_Control_descriptor, new java.lang.String[] { - "Environment", + "Environment", "MethodPolicies", }); + descriptor.resolveAllFeaturesImmutable(); + com.google.api.PolicyProto.getDescriptor(); } // @@protoc_insertion_point(outer_class_scope) diff --git a/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/CppSettings.java b/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/CppSettings.java index f61d3da31c..3ec914f991 100644 --- a/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/CppSettings.java +++ b/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/CppSettings.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,9 @@ * limitations under the License. */ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: google/api/client.proto +// Protobuf Java Version: 4.33.2 package com.google.api; @@ -27,43 +29,46 @@ * * Protobuf type {@code google.api.CppSettings} */ -public final class CppSettings extends com.google.protobuf.GeneratedMessageV3 +@com.google.protobuf.Generated +public final class CppSettings extends com.google.protobuf.GeneratedMessage implements // @@protoc_insertion_point(message_implements:google.api.CppSettings) CppSettingsOrBuilder { private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "CppSettings"); + } + // Use CppSettings.newBuilder() to construct. - private CppSettings(com.google.protobuf.GeneratedMessageV3.Builder builder) { + private CppSettings(com.google.protobuf.GeneratedMessage.Builder builder) { super(builder); } private CppSettings() {} - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new CppSettings(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.api.ClientProto.internal_static_google_api_CppSettings_descriptor; } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.api.ClientProto.internal_static_google_api_CppSettings_fieldAccessorTable .ensureFieldAccessorsInitialized( com.google.api.CppSettings.class, com.google.api.CppSettings.Builder.class); } + private int bitField0_; public static final int COMMON_FIELD_NUMBER = 1; private com.google.api.CommonLanguageSettings common_; + /** * * @@ -77,8 +82,9 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { */ @java.lang.Override public boolean hasCommon() { - return common_ != null; + return ((bitField0_ & 0x00000001) != 0); } + /** * * @@ -94,6 +100,7 @@ public boolean hasCommon() { public com.google.api.CommonLanguageSettings getCommon() { return common_ == null ? com.google.api.CommonLanguageSettings.getDefaultInstance() : common_; } + /** * * @@ -105,7 +112,7 @@ public com.google.api.CommonLanguageSettings getCommon() { */ @java.lang.Override public com.google.api.CommonLanguageSettingsOrBuilder getCommonOrBuilder() { - return getCommon(); + return common_ == null ? com.google.api.CommonLanguageSettings.getDefaultInstance() : common_; } private byte memoizedIsInitialized = -1; @@ -122,7 +129,7 @@ public final boolean isInitialized() { @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (common_ != null) { + if (((bitField0_ & 0x00000001) != 0)) { output.writeMessage(1, getCommon()); } getUnknownFields().writeTo(output); @@ -134,7 +141,7 @@ public int getSerializedSize() { if (size != -1) return size; size = 0; - if (common_ != null) { + if (((bitField0_ & 0x00000001) != 0)) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getCommon()); } size += getUnknownFields().getSerializedSize(); @@ -212,38 +219,38 @@ public static com.google.api.CppSettings parseFrom( public static com.google.api.CppSettings parseFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); } public static com.google.api.CppSettings parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } public static com.google.api.CppSettings parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); } public static com.google.api.CppSettings parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( PARSER, input, extensionRegistry); } public static com.google.api.CppSettings parseFrom(com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); } public static com.google.api.CppSettings parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } @@ -266,10 +273,11 @@ public Builder toBuilder() { } @java.lang.Override - protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { Builder builder = new Builder(parent); return builder; } + /** * * @@ -279,7 +287,7 @@ protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.Build * * Protobuf type {@code google.api.CppSettings} */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder implements // @@protoc_insertion_point(builder_implements:google.api.CppSettings) com.google.api.CppSettingsOrBuilder { @@ -288,7 +296,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.api.ClientProto.internal_static_google_api_CppSettings_fieldAccessorTable .ensureFieldAccessorsInitialized( @@ -296,19 +304,28 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } // Construct using com.google.api.CppSettings.newBuilder() - private Builder() {} + private Builder() { + maybeForceBuilderInitialization(); + } - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetCommonFieldBuilder(); + } } @java.lang.Override public Builder clear() { super.clear(); - if (commonBuilder_ == null) { - common_ = null; - } else { - common_ = null; + bitField0_ = 0; + common_ = null; + if (commonBuilder_ != null) { + commonBuilder_.dispose(); commonBuilder_ = null; } return this; @@ -336,46 +353,21 @@ public com.google.api.CppSettings build() { @java.lang.Override public com.google.api.CppSettings buildPartial() { com.google.api.CppSettings result = new com.google.api.CppSettings(this); - if (commonBuilder_ == null) { - result.common_ = common_; - } else { - result.common_ = commonBuilder_.build(); + if (bitField0_ != 0) { + buildPartial0(result); } 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); + private void buildPartial0(com.google.api.CppSettings result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.common_ = commonBuilder_ == null ? common_ : commonBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + result.bitField0_ |= to_bitField0_; } @java.lang.Override @@ -421,8 +413,8 @@ public Builder mergeFrom( break; case 10: { - input.readMessage(getCommonFieldBuilder().getBuilder(), extensionRegistry); - + input.readMessage(internalGetCommonFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000001; break; } // case 10 default: @@ -442,12 +434,15 @@ public Builder mergeFrom( return this; } + private int bitField0_; + private com.google.api.CommonLanguageSettings common_; - private com.google.protobuf.SingleFieldBuilderV3< + private com.google.protobuf.SingleFieldBuilder< com.google.api.CommonLanguageSettings, com.google.api.CommonLanguageSettings.Builder, com.google.api.CommonLanguageSettingsOrBuilder> commonBuilder_; + /** * * @@ -460,8 +455,9 @@ public Builder mergeFrom( * @return Whether the common field is set. */ public boolean hasCommon() { - return commonBuilder_ != null || common_ != null; + return ((bitField0_ & 0x00000001) != 0); } + /** * * @@ -482,6 +478,7 @@ public com.google.api.CommonLanguageSettings getCommon() { return commonBuilder_.getMessage(); } } + /** * * @@ -497,13 +494,14 @@ public Builder setCommon(com.google.api.CommonLanguageSettings value) { throw new NullPointerException(); } common_ = value; - onChanged(); } else { commonBuilder_.setMessage(value); } - + bitField0_ |= 0x00000001; + onChanged(); return this; } + /** * * @@ -516,13 +514,14 @@ public Builder setCommon(com.google.api.CommonLanguageSettings value) { public Builder setCommon(com.google.api.CommonLanguageSettings.Builder builderForValue) { if (commonBuilder_ == null) { common_ = builderForValue.build(); - onChanged(); } else { commonBuilder_.setMessage(builderForValue.build()); } - + bitField0_ |= 0x00000001; + onChanged(); return this; } + /** * * @@ -534,21 +533,23 @@ public Builder setCommon(com.google.api.CommonLanguageSettings.Builder builderFo */ public Builder mergeCommon(com.google.api.CommonLanguageSettings value) { if (commonBuilder_ == null) { - if (common_ != null) { - common_ = - com.google.api.CommonLanguageSettings.newBuilder(common_) - .mergeFrom(value) - .buildPartial(); + if (((bitField0_ & 0x00000001) != 0) + && common_ != null + && common_ != com.google.api.CommonLanguageSettings.getDefaultInstance()) { + getCommonBuilder().mergeFrom(value); } else { common_ = value; } - onChanged(); } else { commonBuilder_.mergeFrom(value); } - + if (common_ != null) { + bitField0_ |= 0x00000001; + onChanged(); + } return this; } + /** * * @@ -559,16 +560,16 @@ public Builder mergeCommon(com.google.api.CommonLanguageSettings value) { * .google.api.CommonLanguageSettings common = 1; */ public Builder clearCommon() { - if (commonBuilder_ == null) { - common_ = null; - onChanged(); - } else { - common_ = null; + bitField0_ = (bitField0_ & ~0x00000001); + common_ = null; + if (commonBuilder_ != null) { + commonBuilder_.dispose(); commonBuilder_ = null; } - + onChanged(); return this; } + /** * * @@ -579,10 +580,11 @@ public Builder clearCommon() { * .google.api.CommonLanguageSettings common = 1; */ public com.google.api.CommonLanguageSettings.Builder getCommonBuilder() { - + bitField0_ |= 0x00000001; onChanged(); - return getCommonFieldBuilder().getBuilder(); + return internalGetCommonFieldBuilder().getBuilder(); } + /** * * @@ -601,6 +603,7 @@ public com.google.api.CommonLanguageSettingsOrBuilder getCommonOrBuilder() { : common_; } } + /** * * @@ -610,14 +613,14 @@ public com.google.api.CommonLanguageSettingsOrBuilder getCommonOrBuilder() { * * .google.api.CommonLanguageSettings common = 1; */ - private com.google.protobuf.SingleFieldBuilderV3< + private com.google.protobuf.SingleFieldBuilder< com.google.api.CommonLanguageSettings, com.google.api.CommonLanguageSettings.Builder, com.google.api.CommonLanguageSettingsOrBuilder> - getCommonFieldBuilder() { + internalGetCommonFieldBuilder() { if (commonBuilder_ == null) { commonBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< + new com.google.protobuf.SingleFieldBuilder< com.google.api.CommonLanguageSettings, com.google.api.CommonLanguageSettings.Builder, com.google.api.CommonLanguageSettingsOrBuilder>( @@ -627,17 +630,6 @@ public com.google.api.CommonLanguageSettingsOrBuilder getCommonOrBuilder() { return commonBuilder_; } - @java.lang.Override - public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - // @@protoc_insertion_point(builder_scope:google.api.CppSettings) } diff --git a/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/CppSettingsOrBuilder.java b/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/CppSettingsOrBuilder.java index f10fd5458c..4ead7a6a50 100644 --- a/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/CppSettingsOrBuilder.java +++ b/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/CppSettingsOrBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,10 +14,13 @@ * limitations under the License. */ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: google/api/client.proto +// Protobuf Java Version: 4.33.2 package com.google.api; +@com.google.protobuf.Generated public interface CppSettingsOrBuilder extends // @@protoc_insertion_point(interface_extends:google.api.CppSettings) @@ -35,6 +38,7 @@ public interface CppSettingsOrBuilder * @return Whether the common field is set. */ boolean hasCommon(); + /** * * @@ -47,6 +51,7 @@ public interface CppSettingsOrBuilder * @return The common. */ com.google.api.CommonLanguageSettings getCommon(); + /** * * diff --git a/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/CustomHttpPattern.java b/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/CustomHttpPattern.java index bf35f90802..69be778b68 100644 --- a/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/CustomHttpPattern.java +++ b/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/CustomHttpPattern.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,9 @@ * limitations under the License. */ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: google/api/http.proto +// Protobuf Java Version: 4.33.2 package com.google.api; @@ -27,13 +29,25 @@ * * Protobuf type {@code google.api.CustomHttpPattern} */ -public final class CustomHttpPattern extends com.google.protobuf.GeneratedMessageV3 +@com.google.protobuf.Generated +public final class CustomHttpPattern extends com.google.protobuf.GeneratedMessage implements // @@protoc_insertion_point(message_implements:google.api.CustomHttpPattern) CustomHttpPatternOrBuilder { private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "CustomHttpPattern"); + } + // Use CustomHttpPattern.newBuilder() to construct. - private CustomHttpPattern(com.google.protobuf.GeneratedMessageV3.Builder builder) { + private CustomHttpPattern(com.google.protobuf.GeneratedMessage.Builder builder) { super(builder); } @@ -42,23 +56,12 @@ private CustomHttpPattern() { path_ = ""; } - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new CustomHttpPattern(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.api.HttpProto.internal_static_google_api_CustomHttpPattern_descriptor; } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.api.HttpProto.internal_static_google_api_CustomHttpPattern_fieldAccessorTable .ensureFieldAccessorsInitialized( @@ -66,7 +69,10 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } public static final int KIND_FIELD_NUMBER = 1; - private volatile java.lang.Object kind_; + + @SuppressWarnings("serial") + private volatile java.lang.Object kind_ = ""; + /** * * @@ -90,6 +96,7 @@ public java.lang.String getKind() { return s; } } + /** * * @@ -115,7 +122,10 @@ public com.google.protobuf.ByteString getKindBytes() { } public static final int PATH_FIELD_NUMBER = 2; - private volatile java.lang.Object path_; + + @SuppressWarnings("serial") + private volatile java.lang.Object path_ = ""; + /** * * @@ -139,6 +149,7 @@ public java.lang.String getPath() { return s; } } + /** * * @@ -177,11 +188,11 @@ public final boolean isInitialized() { @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(kind_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, kind_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(kind_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, kind_); } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(path_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 2, path_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(path_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, path_); } getUnknownFields().writeTo(output); } @@ -192,11 +203,11 @@ public int getSerializedSize() { if (size != -1) return size; size = 0; - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(kind_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, kind_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(kind_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, kind_); } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(path_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, path_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(path_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, path_); } size += getUnknownFields().getSerializedSize(); memoizedSize = size; @@ -271,38 +282,38 @@ public static com.google.api.CustomHttpPattern parseFrom( public static com.google.api.CustomHttpPattern parseFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); } public static com.google.api.CustomHttpPattern parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } public static com.google.api.CustomHttpPattern parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); } public static com.google.api.CustomHttpPattern parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( PARSER, input, extensionRegistry); } public static com.google.api.CustomHttpPattern parseFrom( com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); } public static com.google.api.CustomHttpPattern parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } @@ -325,10 +336,11 @@ public Builder toBuilder() { } @java.lang.Override - protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { Builder builder = new Builder(parent); return builder; } + /** * * @@ -338,7 +350,7 @@ protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.Build * * Protobuf type {@code google.api.CustomHttpPattern} */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder implements // @@protoc_insertion_point(builder_implements:google.api.CustomHttpPattern) com.google.api.CustomHttpPatternOrBuilder { @@ -347,7 +359,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.api.HttpProto .internal_static_google_api_CustomHttpPattern_fieldAccessorTable @@ -359,17 +371,16 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { // Construct using com.google.api.CustomHttpPattern.newBuilder() private Builder() {} - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { super(parent); } @java.lang.Override public Builder clear() { super.clear(); + bitField0_ = 0; kind_ = ""; - path_ = ""; - return this; } @@ -395,43 +406,21 @@ public com.google.api.CustomHttpPattern build() { @java.lang.Override public com.google.api.CustomHttpPattern buildPartial() { com.google.api.CustomHttpPattern result = new com.google.api.CustomHttpPattern(this); - result.kind_ = kind_; - result.path_ = path_; + if (bitField0_ != 0) { + buildPartial0(result); + } 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); + private void buildPartial0(com.google.api.CustomHttpPattern result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.kind_ = kind_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.path_ = path_; + } } @java.lang.Override @@ -448,10 +437,12 @@ public Builder mergeFrom(com.google.api.CustomHttpPattern other) { if (other == com.google.api.CustomHttpPattern.getDefaultInstance()) return this; if (!other.getKind().isEmpty()) { kind_ = other.kind_; + bitField0_ |= 0x00000001; onChanged(); } if (!other.getPath().isEmpty()) { path_ = other.path_; + bitField0_ |= 0x00000002; onChanged(); } this.mergeUnknownFields(other.getUnknownFields()); @@ -483,13 +474,13 @@ public Builder mergeFrom( case 10: { kind_ = input.readStringRequireUtf8(); - + bitField0_ |= 0x00000001; break; } // case 10 case 18: { path_ = input.readStringRequireUtf8(); - + bitField0_ |= 0x00000002; break; } // case 18 default: @@ -509,7 +500,10 @@ public Builder mergeFrom( return this; } + private int bitField0_; + private java.lang.Object kind_ = ""; + /** * * @@ -532,6 +526,7 @@ public java.lang.String getKind() { return (java.lang.String) ref; } } + /** * * @@ -554,6 +549,7 @@ public com.google.protobuf.ByteString getKindBytes() { return (com.google.protobuf.ByteString) ref; } } + /** * * @@ -570,11 +566,12 @@ public Builder setKind(java.lang.String value) { if (value == null) { throw new NullPointerException(); } - kind_ = value; + bitField0_ |= 0x00000001; onChanged(); return this; } + /** * * @@ -587,11 +584,12 @@ public Builder setKind(java.lang.String value) { * @return This builder for chaining. */ public Builder clearKind() { - kind_ = getDefaultInstance().getKind(); + bitField0_ = (bitField0_ & ~0x00000001); onChanged(); return this; } + /** * * @@ -609,13 +607,14 @@ public Builder setKindBytes(com.google.protobuf.ByteString value) { throw new NullPointerException(); } checkByteStringIsUtf8(value); - kind_ = value; + bitField0_ |= 0x00000001; onChanged(); return this; } private java.lang.Object path_ = ""; + /** * * @@ -638,6 +637,7 @@ public java.lang.String getPath() { return (java.lang.String) ref; } } + /** * * @@ -660,6 +660,7 @@ public com.google.protobuf.ByteString getPathBytes() { return (com.google.protobuf.ByteString) ref; } } + /** * * @@ -676,11 +677,12 @@ public Builder setPath(java.lang.String value) { if (value == null) { throw new NullPointerException(); } - path_ = value; + bitField0_ |= 0x00000002; onChanged(); return this; } + /** * * @@ -693,11 +695,12 @@ public Builder setPath(java.lang.String value) { * @return This builder for chaining. */ public Builder clearPath() { - path_ = getDefaultInstance().getPath(); + bitField0_ = (bitField0_ & ~0x00000002); onChanged(); return this; } + /** * * @@ -715,23 +718,12 @@ public Builder setPathBytes(com.google.protobuf.ByteString value) { throw new NullPointerException(); } checkByteStringIsUtf8(value); - path_ = 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.api.CustomHttpPattern) } diff --git a/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/CustomHttpPatternOrBuilder.java b/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/CustomHttpPatternOrBuilder.java index e33130b009..6b7a132337 100644 --- a/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/CustomHttpPatternOrBuilder.java +++ b/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/CustomHttpPatternOrBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,10 +14,13 @@ * limitations under the License. */ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: google/api/http.proto +// Protobuf Java Version: 4.33.2 package com.google.api; +@com.google.protobuf.Generated public interface CustomHttpPatternOrBuilder extends // @@protoc_insertion_point(interface_extends:google.api.CustomHttpPattern) @@ -35,6 +38,7 @@ public interface CustomHttpPatternOrBuilder * @return The kind. */ java.lang.String getKind(); + /** * * @@ -60,6 +64,7 @@ public interface CustomHttpPatternOrBuilder * @return The path. */ java.lang.String getPath(); + /** * * diff --git a/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/Distribution.java b/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/Distribution.java index 09e41c71d3..cae5b974f8 100644 --- a/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/Distribution.java +++ b/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/Distribution.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,9 @@ * limitations under the License. */ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: google/api/distribution.proto +// Protobuf Java Version: 4.33.2 package com.google.api; @@ -25,12 +27,14 @@ * `Distribution` contains summary statistics for a population of values. It * optionally contains a histogram representing the distribution of those values * across a set of buckets. + * * The summary statistics are the count, mean, sum of the squared deviation from * the mean, the minimum, and the maximum of the set of population of values. * The histogram is based on a sequence of buckets and gives a count of values * that fall into each bucket. The boundaries of the buckets are given either * explicitly or by formulas for buckets of fixed or exponentially increasing * widths. + * * Although it is not forbidden, it is generally a bad idea to include * non-finite values (infinities or NaNs) in the population of values, as this * will render the `mean` and `sum_of_squared_deviation` fields meaningless. @@ -38,13 +42,25 @@ * * Protobuf type {@code google.api.Distribution} */ -public final class Distribution extends com.google.protobuf.GeneratedMessageV3 +@com.google.protobuf.Generated +public final class Distribution extends com.google.protobuf.GeneratedMessage implements // @@protoc_insertion_point(message_implements:google.api.Distribution) DistributionOrBuilder { private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "Distribution"); + } + // Use Distribution.newBuilder() to construct. - private Distribution(com.google.protobuf.GeneratedMessageV3.Builder builder) { + private Distribution(com.google.protobuf.GeneratedMessage.Builder builder) { super(builder); } @@ -53,23 +69,12 @@ private Distribution() { exemplars_ = java.util.Collections.emptyList(); } - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new Distribution(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.api.DistributionProto.internal_static_google_api_Distribution_descriptor; } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.api.DistributionProto .internal_static_google_api_Distribution_fieldAccessorTable @@ -108,6 +113,7 @@ public interface RangeOrBuilder */ double getMax(); } + /** * * @@ -117,36 +123,36 @@ public interface RangeOrBuilder * * Protobuf type {@code google.api.Distribution.Range} */ - public static final class Range extends com.google.protobuf.GeneratedMessageV3 + public static final class Range extends com.google.protobuf.GeneratedMessage implements // @@protoc_insertion_point(message_implements:google.api.Distribution.Range) RangeOrBuilder { private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "Range"); + } + // Use Range.newBuilder() to construct. - private Range(com.google.protobuf.GeneratedMessageV3.Builder builder) { + private Range(com.google.protobuf.GeneratedMessage.Builder builder) { super(builder); } private Range() {} - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new Range(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.api.DistributionProto .internal_static_google_api_Distribution_Range_descriptor; } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.api.DistributionProto .internal_static_google_api_Distribution_Range_fieldAccessorTable @@ -156,7 +162,8 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } public static final int MIN_FIELD_NUMBER = 1; - private double min_; + private double min_ = 0D; + /** * * @@ -174,7 +181,8 @@ public double getMin() { } public static final int MAX_FIELD_NUMBER = 2; - private double max_; + private double max_ = 0D; + /** * * @@ -305,38 +313,38 @@ public static com.google.api.Distribution.Range parseFrom( public static com.google.api.Distribution.Range parseFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); } public static com.google.api.Distribution.Range parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } public static com.google.api.Distribution.Range parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); } public static com.google.api.Distribution.Range parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( PARSER, input, extensionRegistry); } public static com.google.api.Distribution.Range parseFrom( com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); } public static com.google.api.Distribution.Range parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } @@ -359,11 +367,11 @@ public Builder toBuilder() { } @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { Builder builder = new Builder(parent); return builder; } + /** * * @@ -373,8 +381,7 @@ protected Builder newBuilderForType( * * Protobuf type {@code google.api.Distribution.Range} */ - public static final class Builder - extends com.google.protobuf.GeneratedMessageV3.Builder + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder implements // @@protoc_insertion_point(builder_implements:google.api.Distribution.Range) com.google.api.Distribution.RangeOrBuilder { @@ -384,7 +391,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.api.DistributionProto .internal_static_google_api_Distribution_Range_fieldAccessorTable @@ -396,17 +403,16 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { // Construct using com.google.api.Distribution.Range.newBuilder() private Builder() {} - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { super(parent); } @java.lang.Override public Builder clear() { super.clear(); + bitField0_ = 0; min_ = 0D; - max_ = 0D; - return this; } @@ -433,45 +439,21 @@ public com.google.api.Distribution.Range build() { @java.lang.Override public com.google.api.Distribution.Range buildPartial() { com.google.api.Distribution.Range result = new com.google.api.Distribution.Range(this); - result.min_ = min_; - result.max_ = max_; + if (bitField0_ != 0) { + buildPartial0(result); + } 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); + private void buildPartial0(com.google.api.Distribution.Range result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.min_ = min_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.max_ = max_; + } } @java.lang.Override @@ -486,10 +468,10 @@ public Builder mergeFrom(com.google.protobuf.Message other) { public Builder mergeFrom(com.google.api.Distribution.Range other) { if (other == com.google.api.Distribution.Range.getDefaultInstance()) return this; - if (other.getMin() != 0D) { + if (java.lang.Double.doubleToRawLongBits(other.getMin()) != 0) { setMin(other.getMin()); } - if (other.getMax() != 0D) { + if (java.lang.Double.doubleToRawLongBits(other.getMax()) != 0) { setMax(other.getMax()); } this.mergeUnknownFields(other.getUnknownFields()); @@ -521,13 +503,13 @@ public Builder mergeFrom( case 9: { min_ = input.readDouble(); - + bitField0_ |= 0x00000001; break; } // case 9 case 17: { max_ = input.readDouble(); - + bitField0_ |= 0x00000002; break; } // case 17 default: @@ -547,7 +529,10 @@ public Builder mergeFrom( return this; } + private int bitField0_; + private double min_; + /** * * @@ -563,6 +548,7 @@ public Builder mergeFrom( public double getMin() { return min_; } + /** * * @@ -578,9 +564,11 @@ public double getMin() { public Builder setMin(double value) { min_ = value; + bitField0_ |= 0x00000001; onChanged(); return this; } + /** * * @@ -593,13 +581,14 @@ public Builder setMin(double value) { * @return This builder for chaining. */ public Builder clearMin() { - + bitField0_ = (bitField0_ & ~0x00000001); min_ = 0D; onChanged(); return this; } private double max_; + /** * * @@ -615,6 +604,7 @@ public Builder clearMin() { public double getMax() { return max_; } + /** * * @@ -630,9 +620,11 @@ public double getMax() { public Builder setMax(double value) { max_ = value; + bitField0_ |= 0x00000002; onChanged(); return this; } + /** * * @@ -645,24 +637,12 @@ public Builder setMax(double value) { * @return This builder for chaining. */ public Builder clearMax() { - + bitField0_ = (bitField0_ & ~0x00000002); max_ = 0D; onChanged(); return this; } - @java.lang.Override - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - // @@protoc_insertion_point(builder_scope:google.api.Distribution.Range) } @@ -732,6 +712,7 @@ public interface BucketOptionsOrBuilder * @return Whether the linearBuckets field is set. */ boolean hasLinearBuckets(); + /** * * @@ -744,6 +725,7 @@ public interface BucketOptionsOrBuilder * @return The linearBuckets. */ com.google.api.Distribution.BucketOptions.Linear getLinearBuckets(); + /** * * @@ -767,6 +749,7 @@ public interface BucketOptionsOrBuilder * @return Whether the exponentialBuckets field is set. */ boolean hasExponentialBuckets(); + /** * * @@ -779,6 +762,7 @@ public interface BucketOptionsOrBuilder * @return The exponentialBuckets. */ com.google.api.Distribution.BucketOptions.Exponential getExponentialBuckets(); + /** * * @@ -802,6 +786,7 @@ public interface BucketOptionsOrBuilder * @return Whether the explicitBuckets field is set. */ boolean hasExplicitBuckets(); + /** * * @@ -814,6 +799,7 @@ public interface BucketOptionsOrBuilder * @return The explicitBuckets. */ com.google.api.Distribution.BucketOptions.Explicit getExplicitBuckets(); + /** * * @@ -825,8 +811,9 @@ public interface BucketOptionsOrBuilder */ com.google.api.Distribution.BucketOptions.ExplicitOrBuilder getExplicitBucketsOrBuilder(); - public com.google.api.Distribution.BucketOptions.OptionsCase getOptionsCase(); + com.google.api.Distribution.BucketOptions.OptionsCase getOptionsCase(); } + /** * * @@ -835,6 +822,7 @@ public interface BucketOptionsOrBuilder * for the distribution. The buckets can be in a linear sequence, an * exponential sequence, or each bucket can be specified explicitly. * `BucketOptions` does not include the number of values in each bucket. + * * A bucket has an inclusive lower bound and exclusive upper bound for the * values that are counted for that bucket. The upper bound of a bucket must * be strictly greater than the lower bound. The sequence of N buckets for a @@ -849,36 +837,36 @@ public interface BucketOptionsOrBuilder * * Protobuf type {@code google.api.Distribution.BucketOptions} */ - public static final class BucketOptions extends com.google.protobuf.GeneratedMessageV3 + public static final class BucketOptions extends com.google.protobuf.GeneratedMessage implements // @@protoc_insertion_point(message_implements:google.api.Distribution.BucketOptions) BucketOptionsOrBuilder { private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "BucketOptions"); + } + // Use BucketOptions.newBuilder() to construct. - private BucketOptions(com.google.protobuf.GeneratedMessageV3.Builder builder) { + private BucketOptions(com.google.protobuf.GeneratedMessage.Builder builder) { super(builder); } private BucketOptions() {} - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new BucketOptions(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.api.DistributionProto .internal_static_google_api_Distribution_BucketOptions_descriptor; } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.api.DistributionProto .internal_static_google_api_Distribution_BucketOptions_fieldAccessorTable @@ -931,6 +919,7 @@ public interface LinearOrBuilder */ double getOffset(); } + /** * * @@ -938,44 +927,47 @@ public interface LinearOrBuilder * Specifies a linear sequence of buckets that all have the same width * (except overflow and underflow). Each bucket represents a constant * absolute uncertainty on the specific value in the bucket. + * * There are `num_finite_buckets + 2` (= N) buckets. Bucket `i` has the * following boundaries: - * Upper bound (0 <= i < N-1): offset + (width * i). - * Lower bound (1 <= i < N): offset + (width * (i - 1)). + * + * Upper bound (0 <= i < N-1): offset + (width * i). + * + * Lower bound (1 <= i < N): offset + (width * (i - 1)). * * * Protobuf type {@code google.api.Distribution.BucketOptions.Linear} */ - public static final class Linear extends com.google.protobuf.GeneratedMessageV3 + public static final class Linear extends com.google.protobuf.GeneratedMessage implements // @@protoc_insertion_point(message_implements:google.api.Distribution.BucketOptions.Linear) LinearOrBuilder { private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "Linear"); + } + // Use Linear.newBuilder() to construct. - private Linear(com.google.protobuf.GeneratedMessageV3.Builder builder) { + private Linear(com.google.protobuf.GeneratedMessage.Builder builder) { super(builder); } private Linear() {} - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new Linear(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.api.DistributionProto .internal_static_google_api_Distribution_BucketOptions_Linear_descriptor; } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.api.DistributionProto .internal_static_google_api_Distribution_BucketOptions_Linear_fieldAccessorTable @@ -985,7 +977,8 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } public static final int NUM_FINITE_BUCKETS_FIELD_NUMBER = 1; - private int numFiniteBuckets_; + private int numFiniteBuckets_ = 0; + /** * * @@ -1003,7 +996,8 @@ public int getNumFiniteBuckets() { } public static final int WIDTH_FIELD_NUMBER = 2; - private double width_; + private double width_ = 0D; + /** * * @@ -1021,7 +1015,8 @@ public double getWidth() { } public static final int OFFSET_FIELD_NUMBER = 3; - private double offset_; + private double offset_ = 0D; + /** * * @@ -1165,38 +1160,38 @@ public static com.google.api.Distribution.BucketOptions.Linear parseFrom( public static com.google.api.Distribution.BucketOptions.Linear parseFrom( java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); } public static com.google.api.Distribution.BucketOptions.Linear parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } public static com.google.api.Distribution.BucketOptions.Linear parseDelimitedFrom( java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); } public static com.google.api.Distribution.BucketOptions.Linear parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( PARSER, input, extensionRegistry); } public static com.google.api.Distribution.BucketOptions.Linear parseFrom( com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); } public static com.google.api.Distribution.BucketOptions.Linear parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } @@ -1220,10 +1215,11 @@ public Builder toBuilder() { @java.lang.Override protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + com.google.protobuf.GeneratedMessage.BuilderParent parent) { Builder builder = new Builder(parent); return builder; } + /** * * @@ -1231,16 +1227,19 @@ protected Builder newBuilderForType( * Specifies a linear sequence of buckets that all have the same width * (except overflow and underflow). Each bucket represents a constant * absolute uncertainty on the specific value in the bucket. + * * There are `num_finite_buckets + 2` (= N) buckets. Bucket `i` has the * following boundaries: - * Upper bound (0 <= i < N-1): offset + (width * i). - * Lower bound (1 <= i < N): offset + (width * (i - 1)). + * + * Upper bound (0 <= i < N-1): offset + (width * i). + * + * Lower bound (1 <= i < N): offset + (width * (i - 1)). * * * Protobuf type {@code google.api.Distribution.BucketOptions.Linear} */ public static final class Builder - extends com.google.protobuf.GeneratedMessageV3.Builder + extends com.google.protobuf.GeneratedMessage.Builder implements // @@protoc_insertion_point(builder_implements:google.api.Distribution.BucketOptions.Linear) com.google.api.Distribution.BucketOptions.LinearOrBuilder { @@ -1250,7 +1249,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.api.DistributionProto .internal_static_google_api_Distribution_BucketOptions_Linear_fieldAccessorTable @@ -1262,19 +1261,17 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { // Construct using com.google.api.Distribution.BucketOptions.Linear.newBuilder() private Builder() {} - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { super(parent); } @java.lang.Override public Builder clear() { super.clear(); + bitField0_ = 0; numFiniteBuckets_ = 0; - width_ = 0D; - offset_ = 0D; - return this; } @@ -1302,46 +1299,24 @@ public com.google.api.Distribution.BucketOptions.Linear build() { public com.google.api.Distribution.BucketOptions.Linear buildPartial() { com.google.api.Distribution.BucketOptions.Linear result = new com.google.api.Distribution.BucketOptions.Linear(this); - result.numFiniteBuckets_ = numFiniteBuckets_; - result.width_ = width_; - result.offset_ = offset_; + if (bitField0_ != 0) { + buildPartial0(result); + } 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); + private void buildPartial0(com.google.api.Distribution.BucketOptions.Linear result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.numFiniteBuckets_ = numFiniteBuckets_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.width_ = width_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.offset_ = offset_; + } } @java.lang.Override @@ -1360,10 +1335,10 @@ public Builder mergeFrom(com.google.api.Distribution.BucketOptions.Linear other) if (other.getNumFiniteBuckets() != 0) { setNumFiniteBuckets(other.getNumFiniteBuckets()); } - if (other.getWidth() != 0D) { + if (java.lang.Double.doubleToRawLongBits(other.getWidth()) != 0) { setWidth(other.getWidth()); } - if (other.getOffset() != 0D) { + if (java.lang.Double.doubleToRawLongBits(other.getOffset()) != 0) { setOffset(other.getOffset()); } this.mergeUnknownFields(other.getUnknownFields()); @@ -1395,19 +1370,19 @@ public Builder mergeFrom( case 8: { numFiniteBuckets_ = input.readInt32(); - + bitField0_ |= 0x00000001; break; } // case 8 case 17: { width_ = input.readDouble(); - + bitField0_ |= 0x00000002; break; } // case 17 case 25: { offset_ = input.readDouble(); - + bitField0_ |= 0x00000004; break; } // case 25 default: @@ -1427,7 +1402,10 @@ public Builder mergeFrom( return this; } + private int bitField0_; + private int numFiniteBuckets_; + /** * * @@ -1443,6 +1421,7 @@ public Builder mergeFrom( public int getNumFiniteBuckets() { return numFiniteBuckets_; } + /** * * @@ -1458,9 +1437,11 @@ public int getNumFiniteBuckets() { public Builder setNumFiniteBuckets(int value) { numFiniteBuckets_ = value; + bitField0_ |= 0x00000001; onChanged(); return this; } + /** * * @@ -1473,13 +1454,14 @@ public Builder setNumFiniteBuckets(int value) { * @return This builder for chaining. */ public Builder clearNumFiniteBuckets() { - + bitField0_ = (bitField0_ & ~0x00000001); numFiniteBuckets_ = 0; onChanged(); return this; } private double width_; + /** * * @@ -1495,6 +1477,7 @@ public Builder clearNumFiniteBuckets() { public double getWidth() { return width_; } + /** * * @@ -1510,9 +1493,11 @@ public double getWidth() { public Builder setWidth(double value) { width_ = value; + bitField0_ |= 0x00000002; onChanged(); return this; } + /** * * @@ -1525,13 +1510,14 @@ public Builder setWidth(double value) { * @return This builder for chaining. */ public Builder clearWidth() { - + bitField0_ = (bitField0_ & ~0x00000002); width_ = 0D; onChanged(); return this; } private double offset_; + /** * * @@ -1547,6 +1533,7 @@ public Builder clearWidth() { public double getOffset() { return offset_; } + /** * * @@ -1562,9 +1549,11 @@ public double getOffset() { public Builder setOffset(double value) { offset_ = value; + bitField0_ |= 0x00000004; onChanged(); return this; } + /** * * @@ -1577,24 +1566,12 @@ public Builder setOffset(double value) { * @return This builder for chaining. */ public Builder clearOffset() { - + bitField0_ = (bitField0_ & ~0x00000004); offset_ = 0D; onChanged(); return this; } - @java.lang.Override - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - // @@protoc_insertion_point(builder_scope:google.api.Distribution.BucketOptions.Linear) } @@ -1691,6 +1668,7 @@ public interface ExponentialOrBuilder */ double getScale(); } + /** * * @@ -1698,44 +1676,47 @@ public interface ExponentialOrBuilder * Specifies an exponential sequence of buckets that have a width that is * proportional to the value of the lower bound. Each bucket represents a * constant relative uncertainty on a specific value in the bucket. + * * There are `num_finite_buckets + 2` (= N) buckets. Bucket `i` has the * following boundaries: - * Upper bound (0 <= i < N-1): scale * (growth_factor ^ i). - * Lower bound (1 <= i < N): scale * (growth_factor ^ (i - 1)). + * + * Upper bound (0 <= i < N-1): scale * (growth_factor ^ i). + * + * Lower bound (1 <= i < N): scale * (growth_factor ^ (i - 1)). * * * Protobuf type {@code google.api.Distribution.BucketOptions.Exponential} */ - public static final class Exponential extends com.google.protobuf.GeneratedMessageV3 + public static final class Exponential extends com.google.protobuf.GeneratedMessage implements // @@protoc_insertion_point(message_implements:google.api.Distribution.BucketOptions.Exponential) ExponentialOrBuilder { private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "Exponential"); + } + // Use Exponential.newBuilder() to construct. - private Exponential(com.google.protobuf.GeneratedMessageV3.Builder builder) { + private Exponential(com.google.protobuf.GeneratedMessage.Builder builder) { super(builder); } private Exponential() {} - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new Exponential(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.api.DistributionProto .internal_static_google_api_Distribution_BucketOptions_Exponential_descriptor; } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.api.DistributionProto .internal_static_google_api_Distribution_BucketOptions_Exponential_fieldAccessorTable @@ -1745,7 +1726,8 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } public static final int NUM_FINITE_BUCKETS_FIELD_NUMBER = 1; - private int numFiniteBuckets_; + private int numFiniteBuckets_ = 0; + /** * * @@ -1763,7 +1745,8 @@ public int getNumFiniteBuckets() { } public static final int GROWTH_FACTOR_FIELD_NUMBER = 2; - private double growthFactor_; + private double growthFactor_ = 0D; + /** * * @@ -1781,7 +1764,8 @@ public double getGrowthFactor() { } public static final int SCALE_FIELD_NUMBER = 3; - private double scale_; + private double scale_ = 0D; + /** * * @@ -1925,38 +1909,38 @@ public static com.google.api.Distribution.BucketOptions.Exponential parseFrom( public static com.google.api.Distribution.BucketOptions.Exponential parseFrom( java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); } public static com.google.api.Distribution.BucketOptions.Exponential parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } public static com.google.api.Distribution.BucketOptions.Exponential parseDelimitedFrom( java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); } public static com.google.api.Distribution.BucketOptions.Exponential parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( PARSER, input, extensionRegistry); } public static com.google.api.Distribution.BucketOptions.Exponential parseFrom( com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); } public static com.google.api.Distribution.BucketOptions.Exponential parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } @@ -1981,10 +1965,11 @@ public Builder toBuilder() { @java.lang.Override protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + com.google.protobuf.GeneratedMessage.BuilderParent parent) { Builder builder = new Builder(parent); return builder; } + /** * * @@ -1992,16 +1977,19 @@ protected Builder newBuilderForType( * Specifies an exponential sequence of buckets that have a width that is * proportional to the value of the lower bound. Each bucket represents a * constant relative uncertainty on a specific value in the bucket. + * * There are `num_finite_buckets + 2` (= N) buckets. Bucket `i` has the * following boundaries: - * Upper bound (0 <= i < N-1): scale * (growth_factor ^ i). - * Lower bound (1 <= i < N): scale * (growth_factor ^ (i - 1)). + * + * Upper bound (0 <= i < N-1): scale * (growth_factor ^ i). + * + * Lower bound (1 <= i < N): scale * (growth_factor ^ (i - 1)). * * * Protobuf type {@code google.api.Distribution.BucketOptions.Exponential} */ public static final class Builder - extends com.google.protobuf.GeneratedMessageV3.Builder + extends com.google.protobuf.GeneratedMessage.Builder implements // @@protoc_insertion_point(builder_implements:google.api.Distribution.BucketOptions.Exponential) com.google.api.Distribution.BucketOptions.ExponentialOrBuilder { @@ -2011,7 +1999,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.api.DistributionProto .internal_static_google_api_Distribution_BucketOptions_Exponential_fieldAccessorTable @@ -2023,19 +2011,17 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { // Construct using com.google.api.Distribution.BucketOptions.Exponential.newBuilder() private Builder() {} - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { super(parent); } @java.lang.Override public Builder clear() { super.clear(); + bitField0_ = 0; numFiniteBuckets_ = 0; - growthFactor_ = 0D; - scale_ = 0D; - return this; } @@ -2063,46 +2049,24 @@ public com.google.api.Distribution.BucketOptions.Exponential build() { public com.google.api.Distribution.BucketOptions.Exponential buildPartial() { com.google.api.Distribution.BucketOptions.Exponential result = new com.google.api.Distribution.BucketOptions.Exponential(this); - result.numFiniteBuckets_ = numFiniteBuckets_; - result.growthFactor_ = growthFactor_; - result.scale_ = scale_; + if (bitField0_ != 0) { + buildPartial0(result); + } 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); + private void buildPartial0(com.google.api.Distribution.BucketOptions.Exponential result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.numFiniteBuckets_ = numFiniteBuckets_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.growthFactor_ = growthFactor_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.scale_ = scale_; + } } @java.lang.Override @@ -2121,10 +2085,10 @@ public Builder mergeFrom(com.google.api.Distribution.BucketOptions.Exponential o if (other.getNumFiniteBuckets() != 0) { setNumFiniteBuckets(other.getNumFiniteBuckets()); } - if (other.getGrowthFactor() != 0D) { + if (java.lang.Double.doubleToRawLongBits(other.getGrowthFactor()) != 0) { setGrowthFactor(other.getGrowthFactor()); } - if (other.getScale() != 0D) { + if (java.lang.Double.doubleToRawLongBits(other.getScale()) != 0) { setScale(other.getScale()); } this.mergeUnknownFields(other.getUnknownFields()); @@ -2156,19 +2120,19 @@ public Builder mergeFrom( case 8: { numFiniteBuckets_ = input.readInt32(); - + bitField0_ |= 0x00000001; break; } // case 8 case 17: { growthFactor_ = input.readDouble(); - + bitField0_ |= 0x00000002; break; } // case 17 case 25: { scale_ = input.readDouble(); - + bitField0_ |= 0x00000004; break; } // case 25 default: @@ -2188,7 +2152,10 @@ public Builder mergeFrom( return this; } + private int bitField0_; + private int numFiniteBuckets_; + /** * * @@ -2204,6 +2171,7 @@ public Builder mergeFrom( public int getNumFiniteBuckets() { return numFiniteBuckets_; } + /** * * @@ -2219,9 +2187,11 @@ public int getNumFiniteBuckets() { public Builder setNumFiniteBuckets(int value) { numFiniteBuckets_ = value; + bitField0_ |= 0x00000001; onChanged(); return this; } + /** * * @@ -2234,13 +2204,14 @@ public Builder setNumFiniteBuckets(int value) { * @return This builder for chaining. */ public Builder clearNumFiniteBuckets() { - + bitField0_ = (bitField0_ & ~0x00000001); numFiniteBuckets_ = 0; onChanged(); return this; } private double growthFactor_; + /** * * @@ -2256,6 +2227,7 @@ public Builder clearNumFiniteBuckets() { public double getGrowthFactor() { return growthFactor_; } + /** * * @@ -2271,9 +2243,11 @@ public double getGrowthFactor() { public Builder setGrowthFactor(double value) { growthFactor_ = value; + bitField0_ |= 0x00000002; onChanged(); return this; } + /** * * @@ -2286,13 +2260,14 @@ public Builder setGrowthFactor(double value) { * @return This builder for chaining. */ public Builder clearGrowthFactor() { - + bitField0_ = (bitField0_ & ~0x00000002); growthFactor_ = 0D; onChanged(); return this; } private double scale_; + /** * * @@ -2308,6 +2283,7 @@ public Builder clearGrowthFactor() { public double getScale() { return scale_; } + /** * * @@ -2323,9 +2299,11 @@ public double getScale() { public Builder setScale(double value) { scale_ = value; + bitField0_ |= 0x00000004; onChanged(); return this; } + /** * * @@ -2338,24 +2316,12 @@ public Builder setScale(double value) { * @return This builder for chaining. */ public Builder clearScale() { - + bitField0_ = (bitField0_ & ~0x00000004); scale_ = 0D; onChanged(); return this; } - @java.lang.Override - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - // @@protoc_insertion_point(builder_scope:google.api.Distribution.BucketOptions.Exponential) } @@ -2425,6 +2391,7 @@ public interface ExplicitOrBuilder * @return A list containing the bounds. */ java.util.List getBoundsList(); + /** * * @@ -2437,6 +2404,7 @@ public interface ExplicitOrBuilder * @return The count of bounds. */ int getBoundsCount(); + /** * * @@ -2451,15 +2419,19 @@ public interface ExplicitOrBuilder */ double getBounds(int index); } + /** * * *
              * Specifies a set of buckets with arbitrary widths.
        +     *
              * There are `size(bounds) + 1` (= N) buckets. Bucket `i` has the following
              * boundaries:
        -     *    Upper bound (0 <= i < N-1):     bounds[i]
        -     *    Lower bound (1 <= i < N);       bounds[i - 1]
        +     *
        +     * Upper bound (0 <= i < N-1):     bounds[i]
        +     * Lower bound (1 <= i < N);       bounds[i - 1]
        +     *
              * The `bounds` field must contain at least one element. If `bounds` has
              * only one element, then there are no finite buckets, and that single
              * element is the common boundary of the overflow and underflow buckets.
        @@ -2467,13 +2439,24 @@ public interface ExplicitOrBuilder
              *
              * Protobuf type {@code google.api.Distribution.BucketOptions.Explicit}
              */
        -    public static final class Explicit extends com.google.protobuf.GeneratedMessageV3
        +    public static final class Explicit extends com.google.protobuf.GeneratedMessage
                 implements
                 // @@protoc_insertion_point(message_implements:google.api.Distribution.BucketOptions.Explicit)
                 ExplicitOrBuilder {
               private static final long serialVersionUID = 0L;
        +
        +      static {
        +        com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion(
        +            com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC,
        +            /* major= */ 4,
        +            /* minor= */ 33,
        +            /* patch= */ 2,
        +            /* suffix= */ "",
        +            "Explicit");
        +      }
        +
               // Use Explicit.newBuilder() to construct.
        -      private Explicit(com.google.protobuf.GeneratedMessageV3.Builder builder) {
        +      private Explicit(com.google.protobuf.GeneratedMessage.Builder builder) {
                 super(builder);
               }
         
        @@ -2481,24 +2464,13 @@ private Explicit() {
                 bounds_ = emptyDoubleList();
               }
         
        -      @java.lang.Override
        -      @SuppressWarnings({"unused"})
        -      protected java.lang.Object newInstance(UnusedPrivateParameter unused) {
        -        return new Explicit();
        -      }
        -
        -      @java.lang.Override
        -      public final com.google.protobuf.UnknownFieldSet getUnknownFields() {
        -        return this.unknownFields;
        -      }
        -
               public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
                 return com.google.api.DistributionProto
                     .internal_static_google_api_Distribution_BucketOptions_Explicit_descriptor;
               }
         
               @java.lang.Override
        -      protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
        +      protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
                   internalGetFieldAccessorTable() {
                 return com.google.api.DistributionProto
                     .internal_static_google_api_Distribution_BucketOptions_Explicit_fieldAccessorTable
        @@ -2508,7 +2480,10 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
               }
         
               public static final int BOUNDS_FIELD_NUMBER = 1;
        -      private com.google.protobuf.Internal.DoubleList bounds_;
        +
        +      @SuppressWarnings("serial")
        +      private com.google.protobuf.Internal.DoubleList bounds_ = emptyDoubleList();
        +
               /**
                *
                *
        @@ -2524,6 +2499,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
               public java.util.List getBoundsList() {
                 return bounds_;
               }
        +
               /**
                *
                *
        @@ -2538,6 +2514,7 @@ public java.util.List getBoundsList() {
               public int getBoundsCount() {
                 return bounds_.size();
               }
        +
               /**
                *
                *
        @@ -2671,38 +2648,38 @@ public static com.google.api.Distribution.BucketOptions.Explicit parseFrom(
         
               public static com.google.api.Distribution.BucketOptions.Explicit parseFrom(
                   java.io.InputStream input) throws java.io.IOException {
        -        return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
        +        return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input);
               }
         
               public static com.google.api.Distribution.BucketOptions.Explicit parseFrom(
                   java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
                   throws java.io.IOException {
        -        return com.google.protobuf.GeneratedMessageV3.parseWithIOException(
        +        return com.google.protobuf.GeneratedMessage.parseWithIOException(
                     PARSER, input, extensionRegistry);
               }
         
               public static com.google.api.Distribution.BucketOptions.Explicit parseDelimitedFrom(
                   java.io.InputStream input) throws java.io.IOException {
        -        return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input);
        +        return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input);
               }
         
               public static com.google.api.Distribution.BucketOptions.Explicit parseDelimitedFrom(
                   java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
                   throws java.io.IOException {
        -        return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(
        +        return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(
                     PARSER, input, extensionRegistry);
               }
         
               public static com.google.api.Distribution.BucketOptions.Explicit parseFrom(
                   com.google.protobuf.CodedInputStream input) throws java.io.IOException {
        -        return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
        +        return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input);
               }
         
               public static com.google.api.Distribution.BucketOptions.Explicit parseFrom(
                   com.google.protobuf.CodedInputStream input,
                   com.google.protobuf.ExtensionRegistryLite extensionRegistry)
                   throws java.io.IOException {
        -        return com.google.protobuf.GeneratedMessageV3.parseWithIOException(
        +        return com.google.protobuf.GeneratedMessage.parseWithIOException(
                     PARSER, input, extensionRegistry);
               }
         
        @@ -2727,19 +2704,23 @@ public Builder toBuilder() {
         
               @java.lang.Override
               protected Builder newBuilderForType(
        -          com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
        +          com.google.protobuf.GeneratedMessage.BuilderParent parent) {
                 Builder builder = new Builder(parent);
                 return builder;
               }
        +
               /**
                *
                *
                * 
                * Specifies a set of buckets with arbitrary widths.
        +       *
                * There are `size(bounds) + 1` (= N) buckets. Bucket `i` has the following
                * boundaries:
        -       *    Upper bound (0 <= i < N-1):     bounds[i]
        -       *    Lower bound (1 <= i < N);       bounds[i - 1]
        +       *
        +       * Upper bound (0 <= i < N-1):     bounds[i]
        +       * Lower bound (1 <= i < N);       bounds[i - 1]
        +       *
                * The `bounds` field must contain at least one element. If `bounds` has
                * only one element, then there are no finite buckets, and that single
                * element is the common boundary of the overflow and underflow buckets.
        @@ -2748,7 +2729,7 @@ protected Builder newBuilderForType(
                * Protobuf type {@code google.api.Distribution.BucketOptions.Explicit}
                */
               public static final class Builder
        -          extends com.google.protobuf.GeneratedMessageV3.Builder
        +          extends com.google.protobuf.GeneratedMessage.Builder
                   implements
                   // @@protoc_insertion_point(builder_implements:google.api.Distribution.BucketOptions.Explicit)
                   com.google.api.Distribution.BucketOptions.ExplicitOrBuilder {
        @@ -2758,7 +2739,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
                 }
         
                 @java.lang.Override
        -        protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
        +        protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
                     internalGetFieldAccessorTable() {
                   return com.google.api.DistributionProto
                       .internal_static_google_api_Distribution_BucketOptions_Explicit_fieldAccessorTable
        @@ -2770,15 +2751,15 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
                 // Construct using com.google.api.Distribution.BucketOptions.Explicit.newBuilder()
                 private Builder() {}
         
        -        private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
        +        private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) {
                   super(parent);
                 }
         
                 @java.lang.Override
                 public Builder clear() {
                   super.clear();
        +          bitField0_ = 0;
                   bounds_ = emptyDoubleList();
        -          bitField0_ = (bitField0_ & ~0x00000001);
                   return this;
                 }
         
        @@ -2806,49 +2787,19 @@ public com.google.api.Distribution.BucketOptions.Explicit build() {
                 public com.google.api.Distribution.BucketOptions.Explicit buildPartial() {
                   com.google.api.Distribution.BucketOptions.Explicit result =
                       new com.google.api.Distribution.BucketOptions.Explicit(this);
        -          int from_bitField0_ = bitField0_;
        -          if (((bitField0_ & 0x00000001) != 0)) {
        -            bounds_.makeImmutable();
        -            bitField0_ = (bitField0_ & ~0x00000001);
        +          if (bitField0_ != 0) {
        +            buildPartial0(result);
                   }
        -          result.bounds_ = bounds_;
                   onBuilt();
                   return result;
                 }
         
        -        @java.lang.Override
        -        public Builder clone() {
        -          return super.clone();
        -        }
        -
        -        @java.lang.Override
        -        public Builder setField(
        -            com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) {
        -          return super.setField(field, value);
        -        }
        -
        -        @java.lang.Override
        -        public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) {
        -          return super.clearField(field);
        -        }
        -
        -        @java.lang.Override
        -        public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) {
        -          return super.clearOneof(oneof);
        -        }
        -
        -        @java.lang.Override
        -        public Builder setRepeatedField(
        -            com.google.protobuf.Descriptors.FieldDescriptor field,
        -            int index,
        -            java.lang.Object value) {
        -          return super.setRepeatedField(field, index, value);
        -        }
        -
        -        @java.lang.Override
        -        public Builder addRepeatedField(
        -            com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) {
        -          return super.addRepeatedField(field, value);
        +        private void buildPartial0(com.google.api.Distribution.BucketOptions.Explicit result) {
        +          int from_bitField0_ = bitField0_;
        +          if (((from_bitField0_ & 0x00000001) != 0)) {
        +            bounds_.makeImmutable();
        +            result.bounds_ = bounds_;
        +          }
                 }
         
                 @java.lang.Override
        @@ -2867,7 +2818,8 @@ public Builder mergeFrom(com.google.api.Distribution.BucketOptions.Explicit othe
                   if (!other.bounds_.isEmpty()) {
                     if (bounds_.isEmpty()) {
                       bounds_ = other.bounds_;
        -              bitField0_ = (bitField0_ & ~0x00000001);
        +              bounds_.makeImmutable();
        +              bitField0_ |= 0x00000001;
                     } else {
                       ensureBoundsIsMutable();
                       bounds_.addAll(other.bounds_);
        @@ -2911,7 +2863,8 @@ public Builder mergeFrom(
                           {
                             int length = input.readRawVarint32();
                             int limit = input.pushLimit(length);
        -                    ensureBoundsIsMutable();
        +                    int alloc = length > 4096 ? 4096 : length;
        +                    ensureBoundsIsMutable(alloc / 8);
                             while (input.getBytesUntilLimit() > 0) {
                               bounds_.addDouble(input.readDouble());
                             }
        @@ -2940,11 +2893,19 @@ public Builder mergeFrom(
                 private com.google.protobuf.Internal.DoubleList bounds_ = emptyDoubleList();
         
                 private void ensureBoundsIsMutable() {
        -          if (!((bitField0_ & 0x00000001) != 0)) {
        -            bounds_ = mutableCopy(bounds_);
        -            bitField0_ |= 0x00000001;
        +          if (!bounds_.isModifiable()) {
        +            bounds_ = makeMutableCopy(bounds_);
        +          }
        +          bitField0_ |= 0x00000001;
        +        }
        +
        +        private void ensureBoundsIsMutable(int capacity) {
        +          if (!bounds_.isModifiable()) {
        +            bounds_ = makeMutableCopy(bounds_, capacity);
                   }
        +          bitField0_ |= 0x00000001;
                 }
        +
                 /**
                  *
                  *
        @@ -2957,10 +2918,10 @@ private void ensureBoundsIsMutable() {
                  * @return A list containing the bounds.
                  */
                 public java.util.List getBoundsList() {
        -          return ((bitField0_ & 0x00000001) != 0)
        -              ? java.util.Collections.unmodifiableList(bounds_)
        -              : bounds_;
        +          bounds_.makeImmutable();
        +          return bounds_;
                 }
        +
                 /**
                  *
                  *
        @@ -2975,6 +2936,7 @@ public java.util.List getBoundsList() {
                 public int getBoundsCount() {
                   return bounds_.size();
                 }
        +
                 /**
                  *
                  *
        @@ -2990,6 +2952,7 @@ public int getBoundsCount() {
                 public double getBounds(int index) {
                   return bounds_.getDouble(index);
                 }
        +
                 /**
                  *
                  *
        @@ -3004,11 +2967,14 @@ public double getBounds(int index) {
                  * @return This builder for chaining.
                  */
                 public Builder setBounds(int index, double value) {
        +
                   ensureBoundsIsMutable();
                   bounds_.setDouble(index, value);
        +          bitField0_ |= 0x00000001;
                   onChanged();
                   return this;
                 }
        +
                 /**
                  *
                  *
        @@ -3022,11 +2988,14 @@ public Builder setBounds(int index, double value) {
                  * @return This builder for chaining.
                  */
                 public Builder addBounds(double value) {
        +
                   ensureBoundsIsMutable();
                   bounds_.addDouble(value);
        +          bitField0_ |= 0x00000001;
                   onChanged();
                   return this;
                 }
        +
                 /**
                  *
                  *
        @@ -3042,9 +3011,11 @@ public Builder addBounds(double value) {
                 public Builder addAllBounds(java.lang.Iterable values) {
                   ensureBoundsIsMutable();
                   com.google.protobuf.AbstractMessageLite.Builder.addAll(values, bounds_);
        +          bitField0_ |= 0x00000001;
                   onChanged();
                   return this;
                 }
        +
                 /**
                  *
                  *
        @@ -3063,18 +3034,6 @@ public Builder clearBounds() {
                   return this;
                 }
         
        -        @java.lang.Override
        -        public final Builder setUnknownFields(
        -            final com.google.protobuf.UnknownFieldSet unknownFields) {
        -          return super.setUnknownFields(unknownFields);
        -        }
        -
        -        @java.lang.Override
        -        public final Builder mergeUnknownFields(
        -            final com.google.protobuf.UnknownFieldSet unknownFields) {
        -          return super.mergeUnknownFields(unknownFields);
        -        }
        -
                 // @@protoc_insertion_point(builder_scope:google.api.Distribution.BucketOptions.Explicit)
               }
         
        @@ -3128,6 +3087,8 @@ public com.google.api.Distribution.BucketOptions.Explicit getDefaultInstanceForT
             }
         
             private int optionsCase_ = 0;
        +
        +    @SuppressWarnings("serial")
             private java.lang.Object options_;
         
             public enum OptionsCase
        @@ -3143,6 +3104,7 @@ public enum OptionsCase
               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.
        @@ -3178,6 +3140,7 @@ public OptionsCase getOptionsCase() {
             }
         
             public static final int LINEAR_BUCKETS_FIELD_NUMBER = 1;
        +
             /**
              *
              *
        @@ -3193,6 +3156,7 @@ public OptionsCase getOptionsCase() {
             public boolean hasLinearBuckets() {
               return optionsCase_ == 1;
             }
        +
             /**
              *
              *
        @@ -3211,6 +3175,7 @@ public com.google.api.Distribution.BucketOptions.Linear getLinearBuckets() {
               }
               return com.google.api.Distribution.BucketOptions.Linear.getDefaultInstance();
             }
        +
             /**
              *
              *
        @@ -3229,6 +3194,7 @@ public com.google.api.Distribution.BucketOptions.LinearOrBuilder getLinearBucket
             }
         
             public static final int EXPONENTIAL_BUCKETS_FIELD_NUMBER = 2;
        +
             /**
              *
              *
        @@ -3244,6 +3210,7 @@ public com.google.api.Distribution.BucketOptions.LinearOrBuilder getLinearBucket
             public boolean hasExponentialBuckets() {
               return optionsCase_ == 2;
             }
        +
             /**
              *
              *
        @@ -3262,6 +3229,7 @@ public com.google.api.Distribution.BucketOptions.Exponential getExponentialBucke
               }
               return com.google.api.Distribution.BucketOptions.Exponential.getDefaultInstance();
             }
        +
             /**
              *
              *
        @@ -3281,6 +3249,7 @@ public com.google.api.Distribution.BucketOptions.Exponential getExponentialBucke
             }
         
             public static final int EXPLICIT_BUCKETS_FIELD_NUMBER = 3;
        +
             /**
              *
              *
        @@ -3296,6 +3265,7 @@ public com.google.api.Distribution.BucketOptions.Exponential getExponentialBucke
             public boolean hasExplicitBuckets() {
               return optionsCase_ == 3;
             }
        +
             /**
              *
              *
        @@ -3314,6 +3284,7 @@ public com.google.api.Distribution.BucketOptions.Explicit getExplicitBuckets() {
               }
               return com.google.api.Distribution.BucketOptions.Explicit.getDefaultInstance();
             }
        +
             /**
              *
              *
        @@ -3478,38 +3449,38 @@ public static com.google.api.Distribution.BucketOptions parseFrom(
         
             public static com.google.api.Distribution.BucketOptions parseFrom(java.io.InputStream input)
                 throws java.io.IOException {
        -      return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
        +      return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input);
             }
         
             public static com.google.api.Distribution.BucketOptions parseFrom(
                 java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
                 throws java.io.IOException {
        -      return com.google.protobuf.GeneratedMessageV3.parseWithIOException(
        +      return com.google.protobuf.GeneratedMessage.parseWithIOException(
                   PARSER, input, extensionRegistry);
             }
         
             public static com.google.api.Distribution.BucketOptions parseDelimitedFrom(
                 java.io.InputStream input) throws java.io.IOException {
        -      return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input);
        +      return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input);
             }
         
             public static com.google.api.Distribution.BucketOptions parseDelimitedFrom(
                 java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
                 throws java.io.IOException {
        -      return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(
        +      return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(
                   PARSER, input, extensionRegistry);
             }
         
             public static com.google.api.Distribution.BucketOptions parseFrom(
                 com.google.protobuf.CodedInputStream input) throws java.io.IOException {
        -      return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
        +      return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input);
             }
         
             public static com.google.api.Distribution.BucketOptions parseFrom(
                 com.google.protobuf.CodedInputStream input,
                 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
                 throws java.io.IOException {
        -      return com.google.protobuf.GeneratedMessageV3.parseWithIOException(
        +      return com.google.protobuf.GeneratedMessage.parseWithIOException(
                   PARSER, input, extensionRegistry);
             }
         
        @@ -3532,11 +3503,11 @@ public Builder toBuilder() {
             }
         
             @java.lang.Override
        -    protected Builder newBuilderForType(
        -        com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
        +    protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) {
               Builder builder = new Builder(parent);
               return builder;
             }
        +
             /**
              *
              *
        @@ -3545,6 +3516,7 @@ protected Builder newBuilderForType(
              * for the distribution. The buckets can be in a linear sequence, an
              * exponential sequence, or each bucket can be specified explicitly.
              * `BucketOptions` does not include the number of values in each bucket.
        +     *
              * A bucket has an inclusive lower bound and exclusive upper bound for the
              * values that are counted for that bucket. The upper bound of a bucket must
              * be strictly greater than the lower bound. The sequence of N buckets for a
        @@ -3559,8 +3531,7 @@ protected Builder newBuilderForType(
              *
              * Protobuf type {@code google.api.Distribution.BucketOptions}
              */
        -    public static final class Builder
        -        extends com.google.protobuf.GeneratedMessageV3.Builder
        +    public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder
                 implements
                 // @@protoc_insertion_point(builder_implements:google.api.Distribution.BucketOptions)
                 com.google.api.Distribution.BucketOptionsOrBuilder {
        @@ -3570,7 +3541,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
               }
         
               @java.lang.Override
        -      protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
        +      protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
                   internalGetFieldAccessorTable() {
                 return com.google.api.DistributionProto
                     .internal_static_google_api_Distribution_BucketOptions_fieldAccessorTable
        @@ -3582,13 +3553,14 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
               // Construct using com.google.api.Distribution.BucketOptions.newBuilder()
               private Builder() {}
         
        -      private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
        +      private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) {
                 super(parent);
               }
         
               @java.lang.Override
               public Builder clear() {
                 super.clear();
        +        bitField0_ = 0;
                 if (linearBucketsBuilder_ != null) {
                   linearBucketsBuilder_.clear();
                 }
        @@ -3627,65 +3599,30 @@ public com.google.api.Distribution.BucketOptions build() {
               public com.google.api.Distribution.BucketOptions buildPartial() {
                 com.google.api.Distribution.BucketOptions result =
                     new com.google.api.Distribution.BucketOptions(this);
        -        if (optionsCase_ == 1) {
        -          if (linearBucketsBuilder_ == null) {
        -            result.options_ = options_;
        -          } else {
        -            result.options_ = linearBucketsBuilder_.build();
        -          }
        -        }
        -        if (optionsCase_ == 2) {
        -          if (exponentialBucketsBuilder_ == null) {
        -            result.options_ = options_;
        -          } else {
        -            result.options_ = exponentialBucketsBuilder_.build();
        -          }
        -        }
        -        if (optionsCase_ == 3) {
        -          if (explicitBucketsBuilder_ == null) {
        -            result.options_ = options_;
        -          } else {
        -            result.options_ = explicitBucketsBuilder_.build();
        -          }
        +        if (bitField0_ != 0) {
        +          buildPartial0(result);
                 }
        -        result.optionsCase_ = optionsCase_;
        +        buildPartialOneofs(result);
                 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);
        +      private void buildPartial0(com.google.api.Distribution.BucketOptions result) {
        +        int from_bitField0_ = bitField0_;
               }
         
        -      @java.lang.Override
        -      public Builder addRepeatedField(
        -          com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) {
        -        return super.addRepeatedField(field, value);
        +      private void buildPartialOneofs(com.google.api.Distribution.BucketOptions result) {
        +        result.optionsCase_ = optionsCase_;
        +        result.options_ = this.options_;
        +        if (optionsCase_ == 1 && linearBucketsBuilder_ != null) {
        +          result.options_ = linearBucketsBuilder_.build();
        +        }
        +        if (optionsCase_ == 2 && exponentialBucketsBuilder_ != null) {
        +          result.options_ = exponentialBucketsBuilder_.build();
        +        }
        +        if (optionsCase_ == 3 && explicitBucketsBuilder_ != null) {
        +          result.options_ = explicitBucketsBuilder_.build();
        +        }
               }
         
               @java.lang.Override
        @@ -3749,21 +3686,22 @@ public Builder mergeFrom(
                         break;
                       case 10:
                         {
        -                  input.readMessage(getLinearBucketsFieldBuilder().getBuilder(), extensionRegistry);
        +                  input.readMessage(
        +                      internalGetLinearBucketsFieldBuilder().getBuilder(), extensionRegistry);
                           optionsCase_ = 1;
                           break;
                         } // case 10
                       case 18:
                         {
                           input.readMessage(
        -                      getExponentialBucketsFieldBuilder().getBuilder(), extensionRegistry);
        +                      internalGetExponentialBucketsFieldBuilder().getBuilder(), extensionRegistry);
                           optionsCase_ = 2;
                           break;
                         } // case 18
                       case 26:
                         {
                           input.readMessage(
        -                      getExplicitBucketsFieldBuilder().getBuilder(), extensionRegistry);
        +                      internalGetExplicitBucketsFieldBuilder().getBuilder(), extensionRegistry);
                           optionsCase_ = 3;
                           break;
                         } // case 26
        @@ -3798,11 +3736,14 @@ public Builder clearOptions() {
                 return this;
               }
         
        -      private com.google.protobuf.SingleFieldBuilderV3<
        +      private int bitField0_;
        +
        +      private com.google.protobuf.SingleFieldBuilder<
                       com.google.api.Distribution.BucketOptions.Linear,
                       com.google.api.Distribution.BucketOptions.Linear.Builder,
                       com.google.api.Distribution.BucketOptions.LinearOrBuilder>
                   linearBucketsBuilder_;
        +
               /**
                *
                *
        @@ -3818,6 +3759,7 @@ public Builder clearOptions() {
               public boolean hasLinearBuckets() {
                 return optionsCase_ == 1;
               }
        +
               /**
                *
                *
        @@ -3843,6 +3785,7 @@ public com.google.api.Distribution.BucketOptions.Linear getLinearBuckets() {
                   return com.google.api.Distribution.BucketOptions.Linear.getDefaultInstance();
                 }
               }
        +
               /**
                *
                *
        @@ -3865,6 +3808,7 @@ public Builder setLinearBuckets(com.google.api.Distribution.BucketOptions.Linear
                 optionsCase_ = 1;
                 return this;
               }
        +
               /**
                *
                *
        @@ -3885,6 +3829,7 @@ public Builder setLinearBuckets(
                 optionsCase_ = 1;
                 return this;
               }
        +
               /**
                *
                *
        @@ -3918,6 +3863,7 @@ public Builder mergeLinearBuckets(com.google.api.Distribution.BucketOptions.Line
                 optionsCase_ = 1;
                 return this;
               }
        +
               /**
                *
                *
        @@ -3943,6 +3889,7 @@ public Builder clearLinearBuckets() {
                 }
                 return this;
               }
        +
               /**
                *
                *
        @@ -3953,8 +3900,9 @@ public Builder clearLinearBuckets() {
                * .google.api.Distribution.BucketOptions.Linear linear_buckets = 1;
                */
               public com.google.api.Distribution.BucketOptions.Linear.Builder getLinearBucketsBuilder() {
        -        return getLinearBucketsFieldBuilder().getBuilder();
        +        return internalGetLinearBucketsFieldBuilder().getBuilder();
               }
        +
               /**
                *
                *
        @@ -3975,6 +3923,7 @@ public com.google.api.Distribution.BucketOptions.LinearOrBuilder getLinearBucket
                   return com.google.api.Distribution.BucketOptions.Linear.getDefaultInstance();
                 }
               }
        +
               /**
                *
                *
        @@ -3984,17 +3933,17 @@ public com.google.api.Distribution.BucketOptions.LinearOrBuilder getLinearBucket
                *
                * .google.api.Distribution.BucketOptions.Linear linear_buckets = 1;
                */
        -      private com.google.protobuf.SingleFieldBuilderV3<
        +      private com.google.protobuf.SingleFieldBuilder<
                       com.google.api.Distribution.BucketOptions.Linear,
                       com.google.api.Distribution.BucketOptions.Linear.Builder,
                       com.google.api.Distribution.BucketOptions.LinearOrBuilder>
        -          getLinearBucketsFieldBuilder() {
        +          internalGetLinearBucketsFieldBuilder() {
                 if (linearBucketsBuilder_ == null) {
                   if (!(optionsCase_ == 1)) {
                     options_ = com.google.api.Distribution.BucketOptions.Linear.getDefaultInstance();
                   }
                   linearBucketsBuilder_ =
        -              new com.google.protobuf.SingleFieldBuilderV3<
        +              new com.google.protobuf.SingleFieldBuilder<
                           com.google.api.Distribution.BucketOptions.Linear,
                           com.google.api.Distribution.BucketOptions.Linear.Builder,
                           com.google.api.Distribution.BucketOptions.LinearOrBuilder>(
        @@ -4005,15 +3954,15 @@ public com.google.api.Distribution.BucketOptions.LinearOrBuilder getLinearBucket
                 }
                 optionsCase_ = 1;
                 onChanged();
        -        ;
                 return linearBucketsBuilder_;
               }
         
        -      private com.google.protobuf.SingleFieldBuilderV3<
        +      private com.google.protobuf.SingleFieldBuilder<
                       com.google.api.Distribution.BucketOptions.Exponential,
                       com.google.api.Distribution.BucketOptions.Exponential.Builder,
                       com.google.api.Distribution.BucketOptions.ExponentialOrBuilder>
                   exponentialBucketsBuilder_;
        +
               /**
                *
                *
        @@ -4029,6 +3978,7 @@ public com.google.api.Distribution.BucketOptions.LinearOrBuilder getLinearBucket
               public boolean hasExponentialBuckets() {
                 return optionsCase_ == 2;
               }
        +
               /**
                *
                *
        @@ -4054,6 +4004,7 @@ public com.google.api.Distribution.BucketOptions.Exponential getExponentialBucke
                   return com.google.api.Distribution.BucketOptions.Exponential.getDefaultInstance();
                 }
               }
        +
               /**
                *
                *
        @@ -4077,6 +4028,7 @@ public Builder setExponentialBuckets(
                 optionsCase_ = 2;
                 return this;
               }
        +
               /**
                *
                *
        @@ -4097,6 +4049,7 @@ public Builder setExponentialBuckets(
                 optionsCase_ = 2;
                 return this;
               }
        +
               /**
                *
                *
        @@ -4131,6 +4084,7 @@ public Builder mergeExponentialBuckets(
                 optionsCase_ = 2;
                 return this;
               }
        +
               /**
                *
                *
        @@ -4156,6 +4110,7 @@ public Builder clearExponentialBuckets() {
                 }
                 return this;
               }
        +
               /**
                *
                *
        @@ -4167,8 +4122,9 @@ public Builder clearExponentialBuckets() {
                */
               public com.google.api.Distribution.BucketOptions.Exponential.Builder
                   getExponentialBucketsBuilder() {
        -        return getExponentialBucketsFieldBuilder().getBuilder();
        +        return internalGetExponentialBucketsFieldBuilder().getBuilder();
               }
        +
               /**
                *
                *
        @@ -4190,6 +4146,7 @@ public Builder clearExponentialBuckets() {
                   return com.google.api.Distribution.BucketOptions.Exponential.getDefaultInstance();
                 }
               }
        +
               /**
                *
                *
        @@ -4199,17 +4156,17 @@ public Builder clearExponentialBuckets() {
                *
                * .google.api.Distribution.BucketOptions.Exponential exponential_buckets = 2;
                */
        -      private com.google.protobuf.SingleFieldBuilderV3<
        +      private com.google.protobuf.SingleFieldBuilder<
                       com.google.api.Distribution.BucketOptions.Exponential,
                       com.google.api.Distribution.BucketOptions.Exponential.Builder,
                       com.google.api.Distribution.BucketOptions.ExponentialOrBuilder>
        -          getExponentialBucketsFieldBuilder() {
        +          internalGetExponentialBucketsFieldBuilder() {
                 if (exponentialBucketsBuilder_ == null) {
                   if (!(optionsCase_ == 2)) {
                     options_ = com.google.api.Distribution.BucketOptions.Exponential.getDefaultInstance();
                   }
                   exponentialBucketsBuilder_ =
        -              new com.google.protobuf.SingleFieldBuilderV3<
        +              new com.google.protobuf.SingleFieldBuilder<
                           com.google.api.Distribution.BucketOptions.Exponential,
                           com.google.api.Distribution.BucketOptions.Exponential.Builder,
                           com.google.api.Distribution.BucketOptions.ExponentialOrBuilder>(
        @@ -4220,15 +4177,15 @@ public Builder clearExponentialBuckets() {
                 }
                 optionsCase_ = 2;
                 onChanged();
        -        ;
                 return exponentialBucketsBuilder_;
               }
         
        -      private com.google.protobuf.SingleFieldBuilderV3<
        +      private com.google.protobuf.SingleFieldBuilder<
                       com.google.api.Distribution.BucketOptions.Explicit,
                       com.google.api.Distribution.BucketOptions.Explicit.Builder,
                       com.google.api.Distribution.BucketOptions.ExplicitOrBuilder>
                   explicitBucketsBuilder_;
        +
               /**
                *
                *
        @@ -4244,6 +4201,7 @@ public Builder clearExponentialBuckets() {
               public boolean hasExplicitBuckets() {
                 return optionsCase_ == 3;
               }
        +
               /**
                *
                *
        @@ -4269,6 +4227,7 @@ public com.google.api.Distribution.BucketOptions.Explicit getExplicitBuckets() {
                   return com.google.api.Distribution.BucketOptions.Explicit.getDefaultInstance();
                 }
               }
        +
               /**
                *
                *
        @@ -4291,6 +4250,7 @@ public Builder setExplicitBuckets(com.google.api.Distribution.BucketOptions.Expl
                 optionsCase_ = 3;
                 return this;
               }
        +
               /**
                *
                *
        @@ -4311,6 +4271,7 @@ public Builder setExplicitBuckets(
                 optionsCase_ = 3;
                 return this;
               }
        +
               /**
                *
                *
        @@ -4345,6 +4306,7 @@ public Builder mergeExplicitBuckets(
                 optionsCase_ = 3;
                 return this;
               }
        +
               /**
                *
                *
        @@ -4370,6 +4332,7 @@ public Builder clearExplicitBuckets() {
                 }
                 return this;
               }
        +
               /**
                *
                *
        @@ -4381,8 +4344,9 @@ public Builder clearExplicitBuckets() {
                */
               public com.google.api.Distribution.BucketOptions.Explicit.Builder
                   getExplicitBucketsBuilder() {
        -        return getExplicitBucketsFieldBuilder().getBuilder();
        +        return internalGetExplicitBucketsFieldBuilder().getBuilder();
               }
        +
               /**
                *
                *
        @@ -4404,6 +4368,7 @@ public Builder clearExplicitBuckets() {
                   return com.google.api.Distribution.BucketOptions.Explicit.getDefaultInstance();
                 }
               }
        +
               /**
                *
                *
        @@ -4413,17 +4378,17 @@ public Builder clearExplicitBuckets() {
                *
                * .google.api.Distribution.BucketOptions.Explicit explicit_buckets = 3;
                */
        -      private com.google.protobuf.SingleFieldBuilderV3<
        +      private com.google.protobuf.SingleFieldBuilder<
                       com.google.api.Distribution.BucketOptions.Explicit,
                       com.google.api.Distribution.BucketOptions.Explicit.Builder,
                       com.google.api.Distribution.BucketOptions.ExplicitOrBuilder>
        -          getExplicitBucketsFieldBuilder() {
        +          internalGetExplicitBucketsFieldBuilder() {
                 if (explicitBucketsBuilder_ == null) {
                   if (!(optionsCase_ == 3)) {
                     options_ = com.google.api.Distribution.BucketOptions.Explicit.getDefaultInstance();
                   }
                   explicitBucketsBuilder_ =
        -              new com.google.protobuf.SingleFieldBuilderV3<
        +              new com.google.protobuf.SingleFieldBuilder<
                           com.google.api.Distribution.BucketOptions.Explicit,
                           com.google.api.Distribution.BucketOptions.Explicit.Builder,
                           com.google.api.Distribution.BucketOptions.ExplicitOrBuilder>(
        @@ -4434,22 +4399,9 @@ public Builder clearExplicitBuckets() {
                 }
                 optionsCase_ = 3;
                 onChanged();
        -        ;
                 return explicitBucketsBuilder_;
               }
         
        -      @java.lang.Override
        -      public final Builder setUnknownFields(
        -          final com.google.protobuf.UnknownFieldSet unknownFields) {
        -        return super.setUnknownFields(unknownFields);
        -      }
        -
        -      @java.lang.Override
        -      public final Builder mergeUnknownFields(
        -          final com.google.protobuf.UnknownFieldSet unknownFields) {
        -        return super.mergeUnknownFields(unknownFields);
        -      }
        -
               // @@protoc_insertion_point(builder_scope:google.api.Distribution.BucketOptions)
             }
         
        @@ -4533,6 +4485,7 @@ public interface ExemplarOrBuilder
              * @return Whether the timestamp field is set.
              */
             boolean hasTimestamp();
        +
             /**
              *
              *
        @@ -4545,6 +4498,7 @@ public interface ExemplarOrBuilder
              * @return The timestamp.
              */
             com.google.protobuf.Timestamp getTimestamp();
        +
             /**
              *
              *
        @@ -4561,10 +4515,14 @@ public interface ExemplarOrBuilder
              *
              * 
              * Contextual information about the example value. Examples are:
        -     *   Trace: type.googleapis.com/google.monitoring.v3.SpanContext
        -     *   Literal string: type.googleapis.com/google.protobuf.StringValue
        -     *   Labels dropped during aggregation:
        -     *     type.googleapis.com/google.monitoring.v3.DroppedLabels
        +     *
        +     * Trace: type.googleapis.com/google.monitoring.v3.SpanContext
        +     *
        +     * Literal string: type.googleapis.com/google.protobuf.StringValue
        +     *
        +     * Labels dropped during aggregation:
        +     * type.googleapis.com/google.monitoring.v3.DroppedLabels
        +     *
              * There may be only a single attachment of any given message type in a
              * single exemplar, and this is enforced by the system.
              * 
        @@ -4572,15 +4530,20 @@ public interface ExemplarOrBuilder * repeated .google.protobuf.Any attachments = 3; */ java.util.List getAttachmentsList(); + /** * * *
              * Contextual information about the example value. Examples are:
        -     *   Trace: type.googleapis.com/google.monitoring.v3.SpanContext
        -     *   Literal string: type.googleapis.com/google.protobuf.StringValue
        -     *   Labels dropped during aggregation:
        -     *     type.googleapis.com/google.monitoring.v3.DroppedLabels
        +     *
        +     * Trace: type.googleapis.com/google.monitoring.v3.SpanContext
        +     *
        +     * Literal string: type.googleapis.com/google.protobuf.StringValue
        +     *
        +     * Labels dropped during aggregation:
        +     * type.googleapis.com/google.monitoring.v3.DroppedLabels
        +     *
              * There may be only a single attachment of any given message type in a
              * single exemplar, and this is enforced by the system.
              * 
        @@ -4588,15 +4551,20 @@ public interface ExemplarOrBuilder * repeated .google.protobuf.Any attachments = 3; */ com.google.protobuf.Any getAttachments(int index); + /** * * *
              * Contextual information about the example value. Examples are:
        -     *   Trace: type.googleapis.com/google.monitoring.v3.SpanContext
        -     *   Literal string: type.googleapis.com/google.protobuf.StringValue
        -     *   Labels dropped during aggregation:
        -     *     type.googleapis.com/google.monitoring.v3.DroppedLabels
        +     *
        +     * Trace: type.googleapis.com/google.monitoring.v3.SpanContext
        +     *
        +     * Literal string: type.googleapis.com/google.protobuf.StringValue
        +     *
        +     * Labels dropped during aggregation:
        +     * type.googleapis.com/google.monitoring.v3.DroppedLabels
        +     *
              * There may be only a single attachment of any given message type in a
              * single exemplar, and this is enforced by the system.
              * 
        @@ -4604,15 +4572,20 @@ public interface ExemplarOrBuilder * repeated .google.protobuf.Any attachments = 3; */ int getAttachmentsCount(); + /** * * *
              * Contextual information about the example value. Examples are:
        -     *   Trace: type.googleapis.com/google.monitoring.v3.SpanContext
        -     *   Literal string: type.googleapis.com/google.protobuf.StringValue
        -     *   Labels dropped during aggregation:
        -     *     type.googleapis.com/google.monitoring.v3.DroppedLabels
        +     *
        +     * Trace: type.googleapis.com/google.monitoring.v3.SpanContext
        +     *
        +     * Literal string: type.googleapis.com/google.protobuf.StringValue
        +     *
        +     * Labels dropped during aggregation:
        +     * type.googleapis.com/google.monitoring.v3.DroppedLabels
        +     *
              * There may be only a single attachment of any given message type in a
              * single exemplar, and this is enforced by the system.
              * 
        @@ -4620,15 +4593,20 @@ public interface ExemplarOrBuilder * repeated .google.protobuf.Any attachments = 3; */ java.util.List getAttachmentsOrBuilderList(); + /** * * *
              * Contextual information about the example value. Examples are:
        -     *   Trace: type.googleapis.com/google.monitoring.v3.SpanContext
        -     *   Literal string: type.googleapis.com/google.protobuf.StringValue
        -     *   Labels dropped during aggregation:
        -     *     type.googleapis.com/google.monitoring.v3.DroppedLabels
        +     *
        +     * Trace: type.googleapis.com/google.monitoring.v3.SpanContext
        +     *
        +     * Literal string: type.googleapis.com/google.protobuf.StringValue
        +     *
        +     * Labels dropped during aggregation:
        +     * type.googleapis.com/google.monitoring.v3.DroppedLabels
        +     *
              * There may be only a single attachment of any given message type in a
              * single exemplar, and this is enforced by the system.
              * 
        @@ -4637,6 +4615,7 @@ public interface ExemplarOrBuilder */ com.google.protobuf.AnyOrBuilder getAttachmentsOrBuilder(int index); } + /** * * @@ -4650,13 +4629,24 @@ public interface ExemplarOrBuilder * * Protobuf type {@code google.api.Distribution.Exemplar} */ - public static final class Exemplar extends com.google.protobuf.GeneratedMessageV3 + public static final class Exemplar extends com.google.protobuf.GeneratedMessage implements // @@protoc_insertion_point(message_implements:google.api.Distribution.Exemplar) ExemplarOrBuilder { private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "Exemplar"); + } + // Use Exemplar.newBuilder() to construct. - private Exemplar(com.google.protobuf.GeneratedMessageV3.Builder builder) { + private Exemplar(com.google.protobuf.GeneratedMessage.Builder builder) { super(builder); } @@ -4664,24 +4654,13 @@ private Exemplar() { attachments_ = java.util.Collections.emptyList(); } - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new Exemplar(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.api.DistributionProto .internal_static_google_api_Distribution_Exemplar_descriptor; } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.api.DistributionProto .internal_static_google_api_Distribution_Exemplar_fieldAccessorTable @@ -4690,8 +4669,10 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { com.google.api.Distribution.Exemplar.Builder.class); } + private int bitField0_; public static final int VALUE_FIELD_NUMBER = 1; - private double value_; + private double value_ = 0D; + /** * * @@ -4711,6 +4692,7 @@ public double getValue() { public static final int TIMESTAMP_FIELD_NUMBER = 2; private com.google.protobuf.Timestamp timestamp_; + /** * * @@ -4724,8 +4706,9 @@ public double getValue() { */ @java.lang.Override public boolean hasTimestamp() { - return timestamp_ != null; + return ((bitField0_ & 0x00000001) != 0); } + /** * * @@ -4741,6 +4724,7 @@ public boolean hasTimestamp() { public com.google.protobuf.Timestamp getTimestamp() { return timestamp_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : timestamp_; } + /** * * @@ -4752,20 +4736,27 @@ public com.google.protobuf.Timestamp getTimestamp() { */ @java.lang.Override public com.google.protobuf.TimestampOrBuilder getTimestampOrBuilder() { - return getTimestamp(); + return timestamp_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : timestamp_; } public static final int ATTACHMENTS_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") private java.util.List attachments_; + /** * * *
              * Contextual information about the example value. Examples are:
        -     *   Trace: type.googleapis.com/google.monitoring.v3.SpanContext
        -     *   Literal string: type.googleapis.com/google.protobuf.StringValue
        -     *   Labels dropped during aggregation:
        -     *     type.googleapis.com/google.monitoring.v3.DroppedLabels
        +     *
        +     * Trace: type.googleapis.com/google.monitoring.v3.SpanContext
        +     *
        +     * Literal string: type.googleapis.com/google.protobuf.StringValue
        +     *
        +     * Labels dropped during aggregation:
        +     * type.googleapis.com/google.monitoring.v3.DroppedLabels
        +     *
              * There may be only a single attachment of any given message type in a
              * single exemplar, and this is enforced by the system.
              * 
        @@ -4776,15 +4767,20 @@ public com.google.protobuf.TimestampOrBuilder getTimestampOrBuilder() { public java.util.List getAttachmentsList() { return attachments_; } + /** * * *
              * Contextual information about the example value. Examples are:
        -     *   Trace: type.googleapis.com/google.monitoring.v3.SpanContext
        -     *   Literal string: type.googleapis.com/google.protobuf.StringValue
        -     *   Labels dropped during aggregation:
        -     *     type.googleapis.com/google.monitoring.v3.DroppedLabels
        +     *
        +     * Trace: type.googleapis.com/google.monitoring.v3.SpanContext
        +     *
        +     * Literal string: type.googleapis.com/google.protobuf.StringValue
        +     *
        +     * Labels dropped during aggregation:
        +     * type.googleapis.com/google.monitoring.v3.DroppedLabels
        +     *
              * There may be only a single attachment of any given message type in a
              * single exemplar, and this is enforced by the system.
              * 
        @@ -4796,15 +4792,20 @@ public java.util.List getAttachmentsList() { getAttachmentsOrBuilderList() { return attachments_; } + /** * * *
              * Contextual information about the example value. Examples are:
        -     *   Trace: type.googleapis.com/google.monitoring.v3.SpanContext
        -     *   Literal string: type.googleapis.com/google.protobuf.StringValue
        -     *   Labels dropped during aggregation:
        -     *     type.googleapis.com/google.monitoring.v3.DroppedLabels
        +     *
        +     * Trace: type.googleapis.com/google.monitoring.v3.SpanContext
        +     *
        +     * Literal string: type.googleapis.com/google.protobuf.StringValue
        +     *
        +     * Labels dropped during aggregation:
        +     * type.googleapis.com/google.monitoring.v3.DroppedLabels
        +     *
              * There may be only a single attachment of any given message type in a
              * single exemplar, and this is enforced by the system.
              * 
        @@ -4815,15 +4816,20 @@ public java.util.List getAttachmentsList() { public int getAttachmentsCount() { return attachments_.size(); } + /** * * *
              * Contextual information about the example value. Examples are:
        -     *   Trace: type.googleapis.com/google.monitoring.v3.SpanContext
        -     *   Literal string: type.googleapis.com/google.protobuf.StringValue
        -     *   Labels dropped during aggregation:
        -     *     type.googleapis.com/google.monitoring.v3.DroppedLabels
        +     *
        +     * Trace: type.googleapis.com/google.monitoring.v3.SpanContext
        +     *
        +     * Literal string: type.googleapis.com/google.protobuf.StringValue
        +     *
        +     * Labels dropped during aggregation:
        +     * type.googleapis.com/google.monitoring.v3.DroppedLabels
        +     *
              * There may be only a single attachment of any given message type in a
              * single exemplar, and this is enforced by the system.
              * 
        @@ -4834,15 +4840,20 @@ public int getAttachmentsCount() { public com.google.protobuf.Any getAttachments(int index) { return attachments_.get(index); } + /** * * *
              * Contextual information about the example value. Examples are:
        -     *   Trace: type.googleapis.com/google.monitoring.v3.SpanContext
        -     *   Literal string: type.googleapis.com/google.protobuf.StringValue
        -     *   Labels dropped during aggregation:
        -     *     type.googleapis.com/google.monitoring.v3.DroppedLabels
        +     *
        +     * Trace: type.googleapis.com/google.monitoring.v3.SpanContext
        +     *
        +     * Literal string: type.googleapis.com/google.protobuf.StringValue
        +     *
        +     * Labels dropped during aggregation:
        +     * type.googleapis.com/google.monitoring.v3.DroppedLabels
        +     *
              * There may be only a single attachment of any given message type in a
              * single exemplar, and this is enforced by the system.
              * 
        @@ -4871,7 +4882,7 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (java.lang.Double.doubleToRawLongBits(value_) != 0) { output.writeDouble(1, value_); } - if (timestamp_ != null) { + if (((bitField0_ & 0x00000001) != 0)) { output.writeMessage(2, getTimestamp()); } for (int i = 0; i < attachments_.size(); i++) { @@ -4889,7 +4900,7 @@ public int getSerializedSize() { if (java.lang.Double.doubleToRawLongBits(value_) != 0) { size += com.google.protobuf.CodedOutputStream.computeDoubleSize(1, value_); } - if (timestamp_ != null) { + if (((bitField0_ & 0x00000001) != 0)) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getTimestamp()); } for (int i = 0; i < attachments_.size(); i++) { @@ -4983,38 +4994,38 @@ public static com.google.api.Distribution.Exemplar parseFrom( public static com.google.api.Distribution.Exemplar parseFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); } public static com.google.api.Distribution.Exemplar parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } public static com.google.api.Distribution.Exemplar parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); } public static com.google.api.Distribution.Exemplar parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( PARSER, input, extensionRegistry); } public static com.google.api.Distribution.Exemplar parseFrom( com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); } public static com.google.api.Distribution.Exemplar parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } @@ -5037,11 +5048,11 @@ public Builder toBuilder() { } @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { Builder builder = new Builder(parent); return builder; } + /** * * @@ -5055,8 +5066,7 @@ protected Builder newBuilderForType( * * Protobuf type {@code google.api.Distribution.Exemplar} */ - public static final class Builder - extends com.google.protobuf.GeneratedMessageV3.Builder + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder implements // @@protoc_insertion_point(builder_implements:google.api.Distribution.Exemplar) com.google.api.Distribution.ExemplarOrBuilder { @@ -5066,7 +5076,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.api.DistributionProto .internal_static_google_api_Distribution_Exemplar_fieldAccessorTable @@ -5076,21 +5086,30 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } // Construct using com.google.api.Distribution.Exemplar.newBuilder() - private Builder() {} + private Builder() { + maybeForceBuilderInitialization(); + } - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetTimestampFieldBuilder(); + internalGetAttachmentsFieldBuilder(); + } } @java.lang.Override public Builder clear() { super.clear(); + bitField0_ = 0; value_ = 0D; - - if (timestampBuilder_ == null) { - timestamp_ = null; - } else { - timestamp_ = null; + timestamp_ = null; + if (timestampBuilder_ != null) { + timestampBuilder_.dispose(); timestampBuilder_ = null; } if (attachmentsBuilder_ == null) { @@ -5099,7 +5118,7 @@ public Builder clear() { attachments_ = null; attachmentsBuilder_.clear(); } - bitField0_ = (bitField0_ & ~0x00000001); + bitField0_ = (bitField0_ & ~0x00000004); return this; } @@ -5127,59 +5146,37 @@ public com.google.api.Distribution.Exemplar build() { public com.google.api.Distribution.Exemplar buildPartial() { com.google.api.Distribution.Exemplar result = new com.google.api.Distribution.Exemplar(this); - int from_bitField0_ = bitField0_; - result.value_ = value_; - if (timestampBuilder_ == null) { - result.timestamp_ = timestamp_; - } else { - result.timestamp_ = timestampBuilder_.build(); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields(com.google.api.Distribution.Exemplar result) { if (attachmentsBuilder_ == null) { - if (((bitField0_ & 0x00000001) != 0)) { + if (((bitField0_ & 0x00000004) != 0)) { attachments_ = java.util.Collections.unmodifiableList(attachments_); - bitField0_ = (bitField0_ & ~0x00000001); + bitField0_ = (bitField0_ & ~0x00000004); } result.attachments_ = attachments_; } else { result.attachments_ = attachmentsBuilder_.build(); } - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.setField(field, value); - } - - @java.lang.Override - public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - - @java.lang.Override - public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, - java.lang.Object value) { - return super.setRepeatedField(field, index, value); } - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.addRepeatedField(field, value); + private void buildPartial0(com.google.api.Distribution.Exemplar result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.value_ = value_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.timestamp_ = timestampBuilder_ == null ? timestamp_ : timestampBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + result.bitField0_ |= to_bitField0_; } @java.lang.Override @@ -5194,7 +5191,7 @@ public Builder mergeFrom(com.google.protobuf.Message other) { public Builder mergeFrom(com.google.api.Distribution.Exemplar other) { if (other == com.google.api.Distribution.Exemplar.getDefaultInstance()) return this; - if (other.getValue() != 0D) { + if (java.lang.Double.doubleToRawLongBits(other.getValue()) != 0) { setValue(other.getValue()); } if (other.hasTimestamp()) { @@ -5204,7 +5201,7 @@ public Builder mergeFrom(com.google.api.Distribution.Exemplar other) { if (!other.attachments_.isEmpty()) { if (attachments_.isEmpty()) { attachments_ = other.attachments_; - bitField0_ = (bitField0_ & ~0x00000001); + bitField0_ = (bitField0_ & ~0x00000004); } else { ensureAttachmentsIsMutable(); attachments_.addAll(other.attachments_); @@ -5217,10 +5214,10 @@ public Builder mergeFrom(com.google.api.Distribution.Exemplar other) { attachmentsBuilder_.dispose(); attachmentsBuilder_ = null; attachments_ = other.attachments_; - bitField0_ = (bitField0_ & ~0x00000001); + bitField0_ = (bitField0_ & ~0x00000004); attachmentsBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders - ? getAttachmentsFieldBuilder() + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders + ? internalGetAttachmentsFieldBuilder() : null; } else { attachmentsBuilder_.addAllMessages(other.attachments_); @@ -5256,13 +5253,14 @@ public Builder mergeFrom( case 9: { value_ = input.readDouble(); - + bitField0_ |= 0x00000001; break; } // case 9 case 18: { - input.readMessage(getTimestampFieldBuilder().getBuilder(), extensionRegistry); - + input.readMessage( + internalGetTimestampFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; break; } // case 18 case 26: @@ -5297,6 +5295,7 @@ public Builder mergeFrom( private int bitField0_; private double value_; + /** * * @@ -5313,6 +5312,7 @@ public Builder mergeFrom( public double getValue() { return value_; } + /** * * @@ -5329,9 +5329,11 @@ public double getValue() { public Builder setValue(double value) { value_ = value; + bitField0_ |= 0x00000001; onChanged(); return this; } + /** * * @@ -5345,18 +5347,19 @@ public Builder setValue(double value) { * @return This builder for chaining. */ public Builder clearValue() { - + bitField0_ = (bitField0_ & ~0x00000001); value_ = 0D; onChanged(); return this; } private com.google.protobuf.Timestamp timestamp_; - private com.google.protobuf.SingleFieldBuilderV3< + private com.google.protobuf.SingleFieldBuilder< com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder> timestampBuilder_; + /** * * @@ -5369,8 +5372,9 @@ public Builder clearValue() { * @return Whether the timestamp field is set. */ public boolean hasTimestamp() { - return timestampBuilder_ != null || timestamp_ != null; + return ((bitField0_ & 0x00000002) != 0); } + /** * * @@ -5391,6 +5395,7 @@ public com.google.protobuf.Timestamp getTimestamp() { return timestampBuilder_.getMessage(); } } + /** * * @@ -5406,13 +5411,14 @@ public Builder setTimestamp(com.google.protobuf.Timestamp value) { throw new NullPointerException(); } timestamp_ = value; - onChanged(); } else { timestampBuilder_.setMessage(value); } - + bitField0_ |= 0x00000002; + onChanged(); return this; } + /** * * @@ -5425,13 +5431,14 @@ public Builder setTimestamp(com.google.protobuf.Timestamp value) { public Builder setTimestamp(com.google.protobuf.Timestamp.Builder builderForValue) { if (timestampBuilder_ == null) { timestamp_ = builderForValue.build(); - onChanged(); } else { timestampBuilder_.setMessage(builderForValue.build()); } - + bitField0_ |= 0x00000002; + onChanged(); return this; } + /** * * @@ -5443,21 +5450,23 @@ public Builder setTimestamp(com.google.protobuf.Timestamp.Builder builderForValu */ public Builder mergeTimestamp(com.google.protobuf.Timestamp value) { if (timestampBuilder_ == null) { - if (timestamp_ != null) { - timestamp_ = - com.google.protobuf.Timestamp.newBuilder(timestamp_) - .mergeFrom(value) - .buildPartial(); + if (((bitField0_ & 0x00000002) != 0) + && timestamp_ != null + && timestamp_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getTimestampBuilder().mergeFrom(value); } else { timestamp_ = value; } - onChanged(); } else { timestampBuilder_.mergeFrom(value); } - + if (timestamp_ != null) { + bitField0_ |= 0x00000002; + onChanged(); + } return this; } + /** * * @@ -5468,16 +5477,16 @@ public Builder mergeTimestamp(com.google.protobuf.Timestamp value) { * .google.protobuf.Timestamp timestamp = 2; */ public Builder clearTimestamp() { - if (timestampBuilder_ == null) { - timestamp_ = null; - onChanged(); - } else { - timestamp_ = null; + bitField0_ = (bitField0_ & ~0x00000002); + timestamp_ = null; + if (timestampBuilder_ != null) { + timestampBuilder_.dispose(); timestampBuilder_ = null; } - + onChanged(); return this; } + /** * * @@ -5488,10 +5497,11 @@ public Builder clearTimestamp() { * .google.protobuf.Timestamp timestamp = 2; */ public com.google.protobuf.Timestamp.Builder getTimestampBuilder() { - + bitField0_ |= 0x00000002; onChanged(); - return getTimestampFieldBuilder().getBuilder(); + return internalGetTimestampFieldBuilder().getBuilder(); } + /** * * @@ -5510,6 +5520,7 @@ public com.google.protobuf.TimestampOrBuilder getTimestampOrBuilder() { : timestamp_; } } + /** * * @@ -5519,14 +5530,14 @@ public com.google.protobuf.TimestampOrBuilder getTimestampOrBuilder() { * * .google.protobuf.Timestamp timestamp = 2; */ - private com.google.protobuf.SingleFieldBuilderV3< + private com.google.protobuf.SingleFieldBuilder< com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder> - getTimestampFieldBuilder() { + internalGetTimestampFieldBuilder() { if (timestampBuilder_ == null) { timestampBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< + new com.google.protobuf.SingleFieldBuilder< com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder>( @@ -5540,13 +5551,13 @@ public com.google.protobuf.TimestampOrBuilder getTimestampOrBuilder() { java.util.Collections.emptyList(); private void ensureAttachmentsIsMutable() { - if (!((bitField0_ & 0x00000001) != 0)) { + if (!((bitField0_ & 0x00000004) != 0)) { attachments_ = new java.util.ArrayList(attachments_); - bitField0_ |= 0x00000001; + bitField0_ |= 0x00000004; } } - private com.google.protobuf.RepeatedFieldBuilderV3< + private com.google.protobuf.RepeatedFieldBuilder< com.google.protobuf.Any, com.google.protobuf.Any.Builder, com.google.protobuf.AnyOrBuilder> @@ -5557,10 +5568,14 @@ private void ensureAttachmentsIsMutable() { * *
                * Contextual information about the example value. Examples are:
        -       *   Trace: type.googleapis.com/google.monitoring.v3.SpanContext
        -       *   Literal string: type.googleapis.com/google.protobuf.StringValue
        -       *   Labels dropped during aggregation:
        -       *     type.googleapis.com/google.monitoring.v3.DroppedLabels
        +       *
        +       * Trace: type.googleapis.com/google.monitoring.v3.SpanContext
        +       *
        +       * Literal string: type.googleapis.com/google.protobuf.StringValue
        +       *
        +       * Labels dropped during aggregation:
        +       * type.googleapis.com/google.monitoring.v3.DroppedLabels
        +       *
                * There may be only a single attachment of any given message type in a
                * single exemplar, and this is enforced by the system.
                * 
        @@ -5574,15 +5589,20 @@ public java.util.List getAttachmentsList() { return attachmentsBuilder_.getMessageList(); } } + /** * * *
                * Contextual information about the example value. Examples are:
        -       *   Trace: type.googleapis.com/google.monitoring.v3.SpanContext
        -       *   Literal string: type.googleapis.com/google.protobuf.StringValue
        -       *   Labels dropped during aggregation:
        -       *     type.googleapis.com/google.monitoring.v3.DroppedLabels
        +       *
        +       * Trace: type.googleapis.com/google.monitoring.v3.SpanContext
        +       *
        +       * Literal string: type.googleapis.com/google.protobuf.StringValue
        +       *
        +       * Labels dropped during aggregation:
        +       * type.googleapis.com/google.monitoring.v3.DroppedLabels
        +       *
                * There may be only a single attachment of any given message type in a
                * single exemplar, and this is enforced by the system.
                * 
        @@ -5596,15 +5616,20 @@ public int getAttachmentsCount() { return attachmentsBuilder_.getCount(); } } + /** * * *
                * Contextual information about the example value. Examples are:
        -       *   Trace: type.googleapis.com/google.monitoring.v3.SpanContext
        -       *   Literal string: type.googleapis.com/google.protobuf.StringValue
        -       *   Labels dropped during aggregation:
        -       *     type.googleapis.com/google.monitoring.v3.DroppedLabels
        +       *
        +       * Trace: type.googleapis.com/google.monitoring.v3.SpanContext
        +       *
        +       * Literal string: type.googleapis.com/google.protobuf.StringValue
        +       *
        +       * Labels dropped during aggregation:
        +       * type.googleapis.com/google.monitoring.v3.DroppedLabels
        +       *
                * There may be only a single attachment of any given message type in a
                * single exemplar, and this is enforced by the system.
                * 
        @@ -5618,15 +5643,20 @@ public com.google.protobuf.Any getAttachments(int index) { return attachmentsBuilder_.getMessage(index); } } + /** * * *
                * Contextual information about the example value. Examples are:
        -       *   Trace: type.googleapis.com/google.monitoring.v3.SpanContext
        -       *   Literal string: type.googleapis.com/google.protobuf.StringValue
        -       *   Labels dropped during aggregation:
        -       *     type.googleapis.com/google.monitoring.v3.DroppedLabels
        +       *
        +       * Trace: type.googleapis.com/google.monitoring.v3.SpanContext
        +       *
        +       * Literal string: type.googleapis.com/google.protobuf.StringValue
        +       *
        +       * Labels dropped during aggregation:
        +       * type.googleapis.com/google.monitoring.v3.DroppedLabels
        +       *
                * There may be only a single attachment of any given message type in a
                * single exemplar, and this is enforced by the system.
                * 
        @@ -5646,15 +5676,20 @@ public Builder setAttachments(int index, com.google.protobuf.Any value) { } return this; } + /** * * *
                * Contextual information about the example value. Examples are:
        -       *   Trace: type.googleapis.com/google.monitoring.v3.SpanContext
        -       *   Literal string: type.googleapis.com/google.protobuf.StringValue
        -       *   Labels dropped during aggregation:
        -       *     type.googleapis.com/google.monitoring.v3.DroppedLabels
        +       *
        +       * Trace: type.googleapis.com/google.monitoring.v3.SpanContext
        +       *
        +       * Literal string: type.googleapis.com/google.protobuf.StringValue
        +       *
        +       * Labels dropped during aggregation:
        +       * type.googleapis.com/google.monitoring.v3.DroppedLabels
        +       *
                * There may be only a single attachment of any given message type in a
                * single exemplar, and this is enforced by the system.
                * 
        @@ -5671,15 +5706,20 @@ public Builder setAttachments(int index, com.google.protobuf.Any.Builder builder } return this; } + /** * * *
                * Contextual information about the example value. Examples are:
        -       *   Trace: type.googleapis.com/google.monitoring.v3.SpanContext
        -       *   Literal string: type.googleapis.com/google.protobuf.StringValue
        -       *   Labels dropped during aggregation:
        -       *     type.googleapis.com/google.monitoring.v3.DroppedLabels
        +       *
        +       * Trace: type.googleapis.com/google.monitoring.v3.SpanContext
        +       *
        +       * Literal string: type.googleapis.com/google.protobuf.StringValue
        +       *
        +       * Labels dropped during aggregation:
        +       * type.googleapis.com/google.monitoring.v3.DroppedLabels
        +       *
                * There may be only a single attachment of any given message type in a
                * single exemplar, and this is enforced by the system.
                * 
        @@ -5699,15 +5739,20 @@ public Builder addAttachments(com.google.protobuf.Any value) { } return this; } + /** * * *
                * Contextual information about the example value. Examples are:
        -       *   Trace: type.googleapis.com/google.monitoring.v3.SpanContext
        -       *   Literal string: type.googleapis.com/google.protobuf.StringValue
        -       *   Labels dropped during aggregation:
        -       *     type.googleapis.com/google.monitoring.v3.DroppedLabels
        +       *
        +       * Trace: type.googleapis.com/google.monitoring.v3.SpanContext
        +       *
        +       * Literal string: type.googleapis.com/google.protobuf.StringValue
        +       *
        +       * Labels dropped during aggregation:
        +       * type.googleapis.com/google.monitoring.v3.DroppedLabels
        +       *
                * There may be only a single attachment of any given message type in a
                * single exemplar, and this is enforced by the system.
                * 
        @@ -5727,15 +5772,20 @@ public Builder addAttachments(int index, com.google.protobuf.Any value) { } return this; } + /** * * *
                * Contextual information about the example value. Examples are:
        -       *   Trace: type.googleapis.com/google.monitoring.v3.SpanContext
        -       *   Literal string: type.googleapis.com/google.protobuf.StringValue
        -       *   Labels dropped during aggregation:
        -       *     type.googleapis.com/google.monitoring.v3.DroppedLabels
        +       *
        +       * Trace: type.googleapis.com/google.monitoring.v3.SpanContext
        +       *
        +       * Literal string: type.googleapis.com/google.protobuf.StringValue
        +       *
        +       * Labels dropped during aggregation:
        +       * type.googleapis.com/google.monitoring.v3.DroppedLabels
        +       *
                * There may be only a single attachment of any given message type in a
                * single exemplar, and this is enforced by the system.
                * 
        @@ -5752,15 +5802,20 @@ public Builder addAttachments(com.google.protobuf.Any.Builder builderForValue) { } return this; } + /** * * *
                * Contextual information about the example value. Examples are:
        -       *   Trace: type.googleapis.com/google.monitoring.v3.SpanContext
        -       *   Literal string: type.googleapis.com/google.protobuf.StringValue
        -       *   Labels dropped during aggregation:
        -       *     type.googleapis.com/google.monitoring.v3.DroppedLabels
        +       *
        +       * Trace: type.googleapis.com/google.monitoring.v3.SpanContext
        +       *
        +       * Literal string: type.googleapis.com/google.protobuf.StringValue
        +       *
        +       * Labels dropped during aggregation:
        +       * type.googleapis.com/google.monitoring.v3.DroppedLabels
        +       *
                * There may be only a single attachment of any given message type in a
                * single exemplar, and this is enforced by the system.
                * 
        @@ -5777,15 +5832,20 @@ public Builder addAttachments(int index, com.google.protobuf.Any.Builder builder } return this; } + /** * * *
                * Contextual information about the example value. Examples are:
        -       *   Trace: type.googleapis.com/google.monitoring.v3.SpanContext
        -       *   Literal string: type.googleapis.com/google.protobuf.StringValue
        -       *   Labels dropped during aggregation:
        -       *     type.googleapis.com/google.monitoring.v3.DroppedLabels
        +       *
        +       * Trace: type.googleapis.com/google.monitoring.v3.SpanContext
        +       *
        +       * Literal string: type.googleapis.com/google.protobuf.StringValue
        +       *
        +       * Labels dropped during aggregation:
        +       * type.googleapis.com/google.monitoring.v3.DroppedLabels
        +       *
                * There may be only a single attachment of any given message type in a
                * single exemplar, and this is enforced by the system.
                * 
        @@ -5803,15 +5863,20 @@ public Builder addAllAttachments( } return this; } + /** * * *
                * Contextual information about the example value. Examples are:
        -       *   Trace: type.googleapis.com/google.monitoring.v3.SpanContext
        -       *   Literal string: type.googleapis.com/google.protobuf.StringValue
        -       *   Labels dropped during aggregation:
        -       *     type.googleapis.com/google.monitoring.v3.DroppedLabels
        +       *
        +       * Trace: type.googleapis.com/google.monitoring.v3.SpanContext
        +       *
        +       * Literal string: type.googleapis.com/google.protobuf.StringValue
        +       *
        +       * Labels dropped during aggregation:
        +       * type.googleapis.com/google.monitoring.v3.DroppedLabels
        +       *
                * There may be only a single attachment of any given message type in a
                * single exemplar, and this is enforced by the system.
                * 
        @@ -5821,22 +5886,27 @@ public Builder addAllAttachments( public Builder clearAttachments() { if (attachmentsBuilder_ == null) { attachments_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); + bitField0_ = (bitField0_ & ~0x00000004); onChanged(); } else { attachmentsBuilder_.clear(); } return this; } + /** * * *
                * Contextual information about the example value. Examples are:
        -       *   Trace: type.googleapis.com/google.monitoring.v3.SpanContext
        -       *   Literal string: type.googleapis.com/google.protobuf.StringValue
        -       *   Labels dropped during aggregation:
        -       *     type.googleapis.com/google.monitoring.v3.DroppedLabels
        +       *
        +       * Trace: type.googleapis.com/google.monitoring.v3.SpanContext
        +       *
        +       * Literal string: type.googleapis.com/google.protobuf.StringValue
        +       *
        +       * Labels dropped during aggregation:
        +       * type.googleapis.com/google.monitoring.v3.DroppedLabels
        +       *
                * There may be only a single attachment of any given message type in a
                * single exemplar, and this is enforced by the system.
                * 
        @@ -5853,15 +5923,20 @@ public Builder removeAttachments(int index) { } return this; } + /** * * *
                * Contextual information about the example value. Examples are:
        -       *   Trace: type.googleapis.com/google.monitoring.v3.SpanContext
        -       *   Literal string: type.googleapis.com/google.protobuf.StringValue
        -       *   Labels dropped during aggregation:
        -       *     type.googleapis.com/google.monitoring.v3.DroppedLabels
        +       *
        +       * Trace: type.googleapis.com/google.monitoring.v3.SpanContext
        +       *
        +       * Literal string: type.googleapis.com/google.protobuf.StringValue
        +       *
        +       * Labels dropped during aggregation:
        +       * type.googleapis.com/google.monitoring.v3.DroppedLabels
        +       *
                * There may be only a single attachment of any given message type in a
                * single exemplar, and this is enforced by the system.
                * 
        @@ -5869,17 +5944,22 @@ public Builder removeAttachments(int index) { * repeated .google.protobuf.Any attachments = 3; */ public com.google.protobuf.Any.Builder getAttachmentsBuilder(int index) { - return getAttachmentsFieldBuilder().getBuilder(index); + return internalGetAttachmentsFieldBuilder().getBuilder(index); } + /** * * *
                * Contextual information about the example value. Examples are:
        -       *   Trace: type.googleapis.com/google.monitoring.v3.SpanContext
        -       *   Literal string: type.googleapis.com/google.protobuf.StringValue
        -       *   Labels dropped during aggregation:
        -       *     type.googleapis.com/google.monitoring.v3.DroppedLabels
        +       *
        +       * Trace: type.googleapis.com/google.monitoring.v3.SpanContext
        +       *
        +       * Literal string: type.googleapis.com/google.protobuf.StringValue
        +       *
        +       * Labels dropped during aggregation:
        +       * type.googleapis.com/google.monitoring.v3.DroppedLabels
        +       *
                * There may be only a single attachment of any given message type in a
                * single exemplar, and this is enforced by the system.
                * 
        @@ -5893,15 +5973,20 @@ public com.google.protobuf.AnyOrBuilder getAttachmentsOrBuilder(int index) { return attachmentsBuilder_.getMessageOrBuilder(index); } } + /** * * *
                * Contextual information about the example value. Examples are:
        -       *   Trace: type.googleapis.com/google.monitoring.v3.SpanContext
        -       *   Literal string: type.googleapis.com/google.protobuf.StringValue
        -       *   Labels dropped during aggregation:
        -       *     type.googleapis.com/google.monitoring.v3.DroppedLabels
        +       *
        +       * Trace: type.googleapis.com/google.monitoring.v3.SpanContext
        +       *
        +       * Literal string: type.googleapis.com/google.protobuf.StringValue
        +       *
        +       * Labels dropped during aggregation:
        +       * type.googleapis.com/google.monitoring.v3.DroppedLabels
        +       *
                * There may be only a single attachment of any given message type in a
                * single exemplar, and this is enforced by the system.
                * 
        @@ -5916,15 +6001,20 @@ public com.google.protobuf.AnyOrBuilder getAttachmentsOrBuilder(int index) { return java.util.Collections.unmodifiableList(attachments_); } } + /** * * *
                * Contextual information about the example value. Examples are:
        -       *   Trace: type.googleapis.com/google.monitoring.v3.SpanContext
        -       *   Literal string: type.googleapis.com/google.protobuf.StringValue
        -       *   Labels dropped during aggregation:
        -       *     type.googleapis.com/google.monitoring.v3.DroppedLabels
        +       *
        +       * Trace: type.googleapis.com/google.monitoring.v3.SpanContext
        +       *
        +       * Literal string: type.googleapis.com/google.protobuf.StringValue
        +       *
        +       * Labels dropped during aggregation:
        +       * type.googleapis.com/google.monitoring.v3.DroppedLabels
        +       *
                * There may be only a single attachment of any given message type in a
                * single exemplar, and this is enforced by the system.
                * 
        @@ -5932,18 +6022,23 @@ public com.google.protobuf.AnyOrBuilder getAttachmentsOrBuilder(int index) { * repeated .google.protobuf.Any attachments = 3; */ public com.google.protobuf.Any.Builder addAttachmentsBuilder() { - return getAttachmentsFieldBuilder() + return internalGetAttachmentsFieldBuilder() .addBuilder(com.google.protobuf.Any.getDefaultInstance()); } + /** * * *
                * Contextual information about the example value. Examples are:
        -       *   Trace: type.googleapis.com/google.monitoring.v3.SpanContext
        -       *   Literal string: type.googleapis.com/google.protobuf.StringValue
        -       *   Labels dropped during aggregation:
        -       *     type.googleapis.com/google.monitoring.v3.DroppedLabels
        +       *
        +       * Trace: type.googleapis.com/google.monitoring.v3.SpanContext
        +       *
        +       * Literal string: type.googleapis.com/google.protobuf.StringValue
        +       *
        +       * Labels dropped during aggregation:
        +       * type.googleapis.com/google.monitoring.v3.DroppedLabels
        +       *
                * There may be only a single attachment of any given message type in a
                * single exemplar, and this is enforced by the system.
                * 
        @@ -5951,18 +6046,23 @@ public com.google.protobuf.Any.Builder addAttachmentsBuilder() { * repeated .google.protobuf.Any attachments = 3; */ public com.google.protobuf.Any.Builder addAttachmentsBuilder(int index) { - return getAttachmentsFieldBuilder() + return internalGetAttachmentsFieldBuilder() .addBuilder(index, com.google.protobuf.Any.getDefaultInstance()); } + /** * * *
                * Contextual information about the example value. Examples are:
        -       *   Trace: type.googleapis.com/google.monitoring.v3.SpanContext
        -       *   Literal string: type.googleapis.com/google.protobuf.StringValue
        -       *   Labels dropped during aggregation:
        -       *     type.googleapis.com/google.monitoring.v3.DroppedLabels
        +       *
        +       * Trace: type.googleapis.com/google.monitoring.v3.SpanContext
        +       *
        +       * Literal string: type.googleapis.com/google.protobuf.StringValue
        +       *
        +       * Labels dropped during aggregation:
        +       * type.googleapis.com/google.monitoring.v3.DroppedLabels
        +       *
                * There may be only a single attachment of any given message type in a
                * single exemplar, and this is enforced by the system.
                * 
        @@ -5970,22 +6070,22 @@ public com.google.protobuf.Any.Builder addAttachmentsBuilder(int index) { * repeated .google.protobuf.Any attachments = 3; */ public java.util.List getAttachmentsBuilderList() { - return getAttachmentsFieldBuilder().getBuilderList(); + return internalGetAttachmentsFieldBuilder().getBuilderList(); } - private com.google.protobuf.RepeatedFieldBuilderV3< + private com.google.protobuf.RepeatedFieldBuilder< com.google.protobuf.Any, com.google.protobuf.Any.Builder, com.google.protobuf.AnyOrBuilder> - getAttachmentsFieldBuilder() { + internalGetAttachmentsFieldBuilder() { if (attachmentsBuilder_ == null) { attachmentsBuilder_ = - new com.google.protobuf.RepeatedFieldBuilderV3< + new com.google.protobuf.RepeatedFieldBuilder< com.google.protobuf.Any, com.google.protobuf.Any.Builder, com.google.protobuf.AnyOrBuilder>( attachments_, - ((bitField0_ & 0x00000001) != 0), + ((bitField0_ & 0x00000004) != 0), getParentForChildren(), isClean()); attachments_ = null; @@ -5993,18 +6093,6 @@ public java.util.List getAttachmentsBuilderList return attachmentsBuilder_; } - @java.lang.Override - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - // @@protoc_insertion_point(builder_scope:google.api.Distribution.Exemplar) } @@ -6057,8 +6145,10 @@ public com.google.api.Distribution.Exemplar getDefaultInstanceForType() { } } + private int bitField0_; public static final int COUNT_FIELD_NUMBER = 1; - private long count_; + private long count_ = 0L; + /** * * @@ -6078,7 +6168,8 @@ public long getCount() { } public static final int MEAN_FIELD_NUMBER = 2; - private double mean_; + private double mean_ = 0D; + /** * * @@ -6097,16 +6188,20 @@ public double getMean() { } public static final int SUM_OF_SQUARED_DEVIATION_FIELD_NUMBER = 3; - private double sumOfSquaredDeviation_; + private double sumOfSquaredDeviation_ = 0D; + /** * * *
            * The sum of squared deviations from the mean of the values in the
            * population. For values x_i this is:
        -   *     Sum[i=1..n]((x_i - mean)^2)
        +   *
        +   * Sum[i=1..n]((x_i - mean)^2)
        +   *
            * Knuth, "The Art of Computer Programming", Vol. 2, page 232, 3rd edition
            * describes Welford's method for accumulating this sum in one pass.
        +   *
            * If `count` is zero then this field must be zero.
            * 
        * @@ -6121,6 +6216,7 @@ public double getSumOfSquaredDeviation() { public static final int RANGE_FIELD_NUMBER = 4; private com.google.api.Distribution.Range range_; + /** * * @@ -6135,8 +6231,9 @@ public double getSumOfSquaredDeviation() { */ @java.lang.Override public boolean hasRange() { - return range_ != null; + return ((bitField0_ & 0x00000001) != 0); } + /** * * @@ -6153,6 +6250,7 @@ public boolean hasRange() { public com.google.api.Distribution.Range getRange() { return range_ == null ? com.google.api.Distribution.Range.getDefaultInstance() : range_; } + /** * * @@ -6165,11 +6263,12 @@ public com.google.api.Distribution.Range getRange() { */ @java.lang.Override public com.google.api.Distribution.RangeOrBuilder getRangeOrBuilder() { - return getRange(); + return range_ == null ? com.google.api.Distribution.Range.getDefaultInstance() : range_; } public static final int BUCKET_OPTIONS_FIELD_NUMBER = 6; private com.google.api.Distribution.BucketOptions bucketOptions_; + /** * * @@ -6184,8 +6283,9 @@ public com.google.api.Distribution.RangeOrBuilder getRangeOrBuilder() { */ @java.lang.Override public boolean hasBucketOptions() { - return bucketOptions_ != null; + return ((bitField0_ & 0x00000002) != 0); } + /** * * @@ -6204,6 +6304,7 @@ public com.google.api.Distribution.BucketOptions getBucketOptions() { ? com.google.api.Distribution.BucketOptions.getDefaultInstance() : bucketOptions_; } + /** * * @@ -6216,11 +6317,16 @@ public com.google.api.Distribution.BucketOptions getBucketOptions() { */ @java.lang.Override public com.google.api.Distribution.BucketOptionsOrBuilder getBucketOptionsOrBuilder() { - return getBucketOptions(); + return bucketOptions_ == null + ? com.google.api.Distribution.BucketOptions.getDefaultInstance() + : bucketOptions_; } public static final int BUCKET_COUNTS_FIELD_NUMBER = 7; - private com.google.protobuf.Internal.LongList bucketCounts_; + + @SuppressWarnings("serial") + private com.google.protobuf.Internal.LongList bucketCounts_ = emptyLongList(); + /** * * @@ -6230,9 +6336,11 @@ public com.google.api.Distribution.BucketOptionsOrBuilder getBucketOptionsOrBuil * this field. If there is a histogram, then the sum of the values in * `bucket_counts` must equal the value in the `count` field of the * distribution. + * * If present, `bucket_counts` should contain N values, where N is the number * of buckets specified in `bucket_options`. If you supply fewer than N * values, the remaining values are assumed to be 0. + * * The order of the values in `bucket_counts` follows the bucket numbering * schemes described for the three bucket types. The first value must be the * count for the underflow bucket (number 0). The next N-2 values are the @@ -6248,6 +6356,7 @@ public com.google.api.Distribution.BucketOptionsOrBuilder getBucketOptionsOrBuil public java.util.List getBucketCountsList() { return bucketCounts_; } + /** * * @@ -6257,9 +6366,11 @@ public java.util.List getBucketCountsList() { * this field. If there is a histogram, then the sum of the values in * `bucket_counts` must equal the value in the `count` field of the * distribution. + * * If present, `bucket_counts` should contain N values, where N is the number * of buckets specified in `bucket_options`. If you supply fewer than N * values, the remaining values are assumed to be 0. + * * The order of the values in `bucket_counts` follows the bucket numbering * schemes described for the three bucket types. The first value must be the * count for the underflow bucket (number 0). The next N-2 values are the @@ -6274,6 +6385,7 @@ public java.util.List getBucketCountsList() { public int getBucketCountsCount() { return bucketCounts_.size(); } + /** * * @@ -6283,9 +6395,11 @@ public int getBucketCountsCount() { * this field. If there is a histogram, then the sum of the values in * `bucket_counts` must equal the value in the `count` field of the * distribution. + * * If present, `bucket_counts` should contain N values, where N is the number * of buckets specified in `bucket_options`. If you supply fewer than N * values, the remaining values are assumed to be 0. + * * The order of the values in `bucket_counts` follows the bucket numbering * schemes described for the three bucket types. The first value must be the * count for the underflow bucket (number 0). The next N-2 values are the @@ -6305,7 +6419,10 @@ public long getBucketCounts(int index) { private int bucketCountsMemoizedSerializedSize = -1; public static final int EXEMPLARS_FIELD_NUMBER = 10; + + @SuppressWarnings("serial") private java.util.List exemplars_; + /** * * @@ -6319,6 +6436,7 @@ public long getBucketCounts(int index) { public java.util.List getExemplarsList() { return exemplars_; } + /** * * @@ -6333,6 +6451,7 @@ public java.util.List getExemplarsList() { getExemplarsOrBuilderList() { return exemplars_; } + /** * * @@ -6346,6 +6465,7 @@ public java.util.List getExemplarsList() { public int getExemplarsCount() { return exemplars_.size(); } + /** * * @@ -6359,6 +6479,7 @@ public int getExemplarsCount() { public com.google.api.Distribution.Exemplar getExemplars(int index) { return exemplars_.get(index); } + /** * * @@ -6397,10 +6518,10 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (java.lang.Double.doubleToRawLongBits(sumOfSquaredDeviation_) != 0) { output.writeDouble(3, sumOfSquaredDeviation_); } - if (range_ != null) { + if (((bitField0_ & 0x00000001) != 0)) { output.writeMessage(4, getRange()); } - if (bucketOptions_ != null) { + if (((bitField0_ & 0x00000002) != 0)) { output.writeMessage(6, getBucketOptions()); } if (getBucketCountsList().size() > 0) { @@ -6431,10 +6552,10 @@ public int getSerializedSize() { if (java.lang.Double.doubleToRawLongBits(sumOfSquaredDeviation_) != 0) { size += com.google.protobuf.CodedOutputStream.computeDoubleSize(3, sumOfSquaredDeviation_); } - if (range_ != null) { + if (((bitField0_ & 0x00000001) != 0)) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, getRange()); } - if (bucketOptions_ != null) { + if (((bitField0_ & 0x00000002) != 0)) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(6, getBucketOptions()); } { @@ -6562,38 +6683,38 @@ public static com.google.api.Distribution parseFrom( public static com.google.api.Distribution parseFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); } public static com.google.api.Distribution parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } public static com.google.api.Distribution parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); } public static com.google.api.Distribution parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( PARSER, input, extensionRegistry); } public static com.google.api.Distribution parseFrom(com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); } public static com.google.api.Distribution parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } @@ -6616,10 +6737,11 @@ public Builder toBuilder() { } @java.lang.Override - protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { Builder builder = new Builder(parent); return builder; } + /** * * @@ -6627,12 +6749,14 @@ protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.Build * `Distribution` contains summary statistics for a population of values. It * optionally contains a histogram representing the distribution of those values * across a set of buckets. + * * The summary statistics are the count, mean, sum of the squared deviation from * the mean, the minimum, and the maximum of the set of population of values. * The histogram is based on a sequence of buckets and gives a count of values * that fall into each bucket. The boundaries of the buckets are given either * explicitly or by formulas for buckets of fixed or exponentially increasing * widths. + * * Although it is not forbidden, it is generally a bad idea to include * non-finite values (infinities or NaNs) in the population of values, as this * will render the `mean` and `sum_of_squared_deviation` fields meaningless. @@ -6640,7 +6764,7 @@ protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.Build * * Protobuf type {@code google.api.Distribution} */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder implements // @@protoc_insertion_point(builder_implements:google.api.Distribution) com.google.api.DistributionOrBuilder { @@ -6649,7 +6773,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.api.DistributionProto .internal_static_google_api_Distribution_fieldAccessorTable @@ -6658,42 +6782,48 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } // Construct using com.google.api.Distribution.newBuilder() - private Builder() {} + private Builder() { + maybeForceBuilderInitialization(); + } - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetRangeFieldBuilder(); + internalGetBucketOptionsFieldBuilder(); + internalGetExemplarsFieldBuilder(); + } } @java.lang.Override public Builder clear() { super.clear(); + bitField0_ = 0; count_ = 0L; - mean_ = 0D; - sumOfSquaredDeviation_ = 0D; - - if (rangeBuilder_ == null) { - range_ = null; - } else { - range_ = null; + range_ = null; + if (rangeBuilder_ != null) { + rangeBuilder_.dispose(); rangeBuilder_ = null; } - if (bucketOptionsBuilder_ == null) { - bucketOptions_ = null; - } else { - bucketOptions_ = null; + bucketOptions_ = null; + if (bucketOptionsBuilder_ != null) { + bucketOptionsBuilder_.dispose(); bucketOptionsBuilder_ = null; } bucketCounts_ = emptyLongList(); - bitField0_ = (bitField0_ & ~0x00000001); if (exemplarsBuilder_ == null) { exemplars_ = java.util.Collections.emptyList(); } else { exemplars_ = null; exemplarsBuilder_.clear(); } - bitField0_ = (bitField0_ & ~0x00000002); + bitField0_ = (bitField0_ & ~0x00000040); return this; } @@ -6719,69 +6849,52 @@ public com.google.api.Distribution build() { @java.lang.Override public com.google.api.Distribution buildPartial() { com.google.api.Distribution result = new com.google.api.Distribution(this); - int from_bitField0_ = bitField0_; - result.count_ = count_; - result.mean_ = mean_; - result.sumOfSquaredDeviation_ = sumOfSquaredDeviation_; - if (rangeBuilder_ == null) { - result.range_ = range_; - } else { - result.range_ = rangeBuilder_.build(); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); } - if (bucketOptionsBuilder_ == null) { - result.bucketOptions_ = bucketOptions_; - } else { - result.bucketOptions_ = bucketOptionsBuilder_.build(); - } - if (((bitField0_ & 0x00000001) != 0)) { - bucketCounts_.makeImmutable(); - bitField0_ = (bitField0_ & ~0x00000001); - } - result.bucketCounts_ = bucketCounts_; + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields(com.google.api.Distribution result) { if (exemplarsBuilder_ == null) { - if (((bitField0_ & 0x00000002) != 0)) { + if (((bitField0_ & 0x00000040) != 0)) { exemplars_ = java.util.Collections.unmodifiableList(exemplars_); - bitField0_ = (bitField0_ & ~0x00000002); + bitField0_ = (bitField0_ & ~0x00000040); } result.exemplars_ = exemplars_; } else { result.exemplars_ = exemplarsBuilder_.build(); } - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.setField(field, value); - } - - @java.lang.Override - public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - - @java.lang.Override - public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); } - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.addRepeatedField(field, value); + private void buildPartial0(com.google.api.Distribution result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.count_ = count_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.mean_ = mean_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.sumOfSquaredDeviation_ = sumOfSquaredDeviation_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000008) != 0)) { + result.range_ = rangeBuilder_ == null ? range_ : rangeBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.bucketOptions_ = + bucketOptionsBuilder_ == null ? bucketOptions_ : bucketOptionsBuilder_.build(); + to_bitField0_ |= 0x00000002; + } + if (((from_bitField0_ & 0x00000020) != 0)) { + bucketCounts_.makeImmutable(); + result.bucketCounts_ = bucketCounts_; + } + result.bitField0_ |= to_bitField0_; } @java.lang.Override @@ -6799,10 +6912,10 @@ public Builder mergeFrom(com.google.api.Distribution other) { if (other.getCount() != 0L) { setCount(other.getCount()); } - if (other.getMean() != 0D) { + if (java.lang.Double.doubleToRawLongBits(other.getMean()) != 0) { setMean(other.getMean()); } - if (other.getSumOfSquaredDeviation() != 0D) { + if (java.lang.Double.doubleToRawLongBits(other.getSumOfSquaredDeviation()) != 0) { setSumOfSquaredDeviation(other.getSumOfSquaredDeviation()); } if (other.hasRange()) { @@ -6814,7 +6927,8 @@ public Builder mergeFrom(com.google.api.Distribution other) { if (!other.bucketCounts_.isEmpty()) { if (bucketCounts_.isEmpty()) { bucketCounts_ = other.bucketCounts_; - bitField0_ = (bitField0_ & ~0x00000001); + bucketCounts_.makeImmutable(); + bitField0_ |= 0x00000020; } else { ensureBucketCountsIsMutable(); bucketCounts_.addAll(other.bucketCounts_); @@ -6825,7 +6939,7 @@ public Builder mergeFrom(com.google.api.Distribution other) { if (!other.exemplars_.isEmpty()) { if (exemplars_.isEmpty()) { exemplars_ = other.exemplars_; - bitField0_ = (bitField0_ & ~0x00000002); + bitField0_ = (bitField0_ & ~0x00000040); } else { ensureExemplarsIsMutable(); exemplars_.addAll(other.exemplars_); @@ -6838,10 +6952,10 @@ public Builder mergeFrom(com.google.api.Distribution other) { exemplarsBuilder_.dispose(); exemplarsBuilder_ = null; exemplars_ = other.exemplars_; - bitField0_ = (bitField0_ & ~0x00000002); + bitField0_ = (bitField0_ & ~0x00000040); exemplarsBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders - ? getExemplarsFieldBuilder() + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders + ? internalGetExemplarsFieldBuilder() : null; } else { exemplarsBuilder_.addAllMessages(other.exemplars_); @@ -6877,31 +6991,32 @@ public Builder mergeFrom( case 8: { count_ = input.readInt64(); - + bitField0_ |= 0x00000001; break; } // case 8 case 17: { mean_ = input.readDouble(); - + bitField0_ |= 0x00000002; break; } // case 17 case 25: { sumOfSquaredDeviation_ = input.readDouble(); - + bitField0_ |= 0x00000004; break; } // case 25 case 34: { - input.readMessage(getRangeFieldBuilder().getBuilder(), extensionRegistry); - + input.readMessage(internalGetRangeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000008; break; } // case 34 case 50: { - input.readMessage(getBucketOptionsFieldBuilder().getBuilder(), extensionRegistry); - + input.readMessage( + internalGetBucketOptionsFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000010; break; } // case 50 case 56: @@ -6955,6 +7070,7 @@ public Builder mergeFrom( private int bitField0_; private long count_; + /** * * @@ -6972,6 +7088,7 @@ public Builder mergeFrom( public long getCount() { return count_; } + /** * * @@ -6989,9 +7106,11 @@ public long getCount() { public Builder setCount(long value) { count_ = value; + bitField0_ |= 0x00000001; onChanged(); return this; } + /** * * @@ -7006,13 +7125,14 @@ public Builder setCount(long value) { * @return This builder for chaining. */ public Builder clearCount() { - + bitField0_ = (bitField0_ & ~0x00000001); count_ = 0L; onChanged(); return this; } private double mean_; + /** * * @@ -7029,6 +7149,7 @@ public Builder clearCount() { public double getMean() { return mean_; } + /** * * @@ -7045,9 +7166,11 @@ public double getMean() { public Builder setMean(double value) { mean_ = value; + bitField0_ |= 0x00000002; onChanged(); return this; } + /** * * @@ -7061,22 +7184,26 @@ public Builder setMean(double value) { * @return This builder for chaining. */ public Builder clearMean() { - + bitField0_ = (bitField0_ & ~0x00000002); mean_ = 0D; onChanged(); return this; } private double sumOfSquaredDeviation_; + /** * * *
              * The sum of squared deviations from the mean of the values in the
              * population. For values x_i this is:
        -     *     Sum[i=1..n]((x_i - mean)^2)
        +     *
        +     * Sum[i=1..n]((x_i - mean)^2)
        +     *
              * Knuth, "The Art of Computer Programming", Vol. 2, page 232, 3rd edition
              * describes Welford's method for accumulating this sum in one pass.
        +     *
              * If `count` is zero then this field must be zero.
              * 
        * @@ -7088,15 +7215,19 @@ public Builder clearMean() { public double getSumOfSquaredDeviation() { return sumOfSquaredDeviation_; } + /** * * *
              * The sum of squared deviations from the mean of the values in the
              * population. For values x_i this is:
        -     *     Sum[i=1..n]((x_i - mean)^2)
        +     *
        +     * Sum[i=1..n]((x_i - mean)^2)
        +     *
              * Knuth, "The Art of Computer Programming", Vol. 2, page 232, 3rd edition
              * describes Welford's method for accumulating this sum in one pass.
        +     *
              * If `count` is zero then this field must be zero.
              * 
        * @@ -7108,18 +7239,23 @@ public double getSumOfSquaredDeviation() { public Builder setSumOfSquaredDeviation(double value) { sumOfSquaredDeviation_ = value; + bitField0_ |= 0x00000004; onChanged(); return this; } + /** * * *
              * The sum of squared deviations from the mean of the values in the
              * population. For values x_i this is:
        -     *     Sum[i=1..n]((x_i - mean)^2)
        +     *
        +     * Sum[i=1..n]((x_i - mean)^2)
        +     *
              * Knuth, "The Art of Computer Programming", Vol. 2, page 232, 3rd edition
              * describes Welford's method for accumulating this sum in one pass.
        +     *
              * If `count` is zero then this field must be zero.
              * 
        * @@ -7128,18 +7264,19 @@ public Builder setSumOfSquaredDeviation(double value) { * @return This builder for chaining. */ public Builder clearSumOfSquaredDeviation() { - + bitField0_ = (bitField0_ & ~0x00000004); sumOfSquaredDeviation_ = 0D; onChanged(); return this; } private com.google.api.Distribution.Range range_; - private com.google.protobuf.SingleFieldBuilderV3< + private com.google.protobuf.SingleFieldBuilder< com.google.api.Distribution.Range, com.google.api.Distribution.Range.Builder, com.google.api.Distribution.RangeOrBuilder> rangeBuilder_; + /** * * @@ -7153,8 +7290,9 @@ public Builder clearSumOfSquaredDeviation() { * @return Whether the range field is set. */ public boolean hasRange() { - return rangeBuilder_ != null || range_ != null; + return ((bitField0_ & 0x00000008) != 0); } + /** * * @@ -7174,6 +7312,7 @@ public com.google.api.Distribution.Range getRange() { return rangeBuilder_.getMessage(); } } + /** * * @@ -7190,13 +7329,14 @@ public Builder setRange(com.google.api.Distribution.Range value) { throw new NullPointerException(); } range_ = value; - onChanged(); } else { rangeBuilder_.setMessage(value); } - + bitField0_ |= 0x00000008; + onChanged(); return this; } + /** * * @@ -7210,13 +7350,14 @@ public Builder setRange(com.google.api.Distribution.Range value) { public Builder setRange(com.google.api.Distribution.Range.Builder builderForValue) { if (rangeBuilder_ == null) { range_ = builderForValue.build(); - onChanged(); } else { rangeBuilder_.setMessage(builderForValue.build()); } - + bitField0_ |= 0x00000008; + onChanged(); return this; } + /** * * @@ -7229,19 +7370,23 @@ public Builder setRange(com.google.api.Distribution.Range.Builder builderForValu */ public Builder mergeRange(com.google.api.Distribution.Range value) { if (rangeBuilder_ == null) { - if (range_ != null) { - range_ = - com.google.api.Distribution.Range.newBuilder(range_).mergeFrom(value).buildPartial(); + if (((bitField0_ & 0x00000008) != 0) + && range_ != null + && range_ != com.google.api.Distribution.Range.getDefaultInstance()) { + getRangeBuilder().mergeFrom(value); } else { range_ = value; } - onChanged(); } else { rangeBuilder_.mergeFrom(value); } - + if (range_ != null) { + bitField0_ |= 0x00000008; + onChanged(); + } return this; } + /** * * @@ -7253,16 +7398,16 @@ public Builder mergeRange(com.google.api.Distribution.Range value) { * .google.api.Distribution.Range range = 4; */ public Builder clearRange() { - if (rangeBuilder_ == null) { - range_ = null; - onChanged(); - } else { - range_ = null; + bitField0_ = (bitField0_ & ~0x00000008); + range_ = null; + if (rangeBuilder_ != null) { + rangeBuilder_.dispose(); rangeBuilder_ = null; } - + onChanged(); return this; } + /** * * @@ -7274,10 +7419,11 @@ public Builder clearRange() { * .google.api.Distribution.Range range = 4; */ public com.google.api.Distribution.Range.Builder getRangeBuilder() { - + bitField0_ |= 0x00000008; onChanged(); - return getRangeFieldBuilder().getBuilder(); + return internalGetRangeFieldBuilder().getBuilder(); } + /** * * @@ -7295,6 +7441,7 @@ public com.google.api.Distribution.RangeOrBuilder getRangeOrBuilder() { return range_ == null ? com.google.api.Distribution.Range.getDefaultInstance() : range_; } } + /** * * @@ -7305,14 +7452,14 @@ public com.google.api.Distribution.RangeOrBuilder getRangeOrBuilder() { * * .google.api.Distribution.Range range = 4; */ - private com.google.protobuf.SingleFieldBuilderV3< + private com.google.protobuf.SingleFieldBuilder< com.google.api.Distribution.Range, com.google.api.Distribution.Range.Builder, com.google.api.Distribution.RangeOrBuilder> - getRangeFieldBuilder() { + internalGetRangeFieldBuilder() { if (rangeBuilder_ == null) { rangeBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< + new com.google.protobuf.SingleFieldBuilder< com.google.api.Distribution.Range, com.google.api.Distribution.Range.Builder, com.google.api.Distribution.RangeOrBuilder>( @@ -7323,11 +7470,12 @@ public com.google.api.Distribution.RangeOrBuilder getRangeOrBuilder() { } private com.google.api.Distribution.BucketOptions bucketOptions_; - private com.google.protobuf.SingleFieldBuilderV3< + private com.google.protobuf.SingleFieldBuilder< com.google.api.Distribution.BucketOptions, com.google.api.Distribution.BucketOptions.Builder, com.google.api.Distribution.BucketOptionsOrBuilder> bucketOptionsBuilder_; + /** * * @@ -7341,8 +7489,9 @@ public com.google.api.Distribution.RangeOrBuilder getRangeOrBuilder() { * @return Whether the bucketOptions field is set. */ public boolean hasBucketOptions() { - return bucketOptionsBuilder_ != null || bucketOptions_ != null; + return ((bitField0_ & 0x00000010) != 0); } + /** * * @@ -7364,6 +7513,7 @@ public com.google.api.Distribution.BucketOptions getBucketOptions() { return bucketOptionsBuilder_.getMessage(); } } + /** * * @@ -7380,13 +7530,14 @@ public Builder setBucketOptions(com.google.api.Distribution.BucketOptions value) throw new NullPointerException(); } bucketOptions_ = value; - onChanged(); } else { bucketOptionsBuilder_.setMessage(value); } - + bitField0_ |= 0x00000010; + onChanged(); return this; } + /** * * @@ -7401,13 +7552,14 @@ public Builder setBucketOptions( com.google.api.Distribution.BucketOptions.Builder builderForValue) { if (bucketOptionsBuilder_ == null) { bucketOptions_ = builderForValue.build(); - onChanged(); } else { bucketOptionsBuilder_.setMessage(builderForValue.build()); } - + bitField0_ |= 0x00000010; + onChanged(); return this; } + /** * * @@ -7420,21 +7572,23 @@ public Builder setBucketOptions( */ public Builder mergeBucketOptions(com.google.api.Distribution.BucketOptions value) { if (bucketOptionsBuilder_ == null) { - if (bucketOptions_ != null) { - bucketOptions_ = - com.google.api.Distribution.BucketOptions.newBuilder(bucketOptions_) - .mergeFrom(value) - .buildPartial(); + if (((bitField0_ & 0x00000010) != 0) + && bucketOptions_ != null + && bucketOptions_ != com.google.api.Distribution.BucketOptions.getDefaultInstance()) { + getBucketOptionsBuilder().mergeFrom(value); } else { bucketOptions_ = value; } - onChanged(); } else { bucketOptionsBuilder_.mergeFrom(value); } - + if (bucketOptions_ != null) { + bitField0_ |= 0x00000010; + onChanged(); + } return this; } + /** * * @@ -7446,16 +7600,16 @@ public Builder mergeBucketOptions(com.google.api.Distribution.BucketOptions valu * .google.api.Distribution.BucketOptions bucket_options = 6; */ public Builder clearBucketOptions() { - if (bucketOptionsBuilder_ == null) { - bucketOptions_ = null; - onChanged(); - } else { - bucketOptions_ = null; + bitField0_ = (bitField0_ & ~0x00000010); + bucketOptions_ = null; + if (bucketOptionsBuilder_ != null) { + bucketOptionsBuilder_.dispose(); bucketOptionsBuilder_ = null; } - + onChanged(); return this; } + /** * * @@ -7467,10 +7621,11 @@ public Builder clearBucketOptions() { * .google.api.Distribution.BucketOptions bucket_options = 6; */ public com.google.api.Distribution.BucketOptions.Builder getBucketOptionsBuilder() { - + bitField0_ |= 0x00000010; onChanged(); - return getBucketOptionsFieldBuilder().getBuilder(); + return internalGetBucketOptionsFieldBuilder().getBuilder(); } + /** * * @@ -7490,6 +7645,7 @@ public com.google.api.Distribution.BucketOptionsOrBuilder getBucketOptionsOrBuil : bucketOptions_; } } + /** * * @@ -7500,14 +7656,14 @@ public com.google.api.Distribution.BucketOptionsOrBuilder getBucketOptionsOrBuil * * .google.api.Distribution.BucketOptions bucket_options = 6; */ - private com.google.protobuf.SingleFieldBuilderV3< + private com.google.protobuf.SingleFieldBuilder< com.google.api.Distribution.BucketOptions, com.google.api.Distribution.BucketOptions.Builder, com.google.api.Distribution.BucketOptionsOrBuilder> - getBucketOptionsFieldBuilder() { + internalGetBucketOptionsFieldBuilder() { if (bucketOptionsBuilder_ == null) { bucketOptionsBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< + new com.google.protobuf.SingleFieldBuilder< com.google.api.Distribution.BucketOptions, com.google.api.Distribution.BucketOptions.Builder, com.google.api.Distribution.BucketOptionsOrBuilder>( @@ -7520,11 +7676,12 @@ public com.google.api.Distribution.BucketOptionsOrBuilder getBucketOptionsOrBuil private com.google.protobuf.Internal.LongList bucketCounts_ = emptyLongList(); private void ensureBucketCountsIsMutable() { - if (!((bitField0_ & 0x00000001) != 0)) { - bucketCounts_ = mutableCopy(bucketCounts_); - bitField0_ |= 0x00000001; + if (!bucketCounts_.isModifiable()) { + bucketCounts_ = makeMutableCopy(bucketCounts_); } + bitField0_ |= 0x00000020; } + /** * * @@ -7534,9 +7691,11 @@ private void ensureBucketCountsIsMutable() { * this field. If there is a histogram, then the sum of the values in * `bucket_counts` must equal the value in the `count` field of the * distribution. + * * If present, `bucket_counts` should contain N values, where N is the number * of buckets specified in `bucket_options`. If you supply fewer than N * values, the remaining values are assumed to be 0. + * * The order of the values in `bucket_counts` follows the bucket numbering * schemes described for the three bucket types. The first value must be the * count for the underflow bucket (number 0). The next N-2 values are the @@ -7549,10 +7708,10 @@ private void ensureBucketCountsIsMutable() { * @return A list containing the bucketCounts. */ public java.util.List getBucketCountsList() { - return ((bitField0_ & 0x00000001) != 0) - ? java.util.Collections.unmodifiableList(bucketCounts_) - : bucketCounts_; + bucketCounts_.makeImmutable(); + return bucketCounts_; } + /** * * @@ -7562,9 +7721,11 @@ public java.util.List getBucketCountsList() { * this field. If there is a histogram, then the sum of the values in * `bucket_counts` must equal the value in the `count` field of the * distribution. + * * If present, `bucket_counts` should contain N values, where N is the number * of buckets specified in `bucket_options`. If you supply fewer than N * values, the remaining values are assumed to be 0. + * * The order of the values in `bucket_counts` follows the bucket numbering * schemes described for the three bucket types. The first value must be the * count for the underflow bucket (number 0). The next N-2 values are the @@ -7579,6 +7740,7 @@ public java.util.List getBucketCountsList() { public int getBucketCountsCount() { return bucketCounts_.size(); } + /** * * @@ -7588,9 +7750,11 @@ public int getBucketCountsCount() { * this field. If there is a histogram, then the sum of the values in * `bucket_counts` must equal the value in the `count` field of the * distribution. + * * If present, `bucket_counts` should contain N values, where N is the number * of buckets specified in `bucket_options`. If you supply fewer than N * values, the remaining values are assumed to be 0. + * * The order of the values in `bucket_counts` follows the bucket numbering * schemes described for the three bucket types. The first value must be the * count for the underflow bucket (number 0). The next N-2 values are the @@ -7606,6 +7770,7 @@ public int getBucketCountsCount() { public long getBucketCounts(int index) { return bucketCounts_.getLong(index); } + /** * * @@ -7615,9 +7780,11 @@ public long getBucketCounts(int index) { * this field. If there is a histogram, then the sum of the values in * `bucket_counts` must equal the value in the `count` field of the * distribution. + * * If present, `bucket_counts` should contain N values, where N is the number * of buckets specified in `bucket_options`. If you supply fewer than N * values, the remaining values are assumed to be 0. + * * The order of the values in `bucket_counts` follows the bucket numbering * schemes described for the three bucket types. The first value must be the * count for the underflow bucket (number 0). The next N-2 values are the @@ -7632,11 +7799,14 @@ public long getBucketCounts(int index) { * @return This builder for chaining. */ public Builder setBucketCounts(int index, long value) { + ensureBucketCountsIsMutable(); bucketCounts_.setLong(index, value); + bitField0_ |= 0x00000020; onChanged(); return this; } + /** * * @@ -7646,9 +7816,11 @@ public Builder setBucketCounts(int index, long value) { * this field. If there is a histogram, then the sum of the values in * `bucket_counts` must equal the value in the `count` field of the * distribution. + * * If present, `bucket_counts` should contain N values, where N is the number * of buckets specified in `bucket_options`. If you supply fewer than N * values, the remaining values are assumed to be 0. + * * The order of the values in `bucket_counts` follows the bucket numbering * schemes described for the three bucket types. The first value must be the * count for the underflow bucket (number 0). The next N-2 values are the @@ -7662,11 +7834,14 @@ public Builder setBucketCounts(int index, long value) { * @return This builder for chaining. */ public Builder addBucketCounts(long value) { + ensureBucketCountsIsMutable(); bucketCounts_.addLong(value); + bitField0_ |= 0x00000020; onChanged(); return this; } + /** * * @@ -7676,9 +7851,11 @@ public Builder addBucketCounts(long value) { * this field. If there is a histogram, then the sum of the values in * `bucket_counts` must equal the value in the `count` field of the * distribution. + * * If present, `bucket_counts` should contain N values, where N is the number * of buckets specified in `bucket_options`. If you supply fewer than N * values, the remaining values are assumed to be 0. + * * The order of the values in `bucket_counts` follows the bucket numbering * schemes described for the three bucket types. The first value must be the * count for the underflow bucket (number 0). The next N-2 values are the @@ -7694,9 +7871,11 @@ public Builder addBucketCounts(long value) { public Builder addAllBucketCounts(java.lang.Iterable values) { ensureBucketCountsIsMutable(); com.google.protobuf.AbstractMessageLite.Builder.addAll(values, bucketCounts_); + bitField0_ |= 0x00000020; onChanged(); return this; } + /** * * @@ -7706,9 +7885,11 @@ public Builder addAllBucketCounts(java.lang.Iterable v * this field. If there is a histogram, then the sum of the values in * `bucket_counts` must equal the value in the `count` field of the * distribution. + * * If present, `bucket_counts` should contain N values, where N is the number * of buckets specified in `bucket_options`. If you supply fewer than N * values, the remaining values are assumed to be 0. + * * The order of the values in `bucket_counts` follows the bucket numbering * schemes described for the three bucket types. The first value must be the * count for the underflow bucket (number 0). The next N-2 values are the @@ -7722,7 +7903,7 @@ public Builder addAllBucketCounts(java.lang.Iterable v */ public Builder clearBucketCounts() { bucketCounts_ = emptyLongList(); - bitField0_ = (bitField0_ & ~0x00000001); + bitField0_ = (bitField0_ & ~0x00000020); onChanged(); return this; } @@ -7731,13 +7912,13 @@ public Builder clearBucketCounts() { java.util.Collections.emptyList(); private void ensureExemplarsIsMutable() { - if (!((bitField0_ & 0x00000002) != 0)) { + if (!((bitField0_ & 0x00000040) != 0)) { exemplars_ = new java.util.ArrayList(exemplars_); - bitField0_ |= 0x00000002; + bitField0_ |= 0x00000040; } } - private com.google.protobuf.RepeatedFieldBuilderV3< + private com.google.protobuf.RepeatedFieldBuilder< com.google.api.Distribution.Exemplar, com.google.api.Distribution.Exemplar.Builder, com.google.api.Distribution.ExemplarOrBuilder> @@ -7759,6 +7940,7 @@ public java.util.List getExemplarsList() { return exemplarsBuilder_.getMessageList(); } } + /** * * @@ -7775,6 +7957,7 @@ public int getExemplarsCount() { return exemplarsBuilder_.getCount(); } } + /** * * @@ -7791,6 +7974,7 @@ public com.google.api.Distribution.Exemplar getExemplars(int index) { return exemplarsBuilder_.getMessage(index); } } + /** * * @@ -7813,6 +7997,7 @@ public Builder setExemplars(int index, com.google.api.Distribution.Exemplar valu } return this; } + /** * * @@ -7833,6 +8018,7 @@ public Builder setExemplars( } return this; } + /** * * @@ -7855,6 +8041,7 @@ public Builder addExemplars(com.google.api.Distribution.Exemplar value) { } return this; } + /** * * @@ -7877,6 +8064,7 @@ public Builder addExemplars(int index, com.google.api.Distribution.Exemplar valu } return this; } + /** * * @@ -7896,6 +8084,7 @@ public Builder addExemplars(com.google.api.Distribution.Exemplar.Builder builder } return this; } + /** * * @@ -7916,6 +8105,7 @@ public Builder addExemplars( } return this; } + /** * * @@ -7936,6 +8126,7 @@ public Builder addAllExemplars( } return this; } + /** * * @@ -7948,13 +8139,14 @@ public Builder addAllExemplars( public Builder clearExemplars() { if (exemplarsBuilder_ == null) { exemplars_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000002); + bitField0_ = (bitField0_ & ~0x00000040); onChanged(); } else { exemplarsBuilder_.clear(); } return this; } + /** * * @@ -7974,6 +8166,7 @@ public Builder removeExemplars(int index) { } return this; } + /** * * @@ -7984,8 +8177,9 @@ public Builder removeExemplars(int index) { * repeated .google.api.Distribution.Exemplar exemplars = 10; */ public com.google.api.Distribution.Exemplar.Builder getExemplarsBuilder(int index) { - return getExemplarsFieldBuilder().getBuilder(index); + return internalGetExemplarsFieldBuilder().getBuilder(index); } + /** * * @@ -8002,6 +8196,7 @@ public com.google.api.Distribution.ExemplarOrBuilder getExemplarsOrBuilder(int i return exemplarsBuilder_.getMessageOrBuilder(index); } } + /** * * @@ -8019,6 +8214,7 @@ public com.google.api.Distribution.ExemplarOrBuilder getExemplarsOrBuilder(int i return java.util.Collections.unmodifiableList(exemplars_); } } + /** * * @@ -8029,9 +8225,10 @@ public com.google.api.Distribution.ExemplarOrBuilder getExemplarsOrBuilder(int i * repeated .google.api.Distribution.Exemplar exemplars = 10; */ public com.google.api.Distribution.Exemplar.Builder addExemplarsBuilder() { - return getExemplarsFieldBuilder() + return internalGetExemplarsFieldBuilder() .addBuilder(com.google.api.Distribution.Exemplar.getDefaultInstance()); } + /** * * @@ -8042,9 +8239,10 @@ public com.google.api.Distribution.Exemplar.Builder addExemplarsBuilder() { * repeated .google.api.Distribution.Exemplar exemplars = 10; */ public com.google.api.Distribution.Exemplar.Builder addExemplarsBuilder(int index) { - return getExemplarsFieldBuilder() + return internalGetExemplarsFieldBuilder() .addBuilder(index, com.google.api.Distribution.Exemplar.getDefaultInstance()); } + /** * * @@ -8055,37 +8253,26 @@ public com.google.api.Distribution.Exemplar.Builder addExemplarsBuilder(int inde * repeated .google.api.Distribution.Exemplar exemplars = 10; */ public java.util.List getExemplarsBuilderList() { - return getExemplarsFieldBuilder().getBuilderList(); + return internalGetExemplarsFieldBuilder().getBuilderList(); } - private com.google.protobuf.RepeatedFieldBuilderV3< + private com.google.protobuf.RepeatedFieldBuilder< com.google.api.Distribution.Exemplar, com.google.api.Distribution.Exemplar.Builder, com.google.api.Distribution.ExemplarOrBuilder> - getExemplarsFieldBuilder() { + internalGetExemplarsFieldBuilder() { if (exemplarsBuilder_ == null) { exemplarsBuilder_ = - new com.google.protobuf.RepeatedFieldBuilderV3< + new com.google.protobuf.RepeatedFieldBuilder< com.google.api.Distribution.Exemplar, com.google.api.Distribution.Exemplar.Builder, com.google.api.Distribution.ExemplarOrBuilder>( - exemplars_, ((bitField0_ & 0x00000002) != 0), getParentForChildren(), isClean()); + exemplars_, ((bitField0_ & 0x00000040) != 0), getParentForChildren(), isClean()); exemplars_ = null; } return exemplarsBuilder_; } - @java.lang.Override - public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - // @@protoc_insertion_point(builder_scope:google.api.Distribution) } diff --git a/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/DistributionOrBuilder.java b/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/DistributionOrBuilder.java index 27f3411ae3..b2594a0a9d 100644 --- a/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/DistributionOrBuilder.java +++ b/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/DistributionOrBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,10 +14,13 @@ * limitations under the License. */ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: google/api/distribution.proto +// Protobuf Java Version: 4.33.2 package com.google.api; +@com.google.protobuf.Generated public interface DistributionOrBuilder extends // @@protoc_insertion_point(interface_extends:google.api.Distribution) @@ -58,9 +61,12 @@ public interface DistributionOrBuilder *
            * The sum of squared deviations from the mean of the values in the
            * population. For values x_i this is:
        -   *     Sum[i=1..n]((x_i - mean)^2)
        +   *
        +   * Sum[i=1..n]((x_i - mean)^2)
        +   *
            * Knuth, "The Art of Computer Programming", Vol. 2, page 232, 3rd edition
            * describes Welford's method for accumulating this sum in one pass.
        +   *
            * If `count` is zero then this field must be zero.
            * 
        * @@ -83,6 +89,7 @@ public interface DistributionOrBuilder * @return Whether the range field is set. */ boolean hasRange(); + /** * * @@ -96,6 +103,7 @@ public interface DistributionOrBuilder * @return The range. */ com.google.api.Distribution.Range getRange(); + /** * * @@ -121,6 +129,7 @@ public interface DistributionOrBuilder * @return Whether the bucketOptions field is set. */ boolean hasBucketOptions(); + /** * * @@ -134,6 +143,7 @@ public interface DistributionOrBuilder * @return The bucketOptions. */ com.google.api.Distribution.BucketOptions getBucketOptions(); + /** * * @@ -155,9 +165,11 @@ public interface DistributionOrBuilder * this field. If there is a histogram, then the sum of the values in * `bucket_counts` must equal the value in the `count` field of the * distribution. + * * If present, `bucket_counts` should contain N values, where N is the number * of buckets specified in `bucket_options`. If you supply fewer than N * values, the remaining values are assumed to be 0. + * * The order of the values in `bucket_counts` follows the bucket numbering * schemes described for the three bucket types. The first value must be the * count for the underflow bucket (number 0). The next N-2 values are the @@ -170,6 +182,7 @@ public interface DistributionOrBuilder * @return A list containing the bucketCounts. */ java.util.List getBucketCountsList(); + /** * * @@ -179,9 +192,11 @@ public interface DistributionOrBuilder * this field. If there is a histogram, then the sum of the values in * `bucket_counts` must equal the value in the `count` field of the * distribution. + * * If present, `bucket_counts` should contain N values, where N is the number * of buckets specified in `bucket_options`. If you supply fewer than N * values, the remaining values are assumed to be 0. + * * The order of the values in `bucket_counts` follows the bucket numbering * schemes described for the three bucket types. The first value must be the * count for the underflow bucket (number 0). The next N-2 values are the @@ -194,6 +209,7 @@ public interface DistributionOrBuilder * @return The count of bucketCounts. */ int getBucketCountsCount(); + /** * * @@ -203,9 +219,11 @@ public interface DistributionOrBuilder * this field. If there is a histogram, then the sum of the values in * `bucket_counts` must equal the value in the `count` field of the * distribution. + * * If present, `bucket_counts` should contain N values, where N is the number * of buckets specified in `bucket_options`. If you supply fewer than N * values, the remaining values are assumed to be 0. + * * The order of the values in `bucket_counts` follows the bucket numbering * schemes described for the three bucket types. The first value must be the * count for the underflow bucket (number 0). The next N-2 values are the @@ -230,6 +248,7 @@ public interface DistributionOrBuilder * repeated .google.api.Distribution.Exemplar exemplars = 10; */ java.util.List getExemplarsList(); + /** * * @@ -240,6 +259,7 @@ public interface DistributionOrBuilder * repeated .google.api.Distribution.Exemplar exemplars = 10; */ com.google.api.Distribution.Exemplar getExemplars(int index); + /** * * @@ -250,6 +270,7 @@ public interface DistributionOrBuilder * repeated .google.api.Distribution.Exemplar exemplars = 10; */ int getExemplarsCount(); + /** * * @@ -261,6 +282,7 @@ public interface DistributionOrBuilder */ java.util.List getExemplarsOrBuilderList(); + /** * * diff --git a/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/DistributionProto.java b/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/DistributionProto.java index 3237218949..608d41f67e 100644 --- a/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/DistributionProto.java +++ b/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/DistributionProto.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,13 +14,26 @@ * limitations under the License. */ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: google/api/distribution.proto +// Protobuf Java Version: 4.33.2 package com.google.api; -public final class DistributionProto { +@com.google.protobuf.Generated +public final class DistributionProto extends com.google.protobuf.GeneratedFile { private DistributionProto() {} + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "DistributionProto"); + } + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistryLite registry) {} public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry registry) { @@ -29,31 +42,31 @@ public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry r static final com.google.protobuf.Descriptors.Descriptor internal_static_google_api_Distribution_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable internal_static_google_api_Distribution_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_google_api_Distribution_Range_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable internal_static_google_api_Distribution_Range_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_google_api_Distribution_BucketOptions_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable internal_static_google_api_Distribution_BucketOptions_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_google_api_Distribution_BucketOptions_Linear_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable internal_static_google_api_Distribution_BucketOptions_Linear_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_google_api_Distribution_BucketOptions_Exponential_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable internal_static_google_api_Distribution_BucketOptions_Exponential_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_google_api_Distribution_BucketOptions_Explicit_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable internal_static_google_api_Distribution_BucketOptions_Explicit_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_google_api_Distribution_Exemplar_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable internal_static_google_api_Distribution_Exemplar_fieldAccessorTable; public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { @@ -64,34 +77,47 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { static { java.lang.String[] descriptorData = { - "\n\035google/api/distribution.proto\022\ngoogle." - + "api\032\031google/protobuf/any.proto\032\037google/p" - + "rotobuf/timestamp.proto\"\331\006\n\014Distribution" - + "\022\r\n\005count\030\001 \001(\003\022\014\n\004mean\030\002 \001(\001\022 \n\030sum_of_" - + "squared_deviation\030\003 \001(\001\022-\n\005range\030\004 \001(\0132\036" - + ".google.api.Distribution.Range\022>\n\016bucket" - + "_options\030\006 \001(\0132&.google.api.Distribution" - + ".BucketOptions\022\025\n\rbucket_counts\030\007 \003(\003\0224\n" - + "\texemplars\030\n \003(\0132!.google.api.Distributi" - + "on.Exemplar\032!\n\005Range\022\013\n\003min\030\001 \001(\001\022\013\n\003max" - + "\030\002 \001(\001\032\265\003\n\rBucketOptions\022G\n\016linear_bucke" - + "ts\030\001 \001(\0132-.google.api.Distribution.Bucke" - + "tOptions.LinearH\000\022Q\n\023exponential_buckets" - + "\030\002 \001(\01322.google.api.Distribution.BucketO" - + "ptions.ExponentialH\000\022K\n\020explicit_buckets" - + "\030\003 \001(\0132/.google.api.Distribution.BucketO" - + "ptions.ExplicitH\000\032C\n\006Linear\022\032\n\022num_finit" - + "e_buckets\030\001 \001(\005\022\r\n\005width\030\002 \001(\001\022\016\n\006offset" - + "\030\003 \001(\001\032O\n\013Exponential\022\032\n\022num_finite_buck" - + "ets\030\001 \001(\005\022\025\n\rgrowth_factor\030\002 \001(\001\022\r\n\005scal" - + "e\030\003 \001(\001\032\032\n\010Explicit\022\016\n\006bounds\030\001 \003(\001B\t\n\007o" - + "ptions\032s\n\010Exemplar\022\r\n\005value\030\001 \001(\001\022-\n\ttim" - + "estamp\030\002 \001(\0132\032.google.protobuf.Timestamp" - + "\022)\n\013attachments\030\003 \003(\0132\024.google.protobuf." - + "AnyBq\n\016com.google.apiB\021DistributionProto" - + "P\001ZCgoogle.golang.org/genproto/googleapi" - + "s/api/distribution;distribution\242\002\004GAPIb\006" - + "proto3" + "\n" + + "\035google/api/distribution.proto\022\n" + + "google." + + "api\032\031google/protobuf/any.proto\032\037google/protobuf/timestamp.proto\"\331\006\n" + + "\014Distribution\022\r\n" + + "\005count\030\001 \001(\003\022\014\n" + + "\004mean\030\002 \001(\001\022 \n" + + "\030sum_of_squared_deviation\030\003 \001(\001\022-\n" + + "\005range\030\004 \001(\0132\036.google.api.Distribution.Range\022>\n" + + "\016bucket_options\030\006" + + " \001(\0132&.google.api.Distribution.BucketOptions\022\025\n\r" + + "bucket_counts\030\007 \003(\003\0224\n" + + "\texemplars\030\n" + + " \003(\0132!.google.api.Distribution.Exemplar\032!\n" + + "\005Range\022\013\n" + + "\003min\030\001 \001(\001\022\013\n" + + "\003max\030\002 \001(\001\032\265\003\n\r" + + "BucketOptions\022G\n" + + "\016linear_buckets\030\001" + + " \001(\0132-.google.api.Distribution.BucketOptions.LinearH\000\022Q\n" + + "\023exponential_buckets\030\002" + + " \001(\01322.google.api.Distribution.BucketOptions.ExponentialH\000\022K\n" + + "\020explicit_buckets\030\003" + + " \001(\0132/.google.api.Distribution.BucketOptions.ExplicitH\000\032C\n" + + "\006Linear\022\032\n" + + "\022num_finite_buckets\030\001 \001(\005\022\r\n" + + "\005width\030\002 \001(\001\022\016\n" + + "\006offset\030\003 \001(\001\032O\n" + + "\013Exponential\022\032\n" + + "\022num_finite_buckets\030\001 \001(\005\022\025\n\r" + + "growth_factor\030\002 \001(\001\022\r\n" + + "\005scale\030\003 \001(\001\032\032\n" + + "\010Explicit\022\016\n" + + "\006bounds\030\001 \003(\001B\t\n" + + "\007options\032s\n" + + "\010Exemplar\022\r\n" + + "\005value\030\001 \001(\001\022-\n" + + "\ttimestamp\030\002 \001(\0132\032.google.protobuf.Timestamp\022)\n" + + "\013attachments\030\003 \003(\0132\024.google.protobuf.AnyBq\n" + + "\016com.google.apiB\021DistributionProtoP\001ZCgoogle.golang.org/genproto/googleapi" + + "s/api/distribution;distribution\242\002\004GAPIb\006proto3" }; descriptor = com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( @@ -100,9 +126,9 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { com.google.protobuf.AnyProto.getDescriptor(), com.google.protobuf.TimestampProto.getDescriptor(), }); - internal_static_google_api_Distribution_descriptor = getDescriptor().getMessageTypes().get(0); + internal_static_google_api_Distribution_descriptor = getDescriptor().getMessageType(0); internal_static_google_api_Distribution_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_google_api_Distribution_descriptor, new java.lang.String[] { "Count", @@ -114,53 +140,54 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "Exemplars", }); internal_static_google_api_Distribution_Range_descriptor = - internal_static_google_api_Distribution_descriptor.getNestedTypes().get(0); + internal_static_google_api_Distribution_descriptor.getNestedType(0); internal_static_google_api_Distribution_Range_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_google_api_Distribution_Range_descriptor, new java.lang.String[] { "Min", "Max", }); internal_static_google_api_Distribution_BucketOptions_descriptor = - internal_static_google_api_Distribution_descriptor.getNestedTypes().get(1); + internal_static_google_api_Distribution_descriptor.getNestedType(1); internal_static_google_api_Distribution_BucketOptions_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_google_api_Distribution_BucketOptions_descriptor, new java.lang.String[] { "LinearBuckets", "ExponentialBuckets", "ExplicitBuckets", "Options", }); internal_static_google_api_Distribution_BucketOptions_Linear_descriptor = - internal_static_google_api_Distribution_BucketOptions_descriptor.getNestedTypes().get(0); + internal_static_google_api_Distribution_BucketOptions_descriptor.getNestedType(0); internal_static_google_api_Distribution_BucketOptions_Linear_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_google_api_Distribution_BucketOptions_Linear_descriptor, new java.lang.String[] { "NumFiniteBuckets", "Width", "Offset", }); internal_static_google_api_Distribution_BucketOptions_Exponential_descriptor = - internal_static_google_api_Distribution_BucketOptions_descriptor.getNestedTypes().get(1); + internal_static_google_api_Distribution_BucketOptions_descriptor.getNestedType(1); internal_static_google_api_Distribution_BucketOptions_Exponential_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_google_api_Distribution_BucketOptions_Exponential_descriptor, new java.lang.String[] { "NumFiniteBuckets", "GrowthFactor", "Scale", }); internal_static_google_api_Distribution_BucketOptions_Explicit_descriptor = - internal_static_google_api_Distribution_BucketOptions_descriptor.getNestedTypes().get(2); + internal_static_google_api_Distribution_BucketOptions_descriptor.getNestedType(2); internal_static_google_api_Distribution_BucketOptions_Explicit_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_google_api_Distribution_BucketOptions_Explicit_descriptor, new java.lang.String[] { "Bounds", }); internal_static_google_api_Distribution_Exemplar_descriptor = - internal_static_google_api_Distribution_descriptor.getNestedTypes().get(2); + internal_static_google_api_Distribution_descriptor.getNestedType(2); internal_static_google_api_Distribution_Exemplar_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_google_api_Distribution_Exemplar_descriptor, new java.lang.String[] { "Value", "Timestamp", "Attachments", }); + descriptor.resolveAllFeaturesImmutable(); com.google.protobuf.AnyProto.getDescriptor(); com.google.protobuf.TimestampProto.getDescriptor(); } diff --git a/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/Documentation.java b/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/Documentation.java index a30f745edc..edce9c6220 100644 --- a/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/Documentation.java +++ b/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/Documentation.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,9 @@ * limitations under the License. */ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: google/api/documentation.proto +// Protobuf Java Version: 4.33.2 package com.google.api; @@ -23,37 +25,41 @@ * *
          * `Documentation` provides the information for describing a service.
        + *
          * Example:
          * <pre><code>documentation:
        - *   summary: >
        - *     The Google Calendar API gives access
        - *     to most calendar features.
        - *   pages:
        - *   - name: Overview
        - *     content: &#40;== include google/foo/overview.md ==&#41;
        - *   - name: Tutorial
        - *     content: &#40;== include google/foo/tutorial.md ==&#41;
        - *     subpages;
        - *     - name: Java
        - *       content: &#40;== include google/foo/tutorial_java.md ==&#41;
        - *   rules:
        - *   - selector: google.calendar.Calendar.Get
        - *     description: >
        - *       ...
        - *   - selector: google.calendar.Calendar.Put
        - *     description: >
        - *       ...
        + * summary: >
        + * The Google Calendar API gives access
        + * to most calendar features.
        + * pages:
        + * - name: Overview
        + * content: &#40;== include google/foo/overview.md ==&#41;
        + * - name: Tutorial
        + * content: &#40;== include google/foo/tutorial.md ==&#41;
        + * subpages:
        + * - name: Java
        + * content: &#40;== include google/foo/tutorial_java.md ==&#41;
        + * rules:
        + * - selector: google.calendar.Calendar.Get
        + * description: >
        + * ...
        + * - selector: google.calendar.Calendar.Put
        + * description: >
        + * ...
          * </code></pre>
          * Documentation is provided in markdown syntax. In addition to
          * standard markdown features, definition lists, tables and fenced
          * code blocks are supported. Section headers can be provided and are
          * interpreted relative to the section nesting of the context where
          * a documentation fragment is embedded.
        + *
          * Documentation from the IDL is merged with documentation defined
          * via the config at normalization time, where documentation provided
          * by config rules overrides IDL provided.
        + *
          * A number of constructs specific to the API platform are supported
          * in documentation text.
        + *
          * In order to reference a proto element, the following
          * notation can be used:
          * <pre><code>&#91;fully.qualified.proto.name]&#91;]</code></pre>
        @@ -61,6 +67,7 @@
          * <pre><code>&#91;display text]&#91;fully.qualified.proto.name]</code></pre>
          * Text can be excluded from doc using the following notation:
          * <pre><code>&#40;-- internal comment --&#41;</code></pre>
        + *
          * A few directives are available in documentation. Note that
          * directives must appear on a single line to be properly
          * identified. The `include` directive includes a markdown file from
        @@ -76,13 +83,25 @@
          *
          * Protobuf type {@code google.api.Documentation}
          */
        -public final class Documentation extends com.google.protobuf.GeneratedMessageV3
        +@com.google.protobuf.Generated
        +public final class Documentation extends com.google.protobuf.GeneratedMessage
             implements
             // @@protoc_insertion_point(message_implements:google.api.Documentation)
             DocumentationOrBuilder {
           private static final long serialVersionUID = 0L;
        +
        +  static {
        +    com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion(
        +        com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC,
        +        /* major= */ 4,
        +        /* minor= */ 33,
        +        /* patch= */ 2,
        +        /* suffix= */ "",
        +        "Documentation");
        +  }
        +
           // Use Documentation.newBuilder() to construct.
        -  private Documentation(com.google.protobuf.GeneratedMessageV3.Builder builder) {
        +  private Documentation(com.google.protobuf.GeneratedMessage.Builder builder) {
             super(builder);
           }
         
        @@ -95,23 +114,12 @@ private Documentation() {
             overview_ = "";
           }
         
        -  @java.lang.Override
        -  @SuppressWarnings({"unused"})
        -  protected java.lang.Object newInstance(UnusedPrivateParameter unused) {
        -    return new Documentation();
        -  }
        -
        -  @java.lang.Override
        -  public final com.google.protobuf.UnknownFieldSet getUnknownFields() {
        -    return this.unknownFields;
        -  }
        -
           public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
             return com.google.api.DocumentationProto.internal_static_google_api_Documentation_descriptor;
           }
         
           @java.lang.Override
        -  protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
        +  protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
               internalGetFieldAccessorTable() {
             return com.google.api.DocumentationProto
                 .internal_static_google_api_Documentation_fieldAccessorTable
        @@ -120,7 +128,10 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
           }
         
           public static final int SUMMARY_FIELD_NUMBER = 1;
        -  private volatile java.lang.Object summary_;
        +
        +  @SuppressWarnings("serial")
        +  private volatile java.lang.Object summary_ = "";
        +
           /**
            *
            *
        @@ -147,6 +158,7 @@ public java.lang.String getSummary() {
               return s;
             }
           }
        +
           /**
            *
            *
        @@ -175,7 +187,10 @@ public com.google.protobuf.ByteString getSummaryBytes() {
           }
         
           public static final int PAGES_FIELD_NUMBER = 5;
        +
        +  @SuppressWarnings("serial")
           private java.util.List pages_;
        +
           /**
            *
            *
        @@ -189,6 +204,7 @@ public com.google.protobuf.ByteString getSummaryBytes() {
           public java.util.List getPagesList() {
             return pages_;
           }
        +
           /**
            *
            *
        @@ -202,6 +218,7 @@ public java.util.List getPagesList() {
           public java.util.List getPagesOrBuilderList() {
             return pages_;
           }
        +
           /**
            *
            *
        @@ -215,6 +232,7 @@ public java.util.List getPagesOrBuilderL
           public int getPagesCount() {
             return pages_.size();
           }
        +
           /**
            *
            *
        @@ -228,6 +246,7 @@ public int getPagesCount() {
           public com.google.api.Page getPages(int index) {
             return pages_.get(index);
           }
        +
           /**
            *
            *
        @@ -243,12 +262,16 @@ public com.google.api.PageOrBuilder getPagesOrBuilder(int index) {
           }
         
           public static final int RULES_FIELD_NUMBER = 3;
        +
        +  @SuppressWarnings("serial")
           private java.util.List rules_;
        +
           /**
            *
            *
            * 
            * A list of documentation rules that apply to individual API elements.
        +   *
            * **NOTE:** All service configuration rules follow "last one wins" order.
            * 
        * @@ -258,11 +281,13 @@ public com.google.api.PageOrBuilder getPagesOrBuilder(int index) { public java.util.List getRulesList() { return rules_; } + /** * * *
            * A list of documentation rules that apply to individual API elements.
        +   *
            * **NOTE:** All service configuration rules follow "last one wins" order.
            * 
        * @@ -273,11 +298,13 @@ public java.util.List getRulesList() { getRulesOrBuilderList() { return rules_; } + /** * * *
            * A list of documentation rules that apply to individual API elements.
        +   *
            * **NOTE:** All service configuration rules follow "last one wins" order.
            * 
        * @@ -287,11 +314,13 @@ public java.util.List getRulesList() { public int getRulesCount() { return rules_.size(); } + /** * * *
            * A list of documentation rules that apply to individual API elements.
        +   *
            * **NOTE:** All service configuration rules follow "last one wins" order.
            * 
        * @@ -301,11 +330,13 @@ public int getRulesCount() { public com.google.api.DocumentationRule getRules(int index) { return rules_.get(index); } + /** * * *
            * A list of documentation rules that apply to individual API elements.
        +   *
            * **NOTE:** All service configuration rules follow "last one wins" order.
            * 
        * @@ -317,7 +348,10 @@ public com.google.api.DocumentationRuleOrBuilder getRulesOrBuilder(int index) { } public static final int DOCUMENTATION_ROOT_URL_FIELD_NUMBER = 4; - private volatile java.lang.Object documentationRootUrl_; + + @SuppressWarnings("serial") + private volatile java.lang.Object documentationRootUrl_ = ""; + /** * * @@ -341,6 +375,7 @@ public java.lang.String getDocumentationRootUrl() { return s; } } + /** * * @@ -366,7 +401,10 @@ public com.google.protobuf.ByteString getDocumentationRootUrlBytes() { } public static final int SERVICE_ROOT_URL_FIELD_NUMBER = 6; - private volatile java.lang.Object serviceRootUrl_; + + @SuppressWarnings("serial") + private volatile java.lang.Object serviceRootUrl_ = ""; + /** * * @@ -393,6 +431,7 @@ public java.lang.String getServiceRootUrl() { return s; } } + /** * * @@ -421,22 +460,25 @@ public com.google.protobuf.ByteString getServiceRootUrlBytes() { } public static final int OVERVIEW_FIELD_NUMBER = 2; - private volatile java.lang.Object overview_; + + @SuppressWarnings("serial") + private volatile java.lang.Object overview_ = ""; + /** * * *
            * Declares a single overview page. For example:
            * <pre><code>documentation:
        -   *   summary: ...
        -   *   overview: &#40;== include overview.md ==&#41;
        +   * summary: ...
        +   * overview: &#40;== include overview.md ==&#41;
            * </code></pre>
            * This is a shortcut for the following declaration (using pages style):
            * <pre><code>documentation:
        -   *   summary: ...
        -   *   pages:
        -   *   - name: Overview
        -   *     content: &#40;== include overview.md ==&#41;
        +   * summary: ...
        +   * pages:
        +   * - name: Overview
        +   * content: &#40;== include overview.md ==&#41;
            * </code></pre>
            * Note: you cannot specify both `overview` field and `pages` field.
            * 
        @@ -457,21 +499,22 @@ public java.lang.String getOverview() { return s; } } + /** * * *
            * Declares a single overview page. For example:
            * <pre><code>documentation:
        -   *   summary: ...
        -   *   overview: &#40;== include overview.md ==&#41;
        +   * summary: ...
        +   * overview: &#40;== include overview.md ==&#41;
            * </code></pre>
            * This is a shortcut for the following declaration (using pages style):
            * <pre><code>documentation:
        -   *   summary: ...
        -   *   pages:
        -   *   - name: Overview
        -   *     content: &#40;== include overview.md ==&#41;
        +   * summary: ...
        +   * pages:
        +   * - name: Overview
        +   * content: &#40;== include overview.md ==&#41;
            * </code></pre>
            * Note: you cannot specify both `overview` field and `pages` field.
            * 
        @@ -507,23 +550,23 @@ public final boolean isInitialized() { @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(summary_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, summary_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(summary_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, summary_); } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(overview_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 2, overview_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(overview_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, overview_); } for (int i = 0; i < rules_.size(); i++) { output.writeMessage(3, rules_.get(i)); } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(documentationRootUrl_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 4, documentationRootUrl_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(documentationRootUrl_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 4, documentationRootUrl_); } for (int i = 0; i < pages_.size(); i++) { output.writeMessage(5, pages_.get(i)); } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(serviceRootUrl_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 6, serviceRootUrl_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(serviceRootUrl_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 6, serviceRootUrl_); } getUnknownFields().writeTo(output); } @@ -534,23 +577,23 @@ public int getSerializedSize() { if (size != -1) return size; size = 0; - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(summary_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, summary_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(summary_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, summary_); } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(overview_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, overview_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(overview_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, overview_); } for (int i = 0; i < rules_.size(); i++) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, rules_.get(i)); } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(documentationRootUrl_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, documentationRootUrl_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(documentationRootUrl_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(4, documentationRootUrl_); } for (int i = 0; i < pages_.size(); i++) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(5, pages_.get(i)); } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(serviceRootUrl_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(6, serviceRootUrl_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(serviceRootUrl_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(6, serviceRootUrl_); } size += getUnknownFields().getSerializedSize(); memoizedSize = size; @@ -641,38 +684,38 @@ public static com.google.api.Documentation parseFrom( public static com.google.api.Documentation parseFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); } public static com.google.api.Documentation parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } public static com.google.api.Documentation parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); } public static com.google.api.Documentation parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( PARSER, input, extensionRegistry); } public static com.google.api.Documentation parseFrom(com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); } public static com.google.api.Documentation parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } @@ -695,46 +738,51 @@ public Builder toBuilder() { } @java.lang.Override - protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { Builder builder = new Builder(parent); return builder; } + /** * * *
            * `Documentation` provides the information for describing a service.
        +   *
            * Example:
            * <pre><code>documentation:
        -   *   summary: >
        -   *     The Google Calendar API gives access
        -   *     to most calendar features.
        -   *   pages:
        -   *   - name: Overview
        -   *     content: &#40;== include google/foo/overview.md ==&#41;
        -   *   - name: Tutorial
        -   *     content: &#40;== include google/foo/tutorial.md ==&#41;
        -   *     subpages;
        -   *     - name: Java
        -   *       content: &#40;== include google/foo/tutorial_java.md ==&#41;
        -   *   rules:
        -   *   - selector: google.calendar.Calendar.Get
        -   *     description: >
        -   *       ...
        -   *   - selector: google.calendar.Calendar.Put
        -   *     description: >
        -   *       ...
        +   * summary: >
        +   * The Google Calendar API gives access
        +   * to most calendar features.
        +   * pages:
        +   * - name: Overview
        +   * content: &#40;== include google/foo/overview.md ==&#41;
        +   * - name: Tutorial
        +   * content: &#40;== include google/foo/tutorial.md ==&#41;
        +   * subpages:
        +   * - name: Java
        +   * content: &#40;== include google/foo/tutorial_java.md ==&#41;
        +   * rules:
        +   * - selector: google.calendar.Calendar.Get
        +   * description: >
        +   * ...
        +   * - selector: google.calendar.Calendar.Put
        +   * description: >
        +   * ...
            * </code></pre>
            * Documentation is provided in markdown syntax. In addition to
            * standard markdown features, definition lists, tables and fenced
            * code blocks are supported. Section headers can be provided and are
            * interpreted relative to the section nesting of the context where
            * a documentation fragment is embedded.
        +   *
            * Documentation from the IDL is merged with documentation defined
            * via the config at normalization time, where documentation provided
            * by config rules overrides IDL provided.
        +   *
            * A number of constructs specific to the API platform are supported
            * in documentation text.
        +   *
            * In order to reference a proto element, the following
            * notation can be used:
            * <pre><code>&#91;fully.qualified.proto.name]&#91;]</code></pre>
        @@ -742,6 +790,7 @@ protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.Build
            * <pre><code>&#91;display text]&#91;fully.qualified.proto.name]</code></pre>
            * Text can be excluded from doc using the following notation:
            * <pre><code>&#40;-- internal comment --&#41;</code></pre>
        +   *
            * A few directives are available in documentation. Note that
            * directives must appear on a single line to be properly
            * identified. The `include` directive includes a markdown file from
        @@ -757,7 +806,7 @@ protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.Build
            *
            * Protobuf type {@code google.api.Documentation}
            */
        -  public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder
        +  public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder
               implements
               // @@protoc_insertion_point(builder_implements:google.api.Documentation)
               com.google.api.DocumentationOrBuilder {
        @@ -766,7 +815,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
             }
         
             @java.lang.Override
        -    protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
        +    protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
                 internalGetFieldAccessorTable() {
               return com.google.api.DocumentationProto
                   .internal_static_google_api_Documentation_fieldAccessorTable
        @@ -777,35 +826,32 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
             // Construct using com.google.api.Documentation.newBuilder()
             private Builder() {}
         
        -    private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
        +    private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) {
               super(parent);
             }
         
             @java.lang.Override
             public Builder clear() {
               super.clear();
        +      bitField0_ = 0;
               summary_ = "";
        -
               if (pagesBuilder_ == null) {
                 pages_ = java.util.Collections.emptyList();
               } else {
                 pages_ = null;
                 pagesBuilder_.clear();
               }
        -      bitField0_ = (bitField0_ & ~0x00000001);
        +      bitField0_ = (bitField0_ & ~0x00000002);
               if (rulesBuilder_ == null) {
                 rules_ = java.util.Collections.emptyList();
               } else {
                 rules_ = null;
                 rulesBuilder_.clear();
               }
        -      bitField0_ = (bitField0_ & ~0x00000002);
        +      bitField0_ = (bitField0_ & ~0x00000004);
               documentationRootUrl_ = "";
        -
               serviceRootUrl_ = "";
        -
               overview_ = "";
        -
               return this;
             }
         
        @@ -831,64 +877,49 @@ public com.google.api.Documentation build() {
             @java.lang.Override
             public com.google.api.Documentation buildPartial() {
               com.google.api.Documentation result = new com.google.api.Documentation(this);
        -      int from_bitField0_ = bitField0_;
        -      result.summary_ = summary_;
        +      buildPartialRepeatedFields(result);
        +      if (bitField0_ != 0) {
        +        buildPartial0(result);
        +      }
        +      onBuilt();
        +      return result;
        +    }
        +
        +    private void buildPartialRepeatedFields(com.google.api.Documentation result) {
               if (pagesBuilder_ == null) {
        -        if (((bitField0_ & 0x00000001) != 0)) {
        +        if (((bitField0_ & 0x00000002) != 0)) {
                   pages_ = java.util.Collections.unmodifiableList(pages_);
        -          bitField0_ = (bitField0_ & ~0x00000001);
        +          bitField0_ = (bitField0_ & ~0x00000002);
                 }
                 result.pages_ = pages_;
               } else {
                 result.pages_ = pagesBuilder_.build();
               }
               if (rulesBuilder_ == null) {
        -        if (((bitField0_ & 0x00000002) != 0)) {
        +        if (((bitField0_ & 0x00000004) != 0)) {
                   rules_ = java.util.Collections.unmodifiableList(rules_);
        -          bitField0_ = (bitField0_ & ~0x00000002);
        +          bitField0_ = (bitField0_ & ~0x00000004);
                 }
                 result.rules_ = rules_;
               } else {
                 result.rules_ = rulesBuilder_.build();
               }
        -      result.documentationRootUrl_ = documentationRootUrl_;
        -      result.serviceRootUrl_ = serviceRootUrl_;
        -      result.overview_ = overview_;
        -      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);
        +    private void buildPartial0(com.google.api.Documentation result) {
        +      int from_bitField0_ = bitField0_;
        +      if (((from_bitField0_ & 0x00000001) != 0)) {
        +        result.summary_ = summary_;
        +      }
        +      if (((from_bitField0_ & 0x00000008) != 0)) {
        +        result.documentationRootUrl_ = documentationRootUrl_;
        +      }
        +      if (((from_bitField0_ & 0x00000010) != 0)) {
        +        result.serviceRootUrl_ = serviceRootUrl_;
        +      }
        +      if (((from_bitField0_ & 0x00000020) != 0)) {
        +        result.overview_ = overview_;
        +      }
             }
         
             @java.lang.Override
        @@ -905,13 +936,14 @@ public Builder mergeFrom(com.google.api.Documentation other) {
               if (other == com.google.api.Documentation.getDefaultInstance()) return this;
               if (!other.getSummary().isEmpty()) {
                 summary_ = other.summary_;
        +        bitField0_ |= 0x00000001;
                 onChanged();
               }
               if (pagesBuilder_ == null) {
                 if (!other.pages_.isEmpty()) {
                   if (pages_.isEmpty()) {
                     pages_ = other.pages_;
        -            bitField0_ = (bitField0_ & ~0x00000001);
        +            bitField0_ = (bitField0_ & ~0x00000002);
                   } else {
                     ensurePagesIsMutable();
                     pages_.addAll(other.pages_);
        @@ -924,10 +956,10 @@ public Builder mergeFrom(com.google.api.Documentation other) {
                     pagesBuilder_.dispose();
                     pagesBuilder_ = null;
                     pages_ = other.pages_;
        -            bitField0_ = (bitField0_ & ~0x00000001);
        +            bitField0_ = (bitField0_ & ~0x00000002);
                     pagesBuilder_ =
        -                com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders
        -                    ? getPagesFieldBuilder()
        +                com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders
        +                    ? internalGetPagesFieldBuilder()
                             : null;
                   } else {
                     pagesBuilder_.addAllMessages(other.pages_);
        @@ -938,7 +970,7 @@ public Builder mergeFrom(com.google.api.Documentation other) {
                 if (!other.rules_.isEmpty()) {
                   if (rules_.isEmpty()) {
                     rules_ = other.rules_;
        -            bitField0_ = (bitField0_ & ~0x00000002);
        +            bitField0_ = (bitField0_ & ~0x00000004);
                   } else {
                     ensureRulesIsMutable();
                     rules_.addAll(other.rules_);
        @@ -951,10 +983,10 @@ public Builder mergeFrom(com.google.api.Documentation other) {
                     rulesBuilder_.dispose();
                     rulesBuilder_ = null;
                     rules_ = other.rules_;
        -            bitField0_ = (bitField0_ & ~0x00000002);
        +            bitField0_ = (bitField0_ & ~0x00000004);
                     rulesBuilder_ =
        -                com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders
        -                    ? getRulesFieldBuilder()
        +                com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders
        +                    ? internalGetRulesFieldBuilder()
                             : null;
                   } else {
                     rulesBuilder_.addAllMessages(other.rules_);
        @@ -963,14 +995,17 @@ public Builder mergeFrom(com.google.api.Documentation other) {
               }
               if (!other.getDocumentationRootUrl().isEmpty()) {
                 documentationRootUrl_ = other.documentationRootUrl_;
        +        bitField0_ |= 0x00000008;
                 onChanged();
               }
               if (!other.getServiceRootUrl().isEmpty()) {
                 serviceRootUrl_ = other.serviceRootUrl_;
        +        bitField0_ |= 0x00000010;
                 onChanged();
               }
               if (!other.getOverview().isEmpty()) {
                 overview_ = other.overview_;
        +        bitField0_ |= 0x00000020;
                 onChanged();
               }
               this.mergeUnknownFields(other.getUnknownFields());
        @@ -1002,13 +1037,13 @@ public Builder mergeFrom(
                     case 10:
                       {
                         summary_ = input.readStringRequireUtf8();
        -
        +                bitField0_ |= 0x00000001;
                         break;
                       } // case 10
                     case 18:
                       {
                         overview_ = input.readStringRequireUtf8();
        -
        +                bitField0_ |= 0x00000020;
                         break;
                       } // case 18
                     case 26:
        @@ -1026,7 +1061,7 @@ public Builder mergeFrom(
                     case 34:
                       {
                         documentationRootUrl_ = input.readStringRequireUtf8();
        -
        +                bitField0_ |= 0x00000008;
                         break;
                       } // case 34
                     case 42:
        @@ -1044,7 +1079,7 @@ public Builder mergeFrom(
                     case 50:
                       {
                         serviceRootUrl_ = input.readStringRequireUtf8();
        -
        +                bitField0_ |= 0x00000010;
                         break;
                       } // case 50
                     default:
        @@ -1067,6 +1102,7 @@ public Builder mergeFrom(
             private int bitField0_;
         
             private java.lang.Object summary_ = "";
        +
             /**
              *
              *
        @@ -1092,6 +1128,7 @@ public java.lang.String getSummary() {
                 return (java.lang.String) ref;
               }
             }
        +
             /**
              *
              *
        @@ -1117,6 +1154,7 @@ public com.google.protobuf.ByteString getSummaryBytes() {
                 return (com.google.protobuf.ByteString) ref;
               }
             }
        +
             /**
              *
              *
        @@ -1136,11 +1174,12 @@ public Builder setSummary(java.lang.String value) {
               if (value == null) {
                 throw new NullPointerException();
               }
        -
               summary_ = value;
        +      bitField0_ |= 0x00000001;
               onChanged();
               return this;
             }
        +
             /**
              *
              *
        @@ -1156,11 +1195,12 @@ public Builder setSummary(java.lang.String value) {
              * @return This builder for chaining.
              */
             public Builder clearSummary() {
        -
               summary_ = getDefaultInstance().getSummary();
        +      bitField0_ = (bitField0_ & ~0x00000001);
               onChanged();
               return this;
             }
        +
             /**
              *
              *
        @@ -1181,8 +1221,8 @@ public Builder setSummaryBytes(com.google.protobuf.ByteString value) {
                 throw new NullPointerException();
               }
               checkByteStringIsUtf8(value);
        -
               summary_ = value;
        +      bitField0_ |= 0x00000001;
               onChanged();
               return this;
             }
        @@ -1190,13 +1230,13 @@ public Builder setSummaryBytes(com.google.protobuf.ByteString value) {
             private java.util.List pages_ = java.util.Collections.emptyList();
         
             private void ensurePagesIsMutable() {
        -      if (!((bitField0_ & 0x00000001) != 0)) {
        +      if (!((bitField0_ & 0x00000002) != 0)) {
                 pages_ = new java.util.ArrayList(pages_);
        -        bitField0_ |= 0x00000001;
        +        bitField0_ |= 0x00000002;
               }
             }
         
        -    private com.google.protobuf.RepeatedFieldBuilderV3<
        +    private com.google.protobuf.RepeatedFieldBuilder<
                     com.google.api.Page, com.google.api.Page.Builder, com.google.api.PageOrBuilder>
                 pagesBuilder_;
         
        @@ -1216,6 +1256,7 @@ public java.util.List getPagesList() {
                 return pagesBuilder_.getMessageList();
               }
             }
        +
             /**
              *
              *
        @@ -1232,6 +1273,7 @@ public int getPagesCount() {
                 return pagesBuilder_.getCount();
               }
             }
        +
             /**
              *
              *
        @@ -1248,6 +1290,7 @@ public com.google.api.Page getPages(int index) {
                 return pagesBuilder_.getMessage(index);
               }
             }
        +
             /**
              *
              *
        @@ -1270,6 +1313,7 @@ public Builder setPages(int index, com.google.api.Page value) {
               }
               return this;
             }
        +
             /**
              *
              *
        @@ -1289,6 +1333,7 @@ public Builder setPages(int index, com.google.api.Page.Builder builderForValue)
               }
               return this;
             }
        +
             /**
              *
              *
        @@ -1311,6 +1356,7 @@ public Builder addPages(com.google.api.Page value) {
               }
               return this;
             }
        +
             /**
              *
              *
        @@ -1333,6 +1379,7 @@ public Builder addPages(int index, com.google.api.Page value) {
               }
               return this;
             }
        +
             /**
              *
              *
        @@ -1352,6 +1399,7 @@ public Builder addPages(com.google.api.Page.Builder builderForValue) {
               }
               return this;
             }
        +
             /**
              *
              *
        @@ -1371,6 +1419,7 @@ public Builder addPages(int index, com.google.api.Page.Builder builderForValue)
               }
               return this;
             }
        +
             /**
              *
              *
        @@ -1390,6 +1439,7 @@ public Builder addAllPages(java.lang.Iterable val
               }
               return this;
             }
        +
             /**
              *
              *
        @@ -1402,13 +1452,14 @@ public Builder addAllPages(java.lang.Iterable val
             public Builder clearPages() {
               if (pagesBuilder_ == null) {
                 pages_ = java.util.Collections.emptyList();
        -        bitField0_ = (bitField0_ & ~0x00000001);
        +        bitField0_ = (bitField0_ & ~0x00000002);
                 onChanged();
               } else {
                 pagesBuilder_.clear();
               }
               return this;
             }
        +
             /**
              *
              *
        @@ -1428,6 +1479,7 @@ public Builder removePages(int index) {
               }
               return this;
             }
        +
             /**
              *
              *
        @@ -1438,8 +1490,9 @@ public Builder removePages(int index) {
              * repeated .google.api.Page pages = 5;
              */
             public com.google.api.Page.Builder getPagesBuilder(int index) {
        -      return getPagesFieldBuilder().getBuilder(index);
        +      return internalGetPagesFieldBuilder().getBuilder(index);
             }
        +
             /**
              *
              *
        @@ -1456,6 +1509,7 @@ public com.google.api.PageOrBuilder getPagesOrBuilder(int index) {
                 return pagesBuilder_.getMessageOrBuilder(index);
               }
             }
        +
             /**
              *
              *
        @@ -1472,6 +1526,7 @@ public java.util.List getPagesOrBuilderL
                 return java.util.Collections.unmodifiableList(pages_);
               }
             }
        +
             /**
              *
              *
        @@ -1482,8 +1537,9 @@ public java.util.List getPagesOrBuilderL
              * repeated .google.api.Page pages = 5;
              */
             public com.google.api.Page.Builder addPagesBuilder() {
        -      return getPagesFieldBuilder().addBuilder(com.google.api.Page.getDefaultInstance());
        +      return internalGetPagesFieldBuilder().addBuilder(com.google.api.Page.getDefaultInstance());
             }
        +
             /**
              *
              *
        @@ -1494,8 +1550,10 @@ public com.google.api.Page.Builder addPagesBuilder() {
              * repeated .google.api.Page pages = 5;
              */
             public com.google.api.Page.Builder addPagesBuilder(int index) {
        -      return getPagesFieldBuilder().addBuilder(index, com.google.api.Page.getDefaultInstance());
        +      return internalGetPagesFieldBuilder()
        +          .addBuilder(index, com.google.api.Page.getDefaultInstance());
             }
        +
             /**
              *
              *
        @@ -1506,17 +1564,17 @@ public com.google.api.Page.Builder addPagesBuilder(int index) {
              * repeated .google.api.Page pages = 5;
              */
             public java.util.List getPagesBuilderList() {
        -      return getPagesFieldBuilder().getBuilderList();
        +      return internalGetPagesFieldBuilder().getBuilderList();
             }
         
        -    private com.google.protobuf.RepeatedFieldBuilderV3<
        +    private com.google.protobuf.RepeatedFieldBuilder<
                     com.google.api.Page, com.google.api.Page.Builder, com.google.api.PageOrBuilder>
        -        getPagesFieldBuilder() {
        +        internalGetPagesFieldBuilder() {
               if (pagesBuilder_ == null) {
                 pagesBuilder_ =
        -            new com.google.protobuf.RepeatedFieldBuilderV3<
        +            new com.google.protobuf.RepeatedFieldBuilder<
                         com.google.api.Page, com.google.api.Page.Builder, com.google.api.PageOrBuilder>(
        -                pages_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean());
        +                pages_, ((bitField0_ & 0x00000002) != 0), getParentForChildren(), isClean());
                 pages_ = null;
               }
               return pagesBuilder_;
        @@ -1526,13 +1584,13 @@ public java.util.List getPagesBuilderList() {
                 java.util.Collections.emptyList();
         
             private void ensureRulesIsMutable() {
        -      if (!((bitField0_ & 0x00000002) != 0)) {
        +      if (!((bitField0_ & 0x00000004) != 0)) {
                 rules_ = new java.util.ArrayList(rules_);
        -        bitField0_ |= 0x00000002;
        +        bitField0_ |= 0x00000004;
               }
             }
         
        -    private com.google.protobuf.RepeatedFieldBuilderV3<
        +    private com.google.protobuf.RepeatedFieldBuilder<
                     com.google.api.DocumentationRule,
                     com.google.api.DocumentationRule.Builder,
                     com.google.api.DocumentationRuleOrBuilder>
        @@ -1543,6 +1601,7 @@ private void ensureRulesIsMutable() {
              *
              * 
              * A list of documentation rules that apply to individual API elements.
        +     *
              * **NOTE:** All service configuration rules follow "last one wins" order.
              * 
        * @@ -1555,11 +1614,13 @@ public java.util.List getRulesList() { return rulesBuilder_.getMessageList(); } } + /** * * *
              * A list of documentation rules that apply to individual API elements.
        +     *
              * **NOTE:** All service configuration rules follow "last one wins" order.
              * 
        * @@ -1572,11 +1633,13 @@ public int getRulesCount() { return rulesBuilder_.getCount(); } } + /** * * *
              * A list of documentation rules that apply to individual API elements.
        +     *
              * **NOTE:** All service configuration rules follow "last one wins" order.
              * 
        * @@ -1589,11 +1652,13 @@ public com.google.api.DocumentationRule getRules(int index) { return rulesBuilder_.getMessage(index); } } + /** * * *
              * A list of documentation rules that apply to individual API elements.
        +     *
              * **NOTE:** All service configuration rules follow "last one wins" order.
              * 
        * @@ -1612,11 +1677,13 @@ public Builder setRules(int index, com.google.api.DocumentationRule value) { } return this; } + /** * * *
              * A list of documentation rules that apply to individual API elements.
        +     *
              * **NOTE:** All service configuration rules follow "last one wins" order.
              * 
        * @@ -1632,11 +1699,13 @@ public Builder setRules(int index, com.google.api.DocumentationRule.Builder buil } return this; } + /** * * *
              * A list of documentation rules that apply to individual API elements.
        +     *
              * **NOTE:** All service configuration rules follow "last one wins" order.
              * 
        * @@ -1655,11 +1724,13 @@ public Builder addRules(com.google.api.DocumentationRule value) { } return this; } + /** * * *
              * A list of documentation rules that apply to individual API elements.
        +     *
              * **NOTE:** All service configuration rules follow "last one wins" order.
              * 
        * @@ -1678,11 +1749,13 @@ public Builder addRules(int index, com.google.api.DocumentationRule value) { } return this; } + /** * * *
              * A list of documentation rules that apply to individual API elements.
        +     *
              * **NOTE:** All service configuration rules follow "last one wins" order.
              * 
        * @@ -1698,11 +1771,13 @@ public Builder addRules(com.google.api.DocumentationRule.Builder builderForValue } return this; } + /** * * *
              * A list of documentation rules that apply to individual API elements.
        +     *
              * **NOTE:** All service configuration rules follow "last one wins" order.
              * 
        * @@ -1718,11 +1793,13 @@ public Builder addRules(int index, com.google.api.DocumentationRule.Builder buil } return this; } + /** * * *
              * A list of documentation rules that apply to individual API elements.
        +     *
              * **NOTE:** All service configuration rules follow "last one wins" order.
              * 
        * @@ -1739,11 +1816,13 @@ public Builder addAllRules( } return this; } + /** * * *
              * A list of documentation rules that apply to individual API elements.
        +     *
              * **NOTE:** All service configuration rules follow "last one wins" order.
              * 
        * @@ -1752,18 +1831,20 @@ public Builder addAllRules( public Builder clearRules() { if (rulesBuilder_ == null) { rules_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000002); + bitField0_ = (bitField0_ & ~0x00000004); onChanged(); } else { rulesBuilder_.clear(); } return this; } + /** * * *
              * A list of documentation rules that apply to individual API elements.
        +     *
              * **NOTE:** All service configuration rules follow "last one wins" order.
              * 
        * @@ -1779,24 +1860,28 @@ public Builder removeRules(int index) { } return this; } + /** * * *
              * A list of documentation rules that apply to individual API elements.
        +     *
              * **NOTE:** All service configuration rules follow "last one wins" order.
              * 
        * * repeated .google.api.DocumentationRule rules = 3; */ public com.google.api.DocumentationRule.Builder getRulesBuilder(int index) { - return getRulesFieldBuilder().getBuilder(index); + return internalGetRulesFieldBuilder().getBuilder(index); } + /** * * *
              * A list of documentation rules that apply to individual API elements.
        +     *
              * **NOTE:** All service configuration rules follow "last one wins" order.
              * 
        * @@ -1809,11 +1894,13 @@ public com.google.api.DocumentationRuleOrBuilder getRulesOrBuilder(int index) { return rulesBuilder_.getMessageOrBuilder(index); } } + /** * * *
              * A list of documentation rules that apply to individual API elements.
        +     *
              * **NOTE:** All service configuration rules follow "last one wins" order.
              * 
        * @@ -1827,66 +1914,73 @@ public com.google.api.DocumentationRuleOrBuilder getRulesOrBuilder(int index) { return java.util.Collections.unmodifiableList(rules_); } } + /** * * *
              * A list of documentation rules that apply to individual API elements.
        +     *
              * **NOTE:** All service configuration rules follow "last one wins" order.
              * 
        * * repeated .google.api.DocumentationRule rules = 3; */ public com.google.api.DocumentationRule.Builder addRulesBuilder() { - return getRulesFieldBuilder() + return internalGetRulesFieldBuilder() .addBuilder(com.google.api.DocumentationRule.getDefaultInstance()); } + /** * * *
              * A list of documentation rules that apply to individual API elements.
        +     *
              * **NOTE:** All service configuration rules follow "last one wins" order.
              * 
        * * repeated .google.api.DocumentationRule rules = 3; */ public com.google.api.DocumentationRule.Builder addRulesBuilder(int index) { - return getRulesFieldBuilder() + return internalGetRulesFieldBuilder() .addBuilder(index, com.google.api.DocumentationRule.getDefaultInstance()); } + /** * * *
              * A list of documentation rules that apply to individual API elements.
        +     *
              * **NOTE:** All service configuration rules follow "last one wins" order.
              * 
        * * repeated .google.api.DocumentationRule rules = 3; */ public java.util.List getRulesBuilderList() { - return getRulesFieldBuilder().getBuilderList(); + return internalGetRulesFieldBuilder().getBuilderList(); } - private com.google.protobuf.RepeatedFieldBuilderV3< + private com.google.protobuf.RepeatedFieldBuilder< com.google.api.DocumentationRule, com.google.api.DocumentationRule.Builder, com.google.api.DocumentationRuleOrBuilder> - getRulesFieldBuilder() { + internalGetRulesFieldBuilder() { if (rulesBuilder_ == null) { rulesBuilder_ = - new com.google.protobuf.RepeatedFieldBuilderV3< + new com.google.protobuf.RepeatedFieldBuilder< com.google.api.DocumentationRule, com.google.api.DocumentationRule.Builder, com.google.api.DocumentationRuleOrBuilder>( - rules_, ((bitField0_ & 0x00000002) != 0), getParentForChildren(), isClean()); + rules_, ((bitField0_ & 0x00000004) != 0), getParentForChildren(), isClean()); rules_ = null; } return rulesBuilder_; } private java.lang.Object documentationRootUrl_ = ""; + /** * * @@ -1909,6 +2003,7 @@ public java.lang.String getDocumentationRootUrl() { return (java.lang.String) ref; } } + /** * * @@ -1931,6 +2026,7 @@ public com.google.protobuf.ByteString getDocumentationRootUrlBytes() { return (com.google.protobuf.ByteString) ref; } } + /** * * @@ -1947,11 +2043,12 @@ public Builder setDocumentationRootUrl(java.lang.String value) { if (value == null) { throw new NullPointerException(); } - documentationRootUrl_ = value; + bitField0_ |= 0x00000008; onChanged(); return this; } + /** * * @@ -1964,11 +2061,12 @@ public Builder setDocumentationRootUrl(java.lang.String value) { * @return This builder for chaining. */ public Builder clearDocumentationRootUrl() { - documentationRootUrl_ = getDefaultInstance().getDocumentationRootUrl(); + bitField0_ = (bitField0_ & ~0x00000008); onChanged(); return this; } + /** * * @@ -1986,13 +2084,14 @@ public Builder setDocumentationRootUrlBytes(com.google.protobuf.ByteString value throw new NullPointerException(); } checkByteStringIsUtf8(value); - documentationRootUrl_ = value; + bitField0_ |= 0x00000008; onChanged(); return this; } private java.lang.Object serviceRootUrl_ = ""; + /** * * @@ -2018,6 +2117,7 @@ public java.lang.String getServiceRootUrl() { return (java.lang.String) ref; } } + /** * * @@ -2043,6 +2143,7 @@ public com.google.protobuf.ByteString getServiceRootUrlBytes() { return (com.google.protobuf.ByteString) ref; } } + /** * * @@ -2062,11 +2163,12 @@ public Builder setServiceRootUrl(java.lang.String value) { if (value == null) { throw new NullPointerException(); } - serviceRootUrl_ = value; + bitField0_ |= 0x00000010; onChanged(); return this; } + /** * * @@ -2082,11 +2184,12 @@ public Builder setServiceRootUrl(java.lang.String value) { * @return This builder for chaining. */ public Builder clearServiceRootUrl() { - serviceRootUrl_ = getDefaultInstance().getServiceRootUrl(); + bitField0_ = (bitField0_ & ~0x00000010); onChanged(); return this; } + /** * * @@ -2107,28 +2210,29 @@ public Builder setServiceRootUrlBytes(com.google.protobuf.ByteString value) { throw new NullPointerException(); } checkByteStringIsUtf8(value); - serviceRootUrl_ = value; + bitField0_ |= 0x00000010; onChanged(); return this; } private java.lang.Object overview_ = ""; + /** * * *
              * Declares a single overview page. For example:
              * <pre><code>documentation:
        -     *   summary: ...
        -     *   overview: &#40;== include overview.md ==&#41;
        +     * summary: ...
        +     * overview: &#40;== include overview.md ==&#41;
              * </code></pre>
              * This is a shortcut for the following declaration (using pages style):
              * <pre><code>documentation:
        -     *   summary: ...
        -     *   pages:
        -     *   - name: Overview
        -     *     content: &#40;== include overview.md ==&#41;
        +     * summary: ...
        +     * pages:
        +     * - name: Overview
        +     * content: &#40;== include overview.md ==&#41;
              * </code></pre>
              * Note: you cannot specify both `overview` field and `pages` field.
              * 
        @@ -2148,21 +2252,22 @@ public java.lang.String getOverview() { return (java.lang.String) ref; } } + /** * * *
              * Declares a single overview page. For example:
              * <pre><code>documentation:
        -     *   summary: ...
        -     *   overview: &#40;== include overview.md ==&#41;
        +     * summary: ...
        +     * overview: &#40;== include overview.md ==&#41;
              * </code></pre>
              * This is a shortcut for the following declaration (using pages style):
              * <pre><code>documentation:
        -     *   summary: ...
        -     *   pages:
        -     *   - name: Overview
        -     *     content: &#40;== include overview.md ==&#41;
        +     * summary: ...
        +     * pages:
        +     * - name: Overview
        +     * content: &#40;== include overview.md ==&#41;
              * </code></pre>
              * Note: you cannot specify both `overview` field and `pages` field.
              * 
        @@ -2182,21 +2287,22 @@ public com.google.protobuf.ByteString getOverviewBytes() { return (com.google.protobuf.ByteString) ref; } } + /** * * *
              * Declares a single overview page. For example:
              * <pre><code>documentation:
        -     *   summary: ...
        -     *   overview: &#40;== include overview.md ==&#41;
        +     * summary: ...
        +     * overview: &#40;== include overview.md ==&#41;
              * </code></pre>
              * This is a shortcut for the following declaration (using pages style):
              * <pre><code>documentation:
        -     *   summary: ...
        -     *   pages:
        -     *   - name: Overview
        -     *     content: &#40;== include overview.md ==&#41;
        +     * summary: ...
        +     * pages:
        +     * - name: Overview
        +     * content: &#40;== include overview.md ==&#41;
              * </code></pre>
              * Note: you cannot specify both `overview` field and `pages` field.
              * 
        @@ -2210,26 +2316,27 @@ public Builder setOverview(java.lang.String value) { if (value == null) { throw new NullPointerException(); } - overview_ = value; + bitField0_ |= 0x00000020; onChanged(); return this; } + /** * * *
              * Declares a single overview page. For example:
              * <pre><code>documentation:
        -     *   summary: ...
        -     *   overview: &#40;== include overview.md ==&#41;
        +     * summary: ...
        +     * overview: &#40;== include overview.md ==&#41;
              * </code></pre>
              * This is a shortcut for the following declaration (using pages style):
              * <pre><code>documentation:
        -     *   summary: ...
        -     *   pages:
        -     *   - name: Overview
        -     *     content: &#40;== include overview.md ==&#41;
        +     * summary: ...
        +     * pages:
        +     * - name: Overview
        +     * content: &#40;== include overview.md ==&#41;
              * </code></pre>
              * Note: you cannot specify both `overview` field and `pages` field.
              * 
        @@ -2239,26 +2346,27 @@ public Builder setOverview(java.lang.String value) { * @return This builder for chaining. */ public Builder clearOverview() { - overview_ = getDefaultInstance().getOverview(); + bitField0_ = (bitField0_ & ~0x00000020); onChanged(); return this; } + /** * * *
              * Declares a single overview page. For example:
              * <pre><code>documentation:
        -     *   summary: ...
        -     *   overview: &#40;== include overview.md ==&#41;
        +     * summary: ...
        +     * overview: &#40;== include overview.md ==&#41;
              * </code></pre>
              * This is a shortcut for the following declaration (using pages style):
              * <pre><code>documentation:
        -     *   summary: ...
        -     *   pages:
        -     *   - name: Overview
        -     *     content: &#40;== include overview.md ==&#41;
        +     * summary: ...
        +     * pages:
        +     * - name: Overview
        +     * content: &#40;== include overview.md ==&#41;
              * </code></pre>
              * Note: you cannot specify both `overview` field and `pages` field.
              * 
        @@ -2273,23 +2381,12 @@ public Builder setOverviewBytes(com.google.protobuf.ByteString value) { throw new NullPointerException(); } checkByteStringIsUtf8(value); - overview_ = value; + bitField0_ |= 0x00000020; onChanged(); return this; } - @java.lang.Override - public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - // @@protoc_insertion_point(builder_scope:google.api.Documentation) } diff --git a/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/DocumentationOrBuilder.java b/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/DocumentationOrBuilder.java index 11af64871f..dabb559339 100644 --- a/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/DocumentationOrBuilder.java +++ b/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/DocumentationOrBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,10 +14,13 @@ * limitations under the License. */ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: google/api/documentation.proto +// Protobuf Java Version: 4.33.2 package com.google.api; +@com.google.protobuf.Generated public interface DocumentationOrBuilder extends // @@protoc_insertion_point(interface_extends:google.api.Documentation) @@ -38,6 +41,7 @@ public interface DocumentationOrBuilder * @return The summary. */ java.lang.String getSummary(); + /** * * @@ -64,6 +68,7 @@ public interface DocumentationOrBuilder * repeated .google.api.Page pages = 5; */ java.util.List getPagesList(); + /** * * @@ -74,6 +79,7 @@ public interface DocumentationOrBuilder * repeated .google.api.Page pages = 5; */ com.google.api.Page getPages(int index); + /** * * @@ -84,6 +90,7 @@ public interface DocumentationOrBuilder * repeated .google.api.Page pages = 5; */ int getPagesCount(); + /** * * @@ -94,6 +101,7 @@ public interface DocumentationOrBuilder * repeated .google.api.Page pages = 5; */ java.util.List getPagesOrBuilderList(); + /** * * @@ -110,50 +118,59 @@ public interface DocumentationOrBuilder * *
            * A list of documentation rules that apply to individual API elements.
        +   *
            * **NOTE:** All service configuration rules follow "last one wins" order.
            * 
        * * repeated .google.api.DocumentationRule rules = 3; */ java.util.List getRulesList(); + /** * * *
            * A list of documentation rules that apply to individual API elements.
        +   *
            * **NOTE:** All service configuration rules follow "last one wins" order.
            * 
        * * repeated .google.api.DocumentationRule rules = 3; */ com.google.api.DocumentationRule getRules(int index); + /** * * *
            * A list of documentation rules that apply to individual API elements.
        +   *
            * **NOTE:** All service configuration rules follow "last one wins" order.
            * 
        * * repeated .google.api.DocumentationRule rules = 3; */ int getRulesCount(); + /** * * *
            * A list of documentation rules that apply to individual API elements.
        +   *
            * **NOTE:** All service configuration rules follow "last one wins" order.
            * 
        * * repeated .google.api.DocumentationRule rules = 3; */ java.util.List getRulesOrBuilderList(); + /** * * *
            * A list of documentation rules that apply to individual API elements.
        +   *
            * **NOTE:** All service configuration rules follow "last one wins" order.
            * 
        * @@ -173,6 +190,7 @@ public interface DocumentationOrBuilder * @return The documentationRootUrl. */ java.lang.String getDocumentationRootUrl(); + /** * * @@ -201,6 +219,7 @@ public interface DocumentationOrBuilder * @return The serviceRootUrl. */ java.lang.String getServiceRootUrl(); + /** * * @@ -223,15 +242,15 @@ public interface DocumentationOrBuilder *
            * Declares a single overview page. For example:
            * <pre><code>documentation:
        -   *   summary: ...
        -   *   overview: &#40;== include overview.md ==&#41;
        +   * summary: ...
        +   * overview: &#40;== include overview.md ==&#41;
            * </code></pre>
            * This is a shortcut for the following declaration (using pages style):
            * <pre><code>documentation:
        -   *   summary: ...
        -   *   pages:
        -   *   - name: Overview
        -   *     content: &#40;== include overview.md ==&#41;
        +   * summary: ...
        +   * pages:
        +   * - name: Overview
        +   * content: &#40;== include overview.md ==&#41;
            * </code></pre>
            * Note: you cannot specify both `overview` field and `pages` field.
            * 
        @@ -241,21 +260,22 @@ public interface DocumentationOrBuilder * @return The overview. */ java.lang.String getOverview(); + /** * * *
            * Declares a single overview page. For example:
            * <pre><code>documentation:
        -   *   summary: ...
        -   *   overview: &#40;== include overview.md ==&#41;
        +   * summary: ...
        +   * overview: &#40;== include overview.md ==&#41;
            * </code></pre>
            * This is a shortcut for the following declaration (using pages style):
            * <pre><code>documentation:
        -   *   summary: ...
        -   *   pages:
        -   *   - name: Overview
        -   *     content: &#40;== include overview.md ==&#41;
        +   * summary: ...
        +   * pages:
        +   * - name: Overview
        +   * content: &#40;== include overview.md ==&#41;
            * </code></pre>
            * Note: you cannot specify both `overview` field and `pages` field.
            * 
        diff --git a/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/DocumentationProto.java b/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/DocumentationProto.java index e15d06447c..bd0830cb65 100644 --- a/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/DocumentationProto.java +++ b/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/DocumentationProto.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,13 +14,26 @@ * limitations under the License. */ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: google/api/documentation.proto +// Protobuf Java Version: 4.33.2 package com.google.api; -public final class DocumentationProto { +@com.google.protobuf.Generated +public final class DocumentationProto extends com.google.protobuf.GeneratedFile { private DocumentationProto() {} + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "DocumentationProto"); + } + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistryLite registry) {} public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry registry) { @@ -29,15 +42,15 @@ public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry r static final com.google.protobuf.Descriptors.Descriptor internal_static_google_api_Documentation_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable internal_static_google_api_Documentation_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_google_api_DocumentationRule_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable internal_static_google_api_DocumentationRule_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_google_api_Page_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable internal_static_google_api_Page_fieldAccessorTable; public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { @@ -66,28 +79,28 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { descriptor = com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( descriptorData, new com.google.protobuf.Descriptors.FileDescriptor[] {}); - internal_static_google_api_Documentation_descriptor = getDescriptor().getMessageTypes().get(0); + internal_static_google_api_Documentation_descriptor = getDescriptor().getMessageType(0); internal_static_google_api_Documentation_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_google_api_Documentation_descriptor, new java.lang.String[] { "Summary", "Pages", "Rules", "DocumentationRootUrl", "ServiceRootUrl", "Overview", }); - internal_static_google_api_DocumentationRule_descriptor = - getDescriptor().getMessageTypes().get(1); + internal_static_google_api_DocumentationRule_descriptor = getDescriptor().getMessageType(1); internal_static_google_api_DocumentationRule_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_google_api_DocumentationRule_descriptor, new java.lang.String[] { "Selector", "Description", "DeprecationDescription", }); - internal_static_google_api_Page_descriptor = getDescriptor().getMessageTypes().get(2); + internal_static_google_api_Page_descriptor = getDescriptor().getMessageType(2); internal_static_google_api_Page_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_google_api_Page_descriptor, new java.lang.String[] { "Name", "Content", "Subpages", }); + descriptor.resolveAllFeaturesImmutable(); } // @@protoc_insertion_point(outer_class_scope) diff --git a/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/DocumentationRule.java b/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/DocumentationRule.java index b4eac18a80..776df37745 100644 --- a/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/DocumentationRule.java +++ b/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/DocumentationRule.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,9 @@ * limitations under the License. */ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: google/api/documentation.proto +// Protobuf Java Version: 4.33.2 package com.google.api; @@ -27,13 +29,25 @@ * * Protobuf type {@code google.api.DocumentationRule} */ -public final class DocumentationRule extends com.google.protobuf.GeneratedMessageV3 +@com.google.protobuf.Generated +public final class DocumentationRule extends com.google.protobuf.GeneratedMessage implements // @@protoc_insertion_point(message_implements:google.api.DocumentationRule) DocumentationRuleOrBuilder { private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "DocumentationRule"); + } + // Use DocumentationRule.newBuilder() to construct. - private DocumentationRule(com.google.protobuf.GeneratedMessageV3.Builder builder) { + private DocumentationRule(com.google.protobuf.GeneratedMessage.Builder builder) { super(builder); } @@ -43,24 +57,13 @@ private DocumentationRule() { deprecationDescription_ = ""; } - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new DocumentationRule(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.api.DocumentationProto .internal_static_google_api_DocumentationRule_descriptor; } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.api.DocumentationProto .internal_static_google_api_DocumentationRule_fieldAccessorTable @@ -69,7 +72,10 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } public static final int SELECTOR_FIELD_NUMBER = 1; - private volatile java.lang.Object selector_; + + @SuppressWarnings("serial") + private volatile java.lang.Object selector_ = ""; + /** * * @@ -99,6 +105,7 @@ public java.lang.String getSelector() { return s; } } + /** * * @@ -130,7 +137,10 @@ public com.google.protobuf.ByteString getSelectorBytes() { } public static final int DESCRIPTION_FIELD_NUMBER = 2; - private volatile java.lang.Object description_; + + @SuppressWarnings("serial") + private volatile java.lang.Object description_ = ""; + /** * * @@ -156,6 +166,7 @@ public java.lang.String getDescription() { return s; } } + /** * * @@ -183,7 +194,10 @@ public com.google.protobuf.ByteString getDescriptionBytes() { } public static final int DEPRECATION_DESCRIPTION_FIELD_NUMBER = 3; - private volatile java.lang.Object deprecationDescription_; + + @SuppressWarnings("serial") + private volatile java.lang.Object deprecationDescription_ = ""; + /** * * @@ -208,6 +222,7 @@ public java.lang.String getDeprecationDescription() { return s; } } + /** * * @@ -247,14 +262,14 @@ public final boolean isInitialized() { @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(selector_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, selector_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(selector_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, selector_); } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(description_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 2, description_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(description_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, description_); } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(deprecationDescription_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 3, deprecationDescription_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(deprecationDescription_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 3, deprecationDescription_); } getUnknownFields().writeTo(output); } @@ -265,14 +280,14 @@ public int getSerializedSize() { if (size != -1) return size; size = 0; - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(selector_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, selector_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(selector_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, selector_); } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(description_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, description_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(description_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, description_); } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(deprecationDescription_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, deprecationDescription_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(deprecationDescription_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(3, deprecationDescription_); } size += getUnknownFields().getSerializedSize(); memoizedSize = size; @@ -350,38 +365,38 @@ public static com.google.api.DocumentationRule parseFrom( public static com.google.api.DocumentationRule parseFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); } public static com.google.api.DocumentationRule parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } public static com.google.api.DocumentationRule parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); } public static com.google.api.DocumentationRule parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( PARSER, input, extensionRegistry); } public static com.google.api.DocumentationRule parseFrom( com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); } public static com.google.api.DocumentationRule parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } @@ -404,10 +419,11 @@ public Builder toBuilder() { } @java.lang.Override - protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { Builder builder = new Builder(parent); return builder; } + /** * * @@ -417,7 +433,7 @@ protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.Build * * Protobuf type {@code google.api.DocumentationRule} */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder implements // @@protoc_insertion_point(builder_implements:google.api.DocumentationRule) com.google.api.DocumentationRuleOrBuilder { @@ -427,7 +443,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.api.DocumentationProto .internal_static_google_api_DocumentationRule_fieldAccessorTable @@ -439,19 +455,17 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { // Construct using com.google.api.DocumentationRule.newBuilder() private Builder() {} - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { super(parent); } @java.lang.Override public Builder clear() { super.clear(); + bitField0_ = 0; selector_ = ""; - description_ = ""; - deprecationDescription_ = ""; - return this; } @@ -478,44 +492,24 @@ public com.google.api.DocumentationRule build() { @java.lang.Override public com.google.api.DocumentationRule buildPartial() { com.google.api.DocumentationRule result = new com.google.api.DocumentationRule(this); - result.selector_ = selector_; - result.description_ = description_; - result.deprecationDescription_ = deprecationDescription_; + if (bitField0_ != 0) { + buildPartial0(result); + } 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); + private void buildPartial0(com.google.api.DocumentationRule result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.selector_ = selector_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.description_ = description_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.deprecationDescription_ = deprecationDescription_; + } } @java.lang.Override @@ -532,14 +526,17 @@ public Builder mergeFrom(com.google.api.DocumentationRule other) { if (other == com.google.api.DocumentationRule.getDefaultInstance()) return this; if (!other.getSelector().isEmpty()) { selector_ = other.selector_; + bitField0_ |= 0x00000001; onChanged(); } if (!other.getDescription().isEmpty()) { description_ = other.description_; + bitField0_ |= 0x00000002; onChanged(); } if (!other.getDeprecationDescription().isEmpty()) { deprecationDescription_ = other.deprecationDescription_; + bitField0_ |= 0x00000004; onChanged(); } this.mergeUnknownFields(other.getUnknownFields()); @@ -571,19 +568,19 @@ public Builder mergeFrom( case 10: { selector_ = input.readStringRequireUtf8(); - + bitField0_ |= 0x00000001; break; } // case 10 case 18: { description_ = input.readStringRequireUtf8(); - + bitField0_ |= 0x00000002; break; } // case 18 case 26: { deprecationDescription_ = input.readStringRequireUtf8(); - + bitField0_ |= 0x00000004; break; } // case 26 default: @@ -603,7 +600,10 @@ public Builder mergeFrom( return this; } + private int bitField0_; + private java.lang.Object selector_ = ""; + /** * * @@ -632,6 +632,7 @@ public java.lang.String getSelector() { return (java.lang.String) ref; } } + /** * * @@ -660,6 +661,7 @@ public com.google.protobuf.ByteString getSelectorBytes() { return (com.google.protobuf.ByteString) ref; } } + /** * * @@ -682,11 +684,12 @@ public Builder setSelector(java.lang.String value) { if (value == null) { throw new NullPointerException(); } - selector_ = value; + bitField0_ |= 0x00000001; onChanged(); return this; } + /** * * @@ -705,11 +708,12 @@ public Builder setSelector(java.lang.String value) { * @return This builder for chaining. */ public Builder clearSelector() { - selector_ = getDefaultInstance().getSelector(); + bitField0_ = (bitField0_ & ~0x00000001); onChanged(); return this; } + /** * * @@ -733,13 +737,14 @@ public Builder setSelectorBytes(com.google.protobuf.ByteString value) { throw new NullPointerException(); } checkByteStringIsUtf8(value); - selector_ = value; + bitField0_ |= 0x00000001; onChanged(); return this; } private java.lang.Object description_ = ""; + /** * * @@ -764,6 +769,7 @@ public java.lang.String getDescription() { return (java.lang.String) ref; } } + /** * * @@ -788,6 +794,7 @@ public com.google.protobuf.ByteString getDescriptionBytes() { return (com.google.protobuf.ByteString) ref; } } + /** * * @@ -806,11 +813,12 @@ public Builder setDescription(java.lang.String value) { if (value == null) { throw new NullPointerException(); } - description_ = value; + bitField0_ |= 0x00000002; onChanged(); return this; } + /** * * @@ -825,11 +833,12 @@ public Builder setDescription(java.lang.String value) { * @return This builder for chaining. */ public Builder clearDescription() { - description_ = getDefaultInstance().getDescription(); + bitField0_ = (bitField0_ & ~0x00000002); onChanged(); return this; } + /** * * @@ -849,13 +858,14 @@ public Builder setDescriptionBytes(com.google.protobuf.ByteString value) { throw new NullPointerException(); } checkByteStringIsUtf8(value); - description_ = value; + bitField0_ |= 0x00000002; onChanged(); return this; } private java.lang.Object deprecationDescription_ = ""; + /** * * @@ -879,6 +889,7 @@ public java.lang.String getDeprecationDescription() { return (java.lang.String) ref; } } + /** * * @@ -902,6 +913,7 @@ public com.google.protobuf.ByteString getDeprecationDescriptionBytes() { return (com.google.protobuf.ByteString) ref; } } + /** * * @@ -919,11 +931,12 @@ public Builder setDeprecationDescription(java.lang.String value) { if (value == null) { throw new NullPointerException(); } - deprecationDescription_ = value; + bitField0_ |= 0x00000004; onChanged(); return this; } + /** * * @@ -937,11 +950,12 @@ public Builder setDeprecationDescription(java.lang.String value) { * @return This builder for chaining. */ public Builder clearDeprecationDescription() { - deprecationDescription_ = getDefaultInstance().getDeprecationDescription(); + bitField0_ = (bitField0_ & ~0x00000004); onChanged(); return this; } + /** * * @@ -960,23 +974,12 @@ public Builder setDeprecationDescriptionBytes(com.google.protobuf.ByteString val throw new NullPointerException(); } checkByteStringIsUtf8(value); - deprecationDescription_ = 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.api.DocumentationRule) } diff --git a/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/DocumentationRuleOrBuilder.java b/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/DocumentationRuleOrBuilder.java index 29fae9e03c..ded82b90ca 100644 --- a/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/DocumentationRuleOrBuilder.java +++ b/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/DocumentationRuleOrBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,10 +14,13 @@ * limitations under the License. */ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: google/api/documentation.proto +// Protobuf Java Version: 4.33.2 package com.google.api; +@com.google.protobuf.Generated public interface DocumentationRuleOrBuilder extends // @@protoc_insertion_point(interface_extends:google.api.DocumentationRule) @@ -41,6 +44,7 @@ public interface DocumentationRuleOrBuilder * @return The selector. */ java.lang.String getSelector(); + /** * * @@ -74,6 +78,7 @@ public interface DocumentationRuleOrBuilder * @return The description. */ java.lang.String getDescription(); + /** * * @@ -102,6 +107,7 @@ public interface DocumentationRuleOrBuilder * @return The deprecationDescription. */ java.lang.String getDeprecationDescription(); + /** * * diff --git a/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/DotnetSettings.java b/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/DotnetSettings.java index 43d09ca387..c12b21fed5 100644 --- a/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/DotnetSettings.java +++ b/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/DotnetSettings.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,9 @@ * limitations under the License. */ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: google/api/client.proto +// Protobuf Java Version: 4.33.2 package com.google.api; @@ -27,43 +29,64 @@ * * Protobuf type {@code google.api.DotnetSettings} */ -public final class DotnetSettings extends com.google.protobuf.GeneratedMessageV3 +@com.google.protobuf.Generated +public final class DotnetSettings extends com.google.protobuf.GeneratedMessage implements // @@protoc_insertion_point(message_implements:google.api.DotnetSettings) DotnetSettingsOrBuilder { private static final long serialVersionUID = 0L; - // Use DotnetSettings.newBuilder() to construct. - private DotnetSettings(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private DotnetSettings() {} + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "DotnetSettings"); + } - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new DotnetSettings(); + // Use DotnetSettings.newBuilder() to construct. + private DotnetSettings(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); } - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; + private DotnetSettings() { + ignoredResources_ = com.google.protobuf.LazyStringArrayList.emptyList(); + forcedNamespaceAliases_ = com.google.protobuf.LazyStringArrayList.emptyList(); + handwrittenSignatures_ = com.google.protobuf.LazyStringArrayList.emptyList(); } public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.api.ClientProto.internal_static_google_api_DotnetSettings_descriptor; } + @SuppressWarnings({"rawtypes"}) + @java.lang.Override + protected com.google.protobuf.MapFieldReflectionAccessor internalGetMapFieldReflection( + int number) { + switch (number) { + case 2: + return internalGetRenamedServices(); + case 3: + return internalGetRenamedResources(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.api.ClientProto.internal_static_google_api_DotnetSettings_fieldAccessorTable .ensureFieldAccessorsInitialized( com.google.api.DotnetSettings.class, com.google.api.DotnetSettings.Builder.class); } + private int bitField0_; public static final int COMMON_FIELD_NUMBER = 1; private com.google.api.CommonLanguageSettings common_; + /** * * @@ -77,8 +100,9 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { */ @java.lang.Override public boolean hasCommon() { - return common_ != null; + return ((bitField0_ & 0x00000001) != 0); } + /** * * @@ -94,6 +118,7 @@ public boolean hasCommon() { public com.google.api.CommonLanguageSettings getCommon() { return common_ == null ? com.google.api.CommonLanguageSettings.getDefaultInstance() : common_; } + /** * * @@ -105,537 +130,2244 @@ public com.google.api.CommonLanguageSettings getCommon() { */ @java.lang.Override public com.google.api.CommonLanguageSettingsOrBuilder getCommonOrBuilder() { - return getCommon(); + return common_ == null ? com.google.api.CommonLanguageSettings.getDefaultInstance() : common_; } - private byte memoizedIsInitialized = -1; + public static final int RENAMED_SERVICES_FIELD_NUMBER = 2; + + private static final class RenamedServicesDefaultEntryHolder { + static final com.google.protobuf.MapEntry defaultEntry = + com.google.protobuf.MapEntry.newDefaultInstance( + com.google.api.ClientProto + .internal_static_google_api_DotnetSettings_RenamedServicesEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.STRING, + ""); + } - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; + @SuppressWarnings("serial") + private com.google.protobuf.MapField renamedServices_; - memoizedIsInitialized = 1; - return true; + private com.google.protobuf.MapField + internalGetRenamedServices() { + if (renamedServices_ == null) { + return com.google.protobuf.MapField.emptyMapField( + RenamedServicesDefaultEntryHolder.defaultEntry); + } + return renamedServices_; + } + + public int getRenamedServicesCount() { + return internalGetRenamedServices().getMap().size(); } + /** + * + * + *
        +   * Map from original service names to renamed versions.
        +   * This is used when the default generated types
        +   * would cause a naming conflict. (Neither name is
        +   * fully-qualified.)
        +   * Example: Subscriber to SubscriberServiceApi.
        +   * 
        + * + * map<string, string> renamed_services = 2; + */ @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (common_ != null) { - output.writeMessage(1, getCommon()); + public boolean containsRenamedServices(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); } - getUnknownFields().writeTo(output); + return internalGetRenamedServices().getMap().containsKey(key); } + /** Use {@link #getRenamedServicesMap()} instead. */ @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (common_ != null) { - size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getCommon()); - } - size += getUnknownFields().getSerializedSize(); - memoizedSize = size; - return size; + @java.lang.Deprecated + public java.util.Map getRenamedServices() { + return getRenamedServicesMap(); } + /** + * + * + *
        +   * Map from original service names to renamed versions.
        +   * This is used when the default generated types
        +   * would cause a naming conflict. (Neither name is
        +   * fully-qualified.)
        +   * Example: Subscriber to SubscriberServiceApi.
        +   * 
        + * + * map<string, string> renamed_services = 2; + */ @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof com.google.api.DotnetSettings)) { - return super.equals(obj); - } - com.google.api.DotnetSettings other = (com.google.api.DotnetSettings) obj; + public java.util.Map getRenamedServicesMap() { + return internalGetRenamedServices().getMap(); + } - if (hasCommon() != other.hasCommon()) return false; - if (hasCommon()) { - if (!getCommon().equals(other.getCommon())) return false; + /** + * + * + *
        +   * Map from original service names to renamed versions.
        +   * This is used when the default generated types
        +   * would cause a naming conflict. (Neither name is
        +   * fully-qualified.)
        +   * Example: Subscriber to SubscriberServiceApi.
        +   * 
        + * + * map<string, string> renamed_services = 2; + */ + @java.lang.Override + public /* nullable */ java.lang.String getRenamedServicesOrDefault( + java.lang.String key, + /* nullable */ + java.lang.String defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); } - if (!getUnknownFields().equals(other.getUnknownFields())) return false; - return true; + java.util.Map map = internalGetRenamedServices().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; } + /** + * + * + *
        +   * Map from original service names to renamed versions.
        +   * This is used when the default generated types
        +   * would cause a naming conflict. (Neither name is
        +   * fully-qualified.)
        +   * Example: Subscriber to SubscriberServiceApi.
        +   * 
        + * + * map<string, string> renamed_services = 2; + */ @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; + public java.lang.String getRenamedServicesOrThrow(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - if (hasCommon()) { - hash = (37 * hash) + COMMON_FIELD_NUMBER; - hash = (53 * hash) + getCommon().hashCode(); + java.util.Map map = internalGetRenamedServices().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); } - hash = (29 * hash) + getUnknownFields().hashCode(); - memoizedHashCode = hash; - return hash; + return map.get(key); } - public static com.google.api.DotnetSettings parseFrom(java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); + public static final int RENAMED_RESOURCES_FIELD_NUMBER = 3; + + private static final class RenamedResourcesDefaultEntryHolder { + static final com.google.protobuf.MapEntry defaultEntry = + com.google.protobuf.MapEntry.newDefaultInstance( + com.google.api.ClientProto + .internal_static_google_api_DotnetSettings_RenamedResourcesEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.STRING, + ""); } - public static com.google.api.DotnetSettings parseFrom( - java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } + @SuppressWarnings("serial") + private com.google.protobuf.MapField renamedResources_; - public static com.google.api.DotnetSettings parseFrom(com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); + private com.google.protobuf.MapField + internalGetRenamedResources() { + if (renamedResources_ == null) { + return com.google.protobuf.MapField.emptyMapField( + RenamedResourcesDefaultEntryHolder.defaultEntry); + } + return renamedResources_; } - public static com.google.api.DotnetSettings parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); + public int getRenamedResourcesCount() { + return internalGetRenamedResources().getMap().size(); } - public static com.google.api.DotnetSettings parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); + /** + * + * + *
        +   * Map from full resource types to the effective short name
        +   * for the resource. This is used when otherwise resource
        +   * named from different services would cause naming collisions.
        +   * Example entry:
        +   * "datalabeling.googleapis.com/Dataset": "DataLabelingDataset"
        +   * 
        + * + * map<string, string> renamed_resources = 3; + */ + @java.lang.Override + public boolean containsRenamedResources(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + return internalGetRenamedResources().getMap().containsKey(key); } - public static com.google.api.DotnetSettings parseFrom( - byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); + /** Use {@link #getRenamedResourcesMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getRenamedResources() { + return getRenamedResourcesMap(); } - public static com.google.api.DotnetSettings parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + /** + * + * + *
        +   * Map from full resource types to the effective short name
        +   * for the resource. This is used when otherwise resource
        +   * named from different services would cause naming collisions.
        +   * Example entry:
        +   * "datalabeling.googleapis.com/Dataset": "DataLabelingDataset"
        +   * 
        + * + * map<string, string> renamed_resources = 3; + */ + @java.lang.Override + public java.util.Map getRenamedResourcesMap() { + return internalGetRenamedResources().getMap(); } - public static com.google.api.DotnetSettings parseFrom( - java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( - PARSER, input, extensionRegistry); + /** + * + * + *
        +   * Map from full resource types to the effective short name
        +   * for the resource. This is used when otherwise resource
        +   * named from different services would cause naming collisions.
        +   * Example entry:
        +   * "datalabeling.googleapis.com/Dataset": "DataLabelingDataset"
        +   * 
        + * + * map<string, string> renamed_resources = 3; + */ + @java.lang.Override + public /* nullable */ java.lang.String getRenamedResourcesOrDefault( + java.lang.String key, + /* nullable */ + java.lang.String defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetRenamedResources().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; } - public static com.google.api.DotnetSettings parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + /** + * + * + *
        +   * Map from full resource types to the effective short name
        +   * for the resource. This is used when otherwise resource
        +   * named from different services would cause naming collisions.
        +   * Example entry:
        +   * "datalabeling.googleapis.com/Dataset": "DataLabelingDataset"
        +   * 
        + * + * map<string, string> renamed_resources = 3; + */ + @java.lang.Override + public java.lang.String getRenamedResourcesOrThrow(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetRenamedResources().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); } - public static com.google.api.DotnetSettings 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 final int IGNORED_RESOURCES_FIELD_NUMBER = 4; - public static com.google.api.DotnetSettings parseFrom(com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } + @SuppressWarnings("serial") + private com.google.protobuf.LazyStringArrayList ignoredResources_ = + com.google.protobuf.LazyStringArrayList.emptyList(); - public static com.google.api.DotnetSettings parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( - PARSER, input, extensionRegistry); + /** + * + * + *
        +   * List of full resource types to ignore during generation.
        +   * This is typically used for API-specific Location resources,
        +   * which should be handled by the generator as if they were actually
        +   * the common Location resources.
        +   * Example entry: "documentai.googleapis.com/Location"
        +   * 
        + * + * repeated string ignored_resources = 4; + * + * @return A list containing the ignoredResources. + */ + public com.google.protobuf.ProtocolStringList getIgnoredResourcesList() { + return ignoredResources_; } - @java.lang.Override - public Builder newBuilderForType() { - return newBuilder(); + /** + * + * + *
        +   * List of full resource types to ignore during generation.
        +   * This is typically used for API-specific Location resources,
        +   * which should be handled by the generator as if they were actually
        +   * the common Location resources.
        +   * Example entry: "documentai.googleapis.com/Location"
        +   * 
        + * + * repeated string ignored_resources = 4; + * + * @return The count of ignoredResources. + */ + public int getIgnoredResourcesCount() { + return ignoredResources_.size(); } - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); + /** + * + * + *
        +   * List of full resource types to ignore during generation.
        +   * This is typically used for API-specific Location resources,
        +   * which should be handled by the generator as if they were actually
        +   * the common Location resources.
        +   * Example entry: "documentai.googleapis.com/Location"
        +   * 
        + * + * repeated string ignored_resources = 4; + * + * @param index The index of the element to return. + * @return The ignoredResources at the given index. + */ + public java.lang.String getIgnoredResources(int index) { + return ignoredResources_.get(index); } - public static Builder newBuilder(com.google.api.DotnetSettings prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + /** + * + * + *
        +   * List of full resource types to ignore during generation.
        +   * This is typically used for API-specific Location resources,
        +   * which should be handled by the generator as if they were actually
        +   * the common Location resources.
        +   * Example entry: "documentai.googleapis.com/Location"
        +   * 
        + * + * repeated string ignored_resources = 4; + * + * @param index The index of the value to return. + * @return The bytes of the ignoredResources at the given index. + */ + public com.google.protobuf.ByteString getIgnoredResourcesBytes(int index) { + return ignoredResources_.getByteString(index); } - @java.lang.Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + public static final int FORCED_NAMESPACE_ALIASES_FIELD_NUMBER = 5; + + @SuppressWarnings("serial") + private com.google.protobuf.LazyStringArrayList forcedNamespaceAliases_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + + /** + * + * + *
        +   * Namespaces which must be aliased in snippets due to
        +   * a known (but non-generator-predictable) naming collision
        +   * 
        + * + * repeated string forced_namespace_aliases = 5; + * + * @return A list containing the forcedNamespaceAliases. + */ + public com.google.protobuf.ProtocolStringList getForcedNamespaceAliasesList() { + return forcedNamespaceAliases_; } - @java.lang.Override - protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; + /** + * + * + *
        +   * Namespaces which must be aliased in snippets due to
        +   * a known (but non-generator-predictable) naming collision
        +   * 
        + * + * repeated string forced_namespace_aliases = 5; + * + * @return The count of forcedNamespaceAliases. + */ + public int getForcedNamespaceAliasesCount() { + return forcedNamespaceAliases_.size(); } + /** * * *
        -   * Settings for Dotnet client libraries.
        +   * Namespaces which must be aliased in snippets due to
        +   * a known (but non-generator-predictable) naming collision
            * 
        * - * Protobuf type {@code google.api.DotnetSettings} + * repeated string forced_namespace_aliases = 5; + * + * @param index The index of the element to return. + * @return The forcedNamespaceAliases at the given index. */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder - implements - // @@protoc_insertion_point(builder_implements:google.api.DotnetSettings) - com.google.api.DotnetSettingsOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.api.ClientProto.internal_static_google_api_DotnetSettings_descriptor; - } + public java.lang.String getForcedNamespaceAliases(int index) { + return forcedNamespaceAliases_.get(index); + } - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.api.ClientProto.internal_static_google_api_DotnetSettings_fieldAccessorTable - .ensureFieldAccessorsInitialized( + /** + * + * + *
        +   * Namespaces which must be aliased in snippets due to
        +   * a known (but non-generator-predictable) naming collision
        +   * 
        + * + * repeated string forced_namespace_aliases = 5; + * + * @param index The index of the value to return. + * @return The bytes of the forcedNamespaceAliases at the given index. + */ + public com.google.protobuf.ByteString getForcedNamespaceAliasesBytes(int index) { + return forcedNamespaceAliases_.getByteString(index); + } + + public static final int HANDWRITTEN_SIGNATURES_FIELD_NUMBER = 6; + + @SuppressWarnings("serial") + private com.google.protobuf.LazyStringArrayList handwrittenSignatures_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + + /** + * + * + *
        +   * Method signatures (in the form "service.method(signature)")
        +   * which are provided separately, so shouldn't be generated.
        +   * Snippets *calling* these methods are still generated, however.
        +   * 
        + * + * repeated string handwritten_signatures = 6; + * + * @return A list containing the handwrittenSignatures. + */ + public com.google.protobuf.ProtocolStringList getHandwrittenSignaturesList() { + return handwrittenSignatures_; + } + + /** + * + * + *
        +   * Method signatures (in the form "service.method(signature)")
        +   * which are provided separately, so shouldn't be generated.
        +   * Snippets *calling* these methods are still generated, however.
        +   * 
        + * + * repeated string handwritten_signatures = 6; + * + * @return The count of handwrittenSignatures. + */ + public int getHandwrittenSignaturesCount() { + return handwrittenSignatures_.size(); + } + + /** + * + * + *
        +   * Method signatures (in the form "service.method(signature)")
        +   * which are provided separately, so shouldn't be generated.
        +   * Snippets *calling* these methods are still generated, however.
        +   * 
        + * + * repeated string handwritten_signatures = 6; + * + * @param index The index of the element to return. + * @return The handwrittenSignatures at the given index. + */ + public java.lang.String getHandwrittenSignatures(int index) { + return handwrittenSignatures_.get(index); + } + + /** + * + * + *
        +   * Method signatures (in the form "service.method(signature)")
        +   * which are provided separately, so shouldn't be generated.
        +   * Snippets *calling* these methods are still generated, however.
        +   * 
        + * + * repeated string handwritten_signatures = 6; + * + * @param index The index of the value to return. + * @return The bytes of the handwrittenSignatures at the given index. + */ + public com.google.protobuf.ByteString getHandwrittenSignaturesBytes(int index) { + return handwrittenSignatures_.getByteString(index); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(1, getCommon()); + } + com.google.protobuf.GeneratedMessage.serializeStringMapTo( + output, internalGetRenamedServices(), RenamedServicesDefaultEntryHolder.defaultEntry, 2); + com.google.protobuf.GeneratedMessage.serializeStringMapTo( + output, internalGetRenamedResources(), RenamedResourcesDefaultEntryHolder.defaultEntry, 3); + for (int i = 0; i < ignoredResources_.size(); i++) { + com.google.protobuf.GeneratedMessage.writeString(output, 4, ignoredResources_.getRaw(i)); + } + for (int i = 0; i < forcedNamespaceAliases_.size(); i++) { + com.google.protobuf.GeneratedMessage.writeString( + output, 5, forcedNamespaceAliases_.getRaw(i)); + } + for (int i = 0; i < handwrittenSignatures_.size(); i++) { + com.google.protobuf.GeneratedMessage.writeString(output, 6, handwrittenSignatures_.getRaw(i)); + } + 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, getCommon()); + } + for (java.util.Map.Entry entry : + internalGetRenamedServices().getMap().entrySet()) { + com.google.protobuf.MapEntry renamedServices__ = + RenamedServicesDefaultEntryHolder.defaultEntry + .newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, renamedServices__); + } + for (java.util.Map.Entry entry : + internalGetRenamedResources().getMap().entrySet()) { + com.google.protobuf.MapEntry renamedResources__ = + RenamedResourcesDefaultEntryHolder.defaultEntry + .newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, renamedResources__); + } + { + int dataSize = 0; + for (int i = 0; i < ignoredResources_.size(); i++) { + dataSize += computeStringSizeNoTag(ignoredResources_.getRaw(i)); + } + size += dataSize; + size += 1 * getIgnoredResourcesList().size(); + } + { + int dataSize = 0; + for (int i = 0; i < forcedNamespaceAliases_.size(); i++) { + dataSize += computeStringSizeNoTag(forcedNamespaceAliases_.getRaw(i)); + } + size += dataSize; + size += 1 * getForcedNamespaceAliasesList().size(); + } + { + int dataSize = 0; + for (int i = 0; i < handwrittenSignatures_.size(); i++) { + dataSize += computeStringSizeNoTag(handwrittenSignatures_.getRaw(i)); + } + size += dataSize; + size += 1 * getHandwrittenSignaturesList().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.api.DotnetSettings)) { + return super.equals(obj); + } + com.google.api.DotnetSettings other = (com.google.api.DotnetSettings) obj; + + if (hasCommon() != other.hasCommon()) return false; + if (hasCommon()) { + if (!getCommon().equals(other.getCommon())) return false; + } + if (!internalGetRenamedServices().equals(other.internalGetRenamedServices())) return false; + if (!internalGetRenamedResources().equals(other.internalGetRenamedResources())) return false; + if (!getIgnoredResourcesList().equals(other.getIgnoredResourcesList())) return false; + if (!getForcedNamespaceAliasesList().equals(other.getForcedNamespaceAliasesList())) + return false; + if (!getHandwrittenSignaturesList().equals(other.getHandwrittenSignaturesList())) 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 (hasCommon()) { + hash = (37 * hash) + COMMON_FIELD_NUMBER; + hash = (53 * hash) + getCommon().hashCode(); + } + if (!internalGetRenamedServices().getMap().isEmpty()) { + hash = (37 * hash) + RENAMED_SERVICES_FIELD_NUMBER; + hash = (53 * hash) + internalGetRenamedServices().hashCode(); + } + if (!internalGetRenamedResources().getMap().isEmpty()) { + hash = (37 * hash) + RENAMED_RESOURCES_FIELD_NUMBER; + hash = (53 * hash) + internalGetRenamedResources().hashCode(); + } + if (getIgnoredResourcesCount() > 0) { + hash = (37 * hash) + IGNORED_RESOURCES_FIELD_NUMBER; + hash = (53 * hash) + getIgnoredResourcesList().hashCode(); + } + if (getForcedNamespaceAliasesCount() > 0) { + hash = (37 * hash) + FORCED_NAMESPACE_ALIASES_FIELD_NUMBER; + hash = (53 * hash) + getForcedNamespaceAliasesList().hashCode(); + } + if (getHandwrittenSignaturesCount() > 0) { + hash = (37 * hash) + HANDWRITTEN_SIGNATURES_FIELD_NUMBER; + hash = (53 * hash) + getHandwrittenSignaturesList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.api.DotnetSettings parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.api.DotnetSettings parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.api.DotnetSettings parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.api.DotnetSettings parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.api.DotnetSettings parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.api.DotnetSettings parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.api.DotnetSettings parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.api.DotnetSettings parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.api.DotnetSettings parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.api.DotnetSettings parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.api.DotnetSettings parseFrom(com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.api.DotnetSettings parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.api.DotnetSettings 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
        +   * Settings for Dotnet client libraries.
        +   * 
        + * + * Protobuf type {@code google.api.DotnetSettings} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.api.DotnetSettings) + com.google.api.DotnetSettingsOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.api.ClientProto.internal_static_google_api_DotnetSettings_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapFieldReflectionAccessor internalGetMapFieldReflection( + int number) { + switch (number) { + case 2: + return internalGetRenamedServices(); + case 3: + return internalGetRenamedResources(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapFieldReflectionAccessor internalGetMutableMapFieldReflection( + int number) { + switch (number) { + case 2: + return internalGetMutableRenamedServices(); + case 3: + return internalGetMutableRenamedResources(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.api.ClientProto.internal_static_google_api_DotnetSettings_fieldAccessorTable + .ensureFieldAccessorsInitialized( com.google.api.DotnetSettings.class, com.google.api.DotnetSettings.Builder.class); } - // Construct using com.google.api.DotnetSettings.newBuilder() - private Builder() {} + // Construct using com.google.api.DotnetSettings.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetCommonFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + common_ = null; + if (commonBuilder_ != null) { + commonBuilder_.dispose(); + commonBuilder_ = null; + } + internalGetMutableRenamedServices().clear(); + internalGetMutableRenamedResources().clear(); + ignoredResources_ = com.google.protobuf.LazyStringArrayList.emptyList(); + forcedNamespaceAliases_ = com.google.protobuf.LazyStringArrayList.emptyList(); + handwrittenSignatures_ = com.google.protobuf.LazyStringArrayList.emptyList(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.api.ClientProto.internal_static_google_api_DotnetSettings_descriptor; + } + + @java.lang.Override + public com.google.api.DotnetSettings getDefaultInstanceForType() { + return com.google.api.DotnetSettings.getDefaultInstance(); + } + + @java.lang.Override + public com.google.api.DotnetSettings build() { + com.google.api.DotnetSettings result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.api.DotnetSettings buildPartial() { + com.google.api.DotnetSettings result = new com.google.api.DotnetSettings(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.api.DotnetSettings result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.common_ = commonBuilder_ == null ? common_ : commonBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.renamedServices_ = internalGetRenamedServices(); + result.renamedServices_.makeImmutable(); + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.renamedResources_ = internalGetRenamedResources(); + result.renamedResources_.makeImmutable(); + } + if (((from_bitField0_ & 0x00000008) != 0)) { + ignoredResources_.makeImmutable(); + result.ignoredResources_ = ignoredResources_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + forcedNamespaceAliases_.makeImmutable(); + result.forcedNamespaceAliases_ = forcedNamespaceAliases_; + } + if (((from_bitField0_ & 0x00000020) != 0)) { + handwrittenSignatures_.makeImmutable(); + result.handwrittenSignatures_ = handwrittenSignatures_; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.api.DotnetSettings) { + return mergeFrom((com.google.api.DotnetSettings) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.api.DotnetSettings other) { + if (other == com.google.api.DotnetSettings.getDefaultInstance()) return this; + if (other.hasCommon()) { + mergeCommon(other.getCommon()); + } + internalGetMutableRenamedServices().mergeFrom(other.internalGetRenamedServices()); + bitField0_ |= 0x00000002; + internalGetMutableRenamedResources().mergeFrom(other.internalGetRenamedResources()); + bitField0_ |= 0x00000004; + if (!other.ignoredResources_.isEmpty()) { + if (ignoredResources_.isEmpty()) { + ignoredResources_ = other.ignoredResources_; + bitField0_ |= 0x00000008; + } else { + ensureIgnoredResourcesIsMutable(); + ignoredResources_.addAll(other.ignoredResources_); + } + onChanged(); + } + if (!other.forcedNamespaceAliases_.isEmpty()) { + if (forcedNamespaceAliases_.isEmpty()) { + forcedNamespaceAliases_ = other.forcedNamespaceAliases_; + bitField0_ |= 0x00000010; + } else { + ensureForcedNamespaceAliasesIsMutable(); + forcedNamespaceAliases_.addAll(other.forcedNamespaceAliases_); + } + onChanged(); + } + if (!other.handwrittenSignatures_.isEmpty()) { + if (handwrittenSignatures_.isEmpty()) { + handwrittenSignatures_ = other.handwrittenSignatures_; + bitField0_ |= 0x00000020; + } else { + ensureHandwrittenSignaturesIsMutable(); + handwrittenSignatures_.addAll(other.handwrittenSignatures_); + } + 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(internalGetCommonFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + com.google.protobuf.MapEntry renamedServices__ = + input.readMessage( + RenamedServicesDefaultEntryHolder.defaultEntry.getParserForType(), + extensionRegistry); + internalGetMutableRenamedServices() + .getMutableMap() + .put(renamedServices__.getKey(), renamedServices__.getValue()); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + com.google.protobuf.MapEntry + renamedResources__ = + input.readMessage( + RenamedResourcesDefaultEntryHolder.defaultEntry.getParserForType(), + extensionRegistry); + internalGetMutableRenamedResources() + .getMutableMap() + .put(renamedResources__.getKey(), renamedResources__.getValue()); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 34: + { + java.lang.String s = input.readStringRequireUtf8(); + ensureIgnoredResourcesIsMutable(); + ignoredResources_.add(s); + break; + } // case 34 + case 42: + { + java.lang.String s = input.readStringRequireUtf8(); + ensureForcedNamespaceAliasesIsMutable(); + forcedNamespaceAliases_.add(s); + break; + } // case 42 + case 50: + { + java.lang.String s = input.readStringRequireUtf8(); + ensureHandwrittenSignaturesIsMutable(); + handwrittenSignatures_.add(s); + 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 com.google.api.CommonLanguageSettings common_; + private com.google.protobuf.SingleFieldBuilder< + com.google.api.CommonLanguageSettings, + com.google.api.CommonLanguageSettings.Builder, + com.google.api.CommonLanguageSettingsOrBuilder> + commonBuilder_; + + /** + * + * + *
        +     * Some settings.
        +     * 
        + * + * .google.api.CommonLanguageSettings common = 1; + * + * @return Whether the common field is set. + */ + public boolean hasCommon() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
        +     * Some settings.
        +     * 
        + * + * .google.api.CommonLanguageSettings common = 1; + * + * @return The common. + */ + public com.google.api.CommonLanguageSettings getCommon() { + if (commonBuilder_ == null) { + return common_ == null + ? com.google.api.CommonLanguageSettings.getDefaultInstance() + : common_; + } else { + return commonBuilder_.getMessage(); + } + } + + /** + * + * + *
        +     * Some settings.
        +     * 
        + * + * .google.api.CommonLanguageSettings common = 1; + */ + public Builder setCommon(com.google.api.CommonLanguageSettings value) { + if (commonBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + common_ = value; + } else { + commonBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
        +     * Some settings.
        +     * 
        + * + * .google.api.CommonLanguageSettings common = 1; + */ + public Builder setCommon(com.google.api.CommonLanguageSettings.Builder builderForValue) { + if (commonBuilder_ == null) { + common_ = builderForValue.build(); + } else { + commonBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
        +     * Some settings.
        +     * 
        + * + * .google.api.CommonLanguageSettings common = 1; + */ + public Builder mergeCommon(com.google.api.CommonLanguageSettings value) { + if (commonBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) + && common_ != null + && common_ != com.google.api.CommonLanguageSettings.getDefaultInstance()) { + getCommonBuilder().mergeFrom(value); + } else { + common_ = value; + } + } else { + commonBuilder_.mergeFrom(value); + } + if (common_ != null) { + bitField0_ |= 0x00000001; + onChanged(); + } + return this; + } + + /** + * + * + *
        +     * Some settings.
        +     * 
        + * + * .google.api.CommonLanguageSettings common = 1; + */ + public Builder clearCommon() { + bitField0_ = (bitField0_ & ~0x00000001); + common_ = null; + if (commonBuilder_ != null) { + commonBuilder_.dispose(); + commonBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
        +     * Some settings.
        +     * 
        + * + * .google.api.CommonLanguageSettings common = 1; + */ + public com.google.api.CommonLanguageSettings.Builder getCommonBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return internalGetCommonFieldBuilder().getBuilder(); + } + + /** + * + * + *
        +     * Some settings.
        +     * 
        + * + * .google.api.CommonLanguageSettings common = 1; + */ + public com.google.api.CommonLanguageSettingsOrBuilder getCommonOrBuilder() { + if (commonBuilder_ != null) { + return commonBuilder_.getMessageOrBuilder(); + } else { + return common_ == null + ? com.google.api.CommonLanguageSettings.getDefaultInstance() + : common_; + } + } + + /** + * + * + *
        +     * Some settings.
        +     * 
        + * + * .google.api.CommonLanguageSettings common = 1; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.api.CommonLanguageSettings, + com.google.api.CommonLanguageSettings.Builder, + com.google.api.CommonLanguageSettingsOrBuilder> + internalGetCommonFieldBuilder() { + if (commonBuilder_ == null) { + commonBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.api.CommonLanguageSettings, + com.google.api.CommonLanguageSettings.Builder, + com.google.api.CommonLanguageSettingsOrBuilder>( + getCommon(), getParentForChildren(), isClean()); + common_ = null; + } + return commonBuilder_; + } + + private com.google.protobuf.MapField renamedServices_; + + private com.google.protobuf.MapField + internalGetRenamedServices() { + if (renamedServices_ == null) { + return com.google.protobuf.MapField.emptyMapField( + RenamedServicesDefaultEntryHolder.defaultEntry); + } + return renamedServices_; + } + + private com.google.protobuf.MapField + internalGetMutableRenamedServices() { + if (renamedServices_ == null) { + renamedServices_ = + com.google.protobuf.MapField.newMapField( + RenamedServicesDefaultEntryHolder.defaultEntry); + } + if (!renamedServices_.isMutable()) { + renamedServices_ = renamedServices_.copy(); + } + bitField0_ |= 0x00000002; + onChanged(); + return renamedServices_; + } + + public int getRenamedServicesCount() { + return internalGetRenamedServices().getMap().size(); + } + + /** + * + * + *
        +     * Map from original service names to renamed versions.
        +     * This is used when the default generated types
        +     * would cause a naming conflict. (Neither name is
        +     * fully-qualified.)
        +     * Example: Subscriber to SubscriberServiceApi.
        +     * 
        + * + * map<string, string> renamed_services = 2; + */ + @java.lang.Override + public boolean containsRenamedServices(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + return internalGetRenamedServices().getMap().containsKey(key); + } + + /** Use {@link #getRenamedServicesMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getRenamedServices() { + return getRenamedServicesMap(); + } + + /** + * + * + *
        +     * Map from original service names to renamed versions.
        +     * This is used when the default generated types
        +     * would cause a naming conflict. (Neither name is
        +     * fully-qualified.)
        +     * Example: Subscriber to SubscriberServiceApi.
        +     * 
        + * + * map<string, string> renamed_services = 2; + */ + @java.lang.Override + public java.util.Map getRenamedServicesMap() { + return internalGetRenamedServices().getMap(); + } + + /** + * + * + *
        +     * Map from original service names to renamed versions.
        +     * This is used when the default generated types
        +     * would cause a naming conflict. (Neither name is
        +     * fully-qualified.)
        +     * Example: Subscriber to SubscriberServiceApi.
        +     * 
        + * + * map<string, string> renamed_services = 2; + */ + @java.lang.Override + public /* nullable */ java.lang.String getRenamedServicesOrDefault( + java.lang.String key, + /* nullable */ + java.lang.String defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetRenamedServices().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + + /** + * + * + *
        +     * Map from original service names to renamed versions.
        +     * This is used when the default generated types
        +     * would cause a naming conflict. (Neither name is
        +     * fully-qualified.)
        +     * Example: Subscriber to SubscriberServiceApi.
        +     * 
        + * + * map<string, string> renamed_services = 2; + */ + @java.lang.Override + public java.lang.String getRenamedServicesOrThrow(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetRenamedServices().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public Builder clearRenamedServices() { + bitField0_ = (bitField0_ & ~0x00000002); + internalGetMutableRenamedServices().getMutableMap().clear(); + return this; + } - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); + /** + * + * + *
        +     * Map from original service names to renamed versions.
        +     * This is used when the default generated types
        +     * would cause a naming conflict. (Neither name is
        +     * fully-qualified.)
        +     * Example: Subscriber to SubscriberServiceApi.
        +     * 
        + * + * map<string, string> renamed_services = 2; + */ + public Builder removeRenamedServices(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + internalGetMutableRenamedServices().getMutableMap().remove(key); + return this; } - @java.lang.Override - public Builder clear() { - super.clear(); - if (commonBuilder_ == null) { - common_ = null; - } else { - common_ = null; - commonBuilder_ = null; + /** Use alternate mutation accessors instead. */ + @java.lang.Deprecated + public java.util.Map getMutableRenamedServices() { + bitField0_ |= 0x00000002; + return internalGetMutableRenamedServices().getMutableMap(); + } + + /** + * + * + *
        +     * Map from original service names to renamed versions.
        +     * This is used when the default generated types
        +     * would cause a naming conflict. (Neither name is
        +     * fully-qualified.)
        +     * Example: Subscriber to SubscriberServiceApi.
        +     * 
        + * + * map<string, string> renamed_services = 2; + */ + public Builder putRenamedServices(java.lang.String key, java.lang.String value) { + if (key == null) { + throw new NullPointerException("map key"); } + if (value == null) { + throw new NullPointerException("map value"); + } + internalGetMutableRenamedServices().getMutableMap().put(key, value); + bitField0_ |= 0x00000002; + return this; + } + + /** + * + * + *
        +     * Map from original service names to renamed versions.
        +     * This is used when the default generated types
        +     * would cause a naming conflict. (Neither name is
        +     * fully-qualified.)
        +     * Example: Subscriber to SubscriberServiceApi.
        +     * 
        + * + * map<string, string> renamed_services = 2; + */ + public Builder putAllRenamedServices(java.util.Map values) { + internalGetMutableRenamedServices().getMutableMap().putAll(values); + bitField0_ |= 0x00000002; return this; } + private com.google.protobuf.MapField renamedResources_; + + private com.google.protobuf.MapField + internalGetRenamedResources() { + if (renamedResources_ == null) { + return com.google.protobuf.MapField.emptyMapField( + RenamedResourcesDefaultEntryHolder.defaultEntry); + } + return renamedResources_; + } + + private com.google.protobuf.MapField + internalGetMutableRenamedResources() { + if (renamedResources_ == null) { + renamedResources_ = + com.google.protobuf.MapField.newMapField( + RenamedResourcesDefaultEntryHolder.defaultEntry); + } + if (!renamedResources_.isMutable()) { + renamedResources_ = renamedResources_.copy(); + } + bitField0_ |= 0x00000004; + onChanged(); + return renamedResources_; + } + + public int getRenamedResourcesCount() { + return internalGetRenamedResources().getMap().size(); + } + + /** + * + * + *
        +     * Map from full resource types to the effective short name
        +     * for the resource. This is used when otherwise resource
        +     * named from different services would cause naming collisions.
        +     * Example entry:
        +     * "datalabeling.googleapis.com/Dataset": "DataLabelingDataset"
        +     * 
        + * + * map<string, string> renamed_resources = 3; + */ @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return com.google.api.ClientProto.internal_static_google_api_DotnetSettings_descriptor; + public boolean containsRenamedResources(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + return internalGetRenamedResources().getMap().containsKey(key); } + /** Use {@link #getRenamedResourcesMap()} instead. */ @java.lang.Override - public com.google.api.DotnetSettings getDefaultInstanceForType() { - return com.google.api.DotnetSettings.getDefaultInstance(); + @java.lang.Deprecated + public java.util.Map getRenamedResources() { + return getRenamedResourcesMap(); } + /** + * + * + *
        +     * Map from full resource types to the effective short name
        +     * for the resource. This is used when otherwise resource
        +     * named from different services would cause naming collisions.
        +     * Example entry:
        +     * "datalabeling.googleapis.com/Dataset": "DataLabelingDataset"
        +     * 
        + * + * map<string, string> renamed_resources = 3; + */ @java.lang.Override - public com.google.api.DotnetSettings build() { - com.google.api.DotnetSettings result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); + public java.util.Map getRenamedResourcesMap() { + return internalGetRenamedResources().getMap(); + } + + /** + * + * + *
        +     * Map from full resource types to the effective short name
        +     * for the resource. This is used when otherwise resource
        +     * named from different services would cause naming collisions.
        +     * Example entry:
        +     * "datalabeling.googleapis.com/Dataset": "DataLabelingDataset"
        +     * 
        + * + * map<string, string> renamed_resources = 3; + */ + @java.lang.Override + public /* nullable */ java.lang.String getRenamedResourcesOrDefault( + java.lang.String key, + /* nullable */ + java.lang.String defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); } - return result; + java.util.Map map = + internalGetRenamedResources().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; } + /** + * + * + *
        +     * Map from full resource types to the effective short name
        +     * for the resource. This is used when otherwise resource
        +     * named from different services would cause naming collisions.
        +     * Example entry:
        +     * "datalabeling.googleapis.com/Dataset": "DataLabelingDataset"
        +     * 
        + * + * map<string, string> renamed_resources = 3; + */ @java.lang.Override - public com.google.api.DotnetSettings buildPartial() { - com.google.api.DotnetSettings result = new com.google.api.DotnetSettings(this); - if (commonBuilder_ == null) { - result.common_ = common_; - } else { - result.common_ = commonBuilder_.build(); + public java.lang.String getRenamedResourcesOrThrow(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); } - onBuilt(); - return result; + java.util.Map map = + internalGetRenamedResources().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public Builder clearRenamedResources() { + bitField0_ = (bitField0_ & ~0x00000004); + internalGetMutableRenamedResources().getMutableMap().clear(); + return this; + } + + /** + * + * + *
        +     * Map from full resource types to the effective short name
        +     * for the resource. This is used when otherwise resource
        +     * named from different services would cause naming collisions.
        +     * Example entry:
        +     * "datalabeling.googleapis.com/Dataset": "DataLabelingDataset"
        +     * 
        + * + * map<string, string> renamed_resources = 3; + */ + public Builder removeRenamedResources(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + internalGetMutableRenamedResources().getMutableMap().remove(key); + return this; + } + + /** Use alternate mutation accessors instead. */ + @java.lang.Deprecated + public java.util.Map getMutableRenamedResources() { + bitField0_ |= 0x00000004; + return internalGetMutableRenamedResources().getMutableMap(); + } + + /** + * + * + *
        +     * Map from full resource types to the effective short name
        +     * for the resource. This is used when otherwise resource
        +     * named from different services would cause naming collisions.
        +     * Example entry:
        +     * "datalabeling.googleapis.com/Dataset": "DataLabelingDataset"
        +     * 
        + * + * map<string, string> renamed_resources = 3; + */ + public Builder putRenamedResources(java.lang.String key, java.lang.String value) { + if (key == null) { + throw new NullPointerException("map key"); + } + if (value == null) { + throw new NullPointerException("map value"); + } + internalGetMutableRenamedResources().getMutableMap().put(key, value); + bitField0_ |= 0x00000004; + return this; + } + + /** + * + * + *
        +     * Map from full resource types to the effective short name
        +     * for the resource. This is used when otherwise resource
        +     * named from different services would cause naming collisions.
        +     * Example entry:
        +     * "datalabeling.googleapis.com/Dataset": "DataLabelingDataset"
        +     * 
        + * + * map<string, string> renamed_resources = 3; + */ + public Builder putAllRenamedResources( + java.util.Map values) { + internalGetMutableRenamedResources().getMutableMap().putAll(values); + bitField0_ |= 0x00000004; + return this; + } + + private com.google.protobuf.LazyStringArrayList ignoredResources_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + + private void ensureIgnoredResourcesIsMutable() { + if (!ignoredResources_.isModifiable()) { + ignoredResources_ = new com.google.protobuf.LazyStringArrayList(ignoredResources_); + } + bitField0_ |= 0x00000008; + } + + /** + * + * + *
        +     * List of full resource types to ignore during generation.
        +     * This is typically used for API-specific Location resources,
        +     * which should be handled by the generator as if they were actually
        +     * the common Location resources.
        +     * Example entry: "documentai.googleapis.com/Location"
        +     * 
        + * + * repeated string ignored_resources = 4; + * + * @return A list containing the ignoredResources. + */ + public com.google.protobuf.ProtocolStringList getIgnoredResourcesList() { + ignoredResources_.makeImmutable(); + return ignoredResources_; + } + + /** + * + * + *
        +     * List of full resource types to ignore during generation.
        +     * This is typically used for API-specific Location resources,
        +     * which should be handled by the generator as if they were actually
        +     * the common Location resources.
        +     * Example entry: "documentai.googleapis.com/Location"
        +     * 
        + * + * repeated string ignored_resources = 4; + * + * @return The count of ignoredResources. + */ + public int getIgnoredResourcesCount() { + return ignoredResources_.size(); + } + + /** + * + * + *
        +     * List of full resource types to ignore during generation.
        +     * This is typically used for API-specific Location resources,
        +     * which should be handled by the generator as if they were actually
        +     * the common Location resources.
        +     * Example entry: "documentai.googleapis.com/Location"
        +     * 
        + * + * repeated string ignored_resources = 4; + * + * @param index The index of the element to return. + * @return The ignoredResources at the given index. + */ + public java.lang.String getIgnoredResources(int index) { + return ignoredResources_.get(index); + } + + /** + * + * + *
        +     * List of full resource types to ignore during generation.
        +     * This is typically used for API-specific Location resources,
        +     * which should be handled by the generator as if they were actually
        +     * the common Location resources.
        +     * Example entry: "documentai.googleapis.com/Location"
        +     * 
        + * + * repeated string ignored_resources = 4; + * + * @param index The index of the value to return. + * @return The bytes of the ignoredResources at the given index. + */ + public com.google.protobuf.ByteString getIgnoredResourcesBytes(int index) { + return ignoredResources_.getByteString(index); + } + + /** + * + * + *
        +     * List of full resource types to ignore during generation.
        +     * This is typically used for API-specific Location resources,
        +     * which should be handled by the generator as if they were actually
        +     * the common Location resources.
        +     * Example entry: "documentai.googleapis.com/Location"
        +     * 
        + * + * repeated string ignored_resources = 4; + * + * @param index The index to set the value at. + * @param value The ignoredResources to set. + * @return This builder for chaining. + */ + public Builder setIgnoredResources(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureIgnoredResourcesIsMutable(); + ignoredResources_.set(index, value); + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + /** + * + * + *
        +     * List of full resource types to ignore during generation.
        +     * This is typically used for API-specific Location resources,
        +     * which should be handled by the generator as if they were actually
        +     * the common Location resources.
        +     * Example entry: "documentai.googleapis.com/Location"
        +     * 
        + * + * repeated string ignored_resources = 4; + * + * @param value The ignoredResources to add. + * @return This builder for chaining. + */ + public Builder addIgnoredResources(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureIgnoredResourcesIsMutable(); + ignoredResources_.add(value); + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + /** + * + * + *
        +     * List of full resource types to ignore during generation.
        +     * This is typically used for API-specific Location resources,
        +     * which should be handled by the generator as if they were actually
        +     * the common Location resources.
        +     * Example entry: "documentai.googleapis.com/Location"
        +     * 
        + * + * repeated string ignored_resources = 4; + * + * @param values The ignoredResources to add. + * @return This builder for chaining. + */ + public Builder addAllIgnoredResources(java.lang.Iterable values) { + ensureIgnoredResourcesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, ignoredResources_); + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + /** + * + * + *
        +     * List of full resource types to ignore during generation.
        +     * This is typically used for API-specific Location resources,
        +     * which should be handled by the generator as if they were actually
        +     * the common Location resources.
        +     * Example entry: "documentai.googleapis.com/Location"
        +     * 
        + * + * repeated string ignored_resources = 4; + * + * @return This builder for chaining. + */ + public Builder clearIgnoredResources() { + ignoredResources_ = com.google.protobuf.LazyStringArrayList.emptyList(); + bitField0_ = (bitField0_ & ~0x00000008); + ; + onChanged(); + return this; + } + + /** + * + * + *
        +     * List of full resource types to ignore during generation.
        +     * This is typically used for API-specific Location resources,
        +     * which should be handled by the generator as if they were actually
        +     * the common Location resources.
        +     * Example entry: "documentai.googleapis.com/Location"
        +     * 
        + * + * repeated string ignored_resources = 4; + * + * @param value The bytes of the ignoredResources to add. + * @return This builder for chaining. + */ + public Builder addIgnoredResourcesBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureIgnoredResourcesIsMutable(); + ignoredResources_.add(value); + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + private com.google.protobuf.LazyStringArrayList forcedNamespaceAliases_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + + private void ensureForcedNamespaceAliasesIsMutable() { + if (!forcedNamespaceAliases_.isModifiable()) { + forcedNamespaceAliases_ = + new com.google.protobuf.LazyStringArrayList(forcedNamespaceAliases_); + } + bitField0_ |= 0x00000010; + } + + /** + * + * + *
        +     * Namespaces which must be aliased in snippets due to
        +     * a known (but non-generator-predictable) naming collision
        +     * 
        + * + * repeated string forced_namespace_aliases = 5; + * + * @return A list containing the forcedNamespaceAliases. + */ + public com.google.protobuf.ProtocolStringList getForcedNamespaceAliasesList() { + forcedNamespaceAliases_.makeImmutable(); + return forcedNamespaceAliases_; } - @java.lang.Override - public Builder clone() { - return super.clone(); + /** + * + * + *
        +     * Namespaces which must be aliased in snippets due to
        +     * a known (but non-generator-predictable) naming collision
        +     * 
        + * + * repeated string forced_namespace_aliases = 5; + * + * @return The count of forcedNamespaceAliases. + */ + public int getForcedNamespaceAliasesCount() { + return forcedNamespaceAliases_.size(); } - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.setField(field, value); + /** + * + * + *
        +     * Namespaces which must be aliased in snippets due to
        +     * a known (but non-generator-predictable) naming collision
        +     * 
        + * + * repeated string forced_namespace_aliases = 5; + * + * @param index The index of the element to return. + * @return The forcedNamespaceAliases at the given index. + */ + public java.lang.String getForcedNamespaceAliases(int index) { + return forcedNamespaceAliases_.get(index); } - @java.lang.Override - public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); + /** + * + * + *
        +     * Namespaces which must be aliased in snippets due to
        +     * a known (but non-generator-predictable) naming collision
        +     * 
        + * + * repeated string forced_namespace_aliases = 5; + * + * @param index The index of the value to return. + * @return The bytes of the forcedNamespaceAliases at the given index. + */ + public com.google.protobuf.ByteString getForcedNamespaceAliasesBytes(int index) { + return forcedNamespaceAliases_.getByteString(index); } - @java.lang.Override - public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); + /** + * + * + *
        +     * Namespaces which must be aliased in snippets due to
        +     * a known (but non-generator-predictable) naming collision
        +     * 
        + * + * repeated string forced_namespace_aliases = 5; + * + * @param index The index to set the value at. + * @param value The forcedNamespaceAliases to set. + * @return This builder for chaining. + */ + public Builder setForcedNamespaceAliases(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureForcedNamespaceAliasesIsMutable(); + forcedNamespaceAliases_.set(index, value); + bitField0_ |= 0x00000010; + onChanged(); + return this; } - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); + /** + * + * + *
        +     * Namespaces which must be aliased in snippets due to
        +     * a known (but non-generator-predictable) naming collision
        +     * 
        + * + * repeated string forced_namespace_aliases = 5; + * + * @param value The forcedNamespaceAliases to add. + * @return This builder for chaining. + */ + public Builder addForcedNamespaceAliases(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureForcedNamespaceAliasesIsMutable(); + forcedNamespaceAliases_.add(value); + bitField0_ |= 0x00000010; + onChanged(); + return this; } - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.addRepeatedField(field, value); + /** + * + * + *
        +     * Namespaces which must be aliased in snippets due to
        +     * a known (but non-generator-predictable) naming collision
        +     * 
        + * + * repeated string forced_namespace_aliases = 5; + * + * @param values The forcedNamespaceAliases to add. + * @return This builder for chaining. + */ + public Builder addAllForcedNamespaceAliases(java.lang.Iterable values) { + ensureForcedNamespaceAliasesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, forcedNamespaceAliases_); + bitField0_ |= 0x00000010; + onChanged(); + return this; } - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof com.google.api.DotnetSettings) { - return mergeFrom((com.google.api.DotnetSettings) other); - } else { - super.mergeFrom(other); - return this; - } + /** + * + * + *
        +     * Namespaces which must be aliased in snippets due to
        +     * a known (but non-generator-predictable) naming collision
        +     * 
        + * + * repeated string forced_namespace_aliases = 5; + * + * @return This builder for chaining. + */ + public Builder clearForcedNamespaceAliases() { + forcedNamespaceAliases_ = com.google.protobuf.LazyStringArrayList.emptyList(); + bitField0_ = (bitField0_ & ~0x00000010); + ; + onChanged(); + return this; } - public Builder mergeFrom(com.google.api.DotnetSettings other) { - if (other == com.google.api.DotnetSettings.getDefaultInstance()) return this; - if (other.hasCommon()) { - mergeCommon(other.getCommon()); + /** + * + * + *
        +     * Namespaces which must be aliased in snippets due to
        +     * a known (but non-generator-predictable) naming collision
        +     * 
        + * + * repeated string forced_namespace_aliases = 5; + * + * @param value The bytes of the forcedNamespaceAliases to add. + * @return This builder for chaining. + */ + public Builder addForcedNamespaceAliasesBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); } - this.mergeUnknownFields(other.getUnknownFields()); + checkByteStringIsUtf8(value); + ensureForcedNamespaceAliasesIsMutable(); + forcedNamespaceAliases_.add(value); + bitField0_ |= 0x00000010; onChanged(); return this; } - @java.lang.Override - public final boolean isInitialized() { - return true; - } + private com.google.protobuf.LazyStringArrayList handwrittenSignatures_ = + com.google.protobuf.LazyStringArrayList.emptyList(); - @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(); + private void ensureHandwrittenSignaturesIsMutable() { + if (!handwrittenSignatures_.isModifiable()) { + handwrittenSignatures_ = + new com.google.protobuf.LazyStringArrayList(handwrittenSignatures_); } - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: - { - input.readMessage(getCommonFieldBuilder().getBuilder(), extensionRegistry); - - 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; + bitField0_ |= 0x00000020; } - private com.google.api.CommonLanguageSettings common_; - private com.google.protobuf.SingleFieldBuilderV3< - com.google.api.CommonLanguageSettings, - com.google.api.CommonLanguageSettings.Builder, - com.google.api.CommonLanguageSettingsOrBuilder> - commonBuilder_; /** * * *
        -     * Some settings.
        +     * Method signatures (in the form "service.method(signature)")
        +     * which are provided separately, so shouldn't be generated.
        +     * Snippets *calling* these methods are still generated, however.
              * 
        * - * .google.api.CommonLanguageSettings common = 1; + * repeated string handwritten_signatures = 6; * - * @return Whether the common field is set. + * @return A list containing the handwrittenSignatures. */ - public boolean hasCommon() { - return commonBuilder_ != null || common_ != null; + public com.google.protobuf.ProtocolStringList getHandwrittenSignaturesList() { + handwrittenSignatures_.makeImmutable(); + return handwrittenSignatures_; } + /** * * *
        -     * Some settings.
        +     * Method signatures (in the form "service.method(signature)")
        +     * which are provided separately, so shouldn't be generated.
        +     * Snippets *calling* these methods are still generated, however.
              * 
        * - * .google.api.CommonLanguageSettings common = 1; + * repeated string handwritten_signatures = 6; * - * @return The common. + * @return The count of handwrittenSignatures. */ - public com.google.api.CommonLanguageSettings getCommon() { - if (commonBuilder_ == null) { - return common_ == null - ? com.google.api.CommonLanguageSettings.getDefaultInstance() - : common_; - } else { - return commonBuilder_.getMessage(); - } + public int getHandwrittenSignaturesCount() { + return handwrittenSignatures_.size(); } + /** * * *
        -     * Some settings.
        +     * Method signatures (in the form "service.method(signature)")
        +     * which are provided separately, so shouldn't be generated.
        +     * Snippets *calling* these methods are still generated, however.
              * 
        * - * .google.api.CommonLanguageSettings common = 1; + * repeated string handwritten_signatures = 6; + * + * @param index The index of the element to return. + * @return The handwrittenSignatures at the given index. */ - public Builder setCommon(com.google.api.CommonLanguageSettings value) { - if (commonBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - common_ = value; - onChanged(); - } else { - commonBuilder_.setMessage(value); - } - - return this; + public java.lang.String getHandwrittenSignatures(int index) { + return handwrittenSignatures_.get(index); } + /** * * *
        -     * Some settings.
        +     * Method signatures (in the form "service.method(signature)")
        +     * which are provided separately, so shouldn't be generated.
        +     * Snippets *calling* these methods are still generated, however.
              * 
        * - * .google.api.CommonLanguageSettings common = 1; + * repeated string handwritten_signatures = 6; + * + * @param index The index of the value to return. + * @return The bytes of the handwrittenSignatures at the given index. */ - public Builder setCommon(com.google.api.CommonLanguageSettings.Builder builderForValue) { - if (commonBuilder_ == null) { - common_ = builderForValue.build(); - onChanged(); - } else { - commonBuilder_.setMessage(builderForValue.build()); - } - - return this; + public com.google.protobuf.ByteString getHandwrittenSignaturesBytes(int index) { + return handwrittenSignatures_.getByteString(index); } + /** * * *
        -     * Some settings.
        +     * Method signatures (in the form "service.method(signature)")
        +     * which are provided separately, so shouldn't be generated.
        +     * Snippets *calling* these methods are still generated, however.
              * 
        * - * .google.api.CommonLanguageSettings common = 1; + * repeated string handwritten_signatures = 6; + * + * @param index The index to set the value at. + * @param value The handwrittenSignatures to set. + * @return This builder for chaining. */ - public Builder mergeCommon(com.google.api.CommonLanguageSettings value) { - if (commonBuilder_ == null) { - if (common_ != null) { - common_ = - com.google.api.CommonLanguageSettings.newBuilder(common_) - .mergeFrom(value) - .buildPartial(); - } else { - common_ = value; - } - onChanged(); - } else { - commonBuilder_.mergeFrom(value); + public Builder setHandwrittenSignatures(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); } - + ensureHandwrittenSignaturesIsMutable(); + handwrittenSignatures_.set(index, value); + bitField0_ |= 0x00000020; + onChanged(); return this; } + /** * * *
        -     * Some settings.
        +     * Method signatures (in the form "service.method(signature)")
        +     * which are provided separately, so shouldn't be generated.
        +     * Snippets *calling* these methods are still generated, however.
              * 
        * - * .google.api.CommonLanguageSettings common = 1; + * repeated string handwritten_signatures = 6; + * + * @param value The handwrittenSignatures to add. + * @return This builder for chaining. */ - public Builder clearCommon() { - if (commonBuilder_ == null) { - common_ = null; - onChanged(); - } else { - common_ = null; - commonBuilder_ = null; + public Builder addHandwrittenSignatures(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); } - + ensureHandwrittenSignaturesIsMutable(); + handwrittenSignatures_.add(value); + bitField0_ |= 0x00000020; + onChanged(); return this; } + /** * * *
        -     * Some settings.
        +     * Method signatures (in the form "service.method(signature)")
        +     * which are provided separately, so shouldn't be generated.
        +     * Snippets *calling* these methods are still generated, however.
              * 
        * - * .google.api.CommonLanguageSettings common = 1; + * repeated string handwritten_signatures = 6; + * + * @param values The handwrittenSignatures to add. + * @return This builder for chaining. */ - public com.google.api.CommonLanguageSettings.Builder getCommonBuilder() { - + public Builder addAllHandwrittenSignatures(java.lang.Iterable values) { + ensureHandwrittenSignaturesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, handwrittenSignatures_); + bitField0_ |= 0x00000020; onChanged(); - return getCommonFieldBuilder().getBuilder(); + return this; } + /** * * *
        -     * Some settings.
        +     * Method signatures (in the form "service.method(signature)")
        +     * which are provided separately, so shouldn't be generated.
        +     * Snippets *calling* these methods are still generated, however.
              * 
        * - * .google.api.CommonLanguageSettings common = 1; + * repeated string handwritten_signatures = 6; + * + * @return This builder for chaining. */ - public com.google.api.CommonLanguageSettingsOrBuilder getCommonOrBuilder() { - if (commonBuilder_ != null) { - return commonBuilder_.getMessageOrBuilder(); - } else { - return common_ == null - ? com.google.api.CommonLanguageSettings.getDefaultInstance() - : common_; - } + public Builder clearHandwrittenSignatures() { + handwrittenSignatures_ = com.google.protobuf.LazyStringArrayList.emptyList(); + bitField0_ = (bitField0_ & ~0x00000020); + ; + onChanged(); + return this; } + /** * * *
        -     * Some settings.
        +     * Method signatures (in the form "service.method(signature)")
        +     * which are provided separately, so shouldn't be generated.
        +     * Snippets *calling* these methods are still generated, however.
              * 
        * - * .google.api.CommonLanguageSettings common = 1; + * repeated string handwritten_signatures = 6; + * + * @param value The bytes of the handwrittenSignatures to add. + * @return This builder for chaining. */ - private com.google.protobuf.SingleFieldBuilderV3< - com.google.api.CommonLanguageSettings, - com.google.api.CommonLanguageSettings.Builder, - com.google.api.CommonLanguageSettingsOrBuilder> - getCommonFieldBuilder() { - if (commonBuilder_ == null) { - commonBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< - com.google.api.CommonLanguageSettings, - com.google.api.CommonLanguageSettings.Builder, - com.google.api.CommonLanguageSettingsOrBuilder>( - getCommon(), getParentForChildren(), isClean()); - common_ = null; + public Builder addHandwrittenSignaturesBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); } - return commonBuilder_; - } - - @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); + checkByteStringIsUtf8(value); + ensureHandwrittenSignaturesIsMutable(); + handwrittenSignatures_.add(value); + bitField0_ |= 0x00000020; + onChanged(); + return this; } // @@protoc_insertion_point(builder_scope:google.api.DotnetSettings) diff --git a/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/DotnetSettingsOrBuilder.java b/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/DotnetSettingsOrBuilder.java index 4e643721bb..80e4f51ae8 100644 --- a/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/DotnetSettingsOrBuilder.java +++ b/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/DotnetSettingsOrBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,10 +14,13 @@ * limitations under the License. */ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: google/api/client.proto +// Protobuf Java Version: 4.33.2 package com.google.api; +@com.google.protobuf.Generated public interface DotnetSettingsOrBuilder extends // @@protoc_insertion_point(interface_extends:google.api.DotnetSettings) @@ -35,6 +38,7 @@ public interface DotnetSettingsOrBuilder * @return Whether the common field is set. */ boolean hasCommon(); + /** * * @@ -47,6 +51,7 @@ public interface DotnetSettingsOrBuilder * @return The common. */ com.google.api.CommonLanguageSettings getCommon(); + /** * * @@ -57,4 +62,360 @@ public interface DotnetSettingsOrBuilder * .google.api.CommonLanguageSettings common = 1; */ com.google.api.CommonLanguageSettingsOrBuilder getCommonOrBuilder(); + + /** + * + * + *
        +   * Map from original service names to renamed versions.
        +   * This is used when the default generated types
        +   * would cause a naming conflict. (Neither name is
        +   * fully-qualified.)
        +   * Example: Subscriber to SubscriberServiceApi.
        +   * 
        + * + * map<string, string> renamed_services = 2; + */ + int getRenamedServicesCount(); + + /** + * + * + *
        +   * Map from original service names to renamed versions.
        +   * This is used when the default generated types
        +   * would cause a naming conflict. (Neither name is
        +   * fully-qualified.)
        +   * Example: Subscriber to SubscriberServiceApi.
        +   * 
        + * + * map<string, string> renamed_services = 2; + */ + boolean containsRenamedServices(java.lang.String key); + + /** Use {@link #getRenamedServicesMap()} instead. */ + @java.lang.Deprecated + java.util.Map getRenamedServices(); + + /** + * + * + *
        +   * Map from original service names to renamed versions.
        +   * This is used when the default generated types
        +   * would cause a naming conflict. (Neither name is
        +   * fully-qualified.)
        +   * Example: Subscriber to SubscriberServiceApi.
        +   * 
        + * + * map<string, string> renamed_services = 2; + */ + java.util.Map getRenamedServicesMap(); + + /** + * + * + *
        +   * Map from original service names to renamed versions.
        +   * This is used when the default generated types
        +   * would cause a naming conflict. (Neither name is
        +   * fully-qualified.)
        +   * Example: Subscriber to SubscriberServiceApi.
        +   * 
        + * + * map<string, string> renamed_services = 2; + */ + /* nullable */ + java.lang.String getRenamedServicesOrDefault( + java.lang.String key, + /* nullable */ + java.lang.String defaultValue); + + /** + * + * + *
        +   * Map from original service names to renamed versions.
        +   * This is used when the default generated types
        +   * would cause a naming conflict. (Neither name is
        +   * fully-qualified.)
        +   * Example: Subscriber to SubscriberServiceApi.
        +   * 
        + * + * map<string, string> renamed_services = 2; + */ + java.lang.String getRenamedServicesOrThrow(java.lang.String key); + + /** + * + * + *
        +   * Map from full resource types to the effective short name
        +   * for the resource. This is used when otherwise resource
        +   * named from different services would cause naming collisions.
        +   * Example entry:
        +   * "datalabeling.googleapis.com/Dataset": "DataLabelingDataset"
        +   * 
        + * + * map<string, string> renamed_resources = 3; + */ + int getRenamedResourcesCount(); + + /** + * + * + *
        +   * Map from full resource types to the effective short name
        +   * for the resource. This is used when otherwise resource
        +   * named from different services would cause naming collisions.
        +   * Example entry:
        +   * "datalabeling.googleapis.com/Dataset": "DataLabelingDataset"
        +   * 
        + * + * map<string, string> renamed_resources = 3; + */ + boolean containsRenamedResources(java.lang.String key); + + /** Use {@link #getRenamedResourcesMap()} instead. */ + @java.lang.Deprecated + java.util.Map getRenamedResources(); + + /** + * + * + *
        +   * Map from full resource types to the effective short name
        +   * for the resource. This is used when otherwise resource
        +   * named from different services would cause naming collisions.
        +   * Example entry:
        +   * "datalabeling.googleapis.com/Dataset": "DataLabelingDataset"
        +   * 
        + * + * map<string, string> renamed_resources = 3; + */ + java.util.Map getRenamedResourcesMap(); + + /** + * + * + *
        +   * Map from full resource types to the effective short name
        +   * for the resource. This is used when otherwise resource
        +   * named from different services would cause naming collisions.
        +   * Example entry:
        +   * "datalabeling.googleapis.com/Dataset": "DataLabelingDataset"
        +   * 
        + * + * map<string, string> renamed_resources = 3; + */ + /* nullable */ + java.lang.String getRenamedResourcesOrDefault( + java.lang.String key, + /* nullable */ + java.lang.String defaultValue); + + /** + * + * + *
        +   * Map from full resource types to the effective short name
        +   * for the resource. This is used when otherwise resource
        +   * named from different services would cause naming collisions.
        +   * Example entry:
        +   * "datalabeling.googleapis.com/Dataset": "DataLabelingDataset"
        +   * 
        + * + * map<string, string> renamed_resources = 3; + */ + java.lang.String getRenamedResourcesOrThrow(java.lang.String key); + + /** + * + * + *
        +   * List of full resource types to ignore during generation.
        +   * This is typically used for API-specific Location resources,
        +   * which should be handled by the generator as if they were actually
        +   * the common Location resources.
        +   * Example entry: "documentai.googleapis.com/Location"
        +   * 
        + * + * repeated string ignored_resources = 4; + * + * @return A list containing the ignoredResources. + */ + java.util.List getIgnoredResourcesList(); + + /** + * + * + *
        +   * List of full resource types to ignore during generation.
        +   * This is typically used for API-specific Location resources,
        +   * which should be handled by the generator as if they were actually
        +   * the common Location resources.
        +   * Example entry: "documentai.googleapis.com/Location"
        +   * 
        + * + * repeated string ignored_resources = 4; + * + * @return The count of ignoredResources. + */ + int getIgnoredResourcesCount(); + + /** + * + * + *
        +   * List of full resource types to ignore during generation.
        +   * This is typically used for API-specific Location resources,
        +   * which should be handled by the generator as if they were actually
        +   * the common Location resources.
        +   * Example entry: "documentai.googleapis.com/Location"
        +   * 
        + * + * repeated string ignored_resources = 4; + * + * @param index The index of the element to return. + * @return The ignoredResources at the given index. + */ + java.lang.String getIgnoredResources(int index); + + /** + * + * + *
        +   * List of full resource types to ignore during generation.
        +   * This is typically used for API-specific Location resources,
        +   * which should be handled by the generator as if they were actually
        +   * the common Location resources.
        +   * Example entry: "documentai.googleapis.com/Location"
        +   * 
        + * + * repeated string ignored_resources = 4; + * + * @param index The index of the value to return. + * @return The bytes of the ignoredResources at the given index. + */ + com.google.protobuf.ByteString getIgnoredResourcesBytes(int index); + + /** + * + * + *
        +   * Namespaces which must be aliased in snippets due to
        +   * a known (but non-generator-predictable) naming collision
        +   * 
        + * + * repeated string forced_namespace_aliases = 5; + * + * @return A list containing the forcedNamespaceAliases. + */ + java.util.List getForcedNamespaceAliasesList(); + + /** + * + * + *
        +   * Namespaces which must be aliased in snippets due to
        +   * a known (but non-generator-predictable) naming collision
        +   * 
        + * + * repeated string forced_namespace_aliases = 5; + * + * @return The count of forcedNamespaceAliases. + */ + int getForcedNamespaceAliasesCount(); + + /** + * + * + *
        +   * Namespaces which must be aliased in snippets due to
        +   * a known (but non-generator-predictable) naming collision
        +   * 
        + * + * repeated string forced_namespace_aliases = 5; + * + * @param index The index of the element to return. + * @return The forcedNamespaceAliases at the given index. + */ + java.lang.String getForcedNamespaceAliases(int index); + + /** + * + * + *
        +   * Namespaces which must be aliased in snippets due to
        +   * a known (but non-generator-predictable) naming collision
        +   * 
        + * + * repeated string forced_namespace_aliases = 5; + * + * @param index The index of the value to return. + * @return The bytes of the forcedNamespaceAliases at the given index. + */ + com.google.protobuf.ByteString getForcedNamespaceAliasesBytes(int index); + + /** + * + * + *
        +   * Method signatures (in the form "service.method(signature)")
        +   * which are provided separately, so shouldn't be generated.
        +   * Snippets *calling* these methods are still generated, however.
        +   * 
        + * + * repeated string handwritten_signatures = 6; + * + * @return A list containing the handwrittenSignatures. + */ + java.util.List getHandwrittenSignaturesList(); + + /** + * + * + *
        +   * Method signatures (in the form "service.method(signature)")
        +   * which are provided separately, so shouldn't be generated.
        +   * Snippets *calling* these methods are still generated, however.
        +   * 
        + * + * repeated string handwritten_signatures = 6; + * + * @return The count of handwrittenSignatures. + */ + int getHandwrittenSignaturesCount(); + + /** + * + * + *
        +   * Method signatures (in the form "service.method(signature)")
        +   * which are provided separately, so shouldn't be generated.
        +   * Snippets *calling* these methods are still generated, however.
        +   * 
        + * + * repeated string handwritten_signatures = 6; + * + * @param index The index of the element to return. + * @return The handwrittenSignatures at the given index. + */ + java.lang.String getHandwrittenSignatures(int index); + + /** + * + * + *
        +   * Method signatures (in the form "service.method(signature)")
        +   * which are provided separately, so shouldn't be generated.
        +   * Snippets *calling* these methods are still generated, however.
        +   * 
        + * + * repeated string handwritten_signatures = 6; + * + * @param index The index of the value to return. + * @return The bytes of the handwrittenSignatures at the given index. + */ + com.google.protobuf.ByteString getHandwrittenSignaturesBytes(int index); } diff --git a/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/Endpoint.java b/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/Endpoint.java index 7fc28ef25f..9a7425c272 100644 --- a/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/Endpoint.java +++ b/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/Endpoint.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,9 @@ * limitations under the License. */ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: google/api/endpoint.proto +// Protobuf Java Version: 4.33.2 package com.google.api; @@ -26,58 +28,61 @@ * APIs. It is commonly known as a service endpoint. A service may expose * any number of service endpoints, and all service endpoints share the same * service definition, such as quota limits and monitoring metrics. + * * Example: - * type: google.api.Service - * name: library-example.googleapis.com - * endpoints: - * # Declares network address `https://library-example.googleapis.com` - * # for service `library-example.googleapis.com`. The `https` scheme - * # is implicit for all service endpoints. Other schemes may be - * # supported in the future. - * - name: library-example.googleapis.com - * allow_cors: false - * - name: content-staging-library-example.googleapis.com - * # Allows HTTP OPTIONS calls to be passed to the API frontend, for it - * # to decide whether the subsequent cross-origin request is allowed - * # to proceed. - * allow_cors: true + * + * type: google.api.Service + * name: library-example.googleapis.com + * endpoints: + * # Declares network address `https://library-example.googleapis.com` + * # for service `library-example.googleapis.com`. The `https` scheme + * # is implicit for all service endpoints. Other schemes may be + * # supported in the future. + * - name: library-example.googleapis.com + * allow_cors: false + * - name: content-staging-library-example.googleapis.com + * # Allows HTTP OPTIONS calls to be passed to the API frontend, for it + * # to decide whether the subsequent cross-origin request is allowed + * # to proceed. + * allow_cors: true *
        * * Protobuf type {@code google.api.Endpoint} */ -public final class Endpoint extends com.google.protobuf.GeneratedMessageV3 +@com.google.protobuf.Generated +public final class Endpoint extends com.google.protobuf.GeneratedMessage implements // @@protoc_insertion_point(message_implements:google.api.Endpoint) EndpointOrBuilder { private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "Endpoint"); + } + // Use Endpoint.newBuilder() to construct. - private Endpoint(com.google.protobuf.GeneratedMessageV3.Builder builder) { + private Endpoint(com.google.protobuf.GeneratedMessage.Builder builder) { super(builder); } private Endpoint() { name_ = ""; - aliases_ = com.google.protobuf.LazyStringArrayList.EMPTY; + aliases_ = com.google.protobuf.LazyStringArrayList.emptyList(); target_ = ""; } - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new Endpoint(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.api.EndpointProto.internal_static_google_api_Endpoint_descriptor; } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.api.EndpointProto.internal_static_google_api_Endpoint_fieldAccessorTable .ensureFieldAccessorsInitialized( @@ -85,7 +90,10 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } public static final int NAME_FIELD_NUMBER = 1; - private volatile java.lang.Object name_; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** * * @@ -109,6 +117,7 @@ public java.lang.String getName() { return s; } } + /** * * @@ -134,92 +143,86 @@ public com.google.protobuf.ByteString getNameBytes() { } public static final int ALIASES_FIELD_NUMBER = 2; - private com.google.protobuf.LazyStringList aliases_; + + @SuppressWarnings("serial") + private com.google.protobuf.LazyStringArrayList aliases_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + /** * * *
        -   * Unimplemented. Dot not use.
        -   * DEPRECATED: This field is no longer supported. Instead of using aliases,
        -   * please specify multiple [google.api.Endpoint][google.api.Endpoint] for each
        -   * of the intended aliases.
        -   * Additional names that this endpoint will be hosted on.
        +   * Aliases for this endpoint, these will be served by the same UrlMap as the
        +   * parent endpoint, and will be provisioned in the GCP stack for the Regional
        +   * Endpoints.
            * 
        * - * repeated string aliases = 2 [deprecated = true]; + * repeated string aliases = 2; * - * @deprecated google.api.Endpoint.aliases is deprecated. See google/api/endpoint.proto;l=56 * @return A list containing the aliases. */ - @java.lang.Deprecated public com.google.protobuf.ProtocolStringList getAliasesList() { return aliases_; } + /** * * *
        -   * Unimplemented. Dot not use.
        -   * DEPRECATED: This field is no longer supported. Instead of using aliases,
        -   * please specify multiple [google.api.Endpoint][google.api.Endpoint] for each
        -   * of the intended aliases.
        -   * Additional names that this endpoint will be hosted on.
        +   * Aliases for this endpoint, these will be served by the same UrlMap as the
        +   * parent endpoint, and will be provisioned in the GCP stack for the Regional
        +   * Endpoints.
            * 
        * - * repeated string aliases = 2 [deprecated = true]; + * repeated string aliases = 2; * - * @deprecated google.api.Endpoint.aliases is deprecated. See google/api/endpoint.proto;l=56 * @return The count of aliases. */ - @java.lang.Deprecated public int getAliasesCount() { return aliases_.size(); } + /** * * *
        -   * Unimplemented. Dot not use.
        -   * DEPRECATED: This field is no longer supported. Instead of using aliases,
        -   * please specify multiple [google.api.Endpoint][google.api.Endpoint] for each
        -   * of the intended aliases.
        -   * Additional names that this endpoint will be hosted on.
        +   * Aliases for this endpoint, these will be served by the same UrlMap as the
        +   * parent endpoint, and will be provisioned in the GCP stack for the Regional
        +   * Endpoints.
            * 
        * - * repeated string aliases = 2 [deprecated = true]; + * repeated string aliases = 2; * - * @deprecated google.api.Endpoint.aliases is deprecated. See google/api/endpoint.proto;l=56 * @param index The index of the element to return. * @return The aliases at the given index. */ - @java.lang.Deprecated public java.lang.String getAliases(int index) { return aliases_.get(index); } + /** * * *
        -   * Unimplemented. Dot not use.
        -   * DEPRECATED: This field is no longer supported. Instead of using aliases,
        -   * please specify multiple [google.api.Endpoint][google.api.Endpoint] for each
        -   * of the intended aliases.
        -   * Additional names that this endpoint will be hosted on.
        +   * Aliases for this endpoint, these will be served by the same UrlMap as the
        +   * parent endpoint, and will be provisioned in the GCP stack for the Regional
        +   * Endpoints.
            * 
        * - * repeated string aliases = 2 [deprecated = true]; + * repeated string aliases = 2; * - * @deprecated google.api.Endpoint.aliases is deprecated. See google/api/endpoint.proto;l=56 * @param index The index of the value to return. * @return The bytes of the aliases at the given index. */ - @java.lang.Deprecated public com.google.protobuf.ByteString getAliasesBytes(int index) { return aliases_.getByteString(index); } public static final int TARGET_FIELD_NUMBER = 101; - private volatile java.lang.Object target_; + + @SuppressWarnings("serial") + private volatile java.lang.Object target_ = ""; + /** * * @@ -247,6 +250,7 @@ public java.lang.String getTarget() { return s; } } + /** * * @@ -276,7 +280,8 @@ public com.google.protobuf.ByteString getTargetBytes() { } public static final int ALLOW_CORS_FIELD_NUMBER = 5; - private boolean allowCors_; + private boolean allowCors_ = false; + /** * * @@ -312,17 +317,17 @@ public final boolean isInitialized() { @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.GeneratedMessage.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, name_); } for (int i = 0; i < aliases_.size(); i++) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 2, aliases_.getRaw(i)); + com.google.protobuf.GeneratedMessage.writeString(output, 2, aliases_.getRaw(i)); } if (allowCors_ != false) { output.writeBool(5, allowCors_); } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(target_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 101, target_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(target_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 101, target_); } getUnknownFields().writeTo(output); } @@ -333,8 +338,8 @@ public int getSerializedSize() { 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.GeneratedMessage.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, name_); } { int dataSize = 0; @@ -347,8 +352,8 @@ public int getSerializedSize() { if (allowCors_ != false) { size += com.google.protobuf.CodedOutputStream.computeBoolSize(5, allowCors_); } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(target_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(101, target_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(target_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(101, target_); } size += getUnknownFields().getSerializedSize(); memoizedSize = size; @@ -431,38 +436,38 @@ public static com.google.api.Endpoint parseFrom( public static com.google.api.Endpoint parseFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); } public static com.google.api.Endpoint parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } public static com.google.api.Endpoint parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); } public static com.google.api.Endpoint parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( PARSER, input, extensionRegistry); } public static com.google.api.Endpoint parseFrom(com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); } public static com.google.api.Endpoint parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } @@ -485,10 +490,11 @@ public Builder toBuilder() { } @java.lang.Override - protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { Builder builder = new Builder(parent); return builder; } + /** * * @@ -497,26 +503,28 @@ protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.Build * APIs. It is commonly known as a service endpoint. A service may expose * any number of service endpoints, and all service endpoints share the same * service definition, such as quota limits and monitoring metrics. + * * Example: - * type: google.api.Service - * name: library-example.googleapis.com - * endpoints: - * # Declares network address `https://library-example.googleapis.com` - * # for service `library-example.googleapis.com`. The `https` scheme - * # is implicit for all service endpoints. Other schemes may be - * # supported in the future. - * - name: library-example.googleapis.com - * allow_cors: false - * - name: content-staging-library-example.googleapis.com - * # Allows HTTP OPTIONS calls to be passed to the API frontend, for it - * # to decide whether the subsequent cross-origin request is allowed - * # to proceed. - * allow_cors: true + * + * type: google.api.Service + * name: library-example.googleapis.com + * endpoints: + * # Declares network address `https://library-example.googleapis.com` + * # for service `library-example.googleapis.com`. The `https` scheme + * # is implicit for all service endpoints. Other schemes may be + * # supported in the future. + * - name: library-example.googleapis.com + * allow_cors: false + * - name: content-staging-library-example.googleapis.com + * # Allows HTTP OPTIONS calls to be passed to the API frontend, for it + * # to decide whether the subsequent cross-origin request is allowed + * # to proceed. + * allow_cors: true *
        * * Protobuf type {@code google.api.Endpoint} */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder implements // @@protoc_insertion_point(builder_implements:google.api.Endpoint) com.google.api.EndpointOrBuilder { @@ -525,7 +533,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.api.EndpointProto.internal_static_google_api_Endpoint_fieldAccessorTable .ensureFieldAccessorsInitialized( @@ -535,21 +543,18 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { // Construct using com.google.api.Endpoint.newBuilder() private Builder() {} - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { super(parent); } @java.lang.Override public Builder clear() { super.clear(); + bitField0_ = 0; name_ = ""; - - aliases_ = com.google.protobuf.LazyStringArrayList.EMPTY; - bitField0_ = (bitField0_ & ~0x00000001); + aliases_ = com.google.protobuf.LazyStringArrayList.emptyList(); target_ = ""; - allowCors_ = false; - return this; } @@ -575,50 +580,28 @@ public com.google.api.Endpoint build() { @java.lang.Override public com.google.api.Endpoint buildPartial() { com.google.api.Endpoint result = new com.google.api.Endpoint(this); - int from_bitField0_ = bitField0_; - result.name_ = name_; - if (((bitField0_ & 0x00000001) != 0)) { - aliases_ = aliases_.getUnmodifiableView(); - bitField0_ = (bitField0_ & ~0x00000001); + if (bitField0_ != 0) { + buildPartial0(result); } - result.aliases_ = aliases_; - result.target_ = target_; - result.allowCors_ = allowCors_; 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); + private void buildPartial0(com.google.api.Endpoint result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + aliases_.makeImmutable(); + result.aliases_ = aliases_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.target_ = target_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.allowCors_ = allowCors_; + } } @java.lang.Override @@ -635,12 +618,13 @@ public Builder mergeFrom(com.google.api.Endpoint other) { if (other == com.google.api.Endpoint.getDefaultInstance()) return this; if (!other.getName().isEmpty()) { name_ = other.name_; + bitField0_ |= 0x00000001; onChanged(); } if (!other.aliases_.isEmpty()) { if (aliases_.isEmpty()) { aliases_ = other.aliases_; - bitField0_ = (bitField0_ & ~0x00000001); + bitField0_ |= 0x00000002; } else { ensureAliasesIsMutable(); aliases_.addAll(other.aliases_); @@ -649,6 +633,7 @@ public Builder mergeFrom(com.google.api.Endpoint other) { } if (!other.getTarget().isEmpty()) { target_ = other.target_; + bitField0_ |= 0x00000004; onChanged(); } if (other.getAllowCors() != false) { @@ -683,7 +668,7 @@ public Builder mergeFrom( case 10: { name_ = input.readStringRequireUtf8(); - + bitField0_ |= 0x00000001; break; } // case 10 case 18: @@ -696,13 +681,13 @@ public Builder mergeFrom( case 40: { allowCors_ = input.readBool(); - + bitField0_ |= 0x00000008; break; } // case 40 case 810: { target_ = input.readStringRequireUtf8(); - + bitField0_ |= 0x00000004; break; } // case 810 default: @@ -725,6 +710,7 @@ public Builder mergeFrom( private int bitField0_; private java.lang.Object name_ = ""; + /** * * @@ -747,6 +733,7 @@ public java.lang.String getName() { return (java.lang.String) ref; } } + /** * * @@ -769,6 +756,7 @@ public com.google.protobuf.ByteString getNameBytes() { return (com.google.protobuf.ByteString) ref; } } + /** * * @@ -785,11 +773,12 @@ public Builder setName(java.lang.String value) { if (value == null) { throw new NullPointerException(); } - name_ = value; + bitField0_ |= 0x00000001; onChanged(); return this; } + /** * * @@ -802,11 +791,12 @@ public Builder setName(java.lang.String value) { * @return This builder for chaining. */ public Builder clearName() { - name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); onChanged(); return this; } + /** * * @@ -824,223 +814,201 @@ public Builder setNameBytes(com.google.protobuf.ByteString value) { throw new NullPointerException(); } checkByteStringIsUtf8(value); - name_ = value; + bitField0_ |= 0x00000001; onChanged(); return this; } - private com.google.protobuf.LazyStringList aliases_ = - com.google.protobuf.LazyStringArrayList.EMPTY; + private com.google.protobuf.LazyStringArrayList aliases_ = + com.google.protobuf.LazyStringArrayList.emptyList(); private void ensureAliasesIsMutable() { - if (!((bitField0_ & 0x00000001) != 0)) { + if (!aliases_.isModifiable()) { aliases_ = new com.google.protobuf.LazyStringArrayList(aliases_); - bitField0_ |= 0x00000001; } + bitField0_ |= 0x00000002; } + /** * * *
        -     * Unimplemented. Dot not use.
        -     * DEPRECATED: This field is no longer supported. Instead of using aliases,
        -     * please specify multiple [google.api.Endpoint][google.api.Endpoint] for each
        -     * of the intended aliases.
        -     * Additional names that this endpoint will be hosted on.
        +     * Aliases for this endpoint, these will be served by the same UrlMap as the
        +     * parent endpoint, and will be provisioned in the GCP stack for the Regional
        +     * Endpoints.
              * 
        * - * repeated string aliases = 2 [deprecated = true]; + * repeated string aliases = 2; * - * @deprecated google.api.Endpoint.aliases is deprecated. See google/api/endpoint.proto;l=56 * @return A list containing the aliases. */ - @java.lang.Deprecated public com.google.protobuf.ProtocolStringList getAliasesList() { - return aliases_.getUnmodifiableView(); + aliases_.makeImmutable(); + return aliases_; } + /** * * *
        -     * Unimplemented. Dot not use.
        -     * DEPRECATED: This field is no longer supported. Instead of using aliases,
        -     * please specify multiple [google.api.Endpoint][google.api.Endpoint] for each
        -     * of the intended aliases.
        -     * Additional names that this endpoint will be hosted on.
        +     * Aliases for this endpoint, these will be served by the same UrlMap as the
        +     * parent endpoint, and will be provisioned in the GCP stack for the Regional
        +     * Endpoints.
              * 
        * - * repeated string aliases = 2 [deprecated = true]; + * repeated string aliases = 2; * - * @deprecated google.api.Endpoint.aliases is deprecated. See google/api/endpoint.proto;l=56 * @return The count of aliases. */ - @java.lang.Deprecated public int getAliasesCount() { return aliases_.size(); } + /** * * *
        -     * Unimplemented. Dot not use.
        -     * DEPRECATED: This field is no longer supported. Instead of using aliases,
        -     * please specify multiple [google.api.Endpoint][google.api.Endpoint] for each
        -     * of the intended aliases.
        -     * Additional names that this endpoint will be hosted on.
        +     * Aliases for this endpoint, these will be served by the same UrlMap as the
        +     * parent endpoint, and will be provisioned in the GCP stack for the Regional
        +     * Endpoints.
              * 
        * - * repeated string aliases = 2 [deprecated = true]; + * repeated string aliases = 2; * - * @deprecated google.api.Endpoint.aliases is deprecated. See google/api/endpoint.proto;l=56 * @param index The index of the element to return. * @return The aliases at the given index. */ - @java.lang.Deprecated public java.lang.String getAliases(int index) { return aliases_.get(index); } + /** * * *
        -     * Unimplemented. Dot not use.
        -     * DEPRECATED: This field is no longer supported. Instead of using aliases,
        -     * please specify multiple [google.api.Endpoint][google.api.Endpoint] for each
        -     * of the intended aliases.
        -     * Additional names that this endpoint will be hosted on.
        +     * Aliases for this endpoint, these will be served by the same UrlMap as the
        +     * parent endpoint, and will be provisioned in the GCP stack for the Regional
        +     * Endpoints.
              * 
        * - * repeated string aliases = 2 [deprecated = true]; + * repeated string aliases = 2; * - * @deprecated google.api.Endpoint.aliases is deprecated. See google/api/endpoint.proto;l=56 * @param index The index of the value to return. * @return The bytes of the aliases at the given index. */ - @java.lang.Deprecated public com.google.protobuf.ByteString getAliasesBytes(int index) { return aliases_.getByteString(index); } + /** * * *
        -     * Unimplemented. Dot not use.
        -     * DEPRECATED: This field is no longer supported. Instead of using aliases,
        -     * please specify multiple [google.api.Endpoint][google.api.Endpoint] for each
        -     * of the intended aliases.
        -     * Additional names that this endpoint will be hosted on.
        +     * Aliases for this endpoint, these will be served by the same UrlMap as the
        +     * parent endpoint, and will be provisioned in the GCP stack for the Regional
        +     * Endpoints.
              * 
        * - * repeated string aliases = 2 [deprecated = true]; + * repeated string aliases = 2; * - * @deprecated google.api.Endpoint.aliases is deprecated. See google/api/endpoint.proto;l=56 * @param index The index to set the value at. * @param value The aliases to set. * @return This builder for chaining. */ - @java.lang.Deprecated public Builder setAliases(int index, java.lang.String value) { if (value == null) { throw new NullPointerException(); } ensureAliasesIsMutable(); aliases_.set(index, value); + bitField0_ |= 0x00000002; onChanged(); return this; } + /** * * *
        -     * Unimplemented. Dot not use.
        -     * DEPRECATED: This field is no longer supported. Instead of using aliases,
        -     * please specify multiple [google.api.Endpoint][google.api.Endpoint] for each
        -     * of the intended aliases.
        -     * Additional names that this endpoint will be hosted on.
        +     * Aliases for this endpoint, these will be served by the same UrlMap as the
        +     * parent endpoint, and will be provisioned in the GCP stack for the Regional
        +     * Endpoints.
              * 
        * - * repeated string aliases = 2 [deprecated = true]; + * repeated string aliases = 2; * - * @deprecated google.api.Endpoint.aliases is deprecated. See google/api/endpoint.proto;l=56 * @param value The aliases to add. * @return This builder for chaining. */ - @java.lang.Deprecated public Builder addAliases(java.lang.String value) { if (value == null) { throw new NullPointerException(); } ensureAliasesIsMutable(); aliases_.add(value); + bitField0_ |= 0x00000002; onChanged(); return this; } + /** * * *
        -     * Unimplemented. Dot not use.
        -     * DEPRECATED: This field is no longer supported. Instead of using aliases,
        -     * please specify multiple [google.api.Endpoint][google.api.Endpoint] for each
        -     * of the intended aliases.
        -     * Additional names that this endpoint will be hosted on.
        +     * Aliases for this endpoint, these will be served by the same UrlMap as the
        +     * parent endpoint, and will be provisioned in the GCP stack for the Regional
        +     * Endpoints.
              * 
        * - * repeated string aliases = 2 [deprecated = true]; + * repeated string aliases = 2; * - * @deprecated google.api.Endpoint.aliases is deprecated. See google/api/endpoint.proto;l=56 * @param values The aliases to add. * @return This builder for chaining. */ - @java.lang.Deprecated public Builder addAllAliases(java.lang.Iterable values) { ensureAliasesIsMutable(); com.google.protobuf.AbstractMessageLite.Builder.addAll(values, aliases_); + bitField0_ |= 0x00000002; onChanged(); return this; } + /** * * *
        -     * Unimplemented. Dot not use.
        -     * DEPRECATED: This field is no longer supported. Instead of using aliases,
        -     * please specify multiple [google.api.Endpoint][google.api.Endpoint] for each
        -     * of the intended aliases.
        -     * Additional names that this endpoint will be hosted on.
        +     * Aliases for this endpoint, these will be served by the same UrlMap as the
        +     * parent endpoint, and will be provisioned in the GCP stack for the Regional
        +     * Endpoints.
              * 
        * - * repeated string aliases = 2 [deprecated = true]; + * repeated string aliases = 2; * - * @deprecated google.api.Endpoint.aliases is deprecated. See google/api/endpoint.proto;l=56 * @return This builder for chaining. */ - @java.lang.Deprecated public Builder clearAliases() { - aliases_ = com.google.protobuf.LazyStringArrayList.EMPTY; - bitField0_ = (bitField0_ & ~0x00000001); + aliases_ = com.google.protobuf.LazyStringArrayList.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + ; onChanged(); return this; } + /** * * *
        -     * Unimplemented. Dot not use.
        -     * DEPRECATED: This field is no longer supported. Instead of using aliases,
        -     * please specify multiple [google.api.Endpoint][google.api.Endpoint] for each
        -     * of the intended aliases.
        -     * Additional names that this endpoint will be hosted on.
        +     * Aliases for this endpoint, these will be served by the same UrlMap as the
        +     * parent endpoint, and will be provisioned in the GCP stack for the Regional
        +     * Endpoints.
              * 
        * - * repeated string aliases = 2 [deprecated = true]; + * repeated string aliases = 2; * - * @deprecated google.api.Endpoint.aliases is deprecated. See google/api/endpoint.proto;l=56 * @param value The bytes of the aliases to add. * @return This builder for chaining. */ - @java.lang.Deprecated public Builder addAliasesBytes(com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); @@ -1048,11 +1016,13 @@ public Builder addAliasesBytes(com.google.protobuf.ByteString value) { checkByteStringIsUtf8(value); ensureAliasesIsMutable(); aliases_.add(value); + bitField0_ |= 0x00000002; onChanged(); return this; } private java.lang.Object target_ = ""; + /** * * @@ -1079,6 +1049,7 @@ public java.lang.String getTarget() { return (java.lang.String) ref; } } + /** * * @@ -1105,6 +1076,7 @@ public com.google.protobuf.ByteString getTargetBytes() { return (com.google.protobuf.ByteString) ref; } } + /** * * @@ -1125,11 +1097,12 @@ public Builder setTarget(java.lang.String value) { if (value == null) { throw new NullPointerException(); } - target_ = value; + bitField0_ |= 0x00000004; onChanged(); return this; } + /** * * @@ -1146,11 +1119,12 @@ public Builder setTarget(java.lang.String value) { * @return This builder for chaining. */ public Builder clearTarget() { - target_ = getDefaultInstance().getTarget(); + bitField0_ = (bitField0_ & ~0x00000004); onChanged(); return this; } + /** * * @@ -1172,13 +1146,14 @@ public Builder setTargetBytes(com.google.protobuf.ByteString value) { throw new NullPointerException(); } checkByteStringIsUtf8(value); - target_ = value; + bitField0_ |= 0x00000004; onChanged(); return this; } private boolean allowCors_; + /** * * @@ -1199,6 +1174,7 @@ public Builder setTargetBytes(com.google.protobuf.ByteString value) { public boolean getAllowCors() { return allowCors_; } + /** * * @@ -1219,9 +1195,11 @@ public boolean getAllowCors() { public Builder setAllowCors(boolean value) { allowCors_ = value; + bitField0_ |= 0x00000008; onChanged(); return this; } + /** * * @@ -1239,23 +1217,12 @@ public Builder setAllowCors(boolean value) { * @return This builder for chaining. */ public Builder clearAllowCors() { - + bitField0_ = (bitField0_ & ~0x00000008); allowCors_ = false; onChanged(); return this; } - @java.lang.Override - public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - // @@protoc_insertion_point(builder_scope:google.api.Endpoint) } diff --git a/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/EndpointOrBuilder.java b/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/EndpointOrBuilder.java index fae540697b..c045f1b455 100644 --- a/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/EndpointOrBuilder.java +++ b/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/EndpointOrBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,10 +14,13 @@ * limitations under the License. */ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: google/api/endpoint.proto +// Protobuf Java Version: 4.33.2 package com.google.api; +@com.google.protobuf.Generated public interface EndpointOrBuilder extends // @@protoc_insertion_point(interface_extends:google.api.Endpoint) @@ -35,6 +38,7 @@ public interface EndpointOrBuilder * @return The name. */ java.lang.String getName(); + /** * * @@ -52,75 +56,62 @@ public interface EndpointOrBuilder * * *
        -   * Unimplemented. Dot not use.
        -   * DEPRECATED: This field is no longer supported. Instead of using aliases,
        -   * please specify multiple [google.api.Endpoint][google.api.Endpoint] for each
        -   * of the intended aliases.
        -   * Additional names that this endpoint will be hosted on.
        +   * Aliases for this endpoint, these will be served by the same UrlMap as the
        +   * parent endpoint, and will be provisioned in the GCP stack for the Regional
        +   * Endpoints.
            * 
        * - * repeated string aliases = 2 [deprecated = true]; + * repeated string aliases = 2; * - * @deprecated google.api.Endpoint.aliases is deprecated. See google/api/endpoint.proto;l=56 * @return A list containing the aliases. */ - @java.lang.Deprecated java.util.List getAliasesList(); + /** * * *
        -   * Unimplemented. Dot not use.
        -   * DEPRECATED: This field is no longer supported. Instead of using aliases,
        -   * please specify multiple [google.api.Endpoint][google.api.Endpoint] for each
        -   * of the intended aliases.
        -   * Additional names that this endpoint will be hosted on.
        +   * Aliases for this endpoint, these will be served by the same UrlMap as the
        +   * parent endpoint, and will be provisioned in the GCP stack for the Regional
        +   * Endpoints.
            * 
        * - * repeated string aliases = 2 [deprecated = true]; + * repeated string aliases = 2; * - * @deprecated google.api.Endpoint.aliases is deprecated. See google/api/endpoint.proto;l=56 * @return The count of aliases. */ - @java.lang.Deprecated int getAliasesCount(); + /** * * *
        -   * Unimplemented. Dot not use.
        -   * DEPRECATED: This field is no longer supported. Instead of using aliases,
        -   * please specify multiple [google.api.Endpoint][google.api.Endpoint] for each
        -   * of the intended aliases.
        -   * Additional names that this endpoint will be hosted on.
        +   * Aliases for this endpoint, these will be served by the same UrlMap as the
        +   * parent endpoint, and will be provisioned in the GCP stack for the Regional
        +   * Endpoints.
            * 
        * - * repeated string aliases = 2 [deprecated = true]; + * repeated string aliases = 2; * - * @deprecated google.api.Endpoint.aliases is deprecated. See google/api/endpoint.proto;l=56 * @param index The index of the element to return. * @return The aliases at the given index. */ - @java.lang.Deprecated java.lang.String getAliases(int index); + /** * * *
        -   * Unimplemented. Dot not use.
        -   * DEPRECATED: This field is no longer supported. Instead of using aliases,
        -   * please specify multiple [google.api.Endpoint][google.api.Endpoint] for each
        -   * of the intended aliases.
        -   * Additional names that this endpoint will be hosted on.
        +   * Aliases for this endpoint, these will be served by the same UrlMap as the
        +   * parent endpoint, and will be provisioned in the GCP stack for the Regional
        +   * Endpoints.
            * 
        * - * repeated string aliases = 2 [deprecated = true]; + * repeated string aliases = 2; * - * @deprecated google.api.Endpoint.aliases is deprecated. See google/api/endpoint.proto;l=56 * @param index The index of the value to return. * @return The bytes of the aliases at the given index. */ - @java.lang.Deprecated com.google.protobuf.ByteString getAliasesBytes(int index); /** @@ -139,6 +130,7 @@ public interface EndpointOrBuilder * @return The target. */ java.lang.String getTarget(); + /** * * diff --git a/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/EndpointProto.java b/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/EndpointProto.java index 196f1b64f6..6c6b0a68a3 100644 --- a/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/EndpointProto.java +++ b/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/EndpointProto.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,13 +14,26 @@ * limitations under the License. */ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: google/api/endpoint.proto +// Protobuf Java Version: 4.33.2 package com.google.api; -public final class EndpointProto { +@com.google.protobuf.Generated +public final class EndpointProto extends com.google.protobuf.GeneratedFile { private EndpointProto() {} + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "EndpointProto"); + } + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistryLite registry) {} public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry registry) { @@ -29,7 +42,7 @@ public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry r static final com.google.protobuf.Descriptors.Descriptor internal_static_google_api_Endpoint_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable internal_static_google_api_Endpoint_fieldAccessorTable; public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { @@ -41,23 +54,23 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { static { java.lang.String[] descriptorData = { "\n\031google/api/endpoint.proto\022\ngoogle.api\"" - + "Q\n\010Endpoint\022\014\n\004name\030\001 \001(\t\022\023\n\007aliases\030\002 \003" - + "(\tB\002\030\001\022\016\n\006target\030e \001(\t\022\022\n\nallow_cors\030\005 \001" - + "(\010Bo\n\016com.google.apiB\rEndpointProtoP\001ZEg" - + "oogle.golang.org/genproto/googleapis/api" - + "/serviceconfig;serviceconfig\242\002\004GAPIb\006pro" - + "to3" + + "M\n\010Endpoint\022\014\n\004name\030\001 \001(\t\022\017\n\007aliases\030\002 \003" + + "(\t\022\016\n\006target\030e \001(\t\022\022\n\nallow_cors\030\005 \001(\010Bo" + + "\n\016com.google.apiB\rEndpointProtoP\001ZEgoogl" + + "e.golang.org/genproto/googleapis/api/ser" + + "viceconfig;serviceconfig\242\002\004GAPIb\006proto3" }; descriptor = com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( descriptorData, new com.google.protobuf.Descriptors.FileDescriptor[] {}); - internal_static_google_api_Endpoint_descriptor = getDescriptor().getMessageTypes().get(0); + internal_static_google_api_Endpoint_descriptor = getDescriptor().getMessageType(0); internal_static_google_api_Endpoint_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_google_api_Endpoint_descriptor, new java.lang.String[] { "Name", "Aliases", "Target", "AllowCors", }); + descriptor.resolveAllFeaturesImmutable(); } // @@protoc_insertion_point(outer_class_scope) diff --git a/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/ErrorReason.java b/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/ErrorReason.java index 63903e464f..84f59f2904 100644 --- a/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/ErrorReason.java +++ b/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/ErrorReason.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,9 @@ * limitations under the License. */ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: google/api/error_reason.proto +// Protobuf Java Version: 4.33.2 package com.google.api; @@ -36,6 +38,7 @@ * * Protobuf enum {@code google.api.ErrorReason} */ +@com.google.protobuf.Generated public enum ErrorReason implements com.google.protobuf.ProtocolMessageEnum { /** * @@ -52,15 +55,18 @@ public enum ErrorReason implements com.google.protobuf.ProtocolMessageEnum { * *
            * The request is calling a disabled service for a consumer.
        +   *
            * Example of an ErrorInfo when the consumer "projects/123" contacting
            * "pubsub.googleapis.com" service which is disabled:
        -   *     { "reason": "SERVICE_DISABLED",
        -   *       "domain": "googleapis.com",
        -   *       "metadata": {
        -   *         "consumer": "projects/123",
        -   *         "service": "pubsub.googleapis.com"
        -   *       }
        -   *     }
        +   *
        +   * { "reason": "SERVICE_DISABLED",
        +   * "domain": "googleapis.com",
        +   * "metadata": {
        +   * "consumer": "projects/123",
        +   * "service": "pubsub.googleapis.com"
        +   * }
        +   * }
        +   *
            * This response indicates the "pubsub.googleapis.com" has been disabled in
            * "projects/123".
            * 
        @@ -73,16 +79,19 @@ public enum ErrorReason implements com.google.protobuf.ProtocolMessageEnum { * *
            * The request whose associated billing account is disabled.
        +   *
            * Example of an ErrorInfo when the consumer "projects/123" fails to contact
            * "pubsub.googleapis.com" service because the associated billing account is
            * disabled:
        -   *     { "reason": "BILLING_DISABLED",
        -   *       "domain": "googleapis.com",
        -   *       "metadata": {
        -   *         "consumer": "projects/123",
        -   *         "service": "pubsub.googleapis.com"
        -   *       }
        -   *     }
        +   *
        +   * { "reason": "BILLING_DISABLED",
        +   * "domain": "googleapis.com",
        +   * "metadata": {
        +   * "consumer": "projects/123",
        +   * "service": "pubsub.googleapis.com"
        +   * }
        +   * }
        +   *
            * This response indicates the billing account associated has been disabled.
            * 
        * @@ -96,14 +105,16 @@ public enum ErrorReason implements com.google.protobuf.ProtocolMessageEnum { * The request is denied because the provided [API * key](https://cloud.google.com/docs/authentication/api-keys) is invalid. It * may be in a bad format, cannot be found, or has been expired). + * * Example of an ErrorInfo when the request is contacting * "storage.googleapis.com" service with an invalid API key: - * { "reason": "API_KEY_INVALID", - * "domain": "googleapis.com", - * "metadata": { - * "service": "storage.googleapis.com", - * } - * } + * + * { "reason": "API_KEY_INVALID", + * "domain": "googleapis.com", + * "metadata": { + * "service": "storage.googleapis.com", + * } + * } *
        * * API_KEY_INVALID = 3; @@ -115,16 +126,18 @@ public enum ErrorReason implements com.google.protobuf.ProtocolMessageEnum { *
            * The request is denied because it violates [API key API
            * restrictions](https://cloud.google.com/docs/authentication/api-keys#adding_api_restrictions).
        +   *
            * Example of an ErrorInfo when the consumer "projects/123" fails to call the
            * "storage.googleapis.com" service because this service is restricted in the
            * API key:
        -   *     { "reason": "API_KEY_SERVICE_BLOCKED",
        -   *       "domain": "googleapis.com",
        -   *       "metadata": {
        -   *         "consumer": "projects/123",
        -   *         "service": "storage.googleapis.com"
        -   *       }
        -   *     }
        +   *
        +   * { "reason": "API_KEY_SERVICE_BLOCKED",
        +   * "domain": "googleapis.com",
        +   * "metadata": {
        +   * "consumer": "projects/123",
        +   * "service": "storage.googleapis.com"
        +   * }
        +   * }
            * 
        * * API_KEY_SERVICE_BLOCKED = 4; @@ -136,16 +149,18 @@ public enum ErrorReason implements com.google.protobuf.ProtocolMessageEnum { *
            * The request is denied because it violates [API key HTTP
            * restrictions](https://cloud.google.com/docs/authentication/api-keys#adding_http_restrictions).
        +   *
            * Example of an ErrorInfo when the consumer "projects/123" fails to call
            * "storage.googleapis.com" service because the http referrer of the request
            * violates API key HTTP restrictions:
        -   *     { "reason": "API_KEY_HTTP_REFERRER_BLOCKED",
        -   *       "domain": "googleapis.com",
        -   *       "metadata": {
        -   *         "consumer": "projects/123",
        -   *         "service": "storage.googleapis.com",
        -   *       }
        -   *     }
        +   *
        +   * { "reason": "API_KEY_HTTP_REFERRER_BLOCKED",
        +   * "domain": "googleapis.com",
        +   * "metadata": {
        +   * "consumer": "projects/123",
        +   * "service": "storage.googleapis.com",
        +   * }
        +   * }
            * 
        * * API_KEY_HTTP_REFERRER_BLOCKED = 7; @@ -157,16 +172,18 @@ public enum ErrorReason implements com.google.protobuf.ProtocolMessageEnum { *
            * The request is denied because it violates [API key IP address
            * restrictions](https://cloud.google.com/docs/authentication/api-keys#adding_application_restrictions).
        +   *
            * Example of an ErrorInfo when the consumer "projects/123" fails to call
            * "storage.googleapis.com" service because the caller IP of the request
            * violates API key IP address restrictions:
        -   *     { "reason": "API_KEY_IP_ADDRESS_BLOCKED",
        -   *       "domain": "googleapis.com",
        -   *       "metadata": {
        -   *         "consumer": "projects/123",
        -   *         "service": "storage.googleapis.com",
        -   *       }
        -   *     }
        +   *
        +   * { "reason": "API_KEY_IP_ADDRESS_BLOCKED",
        +   * "domain": "googleapis.com",
        +   * "metadata": {
        +   * "consumer": "projects/123",
        +   * "service": "storage.googleapis.com",
        +   * }
        +   * }
            * 
        * * API_KEY_IP_ADDRESS_BLOCKED = 8; @@ -178,16 +195,18 @@ public enum ErrorReason implements com.google.protobuf.ProtocolMessageEnum { *
            * The request is denied because it violates [API key Android application
            * restrictions](https://cloud.google.com/docs/authentication/api-keys#adding_application_restrictions).
        +   *
            * Example of an ErrorInfo when the consumer "projects/123" fails to call
            * "storage.googleapis.com" service because the request from the Android apps
            * violates the API key Android application restrictions:
        -   *     { "reason": "API_KEY_ANDROID_APP_BLOCKED",
        -   *       "domain": "googleapis.com",
        -   *       "metadata": {
        -   *         "consumer": "projects/123",
        -   *         "service": "storage.googleapis.com"
        -   *       }
        -   *     }
        +   *
        +   * { "reason": "API_KEY_ANDROID_APP_BLOCKED",
        +   * "domain": "googleapis.com",
        +   * "metadata": {
        +   * "consumer": "projects/123",
        +   * "service": "storage.googleapis.com"
        +   * }
        +   * }
            * 
        * * API_KEY_ANDROID_APP_BLOCKED = 9; @@ -199,16 +218,18 @@ public enum ErrorReason implements com.google.protobuf.ProtocolMessageEnum { *
            * The request is denied because it violates [API key iOS application
            * restrictions](https://cloud.google.com/docs/authentication/api-keys#adding_application_restrictions).
        +   *
            * Example of an ErrorInfo when the consumer "projects/123" fails to call
            * "storage.googleapis.com" service because the request from the iOS apps
            * violates the API key iOS application restrictions:
        -   *     { "reason": "API_KEY_IOS_APP_BLOCKED",
        -   *       "domain": "googleapis.com",
        -   *       "metadata": {
        -   *         "consumer": "projects/123",
        -   *         "service": "storage.googleapis.com"
        -   *       }
        -   *     }
        +   *
        +   * { "reason": "API_KEY_IOS_APP_BLOCKED",
        +   * "domain": "googleapis.com",
        +   * "metadata": {
        +   * "consumer": "projects/123",
        +   * "service": "storage.googleapis.com"
        +   * }
        +   * }
            * 
        * * API_KEY_IOS_APP_BLOCKED = 13; @@ -220,33 +241,37 @@ public enum ErrorReason implements com.google.protobuf.ProtocolMessageEnum { *
            * The request is denied because there is not enough rate quota for the
            * consumer.
        +   *
            * Example of an ErrorInfo when the consumer "projects/123" fails to contact
            * "pubsub.googleapis.com" service because consumer's rate quota usage has
            * reached the maximum value set for the quota limit
            * "ReadsPerMinutePerProject" on the quota metric
            * "pubsub.googleapis.com/read_requests":
        -   *     { "reason": "RATE_LIMIT_EXCEEDED",
        -   *       "domain": "googleapis.com",
        -   *       "metadata": {
        -   *         "consumer": "projects/123",
        -   *         "service": "pubsub.googleapis.com",
        -   *         "quota_metric": "pubsub.googleapis.com/read_requests",
        -   *         "quota_limit": "ReadsPerMinutePerProject"
        -   *       }
        -   *     }
        +   *
        +   * { "reason": "RATE_LIMIT_EXCEEDED",
        +   * "domain": "googleapis.com",
        +   * "metadata": {
        +   * "consumer": "projects/123",
        +   * "service": "pubsub.googleapis.com",
        +   * "quota_metric": "pubsub.googleapis.com/read_requests",
        +   * "quota_limit": "ReadsPerMinutePerProject"
        +   * }
        +   * }
        +   *
            * Example of an ErrorInfo when the consumer "projects/123" checks quota on
            * the service "dataflow.googleapis.com" and hits the organization quota
            * limit "DefaultRequestsPerMinutePerOrganization" on the metric
            * "dataflow.googleapis.com/default_requests".
        -   *     { "reason": "RATE_LIMIT_EXCEEDED",
        -   *       "domain": "googleapis.com",
        -   *       "metadata": {
        -   *         "consumer": "projects/123",
        -   *         "service": "dataflow.googleapis.com",
        -   *         "quota_metric": "dataflow.googleapis.com/default_requests",
        -   *         "quota_limit": "DefaultRequestsPerMinutePerOrganization"
        -   *       }
        -   *     }
        +   *
        +   * { "reason": "RATE_LIMIT_EXCEEDED",
        +   * "domain": "googleapis.com",
        +   * "metadata": {
        +   * "consumer": "projects/123",
        +   * "service": "dataflow.googleapis.com",
        +   * "quota_metric": "dataflow.googleapis.com/default_requests",
        +   * "quota_limit": "DefaultRequestsPerMinutePerOrganization"
        +   * }
        +   * }
            * 
        * * RATE_LIMIT_EXCEEDED = 5; @@ -258,32 +283,36 @@ public enum ErrorReason implements com.google.protobuf.ProtocolMessageEnum { *
            * The request is denied because there is not enough resource quota for the
            * consumer.
        +   *
            * Example of an ErrorInfo when the consumer "projects/123" fails to contact
            * "compute.googleapis.com" service because consumer's resource quota usage
            * has reached the maximum value set for the quota limit "VMsPerProject"
            * on the quota metric "compute.googleapis.com/vms":
        -   *     { "reason": "RESOURCE_QUOTA_EXCEEDED",
        -   *       "domain": "googleapis.com",
        -   *       "metadata": {
        -   *         "consumer": "projects/123",
        -   *         "service": "compute.googleapis.com",
        -   *         "quota_metric": "compute.googleapis.com/vms",
        -   *         "quota_limit": "VMsPerProject"
        -   *       }
        -   *     }
        +   *
        +   * { "reason": "RESOURCE_QUOTA_EXCEEDED",
        +   * "domain": "googleapis.com",
        +   * "metadata": {
        +   * "consumer": "projects/123",
        +   * "service": "compute.googleapis.com",
        +   * "quota_metric": "compute.googleapis.com/vms",
        +   * "quota_limit": "VMsPerProject"
        +   * }
        +   * }
        +   *
            * Example of an ErrorInfo when the consumer "projects/123" checks resource
            * quota on the service "dataflow.googleapis.com" and hits the organization
            * quota limit "jobs-per-organization" on the metric
            * "dataflow.googleapis.com/job_count".
        -   *     { "reason": "RESOURCE_QUOTA_EXCEEDED",
        -   *       "domain": "googleapis.com",
        -   *       "metadata": {
        -   *         "consumer": "projects/123",
        -   *         "service": "dataflow.googleapis.com",
        -   *         "quota_metric": "dataflow.googleapis.com/job_count",
        -   *         "quota_limit": "jobs-per-organization"
        -   *       }
        -   *     }
        +   *
        +   * { "reason": "RESOURCE_QUOTA_EXCEEDED",
        +   * "domain": "googleapis.com",
        +   * "metadata": {
        +   * "consumer": "projects/123",
        +   * "service": "dataflow.googleapis.com",
        +   * "quota_metric": "dataflow.googleapis.com/job_count",
        +   * "quota_limit": "jobs-per-organization"
        +   * }
        +   * }
            * 
        * * RESOURCE_QUOTA_EXCEEDED = 6; @@ -296,17 +325,20 @@ public enum ErrorReason implements com.google.protobuf.ProtocolMessageEnum { * The request whose associated billing account address is in a tax restricted * location, violates the local tax restrictions when creating resources in * the restricted region. + * * Example of an ErrorInfo when creating the Cloud Storage Bucket in the * container "projects/123" under a tax restricted region * "locations/asia-northeast3": - * { "reason": "LOCATION_TAX_POLICY_VIOLATED", - * "domain": "googleapis.com", - * "metadata": { - * "consumer": "projects/123", - * "service": "storage.googleapis.com", - * "location": "locations/asia-northeast3" - * } - * } + * + * { "reason": "LOCATION_TAX_POLICY_VIOLATED", + * "domain": "googleapis.com", + * "metadata": { + * "consumer": "projects/123", + * "service": "storage.googleapis.com", + * "location": "locations/asia-northeast3" + * } + * } + * * This response indicates creating the Cloud Storage Bucket in * "locations/asia-northeast3" violates the location tax restriction. *
        @@ -322,15 +354,17 @@ public enum ErrorReason implements com.google.protobuf.ProtocolMessageEnum { * on the user project "projects/123" or the user project is invalid. For more * information, check the [userProject System * Parameters](https://cloud.google.com/apis/docs/system-parameters). + * * Example of an ErrorInfo when the caller is calling Cloud Storage service * with insufficient permissions on the user project: - * { "reason": "USER_PROJECT_DENIED", - * "domain": "googleapis.com", - * "metadata": { - * "consumer": "projects/123", - * "service": "storage.googleapis.com" - * } - * } + * + * { "reason": "USER_PROJECT_DENIED", + * "domain": "googleapis.com", + * "metadata": { + * "consumer": "projects/123", + * "service": "storage.googleapis.com" + * } + * } * * * USER_PROJECT_DENIED = 11; @@ -344,15 +378,17 @@ public enum ErrorReason implements com.google.protobuf.ProtocolMessageEnum { * to Terms of Service(Tos) violations. Check [Project suspension * guidelines](https://cloud.google.com/resource-manager/docs/project-suspension-guidelines) * for more information. + * * Example of an ErrorInfo when calling Cloud Storage service with the * suspended consumer "projects/123": - * { "reason": "CONSUMER_SUSPENDED", - * "domain": "googleapis.com", - * "metadata": { - * "consumer": "projects/123", - * "service": "storage.googleapis.com" - * } - * } + * + * { "reason": "CONSUMER_SUSPENDED", + * "domain": "googleapis.com", + * "metadata": { + * "consumer": "projects/123", + * "service": "storage.googleapis.com" + * } + * } * * * CONSUMER_SUSPENDED = 12; @@ -364,15 +400,17 @@ public enum ErrorReason implements com.google.protobuf.ProtocolMessageEnum { *
            * The request is denied because the associated consumer is invalid. It may be
            * in a bad format, cannot be found, or have been deleted.
        +   *
            * Example of an ErrorInfo when calling Cloud Storage service with the
            * invalid consumer "projects/123":
        -   *     { "reason": "CONSUMER_INVALID",
        -   *       "domain": "googleapis.com",
        -   *       "metadata": {
        -   *         "consumer": "projects/123",
        -   *         "service": "storage.googleapis.com"
        -   *       }
        -   *     }
        +   *
        +   * { "reason": "CONSUMER_INVALID",
        +   * "domain": "googleapis.com",
        +   * "metadata": {
        +   * "consumer": "projects/123",
        +   * "service": "storage.googleapis.com"
        +   * }
        +   * }
            * 
        * * CONSUMER_INVALID = 14; @@ -388,17 +426,19 @@ public enum ErrorReason implements com.google.protobuf.ProtocolMessageEnum { * to search the audit log for a request rejected by VPC Service Controls. For * more information, please refer [VPC Service Controls * Troubleshooting](https://cloud.google.com/vpc-service-controls/docs/troubleshooting#unique-id) + * * Example of an ErrorInfo when the consumer "projects/123" fails to call * Cloud Storage service because the request is prohibited by the VPC Service * Controls. - * { "reason": "SECURITY_POLICY_VIOLATED", - * "domain": "googleapis.com", - * "metadata": { - * "uid": "123456789abcde", - * "consumer": "projects/123", - * "service": "storage.googleapis.com" - * } - * } + * + * { "reason": "SECURITY_POLICY_VIOLATED", + * "domain": "googleapis.com", + * "metadata": { + * "uid": "123456789abcde", + * "consumer": "projects/123", + * "service": "storage.googleapis.com" + * } + * } * * * SECURITY_POLICY_VIOLATED = 15; @@ -409,15 +449,17 @@ public enum ErrorReason implements com.google.protobuf.ProtocolMessageEnum { * *
            * The request is denied because the provided access token has expired.
        +   *
            * Example of an ErrorInfo when the request is calling Cloud Storage service
            * with an expired access token:
        -   *     { "reason": "ACCESS_TOKEN_EXPIRED",
        -   *       "domain": "googleapis.com",
        -   *       "metadata": {
        -   *         "service": "storage.googleapis.com",
        -   *         "method": "google.storage.v1.Storage.GetObject"
        -   *       }
        -   *     }
        +   *
        +   * { "reason": "ACCESS_TOKEN_EXPIRED",
        +   * "domain": "googleapis.com",
        +   * "metadata": {
        +   * "service": "storage.googleapis.com",
        +   * "method": "google.storage.v1.Storage.GetObject"
        +   * }
        +   * }
            * 
        * * ACCESS_TOKEN_EXPIRED = 16; @@ -433,15 +475,17 @@ public enum ErrorReason implements com.google.protobuf.ProtocolMessageEnum { * APIs](https://developers.google.com/identity/protocols/oauth2/scopes) for * the list of the OAuth 2.0 scopes that you might need to request to access * the API. + * * Example of an ErrorInfo when the request is calling Cloud Storage service * with an access token that is missing required scopes: - * { "reason": "ACCESS_TOKEN_SCOPE_INSUFFICIENT", - * "domain": "googleapis.com", - * "metadata": { - * "service": "storage.googleapis.com", - * "method": "google.storage.v1.Storage.GetObject" - * } - * } + * + * { "reason": "ACCESS_TOKEN_SCOPE_INSUFFICIENT", + * "domain": "googleapis.com", + * "metadata": { + * "service": "storage.googleapis.com", + * "method": "google.storage.v1.Storage.GetObject" + * } + * } * * * ACCESS_TOKEN_SCOPE_INSUFFICIENT = 17; @@ -454,20 +498,23 @@ public enum ErrorReason implements com.google.protobuf.ProtocolMessageEnum { * The request is denied because the account associated with the provided * access token is in an invalid state, such as disabled or deleted. * For more information, see https://cloud.google.com/docs/authentication. + * * Warning: For privacy reasons, the server may not be able to disclose the * email address for some accounts. The client MUST NOT depend on the * availability of the `email` attribute. + * * Example of an ErrorInfo when the request is to the Cloud Storage API with * an access token that is associated with a disabled or deleted [service * account](http://cloud/iam/docs/service-accounts): - * { "reason": "ACCOUNT_STATE_INVALID", - * "domain": "googleapis.com", - * "metadata": { - * "service": "storage.googleapis.com", - * "method": "google.storage.v1.Storage.GetObject", - * "email": "user@123.iam.gserviceaccount.com" - * } - * } + * + * { "reason": "ACCOUNT_STATE_INVALID", + * "domain": "googleapis.com", + * "metadata": { + * "service": "storage.googleapis.com", + * "method": "google.storage.v1.Storage.GetObject", + * "email": "user@123.iam.gserviceaccount.com" + * } + * } * * * ACCOUNT_STATE_INVALID = 18; @@ -479,15 +526,17 @@ public enum ErrorReason implements com.google.protobuf.ProtocolMessageEnum { *
            * The request is denied because the type of the provided access token is not
            * supported by the API being called.
        +   *
            * Example of an ErrorInfo when the request is to the Cloud Storage API with
            * an unsupported token type.
        -   *     { "reason": "ACCESS_TOKEN_TYPE_UNSUPPORTED",
        -   *       "domain": "googleapis.com",
        -   *       "metadata": {
        -   *         "service": "storage.googleapis.com",
        -   *         "method": "google.storage.v1.Storage.GetObject"
        -   *       }
        -   *     }
        +   *
        +   * { "reason": "ACCESS_TOKEN_TYPE_UNSUPPORTED",
        +   * "domain": "googleapis.com",
        +   * "metadata": {
        +   * "service": "storage.googleapis.com",
        +   * "method": "google.storage.v1.Storage.GetObject"
        +   * }
        +   * }
            * 
        * * ACCESS_TOKEN_TYPE_UNSUPPORTED = 19; @@ -501,15 +550,17 @@ public enum ErrorReason implements com.google.protobuf.ProtocolMessageEnum { * credentials. For more information regarding the supported authentication * strategies for Google Cloud APIs, see * https://cloud.google.com/docs/authentication. + * * Example of an ErrorInfo when the request is to the Cloud Storage API * without any authentication credentials. - * { "reason": "CREDENTIALS_MISSING", - * "domain": "googleapis.com", - * "metadata": { - * "service": "storage.googleapis.com", - * "method": "google.storage.v1.Storage.GetObject" - * } - * } + * + * { "reason": "CREDENTIALS_MISSING", + * "domain": "googleapis.com", + * "metadata": { + * "service": "storage.googleapis.com", + * "method": "google.storage.v1.Storage.GetObject" + * } + * } * * * CREDENTIALS_MISSING = 20; @@ -523,17 +574,19 @@ public enum ErrorReason implements com.google.protobuf.ProtocolMessageEnum { * which acts as the [API * consumer](https://cloud.google.com/apis/design/glossary#api_consumer) is * invalid. It may be in a bad format or empty. + * * Example of an ErrorInfo when the request is to the Cloud Functions API, * but the offered resource project in the request in a bad format which can't * perform the ListFunctions method. - * { "reason": "RESOURCE_PROJECT_INVALID", - * "domain": "googleapis.com", - * "metadata": { - * "service": "cloudfunctions.googleapis.com", - * "method": - * "google.cloud.functions.v1.CloudFunctionsService.ListFunctions" - * } - * } + * + * { "reason": "RESOURCE_PROJECT_INVALID", + * "domain": "googleapis.com", + * "metadata": { + * "service": "cloudfunctions.googleapis.com", + * "method": + * "google.cloud.functions.v1.CloudFunctionsService.ListFunctions" + * } + * } * * * RESOURCE_PROJECT_INVALID = 21; @@ -545,16 +598,18 @@ public enum ErrorReason implements com.google.protobuf.ProtocolMessageEnum { *
            * The request is denied because the provided session cookie is missing,
            * invalid or failed to decode.
        +   *
            * Example of an ErrorInfo when the request is calling Cloud Storage service
            * with a SID cookie which can't be decoded.
        -   *     { "reason": "SESSION_COOKIE_INVALID",
        -   *       "domain": "googleapis.com",
        -   *       "metadata": {
        -   *         "service": "storage.googleapis.com",
        -   *         "method": "google.storage.v1.Storage.GetObject",
        -   *         "cookie": "SID"
        -   *       }
        -   *     }
        +   *
        +   * { "reason": "SESSION_COOKIE_INVALID",
        +   * "domain": "googleapis.com",
        +   * "metadata": {
        +   * "service": "storage.googleapis.com",
        +   * "method": "google.storage.v1.Storage.GetObject",
        +   * "cookie": "SID"
        +   * }
        +   * }
            * 
        * * SESSION_COOKIE_INVALID = 23; @@ -566,16 +621,19 @@ public enum ErrorReason implements com.google.protobuf.ProtocolMessageEnum { *
            * The request is denied because the user is from a Google Workspace customer
            * that blocks their users from accessing a particular service.
        +   *
            * Example scenario: https://support.google.com/a/answer/9197205?hl=en
        +   *
            * Example of an ErrorInfo when access to Google Cloud Storage service is
            * blocked by the Google Workspace administrator:
        -   *     { "reason": "USER_BLOCKED_BY_ADMIN",
        -   *       "domain": "googleapis.com",
        -   *       "metadata": {
        -   *         "service": "storage.googleapis.com",
        -   *         "method": "google.storage.v1.Storage.GetObject",
        -   *       }
        -   *     }
        +   *
        +   * { "reason": "USER_BLOCKED_BY_ADMIN",
        +   * "domain": "googleapis.com",
        +   * "metadata": {
        +   * "service": "storage.googleapis.com",
        +   * "method": "google.storage.v1.Storage.GetObject",
        +   * }
        +   * }
            * 
        * * USER_BLOCKED_BY_ADMIN = 24; @@ -589,15 +647,17 @@ public enum ErrorReason implements com.google.protobuf.ProtocolMessageEnum { * by administrators according to the organization policy constraint. * For more information see * https://cloud.google.com/resource-manager/docs/organization-policy/restricting-services. + * * Example of an ErrorInfo when access to Google Cloud Storage service is * restricted by Resource Usage Restriction policy: - * { "reason": "RESOURCE_USAGE_RESTRICTION_VIOLATED", - * "domain": "googleapis.com", - * "metadata": { - * "consumer": "projects/project-123", - * "service": "storage.googleapis.com" - * } - * } + * + * { "reason": "RESOURCE_USAGE_RESTRICTION_VIOLATED", + * "domain": "googleapis.com", + * "metadata": { + * "consumer": "projects/project-123", + * "service": "storage.googleapis.com" + * } + * } * * * RESOURCE_USAGE_RESTRICTION_VIOLATED = 25; @@ -608,18 +668,21 @@ public enum ErrorReason implements com.google.protobuf.ProtocolMessageEnum { * *
            * Unimplemented. Do not use.
        +   *
            * The request is denied because it contains unsupported system parameters in
            * URL query parameters or HTTP headers. For more information,
            * see https://cloud.google.com/apis/docs/system-parameters
        +   *
            * Example of an ErrorInfo when access "pubsub.googleapis.com" service with
            * a request header of "x-goog-user-ip":
        -   *     { "reason": "SYSTEM_PARAMETER_UNSUPPORTED",
        -   *       "domain": "googleapis.com",
        -   *       "metadata": {
        -   *         "service": "pubsub.googleapis.com"
        -   *         "parameter": "x-goog-user-ip"
        -   *       }
        -   *     }
        +   *
        +   * { "reason": "SYSTEM_PARAMETER_UNSUPPORTED",
        +   * "domain": "googleapis.com",
        +   * "metadata": {
        +   * "service": "pubsub.googleapis.com"
        +   * "parameter": "x-goog-user-ip"
        +   * }
        +   * }
            * 
        * * SYSTEM_PARAMETER_UNSUPPORTED = 26; @@ -632,15 +695,17 @@ public enum ErrorReason implements com.google.protobuf.ProtocolMessageEnum { * The request is denied because it violates Org Restriction: the requested * resource does not belong to allowed organizations specified in * "X-Goog-Allowed-Resources" header. + * * Example of an ErrorInfo when accessing a GCP resource that is restricted by * Org Restriction for "pubsub.googleapis.com" service. + * * { - * reason: "ORG_RESTRICTION_VIOLATION" - * domain: "googleapis.com" - * metadata { - * "consumer":"projects/123456" - * "service": "pubsub.googleapis.com" - * } + * reason: "ORG_RESTRICTION_VIOLATION" + * domain: "googleapis.com" + * metadata { + * "consumer":"projects/123456" + * "service": "pubsub.googleapis.com" + * } * } * * @@ -653,25 +718,159 @@ public enum ErrorReason implements com.google.protobuf.ProtocolMessageEnum { *
            * The request is denied because "X-Goog-Allowed-Resources" header is in a bad
            * format.
        +   *
            * Example of an ErrorInfo when
            * accessing "pubsub.googleapis.com" service with an invalid
            * "X-Goog-Allowed-Resources" request header.
        +   *
            * {
        -   *   reason: "ORG_RESTRICTION_HEADER_INVALID"
        -   *   domain: "googleapis.com"
        -   *   metadata {
        -   *     "consumer":"projects/123456"
        -   *     "service": "pubsub.googleapis.com"
        -   *   }
        +   * reason: "ORG_RESTRICTION_HEADER_INVALID"
        +   * domain: "googleapis.com"
        +   * metadata {
        +   * "consumer":"projects/123456"
        +   * "service": "pubsub.googleapis.com"
        +   * }
            * }
            * 
        * * ORG_RESTRICTION_HEADER_INVALID = 28; */ ORG_RESTRICTION_HEADER_INVALID(28), + /** + * + * + *
        +   * Unimplemented. Do not use.
        +   *
        +   * The request is calling a service that is not visible to the consumer.
        +   *
        +   * Example of an ErrorInfo when the consumer "projects/123" contacting
        +   * "pubsub.googleapis.com" service which is not visible to the consumer.
        +   *
        +   * { "reason": "SERVICE_NOT_VISIBLE",
        +   * "domain": "googleapis.com",
        +   * "metadata": {
        +   * "consumer": "projects/123",
        +   * "service": "pubsub.googleapis.com"
        +   * }
        +   * }
        +   *
        +   * This response indicates the "pubsub.googleapis.com" is not visible to
        +   * "projects/123" (or it may not exist).
        +   * 
        + * + * SERVICE_NOT_VISIBLE = 29; + */ + SERVICE_NOT_VISIBLE(29), + /** + * + * + *
        +   * The request is related to a project for which GCP access is suspended.
        +   *
        +   * Example of an ErrorInfo when the consumer "projects/123" fails to contact
        +   * "pubsub.googleapis.com" service because GCP access is suspended:
        +   *
        +   * { "reason": "GCP_SUSPENDED",
        +   * "domain": "googleapis.com",
        +   * "metadata": {
        +   * "consumer": "projects/123",
        +   * "service": "pubsub.googleapis.com"
        +   * }
        +   * }
        +   *
        +   * This response indicates the associated GCP account has been suspended.
        +   * 
        + * + * GCP_SUSPENDED = 30; + */ + GCP_SUSPENDED(30), + /** + * + * + *
        +   * The request violates the location policies when creating resources in
        +   * the restricted region.
        +   *
        +   * Example of an ErrorInfo when creating the Cloud Storage Bucket by
        +   * "projects/123" for service storage.googleapis.com:
        +   *
        +   * { "reason": "LOCATION_POLICY_VIOLATED",
        +   * "domain": "googleapis.com",
        +   * "metadata": {
        +   * "consumer": "projects/123",
        +   * "service": "storage.googleapis.com",
        +   * }
        +   * }
        +   *
        +   * This response indicates creating the Cloud Storage Bucket in
        +   * "locations/asia-northeast3" violates at least one location policy.
        +   * The troubleshooting guidance is provided in the Help links.
        +   * 
        + * + * LOCATION_POLICY_VIOLATED = 31; + */ + LOCATION_POLICY_VIOLATED(31), + /** + * + * + *
        +   * The request is denied because origin request header is missing.
        +   *
        +   * Example of an ErrorInfo when
        +   * accessing "pubsub.googleapis.com" service with an empty "Origin" request
        +   * header.
        +   *
        +   * {
        +   * reason: "MISSING_ORIGIN"
        +   * domain: "googleapis.com"
        +   * metadata {
        +   * "consumer":"projects/123456"
        +   * "service": "pubsub.googleapis.com"
        +   * }
        +   * }
        +   * 
        + * + * MISSING_ORIGIN = 33; + */ + MISSING_ORIGIN(33), + /** + * + * + *
        +   * The request is denied because the request contains more than one credential
        +   * type that are individually acceptable, but not together. The customer
        +   * should retry their request with only one set of credentials.
        +   *
        +   * Example of an ErrorInfo when
        +   * accessing "pubsub.googleapis.com" service with overloaded credentials.
        +   *
        +   * {
        +   * reason: "OVERLOADED_CREDENTIALS"
        +   * domain: "googleapis.com"
        +   * metadata {
        +   * "consumer":"projects/123456"
        +   * "service": "pubsub.googleapis.com"
        +   * }
        +   * }
        +   * 
        + * + * OVERLOADED_CREDENTIALS = 34; + */ + OVERLOADED_CREDENTIALS(34), UNRECOGNIZED(-1), ; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "ErrorReason"); + } + /** * * @@ -682,20 +881,24 @@ public enum ErrorReason implements com.google.protobuf.ProtocolMessageEnum { * ERROR_REASON_UNSPECIFIED = 0; */ public static final int ERROR_REASON_UNSPECIFIED_VALUE = 0; + /** * * *
            * The request is calling a disabled service for a consumer.
        +   *
            * Example of an ErrorInfo when the consumer "projects/123" contacting
            * "pubsub.googleapis.com" service which is disabled:
        -   *     { "reason": "SERVICE_DISABLED",
        -   *       "domain": "googleapis.com",
        -   *       "metadata": {
        -   *         "consumer": "projects/123",
        -   *         "service": "pubsub.googleapis.com"
        -   *       }
        -   *     }
        +   *
        +   * { "reason": "SERVICE_DISABLED",
        +   * "domain": "googleapis.com",
        +   * "metadata": {
        +   * "consumer": "projects/123",
        +   * "service": "pubsub.googleapis.com"
        +   * }
        +   * }
        +   *
            * This response indicates the "pubsub.googleapis.com" has been disabled in
            * "projects/123".
            * 
        @@ -703,27 +906,32 @@ public enum ErrorReason implements com.google.protobuf.ProtocolMessageEnum { * SERVICE_DISABLED = 1; */ public static final int SERVICE_DISABLED_VALUE = 1; + /** * * *
            * The request whose associated billing account is disabled.
        +   *
            * Example of an ErrorInfo when the consumer "projects/123" fails to contact
            * "pubsub.googleapis.com" service because the associated billing account is
            * disabled:
        -   *     { "reason": "BILLING_DISABLED",
        -   *       "domain": "googleapis.com",
        -   *       "metadata": {
        -   *         "consumer": "projects/123",
        -   *         "service": "pubsub.googleapis.com"
        -   *       }
        -   *     }
        +   *
        +   * { "reason": "BILLING_DISABLED",
        +   * "domain": "googleapis.com",
        +   * "metadata": {
        +   * "consumer": "projects/123",
        +   * "service": "pubsub.googleapis.com"
        +   * }
        +   * }
        +   *
            * This response indicates the billing account associated has been disabled.
            * 
        * * BILLING_DISABLED = 2; */ public static final int BILLING_DISABLED_VALUE = 2; + /** * * @@ -731,199 +939,227 @@ public enum ErrorReason implements com.google.protobuf.ProtocolMessageEnum { * The request is denied because the provided [API * key](https://cloud.google.com/docs/authentication/api-keys) is invalid. It * may be in a bad format, cannot be found, or has been expired). + * * Example of an ErrorInfo when the request is contacting * "storage.googleapis.com" service with an invalid API key: - * { "reason": "API_KEY_INVALID", - * "domain": "googleapis.com", - * "metadata": { - * "service": "storage.googleapis.com", - * } - * } + * + * { "reason": "API_KEY_INVALID", + * "domain": "googleapis.com", + * "metadata": { + * "service": "storage.googleapis.com", + * } + * } * * * API_KEY_INVALID = 3; */ public static final int API_KEY_INVALID_VALUE = 3; + /** * * *
            * The request is denied because it violates [API key API
            * restrictions](https://cloud.google.com/docs/authentication/api-keys#adding_api_restrictions).
        +   *
            * Example of an ErrorInfo when the consumer "projects/123" fails to call the
            * "storage.googleapis.com" service because this service is restricted in the
            * API key:
        -   *     { "reason": "API_KEY_SERVICE_BLOCKED",
        -   *       "domain": "googleapis.com",
        -   *       "metadata": {
        -   *         "consumer": "projects/123",
        -   *         "service": "storage.googleapis.com"
        -   *       }
        -   *     }
        +   *
        +   * { "reason": "API_KEY_SERVICE_BLOCKED",
        +   * "domain": "googleapis.com",
        +   * "metadata": {
        +   * "consumer": "projects/123",
        +   * "service": "storage.googleapis.com"
        +   * }
        +   * }
            * 
        * * API_KEY_SERVICE_BLOCKED = 4; */ public static final int API_KEY_SERVICE_BLOCKED_VALUE = 4; + /** * * *
            * The request is denied because it violates [API key HTTP
            * restrictions](https://cloud.google.com/docs/authentication/api-keys#adding_http_restrictions).
        +   *
            * Example of an ErrorInfo when the consumer "projects/123" fails to call
            * "storage.googleapis.com" service because the http referrer of the request
            * violates API key HTTP restrictions:
        -   *     { "reason": "API_KEY_HTTP_REFERRER_BLOCKED",
        -   *       "domain": "googleapis.com",
        -   *       "metadata": {
        -   *         "consumer": "projects/123",
        -   *         "service": "storage.googleapis.com",
        -   *       }
        -   *     }
        +   *
        +   * { "reason": "API_KEY_HTTP_REFERRER_BLOCKED",
        +   * "domain": "googleapis.com",
        +   * "metadata": {
        +   * "consumer": "projects/123",
        +   * "service": "storage.googleapis.com",
        +   * }
        +   * }
            * 
        * * API_KEY_HTTP_REFERRER_BLOCKED = 7; */ public static final int API_KEY_HTTP_REFERRER_BLOCKED_VALUE = 7; + /** * * *
            * The request is denied because it violates [API key IP address
            * restrictions](https://cloud.google.com/docs/authentication/api-keys#adding_application_restrictions).
        +   *
            * Example of an ErrorInfo when the consumer "projects/123" fails to call
            * "storage.googleapis.com" service because the caller IP of the request
            * violates API key IP address restrictions:
        -   *     { "reason": "API_KEY_IP_ADDRESS_BLOCKED",
        -   *       "domain": "googleapis.com",
        -   *       "metadata": {
        -   *         "consumer": "projects/123",
        -   *         "service": "storage.googleapis.com",
        -   *       }
        -   *     }
        +   *
        +   * { "reason": "API_KEY_IP_ADDRESS_BLOCKED",
        +   * "domain": "googleapis.com",
        +   * "metadata": {
        +   * "consumer": "projects/123",
        +   * "service": "storage.googleapis.com",
        +   * }
        +   * }
            * 
        * * API_KEY_IP_ADDRESS_BLOCKED = 8; */ public static final int API_KEY_IP_ADDRESS_BLOCKED_VALUE = 8; + /** * * *
            * The request is denied because it violates [API key Android application
            * restrictions](https://cloud.google.com/docs/authentication/api-keys#adding_application_restrictions).
        +   *
            * Example of an ErrorInfo when the consumer "projects/123" fails to call
            * "storage.googleapis.com" service because the request from the Android apps
            * violates the API key Android application restrictions:
        -   *     { "reason": "API_KEY_ANDROID_APP_BLOCKED",
        -   *       "domain": "googleapis.com",
        -   *       "metadata": {
        -   *         "consumer": "projects/123",
        -   *         "service": "storage.googleapis.com"
        -   *       }
        -   *     }
        +   *
        +   * { "reason": "API_KEY_ANDROID_APP_BLOCKED",
        +   * "domain": "googleapis.com",
        +   * "metadata": {
        +   * "consumer": "projects/123",
        +   * "service": "storage.googleapis.com"
        +   * }
        +   * }
            * 
        * * API_KEY_ANDROID_APP_BLOCKED = 9; */ public static final int API_KEY_ANDROID_APP_BLOCKED_VALUE = 9; + /** * * *
            * The request is denied because it violates [API key iOS application
            * restrictions](https://cloud.google.com/docs/authentication/api-keys#adding_application_restrictions).
        +   *
            * Example of an ErrorInfo when the consumer "projects/123" fails to call
            * "storage.googleapis.com" service because the request from the iOS apps
            * violates the API key iOS application restrictions:
        -   *     { "reason": "API_KEY_IOS_APP_BLOCKED",
        -   *       "domain": "googleapis.com",
        -   *       "metadata": {
        -   *         "consumer": "projects/123",
        -   *         "service": "storage.googleapis.com"
        -   *       }
        -   *     }
        +   *
        +   * { "reason": "API_KEY_IOS_APP_BLOCKED",
        +   * "domain": "googleapis.com",
        +   * "metadata": {
        +   * "consumer": "projects/123",
        +   * "service": "storage.googleapis.com"
        +   * }
        +   * }
            * 
        * * API_KEY_IOS_APP_BLOCKED = 13; */ public static final int API_KEY_IOS_APP_BLOCKED_VALUE = 13; + /** * * *
            * The request is denied because there is not enough rate quota for the
            * consumer.
        +   *
            * Example of an ErrorInfo when the consumer "projects/123" fails to contact
            * "pubsub.googleapis.com" service because consumer's rate quota usage has
            * reached the maximum value set for the quota limit
            * "ReadsPerMinutePerProject" on the quota metric
            * "pubsub.googleapis.com/read_requests":
        -   *     { "reason": "RATE_LIMIT_EXCEEDED",
        -   *       "domain": "googleapis.com",
        -   *       "metadata": {
        -   *         "consumer": "projects/123",
        -   *         "service": "pubsub.googleapis.com",
        -   *         "quota_metric": "pubsub.googleapis.com/read_requests",
        -   *         "quota_limit": "ReadsPerMinutePerProject"
        -   *       }
        -   *     }
        +   *
        +   * { "reason": "RATE_LIMIT_EXCEEDED",
        +   * "domain": "googleapis.com",
        +   * "metadata": {
        +   * "consumer": "projects/123",
        +   * "service": "pubsub.googleapis.com",
        +   * "quota_metric": "pubsub.googleapis.com/read_requests",
        +   * "quota_limit": "ReadsPerMinutePerProject"
        +   * }
        +   * }
        +   *
            * Example of an ErrorInfo when the consumer "projects/123" checks quota on
            * the service "dataflow.googleapis.com" and hits the organization quota
            * limit "DefaultRequestsPerMinutePerOrganization" on the metric
            * "dataflow.googleapis.com/default_requests".
        -   *     { "reason": "RATE_LIMIT_EXCEEDED",
        -   *       "domain": "googleapis.com",
        -   *       "metadata": {
        -   *         "consumer": "projects/123",
        -   *         "service": "dataflow.googleapis.com",
        -   *         "quota_metric": "dataflow.googleapis.com/default_requests",
        -   *         "quota_limit": "DefaultRequestsPerMinutePerOrganization"
        -   *       }
        -   *     }
        +   *
        +   * { "reason": "RATE_LIMIT_EXCEEDED",
        +   * "domain": "googleapis.com",
        +   * "metadata": {
        +   * "consumer": "projects/123",
        +   * "service": "dataflow.googleapis.com",
        +   * "quota_metric": "dataflow.googleapis.com/default_requests",
        +   * "quota_limit": "DefaultRequestsPerMinutePerOrganization"
        +   * }
        +   * }
            * 
        * * RATE_LIMIT_EXCEEDED = 5; */ public static final int RATE_LIMIT_EXCEEDED_VALUE = 5; + /** * * *
            * The request is denied because there is not enough resource quota for the
            * consumer.
        +   *
            * Example of an ErrorInfo when the consumer "projects/123" fails to contact
            * "compute.googleapis.com" service because consumer's resource quota usage
            * has reached the maximum value set for the quota limit "VMsPerProject"
            * on the quota metric "compute.googleapis.com/vms":
        -   *     { "reason": "RESOURCE_QUOTA_EXCEEDED",
        -   *       "domain": "googleapis.com",
        -   *       "metadata": {
        -   *         "consumer": "projects/123",
        -   *         "service": "compute.googleapis.com",
        -   *         "quota_metric": "compute.googleapis.com/vms",
        -   *         "quota_limit": "VMsPerProject"
        -   *       }
        -   *     }
        +   *
        +   * { "reason": "RESOURCE_QUOTA_EXCEEDED",
        +   * "domain": "googleapis.com",
        +   * "metadata": {
        +   * "consumer": "projects/123",
        +   * "service": "compute.googleapis.com",
        +   * "quota_metric": "compute.googleapis.com/vms",
        +   * "quota_limit": "VMsPerProject"
        +   * }
        +   * }
        +   *
            * Example of an ErrorInfo when the consumer "projects/123" checks resource
            * quota on the service "dataflow.googleapis.com" and hits the organization
            * quota limit "jobs-per-organization" on the metric
            * "dataflow.googleapis.com/job_count".
        -   *     { "reason": "RESOURCE_QUOTA_EXCEEDED",
        -   *       "domain": "googleapis.com",
        -   *       "metadata": {
        -   *         "consumer": "projects/123",
        -   *         "service": "dataflow.googleapis.com",
        -   *         "quota_metric": "dataflow.googleapis.com/job_count",
        -   *         "quota_limit": "jobs-per-organization"
        -   *       }
        -   *     }
        +   *
        +   * { "reason": "RESOURCE_QUOTA_EXCEEDED",
        +   * "domain": "googleapis.com",
        +   * "metadata": {
        +   * "consumer": "projects/123",
        +   * "service": "dataflow.googleapis.com",
        +   * "quota_metric": "dataflow.googleapis.com/job_count",
        +   * "quota_limit": "jobs-per-organization"
        +   * }
        +   * }
            * 
        * * RESOURCE_QUOTA_EXCEEDED = 6; */ public static final int RESOURCE_QUOTA_EXCEEDED_VALUE = 6; + /** * * @@ -931,17 +1167,20 @@ public enum ErrorReason implements com.google.protobuf.ProtocolMessageEnum { * The request whose associated billing account address is in a tax restricted * location, violates the local tax restrictions when creating resources in * the restricted region. + * * Example of an ErrorInfo when creating the Cloud Storage Bucket in the * container "projects/123" under a tax restricted region * "locations/asia-northeast3": - * { "reason": "LOCATION_TAX_POLICY_VIOLATED", - * "domain": "googleapis.com", - * "metadata": { - * "consumer": "projects/123", - * "service": "storage.googleapis.com", - * "location": "locations/asia-northeast3" - * } - * } + * + * { "reason": "LOCATION_TAX_POLICY_VIOLATED", + * "domain": "googleapis.com", + * "metadata": { + * "consumer": "projects/123", + * "service": "storage.googleapis.com", + * "location": "locations/asia-northeast3" + * } + * } + * * This response indicates creating the Cloud Storage Bucket in * "locations/asia-northeast3" violates the location tax restriction. * @@ -949,6 +1188,7 @@ public enum ErrorReason implements com.google.protobuf.ProtocolMessageEnum { * LOCATION_TAX_POLICY_VIOLATED = 10; */ public static final int LOCATION_TAX_POLICY_VIOLATED_VALUE = 10; + /** * * @@ -957,20 +1197,23 @@ public enum ErrorReason implements com.google.protobuf.ProtocolMessageEnum { * on the user project "projects/123" or the user project is invalid. For more * information, check the [userProject System * Parameters](https://cloud.google.com/apis/docs/system-parameters). + * * Example of an ErrorInfo when the caller is calling Cloud Storage service * with insufficient permissions on the user project: - * { "reason": "USER_PROJECT_DENIED", - * "domain": "googleapis.com", - * "metadata": { - * "consumer": "projects/123", - * "service": "storage.googleapis.com" - * } - * } + * + * { "reason": "USER_PROJECT_DENIED", + * "domain": "googleapis.com", + * "metadata": { + * "consumer": "projects/123", + * "service": "storage.googleapis.com" + * } + * } * * * USER_PROJECT_DENIED = 11; */ public static final int USER_PROJECT_DENIED_VALUE = 11; + /** * * @@ -979,40 +1222,46 @@ public enum ErrorReason implements com.google.protobuf.ProtocolMessageEnum { * to Terms of Service(Tos) violations. Check [Project suspension * guidelines](https://cloud.google.com/resource-manager/docs/project-suspension-guidelines) * for more information. + * * Example of an ErrorInfo when calling Cloud Storage service with the * suspended consumer "projects/123": - * { "reason": "CONSUMER_SUSPENDED", - * "domain": "googleapis.com", - * "metadata": { - * "consumer": "projects/123", - * "service": "storage.googleapis.com" - * } - * } + * + * { "reason": "CONSUMER_SUSPENDED", + * "domain": "googleapis.com", + * "metadata": { + * "consumer": "projects/123", + * "service": "storage.googleapis.com" + * } + * } * * * CONSUMER_SUSPENDED = 12; */ public static final int CONSUMER_SUSPENDED_VALUE = 12; + /** * * *
            * The request is denied because the associated consumer is invalid. It may be
            * in a bad format, cannot be found, or have been deleted.
        +   *
            * Example of an ErrorInfo when calling Cloud Storage service with the
            * invalid consumer "projects/123":
        -   *     { "reason": "CONSUMER_INVALID",
        -   *       "domain": "googleapis.com",
        -   *       "metadata": {
        -   *         "consumer": "projects/123",
        -   *         "service": "storage.googleapis.com"
        -   *       }
        -   *     }
        +   *
        +   * { "reason": "CONSUMER_INVALID",
        +   * "domain": "googleapis.com",
        +   * "metadata": {
        +   * "consumer": "projects/123",
        +   * "service": "storage.googleapis.com"
        +   * }
        +   * }
            * 
        * * CONSUMER_INVALID = 14; */ public static final int CONSUMER_INVALID_VALUE = 14; + /** * * @@ -1023,41 +1272,47 @@ public enum ErrorReason implements com.google.protobuf.ProtocolMessageEnum { * to search the audit log for a request rejected by VPC Service Controls. For * more information, please refer [VPC Service Controls * Troubleshooting](https://cloud.google.com/vpc-service-controls/docs/troubleshooting#unique-id) + * * Example of an ErrorInfo when the consumer "projects/123" fails to call * Cloud Storage service because the request is prohibited by the VPC Service * Controls. - * { "reason": "SECURITY_POLICY_VIOLATED", - * "domain": "googleapis.com", - * "metadata": { - * "uid": "123456789abcde", - * "consumer": "projects/123", - * "service": "storage.googleapis.com" - * } - * } + * + * { "reason": "SECURITY_POLICY_VIOLATED", + * "domain": "googleapis.com", + * "metadata": { + * "uid": "123456789abcde", + * "consumer": "projects/123", + * "service": "storage.googleapis.com" + * } + * } * * * SECURITY_POLICY_VIOLATED = 15; */ public static final int SECURITY_POLICY_VIOLATED_VALUE = 15; + /** * * *
            * The request is denied because the provided access token has expired.
        +   *
            * Example of an ErrorInfo when the request is calling Cloud Storage service
            * with an expired access token:
        -   *     { "reason": "ACCESS_TOKEN_EXPIRED",
        -   *       "domain": "googleapis.com",
        -   *       "metadata": {
        -   *         "service": "storage.googleapis.com",
        -   *         "method": "google.storage.v1.Storage.GetObject"
        -   *       }
        -   *     }
        +   *
        +   * { "reason": "ACCESS_TOKEN_EXPIRED",
        +   * "domain": "googleapis.com",
        +   * "metadata": {
        +   * "service": "storage.googleapis.com",
        +   * "method": "google.storage.v1.Storage.GetObject"
        +   * }
        +   * }
            * 
        * * ACCESS_TOKEN_EXPIRED = 16; */ public static final int ACCESS_TOKEN_EXPIRED_VALUE = 16; + /** * * @@ -1068,20 +1323,23 @@ public enum ErrorReason implements com.google.protobuf.ProtocolMessageEnum { * APIs](https://developers.google.com/identity/protocols/oauth2/scopes) for * the list of the OAuth 2.0 scopes that you might need to request to access * the API. + * * Example of an ErrorInfo when the request is calling Cloud Storage service * with an access token that is missing required scopes: - * { "reason": "ACCESS_TOKEN_SCOPE_INSUFFICIENT", - * "domain": "googleapis.com", - * "metadata": { - * "service": "storage.googleapis.com", - * "method": "google.storage.v1.Storage.GetObject" - * } - * } + * + * { "reason": "ACCESS_TOKEN_SCOPE_INSUFFICIENT", + * "domain": "googleapis.com", + * "metadata": { + * "service": "storage.googleapis.com", + * "method": "google.storage.v1.Storage.GetObject" + * } + * } * * * ACCESS_TOKEN_SCOPE_INSUFFICIENT = 17; */ public static final int ACCESS_TOKEN_SCOPE_INSUFFICIENT_VALUE = 17; + /** * * @@ -1089,45 +1347,52 @@ public enum ErrorReason implements com.google.protobuf.ProtocolMessageEnum { * The request is denied because the account associated with the provided * access token is in an invalid state, such as disabled or deleted. * For more information, see https://cloud.google.com/docs/authentication. + * * Warning: For privacy reasons, the server may not be able to disclose the * email address for some accounts. The client MUST NOT depend on the * availability of the `email` attribute. + * * Example of an ErrorInfo when the request is to the Cloud Storage API with * an access token that is associated with a disabled or deleted [service * account](http://cloud/iam/docs/service-accounts): - * { "reason": "ACCOUNT_STATE_INVALID", - * "domain": "googleapis.com", - * "metadata": { - * "service": "storage.googleapis.com", - * "method": "google.storage.v1.Storage.GetObject", - * "email": "user@123.iam.gserviceaccount.com" - * } - * } + * + * { "reason": "ACCOUNT_STATE_INVALID", + * "domain": "googleapis.com", + * "metadata": { + * "service": "storage.googleapis.com", + * "method": "google.storage.v1.Storage.GetObject", + * "email": "user@123.iam.gserviceaccount.com" + * } + * } * * * ACCOUNT_STATE_INVALID = 18; */ public static final int ACCOUNT_STATE_INVALID_VALUE = 18; + /** * * *
            * The request is denied because the type of the provided access token is not
            * supported by the API being called.
        +   *
            * Example of an ErrorInfo when the request is to the Cloud Storage API with
            * an unsupported token type.
        -   *     { "reason": "ACCESS_TOKEN_TYPE_UNSUPPORTED",
        -   *       "domain": "googleapis.com",
        -   *       "metadata": {
        -   *         "service": "storage.googleapis.com",
        -   *         "method": "google.storage.v1.Storage.GetObject"
        -   *       }
        -   *     }
        +   *
        +   * { "reason": "ACCESS_TOKEN_TYPE_UNSUPPORTED",
        +   * "domain": "googleapis.com",
        +   * "metadata": {
        +   * "service": "storage.googleapis.com",
        +   * "method": "google.storage.v1.Storage.GetObject"
        +   * }
        +   * }
            * 
        * * ACCESS_TOKEN_TYPE_UNSUPPORTED = 19; */ public static final int ACCESS_TOKEN_TYPE_UNSUPPORTED_VALUE = 19; + /** * * @@ -1136,20 +1401,23 @@ public enum ErrorReason implements com.google.protobuf.ProtocolMessageEnum { * credentials. For more information regarding the supported authentication * strategies for Google Cloud APIs, see * https://cloud.google.com/docs/authentication. + * * Example of an ErrorInfo when the request is to the Cloud Storage API * without any authentication credentials. - * { "reason": "CREDENTIALS_MISSING", - * "domain": "googleapis.com", - * "metadata": { - * "service": "storage.googleapis.com", - * "method": "google.storage.v1.Storage.GetObject" - * } - * } + * + * { "reason": "CREDENTIALS_MISSING", + * "domain": "googleapis.com", + * "metadata": { + * "service": "storage.googleapis.com", + * "method": "google.storage.v1.Storage.GetObject" + * } + * } * * * CREDENTIALS_MISSING = 20; */ public static final int CREDENTIALS_MISSING_VALUE = 20; + /** * * @@ -1158,64 +1426,74 @@ public enum ErrorReason implements com.google.protobuf.ProtocolMessageEnum { * which acts as the [API * consumer](https://cloud.google.com/apis/design/glossary#api_consumer) is * invalid. It may be in a bad format or empty. + * * Example of an ErrorInfo when the request is to the Cloud Functions API, * but the offered resource project in the request in a bad format which can't * perform the ListFunctions method. - * { "reason": "RESOURCE_PROJECT_INVALID", - * "domain": "googleapis.com", - * "metadata": { - * "service": "cloudfunctions.googleapis.com", - * "method": - * "google.cloud.functions.v1.CloudFunctionsService.ListFunctions" - * } - * } + * + * { "reason": "RESOURCE_PROJECT_INVALID", + * "domain": "googleapis.com", + * "metadata": { + * "service": "cloudfunctions.googleapis.com", + * "method": + * "google.cloud.functions.v1.CloudFunctionsService.ListFunctions" + * } + * } * * * RESOURCE_PROJECT_INVALID = 21; */ public static final int RESOURCE_PROJECT_INVALID_VALUE = 21; + /** * * *
            * The request is denied because the provided session cookie is missing,
            * invalid or failed to decode.
        +   *
            * Example of an ErrorInfo when the request is calling Cloud Storage service
            * with a SID cookie which can't be decoded.
        -   *     { "reason": "SESSION_COOKIE_INVALID",
        -   *       "domain": "googleapis.com",
        -   *       "metadata": {
        -   *         "service": "storage.googleapis.com",
        -   *         "method": "google.storage.v1.Storage.GetObject",
        -   *         "cookie": "SID"
        -   *       }
        -   *     }
        +   *
        +   * { "reason": "SESSION_COOKIE_INVALID",
        +   * "domain": "googleapis.com",
        +   * "metadata": {
        +   * "service": "storage.googleapis.com",
        +   * "method": "google.storage.v1.Storage.GetObject",
        +   * "cookie": "SID"
        +   * }
        +   * }
            * 
        * * SESSION_COOKIE_INVALID = 23; */ public static final int SESSION_COOKIE_INVALID_VALUE = 23; + /** * * *
            * The request is denied because the user is from a Google Workspace customer
            * that blocks their users from accessing a particular service.
        +   *
            * Example scenario: https://support.google.com/a/answer/9197205?hl=en
        +   *
            * Example of an ErrorInfo when access to Google Cloud Storage service is
            * blocked by the Google Workspace administrator:
        -   *     { "reason": "USER_BLOCKED_BY_ADMIN",
        -   *       "domain": "googleapis.com",
        -   *       "metadata": {
        -   *         "service": "storage.googleapis.com",
        -   *         "method": "google.storage.v1.Storage.GetObject",
        -   *       }
        -   *     }
        +   *
        +   * { "reason": "USER_BLOCKED_BY_ADMIN",
        +   * "domain": "googleapis.com",
        +   * "metadata": {
        +   * "service": "storage.googleapis.com",
        +   * "method": "google.storage.v1.Storage.GetObject",
        +   * }
        +   * }
            * 
        * * USER_BLOCKED_BY_ADMIN = 24; */ public static final int USER_BLOCKED_BY_ADMIN_VALUE = 24; + /** * * @@ -1224,42 +1502,49 @@ public enum ErrorReason implements com.google.protobuf.ProtocolMessageEnum { * by administrators according to the organization policy constraint. * For more information see * https://cloud.google.com/resource-manager/docs/organization-policy/restricting-services. + * * Example of an ErrorInfo when access to Google Cloud Storage service is * restricted by Resource Usage Restriction policy: - * { "reason": "RESOURCE_USAGE_RESTRICTION_VIOLATED", - * "domain": "googleapis.com", - * "metadata": { - * "consumer": "projects/project-123", - * "service": "storage.googleapis.com" - * } - * } + * + * { "reason": "RESOURCE_USAGE_RESTRICTION_VIOLATED", + * "domain": "googleapis.com", + * "metadata": { + * "consumer": "projects/project-123", + * "service": "storage.googleapis.com" + * } + * } * * * RESOURCE_USAGE_RESTRICTION_VIOLATED = 25; */ public static final int RESOURCE_USAGE_RESTRICTION_VIOLATED_VALUE = 25; + /** * * *
            * Unimplemented. Do not use.
        +   *
            * The request is denied because it contains unsupported system parameters in
            * URL query parameters or HTTP headers. For more information,
            * see https://cloud.google.com/apis/docs/system-parameters
        +   *
            * Example of an ErrorInfo when access "pubsub.googleapis.com" service with
            * a request header of "x-goog-user-ip":
        -   *     { "reason": "SYSTEM_PARAMETER_UNSUPPORTED",
        -   *       "domain": "googleapis.com",
        -   *       "metadata": {
        -   *         "service": "pubsub.googleapis.com"
        -   *         "parameter": "x-goog-user-ip"
        -   *       }
        -   *     }
        +   *
        +   * { "reason": "SYSTEM_PARAMETER_UNSUPPORTED",
        +   * "domain": "googleapis.com",
        +   * "metadata": {
        +   * "service": "pubsub.googleapis.com"
        +   * "parameter": "x-goog-user-ip"
        +   * }
        +   * }
            * 
        * * SYSTEM_PARAMETER_UNSUPPORTED = 26; */ public static final int SYSTEM_PARAMETER_UNSUPPORTED_VALUE = 26; + /** * * @@ -1267,37 +1552,42 @@ public enum ErrorReason implements com.google.protobuf.ProtocolMessageEnum { * The request is denied because it violates Org Restriction: the requested * resource does not belong to allowed organizations specified in * "X-Goog-Allowed-Resources" header. + * * Example of an ErrorInfo when accessing a GCP resource that is restricted by * Org Restriction for "pubsub.googleapis.com" service. + * * { - * reason: "ORG_RESTRICTION_VIOLATION" - * domain: "googleapis.com" - * metadata { - * "consumer":"projects/123456" - * "service": "pubsub.googleapis.com" - * } + * reason: "ORG_RESTRICTION_VIOLATION" + * domain: "googleapis.com" + * metadata { + * "consumer":"projects/123456" + * "service": "pubsub.googleapis.com" + * } * } * * * ORG_RESTRICTION_VIOLATION = 27; */ public static final int ORG_RESTRICTION_VIOLATION_VALUE = 27; + /** * * *
            * The request is denied because "X-Goog-Allowed-Resources" header is in a bad
            * format.
        +   *
            * Example of an ErrorInfo when
            * accessing "pubsub.googleapis.com" service with an invalid
            * "X-Goog-Allowed-Resources" request header.
        +   *
            * {
        -   *   reason: "ORG_RESTRICTION_HEADER_INVALID"
        -   *   domain: "googleapis.com"
        -   *   metadata {
        -   *     "consumer":"projects/123456"
        -   *     "service": "pubsub.googleapis.com"
        -   *   }
        +   * reason: "ORG_RESTRICTION_HEADER_INVALID"
        +   * domain: "googleapis.com"
        +   * metadata {
        +   * "consumer":"projects/123456"
        +   * "service": "pubsub.googleapis.com"
        +   * }
            * }
            * 
        * @@ -1305,6 +1595,133 @@ public enum ErrorReason implements com.google.protobuf.ProtocolMessageEnum { */ public static final int ORG_RESTRICTION_HEADER_INVALID_VALUE = 28; + /** + * + * + *
        +   * Unimplemented. Do not use.
        +   *
        +   * The request is calling a service that is not visible to the consumer.
        +   *
        +   * Example of an ErrorInfo when the consumer "projects/123" contacting
        +   * "pubsub.googleapis.com" service which is not visible to the consumer.
        +   *
        +   * { "reason": "SERVICE_NOT_VISIBLE",
        +   * "domain": "googleapis.com",
        +   * "metadata": {
        +   * "consumer": "projects/123",
        +   * "service": "pubsub.googleapis.com"
        +   * }
        +   * }
        +   *
        +   * This response indicates the "pubsub.googleapis.com" is not visible to
        +   * "projects/123" (or it may not exist).
        +   * 
        + * + * SERVICE_NOT_VISIBLE = 29; + */ + public static final int SERVICE_NOT_VISIBLE_VALUE = 29; + + /** + * + * + *
        +   * The request is related to a project for which GCP access is suspended.
        +   *
        +   * Example of an ErrorInfo when the consumer "projects/123" fails to contact
        +   * "pubsub.googleapis.com" service because GCP access is suspended:
        +   *
        +   * { "reason": "GCP_SUSPENDED",
        +   * "domain": "googleapis.com",
        +   * "metadata": {
        +   * "consumer": "projects/123",
        +   * "service": "pubsub.googleapis.com"
        +   * }
        +   * }
        +   *
        +   * This response indicates the associated GCP account has been suspended.
        +   * 
        + * + * GCP_SUSPENDED = 30; + */ + public static final int GCP_SUSPENDED_VALUE = 30; + + /** + * + * + *
        +   * The request violates the location policies when creating resources in
        +   * the restricted region.
        +   *
        +   * Example of an ErrorInfo when creating the Cloud Storage Bucket by
        +   * "projects/123" for service storage.googleapis.com:
        +   *
        +   * { "reason": "LOCATION_POLICY_VIOLATED",
        +   * "domain": "googleapis.com",
        +   * "metadata": {
        +   * "consumer": "projects/123",
        +   * "service": "storage.googleapis.com",
        +   * }
        +   * }
        +   *
        +   * This response indicates creating the Cloud Storage Bucket in
        +   * "locations/asia-northeast3" violates at least one location policy.
        +   * The troubleshooting guidance is provided in the Help links.
        +   * 
        + * + * LOCATION_POLICY_VIOLATED = 31; + */ + public static final int LOCATION_POLICY_VIOLATED_VALUE = 31; + + /** + * + * + *
        +   * The request is denied because origin request header is missing.
        +   *
        +   * Example of an ErrorInfo when
        +   * accessing "pubsub.googleapis.com" service with an empty "Origin" request
        +   * header.
        +   *
        +   * {
        +   * reason: "MISSING_ORIGIN"
        +   * domain: "googleapis.com"
        +   * metadata {
        +   * "consumer":"projects/123456"
        +   * "service": "pubsub.googleapis.com"
        +   * }
        +   * }
        +   * 
        + * + * MISSING_ORIGIN = 33; + */ + public static final int MISSING_ORIGIN_VALUE = 33; + + /** + * + * + *
        +   * The request is denied because the request contains more than one credential
        +   * type that are individually acceptable, but not together. The customer
        +   * should retry their request with only one set of credentials.
        +   *
        +   * Example of an ErrorInfo when
        +   * accessing "pubsub.googleapis.com" service with overloaded credentials.
        +   *
        +   * {
        +   * reason: "OVERLOADED_CREDENTIALS"
        +   * domain: "googleapis.com"
        +   * metadata {
        +   * "consumer":"projects/123456"
        +   * "service": "pubsub.googleapis.com"
        +   * }
        +   * }
        +   * 
        + * + * OVERLOADED_CREDENTIALS = 34; + */ + public static final int OVERLOADED_CREDENTIALS_VALUE = 34; + public final int getNumber() { if (this == UNRECOGNIZED) { throw new java.lang.IllegalArgumentException( @@ -1385,6 +1802,16 @@ public static ErrorReason forNumber(int value) { return ORG_RESTRICTION_VIOLATION; case 28: return ORG_RESTRICTION_HEADER_INVALID; + case 29: + return SERVICE_NOT_VISIBLE; + case 30: + return GCP_SUSPENDED; + case 31: + return LOCATION_POLICY_VIOLATED; + case 33: + return MISSING_ORIGIN; + case 34: + return OVERLOADED_CREDENTIALS; default: return null; } @@ -1413,7 +1840,7 @@ public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType return getDescriptor(); } - public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + public static com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { return com.google.api.ErrorReasonProto.getDescriptor().getEnumTypes().get(0); } diff --git a/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/ErrorReasonProto.java b/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/ErrorReasonProto.java index 406d7c3554..94f39f58ba 100644 --- a/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/ErrorReasonProto.java +++ b/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/ErrorReasonProto.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,13 +14,26 @@ * limitations under the License. */ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: google/api/error_reason.proto +// Protobuf Java Version: 4.33.2 package com.google.api; -public final class ErrorReasonProto { +@com.google.protobuf.Generated +public final class ErrorReasonProto extends com.google.protobuf.GeneratedFile { private ErrorReasonProto() {} + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "ErrorReasonProto"); + } + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistryLite registry) {} public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry registry) { @@ -36,7 +49,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { static { java.lang.String[] descriptorData = { "\n\035google/api/error_reason.proto\022\ngoogle." - + "api*\300\006\n\013ErrorReason\022\034\n\030ERROR_REASON_UNSP" + + "api*\272\007\n\013ErrorReason\022\034\n\030ERROR_REASON_UNSP" + "ECIFIED\020\000\022\024\n\020SERVICE_DISABLED\020\001\022\024\n\020BILLI" + "NG_DISABLED\020\002\022\023\n\017API_KEY_INVALID\020\003\022\033\n\027AP" + "I_KEY_SERVICE_BLOCKED\020\004\022!\n\035API_KEY_HTTP_" @@ -56,14 +69,19 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + "OCKED_BY_ADMIN\020\030\022\'\n#RESOURCE_USAGE_RESTR" + "ICTION_VIOLATED\020\031\022 \n\034SYSTEM_PARAMETER_UN" + "SUPPORTED\020\032\022\035\n\031ORG_RESTRICTION_VIOLATION" - + "\020\033\022\"\n\036ORG_RESTRICTION_HEADER_INVALID\020\034Bp" - + "\n\016com.google.apiB\020ErrorReasonProtoP\001ZCgo" - + "ogle.golang.org/genproto/googleapis/api/" - + "error_reason;error_reason\242\002\004GAPIb\006proto3" + + "\020\033\022\"\n\036ORG_RESTRICTION_HEADER_INVALID\020\034\022\027" + + "\n\023SERVICE_NOT_VISIBLE\020\035\022\021\n\rGCP_SUSPENDED" + + "\020\036\022\034\n\030LOCATION_POLICY_VIOLATED\020\037\022\022\n\016MISS" + + "ING_ORIGIN\020!\022\032\n\026OVERLOADED_CREDENTIALS\020\"" + + "Bp\n\016com.google.apiB\020ErrorReasonProtoP\001ZC" + + "google.golang.org/genproto/googleapis/ap" + + "i/error_reason;error_reason\242\002\004GAPIb\006prot" + + "o3" }; descriptor = com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( descriptorData, new com.google.protobuf.Descriptors.FileDescriptor[] {}); + descriptor.resolveAllFeaturesImmutable(); } // @@protoc_insertion_point(outer_class_scope) diff --git a/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/FieldBehavior.java b/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/FieldBehavior.java index 9b2fd46279..f3df9a376e 100644 --- a/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/FieldBehavior.java +++ b/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/FieldBehavior.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,9 @@ * limitations under the License. */ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: google/api/field_behavior.proto +// Protobuf Java Version: 4.33.2 package com.google.api; @@ -26,11 +28,13 @@ * is required in requests, or given as output but ignored as input). * This **does not** change the behavior in protocol buffers itself; it only * denotes the behavior and may affect how API tooling handles the field. + * * Note: This enum **may** receive new values in the future. * * * Protobuf enum {@code google.api.FieldBehavior} */ +@com.google.protobuf.Generated public enum FieldBehavior implements com.google.protobuf.ProtocolMessageEnum { /** * @@ -129,9 +133,40 @@ public enum FieldBehavior implements com.google.protobuf.ProtocolMessageEnum { * NON_EMPTY_DEFAULT = 7; */ NON_EMPTY_DEFAULT(7), + /** + * + * + *
        +   * Denotes that the field in a resource (a message annotated with
        +   * google.api.resource) is used in the resource name to uniquely identify the
        +   * resource. For AIP-compliant APIs, this should only be applied to the
        +   * `name` field on the resource.
        +   *
        +   * This behavior should not be applied to references to other resources within
        +   * the message.
        +   *
        +   * The identifier field of resources often have different field behavior
        +   * depending on the request it is embedded in (e.g. for Create methods name
        +   * is optional and unused, while for Update methods it is required). Instead
        +   * of method-specific annotations, only `IDENTIFIER` is required.
        +   * 
        + * + * IDENTIFIER = 8; + */ + IDENTIFIER(8), UNRECOGNIZED(-1), ; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "FieldBehavior"); + } + /** * * @@ -142,6 +177,7 @@ public enum FieldBehavior implements com.google.protobuf.ProtocolMessageEnum { * FIELD_BEHAVIOR_UNSPECIFIED = 0; */ public static final int FIELD_BEHAVIOR_UNSPECIFIED_VALUE = 0; + /** * * @@ -154,6 +190,7 @@ public enum FieldBehavior implements com.google.protobuf.ProtocolMessageEnum { * OPTIONAL = 1; */ public static final int OPTIONAL_VALUE = 1; + /** * * @@ -166,6 +203,7 @@ public enum FieldBehavior implements com.google.protobuf.ProtocolMessageEnum { * REQUIRED = 2; */ public static final int REQUIRED_VALUE = 2; + /** * * @@ -179,6 +217,7 @@ public enum FieldBehavior implements com.google.protobuf.ProtocolMessageEnum { * OUTPUT_ONLY = 3; */ public static final int OUTPUT_ONLY_VALUE = 3; + /** * * @@ -191,6 +230,7 @@ public enum FieldBehavior implements com.google.protobuf.ProtocolMessageEnum { * INPUT_ONLY = 4; */ public static final int INPUT_ONLY_VALUE = 4; + /** * * @@ -203,6 +243,7 @@ public enum FieldBehavior implements com.google.protobuf.ProtocolMessageEnum { * IMMUTABLE = 5; */ public static final int IMMUTABLE_VALUE = 5; + /** * * @@ -216,6 +257,7 @@ public enum FieldBehavior implements com.google.protobuf.ProtocolMessageEnum { * UNORDERED_LIST = 6; */ public static final int UNORDERED_LIST_VALUE = 6; + /** * * @@ -230,6 +272,28 @@ public enum FieldBehavior implements com.google.protobuf.ProtocolMessageEnum { */ public static final int NON_EMPTY_DEFAULT_VALUE = 7; + /** + * + * + *
        +   * Denotes that the field in a resource (a message annotated with
        +   * google.api.resource) is used in the resource name to uniquely identify the
        +   * resource. For AIP-compliant APIs, this should only be applied to the
        +   * `name` field on the resource.
        +   *
        +   * This behavior should not be applied to references to other resources within
        +   * the message.
        +   *
        +   * The identifier field of resources often have different field behavior
        +   * depending on the request it is embedded in (e.g. for Create methods name
        +   * is optional and unused, while for Update methods it is required). Instead
        +   * of method-specific annotations, only `IDENTIFIER` is required.
        +   * 
        + * + * IDENTIFIER = 8; + */ + public static final int IDENTIFIER_VALUE = 8; + public final int getNumber() { if (this == UNRECOGNIZED) { throw new java.lang.IllegalArgumentException( @@ -270,6 +334,8 @@ public static FieldBehavior forNumber(int value) { return UNORDERED_LIST; case 7: return NON_EMPTY_DEFAULT; + case 8: + return IDENTIFIER; default: return null; } @@ -298,7 +364,7 @@ public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType return getDescriptor(); } - public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + public static com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { return com.google.api.FieldBehaviorProto.getDescriptor().getEnumTypes().get(0); } diff --git a/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/FieldBehaviorProto.java b/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/FieldBehaviorProto.java index 07ab7e51a0..ce36b26b47 100644 --- a/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/FieldBehaviorProto.java +++ b/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/FieldBehaviorProto.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,13 +14,26 @@ * limitations under the License. */ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: google/api/field_behavior.proto +// Protobuf Java Version: 4.33.2 package com.google.api; -public final class FieldBehaviorProto { +@com.google.protobuf.Generated +public final class FieldBehaviorProto extends com.google.protobuf.GeneratedFile { private FieldBehaviorProto() {} + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "FieldBehaviorProto"); + } + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistryLite registry) { registry.add(com.google.api.FieldBehaviorProto.fieldBehavior); } @@ -30,20 +43,23 @@ public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry r } public static final int FIELD_BEHAVIOR_FIELD_NUMBER = 1052; + /** * * *
            * A designation of a specific field behavior (required, output only, etc.)
            * in protobuf messages.
        +   *
            * Examples:
        -   *   string name = 1 [(google.api.field_behavior) = REQUIRED];
        -   *   State state = 1 [(google.api.field_behavior) = OUTPUT_ONLY];
        -   *   google.protobuf.Duration ttl = 1
        -   *     [(google.api.field_behavior) = INPUT_ONLY];
        -   *   google.protobuf.Timestamp expire_time = 1
        -   *     [(google.api.field_behavior) = OUTPUT_ONLY,
        -   *      (google.api.field_behavior) = IMMUTABLE];
        +   *
        +   * string name = 1 [(google.api.field_behavior) = REQUIRED];
        +   * State state = 1 [(google.api.field_behavior) = OUTPUT_ONLY];
        +   * google.protobuf.Duration ttl = 1
        +   * [(google.api.field_behavior) = INPUT_ONLY];
        +   * google.protobuf.Timestamp expire_time = 1
        +   * [(google.api.field_behavior) = OUTPUT_ONLY,
        +   * (google.api.field_behavior) = IMMUTABLE];
            * 
        * * extend .google.protobuf.FieldOptions { ... } @@ -65,16 +81,16 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { java.lang.String[] descriptorData = { "\n\037google/api/field_behavior.proto\022\ngoogl" + "e.api\032 google/protobuf/descriptor.proto*" - + "\246\001\n\rFieldBehavior\022\036\n\032FIELD_BEHAVIOR_UNSP" + + "\266\001\n\rFieldBehavior\022\036\n\032FIELD_BEHAVIOR_UNSP" + "ECIFIED\020\000\022\014\n\010OPTIONAL\020\001\022\014\n\010REQUIRED\020\002\022\017\n" + "\013OUTPUT_ONLY\020\003\022\016\n\nINPUT_ONLY\020\004\022\r\n\tIMMUTA" + "BLE\020\005\022\022\n\016UNORDERED_LIST\020\006\022\025\n\021NON_EMPTY_D" - + "EFAULT\020\007:Q\n\016field_behavior\022\035.google.prot" - + "obuf.FieldOptions\030\234\010 \003(\0162\031.google.api.Fi" - + "eldBehaviorBp\n\016com.google.apiB\022FieldBeha" - + "viorProtoP\001ZAgoogle.golang.org/genproto/" - + "googleapis/api/annotations;annotations\242\002" - + "\004GAPIb\006proto3" + + "EFAULT\020\007\022\016\n\nIDENTIFIER\020\010:U\n\016field_behavi" + + "or\022\035.google.protobuf.FieldOptions\030\234\010 \003(\016" + + "2\031.google.api.FieldBehaviorB\002\020\000Bp\n\016com.g" + + "oogle.apiB\022FieldBehaviorProtoP\001ZAgoogle." + + "golang.org/genproto/googleapis/api/annot" + + "ations;annotations\242\002\004GAPIb\006proto3" }; descriptor = com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( @@ -82,7 +98,8 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { new com.google.protobuf.Descriptors.FileDescriptor[] { com.google.protobuf.DescriptorProtos.getDescriptor(), }); - fieldBehavior.internalInit(descriptor.getExtensions().get(0)); + fieldBehavior.internalInit(descriptor.getExtension(0)); + descriptor.resolveAllFeaturesImmutable(); com.google.protobuf.DescriptorProtos.getDescriptor(); } diff --git a/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/FieldInfo.java b/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/FieldInfo.java new file mode 100644 index 0000000000..b740d5c77a --- /dev/null +++ b/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/FieldInfo.java @@ -0,0 +1,1389 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/api/field_info.proto +// Protobuf Java Version: 4.33.2 + +package com.google.api; + +/** + * + * + *
        + * Rich semantic information of an API field beyond basic typing.
        + * 
        + * + * Protobuf type {@code google.api.FieldInfo} + */ +@com.google.protobuf.Generated +public final class FieldInfo extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.api.FieldInfo) + FieldInfoOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "FieldInfo"); + } + + // Use FieldInfo.newBuilder() to construct. + private FieldInfo(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private FieldInfo() { + format_ = 0; + referencedTypes_ = java.util.Collections.emptyList(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.api.FieldInfoProto.internal_static_google_api_FieldInfo_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.api.FieldInfoProto.internal_static_google_api_FieldInfo_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.api.FieldInfo.class, com.google.api.FieldInfo.Builder.class); + } + + /** + * + * + *
        +   * The standard format of a field value. The supported formats are all backed
        +   * by either an RFC defined by the IETF or a Google-defined AIP.
        +   * 
        + * + * Protobuf enum {@code google.api.FieldInfo.Format} + */ + public enum Format implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
        +     * Default, unspecified value.
        +     * 
        + * + * FORMAT_UNSPECIFIED = 0; + */ + FORMAT_UNSPECIFIED(0), + /** + * + * + *
        +     * Universally Unique Identifier, version 4, value as defined by
        +     * https://datatracker.ietf.org/doc/html/rfc4122. The value may be
        +     * normalized to entirely lowercase letters. For example, the value
        +     * `F47AC10B-58CC-0372-8567-0E02B2C3D479` would be normalized to
        +     * `f47ac10b-58cc-0372-8567-0e02b2c3d479`.
        +     * 
        + * + * UUID4 = 1; + */ + UUID4(1), + /** + * + * + *
        +     * Internet Protocol v4 value as defined by [RFC
        +     * 791](https://datatracker.ietf.org/doc/html/rfc791). The value may be
        +     * condensed, with leading zeros in each octet stripped. For example,
        +     * `001.022.233.040` would be condensed to `1.22.233.40`.
        +     * 
        + * + * IPV4 = 2; + */ + IPV4(2), + /** + * + * + *
        +     * Internet Protocol v6 value as defined by [RFC
        +     * 2460](https://datatracker.ietf.org/doc/html/rfc2460). The value may be
        +     * normalized to entirely lowercase letters with zeros compressed, following
        +     * [RFC 5952](https://datatracker.ietf.org/doc/html/rfc5952). For example,
        +     * the value `2001:0DB8:0::0` would be normalized to `2001:db8::`.
        +     * 
        + * + * IPV6 = 3; + */ + IPV6(3), + /** + * + * + *
        +     * An IP address in either v4 or v6 format as described by the individual
        +     * values defined herein. See the comments on the IPV4 and IPV6 types for
        +     * allowed normalizations of each.
        +     * 
        + * + * IPV4_OR_IPV6 = 4; + */ + IPV4_OR_IPV6(4), + UNRECOGNIZED(-1), + ; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "Format"); + } + + /** + * + * + *
        +     * Default, unspecified value.
        +     * 
        + * + * FORMAT_UNSPECIFIED = 0; + */ + public static final int FORMAT_UNSPECIFIED_VALUE = 0; + + /** + * + * + *
        +     * Universally Unique Identifier, version 4, value as defined by
        +     * https://datatracker.ietf.org/doc/html/rfc4122. The value may be
        +     * normalized to entirely lowercase letters. For example, the value
        +     * `F47AC10B-58CC-0372-8567-0E02B2C3D479` would be normalized to
        +     * `f47ac10b-58cc-0372-8567-0e02b2c3d479`.
        +     * 
        + * + * UUID4 = 1; + */ + public static final int UUID4_VALUE = 1; + + /** + * + * + *
        +     * Internet Protocol v4 value as defined by [RFC
        +     * 791](https://datatracker.ietf.org/doc/html/rfc791). The value may be
        +     * condensed, with leading zeros in each octet stripped. For example,
        +     * `001.022.233.040` would be condensed to `1.22.233.40`.
        +     * 
        + * + * IPV4 = 2; + */ + public static final int IPV4_VALUE = 2; + + /** + * + * + *
        +     * Internet Protocol v6 value as defined by [RFC
        +     * 2460](https://datatracker.ietf.org/doc/html/rfc2460). The value may be
        +     * normalized to entirely lowercase letters with zeros compressed, following
        +     * [RFC 5952](https://datatracker.ietf.org/doc/html/rfc5952). For example,
        +     * the value `2001:0DB8:0::0` would be normalized to `2001:db8::`.
        +     * 
        + * + * IPV6 = 3; + */ + public static final int IPV6_VALUE = 3; + + /** + * + * + *
        +     * An IP address in either v4 or v6 format as described by the individual
        +     * values defined herein. See the comments on the IPV4 and IPV6 types for
        +     * allowed normalizations of each.
        +     * 
        + * + * IPV4_OR_IPV6 = 4; + */ + public static final int IPV4_OR_IPV6_VALUE = 4; + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static Format 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 Format forNumber(int value) { + switch (value) { + case 0: + return FORMAT_UNSPECIFIED; + case 1: + return UUID4; + case 2: + return IPV4; + case 3: + return IPV6; + case 4: + return IPV4_OR_IPV6; + 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 Format findValueByNumber(int number) { + return Format.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 com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.api.FieldInfo.getDescriptor().getEnumTypes().get(0); + } + + private static final Format[] VALUES = values(); + + public static Format 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 Format(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.api.FieldInfo.Format) + } + + public static final int FORMAT_FIELD_NUMBER = 1; + private int format_ = 0; + + /** + * + * + *
        +   * The standard format of a field value. This does not explicitly configure
        +   * any API consumer, just documents the API's format for the field it is
        +   * applied to.
        +   * 
        + * + * .google.api.FieldInfo.Format format = 1; + * + * @return The enum numeric value on the wire for format. + */ + @java.lang.Override + public int getFormatValue() { + return format_; + } + + /** + * + * + *
        +   * The standard format of a field value. This does not explicitly configure
        +   * any API consumer, just documents the API's format for the field it is
        +   * applied to.
        +   * 
        + * + * .google.api.FieldInfo.Format format = 1; + * + * @return The format. + */ + @java.lang.Override + public com.google.api.FieldInfo.Format getFormat() { + com.google.api.FieldInfo.Format result = com.google.api.FieldInfo.Format.forNumber(format_); + return result == null ? com.google.api.FieldInfo.Format.UNRECOGNIZED : result; + } + + public static final int REFERENCED_TYPES_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private java.util.List referencedTypes_; + + /** + * + * + *
        +   * The type(s) that the annotated, generic field may represent.
        +   *
        +   * Currently, this must only be used on fields of type `google.protobuf.Any`.
        +   * Supporting other generic types may be considered in the future.
        +   * 
        + * + * repeated .google.api.TypeReference referenced_types = 2; + */ + @java.lang.Override + public java.util.List getReferencedTypesList() { + return referencedTypes_; + } + + /** + * + * + *
        +   * The type(s) that the annotated, generic field may represent.
        +   *
        +   * Currently, this must only be used on fields of type `google.protobuf.Any`.
        +   * Supporting other generic types may be considered in the future.
        +   * 
        + * + * repeated .google.api.TypeReference referenced_types = 2; + */ + @java.lang.Override + public java.util.List + getReferencedTypesOrBuilderList() { + return referencedTypes_; + } + + /** + * + * + *
        +   * The type(s) that the annotated, generic field may represent.
        +   *
        +   * Currently, this must only be used on fields of type `google.protobuf.Any`.
        +   * Supporting other generic types may be considered in the future.
        +   * 
        + * + * repeated .google.api.TypeReference referenced_types = 2; + */ + @java.lang.Override + public int getReferencedTypesCount() { + return referencedTypes_.size(); + } + + /** + * + * + *
        +   * The type(s) that the annotated, generic field may represent.
        +   *
        +   * Currently, this must only be used on fields of type `google.protobuf.Any`.
        +   * Supporting other generic types may be considered in the future.
        +   * 
        + * + * repeated .google.api.TypeReference referenced_types = 2; + */ + @java.lang.Override + public com.google.api.TypeReference getReferencedTypes(int index) { + return referencedTypes_.get(index); + } + + /** + * + * + *
        +   * The type(s) that the annotated, generic field may represent.
        +   *
        +   * Currently, this must only be used on fields of type `google.protobuf.Any`.
        +   * Supporting other generic types may be considered in the future.
        +   * 
        + * + * repeated .google.api.TypeReference referenced_types = 2; + */ + @java.lang.Override + public com.google.api.TypeReferenceOrBuilder getReferencedTypesOrBuilder(int index) { + return referencedTypes_.get(index); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (format_ != com.google.api.FieldInfo.Format.FORMAT_UNSPECIFIED.getNumber()) { + output.writeEnum(1, format_); + } + for (int i = 0; i < referencedTypes_.size(); i++) { + output.writeMessage(2, referencedTypes_.get(i)); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (format_ != com.google.api.FieldInfo.Format.FORMAT_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(1, format_); + } + for (int i = 0; i < referencedTypes_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, referencedTypes_.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.api.FieldInfo)) { + return super.equals(obj); + } + com.google.api.FieldInfo other = (com.google.api.FieldInfo) obj; + + if (format_ != other.format_) return false; + if (!getReferencedTypesList().equals(other.getReferencedTypesList())) 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) + FORMAT_FIELD_NUMBER; + hash = (53 * hash) + format_; + if (getReferencedTypesCount() > 0) { + hash = (37 * hash) + REFERENCED_TYPES_FIELD_NUMBER; + hash = (53 * hash) + getReferencedTypesList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.api.FieldInfo parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.api.FieldInfo parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.api.FieldInfo parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.api.FieldInfo parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.api.FieldInfo parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.api.FieldInfo parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.api.FieldInfo parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.api.FieldInfo parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.api.FieldInfo parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.api.FieldInfo parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.api.FieldInfo parseFrom(com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.api.FieldInfo parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.api.FieldInfo 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
        +   * Rich semantic information of an API field beyond basic typing.
        +   * 
        + * + * Protobuf type {@code google.api.FieldInfo} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.api.FieldInfo) + com.google.api.FieldInfoOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.api.FieldInfoProto.internal_static_google_api_FieldInfo_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.api.FieldInfoProto.internal_static_google_api_FieldInfo_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.api.FieldInfo.class, com.google.api.FieldInfo.Builder.class); + } + + // Construct using com.google.api.FieldInfo.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + format_ = 0; + if (referencedTypesBuilder_ == null) { + referencedTypes_ = java.util.Collections.emptyList(); + } else { + referencedTypes_ = null; + referencedTypesBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000002); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.api.FieldInfoProto.internal_static_google_api_FieldInfo_descriptor; + } + + @java.lang.Override + public com.google.api.FieldInfo getDefaultInstanceForType() { + return com.google.api.FieldInfo.getDefaultInstance(); + } + + @java.lang.Override + public com.google.api.FieldInfo build() { + com.google.api.FieldInfo result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.api.FieldInfo buildPartial() { + com.google.api.FieldInfo result = new com.google.api.FieldInfo(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields(com.google.api.FieldInfo result) { + if (referencedTypesBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0)) { + referencedTypes_ = java.util.Collections.unmodifiableList(referencedTypes_); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.referencedTypes_ = referencedTypes_; + } else { + result.referencedTypes_ = referencedTypesBuilder_.build(); + } + } + + private void buildPartial0(com.google.api.FieldInfo result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.format_ = format_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.api.FieldInfo) { + return mergeFrom((com.google.api.FieldInfo) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.api.FieldInfo other) { + if (other == com.google.api.FieldInfo.getDefaultInstance()) return this; + if (other.format_ != 0) { + setFormatValue(other.getFormatValue()); + } + if (referencedTypesBuilder_ == null) { + if (!other.referencedTypes_.isEmpty()) { + if (referencedTypes_.isEmpty()) { + referencedTypes_ = other.referencedTypes_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureReferencedTypesIsMutable(); + referencedTypes_.addAll(other.referencedTypes_); + } + onChanged(); + } + } else { + if (!other.referencedTypes_.isEmpty()) { + if (referencedTypesBuilder_.isEmpty()) { + referencedTypesBuilder_.dispose(); + referencedTypesBuilder_ = null; + referencedTypes_ = other.referencedTypes_; + bitField0_ = (bitField0_ & ~0x00000002); + referencedTypesBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders + ? internalGetReferencedTypesFieldBuilder() + : null; + } else { + referencedTypesBuilder_.addAllMessages(other.referencedTypes_); + } + } + } + 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: + { + format_ = input.readEnum(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 18: + { + com.google.api.TypeReference m = + input.readMessage(com.google.api.TypeReference.parser(), extensionRegistry); + if (referencedTypesBuilder_ == null) { + ensureReferencedTypesIsMutable(); + referencedTypes_.add(m); + } else { + referencedTypesBuilder_.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 int format_ = 0; + + /** + * + * + *
        +     * The standard format of a field value. This does not explicitly configure
        +     * any API consumer, just documents the API's format for the field it is
        +     * applied to.
        +     * 
        + * + * .google.api.FieldInfo.Format format = 1; + * + * @return The enum numeric value on the wire for format. + */ + @java.lang.Override + public int getFormatValue() { + return format_; + } + + /** + * + * + *
        +     * The standard format of a field value. This does not explicitly configure
        +     * any API consumer, just documents the API's format for the field it is
        +     * applied to.
        +     * 
        + * + * .google.api.FieldInfo.Format format = 1; + * + * @param value The enum numeric value on the wire for format to set. + * @return This builder for chaining. + */ + public Builder setFormatValue(int value) { + format_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
        +     * The standard format of a field value. This does not explicitly configure
        +     * any API consumer, just documents the API's format for the field it is
        +     * applied to.
        +     * 
        + * + * .google.api.FieldInfo.Format format = 1; + * + * @return The format. + */ + @java.lang.Override + public com.google.api.FieldInfo.Format getFormat() { + com.google.api.FieldInfo.Format result = com.google.api.FieldInfo.Format.forNumber(format_); + return result == null ? com.google.api.FieldInfo.Format.UNRECOGNIZED : result; + } + + /** + * + * + *
        +     * The standard format of a field value. This does not explicitly configure
        +     * any API consumer, just documents the API's format for the field it is
        +     * applied to.
        +     * 
        + * + * .google.api.FieldInfo.Format format = 1; + * + * @param value The format to set. + * @return This builder for chaining. + */ + public Builder setFormat(com.google.api.FieldInfo.Format value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000001; + format_ = value.getNumber(); + onChanged(); + return this; + } + + /** + * + * + *
        +     * The standard format of a field value. This does not explicitly configure
        +     * any API consumer, just documents the API's format for the field it is
        +     * applied to.
        +     * 
        + * + * .google.api.FieldInfo.Format format = 1; + * + * @return This builder for chaining. + */ + public Builder clearFormat() { + bitField0_ = (bitField0_ & ~0x00000001); + format_ = 0; + onChanged(); + return this; + } + + private java.util.List referencedTypes_ = + java.util.Collections.emptyList(); + + private void ensureReferencedTypesIsMutable() { + if (!((bitField0_ & 0x00000002) != 0)) { + referencedTypes_ = new java.util.ArrayList(referencedTypes_); + bitField0_ |= 0x00000002; + } + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.google.api.TypeReference, + com.google.api.TypeReference.Builder, + com.google.api.TypeReferenceOrBuilder> + referencedTypesBuilder_; + + /** + * + * + *
        +     * The type(s) that the annotated, generic field may represent.
        +     *
        +     * Currently, this must only be used on fields of type `google.protobuf.Any`.
        +     * Supporting other generic types may be considered in the future.
        +     * 
        + * + * repeated .google.api.TypeReference referenced_types = 2; + */ + public java.util.List getReferencedTypesList() { + if (referencedTypesBuilder_ == null) { + return java.util.Collections.unmodifiableList(referencedTypes_); + } else { + return referencedTypesBuilder_.getMessageList(); + } + } + + /** + * + * + *
        +     * The type(s) that the annotated, generic field may represent.
        +     *
        +     * Currently, this must only be used on fields of type `google.protobuf.Any`.
        +     * Supporting other generic types may be considered in the future.
        +     * 
        + * + * repeated .google.api.TypeReference referenced_types = 2; + */ + public int getReferencedTypesCount() { + if (referencedTypesBuilder_ == null) { + return referencedTypes_.size(); + } else { + return referencedTypesBuilder_.getCount(); + } + } + + /** + * + * + *
        +     * The type(s) that the annotated, generic field may represent.
        +     *
        +     * Currently, this must only be used on fields of type `google.protobuf.Any`.
        +     * Supporting other generic types may be considered in the future.
        +     * 
        + * + * repeated .google.api.TypeReference referenced_types = 2; + */ + public com.google.api.TypeReference getReferencedTypes(int index) { + if (referencedTypesBuilder_ == null) { + return referencedTypes_.get(index); + } else { + return referencedTypesBuilder_.getMessage(index); + } + } + + /** + * + * + *
        +     * The type(s) that the annotated, generic field may represent.
        +     *
        +     * Currently, this must only be used on fields of type `google.protobuf.Any`.
        +     * Supporting other generic types may be considered in the future.
        +     * 
        + * + * repeated .google.api.TypeReference referenced_types = 2; + */ + public Builder setReferencedTypes(int index, com.google.api.TypeReference value) { + if (referencedTypesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureReferencedTypesIsMutable(); + referencedTypes_.set(index, value); + onChanged(); + } else { + referencedTypesBuilder_.setMessage(index, value); + } + return this; + } + + /** + * + * + *
        +     * The type(s) that the annotated, generic field may represent.
        +     *
        +     * Currently, this must only be used on fields of type `google.protobuf.Any`.
        +     * Supporting other generic types may be considered in the future.
        +     * 
        + * + * repeated .google.api.TypeReference referenced_types = 2; + */ + public Builder setReferencedTypes( + int index, com.google.api.TypeReference.Builder builderForValue) { + if (referencedTypesBuilder_ == null) { + ensureReferencedTypesIsMutable(); + referencedTypes_.set(index, builderForValue.build()); + onChanged(); + } else { + referencedTypesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
        +     * The type(s) that the annotated, generic field may represent.
        +     *
        +     * Currently, this must only be used on fields of type `google.protobuf.Any`.
        +     * Supporting other generic types may be considered in the future.
        +     * 
        + * + * repeated .google.api.TypeReference referenced_types = 2; + */ + public Builder addReferencedTypes(com.google.api.TypeReference value) { + if (referencedTypesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureReferencedTypesIsMutable(); + referencedTypes_.add(value); + onChanged(); + } else { + referencedTypesBuilder_.addMessage(value); + } + return this; + } + + /** + * + * + *
        +     * The type(s) that the annotated, generic field may represent.
        +     *
        +     * Currently, this must only be used on fields of type `google.protobuf.Any`.
        +     * Supporting other generic types may be considered in the future.
        +     * 
        + * + * repeated .google.api.TypeReference referenced_types = 2; + */ + public Builder addReferencedTypes(int index, com.google.api.TypeReference value) { + if (referencedTypesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureReferencedTypesIsMutable(); + referencedTypes_.add(index, value); + onChanged(); + } else { + referencedTypesBuilder_.addMessage(index, value); + } + return this; + } + + /** + * + * + *
        +     * The type(s) that the annotated, generic field may represent.
        +     *
        +     * Currently, this must only be used on fields of type `google.protobuf.Any`.
        +     * Supporting other generic types may be considered in the future.
        +     * 
        + * + * repeated .google.api.TypeReference referenced_types = 2; + */ + public Builder addReferencedTypes(com.google.api.TypeReference.Builder builderForValue) { + if (referencedTypesBuilder_ == null) { + ensureReferencedTypesIsMutable(); + referencedTypes_.add(builderForValue.build()); + onChanged(); + } else { + referencedTypesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + + /** + * + * + *
        +     * The type(s) that the annotated, generic field may represent.
        +     *
        +     * Currently, this must only be used on fields of type `google.protobuf.Any`.
        +     * Supporting other generic types may be considered in the future.
        +     * 
        + * + * repeated .google.api.TypeReference referenced_types = 2; + */ + public Builder addReferencedTypes( + int index, com.google.api.TypeReference.Builder builderForValue) { + if (referencedTypesBuilder_ == null) { + ensureReferencedTypesIsMutable(); + referencedTypes_.add(index, builderForValue.build()); + onChanged(); + } else { + referencedTypesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
        +     * The type(s) that the annotated, generic field may represent.
        +     *
        +     * Currently, this must only be used on fields of type `google.protobuf.Any`.
        +     * Supporting other generic types may be considered in the future.
        +     * 
        + * + * repeated .google.api.TypeReference referenced_types = 2; + */ + public Builder addAllReferencedTypes( + java.lang.Iterable values) { + if (referencedTypesBuilder_ == null) { + ensureReferencedTypesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, referencedTypes_); + onChanged(); + } else { + referencedTypesBuilder_.addAllMessages(values); + } + return this; + } + + /** + * + * + *
        +     * The type(s) that the annotated, generic field may represent.
        +     *
        +     * Currently, this must only be used on fields of type `google.protobuf.Any`.
        +     * Supporting other generic types may be considered in the future.
        +     * 
        + * + * repeated .google.api.TypeReference referenced_types = 2; + */ + public Builder clearReferencedTypes() { + if (referencedTypesBuilder_ == null) { + referencedTypes_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + } else { + referencedTypesBuilder_.clear(); + } + return this; + } + + /** + * + * + *
        +     * The type(s) that the annotated, generic field may represent.
        +     *
        +     * Currently, this must only be used on fields of type `google.protobuf.Any`.
        +     * Supporting other generic types may be considered in the future.
        +     * 
        + * + * repeated .google.api.TypeReference referenced_types = 2; + */ + public Builder removeReferencedTypes(int index) { + if (referencedTypesBuilder_ == null) { + ensureReferencedTypesIsMutable(); + referencedTypes_.remove(index); + onChanged(); + } else { + referencedTypesBuilder_.remove(index); + } + return this; + } + + /** + * + * + *
        +     * The type(s) that the annotated, generic field may represent.
        +     *
        +     * Currently, this must only be used on fields of type `google.protobuf.Any`.
        +     * Supporting other generic types may be considered in the future.
        +     * 
        + * + * repeated .google.api.TypeReference referenced_types = 2; + */ + public com.google.api.TypeReference.Builder getReferencedTypesBuilder(int index) { + return internalGetReferencedTypesFieldBuilder().getBuilder(index); + } + + /** + * + * + *
        +     * The type(s) that the annotated, generic field may represent.
        +     *
        +     * Currently, this must only be used on fields of type `google.protobuf.Any`.
        +     * Supporting other generic types may be considered in the future.
        +     * 
        + * + * repeated .google.api.TypeReference referenced_types = 2; + */ + public com.google.api.TypeReferenceOrBuilder getReferencedTypesOrBuilder(int index) { + if (referencedTypesBuilder_ == null) { + return referencedTypes_.get(index); + } else { + return referencedTypesBuilder_.getMessageOrBuilder(index); + } + } + + /** + * + * + *
        +     * The type(s) that the annotated, generic field may represent.
        +     *
        +     * Currently, this must only be used on fields of type `google.protobuf.Any`.
        +     * Supporting other generic types may be considered in the future.
        +     * 
        + * + * repeated .google.api.TypeReference referenced_types = 2; + */ + public java.util.List + getReferencedTypesOrBuilderList() { + if (referencedTypesBuilder_ != null) { + return referencedTypesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(referencedTypes_); + } + } + + /** + * + * + *
        +     * The type(s) that the annotated, generic field may represent.
        +     *
        +     * Currently, this must only be used on fields of type `google.protobuf.Any`.
        +     * Supporting other generic types may be considered in the future.
        +     * 
        + * + * repeated .google.api.TypeReference referenced_types = 2; + */ + public com.google.api.TypeReference.Builder addReferencedTypesBuilder() { + return internalGetReferencedTypesFieldBuilder() + .addBuilder(com.google.api.TypeReference.getDefaultInstance()); + } + + /** + * + * + *
        +     * The type(s) that the annotated, generic field may represent.
        +     *
        +     * Currently, this must only be used on fields of type `google.protobuf.Any`.
        +     * Supporting other generic types may be considered in the future.
        +     * 
        + * + * repeated .google.api.TypeReference referenced_types = 2; + */ + public com.google.api.TypeReference.Builder addReferencedTypesBuilder(int index) { + return internalGetReferencedTypesFieldBuilder() + .addBuilder(index, com.google.api.TypeReference.getDefaultInstance()); + } + + /** + * + * + *
        +     * The type(s) that the annotated, generic field may represent.
        +     *
        +     * Currently, this must only be used on fields of type `google.protobuf.Any`.
        +     * Supporting other generic types may be considered in the future.
        +     * 
        + * + * repeated .google.api.TypeReference referenced_types = 2; + */ + public java.util.List getReferencedTypesBuilderList() { + return internalGetReferencedTypesFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.google.api.TypeReference, + com.google.api.TypeReference.Builder, + com.google.api.TypeReferenceOrBuilder> + internalGetReferencedTypesFieldBuilder() { + if (referencedTypesBuilder_ == null) { + referencedTypesBuilder_ = + new com.google.protobuf.RepeatedFieldBuilder< + com.google.api.TypeReference, + com.google.api.TypeReference.Builder, + com.google.api.TypeReferenceOrBuilder>( + referencedTypes_, + ((bitField0_ & 0x00000002) != 0), + getParentForChildren(), + isClean()); + referencedTypes_ = null; + } + return referencedTypesBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.api.FieldInfo) + } + + // @@protoc_insertion_point(class_scope:google.api.FieldInfo) + private static final com.google.api.FieldInfo DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.api.FieldInfo(); + } + + public static com.google.api.FieldInfo getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public FieldInfo 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.api.FieldInfo getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/FieldInfoOrBuilder.java b/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/FieldInfoOrBuilder.java new file mode 100644 index 0000000000..acaf9a7b03 --- /dev/null +++ b/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/FieldInfoOrBuilder.java @@ -0,0 +1,128 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/api/field_info.proto +// Protobuf Java Version: 4.33.2 + +package com.google.api; + +@com.google.protobuf.Generated +public interface FieldInfoOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.api.FieldInfo) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
        +   * The standard format of a field value. This does not explicitly configure
        +   * any API consumer, just documents the API's format for the field it is
        +   * applied to.
        +   * 
        + * + * .google.api.FieldInfo.Format format = 1; + * + * @return The enum numeric value on the wire for format. + */ + int getFormatValue(); + + /** + * + * + *
        +   * The standard format of a field value. This does not explicitly configure
        +   * any API consumer, just documents the API's format for the field it is
        +   * applied to.
        +   * 
        + * + * .google.api.FieldInfo.Format format = 1; + * + * @return The format. + */ + com.google.api.FieldInfo.Format getFormat(); + + /** + * + * + *
        +   * The type(s) that the annotated, generic field may represent.
        +   *
        +   * Currently, this must only be used on fields of type `google.protobuf.Any`.
        +   * Supporting other generic types may be considered in the future.
        +   * 
        + * + * repeated .google.api.TypeReference referenced_types = 2; + */ + java.util.List getReferencedTypesList(); + + /** + * + * + *
        +   * The type(s) that the annotated, generic field may represent.
        +   *
        +   * Currently, this must only be used on fields of type `google.protobuf.Any`.
        +   * Supporting other generic types may be considered in the future.
        +   * 
        + * + * repeated .google.api.TypeReference referenced_types = 2; + */ + com.google.api.TypeReference getReferencedTypes(int index); + + /** + * + * + *
        +   * The type(s) that the annotated, generic field may represent.
        +   *
        +   * Currently, this must only be used on fields of type `google.protobuf.Any`.
        +   * Supporting other generic types may be considered in the future.
        +   * 
        + * + * repeated .google.api.TypeReference referenced_types = 2; + */ + int getReferencedTypesCount(); + + /** + * + * + *
        +   * The type(s) that the annotated, generic field may represent.
        +   *
        +   * Currently, this must only be used on fields of type `google.protobuf.Any`.
        +   * Supporting other generic types may be considered in the future.
        +   * 
        + * + * repeated .google.api.TypeReference referenced_types = 2; + */ + java.util.List getReferencedTypesOrBuilderList(); + + /** + * + * + *
        +   * The type(s) that the annotated, generic field may represent.
        +   *
        +   * Currently, this must only be used on fields of type `google.protobuf.Any`.
        +   * Supporting other generic types may be considered in the future.
        +   * 
        + * + * repeated .google.api.TypeReference referenced_types = 2; + */ + com.google.api.TypeReferenceOrBuilder getReferencedTypesOrBuilder(int index); +} diff --git a/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/FieldInfoProto.java b/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/FieldInfoProto.java new file mode 100644 index 0000000000..11ee6cd6c1 --- /dev/null +++ b/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/FieldInfoProto.java @@ -0,0 +1,135 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/api/field_info.proto +// Protobuf Java Version: 4.33.2 + +package com.google.api; + +@com.google.protobuf.Generated +public final class FieldInfoProto extends com.google.protobuf.GeneratedFile { + private FieldInfoProto() {} + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "FieldInfoProto"); + } + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistryLite registry) { + registry.add(com.google.api.FieldInfoProto.fieldInfo); + } + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions((com.google.protobuf.ExtensionRegistryLite) registry); + } + + public static final int FIELD_INFO_FIELD_NUMBER = 291403980; + + /** + * + * + *
        +   * Rich semantic descriptor of an API field beyond the basic typing.
        +   *
        +   * Examples:
        +   *
        +   * string request_id = 1 [(google.api.field_info).format = UUID4];
        +   * string old_ip_address = 2 [(google.api.field_info).format = IPV4];
        +   * string new_ip_address = 3 [(google.api.field_info).format = IPV6];
        +   * string actual_ip_address = 4 [
        +   * (google.api.field_info).format = IPV4_OR_IPV6
        +   * ];
        +   * google.protobuf.Any generic_field = 5 [
        +   * (google.api.field_info).referenced_types = {type_name: "ActualType"},
        +   * (google.api.field_info).referenced_types = {type_name: "OtherType"},
        +   * ];
        +   * google.protobuf.Any generic_user_input = 5 [
        +   * (google.api.field_info).referenced_types = {type_name: "*"},
        +   * ];
        +   * 
        + * + * extend .google.protobuf.FieldOptions { ... } + */ + public static final com.google.protobuf.GeneratedMessage.GeneratedExtension< + com.google.protobuf.DescriptorProtos.FieldOptions, com.google.api.FieldInfo> + fieldInfo = + com.google.protobuf.GeneratedMessage.newFileScopedGeneratedExtension( + com.google.api.FieldInfo.class, com.google.api.FieldInfo.getDefaultInstance()); + + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_api_FieldInfo_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_api_FieldInfo_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_api_TypeReference_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_api_TypeReference_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\033google/api/field_info.proto\022\ngoogle.ap" + + "i\032 google/protobuf/descriptor.proto\"\301\001\n\t" + + "FieldInfo\022,\n\006format\030\001 \001(\0162\034.google.api.F" + + "ieldInfo.Format\0223\n\020referenced_types\030\002 \003(" + + "\0132\031.google.api.TypeReference\"Q\n\006Format\022\026" + + "\n\022FORMAT_UNSPECIFIED\020\000\022\t\n\005UUID4\020\001\022\010\n\004IPV" + + "4\020\002\022\010\n\004IPV6\020\003\022\020\n\014IPV4_OR_IPV6\020\004\"\"\n\rTypeR" + + "eference\022\021\n\ttype_name\030\001 \001(\t:L\n\nfield_inf" + + "o\022\035.google.protobuf.FieldOptions\030\314\361\371\212\001 \001" + + "(\0132\025.google.api.FieldInfoBl\n\016com.google." + + "apiB\016FieldInfoProtoP\001ZAgoogle.golang.org" + + "/genproto/googleapis/api/annotations;ann" + + "otations\242\002\004GAPIb\006proto3" + }; + descriptor = + com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( + descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + com.google.protobuf.DescriptorProtos.getDescriptor(), + }); + internal_static_google_api_FieldInfo_descriptor = getDescriptor().getMessageType(0); + internal_static_google_api_FieldInfo_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_api_FieldInfo_descriptor, + new java.lang.String[] { + "Format", "ReferencedTypes", + }); + internal_static_google_api_TypeReference_descriptor = getDescriptor().getMessageType(1); + internal_static_google_api_TypeReference_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_api_TypeReference_descriptor, + new java.lang.String[] { + "TypeName", + }); + fieldInfo.internalInit(descriptor.getExtension(0)); + descriptor.resolveAllFeaturesImmutable(); + com.google.protobuf.DescriptorProtos.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/FieldPolicy.java b/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/FieldPolicy.java new file mode 100644 index 0000000000..87145eb794 --- /dev/null +++ b/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/FieldPolicy.java @@ -0,0 +1,1061 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/api/policy.proto +// Protobuf Java Version: 4.33.2 + +package com.google.api; + +/** + * + * + *
        + * Google API Policy Annotation
        + *
        + * This message defines a simple API policy annotation that can be used to
        + * annotate API request and response message fields with applicable policies.
        + * One field may have multiple applicable policies that must all be satisfied
        + * before a request can be processed. This policy annotation is used to
        + * generate the overall policy that will be used for automatic runtime
        + * policy enforcement and documentation generation.
        + * 
        + * + * Protobuf type {@code google.api.FieldPolicy} + */ +@com.google.protobuf.Generated +public final class FieldPolicy extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.api.FieldPolicy) + FieldPolicyOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "FieldPolicy"); + } + + // Use FieldPolicy.newBuilder() to construct. + private FieldPolicy(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private FieldPolicy() { + selector_ = ""; + resourcePermission_ = ""; + resourceType_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.api.PolicyProto.internal_static_google_api_FieldPolicy_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.api.PolicyProto.internal_static_google_api_FieldPolicy_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.api.FieldPolicy.class, com.google.api.FieldPolicy.Builder.class); + } + + public static final int SELECTOR_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object selector_ = ""; + + /** + * + * + *
        +   * Selects one or more request or response message fields to apply this
        +   * `FieldPolicy`.
        +   *
        +   * When a `FieldPolicy` is used in proto annotation, the selector must
        +   * be left as empty. The service config generator will automatically fill
        +   * the correct value.
        +   *
        +   * When a `FieldPolicy` is used in service config, the selector must be a
        +   * comma-separated string with valid request or response field paths,
        +   * such as "foo.bar" or "foo.bar,foo.baz".
        +   * 
        + * + * string selector = 1; + * + * @return The selector. + */ + @java.lang.Override + public java.lang.String getSelector() { + java.lang.Object ref = selector_; + 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(); + selector_ = s; + return s; + } + } + + /** + * + * + *
        +   * Selects one or more request or response message fields to apply this
        +   * `FieldPolicy`.
        +   *
        +   * When a `FieldPolicy` is used in proto annotation, the selector must
        +   * be left as empty. The service config generator will automatically fill
        +   * the correct value.
        +   *
        +   * When a `FieldPolicy` is used in service config, the selector must be a
        +   * comma-separated string with valid request or response field paths,
        +   * such as "foo.bar" or "foo.bar,foo.baz".
        +   * 
        + * + * string selector = 1; + * + * @return The bytes for selector. + */ + @java.lang.Override + public com.google.protobuf.ByteString getSelectorBytes() { + java.lang.Object ref = selector_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + selector_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int RESOURCE_PERMISSION_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object resourcePermission_ = ""; + + /** + * + * + *
        +   * Specifies the required permission(s) for the resource referred to by the
        +   * field. It requires the field contains a valid resource reference, and
        +   * the request must pass the permission checks to proceed. For example,
        +   * "resourcemanager.projects.get".
        +   * 
        + * + * string resource_permission = 2; + * + * @return The resourcePermission. + */ + @java.lang.Override + public java.lang.String getResourcePermission() { + java.lang.Object ref = resourcePermission_; + 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(); + resourcePermission_ = s; + return s; + } + } + + /** + * + * + *
        +   * Specifies the required permission(s) for the resource referred to by the
        +   * field. It requires the field contains a valid resource reference, and
        +   * the request must pass the permission checks to proceed. For example,
        +   * "resourcemanager.projects.get".
        +   * 
        + * + * string resource_permission = 2; + * + * @return The bytes for resourcePermission. + */ + @java.lang.Override + public com.google.protobuf.ByteString getResourcePermissionBytes() { + java.lang.Object ref = resourcePermission_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + resourcePermission_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int RESOURCE_TYPE_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object resourceType_ = ""; + + /** + * + * + *
        +   * Specifies the resource type for the resource referred to by the field.
        +   * 
        + * + * string resource_type = 3; + * + * @return The resourceType. + */ + @java.lang.Override + public java.lang.String getResourceType() { + java.lang.Object ref = resourceType_; + 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(); + resourceType_ = s; + return s; + } + } + + /** + * + * + *
        +   * Specifies the resource type for the resource referred to by the field.
        +   * 
        + * + * string resource_type = 3; + * + * @return The bytes for resourceType. + */ + @java.lang.Override + public com.google.protobuf.ByteString getResourceTypeBytes() { + java.lang.Object ref = resourceType_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + resourceType_ = 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.GeneratedMessage.isStringEmpty(selector_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, selector_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(resourcePermission_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, resourcePermission_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(resourceType_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 3, resourceType_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(selector_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, selector_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(resourcePermission_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, resourcePermission_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(resourceType_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(3, resourceType_); + } + 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.api.FieldPolicy)) { + return super.equals(obj); + } + com.google.api.FieldPolicy other = (com.google.api.FieldPolicy) obj; + + if (!getSelector().equals(other.getSelector())) return false; + if (!getResourcePermission().equals(other.getResourcePermission())) return false; + if (!getResourceType().equals(other.getResourceType())) 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) + SELECTOR_FIELD_NUMBER; + hash = (53 * hash) + getSelector().hashCode(); + hash = (37 * hash) + RESOURCE_PERMISSION_FIELD_NUMBER; + hash = (53 * hash) + getResourcePermission().hashCode(); + hash = (37 * hash) + RESOURCE_TYPE_FIELD_NUMBER; + hash = (53 * hash) + getResourceType().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.api.FieldPolicy parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.api.FieldPolicy parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.api.FieldPolicy parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.api.FieldPolicy parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.api.FieldPolicy parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.api.FieldPolicy parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.api.FieldPolicy parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.api.FieldPolicy parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.api.FieldPolicy parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.api.FieldPolicy parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.api.FieldPolicy parseFrom(com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.api.FieldPolicy parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.api.FieldPolicy 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
        +   * Google API Policy Annotation
        +   *
        +   * This message defines a simple API policy annotation that can be used to
        +   * annotate API request and response message fields with applicable policies.
        +   * One field may have multiple applicable policies that must all be satisfied
        +   * before a request can be processed. This policy annotation is used to
        +   * generate the overall policy that will be used for automatic runtime
        +   * policy enforcement and documentation generation.
        +   * 
        + * + * Protobuf type {@code google.api.FieldPolicy} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.api.FieldPolicy) + com.google.api.FieldPolicyOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.api.PolicyProto.internal_static_google_api_FieldPolicy_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.api.PolicyProto.internal_static_google_api_FieldPolicy_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.api.FieldPolicy.class, com.google.api.FieldPolicy.Builder.class); + } + + // Construct using com.google.api.FieldPolicy.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + selector_ = ""; + resourcePermission_ = ""; + resourceType_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.api.PolicyProto.internal_static_google_api_FieldPolicy_descriptor; + } + + @java.lang.Override + public com.google.api.FieldPolicy getDefaultInstanceForType() { + return com.google.api.FieldPolicy.getDefaultInstance(); + } + + @java.lang.Override + public com.google.api.FieldPolicy build() { + com.google.api.FieldPolicy result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.api.FieldPolicy buildPartial() { + com.google.api.FieldPolicy result = new com.google.api.FieldPolicy(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.api.FieldPolicy result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.selector_ = selector_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.resourcePermission_ = resourcePermission_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.resourceType_ = resourceType_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.api.FieldPolicy) { + return mergeFrom((com.google.api.FieldPolicy) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.api.FieldPolicy other) { + if (other == com.google.api.FieldPolicy.getDefaultInstance()) return this; + if (!other.getSelector().isEmpty()) { + selector_ = other.selector_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getResourcePermission().isEmpty()) { + resourcePermission_ = other.resourcePermission_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (!other.getResourceType().isEmpty()) { + resourceType_ = other.resourceType_; + 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: + { + selector_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + resourcePermission_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + resourceType_ = 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 selector_ = ""; + + /** + * + * + *
        +     * Selects one or more request or response message fields to apply this
        +     * `FieldPolicy`.
        +     *
        +     * When a `FieldPolicy` is used in proto annotation, the selector must
        +     * be left as empty. The service config generator will automatically fill
        +     * the correct value.
        +     *
        +     * When a `FieldPolicy` is used in service config, the selector must be a
        +     * comma-separated string with valid request or response field paths,
        +     * such as "foo.bar" or "foo.bar,foo.baz".
        +     * 
        + * + * string selector = 1; + * + * @return The selector. + */ + public java.lang.String getSelector() { + java.lang.Object ref = selector_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + selector_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
        +     * Selects one or more request or response message fields to apply this
        +     * `FieldPolicy`.
        +     *
        +     * When a `FieldPolicy` is used in proto annotation, the selector must
        +     * be left as empty. The service config generator will automatically fill
        +     * the correct value.
        +     *
        +     * When a `FieldPolicy` is used in service config, the selector must be a
        +     * comma-separated string with valid request or response field paths,
        +     * such as "foo.bar" or "foo.bar,foo.baz".
        +     * 
        + * + * string selector = 1; + * + * @return The bytes for selector. + */ + public com.google.protobuf.ByteString getSelectorBytes() { + java.lang.Object ref = selector_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + selector_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
        +     * Selects one or more request or response message fields to apply this
        +     * `FieldPolicy`.
        +     *
        +     * When a `FieldPolicy` is used in proto annotation, the selector must
        +     * be left as empty. The service config generator will automatically fill
        +     * the correct value.
        +     *
        +     * When a `FieldPolicy` is used in service config, the selector must be a
        +     * comma-separated string with valid request or response field paths,
        +     * such as "foo.bar" or "foo.bar,foo.baz".
        +     * 
        + * + * string selector = 1; + * + * @param value The selector to set. + * @return This builder for chaining. + */ + public Builder setSelector(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + selector_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
        +     * Selects one or more request or response message fields to apply this
        +     * `FieldPolicy`.
        +     *
        +     * When a `FieldPolicy` is used in proto annotation, the selector must
        +     * be left as empty. The service config generator will automatically fill
        +     * the correct value.
        +     *
        +     * When a `FieldPolicy` is used in service config, the selector must be a
        +     * comma-separated string with valid request or response field paths,
        +     * such as "foo.bar" or "foo.bar,foo.baz".
        +     * 
        + * + * string selector = 1; + * + * @return This builder for chaining. + */ + public Builder clearSelector() { + selector_ = getDefaultInstance().getSelector(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
        +     * Selects one or more request or response message fields to apply this
        +     * `FieldPolicy`.
        +     *
        +     * When a `FieldPolicy` is used in proto annotation, the selector must
        +     * be left as empty. The service config generator will automatically fill
        +     * the correct value.
        +     *
        +     * When a `FieldPolicy` is used in service config, the selector must be a
        +     * comma-separated string with valid request or response field paths,
        +     * such as "foo.bar" or "foo.bar,foo.baz".
        +     * 
        + * + * string selector = 1; + * + * @param value The bytes for selector to set. + * @return This builder for chaining. + */ + public Builder setSelectorBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + selector_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object resourcePermission_ = ""; + + /** + * + * + *
        +     * Specifies the required permission(s) for the resource referred to by the
        +     * field. It requires the field contains a valid resource reference, and
        +     * the request must pass the permission checks to proceed. For example,
        +     * "resourcemanager.projects.get".
        +     * 
        + * + * string resource_permission = 2; + * + * @return The resourcePermission. + */ + public java.lang.String getResourcePermission() { + java.lang.Object ref = resourcePermission_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + resourcePermission_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
        +     * Specifies the required permission(s) for the resource referred to by the
        +     * field. It requires the field contains a valid resource reference, and
        +     * the request must pass the permission checks to proceed. For example,
        +     * "resourcemanager.projects.get".
        +     * 
        + * + * string resource_permission = 2; + * + * @return The bytes for resourcePermission. + */ + public com.google.protobuf.ByteString getResourcePermissionBytes() { + java.lang.Object ref = resourcePermission_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + resourcePermission_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
        +     * Specifies the required permission(s) for the resource referred to by the
        +     * field. It requires the field contains a valid resource reference, and
        +     * the request must pass the permission checks to proceed. For example,
        +     * "resourcemanager.projects.get".
        +     * 
        + * + * string resource_permission = 2; + * + * @param value The resourcePermission to set. + * @return This builder for chaining. + */ + public Builder setResourcePermission(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + resourcePermission_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
        +     * Specifies the required permission(s) for the resource referred to by the
        +     * field. It requires the field contains a valid resource reference, and
        +     * the request must pass the permission checks to proceed. For example,
        +     * "resourcemanager.projects.get".
        +     * 
        + * + * string resource_permission = 2; + * + * @return This builder for chaining. + */ + public Builder clearResourcePermission() { + resourcePermission_ = getDefaultInstance().getResourcePermission(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
        +     * Specifies the required permission(s) for the resource referred to by the
        +     * field. It requires the field contains a valid resource reference, and
        +     * the request must pass the permission checks to proceed. For example,
        +     * "resourcemanager.projects.get".
        +     * 
        + * + * string resource_permission = 2; + * + * @param value The bytes for resourcePermission to set. + * @return This builder for chaining. + */ + public Builder setResourcePermissionBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + resourcePermission_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private java.lang.Object resourceType_ = ""; + + /** + * + * + *
        +     * Specifies the resource type for the resource referred to by the field.
        +     * 
        + * + * string resource_type = 3; + * + * @return The resourceType. + */ + public java.lang.String getResourceType() { + java.lang.Object ref = resourceType_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + resourceType_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
        +     * Specifies the resource type for the resource referred to by the field.
        +     * 
        + * + * string resource_type = 3; + * + * @return The bytes for resourceType. + */ + public com.google.protobuf.ByteString getResourceTypeBytes() { + java.lang.Object ref = resourceType_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + resourceType_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
        +     * Specifies the resource type for the resource referred to by the field.
        +     * 
        + * + * string resource_type = 3; + * + * @param value The resourceType to set. + * @return This builder for chaining. + */ + public Builder setResourceType(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + resourceType_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
        +     * Specifies the resource type for the resource referred to by the field.
        +     * 
        + * + * string resource_type = 3; + * + * @return This builder for chaining. + */ + public Builder clearResourceType() { + resourceType_ = getDefaultInstance().getResourceType(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + + /** + * + * + *
        +     * Specifies the resource type for the resource referred to by the field.
        +     * 
        + * + * string resource_type = 3; + * + * @param value The bytes for resourceType to set. + * @return This builder for chaining. + */ + public Builder setResourceTypeBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + resourceType_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.api.FieldPolicy) + } + + // @@protoc_insertion_point(class_scope:google.api.FieldPolicy) + private static final com.google.api.FieldPolicy DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.api.FieldPolicy(); + } + + public static com.google.api.FieldPolicy getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public FieldPolicy 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.api.FieldPolicy getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/FieldPolicyOrBuilder.java b/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/FieldPolicyOrBuilder.java new file mode 100644 index 0000000000..dffa04fcd2 --- /dev/null +++ b/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/FieldPolicyOrBuilder.java @@ -0,0 +1,130 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/api/policy.proto +// Protobuf Java Version: 4.33.2 + +package com.google.api; + +@com.google.protobuf.Generated +public interface FieldPolicyOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.api.FieldPolicy) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
        +   * Selects one or more request or response message fields to apply this
        +   * `FieldPolicy`.
        +   *
        +   * When a `FieldPolicy` is used in proto annotation, the selector must
        +   * be left as empty. The service config generator will automatically fill
        +   * the correct value.
        +   *
        +   * When a `FieldPolicy` is used in service config, the selector must be a
        +   * comma-separated string with valid request or response field paths,
        +   * such as "foo.bar" or "foo.bar,foo.baz".
        +   * 
        + * + * string selector = 1; + * + * @return The selector. + */ + java.lang.String getSelector(); + + /** + * + * + *
        +   * Selects one or more request or response message fields to apply this
        +   * `FieldPolicy`.
        +   *
        +   * When a `FieldPolicy` is used in proto annotation, the selector must
        +   * be left as empty. The service config generator will automatically fill
        +   * the correct value.
        +   *
        +   * When a `FieldPolicy` is used in service config, the selector must be a
        +   * comma-separated string with valid request or response field paths,
        +   * such as "foo.bar" or "foo.bar,foo.baz".
        +   * 
        + * + * string selector = 1; + * + * @return The bytes for selector. + */ + com.google.protobuf.ByteString getSelectorBytes(); + + /** + * + * + *
        +   * Specifies the required permission(s) for the resource referred to by the
        +   * field. It requires the field contains a valid resource reference, and
        +   * the request must pass the permission checks to proceed. For example,
        +   * "resourcemanager.projects.get".
        +   * 
        + * + * string resource_permission = 2; + * + * @return The resourcePermission. + */ + java.lang.String getResourcePermission(); + + /** + * + * + *
        +   * Specifies the required permission(s) for the resource referred to by the
        +   * field. It requires the field contains a valid resource reference, and
        +   * the request must pass the permission checks to proceed. For example,
        +   * "resourcemanager.projects.get".
        +   * 
        + * + * string resource_permission = 2; + * + * @return The bytes for resourcePermission. + */ + com.google.protobuf.ByteString getResourcePermissionBytes(); + + /** + * + * + *
        +   * Specifies the resource type for the resource referred to by the field.
        +   * 
        + * + * string resource_type = 3; + * + * @return The resourceType. + */ + java.lang.String getResourceType(); + + /** + * + * + *
        +   * Specifies the resource type for the resource referred to by the field.
        +   * 
        + * + * string resource_type = 3; + * + * @return The bytes for resourceType. + */ + com.google.protobuf.ByteString getResourceTypeBytes(); +} diff --git a/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/GoSettings.java b/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/GoSettings.java index f21f7cfc20..54f2d59f5c 100644 --- a/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/GoSettings.java +++ b/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/GoSettings.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,9 @@ * limitations under the License. */ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: google/api/client.proto +// Protobuf Java Version: 4.33.2 package com.google.api; @@ -27,43 +29,58 @@ * * Protobuf type {@code google.api.GoSettings} */ -public final class GoSettings extends com.google.protobuf.GeneratedMessageV3 +@com.google.protobuf.Generated +public final class GoSettings extends com.google.protobuf.GeneratedMessage implements // @@protoc_insertion_point(message_implements:google.api.GoSettings) GoSettingsOrBuilder { private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "GoSettings"); + } + // Use GoSettings.newBuilder() to construct. - private GoSettings(com.google.protobuf.GeneratedMessageV3.Builder builder) { + private GoSettings(com.google.protobuf.GeneratedMessage.Builder builder) { super(builder); } private GoSettings() {} - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new GoSettings(); + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.api.ClientProto.internal_static_google_api_GoSettings_descriptor; } + @SuppressWarnings({"rawtypes"}) @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.api.ClientProto.internal_static_google_api_GoSettings_descriptor; + protected com.google.protobuf.MapFieldReflectionAccessor internalGetMapFieldReflection( + int number) { + switch (number) { + case 2: + return internalGetRenamedServices(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.api.ClientProto.internal_static_google_api_GoSettings_fieldAccessorTable .ensureFieldAccessorsInitialized( com.google.api.GoSettings.class, com.google.api.GoSettings.Builder.class); } + private int bitField0_; public static final int COMMON_FIELD_NUMBER = 1; private com.google.api.CommonLanguageSettings common_; + /** * * @@ -77,8 +94,9 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { */ @java.lang.Override public boolean hasCommon() { - return common_ != null; + return ((bitField0_ & 0x00000001) != 0); } + /** * * @@ -94,6 +112,7 @@ public boolean hasCommon() { public com.google.api.CommonLanguageSettings getCommon() { return common_ == null ? com.google.api.CommonLanguageSettings.getDefaultInstance() : common_; } + /** * * @@ -105,7 +124,144 @@ public com.google.api.CommonLanguageSettings getCommon() { */ @java.lang.Override public com.google.api.CommonLanguageSettingsOrBuilder getCommonOrBuilder() { - return getCommon(); + return common_ == null ? com.google.api.CommonLanguageSettings.getDefaultInstance() : common_; + } + + public static final int RENAMED_SERVICES_FIELD_NUMBER = 2; + + private static final class RenamedServicesDefaultEntryHolder { + static final com.google.protobuf.MapEntry defaultEntry = + com.google.protobuf.MapEntry.newDefaultInstance( + com.google.api.ClientProto + .internal_static_google_api_GoSettings_RenamedServicesEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.STRING, + ""); + } + + @SuppressWarnings("serial") + private com.google.protobuf.MapField renamedServices_; + + private com.google.protobuf.MapField + internalGetRenamedServices() { + if (renamedServices_ == null) { + return com.google.protobuf.MapField.emptyMapField( + RenamedServicesDefaultEntryHolder.defaultEntry); + } + return renamedServices_; + } + + public int getRenamedServicesCount() { + return internalGetRenamedServices().getMap().size(); + } + + /** + * + * + *
        +   * Map of service names to renamed services. Keys are the package relative
        +   * service names and values are the name to be used for the service client
        +   * and call options.
        +   *
        +   * publishing:
        +   * go_settings:
        +   * renamed_services:
        +   * Publisher: TopicAdmin
        +   * 
        + * + * map<string, string> renamed_services = 2; + */ + @java.lang.Override + public boolean containsRenamedServices(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + return internalGetRenamedServices().getMap().containsKey(key); + } + + /** Use {@link #getRenamedServicesMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getRenamedServices() { + return getRenamedServicesMap(); + } + + /** + * + * + *
        +   * Map of service names to renamed services. Keys are the package relative
        +   * service names and values are the name to be used for the service client
        +   * and call options.
        +   *
        +   * publishing:
        +   * go_settings:
        +   * renamed_services:
        +   * Publisher: TopicAdmin
        +   * 
        + * + * map<string, string> renamed_services = 2; + */ + @java.lang.Override + public java.util.Map getRenamedServicesMap() { + return internalGetRenamedServices().getMap(); + } + + /** + * + * + *
        +   * Map of service names to renamed services. Keys are the package relative
        +   * service names and values are the name to be used for the service client
        +   * and call options.
        +   *
        +   * publishing:
        +   * go_settings:
        +   * renamed_services:
        +   * Publisher: TopicAdmin
        +   * 
        + * + * map<string, string> renamed_services = 2; + */ + @java.lang.Override + public /* nullable */ java.lang.String getRenamedServicesOrDefault( + java.lang.String key, + /* nullable */ + java.lang.String defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetRenamedServices().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + + /** + * + * + *
        +   * Map of service names to renamed services. Keys are the package relative
        +   * service names and values are the name to be used for the service client
        +   * and call options.
        +   *
        +   * publishing:
        +   * go_settings:
        +   * renamed_services:
        +   * Publisher: TopicAdmin
        +   * 
        + * + * map<string, string> renamed_services = 2; + */ + @java.lang.Override + public java.lang.String getRenamedServicesOrThrow(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetRenamedServices().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); } private byte memoizedIsInitialized = -1; @@ -122,9 +278,11 @@ public final boolean isInitialized() { @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (common_ != null) { + if (((bitField0_ & 0x00000001) != 0)) { output.writeMessage(1, getCommon()); } + com.google.protobuf.GeneratedMessage.serializeStringMapTo( + output, internalGetRenamedServices(), RenamedServicesDefaultEntryHolder.defaultEntry, 2); getUnknownFields().writeTo(output); } @@ -134,9 +292,19 @@ public int getSerializedSize() { if (size != -1) return size; size = 0; - if (common_ != null) { + if (((bitField0_ & 0x00000001) != 0)) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getCommon()); } + for (java.util.Map.Entry entry : + internalGetRenamedServices().getMap().entrySet()) { + com.google.protobuf.MapEntry renamedServices__ = + RenamedServicesDefaultEntryHolder.defaultEntry + .newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, renamedServices__); + } size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; @@ -156,6 +324,7 @@ public boolean equals(final java.lang.Object obj) { if (hasCommon()) { if (!getCommon().equals(other.getCommon())) return false; } + if (!internalGetRenamedServices().equals(other.internalGetRenamedServices())) return false; if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -171,6 +340,10 @@ public int hashCode() { hash = (37 * hash) + COMMON_FIELD_NUMBER; hash = (53 * hash) + getCommon().hashCode(); } + if (!internalGetRenamedServices().getMap().isEmpty()) { + hash = (37 * hash) + RENAMED_SERVICES_FIELD_NUMBER; + hash = (53 * hash) + internalGetRenamedServices().hashCode(); + } hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; @@ -212,38 +385,38 @@ public static com.google.api.GoSettings parseFrom( public static com.google.api.GoSettings parseFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); } public static com.google.api.GoSettings parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } public static com.google.api.GoSettings parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); } public static com.google.api.GoSettings parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( PARSER, input, extensionRegistry); } public static com.google.api.GoSettings parseFrom(com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); } public static com.google.api.GoSettings parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } @@ -266,10 +439,11 @@ public Builder toBuilder() { } @java.lang.Override - protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { Builder builder = new Builder(parent); return builder; } + /** * * @@ -279,7 +453,7 @@ protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.Build * * Protobuf type {@code google.api.GoSettings} */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder implements // @@protoc_insertion_point(builder_implements:google.api.GoSettings) com.google.api.GoSettingsOrBuilder { @@ -287,8 +461,30 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.api.ClientProto.internal_static_google_api_GoSettings_descriptor; } + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapFieldReflectionAccessor internalGetMapFieldReflection( + int number) { + switch (number) { + case 2: + return internalGetRenamedServices(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapFieldReflectionAccessor internalGetMutableMapFieldReflection( + int number) { + switch (number) { + case 2: + return internalGetMutableRenamedServices(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.api.ClientProto.internal_static_google_api_GoSettings_fieldAccessorTable .ensureFieldAccessorsInitialized( @@ -296,21 +492,31 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } // Construct using com.google.api.GoSettings.newBuilder() - private Builder() {} + private Builder() { + maybeForceBuilderInitialization(); + } - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetCommonFieldBuilder(); + } } @java.lang.Override public Builder clear() { super.clear(); - if (commonBuilder_ == null) { - common_ = null; - } else { - common_ = null; + bitField0_ = 0; + common_ = null; + if (commonBuilder_ != null) { + commonBuilder_.dispose(); commonBuilder_ = null; } + internalGetMutableRenamedServices().clear(); return this; } @@ -336,46 +542,25 @@ public com.google.api.GoSettings build() { @java.lang.Override public com.google.api.GoSettings buildPartial() { com.google.api.GoSettings result = new com.google.api.GoSettings(this); - if (commonBuilder_ == null) { - result.common_ = common_; - } else { - result.common_ = commonBuilder_.build(); + if (bitField0_ != 0) { + buildPartial0(result); } 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); + private void buildPartial0(com.google.api.GoSettings result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.common_ = commonBuilder_ == null ? common_ : commonBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.renamedServices_ = internalGetRenamedServices(); + result.renamedServices_.makeImmutable(); + } + result.bitField0_ |= to_bitField0_; } @java.lang.Override @@ -393,6 +578,8 @@ public Builder mergeFrom(com.google.api.GoSettings other) { if (other.hasCommon()) { mergeCommon(other.getCommon()); } + internalGetMutableRenamedServices().mergeFrom(other.internalGetRenamedServices()); + bitField0_ |= 0x00000002; this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; @@ -421,10 +608,22 @@ public Builder mergeFrom( break; case 10: { - input.readMessage(getCommonFieldBuilder().getBuilder(), extensionRegistry); - + input.readMessage(internalGetCommonFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000001; break; } // case 10 + case 18: + { + com.google.protobuf.MapEntry renamedServices__ = + input.readMessage( + RenamedServicesDefaultEntryHolder.defaultEntry.getParserForType(), + extensionRegistry); + internalGetMutableRenamedServices() + .getMutableMap() + .put(renamedServices__.getKey(), renamedServices__.getValue()); + bitField0_ |= 0x00000002; + break; + } // case 18 default: { if (!super.parseUnknownField(input, extensionRegistry, tag)) { @@ -442,12 +641,15 @@ public Builder mergeFrom( return this; } + private int bitField0_; + private com.google.api.CommonLanguageSettings common_; - private com.google.protobuf.SingleFieldBuilderV3< + private com.google.protobuf.SingleFieldBuilder< com.google.api.CommonLanguageSettings, com.google.api.CommonLanguageSettings.Builder, com.google.api.CommonLanguageSettingsOrBuilder> commonBuilder_; + /** * * @@ -460,8 +662,9 @@ public Builder mergeFrom( * @return Whether the common field is set. */ public boolean hasCommon() { - return commonBuilder_ != null || common_ != null; + return ((bitField0_ & 0x00000001) != 0); } + /** * * @@ -482,6 +685,7 @@ public com.google.api.CommonLanguageSettings getCommon() { return commonBuilder_.getMessage(); } } + /** * * @@ -497,13 +701,14 @@ public Builder setCommon(com.google.api.CommonLanguageSettings value) { throw new NullPointerException(); } common_ = value; - onChanged(); } else { commonBuilder_.setMessage(value); } - + bitField0_ |= 0x00000001; + onChanged(); return this; } + /** * * @@ -516,13 +721,14 @@ public Builder setCommon(com.google.api.CommonLanguageSettings value) { public Builder setCommon(com.google.api.CommonLanguageSettings.Builder builderForValue) { if (commonBuilder_ == null) { common_ = builderForValue.build(); - onChanged(); } else { commonBuilder_.setMessage(builderForValue.build()); } - + bitField0_ |= 0x00000001; + onChanged(); return this; } + /** * * @@ -534,21 +740,23 @@ public Builder setCommon(com.google.api.CommonLanguageSettings.Builder builderFo */ public Builder mergeCommon(com.google.api.CommonLanguageSettings value) { if (commonBuilder_ == null) { - if (common_ != null) { - common_ = - com.google.api.CommonLanguageSettings.newBuilder(common_) - .mergeFrom(value) - .buildPartial(); + if (((bitField0_ & 0x00000001) != 0) + && common_ != null + && common_ != com.google.api.CommonLanguageSettings.getDefaultInstance()) { + getCommonBuilder().mergeFrom(value); } else { common_ = value; } - onChanged(); } else { commonBuilder_.mergeFrom(value); } - + if (common_ != null) { + bitField0_ |= 0x00000001; + onChanged(); + } return this; } + /** * * @@ -559,16 +767,16 @@ public Builder mergeCommon(com.google.api.CommonLanguageSettings value) { * .google.api.CommonLanguageSettings common = 1; */ public Builder clearCommon() { - if (commonBuilder_ == null) { - common_ = null; - onChanged(); - } else { - common_ = null; + bitField0_ = (bitField0_ & ~0x00000001); + common_ = null; + if (commonBuilder_ != null) { + commonBuilder_.dispose(); commonBuilder_ = null; } - + onChanged(); return this; } + /** * * @@ -579,10 +787,11 @@ public Builder clearCommon() { * .google.api.CommonLanguageSettings common = 1; */ public com.google.api.CommonLanguageSettings.Builder getCommonBuilder() { - + bitField0_ |= 0x00000001; onChanged(); - return getCommonFieldBuilder().getBuilder(); + return internalGetCommonFieldBuilder().getBuilder(); } + /** * * @@ -601,6 +810,7 @@ public com.google.api.CommonLanguageSettingsOrBuilder getCommonOrBuilder() { : common_; } } + /** * * @@ -610,14 +820,14 @@ public com.google.api.CommonLanguageSettingsOrBuilder getCommonOrBuilder() { * * .google.api.CommonLanguageSettings common = 1; */ - private com.google.protobuf.SingleFieldBuilderV3< + private com.google.protobuf.SingleFieldBuilder< com.google.api.CommonLanguageSettings, com.google.api.CommonLanguageSettings.Builder, com.google.api.CommonLanguageSettingsOrBuilder> - getCommonFieldBuilder() { + internalGetCommonFieldBuilder() { if (commonBuilder_ == null) { commonBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< + new com.google.protobuf.SingleFieldBuilder< com.google.api.CommonLanguageSettings, com.google.api.CommonLanguageSettings.Builder, com.google.api.CommonLanguageSettingsOrBuilder>( @@ -627,15 +837,229 @@ public com.google.api.CommonLanguageSettingsOrBuilder getCommonOrBuilder() { return commonBuilder_; } + private com.google.protobuf.MapField renamedServices_; + + private com.google.protobuf.MapField + internalGetRenamedServices() { + if (renamedServices_ == null) { + return com.google.protobuf.MapField.emptyMapField( + RenamedServicesDefaultEntryHolder.defaultEntry); + } + return renamedServices_; + } + + private com.google.protobuf.MapField + internalGetMutableRenamedServices() { + if (renamedServices_ == null) { + renamedServices_ = + com.google.protobuf.MapField.newMapField( + RenamedServicesDefaultEntryHolder.defaultEntry); + } + if (!renamedServices_.isMutable()) { + renamedServices_ = renamedServices_.copy(); + } + bitField0_ |= 0x00000002; + onChanged(); + return renamedServices_; + } + + public int getRenamedServicesCount() { + return internalGetRenamedServices().getMap().size(); + } + + /** + * + * + *
        +     * Map of service names to renamed services. Keys are the package relative
        +     * service names and values are the name to be used for the service client
        +     * and call options.
        +     *
        +     * publishing:
        +     * go_settings:
        +     * renamed_services:
        +     * Publisher: TopicAdmin
        +     * 
        + * + * map<string, string> renamed_services = 2; + */ + @java.lang.Override + public boolean containsRenamedServices(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + return internalGetRenamedServices().getMap().containsKey(key); + } + + /** Use {@link #getRenamedServicesMap()} instead. */ @java.lang.Override - public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); + @java.lang.Deprecated + public java.util.Map getRenamedServices() { + return getRenamedServicesMap(); } + /** + * + * + *
        +     * Map of service names to renamed services. Keys are the package relative
        +     * service names and values are the name to be used for the service client
        +     * and call options.
        +     *
        +     * publishing:
        +     * go_settings:
        +     * renamed_services:
        +     * Publisher: TopicAdmin
        +     * 
        + * + * map<string, string> renamed_services = 2; + */ @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); + public java.util.Map getRenamedServicesMap() { + return internalGetRenamedServices().getMap(); + } + + /** + * + * + *
        +     * Map of service names to renamed services. Keys are the package relative
        +     * service names and values are the name to be used for the service client
        +     * and call options.
        +     *
        +     * publishing:
        +     * go_settings:
        +     * renamed_services:
        +     * Publisher: TopicAdmin
        +     * 
        + * + * map<string, string> renamed_services = 2; + */ + @java.lang.Override + public /* nullable */ java.lang.String getRenamedServicesOrDefault( + java.lang.String key, + /* nullable */ + java.lang.String defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetRenamedServices().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + + /** + * + * + *
        +     * Map of service names to renamed services. Keys are the package relative
        +     * service names and values are the name to be used for the service client
        +     * and call options.
        +     *
        +     * publishing:
        +     * go_settings:
        +     * renamed_services:
        +     * Publisher: TopicAdmin
        +     * 
        + * + * map<string, string> renamed_services = 2; + */ + @java.lang.Override + public java.lang.String getRenamedServicesOrThrow(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetRenamedServices().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public Builder clearRenamedServices() { + bitField0_ = (bitField0_ & ~0x00000002); + internalGetMutableRenamedServices().getMutableMap().clear(); + return this; + } + + /** + * + * + *
        +     * Map of service names to renamed services. Keys are the package relative
        +     * service names and values are the name to be used for the service client
        +     * and call options.
        +     *
        +     * publishing:
        +     * go_settings:
        +     * renamed_services:
        +     * Publisher: TopicAdmin
        +     * 
        + * + * map<string, string> renamed_services = 2; + */ + public Builder removeRenamedServices(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + internalGetMutableRenamedServices().getMutableMap().remove(key); + return this; + } + + /** Use alternate mutation accessors instead. */ + @java.lang.Deprecated + public java.util.Map getMutableRenamedServices() { + bitField0_ |= 0x00000002; + return internalGetMutableRenamedServices().getMutableMap(); + } + + /** + * + * + *
        +     * Map of service names to renamed services. Keys are the package relative
        +     * service names and values are the name to be used for the service client
        +     * and call options.
        +     *
        +     * publishing:
        +     * go_settings:
        +     * renamed_services:
        +     * Publisher: TopicAdmin
        +     * 
        + * + * map<string, string> renamed_services = 2; + */ + public Builder putRenamedServices(java.lang.String key, java.lang.String value) { + if (key == null) { + throw new NullPointerException("map key"); + } + if (value == null) { + throw new NullPointerException("map value"); + } + internalGetMutableRenamedServices().getMutableMap().put(key, value); + bitField0_ |= 0x00000002; + return this; + } + + /** + * + * + *
        +     * Map of service names to renamed services. Keys are the package relative
        +     * service names and values are the name to be used for the service client
        +     * and call options.
        +     *
        +     * publishing:
        +     * go_settings:
        +     * renamed_services:
        +     * Publisher: TopicAdmin
        +     * 
        + * + * map<string, string> renamed_services = 2; + */ + public Builder putAllRenamedServices(java.util.Map values) { + internalGetMutableRenamedServices().getMutableMap().putAll(values); + bitField0_ |= 0x00000002; + return this; } // @@protoc_insertion_point(builder_scope:google.api.GoSettings) diff --git a/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/GoSettingsOrBuilder.java b/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/GoSettingsOrBuilder.java index b5a41ca0d9..c978320ae6 100644 --- a/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/GoSettingsOrBuilder.java +++ b/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/GoSettingsOrBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,10 +14,13 @@ * limitations under the License. */ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: google/api/client.proto +// Protobuf Java Version: 4.33.2 package com.google.api; +@com.google.protobuf.Generated public interface GoSettingsOrBuilder extends // @@protoc_insertion_point(interface_extends:google.api.GoSettings) @@ -35,6 +38,7 @@ public interface GoSettingsOrBuilder * @return Whether the common field is set. */ boolean hasCommon(); + /** * * @@ -47,6 +51,7 @@ public interface GoSettingsOrBuilder * @return The common. */ com.google.api.CommonLanguageSettings getCommon(); + /** * * @@ -57,4 +62,102 @@ public interface GoSettingsOrBuilder * .google.api.CommonLanguageSettings common = 1; */ com.google.api.CommonLanguageSettingsOrBuilder getCommonOrBuilder(); + + /** + * + * + *
        +   * Map of service names to renamed services. Keys are the package relative
        +   * service names and values are the name to be used for the service client
        +   * and call options.
        +   *
        +   * publishing:
        +   * go_settings:
        +   * renamed_services:
        +   * Publisher: TopicAdmin
        +   * 
        + * + * map<string, string> renamed_services = 2; + */ + int getRenamedServicesCount(); + + /** + * + * + *
        +   * Map of service names to renamed services. Keys are the package relative
        +   * service names and values are the name to be used for the service client
        +   * and call options.
        +   *
        +   * publishing:
        +   * go_settings:
        +   * renamed_services:
        +   * Publisher: TopicAdmin
        +   * 
        + * + * map<string, string> renamed_services = 2; + */ + boolean containsRenamedServices(java.lang.String key); + + /** Use {@link #getRenamedServicesMap()} instead. */ + @java.lang.Deprecated + java.util.Map getRenamedServices(); + + /** + * + * + *
        +   * Map of service names to renamed services. Keys are the package relative
        +   * service names and values are the name to be used for the service client
        +   * and call options.
        +   *
        +   * publishing:
        +   * go_settings:
        +   * renamed_services:
        +   * Publisher: TopicAdmin
        +   * 
        + * + * map<string, string> renamed_services = 2; + */ + java.util.Map getRenamedServicesMap(); + + /** + * + * + *
        +   * Map of service names to renamed services. Keys are the package relative
        +   * service names and values are the name to be used for the service client
        +   * and call options.
        +   *
        +   * publishing:
        +   * go_settings:
        +   * renamed_services:
        +   * Publisher: TopicAdmin
        +   * 
        + * + * map<string, string> renamed_services = 2; + */ + /* nullable */ + java.lang.String getRenamedServicesOrDefault( + java.lang.String key, + /* nullable */ + java.lang.String defaultValue); + + /** + * + * + *
        +   * Map of service names to renamed services. Keys are the package relative
        +   * service names and values are the name to be used for the service client
        +   * and call options.
        +   *
        +   * publishing:
        +   * go_settings:
        +   * renamed_services:
        +   * Publisher: TopicAdmin
        +   * 
        + * + * map<string, string> renamed_services = 2; + */ + java.lang.String getRenamedServicesOrThrow(java.lang.String key); } diff --git a/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/Http.java b/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/Http.java index 6aa15d767b..1a2af563a8 100644 --- a/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/Http.java +++ b/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/Http.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,9 @@ * limitations under the License. */ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: google/api/http.proto +// Protobuf Java Version: 4.33.2 package com.google.api; @@ -29,13 +31,25 @@ * * Protobuf type {@code google.api.Http} */ -public final class Http extends com.google.protobuf.GeneratedMessageV3 +@com.google.protobuf.Generated +public final class Http extends com.google.protobuf.GeneratedMessage implements // @@protoc_insertion_point(message_implements:google.api.Http) HttpOrBuilder { private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "Http"); + } + // Use Http.newBuilder() to construct. - private Http(com.google.protobuf.GeneratedMessageV3.Builder builder) { + private Http(com.google.protobuf.GeneratedMessage.Builder builder) { super(builder); } @@ -43,23 +57,12 @@ private Http() { rules_ = java.util.Collections.emptyList(); } - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new Http(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.api.HttpProto.internal_static_google_api_Http_descriptor; } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.api.HttpProto.internal_static_google_api_Http_fieldAccessorTable .ensureFieldAccessorsInitialized( @@ -67,12 +70,16 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } public static final int RULES_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") private java.util.List rules_; + /** * * *
            * A list of HTTP configuration rules that apply to individual API methods.
        +   *
            * **NOTE:** All service configuration rules follow "last one wins" order.
            * 
        * @@ -82,11 +89,13 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { public java.util.List getRulesList() { return rules_; } + /** * * *
            * A list of HTTP configuration rules that apply to individual API methods.
        +   *
            * **NOTE:** All service configuration rules follow "last one wins" order.
            * 
        * @@ -96,11 +105,13 @@ public java.util.List getRulesList() { public java.util.List getRulesOrBuilderList() { return rules_; } + /** * * *
            * A list of HTTP configuration rules that apply to individual API methods.
        +   *
            * **NOTE:** All service configuration rules follow "last one wins" order.
            * 
        * @@ -110,11 +121,13 @@ public java.util.List getRulesOrBuil public int getRulesCount() { return rules_.size(); } + /** * * *
            * A list of HTTP configuration rules that apply to individual API methods.
        +   *
            * **NOTE:** All service configuration rules follow "last one wins" order.
            * 
        * @@ -124,11 +137,13 @@ public int getRulesCount() { public com.google.api.HttpRule getRules(int index) { return rules_.get(index); } + /** * * *
            * A list of HTTP configuration rules that apply to individual API methods.
        +   *
            * **NOTE:** All service configuration rules follow "last one wins" order.
            * 
        * @@ -140,7 +155,8 @@ public com.google.api.HttpRuleOrBuilder getRulesOrBuilder(int index) { } public static final int FULLY_DECODE_RESERVED_EXPANSION_FIELD_NUMBER = 2; - private boolean fullyDecodeReservedExpansion_; + private boolean fullyDecodeReservedExpansion_ = false; + /** * * @@ -148,6 +164,7 @@ public com.google.api.HttpRuleOrBuilder getRulesOrBuilder(int index) { * When set to true, URL path parameters will be fully URI-decoded except in * cases of single segment matches in reserved expansion, where "%2F" will be * left encoded. + * * The default behavior is to not decode RFC 6570 reserved characters in multi * segment matches. * @@ -273,38 +290,38 @@ public static com.google.api.Http parseFrom( public static com.google.api.Http parseFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); } public static com.google.api.Http parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } public static com.google.api.Http parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); } public static com.google.api.Http parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( PARSER, input, extensionRegistry); } public static com.google.api.Http parseFrom(com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); } public static com.google.api.Http parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } @@ -327,10 +344,11 @@ public Builder toBuilder() { } @java.lang.Override - protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { Builder builder = new Builder(parent); return builder; } + /** * * @@ -342,7 +360,7 @@ protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.Build * * Protobuf type {@code google.api.Http} */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder implements // @@protoc_insertion_point(builder_implements:google.api.Http) com.google.api.HttpOrBuilder { @@ -351,7 +369,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.api.HttpProto.internal_static_google_api_Http_fieldAccessorTable .ensureFieldAccessorsInitialized( @@ -361,13 +379,14 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { // Construct using com.google.api.Http.newBuilder() private Builder() {} - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { super(parent); } @java.lang.Override public Builder clear() { super.clear(); + bitField0_ = 0; if (rulesBuilder_ == null) { rules_ = java.util.Collections.emptyList(); } else { @@ -376,7 +395,6 @@ public Builder clear() { } bitField0_ = (bitField0_ & ~0x00000001); fullyDecodeReservedExpansion_ = false; - return this; } @@ -402,7 +420,15 @@ public com.google.api.Http build() { @java.lang.Override public com.google.api.Http buildPartial() { com.google.api.Http result = new com.google.api.Http(this); - int from_bitField0_ = bitField0_; + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields(com.google.api.Http result) { if (rulesBuilder_ == null) { if (((bitField0_ & 0x00000001) != 0)) { rules_ = java.util.Collections.unmodifiableList(rules_); @@ -412,42 +438,13 @@ public com.google.api.Http buildPartial() { } else { result.rules_ = rulesBuilder_.build(); } - result.fullyDecodeReservedExpansion_ = fullyDecodeReservedExpansion_; - 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); + private void buildPartial0(com.google.api.Http result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.fullyDecodeReservedExpansion_ = fullyDecodeReservedExpansion_; + } } @java.lang.Override @@ -481,8 +478,8 @@ public Builder mergeFrom(com.google.api.Http other) { rules_ = other.rules_; bitField0_ = (bitField0_ & ~0x00000001); rulesBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders - ? getRulesFieldBuilder() + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders + ? internalGetRulesFieldBuilder() : null; } else { rulesBuilder_.addAllMessages(other.rules_); @@ -533,7 +530,7 @@ public Builder mergeFrom( case 16: { fullyDecodeReservedExpansion_ = input.readBool(); - + bitField0_ |= 0x00000002; break; } // case 16 default: @@ -564,7 +561,7 @@ private void ensureRulesIsMutable() { } } - private com.google.protobuf.RepeatedFieldBuilderV3< + private com.google.protobuf.RepeatedFieldBuilder< com.google.api.HttpRule, com.google.api.HttpRule.Builder, com.google.api.HttpRuleOrBuilder> @@ -575,6 +572,7 @@ private void ensureRulesIsMutable() { * *
              * A list of HTTP configuration rules that apply to individual API methods.
        +     *
              * **NOTE:** All service configuration rules follow "last one wins" order.
              * 
        * @@ -587,11 +585,13 @@ public java.util.List getRulesList() { return rulesBuilder_.getMessageList(); } } + /** * * *
              * A list of HTTP configuration rules that apply to individual API methods.
        +     *
              * **NOTE:** All service configuration rules follow "last one wins" order.
              * 
        * @@ -604,11 +604,13 @@ public int getRulesCount() { return rulesBuilder_.getCount(); } } + /** * * *
              * A list of HTTP configuration rules that apply to individual API methods.
        +     *
              * **NOTE:** All service configuration rules follow "last one wins" order.
              * 
        * @@ -621,11 +623,13 @@ public com.google.api.HttpRule getRules(int index) { return rulesBuilder_.getMessage(index); } } + /** * * *
              * A list of HTTP configuration rules that apply to individual API methods.
        +     *
              * **NOTE:** All service configuration rules follow "last one wins" order.
              * 
        * @@ -644,11 +648,13 @@ public Builder setRules(int index, com.google.api.HttpRule value) { } return this; } + /** * * *
              * A list of HTTP configuration rules that apply to individual API methods.
        +     *
              * **NOTE:** All service configuration rules follow "last one wins" order.
              * 
        * @@ -664,11 +670,13 @@ public Builder setRules(int index, com.google.api.HttpRule.Builder builderForVal } return this; } + /** * * *
              * A list of HTTP configuration rules that apply to individual API methods.
        +     *
              * **NOTE:** All service configuration rules follow "last one wins" order.
              * 
        * @@ -687,11 +695,13 @@ public Builder addRules(com.google.api.HttpRule value) { } return this; } + /** * * *
              * A list of HTTP configuration rules that apply to individual API methods.
        +     *
              * **NOTE:** All service configuration rules follow "last one wins" order.
              * 
        * @@ -710,11 +720,13 @@ public Builder addRules(int index, com.google.api.HttpRule value) { } return this; } + /** * * *
              * A list of HTTP configuration rules that apply to individual API methods.
        +     *
              * **NOTE:** All service configuration rules follow "last one wins" order.
              * 
        * @@ -730,11 +742,13 @@ public Builder addRules(com.google.api.HttpRule.Builder builderForValue) { } return this; } + /** * * *
              * A list of HTTP configuration rules that apply to individual API methods.
        +     *
              * **NOTE:** All service configuration rules follow "last one wins" order.
              * 
        * @@ -750,11 +764,13 @@ public Builder addRules(int index, com.google.api.HttpRule.Builder builderForVal } return this; } + /** * * *
              * A list of HTTP configuration rules that apply to individual API methods.
        +     *
              * **NOTE:** All service configuration rules follow "last one wins" order.
              * 
        * @@ -770,11 +786,13 @@ public Builder addAllRules(java.lang.Iterable } return this; } + /** * * *
              * A list of HTTP configuration rules that apply to individual API methods.
        +     *
              * **NOTE:** All service configuration rules follow "last one wins" order.
              * 
        * @@ -790,11 +808,13 @@ public Builder clearRules() { } return this; } + /** * * *
              * A list of HTTP configuration rules that apply to individual API methods.
        +     *
              * **NOTE:** All service configuration rules follow "last one wins" order.
              * 
        * @@ -810,24 +830,28 @@ public Builder removeRules(int index) { } return this; } + /** * * *
              * A list of HTTP configuration rules that apply to individual API methods.
        +     *
              * **NOTE:** All service configuration rules follow "last one wins" order.
              * 
        * * repeated .google.api.HttpRule rules = 1; */ public com.google.api.HttpRule.Builder getRulesBuilder(int index) { - return getRulesFieldBuilder().getBuilder(index); + return internalGetRulesFieldBuilder().getBuilder(index); } + /** * * *
              * A list of HTTP configuration rules that apply to individual API methods.
        +     *
              * **NOTE:** All service configuration rules follow "last one wins" order.
              * 
        * @@ -840,11 +864,13 @@ public com.google.api.HttpRuleOrBuilder getRulesOrBuilder(int index) { return rulesBuilder_.getMessageOrBuilder(index); } } + /** * * *
              * A list of HTTP configuration rules that apply to individual API methods.
        +     *
              * **NOTE:** All service configuration rules follow "last one wins" order.
              * 
        * @@ -857,54 +883,62 @@ public java.util.List getRulesOrBuil return java.util.Collections.unmodifiableList(rules_); } } + /** * * *
              * A list of HTTP configuration rules that apply to individual API methods.
        +     *
              * **NOTE:** All service configuration rules follow "last one wins" order.
              * 
        * * repeated .google.api.HttpRule rules = 1; */ public com.google.api.HttpRule.Builder addRulesBuilder() { - return getRulesFieldBuilder().addBuilder(com.google.api.HttpRule.getDefaultInstance()); + return internalGetRulesFieldBuilder() + .addBuilder(com.google.api.HttpRule.getDefaultInstance()); } + /** * * *
              * A list of HTTP configuration rules that apply to individual API methods.
        +     *
              * **NOTE:** All service configuration rules follow "last one wins" order.
              * 
        * * repeated .google.api.HttpRule rules = 1; */ public com.google.api.HttpRule.Builder addRulesBuilder(int index) { - return getRulesFieldBuilder().addBuilder(index, com.google.api.HttpRule.getDefaultInstance()); + return internalGetRulesFieldBuilder() + .addBuilder(index, com.google.api.HttpRule.getDefaultInstance()); } + /** * * *
              * A list of HTTP configuration rules that apply to individual API methods.
        +     *
              * **NOTE:** All service configuration rules follow "last one wins" order.
              * 
        * * repeated .google.api.HttpRule rules = 1; */ public java.util.List getRulesBuilderList() { - return getRulesFieldBuilder().getBuilderList(); + return internalGetRulesFieldBuilder().getBuilderList(); } - private com.google.protobuf.RepeatedFieldBuilderV3< + private com.google.protobuf.RepeatedFieldBuilder< com.google.api.HttpRule, com.google.api.HttpRule.Builder, com.google.api.HttpRuleOrBuilder> - getRulesFieldBuilder() { + internalGetRulesFieldBuilder() { if (rulesBuilder_ == null) { rulesBuilder_ = - new com.google.protobuf.RepeatedFieldBuilderV3< + new com.google.protobuf.RepeatedFieldBuilder< com.google.api.HttpRule, com.google.api.HttpRule.Builder, com.google.api.HttpRuleOrBuilder>( @@ -915,6 +949,7 @@ public java.util.List getRulesBuilderList() { } private boolean fullyDecodeReservedExpansion_; + /** * * @@ -922,6 +957,7 @@ public java.util.List getRulesBuilderList() { * When set to true, URL path parameters will be fully URI-decoded except in * cases of single segment matches in reserved expansion, where "%2F" will be * left encoded. + * * The default behavior is to not decode RFC 6570 reserved characters in multi * segment matches. * @@ -934,6 +970,7 @@ public java.util.List getRulesBuilderList() { public boolean getFullyDecodeReservedExpansion() { return fullyDecodeReservedExpansion_; } + /** * * @@ -941,6 +978,7 @@ public boolean getFullyDecodeReservedExpansion() { * When set to true, URL path parameters will be fully URI-decoded except in * cases of single segment matches in reserved expansion, where "%2F" will be * left encoded. + * * The default behavior is to not decode RFC 6570 reserved characters in multi * segment matches. * @@ -953,9 +991,11 @@ public boolean getFullyDecodeReservedExpansion() { public Builder setFullyDecodeReservedExpansion(boolean value) { fullyDecodeReservedExpansion_ = value; + bitField0_ |= 0x00000002; onChanged(); return this; } + /** * * @@ -963,6 +1003,7 @@ public Builder setFullyDecodeReservedExpansion(boolean value) { * When set to true, URL path parameters will be fully URI-decoded except in * cases of single segment matches in reserved expansion, where "%2F" will be * left encoded. + * * The default behavior is to not decode RFC 6570 reserved characters in multi * segment matches. * @@ -972,23 +1013,12 @@ public Builder setFullyDecodeReservedExpansion(boolean value) { * @return This builder for chaining. */ public Builder clearFullyDecodeReservedExpansion() { - + bitField0_ = (bitField0_ & ~0x00000002); fullyDecodeReservedExpansion_ = false; onChanged(); return this; } - @java.lang.Override - public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - // @@protoc_insertion_point(builder_scope:google.api.Http) } diff --git a/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/HttpBody.java b/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/HttpBody.java index fbab9ae19b..c3d093d9cb 100644 --- a/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/HttpBody.java +++ b/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/HttpBody.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,9 @@ * limitations under the License. */ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: google/api/httpbody.proto +// Protobuf Java Version: 4.33.2 package com.google.api; @@ -25,44 +27,69 @@ * Message that represents an arbitrary HTTP body. It should only be used for * payload formats that can't be represented as JSON, such as raw binary or * an HTML page. + * + * * This message can be used both in streaming and non-streaming API methods in * the request as well as the response. + * * It can be used as a top-level request field, which is convenient if one * wants to extract parameters from either the URL or HTTP template into the * request fields and also want access to the raw HTTP body. + * * Example: - * message GetResourceRequest { - * // A unique request id. - * string request_id = 1; - * // The raw HTTP body is bound to this field. - * google.api.HttpBody http_body = 2; - * } - * service ResourceService { - * rpc GetResource(GetResourceRequest) - * returns (google.api.HttpBody); - * rpc UpdateResource(google.api.HttpBody) - * returns (google.protobuf.Empty); - * } + * + * message GetResourceRequest { + * // A unique request id. + * string request_id = 1; + * + * // The raw HTTP body is bound to this field. + * google.api.HttpBody http_body = 2; + * + * } + * + * service ResourceService { + * rpc GetResource(GetResourceRequest) + * returns (google.api.HttpBody); + * rpc UpdateResource(google.api.HttpBody) + * returns (google.protobuf.Empty); + * + * } + * * Example with streaming methods: - * service CaldavService { - * rpc GetCalendar(stream google.api.HttpBody) - * returns (stream google.api.HttpBody); - * rpc UpdateCalendar(stream google.api.HttpBody) - * returns (stream google.api.HttpBody); - * } + * + * service CaldavService { + * rpc GetCalendar(stream google.api.HttpBody) + * returns (stream google.api.HttpBody); + * rpc UpdateCalendar(stream google.api.HttpBody) + * returns (stream google.api.HttpBody); + * + * } + * * Use of this type only changes how the request and response bodies are * handled, all other features will continue to work unchanged. * * * Protobuf type {@code google.api.HttpBody} */ -public final class HttpBody extends com.google.protobuf.GeneratedMessageV3 +@com.google.protobuf.Generated +public final class HttpBody extends com.google.protobuf.GeneratedMessage implements // @@protoc_insertion_point(message_implements:google.api.HttpBody) HttpBodyOrBuilder { private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "HttpBody"); + } + // Use HttpBody.newBuilder() to construct. - private HttpBody(com.google.protobuf.GeneratedMessageV3.Builder builder) { + private HttpBody(com.google.protobuf.GeneratedMessage.Builder builder) { super(builder); } @@ -72,23 +99,12 @@ private HttpBody() { extensions_ = java.util.Collections.emptyList(); } - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new HttpBody(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.api.HttpBodyProto.internal_static_google_api_HttpBody_descriptor; } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.api.HttpBodyProto.internal_static_google_api_HttpBody_fieldAccessorTable .ensureFieldAccessorsInitialized( @@ -96,7 +112,10 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } public static final int CONTENT_TYPE_FIELD_NUMBER = 1; - private volatile java.lang.Object contentType_; + + @SuppressWarnings("serial") + private volatile java.lang.Object contentType_ = ""; + /** * * @@ -120,6 +139,7 @@ public java.lang.String getContentType() { return s; } } + /** * * @@ -145,7 +165,8 @@ public com.google.protobuf.ByteString getContentTypeBytes() { } public static final int DATA_FIELD_NUMBER = 2; - private com.google.protobuf.ByteString data_; + private com.google.protobuf.ByteString data_ = com.google.protobuf.ByteString.EMPTY; + /** * * @@ -163,7 +184,10 @@ public com.google.protobuf.ByteString getData() { } public static final int EXTENSIONS_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") private java.util.List extensions_; + /** * * @@ -178,6 +202,7 @@ public com.google.protobuf.ByteString getData() { public java.util.List getExtensionsList() { return extensions_; } + /** * * @@ -192,6 +217,7 @@ public java.util.List getExtensionsList() { public java.util.List getExtensionsOrBuilderList() { return extensions_; } + /** * * @@ -206,6 +232,7 @@ public java.util.List getExtensionsO public int getExtensionsCount() { return extensions_.size(); } + /** * * @@ -220,6 +247,7 @@ public int getExtensionsCount() { public com.google.protobuf.Any getExtensions(int index) { return extensions_.get(index); } + /** * * @@ -249,8 +277,8 @@ public final boolean isInitialized() { @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(contentType_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, contentType_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(contentType_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, contentType_); } if (!data_.isEmpty()) { output.writeBytes(2, data_); @@ -267,8 +295,8 @@ public int getSerializedSize() { if (size != -1) return size; size = 0; - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(contentType_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, contentType_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(contentType_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, contentType_); } if (!data_.isEmpty()) { size += com.google.protobuf.CodedOutputStream.computeBytesSize(2, data_); @@ -354,38 +382,38 @@ public static com.google.api.HttpBody parseFrom( public static com.google.api.HttpBody parseFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); } public static com.google.api.HttpBody parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } public static com.google.api.HttpBody parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); } public static com.google.api.HttpBody parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( PARSER, input, extensionRegistry); } public static com.google.api.HttpBody parseFrom(com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); } public static com.google.api.HttpBody parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } @@ -408,10 +436,11 @@ public Builder toBuilder() { } @java.lang.Override - protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { Builder builder = new Builder(parent); return builder; } + /** * * @@ -419,38 +448,51 @@ protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.Build * Message that represents an arbitrary HTTP body. It should only be used for * payload formats that can't be represented as JSON, such as raw binary or * an HTML page. + * + * * This message can be used both in streaming and non-streaming API methods in * the request as well as the response. + * * It can be used as a top-level request field, which is convenient if one * wants to extract parameters from either the URL or HTTP template into the * request fields and also want access to the raw HTTP body. + * * Example: - * message GetResourceRequest { - * // A unique request id. - * string request_id = 1; - * // The raw HTTP body is bound to this field. - * google.api.HttpBody http_body = 2; - * } - * service ResourceService { - * rpc GetResource(GetResourceRequest) - * returns (google.api.HttpBody); - * rpc UpdateResource(google.api.HttpBody) - * returns (google.protobuf.Empty); - * } + * + * message GetResourceRequest { + * // A unique request id. + * string request_id = 1; + * + * // The raw HTTP body is bound to this field. + * google.api.HttpBody http_body = 2; + * + * } + * + * service ResourceService { + * rpc GetResource(GetResourceRequest) + * returns (google.api.HttpBody); + * rpc UpdateResource(google.api.HttpBody) + * returns (google.protobuf.Empty); + * + * } + * * Example with streaming methods: - * service CaldavService { - * rpc GetCalendar(stream google.api.HttpBody) - * returns (stream google.api.HttpBody); - * rpc UpdateCalendar(stream google.api.HttpBody) - * returns (stream google.api.HttpBody); - * } + * + * service CaldavService { + * rpc GetCalendar(stream google.api.HttpBody) + * returns (stream google.api.HttpBody); + * rpc UpdateCalendar(stream google.api.HttpBody) + * returns (stream google.api.HttpBody); + * + * } + * * Use of this type only changes how the request and response bodies are * handled, all other features will continue to work unchanged. * * * Protobuf type {@code google.api.HttpBody} */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder implements // @@protoc_insertion_point(builder_implements:google.api.HttpBody) com.google.api.HttpBodyOrBuilder { @@ -459,7 +501,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.api.HttpBodyProto.internal_static_google_api_HttpBody_fieldAccessorTable .ensureFieldAccessorsInitialized( @@ -469,24 +511,23 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { // Construct using com.google.api.HttpBody.newBuilder() private Builder() {} - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { super(parent); } @java.lang.Override public Builder clear() { super.clear(); + bitField0_ = 0; contentType_ = ""; - data_ = com.google.protobuf.ByteString.EMPTY; - if (extensionsBuilder_ == null) { extensions_ = java.util.Collections.emptyList(); } else { extensions_ = null; extensionsBuilder_.clear(); } - bitField0_ = (bitField0_ & ~0x00000001); + bitField0_ = (bitField0_ & ~0x00000004); return this; } @@ -512,53 +553,34 @@ public com.google.api.HttpBody build() { @java.lang.Override public com.google.api.HttpBody buildPartial() { com.google.api.HttpBody result = new com.google.api.HttpBody(this); - int from_bitField0_ = bitField0_; - result.contentType_ = contentType_; - result.data_ = data_; + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields(com.google.api.HttpBody result) { if (extensionsBuilder_ == null) { - if (((bitField0_ & 0x00000001) != 0)) { + if (((bitField0_ & 0x00000004) != 0)) { extensions_ = java.util.Collections.unmodifiableList(extensions_); - bitField0_ = (bitField0_ & ~0x00000001); + bitField0_ = (bitField0_ & ~0x00000004); } result.extensions_ = extensions_; } else { result.extensions_ = extensionsBuilder_.build(); } - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.setField(field, value); - } - - @java.lang.Override - public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); } - @java.lang.Override - public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.addRepeatedField(field, value); + private void buildPartial0(com.google.api.HttpBody result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.contentType_ = contentType_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.data_ = data_; + } } @java.lang.Override @@ -575,16 +597,17 @@ public Builder mergeFrom(com.google.api.HttpBody other) { if (other == com.google.api.HttpBody.getDefaultInstance()) return this; if (!other.getContentType().isEmpty()) { contentType_ = other.contentType_; + bitField0_ |= 0x00000001; onChanged(); } - if (other.getData() != com.google.protobuf.ByteString.EMPTY) { + if (!other.getData().isEmpty()) { setData(other.getData()); } if (extensionsBuilder_ == null) { if (!other.extensions_.isEmpty()) { if (extensions_.isEmpty()) { extensions_ = other.extensions_; - bitField0_ = (bitField0_ & ~0x00000001); + bitField0_ = (bitField0_ & ~0x00000004); } else { ensureExtensionsIsMutable(); extensions_.addAll(other.extensions_); @@ -597,10 +620,10 @@ public Builder mergeFrom(com.google.api.HttpBody other) { extensionsBuilder_.dispose(); extensionsBuilder_ = null; extensions_ = other.extensions_; - bitField0_ = (bitField0_ & ~0x00000001); + bitField0_ = (bitField0_ & ~0x00000004); extensionsBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders - ? getExtensionsFieldBuilder() + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders + ? internalGetExtensionsFieldBuilder() : null; } else { extensionsBuilder_.addAllMessages(other.extensions_); @@ -636,13 +659,13 @@ public Builder mergeFrom( case 10: { contentType_ = input.readStringRequireUtf8(); - + bitField0_ |= 0x00000001; break; } // case 10 case 18: { data_ = input.readBytes(); - + bitField0_ |= 0x00000002; break; } // case 18 case 26: @@ -677,6 +700,7 @@ public Builder mergeFrom( private int bitField0_; private java.lang.Object contentType_ = ""; + /** * * @@ -699,6 +723,7 @@ public java.lang.String getContentType() { return (java.lang.String) ref; } } + /** * * @@ -721,6 +746,7 @@ public com.google.protobuf.ByteString getContentTypeBytes() { return (com.google.protobuf.ByteString) ref; } } + /** * * @@ -737,11 +763,12 @@ public Builder setContentType(java.lang.String value) { if (value == null) { throw new NullPointerException(); } - contentType_ = value; + bitField0_ |= 0x00000001; onChanged(); return this; } + /** * * @@ -754,11 +781,12 @@ public Builder setContentType(java.lang.String value) { * @return This builder for chaining. */ public Builder clearContentType() { - contentType_ = getDefaultInstance().getContentType(); + bitField0_ = (bitField0_ & ~0x00000001); onChanged(); return this; } + /** * * @@ -776,13 +804,14 @@ public Builder setContentTypeBytes(com.google.protobuf.ByteString value) { throw new NullPointerException(); } checkByteStringIsUtf8(value); - contentType_ = value; + bitField0_ |= 0x00000001; onChanged(); return this; } private com.google.protobuf.ByteString data_ = com.google.protobuf.ByteString.EMPTY; + /** * * @@ -798,6 +827,7 @@ public Builder setContentTypeBytes(com.google.protobuf.ByteString value) { public com.google.protobuf.ByteString getData() { return data_; } + /** * * @@ -814,11 +844,12 @@ public Builder setData(com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); } - data_ = value; + bitField0_ |= 0x00000002; onChanged(); return this; } + /** * * @@ -831,7 +862,7 @@ public Builder setData(com.google.protobuf.ByteString value) { * @return This builder for chaining. */ public Builder clearData() { - + bitField0_ = (bitField0_ & ~0x00000002); data_ = getDefaultInstance().getData(); onChanged(); return this; @@ -840,13 +871,13 @@ public Builder clearData() { private java.util.List extensions_ = java.util.Collections.emptyList(); private void ensureExtensionsIsMutable() { - if (!((bitField0_ & 0x00000001) != 0)) { + if (!((bitField0_ & 0x00000004) != 0)) { extensions_ = new java.util.ArrayList(extensions_); - bitField0_ |= 0x00000001; + bitField0_ |= 0x00000004; } } - private com.google.protobuf.RepeatedFieldBuilderV3< + private com.google.protobuf.RepeatedFieldBuilder< com.google.protobuf.Any, com.google.protobuf.Any.Builder, com.google.protobuf.AnyOrBuilder> @@ -869,6 +900,7 @@ public java.util.List getExtensionsList() { return extensionsBuilder_.getMessageList(); } } + /** * * @@ -886,6 +918,7 @@ public int getExtensionsCount() { return extensionsBuilder_.getCount(); } } + /** * * @@ -903,6 +936,7 @@ public com.google.protobuf.Any getExtensions(int index) { return extensionsBuilder_.getMessage(index); } } + /** * * @@ -926,6 +960,7 @@ public Builder setExtensions(int index, com.google.protobuf.Any value) { } return this; } + /** * * @@ -946,6 +981,7 @@ public Builder setExtensions(int index, com.google.protobuf.Any.Builder builderF } return this; } + /** * * @@ -969,6 +1005,7 @@ public Builder addExtensions(com.google.protobuf.Any value) { } return this; } + /** * * @@ -992,6 +1029,7 @@ public Builder addExtensions(int index, com.google.protobuf.Any value) { } return this; } + /** * * @@ -1012,6 +1050,7 @@ public Builder addExtensions(com.google.protobuf.Any.Builder builderForValue) { } return this; } + /** * * @@ -1032,6 +1071,7 @@ public Builder addExtensions(int index, com.google.protobuf.Any.Builder builderF } return this; } + /** * * @@ -1052,6 +1092,7 @@ public Builder addAllExtensions(java.lang.Iterablerepeated .google.protobuf.Any extensions = 3;
        */ public com.google.protobuf.Any.Builder getExtensionsBuilder(int index) { - return getExtensionsFieldBuilder().getBuilder(index); + return internalGetExtensionsFieldBuilder().getBuilder(index); } + /** * * @@ -1122,6 +1166,7 @@ public com.google.protobuf.AnyOrBuilder getExtensionsOrBuilder(int index) { return extensionsBuilder_.getMessageOrBuilder(index); } } + /** * * @@ -1139,6 +1184,7 @@ public java.util.List getExtensionsO return java.util.Collections.unmodifiableList(extensions_); } } + /** * * @@ -1150,8 +1196,10 @@ public java.util.List getExtensionsO * repeated .google.protobuf.Any extensions = 3; */ public com.google.protobuf.Any.Builder addExtensionsBuilder() { - return getExtensionsFieldBuilder().addBuilder(com.google.protobuf.Any.getDefaultInstance()); + return internalGetExtensionsFieldBuilder() + .addBuilder(com.google.protobuf.Any.getDefaultInstance()); } + /** * * @@ -1163,9 +1211,10 @@ public com.google.protobuf.Any.Builder addExtensionsBuilder() { * repeated .google.protobuf.Any extensions = 3; */ public com.google.protobuf.Any.Builder addExtensionsBuilder(int index) { - return getExtensionsFieldBuilder() + return internalGetExtensionsFieldBuilder() .addBuilder(index, com.google.protobuf.Any.getDefaultInstance()); } + /** * * @@ -1177,37 +1226,26 @@ public com.google.protobuf.Any.Builder addExtensionsBuilder(int index) { * repeated .google.protobuf.Any extensions = 3; */ public java.util.List getExtensionsBuilderList() { - return getExtensionsFieldBuilder().getBuilderList(); + return internalGetExtensionsFieldBuilder().getBuilderList(); } - private com.google.protobuf.RepeatedFieldBuilderV3< + private com.google.protobuf.RepeatedFieldBuilder< com.google.protobuf.Any, com.google.protobuf.Any.Builder, com.google.protobuf.AnyOrBuilder> - getExtensionsFieldBuilder() { + internalGetExtensionsFieldBuilder() { if (extensionsBuilder_ == null) { extensionsBuilder_ = - new com.google.protobuf.RepeatedFieldBuilderV3< + new com.google.protobuf.RepeatedFieldBuilder< com.google.protobuf.Any, com.google.protobuf.Any.Builder, com.google.protobuf.AnyOrBuilder>( - extensions_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + extensions_, ((bitField0_ & 0x00000004) != 0), getParentForChildren(), isClean()); extensions_ = null; } return extensionsBuilder_; } - @java.lang.Override - public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - // @@protoc_insertion_point(builder_scope:google.api.HttpBody) } diff --git a/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/HttpBodyOrBuilder.java b/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/HttpBodyOrBuilder.java index c1749af4f1..bbc6427a65 100644 --- a/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/HttpBodyOrBuilder.java +++ b/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/HttpBodyOrBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,10 +14,13 @@ * limitations under the License. */ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: google/api/httpbody.proto +// Protobuf Java Version: 4.33.2 package com.google.api; +@com.google.protobuf.Generated public interface HttpBodyOrBuilder extends // @@protoc_insertion_point(interface_extends:google.api.HttpBody) @@ -35,6 +38,7 @@ public interface HttpBodyOrBuilder * @return The contentType. */ java.lang.String getContentType(); + /** * * @@ -72,6 +76,7 @@ public interface HttpBodyOrBuilder * repeated .google.protobuf.Any extensions = 3; */ java.util.List getExtensionsList(); + /** * * @@ -83,6 +88,7 @@ public interface HttpBodyOrBuilder * repeated .google.protobuf.Any extensions = 3; */ com.google.protobuf.Any getExtensions(int index); + /** * * @@ -94,6 +100,7 @@ public interface HttpBodyOrBuilder * repeated .google.protobuf.Any extensions = 3; */ int getExtensionsCount(); + /** * * @@ -105,6 +112,7 @@ public interface HttpBodyOrBuilder * repeated .google.protobuf.Any extensions = 3; */ java.util.List getExtensionsOrBuilderList(); + /** * * diff --git a/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/HttpBodyProto.java b/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/HttpBodyProto.java index b136b6924b..b6e9a92a0a 100644 --- a/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/HttpBodyProto.java +++ b/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/HttpBodyProto.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,13 +14,26 @@ * limitations under the License. */ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: google/api/httpbody.proto +// Protobuf Java Version: 4.33.2 package com.google.api; -public final class HttpBodyProto { +@com.google.protobuf.Generated +public final class HttpBodyProto extends com.google.protobuf.GeneratedFile { private HttpBodyProto() {} + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "HttpBodyProto"); + } + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistryLite registry) {} public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry registry) { @@ -29,7 +42,7 @@ public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry r static final com.google.protobuf.Descriptors.Descriptor internal_static_google_api_HttpBody_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable internal_static_google_api_HttpBody_fieldAccessorTable; public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { @@ -43,10 +56,10 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "\n\031google/api/httpbody.proto\022\ngoogle.api\032" + "\031google/protobuf/any.proto\"X\n\010HttpBody\022\024" + "\n\014content_type\030\001 \001(\t\022\014\n\004data\030\002 \001(\014\022(\n\nex" - + "tensions\030\003 \003(\0132\024.google.protobuf.AnyBh\n\016" + + "tensions\030\003 \003(\0132\024.google.protobuf.AnyBe\n\016" + "com.google.apiB\rHttpBodyProtoP\001Z;google." + "golang.org/genproto/googleapis/api/httpb" - + "ody;httpbody\370\001\001\242\002\004GAPIb\006proto3" + + "ody;httpbody\242\002\004GAPIb\006proto3" }; descriptor = com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( @@ -54,13 +67,14 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { new com.google.protobuf.Descriptors.FileDescriptor[] { com.google.protobuf.AnyProto.getDescriptor(), }); - internal_static_google_api_HttpBody_descriptor = getDescriptor().getMessageTypes().get(0); + internal_static_google_api_HttpBody_descriptor = getDescriptor().getMessageType(0); internal_static_google_api_HttpBody_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_google_api_HttpBody_descriptor, new java.lang.String[] { "ContentType", "Data", "Extensions", }); + descriptor.resolveAllFeaturesImmutable(); com.google.protobuf.AnyProto.getDescriptor(); } diff --git a/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/HttpOrBuilder.java b/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/HttpOrBuilder.java index 17900f27ac..2d13f3b3cd 100644 --- a/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/HttpOrBuilder.java +++ b/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/HttpOrBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,10 +14,13 @@ * limitations under the License. */ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: google/api/http.proto +// Protobuf Java Version: 4.33.2 package com.google.api; +@com.google.protobuf.Generated public interface HttpOrBuilder extends // @@protoc_insertion_point(interface_extends:google.api.Http) @@ -28,50 +31,59 @@ public interface HttpOrBuilder * *
            * A list of HTTP configuration rules that apply to individual API methods.
        +   *
            * **NOTE:** All service configuration rules follow "last one wins" order.
            * 
        * * repeated .google.api.HttpRule rules = 1; */ java.util.List getRulesList(); + /** * * *
            * A list of HTTP configuration rules that apply to individual API methods.
        +   *
            * **NOTE:** All service configuration rules follow "last one wins" order.
            * 
        * * repeated .google.api.HttpRule rules = 1; */ com.google.api.HttpRule getRules(int index); + /** * * *
            * A list of HTTP configuration rules that apply to individual API methods.
        +   *
            * **NOTE:** All service configuration rules follow "last one wins" order.
            * 
        * * repeated .google.api.HttpRule rules = 1; */ int getRulesCount(); + /** * * *
            * A list of HTTP configuration rules that apply to individual API methods.
        +   *
            * **NOTE:** All service configuration rules follow "last one wins" order.
            * 
        * * repeated .google.api.HttpRule rules = 1; */ java.util.List getRulesOrBuilderList(); + /** * * *
            * A list of HTTP configuration rules that apply to individual API methods.
        +   *
            * **NOTE:** All service configuration rules follow "last one wins" order.
            * 
        * @@ -86,6 +98,7 @@ public interface HttpOrBuilder * When set to true, URL path parameters will be fully URI-decoded except in * cases of single segment matches in reserved expansion, where "%2F" will be * left encoded. + * * The default behavior is to not decode RFC 6570 reserved characters in multi * segment matches. * diff --git a/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/HttpProto.java b/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/HttpProto.java index 02dfa316be..435597f6bc 100644 --- a/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/HttpProto.java +++ b/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/HttpProto.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,13 +14,26 @@ * limitations under the License. */ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: google/api/http.proto +// Protobuf Java Version: 4.33.2 package com.google.api; -public final class HttpProto { +@com.google.protobuf.Generated +public final class HttpProto extends com.google.protobuf.GeneratedFile { private HttpProto() {} + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "HttpProto"); + } + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistryLite registry) {} public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry registry) { @@ -29,15 +42,15 @@ public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry r static final com.google.protobuf.Descriptors.Descriptor internal_static_google_api_Http_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable internal_static_google_api_Http_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_google_api_HttpRule_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable internal_static_google_api_HttpRule_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_google_api_CustomHttpPattern_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable internal_static_google_api_CustomHttpPattern_fieldAccessorTable; public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { @@ -48,34 +61,43 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { static { java.lang.String[] descriptorData = { - "\n\025google/api/http.proto\022\ngoogle.api\"T\n\004H" - + "ttp\022#\n\005rules\030\001 \003(\0132\024.google.api.HttpRule" - + "\022\'\n\037fully_decode_reserved_expansion\030\002 \001(" - + "\010\"\201\002\n\010HttpRule\022\020\n\010selector\030\001 \001(\t\022\r\n\003get\030" - + "\002 \001(\tH\000\022\r\n\003put\030\003 \001(\tH\000\022\016\n\004post\030\004 \001(\tH\000\022\020" - + "\n\006delete\030\005 \001(\tH\000\022\017\n\005patch\030\006 \001(\tH\000\022/\n\006cus" - + "tom\030\010 \001(\0132\035.google.api.CustomHttpPattern" - + "H\000\022\014\n\004body\030\007 \001(\t\022\025\n\rresponse_body\030\014 \001(\t\022" - + "1\n\023additional_bindings\030\013 \003(\0132\024.google.ap" - + "i.HttpRuleB\t\n\007pattern\"/\n\021CustomHttpPatte" - + "rn\022\014\n\004kind\030\001 \001(\t\022\014\n\004path\030\002 \001(\tBj\n\016com.go" - + "ogle.apiB\tHttpProtoP\001ZAgoogle.golang.org" - + "/genproto/googleapis/api/annotations;ann" - + "otations\370\001\001\242\002\004GAPIb\006proto3" + "\n" + + "\025google/api/http.proto\022\n" + + "google.api\"T\n" + + "\004Http\022#\n" + + "\005rules\030\001 \003(\0132\024.google.api.HttpRule\022\'\n" + + "\037fully_decode_reserved_expansion\030\002 \001(\010\"\201\002\n" + + "\010HttpRule\022\020\n" + + "\010selector\030\001 \001(\t\022\r\n" + + "\003get\030\002 \001(\tH\000\022\r\n" + + "\003put\030\003 \001(\tH\000\022\016\n" + + "\004post\030\004 \001(\tH\000\022\020\n" + + "\006delete\030\005 \001(\tH\000\022\017\n" + + "\005patch\030\006 \001(\tH\000\022/\n" + + "\006custom\030\010 \001(\0132\035.google.api.CustomHttpPatternH\000\022\014\n" + + "\004body\030\007 \001(\t\022\025\n\r" + + "response_body\030\014 \001(\t\0221\n" + + "\023additional_bindings\030\013 \003(\0132\024.google.api.HttpRuleB\t\n" + + "\007pattern\"/\n" + + "\021CustomHttpPattern\022\014\n" + + "\004kind\030\001 \001(\t\022\014\n" + + "\004path\030\002 \001(\tBg\n" + + "\016com.google.apiB\tHttpProtoP\001ZAgoogle.golang.org" + + "/genproto/googleapis/api/annotations;annotations\242\002\004GAPIb\006proto3" }; descriptor = com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( descriptorData, new com.google.protobuf.Descriptors.FileDescriptor[] {}); - internal_static_google_api_Http_descriptor = getDescriptor().getMessageTypes().get(0); + internal_static_google_api_Http_descriptor = getDescriptor().getMessageType(0); internal_static_google_api_Http_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_google_api_Http_descriptor, new java.lang.String[] { "Rules", "FullyDecodeReservedExpansion", }); - internal_static_google_api_HttpRule_descriptor = getDescriptor().getMessageTypes().get(1); + internal_static_google_api_HttpRule_descriptor = getDescriptor().getMessageType(1); internal_static_google_api_HttpRule_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_google_api_HttpRule_descriptor, new java.lang.String[] { "Selector", @@ -90,14 +112,14 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "AdditionalBindings", "Pattern", }); - internal_static_google_api_CustomHttpPattern_descriptor = - getDescriptor().getMessageTypes().get(2); + internal_static_google_api_CustomHttpPattern_descriptor = getDescriptor().getMessageType(2); internal_static_google_api_CustomHttpPattern_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_google_api_CustomHttpPattern_descriptor, new java.lang.String[] { "Kind", "Path", }); + descriptor.resolveAllFeaturesImmutable(); } // @@protoc_insertion_point(outer_class_scope) diff --git a/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/HttpRule.java b/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/HttpRule.java index 568b0c52b2..34d577d8d9 100644 --- a/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/HttpRule.java +++ b/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/HttpRule.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,9 @@ * limitations under the License. */ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: google/api/http.proto +// Protobuf Java Version: 4.33.2 package com.google.api; @@ -22,7 +24,8 @@ * * *
        - * # gRPC Transcoding
        + * gRPC Transcoding
        + *
          * gRPC Transcoding is a feature for mapping between a gRPC method and one or
          * more HTTP REST endpoints. It allows developers to build a single API service
          * that supports both gRPC APIs and REST APIs. Many systems, including [Google
        @@ -31,165 +34,194 @@
          * Gateway](https://github.com/grpc-ecosystem/grpc-gateway),
          * and [Envoy](https://github.com/envoyproxy/envoy) proxy support this feature
          * and use it for large scale production services.
        + *
          * `HttpRule` defines the schema of the gRPC/REST mapping. The mapping specifies
          * how different portions of the gRPC request message are mapped to the URL
          * path, URL query parameters, and HTTP request body. It also controls how the
          * gRPC response message is mapped to the HTTP response body. `HttpRule` is
          * typically specified as an `google.api.http` annotation on the gRPC method.
        + *
          * Each mapping specifies a URL path template and an HTTP method. The path
          * template may refer to one or more fields in the gRPC request message, as long
          * as each field is a non-repeated field with a primitive (non-message) type.
          * The path template controls how fields of the request message are mapped to
          * the URL path.
        + *
          * Example:
        - *     service Messaging {
        - *       rpc GetMessage(GetMessageRequest) returns (Message) {
        - *         option (google.api.http) = {
        - *             get: "/v1/{name=messages/*}"
        - *         };
        - *       }
        - *     }
        - *     message GetMessageRequest {
        - *       string name = 1; // Mapped to URL path.
        - *     }
        - *     message Message {
        - *       string text = 1; // The resource content.
        - *     }
        + *
        + * service Messaging {
        + * rpc GetMessage(GetMessageRequest) returns (Message) {
        + * option (google.api.http) = {
        + * get: "/v1/{name=messages/*}"
        + * };
        + * }
        + * }
        + * message GetMessageRequest {
        + * string name = 1; // Mapped to URL path.
        + * }
        + * message Message {
        + * string text = 1; // The resource content.
        + * }
        + *
          * This enables an HTTP REST to gRPC mapping as below:
        - * HTTP | gRPC
        - * -----|-----
        - * `GET /v1/messages/123456`  | `GetMessage(name: "messages/123456")`
        + *
        + * - HTTP: `GET /v1/messages/123456`
        + * - gRPC: `GetMessage(name: "messages/123456")`
        + *
          * Any fields in the request message which are not bound by the path template
          * automatically become HTTP query parameters if there is no HTTP request body.
          * For example:
        - *     service Messaging {
        - *       rpc GetMessage(GetMessageRequest) returns (Message) {
        - *         option (google.api.http) = {
        - *             get:"/v1/messages/{message_id}"
        - *         };
        - *       }
        - *     }
        - *     message GetMessageRequest {
        - *       message SubMessage {
        - *         string subfield = 1;
        - *       }
        - *       string message_id = 1; // Mapped to URL path.
        - *       int64 revision = 2;    // Mapped to URL query parameter `revision`.
        - *       SubMessage sub = 3;    // Mapped to URL query parameter `sub.subfield`.
        - *     }
        + *
        + * service Messaging {
        + * rpc GetMessage(GetMessageRequest) returns (Message) {
        + * option (google.api.http) = {
        + * get:"/v1/messages/{message_id}"
        + * };
        + * }
        + * }
        + * message GetMessageRequest {
        + * message SubMessage {
        + * string subfield = 1;
        + * }
        + * string message_id = 1; // Mapped to URL path.
        + * int64 revision = 2;    // Mapped to URL query parameter `revision`.
        + * SubMessage sub = 3;    // Mapped to URL query parameter `sub.subfield`.
        + * }
        + *
          * This enables a HTTP JSON to RPC mapping as below:
        - * HTTP | gRPC
        - * -----|-----
        - * `GET /v1/messages/123456?revision=2&sub.subfield=foo` |
        - * `GetMessage(message_id: "123456" revision: 2 sub: SubMessage(subfield:
        - * "foo"))`
        + *
        + * - HTTP: `GET /v1/messages/123456?revision=2&sub.subfield=foo`
        + * - gRPC: `GetMessage(message_id: "123456" revision: 2 sub:
        + * SubMessage(subfield: "foo"))`
        + *
          * Note that fields which are mapped to URL query parameters must have a
          * primitive type or a repeated primitive type or a non-repeated message type.
          * In the case of a repeated type, the parameter can be repeated in the URL
          * as `...?param=A&param=B`. In the case of a message type, each field of the
          * message is mapped to a separate parameter, such as
          * `...?foo.a=A&foo.b=B&foo.c=C`.
        + *
          * For HTTP methods that allow a request body, the `body` field
          * specifies the mapping. Consider a REST update method on the
          * message resource collection:
        - *     service Messaging {
        - *       rpc UpdateMessage(UpdateMessageRequest) returns (Message) {
        - *         option (google.api.http) = {
        - *           patch: "/v1/messages/{message_id}"
        - *           body: "message"
        - *         };
        - *       }
        - *     }
        - *     message UpdateMessageRequest {
        - *       string message_id = 1; // mapped to the URL
        - *       Message message = 2;   // mapped to the body
        - *     }
        + *
        + * service Messaging {
        + * rpc UpdateMessage(UpdateMessageRequest) returns (Message) {
        + * option (google.api.http) = {
        + * patch: "/v1/messages/{message_id}"
        + * body: "message"
        + * };
        + * }
        + * }
        + * message UpdateMessageRequest {
        + * string message_id = 1; // mapped to the URL
        + * Message message = 2;   // mapped to the body
        + * }
        + *
          * The following HTTP JSON to RPC mapping is enabled, where the
          * representation of the JSON in the request body is determined by
          * protos JSON encoding:
        - * HTTP | gRPC
        - * -----|-----
        - * `PATCH /v1/messages/123456 { "text": "Hi!" }` | `UpdateMessage(message_id:
        - * "123456" message { text: "Hi!" })`
        + *
        + * - HTTP: `PATCH /v1/messages/123456 { "text": "Hi!" }`
        + * - gRPC: `UpdateMessage(message_id: "123456" message { text: "Hi!" })`
        + *
          * The special name `*` can be used in the body mapping to define that
          * every field not bound by the path template should be mapped to the
          * request body.  This enables the following alternative definition of
          * the update method:
        - *     service Messaging {
        - *       rpc UpdateMessage(Message) returns (Message) {
        - *         option (google.api.http) = {
        - *           patch: "/v1/messages/{message_id}"
        - *           body: "*"
        - *         };
        - *       }
        - *     }
        - *     message Message {
        - *       string message_id = 1;
        - *       string text = 2;
        - *     }
        + *
        + * service Messaging {
        + * rpc UpdateMessage(Message) returns (Message) {
        + * option (google.api.http) = {
        + * patch: "/v1/messages/{message_id}"
        + * body: "*"
        + * };
        + * }
        + * }
        + * message Message {
        + * string message_id = 1;
        + * string text = 2;
        + * }
        + *
        + *
          * The following HTTP JSON to RPC mapping is enabled:
        - * HTTP | gRPC
        - * -----|-----
        - * `PATCH /v1/messages/123456 { "text": "Hi!" }` | `UpdateMessage(message_id:
        - * "123456" text: "Hi!")`
        + *
        + * - HTTP: `PATCH /v1/messages/123456 { "text": "Hi!" }`
        + * - gRPC: `UpdateMessage(message_id: "123456" text: "Hi!")`
        + *
          * Note that when using `*` in the body mapping, it is not possible to
          * have HTTP parameters, as all fields not bound by the path end in
          * the body. This makes this option more rarely used in practice when
          * defining REST APIs. The common usage of `*` is in custom methods
          * which don't use the URL at all for transferring data.
        + *
          * It is possible to define multiple HTTP methods for one RPC by using
          * the `additional_bindings` option. Example:
        - *     service Messaging {
        - *       rpc GetMessage(GetMessageRequest) returns (Message) {
        - *         option (google.api.http) = {
        - *           get: "/v1/messages/{message_id}"
        - *           additional_bindings {
        - *             get: "/v1/users/{user_id}/messages/{message_id}"
        - *           }
        - *         };
        - *       }
        - *     }
        - *     message GetMessageRequest {
        - *       string message_id = 1;
        - *       string user_id = 2;
        - *     }
        + *
        + * service Messaging {
        + * rpc GetMessage(GetMessageRequest) returns (Message) {
        + * option (google.api.http) = {
        + * get: "/v1/messages/{message_id}"
        + * additional_bindings {
        + * get: "/v1/users/{user_id}/messages/{message_id}"
        + * }
        + * };
        + * }
        + * }
        + * message GetMessageRequest {
        + * string message_id = 1;
        + * string user_id = 2;
        + * }
        + *
          * This enables the following two alternative HTTP JSON to RPC mappings:
        - * HTTP | gRPC
        - * -----|-----
        - * `GET /v1/messages/123456` | `GetMessage(message_id: "123456")`
        - * `GET /v1/users/me/messages/123456` | `GetMessage(user_id: "me" message_id:
        - * "123456")`
        - * ## Rules for HTTP mapping
        + *
        + * - HTTP: `GET /v1/messages/123456`
        + * - gRPC: `GetMessage(message_id: "123456")`
        + *
        + * - HTTP: `GET /v1/users/me/messages/123456`
        + * - gRPC: `GetMessage(user_id: "me" message_id: "123456")`
        + *
        + * Rules for HTTP mapping
        + *
          * 1. Leaf request fields (recursive expansion nested messages in the request
        - *    message) are classified into three categories:
        - *    - Fields referred by the path template. They are passed via the URL path.
        - *    - Fields referred by the [HttpRule.body][google.api.HttpRule.body]. They are passed via the HTTP
        - *      request body.
        - *    - All other fields are passed via the URL query parameters, and the
        - *      parameter name is the field path in the request message. A repeated
        - *      field can be represented as multiple query parameters under the same
        - *      name.
        - *  2. If [HttpRule.body][google.api.HttpRule.body] is "*", there is no URL query parameter, all fields
        - *     are passed via URL path and HTTP request body.
        - *  3. If [HttpRule.body][google.api.HttpRule.body] is omitted, there is no HTTP request body, all
        - *     fields are passed via URL path and URL query parameters.
        - * ### Path template syntax
        - *     Template = "/" Segments [ Verb ] ;
        - *     Segments = Segment { "/" Segment } ;
        - *     Segment  = "*" | "**" | LITERAL | Variable ;
        - *     Variable = "{" FieldPath [ "=" Segments ] "}" ;
        - *     FieldPath = IDENT { "." IDENT } ;
        - *     Verb     = ":" LITERAL ;
        + * message) are classified into three categories:
        + * - Fields referred by the path template. They are passed via the URL path.
        + * - Fields referred by the [HttpRule.body][google.api.HttpRule.body]. They
        + * are passed via the HTTP
        + * request body.
        + * - All other fields are passed via the URL query parameters, and the
        + * parameter name is the field path in the request message. A repeated
        + * field can be represented as multiple query parameters under the same
        + * name.
        + * 2. If [HttpRule.body][google.api.HttpRule.body] is "*", there is no URL
        + * query parameter, all fields
        + * are passed via URL path and HTTP request body.
        + * 3. If [HttpRule.body][google.api.HttpRule.body] is omitted, there is no HTTP
        + * request body, all
        + * fields are passed via URL path and URL query parameters.
        + *
        + * Path template syntax
        + *
        + * Template = "/" Segments [ Verb ] ;
        + * Segments = Segment { "/" Segment } ;
        + * Segment  = "*" | "**" | LITERAL | Variable ;
        + * Variable = "{" FieldPath [ "=" Segments ] "}" ;
        + * FieldPath = IDENT { "." IDENT } ;
        + * Verb     = ":" LITERAL ;
        + *
          * The syntax `*` matches a single URL path segment. The syntax `**` matches
          * zero or more URL path segments, which must be the last part of the URL path
          * except the `Verb`.
        + *
          * The syntax `Variable` matches part of the URL path as specified by its
          * template. A variable template must not contain other variables. If a variable
          * matches a single path segment, its template may be omitted, e.g. `{var}`
          * is equivalent to `{var=*}`.
        + *
          * The syntax `LITERAL` matches literal text in the URL path. If the `LITERAL`
          * contains any reserved character, such characters should be percent-encoded
          * before the matching.
        + *
          * If a variable contains exactly one path segment, such as `"{var}"` or
          * `"{var=*}"`, when such a variable is expanded into a URL path on the client
          * side, all characters except `[-_.~0-9a-zA-Z]` are percent-encoded. The
        @@ -197,6 +229,7 @@
          * [Discovery
          * Document](https://developers.google.com/discovery/v1/reference/apis) as
          * `{var}`.
        + *
          * If a variable contains multiple path segments, such as `"{var=foo/*}"`
          * or `"{var=**}"`, when such a variable is expanded into a URL path on the
          * client side, all characters except `[-_.~/0-9a-zA-Z]` are percent-encoded.
        @@ -205,11 +238,14 @@
          * [Discovery
          * Document](https://developers.google.com/discovery/v1/reference/apis) as
          * `{+var}`.
        - * ## Using gRPC API Service Configuration
        + *
        + * Using gRPC API Service Configuration
        + *
          * gRPC API Service Configuration (service config) is a configuration language
          * for configuring a gRPC service to become a user-facing product. The
          * service config is simply the YAML representation of the `google.api.Service`
          * proto message.
        + *
          * As an alternative to annotating your proto file, you can configure gRPC
          * transcoding in your service config YAML files. You do this by specifying a
          * `HttpRule` that maps the gRPC method to a REST endpoint, achieving the same
        @@ -217,16 +253,20 @@
          * have a proto that is reused in multiple services. Note that any transcoding
          * specified in the service config will override any matching transcoding
          * configuration in the proto.
        - * Example:
        - *     http:
        - *       rules:
        - *         # Selects a gRPC method and applies HttpRule to it.
        - *         - selector: example.v1.Messaging.GetMessage
        - *           get: /v1/messages/{message_id}/{sub.subfield}
        - * ## Special notes
        + *
        + * The following example selects a gRPC method and applies an `HttpRule` to it:
        + *
        + * http:
        + * rules:
        + * - selector: example.v1.Messaging.GetMessage
        + * get: /v1/messages/{message_id}/{sub.subfield}
        + *
        + * Special notes
        + *
          * When gRPC Transcoding is used to map a gRPC to JSON REST endpoints, the
          * proto to JSON conversion must follow the [proto3
          * specification](https://developers.google.com/protocol-buffers/docs/proto3#json).
        + *
          * While the single segment variable follows the semantics of
          * [RFC 6570](https://tools.ietf.org/html/rfc6570) Section 3.2.2 Simple String
          * Expansion, the multi segment variable **does not** follow RFC 6570 Section
        @@ -234,13 +274,17 @@
          * does not expand special characters like `?` and `#`, which would lead
          * to invalid URLs. As the result, gRPC Transcoding uses a custom encoding
          * for multi segment variables.
        + *
          * The path variables **must not** refer to any repeated or mapped field,
          * because client libraries are not capable of handling such variable expansion.
        + *
          * The path variables **must not** capture the leading "/" character. The reason
          * is that the most common use case "{var}" does not capture the leading "/"
          * character. For consistency, all path variables must share the same behavior.
        + *
          * Repeated message fields must not be mapped to URL query parameters, because
          * no client library can support such complicated mapping.
        + *
          * If an API needs to use a JSON array for request or response body, it can map
          * the request or response body to a repeated field. However, some gRPC
          * Transcoding implementations may not support this feature.
        @@ -248,13 +292,25 @@
          *
          * Protobuf type {@code google.api.HttpRule}
          */
        -public final class HttpRule extends com.google.protobuf.GeneratedMessageV3
        +@com.google.protobuf.Generated
        +public final class HttpRule extends com.google.protobuf.GeneratedMessage
             implements
             // @@protoc_insertion_point(message_implements:google.api.HttpRule)
             HttpRuleOrBuilder {
           private static final long serialVersionUID = 0L;
        +
        +  static {
        +    com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion(
        +        com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC,
        +        /* major= */ 4,
        +        /* minor= */ 33,
        +        /* patch= */ 2,
        +        /* suffix= */ "",
        +        "HttpRule");
        +  }
        +
           // Use HttpRule.newBuilder() to construct.
        -  private HttpRule(com.google.protobuf.GeneratedMessageV3.Builder builder) {
        +  private HttpRule(com.google.protobuf.GeneratedMessage.Builder builder) {
             super(builder);
           }
         
        @@ -265,23 +321,12 @@ private HttpRule() {
             additionalBindings_ = java.util.Collections.emptyList();
           }
         
        -  @java.lang.Override
        -  @SuppressWarnings({"unused"})
        -  protected java.lang.Object newInstance(UnusedPrivateParameter unused) {
        -    return new HttpRule();
        -  }
        -
        -  @java.lang.Override
        -  public final com.google.protobuf.UnknownFieldSet getUnknownFields() {
        -    return this.unknownFields;
        -  }
        -
           public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
             return com.google.api.HttpProto.internal_static_google_api_HttpRule_descriptor;
           }
         
           @java.lang.Override
        -  protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
        +  protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
               internalGetFieldAccessorTable() {
             return com.google.api.HttpProto.internal_static_google_api_HttpRule_fieldAccessorTable
                 .ensureFieldAccessorsInitialized(
        @@ -289,6 +334,8 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
           }
         
           private int patternCase_ = 0;
        +
        +  @SuppressWarnings("serial")
           private java.lang.Object pattern_;
         
           public enum PatternCase
        @@ -307,6 +354,7 @@ public enum PatternCase
             private PatternCase(int value) {
               this.value = value;
             }
        +
             /**
              * @param value The number of the enum to look for.
              * @return The enum associated with the given number.
        @@ -348,13 +396,18 @@ public PatternCase getPatternCase() {
           }
         
           public static final int SELECTOR_FIELD_NUMBER = 1;
        -  private volatile java.lang.Object selector_;
        +
        +  @SuppressWarnings("serial")
        +  private volatile java.lang.Object selector_ = "";
        +
           /**
            *
            *
            * 
            * Selects a method to which this rule applies.
        -   * Refer to [selector][google.api.DocumentationRule.selector] for syntax details.
        +   *
        +   * Refer to [selector][google.api.DocumentationRule.selector] for syntax
        +   * details.
            * 
        * * string selector = 1; @@ -373,12 +426,15 @@ public java.lang.String getSelector() { return s; } } + /** * * *
            * Selects a method to which this rule applies.
        -   * Refer to [selector][google.api.DocumentationRule.selector] for syntax details.
        +   *
        +   * Refer to [selector][google.api.DocumentationRule.selector] for syntax
        +   * details.
            * 
        * * string selector = 1; @@ -399,6 +455,7 @@ public com.google.protobuf.ByteString getSelectorBytes() { } public static final int GET_FIELD_NUMBER = 2; + /** * * @@ -414,6 +471,7 @@ public com.google.protobuf.ByteString getSelectorBytes() { public boolean hasGet() { return patternCase_ == 2; } + /** * * @@ -442,6 +500,7 @@ public java.lang.String getGet() { return s; } } + /** * * @@ -472,6 +531,7 @@ public com.google.protobuf.ByteString getGetBytes() { } public static final int PUT_FIELD_NUMBER = 3; + /** * * @@ -486,6 +546,7 @@ public com.google.protobuf.ByteString getGetBytes() { public boolean hasPut() { return patternCase_ == 3; } + /** * * @@ -513,6 +574,7 @@ public java.lang.String getPut() { return s; } } + /** * * @@ -542,6 +604,7 @@ public com.google.protobuf.ByteString getPutBytes() { } public static final int POST_FIELD_NUMBER = 4; + /** * * @@ -556,6 +619,7 @@ public com.google.protobuf.ByteString getPutBytes() { public boolean hasPost() { return patternCase_ == 4; } + /** * * @@ -583,6 +647,7 @@ public java.lang.String getPost() { return s; } } + /** * * @@ -612,6 +677,7 @@ public com.google.protobuf.ByteString getPostBytes() { } public static final int DELETE_FIELD_NUMBER = 5; + /** * * @@ -626,6 +692,7 @@ public com.google.protobuf.ByteString getPostBytes() { public boolean hasDelete() { return patternCase_ == 5; } + /** * * @@ -653,6 +720,7 @@ public java.lang.String getDelete() { return s; } } + /** * * @@ -682,6 +750,7 @@ public com.google.protobuf.ByteString getDeleteBytes() { } public static final int PATCH_FIELD_NUMBER = 6; + /** * * @@ -696,6 +765,7 @@ public com.google.protobuf.ByteString getDeleteBytes() { public boolean hasPatch() { return patternCase_ == 6; } + /** * * @@ -723,6 +793,7 @@ public java.lang.String getPatch() { return s; } } + /** * * @@ -752,6 +823,7 @@ public com.google.protobuf.ByteString getPatchBytes() { } public static final int CUSTOM_FIELD_NUMBER = 8; + /** * * @@ -770,6 +842,7 @@ public com.google.protobuf.ByteString getPatchBytes() { public boolean hasCustom() { return patternCase_ == 8; } + /** * * @@ -791,6 +864,7 @@ public com.google.api.CustomHttpPattern getCustom() { } return com.google.api.CustomHttpPattern.getDefaultInstance(); } + /** * * @@ -812,7 +886,10 @@ public com.google.api.CustomHttpPatternOrBuilder getCustomOrBuilder() { } public static final int BODY_FIELD_NUMBER = 7; - private volatile java.lang.Object body_; + + @SuppressWarnings("serial") + private volatile java.lang.Object body_ = ""; + /** * * @@ -820,6 +897,7 @@ public com.google.api.CustomHttpPatternOrBuilder getCustomOrBuilder() { * The name of the request field whose value is mapped to the HTTP request * body, or `*` for mapping all request fields not captured by the path * pattern to the HTTP body, or omitted for not having any HTTP request body. + * * NOTE: the referred field must be present at the top-level of the request * message type. *
        @@ -840,6 +918,7 @@ public java.lang.String getBody() { return s; } } + /** * * @@ -847,6 +926,7 @@ public java.lang.String getBody() { * The name of the request field whose value is mapped to the HTTP request * body, or `*` for mapping all request fields not captured by the path * pattern to the HTTP body, or omitted for not having any HTTP request body. + * * NOTE: the referred field must be present at the top-level of the request * message type. * @@ -869,7 +949,10 @@ public com.google.protobuf.ByteString getBodyBytes() { } public static final int RESPONSE_BODY_FIELD_NUMBER = 12; - private volatile java.lang.Object responseBody_; + + @SuppressWarnings("serial") + private volatile java.lang.Object responseBody_ = ""; + /** * * @@ -877,6 +960,7 @@ public com.google.protobuf.ByteString getBodyBytes() { * Optional. The name of the response field whose value is mapped to the HTTP * response body. When omitted, the entire response message will be used * as the HTTP response body. + * * NOTE: The referred field must be present at the top-level of the response * message type. * @@ -897,6 +981,7 @@ public java.lang.String getResponseBody() { return s; } } + /** * * @@ -904,6 +989,7 @@ public java.lang.String getResponseBody() { * Optional. The name of the response field whose value is mapped to the HTTP * response body. When omitted, the entire response message will be used * as the HTTP response body. + * * NOTE: The referred field must be present at the top-level of the response * message type. * @@ -926,7 +1012,10 @@ public com.google.protobuf.ByteString getResponseBodyBytes() { } public static final int ADDITIONAL_BINDINGS_FIELD_NUMBER = 11; + + @SuppressWarnings("serial") private java.util.List additionalBindings_; + /** * * @@ -942,6 +1031,7 @@ public com.google.protobuf.ByteString getResponseBodyBytes() { public java.util.List getAdditionalBindingsList() { return additionalBindings_; } + /** * * @@ -958,6 +1048,7 @@ public java.util.List getAdditionalBindingsList() { getAdditionalBindingsOrBuilderList() { return additionalBindings_; } + /** * * @@ -973,6 +1064,7 @@ public java.util.List getAdditionalBindingsList() { public int getAdditionalBindingsCount() { return additionalBindings_.size(); } + /** * * @@ -988,6 +1080,7 @@ public int getAdditionalBindingsCount() { public com.google.api.HttpRule getAdditionalBindings(int index) { return additionalBindings_.get(index); } + /** * * @@ -1018,26 +1111,26 @@ public final boolean isInitialized() { @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(selector_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, selector_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(selector_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, selector_); } if (patternCase_ == 2) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 2, pattern_); + com.google.protobuf.GeneratedMessage.writeString(output, 2, pattern_); } if (patternCase_ == 3) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 3, pattern_); + com.google.protobuf.GeneratedMessage.writeString(output, 3, pattern_); } if (patternCase_ == 4) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 4, pattern_); + com.google.protobuf.GeneratedMessage.writeString(output, 4, pattern_); } if (patternCase_ == 5) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 5, pattern_); + com.google.protobuf.GeneratedMessage.writeString(output, 5, pattern_); } if (patternCase_ == 6) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 6, pattern_); + com.google.protobuf.GeneratedMessage.writeString(output, 6, pattern_); } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(body_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 7, body_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(body_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 7, body_); } if (patternCase_ == 8) { output.writeMessage(8, (com.google.api.CustomHttpPattern) pattern_); @@ -1045,8 +1138,8 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io for (int i = 0; i < additionalBindings_.size(); i++) { output.writeMessage(11, additionalBindings_.get(i)); } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(responseBody_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 12, responseBody_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(responseBody_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 12, responseBody_); } getUnknownFields().writeTo(output); } @@ -1057,26 +1150,26 @@ public int getSerializedSize() { if (size != -1) return size; size = 0; - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(selector_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, selector_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(selector_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, selector_); } if (patternCase_ == 2) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, pattern_); + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, pattern_); } if (patternCase_ == 3) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, pattern_); + size += com.google.protobuf.GeneratedMessage.computeStringSize(3, pattern_); } if (patternCase_ == 4) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, pattern_); + size += com.google.protobuf.GeneratedMessage.computeStringSize(4, pattern_); } if (patternCase_ == 5) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, pattern_); + size += com.google.protobuf.GeneratedMessage.computeStringSize(5, pattern_); } if (patternCase_ == 6) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(6, pattern_); + size += com.google.protobuf.GeneratedMessage.computeStringSize(6, pattern_); } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(body_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(7, body_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(body_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(7, body_); } if (patternCase_ == 8) { size += @@ -1087,8 +1180,8 @@ public int getSerializedSize() { size += com.google.protobuf.CodedOutputStream.computeMessageSize(11, additionalBindings_.get(i)); } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(responseBody_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(12, responseBody_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(responseBody_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(12, responseBody_); } size += getUnknownFields().getSerializedSize(); memoizedSize = size; @@ -1222,38 +1315,38 @@ public static com.google.api.HttpRule parseFrom( public static com.google.api.HttpRule parseFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); } public static com.google.api.HttpRule parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } public static com.google.api.HttpRule parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); } public static com.google.api.HttpRule parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( PARSER, input, extensionRegistry); } public static com.google.api.HttpRule parseFrom(com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); } public static com.google.api.HttpRule parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } @@ -1276,15 +1369,17 @@ public Builder toBuilder() { } @java.lang.Override - protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { Builder builder = new Builder(parent); return builder; } + /** * * *
        -   * # gRPC Transcoding
        +   * gRPC Transcoding
        +   *
            * gRPC Transcoding is a feature for mapping between a gRPC method and one or
            * more HTTP REST endpoints. It allows developers to build a single API service
            * that supports both gRPC APIs and REST APIs. Many systems, including [Google
        @@ -1293,165 +1388,194 @@ protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.Build
            * Gateway](https://github.com/grpc-ecosystem/grpc-gateway),
            * and [Envoy](https://github.com/envoyproxy/envoy) proxy support this feature
            * and use it for large scale production services.
        +   *
            * `HttpRule` defines the schema of the gRPC/REST mapping. The mapping specifies
            * how different portions of the gRPC request message are mapped to the URL
            * path, URL query parameters, and HTTP request body. It also controls how the
            * gRPC response message is mapped to the HTTP response body. `HttpRule` is
            * typically specified as an `google.api.http` annotation on the gRPC method.
        +   *
            * Each mapping specifies a URL path template and an HTTP method. The path
            * template may refer to one or more fields in the gRPC request message, as long
            * as each field is a non-repeated field with a primitive (non-message) type.
            * The path template controls how fields of the request message are mapped to
            * the URL path.
        +   *
            * Example:
        -   *     service Messaging {
        -   *       rpc GetMessage(GetMessageRequest) returns (Message) {
        -   *         option (google.api.http) = {
        -   *             get: "/v1/{name=messages/*}"
        -   *         };
        -   *       }
        -   *     }
        -   *     message GetMessageRequest {
        -   *       string name = 1; // Mapped to URL path.
        -   *     }
        -   *     message Message {
        -   *       string text = 1; // The resource content.
        -   *     }
        +   *
        +   * service Messaging {
        +   * rpc GetMessage(GetMessageRequest) returns (Message) {
        +   * option (google.api.http) = {
        +   * get: "/v1/{name=messages/*}"
        +   * };
        +   * }
        +   * }
        +   * message GetMessageRequest {
        +   * string name = 1; // Mapped to URL path.
        +   * }
        +   * message Message {
        +   * string text = 1; // The resource content.
        +   * }
        +   *
            * This enables an HTTP REST to gRPC mapping as below:
        -   * HTTP | gRPC
        -   * -----|-----
        -   * `GET /v1/messages/123456`  | `GetMessage(name: "messages/123456")`
        +   *
        +   * - HTTP: `GET /v1/messages/123456`
        +   * - gRPC: `GetMessage(name: "messages/123456")`
        +   *
            * Any fields in the request message which are not bound by the path template
            * automatically become HTTP query parameters if there is no HTTP request body.
            * For example:
        -   *     service Messaging {
        -   *       rpc GetMessage(GetMessageRequest) returns (Message) {
        -   *         option (google.api.http) = {
        -   *             get:"/v1/messages/{message_id}"
        -   *         };
        -   *       }
        -   *     }
        -   *     message GetMessageRequest {
        -   *       message SubMessage {
        -   *         string subfield = 1;
        -   *       }
        -   *       string message_id = 1; // Mapped to URL path.
        -   *       int64 revision = 2;    // Mapped to URL query parameter `revision`.
        -   *       SubMessage sub = 3;    // Mapped to URL query parameter `sub.subfield`.
        -   *     }
        +   *
        +   * service Messaging {
        +   * rpc GetMessage(GetMessageRequest) returns (Message) {
        +   * option (google.api.http) = {
        +   * get:"/v1/messages/{message_id}"
        +   * };
        +   * }
        +   * }
        +   * message GetMessageRequest {
        +   * message SubMessage {
        +   * string subfield = 1;
        +   * }
        +   * string message_id = 1; // Mapped to URL path.
        +   * int64 revision = 2;    // Mapped to URL query parameter `revision`.
        +   * SubMessage sub = 3;    // Mapped to URL query parameter `sub.subfield`.
        +   * }
        +   *
            * This enables a HTTP JSON to RPC mapping as below:
        -   * HTTP | gRPC
        -   * -----|-----
        -   * `GET /v1/messages/123456?revision=2&sub.subfield=foo` |
        -   * `GetMessage(message_id: "123456" revision: 2 sub: SubMessage(subfield:
        -   * "foo"))`
        +   *
        +   * - HTTP: `GET /v1/messages/123456?revision=2&sub.subfield=foo`
        +   * - gRPC: `GetMessage(message_id: "123456" revision: 2 sub:
        +   * SubMessage(subfield: "foo"))`
        +   *
            * Note that fields which are mapped to URL query parameters must have a
            * primitive type or a repeated primitive type or a non-repeated message type.
            * In the case of a repeated type, the parameter can be repeated in the URL
            * as `...?param=A&param=B`. In the case of a message type, each field of the
            * message is mapped to a separate parameter, such as
            * `...?foo.a=A&foo.b=B&foo.c=C`.
        +   *
            * For HTTP methods that allow a request body, the `body` field
            * specifies the mapping. Consider a REST update method on the
            * message resource collection:
        -   *     service Messaging {
        -   *       rpc UpdateMessage(UpdateMessageRequest) returns (Message) {
        -   *         option (google.api.http) = {
        -   *           patch: "/v1/messages/{message_id}"
        -   *           body: "message"
        -   *         };
        -   *       }
        -   *     }
        -   *     message UpdateMessageRequest {
        -   *       string message_id = 1; // mapped to the URL
        -   *       Message message = 2;   // mapped to the body
        -   *     }
        +   *
        +   * service Messaging {
        +   * rpc UpdateMessage(UpdateMessageRequest) returns (Message) {
        +   * option (google.api.http) = {
        +   * patch: "/v1/messages/{message_id}"
        +   * body: "message"
        +   * };
        +   * }
        +   * }
        +   * message UpdateMessageRequest {
        +   * string message_id = 1; // mapped to the URL
        +   * Message message = 2;   // mapped to the body
        +   * }
        +   *
            * The following HTTP JSON to RPC mapping is enabled, where the
            * representation of the JSON in the request body is determined by
            * protos JSON encoding:
        -   * HTTP | gRPC
        -   * -----|-----
        -   * `PATCH /v1/messages/123456 { "text": "Hi!" }` | `UpdateMessage(message_id:
        -   * "123456" message { text: "Hi!" })`
        +   *
        +   * - HTTP: `PATCH /v1/messages/123456 { "text": "Hi!" }`
        +   * - gRPC: `UpdateMessage(message_id: "123456" message { text: "Hi!" })`
        +   *
            * The special name `*` can be used in the body mapping to define that
            * every field not bound by the path template should be mapped to the
            * request body.  This enables the following alternative definition of
            * the update method:
        -   *     service Messaging {
        -   *       rpc UpdateMessage(Message) returns (Message) {
        -   *         option (google.api.http) = {
        -   *           patch: "/v1/messages/{message_id}"
        -   *           body: "*"
        -   *         };
        -   *       }
        -   *     }
        -   *     message Message {
        -   *       string message_id = 1;
        -   *       string text = 2;
        -   *     }
        +   *
        +   * service Messaging {
        +   * rpc UpdateMessage(Message) returns (Message) {
        +   * option (google.api.http) = {
        +   * patch: "/v1/messages/{message_id}"
        +   * body: "*"
        +   * };
        +   * }
        +   * }
        +   * message Message {
        +   * string message_id = 1;
        +   * string text = 2;
        +   * }
        +   *
        +   *
            * The following HTTP JSON to RPC mapping is enabled:
        -   * HTTP | gRPC
        -   * -----|-----
        -   * `PATCH /v1/messages/123456 { "text": "Hi!" }` | `UpdateMessage(message_id:
        -   * "123456" text: "Hi!")`
        +   *
        +   * - HTTP: `PATCH /v1/messages/123456 { "text": "Hi!" }`
        +   * - gRPC: `UpdateMessage(message_id: "123456" text: "Hi!")`
        +   *
            * Note that when using `*` in the body mapping, it is not possible to
            * have HTTP parameters, as all fields not bound by the path end in
            * the body. This makes this option more rarely used in practice when
            * defining REST APIs. The common usage of `*` is in custom methods
            * which don't use the URL at all for transferring data.
        +   *
            * It is possible to define multiple HTTP methods for one RPC by using
            * the `additional_bindings` option. Example:
        -   *     service Messaging {
        -   *       rpc GetMessage(GetMessageRequest) returns (Message) {
        -   *         option (google.api.http) = {
        -   *           get: "/v1/messages/{message_id}"
        -   *           additional_bindings {
        -   *             get: "/v1/users/{user_id}/messages/{message_id}"
        -   *           }
        -   *         };
        -   *       }
        -   *     }
        -   *     message GetMessageRequest {
        -   *       string message_id = 1;
        -   *       string user_id = 2;
        -   *     }
        +   *
        +   * service Messaging {
        +   * rpc GetMessage(GetMessageRequest) returns (Message) {
        +   * option (google.api.http) = {
        +   * get: "/v1/messages/{message_id}"
        +   * additional_bindings {
        +   * get: "/v1/users/{user_id}/messages/{message_id}"
        +   * }
        +   * };
        +   * }
        +   * }
        +   * message GetMessageRequest {
        +   * string message_id = 1;
        +   * string user_id = 2;
        +   * }
        +   *
            * This enables the following two alternative HTTP JSON to RPC mappings:
        -   * HTTP | gRPC
        -   * -----|-----
        -   * `GET /v1/messages/123456` | `GetMessage(message_id: "123456")`
        -   * `GET /v1/users/me/messages/123456` | `GetMessage(user_id: "me" message_id:
        -   * "123456")`
        -   * ## Rules for HTTP mapping
        +   *
        +   * - HTTP: `GET /v1/messages/123456`
        +   * - gRPC: `GetMessage(message_id: "123456")`
        +   *
        +   * - HTTP: `GET /v1/users/me/messages/123456`
        +   * - gRPC: `GetMessage(user_id: "me" message_id: "123456")`
        +   *
        +   * Rules for HTTP mapping
        +   *
            * 1. Leaf request fields (recursive expansion nested messages in the request
        -   *    message) are classified into three categories:
        -   *    - Fields referred by the path template. They are passed via the URL path.
        -   *    - Fields referred by the [HttpRule.body][google.api.HttpRule.body]. They are passed via the HTTP
        -   *      request body.
        -   *    - All other fields are passed via the URL query parameters, and the
        -   *      parameter name is the field path in the request message. A repeated
        -   *      field can be represented as multiple query parameters under the same
        -   *      name.
        -   *  2. If [HttpRule.body][google.api.HttpRule.body] is "*", there is no URL query parameter, all fields
        -   *     are passed via URL path and HTTP request body.
        -   *  3. If [HttpRule.body][google.api.HttpRule.body] is omitted, there is no HTTP request body, all
        -   *     fields are passed via URL path and URL query parameters.
        -   * ### Path template syntax
        -   *     Template = "/" Segments [ Verb ] ;
        -   *     Segments = Segment { "/" Segment } ;
        -   *     Segment  = "*" | "**" | LITERAL | Variable ;
        -   *     Variable = "{" FieldPath [ "=" Segments ] "}" ;
        -   *     FieldPath = IDENT { "." IDENT } ;
        -   *     Verb     = ":" LITERAL ;
        +   * message) are classified into three categories:
        +   * - Fields referred by the path template. They are passed via the URL path.
        +   * - Fields referred by the [HttpRule.body][google.api.HttpRule.body]. They
        +   * are passed via the HTTP
        +   * request body.
        +   * - All other fields are passed via the URL query parameters, and the
        +   * parameter name is the field path in the request message. A repeated
        +   * field can be represented as multiple query parameters under the same
        +   * name.
        +   * 2. If [HttpRule.body][google.api.HttpRule.body] is "*", there is no URL
        +   * query parameter, all fields
        +   * are passed via URL path and HTTP request body.
        +   * 3. If [HttpRule.body][google.api.HttpRule.body] is omitted, there is no HTTP
        +   * request body, all
        +   * fields are passed via URL path and URL query parameters.
        +   *
        +   * Path template syntax
        +   *
        +   * Template = "/" Segments [ Verb ] ;
        +   * Segments = Segment { "/" Segment } ;
        +   * Segment  = "*" | "**" | LITERAL | Variable ;
        +   * Variable = "{" FieldPath [ "=" Segments ] "}" ;
        +   * FieldPath = IDENT { "." IDENT } ;
        +   * Verb     = ":" LITERAL ;
        +   *
            * The syntax `*` matches a single URL path segment. The syntax `**` matches
            * zero or more URL path segments, which must be the last part of the URL path
            * except the `Verb`.
        +   *
            * The syntax `Variable` matches part of the URL path as specified by its
            * template. A variable template must not contain other variables. If a variable
            * matches a single path segment, its template may be omitted, e.g. `{var}`
            * is equivalent to `{var=*}`.
        +   *
            * The syntax `LITERAL` matches literal text in the URL path. If the `LITERAL`
            * contains any reserved character, such characters should be percent-encoded
            * before the matching.
        +   *
            * If a variable contains exactly one path segment, such as `"{var}"` or
            * `"{var=*}"`, when such a variable is expanded into a URL path on the client
            * side, all characters except `[-_.~0-9a-zA-Z]` are percent-encoded. The
        @@ -1459,6 +1583,7 @@ protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.Build
            * [Discovery
            * Document](https://developers.google.com/discovery/v1/reference/apis) as
            * `{var}`.
        +   *
            * If a variable contains multiple path segments, such as `"{var=foo/*}"`
            * or `"{var=**}"`, when such a variable is expanded into a URL path on the
            * client side, all characters except `[-_.~/0-9a-zA-Z]` are percent-encoded.
        @@ -1467,11 +1592,14 @@ protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.Build
            * [Discovery
            * Document](https://developers.google.com/discovery/v1/reference/apis) as
            * `{+var}`.
        -   * ## Using gRPC API Service Configuration
        +   *
        +   * Using gRPC API Service Configuration
        +   *
            * gRPC API Service Configuration (service config) is a configuration language
            * for configuring a gRPC service to become a user-facing product. The
            * service config is simply the YAML representation of the `google.api.Service`
            * proto message.
        +   *
            * As an alternative to annotating your proto file, you can configure gRPC
            * transcoding in your service config YAML files. You do this by specifying a
            * `HttpRule` that maps the gRPC method to a REST endpoint, achieving the same
        @@ -1479,16 +1607,20 @@ protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.Build
            * have a proto that is reused in multiple services. Note that any transcoding
            * specified in the service config will override any matching transcoding
            * configuration in the proto.
        -   * Example:
        -   *     http:
        -   *       rules:
        -   *         # Selects a gRPC method and applies HttpRule to it.
        -   *         - selector: example.v1.Messaging.GetMessage
        -   *           get: /v1/messages/{message_id}/{sub.subfield}
        -   * ## Special notes
        +   *
        +   * The following example selects a gRPC method and applies an `HttpRule` to it:
        +   *
        +   * http:
        +   * rules:
        +   * - selector: example.v1.Messaging.GetMessage
        +   * get: /v1/messages/{message_id}/{sub.subfield}
        +   *
        +   * Special notes
        +   *
            * When gRPC Transcoding is used to map a gRPC to JSON REST endpoints, the
            * proto to JSON conversion must follow the [proto3
            * specification](https://developers.google.com/protocol-buffers/docs/proto3#json).
        +   *
            * While the single segment variable follows the semantics of
            * [RFC 6570](https://tools.ietf.org/html/rfc6570) Section 3.2.2 Simple String
            * Expansion, the multi segment variable **does not** follow RFC 6570 Section
        @@ -1496,13 +1628,17 @@ protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.Build
            * does not expand special characters like `?` and `#`, which would lead
            * to invalid URLs. As the result, gRPC Transcoding uses a custom encoding
            * for multi segment variables.
        +   *
            * The path variables **must not** refer to any repeated or mapped field,
            * because client libraries are not capable of handling such variable expansion.
        +   *
            * The path variables **must not** capture the leading "/" character. The reason
            * is that the most common use case "{var}" does not capture the leading "/"
            * character. For consistency, all path variables must share the same behavior.
        +   *
            * Repeated message fields must not be mapped to URL query parameters, because
            * no client library can support such complicated mapping.
        +   *
            * If an API needs to use a JSON array for request or response body, it can map
            * the request or response body to a repeated field. However, some gRPC
            * Transcoding implementations may not support this feature.
        @@ -1510,7 +1646,7 @@ protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.Build
            *
            * Protobuf type {@code google.api.HttpRule}
            */
        -  public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder
        +  public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder
               implements
               // @@protoc_insertion_point(builder_implements:google.api.HttpRule)
               com.google.api.HttpRuleOrBuilder {
        @@ -1519,7 +1655,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
             }
         
             @java.lang.Override
        -    protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
        +    protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
                 internalGetFieldAccessorTable() {
               return com.google.api.HttpProto.internal_static_google_api_HttpRule_fieldAccessorTable
                   .ensureFieldAccessorsInitialized(
        @@ -1529,29 +1665,27 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
             // Construct using com.google.api.HttpRule.newBuilder()
             private Builder() {}
         
        -    private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
        +    private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) {
               super(parent);
             }
         
             @java.lang.Override
             public Builder clear() {
               super.clear();
        +      bitField0_ = 0;
               selector_ = "";
        -
               if (customBuilder_ != null) {
                 customBuilder_.clear();
               }
               body_ = "";
        -
               responseBody_ = "";
        -
               if (additionalBindingsBuilder_ == null) {
                 additionalBindings_ = java.util.Collections.emptyList();
               } else {
                 additionalBindings_ = null;
                 additionalBindingsBuilder_.clear();
               }
        -      bitField0_ = (bitField0_ & ~0x00000001);
        +      bitField0_ = (bitField0_ & ~0x00000200);
               patternCase_ = 0;
               pattern_ = null;
               return this;
        @@ -1579,77 +1713,46 @@ public com.google.api.HttpRule build() {
             @java.lang.Override
             public com.google.api.HttpRule buildPartial() {
               com.google.api.HttpRule result = new com.google.api.HttpRule(this);
        -      int from_bitField0_ = bitField0_;
        -      result.selector_ = selector_;
        -      if (patternCase_ == 2) {
        -        result.pattern_ = pattern_;
        +      buildPartialRepeatedFields(result);
        +      if (bitField0_ != 0) {
        +        buildPartial0(result);
               }
        -      if (patternCase_ == 3) {
        -        result.pattern_ = pattern_;
        -      }
        -      if (patternCase_ == 4) {
        -        result.pattern_ = pattern_;
        -      }
        -      if (patternCase_ == 5) {
        -        result.pattern_ = pattern_;
        -      }
        -      if (patternCase_ == 6) {
        -        result.pattern_ = pattern_;
        -      }
        -      if (patternCase_ == 8) {
        -        if (customBuilder_ == null) {
        -          result.pattern_ = pattern_;
        -        } else {
        -          result.pattern_ = customBuilder_.build();
        -        }
        -      }
        -      result.body_ = body_;
        -      result.responseBody_ = responseBody_;
        +      buildPartialOneofs(result);
        +      onBuilt();
        +      return result;
        +    }
        +
        +    private void buildPartialRepeatedFields(com.google.api.HttpRule result) {
               if (additionalBindingsBuilder_ == null) {
        -        if (((bitField0_ & 0x00000001) != 0)) {
        +        if (((bitField0_ & 0x00000200) != 0)) {
                   additionalBindings_ = java.util.Collections.unmodifiableList(additionalBindings_);
        -          bitField0_ = (bitField0_ & ~0x00000001);
        +          bitField0_ = (bitField0_ & ~0x00000200);
                 }
                 result.additionalBindings_ = additionalBindings_;
               } else {
                 result.additionalBindings_ = additionalBindingsBuilder_.build();
               }
        -      result.patternCase_ = patternCase_;
        -      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);
        +    private void buildPartial0(com.google.api.HttpRule result) {
        +      int from_bitField0_ = bitField0_;
        +      if (((from_bitField0_ & 0x00000001) != 0)) {
        +        result.selector_ = selector_;
        +      }
        +      if (((from_bitField0_ & 0x00000080) != 0)) {
        +        result.body_ = body_;
        +      }
        +      if (((from_bitField0_ & 0x00000100) != 0)) {
        +        result.responseBody_ = responseBody_;
        +      }
             }
         
        -    @java.lang.Override
        -    public Builder addRepeatedField(
        -        com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) {
        -      return super.addRepeatedField(field, value);
        +    private void buildPartialOneofs(com.google.api.HttpRule result) {
        +      result.patternCase_ = patternCase_;
        +      result.pattern_ = this.pattern_;
        +      if (patternCase_ == 8 && customBuilder_ != null) {
        +        result.pattern_ = customBuilder_.build();
        +      }
             }
         
             @java.lang.Override
        @@ -1666,21 +1769,24 @@ public Builder mergeFrom(com.google.api.HttpRule other) {
               if (other == com.google.api.HttpRule.getDefaultInstance()) return this;
               if (!other.getSelector().isEmpty()) {
                 selector_ = other.selector_;
        +        bitField0_ |= 0x00000001;
                 onChanged();
               }
               if (!other.getBody().isEmpty()) {
                 body_ = other.body_;
        +        bitField0_ |= 0x00000080;
                 onChanged();
               }
               if (!other.getResponseBody().isEmpty()) {
                 responseBody_ = other.responseBody_;
        +        bitField0_ |= 0x00000100;
                 onChanged();
               }
               if (additionalBindingsBuilder_ == null) {
                 if (!other.additionalBindings_.isEmpty()) {
                   if (additionalBindings_.isEmpty()) {
                     additionalBindings_ = other.additionalBindings_;
        -            bitField0_ = (bitField0_ & ~0x00000001);
        +            bitField0_ = (bitField0_ & ~0x00000200);
                   } else {
                     ensureAdditionalBindingsIsMutable();
                     additionalBindings_.addAll(other.additionalBindings_);
        @@ -1693,10 +1799,10 @@ public Builder mergeFrom(com.google.api.HttpRule other) {
                     additionalBindingsBuilder_.dispose();
                     additionalBindingsBuilder_ = null;
                     additionalBindings_ = other.additionalBindings_;
        -            bitField0_ = (bitField0_ & ~0x00000001);
        +            bitField0_ = (bitField0_ & ~0x00000200);
                     additionalBindingsBuilder_ =
        -                com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders
        -                    ? getAdditionalBindingsFieldBuilder()
        +                com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders
        +                    ? internalGetAdditionalBindingsFieldBuilder()
                             : null;
                   } else {
                     additionalBindingsBuilder_.addAllMessages(other.additionalBindings_);
        @@ -1778,7 +1884,7 @@ public Builder mergeFrom(
                     case 10:
                       {
                         selector_ = input.readStringRequireUtf8();
        -
        +                bitField0_ |= 0x00000001;
                         break;
                       } // case 10
                     case 18:
        @@ -1819,12 +1925,12 @@ public Builder mergeFrom(
                     case 58:
                       {
                         body_ = input.readStringRequireUtf8();
        -
        +                bitField0_ |= 0x00000080;
                         break;
                       } // case 58
                     case 66:
                       {
        -                input.readMessage(getCustomFieldBuilder().getBuilder(), extensionRegistry);
        +                input.readMessage(internalGetCustomFieldBuilder().getBuilder(), extensionRegistry);
                         patternCase_ = 8;
                         break;
                       } // case 66
        @@ -1843,7 +1949,7 @@ public Builder mergeFrom(
                     case 98:
                       {
                         responseBody_ = input.readStringRequireUtf8();
        -
        +                bitField0_ |= 0x00000100;
                         break;
                       } // case 98
                     default:
        @@ -1880,12 +1986,15 @@ public Builder clearPattern() {
             private int bitField0_;
         
             private java.lang.Object selector_ = "";
        +
             /**
              *
              *
              * 
              * Selects a method to which this rule applies.
        -     * Refer to [selector][google.api.DocumentationRule.selector] for syntax details.
        +     *
        +     * Refer to [selector][google.api.DocumentationRule.selector] for syntax
        +     * details.
              * 
        * * string selector = 1; @@ -1903,12 +2012,15 @@ public java.lang.String getSelector() { return (java.lang.String) ref; } } + /** * * *
              * Selects a method to which this rule applies.
        -     * Refer to [selector][google.api.DocumentationRule.selector] for syntax details.
        +     *
        +     * Refer to [selector][google.api.DocumentationRule.selector] for syntax
        +     * details.
              * 
        * * string selector = 1; @@ -1926,12 +2038,15 @@ public com.google.protobuf.ByteString getSelectorBytes() { return (com.google.protobuf.ByteString) ref; } } + /** * * *
              * Selects a method to which this rule applies.
        -     * Refer to [selector][google.api.DocumentationRule.selector] for syntax details.
        +     *
        +     * Refer to [selector][google.api.DocumentationRule.selector] for syntax
        +     * details.
              * 
        * * string selector = 1; @@ -1943,17 +2058,20 @@ public Builder setSelector(java.lang.String value) { if (value == null) { throw new NullPointerException(); } - selector_ = value; + bitField0_ |= 0x00000001; onChanged(); return this; } + /** * * *
              * Selects a method to which this rule applies.
        -     * Refer to [selector][google.api.DocumentationRule.selector] for syntax details.
        +     *
        +     * Refer to [selector][google.api.DocumentationRule.selector] for syntax
        +     * details.
              * 
        * * string selector = 1; @@ -1961,17 +2079,20 @@ public Builder setSelector(java.lang.String value) { * @return This builder for chaining. */ public Builder clearSelector() { - selector_ = getDefaultInstance().getSelector(); + bitField0_ = (bitField0_ & ~0x00000001); onChanged(); return this; } + /** * * *
              * Selects a method to which this rule applies.
        -     * Refer to [selector][google.api.DocumentationRule.selector] for syntax details.
        +     *
        +     * Refer to [selector][google.api.DocumentationRule.selector] for syntax
        +     * details.
              * 
        * * string selector = 1; @@ -1984,8 +2105,8 @@ public Builder setSelectorBytes(com.google.protobuf.ByteString value) { throw new NullPointerException(); } checkByteStringIsUtf8(value); - selector_ = value; + bitField0_ |= 0x00000001; onChanged(); return this; } @@ -2006,6 +2127,7 @@ public Builder setSelectorBytes(com.google.protobuf.ByteString value) { public boolean hasGet() { return patternCase_ == 2; } + /** * * @@ -2035,6 +2157,7 @@ public java.lang.String getGet() { return (java.lang.String) ref; } } + /** * * @@ -2064,6 +2187,7 @@ public com.google.protobuf.ByteString getGetBytes() { return (com.google.protobuf.ByteString) ref; } } + /** * * @@ -2086,6 +2210,7 @@ public Builder setGet(java.lang.String value) { onChanged(); return this; } + /** * * @@ -2106,6 +2231,7 @@ public Builder clearGet() { } return this; } + /** * * @@ -2145,6 +2271,7 @@ public Builder setGetBytes(com.google.protobuf.ByteString value) { public boolean hasPut() { return patternCase_ == 3; } + /** * * @@ -2173,6 +2300,7 @@ public java.lang.String getPut() { return (java.lang.String) ref; } } + /** * * @@ -2201,6 +2329,7 @@ public com.google.protobuf.ByteString getPutBytes() { return (com.google.protobuf.ByteString) ref; } } + /** * * @@ -2222,6 +2351,7 @@ public Builder setPut(java.lang.String value) { onChanged(); return this; } + /** * * @@ -2241,6 +2371,7 @@ public Builder clearPut() { } return this; } + /** * * @@ -2279,6 +2410,7 @@ public Builder setPutBytes(com.google.protobuf.ByteString value) { public boolean hasPost() { return patternCase_ == 4; } + /** * * @@ -2307,6 +2439,7 @@ public java.lang.String getPost() { return (java.lang.String) ref; } } + /** * * @@ -2335,6 +2468,7 @@ public com.google.protobuf.ByteString getPostBytes() { return (com.google.protobuf.ByteString) ref; } } + /** * * @@ -2356,6 +2490,7 @@ public Builder setPost(java.lang.String value) { onChanged(); return this; } + /** * * @@ -2375,6 +2510,7 @@ public Builder clearPost() { } return this; } + /** * * @@ -2413,6 +2549,7 @@ public Builder setPostBytes(com.google.protobuf.ByteString value) { public boolean hasDelete() { return patternCase_ == 5; } + /** * * @@ -2441,6 +2578,7 @@ public java.lang.String getDelete() { return (java.lang.String) ref; } } + /** * * @@ -2469,6 +2607,7 @@ public com.google.protobuf.ByteString getDeleteBytes() { return (com.google.protobuf.ByteString) ref; } } + /** * * @@ -2490,6 +2629,7 @@ public Builder setDelete(java.lang.String value) { onChanged(); return this; } + /** * * @@ -2509,6 +2649,7 @@ public Builder clearDelete() { } return this; } + /** * * @@ -2547,6 +2688,7 @@ public Builder setDeleteBytes(com.google.protobuf.ByteString value) { public boolean hasPatch() { return patternCase_ == 6; } + /** * * @@ -2575,6 +2717,7 @@ public java.lang.String getPatch() { return (java.lang.String) ref; } } + /** * * @@ -2603,6 +2746,7 @@ public com.google.protobuf.ByteString getPatchBytes() { return (com.google.protobuf.ByteString) ref; } } + /** * * @@ -2624,6 +2768,7 @@ public Builder setPatch(java.lang.String value) { onChanged(); return this; } + /** * * @@ -2643,6 +2788,7 @@ public Builder clearPatch() { } return this; } + /** * * @@ -2666,11 +2812,12 @@ public Builder setPatchBytes(com.google.protobuf.ByteString value) { return this; } - private com.google.protobuf.SingleFieldBuilderV3< + private com.google.protobuf.SingleFieldBuilder< com.google.api.CustomHttpPattern, com.google.api.CustomHttpPattern.Builder, com.google.api.CustomHttpPatternOrBuilder> customBuilder_; + /** * * @@ -2689,6 +2836,7 @@ public Builder setPatchBytes(com.google.protobuf.ByteString value) { public boolean hasCustom() { return patternCase_ == 8; } + /** * * @@ -2717,6 +2865,7 @@ public com.google.api.CustomHttpPattern getCustom() { return com.google.api.CustomHttpPattern.getDefaultInstance(); } } + /** * * @@ -2742,6 +2891,7 @@ public Builder setCustom(com.google.api.CustomHttpPattern value) { patternCase_ = 8; return this; } + /** * * @@ -2764,6 +2914,7 @@ public Builder setCustom(com.google.api.CustomHttpPattern.Builder builderForValu patternCase_ = 8; return this; } + /** * * @@ -2799,6 +2950,7 @@ public Builder mergeCustom(com.google.api.CustomHttpPattern value) { patternCase_ = 8; return this; } + /** * * @@ -2827,6 +2979,7 @@ public Builder clearCustom() { } return this; } + /** * * @@ -2840,8 +2993,9 @@ public Builder clearCustom() { * .google.api.CustomHttpPattern custom = 8; */ public com.google.api.CustomHttpPattern.Builder getCustomBuilder() { - return getCustomFieldBuilder().getBuilder(); + return internalGetCustomFieldBuilder().getBuilder(); } + /** * * @@ -2865,6 +3019,7 @@ public com.google.api.CustomHttpPatternOrBuilder getCustomOrBuilder() { return com.google.api.CustomHttpPattern.getDefaultInstance(); } } + /** * * @@ -2877,17 +3032,17 @@ public com.google.api.CustomHttpPatternOrBuilder getCustomOrBuilder() { * * .google.api.CustomHttpPattern custom = 8; */ - private com.google.protobuf.SingleFieldBuilderV3< + private com.google.protobuf.SingleFieldBuilder< com.google.api.CustomHttpPattern, com.google.api.CustomHttpPattern.Builder, com.google.api.CustomHttpPatternOrBuilder> - getCustomFieldBuilder() { + internalGetCustomFieldBuilder() { if (customBuilder_ == null) { if (!(patternCase_ == 8)) { pattern_ = com.google.api.CustomHttpPattern.getDefaultInstance(); } customBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< + new com.google.protobuf.SingleFieldBuilder< com.google.api.CustomHttpPattern, com.google.api.CustomHttpPattern.Builder, com.google.api.CustomHttpPatternOrBuilder>( @@ -2896,11 +3051,11 @@ public com.google.api.CustomHttpPatternOrBuilder getCustomOrBuilder() { } patternCase_ = 8; onChanged(); - ; return customBuilder_; } private java.lang.Object body_ = ""; + /** * * @@ -2908,6 +3063,7 @@ public com.google.api.CustomHttpPatternOrBuilder getCustomOrBuilder() { * The name of the request field whose value is mapped to the HTTP request * body, or `*` for mapping all request fields not captured by the path * pattern to the HTTP body, or omitted for not having any HTTP request body. + * * NOTE: the referred field must be present at the top-level of the request * message type. *
        @@ -2927,6 +3083,7 @@ public java.lang.String getBody() { return (java.lang.String) ref; } } + /** * * @@ -2934,6 +3091,7 @@ public java.lang.String getBody() { * The name of the request field whose value is mapped to the HTTP request * body, or `*` for mapping all request fields not captured by the path * pattern to the HTTP body, or omitted for not having any HTTP request body. + * * NOTE: the referred field must be present at the top-level of the request * message type. * @@ -2953,6 +3111,7 @@ public com.google.protobuf.ByteString getBodyBytes() { return (com.google.protobuf.ByteString) ref; } } + /** * * @@ -2960,6 +3119,7 @@ public com.google.protobuf.ByteString getBodyBytes() { * The name of the request field whose value is mapped to the HTTP request * body, or `*` for mapping all request fields not captured by the path * pattern to the HTTP body, or omitted for not having any HTTP request body. + * * NOTE: the referred field must be present at the top-level of the request * message type. * @@ -2973,11 +3133,12 @@ public Builder setBody(java.lang.String value) { if (value == null) { throw new NullPointerException(); } - body_ = value; + bitField0_ |= 0x00000080; onChanged(); return this; } + /** * * @@ -2985,6 +3146,7 @@ public Builder setBody(java.lang.String value) { * The name of the request field whose value is mapped to the HTTP request * body, or `*` for mapping all request fields not captured by the path * pattern to the HTTP body, or omitted for not having any HTTP request body. + * * NOTE: the referred field must be present at the top-level of the request * message type. * @@ -2994,11 +3156,12 @@ public Builder setBody(java.lang.String value) { * @return This builder for chaining. */ public Builder clearBody() { - body_ = getDefaultInstance().getBody(); + bitField0_ = (bitField0_ & ~0x00000080); onChanged(); return this; } + /** * * @@ -3006,6 +3169,7 @@ public Builder clearBody() { * The name of the request field whose value is mapped to the HTTP request * body, or `*` for mapping all request fields not captured by the path * pattern to the HTTP body, or omitted for not having any HTTP request body. + * * NOTE: the referred field must be present at the top-level of the request * message type. * @@ -3020,13 +3184,14 @@ public Builder setBodyBytes(com.google.protobuf.ByteString value) { throw new NullPointerException(); } checkByteStringIsUtf8(value); - body_ = value; + bitField0_ |= 0x00000080; onChanged(); return this; } private java.lang.Object responseBody_ = ""; + /** * * @@ -3034,6 +3199,7 @@ public Builder setBodyBytes(com.google.protobuf.ByteString value) { * Optional. The name of the response field whose value is mapped to the HTTP * response body. When omitted, the entire response message will be used * as the HTTP response body. + * * NOTE: The referred field must be present at the top-level of the response * message type. * @@ -3053,6 +3219,7 @@ public java.lang.String getResponseBody() { return (java.lang.String) ref; } } + /** * * @@ -3060,6 +3227,7 @@ public java.lang.String getResponseBody() { * Optional. The name of the response field whose value is mapped to the HTTP * response body. When omitted, the entire response message will be used * as the HTTP response body. + * * NOTE: The referred field must be present at the top-level of the response * message type. * @@ -3079,6 +3247,7 @@ public com.google.protobuf.ByteString getResponseBodyBytes() { return (com.google.protobuf.ByteString) ref; } } + /** * * @@ -3086,6 +3255,7 @@ public com.google.protobuf.ByteString getResponseBodyBytes() { * Optional. The name of the response field whose value is mapped to the HTTP * response body. When omitted, the entire response message will be used * as the HTTP response body. + * * NOTE: The referred field must be present at the top-level of the response * message type. * @@ -3099,11 +3269,12 @@ public Builder setResponseBody(java.lang.String value) { if (value == null) { throw new NullPointerException(); } - responseBody_ = value; + bitField0_ |= 0x00000100; onChanged(); return this; } + /** * * @@ -3111,6 +3282,7 @@ public Builder setResponseBody(java.lang.String value) { * Optional. The name of the response field whose value is mapped to the HTTP * response body. When omitted, the entire response message will be used * as the HTTP response body. + * * NOTE: The referred field must be present at the top-level of the response * message type. * @@ -3120,11 +3292,12 @@ public Builder setResponseBody(java.lang.String value) { * @return This builder for chaining. */ public Builder clearResponseBody() { - responseBody_ = getDefaultInstance().getResponseBody(); + bitField0_ = (bitField0_ & ~0x00000100); onChanged(); return this; } + /** * * @@ -3132,6 +3305,7 @@ public Builder clearResponseBody() { * Optional. The name of the response field whose value is mapped to the HTTP * response body. When omitted, the entire response message will be used * as the HTTP response body. + * * NOTE: The referred field must be present at the top-level of the response * message type. * @@ -3146,8 +3320,8 @@ public Builder setResponseBodyBytes(com.google.protobuf.ByteString value) { throw new NullPointerException(); } checkByteStringIsUtf8(value); - responseBody_ = value; + bitField0_ |= 0x00000100; onChanged(); return this; } @@ -3156,13 +3330,13 @@ public Builder setResponseBodyBytes(com.google.protobuf.ByteString value) { java.util.Collections.emptyList(); private void ensureAdditionalBindingsIsMutable() { - if (!((bitField0_ & 0x00000001) != 0)) { + if (!((bitField0_ & 0x00000200) != 0)) { additionalBindings_ = new java.util.ArrayList(additionalBindings_); - bitField0_ |= 0x00000001; + bitField0_ |= 0x00000200; } } - private com.google.protobuf.RepeatedFieldBuilderV3< + private com.google.protobuf.RepeatedFieldBuilder< com.google.api.HttpRule, com.google.api.HttpRule.Builder, com.google.api.HttpRuleOrBuilder> @@ -3186,6 +3360,7 @@ public java.util.List getAdditionalBindingsList() { return additionalBindingsBuilder_.getMessageList(); } } + /** * * @@ -3204,6 +3379,7 @@ public int getAdditionalBindingsCount() { return additionalBindingsBuilder_.getCount(); } } + /** * * @@ -3222,6 +3398,7 @@ public com.google.api.HttpRule getAdditionalBindings(int index) { return additionalBindingsBuilder_.getMessage(index); } } + /** * * @@ -3246,6 +3423,7 @@ public Builder setAdditionalBindings(int index, com.google.api.HttpRule value) { } return this; } + /** * * @@ -3268,6 +3446,7 @@ public Builder setAdditionalBindings( } return this; } + /** * * @@ -3292,6 +3471,7 @@ public Builder addAdditionalBindings(com.google.api.HttpRule value) { } return this; } + /** * * @@ -3316,6 +3496,7 @@ public Builder addAdditionalBindings(int index, com.google.api.HttpRule value) { } return this; } + /** * * @@ -3337,6 +3518,7 @@ public Builder addAdditionalBindings(com.google.api.HttpRule.Builder builderForV } return this; } + /** * * @@ -3359,6 +3541,7 @@ public Builder addAdditionalBindings( } return this; } + /** * * @@ -3381,6 +3564,7 @@ public Builder addAllAdditionalBindings( } return this; } + /** * * @@ -3395,13 +3579,14 @@ public Builder addAllAdditionalBindings( public Builder clearAdditionalBindings() { if (additionalBindingsBuilder_ == null) { additionalBindings_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); + bitField0_ = (bitField0_ & ~0x00000200); onChanged(); } else { additionalBindingsBuilder_.clear(); } return this; } + /** * * @@ -3423,6 +3608,7 @@ public Builder removeAdditionalBindings(int index) { } return this; } + /** * * @@ -3435,8 +3621,9 @@ public Builder removeAdditionalBindings(int index) { * repeated .google.api.HttpRule additional_bindings = 11; */ public com.google.api.HttpRule.Builder getAdditionalBindingsBuilder(int index) { - return getAdditionalBindingsFieldBuilder().getBuilder(index); + return internalGetAdditionalBindingsFieldBuilder().getBuilder(index); } + /** * * @@ -3455,6 +3642,7 @@ public com.google.api.HttpRuleOrBuilder getAdditionalBindingsOrBuilder(int index return additionalBindingsBuilder_.getMessageOrBuilder(index); } } + /** * * @@ -3474,6 +3662,7 @@ public com.google.api.HttpRuleOrBuilder getAdditionalBindingsOrBuilder(int index return java.util.Collections.unmodifiableList(additionalBindings_); } } + /** * * @@ -3486,9 +3675,10 @@ public com.google.api.HttpRuleOrBuilder getAdditionalBindingsOrBuilder(int index * repeated .google.api.HttpRule additional_bindings = 11; */ public com.google.api.HttpRule.Builder addAdditionalBindingsBuilder() { - return getAdditionalBindingsFieldBuilder() + return internalGetAdditionalBindingsFieldBuilder() .addBuilder(com.google.api.HttpRule.getDefaultInstance()); } + /** * * @@ -3501,9 +3691,10 @@ public com.google.api.HttpRule.Builder addAdditionalBindingsBuilder() { * repeated .google.api.HttpRule additional_bindings = 11; */ public com.google.api.HttpRule.Builder addAdditionalBindingsBuilder(int index) { - return getAdditionalBindingsFieldBuilder() + return internalGetAdditionalBindingsFieldBuilder() .addBuilder(index, com.google.api.HttpRule.getDefaultInstance()); } + /** * * @@ -3516,22 +3707,22 @@ public com.google.api.HttpRule.Builder addAdditionalBindingsBuilder(int index) { * repeated .google.api.HttpRule additional_bindings = 11; */ public java.util.List getAdditionalBindingsBuilderList() { - return getAdditionalBindingsFieldBuilder().getBuilderList(); + return internalGetAdditionalBindingsFieldBuilder().getBuilderList(); } - private com.google.protobuf.RepeatedFieldBuilderV3< + private com.google.protobuf.RepeatedFieldBuilder< com.google.api.HttpRule, com.google.api.HttpRule.Builder, com.google.api.HttpRuleOrBuilder> - getAdditionalBindingsFieldBuilder() { + internalGetAdditionalBindingsFieldBuilder() { if (additionalBindingsBuilder_ == null) { additionalBindingsBuilder_ = - new com.google.protobuf.RepeatedFieldBuilderV3< + new com.google.protobuf.RepeatedFieldBuilder< com.google.api.HttpRule, com.google.api.HttpRule.Builder, com.google.api.HttpRuleOrBuilder>( additionalBindings_, - ((bitField0_ & 0x00000001) != 0), + ((bitField0_ & 0x00000200) != 0), getParentForChildren(), isClean()); additionalBindings_ = null; @@ -3539,17 +3730,6 @@ public java.util.List getAdditionalBindingsBuil return additionalBindingsBuilder_; } - @java.lang.Override - public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - // @@protoc_insertion_point(builder_scope:google.api.HttpRule) } diff --git a/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/HttpRuleOrBuilder.java b/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/HttpRuleOrBuilder.java index 85b2a1e7c9..e4f16afbae 100644 --- a/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/HttpRuleOrBuilder.java +++ b/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/HttpRuleOrBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,10 +14,13 @@ * limitations under the License. */ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: google/api/http.proto +// Protobuf Java Version: 4.33.2 package com.google.api; +@com.google.protobuf.Generated public interface HttpRuleOrBuilder extends // @@protoc_insertion_point(interface_extends:google.api.HttpRule) @@ -28,7 +31,9 @@ public interface HttpRuleOrBuilder * *
            * Selects a method to which this rule applies.
        -   * Refer to [selector][google.api.DocumentationRule.selector] for syntax details.
        +   *
        +   * Refer to [selector][google.api.DocumentationRule.selector] for syntax
        +   * details.
            * 
        * * string selector = 1; @@ -36,12 +41,15 @@ public interface HttpRuleOrBuilder * @return The selector. */ java.lang.String getSelector(); + /** * * *
            * Selects a method to which this rule applies.
        -   * Refer to [selector][google.api.DocumentationRule.selector] for syntax details.
        +   *
        +   * Refer to [selector][google.api.DocumentationRule.selector] for syntax
        +   * details.
            * 
        * * string selector = 1; @@ -63,6 +71,7 @@ public interface HttpRuleOrBuilder * @return Whether the get field is set. */ boolean hasGet(); + /** * * @@ -76,6 +85,7 @@ public interface HttpRuleOrBuilder * @return The get. */ java.lang.String getGet(); + /** * * @@ -102,6 +112,7 @@ public interface HttpRuleOrBuilder * @return Whether the put field is set. */ boolean hasPut(); + /** * * @@ -114,6 +125,7 @@ public interface HttpRuleOrBuilder * @return The put. */ java.lang.String getPut(); + /** * * @@ -139,6 +151,7 @@ public interface HttpRuleOrBuilder * @return Whether the post field is set. */ boolean hasPost(); + /** * * @@ -151,6 +164,7 @@ public interface HttpRuleOrBuilder * @return The post. */ java.lang.String getPost(); + /** * * @@ -176,6 +190,7 @@ public interface HttpRuleOrBuilder * @return Whether the delete field is set. */ boolean hasDelete(); + /** * * @@ -188,6 +203,7 @@ public interface HttpRuleOrBuilder * @return The delete. */ java.lang.String getDelete(); + /** * * @@ -213,6 +229,7 @@ public interface HttpRuleOrBuilder * @return Whether the patch field is set. */ boolean hasPatch(); + /** * * @@ -225,6 +242,7 @@ public interface HttpRuleOrBuilder * @return The patch. */ java.lang.String getPatch(); + /** * * @@ -253,6 +271,7 @@ public interface HttpRuleOrBuilder * @return Whether the custom field is set. */ boolean hasCustom(); + /** * * @@ -268,6 +287,7 @@ public interface HttpRuleOrBuilder * @return The custom. */ com.google.api.CustomHttpPattern getCustom(); + /** * * @@ -289,6 +309,7 @@ public interface HttpRuleOrBuilder * The name of the request field whose value is mapped to the HTTP request * body, or `*` for mapping all request fields not captured by the path * pattern to the HTTP body, or omitted for not having any HTTP request body. + * * NOTE: the referred field must be present at the top-level of the request * message type. * @@ -298,6 +319,7 @@ public interface HttpRuleOrBuilder * @return The body. */ java.lang.String getBody(); + /** * * @@ -305,6 +327,7 @@ public interface HttpRuleOrBuilder * The name of the request field whose value is mapped to the HTTP request * body, or `*` for mapping all request fields not captured by the path * pattern to the HTTP body, or omitted for not having any HTTP request body. + * * NOTE: the referred field must be present at the top-level of the request * message type. * @@ -322,6 +345,7 @@ public interface HttpRuleOrBuilder * Optional. The name of the response field whose value is mapped to the HTTP * response body. When omitted, the entire response message will be used * as the HTTP response body. + * * NOTE: The referred field must be present at the top-level of the response * message type. * @@ -331,6 +355,7 @@ public interface HttpRuleOrBuilder * @return The responseBody. */ java.lang.String getResponseBody(); + /** * * @@ -338,6 +363,7 @@ public interface HttpRuleOrBuilder * Optional. The name of the response field whose value is mapped to the HTTP * response body. When omitted, the entire response message will be used * as the HTTP response body. + * * NOTE: The referred field must be present at the top-level of the response * message type. * @@ -360,6 +386,7 @@ public interface HttpRuleOrBuilder * repeated .google.api.HttpRule additional_bindings = 11; */ java.util.List getAdditionalBindingsList(); + /** * * @@ -372,6 +399,7 @@ public interface HttpRuleOrBuilder * repeated .google.api.HttpRule additional_bindings = 11; */ com.google.api.HttpRule getAdditionalBindings(int index); + /** * * @@ -384,6 +412,7 @@ public interface HttpRuleOrBuilder * repeated .google.api.HttpRule additional_bindings = 11; */ int getAdditionalBindingsCount(); + /** * * @@ -396,6 +425,7 @@ public interface HttpRuleOrBuilder * repeated .google.api.HttpRule additional_bindings = 11; */ java.util.List getAdditionalBindingsOrBuilderList(); + /** * * @@ -409,5 +439,5 @@ public interface HttpRuleOrBuilder */ com.google.api.HttpRuleOrBuilder getAdditionalBindingsOrBuilder(int index); - public com.google.api.HttpRule.PatternCase getPatternCase(); + com.google.api.HttpRule.PatternCase getPatternCase(); } diff --git a/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/JavaSettings.java b/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/JavaSettings.java index ea465684ba..6617042ef6 100644 --- a/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/JavaSettings.java +++ b/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/JavaSettings.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,9 @@ * limitations under the License. */ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: google/api/client.proto +// Protobuf Java Version: 4.33.2 package com.google.api; @@ -27,13 +29,25 @@ * * Protobuf type {@code google.api.JavaSettings} */ -public final class JavaSettings extends com.google.protobuf.GeneratedMessageV3 +@com.google.protobuf.Generated +public final class JavaSettings extends com.google.protobuf.GeneratedMessage implements // @@protoc_insertion_point(message_implements:google.api.JavaSettings) JavaSettingsOrBuilder { private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "JavaSettings"); + } + // Use JavaSettings.newBuilder() to construct. - private JavaSettings(com.google.protobuf.GeneratedMessageV3.Builder builder) { + private JavaSettings(com.google.protobuf.GeneratedMessage.Builder builder) { super(builder); } @@ -41,24 +55,14 @@ private JavaSettings() { libraryPackage_ = ""; } - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new JavaSettings(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.api.ClientProto.internal_static_google_api_JavaSettings_descriptor; } @SuppressWarnings({"rawtypes"}) @java.lang.Override - protected com.google.protobuf.MapField internalGetMapField(int number) { + protected com.google.protobuf.MapFieldReflectionAccessor internalGetMapFieldReflection( + int number) { switch (number) { case 2: return internalGetServiceClassNames(); @@ -68,15 +72,19 @@ protected com.google.protobuf.MapField internalGetMapField(int number) { } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.api.ClientProto.internal_static_google_api_JavaSettings_fieldAccessorTable .ensureFieldAccessorsInitialized( com.google.api.JavaSettings.class, com.google.api.JavaSettings.Builder.class); } + private int bitField0_; public static final int LIBRARY_PACKAGE_FIELD_NUMBER = 1; - private volatile java.lang.Object libraryPackage_; + + @SuppressWarnings("serial") + private volatile java.lang.Object libraryPackage_ = ""; + /** * * @@ -86,10 +94,12 @@ protected com.google.protobuf.MapField internalGetMapField(int number) { * who have already set the language_settings.java.package_name" field * in gapic.yaml. API teams should use the protobuf java_package option * where possible. + * * Example of a YAML configuration:: - * publishing: - * java_settings: - * library_package: com.google.cloud.pubsub.v1 + * + * publishing: + * java_settings: + * library_package: com.google.cloud.pubsub.v1 * * * string library_package = 1; @@ -108,6 +118,7 @@ public java.lang.String getLibraryPackage() { return s; } } + /** * * @@ -117,10 +128,12 @@ public java.lang.String getLibraryPackage() { * who have already set the language_settings.java.package_name" field * in gapic.yaml. API teams should use the protobuf java_package option * where possible. + * * Example of a YAML configuration:: - * publishing: - * java_settings: - * library_package: com.google.cloud.pubsub.v1 + * + * publishing: + * java_settings: + * library_package: com.google.cloud.pubsub.v1 * * * string library_package = 1; @@ -153,6 +166,7 @@ private static final class ServiceClassNamesDefaultEntryHolder { ""); } + @SuppressWarnings("serial") private com.google.protobuf.MapField serviceClassNames_; private com.google.protobuf.MapField @@ -167,6 +181,7 @@ private static final class ServiceClassNamesDefaultEntryHolder { public int getServiceClassNamesCount() { return internalGetServiceClassNames().getMap().size(); } + /** * * @@ -177,12 +192,14 @@ public int getServiceClassNamesCount() { * the language_settings.java.interface_names" field in gapic.yaml. API * teams should otherwise use the service name as it appears in the * protobuf. + * * Example of a YAML configuration:: - * publishing: - * java_settings: - * service_class_names: - * - google.pubsub.v1.Publisher: TopicAdmin - * - google.pubsub.v1.Subscriber: SubscriptionAdmin + * + * publishing: + * java_settings: + * service_class_names: + * - google.pubsub.v1.Publisher: TopicAdmin + * - google.pubsub.v1.Subscriber: SubscriptionAdmin * * * map<string, string> service_class_names = 2; @@ -194,12 +211,14 @@ public boolean containsServiceClassNames(java.lang.String key) { } return internalGetServiceClassNames().getMap().containsKey(key); } + /** Use {@link #getServiceClassNamesMap()} instead. */ @java.lang.Override @java.lang.Deprecated public java.util.Map getServiceClassNames() { return getServiceClassNamesMap(); } + /** * * @@ -210,12 +229,14 @@ public java.util.Map getServiceClassNames() * the language_settings.java.interface_names" field in gapic.yaml. API * teams should otherwise use the service name as it appears in the * protobuf. + * * Example of a YAML configuration:: - * publishing: - * java_settings: - * service_class_names: - * - google.pubsub.v1.Publisher: TopicAdmin - * - google.pubsub.v1.Subscriber: SubscriptionAdmin + * + * publishing: + * java_settings: + * service_class_names: + * - google.pubsub.v1.Publisher: TopicAdmin + * - google.pubsub.v1.Subscriber: SubscriptionAdmin * * * map<string, string> service_class_names = 2; @@ -224,6 +245,7 @@ public java.util.Map getServiceClassNames() public java.util.Map getServiceClassNamesMap() { return internalGetServiceClassNames().getMap(); } + /** * * @@ -234,25 +256,30 @@ public java.util.Map getServiceClassNamesMap * the language_settings.java.interface_names" field in gapic.yaml. API * teams should otherwise use the service name as it appears in the * protobuf. + * * Example of a YAML configuration:: - * publishing: - * java_settings: - * service_class_names: - * - google.pubsub.v1.Publisher: TopicAdmin - * - google.pubsub.v1.Subscriber: SubscriptionAdmin + * + * publishing: + * java_settings: + * service_class_names: + * - google.pubsub.v1.Publisher: TopicAdmin + * - google.pubsub.v1.Subscriber: SubscriptionAdmin * * * map<string, string> service_class_names = 2; */ @java.lang.Override - public java.lang.String getServiceClassNamesOrDefault( - java.lang.String key, java.lang.String defaultValue) { + public /* nullable */ java.lang.String getServiceClassNamesOrDefault( + java.lang.String key, + /* nullable */ + java.lang.String defaultValue) { if (key == null) { throw new NullPointerException("map key"); } java.util.Map map = internalGetServiceClassNames().getMap(); return map.containsKey(key) ? map.get(key) : defaultValue; } + /** * * @@ -263,12 +290,14 @@ public java.lang.String getServiceClassNamesOrDefault( * the language_settings.java.interface_names" field in gapic.yaml. API * teams should otherwise use the service name as it appears in the * protobuf. + * * Example of a YAML configuration:: - * publishing: - * java_settings: - * service_class_names: - * - google.pubsub.v1.Publisher: TopicAdmin - * - google.pubsub.v1.Subscriber: SubscriptionAdmin + * + * publishing: + * java_settings: + * service_class_names: + * - google.pubsub.v1.Publisher: TopicAdmin + * - google.pubsub.v1.Subscriber: SubscriptionAdmin * * * map<string, string> service_class_names = 2; @@ -287,6 +316,7 @@ public java.lang.String getServiceClassNamesOrThrow(java.lang.String key) { public static final int COMMON_FIELD_NUMBER = 3; private com.google.api.CommonLanguageSettings common_; + /** * * @@ -300,8 +330,9 @@ public java.lang.String getServiceClassNamesOrThrow(java.lang.String key) { */ @java.lang.Override public boolean hasCommon() { - return common_ != null; + return ((bitField0_ & 0x00000001) != 0); } + /** * * @@ -317,6 +348,7 @@ public boolean hasCommon() { public com.google.api.CommonLanguageSettings getCommon() { return common_ == null ? com.google.api.CommonLanguageSettings.getDefaultInstance() : common_; } + /** * * @@ -328,7 +360,7 @@ public com.google.api.CommonLanguageSettings getCommon() { */ @java.lang.Override public com.google.api.CommonLanguageSettingsOrBuilder getCommonOrBuilder() { - return getCommon(); + return common_ == null ? com.google.api.CommonLanguageSettings.getDefaultInstance() : common_; } private byte memoizedIsInitialized = -1; @@ -345,15 +377,15 @@ public final boolean isInitialized() { @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(libraryPackage_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, libraryPackage_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(libraryPackage_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, libraryPackage_); } - com.google.protobuf.GeneratedMessageV3.serializeStringMapTo( + com.google.protobuf.GeneratedMessage.serializeStringMapTo( output, internalGetServiceClassNames(), ServiceClassNamesDefaultEntryHolder.defaultEntry, 2); - if (common_ != null) { + if (((bitField0_ & 0x00000001) != 0)) { output.writeMessage(3, getCommon()); } getUnknownFields().writeTo(output); @@ -365,8 +397,8 @@ public int getSerializedSize() { if (size != -1) return size; size = 0; - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(libraryPackage_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, libraryPackage_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(libraryPackage_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, libraryPackage_); } for (java.util.Map.Entry entry : internalGetServiceClassNames().getMap().entrySet()) { @@ -378,7 +410,7 @@ public int getSerializedSize() { .build(); size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, serviceClassNames__); } - if (common_ != null) { + if (((bitField0_ & 0x00000001) != 0)) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getCommon()); } size += getUnknownFields().getSerializedSize(); @@ -464,38 +496,38 @@ public static com.google.api.JavaSettings parseFrom( public static com.google.api.JavaSettings parseFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); } public static com.google.api.JavaSettings parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } public static com.google.api.JavaSettings parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); } public static com.google.api.JavaSettings parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( PARSER, input, extensionRegistry); } public static com.google.api.JavaSettings parseFrom(com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); } public static com.google.api.JavaSettings parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } @@ -518,10 +550,11 @@ public Builder toBuilder() { } @java.lang.Override - protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { Builder builder = new Builder(parent); return builder; } + /** * * @@ -531,7 +564,7 @@ protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.Build * * Protobuf type {@code google.api.JavaSettings} */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder implements // @@protoc_insertion_point(builder_implements:google.api.JavaSettings) com.google.api.JavaSettingsOrBuilder { @@ -540,7 +573,8 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } @SuppressWarnings({"rawtypes"}) - protected com.google.protobuf.MapField internalGetMapField(int number) { + protected com.google.protobuf.MapFieldReflectionAccessor internalGetMapFieldReflection( + int number) { switch (number) { case 2: return internalGetServiceClassNames(); @@ -550,7 +584,8 @@ protected com.google.protobuf.MapField internalGetMapField(int number) { } @SuppressWarnings({"rawtypes"}) - protected com.google.protobuf.MapField internalGetMutableMapField(int number) { + protected com.google.protobuf.MapFieldReflectionAccessor internalGetMutableMapFieldReflection( + int number) { switch (number) { case 2: return internalGetMutableServiceClassNames(); @@ -560,7 +595,7 @@ protected com.google.protobuf.MapField internalGetMutableMapField(int number) { } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.api.ClientProto.internal_static_google_api_JavaSettings_fieldAccessorTable .ensureFieldAccessorsInitialized( @@ -568,22 +603,30 @@ protected com.google.protobuf.MapField internalGetMutableMapField(int number) { } // Construct using com.google.api.JavaSettings.newBuilder() - private Builder() {} + private Builder() { + maybeForceBuilderInitialization(); + } - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetCommonFieldBuilder(); + } } @java.lang.Override public Builder clear() { super.clear(); + bitField0_ = 0; libraryPackage_ = ""; - internalGetMutableServiceClassNames().clear(); - if (commonBuilder_ == null) { - common_ = null; - } else { - common_ = null; + common_ = null; + if (commonBuilder_ != null) { + commonBuilder_.dispose(); commonBuilder_ = null; } return this; @@ -611,50 +654,28 @@ public com.google.api.JavaSettings build() { @java.lang.Override public com.google.api.JavaSettings buildPartial() { com.google.api.JavaSettings result = new com.google.api.JavaSettings(this); - int from_bitField0_ = bitField0_; - result.libraryPackage_ = libraryPackage_; - result.serviceClassNames_ = internalGetServiceClassNames(); - result.serviceClassNames_.makeImmutable(); - if (commonBuilder_ == null) { - result.common_ = common_; - } else { - result.common_ = commonBuilder_.build(); + if (bitField0_ != 0) { + buildPartial0(result); } 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); + private void buildPartial0(com.google.api.JavaSettings result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.libraryPackage_ = libraryPackage_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.serviceClassNames_ = internalGetServiceClassNames(); + result.serviceClassNames_.makeImmutable(); + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000004) != 0)) { + result.common_ = commonBuilder_ == null ? common_ : commonBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + result.bitField0_ |= to_bitField0_; } @java.lang.Override @@ -671,9 +692,11 @@ public Builder mergeFrom(com.google.api.JavaSettings other) { if (other == com.google.api.JavaSettings.getDefaultInstance()) return this; if (!other.getLibraryPackage().isEmpty()) { libraryPackage_ = other.libraryPackage_; + bitField0_ |= 0x00000001; onChanged(); } internalGetMutableServiceClassNames().mergeFrom(other.internalGetServiceClassNames()); + bitField0_ |= 0x00000002; if (other.hasCommon()) { mergeCommon(other.getCommon()); } @@ -706,7 +729,7 @@ public Builder mergeFrom( case 10: { libraryPackage_ = input.readStringRequireUtf8(); - + bitField0_ |= 0x00000001; break; } // case 10 case 18: @@ -719,12 +742,13 @@ public Builder mergeFrom( internalGetMutableServiceClassNames() .getMutableMap() .put(serviceClassNames__.getKey(), serviceClassNames__.getValue()); + bitField0_ |= 0x00000002; break; } // case 18 case 26: { - input.readMessage(getCommonFieldBuilder().getBuilder(), extensionRegistry); - + input.readMessage(internalGetCommonFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000004; break; } // case 26 default: @@ -747,6 +771,7 @@ public Builder mergeFrom( private int bitField0_; private java.lang.Object libraryPackage_ = ""; + /** * * @@ -756,10 +781,12 @@ public Builder mergeFrom( * who have already set the language_settings.java.package_name" field * in gapic.yaml. API teams should use the protobuf java_package option * where possible. + * * Example of a YAML configuration:: - * publishing: - * java_settings: - * library_package: com.google.cloud.pubsub.v1 + * + * publishing: + * java_settings: + * library_package: com.google.cloud.pubsub.v1 * * * string library_package = 1; @@ -777,6 +804,7 @@ public java.lang.String getLibraryPackage() { return (java.lang.String) ref; } } + /** * * @@ -786,10 +814,12 @@ public java.lang.String getLibraryPackage() { * who have already set the language_settings.java.package_name" field * in gapic.yaml. API teams should use the protobuf java_package option * where possible. + * * Example of a YAML configuration:: - * publishing: - * java_settings: - * library_package: com.google.cloud.pubsub.v1 + * + * publishing: + * java_settings: + * library_package: com.google.cloud.pubsub.v1 * * * string library_package = 1; @@ -807,6 +837,7 @@ public com.google.protobuf.ByteString getLibraryPackageBytes() { return (com.google.protobuf.ByteString) ref; } } + /** * * @@ -816,10 +847,12 @@ public com.google.protobuf.ByteString getLibraryPackageBytes() { * who have already set the language_settings.java.package_name" field * in gapic.yaml. API teams should use the protobuf java_package option * where possible. + * * Example of a YAML configuration:: - * publishing: - * java_settings: - * library_package: com.google.cloud.pubsub.v1 + * + * publishing: + * java_settings: + * library_package: com.google.cloud.pubsub.v1 * * * string library_package = 1; @@ -831,11 +864,12 @@ public Builder setLibraryPackage(java.lang.String value) { if (value == null) { throw new NullPointerException(); } - libraryPackage_ = value; + bitField0_ |= 0x00000001; onChanged(); return this; } + /** * * @@ -845,10 +879,12 @@ public Builder setLibraryPackage(java.lang.String value) { * who have already set the language_settings.java.package_name" field * in gapic.yaml. API teams should use the protobuf java_package option * where possible. + * * Example of a YAML configuration:: - * publishing: - * java_settings: - * library_package: com.google.cloud.pubsub.v1 + * + * publishing: + * java_settings: + * library_package: com.google.cloud.pubsub.v1 * * * string library_package = 1; @@ -856,11 +892,12 @@ public Builder setLibraryPackage(java.lang.String value) { * @return This builder for chaining. */ public Builder clearLibraryPackage() { - libraryPackage_ = getDefaultInstance().getLibraryPackage(); + bitField0_ = (bitField0_ & ~0x00000001); onChanged(); return this; } + /** * * @@ -870,10 +907,12 @@ public Builder clearLibraryPackage() { * who have already set the language_settings.java.package_name" field * in gapic.yaml. API teams should use the protobuf java_package option * where possible. + * * Example of a YAML configuration:: - * publishing: - * java_settings: - * library_package: com.google.cloud.pubsub.v1 + * + * publishing: + * java_settings: + * library_package: com.google.cloud.pubsub.v1 * * * string library_package = 1; @@ -886,8 +925,8 @@ public Builder setLibraryPackageBytes(com.google.protobuf.ByteString value) { throw new NullPointerException(); } checkByteStringIsUtf8(value); - libraryPackage_ = value; + bitField0_ |= 0x00000001; onChanged(); return this; } @@ -905,8 +944,6 @@ public Builder setLibraryPackageBytes(com.google.protobuf.ByteString value) { private com.google.protobuf.MapField internalGetMutableServiceClassNames() { - onChanged(); - ; if (serviceClassNames_ == null) { serviceClassNames_ = com.google.protobuf.MapField.newMapField( @@ -915,12 +952,15 @@ public Builder setLibraryPackageBytes(com.google.protobuf.ByteString value) { if (!serviceClassNames_.isMutable()) { serviceClassNames_ = serviceClassNames_.copy(); } + bitField0_ |= 0x00000002; + onChanged(); return serviceClassNames_; } public int getServiceClassNamesCount() { return internalGetServiceClassNames().getMap().size(); } + /** * * @@ -931,12 +971,14 @@ public int getServiceClassNamesCount() { * the language_settings.java.interface_names" field in gapic.yaml. API * teams should otherwise use the service name as it appears in the * protobuf. + * * Example of a YAML configuration:: - * publishing: - * java_settings: - * service_class_names: - * - google.pubsub.v1.Publisher: TopicAdmin - * - google.pubsub.v1.Subscriber: SubscriptionAdmin + * + * publishing: + * java_settings: + * service_class_names: + * - google.pubsub.v1.Publisher: TopicAdmin + * - google.pubsub.v1.Subscriber: SubscriptionAdmin * * * map<string, string> service_class_names = 2; @@ -948,12 +990,14 @@ public boolean containsServiceClassNames(java.lang.String key) { } return internalGetServiceClassNames().getMap().containsKey(key); } + /** Use {@link #getServiceClassNamesMap()} instead. */ @java.lang.Override @java.lang.Deprecated public java.util.Map getServiceClassNames() { return getServiceClassNamesMap(); } + /** * * @@ -964,12 +1008,14 @@ public java.util.Map getServiceClassNames() * the language_settings.java.interface_names" field in gapic.yaml. API * teams should otherwise use the service name as it appears in the * protobuf. + * * Example of a YAML configuration:: - * publishing: - * java_settings: - * service_class_names: - * - google.pubsub.v1.Publisher: TopicAdmin - * - google.pubsub.v1.Subscriber: SubscriptionAdmin + * + * publishing: + * java_settings: + * service_class_names: + * - google.pubsub.v1.Publisher: TopicAdmin + * - google.pubsub.v1.Subscriber: SubscriptionAdmin * * * map<string, string> service_class_names = 2; @@ -978,6 +1024,7 @@ public java.util.Map getServiceClassNames() public java.util.Map getServiceClassNamesMap() { return internalGetServiceClassNames().getMap(); } + /** * * @@ -988,19 +1035,23 @@ public java.util.Map getServiceClassNamesMap * the language_settings.java.interface_names" field in gapic.yaml. API * teams should otherwise use the service name as it appears in the * protobuf. + * * Example of a YAML configuration:: - * publishing: - * java_settings: - * service_class_names: - * - google.pubsub.v1.Publisher: TopicAdmin - * - google.pubsub.v1.Subscriber: SubscriptionAdmin + * + * publishing: + * java_settings: + * service_class_names: + * - google.pubsub.v1.Publisher: TopicAdmin + * - google.pubsub.v1.Subscriber: SubscriptionAdmin * * * map<string, string> service_class_names = 2; */ @java.lang.Override - public java.lang.String getServiceClassNamesOrDefault( - java.lang.String key, java.lang.String defaultValue) { + public /* nullable */ java.lang.String getServiceClassNamesOrDefault( + java.lang.String key, + /* nullable */ + java.lang.String defaultValue) { if (key == null) { throw new NullPointerException("map key"); } @@ -1008,6 +1059,7 @@ public java.lang.String getServiceClassNamesOrDefault( internalGetServiceClassNames().getMap(); return map.containsKey(key) ? map.get(key) : defaultValue; } + /** * * @@ -1018,12 +1070,14 @@ public java.lang.String getServiceClassNamesOrDefault( * the language_settings.java.interface_names" field in gapic.yaml. API * teams should otherwise use the service name as it appears in the * protobuf. + * * Example of a YAML configuration:: - * publishing: - * java_settings: - * service_class_names: - * - google.pubsub.v1.Publisher: TopicAdmin - * - google.pubsub.v1.Subscriber: SubscriptionAdmin + * + * publishing: + * java_settings: + * service_class_names: + * - google.pubsub.v1.Publisher: TopicAdmin + * - google.pubsub.v1.Subscriber: SubscriptionAdmin * * * map<string, string> service_class_names = 2; @@ -1042,9 +1096,11 @@ public java.lang.String getServiceClassNamesOrThrow(java.lang.String key) { } public Builder clearServiceClassNames() { + bitField0_ = (bitField0_ & ~0x00000002); internalGetMutableServiceClassNames().getMutableMap().clear(); return this; } + /** * * @@ -1055,12 +1111,14 @@ public Builder clearServiceClassNames() { * the language_settings.java.interface_names" field in gapic.yaml. API * teams should otherwise use the service name as it appears in the * protobuf. + * * Example of a YAML configuration:: - * publishing: - * java_settings: - * service_class_names: - * - google.pubsub.v1.Publisher: TopicAdmin - * - google.pubsub.v1.Subscriber: SubscriptionAdmin + * + * publishing: + * java_settings: + * service_class_names: + * - google.pubsub.v1.Publisher: TopicAdmin + * - google.pubsub.v1.Subscriber: SubscriptionAdmin * * * map<string, string> service_class_names = 2; @@ -1072,11 +1130,14 @@ public Builder removeServiceClassNames(java.lang.String key) { internalGetMutableServiceClassNames().getMutableMap().remove(key); return this; } + /** Use alternate mutation accessors instead. */ @java.lang.Deprecated public java.util.Map getMutableServiceClassNames() { + bitField0_ |= 0x00000002; return internalGetMutableServiceClassNames().getMutableMap(); } + /** * * @@ -1087,12 +1148,14 @@ public java.util.Map getMutableServiceClassN * the language_settings.java.interface_names" field in gapic.yaml. API * teams should otherwise use the service name as it appears in the * protobuf. + * * Example of a YAML configuration:: - * publishing: - * java_settings: - * service_class_names: - * - google.pubsub.v1.Publisher: TopicAdmin - * - google.pubsub.v1.Subscriber: SubscriptionAdmin + * + * publishing: + * java_settings: + * service_class_names: + * - google.pubsub.v1.Publisher: TopicAdmin + * - google.pubsub.v1.Subscriber: SubscriptionAdmin * * * map<string, string> service_class_names = 2; @@ -1104,10 +1167,11 @@ public Builder putServiceClassNames(java.lang.String key, java.lang.String value if (value == null) { throw new NullPointerException("map value"); } - internalGetMutableServiceClassNames().getMutableMap().put(key, value); + bitField0_ |= 0x00000002; return this; } + /** * * @@ -1118,12 +1182,14 @@ public Builder putServiceClassNames(java.lang.String key, java.lang.String value * the language_settings.java.interface_names" field in gapic.yaml. API * teams should otherwise use the service name as it appears in the * protobuf. + * * Example of a YAML configuration:: - * publishing: - * java_settings: - * service_class_names: - * - google.pubsub.v1.Publisher: TopicAdmin - * - google.pubsub.v1.Subscriber: SubscriptionAdmin + * + * publishing: + * java_settings: + * service_class_names: + * - google.pubsub.v1.Publisher: TopicAdmin + * - google.pubsub.v1.Subscriber: SubscriptionAdmin * * * map<string, string> service_class_names = 2; @@ -1131,15 +1197,17 @@ public Builder putServiceClassNames(java.lang.String key, java.lang.String value public Builder putAllServiceClassNames( java.util.Map values) { internalGetMutableServiceClassNames().getMutableMap().putAll(values); + bitField0_ |= 0x00000002; return this; } private com.google.api.CommonLanguageSettings common_; - private com.google.protobuf.SingleFieldBuilderV3< + private com.google.protobuf.SingleFieldBuilder< com.google.api.CommonLanguageSettings, com.google.api.CommonLanguageSettings.Builder, com.google.api.CommonLanguageSettingsOrBuilder> commonBuilder_; + /** * * @@ -1152,8 +1220,9 @@ public Builder putAllServiceClassNames( * @return Whether the common field is set. */ public boolean hasCommon() { - return commonBuilder_ != null || common_ != null; + return ((bitField0_ & 0x00000004) != 0); } + /** * * @@ -1174,6 +1243,7 @@ public com.google.api.CommonLanguageSettings getCommon() { return commonBuilder_.getMessage(); } } + /** * * @@ -1189,13 +1259,14 @@ public Builder setCommon(com.google.api.CommonLanguageSettings value) { throw new NullPointerException(); } common_ = value; - onChanged(); } else { commonBuilder_.setMessage(value); } - + bitField0_ |= 0x00000004; + onChanged(); return this; } + /** * * @@ -1208,13 +1279,14 @@ public Builder setCommon(com.google.api.CommonLanguageSettings value) { public Builder setCommon(com.google.api.CommonLanguageSettings.Builder builderForValue) { if (commonBuilder_ == null) { common_ = builderForValue.build(); - onChanged(); } else { commonBuilder_.setMessage(builderForValue.build()); } - + bitField0_ |= 0x00000004; + onChanged(); return this; } + /** * * @@ -1226,21 +1298,23 @@ public Builder setCommon(com.google.api.CommonLanguageSettings.Builder builderFo */ public Builder mergeCommon(com.google.api.CommonLanguageSettings value) { if (commonBuilder_ == null) { - if (common_ != null) { - common_ = - com.google.api.CommonLanguageSettings.newBuilder(common_) - .mergeFrom(value) - .buildPartial(); + if (((bitField0_ & 0x00000004) != 0) + && common_ != null + && common_ != com.google.api.CommonLanguageSettings.getDefaultInstance()) { + getCommonBuilder().mergeFrom(value); } else { common_ = value; } - onChanged(); } else { commonBuilder_.mergeFrom(value); } - + if (common_ != null) { + bitField0_ |= 0x00000004; + onChanged(); + } return this; } + /** * * @@ -1251,16 +1325,16 @@ public Builder mergeCommon(com.google.api.CommonLanguageSettings value) { * .google.api.CommonLanguageSettings common = 3; */ public Builder clearCommon() { - if (commonBuilder_ == null) { - common_ = null; - onChanged(); - } else { - common_ = null; + bitField0_ = (bitField0_ & ~0x00000004); + common_ = null; + if (commonBuilder_ != null) { + commonBuilder_.dispose(); commonBuilder_ = null; } - + onChanged(); return this; } + /** * * @@ -1271,10 +1345,11 @@ public Builder clearCommon() { * .google.api.CommonLanguageSettings common = 3; */ public com.google.api.CommonLanguageSettings.Builder getCommonBuilder() { - + bitField0_ |= 0x00000004; onChanged(); - return getCommonFieldBuilder().getBuilder(); + return internalGetCommonFieldBuilder().getBuilder(); } + /** * * @@ -1293,6 +1368,7 @@ public com.google.api.CommonLanguageSettingsOrBuilder getCommonOrBuilder() { : common_; } } + /** * * @@ -1302,14 +1378,14 @@ public com.google.api.CommonLanguageSettingsOrBuilder getCommonOrBuilder() { * * .google.api.CommonLanguageSettings common = 3; */ - private com.google.protobuf.SingleFieldBuilderV3< + private com.google.protobuf.SingleFieldBuilder< com.google.api.CommonLanguageSettings, com.google.api.CommonLanguageSettings.Builder, com.google.api.CommonLanguageSettingsOrBuilder> - getCommonFieldBuilder() { + internalGetCommonFieldBuilder() { if (commonBuilder_ == null) { commonBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< + new com.google.protobuf.SingleFieldBuilder< com.google.api.CommonLanguageSettings, com.google.api.CommonLanguageSettings.Builder, com.google.api.CommonLanguageSettingsOrBuilder>( @@ -1319,17 +1395,6 @@ public com.google.api.CommonLanguageSettingsOrBuilder getCommonOrBuilder() { return commonBuilder_; } - @java.lang.Override - public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - // @@protoc_insertion_point(builder_scope:google.api.JavaSettings) } diff --git a/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/JavaSettingsOrBuilder.java b/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/JavaSettingsOrBuilder.java index dfad2159e5..1ae94c7bbc 100644 --- a/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/JavaSettingsOrBuilder.java +++ b/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/JavaSettingsOrBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,10 +14,13 @@ * limitations under the License. */ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: google/api/client.proto +// Protobuf Java Version: 4.33.2 package com.google.api; +@com.google.protobuf.Generated public interface JavaSettingsOrBuilder extends // @@protoc_insertion_point(interface_extends:google.api.JavaSettings) @@ -32,10 +35,12 @@ public interface JavaSettingsOrBuilder * who have already set the language_settings.java.package_name" field * in gapic.yaml. API teams should use the protobuf java_package option * where possible. + * * Example of a YAML configuration:: - * publishing: - * java_settings: - * library_package: com.google.cloud.pubsub.v1 + * + * publishing: + * java_settings: + * library_package: com.google.cloud.pubsub.v1 * * * string library_package = 1; @@ -43,6 +48,7 @@ public interface JavaSettingsOrBuilder * @return The libraryPackage. */ java.lang.String getLibraryPackage(); + /** * * @@ -52,10 +58,12 @@ public interface JavaSettingsOrBuilder * who have already set the language_settings.java.package_name" field * in gapic.yaml. API teams should use the protobuf java_package option * where possible. + * * Example of a YAML configuration:: - * publishing: - * java_settings: - * library_package: com.google.cloud.pubsub.v1 + * + * publishing: + * java_settings: + * library_package: com.google.cloud.pubsub.v1 * * * string library_package = 1; @@ -74,17 +82,20 @@ public interface JavaSettingsOrBuilder * the language_settings.java.interface_names" field in gapic.yaml. API * teams should otherwise use the service name as it appears in the * protobuf. + * * Example of a YAML configuration:: - * publishing: - * java_settings: - * service_class_names: - * - google.pubsub.v1.Publisher: TopicAdmin - * - google.pubsub.v1.Subscriber: SubscriptionAdmin + * + * publishing: + * java_settings: + * service_class_names: + * - google.pubsub.v1.Publisher: TopicAdmin + * - google.pubsub.v1.Subscriber: SubscriptionAdmin * * * map<string, string> service_class_names = 2; */ int getServiceClassNamesCount(); + /** * * @@ -95,20 +106,24 @@ public interface JavaSettingsOrBuilder * the language_settings.java.interface_names" field in gapic.yaml. API * teams should otherwise use the service name as it appears in the * protobuf. + * * Example of a YAML configuration:: - * publishing: - * java_settings: - * service_class_names: - * - google.pubsub.v1.Publisher: TopicAdmin - * - google.pubsub.v1.Subscriber: SubscriptionAdmin + * + * publishing: + * java_settings: + * service_class_names: + * - google.pubsub.v1.Publisher: TopicAdmin + * - google.pubsub.v1.Subscriber: SubscriptionAdmin * * * map<string, string> service_class_names = 2; */ boolean containsServiceClassNames(java.lang.String key); + /** Use {@link #getServiceClassNamesMap()} instead. */ @java.lang.Deprecated java.util.Map getServiceClassNames(); + /** * * @@ -119,17 +134,20 @@ public interface JavaSettingsOrBuilder * the language_settings.java.interface_names" field in gapic.yaml. API * teams should otherwise use the service name as it appears in the * protobuf. + * * Example of a YAML configuration:: - * publishing: - * java_settings: - * service_class_names: - * - google.pubsub.v1.Publisher: TopicAdmin - * - google.pubsub.v1.Subscriber: SubscriptionAdmin + * + * publishing: + * java_settings: + * service_class_names: + * - google.pubsub.v1.Publisher: TopicAdmin + * - google.pubsub.v1.Subscriber: SubscriptionAdmin * * * map<string, string> service_class_names = 2; */ java.util.Map getServiceClassNamesMap(); + /** * * @@ -140,22 +158,24 @@ public interface JavaSettingsOrBuilder * the language_settings.java.interface_names" field in gapic.yaml. API * teams should otherwise use the service name as it appears in the * protobuf. + * * Example of a YAML configuration:: - * publishing: - * java_settings: - * service_class_names: - * - google.pubsub.v1.Publisher: TopicAdmin - * - google.pubsub.v1.Subscriber: SubscriptionAdmin + * + * publishing: + * java_settings: + * service_class_names: + * - google.pubsub.v1.Publisher: TopicAdmin + * - google.pubsub.v1.Subscriber: SubscriptionAdmin * * * map<string, string> service_class_names = 2; */ - /* nullable */ java.lang.String getServiceClassNamesOrDefault( java.lang.String key, /* nullable */ java.lang.String defaultValue); + /** * * @@ -166,12 +186,14 @@ java.lang.String getServiceClassNamesOrDefault( * the language_settings.java.interface_names" field in gapic.yaml. API * teams should otherwise use the service name as it appears in the * protobuf. + * * Example of a YAML configuration:: - * publishing: - * java_settings: - * service_class_names: - * - google.pubsub.v1.Publisher: TopicAdmin - * - google.pubsub.v1.Subscriber: SubscriptionAdmin + * + * publishing: + * java_settings: + * service_class_names: + * - google.pubsub.v1.Publisher: TopicAdmin + * - google.pubsub.v1.Subscriber: SubscriptionAdmin * * * map<string, string> service_class_names = 2; @@ -190,6 +212,7 @@ java.lang.String getServiceClassNamesOrDefault( * @return Whether the common field is set. */ boolean hasCommon(); + /** * * @@ -202,6 +225,7 @@ java.lang.String getServiceClassNamesOrDefault( * @return The common. */ com.google.api.CommonLanguageSettings getCommon(); + /** * * diff --git a/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/JwtLocation.java b/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/JwtLocation.java index 02ddb3e616..83fafd0ff9 100644 --- a/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/JwtLocation.java +++ b/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/JwtLocation.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,9 @@ * limitations under the License. */ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: google/api/auth.proto +// Protobuf Java Version: 4.33.2 package com.google.api; @@ -27,13 +29,25 @@ * * Protobuf type {@code google.api.JwtLocation} */ -public final class JwtLocation extends com.google.protobuf.GeneratedMessageV3 +@com.google.protobuf.Generated +public final class JwtLocation extends com.google.protobuf.GeneratedMessage implements // @@protoc_insertion_point(message_implements:google.api.JwtLocation) JwtLocationOrBuilder { private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "JwtLocation"); + } + // Use JwtLocation.newBuilder() to construct. - private JwtLocation(com.google.protobuf.GeneratedMessageV3.Builder builder) { + private JwtLocation(com.google.protobuf.GeneratedMessage.Builder builder) { super(builder); } @@ -41,23 +55,12 @@ private JwtLocation() { valuePrefix_ = ""; } - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new JwtLocation(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.api.AuthProto.internal_static_google_api_JwtLocation_descriptor; } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.api.AuthProto.internal_static_google_api_JwtLocation_fieldAccessorTable .ensureFieldAccessorsInitialized( @@ -65,6 +68,8 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } private int inCase_ = 0; + + @SuppressWarnings("serial") private java.lang.Object in_; public enum InCase @@ -80,6 +85,7 @@ public enum InCase private InCase(int value) { this.value = value; } + /** * @param value The number of the enum to look for. * @return The enum associated with the given number. @@ -115,6 +121,7 @@ public InCase getInCase() { } public static final int HEADER_FIELD_NUMBER = 1; + /** * * @@ -129,6 +136,7 @@ public InCase getInCase() { public boolean hasHeader() { return inCase_ == 1; } + /** * * @@ -156,6 +164,7 @@ public java.lang.String getHeader() { return s; } } + /** * * @@ -185,6 +194,7 @@ public com.google.protobuf.ByteString getHeaderBytes() { } public static final int QUERY_FIELD_NUMBER = 2; + /** * * @@ -199,6 +209,7 @@ public com.google.protobuf.ByteString getHeaderBytes() { public boolean hasQuery() { return inCase_ == 2; } + /** * * @@ -226,6 +237,7 @@ public java.lang.String getQuery() { return s; } } + /** * * @@ -255,6 +267,7 @@ public com.google.protobuf.ByteString getQueryBytes() { } public static final int COOKIE_FIELD_NUMBER = 4; + /** * * @@ -269,6 +282,7 @@ public com.google.protobuf.ByteString getQueryBytes() { public boolean hasCookie() { return inCase_ == 4; } + /** * * @@ -296,6 +310,7 @@ public java.lang.String getCookie() { return s; } } + /** * * @@ -325,7 +340,10 @@ public com.google.protobuf.ByteString getCookieBytes() { } public static final int VALUE_PREFIX_FIELD_NUMBER = 3; - private volatile java.lang.Object valuePrefix_; + + @SuppressWarnings("serial") + private volatile java.lang.Object valuePrefix_ = ""; + /** * * @@ -335,6 +353,7 @@ public com.google.protobuf.ByteString getCookieBytes() { * If not empty, the header value has to match (case sensitive) this prefix. * If not matched, JWT will not be extracted. If matched, JWT will be * extracted after the prefix is removed. + * * For example, for "Authorization: Bearer {JWT}", * value_prefix="Bearer " with a space at the end. * @@ -355,6 +374,7 @@ public java.lang.String getValuePrefix() { return s; } } + /** * * @@ -364,6 +384,7 @@ public java.lang.String getValuePrefix() { * If not empty, the header value has to match (case sensitive) this prefix. * If not matched, JWT will not be extracted. If matched, JWT will be * extracted after the prefix is removed. + * * For example, for "Authorization: Bearer {JWT}", * value_prefix="Bearer " with a space at the end. * @@ -400,16 +421,16 @@ public final boolean isInitialized() { @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { if (inCase_ == 1) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, in_); + com.google.protobuf.GeneratedMessage.writeString(output, 1, in_); } if (inCase_ == 2) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 2, in_); + com.google.protobuf.GeneratedMessage.writeString(output, 2, in_); } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(valuePrefix_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 3, valuePrefix_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(valuePrefix_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 3, valuePrefix_); } if (inCase_ == 4) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 4, in_); + com.google.protobuf.GeneratedMessage.writeString(output, 4, in_); } getUnknownFields().writeTo(output); } @@ -421,16 +442,16 @@ public int getSerializedSize() { size = 0; if (inCase_ == 1) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, in_); + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, in_); } if (inCase_ == 2) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, in_); + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, in_); } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(valuePrefix_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, valuePrefix_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(valuePrefix_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(3, valuePrefix_); } if (inCase_ == 4) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, in_); + size += com.google.protobuf.GeneratedMessage.computeStringSize(4, in_); } size += getUnknownFields().getSerializedSize(); memoizedSize = size; @@ -532,38 +553,38 @@ public static com.google.api.JwtLocation parseFrom( public static com.google.api.JwtLocation parseFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); } public static com.google.api.JwtLocation parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } public static com.google.api.JwtLocation parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); } public static com.google.api.JwtLocation parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( PARSER, input, extensionRegistry); } public static com.google.api.JwtLocation parseFrom(com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); } public static com.google.api.JwtLocation parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } @@ -586,10 +607,11 @@ public Builder toBuilder() { } @java.lang.Override - protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { Builder builder = new Builder(parent); return builder; } + /** * * @@ -599,7 +621,7 @@ protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.Build * * Protobuf type {@code google.api.JwtLocation} */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder implements // @@protoc_insertion_point(builder_implements:google.api.JwtLocation) com.google.api.JwtLocationOrBuilder { @@ -608,7 +630,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.api.AuthProto.internal_static_google_api_JwtLocation_fieldAccessorTable .ensureFieldAccessorsInitialized( @@ -618,15 +640,15 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { // Construct using com.google.api.JwtLocation.newBuilder() private Builder() {} - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { super(parent); } @java.lang.Override public Builder clear() { super.clear(); + bitField0_ = 0; valuePrefix_ = ""; - inCase_ = 0; in_ = null; return this; @@ -654,52 +676,24 @@ public com.google.api.JwtLocation build() { @java.lang.Override public com.google.api.JwtLocation buildPartial() { com.google.api.JwtLocation result = new com.google.api.JwtLocation(this); - if (inCase_ == 1) { - result.in_ = in_; - } - if (inCase_ == 2) { - result.in_ = in_; - } - if (inCase_ == 4) { - result.in_ = in_; + if (bitField0_ != 0) { + buildPartial0(result); } - result.valuePrefix_ = valuePrefix_; - result.inCase_ = inCase_; + buildPartialOneofs(result); 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); + private void buildPartial0(com.google.api.JwtLocation result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000008) != 0)) { + result.valuePrefix_ = valuePrefix_; + } } - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.addRepeatedField(field, value); + private void buildPartialOneofs(com.google.api.JwtLocation result) { + result.inCase_ = inCase_; + result.in_ = this.in_; } @java.lang.Override @@ -716,6 +710,7 @@ public Builder mergeFrom(com.google.api.JwtLocation other) { if (other == com.google.api.JwtLocation.getDefaultInstance()) return this; if (!other.getValuePrefix().isEmpty()) { valuePrefix_ = other.valuePrefix_; + bitField0_ |= 0x00000008; onChanged(); } switch (other.getInCase()) { @@ -788,7 +783,7 @@ public Builder mergeFrom( case 26: { valuePrefix_ = input.readStringRequireUtf8(); - + bitField0_ |= 0x00000008; break; } // case 26 case 34: @@ -829,6 +824,8 @@ public Builder clearIn() { return this; } + private int bitField0_; + /** * * @@ -844,6 +841,7 @@ public Builder clearIn() { public boolean hasHeader() { return inCase_ == 1; } + /** * * @@ -872,6 +870,7 @@ public java.lang.String getHeader() { return (java.lang.String) ref; } } + /** * * @@ -900,6 +899,7 @@ public com.google.protobuf.ByteString getHeaderBytes() { return (com.google.protobuf.ByteString) ref; } } + /** * * @@ -921,6 +921,7 @@ public Builder setHeader(java.lang.String value) { onChanged(); return this; } + /** * * @@ -940,6 +941,7 @@ public Builder clearHeader() { } return this; } + /** * * @@ -978,6 +980,7 @@ public Builder setHeaderBytes(com.google.protobuf.ByteString value) { public boolean hasQuery() { return inCase_ == 2; } + /** * * @@ -1006,6 +1009,7 @@ public java.lang.String getQuery() { return (java.lang.String) ref; } } + /** * * @@ -1034,6 +1038,7 @@ public com.google.protobuf.ByteString getQueryBytes() { return (com.google.protobuf.ByteString) ref; } } + /** * * @@ -1055,6 +1060,7 @@ public Builder setQuery(java.lang.String value) { onChanged(); return this; } + /** * * @@ -1074,6 +1080,7 @@ public Builder clearQuery() { } return this; } + /** * * @@ -1112,6 +1119,7 @@ public Builder setQueryBytes(com.google.protobuf.ByteString value) { public boolean hasCookie() { return inCase_ == 4; } + /** * * @@ -1140,6 +1148,7 @@ public java.lang.String getCookie() { return (java.lang.String) ref; } } + /** * * @@ -1168,6 +1177,7 @@ public com.google.protobuf.ByteString getCookieBytes() { return (com.google.protobuf.ByteString) ref; } } + /** * * @@ -1189,6 +1199,7 @@ public Builder setCookie(java.lang.String value) { onChanged(); return this; } + /** * * @@ -1208,6 +1219,7 @@ public Builder clearCookie() { } return this; } + /** * * @@ -1232,6 +1244,7 @@ public Builder setCookieBytes(com.google.protobuf.ByteString value) { } private java.lang.Object valuePrefix_ = ""; + /** * * @@ -1241,6 +1254,7 @@ public Builder setCookieBytes(com.google.protobuf.ByteString value) { * If not empty, the header value has to match (case sensitive) this prefix. * If not matched, JWT will not be extracted. If matched, JWT will be * extracted after the prefix is removed. + * * For example, for "Authorization: Bearer {JWT}", * value_prefix="Bearer " with a space at the end. * @@ -1260,6 +1274,7 @@ public java.lang.String getValuePrefix() { return (java.lang.String) ref; } } + /** * * @@ -1269,6 +1284,7 @@ public java.lang.String getValuePrefix() { * If not empty, the header value has to match (case sensitive) this prefix. * If not matched, JWT will not be extracted. If matched, JWT will be * extracted after the prefix is removed. + * * For example, for "Authorization: Bearer {JWT}", * value_prefix="Bearer " with a space at the end. * @@ -1288,6 +1304,7 @@ public com.google.protobuf.ByteString getValuePrefixBytes() { return (com.google.protobuf.ByteString) ref; } } + /** * * @@ -1297,6 +1314,7 @@ public com.google.protobuf.ByteString getValuePrefixBytes() { * If not empty, the header value has to match (case sensitive) this prefix. * If not matched, JWT will not be extracted. If matched, JWT will be * extracted after the prefix is removed. + * * For example, for "Authorization: Bearer {JWT}", * value_prefix="Bearer " with a space at the end. * @@ -1310,11 +1328,12 @@ public Builder setValuePrefix(java.lang.String value) { if (value == null) { throw new NullPointerException(); } - valuePrefix_ = value; + bitField0_ |= 0x00000008; onChanged(); return this; } + /** * * @@ -1324,6 +1343,7 @@ public Builder setValuePrefix(java.lang.String value) { * If not empty, the header value has to match (case sensitive) this prefix. * If not matched, JWT will not be extracted. If matched, JWT will be * extracted after the prefix is removed. + * * For example, for "Authorization: Bearer {JWT}", * value_prefix="Bearer " with a space at the end. * @@ -1333,11 +1353,12 @@ public Builder setValuePrefix(java.lang.String value) { * @return This builder for chaining. */ public Builder clearValuePrefix() { - valuePrefix_ = getDefaultInstance().getValuePrefix(); + bitField0_ = (bitField0_ & ~0x00000008); onChanged(); return this; } + /** * * @@ -1347,6 +1368,7 @@ public Builder clearValuePrefix() { * If not empty, the header value has to match (case sensitive) this prefix. * If not matched, JWT will not be extracted. If matched, JWT will be * extracted after the prefix is removed. + * * For example, for "Authorization: Bearer {JWT}", * value_prefix="Bearer " with a space at the end. * @@ -1361,23 +1383,12 @@ public Builder setValuePrefixBytes(com.google.protobuf.ByteString value) { throw new NullPointerException(); } checkByteStringIsUtf8(value); - valuePrefix_ = 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.api.JwtLocation) } diff --git a/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/JwtLocationOrBuilder.java b/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/JwtLocationOrBuilder.java index 167a5c86e6..66b67c1d10 100644 --- a/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/JwtLocationOrBuilder.java +++ b/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/JwtLocationOrBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,10 +14,13 @@ * limitations under the License. */ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: google/api/auth.proto +// Protobuf Java Version: 4.33.2 package com.google.api; +@com.google.protobuf.Generated public interface JwtLocationOrBuilder extends // @@protoc_insertion_point(interface_extends:google.api.JwtLocation) @@ -35,6 +38,7 @@ public interface JwtLocationOrBuilder * @return Whether the header field is set. */ boolean hasHeader(); + /** * * @@ -47,6 +51,7 @@ public interface JwtLocationOrBuilder * @return The header. */ java.lang.String getHeader(); + /** * * @@ -72,6 +77,7 @@ public interface JwtLocationOrBuilder * @return Whether the query field is set. */ boolean hasQuery(); + /** * * @@ -84,6 +90,7 @@ public interface JwtLocationOrBuilder * @return The query. */ java.lang.String getQuery(); + /** * * @@ -109,6 +116,7 @@ public interface JwtLocationOrBuilder * @return Whether the cookie field is set. */ boolean hasCookie(); + /** * * @@ -121,6 +129,7 @@ public interface JwtLocationOrBuilder * @return The cookie. */ java.lang.String getCookie(); + /** * * @@ -143,6 +152,7 @@ public interface JwtLocationOrBuilder * If not empty, the header value has to match (case sensitive) this prefix. * If not matched, JWT will not be extracted. If matched, JWT will be * extracted after the prefix is removed. + * * For example, for "Authorization: Bearer {JWT}", * value_prefix="Bearer " with a space at the end. * @@ -152,6 +162,7 @@ public interface JwtLocationOrBuilder * @return The valuePrefix. */ java.lang.String getValuePrefix(); + /** * * @@ -161,6 +172,7 @@ public interface JwtLocationOrBuilder * If not empty, the header value has to match (case sensitive) this prefix. * If not matched, JWT will not be extracted. If matched, JWT will be * extracted after the prefix is removed. + * * For example, for "Authorization: Bearer {JWT}", * value_prefix="Bearer " with a space at the end. * @@ -171,5 +183,5 @@ public interface JwtLocationOrBuilder */ com.google.protobuf.ByteString getValuePrefixBytes(); - public com.google.api.JwtLocation.InCase getInCase(); + com.google.api.JwtLocation.InCase getInCase(); } diff --git a/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/LabelDescriptor.java b/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/LabelDescriptor.java index 0a2963a358..9cabbf1622 100644 --- a/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/LabelDescriptor.java +++ b/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/LabelDescriptor.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,9 @@ * limitations under the License. */ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: google/api/label.proto +// Protobuf Java Version: 4.33.2 package com.google.api; @@ -27,13 +29,25 @@ * * Protobuf type {@code google.api.LabelDescriptor} */ -public final class LabelDescriptor extends com.google.protobuf.GeneratedMessageV3 +@com.google.protobuf.Generated +public final class LabelDescriptor extends com.google.protobuf.GeneratedMessage implements // @@protoc_insertion_point(message_implements:google.api.LabelDescriptor) LabelDescriptorOrBuilder { private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "LabelDescriptor"); + } + // Use LabelDescriptor.newBuilder() to construct. - private LabelDescriptor(com.google.protobuf.GeneratedMessageV3.Builder builder) { + private LabelDescriptor(com.google.protobuf.GeneratedMessage.Builder builder) { super(builder); } @@ -43,23 +57,12 @@ private LabelDescriptor() { description_ = ""; } - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new LabelDescriptor(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.api.LabelProto.internal_static_google_api_LabelDescriptor_descriptor; } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.api.LabelProto.internal_static_google_api_LabelDescriptor_fieldAccessorTable .ensureFieldAccessorsInitialized( @@ -109,6 +112,16 @@ public enum ValueType implements com.google.protobuf.ProtocolMessageEnum { UNRECOGNIZED(-1), ; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "ValueType"); + } + /** * * @@ -119,6 +132,7 @@ public enum ValueType implements com.google.protobuf.ProtocolMessageEnum { * STRING = 0; */ public static final int STRING_VALUE = 0; + /** * * @@ -129,6 +143,7 @@ public enum ValueType implements com.google.protobuf.ProtocolMessageEnum { * BOOL = 1; */ public static final int BOOL_VALUE = 1; + /** * * @@ -198,7 +213,7 @@ public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType return getDescriptor(); } - public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + public static com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { return com.google.api.LabelDescriptor.getDescriptor().getEnumTypes().get(0); } @@ -224,7 +239,10 @@ private ValueType(int value) { } public static final int KEY_FIELD_NUMBER = 1; - private volatile java.lang.Object key_; + + @SuppressWarnings("serial") + private volatile java.lang.Object key_ = ""; + /** * * @@ -248,6 +266,7 @@ public java.lang.String getKey() { return s; } } + /** * * @@ -273,7 +292,8 @@ public com.google.protobuf.ByteString getKeyBytes() { } public static final int VALUE_TYPE_FIELD_NUMBER = 2; - private int valueType_; + private int valueType_ = 0; + /** * * @@ -289,6 +309,7 @@ public com.google.protobuf.ByteString getKeyBytes() { public int getValueTypeValue() { return valueType_; } + /** * * @@ -302,14 +323,16 @@ public int getValueTypeValue() { */ @java.lang.Override public com.google.api.LabelDescriptor.ValueType getValueType() { - @SuppressWarnings("deprecation") com.google.api.LabelDescriptor.ValueType result = - com.google.api.LabelDescriptor.ValueType.valueOf(valueType_); + com.google.api.LabelDescriptor.ValueType.forNumber(valueType_); return result == null ? com.google.api.LabelDescriptor.ValueType.UNRECOGNIZED : result; } public static final int DESCRIPTION_FIELD_NUMBER = 3; - private volatile java.lang.Object description_; + + @SuppressWarnings("serial") + private volatile java.lang.Object description_ = ""; + /** * * @@ -333,6 +356,7 @@ public java.lang.String getDescription() { return s; } } + /** * * @@ -371,14 +395,14 @@ public final boolean isInitialized() { @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(key_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, key_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(key_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, key_); } if (valueType_ != com.google.api.LabelDescriptor.ValueType.STRING.getNumber()) { output.writeEnum(2, valueType_); } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(description_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 3, description_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(description_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 3, description_); } getUnknownFields().writeTo(output); } @@ -389,14 +413,14 @@ public int getSerializedSize() { if (size != -1) return size; size = 0; - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(key_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, key_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(key_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, key_); } if (valueType_ != com.google.api.LabelDescriptor.ValueType.STRING.getNumber()) { size += com.google.protobuf.CodedOutputStream.computeEnumSize(2, valueType_); } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(description_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, description_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(description_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(3, description_); } size += getUnknownFields().getSerializedSize(); memoizedSize = size; @@ -474,38 +498,38 @@ public static com.google.api.LabelDescriptor parseFrom( public static com.google.api.LabelDescriptor parseFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); } public static com.google.api.LabelDescriptor parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } public static com.google.api.LabelDescriptor parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); } public static com.google.api.LabelDescriptor parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( PARSER, input, extensionRegistry); } public static com.google.api.LabelDescriptor parseFrom(com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); } public static com.google.api.LabelDescriptor parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } @@ -528,10 +552,11 @@ public Builder toBuilder() { } @java.lang.Override - protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { Builder builder = new Builder(parent); return builder; } + /** * * @@ -541,7 +566,7 @@ protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.Build * * Protobuf type {@code google.api.LabelDescriptor} */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder implements // @@protoc_insertion_point(builder_implements:google.api.LabelDescriptor) com.google.api.LabelDescriptorOrBuilder { @@ -550,7 +575,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.api.LabelProto.internal_static_google_api_LabelDescriptor_fieldAccessorTable .ensureFieldAccessorsInitialized( @@ -560,19 +585,17 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { // Construct using com.google.api.LabelDescriptor.newBuilder() private Builder() {} - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { super(parent); } @java.lang.Override public Builder clear() { super.clear(); + bitField0_ = 0; key_ = ""; - valueType_ = 0; - description_ = ""; - return this; } @@ -598,44 +621,24 @@ public com.google.api.LabelDescriptor build() { @java.lang.Override public com.google.api.LabelDescriptor buildPartial() { com.google.api.LabelDescriptor result = new com.google.api.LabelDescriptor(this); - result.key_ = key_; - result.valueType_ = valueType_; - result.description_ = description_; + if (bitField0_ != 0) { + buildPartial0(result); + } 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); + private void buildPartial0(com.google.api.LabelDescriptor result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.key_ = key_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.valueType_ = valueType_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.description_ = description_; + } } @java.lang.Override @@ -652,6 +655,7 @@ public Builder mergeFrom(com.google.api.LabelDescriptor other) { if (other == com.google.api.LabelDescriptor.getDefaultInstance()) return this; if (!other.getKey().isEmpty()) { key_ = other.key_; + bitField0_ |= 0x00000001; onChanged(); } if (other.valueType_ != 0) { @@ -659,6 +663,7 @@ public Builder mergeFrom(com.google.api.LabelDescriptor other) { } if (!other.getDescription().isEmpty()) { description_ = other.description_; + bitField0_ |= 0x00000004; onChanged(); } this.mergeUnknownFields(other.getUnknownFields()); @@ -690,19 +695,19 @@ public Builder mergeFrom( case 10: { key_ = input.readStringRequireUtf8(); - + bitField0_ |= 0x00000001; break; } // case 10 case 16: { valueType_ = input.readEnum(); - + bitField0_ |= 0x00000002; break; } // case 16 case 26: { description_ = input.readStringRequireUtf8(); - + bitField0_ |= 0x00000004; break; } // case 26 default: @@ -722,7 +727,10 @@ public Builder mergeFrom( return this; } + private int bitField0_; + private java.lang.Object key_ = ""; + /** * * @@ -745,6 +753,7 @@ public java.lang.String getKey() { return (java.lang.String) ref; } } + /** * * @@ -767,6 +776,7 @@ public com.google.protobuf.ByteString getKeyBytes() { return (com.google.protobuf.ByteString) ref; } } + /** * * @@ -783,11 +793,12 @@ public Builder setKey(java.lang.String value) { if (value == null) { throw new NullPointerException(); } - key_ = value; + bitField0_ |= 0x00000001; onChanged(); return this; } + /** * * @@ -800,11 +811,12 @@ public Builder setKey(java.lang.String value) { * @return This builder for chaining. */ public Builder clearKey() { - key_ = getDefaultInstance().getKey(); + bitField0_ = (bitField0_ & ~0x00000001); onChanged(); return this; } + /** * * @@ -822,13 +834,14 @@ public Builder setKeyBytes(com.google.protobuf.ByteString value) { throw new NullPointerException(); } checkByteStringIsUtf8(value); - key_ = value; + bitField0_ |= 0x00000001; onChanged(); return this; } private int valueType_ = 0; + /** * * @@ -844,6 +857,7 @@ public Builder setKeyBytes(com.google.protobuf.ByteString value) { public int getValueTypeValue() { return valueType_; } + /** * * @@ -857,11 +871,12 @@ public int getValueTypeValue() { * @return This builder for chaining. */ public Builder setValueTypeValue(int value) { - valueType_ = value; + bitField0_ |= 0x00000002; onChanged(); return this; } + /** * * @@ -875,11 +890,11 @@ public Builder setValueTypeValue(int value) { */ @java.lang.Override public com.google.api.LabelDescriptor.ValueType getValueType() { - @SuppressWarnings("deprecation") com.google.api.LabelDescriptor.ValueType result = - com.google.api.LabelDescriptor.ValueType.valueOf(valueType_); + com.google.api.LabelDescriptor.ValueType.forNumber(valueType_); return result == null ? com.google.api.LabelDescriptor.ValueType.UNRECOGNIZED : result; } + /** * * @@ -896,11 +911,12 @@ public Builder setValueType(com.google.api.LabelDescriptor.ValueType value) { if (value == null) { throw new NullPointerException(); } - + bitField0_ |= 0x00000002; valueType_ = value.getNumber(); onChanged(); return this; } + /** * * @@ -913,13 +929,14 @@ public Builder setValueType(com.google.api.LabelDescriptor.ValueType value) { * @return This builder for chaining. */ public Builder clearValueType() { - + bitField0_ = (bitField0_ & ~0x00000002); valueType_ = 0; onChanged(); return this; } private java.lang.Object description_ = ""; + /** * * @@ -942,6 +959,7 @@ public java.lang.String getDescription() { return (java.lang.String) ref; } } + /** * * @@ -964,6 +982,7 @@ public com.google.protobuf.ByteString getDescriptionBytes() { return (com.google.protobuf.ByteString) ref; } } + /** * * @@ -980,11 +999,12 @@ public Builder setDescription(java.lang.String value) { if (value == null) { throw new NullPointerException(); } - description_ = value; + bitField0_ |= 0x00000004; onChanged(); return this; } + /** * * @@ -997,11 +1017,12 @@ public Builder setDescription(java.lang.String value) { * @return This builder for chaining. */ public Builder clearDescription() { - description_ = getDefaultInstance().getDescription(); + bitField0_ = (bitField0_ & ~0x00000004); onChanged(); return this; } + /** * * @@ -1019,23 +1040,12 @@ public Builder setDescriptionBytes(com.google.protobuf.ByteString value) { throw new NullPointerException(); } checkByteStringIsUtf8(value); - description_ = 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.api.LabelDescriptor) } diff --git a/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/LabelDescriptorOrBuilder.java b/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/LabelDescriptorOrBuilder.java index dbfe91154e..0387992ea4 100644 --- a/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/LabelDescriptorOrBuilder.java +++ b/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/LabelDescriptorOrBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,10 +14,13 @@ * limitations under the License. */ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: google/api/label.proto +// Protobuf Java Version: 4.33.2 package com.google.api; +@com.google.protobuf.Generated public interface LabelDescriptorOrBuilder extends // @@protoc_insertion_point(interface_extends:google.api.LabelDescriptor) @@ -35,6 +38,7 @@ public interface LabelDescriptorOrBuilder * @return The key. */ java.lang.String getKey(); + /** * * @@ -60,6 +64,7 @@ public interface LabelDescriptorOrBuilder * @return The enum numeric value on the wire for valueType. */ int getValueTypeValue(); + /** * * @@ -85,6 +90,7 @@ public interface LabelDescriptorOrBuilder * @return The description. */ java.lang.String getDescription(); + /** * * diff --git a/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/LabelProto.java b/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/LabelProto.java index 4a32bc4b8a..26670b7d15 100644 --- a/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/LabelProto.java +++ b/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/LabelProto.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,13 +14,26 @@ * limitations under the License. */ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: google/api/label.proto +// Protobuf Java Version: 4.33.2 package com.google.api; -public final class LabelProto { +@com.google.protobuf.Generated +public final class LabelProto extends com.google.protobuf.GeneratedFile { private LabelProto() {} + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "LabelProto"); + } + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistryLite registry) {} public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry registry) { @@ -29,7 +42,7 @@ public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry r static final com.google.protobuf.Descriptors.Descriptor internal_static_google_api_LabelDescriptor_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable internal_static_google_api_LabelDescriptor_fieldAccessorTable; public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { @@ -40,26 +53,32 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { static { java.lang.String[] descriptorData = { - "\n\026google/api/label.proto\022\ngoogle.api\"\234\001\n" - + "\017LabelDescriptor\022\013\n\003key\030\001 \001(\t\0229\n\nvalue_t" - + "ype\030\002 \001(\0162%.google.api.LabelDescriptor.V" - + "alueType\022\023\n\013description\030\003 \001(\t\",\n\tValueTy" - + "pe\022\n\n\006STRING\020\000\022\010\n\004BOOL\020\001\022\t\n\005INT64\020\002B_\n\016c" - + "om.google.apiB\nLabelProtoP\001Z5google.gola" - + "ng.org/genproto/googleapis/api/label;lab" - + "el\370\001\001\242\002\004GAPIb\006proto3" + "\n" + + "\026google/api/label.proto\022\n" + + "google.api\"\234\001\n" + + "\017LabelDescriptor\022\013\n" + + "\003key\030\001 \001(\t\0229\n\n" + + "value_type\030\002 \001(\0162%.google.api.LabelDescriptor.ValueType\022\023\n" + + "\013description\030\003 \001(\t\",\n" + + "\tValueType\022\n\n" + + "\006STRING\020\000\022\010\n" + + "\004BOOL\020\001\022\t\n" + + "\005INT64\020\002B\\\n" + + "\016com.google.apiB\n" + + "LabelProtoP\001Z5google.golang.org/genproto/googleapis/api/label;lab" + + "el\242\002\004GAPIb\006proto3" }; descriptor = com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( descriptorData, new com.google.protobuf.Descriptors.FileDescriptor[] {}); - internal_static_google_api_LabelDescriptor_descriptor = - getDescriptor().getMessageTypes().get(0); + internal_static_google_api_LabelDescriptor_descriptor = getDescriptor().getMessageType(0); internal_static_google_api_LabelDescriptor_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_google_api_LabelDescriptor_descriptor, new java.lang.String[] { "Key", "ValueType", "Description", }); + descriptor.resolveAllFeaturesImmutable(); } // @@protoc_insertion_point(outer_class_scope) diff --git a/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/LaunchStage.java b/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/LaunchStage.java index c0c42e10d0..79841817ce 100644 --- a/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/LaunchStage.java +++ b/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/LaunchStage.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,9 @@ * limitations under the License. */ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: google/api/launch_stage.proto +// Protobuf Java Version: 4.33.2 package com.google.api; @@ -28,6 +30,7 @@ * * Protobuf enum {@code google.api.LaunchStage} */ +@com.google.protobuf.Generated public enum LaunchStage implements com.google.protobuf.ProtocolMessageEnum { /** * @@ -133,6 +136,16 @@ public enum LaunchStage implements com.google.protobuf.ProtocolMessageEnum { UNRECOGNIZED(-1), ; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "LaunchStage"); + } + /** * * @@ -143,6 +156,7 @@ public enum LaunchStage implements com.google.protobuf.ProtocolMessageEnum { * LAUNCH_STAGE_UNSPECIFIED = 0; */ public static final int LAUNCH_STAGE_UNSPECIFIED_VALUE = 0; + /** * * @@ -153,6 +167,7 @@ public enum LaunchStage implements com.google.protobuf.ProtocolMessageEnum { * UNIMPLEMENTED = 6; */ public static final int UNIMPLEMENTED_VALUE = 6; + /** * * @@ -163,6 +178,7 @@ public enum LaunchStage implements com.google.protobuf.ProtocolMessageEnum { * PRELAUNCH = 7; */ public static final int PRELAUNCH_VALUE = 7; + /** * * @@ -177,6 +193,7 @@ public enum LaunchStage implements com.google.protobuf.ProtocolMessageEnum { * EARLY_ACCESS = 1; */ public static final int EARLY_ACCESS_VALUE = 1; + /** * * @@ -195,6 +212,7 @@ public enum LaunchStage implements com.google.protobuf.ProtocolMessageEnum { * ALPHA = 2; */ public static final int ALPHA_VALUE = 2; + /** * * @@ -209,6 +227,7 @@ public enum LaunchStage implements com.google.protobuf.ProtocolMessageEnum { * BETA = 3; */ public static final int BETA_VALUE = 3; + /** * * @@ -220,6 +239,7 @@ public enum LaunchStage implements com.google.protobuf.ProtocolMessageEnum { * GA = 4; */ public static final int GA_VALUE = 4; + /** * * @@ -303,7 +323,7 @@ public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType return getDescriptor(); } - public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + public static com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { return com.google.api.LaunchStageProto.getDescriptor().getEnumTypes().get(0); } diff --git a/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/LaunchStageProto.java b/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/LaunchStageProto.java index acc85f9403..e62f94680e 100644 --- a/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/LaunchStageProto.java +++ b/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/LaunchStageProto.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,13 +14,26 @@ * limitations under the License. */ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: google/api/launch_stage.proto +// Protobuf Java Version: 4.33.2 package com.google.api; -public final class LaunchStageProto { +@com.google.protobuf.Generated +public final class LaunchStageProto extends com.google.protobuf.GeneratedFile { private LaunchStageProto() {} + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "LaunchStageProto"); + } + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistryLite registry) {} public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry registry) { @@ -47,6 +60,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { descriptor = com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( descriptorData, new com.google.protobuf.Descriptors.FileDescriptor[] {}); + descriptor.resolveAllFeaturesImmutable(); } // @@protoc_insertion_point(outer_class_scope) diff --git a/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/LogDescriptor.java b/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/LogDescriptor.java index 2ef911f9f7..840da647f1 100644 --- a/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/LogDescriptor.java +++ b/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/LogDescriptor.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,9 @@ * limitations under the License. */ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: google/api/log.proto +// Protobuf Java Version: 4.33.2 package com.google.api; @@ -23,23 +25,36 @@ * *
          * A description of a log type. Example in YAML format:
        - *     - name: library.googleapis.com/activity_history
        - *       description: The history of borrowing and returning library items.
        - *       display_name: Activity
        - *       labels:
        - *       - key: /customer_id
        - *         description: Identifier of a library customer
        + *
        + * - name: library.googleapis.com/activity_history
        + * description: The history of borrowing and returning library items.
        + * display_name: Activity
        + * labels:
        + * - key: /customer_id
        + * description: Identifier of a library customer
          * 
        * * Protobuf type {@code google.api.LogDescriptor} */ -public final class LogDescriptor extends com.google.protobuf.GeneratedMessageV3 +@com.google.protobuf.Generated +public final class LogDescriptor extends com.google.protobuf.GeneratedMessage implements // @@protoc_insertion_point(message_implements:google.api.LogDescriptor) LogDescriptorOrBuilder { private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "LogDescriptor"); + } + // Use LogDescriptor.newBuilder() to construct. - private LogDescriptor(com.google.protobuf.GeneratedMessageV3.Builder builder) { + private LogDescriptor(com.google.protobuf.GeneratedMessage.Builder builder) { super(builder); } @@ -50,23 +65,12 @@ private LogDescriptor() { displayName_ = ""; } - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new LogDescriptor(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.api.LogProto.internal_static_google_api_LogDescriptor_descriptor; } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.api.LogProto.internal_static_google_api_LogDescriptor_fieldAccessorTable .ensureFieldAccessorsInitialized( @@ -74,7 +78,10 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } public static final int NAME_FIELD_NUMBER = 1; - private volatile java.lang.Object name_; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** * * @@ -101,6 +108,7 @@ public java.lang.String getName() { return s; } } + /** * * @@ -129,7 +137,10 @@ public com.google.protobuf.ByteString getNameBytes() { } public static final int LABELS_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") private java.util.List labels_; + /** * * @@ -145,6 +156,7 @@ public com.google.protobuf.ByteString getNameBytes() { public java.util.List getLabelsList() { return labels_; } + /** * * @@ -161,6 +173,7 @@ public java.util.List getLabelsList() { getLabelsOrBuilderList() { return labels_; } + /** * * @@ -176,6 +189,7 @@ public java.util.List getLabelsList() { public int getLabelsCount() { return labels_.size(); } + /** * * @@ -191,6 +205,7 @@ public int getLabelsCount() { public com.google.api.LabelDescriptor getLabels(int index) { return labels_.get(index); } + /** * * @@ -208,7 +223,10 @@ public com.google.api.LabelDescriptorOrBuilder getLabelsOrBuilder(int index) { } public static final int DESCRIPTION_FIELD_NUMBER = 3; - private volatile java.lang.Object description_; + + @SuppressWarnings("serial") + private volatile java.lang.Object description_ = ""; + /** * * @@ -233,6 +251,7 @@ public java.lang.String getDescription() { return s; } } + /** * * @@ -259,7 +278,10 @@ public com.google.protobuf.ByteString getDescriptionBytes() { } public static final int DISPLAY_NAME_FIELD_NUMBER = 4; - private volatile java.lang.Object displayName_; + + @SuppressWarnings("serial") + private volatile java.lang.Object displayName_ = ""; + /** * * @@ -284,6 +306,7 @@ public java.lang.String getDisplayName() { return s; } } + /** * * @@ -323,17 +346,17 @@ public final boolean isInitialized() { @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.GeneratedMessage.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, name_); } for (int i = 0; i < labels_.size(); i++) { output.writeMessage(2, labels_.get(i)); } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(description_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 3, description_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(description_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 3, description_); } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(displayName_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 4, displayName_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(displayName_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 4, displayName_); } getUnknownFields().writeTo(output); } @@ -344,17 +367,17 @@ public int getSerializedSize() { 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.GeneratedMessage.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, name_); } for (int i = 0; i < labels_.size(); i++) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, labels_.get(i)); } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(description_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, description_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(description_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(3, description_); } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(displayName_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, displayName_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(displayName_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(4, displayName_); } size += getUnknownFields().getSerializedSize(); memoizedSize = size; @@ -437,38 +460,38 @@ public static com.google.api.LogDescriptor parseFrom( public static com.google.api.LogDescriptor parseFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); } public static com.google.api.LogDescriptor parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } public static com.google.api.LogDescriptor parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); } public static com.google.api.LogDescriptor parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( PARSER, input, extensionRegistry); } public static com.google.api.LogDescriptor parseFrom(com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); } public static com.google.api.LogDescriptor parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } @@ -491,26 +514,28 @@ public Builder toBuilder() { } @java.lang.Override - protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { Builder builder = new Builder(parent); return builder; } + /** * * *
            * A description of a log type. Example in YAML format:
        -   *     - name: library.googleapis.com/activity_history
        -   *       description: The history of borrowing and returning library items.
        -   *       display_name: Activity
        -   *       labels:
        -   *       - key: /customer_id
        -   *         description: Identifier of a library customer
        +   *
        +   * - name: library.googleapis.com/activity_history
        +   * description: The history of borrowing and returning library items.
        +   * display_name: Activity
        +   * labels:
        +   * - key: /customer_id
        +   * description: Identifier of a library customer
            * 
        * * Protobuf type {@code google.api.LogDescriptor} */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder implements // @@protoc_insertion_point(builder_implements:google.api.LogDescriptor) com.google.api.LogDescriptorOrBuilder { @@ -519,7 +544,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.api.LogProto.internal_static_google_api_LogDescriptor_fieldAccessorTable .ensureFieldAccessorsInitialized( @@ -529,26 +554,24 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { // Construct using com.google.api.LogDescriptor.newBuilder() private Builder() {} - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { super(parent); } @java.lang.Override public Builder clear() { super.clear(); + bitField0_ = 0; name_ = ""; - if (labelsBuilder_ == null) { labels_ = java.util.Collections.emptyList(); } else { labels_ = null; labelsBuilder_.clear(); } - bitField0_ = (bitField0_ & ~0x00000001); + bitField0_ = (bitField0_ & ~0x00000002); description_ = ""; - displayName_ = ""; - return this; } @@ -574,54 +597,37 @@ public com.google.api.LogDescriptor build() { @java.lang.Override public com.google.api.LogDescriptor buildPartial() { com.google.api.LogDescriptor result = new com.google.api.LogDescriptor(this); - int from_bitField0_ = bitField0_; - result.name_ = name_; + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields(com.google.api.LogDescriptor result) { if (labelsBuilder_ == null) { - if (((bitField0_ & 0x00000001) != 0)) { + if (((bitField0_ & 0x00000002) != 0)) { labels_ = java.util.Collections.unmodifiableList(labels_); - bitField0_ = (bitField0_ & ~0x00000001); + bitField0_ = (bitField0_ & ~0x00000002); } result.labels_ = labels_; } else { result.labels_ = labelsBuilder_.build(); } - result.description_ = description_; - result.displayName_ = displayName_; - 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); + private void buildPartial0(com.google.api.LogDescriptor result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.description_ = description_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.displayName_ = displayName_; + } } @java.lang.Override @@ -638,13 +644,14 @@ public Builder mergeFrom(com.google.api.LogDescriptor other) { if (other == com.google.api.LogDescriptor.getDefaultInstance()) return this; if (!other.getName().isEmpty()) { name_ = other.name_; + bitField0_ |= 0x00000001; onChanged(); } if (labelsBuilder_ == null) { if (!other.labels_.isEmpty()) { if (labels_.isEmpty()) { labels_ = other.labels_; - bitField0_ = (bitField0_ & ~0x00000001); + bitField0_ = (bitField0_ & ~0x00000002); } else { ensureLabelsIsMutable(); labels_.addAll(other.labels_); @@ -657,10 +664,10 @@ public Builder mergeFrom(com.google.api.LogDescriptor other) { labelsBuilder_.dispose(); labelsBuilder_ = null; labels_ = other.labels_; - bitField0_ = (bitField0_ & ~0x00000001); + bitField0_ = (bitField0_ & ~0x00000002); labelsBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders - ? getLabelsFieldBuilder() + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders + ? internalGetLabelsFieldBuilder() : null; } else { labelsBuilder_.addAllMessages(other.labels_); @@ -669,10 +676,12 @@ public Builder mergeFrom(com.google.api.LogDescriptor other) { } if (!other.getDescription().isEmpty()) { description_ = other.description_; + bitField0_ |= 0x00000004; onChanged(); } if (!other.getDisplayName().isEmpty()) { displayName_ = other.displayName_; + bitField0_ |= 0x00000008; onChanged(); } this.mergeUnknownFields(other.getUnknownFields()); @@ -704,7 +713,7 @@ public Builder mergeFrom( case 10: { name_ = input.readStringRequireUtf8(); - + bitField0_ |= 0x00000001; break; } // case 10 case 18: @@ -722,13 +731,13 @@ public Builder mergeFrom( case 26: { description_ = input.readStringRequireUtf8(); - + bitField0_ |= 0x00000004; break; } // case 26 case 34: { displayName_ = input.readStringRequireUtf8(); - + bitField0_ |= 0x00000008; break; } // case 34 default: @@ -751,6 +760,7 @@ public Builder mergeFrom( private int bitField0_; private java.lang.Object name_ = ""; + /** * * @@ -776,6 +786,7 @@ public java.lang.String getName() { return (java.lang.String) ref; } } + /** * * @@ -801,6 +812,7 @@ public com.google.protobuf.ByteString getNameBytes() { return (com.google.protobuf.ByteString) ref; } } + /** * * @@ -820,11 +832,12 @@ public Builder setName(java.lang.String value) { if (value == null) { throw new NullPointerException(); } - name_ = value; + bitField0_ |= 0x00000001; onChanged(); return this; } + /** * * @@ -840,11 +853,12 @@ public Builder setName(java.lang.String value) { * @return This builder for chaining. */ public Builder clearName() { - name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); onChanged(); return this; } + /** * * @@ -865,8 +879,8 @@ public Builder setNameBytes(com.google.protobuf.ByteString value) { throw new NullPointerException(); } checkByteStringIsUtf8(value); - name_ = value; + bitField0_ |= 0x00000001; onChanged(); return this; } @@ -875,13 +889,13 @@ public Builder setNameBytes(com.google.protobuf.ByteString value) { java.util.Collections.emptyList(); private void ensureLabelsIsMutable() { - if (!((bitField0_ & 0x00000001) != 0)) { + if (!((bitField0_ & 0x00000002) != 0)) { labels_ = new java.util.ArrayList(labels_); - bitField0_ |= 0x00000001; + bitField0_ |= 0x00000002; } } - private com.google.protobuf.RepeatedFieldBuilderV3< + private com.google.protobuf.RepeatedFieldBuilder< com.google.api.LabelDescriptor, com.google.api.LabelDescriptor.Builder, com.google.api.LabelDescriptorOrBuilder> @@ -905,6 +919,7 @@ public java.util.List getLabelsList() { return labelsBuilder_.getMessageList(); } } + /** * * @@ -923,6 +938,7 @@ public int getLabelsCount() { return labelsBuilder_.getCount(); } } + /** * * @@ -941,6 +957,7 @@ public com.google.api.LabelDescriptor getLabels(int index) { return labelsBuilder_.getMessage(index); } } + /** * * @@ -965,6 +982,7 @@ public Builder setLabels(int index, com.google.api.LabelDescriptor value) { } return this; } + /** * * @@ -986,6 +1004,7 @@ public Builder setLabels(int index, com.google.api.LabelDescriptor.Builder build } return this; } + /** * * @@ -1010,6 +1029,7 @@ public Builder addLabels(com.google.api.LabelDescriptor value) { } return this; } + /** * * @@ -1034,6 +1054,7 @@ public Builder addLabels(int index, com.google.api.LabelDescriptor value) { } return this; } + /** * * @@ -1055,6 +1076,7 @@ public Builder addLabels(com.google.api.LabelDescriptor.Builder builderForValue) } return this; } + /** * * @@ -1076,6 +1098,7 @@ public Builder addLabels(int index, com.google.api.LabelDescriptor.Builder build } return this; } + /** * * @@ -1098,6 +1121,7 @@ public Builder addAllLabels( } return this; } + /** * * @@ -1112,13 +1136,14 @@ public Builder addAllLabels( public Builder clearLabels() { if (labelsBuilder_ == null) { labels_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); + bitField0_ = (bitField0_ & ~0x00000002); onChanged(); } else { labelsBuilder_.clear(); } return this; } + /** * * @@ -1140,6 +1165,7 @@ public Builder removeLabels(int index) { } return this; } + /** * * @@ -1152,8 +1178,9 @@ public Builder removeLabels(int index) { * repeated .google.api.LabelDescriptor labels = 2; */ public com.google.api.LabelDescriptor.Builder getLabelsBuilder(int index) { - return getLabelsFieldBuilder().getBuilder(index); + return internalGetLabelsFieldBuilder().getBuilder(index); } + /** * * @@ -1172,6 +1199,7 @@ public com.google.api.LabelDescriptorOrBuilder getLabelsOrBuilder(int index) { return labelsBuilder_.getMessageOrBuilder(index); } } + /** * * @@ -1191,6 +1219,7 @@ public com.google.api.LabelDescriptorOrBuilder getLabelsOrBuilder(int index) { return java.util.Collections.unmodifiableList(labels_); } } + /** * * @@ -1203,9 +1232,10 @@ public com.google.api.LabelDescriptorOrBuilder getLabelsOrBuilder(int index) { * repeated .google.api.LabelDescriptor labels = 2; */ public com.google.api.LabelDescriptor.Builder addLabelsBuilder() { - return getLabelsFieldBuilder() + return internalGetLabelsFieldBuilder() .addBuilder(com.google.api.LabelDescriptor.getDefaultInstance()); } + /** * * @@ -1218,9 +1248,10 @@ public com.google.api.LabelDescriptor.Builder addLabelsBuilder() { * repeated .google.api.LabelDescriptor labels = 2; */ public com.google.api.LabelDescriptor.Builder addLabelsBuilder(int index) { - return getLabelsFieldBuilder() + return internalGetLabelsFieldBuilder() .addBuilder(index, com.google.api.LabelDescriptor.getDefaultInstance()); } + /** * * @@ -1233,27 +1264,28 @@ public com.google.api.LabelDescriptor.Builder addLabelsBuilder(int index) { * repeated .google.api.LabelDescriptor labels = 2; */ public java.util.List getLabelsBuilderList() { - return getLabelsFieldBuilder().getBuilderList(); + return internalGetLabelsFieldBuilder().getBuilderList(); } - private com.google.protobuf.RepeatedFieldBuilderV3< + private com.google.protobuf.RepeatedFieldBuilder< com.google.api.LabelDescriptor, com.google.api.LabelDescriptor.Builder, com.google.api.LabelDescriptorOrBuilder> - getLabelsFieldBuilder() { + internalGetLabelsFieldBuilder() { if (labelsBuilder_ == null) { labelsBuilder_ = - new com.google.protobuf.RepeatedFieldBuilderV3< + new com.google.protobuf.RepeatedFieldBuilder< com.google.api.LabelDescriptor, com.google.api.LabelDescriptor.Builder, com.google.api.LabelDescriptorOrBuilder>( - labels_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + labels_, ((bitField0_ & 0x00000002) != 0), getParentForChildren(), isClean()); labels_ = null; } return labelsBuilder_; } private java.lang.Object description_ = ""; + /** * * @@ -1277,6 +1309,7 @@ public java.lang.String getDescription() { return (java.lang.String) ref; } } + /** * * @@ -1300,6 +1333,7 @@ public com.google.protobuf.ByteString getDescriptionBytes() { return (com.google.protobuf.ByteString) ref; } } + /** * * @@ -1317,11 +1351,12 @@ public Builder setDescription(java.lang.String value) { if (value == null) { throw new NullPointerException(); } - description_ = value; + bitField0_ |= 0x00000004; onChanged(); return this; } + /** * * @@ -1335,11 +1370,12 @@ public Builder setDescription(java.lang.String value) { * @return This builder for chaining. */ public Builder clearDescription() { - description_ = getDefaultInstance().getDescription(); + bitField0_ = (bitField0_ & ~0x00000004); onChanged(); return this; } + /** * * @@ -1358,13 +1394,14 @@ public Builder setDescriptionBytes(com.google.protobuf.ByteString value) { throw new NullPointerException(); } checkByteStringIsUtf8(value); - description_ = value; + bitField0_ |= 0x00000004; onChanged(); return this; } private java.lang.Object displayName_ = ""; + /** * * @@ -1388,6 +1425,7 @@ public java.lang.String getDisplayName() { return (java.lang.String) ref; } } + /** * * @@ -1411,6 +1449,7 @@ public com.google.protobuf.ByteString getDisplayNameBytes() { return (com.google.protobuf.ByteString) ref; } } + /** * * @@ -1428,11 +1467,12 @@ public Builder setDisplayName(java.lang.String value) { if (value == null) { throw new NullPointerException(); } - displayName_ = value; + bitField0_ |= 0x00000008; onChanged(); return this; } + /** * * @@ -1446,11 +1486,12 @@ public Builder setDisplayName(java.lang.String value) { * @return This builder for chaining. */ public Builder clearDisplayName() { - displayName_ = getDefaultInstance().getDisplayName(); + bitField0_ = (bitField0_ & ~0x00000008); onChanged(); return this; } + /** * * @@ -1469,23 +1510,12 @@ public Builder setDisplayNameBytes(com.google.protobuf.ByteString value) { throw new NullPointerException(); } checkByteStringIsUtf8(value); - displayName_ = 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.api.LogDescriptor) } diff --git a/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/LogDescriptorOrBuilder.java b/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/LogDescriptorOrBuilder.java index 6a08375afd..aeb4c62ebd 100644 --- a/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/LogDescriptorOrBuilder.java +++ b/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/LogDescriptorOrBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,10 +14,13 @@ * limitations under the License. */ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: google/api/log.proto +// Protobuf Java Version: 4.33.2 package com.google.api; +@com.google.protobuf.Generated public interface LogDescriptorOrBuilder extends // @@protoc_insertion_point(interface_extends:google.api.LogDescriptor) @@ -38,6 +41,7 @@ public interface LogDescriptorOrBuilder * @return The name. */ java.lang.String getName(); + /** * * @@ -66,6 +70,7 @@ public interface LogDescriptorOrBuilder * repeated .google.api.LabelDescriptor labels = 2; */ java.util.List getLabelsList(); + /** * * @@ -78,6 +83,7 @@ public interface LogDescriptorOrBuilder * repeated .google.api.LabelDescriptor labels = 2; */ com.google.api.LabelDescriptor getLabels(int index); + /** * * @@ -90,6 +96,7 @@ public interface LogDescriptorOrBuilder * repeated .google.api.LabelDescriptor labels = 2; */ int getLabelsCount(); + /** * * @@ -102,6 +109,7 @@ public interface LogDescriptorOrBuilder * repeated .google.api.LabelDescriptor labels = 2; */ java.util.List getLabelsOrBuilderList(); + /** * * @@ -128,6 +136,7 @@ public interface LogDescriptorOrBuilder * @return The description. */ java.lang.String getDescription(); + /** * * @@ -155,6 +164,7 @@ public interface LogDescriptorOrBuilder * @return The displayName. */ java.lang.String getDisplayName(); + /** * * diff --git a/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/LogProto.java b/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/LogProto.java index 2aaad09035..a1ddf3479a 100644 --- a/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/LogProto.java +++ b/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/LogProto.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,13 +14,26 @@ * limitations under the License. */ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: google/api/log.proto +// Protobuf Java Version: 4.33.2 package com.google.api; -public final class LogProto { +@com.google.protobuf.Generated +public final class LogProto extends com.google.protobuf.GeneratedFile { private LogProto() {} + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "LogProto"); + } + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistryLite registry) {} public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry registry) { @@ -29,7 +42,7 @@ public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry r static final com.google.protobuf.Descriptors.Descriptor internal_static_google_api_LogDescriptor_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable internal_static_google_api_LogDescriptor_fieldAccessorTable; public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { @@ -55,13 +68,14 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { new com.google.protobuf.Descriptors.FileDescriptor[] { com.google.api.LabelProto.getDescriptor(), }); - internal_static_google_api_LogDescriptor_descriptor = getDescriptor().getMessageTypes().get(0); + internal_static_google_api_LogDescriptor_descriptor = getDescriptor().getMessageType(0); internal_static_google_api_LogDescriptor_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_google_api_LogDescriptor_descriptor, new java.lang.String[] { "Name", "Labels", "Description", "DisplayName", }); + descriptor.resolveAllFeaturesImmutable(); com.google.api.LabelProto.getDescriptor(); } diff --git a/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/Logging.java b/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/Logging.java index e2a0cee591..2fc2f7f125 100644 --- a/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/Logging.java +++ b/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/Logging.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,9 @@ * limitations under the License. */ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: google/api/logging.proto +// Protobuf Java Version: 4.33.2 package com.google.api; @@ -23,43 +25,57 @@ * *
          * Logging configuration of the service.
        + *
          * The following example shows how to configure logs to be sent to the
          * producer and consumer projects. In the example, the `activity_history`
          * log is sent to both the producer and consumer projects, whereas the
          * `purchase_history` log is only sent to the producer project.
        - *     monitored_resources:
        - *     - type: library.googleapis.com/branch
        - *       labels:
        - *       - key: /city
        - *         description: The city where the library branch is located in.
        - *       - key: /name
        - *         description: The name of the branch.
        - *     logs:
        - *     - name: activity_history
        - *       labels:
        - *       - key: /customer_id
        - *     - name: purchase_history
        - *     logging:
        - *       producer_destinations:
        - *       - monitored_resource: library.googleapis.com/branch
        - *         logs:
        - *         - activity_history
        - *         - purchase_history
        - *       consumer_destinations:
        - *       - monitored_resource: library.googleapis.com/branch
        - *         logs:
        - *         - activity_history
        + *
        + * monitored_resources:
        + * - type: library.googleapis.com/branch
        + * labels:
        + * - key: /city
        + * description: The city where the library branch is located in.
        + * - key: /name
        + * description: The name of the branch.
        + * logs:
        + * - name: activity_history
        + * labels:
        + * - key: /customer_id
        + * - name: purchase_history
        + * logging:
        + * producer_destinations:
        + * - monitored_resource: library.googleapis.com/branch
        + * logs:
        + * - activity_history
        + * - purchase_history
        + * consumer_destinations:
        + * - monitored_resource: library.googleapis.com/branch
        + * logs:
        + * - activity_history
          * 
        * * Protobuf type {@code google.api.Logging} */ -public final class Logging extends com.google.protobuf.GeneratedMessageV3 +@com.google.protobuf.Generated +public final class Logging extends com.google.protobuf.GeneratedMessage implements // @@protoc_insertion_point(message_implements:google.api.Logging) LoggingOrBuilder { private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "Logging"); + } + // Use Logging.newBuilder() to construct. - private Logging(com.google.protobuf.GeneratedMessageV3.Builder builder) { + private Logging(com.google.protobuf.GeneratedMessage.Builder builder) { super(builder); } @@ -68,23 +84,12 @@ private Logging() { consumerDestinations_ = java.util.Collections.emptyList(); } - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new Logging(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.api.LoggingProto.internal_static_google_api_Logging_descriptor; } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.api.LoggingProto.internal_static_google_api_Logging_fieldAccessorTable .ensureFieldAccessorsInitialized( @@ -101,7 +106,8 @@ public interface LoggingDestinationOrBuilder * *
              * The monitored resource type. The type must be defined in the
        -     * [Service.monitored_resources][google.api.Service.monitored_resources] section.
        +     * [Service.monitored_resources][google.api.Service.monitored_resources]
        +     * section.
              * 
        * * string monitored_resource = 3; @@ -109,12 +115,14 @@ public interface LoggingDestinationOrBuilder * @return The monitoredResource. */ java.lang.String getMonitoredResource(); + /** * * *
              * The monitored resource type. The type must be defined in the
        -     * [Service.monitored_resources][google.api.Service.monitored_resources] section.
        +     * [Service.monitored_resources][google.api.Service.monitored_resources]
        +     * section.
              * 
        * * string monitored_resource = 3; @@ -128,9 +136,9 @@ public interface LoggingDestinationOrBuilder * *
              * Names of the logs to be sent to this destination. Each name must
        -     * be defined in the [Service.logs][google.api.Service.logs] section. If the log name is
        -     * not a domain scoped name, it will be automatically prefixed with
        -     * the service name followed by "/".
        +     * be defined in the [Service.logs][google.api.Service.logs] section. If the
        +     * log name is not a domain scoped name, it will be automatically prefixed
        +     * with the service name followed by "/".
              * 
        * * repeated string logs = 1; @@ -138,14 +146,15 @@ public interface LoggingDestinationOrBuilder * @return A list containing the logs. */ java.util.List getLogsList(); + /** * * *
              * Names of the logs to be sent to this destination. Each name must
        -     * be defined in the [Service.logs][google.api.Service.logs] section. If the log name is
        -     * not a domain scoped name, it will be automatically prefixed with
        -     * the service name followed by "/".
        +     * be defined in the [Service.logs][google.api.Service.logs] section. If the
        +     * log name is not a domain scoped name, it will be automatically prefixed
        +     * with the service name followed by "/".
              * 
        * * repeated string logs = 1; @@ -153,14 +162,15 @@ public interface LoggingDestinationOrBuilder * @return The count of logs. */ int getLogsCount(); + /** * * *
              * Names of the logs to be sent to this destination. Each name must
        -     * be defined in the [Service.logs][google.api.Service.logs] section. If the log name is
        -     * not a domain scoped name, it will be automatically prefixed with
        -     * the service name followed by "/".
        +     * be defined in the [Service.logs][google.api.Service.logs] section. If the
        +     * log name is not a domain scoped name, it will be automatically prefixed
        +     * with the service name followed by "/".
              * 
        * * repeated string logs = 1; @@ -169,14 +179,15 @@ public interface LoggingDestinationOrBuilder * @return The logs at the given index. */ java.lang.String getLogs(int index); + /** * * *
              * Names of the logs to be sent to this destination. Each name must
        -     * be defined in the [Service.logs][google.api.Service.logs] section. If the log name is
        -     * not a domain scoped name, it will be automatically prefixed with
        -     * the service name followed by "/".
        +     * be defined in the [Service.logs][google.api.Service.logs] section. If the
        +     * log name is not a domain scoped name, it will be automatically prefixed
        +     * with the service name followed by "/".
              * 
        * * repeated string logs = 1; @@ -186,6 +197,7 @@ public interface LoggingDestinationOrBuilder */ com.google.protobuf.ByteString getLogsBytes(int index); } + /** * * @@ -196,30 +208,30 @@ public interface LoggingDestinationOrBuilder * * Protobuf type {@code google.api.Logging.LoggingDestination} */ - public static final class LoggingDestination extends com.google.protobuf.GeneratedMessageV3 + public static final class LoggingDestination extends com.google.protobuf.GeneratedMessage implements // @@protoc_insertion_point(message_implements:google.api.Logging.LoggingDestination) LoggingDestinationOrBuilder { private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "LoggingDestination"); + } + // Use LoggingDestination.newBuilder() to construct. - private LoggingDestination(com.google.protobuf.GeneratedMessageV3.Builder builder) { + private LoggingDestination(com.google.protobuf.GeneratedMessage.Builder builder) { super(builder); } private LoggingDestination() { monitoredResource_ = ""; - logs_ = com.google.protobuf.LazyStringArrayList.EMPTY; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new LoggingDestination(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; + logs_ = com.google.protobuf.LazyStringArrayList.emptyList(); } public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { @@ -228,7 +240,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.api.LoggingProto .internal_static_google_api_Logging_LoggingDestination_fieldAccessorTable @@ -238,13 +250,17 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } public static final int MONITORED_RESOURCE_FIELD_NUMBER = 3; - private volatile java.lang.Object monitoredResource_; + + @SuppressWarnings("serial") + private volatile java.lang.Object monitoredResource_ = ""; + /** * * *
              * The monitored resource type. The type must be defined in the
        -     * [Service.monitored_resources][google.api.Service.monitored_resources] section.
        +     * [Service.monitored_resources][google.api.Service.monitored_resources]
        +     * section.
              * 
        * * string monitored_resource = 3; @@ -263,12 +279,14 @@ public java.lang.String getMonitoredResource() { return s; } } + /** * * *
              * The monitored resource type. The type must be defined in the
        -     * [Service.monitored_resources][google.api.Service.monitored_resources] section.
        +     * [Service.monitored_resources][google.api.Service.monitored_resources]
        +     * section.
              * 
        * * string monitored_resource = 3; @@ -289,15 +307,19 @@ public com.google.protobuf.ByteString getMonitoredResourceBytes() { } public static final int LOGS_FIELD_NUMBER = 1; - private com.google.protobuf.LazyStringList logs_; + + @SuppressWarnings("serial") + private com.google.protobuf.LazyStringArrayList logs_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + /** * * *
              * Names of the logs to be sent to this destination. Each name must
        -     * be defined in the [Service.logs][google.api.Service.logs] section. If the log name is
        -     * not a domain scoped name, it will be automatically prefixed with
        -     * the service name followed by "/".
        +     * be defined in the [Service.logs][google.api.Service.logs] section. If the
        +     * log name is not a domain scoped name, it will be automatically prefixed
        +     * with the service name followed by "/".
              * 
        * * repeated string logs = 1; @@ -307,14 +329,15 @@ public com.google.protobuf.ByteString getMonitoredResourceBytes() { public com.google.protobuf.ProtocolStringList getLogsList() { return logs_; } + /** * * *
              * Names of the logs to be sent to this destination. Each name must
        -     * be defined in the [Service.logs][google.api.Service.logs] section. If the log name is
        -     * not a domain scoped name, it will be automatically prefixed with
        -     * the service name followed by "/".
        +     * be defined in the [Service.logs][google.api.Service.logs] section. If the
        +     * log name is not a domain scoped name, it will be automatically prefixed
        +     * with the service name followed by "/".
              * 
        * * repeated string logs = 1; @@ -324,14 +347,15 @@ public com.google.protobuf.ProtocolStringList getLogsList() { public int getLogsCount() { return logs_.size(); } + /** * * *
              * Names of the logs to be sent to this destination. Each name must
        -     * be defined in the [Service.logs][google.api.Service.logs] section. If the log name is
        -     * not a domain scoped name, it will be automatically prefixed with
        -     * the service name followed by "/".
        +     * be defined in the [Service.logs][google.api.Service.logs] section. If the
        +     * log name is not a domain scoped name, it will be automatically prefixed
        +     * with the service name followed by "/".
              * 
        * * repeated string logs = 1; @@ -342,14 +366,15 @@ public int getLogsCount() { public java.lang.String getLogs(int index) { return logs_.get(index); } + /** * * *
              * Names of the logs to be sent to this destination. Each name must
        -     * be defined in the [Service.logs][google.api.Service.logs] section. If the log name is
        -     * not a domain scoped name, it will be automatically prefixed with
        -     * the service name followed by "/".
        +     * be defined in the [Service.logs][google.api.Service.logs] section. If the
        +     * log name is not a domain scoped name, it will be automatically prefixed
        +     * with the service name followed by "/".
              * 
        * * repeated string logs = 1; @@ -376,10 +401,10 @@ public final boolean isInitialized() { @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { for (int i = 0; i < logs_.size(); i++) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, logs_.getRaw(i)); + com.google.protobuf.GeneratedMessage.writeString(output, 1, logs_.getRaw(i)); } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(monitoredResource_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 3, monitoredResource_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(monitoredResource_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 3, monitoredResource_); } getUnknownFields().writeTo(output); } @@ -398,8 +423,8 @@ public int getSerializedSize() { size += dataSize; size += 1 * getLogsList().size(); } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(monitoredResource_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, monitoredResource_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(monitoredResource_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(3, monitoredResource_); } size += getUnknownFields().getSerializedSize(); memoizedSize = size; @@ -478,38 +503,38 @@ public static com.google.api.Logging.LoggingDestination parseFrom( public static com.google.api.Logging.LoggingDestination parseFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); } public static com.google.api.Logging.LoggingDestination parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } public static com.google.api.Logging.LoggingDestination parseDelimitedFrom( java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); } public static com.google.api.Logging.LoggingDestination parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( PARSER, input, extensionRegistry); } public static com.google.api.Logging.LoggingDestination parseFrom( com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); } public static com.google.api.Logging.LoggingDestination parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } @@ -532,11 +557,11 @@ public Builder toBuilder() { } @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { Builder builder = new Builder(parent); return builder; } + /** * * @@ -547,8 +572,7 @@ protected Builder newBuilderForType( * * Protobuf type {@code google.api.Logging.LoggingDestination} */ - public static final class Builder - extends com.google.protobuf.GeneratedMessageV3.Builder + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder implements // @@protoc_insertion_point(builder_implements:google.api.Logging.LoggingDestination) com.google.api.Logging.LoggingDestinationOrBuilder { @@ -558,7 +582,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.api.LoggingProto .internal_static_google_api_Logging_LoggingDestination_fieldAccessorTable @@ -570,17 +594,16 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { // Construct using com.google.api.Logging.LoggingDestination.newBuilder() private Builder() {} - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { super(parent); } @java.lang.Override public Builder clear() { super.clear(); + bitField0_ = 0; monitoredResource_ = ""; - - logs_ = com.google.protobuf.LazyStringArrayList.EMPTY; - bitField0_ = (bitField0_ & ~0x00000001); + logs_ = com.google.protobuf.LazyStringArrayList.emptyList(); return this; } @@ -608,50 +631,22 @@ public com.google.api.Logging.LoggingDestination build() { public com.google.api.Logging.LoggingDestination buildPartial() { com.google.api.Logging.LoggingDestination result = new com.google.api.Logging.LoggingDestination(this); - int from_bitField0_ = bitField0_; - result.monitoredResource_ = monitoredResource_; - if (((bitField0_ & 0x00000001) != 0)) { - logs_ = logs_.getUnmodifiableView(); - bitField0_ = (bitField0_ & ~0x00000001); + if (bitField0_ != 0) { + buildPartial0(result); } - result.logs_ = logs_; 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); + private void buildPartial0(com.google.api.Logging.LoggingDestination result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.monitoredResource_ = monitoredResource_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + logs_.makeImmutable(); + result.logs_ = logs_; + } } @java.lang.Override @@ -668,12 +663,13 @@ public Builder mergeFrom(com.google.api.Logging.LoggingDestination other) { if (other == com.google.api.Logging.LoggingDestination.getDefaultInstance()) return this; if (!other.getMonitoredResource().isEmpty()) { monitoredResource_ = other.monitoredResource_; + bitField0_ |= 0x00000001; onChanged(); } if (!other.logs_.isEmpty()) { if (logs_.isEmpty()) { logs_ = other.logs_; - bitField0_ = (bitField0_ & ~0x00000001); + bitField0_ |= 0x00000002; } else { ensureLogsIsMutable(); logs_.addAll(other.logs_); @@ -716,7 +712,7 @@ public Builder mergeFrom( case 26: { monitoredResource_ = input.readStringRequireUtf8(); - + bitField0_ |= 0x00000001; break; } // case 26 default: @@ -739,12 +735,14 @@ public Builder mergeFrom( private int bitField0_; private java.lang.Object monitoredResource_ = ""; + /** * * *
                * The monitored resource type. The type must be defined in the
        -       * [Service.monitored_resources][google.api.Service.monitored_resources] section.
        +       * [Service.monitored_resources][google.api.Service.monitored_resources]
        +       * section.
                * 
        * * string monitored_resource = 3; @@ -762,12 +760,14 @@ public java.lang.String getMonitoredResource() { return (java.lang.String) ref; } } + /** * * *
                * The monitored resource type. The type must be defined in the
        -       * [Service.monitored_resources][google.api.Service.monitored_resources] section.
        +       * [Service.monitored_resources][google.api.Service.monitored_resources]
        +       * section.
                * 
        * * string monitored_resource = 3; @@ -785,12 +785,14 @@ public com.google.protobuf.ByteString getMonitoredResourceBytes() { return (com.google.protobuf.ByteString) ref; } } + /** * * *
                * The monitored resource type. The type must be defined in the
        -       * [Service.monitored_resources][google.api.Service.monitored_resources] section.
        +       * [Service.monitored_resources][google.api.Service.monitored_resources]
        +       * section.
                * 
        * * string monitored_resource = 3; @@ -802,17 +804,19 @@ public Builder setMonitoredResource(java.lang.String value) { if (value == null) { throw new NullPointerException(); } - monitoredResource_ = value; + bitField0_ |= 0x00000001; onChanged(); return this; } + /** * * *
                * The monitored resource type. The type must be defined in the
        -       * [Service.monitored_resources][google.api.Service.monitored_resources] section.
        +       * [Service.monitored_resources][google.api.Service.monitored_resources]
        +       * section.
                * 
        * * string monitored_resource = 3; @@ -820,17 +824,19 @@ public Builder setMonitoredResource(java.lang.String value) { * @return This builder for chaining. */ public Builder clearMonitoredResource() { - monitoredResource_ = getDefaultInstance().getMonitoredResource(); + bitField0_ = (bitField0_ & ~0x00000001); onChanged(); return this; } + /** * * *
                * The monitored resource type. The type must be defined in the
        -       * [Service.monitored_resources][google.api.Service.monitored_resources] section.
        +       * [Service.monitored_resources][google.api.Service.monitored_resources]
        +       * section.
                * 
        * * string monitored_resource = 3; @@ -843,29 +849,30 @@ public Builder setMonitoredResourceBytes(com.google.protobuf.ByteString value) { throw new NullPointerException(); } checkByteStringIsUtf8(value); - monitoredResource_ = value; + bitField0_ |= 0x00000001; onChanged(); return this; } - private com.google.protobuf.LazyStringList logs_ = - com.google.protobuf.LazyStringArrayList.EMPTY; + private com.google.protobuf.LazyStringArrayList logs_ = + com.google.protobuf.LazyStringArrayList.emptyList(); private void ensureLogsIsMutable() { - if (!((bitField0_ & 0x00000001) != 0)) { + if (!logs_.isModifiable()) { logs_ = new com.google.protobuf.LazyStringArrayList(logs_); - bitField0_ |= 0x00000001; } + bitField0_ |= 0x00000002; } + /** * * *
                * Names of the logs to be sent to this destination. Each name must
        -       * be defined in the [Service.logs][google.api.Service.logs] section. If the log name is
        -       * not a domain scoped name, it will be automatically prefixed with
        -       * the service name followed by "/".
        +       * be defined in the [Service.logs][google.api.Service.logs] section. If the
        +       * log name is not a domain scoped name, it will be automatically prefixed
        +       * with the service name followed by "/".
                * 
        * * repeated string logs = 1; @@ -873,16 +880,18 @@ private void ensureLogsIsMutable() { * @return A list containing the logs. */ public com.google.protobuf.ProtocolStringList getLogsList() { - return logs_.getUnmodifiableView(); + logs_.makeImmutable(); + return logs_; } + /** * * *
                * Names of the logs to be sent to this destination. Each name must
        -       * be defined in the [Service.logs][google.api.Service.logs] section. If the log name is
        -       * not a domain scoped name, it will be automatically prefixed with
        -       * the service name followed by "/".
        +       * be defined in the [Service.logs][google.api.Service.logs] section. If the
        +       * log name is not a domain scoped name, it will be automatically prefixed
        +       * with the service name followed by "/".
                * 
        * * repeated string logs = 1; @@ -892,14 +901,15 @@ public com.google.protobuf.ProtocolStringList getLogsList() { public int getLogsCount() { return logs_.size(); } + /** * * *
                * Names of the logs to be sent to this destination. Each name must
        -       * be defined in the [Service.logs][google.api.Service.logs] section. If the log name is
        -       * not a domain scoped name, it will be automatically prefixed with
        -       * the service name followed by "/".
        +       * be defined in the [Service.logs][google.api.Service.logs] section. If the
        +       * log name is not a domain scoped name, it will be automatically prefixed
        +       * with the service name followed by "/".
                * 
        * * repeated string logs = 1; @@ -910,14 +920,15 @@ public int getLogsCount() { public java.lang.String getLogs(int index) { return logs_.get(index); } + /** * * *
                * Names of the logs to be sent to this destination. Each name must
        -       * be defined in the [Service.logs][google.api.Service.logs] section. If the log name is
        -       * not a domain scoped name, it will be automatically prefixed with
        -       * the service name followed by "/".
        +       * be defined in the [Service.logs][google.api.Service.logs] section. If the
        +       * log name is not a domain scoped name, it will be automatically prefixed
        +       * with the service name followed by "/".
                * 
        * * repeated string logs = 1; @@ -928,14 +939,15 @@ public java.lang.String getLogs(int index) { public com.google.protobuf.ByteString getLogsBytes(int index) { return logs_.getByteString(index); } + /** * * *
                * Names of the logs to be sent to this destination. Each name must
        -       * be defined in the [Service.logs][google.api.Service.logs] section. If the log name is
        -       * not a domain scoped name, it will be automatically prefixed with
        -       * the service name followed by "/".
        +       * be defined in the [Service.logs][google.api.Service.logs] section. If the
        +       * log name is not a domain scoped name, it will be automatically prefixed
        +       * with the service name followed by "/".
                * 
        * * repeated string logs = 1; @@ -950,17 +962,19 @@ public Builder setLogs(int index, java.lang.String value) { } ensureLogsIsMutable(); logs_.set(index, value); + bitField0_ |= 0x00000002; onChanged(); return this; } + /** * * *
                * Names of the logs to be sent to this destination. Each name must
        -       * be defined in the [Service.logs][google.api.Service.logs] section. If the log name is
        -       * not a domain scoped name, it will be automatically prefixed with
        -       * the service name followed by "/".
        +       * be defined in the [Service.logs][google.api.Service.logs] section. If the
        +       * log name is not a domain scoped name, it will be automatically prefixed
        +       * with the service name followed by "/".
                * 
        * * repeated string logs = 1; @@ -974,17 +988,19 @@ public Builder addLogs(java.lang.String value) { } ensureLogsIsMutable(); logs_.add(value); + bitField0_ |= 0x00000002; onChanged(); return this; } + /** * * *
                * Names of the logs to be sent to this destination. Each name must
        -       * be defined in the [Service.logs][google.api.Service.logs] section. If the log name is
        -       * not a domain scoped name, it will be automatically prefixed with
        -       * the service name followed by "/".
        +       * be defined in the [Service.logs][google.api.Service.logs] section. If the
        +       * log name is not a domain scoped name, it will be automatically prefixed
        +       * with the service name followed by "/".
                * 
        * * repeated string logs = 1; @@ -995,17 +1011,19 @@ public Builder addLogs(java.lang.String value) { public Builder addAllLogs(java.lang.Iterable values) { ensureLogsIsMutable(); com.google.protobuf.AbstractMessageLite.Builder.addAll(values, logs_); + bitField0_ |= 0x00000002; onChanged(); return this; } + /** * * *
                * Names of the logs to be sent to this destination. Each name must
        -       * be defined in the [Service.logs][google.api.Service.logs] section. If the log name is
        -       * not a domain scoped name, it will be automatically prefixed with
        -       * the service name followed by "/".
        +       * be defined in the [Service.logs][google.api.Service.logs] section. If the
        +       * log name is not a domain scoped name, it will be automatically prefixed
        +       * with the service name followed by "/".
                * 
        * * repeated string logs = 1; @@ -1013,19 +1031,21 @@ public Builder addAllLogs(java.lang.Iterable values) { * @return This builder for chaining. */ public Builder clearLogs() { - logs_ = com.google.protobuf.LazyStringArrayList.EMPTY; - bitField0_ = (bitField0_ & ~0x00000001); + logs_ = com.google.protobuf.LazyStringArrayList.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + ; onChanged(); return this; } + /** * * *
                * Names of the logs to be sent to this destination. Each name must
        -       * be defined in the [Service.logs][google.api.Service.logs] section. If the log name is
        -       * not a domain scoped name, it will be automatically prefixed with
        -       * the service name followed by "/".
        +       * be defined in the [Service.logs][google.api.Service.logs] section. If the
        +       * log name is not a domain scoped name, it will be automatically prefixed
        +       * with the service name followed by "/".
                * 
        * * repeated string logs = 1; @@ -1040,22 +1060,11 @@ public Builder addLogsBytes(com.google.protobuf.ByteString value) { checkByteStringIsUtf8(value); ensureLogsIsMutable(); logs_.add(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.api.Logging.LoggingDestination) } @@ -1109,7 +1118,10 @@ public com.google.api.Logging.LoggingDestination getDefaultInstanceForType() { } public static final int PRODUCER_DESTINATIONS_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") private java.util.List producerDestinations_; + /** * * @@ -1126,6 +1138,7 @@ public com.google.api.Logging.LoggingDestination getDefaultInstanceForType() { public java.util.List getProducerDestinationsList() { return producerDestinations_; } + /** * * @@ -1143,6 +1156,7 @@ public java.util.List getProducerDest getProducerDestinationsOrBuilderList() { return producerDestinations_; } + /** * * @@ -1159,6 +1173,7 @@ public java.util.List getProducerDest public int getProducerDestinationsCount() { return producerDestinations_.size(); } + /** * * @@ -1175,6 +1190,7 @@ public int getProducerDestinationsCount() { public com.google.api.Logging.LoggingDestination getProducerDestinations(int index) { return producerDestinations_.get(index); } + /** * * @@ -1194,7 +1210,10 @@ public com.google.api.Logging.LoggingDestinationOrBuilder getProducerDestination } public static final int CONSUMER_DESTINATIONS_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") private java.util.List consumerDestinations_; + /** * * @@ -1211,6 +1230,7 @@ public com.google.api.Logging.LoggingDestinationOrBuilder getProducerDestination public java.util.List getConsumerDestinationsList() { return consumerDestinations_; } + /** * * @@ -1228,6 +1248,7 @@ public java.util.List getConsumerDest getConsumerDestinationsOrBuilderList() { return consumerDestinations_; } + /** * * @@ -1244,6 +1265,7 @@ public java.util.List getConsumerDest public int getConsumerDestinationsCount() { return consumerDestinations_.size(); } + /** * * @@ -1260,6 +1282,7 @@ public int getConsumerDestinationsCount() { public com.google.api.Logging.LoggingDestination getConsumerDestinations(int index) { return consumerDestinations_.get(index); } + /** * * @@ -1392,38 +1415,38 @@ public static com.google.api.Logging parseFrom( public static com.google.api.Logging parseFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); } public static com.google.api.Logging parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } public static com.google.api.Logging parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); } public static com.google.api.Logging parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( PARSER, input, extensionRegistry); } public static com.google.api.Logging parseFrom(com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); } public static com.google.api.Logging parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } @@ -1446,46 +1469,49 @@ public Builder toBuilder() { } @java.lang.Override - protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { Builder builder = new Builder(parent); return builder; } + /** * * *
            * Logging configuration of the service.
        +   *
            * The following example shows how to configure logs to be sent to the
            * producer and consumer projects. In the example, the `activity_history`
            * log is sent to both the producer and consumer projects, whereas the
            * `purchase_history` log is only sent to the producer project.
        -   *     monitored_resources:
        -   *     - type: library.googleapis.com/branch
        -   *       labels:
        -   *       - key: /city
        -   *         description: The city where the library branch is located in.
        -   *       - key: /name
        -   *         description: The name of the branch.
        -   *     logs:
        -   *     - name: activity_history
        -   *       labels:
        -   *       - key: /customer_id
        -   *     - name: purchase_history
        -   *     logging:
        -   *       producer_destinations:
        -   *       - monitored_resource: library.googleapis.com/branch
        -   *         logs:
        -   *         - activity_history
        -   *         - purchase_history
        -   *       consumer_destinations:
        -   *       - monitored_resource: library.googleapis.com/branch
        -   *         logs:
        -   *         - activity_history
        +   *
        +   * monitored_resources:
        +   * - type: library.googleapis.com/branch
        +   * labels:
        +   * - key: /city
        +   * description: The city where the library branch is located in.
        +   * - key: /name
        +   * description: The name of the branch.
        +   * logs:
        +   * - name: activity_history
        +   * labels:
        +   * - key: /customer_id
        +   * - name: purchase_history
        +   * logging:
        +   * producer_destinations:
        +   * - monitored_resource: library.googleapis.com/branch
        +   * logs:
        +   * - activity_history
        +   * - purchase_history
        +   * consumer_destinations:
        +   * - monitored_resource: library.googleapis.com/branch
        +   * logs:
        +   * - activity_history
            * 
        * * Protobuf type {@code google.api.Logging} */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder implements // @@protoc_insertion_point(builder_implements:google.api.Logging) com.google.api.LoggingOrBuilder { @@ -1494,7 +1520,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.api.LoggingProto.internal_static_google_api_Logging_fieldAccessorTable .ensureFieldAccessorsInitialized( @@ -1504,13 +1530,14 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { // Construct using com.google.api.Logging.newBuilder() private Builder() {} - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { super(parent); } @java.lang.Override public Builder clear() { super.clear(); + bitField0_ = 0; if (producerDestinationsBuilder_ == null) { producerDestinations_ = java.util.Collections.emptyList(); } else { @@ -1550,7 +1577,15 @@ public com.google.api.Logging build() { @java.lang.Override public com.google.api.Logging buildPartial() { com.google.api.Logging result = new com.google.api.Logging(this); - int from_bitField0_ = bitField0_; + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields(com.google.api.Logging result) { if (producerDestinationsBuilder_ == null) { if (((bitField0_ & 0x00000001) != 0)) { producerDestinations_ = java.util.Collections.unmodifiableList(producerDestinations_); @@ -1569,41 +1604,10 @@ public com.google.api.Logging buildPartial() { } else { result.consumerDestinations_ = consumerDestinationsBuilder_.build(); } - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.setField(field, value); - } - - @java.lang.Override - public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - - @java.lang.Override - public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); } - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.addRepeatedField(field, value); + private void buildPartial0(com.google.api.Logging result) { + int from_bitField0_ = bitField0_; } @java.lang.Override @@ -1637,8 +1641,8 @@ public Builder mergeFrom(com.google.api.Logging other) { producerDestinations_ = other.producerDestinations_; bitField0_ = (bitField0_ & ~0x00000001); producerDestinationsBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders - ? getProducerDestinationsFieldBuilder() + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders + ? internalGetProducerDestinationsFieldBuilder() : null; } else { producerDestinationsBuilder_.addAllMessages(other.producerDestinations_); @@ -1664,8 +1668,8 @@ public Builder mergeFrom(com.google.api.Logging other) { consumerDestinations_ = other.consumerDestinations_; bitField0_ = (bitField0_ & ~0x00000002); consumerDestinationsBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders - ? getConsumerDestinationsFieldBuilder() + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders + ? internalGetConsumerDestinationsFieldBuilder() : null; } else { consumerDestinationsBuilder_.addAllMessages(other.consumerDestinations_); @@ -1755,7 +1759,7 @@ private void ensureProducerDestinationsIsMutable() { } } - private com.google.protobuf.RepeatedFieldBuilderV3< + private com.google.protobuf.RepeatedFieldBuilder< com.google.api.Logging.LoggingDestination, com.google.api.Logging.LoggingDestination.Builder, com.google.api.Logging.LoggingDestinationOrBuilder> @@ -1780,6 +1784,7 @@ public java.util.List getProducerDest return producerDestinationsBuilder_.getMessageList(); } } + /** * * @@ -1799,6 +1804,7 @@ public int getProducerDestinationsCount() { return producerDestinationsBuilder_.getCount(); } } + /** * * @@ -1818,6 +1824,7 @@ public com.google.api.Logging.LoggingDestination getProducerDestinations(int ind return producerDestinationsBuilder_.getMessage(index); } } + /** * * @@ -1844,6 +1851,7 @@ public Builder setProducerDestinations( } return this; } + /** * * @@ -1867,6 +1875,7 @@ public Builder setProducerDestinations( } return this; } + /** * * @@ -1892,6 +1901,7 @@ public Builder addProducerDestinations(com.google.api.Logging.LoggingDestination } return this; } + /** * * @@ -1918,6 +1928,7 @@ public Builder addProducerDestinations( } return this; } + /** * * @@ -1941,6 +1952,7 @@ public Builder addProducerDestinations( } return this; } + /** * * @@ -1964,6 +1976,7 @@ public Builder addProducerDestinations( } return this; } + /** * * @@ -1987,6 +2000,7 @@ public Builder addAllProducerDestinations( } return this; } + /** * * @@ -2009,6 +2023,7 @@ public Builder clearProducerDestinations() { } return this; } + /** * * @@ -2031,6 +2046,7 @@ public Builder removeProducerDestinations(int index) { } return this; } + /** * * @@ -2045,8 +2061,9 @@ public Builder removeProducerDestinations(int index) { */ public com.google.api.Logging.LoggingDestination.Builder getProducerDestinationsBuilder( int index) { - return getProducerDestinationsFieldBuilder().getBuilder(index); + return internalGetProducerDestinationsFieldBuilder().getBuilder(index); } + /** * * @@ -2067,6 +2084,7 @@ public com.google.api.Logging.LoggingDestinationOrBuilder getProducerDestination return producerDestinationsBuilder_.getMessageOrBuilder(index); } } + /** * * @@ -2087,6 +2105,7 @@ public com.google.api.Logging.LoggingDestinationOrBuilder getProducerDestination return java.util.Collections.unmodifiableList(producerDestinations_); } } + /** * * @@ -2100,9 +2119,10 @@ public com.google.api.Logging.LoggingDestinationOrBuilder getProducerDestination * repeated .google.api.Logging.LoggingDestination producer_destinations = 1; */ public com.google.api.Logging.LoggingDestination.Builder addProducerDestinationsBuilder() { - return getProducerDestinationsFieldBuilder() + return internalGetProducerDestinationsFieldBuilder() .addBuilder(com.google.api.Logging.LoggingDestination.getDefaultInstance()); } + /** * * @@ -2117,9 +2137,10 @@ public com.google.api.Logging.LoggingDestination.Builder addProducerDestinations */ public com.google.api.Logging.LoggingDestination.Builder addProducerDestinationsBuilder( int index) { - return getProducerDestinationsFieldBuilder() + return internalGetProducerDestinationsFieldBuilder() .addBuilder(index, com.google.api.Logging.LoggingDestination.getDefaultInstance()); } + /** * * @@ -2134,17 +2155,17 @@ public com.google.api.Logging.LoggingDestination.Builder addProducerDestinations */ public java.util.List getProducerDestinationsBuilderList() { - return getProducerDestinationsFieldBuilder().getBuilderList(); + return internalGetProducerDestinationsFieldBuilder().getBuilderList(); } - private com.google.protobuf.RepeatedFieldBuilderV3< + private com.google.protobuf.RepeatedFieldBuilder< com.google.api.Logging.LoggingDestination, com.google.api.Logging.LoggingDestination.Builder, com.google.api.Logging.LoggingDestinationOrBuilder> - getProducerDestinationsFieldBuilder() { + internalGetProducerDestinationsFieldBuilder() { if (producerDestinationsBuilder_ == null) { producerDestinationsBuilder_ = - new com.google.protobuf.RepeatedFieldBuilderV3< + new com.google.protobuf.RepeatedFieldBuilder< com.google.api.Logging.LoggingDestination, com.google.api.Logging.LoggingDestination.Builder, com.google.api.Logging.LoggingDestinationOrBuilder>( @@ -2169,7 +2190,7 @@ private void ensureConsumerDestinationsIsMutable() { } } - private com.google.protobuf.RepeatedFieldBuilderV3< + private com.google.protobuf.RepeatedFieldBuilder< com.google.api.Logging.LoggingDestination, com.google.api.Logging.LoggingDestination.Builder, com.google.api.Logging.LoggingDestinationOrBuilder> @@ -2194,6 +2215,7 @@ public java.util.List getConsumerDest return consumerDestinationsBuilder_.getMessageList(); } } + /** * * @@ -2213,6 +2235,7 @@ public int getConsumerDestinationsCount() { return consumerDestinationsBuilder_.getCount(); } } + /** * * @@ -2232,6 +2255,7 @@ public com.google.api.Logging.LoggingDestination getConsumerDestinations(int ind return consumerDestinationsBuilder_.getMessage(index); } } + /** * * @@ -2258,6 +2282,7 @@ public Builder setConsumerDestinations( } return this; } + /** * * @@ -2281,6 +2306,7 @@ public Builder setConsumerDestinations( } return this; } + /** * * @@ -2306,6 +2332,7 @@ public Builder addConsumerDestinations(com.google.api.Logging.LoggingDestination } return this; } + /** * * @@ -2332,6 +2359,7 @@ public Builder addConsumerDestinations( } return this; } + /** * * @@ -2355,6 +2383,7 @@ public Builder addConsumerDestinations( } return this; } + /** * * @@ -2378,6 +2407,7 @@ public Builder addConsumerDestinations( } return this; } + /** * * @@ -2401,6 +2431,7 @@ public Builder addAllConsumerDestinations( } return this; } + /** * * @@ -2423,6 +2454,7 @@ public Builder clearConsumerDestinations() { } return this; } + /** * * @@ -2445,6 +2477,7 @@ public Builder removeConsumerDestinations(int index) { } return this; } + /** * * @@ -2459,8 +2492,9 @@ public Builder removeConsumerDestinations(int index) { */ public com.google.api.Logging.LoggingDestination.Builder getConsumerDestinationsBuilder( int index) { - return getConsumerDestinationsFieldBuilder().getBuilder(index); + return internalGetConsumerDestinationsFieldBuilder().getBuilder(index); } + /** * * @@ -2481,6 +2515,7 @@ public com.google.api.Logging.LoggingDestinationOrBuilder getConsumerDestination return consumerDestinationsBuilder_.getMessageOrBuilder(index); } } + /** * * @@ -2501,6 +2536,7 @@ public com.google.api.Logging.LoggingDestinationOrBuilder getConsumerDestination return java.util.Collections.unmodifiableList(consumerDestinations_); } } + /** * * @@ -2514,9 +2550,10 @@ public com.google.api.Logging.LoggingDestinationOrBuilder getConsumerDestination * repeated .google.api.Logging.LoggingDestination consumer_destinations = 2; */ public com.google.api.Logging.LoggingDestination.Builder addConsumerDestinationsBuilder() { - return getConsumerDestinationsFieldBuilder() + return internalGetConsumerDestinationsFieldBuilder() .addBuilder(com.google.api.Logging.LoggingDestination.getDefaultInstance()); } + /** * * @@ -2531,9 +2568,10 @@ public com.google.api.Logging.LoggingDestination.Builder addConsumerDestinations */ public com.google.api.Logging.LoggingDestination.Builder addConsumerDestinationsBuilder( int index) { - return getConsumerDestinationsFieldBuilder() + return internalGetConsumerDestinationsFieldBuilder() .addBuilder(index, com.google.api.Logging.LoggingDestination.getDefaultInstance()); } + /** * * @@ -2548,17 +2586,17 @@ public com.google.api.Logging.LoggingDestination.Builder addConsumerDestinations */ public java.util.List getConsumerDestinationsBuilderList() { - return getConsumerDestinationsFieldBuilder().getBuilderList(); + return internalGetConsumerDestinationsFieldBuilder().getBuilderList(); } - private com.google.protobuf.RepeatedFieldBuilderV3< + private com.google.protobuf.RepeatedFieldBuilder< com.google.api.Logging.LoggingDestination, com.google.api.Logging.LoggingDestination.Builder, com.google.api.Logging.LoggingDestinationOrBuilder> - getConsumerDestinationsFieldBuilder() { + internalGetConsumerDestinationsFieldBuilder() { if (consumerDestinationsBuilder_ == null) { consumerDestinationsBuilder_ = - new com.google.protobuf.RepeatedFieldBuilderV3< + new com.google.protobuf.RepeatedFieldBuilder< com.google.api.Logging.LoggingDestination, com.google.api.Logging.LoggingDestination.Builder, com.google.api.Logging.LoggingDestinationOrBuilder>( @@ -2571,17 +2609,6 @@ public com.google.api.Logging.LoggingDestination.Builder addConsumerDestinations return consumerDestinationsBuilder_; } - @java.lang.Override - public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - // @@protoc_insertion_point(builder_scope:google.api.Logging) } diff --git a/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/LoggingOrBuilder.java b/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/LoggingOrBuilder.java index af4857ba22..9ae95d0b8a 100644 --- a/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/LoggingOrBuilder.java +++ b/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/LoggingOrBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,10 +14,13 @@ * limitations under the License. */ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: google/api/logging.proto +// Protobuf Java Version: 4.33.2 package com.google.api; +@com.google.protobuf.Generated public interface LoggingOrBuilder extends // @@protoc_insertion_point(interface_extends:google.api.Logging) @@ -36,6 +39,7 @@ public interface LoggingOrBuilder * repeated .google.api.Logging.LoggingDestination producer_destinations = 1; */ java.util.List getProducerDestinationsList(); + /** * * @@ -49,6 +53,7 @@ public interface LoggingOrBuilder * repeated .google.api.Logging.LoggingDestination producer_destinations = 1; */ com.google.api.Logging.LoggingDestination getProducerDestinations(int index); + /** * * @@ -62,6 +67,7 @@ public interface LoggingOrBuilder * repeated .google.api.Logging.LoggingDestination producer_destinations = 1; */ int getProducerDestinationsCount(); + /** * * @@ -76,6 +82,7 @@ public interface LoggingOrBuilder */ java.util.List getProducerDestinationsOrBuilderList(); + /** * * @@ -103,6 +110,7 @@ public interface LoggingOrBuilder * repeated .google.api.Logging.LoggingDestination consumer_destinations = 2; */ java.util.List getConsumerDestinationsList(); + /** * * @@ -116,6 +124,7 @@ public interface LoggingOrBuilder * repeated .google.api.Logging.LoggingDestination consumer_destinations = 2; */ com.google.api.Logging.LoggingDestination getConsumerDestinations(int index); + /** * * @@ -129,6 +138,7 @@ public interface LoggingOrBuilder * repeated .google.api.Logging.LoggingDestination consumer_destinations = 2; */ int getConsumerDestinationsCount(); + /** * * @@ -143,6 +153,7 @@ public interface LoggingOrBuilder */ java.util.List getConsumerDestinationsOrBuilderList(); + /** * * diff --git a/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/LoggingProto.java b/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/LoggingProto.java index 43c8d73225..43e9c2cc94 100644 --- a/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/LoggingProto.java +++ b/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/LoggingProto.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,13 +14,26 @@ * limitations under the License. */ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: google/api/logging.proto +// Protobuf Java Version: 4.33.2 package com.google.api; -public final class LoggingProto { +@com.google.protobuf.Generated +public final class LoggingProto extends com.google.protobuf.GeneratedFile { private LoggingProto() {} + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "LoggingProto"); + } + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistryLite registry) {} public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry registry) { @@ -29,11 +42,11 @@ public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry r static final com.google.protobuf.Descriptors.Descriptor internal_static_google_api_Logging_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable internal_static_google_api_Logging_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_google_api_Logging_LoggingDestination_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable internal_static_google_api_Logging_LoggingDestination_fieldAccessorTable; public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { @@ -58,21 +71,22 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { descriptor = com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( descriptorData, new com.google.protobuf.Descriptors.FileDescriptor[] {}); - internal_static_google_api_Logging_descriptor = getDescriptor().getMessageTypes().get(0); + internal_static_google_api_Logging_descriptor = getDescriptor().getMessageType(0); internal_static_google_api_Logging_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_google_api_Logging_descriptor, new java.lang.String[] { "ProducerDestinations", "ConsumerDestinations", }); internal_static_google_api_Logging_LoggingDestination_descriptor = - internal_static_google_api_Logging_descriptor.getNestedTypes().get(0); + internal_static_google_api_Logging_descriptor.getNestedType(0); internal_static_google_api_Logging_LoggingDestination_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_google_api_Logging_LoggingDestination_descriptor, new java.lang.String[] { "MonitoredResource", "Logs", }); + descriptor.resolveAllFeaturesImmutable(); } // @@protoc_insertion_point(outer_class_scope) diff --git a/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/MethodPolicy.java b/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/MethodPolicy.java new file mode 100644 index 0000000000..a7f59a9bc3 --- /dev/null +++ b/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/MethodPolicy.java @@ -0,0 +1,1149 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/api/policy.proto +// Protobuf Java Version: 4.33.2 + +package com.google.api; + +/** + * + * + *
        + * Defines policies applying to an RPC method.
        + * 
        + * + * Protobuf type {@code google.api.MethodPolicy} + */ +@com.google.protobuf.Generated +public final class MethodPolicy extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.api.MethodPolicy) + MethodPolicyOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "MethodPolicy"); + } + + // Use MethodPolicy.newBuilder() to construct. + private MethodPolicy(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private MethodPolicy() { + selector_ = ""; + requestPolicies_ = java.util.Collections.emptyList(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.api.PolicyProto.internal_static_google_api_MethodPolicy_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.api.PolicyProto.internal_static_google_api_MethodPolicy_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.api.MethodPolicy.class, com.google.api.MethodPolicy.Builder.class); + } + + public static final int SELECTOR_FIELD_NUMBER = 9; + + @SuppressWarnings("serial") + private volatile java.lang.Object selector_ = ""; + + /** + * + * + *
        +   * Selects a method to which these policies should be enforced, for example,
        +   * "google.pubsub.v1.Subscriber.CreateSubscription".
        +   *
        +   * Refer to [selector][google.api.DocumentationRule.selector] for syntax
        +   * details.
        +   *
        +   * NOTE: This field must not be set in the proto annotation. It will be
        +   * automatically filled by the service config compiler .
        +   * 
        + * + * string selector = 9; + * + * @return The selector. + */ + @java.lang.Override + public java.lang.String getSelector() { + java.lang.Object ref = selector_; + 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(); + selector_ = s; + return s; + } + } + + /** + * + * + *
        +   * Selects a method to which these policies should be enforced, for example,
        +   * "google.pubsub.v1.Subscriber.CreateSubscription".
        +   *
        +   * Refer to [selector][google.api.DocumentationRule.selector] for syntax
        +   * details.
        +   *
        +   * NOTE: This field must not be set in the proto annotation. It will be
        +   * automatically filled by the service config compiler .
        +   * 
        + * + * string selector = 9; + * + * @return The bytes for selector. + */ + @java.lang.Override + public com.google.protobuf.ByteString getSelectorBytes() { + java.lang.Object ref = selector_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + selector_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int REQUEST_POLICIES_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private java.util.List requestPolicies_; + + /** + * + * + *
        +   * Policies that are applicable to the request message.
        +   * 
        + * + * repeated .google.api.FieldPolicy request_policies = 2; + */ + @java.lang.Override + public java.util.List getRequestPoliciesList() { + return requestPolicies_; + } + + /** + * + * + *
        +   * Policies that are applicable to the request message.
        +   * 
        + * + * repeated .google.api.FieldPolicy request_policies = 2; + */ + @java.lang.Override + public java.util.List + getRequestPoliciesOrBuilderList() { + return requestPolicies_; + } + + /** + * + * + *
        +   * Policies that are applicable to the request message.
        +   * 
        + * + * repeated .google.api.FieldPolicy request_policies = 2; + */ + @java.lang.Override + public int getRequestPoliciesCount() { + return requestPolicies_.size(); + } + + /** + * + * + *
        +   * Policies that are applicable to the request message.
        +   * 
        + * + * repeated .google.api.FieldPolicy request_policies = 2; + */ + @java.lang.Override + public com.google.api.FieldPolicy getRequestPolicies(int index) { + return requestPolicies_.get(index); + } + + /** + * + * + *
        +   * Policies that are applicable to the request message.
        +   * 
        + * + * repeated .google.api.FieldPolicy request_policies = 2; + */ + @java.lang.Override + public com.google.api.FieldPolicyOrBuilder getRequestPoliciesOrBuilder(int index) { + return requestPolicies_.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 < requestPolicies_.size(); i++) { + output.writeMessage(2, requestPolicies_.get(i)); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(selector_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 9, selector_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < requestPolicies_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, requestPolicies_.get(i)); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(selector_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(9, selector_); + } + 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.api.MethodPolicy)) { + return super.equals(obj); + } + com.google.api.MethodPolicy other = (com.google.api.MethodPolicy) obj; + + if (!getSelector().equals(other.getSelector())) return false; + if (!getRequestPoliciesList().equals(other.getRequestPoliciesList())) 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) + SELECTOR_FIELD_NUMBER; + hash = (53 * hash) + getSelector().hashCode(); + if (getRequestPoliciesCount() > 0) { + hash = (37 * hash) + REQUEST_POLICIES_FIELD_NUMBER; + hash = (53 * hash) + getRequestPoliciesList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.api.MethodPolicy parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.api.MethodPolicy parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.api.MethodPolicy parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.api.MethodPolicy parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.api.MethodPolicy parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.api.MethodPolicy parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.api.MethodPolicy parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.api.MethodPolicy parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.api.MethodPolicy parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.api.MethodPolicy parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.api.MethodPolicy parseFrom(com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.api.MethodPolicy parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.api.MethodPolicy 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
        +   * Defines policies applying to an RPC method.
        +   * 
        + * + * Protobuf type {@code google.api.MethodPolicy} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.api.MethodPolicy) + com.google.api.MethodPolicyOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.api.PolicyProto.internal_static_google_api_MethodPolicy_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.api.PolicyProto.internal_static_google_api_MethodPolicy_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.api.MethodPolicy.class, com.google.api.MethodPolicy.Builder.class); + } + + // Construct using com.google.api.MethodPolicy.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + selector_ = ""; + if (requestPoliciesBuilder_ == null) { + requestPolicies_ = java.util.Collections.emptyList(); + } else { + requestPolicies_ = null; + requestPoliciesBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000002); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.api.PolicyProto.internal_static_google_api_MethodPolicy_descriptor; + } + + @java.lang.Override + public com.google.api.MethodPolicy getDefaultInstanceForType() { + return com.google.api.MethodPolicy.getDefaultInstance(); + } + + @java.lang.Override + public com.google.api.MethodPolicy build() { + com.google.api.MethodPolicy result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.api.MethodPolicy buildPartial() { + com.google.api.MethodPolicy result = new com.google.api.MethodPolicy(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields(com.google.api.MethodPolicy result) { + if (requestPoliciesBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0)) { + requestPolicies_ = java.util.Collections.unmodifiableList(requestPolicies_); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.requestPolicies_ = requestPolicies_; + } else { + result.requestPolicies_ = requestPoliciesBuilder_.build(); + } + } + + private void buildPartial0(com.google.api.MethodPolicy result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.selector_ = selector_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.api.MethodPolicy) { + return mergeFrom((com.google.api.MethodPolicy) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.api.MethodPolicy other) { + if (other == com.google.api.MethodPolicy.getDefaultInstance()) return this; + if (!other.getSelector().isEmpty()) { + selector_ = other.selector_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (requestPoliciesBuilder_ == null) { + if (!other.requestPolicies_.isEmpty()) { + if (requestPolicies_.isEmpty()) { + requestPolicies_ = other.requestPolicies_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureRequestPoliciesIsMutable(); + requestPolicies_.addAll(other.requestPolicies_); + } + onChanged(); + } + } else { + if (!other.requestPolicies_.isEmpty()) { + if (requestPoliciesBuilder_.isEmpty()) { + requestPoliciesBuilder_.dispose(); + requestPoliciesBuilder_ = null; + requestPolicies_ = other.requestPolicies_; + bitField0_ = (bitField0_ & ~0x00000002); + requestPoliciesBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders + ? internalGetRequestPoliciesFieldBuilder() + : null; + } else { + requestPoliciesBuilder_.addAllMessages(other.requestPolicies_); + } + } + } + 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: + { + com.google.api.FieldPolicy m = + input.readMessage(com.google.api.FieldPolicy.parser(), extensionRegistry); + if (requestPoliciesBuilder_ == null) { + ensureRequestPoliciesIsMutable(); + requestPolicies_.add(m); + } else { + requestPoliciesBuilder_.addMessage(m); + } + break; + } // case 18 + case 74: + { + selector_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 74 + 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 selector_ = ""; + + /** + * + * + *
        +     * Selects a method to which these policies should be enforced, for example,
        +     * "google.pubsub.v1.Subscriber.CreateSubscription".
        +     *
        +     * Refer to [selector][google.api.DocumentationRule.selector] for syntax
        +     * details.
        +     *
        +     * NOTE: This field must not be set in the proto annotation. It will be
        +     * automatically filled by the service config compiler .
        +     * 
        + * + * string selector = 9; + * + * @return The selector. + */ + public java.lang.String getSelector() { + java.lang.Object ref = selector_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + selector_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
        +     * Selects a method to which these policies should be enforced, for example,
        +     * "google.pubsub.v1.Subscriber.CreateSubscription".
        +     *
        +     * Refer to [selector][google.api.DocumentationRule.selector] for syntax
        +     * details.
        +     *
        +     * NOTE: This field must not be set in the proto annotation. It will be
        +     * automatically filled by the service config compiler .
        +     * 
        + * + * string selector = 9; + * + * @return The bytes for selector. + */ + public com.google.protobuf.ByteString getSelectorBytes() { + java.lang.Object ref = selector_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + selector_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
        +     * Selects a method to which these policies should be enforced, for example,
        +     * "google.pubsub.v1.Subscriber.CreateSubscription".
        +     *
        +     * Refer to [selector][google.api.DocumentationRule.selector] for syntax
        +     * details.
        +     *
        +     * NOTE: This field must not be set in the proto annotation. It will be
        +     * automatically filled by the service config compiler .
        +     * 
        + * + * string selector = 9; + * + * @param value The selector to set. + * @return This builder for chaining. + */ + public Builder setSelector(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + selector_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
        +     * Selects a method to which these policies should be enforced, for example,
        +     * "google.pubsub.v1.Subscriber.CreateSubscription".
        +     *
        +     * Refer to [selector][google.api.DocumentationRule.selector] for syntax
        +     * details.
        +     *
        +     * NOTE: This field must not be set in the proto annotation. It will be
        +     * automatically filled by the service config compiler .
        +     * 
        + * + * string selector = 9; + * + * @return This builder for chaining. + */ + public Builder clearSelector() { + selector_ = getDefaultInstance().getSelector(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
        +     * Selects a method to which these policies should be enforced, for example,
        +     * "google.pubsub.v1.Subscriber.CreateSubscription".
        +     *
        +     * Refer to [selector][google.api.DocumentationRule.selector] for syntax
        +     * details.
        +     *
        +     * NOTE: This field must not be set in the proto annotation. It will be
        +     * automatically filled by the service config compiler .
        +     * 
        + * + * string selector = 9; + * + * @param value The bytes for selector to set. + * @return This builder for chaining. + */ + public Builder setSelectorBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + selector_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.util.List requestPolicies_ = + java.util.Collections.emptyList(); + + private void ensureRequestPoliciesIsMutable() { + if (!((bitField0_ & 0x00000002) != 0)) { + requestPolicies_ = new java.util.ArrayList(requestPolicies_); + bitField0_ |= 0x00000002; + } + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.google.api.FieldPolicy, + com.google.api.FieldPolicy.Builder, + com.google.api.FieldPolicyOrBuilder> + requestPoliciesBuilder_; + + /** + * + * + *
        +     * Policies that are applicable to the request message.
        +     * 
        + * + * repeated .google.api.FieldPolicy request_policies = 2; + */ + public java.util.List getRequestPoliciesList() { + if (requestPoliciesBuilder_ == null) { + return java.util.Collections.unmodifiableList(requestPolicies_); + } else { + return requestPoliciesBuilder_.getMessageList(); + } + } + + /** + * + * + *
        +     * Policies that are applicable to the request message.
        +     * 
        + * + * repeated .google.api.FieldPolicy request_policies = 2; + */ + public int getRequestPoliciesCount() { + if (requestPoliciesBuilder_ == null) { + return requestPolicies_.size(); + } else { + return requestPoliciesBuilder_.getCount(); + } + } + + /** + * + * + *
        +     * Policies that are applicable to the request message.
        +     * 
        + * + * repeated .google.api.FieldPolicy request_policies = 2; + */ + public com.google.api.FieldPolicy getRequestPolicies(int index) { + if (requestPoliciesBuilder_ == null) { + return requestPolicies_.get(index); + } else { + return requestPoliciesBuilder_.getMessage(index); + } + } + + /** + * + * + *
        +     * Policies that are applicable to the request message.
        +     * 
        + * + * repeated .google.api.FieldPolicy request_policies = 2; + */ + public Builder setRequestPolicies(int index, com.google.api.FieldPolicy value) { + if (requestPoliciesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureRequestPoliciesIsMutable(); + requestPolicies_.set(index, value); + onChanged(); + } else { + requestPoliciesBuilder_.setMessage(index, value); + } + return this; + } + + /** + * + * + *
        +     * Policies that are applicable to the request message.
        +     * 
        + * + * repeated .google.api.FieldPolicy request_policies = 2; + */ + public Builder setRequestPolicies( + int index, com.google.api.FieldPolicy.Builder builderForValue) { + if (requestPoliciesBuilder_ == null) { + ensureRequestPoliciesIsMutable(); + requestPolicies_.set(index, builderForValue.build()); + onChanged(); + } else { + requestPoliciesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
        +     * Policies that are applicable to the request message.
        +     * 
        + * + * repeated .google.api.FieldPolicy request_policies = 2; + */ + public Builder addRequestPolicies(com.google.api.FieldPolicy value) { + if (requestPoliciesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureRequestPoliciesIsMutable(); + requestPolicies_.add(value); + onChanged(); + } else { + requestPoliciesBuilder_.addMessage(value); + } + return this; + } + + /** + * + * + *
        +     * Policies that are applicable to the request message.
        +     * 
        + * + * repeated .google.api.FieldPolicy request_policies = 2; + */ + public Builder addRequestPolicies(int index, com.google.api.FieldPolicy value) { + if (requestPoliciesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureRequestPoliciesIsMutable(); + requestPolicies_.add(index, value); + onChanged(); + } else { + requestPoliciesBuilder_.addMessage(index, value); + } + return this; + } + + /** + * + * + *
        +     * Policies that are applicable to the request message.
        +     * 
        + * + * repeated .google.api.FieldPolicy request_policies = 2; + */ + public Builder addRequestPolicies(com.google.api.FieldPolicy.Builder builderForValue) { + if (requestPoliciesBuilder_ == null) { + ensureRequestPoliciesIsMutable(); + requestPolicies_.add(builderForValue.build()); + onChanged(); + } else { + requestPoliciesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + + /** + * + * + *
        +     * Policies that are applicable to the request message.
        +     * 
        + * + * repeated .google.api.FieldPolicy request_policies = 2; + */ + public Builder addRequestPolicies( + int index, com.google.api.FieldPolicy.Builder builderForValue) { + if (requestPoliciesBuilder_ == null) { + ensureRequestPoliciesIsMutable(); + requestPolicies_.add(index, builderForValue.build()); + onChanged(); + } else { + requestPoliciesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
        +     * Policies that are applicable to the request message.
        +     * 
        + * + * repeated .google.api.FieldPolicy request_policies = 2; + */ + public Builder addAllRequestPolicies( + java.lang.Iterable values) { + if (requestPoliciesBuilder_ == null) { + ensureRequestPoliciesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, requestPolicies_); + onChanged(); + } else { + requestPoliciesBuilder_.addAllMessages(values); + } + return this; + } + + /** + * + * + *
        +     * Policies that are applicable to the request message.
        +     * 
        + * + * repeated .google.api.FieldPolicy request_policies = 2; + */ + public Builder clearRequestPolicies() { + if (requestPoliciesBuilder_ == null) { + requestPolicies_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + } else { + requestPoliciesBuilder_.clear(); + } + return this; + } + + /** + * + * + *
        +     * Policies that are applicable to the request message.
        +     * 
        + * + * repeated .google.api.FieldPolicy request_policies = 2; + */ + public Builder removeRequestPolicies(int index) { + if (requestPoliciesBuilder_ == null) { + ensureRequestPoliciesIsMutable(); + requestPolicies_.remove(index); + onChanged(); + } else { + requestPoliciesBuilder_.remove(index); + } + return this; + } + + /** + * + * + *
        +     * Policies that are applicable to the request message.
        +     * 
        + * + * repeated .google.api.FieldPolicy request_policies = 2; + */ + public com.google.api.FieldPolicy.Builder getRequestPoliciesBuilder(int index) { + return internalGetRequestPoliciesFieldBuilder().getBuilder(index); + } + + /** + * + * + *
        +     * Policies that are applicable to the request message.
        +     * 
        + * + * repeated .google.api.FieldPolicy request_policies = 2; + */ + public com.google.api.FieldPolicyOrBuilder getRequestPoliciesOrBuilder(int index) { + if (requestPoliciesBuilder_ == null) { + return requestPolicies_.get(index); + } else { + return requestPoliciesBuilder_.getMessageOrBuilder(index); + } + } + + /** + * + * + *
        +     * Policies that are applicable to the request message.
        +     * 
        + * + * repeated .google.api.FieldPolicy request_policies = 2; + */ + public java.util.List + getRequestPoliciesOrBuilderList() { + if (requestPoliciesBuilder_ != null) { + return requestPoliciesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(requestPolicies_); + } + } + + /** + * + * + *
        +     * Policies that are applicable to the request message.
        +     * 
        + * + * repeated .google.api.FieldPolicy request_policies = 2; + */ + public com.google.api.FieldPolicy.Builder addRequestPoliciesBuilder() { + return internalGetRequestPoliciesFieldBuilder() + .addBuilder(com.google.api.FieldPolicy.getDefaultInstance()); + } + + /** + * + * + *
        +     * Policies that are applicable to the request message.
        +     * 
        + * + * repeated .google.api.FieldPolicy request_policies = 2; + */ + public com.google.api.FieldPolicy.Builder addRequestPoliciesBuilder(int index) { + return internalGetRequestPoliciesFieldBuilder() + .addBuilder(index, com.google.api.FieldPolicy.getDefaultInstance()); + } + + /** + * + * + *
        +     * Policies that are applicable to the request message.
        +     * 
        + * + * repeated .google.api.FieldPolicy request_policies = 2; + */ + public java.util.List getRequestPoliciesBuilderList() { + return internalGetRequestPoliciesFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.google.api.FieldPolicy, + com.google.api.FieldPolicy.Builder, + com.google.api.FieldPolicyOrBuilder> + internalGetRequestPoliciesFieldBuilder() { + if (requestPoliciesBuilder_ == null) { + requestPoliciesBuilder_ = + new com.google.protobuf.RepeatedFieldBuilder< + com.google.api.FieldPolicy, + com.google.api.FieldPolicy.Builder, + com.google.api.FieldPolicyOrBuilder>( + requestPolicies_, + ((bitField0_ & 0x00000002) != 0), + getParentForChildren(), + isClean()); + requestPolicies_ = null; + } + return requestPoliciesBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.api.MethodPolicy) + } + + // @@protoc_insertion_point(class_scope:google.api.MethodPolicy) + private static final com.google.api.MethodPolicy DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.api.MethodPolicy(); + } + + public static com.google.api.MethodPolicy getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public MethodPolicy 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.api.MethodPolicy getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/MethodPolicyOrBuilder.java b/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/MethodPolicyOrBuilder.java new file mode 100644 index 0000000000..9d203834b2 --- /dev/null +++ b/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/MethodPolicyOrBuilder.java @@ -0,0 +1,123 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/api/policy.proto +// Protobuf Java Version: 4.33.2 + +package com.google.api; + +@com.google.protobuf.Generated +public interface MethodPolicyOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.api.MethodPolicy) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
        +   * Selects a method to which these policies should be enforced, for example,
        +   * "google.pubsub.v1.Subscriber.CreateSubscription".
        +   *
        +   * Refer to [selector][google.api.DocumentationRule.selector] for syntax
        +   * details.
        +   *
        +   * NOTE: This field must not be set in the proto annotation. It will be
        +   * automatically filled by the service config compiler .
        +   * 
        + * + * string selector = 9; + * + * @return The selector. + */ + java.lang.String getSelector(); + + /** + * + * + *
        +   * Selects a method to which these policies should be enforced, for example,
        +   * "google.pubsub.v1.Subscriber.CreateSubscription".
        +   *
        +   * Refer to [selector][google.api.DocumentationRule.selector] for syntax
        +   * details.
        +   *
        +   * NOTE: This field must not be set in the proto annotation. It will be
        +   * automatically filled by the service config compiler .
        +   * 
        + * + * string selector = 9; + * + * @return The bytes for selector. + */ + com.google.protobuf.ByteString getSelectorBytes(); + + /** + * + * + *
        +   * Policies that are applicable to the request message.
        +   * 
        + * + * repeated .google.api.FieldPolicy request_policies = 2; + */ + java.util.List getRequestPoliciesList(); + + /** + * + * + *
        +   * Policies that are applicable to the request message.
        +   * 
        + * + * repeated .google.api.FieldPolicy request_policies = 2; + */ + com.google.api.FieldPolicy getRequestPolicies(int index); + + /** + * + * + *
        +   * Policies that are applicable to the request message.
        +   * 
        + * + * repeated .google.api.FieldPolicy request_policies = 2; + */ + int getRequestPoliciesCount(); + + /** + * + * + *
        +   * Policies that are applicable to the request message.
        +   * 
        + * + * repeated .google.api.FieldPolicy request_policies = 2; + */ + java.util.List getRequestPoliciesOrBuilderList(); + + /** + * + * + *
        +   * Policies that are applicable to the request message.
        +   * 
        + * + * repeated .google.api.FieldPolicy request_policies = 2; + */ + com.google.api.FieldPolicyOrBuilder getRequestPoliciesOrBuilder(int index); +} diff --git a/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/MethodSettings.java b/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/MethodSettings.java index b75009443a..34c86cd18e 100644 --- a/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/MethodSettings.java +++ b/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/MethodSettings.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,9 @@ * limitations under the License. */ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: google/api/client.proto +// Protobuf Java Version: 4.33.2 package com.google.api; @@ -27,29 +29,31 @@ * * Protobuf type {@code google.api.MethodSettings} */ -public final class MethodSettings extends com.google.protobuf.GeneratedMessageV3 +@com.google.protobuf.Generated +public final class MethodSettings extends com.google.protobuf.GeneratedMessage implements // @@protoc_insertion_point(message_implements:google.api.MethodSettings) MethodSettingsOrBuilder { private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "MethodSettings"); + } + // Use MethodSettings.newBuilder() to construct. - private MethodSettings(com.google.protobuf.GeneratedMessageV3.Builder builder) { + private MethodSettings(com.google.protobuf.GeneratedMessage.Builder builder) { super(builder); } private MethodSettings() { selector_ = ""; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new MethodSettings(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; + autoPopulatedFields_ = com.google.protobuf.LazyStringArrayList.emptyList(); } public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { @@ -57,7 +61,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.api.ClientProto.internal_static_google_api_MethodSettings_fieldAccessorTable .ensureFieldAccessorsInitialized( @@ -82,6 +86,7 @@ public interface LongRunningOrBuilder * @return Whether the initialPollDelay field is set. */ boolean hasInitialPollDelay(); + /** * * @@ -95,6 +100,7 @@ public interface LongRunningOrBuilder * @return The initialPollDelay. */ com.google.protobuf.Duration getInitialPollDelay(); + /** * * @@ -135,6 +141,7 @@ public interface LongRunningOrBuilder * @return Whether the maxPollDelay field is set. */ boolean hasMaxPollDelay(); + /** * * @@ -148,6 +155,7 @@ public interface LongRunningOrBuilder * @return The maxPollDelay. */ com.google.protobuf.Duration getMaxPollDelay(); + /** * * @@ -173,6 +181,7 @@ public interface LongRunningOrBuilder * @return Whether the totalPollTimeout field is set. */ boolean hasTotalPollTimeout(); + /** * * @@ -186,6 +195,7 @@ public interface LongRunningOrBuilder * @return The totalPollTimeout. */ com.google.protobuf.Duration getTotalPollTimeout(); + /** * * @@ -198,6 +208,7 @@ public interface LongRunningOrBuilder */ com.google.protobuf.DurationOrBuilder getTotalPollTimeoutOrBuilder(); } + /** * * @@ -211,36 +222,36 @@ public interface LongRunningOrBuilder * * Protobuf type {@code google.api.MethodSettings.LongRunning} */ - public static final class LongRunning extends com.google.protobuf.GeneratedMessageV3 + public static final class LongRunning extends com.google.protobuf.GeneratedMessage implements // @@protoc_insertion_point(message_implements:google.api.MethodSettings.LongRunning) LongRunningOrBuilder { private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "LongRunning"); + } + // Use LongRunning.newBuilder() to construct. - private LongRunning(com.google.protobuf.GeneratedMessageV3.Builder builder) { + private LongRunning(com.google.protobuf.GeneratedMessage.Builder builder) { super(builder); } private LongRunning() {} - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new LongRunning(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.api.ClientProto .internal_static_google_api_MethodSettings_LongRunning_descriptor; } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.api.ClientProto .internal_static_google_api_MethodSettings_LongRunning_fieldAccessorTable @@ -249,8 +260,10 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { com.google.api.MethodSettings.LongRunning.Builder.class); } + private int bitField0_; public static final int INITIAL_POLL_DELAY_FIELD_NUMBER = 1; private com.google.protobuf.Duration initialPollDelay_; + /** * * @@ -265,8 +278,9 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { */ @java.lang.Override public boolean hasInitialPollDelay() { - return initialPollDelay_ != null; + return ((bitField0_ & 0x00000001) != 0); } + /** * * @@ -285,6 +299,7 @@ public com.google.protobuf.Duration getInitialPollDelay() { ? com.google.protobuf.Duration.getDefaultInstance() : initialPollDelay_; } + /** * * @@ -297,11 +312,14 @@ public com.google.protobuf.Duration getInitialPollDelay() { */ @java.lang.Override public com.google.protobuf.DurationOrBuilder getInitialPollDelayOrBuilder() { - return getInitialPollDelay(); + return initialPollDelay_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : initialPollDelay_; } public static final int POLL_DELAY_MULTIPLIER_FIELD_NUMBER = 2; - private float pollDelayMultiplier_; + private float pollDelayMultiplier_ = 0F; + /** * * @@ -322,6 +340,7 @@ public float getPollDelayMultiplier() { public static final int MAX_POLL_DELAY_FIELD_NUMBER = 3; private com.google.protobuf.Duration maxPollDelay_; + /** * * @@ -336,8 +355,9 @@ public float getPollDelayMultiplier() { */ @java.lang.Override public boolean hasMaxPollDelay() { - return maxPollDelay_ != null; + return ((bitField0_ & 0x00000002) != 0); } + /** * * @@ -356,6 +376,7 @@ public com.google.protobuf.Duration getMaxPollDelay() { ? com.google.protobuf.Duration.getDefaultInstance() : maxPollDelay_; } + /** * * @@ -368,11 +389,14 @@ public com.google.protobuf.Duration getMaxPollDelay() { */ @java.lang.Override public com.google.protobuf.DurationOrBuilder getMaxPollDelayOrBuilder() { - return getMaxPollDelay(); + return maxPollDelay_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : maxPollDelay_; } public static final int TOTAL_POLL_TIMEOUT_FIELD_NUMBER = 4; private com.google.protobuf.Duration totalPollTimeout_; + /** * * @@ -387,8 +411,9 @@ public com.google.protobuf.DurationOrBuilder getMaxPollDelayOrBuilder() { */ @java.lang.Override public boolean hasTotalPollTimeout() { - return totalPollTimeout_ != null; + return ((bitField0_ & 0x00000004) != 0); } + /** * * @@ -407,6 +432,7 @@ public com.google.protobuf.Duration getTotalPollTimeout() { ? com.google.protobuf.Duration.getDefaultInstance() : totalPollTimeout_; } + /** * * @@ -419,7 +445,9 @@ public com.google.protobuf.Duration getTotalPollTimeout() { */ @java.lang.Override public com.google.protobuf.DurationOrBuilder getTotalPollTimeoutOrBuilder() { - return getTotalPollTimeout(); + return totalPollTimeout_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : totalPollTimeout_; } private byte memoizedIsInitialized = -1; @@ -436,16 +464,16 @@ public final boolean isInitialized() { @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (initialPollDelay_ != null) { + if (((bitField0_ & 0x00000001) != 0)) { output.writeMessage(1, getInitialPollDelay()); } if (java.lang.Float.floatToRawIntBits(pollDelayMultiplier_) != 0) { output.writeFloat(2, pollDelayMultiplier_); } - if (maxPollDelay_ != null) { + if (((bitField0_ & 0x00000002) != 0)) { output.writeMessage(3, getMaxPollDelay()); } - if (totalPollTimeout_ != null) { + if (((bitField0_ & 0x00000004) != 0)) { output.writeMessage(4, getTotalPollTimeout()); } getUnknownFields().writeTo(output); @@ -457,16 +485,16 @@ public int getSerializedSize() { if (size != -1) return size; size = 0; - if (initialPollDelay_ != null) { + if (((bitField0_ & 0x00000001) != 0)) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getInitialPollDelay()); } if (java.lang.Float.floatToRawIntBits(pollDelayMultiplier_) != 0) { size += com.google.protobuf.CodedOutputStream.computeFloatSize(2, pollDelayMultiplier_); } - if (maxPollDelay_ != null) { + if (((bitField0_ & 0x00000002) != 0)) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getMaxPollDelay()); } - if (totalPollTimeout_ != null) { + if (((bitField0_ & 0x00000004) != 0)) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, getTotalPollTimeout()); } size += getUnknownFields().getSerializedSize(); @@ -566,38 +594,38 @@ public static com.google.api.MethodSettings.LongRunning parseFrom( public static com.google.api.MethodSettings.LongRunning parseFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); } public static com.google.api.MethodSettings.LongRunning parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } public static com.google.api.MethodSettings.LongRunning parseDelimitedFrom( java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); } public static com.google.api.MethodSettings.LongRunning parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( PARSER, input, extensionRegistry); } public static com.google.api.MethodSettings.LongRunning parseFrom( com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); } public static com.google.api.MethodSettings.LongRunning parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } @@ -620,11 +648,11 @@ public Builder toBuilder() { } @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { Builder builder = new Builder(parent); return builder; } + /** * * @@ -638,8 +666,7 @@ protected Builder newBuilderForType( * * Protobuf type {@code google.api.MethodSettings.LongRunning} */ - public static final class Builder - extends com.google.protobuf.GeneratedMessageV3.Builder + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder implements // @@protoc_insertion_point(builder_implements:google.api.MethodSettings.LongRunning) com.google.api.MethodSettings.LongRunningOrBuilder { @@ -649,7 +676,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.api.ClientProto .internal_static_google_api_MethodSettings_LongRunning_fieldAccessorTable @@ -659,33 +686,41 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } // Construct using com.google.api.MethodSettings.LongRunning.newBuilder() - private Builder() {} + private Builder() { + maybeForceBuilderInitialization(); + } - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetInitialPollDelayFieldBuilder(); + internalGetMaxPollDelayFieldBuilder(); + internalGetTotalPollTimeoutFieldBuilder(); + } } @java.lang.Override public Builder clear() { super.clear(); - if (initialPollDelayBuilder_ == null) { - initialPollDelay_ = null; - } else { - initialPollDelay_ = null; + bitField0_ = 0; + initialPollDelay_ = null; + if (initialPollDelayBuilder_ != null) { + initialPollDelayBuilder_.dispose(); initialPollDelayBuilder_ = null; } pollDelayMultiplier_ = 0F; - - if (maxPollDelayBuilder_ == null) { - maxPollDelay_ = null; - } else { - maxPollDelay_ = null; + maxPollDelay_ = null; + if (maxPollDelayBuilder_ != null) { + maxPollDelayBuilder_.dispose(); maxPollDelayBuilder_ = null; } - if (totalPollTimeoutBuilder_ == null) { - totalPollTimeout_ = null; - } else { - totalPollTimeout_ = null; + totalPollTimeout_ = null; + if (totalPollTimeoutBuilder_ != null) { + totalPollTimeoutBuilder_.dispose(); totalPollTimeoutBuilder_ = null; } return this; @@ -715,59 +750,39 @@ public com.google.api.MethodSettings.LongRunning build() { public com.google.api.MethodSettings.LongRunning buildPartial() { com.google.api.MethodSettings.LongRunning result = new com.google.api.MethodSettings.LongRunning(this); - if (initialPollDelayBuilder_ == null) { - result.initialPollDelay_ = initialPollDelay_; - } else { - result.initialPollDelay_ = initialPollDelayBuilder_.build(); - } - result.pollDelayMultiplier_ = pollDelayMultiplier_; - if (maxPollDelayBuilder_ == null) { - result.maxPollDelay_ = maxPollDelay_; - } else { - result.maxPollDelay_ = maxPollDelayBuilder_.build(); - } - if (totalPollTimeoutBuilder_ == null) { - result.totalPollTimeout_ = totalPollTimeout_; - } else { - result.totalPollTimeout_ = totalPollTimeoutBuilder_.build(); + if (bitField0_ != 0) { + buildPartial0(result); } 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); + private void buildPartial0(com.google.api.MethodSettings.LongRunning result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.initialPollDelay_ = + initialPollDelayBuilder_ == null + ? initialPollDelay_ + : initialPollDelayBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.pollDelayMultiplier_ = pollDelayMultiplier_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.maxPollDelay_ = + maxPollDelayBuilder_ == null ? maxPollDelay_ : maxPollDelayBuilder_.build(); + to_bitField0_ |= 0x00000002; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.totalPollTimeout_ = + totalPollTimeoutBuilder_ == null + ? totalPollTimeout_ + : totalPollTimeoutBuilder_.build(); + to_bitField0_ |= 0x00000004; + } + result.bitField0_ |= to_bitField0_; } @java.lang.Override @@ -785,7 +800,7 @@ public Builder mergeFrom(com.google.api.MethodSettings.LongRunning other) { if (other.hasInitialPollDelay()) { mergeInitialPollDelay(other.getInitialPollDelay()); } - if (other.getPollDelayMultiplier() != 0F) { + if (java.lang.Float.floatToRawIntBits(other.getPollDelayMultiplier()) != 0) { setPollDelayMultiplier(other.getPollDelayMultiplier()); } if (other.hasMaxPollDelay()) { @@ -823,27 +838,28 @@ public Builder mergeFrom( case 10: { input.readMessage( - getInitialPollDelayFieldBuilder().getBuilder(), extensionRegistry); - + internalGetInitialPollDelayFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000001; break; } // case 10 case 21: { pollDelayMultiplier_ = input.readFloat(); - + bitField0_ |= 0x00000002; break; } // case 21 case 26: { - input.readMessage(getMaxPollDelayFieldBuilder().getBuilder(), extensionRegistry); - + input.readMessage( + internalGetMaxPollDelayFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000004; break; } // case 26 case 34: { input.readMessage( - getTotalPollTimeoutFieldBuilder().getBuilder(), extensionRegistry); - + internalGetTotalPollTimeoutFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000008; break; } // case 34 default: @@ -863,12 +879,15 @@ public Builder mergeFrom( return this; } + private int bitField0_; + private com.google.protobuf.Duration initialPollDelay_; - private com.google.protobuf.SingleFieldBuilderV3< + private com.google.protobuf.SingleFieldBuilder< com.google.protobuf.Duration, com.google.protobuf.Duration.Builder, com.google.protobuf.DurationOrBuilder> initialPollDelayBuilder_; + /** * * @@ -882,8 +901,9 @@ public Builder mergeFrom( * @return Whether the initialPollDelay field is set. */ public boolean hasInitialPollDelay() { - return initialPollDelayBuilder_ != null || initialPollDelay_ != null; + return ((bitField0_ & 0x00000001) != 0); } + /** * * @@ -905,6 +925,7 @@ public com.google.protobuf.Duration getInitialPollDelay() { return initialPollDelayBuilder_.getMessage(); } } + /** * * @@ -921,13 +942,14 @@ public Builder setInitialPollDelay(com.google.protobuf.Duration value) { throw new NullPointerException(); } initialPollDelay_ = value; - onChanged(); } else { initialPollDelayBuilder_.setMessage(value); } - + bitField0_ |= 0x00000001; + onChanged(); return this; } + /** * * @@ -941,13 +963,14 @@ public Builder setInitialPollDelay(com.google.protobuf.Duration value) { public Builder setInitialPollDelay(com.google.protobuf.Duration.Builder builderForValue) { if (initialPollDelayBuilder_ == null) { initialPollDelay_ = builderForValue.build(); - onChanged(); } else { initialPollDelayBuilder_.setMessage(builderForValue.build()); } - + bitField0_ |= 0x00000001; + onChanged(); return this; } + /** * * @@ -960,21 +983,23 @@ public Builder setInitialPollDelay(com.google.protobuf.Duration.Builder builderF */ public Builder mergeInitialPollDelay(com.google.protobuf.Duration value) { if (initialPollDelayBuilder_ == null) { - if (initialPollDelay_ != null) { - initialPollDelay_ = - com.google.protobuf.Duration.newBuilder(initialPollDelay_) - .mergeFrom(value) - .buildPartial(); + if (((bitField0_ & 0x00000001) != 0) + && initialPollDelay_ != null + && initialPollDelay_ != com.google.protobuf.Duration.getDefaultInstance()) { + getInitialPollDelayBuilder().mergeFrom(value); } else { initialPollDelay_ = value; } - onChanged(); } else { initialPollDelayBuilder_.mergeFrom(value); } - + if (initialPollDelay_ != null) { + bitField0_ |= 0x00000001; + onChanged(); + } return this; } + /** * * @@ -986,16 +1011,16 @@ public Builder mergeInitialPollDelay(com.google.protobuf.Duration value) { * .google.protobuf.Duration initial_poll_delay = 1; */ public Builder clearInitialPollDelay() { - if (initialPollDelayBuilder_ == null) { - initialPollDelay_ = null; - onChanged(); - } else { - initialPollDelay_ = null; + bitField0_ = (bitField0_ & ~0x00000001); + initialPollDelay_ = null; + if (initialPollDelayBuilder_ != null) { + initialPollDelayBuilder_.dispose(); initialPollDelayBuilder_ = null; } - + onChanged(); return this; } + /** * * @@ -1007,10 +1032,11 @@ public Builder clearInitialPollDelay() { * .google.protobuf.Duration initial_poll_delay = 1; */ public com.google.protobuf.Duration.Builder getInitialPollDelayBuilder() { - + bitField0_ |= 0x00000001; onChanged(); - return getInitialPollDelayFieldBuilder().getBuilder(); + return internalGetInitialPollDelayFieldBuilder().getBuilder(); } + /** * * @@ -1030,6 +1056,7 @@ public com.google.protobuf.DurationOrBuilder getInitialPollDelayOrBuilder() { : initialPollDelay_; } } + /** * * @@ -1040,14 +1067,14 @@ public com.google.protobuf.DurationOrBuilder getInitialPollDelayOrBuilder() { * * .google.protobuf.Duration initial_poll_delay = 1; */ - private com.google.protobuf.SingleFieldBuilderV3< + private com.google.protobuf.SingleFieldBuilder< com.google.protobuf.Duration, com.google.protobuf.Duration.Builder, com.google.protobuf.DurationOrBuilder> - getInitialPollDelayFieldBuilder() { + internalGetInitialPollDelayFieldBuilder() { if (initialPollDelayBuilder_ == null) { initialPollDelayBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< + new com.google.protobuf.SingleFieldBuilder< com.google.protobuf.Duration, com.google.protobuf.Duration.Builder, com.google.protobuf.DurationOrBuilder>( @@ -1058,6 +1085,7 @@ public com.google.protobuf.DurationOrBuilder getInitialPollDelayOrBuilder() { } private float pollDelayMultiplier_; + /** * * @@ -1075,6 +1103,7 @@ public com.google.protobuf.DurationOrBuilder getInitialPollDelayOrBuilder() { public float getPollDelayMultiplier() { return pollDelayMultiplier_; } + /** * * @@ -1092,9 +1121,11 @@ public float getPollDelayMultiplier() { public Builder setPollDelayMultiplier(float value) { pollDelayMultiplier_ = value; + bitField0_ |= 0x00000002; onChanged(); return this; } + /** * * @@ -1109,18 +1140,19 @@ public Builder setPollDelayMultiplier(float value) { * @return This builder for chaining. */ public Builder clearPollDelayMultiplier() { - + bitField0_ = (bitField0_ & ~0x00000002); pollDelayMultiplier_ = 0F; onChanged(); return this; } private com.google.protobuf.Duration maxPollDelay_; - private com.google.protobuf.SingleFieldBuilderV3< + private com.google.protobuf.SingleFieldBuilder< com.google.protobuf.Duration, com.google.protobuf.Duration.Builder, com.google.protobuf.DurationOrBuilder> maxPollDelayBuilder_; + /** * * @@ -1134,8 +1166,9 @@ public Builder clearPollDelayMultiplier() { * @return Whether the maxPollDelay field is set. */ public boolean hasMaxPollDelay() { - return maxPollDelayBuilder_ != null || maxPollDelay_ != null; + return ((bitField0_ & 0x00000004) != 0); } + /** * * @@ -1157,6 +1190,7 @@ public com.google.protobuf.Duration getMaxPollDelay() { return maxPollDelayBuilder_.getMessage(); } } + /** * * @@ -1173,13 +1207,14 @@ public Builder setMaxPollDelay(com.google.protobuf.Duration value) { throw new NullPointerException(); } maxPollDelay_ = value; - onChanged(); } else { maxPollDelayBuilder_.setMessage(value); } - + bitField0_ |= 0x00000004; + onChanged(); return this; } + /** * * @@ -1193,13 +1228,14 @@ public Builder setMaxPollDelay(com.google.protobuf.Duration value) { public Builder setMaxPollDelay(com.google.protobuf.Duration.Builder builderForValue) { if (maxPollDelayBuilder_ == null) { maxPollDelay_ = builderForValue.build(); - onChanged(); } else { maxPollDelayBuilder_.setMessage(builderForValue.build()); } - + bitField0_ |= 0x00000004; + onChanged(); return this; } + /** * * @@ -1212,21 +1248,23 @@ public Builder setMaxPollDelay(com.google.protobuf.Duration.Builder builderForVa */ public Builder mergeMaxPollDelay(com.google.protobuf.Duration value) { if (maxPollDelayBuilder_ == null) { - if (maxPollDelay_ != null) { - maxPollDelay_ = - com.google.protobuf.Duration.newBuilder(maxPollDelay_) - .mergeFrom(value) - .buildPartial(); + if (((bitField0_ & 0x00000004) != 0) + && maxPollDelay_ != null + && maxPollDelay_ != com.google.protobuf.Duration.getDefaultInstance()) { + getMaxPollDelayBuilder().mergeFrom(value); } else { maxPollDelay_ = value; } - onChanged(); } else { maxPollDelayBuilder_.mergeFrom(value); } - + if (maxPollDelay_ != null) { + bitField0_ |= 0x00000004; + onChanged(); + } return this; } + /** * * @@ -1238,16 +1276,16 @@ public Builder mergeMaxPollDelay(com.google.protobuf.Duration value) { * .google.protobuf.Duration max_poll_delay = 3; */ public Builder clearMaxPollDelay() { - if (maxPollDelayBuilder_ == null) { - maxPollDelay_ = null; - onChanged(); - } else { - maxPollDelay_ = null; + bitField0_ = (bitField0_ & ~0x00000004); + maxPollDelay_ = null; + if (maxPollDelayBuilder_ != null) { + maxPollDelayBuilder_.dispose(); maxPollDelayBuilder_ = null; } - + onChanged(); return this; } + /** * * @@ -1259,10 +1297,11 @@ public Builder clearMaxPollDelay() { * .google.protobuf.Duration max_poll_delay = 3; */ public com.google.protobuf.Duration.Builder getMaxPollDelayBuilder() { - + bitField0_ |= 0x00000004; onChanged(); - return getMaxPollDelayFieldBuilder().getBuilder(); + return internalGetMaxPollDelayFieldBuilder().getBuilder(); } + /** * * @@ -1282,6 +1321,7 @@ public com.google.protobuf.DurationOrBuilder getMaxPollDelayOrBuilder() { : maxPollDelay_; } } + /** * * @@ -1292,14 +1332,14 @@ public com.google.protobuf.DurationOrBuilder getMaxPollDelayOrBuilder() { * * .google.protobuf.Duration max_poll_delay = 3; */ - private com.google.protobuf.SingleFieldBuilderV3< + private com.google.protobuf.SingleFieldBuilder< com.google.protobuf.Duration, com.google.protobuf.Duration.Builder, com.google.protobuf.DurationOrBuilder> - getMaxPollDelayFieldBuilder() { + internalGetMaxPollDelayFieldBuilder() { if (maxPollDelayBuilder_ == null) { maxPollDelayBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< + new com.google.protobuf.SingleFieldBuilder< com.google.protobuf.Duration, com.google.protobuf.Duration.Builder, com.google.protobuf.DurationOrBuilder>( @@ -1310,11 +1350,12 @@ public com.google.protobuf.DurationOrBuilder getMaxPollDelayOrBuilder() { } private com.google.protobuf.Duration totalPollTimeout_; - private com.google.protobuf.SingleFieldBuilderV3< + private com.google.protobuf.SingleFieldBuilder< com.google.protobuf.Duration, com.google.protobuf.Duration.Builder, com.google.protobuf.DurationOrBuilder> totalPollTimeoutBuilder_; + /** * * @@ -1328,8 +1369,9 @@ public com.google.protobuf.DurationOrBuilder getMaxPollDelayOrBuilder() { * @return Whether the totalPollTimeout field is set. */ public boolean hasTotalPollTimeout() { - return totalPollTimeoutBuilder_ != null || totalPollTimeout_ != null; + return ((bitField0_ & 0x00000008) != 0); } + /** * * @@ -1351,6 +1393,7 @@ public com.google.protobuf.Duration getTotalPollTimeout() { return totalPollTimeoutBuilder_.getMessage(); } } + /** * * @@ -1367,13 +1410,14 @@ public Builder setTotalPollTimeout(com.google.protobuf.Duration value) { throw new NullPointerException(); } totalPollTimeout_ = value; - onChanged(); } else { totalPollTimeoutBuilder_.setMessage(value); } - + bitField0_ |= 0x00000008; + onChanged(); return this; } + /** * * @@ -1387,13 +1431,14 @@ public Builder setTotalPollTimeout(com.google.protobuf.Duration value) { public Builder setTotalPollTimeout(com.google.protobuf.Duration.Builder builderForValue) { if (totalPollTimeoutBuilder_ == null) { totalPollTimeout_ = builderForValue.build(); - onChanged(); } else { totalPollTimeoutBuilder_.setMessage(builderForValue.build()); } - + bitField0_ |= 0x00000008; + onChanged(); return this; } + /** * * @@ -1406,21 +1451,23 @@ public Builder setTotalPollTimeout(com.google.protobuf.Duration.Builder builderF */ public Builder mergeTotalPollTimeout(com.google.protobuf.Duration value) { if (totalPollTimeoutBuilder_ == null) { - if (totalPollTimeout_ != null) { - totalPollTimeout_ = - com.google.protobuf.Duration.newBuilder(totalPollTimeout_) - .mergeFrom(value) - .buildPartial(); + if (((bitField0_ & 0x00000008) != 0) + && totalPollTimeout_ != null + && totalPollTimeout_ != com.google.protobuf.Duration.getDefaultInstance()) { + getTotalPollTimeoutBuilder().mergeFrom(value); } else { totalPollTimeout_ = value; } - onChanged(); } else { totalPollTimeoutBuilder_.mergeFrom(value); } - + if (totalPollTimeout_ != null) { + bitField0_ |= 0x00000008; + onChanged(); + } return this; } + /** * * @@ -1432,16 +1479,16 @@ public Builder mergeTotalPollTimeout(com.google.protobuf.Duration value) { * .google.protobuf.Duration total_poll_timeout = 4; */ public Builder clearTotalPollTimeout() { - if (totalPollTimeoutBuilder_ == null) { - totalPollTimeout_ = null; - onChanged(); - } else { - totalPollTimeout_ = null; + bitField0_ = (bitField0_ & ~0x00000008); + totalPollTimeout_ = null; + if (totalPollTimeoutBuilder_ != null) { + totalPollTimeoutBuilder_.dispose(); totalPollTimeoutBuilder_ = null; } - + onChanged(); return this; } + /** * * @@ -1453,10 +1500,11 @@ public Builder clearTotalPollTimeout() { * .google.protobuf.Duration total_poll_timeout = 4; */ public com.google.protobuf.Duration.Builder getTotalPollTimeoutBuilder() { - + bitField0_ |= 0x00000008; onChanged(); - return getTotalPollTimeoutFieldBuilder().getBuilder(); + return internalGetTotalPollTimeoutFieldBuilder().getBuilder(); } + /** * * @@ -1476,6 +1524,7 @@ public com.google.protobuf.DurationOrBuilder getTotalPollTimeoutOrBuilder() { : totalPollTimeout_; } } + /** * * @@ -1486,14 +1535,14 @@ public com.google.protobuf.DurationOrBuilder getTotalPollTimeoutOrBuilder() { * * .google.protobuf.Duration total_poll_timeout = 4; */ - private com.google.protobuf.SingleFieldBuilderV3< + private com.google.protobuf.SingleFieldBuilder< com.google.protobuf.Duration, com.google.protobuf.Duration.Builder, com.google.protobuf.DurationOrBuilder> - getTotalPollTimeoutFieldBuilder() { + internalGetTotalPollTimeoutFieldBuilder() { if (totalPollTimeoutBuilder_ == null) { totalPollTimeoutBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< + new com.google.protobuf.SingleFieldBuilder< com.google.protobuf.Duration, com.google.protobuf.Duration.Builder, com.google.protobuf.DurationOrBuilder>( @@ -1503,18 +1552,6 @@ public com.google.protobuf.DurationOrBuilder getTotalPollTimeoutOrBuilder() { return totalPollTimeoutBuilder_; } - @java.lang.Override - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - // @@protoc_insertion_point(builder_scope:google.api.MethodSettings.LongRunning) } @@ -1567,14 +1604,25 @@ public com.google.api.MethodSettings.LongRunning getDefaultInstanceForType() { } } + private int bitField0_; public static final int SELECTOR_FIELD_NUMBER = 1; - private volatile java.lang.Object selector_; + + @SuppressWarnings("serial") + private volatile java.lang.Object selector_ = ""; + /** * * *
            * The fully qualified name of the method, for which the options below apply.
            * This is used to find the method to apply the options.
        +   *
        +   * Example:
        +   *
        +   * publishing:
        +   * method_settings:
        +   * - selector: google.storage.control.v2.StorageControl.CreateFolder
        +   * # method settings for CreateFolder...
            * 
        * * string selector = 1; @@ -1593,12 +1641,20 @@ public java.lang.String getSelector() { return s; } } + /** * * *
            * The fully qualified name of the method, for which the options below apply.
            * This is used to find the method to apply the options.
        +   *
        +   * Example:
        +   *
        +   * publishing:
        +   * method_settings:
        +   * - selector: google.storage.control.v2.StorageControl.CreateFolder
        +   * # method settings for CreateFolder...
            * 
        * * string selector = 1; @@ -1620,6 +1676,7 @@ public com.google.protobuf.ByteString getSelectorBytes() { public static final int LONG_RUNNING_FIELD_NUMBER = 2; private com.google.api.MethodSettings.LongRunning longRunning_; + /** * * @@ -1627,18 +1684,17 @@ public com.google.protobuf.ByteString getSelectorBytes() { * Describes settings to use for long-running operations when generating * API methods for RPCs. Complements RPCs that use the annotations in * google/longrunning/operations.proto. + * * Example of a YAML configuration:: - * publishing: - * method_behavior: - * - selector: CreateAdDomain - * long_running: - * initial_poll_delay: - * seconds: 60 # 1 minute - * poll_delay_multiplier: 1.5 - * max_poll_delay: - * seconds: 360 # 6 minutes - * total_poll_timeout: - * seconds: 54000 # 90 minutes + * + * publishing: + * method_settings: + * - selector: google.cloud.speech.v2.Speech.BatchRecognize + * long_running: + * initial_poll_delay: 60s # 1 minute + * poll_delay_multiplier: 1.5 + * max_poll_delay: 360s # 6 minutes + * total_poll_timeout: 54000s # 90 minutes * * * .google.api.MethodSettings.LongRunning long_running = 2; @@ -1647,8 +1703,9 @@ public com.google.protobuf.ByteString getSelectorBytes() { */ @java.lang.Override public boolean hasLongRunning() { - return longRunning_ != null; + return ((bitField0_ & 0x00000001) != 0); } + /** * * @@ -1656,18 +1713,17 @@ public boolean hasLongRunning() { * Describes settings to use for long-running operations when generating * API methods for RPCs. Complements RPCs that use the annotations in * google/longrunning/operations.proto. + * * Example of a YAML configuration:: - * publishing: - * method_behavior: - * - selector: CreateAdDomain - * long_running: - * initial_poll_delay: - * seconds: 60 # 1 minute - * poll_delay_multiplier: 1.5 - * max_poll_delay: - * seconds: 360 # 6 minutes - * total_poll_timeout: - * seconds: 54000 # 90 minutes + * + * publishing: + * method_settings: + * - selector: google.cloud.speech.v2.Speech.BatchRecognize + * long_running: + * initial_poll_delay: 60s # 1 minute + * poll_delay_multiplier: 1.5 + * max_poll_delay: 360s # 6 minutes + * total_poll_timeout: 54000s # 90 minutes * * * .google.api.MethodSettings.LongRunning long_running = 2; @@ -1680,6 +1736,7 @@ public com.google.api.MethodSettings.LongRunning getLongRunning() { ? com.google.api.MethodSettings.LongRunning.getDefaultInstance() : longRunning_; } + /** * * @@ -1687,25 +1744,134 @@ public com.google.api.MethodSettings.LongRunning getLongRunning() { * Describes settings to use for long-running operations when generating * API methods for RPCs. Complements RPCs that use the annotations in * google/longrunning/operations.proto. + * * Example of a YAML configuration:: - * publishing: - * method_behavior: - * - selector: CreateAdDomain - * long_running: - * initial_poll_delay: - * seconds: 60 # 1 minute - * poll_delay_multiplier: 1.5 - * max_poll_delay: - * seconds: 360 # 6 minutes - * total_poll_timeout: - * seconds: 54000 # 90 minutes + * + * publishing: + * method_settings: + * - selector: google.cloud.speech.v2.Speech.BatchRecognize + * long_running: + * initial_poll_delay: 60s # 1 minute + * poll_delay_multiplier: 1.5 + * max_poll_delay: 360s # 6 minutes + * total_poll_timeout: 54000s # 90 minutes * * * .google.api.MethodSettings.LongRunning long_running = 2; */ @java.lang.Override public com.google.api.MethodSettings.LongRunningOrBuilder getLongRunningOrBuilder() { - return getLongRunning(); + return longRunning_ == null + ? com.google.api.MethodSettings.LongRunning.getDefaultInstance() + : longRunning_; + } + + public static final int AUTO_POPULATED_FIELDS_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private com.google.protobuf.LazyStringArrayList autoPopulatedFields_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + + /** + * + * + *
        +   * List of top-level fields of the request message, that should be
        +   * automatically populated by the client libraries based on their
        +   * (google.api.field_info).format. Currently supported format: UUID4.
        +   *
        +   * Example of a YAML configuration:
        +   *
        +   * publishing:
        +   * method_settings:
        +   * - selector: google.example.v1.ExampleService.CreateExample
        +   * auto_populated_fields:
        +   * - request_id
        +   * 
        + * + * repeated string auto_populated_fields = 3; + * + * @return A list containing the autoPopulatedFields. + */ + public com.google.protobuf.ProtocolStringList getAutoPopulatedFieldsList() { + return autoPopulatedFields_; + } + + /** + * + * + *
        +   * List of top-level fields of the request message, that should be
        +   * automatically populated by the client libraries based on their
        +   * (google.api.field_info).format. Currently supported format: UUID4.
        +   *
        +   * Example of a YAML configuration:
        +   *
        +   * publishing:
        +   * method_settings:
        +   * - selector: google.example.v1.ExampleService.CreateExample
        +   * auto_populated_fields:
        +   * - request_id
        +   * 
        + * + * repeated string auto_populated_fields = 3; + * + * @return The count of autoPopulatedFields. + */ + public int getAutoPopulatedFieldsCount() { + return autoPopulatedFields_.size(); + } + + /** + * + * + *
        +   * List of top-level fields of the request message, that should be
        +   * automatically populated by the client libraries based on their
        +   * (google.api.field_info).format. Currently supported format: UUID4.
        +   *
        +   * Example of a YAML configuration:
        +   *
        +   * publishing:
        +   * method_settings:
        +   * - selector: google.example.v1.ExampleService.CreateExample
        +   * auto_populated_fields:
        +   * - request_id
        +   * 
        + * + * repeated string auto_populated_fields = 3; + * + * @param index The index of the element to return. + * @return The autoPopulatedFields at the given index. + */ + public java.lang.String getAutoPopulatedFields(int index) { + return autoPopulatedFields_.get(index); + } + + /** + * + * + *
        +   * List of top-level fields of the request message, that should be
        +   * automatically populated by the client libraries based on their
        +   * (google.api.field_info).format. Currently supported format: UUID4.
        +   *
        +   * Example of a YAML configuration:
        +   *
        +   * publishing:
        +   * method_settings:
        +   * - selector: google.example.v1.ExampleService.CreateExample
        +   * auto_populated_fields:
        +   * - request_id
        +   * 
        + * + * repeated string auto_populated_fields = 3; + * + * @param index The index of the value to return. + * @return The bytes of the autoPopulatedFields at the given index. + */ + public com.google.protobuf.ByteString getAutoPopulatedFieldsBytes(int index) { + return autoPopulatedFields_.getByteString(index); } private byte memoizedIsInitialized = -1; @@ -1722,12 +1888,15 @@ public final boolean isInitialized() { @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(selector_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, selector_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(selector_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, selector_); } - if (longRunning_ != null) { + if (((bitField0_ & 0x00000001) != 0)) { output.writeMessage(2, getLongRunning()); } + for (int i = 0; i < autoPopulatedFields_.size(); i++) { + com.google.protobuf.GeneratedMessage.writeString(output, 3, autoPopulatedFields_.getRaw(i)); + } getUnknownFields().writeTo(output); } @@ -1737,12 +1906,20 @@ public int getSerializedSize() { if (size != -1) return size; size = 0; - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(selector_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, selector_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(selector_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, selector_); } - if (longRunning_ != null) { + if (((bitField0_ & 0x00000001) != 0)) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getLongRunning()); } + { + int dataSize = 0; + for (int i = 0; i < autoPopulatedFields_.size(); i++) { + dataSize += computeStringSizeNoTag(autoPopulatedFields_.getRaw(i)); + } + size += dataSize; + size += 1 * getAutoPopulatedFieldsList().size(); + } size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; @@ -1763,6 +1940,7 @@ public boolean equals(final java.lang.Object obj) { if (hasLongRunning()) { if (!getLongRunning().equals(other.getLongRunning())) return false; } + if (!getAutoPopulatedFieldsList().equals(other.getAutoPopulatedFieldsList())) return false; if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -1780,6 +1958,10 @@ public int hashCode() { hash = (37 * hash) + LONG_RUNNING_FIELD_NUMBER; hash = (53 * hash) + getLongRunning().hashCode(); } + if (getAutoPopulatedFieldsCount() > 0) { + hash = (37 * hash) + AUTO_POPULATED_FIELDS_FIELD_NUMBER; + hash = (53 * hash) + getAutoPopulatedFieldsList().hashCode(); + } hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; @@ -1821,38 +2003,38 @@ public static com.google.api.MethodSettings parseFrom( public static com.google.api.MethodSettings parseFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); } public static com.google.api.MethodSettings parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } public static com.google.api.MethodSettings parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); } public static com.google.api.MethodSettings parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( PARSER, input, extensionRegistry); } public static com.google.api.MethodSettings parseFrom(com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); } public static com.google.api.MethodSettings parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } @@ -1875,10 +2057,11 @@ public Builder toBuilder() { } @java.lang.Override - protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { Builder builder = new Builder(parent); return builder; } + /** * * @@ -1888,7 +2071,7 @@ protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.Build * * Protobuf type {@code google.api.MethodSettings} */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder implements // @@protoc_insertion_point(builder_implements:google.api.MethodSettings) com.google.api.MethodSettingsOrBuilder { @@ -1897,7 +2080,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.api.ClientProto.internal_static_google_api_MethodSettings_fieldAccessorTable .ensureFieldAccessorsInitialized( @@ -1905,23 +2088,32 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } // Construct using com.google.api.MethodSettings.newBuilder() - private Builder() {} + private Builder() { + maybeForceBuilderInitialization(); + } - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetLongRunningFieldBuilder(); + } } @java.lang.Override public Builder clear() { super.clear(); + bitField0_ = 0; selector_ = ""; - - if (longRunningBuilder_ == null) { - longRunning_ = null; - } else { - longRunning_ = null; + longRunning_ = null; + if (longRunningBuilder_ != null) { + longRunningBuilder_.dispose(); longRunningBuilder_ = null; } + autoPopulatedFields_ = com.google.protobuf.LazyStringArrayList.emptyList(); return this; } @@ -1947,47 +2139,29 @@ public com.google.api.MethodSettings build() { @java.lang.Override public com.google.api.MethodSettings buildPartial() { com.google.api.MethodSettings result = new com.google.api.MethodSettings(this); - result.selector_ = selector_; - if (longRunningBuilder_ == null) { - result.longRunning_ = longRunning_; - } else { - result.longRunning_ = longRunningBuilder_.build(); + if (bitField0_ != 0) { + buildPartial0(result); } 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); + private void buildPartial0(com.google.api.MethodSettings result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.selector_ = selector_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.longRunning_ = + longRunningBuilder_ == null ? longRunning_ : longRunningBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + autoPopulatedFields_.makeImmutable(); + result.autoPopulatedFields_ = autoPopulatedFields_; + } + result.bitField0_ |= to_bitField0_; } @java.lang.Override @@ -2004,11 +2178,22 @@ public Builder mergeFrom(com.google.api.MethodSettings other) { if (other == com.google.api.MethodSettings.getDefaultInstance()) return this; if (!other.getSelector().isEmpty()) { selector_ = other.selector_; + bitField0_ |= 0x00000001; onChanged(); } if (other.hasLongRunning()) { mergeLongRunning(other.getLongRunning()); } + if (!other.autoPopulatedFields_.isEmpty()) { + if (autoPopulatedFields_.isEmpty()) { + autoPopulatedFields_ = other.autoPopulatedFields_; + bitField0_ |= 0x00000004; + } else { + ensureAutoPopulatedFieldsIsMutable(); + autoPopulatedFields_.addAll(other.autoPopulatedFields_); + } + onChanged(); + } this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; @@ -2038,15 +2223,23 @@ public Builder mergeFrom( case 10: { selector_ = input.readStringRequireUtf8(); - + bitField0_ |= 0x00000001; break; } // case 10 case 18: { - input.readMessage(getLongRunningFieldBuilder().getBuilder(), extensionRegistry); - + input.readMessage( + internalGetLongRunningFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; break; } // case 18 + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + ensureAutoPopulatedFieldsIsMutable(); + autoPopulatedFields_.add(s); + break; + } // case 26 default: { if (!super.parseUnknownField(input, extensionRegistry, tag)) { @@ -2064,13 +2257,23 @@ public Builder mergeFrom( return this; } + private int bitField0_; + private java.lang.Object selector_ = ""; + /** * * *
              * The fully qualified name of the method, for which the options below apply.
              * This is used to find the method to apply the options.
        +     *
        +     * Example:
        +     *
        +     * publishing:
        +     * method_settings:
        +     * - selector: google.storage.control.v2.StorageControl.CreateFolder
        +     * # method settings for CreateFolder...
              * 
        * * string selector = 1; @@ -2088,12 +2291,20 @@ public java.lang.String getSelector() { return (java.lang.String) ref; } } + /** * * *
              * The fully qualified name of the method, for which the options below apply.
              * This is used to find the method to apply the options.
        +     *
        +     * Example:
        +     *
        +     * publishing:
        +     * method_settings:
        +     * - selector: google.storage.control.v2.StorageControl.CreateFolder
        +     * # method settings for CreateFolder...
              * 
        * * string selector = 1; @@ -2111,12 +2322,20 @@ public com.google.protobuf.ByteString getSelectorBytes() { return (com.google.protobuf.ByteString) ref; } } + /** * * *
              * The fully qualified name of the method, for which the options below apply.
              * This is used to find the method to apply the options.
        +     *
        +     * Example:
        +     *
        +     * publishing:
        +     * method_settings:
        +     * - selector: google.storage.control.v2.StorageControl.CreateFolder
        +     * # method settings for CreateFolder...
              * 
        * * string selector = 1; @@ -2128,17 +2347,25 @@ public Builder setSelector(java.lang.String value) { if (value == null) { throw new NullPointerException(); } - selector_ = value; + bitField0_ |= 0x00000001; onChanged(); return this; } + /** * * *
              * The fully qualified name of the method, for which the options below apply.
              * This is used to find the method to apply the options.
        +     *
        +     * Example:
        +     *
        +     * publishing:
        +     * method_settings:
        +     * - selector: google.storage.control.v2.StorageControl.CreateFolder
        +     * # method settings for CreateFolder...
              * 
        * * string selector = 1; @@ -2146,17 +2373,25 @@ public Builder setSelector(java.lang.String value) { * @return This builder for chaining. */ public Builder clearSelector() { - selector_ = getDefaultInstance().getSelector(); + bitField0_ = (bitField0_ & ~0x00000001); onChanged(); return this; } + /** * * *
              * The fully qualified name of the method, for which the options below apply.
              * This is used to find the method to apply the options.
        +     *
        +     * Example:
        +     *
        +     * publishing:
        +     * method_settings:
        +     * - selector: google.storage.control.v2.StorageControl.CreateFolder
        +     * # method settings for CreateFolder...
              * 
        * * string selector = 1; @@ -2169,18 +2404,19 @@ public Builder setSelectorBytes(com.google.protobuf.ByteString value) { throw new NullPointerException(); } checkByteStringIsUtf8(value); - selector_ = value; + bitField0_ |= 0x00000001; onChanged(); return this; } private com.google.api.MethodSettings.LongRunning longRunning_; - private com.google.protobuf.SingleFieldBuilderV3< + private com.google.protobuf.SingleFieldBuilder< com.google.api.MethodSettings.LongRunning, com.google.api.MethodSettings.LongRunning.Builder, com.google.api.MethodSettings.LongRunningOrBuilder> longRunningBuilder_; + /** * * @@ -2188,18 +2424,17 @@ public Builder setSelectorBytes(com.google.protobuf.ByteString value) { * Describes settings to use for long-running operations when generating * API methods for RPCs. Complements RPCs that use the annotations in * google/longrunning/operations.proto. + * * Example of a YAML configuration:: - * publishing: - * method_behavior: - * - selector: CreateAdDomain - * long_running: - * initial_poll_delay: - * seconds: 60 # 1 minute - * poll_delay_multiplier: 1.5 - * max_poll_delay: - * seconds: 360 # 6 minutes - * total_poll_timeout: - * seconds: 54000 # 90 minutes + * + * publishing: + * method_settings: + * - selector: google.cloud.speech.v2.Speech.BatchRecognize + * long_running: + * initial_poll_delay: 60s # 1 minute + * poll_delay_multiplier: 1.5 + * max_poll_delay: 360s # 6 minutes + * total_poll_timeout: 54000s # 90 minutes * * * .google.api.MethodSettings.LongRunning long_running = 2; @@ -2207,8 +2442,9 @@ public Builder setSelectorBytes(com.google.protobuf.ByteString value) { * @return Whether the longRunning field is set. */ public boolean hasLongRunning() { - return longRunningBuilder_ != null || longRunning_ != null; + return ((bitField0_ & 0x00000002) != 0); } + /** * * @@ -2216,18 +2452,17 @@ public boolean hasLongRunning() { * Describes settings to use for long-running operations when generating * API methods for RPCs. Complements RPCs that use the annotations in * google/longrunning/operations.proto. + * * Example of a YAML configuration:: - * publishing: - * method_behavior: - * - selector: CreateAdDomain - * long_running: - * initial_poll_delay: - * seconds: 60 # 1 minute - * poll_delay_multiplier: 1.5 - * max_poll_delay: - * seconds: 360 # 6 minutes - * total_poll_timeout: - * seconds: 54000 # 90 minutes + * + * publishing: + * method_settings: + * - selector: google.cloud.speech.v2.Speech.BatchRecognize + * long_running: + * initial_poll_delay: 60s # 1 minute + * poll_delay_multiplier: 1.5 + * max_poll_delay: 360s # 6 minutes + * total_poll_timeout: 54000s # 90 minutes * * * .google.api.MethodSettings.LongRunning long_running = 2; @@ -2243,6 +2478,7 @@ public com.google.api.MethodSettings.LongRunning getLongRunning() { return longRunningBuilder_.getMessage(); } } + /** * * @@ -2250,18 +2486,17 @@ public com.google.api.MethodSettings.LongRunning getLongRunning() { * Describes settings to use for long-running operations when generating * API methods for RPCs. Complements RPCs that use the annotations in * google/longrunning/operations.proto. + * * Example of a YAML configuration:: - * publishing: - * method_behavior: - * - selector: CreateAdDomain - * long_running: - * initial_poll_delay: - * seconds: 60 # 1 minute - * poll_delay_multiplier: 1.5 - * max_poll_delay: - * seconds: 360 # 6 minutes - * total_poll_timeout: - * seconds: 54000 # 90 minutes + * + * publishing: + * method_settings: + * - selector: google.cloud.speech.v2.Speech.BatchRecognize + * long_running: + * initial_poll_delay: 60s # 1 minute + * poll_delay_multiplier: 1.5 + * max_poll_delay: 360s # 6 minutes + * total_poll_timeout: 54000s # 90 minutes * * * .google.api.MethodSettings.LongRunning long_running = 2; @@ -2272,13 +2507,14 @@ public Builder setLongRunning(com.google.api.MethodSettings.LongRunning value) { throw new NullPointerException(); } longRunning_ = value; - onChanged(); } else { longRunningBuilder_.setMessage(value); } - + bitField0_ |= 0x00000002; + onChanged(); return this; } + /** * * @@ -2286,18 +2522,17 @@ public Builder setLongRunning(com.google.api.MethodSettings.LongRunning value) { * Describes settings to use for long-running operations when generating * API methods for RPCs. Complements RPCs that use the annotations in * google/longrunning/operations.proto. + * * Example of a YAML configuration:: - * publishing: - * method_behavior: - * - selector: CreateAdDomain - * long_running: - * initial_poll_delay: - * seconds: 60 # 1 minute - * poll_delay_multiplier: 1.5 - * max_poll_delay: - * seconds: 360 # 6 minutes - * total_poll_timeout: - * seconds: 54000 # 90 minutes + * + * publishing: + * method_settings: + * - selector: google.cloud.speech.v2.Speech.BatchRecognize + * long_running: + * initial_poll_delay: 60s # 1 minute + * poll_delay_multiplier: 1.5 + * max_poll_delay: 360s # 6 minutes + * total_poll_timeout: 54000s # 90 minutes * * * .google.api.MethodSettings.LongRunning long_running = 2; @@ -2306,13 +2541,14 @@ public Builder setLongRunning( com.google.api.MethodSettings.LongRunning.Builder builderForValue) { if (longRunningBuilder_ == null) { longRunning_ = builderForValue.build(); - onChanged(); } else { longRunningBuilder_.setMessage(builderForValue.build()); } - + bitField0_ |= 0x00000002; + onChanged(); return this; } + /** * * @@ -2320,39 +2556,40 @@ public Builder setLongRunning( * Describes settings to use for long-running operations when generating * API methods for RPCs. Complements RPCs that use the annotations in * google/longrunning/operations.proto. + * * Example of a YAML configuration:: - * publishing: - * method_behavior: - * - selector: CreateAdDomain - * long_running: - * initial_poll_delay: - * seconds: 60 # 1 minute - * poll_delay_multiplier: 1.5 - * max_poll_delay: - * seconds: 360 # 6 minutes - * total_poll_timeout: - * seconds: 54000 # 90 minutes + * + * publishing: + * method_settings: + * - selector: google.cloud.speech.v2.Speech.BatchRecognize + * long_running: + * initial_poll_delay: 60s # 1 minute + * poll_delay_multiplier: 1.5 + * max_poll_delay: 360s # 6 minutes + * total_poll_timeout: 54000s # 90 minutes * * * .google.api.MethodSettings.LongRunning long_running = 2; */ public Builder mergeLongRunning(com.google.api.MethodSettings.LongRunning value) { if (longRunningBuilder_ == null) { - if (longRunning_ != null) { - longRunning_ = - com.google.api.MethodSettings.LongRunning.newBuilder(longRunning_) - .mergeFrom(value) - .buildPartial(); + if (((bitField0_ & 0x00000002) != 0) + && longRunning_ != null + && longRunning_ != com.google.api.MethodSettings.LongRunning.getDefaultInstance()) { + getLongRunningBuilder().mergeFrom(value); } else { longRunning_ = value; } - onChanged(); } else { longRunningBuilder_.mergeFrom(value); } - + if (longRunning_ != null) { + bitField0_ |= 0x00000002; + onChanged(); + } return this; } + /** * * @@ -2360,33 +2597,32 @@ public Builder mergeLongRunning(com.google.api.MethodSettings.LongRunning value) * Describes settings to use for long-running operations when generating * API methods for RPCs. Complements RPCs that use the annotations in * google/longrunning/operations.proto. + * * Example of a YAML configuration:: - * publishing: - * method_behavior: - * - selector: CreateAdDomain - * long_running: - * initial_poll_delay: - * seconds: 60 # 1 minute - * poll_delay_multiplier: 1.5 - * max_poll_delay: - * seconds: 360 # 6 minutes - * total_poll_timeout: - * seconds: 54000 # 90 minutes + * + * publishing: + * method_settings: + * - selector: google.cloud.speech.v2.Speech.BatchRecognize + * long_running: + * initial_poll_delay: 60s # 1 minute + * poll_delay_multiplier: 1.5 + * max_poll_delay: 360s # 6 minutes + * total_poll_timeout: 54000s # 90 minutes * * * .google.api.MethodSettings.LongRunning long_running = 2; */ public Builder clearLongRunning() { - if (longRunningBuilder_ == null) { - longRunning_ = null; - onChanged(); - } else { - longRunning_ = null; + bitField0_ = (bitField0_ & ~0x00000002); + longRunning_ = null; + if (longRunningBuilder_ != null) { + longRunningBuilder_.dispose(); longRunningBuilder_ = null; } - + onChanged(); return this; } + /** * * @@ -2394,27 +2630,27 @@ public Builder clearLongRunning() { * Describes settings to use for long-running operations when generating * API methods for RPCs. Complements RPCs that use the annotations in * google/longrunning/operations.proto. + * * Example of a YAML configuration:: - * publishing: - * method_behavior: - * - selector: CreateAdDomain - * long_running: - * initial_poll_delay: - * seconds: 60 # 1 minute - * poll_delay_multiplier: 1.5 - * max_poll_delay: - * seconds: 360 # 6 minutes - * total_poll_timeout: - * seconds: 54000 # 90 minutes + * + * publishing: + * method_settings: + * - selector: google.cloud.speech.v2.Speech.BatchRecognize + * long_running: + * initial_poll_delay: 60s # 1 minute + * poll_delay_multiplier: 1.5 + * max_poll_delay: 360s # 6 minutes + * total_poll_timeout: 54000s # 90 minutes * * * .google.api.MethodSettings.LongRunning long_running = 2; */ public com.google.api.MethodSettings.LongRunning.Builder getLongRunningBuilder() { - + bitField0_ |= 0x00000002; onChanged(); - return getLongRunningFieldBuilder().getBuilder(); + return internalGetLongRunningFieldBuilder().getBuilder(); } + /** * * @@ -2422,18 +2658,17 @@ public com.google.api.MethodSettings.LongRunning.Builder getLongRunningBuilder() * Describes settings to use for long-running operations when generating * API methods for RPCs. Complements RPCs that use the annotations in * google/longrunning/operations.proto. + * * Example of a YAML configuration:: - * publishing: - * method_behavior: - * - selector: CreateAdDomain - * long_running: - * initial_poll_delay: - * seconds: 60 # 1 minute - * poll_delay_multiplier: 1.5 - * max_poll_delay: - * seconds: 360 # 6 minutes - * total_poll_timeout: - * seconds: 54000 # 90 minutes + * + * publishing: + * method_settings: + * - selector: google.cloud.speech.v2.Speech.BatchRecognize + * long_running: + * initial_poll_delay: 60s # 1 minute + * poll_delay_multiplier: 1.5 + * max_poll_delay: 360s # 6 minutes + * total_poll_timeout: 54000s # 90 minutes * * * .google.api.MethodSettings.LongRunning long_running = 2; @@ -2447,6 +2682,7 @@ public com.google.api.MethodSettings.LongRunningOrBuilder getLongRunningOrBuilde : longRunning_; } } + /** * * @@ -2454,30 +2690,29 @@ public com.google.api.MethodSettings.LongRunningOrBuilder getLongRunningOrBuilde * Describes settings to use for long-running operations when generating * API methods for RPCs. Complements RPCs that use the annotations in * google/longrunning/operations.proto. + * * Example of a YAML configuration:: - * publishing: - * method_behavior: - * - selector: CreateAdDomain - * long_running: - * initial_poll_delay: - * seconds: 60 # 1 minute - * poll_delay_multiplier: 1.5 - * max_poll_delay: - * seconds: 360 # 6 minutes - * total_poll_timeout: - * seconds: 54000 # 90 minutes + * + * publishing: + * method_settings: + * - selector: google.cloud.speech.v2.Speech.BatchRecognize + * long_running: + * initial_poll_delay: 60s # 1 minute + * poll_delay_multiplier: 1.5 + * max_poll_delay: 360s # 6 minutes + * total_poll_timeout: 54000s # 90 minutes * * * .google.api.MethodSettings.LongRunning long_running = 2; */ - private com.google.protobuf.SingleFieldBuilderV3< + private com.google.protobuf.SingleFieldBuilder< com.google.api.MethodSettings.LongRunning, com.google.api.MethodSettings.LongRunning.Builder, com.google.api.MethodSettings.LongRunningOrBuilder> - getLongRunningFieldBuilder() { + internalGetLongRunningFieldBuilder() { if (longRunningBuilder_ == null) { longRunningBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< + new com.google.protobuf.SingleFieldBuilder< com.google.api.MethodSettings.LongRunning, com.google.api.MethodSettings.LongRunning.Builder, com.google.api.MethodSettings.LongRunningOrBuilder>( @@ -2487,15 +2722,277 @@ public com.google.api.MethodSettings.LongRunningOrBuilder getLongRunningOrBuilde return longRunningBuilder_; } - @java.lang.Override - public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); + private com.google.protobuf.LazyStringArrayList autoPopulatedFields_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + + private void ensureAutoPopulatedFieldsIsMutable() { + if (!autoPopulatedFields_.isModifiable()) { + autoPopulatedFields_ = new com.google.protobuf.LazyStringArrayList(autoPopulatedFields_); + } + bitField0_ |= 0x00000004; } - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); + /** + * + * + *
        +     * List of top-level fields of the request message, that should be
        +     * automatically populated by the client libraries based on their
        +     * (google.api.field_info).format. Currently supported format: UUID4.
        +     *
        +     * Example of a YAML configuration:
        +     *
        +     * publishing:
        +     * method_settings:
        +     * - selector: google.example.v1.ExampleService.CreateExample
        +     * auto_populated_fields:
        +     * - request_id
        +     * 
        + * + * repeated string auto_populated_fields = 3; + * + * @return A list containing the autoPopulatedFields. + */ + public com.google.protobuf.ProtocolStringList getAutoPopulatedFieldsList() { + autoPopulatedFields_.makeImmutable(); + return autoPopulatedFields_; + } + + /** + * + * + *
        +     * List of top-level fields of the request message, that should be
        +     * automatically populated by the client libraries based on their
        +     * (google.api.field_info).format. Currently supported format: UUID4.
        +     *
        +     * Example of a YAML configuration:
        +     *
        +     * publishing:
        +     * method_settings:
        +     * - selector: google.example.v1.ExampleService.CreateExample
        +     * auto_populated_fields:
        +     * - request_id
        +     * 
        + * + * repeated string auto_populated_fields = 3; + * + * @return The count of autoPopulatedFields. + */ + public int getAutoPopulatedFieldsCount() { + return autoPopulatedFields_.size(); + } + + /** + * + * + *
        +     * List of top-level fields of the request message, that should be
        +     * automatically populated by the client libraries based on their
        +     * (google.api.field_info).format. Currently supported format: UUID4.
        +     *
        +     * Example of a YAML configuration:
        +     *
        +     * publishing:
        +     * method_settings:
        +     * - selector: google.example.v1.ExampleService.CreateExample
        +     * auto_populated_fields:
        +     * - request_id
        +     * 
        + * + * repeated string auto_populated_fields = 3; + * + * @param index The index of the element to return. + * @return The autoPopulatedFields at the given index. + */ + public java.lang.String getAutoPopulatedFields(int index) { + return autoPopulatedFields_.get(index); + } + + /** + * + * + *
        +     * List of top-level fields of the request message, that should be
        +     * automatically populated by the client libraries based on their
        +     * (google.api.field_info).format. Currently supported format: UUID4.
        +     *
        +     * Example of a YAML configuration:
        +     *
        +     * publishing:
        +     * method_settings:
        +     * - selector: google.example.v1.ExampleService.CreateExample
        +     * auto_populated_fields:
        +     * - request_id
        +     * 
        + * + * repeated string auto_populated_fields = 3; + * + * @param index The index of the value to return. + * @return The bytes of the autoPopulatedFields at the given index. + */ + public com.google.protobuf.ByteString getAutoPopulatedFieldsBytes(int index) { + return autoPopulatedFields_.getByteString(index); + } + + /** + * + * + *
        +     * List of top-level fields of the request message, that should be
        +     * automatically populated by the client libraries based on their
        +     * (google.api.field_info).format. Currently supported format: UUID4.
        +     *
        +     * Example of a YAML configuration:
        +     *
        +     * publishing:
        +     * method_settings:
        +     * - selector: google.example.v1.ExampleService.CreateExample
        +     * auto_populated_fields:
        +     * - request_id
        +     * 
        + * + * repeated string auto_populated_fields = 3; + * + * @param index The index to set the value at. + * @param value The autoPopulatedFields to set. + * @return This builder for chaining. + */ + public Builder setAutoPopulatedFields(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureAutoPopulatedFieldsIsMutable(); + autoPopulatedFields_.set(index, value); + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
        +     * List of top-level fields of the request message, that should be
        +     * automatically populated by the client libraries based on their
        +     * (google.api.field_info).format. Currently supported format: UUID4.
        +     *
        +     * Example of a YAML configuration:
        +     *
        +     * publishing:
        +     * method_settings:
        +     * - selector: google.example.v1.ExampleService.CreateExample
        +     * auto_populated_fields:
        +     * - request_id
        +     * 
        + * + * repeated string auto_populated_fields = 3; + * + * @param value The autoPopulatedFields to add. + * @return This builder for chaining. + */ + public Builder addAutoPopulatedFields(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureAutoPopulatedFieldsIsMutable(); + autoPopulatedFields_.add(value); + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
        +     * List of top-level fields of the request message, that should be
        +     * automatically populated by the client libraries based on their
        +     * (google.api.field_info).format. Currently supported format: UUID4.
        +     *
        +     * Example of a YAML configuration:
        +     *
        +     * publishing:
        +     * method_settings:
        +     * - selector: google.example.v1.ExampleService.CreateExample
        +     * auto_populated_fields:
        +     * - request_id
        +     * 
        + * + * repeated string auto_populated_fields = 3; + * + * @param values The autoPopulatedFields to add. + * @return This builder for chaining. + */ + public Builder addAllAutoPopulatedFields(java.lang.Iterable values) { + ensureAutoPopulatedFieldsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, autoPopulatedFields_); + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
        +     * List of top-level fields of the request message, that should be
        +     * automatically populated by the client libraries based on their
        +     * (google.api.field_info).format. Currently supported format: UUID4.
        +     *
        +     * Example of a YAML configuration:
        +     *
        +     * publishing:
        +     * method_settings:
        +     * - selector: google.example.v1.ExampleService.CreateExample
        +     * auto_populated_fields:
        +     * - request_id
        +     * 
        + * + * repeated string auto_populated_fields = 3; + * + * @return This builder for chaining. + */ + public Builder clearAutoPopulatedFields() { + autoPopulatedFields_ = com.google.protobuf.LazyStringArrayList.emptyList(); + bitField0_ = (bitField0_ & ~0x00000004); + ; + onChanged(); + return this; + } + + /** + * + * + *
        +     * List of top-level fields of the request message, that should be
        +     * automatically populated by the client libraries based on their
        +     * (google.api.field_info).format. Currently supported format: UUID4.
        +     *
        +     * Example of a YAML configuration:
        +     *
        +     * publishing:
        +     * method_settings:
        +     * - selector: google.example.v1.ExampleService.CreateExample
        +     * auto_populated_fields:
        +     * - request_id
        +     * 
        + * + * repeated string auto_populated_fields = 3; + * + * @param value The bytes of the autoPopulatedFields to add. + * @return This builder for chaining. + */ + public Builder addAutoPopulatedFieldsBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureAutoPopulatedFieldsIsMutable(); + autoPopulatedFields_.add(value); + bitField0_ |= 0x00000004; + onChanged(); + return this; } // @@protoc_insertion_point(builder_scope:google.api.MethodSettings) diff --git a/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/MethodSettingsOrBuilder.java b/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/MethodSettingsOrBuilder.java index bd5c5eaf25..90c24d2333 100644 --- a/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/MethodSettingsOrBuilder.java +++ b/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/MethodSettingsOrBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,10 +14,13 @@ * limitations under the License. */ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: google/api/client.proto +// Protobuf Java Version: 4.33.2 package com.google.api; +@com.google.protobuf.Generated public interface MethodSettingsOrBuilder extends // @@protoc_insertion_point(interface_extends:google.api.MethodSettings) @@ -29,6 +32,13 @@ public interface MethodSettingsOrBuilder *
            * The fully qualified name of the method, for which the options below apply.
            * This is used to find the method to apply the options.
        +   *
        +   * Example:
        +   *
        +   * publishing:
        +   * method_settings:
        +   * - selector: google.storage.control.v2.StorageControl.CreateFolder
        +   * # method settings for CreateFolder...
            * 
        * * string selector = 1; @@ -36,12 +46,20 @@ public interface MethodSettingsOrBuilder * @return The selector. */ java.lang.String getSelector(); + /** * * *
            * The fully qualified name of the method, for which the options below apply.
            * This is used to find the method to apply the options.
        +   *
        +   * Example:
        +   *
        +   * publishing:
        +   * method_settings:
        +   * - selector: google.storage.control.v2.StorageControl.CreateFolder
        +   * # method settings for CreateFolder...
            * 
        * * string selector = 1; @@ -57,18 +75,17 @@ public interface MethodSettingsOrBuilder * Describes settings to use for long-running operations when generating * API methods for RPCs. Complements RPCs that use the annotations in * google/longrunning/operations.proto. + * * Example of a YAML configuration:: - * publishing: - * method_behavior: - * - selector: CreateAdDomain - * long_running: - * initial_poll_delay: - * seconds: 60 # 1 minute - * poll_delay_multiplier: 1.5 - * max_poll_delay: - * seconds: 360 # 6 minutes - * total_poll_timeout: - * seconds: 54000 # 90 minutes + * + * publishing: + * method_settings: + * - selector: google.cloud.speech.v2.Speech.BatchRecognize + * long_running: + * initial_poll_delay: 60s # 1 minute + * poll_delay_multiplier: 1.5 + * max_poll_delay: 360s # 6 minutes + * total_poll_timeout: 54000s # 90 minutes * * * .google.api.MethodSettings.LongRunning long_running = 2; @@ -76,6 +93,7 @@ public interface MethodSettingsOrBuilder * @return Whether the longRunning field is set. */ boolean hasLongRunning(); + /** * * @@ -83,18 +101,17 @@ public interface MethodSettingsOrBuilder * Describes settings to use for long-running operations when generating * API methods for RPCs. Complements RPCs that use the annotations in * google/longrunning/operations.proto. + * * Example of a YAML configuration:: - * publishing: - * method_behavior: - * - selector: CreateAdDomain - * long_running: - * initial_poll_delay: - * seconds: 60 # 1 minute - * poll_delay_multiplier: 1.5 - * max_poll_delay: - * seconds: 360 # 6 minutes - * total_poll_timeout: - * seconds: 54000 # 90 minutes + * + * publishing: + * method_settings: + * - selector: google.cloud.speech.v2.Speech.BatchRecognize + * long_running: + * initial_poll_delay: 60s # 1 minute + * poll_delay_multiplier: 1.5 + * max_poll_delay: 360s # 6 minutes + * total_poll_timeout: 54000s # 90 minutes * * * .google.api.MethodSettings.LongRunning long_running = 2; @@ -102,6 +119,7 @@ public interface MethodSettingsOrBuilder * @return The longRunning. */ com.google.api.MethodSettings.LongRunning getLongRunning(); + /** * * @@ -109,21 +127,114 @@ public interface MethodSettingsOrBuilder * Describes settings to use for long-running operations when generating * API methods for RPCs. Complements RPCs that use the annotations in * google/longrunning/operations.proto. + * * Example of a YAML configuration:: - * publishing: - * method_behavior: - * - selector: CreateAdDomain - * long_running: - * initial_poll_delay: - * seconds: 60 # 1 minute - * poll_delay_multiplier: 1.5 - * max_poll_delay: - * seconds: 360 # 6 minutes - * total_poll_timeout: - * seconds: 54000 # 90 minutes + * + * publishing: + * method_settings: + * - selector: google.cloud.speech.v2.Speech.BatchRecognize + * long_running: + * initial_poll_delay: 60s # 1 minute + * poll_delay_multiplier: 1.5 + * max_poll_delay: 360s # 6 minutes + * total_poll_timeout: 54000s # 90 minutes * * * .google.api.MethodSettings.LongRunning long_running = 2; */ com.google.api.MethodSettings.LongRunningOrBuilder getLongRunningOrBuilder(); + + /** + * + * + *
        +   * List of top-level fields of the request message, that should be
        +   * automatically populated by the client libraries based on their
        +   * (google.api.field_info).format. Currently supported format: UUID4.
        +   *
        +   * Example of a YAML configuration:
        +   *
        +   * publishing:
        +   * method_settings:
        +   * - selector: google.example.v1.ExampleService.CreateExample
        +   * auto_populated_fields:
        +   * - request_id
        +   * 
        + * + * repeated string auto_populated_fields = 3; + * + * @return A list containing the autoPopulatedFields. + */ + java.util.List getAutoPopulatedFieldsList(); + + /** + * + * + *
        +   * List of top-level fields of the request message, that should be
        +   * automatically populated by the client libraries based on their
        +   * (google.api.field_info).format. Currently supported format: UUID4.
        +   *
        +   * Example of a YAML configuration:
        +   *
        +   * publishing:
        +   * method_settings:
        +   * - selector: google.example.v1.ExampleService.CreateExample
        +   * auto_populated_fields:
        +   * - request_id
        +   * 
        + * + * repeated string auto_populated_fields = 3; + * + * @return The count of autoPopulatedFields. + */ + int getAutoPopulatedFieldsCount(); + + /** + * + * + *
        +   * List of top-level fields of the request message, that should be
        +   * automatically populated by the client libraries based on their
        +   * (google.api.field_info).format. Currently supported format: UUID4.
        +   *
        +   * Example of a YAML configuration:
        +   *
        +   * publishing:
        +   * method_settings:
        +   * - selector: google.example.v1.ExampleService.CreateExample
        +   * auto_populated_fields:
        +   * - request_id
        +   * 
        + * + * repeated string auto_populated_fields = 3; + * + * @param index The index of the element to return. + * @return The autoPopulatedFields at the given index. + */ + java.lang.String getAutoPopulatedFields(int index); + + /** + * + * + *
        +   * List of top-level fields of the request message, that should be
        +   * automatically populated by the client libraries based on their
        +   * (google.api.field_info).format. Currently supported format: UUID4.
        +   *
        +   * Example of a YAML configuration:
        +   *
        +   * publishing:
        +   * method_settings:
        +   * - selector: google.example.v1.ExampleService.CreateExample
        +   * auto_populated_fields:
        +   * - request_id
        +   * 
        + * + * repeated string auto_populated_fields = 3; + * + * @param index The index of the value to return. + * @return The bytes of the autoPopulatedFields at the given index. + */ + com.google.protobuf.ByteString getAutoPopulatedFieldsBytes(int index); } diff --git a/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/Metric.java b/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/Metric.java index c6f0879da0..d588df8041 100644 --- a/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/Metric.java +++ b/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/Metric.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,9 @@ * limitations under the License. */ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: google/api/metric.proto +// Protobuf Java Version: 4.33.2 package com.google.api; @@ -28,13 +30,25 @@ * * Protobuf type {@code google.api.Metric} */ -public final class Metric extends com.google.protobuf.GeneratedMessageV3 +@com.google.protobuf.Generated +public final class Metric extends com.google.protobuf.GeneratedMessage implements // @@protoc_insertion_point(message_implements:google.api.Metric) MetricOrBuilder { private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "Metric"); + } + // Use Metric.newBuilder() to construct. - private Metric(com.google.protobuf.GeneratedMessageV3.Builder builder) { + private Metric(com.google.protobuf.GeneratedMessage.Builder builder) { super(builder); } @@ -42,24 +56,14 @@ private Metric() { type_ = ""; } - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new Metric(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.api.MetricProto.internal_static_google_api_Metric_descriptor; } @SuppressWarnings({"rawtypes"}) @java.lang.Override - protected com.google.protobuf.MapField internalGetMapField(int number) { + protected com.google.protobuf.MapFieldReflectionAccessor internalGetMapFieldReflection( + int number) { switch (number) { case 2: return internalGetLabels(); @@ -69,7 +73,7 @@ protected com.google.protobuf.MapField internalGetMapField(int number) { } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.api.MetricProto.internal_static_google_api_Metric_fieldAccessorTable .ensureFieldAccessorsInitialized( @@ -77,13 +81,17 @@ protected com.google.protobuf.MapField internalGetMapField(int number) { } public static final int TYPE_FIELD_NUMBER = 3; - private volatile java.lang.Object type_; + + @SuppressWarnings("serial") + private volatile java.lang.Object type_ = ""; + /** * * *
        -   * An existing metric type, see [google.api.MetricDescriptor][google.api.MetricDescriptor].
        -   * For example, `custom.googleapis.com/invoice/paid/amount`.
        +   * An existing metric type, see
        +   * [google.api.MetricDescriptor][google.api.MetricDescriptor]. For example,
        +   * `custom.googleapis.com/invoice/paid/amount`.
            * 
        * * string type = 3; @@ -102,12 +110,14 @@ public java.lang.String getType() { return s; } } + /** * * *
        -   * An existing metric type, see [google.api.MetricDescriptor][google.api.MetricDescriptor].
        -   * For example, `custom.googleapis.com/invoice/paid/amount`.
        +   * An existing metric type, see
        +   * [google.api.MetricDescriptor][google.api.MetricDescriptor]. For example,
        +   * `custom.googleapis.com/invoice/paid/amount`.
            * 
        * * string type = 3; @@ -139,6 +149,7 @@ private static final class LabelsDefaultEntryHolder { ""); } + @SuppressWarnings("serial") private com.google.protobuf.MapField labels_; private com.google.protobuf.MapField internalGetLabels() { @@ -151,6 +162,7 @@ private com.google.protobuf.MapField interna public int getLabelsCount() { return internalGetLabels().getMap().size(); } + /** * * @@ -168,12 +180,14 @@ public boolean containsLabels(java.lang.String key) { } return internalGetLabels().getMap().containsKey(key); } + /** Use {@link #getLabelsMap()} instead. */ @java.lang.Override @java.lang.Deprecated public java.util.Map getLabels() { return getLabelsMap(); } + /** * * @@ -188,6 +202,7 @@ public java.util.Map getLabels() { public java.util.Map getLabelsMap() { return internalGetLabels().getMap(); } + /** * * @@ -199,13 +214,17 @@ public java.util.Map getLabelsMap() { * map<string, string> labels = 2; */ @java.lang.Override - public java.lang.String getLabelsOrDefault(java.lang.String key, java.lang.String defaultValue) { + 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; } + /** * * @@ -242,10 +261,10 @@ public final boolean isInitialized() { @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - com.google.protobuf.GeneratedMessageV3.serializeStringMapTo( + com.google.protobuf.GeneratedMessage.serializeStringMapTo( output, internalGetLabels(), LabelsDefaultEntryHolder.defaultEntry, 2); - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(type_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 3, type_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(type_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 3, type_); } getUnknownFields().writeTo(output); } @@ -266,8 +285,8 @@ public int getSerializedSize() { .build(); size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, labels__); } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(type_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, type_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(type_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(3, type_); } size += getUnknownFields().getSerializedSize(); memoizedSize = size; @@ -344,38 +363,38 @@ public static com.google.api.Metric parseFrom( public static com.google.api.Metric parseFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); } public static com.google.api.Metric parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } public static com.google.api.Metric parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); } public static com.google.api.Metric parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( PARSER, input, extensionRegistry); } public static com.google.api.Metric parseFrom(com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); } public static com.google.api.Metric parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } @@ -398,10 +417,11 @@ public Builder toBuilder() { } @java.lang.Override - protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { Builder builder = new Builder(parent); return builder; } + /** * * @@ -412,7 +432,7 @@ protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.Build * * Protobuf type {@code google.api.Metric} */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder implements // @@protoc_insertion_point(builder_implements:google.api.Metric) com.google.api.MetricOrBuilder { @@ -421,7 +441,8 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } @SuppressWarnings({"rawtypes"}) - protected com.google.protobuf.MapField internalGetMapField(int number) { + protected com.google.protobuf.MapFieldReflectionAccessor internalGetMapFieldReflection( + int number) { switch (number) { case 2: return internalGetLabels(); @@ -431,7 +452,8 @@ protected com.google.protobuf.MapField internalGetMapField(int number) { } @SuppressWarnings({"rawtypes"}) - protected com.google.protobuf.MapField internalGetMutableMapField(int number) { + protected com.google.protobuf.MapFieldReflectionAccessor internalGetMutableMapFieldReflection( + int number) { switch (number) { case 2: return internalGetMutableLabels(); @@ -441,7 +463,7 @@ protected com.google.protobuf.MapField internalGetMutableMapField(int number) { } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.api.MetricProto.internal_static_google_api_Metric_fieldAccessorTable .ensureFieldAccessorsInitialized( @@ -451,15 +473,15 @@ protected com.google.protobuf.MapField internalGetMutableMapField(int number) { // Construct using com.google.api.Metric.newBuilder() private Builder() {} - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { super(parent); } @java.lang.Override public Builder clear() { super.clear(); + bitField0_ = 0; type_ = ""; - internalGetMutableLabels().clear(); return this; } @@ -486,45 +508,22 @@ public com.google.api.Metric build() { @java.lang.Override public com.google.api.Metric buildPartial() { com.google.api.Metric result = new com.google.api.Metric(this); - int from_bitField0_ = bitField0_; - result.type_ = type_; - result.labels_ = internalGetLabels(); - result.labels_.makeImmutable(); + if (bitField0_ != 0) { + buildPartial0(result); + } 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); + private void buildPartial0(com.google.api.Metric result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.type_ = type_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.labels_ = internalGetLabels(); + result.labels_.makeImmutable(); + } } @java.lang.Override @@ -541,9 +540,11 @@ public Builder mergeFrom(com.google.api.Metric other) { if (other == com.google.api.Metric.getDefaultInstance()) return this; if (!other.getType().isEmpty()) { type_ = other.type_; + bitField0_ |= 0x00000001; onChanged(); } internalGetMutableLabels().mergeFrom(other.internalGetLabels()); + bitField0_ |= 0x00000002; this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; @@ -579,12 +580,13 @@ public Builder mergeFrom( internalGetMutableLabels() .getMutableMap() .put(labels__.getKey(), labels__.getValue()); + bitField0_ |= 0x00000002; break; } // case 18 case 26: { type_ = input.readStringRequireUtf8(); - + bitField0_ |= 0x00000001; break; } // case 26 default: @@ -607,12 +609,14 @@ public Builder mergeFrom( private int bitField0_; private java.lang.Object type_ = ""; + /** * * *
        -     * An existing metric type, see [google.api.MetricDescriptor][google.api.MetricDescriptor].
        -     * For example, `custom.googleapis.com/invoice/paid/amount`.
        +     * An existing metric type, see
        +     * [google.api.MetricDescriptor][google.api.MetricDescriptor]. For example,
        +     * `custom.googleapis.com/invoice/paid/amount`.
              * 
        * * string type = 3; @@ -630,12 +634,14 @@ public java.lang.String getType() { return (java.lang.String) ref; } } + /** * * *
        -     * An existing metric type, see [google.api.MetricDescriptor][google.api.MetricDescriptor].
        -     * For example, `custom.googleapis.com/invoice/paid/amount`.
        +     * An existing metric type, see
        +     * [google.api.MetricDescriptor][google.api.MetricDescriptor]. For example,
        +     * `custom.googleapis.com/invoice/paid/amount`.
              * 
        * * string type = 3; @@ -653,12 +659,14 @@ public com.google.protobuf.ByteString getTypeBytes() { return (com.google.protobuf.ByteString) ref; } } + /** * * *
        -     * An existing metric type, see [google.api.MetricDescriptor][google.api.MetricDescriptor].
        -     * For example, `custom.googleapis.com/invoice/paid/amount`.
        +     * An existing metric type, see
        +     * [google.api.MetricDescriptor][google.api.MetricDescriptor]. For example,
        +     * `custom.googleapis.com/invoice/paid/amount`.
              * 
        * * string type = 3; @@ -670,17 +678,19 @@ public Builder setType(java.lang.String value) { if (value == null) { throw new NullPointerException(); } - type_ = value; + bitField0_ |= 0x00000001; onChanged(); return this; } + /** * * *
        -     * An existing metric type, see [google.api.MetricDescriptor][google.api.MetricDescriptor].
        -     * For example, `custom.googleapis.com/invoice/paid/amount`.
        +     * An existing metric type, see
        +     * [google.api.MetricDescriptor][google.api.MetricDescriptor]. For example,
        +     * `custom.googleapis.com/invoice/paid/amount`.
              * 
        * * string type = 3; @@ -688,17 +698,19 @@ public Builder setType(java.lang.String value) { * @return This builder for chaining. */ public Builder clearType() { - type_ = getDefaultInstance().getType(); + bitField0_ = (bitField0_ & ~0x00000001); onChanged(); return this; } + /** * * *
        -     * An existing metric type, see [google.api.MetricDescriptor][google.api.MetricDescriptor].
        -     * For example, `custom.googleapis.com/invoice/paid/amount`.
        +     * An existing metric type, see
        +     * [google.api.MetricDescriptor][google.api.MetricDescriptor]. For example,
        +     * `custom.googleapis.com/invoice/paid/amount`.
              * 
        * * string type = 3; @@ -711,8 +723,8 @@ public Builder setTypeBytes(com.google.protobuf.ByteString value) { throw new NullPointerException(); } checkByteStringIsUtf8(value); - type_ = value; + bitField0_ |= 0x00000001; onChanged(); return this; } @@ -728,20 +740,21 @@ private com.google.protobuf.MapField interna private com.google.protobuf.MapField internalGetMutableLabels() { - onChanged(); - ; if (labels_ == null) { labels_ = com.google.protobuf.MapField.newMapField(LabelsDefaultEntryHolder.defaultEntry); } if (!labels_.isMutable()) { labels_ = labels_.copy(); } + bitField0_ |= 0x00000002; + onChanged(); return labels_; } public int getLabelsCount() { return internalGetLabels().getMap().size(); } + /** * * @@ -759,12 +772,14 @@ public boolean containsLabels(java.lang.String key) { } return internalGetLabels().getMap().containsKey(key); } + /** Use {@link #getLabelsMap()} instead. */ @java.lang.Override @java.lang.Deprecated public java.util.Map getLabels() { return getLabelsMap(); } + /** * * @@ -779,6 +794,7 @@ public java.util.Map getLabels() { public java.util.Map getLabelsMap() { return internalGetLabels().getMap(); } + /** * * @@ -790,14 +806,17 @@ public java.util.Map getLabelsMap() { * map<string, string> labels = 2; */ @java.lang.Override - public java.lang.String getLabelsOrDefault( - java.lang.String key, java.lang.String defaultValue) { + 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; } + /** * * @@ -821,9 +840,11 @@ public java.lang.String getLabelsOrThrow(java.lang.String key) { } public Builder clearLabels() { + bitField0_ = (bitField0_ & ~0x00000002); internalGetMutableLabels().getMutableMap().clear(); return this; } + /** * * @@ -841,11 +862,14 @@ public Builder removeLabels(java.lang.String key) { internalGetMutableLabels().getMutableMap().remove(key); return this; } + /** Use alternate mutation accessors instead. */ @java.lang.Deprecated public java.util.Map getMutableLabels() { + bitField0_ |= 0x00000002; return internalGetMutableLabels().getMutableMap(); } + /** * * @@ -863,10 +887,11 @@ public Builder putLabels(java.lang.String key, java.lang.String value) { if (value == null) { throw new NullPointerException("map value"); } - internalGetMutableLabels().getMutableMap().put(key, value); + bitField0_ |= 0x00000002; return this; } + /** * * @@ -879,20 +904,10 @@ public Builder putLabels(java.lang.String key, java.lang.String value) { */ public Builder putAllLabels(java.util.Map values) { internalGetMutableLabels().getMutableMap().putAll(values); + bitField0_ |= 0x00000002; return this; } - @java.lang.Override - public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - // @@protoc_insertion_point(builder_scope:google.api.Metric) } diff --git a/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/MetricDescriptor.java b/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/MetricDescriptor.java index 0ba01d20fa..e5b3a16447 100644 --- a/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/MetricDescriptor.java +++ b/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/MetricDescriptor.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,9 @@ * limitations under the License. */ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: google/api/metric.proto +// Protobuf Java Version: 4.33.2 package com.google.api; @@ -29,13 +31,25 @@ * * Protobuf type {@code google.api.MetricDescriptor} */ -public final class MetricDescriptor extends com.google.protobuf.GeneratedMessageV3 +@com.google.protobuf.Generated +public final class MetricDescriptor extends com.google.protobuf.GeneratedMessage implements // @@protoc_insertion_point(message_implements:google.api.MetricDescriptor) MetricDescriptorOrBuilder { private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "MetricDescriptor"); + } + // Use MetricDescriptor.newBuilder() to construct. - private MetricDescriptor(com.google.protobuf.GeneratedMessageV3.Builder builder) { + private MetricDescriptor(com.google.protobuf.GeneratedMessage.Builder builder) { super(builder); } @@ -49,18 +63,7 @@ private MetricDescriptor() { description_ = ""; displayName_ = ""; launchStage_ = 0; - monitoredResourceTypes_ = com.google.protobuf.LazyStringArrayList.EMPTY; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new MetricDescriptor(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; + monitoredResourceTypes_ = com.google.protobuf.LazyStringArrayList.emptyList(); } public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { @@ -68,7 +71,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.api.MetricProto.internal_static_google_api_MetricDescriptor_fieldAccessorTable .ensureFieldAccessorsInitialized( @@ -134,6 +137,16 @@ public enum MetricKind implements com.google.protobuf.ProtocolMessageEnum { UNRECOGNIZED(-1), ; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "MetricKind"); + } + /** * * @@ -144,6 +157,7 @@ public enum MetricKind implements com.google.protobuf.ProtocolMessageEnum { * METRIC_KIND_UNSPECIFIED = 0; */ public static final int METRIC_KIND_UNSPECIFIED_VALUE = 0; + /** * * @@ -154,6 +168,7 @@ public enum MetricKind implements com.google.protobuf.ProtocolMessageEnum { * GAUGE = 1; */ public static final int GAUGE_VALUE = 1; + /** * * @@ -164,6 +179,7 @@ public enum MetricKind implements com.google.protobuf.ProtocolMessageEnum { * DELTA = 2; */ public static final int DELTA_VALUE = 2; + /** * * @@ -239,7 +255,7 @@ public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType return getDescriptor(); } - public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + public static com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { return com.google.api.MetricDescriptor.getDescriptor().getEnumTypes().get(0); } @@ -349,6 +365,16 @@ public enum ValueType implements com.google.protobuf.ProtocolMessageEnum { UNRECOGNIZED(-1), ; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "ValueType"); + } + /** * * @@ -359,6 +385,7 @@ public enum ValueType implements com.google.protobuf.ProtocolMessageEnum { * VALUE_TYPE_UNSPECIFIED = 0; */ public static final int VALUE_TYPE_UNSPECIFIED_VALUE = 0; + /** * * @@ -370,6 +397,7 @@ public enum ValueType implements com.google.protobuf.ProtocolMessageEnum { * BOOL = 1; */ public static final int BOOL_VALUE = 1; + /** * * @@ -380,6 +408,7 @@ public enum ValueType implements com.google.protobuf.ProtocolMessageEnum { * INT64 = 2; */ public static final int INT64_VALUE = 2; + /** * * @@ -390,6 +419,7 @@ public enum ValueType implements com.google.protobuf.ProtocolMessageEnum { * DOUBLE = 3; */ public static final int DOUBLE_VALUE = 3; + /** * * @@ -401,6 +431,7 @@ public enum ValueType implements com.google.protobuf.ProtocolMessageEnum { * STRING = 4; */ public static final int STRING_VALUE = 4; + /** * * @@ -411,6 +442,7 @@ public enum ValueType implements com.google.protobuf.ProtocolMessageEnum { * DISTRIBUTION = 5; */ public static final int DISTRIBUTION_VALUE = 5; + /** * * @@ -488,7 +520,7 @@ public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType return getDescriptor(); } - public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + public static com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { return com.google.api.MetricDescriptor.getDescriptor().getEnumTypes().get(1); } @@ -522,28 +554,33 @@ public interface MetricDescriptorMetadataOrBuilder * * *
        -     * Deprecated. Must use the [MetricDescriptor.launch_stage][google.api.MetricDescriptor.launch_stage] instead.
        +     * Deprecated. Must use the
        +     * [MetricDescriptor.launch_stage][google.api.MetricDescriptor.launch_stage]
        +     * instead.
              * 
        * * .google.api.LaunchStage launch_stage = 1 [deprecated = true]; * * @deprecated google.api.MetricDescriptor.MetricDescriptorMetadata.launch_stage is deprecated. - * See google/api/metric.proto;l=83 + * See google/api/metric.proto;l=100 * @return The enum numeric value on the wire for launchStage. */ @java.lang.Deprecated int getLaunchStageValue(); + /** * * *
        -     * Deprecated. Must use the [MetricDescriptor.launch_stage][google.api.MetricDescriptor.launch_stage] instead.
        +     * Deprecated. Must use the
        +     * [MetricDescriptor.launch_stage][google.api.MetricDescriptor.launch_stage]
        +     * instead.
              * 
        * * .google.api.LaunchStage launch_stage = 1 [deprecated = true]; * * @deprecated google.api.MetricDescriptor.MetricDescriptorMetadata.launch_stage is deprecated. - * See google/api/metric.proto;l=83 + * See google/api/metric.proto;l=100 * @return The launchStage. */ @java.lang.Deprecated @@ -564,6 +601,7 @@ public interface MetricDescriptorMetadataOrBuilder * @return Whether the samplePeriod field is set. */ boolean hasSamplePeriod(); + /** * * @@ -579,6 +617,7 @@ public interface MetricDescriptorMetadataOrBuilder * @return The samplePeriod. */ com.google.protobuf.Duration getSamplePeriod(); + /** * * @@ -607,6 +646,7 @@ public interface MetricDescriptorMetadataOrBuilder * @return Whether the ingestDelay field is set. */ boolean hasIngestDelay(); + /** * * @@ -621,6 +661,7 @@ public interface MetricDescriptorMetadataOrBuilder * @return The ingestDelay. */ com.google.protobuf.Duration getIngestDelay(); + /** * * @@ -633,7 +674,91 @@ public interface MetricDescriptorMetadataOrBuilder * .google.protobuf.Duration ingest_delay = 3; */ com.google.protobuf.DurationOrBuilder getIngestDelayOrBuilder(); + + /** + * + * + *
        +     * The scope of the timeseries data of the metric.
        +     * 
        + * + * + * repeated .google.api.MetricDescriptor.MetricDescriptorMetadata.TimeSeriesResourceHierarchyLevel time_series_resource_hierarchy_level = 4; + * + * + * @return A list containing the timeSeriesResourceHierarchyLevel. + */ + java.util.List< + com.google.api.MetricDescriptor.MetricDescriptorMetadata + .TimeSeriesResourceHierarchyLevel> + getTimeSeriesResourceHierarchyLevelList(); + + /** + * + * + *
        +     * The scope of the timeseries data of the metric.
        +     * 
        + * + * + * repeated .google.api.MetricDescriptor.MetricDescriptorMetadata.TimeSeriesResourceHierarchyLevel time_series_resource_hierarchy_level = 4; + * + * + * @return The count of timeSeriesResourceHierarchyLevel. + */ + int getTimeSeriesResourceHierarchyLevelCount(); + + /** + * + * + *
        +     * The scope of the timeseries data of the metric.
        +     * 
        + * + * + * repeated .google.api.MetricDescriptor.MetricDescriptorMetadata.TimeSeriesResourceHierarchyLevel time_series_resource_hierarchy_level = 4; + * + * + * @param index The index of the element to return. + * @return The timeSeriesResourceHierarchyLevel at the given index. + */ + com.google.api.MetricDescriptor.MetricDescriptorMetadata.TimeSeriesResourceHierarchyLevel + getTimeSeriesResourceHierarchyLevel(int index); + + /** + * + * + *
        +     * The scope of the timeseries data of the metric.
        +     * 
        + * + * + * repeated .google.api.MetricDescriptor.MetricDescriptorMetadata.TimeSeriesResourceHierarchyLevel time_series_resource_hierarchy_level = 4; + * + * + * @return A list containing the enum numeric values on the wire for + * timeSeriesResourceHierarchyLevel. + */ + java.util.List getTimeSeriesResourceHierarchyLevelValueList(); + + /** + * + * + *
        +     * The scope of the timeseries data of the metric.
        +     * 
        + * + * + * repeated .google.api.MetricDescriptor.MetricDescriptorMetadata.TimeSeriesResourceHierarchyLevel time_series_resource_hierarchy_level = 4; + * + * + * @param index The index of the value to return. + * @return The enum numeric value on the wire of timeSeriesResourceHierarchyLevel at the given + * index. + */ + int getTimeSeriesResourceHierarchyLevelValue(int index); } + /** * * @@ -643,29 +768,30 @@ public interface MetricDescriptorMetadataOrBuilder * * Protobuf type {@code google.api.MetricDescriptor.MetricDescriptorMetadata} */ - public static final class MetricDescriptorMetadata extends com.google.protobuf.GeneratedMessageV3 + public static final class MetricDescriptorMetadata extends com.google.protobuf.GeneratedMessage implements // @@protoc_insertion_point(message_implements:google.api.MetricDescriptor.MetricDescriptorMetadata) MetricDescriptorMetadataOrBuilder { private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "MetricDescriptorMetadata"); + } + // Use MetricDescriptorMetadata.newBuilder() to construct. - private MetricDescriptorMetadata(com.google.protobuf.GeneratedMessageV3.Builder builder) { + private MetricDescriptorMetadata(com.google.protobuf.GeneratedMessage.Builder builder) { super(builder); } private MetricDescriptorMetadata() { launchStage_ = 0; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new MetricDescriptorMetadata(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; + timeSeriesResourceHierarchyLevel_ = emptyIntList(); } public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { @@ -674,7 +800,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.api.MetricProto .internal_static_google_api_MetricDescriptor_MetricDescriptorMetadata_fieldAccessorTable @@ -683,19 +809,223 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { com.google.api.MetricDescriptor.MetricDescriptorMetadata.Builder.class); } + /** + * + * + *
        +     * The resource hierarchy level of the timeseries data of a metric.
        +     * 
        + * + * Protobuf enum {@code + * google.api.MetricDescriptor.MetricDescriptorMetadata.TimeSeriesResourceHierarchyLevel} + */ + public enum TimeSeriesResourceHierarchyLevel + implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
        +       * Do not use this default value.
        +       * 
        + * + * TIME_SERIES_RESOURCE_HIERARCHY_LEVEL_UNSPECIFIED = 0; + */ + TIME_SERIES_RESOURCE_HIERARCHY_LEVEL_UNSPECIFIED(0), + /** + * + * + *
        +       * Scopes a metric to a project.
        +       * 
        + * + * PROJECT = 1; + */ + PROJECT(1), + /** + * + * + *
        +       * Scopes a metric to an organization.
        +       * 
        + * + * ORGANIZATION = 2; + */ + ORGANIZATION(2), + /** + * + * + *
        +       * Scopes a metric to a folder.
        +       * 
        + * + * FOLDER = 3; + */ + FOLDER(3), + UNRECOGNIZED(-1), + ; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "TimeSeriesResourceHierarchyLevel"); + } + + /** + * + * + *
        +       * Do not use this default value.
        +       * 
        + * + * TIME_SERIES_RESOURCE_HIERARCHY_LEVEL_UNSPECIFIED = 0; + */ + public static final int TIME_SERIES_RESOURCE_HIERARCHY_LEVEL_UNSPECIFIED_VALUE = 0; + + /** + * + * + *
        +       * Scopes a metric to a project.
        +       * 
        + * + * PROJECT = 1; + */ + public static final int PROJECT_VALUE = 1; + + /** + * + * + *
        +       * Scopes a metric to an organization.
        +       * 
        + * + * ORGANIZATION = 2; + */ + public static final int ORGANIZATION_VALUE = 2; + + /** + * + * + *
        +       * Scopes a metric to a folder.
        +       * 
        + * + * FOLDER = 3; + */ + public static final int FOLDER_VALUE = 3; + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static TimeSeriesResourceHierarchyLevel 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 TimeSeriesResourceHierarchyLevel forNumber(int value) { + switch (value) { + case 0: + return TIME_SERIES_RESOURCE_HIERARCHY_LEVEL_UNSPECIFIED; + case 1: + return PROJECT; + case 2: + return ORGANIZATION; + case 3: + return FOLDER; + default: + return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap + internalGetValueMap() { + return internalValueMap; + } + + private static final com.google.protobuf.Internal.EnumLiteMap< + TimeSeriesResourceHierarchyLevel> + internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public TimeSeriesResourceHierarchyLevel findValueByNumber(int number) { + return TimeSeriesResourceHierarchyLevel.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 com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.api.MetricDescriptor.MetricDescriptorMetadata.getDescriptor() + .getEnumTypes() + .get(0); + } + + private static final TimeSeriesResourceHierarchyLevel[] VALUES = values(); + + public static TimeSeriesResourceHierarchyLevel 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 TimeSeriesResourceHierarchyLevel(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.api.MetricDescriptor.MetricDescriptorMetadata.TimeSeriesResourceHierarchyLevel) + } + + private int bitField0_; public static final int LAUNCH_STAGE_FIELD_NUMBER = 1; - private int launchStage_; + private int launchStage_ = 0; + /** * * *
        -     * Deprecated. Must use the [MetricDescriptor.launch_stage][google.api.MetricDescriptor.launch_stage] instead.
        +     * Deprecated. Must use the
        +     * [MetricDescriptor.launch_stage][google.api.MetricDescriptor.launch_stage]
        +     * instead.
              * 
        * * .google.api.LaunchStage launch_stage = 1 [deprecated = true]; * * @deprecated google.api.MetricDescriptor.MetricDescriptorMetadata.launch_stage is deprecated. - * See google/api/metric.proto;l=83 + * See google/api/metric.proto;l=100 * @return The enum numeric value on the wire for launchStage. */ @java.lang.Override @@ -703,29 +1033,32 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { public int getLaunchStageValue() { return launchStage_; } + /** * * *
        -     * Deprecated. Must use the [MetricDescriptor.launch_stage][google.api.MetricDescriptor.launch_stage] instead.
        +     * Deprecated. Must use the
        +     * [MetricDescriptor.launch_stage][google.api.MetricDescriptor.launch_stage]
        +     * instead.
              * 
        * * .google.api.LaunchStage launch_stage = 1 [deprecated = true]; * * @deprecated google.api.MetricDescriptor.MetricDescriptorMetadata.launch_stage is deprecated. - * See google/api/metric.proto;l=83 + * See google/api/metric.proto;l=100 * @return The launchStage. */ @java.lang.Override @java.lang.Deprecated public com.google.api.LaunchStage getLaunchStage() { - @SuppressWarnings("deprecation") - com.google.api.LaunchStage result = com.google.api.LaunchStage.valueOf(launchStage_); + com.google.api.LaunchStage result = com.google.api.LaunchStage.forNumber(launchStage_); return result == null ? com.google.api.LaunchStage.UNRECOGNIZED : result; } public static final int SAMPLE_PERIOD_FIELD_NUMBER = 2; private com.google.protobuf.Duration samplePeriod_; + /** * * @@ -742,8 +1075,9 @@ public com.google.api.LaunchStage getLaunchStage() { */ @java.lang.Override public boolean hasSamplePeriod() { - return samplePeriod_ != null; + return ((bitField0_ & 0x00000001) != 0); } + /** * * @@ -764,6 +1098,7 @@ public com.google.protobuf.Duration getSamplePeriod() { ? com.google.protobuf.Duration.getDefaultInstance() : samplePeriod_; } + /** * * @@ -778,11 +1113,14 @@ public com.google.protobuf.Duration getSamplePeriod() { */ @java.lang.Override public com.google.protobuf.DurationOrBuilder getSamplePeriodOrBuilder() { - return getSamplePeriod(); + return samplePeriod_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : samplePeriod_; } public static final int INGEST_DELAY_FIELD_NUMBER = 3; private com.google.protobuf.Duration ingestDelay_; + /** * * @@ -798,8 +1136,9 @@ public com.google.protobuf.DurationOrBuilder getSamplePeriodOrBuilder() { */ @java.lang.Override public boolean hasIngestDelay() { - return ingestDelay_ != null; + return ((bitField0_ & 0x00000002) != 0); } + /** * * @@ -819,6 +1158,7 @@ public com.google.protobuf.Duration getIngestDelay() { ? com.google.protobuf.Duration.getDefaultInstance() : ingestDelay_; } + /** * * @@ -832,50 +1172,205 @@ public com.google.protobuf.Duration getIngestDelay() { */ @java.lang.Override public com.google.protobuf.DurationOrBuilder getIngestDelayOrBuilder() { - return getIngestDelay(); + return ingestDelay_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : ingestDelay_; } - private byte memoizedIsInitialized = -1; + public static final int TIME_SERIES_RESOURCE_HIERARCHY_LEVEL_FIELD_NUMBER = 4; + + @SuppressWarnings("serial") + private com.google.protobuf.Internal.IntList timeSeriesResourceHierarchyLevel_ = emptyIntList(); + + private static final com.google.protobuf.Internal.IntListAdapter.IntConverter< + com.google.api.MetricDescriptor.MetricDescriptorMetadata + .TimeSeriesResourceHierarchyLevel> + timeSeriesResourceHierarchyLevel_converter_ = + new com.google.protobuf.Internal.IntListAdapter.IntConverter< + com.google.api.MetricDescriptor.MetricDescriptorMetadata + .TimeSeriesResourceHierarchyLevel>() { + public com.google.api.MetricDescriptor.MetricDescriptorMetadata + .TimeSeriesResourceHierarchyLevel + convert(int from) { + com.google.api.MetricDescriptor.MetricDescriptorMetadata + .TimeSeriesResourceHierarchyLevel + result = + com.google.api.MetricDescriptor.MetricDescriptorMetadata + .TimeSeriesResourceHierarchyLevel.forNumber(from); + return result == null + ? com.google.api.MetricDescriptor.MetricDescriptorMetadata + .TimeSeriesResourceHierarchyLevel.UNRECOGNIZED + : result; + } + }; + /** + * + * + *
        +     * The scope of the timeseries data of the metric.
        +     * 
        + * + * + * repeated .google.api.MetricDescriptor.MetricDescriptorMetadata.TimeSeriesResourceHierarchyLevel time_series_resource_hierarchy_level = 4; + * + * + * @return A list containing the timeSeriesResourceHierarchyLevel. + */ @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; + public java.util.List< + com.google.api.MetricDescriptor.MetricDescriptorMetadata + .TimeSeriesResourceHierarchyLevel> + getTimeSeriesResourceHierarchyLevelList() { + return new com.google.protobuf.Internal.IntListAdapter< + com.google.api.MetricDescriptor.MetricDescriptorMetadata + .TimeSeriesResourceHierarchyLevel>( + timeSeriesResourceHierarchyLevel_, timeSeriesResourceHierarchyLevel_converter_); } + /** + * + * + *
        +     * The scope of the timeseries data of the metric.
        +     * 
        + * + * + * repeated .google.api.MetricDescriptor.MetricDescriptorMetadata.TimeSeriesResourceHierarchyLevel time_series_resource_hierarchy_level = 4; + * + * + * @return The count of timeSeriesResourceHierarchyLevel. + */ @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (launchStage_ != com.google.api.LaunchStage.LAUNCH_STAGE_UNSPECIFIED.getNumber()) { - output.writeEnum(1, launchStage_); - } - if (samplePeriod_ != null) { - output.writeMessage(2, getSamplePeriod()); - } - if (ingestDelay_ != null) { - output.writeMessage(3, getIngestDelay()); - } - getUnknownFields().writeTo(output); + public int getTimeSeriesResourceHierarchyLevelCount() { + return timeSeriesResourceHierarchyLevel_.size(); } + /** + * + * + *
        +     * The scope of the timeseries data of the metric.
        +     * 
        + * + * + * repeated .google.api.MetricDescriptor.MetricDescriptorMetadata.TimeSeriesResourceHierarchyLevel time_series_resource_hierarchy_level = 4; + * + * + * @param index The index of the element to return. + * @return The timeSeriesResourceHierarchyLevel at the given index. + */ @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; + public com.google.api.MetricDescriptor.MetricDescriptorMetadata.TimeSeriesResourceHierarchyLevel + getTimeSeriesResourceHierarchyLevel(int index) { + return timeSeriesResourceHierarchyLevel_converter_.convert( + timeSeriesResourceHierarchyLevel_.getInt(index)); + } - size = 0; - if (launchStage_ != com.google.api.LaunchStage.LAUNCH_STAGE_UNSPECIFIED.getNumber()) { + /** + * + * + *
        +     * The scope of the timeseries data of the metric.
        +     * 
        + * + * + * repeated .google.api.MetricDescriptor.MetricDescriptorMetadata.TimeSeriesResourceHierarchyLevel time_series_resource_hierarchy_level = 4; + * + * + * @return A list containing the enum numeric values on the wire for + * timeSeriesResourceHierarchyLevel. + */ + @java.lang.Override + public java.util.List getTimeSeriesResourceHierarchyLevelValueList() { + return timeSeriesResourceHierarchyLevel_; + } + + /** + * + * + *
        +     * The scope of the timeseries data of the metric.
        +     * 
        + * + * + * repeated .google.api.MetricDescriptor.MetricDescriptorMetadata.TimeSeriesResourceHierarchyLevel time_series_resource_hierarchy_level = 4; + * + * + * @param index The index of the value to return. + * @return The enum numeric value on the wire of timeSeriesResourceHierarchyLevel at the given + * index. + */ + @java.lang.Override + public int getTimeSeriesResourceHierarchyLevelValue(int index) { + return timeSeriesResourceHierarchyLevel_.getInt(index); + } + + private int timeSeriesResourceHierarchyLevelMemoizedSerializedSize; + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + getSerializedSize(); + if (launchStage_ != com.google.api.LaunchStage.LAUNCH_STAGE_UNSPECIFIED.getNumber()) { + output.writeEnum(1, launchStage_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(2, getSamplePeriod()); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeMessage(3, getIngestDelay()); + } + if (getTimeSeriesResourceHierarchyLevelList().size() > 0) { + output.writeUInt32NoTag(34); + output.writeUInt32NoTag(timeSeriesResourceHierarchyLevelMemoizedSerializedSize); + } + for (int i = 0; i < timeSeriesResourceHierarchyLevel_.size(); i++) { + output.writeEnumNoTag(timeSeriesResourceHierarchyLevel_.getInt(i)); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (launchStage_ != com.google.api.LaunchStage.LAUNCH_STAGE_UNSPECIFIED.getNumber()) { size += com.google.protobuf.CodedOutputStream.computeEnumSize(1, launchStage_); } - if (samplePeriod_ != null) { + if (((bitField0_ & 0x00000001) != 0)) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getSamplePeriod()); } - if (ingestDelay_ != null) { + if (((bitField0_ & 0x00000002) != 0)) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getIngestDelay()); } + { + int dataSize = 0; + for (int i = 0; i < timeSeriesResourceHierarchyLevel_.size(); i++) { + dataSize += + com.google.protobuf.CodedOutputStream.computeEnumSizeNoTag( + timeSeriesResourceHierarchyLevel_.getInt(i)); + } + size += dataSize; + if (!getTimeSeriesResourceHierarchyLevelList().isEmpty()) { + size += 1; + size += com.google.protobuf.CodedOutputStream.computeUInt32SizeNoTag(dataSize); + } + timeSeriesResourceHierarchyLevelMemoizedSerializedSize = dataSize; + } size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; @@ -901,6 +1396,8 @@ public boolean equals(final java.lang.Object obj) { if (hasIngestDelay()) { if (!getIngestDelay().equals(other.getIngestDelay())) return false; } + if (!timeSeriesResourceHierarchyLevel_.equals(other.timeSeriesResourceHierarchyLevel_)) + return false; if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -922,6 +1419,10 @@ public int hashCode() { hash = (37 * hash) + INGEST_DELAY_FIELD_NUMBER; hash = (53 * hash) + getIngestDelay().hashCode(); } + if (getTimeSeriesResourceHierarchyLevelCount() > 0) { + hash = (37 * hash) + TIME_SERIES_RESOURCE_HIERARCHY_LEVEL_FIELD_NUMBER; + hash = (53 * hash) + timeSeriesResourceHierarchyLevel_.hashCode(); + } hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; @@ -964,38 +1465,38 @@ public static com.google.api.MetricDescriptor.MetricDescriptorMetadata parseFrom public static com.google.api.MetricDescriptor.MetricDescriptorMetadata parseFrom( java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); } public static com.google.api.MetricDescriptor.MetricDescriptorMetadata parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } public static com.google.api.MetricDescriptor.MetricDescriptorMetadata parseDelimitedFrom( java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); } public static com.google.api.MetricDescriptor.MetricDescriptorMetadata parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( PARSER, input, extensionRegistry); } public static com.google.api.MetricDescriptor.MetricDescriptorMetadata parseFrom( com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); } public static com.google.api.MetricDescriptor.MetricDescriptorMetadata parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } @@ -1019,11 +1520,11 @@ public Builder toBuilder() { } @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { Builder builder = new Builder(parent); return builder; } + /** * * @@ -1033,8 +1534,7 @@ protected Builder newBuilderForType( * * Protobuf type {@code google.api.MetricDescriptor.MetricDescriptorMetadata} */ - public static final class Builder - extends com.google.protobuf.GeneratedMessageV3.Builder + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder implements // @@protoc_insertion_point(builder_implements:google.api.MetricDescriptor.MetricDescriptorMetadata) com.google.api.MetricDescriptor.MetricDescriptorMetadataOrBuilder { @@ -1044,7 +1544,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.api.MetricProto .internal_static_google_api_MetricDescriptor_MetricDescriptorMetadata_fieldAccessorTable @@ -1054,29 +1554,38 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } // Construct using com.google.api.MetricDescriptor.MetricDescriptorMetadata.newBuilder() - private Builder() {} + private Builder() { + maybeForceBuilderInitialization(); + } - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetSamplePeriodFieldBuilder(); + internalGetIngestDelayFieldBuilder(); + } } @java.lang.Override public Builder clear() { super.clear(); + bitField0_ = 0; launchStage_ = 0; - - if (samplePeriodBuilder_ == null) { - samplePeriod_ = null; - } else { - samplePeriod_ = null; + samplePeriod_ = null; + if (samplePeriodBuilder_ != null) { + samplePeriodBuilder_.dispose(); samplePeriodBuilder_ = null; } - if (ingestDelayBuilder_ == null) { - ingestDelay_ = null; - } else { - ingestDelay_ = null; + ingestDelay_ = null; + if (ingestDelayBuilder_ != null) { + ingestDelayBuilder_.dispose(); ingestDelayBuilder_ = null; } + timeSeriesResourceHierarchyLevel_ = emptyIntList(); return this; } @@ -1104,54 +1613,34 @@ public com.google.api.MetricDescriptor.MetricDescriptorMetadata build() { public com.google.api.MetricDescriptor.MetricDescriptorMetadata buildPartial() { com.google.api.MetricDescriptor.MetricDescriptorMetadata result = new com.google.api.MetricDescriptor.MetricDescriptorMetadata(this); - result.launchStage_ = launchStage_; - if (samplePeriodBuilder_ == null) { - result.samplePeriod_ = samplePeriod_; - } else { - result.samplePeriod_ = samplePeriodBuilder_.build(); - } - if (ingestDelayBuilder_ == null) { - result.ingestDelay_ = ingestDelay_; - } else { - result.ingestDelay_ = ingestDelayBuilder_.build(); + if (bitField0_ != 0) { + buildPartial0(result); } 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); + private void buildPartial0(com.google.api.MetricDescriptor.MetricDescriptorMetadata result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.launchStage_ = launchStage_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.samplePeriod_ = + samplePeriodBuilder_ == null ? samplePeriod_ : samplePeriodBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.ingestDelay_ = + ingestDelayBuilder_ == null ? ingestDelay_ : ingestDelayBuilder_.build(); + to_bitField0_ |= 0x00000002; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + timeSeriesResourceHierarchyLevel_.makeImmutable(); + result.timeSeriesResourceHierarchyLevel_ = timeSeriesResourceHierarchyLevel_; + } + result.bitField0_ |= to_bitField0_; } @java.lang.Override @@ -1176,6 +1665,17 @@ public Builder mergeFrom(com.google.api.MetricDescriptor.MetricDescriptorMetadat if (other.hasIngestDelay()) { mergeIngestDelay(other.getIngestDelay()); } + if (!other.timeSeriesResourceHierarchyLevel_.isEmpty()) { + if (timeSeriesResourceHierarchyLevel_.isEmpty()) { + timeSeriesResourceHierarchyLevel_ = other.timeSeriesResourceHierarchyLevel_; + timeSeriesResourceHierarchyLevel_.makeImmutable(); + bitField0_ |= 0x00000008; + } else { + ensureTimeSeriesResourceHierarchyLevelIsMutable(); + timeSeriesResourceHierarchyLevel_.addAll(other.timeSeriesResourceHierarchyLevel_); + } + onChanged(); + } this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; @@ -1205,21 +1705,41 @@ public Builder mergeFrom( case 8: { launchStage_ = input.readEnum(); - + bitField0_ |= 0x00000001; break; } // case 8 case 18: { - input.readMessage(getSamplePeriodFieldBuilder().getBuilder(), extensionRegistry); - + input.readMessage( + internalGetSamplePeriodFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; break; } // case 18 case 26: { - input.readMessage(getIngestDelayFieldBuilder().getBuilder(), extensionRegistry); - + input.readMessage( + internalGetIngestDelayFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000004; break; } // case 26 + case 32: + { + int tmpRaw = input.readEnum(); + ensureTimeSeriesResourceHierarchyLevelIsMutable(); + timeSeriesResourceHierarchyLevel_.addInt(tmpRaw); + break; + } // case 32 + case 34: + { + int length = input.readRawVarint32(); + int limit = input.pushLimit(length); + ensureTimeSeriesResourceHierarchyLevelIsMutable(); + while (input.getBytesUntilLimit() > 0) { + timeSeriesResourceHierarchyLevel_.addInt(input.readEnum()); + } + input.popLimit(limit); + break; + } // case 34 default: { if (!super.parseUnknownField(input, extensionRegistry, tag)) { @@ -1237,18 +1757,23 @@ public Builder mergeFrom( return this; } + private int bitField0_; + private int launchStage_ = 0; + /** * * *
        -       * Deprecated. Must use the [MetricDescriptor.launch_stage][google.api.MetricDescriptor.launch_stage] instead.
        +       * Deprecated. Must use the
        +       * [MetricDescriptor.launch_stage][google.api.MetricDescriptor.launch_stage]
        +       * instead.
                * 
        * * .google.api.LaunchStage launch_stage = 1 [deprecated = true]; * * @deprecated google.api.MetricDescriptor.MetricDescriptorMetadata.launch_stage is - * deprecated. See google/api/metric.proto;l=83 + * deprecated. See google/api/metric.proto;l=100 * @return The enum numeric value on the wire for launchStage. */ @java.lang.Override @@ -1256,58 +1781,66 @@ public Builder mergeFrom( public int getLaunchStageValue() { return launchStage_; } + /** * * *
        -       * Deprecated. Must use the [MetricDescriptor.launch_stage][google.api.MetricDescriptor.launch_stage] instead.
        +       * Deprecated. Must use the
        +       * [MetricDescriptor.launch_stage][google.api.MetricDescriptor.launch_stage]
        +       * instead.
                * 
        * * .google.api.LaunchStage launch_stage = 1 [deprecated = true]; * * @deprecated google.api.MetricDescriptor.MetricDescriptorMetadata.launch_stage is - * deprecated. See google/api/metric.proto;l=83 + * deprecated. See google/api/metric.proto;l=100 * @param value The enum numeric value on the wire for launchStage to set. * @return This builder for chaining. */ @java.lang.Deprecated public Builder setLaunchStageValue(int value) { - launchStage_ = value; + bitField0_ |= 0x00000001; onChanged(); return this; } + /** * * *
        -       * Deprecated. Must use the [MetricDescriptor.launch_stage][google.api.MetricDescriptor.launch_stage] instead.
        +       * Deprecated. Must use the
        +       * [MetricDescriptor.launch_stage][google.api.MetricDescriptor.launch_stage]
        +       * instead.
                * 
        * * .google.api.LaunchStage launch_stage = 1 [deprecated = true]; * * @deprecated google.api.MetricDescriptor.MetricDescriptorMetadata.launch_stage is - * deprecated. See google/api/metric.proto;l=83 + * deprecated. See google/api/metric.proto;l=100 * @return The launchStage. */ @java.lang.Override @java.lang.Deprecated public com.google.api.LaunchStage getLaunchStage() { - @SuppressWarnings("deprecation") - com.google.api.LaunchStage result = com.google.api.LaunchStage.valueOf(launchStage_); + com.google.api.LaunchStage result = com.google.api.LaunchStage.forNumber(launchStage_); return result == null ? com.google.api.LaunchStage.UNRECOGNIZED : result; } + /** * * *
        -       * Deprecated. Must use the [MetricDescriptor.launch_stage][google.api.MetricDescriptor.launch_stage] instead.
        +       * Deprecated. Must use the
        +       * [MetricDescriptor.launch_stage][google.api.MetricDescriptor.launch_stage]
        +       * instead.
                * 
        * * .google.api.LaunchStage launch_stage = 1 [deprecated = true]; * * @deprecated google.api.MetricDescriptor.MetricDescriptorMetadata.launch_stage is - * deprecated. See google/api/metric.proto;l=83 + * deprecated. See google/api/metric.proto;l=100 * @param value The launchStage to set. * @return This builder for chaining. */ @@ -1316,38 +1849,42 @@ public Builder setLaunchStage(com.google.api.LaunchStage value) { if (value == null) { throw new NullPointerException(); } - + bitField0_ |= 0x00000001; launchStage_ = value.getNumber(); onChanged(); return this; } + /** * * *
        -       * Deprecated. Must use the [MetricDescriptor.launch_stage][google.api.MetricDescriptor.launch_stage] instead.
        +       * Deprecated. Must use the
        +       * [MetricDescriptor.launch_stage][google.api.MetricDescriptor.launch_stage]
        +       * instead.
                * 
        * * .google.api.LaunchStage launch_stage = 1 [deprecated = true]; * * @deprecated google.api.MetricDescriptor.MetricDescriptorMetadata.launch_stage is - * deprecated. See google/api/metric.proto;l=83 + * deprecated. See google/api/metric.proto;l=100 * @return This builder for chaining. */ @java.lang.Deprecated public Builder clearLaunchStage() { - + bitField0_ = (bitField0_ & ~0x00000001); launchStage_ = 0; onChanged(); return this; } private com.google.protobuf.Duration samplePeriod_; - private com.google.protobuf.SingleFieldBuilderV3< + private com.google.protobuf.SingleFieldBuilder< com.google.protobuf.Duration, com.google.protobuf.Duration.Builder, com.google.protobuf.DurationOrBuilder> samplePeriodBuilder_; + /** * * @@ -1363,8 +1900,9 @@ public Builder clearLaunchStage() { * @return Whether the samplePeriod field is set. */ public boolean hasSamplePeriod() { - return samplePeriodBuilder_ != null || samplePeriod_ != null; + return ((bitField0_ & 0x00000002) != 0); } + /** * * @@ -1388,6 +1926,7 @@ public com.google.protobuf.Duration getSamplePeriod() { return samplePeriodBuilder_.getMessage(); } } + /** * * @@ -1406,13 +1945,14 @@ public Builder setSamplePeriod(com.google.protobuf.Duration value) { throw new NullPointerException(); } samplePeriod_ = value; - onChanged(); } else { samplePeriodBuilder_.setMessage(value); } - + bitField0_ |= 0x00000002; + onChanged(); return this; } + /** * * @@ -1428,13 +1968,14 @@ public Builder setSamplePeriod(com.google.protobuf.Duration value) { public Builder setSamplePeriod(com.google.protobuf.Duration.Builder builderForValue) { if (samplePeriodBuilder_ == null) { samplePeriod_ = builderForValue.build(); - onChanged(); } else { samplePeriodBuilder_.setMessage(builderForValue.build()); } - + bitField0_ |= 0x00000002; + onChanged(); return this; } + /** * * @@ -1449,21 +1990,23 @@ public Builder setSamplePeriod(com.google.protobuf.Duration.Builder builderForVa */ public Builder mergeSamplePeriod(com.google.protobuf.Duration value) { if (samplePeriodBuilder_ == null) { - if (samplePeriod_ != null) { - samplePeriod_ = - com.google.protobuf.Duration.newBuilder(samplePeriod_) - .mergeFrom(value) - .buildPartial(); + if (((bitField0_ & 0x00000002) != 0) + && samplePeriod_ != null + && samplePeriod_ != com.google.protobuf.Duration.getDefaultInstance()) { + getSamplePeriodBuilder().mergeFrom(value); } else { samplePeriod_ = value; } - onChanged(); } else { samplePeriodBuilder_.mergeFrom(value); } - + if (samplePeriod_ != null) { + bitField0_ |= 0x00000002; + onChanged(); + } return this; } + /** * * @@ -1477,16 +2020,16 @@ public Builder mergeSamplePeriod(com.google.protobuf.Duration value) { * .google.protobuf.Duration sample_period = 2; */ public Builder clearSamplePeriod() { - if (samplePeriodBuilder_ == null) { - samplePeriod_ = null; - onChanged(); - } else { - samplePeriod_ = null; + bitField0_ = (bitField0_ & ~0x00000002); + samplePeriod_ = null; + if (samplePeriodBuilder_ != null) { + samplePeriodBuilder_.dispose(); samplePeriodBuilder_ = null; } - + onChanged(); return this; } + /** * * @@ -1500,10 +2043,11 @@ public Builder clearSamplePeriod() { * .google.protobuf.Duration sample_period = 2; */ public com.google.protobuf.Duration.Builder getSamplePeriodBuilder() { - + bitField0_ |= 0x00000002; onChanged(); - return getSamplePeriodFieldBuilder().getBuilder(); + return internalGetSamplePeriodFieldBuilder().getBuilder(); } + /** * * @@ -1525,6 +2069,7 @@ public com.google.protobuf.DurationOrBuilder getSamplePeriodOrBuilder() { : samplePeriod_; } } + /** * * @@ -1537,14 +2082,14 @@ public com.google.protobuf.DurationOrBuilder getSamplePeriodOrBuilder() { * * .google.protobuf.Duration sample_period = 2; */ - private com.google.protobuf.SingleFieldBuilderV3< + private com.google.protobuf.SingleFieldBuilder< com.google.protobuf.Duration, com.google.protobuf.Duration.Builder, com.google.protobuf.DurationOrBuilder> - getSamplePeriodFieldBuilder() { + internalGetSamplePeriodFieldBuilder() { if (samplePeriodBuilder_ == null) { samplePeriodBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< + new com.google.protobuf.SingleFieldBuilder< com.google.protobuf.Duration, com.google.protobuf.Duration.Builder, com.google.protobuf.DurationOrBuilder>( @@ -1555,11 +2100,12 @@ public com.google.protobuf.DurationOrBuilder getSamplePeriodOrBuilder() { } private com.google.protobuf.Duration ingestDelay_; - private com.google.protobuf.SingleFieldBuilderV3< + private com.google.protobuf.SingleFieldBuilder< com.google.protobuf.Duration, com.google.protobuf.Duration.Builder, com.google.protobuf.DurationOrBuilder> ingestDelayBuilder_; + /** * * @@ -1574,8 +2120,9 @@ public com.google.protobuf.DurationOrBuilder getSamplePeriodOrBuilder() { * @return Whether the ingestDelay field is set. */ public boolean hasIngestDelay() { - return ingestDelayBuilder_ != null || ingestDelay_ != null; + return ((bitField0_ & 0x00000004) != 0); } + /** * * @@ -1598,175 +2145,453 @@ public com.google.protobuf.Duration getIngestDelay() { return ingestDelayBuilder_.getMessage(); } } + + /** + * + * + *
        +       * The delay of data points caused by ingestion. Data points older than this
        +       * age are guaranteed to be ingested and available to be read, excluding
        +       * data loss due to errors.
        +       * 
        + * + * .google.protobuf.Duration ingest_delay = 3; + */ + public Builder setIngestDelay(com.google.protobuf.Duration value) { + if (ingestDelayBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ingestDelay_ = value; + } else { + ingestDelayBuilder_.setMessage(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
        +       * The delay of data points caused by ingestion. Data points older than this
        +       * age are guaranteed to be ingested and available to be read, excluding
        +       * data loss due to errors.
        +       * 
        + * + * .google.protobuf.Duration ingest_delay = 3; + */ + public Builder setIngestDelay(com.google.protobuf.Duration.Builder builderForValue) { + if (ingestDelayBuilder_ == null) { + ingestDelay_ = builderForValue.build(); + } else { + ingestDelayBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
        +       * The delay of data points caused by ingestion. Data points older than this
        +       * age are guaranteed to be ingested and available to be read, excluding
        +       * data loss due to errors.
        +       * 
        + * + * .google.protobuf.Duration ingest_delay = 3; + */ + public Builder mergeIngestDelay(com.google.protobuf.Duration value) { + if (ingestDelayBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0) + && ingestDelay_ != null + && ingestDelay_ != com.google.protobuf.Duration.getDefaultInstance()) { + getIngestDelayBuilder().mergeFrom(value); + } else { + ingestDelay_ = value; + } + } else { + ingestDelayBuilder_.mergeFrom(value); + } + if (ingestDelay_ != null) { + bitField0_ |= 0x00000004; + onChanged(); + } + return this; + } + + /** + * + * + *
        +       * The delay of data points caused by ingestion. Data points older than this
        +       * age are guaranteed to be ingested and available to be read, excluding
        +       * data loss due to errors.
        +       * 
        + * + * .google.protobuf.Duration ingest_delay = 3; + */ + public Builder clearIngestDelay() { + bitField0_ = (bitField0_ & ~0x00000004); + ingestDelay_ = null; + if (ingestDelayBuilder_ != null) { + ingestDelayBuilder_.dispose(); + ingestDelayBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
        +       * The delay of data points caused by ingestion. Data points older than this
        +       * age are guaranteed to be ingested and available to be read, excluding
        +       * data loss due to errors.
        +       * 
        + * + * .google.protobuf.Duration ingest_delay = 3; + */ + public com.google.protobuf.Duration.Builder getIngestDelayBuilder() { + bitField0_ |= 0x00000004; + onChanged(); + return internalGetIngestDelayFieldBuilder().getBuilder(); + } + + /** + * + * + *
        +       * The delay of data points caused by ingestion. Data points older than this
        +       * age are guaranteed to be ingested and available to be read, excluding
        +       * data loss due to errors.
        +       * 
        + * + * .google.protobuf.Duration ingest_delay = 3; + */ + public com.google.protobuf.DurationOrBuilder getIngestDelayOrBuilder() { + if (ingestDelayBuilder_ != null) { + return ingestDelayBuilder_.getMessageOrBuilder(); + } else { + return ingestDelay_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : ingestDelay_; + } + } + + /** + * + * + *
        +       * The delay of data points caused by ingestion. Data points older than this
        +       * age are guaranteed to be ingested and available to be read, excluding
        +       * data loss due to errors.
        +       * 
        + * + * .google.protobuf.Duration ingest_delay = 3; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder> + internalGetIngestDelayFieldBuilder() { + if (ingestDelayBuilder_ == null) { + ingestDelayBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder>( + getIngestDelay(), getParentForChildren(), isClean()); + ingestDelay_ = null; + } + return ingestDelayBuilder_; + } + + private com.google.protobuf.Internal.IntList timeSeriesResourceHierarchyLevel_ = + emptyIntList(); + + private void ensureTimeSeriesResourceHierarchyLevelIsMutable() { + if (!timeSeriesResourceHierarchyLevel_.isModifiable()) { + timeSeriesResourceHierarchyLevel_ = makeMutableCopy(timeSeriesResourceHierarchyLevel_); + } + bitField0_ |= 0x00000008; + } + + /** + * + * + *
        +       * The scope of the timeseries data of the metric.
        +       * 
        + * + * + * repeated .google.api.MetricDescriptor.MetricDescriptorMetadata.TimeSeriesResourceHierarchyLevel time_series_resource_hierarchy_level = 4; + * + * + * @return A list containing the timeSeriesResourceHierarchyLevel. + */ + public java.util.List< + com.google.api.MetricDescriptor.MetricDescriptorMetadata + .TimeSeriesResourceHierarchyLevel> + getTimeSeriesResourceHierarchyLevelList() { + return new com.google.protobuf.Internal.IntListAdapter< + com.google.api.MetricDescriptor.MetricDescriptorMetadata + .TimeSeriesResourceHierarchyLevel>( + timeSeriesResourceHierarchyLevel_, timeSeriesResourceHierarchyLevel_converter_); + } + + /** + * + * + *
        +       * The scope of the timeseries data of the metric.
        +       * 
        + * + * + * repeated .google.api.MetricDescriptor.MetricDescriptorMetadata.TimeSeriesResourceHierarchyLevel time_series_resource_hierarchy_level = 4; + * + * + * @return The count of timeSeriesResourceHierarchyLevel. + */ + public int getTimeSeriesResourceHierarchyLevelCount() { + return timeSeriesResourceHierarchyLevel_.size(); + } + + /** + * + * + *
        +       * The scope of the timeseries data of the metric.
        +       * 
        + * + * + * repeated .google.api.MetricDescriptor.MetricDescriptorMetadata.TimeSeriesResourceHierarchyLevel time_series_resource_hierarchy_level = 4; + * + * + * @param index The index of the element to return. + * @return The timeSeriesResourceHierarchyLevel at the given index. + */ + public com.google.api.MetricDescriptor.MetricDescriptorMetadata + .TimeSeriesResourceHierarchyLevel + getTimeSeriesResourceHierarchyLevel(int index) { + return timeSeriesResourceHierarchyLevel_converter_.convert( + timeSeriesResourceHierarchyLevel_.getInt(index)); + } + + /** + * + * + *
        +       * The scope of the timeseries data of the metric.
        +       * 
        + * + * + * repeated .google.api.MetricDescriptor.MetricDescriptorMetadata.TimeSeriesResourceHierarchyLevel time_series_resource_hierarchy_level = 4; + * + * + * @param index The index to set the value at. + * @param value The timeSeriesResourceHierarchyLevel to set. + * @return This builder for chaining. + */ + public Builder setTimeSeriesResourceHierarchyLevel( + int index, + com.google.api.MetricDescriptor.MetricDescriptorMetadata.TimeSeriesResourceHierarchyLevel + value) { + if (value == null) { + throw new NullPointerException(); + } + ensureTimeSeriesResourceHierarchyLevelIsMutable(); + timeSeriesResourceHierarchyLevel_.setInt(index, value.getNumber()); + onChanged(); + return this; + } + + /** + * + * + *
        +       * The scope of the timeseries data of the metric.
        +       * 
        + * + * + * repeated .google.api.MetricDescriptor.MetricDescriptorMetadata.TimeSeriesResourceHierarchyLevel time_series_resource_hierarchy_level = 4; + * + * + * @param value The timeSeriesResourceHierarchyLevel to add. + * @return This builder for chaining. + */ + public Builder addTimeSeriesResourceHierarchyLevel( + com.google.api.MetricDescriptor.MetricDescriptorMetadata.TimeSeriesResourceHierarchyLevel + value) { + if (value == null) { + throw new NullPointerException(); + } + ensureTimeSeriesResourceHierarchyLevelIsMutable(); + timeSeriesResourceHierarchyLevel_.addInt(value.getNumber()); + onChanged(); + return this; + } + /** * * *
        -       * The delay of data points caused by ingestion. Data points older than this
        -       * age are guaranteed to be ingested and available to be read, excluding
        -       * data loss due to errors.
        +       * The scope of the timeseries data of the metric.
                * 
        * - * .google.protobuf.Duration ingest_delay = 3; + * + * repeated .google.api.MetricDescriptor.MetricDescriptorMetadata.TimeSeriesResourceHierarchyLevel time_series_resource_hierarchy_level = 4; + * + * + * @param values The timeSeriesResourceHierarchyLevel to add. + * @return This builder for chaining. */ - public Builder setIngestDelay(com.google.protobuf.Duration value) { - if (ingestDelayBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ingestDelay_ = value; - onChanged(); - } else { - ingestDelayBuilder_.setMessage(value); + public Builder addAllTimeSeriesResourceHierarchyLevel( + java.lang.Iterable< + ? extends + com.google.api.MetricDescriptor.MetricDescriptorMetadata + .TimeSeriesResourceHierarchyLevel> + values) { + ensureTimeSeriesResourceHierarchyLevelIsMutable(); + for (com.google.api.MetricDescriptor.MetricDescriptorMetadata + .TimeSeriesResourceHierarchyLevel + value : values) { + timeSeriesResourceHierarchyLevel_.addInt(value.getNumber()); } - + onChanged(); return this; } + /** * * *
        -       * The delay of data points caused by ingestion. Data points older than this
        -       * age are guaranteed to be ingested and available to be read, excluding
        -       * data loss due to errors.
        +       * The scope of the timeseries data of the metric.
                * 
        * - * .google.protobuf.Duration ingest_delay = 3; + * + * repeated .google.api.MetricDescriptor.MetricDescriptorMetadata.TimeSeriesResourceHierarchyLevel time_series_resource_hierarchy_level = 4; + * + * + * @return This builder for chaining. */ - public Builder setIngestDelay(com.google.protobuf.Duration.Builder builderForValue) { - if (ingestDelayBuilder_ == null) { - ingestDelay_ = builderForValue.build(); - onChanged(); - } else { - ingestDelayBuilder_.setMessage(builderForValue.build()); - } - + public Builder clearTimeSeriesResourceHierarchyLevel() { + timeSeriesResourceHierarchyLevel_ = emptyIntList(); + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); return this; } + /** * * *
        -       * The delay of data points caused by ingestion. Data points older than this
        -       * age are guaranteed to be ingested and available to be read, excluding
        -       * data loss due to errors.
        +       * The scope of the timeseries data of the metric.
                * 
        * - * .google.protobuf.Duration ingest_delay = 3; + * + * repeated .google.api.MetricDescriptor.MetricDescriptorMetadata.TimeSeriesResourceHierarchyLevel time_series_resource_hierarchy_level = 4; + * + * + * @return A list containing the enum numeric values on the wire for + * timeSeriesResourceHierarchyLevel. */ - public Builder mergeIngestDelay(com.google.protobuf.Duration value) { - if (ingestDelayBuilder_ == null) { - if (ingestDelay_ != null) { - ingestDelay_ = - com.google.protobuf.Duration.newBuilder(ingestDelay_) - .mergeFrom(value) - .buildPartial(); - } else { - ingestDelay_ = value; - } - onChanged(); - } else { - ingestDelayBuilder_.mergeFrom(value); - } - - return this; + public java.util.List getTimeSeriesResourceHierarchyLevelValueList() { + timeSeriesResourceHierarchyLevel_.makeImmutable(); + return timeSeriesResourceHierarchyLevel_; } + /** * * *
        -       * The delay of data points caused by ingestion. Data points older than this
        -       * age are guaranteed to be ingested and available to be read, excluding
        -       * data loss due to errors.
        +       * The scope of the timeseries data of the metric.
                * 
        * - * .google.protobuf.Duration ingest_delay = 3; + * + * repeated .google.api.MetricDescriptor.MetricDescriptorMetadata.TimeSeriesResourceHierarchyLevel time_series_resource_hierarchy_level = 4; + * + * + * @param index The index of the value to return. + * @return The enum numeric value on the wire of timeSeriesResourceHierarchyLevel at the given + * index. */ - public Builder clearIngestDelay() { - if (ingestDelayBuilder_ == null) { - ingestDelay_ = null; - onChanged(); - } else { - ingestDelay_ = null; - ingestDelayBuilder_ = null; - } - - return this; + public int getTimeSeriesResourceHierarchyLevelValue(int index) { + return timeSeriesResourceHierarchyLevel_.getInt(index); } + /** * * *
        -       * The delay of data points caused by ingestion. Data points older than this
        -       * age are guaranteed to be ingested and available to be read, excluding
        -       * data loss due to errors.
        +       * The scope of the timeseries data of the metric.
                * 
        * - * .google.protobuf.Duration ingest_delay = 3; + * + * repeated .google.api.MetricDescriptor.MetricDescriptorMetadata.TimeSeriesResourceHierarchyLevel time_series_resource_hierarchy_level = 4; + * + * + * @param index The index to set the value at. + * @param value The enum numeric value on the wire for timeSeriesResourceHierarchyLevel to + * set. + * @return This builder for chaining. */ - public com.google.protobuf.Duration.Builder getIngestDelayBuilder() { - + public Builder setTimeSeriesResourceHierarchyLevelValue(int index, int value) { + ensureTimeSeriesResourceHierarchyLevelIsMutable(); + timeSeriesResourceHierarchyLevel_.setInt(index, value); onChanged(); - return getIngestDelayFieldBuilder().getBuilder(); + return this; } + /** * * *
        -       * The delay of data points caused by ingestion. Data points older than this
        -       * age are guaranteed to be ingested and available to be read, excluding
        -       * data loss due to errors.
        +       * The scope of the timeseries data of the metric.
                * 
        * - * .google.protobuf.Duration ingest_delay = 3; + * + * repeated .google.api.MetricDescriptor.MetricDescriptorMetadata.TimeSeriesResourceHierarchyLevel time_series_resource_hierarchy_level = 4; + * + * + * @param value The enum numeric value on the wire for timeSeriesResourceHierarchyLevel to + * add. + * @return This builder for chaining. */ - public com.google.protobuf.DurationOrBuilder getIngestDelayOrBuilder() { - if (ingestDelayBuilder_ != null) { - return ingestDelayBuilder_.getMessageOrBuilder(); - } else { - return ingestDelay_ == null - ? com.google.protobuf.Duration.getDefaultInstance() - : ingestDelay_; - } + public Builder addTimeSeriesResourceHierarchyLevelValue(int value) { + ensureTimeSeriesResourceHierarchyLevelIsMutable(); + timeSeriesResourceHierarchyLevel_.addInt(value); + onChanged(); + return this; } + /** * * *
        -       * The delay of data points caused by ingestion. Data points older than this
        -       * age are guaranteed to be ingested and available to be read, excluding
        -       * data loss due to errors.
        +       * The scope of the timeseries data of the metric.
                * 
        * - * .google.protobuf.Duration ingest_delay = 3; + * + * repeated .google.api.MetricDescriptor.MetricDescriptorMetadata.TimeSeriesResourceHierarchyLevel time_series_resource_hierarchy_level = 4; + * + * + * @param values The enum numeric values on the wire for timeSeriesResourceHierarchyLevel to + * add. + * @return This builder for chaining. */ - private com.google.protobuf.SingleFieldBuilderV3< - com.google.protobuf.Duration, - com.google.protobuf.Duration.Builder, - com.google.protobuf.DurationOrBuilder> - getIngestDelayFieldBuilder() { - if (ingestDelayBuilder_ == null) { - ingestDelayBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< - com.google.protobuf.Duration, - com.google.protobuf.Duration.Builder, - com.google.protobuf.DurationOrBuilder>( - getIngestDelay(), getParentForChildren(), isClean()); - ingestDelay_ = null; + public Builder addAllTimeSeriesResourceHierarchyLevelValue( + java.lang.Iterable values) { + ensureTimeSeriesResourceHierarchyLevelIsMutable(); + for (int value : values) { + timeSeriesResourceHierarchyLevel_.addInt(value); } - return ingestDelayBuilder_; - } - - @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); + onChanged(); + return this; } // @@protoc_insertion_point(builder_scope:google.api.MetricDescriptor.MetricDescriptorMetadata) @@ -1821,8 +2646,12 @@ public com.google.api.MetricDescriptor.MetricDescriptorMetadata getDefaultInstan } } + private int bitField0_; public static final int NAME_FIELD_NUMBER = 1; - private volatile java.lang.Object name_; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** * * @@ -1846,6 +2675,7 @@ public java.lang.String getName() { return s; } } + /** * * @@ -1871,7 +2701,10 @@ public com.google.protobuf.ByteString getNameBytes() { } public static final int TYPE_FIELD_NUMBER = 8; - private volatile java.lang.Object type_; + + @SuppressWarnings("serial") + private volatile java.lang.Object type_ = ""; + /** * * @@ -1880,9 +2713,10 @@ public com.google.protobuf.ByteString getNameBytes() { * URL-encoded. All user-defined metric types have the DNS name * `custom.googleapis.com` or `external.googleapis.com`. Metric types should * use a natural hierarchical grouping. For example: - * "custom.googleapis.com/invoice/paid/amount" - * "external.googleapis.com/prometheus/up" - * "appengine.googleapis.com/http/server/response_latencies" + * + * "custom.googleapis.com/invoice/paid/amount" + * "external.googleapis.com/prometheus/up" + * "appengine.googleapis.com/http/server/response_latencies" * * * string type = 8; @@ -1901,6 +2735,7 @@ public java.lang.String getType() { return s; } } + /** * * @@ -1909,9 +2744,10 @@ public java.lang.String getType() { * URL-encoded. All user-defined metric types have the DNS name * `custom.googleapis.com` or `external.googleapis.com`. Metric types should * use a natural hierarchical grouping. For example: - * "custom.googleapis.com/invoice/paid/amount" - * "external.googleapis.com/prometheus/up" - * "appengine.googleapis.com/http/server/response_latencies" + * + * "custom.googleapis.com/invoice/paid/amount" + * "external.googleapis.com/prometheus/up" + * "appengine.googleapis.com/http/server/response_latencies" * * * string type = 8; @@ -1932,7 +2768,10 @@ public com.google.protobuf.ByteString getTypeBytes() { } public static final int LABELS_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") private java.util.List labels_; + /** * * @@ -1951,6 +2790,7 @@ public com.google.protobuf.ByteString getTypeBytes() { public java.util.List getLabelsList() { return labels_; } + /** * * @@ -1970,6 +2810,7 @@ public java.util.List getLabelsList() { getLabelsOrBuilderList() { return labels_; } + /** * * @@ -1988,6 +2829,7 @@ public java.util.List getLabelsList() { public int getLabelsCount() { return labels_.size(); } + /** * * @@ -2006,6 +2848,7 @@ public int getLabelsCount() { public com.google.api.LabelDescriptor getLabels(int index) { return labels_.get(index); } + /** * * @@ -2026,7 +2869,8 @@ public com.google.api.LabelDescriptorOrBuilder getLabelsOrBuilder(int index) { } public static final int METRIC_KIND_FIELD_NUMBER = 3; - private int metricKind_; + private int metricKind_ = 0; + /** * * @@ -2043,6 +2887,7 @@ public com.google.api.LabelDescriptorOrBuilder getLabelsOrBuilder(int index) { public int getMetricKindValue() { return metricKind_; } + /** * * @@ -2057,14 +2902,14 @@ public int getMetricKindValue() { */ @java.lang.Override public com.google.api.MetricDescriptor.MetricKind getMetricKind() { - @SuppressWarnings("deprecation") com.google.api.MetricDescriptor.MetricKind result = - com.google.api.MetricDescriptor.MetricKind.valueOf(metricKind_); + com.google.api.MetricDescriptor.MetricKind.forNumber(metricKind_); return result == null ? com.google.api.MetricDescriptor.MetricKind.UNRECOGNIZED : result; } public static final int VALUE_TYPE_FIELD_NUMBER = 4; - private int valueType_; + private int valueType_ = 0; + /** * * @@ -2081,6 +2926,7 @@ public com.google.api.MetricDescriptor.MetricKind getMetricKind() { public int getValueTypeValue() { return valueType_; } + /** * * @@ -2095,14 +2941,16 @@ public int getValueTypeValue() { */ @java.lang.Override public com.google.api.MetricDescriptor.ValueType getValueType() { - @SuppressWarnings("deprecation") com.google.api.MetricDescriptor.ValueType result = - com.google.api.MetricDescriptor.ValueType.valueOf(valueType_); + com.google.api.MetricDescriptor.ValueType.forNumber(valueType_); return result == null ? com.google.api.MetricDescriptor.ValueType.UNRECOGNIZED : result; } public static final int UNIT_FIELD_NUMBER = 5; - private volatile java.lang.Object unit_; + + @SuppressWarnings("serial") + private volatile java.lang.Object unit_ = ""; + /** * * @@ -2110,22 +2958,28 @@ public com.google.api.MetricDescriptor.ValueType getValueType() { * The units in which the metric value is reported. It is only applicable * if the `value_type` is `INT64`, `DOUBLE`, or `DISTRIBUTION`. The `unit` * defines the representation of the stored metric values. + * * Different systems might scale the values to be more easily displayed (so a * value of `0.02kBy` _might_ be displayed as `20By`, and a value of * `3523kBy` _might_ be displayed as `3.5MBy`). However, if the `unit` is * `kBy`, then the value of the metric is always in thousands of bytes, no * matter how it might be displayed. + * * If you want a custom metric to record the exact number of CPU-seconds used * by a job, you can create an `INT64 CUMULATIVE` metric whose `unit` is * `s{CPU}` (or equivalently `1s{CPU}` or just `s`). If the job uses 12,005 * CPU-seconds, then the value is written as `12005`. + * * Alternatively, if you want a custom metric to record data in a more * granular way, you can create a `DOUBLE CUMULATIVE` metric whose `unit` is * `ks{CPU}`, and then write the value `12.005` (which is `12005/1000`), * or use `Kis{CPU}` and write `11.723` (which is `12005/1024`). + * * The supported units are a subset of [The Unified Code for Units of * Measure](https://unitsofmeasure.org/ucum.html) standard: + * * **Basic units (UNIT)** + * * * `bit` bit * * `By` byte * * `s` second @@ -2133,7 +2987,9 @@ public com.google.api.MetricDescriptor.ValueType getValueType() { * * `h` hour * * `d` day * * `1` dimensionless + * * **Prefixes (PREFIX)** + * * * `k` kilo (10^3) * * `M` mega (10^6) * * `G` giga (10^9) @@ -2142,6 +2998,7 @@ public com.google.api.MetricDescriptor.ValueType getValueType() { * * `E` exa (10^18) * * `Z` zetta (10^21) * * `Y` yotta (10^24) + * * * `m` milli (10^-3) * * `u` micro (10^-6) * * `n` nano (10^-9) @@ -2150,46 +3007,56 @@ public com.google.api.MetricDescriptor.ValueType getValueType() { * * `a` atto (10^-18) * * `z` zepto (10^-21) * * `y` yocto (10^-24) + * * * `Ki` kibi (2^10) * * `Mi` mebi (2^20) * * `Gi` gibi (2^30) * * `Ti` tebi (2^40) * * `Pi` pebi (2^50) + * * **Grammar** + * * The grammar also includes these connectors: + * * * `/` division or ratio (as an infix operator). For examples, - * `kBy/{email}` or `MiBy/10ms` (although you should almost never - * have `/s` in a metric `unit`; rates should always be computed at - * query time from the underlying cumulative or delta value). + * `kBy/{email}` or `MiBy/10ms` (although you should almost never + * have `/s` in a metric `unit`; rates should always be computed at + * query time from the underlying cumulative or delta value). * * `.` multiplication or composition (as an infix operator). For - * examples, `GBy.d` or `k{watt}.h`. + * examples, `GBy.d` or `k{watt}.h`. + * * The grammar for a unit is as follows: - * Expression = Component { "." Component } { "/" Component } ; - * Component = ( [ PREFIX ] UNIT | "%" ) [ Annotation ] - * | Annotation - * | "1" - * ; - * Annotation = "{" NAME "}" ; + * + * Expression = Component { "." Component } { "/" Component } ; + * + * Component = ( [ PREFIX ] UNIT | "%" ) [ Annotation ] + * | Annotation + * | "1" + * ; + * + * Annotation = "{" NAME "}" ; + * * Notes: + * * * `Annotation` is just a comment if it follows a `UNIT`. If the annotation - * is used alone, then the unit is equivalent to `1`. For examples, - * `{request}/s == 1/s`, `By{transmitted}/s == By/s`. + * is used alone, then the unit is equivalent to `1`. For examples, + * `{request}/s == 1/s`, `By{transmitted}/s == By/s`. * * `NAME` is a sequence of non-blank printable ASCII characters not - * containing `{` or `}`. + * containing `{` or `}`. * * `1` represents a unitary [dimensionless - * unit](https://en.wikipedia.org/wiki/Dimensionless_quantity) of 1, such - * as in `1/s`. It is typically used when none of the basic units are - * appropriate. For example, "new users per day" can be represented as - * `1/d` or `{new-users}/d` (and a metric value `5` would mean "5 new - * users). Alternatively, "thousands of page views per day" would be - * represented as `1000/d` or `k1/d` or `k{page_views}/d` (and a metric - * value of `5.3` would mean "5300 page views per day"). + * unit](https://en.wikipedia.org/wiki/Dimensionless_quantity) of 1, such + * as in `1/s`. It is typically used when none of the basic units are + * appropriate. For example, "new users per day" can be represented as + * `1/d` or `{new-users}/d` (and a metric value `5` would mean "5 new + * users). Alternatively, "thousands of page views per day" would be + * represented as `1000/d` or `k1/d` or `k{page_views}/d` (and a metric + * value of `5.3` would mean "5300 page views per day"). * * `%` represents dimensionless value of 1/100, and annotates values giving - * a percentage (so the metric values are typically in the range of 0..100, - * and a metric value `3` means "3 percent"). + * a percentage (so the metric values are typically in the range of 0..100, + * and a metric value `3` means "3 percent"). * * `10^2.%` indicates a metric contains a ratio, typically in the range - * 0..1, that will be multiplied by 100 and displayed as a percentage - * (so a metric value `0.03` means "3 percent"). + * 0..1, that will be multiplied by 100 and displayed as a percentage + * (so a metric value `0.03` means "3 percent"). * * * string unit = 5; @@ -2208,6 +3075,7 @@ public java.lang.String getUnit() { return s; } } + /** * * @@ -2215,22 +3083,28 @@ public java.lang.String getUnit() { * The units in which the metric value is reported. It is only applicable * if the `value_type` is `INT64`, `DOUBLE`, or `DISTRIBUTION`. The `unit` * defines the representation of the stored metric values. + * * Different systems might scale the values to be more easily displayed (so a * value of `0.02kBy` _might_ be displayed as `20By`, and a value of * `3523kBy` _might_ be displayed as `3.5MBy`). However, if the `unit` is * `kBy`, then the value of the metric is always in thousands of bytes, no * matter how it might be displayed. + * * If you want a custom metric to record the exact number of CPU-seconds used * by a job, you can create an `INT64 CUMULATIVE` metric whose `unit` is * `s{CPU}` (or equivalently `1s{CPU}` or just `s`). If the job uses 12,005 * CPU-seconds, then the value is written as `12005`. + * * Alternatively, if you want a custom metric to record data in a more * granular way, you can create a `DOUBLE CUMULATIVE` metric whose `unit` is * `ks{CPU}`, and then write the value `12.005` (which is `12005/1000`), * or use `Kis{CPU}` and write `11.723` (which is `12005/1024`). + * * The supported units are a subset of [The Unified Code for Units of * Measure](https://unitsofmeasure.org/ucum.html) standard: + * * **Basic units (UNIT)** + * * * `bit` bit * * `By` byte * * `s` second @@ -2238,7 +3112,9 @@ public java.lang.String getUnit() { * * `h` hour * * `d` day * * `1` dimensionless + * * **Prefixes (PREFIX)** + * * * `k` kilo (10^3) * * `M` mega (10^6) * * `G` giga (10^9) @@ -2247,6 +3123,7 @@ public java.lang.String getUnit() { * * `E` exa (10^18) * * `Z` zetta (10^21) * * `Y` yotta (10^24) + * * * `m` milli (10^-3) * * `u` micro (10^-6) * * `n` nano (10^-9) @@ -2255,46 +3132,56 @@ public java.lang.String getUnit() { * * `a` atto (10^-18) * * `z` zepto (10^-21) * * `y` yocto (10^-24) + * * * `Ki` kibi (2^10) * * `Mi` mebi (2^20) * * `Gi` gibi (2^30) * * `Ti` tebi (2^40) * * `Pi` pebi (2^50) + * * **Grammar** + * * The grammar also includes these connectors: + * * * `/` division or ratio (as an infix operator). For examples, - * `kBy/{email}` or `MiBy/10ms` (although you should almost never - * have `/s` in a metric `unit`; rates should always be computed at - * query time from the underlying cumulative or delta value). + * `kBy/{email}` or `MiBy/10ms` (although you should almost never + * have `/s` in a metric `unit`; rates should always be computed at + * query time from the underlying cumulative or delta value). * * `.` multiplication or composition (as an infix operator). For - * examples, `GBy.d` or `k{watt}.h`. + * examples, `GBy.d` or `k{watt}.h`. + * * The grammar for a unit is as follows: - * Expression = Component { "." Component } { "/" Component } ; - * Component = ( [ PREFIX ] UNIT | "%" ) [ Annotation ] - * | Annotation - * | "1" - * ; - * Annotation = "{" NAME "}" ; + * + * Expression = Component { "." Component } { "/" Component } ; + * + * Component = ( [ PREFIX ] UNIT | "%" ) [ Annotation ] + * | Annotation + * | "1" + * ; + * + * Annotation = "{" NAME "}" ; + * * Notes: + * * * `Annotation` is just a comment if it follows a `UNIT`. If the annotation - * is used alone, then the unit is equivalent to `1`. For examples, - * `{request}/s == 1/s`, `By{transmitted}/s == By/s`. + * is used alone, then the unit is equivalent to `1`. For examples, + * `{request}/s == 1/s`, `By{transmitted}/s == By/s`. * * `NAME` is a sequence of non-blank printable ASCII characters not - * containing `{` or `}`. + * containing `{` or `}`. * * `1` represents a unitary [dimensionless - * unit](https://en.wikipedia.org/wiki/Dimensionless_quantity) of 1, such - * as in `1/s`. It is typically used when none of the basic units are - * appropriate. For example, "new users per day" can be represented as - * `1/d` or `{new-users}/d` (and a metric value `5` would mean "5 new - * users). Alternatively, "thousands of page views per day" would be - * represented as `1000/d` or `k1/d` or `k{page_views}/d` (and a metric - * value of `5.3` would mean "5300 page views per day"). + * unit](https://en.wikipedia.org/wiki/Dimensionless_quantity) of 1, such + * as in `1/s`. It is typically used when none of the basic units are + * appropriate. For example, "new users per day" can be represented as + * `1/d` or `{new-users}/d` (and a metric value `5` would mean "5 new + * users). Alternatively, "thousands of page views per day" would be + * represented as `1000/d` or `k1/d` or `k{page_views}/d` (and a metric + * value of `5.3` would mean "5300 page views per day"). * * `%` represents dimensionless value of 1/100, and annotates values giving - * a percentage (so the metric values are typically in the range of 0..100, - * and a metric value `3` means "3 percent"). + * a percentage (so the metric values are typically in the range of 0..100, + * and a metric value `3` means "3 percent"). * * `10^2.%` indicates a metric contains a ratio, typically in the range - * 0..1, that will be multiplied by 100 and displayed as a percentage - * (so a metric value `0.03` means "3 percent"). + * 0..1, that will be multiplied by 100 and displayed as a percentage + * (so a metric value `0.03` means "3 percent"). * * * string unit = 5; @@ -2315,7 +3202,10 @@ public com.google.protobuf.ByteString getUnitBytes() { } public static final int DESCRIPTION_FIELD_NUMBER = 6; - private volatile java.lang.Object description_; + + @SuppressWarnings("serial") + private volatile java.lang.Object description_ = ""; + /** * * @@ -2339,6 +3229,7 @@ public java.lang.String getDescription() { return s; } } + /** * * @@ -2364,7 +3255,10 @@ public com.google.protobuf.ByteString getDescriptionBytes() { } public static final int DISPLAY_NAME_FIELD_NUMBER = 7; - private volatile java.lang.Object displayName_; + + @SuppressWarnings("serial") + private volatile java.lang.Object displayName_ = ""; + /** * * @@ -2391,6 +3285,7 @@ public java.lang.String getDisplayName() { return s; } } + /** * * @@ -2420,6 +3315,7 @@ public com.google.protobuf.ByteString getDisplayNameBytes() { public static final int METADATA_FIELD_NUMBER = 10; private com.google.api.MetricDescriptor.MetricDescriptorMetadata metadata_; + /** * * @@ -2433,8 +3329,9 @@ public com.google.protobuf.ByteString getDisplayNameBytes() { */ @java.lang.Override public boolean hasMetadata() { - return metadata_ != null; + return ((bitField0_ & 0x00000001) != 0); } + /** * * @@ -2452,6 +3349,7 @@ public com.google.api.MetricDescriptor.MetricDescriptorMetadata getMetadata() { ? com.google.api.MetricDescriptor.MetricDescriptorMetadata.getDefaultInstance() : metadata_; } + /** * * @@ -2463,11 +3361,14 @@ public com.google.api.MetricDescriptor.MetricDescriptorMetadata getMetadata() { */ @java.lang.Override public com.google.api.MetricDescriptor.MetricDescriptorMetadataOrBuilder getMetadataOrBuilder() { - return getMetadata(); + return metadata_ == null + ? com.google.api.MetricDescriptor.MetricDescriptorMetadata.getDefaultInstance() + : metadata_; } public static final int LAUNCH_STAGE_FIELD_NUMBER = 12; - private int launchStage_; + private int launchStage_ = 0; + /** * * @@ -2483,6 +3384,7 @@ public com.google.api.MetricDescriptor.MetricDescriptorMetadataOrBuilder getMeta public int getLaunchStageValue() { return launchStage_; } + /** * * @@ -2496,22 +3398,26 @@ public int getLaunchStageValue() { */ @java.lang.Override public com.google.api.LaunchStage getLaunchStage() { - @SuppressWarnings("deprecation") - com.google.api.LaunchStage result = com.google.api.LaunchStage.valueOf(launchStage_); + com.google.api.LaunchStage result = com.google.api.LaunchStage.forNumber(launchStage_); return result == null ? com.google.api.LaunchStage.UNRECOGNIZED : result; } public static final int MONITORED_RESOURCE_TYPES_FIELD_NUMBER = 13; - private com.google.protobuf.LazyStringList monitoredResourceTypes_; + + @SuppressWarnings("serial") + private com.google.protobuf.LazyStringArrayList monitoredResourceTypes_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + /** * * *
            * Read-only. If present, then a [time
            * series][google.monitoring.v3.TimeSeries], which is identified partially by
        -   * a metric type and a [MonitoredResourceDescriptor][google.api.MonitoredResourceDescriptor], that is associated
        -   * with this metric type can only be associated with one of the monitored
        -   * resource types listed here.
        +   * a metric type and a
        +   * [MonitoredResourceDescriptor][google.api.MonitoredResourceDescriptor], that
        +   * is associated with this metric type can only be associated with one of the
        +   * monitored resource types listed here.
            * 
        * * repeated string monitored_resource_types = 13; @@ -2521,15 +3427,17 @@ public com.google.api.LaunchStage getLaunchStage() { public com.google.protobuf.ProtocolStringList getMonitoredResourceTypesList() { return monitoredResourceTypes_; } + /** * * *
            * Read-only. If present, then a [time
            * series][google.monitoring.v3.TimeSeries], which is identified partially by
        -   * a metric type and a [MonitoredResourceDescriptor][google.api.MonitoredResourceDescriptor], that is associated
        -   * with this metric type can only be associated with one of the monitored
        -   * resource types listed here.
        +   * a metric type and a
        +   * [MonitoredResourceDescriptor][google.api.MonitoredResourceDescriptor], that
        +   * is associated with this metric type can only be associated with one of the
        +   * monitored resource types listed here.
            * 
        * * repeated string monitored_resource_types = 13; @@ -2539,15 +3447,17 @@ public com.google.protobuf.ProtocolStringList getMonitoredResourceTypesList() { public int getMonitoredResourceTypesCount() { return monitoredResourceTypes_.size(); } + /** * * *
            * Read-only. If present, then a [time
            * series][google.monitoring.v3.TimeSeries], which is identified partially by
        -   * a metric type and a [MonitoredResourceDescriptor][google.api.MonitoredResourceDescriptor], that is associated
        -   * with this metric type can only be associated with one of the monitored
        -   * resource types listed here.
        +   * a metric type and a
        +   * [MonitoredResourceDescriptor][google.api.MonitoredResourceDescriptor], that
        +   * is associated with this metric type can only be associated with one of the
        +   * monitored resource types listed here.
            * 
        * * repeated string monitored_resource_types = 13; @@ -2558,15 +3468,17 @@ public int getMonitoredResourceTypesCount() { public java.lang.String getMonitoredResourceTypes(int index) { return monitoredResourceTypes_.get(index); } + /** * * *
            * Read-only. If present, then a [time
            * series][google.monitoring.v3.TimeSeries], which is identified partially by
        -   * a metric type and a [MonitoredResourceDescriptor][google.api.MonitoredResourceDescriptor], that is associated
        -   * with this metric type can only be associated with one of the monitored
        -   * resource types listed here.
        +   * a metric type and a
        +   * [MonitoredResourceDescriptor][google.api.MonitoredResourceDescriptor], that
        +   * is associated with this metric type can only be associated with one of the
        +   * monitored resource types listed here.
            * 
        * * repeated string monitored_resource_types = 13; @@ -2592,8 +3504,8 @@ public final boolean isInitialized() { @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.GeneratedMessage.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, name_); } for (int i = 0; i < labels_.size(); i++) { output.writeMessage(2, labels_.get(i)); @@ -2606,26 +3518,26 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io != com.google.api.MetricDescriptor.ValueType.VALUE_TYPE_UNSPECIFIED.getNumber()) { output.writeEnum(4, valueType_); } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(unit_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 5, unit_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(unit_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 5, unit_); } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(description_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 6, description_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(description_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 6, description_); } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(displayName_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 7, displayName_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(displayName_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 7, displayName_); } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(type_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 8, type_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(type_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 8, type_); } - if (metadata_ != null) { + if (((bitField0_ & 0x00000001) != 0)) { output.writeMessage(10, getMetadata()); } if (launchStage_ != com.google.api.LaunchStage.LAUNCH_STAGE_UNSPECIFIED.getNumber()) { output.writeEnum(12, launchStage_); } for (int i = 0; i < monitoredResourceTypes_.size(); i++) { - com.google.protobuf.GeneratedMessageV3.writeString( + com.google.protobuf.GeneratedMessage.writeString( output, 13, monitoredResourceTypes_.getRaw(i)); } getUnknownFields().writeTo(output); @@ -2637,8 +3549,8 @@ public int getSerializedSize() { 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.GeneratedMessage.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, name_); } for (int i = 0; i < labels_.size(); i++) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, labels_.get(i)); @@ -2651,19 +3563,19 @@ public int getSerializedSize() { != com.google.api.MetricDescriptor.ValueType.VALUE_TYPE_UNSPECIFIED.getNumber()) { size += com.google.protobuf.CodedOutputStream.computeEnumSize(4, valueType_); } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(unit_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, unit_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(unit_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(5, unit_); } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(description_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(6, description_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(description_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(6, description_); } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(displayName_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(7, displayName_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(displayName_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(7, displayName_); } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(type_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(8, type_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(type_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(8, type_); } - if (metadata_ != null) { + if (((bitField0_ & 0x00000001) != 0)) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(10, getMetadata()); } if (launchStage_ != com.google.api.LaunchStage.LAUNCH_STAGE_UNSPECIFIED.getNumber()) { @@ -2787,38 +3699,38 @@ public static com.google.api.MetricDescriptor parseFrom( public static com.google.api.MetricDescriptor parseFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); } public static com.google.api.MetricDescriptor parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } public static com.google.api.MetricDescriptor parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); } public static com.google.api.MetricDescriptor parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( PARSER, input, extensionRegistry); } public static com.google.api.MetricDescriptor parseFrom( com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); } public static com.google.api.MetricDescriptor parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } @@ -2841,10 +3753,11 @@ public Builder toBuilder() { } @java.lang.Override - protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { Builder builder = new Builder(parent); return builder; } + /** * * @@ -2856,7 +3769,7 @@ protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.Build * * Protobuf type {@code google.api.MetricDescriptor} */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder implements // @@protoc_insertion_point(builder_implements:google.api.MetricDescriptor) com.google.api.MetricDescriptorOrBuilder { @@ -2865,7 +3778,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.api.MetricProto .internal_static_google_api_MetricDescriptor_fieldAccessorTable @@ -2874,46 +3787,47 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } // Construct using com.google.api.MetricDescriptor.newBuilder() - private Builder() {} + private Builder() { + maybeForceBuilderInitialization(); + } - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetLabelsFieldBuilder(); + internalGetMetadataFieldBuilder(); + } } @java.lang.Override public Builder clear() { super.clear(); + bitField0_ = 0; name_ = ""; - type_ = ""; - if (labelsBuilder_ == null) { labels_ = java.util.Collections.emptyList(); } else { labels_ = null; labelsBuilder_.clear(); } - bitField0_ = (bitField0_ & ~0x00000001); + bitField0_ = (bitField0_ & ~0x00000004); metricKind_ = 0; - valueType_ = 0; - unit_ = ""; - description_ = ""; - displayName_ = ""; - - if (metadataBuilder_ == null) { - metadata_ = null; - } else { - metadata_ = null; + metadata_ = null; + if (metadataBuilder_ != null) { + metadataBuilder_.dispose(); metadataBuilder_ = null; } launchStage_ = 0; - - monitoredResourceTypes_ = com.google.protobuf.LazyStringArrayList.EMPTY; - bitField0_ = (bitField0_ & ~0x00000002); + monitoredResourceTypes_ = com.google.protobuf.LazyStringArrayList.emptyList(); return this; } @@ -2939,69 +3853,62 @@ public com.google.api.MetricDescriptor build() { @java.lang.Override public com.google.api.MetricDescriptor buildPartial() { com.google.api.MetricDescriptor result = new com.google.api.MetricDescriptor(this); - int from_bitField0_ = bitField0_; - result.name_ = name_; - result.type_ = type_; - if (labelsBuilder_ == null) { - if (((bitField0_ & 0x00000001) != 0)) { - labels_ = java.util.Collections.unmodifiableList(labels_); - bitField0_ = (bitField0_ & ~0x00000001); - } - result.labels_ = labels_; - } else { - result.labels_ = labelsBuilder_.build(); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); } - result.metricKind_ = metricKind_; - result.valueType_ = valueType_; - result.unit_ = unit_; - result.description_ = description_; - result.displayName_ = displayName_; - if (metadataBuilder_ == null) { - result.metadata_ = metadata_; - } else { - result.metadata_ = metadataBuilder_.build(); - } - result.launchStage_ = launchStage_; - if (((bitField0_ & 0x00000002) != 0)) { - monitoredResourceTypes_ = monitoredResourceTypes_.getUnmodifiableView(); - bitField0_ = (bitField0_ & ~0x00000002); - } - result.monitoredResourceTypes_ = monitoredResourceTypes_; 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); + private void buildPartialRepeatedFields(com.google.api.MetricDescriptor result) { + if (labelsBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0)) { + labels_ = java.util.Collections.unmodifiableList(labels_); + bitField0_ = (bitField0_ & ~0x00000004); + } + result.labels_ = labels_; + } else { + result.labels_ = labelsBuilder_.build(); + } } - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.addRepeatedField(field, value); + private void buildPartial0(com.google.api.MetricDescriptor result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.type_ = type_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.metricKind_ = metricKind_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.valueType_ = valueType_; + } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.unit_ = unit_; + } + if (((from_bitField0_ & 0x00000040) != 0)) { + result.description_ = description_; + } + if (((from_bitField0_ & 0x00000080) != 0)) { + result.displayName_ = displayName_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000100) != 0)) { + result.metadata_ = metadataBuilder_ == null ? metadata_ : metadataBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000200) != 0)) { + result.launchStage_ = launchStage_; + } + if (((from_bitField0_ & 0x00000400) != 0)) { + monitoredResourceTypes_.makeImmutable(); + result.monitoredResourceTypes_ = monitoredResourceTypes_; + } + result.bitField0_ |= to_bitField0_; } @java.lang.Override @@ -3018,17 +3925,19 @@ public Builder mergeFrom(com.google.api.MetricDescriptor other) { if (other == com.google.api.MetricDescriptor.getDefaultInstance()) return this; if (!other.getName().isEmpty()) { name_ = other.name_; + bitField0_ |= 0x00000001; onChanged(); } if (!other.getType().isEmpty()) { type_ = other.type_; + bitField0_ |= 0x00000002; onChanged(); } if (labelsBuilder_ == null) { if (!other.labels_.isEmpty()) { if (labels_.isEmpty()) { labels_ = other.labels_; - bitField0_ = (bitField0_ & ~0x00000001); + bitField0_ = (bitField0_ & ~0x00000004); } else { ensureLabelsIsMutable(); labels_.addAll(other.labels_); @@ -3041,10 +3950,10 @@ public Builder mergeFrom(com.google.api.MetricDescriptor other) { labelsBuilder_.dispose(); labelsBuilder_ = null; labels_ = other.labels_; - bitField0_ = (bitField0_ & ~0x00000001); + bitField0_ = (bitField0_ & ~0x00000004); labelsBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders - ? getLabelsFieldBuilder() + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders + ? internalGetLabelsFieldBuilder() : null; } else { labelsBuilder_.addAllMessages(other.labels_); @@ -3059,14 +3968,17 @@ public Builder mergeFrom(com.google.api.MetricDescriptor other) { } if (!other.getUnit().isEmpty()) { unit_ = other.unit_; + bitField0_ |= 0x00000020; onChanged(); } if (!other.getDescription().isEmpty()) { description_ = other.description_; + bitField0_ |= 0x00000040; onChanged(); } if (!other.getDisplayName().isEmpty()) { displayName_ = other.displayName_; + bitField0_ |= 0x00000080; onChanged(); } if (other.hasMetadata()) { @@ -3078,7 +3990,7 @@ public Builder mergeFrom(com.google.api.MetricDescriptor other) { if (!other.monitoredResourceTypes_.isEmpty()) { if (monitoredResourceTypes_.isEmpty()) { monitoredResourceTypes_ = other.monitoredResourceTypes_; - bitField0_ = (bitField0_ & ~0x00000002); + bitField0_ |= 0x00000400; } else { ensureMonitoredResourceTypesIsMutable(); monitoredResourceTypes_.addAll(other.monitoredResourceTypes_); @@ -3114,7 +4026,7 @@ public Builder mergeFrom( case 10: { name_ = input.readStringRequireUtf8(); - + bitField0_ |= 0x00000001; break; } // case 10 case 18: @@ -3132,49 +4044,50 @@ public Builder mergeFrom( case 24: { metricKind_ = input.readEnum(); - + bitField0_ |= 0x00000008; break; } // case 24 case 32: { valueType_ = input.readEnum(); - + bitField0_ |= 0x00000010; break; } // case 32 case 42: { unit_ = input.readStringRequireUtf8(); - + bitField0_ |= 0x00000020; break; } // case 42 case 50: { description_ = input.readStringRequireUtf8(); - + bitField0_ |= 0x00000040; break; } // case 50 case 58: { displayName_ = input.readStringRequireUtf8(); - + bitField0_ |= 0x00000080; break; } // case 58 case 66: { type_ = input.readStringRequireUtf8(); - + bitField0_ |= 0x00000002; break; } // case 66 case 82: { - input.readMessage(getMetadataFieldBuilder().getBuilder(), extensionRegistry); - + input.readMessage( + internalGetMetadataFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000100; break; } // case 82 case 96: { launchStage_ = input.readEnum(); - + bitField0_ |= 0x00000200; break; } // case 96 case 106: @@ -3204,6 +4117,7 @@ public Builder mergeFrom( private int bitField0_; private java.lang.Object name_ = ""; + /** * * @@ -3226,6 +4140,7 @@ public java.lang.String getName() { return (java.lang.String) ref; } } + /** * * @@ -3248,6 +4163,7 @@ public com.google.protobuf.ByteString getNameBytes() { return (com.google.protobuf.ByteString) ref; } } + /** * * @@ -3264,11 +4180,12 @@ public Builder setName(java.lang.String value) { if (value == null) { throw new NullPointerException(); } - name_ = value; + bitField0_ |= 0x00000001; onChanged(); return this; } + /** * * @@ -3281,11 +4198,12 @@ public Builder setName(java.lang.String value) { * @return This builder for chaining. */ public Builder clearName() { - name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); onChanged(); return this; } + /** * * @@ -3303,13 +4221,14 @@ public Builder setNameBytes(com.google.protobuf.ByteString value) { throw new NullPointerException(); } checkByteStringIsUtf8(value); - name_ = value; + bitField0_ |= 0x00000001; onChanged(); return this; } private java.lang.Object type_ = ""; + /** * * @@ -3318,9 +4237,10 @@ public Builder setNameBytes(com.google.protobuf.ByteString value) { * URL-encoded. All user-defined metric types have the DNS name * `custom.googleapis.com` or `external.googleapis.com`. Metric types should * use a natural hierarchical grouping. For example: - * "custom.googleapis.com/invoice/paid/amount" - * "external.googleapis.com/prometheus/up" - * "appengine.googleapis.com/http/server/response_latencies" + * + * "custom.googleapis.com/invoice/paid/amount" + * "external.googleapis.com/prometheus/up" + * "appengine.googleapis.com/http/server/response_latencies" * * * string type = 8; @@ -3338,6 +4258,7 @@ public java.lang.String getType() { return (java.lang.String) ref; } } + /** * * @@ -3346,9 +4267,10 @@ public java.lang.String getType() { * URL-encoded. All user-defined metric types have the DNS name * `custom.googleapis.com` or `external.googleapis.com`. Metric types should * use a natural hierarchical grouping. For example: - * "custom.googleapis.com/invoice/paid/amount" - * "external.googleapis.com/prometheus/up" - * "appengine.googleapis.com/http/server/response_latencies" + * + * "custom.googleapis.com/invoice/paid/amount" + * "external.googleapis.com/prometheus/up" + * "appengine.googleapis.com/http/server/response_latencies" * * * string type = 8; @@ -3366,6 +4288,7 @@ public com.google.protobuf.ByteString getTypeBytes() { return (com.google.protobuf.ByteString) ref; } } + /** * * @@ -3374,9 +4297,10 @@ public com.google.protobuf.ByteString getTypeBytes() { * URL-encoded. All user-defined metric types have the DNS name * `custom.googleapis.com` or `external.googleapis.com`. Metric types should * use a natural hierarchical grouping. For example: - * "custom.googleapis.com/invoice/paid/amount" - * "external.googleapis.com/prometheus/up" - * "appengine.googleapis.com/http/server/response_latencies" + * + * "custom.googleapis.com/invoice/paid/amount" + * "external.googleapis.com/prometheus/up" + * "appengine.googleapis.com/http/server/response_latencies" * * * string type = 8; @@ -3388,11 +4312,12 @@ public Builder setType(java.lang.String value) { if (value == null) { throw new NullPointerException(); } - type_ = value; + bitField0_ |= 0x00000002; onChanged(); return this; } + /** * * @@ -3401,9 +4326,10 @@ public Builder setType(java.lang.String value) { * URL-encoded. All user-defined metric types have the DNS name * `custom.googleapis.com` or `external.googleapis.com`. Metric types should * use a natural hierarchical grouping. For example: - * "custom.googleapis.com/invoice/paid/amount" - * "external.googleapis.com/prometheus/up" - * "appengine.googleapis.com/http/server/response_latencies" + * + * "custom.googleapis.com/invoice/paid/amount" + * "external.googleapis.com/prometheus/up" + * "appengine.googleapis.com/http/server/response_latencies" * * * string type = 8; @@ -3411,11 +4337,12 @@ public Builder setType(java.lang.String value) { * @return This builder for chaining. */ public Builder clearType() { - type_ = getDefaultInstance().getType(); + bitField0_ = (bitField0_ & ~0x00000002); onChanged(); return this; } + /** * * @@ -3424,9 +4351,10 @@ public Builder clearType() { * URL-encoded. All user-defined metric types have the DNS name * `custom.googleapis.com` or `external.googleapis.com`. Metric types should * use a natural hierarchical grouping. For example: - * "custom.googleapis.com/invoice/paid/amount" - * "external.googleapis.com/prometheus/up" - * "appengine.googleapis.com/http/server/response_latencies" + * + * "custom.googleapis.com/invoice/paid/amount" + * "external.googleapis.com/prometheus/up" + * "appengine.googleapis.com/http/server/response_latencies" * * * string type = 8; @@ -3439,8 +4367,8 @@ public Builder setTypeBytes(com.google.protobuf.ByteString value) { throw new NullPointerException(); } checkByteStringIsUtf8(value); - type_ = value; + bitField0_ |= 0x00000002; onChanged(); return this; } @@ -3449,13 +4377,13 @@ public Builder setTypeBytes(com.google.protobuf.ByteString value) { java.util.Collections.emptyList(); private void ensureLabelsIsMutable() { - if (!((bitField0_ & 0x00000001) != 0)) { + if (!((bitField0_ & 0x00000004) != 0)) { labels_ = new java.util.ArrayList(labels_); - bitField0_ |= 0x00000001; + bitField0_ |= 0x00000004; } } - private com.google.protobuf.RepeatedFieldBuilderV3< + private com.google.protobuf.RepeatedFieldBuilder< com.google.api.LabelDescriptor, com.google.api.LabelDescriptor.Builder, com.google.api.LabelDescriptorOrBuilder> @@ -3482,6 +4410,7 @@ public java.util.List getLabelsList() { return labelsBuilder_.getMessageList(); } } + /** * * @@ -3503,6 +4432,7 @@ public int getLabelsCount() { return labelsBuilder_.getCount(); } } + /** * * @@ -3524,6 +4454,7 @@ public com.google.api.LabelDescriptor getLabels(int index) { return labelsBuilder_.getMessage(index); } } + /** * * @@ -3551,6 +4482,7 @@ public Builder setLabels(int index, com.google.api.LabelDescriptor value) { } return this; } + /** * * @@ -3575,6 +4507,7 @@ public Builder setLabels(int index, com.google.api.LabelDescriptor.Builder build } return this; } + /** * * @@ -3602,6 +4535,7 @@ public Builder addLabels(com.google.api.LabelDescriptor value) { } return this; } + /** * * @@ -3629,6 +4563,7 @@ public Builder addLabels(int index, com.google.api.LabelDescriptor value) { } return this; } + /** * * @@ -3653,6 +4588,7 @@ public Builder addLabels(com.google.api.LabelDescriptor.Builder builderForValue) } return this; } + /** * * @@ -3677,6 +4613,7 @@ public Builder addLabels(int index, com.google.api.LabelDescriptor.Builder build } return this; } + /** * * @@ -3702,6 +4639,7 @@ public Builder addAllLabels( } return this; } + /** * * @@ -3719,13 +4657,14 @@ public Builder addAllLabels( public Builder clearLabels() { if (labelsBuilder_ == null) { labels_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); + bitField0_ = (bitField0_ & ~0x00000004); onChanged(); } else { labelsBuilder_.clear(); } return this; } + /** * * @@ -3750,6 +4689,7 @@ public Builder removeLabels(int index) { } return this; } + /** * * @@ -3765,8 +4705,9 @@ public Builder removeLabels(int index) { * repeated .google.api.LabelDescriptor labels = 2; */ public com.google.api.LabelDescriptor.Builder getLabelsBuilder(int index) { - return getLabelsFieldBuilder().getBuilder(index); + return internalGetLabelsFieldBuilder().getBuilder(index); } + /** * * @@ -3788,6 +4729,7 @@ public com.google.api.LabelDescriptorOrBuilder getLabelsOrBuilder(int index) { return labelsBuilder_.getMessageOrBuilder(index); } } + /** * * @@ -3810,6 +4752,7 @@ public com.google.api.LabelDescriptorOrBuilder getLabelsOrBuilder(int index) { return java.util.Collections.unmodifiableList(labels_); } } + /** * * @@ -3825,9 +4768,10 @@ public com.google.api.LabelDescriptorOrBuilder getLabelsOrBuilder(int index) { * repeated .google.api.LabelDescriptor labels = 2; */ public com.google.api.LabelDescriptor.Builder addLabelsBuilder() { - return getLabelsFieldBuilder() + return internalGetLabelsFieldBuilder() .addBuilder(com.google.api.LabelDescriptor.getDefaultInstance()); } + /** * * @@ -3843,9 +4787,10 @@ public com.google.api.LabelDescriptor.Builder addLabelsBuilder() { * repeated .google.api.LabelDescriptor labels = 2; */ public com.google.api.LabelDescriptor.Builder addLabelsBuilder(int index) { - return getLabelsFieldBuilder() + return internalGetLabelsFieldBuilder() .addBuilder(index, com.google.api.LabelDescriptor.getDefaultInstance()); } + /** * * @@ -3861,27 +4806,28 @@ public com.google.api.LabelDescriptor.Builder addLabelsBuilder(int index) { * repeated .google.api.LabelDescriptor labels = 2; */ public java.util.List getLabelsBuilderList() { - return getLabelsFieldBuilder().getBuilderList(); + return internalGetLabelsFieldBuilder().getBuilderList(); } - private com.google.protobuf.RepeatedFieldBuilderV3< + private com.google.protobuf.RepeatedFieldBuilder< com.google.api.LabelDescriptor, com.google.api.LabelDescriptor.Builder, com.google.api.LabelDescriptorOrBuilder> - getLabelsFieldBuilder() { + internalGetLabelsFieldBuilder() { if (labelsBuilder_ == null) { labelsBuilder_ = - new com.google.protobuf.RepeatedFieldBuilderV3< + new com.google.protobuf.RepeatedFieldBuilder< com.google.api.LabelDescriptor, com.google.api.LabelDescriptor.Builder, com.google.api.LabelDescriptorOrBuilder>( - labels_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + labels_, ((bitField0_ & 0x00000004) != 0), getParentForChildren(), isClean()); labels_ = null; } return labelsBuilder_; } private int metricKind_ = 0; + /** * * @@ -3898,6 +4844,7 @@ public java.util.List getLabelsBuilderLi public int getMetricKindValue() { return metricKind_; } + /** * * @@ -3912,11 +4859,12 @@ public int getMetricKindValue() { * @return This builder for chaining. */ public Builder setMetricKindValue(int value) { - metricKind_ = value; + bitField0_ |= 0x00000008; onChanged(); return this; } + /** * * @@ -3931,11 +4879,11 @@ public Builder setMetricKindValue(int value) { */ @java.lang.Override public com.google.api.MetricDescriptor.MetricKind getMetricKind() { - @SuppressWarnings("deprecation") com.google.api.MetricDescriptor.MetricKind result = - com.google.api.MetricDescriptor.MetricKind.valueOf(metricKind_); + com.google.api.MetricDescriptor.MetricKind.forNumber(metricKind_); return result == null ? com.google.api.MetricDescriptor.MetricKind.UNRECOGNIZED : result; } + /** * * @@ -3953,11 +4901,12 @@ public Builder setMetricKind(com.google.api.MetricDescriptor.MetricKind value) { if (value == null) { throw new NullPointerException(); } - + bitField0_ |= 0x00000008; metricKind_ = value.getNumber(); onChanged(); return this; } + /** * * @@ -3971,13 +4920,14 @@ public Builder setMetricKind(com.google.api.MetricDescriptor.MetricKind value) { * @return This builder for chaining. */ public Builder clearMetricKind() { - + bitField0_ = (bitField0_ & ~0x00000008); metricKind_ = 0; onChanged(); return this; } private int valueType_ = 0; + /** * * @@ -3994,6 +4944,7 @@ public Builder clearMetricKind() { public int getValueTypeValue() { return valueType_; } + /** * * @@ -4008,11 +4959,12 @@ public int getValueTypeValue() { * @return This builder for chaining. */ public Builder setValueTypeValue(int value) { - valueType_ = value; + bitField0_ |= 0x00000010; onChanged(); return this; } + /** * * @@ -4027,11 +4979,11 @@ public Builder setValueTypeValue(int value) { */ @java.lang.Override public com.google.api.MetricDescriptor.ValueType getValueType() { - @SuppressWarnings("deprecation") com.google.api.MetricDescriptor.ValueType result = - com.google.api.MetricDescriptor.ValueType.valueOf(valueType_); + com.google.api.MetricDescriptor.ValueType.forNumber(valueType_); return result == null ? com.google.api.MetricDescriptor.ValueType.UNRECOGNIZED : result; } + /** * * @@ -4049,11 +5001,12 @@ public Builder setValueType(com.google.api.MetricDescriptor.ValueType value) { if (value == null) { throw new NullPointerException(); } - + bitField0_ |= 0x00000010; valueType_ = value.getNumber(); onChanged(); return this; } + /** * * @@ -4067,13 +5020,14 @@ public Builder setValueType(com.google.api.MetricDescriptor.ValueType value) { * @return This builder for chaining. */ public Builder clearValueType() { - + bitField0_ = (bitField0_ & ~0x00000010); valueType_ = 0; onChanged(); return this; } private java.lang.Object unit_ = ""; + /** * * @@ -4081,22 +5035,28 @@ public Builder clearValueType() { * The units in which the metric value is reported. It is only applicable * if the `value_type` is `INT64`, `DOUBLE`, or `DISTRIBUTION`. The `unit` * defines the representation of the stored metric values. + * * Different systems might scale the values to be more easily displayed (so a * value of `0.02kBy` _might_ be displayed as `20By`, and a value of * `3523kBy` _might_ be displayed as `3.5MBy`). However, if the `unit` is * `kBy`, then the value of the metric is always in thousands of bytes, no * matter how it might be displayed. + * * If you want a custom metric to record the exact number of CPU-seconds used * by a job, you can create an `INT64 CUMULATIVE` metric whose `unit` is * `s{CPU}` (or equivalently `1s{CPU}` or just `s`). If the job uses 12,005 * CPU-seconds, then the value is written as `12005`. + * * Alternatively, if you want a custom metric to record data in a more * granular way, you can create a `DOUBLE CUMULATIVE` metric whose `unit` is * `ks{CPU}`, and then write the value `12.005` (which is `12005/1000`), * or use `Kis{CPU}` and write `11.723` (which is `12005/1024`). + * * The supported units are a subset of [The Unified Code for Units of * Measure](https://unitsofmeasure.org/ucum.html) standard: + * * **Basic units (UNIT)** + * * * `bit` bit * * `By` byte * * `s` second @@ -4104,7 +5064,9 @@ public Builder clearValueType() { * * `h` hour * * `d` day * * `1` dimensionless + * * **Prefixes (PREFIX)** + * * * `k` kilo (10^3) * * `M` mega (10^6) * * `G` giga (10^9) @@ -4113,6 +5075,7 @@ public Builder clearValueType() { * * `E` exa (10^18) * * `Z` zetta (10^21) * * `Y` yotta (10^24) + * * * `m` milli (10^-3) * * `u` micro (10^-6) * * `n` nano (10^-9) @@ -4121,46 +5084,56 @@ public Builder clearValueType() { * * `a` atto (10^-18) * * `z` zepto (10^-21) * * `y` yocto (10^-24) + * * * `Ki` kibi (2^10) * * `Mi` mebi (2^20) * * `Gi` gibi (2^30) * * `Ti` tebi (2^40) * * `Pi` pebi (2^50) + * * **Grammar** + * * The grammar also includes these connectors: + * * * `/` division or ratio (as an infix operator). For examples, - * `kBy/{email}` or `MiBy/10ms` (although you should almost never - * have `/s` in a metric `unit`; rates should always be computed at - * query time from the underlying cumulative or delta value). + * `kBy/{email}` or `MiBy/10ms` (although you should almost never + * have `/s` in a metric `unit`; rates should always be computed at + * query time from the underlying cumulative or delta value). * * `.` multiplication or composition (as an infix operator). For - * examples, `GBy.d` or `k{watt}.h`. + * examples, `GBy.d` or `k{watt}.h`. + * * The grammar for a unit is as follows: - * Expression = Component { "." Component } { "/" Component } ; - * Component = ( [ PREFIX ] UNIT | "%" ) [ Annotation ] - * | Annotation - * | "1" - * ; - * Annotation = "{" NAME "}" ; + * + * Expression = Component { "." Component } { "/" Component } ; + * + * Component = ( [ PREFIX ] UNIT | "%" ) [ Annotation ] + * | Annotation + * | "1" + * ; + * + * Annotation = "{" NAME "}" ; + * * Notes: + * * * `Annotation` is just a comment if it follows a `UNIT`. If the annotation - * is used alone, then the unit is equivalent to `1`. For examples, - * `{request}/s == 1/s`, `By{transmitted}/s == By/s`. + * is used alone, then the unit is equivalent to `1`. For examples, + * `{request}/s == 1/s`, `By{transmitted}/s == By/s`. * * `NAME` is a sequence of non-blank printable ASCII characters not - * containing `{` or `}`. + * containing `{` or `}`. * * `1` represents a unitary [dimensionless - * unit](https://en.wikipedia.org/wiki/Dimensionless_quantity) of 1, such - * as in `1/s`. It is typically used when none of the basic units are - * appropriate. For example, "new users per day" can be represented as - * `1/d` or `{new-users}/d` (and a metric value `5` would mean "5 new - * users). Alternatively, "thousands of page views per day" would be - * represented as `1000/d` or `k1/d` or `k{page_views}/d` (and a metric - * value of `5.3` would mean "5300 page views per day"). + * unit](https://en.wikipedia.org/wiki/Dimensionless_quantity) of 1, such + * as in `1/s`. It is typically used when none of the basic units are + * appropriate. For example, "new users per day" can be represented as + * `1/d` or `{new-users}/d` (and a metric value `5` would mean "5 new + * users). Alternatively, "thousands of page views per day" would be + * represented as `1000/d` or `k1/d` or `k{page_views}/d` (and a metric + * value of `5.3` would mean "5300 page views per day"). * * `%` represents dimensionless value of 1/100, and annotates values giving - * a percentage (so the metric values are typically in the range of 0..100, - * and a metric value `3` means "3 percent"). + * a percentage (so the metric values are typically in the range of 0..100, + * and a metric value `3` means "3 percent"). * * `10^2.%` indicates a metric contains a ratio, typically in the range - * 0..1, that will be multiplied by 100 and displayed as a percentage - * (so a metric value `0.03` means "3 percent"). + * 0..1, that will be multiplied by 100 and displayed as a percentage + * (so a metric value `0.03` means "3 percent"). * * * string unit = 5; @@ -4178,6 +5151,7 @@ public java.lang.String getUnit() { return (java.lang.String) ref; } } + /** * * @@ -4185,22 +5159,28 @@ public java.lang.String getUnit() { * The units in which the metric value is reported. It is only applicable * if the `value_type` is `INT64`, `DOUBLE`, or `DISTRIBUTION`. The `unit` * defines the representation of the stored metric values. + * * Different systems might scale the values to be more easily displayed (so a * value of `0.02kBy` _might_ be displayed as `20By`, and a value of * `3523kBy` _might_ be displayed as `3.5MBy`). However, if the `unit` is * `kBy`, then the value of the metric is always in thousands of bytes, no * matter how it might be displayed. + * * If you want a custom metric to record the exact number of CPU-seconds used * by a job, you can create an `INT64 CUMULATIVE` metric whose `unit` is * `s{CPU}` (or equivalently `1s{CPU}` or just `s`). If the job uses 12,005 * CPU-seconds, then the value is written as `12005`. + * * Alternatively, if you want a custom metric to record data in a more * granular way, you can create a `DOUBLE CUMULATIVE` metric whose `unit` is * `ks{CPU}`, and then write the value `12.005` (which is `12005/1000`), * or use `Kis{CPU}` and write `11.723` (which is `12005/1024`). + * * The supported units are a subset of [The Unified Code for Units of * Measure](https://unitsofmeasure.org/ucum.html) standard: + * * **Basic units (UNIT)** + * * * `bit` bit * * `By` byte * * `s` second @@ -4208,7 +5188,9 @@ public java.lang.String getUnit() { * * `h` hour * * `d` day * * `1` dimensionless + * * **Prefixes (PREFIX)** + * * * `k` kilo (10^3) * * `M` mega (10^6) * * `G` giga (10^9) @@ -4217,6 +5199,7 @@ public java.lang.String getUnit() { * * `E` exa (10^18) * * `Z` zetta (10^21) * * `Y` yotta (10^24) + * * * `m` milli (10^-3) * * `u` micro (10^-6) * * `n` nano (10^-9) @@ -4225,46 +5208,56 @@ public java.lang.String getUnit() { * * `a` atto (10^-18) * * `z` zepto (10^-21) * * `y` yocto (10^-24) + * * * `Ki` kibi (2^10) * * `Mi` mebi (2^20) * * `Gi` gibi (2^30) * * `Ti` tebi (2^40) * * `Pi` pebi (2^50) + * * **Grammar** + * * The grammar also includes these connectors: + * * * `/` division or ratio (as an infix operator). For examples, - * `kBy/{email}` or `MiBy/10ms` (although you should almost never - * have `/s` in a metric `unit`; rates should always be computed at - * query time from the underlying cumulative or delta value). + * `kBy/{email}` or `MiBy/10ms` (although you should almost never + * have `/s` in a metric `unit`; rates should always be computed at + * query time from the underlying cumulative or delta value). * * `.` multiplication or composition (as an infix operator). For - * examples, `GBy.d` or `k{watt}.h`. + * examples, `GBy.d` or `k{watt}.h`. + * * The grammar for a unit is as follows: - * Expression = Component { "." Component } { "/" Component } ; - * Component = ( [ PREFIX ] UNIT | "%" ) [ Annotation ] - * | Annotation - * | "1" - * ; - * Annotation = "{" NAME "}" ; + * + * Expression = Component { "." Component } { "/" Component } ; + * + * Component = ( [ PREFIX ] UNIT | "%" ) [ Annotation ] + * | Annotation + * | "1" + * ; + * + * Annotation = "{" NAME "}" ; + * * Notes: + * * * `Annotation` is just a comment if it follows a `UNIT`. If the annotation - * is used alone, then the unit is equivalent to `1`. For examples, - * `{request}/s == 1/s`, `By{transmitted}/s == By/s`. + * is used alone, then the unit is equivalent to `1`. For examples, + * `{request}/s == 1/s`, `By{transmitted}/s == By/s`. * * `NAME` is a sequence of non-blank printable ASCII characters not - * containing `{` or `}`. + * containing `{` or `}`. * * `1` represents a unitary [dimensionless - * unit](https://en.wikipedia.org/wiki/Dimensionless_quantity) of 1, such - * as in `1/s`. It is typically used when none of the basic units are - * appropriate. For example, "new users per day" can be represented as - * `1/d` or `{new-users}/d` (and a metric value `5` would mean "5 new - * users). Alternatively, "thousands of page views per day" would be - * represented as `1000/d` or `k1/d` or `k{page_views}/d` (and a metric - * value of `5.3` would mean "5300 page views per day"). + * unit](https://en.wikipedia.org/wiki/Dimensionless_quantity) of 1, such + * as in `1/s`. It is typically used when none of the basic units are + * appropriate. For example, "new users per day" can be represented as + * `1/d` or `{new-users}/d` (and a metric value `5` would mean "5 new + * users). Alternatively, "thousands of page views per day" would be + * represented as `1000/d` or `k1/d` or `k{page_views}/d` (and a metric + * value of `5.3` would mean "5300 page views per day"). * * `%` represents dimensionless value of 1/100, and annotates values giving - * a percentage (so the metric values are typically in the range of 0..100, - * and a metric value `3` means "3 percent"). + * a percentage (so the metric values are typically in the range of 0..100, + * and a metric value `3` means "3 percent"). * * `10^2.%` indicates a metric contains a ratio, typically in the range - * 0..1, that will be multiplied by 100 and displayed as a percentage - * (so a metric value `0.03` means "3 percent"). + * 0..1, that will be multiplied by 100 and displayed as a percentage + * (so a metric value `0.03` means "3 percent"). * * * string unit = 5; @@ -4282,6 +5275,7 @@ public com.google.protobuf.ByteString getUnitBytes() { return (com.google.protobuf.ByteString) ref; } } + /** * * @@ -4289,22 +5283,28 @@ public com.google.protobuf.ByteString getUnitBytes() { * The units in which the metric value is reported. It is only applicable * if the `value_type` is `INT64`, `DOUBLE`, or `DISTRIBUTION`. The `unit` * defines the representation of the stored metric values. + * * Different systems might scale the values to be more easily displayed (so a * value of `0.02kBy` _might_ be displayed as `20By`, and a value of * `3523kBy` _might_ be displayed as `3.5MBy`). However, if the `unit` is * `kBy`, then the value of the metric is always in thousands of bytes, no * matter how it might be displayed. + * * If you want a custom metric to record the exact number of CPU-seconds used * by a job, you can create an `INT64 CUMULATIVE` metric whose `unit` is * `s{CPU}` (or equivalently `1s{CPU}` or just `s`). If the job uses 12,005 * CPU-seconds, then the value is written as `12005`. + * * Alternatively, if you want a custom metric to record data in a more * granular way, you can create a `DOUBLE CUMULATIVE` metric whose `unit` is * `ks{CPU}`, and then write the value `12.005` (which is `12005/1000`), * or use `Kis{CPU}` and write `11.723` (which is `12005/1024`). + * * The supported units are a subset of [The Unified Code for Units of * Measure](https://unitsofmeasure.org/ucum.html) standard: + * * **Basic units (UNIT)** + * * * `bit` bit * * `By` byte * * `s` second @@ -4312,7 +5312,9 @@ public com.google.protobuf.ByteString getUnitBytes() { * * `h` hour * * `d` day * * `1` dimensionless + * * **Prefixes (PREFIX)** + * * * `k` kilo (10^3) * * `M` mega (10^6) * * `G` giga (10^9) @@ -4321,6 +5323,7 @@ public com.google.protobuf.ByteString getUnitBytes() { * * `E` exa (10^18) * * `Z` zetta (10^21) * * `Y` yotta (10^24) + * * * `m` milli (10^-3) * * `u` micro (10^-6) * * `n` nano (10^-9) @@ -4329,46 +5332,56 @@ public com.google.protobuf.ByteString getUnitBytes() { * * `a` atto (10^-18) * * `z` zepto (10^-21) * * `y` yocto (10^-24) + * * * `Ki` kibi (2^10) * * `Mi` mebi (2^20) * * `Gi` gibi (2^30) * * `Ti` tebi (2^40) * * `Pi` pebi (2^50) + * * **Grammar** + * * The grammar also includes these connectors: + * * * `/` division or ratio (as an infix operator). For examples, - * `kBy/{email}` or `MiBy/10ms` (although you should almost never - * have `/s` in a metric `unit`; rates should always be computed at - * query time from the underlying cumulative or delta value). + * `kBy/{email}` or `MiBy/10ms` (although you should almost never + * have `/s` in a metric `unit`; rates should always be computed at + * query time from the underlying cumulative or delta value). * * `.` multiplication or composition (as an infix operator). For - * examples, `GBy.d` or `k{watt}.h`. + * examples, `GBy.d` or `k{watt}.h`. + * * The grammar for a unit is as follows: - * Expression = Component { "." Component } { "/" Component } ; - * Component = ( [ PREFIX ] UNIT | "%" ) [ Annotation ] - * | Annotation - * | "1" - * ; - * Annotation = "{" NAME "}" ; + * + * Expression = Component { "." Component } { "/" Component } ; + * + * Component = ( [ PREFIX ] UNIT | "%" ) [ Annotation ] + * | Annotation + * | "1" + * ; + * + * Annotation = "{" NAME "}" ; + * * Notes: + * * * `Annotation` is just a comment if it follows a `UNIT`. If the annotation - * is used alone, then the unit is equivalent to `1`. For examples, - * `{request}/s == 1/s`, `By{transmitted}/s == By/s`. + * is used alone, then the unit is equivalent to `1`. For examples, + * `{request}/s == 1/s`, `By{transmitted}/s == By/s`. * * `NAME` is a sequence of non-blank printable ASCII characters not - * containing `{` or `}`. + * containing `{` or `}`. * * `1` represents a unitary [dimensionless - * unit](https://en.wikipedia.org/wiki/Dimensionless_quantity) of 1, such - * as in `1/s`. It is typically used when none of the basic units are - * appropriate. For example, "new users per day" can be represented as - * `1/d` or `{new-users}/d` (and a metric value `5` would mean "5 new - * users). Alternatively, "thousands of page views per day" would be - * represented as `1000/d` or `k1/d` or `k{page_views}/d` (and a metric - * value of `5.3` would mean "5300 page views per day"). + * unit](https://en.wikipedia.org/wiki/Dimensionless_quantity) of 1, such + * as in `1/s`. It is typically used when none of the basic units are + * appropriate. For example, "new users per day" can be represented as + * `1/d` or `{new-users}/d` (and a metric value `5` would mean "5 new + * users). Alternatively, "thousands of page views per day" would be + * represented as `1000/d` or `k1/d` or `k{page_views}/d` (and a metric + * value of `5.3` would mean "5300 page views per day"). * * `%` represents dimensionless value of 1/100, and annotates values giving - * a percentage (so the metric values are typically in the range of 0..100, - * and a metric value `3` means "3 percent"). + * a percentage (so the metric values are typically in the range of 0..100, + * and a metric value `3` means "3 percent"). * * `10^2.%` indicates a metric contains a ratio, typically in the range - * 0..1, that will be multiplied by 100 and displayed as a percentage - * (so a metric value `0.03` means "3 percent"). + * 0..1, that will be multiplied by 100 and displayed as a percentage + * (so a metric value `0.03` means "3 percent"). * * * string unit = 5; @@ -4380,11 +5393,12 @@ public Builder setUnit(java.lang.String value) { if (value == null) { throw new NullPointerException(); } - unit_ = value; + bitField0_ |= 0x00000020; onChanged(); return this; } + /** * * @@ -4392,22 +5406,28 @@ public Builder setUnit(java.lang.String value) { * The units in which the metric value is reported. It is only applicable * if the `value_type` is `INT64`, `DOUBLE`, or `DISTRIBUTION`. The `unit` * defines the representation of the stored metric values. + * * Different systems might scale the values to be more easily displayed (so a * value of `0.02kBy` _might_ be displayed as `20By`, and a value of * `3523kBy` _might_ be displayed as `3.5MBy`). However, if the `unit` is * `kBy`, then the value of the metric is always in thousands of bytes, no * matter how it might be displayed. + * * If you want a custom metric to record the exact number of CPU-seconds used * by a job, you can create an `INT64 CUMULATIVE` metric whose `unit` is * `s{CPU}` (or equivalently `1s{CPU}` or just `s`). If the job uses 12,005 * CPU-seconds, then the value is written as `12005`. + * * Alternatively, if you want a custom metric to record data in a more * granular way, you can create a `DOUBLE CUMULATIVE` metric whose `unit` is * `ks{CPU}`, and then write the value `12.005` (which is `12005/1000`), * or use `Kis{CPU}` and write `11.723` (which is `12005/1024`). + * * The supported units are a subset of [The Unified Code for Units of * Measure](https://unitsofmeasure.org/ucum.html) standard: + * * **Basic units (UNIT)** + * * * `bit` bit * * `By` byte * * `s` second @@ -4415,7 +5435,9 @@ public Builder setUnit(java.lang.String value) { * * `h` hour * * `d` day * * `1` dimensionless + * * **Prefixes (PREFIX)** + * * * `k` kilo (10^3) * * `M` mega (10^6) * * `G` giga (10^9) @@ -4424,6 +5446,7 @@ public Builder setUnit(java.lang.String value) { * * `E` exa (10^18) * * `Z` zetta (10^21) * * `Y` yotta (10^24) + * * * `m` milli (10^-3) * * `u` micro (10^-6) * * `n` nano (10^-9) @@ -4432,46 +5455,56 @@ public Builder setUnit(java.lang.String value) { * * `a` atto (10^-18) * * `z` zepto (10^-21) * * `y` yocto (10^-24) + * * * `Ki` kibi (2^10) * * `Mi` mebi (2^20) * * `Gi` gibi (2^30) * * `Ti` tebi (2^40) * * `Pi` pebi (2^50) + * * **Grammar** + * * The grammar also includes these connectors: + * * * `/` division or ratio (as an infix operator). For examples, - * `kBy/{email}` or `MiBy/10ms` (although you should almost never - * have `/s` in a metric `unit`; rates should always be computed at - * query time from the underlying cumulative or delta value). + * `kBy/{email}` or `MiBy/10ms` (although you should almost never + * have `/s` in a metric `unit`; rates should always be computed at + * query time from the underlying cumulative or delta value). * * `.` multiplication or composition (as an infix operator). For - * examples, `GBy.d` or `k{watt}.h`. + * examples, `GBy.d` or `k{watt}.h`. + * * The grammar for a unit is as follows: - * Expression = Component { "." Component } { "/" Component } ; - * Component = ( [ PREFIX ] UNIT | "%" ) [ Annotation ] - * | Annotation - * | "1" - * ; - * Annotation = "{" NAME "}" ; + * + * Expression = Component { "." Component } { "/" Component } ; + * + * Component = ( [ PREFIX ] UNIT | "%" ) [ Annotation ] + * | Annotation + * | "1" + * ; + * + * Annotation = "{" NAME "}" ; + * * Notes: + * * * `Annotation` is just a comment if it follows a `UNIT`. If the annotation - * is used alone, then the unit is equivalent to `1`. For examples, - * `{request}/s == 1/s`, `By{transmitted}/s == By/s`. + * is used alone, then the unit is equivalent to `1`. For examples, + * `{request}/s == 1/s`, `By{transmitted}/s == By/s`. * * `NAME` is a sequence of non-blank printable ASCII characters not - * containing `{` or `}`. + * containing `{` or `}`. * * `1` represents a unitary [dimensionless - * unit](https://en.wikipedia.org/wiki/Dimensionless_quantity) of 1, such - * as in `1/s`. It is typically used when none of the basic units are - * appropriate. For example, "new users per day" can be represented as - * `1/d` or `{new-users}/d` (and a metric value `5` would mean "5 new - * users). Alternatively, "thousands of page views per day" would be - * represented as `1000/d` or `k1/d` or `k{page_views}/d` (and a metric - * value of `5.3` would mean "5300 page views per day"). + * unit](https://en.wikipedia.org/wiki/Dimensionless_quantity) of 1, such + * as in `1/s`. It is typically used when none of the basic units are + * appropriate. For example, "new users per day" can be represented as + * `1/d` or `{new-users}/d` (and a metric value `5` would mean "5 new + * users). Alternatively, "thousands of page views per day" would be + * represented as `1000/d` or `k1/d` or `k{page_views}/d` (and a metric + * value of `5.3` would mean "5300 page views per day"). * * `%` represents dimensionless value of 1/100, and annotates values giving - * a percentage (so the metric values are typically in the range of 0..100, - * and a metric value `3` means "3 percent"). + * a percentage (so the metric values are typically in the range of 0..100, + * and a metric value `3` means "3 percent"). * * `10^2.%` indicates a metric contains a ratio, typically in the range - * 0..1, that will be multiplied by 100 and displayed as a percentage - * (so a metric value `0.03` means "3 percent"). + * 0..1, that will be multiplied by 100 and displayed as a percentage + * (so a metric value `0.03` means "3 percent"). * * * string unit = 5; @@ -4479,11 +5512,12 @@ public Builder setUnit(java.lang.String value) { * @return This builder for chaining. */ public Builder clearUnit() { - unit_ = getDefaultInstance().getUnit(); + bitField0_ = (bitField0_ & ~0x00000020); onChanged(); return this; } + /** * * @@ -4491,22 +5525,28 @@ public Builder clearUnit() { * The units in which the metric value is reported. It is only applicable * if the `value_type` is `INT64`, `DOUBLE`, or `DISTRIBUTION`. The `unit` * defines the representation of the stored metric values. + * * Different systems might scale the values to be more easily displayed (so a * value of `0.02kBy` _might_ be displayed as `20By`, and a value of * `3523kBy` _might_ be displayed as `3.5MBy`). However, if the `unit` is * `kBy`, then the value of the metric is always in thousands of bytes, no * matter how it might be displayed. + * * If you want a custom metric to record the exact number of CPU-seconds used * by a job, you can create an `INT64 CUMULATIVE` metric whose `unit` is * `s{CPU}` (or equivalently `1s{CPU}` or just `s`). If the job uses 12,005 * CPU-seconds, then the value is written as `12005`. + * * Alternatively, if you want a custom metric to record data in a more * granular way, you can create a `DOUBLE CUMULATIVE` metric whose `unit` is * `ks{CPU}`, and then write the value `12.005` (which is `12005/1000`), * or use `Kis{CPU}` and write `11.723` (which is `12005/1024`). + * * The supported units are a subset of [The Unified Code for Units of * Measure](https://unitsofmeasure.org/ucum.html) standard: + * * **Basic units (UNIT)** + * * * `bit` bit * * `By` byte * * `s` second @@ -4514,7 +5554,9 @@ public Builder clearUnit() { * * `h` hour * * `d` day * * `1` dimensionless + * * **Prefixes (PREFIX)** + * * * `k` kilo (10^3) * * `M` mega (10^6) * * `G` giga (10^9) @@ -4523,6 +5565,7 @@ public Builder clearUnit() { * * `E` exa (10^18) * * `Z` zetta (10^21) * * `Y` yotta (10^24) + * * * `m` milli (10^-3) * * `u` micro (10^-6) * * `n` nano (10^-9) @@ -4531,46 +5574,56 @@ public Builder clearUnit() { * * `a` atto (10^-18) * * `z` zepto (10^-21) * * `y` yocto (10^-24) + * * * `Ki` kibi (2^10) * * `Mi` mebi (2^20) * * `Gi` gibi (2^30) * * `Ti` tebi (2^40) * * `Pi` pebi (2^50) + * * **Grammar** + * * The grammar also includes these connectors: + * * * `/` division or ratio (as an infix operator). For examples, - * `kBy/{email}` or `MiBy/10ms` (although you should almost never - * have `/s` in a metric `unit`; rates should always be computed at - * query time from the underlying cumulative or delta value). + * `kBy/{email}` or `MiBy/10ms` (although you should almost never + * have `/s` in a metric `unit`; rates should always be computed at + * query time from the underlying cumulative or delta value). * * `.` multiplication or composition (as an infix operator). For - * examples, `GBy.d` or `k{watt}.h`. + * examples, `GBy.d` or `k{watt}.h`. + * * The grammar for a unit is as follows: - * Expression = Component { "." Component } { "/" Component } ; - * Component = ( [ PREFIX ] UNIT | "%" ) [ Annotation ] - * | Annotation - * | "1" - * ; - * Annotation = "{" NAME "}" ; + * + * Expression = Component { "." Component } { "/" Component } ; + * + * Component = ( [ PREFIX ] UNIT | "%" ) [ Annotation ] + * | Annotation + * | "1" + * ; + * + * Annotation = "{" NAME "}" ; + * * Notes: + * * * `Annotation` is just a comment if it follows a `UNIT`. If the annotation - * is used alone, then the unit is equivalent to `1`. For examples, - * `{request}/s == 1/s`, `By{transmitted}/s == By/s`. + * is used alone, then the unit is equivalent to `1`. For examples, + * `{request}/s == 1/s`, `By{transmitted}/s == By/s`. * * `NAME` is a sequence of non-blank printable ASCII characters not - * containing `{` or `}`. + * containing `{` or `}`. * * `1` represents a unitary [dimensionless - * unit](https://en.wikipedia.org/wiki/Dimensionless_quantity) of 1, such - * as in `1/s`. It is typically used when none of the basic units are - * appropriate. For example, "new users per day" can be represented as - * `1/d` or `{new-users}/d` (and a metric value `5` would mean "5 new - * users). Alternatively, "thousands of page views per day" would be - * represented as `1000/d` or `k1/d` or `k{page_views}/d` (and a metric - * value of `5.3` would mean "5300 page views per day"). + * unit](https://en.wikipedia.org/wiki/Dimensionless_quantity) of 1, such + * as in `1/s`. It is typically used when none of the basic units are + * appropriate. For example, "new users per day" can be represented as + * `1/d` or `{new-users}/d` (and a metric value `5` would mean "5 new + * users). Alternatively, "thousands of page views per day" would be + * represented as `1000/d` or `k1/d` or `k{page_views}/d` (and a metric + * value of `5.3` would mean "5300 page views per day"). * * `%` represents dimensionless value of 1/100, and annotates values giving - * a percentage (so the metric values are typically in the range of 0..100, - * and a metric value `3` means "3 percent"). + * a percentage (so the metric values are typically in the range of 0..100, + * and a metric value `3` means "3 percent"). * * `10^2.%` indicates a metric contains a ratio, typically in the range - * 0..1, that will be multiplied by 100 and displayed as a percentage - * (so a metric value `0.03` means "3 percent"). + * 0..1, that will be multiplied by 100 and displayed as a percentage + * (so a metric value `0.03` means "3 percent"). * * * string unit = 5; @@ -4583,13 +5636,14 @@ public Builder setUnitBytes(com.google.protobuf.ByteString value) { throw new NullPointerException(); } checkByteStringIsUtf8(value); - unit_ = value; + bitField0_ |= 0x00000020; onChanged(); return this; } private java.lang.Object description_ = ""; + /** * * @@ -4612,6 +5666,7 @@ public java.lang.String getDescription() { return (java.lang.String) ref; } } + /** * * @@ -4634,6 +5689,7 @@ public com.google.protobuf.ByteString getDescriptionBytes() { return (com.google.protobuf.ByteString) ref; } } + /** * * @@ -4650,11 +5706,12 @@ public Builder setDescription(java.lang.String value) { if (value == null) { throw new NullPointerException(); } - description_ = value; + bitField0_ |= 0x00000040; onChanged(); return this; } + /** * * @@ -4667,11 +5724,12 @@ public Builder setDescription(java.lang.String value) { * @return This builder for chaining. */ public Builder clearDescription() { - description_ = getDefaultInstance().getDescription(); + bitField0_ = (bitField0_ & ~0x00000040); onChanged(); return this; } + /** * * @@ -4689,13 +5747,14 @@ public Builder setDescriptionBytes(com.google.protobuf.ByteString value) { throw new NullPointerException(); } checkByteStringIsUtf8(value); - description_ = value; + bitField0_ |= 0x00000040; onChanged(); return this; } private java.lang.Object displayName_ = ""; + /** * * @@ -4721,6 +5780,7 @@ public java.lang.String getDisplayName() { return (java.lang.String) ref; } } + /** * * @@ -4746,6 +5806,7 @@ public com.google.protobuf.ByteString getDisplayNameBytes() { return (com.google.protobuf.ByteString) ref; } } + /** * * @@ -4765,11 +5826,12 @@ public Builder setDisplayName(java.lang.String value) { if (value == null) { throw new NullPointerException(); } - displayName_ = value; + bitField0_ |= 0x00000080; onChanged(); return this; } + /** * * @@ -4785,11 +5847,12 @@ public Builder setDisplayName(java.lang.String value) { * @return This builder for chaining. */ public Builder clearDisplayName() { - displayName_ = getDefaultInstance().getDisplayName(); + bitField0_ = (bitField0_ & ~0x00000080); onChanged(); return this; } + /** * * @@ -4810,18 +5873,19 @@ public Builder setDisplayNameBytes(com.google.protobuf.ByteString value) { throw new NullPointerException(); } checkByteStringIsUtf8(value); - displayName_ = value; + bitField0_ |= 0x00000080; onChanged(); return this; } private com.google.api.MetricDescriptor.MetricDescriptorMetadata metadata_; - private com.google.protobuf.SingleFieldBuilderV3< + private com.google.protobuf.SingleFieldBuilder< com.google.api.MetricDescriptor.MetricDescriptorMetadata, com.google.api.MetricDescriptor.MetricDescriptorMetadata.Builder, com.google.api.MetricDescriptor.MetricDescriptorMetadataOrBuilder> metadataBuilder_; + /** * * @@ -4834,8 +5898,9 @@ public Builder setDisplayNameBytes(com.google.protobuf.ByteString value) { * @return Whether the metadata field is set. */ public boolean hasMetadata() { - return metadataBuilder_ != null || metadata_ != null; + return ((bitField0_ & 0x00000100) != 0); } + /** * * @@ -4856,6 +5921,7 @@ public com.google.api.MetricDescriptor.MetricDescriptorMetadata getMetadata() { return metadataBuilder_.getMessage(); } } + /** * * @@ -4871,13 +5937,14 @@ public Builder setMetadata(com.google.api.MetricDescriptor.MetricDescriptorMetad throw new NullPointerException(); } metadata_ = value; - onChanged(); } else { metadataBuilder_.setMessage(value); } - + bitField0_ |= 0x00000100; + onChanged(); return this; } + /** * * @@ -4891,13 +5958,14 @@ public Builder setMetadata( com.google.api.MetricDescriptor.MetricDescriptorMetadata.Builder builderForValue) { if (metadataBuilder_ == null) { metadata_ = builderForValue.build(); - onChanged(); } else { metadataBuilder_.setMessage(builderForValue.build()); } - + bitField0_ |= 0x00000100; + onChanged(); return this; } + /** * * @@ -4909,21 +5977,24 @@ public Builder setMetadata( */ public Builder mergeMetadata(com.google.api.MetricDescriptor.MetricDescriptorMetadata value) { if (metadataBuilder_ == null) { - if (metadata_ != null) { - metadata_ = - com.google.api.MetricDescriptor.MetricDescriptorMetadata.newBuilder(metadata_) - .mergeFrom(value) - .buildPartial(); + if (((bitField0_ & 0x00000100) != 0) + && metadata_ != null + && metadata_ + != com.google.api.MetricDescriptor.MetricDescriptorMetadata.getDefaultInstance()) { + getMetadataBuilder().mergeFrom(value); } else { metadata_ = value; } - onChanged(); } else { metadataBuilder_.mergeFrom(value); } - + if (metadata_ != null) { + bitField0_ |= 0x00000100; + onChanged(); + } return this; } + /** * * @@ -4934,16 +6005,16 @@ public Builder mergeMetadata(com.google.api.MetricDescriptor.MetricDescriptorMet * .google.api.MetricDescriptor.MetricDescriptorMetadata metadata = 10; */ public Builder clearMetadata() { - if (metadataBuilder_ == null) { - metadata_ = null; - onChanged(); - } else { - metadata_ = null; + bitField0_ = (bitField0_ & ~0x00000100); + metadata_ = null; + if (metadataBuilder_ != null) { + metadataBuilder_.dispose(); metadataBuilder_ = null; } - + onChanged(); return this; } + /** * * @@ -4954,10 +6025,11 @@ public Builder clearMetadata() { * .google.api.MetricDescriptor.MetricDescriptorMetadata metadata = 10; */ public com.google.api.MetricDescriptor.MetricDescriptorMetadata.Builder getMetadataBuilder() { - + bitField0_ |= 0x00000100; onChanged(); - return getMetadataFieldBuilder().getBuilder(); + return internalGetMetadataFieldBuilder().getBuilder(); } + /** * * @@ -4977,6 +6049,7 @@ public com.google.api.MetricDescriptor.MetricDescriptorMetadata.Builder getMetad : metadata_; } } + /** * * @@ -4986,14 +6059,14 @@ public com.google.api.MetricDescriptor.MetricDescriptorMetadata.Builder getMetad * * .google.api.MetricDescriptor.MetricDescriptorMetadata metadata = 10; */ - private com.google.protobuf.SingleFieldBuilderV3< + private com.google.protobuf.SingleFieldBuilder< com.google.api.MetricDescriptor.MetricDescriptorMetadata, com.google.api.MetricDescriptor.MetricDescriptorMetadata.Builder, com.google.api.MetricDescriptor.MetricDescriptorMetadataOrBuilder> - getMetadataFieldBuilder() { + internalGetMetadataFieldBuilder() { if (metadataBuilder_ == null) { metadataBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< + new com.google.protobuf.SingleFieldBuilder< com.google.api.MetricDescriptor.MetricDescriptorMetadata, com.google.api.MetricDescriptor.MetricDescriptorMetadata.Builder, com.google.api.MetricDescriptor.MetricDescriptorMetadataOrBuilder>( @@ -5004,6 +6077,7 @@ public com.google.api.MetricDescriptor.MetricDescriptorMetadata.Builder getMetad } private int launchStage_ = 0; + /** * * @@ -5019,6 +6093,7 @@ public com.google.api.MetricDescriptor.MetricDescriptorMetadata.Builder getMetad public int getLaunchStageValue() { return launchStage_; } + /** * * @@ -5032,11 +6107,12 @@ public int getLaunchStageValue() { * @return This builder for chaining. */ public Builder setLaunchStageValue(int value) { - launchStage_ = value; + bitField0_ |= 0x00000200; onChanged(); return this; } + /** * * @@ -5050,10 +6126,10 @@ public Builder setLaunchStageValue(int value) { */ @java.lang.Override public com.google.api.LaunchStage getLaunchStage() { - @SuppressWarnings("deprecation") - com.google.api.LaunchStage result = com.google.api.LaunchStage.valueOf(launchStage_); + com.google.api.LaunchStage result = com.google.api.LaunchStage.forNumber(launchStage_); return result == null ? com.google.api.LaunchStage.UNRECOGNIZED : result; } + /** * * @@ -5070,11 +6146,12 @@ public Builder setLaunchStage(com.google.api.LaunchStage value) { if (value == null) { throw new NullPointerException(); } - + bitField0_ |= 0x00000200; launchStage_ = value.getNumber(); onChanged(); return this; } + /** * * @@ -5087,31 +6164,33 @@ public Builder setLaunchStage(com.google.api.LaunchStage value) { * @return This builder for chaining. */ public Builder clearLaunchStage() { - + bitField0_ = (bitField0_ & ~0x00000200); launchStage_ = 0; onChanged(); return this; } - private com.google.protobuf.LazyStringList monitoredResourceTypes_ = - com.google.protobuf.LazyStringArrayList.EMPTY; + private com.google.protobuf.LazyStringArrayList monitoredResourceTypes_ = + com.google.protobuf.LazyStringArrayList.emptyList(); private void ensureMonitoredResourceTypesIsMutable() { - if (!((bitField0_ & 0x00000002) != 0)) { + if (!monitoredResourceTypes_.isModifiable()) { monitoredResourceTypes_ = new com.google.protobuf.LazyStringArrayList(monitoredResourceTypes_); - bitField0_ |= 0x00000002; } + bitField0_ |= 0x00000400; } + /** * * *
              * Read-only. If present, then a [time
              * series][google.monitoring.v3.TimeSeries], which is identified partially by
        -     * a metric type and a [MonitoredResourceDescriptor][google.api.MonitoredResourceDescriptor], that is associated
        -     * with this metric type can only be associated with one of the monitored
        -     * resource types listed here.
        +     * a metric type and a
        +     * [MonitoredResourceDescriptor][google.api.MonitoredResourceDescriptor], that
        +     * is associated with this metric type can only be associated with one of the
        +     * monitored resource types listed here.
              * 
        * * repeated string monitored_resource_types = 13; @@ -5119,17 +6198,20 @@ private void ensureMonitoredResourceTypesIsMutable() { * @return A list containing the monitoredResourceTypes. */ public com.google.protobuf.ProtocolStringList getMonitoredResourceTypesList() { - return monitoredResourceTypes_.getUnmodifiableView(); + monitoredResourceTypes_.makeImmutable(); + return monitoredResourceTypes_; } + /** * * *
              * Read-only. If present, then a [time
              * series][google.monitoring.v3.TimeSeries], which is identified partially by
        -     * a metric type and a [MonitoredResourceDescriptor][google.api.MonitoredResourceDescriptor], that is associated
        -     * with this metric type can only be associated with one of the monitored
        -     * resource types listed here.
        +     * a metric type and a
        +     * [MonitoredResourceDescriptor][google.api.MonitoredResourceDescriptor], that
        +     * is associated with this metric type can only be associated with one of the
        +     * monitored resource types listed here.
              * 
        * * repeated string monitored_resource_types = 13; @@ -5139,15 +6221,17 @@ public com.google.protobuf.ProtocolStringList getMonitoredResourceTypesList() { public int getMonitoredResourceTypesCount() { return monitoredResourceTypes_.size(); } + /** * * *
              * Read-only. If present, then a [time
              * series][google.monitoring.v3.TimeSeries], which is identified partially by
        -     * a metric type and a [MonitoredResourceDescriptor][google.api.MonitoredResourceDescriptor], that is associated
        -     * with this metric type can only be associated with one of the monitored
        -     * resource types listed here.
        +     * a metric type and a
        +     * [MonitoredResourceDescriptor][google.api.MonitoredResourceDescriptor], that
        +     * is associated with this metric type can only be associated with one of the
        +     * monitored resource types listed here.
              * 
        * * repeated string monitored_resource_types = 13; @@ -5158,15 +6242,17 @@ public int getMonitoredResourceTypesCount() { public java.lang.String getMonitoredResourceTypes(int index) { return monitoredResourceTypes_.get(index); } + /** * * *
              * Read-only. If present, then a [time
              * series][google.monitoring.v3.TimeSeries], which is identified partially by
        -     * a metric type and a [MonitoredResourceDescriptor][google.api.MonitoredResourceDescriptor], that is associated
        -     * with this metric type can only be associated with one of the monitored
        -     * resource types listed here.
        +     * a metric type and a
        +     * [MonitoredResourceDescriptor][google.api.MonitoredResourceDescriptor], that
        +     * is associated with this metric type can only be associated with one of the
        +     * monitored resource types listed here.
              * 
        * * repeated string monitored_resource_types = 13; @@ -5177,15 +6263,17 @@ public java.lang.String getMonitoredResourceTypes(int index) { public com.google.protobuf.ByteString getMonitoredResourceTypesBytes(int index) { return monitoredResourceTypes_.getByteString(index); } + /** * * *
              * Read-only. If present, then a [time
              * series][google.monitoring.v3.TimeSeries], which is identified partially by
        -     * a metric type and a [MonitoredResourceDescriptor][google.api.MonitoredResourceDescriptor], that is associated
        -     * with this metric type can only be associated with one of the monitored
        -     * resource types listed here.
        +     * a metric type and a
        +     * [MonitoredResourceDescriptor][google.api.MonitoredResourceDescriptor], that
        +     * is associated with this metric type can only be associated with one of the
        +     * monitored resource types listed here.
              * 
        * * repeated string monitored_resource_types = 13; @@ -5200,18 +6288,21 @@ public Builder setMonitoredResourceTypes(int index, java.lang.String value) { } ensureMonitoredResourceTypesIsMutable(); monitoredResourceTypes_.set(index, value); + bitField0_ |= 0x00000400; onChanged(); return this; } + /** * * *
              * Read-only. If present, then a [time
              * series][google.monitoring.v3.TimeSeries], which is identified partially by
        -     * a metric type and a [MonitoredResourceDescriptor][google.api.MonitoredResourceDescriptor], that is associated
        -     * with this metric type can only be associated with one of the monitored
        -     * resource types listed here.
        +     * a metric type and a
        +     * [MonitoredResourceDescriptor][google.api.MonitoredResourceDescriptor], that
        +     * is associated with this metric type can only be associated with one of the
        +     * monitored resource types listed here.
              * 
        * * repeated string monitored_resource_types = 13; @@ -5225,18 +6316,21 @@ public Builder addMonitoredResourceTypes(java.lang.String value) { } ensureMonitoredResourceTypesIsMutable(); monitoredResourceTypes_.add(value); + bitField0_ |= 0x00000400; onChanged(); return this; } + /** * * *
              * Read-only. If present, then a [time
              * series][google.monitoring.v3.TimeSeries], which is identified partially by
        -     * a metric type and a [MonitoredResourceDescriptor][google.api.MonitoredResourceDescriptor], that is associated
        -     * with this metric type can only be associated with one of the monitored
        -     * resource types listed here.
        +     * a metric type and a
        +     * [MonitoredResourceDescriptor][google.api.MonitoredResourceDescriptor], that
        +     * is associated with this metric type can only be associated with one of the
        +     * monitored resource types listed here.
              * 
        * * repeated string monitored_resource_types = 13; @@ -5247,18 +6341,21 @@ public Builder addMonitoredResourceTypes(java.lang.String value) { public Builder addAllMonitoredResourceTypes(java.lang.Iterable values) { ensureMonitoredResourceTypesIsMutable(); com.google.protobuf.AbstractMessageLite.Builder.addAll(values, monitoredResourceTypes_); + bitField0_ |= 0x00000400; onChanged(); return this; } + /** * * *
              * Read-only. If present, then a [time
              * series][google.monitoring.v3.TimeSeries], which is identified partially by
        -     * a metric type and a [MonitoredResourceDescriptor][google.api.MonitoredResourceDescriptor], that is associated
        -     * with this metric type can only be associated with one of the monitored
        -     * resource types listed here.
        +     * a metric type and a
        +     * [MonitoredResourceDescriptor][google.api.MonitoredResourceDescriptor], that
        +     * is associated with this metric type can only be associated with one of the
        +     * monitored resource types listed here.
              * 
        * * repeated string monitored_resource_types = 13; @@ -5266,20 +6363,23 @@ public Builder addAllMonitoredResourceTypes(java.lang.Iterable * @return This builder for chaining. */ public Builder clearMonitoredResourceTypes() { - monitoredResourceTypes_ = com.google.protobuf.LazyStringArrayList.EMPTY; - bitField0_ = (bitField0_ & ~0x00000002); + monitoredResourceTypes_ = com.google.protobuf.LazyStringArrayList.emptyList(); + bitField0_ = (bitField0_ & ~0x00000400); + ; onChanged(); return this; } + /** * * *
              * Read-only. If present, then a [time
              * series][google.monitoring.v3.TimeSeries], which is identified partially by
        -     * a metric type and a [MonitoredResourceDescriptor][google.api.MonitoredResourceDescriptor], that is associated
        -     * with this metric type can only be associated with one of the monitored
        -     * resource types listed here.
        +     * a metric type and a
        +     * [MonitoredResourceDescriptor][google.api.MonitoredResourceDescriptor], that
        +     * is associated with this metric type can only be associated with one of the
        +     * monitored resource types listed here.
              * 
        * * repeated string monitored_resource_types = 13; @@ -5294,21 +6394,11 @@ public Builder addMonitoredResourceTypesBytes(com.google.protobuf.ByteString val checkByteStringIsUtf8(value); ensureMonitoredResourceTypesIsMutable(); monitoredResourceTypes_.add(value); + bitField0_ |= 0x00000400; onChanged(); return this; } - @java.lang.Override - public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - // @@protoc_insertion_point(builder_scope:google.api.MetricDescriptor) } diff --git a/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/MetricDescriptorOrBuilder.java b/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/MetricDescriptorOrBuilder.java index c2a244e093..d7fcb24bf9 100644 --- a/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/MetricDescriptorOrBuilder.java +++ b/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/MetricDescriptorOrBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,10 +14,13 @@ * limitations under the License. */ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: google/api/metric.proto +// Protobuf Java Version: 4.33.2 package com.google.api; +@com.google.protobuf.Generated public interface MetricDescriptorOrBuilder extends // @@protoc_insertion_point(interface_extends:google.api.MetricDescriptor) @@ -35,6 +38,7 @@ public interface MetricDescriptorOrBuilder * @return The name. */ java.lang.String getName(); + /** * * @@ -56,9 +60,10 @@ public interface MetricDescriptorOrBuilder * URL-encoded. All user-defined metric types have the DNS name * `custom.googleapis.com` or `external.googleapis.com`. Metric types should * use a natural hierarchical grouping. For example: - * "custom.googleapis.com/invoice/paid/amount" - * "external.googleapis.com/prometheus/up" - * "appengine.googleapis.com/http/server/response_latencies" + * + * "custom.googleapis.com/invoice/paid/amount" + * "external.googleapis.com/prometheus/up" + * "appengine.googleapis.com/http/server/response_latencies" * * * string type = 8; @@ -66,6 +71,7 @@ public interface MetricDescriptorOrBuilder * @return The type. */ java.lang.String getType(); + /** * * @@ -74,9 +80,10 @@ public interface MetricDescriptorOrBuilder * URL-encoded. All user-defined metric types have the DNS name * `custom.googleapis.com` or `external.googleapis.com`. Metric types should * use a natural hierarchical grouping. For example: - * "custom.googleapis.com/invoice/paid/amount" - * "external.googleapis.com/prometheus/up" - * "appengine.googleapis.com/http/server/response_latencies" + * + * "custom.googleapis.com/invoice/paid/amount" + * "external.googleapis.com/prometheus/up" + * "appengine.googleapis.com/http/server/response_latencies" * * * string type = 8; @@ -100,6 +107,7 @@ public interface MetricDescriptorOrBuilder * repeated .google.api.LabelDescriptor labels = 2; */ java.util.List getLabelsList(); + /** * * @@ -115,6 +123,7 @@ public interface MetricDescriptorOrBuilder * repeated .google.api.LabelDescriptor labels = 2; */ com.google.api.LabelDescriptor getLabels(int index); + /** * * @@ -130,6 +139,7 @@ public interface MetricDescriptorOrBuilder * repeated .google.api.LabelDescriptor labels = 2; */ int getLabelsCount(); + /** * * @@ -145,6 +155,7 @@ public interface MetricDescriptorOrBuilder * repeated .google.api.LabelDescriptor labels = 2; */ java.util.List getLabelsOrBuilderList(); + /** * * @@ -174,6 +185,7 @@ public interface MetricDescriptorOrBuilder * @return The enum numeric value on the wire for metricKind. */ int getMetricKindValue(); + /** * * @@ -201,6 +213,7 @@ public interface MetricDescriptorOrBuilder * @return The enum numeric value on the wire for valueType. */ int getValueTypeValue(); + /** * * @@ -222,22 +235,28 @@ public interface MetricDescriptorOrBuilder * The units in which the metric value is reported. It is only applicable * if the `value_type` is `INT64`, `DOUBLE`, or `DISTRIBUTION`. The `unit` * defines the representation of the stored metric values. + * * Different systems might scale the values to be more easily displayed (so a * value of `0.02kBy` _might_ be displayed as `20By`, and a value of * `3523kBy` _might_ be displayed as `3.5MBy`). However, if the `unit` is * `kBy`, then the value of the metric is always in thousands of bytes, no * matter how it might be displayed. + * * If you want a custom metric to record the exact number of CPU-seconds used * by a job, you can create an `INT64 CUMULATIVE` metric whose `unit` is * `s{CPU}` (or equivalently `1s{CPU}` or just `s`). If the job uses 12,005 * CPU-seconds, then the value is written as `12005`. + * * Alternatively, if you want a custom metric to record data in a more * granular way, you can create a `DOUBLE CUMULATIVE` metric whose `unit` is * `ks{CPU}`, and then write the value `12.005` (which is `12005/1000`), * or use `Kis{CPU}` and write `11.723` (which is `12005/1024`). + * * The supported units are a subset of [The Unified Code for Units of * Measure](https://unitsofmeasure.org/ucum.html) standard: + * * **Basic units (UNIT)** + * * * `bit` bit * * `By` byte * * `s` second @@ -245,7 +264,9 @@ public interface MetricDescriptorOrBuilder * * `h` hour * * `d` day * * `1` dimensionless + * * **Prefixes (PREFIX)** + * * * `k` kilo (10^3) * * `M` mega (10^6) * * `G` giga (10^9) @@ -254,6 +275,7 @@ public interface MetricDescriptorOrBuilder * * `E` exa (10^18) * * `Z` zetta (10^21) * * `Y` yotta (10^24) + * * * `m` milli (10^-3) * * `u` micro (10^-6) * * `n` nano (10^-9) @@ -262,46 +284,56 @@ public interface MetricDescriptorOrBuilder * * `a` atto (10^-18) * * `z` zepto (10^-21) * * `y` yocto (10^-24) + * * * `Ki` kibi (2^10) * * `Mi` mebi (2^20) * * `Gi` gibi (2^30) * * `Ti` tebi (2^40) * * `Pi` pebi (2^50) + * * **Grammar** + * * The grammar also includes these connectors: + * * * `/` division or ratio (as an infix operator). For examples, - * `kBy/{email}` or `MiBy/10ms` (although you should almost never - * have `/s` in a metric `unit`; rates should always be computed at - * query time from the underlying cumulative or delta value). + * `kBy/{email}` or `MiBy/10ms` (although you should almost never + * have `/s` in a metric `unit`; rates should always be computed at + * query time from the underlying cumulative or delta value). * * `.` multiplication or composition (as an infix operator). For - * examples, `GBy.d` or `k{watt}.h`. + * examples, `GBy.d` or `k{watt}.h`. + * * The grammar for a unit is as follows: - * Expression = Component { "." Component } { "/" Component } ; - * Component = ( [ PREFIX ] UNIT | "%" ) [ Annotation ] - * | Annotation - * | "1" - * ; - * Annotation = "{" NAME "}" ; + * + * Expression = Component { "." Component } { "/" Component } ; + * + * Component = ( [ PREFIX ] UNIT | "%" ) [ Annotation ] + * | Annotation + * | "1" + * ; + * + * Annotation = "{" NAME "}" ; + * * Notes: + * * * `Annotation` is just a comment if it follows a `UNIT`. If the annotation - * is used alone, then the unit is equivalent to `1`. For examples, - * `{request}/s == 1/s`, `By{transmitted}/s == By/s`. + * is used alone, then the unit is equivalent to `1`. For examples, + * `{request}/s == 1/s`, `By{transmitted}/s == By/s`. * * `NAME` is a sequence of non-blank printable ASCII characters not - * containing `{` or `}`. + * containing `{` or `}`. * * `1` represents a unitary [dimensionless - * unit](https://en.wikipedia.org/wiki/Dimensionless_quantity) of 1, such - * as in `1/s`. It is typically used when none of the basic units are - * appropriate. For example, "new users per day" can be represented as - * `1/d` or `{new-users}/d` (and a metric value `5` would mean "5 new - * users). Alternatively, "thousands of page views per day" would be - * represented as `1000/d` or `k1/d` or `k{page_views}/d` (and a metric - * value of `5.3` would mean "5300 page views per day"). + * unit](https://en.wikipedia.org/wiki/Dimensionless_quantity) of 1, such + * as in `1/s`. It is typically used when none of the basic units are + * appropriate. For example, "new users per day" can be represented as + * `1/d` or `{new-users}/d` (and a metric value `5` would mean "5 new + * users). Alternatively, "thousands of page views per day" would be + * represented as `1000/d` or `k1/d` or `k{page_views}/d` (and a metric + * value of `5.3` would mean "5300 page views per day"). * * `%` represents dimensionless value of 1/100, and annotates values giving - * a percentage (so the metric values are typically in the range of 0..100, - * and a metric value `3` means "3 percent"). + * a percentage (so the metric values are typically in the range of 0..100, + * and a metric value `3` means "3 percent"). * * `10^2.%` indicates a metric contains a ratio, typically in the range - * 0..1, that will be multiplied by 100 and displayed as a percentage - * (so a metric value `0.03` means "3 percent"). + * 0..1, that will be multiplied by 100 and displayed as a percentage + * (so a metric value `0.03` means "3 percent"). * * * string unit = 5; @@ -309,6 +341,7 @@ public interface MetricDescriptorOrBuilder * @return The unit. */ java.lang.String getUnit(); + /** * * @@ -316,22 +349,28 @@ public interface MetricDescriptorOrBuilder * The units in which the metric value is reported. It is only applicable * if the `value_type` is `INT64`, `DOUBLE`, or `DISTRIBUTION`. The `unit` * defines the representation of the stored metric values. + * * Different systems might scale the values to be more easily displayed (so a * value of `0.02kBy` _might_ be displayed as `20By`, and a value of * `3523kBy` _might_ be displayed as `3.5MBy`). However, if the `unit` is * `kBy`, then the value of the metric is always in thousands of bytes, no * matter how it might be displayed. + * * If you want a custom metric to record the exact number of CPU-seconds used * by a job, you can create an `INT64 CUMULATIVE` metric whose `unit` is * `s{CPU}` (or equivalently `1s{CPU}` or just `s`). If the job uses 12,005 * CPU-seconds, then the value is written as `12005`. + * * Alternatively, if you want a custom metric to record data in a more * granular way, you can create a `DOUBLE CUMULATIVE` metric whose `unit` is * `ks{CPU}`, and then write the value `12.005` (which is `12005/1000`), * or use `Kis{CPU}` and write `11.723` (which is `12005/1024`). + * * The supported units are a subset of [The Unified Code for Units of * Measure](https://unitsofmeasure.org/ucum.html) standard: + * * **Basic units (UNIT)** + * * * `bit` bit * * `By` byte * * `s` second @@ -339,7 +378,9 @@ public interface MetricDescriptorOrBuilder * * `h` hour * * `d` day * * `1` dimensionless + * * **Prefixes (PREFIX)** + * * * `k` kilo (10^3) * * `M` mega (10^6) * * `G` giga (10^9) @@ -348,6 +389,7 @@ public interface MetricDescriptorOrBuilder * * `E` exa (10^18) * * `Z` zetta (10^21) * * `Y` yotta (10^24) + * * * `m` milli (10^-3) * * `u` micro (10^-6) * * `n` nano (10^-9) @@ -356,46 +398,56 @@ public interface MetricDescriptorOrBuilder * * `a` atto (10^-18) * * `z` zepto (10^-21) * * `y` yocto (10^-24) + * * * `Ki` kibi (2^10) * * `Mi` mebi (2^20) * * `Gi` gibi (2^30) * * `Ti` tebi (2^40) * * `Pi` pebi (2^50) + * * **Grammar** + * * The grammar also includes these connectors: + * * * `/` division or ratio (as an infix operator). For examples, - * `kBy/{email}` or `MiBy/10ms` (although you should almost never - * have `/s` in a metric `unit`; rates should always be computed at - * query time from the underlying cumulative or delta value). + * `kBy/{email}` or `MiBy/10ms` (although you should almost never + * have `/s` in a metric `unit`; rates should always be computed at + * query time from the underlying cumulative or delta value). * * `.` multiplication or composition (as an infix operator). For - * examples, `GBy.d` or `k{watt}.h`. + * examples, `GBy.d` or `k{watt}.h`. + * * The grammar for a unit is as follows: - * Expression = Component { "." Component } { "/" Component } ; - * Component = ( [ PREFIX ] UNIT | "%" ) [ Annotation ] - * | Annotation - * | "1" - * ; - * Annotation = "{" NAME "}" ; + * + * Expression = Component { "." Component } { "/" Component } ; + * + * Component = ( [ PREFIX ] UNIT | "%" ) [ Annotation ] + * | Annotation + * | "1" + * ; + * + * Annotation = "{" NAME "}" ; + * * Notes: + * * * `Annotation` is just a comment if it follows a `UNIT`. If the annotation - * is used alone, then the unit is equivalent to `1`. For examples, - * `{request}/s == 1/s`, `By{transmitted}/s == By/s`. + * is used alone, then the unit is equivalent to `1`. For examples, + * `{request}/s == 1/s`, `By{transmitted}/s == By/s`. * * `NAME` is a sequence of non-blank printable ASCII characters not - * containing `{` or `}`. + * containing `{` or `}`. * * `1` represents a unitary [dimensionless - * unit](https://en.wikipedia.org/wiki/Dimensionless_quantity) of 1, such - * as in `1/s`. It is typically used when none of the basic units are - * appropriate. For example, "new users per day" can be represented as - * `1/d` or `{new-users}/d` (and a metric value `5` would mean "5 new - * users). Alternatively, "thousands of page views per day" would be - * represented as `1000/d` or `k1/d` or `k{page_views}/d` (and a metric - * value of `5.3` would mean "5300 page views per day"). + * unit](https://en.wikipedia.org/wiki/Dimensionless_quantity) of 1, such + * as in `1/s`. It is typically used when none of the basic units are + * appropriate. For example, "new users per day" can be represented as + * `1/d` or `{new-users}/d` (and a metric value `5` would mean "5 new + * users). Alternatively, "thousands of page views per day" would be + * represented as `1000/d` or `k1/d` or `k{page_views}/d` (and a metric + * value of `5.3` would mean "5300 page views per day"). * * `%` represents dimensionless value of 1/100, and annotates values giving - * a percentage (so the metric values are typically in the range of 0..100, - * and a metric value `3` means "3 percent"). + * a percentage (so the metric values are typically in the range of 0..100, + * and a metric value `3` means "3 percent"). * * `10^2.%` indicates a metric contains a ratio, typically in the range - * 0..1, that will be multiplied by 100 and displayed as a percentage - * (so a metric value `0.03` means "3 percent"). + * 0..1, that will be multiplied by 100 and displayed as a percentage + * (so a metric value `0.03` means "3 percent"). * * * string unit = 5; @@ -416,6 +468,7 @@ public interface MetricDescriptorOrBuilder * @return The description. */ java.lang.String getDescription(); + /** * * @@ -444,6 +497,7 @@ public interface MetricDescriptorOrBuilder * @return The displayName. */ java.lang.String getDisplayName(); + /** * * @@ -472,6 +526,7 @@ public interface MetricDescriptorOrBuilder * @return Whether the metadata field is set. */ boolean hasMetadata(); + /** * * @@ -484,6 +539,7 @@ public interface MetricDescriptorOrBuilder * @return The metadata. */ com.google.api.MetricDescriptor.MetricDescriptorMetadata getMetadata(); + /** * * @@ -507,6 +563,7 @@ public interface MetricDescriptorOrBuilder * @return The enum numeric value on the wire for launchStage. */ int getLaunchStageValue(); + /** * * @@ -526,9 +583,10 @@ public interface MetricDescriptorOrBuilder *
            * Read-only. If present, then a [time
            * series][google.monitoring.v3.TimeSeries], which is identified partially by
        -   * a metric type and a [MonitoredResourceDescriptor][google.api.MonitoredResourceDescriptor], that is associated
        -   * with this metric type can only be associated with one of the monitored
        -   * resource types listed here.
        +   * a metric type and a
        +   * [MonitoredResourceDescriptor][google.api.MonitoredResourceDescriptor], that
        +   * is associated with this metric type can only be associated with one of the
        +   * monitored resource types listed here.
            * 
        * * repeated string monitored_resource_types = 13; @@ -536,15 +594,17 @@ public interface MetricDescriptorOrBuilder * @return A list containing the monitoredResourceTypes. */ java.util.List getMonitoredResourceTypesList(); + /** * * *
            * Read-only. If present, then a [time
            * series][google.monitoring.v3.TimeSeries], which is identified partially by
        -   * a metric type and a [MonitoredResourceDescriptor][google.api.MonitoredResourceDescriptor], that is associated
        -   * with this metric type can only be associated with one of the monitored
        -   * resource types listed here.
        +   * a metric type and a
        +   * [MonitoredResourceDescriptor][google.api.MonitoredResourceDescriptor], that
        +   * is associated with this metric type can only be associated with one of the
        +   * monitored resource types listed here.
            * 
        * * repeated string monitored_resource_types = 13; @@ -552,15 +612,17 @@ public interface MetricDescriptorOrBuilder * @return The count of monitoredResourceTypes. */ int getMonitoredResourceTypesCount(); + /** * * *
            * Read-only. If present, then a [time
            * series][google.monitoring.v3.TimeSeries], which is identified partially by
        -   * a metric type and a [MonitoredResourceDescriptor][google.api.MonitoredResourceDescriptor], that is associated
        -   * with this metric type can only be associated with one of the monitored
        -   * resource types listed here.
        +   * a metric type and a
        +   * [MonitoredResourceDescriptor][google.api.MonitoredResourceDescriptor], that
        +   * is associated with this metric type can only be associated with one of the
        +   * monitored resource types listed here.
            * 
        * * repeated string monitored_resource_types = 13; @@ -569,15 +631,17 @@ public interface MetricDescriptorOrBuilder * @return The monitoredResourceTypes at the given index. */ java.lang.String getMonitoredResourceTypes(int index); + /** * * *
            * Read-only. If present, then a [time
            * series][google.monitoring.v3.TimeSeries], which is identified partially by
        -   * a metric type and a [MonitoredResourceDescriptor][google.api.MonitoredResourceDescriptor], that is associated
        -   * with this metric type can only be associated with one of the monitored
        -   * resource types listed here.
        +   * a metric type and a
        +   * [MonitoredResourceDescriptor][google.api.MonitoredResourceDescriptor], that
        +   * is associated with this metric type can only be associated with one of the
        +   * monitored resource types listed here.
            * 
        * * repeated string monitored_resource_types = 13; diff --git a/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/MetricOrBuilder.java b/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/MetricOrBuilder.java index db9fe4b181..e1a5111763 100644 --- a/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/MetricOrBuilder.java +++ b/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/MetricOrBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,10 +14,13 @@ * limitations under the License. */ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: google/api/metric.proto +// Protobuf Java Version: 4.33.2 package com.google.api; +@com.google.protobuf.Generated public interface MetricOrBuilder extends // @@protoc_insertion_point(interface_extends:google.api.Metric) @@ -27,8 +30,9 @@ public interface MetricOrBuilder * * *
        -   * An existing metric type, see [google.api.MetricDescriptor][google.api.MetricDescriptor].
        -   * For example, `custom.googleapis.com/invoice/paid/amount`.
        +   * An existing metric type, see
        +   * [google.api.MetricDescriptor][google.api.MetricDescriptor]. For example,
        +   * `custom.googleapis.com/invoice/paid/amount`.
            * 
        * * string type = 3; @@ -36,12 +40,14 @@ public interface MetricOrBuilder * @return The type. */ java.lang.String getType(); + /** * * *
        -   * An existing metric type, see [google.api.MetricDescriptor][google.api.MetricDescriptor].
        -   * For example, `custom.googleapis.com/invoice/paid/amount`.
        +   * An existing metric type, see
        +   * [google.api.MetricDescriptor][google.api.MetricDescriptor]. For example,
        +   * `custom.googleapis.com/invoice/paid/amount`.
            * 
        * * string type = 3; @@ -61,6 +67,7 @@ public interface MetricOrBuilder * map<string, string> labels = 2; */ int getLabelsCount(); + /** * * @@ -72,9 +79,11 @@ public interface MetricOrBuilder * map<string, string> labels = 2; */ boolean containsLabels(java.lang.String key); + /** Use {@link #getLabelsMap()} instead. */ @java.lang.Deprecated java.util.Map getLabels(); + /** * * @@ -86,6 +95,7 @@ public interface MetricOrBuilder * map<string, string> labels = 2; */ java.util.Map getLabelsMap(); + /** * * @@ -96,12 +106,12 @@ public interface MetricOrBuilder * * map<string, string> labels = 2; */ - /* nullable */ java.lang.String getLabelsOrDefault( java.lang.String key, /* nullable */ java.lang.String defaultValue); + /** * * diff --git a/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/MetricProto.java b/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/MetricProto.java index 43d694522c..f4eef06153 100644 --- a/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/MetricProto.java +++ b/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/MetricProto.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,13 +14,26 @@ * limitations under the License. */ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: google/api/metric.proto +// Protobuf Java Version: 4.33.2 package com.google.api; -public final class MetricProto { +@com.google.protobuf.Generated +public final class MetricProto extends com.google.protobuf.GeneratedFile { private MetricProto() {} + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "MetricProto"); + } + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistryLite registry) {} public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry registry) { @@ -29,19 +42,19 @@ public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry r static final com.google.protobuf.Descriptors.Descriptor internal_static_google_api_MetricDescriptor_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable internal_static_google_api_MetricDescriptor_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_google_api_MetricDescriptor_MetricDescriptorMetadata_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable internal_static_google_api_MetricDescriptor_MetricDescriptorMetadata_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_google_api_Metric_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable internal_static_google_api_Metric_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_google_api_Metric_LabelsEntry_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable internal_static_google_api_Metric_LabelsEntry_fieldAccessorTable; public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { @@ -52,35 +65,56 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { static { java.lang.String[] descriptorData = { - "\n\027google/api/metric.proto\022\ngoogle.api\032\026g" - + "oogle/api/label.proto\032\035google/api/launch" - + "_stage.proto\032\036google/protobuf/duration.p" - + "roto\"\237\006\n\020MetricDescriptor\022\014\n\004name\030\001 \001(\t\022" - + "\014\n\004type\030\010 \001(\t\022+\n\006labels\030\002 \003(\0132\033.google.a" - + "pi.LabelDescriptor\022<\n\013metric_kind\030\003 \001(\0162" - + "\'.google.api.MetricDescriptor.MetricKind" - + "\022:\n\nvalue_type\030\004 \001(\0162&.google.api.Metric" - + "Descriptor.ValueType\022\014\n\004unit\030\005 \001(\t\022\023\n\013de" - + "scription\030\006 \001(\t\022\024\n\014display_name\030\007 \001(\t\022G\n" - + "\010metadata\030\n \001(\01325.google.api.MetricDescr" - + "iptor.MetricDescriptorMetadata\022-\n\014launch" - + "_stage\030\014 \001(\0162\027.google.api.LaunchStage\022 \n" - + "\030monitored_resource_types\030\r \003(\t\032\260\001\n\030Metr" - + "icDescriptorMetadata\0221\n\014launch_stage\030\001 \001" - + "(\0162\027.google.api.LaunchStageB\002\030\001\0220\n\rsampl" - + "e_period\030\002 \001(\0132\031.google.protobuf.Duratio" - + "n\022/\n\014ingest_delay\030\003 \001(\0132\031.google.protobu" - + "f.Duration\"O\n\nMetricKind\022\033\n\027METRIC_KIND_" - + "UNSPECIFIED\020\000\022\t\n\005GAUGE\020\001\022\t\n\005DELTA\020\002\022\016\n\nC" - + "UMULATIVE\020\003\"q\n\tValueType\022\032\n\026VALUE_TYPE_U" - + "NSPECIFIED\020\000\022\010\n\004BOOL\020\001\022\t\n\005INT64\020\002\022\n\n\006DOU" - + "BLE\020\003\022\n\n\006STRING\020\004\022\020\n\014DISTRIBUTION\020\005\022\t\n\005M" - + "ONEY\020\006\"u\n\006Metric\022\014\n\004type\030\003 \001(\t\022.\n\006labels" - + "\030\002 \003(\0132\036.google.api.Metric.LabelsEntry\032-" - + "\n\013LabelsEntry\022\013\n\003key\030\001 \001(\t\022\r\n\005value\030\002 \001(" - + "\t:\0028\001B_\n\016com.google.apiB\013MetricProtoP\001Z7" - + "google.golang.org/genproto/googleapis/ap" - + "i/metric;metric\242\002\004GAPIb\006proto3" + "\n" + + "\027google/api/metric.proto\022\n" + + "google.api\032\026google/api/label.proto\032\035google/api/launch" + + "_stage.proto\032\036google/protobuf/duration.proto\"\254\010\n" + + "\020MetricDescriptor\022\014\n" + + "\004name\030\001 \001(\t\022\014\n" + + "\004type\030\010 \001(\t\022+\n" + + "\006labels\030\002 \003(\0132\033.google.api.LabelDescriptor\022<\n" + + "\013metric_kind\030\003 \001(\0162\'.google.api.MetricDescriptor.MetricKind\022:\n\n" + + "value_type\030\004 \001(\0162&.google.api.MetricDescriptor.ValueType\022\014\n" + + "\004unit\030\005 \001(\t\022\023\n" + + "\013description\030\006 \001(\t\022\024\n" + + "\014display_name\030\007 \001(\t\022G\n" + + "\010metadata\030\n" + + " \001(\01325.google.api.MetricDescriptor.MetricDescriptorMetadata\022-\n" + + "\014launch_stage\030\014 \001(\0162\027.google.api.LaunchStage\022 \n" + + "\030monitored_resource_types\030\r" + + " \003(\t\032\275\003\n" + + "\030MetricDescriptorMetadata\0221\n" + + "\014launch_stage\030\001 \001(\0162\027.google.api.LaunchStageB\002\030\001\0220\n\r" + + "sample_period\030\002 \001(\0132\031.google.protobuf.Duration\022/\n" + + "\014ingest_delay\030\003 \001(\0132\031.google.protobuf.Duration\022\204\001\n" + + "$time_series_resource_hierarchy_level\030\004 \003(\0162V.google.api.MetricDes" + + "criptor.MetricDescriptorMetadata.TimeSeriesResourceHierarchyLevel\"\203\001\n" + + " TimeSeriesResourceHierarchyLevel\0224\n" + + "0TIME_SERIES_RESOURCE_HIERARCHY_LEVEL_UNSPECIFIED\020\000\022\013\n" + + "\007PROJECT\020\001\022\020\n" + + "\014ORGANIZATION\020\002\022\n\n" + + "\006FOLDER\020\003\"O\n\n" + + "MetricKind\022\033\n" + + "\027METRIC_KIND_UNSPECIFIED\020\000\022\t\n" + + "\005GAUGE\020\001\022\t\n" + + "\005DELTA\020\002\022\016\n\n" + + "CUMULATIVE\020\003\"q\n" + + "\tValueType\022\032\n" + + "\026VALUE_TYPE_UNSPECIFIED\020\000\022\010\n" + + "\004BOOL\020\001\022\t\n" + + "\005INT64\020\002\022\n\n" + + "\006DOUBLE\020\003\022\n\n" + + "\006STRING\020\004\022\020\n" + + "\014DISTRIBUTION\020\005\022\t\n" + + "\005MONEY\020\006\"u\n" + + "\006Metric\022\014\n" + + "\004type\030\003 \001(\t\022.\n" + + "\006labels\030\002 \003(\0132\036.google.api.Metric.LabelsEntry\032-\n" + + "\013LabelsEntry\022\013\n" + + "\003key\030\001 \001(\t\022\r\n" + + "\005value\030\002 \001(\t:\0028\001B_\n" + + "\016com.google.apiB\013MetricProtoP\001Z7google.gola" + + "ng.org/genproto/googleapis/api/metric;metric\242\002\004GAPIb\006proto3" }; descriptor = com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( @@ -90,10 +124,9 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { com.google.api.LaunchStageProto.getDescriptor(), com.google.protobuf.DurationProto.getDescriptor(), }); - internal_static_google_api_MetricDescriptor_descriptor = - getDescriptor().getMessageTypes().get(0); + internal_static_google_api_MetricDescriptor_descriptor = getDescriptor().getMessageType(0); internal_static_google_api_MetricDescriptor_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_google_api_MetricDescriptor_descriptor, new java.lang.String[] { "Name", @@ -109,28 +142,29 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "MonitoredResourceTypes", }); internal_static_google_api_MetricDescriptor_MetricDescriptorMetadata_descriptor = - internal_static_google_api_MetricDescriptor_descriptor.getNestedTypes().get(0); + internal_static_google_api_MetricDescriptor_descriptor.getNestedType(0); internal_static_google_api_MetricDescriptor_MetricDescriptorMetadata_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_google_api_MetricDescriptor_MetricDescriptorMetadata_descriptor, new java.lang.String[] { - "LaunchStage", "SamplePeriod", "IngestDelay", + "LaunchStage", "SamplePeriod", "IngestDelay", "TimeSeriesResourceHierarchyLevel", }); - internal_static_google_api_Metric_descriptor = getDescriptor().getMessageTypes().get(1); + internal_static_google_api_Metric_descriptor = getDescriptor().getMessageType(1); internal_static_google_api_Metric_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_google_api_Metric_descriptor, new java.lang.String[] { "Type", "Labels", }); internal_static_google_api_Metric_LabelsEntry_descriptor = - internal_static_google_api_Metric_descriptor.getNestedTypes().get(0); + internal_static_google_api_Metric_descriptor.getNestedType(0); internal_static_google_api_Metric_LabelsEntry_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_google_api_Metric_LabelsEntry_descriptor, new java.lang.String[] { "Key", "Value", }); + descriptor.resolveAllFeaturesImmutable(); com.google.api.LabelProto.getDescriptor(); com.google.api.LaunchStageProto.getDescriptor(); com.google.protobuf.DurationProto.getDescriptor(); diff --git a/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/MetricRule.java b/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/MetricRule.java index a5812838aa..44127ee25d 100644 --- a/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/MetricRule.java +++ b/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/MetricRule.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,9 @@ * limitations under the License. */ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: google/api/quota.proto +// Protobuf Java Version: 4.33.2 package com.google.api; @@ -28,13 +30,25 @@ * * Protobuf type {@code google.api.MetricRule} */ -public final class MetricRule extends com.google.protobuf.GeneratedMessageV3 +@com.google.protobuf.Generated +public final class MetricRule extends com.google.protobuf.GeneratedMessage implements // @@protoc_insertion_point(message_implements:google.api.MetricRule) MetricRuleOrBuilder { private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "MetricRule"); + } + // Use MetricRule.newBuilder() to construct. - private MetricRule(com.google.protobuf.GeneratedMessageV3.Builder builder) { + private MetricRule(com.google.protobuf.GeneratedMessage.Builder builder) { super(builder); } @@ -42,24 +56,14 @@ private MetricRule() { selector_ = ""; } - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new MetricRule(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.api.QuotaProto.internal_static_google_api_MetricRule_descriptor; } @SuppressWarnings({"rawtypes"}) @java.lang.Override - protected com.google.protobuf.MapField internalGetMapField(int number) { + protected com.google.protobuf.MapFieldReflectionAccessor internalGetMapFieldReflection( + int number) { switch (number) { case 2: return internalGetMetricCosts(); @@ -69,7 +73,7 @@ protected com.google.protobuf.MapField internalGetMapField(int number) { } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.api.QuotaProto.internal_static_google_api_MetricRule_fieldAccessorTable .ensureFieldAccessorsInitialized( @@ -77,13 +81,18 @@ protected com.google.protobuf.MapField internalGetMapField(int number) { } public static final int SELECTOR_FIELD_NUMBER = 1; - private volatile java.lang.Object selector_; + + @SuppressWarnings("serial") + private volatile java.lang.Object selector_ = ""; + /** * * *
            * Selects the methods to which this rule applies.
        -   * Refer to [selector][google.api.DocumentationRule.selector] for syntax details.
        +   *
        +   * Refer to [selector][google.api.DocumentationRule.selector] for syntax
        +   * details.
            * 
        * * string selector = 1; @@ -102,12 +111,15 @@ public java.lang.String getSelector() { return s; } } + /** * * *
            * Selects the methods to which this rule applies.
        -   * Refer to [selector][google.api.DocumentationRule.selector] for syntax details.
        +   *
        +   * Refer to [selector][google.api.DocumentationRule.selector] for syntax
        +   * details.
            * 
        * * string selector = 1; @@ -140,6 +152,7 @@ private static final class MetricCostsDefaultEntryHolder { 0L); } + @SuppressWarnings("serial") private com.google.protobuf.MapField metricCosts_; private com.google.protobuf.MapField internalGetMetricCosts() { @@ -152,12 +165,14 @@ private com.google.protobuf.MapField internalG public int getMetricCostsCount() { return internalGetMetricCosts().getMap().size(); } + /** * * *
            * Metrics to update when the selected methods are called, and the associated
            * cost applied to each metric.
        +   *
            * The key of the map is the metric name, and the values are the amount
            * increased for the metric against which the quota limits are defined.
            * The value must not be negative.
        @@ -172,18 +187,21 @@ public boolean containsMetricCosts(java.lang.String key) {
             }
             return internalGetMetricCosts().getMap().containsKey(key);
           }
        +
           /** Use {@link #getMetricCostsMap()} instead. */
           @java.lang.Override
           @java.lang.Deprecated
           public java.util.Map getMetricCosts() {
             return getMetricCostsMap();
           }
        +
           /**
            *
            *
            * 
            * Metrics to update when the selected methods are called, and the associated
            * cost applied to each metric.
        +   *
            * The key of the map is the metric name, and the values are the amount
            * increased for the metric against which the quota limits are defined.
            * The value must not be negative.
        @@ -195,12 +213,14 @@ public java.util.Map getMetricCosts() {
           public java.util.Map getMetricCostsMap() {
             return internalGetMetricCosts().getMap();
           }
        +
           /**
            *
            *
            * 
            * Metrics to update when the selected methods are called, and the associated
            * cost applied to each metric.
        +   *
            * The key of the map is the metric name, and the values are the amount
            * increased for the metric against which the quota limits are defined.
            * The value must not be negative.
        @@ -216,12 +236,14 @@ public long getMetricCostsOrDefault(java.lang.String key, long defaultValue) {
             java.util.Map map = internalGetMetricCosts().getMap();
             return map.containsKey(key) ? map.get(key) : defaultValue;
           }
        +
           /**
            *
            *
            * 
            * Metrics to update when the selected methods are called, and the associated
            * cost applied to each metric.
        +   *
            * The key of the map is the metric name, and the values are the amount
            * increased for the metric against which the quota limits are defined.
            * The value must not be negative.
        @@ -255,10 +277,10 @@ public final boolean isInitialized() {
         
           @java.lang.Override
           public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException {
        -    if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(selector_)) {
        -      com.google.protobuf.GeneratedMessageV3.writeString(output, 1, selector_);
        +    if (!com.google.protobuf.GeneratedMessage.isStringEmpty(selector_)) {
        +      com.google.protobuf.GeneratedMessage.writeString(output, 1, selector_);
             }
        -    com.google.protobuf.GeneratedMessageV3.serializeStringMapTo(
        +    com.google.protobuf.GeneratedMessage.serializeStringMapTo(
                 output, internalGetMetricCosts(), MetricCostsDefaultEntryHolder.defaultEntry, 2);
             getUnknownFields().writeTo(output);
           }
        @@ -269,8 +291,8 @@ public int getSerializedSize() {
             if (size != -1) return size;
         
             size = 0;
        -    if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(selector_)) {
        -      size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, selector_);
        +    if (!com.google.protobuf.GeneratedMessage.isStringEmpty(selector_)) {
        +      size += com.google.protobuf.GeneratedMessage.computeStringSize(1, selector_);
             }
             for (java.util.Map.Entry entry :
                 internalGetMetricCosts().getMap().entrySet()) {
        @@ -357,38 +379,38 @@ public static com.google.api.MetricRule parseFrom(
         
           public static com.google.api.MetricRule parseFrom(java.io.InputStream input)
               throws java.io.IOException {
        -    return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
        +    return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input);
           }
         
           public static com.google.api.MetricRule parseFrom(
               java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
               throws java.io.IOException {
        -    return com.google.protobuf.GeneratedMessageV3.parseWithIOException(
        +    return com.google.protobuf.GeneratedMessage.parseWithIOException(
                 PARSER, input, extensionRegistry);
           }
         
           public static com.google.api.MetricRule parseDelimitedFrom(java.io.InputStream input)
               throws java.io.IOException {
        -    return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input);
        +    return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input);
           }
         
           public static com.google.api.MetricRule parseDelimitedFrom(
               java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
               throws java.io.IOException {
        -    return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(
        +    return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(
                 PARSER, input, extensionRegistry);
           }
         
           public static com.google.api.MetricRule parseFrom(com.google.protobuf.CodedInputStream input)
               throws java.io.IOException {
        -    return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
        +    return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input);
           }
         
           public static com.google.api.MetricRule parseFrom(
               com.google.protobuf.CodedInputStream input,
               com.google.protobuf.ExtensionRegistryLite extensionRegistry)
               throws java.io.IOException {
        -    return com.google.protobuf.GeneratedMessageV3.parseWithIOException(
        +    return com.google.protobuf.GeneratedMessage.parseWithIOException(
                 PARSER, input, extensionRegistry);
           }
         
        @@ -411,10 +433,11 @@ public Builder toBuilder() {
           }
         
           @java.lang.Override
        -  protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
        +  protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) {
             Builder builder = new Builder(parent);
             return builder;
           }
        +
           /**
            *
            *
        @@ -425,7 +448,7 @@ protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.Build
            *
            * Protobuf type {@code google.api.MetricRule}
            */
        -  public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder
        +  public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder
               implements
               // @@protoc_insertion_point(builder_implements:google.api.MetricRule)
               com.google.api.MetricRuleOrBuilder {
        @@ -434,7 +457,8 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
             }
         
             @SuppressWarnings({"rawtypes"})
        -    protected com.google.protobuf.MapField internalGetMapField(int number) {
        +    protected com.google.protobuf.MapFieldReflectionAccessor internalGetMapFieldReflection(
        +        int number) {
               switch (number) {
                 case 2:
                   return internalGetMetricCosts();
        @@ -444,7 +468,8 @@ protected com.google.protobuf.MapField internalGetMapField(int number) {
             }
         
             @SuppressWarnings({"rawtypes"})
        -    protected com.google.protobuf.MapField internalGetMutableMapField(int number) {
        +    protected com.google.protobuf.MapFieldReflectionAccessor internalGetMutableMapFieldReflection(
        +        int number) {
               switch (number) {
                 case 2:
                   return internalGetMutableMetricCosts();
        @@ -454,7 +479,7 @@ protected com.google.protobuf.MapField internalGetMutableMapField(int number) {
             }
         
             @java.lang.Override
        -    protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
        +    protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
                 internalGetFieldAccessorTable() {
               return com.google.api.QuotaProto.internal_static_google_api_MetricRule_fieldAccessorTable
                   .ensureFieldAccessorsInitialized(
        @@ -464,15 +489,15 @@ protected com.google.protobuf.MapField internalGetMutableMapField(int number) {
             // Construct using com.google.api.MetricRule.newBuilder()
             private Builder() {}
         
        -    private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
        +    private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) {
               super(parent);
             }
         
             @java.lang.Override
             public Builder clear() {
               super.clear();
        +      bitField0_ = 0;
               selector_ = "";
        -
               internalGetMutableMetricCosts().clear();
               return this;
             }
        @@ -499,45 +524,22 @@ public com.google.api.MetricRule build() {
             @java.lang.Override
             public com.google.api.MetricRule buildPartial() {
               com.google.api.MetricRule result = new com.google.api.MetricRule(this);
        -      int from_bitField0_ = bitField0_;
        -      result.selector_ = selector_;
        -      result.metricCosts_ = internalGetMetricCosts();
        -      result.metricCosts_.makeImmutable();
        +      if (bitField0_ != 0) {
        +        buildPartial0(result);
        +      }
               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);
        +    private void buildPartial0(com.google.api.MetricRule result) {
        +      int from_bitField0_ = bitField0_;
        +      if (((from_bitField0_ & 0x00000001) != 0)) {
        +        result.selector_ = selector_;
        +      }
        +      if (((from_bitField0_ & 0x00000002) != 0)) {
        +        result.metricCosts_ = internalGetMetricCosts();
        +        result.metricCosts_.makeImmutable();
        +      }
             }
         
             @java.lang.Override
        @@ -554,9 +556,11 @@ public Builder mergeFrom(com.google.api.MetricRule other) {
               if (other == com.google.api.MetricRule.getDefaultInstance()) return this;
               if (!other.getSelector().isEmpty()) {
                 selector_ = other.selector_;
        +        bitField0_ |= 0x00000001;
                 onChanged();
               }
               internalGetMutableMetricCosts().mergeFrom(other.internalGetMetricCosts());
        +      bitField0_ |= 0x00000002;
               this.mergeUnknownFields(other.getUnknownFields());
               onChanged();
               return this;
        @@ -586,7 +590,7 @@ public Builder mergeFrom(
                     case 10:
                       {
                         selector_ = input.readStringRequireUtf8();
        -
        +                bitField0_ |= 0x00000001;
                         break;
                       } // case 10
                     case 18:
        @@ -598,6 +602,7 @@ public Builder mergeFrom(
                         internalGetMutableMetricCosts()
                             .getMutableMap()
                             .put(metricCosts__.getKey(), metricCosts__.getValue());
        +                bitField0_ |= 0x00000002;
                         break;
                       } // case 18
                     default:
        @@ -620,12 +625,15 @@ public Builder mergeFrom(
             private int bitField0_;
         
             private java.lang.Object selector_ = "";
        +
             /**
              *
              *
              * 
              * Selects the methods to which this rule applies.
        -     * Refer to [selector][google.api.DocumentationRule.selector] for syntax details.
        +     *
        +     * Refer to [selector][google.api.DocumentationRule.selector] for syntax
        +     * details.
              * 
        * * string selector = 1; @@ -643,12 +651,15 @@ public java.lang.String getSelector() { return (java.lang.String) ref; } } + /** * * *
              * Selects the methods to which this rule applies.
        -     * Refer to [selector][google.api.DocumentationRule.selector] for syntax details.
        +     *
        +     * Refer to [selector][google.api.DocumentationRule.selector] for syntax
        +     * details.
              * 
        * * string selector = 1; @@ -666,12 +677,15 @@ public com.google.protobuf.ByteString getSelectorBytes() { return (com.google.protobuf.ByteString) ref; } } + /** * * *
              * Selects the methods to which this rule applies.
        -     * Refer to [selector][google.api.DocumentationRule.selector] for syntax details.
        +     *
        +     * Refer to [selector][google.api.DocumentationRule.selector] for syntax
        +     * details.
              * 
        * * string selector = 1; @@ -683,17 +697,20 @@ public Builder setSelector(java.lang.String value) { if (value == null) { throw new NullPointerException(); } - selector_ = value; + bitField0_ |= 0x00000001; onChanged(); return this; } + /** * * *
              * Selects the methods to which this rule applies.
        -     * Refer to [selector][google.api.DocumentationRule.selector] for syntax details.
        +     *
        +     * Refer to [selector][google.api.DocumentationRule.selector] for syntax
        +     * details.
              * 
        * * string selector = 1; @@ -701,17 +718,20 @@ public Builder setSelector(java.lang.String value) { * @return This builder for chaining. */ public Builder clearSelector() { - selector_ = getDefaultInstance().getSelector(); + bitField0_ = (bitField0_ & ~0x00000001); onChanged(); return this; } + /** * * *
              * Selects the methods to which this rule applies.
        -     * Refer to [selector][google.api.DocumentationRule.selector] for syntax details.
        +     *
        +     * Refer to [selector][google.api.DocumentationRule.selector] for syntax
        +     * details.
              * 
        * * string selector = 1; @@ -724,8 +744,8 @@ public Builder setSelectorBytes(com.google.protobuf.ByteString value) { throw new NullPointerException(); } checkByteStringIsUtf8(value); - selector_ = value; + bitField0_ |= 0x00000001; onChanged(); return this; } @@ -743,8 +763,6 @@ public Builder setSelectorBytes(com.google.protobuf.ByteString value) { private com.google.protobuf.MapField internalGetMutableMetricCosts() { - onChanged(); - ; if (metricCosts_ == null) { metricCosts_ = com.google.protobuf.MapField.newMapField(MetricCostsDefaultEntryHolder.defaultEntry); @@ -752,18 +770,22 @@ public Builder setSelectorBytes(com.google.protobuf.ByteString value) { if (!metricCosts_.isMutable()) { metricCosts_ = metricCosts_.copy(); } + bitField0_ |= 0x00000002; + onChanged(); return metricCosts_; } public int getMetricCostsCount() { return internalGetMetricCosts().getMap().size(); } + /** * * *
              * Metrics to update when the selected methods are called, and the associated
              * cost applied to each metric.
        +     *
              * The key of the map is the metric name, and the values are the amount
              * increased for the metric against which the quota limits are defined.
              * The value must not be negative.
        @@ -778,18 +800,21 @@ public boolean containsMetricCosts(java.lang.String key) {
               }
               return internalGetMetricCosts().getMap().containsKey(key);
             }
        +
             /** Use {@link #getMetricCostsMap()} instead. */
             @java.lang.Override
             @java.lang.Deprecated
             public java.util.Map getMetricCosts() {
               return getMetricCostsMap();
             }
        +
             /**
              *
              *
              * 
              * Metrics to update when the selected methods are called, and the associated
              * cost applied to each metric.
        +     *
              * The key of the map is the metric name, and the values are the amount
              * increased for the metric against which the quota limits are defined.
              * The value must not be negative.
        @@ -801,12 +826,14 @@ public java.util.Map getMetricCosts() {
             public java.util.Map getMetricCostsMap() {
               return internalGetMetricCosts().getMap();
             }
        +
             /**
              *
              *
              * 
              * Metrics to update when the selected methods are called, and the associated
              * cost applied to each metric.
        +     *
              * The key of the map is the metric name, and the values are the amount
              * increased for the metric against which the quota limits are defined.
              * The value must not be negative.
        @@ -822,12 +849,14 @@ public long getMetricCostsOrDefault(java.lang.String key, long defaultValue) {
               java.util.Map map = internalGetMetricCosts().getMap();
               return map.containsKey(key) ? map.get(key) : defaultValue;
             }
        +
             /**
              *
              *
              * 
              * Metrics to update when the selected methods are called, and the associated
              * cost applied to each metric.
        +     *
              * The key of the map is the metric name, and the values are the amount
              * increased for the metric against which the quota limits are defined.
              * The value must not be negative.
        @@ -848,15 +877,18 @@ public long getMetricCostsOrThrow(java.lang.String key) {
             }
         
             public Builder clearMetricCosts() {
        +      bitField0_ = (bitField0_ & ~0x00000002);
               internalGetMutableMetricCosts().getMutableMap().clear();
               return this;
             }
        +
             /**
              *
              *
              * 
              * Metrics to update when the selected methods are called, and the associated
              * cost applied to each metric.
        +     *
              * The key of the map is the metric name, and the values are the amount
              * increased for the metric against which the quota limits are defined.
              * The value must not be negative.
        @@ -871,17 +903,21 @@ public Builder removeMetricCosts(java.lang.String key) {
               internalGetMutableMetricCosts().getMutableMap().remove(key);
               return this;
             }
        +
             /** Use alternate mutation accessors instead. */
             @java.lang.Deprecated
             public java.util.Map getMutableMetricCosts() {
        +      bitField0_ |= 0x00000002;
               return internalGetMutableMetricCosts().getMutableMap();
             }
        +
             /**
              *
              *
              * 
              * Metrics to update when the selected methods are called, and the associated
              * cost applied to each metric.
        +     *
              * The key of the map is the metric name, and the values are the amount
              * increased for the metric against which the quota limits are defined.
              * The value must not be negative.
        @@ -895,14 +931,17 @@ public Builder putMetricCosts(java.lang.String key, long value) {
               }
         
               internalGetMutableMetricCosts().getMutableMap().put(key, value);
        +      bitField0_ |= 0x00000002;
               return this;
             }
        +
             /**
              *
              *
              * 
              * Metrics to update when the selected methods are called, and the associated
              * cost applied to each metric.
        +     *
              * The key of the map is the metric name, and the values are the amount
              * increased for the metric against which the quota limits are defined.
              * The value must not be negative.
        @@ -912,20 +951,10 @@ public Builder putMetricCosts(java.lang.String key, long value) {
              */
             public Builder putAllMetricCosts(java.util.Map values) {
               internalGetMutableMetricCosts().getMutableMap().putAll(values);
        +      bitField0_ |= 0x00000002;
               return this;
             }
         
        -    @java.lang.Override
        -    public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) {
        -      return super.setUnknownFields(unknownFields);
        -    }
        -
        -    @java.lang.Override
        -    public final Builder mergeUnknownFields(
        -        final com.google.protobuf.UnknownFieldSet unknownFields) {
        -      return super.mergeUnknownFields(unknownFields);
        -    }
        -
             // @@protoc_insertion_point(builder_scope:google.api.MetricRule)
           }
         
        diff --git a/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/MetricRuleOrBuilder.java b/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/MetricRuleOrBuilder.java
        index 8f4734544c..4d7317dc80 100644
        --- a/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/MetricRuleOrBuilder.java
        +++ b/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/MetricRuleOrBuilder.java
        @@ -1,5 +1,5 @@
         /*
        - * Copyright 2020 Google LLC
        + * Copyright 2026 Google LLC
          *
          * Licensed under the Apache License, Version 2.0 (the "License");
          * you may not use this file except in compliance with the License.
        @@ -14,10 +14,13 @@
          * limitations under the License.
          */
         // Generated by the protocol buffer compiler.  DO NOT EDIT!
        +// NO CHECKED-IN PROTOBUF GENCODE
         // source: google/api/quota.proto
        +// Protobuf Java Version: 4.33.2
         
         package com.google.api;
         
        +@com.google.protobuf.Generated
         public interface MetricRuleOrBuilder
             extends
             // @@protoc_insertion_point(interface_extends:google.api.MetricRule)
        @@ -28,7 +31,9 @@ public interface MetricRuleOrBuilder
            *
            * 
            * Selects the methods to which this rule applies.
        -   * Refer to [selector][google.api.DocumentationRule.selector] for syntax details.
        +   *
        +   * Refer to [selector][google.api.DocumentationRule.selector] for syntax
        +   * details.
            * 
        * * string selector = 1; @@ -36,12 +41,15 @@ public interface MetricRuleOrBuilder * @return The selector. */ java.lang.String getSelector(); + /** * * *
            * Selects the methods to which this rule applies.
        -   * Refer to [selector][google.api.DocumentationRule.selector] for syntax details.
        +   *
        +   * Refer to [selector][google.api.DocumentationRule.selector] for syntax
        +   * details.
            * 
        * * string selector = 1; @@ -56,6 +64,7 @@ public interface MetricRuleOrBuilder *
            * Metrics to update when the selected methods are called, and the associated
            * cost applied to each metric.
        +   *
            * The key of the map is the metric name, and the values are the amount
            * increased for the metric against which the quota limits are defined.
            * The value must not be negative.
        @@ -64,12 +73,14 @@ public interface MetricRuleOrBuilder
            * map<string, int64> metric_costs = 2;
            */
           int getMetricCostsCount();
        +
           /**
            *
            *
            * 
            * Metrics to update when the selected methods are called, and the associated
            * cost applied to each metric.
        +   *
            * The key of the map is the metric name, and the values are the amount
            * increased for the metric against which the quota limits are defined.
            * The value must not be negative.
        @@ -78,15 +89,18 @@ public interface MetricRuleOrBuilder
            * map<string, int64> metric_costs = 2;
            */
           boolean containsMetricCosts(java.lang.String key);
        +
           /** Use {@link #getMetricCostsMap()} instead. */
           @java.lang.Deprecated
           java.util.Map getMetricCosts();
        +
           /**
            *
            *
            * 
            * Metrics to update when the selected methods are called, and the associated
            * cost applied to each metric.
        +   *
            * The key of the map is the metric name, and the values are the amount
            * increased for the metric against which the quota limits are defined.
            * The value must not be negative.
        @@ -95,12 +109,14 @@ public interface MetricRuleOrBuilder
            * map<string, int64> metric_costs = 2;
            */
           java.util.Map getMetricCostsMap();
        +
           /**
            *
            *
            * 
            * Metrics to update when the selected methods are called, and the associated
            * cost applied to each metric.
        +   *
            * The key of the map is the metric name, and the values are the amount
            * increased for the metric against which the quota limits are defined.
            * The value must not be negative.
        @@ -109,12 +125,14 @@ public interface MetricRuleOrBuilder
            * map<string, int64> metric_costs = 2;
            */
           long getMetricCostsOrDefault(java.lang.String key, long defaultValue);
        +
           /**
            *
            *
            * 
            * Metrics to update when the selected methods are called, and the associated
            * cost applied to each metric.
        +   *
            * The key of the map is the metric name, and the values are the amount
            * increased for the metric against which the quota limits are defined.
            * The value must not be negative.
        diff --git a/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/MonitoredResource.java b/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/MonitoredResource.java
        index 321c7bc7e0..3c6ba1f8fa 100644
        --- a/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/MonitoredResource.java
        +++ b/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/MonitoredResource.java
        @@ -1,5 +1,5 @@
         /*
        - * Copyright 2020 Google LLC
        + * Copyright 2026 Google LLC
          *
          * Licensed under the Apache License, Version 2.0 (the "License");
          * you may not use this file except in compliance with the License.
        @@ -14,7 +14,9 @@
          * limitations under the License.
          */
         // Generated by the protocol buffer compiler.  DO NOT EDIT!
        +// NO CHECKED-IN PROTOBUF GENCODE
         // source: google/api/monitored_resource.proto
        +// Protobuf Java Version: 4.33.2
         
         package com.google.api;
         
        @@ -25,27 +27,42 @@
          * An object representing a resource that can be used for monitoring, logging,
          * billing, or other purposes. Examples include virtual machine instances,
          * databases, and storage devices such as disks. The `type` field identifies a
        - * [MonitoredResourceDescriptor][google.api.MonitoredResourceDescriptor] object that describes the resource's
        - * schema. Information in the `labels` field identifies the actual resource and
        - * its attributes according to the schema. For example, a particular Compute
        - * Engine VM instance could be represented by the following object, because the
        - * [MonitoredResourceDescriptor][google.api.MonitoredResourceDescriptor] for `"gce_instance"` has labels
        + * [MonitoredResourceDescriptor][google.api.MonitoredResourceDescriptor] object
        + * that describes the resource's schema. Information in the `labels` field
        + * identifies the actual resource and its attributes according to the schema.
        + * For example, a particular Compute Engine VM instance could be represented by
        + * the following object, because the
        + * [MonitoredResourceDescriptor][google.api.MonitoredResourceDescriptor] for
        + * `"gce_instance"` has labels
          * `"project_id"`, `"instance_id"` and `"zone"`:
        - *     { "type": "gce_instance",
        - *       "labels": { "project_id": "my-project",
        - *                   "instance_id": "12345678901234",
        - *                   "zone": "us-central1-a" }}
        + *
        + * { "type": "gce_instance",
        + * "labels": { "project_id": "my-project",
        + * "instance_id": "12345678901234",
        + * "zone": "us-central1-a" }}
          * 
        * * Protobuf type {@code google.api.MonitoredResource} */ -public final class MonitoredResource extends com.google.protobuf.GeneratedMessageV3 +@com.google.protobuf.Generated +public final class MonitoredResource extends com.google.protobuf.GeneratedMessage implements // @@protoc_insertion_point(message_implements:google.api.MonitoredResource) MonitoredResourceOrBuilder { private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "MonitoredResource"); + } + // Use MonitoredResource.newBuilder() to construct. - private MonitoredResource(com.google.protobuf.GeneratedMessageV3.Builder builder) { + private MonitoredResource(com.google.protobuf.GeneratedMessage.Builder builder) { super(builder); } @@ -53,17 +70,6 @@ private MonitoredResource() { type_ = ""; } - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new MonitoredResource(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.api.MonitoredResourceProto .internal_static_google_api_MonitoredResource_descriptor; @@ -71,7 +77,8 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { @SuppressWarnings({"rawtypes"}) @java.lang.Override - protected com.google.protobuf.MapField internalGetMapField(int number) { + protected com.google.protobuf.MapFieldReflectionAccessor internalGetMapFieldReflection( + int number) { switch (number) { case 2: return internalGetLabels(); @@ -81,7 +88,7 @@ protected com.google.protobuf.MapField internalGetMapField(int number) { } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.api.MonitoredResourceProto .internal_static_google_api_MonitoredResource_fieldAccessorTable @@ -90,16 +97,21 @@ protected com.google.protobuf.MapField internalGetMapField(int number) { } public static final int TYPE_FIELD_NUMBER = 1; - private volatile java.lang.Object type_; + + @SuppressWarnings("serial") + private volatile java.lang.Object type_ = ""; + /** * * *
            * Required. The monitored resource type. This field must match
        -   * the `type` field of a [MonitoredResourceDescriptor][google.api.MonitoredResourceDescriptor] object. For
        -   * example, the type of a Compute Engine VM instance is `gce_instance`.
        -   * Some descriptors include the service name in the type; for example,
        -   * the type of a Datastream stream is `datastream.googleapis.com/Stream`.
        +   * the `type` field of a
        +   * [MonitoredResourceDescriptor][google.api.MonitoredResourceDescriptor]
        +   * object. For example, the type of a Compute Engine VM instance is
        +   * `gce_instance`. Some descriptors include the service name in the type; for
        +   * example, the type of a Datastream stream is
        +   * `datastream.googleapis.com/Stream`.
            * 
        * * string type = 1; @@ -118,15 +130,18 @@ public java.lang.String getType() { return s; } } + /** * * *
            * Required. The monitored resource type. This field must match
        -   * the `type` field of a [MonitoredResourceDescriptor][google.api.MonitoredResourceDescriptor] object. For
        -   * example, the type of a Compute Engine VM instance is `gce_instance`.
        -   * Some descriptors include the service name in the type; for example,
        -   * the type of a Datastream stream is `datastream.googleapis.com/Stream`.
        +   * the `type` field of a
        +   * [MonitoredResourceDescriptor][google.api.MonitoredResourceDescriptor]
        +   * object. For example, the type of a Compute Engine VM instance is
        +   * `gce_instance`. Some descriptors include the service name in the type; for
        +   * example, the type of a Datastream stream is
        +   * `datastream.googleapis.com/Stream`.
            * 
        * * string type = 1; @@ -159,6 +174,7 @@ private static final class LabelsDefaultEntryHolder { ""); } + @SuppressWarnings("serial") private com.google.protobuf.MapField labels_; private com.google.protobuf.MapField internalGetLabels() { @@ -171,6 +187,7 @@ private com.google.protobuf.MapField interna public int getLabelsCount() { return internalGetLabels().getMap().size(); } + /** * * @@ -189,12 +206,14 @@ public boolean containsLabels(java.lang.String key) { } return internalGetLabels().getMap().containsKey(key); } + /** Use {@link #getLabelsMap()} instead. */ @java.lang.Override @java.lang.Deprecated public java.util.Map getLabels() { return getLabelsMap(); } + /** * * @@ -210,6 +229,7 @@ public java.util.Map getLabels() { public java.util.Map getLabelsMap() { return internalGetLabels().getMap(); } + /** * * @@ -222,13 +242,17 @@ public java.util.Map getLabelsMap() { * map<string, string> labels = 2; */ @java.lang.Override - public java.lang.String getLabelsOrDefault(java.lang.String key, java.lang.String defaultValue) { + 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; } + /** * * @@ -266,10 +290,10 @@ public final boolean isInitialized() { @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(type_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, type_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(type_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, type_); } - com.google.protobuf.GeneratedMessageV3.serializeStringMapTo( + com.google.protobuf.GeneratedMessage.serializeStringMapTo( output, internalGetLabels(), LabelsDefaultEntryHolder.defaultEntry, 2); getUnknownFields().writeTo(output); } @@ -280,8 +304,8 @@ public int getSerializedSize() { if (size != -1) return size; size = 0; - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(type_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, type_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(type_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, type_); } for (java.util.Map.Entry entry : internalGetLabels().getMap().entrySet()) { @@ -368,38 +392,38 @@ public static com.google.api.MonitoredResource parseFrom( public static com.google.api.MonitoredResource parseFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); } public static com.google.api.MonitoredResource parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } public static com.google.api.MonitoredResource parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); } public static com.google.api.MonitoredResource parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( PARSER, input, extensionRegistry); } public static com.google.api.MonitoredResource parseFrom( com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); } public static com.google.api.MonitoredResource parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } @@ -422,10 +446,11 @@ public Builder toBuilder() { } @java.lang.Override - protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { Builder builder = new Builder(parent); return builder; } + /** * * @@ -433,21 +458,24 @@ protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.Build * An object representing a resource that can be used for monitoring, logging, * billing, or other purposes. Examples include virtual machine instances, * databases, and storage devices such as disks. The `type` field identifies a - * [MonitoredResourceDescriptor][google.api.MonitoredResourceDescriptor] object that describes the resource's - * schema. Information in the `labels` field identifies the actual resource and - * its attributes according to the schema. For example, a particular Compute - * Engine VM instance could be represented by the following object, because the - * [MonitoredResourceDescriptor][google.api.MonitoredResourceDescriptor] for `"gce_instance"` has labels + * [MonitoredResourceDescriptor][google.api.MonitoredResourceDescriptor] object + * that describes the resource's schema. Information in the `labels` field + * identifies the actual resource and its attributes according to the schema. + * For example, a particular Compute Engine VM instance could be represented by + * the following object, because the + * [MonitoredResourceDescriptor][google.api.MonitoredResourceDescriptor] for + * `"gce_instance"` has labels * `"project_id"`, `"instance_id"` and `"zone"`: - * { "type": "gce_instance", - * "labels": { "project_id": "my-project", - * "instance_id": "12345678901234", - * "zone": "us-central1-a" }} + * + * { "type": "gce_instance", + * "labels": { "project_id": "my-project", + * "instance_id": "12345678901234", + * "zone": "us-central1-a" }} *
        * * Protobuf type {@code google.api.MonitoredResource} */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder implements // @@protoc_insertion_point(builder_implements:google.api.MonitoredResource) com.google.api.MonitoredResourceOrBuilder { @@ -457,7 +485,8 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } @SuppressWarnings({"rawtypes"}) - protected com.google.protobuf.MapField internalGetMapField(int number) { + protected com.google.protobuf.MapFieldReflectionAccessor internalGetMapFieldReflection( + int number) { switch (number) { case 2: return internalGetLabels(); @@ -467,7 +496,8 @@ protected com.google.protobuf.MapField internalGetMapField(int number) { } @SuppressWarnings({"rawtypes"}) - protected com.google.protobuf.MapField internalGetMutableMapField(int number) { + protected com.google.protobuf.MapFieldReflectionAccessor internalGetMutableMapFieldReflection( + int number) { switch (number) { case 2: return internalGetMutableLabels(); @@ -477,7 +507,7 @@ protected com.google.protobuf.MapField internalGetMutableMapField(int number) { } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.api.MonitoredResourceProto .internal_static_google_api_MonitoredResource_fieldAccessorTable @@ -489,15 +519,15 @@ protected com.google.protobuf.MapField internalGetMutableMapField(int number) { // Construct using com.google.api.MonitoredResource.newBuilder() private Builder() {} - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { super(parent); } @java.lang.Override public Builder clear() { super.clear(); + bitField0_ = 0; type_ = ""; - internalGetMutableLabels().clear(); return this; } @@ -525,45 +555,22 @@ public com.google.api.MonitoredResource build() { @java.lang.Override public com.google.api.MonitoredResource buildPartial() { com.google.api.MonitoredResource result = new com.google.api.MonitoredResource(this); - int from_bitField0_ = bitField0_; - result.type_ = type_; - result.labels_ = internalGetLabels(); - result.labels_.makeImmutable(); + if (bitField0_ != 0) { + buildPartial0(result); + } 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); + private void buildPartial0(com.google.api.MonitoredResource result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.type_ = type_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.labels_ = internalGetLabels(); + result.labels_.makeImmutable(); + } } @java.lang.Override @@ -580,9 +587,11 @@ public Builder mergeFrom(com.google.api.MonitoredResource other) { if (other == com.google.api.MonitoredResource.getDefaultInstance()) return this; if (!other.getType().isEmpty()) { type_ = other.type_; + bitField0_ |= 0x00000001; onChanged(); } internalGetMutableLabels().mergeFrom(other.internalGetLabels()); + bitField0_ |= 0x00000002; this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; @@ -612,7 +621,7 @@ public Builder mergeFrom( case 10: { type_ = input.readStringRequireUtf8(); - + bitField0_ |= 0x00000001; break; } // case 10 case 18: @@ -624,6 +633,7 @@ public Builder mergeFrom( internalGetMutableLabels() .getMutableMap() .put(labels__.getKey(), labels__.getValue()); + bitField0_ |= 0x00000002; break; } // case 18 default: @@ -646,15 +656,18 @@ public Builder mergeFrom( private int bitField0_; private java.lang.Object type_ = ""; + /** * * *
              * Required. The monitored resource type. This field must match
        -     * the `type` field of a [MonitoredResourceDescriptor][google.api.MonitoredResourceDescriptor] object. For
        -     * example, the type of a Compute Engine VM instance is `gce_instance`.
        -     * Some descriptors include the service name in the type; for example,
        -     * the type of a Datastream stream is `datastream.googleapis.com/Stream`.
        +     * the `type` field of a
        +     * [MonitoredResourceDescriptor][google.api.MonitoredResourceDescriptor]
        +     * object. For example, the type of a Compute Engine VM instance is
        +     * `gce_instance`. Some descriptors include the service name in the type; for
        +     * example, the type of a Datastream stream is
        +     * `datastream.googleapis.com/Stream`.
              * 
        * * string type = 1; @@ -672,15 +685,18 @@ public java.lang.String getType() { return (java.lang.String) ref; } } + /** * * *
              * Required. The monitored resource type. This field must match
        -     * the `type` field of a [MonitoredResourceDescriptor][google.api.MonitoredResourceDescriptor] object. For
        -     * example, the type of a Compute Engine VM instance is `gce_instance`.
        -     * Some descriptors include the service name in the type; for example,
        -     * the type of a Datastream stream is `datastream.googleapis.com/Stream`.
        +     * the `type` field of a
        +     * [MonitoredResourceDescriptor][google.api.MonitoredResourceDescriptor]
        +     * object. For example, the type of a Compute Engine VM instance is
        +     * `gce_instance`. Some descriptors include the service name in the type; for
        +     * example, the type of a Datastream stream is
        +     * `datastream.googleapis.com/Stream`.
              * 
        * * string type = 1; @@ -698,15 +714,18 @@ public com.google.protobuf.ByteString getTypeBytes() { return (com.google.protobuf.ByteString) ref; } } + /** * * *
              * Required. The monitored resource type. This field must match
        -     * the `type` field of a [MonitoredResourceDescriptor][google.api.MonitoredResourceDescriptor] object. For
        -     * example, the type of a Compute Engine VM instance is `gce_instance`.
        -     * Some descriptors include the service name in the type; for example,
        -     * the type of a Datastream stream is `datastream.googleapis.com/Stream`.
        +     * the `type` field of a
        +     * [MonitoredResourceDescriptor][google.api.MonitoredResourceDescriptor]
        +     * object. For example, the type of a Compute Engine VM instance is
        +     * `gce_instance`. Some descriptors include the service name in the type; for
        +     * example, the type of a Datastream stream is
        +     * `datastream.googleapis.com/Stream`.
              * 
        * * string type = 1; @@ -718,20 +737,23 @@ public Builder setType(java.lang.String value) { if (value == null) { throw new NullPointerException(); } - type_ = value; + bitField0_ |= 0x00000001; onChanged(); return this; } + /** * * *
              * Required. The monitored resource type. This field must match
        -     * the `type` field of a [MonitoredResourceDescriptor][google.api.MonitoredResourceDescriptor] object. For
        -     * example, the type of a Compute Engine VM instance is `gce_instance`.
        -     * Some descriptors include the service name in the type; for example,
        -     * the type of a Datastream stream is `datastream.googleapis.com/Stream`.
        +     * the `type` field of a
        +     * [MonitoredResourceDescriptor][google.api.MonitoredResourceDescriptor]
        +     * object. For example, the type of a Compute Engine VM instance is
        +     * `gce_instance`. Some descriptors include the service name in the type; for
        +     * example, the type of a Datastream stream is
        +     * `datastream.googleapis.com/Stream`.
              * 
        * * string type = 1; @@ -739,20 +761,23 @@ public Builder setType(java.lang.String value) { * @return This builder for chaining. */ public Builder clearType() { - type_ = getDefaultInstance().getType(); + bitField0_ = (bitField0_ & ~0x00000001); onChanged(); return this; } + /** * * *
              * Required. The monitored resource type. This field must match
        -     * the `type` field of a [MonitoredResourceDescriptor][google.api.MonitoredResourceDescriptor] object. For
        -     * example, the type of a Compute Engine VM instance is `gce_instance`.
        -     * Some descriptors include the service name in the type; for example,
        -     * the type of a Datastream stream is `datastream.googleapis.com/Stream`.
        +     * the `type` field of a
        +     * [MonitoredResourceDescriptor][google.api.MonitoredResourceDescriptor]
        +     * object. For example, the type of a Compute Engine VM instance is
        +     * `gce_instance`. Some descriptors include the service name in the type; for
        +     * example, the type of a Datastream stream is
        +     * `datastream.googleapis.com/Stream`.
              * 
        * * string type = 1; @@ -765,8 +790,8 @@ public Builder setTypeBytes(com.google.protobuf.ByteString value) { throw new NullPointerException(); } checkByteStringIsUtf8(value); - type_ = value; + bitField0_ |= 0x00000001; onChanged(); return this; } @@ -782,20 +807,21 @@ private com.google.protobuf.MapField interna private com.google.protobuf.MapField internalGetMutableLabels() { - onChanged(); - ; if (labels_ == null) { labels_ = com.google.protobuf.MapField.newMapField(LabelsDefaultEntryHolder.defaultEntry); } if (!labels_.isMutable()) { labels_ = labels_.copy(); } + bitField0_ |= 0x00000002; + onChanged(); return labels_; } public int getLabelsCount() { return internalGetLabels().getMap().size(); } + /** * * @@ -814,12 +840,14 @@ public boolean containsLabels(java.lang.String key) { } return internalGetLabels().getMap().containsKey(key); } + /** Use {@link #getLabelsMap()} instead. */ @java.lang.Override @java.lang.Deprecated public java.util.Map getLabels() { return getLabelsMap(); } + /** * * @@ -835,6 +863,7 @@ public java.util.Map getLabels() { public java.util.Map getLabelsMap() { return internalGetLabels().getMap(); } + /** * * @@ -847,14 +876,17 @@ public java.util.Map getLabelsMap() { * map<string, string> labels = 2; */ @java.lang.Override - public java.lang.String getLabelsOrDefault( - java.lang.String key, java.lang.String defaultValue) { + 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; } + /** * * @@ -879,9 +911,11 @@ public java.lang.String getLabelsOrThrow(java.lang.String key) { } public Builder clearLabels() { + bitField0_ = (bitField0_ & ~0x00000002); internalGetMutableLabels().getMutableMap().clear(); return this; } + /** * * @@ -900,11 +934,14 @@ public Builder removeLabels(java.lang.String key) { internalGetMutableLabels().getMutableMap().remove(key); return this; } + /** Use alternate mutation accessors instead. */ @java.lang.Deprecated public java.util.Map getMutableLabels() { + bitField0_ |= 0x00000002; return internalGetMutableLabels().getMutableMap(); } + /** * * @@ -923,10 +960,11 @@ public Builder putLabels(java.lang.String key, java.lang.String value) { if (value == null) { throw new NullPointerException("map value"); } - internalGetMutableLabels().getMutableMap().put(key, value); + bitField0_ |= 0x00000002; return this; } + /** * * @@ -940,20 +978,10 @@ public Builder putLabels(java.lang.String key, java.lang.String value) { */ public Builder putAllLabels(java.util.Map values) { internalGetMutableLabels().getMutableMap().putAll(values); + bitField0_ |= 0x00000002; return this; } - @java.lang.Override - public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - // @@protoc_insertion_point(builder_scope:google.api.MonitoredResource) } diff --git a/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/MonitoredResourceDescriptor.java b/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/MonitoredResourceDescriptor.java index 955dbd88b6..c1a4b700b1 100644 --- a/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/MonitoredResourceDescriptor.java +++ b/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/MonitoredResourceDescriptor.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,9 @@ * limitations under the License. */ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: google/api/monitored_resource.proto +// Protobuf Java Version: 4.33.2 package com.google.api; @@ -22,11 +24,13 @@ * * *
        - * An object that describes the schema of a [MonitoredResource][google.api.MonitoredResource] object using a
        - * type name and a set of labels.  For example, the monitored resource
        - * descriptor for Google Compute Engine VM instances has a type of
        + * An object that describes the schema of a
        + * [MonitoredResource][google.api.MonitoredResource] object using a type name
        + * and a set of labels.  For example, the monitored resource descriptor for
        + * Google Compute Engine VM instances has a type of
          * `"gce_instance"` and specifies the use of the labels `"instance_id"` and
          * `"zone"` to identify particular VM instances.
        + *
          * Different APIs can support different monitored resource types. APIs generally
          * provide a `list` method that returns the monitored resource descriptors used
          * by the API.
        @@ -34,13 +38,25 @@
          *
          * Protobuf type {@code google.api.MonitoredResourceDescriptor}
          */
        -public final class MonitoredResourceDescriptor extends com.google.protobuf.GeneratedMessageV3
        +@com.google.protobuf.Generated
        +public final class MonitoredResourceDescriptor extends com.google.protobuf.GeneratedMessage
             implements
             // @@protoc_insertion_point(message_implements:google.api.MonitoredResourceDescriptor)
             MonitoredResourceDescriptorOrBuilder {
           private static final long serialVersionUID = 0L;
        +
        +  static {
        +    com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion(
        +        com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC,
        +        /* major= */ 4,
        +        /* minor= */ 33,
        +        /* patch= */ 2,
        +        /* suffix= */ "",
        +        "MonitoredResourceDescriptor");
        +  }
        +
           // Use MonitoredResourceDescriptor.newBuilder() to construct.
        -  private MonitoredResourceDescriptor(com.google.protobuf.GeneratedMessageV3.Builder builder) {
        +  private MonitoredResourceDescriptor(com.google.protobuf.GeneratedMessage.Builder builder) {
             super(builder);
           }
         
        @@ -53,24 +69,13 @@ private MonitoredResourceDescriptor() {
             launchStage_ = 0;
           }
         
        -  @java.lang.Override
        -  @SuppressWarnings({"unused"})
        -  protected java.lang.Object newInstance(UnusedPrivateParameter unused) {
        -    return new MonitoredResourceDescriptor();
        -  }
        -
        -  @java.lang.Override
        -  public final com.google.protobuf.UnknownFieldSet getUnknownFields() {
        -    return this.unknownFields;
        -  }
        -
           public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
             return com.google.api.MonitoredResourceProto
                 .internal_static_google_api_MonitoredResourceDescriptor_descriptor;
           }
         
           @java.lang.Override
        -  protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
        +  protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
               internalGetFieldAccessorTable() {
             return com.google.api.MonitoredResourceProto
                 .internal_static_google_api_MonitoredResourceDescriptor_fieldAccessorTable
        @@ -80,7 +85,10 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
           }
         
           public static final int NAME_FIELD_NUMBER = 5;
        -  private volatile java.lang.Object name_;
        +
        +  @SuppressWarnings("serial")
        +  private volatile java.lang.Object name_ = "";
        +
           /**
            *
            *
        @@ -109,6 +117,7 @@ public java.lang.String getName() {
               return s;
             }
           }
        +
           /**
            *
            *
        @@ -139,15 +148,18 @@ public com.google.protobuf.ByteString getNameBytes() {
           }
         
           public static final int TYPE_FIELD_NUMBER = 1;
        -  private volatile java.lang.Object type_;
        +
        +  @SuppressWarnings("serial")
        +  private volatile java.lang.Object type_ = "";
        +
           /**
            *
            *
            * 
            * Required. The monitored resource type. For example, the type
            * `"cloudsql_database"` represents databases in Google Cloud SQL.
        -   *  For a list of types, see [Monitoring resource
        -   *  types](https://cloud.google.com/monitoring/api/resources)
        +   * For a list of types, see [Monitored resource
        +   * types](https://cloud.google.com/monitoring/api/resources)
            * and [Logging resource
            * types](https://cloud.google.com/logging/docs/api/v2/resource-list).
            * 
        @@ -168,14 +180,15 @@ public java.lang.String getType() { return s; } } + /** * * *
            * Required. The monitored resource type. For example, the type
            * `"cloudsql_database"` represents databases in Google Cloud SQL.
        -   *  For a list of types, see [Monitoring resource
        -   *  types](https://cloud.google.com/monitoring/api/resources)
        +   * For a list of types, see [Monitored resource
        +   * types](https://cloud.google.com/monitoring/api/resources)
            * and [Logging resource
            * types](https://cloud.google.com/logging/docs/api/v2/resource-list).
            * 
        @@ -198,7 +211,10 @@ public com.google.protobuf.ByteString getTypeBytes() { } public static final int DISPLAY_NAME_FIELD_NUMBER = 2; - private volatile java.lang.Object displayName_; + + @SuppressWarnings("serial") + private volatile java.lang.Object displayName_ = ""; + /** * * @@ -225,6 +241,7 @@ public java.lang.String getDisplayName() { return s; } } + /** * * @@ -253,7 +270,10 @@ public com.google.protobuf.ByteString getDisplayNameBytes() { } public static final int DESCRIPTION_FIELD_NUMBER = 3; - private volatile java.lang.Object description_; + + @SuppressWarnings("serial") + private volatile java.lang.Object description_ = ""; + /** * * @@ -278,6 +298,7 @@ public java.lang.String getDescription() { return s; } } + /** * * @@ -304,7 +325,10 @@ public com.google.protobuf.ByteString getDescriptionBytes() { } public static final int LABELS_FIELD_NUMBER = 4; + + @SuppressWarnings("serial") private java.util.List labels_; + /** * * @@ -320,6 +344,7 @@ public com.google.protobuf.ByteString getDescriptionBytes() { public java.util.List getLabelsList() { return labels_; } + /** * * @@ -336,6 +361,7 @@ public java.util.List getLabelsList() { getLabelsOrBuilderList() { return labels_; } + /** * * @@ -351,6 +377,7 @@ public java.util.List getLabelsList() { public int getLabelsCount() { return labels_.size(); } + /** * * @@ -366,6 +393,7 @@ public int getLabelsCount() { public com.google.api.LabelDescriptor getLabels(int index) { return labels_.get(index); } + /** * * @@ -383,7 +411,8 @@ public com.google.api.LabelDescriptorOrBuilder getLabelsOrBuilder(int index) { } public static final int LAUNCH_STAGE_FIELD_NUMBER = 7; - private int launchStage_; + private int launchStage_ = 0; + /** * * @@ -399,6 +428,7 @@ public com.google.api.LabelDescriptorOrBuilder getLabelsOrBuilder(int index) { public int getLaunchStageValue() { return launchStage_; } + /** * * @@ -412,8 +442,7 @@ public int getLaunchStageValue() { */ @java.lang.Override public com.google.api.LaunchStage getLaunchStage() { - @SuppressWarnings("deprecation") - com.google.api.LaunchStage result = com.google.api.LaunchStage.valueOf(launchStage_); + com.google.api.LaunchStage result = com.google.api.LaunchStage.forNumber(launchStage_); return result == null ? com.google.api.LaunchStage.UNRECOGNIZED : result; } @@ -431,20 +460,20 @@ public final boolean isInitialized() { @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(type_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, type_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(type_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, type_); } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(displayName_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 2, displayName_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(displayName_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, displayName_); } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(description_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 3, description_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(description_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 3, description_); } for (int i = 0; i < labels_.size(); i++) { output.writeMessage(4, labels_.get(i)); } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 5, name_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 5, name_); } if (launchStage_ != com.google.api.LaunchStage.LAUNCH_STAGE_UNSPECIFIED.getNumber()) { output.writeEnum(7, launchStage_); @@ -458,20 +487,20 @@ public int getSerializedSize() { if (size != -1) return size; size = 0; - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(type_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, type_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(type_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, type_); } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(displayName_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, displayName_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(displayName_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, displayName_); } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(description_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, description_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(description_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(3, description_); } for (int i = 0; i < labels_.size(); i++) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, labels_.get(i)); } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, name_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(5, name_); } if (launchStage_ != com.google.api.LaunchStage.LAUNCH_STAGE_UNSPECIFIED.getNumber()) { size += com.google.protobuf.CodedOutputStream.computeEnumSize(7, launchStage_); @@ -565,38 +594,38 @@ public static com.google.api.MonitoredResourceDescriptor parseFrom( public static com.google.api.MonitoredResourceDescriptor parseFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); } public static com.google.api.MonitoredResourceDescriptor parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } public static com.google.api.MonitoredResourceDescriptor parseDelimitedFrom( java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); } public static com.google.api.MonitoredResourceDescriptor parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( PARSER, input, extensionRegistry); } public static com.google.api.MonitoredResourceDescriptor parseFrom( com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); } public static com.google.api.MonitoredResourceDescriptor parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } @@ -619,19 +648,22 @@ public Builder toBuilder() { } @java.lang.Override - protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { Builder builder = new Builder(parent); return builder; } + /** * * *
        -   * An object that describes the schema of a [MonitoredResource][google.api.MonitoredResource] object using a
        -   * type name and a set of labels.  For example, the monitored resource
        -   * descriptor for Google Compute Engine VM instances has a type of
        +   * An object that describes the schema of a
        +   * [MonitoredResource][google.api.MonitoredResource] object using a type name
        +   * and a set of labels.  For example, the monitored resource descriptor for
        +   * Google Compute Engine VM instances has a type of
            * `"gce_instance"` and specifies the use of the labels `"instance_id"` and
            * `"zone"` to identify particular VM instances.
        +   *
            * Different APIs can support different monitored resource types. APIs generally
            * provide a `list` method that returns the monitored resource descriptors used
            * by the API.
        @@ -639,7 +671,7 @@ protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.Build
            *
            * Protobuf type {@code google.api.MonitoredResourceDescriptor}
            */
        -  public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder
        +  public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder
               implements
               // @@protoc_insertion_point(builder_implements:google.api.MonitoredResourceDescriptor)
               com.google.api.MonitoredResourceDescriptorOrBuilder {
        @@ -649,7 +681,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
             }
         
             @java.lang.Override
        -    protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
        +    protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
                 internalGetFieldAccessorTable() {
               return com.google.api.MonitoredResourceProto
                   .internal_static_google_api_MonitoredResourceDescriptor_fieldAccessorTable
        @@ -661,30 +693,26 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
             // Construct using com.google.api.MonitoredResourceDescriptor.newBuilder()
             private Builder() {}
         
        -    private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
        +    private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) {
               super(parent);
             }
         
             @java.lang.Override
             public Builder clear() {
               super.clear();
        +      bitField0_ = 0;
               name_ = "";
        -
               type_ = "";
        -
               displayName_ = "";
        -
               description_ = "";
        -
               if (labelsBuilder_ == null) {
                 labels_ = java.util.Collections.emptyList();
               } else {
                 labels_ = null;
                 labelsBuilder_.clear();
               }
        -      bitField0_ = (bitField0_ & ~0x00000001);
        +      bitField0_ = (bitField0_ & ~0x00000010);
               launchStage_ = 0;
        -
               return this;
             }
         
        @@ -712,56 +740,43 @@ public com.google.api.MonitoredResourceDescriptor build() {
             public com.google.api.MonitoredResourceDescriptor buildPartial() {
               com.google.api.MonitoredResourceDescriptor result =
                   new com.google.api.MonitoredResourceDescriptor(this);
        -      int from_bitField0_ = bitField0_;
        -      result.name_ = name_;
        -      result.type_ = type_;
        -      result.displayName_ = displayName_;
        -      result.description_ = description_;
        +      buildPartialRepeatedFields(result);
        +      if (bitField0_ != 0) {
        +        buildPartial0(result);
        +      }
        +      onBuilt();
        +      return result;
        +    }
        +
        +    private void buildPartialRepeatedFields(com.google.api.MonitoredResourceDescriptor result) {
               if (labelsBuilder_ == null) {
        -        if (((bitField0_ & 0x00000001) != 0)) {
        +        if (((bitField0_ & 0x00000010) != 0)) {
                   labels_ = java.util.Collections.unmodifiableList(labels_);
        -          bitField0_ = (bitField0_ & ~0x00000001);
        +          bitField0_ = (bitField0_ & ~0x00000010);
                 }
                 result.labels_ = labels_;
               } else {
                 result.labels_ = labelsBuilder_.build();
               }
        -      result.launchStage_ = launchStage_;
        -      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);
        +    private void buildPartial0(com.google.api.MonitoredResourceDescriptor result) {
        +      int from_bitField0_ = bitField0_;
        +      if (((from_bitField0_ & 0x00000001) != 0)) {
        +        result.name_ = name_;
        +      }
        +      if (((from_bitField0_ & 0x00000002) != 0)) {
        +        result.type_ = type_;
        +      }
        +      if (((from_bitField0_ & 0x00000004) != 0)) {
        +        result.displayName_ = displayName_;
        +      }
        +      if (((from_bitField0_ & 0x00000008) != 0)) {
        +        result.description_ = description_;
        +      }
        +      if (((from_bitField0_ & 0x00000020) != 0)) {
        +        result.launchStage_ = launchStage_;
        +      }
             }
         
             @java.lang.Override
        @@ -778,25 +793,29 @@ public Builder mergeFrom(com.google.api.MonitoredResourceDescriptor other) {
               if (other == com.google.api.MonitoredResourceDescriptor.getDefaultInstance()) return this;
               if (!other.getName().isEmpty()) {
                 name_ = other.name_;
        +        bitField0_ |= 0x00000001;
                 onChanged();
               }
               if (!other.getType().isEmpty()) {
                 type_ = other.type_;
        +        bitField0_ |= 0x00000002;
                 onChanged();
               }
               if (!other.getDisplayName().isEmpty()) {
                 displayName_ = other.displayName_;
        +        bitField0_ |= 0x00000004;
                 onChanged();
               }
               if (!other.getDescription().isEmpty()) {
                 description_ = other.description_;
        +        bitField0_ |= 0x00000008;
                 onChanged();
               }
               if (labelsBuilder_ == null) {
                 if (!other.labels_.isEmpty()) {
                   if (labels_.isEmpty()) {
                     labels_ = other.labels_;
        -            bitField0_ = (bitField0_ & ~0x00000001);
        +            bitField0_ = (bitField0_ & ~0x00000010);
                   } else {
                     ensureLabelsIsMutable();
                     labels_.addAll(other.labels_);
        @@ -809,10 +828,10 @@ public Builder mergeFrom(com.google.api.MonitoredResourceDescriptor other) {
                     labelsBuilder_.dispose();
                     labelsBuilder_ = null;
                     labels_ = other.labels_;
        -            bitField0_ = (bitField0_ & ~0x00000001);
        +            bitField0_ = (bitField0_ & ~0x00000010);
                     labelsBuilder_ =
        -                com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders
        -                    ? getLabelsFieldBuilder()
        +                com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders
        +                    ? internalGetLabelsFieldBuilder()
                             : null;
                   } else {
                     labelsBuilder_.addAllMessages(other.labels_);
        @@ -851,19 +870,19 @@ public Builder mergeFrom(
                     case 10:
                       {
                         type_ = input.readStringRequireUtf8();
        -
        +                bitField0_ |= 0x00000002;
                         break;
                       } // case 10
                     case 18:
                       {
                         displayName_ = input.readStringRequireUtf8();
        -
        +                bitField0_ |= 0x00000004;
                         break;
                       } // case 18
                     case 26:
                       {
                         description_ = input.readStringRequireUtf8();
        -
        +                bitField0_ |= 0x00000008;
                         break;
                       } // case 26
                     case 34:
        @@ -881,13 +900,13 @@ public Builder mergeFrom(
                     case 42:
                       {
                         name_ = input.readStringRequireUtf8();
        -
        +                bitField0_ |= 0x00000001;
                         break;
                       } // case 42
                     case 56:
                       {
                         launchStage_ = input.readEnum();
        -
        +                bitField0_ |= 0x00000020;
                         break;
                       } // case 56
                     default:
        @@ -910,6 +929,7 @@ public Builder mergeFrom(
             private int bitField0_;
         
             private java.lang.Object name_ = "";
        +
             /**
              *
              *
        @@ -937,6 +957,7 @@ public java.lang.String getName() {
                 return (java.lang.String) ref;
               }
             }
        +
             /**
              *
              *
        @@ -964,6 +985,7 @@ public com.google.protobuf.ByteString getNameBytes() {
                 return (com.google.protobuf.ByteString) ref;
               }
             }
        +
             /**
              *
              *
        @@ -985,11 +1007,12 @@ public Builder setName(java.lang.String value) {
               if (value == null) {
                 throw new NullPointerException();
               }
        -
               name_ = value;
        +      bitField0_ |= 0x00000001;
               onChanged();
               return this;
             }
        +
             /**
              *
              *
        @@ -1007,11 +1030,12 @@ public Builder setName(java.lang.String value) {
              * @return This builder for chaining.
              */
             public Builder clearName() {
        -
               name_ = getDefaultInstance().getName();
        +      bitField0_ = (bitField0_ & ~0x00000001);
               onChanged();
               return this;
             }
        +
             /**
              *
              *
        @@ -1034,21 +1058,22 @@ public Builder setNameBytes(com.google.protobuf.ByteString value) {
                 throw new NullPointerException();
               }
               checkByteStringIsUtf8(value);
        -
               name_ = value;
        +      bitField0_ |= 0x00000001;
               onChanged();
               return this;
             }
         
             private java.lang.Object type_ = "";
        +
             /**
              *
              *
              * 
              * Required. The monitored resource type. For example, the type
              * `"cloudsql_database"` represents databases in Google Cloud SQL.
        -     *  For a list of types, see [Monitoring resource
        -     *  types](https://cloud.google.com/monitoring/api/resources)
        +     * For a list of types, see [Monitored resource
        +     * types](https://cloud.google.com/monitoring/api/resources)
              * and [Logging resource
              * types](https://cloud.google.com/logging/docs/api/v2/resource-list).
              * 
        @@ -1068,14 +1093,15 @@ public java.lang.String getType() { return (java.lang.String) ref; } } + /** * * *
              * Required. The monitored resource type. For example, the type
              * `"cloudsql_database"` represents databases in Google Cloud SQL.
        -     *  For a list of types, see [Monitoring resource
        -     *  types](https://cloud.google.com/monitoring/api/resources)
        +     * For a list of types, see [Monitored resource
        +     * types](https://cloud.google.com/monitoring/api/resources)
              * and [Logging resource
              * types](https://cloud.google.com/logging/docs/api/v2/resource-list).
              * 
        @@ -1095,14 +1121,15 @@ public com.google.protobuf.ByteString getTypeBytes() { return (com.google.protobuf.ByteString) ref; } } + /** * * *
              * Required. The monitored resource type. For example, the type
              * `"cloudsql_database"` represents databases in Google Cloud SQL.
        -     *  For a list of types, see [Monitoring resource
        -     *  types](https://cloud.google.com/monitoring/api/resources)
        +     * For a list of types, see [Monitored resource
        +     * types](https://cloud.google.com/monitoring/api/resources)
              * and [Logging resource
              * types](https://cloud.google.com/logging/docs/api/v2/resource-list).
              * 
        @@ -1116,19 +1143,20 @@ public Builder setType(java.lang.String value) { if (value == null) { throw new NullPointerException(); } - type_ = value; + bitField0_ |= 0x00000002; onChanged(); return this; } + /** * * *
              * Required. The monitored resource type. For example, the type
              * `"cloudsql_database"` represents databases in Google Cloud SQL.
        -     *  For a list of types, see [Monitoring resource
        -     *  types](https://cloud.google.com/monitoring/api/resources)
        +     * For a list of types, see [Monitored resource
        +     * types](https://cloud.google.com/monitoring/api/resources)
              * and [Logging resource
              * types](https://cloud.google.com/logging/docs/api/v2/resource-list).
              * 
        @@ -1138,19 +1166,20 @@ public Builder setType(java.lang.String value) { * @return This builder for chaining. */ public Builder clearType() { - type_ = getDefaultInstance().getType(); + bitField0_ = (bitField0_ & ~0x00000002); onChanged(); return this; } + /** * * *
              * Required. The monitored resource type. For example, the type
              * `"cloudsql_database"` represents databases in Google Cloud SQL.
        -     *  For a list of types, see [Monitoring resource
        -     *  types](https://cloud.google.com/monitoring/api/resources)
        +     * For a list of types, see [Monitored resource
        +     * types](https://cloud.google.com/monitoring/api/resources)
              * and [Logging resource
              * types](https://cloud.google.com/logging/docs/api/v2/resource-list).
              * 
        @@ -1165,13 +1194,14 @@ public Builder setTypeBytes(com.google.protobuf.ByteString value) { throw new NullPointerException(); } checkByteStringIsUtf8(value); - type_ = value; + bitField0_ |= 0x00000002; onChanged(); return this; } private java.lang.Object displayName_ = ""; + /** * * @@ -1197,6 +1227,7 @@ public java.lang.String getDisplayName() { return (java.lang.String) ref; } } + /** * * @@ -1222,6 +1253,7 @@ public com.google.protobuf.ByteString getDisplayNameBytes() { return (com.google.protobuf.ByteString) ref; } } + /** * * @@ -1241,11 +1273,12 @@ public Builder setDisplayName(java.lang.String value) { if (value == null) { throw new NullPointerException(); } - displayName_ = value; + bitField0_ |= 0x00000004; onChanged(); return this; } + /** * * @@ -1261,11 +1294,12 @@ public Builder setDisplayName(java.lang.String value) { * @return This builder for chaining. */ public Builder clearDisplayName() { - displayName_ = getDefaultInstance().getDisplayName(); + bitField0_ = (bitField0_ & ~0x00000004); onChanged(); return this; } + /** * * @@ -1286,13 +1320,14 @@ public Builder setDisplayNameBytes(com.google.protobuf.ByteString value) { throw new NullPointerException(); } checkByteStringIsUtf8(value); - displayName_ = value; + bitField0_ |= 0x00000004; onChanged(); return this; } private java.lang.Object description_ = ""; + /** * * @@ -1316,6 +1351,7 @@ public java.lang.String getDescription() { return (java.lang.String) ref; } } + /** * * @@ -1339,6 +1375,7 @@ public com.google.protobuf.ByteString getDescriptionBytes() { return (com.google.protobuf.ByteString) ref; } } + /** * * @@ -1356,11 +1393,12 @@ public Builder setDescription(java.lang.String value) { if (value == null) { throw new NullPointerException(); } - description_ = value; + bitField0_ |= 0x00000008; onChanged(); return this; } + /** * * @@ -1374,11 +1412,12 @@ public Builder setDescription(java.lang.String value) { * @return This builder for chaining. */ public Builder clearDescription() { - description_ = getDefaultInstance().getDescription(); + bitField0_ = (bitField0_ & ~0x00000008); onChanged(); return this; } + /** * * @@ -1397,8 +1436,8 @@ public Builder setDescriptionBytes(com.google.protobuf.ByteString value) { throw new NullPointerException(); } checkByteStringIsUtf8(value); - description_ = value; + bitField0_ |= 0x00000008; onChanged(); return this; } @@ -1407,13 +1446,13 @@ public Builder setDescriptionBytes(com.google.protobuf.ByteString value) { java.util.Collections.emptyList(); private void ensureLabelsIsMutable() { - if (!((bitField0_ & 0x00000001) != 0)) { + if (!((bitField0_ & 0x00000010) != 0)) { labels_ = new java.util.ArrayList(labels_); - bitField0_ |= 0x00000001; + bitField0_ |= 0x00000010; } } - private com.google.protobuf.RepeatedFieldBuilderV3< + private com.google.protobuf.RepeatedFieldBuilder< com.google.api.LabelDescriptor, com.google.api.LabelDescriptor.Builder, com.google.api.LabelDescriptorOrBuilder> @@ -1437,6 +1476,7 @@ public java.util.List getLabelsList() { return labelsBuilder_.getMessageList(); } } + /** * * @@ -1455,6 +1495,7 @@ public int getLabelsCount() { return labelsBuilder_.getCount(); } } + /** * * @@ -1473,6 +1514,7 @@ public com.google.api.LabelDescriptor getLabels(int index) { return labelsBuilder_.getMessage(index); } } + /** * * @@ -1497,6 +1539,7 @@ public Builder setLabels(int index, com.google.api.LabelDescriptor value) { } return this; } + /** * * @@ -1518,6 +1561,7 @@ public Builder setLabels(int index, com.google.api.LabelDescriptor.Builder build } return this; } + /** * * @@ -1542,6 +1586,7 @@ public Builder addLabels(com.google.api.LabelDescriptor value) { } return this; } + /** * * @@ -1566,6 +1611,7 @@ public Builder addLabels(int index, com.google.api.LabelDescriptor value) { } return this; } + /** * * @@ -1587,6 +1633,7 @@ public Builder addLabels(com.google.api.LabelDescriptor.Builder builderForValue) } return this; } + /** * * @@ -1608,6 +1655,7 @@ public Builder addLabels(int index, com.google.api.LabelDescriptor.Builder build } return this; } + /** * * @@ -1630,6 +1678,7 @@ public Builder addAllLabels( } return this; } + /** * * @@ -1644,13 +1693,14 @@ public Builder addAllLabels( public Builder clearLabels() { if (labelsBuilder_ == null) { labels_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); + bitField0_ = (bitField0_ & ~0x00000010); onChanged(); } else { labelsBuilder_.clear(); } return this; } + /** * * @@ -1672,6 +1722,7 @@ public Builder removeLabels(int index) { } return this; } + /** * * @@ -1684,8 +1735,9 @@ public Builder removeLabels(int index) { * repeated .google.api.LabelDescriptor labels = 4; */ public com.google.api.LabelDescriptor.Builder getLabelsBuilder(int index) { - return getLabelsFieldBuilder().getBuilder(index); + return internalGetLabelsFieldBuilder().getBuilder(index); } + /** * * @@ -1704,6 +1756,7 @@ public com.google.api.LabelDescriptorOrBuilder getLabelsOrBuilder(int index) { return labelsBuilder_.getMessageOrBuilder(index); } } + /** * * @@ -1723,6 +1776,7 @@ public com.google.api.LabelDescriptorOrBuilder getLabelsOrBuilder(int index) { return java.util.Collections.unmodifiableList(labels_); } } + /** * * @@ -1735,9 +1789,10 @@ public com.google.api.LabelDescriptorOrBuilder getLabelsOrBuilder(int index) { * repeated .google.api.LabelDescriptor labels = 4; */ public com.google.api.LabelDescriptor.Builder addLabelsBuilder() { - return getLabelsFieldBuilder() + return internalGetLabelsFieldBuilder() .addBuilder(com.google.api.LabelDescriptor.getDefaultInstance()); } + /** * * @@ -1750,9 +1805,10 @@ public com.google.api.LabelDescriptor.Builder addLabelsBuilder() { * repeated .google.api.LabelDescriptor labels = 4; */ public com.google.api.LabelDescriptor.Builder addLabelsBuilder(int index) { - return getLabelsFieldBuilder() + return internalGetLabelsFieldBuilder() .addBuilder(index, com.google.api.LabelDescriptor.getDefaultInstance()); } + /** * * @@ -1765,27 +1821,28 @@ public com.google.api.LabelDescriptor.Builder addLabelsBuilder(int index) { * repeated .google.api.LabelDescriptor labels = 4; */ public java.util.List getLabelsBuilderList() { - return getLabelsFieldBuilder().getBuilderList(); + return internalGetLabelsFieldBuilder().getBuilderList(); } - private com.google.protobuf.RepeatedFieldBuilderV3< + private com.google.protobuf.RepeatedFieldBuilder< com.google.api.LabelDescriptor, com.google.api.LabelDescriptor.Builder, com.google.api.LabelDescriptorOrBuilder> - getLabelsFieldBuilder() { + internalGetLabelsFieldBuilder() { if (labelsBuilder_ == null) { labelsBuilder_ = - new com.google.protobuf.RepeatedFieldBuilderV3< + new com.google.protobuf.RepeatedFieldBuilder< com.google.api.LabelDescriptor, com.google.api.LabelDescriptor.Builder, com.google.api.LabelDescriptorOrBuilder>( - labels_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + labels_, ((bitField0_ & 0x00000010) != 0), getParentForChildren(), isClean()); labels_ = null; } return labelsBuilder_; } private int launchStage_ = 0; + /** * * @@ -1801,6 +1858,7 @@ public java.util.List getLabelsBuilderLi public int getLaunchStageValue() { return launchStage_; } + /** * * @@ -1814,11 +1872,12 @@ public int getLaunchStageValue() { * @return This builder for chaining. */ public Builder setLaunchStageValue(int value) { - launchStage_ = value; + bitField0_ |= 0x00000020; onChanged(); return this; } + /** * * @@ -1832,10 +1891,10 @@ public Builder setLaunchStageValue(int value) { */ @java.lang.Override public com.google.api.LaunchStage getLaunchStage() { - @SuppressWarnings("deprecation") - com.google.api.LaunchStage result = com.google.api.LaunchStage.valueOf(launchStage_); + com.google.api.LaunchStage result = com.google.api.LaunchStage.forNumber(launchStage_); return result == null ? com.google.api.LaunchStage.UNRECOGNIZED : result; } + /** * * @@ -1852,11 +1911,12 @@ public Builder setLaunchStage(com.google.api.LaunchStage value) { if (value == null) { throw new NullPointerException(); } - + bitField0_ |= 0x00000020; launchStage_ = value.getNumber(); onChanged(); return this; } + /** * * @@ -1869,23 +1929,12 @@ public Builder setLaunchStage(com.google.api.LaunchStage value) { * @return This builder for chaining. */ public Builder clearLaunchStage() { - + bitField0_ = (bitField0_ & ~0x00000020); launchStage_ = 0; onChanged(); return this; } - @java.lang.Override - public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - // @@protoc_insertion_point(builder_scope:google.api.MonitoredResourceDescriptor) } diff --git a/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/MonitoredResourceDescriptorOrBuilder.java b/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/MonitoredResourceDescriptorOrBuilder.java index 0bfc3aa309..a499d299d3 100644 --- a/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/MonitoredResourceDescriptorOrBuilder.java +++ b/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/MonitoredResourceDescriptorOrBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,10 +14,13 @@ * limitations under the License. */ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: google/api/monitored_resource.proto +// Protobuf Java Version: 4.33.2 package com.google.api; +@com.google.protobuf.Generated public interface MonitoredResourceDescriptorOrBuilder extends // @@protoc_insertion_point(interface_extends:google.api.MonitoredResourceDescriptor) @@ -40,6 +43,7 @@ public interface MonitoredResourceDescriptorOrBuilder * @return The name. */ java.lang.String getName(); + /** * * @@ -64,8 +68,8 @@ public interface MonitoredResourceDescriptorOrBuilder *
            * Required. The monitored resource type. For example, the type
            * `"cloudsql_database"` represents databases in Google Cloud SQL.
        -   *  For a list of types, see [Monitoring resource
        -   *  types](https://cloud.google.com/monitoring/api/resources)
        +   * For a list of types, see [Monitored resource
        +   * types](https://cloud.google.com/monitoring/api/resources)
            * and [Logging resource
            * types](https://cloud.google.com/logging/docs/api/v2/resource-list).
            * 
        @@ -75,14 +79,15 @@ public interface MonitoredResourceDescriptorOrBuilder * @return The type. */ java.lang.String getType(); + /** * * *
            * Required. The monitored resource type. For example, the type
            * `"cloudsql_database"` represents databases in Google Cloud SQL.
        -   *  For a list of types, see [Monitoring resource
        -   *  types](https://cloud.google.com/monitoring/api/resources)
        +   * For a list of types, see [Monitored resource
        +   * types](https://cloud.google.com/monitoring/api/resources)
            * and [Logging resource
            * types](https://cloud.google.com/logging/docs/api/v2/resource-list).
            * 
        @@ -108,6 +113,7 @@ public interface MonitoredResourceDescriptorOrBuilder * @return The displayName. */ java.lang.String getDisplayName(); + /** * * @@ -137,6 +143,7 @@ public interface MonitoredResourceDescriptorOrBuilder * @return The description. */ java.lang.String getDescription(); + /** * * @@ -163,6 +170,7 @@ public interface MonitoredResourceDescriptorOrBuilder * repeated .google.api.LabelDescriptor labels = 4; */ java.util.List getLabelsList(); + /** * * @@ -175,6 +183,7 @@ public interface MonitoredResourceDescriptorOrBuilder * repeated .google.api.LabelDescriptor labels = 4; */ com.google.api.LabelDescriptor getLabels(int index); + /** * * @@ -187,6 +196,7 @@ public interface MonitoredResourceDescriptorOrBuilder * repeated .google.api.LabelDescriptor labels = 4; */ int getLabelsCount(); + /** * * @@ -199,6 +209,7 @@ public interface MonitoredResourceDescriptorOrBuilder * repeated .google.api.LabelDescriptor labels = 4; */ java.util.List getLabelsOrBuilderList(); + /** * * @@ -224,6 +235,7 @@ public interface MonitoredResourceDescriptorOrBuilder * @return The enum numeric value on the wire for launchStage. */ int getLaunchStageValue(); + /** * * diff --git a/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/MonitoredResourceMetadata.java b/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/MonitoredResourceMetadata.java index f13cde4071..ee31177ded 100644 --- a/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/MonitoredResourceMetadata.java +++ b/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/MonitoredResourceMetadata.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,9 @@ * limitations under the License. */ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: google/api/monitored_resource.proto +// Protobuf Java Version: 4.33.2 package com.google.api; @@ -22,39 +24,40 @@ * * *
        - * Auxiliary metadata for a [MonitoredResource][google.api.MonitoredResource] object.
        - * [MonitoredResource][google.api.MonitoredResource] objects contain the minimum set of information to
        - * uniquely identify a monitored resource instance. There is some other useful
        - * auxiliary metadata. Monitoring and Logging use an ingestion
        - * pipeline to extract metadata for cloud resources of all types, and store
        - * the metadata in this message.
        + * Auxiliary metadata for a [MonitoredResource][google.api.MonitoredResource]
        + * object. [MonitoredResource][google.api.MonitoredResource] objects contain the
        + * minimum set of information to uniquely identify a monitored resource
        + * instance. There is some other useful auxiliary metadata. Monitoring and
        + * Logging use an ingestion pipeline to extract metadata for cloud resources of
        + * all types, and store the metadata in this message.
          * 
        * * Protobuf type {@code google.api.MonitoredResourceMetadata} */ -public final class MonitoredResourceMetadata extends com.google.protobuf.GeneratedMessageV3 +@com.google.protobuf.Generated +public final class MonitoredResourceMetadata extends com.google.protobuf.GeneratedMessage implements // @@protoc_insertion_point(message_implements:google.api.MonitoredResourceMetadata) MonitoredResourceMetadataOrBuilder { private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "MonitoredResourceMetadata"); + } + // Use MonitoredResourceMetadata.newBuilder() to construct. - private MonitoredResourceMetadata(com.google.protobuf.GeneratedMessageV3.Builder builder) { + private MonitoredResourceMetadata(com.google.protobuf.GeneratedMessage.Builder builder) { super(builder); } private MonitoredResourceMetadata() {} - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new MonitoredResourceMetadata(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.api.MonitoredResourceProto .internal_static_google_api_MonitoredResourceMetadata_descriptor; @@ -62,7 +65,8 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { @SuppressWarnings({"rawtypes"}) @java.lang.Override - protected com.google.protobuf.MapField internalGetMapField(int number) { + protected com.google.protobuf.MapFieldReflectionAccessor internalGetMapFieldReflection( + int number) { switch (number) { case 2: return internalGetUserLabels(); @@ -72,7 +76,7 @@ protected com.google.protobuf.MapField internalGetMapField(int number) { } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.api.MonitoredResourceProto .internal_static_google_api_MonitoredResourceMetadata_fieldAccessorTable @@ -81,8 +85,10 @@ protected com.google.protobuf.MapField internalGetMapField(int number) { com.google.api.MonitoredResourceMetadata.Builder.class); } + private int bitField0_; public static final int SYSTEM_LABELS_FIELD_NUMBER = 1; private com.google.protobuf.Struct systemLabels_; + /** * * @@ -93,9 +99,10 @@ protected com.google.protobuf.MapField internalGetMapField(int number) { * "security_group", "name", etc. * System label values can be only strings, Boolean values, or a list of * strings. For example: - * { "name": "my-test-instance", - * "security_group": ["a", "b", "c"], - * "spot_instance": false } + * + * { "name": "my-test-instance", + * "security_group": ["a", "b", "c"], + * "spot_instance": false } *
        * * .google.protobuf.Struct system_labels = 1; @@ -104,8 +111,9 @@ protected com.google.protobuf.MapField internalGetMapField(int number) { */ @java.lang.Override public boolean hasSystemLabels() { - return systemLabels_ != null; + return ((bitField0_ & 0x00000001) != 0); } + /** * * @@ -116,9 +124,10 @@ public boolean hasSystemLabels() { * "security_group", "name", etc. * System label values can be only strings, Boolean values, or a list of * strings. For example: - * { "name": "my-test-instance", - * "security_group": ["a", "b", "c"], - * "spot_instance": false } + * + * { "name": "my-test-instance", + * "security_group": ["a", "b", "c"], + * "spot_instance": false } *
        * * .google.protobuf.Struct system_labels = 1; @@ -129,6 +138,7 @@ public boolean hasSystemLabels() { public com.google.protobuf.Struct getSystemLabels() { return systemLabels_ == null ? com.google.protobuf.Struct.getDefaultInstance() : systemLabels_; } + /** * * @@ -139,16 +149,17 @@ public com.google.protobuf.Struct getSystemLabels() { * "security_group", "name", etc. * System label values can be only strings, Boolean values, or a list of * strings. For example: - * { "name": "my-test-instance", - * "security_group": ["a", "b", "c"], - * "spot_instance": false } + * + * { "name": "my-test-instance", + * "security_group": ["a", "b", "c"], + * "spot_instance": false } *
        * * .google.protobuf.Struct system_labels = 1; */ @java.lang.Override public com.google.protobuf.StructOrBuilder getSystemLabelsOrBuilder() { - return getSystemLabels(); + return systemLabels_ == null ? com.google.protobuf.Struct.getDefaultInstance() : systemLabels_; } public static final int USER_LABELS_FIELD_NUMBER = 2; @@ -164,6 +175,7 @@ private static final class UserLabelsDefaultEntryHolder { ""); } + @SuppressWarnings("serial") private com.google.protobuf.MapField userLabels_; private com.google.protobuf.MapField internalGetUserLabels() { @@ -176,6 +188,7 @@ private com.google.protobuf.MapField interna public int getUserLabelsCount() { return internalGetUserLabels().getMap().size(); } + /** * * @@ -192,12 +205,14 @@ public boolean containsUserLabels(java.lang.String key) { } return internalGetUserLabels().getMap().containsKey(key); } + /** Use {@link #getUserLabelsMap()} instead. */ @java.lang.Override @java.lang.Deprecated public java.util.Map getUserLabels() { return getUserLabelsMap(); } + /** * * @@ -211,6 +226,7 @@ public java.util.Map getUserLabels() { public java.util.Map getUserLabelsMap() { return internalGetUserLabels().getMap(); } + /** * * @@ -221,14 +237,17 @@ public java.util.Map getUserLabelsMap() { * map<string, string> user_labels = 2; */ @java.lang.Override - public java.lang.String getUserLabelsOrDefault( - java.lang.String key, java.lang.String defaultValue) { + public /* nullable */ java.lang.String getUserLabelsOrDefault( + java.lang.String key, + /* nullable */ + java.lang.String defaultValue) { if (key == null) { throw new NullPointerException("map key"); } java.util.Map map = internalGetUserLabels().getMap(); return map.containsKey(key) ? map.get(key) : defaultValue; } + /** * * @@ -264,10 +283,10 @@ public final boolean isInitialized() { @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (systemLabels_ != null) { + if (((bitField0_ & 0x00000001) != 0)) { output.writeMessage(1, getSystemLabels()); } - com.google.protobuf.GeneratedMessageV3.serializeStringMapTo( + com.google.protobuf.GeneratedMessage.serializeStringMapTo( output, internalGetUserLabels(), UserLabelsDefaultEntryHolder.defaultEntry, 2); getUnknownFields().writeTo(output); } @@ -278,7 +297,7 @@ public int getSerializedSize() { if (size != -1) return size; size = 0; - if (systemLabels_ != null) { + if (((bitField0_ & 0x00000001) != 0)) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getSystemLabels()); } for (java.util.Map.Entry entry : @@ -372,38 +391,38 @@ public static com.google.api.MonitoredResourceMetadata parseFrom( public static com.google.api.MonitoredResourceMetadata parseFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); } public static com.google.api.MonitoredResourceMetadata parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } public static com.google.api.MonitoredResourceMetadata parseDelimitedFrom( java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); } public static com.google.api.MonitoredResourceMetadata parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( PARSER, input, extensionRegistry); } public static com.google.api.MonitoredResourceMetadata parseFrom( com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); } public static com.google.api.MonitoredResourceMetadata parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } @@ -426,25 +445,26 @@ public Builder toBuilder() { } @java.lang.Override - protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { Builder builder = new Builder(parent); return builder; } + /** * * *
        -   * Auxiliary metadata for a [MonitoredResource][google.api.MonitoredResource] object.
        -   * [MonitoredResource][google.api.MonitoredResource] objects contain the minimum set of information to
        -   * uniquely identify a monitored resource instance. There is some other useful
        -   * auxiliary metadata. Monitoring and Logging use an ingestion
        -   * pipeline to extract metadata for cloud resources of all types, and store
        -   * the metadata in this message.
        +   * Auxiliary metadata for a [MonitoredResource][google.api.MonitoredResource]
        +   * object. [MonitoredResource][google.api.MonitoredResource] objects contain the
        +   * minimum set of information to uniquely identify a monitored resource
        +   * instance. There is some other useful auxiliary metadata. Monitoring and
        +   * Logging use an ingestion pipeline to extract metadata for cloud resources of
        +   * all types, and store the metadata in this message.
            * 
        * * Protobuf type {@code google.api.MonitoredResourceMetadata} */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder implements // @@protoc_insertion_point(builder_implements:google.api.MonitoredResourceMetadata) com.google.api.MonitoredResourceMetadataOrBuilder { @@ -454,7 +474,8 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } @SuppressWarnings({"rawtypes"}) - protected com.google.protobuf.MapField internalGetMapField(int number) { + protected com.google.protobuf.MapFieldReflectionAccessor internalGetMapFieldReflection( + int number) { switch (number) { case 2: return internalGetUserLabels(); @@ -464,7 +485,8 @@ protected com.google.protobuf.MapField internalGetMapField(int number) { } @SuppressWarnings({"rawtypes"}) - protected com.google.protobuf.MapField internalGetMutableMapField(int number) { + protected com.google.protobuf.MapFieldReflectionAccessor internalGetMutableMapFieldReflection( + int number) { switch (number) { case 2: return internalGetMutableUserLabels(); @@ -474,7 +496,7 @@ protected com.google.protobuf.MapField internalGetMutableMapField(int number) { } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.api.MonitoredResourceProto .internal_static_google_api_MonitoredResourceMetadata_fieldAccessorTable @@ -484,19 +506,28 @@ protected com.google.protobuf.MapField internalGetMutableMapField(int number) { } // Construct using com.google.api.MonitoredResourceMetadata.newBuilder() - private Builder() {} + private Builder() { + maybeForceBuilderInitialization(); + } - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetSystemLabelsFieldBuilder(); + } } @java.lang.Override public Builder clear() { super.clear(); - if (systemLabelsBuilder_ == null) { - systemLabels_ = null; - } else { - systemLabels_ = null; + bitField0_ = 0; + systemLabels_ = null; + if (systemLabelsBuilder_ != null) { + systemLabelsBuilder_.dispose(); systemLabelsBuilder_ = null; } internalGetMutableUserLabels().clear(); @@ -527,49 +558,26 @@ public com.google.api.MonitoredResourceMetadata build() { public com.google.api.MonitoredResourceMetadata buildPartial() { com.google.api.MonitoredResourceMetadata result = new com.google.api.MonitoredResourceMetadata(this); - int from_bitField0_ = bitField0_; - if (systemLabelsBuilder_ == null) { - result.systemLabels_ = systemLabels_; - } else { - result.systemLabels_ = systemLabelsBuilder_.build(); + if (bitField0_ != 0) { + buildPartial0(result); } - result.userLabels_ = internalGetUserLabels(); - result.userLabels_.makeImmutable(); 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); + private void buildPartial0(com.google.api.MonitoredResourceMetadata result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.systemLabels_ = + systemLabelsBuilder_ == null ? systemLabels_ : systemLabelsBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.userLabels_ = internalGetUserLabels(); + result.userLabels_.makeImmutable(); + } + result.bitField0_ |= to_bitField0_; } @java.lang.Override @@ -588,6 +596,7 @@ public Builder mergeFrom(com.google.api.MonitoredResourceMetadata other) { mergeSystemLabels(other.getSystemLabels()); } internalGetMutableUserLabels().mergeFrom(other.internalGetUserLabels()); + bitField0_ |= 0x00000002; this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; @@ -616,8 +625,9 @@ public Builder mergeFrom( break; case 10: { - input.readMessage(getSystemLabelsFieldBuilder().getBuilder(), extensionRegistry); - + input.readMessage( + internalGetSystemLabelsFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000001; break; } // case 10 case 18: @@ -629,6 +639,7 @@ public Builder mergeFrom( internalGetMutableUserLabels() .getMutableMap() .put(userLabels__.getKey(), userLabels__.getValue()); + bitField0_ |= 0x00000002; break; } // case 18 default: @@ -651,11 +662,12 @@ public Builder mergeFrom( private int bitField0_; private com.google.protobuf.Struct systemLabels_; - private com.google.protobuf.SingleFieldBuilderV3< + private com.google.protobuf.SingleFieldBuilder< com.google.protobuf.Struct, com.google.protobuf.Struct.Builder, com.google.protobuf.StructOrBuilder> systemLabelsBuilder_; + /** * * @@ -666,9 +678,10 @@ public Builder mergeFrom( * "security_group", "name", etc. * System label values can be only strings, Boolean values, or a list of * strings. For example: - * { "name": "my-test-instance", - * "security_group": ["a", "b", "c"], - * "spot_instance": false } + * + * { "name": "my-test-instance", + * "security_group": ["a", "b", "c"], + * "spot_instance": false } *
        * * .google.protobuf.Struct system_labels = 1; @@ -676,8 +689,9 @@ public Builder mergeFrom( * @return Whether the systemLabels field is set. */ public boolean hasSystemLabels() { - return systemLabelsBuilder_ != null || systemLabels_ != null; + return ((bitField0_ & 0x00000001) != 0); } + /** * * @@ -688,9 +702,10 @@ public boolean hasSystemLabels() { * "security_group", "name", etc. * System label values can be only strings, Boolean values, or a list of * strings. For example: - * { "name": "my-test-instance", - * "security_group": ["a", "b", "c"], - * "spot_instance": false } + * + * { "name": "my-test-instance", + * "security_group": ["a", "b", "c"], + * "spot_instance": false } *
        * * .google.protobuf.Struct system_labels = 1; @@ -706,6 +721,7 @@ public com.google.protobuf.Struct getSystemLabels() { return systemLabelsBuilder_.getMessage(); } } + /** * * @@ -716,9 +732,10 @@ public com.google.protobuf.Struct getSystemLabels() { * "security_group", "name", etc. * System label values can be only strings, Boolean values, or a list of * strings. For example: - * { "name": "my-test-instance", - * "security_group": ["a", "b", "c"], - * "spot_instance": false } + * + * { "name": "my-test-instance", + * "security_group": ["a", "b", "c"], + * "spot_instance": false } *
        * * .google.protobuf.Struct system_labels = 1; @@ -729,13 +746,14 @@ public Builder setSystemLabels(com.google.protobuf.Struct value) { throw new NullPointerException(); } systemLabels_ = value; - onChanged(); } else { systemLabelsBuilder_.setMessage(value); } - + bitField0_ |= 0x00000001; + onChanged(); return this; } + /** * * @@ -746,9 +764,10 @@ public Builder setSystemLabels(com.google.protobuf.Struct value) { * "security_group", "name", etc. * System label values can be only strings, Boolean values, or a list of * strings. For example: - * { "name": "my-test-instance", - * "security_group": ["a", "b", "c"], - * "spot_instance": false } + * + * { "name": "my-test-instance", + * "security_group": ["a", "b", "c"], + * "spot_instance": false } *
        * * .google.protobuf.Struct system_labels = 1; @@ -756,13 +775,14 @@ public Builder setSystemLabels(com.google.protobuf.Struct value) { public Builder setSystemLabels(com.google.protobuf.Struct.Builder builderForValue) { if (systemLabelsBuilder_ == null) { systemLabels_ = builderForValue.build(); - onChanged(); } else { systemLabelsBuilder_.setMessage(builderForValue.build()); } - + bitField0_ |= 0x00000001; + onChanged(); return this; } + /** * * @@ -773,28 +793,33 @@ public Builder setSystemLabels(com.google.protobuf.Struct.Builder builderForValu * "security_group", "name", etc. * System label values can be only strings, Boolean values, or a list of * strings. For example: - * { "name": "my-test-instance", - * "security_group": ["a", "b", "c"], - * "spot_instance": false } + * + * { "name": "my-test-instance", + * "security_group": ["a", "b", "c"], + * "spot_instance": false } *
        * * .google.protobuf.Struct system_labels = 1; */ public Builder mergeSystemLabels(com.google.protobuf.Struct value) { if (systemLabelsBuilder_ == null) { - if (systemLabels_ != null) { - systemLabels_ = - com.google.protobuf.Struct.newBuilder(systemLabels_).mergeFrom(value).buildPartial(); + if (((bitField0_ & 0x00000001) != 0) + && systemLabels_ != null + && systemLabels_ != com.google.protobuf.Struct.getDefaultInstance()) { + getSystemLabelsBuilder().mergeFrom(value); } else { systemLabels_ = value; } - onChanged(); } else { systemLabelsBuilder_.mergeFrom(value); } - + if (systemLabels_ != null) { + bitField0_ |= 0x00000001; + onChanged(); + } return this; } + /** * * @@ -805,24 +830,25 @@ public Builder mergeSystemLabels(com.google.protobuf.Struct value) { * "security_group", "name", etc. * System label values can be only strings, Boolean values, or a list of * strings. For example: - * { "name": "my-test-instance", - * "security_group": ["a", "b", "c"], - * "spot_instance": false } + * + * { "name": "my-test-instance", + * "security_group": ["a", "b", "c"], + * "spot_instance": false } *
        * * .google.protobuf.Struct system_labels = 1; */ public Builder clearSystemLabels() { - if (systemLabelsBuilder_ == null) { - systemLabels_ = null; - onChanged(); - } else { - systemLabels_ = null; + bitField0_ = (bitField0_ & ~0x00000001); + systemLabels_ = null; + if (systemLabelsBuilder_ != null) { + systemLabelsBuilder_.dispose(); systemLabelsBuilder_ = null; } - + onChanged(); return this; } + /** * * @@ -833,18 +859,20 @@ public Builder clearSystemLabels() { * "security_group", "name", etc. * System label values can be only strings, Boolean values, or a list of * strings. For example: - * { "name": "my-test-instance", - * "security_group": ["a", "b", "c"], - * "spot_instance": false } + * + * { "name": "my-test-instance", + * "security_group": ["a", "b", "c"], + * "spot_instance": false } *
        * * .google.protobuf.Struct system_labels = 1; */ public com.google.protobuf.Struct.Builder getSystemLabelsBuilder() { - + bitField0_ |= 0x00000001; onChanged(); - return getSystemLabelsFieldBuilder().getBuilder(); + return internalGetSystemLabelsFieldBuilder().getBuilder(); } + /** * * @@ -855,9 +883,10 @@ public com.google.protobuf.Struct.Builder getSystemLabelsBuilder() { * "security_group", "name", etc. * System label values can be only strings, Boolean values, or a list of * strings. For example: - * { "name": "my-test-instance", - * "security_group": ["a", "b", "c"], - * "spot_instance": false } + * + * { "name": "my-test-instance", + * "security_group": ["a", "b", "c"], + * "spot_instance": false } *
        * * .google.protobuf.Struct system_labels = 1; @@ -871,6 +900,7 @@ public com.google.protobuf.StructOrBuilder getSystemLabelsOrBuilder() { : systemLabels_; } } + /** * * @@ -881,21 +911,22 @@ public com.google.protobuf.StructOrBuilder getSystemLabelsOrBuilder() { * "security_group", "name", etc. * System label values can be only strings, Boolean values, or a list of * strings. For example: - * { "name": "my-test-instance", - * "security_group": ["a", "b", "c"], - * "spot_instance": false } + * + * { "name": "my-test-instance", + * "security_group": ["a", "b", "c"], + * "spot_instance": false } *
        * * .google.protobuf.Struct system_labels = 1; */ - private com.google.protobuf.SingleFieldBuilderV3< + private com.google.protobuf.SingleFieldBuilder< com.google.protobuf.Struct, com.google.protobuf.Struct.Builder, com.google.protobuf.StructOrBuilder> - getSystemLabelsFieldBuilder() { + internalGetSystemLabelsFieldBuilder() { if (systemLabelsBuilder_ == null) { systemLabelsBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< + new com.google.protobuf.SingleFieldBuilder< com.google.protobuf.Struct, com.google.protobuf.Struct.Builder, com.google.protobuf.StructOrBuilder>( @@ -918,8 +949,6 @@ public com.google.protobuf.StructOrBuilder getSystemLabelsOrBuilder() { private com.google.protobuf.MapField internalGetMutableUserLabels() { - onChanged(); - ; if (userLabels_ == null) { userLabels_ = com.google.protobuf.MapField.newMapField(UserLabelsDefaultEntryHolder.defaultEntry); @@ -927,12 +956,15 @@ public com.google.protobuf.StructOrBuilder getSystemLabelsOrBuilder() { if (!userLabels_.isMutable()) { userLabels_ = userLabels_.copy(); } + bitField0_ |= 0x00000002; + onChanged(); return userLabels_; } public int getUserLabelsCount() { return internalGetUserLabels().getMap().size(); } + /** * * @@ -949,12 +981,14 @@ public boolean containsUserLabels(java.lang.String key) { } return internalGetUserLabels().getMap().containsKey(key); } + /** Use {@link #getUserLabelsMap()} instead. */ @java.lang.Override @java.lang.Deprecated public java.util.Map getUserLabels() { return getUserLabelsMap(); } + /** * * @@ -968,6 +1002,7 @@ public java.util.Map getUserLabels() { public java.util.Map getUserLabelsMap() { return internalGetUserLabels().getMap(); } + /** * * @@ -978,14 +1013,17 @@ public java.util.Map getUserLabelsMap() { * map<string, string> user_labels = 2; */ @java.lang.Override - public java.lang.String getUserLabelsOrDefault( - java.lang.String key, java.lang.String defaultValue) { + public /* nullable */ java.lang.String getUserLabelsOrDefault( + java.lang.String key, + /* nullable */ + java.lang.String defaultValue) { if (key == null) { throw new NullPointerException("map key"); } java.util.Map map = internalGetUserLabels().getMap(); return map.containsKey(key) ? map.get(key) : defaultValue; } + /** * * @@ -1008,9 +1046,11 @@ public java.lang.String getUserLabelsOrThrow(java.lang.String key) { } public Builder clearUserLabels() { + bitField0_ = (bitField0_ & ~0x00000002); internalGetMutableUserLabels().getMutableMap().clear(); return this; } + /** * * @@ -1027,11 +1067,14 @@ public Builder removeUserLabels(java.lang.String key) { internalGetMutableUserLabels().getMutableMap().remove(key); return this; } + /** Use alternate mutation accessors instead. */ @java.lang.Deprecated public java.util.Map getMutableUserLabels() { + bitField0_ |= 0x00000002; return internalGetMutableUserLabels().getMutableMap(); } + /** * * @@ -1048,10 +1091,11 @@ public Builder putUserLabels(java.lang.String key, java.lang.String value) { if (value == null) { throw new NullPointerException("map value"); } - internalGetMutableUserLabels().getMutableMap().put(key, value); + bitField0_ |= 0x00000002; return this; } + /** * * @@ -1063,20 +1107,10 @@ public Builder putUserLabels(java.lang.String key, java.lang.String value) { */ public Builder putAllUserLabels(java.util.Map values) { internalGetMutableUserLabels().getMutableMap().putAll(values); + bitField0_ |= 0x00000002; return this; } - @java.lang.Override - public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - // @@protoc_insertion_point(builder_scope:google.api.MonitoredResourceMetadata) } diff --git a/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/MonitoredResourceMetadataOrBuilder.java b/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/MonitoredResourceMetadataOrBuilder.java index ac5ffa2220..5ecd669239 100644 --- a/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/MonitoredResourceMetadataOrBuilder.java +++ b/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/MonitoredResourceMetadataOrBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,10 +14,13 @@ * limitations under the License. */ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: google/api/monitored_resource.proto +// Protobuf Java Version: 4.33.2 package com.google.api; +@com.google.protobuf.Generated public interface MonitoredResourceMetadataOrBuilder extends // @@protoc_insertion_point(interface_extends:google.api.MonitoredResourceMetadata) @@ -33,9 +36,10 @@ public interface MonitoredResourceMetadataOrBuilder * "security_group", "name", etc. * System label values can be only strings, Boolean values, or a list of * strings. For example: - * { "name": "my-test-instance", - * "security_group": ["a", "b", "c"], - * "spot_instance": false } + * + * { "name": "my-test-instance", + * "security_group": ["a", "b", "c"], + * "spot_instance": false } *
        * * .google.protobuf.Struct system_labels = 1; @@ -43,6 +47,7 @@ public interface MonitoredResourceMetadataOrBuilder * @return Whether the systemLabels field is set. */ boolean hasSystemLabels(); + /** * * @@ -53,9 +58,10 @@ public interface MonitoredResourceMetadataOrBuilder * "security_group", "name", etc. * System label values can be only strings, Boolean values, or a list of * strings. For example: - * { "name": "my-test-instance", - * "security_group": ["a", "b", "c"], - * "spot_instance": false } + * + * { "name": "my-test-instance", + * "security_group": ["a", "b", "c"], + * "spot_instance": false } *
        * * .google.protobuf.Struct system_labels = 1; @@ -63,6 +69,7 @@ public interface MonitoredResourceMetadataOrBuilder * @return The systemLabels. */ com.google.protobuf.Struct getSystemLabels(); + /** * * @@ -73,9 +80,10 @@ public interface MonitoredResourceMetadataOrBuilder * "security_group", "name", etc. * System label values can be only strings, Boolean values, or a list of * strings. For example: - * { "name": "my-test-instance", - * "security_group": ["a", "b", "c"], - * "spot_instance": false } + * + * { "name": "my-test-instance", + * "security_group": ["a", "b", "c"], + * "spot_instance": false } *
        * * .google.protobuf.Struct system_labels = 1; @@ -92,6 +100,7 @@ public interface MonitoredResourceMetadataOrBuilder * map<string, string> user_labels = 2; */ int getUserLabelsCount(); + /** * * @@ -102,9 +111,11 @@ public interface MonitoredResourceMetadataOrBuilder * map<string, string> user_labels = 2; */ boolean containsUserLabels(java.lang.String key); + /** Use {@link #getUserLabelsMap()} instead. */ @java.lang.Deprecated java.util.Map getUserLabels(); + /** * * @@ -115,6 +126,7 @@ public interface MonitoredResourceMetadataOrBuilder * map<string, string> user_labels = 2; */ java.util.Map getUserLabelsMap(); + /** * * @@ -124,12 +136,12 @@ public interface MonitoredResourceMetadataOrBuilder * * map<string, string> user_labels = 2; */ - /* nullable */ java.lang.String getUserLabelsOrDefault( java.lang.String key, /* nullable */ java.lang.String defaultValue); + /** * * diff --git a/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/MonitoredResourceOrBuilder.java b/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/MonitoredResourceOrBuilder.java index b07b2575bc..fe9baa0a55 100644 --- a/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/MonitoredResourceOrBuilder.java +++ b/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/MonitoredResourceOrBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,10 +14,13 @@ * limitations under the License. */ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: google/api/monitored_resource.proto +// Protobuf Java Version: 4.33.2 package com.google.api; +@com.google.protobuf.Generated public interface MonitoredResourceOrBuilder extends // @@protoc_insertion_point(interface_extends:google.api.MonitoredResource) @@ -28,10 +31,12 @@ public interface MonitoredResourceOrBuilder * *
            * Required. The monitored resource type. This field must match
        -   * the `type` field of a [MonitoredResourceDescriptor][google.api.MonitoredResourceDescriptor] object. For
        -   * example, the type of a Compute Engine VM instance is `gce_instance`.
        -   * Some descriptors include the service name in the type; for example,
        -   * the type of a Datastream stream is `datastream.googleapis.com/Stream`.
        +   * the `type` field of a
        +   * [MonitoredResourceDescriptor][google.api.MonitoredResourceDescriptor]
        +   * object. For example, the type of a Compute Engine VM instance is
        +   * `gce_instance`. Some descriptors include the service name in the type; for
        +   * example, the type of a Datastream stream is
        +   * `datastream.googleapis.com/Stream`.
            * 
        * * string type = 1; @@ -39,15 +44,18 @@ public interface MonitoredResourceOrBuilder * @return The type. */ java.lang.String getType(); + /** * * *
            * Required. The monitored resource type. This field must match
        -   * the `type` field of a [MonitoredResourceDescriptor][google.api.MonitoredResourceDescriptor] object. For
        -   * example, the type of a Compute Engine VM instance is `gce_instance`.
        -   * Some descriptors include the service name in the type; for example,
        -   * the type of a Datastream stream is `datastream.googleapis.com/Stream`.
        +   * the `type` field of a
        +   * [MonitoredResourceDescriptor][google.api.MonitoredResourceDescriptor]
        +   * object. For example, the type of a Compute Engine VM instance is
        +   * `gce_instance`. Some descriptors include the service name in the type; for
        +   * example, the type of a Datastream stream is
        +   * `datastream.googleapis.com/Stream`.
            * 
        * * string type = 1; @@ -68,6 +76,7 @@ public interface MonitoredResourceOrBuilder * map<string, string> labels = 2; */ int getLabelsCount(); + /** * * @@ -80,9 +89,11 @@ public interface MonitoredResourceOrBuilder * map<string, string> labels = 2; */ boolean containsLabels(java.lang.String key); + /** Use {@link #getLabelsMap()} instead. */ @java.lang.Deprecated java.util.Map getLabels(); + /** * * @@ -95,6 +106,7 @@ public interface MonitoredResourceOrBuilder * map<string, string> labels = 2; */ java.util.Map getLabelsMap(); + /** * * @@ -106,12 +118,12 @@ public interface MonitoredResourceOrBuilder * * map<string, string> labels = 2; */ - /* nullable */ java.lang.String getLabelsOrDefault( java.lang.String key, /* nullable */ java.lang.String defaultValue); + /** * * diff --git a/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/MonitoredResourceProto.java b/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/MonitoredResourceProto.java index 4d4a2321fd..dee2cd08ad 100644 --- a/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/MonitoredResourceProto.java +++ b/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/MonitoredResourceProto.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,13 +14,26 @@ * limitations under the License. */ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: google/api/monitored_resource.proto +// Protobuf Java Version: 4.33.2 package com.google.api; -public final class MonitoredResourceProto { +@com.google.protobuf.Generated +public final class MonitoredResourceProto extends com.google.protobuf.GeneratedFile { private MonitoredResourceProto() {} + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "MonitoredResourceProto"); + } + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistryLite registry) {} public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry registry) { @@ -29,23 +42,23 @@ public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry r static final com.google.protobuf.Descriptors.Descriptor internal_static_google_api_MonitoredResourceDescriptor_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable internal_static_google_api_MonitoredResourceDescriptor_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_google_api_MonitoredResource_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable internal_static_google_api_MonitoredResource_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_google_api_MonitoredResource_LabelsEntry_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable internal_static_google_api_MonitoredResource_LabelsEntry_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_google_api_MonitoredResourceMetadata_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable internal_static_google_api_MonitoredResourceMetadata_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_google_api_MonitoredResourceMetadata_UserLabelsEntry_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable internal_static_google_api_MonitoredResourceMetadata_UserLabelsEntry_fieldAccessorTable; public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { @@ -56,27 +69,33 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { static { java.lang.String[] descriptorData = { - "\n#google/api/monitored_resource.proto\022\ng" - + "oogle.api\032\026google/api/label.proto\032\035googl" - + "e/api/launch_stage.proto\032\034google/protobu" - + "f/struct.proto\"\300\001\n\033MonitoredResourceDesc" - + "riptor\022\014\n\004name\030\005 \001(\t\022\014\n\004type\030\001 \001(\t\022\024\n\014di" - + "splay_name\030\002 \001(\t\022\023\n\013description\030\003 \001(\t\022+\n" - + "\006labels\030\004 \003(\0132\033.google.api.LabelDescript" - + "or\022-\n\014launch_stage\030\007 \001(\0162\027.google.api.La" - + "unchStage\"\213\001\n\021MonitoredResource\022\014\n\004type\030" - + "\001 \001(\t\0229\n\006labels\030\002 \003(\0132).google.api.Monit" - + "oredResource.LabelsEntry\032-\n\013LabelsEntry\022" - + "\013\n\003key\030\001 \001(\t\022\r\n\005value\030\002 \001(\t:\0028\001\"\312\001\n\031Moni" - + "toredResourceMetadata\022.\n\rsystem_labels\030\001" - + " \001(\0132\027.google.protobuf.Struct\022J\n\013user_la" - + "bels\030\002 \003(\01325.google.api.MonitoredResourc" - + "eMetadata.UserLabelsEntry\0321\n\017UserLabelsE" - + "ntry\022\013\n\003key\030\001 \001(\t\022\r\n\005value\030\002 \001(\t:\0028\001By\n\016" - + "com.google.apiB\026MonitoredResourceProtoP\001" + "\n" + + "#google/api/monitored_resource.proto\022\n" + + "google.api\032\026google/api/label.proto\032\035googl" + + "e/api/launch_stage.proto\032\034google/protobuf/struct.proto\"\300\001\n" + + "\033MonitoredResourceDescriptor\022\014\n" + + "\004name\030\005 \001(\t\022\014\n" + + "\004type\030\001 \001(\t\022\024\n" + + "\014display_name\030\002 \001(\t\022\023\n" + + "\013description\030\003 \001(\t\022+\n" + + "\006labels\030\004 \003(\0132\033.google.api.LabelDescriptor\022-\n" + + "\014launch_stage\030\007 \001(\0162\027.google.api.LaunchStage\"\213\001\n" + + "\021MonitoredResource\022\014\n" + + "\004type\030\001 \001(\t\0229\n" + + "\006labels\030\002 \003(\0132).google.api.MonitoredResource.LabelsEntry\032-\n" + + "\013LabelsEntry\022\013\n" + + "\003key\030\001 \001(\t\022\r\n" + + "\005value\030\002 \001(\t:\0028\001\"\312\001\n" + + "\031MonitoredResourceMetadata\022.\n\r" + + "system_labels\030\001 \001(\0132\027.google.protobuf.Struct\022J\n" + + "\013user_labels\030\002" + + " \003(\01325.google.api.MonitoredResourceMetadata.UserLabelsEntry\0321\n" + + "\017UserLabelsEntry\022\013\n" + + "\003key\030\001 \001(\t\022\r\n" + + "\005value\030\002 \001(\t:\0028\001Bv\n" + + "\016com.google.apiB\026MonitoredResourceProtoP\001" + "ZCgoogle.golang.org/genproto/googleapis/" - + "api/monitoredres;monitoredres\370\001\001\242\002\004GAPIb" - + "\006proto3" + + "api/monitoredres;monitoredres\242\002\004GAPIb\006proto3" }; descriptor = com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( @@ -87,45 +106,45 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { com.google.protobuf.StructProto.getDescriptor(), }); internal_static_google_api_MonitoredResourceDescriptor_descriptor = - getDescriptor().getMessageTypes().get(0); + getDescriptor().getMessageType(0); internal_static_google_api_MonitoredResourceDescriptor_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_google_api_MonitoredResourceDescriptor_descriptor, new java.lang.String[] { "Name", "Type", "DisplayName", "Description", "Labels", "LaunchStage", }); - internal_static_google_api_MonitoredResource_descriptor = - getDescriptor().getMessageTypes().get(1); + internal_static_google_api_MonitoredResource_descriptor = getDescriptor().getMessageType(1); internal_static_google_api_MonitoredResource_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_google_api_MonitoredResource_descriptor, new java.lang.String[] { "Type", "Labels", }); internal_static_google_api_MonitoredResource_LabelsEntry_descriptor = - internal_static_google_api_MonitoredResource_descriptor.getNestedTypes().get(0); + internal_static_google_api_MonitoredResource_descriptor.getNestedType(0); internal_static_google_api_MonitoredResource_LabelsEntry_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_google_api_MonitoredResource_LabelsEntry_descriptor, new java.lang.String[] { "Key", "Value", }); internal_static_google_api_MonitoredResourceMetadata_descriptor = - getDescriptor().getMessageTypes().get(2); + getDescriptor().getMessageType(2); internal_static_google_api_MonitoredResourceMetadata_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_google_api_MonitoredResourceMetadata_descriptor, new java.lang.String[] { "SystemLabels", "UserLabels", }); internal_static_google_api_MonitoredResourceMetadata_UserLabelsEntry_descriptor = - internal_static_google_api_MonitoredResourceMetadata_descriptor.getNestedTypes().get(0); + internal_static_google_api_MonitoredResourceMetadata_descriptor.getNestedType(0); internal_static_google_api_MonitoredResourceMetadata_UserLabelsEntry_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_google_api_MonitoredResourceMetadata_UserLabelsEntry_descriptor, new java.lang.String[] { "Key", "Value", }); + descriptor.resolveAllFeaturesImmutable(); com.google.api.LabelProto.getDescriptor(); com.google.api.LaunchStageProto.getDescriptor(); com.google.protobuf.StructProto.getDescriptor(); diff --git a/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/Monitoring.java b/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/Monitoring.java index 357a98286c..f7fb4f0341 100644 --- a/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/Monitoring.java +++ b/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/Monitoring.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,9 @@ * limitations under the License. */ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: google/api/monitoring.proto +// Protobuf Java Version: 4.33.2 package com.google.api; @@ -23,66 +25,80 @@ * *
          * Monitoring configuration of the service.
        + *
          * The example below shows how to configure monitored resources and metrics
          * for monitoring. In the example, a monitored resource and two metrics are
          * defined. The `library.googleapis.com/book/returned_count` metric is sent
          * to both producer and consumer projects, whereas the
          * `library.googleapis.com/book/num_overdue` metric is only sent to the
          * consumer project.
        - *     monitored_resources:
        - *     - type: library.googleapis.com/Branch
        - *       display_name: "Library Branch"
        - *       description: "A branch of a library."
        - *       launch_stage: GA
        - *       labels:
        - *       - key: resource_container
        - *         description: "The Cloud container (ie. project id) for the Branch."
        - *       - key: location
        - *         description: "The location of the library branch."
        - *       - key: branch_id
        - *         description: "The id of the branch."
        - *     metrics:
        - *     - name: library.googleapis.com/book/returned_count
        - *       display_name: "Books Returned"
        - *       description: "The count of books that have been returned."
        - *       launch_stage: GA
        - *       metric_kind: DELTA
        - *       value_type: INT64
        - *       unit: "1"
        - *       labels:
        - *       - key: customer_id
        - *         description: "The id of the customer."
        - *     - name: library.googleapis.com/book/num_overdue
        - *       display_name: "Books Overdue"
        - *       description: "The current number of overdue books."
        - *       launch_stage: GA
        - *       metric_kind: GAUGE
        - *       value_type: INT64
        - *       unit: "1"
        - *       labels:
        - *       - key: customer_id
        - *         description: "The id of the customer."
        - *     monitoring:
        - *       producer_destinations:
        - *       - monitored_resource: library.googleapis.com/Branch
        - *         metrics:
        - *         - library.googleapis.com/book/returned_count
        - *       consumer_destinations:
        - *       - monitored_resource: library.googleapis.com/Branch
        - *         metrics:
        - *         - library.googleapis.com/book/returned_count
        - *         - library.googleapis.com/book/num_overdue
        + *
        + * monitored_resources:
        + * - type: library.googleapis.com/Branch
        + * display_name: "Library Branch"
        + * description: "A branch of a library."
        + * launch_stage: GA
        + * labels:
        + * - key: resource_container
        + * description: "The Cloud container (ie. project id) for the Branch."
        + * - key: location
        + * description: "The location of the library branch."
        + * - key: branch_id
        + * description: "The id of the branch."
        + * metrics:
        + * - name: library.googleapis.com/book/returned_count
        + * display_name: "Books Returned"
        + * description: "The count of books that have been returned."
        + * launch_stage: GA
        + * metric_kind: DELTA
        + * value_type: INT64
        + * unit: "1"
        + * labels:
        + * - key: customer_id
        + * description: "The id of the customer."
        + * - name: library.googleapis.com/book/num_overdue
        + * display_name: "Books Overdue"
        + * description: "The current number of overdue books."
        + * launch_stage: GA
        + * metric_kind: GAUGE
        + * value_type: INT64
        + * unit: "1"
        + * labels:
        + * - key: customer_id
        + * description: "The id of the customer."
        + * monitoring:
        + * producer_destinations:
        + * - monitored_resource: library.googleapis.com/Branch
        + * metrics:
        + * - library.googleapis.com/book/returned_count
        + * consumer_destinations:
        + * - monitored_resource: library.googleapis.com/Branch
        + * metrics:
        + * - library.googleapis.com/book/returned_count
        + * - library.googleapis.com/book/num_overdue
          * 
        * * Protobuf type {@code google.api.Monitoring} */ -public final class Monitoring extends com.google.protobuf.GeneratedMessageV3 +@com.google.protobuf.Generated +public final class Monitoring extends com.google.protobuf.GeneratedMessage implements // @@protoc_insertion_point(message_implements:google.api.Monitoring) MonitoringOrBuilder { private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "Monitoring"); + } + // Use Monitoring.newBuilder() to construct. - private Monitoring(com.google.protobuf.GeneratedMessageV3.Builder builder) { + private Monitoring(com.google.protobuf.GeneratedMessage.Builder builder) { super(builder); } @@ -91,23 +107,12 @@ private Monitoring() { consumerDestinations_ = java.util.Collections.emptyList(); } - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new Monitoring(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.api.MonitoringProto.internal_static_google_api_Monitoring_descriptor; } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.api.MonitoringProto.internal_static_google_api_Monitoring_fieldAccessorTable .ensureFieldAccessorsInitialized( @@ -124,7 +129,8 @@ public interface MonitoringDestinationOrBuilder * *
              * The monitored resource type. The type must be defined in
        -     * [Service.monitored_resources][google.api.Service.monitored_resources] section.
        +     * [Service.monitored_resources][google.api.Service.monitored_resources]
        +     * section.
              * 
        * * string monitored_resource = 1; @@ -132,12 +138,14 @@ public interface MonitoringDestinationOrBuilder * @return The monitoredResource. */ java.lang.String getMonitoredResource(); + /** * * *
              * The monitored resource type. The type must be defined in
        -     * [Service.monitored_resources][google.api.Service.monitored_resources] section.
        +     * [Service.monitored_resources][google.api.Service.monitored_resources]
        +     * section.
              * 
        * * string monitored_resource = 1; @@ -151,7 +159,8 @@ public interface MonitoringDestinationOrBuilder * *
              * Types of the metrics to report to this monitoring destination.
        -     * Each type must be defined in [Service.metrics][google.api.Service.metrics] section.
        +     * Each type must be defined in
        +     * [Service.metrics][google.api.Service.metrics] section.
              * 
        * * repeated string metrics = 2; @@ -159,12 +168,14 @@ public interface MonitoringDestinationOrBuilder * @return A list containing the metrics. */ java.util.List getMetricsList(); + /** * * *
              * Types of the metrics to report to this monitoring destination.
        -     * Each type must be defined in [Service.metrics][google.api.Service.metrics] section.
        +     * Each type must be defined in
        +     * [Service.metrics][google.api.Service.metrics] section.
              * 
        * * repeated string metrics = 2; @@ -172,12 +183,14 @@ public interface MonitoringDestinationOrBuilder * @return The count of metrics. */ int getMetricsCount(); + /** * * *
              * Types of the metrics to report to this monitoring destination.
        -     * Each type must be defined in [Service.metrics][google.api.Service.metrics] section.
        +     * Each type must be defined in
        +     * [Service.metrics][google.api.Service.metrics] section.
              * 
        * * repeated string metrics = 2; @@ -186,12 +199,14 @@ public interface MonitoringDestinationOrBuilder * @return The metrics at the given index. */ java.lang.String getMetrics(int index); + /** * * *
              * Types of the metrics to report to this monitoring destination.
        -     * Each type must be defined in [Service.metrics][google.api.Service.metrics] section.
        +     * Each type must be defined in
        +     * [Service.metrics][google.api.Service.metrics] section.
              * 
        * * repeated string metrics = 2; @@ -201,6 +216,7 @@ public interface MonitoringDestinationOrBuilder */ com.google.protobuf.ByteString getMetricsBytes(int index); } + /** * * @@ -211,30 +227,30 @@ public interface MonitoringDestinationOrBuilder * * Protobuf type {@code google.api.Monitoring.MonitoringDestination} */ - public static final class MonitoringDestination extends com.google.protobuf.GeneratedMessageV3 + public static final class MonitoringDestination extends com.google.protobuf.GeneratedMessage implements // @@protoc_insertion_point(message_implements:google.api.Monitoring.MonitoringDestination) MonitoringDestinationOrBuilder { private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "MonitoringDestination"); + } + // Use MonitoringDestination.newBuilder() to construct. - private MonitoringDestination(com.google.protobuf.GeneratedMessageV3.Builder builder) { + private MonitoringDestination(com.google.protobuf.GeneratedMessage.Builder builder) { super(builder); } private MonitoringDestination() { monitoredResource_ = ""; - metrics_ = com.google.protobuf.LazyStringArrayList.EMPTY; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new MonitoringDestination(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; + metrics_ = com.google.protobuf.LazyStringArrayList.emptyList(); } public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { @@ -243,7 +259,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.api.MonitoringProto .internal_static_google_api_Monitoring_MonitoringDestination_fieldAccessorTable @@ -253,13 +269,17 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } public static final int MONITORED_RESOURCE_FIELD_NUMBER = 1; - private volatile java.lang.Object monitoredResource_; + + @SuppressWarnings("serial") + private volatile java.lang.Object monitoredResource_ = ""; + /** * * *
              * The monitored resource type. The type must be defined in
        -     * [Service.monitored_resources][google.api.Service.monitored_resources] section.
        +     * [Service.monitored_resources][google.api.Service.monitored_resources]
        +     * section.
              * 
        * * string monitored_resource = 1; @@ -278,12 +298,14 @@ public java.lang.String getMonitoredResource() { return s; } } + /** * * *
              * The monitored resource type. The type must be defined in
        -     * [Service.monitored_resources][google.api.Service.monitored_resources] section.
        +     * [Service.monitored_resources][google.api.Service.monitored_resources]
        +     * section.
              * 
        * * string monitored_resource = 1; @@ -304,13 +326,18 @@ public com.google.protobuf.ByteString getMonitoredResourceBytes() { } public static final int METRICS_FIELD_NUMBER = 2; - private com.google.protobuf.LazyStringList metrics_; + + @SuppressWarnings("serial") + private com.google.protobuf.LazyStringArrayList metrics_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + /** * * *
              * Types of the metrics to report to this monitoring destination.
        -     * Each type must be defined in [Service.metrics][google.api.Service.metrics] section.
        +     * Each type must be defined in
        +     * [Service.metrics][google.api.Service.metrics] section.
              * 
        * * repeated string metrics = 2; @@ -320,12 +347,14 @@ public com.google.protobuf.ByteString getMonitoredResourceBytes() { public com.google.protobuf.ProtocolStringList getMetricsList() { return metrics_; } + /** * * *
              * Types of the metrics to report to this monitoring destination.
        -     * Each type must be defined in [Service.metrics][google.api.Service.metrics] section.
        +     * Each type must be defined in
        +     * [Service.metrics][google.api.Service.metrics] section.
              * 
        * * repeated string metrics = 2; @@ -335,12 +364,14 @@ public com.google.protobuf.ProtocolStringList getMetricsList() { public int getMetricsCount() { return metrics_.size(); } + /** * * *
              * Types of the metrics to report to this monitoring destination.
        -     * Each type must be defined in [Service.metrics][google.api.Service.metrics] section.
        +     * Each type must be defined in
        +     * [Service.metrics][google.api.Service.metrics] section.
              * 
        * * repeated string metrics = 2; @@ -351,12 +382,14 @@ public int getMetricsCount() { public java.lang.String getMetrics(int index) { return metrics_.get(index); } + /** * * *
              * Types of the metrics to report to this monitoring destination.
        -     * Each type must be defined in [Service.metrics][google.api.Service.metrics] section.
        +     * Each type must be defined in
        +     * [Service.metrics][google.api.Service.metrics] section.
              * 
        * * repeated string metrics = 2; @@ -382,11 +415,11 @@ public final boolean isInitialized() { @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(monitoredResource_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, monitoredResource_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(monitoredResource_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, monitoredResource_); } for (int i = 0; i < metrics_.size(); i++) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 2, metrics_.getRaw(i)); + com.google.protobuf.GeneratedMessage.writeString(output, 2, metrics_.getRaw(i)); } getUnknownFields().writeTo(output); } @@ -397,8 +430,8 @@ public int getSerializedSize() { if (size != -1) return size; size = 0; - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(monitoredResource_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, monitoredResource_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(monitoredResource_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, monitoredResource_); } { int dataSize = 0; @@ -485,38 +518,38 @@ public static com.google.api.Monitoring.MonitoringDestination parseFrom( public static com.google.api.Monitoring.MonitoringDestination parseFrom( java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); } public static com.google.api.Monitoring.MonitoringDestination parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } public static com.google.api.Monitoring.MonitoringDestination parseDelimitedFrom( java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); } public static com.google.api.Monitoring.MonitoringDestination parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( PARSER, input, extensionRegistry); } public static com.google.api.Monitoring.MonitoringDestination parseFrom( com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); } public static com.google.api.Monitoring.MonitoringDestination parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } @@ -539,11 +572,11 @@ public Builder toBuilder() { } @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { Builder builder = new Builder(parent); return builder; } + /** * * @@ -554,8 +587,7 @@ protected Builder newBuilderForType( * * Protobuf type {@code google.api.Monitoring.MonitoringDestination} */ - public static final class Builder - extends com.google.protobuf.GeneratedMessageV3.Builder + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder implements // @@protoc_insertion_point(builder_implements:google.api.Monitoring.MonitoringDestination) com.google.api.Monitoring.MonitoringDestinationOrBuilder { @@ -565,7 +597,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.api.MonitoringProto .internal_static_google_api_Monitoring_MonitoringDestination_fieldAccessorTable @@ -577,17 +609,16 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { // Construct using com.google.api.Monitoring.MonitoringDestination.newBuilder() private Builder() {} - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { super(parent); } @java.lang.Override public Builder clear() { super.clear(); + bitField0_ = 0; monitoredResource_ = ""; - - metrics_ = com.google.protobuf.LazyStringArrayList.EMPTY; - bitField0_ = (bitField0_ & ~0x00000001); + metrics_ = com.google.protobuf.LazyStringArrayList.emptyList(); return this; } @@ -615,50 +646,22 @@ public com.google.api.Monitoring.MonitoringDestination build() { public com.google.api.Monitoring.MonitoringDestination buildPartial() { com.google.api.Monitoring.MonitoringDestination result = new com.google.api.Monitoring.MonitoringDestination(this); - int from_bitField0_ = bitField0_; - result.monitoredResource_ = monitoredResource_; - if (((bitField0_ & 0x00000001) != 0)) { - metrics_ = metrics_.getUnmodifiableView(); - bitField0_ = (bitField0_ & ~0x00000001); + if (bitField0_ != 0) { + buildPartial0(result); } - result.metrics_ = metrics_; 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); + private void buildPartial0(com.google.api.Monitoring.MonitoringDestination result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.monitoredResource_ = monitoredResource_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + metrics_.makeImmutable(); + result.metrics_ = metrics_; + } } @java.lang.Override @@ -676,12 +679,13 @@ public Builder mergeFrom(com.google.api.Monitoring.MonitoringDestination other) return this; if (!other.getMonitoredResource().isEmpty()) { monitoredResource_ = other.monitoredResource_; + bitField0_ |= 0x00000001; onChanged(); } if (!other.metrics_.isEmpty()) { if (metrics_.isEmpty()) { metrics_ = other.metrics_; - bitField0_ = (bitField0_ & ~0x00000001); + bitField0_ |= 0x00000002; } else { ensureMetricsIsMutable(); metrics_.addAll(other.metrics_); @@ -717,7 +721,7 @@ public Builder mergeFrom( case 10: { monitoredResource_ = input.readStringRequireUtf8(); - + bitField0_ |= 0x00000001; break; } // case 10 case 18: @@ -747,12 +751,14 @@ public Builder mergeFrom( private int bitField0_; private java.lang.Object monitoredResource_ = ""; + /** * * *
                * The monitored resource type. The type must be defined in
        -       * [Service.monitored_resources][google.api.Service.monitored_resources] section.
        +       * [Service.monitored_resources][google.api.Service.monitored_resources]
        +       * section.
                * 
        * * string monitored_resource = 1; @@ -770,12 +776,14 @@ public java.lang.String getMonitoredResource() { return (java.lang.String) ref; } } + /** * * *
                * The monitored resource type. The type must be defined in
        -       * [Service.monitored_resources][google.api.Service.monitored_resources] section.
        +       * [Service.monitored_resources][google.api.Service.monitored_resources]
        +       * section.
                * 
        * * string monitored_resource = 1; @@ -793,12 +801,14 @@ public com.google.protobuf.ByteString getMonitoredResourceBytes() { return (com.google.protobuf.ByteString) ref; } } + /** * * *
                * The monitored resource type. The type must be defined in
        -       * [Service.monitored_resources][google.api.Service.monitored_resources] section.
        +       * [Service.monitored_resources][google.api.Service.monitored_resources]
        +       * section.
                * 
        * * string monitored_resource = 1; @@ -810,17 +820,19 @@ public Builder setMonitoredResource(java.lang.String value) { if (value == null) { throw new NullPointerException(); } - monitoredResource_ = value; + bitField0_ |= 0x00000001; onChanged(); return this; } + /** * * *
                * The monitored resource type. The type must be defined in
        -       * [Service.monitored_resources][google.api.Service.monitored_resources] section.
        +       * [Service.monitored_resources][google.api.Service.monitored_resources]
        +       * section.
                * 
        * * string monitored_resource = 1; @@ -828,17 +840,19 @@ public Builder setMonitoredResource(java.lang.String value) { * @return This builder for chaining. */ public Builder clearMonitoredResource() { - monitoredResource_ = getDefaultInstance().getMonitoredResource(); + bitField0_ = (bitField0_ & ~0x00000001); onChanged(); return this; } + /** * * *
                * The monitored resource type. The type must be defined in
        -       * [Service.monitored_resources][google.api.Service.monitored_resources] section.
        +       * [Service.monitored_resources][google.api.Service.monitored_resources]
        +       * section.
                * 
        * * string monitored_resource = 1; @@ -851,27 +865,29 @@ public Builder setMonitoredResourceBytes(com.google.protobuf.ByteString value) { throw new NullPointerException(); } checkByteStringIsUtf8(value); - monitoredResource_ = value; + bitField0_ |= 0x00000001; onChanged(); return this; } - private com.google.protobuf.LazyStringList metrics_ = - com.google.protobuf.LazyStringArrayList.EMPTY; + private com.google.protobuf.LazyStringArrayList metrics_ = + com.google.protobuf.LazyStringArrayList.emptyList(); private void ensureMetricsIsMutable() { - if (!((bitField0_ & 0x00000001) != 0)) { + if (!metrics_.isModifiable()) { metrics_ = new com.google.protobuf.LazyStringArrayList(metrics_); - bitField0_ |= 0x00000001; } + bitField0_ |= 0x00000002; } + /** * * *
                * Types of the metrics to report to this monitoring destination.
        -       * Each type must be defined in [Service.metrics][google.api.Service.metrics] section.
        +       * Each type must be defined in
        +       * [Service.metrics][google.api.Service.metrics] section.
                * 
        * * repeated string metrics = 2; @@ -879,14 +895,17 @@ private void ensureMetricsIsMutable() { * @return A list containing the metrics. */ public com.google.protobuf.ProtocolStringList getMetricsList() { - return metrics_.getUnmodifiableView(); + metrics_.makeImmutable(); + return metrics_; } + /** * * *
                * Types of the metrics to report to this monitoring destination.
        -       * Each type must be defined in [Service.metrics][google.api.Service.metrics] section.
        +       * Each type must be defined in
        +       * [Service.metrics][google.api.Service.metrics] section.
                * 
        * * repeated string metrics = 2; @@ -896,12 +915,14 @@ public com.google.protobuf.ProtocolStringList getMetricsList() { public int getMetricsCount() { return metrics_.size(); } + /** * * *
                * Types of the metrics to report to this monitoring destination.
        -       * Each type must be defined in [Service.metrics][google.api.Service.metrics] section.
        +       * Each type must be defined in
        +       * [Service.metrics][google.api.Service.metrics] section.
                * 
        * * repeated string metrics = 2; @@ -912,12 +933,14 @@ public int getMetricsCount() { public java.lang.String getMetrics(int index) { return metrics_.get(index); } + /** * * *
                * Types of the metrics to report to this monitoring destination.
        -       * Each type must be defined in [Service.metrics][google.api.Service.metrics] section.
        +       * Each type must be defined in
        +       * [Service.metrics][google.api.Service.metrics] section.
                * 
        * * repeated string metrics = 2; @@ -928,12 +951,14 @@ public java.lang.String getMetrics(int index) { public com.google.protobuf.ByteString getMetricsBytes(int index) { return metrics_.getByteString(index); } + /** * * *
                * Types of the metrics to report to this monitoring destination.
        -       * Each type must be defined in [Service.metrics][google.api.Service.metrics] section.
        +       * Each type must be defined in
        +       * [Service.metrics][google.api.Service.metrics] section.
                * 
        * * repeated string metrics = 2; @@ -948,15 +973,18 @@ public Builder setMetrics(int index, java.lang.String value) { } ensureMetricsIsMutable(); metrics_.set(index, value); + bitField0_ |= 0x00000002; onChanged(); return this; } + /** * * *
                * Types of the metrics to report to this monitoring destination.
        -       * Each type must be defined in [Service.metrics][google.api.Service.metrics] section.
        +       * Each type must be defined in
        +       * [Service.metrics][google.api.Service.metrics] section.
                * 
        * * repeated string metrics = 2; @@ -970,15 +998,18 @@ public Builder addMetrics(java.lang.String value) { } ensureMetricsIsMutable(); metrics_.add(value); + bitField0_ |= 0x00000002; onChanged(); return this; } + /** * * *
                * Types of the metrics to report to this monitoring destination.
        -       * Each type must be defined in [Service.metrics][google.api.Service.metrics] section.
        +       * Each type must be defined in
        +       * [Service.metrics][google.api.Service.metrics] section.
                * 
        * * repeated string metrics = 2; @@ -989,15 +1020,18 @@ public Builder addMetrics(java.lang.String value) { public Builder addAllMetrics(java.lang.Iterable values) { ensureMetricsIsMutable(); com.google.protobuf.AbstractMessageLite.Builder.addAll(values, metrics_); + bitField0_ |= 0x00000002; onChanged(); return this; } + /** * * *
                * Types of the metrics to report to this monitoring destination.
        -       * Each type must be defined in [Service.metrics][google.api.Service.metrics] section.
        +       * Each type must be defined in
        +       * [Service.metrics][google.api.Service.metrics] section.
                * 
        * * repeated string metrics = 2; @@ -1005,17 +1039,20 @@ public Builder addAllMetrics(java.lang.Iterable values) { * @return This builder for chaining. */ public Builder clearMetrics() { - metrics_ = com.google.protobuf.LazyStringArrayList.EMPTY; - bitField0_ = (bitField0_ & ~0x00000001); + metrics_ = com.google.protobuf.LazyStringArrayList.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + ; onChanged(); return this; } + /** * * *
                * Types of the metrics to report to this monitoring destination.
        -       * Each type must be defined in [Service.metrics][google.api.Service.metrics] section.
        +       * Each type must be defined in
        +       * [Service.metrics][google.api.Service.metrics] section.
                * 
        * * repeated string metrics = 2; @@ -1030,22 +1067,11 @@ public Builder addMetricsBytes(com.google.protobuf.ByteString value) { checkByteStringIsUtf8(value); ensureMetricsIsMutable(); metrics_.add(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.api.Monitoring.MonitoringDestination) } @@ -1099,7 +1125,10 @@ public com.google.api.Monitoring.MonitoringDestination getDefaultInstanceForType } public static final int PRODUCER_DESTINATIONS_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") private java.util.List producerDestinations_; + /** * * @@ -1119,6 +1148,7 @@ public com.google.api.Monitoring.MonitoringDestination getDefaultInstanceForType getProducerDestinationsList() { return producerDestinations_; } + /** * * @@ -1138,6 +1168,7 @@ public com.google.api.Monitoring.MonitoringDestination getDefaultInstanceForType getProducerDestinationsOrBuilderList() { return producerDestinations_; } + /** * * @@ -1156,6 +1187,7 @@ public com.google.api.Monitoring.MonitoringDestination getDefaultInstanceForType public int getProducerDestinationsCount() { return producerDestinations_.size(); } + /** * * @@ -1174,6 +1206,7 @@ public int getProducerDestinationsCount() { public com.google.api.Monitoring.MonitoringDestination getProducerDestinations(int index) { return producerDestinations_.get(index); } + /** * * @@ -1195,7 +1228,10 @@ public com.google.api.Monitoring.MonitoringDestinationOrBuilder getProducerDesti } public static final int CONSUMER_DESTINATIONS_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") private java.util.List consumerDestinations_; + /** * * @@ -1215,6 +1251,7 @@ public com.google.api.Monitoring.MonitoringDestinationOrBuilder getProducerDesti getConsumerDestinationsList() { return consumerDestinations_; } + /** * * @@ -1234,6 +1271,7 @@ public com.google.api.Monitoring.MonitoringDestinationOrBuilder getProducerDesti getConsumerDestinationsOrBuilderList() { return consumerDestinations_; } + /** * * @@ -1252,6 +1290,7 @@ public com.google.api.Monitoring.MonitoringDestinationOrBuilder getProducerDesti public int getConsumerDestinationsCount() { return consumerDestinations_.size(); } + /** * * @@ -1270,6 +1309,7 @@ public int getConsumerDestinationsCount() { public com.google.api.Monitoring.MonitoringDestination getConsumerDestinations(int index) { return consumerDestinations_.get(index); } + /** * * @@ -1404,38 +1444,38 @@ public static com.google.api.Monitoring parseFrom( public static com.google.api.Monitoring parseFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); } public static com.google.api.Monitoring parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } public static com.google.api.Monitoring parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); } public static com.google.api.Monitoring parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( PARSER, input, extensionRegistry); } public static com.google.api.Monitoring parseFrom(com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); } public static com.google.api.Monitoring parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } @@ -1458,69 +1498,72 @@ public Builder toBuilder() { } @java.lang.Override - protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { Builder builder = new Builder(parent); return builder; } + /** * * *
            * Monitoring configuration of the service.
        +   *
            * The example below shows how to configure monitored resources and metrics
            * for monitoring. In the example, a monitored resource and two metrics are
            * defined. The `library.googleapis.com/book/returned_count` metric is sent
            * to both producer and consumer projects, whereas the
            * `library.googleapis.com/book/num_overdue` metric is only sent to the
            * consumer project.
        -   *     monitored_resources:
        -   *     - type: library.googleapis.com/Branch
        -   *       display_name: "Library Branch"
        -   *       description: "A branch of a library."
        -   *       launch_stage: GA
        -   *       labels:
        -   *       - key: resource_container
        -   *         description: "The Cloud container (ie. project id) for the Branch."
        -   *       - key: location
        -   *         description: "The location of the library branch."
        -   *       - key: branch_id
        -   *         description: "The id of the branch."
        -   *     metrics:
        -   *     - name: library.googleapis.com/book/returned_count
        -   *       display_name: "Books Returned"
        -   *       description: "The count of books that have been returned."
        -   *       launch_stage: GA
        -   *       metric_kind: DELTA
        -   *       value_type: INT64
        -   *       unit: "1"
        -   *       labels:
        -   *       - key: customer_id
        -   *         description: "The id of the customer."
        -   *     - name: library.googleapis.com/book/num_overdue
        -   *       display_name: "Books Overdue"
        -   *       description: "The current number of overdue books."
        -   *       launch_stage: GA
        -   *       metric_kind: GAUGE
        -   *       value_type: INT64
        -   *       unit: "1"
        -   *       labels:
        -   *       - key: customer_id
        -   *         description: "The id of the customer."
        -   *     monitoring:
        -   *       producer_destinations:
        -   *       - monitored_resource: library.googleapis.com/Branch
        -   *         metrics:
        -   *         - library.googleapis.com/book/returned_count
        -   *       consumer_destinations:
        -   *       - monitored_resource: library.googleapis.com/Branch
        -   *         metrics:
        -   *         - library.googleapis.com/book/returned_count
        -   *         - library.googleapis.com/book/num_overdue
        +   *
        +   * monitored_resources:
        +   * - type: library.googleapis.com/Branch
        +   * display_name: "Library Branch"
        +   * description: "A branch of a library."
        +   * launch_stage: GA
        +   * labels:
        +   * - key: resource_container
        +   * description: "The Cloud container (ie. project id) for the Branch."
        +   * - key: location
        +   * description: "The location of the library branch."
        +   * - key: branch_id
        +   * description: "The id of the branch."
        +   * metrics:
        +   * - name: library.googleapis.com/book/returned_count
        +   * display_name: "Books Returned"
        +   * description: "The count of books that have been returned."
        +   * launch_stage: GA
        +   * metric_kind: DELTA
        +   * value_type: INT64
        +   * unit: "1"
        +   * labels:
        +   * - key: customer_id
        +   * description: "The id of the customer."
        +   * - name: library.googleapis.com/book/num_overdue
        +   * display_name: "Books Overdue"
        +   * description: "The current number of overdue books."
        +   * launch_stage: GA
        +   * metric_kind: GAUGE
        +   * value_type: INT64
        +   * unit: "1"
        +   * labels:
        +   * - key: customer_id
        +   * description: "The id of the customer."
        +   * monitoring:
        +   * producer_destinations:
        +   * - monitored_resource: library.googleapis.com/Branch
        +   * metrics:
        +   * - library.googleapis.com/book/returned_count
        +   * consumer_destinations:
        +   * - monitored_resource: library.googleapis.com/Branch
        +   * metrics:
        +   * - library.googleapis.com/book/returned_count
        +   * - library.googleapis.com/book/num_overdue
            * 
        * * Protobuf type {@code google.api.Monitoring} */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder implements // @@protoc_insertion_point(builder_implements:google.api.Monitoring) com.google.api.MonitoringOrBuilder { @@ -1529,7 +1572,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.api.MonitoringProto.internal_static_google_api_Monitoring_fieldAccessorTable .ensureFieldAccessorsInitialized( @@ -1539,13 +1582,14 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { // Construct using com.google.api.Monitoring.newBuilder() private Builder() {} - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { super(parent); } @java.lang.Override public Builder clear() { super.clear(); + bitField0_ = 0; if (producerDestinationsBuilder_ == null) { producerDestinations_ = java.util.Collections.emptyList(); } else { @@ -1585,7 +1629,15 @@ public com.google.api.Monitoring build() { @java.lang.Override public com.google.api.Monitoring buildPartial() { com.google.api.Monitoring result = new com.google.api.Monitoring(this); - int from_bitField0_ = bitField0_; + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields(com.google.api.Monitoring result) { if (producerDestinationsBuilder_ == null) { if (((bitField0_ & 0x00000001) != 0)) { producerDestinations_ = java.util.Collections.unmodifiableList(producerDestinations_); @@ -1604,41 +1656,10 @@ public com.google.api.Monitoring buildPartial() { } else { result.consumerDestinations_ = consumerDestinationsBuilder_.build(); } - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.setField(field, value); - } - - @java.lang.Override - public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - - @java.lang.Override - public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); } - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.addRepeatedField(field, value); + private void buildPartial0(com.google.api.Monitoring result) { + int from_bitField0_ = bitField0_; } @java.lang.Override @@ -1672,8 +1693,8 @@ public Builder mergeFrom(com.google.api.Monitoring other) { producerDestinations_ = other.producerDestinations_; bitField0_ = (bitField0_ & ~0x00000001); producerDestinationsBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders - ? getProducerDestinationsFieldBuilder() + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders + ? internalGetProducerDestinationsFieldBuilder() : null; } else { producerDestinationsBuilder_.addAllMessages(other.producerDestinations_); @@ -1699,8 +1720,8 @@ public Builder mergeFrom(com.google.api.Monitoring other) { consumerDestinations_ = other.consumerDestinations_; bitField0_ = (bitField0_ & ~0x00000002); consumerDestinationsBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders - ? getConsumerDestinationsFieldBuilder() + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders + ? internalGetConsumerDestinationsFieldBuilder() : null; } else { consumerDestinationsBuilder_.addAllMessages(other.consumerDestinations_); @@ -1792,7 +1813,7 @@ private void ensureProducerDestinationsIsMutable() { } } - private com.google.protobuf.RepeatedFieldBuilderV3< + private com.google.protobuf.RepeatedFieldBuilder< com.google.api.Monitoring.MonitoringDestination, com.google.api.Monitoring.MonitoringDestination.Builder, com.google.api.Monitoring.MonitoringDestinationOrBuilder> @@ -1820,6 +1841,7 @@ private void ensureProducerDestinationsIsMutable() { return producerDestinationsBuilder_.getMessageList(); } } + /** * * @@ -1841,6 +1863,7 @@ public int getProducerDestinationsCount() { return producerDestinationsBuilder_.getCount(); } } + /** * * @@ -1862,6 +1885,7 @@ public com.google.api.Monitoring.MonitoringDestination getProducerDestinations(i return producerDestinationsBuilder_.getMessage(index); } } + /** * * @@ -1890,6 +1914,7 @@ public Builder setProducerDestinations( } return this; } + /** * * @@ -1915,6 +1940,7 @@ public Builder setProducerDestinations( } return this; } + /** * * @@ -1942,6 +1968,7 @@ public Builder addProducerDestinations(com.google.api.Monitoring.MonitoringDesti } return this; } + /** * * @@ -1970,6 +1997,7 @@ public Builder addProducerDestinations( } return this; } + /** * * @@ -1995,6 +2023,7 @@ public Builder addProducerDestinations( } return this; } + /** * * @@ -2020,6 +2049,7 @@ public Builder addProducerDestinations( } return this; } + /** * * @@ -2045,6 +2075,7 @@ public Builder addAllProducerDestinations( } return this; } + /** * * @@ -2069,6 +2100,7 @@ public Builder clearProducerDestinations() { } return this; } + /** * * @@ -2093,6 +2125,7 @@ public Builder removeProducerDestinations(int index) { } return this; } + /** * * @@ -2109,8 +2142,9 @@ public Builder removeProducerDestinations(int index) { */ public com.google.api.Monitoring.MonitoringDestination.Builder getProducerDestinationsBuilder( int index) { - return getProducerDestinationsFieldBuilder().getBuilder(index); + return internalGetProducerDestinationsFieldBuilder().getBuilder(index); } + /** * * @@ -2133,6 +2167,7 @@ public com.google.api.Monitoring.MonitoringDestination.Builder getProducerDestin return producerDestinationsBuilder_.getMessageOrBuilder(index); } } + /** * * @@ -2155,6 +2190,7 @@ public com.google.api.Monitoring.MonitoringDestination.Builder getProducerDestin return java.util.Collections.unmodifiableList(producerDestinations_); } } + /** * * @@ -2171,9 +2207,10 @@ public com.google.api.Monitoring.MonitoringDestination.Builder getProducerDestin */ public com.google.api.Monitoring.MonitoringDestination.Builder addProducerDestinationsBuilder() { - return getProducerDestinationsFieldBuilder() + return internalGetProducerDestinationsFieldBuilder() .addBuilder(com.google.api.Monitoring.MonitoringDestination.getDefaultInstance()); } + /** * * @@ -2190,9 +2227,10 @@ public com.google.api.Monitoring.MonitoringDestination.Builder getProducerDestin */ public com.google.api.Monitoring.MonitoringDestination.Builder addProducerDestinationsBuilder( int index) { - return getProducerDestinationsFieldBuilder() + return internalGetProducerDestinationsFieldBuilder() .addBuilder(index, com.google.api.Monitoring.MonitoringDestination.getDefaultInstance()); } + /** * * @@ -2209,17 +2247,17 @@ public com.google.api.Monitoring.MonitoringDestination.Builder addProducerDestin */ public java.util.List getProducerDestinationsBuilderList() { - return getProducerDestinationsFieldBuilder().getBuilderList(); + return internalGetProducerDestinationsFieldBuilder().getBuilderList(); } - private com.google.protobuf.RepeatedFieldBuilderV3< + private com.google.protobuf.RepeatedFieldBuilder< com.google.api.Monitoring.MonitoringDestination, com.google.api.Monitoring.MonitoringDestination.Builder, com.google.api.Monitoring.MonitoringDestinationOrBuilder> - getProducerDestinationsFieldBuilder() { + internalGetProducerDestinationsFieldBuilder() { if (producerDestinationsBuilder_ == null) { producerDestinationsBuilder_ = - new com.google.protobuf.RepeatedFieldBuilderV3< + new com.google.protobuf.RepeatedFieldBuilder< com.google.api.Monitoring.MonitoringDestination, com.google.api.Monitoring.MonitoringDestination.Builder, com.google.api.Monitoring.MonitoringDestinationOrBuilder>( @@ -2244,7 +2282,7 @@ private void ensureConsumerDestinationsIsMutable() { } } - private com.google.protobuf.RepeatedFieldBuilderV3< + private com.google.protobuf.RepeatedFieldBuilder< com.google.api.Monitoring.MonitoringDestination, com.google.api.Monitoring.MonitoringDestination.Builder, com.google.api.Monitoring.MonitoringDestinationOrBuilder> @@ -2272,6 +2310,7 @@ private void ensureConsumerDestinationsIsMutable() { return consumerDestinationsBuilder_.getMessageList(); } } + /** * * @@ -2293,6 +2332,7 @@ public int getConsumerDestinationsCount() { return consumerDestinationsBuilder_.getCount(); } } + /** * * @@ -2314,6 +2354,7 @@ public com.google.api.Monitoring.MonitoringDestination getConsumerDestinations(i return consumerDestinationsBuilder_.getMessage(index); } } + /** * * @@ -2342,6 +2383,7 @@ public Builder setConsumerDestinations( } return this; } + /** * * @@ -2367,6 +2409,7 @@ public Builder setConsumerDestinations( } return this; } + /** * * @@ -2394,6 +2437,7 @@ public Builder addConsumerDestinations(com.google.api.Monitoring.MonitoringDesti } return this; } + /** * * @@ -2422,6 +2466,7 @@ public Builder addConsumerDestinations( } return this; } + /** * * @@ -2447,6 +2492,7 @@ public Builder addConsumerDestinations( } return this; } + /** * * @@ -2472,6 +2518,7 @@ public Builder addConsumerDestinations( } return this; } + /** * * @@ -2497,6 +2544,7 @@ public Builder addAllConsumerDestinations( } return this; } + /** * * @@ -2521,6 +2569,7 @@ public Builder clearConsumerDestinations() { } return this; } + /** * * @@ -2545,6 +2594,7 @@ public Builder removeConsumerDestinations(int index) { } return this; } + /** * * @@ -2561,8 +2611,9 @@ public Builder removeConsumerDestinations(int index) { */ public com.google.api.Monitoring.MonitoringDestination.Builder getConsumerDestinationsBuilder( int index) { - return getConsumerDestinationsFieldBuilder().getBuilder(index); + return internalGetConsumerDestinationsFieldBuilder().getBuilder(index); } + /** * * @@ -2585,6 +2636,7 @@ public com.google.api.Monitoring.MonitoringDestination.Builder getConsumerDestin return consumerDestinationsBuilder_.getMessageOrBuilder(index); } } + /** * * @@ -2607,6 +2659,7 @@ public com.google.api.Monitoring.MonitoringDestination.Builder getConsumerDestin return java.util.Collections.unmodifiableList(consumerDestinations_); } } + /** * * @@ -2623,9 +2676,10 @@ public com.google.api.Monitoring.MonitoringDestination.Builder getConsumerDestin */ public com.google.api.Monitoring.MonitoringDestination.Builder addConsumerDestinationsBuilder() { - return getConsumerDestinationsFieldBuilder() + return internalGetConsumerDestinationsFieldBuilder() .addBuilder(com.google.api.Monitoring.MonitoringDestination.getDefaultInstance()); } + /** * * @@ -2642,9 +2696,10 @@ public com.google.api.Monitoring.MonitoringDestination.Builder getConsumerDestin */ public com.google.api.Monitoring.MonitoringDestination.Builder addConsumerDestinationsBuilder( int index) { - return getConsumerDestinationsFieldBuilder() + return internalGetConsumerDestinationsFieldBuilder() .addBuilder(index, com.google.api.Monitoring.MonitoringDestination.getDefaultInstance()); } + /** * * @@ -2661,17 +2716,17 @@ public com.google.api.Monitoring.MonitoringDestination.Builder addConsumerDestin */ public java.util.List getConsumerDestinationsBuilderList() { - return getConsumerDestinationsFieldBuilder().getBuilderList(); + return internalGetConsumerDestinationsFieldBuilder().getBuilderList(); } - private com.google.protobuf.RepeatedFieldBuilderV3< + private com.google.protobuf.RepeatedFieldBuilder< com.google.api.Monitoring.MonitoringDestination, com.google.api.Monitoring.MonitoringDestination.Builder, com.google.api.Monitoring.MonitoringDestinationOrBuilder> - getConsumerDestinationsFieldBuilder() { + internalGetConsumerDestinationsFieldBuilder() { if (consumerDestinationsBuilder_ == null) { consumerDestinationsBuilder_ = - new com.google.protobuf.RepeatedFieldBuilderV3< + new com.google.protobuf.RepeatedFieldBuilder< com.google.api.Monitoring.MonitoringDestination, com.google.api.Monitoring.MonitoringDestination.Builder, com.google.api.Monitoring.MonitoringDestinationOrBuilder>( @@ -2684,17 +2739,6 @@ public com.google.api.Monitoring.MonitoringDestination.Builder addConsumerDestin return consumerDestinationsBuilder_; } - @java.lang.Override - public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - // @@protoc_insertion_point(builder_scope:google.api.Monitoring) } diff --git a/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/MonitoringOrBuilder.java b/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/MonitoringOrBuilder.java index 4a9cc51ca8..47ce08dc99 100644 --- a/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/MonitoringOrBuilder.java +++ b/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/MonitoringOrBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,10 +14,13 @@ * limitations under the License. */ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: google/api/monitoring.proto +// Protobuf Java Version: 4.33.2 package com.google.api; +@com.google.protobuf.Generated public interface MonitoringOrBuilder extends // @@protoc_insertion_point(interface_extends:google.api.Monitoring) @@ -38,6 +41,7 @@ public interface MonitoringOrBuilder * repeated .google.api.Monitoring.MonitoringDestination producer_destinations = 1; */ java.util.List getProducerDestinationsList(); + /** * * @@ -53,6 +57,7 @@ public interface MonitoringOrBuilder * repeated .google.api.Monitoring.MonitoringDestination producer_destinations = 1; */ com.google.api.Monitoring.MonitoringDestination getProducerDestinations(int index); + /** * * @@ -68,6 +73,7 @@ public interface MonitoringOrBuilder * repeated .google.api.Monitoring.MonitoringDestination producer_destinations = 1; */ int getProducerDestinationsCount(); + /** * * @@ -84,6 +90,7 @@ public interface MonitoringOrBuilder */ java.util.List getProducerDestinationsOrBuilderList(); + /** * * @@ -116,6 +123,7 @@ com.google.api.Monitoring.MonitoringDestinationOrBuilder getProducerDestinations * repeated .google.api.Monitoring.MonitoringDestination consumer_destinations = 2; */ java.util.List getConsumerDestinationsList(); + /** * * @@ -131,6 +139,7 @@ com.google.api.Monitoring.MonitoringDestinationOrBuilder getProducerDestinations * repeated .google.api.Monitoring.MonitoringDestination consumer_destinations = 2; */ com.google.api.Monitoring.MonitoringDestination getConsumerDestinations(int index); + /** * * @@ -146,6 +155,7 @@ com.google.api.Monitoring.MonitoringDestinationOrBuilder getProducerDestinations * repeated .google.api.Monitoring.MonitoringDestination consumer_destinations = 2; */ int getConsumerDestinationsCount(); + /** * * @@ -162,6 +172,7 @@ com.google.api.Monitoring.MonitoringDestinationOrBuilder getProducerDestinations */ java.util.List getConsumerDestinationsOrBuilderList(); + /** * * diff --git a/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/MonitoringProto.java b/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/MonitoringProto.java index f71eac12f1..444e997e6a 100644 --- a/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/MonitoringProto.java +++ b/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/MonitoringProto.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,13 +14,26 @@ * limitations under the License. */ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: google/api/monitoring.proto +// Protobuf Java Version: 4.33.2 package com.google.api; -public final class MonitoringProto { +@com.google.protobuf.Generated +public final class MonitoringProto extends com.google.protobuf.GeneratedFile { private MonitoringProto() {} + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "MonitoringProto"); + } + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistryLite registry) {} public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry registry) { @@ -29,11 +42,11 @@ public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry r static final com.google.protobuf.Descriptors.Descriptor internal_static_google_api_Monitoring_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable internal_static_google_api_Monitoring_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_google_api_Monitoring_MonitoringDestination_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable internal_static_google_api_Monitoring_MonitoringDestination_fieldAccessorTable; public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { @@ -59,21 +72,22 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { descriptor = com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( descriptorData, new com.google.protobuf.Descriptors.FileDescriptor[] {}); - internal_static_google_api_Monitoring_descriptor = getDescriptor().getMessageTypes().get(0); + internal_static_google_api_Monitoring_descriptor = getDescriptor().getMessageType(0); internal_static_google_api_Monitoring_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_google_api_Monitoring_descriptor, new java.lang.String[] { "ProducerDestinations", "ConsumerDestinations", }); internal_static_google_api_Monitoring_MonitoringDestination_descriptor = - internal_static_google_api_Monitoring_descriptor.getNestedTypes().get(0); + internal_static_google_api_Monitoring_descriptor.getNestedType(0); internal_static_google_api_Monitoring_MonitoringDestination_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_google_api_Monitoring_MonitoringDestination_descriptor, new java.lang.String[] { "MonitoredResource", "Metrics", }); + descriptor.resolveAllFeaturesImmutable(); } // @@protoc_insertion_point(outer_class_scope) diff --git a/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/NodeSettings.java b/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/NodeSettings.java index b98fe56ece..809f591657 100644 --- a/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/NodeSettings.java +++ b/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/NodeSettings.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,9 @@ * limitations under the License. */ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: google/api/client.proto +// Protobuf Java Version: 4.33.2 package com.google.api; @@ -27,43 +29,46 @@ * * Protobuf type {@code google.api.NodeSettings} */ -public final class NodeSettings extends com.google.protobuf.GeneratedMessageV3 +@com.google.protobuf.Generated +public final class NodeSettings extends com.google.protobuf.GeneratedMessage implements // @@protoc_insertion_point(message_implements:google.api.NodeSettings) NodeSettingsOrBuilder { private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "NodeSettings"); + } + // Use NodeSettings.newBuilder() to construct. - private NodeSettings(com.google.protobuf.GeneratedMessageV3.Builder builder) { + private NodeSettings(com.google.protobuf.GeneratedMessage.Builder builder) { super(builder); } private NodeSettings() {} - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new NodeSettings(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.api.ClientProto.internal_static_google_api_NodeSettings_descriptor; } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.api.ClientProto.internal_static_google_api_NodeSettings_fieldAccessorTable .ensureFieldAccessorsInitialized( com.google.api.NodeSettings.class, com.google.api.NodeSettings.Builder.class); } + private int bitField0_; public static final int COMMON_FIELD_NUMBER = 1; private com.google.api.CommonLanguageSettings common_; + /** * * @@ -77,8 +82,9 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { */ @java.lang.Override public boolean hasCommon() { - return common_ != null; + return ((bitField0_ & 0x00000001) != 0); } + /** * * @@ -94,6 +100,7 @@ public boolean hasCommon() { public com.google.api.CommonLanguageSettings getCommon() { return common_ == null ? com.google.api.CommonLanguageSettings.getDefaultInstance() : common_; } + /** * * @@ -105,7 +112,7 @@ public com.google.api.CommonLanguageSettings getCommon() { */ @java.lang.Override public com.google.api.CommonLanguageSettingsOrBuilder getCommonOrBuilder() { - return getCommon(); + return common_ == null ? com.google.api.CommonLanguageSettings.getDefaultInstance() : common_; } private byte memoizedIsInitialized = -1; @@ -122,7 +129,7 @@ public final boolean isInitialized() { @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (common_ != null) { + if (((bitField0_ & 0x00000001) != 0)) { output.writeMessage(1, getCommon()); } getUnknownFields().writeTo(output); @@ -134,7 +141,7 @@ public int getSerializedSize() { if (size != -1) return size; size = 0; - if (common_ != null) { + if (((bitField0_ & 0x00000001) != 0)) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getCommon()); } size += getUnknownFields().getSerializedSize(); @@ -212,38 +219,38 @@ public static com.google.api.NodeSettings parseFrom( public static com.google.api.NodeSettings parseFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); } public static com.google.api.NodeSettings parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } public static com.google.api.NodeSettings parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); } public static com.google.api.NodeSettings parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( PARSER, input, extensionRegistry); } public static com.google.api.NodeSettings parseFrom(com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); } public static com.google.api.NodeSettings parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } @@ -266,10 +273,11 @@ public Builder toBuilder() { } @java.lang.Override - protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { Builder builder = new Builder(parent); return builder; } + /** * * @@ -279,7 +287,7 @@ protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.Build * * Protobuf type {@code google.api.NodeSettings} */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder implements // @@protoc_insertion_point(builder_implements:google.api.NodeSettings) com.google.api.NodeSettingsOrBuilder { @@ -288,7 +296,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.api.ClientProto.internal_static_google_api_NodeSettings_fieldAccessorTable .ensureFieldAccessorsInitialized( @@ -296,19 +304,28 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } // Construct using com.google.api.NodeSettings.newBuilder() - private Builder() {} + private Builder() { + maybeForceBuilderInitialization(); + } - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetCommonFieldBuilder(); + } } @java.lang.Override public Builder clear() { super.clear(); - if (commonBuilder_ == null) { - common_ = null; - } else { - common_ = null; + bitField0_ = 0; + common_ = null; + if (commonBuilder_ != null) { + commonBuilder_.dispose(); commonBuilder_ = null; } return this; @@ -336,46 +353,21 @@ public com.google.api.NodeSettings build() { @java.lang.Override public com.google.api.NodeSettings buildPartial() { com.google.api.NodeSettings result = new com.google.api.NodeSettings(this); - if (commonBuilder_ == null) { - result.common_ = common_; - } else { - result.common_ = commonBuilder_.build(); + if (bitField0_ != 0) { + buildPartial0(result); } 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); + private void buildPartial0(com.google.api.NodeSettings result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.common_ = commonBuilder_ == null ? common_ : commonBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + result.bitField0_ |= to_bitField0_; } @java.lang.Override @@ -421,8 +413,8 @@ public Builder mergeFrom( break; case 10: { - input.readMessage(getCommonFieldBuilder().getBuilder(), extensionRegistry); - + input.readMessage(internalGetCommonFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000001; break; } // case 10 default: @@ -442,12 +434,15 @@ public Builder mergeFrom( return this; } + private int bitField0_; + private com.google.api.CommonLanguageSettings common_; - private com.google.protobuf.SingleFieldBuilderV3< + private com.google.protobuf.SingleFieldBuilder< com.google.api.CommonLanguageSettings, com.google.api.CommonLanguageSettings.Builder, com.google.api.CommonLanguageSettingsOrBuilder> commonBuilder_; + /** * * @@ -460,8 +455,9 @@ public Builder mergeFrom( * @return Whether the common field is set. */ public boolean hasCommon() { - return commonBuilder_ != null || common_ != null; + return ((bitField0_ & 0x00000001) != 0); } + /** * * @@ -482,6 +478,7 @@ public com.google.api.CommonLanguageSettings getCommon() { return commonBuilder_.getMessage(); } } + /** * * @@ -497,13 +494,14 @@ public Builder setCommon(com.google.api.CommonLanguageSettings value) { throw new NullPointerException(); } common_ = value; - onChanged(); } else { commonBuilder_.setMessage(value); } - + bitField0_ |= 0x00000001; + onChanged(); return this; } + /** * * @@ -516,13 +514,14 @@ public Builder setCommon(com.google.api.CommonLanguageSettings value) { public Builder setCommon(com.google.api.CommonLanguageSettings.Builder builderForValue) { if (commonBuilder_ == null) { common_ = builderForValue.build(); - onChanged(); } else { commonBuilder_.setMessage(builderForValue.build()); } - + bitField0_ |= 0x00000001; + onChanged(); return this; } + /** * * @@ -534,21 +533,23 @@ public Builder setCommon(com.google.api.CommonLanguageSettings.Builder builderFo */ public Builder mergeCommon(com.google.api.CommonLanguageSettings value) { if (commonBuilder_ == null) { - if (common_ != null) { - common_ = - com.google.api.CommonLanguageSettings.newBuilder(common_) - .mergeFrom(value) - .buildPartial(); + if (((bitField0_ & 0x00000001) != 0) + && common_ != null + && common_ != com.google.api.CommonLanguageSettings.getDefaultInstance()) { + getCommonBuilder().mergeFrom(value); } else { common_ = value; } - onChanged(); } else { commonBuilder_.mergeFrom(value); } - + if (common_ != null) { + bitField0_ |= 0x00000001; + onChanged(); + } return this; } + /** * * @@ -559,16 +560,16 @@ public Builder mergeCommon(com.google.api.CommonLanguageSettings value) { * .google.api.CommonLanguageSettings common = 1; */ public Builder clearCommon() { - if (commonBuilder_ == null) { - common_ = null; - onChanged(); - } else { - common_ = null; + bitField0_ = (bitField0_ & ~0x00000001); + common_ = null; + if (commonBuilder_ != null) { + commonBuilder_.dispose(); commonBuilder_ = null; } - + onChanged(); return this; } + /** * * @@ -579,10 +580,11 @@ public Builder clearCommon() { * .google.api.CommonLanguageSettings common = 1; */ public com.google.api.CommonLanguageSettings.Builder getCommonBuilder() { - + bitField0_ |= 0x00000001; onChanged(); - return getCommonFieldBuilder().getBuilder(); + return internalGetCommonFieldBuilder().getBuilder(); } + /** * * @@ -601,6 +603,7 @@ public com.google.api.CommonLanguageSettingsOrBuilder getCommonOrBuilder() { : common_; } } + /** * * @@ -610,14 +613,14 @@ public com.google.api.CommonLanguageSettingsOrBuilder getCommonOrBuilder() { * * .google.api.CommonLanguageSettings common = 1; */ - private com.google.protobuf.SingleFieldBuilderV3< + private com.google.protobuf.SingleFieldBuilder< com.google.api.CommonLanguageSettings, com.google.api.CommonLanguageSettings.Builder, com.google.api.CommonLanguageSettingsOrBuilder> - getCommonFieldBuilder() { + internalGetCommonFieldBuilder() { if (commonBuilder_ == null) { commonBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< + new com.google.protobuf.SingleFieldBuilder< com.google.api.CommonLanguageSettings, com.google.api.CommonLanguageSettings.Builder, com.google.api.CommonLanguageSettingsOrBuilder>( @@ -627,17 +630,6 @@ public com.google.api.CommonLanguageSettingsOrBuilder getCommonOrBuilder() { return commonBuilder_; } - @java.lang.Override - public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - // @@protoc_insertion_point(builder_scope:google.api.NodeSettings) } diff --git a/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/NodeSettingsOrBuilder.java b/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/NodeSettingsOrBuilder.java index 4689e7029a..530fba66c7 100644 --- a/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/NodeSettingsOrBuilder.java +++ b/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/NodeSettingsOrBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,10 +14,13 @@ * limitations under the License. */ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: google/api/client.proto +// Protobuf Java Version: 4.33.2 package com.google.api; +@com.google.protobuf.Generated public interface NodeSettingsOrBuilder extends // @@protoc_insertion_point(interface_extends:google.api.NodeSettings) @@ -35,6 +38,7 @@ public interface NodeSettingsOrBuilder * @return Whether the common field is set. */ boolean hasCommon(); + /** * * @@ -47,6 +51,7 @@ public interface NodeSettingsOrBuilder * @return The common. */ com.google.api.CommonLanguageSettings getCommon(); + /** * * diff --git a/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/OAuthRequirements.java b/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/OAuthRequirements.java index 2991b22c7b..75b6bc9058 100644 --- a/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/OAuthRequirements.java +++ b/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/OAuthRequirements.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,9 @@ * limitations under the License. */ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: google/api/auth.proto +// Protobuf Java Version: 4.33.2 package com.google.api; @@ -26,13 +28,17 @@ * there are scopes defined for "Read-only access to Google Calendar" and * "Access to Cloud Platform". Users can consent to a scope for an application, * giving it permission to access that data on their behalf. + * * OAuth scope specifications should be fairly coarse grained; a user will need * to see and understand the text description of what your scope means. + * * In most cases: use one or at most two OAuth scopes for an entire family of * products. If your product has multiple APIs, you should probably be sharing * the OAuth scope across all of those APIs. + * * When you need finer grained OAuth consent screens: talk with your product * management about how developers will use them in practice. + * * Please note that even though each of the canonical scopes is enough for a * request to be accepted and passed to the backend, a request can still fail * due to the backend requiring additional scopes or permissions. @@ -40,13 +46,25 @@ * * Protobuf type {@code google.api.OAuthRequirements} */ -public final class OAuthRequirements extends com.google.protobuf.GeneratedMessageV3 +@com.google.protobuf.Generated +public final class OAuthRequirements extends com.google.protobuf.GeneratedMessage implements // @@protoc_insertion_point(message_implements:google.api.OAuthRequirements) OAuthRequirementsOrBuilder { private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "OAuthRequirements"); + } + // Use OAuthRequirements.newBuilder() to construct. - private OAuthRequirements(com.google.protobuf.GeneratedMessageV3.Builder builder) { + private OAuthRequirements(com.google.protobuf.GeneratedMessage.Builder builder) { super(builder); } @@ -54,23 +72,12 @@ private OAuthRequirements() { canonicalScopes_ = ""; } - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new OAuthRequirements(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.api.AuthProto.internal_static_google_api_OAuthRequirements_descriptor; } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.api.AuthProto.internal_static_google_api_OAuthRequirements_fieldAccessorTable .ensureFieldAccessorsInitialized( @@ -78,16 +85,21 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } public static final int CANONICAL_SCOPES_FIELD_NUMBER = 1; - private volatile java.lang.Object canonicalScopes_; + + @SuppressWarnings("serial") + private volatile java.lang.Object canonicalScopes_ = ""; + /** * * *
            * The list of publicly documented OAuth scopes that are allowed access. An
            * OAuth token containing any of these scopes will be accepted.
        +   *
            * Example:
        -   *      canonical_scopes: https://www.googleapis.com/auth/calendar,
        -   *                        https://www.googleapis.com/auth/calendar.read
        +   *
        +   * canonical_scopes: https://www.googleapis.com/auth/calendar,
        +   * https://www.googleapis.com/auth/calendar.read
            * 
        * * string canonical_scopes = 1; @@ -106,15 +118,18 @@ public java.lang.String getCanonicalScopes() { return s; } } + /** * * *
            * The list of publicly documented OAuth scopes that are allowed access. An
            * OAuth token containing any of these scopes will be accepted.
        +   *
            * Example:
        -   *      canonical_scopes: https://www.googleapis.com/auth/calendar,
        -   *                        https://www.googleapis.com/auth/calendar.read
        +   *
        +   * canonical_scopes: https://www.googleapis.com/auth/calendar,
        +   * https://www.googleapis.com/auth/calendar.read
            * 
        * * string canonical_scopes = 1; @@ -148,8 +163,8 @@ public final boolean isInitialized() { @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(canonicalScopes_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, canonicalScopes_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(canonicalScopes_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, canonicalScopes_); } getUnknownFields().writeTo(output); } @@ -160,8 +175,8 @@ public int getSerializedSize() { if (size != -1) return size; size = 0; - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(canonicalScopes_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, canonicalScopes_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(canonicalScopes_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, canonicalScopes_); } size += getUnknownFields().getSerializedSize(); memoizedSize = size; @@ -233,38 +248,38 @@ public static com.google.api.OAuthRequirements parseFrom( public static com.google.api.OAuthRequirements parseFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); } public static com.google.api.OAuthRequirements parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } public static com.google.api.OAuthRequirements parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); } public static com.google.api.OAuthRequirements parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( PARSER, input, extensionRegistry); } public static com.google.api.OAuthRequirements parseFrom( com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); } public static com.google.api.OAuthRequirements parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } @@ -287,10 +302,11 @@ public Builder toBuilder() { } @java.lang.Override - protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { Builder builder = new Builder(parent); return builder; } + /** * * @@ -299,13 +315,17 @@ protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.Build * there are scopes defined for "Read-only access to Google Calendar" and * "Access to Cloud Platform". Users can consent to a scope for an application, * giving it permission to access that data on their behalf. + * * OAuth scope specifications should be fairly coarse grained; a user will need * to see and understand the text description of what your scope means. + * * In most cases: use one or at most two OAuth scopes for an entire family of * products. If your product has multiple APIs, you should probably be sharing * the OAuth scope across all of those APIs. + * * When you need finer grained OAuth consent screens: talk with your product * management about how developers will use them in practice. + * * Please note that even though each of the canonical scopes is enough for a * request to be accepted and passed to the backend, a request can still fail * due to the backend requiring additional scopes or permissions. @@ -313,7 +333,7 @@ protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.Build * * Protobuf type {@code google.api.OAuthRequirements} */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder implements // @@protoc_insertion_point(builder_implements:google.api.OAuthRequirements) com.google.api.OAuthRequirementsOrBuilder { @@ -322,7 +342,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.api.AuthProto .internal_static_google_api_OAuthRequirements_fieldAccessorTable @@ -334,15 +354,15 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { // Construct using com.google.api.OAuthRequirements.newBuilder() private Builder() {} - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { super(parent); } @java.lang.Override public Builder clear() { super.clear(); + bitField0_ = 0; canonicalScopes_ = ""; - return this; } @@ -368,42 +388,18 @@ public com.google.api.OAuthRequirements build() { @java.lang.Override public com.google.api.OAuthRequirements buildPartial() { com.google.api.OAuthRequirements result = new com.google.api.OAuthRequirements(this); - result.canonicalScopes_ = canonicalScopes_; + if (bitField0_ != 0) { + buildPartial0(result); + } 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); + private void buildPartial0(com.google.api.OAuthRequirements result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.canonicalScopes_ = canonicalScopes_; + } } @java.lang.Override @@ -420,6 +416,7 @@ public Builder mergeFrom(com.google.api.OAuthRequirements other) { if (other == com.google.api.OAuthRequirements.getDefaultInstance()) return this; if (!other.getCanonicalScopes().isEmpty()) { canonicalScopes_ = other.canonicalScopes_; + bitField0_ |= 0x00000001; onChanged(); } this.mergeUnknownFields(other.getUnknownFields()); @@ -451,7 +448,7 @@ public Builder mergeFrom( case 10: { canonicalScopes_ = input.readStringRequireUtf8(); - + bitField0_ |= 0x00000001; break; } // case 10 default: @@ -471,16 +468,21 @@ public Builder mergeFrom( return this; } + private int bitField0_; + private java.lang.Object canonicalScopes_ = ""; + /** * * *
              * The list of publicly documented OAuth scopes that are allowed access. An
              * OAuth token containing any of these scopes will be accepted.
        +     *
              * Example:
        -     *      canonical_scopes: https://www.googleapis.com/auth/calendar,
        -     *                        https://www.googleapis.com/auth/calendar.read
        +     *
        +     * canonical_scopes: https://www.googleapis.com/auth/calendar,
        +     * https://www.googleapis.com/auth/calendar.read
              * 
        * * string canonical_scopes = 1; @@ -498,15 +500,18 @@ public java.lang.String getCanonicalScopes() { return (java.lang.String) ref; } } + /** * * *
              * The list of publicly documented OAuth scopes that are allowed access. An
              * OAuth token containing any of these scopes will be accepted.
        +     *
              * Example:
        -     *      canonical_scopes: https://www.googleapis.com/auth/calendar,
        -     *                        https://www.googleapis.com/auth/calendar.read
        +     *
        +     * canonical_scopes: https://www.googleapis.com/auth/calendar,
        +     * https://www.googleapis.com/auth/calendar.read
              * 
        * * string canonical_scopes = 1; @@ -524,15 +529,18 @@ public com.google.protobuf.ByteString getCanonicalScopesBytes() { return (com.google.protobuf.ByteString) ref; } } + /** * * *
              * The list of publicly documented OAuth scopes that are allowed access. An
              * OAuth token containing any of these scopes will be accepted.
        +     *
              * Example:
        -     *      canonical_scopes: https://www.googleapis.com/auth/calendar,
        -     *                        https://www.googleapis.com/auth/calendar.read
        +     *
        +     * canonical_scopes: https://www.googleapis.com/auth/calendar,
        +     * https://www.googleapis.com/auth/calendar.read
              * 
        * * string canonical_scopes = 1; @@ -544,20 +552,23 @@ public Builder setCanonicalScopes(java.lang.String value) { if (value == null) { throw new NullPointerException(); } - canonicalScopes_ = value; + bitField0_ |= 0x00000001; onChanged(); return this; } + /** * * *
              * The list of publicly documented OAuth scopes that are allowed access. An
              * OAuth token containing any of these scopes will be accepted.
        +     *
              * Example:
        -     *      canonical_scopes: https://www.googleapis.com/auth/calendar,
        -     *                        https://www.googleapis.com/auth/calendar.read
        +     *
        +     * canonical_scopes: https://www.googleapis.com/auth/calendar,
        +     * https://www.googleapis.com/auth/calendar.read
              * 
        * * string canonical_scopes = 1; @@ -565,20 +576,23 @@ public Builder setCanonicalScopes(java.lang.String value) { * @return This builder for chaining. */ public Builder clearCanonicalScopes() { - canonicalScopes_ = getDefaultInstance().getCanonicalScopes(); + bitField0_ = (bitField0_ & ~0x00000001); onChanged(); return this; } + /** * * *
              * The list of publicly documented OAuth scopes that are allowed access. An
              * OAuth token containing any of these scopes will be accepted.
        +     *
              * Example:
        -     *      canonical_scopes: https://www.googleapis.com/auth/calendar,
        -     *                        https://www.googleapis.com/auth/calendar.read
        +     *
        +     * canonical_scopes: https://www.googleapis.com/auth/calendar,
        +     * https://www.googleapis.com/auth/calendar.read
              * 
        * * string canonical_scopes = 1; @@ -591,23 +605,12 @@ public Builder setCanonicalScopesBytes(com.google.protobuf.ByteString value) { throw new NullPointerException(); } checkByteStringIsUtf8(value); - canonicalScopes_ = 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.api.OAuthRequirements) } diff --git a/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/OAuthRequirementsOrBuilder.java b/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/OAuthRequirementsOrBuilder.java index 27a92e367e..70c7e2c7d7 100644 --- a/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/OAuthRequirementsOrBuilder.java +++ b/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/OAuthRequirementsOrBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,10 +14,13 @@ * limitations under the License. */ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: google/api/auth.proto +// Protobuf Java Version: 4.33.2 package com.google.api; +@com.google.protobuf.Generated public interface OAuthRequirementsOrBuilder extends // @@protoc_insertion_point(interface_extends:google.api.OAuthRequirements) @@ -29,9 +32,11 @@ public interface OAuthRequirementsOrBuilder *
            * The list of publicly documented OAuth scopes that are allowed access. An
            * OAuth token containing any of these scopes will be accepted.
        +   *
            * Example:
        -   *      canonical_scopes: https://www.googleapis.com/auth/calendar,
        -   *                        https://www.googleapis.com/auth/calendar.read
        +   *
        +   * canonical_scopes: https://www.googleapis.com/auth/calendar,
        +   * https://www.googleapis.com/auth/calendar.read
            * 
        * * string canonical_scopes = 1; @@ -39,15 +44,18 @@ public interface OAuthRequirementsOrBuilder * @return The canonicalScopes. */ java.lang.String getCanonicalScopes(); + /** * * *
            * The list of publicly documented OAuth scopes that are allowed access. An
            * OAuth token containing any of these scopes will be accepted.
        +   *
            * Example:
        -   *      canonical_scopes: https://www.googleapis.com/auth/calendar,
        -   *                        https://www.googleapis.com/auth/calendar.read
        +   *
        +   * canonical_scopes: https://www.googleapis.com/auth/calendar,
        +   * https://www.googleapis.com/auth/calendar.read
            * 
        * * string canonical_scopes = 1; diff --git a/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/Page.java b/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/Page.java index 5be5ccd592..7e57252646 100644 --- a/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/Page.java +++ b/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/Page.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,9 @@ * limitations under the License. */ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: google/api/documentation.proto +// Protobuf Java Version: 4.33.2 package com.google.api; @@ -28,13 +30,25 @@ * * Protobuf type {@code google.api.Page} */ -public final class Page extends com.google.protobuf.GeneratedMessageV3 +@com.google.protobuf.Generated +public final class Page extends com.google.protobuf.GeneratedMessage implements // @@protoc_insertion_point(message_implements:google.api.Page) PageOrBuilder { private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "Page"); + } + // Use Page.newBuilder() to construct. - private Page(com.google.protobuf.GeneratedMessageV3.Builder builder) { + private Page(com.google.protobuf.GeneratedMessage.Builder builder) { super(builder); } @@ -44,23 +58,12 @@ private Page() { subpages_ = java.util.Collections.emptyList(); } - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new Page(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.api.DocumentationProto.internal_static_google_api_Page_descriptor; } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.api.DocumentationProto.internal_static_google_api_Page_fieldAccessorTable .ensureFieldAccessorsInitialized( @@ -68,7 +71,10 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } public static final int NAME_FIELD_NUMBER = 1; - private volatile java.lang.Object name_; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** * * @@ -80,10 +86,10 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { * documentation. For example: * <pre><code>pages: * - name: Tutorial - * content: &#40;== include tutorial.md ==&#41; - * subpages: - * - name: Java - * content: &#40;== include tutorial_java.md ==&#41; + * content: &#40;== include tutorial.md ==&#41; + * subpages: + * - name: Java + * content: &#40;== include tutorial_java.md ==&#41; * </code></pre> * You can reference `Java` page using Markdown reference link syntax: * `[Java][Tutorial.Java]`. @@ -105,6 +111,7 @@ public java.lang.String getName() { return s; } } + /** * * @@ -116,10 +123,10 @@ public java.lang.String getName() { * documentation. For example: * <pre><code>pages: * - name: Tutorial - * content: &#40;== include tutorial.md ==&#41; - * subpages: - * - name: Java - * content: &#40;== include tutorial_java.md ==&#41; + * content: &#40;== include tutorial.md ==&#41; + * subpages: + * - name: Java + * content: &#40;== include tutorial_java.md ==&#41; * </code></pre> * You can reference `Java` page using Markdown reference link syntax: * `[Java][Tutorial.Java]`. @@ -143,14 +150,17 @@ public com.google.protobuf.ByteString getNameBytes() { } public static final int CONTENT_FIELD_NUMBER = 2; - private volatile java.lang.Object content_; + + @SuppressWarnings("serial") + private volatile java.lang.Object content_ = ""; + /** * * *
        -   * The Markdown content of the page. You can use <code>&#40;== include {path}
        -   * ==&#41;</code> to include content from a Markdown file. The content can be
        -   * used to produce the documentation page such as HTML format page.
        +   * The Markdown content of the page. You can use ```(== include {path}
        +   * ==)``` to include content from a Markdown file. The content can be used
        +   * to produce the documentation page such as HTML format page.
            * 
        * * string content = 2; @@ -169,13 +179,14 @@ public java.lang.String getContent() { return s; } } + /** * * *
        -   * The Markdown content of the page. You can use <code>&#40;== include {path}
        -   * ==&#41;</code> to include content from a Markdown file. The content can be
        -   * used to produce the documentation page such as HTML format page.
        +   * The Markdown content of the page. You can use ```(== include {path}
        +   * ==)``` to include content from a Markdown file. The content can be used
        +   * to produce the documentation page such as HTML format page.
            * 
        * * string content = 2; @@ -196,7 +207,10 @@ public com.google.protobuf.ByteString getContentBytes() { } public static final int SUBPAGES_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") private java.util.List subpages_; + /** * * @@ -211,6 +225,7 @@ public com.google.protobuf.ByteString getContentBytes() { public java.util.List getSubpagesList() { return subpages_; } + /** * * @@ -225,6 +240,7 @@ public java.util.List getSubpagesList() { public java.util.List getSubpagesOrBuilderList() { return subpages_; } + /** * * @@ -239,6 +255,7 @@ public java.util.List getSubpagesOrBuild public int getSubpagesCount() { return subpages_.size(); } + /** * * @@ -253,6 +270,7 @@ public int getSubpagesCount() { public com.google.api.Page getSubpages(int index) { return subpages_.get(index); } + /** * * @@ -282,11 +300,11 @@ public final boolean isInitialized() { @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.GeneratedMessage.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, name_); } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(content_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 2, content_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(content_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, content_); } for (int i = 0; i < subpages_.size(); i++) { output.writeMessage(3, subpages_.get(i)); @@ -300,11 +318,11 @@ public int getSerializedSize() { 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.GeneratedMessage.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, name_); } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(content_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, content_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(content_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, content_); } for (int i = 0; i < subpages_.size(); i++) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, subpages_.get(i)); @@ -387,38 +405,38 @@ public static com.google.api.Page parseFrom( public static com.google.api.Page parseFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); } public static com.google.api.Page parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } public static com.google.api.Page parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); } public static com.google.api.Page parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( PARSER, input, extensionRegistry); } public static com.google.api.Page parseFrom(com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); } public static com.google.api.Page parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } @@ -441,10 +459,11 @@ public Builder toBuilder() { } @java.lang.Override - protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { Builder builder = new Builder(parent); return builder; } + /** * * @@ -455,7 +474,7 @@ protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.Build * * Protobuf type {@code google.api.Page} */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder implements // @@protoc_insertion_point(builder_implements:google.api.Page) com.google.api.PageOrBuilder { @@ -464,7 +483,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.api.DocumentationProto.internal_static_google_api_Page_fieldAccessorTable .ensureFieldAccessorsInitialized( @@ -474,24 +493,23 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { // Construct using com.google.api.Page.newBuilder() private Builder() {} - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { super(parent); } @java.lang.Override public Builder clear() { super.clear(); + bitField0_ = 0; name_ = ""; - content_ = ""; - if (subpagesBuilder_ == null) { subpages_ = java.util.Collections.emptyList(); } else { subpages_ = null; subpagesBuilder_.clear(); } - bitField0_ = (bitField0_ & ~0x00000001); + bitField0_ = (bitField0_ & ~0x00000004); return this; } @@ -517,53 +535,34 @@ public com.google.api.Page build() { @java.lang.Override public com.google.api.Page buildPartial() { com.google.api.Page result = new com.google.api.Page(this); - int from_bitField0_ = bitField0_; - result.name_ = name_; - result.content_ = content_; + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields(com.google.api.Page result) { if (subpagesBuilder_ == null) { - if (((bitField0_ & 0x00000001) != 0)) { + if (((bitField0_ & 0x00000004) != 0)) { subpages_ = java.util.Collections.unmodifiableList(subpages_); - bitField0_ = (bitField0_ & ~0x00000001); + bitField0_ = (bitField0_ & ~0x00000004); } result.subpages_ = subpages_; } else { result.subpages_ = subpagesBuilder_.build(); } - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.setField(field, value); - } - - @java.lang.Override - public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - - @java.lang.Override - public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); } - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.addRepeatedField(field, value); + private void buildPartial0(com.google.api.Page result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.content_ = content_; + } } @java.lang.Override @@ -580,17 +579,19 @@ public Builder mergeFrom(com.google.api.Page other) { if (other == com.google.api.Page.getDefaultInstance()) return this; if (!other.getName().isEmpty()) { name_ = other.name_; + bitField0_ |= 0x00000001; onChanged(); } if (!other.getContent().isEmpty()) { content_ = other.content_; + bitField0_ |= 0x00000002; onChanged(); } if (subpagesBuilder_ == null) { if (!other.subpages_.isEmpty()) { if (subpages_.isEmpty()) { subpages_ = other.subpages_; - bitField0_ = (bitField0_ & ~0x00000001); + bitField0_ = (bitField0_ & ~0x00000004); } else { ensureSubpagesIsMutable(); subpages_.addAll(other.subpages_); @@ -603,10 +604,10 @@ public Builder mergeFrom(com.google.api.Page other) { subpagesBuilder_.dispose(); subpagesBuilder_ = null; subpages_ = other.subpages_; - bitField0_ = (bitField0_ & ~0x00000001); + bitField0_ = (bitField0_ & ~0x00000004); subpagesBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders - ? getSubpagesFieldBuilder() + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders + ? internalGetSubpagesFieldBuilder() : null; } else { subpagesBuilder_.addAllMessages(other.subpages_); @@ -642,13 +643,13 @@ public Builder mergeFrom( case 10: { name_ = input.readStringRequireUtf8(); - + bitField0_ |= 0x00000001; break; } // case 10 case 18: { content_ = input.readStringRequireUtf8(); - + bitField0_ |= 0x00000002; break; } // case 18 case 26: @@ -683,6 +684,7 @@ public Builder mergeFrom( private int bitField0_; private java.lang.Object name_ = ""; + /** * * @@ -694,10 +696,10 @@ public Builder mergeFrom( * documentation. For example: * <pre><code>pages: * - name: Tutorial - * content: &#40;== include tutorial.md ==&#41; - * subpages: - * - name: Java - * content: &#40;== include tutorial_java.md ==&#41; + * content: &#40;== include tutorial.md ==&#41; + * subpages: + * - name: Java + * content: &#40;== include tutorial_java.md ==&#41; * </code></pre> * You can reference `Java` page using Markdown reference link syntax: * `[Java][Tutorial.Java]`. @@ -718,6 +720,7 @@ public java.lang.String getName() { return (java.lang.String) ref; } } + /** * * @@ -729,10 +732,10 @@ public java.lang.String getName() { * documentation. For example: * <pre><code>pages: * - name: Tutorial - * content: &#40;== include tutorial.md ==&#41; - * subpages: - * - name: Java - * content: &#40;== include tutorial_java.md ==&#41; + * content: &#40;== include tutorial.md ==&#41; + * subpages: + * - name: Java + * content: &#40;== include tutorial_java.md ==&#41; * </code></pre> * You can reference `Java` page using Markdown reference link syntax: * `[Java][Tutorial.Java]`. @@ -753,6 +756,7 @@ public com.google.protobuf.ByteString getNameBytes() { return (com.google.protobuf.ByteString) ref; } } + /** * * @@ -764,10 +768,10 @@ public com.google.protobuf.ByteString getNameBytes() { * documentation. For example: * <pre><code>pages: * - name: Tutorial - * content: &#40;== include tutorial.md ==&#41; - * subpages: - * - name: Java - * content: &#40;== include tutorial_java.md ==&#41; + * content: &#40;== include tutorial.md ==&#41; + * subpages: + * - name: Java + * content: &#40;== include tutorial_java.md ==&#41; * </code></pre> * You can reference `Java` page using Markdown reference link syntax: * `[Java][Tutorial.Java]`. @@ -782,11 +786,12 @@ public Builder setName(java.lang.String value) { if (value == null) { throw new NullPointerException(); } - name_ = value; + bitField0_ |= 0x00000001; onChanged(); return this; } + /** * * @@ -798,10 +803,10 @@ public Builder setName(java.lang.String value) { * documentation. For example: * <pre><code>pages: * - name: Tutorial - * content: &#40;== include tutorial.md ==&#41; - * subpages: - * - name: Java - * content: &#40;== include tutorial_java.md ==&#41; + * content: &#40;== include tutorial.md ==&#41; + * subpages: + * - name: Java + * content: &#40;== include tutorial_java.md ==&#41; * </code></pre> * You can reference `Java` page using Markdown reference link syntax: * `[Java][Tutorial.Java]`. @@ -812,11 +817,12 @@ public Builder setName(java.lang.String value) { * @return This builder for chaining. */ public Builder clearName() { - name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); onChanged(); return this; } + /** * * @@ -828,10 +834,10 @@ public Builder clearName() { * documentation. For example: * <pre><code>pages: * - name: Tutorial - * content: &#40;== include tutorial.md ==&#41; - * subpages: - * - name: Java - * content: &#40;== include tutorial_java.md ==&#41; + * content: &#40;== include tutorial.md ==&#41; + * subpages: + * - name: Java + * content: &#40;== include tutorial_java.md ==&#41; * </code></pre> * You can reference `Java` page using Markdown reference link syntax: * `[Java][Tutorial.Java]`. @@ -847,20 +853,21 @@ public Builder setNameBytes(com.google.protobuf.ByteString value) { throw new NullPointerException(); } checkByteStringIsUtf8(value); - name_ = value; + bitField0_ |= 0x00000001; onChanged(); return this; } private java.lang.Object content_ = ""; + /** * * *
        -     * The Markdown content of the page. You can use <code>&#40;== include {path}
        -     * ==&#41;</code> to include content from a Markdown file. The content can be
        -     * used to produce the documentation page such as HTML format page.
        +     * The Markdown content of the page. You can use ```(== include {path}
        +     * ==)``` to include content from a Markdown file. The content can be used
        +     * to produce the documentation page such as HTML format page.
              * 
        * * string content = 2; @@ -878,13 +885,14 @@ public java.lang.String getContent() { return (java.lang.String) ref; } } + /** * * *
        -     * The Markdown content of the page. You can use <code>&#40;== include {path}
        -     * ==&#41;</code> to include content from a Markdown file. The content can be
        -     * used to produce the documentation page such as HTML format page.
        +     * The Markdown content of the page. You can use ```(== include {path}
        +     * ==)``` to include content from a Markdown file. The content can be used
        +     * to produce the documentation page such as HTML format page.
              * 
        * * string content = 2; @@ -902,13 +910,14 @@ public com.google.protobuf.ByteString getContentBytes() { return (com.google.protobuf.ByteString) ref; } } + /** * * *
        -     * The Markdown content of the page. You can use <code>&#40;== include {path}
        -     * ==&#41;</code> to include content from a Markdown file. The content can be
        -     * used to produce the documentation page such as HTML format page.
        +     * The Markdown content of the page. You can use ```(== include {path}
        +     * ==)``` to include content from a Markdown file. The content can be used
        +     * to produce the documentation page such as HTML format page.
              * 
        * * string content = 2; @@ -920,18 +929,19 @@ public Builder setContent(java.lang.String value) { if (value == null) { throw new NullPointerException(); } - content_ = value; + bitField0_ |= 0x00000002; onChanged(); return this; } + /** * * *
        -     * The Markdown content of the page. You can use <code>&#40;== include {path}
        -     * ==&#41;</code> to include content from a Markdown file. The content can be
        -     * used to produce the documentation page such as HTML format page.
        +     * The Markdown content of the page. You can use ```(== include {path}
        +     * ==)``` to include content from a Markdown file. The content can be used
        +     * to produce the documentation page such as HTML format page.
              * 
        * * string content = 2; @@ -939,18 +949,19 @@ public Builder setContent(java.lang.String value) { * @return This builder for chaining. */ public Builder clearContent() { - content_ = getDefaultInstance().getContent(); + bitField0_ = (bitField0_ & ~0x00000002); onChanged(); return this; } + /** * * *
        -     * The Markdown content of the page. You can use <code>&#40;== include {path}
        -     * ==&#41;</code> to include content from a Markdown file. The content can be
        -     * used to produce the documentation page such as HTML format page.
        +     * The Markdown content of the page. You can use ```(== include {path}
        +     * ==)``` to include content from a Markdown file. The content can be used
        +     * to produce the documentation page such as HTML format page.
              * 
        * * string content = 2; @@ -963,8 +974,8 @@ public Builder setContentBytes(com.google.protobuf.ByteString value) { throw new NullPointerException(); } checkByteStringIsUtf8(value); - content_ = value; + bitField0_ |= 0x00000002; onChanged(); return this; } @@ -972,13 +983,13 @@ public Builder setContentBytes(com.google.protobuf.ByteString value) { private java.util.List subpages_ = java.util.Collections.emptyList(); private void ensureSubpagesIsMutable() { - if (!((bitField0_ & 0x00000001) != 0)) { + if (!((bitField0_ & 0x00000004) != 0)) { subpages_ = new java.util.ArrayList(subpages_); - bitField0_ |= 0x00000001; + bitField0_ |= 0x00000004; } } - private com.google.protobuf.RepeatedFieldBuilderV3< + private com.google.protobuf.RepeatedFieldBuilder< com.google.api.Page, com.google.api.Page.Builder, com.google.api.PageOrBuilder> subpagesBuilder_; @@ -999,6 +1010,7 @@ public java.util.List getSubpagesList() { return subpagesBuilder_.getMessageList(); } } + /** * * @@ -1016,6 +1028,7 @@ public int getSubpagesCount() { return subpagesBuilder_.getCount(); } } + /** * * @@ -1033,6 +1046,7 @@ public com.google.api.Page getSubpages(int index) { return subpagesBuilder_.getMessage(index); } } + /** * * @@ -1056,6 +1070,7 @@ public Builder setSubpages(int index, com.google.api.Page value) { } return this; } + /** * * @@ -1076,6 +1091,7 @@ public Builder setSubpages(int index, com.google.api.Page.Builder builderForValu } return this; } + /** * * @@ -1099,6 +1115,7 @@ public Builder addSubpages(com.google.api.Page value) { } return this; } + /** * * @@ -1122,6 +1139,7 @@ public Builder addSubpages(int index, com.google.api.Page value) { } return this; } + /** * * @@ -1142,6 +1160,7 @@ public Builder addSubpages(com.google.api.Page.Builder builderForValue) { } return this; } + /** * * @@ -1162,6 +1181,7 @@ public Builder addSubpages(int index, com.google.api.Page.Builder builderForValu } return this; } + /** * * @@ -1182,6 +1202,7 @@ public Builder addAllSubpages(java.lang.Iterable } return this; } + /** * * @@ -1195,13 +1216,14 @@ public Builder addAllSubpages(java.lang.Iterable public Builder clearSubpages() { if (subpagesBuilder_ == null) { subpages_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); + bitField0_ = (bitField0_ & ~0x00000004); onChanged(); } else { subpagesBuilder_.clear(); } return this; } + /** * * @@ -1222,6 +1244,7 @@ public Builder removeSubpages(int index) { } return this; } + /** * * @@ -1233,8 +1256,9 @@ public Builder removeSubpages(int index) { * repeated .google.api.Page subpages = 3; */ public com.google.api.Page.Builder getSubpagesBuilder(int index) { - return getSubpagesFieldBuilder().getBuilder(index); + return internalGetSubpagesFieldBuilder().getBuilder(index); } + /** * * @@ -1252,6 +1276,7 @@ public com.google.api.PageOrBuilder getSubpagesOrBuilder(int index) { return subpagesBuilder_.getMessageOrBuilder(index); } } + /** * * @@ -1269,6 +1294,7 @@ public java.util.List getSubpagesOrBuild return java.util.Collections.unmodifiableList(subpages_); } } + /** * * @@ -1280,8 +1306,9 @@ public java.util.List getSubpagesOrBuild * repeated .google.api.Page subpages = 3; */ public com.google.api.Page.Builder addSubpagesBuilder() { - return getSubpagesFieldBuilder().addBuilder(com.google.api.Page.getDefaultInstance()); + return internalGetSubpagesFieldBuilder().addBuilder(com.google.api.Page.getDefaultInstance()); } + /** * * @@ -1293,8 +1320,10 @@ public com.google.api.Page.Builder addSubpagesBuilder() { * repeated .google.api.Page subpages = 3; */ public com.google.api.Page.Builder addSubpagesBuilder(int index) { - return getSubpagesFieldBuilder().addBuilder(index, com.google.api.Page.getDefaultInstance()); + return internalGetSubpagesFieldBuilder() + .addBuilder(index, com.google.api.Page.getDefaultInstance()); } + /** * * @@ -1306,33 +1335,22 @@ public com.google.api.Page.Builder addSubpagesBuilder(int index) { * repeated .google.api.Page subpages = 3; */ public java.util.List getSubpagesBuilderList() { - return getSubpagesFieldBuilder().getBuilderList(); + return internalGetSubpagesFieldBuilder().getBuilderList(); } - private com.google.protobuf.RepeatedFieldBuilderV3< + private com.google.protobuf.RepeatedFieldBuilder< com.google.api.Page, com.google.api.Page.Builder, com.google.api.PageOrBuilder> - getSubpagesFieldBuilder() { + internalGetSubpagesFieldBuilder() { if (subpagesBuilder_ == null) { subpagesBuilder_ = - new com.google.protobuf.RepeatedFieldBuilderV3< + new com.google.protobuf.RepeatedFieldBuilder< com.google.api.Page, com.google.api.Page.Builder, com.google.api.PageOrBuilder>( - subpages_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + subpages_, ((bitField0_ & 0x00000004) != 0), getParentForChildren(), isClean()); subpages_ = null; } return subpagesBuilder_; } - @java.lang.Override - public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - // @@protoc_insertion_point(builder_scope:google.api.Page) } diff --git a/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/PageOrBuilder.java b/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/PageOrBuilder.java index 126503118a..d0438763fd 100644 --- a/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/PageOrBuilder.java +++ b/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/PageOrBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,10 +14,13 @@ * limitations under the License. */ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: google/api/documentation.proto +// Protobuf Java Version: 4.33.2 package com.google.api; +@com.google.protobuf.Generated public interface PageOrBuilder extends // @@protoc_insertion_point(interface_extends:google.api.Page) @@ -34,10 +37,10 @@ public interface PageOrBuilder * documentation. For example: * <pre><code>pages: * - name: Tutorial - * content: &#40;== include tutorial.md ==&#41; - * subpages: - * - name: Java - * content: &#40;== include tutorial_java.md ==&#41; + * content: &#40;== include tutorial.md ==&#41; + * subpages: + * - name: Java + * content: &#40;== include tutorial_java.md ==&#41; * </code></pre> * You can reference `Java` page using Markdown reference link syntax: * `[Java][Tutorial.Java]`. @@ -48,6 +51,7 @@ public interface PageOrBuilder * @return The name. */ java.lang.String getName(); + /** * * @@ -59,10 +63,10 @@ public interface PageOrBuilder * documentation. For example: * <pre><code>pages: * - name: Tutorial - * content: &#40;== include tutorial.md ==&#41; - * subpages: - * - name: Java - * content: &#40;== include tutorial_java.md ==&#41; + * content: &#40;== include tutorial.md ==&#41; + * subpages: + * - name: Java + * content: &#40;== include tutorial_java.md ==&#41; * </code></pre> * You can reference `Java` page using Markdown reference link syntax: * `[Java][Tutorial.Java]`. @@ -78,9 +82,9 @@ public interface PageOrBuilder * * *
        -   * The Markdown content of the page. You can use <code>&#40;== include {path}
        -   * ==&#41;</code> to include content from a Markdown file. The content can be
        -   * used to produce the documentation page such as HTML format page.
        +   * The Markdown content of the page. You can use ```(== include {path}
        +   * ==)``` to include content from a Markdown file. The content can be used
        +   * to produce the documentation page such as HTML format page.
            * 
        * * string content = 2; @@ -88,13 +92,14 @@ public interface PageOrBuilder * @return The content. */ java.lang.String getContent(); + /** * * *
        -   * The Markdown content of the page. You can use <code>&#40;== include {path}
        -   * ==&#41;</code> to include content from a Markdown file. The content can be
        -   * used to produce the documentation page such as HTML format page.
        +   * The Markdown content of the page. You can use ```(== include {path}
        +   * ==)``` to include content from a Markdown file. The content can be used
        +   * to produce the documentation page such as HTML format page.
            * 
        * * string content = 2; @@ -114,6 +119,7 @@ public interface PageOrBuilder * repeated .google.api.Page subpages = 3; */ java.util.List getSubpagesList(); + /** * * @@ -125,6 +131,7 @@ public interface PageOrBuilder * repeated .google.api.Page subpages = 3; */ com.google.api.Page getSubpages(int index); + /** * * @@ -136,6 +143,7 @@ public interface PageOrBuilder * repeated .google.api.Page subpages = 3; */ int getSubpagesCount(); + /** * * @@ -147,6 +155,7 @@ public interface PageOrBuilder * repeated .google.api.Page subpages = 3; */ java.util.List getSubpagesOrBuilderList(); + /** * * diff --git a/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/PhpSettings.java b/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/PhpSettings.java index ef4161110c..eff8b20b9e 100644 --- a/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/PhpSettings.java +++ b/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/PhpSettings.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,9 @@ * limitations under the License. */ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: google/api/client.proto +// Protobuf Java Version: 4.33.2 package com.google.api; @@ -27,43 +29,46 @@ * * Protobuf type {@code google.api.PhpSettings} */ -public final class PhpSettings extends com.google.protobuf.GeneratedMessageV3 +@com.google.protobuf.Generated +public final class PhpSettings extends com.google.protobuf.GeneratedMessage implements // @@protoc_insertion_point(message_implements:google.api.PhpSettings) PhpSettingsOrBuilder { private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "PhpSettings"); + } + // Use PhpSettings.newBuilder() to construct. - private PhpSettings(com.google.protobuf.GeneratedMessageV3.Builder builder) { + private PhpSettings(com.google.protobuf.GeneratedMessage.Builder builder) { super(builder); } private PhpSettings() {} - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new PhpSettings(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.api.ClientProto.internal_static_google_api_PhpSettings_descriptor; } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.api.ClientProto.internal_static_google_api_PhpSettings_fieldAccessorTable .ensureFieldAccessorsInitialized( com.google.api.PhpSettings.class, com.google.api.PhpSettings.Builder.class); } + private int bitField0_; public static final int COMMON_FIELD_NUMBER = 1; private com.google.api.CommonLanguageSettings common_; + /** * * @@ -77,8 +82,9 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { */ @java.lang.Override public boolean hasCommon() { - return common_ != null; + return ((bitField0_ & 0x00000001) != 0); } + /** * * @@ -94,6 +100,7 @@ public boolean hasCommon() { public com.google.api.CommonLanguageSettings getCommon() { return common_ == null ? com.google.api.CommonLanguageSettings.getDefaultInstance() : common_; } + /** * * @@ -105,7 +112,7 @@ public com.google.api.CommonLanguageSettings getCommon() { */ @java.lang.Override public com.google.api.CommonLanguageSettingsOrBuilder getCommonOrBuilder() { - return getCommon(); + return common_ == null ? com.google.api.CommonLanguageSettings.getDefaultInstance() : common_; } private byte memoizedIsInitialized = -1; @@ -122,7 +129,7 @@ public final boolean isInitialized() { @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (common_ != null) { + if (((bitField0_ & 0x00000001) != 0)) { output.writeMessage(1, getCommon()); } getUnknownFields().writeTo(output); @@ -134,7 +141,7 @@ public int getSerializedSize() { if (size != -1) return size; size = 0; - if (common_ != null) { + if (((bitField0_ & 0x00000001) != 0)) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getCommon()); } size += getUnknownFields().getSerializedSize(); @@ -212,38 +219,38 @@ public static com.google.api.PhpSettings parseFrom( public static com.google.api.PhpSettings parseFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); } public static com.google.api.PhpSettings parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } public static com.google.api.PhpSettings parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); } public static com.google.api.PhpSettings parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( PARSER, input, extensionRegistry); } public static com.google.api.PhpSettings parseFrom(com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); } public static com.google.api.PhpSettings parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } @@ -266,10 +273,11 @@ public Builder toBuilder() { } @java.lang.Override - protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { Builder builder = new Builder(parent); return builder; } + /** * * @@ -279,7 +287,7 @@ protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.Build * * Protobuf type {@code google.api.PhpSettings} */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder implements // @@protoc_insertion_point(builder_implements:google.api.PhpSettings) com.google.api.PhpSettingsOrBuilder { @@ -288,7 +296,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.api.ClientProto.internal_static_google_api_PhpSettings_fieldAccessorTable .ensureFieldAccessorsInitialized( @@ -296,19 +304,28 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } // Construct using com.google.api.PhpSettings.newBuilder() - private Builder() {} + private Builder() { + maybeForceBuilderInitialization(); + } - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetCommonFieldBuilder(); + } } @java.lang.Override public Builder clear() { super.clear(); - if (commonBuilder_ == null) { - common_ = null; - } else { - common_ = null; + bitField0_ = 0; + common_ = null; + if (commonBuilder_ != null) { + commonBuilder_.dispose(); commonBuilder_ = null; } return this; @@ -336,46 +353,21 @@ public com.google.api.PhpSettings build() { @java.lang.Override public com.google.api.PhpSettings buildPartial() { com.google.api.PhpSettings result = new com.google.api.PhpSettings(this); - if (commonBuilder_ == null) { - result.common_ = common_; - } else { - result.common_ = commonBuilder_.build(); + if (bitField0_ != 0) { + buildPartial0(result); } 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); + private void buildPartial0(com.google.api.PhpSettings result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.common_ = commonBuilder_ == null ? common_ : commonBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + result.bitField0_ |= to_bitField0_; } @java.lang.Override @@ -421,8 +413,8 @@ public Builder mergeFrom( break; case 10: { - input.readMessage(getCommonFieldBuilder().getBuilder(), extensionRegistry); - + input.readMessage(internalGetCommonFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000001; break; } // case 10 default: @@ -442,12 +434,15 @@ public Builder mergeFrom( return this; } + private int bitField0_; + private com.google.api.CommonLanguageSettings common_; - private com.google.protobuf.SingleFieldBuilderV3< + private com.google.protobuf.SingleFieldBuilder< com.google.api.CommonLanguageSettings, com.google.api.CommonLanguageSettings.Builder, com.google.api.CommonLanguageSettingsOrBuilder> commonBuilder_; + /** * * @@ -460,8 +455,9 @@ public Builder mergeFrom( * @return Whether the common field is set. */ public boolean hasCommon() { - return commonBuilder_ != null || common_ != null; + return ((bitField0_ & 0x00000001) != 0); } + /** * * @@ -482,6 +478,7 @@ public com.google.api.CommonLanguageSettings getCommon() { return commonBuilder_.getMessage(); } } + /** * * @@ -497,13 +494,14 @@ public Builder setCommon(com.google.api.CommonLanguageSettings value) { throw new NullPointerException(); } common_ = value; - onChanged(); } else { commonBuilder_.setMessage(value); } - + bitField0_ |= 0x00000001; + onChanged(); return this; } + /** * * @@ -516,13 +514,14 @@ public Builder setCommon(com.google.api.CommonLanguageSettings value) { public Builder setCommon(com.google.api.CommonLanguageSettings.Builder builderForValue) { if (commonBuilder_ == null) { common_ = builderForValue.build(); - onChanged(); } else { commonBuilder_.setMessage(builderForValue.build()); } - + bitField0_ |= 0x00000001; + onChanged(); return this; } + /** * * @@ -534,21 +533,23 @@ public Builder setCommon(com.google.api.CommonLanguageSettings.Builder builderFo */ public Builder mergeCommon(com.google.api.CommonLanguageSettings value) { if (commonBuilder_ == null) { - if (common_ != null) { - common_ = - com.google.api.CommonLanguageSettings.newBuilder(common_) - .mergeFrom(value) - .buildPartial(); + if (((bitField0_ & 0x00000001) != 0) + && common_ != null + && common_ != com.google.api.CommonLanguageSettings.getDefaultInstance()) { + getCommonBuilder().mergeFrom(value); } else { common_ = value; } - onChanged(); } else { commonBuilder_.mergeFrom(value); } - + if (common_ != null) { + bitField0_ |= 0x00000001; + onChanged(); + } return this; } + /** * * @@ -559,16 +560,16 @@ public Builder mergeCommon(com.google.api.CommonLanguageSettings value) { * .google.api.CommonLanguageSettings common = 1; */ public Builder clearCommon() { - if (commonBuilder_ == null) { - common_ = null; - onChanged(); - } else { - common_ = null; + bitField0_ = (bitField0_ & ~0x00000001); + common_ = null; + if (commonBuilder_ != null) { + commonBuilder_.dispose(); commonBuilder_ = null; } - + onChanged(); return this; } + /** * * @@ -579,10 +580,11 @@ public Builder clearCommon() { * .google.api.CommonLanguageSettings common = 1; */ public com.google.api.CommonLanguageSettings.Builder getCommonBuilder() { - + bitField0_ |= 0x00000001; onChanged(); - return getCommonFieldBuilder().getBuilder(); + return internalGetCommonFieldBuilder().getBuilder(); } + /** * * @@ -601,6 +603,7 @@ public com.google.api.CommonLanguageSettingsOrBuilder getCommonOrBuilder() { : common_; } } + /** * * @@ -610,14 +613,14 @@ public com.google.api.CommonLanguageSettingsOrBuilder getCommonOrBuilder() { * * .google.api.CommonLanguageSettings common = 1; */ - private com.google.protobuf.SingleFieldBuilderV3< + private com.google.protobuf.SingleFieldBuilder< com.google.api.CommonLanguageSettings, com.google.api.CommonLanguageSettings.Builder, com.google.api.CommonLanguageSettingsOrBuilder> - getCommonFieldBuilder() { + internalGetCommonFieldBuilder() { if (commonBuilder_ == null) { commonBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< + new com.google.protobuf.SingleFieldBuilder< com.google.api.CommonLanguageSettings, com.google.api.CommonLanguageSettings.Builder, com.google.api.CommonLanguageSettingsOrBuilder>( @@ -627,17 +630,6 @@ public com.google.api.CommonLanguageSettingsOrBuilder getCommonOrBuilder() { return commonBuilder_; } - @java.lang.Override - public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - // @@protoc_insertion_point(builder_scope:google.api.PhpSettings) } diff --git a/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/PhpSettingsOrBuilder.java b/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/PhpSettingsOrBuilder.java index 09fa6be89a..bdb702f445 100644 --- a/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/PhpSettingsOrBuilder.java +++ b/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/PhpSettingsOrBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,10 +14,13 @@ * limitations under the License. */ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: google/api/client.proto +// Protobuf Java Version: 4.33.2 package com.google.api; +@com.google.protobuf.Generated public interface PhpSettingsOrBuilder extends // @@protoc_insertion_point(interface_extends:google.api.PhpSettings) @@ -35,6 +38,7 @@ public interface PhpSettingsOrBuilder * @return Whether the common field is set. */ boolean hasCommon(); + /** * * @@ -47,6 +51,7 @@ public interface PhpSettingsOrBuilder * @return The common. */ com.google.api.CommonLanguageSettings getCommon(); + /** * * diff --git a/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/PolicyProto.java b/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/PolicyProto.java new file mode 100644 index 0000000000..eb1771e5c7 --- /dev/null +++ b/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/PolicyProto.java @@ -0,0 +1,139 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/api/policy.proto +// Protobuf Java Version: 4.33.2 + +package com.google.api; + +@com.google.protobuf.Generated +public final class PolicyProto extends com.google.protobuf.GeneratedFile { + private PolicyProto() {} + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "PolicyProto"); + } + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistryLite registry) { + registry.add(com.google.api.PolicyProto.fieldPolicy); + registry.add(com.google.api.PolicyProto.methodPolicy); + } + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions((com.google.protobuf.ExtensionRegistryLite) registry); + } + + public static final int FIELD_POLICY_FIELD_NUMBER = 158361448; + + /** + * + * + *
        +   * See [FieldPolicy][].
        +   * 
        + * + * extend .google.protobuf.FieldOptions { ... } + */ + public static final com.google.protobuf.GeneratedMessage.GeneratedExtension< + com.google.protobuf.DescriptorProtos.FieldOptions, com.google.api.FieldPolicy> + fieldPolicy = + com.google.protobuf.GeneratedMessage.newFileScopedGeneratedExtension( + com.google.api.FieldPolicy.class, com.google.api.FieldPolicy.getDefaultInstance()); + + public static final int METHOD_POLICY_FIELD_NUMBER = 161893301; + + /** + * + * + *
        +   * See [MethodPolicy][].
        +   * 
        + * + * extend .google.protobuf.MethodOptions { ... } + */ + public static final com.google.protobuf.GeneratedMessage.GeneratedExtension< + com.google.protobuf.DescriptorProtos.MethodOptions, com.google.api.MethodPolicy> + methodPolicy = + com.google.protobuf.GeneratedMessage.newFileScopedGeneratedExtension( + com.google.api.MethodPolicy.class, com.google.api.MethodPolicy.getDefaultInstance()); + + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_api_FieldPolicy_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_api_FieldPolicy_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_api_MethodPolicy_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_api_MethodPolicy_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\027google/api/policy.proto\022\ngoogle.api\032 g" + + "oogle/protobuf/descriptor.proto\"S\n\013Field" + + "Policy\022\020\n\010selector\030\001 \001(\t\022\033\n\023resource_per" + + "mission\030\002 \001(\t\022\025\n\rresource_type\030\003 \001(\t\"S\n\014" + + "MethodPolicy\022\020\n\010selector\030\t \001(\t\0221\n\020reques" + + "t_policies\030\002 \003(\0132\027.google.api.FieldPolic" + + "y:O\n\014field_policy\022\035.google.protobuf.Fiel" + + "dOptions\030\350\316\301K \001(\0132\027.google.api.FieldPoli" + + "cy:R\n\rmethod_policy\022\036.google.protobuf.Me" + + "thodOptions\030\265\227\231M \001(\0132\030.google.api.Method" + + "PolicyBm\n\016com.google.apiB\013PolicyProtoP\001Z" + + "Egoogle.golang.org/genproto/googleapis/a" + + "pi/serviceconfig;serviceconfig\242\002\004GAPIb\006p" + + "roto3" + }; + descriptor = + com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( + descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + com.google.protobuf.DescriptorProtos.getDescriptor(), + }); + internal_static_google_api_FieldPolicy_descriptor = getDescriptor().getMessageType(0); + internal_static_google_api_FieldPolicy_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_api_FieldPolicy_descriptor, + new java.lang.String[] { + "Selector", "ResourcePermission", "ResourceType", + }); + internal_static_google_api_MethodPolicy_descriptor = getDescriptor().getMessageType(1); + internal_static_google_api_MethodPolicy_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_api_MethodPolicy_descriptor, + new java.lang.String[] { + "Selector", "RequestPolicies", + }); + fieldPolicy.internalInit(descriptor.getExtension(0)); + methodPolicy.internalInit(descriptor.getExtension(1)); + descriptor.resolveAllFeaturesImmutable(); + com.google.protobuf.DescriptorProtos.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/ProjectProperties.java b/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/ProjectProperties.java index e15bf00c85..c41163fb66 100644 --- a/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/ProjectProperties.java +++ b/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/ProjectProperties.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,9 @@ * limitations under the License. */ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: google/api/consumer.proto +// Protobuf Java Version: 4.33.2 package com.google.api; @@ -28,25 +30,39 @@ * associated with a school, or a business, or a government agency, a business * type property on the project may affect how a service responds to the client. * This descriptor defines which properties are allowed to be set on a project. + * * Example: - * project_properties: - * properties: - * - name: NO_WATERMARK - * type: BOOL - * description: Allows usage of the API without watermarks. - * - name: EXTENDED_TILE_CACHE_PERIOD - * type: INT64 + * + * project_properties: + * properties: + * - name: NO_WATERMARK + * type: BOOL + * description: Allows usage of the API without watermarks. + * - name: EXTENDED_TILE_CACHE_PERIOD + * type: INT64 *
        * * Protobuf type {@code google.api.ProjectProperties} */ -public final class ProjectProperties extends com.google.protobuf.GeneratedMessageV3 +@com.google.protobuf.Generated +public final class ProjectProperties extends com.google.protobuf.GeneratedMessage implements // @@protoc_insertion_point(message_implements:google.api.ProjectProperties) ProjectPropertiesOrBuilder { private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "ProjectProperties"); + } + // Use ProjectProperties.newBuilder() to construct. - private ProjectProperties(com.google.protobuf.GeneratedMessageV3.Builder builder) { + private ProjectProperties(com.google.protobuf.GeneratedMessage.Builder builder) { super(builder); } @@ -54,23 +70,12 @@ private ProjectProperties() { properties_ = java.util.Collections.emptyList(); } - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new ProjectProperties(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.api.ConsumerProto.internal_static_google_api_ProjectProperties_descriptor; } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.api.ConsumerProto .internal_static_google_api_ProjectProperties_fieldAccessorTable @@ -79,7 +84,10 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } public static final int PROPERTIES_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") private java.util.List properties_; + /** * * @@ -93,6 +101,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { public java.util.List getPropertiesList() { return properties_; } + /** * * @@ -106,6 +115,7 @@ public java.util.List getPropertiesList() { public java.util.List getPropertiesOrBuilderList() { return properties_; } + /** * * @@ -119,6 +129,7 @@ public java.util.List getPropertiesO public int getPropertiesCount() { return properties_.size(); } + /** * * @@ -132,6 +143,7 @@ public int getPropertiesCount() { public com.google.api.Property getProperties(int index) { return properties_.get(index); } + /** * * @@ -247,38 +259,38 @@ public static com.google.api.ProjectProperties parseFrom( public static com.google.api.ProjectProperties parseFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); } public static com.google.api.ProjectProperties parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } public static com.google.api.ProjectProperties parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); } public static com.google.api.ProjectProperties parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( PARSER, input, extensionRegistry); } public static com.google.api.ProjectProperties parseFrom( com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); } public static com.google.api.ProjectProperties parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } @@ -301,10 +313,11 @@ public Builder toBuilder() { } @java.lang.Override - protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { Builder builder = new Builder(parent); return builder; } + /** * * @@ -315,19 +328,21 @@ protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.Build * associated with a school, or a business, or a government agency, a business * type property on the project may affect how a service responds to the client. * This descriptor defines which properties are allowed to be set on a project. + * * Example: - * project_properties: - * properties: - * - name: NO_WATERMARK - * type: BOOL - * description: Allows usage of the API without watermarks. - * - name: EXTENDED_TILE_CACHE_PERIOD - * type: INT64 + * + * project_properties: + * properties: + * - name: NO_WATERMARK + * type: BOOL + * description: Allows usage of the API without watermarks. + * - name: EXTENDED_TILE_CACHE_PERIOD + * type: INT64 * * * Protobuf type {@code google.api.ProjectProperties} */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder implements // @@protoc_insertion_point(builder_implements:google.api.ProjectProperties) com.google.api.ProjectPropertiesOrBuilder { @@ -336,7 +351,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.api.ConsumerProto .internal_static_google_api_ProjectProperties_fieldAccessorTable @@ -348,13 +363,14 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { // Construct using com.google.api.ProjectProperties.newBuilder() private Builder() {} - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { super(parent); } @java.lang.Override public Builder clear() { super.clear(); + bitField0_ = 0; if (propertiesBuilder_ == null) { properties_ = java.util.Collections.emptyList(); } else { @@ -387,7 +403,15 @@ public com.google.api.ProjectProperties build() { @java.lang.Override public com.google.api.ProjectProperties buildPartial() { com.google.api.ProjectProperties result = new com.google.api.ProjectProperties(this); - int from_bitField0_ = bitField0_; + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields(com.google.api.ProjectProperties result) { if (propertiesBuilder_ == null) { if (((bitField0_ & 0x00000001) != 0)) { properties_ = java.util.Collections.unmodifiableList(properties_); @@ -397,41 +421,10 @@ public com.google.api.ProjectProperties buildPartial() { } else { result.properties_ = propertiesBuilder_.build(); } - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.setField(field, value); } - @java.lang.Override - public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - - @java.lang.Override - public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.addRepeatedField(field, value); + private void buildPartial0(com.google.api.ProjectProperties result) { + int from_bitField0_ = bitField0_; } @java.lang.Override @@ -465,8 +458,8 @@ public Builder mergeFrom(com.google.api.ProjectProperties other) { properties_ = other.properties_; bitField0_ = (bitField0_ & ~0x00000001); propertiesBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders - ? getPropertiesFieldBuilder() + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders + ? internalGetPropertiesFieldBuilder() : null; } else { propertiesBuilder_.addAllMessages(other.properties_); @@ -539,7 +532,7 @@ private void ensurePropertiesIsMutable() { } } - private com.google.protobuf.RepeatedFieldBuilderV3< + private com.google.protobuf.RepeatedFieldBuilder< com.google.api.Property, com.google.api.Property.Builder, com.google.api.PropertyOrBuilder> @@ -561,6 +554,7 @@ public java.util.List getPropertiesList() { return propertiesBuilder_.getMessageList(); } } + /** * * @@ -577,6 +571,7 @@ public int getPropertiesCount() { return propertiesBuilder_.getCount(); } } + /** * * @@ -593,6 +588,7 @@ public com.google.api.Property getProperties(int index) { return propertiesBuilder_.getMessage(index); } } + /** * * @@ -615,6 +611,7 @@ public Builder setProperties(int index, com.google.api.Property value) { } return this; } + /** * * @@ -634,6 +631,7 @@ public Builder setProperties(int index, com.google.api.Property.Builder builderF } return this; } + /** * * @@ -656,6 +654,7 @@ public Builder addProperties(com.google.api.Property value) { } return this; } + /** * * @@ -678,6 +677,7 @@ public Builder addProperties(int index, com.google.api.Property value) { } return this; } + /** * * @@ -697,6 +697,7 @@ public Builder addProperties(com.google.api.Property.Builder builderForValue) { } return this; } + /** * * @@ -716,6 +717,7 @@ public Builder addProperties(int index, com.google.api.Property.Builder builderF } return this; } + /** * * @@ -735,6 +737,7 @@ public Builder addAllProperties(java.lang.Iterablerepeated .google.api.Property properties = 1;
        */ public com.google.api.Property.Builder getPropertiesBuilder(int index) { - return getPropertiesFieldBuilder().getBuilder(index); + return internalGetPropertiesFieldBuilder().getBuilder(index); } + /** * * @@ -801,6 +807,7 @@ public com.google.api.PropertyOrBuilder getPropertiesOrBuilder(int index) { return propertiesBuilder_.getMessageOrBuilder(index); } } + /** * * @@ -817,6 +824,7 @@ public java.util.List getPropertiesO return java.util.Collections.unmodifiableList(properties_); } } + /** * * @@ -827,8 +835,10 @@ public java.util.List getPropertiesO * repeated .google.api.Property properties = 1; */ public com.google.api.Property.Builder addPropertiesBuilder() { - return getPropertiesFieldBuilder().addBuilder(com.google.api.Property.getDefaultInstance()); + return internalGetPropertiesFieldBuilder() + .addBuilder(com.google.api.Property.getDefaultInstance()); } + /** * * @@ -839,9 +849,10 @@ public com.google.api.Property.Builder addPropertiesBuilder() { * repeated .google.api.Property properties = 1; */ public com.google.api.Property.Builder addPropertiesBuilder(int index) { - return getPropertiesFieldBuilder() + return internalGetPropertiesFieldBuilder() .addBuilder(index, com.google.api.Property.getDefaultInstance()); } + /** * * @@ -852,17 +863,17 @@ public com.google.api.Property.Builder addPropertiesBuilder(int index) { * repeated .google.api.Property properties = 1; */ public java.util.List getPropertiesBuilderList() { - return getPropertiesFieldBuilder().getBuilderList(); + return internalGetPropertiesFieldBuilder().getBuilderList(); } - private com.google.protobuf.RepeatedFieldBuilderV3< + private com.google.protobuf.RepeatedFieldBuilder< com.google.api.Property, com.google.api.Property.Builder, com.google.api.PropertyOrBuilder> - getPropertiesFieldBuilder() { + internalGetPropertiesFieldBuilder() { if (propertiesBuilder_ == null) { propertiesBuilder_ = - new com.google.protobuf.RepeatedFieldBuilderV3< + new com.google.protobuf.RepeatedFieldBuilder< com.google.api.Property, com.google.api.Property.Builder, com.google.api.PropertyOrBuilder>( @@ -872,17 +883,6 @@ public java.util.List getPropertiesBuilderList( return propertiesBuilder_; } - @java.lang.Override - public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - // @@protoc_insertion_point(builder_scope:google.api.ProjectProperties) } diff --git a/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/ProjectPropertiesOrBuilder.java b/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/ProjectPropertiesOrBuilder.java index 7662b29875..fe959d2be7 100644 --- a/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/ProjectPropertiesOrBuilder.java +++ b/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/ProjectPropertiesOrBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,10 +14,13 @@ * limitations under the License. */ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: google/api/consumer.proto +// Protobuf Java Version: 4.33.2 package com.google.api; +@com.google.protobuf.Generated public interface ProjectPropertiesOrBuilder extends // @@protoc_insertion_point(interface_extends:google.api.ProjectProperties) @@ -33,6 +36,7 @@ public interface ProjectPropertiesOrBuilder * repeated .google.api.Property properties = 1; */ java.util.List getPropertiesList(); + /** * * @@ -43,6 +47,7 @@ public interface ProjectPropertiesOrBuilder * repeated .google.api.Property properties = 1; */ com.google.api.Property getProperties(int index); + /** * * @@ -53,6 +58,7 @@ public interface ProjectPropertiesOrBuilder * repeated .google.api.Property properties = 1; */ int getPropertiesCount(); + /** * * @@ -63,6 +69,7 @@ public interface ProjectPropertiesOrBuilder * repeated .google.api.Property properties = 1; */ java.util.List getPropertiesOrBuilderList(); + /** * * diff --git a/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/Property.java b/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/Property.java index 1f6a05e0c0..6d4be63b0e 100644 --- a/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/Property.java +++ b/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/Property.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,9 @@ * limitations under the License. */ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: google/api/consumer.proto +// Protobuf Java Version: 4.33.2 package com.google.api; @@ -23,24 +25,38 @@ * *
          * Defines project properties.
        + *
          * API services can define properties that can be assigned to consumer projects
          * so that backends can perform response customization without having to make
          * additional calls or maintain additional storage. For example, Maps API
          * defines properties that controls map tile cache period, or whether to embed a
          * watermark in a result.
        + *
          * These values can be set via API producer console. Only API providers can
          * define and set these properties.
          * 
        * * Protobuf type {@code google.api.Property} */ -public final class Property extends com.google.protobuf.GeneratedMessageV3 +@com.google.protobuf.Generated +public final class Property extends com.google.protobuf.GeneratedMessage implements // @@protoc_insertion_point(message_implements:google.api.Property) PropertyOrBuilder { private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "Property"); + } + // Use Property.newBuilder() to construct. - private Property(com.google.protobuf.GeneratedMessageV3.Builder builder) { + private Property(com.google.protobuf.GeneratedMessage.Builder builder) { super(builder); } @@ -50,23 +66,12 @@ private Property() { description_ = ""; } - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new Property(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.api.ConsumerProto.internal_static_google_api_Property_descriptor; } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.api.ConsumerProto.internal_static_google_api_Property_fieldAccessorTable .ensureFieldAccessorsInitialized( @@ -136,6 +141,16 @@ public enum PropertyType implements com.google.protobuf.ProtocolMessageEnum { UNRECOGNIZED(-1), ; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "PropertyType"); + } + /** * * @@ -146,6 +161,7 @@ public enum PropertyType implements com.google.protobuf.ProtocolMessageEnum { * UNSPECIFIED = 0; */ public static final int UNSPECIFIED_VALUE = 0; + /** * * @@ -156,6 +172,7 @@ public enum PropertyType implements com.google.protobuf.ProtocolMessageEnum { * INT64 = 1; */ public static final int INT64_VALUE = 1; + /** * * @@ -166,6 +183,7 @@ public enum PropertyType implements com.google.protobuf.ProtocolMessageEnum { * BOOL = 2; */ public static final int BOOL_VALUE = 2; + /** * * @@ -176,6 +194,7 @@ public enum PropertyType implements com.google.protobuf.ProtocolMessageEnum { * STRING = 3; */ public static final int STRING_VALUE = 3; + /** * * @@ -249,7 +268,7 @@ public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType return getDescriptor(); } - public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + public static com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { return com.google.api.Property.getDescriptor().getEnumTypes().get(0); } @@ -275,7 +294,10 @@ private PropertyType(int value) { } public static final int NAME_FIELD_NUMBER = 1; - private volatile java.lang.Object name_; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** * * @@ -299,6 +321,7 @@ public java.lang.String getName() { return s; } } + /** * * @@ -324,7 +347,8 @@ public com.google.protobuf.ByteString getNameBytes() { } public static final int TYPE_FIELD_NUMBER = 2; - private int type_; + private int type_ = 0; + /** * * @@ -340,6 +364,7 @@ public com.google.protobuf.ByteString getNameBytes() { public int getTypeValue() { return type_; } + /** * * @@ -353,14 +378,16 @@ public int getTypeValue() { */ @java.lang.Override public com.google.api.Property.PropertyType getType() { - @SuppressWarnings("deprecation") com.google.api.Property.PropertyType result = - com.google.api.Property.PropertyType.valueOf(type_); + com.google.api.Property.PropertyType.forNumber(type_); return result == null ? com.google.api.Property.PropertyType.UNRECOGNIZED : result; } public static final int DESCRIPTION_FIELD_NUMBER = 3; - private volatile java.lang.Object description_; + + @SuppressWarnings("serial") + private volatile java.lang.Object description_ = ""; + /** * * @@ -384,6 +411,7 @@ public java.lang.String getDescription() { return s; } } + /** * * @@ -422,14 +450,14 @@ public final boolean isInitialized() { @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.GeneratedMessage.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, name_); } if (type_ != com.google.api.Property.PropertyType.UNSPECIFIED.getNumber()) { output.writeEnum(2, type_); } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(description_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 3, description_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(description_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 3, description_); } getUnknownFields().writeTo(output); } @@ -440,14 +468,14 @@ public int getSerializedSize() { 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.GeneratedMessage.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, name_); } if (type_ != com.google.api.Property.PropertyType.UNSPECIFIED.getNumber()) { size += com.google.protobuf.CodedOutputStream.computeEnumSize(2, type_); } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(description_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, description_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(description_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(3, description_); } size += getUnknownFields().getSerializedSize(); memoizedSize = size; @@ -525,38 +553,38 @@ public static com.google.api.Property parseFrom( public static com.google.api.Property parseFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); } public static com.google.api.Property parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } public static com.google.api.Property parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); } public static com.google.api.Property parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( PARSER, input, extensionRegistry); } public static com.google.api.Property parseFrom(com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); } public static com.google.api.Property parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } @@ -579,27 +607,30 @@ public Builder toBuilder() { } @java.lang.Override - protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { Builder builder = new Builder(parent); return builder; } + /** * * *
            * Defines project properties.
        +   *
            * API services can define properties that can be assigned to consumer projects
            * so that backends can perform response customization without having to make
            * additional calls or maintain additional storage. For example, Maps API
            * defines properties that controls map tile cache period, or whether to embed a
            * watermark in a result.
        +   *
            * These values can be set via API producer console. Only API providers can
            * define and set these properties.
            * 
        * * Protobuf type {@code google.api.Property} */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder implements // @@protoc_insertion_point(builder_implements:google.api.Property) com.google.api.PropertyOrBuilder { @@ -608,7 +639,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.api.ConsumerProto.internal_static_google_api_Property_fieldAccessorTable .ensureFieldAccessorsInitialized( @@ -618,19 +649,17 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { // Construct using com.google.api.Property.newBuilder() private Builder() {} - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { super(parent); } @java.lang.Override public Builder clear() { super.clear(); + bitField0_ = 0; name_ = ""; - type_ = 0; - description_ = ""; - return this; } @@ -656,44 +685,24 @@ public com.google.api.Property build() { @java.lang.Override public com.google.api.Property buildPartial() { com.google.api.Property result = new com.google.api.Property(this); - result.name_ = name_; - result.type_ = type_; - result.description_ = description_; + if (bitField0_ != 0) { + buildPartial0(result); + } 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); + private void buildPartial0(com.google.api.Property result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.type_ = type_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.description_ = description_; + } } @java.lang.Override @@ -710,6 +719,7 @@ public Builder mergeFrom(com.google.api.Property other) { if (other == com.google.api.Property.getDefaultInstance()) return this; if (!other.getName().isEmpty()) { name_ = other.name_; + bitField0_ |= 0x00000001; onChanged(); } if (other.type_ != 0) { @@ -717,6 +727,7 @@ public Builder mergeFrom(com.google.api.Property other) { } if (!other.getDescription().isEmpty()) { description_ = other.description_; + bitField0_ |= 0x00000004; onChanged(); } this.mergeUnknownFields(other.getUnknownFields()); @@ -748,19 +759,19 @@ public Builder mergeFrom( case 10: { name_ = input.readStringRequireUtf8(); - + bitField0_ |= 0x00000001; break; } // case 10 case 16: { type_ = input.readEnum(); - + bitField0_ |= 0x00000002; break; } // case 16 case 26: { description_ = input.readStringRequireUtf8(); - + bitField0_ |= 0x00000004; break; } // case 26 default: @@ -780,7 +791,10 @@ public Builder mergeFrom( return this; } + private int bitField0_; + private java.lang.Object name_ = ""; + /** * * @@ -803,6 +817,7 @@ public java.lang.String getName() { return (java.lang.String) ref; } } + /** * * @@ -825,6 +840,7 @@ public com.google.protobuf.ByteString getNameBytes() { return (com.google.protobuf.ByteString) ref; } } + /** * * @@ -841,11 +857,12 @@ public Builder setName(java.lang.String value) { if (value == null) { throw new NullPointerException(); } - name_ = value; + bitField0_ |= 0x00000001; onChanged(); return this; } + /** * * @@ -858,11 +875,12 @@ public Builder setName(java.lang.String value) { * @return This builder for chaining. */ public Builder clearName() { - name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); onChanged(); return this; } + /** * * @@ -880,13 +898,14 @@ public Builder setNameBytes(com.google.protobuf.ByteString value) { throw new NullPointerException(); } checkByteStringIsUtf8(value); - name_ = value; + bitField0_ |= 0x00000001; onChanged(); return this; } private int type_ = 0; + /** * * @@ -902,6 +921,7 @@ public Builder setNameBytes(com.google.protobuf.ByteString value) { public int getTypeValue() { return type_; } + /** * * @@ -915,11 +935,12 @@ public int getTypeValue() { * @return This builder for chaining. */ public Builder setTypeValue(int value) { - type_ = value; + bitField0_ |= 0x00000002; onChanged(); return this; } + /** * * @@ -933,11 +954,11 @@ public Builder setTypeValue(int value) { */ @java.lang.Override public com.google.api.Property.PropertyType getType() { - @SuppressWarnings("deprecation") com.google.api.Property.PropertyType result = - com.google.api.Property.PropertyType.valueOf(type_); + com.google.api.Property.PropertyType.forNumber(type_); return result == null ? com.google.api.Property.PropertyType.UNRECOGNIZED : result; } + /** * * @@ -954,11 +975,12 @@ public Builder setType(com.google.api.Property.PropertyType value) { if (value == null) { throw new NullPointerException(); } - + bitField0_ |= 0x00000002; type_ = value.getNumber(); onChanged(); return this; } + /** * * @@ -971,13 +993,14 @@ public Builder setType(com.google.api.Property.PropertyType value) { * @return This builder for chaining. */ public Builder clearType() { - + bitField0_ = (bitField0_ & ~0x00000002); type_ = 0; onChanged(); return this; } private java.lang.Object description_ = ""; + /** * * @@ -1000,6 +1023,7 @@ public java.lang.String getDescription() { return (java.lang.String) ref; } } + /** * * @@ -1022,6 +1046,7 @@ public com.google.protobuf.ByteString getDescriptionBytes() { return (com.google.protobuf.ByteString) ref; } } + /** * * @@ -1038,11 +1063,12 @@ public Builder setDescription(java.lang.String value) { if (value == null) { throw new NullPointerException(); } - description_ = value; + bitField0_ |= 0x00000004; onChanged(); return this; } + /** * * @@ -1055,11 +1081,12 @@ public Builder setDescription(java.lang.String value) { * @return This builder for chaining. */ public Builder clearDescription() { - description_ = getDefaultInstance().getDescription(); + bitField0_ = (bitField0_ & ~0x00000004); onChanged(); return this; } + /** * * @@ -1077,23 +1104,12 @@ public Builder setDescriptionBytes(com.google.protobuf.ByteString value) { throw new NullPointerException(); } checkByteStringIsUtf8(value); - description_ = 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.api.Property) } diff --git a/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/PropertyOrBuilder.java b/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/PropertyOrBuilder.java index c537871c93..d7e8d35d57 100644 --- a/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/PropertyOrBuilder.java +++ b/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/PropertyOrBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,10 +14,13 @@ * limitations under the License. */ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: google/api/consumer.proto +// Protobuf Java Version: 4.33.2 package com.google.api; +@com.google.protobuf.Generated public interface PropertyOrBuilder extends // @@protoc_insertion_point(interface_extends:google.api.Property) @@ -35,6 +38,7 @@ public interface PropertyOrBuilder * @return The name. */ java.lang.String getName(); + /** * * @@ -60,6 +64,7 @@ public interface PropertyOrBuilder * @return The enum numeric value on the wire for type. */ int getTypeValue(); + /** * * @@ -85,6 +90,7 @@ public interface PropertyOrBuilder * @return The description. */ java.lang.String getDescription(); + /** * * diff --git a/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/Publishing.java b/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/Publishing.java index 99562de3c4..6160a22e31 100644 --- a/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/Publishing.java +++ b/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/Publishing.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,9 @@ * limitations under the License. */ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: google/api/client.proto +// Protobuf Java Version: 4.33.2 package com.google.api; @@ -29,13 +31,25 @@ * * Protobuf type {@code google.api.Publishing} */ -public final class Publishing extends com.google.protobuf.GeneratedMessageV3 +@com.google.protobuf.Generated +public final class Publishing extends com.google.protobuf.GeneratedMessage implements // @@protoc_insertion_point(message_implements:google.api.Publishing) PublishingOrBuilder { private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "Publishing"); + } + // Use Publishing.newBuilder() to construct. - private Publishing(com.google.protobuf.GeneratedMessageV3.Builder builder) { + private Publishing(com.google.protobuf.GeneratedMessage.Builder builder) { super(builder); } @@ -45,21 +59,12 @@ private Publishing() { documentationUri_ = ""; apiShortName_ = ""; githubLabel_ = ""; - codeownerGithubTeams_ = com.google.protobuf.LazyStringArrayList.EMPTY; + codeownerGithubTeams_ = com.google.protobuf.LazyStringArrayList.emptyList(); docTagPrefix_ = ""; organization_ = 0; librarySettings_ = java.util.Collections.emptyList(); - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new Publishing(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; + protoReferenceDocumentationUri_ = ""; + restReferenceDocumentationUri_ = ""; } public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { @@ -67,7 +72,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.api.ClientProto.internal_static_google_api_Publishing_fieldAccessorTable .ensureFieldAccessorsInitialized( @@ -75,7 +80,10 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } public static final int METHOD_SETTINGS_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") private java.util.List methodSettings_; + /** * * @@ -90,6 +98,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { public java.util.List getMethodSettingsList() { return methodSettings_; } + /** * * @@ -105,6 +114,7 @@ public java.util.List getMethodSettingsList() { getMethodSettingsOrBuilderList() { return methodSettings_; } + /** * * @@ -119,6 +129,7 @@ public java.util.List getMethodSettingsList() { public int getMethodSettingsCount() { return methodSettings_.size(); } + /** * * @@ -133,6 +144,7 @@ public int getMethodSettingsCount() { public com.google.api.MethodSettings getMethodSettings(int index) { return methodSettings_.get(index); } + /** * * @@ -149,12 +161,15 @@ public com.google.api.MethodSettingsOrBuilder getMethodSettingsOrBuilder(int ind } public static final int NEW_ISSUE_URI_FIELD_NUMBER = 101; - private volatile java.lang.Object newIssueUri_; + + @SuppressWarnings("serial") + private volatile java.lang.Object newIssueUri_ = ""; + /** * * *
        -   * Link to a place that API users can report issues.  Example:
        +   * Link to a *public* URI where users can report issues.  Example:
            * https://issuetracker.google.com/issues/new?component=190865&template=1161103
            * 
        * @@ -174,11 +189,12 @@ public java.lang.String getNewIssueUri() { return s; } } + /** * * *
        -   * Link to a place that API users can report issues.  Example:
        +   * Link to a *public* URI where users can report issues.  Example:
            * https://issuetracker.google.com/issues/new?component=190865&template=1161103
            * 
        * @@ -200,7 +216,10 @@ public com.google.protobuf.ByteString getNewIssueUriBytes() { } public static final int DOCUMENTATION_URI_FIELD_NUMBER = 102; - private volatile java.lang.Object documentationUri_; + + @SuppressWarnings("serial") + private volatile java.lang.Object documentationUri_ = ""; + /** * * @@ -225,6 +244,7 @@ public java.lang.String getDocumentationUri() { return s; } } + /** * * @@ -251,7 +271,10 @@ public com.google.protobuf.ByteString getDocumentationUriBytes() { } public static final int API_SHORT_NAME_FIELD_NUMBER = 103; - private volatile java.lang.Object apiShortName_; + + @SuppressWarnings("serial") + private volatile java.lang.Object apiShortName_ = ""; + /** * * @@ -277,6 +300,7 @@ public java.lang.String getApiShortName() { return s; } } + /** * * @@ -304,7 +328,10 @@ public com.google.protobuf.ByteString getApiShortNameBytes() { } public static final int GITHUB_LABEL_FIELD_NUMBER = 104; - private volatile java.lang.Object githubLabel_; + + @SuppressWarnings("serial") + private volatile java.lang.Object githubLabel_ = ""; + /** * * @@ -328,6 +355,7 @@ public java.lang.String getGithubLabel() { return s; } } + /** * * @@ -353,7 +381,11 @@ public com.google.protobuf.ByteString getGithubLabelBytes() { } public static final int CODEOWNER_GITHUB_TEAMS_FIELD_NUMBER = 105; - private com.google.protobuf.LazyStringList codeownerGithubTeams_; + + @SuppressWarnings("serial") + private com.google.protobuf.LazyStringArrayList codeownerGithubTeams_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + /** * * @@ -369,6 +401,7 @@ public com.google.protobuf.ByteString getGithubLabelBytes() { public com.google.protobuf.ProtocolStringList getCodeownerGithubTeamsList() { return codeownerGithubTeams_; } + /** * * @@ -384,6 +417,7 @@ public com.google.protobuf.ProtocolStringList getCodeownerGithubTeamsList() { public int getCodeownerGithubTeamsCount() { return codeownerGithubTeams_.size(); } + /** * * @@ -400,6 +434,7 @@ public int getCodeownerGithubTeamsCount() { public java.lang.String getCodeownerGithubTeams(int index) { return codeownerGithubTeams_.get(index); } + /** * * @@ -418,7 +453,10 @@ public com.google.protobuf.ByteString getCodeownerGithubTeamsBytes(int index) { } public static final int DOC_TAG_PREFIX_FIELD_NUMBER = 106; - private volatile java.lang.Object docTagPrefix_; + + @SuppressWarnings("serial") + private volatile java.lang.Object docTagPrefix_ = ""; + /** * * @@ -443,6 +481,7 @@ public java.lang.String getDocTagPrefix() { return s; } } + /** * * @@ -469,7 +508,8 @@ public com.google.protobuf.ByteString getDocTagPrefixBytes() { } public static final int ORGANIZATION_FIELD_NUMBER = 107; - private int organization_; + private int organization_ = 0; + /** * * @@ -485,6 +525,7 @@ public com.google.protobuf.ByteString getDocTagPrefixBytes() { public int getOrganizationValue() { return organization_; } + /** * * @@ -498,14 +539,16 @@ public int getOrganizationValue() { */ @java.lang.Override public com.google.api.ClientLibraryOrganization getOrganization() { - @SuppressWarnings("deprecation") com.google.api.ClientLibraryOrganization result = - com.google.api.ClientLibraryOrganization.valueOf(organization_); + com.google.api.ClientLibraryOrganization.forNumber(organization_); return result == null ? com.google.api.ClientLibraryOrganization.UNRECOGNIZED : result; } public static final int LIBRARY_SETTINGS_FIELD_NUMBER = 109; + + @SuppressWarnings("serial") private java.util.List librarySettings_; + /** * * @@ -521,6 +564,7 @@ public com.google.api.ClientLibraryOrganization getOrganization() { public java.util.List getLibrarySettingsList() { return librarySettings_; } + /** * * @@ -537,6 +581,7 @@ public java.util.List getLibrarySettingsLi getLibrarySettingsOrBuilderList() { return librarySettings_; } + /** * * @@ -552,6 +597,7 @@ public java.util.List getLibrarySettingsLi public int getLibrarySettingsCount() { return librarySettings_.size(); } + /** * * @@ -567,6 +613,7 @@ public int getLibrarySettingsCount() { public com.google.api.ClientLibrarySettings getLibrarySettings(int index) { return librarySettings_.get(index); } + /** * * @@ -583,6 +630,116 @@ public com.google.api.ClientLibrarySettingsOrBuilder getLibrarySettingsOrBuilder return librarySettings_.get(index); } + public static final int PROTO_REFERENCE_DOCUMENTATION_URI_FIELD_NUMBER = 110; + + @SuppressWarnings("serial") + private volatile java.lang.Object protoReferenceDocumentationUri_ = ""; + + /** + * + * + *
        +   * Optional link to proto reference documentation.  Example:
        +   * https://cloud.google.com/pubsub/lite/docs/reference/rpc
        +   * 
        + * + * string proto_reference_documentation_uri = 110; + * + * @return The protoReferenceDocumentationUri. + */ + @java.lang.Override + public java.lang.String getProtoReferenceDocumentationUri() { + java.lang.Object ref = protoReferenceDocumentationUri_; + 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(); + protoReferenceDocumentationUri_ = s; + return s; + } + } + + /** + * + * + *
        +   * Optional link to proto reference documentation.  Example:
        +   * https://cloud.google.com/pubsub/lite/docs/reference/rpc
        +   * 
        + * + * string proto_reference_documentation_uri = 110; + * + * @return The bytes for protoReferenceDocumentationUri. + */ + @java.lang.Override + public com.google.protobuf.ByteString getProtoReferenceDocumentationUriBytes() { + java.lang.Object ref = protoReferenceDocumentationUri_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + protoReferenceDocumentationUri_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int REST_REFERENCE_DOCUMENTATION_URI_FIELD_NUMBER = 111; + + @SuppressWarnings("serial") + private volatile java.lang.Object restReferenceDocumentationUri_ = ""; + + /** + * + * + *
        +   * Optional link to REST reference documentation.  Example:
        +   * https://cloud.google.com/pubsub/lite/docs/reference/rest
        +   * 
        + * + * string rest_reference_documentation_uri = 111; + * + * @return The restReferenceDocumentationUri. + */ + @java.lang.Override + public java.lang.String getRestReferenceDocumentationUri() { + java.lang.Object ref = restReferenceDocumentationUri_; + 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(); + restReferenceDocumentationUri_ = s; + return s; + } + } + + /** + * + * + *
        +   * Optional link to REST reference documentation.  Example:
        +   * https://cloud.google.com/pubsub/lite/docs/reference/rest
        +   * 
        + * + * string rest_reference_documentation_uri = 111; + * + * @return The bytes for restReferenceDocumentationUri. + */ + @java.lang.Override + public com.google.protobuf.ByteString getRestReferenceDocumentationUriBytes() { + java.lang.Object ref = restReferenceDocumentationUri_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + restReferenceDocumentationUri_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + private byte memoizedIsInitialized = -1; @java.lang.Override @@ -600,24 +757,24 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io for (int i = 0; i < methodSettings_.size(); i++) { output.writeMessage(2, methodSettings_.get(i)); } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(newIssueUri_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 101, newIssueUri_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(newIssueUri_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 101, newIssueUri_); } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(documentationUri_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 102, documentationUri_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(documentationUri_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 102, documentationUri_); } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(apiShortName_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 103, apiShortName_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(apiShortName_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 103, apiShortName_); } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(githubLabel_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 104, githubLabel_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(githubLabel_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 104, githubLabel_); } for (int i = 0; i < codeownerGithubTeams_.size(); i++) { - com.google.protobuf.GeneratedMessageV3.writeString( + com.google.protobuf.GeneratedMessage.writeString( output, 105, codeownerGithubTeams_.getRaw(i)); } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(docTagPrefix_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 106, docTagPrefix_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(docTagPrefix_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 106, docTagPrefix_); } if (organization_ != com.google.api.ClientLibraryOrganization.CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED @@ -627,6 +784,13 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io for (int i = 0; i < librarySettings_.size(); i++) { output.writeMessage(109, librarySettings_.get(i)); } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(protoReferenceDocumentationUri_)) { + com.google.protobuf.GeneratedMessage.writeString( + output, 110, protoReferenceDocumentationUri_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(restReferenceDocumentationUri_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 111, restReferenceDocumentationUri_); + } getUnknownFields().writeTo(output); } @@ -639,17 +803,17 @@ public int getSerializedSize() { for (int i = 0; i < methodSettings_.size(); i++) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, methodSettings_.get(i)); } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(newIssueUri_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(101, newIssueUri_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(newIssueUri_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(101, newIssueUri_); } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(documentationUri_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(102, documentationUri_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(documentationUri_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(102, documentationUri_); } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(apiShortName_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(103, apiShortName_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(apiShortName_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(103, apiShortName_); } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(githubLabel_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(104, githubLabel_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(githubLabel_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(104, githubLabel_); } { int dataSize = 0; @@ -659,8 +823,8 @@ public int getSerializedSize() { size += dataSize; size += 2 * getCodeownerGithubTeamsList().size(); } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(docTagPrefix_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(106, docTagPrefix_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(docTagPrefix_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(106, docTagPrefix_); } if (organization_ != com.google.api.ClientLibraryOrganization.CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED @@ -671,6 +835,16 @@ public int getSerializedSize() { size += com.google.protobuf.CodedOutputStream.computeMessageSize(109, librarySettings_.get(i)); } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(protoReferenceDocumentationUri_)) { + size += + com.google.protobuf.GeneratedMessage.computeStringSize( + 110, protoReferenceDocumentationUri_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(restReferenceDocumentationUri_)) { + size += + com.google.protobuf.GeneratedMessage.computeStringSize( + 111, restReferenceDocumentationUri_); + } size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; @@ -695,6 +869,10 @@ public boolean equals(final java.lang.Object obj) { if (!getDocTagPrefix().equals(other.getDocTagPrefix())) return false; if (organization_ != other.organization_) return false; if (!getLibrarySettingsList().equals(other.getLibrarySettingsList())) return false; + if (!getProtoReferenceDocumentationUri().equals(other.getProtoReferenceDocumentationUri())) + return false; + if (!getRestReferenceDocumentationUri().equals(other.getRestReferenceDocumentationUri())) + return false; if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -730,6 +908,10 @@ public int hashCode() { hash = (37 * hash) + LIBRARY_SETTINGS_FIELD_NUMBER; hash = (53 * hash) + getLibrarySettingsList().hashCode(); } + hash = (37 * hash) + PROTO_REFERENCE_DOCUMENTATION_URI_FIELD_NUMBER; + hash = (53 * hash) + getProtoReferenceDocumentationUri().hashCode(); + hash = (37 * hash) + REST_REFERENCE_DOCUMENTATION_URI_FIELD_NUMBER; + hash = (53 * hash) + getRestReferenceDocumentationUri().hashCode(); hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; @@ -771,38 +953,38 @@ public static com.google.api.Publishing parseFrom( public static com.google.api.Publishing parseFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); } public static com.google.api.Publishing parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } public static com.google.api.Publishing parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); } public static com.google.api.Publishing parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( PARSER, input, extensionRegistry); } public static com.google.api.Publishing parseFrom(com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); } public static com.google.api.Publishing parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } @@ -825,10 +1007,11 @@ public Builder toBuilder() { } @java.lang.Override - protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { Builder builder = new Builder(parent); return builder; } + /** * * @@ -840,7 +1023,7 @@ protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.Build * * Protobuf type {@code google.api.Publishing} */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder implements // @@protoc_insertion_point(builder_implements:google.api.Publishing) com.google.api.PublishingOrBuilder { @@ -849,7 +1032,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.api.ClientProto.internal_static_google_api_Publishing_fieldAccessorTable .ensureFieldAccessorsInitialized( @@ -859,13 +1042,14 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { // Construct using com.google.api.Publishing.newBuilder() private Builder() {} - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { super(parent); } @java.lang.Override public Builder clear() { super.clear(); + bitField0_ = 0; if (methodSettingsBuilder_ == null) { methodSettings_ = java.util.Collections.emptyList(); } else { @@ -874,26 +1058,21 @@ public Builder clear() { } bitField0_ = (bitField0_ & ~0x00000001); newIssueUri_ = ""; - documentationUri_ = ""; - apiShortName_ = ""; - githubLabel_ = ""; - - codeownerGithubTeams_ = com.google.protobuf.LazyStringArrayList.EMPTY; - bitField0_ = (bitField0_ & ~0x00000002); + codeownerGithubTeams_ = com.google.protobuf.LazyStringArrayList.emptyList(); docTagPrefix_ = ""; - organization_ = 0; - if (librarySettingsBuilder_ == null) { librarySettings_ = java.util.Collections.emptyList(); } else { librarySettings_ = null; librarySettingsBuilder_.clear(); } - bitField0_ = (bitField0_ & ~0x00000004); + bitField0_ = (bitField0_ & ~0x00000100); + protoReferenceDocumentationUri_ = ""; + restReferenceDocumentationUri_ = ""; return this; } @@ -919,7 +1098,15 @@ public com.google.api.Publishing build() { @java.lang.Override public com.google.api.Publishing buildPartial() { com.google.api.Publishing result = new com.google.api.Publishing(this); - int from_bitField0_ = bitField0_; + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields(com.google.api.Publishing result) { if (methodSettingsBuilder_ == null) { if (((bitField0_ & 0x00000001) != 0)) { methodSettings_ = java.util.Collections.unmodifiableList(methodSettings_); @@ -929,61 +1116,47 @@ public com.google.api.Publishing buildPartial() { } else { result.methodSettings_ = methodSettingsBuilder_.build(); } - result.newIssueUri_ = newIssueUri_; - result.documentationUri_ = documentationUri_; - result.apiShortName_ = apiShortName_; - result.githubLabel_ = githubLabel_; - if (((bitField0_ & 0x00000002) != 0)) { - codeownerGithubTeams_ = codeownerGithubTeams_.getUnmodifiableView(); - bitField0_ = (bitField0_ & ~0x00000002); - } - result.codeownerGithubTeams_ = codeownerGithubTeams_; - result.docTagPrefix_ = docTagPrefix_; - result.organization_ = organization_; if (librarySettingsBuilder_ == null) { - if (((bitField0_ & 0x00000004) != 0)) { + if (((bitField0_ & 0x00000100) != 0)) { librarySettings_ = java.util.Collections.unmodifiableList(librarySettings_); - bitField0_ = (bitField0_ & ~0x00000004); + bitField0_ = (bitField0_ & ~0x00000100); } result.librarySettings_ = librarySettings_; } else { result.librarySettings_ = librarySettingsBuilder_.build(); } - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); } - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.setField(field, value); - } - - @java.lang.Override - public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - - @java.lang.Override - public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.addRepeatedField(field, value); + private void buildPartial0(com.google.api.Publishing result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.newIssueUri_ = newIssueUri_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.documentationUri_ = documentationUri_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.apiShortName_ = apiShortName_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.githubLabel_ = githubLabel_; + } + if (((from_bitField0_ & 0x00000020) != 0)) { + codeownerGithubTeams_.makeImmutable(); + result.codeownerGithubTeams_ = codeownerGithubTeams_; + } + if (((from_bitField0_ & 0x00000040) != 0)) { + result.docTagPrefix_ = docTagPrefix_; + } + if (((from_bitField0_ & 0x00000080) != 0)) { + result.organization_ = organization_; + } + if (((from_bitField0_ & 0x00000200) != 0)) { + result.protoReferenceDocumentationUri_ = protoReferenceDocumentationUri_; + } + if (((from_bitField0_ & 0x00000400) != 0)) { + result.restReferenceDocumentationUri_ = restReferenceDocumentationUri_; + } } @java.lang.Override @@ -1017,8 +1190,8 @@ public Builder mergeFrom(com.google.api.Publishing other) { methodSettings_ = other.methodSettings_; bitField0_ = (bitField0_ & ~0x00000001); methodSettingsBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders - ? getMethodSettingsFieldBuilder() + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders + ? internalGetMethodSettingsFieldBuilder() : null; } else { methodSettingsBuilder_.addAllMessages(other.methodSettings_); @@ -1027,24 +1200,28 @@ public Builder mergeFrom(com.google.api.Publishing other) { } if (!other.getNewIssueUri().isEmpty()) { newIssueUri_ = other.newIssueUri_; + bitField0_ |= 0x00000002; onChanged(); } if (!other.getDocumentationUri().isEmpty()) { documentationUri_ = other.documentationUri_; + bitField0_ |= 0x00000004; onChanged(); } if (!other.getApiShortName().isEmpty()) { apiShortName_ = other.apiShortName_; + bitField0_ |= 0x00000008; onChanged(); } if (!other.getGithubLabel().isEmpty()) { githubLabel_ = other.githubLabel_; + bitField0_ |= 0x00000010; onChanged(); } if (!other.codeownerGithubTeams_.isEmpty()) { if (codeownerGithubTeams_.isEmpty()) { codeownerGithubTeams_ = other.codeownerGithubTeams_; - bitField0_ = (bitField0_ & ~0x00000002); + bitField0_ |= 0x00000020; } else { ensureCodeownerGithubTeamsIsMutable(); codeownerGithubTeams_.addAll(other.codeownerGithubTeams_); @@ -1053,6 +1230,7 @@ public Builder mergeFrom(com.google.api.Publishing other) { } if (!other.getDocTagPrefix().isEmpty()) { docTagPrefix_ = other.docTagPrefix_; + bitField0_ |= 0x00000040; onChanged(); } if (other.organization_ != 0) { @@ -1062,7 +1240,7 @@ public Builder mergeFrom(com.google.api.Publishing other) { if (!other.librarySettings_.isEmpty()) { if (librarySettings_.isEmpty()) { librarySettings_ = other.librarySettings_; - bitField0_ = (bitField0_ & ~0x00000004); + bitField0_ = (bitField0_ & ~0x00000100); } else { ensureLibrarySettingsIsMutable(); librarySettings_.addAll(other.librarySettings_); @@ -1075,16 +1253,26 @@ public Builder mergeFrom(com.google.api.Publishing other) { librarySettingsBuilder_.dispose(); librarySettingsBuilder_ = null; librarySettings_ = other.librarySettings_; - bitField0_ = (bitField0_ & ~0x00000004); + bitField0_ = (bitField0_ & ~0x00000100); librarySettingsBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders - ? getLibrarySettingsFieldBuilder() + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders + ? internalGetLibrarySettingsFieldBuilder() : null; } else { librarySettingsBuilder_.addAllMessages(other.librarySettings_); } } } + if (!other.getProtoReferenceDocumentationUri().isEmpty()) { + protoReferenceDocumentationUri_ = other.protoReferenceDocumentationUri_; + bitField0_ |= 0x00000200; + onChanged(); + } + if (!other.getRestReferenceDocumentationUri().isEmpty()) { + restReferenceDocumentationUri_ = other.restReferenceDocumentationUri_; + bitField0_ |= 0x00000400; + onChanged(); + } this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; @@ -1126,25 +1314,25 @@ public Builder mergeFrom( case 810: { newIssueUri_ = input.readStringRequireUtf8(); - + bitField0_ |= 0x00000002; break; } // case 810 case 818: { documentationUri_ = input.readStringRequireUtf8(); - + bitField0_ |= 0x00000004; break; } // case 818 case 826: { apiShortName_ = input.readStringRequireUtf8(); - + bitField0_ |= 0x00000008; break; } // case 826 case 834: { githubLabel_ = input.readStringRequireUtf8(); - + bitField0_ |= 0x00000010; break; } // case 834 case 842: @@ -1157,13 +1345,13 @@ public Builder mergeFrom( case 850: { docTagPrefix_ = input.readStringRequireUtf8(); - + bitField0_ |= 0x00000040; break; } // case 850 case 856: { organization_ = input.readEnum(); - + bitField0_ |= 0x00000080; break; } // case 856 case 874: @@ -1179,6 +1367,18 @@ public Builder mergeFrom( } break; } // case 874 + case 882: + { + protoReferenceDocumentationUri_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000200; + break; + } // case 882 + case 890: + { + restReferenceDocumentationUri_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000400; + break; + } // case 890 default: { if (!super.parseUnknownField(input, extensionRegistry, tag)) { @@ -1208,7 +1408,7 @@ private void ensureMethodSettingsIsMutable() { } } - private com.google.protobuf.RepeatedFieldBuilderV3< + private com.google.protobuf.RepeatedFieldBuilder< com.google.api.MethodSettings, com.google.api.MethodSettings.Builder, com.google.api.MethodSettingsOrBuilder> @@ -1231,6 +1431,7 @@ public java.util.List getMethodSettingsList() { return methodSettingsBuilder_.getMessageList(); } } + /** * * @@ -1248,6 +1449,7 @@ public int getMethodSettingsCount() { return methodSettingsBuilder_.getCount(); } } + /** * * @@ -1265,6 +1467,7 @@ public com.google.api.MethodSettings getMethodSettings(int index) { return methodSettingsBuilder_.getMessage(index); } } + /** * * @@ -1288,6 +1491,7 @@ public Builder setMethodSettings(int index, com.google.api.MethodSettings value) } return this; } + /** * * @@ -1309,6 +1513,7 @@ public Builder setMethodSettings( } return this; } + /** * * @@ -1332,6 +1537,7 @@ public Builder addMethodSettings(com.google.api.MethodSettings value) { } return this; } + /** * * @@ -1355,6 +1561,7 @@ public Builder addMethodSettings(int index, com.google.api.MethodSettings value) } return this; } + /** * * @@ -1375,6 +1582,7 @@ public Builder addMethodSettings(com.google.api.MethodSettings.Builder builderFo } return this; } + /** * * @@ -1396,6 +1604,7 @@ public Builder addMethodSettings( } return this; } + /** * * @@ -1417,6 +1626,7 @@ public Builder addAllMethodSettings( } return this; } + /** * * @@ -1437,6 +1647,7 @@ public Builder clearMethodSettings() { } return this; } + /** * * @@ -1457,6 +1668,7 @@ public Builder removeMethodSettings(int index) { } return this; } + /** * * @@ -1468,8 +1680,9 @@ public Builder removeMethodSettings(int index) { * repeated .google.api.MethodSettings method_settings = 2; */ public com.google.api.MethodSettings.Builder getMethodSettingsBuilder(int index) { - return getMethodSettingsFieldBuilder().getBuilder(index); + return internalGetMethodSettingsFieldBuilder().getBuilder(index); } + /** * * @@ -1487,6 +1700,7 @@ public com.google.api.MethodSettingsOrBuilder getMethodSettingsOrBuilder(int ind return methodSettingsBuilder_.getMessageOrBuilder(index); } } + /** * * @@ -1505,6 +1719,7 @@ public com.google.api.MethodSettingsOrBuilder getMethodSettingsOrBuilder(int ind return java.util.Collections.unmodifiableList(methodSettings_); } } + /** * * @@ -1516,9 +1731,10 @@ public com.google.api.MethodSettingsOrBuilder getMethodSettingsOrBuilder(int ind * repeated .google.api.MethodSettings method_settings = 2; */ public com.google.api.MethodSettings.Builder addMethodSettingsBuilder() { - return getMethodSettingsFieldBuilder() + return internalGetMethodSettingsFieldBuilder() .addBuilder(com.google.api.MethodSettings.getDefaultInstance()); } + /** * * @@ -1530,9 +1746,10 @@ public com.google.api.MethodSettings.Builder addMethodSettingsBuilder() { * repeated .google.api.MethodSettings method_settings = 2; */ public com.google.api.MethodSettings.Builder addMethodSettingsBuilder(int index) { - return getMethodSettingsFieldBuilder() + return internalGetMethodSettingsFieldBuilder() .addBuilder(index, com.google.api.MethodSettings.getDefaultInstance()); } + /** * * @@ -1544,17 +1761,17 @@ public com.google.api.MethodSettings.Builder addMethodSettingsBuilder(int index) * repeated .google.api.MethodSettings method_settings = 2; */ public java.util.List getMethodSettingsBuilderList() { - return getMethodSettingsFieldBuilder().getBuilderList(); + return internalGetMethodSettingsFieldBuilder().getBuilderList(); } - private com.google.protobuf.RepeatedFieldBuilderV3< + private com.google.protobuf.RepeatedFieldBuilder< com.google.api.MethodSettings, com.google.api.MethodSettings.Builder, com.google.api.MethodSettingsOrBuilder> - getMethodSettingsFieldBuilder() { + internalGetMethodSettingsFieldBuilder() { if (methodSettingsBuilder_ == null) { methodSettingsBuilder_ = - new com.google.protobuf.RepeatedFieldBuilderV3< + new com.google.protobuf.RepeatedFieldBuilder< com.google.api.MethodSettings, com.google.api.MethodSettings.Builder, com.google.api.MethodSettingsOrBuilder>( @@ -1568,11 +1785,12 @@ public java.util.List getMethodSettingsBu } private java.lang.Object newIssueUri_ = ""; + /** * * *
        -     * Link to a place that API users can report issues.  Example:
        +     * Link to a *public* URI where users can report issues.  Example:
              * https://issuetracker.google.com/issues/new?component=190865&template=1161103
              * 
        * @@ -1591,11 +1809,12 @@ public java.lang.String getNewIssueUri() { return (java.lang.String) ref; } } + /** * * *
        -     * Link to a place that API users can report issues.  Example:
        +     * Link to a *public* URI where users can report issues.  Example:
              * https://issuetracker.google.com/issues/new?component=190865&template=1161103
              * 
        * @@ -1614,11 +1833,12 @@ public com.google.protobuf.ByteString getNewIssueUriBytes() { return (com.google.protobuf.ByteString) ref; } } + /** * * *
        -     * Link to a place that API users can report issues.  Example:
        +     * Link to a *public* URI where users can report issues.  Example:
              * https://issuetracker.google.com/issues/new?component=190865&template=1161103
              * 
        * @@ -1631,16 +1851,17 @@ public Builder setNewIssueUri(java.lang.String value) { if (value == null) { throw new NullPointerException(); } - newIssueUri_ = value; + bitField0_ |= 0x00000002; onChanged(); return this; } + /** * * *
        -     * Link to a place that API users can report issues.  Example:
        +     * Link to a *public* URI where users can report issues.  Example:
              * https://issuetracker.google.com/issues/new?component=190865&template=1161103
              * 
        * @@ -1649,16 +1870,17 @@ public Builder setNewIssueUri(java.lang.String value) { * @return This builder for chaining. */ public Builder clearNewIssueUri() { - newIssueUri_ = getDefaultInstance().getNewIssueUri(); + bitField0_ = (bitField0_ & ~0x00000002); onChanged(); return this; } + /** * * *
        -     * Link to a place that API users can report issues.  Example:
        +     * Link to a *public* URI where users can report issues.  Example:
              * https://issuetracker.google.com/issues/new?component=190865&template=1161103
              * 
        * @@ -1672,13 +1894,14 @@ public Builder setNewIssueUriBytes(com.google.protobuf.ByteString value) { throw new NullPointerException(); } checkByteStringIsUtf8(value); - newIssueUri_ = value; + bitField0_ |= 0x00000002; onChanged(); return this; } private java.lang.Object documentationUri_ = ""; + /** * * @@ -1702,6 +1925,7 @@ public java.lang.String getDocumentationUri() { return (java.lang.String) ref; } } + /** * * @@ -1725,6 +1949,7 @@ public com.google.protobuf.ByteString getDocumentationUriBytes() { return (com.google.protobuf.ByteString) ref; } } + /** * * @@ -1742,11 +1967,12 @@ public Builder setDocumentationUri(java.lang.String value) { if (value == null) { throw new NullPointerException(); } - documentationUri_ = value; + bitField0_ |= 0x00000004; onChanged(); return this; } + /** * * @@ -1760,11 +1986,12 @@ public Builder setDocumentationUri(java.lang.String value) { * @return This builder for chaining. */ public Builder clearDocumentationUri() { - documentationUri_ = getDefaultInstance().getDocumentationUri(); + bitField0_ = (bitField0_ & ~0x00000004); onChanged(); return this; } + /** * * @@ -1783,13 +2010,14 @@ public Builder setDocumentationUriBytes(com.google.protobuf.ByteString value) { throw new NullPointerException(); } checkByteStringIsUtf8(value); - documentationUri_ = value; + bitField0_ |= 0x00000004; onChanged(); return this; } private java.lang.Object apiShortName_ = ""; + /** * * @@ -1814,6 +2042,7 @@ public java.lang.String getApiShortName() { return (java.lang.String) ref; } } + /** * * @@ -1838,6 +2067,7 @@ public com.google.protobuf.ByteString getApiShortNameBytes() { return (com.google.protobuf.ByteString) ref; } } + /** * * @@ -1856,11 +2086,12 @@ public Builder setApiShortName(java.lang.String value) { if (value == null) { throw new NullPointerException(); } - apiShortName_ = value; + bitField0_ |= 0x00000008; onChanged(); return this; } + /** * * @@ -1875,11 +2106,12 @@ public Builder setApiShortName(java.lang.String value) { * @return This builder for chaining. */ public Builder clearApiShortName() { - apiShortName_ = getDefaultInstance().getApiShortName(); + bitField0_ = (bitField0_ & ~0x00000008); onChanged(); return this; } + /** * * @@ -1899,13 +2131,14 @@ public Builder setApiShortNameBytes(com.google.protobuf.ByteString value) { throw new NullPointerException(); } checkByteStringIsUtf8(value); - apiShortName_ = value; + bitField0_ |= 0x00000008; onChanged(); return this; } private java.lang.Object githubLabel_ = ""; + /** * * @@ -1928,6 +2161,7 @@ public java.lang.String getGithubLabel() { return (java.lang.String) ref; } } + /** * * @@ -1950,6 +2184,7 @@ public com.google.protobuf.ByteString getGithubLabelBytes() { return (com.google.protobuf.ByteString) ref; } } + /** * * @@ -1966,11 +2201,12 @@ public Builder setGithubLabel(java.lang.String value) { if (value == null) { throw new NullPointerException(); } - githubLabel_ = value; + bitField0_ |= 0x00000010; onChanged(); return this; } + /** * * @@ -1983,11 +2219,12 @@ public Builder setGithubLabel(java.lang.String value) { * @return This builder for chaining. */ public Builder clearGithubLabel() { - githubLabel_ = getDefaultInstance().getGithubLabel(); + bitField0_ = (bitField0_ & ~0x00000010); onChanged(); return this; } + /** * * @@ -2005,21 +2242,22 @@ public Builder setGithubLabelBytes(com.google.protobuf.ByteString value) { throw new NullPointerException(); } checkByteStringIsUtf8(value); - githubLabel_ = value; + bitField0_ |= 0x00000010; onChanged(); return this; } - private com.google.protobuf.LazyStringList codeownerGithubTeams_ = - com.google.protobuf.LazyStringArrayList.EMPTY; + private com.google.protobuf.LazyStringArrayList codeownerGithubTeams_ = + com.google.protobuf.LazyStringArrayList.emptyList(); private void ensureCodeownerGithubTeamsIsMutable() { - if (!((bitField0_ & 0x00000002) != 0)) { + if (!codeownerGithubTeams_.isModifiable()) { codeownerGithubTeams_ = new com.google.protobuf.LazyStringArrayList(codeownerGithubTeams_); - bitField0_ |= 0x00000002; } + bitField0_ |= 0x00000020; } + /** * * @@ -2033,8 +2271,10 @@ private void ensureCodeownerGithubTeamsIsMutable() { * @return A list containing the codeownerGithubTeams. */ public com.google.protobuf.ProtocolStringList getCodeownerGithubTeamsList() { - return codeownerGithubTeams_.getUnmodifiableView(); + codeownerGithubTeams_.makeImmutable(); + return codeownerGithubTeams_; } + /** * * @@ -2050,6 +2290,7 @@ public com.google.protobuf.ProtocolStringList getCodeownerGithubTeamsList() { public int getCodeownerGithubTeamsCount() { return codeownerGithubTeams_.size(); } + /** * * @@ -2066,6 +2307,7 @@ public int getCodeownerGithubTeamsCount() { public java.lang.String getCodeownerGithubTeams(int index) { return codeownerGithubTeams_.get(index); } + /** * * @@ -2082,6 +2324,7 @@ public java.lang.String getCodeownerGithubTeams(int index) { public com.google.protobuf.ByteString getCodeownerGithubTeamsBytes(int index) { return codeownerGithubTeams_.getByteString(index); } + /** * * @@ -2102,9 +2345,11 @@ public Builder setCodeownerGithubTeams(int index, java.lang.String value) { } ensureCodeownerGithubTeamsIsMutable(); codeownerGithubTeams_.set(index, value); + bitField0_ |= 0x00000020; onChanged(); return this; } + /** * * @@ -2124,9 +2369,11 @@ public Builder addCodeownerGithubTeams(java.lang.String value) { } ensureCodeownerGithubTeamsIsMutable(); codeownerGithubTeams_.add(value); + bitField0_ |= 0x00000020; onChanged(); return this; } + /** * * @@ -2143,9 +2390,11 @@ public Builder addCodeownerGithubTeams(java.lang.String value) { public Builder addAllCodeownerGithubTeams(java.lang.Iterable values) { ensureCodeownerGithubTeamsIsMutable(); com.google.protobuf.AbstractMessageLite.Builder.addAll(values, codeownerGithubTeams_); + bitField0_ |= 0x00000020; onChanged(); return this; } + /** * * @@ -2159,11 +2408,13 @@ public Builder addAllCodeownerGithubTeams(java.lang.Iterable v * @return This builder for chaining. */ public Builder clearCodeownerGithubTeams() { - codeownerGithubTeams_ = com.google.protobuf.LazyStringArrayList.EMPTY; - bitField0_ = (bitField0_ & ~0x00000002); + codeownerGithubTeams_ = com.google.protobuf.LazyStringArrayList.emptyList(); + bitField0_ = (bitField0_ & ~0x00000020); + ; onChanged(); return this; } + /** * * @@ -2184,11 +2435,13 @@ public Builder addCodeownerGithubTeamsBytes(com.google.protobuf.ByteString value checkByteStringIsUtf8(value); ensureCodeownerGithubTeamsIsMutable(); codeownerGithubTeams_.add(value); + bitField0_ |= 0x00000020; onChanged(); return this; } private java.lang.Object docTagPrefix_ = ""; + /** * * @@ -2212,6 +2465,7 @@ public java.lang.String getDocTagPrefix() { return (java.lang.String) ref; } } + /** * * @@ -2235,6 +2489,7 @@ public com.google.protobuf.ByteString getDocTagPrefixBytes() { return (com.google.protobuf.ByteString) ref; } } + /** * * @@ -2252,11 +2507,12 @@ public Builder setDocTagPrefix(java.lang.String value) { if (value == null) { throw new NullPointerException(); } - docTagPrefix_ = value; + bitField0_ |= 0x00000040; onChanged(); return this; } + /** * * @@ -2270,11 +2526,12 @@ public Builder setDocTagPrefix(java.lang.String value) { * @return This builder for chaining. */ public Builder clearDocTagPrefix() { - docTagPrefix_ = getDefaultInstance().getDocTagPrefix(); + bitField0_ = (bitField0_ & ~0x00000040); onChanged(); return this; } + /** * * @@ -2293,13 +2550,14 @@ public Builder setDocTagPrefixBytes(com.google.protobuf.ByteString value) { throw new NullPointerException(); } checkByteStringIsUtf8(value); - docTagPrefix_ = value; + bitField0_ |= 0x00000040; onChanged(); return this; } private int organization_ = 0; + /** * * @@ -2315,6 +2573,7 @@ public Builder setDocTagPrefixBytes(com.google.protobuf.ByteString value) { public int getOrganizationValue() { return organization_; } + /** * * @@ -2328,11 +2587,12 @@ public int getOrganizationValue() { * @return This builder for chaining. */ public Builder setOrganizationValue(int value) { - organization_ = value; + bitField0_ |= 0x00000080; onChanged(); return this; } + /** * * @@ -2346,11 +2606,11 @@ public Builder setOrganizationValue(int value) { */ @java.lang.Override public com.google.api.ClientLibraryOrganization getOrganization() { - @SuppressWarnings("deprecation") com.google.api.ClientLibraryOrganization result = - com.google.api.ClientLibraryOrganization.valueOf(organization_); + com.google.api.ClientLibraryOrganization.forNumber(organization_); return result == null ? com.google.api.ClientLibraryOrganization.UNRECOGNIZED : result; } + /** * * @@ -2367,11 +2627,12 @@ public Builder setOrganization(com.google.api.ClientLibraryOrganization value) { if (value == null) { throw new NullPointerException(); } - + bitField0_ |= 0x00000080; organization_ = value.getNumber(); onChanged(); return this; } + /** * * @@ -2384,7 +2645,7 @@ public Builder setOrganization(com.google.api.ClientLibraryOrganization value) { * @return This builder for chaining. */ public Builder clearOrganization() { - + bitField0_ = (bitField0_ & ~0x00000080); organization_ = 0; onChanged(); return this; @@ -2394,14 +2655,14 @@ public Builder clearOrganization() { java.util.Collections.emptyList(); private void ensureLibrarySettingsIsMutable() { - if (!((bitField0_ & 0x00000004) != 0)) { + if (!((bitField0_ & 0x00000100) != 0)) { librarySettings_ = new java.util.ArrayList(librarySettings_); - bitField0_ |= 0x00000004; + bitField0_ |= 0x00000100; } } - private com.google.protobuf.RepeatedFieldBuilderV3< + private com.google.protobuf.RepeatedFieldBuilder< com.google.api.ClientLibrarySettings, com.google.api.ClientLibrarySettings.Builder, com.google.api.ClientLibrarySettingsOrBuilder> @@ -2425,6 +2686,7 @@ public java.util.List getLibrarySettingsLi return librarySettingsBuilder_.getMessageList(); } } + /** * * @@ -2443,6 +2705,7 @@ public int getLibrarySettingsCount() { return librarySettingsBuilder_.getCount(); } } + /** * * @@ -2461,6 +2724,7 @@ public com.google.api.ClientLibrarySettings getLibrarySettings(int index) { return librarySettingsBuilder_.getMessage(index); } } + /** * * @@ -2485,6 +2749,7 @@ public Builder setLibrarySettings(int index, com.google.api.ClientLibrarySetting } return this; } + /** * * @@ -2507,6 +2772,7 @@ public Builder setLibrarySettings( } return this; } + /** * * @@ -2531,6 +2797,7 @@ public Builder addLibrarySettings(com.google.api.ClientLibrarySettings value) { } return this; } + /** * * @@ -2555,6 +2822,7 @@ public Builder addLibrarySettings(int index, com.google.api.ClientLibrarySetting } return this; } + /** * * @@ -2577,6 +2845,7 @@ public Builder addLibrarySettings( } return this; } + /** * * @@ -2599,6 +2868,7 @@ public Builder addLibrarySettings( } return this; } + /** * * @@ -2621,6 +2891,7 @@ public Builder addAllLibrarySettings( } return this; } + /** * * @@ -2635,13 +2906,14 @@ public Builder addAllLibrarySettings( public Builder clearLibrarySettings() { if (librarySettingsBuilder_ == null) { librarySettings_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000004); + bitField0_ = (bitField0_ & ~0x00000100); onChanged(); } else { librarySettingsBuilder_.clear(); } return this; } + /** * * @@ -2663,6 +2935,7 @@ public Builder removeLibrarySettings(int index) { } return this; } + /** * * @@ -2675,8 +2948,9 @@ public Builder removeLibrarySettings(int index) { * repeated .google.api.ClientLibrarySettings library_settings = 109; */ public com.google.api.ClientLibrarySettings.Builder getLibrarySettingsBuilder(int index) { - return getLibrarySettingsFieldBuilder().getBuilder(index); + return internalGetLibrarySettingsFieldBuilder().getBuilder(index); } + /** * * @@ -2695,6 +2969,7 @@ public com.google.api.ClientLibrarySettingsOrBuilder getLibrarySettingsOrBuilder return librarySettingsBuilder_.getMessageOrBuilder(index); } } + /** * * @@ -2714,6 +2989,7 @@ public com.google.api.ClientLibrarySettingsOrBuilder getLibrarySettingsOrBuilder return java.util.Collections.unmodifiableList(librarySettings_); } } + /** * * @@ -2726,9 +3002,10 @@ public com.google.api.ClientLibrarySettingsOrBuilder getLibrarySettingsOrBuilder * repeated .google.api.ClientLibrarySettings library_settings = 109; */ public com.google.api.ClientLibrarySettings.Builder addLibrarySettingsBuilder() { - return getLibrarySettingsFieldBuilder() + return internalGetLibrarySettingsFieldBuilder() .addBuilder(com.google.api.ClientLibrarySettings.getDefaultInstance()); } + /** * * @@ -2741,9 +3018,10 @@ public com.google.api.ClientLibrarySettings.Builder addLibrarySettingsBuilder() * repeated .google.api.ClientLibrarySettings library_settings = 109; */ public com.google.api.ClientLibrarySettings.Builder addLibrarySettingsBuilder(int index) { - return getLibrarySettingsFieldBuilder() + return internalGetLibrarySettingsFieldBuilder() .addBuilder(index, com.google.api.ClientLibrarySettings.getDefaultInstance()); } + /** * * @@ -2757,22 +3035,22 @@ public com.google.api.ClientLibrarySettings.Builder addLibrarySettingsBuilder(in */ public java.util.List getLibrarySettingsBuilderList() { - return getLibrarySettingsFieldBuilder().getBuilderList(); + return internalGetLibrarySettingsFieldBuilder().getBuilderList(); } - private com.google.protobuf.RepeatedFieldBuilderV3< + private com.google.protobuf.RepeatedFieldBuilder< com.google.api.ClientLibrarySettings, com.google.api.ClientLibrarySettings.Builder, com.google.api.ClientLibrarySettingsOrBuilder> - getLibrarySettingsFieldBuilder() { + internalGetLibrarySettingsFieldBuilder() { if (librarySettingsBuilder_ == null) { librarySettingsBuilder_ = - new com.google.protobuf.RepeatedFieldBuilderV3< + new com.google.protobuf.RepeatedFieldBuilder< com.google.api.ClientLibrarySettings, com.google.api.ClientLibrarySettings.Builder, com.google.api.ClientLibrarySettingsOrBuilder>( librarySettings_, - ((bitField0_ & 0x00000004) != 0), + ((bitField0_ & 0x00000100) != 0), getParentForChildren(), isClean()); librarySettings_ = null; @@ -2780,15 +3058,236 @@ public com.google.api.ClientLibrarySettings.Builder addLibrarySettingsBuilder(in return librarySettingsBuilder_; } - @java.lang.Override - public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); + private java.lang.Object protoReferenceDocumentationUri_ = ""; + + /** + * + * + *
        +     * Optional link to proto reference documentation.  Example:
        +     * https://cloud.google.com/pubsub/lite/docs/reference/rpc
        +     * 
        + * + * string proto_reference_documentation_uri = 110; + * + * @return The protoReferenceDocumentationUri. + */ + public java.lang.String getProtoReferenceDocumentationUri() { + java.lang.Object ref = protoReferenceDocumentationUri_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + protoReferenceDocumentationUri_ = s; + return s; + } else { + return (java.lang.String) ref; + } } - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); + /** + * + * + *
        +     * Optional link to proto reference documentation.  Example:
        +     * https://cloud.google.com/pubsub/lite/docs/reference/rpc
        +     * 
        + * + * string proto_reference_documentation_uri = 110; + * + * @return The bytes for protoReferenceDocumentationUri. + */ + public com.google.protobuf.ByteString getProtoReferenceDocumentationUriBytes() { + java.lang.Object ref = protoReferenceDocumentationUri_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + protoReferenceDocumentationUri_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
        +     * Optional link to proto reference documentation.  Example:
        +     * https://cloud.google.com/pubsub/lite/docs/reference/rpc
        +     * 
        + * + * string proto_reference_documentation_uri = 110; + * + * @param value The protoReferenceDocumentationUri to set. + * @return This builder for chaining. + */ + public Builder setProtoReferenceDocumentationUri(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + protoReferenceDocumentationUri_ = value; + bitField0_ |= 0x00000200; + onChanged(); + return this; + } + + /** + * + * + *
        +     * Optional link to proto reference documentation.  Example:
        +     * https://cloud.google.com/pubsub/lite/docs/reference/rpc
        +     * 
        + * + * string proto_reference_documentation_uri = 110; + * + * @return This builder for chaining. + */ + public Builder clearProtoReferenceDocumentationUri() { + protoReferenceDocumentationUri_ = getDefaultInstance().getProtoReferenceDocumentationUri(); + bitField0_ = (bitField0_ & ~0x00000200); + onChanged(); + return this; + } + + /** + * + * + *
        +     * Optional link to proto reference documentation.  Example:
        +     * https://cloud.google.com/pubsub/lite/docs/reference/rpc
        +     * 
        + * + * string proto_reference_documentation_uri = 110; + * + * @param value The bytes for protoReferenceDocumentationUri to set. + * @return This builder for chaining. + */ + public Builder setProtoReferenceDocumentationUriBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + protoReferenceDocumentationUri_ = value; + bitField0_ |= 0x00000200; + onChanged(); + return this; + } + + private java.lang.Object restReferenceDocumentationUri_ = ""; + + /** + * + * + *
        +     * Optional link to REST reference documentation.  Example:
        +     * https://cloud.google.com/pubsub/lite/docs/reference/rest
        +     * 
        + * + * string rest_reference_documentation_uri = 111; + * + * @return The restReferenceDocumentationUri. + */ + public java.lang.String getRestReferenceDocumentationUri() { + java.lang.Object ref = restReferenceDocumentationUri_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + restReferenceDocumentationUri_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
        +     * Optional link to REST reference documentation.  Example:
        +     * https://cloud.google.com/pubsub/lite/docs/reference/rest
        +     * 
        + * + * string rest_reference_documentation_uri = 111; + * + * @return The bytes for restReferenceDocumentationUri. + */ + public com.google.protobuf.ByteString getRestReferenceDocumentationUriBytes() { + java.lang.Object ref = restReferenceDocumentationUri_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + restReferenceDocumentationUri_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
        +     * Optional link to REST reference documentation.  Example:
        +     * https://cloud.google.com/pubsub/lite/docs/reference/rest
        +     * 
        + * + * string rest_reference_documentation_uri = 111; + * + * @param value The restReferenceDocumentationUri to set. + * @return This builder for chaining. + */ + public Builder setRestReferenceDocumentationUri(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + restReferenceDocumentationUri_ = value; + bitField0_ |= 0x00000400; + onChanged(); + return this; + } + + /** + * + * + *
        +     * Optional link to REST reference documentation.  Example:
        +     * https://cloud.google.com/pubsub/lite/docs/reference/rest
        +     * 
        + * + * string rest_reference_documentation_uri = 111; + * + * @return This builder for chaining. + */ + public Builder clearRestReferenceDocumentationUri() { + restReferenceDocumentationUri_ = getDefaultInstance().getRestReferenceDocumentationUri(); + bitField0_ = (bitField0_ & ~0x00000400); + onChanged(); + return this; + } + + /** + * + * + *
        +     * Optional link to REST reference documentation.  Example:
        +     * https://cloud.google.com/pubsub/lite/docs/reference/rest
        +     * 
        + * + * string rest_reference_documentation_uri = 111; + * + * @param value The bytes for restReferenceDocumentationUri to set. + * @return This builder for chaining. + */ + public Builder setRestReferenceDocumentationUriBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + restReferenceDocumentationUri_ = value; + bitField0_ |= 0x00000400; + onChanged(); + return this; } // @@protoc_insertion_point(builder_scope:google.api.Publishing) diff --git a/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/PublishingOrBuilder.java b/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/PublishingOrBuilder.java index b6eee072ba..f1e2b26bc9 100644 --- a/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/PublishingOrBuilder.java +++ b/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/PublishingOrBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,10 +14,13 @@ * limitations under the License. */ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: google/api/client.proto +// Protobuf Java Version: 4.33.2 package com.google.api; +@com.google.protobuf.Generated public interface PublishingOrBuilder extends // @@protoc_insertion_point(interface_extends:google.api.Publishing) @@ -34,6 +37,7 @@ public interface PublishingOrBuilder * repeated .google.api.MethodSettings method_settings = 2; */ java.util.List getMethodSettingsList(); + /** * * @@ -45,6 +49,7 @@ public interface PublishingOrBuilder * repeated .google.api.MethodSettings method_settings = 2; */ com.google.api.MethodSettings getMethodSettings(int index); + /** * * @@ -56,6 +61,7 @@ public interface PublishingOrBuilder * repeated .google.api.MethodSettings method_settings = 2; */ int getMethodSettingsCount(); + /** * * @@ -67,6 +73,7 @@ public interface PublishingOrBuilder * repeated .google.api.MethodSettings method_settings = 2; */ java.util.List getMethodSettingsOrBuilderList(); + /** * * @@ -83,7 +90,7 @@ public interface PublishingOrBuilder * * *
        -   * Link to a place that API users can report issues.  Example:
        +   * Link to a *public* URI where users can report issues.  Example:
            * https://issuetracker.google.com/issues/new?component=190865&template=1161103
            * 
        * @@ -92,11 +99,12 @@ public interface PublishingOrBuilder * @return The newIssueUri. */ java.lang.String getNewIssueUri(); + /** * * *
        -   * Link to a place that API users can report issues.  Example:
        +   * Link to a *public* URI where users can report issues.  Example:
            * https://issuetracker.google.com/issues/new?component=190865&template=1161103
            * 
        * @@ -119,6 +127,7 @@ public interface PublishingOrBuilder * @return The documentationUri. */ java.lang.String getDocumentationUri(); + /** * * @@ -147,6 +156,7 @@ public interface PublishingOrBuilder * @return The apiShortName. */ java.lang.String getApiShortName(); + /** * * @@ -174,6 +184,7 @@ public interface PublishingOrBuilder * @return The githubLabel. */ java.lang.String getGithubLabel(); + /** * * @@ -200,6 +211,7 @@ public interface PublishingOrBuilder * @return A list containing the codeownerGithubTeams. */ java.util.List getCodeownerGithubTeamsList(); + /** * * @@ -213,6 +225,7 @@ public interface PublishingOrBuilder * @return The count of codeownerGithubTeams. */ int getCodeownerGithubTeamsCount(); + /** * * @@ -227,6 +240,7 @@ public interface PublishingOrBuilder * @return The codeownerGithubTeams at the given index. */ java.lang.String getCodeownerGithubTeams(int index); + /** * * @@ -255,6 +269,7 @@ public interface PublishingOrBuilder * @return The docTagPrefix. */ java.lang.String getDocTagPrefix(); + /** * * @@ -281,6 +296,7 @@ public interface PublishingOrBuilder * @return The enum numeric value on the wire for organization. */ int getOrganizationValue(); + /** * * @@ -306,6 +322,7 @@ public interface PublishingOrBuilder * repeated .google.api.ClientLibrarySettings library_settings = 109; */ java.util.List getLibrarySettingsList(); + /** * * @@ -318,6 +335,7 @@ public interface PublishingOrBuilder * repeated .google.api.ClientLibrarySettings library_settings = 109; */ com.google.api.ClientLibrarySettings getLibrarySettings(int index); + /** * * @@ -330,6 +348,7 @@ public interface PublishingOrBuilder * repeated .google.api.ClientLibrarySettings library_settings = 109; */ int getLibrarySettingsCount(); + /** * * @@ -343,6 +362,7 @@ public interface PublishingOrBuilder */ java.util.List getLibrarySettingsOrBuilderList(); + /** * * @@ -355,4 +375,60 @@ public interface PublishingOrBuilder * repeated .google.api.ClientLibrarySettings library_settings = 109; */ com.google.api.ClientLibrarySettingsOrBuilder getLibrarySettingsOrBuilder(int index); + + /** + * + * + *
        +   * Optional link to proto reference documentation.  Example:
        +   * https://cloud.google.com/pubsub/lite/docs/reference/rpc
        +   * 
        + * + * string proto_reference_documentation_uri = 110; + * + * @return The protoReferenceDocumentationUri. + */ + java.lang.String getProtoReferenceDocumentationUri(); + + /** + * + * + *
        +   * Optional link to proto reference documentation.  Example:
        +   * https://cloud.google.com/pubsub/lite/docs/reference/rpc
        +   * 
        + * + * string proto_reference_documentation_uri = 110; + * + * @return The bytes for protoReferenceDocumentationUri. + */ + com.google.protobuf.ByteString getProtoReferenceDocumentationUriBytes(); + + /** + * + * + *
        +   * Optional link to REST reference documentation.  Example:
        +   * https://cloud.google.com/pubsub/lite/docs/reference/rest
        +   * 
        + * + * string rest_reference_documentation_uri = 111; + * + * @return The restReferenceDocumentationUri. + */ + java.lang.String getRestReferenceDocumentationUri(); + + /** + * + * + *
        +   * Optional link to REST reference documentation.  Example:
        +   * https://cloud.google.com/pubsub/lite/docs/reference/rest
        +   * 
        + * + * string rest_reference_documentation_uri = 111; + * + * @return The bytes for restReferenceDocumentationUri. + */ + com.google.protobuf.ByteString getRestReferenceDocumentationUriBytes(); } diff --git a/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/PythonSettings.java b/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/PythonSettings.java index 02e3cc045f..9aaf24e045 100644 --- a/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/PythonSettings.java +++ b/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/PythonSettings.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,9 @@ * limitations under the License. */ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: google/api/client.proto +// Protobuf Java Version: 4.33.2 package com.google.api; @@ -27,43 +29,821 @@ * * Protobuf type {@code google.api.PythonSettings} */ -public final class PythonSettings extends com.google.protobuf.GeneratedMessageV3 +@com.google.protobuf.Generated +public final class PythonSettings extends com.google.protobuf.GeneratedMessage implements // @@protoc_insertion_point(message_implements:google.api.PythonSettings) PythonSettingsOrBuilder { private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "PythonSettings"); + } + // Use PythonSettings.newBuilder() to construct. - private PythonSettings(com.google.protobuf.GeneratedMessageV3.Builder builder) { + private PythonSettings(com.google.protobuf.GeneratedMessage.Builder builder) { super(builder); } private PythonSettings() {} - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new PythonSettings(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.api.ClientProto.internal_static_google_api_PythonSettings_descriptor; } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.api.ClientProto.internal_static_google_api_PythonSettings_fieldAccessorTable .ensureFieldAccessorsInitialized( com.google.api.PythonSettings.class, com.google.api.PythonSettings.Builder.class); } + public interface ExperimentalFeaturesOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.api.PythonSettings.ExperimentalFeatures) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
        +     * Enables generation of asynchronous REST clients if `rest` transport is
        +     * enabled. By default, asynchronous REST clients will not be generated.
        +     * This feature will be enabled by default 1 month after launching the
        +     * feature in preview packages.
        +     * 
        + * + * bool rest_async_io_enabled = 1; + * + * @return The restAsyncIoEnabled. + */ + boolean getRestAsyncIoEnabled(); + + /** + * + * + *
        +     * Enables generation of protobuf code using new types that are more
        +     * Pythonic which are included in `protobuf>=5.29.x`. This feature will be
        +     * enabled by default 1 month after launching the feature in preview
        +     * packages.
        +     * 
        + * + * bool protobuf_pythonic_types_enabled = 2; + * + * @return The protobufPythonicTypesEnabled. + */ + boolean getProtobufPythonicTypesEnabled(); + + /** + * + * + *
        +     * Disables generation of an unversioned Python package for this client
        +     * library. This means that the module names will need to be versioned in
        +     * import statements. For example `import google.cloud.library_v2` instead
        +     * of `import google.cloud.library`.
        +     * 
        + * + * bool unversioned_package_disabled = 3; + * + * @return The unversionedPackageDisabled. + */ + boolean getUnversionedPackageDisabled(); + } + + /** + * + * + *
        +   * Experimental features to be included during client library generation.
        +   * These fields will be deprecated once the feature graduates and is enabled
        +   * by default.
        +   * 
        + * + * Protobuf type {@code google.api.PythonSettings.ExperimentalFeatures} + */ + public static final class ExperimentalFeatures extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.api.PythonSettings.ExperimentalFeatures) + ExperimentalFeaturesOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "ExperimentalFeatures"); + } + + // Use ExperimentalFeatures.newBuilder() to construct. + private ExperimentalFeatures(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private ExperimentalFeatures() {} + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.api.ClientProto + .internal_static_google_api_PythonSettings_ExperimentalFeatures_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.api.ClientProto + .internal_static_google_api_PythonSettings_ExperimentalFeatures_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.api.PythonSettings.ExperimentalFeatures.class, + com.google.api.PythonSettings.ExperimentalFeatures.Builder.class); + } + + public static final int REST_ASYNC_IO_ENABLED_FIELD_NUMBER = 1; + private boolean restAsyncIoEnabled_ = false; + + /** + * + * + *
        +     * Enables generation of asynchronous REST clients if `rest` transport is
        +     * enabled. By default, asynchronous REST clients will not be generated.
        +     * This feature will be enabled by default 1 month after launching the
        +     * feature in preview packages.
        +     * 
        + * + * bool rest_async_io_enabled = 1; + * + * @return The restAsyncIoEnabled. + */ + @java.lang.Override + public boolean getRestAsyncIoEnabled() { + return restAsyncIoEnabled_; + } + + public static final int PROTOBUF_PYTHONIC_TYPES_ENABLED_FIELD_NUMBER = 2; + private boolean protobufPythonicTypesEnabled_ = false; + + /** + * + * + *
        +     * Enables generation of protobuf code using new types that are more
        +     * Pythonic which are included in `protobuf>=5.29.x`. This feature will be
        +     * enabled by default 1 month after launching the feature in preview
        +     * packages.
        +     * 
        + * + * bool protobuf_pythonic_types_enabled = 2; + * + * @return The protobufPythonicTypesEnabled. + */ + @java.lang.Override + public boolean getProtobufPythonicTypesEnabled() { + return protobufPythonicTypesEnabled_; + } + + public static final int UNVERSIONED_PACKAGE_DISABLED_FIELD_NUMBER = 3; + private boolean unversionedPackageDisabled_ = false; + + /** + * + * + *
        +     * Disables generation of an unversioned Python package for this client
        +     * library. This means that the module names will need to be versioned in
        +     * import statements. For example `import google.cloud.library_v2` instead
        +     * of `import google.cloud.library`.
        +     * 
        + * + * bool unversioned_package_disabled = 3; + * + * @return The unversionedPackageDisabled. + */ + @java.lang.Override + public boolean getUnversionedPackageDisabled() { + return unversionedPackageDisabled_; + } + + 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 (restAsyncIoEnabled_ != false) { + output.writeBool(1, restAsyncIoEnabled_); + } + if (protobufPythonicTypesEnabled_ != false) { + output.writeBool(2, protobufPythonicTypesEnabled_); + } + if (unversionedPackageDisabled_ != false) { + output.writeBool(3, unversionedPackageDisabled_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (restAsyncIoEnabled_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(1, restAsyncIoEnabled_); + } + if (protobufPythonicTypesEnabled_ != false) { + size += + com.google.protobuf.CodedOutputStream.computeBoolSize(2, protobufPythonicTypesEnabled_); + } + if (unversionedPackageDisabled_ != false) { + size += + com.google.protobuf.CodedOutputStream.computeBoolSize(3, unversionedPackageDisabled_); + } + 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.api.PythonSettings.ExperimentalFeatures)) { + return super.equals(obj); + } + com.google.api.PythonSettings.ExperimentalFeatures other = + (com.google.api.PythonSettings.ExperimentalFeatures) obj; + + if (getRestAsyncIoEnabled() != other.getRestAsyncIoEnabled()) return false; + if (getProtobufPythonicTypesEnabled() != other.getProtobufPythonicTypesEnabled()) + return false; + if (getUnversionedPackageDisabled() != other.getUnversionedPackageDisabled()) 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) + REST_ASYNC_IO_ENABLED_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getRestAsyncIoEnabled()); + hash = (37 * hash) + PROTOBUF_PYTHONIC_TYPES_ENABLED_FIELD_NUMBER; + hash = + (53 * hash) + com.google.protobuf.Internal.hashBoolean(getProtobufPythonicTypesEnabled()); + hash = (37 * hash) + UNVERSIONED_PACKAGE_DISABLED_FIELD_NUMBER; + hash = + (53 * hash) + com.google.protobuf.Internal.hashBoolean(getUnversionedPackageDisabled()); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.api.PythonSettings.ExperimentalFeatures parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.api.PythonSettings.ExperimentalFeatures parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.api.PythonSettings.ExperimentalFeatures parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.api.PythonSettings.ExperimentalFeatures parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.api.PythonSettings.ExperimentalFeatures parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.api.PythonSettings.ExperimentalFeatures parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.api.PythonSettings.ExperimentalFeatures parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.api.PythonSettings.ExperimentalFeatures parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.api.PythonSettings.ExperimentalFeatures parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.api.PythonSettings.ExperimentalFeatures parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.api.PythonSettings.ExperimentalFeatures parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.api.PythonSettings.ExperimentalFeatures parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.api.PythonSettings.ExperimentalFeatures 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
        +     * Experimental features to be included during client library generation.
        +     * These fields will be deprecated once the feature graduates and is enabled
        +     * by default.
        +     * 
        + * + * Protobuf type {@code google.api.PythonSettings.ExperimentalFeatures} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.api.PythonSettings.ExperimentalFeatures) + com.google.api.PythonSettings.ExperimentalFeaturesOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.api.ClientProto + .internal_static_google_api_PythonSettings_ExperimentalFeatures_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.api.ClientProto + .internal_static_google_api_PythonSettings_ExperimentalFeatures_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.api.PythonSettings.ExperimentalFeatures.class, + com.google.api.PythonSettings.ExperimentalFeatures.Builder.class); + } + + // Construct using com.google.api.PythonSettings.ExperimentalFeatures.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + restAsyncIoEnabled_ = false; + protobufPythonicTypesEnabled_ = false; + unversionedPackageDisabled_ = false; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.api.ClientProto + .internal_static_google_api_PythonSettings_ExperimentalFeatures_descriptor; + } + + @java.lang.Override + public com.google.api.PythonSettings.ExperimentalFeatures getDefaultInstanceForType() { + return com.google.api.PythonSettings.ExperimentalFeatures.getDefaultInstance(); + } + + @java.lang.Override + public com.google.api.PythonSettings.ExperimentalFeatures build() { + com.google.api.PythonSettings.ExperimentalFeatures result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.api.PythonSettings.ExperimentalFeatures buildPartial() { + com.google.api.PythonSettings.ExperimentalFeatures result = + new com.google.api.PythonSettings.ExperimentalFeatures(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.api.PythonSettings.ExperimentalFeatures result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.restAsyncIoEnabled_ = restAsyncIoEnabled_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.protobufPythonicTypesEnabled_ = protobufPythonicTypesEnabled_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.unversionedPackageDisabled_ = unversionedPackageDisabled_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.api.PythonSettings.ExperimentalFeatures) { + return mergeFrom((com.google.api.PythonSettings.ExperimentalFeatures) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.api.PythonSettings.ExperimentalFeatures other) { + if (other == com.google.api.PythonSettings.ExperimentalFeatures.getDefaultInstance()) + return this; + if (other.getRestAsyncIoEnabled() != false) { + setRestAsyncIoEnabled(other.getRestAsyncIoEnabled()); + } + if (other.getProtobufPythonicTypesEnabled() != false) { + setProtobufPythonicTypesEnabled(other.getProtobufPythonicTypesEnabled()); + } + if (other.getUnversionedPackageDisabled() != false) { + setUnversionedPackageDisabled(other.getUnversionedPackageDisabled()); + } + 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: + { + restAsyncIoEnabled_ = input.readBool(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 16: + { + protobufPythonicTypesEnabled_ = input.readBool(); + bitField0_ |= 0x00000002; + break; + } // case 16 + case 24: + { + unversionedPackageDisabled_ = 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 boolean restAsyncIoEnabled_; + + /** + * + * + *
        +       * Enables generation of asynchronous REST clients if `rest` transport is
        +       * enabled. By default, asynchronous REST clients will not be generated.
        +       * This feature will be enabled by default 1 month after launching the
        +       * feature in preview packages.
        +       * 
        + * + * bool rest_async_io_enabled = 1; + * + * @return The restAsyncIoEnabled. + */ + @java.lang.Override + public boolean getRestAsyncIoEnabled() { + return restAsyncIoEnabled_; + } + + /** + * + * + *
        +       * Enables generation of asynchronous REST clients if `rest` transport is
        +       * enabled. By default, asynchronous REST clients will not be generated.
        +       * This feature will be enabled by default 1 month after launching the
        +       * feature in preview packages.
        +       * 
        + * + * bool rest_async_io_enabled = 1; + * + * @param value The restAsyncIoEnabled to set. + * @return This builder for chaining. + */ + public Builder setRestAsyncIoEnabled(boolean value) { + + restAsyncIoEnabled_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
        +       * Enables generation of asynchronous REST clients if `rest` transport is
        +       * enabled. By default, asynchronous REST clients will not be generated.
        +       * This feature will be enabled by default 1 month after launching the
        +       * feature in preview packages.
        +       * 
        + * + * bool rest_async_io_enabled = 1; + * + * @return This builder for chaining. + */ + public Builder clearRestAsyncIoEnabled() { + bitField0_ = (bitField0_ & ~0x00000001); + restAsyncIoEnabled_ = false; + onChanged(); + return this; + } + + private boolean protobufPythonicTypesEnabled_; + + /** + * + * + *
        +       * Enables generation of protobuf code using new types that are more
        +       * Pythonic which are included in `protobuf>=5.29.x`. This feature will be
        +       * enabled by default 1 month after launching the feature in preview
        +       * packages.
        +       * 
        + * + * bool protobuf_pythonic_types_enabled = 2; + * + * @return The protobufPythonicTypesEnabled. + */ + @java.lang.Override + public boolean getProtobufPythonicTypesEnabled() { + return protobufPythonicTypesEnabled_; + } + + /** + * + * + *
        +       * Enables generation of protobuf code using new types that are more
        +       * Pythonic which are included in `protobuf>=5.29.x`. This feature will be
        +       * enabled by default 1 month after launching the feature in preview
        +       * packages.
        +       * 
        + * + * bool protobuf_pythonic_types_enabled = 2; + * + * @param value The protobufPythonicTypesEnabled to set. + * @return This builder for chaining. + */ + public Builder setProtobufPythonicTypesEnabled(boolean value) { + + protobufPythonicTypesEnabled_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
        +       * Enables generation of protobuf code using new types that are more
        +       * Pythonic which are included in `protobuf>=5.29.x`. This feature will be
        +       * enabled by default 1 month after launching the feature in preview
        +       * packages.
        +       * 
        + * + * bool protobuf_pythonic_types_enabled = 2; + * + * @return This builder for chaining. + */ + public Builder clearProtobufPythonicTypesEnabled() { + bitField0_ = (bitField0_ & ~0x00000002); + protobufPythonicTypesEnabled_ = false; + onChanged(); + return this; + } + + private boolean unversionedPackageDisabled_; + + /** + * + * + *
        +       * Disables generation of an unversioned Python package for this client
        +       * library. This means that the module names will need to be versioned in
        +       * import statements. For example `import google.cloud.library_v2` instead
        +       * of `import google.cloud.library`.
        +       * 
        + * + * bool unversioned_package_disabled = 3; + * + * @return The unversionedPackageDisabled. + */ + @java.lang.Override + public boolean getUnversionedPackageDisabled() { + return unversionedPackageDisabled_; + } + + /** + * + * + *
        +       * Disables generation of an unversioned Python package for this client
        +       * library. This means that the module names will need to be versioned in
        +       * import statements. For example `import google.cloud.library_v2` instead
        +       * of `import google.cloud.library`.
        +       * 
        + * + * bool unversioned_package_disabled = 3; + * + * @param value The unversionedPackageDisabled to set. + * @return This builder for chaining. + */ + public Builder setUnversionedPackageDisabled(boolean value) { + + unversionedPackageDisabled_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
        +       * Disables generation of an unversioned Python package for this client
        +       * library. This means that the module names will need to be versioned in
        +       * import statements. For example `import google.cloud.library_v2` instead
        +       * of `import google.cloud.library`.
        +       * 
        + * + * bool unversioned_package_disabled = 3; + * + * @return This builder for chaining. + */ + public Builder clearUnversionedPackageDisabled() { + bitField0_ = (bitField0_ & ~0x00000004); + unversionedPackageDisabled_ = false; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.api.PythonSettings.ExperimentalFeatures) + } + + // @@protoc_insertion_point(class_scope:google.api.PythonSettings.ExperimentalFeatures) + private static final com.google.api.PythonSettings.ExperimentalFeatures DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.api.PythonSettings.ExperimentalFeatures(); + } + + public static com.google.api.PythonSettings.ExperimentalFeatures getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ExperimentalFeatures 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.api.PythonSettings.ExperimentalFeatures getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + private int bitField0_; public static final int COMMON_FIELD_NUMBER = 1; private com.google.api.CommonLanguageSettings common_; + /** * * @@ -77,8 +857,9 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { */ @java.lang.Override public boolean hasCommon() { - return common_ != null; + return ((bitField0_ & 0x00000001) != 0); } + /** * * @@ -94,6 +875,7 @@ public boolean hasCommon() { public com.google.api.CommonLanguageSettings getCommon() { return common_ == null ? com.google.api.CommonLanguageSettings.getDefaultInstance() : common_; } + /** * * @@ -105,7 +887,61 @@ public com.google.api.CommonLanguageSettings getCommon() { */ @java.lang.Override public com.google.api.CommonLanguageSettingsOrBuilder getCommonOrBuilder() { - return getCommon(); + return common_ == null ? com.google.api.CommonLanguageSettings.getDefaultInstance() : common_; + } + + public static final int EXPERIMENTAL_FEATURES_FIELD_NUMBER = 2; + private com.google.api.PythonSettings.ExperimentalFeatures experimentalFeatures_; + + /** + * + * + *
        +   * Experimental features to be included during client library generation.
        +   * 
        + * + * .google.api.PythonSettings.ExperimentalFeatures experimental_features = 2; + * + * @return Whether the experimentalFeatures field is set. + */ + @java.lang.Override + public boolean hasExperimentalFeatures() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
        +   * Experimental features to be included during client library generation.
        +   * 
        + * + * .google.api.PythonSettings.ExperimentalFeatures experimental_features = 2; + * + * @return The experimentalFeatures. + */ + @java.lang.Override + public com.google.api.PythonSettings.ExperimentalFeatures getExperimentalFeatures() { + return experimentalFeatures_ == null + ? com.google.api.PythonSettings.ExperimentalFeatures.getDefaultInstance() + : experimentalFeatures_; + } + + /** + * + * + *
        +   * Experimental features to be included during client library generation.
        +   * 
        + * + * .google.api.PythonSettings.ExperimentalFeatures experimental_features = 2; + */ + @java.lang.Override + public com.google.api.PythonSettings.ExperimentalFeaturesOrBuilder + getExperimentalFeaturesOrBuilder() { + return experimentalFeatures_ == null + ? com.google.api.PythonSettings.ExperimentalFeatures.getDefaultInstance() + : experimentalFeatures_; } private byte memoizedIsInitialized = -1; @@ -122,9 +958,12 @@ public final boolean isInitialized() { @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (common_ != null) { + if (((bitField0_ & 0x00000001) != 0)) { output.writeMessage(1, getCommon()); } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeMessage(2, getExperimentalFeatures()); + } getUnknownFields().writeTo(output); } @@ -134,9 +973,13 @@ public int getSerializedSize() { if (size != -1) return size; size = 0; - if (common_ != null) { + if (((bitField0_ & 0x00000001) != 0)) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getCommon()); } + if (((bitField0_ & 0x00000002) != 0)) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize(2, getExperimentalFeatures()); + } size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; @@ -156,6 +999,10 @@ public boolean equals(final java.lang.Object obj) { if (hasCommon()) { if (!getCommon().equals(other.getCommon())) return false; } + if (hasExperimentalFeatures() != other.hasExperimentalFeatures()) return false; + if (hasExperimentalFeatures()) { + if (!getExperimentalFeatures().equals(other.getExperimentalFeatures())) return false; + } if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -171,6 +1018,10 @@ public int hashCode() { hash = (37 * hash) + COMMON_FIELD_NUMBER; hash = (53 * hash) + getCommon().hashCode(); } + if (hasExperimentalFeatures()) { + hash = (37 * hash) + EXPERIMENTAL_FEATURES_FIELD_NUMBER; + hash = (53 * hash) + getExperimentalFeatures().hashCode(); + } hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; @@ -212,38 +1063,38 @@ public static com.google.api.PythonSettings parseFrom( public static com.google.api.PythonSettings parseFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); } public static com.google.api.PythonSettings parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } public static com.google.api.PythonSettings parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); } public static com.google.api.PythonSettings parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( PARSER, input, extensionRegistry); } public static com.google.api.PythonSettings parseFrom(com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); } public static com.google.api.PythonSettings parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } @@ -266,10 +1117,11 @@ public Builder toBuilder() { } @java.lang.Override - protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { Builder builder = new Builder(parent); return builder; } + /** * * @@ -279,7 +1131,7 @@ protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.Build * * Protobuf type {@code google.api.PythonSettings} */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder implements // @@protoc_insertion_point(builder_implements:google.api.PythonSettings) com.google.api.PythonSettingsOrBuilder { @@ -288,7 +1140,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.api.ClientProto.internal_static_google_api_PythonSettings_fieldAccessorTable .ensureFieldAccessorsInitialized( @@ -296,21 +1148,36 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } // Construct using com.google.api.PythonSettings.newBuilder() - private Builder() {} + private Builder() { + maybeForceBuilderInitialization(); + } - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetCommonFieldBuilder(); + internalGetExperimentalFeaturesFieldBuilder(); + } } @java.lang.Override public Builder clear() { super.clear(); - if (commonBuilder_ == null) { - common_ = null; - } else { - common_ = null; + bitField0_ = 0; + common_ = null; + if (commonBuilder_ != null) { + commonBuilder_.dispose(); commonBuilder_ = null; } + experimentalFeatures_ = null; + if (experimentalFeaturesBuilder_ != null) { + experimentalFeaturesBuilder_.dispose(); + experimentalFeaturesBuilder_ = null; + } return this; } @@ -336,46 +1203,28 @@ public com.google.api.PythonSettings build() { @java.lang.Override public com.google.api.PythonSettings buildPartial() { com.google.api.PythonSettings result = new com.google.api.PythonSettings(this); - if (commonBuilder_ == null) { - result.common_ = common_; - } else { - result.common_ = commonBuilder_.build(); + if (bitField0_ != 0) { + buildPartial0(result); } 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); + private void buildPartial0(com.google.api.PythonSettings result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.common_ = commonBuilder_ == null ? common_ : commonBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.experimentalFeatures_ = + experimentalFeaturesBuilder_ == null + ? experimentalFeatures_ + : experimentalFeaturesBuilder_.build(); + to_bitField0_ |= 0x00000002; + } + result.bitField0_ |= to_bitField0_; } @java.lang.Override @@ -393,6 +1242,9 @@ public Builder mergeFrom(com.google.api.PythonSettings other) { if (other.hasCommon()) { mergeCommon(other.getCommon()); } + if (other.hasExperimentalFeatures()) { + mergeExperimentalFeatures(other.getExperimentalFeatures()); + } this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; @@ -421,10 +1273,17 @@ public Builder mergeFrom( break; case 10: { - input.readMessage(getCommonFieldBuilder().getBuilder(), extensionRegistry); - + input.readMessage(internalGetCommonFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000001; break; } // case 10 + case 18: + { + input.readMessage( + internalGetExperimentalFeaturesFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 default: { if (!super.parseUnknownField(input, extensionRegistry, tag)) { @@ -442,12 +1301,15 @@ public Builder mergeFrom( return this; } + private int bitField0_; + private com.google.api.CommonLanguageSettings common_; - private com.google.protobuf.SingleFieldBuilderV3< + private com.google.protobuf.SingleFieldBuilder< com.google.api.CommonLanguageSettings, com.google.api.CommonLanguageSettings.Builder, com.google.api.CommonLanguageSettingsOrBuilder> commonBuilder_; + /** * * @@ -460,8 +1322,9 @@ public Builder mergeFrom( * @return Whether the common field is set. */ public boolean hasCommon() { - return commonBuilder_ != null || common_ != null; + return ((bitField0_ & 0x00000001) != 0); } + /** * * @@ -482,6 +1345,7 @@ public com.google.api.CommonLanguageSettings getCommon() { return commonBuilder_.getMessage(); } } + /** * * @@ -497,13 +1361,14 @@ public Builder setCommon(com.google.api.CommonLanguageSettings value) { throw new NullPointerException(); } common_ = value; - onChanged(); } else { commonBuilder_.setMessage(value); } - + bitField0_ |= 0x00000001; + onChanged(); return this; } + /** * * @@ -516,13 +1381,14 @@ public Builder setCommon(com.google.api.CommonLanguageSettings value) { public Builder setCommon(com.google.api.CommonLanguageSettings.Builder builderForValue) { if (commonBuilder_ == null) { common_ = builderForValue.build(); - onChanged(); } else { commonBuilder_.setMessage(builderForValue.build()); } - + bitField0_ |= 0x00000001; + onChanged(); return this; } + /** * * @@ -534,21 +1400,23 @@ public Builder setCommon(com.google.api.CommonLanguageSettings.Builder builderFo */ public Builder mergeCommon(com.google.api.CommonLanguageSettings value) { if (commonBuilder_ == null) { - if (common_ != null) { - common_ = - com.google.api.CommonLanguageSettings.newBuilder(common_) - .mergeFrom(value) - .buildPartial(); + if (((bitField0_ & 0x00000001) != 0) + && common_ != null + && common_ != com.google.api.CommonLanguageSettings.getDefaultInstance()) { + getCommonBuilder().mergeFrom(value); } else { common_ = value; } - onChanged(); } else { commonBuilder_.mergeFrom(value); } - + if (common_ != null) { + bitField0_ |= 0x00000001; + onChanged(); + } return this; } + /** * * @@ -559,16 +1427,16 @@ public Builder mergeCommon(com.google.api.CommonLanguageSettings value) { * .google.api.CommonLanguageSettings common = 1; */ public Builder clearCommon() { - if (commonBuilder_ == null) { - common_ = null; - onChanged(); - } else { - common_ = null; + bitField0_ = (bitField0_ & ~0x00000001); + common_ = null; + if (commonBuilder_ != null) { + commonBuilder_.dispose(); commonBuilder_ = null; } - + onChanged(); return this; } + /** * * @@ -579,10 +1447,11 @@ public Builder clearCommon() { * .google.api.CommonLanguageSettings common = 1; */ public com.google.api.CommonLanguageSettings.Builder getCommonBuilder() { - + bitField0_ |= 0x00000001; onChanged(); - return getCommonFieldBuilder().getBuilder(); + return internalGetCommonFieldBuilder().getBuilder(); } + /** * * @@ -601,6 +1470,7 @@ public com.google.api.CommonLanguageSettingsOrBuilder getCommonOrBuilder() { : common_; } } + /** * * @@ -610,14 +1480,14 @@ public com.google.api.CommonLanguageSettingsOrBuilder getCommonOrBuilder() { * * .google.api.CommonLanguageSettings common = 1; */ - private com.google.protobuf.SingleFieldBuilderV3< + private com.google.protobuf.SingleFieldBuilder< com.google.api.CommonLanguageSettings, com.google.api.CommonLanguageSettings.Builder, com.google.api.CommonLanguageSettingsOrBuilder> - getCommonFieldBuilder() { + internalGetCommonFieldBuilder() { if (commonBuilder_ == null) { commonBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< + new com.google.protobuf.SingleFieldBuilder< com.google.api.CommonLanguageSettings, com.google.api.CommonLanguageSettings.Builder, com.google.api.CommonLanguageSettingsOrBuilder>( @@ -627,15 +1497,204 @@ public com.google.api.CommonLanguageSettingsOrBuilder getCommonOrBuilder() { return commonBuilder_; } - @java.lang.Override - public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); + private com.google.api.PythonSettings.ExperimentalFeatures experimentalFeatures_; + private com.google.protobuf.SingleFieldBuilder< + com.google.api.PythonSettings.ExperimentalFeatures, + com.google.api.PythonSettings.ExperimentalFeatures.Builder, + com.google.api.PythonSettings.ExperimentalFeaturesOrBuilder> + experimentalFeaturesBuilder_; + + /** + * + * + *
        +     * Experimental features to be included during client library generation.
        +     * 
        + * + * .google.api.PythonSettings.ExperimentalFeatures experimental_features = 2; + * + * @return Whether the experimentalFeatures field is set. + */ + public boolean hasExperimentalFeatures() { + return ((bitField0_ & 0x00000002) != 0); } - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); + /** + * + * + *
        +     * Experimental features to be included during client library generation.
        +     * 
        + * + * .google.api.PythonSettings.ExperimentalFeatures experimental_features = 2; + * + * @return The experimentalFeatures. + */ + public com.google.api.PythonSettings.ExperimentalFeatures getExperimentalFeatures() { + if (experimentalFeaturesBuilder_ == null) { + return experimentalFeatures_ == null + ? com.google.api.PythonSettings.ExperimentalFeatures.getDefaultInstance() + : experimentalFeatures_; + } else { + return experimentalFeaturesBuilder_.getMessage(); + } + } + + /** + * + * + *
        +     * Experimental features to be included during client library generation.
        +     * 
        + * + * .google.api.PythonSettings.ExperimentalFeatures experimental_features = 2; + */ + public Builder setExperimentalFeatures( + com.google.api.PythonSettings.ExperimentalFeatures value) { + if (experimentalFeaturesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + experimentalFeatures_ = value; + } else { + experimentalFeaturesBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
        +     * Experimental features to be included during client library generation.
        +     * 
        + * + * .google.api.PythonSettings.ExperimentalFeatures experimental_features = 2; + */ + public Builder setExperimentalFeatures( + com.google.api.PythonSettings.ExperimentalFeatures.Builder builderForValue) { + if (experimentalFeaturesBuilder_ == null) { + experimentalFeatures_ = builderForValue.build(); + } else { + experimentalFeaturesBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
        +     * Experimental features to be included during client library generation.
        +     * 
        + * + * .google.api.PythonSettings.ExperimentalFeatures experimental_features = 2; + */ + public Builder mergeExperimentalFeatures( + com.google.api.PythonSettings.ExperimentalFeatures value) { + if (experimentalFeaturesBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && experimentalFeatures_ != null + && experimentalFeatures_ + != com.google.api.PythonSettings.ExperimentalFeatures.getDefaultInstance()) { + getExperimentalFeaturesBuilder().mergeFrom(value); + } else { + experimentalFeatures_ = value; + } + } else { + experimentalFeaturesBuilder_.mergeFrom(value); + } + if (experimentalFeatures_ != null) { + bitField0_ |= 0x00000002; + onChanged(); + } + return this; + } + + /** + * + * + *
        +     * Experimental features to be included during client library generation.
        +     * 
        + * + * .google.api.PythonSettings.ExperimentalFeatures experimental_features = 2; + */ + public Builder clearExperimentalFeatures() { + bitField0_ = (bitField0_ & ~0x00000002); + experimentalFeatures_ = null; + if (experimentalFeaturesBuilder_ != null) { + experimentalFeaturesBuilder_.dispose(); + experimentalFeaturesBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
        +     * Experimental features to be included during client library generation.
        +     * 
        + * + * .google.api.PythonSettings.ExperimentalFeatures experimental_features = 2; + */ + public com.google.api.PythonSettings.ExperimentalFeatures.Builder + getExperimentalFeaturesBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return internalGetExperimentalFeaturesFieldBuilder().getBuilder(); + } + + /** + * + * + *
        +     * Experimental features to be included during client library generation.
        +     * 
        + * + * .google.api.PythonSettings.ExperimentalFeatures experimental_features = 2; + */ + public com.google.api.PythonSettings.ExperimentalFeaturesOrBuilder + getExperimentalFeaturesOrBuilder() { + if (experimentalFeaturesBuilder_ != null) { + return experimentalFeaturesBuilder_.getMessageOrBuilder(); + } else { + return experimentalFeatures_ == null + ? com.google.api.PythonSettings.ExperimentalFeatures.getDefaultInstance() + : experimentalFeatures_; + } + } + + /** + * + * + *
        +     * Experimental features to be included during client library generation.
        +     * 
        + * + * .google.api.PythonSettings.ExperimentalFeatures experimental_features = 2; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.api.PythonSettings.ExperimentalFeatures, + com.google.api.PythonSettings.ExperimentalFeatures.Builder, + com.google.api.PythonSettings.ExperimentalFeaturesOrBuilder> + internalGetExperimentalFeaturesFieldBuilder() { + if (experimentalFeaturesBuilder_ == null) { + experimentalFeaturesBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.api.PythonSettings.ExperimentalFeatures, + com.google.api.PythonSettings.ExperimentalFeatures.Builder, + com.google.api.PythonSettings.ExperimentalFeaturesOrBuilder>( + getExperimentalFeatures(), getParentForChildren(), isClean()); + experimentalFeatures_ = null; + } + return experimentalFeaturesBuilder_; } // @@protoc_insertion_point(builder_scope:google.api.PythonSettings) diff --git a/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/PythonSettingsOrBuilder.java b/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/PythonSettingsOrBuilder.java index 9880ed0bfe..9bbce3365d 100644 --- a/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/PythonSettingsOrBuilder.java +++ b/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/PythonSettingsOrBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,10 +14,13 @@ * limitations under the License. */ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: google/api/client.proto +// Protobuf Java Version: 4.33.2 package com.google.api; +@com.google.protobuf.Generated public interface PythonSettingsOrBuilder extends // @@protoc_insertion_point(interface_extends:google.api.PythonSettings) @@ -35,6 +38,7 @@ public interface PythonSettingsOrBuilder * @return Whether the common field is set. */ boolean hasCommon(); + /** * * @@ -47,6 +51,7 @@ public interface PythonSettingsOrBuilder * @return The common. */ com.google.api.CommonLanguageSettings getCommon(); + /** * * @@ -57,4 +62,41 @@ public interface PythonSettingsOrBuilder * .google.api.CommonLanguageSettings common = 1; */ com.google.api.CommonLanguageSettingsOrBuilder getCommonOrBuilder(); + + /** + * + * + *
        +   * Experimental features to be included during client library generation.
        +   * 
        + * + * .google.api.PythonSettings.ExperimentalFeatures experimental_features = 2; + * + * @return Whether the experimentalFeatures field is set. + */ + boolean hasExperimentalFeatures(); + + /** + * + * + *
        +   * Experimental features to be included during client library generation.
        +   * 
        + * + * .google.api.PythonSettings.ExperimentalFeatures experimental_features = 2; + * + * @return The experimentalFeatures. + */ + com.google.api.PythonSettings.ExperimentalFeatures getExperimentalFeatures(); + + /** + * + * + *
        +   * Experimental features to be included during client library generation.
        +   * 
        + * + * .google.api.PythonSettings.ExperimentalFeatures experimental_features = 2; + */ + com.google.api.PythonSettings.ExperimentalFeaturesOrBuilder getExperimentalFeaturesOrBuilder(); } diff --git a/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/Quota.java b/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/Quota.java index f77fb009c4..b30139f04c 100644 --- a/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/Quota.java +++ b/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/Quota.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,9 @@ * limitations under the License. */ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: google/api/quota.proto +// Protobuf Java Version: 4.33.2 package com.google.api; @@ -24,55 +26,76 @@ *
          * Quota configuration helps to achieve fairness and budgeting in service
          * usage.
        + *
          * The metric based quota configuration works this way:
          * - The service configuration defines a set of metrics.
          * - For API calls, the quota.metric_rules maps methods to metrics with
        - *   corresponding costs.
        + * corresponding costs.
          * - The quota.limits defines limits on the metrics, which will be used for
        - *   quota checks at runtime.
        + * quota checks at runtime.
        + *
          * An example quota configuration in yaml format:
        - *    quota:
        - *      limits:
        - *      - name: apiWriteQpsPerProject
        - *        metric: library.googleapis.com/write_calls
        - *        unit: "1/min/{project}"  # rate limit for consumer projects
        - *        values:
        - *          STANDARD: 10000
        - *      (The metric rules bind all methods to the read_calls metric,
        - *       except for the UpdateBook and DeleteBook methods. These two methods
        - *       are mapped to the write_calls metric, with the UpdateBook method
        - *       consuming at twice rate as the DeleteBook method.)
        - *      metric_rules:
        - *      - selector: "*"
        - *        metric_costs:
        - *          library.googleapis.com/read_calls: 1
        - *      - selector: google.example.library.v1.LibraryService.UpdateBook
        - *        metric_costs:
        - *          library.googleapis.com/write_calls: 2
        - *      - selector: google.example.library.v1.LibraryService.DeleteBook
        - *        metric_costs:
        - *          library.googleapis.com/write_calls: 1
        - *  Corresponding Metric definition:
        - *      metrics:
        - *      - name: library.googleapis.com/read_calls
        - *        display_name: Read requests
        - *        metric_kind: DELTA
        - *        value_type: INT64
        - *      - name: library.googleapis.com/write_calls
        - *        display_name: Write requests
        - *        metric_kind: DELTA
        - *        value_type: INT64
        + *
        + * quota:
        + * limits:
        + *
        + * - name: apiWriteQpsPerProject
        + * metric: library.googleapis.com/write_calls
        + * unit: "1/min/{project}"  # rate limit for consumer projects
        + * values:
        + * STANDARD: 10000
        + *
        + *
        + * (The metric rules bind all methods to the read_calls metric,
        + * except for the UpdateBook and DeleteBook methods. These two methods
        + * are mapped to the write_calls metric, with the UpdateBook method
        + * consuming at twice rate as the DeleteBook method.)
        + * metric_rules:
        + * - selector: "*"
        + * metric_costs:
        + * library.googleapis.com/read_calls: 1
        + * - selector: google.example.library.v1.LibraryService.UpdateBook
        + * metric_costs:
        + * library.googleapis.com/write_calls: 2
        + * - selector: google.example.library.v1.LibraryService.DeleteBook
        + * metric_costs:
        + * library.googleapis.com/write_calls: 1
        + *
        + * Corresponding Metric definition:
        + *
        + * metrics:
        + * - name: library.googleapis.com/read_calls
        + * display_name: Read requests
        + * metric_kind: DELTA
        + * value_type: INT64
        + *
        + * - name: library.googleapis.com/write_calls
        + * display_name: Write requests
        + * metric_kind: DELTA
        + * value_type: INT64
          * 
        * * Protobuf type {@code google.api.Quota} */ -public final class Quota extends com.google.protobuf.GeneratedMessageV3 +@com.google.protobuf.Generated +public final class Quota extends com.google.protobuf.GeneratedMessage implements // @@protoc_insertion_point(message_implements:google.api.Quota) QuotaOrBuilder { private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "Quota"); + } + // Use Quota.newBuilder() to construct. - private Quota(com.google.protobuf.GeneratedMessageV3.Builder builder) { + private Quota(com.google.protobuf.GeneratedMessage.Builder builder) { super(builder); } @@ -81,23 +104,12 @@ private Quota() { metricRules_ = java.util.Collections.emptyList(); } - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new Quota(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.api.QuotaProto.internal_static_google_api_Quota_descriptor; } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.api.QuotaProto.internal_static_google_api_Quota_fieldAccessorTable .ensureFieldAccessorsInitialized( @@ -105,7 +117,10 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } public static final int LIMITS_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") private java.util.List limits_; + /** * * @@ -119,6 +134,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { public java.util.List getLimitsList() { return limits_; } + /** * * @@ -132,6 +148,7 @@ public java.util.List getLimitsList() { public java.util.List getLimitsOrBuilderList() { return limits_; } + /** * * @@ -145,6 +162,7 @@ public java.util.List getLimitsOrB public int getLimitsCount() { return limits_.size(); } + /** * * @@ -158,6 +176,7 @@ public int getLimitsCount() { public com.google.api.QuotaLimit getLimits(int index) { return limits_.get(index); } + /** * * @@ -173,7 +192,10 @@ public com.google.api.QuotaLimitOrBuilder getLimitsOrBuilder(int index) { } public static final int METRIC_RULES_FIELD_NUMBER = 4; + + @SuppressWarnings("serial") private java.util.List metricRules_; + /** * * @@ -188,6 +210,7 @@ public com.google.api.QuotaLimitOrBuilder getLimitsOrBuilder(int index) { public java.util.List getMetricRulesList() { return metricRules_; } + /** * * @@ -203,6 +226,7 @@ public java.util.List getMetricRulesList() { getMetricRulesOrBuilderList() { return metricRules_; } + /** * * @@ -217,6 +241,7 @@ public java.util.List getMetricRulesList() { public int getMetricRulesCount() { return metricRules_.size(); } + /** * * @@ -231,6 +256,7 @@ public int getMetricRulesCount() { public com.google.api.MetricRule getMetricRules(int index) { return metricRules_.get(index); } + /** * * @@ -358,38 +384,38 @@ public static com.google.api.Quota parseFrom( public static com.google.api.Quota parseFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); } public static com.google.api.Quota parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } public static com.google.api.Quota parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); } public static com.google.api.Quota parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( PARSER, input, extensionRegistry); } public static com.google.api.Quota parseFrom(com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); } public static com.google.api.Quota parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } @@ -412,59 +438,69 @@ public Builder toBuilder() { } @java.lang.Override - protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { Builder builder = new Builder(parent); return builder; } + /** * * *
            * Quota configuration helps to achieve fairness and budgeting in service
            * usage.
        +   *
            * The metric based quota configuration works this way:
            * - The service configuration defines a set of metrics.
            * - For API calls, the quota.metric_rules maps methods to metrics with
        -   *   corresponding costs.
        +   * corresponding costs.
            * - The quota.limits defines limits on the metrics, which will be used for
        -   *   quota checks at runtime.
        +   * quota checks at runtime.
        +   *
            * An example quota configuration in yaml format:
        -   *    quota:
        -   *      limits:
        -   *      - name: apiWriteQpsPerProject
        -   *        metric: library.googleapis.com/write_calls
        -   *        unit: "1/min/{project}"  # rate limit for consumer projects
        -   *        values:
        -   *          STANDARD: 10000
        -   *      (The metric rules bind all methods to the read_calls metric,
        -   *       except for the UpdateBook and DeleteBook methods. These two methods
        -   *       are mapped to the write_calls metric, with the UpdateBook method
        -   *       consuming at twice rate as the DeleteBook method.)
        -   *      metric_rules:
        -   *      - selector: "*"
        -   *        metric_costs:
        -   *          library.googleapis.com/read_calls: 1
        -   *      - selector: google.example.library.v1.LibraryService.UpdateBook
        -   *        metric_costs:
        -   *          library.googleapis.com/write_calls: 2
        -   *      - selector: google.example.library.v1.LibraryService.DeleteBook
        -   *        metric_costs:
        -   *          library.googleapis.com/write_calls: 1
        -   *  Corresponding Metric definition:
        -   *      metrics:
        -   *      - name: library.googleapis.com/read_calls
        -   *        display_name: Read requests
        -   *        metric_kind: DELTA
        -   *        value_type: INT64
        -   *      - name: library.googleapis.com/write_calls
        -   *        display_name: Write requests
        -   *        metric_kind: DELTA
        -   *        value_type: INT64
        +   *
        +   * quota:
        +   * limits:
        +   *
        +   * - name: apiWriteQpsPerProject
        +   * metric: library.googleapis.com/write_calls
        +   * unit: "1/min/{project}"  # rate limit for consumer projects
        +   * values:
        +   * STANDARD: 10000
        +   *
        +   *
        +   * (The metric rules bind all methods to the read_calls metric,
        +   * except for the UpdateBook and DeleteBook methods. These two methods
        +   * are mapped to the write_calls metric, with the UpdateBook method
        +   * consuming at twice rate as the DeleteBook method.)
        +   * metric_rules:
        +   * - selector: "*"
        +   * metric_costs:
        +   * library.googleapis.com/read_calls: 1
        +   * - selector: google.example.library.v1.LibraryService.UpdateBook
        +   * metric_costs:
        +   * library.googleapis.com/write_calls: 2
        +   * - selector: google.example.library.v1.LibraryService.DeleteBook
        +   * metric_costs:
        +   * library.googleapis.com/write_calls: 1
        +   *
        +   * Corresponding Metric definition:
        +   *
        +   * metrics:
        +   * - name: library.googleapis.com/read_calls
        +   * display_name: Read requests
        +   * metric_kind: DELTA
        +   * value_type: INT64
        +   *
        +   * - name: library.googleapis.com/write_calls
        +   * display_name: Write requests
        +   * metric_kind: DELTA
        +   * value_type: INT64
            * 
        * * Protobuf type {@code google.api.Quota} */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder implements // @@protoc_insertion_point(builder_implements:google.api.Quota) com.google.api.QuotaOrBuilder { @@ -473,7 +509,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.api.QuotaProto.internal_static_google_api_Quota_fieldAccessorTable .ensureFieldAccessorsInitialized( @@ -483,13 +519,14 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { // Construct using com.google.api.Quota.newBuilder() private Builder() {} - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { super(parent); } @java.lang.Override public Builder clear() { super.clear(); + bitField0_ = 0; if (limitsBuilder_ == null) { limits_ = java.util.Collections.emptyList(); } else { @@ -529,7 +566,15 @@ public com.google.api.Quota build() { @java.lang.Override public com.google.api.Quota buildPartial() { com.google.api.Quota result = new com.google.api.Quota(this); - int from_bitField0_ = bitField0_; + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields(com.google.api.Quota result) { if (limitsBuilder_ == null) { if (((bitField0_ & 0x00000001) != 0)) { limits_ = java.util.Collections.unmodifiableList(limits_); @@ -548,41 +593,10 @@ public com.google.api.Quota buildPartial() { } else { result.metricRules_ = metricRulesBuilder_.build(); } - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.setField(field, value); - } - - @java.lang.Override - public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - - @java.lang.Override - public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); } - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.addRepeatedField(field, value); + private void buildPartial0(com.google.api.Quota result) { + int from_bitField0_ = bitField0_; } @java.lang.Override @@ -616,8 +630,8 @@ public Builder mergeFrom(com.google.api.Quota other) { limits_ = other.limits_; bitField0_ = (bitField0_ & ~0x00000001); limitsBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders - ? getLimitsFieldBuilder() + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders + ? internalGetLimitsFieldBuilder() : null; } else { limitsBuilder_.addAllMessages(other.limits_); @@ -643,8 +657,8 @@ public Builder mergeFrom(com.google.api.Quota other) { metricRules_ = other.metricRules_; bitField0_ = (bitField0_ & ~0x00000002); metricRulesBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders - ? getMetricRulesFieldBuilder() + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders + ? internalGetMetricRulesFieldBuilder() : null; } else { metricRulesBuilder_.addAllMessages(other.metricRules_); @@ -729,7 +743,7 @@ private void ensureLimitsIsMutable() { } } - private com.google.protobuf.RepeatedFieldBuilderV3< + private com.google.protobuf.RepeatedFieldBuilder< com.google.api.QuotaLimit, com.google.api.QuotaLimit.Builder, com.google.api.QuotaLimitOrBuilder> @@ -751,6 +765,7 @@ public java.util.List getLimitsList() { return limitsBuilder_.getMessageList(); } } + /** * * @@ -767,6 +782,7 @@ public int getLimitsCount() { return limitsBuilder_.getCount(); } } + /** * * @@ -783,6 +799,7 @@ public com.google.api.QuotaLimit getLimits(int index) { return limitsBuilder_.getMessage(index); } } + /** * * @@ -805,6 +822,7 @@ public Builder setLimits(int index, com.google.api.QuotaLimit value) { } return this; } + /** * * @@ -824,6 +842,7 @@ public Builder setLimits(int index, com.google.api.QuotaLimit.Builder builderFor } return this; } + /** * * @@ -846,6 +865,7 @@ public Builder addLimits(com.google.api.QuotaLimit value) { } return this; } + /** * * @@ -868,6 +888,7 @@ public Builder addLimits(int index, com.google.api.QuotaLimit value) { } return this; } + /** * * @@ -887,6 +908,7 @@ public Builder addLimits(com.google.api.QuotaLimit.Builder builderForValue) { } return this; } + /** * * @@ -906,6 +928,7 @@ public Builder addLimits(int index, com.google.api.QuotaLimit.Builder builderFor } return this; } + /** * * @@ -925,6 +948,7 @@ public Builder addAllLimits(java.lang.Iterablerepeated .google.api.QuotaLimit limits = 3; */ public com.google.api.QuotaLimit.Builder getLimitsBuilder(int index) { - return getLimitsFieldBuilder().getBuilder(index); + return internalGetLimitsFieldBuilder().getBuilder(index); } + /** * * @@ -991,6 +1018,7 @@ public com.google.api.QuotaLimitOrBuilder getLimitsOrBuilder(int index) { return limitsBuilder_.getMessageOrBuilder(index); } } + /** * * @@ -1007,6 +1035,7 @@ public java.util.List getLimitsOrB return java.util.Collections.unmodifiableList(limits_); } } + /** * * @@ -1017,8 +1046,10 @@ public java.util.List getLimitsOrB * repeated .google.api.QuotaLimit limits = 3; */ public com.google.api.QuotaLimit.Builder addLimitsBuilder() { - return getLimitsFieldBuilder().addBuilder(com.google.api.QuotaLimit.getDefaultInstance()); + return internalGetLimitsFieldBuilder() + .addBuilder(com.google.api.QuotaLimit.getDefaultInstance()); } + /** * * @@ -1029,9 +1060,10 @@ public com.google.api.QuotaLimit.Builder addLimitsBuilder() { * repeated .google.api.QuotaLimit limits = 3; */ public com.google.api.QuotaLimit.Builder addLimitsBuilder(int index) { - return getLimitsFieldBuilder() + return internalGetLimitsFieldBuilder() .addBuilder(index, com.google.api.QuotaLimit.getDefaultInstance()); } + /** * * @@ -1042,17 +1074,17 @@ public com.google.api.QuotaLimit.Builder addLimitsBuilder(int index) { * repeated .google.api.QuotaLimit limits = 3; */ public java.util.List getLimitsBuilderList() { - return getLimitsFieldBuilder().getBuilderList(); + return internalGetLimitsFieldBuilder().getBuilderList(); } - private com.google.protobuf.RepeatedFieldBuilderV3< + private com.google.protobuf.RepeatedFieldBuilder< com.google.api.QuotaLimit, com.google.api.QuotaLimit.Builder, com.google.api.QuotaLimitOrBuilder> - getLimitsFieldBuilder() { + internalGetLimitsFieldBuilder() { if (limitsBuilder_ == null) { limitsBuilder_ = - new com.google.protobuf.RepeatedFieldBuilderV3< + new com.google.protobuf.RepeatedFieldBuilder< com.google.api.QuotaLimit, com.google.api.QuotaLimit.Builder, com.google.api.QuotaLimitOrBuilder>( @@ -1072,7 +1104,7 @@ private void ensureMetricRulesIsMutable() { } } - private com.google.protobuf.RepeatedFieldBuilderV3< + private com.google.protobuf.RepeatedFieldBuilder< com.google.api.MetricRule, com.google.api.MetricRule.Builder, com.google.api.MetricRuleOrBuilder> @@ -1095,6 +1127,7 @@ public java.util.List getMetricRulesList() { return metricRulesBuilder_.getMessageList(); } } + /** * * @@ -1112,6 +1145,7 @@ public int getMetricRulesCount() { return metricRulesBuilder_.getCount(); } } + /** * * @@ -1129,6 +1163,7 @@ public com.google.api.MetricRule getMetricRules(int index) { return metricRulesBuilder_.getMessage(index); } } + /** * * @@ -1152,6 +1187,7 @@ public Builder setMetricRules(int index, com.google.api.MetricRule value) { } return this; } + /** * * @@ -1172,6 +1208,7 @@ public Builder setMetricRules(int index, com.google.api.MetricRule.Builder build } return this; } + /** * * @@ -1195,6 +1232,7 @@ public Builder addMetricRules(com.google.api.MetricRule value) { } return this; } + /** * * @@ -1218,6 +1256,7 @@ public Builder addMetricRules(int index, com.google.api.MetricRule value) { } return this; } + /** * * @@ -1238,6 +1277,7 @@ public Builder addMetricRules(com.google.api.MetricRule.Builder builderForValue) } return this; } + /** * * @@ -1258,6 +1298,7 @@ public Builder addMetricRules(int index, com.google.api.MetricRule.Builder build } return this; } + /** * * @@ -1279,6 +1320,7 @@ public Builder addAllMetricRules( } return this; } + /** * * @@ -1299,6 +1341,7 @@ public Builder clearMetricRules() { } return this; } + /** * * @@ -1319,6 +1362,7 @@ public Builder removeMetricRules(int index) { } return this; } + /** * * @@ -1330,8 +1374,9 @@ public Builder removeMetricRules(int index) { * repeated .google.api.MetricRule metric_rules = 4; */ public com.google.api.MetricRule.Builder getMetricRulesBuilder(int index) { - return getMetricRulesFieldBuilder().getBuilder(index); + return internalGetMetricRulesFieldBuilder().getBuilder(index); } + /** * * @@ -1349,6 +1394,7 @@ public com.google.api.MetricRuleOrBuilder getMetricRulesOrBuilder(int index) { return metricRulesBuilder_.getMessageOrBuilder(index); } } + /** * * @@ -1367,6 +1413,7 @@ public com.google.api.MetricRuleOrBuilder getMetricRulesOrBuilder(int index) { return java.util.Collections.unmodifiableList(metricRules_); } } + /** * * @@ -1378,9 +1425,10 @@ public com.google.api.MetricRuleOrBuilder getMetricRulesOrBuilder(int index) { * repeated .google.api.MetricRule metric_rules = 4; */ public com.google.api.MetricRule.Builder addMetricRulesBuilder() { - return getMetricRulesFieldBuilder() + return internalGetMetricRulesFieldBuilder() .addBuilder(com.google.api.MetricRule.getDefaultInstance()); } + /** * * @@ -1392,9 +1440,10 @@ public com.google.api.MetricRule.Builder addMetricRulesBuilder() { * repeated .google.api.MetricRule metric_rules = 4; */ public com.google.api.MetricRule.Builder addMetricRulesBuilder(int index) { - return getMetricRulesFieldBuilder() + return internalGetMetricRulesFieldBuilder() .addBuilder(index, com.google.api.MetricRule.getDefaultInstance()); } + /** * * @@ -1406,17 +1455,17 @@ public com.google.api.MetricRule.Builder addMetricRulesBuilder(int index) { * repeated .google.api.MetricRule metric_rules = 4; */ public java.util.List getMetricRulesBuilderList() { - return getMetricRulesFieldBuilder().getBuilderList(); + return internalGetMetricRulesFieldBuilder().getBuilderList(); } - private com.google.protobuf.RepeatedFieldBuilderV3< + private com.google.protobuf.RepeatedFieldBuilder< com.google.api.MetricRule, com.google.api.MetricRule.Builder, com.google.api.MetricRuleOrBuilder> - getMetricRulesFieldBuilder() { + internalGetMetricRulesFieldBuilder() { if (metricRulesBuilder_ == null) { metricRulesBuilder_ = - new com.google.protobuf.RepeatedFieldBuilderV3< + new com.google.protobuf.RepeatedFieldBuilder< com.google.api.MetricRule, com.google.api.MetricRule.Builder, com.google.api.MetricRuleOrBuilder>( @@ -1426,17 +1475,6 @@ public java.util.List getMetricRulesBuilderLi return metricRulesBuilder_; } - @java.lang.Override - public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - // @@protoc_insertion_point(builder_scope:google.api.Quota) } diff --git a/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/QuotaLimit.java b/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/QuotaLimit.java index 50ebf11627..84eb3ed1fd 100644 --- a/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/QuotaLimit.java +++ b/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/QuotaLimit.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,9 @@ * limitations under the License. */ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: google/api/quota.proto +// Protobuf Java Version: 4.33.2 package com.google.api; @@ -29,13 +31,25 @@ * * Protobuf type {@code google.api.QuotaLimit} */ -public final class QuotaLimit extends com.google.protobuf.GeneratedMessageV3 +@com.google.protobuf.Generated +public final class QuotaLimit extends com.google.protobuf.GeneratedMessage implements // @@protoc_insertion_point(message_implements:google.api.QuotaLimit) QuotaLimitOrBuilder { private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "QuotaLimit"); + } + // Use QuotaLimit.newBuilder() to construct. - private QuotaLimit(com.google.protobuf.GeneratedMessageV3.Builder builder) { + private QuotaLimit(com.google.protobuf.GeneratedMessage.Builder builder) { super(builder); } @@ -48,24 +62,14 @@ private QuotaLimit() { displayName_ = ""; } - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new QuotaLimit(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.api.QuotaProto.internal_static_google_api_QuotaLimit_descriptor; } @SuppressWarnings({"rawtypes"}) @java.lang.Override - protected com.google.protobuf.MapField internalGetMapField(int number) { + protected com.google.protobuf.MapFieldReflectionAccessor internalGetMapFieldReflection( + int number) { switch (number) { case 10: return internalGetValues(); @@ -75,7 +79,7 @@ protected com.google.protobuf.MapField internalGetMapField(int number) { } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.api.QuotaProto.internal_static_google_api_QuotaLimit_fieldAccessorTable .ensureFieldAccessorsInitialized( @@ -83,14 +87,19 @@ protected com.google.protobuf.MapField internalGetMapField(int number) { } public static final int NAME_FIELD_NUMBER = 6; - private volatile java.lang.Object name_; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** * * *
            * Name of the quota limit.
        +   *
            * The name must be provided, and it must be unique within the service. The
            * name can only include alphanumeric characters as well as '-'.
        +   *
            * The maximum length of the limit name is 64 characters.
            * 
        * @@ -110,13 +119,16 @@ public java.lang.String getName() { return s; } } + /** * * *
            * Name of the quota limit.
        +   *
            * The name must be provided, and it must be unique within the service. The
            * name can only include alphanumeric characters as well as '-'.
        +   *
            * The maximum length of the limit name is 64 characters.
            * 
        * @@ -138,7 +150,10 @@ public com.google.protobuf.ByteString getNameBytes() { } public static final int DESCRIPTION_FIELD_NUMBER = 2; - private volatile java.lang.Object description_; + + @SuppressWarnings("serial") + private volatile java.lang.Object description_ = ""; + /** * * @@ -164,6 +179,7 @@ public java.lang.String getDescription() { return s; } } + /** * * @@ -191,7 +207,8 @@ public com.google.protobuf.ByteString getDescriptionBytes() { } public static final int DEFAULT_LIMIT_FIELD_NUMBER = 3; - private long defaultLimit_; + private long defaultLimit_ = 0L; + /** * * @@ -199,10 +216,12 @@ public com.google.protobuf.ByteString getDescriptionBytes() { * Default number of tokens that can be consumed during the specified * duration. This is the number of tokens assigned when a client * application developer activates the service for his/her project. + * * Specifying a value of 0 will block all requests. This can be used if you * are provisioning quota to selected consumers and blocking others. * Similarly, a value of -1 will indicate an unlimited quota. No other * negative values are allowed. + * * Used by group-based quotas only. * * @@ -216,7 +235,8 @@ public long getDefaultLimit() { } public static final int MAX_LIMIT_FIELD_NUMBER = 4; - private long maxLimit_; + private long maxLimit_ = 0L; + /** * * @@ -225,8 +245,10 @@ public long getDefaultLimit() { * duration. Client application developers can override the default limit up * to this maximum. If specified, this value cannot be set to a value less * than the default limit. If not specified, it is set to the default limit. + * * To allow clients to apply overrides with no upper bound, set this to -1, * indicating unlimited maximum quota. + * * Used by group-based quotas only. * * @@ -240,7 +262,8 @@ public long getMaxLimit() { } public static final int FREE_TIER_FIELD_NUMBER = 7; - private long freeTier_; + private long freeTier_ = 0L; + /** * * @@ -251,6 +274,7 @@ public long getMaxLimit() { * This field can only be set on a limit with duration "1d", in a billable * group; it is invalid on any other limit. If this field is not set, it * defaults to 0, indicating that there is no free tier for this service. + * * Used by group-based quotas only. * * @@ -264,12 +288,16 @@ public long getFreeTier() { } public static final int DURATION_FIELD_NUMBER = 5; - private volatile java.lang.Object duration_; + + @SuppressWarnings("serial") + private volatile java.lang.Object duration_ = ""; + /** * * *
            * Duration of this limit in textual notation. Must be "100s" or "1d".
        +   *
            * Used by group-based quotas only.
            * 
        * @@ -289,11 +317,13 @@ public java.lang.String getDuration() { return s; } } + /** * * *
            * Duration of this limit in textual notation. Must be "100s" or "1d".
        +   *
            * Used by group-based quotas only.
            * 
        * @@ -315,7 +345,10 @@ public com.google.protobuf.ByteString getDurationBytes() { } public static final int METRIC_FIELD_NUMBER = 8; - private volatile java.lang.Object metric_; + + @SuppressWarnings("serial") + private volatile java.lang.Object metric_ = ""; + /** * * @@ -341,6 +374,7 @@ public java.lang.String getMetric() { return s; } } + /** * * @@ -368,16 +402,21 @@ public com.google.protobuf.ByteString getMetricBytes() { } public static final int UNIT_FIELD_NUMBER = 9; - private volatile java.lang.Object unit_; + + @SuppressWarnings("serial") + private volatile java.lang.Object unit_ = ""; + /** * * *
            * Specify the unit of the quota limit. It uses the same syntax as
        -   * [Metric.unit][]. The supported unit kinds are determined by the quota
        -   * backend system.
        +   * [MetricDescriptor.unit][google.api.MetricDescriptor.unit]. The supported
        +   * unit kinds are determined by the quota backend system.
        +   *
            * Here are some examples:
            * * "1/min/{project}" for quota per minute per project.
        +   *
            * Note: the order of unit components is insignificant.
            * The "1" at the beginning is required to follow the metric unit syntax.
            * 
        @@ -398,15 +437,18 @@ public java.lang.String getUnit() { return s; } } + /** * * *
            * Specify the unit of the quota limit. It uses the same syntax as
        -   * [Metric.unit][]. The supported unit kinds are determined by the quota
        -   * backend system.
        +   * [MetricDescriptor.unit][google.api.MetricDescriptor.unit]. The supported
        +   * unit kinds are determined by the quota backend system.
        +   *
            * Here are some examples:
            * * "1/min/{project}" for quota per minute per project.
        +   *
            * Note: the order of unit components is insignificant.
            * The "1" at the beginning is required to follow the metric unit syntax.
            * 
        @@ -440,6 +482,7 @@ private static final class ValuesDefaultEntryHolder { 0L); } + @SuppressWarnings("serial") private com.google.protobuf.MapField values_; private com.google.protobuf.MapField internalGetValues() { @@ -452,6 +495,7 @@ private com.google.protobuf.MapField internalG public int getValuesCount() { return internalGetValues().getMap().size(); } + /** * * @@ -470,12 +514,14 @@ public boolean containsValues(java.lang.String key) { } return internalGetValues().getMap().containsKey(key); } + /** Use {@link #getValuesMap()} instead. */ @java.lang.Override @java.lang.Deprecated public java.util.Map getValues() { return getValuesMap(); } + /** * * @@ -491,6 +537,7 @@ public java.util.Map getValues() { public java.util.Map getValuesMap() { return internalGetValues().getMap(); } + /** * * @@ -510,6 +557,7 @@ public long getValuesOrDefault(java.lang.String key, long defaultValue) { java.util.Map map = internalGetValues().getMap(); return map.containsKey(key) ? map.get(key) : defaultValue; } + /** * * @@ -534,7 +582,10 @@ public long getValuesOrThrow(java.lang.String key) { } public static final int DISPLAY_NAME_FIELD_NUMBER = 12; - private volatile java.lang.Object displayName_; + + @SuppressWarnings("serial") + private volatile java.lang.Object displayName_ = ""; + /** * * @@ -561,6 +612,7 @@ public java.lang.String getDisplayName() { return s; } } + /** * * @@ -602,8 +654,8 @@ public final boolean isInitialized() { @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(description_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 2, description_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(description_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, description_); } if (defaultLimit_ != 0L) { output.writeInt64(3, defaultLimit_); @@ -611,25 +663,25 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (maxLimit_ != 0L) { output.writeInt64(4, maxLimit_); } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(duration_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 5, duration_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(duration_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 5, duration_); } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 6, name_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 6, name_); } if (freeTier_ != 0L) { output.writeInt64(7, freeTier_); } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(metric_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 8, metric_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(metric_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 8, metric_); } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(unit_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 9, unit_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(unit_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 9, unit_); } - com.google.protobuf.GeneratedMessageV3.serializeStringMapTo( + com.google.protobuf.GeneratedMessage.serializeStringMapTo( output, internalGetValues(), ValuesDefaultEntryHolder.defaultEntry, 10); - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(displayName_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 12, displayName_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(displayName_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 12, displayName_); } getUnknownFields().writeTo(output); } @@ -640,8 +692,8 @@ public int getSerializedSize() { if (size != -1) return size; size = 0; - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(description_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, description_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(description_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, description_); } if (defaultLimit_ != 0L) { size += com.google.protobuf.CodedOutputStream.computeInt64Size(3, defaultLimit_); @@ -649,20 +701,20 @@ public int getSerializedSize() { if (maxLimit_ != 0L) { size += com.google.protobuf.CodedOutputStream.computeInt64Size(4, maxLimit_); } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(duration_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, duration_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(duration_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(5, duration_); } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(6, name_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(6, name_); } if (freeTier_ != 0L) { size += com.google.protobuf.CodedOutputStream.computeInt64Size(7, freeTier_); } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(metric_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(8, metric_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(metric_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(8, metric_); } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(unit_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(9, unit_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(unit_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(9, unit_); } for (java.util.Map.Entry entry : internalGetValues().getMap().entrySet()) { @@ -674,8 +726,8 @@ public int getSerializedSize() { .build(); size += com.google.protobuf.CodedOutputStream.computeMessageSize(10, values__); } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(displayName_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(12, displayName_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(displayName_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(12, displayName_); } size += getUnknownFields().getSerializedSize(); memoizedSize = size; @@ -776,38 +828,38 @@ public static com.google.api.QuotaLimit parseFrom( public static com.google.api.QuotaLimit parseFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); } public static com.google.api.QuotaLimit parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } public static com.google.api.QuotaLimit parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); } public static com.google.api.QuotaLimit parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( PARSER, input, extensionRegistry); } public static com.google.api.QuotaLimit parseFrom(com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); } public static com.google.api.QuotaLimit parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } @@ -830,10 +882,11 @@ public Builder toBuilder() { } @java.lang.Override - protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { Builder builder = new Builder(parent); return builder; } + /** * * @@ -845,7 +898,7 @@ protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.Build * * Protobuf type {@code google.api.QuotaLimit} */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder implements // @@protoc_insertion_point(builder_implements:google.api.QuotaLimit) com.google.api.QuotaLimitOrBuilder { @@ -854,7 +907,8 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } @SuppressWarnings({"rawtypes"}) - protected com.google.protobuf.MapField internalGetMapField(int number) { + protected com.google.protobuf.MapFieldReflectionAccessor internalGetMapFieldReflection( + int number) { switch (number) { case 10: return internalGetValues(); @@ -864,7 +918,8 @@ protected com.google.protobuf.MapField internalGetMapField(int number) { } @SuppressWarnings({"rawtypes"}) - protected com.google.protobuf.MapField internalGetMutableMapField(int number) { + protected com.google.protobuf.MapFieldReflectionAccessor internalGetMutableMapFieldReflection( + int number) { switch (number) { case 10: return internalGetMutableValues(); @@ -874,7 +929,7 @@ protected com.google.protobuf.MapField internalGetMutableMapField(int number) { } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.api.QuotaProto.internal_static_google_api_QuotaLimit_fieldAccessorTable .ensureFieldAccessorsInitialized( @@ -884,32 +939,24 @@ protected com.google.protobuf.MapField internalGetMutableMapField(int number) { // Construct using com.google.api.QuotaLimit.newBuilder() private Builder() {} - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { super(parent); } @java.lang.Override public Builder clear() { super.clear(); + bitField0_ = 0; name_ = ""; - description_ = ""; - defaultLimit_ = 0L; - maxLimit_ = 0L; - freeTier_ = 0L; - duration_ = ""; - metric_ = ""; - unit_ = ""; - internalGetMutableValues().clear(); displayName_ = ""; - return this; } @@ -935,53 +982,46 @@ public com.google.api.QuotaLimit build() { @java.lang.Override public com.google.api.QuotaLimit buildPartial() { com.google.api.QuotaLimit result = new com.google.api.QuotaLimit(this); - int from_bitField0_ = bitField0_; - result.name_ = name_; - result.description_ = description_; - result.defaultLimit_ = defaultLimit_; - result.maxLimit_ = maxLimit_; - result.freeTier_ = freeTier_; - result.duration_ = duration_; - result.metric_ = metric_; - result.unit_ = unit_; - result.values_ = internalGetValues(); - result.values_.makeImmutable(); - result.displayName_ = displayName_; + if (bitField0_ != 0) { + buildPartial0(result); + } 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); + private void buildPartial0(com.google.api.QuotaLimit 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.defaultLimit_ = defaultLimit_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.maxLimit_ = maxLimit_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.freeTier_ = freeTier_; + } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.duration_ = duration_; + } + if (((from_bitField0_ & 0x00000040) != 0)) { + result.metric_ = metric_; + } + if (((from_bitField0_ & 0x00000080) != 0)) { + result.unit_ = unit_; + } + if (((from_bitField0_ & 0x00000100) != 0)) { + result.values_ = internalGetValues(); + result.values_.makeImmutable(); + } + if (((from_bitField0_ & 0x00000200) != 0)) { + result.displayName_ = displayName_; + } } @java.lang.Override @@ -998,10 +1038,12 @@ public Builder mergeFrom(com.google.api.QuotaLimit other) { if (other == com.google.api.QuotaLimit.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.getDefaultLimit() != 0L) { @@ -1015,19 +1057,24 @@ public Builder mergeFrom(com.google.api.QuotaLimit other) { } if (!other.getDuration().isEmpty()) { duration_ = other.duration_; + bitField0_ |= 0x00000020; onChanged(); } if (!other.getMetric().isEmpty()) { metric_ = other.metric_; + bitField0_ |= 0x00000040; onChanged(); } if (!other.getUnit().isEmpty()) { unit_ = other.unit_; + bitField0_ |= 0x00000080; onChanged(); } internalGetMutableValues().mergeFrom(other.internalGetValues()); + bitField0_ |= 0x00000100; if (!other.getDisplayName().isEmpty()) { displayName_ = other.displayName_; + bitField0_ |= 0x00000200; onChanged(); } this.mergeUnknownFields(other.getUnknownFields()); @@ -1059,49 +1106,49 @@ public Builder mergeFrom( case 18: { description_ = input.readStringRequireUtf8(); - + bitField0_ |= 0x00000002; break; } // case 18 case 24: { defaultLimit_ = input.readInt64(); - + bitField0_ |= 0x00000004; break; } // case 24 case 32: { maxLimit_ = input.readInt64(); - + bitField0_ |= 0x00000008; break; } // case 32 case 42: { duration_ = input.readStringRequireUtf8(); - + bitField0_ |= 0x00000020; break; } // case 42 case 50: { name_ = input.readStringRequireUtf8(); - + bitField0_ |= 0x00000001; break; } // case 50 case 56: { freeTier_ = input.readInt64(); - + bitField0_ |= 0x00000010; break; } // case 56 case 66: { metric_ = input.readStringRequireUtf8(); - + bitField0_ |= 0x00000040; break; } // case 66 case 74: { unit_ = input.readStringRequireUtf8(); - + bitField0_ |= 0x00000080; break; } // case 74 case 82: @@ -1113,12 +1160,13 @@ public Builder mergeFrom( internalGetMutableValues() .getMutableMap() .put(values__.getKey(), values__.getValue()); + bitField0_ |= 0x00000100; break; } // case 82 case 98: { displayName_ = input.readStringRequireUtf8(); - + bitField0_ |= 0x00000200; break; } // case 98 default: @@ -1141,13 +1189,16 @@ public Builder mergeFrom( private int bitField0_; private java.lang.Object name_ = ""; + /** * * *
              * Name of the quota limit.
        +     *
              * The name must be provided, and it must be unique within the service. The
              * name can only include alphanumeric characters as well as '-'.
        +     *
              * The maximum length of the limit name is 64 characters.
              * 
        * @@ -1166,13 +1217,16 @@ public java.lang.String getName() { return (java.lang.String) ref; } } + /** * * *
              * Name of the quota limit.
        +     *
              * The name must be provided, and it must be unique within the service. The
              * name can only include alphanumeric characters as well as '-'.
        +     *
              * The maximum length of the limit name is 64 characters.
              * 
        * @@ -1191,13 +1245,16 @@ public com.google.protobuf.ByteString getNameBytes() { return (com.google.protobuf.ByteString) ref; } } + /** * * *
              * Name of the quota limit.
        +     *
              * The name must be provided, and it must be unique within the service. The
              * name can only include alphanumeric characters as well as '-'.
        +     *
              * The maximum length of the limit name is 64 characters.
              * 
        * @@ -1210,18 +1267,21 @@ public Builder setName(java.lang.String value) { if (value == null) { throw new NullPointerException(); } - name_ = value; + bitField0_ |= 0x00000001; onChanged(); return this; } + /** * * *
              * Name of the quota limit.
        +     *
              * The name must be provided, and it must be unique within the service. The
              * name can only include alphanumeric characters as well as '-'.
        +     *
              * The maximum length of the limit name is 64 characters.
              * 
        * @@ -1230,18 +1290,21 @@ public Builder setName(java.lang.String value) { * @return This builder for chaining. */ public Builder clearName() { - name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); onChanged(); return this; } + /** * * *
              * Name of the quota limit.
        +     *
              * The name must be provided, and it must be unique within the service. The
              * name can only include alphanumeric characters as well as '-'.
        +     *
              * The maximum length of the limit name is 64 characters.
              * 
        * @@ -1255,13 +1318,14 @@ public Builder setNameBytes(com.google.protobuf.ByteString value) { throw new NullPointerException(); } checkByteStringIsUtf8(value); - name_ = value; + bitField0_ |= 0x00000001; onChanged(); return this; } private java.lang.Object description_ = ""; + /** * * @@ -1286,6 +1350,7 @@ public java.lang.String getDescription() { return (java.lang.String) ref; } } + /** * * @@ -1310,6 +1375,7 @@ public com.google.protobuf.ByteString getDescriptionBytes() { return (com.google.protobuf.ByteString) ref; } } + /** * * @@ -1328,11 +1394,12 @@ public Builder setDescription(java.lang.String value) { if (value == null) { throw new NullPointerException(); } - description_ = value; + bitField0_ |= 0x00000002; onChanged(); return this; } + /** * * @@ -1347,11 +1414,12 @@ public Builder setDescription(java.lang.String value) { * @return This builder for chaining. */ public Builder clearDescription() { - description_ = getDefaultInstance().getDescription(); + bitField0_ = (bitField0_ & ~0x00000002); onChanged(); return this; } + /** * * @@ -1371,13 +1439,14 @@ public Builder setDescriptionBytes(com.google.protobuf.ByteString value) { throw new NullPointerException(); } checkByteStringIsUtf8(value); - description_ = value; + bitField0_ |= 0x00000002; onChanged(); return this; } private long defaultLimit_; + /** * * @@ -1385,10 +1454,12 @@ public Builder setDescriptionBytes(com.google.protobuf.ByteString value) { * Default number of tokens that can be consumed during the specified * duration. This is the number of tokens assigned when a client * application developer activates the service for his/her project. + * * Specifying a value of 0 will block all requests. This can be used if you * are provisioning quota to selected consumers and blocking others. * Similarly, a value of -1 will indicate an unlimited quota. No other * negative values are allowed. + * * Used by group-based quotas only. * * @@ -1400,6 +1471,7 @@ public Builder setDescriptionBytes(com.google.protobuf.ByteString value) { public long getDefaultLimit() { return defaultLimit_; } + /** * * @@ -1407,10 +1479,12 @@ public long getDefaultLimit() { * Default number of tokens that can be consumed during the specified * duration. This is the number of tokens assigned when a client * application developer activates the service for his/her project. + * * Specifying a value of 0 will block all requests. This can be used if you * are provisioning quota to selected consumers and blocking others. * Similarly, a value of -1 will indicate an unlimited quota. No other * negative values are allowed. + * * Used by group-based quotas only. * * @@ -1422,9 +1496,11 @@ public long getDefaultLimit() { public Builder setDefaultLimit(long value) { defaultLimit_ = value; + bitField0_ |= 0x00000004; onChanged(); return this; } + /** * * @@ -1432,10 +1508,12 @@ public Builder setDefaultLimit(long value) { * Default number of tokens that can be consumed during the specified * duration. This is the number of tokens assigned when a client * application developer activates the service for his/her project. + * * Specifying a value of 0 will block all requests. This can be used if you * are provisioning quota to selected consumers and blocking others. * Similarly, a value of -1 will indicate an unlimited quota. No other * negative values are allowed. + * * Used by group-based quotas only. * * @@ -1444,13 +1522,14 @@ public Builder setDefaultLimit(long value) { * @return This builder for chaining. */ public Builder clearDefaultLimit() { - + bitField0_ = (bitField0_ & ~0x00000004); defaultLimit_ = 0L; onChanged(); return this; } private long maxLimit_; + /** * * @@ -1459,8 +1538,10 @@ public Builder clearDefaultLimit() { * duration. Client application developers can override the default limit up * to this maximum. If specified, this value cannot be set to a value less * than the default limit. If not specified, it is set to the default limit. + * * To allow clients to apply overrides with no upper bound, set this to -1, * indicating unlimited maximum quota. + * * Used by group-based quotas only. * * @@ -1472,6 +1553,7 @@ public Builder clearDefaultLimit() { public long getMaxLimit() { return maxLimit_; } + /** * * @@ -1480,8 +1562,10 @@ public long getMaxLimit() { * duration. Client application developers can override the default limit up * to this maximum. If specified, this value cannot be set to a value less * than the default limit. If not specified, it is set to the default limit. + * * To allow clients to apply overrides with no upper bound, set this to -1, * indicating unlimited maximum quota. + * * Used by group-based quotas only. * * @@ -1493,9 +1577,11 @@ public long getMaxLimit() { public Builder setMaxLimit(long value) { maxLimit_ = value; + bitField0_ |= 0x00000008; onChanged(); return this; } + /** * * @@ -1504,8 +1590,10 @@ public Builder setMaxLimit(long value) { * duration. Client application developers can override the default limit up * to this maximum. If specified, this value cannot be set to a value less * than the default limit. If not specified, it is set to the default limit. + * * To allow clients to apply overrides with no upper bound, set this to -1, * indicating unlimited maximum quota. + * * Used by group-based quotas only. * * @@ -1514,13 +1602,14 @@ public Builder setMaxLimit(long value) { * @return This builder for chaining. */ public Builder clearMaxLimit() { - + bitField0_ = (bitField0_ & ~0x00000008); maxLimit_ = 0L; onChanged(); return this; } private long freeTier_; + /** * * @@ -1531,6 +1620,7 @@ public Builder clearMaxLimit() { * This field can only be set on a limit with duration "1d", in a billable * group; it is invalid on any other limit. If this field is not set, it * defaults to 0, indicating that there is no free tier for this service. + * * Used by group-based quotas only. * * @@ -1542,6 +1632,7 @@ public Builder clearMaxLimit() { public long getFreeTier() { return freeTier_; } + /** * * @@ -1552,6 +1643,7 @@ public long getFreeTier() { * This field can only be set on a limit with duration "1d", in a billable * group; it is invalid on any other limit. If this field is not set, it * defaults to 0, indicating that there is no free tier for this service. + * * Used by group-based quotas only. * * @@ -1563,9 +1655,11 @@ public long getFreeTier() { public Builder setFreeTier(long value) { freeTier_ = value; + bitField0_ |= 0x00000010; onChanged(); return this; } + /** * * @@ -1576,6 +1670,7 @@ public Builder setFreeTier(long value) { * This field can only be set on a limit with duration "1d", in a billable * group; it is invalid on any other limit. If this field is not set, it * defaults to 0, indicating that there is no free tier for this service. + * * Used by group-based quotas only. * * @@ -1584,18 +1679,20 @@ public Builder setFreeTier(long value) { * @return This builder for chaining. */ public Builder clearFreeTier() { - + bitField0_ = (bitField0_ & ~0x00000010); freeTier_ = 0L; onChanged(); return this; } private java.lang.Object duration_ = ""; + /** * * *
              * Duration of this limit in textual notation. Must be "100s" or "1d".
        +     *
              * Used by group-based quotas only.
              * 
        * @@ -1614,11 +1711,13 @@ public java.lang.String getDuration() { return (java.lang.String) ref; } } + /** * * *
              * Duration of this limit in textual notation. Must be "100s" or "1d".
        +     *
              * Used by group-based quotas only.
              * 
        * @@ -1637,11 +1736,13 @@ public com.google.protobuf.ByteString getDurationBytes() { return (com.google.protobuf.ByteString) ref; } } + /** * * *
              * Duration of this limit in textual notation. Must be "100s" or "1d".
        +     *
              * Used by group-based quotas only.
              * 
        * @@ -1654,16 +1755,18 @@ public Builder setDuration(java.lang.String value) { if (value == null) { throw new NullPointerException(); } - duration_ = value; + bitField0_ |= 0x00000020; onChanged(); return this; } + /** * * *
              * Duration of this limit in textual notation. Must be "100s" or "1d".
        +     *
              * Used by group-based quotas only.
              * 
        * @@ -1672,16 +1775,18 @@ public Builder setDuration(java.lang.String value) { * @return This builder for chaining. */ public Builder clearDuration() { - duration_ = getDefaultInstance().getDuration(); + bitField0_ = (bitField0_ & ~0x00000020); onChanged(); return this; } + /** * * *
              * Duration of this limit in textual notation. Must be "100s" or "1d".
        +     *
              * Used by group-based quotas only.
              * 
        * @@ -1695,13 +1800,14 @@ public Builder setDurationBytes(com.google.protobuf.ByteString value) { throw new NullPointerException(); } checkByteStringIsUtf8(value); - duration_ = value; + bitField0_ |= 0x00000020; onChanged(); return this; } private java.lang.Object metric_ = ""; + /** * * @@ -1726,6 +1832,7 @@ public java.lang.String getMetric() { return (java.lang.String) ref; } } + /** * * @@ -1750,6 +1857,7 @@ public com.google.protobuf.ByteString getMetricBytes() { return (com.google.protobuf.ByteString) ref; } } + /** * * @@ -1768,11 +1876,12 @@ public Builder setMetric(java.lang.String value) { if (value == null) { throw new NullPointerException(); } - metric_ = value; + bitField0_ |= 0x00000040; onChanged(); return this; } + /** * * @@ -1787,11 +1896,12 @@ public Builder setMetric(java.lang.String value) { * @return This builder for chaining. */ public Builder clearMetric() { - metric_ = getDefaultInstance().getMetric(); + bitField0_ = (bitField0_ & ~0x00000040); onChanged(); return this; } + /** * * @@ -1811,22 +1921,25 @@ public Builder setMetricBytes(com.google.protobuf.ByteString value) { throw new NullPointerException(); } checkByteStringIsUtf8(value); - metric_ = value; + bitField0_ |= 0x00000040; onChanged(); return this; } private java.lang.Object unit_ = ""; + /** * * *
              * Specify the unit of the quota limit. It uses the same syntax as
        -     * [Metric.unit][]. The supported unit kinds are determined by the quota
        -     * backend system.
        +     * [MetricDescriptor.unit][google.api.MetricDescriptor.unit]. The supported
        +     * unit kinds are determined by the quota backend system.
        +     *
              * Here are some examples:
              * * "1/min/{project}" for quota per minute per project.
        +     *
              * Note: the order of unit components is insignificant.
              * The "1" at the beginning is required to follow the metric unit syntax.
              * 
        @@ -1846,15 +1959,18 @@ public java.lang.String getUnit() { return (java.lang.String) ref; } } + /** * * *
              * Specify the unit of the quota limit. It uses the same syntax as
        -     * [Metric.unit][]. The supported unit kinds are determined by the quota
        -     * backend system.
        +     * [MetricDescriptor.unit][google.api.MetricDescriptor.unit]. The supported
        +     * unit kinds are determined by the quota backend system.
        +     *
              * Here are some examples:
              * * "1/min/{project}" for quota per minute per project.
        +     *
              * Note: the order of unit components is insignificant.
              * The "1" at the beginning is required to follow the metric unit syntax.
              * 
        @@ -1874,15 +1990,18 @@ public com.google.protobuf.ByteString getUnitBytes() { return (com.google.protobuf.ByteString) ref; } } + /** * * *
              * Specify the unit of the quota limit. It uses the same syntax as
        -     * [Metric.unit][]. The supported unit kinds are determined by the quota
        -     * backend system.
        +     * [MetricDescriptor.unit][google.api.MetricDescriptor.unit]. The supported
        +     * unit kinds are determined by the quota backend system.
        +     *
              * Here are some examples:
              * * "1/min/{project}" for quota per minute per project.
        +     *
              * Note: the order of unit components is insignificant.
              * The "1" at the beginning is required to follow the metric unit syntax.
              * 
        @@ -1896,20 +2015,23 @@ public Builder setUnit(java.lang.String value) { if (value == null) { throw new NullPointerException(); } - unit_ = value; + bitField0_ |= 0x00000080; onChanged(); return this; } + /** * * *
              * Specify the unit of the quota limit. It uses the same syntax as
        -     * [Metric.unit][]. The supported unit kinds are determined by the quota
        -     * backend system.
        +     * [MetricDescriptor.unit][google.api.MetricDescriptor.unit]. The supported
        +     * unit kinds are determined by the quota backend system.
        +     *
              * Here are some examples:
              * * "1/min/{project}" for quota per minute per project.
        +     *
              * Note: the order of unit components is insignificant.
              * The "1" at the beginning is required to follow the metric unit syntax.
              * 
        @@ -1919,20 +2041,23 @@ public Builder setUnit(java.lang.String value) { * @return This builder for chaining. */ public Builder clearUnit() { - unit_ = getDefaultInstance().getUnit(); + bitField0_ = (bitField0_ & ~0x00000080); onChanged(); return this; } + /** * * *
              * Specify the unit of the quota limit. It uses the same syntax as
        -     * [Metric.unit][]. The supported unit kinds are determined by the quota
        -     * backend system.
        +     * [MetricDescriptor.unit][google.api.MetricDescriptor.unit]. The supported
        +     * unit kinds are determined by the quota backend system.
        +     *
              * Here are some examples:
              * * "1/min/{project}" for quota per minute per project.
        +     *
              * Note: the order of unit components is insignificant.
              * The "1" at the beginning is required to follow the metric unit syntax.
              * 
        @@ -1947,8 +2072,8 @@ public Builder setUnitBytes(com.google.protobuf.ByteString value) { throw new NullPointerException(); } checkByteStringIsUtf8(value); - unit_ = value; + bitField0_ |= 0x00000080; onChanged(); return this; } @@ -1964,20 +2089,21 @@ private com.google.protobuf.MapField internalG private com.google.protobuf.MapField internalGetMutableValues() { - onChanged(); - ; if (values_ == null) { values_ = com.google.protobuf.MapField.newMapField(ValuesDefaultEntryHolder.defaultEntry); } if (!values_.isMutable()) { values_ = values_.copy(); } + bitField0_ |= 0x00000100; + onChanged(); return values_; } public int getValuesCount() { return internalGetValues().getMap().size(); } + /** * * @@ -1996,12 +2122,14 @@ public boolean containsValues(java.lang.String key) { } return internalGetValues().getMap().containsKey(key); } + /** Use {@link #getValuesMap()} instead. */ @java.lang.Override @java.lang.Deprecated public java.util.Map getValues() { return getValuesMap(); } + /** * * @@ -2017,6 +2145,7 @@ public java.util.Map getValues() { public java.util.Map getValuesMap() { return internalGetValues().getMap(); } + /** * * @@ -2036,6 +2165,7 @@ public long getValuesOrDefault(java.lang.String key, long defaultValue) { java.util.Map map = internalGetValues().getMap(); return map.containsKey(key) ? map.get(key) : defaultValue; } + /** * * @@ -2060,9 +2190,11 @@ public long getValuesOrThrow(java.lang.String key) { } public Builder clearValues() { + bitField0_ = (bitField0_ & ~0x00000100); internalGetMutableValues().getMutableMap().clear(); return this; } + /** * * @@ -2081,11 +2213,14 @@ public Builder removeValues(java.lang.String key) { internalGetMutableValues().getMutableMap().remove(key); return this; } + /** Use alternate mutation accessors instead. */ @java.lang.Deprecated public java.util.Map getMutableValues() { + bitField0_ |= 0x00000100; return internalGetMutableValues().getMutableMap(); } + /** * * @@ -2103,8 +2238,10 @@ public Builder putValues(java.lang.String key, long value) { } internalGetMutableValues().getMutableMap().put(key, value); + bitField0_ |= 0x00000100; return this; } + /** * * @@ -2118,10 +2255,12 @@ public Builder putValues(java.lang.String key, long value) { */ public Builder putAllValues(java.util.Map values) { internalGetMutableValues().getMutableMap().putAll(values); + bitField0_ |= 0x00000100; return this; } private java.lang.Object displayName_ = ""; + /** * * @@ -2147,6 +2286,7 @@ public java.lang.String getDisplayName() { return (java.lang.String) ref; } } + /** * * @@ -2172,6 +2312,7 @@ public com.google.protobuf.ByteString getDisplayNameBytes() { return (com.google.protobuf.ByteString) ref; } } + /** * * @@ -2191,11 +2332,12 @@ public Builder setDisplayName(java.lang.String value) { if (value == null) { throw new NullPointerException(); } - displayName_ = value; + bitField0_ |= 0x00000200; onChanged(); return this; } + /** * * @@ -2211,11 +2353,12 @@ public Builder setDisplayName(java.lang.String value) { * @return This builder for chaining. */ public Builder clearDisplayName() { - displayName_ = getDefaultInstance().getDisplayName(); + bitField0_ = (bitField0_ & ~0x00000200); onChanged(); return this; } + /** * * @@ -2236,23 +2379,12 @@ public Builder setDisplayNameBytes(com.google.protobuf.ByteString value) { throw new NullPointerException(); } checkByteStringIsUtf8(value); - displayName_ = value; + bitField0_ |= 0x00000200; onChanged(); return this; } - @java.lang.Override - public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - // @@protoc_insertion_point(builder_scope:google.api.QuotaLimit) } diff --git a/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/QuotaLimitOrBuilder.java b/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/QuotaLimitOrBuilder.java index 5f0a4d43db..11d9fe6939 100644 --- a/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/QuotaLimitOrBuilder.java +++ b/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/QuotaLimitOrBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,10 +14,13 @@ * limitations under the License. */ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: google/api/quota.proto +// Protobuf Java Version: 4.33.2 package com.google.api; +@com.google.protobuf.Generated public interface QuotaLimitOrBuilder extends // @@protoc_insertion_point(interface_extends:google.api.QuotaLimit) @@ -28,8 +31,10 @@ public interface QuotaLimitOrBuilder * *
            * Name of the quota limit.
        +   *
            * The name must be provided, and it must be unique within the service. The
            * name can only include alphanumeric characters as well as '-'.
        +   *
            * The maximum length of the limit name is 64 characters.
            * 
        * @@ -38,13 +43,16 @@ public interface QuotaLimitOrBuilder * @return The name. */ java.lang.String getName(); + /** * * *
            * Name of the quota limit.
        +   *
            * The name must be provided, and it must be unique within the service. The
            * name can only include alphanumeric characters as well as '-'.
        +   *
            * The maximum length of the limit name is 64 characters.
            * 
        * @@ -68,6 +76,7 @@ public interface QuotaLimitOrBuilder * @return The description. */ java.lang.String getDescription(); + /** * * @@ -90,10 +99,12 @@ public interface QuotaLimitOrBuilder * Default number of tokens that can be consumed during the specified * duration. This is the number of tokens assigned when a client * application developer activates the service for his/her project. + * * Specifying a value of 0 will block all requests. This can be used if you * are provisioning quota to selected consumers and blocking others. * Similarly, a value of -1 will indicate an unlimited quota. No other * negative values are allowed. + * * Used by group-based quotas only. * * @@ -111,8 +122,10 @@ public interface QuotaLimitOrBuilder * duration. Client application developers can override the default limit up * to this maximum. If specified, this value cannot be set to a value less * than the default limit. If not specified, it is set to the default limit. + * * To allow clients to apply overrides with no upper bound, set this to -1, * indicating unlimited maximum quota. + * * Used by group-based quotas only. * * @@ -132,6 +145,7 @@ public interface QuotaLimitOrBuilder * This field can only be set on a limit with duration "1d", in a billable * group; it is invalid on any other limit. If this field is not set, it * defaults to 0, indicating that there is no free tier for this service. + * * Used by group-based quotas only. * * @@ -146,6 +160,7 @@ public interface QuotaLimitOrBuilder * *
            * Duration of this limit in textual notation. Must be "100s" or "1d".
        +   *
            * Used by group-based quotas only.
            * 
        * @@ -154,11 +169,13 @@ public interface QuotaLimitOrBuilder * @return The duration. */ java.lang.String getDuration(); + /** * * *
            * Duration of this limit in textual notation. Must be "100s" or "1d".
        +   *
            * Used by group-based quotas only.
            * 
        * @@ -182,6 +199,7 @@ public interface QuotaLimitOrBuilder * @return The metric. */ java.lang.String getMetric(); + /** * * @@ -202,10 +220,12 @@ public interface QuotaLimitOrBuilder * *
            * Specify the unit of the quota limit. It uses the same syntax as
        -   * [Metric.unit][]. The supported unit kinds are determined by the quota
        -   * backend system.
        +   * [MetricDescriptor.unit][google.api.MetricDescriptor.unit]. The supported
        +   * unit kinds are determined by the quota backend system.
        +   *
            * Here are some examples:
            * * "1/min/{project}" for quota per minute per project.
        +   *
            * Note: the order of unit components is insignificant.
            * The "1" at the beginning is required to follow the metric unit syntax.
            * 
        @@ -215,15 +235,18 @@ public interface QuotaLimitOrBuilder * @return The unit. */ java.lang.String getUnit(); + /** * * *
            * Specify the unit of the quota limit. It uses the same syntax as
        -   * [Metric.unit][]. The supported unit kinds are determined by the quota
        -   * backend system.
        +   * [MetricDescriptor.unit][google.api.MetricDescriptor.unit]. The supported
        +   * unit kinds are determined by the quota backend system.
        +   *
            * Here are some examples:
            * * "1/min/{project}" for quota per minute per project.
        +   *
            * Note: the order of unit components is insignificant.
            * The "1" at the beginning is required to follow the metric unit syntax.
            * 
        @@ -246,6 +269,7 @@ public interface QuotaLimitOrBuilder * map<string, int64> values = 10; */ int getValuesCount(); + /** * * @@ -258,9 +282,11 @@ public interface QuotaLimitOrBuilder * map<string, int64> values = 10; */ boolean containsValues(java.lang.String key); + /** Use {@link #getValuesMap()} instead. */ @java.lang.Deprecated java.util.Map getValues(); + /** * * @@ -273,6 +299,7 @@ public interface QuotaLimitOrBuilder * map<string, int64> values = 10; */ java.util.Map getValuesMap(); + /** * * @@ -285,6 +312,7 @@ public interface QuotaLimitOrBuilder * map<string, int64> values = 10; */ long getValuesOrDefault(java.lang.String key, long defaultValue); + /** * * @@ -313,6 +341,7 @@ public interface QuotaLimitOrBuilder * @return The displayName. */ java.lang.String getDisplayName(); + /** * * diff --git a/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/QuotaOrBuilder.java b/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/QuotaOrBuilder.java index e54a0c5fd3..cfe92c8ba7 100644 --- a/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/QuotaOrBuilder.java +++ b/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/QuotaOrBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,10 +14,13 @@ * limitations under the License. */ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: google/api/quota.proto +// Protobuf Java Version: 4.33.2 package com.google.api; +@com.google.protobuf.Generated public interface QuotaOrBuilder extends // @@protoc_insertion_point(interface_extends:google.api.Quota) @@ -33,6 +36,7 @@ public interface QuotaOrBuilder * repeated .google.api.QuotaLimit limits = 3; */ java.util.List getLimitsList(); + /** * * @@ -43,6 +47,7 @@ public interface QuotaOrBuilder * repeated .google.api.QuotaLimit limits = 3; */ com.google.api.QuotaLimit getLimits(int index); + /** * * @@ -53,6 +58,7 @@ public interface QuotaOrBuilder * repeated .google.api.QuotaLimit limits = 3; */ int getLimitsCount(); + /** * * @@ -63,6 +69,7 @@ public interface QuotaOrBuilder * repeated .google.api.QuotaLimit limits = 3; */ java.util.List getLimitsOrBuilderList(); + /** * * @@ -85,6 +92,7 @@ public interface QuotaOrBuilder * repeated .google.api.MetricRule metric_rules = 4; */ java.util.List getMetricRulesList(); + /** * * @@ -96,6 +104,7 @@ public interface QuotaOrBuilder * repeated .google.api.MetricRule metric_rules = 4; */ com.google.api.MetricRule getMetricRules(int index); + /** * * @@ -107,6 +116,7 @@ public interface QuotaOrBuilder * repeated .google.api.MetricRule metric_rules = 4; */ int getMetricRulesCount(); + /** * * @@ -118,6 +128,7 @@ public interface QuotaOrBuilder * repeated .google.api.MetricRule metric_rules = 4; */ java.util.List getMetricRulesOrBuilderList(); + /** * * diff --git a/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/QuotaProto.java b/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/QuotaProto.java index 33c663c8ef..54cddc241f 100644 --- a/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/QuotaProto.java +++ b/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/QuotaProto.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,13 +14,26 @@ * limitations under the License. */ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: google/api/quota.proto +// Protobuf Java Version: 4.33.2 package com.google.api; -public final class QuotaProto { +@com.google.protobuf.Generated +public final class QuotaProto extends com.google.protobuf.GeneratedFile { private QuotaProto() {} + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "QuotaProto"); + } + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistryLite registry) {} public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry registry) { @@ -29,23 +42,23 @@ public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry r static final com.google.protobuf.Descriptors.Descriptor internal_static_google_api_Quota_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable internal_static_google_api_Quota_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_google_api_MetricRule_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable internal_static_google_api_MetricRule_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_google_api_MetricRule_MetricCostsEntry_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable internal_static_google_api_MetricRule_MetricCostsEntry_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_google_api_QuotaLimit_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable internal_static_google_api_QuotaLimit_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_google_api_QuotaLimit_ValuesEntry_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable internal_static_google_api_QuotaLimit_ValuesEntry_fieldAccessorTable; public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { @@ -56,52 +69,65 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { static { java.lang.String[] descriptorData = { - "\n\026google/api/quota.proto\022\ngoogle.api\"]\n\005" - + "Quota\022&\n\006limits\030\003 \003(\0132\026.google.api.Quota" - + "Limit\022,\n\014metric_rules\030\004 \003(\0132\026.google.api" - + ".MetricRule\"\221\001\n\nMetricRule\022\020\n\010selector\030\001" - + " \001(\t\022=\n\014metric_costs\030\002 \003(\0132\'.google.api." - + "MetricRule.MetricCostsEntry\0322\n\020MetricCos" - + "tsEntry\022\013\n\003key\030\001 \001(\t\022\r\n\005value\030\002 \001(\003:\0028\001\"" - + "\225\002\n\nQuotaLimit\022\014\n\004name\030\006 \001(\t\022\023\n\013descript" - + "ion\030\002 \001(\t\022\025\n\rdefault_limit\030\003 \001(\003\022\021\n\tmax_" - + "limit\030\004 \001(\003\022\021\n\tfree_tier\030\007 \001(\003\022\020\n\010durati" - + "on\030\005 \001(\t\022\016\n\006metric\030\010 \001(\t\022\014\n\004unit\030\t \001(\t\0222" - + "\n\006values\030\n \003(\0132\".google.api.QuotaLimit.V" - + "aluesEntry\022\024\n\014display_name\030\014 \001(\t\032-\n\013Valu" - + "esEntry\022\013\n\003key\030\001 \001(\t\022\r\n\005value\030\002 \001(\003:\0028\001B" - + "l\n\016com.google.apiB\nQuotaProtoP\001ZEgoogle." - + "golang.org/genproto/googleapis/api/servi" + "\n" + + "\026google/api/quota.proto\022\n" + + "google.api\"]\n" + + "\005Quota\022&\n" + + "\006limits\030\003 \003(\0132\026.google.api.QuotaLimit\022,\n" + + "\014metric_rules\030\004 \003(\0132\026.google.api.MetricRule\"\221\001\n\n" + + "MetricRule\022\020\n" + + "\010selector\030\001 \001(\t\022=\n" + + "\014metric_costs\030\002 \003(\0132\'.google.api.MetricRule.MetricCostsEntry\0322\n" + + "\020MetricCostsEntry\022\013\n" + + "\003key\030\001 \001(\t\022\r\n" + + "\005value\030\002 \001(\003:\0028\001\"\225\002\n\n" + + "QuotaLimit\022\014\n" + + "\004name\030\006 \001(\t\022\023\n" + + "\013description\030\002 \001(\t\022\025\n\r" + + "default_limit\030\003 \001(\003\022\021\n" + + "\tmax_limit\030\004 \001(\003\022\021\n" + + "\tfree_tier\030\007 \001(\003\022\020\n" + + "\010duration\030\005 \001(\t\022\016\n" + + "\006metric\030\010 \001(\t\022\014\n" + + "\004unit\030\t \001(\t\0222\n" + + "\006values\030\n" + + " \003(\0132\".google.api.QuotaLimit.ValuesEntry\022\024\n" + + "\014display_name\030\014 \001(\t\032-\n" + + "\013ValuesEntry\022\013\n" + + "\003key\030\001 \001(\t\022\r\n" + + "\005value\030\002 \001(\003:\0028\001Bl\n" + + "\016com.google.apiB\n" + + "QuotaProtoP\001ZEgoogle.golang.org/genproto/googleapis/api/servi" + "ceconfig;serviceconfig\242\002\004GAPIb\006proto3" }; descriptor = com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( descriptorData, new com.google.protobuf.Descriptors.FileDescriptor[] {}); - internal_static_google_api_Quota_descriptor = getDescriptor().getMessageTypes().get(0); + internal_static_google_api_Quota_descriptor = getDescriptor().getMessageType(0); internal_static_google_api_Quota_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_google_api_Quota_descriptor, new java.lang.String[] { "Limits", "MetricRules", }); - internal_static_google_api_MetricRule_descriptor = getDescriptor().getMessageTypes().get(1); + internal_static_google_api_MetricRule_descriptor = getDescriptor().getMessageType(1); internal_static_google_api_MetricRule_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_google_api_MetricRule_descriptor, new java.lang.String[] { "Selector", "MetricCosts", }); internal_static_google_api_MetricRule_MetricCostsEntry_descriptor = - internal_static_google_api_MetricRule_descriptor.getNestedTypes().get(0); + internal_static_google_api_MetricRule_descriptor.getNestedType(0); internal_static_google_api_MetricRule_MetricCostsEntry_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_google_api_MetricRule_MetricCostsEntry_descriptor, new java.lang.String[] { "Key", "Value", }); - internal_static_google_api_QuotaLimit_descriptor = getDescriptor().getMessageTypes().get(2); + internal_static_google_api_QuotaLimit_descriptor = getDescriptor().getMessageType(2); internal_static_google_api_QuotaLimit_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_google_api_QuotaLimit_descriptor, new java.lang.String[] { "Name", @@ -116,13 +142,14 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "DisplayName", }); internal_static_google_api_QuotaLimit_ValuesEntry_descriptor = - internal_static_google_api_QuotaLimit_descriptor.getNestedTypes().get(0); + internal_static_google_api_QuotaLimit_descriptor.getNestedType(0); internal_static_google_api_QuotaLimit_ValuesEntry_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_google_api_QuotaLimit_ValuesEntry_descriptor, new java.lang.String[] { "Key", "Value", }); + descriptor.resolveAllFeaturesImmutable(); } // @@protoc_insertion_point(outer_class_scope) diff --git a/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/ResourceDescriptor.java b/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/ResourceDescriptor.java index 8c1653283f..9016891445 100644 --- a/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/ResourceDescriptor.java +++ b/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/ResourceDescriptor.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,9 @@ * limitations under the License. */ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: google/api/resource.proto +// Protobuf Java Version: 4.33.2 package com.google.api; @@ -23,75 +25,86 @@ * *
          * A simple descriptor of a resource type.
        + *
          * ResourceDescriptor annotates a resource message (either by means of a
          * protobuf annotation or use in the service config), and associates the
          * resource's schema, the resource type, and the pattern of the resource name.
        + *
          * Example:
        - *     message Topic {
        - *       // Indicates this message defines a resource schema.
        - *       // Declares the resource type in the format of {service}/{kind}.
        - *       // For Kubernetes resources, the format is {api group}/{kind}.
        - *       option (google.api.resource) = {
        - *         type: "pubsub.googleapis.com/Topic"
        - *         pattern: "projects/{project}/topics/{topic}"
        - *       };
        - *     }
        + *
        + * message Topic {
        + * // Indicates this message defines a resource schema.
        + * // Declares the resource type in the format of {service}/{kind}.
        + * // For Kubernetes resources, the format is {api group}/{kind}.
        + * option (google.api.resource) = {
        + * type: "pubsub.googleapis.com/Topic"
        + * pattern: "projects/{project}/topics/{topic}"
        + * };
        + * }
        + *
          * The ResourceDescriptor Yaml config will look like:
        - *     resources:
        - *     - type: "pubsub.googleapis.com/Topic"
        - *       pattern: "projects/{project}/topics/{topic}"
        + *
        + * resources:
        + * - type: "pubsub.googleapis.com/Topic"
        + * pattern: "projects/{project}/topics/{topic}"
        + *
          * Sometimes, resources have multiple patterns, typically because they can
          * live under multiple parents.
        + *
          * Example:
        - *     message LogEntry {
        - *       option (google.api.resource) = {
        - *         type: "logging.googleapis.com/LogEntry"
        - *         pattern: "projects/{project}/logs/{log}"
        - *         pattern: "folders/{folder}/logs/{log}"
        - *         pattern: "organizations/{organization}/logs/{log}"
        - *         pattern: "billingAccounts/{billing_account}/logs/{log}"
        - *       };
        - *     }
        + *
        + * message LogEntry {
        + * option (google.api.resource) = {
        + * type: "logging.googleapis.com/LogEntry"
        + * pattern: "projects/{project}/logs/{log}"
        + * pattern: "folders/{folder}/logs/{log}"
        + * pattern: "organizations/{organization}/logs/{log}"
        + * pattern: "billingAccounts/{billing_account}/logs/{log}"
        + * };
        + * }
        + *
          * The ResourceDescriptor Yaml config will look like:
        - *     resources:
        - *     - type: 'logging.googleapis.com/LogEntry'
        - *       pattern: "projects/{project}/logs/{log}"
        - *       pattern: "folders/{folder}/logs/{log}"
        - *       pattern: "organizations/{organization}/logs/{log}"
        - *       pattern: "billingAccounts/{billing_account}/logs/{log}"
        + *
        + * resources:
        + * - type: 'logging.googleapis.com/LogEntry'
        + * pattern: "projects/{project}/logs/{log}"
        + * pattern: "folders/{folder}/logs/{log}"
        + * pattern: "organizations/{organization}/logs/{log}"
        + * pattern: "billingAccounts/{billing_account}/logs/{log}"
          * 
        * * Protobuf type {@code google.api.ResourceDescriptor} */ -public final class ResourceDescriptor extends com.google.protobuf.GeneratedMessageV3 +@com.google.protobuf.Generated +public final class ResourceDescriptor extends com.google.protobuf.GeneratedMessage implements // @@protoc_insertion_point(message_implements:google.api.ResourceDescriptor) ResourceDescriptorOrBuilder { private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "ResourceDescriptor"); + } + // Use ResourceDescriptor.newBuilder() to construct. - private ResourceDescriptor(com.google.protobuf.GeneratedMessageV3.Builder builder) { + private ResourceDescriptor(com.google.protobuf.GeneratedMessage.Builder builder) { super(builder); } private ResourceDescriptor() { type_ = ""; - pattern_ = com.google.protobuf.LazyStringArrayList.EMPTY; + pattern_ = com.google.protobuf.LazyStringArrayList.emptyList(); nameField_ = ""; history_ = 0; plural_ = ""; singular_ = ""; - style_ = java.util.Collections.emptyList(); - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new ResourceDescriptor(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; + style_ = emptyIntList(); } public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { @@ -99,7 +112,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.api.ResourceProto .internal_static_google_api_ResourceDescriptor_fieldAccessorTable @@ -155,6 +168,16 @@ public enum History implements com.google.protobuf.ProtocolMessageEnum { UNRECOGNIZED(-1), ; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "History"); + } + /** * * @@ -165,6 +188,7 @@ public enum History implements com.google.protobuf.ProtocolMessageEnum { * HISTORY_UNSPECIFIED = 0; */ public static final int HISTORY_UNSPECIFIED_VALUE = 0; + /** * * @@ -176,6 +200,7 @@ public enum History implements com.google.protobuf.ProtocolMessageEnum { * ORIGINALLY_SINGLE_PATTERN = 1; */ public static final int ORIGINALLY_SINGLE_PATTERN_VALUE = 1; + /** * * @@ -247,7 +272,7 @@ public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType return getDescriptor(); } - public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + public static com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { return com.google.api.ResourceDescriptor.getDescriptor().getEnumTypes().get(0); } @@ -297,9 +322,11 @@ public enum Style implements com.google.protobuf.ProtocolMessageEnum { * *
              * This resource is intended to be "declarative-friendly".
        +     *
              * Declarative-friendly resources must be more strictly consistent, and
              * setting this to true communicates to tools that this resource should
              * adhere to declarative-friendly expectations.
        +     *
              * Note: This is used by the API linter (linter.aip.dev) to enable
              * additional checks.
              * 
        @@ -310,6 +337,16 @@ public enum Style implements com.google.protobuf.ProtocolMessageEnum { UNRECOGNIZED(-1), ; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "Style"); + } + /** * * @@ -320,14 +357,17 @@ public enum Style implements com.google.protobuf.ProtocolMessageEnum { * STYLE_UNSPECIFIED = 0; */ public static final int STYLE_UNSPECIFIED_VALUE = 0; + /** * * *
              * This resource is intended to be "declarative-friendly".
        +     *
              * Declarative-friendly resources must be more strictly consistent, and
              * setting this to true communicates to tools that this resource should
              * adhere to declarative-friendly expectations.
        +     *
              * Note: This is used by the API linter (linter.aip.dev) to enable
              * additional checks.
              * 
        @@ -392,7 +432,7 @@ public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType return getDescriptor(); } - public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + public static com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { return com.google.api.ResourceDescriptor.getDescriptor().getEnumTypes().get(1); } @@ -418,7 +458,10 @@ private Style(int value) { } public static final int TYPE_FIELD_NUMBER = 1; - private volatile java.lang.Object type_; + + @SuppressWarnings("serial") + private volatile java.lang.Object type_ = ""; + /** * * @@ -426,7 +469,9 @@ private Style(int value) { * The resource type. It must be in the format of * {service_name}/{resource_type_kind}. The `resource_type_kind` must be * singular and must not include version numbers. + * * Example: `storage.googleapis.com/Bucket` + * * The value of the resource_type_kind must follow the regular expression * /[A-Za-z][a-zA-Z0-9]+/. It should start with an upper case character and * should use PascalCase (UpperCamelCase). The maximum number of @@ -449,6 +494,7 @@ public java.lang.String getType() { return s; } } + /** * * @@ -456,7 +502,9 @@ public java.lang.String getType() { * The resource type. It must be in the format of * {service_name}/{resource_type_kind}. The `resource_type_kind` must be * singular and must not include version numbers. + * * Example: `storage.googleapis.com/Bucket` + * * The value of the resource_type_kind must follow the regular expression * /[A-Za-z][a-zA-Z0-9]+/. It should start with an upper case character and * should use PascalCase (UpperCamelCase). The maximum number of @@ -481,21 +529,30 @@ public com.google.protobuf.ByteString getTypeBytes() { } public static final int PATTERN_FIELD_NUMBER = 2; - private com.google.protobuf.LazyStringList pattern_; + + @SuppressWarnings("serial") + private com.google.protobuf.LazyStringArrayList pattern_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + /** * * *
            * Optional. The relative resource name pattern associated with this resource
            * type. The DNS prefix of the full resource name shouldn't be specified here.
        +   *
            * The path pattern must follow the syntax, which aligns with HTTP binding
            * syntax:
        -   *     Template = Segment { "/" Segment } ;
        -   *     Segment = LITERAL | Variable ;
        -   *     Variable = "{" LITERAL "}" ;
        +   *
        +   * Template = Segment { "/" Segment } ;
        +   * Segment = LITERAL | Variable ;
        +   * Variable = "{" LITERAL "}" ;
        +   *
            * Examples:
        -   *     - "projects/{project}/topics/{topic}"
        -   *     - "projects/{project}/knowledgeBases/{knowledge_base}"
        +   *
        +   * - "projects/{project}/topics/{topic}"
        +   * - "projects/{project}/knowledgeBases/{knowledge_base}"
        +   *
            * The components in braces correspond to the IDs for each resource in the
            * hierarchy. It is expected that, if multiple patterns are provided,
            * the same component name (e.g. "project") refers to IDs of the same
        @@ -509,20 +566,26 @@ public com.google.protobuf.ByteString getTypeBytes() {
           public com.google.protobuf.ProtocolStringList getPatternList() {
             return pattern_;
           }
        +
           /**
            *
            *
            * 
            * Optional. The relative resource name pattern associated with this resource
            * type. The DNS prefix of the full resource name shouldn't be specified here.
        +   *
            * The path pattern must follow the syntax, which aligns with HTTP binding
            * syntax:
        -   *     Template = Segment { "/" Segment } ;
        -   *     Segment = LITERAL | Variable ;
        -   *     Variable = "{" LITERAL "}" ;
        +   *
        +   * Template = Segment { "/" Segment } ;
        +   * Segment = LITERAL | Variable ;
        +   * Variable = "{" LITERAL "}" ;
        +   *
            * Examples:
        -   *     - "projects/{project}/topics/{topic}"
        -   *     - "projects/{project}/knowledgeBases/{knowledge_base}"
        +   *
        +   * - "projects/{project}/topics/{topic}"
        +   * - "projects/{project}/knowledgeBases/{knowledge_base}"
        +   *
            * The components in braces correspond to the IDs for each resource in the
            * hierarchy. It is expected that, if multiple patterns are provided,
            * the same component name (e.g. "project") refers to IDs of the same
        @@ -536,20 +599,26 @@ public com.google.protobuf.ProtocolStringList getPatternList() {
           public int getPatternCount() {
             return pattern_.size();
           }
        +
           /**
            *
            *
            * 
            * Optional. The relative resource name pattern associated with this resource
            * type. The DNS prefix of the full resource name shouldn't be specified here.
        +   *
            * The path pattern must follow the syntax, which aligns with HTTP binding
            * syntax:
        -   *     Template = Segment { "/" Segment } ;
        -   *     Segment = LITERAL | Variable ;
        -   *     Variable = "{" LITERAL "}" ;
        +   *
        +   * Template = Segment { "/" Segment } ;
        +   * Segment = LITERAL | Variable ;
        +   * Variable = "{" LITERAL "}" ;
        +   *
            * Examples:
        -   *     - "projects/{project}/topics/{topic}"
        -   *     - "projects/{project}/knowledgeBases/{knowledge_base}"
        +   *
        +   * - "projects/{project}/topics/{topic}"
        +   * - "projects/{project}/knowledgeBases/{knowledge_base}"
        +   *
            * The components in braces correspond to the IDs for each resource in the
            * hierarchy. It is expected that, if multiple patterns are provided,
            * the same component name (e.g. "project") refers to IDs of the same
        @@ -564,20 +633,26 @@ public int getPatternCount() {
           public java.lang.String getPattern(int index) {
             return pattern_.get(index);
           }
        +
           /**
            *
            *
            * 
            * Optional. The relative resource name pattern associated with this resource
            * type. The DNS prefix of the full resource name shouldn't be specified here.
        +   *
            * The path pattern must follow the syntax, which aligns with HTTP binding
            * syntax:
        -   *     Template = Segment { "/" Segment } ;
        -   *     Segment = LITERAL | Variable ;
        -   *     Variable = "{" LITERAL "}" ;
        +   *
        +   * Template = Segment { "/" Segment } ;
        +   * Segment = LITERAL | Variable ;
        +   * Variable = "{" LITERAL "}" ;
        +   *
            * Examples:
        -   *     - "projects/{project}/topics/{topic}"
        -   *     - "projects/{project}/knowledgeBases/{knowledge_base}"
        +   *
        +   * - "projects/{project}/topics/{topic}"
        +   * - "projects/{project}/knowledgeBases/{knowledge_base}"
        +   *
            * The components in braces correspond to the IDs for each resource in the
            * hierarchy. It is expected that, if multiple patterns are provided,
            * the same component name (e.g. "project") refers to IDs of the same
        @@ -594,7 +669,10 @@ public com.google.protobuf.ByteString getPatternBytes(int index) {
           }
         
           public static final int NAME_FIELD_FIELD_NUMBER = 3;
        -  private volatile java.lang.Object nameField_;
        +
        +  @SuppressWarnings("serial")
        +  private volatile java.lang.Object nameField_ = "";
        +
           /**
            *
            *
        @@ -619,6 +697,7 @@ public java.lang.String getNameField() {
               return s;
             }
           }
        +
           /**
            *
            *
        @@ -645,24 +724,27 @@ public com.google.protobuf.ByteString getNameFieldBytes() {
           }
         
           public static final int HISTORY_FIELD_NUMBER = 4;
        -  private int history_;
        +  private int history_ = 0;
        +
           /**
            *
            *
            * 
            * Optional. The historical or future-looking state of the resource pattern.
        +   *
            * Example:
        -   *     // The InspectTemplate message originally only supported resource
        -   *     // names with organization, and project was added later.
        -   *     message InspectTemplate {
        -   *       option (google.api.resource) = {
        -   *         type: "dlp.googleapis.com/InspectTemplate"
        -   *         pattern:
        -   *         "organizations/{organization}/inspectTemplates/{inspect_template}"
        -   *         pattern: "projects/{project}/inspectTemplates/{inspect_template}"
        -   *         history: ORIGINALLY_SINGLE_PATTERN
        -   *       };
        -   *     }
        +   *
        +   * // The InspectTemplate message originally only supported resource
        +   * // names with organization, and project was added later.
        +   * message InspectTemplate {
        +   * option (google.api.resource) = {
        +   * type: "dlp.googleapis.com/InspectTemplate"
        +   * pattern:
        +   * "organizations/{organization}/inspectTemplates/{inspect_template}"
        +   * pattern: "projects/{project}/inspectTemplates/{inspect_template}"
        +   * history: ORIGINALLY_SINGLE_PATTERN
        +   * };
        +   * }
            * 
        * * .google.api.ResourceDescriptor.History history = 4; @@ -673,23 +755,26 @@ public com.google.protobuf.ByteString getNameFieldBytes() { public int getHistoryValue() { return history_; } + /** * * *
            * Optional. The historical or future-looking state of the resource pattern.
        +   *
            * Example:
        -   *     // The InspectTemplate message originally only supported resource
        -   *     // names with organization, and project was added later.
        -   *     message InspectTemplate {
        -   *       option (google.api.resource) = {
        -   *         type: "dlp.googleapis.com/InspectTemplate"
        -   *         pattern:
        -   *         "organizations/{organization}/inspectTemplates/{inspect_template}"
        -   *         pattern: "projects/{project}/inspectTemplates/{inspect_template}"
        -   *         history: ORIGINALLY_SINGLE_PATTERN
        -   *       };
        -   *     }
        +   *
        +   * // The InspectTemplate message originally only supported resource
        +   * // names with organization, and project was added later.
        +   * message InspectTemplate {
        +   * option (google.api.resource) = {
        +   * type: "dlp.googleapis.com/InspectTemplate"
        +   * pattern:
        +   * "organizations/{organization}/inspectTemplates/{inspect_template}"
        +   * pattern: "projects/{project}/inspectTemplates/{inspect_template}"
        +   * history: ORIGINALLY_SINGLE_PATTERN
        +   * };
        +   * }
            * 
        * * .google.api.ResourceDescriptor.History history = 4; @@ -698,23 +783,31 @@ public int getHistoryValue() { */ @java.lang.Override public com.google.api.ResourceDescriptor.History getHistory() { - @SuppressWarnings("deprecation") com.google.api.ResourceDescriptor.History result = - com.google.api.ResourceDescriptor.History.valueOf(history_); + com.google.api.ResourceDescriptor.History.forNumber(history_); return result == null ? com.google.api.ResourceDescriptor.History.UNRECOGNIZED : result; } public static final int PLURAL_FIELD_NUMBER = 5; - private volatile java.lang.Object plural_; + + @SuppressWarnings("serial") + private volatile java.lang.Object plural_ = ""; + /** * * *
            * The plural name used in the resource name and permission names, such as
            * 'projects' for the resource name of 'projects/{project}' and the permission
        -   * name of 'cloudresourcemanager.googleapis.com/projects.get'. It is the same
        -   * concept of the `plural` field in k8s CRD spec
        +   * name of 'cloudresourcemanager.googleapis.com/projects.get'. One exception
        +   * to this is for Nested Collections that have stuttering names, as defined
        +   * in [AIP-122](https://google.aip.dev/122#nested-collections), where the
        +   * collection ID in the resource name pattern does not necessarily directly
        +   * match the `plural` value.
        +   *
        +   * It is the same concept of the `plural` field in k8s CRD spec
            * https://kubernetes.io/docs/tasks/access-kubernetes-api/custom-resources/custom-resource-definitions/
        +   *
            * Note: The plural form is required even for singleton resources. See
            * https://aip.dev/156
            * 
        @@ -735,15 +828,22 @@ public java.lang.String getPlural() { return s; } } + /** * * *
            * The plural name used in the resource name and permission names, such as
            * 'projects' for the resource name of 'projects/{project}' and the permission
        -   * name of 'cloudresourcemanager.googleapis.com/projects.get'. It is the same
        -   * concept of the `plural` field in k8s CRD spec
        +   * name of 'cloudresourcemanager.googleapis.com/projects.get'. One exception
        +   * to this is for Nested Collections that have stuttering names, as defined
        +   * in [AIP-122](https://google.aip.dev/122#nested-collections), where the
        +   * collection ID in the resource name pattern does not necessarily directly
        +   * match the `plural` value.
        +   *
        +   * It is the same concept of the `plural` field in k8s CRD spec
            * https://kubernetes.io/docs/tasks/access-kubernetes-api/custom-resources/custom-resource-definitions/
        +   *
            * Note: The plural form is required even for singleton resources. See
            * https://aip.dev/156
            * 
        @@ -766,7 +866,10 @@ public com.google.protobuf.ByteString getPluralBytes() { } public static final int SINGULAR_FIELD_NUMBER = 6; - private volatile java.lang.Object singular_; + + @SuppressWarnings("serial") + private volatile java.lang.Object singular_ = ""; + /** * * @@ -792,6 +895,7 @@ public java.lang.String getSingular() { return s; } } + /** * * @@ -819,19 +923,22 @@ public com.google.protobuf.ByteString getSingularBytes() { } public static final int STYLE_FIELD_NUMBER = 10; - private java.util.List style_; - private static final com.google.protobuf.Internal.ListAdapter.Converter< - java.lang.Integer, com.google.api.ResourceDescriptor.Style> + + @SuppressWarnings("serial") + private com.google.protobuf.Internal.IntList style_ = emptyIntList(); + + private static final com.google.protobuf.Internal.IntListAdapter.IntConverter< + com.google.api.ResourceDescriptor.Style> style_converter_ = - new com.google.protobuf.Internal.ListAdapter.Converter< - java.lang.Integer, com.google.api.ResourceDescriptor.Style>() { - public com.google.api.ResourceDescriptor.Style convert(java.lang.Integer from) { - @SuppressWarnings("deprecation") + new com.google.protobuf.Internal.IntListAdapter.IntConverter< + com.google.api.ResourceDescriptor.Style>() { + public com.google.api.ResourceDescriptor.Style convert(int from) { com.google.api.ResourceDescriptor.Style result = - com.google.api.ResourceDescriptor.Style.valueOf(from); + com.google.api.ResourceDescriptor.Style.forNumber(from); return result == null ? com.google.api.ResourceDescriptor.Style.UNRECOGNIZED : result; } }; + /** * * @@ -847,9 +954,10 @@ public com.google.api.ResourceDescriptor.Style convert(java.lang.Integer from) { */ @java.lang.Override public java.util.List getStyleList() { - return new com.google.protobuf.Internal.ListAdapter< - java.lang.Integer, com.google.api.ResourceDescriptor.Style>(style_, style_converter_); + return new com.google.protobuf.Internal.IntListAdapter( + style_, style_converter_); } + /** * * @@ -867,6 +975,7 @@ public java.util.List getStyleList() { public int getStyleCount() { return style_.size(); } + /** * * @@ -883,8 +992,9 @@ public int getStyleCount() { */ @java.lang.Override public com.google.api.ResourceDescriptor.Style getStyle(int index) { - return style_converter_.convert(style_.get(index)); + return style_converter_.convert(style_.getInt(index)); } + /** * * @@ -902,6 +1012,7 @@ public com.google.api.ResourceDescriptor.Style getStyle(int index) { public java.util.List getStyleValueList() { return style_; } + /** * * @@ -918,7 +1029,7 @@ public java.util.List getStyleValueList() { */ @java.lang.Override public int getStyleValue(int index) { - return style_.get(index); + return style_.getInt(index); } private int styleMemoizedSerializedSize; @@ -938,30 +1049,30 @@ public final boolean isInitialized() { @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { getSerializedSize(); - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(type_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, type_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(type_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, type_); } for (int i = 0; i < pattern_.size(); i++) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 2, pattern_.getRaw(i)); + com.google.protobuf.GeneratedMessage.writeString(output, 2, pattern_.getRaw(i)); } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nameField_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 3, nameField_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(nameField_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 3, nameField_); } if (history_ != com.google.api.ResourceDescriptor.History.HISTORY_UNSPECIFIED.getNumber()) { output.writeEnum(4, history_); } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(plural_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 5, plural_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(plural_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 5, plural_); } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(singular_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 6, singular_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(singular_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 6, singular_); } if (getStyleList().size() > 0) { output.writeUInt32NoTag(82); output.writeUInt32NoTag(styleMemoizedSerializedSize); } for (int i = 0; i < style_.size(); i++) { - output.writeEnumNoTag(style_.get(i)); + output.writeEnumNoTag(style_.getInt(i)); } getUnknownFields().writeTo(output); } @@ -972,8 +1083,8 @@ public int getSerializedSize() { if (size != -1) return size; size = 0; - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(type_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, type_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(type_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, type_); } { int dataSize = 0; @@ -983,22 +1094,22 @@ public int getSerializedSize() { size += dataSize; size += 1 * getPatternList().size(); } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nameField_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, nameField_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(nameField_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(3, nameField_); } if (history_ != com.google.api.ResourceDescriptor.History.HISTORY_UNSPECIFIED.getNumber()) { size += com.google.protobuf.CodedOutputStream.computeEnumSize(4, history_); } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(plural_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, plural_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(plural_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(5, plural_); } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(singular_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(6, singular_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(singular_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(6, singular_); } { int dataSize = 0; for (int i = 0; i < style_.size(); i++) { - dataSize += com.google.protobuf.CodedOutputStream.computeEnumSizeNoTag(style_.get(i)); + dataSize += com.google.protobuf.CodedOutputStream.computeEnumSizeNoTag(style_.getInt(i)); } size += dataSize; if (!getStyleList().isEmpty()) { @@ -1099,38 +1210,38 @@ public static com.google.api.ResourceDescriptor parseFrom( public static com.google.api.ResourceDescriptor parseFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); } public static com.google.api.ResourceDescriptor parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } public static com.google.api.ResourceDescriptor parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); } public static com.google.api.ResourceDescriptor parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( PARSER, input, extensionRegistry); } public static com.google.api.ResourceDescriptor parseFrom( com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); } public static com.google.api.ResourceDescriptor parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } @@ -1153,56 +1264,67 @@ public Builder toBuilder() { } @java.lang.Override - protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { Builder builder = new Builder(parent); return builder; } + /** * * *
            * A simple descriptor of a resource type.
        +   *
            * ResourceDescriptor annotates a resource message (either by means of a
            * protobuf annotation or use in the service config), and associates the
            * resource's schema, the resource type, and the pattern of the resource name.
        +   *
            * Example:
        -   *     message Topic {
        -   *       // Indicates this message defines a resource schema.
        -   *       // Declares the resource type in the format of {service}/{kind}.
        -   *       // For Kubernetes resources, the format is {api group}/{kind}.
        -   *       option (google.api.resource) = {
        -   *         type: "pubsub.googleapis.com/Topic"
        -   *         pattern: "projects/{project}/topics/{topic}"
        -   *       };
        -   *     }
        +   *
        +   * message Topic {
        +   * // Indicates this message defines a resource schema.
        +   * // Declares the resource type in the format of {service}/{kind}.
        +   * // For Kubernetes resources, the format is {api group}/{kind}.
        +   * option (google.api.resource) = {
        +   * type: "pubsub.googleapis.com/Topic"
        +   * pattern: "projects/{project}/topics/{topic}"
        +   * };
        +   * }
        +   *
            * The ResourceDescriptor Yaml config will look like:
        -   *     resources:
        -   *     - type: "pubsub.googleapis.com/Topic"
        -   *       pattern: "projects/{project}/topics/{topic}"
        +   *
        +   * resources:
        +   * - type: "pubsub.googleapis.com/Topic"
        +   * pattern: "projects/{project}/topics/{topic}"
        +   *
            * Sometimes, resources have multiple patterns, typically because they can
            * live under multiple parents.
        +   *
            * Example:
        -   *     message LogEntry {
        -   *       option (google.api.resource) = {
        -   *         type: "logging.googleapis.com/LogEntry"
        -   *         pattern: "projects/{project}/logs/{log}"
        -   *         pattern: "folders/{folder}/logs/{log}"
        -   *         pattern: "organizations/{organization}/logs/{log}"
        -   *         pattern: "billingAccounts/{billing_account}/logs/{log}"
        -   *       };
        -   *     }
        +   *
        +   * message LogEntry {
        +   * option (google.api.resource) = {
        +   * type: "logging.googleapis.com/LogEntry"
        +   * pattern: "projects/{project}/logs/{log}"
        +   * pattern: "folders/{folder}/logs/{log}"
        +   * pattern: "organizations/{organization}/logs/{log}"
        +   * pattern: "billingAccounts/{billing_account}/logs/{log}"
        +   * };
        +   * }
        +   *
            * The ResourceDescriptor Yaml config will look like:
        -   *     resources:
        -   *     - type: 'logging.googleapis.com/LogEntry'
        -   *       pattern: "projects/{project}/logs/{log}"
        -   *       pattern: "folders/{folder}/logs/{log}"
        -   *       pattern: "organizations/{organization}/logs/{log}"
        -   *       pattern: "billingAccounts/{billing_account}/logs/{log}"
        +   *
        +   * resources:
        +   * - type: 'logging.googleapis.com/LogEntry'
        +   * pattern: "projects/{project}/logs/{log}"
        +   * pattern: "folders/{folder}/logs/{log}"
        +   * pattern: "organizations/{organization}/logs/{log}"
        +   * pattern: "billingAccounts/{billing_account}/logs/{log}"
            * 
        * * Protobuf type {@code google.api.ResourceDescriptor} */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder implements // @@protoc_insertion_point(builder_implements:google.api.ResourceDescriptor) com.google.api.ResourceDescriptorOrBuilder { @@ -1211,7 +1333,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.api.ResourceProto .internal_static_google_api_ResourceDescriptor_fieldAccessorTable @@ -1223,27 +1345,21 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { // Construct using com.google.api.ResourceDescriptor.newBuilder() private Builder() {} - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { super(parent); } @java.lang.Override public Builder clear() { super.clear(); + bitField0_ = 0; type_ = ""; - - pattern_ = com.google.protobuf.LazyStringArrayList.EMPTY; - bitField0_ = (bitField0_ & ~0x00000001); + pattern_ = com.google.protobuf.LazyStringArrayList.emptyList(); nameField_ = ""; - history_ = 0; - plural_ = ""; - singular_ = ""; - - style_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000002); + style_ = emptyIntList(); return this; } @@ -1269,57 +1385,38 @@ public com.google.api.ResourceDescriptor build() { @java.lang.Override public com.google.api.ResourceDescriptor buildPartial() { com.google.api.ResourceDescriptor result = new com.google.api.ResourceDescriptor(this); - int from_bitField0_ = bitField0_; - result.type_ = type_; - if (((bitField0_ & 0x00000001) != 0)) { - pattern_ = pattern_.getUnmodifiableView(); - bitField0_ = (bitField0_ & ~0x00000001); + if (bitField0_ != 0) { + buildPartial0(result); } - result.pattern_ = pattern_; - result.nameField_ = nameField_; - result.history_ = history_; - result.plural_ = plural_; - result.singular_ = singular_; - if (((bitField0_ & 0x00000002) != 0)) { - style_ = java.util.Collections.unmodifiableList(style_); - bitField0_ = (bitField0_ & ~0x00000002); - } - result.style_ = style_; 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); + private void buildPartial0(com.google.api.ResourceDescriptor result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.type_ = type_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + pattern_.makeImmutable(); + result.pattern_ = pattern_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.nameField_ = nameField_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.history_ = history_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.plural_ = plural_; + } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.singular_ = singular_; + } + if (((from_bitField0_ & 0x00000040) != 0)) { + style_.makeImmutable(); + result.style_ = style_; + } } @java.lang.Override @@ -1336,12 +1433,13 @@ public Builder mergeFrom(com.google.api.ResourceDescriptor other) { if (other == com.google.api.ResourceDescriptor.getDefaultInstance()) return this; if (!other.getType().isEmpty()) { type_ = other.type_; + bitField0_ |= 0x00000001; onChanged(); } if (!other.pattern_.isEmpty()) { if (pattern_.isEmpty()) { pattern_ = other.pattern_; - bitField0_ = (bitField0_ & ~0x00000001); + bitField0_ |= 0x00000002; } else { ensurePatternIsMutable(); pattern_.addAll(other.pattern_); @@ -1350,6 +1448,7 @@ public Builder mergeFrom(com.google.api.ResourceDescriptor other) { } if (!other.getNameField().isEmpty()) { nameField_ = other.nameField_; + bitField0_ |= 0x00000004; onChanged(); } if (other.history_ != 0) { @@ -1357,16 +1456,19 @@ public Builder mergeFrom(com.google.api.ResourceDescriptor other) { } if (!other.getPlural().isEmpty()) { plural_ = other.plural_; + bitField0_ |= 0x00000010; onChanged(); } if (!other.getSingular().isEmpty()) { singular_ = other.singular_; + bitField0_ |= 0x00000020; onChanged(); } if (!other.style_.isEmpty()) { if (style_.isEmpty()) { style_ = other.style_; - bitField0_ = (bitField0_ & ~0x00000002); + style_.makeImmutable(); + bitField0_ |= 0x00000040; } else { ensureStyleIsMutable(); style_.addAll(other.style_); @@ -1402,7 +1504,7 @@ public Builder mergeFrom( case 10: { type_ = input.readStringRequireUtf8(); - + bitField0_ |= 0x00000001; break; } // case 10 case 18: @@ -1415,44 +1517,43 @@ public Builder mergeFrom( case 26: { nameField_ = input.readStringRequireUtf8(); - + bitField0_ |= 0x00000004; break; } // case 26 case 32: { history_ = input.readEnum(); - + bitField0_ |= 0x00000008; break; } // case 32 case 42: { plural_ = input.readStringRequireUtf8(); - + bitField0_ |= 0x00000010; break; } // case 42 case 50: { singular_ = input.readStringRequireUtf8(); - + bitField0_ |= 0x00000020; break; } // case 50 case 80: { int tmpRaw = input.readEnum(); ensureStyleIsMutable(); - style_.add(tmpRaw); + style_.addInt(tmpRaw); break; } // case 80 case 82: { int length = input.readRawVarint32(); - int oldLimit = input.pushLimit(length); + int limit = input.pushLimit(length); + ensureStyleIsMutable(); while (input.getBytesUntilLimit() > 0) { - int tmpRaw = input.readEnum(); - ensureStyleIsMutable(); - style_.add(tmpRaw); + style_.addInt(input.readEnum()); } - input.popLimit(oldLimit); + input.popLimit(limit); break; } // case 82 default: @@ -1475,6 +1576,7 @@ public Builder mergeFrom( private int bitField0_; private java.lang.Object type_ = ""; + /** * * @@ -1482,7 +1584,9 @@ public Builder mergeFrom( * The resource type. It must be in the format of * {service_name}/{resource_type_kind}. The `resource_type_kind` must be * singular and must not include version numbers. + * * Example: `storage.googleapis.com/Bucket` + * * The value of the resource_type_kind must follow the regular expression * /[A-Za-z][a-zA-Z0-9]+/. It should start with an upper case character and * should use PascalCase (UpperCamelCase). The maximum number of @@ -1504,6 +1608,7 @@ public java.lang.String getType() { return (java.lang.String) ref; } } + /** * * @@ -1511,7 +1616,9 @@ public java.lang.String getType() { * The resource type. It must be in the format of * {service_name}/{resource_type_kind}. The `resource_type_kind` must be * singular and must not include version numbers. + * * Example: `storage.googleapis.com/Bucket` + * * The value of the resource_type_kind must follow the regular expression * /[A-Za-z][a-zA-Z0-9]+/. It should start with an upper case character and * should use PascalCase (UpperCamelCase). The maximum number of @@ -1533,6 +1640,7 @@ public com.google.protobuf.ByteString getTypeBytes() { return (com.google.protobuf.ByteString) ref; } } + /** * * @@ -1540,7 +1648,9 @@ public com.google.protobuf.ByteString getTypeBytes() { * The resource type. It must be in the format of * {service_name}/{resource_type_kind}. The `resource_type_kind` must be * singular and must not include version numbers. + * * Example: `storage.googleapis.com/Bucket` + * * The value of the resource_type_kind must follow the regular expression * /[A-Za-z][a-zA-Z0-9]+/. It should start with an upper case character and * should use PascalCase (UpperCamelCase). The maximum number of @@ -1556,11 +1666,12 @@ public Builder setType(java.lang.String value) { if (value == null) { throw new NullPointerException(); } - type_ = value; + bitField0_ |= 0x00000001; onChanged(); return this; } + /** * * @@ -1568,7 +1679,9 @@ public Builder setType(java.lang.String value) { * The resource type. It must be in the format of * {service_name}/{resource_type_kind}. The `resource_type_kind` must be * singular and must not include version numbers. + * * Example: `storage.googleapis.com/Bucket` + * * The value of the resource_type_kind must follow the regular expression * /[A-Za-z][a-zA-Z0-9]+/. It should start with an upper case character and * should use PascalCase (UpperCamelCase). The maximum number of @@ -1580,11 +1693,12 @@ public Builder setType(java.lang.String value) { * @return This builder for chaining. */ public Builder clearType() { - type_ = getDefaultInstance().getType(); + bitField0_ = (bitField0_ & ~0x00000001); onChanged(); return this; } + /** * * @@ -1592,7 +1706,9 @@ public Builder clearType() { * The resource type. It must be in the format of * {service_name}/{resource_type_kind}. The `resource_type_kind` must be * singular and must not include version numbers. + * * Example: `storage.googleapis.com/Bucket` + * * The value of the resource_type_kind must follow the regular expression * /[A-Za-z][a-zA-Z0-9]+/. It should start with an upper case character and * should use PascalCase (UpperCamelCase). The maximum number of @@ -1609,35 +1725,41 @@ public Builder setTypeBytes(com.google.protobuf.ByteString value) { throw new NullPointerException(); } checkByteStringIsUtf8(value); - type_ = value; + bitField0_ |= 0x00000001; onChanged(); return this; } - private com.google.protobuf.LazyStringList pattern_ = - com.google.protobuf.LazyStringArrayList.EMPTY; + private com.google.protobuf.LazyStringArrayList pattern_ = + com.google.protobuf.LazyStringArrayList.emptyList(); private void ensurePatternIsMutable() { - if (!((bitField0_ & 0x00000001) != 0)) { + if (!pattern_.isModifiable()) { pattern_ = new com.google.protobuf.LazyStringArrayList(pattern_); - bitField0_ |= 0x00000001; } + bitField0_ |= 0x00000002; } + /** * * *
              * Optional. The relative resource name pattern associated with this resource
              * type. The DNS prefix of the full resource name shouldn't be specified here.
        +     *
              * The path pattern must follow the syntax, which aligns with HTTP binding
              * syntax:
        -     *     Template = Segment { "/" Segment } ;
        -     *     Segment = LITERAL | Variable ;
        -     *     Variable = "{" LITERAL "}" ;
        +     *
        +     * Template = Segment { "/" Segment } ;
        +     * Segment = LITERAL | Variable ;
        +     * Variable = "{" LITERAL "}" ;
        +     *
              * Examples:
        -     *     - "projects/{project}/topics/{topic}"
        -     *     - "projects/{project}/knowledgeBases/{knowledge_base}"
        +     *
        +     * - "projects/{project}/topics/{topic}"
        +     * - "projects/{project}/knowledgeBases/{knowledge_base}"
        +     *
              * The components in braces correspond to the IDs for each resource in the
              * hierarchy. It is expected that, if multiple patterns are provided,
              * the same component name (e.g. "project") refers to IDs of the same
        @@ -1649,22 +1771,29 @@ private void ensurePatternIsMutable() {
              * @return A list containing the pattern.
              */
             public com.google.protobuf.ProtocolStringList getPatternList() {
        -      return pattern_.getUnmodifiableView();
        +      pattern_.makeImmutable();
        +      return pattern_;
             }
        +
             /**
              *
              *
              * 
              * Optional. The relative resource name pattern associated with this resource
              * type. The DNS prefix of the full resource name shouldn't be specified here.
        +     *
              * The path pattern must follow the syntax, which aligns with HTTP binding
              * syntax:
        -     *     Template = Segment { "/" Segment } ;
        -     *     Segment = LITERAL | Variable ;
        -     *     Variable = "{" LITERAL "}" ;
        +     *
        +     * Template = Segment { "/" Segment } ;
        +     * Segment = LITERAL | Variable ;
        +     * Variable = "{" LITERAL "}" ;
        +     *
              * Examples:
        -     *     - "projects/{project}/topics/{topic}"
        -     *     - "projects/{project}/knowledgeBases/{knowledge_base}"
        +     *
        +     * - "projects/{project}/topics/{topic}"
        +     * - "projects/{project}/knowledgeBases/{knowledge_base}"
        +     *
              * The components in braces correspond to the IDs for each resource in the
              * hierarchy. It is expected that, if multiple patterns are provided,
              * the same component name (e.g. "project") refers to IDs of the same
        @@ -1678,20 +1807,26 @@ public com.google.protobuf.ProtocolStringList getPatternList() {
             public int getPatternCount() {
               return pattern_.size();
             }
        +
             /**
              *
              *
              * 
              * Optional. The relative resource name pattern associated with this resource
              * type. The DNS prefix of the full resource name shouldn't be specified here.
        +     *
              * The path pattern must follow the syntax, which aligns with HTTP binding
              * syntax:
        -     *     Template = Segment { "/" Segment } ;
        -     *     Segment = LITERAL | Variable ;
        -     *     Variable = "{" LITERAL "}" ;
        +     *
        +     * Template = Segment { "/" Segment } ;
        +     * Segment = LITERAL | Variable ;
        +     * Variable = "{" LITERAL "}" ;
        +     *
              * Examples:
        -     *     - "projects/{project}/topics/{topic}"
        -     *     - "projects/{project}/knowledgeBases/{knowledge_base}"
        +     *
        +     * - "projects/{project}/topics/{topic}"
        +     * - "projects/{project}/knowledgeBases/{knowledge_base}"
        +     *
              * The components in braces correspond to the IDs for each resource in the
              * hierarchy. It is expected that, if multiple patterns are provided,
              * the same component name (e.g. "project") refers to IDs of the same
        @@ -1706,20 +1841,26 @@ public int getPatternCount() {
             public java.lang.String getPattern(int index) {
               return pattern_.get(index);
             }
        +
             /**
              *
              *
              * 
              * Optional. The relative resource name pattern associated with this resource
              * type. The DNS prefix of the full resource name shouldn't be specified here.
        +     *
              * The path pattern must follow the syntax, which aligns with HTTP binding
              * syntax:
        -     *     Template = Segment { "/" Segment } ;
        -     *     Segment = LITERAL | Variable ;
        -     *     Variable = "{" LITERAL "}" ;
        +     *
        +     * Template = Segment { "/" Segment } ;
        +     * Segment = LITERAL | Variable ;
        +     * Variable = "{" LITERAL "}" ;
        +     *
              * Examples:
        -     *     - "projects/{project}/topics/{topic}"
        -     *     - "projects/{project}/knowledgeBases/{knowledge_base}"
        +     *
        +     * - "projects/{project}/topics/{topic}"
        +     * - "projects/{project}/knowledgeBases/{knowledge_base}"
        +     *
              * The components in braces correspond to the IDs for each resource in the
              * hierarchy. It is expected that, if multiple patterns are provided,
              * the same component name (e.g. "project") refers to IDs of the same
        @@ -1734,20 +1875,26 @@ public java.lang.String getPattern(int index) {
             public com.google.protobuf.ByteString getPatternBytes(int index) {
               return pattern_.getByteString(index);
             }
        +
             /**
              *
              *
              * 
              * Optional. The relative resource name pattern associated with this resource
              * type. The DNS prefix of the full resource name shouldn't be specified here.
        +     *
              * The path pattern must follow the syntax, which aligns with HTTP binding
              * syntax:
        -     *     Template = Segment { "/" Segment } ;
        -     *     Segment = LITERAL | Variable ;
        -     *     Variable = "{" LITERAL "}" ;
        +     *
        +     * Template = Segment { "/" Segment } ;
        +     * Segment = LITERAL | Variable ;
        +     * Variable = "{" LITERAL "}" ;
        +     *
              * Examples:
        -     *     - "projects/{project}/topics/{topic}"
        -     *     - "projects/{project}/knowledgeBases/{knowledge_base}"
        +     *
        +     * - "projects/{project}/topics/{topic}"
        +     * - "projects/{project}/knowledgeBases/{knowledge_base}"
        +     *
              * The components in braces correspond to the IDs for each resource in the
              * hierarchy. It is expected that, if multiple patterns are provided,
              * the same component name (e.g. "project") refers to IDs of the same
        @@ -1766,23 +1913,30 @@ public Builder setPattern(int index, java.lang.String value) {
               }
               ensurePatternIsMutable();
               pattern_.set(index, value);
        +      bitField0_ |= 0x00000002;
               onChanged();
               return this;
             }
        +
             /**
              *
              *
              * 
              * Optional. The relative resource name pattern associated with this resource
              * type. The DNS prefix of the full resource name shouldn't be specified here.
        +     *
              * The path pattern must follow the syntax, which aligns with HTTP binding
              * syntax:
        -     *     Template = Segment { "/" Segment } ;
        -     *     Segment = LITERAL | Variable ;
        -     *     Variable = "{" LITERAL "}" ;
        +     *
        +     * Template = Segment { "/" Segment } ;
        +     * Segment = LITERAL | Variable ;
        +     * Variable = "{" LITERAL "}" ;
        +     *
              * Examples:
        -     *     - "projects/{project}/topics/{topic}"
        -     *     - "projects/{project}/knowledgeBases/{knowledge_base}"
        +     *
        +     * - "projects/{project}/topics/{topic}"
        +     * - "projects/{project}/knowledgeBases/{knowledge_base}"
        +     *
              * The components in braces correspond to the IDs for each resource in the
              * hierarchy. It is expected that, if multiple patterns are provided,
              * the same component name (e.g. "project") refers to IDs of the same
        @@ -1800,23 +1954,30 @@ public Builder addPattern(java.lang.String value) {
               }
               ensurePatternIsMutable();
               pattern_.add(value);
        +      bitField0_ |= 0x00000002;
               onChanged();
               return this;
             }
        +
             /**
              *
              *
              * 
              * Optional. The relative resource name pattern associated with this resource
              * type. The DNS prefix of the full resource name shouldn't be specified here.
        +     *
              * The path pattern must follow the syntax, which aligns with HTTP binding
              * syntax:
        -     *     Template = Segment { "/" Segment } ;
        -     *     Segment = LITERAL | Variable ;
        -     *     Variable = "{" LITERAL "}" ;
        +     *
        +     * Template = Segment { "/" Segment } ;
        +     * Segment = LITERAL | Variable ;
        +     * Variable = "{" LITERAL "}" ;
        +     *
              * Examples:
        -     *     - "projects/{project}/topics/{topic}"
        -     *     - "projects/{project}/knowledgeBases/{knowledge_base}"
        +     *
        +     * - "projects/{project}/topics/{topic}"
        +     * - "projects/{project}/knowledgeBases/{knowledge_base}"
        +     *
              * The components in braces correspond to the IDs for each resource in the
              * hierarchy. It is expected that, if multiple patterns are provided,
              * the same component name (e.g. "project") refers to IDs of the same
        @@ -1831,23 +1992,30 @@ public Builder addPattern(java.lang.String value) {
             public Builder addAllPattern(java.lang.Iterable values) {
               ensurePatternIsMutable();
               com.google.protobuf.AbstractMessageLite.Builder.addAll(values, pattern_);
        +      bitField0_ |= 0x00000002;
               onChanged();
               return this;
             }
        +
             /**
              *
              *
              * 
              * Optional. The relative resource name pattern associated with this resource
              * type. The DNS prefix of the full resource name shouldn't be specified here.
        +     *
              * The path pattern must follow the syntax, which aligns with HTTP binding
              * syntax:
        -     *     Template = Segment { "/" Segment } ;
        -     *     Segment = LITERAL | Variable ;
        -     *     Variable = "{" LITERAL "}" ;
        +     *
        +     * Template = Segment { "/" Segment } ;
        +     * Segment = LITERAL | Variable ;
        +     * Variable = "{" LITERAL "}" ;
        +     *
              * Examples:
        -     *     - "projects/{project}/topics/{topic}"
        -     *     - "projects/{project}/knowledgeBases/{knowledge_base}"
        +     *
        +     * - "projects/{project}/topics/{topic}"
        +     * - "projects/{project}/knowledgeBases/{knowledge_base}"
        +     *
              * The components in braces correspond to the IDs for each resource in the
              * hierarchy. It is expected that, if multiple patterns are provided,
              * the same component name (e.g. "project") refers to IDs of the same
        @@ -1859,25 +2027,32 @@ public Builder addAllPattern(java.lang.Iterable values) {
              * @return This builder for chaining.
              */
             public Builder clearPattern() {
        -      pattern_ = com.google.protobuf.LazyStringArrayList.EMPTY;
        -      bitField0_ = (bitField0_ & ~0x00000001);
        +      pattern_ = com.google.protobuf.LazyStringArrayList.emptyList();
        +      bitField0_ = (bitField0_ & ~0x00000002);
        +      ;
               onChanged();
               return this;
             }
        +
             /**
              *
              *
              * 
              * Optional. The relative resource name pattern associated with this resource
              * type. The DNS prefix of the full resource name shouldn't be specified here.
        +     *
              * The path pattern must follow the syntax, which aligns with HTTP binding
              * syntax:
        -     *     Template = Segment { "/" Segment } ;
        -     *     Segment = LITERAL | Variable ;
        -     *     Variable = "{" LITERAL "}" ;
        +     *
        +     * Template = Segment { "/" Segment } ;
        +     * Segment = LITERAL | Variable ;
        +     * Variable = "{" LITERAL "}" ;
        +     *
              * Examples:
        -     *     - "projects/{project}/topics/{topic}"
        -     *     - "projects/{project}/knowledgeBases/{knowledge_base}"
        +     *
        +     * - "projects/{project}/topics/{topic}"
        +     * - "projects/{project}/knowledgeBases/{knowledge_base}"
        +     *
              * The components in braces correspond to the IDs for each resource in the
              * hierarchy. It is expected that, if multiple patterns are provided,
              * the same component name (e.g. "project") refers to IDs of the same
        @@ -1896,11 +2071,13 @@ public Builder addPatternBytes(com.google.protobuf.ByteString value) {
               checkByteStringIsUtf8(value);
               ensurePatternIsMutable();
               pattern_.add(value);
        +      bitField0_ |= 0x00000002;
               onChanged();
               return this;
             }
         
             private java.lang.Object nameField_ = "";
        +
             /**
              *
              *
        @@ -1924,6 +2101,7 @@ public java.lang.String getNameField() {
                 return (java.lang.String) ref;
               }
             }
        +
             /**
              *
              *
        @@ -1947,6 +2125,7 @@ public com.google.protobuf.ByteString getNameFieldBytes() {
                 return (com.google.protobuf.ByteString) ref;
               }
             }
        +
             /**
              *
              *
        @@ -1964,11 +2143,12 @@ public Builder setNameField(java.lang.String value) {
               if (value == null) {
                 throw new NullPointerException();
               }
        -
               nameField_ = value;
        +      bitField0_ |= 0x00000004;
               onChanged();
               return this;
             }
        +
             /**
              *
              *
        @@ -1982,11 +2162,12 @@ public Builder setNameField(java.lang.String value) {
              * @return This builder for chaining.
              */
             public Builder clearNameField() {
        -
               nameField_ = getDefaultInstance().getNameField();
        +      bitField0_ = (bitField0_ & ~0x00000004);
               onChanged();
               return this;
             }
        +
             /**
              *
              *
        @@ -2005,30 +2186,33 @@ public Builder setNameFieldBytes(com.google.protobuf.ByteString value) {
                 throw new NullPointerException();
               }
               checkByteStringIsUtf8(value);
        -
               nameField_ = value;
        +      bitField0_ |= 0x00000004;
               onChanged();
               return this;
             }
         
             private int history_ = 0;
        +
             /**
              *
              *
              * 
              * Optional. The historical or future-looking state of the resource pattern.
        +     *
              * Example:
        -     *     // The InspectTemplate message originally only supported resource
        -     *     // names with organization, and project was added later.
        -     *     message InspectTemplate {
        -     *       option (google.api.resource) = {
        -     *         type: "dlp.googleapis.com/InspectTemplate"
        -     *         pattern:
        -     *         "organizations/{organization}/inspectTemplates/{inspect_template}"
        -     *         pattern: "projects/{project}/inspectTemplates/{inspect_template}"
        -     *         history: ORIGINALLY_SINGLE_PATTERN
        -     *       };
        -     *     }
        +     *
        +     * // The InspectTemplate message originally only supported resource
        +     * // names with organization, and project was added later.
        +     * message InspectTemplate {
        +     * option (google.api.resource) = {
        +     * type: "dlp.googleapis.com/InspectTemplate"
        +     * pattern:
        +     * "organizations/{organization}/inspectTemplates/{inspect_template}"
        +     * pattern: "projects/{project}/inspectTemplates/{inspect_template}"
        +     * history: ORIGINALLY_SINGLE_PATTERN
        +     * };
        +     * }
              * 
        * * .google.api.ResourceDescriptor.History history = 4; @@ -2039,23 +2223,26 @@ public Builder setNameFieldBytes(com.google.protobuf.ByteString value) { public int getHistoryValue() { return history_; } + /** * * *
              * Optional. The historical or future-looking state of the resource pattern.
        +     *
              * Example:
        -     *     // The InspectTemplate message originally only supported resource
        -     *     // names with organization, and project was added later.
        -     *     message InspectTemplate {
        -     *       option (google.api.resource) = {
        -     *         type: "dlp.googleapis.com/InspectTemplate"
        -     *         pattern:
        -     *         "organizations/{organization}/inspectTemplates/{inspect_template}"
        -     *         pattern: "projects/{project}/inspectTemplates/{inspect_template}"
        -     *         history: ORIGINALLY_SINGLE_PATTERN
        -     *       };
        -     *     }
        +     *
        +     * // The InspectTemplate message originally only supported resource
        +     * // names with organization, and project was added later.
        +     * message InspectTemplate {
        +     * option (google.api.resource) = {
        +     * type: "dlp.googleapis.com/InspectTemplate"
        +     * pattern:
        +     * "organizations/{organization}/inspectTemplates/{inspect_template}"
        +     * pattern: "projects/{project}/inspectTemplates/{inspect_template}"
        +     * history: ORIGINALLY_SINGLE_PATTERN
        +     * };
        +     * }
              * 
        * * .google.api.ResourceDescriptor.History history = 4; @@ -2064,28 +2251,31 @@ public int getHistoryValue() { * @return This builder for chaining. */ public Builder setHistoryValue(int value) { - history_ = value; + bitField0_ |= 0x00000008; onChanged(); return this; } + /** * * *
              * Optional. The historical or future-looking state of the resource pattern.
        +     *
              * Example:
        -     *     // The InspectTemplate message originally only supported resource
        -     *     // names with organization, and project was added later.
        -     *     message InspectTemplate {
        -     *       option (google.api.resource) = {
        -     *         type: "dlp.googleapis.com/InspectTemplate"
        -     *         pattern:
        -     *         "organizations/{organization}/inspectTemplates/{inspect_template}"
        -     *         pattern: "projects/{project}/inspectTemplates/{inspect_template}"
        -     *         history: ORIGINALLY_SINGLE_PATTERN
        -     *       };
        -     *     }
        +     *
        +     * // The InspectTemplate message originally only supported resource
        +     * // names with organization, and project was added later.
        +     * message InspectTemplate {
        +     * option (google.api.resource) = {
        +     * type: "dlp.googleapis.com/InspectTemplate"
        +     * pattern:
        +     * "organizations/{organization}/inspectTemplates/{inspect_template}"
        +     * pattern: "projects/{project}/inspectTemplates/{inspect_template}"
        +     * history: ORIGINALLY_SINGLE_PATTERN
        +     * };
        +     * }
              * 
        * * .google.api.ResourceDescriptor.History history = 4; @@ -2094,28 +2284,30 @@ public Builder setHistoryValue(int value) { */ @java.lang.Override public com.google.api.ResourceDescriptor.History getHistory() { - @SuppressWarnings("deprecation") com.google.api.ResourceDescriptor.History result = - com.google.api.ResourceDescriptor.History.valueOf(history_); + com.google.api.ResourceDescriptor.History.forNumber(history_); return result == null ? com.google.api.ResourceDescriptor.History.UNRECOGNIZED : result; } + /** * * *
              * Optional. The historical or future-looking state of the resource pattern.
        +     *
              * Example:
        -     *     // The InspectTemplate message originally only supported resource
        -     *     // names with organization, and project was added later.
        -     *     message InspectTemplate {
        -     *       option (google.api.resource) = {
        -     *         type: "dlp.googleapis.com/InspectTemplate"
        -     *         pattern:
        -     *         "organizations/{organization}/inspectTemplates/{inspect_template}"
        -     *         pattern: "projects/{project}/inspectTemplates/{inspect_template}"
        -     *         history: ORIGINALLY_SINGLE_PATTERN
        -     *       };
        -     *     }
        +     *
        +     * // The InspectTemplate message originally only supported resource
        +     * // names with organization, and project was added later.
        +     * message InspectTemplate {
        +     * option (google.api.resource) = {
        +     * type: "dlp.googleapis.com/InspectTemplate"
        +     * pattern:
        +     * "organizations/{organization}/inspectTemplates/{inspect_template}"
        +     * pattern: "projects/{project}/inspectTemplates/{inspect_template}"
        +     * history: ORIGINALLY_SINGLE_PATTERN
        +     * };
        +     * }
              * 
        * * .google.api.ResourceDescriptor.History history = 4; @@ -2127,28 +2319,31 @@ public Builder setHistory(com.google.api.ResourceDescriptor.History value) { if (value == null) { throw new NullPointerException(); } - + bitField0_ |= 0x00000008; history_ = value.getNumber(); onChanged(); return this; } + /** * * *
              * Optional. The historical or future-looking state of the resource pattern.
        +     *
              * Example:
        -     *     // The InspectTemplate message originally only supported resource
        -     *     // names with organization, and project was added later.
        -     *     message InspectTemplate {
        -     *       option (google.api.resource) = {
        -     *         type: "dlp.googleapis.com/InspectTemplate"
        -     *         pattern:
        -     *         "organizations/{organization}/inspectTemplates/{inspect_template}"
        -     *         pattern: "projects/{project}/inspectTemplates/{inspect_template}"
        -     *         history: ORIGINALLY_SINGLE_PATTERN
        -     *       };
        -     *     }
        +     *
        +     * // The InspectTemplate message originally only supported resource
        +     * // names with organization, and project was added later.
        +     * message InspectTemplate {
        +     * option (google.api.resource) = {
        +     * type: "dlp.googleapis.com/InspectTemplate"
        +     * pattern:
        +     * "organizations/{organization}/inspectTemplates/{inspect_template}"
        +     * pattern: "projects/{project}/inspectTemplates/{inspect_template}"
        +     * history: ORIGINALLY_SINGLE_PATTERN
        +     * };
        +     * }
              * 
        * * .google.api.ResourceDescriptor.History history = 4; @@ -2156,22 +2351,29 @@ public Builder setHistory(com.google.api.ResourceDescriptor.History value) { * @return This builder for chaining. */ public Builder clearHistory() { - + bitField0_ = (bitField0_ & ~0x00000008); history_ = 0; onChanged(); return this; } private java.lang.Object plural_ = ""; + /** * * *
              * The plural name used in the resource name and permission names, such as
              * 'projects' for the resource name of 'projects/{project}' and the permission
        -     * name of 'cloudresourcemanager.googleapis.com/projects.get'. It is the same
        -     * concept of the `plural` field in k8s CRD spec
        +     * name of 'cloudresourcemanager.googleapis.com/projects.get'. One exception
        +     * to this is for Nested Collections that have stuttering names, as defined
        +     * in [AIP-122](https://google.aip.dev/122#nested-collections), where the
        +     * collection ID in the resource name pattern does not necessarily directly
        +     * match the `plural` value.
        +     *
        +     * It is the same concept of the `plural` field in k8s CRD spec
              * https://kubernetes.io/docs/tasks/access-kubernetes-api/custom-resources/custom-resource-definitions/
        +     *
              * Note: The plural form is required even for singleton resources. See
              * https://aip.dev/156
              * 
        @@ -2191,15 +2393,22 @@ public java.lang.String getPlural() { return (java.lang.String) ref; } } + /** * * *
              * The plural name used in the resource name and permission names, such as
              * 'projects' for the resource name of 'projects/{project}' and the permission
        -     * name of 'cloudresourcemanager.googleapis.com/projects.get'. It is the same
        -     * concept of the `plural` field in k8s CRD spec
        +     * name of 'cloudresourcemanager.googleapis.com/projects.get'. One exception
        +     * to this is for Nested Collections that have stuttering names, as defined
        +     * in [AIP-122](https://google.aip.dev/122#nested-collections), where the
        +     * collection ID in the resource name pattern does not necessarily directly
        +     * match the `plural` value.
        +     *
        +     * It is the same concept of the `plural` field in k8s CRD spec
              * https://kubernetes.io/docs/tasks/access-kubernetes-api/custom-resources/custom-resource-definitions/
        +     *
              * Note: The plural form is required even for singleton resources. See
              * https://aip.dev/156
              * 
        @@ -2219,15 +2428,22 @@ public com.google.protobuf.ByteString getPluralBytes() { return (com.google.protobuf.ByteString) ref; } } + /** * * *
              * The plural name used in the resource name and permission names, such as
              * 'projects' for the resource name of 'projects/{project}' and the permission
        -     * name of 'cloudresourcemanager.googleapis.com/projects.get'. It is the same
        -     * concept of the `plural` field in k8s CRD spec
        +     * name of 'cloudresourcemanager.googleapis.com/projects.get'. One exception
        +     * to this is for Nested Collections that have stuttering names, as defined
        +     * in [AIP-122](https://google.aip.dev/122#nested-collections), where the
        +     * collection ID in the resource name pattern does not necessarily directly
        +     * match the `plural` value.
        +     *
        +     * It is the same concept of the `plural` field in k8s CRD spec
              * https://kubernetes.io/docs/tasks/access-kubernetes-api/custom-resources/custom-resource-definitions/
        +     *
              * Note: The plural form is required even for singleton resources. See
              * https://aip.dev/156
              * 
        @@ -2241,20 +2457,27 @@ public Builder setPlural(java.lang.String value) { if (value == null) { throw new NullPointerException(); } - plural_ = value; + bitField0_ |= 0x00000010; onChanged(); return this; } + /** * * *
              * The plural name used in the resource name and permission names, such as
              * 'projects' for the resource name of 'projects/{project}' and the permission
        -     * name of 'cloudresourcemanager.googleapis.com/projects.get'. It is the same
        -     * concept of the `plural` field in k8s CRD spec
        +     * name of 'cloudresourcemanager.googleapis.com/projects.get'. One exception
        +     * to this is for Nested Collections that have stuttering names, as defined
        +     * in [AIP-122](https://google.aip.dev/122#nested-collections), where the
        +     * collection ID in the resource name pattern does not necessarily directly
        +     * match the `plural` value.
        +     *
        +     * It is the same concept of the `plural` field in k8s CRD spec
              * https://kubernetes.io/docs/tasks/access-kubernetes-api/custom-resources/custom-resource-definitions/
        +     *
              * Note: The plural form is required even for singleton resources. See
              * https://aip.dev/156
              * 
        @@ -2264,20 +2487,27 @@ public Builder setPlural(java.lang.String value) { * @return This builder for chaining. */ public Builder clearPlural() { - plural_ = getDefaultInstance().getPlural(); + bitField0_ = (bitField0_ & ~0x00000010); onChanged(); return this; } + /** * * *
              * The plural name used in the resource name and permission names, such as
              * 'projects' for the resource name of 'projects/{project}' and the permission
        -     * name of 'cloudresourcemanager.googleapis.com/projects.get'. It is the same
        -     * concept of the `plural` field in k8s CRD spec
        +     * name of 'cloudresourcemanager.googleapis.com/projects.get'. One exception
        +     * to this is for Nested Collections that have stuttering names, as defined
        +     * in [AIP-122](https://google.aip.dev/122#nested-collections), where the
        +     * collection ID in the resource name pattern does not necessarily directly
        +     * match the `plural` value.
        +     *
        +     * It is the same concept of the `plural` field in k8s CRD spec
              * https://kubernetes.io/docs/tasks/access-kubernetes-api/custom-resources/custom-resource-definitions/
        +     *
              * Note: The plural form is required even for singleton resources. See
              * https://aip.dev/156
              * 
        @@ -2292,13 +2522,14 @@ public Builder setPluralBytes(com.google.protobuf.ByteString value) { throw new NullPointerException(); } checkByteStringIsUtf8(value); - plural_ = value; + bitField0_ |= 0x00000010; onChanged(); return this; } private java.lang.Object singular_ = ""; + /** * * @@ -2323,6 +2554,7 @@ public java.lang.String getSingular() { return (java.lang.String) ref; } } + /** * * @@ -2347,6 +2579,7 @@ public com.google.protobuf.ByteString getSingularBytes() { return (com.google.protobuf.ByteString) ref; } } + /** * * @@ -2365,11 +2598,12 @@ public Builder setSingular(java.lang.String value) { if (value == null) { throw new NullPointerException(); } - singular_ = value; + bitField0_ |= 0x00000020; onChanged(); return this; } + /** * * @@ -2384,11 +2618,12 @@ public Builder setSingular(java.lang.String value) { * @return This builder for chaining. */ public Builder clearSingular() { - singular_ = getDefaultInstance().getSingular(); + bitField0_ = (bitField0_ & ~0x00000020); onChanged(); return this; } + /** * * @@ -2408,20 +2643,21 @@ public Builder setSingularBytes(com.google.protobuf.ByteString value) { throw new NullPointerException(); } checkByteStringIsUtf8(value); - singular_ = value; + bitField0_ |= 0x00000020; onChanged(); return this; } - private java.util.List style_ = java.util.Collections.emptyList(); + private com.google.protobuf.Internal.IntList style_ = emptyIntList(); private void ensureStyleIsMutable() { - if (!((bitField0_ & 0x00000002) != 0)) { - style_ = new java.util.ArrayList(style_); - bitField0_ |= 0x00000002; + if (!style_.isModifiable()) { + style_ = makeMutableCopy(style_); } + bitField0_ |= 0x00000040; } + /** * * @@ -2436,9 +2672,10 @@ private void ensureStyleIsMutable() { * @return A list containing the style. */ public java.util.List getStyleList() { - return new com.google.protobuf.Internal.ListAdapter< - java.lang.Integer, com.google.api.ResourceDescriptor.Style>(style_, style_converter_); + return new com.google.protobuf.Internal.IntListAdapter< + com.google.api.ResourceDescriptor.Style>(style_, style_converter_); } + /** * * @@ -2455,6 +2692,7 @@ public java.util.List getStyleList() { public int getStyleCount() { return style_.size(); } + /** * * @@ -2470,8 +2708,9 @@ public int getStyleCount() { * @return The style at the given index. */ public com.google.api.ResourceDescriptor.Style getStyle(int index) { - return style_converter_.convert(style_.get(index)); + return style_converter_.convert(style_.getInt(index)); } + /** * * @@ -2492,10 +2731,11 @@ public Builder setStyle(int index, com.google.api.ResourceDescriptor.Style value throw new NullPointerException(); } ensureStyleIsMutable(); - style_.set(index, value.getNumber()); + style_.setInt(index, value.getNumber()); onChanged(); return this; } + /** * * @@ -2515,10 +2755,11 @@ public Builder addStyle(com.google.api.ResourceDescriptor.Style value) { throw new NullPointerException(); } ensureStyleIsMutable(); - style_.add(value.getNumber()); + style_.addInt(value.getNumber()); onChanged(); return this; } + /** * * @@ -2537,11 +2778,12 @@ public Builder addAllStyle( java.lang.Iterable values) { ensureStyleIsMutable(); for (com.google.api.ResourceDescriptor.Style value : values) { - style_.add(value.getNumber()); + style_.addInt(value.getNumber()); } onChanged(); return this; } + /** * * @@ -2556,11 +2798,12 @@ public Builder addAllStyle( * @return This builder for chaining. */ public Builder clearStyle() { - style_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000002); + style_ = emptyIntList(); + bitField0_ = (bitField0_ & ~0x00000040); onChanged(); return this; } + /** * * @@ -2575,8 +2818,10 @@ public Builder clearStyle() { * @return A list containing the enum numeric values on the wire for style. */ public java.util.List getStyleValueList() { - return java.util.Collections.unmodifiableList(style_); + style_.makeImmutable(); + return style_; } + /** * * @@ -2592,8 +2837,9 @@ public java.util.List getStyleValueList() { * @return The enum numeric value on the wire of style at the given index. */ public int getStyleValue(int index) { - return style_.get(index); + return style_.getInt(index); } + /** * * @@ -2611,10 +2857,11 @@ public int getStyleValue(int index) { */ public Builder setStyleValue(int index, int value) { ensureStyleIsMutable(); - style_.set(index, value); + style_.setInt(index, value); onChanged(); return this; } + /** * * @@ -2631,10 +2878,11 @@ public Builder setStyleValue(int index, int value) { */ public Builder addStyleValue(int value) { ensureStyleIsMutable(); - style_.add(value); + style_.addInt(value); onChanged(); return this; } + /** * * @@ -2652,23 +2900,12 @@ public Builder addStyleValue(int value) { public Builder addAllStyleValue(java.lang.Iterable values) { ensureStyleIsMutable(); for (int value : values) { - style_.add(value); + style_.addInt(value); } onChanged(); return this; } - @java.lang.Override - public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - // @@protoc_insertion_point(builder_scope:google.api.ResourceDescriptor) } diff --git a/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/ResourceDescriptorOrBuilder.java b/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/ResourceDescriptorOrBuilder.java index 3e9739257d..a590775a10 100644 --- a/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/ResourceDescriptorOrBuilder.java +++ b/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/ResourceDescriptorOrBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,10 +14,13 @@ * limitations under the License. */ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: google/api/resource.proto +// Protobuf Java Version: 4.33.2 package com.google.api; +@com.google.protobuf.Generated public interface ResourceDescriptorOrBuilder extends // @@protoc_insertion_point(interface_extends:google.api.ResourceDescriptor) @@ -30,7 +33,9 @@ public interface ResourceDescriptorOrBuilder * The resource type. It must be in the format of * {service_name}/{resource_type_kind}. The `resource_type_kind` must be * singular and must not include version numbers. + * * Example: `storage.googleapis.com/Bucket` + * * The value of the resource_type_kind must follow the regular expression * /[A-Za-z][a-zA-Z0-9]+/. It should start with an upper case character and * should use PascalCase (UpperCamelCase). The maximum number of @@ -42,6 +47,7 @@ public interface ResourceDescriptorOrBuilder * @return The type. */ java.lang.String getType(); + /** * * @@ -49,7 +55,9 @@ public interface ResourceDescriptorOrBuilder * The resource type. It must be in the format of * {service_name}/{resource_type_kind}. The `resource_type_kind` must be * singular and must not include version numbers. + * * Example: `storage.googleapis.com/Bucket` + * * The value of the resource_type_kind must follow the regular expression * /[A-Za-z][a-zA-Z0-9]+/. It should start with an upper case character and * should use PascalCase (UpperCamelCase). The maximum number of @@ -68,14 +76,19 @@ public interface ResourceDescriptorOrBuilder *
            * Optional. The relative resource name pattern associated with this resource
            * type. The DNS prefix of the full resource name shouldn't be specified here.
        +   *
            * The path pattern must follow the syntax, which aligns with HTTP binding
            * syntax:
        -   *     Template = Segment { "/" Segment } ;
        -   *     Segment = LITERAL | Variable ;
        -   *     Variable = "{" LITERAL "}" ;
        +   *
        +   * Template = Segment { "/" Segment } ;
        +   * Segment = LITERAL | Variable ;
        +   * Variable = "{" LITERAL "}" ;
        +   *
            * Examples:
        -   *     - "projects/{project}/topics/{topic}"
        -   *     - "projects/{project}/knowledgeBases/{knowledge_base}"
        +   *
        +   * - "projects/{project}/topics/{topic}"
        +   * - "projects/{project}/knowledgeBases/{knowledge_base}"
        +   *
            * The components in braces correspond to the IDs for each resource in the
            * hierarchy. It is expected that, if multiple patterns are provided,
            * the same component name (e.g. "project") refers to IDs of the same
        @@ -87,20 +100,26 @@ public interface ResourceDescriptorOrBuilder
            * @return A list containing the pattern.
            */
           java.util.List getPatternList();
        +
           /**
            *
            *
            * 
            * Optional. The relative resource name pattern associated with this resource
            * type. The DNS prefix of the full resource name shouldn't be specified here.
        +   *
            * The path pattern must follow the syntax, which aligns with HTTP binding
            * syntax:
        -   *     Template = Segment { "/" Segment } ;
        -   *     Segment = LITERAL | Variable ;
        -   *     Variable = "{" LITERAL "}" ;
        +   *
        +   * Template = Segment { "/" Segment } ;
        +   * Segment = LITERAL | Variable ;
        +   * Variable = "{" LITERAL "}" ;
        +   *
            * Examples:
        -   *     - "projects/{project}/topics/{topic}"
        -   *     - "projects/{project}/knowledgeBases/{knowledge_base}"
        +   *
        +   * - "projects/{project}/topics/{topic}"
        +   * - "projects/{project}/knowledgeBases/{knowledge_base}"
        +   *
            * The components in braces correspond to the IDs for each resource in the
            * hierarchy. It is expected that, if multiple patterns are provided,
            * the same component name (e.g. "project") refers to IDs of the same
        @@ -112,20 +131,26 @@ public interface ResourceDescriptorOrBuilder
            * @return The count of pattern.
            */
           int getPatternCount();
        +
           /**
            *
            *
            * 
            * Optional. The relative resource name pattern associated with this resource
            * type. The DNS prefix of the full resource name shouldn't be specified here.
        +   *
            * The path pattern must follow the syntax, which aligns with HTTP binding
            * syntax:
        -   *     Template = Segment { "/" Segment } ;
        -   *     Segment = LITERAL | Variable ;
        -   *     Variable = "{" LITERAL "}" ;
        +   *
        +   * Template = Segment { "/" Segment } ;
        +   * Segment = LITERAL | Variable ;
        +   * Variable = "{" LITERAL "}" ;
        +   *
            * Examples:
        -   *     - "projects/{project}/topics/{topic}"
        -   *     - "projects/{project}/knowledgeBases/{knowledge_base}"
        +   *
        +   * - "projects/{project}/topics/{topic}"
        +   * - "projects/{project}/knowledgeBases/{knowledge_base}"
        +   *
            * The components in braces correspond to the IDs for each resource in the
            * hierarchy. It is expected that, if multiple patterns are provided,
            * the same component name (e.g. "project") refers to IDs of the same
        @@ -138,20 +163,26 @@ public interface ResourceDescriptorOrBuilder
            * @return The pattern at the given index.
            */
           java.lang.String getPattern(int index);
        +
           /**
            *
            *
            * 
            * Optional. The relative resource name pattern associated with this resource
            * type. The DNS prefix of the full resource name shouldn't be specified here.
        +   *
            * The path pattern must follow the syntax, which aligns with HTTP binding
            * syntax:
        -   *     Template = Segment { "/" Segment } ;
        -   *     Segment = LITERAL | Variable ;
        -   *     Variable = "{" LITERAL "}" ;
        +   *
        +   * Template = Segment { "/" Segment } ;
        +   * Segment = LITERAL | Variable ;
        +   * Variable = "{" LITERAL "}" ;
        +   *
            * Examples:
        -   *     - "projects/{project}/topics/{topic}"
        -   *     - "projects/{project}/knowledgeBases/{knowledge_base}"
        +   *
        +   * - "projects/{project}/topics/{topic}"
        +   * - "projects/{project}/knowledgeBases/{knowledge_base}"
        +   *
            * The components in braces correspond to the IDs for each resource in the
            * hierarchy. It is expected that, if multiple patterns are provided,
            * the same component name (e.g. "project") refers to IDs of the same
        @@ -178,6 +209,7 @@ public interface ResourceDescriptorOrBuilder
            * @return The nameField.
            */
           java.lang.String getNameField();
        +
           /**
            *
            *
        @@ -197,18 +229,20 @@ public interface ResourceDescriptorOrBuilder
            *
            * 
            * Optional. The historical or future-looking state of the resource pattern.
        +   *
            * Example:
        -   *     // The InspectTemplate message originally only supported resource
        -   *     // names with organization, and project was added later.
        -   *     message InspectTemplate {
        -   *       option (google.api.resource) = {
        -   *         type: "dlp.googleapis.com/InspectTemplate"
        -   *         pattern:
        -   *         "organizations/{organization}/inspectTemplates/{inspect_template}"
        -   *         pattern: "projects/{project}/inspectTemplates/{inspect_template}"
        -   *         history: ORIGINALLY_SINGLE_PATTERN
        -   *       };
        -   *     }
        +   *
        +   * // The InspectTemplate message originally only supported resource
        +   * // names with organization, and project was added later.
        +   * message InspectTemplate {
        +   * option (google.api.resource) = {
        +   * type: "dlp.googleapis.com/InspectTemplate"
        +   * pattern:
        +   * "organizations/{organization}/inspectTemplates/{inspect_template}"
        +   * pattern: "projects/{project}/inspectTemplates/{inspect_template}"
        +   * history: ORIGINALLY_SINGLE_PATTERN
        +   * };
        +   * }
            * 
        * * .google.api.ResourceDescriptor.History history = 4; @@ -216,23 +250,26 @@ public interface ResourceDescriptorOrBuilder * @return The enum numeric value on the wire for history. */ int getHistoryValue(); + /** * * *
            * Optional. The historical or future-looking state of the resource pattern.
        +   *
            * Example:
        -   *     // The InspectTemplate message originally only supported resource
        -   *     // names with organization, and project was added later.
        -   *     message InspectTemplate {
        -   *       option (google.api.resource) = {
        -   *         type: "dlp.googleapis.com/InspectTemplate"
        -   *         pattern:
        -   *         "organizations/{organization}/inspectTemplates/{inspect_template}"
        -   *         pattern: "projects/{project}/inspectTemplates/{inspect_template}"
        -   *         history: ORIGINALLY_SINGLE_PATTERN
        -   *       };
        -   *     }
        +   *
        +   * // The InspectTemplate message originally only supported resource
        +   * // names with organization, and project was added later.
        +   * message InspectTemplate {
        +   * option (google.api.resource) = {
        +   * type: "dlp.googleapis.com/InspectTemplate"
        +   * pattern:
        +   * "organizations/{organization}/inspectTemplates/{inspect_template}"
        +   * pattern: "projects/{project}/inspectTemplates/{inspect_template}"
        +   * history: ORIGINALLY_SINGLE_PATTERN
        +   * };
        +   * }
            * 
        * * .google.api.ResourceDescriptor.History history = 4; @@ -247,9 +284,15 @@ public interface ResourceDescriptorOrBuilder *
            * The plural name used in the resource name and permission names, such as
            * 'projects' for the resource name of 'projects/{project}' and the permission
        -   * name of 'cloudresourcemanager.googleapis.com/projects.get'. It is the same
        -   * concept of the `plural` field in k8s CRD spec
        +   * name of 'cloudresourcemanager.googleapis.com/projects.get'. One exception
        +   * to this is for Nested Collections that have stuttering names, as defined
        +   * in [AIP-122](https://google.aip.dev/122#nested-collections), where the
        +   * collection ID in the resource name pattern does not necessarily directly
        +   * match the `plural` value.
        +   *
        +   * It is the same concept of the `plural` field in k8s CRD spec
            * https://kubernetes.io/docs/tasks/access-kubernetes-api/custom-resources/custom-resource-definitions/
        +   *
            * Note: The plural form is required even for singleton resources. See
            * https://aip.dev/156
            * 
        @@ -259,15 +302,22 @@ public interface ResourceDescriptorOrBuilder * @return The plural. */ java.lang.String getPlural(); + /** * * *
            * The plural name used in the resource name and permission names, such as
            * 'projects' for the resource name of 'projects/{project}' and the permission
        -   * name of 'cloudresourcemanager.googleapis.com/projects.get'. It is the same
        -   * concept of the `plural` field in k8s CRD spec
        +   * name of 'cloudresourcemanager.googleapis.com/projects.get'. One exception
        +   * to this is for Nested Collections that have stuttering names, as defined
        +   * in [AIP-122](https://google.aip.dev/122#nested-collections), where the
        +   * collection ID in the resource name pattern does not necessarily directly
        +   * match the `plural` value.
        +   *
        +   * It is the same concept of the `plural` field in k8s CRD spec
            * https://kubernetes.io/docs/tasks/access-kubernetes-api/custom-resources/custom-resource-definitions/
        +   *
            * Note: The plural form is required even for singleton resources. See
            * https://aip.dev/156
            * 
        @@ -292,6 +342,7 @@ public interface ResourceDescriptorOrBuilder * @return The singular. */ java.lang.String getSingular(); + /** * * @@ -321,6 +372,7 @@ public interface ResourceDescriptorOrBuilder * @return A list containing the style. */ java.util.List getStyleList(); + /** * * @@ -335,6 +387,7 @@ public interface ResourceDescriptorOrBuilder * @return The count of style. */ int getStyleCount(); + /** * * @@ -350,6 +403,7 @@ public interface ResourceDescriptorOrBuilder * @return The style at the given index. */ com.google.api.ResourceDescriptor.Style getStyle(int index); + /** * * @@ -364,6 +418,7 @@ public interface ResourceDescriptorOrBuilder * @return A list containing the enum numeric values on the wire for style. */ java.util.List getStyleValueList(); + /** * * diff --git a/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/ResourceProto.java b/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/ResourceProto.java index 80c375e126..5366f01618 100644 --- a/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/ResourceProto.java +++ b/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/ResourceProto.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,13 +14,26 @@ * limitations under the License. */ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: google/api/resource.proto +// Protobuf Java Version: 4.33.2 package com.google.api; -public final class ResourceProto { +@com.google.protobuf.Generated +public final class ResourceProto extends com.google.protobuf.GeneratedFile { private ResourceProto() {} + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "ResourceProto"); + } + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistryLite registry) { registry.add(com.google.api.ResourceProto.resourceReference); registry.add(com.google.api.ResourceProto.resourceDefinition); @@ -32,6 +45,7 @@ public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry r } public static final int RESOURCE_REFERENCE_FIELD_NUMBER = 1055; + /** * * @@ -50,6 +64,7 @@ public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry r com.google.api.ResourceReference.getDefaultInstance()); public static final int RESOURCE_DEFINITION_FIELD_NUMBER = 1053; + /** * * @@ -69,6 +84,7 @@ public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry r com.google.api.ResourceDescriptor.getDefaultInstance()); public static final int RESOURCE_FIELD_NUMBER = 1053; + /** * * @@ -88,11 +104,11 @@ public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry r static final com.google.protobuf.Descriptors.Descriptor internal_static_google_api_ResourceDescriptor_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable internal_static_google_api_ResourceDescriptor_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_google_api_ResourceReference_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable internal_static_google_api_ResourceReference_fieldAccessorTable; public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { @@ -122,10 +138,10 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + "s\030\235\010 \003(\0132\036.google.api.ResourceDescriptor" + ":R\n\010resource\022\037.google.protobuf.MessageOp" + "tions\030\235\010 \001(\0132\036.google.api.ResourceDescri" - + "ptorBn\n\016com.google.apiB\rResourceProtoP\001Z" + + "ptorBk\n\016com.google.apiB\rResourceProtoP\001Z" + "Agoogle.golang.org/genproto/googleapis/a" - + "pi/annotations;annotations\370\001\001\242\002\004GAPIb\006pr" - + "oto3" + + "pi/annotations;annotations\242\002\004GAPIb\006proto" + + "3" }; descriptor = com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( @@ -133,25 +149,24 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { new com.google.protobuf.Descriptors.FileDescriptor[] { com.google.protobuf.DescriptorProtos.getDescriptor(), }); - internal_static_google_api_ResourceDescriptor_descriptor = - getDescriptor().getMessageTypes().get(0); + internal_static_google_api_ResourceDescriptor_descriptor = getDescriptor().getMessageType(0); internal_static_google_api_ResourceDescriptor_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_google_api_ResourceDescriptor_descriptor, new java.lang.String[] { "Type", "Pattern", "NameField", "History", "Plural", "Singular", "Style", }); - internal_static_google_api_ResourceReference_descriptor = - getDescriptor().getMessageTypes().get(1); + internal_static_google_api_ResourceReference_descriptor = getDescriptor().getMessageType(1); internal_static_google_api_ResourceReference_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_google_api_ResourceReference_descriptor, new java.lang.String[] { "Type", "ChildType", }); - resourceReference.internalInit(descriptor.getExtensions().get(0)); - resourceDefinition.internalInit(descriptor.getExtensions().get(1)); - resource.internalInit(descriptor.getExtensions().get(2)); + resourceReference.internalInit(descriptor.getExtension(0)); + resourceDefinition.internalInit(descriptor.getExtension(1)); + resource.internalInit(descriptor.getExtension(2)); + descriptor.resolveAllFeaturesImmutable(); com.google.protobuf.DescriptorProtos.getDescriptor(); } diff --git a/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/ResourceReference.java b/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/ResourceReference.java index 74dbec1d14..8b0625900d 100644 --- a/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/ResourceReference.java +++ b/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/ResourceReference.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,9 @@ * limitations under the License. */ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: google/api/resource.proto +// Protobuf Java Version: 4.33.2 package com.google.api; @@ -28,13 +30,25 @@ * * Protobuf type {@code google.api.ResourceReference} */ -public final class ResourceReference extends com.google.protobuf.GeneratedMessageV3 +@com.google.protobuf.Generated +public final class ResourceReference extends com.google.protobuf.GeneratedMessage implements // @@protoc_insertion_point(message_implements:google.api.ResourceReference) ResourceReferenceOrBuilder { private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "ResourceReference"); + } + // Use ResourceReference.newBuilder() to construct. - private ResourceReference(com.google.protobuf.GeneratedMessageV3.Builder builder) { + private ResourceReference(com.google.protobuf.GeneratedMessage.Builder builder) { super(builder); } @@ -43,23 +57,12 @@ private ResourceReference() { childType_ = ""; } - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new ResourceReference(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.api.ResourceProto.internal_static_google_api_ResourceReference_descriptor; } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.api.ResourceProto .internal_static_google_api_ResourceReference_fieldAccessorTable @@ -68,26 +71,34 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } public static final int TYPE_FIELD_NUMBER = 1; - private volatile java.lang.Object type_; + + @SuppressWarnings("serial") + private volatile java.lang.Object type_ = ""; + /** * * *
            * The resource type that the annotated field references.
        +   *
            * Example:
        -   *     message Subscription {
        -   *       string topic = 2 [(google.api.resource_reference) = {
        -   *         type: "pubsub.googleapis.com/Topic"
        -   *       }];
        -   *     }
        +   *
        +   * message Subscription {
        +   * string topic = 2 [(google.api.resource_reference) = {
        +   * type: "pubsub.googleapis.com/Topic"
        +   * }];
        +   * }
        +   *
            * Occasionally, a field may reference an arbitrary resource. In this case,
            * APIs use the special value * in their resource reference.
        +   *
            * Example:
        -   *     message GetIamPolicyRequest {
        -   *       string resource = 2 [(google.api.resource_reference) = {
        -   *         type: "*"
        -   *       }];
        -   *     }
        +   *
        +   * message GetIamPolicyRequest {
        +   * string resource = 2 [(google.api.resource_reference) = {
        +   * type: "*"
        +   * }];
        +   * }
            * 
        * * string type = 1; @@ -106,25 +117,31 @@ public java.lang.String getType() { return s; } } + /** * * *
            * The resource type that the annotated field references.
        +   *
            * Example:
        -   *     message Subscription {
        -   *       string topic = 2 [(google.api.resource_reference) = {
        -   *         type: "pubsub.googleapis.com/Topic"
        -   *       }];
        -   *     }
        +   *
        +   * message Subscription {
        +   * string topic = 2 [(google.api.resource_reference) = {
        +   * type: "pubsub.googleapis.com/Topic"
        +   * }];
        +   * }
        +   *
            * Occasionally, a field may reference an arbitrary resource. In this case,
            * APIs use the special value * in their resource reference.
        +   *
            * Example:
        -   *     message GetIamPolicyRequest {
        -   *       string resource = 2 [(google.api.resource_reference) = {
        -   *         type: "*"
        -   *       }];
        -   *     }
        +   *
        +   * message GetIamPolicyRequest {
        +   * string resource = 2 [(google.api.resource_reference) = {
        +   * type: "*"
        +   * }];
        +   * }
            * 
        * * string type = 1; @@ -145,7 +162,10 @@ public com.google.protobuf.ByteString getTypeBytes() { } public static final int CHILD_TYPE_FIELD_NUMBER = 2; - private volatile java.lang.Object childType_; + + @SuppressWarnings("serial") + private volatile java.lang.Object childType_ = ""; + /** * * @@ -153,12 +173,14 @@ public com.google.protobuf.ByteString getTypeBytes() { * The resource type of a child collection that the annotated field * references. This is useful for annotating the `parent` field that * doesn't have a fixed resource type. + * * Example: - * message ListLogEntriesRequest { - * string parent = 1 [(google.api.resource_reference) = { - * child_type: "logging.googleapis.com/LogEntry" - * }; - * } + * + * message ListLogEntriesRequest { + * string parent = 1 [(google.api.resource_reference) = { + * child_type: "logging.googleapis.com/LogEntry" + * }; + * } *
        * * string child_type = 2; @@ -177,6 +199,7 @@ public java.lang.String getChildType() { return s; } } + /** * * @@ -184,12 +207,14 @@ public java.lang.String getChildType() { * The resource type of a child collection that the annotated field * references. This is useful for annotating the `parent` field that * doesn't have a fixed resource type. + * * Example: - * message ListLogEntriesRequest { - * string parent = 1 [(google.api.resource_reference) = { - * child_type: "logging.googleapis.com/LogEntry" - * }; - * } + * + * message ListLogEntriesRequest { + * string parent = 1 [(google.api.resource_reference) = { + * child_type: "logging.googleapis.com/LogEntry" + * }; + * } *
        * * string child_type = 2; @@ -223,11 +248,11 @@ public final boolean isInitialized() { @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(type_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, type_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(type_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, type_); } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(childType_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 2, childType_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(childType_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, childType_); } getUnknownFields().writeTo(output); } @@ -238,11 +263,11 @@ public int getSerializedSize() { if (size != -1) return size; size = 0; - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(type_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, type_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(type_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, type_); } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(childType_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, childType_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(childType_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, childType_); } size += getUnknownFields().getSerializedSize(); memoizedSize = size; @@ -317,38 +342,38 @@ public static com.google.api.ResourceReference parseFrom( public static com.google.api.ResourceReference parseFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); } public static com.google.api.ResourceReference parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } public static com.google.api.ResourceReference parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); } public static com.google.api.ResourceReference parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( PARSER, input, extensionRegistry); } public static com.google.api.ResourceReference parseFrom( com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); } public static com.google.api.ResourceReference parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } @@ -371,10 +396,11 @@ public Builder toBuilder() { } @java.lang.Override - protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { Builder builder = new Builder(parent); return builder; } + /** * * @@ -385,7 +411,7 @@ protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.Build * * Protobuf type {@code google.api.ResourceReference} */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder implements // @@protoc_insertion_point(builder_implements:google.api.ResourceReference) com.google.api.ResourceReferenceOrBuilder { @@ -394,7 +420,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.api.ResourceProto .internal_static_google_api_ResourceReference_fieldAccessorTable @@ -406,17 +432,16 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { // Construct using com.google.api.ResourceReference.newBuilder() private Builder() {} - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { super(parent); } @java.lang.Override public Builder clear() { super.clear(); + bitField0_ = 0; type_ = ""; - childType_ = ""; - return this; } @@ -442,43 +467,21 @@ public com.google.api.ResourceReference build() { @java.lang.Override public com.google.api.ResourceReference buildPartial() { com.google.api.ResourceReference result = new com.google.api.ResourceReference(this); - result.type_ = type_; - result.childType_ = childType_; + if (bitField0_ != 0) { + buildPartial0(result); + } 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); + private void buildPartial0(com.google.api.ResourceReference result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.type_ = type_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.childType_ = childType_; + } } @java.lang.Override @@ -495,10 +498,12 @@ public Builder mergeFrom(com.google.api.ResourceReference other) { if (other == com.google.api.ResourceReference.getDefaultInstance()) return this; if (!other.getType().isEmpty()) { type_ = other.type_; + bitField0_ |= 0x00000001; onChanged(); } if (!other.getChildType().isEmpty()) { childType_ = other.childType_; + bitField0_ |= 0x00000002; onChanged(); } this.mergeUnknownFields(other.getUnknownFields()); @@ -530,13 +535,13 @@ public Builder mergeFrom( case 10: { type_ = input.readStringRequireUtf8(); - + bitField0_ |= 0x00000001; break; } // case 10 case 18: { childType_ = input.readStringRequireUtf8(); - + bitField0_ |= 0x00000002; break; } // case 18 default: @@ -556,26 +561,34 @@ public Builder mergeFrom( return this; } + private int bitField0_; + private java.lang.Object type_ = ""; + /** * * *
              * The resource type that the annotated field references.
        +     *
              * Example:
        -     *     message Subscription {
        -     *       string topic = 2 [(google.api.resource_reference) = {
        -     *         type: "pubsub.googleapis.com/Topic"
        -     *       }];
        -     *     }
        +     *
        +     * message Subscription {
        +     * string topic = 2 [(google.api.resource_reference) = {
        +     * type: "pubsub.googleapis.com/Topic"
        +     * }];
        +     * }
        +     *
              * Occasionally, a field may reference an arbitrary resource. In this case,
              * APIs use the special value * in their resource reference.
        +     *
              * Example:
        -     *     message GetIamPolicyRequest {
        -     *       string resource = 2 [(google.api.resource_reference) = {
        -     *         type: "*"
        -     *       }];
        -     *     }
        +     *
        +     * message GetIamPolicyRequest {
        +     * string resource = 2 [(google.api.resource_reference) = {
        +     * type: "*"
        +     * }];
        +     * }
              * 
        * * string type = 1; @@ -593,25 +606,31 @@ public java.lang.String getType() { return (java.lang.String) ref; } } + /** * * *
              * The resource type that the annotated field references.
        +     *
              * Example:
        -     *     message Subscription {
        -     *       string topic = 2 [(google.api.resource_reference) = {
        -     *         type: "pubsub.googleapis.com/Topic"
        -     *       }];
        -     *     }
        +     *
        +     * message Subscription {
        +     * string topic = 2 [(google.api.resource_reference) = {
        +     * type: "pubsub.googleapis.com/Topic"
        +     * }];
        +     * }
        +     *
              * Occasionally, a field may reference an arbitrary resource. In this case,
              * APIs use the special value * in their resource reference.
        +     *
              * Example:
        -     *     message GetIamPolicyRequest {
        -     *       string resource = 2 [(google.api.resource_reference) = {
        -     *         type: "*"
        -     *       }];
        -     *     }
        +     *
        +     * message GetIamPolicyRequest {
        +     * string resource = 2 [(google.api.resource_reference) = {
        +     * type: "*"
        +     * }];
        +     * }
              * 
        * * string type = 1; @@ -629,25 +648,31 @@ public com.google.protobuf.ByteString getTypeBytes() { return (com.google.protobuf.ByteString) ref; } } + /** * * *
              * The resource type that the annotated field references.
        +     *
              * Example:
        -     *     message Subscription {
        -     *       string topic = 2 [(google.api.resource_reference) = {
        -     *         type: "pubsub.googleapis.com/Topic"
        -     *       }];
        -     *     }
        +     *
        +     * message Subscription {
        +     * string topic = 2 [(google.api.resource_reference) = {
        +     * type: "pubsub.googleapis.com/Topic"
        +     * }];
        +     * }
        +     *
              * Occasionally, a field may reference an arbitrary resource. In this case,
              * APIs use the special value * in their resource reference.
        +     *
              * Example:
        -     *     message GetIamPolicyRequest {
        -     *       string resource = 2 [(google.api.resource_reference) = {
        -     *         type: "*"
        -     *       }];
        -     *     }
        +     *
        +     * message GetIamPolicyRequest {
        +     * string resource = 2 [(google.api.resource_reference) = {
        +     * type: "*"
        +     * }];
        +     * }
              * 
        * * string type = 1; @@ -659,30 +684,36 @@ public Builder setType(java.lang.String value) { if (value == null) { throw new NullPointerException(); } - type_ = value; + bitField0_ |= 0x00000001; onChanged(); return this; } + /** * * *
              * The resource type that the annotated field references.
        +     *
              * Example:
        -     *     message Subscription {
        -     *       string topic = 2 [(google.api.resource_reference) = {
        -     *         type: "pubsub.googleapis.com/Topic"
        -     *       }];
        -     *     }
        +     *
        +     * message Subscription {
        +     * string topic = 2 [(google.api.resource_reference) = {
        +     * type: "pubsub.googleapis.com/Topic"
        +     * }];
        +     * }
        +     *
              * Occasionally, a field may reference an arbitrary resource. In this case,
              * APIs use the special value * in their resource reference.
        +     *
              * Example:
        -     *     message GetIamPolicyRequest {
        -     *       string resource = 2 [(google.api.resource_reference) = {
        -     *         type: "*"
        -     *       }];
        -     *     }
        +     *
        +     * message GetIamPolicyRequest {
        +     * string resource = 2 [(google.api.resource_reference) = {
        +     * type: "*"
        +     * }];
        +     * }
              * 
        * * string type = 1; @@ -690,30 +721,36 @@ public Builder setType(java.lang.String value) { * @return This builder for chaining. */ public Builder clearType() { - type_ = getDefaultInstance().getType(); + bitField0_ = (bitField0_ & ~0x00000001); onChanged(); return this; } + /** * * *
              * The resource type that the annotated field references.
        +     *
              * Example:
        -     *     message Subscription {
        -     *       string topic = 2 [(google.api.resource_reference) = {
        -     *         type: "pubsub.googleapis.com/Topic"
        -     *       }];
        -     *     }
        +     *
        +     * message Subscription {
        +     * string topic = 2 [(google.api.resource_reference) = {
        +     * type: "pubsub.googleapis.com/Topic"
        +     * }];
        +     * }
        +     *
              * Occasionally, a field may reference an arbitrary resource. In this case,
              * APIs use the special value * in their resource reference.
        +     *
              * Example:
        -     *     message GetIamPolicyRequest {
        -     *       string resource = 2 [(google.api.resource_reference) = {
        -     *         type: "*"
        -     *       }];
        -     *     }
        +     *
        +     * message GetIamPolicyRequest {
        +     * string resource = 2 [(google.api.resource_reference) = {
        +     * type: "*"
        +     * }];
        +     * }
              * 
        * * string type = 1; @@ -726,13 +763,14 @@ public Builder setTypeBytes(com.google.protobuf.ByteString value) { throw new NullPointerException(); } checkByteStringIsUtf8(value); - type_ = value; + bitField0_ |= 0x00000001; onChanged(); return this; } private java.lang.Object childType_ = ""; + /** * * @@ -740,12 +778,14 @@ public Builder setTypeBytes(com.google.protobuf.ByteString value) { * The resource type of a child collection that the annotated field * references. This is useful for annotating the `parent` field that * doesn't have a fixed resource type. + * * Example: - * message ListLogEntriesRequest { - * string parent = 1 [(google.api.resource_reference) = { - * child_type: "logging.googleapis.com/LogEntry" - * }; - * } + * + * message ListLogEntriesRequest { + * string parent = 1 [(google.api.resource_reference) = { + * child_type: "logging.googleapis.com/LogEntry" + * }; + * } *
        * * string child_type = 2; @@ -763,6 +803,7 @@ public java.lang.String getChildType() { return (java.lang.String) ref; } } + /** * * @@ -770,12 +811,14 @@ public java.lang.String getChildType() { * The resource type of a child collection that the annotated field * references. This is useful for annotating the `parent` field that * doesn't have a fixed resource type. + * * Example: - * message ListLogEntriesRequest { - * string parent = 1 [(google.api.resource_reference) = { - * child_type: "logging.googleapis.com/LogEntry" - * }; - * } + * + * message ListLogEntriesRequest { + * string parent = 1 [(google.api.resource_reference) = { + * child_type: "logging.googleapis.com/LogEntry" + * }; + * } *
        * * string child_type = 2; @@ -793,6 +836,7 @@ public com.google.protobuf.ByteString getChildTypeBytes() { return (com.google.protobuf.ByteString) ref; } } + /** * * @@ -800,12 +844,14 @@ public com.google.protobuf.ByteString getChildTypeBytes() { * The resource type of a child collection that the annotated field * references. This is useful for annotating the `parent` field that * doesn't have a fixed resource type. + * * Example: - * message ListLogEntriesRequest { - * string parent = 1 [(google.api.resource_reference) = { - * child_type: "logging.googleapis.com/LogEntry" - * }; - * } + * + * message ListLogEntriesRequest { + * string parent = 1 [(google.api.resource_reference) = { + * child_type: "logging.googleapis.com/LogEntry" + * }; + * } *
        * * string child_type = 2; @@ -817,11 +863,12 @@ public Builder setChildType(java.lang.String value) { if (value == null) { throw new NullPointerException(); } - childType_ = value; + bitField0_ |= 0x00000002; onChanged(); return this; } + /** * * @@ -829,12 +876,14 @@ public Builder setChildType(java.lang.String value) { * The resource type of a child collection that the annotated field * references. This is useful for annotating the `parent` field that * doesn't have a fixed resource type. + * * Example: - * message ListLogEntriesRequest { - * string parent = 1 [(google.api.resource_reference) = { - * child_type: "logging.googleapis.com/LogEntry" - * }; - * } + * + * message ListLogEntriesRequest { + * string parent = 1 [(google.api.resource_reference) = { + * child_type: "logging.googleapis.com/LogEntry" + * }; + * } *
        * * string child_type = 2; @@ -842,11 +891,12 @@ public Builder setChildType(java.lang.String value) { * @return This builder for chaining. */ public Builder clearChildType() { - childType_ = getDefaultInstance().getChildType(); + bitField0_ = (bitField0_ & ~0x00000002); onChanged(); return this; } + /** * * @@ -854,12 +904,14 @@ public Builder clearChildType() { * The resource type of a child collection that the annotated field * references. This is useful for annotating the `parent` field that * doesn't have a fixed resource type. + * * Example: - * message ListLogEntriesRequest { - * string parent = 1 [(google.api.resource_reference) = { - * child_type: "logging.googleapis.com/LogEntry" - * }; - * } + * + * message ListLogEntriesRequest { + * string parent = 1 [(google.api.resource_reference) = { + * child_type: "logging.googleapis.com/LogEntry" + * }; + * } *
        * * string child_type = 2; @@ -872,23 +924,12 @@ public Builder setChildTypeBytes(com.google.protobuf.ByteString value) { throw new NullPointerException(); } checkByteStringIsUtf8(value); - childType_ = 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.api.ResourceReference) } diff --git a/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/ResourceReferenceOrBuilder.java b/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/ResourceReferenceOrBuilder.java index d7ad517359..335588f195 100644 --- a/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/ResourceReferenceOrBuilder.java +++ b/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/ResourceReferenceOrBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,10 +14,13 @@ * limitations under the License. */ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: google/api/resource.proto +// Protobuf Java Version: 4.33.2 package com.google.api; +@com.google.protobuf.Generated public interface ResourceReferenceOrBuilder extends // @@protoc_insertion_point(interface_extends:google.api.ResourceReference) @@ -28,20 +31,25 @@ public interface ResourceReferenceOrBuilder * *
            * The resource type that the annotated field references.
        +   *
            * Example:
        -   *     message Subscription {
        -   *       string topic = 2 [(google.api.resource_reference) = {
        -   *         type: "pubsub.googleapis.com/Topic"
        -   *       }];
        -   *     }
        +   *
        +   * message Subscription {
        +   * string topic = 2 [(google.api.resource_reference) = {
        +   * type: "pubsub.googleapis.com/Topic"
        +   * }];
        +   * }
        +   *
            * Occasionally, a field may reference an arbitrary resource. In this case,
            * APIs use the special value * in their resource reference.
        +   *
            * Example:
        -   *     message GetIamPolicyRequest {
        -   *       string resource = 2 [(google.api.resource_reference) = {
        -   *         type: "*"
        -   *       }];
        -   *     }
        +   *
        +   * message GetIamPolicyRequest {
        +   * string resource = 2 [(google.api.resource_reference) = {
        +   * type: "*"
        +   * }];
        +   * }
            * 
        * * string type = 1; @@ -49,25 +57,31 @@ public interface ResourceReferenceOrBuilder * @return The type. */ java.lang.String getType(); + /** * * *
            * The resource type that the annotated field references.
        +   *
            * Example:
        -   *     message Subscription {
        -   *       string topic = 2 [(google.api.resource_reference) = {
        -   *         type: "pubsub.googleapis.com/Topic"
        -   *       }];
        -   *     }
        +   *
        +   * message Subscription {
        +   * string topic = 2 [(google.api.resource_reference) = {
        +   * type: "pubsub.googleapis.com/Topic"
        +   * }];
        +   * }
        +   *
            * Occasionally, a field may reference an arbitrary resource. In this case,
            * APIs use the special value * in their resource reference.
        +   *
            * Example:
        -   *     message GetIamPolicyRequest {
        -   *       string resource = 2 [(google.api.resource_reference) = {
        -   *         type: "*"
        -   *       }];
        -   *     }
        +   *
        +   * message GetIamPolicyRequest {
        +   * string resource = 2 [(google.api.resource_reference) = {
        +   * type: "*"
        +   * }];
        +   * }
            * 
        * * string type = 1; @@ -83,12 +97,14 @@ public interface ResourceReferenceOrBuilder * The resource type of a child collection that the annotated field * references. This is useful for annotating the `parent` field that * doesn't have a fixed resource type. + * * Example: - * message ListLogEntriesRequest { - * string parent = 1 [(google.api.resource_reference) = { - * child_type: "logging.googleapis.com/LogEntry" - * }; - * } + * + * message ListLogEntriesRequest { + * string parent = 1 [(google.api.resource_reference) = { + * child_type: "logging.googleapis.com/LogEntry" + * }; + * } *
        * * string child_type = 2; @@ -96,6 +112,7 @@ public interface ResourceReferenceOrBuilder * @return The childType. */ java.lang.String getChildType(); + /** * * @@ -103,12 +120,14 @@ public interface ResourceReferenceOrBuilder * The resource type of a child collection that the annotated field * references. This is useful for annotating the `parent` field that * doesn't have a fixed resource type. + * * Example: - * message ListLogEntriesRequest { - * string parent = 1 [(google.api.resource_reference) = { - * child_type: "logging.googleapis.com/LogEntry" - * }; - * } + * + * message ListLogEntriesRequest { + * string parent = 1 [(google.api.resource_reference) = { + * child_type: "logging.googleapis.com/LogEntry" + * }; + * } *
        * * string child_type = 2; diff --git a/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/RoutingParameter.java b/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/RoutingParameter.java index 3f173c9d5d..20980845ce 100644 --- a/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/RoutingParameter.java +++ b/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/RoutingParameter.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,9 @@ * limitations under the License. */ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: google/api/routing.proto +// Protobuf Java Version: 4.33.2 package com.google.api; @@ -27,13 +29,25 @@ * * Protobuf type {@code google.api.RoutingParameter} */ -public final class RoutingParameter extends com.google.protobuf.GeneratedMessageV3 +@com.google.protobuf.Generated +public final class RoutingParameter extends com.google.protobuf.GeneratedMessage implements // @@protoc_insertion_point(message_implements:google.api.RoutingParameter) RoutingParameterOrBuilder { private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "RoutingParameter"); + } + // Use RoutingParameter.newBuilder() to construct. - private RoutingParameter(com.google.protobuf.GeneratedMessageV3.Builder builder) { + private RoutingParameter(com.google.protobuf.GeneratedMessage.Builder builder) { super(builder); } @@ -42,23 +56,12 @@ private RoutingParameter() { pathTemplate_ = ""; } - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new RoutingParameter(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.api.RoutingProto.internal_static_google_api_RoutingParameter_descriptor; } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.api.RoutingProto .internal_static_google_api_RoutingParameter_fieldAccessorTable @@ -67,7 +70,10 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } public static final int FIELD_FIELD_NUMBER = 1; - private volatile java.lang.Object field_; + + @SuppressWarnings("serial") + private volatile java.lang.Object field_ = ""; + /** * * @@ -91,6 +97,7 @@ public java.lang.String getField() { return s; } } + /** * * @@ -116,7 +123,10 @@ public com.google.protobuf.ByteString getFieldBytes() { } public static final int PATH_TEMPLATE_FIELD_NUMBER = 2; - private volatile java.lang.Object pathTemplate_; + + @SuppressWarnings("serial") + private volatile java.lang.Object pathTemplate_ = ""; + /** * * @@ -130,42 +140,50 @@ public com.google.protobuf.ByteString getFieldBytes() { * - the name of the single named segment will be used as a header name, * - the match value of the segment will be used as a header value; * if the match is NOT successful, nothing will be sent. + * * Example: - * -- This is a field in the request message - * | that the header value will be extracted from. - * | - * | -- This is the key name in the - * | | routing header. - * V | - * field: "table_name" v - * path_template: "projects/*/{table_location=instances/*}/tables/*" - * ^ ^ - * | | - * In the {} brackets is the pattern that -- | - * specifies what to extract from the | - * field as a value to be sent. | - * | - * The string in the field must match the whole pattern -- - * before brackets, inside brackets, after brackets. + * + * -- This is a field in the request message + * | that the header value will be extracted from. + * | + * | -- This is the key name in the + * | | routing header. + * V | + * field: "table_name" v + * path_template: "projects/*/{table_location=instances/*}/tables/*" + * ^ ^ + * | | + * In the {} brackets is the pattern that -- | + * specifies what to extract from the | + * field as a value to be sent. | + * | + * The string in the field must match the whole pattern -- + * before brackets, inside brackets, after brackets. + * * When looking at this specific example, we can see that: * - A key-value pair with the key `table_location` - * and the value matching `instances/*` should be added - * to the x-goog-request-params routing header. + * and the value matching `instances/*` should be added + * to the x-goog-request-params routing header. * - The value is extracted from the request message's `table_name` field - * if it matches the full pattern specified: - * `projects/*/instances/*/tables/*`. + * if it matches the full pattern specified: + * `projects/*/instances/*/tables/*`. + * * **NB:** If the `path_template` field is not provided, the key name is * equal to the field name, and the whole field should be sent as a value. * This makes the pattern for the field and the value functionally equivalent * to `**`, and the configuration - * { - * field: "table_name" - * } + * + * { + * field: "table_name" + * } + * * is a functionally equivalent shorthand to: - * { - * field: "table_name" - * path_template: "{table_name=**}" - * } + * + * { + * field: "table_name" + * path_template: "{table_name=**}" + * } + * * See Example 1 for more details. *
        * @@ -185,6 +203,7 @@ public java.lang.String getPathTemplate() { return s; } } + /** * * @@ -198,42 +217,50 @@ public java.lang.String getPathTemplate() { * - the name of the single named segment will be used as a header name, * - the match value of the segment will be used as a header value; * if the match is NOT successful, nothing will be sent. + * * Example: - * -- This is a field in the request message - * | that the header value will be extracted from. - * | - * | -- This is the key name in the - * | | routing header. - * V | - * field: "table_name" v - * path_template: "projects/*/{table_location=instances/*}/tables/*" - * ^ ^ - * | | - * In the {} brackets is the pattern that -- | - * specifies what to extract from the | - * field as a value to be sent. | - * | - * The string in the field must match the whole pattern -- - * before brackets, inside brackets, after brackets. + * + * -- This is a field in the request message + * | that the header value will be extracted from. + * | + * | -- This is the key name in the + * | | routing header. + * V | + * field: "table_name" v + * path_template: "projects/*/{table_location=instances/*}/tables/*" + * ^ ^ + * | | + * In the {} brackets is the pattern that -- | + * specifies what to extract from the | + * field as a value to be sent. | + * | + * The string in the field must match the whole pattern -- + * before brackets, inside brackets, after brackets. + * * When looking at this specific example, we can see that: * - A key-value pair with the key `table_location` - * and the value matching `instances/*` should be added - * to the x-goog-request-params routing header. + * and the value matching `instances/*` should be added + * to the x-goog-request-params routing header. * - The value is extracted from the request message's `table_name` field - * if it matches the full pattern specified: - * `projects/*/instances/*/tables/*`. + * if it matches the full pattern specified: + * `projects/*/instances/*/tables/*`. + * * **NB:** If the `path_template` field is not provided, the key name is * equal to the field name, and the whole field should be sent as a value. * This makes the pattern for the field and the value functionally equivalent * to `**`, and the configuration - * { - * field: "table_name" - * } + * + * { + * field: "table_name" + * } + * * is a functionally equivalent shorthand to: - * { - * field: "table_name" - * path_template: "{table_name=**}" - * } + * + * { + * field: "table_name" + * path_template: "{table_name=**}" + * } + * * See Example 1 for more details. *
        * @@ -268,11 +295,11 @@ public final boolean isInitialized() { @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(field_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, field_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(field_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, field_); } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(pathTemplate_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 2, pathTemplate_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(pathTemplate_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, pathTemplate_); } getUnknownFields().writeTo(output); } @@ -283,11 +310,11 @@ public int getSerializedSize() { if (size != -1) return size; size = 0; - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(field_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, field_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(field_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, field_); } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(pathTemplate_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, pathTemplate_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(pathTemplate_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, pathTemplate_); } size += getUnknownFields().getSerializedSize(); memoizedSize = size; @@ -362,38 +389,38 @@ public static com.google.api.RoutingParameter parseFrom( public static com.google.api.RoutingParameter parseFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); } public static com.google.api.RoutingParameter parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } public static com.google.api.RoutingParameter parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); } public static com.google.api.RoutingParameter parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( PARSER, input, extensionRegistry); } public static com.google.api.RoutingParameter parseFrom( com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); } public static com.google.api.RoutingParameter parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } @@ -416,10 +443,11 @@ public Builder toBuilder() { } @java.lang.Override - protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { Builder builder = new Builder(parent); return builder; } + /** * * @@ -429,7 +457,7 @@ protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.Build * * Protobuf type {@code google.api.RoutingParameter} */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder implements // @@protoc_insertion_point(builder_implements:google.api.RoutingParameter) com.google.api.RoutingParameterOrBuilder { @@ -438,7 +466,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.api.RoutingProto .internal_static_google_api_RoutingParameter_fieldAccessorTable @@ -449,17 +477,16 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { // Construct using com.google.api.RoutingParameter.newBuilder() private Builder() {} - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { super(parent); } @java.lang.Override public Builder clear() { super.clear(); + bitField0_ = 0; field_ = ""; - pathTemplate_ = ""; - return this; } @@ -485,43 +512,21 @@ public com.google.api.RoutingParameter build() { @java.lang.Override public com.google.api.RoutingParameter buildPartial() { com.google.api.RoutingParameter result = new com.google.api.RoutingParameter(this); - result.field_ = field_; - result.pathTemplate_ = pathTemplate_; + if (bitField0_ != 0) { + buildPartial0(result); + } 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); + private void buildPartial0(com.google.api.RoutingParameter result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.field_ = field_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.pathTemplate_ = pathTemplate_; + } } @java.lang.Override @@ -538,10 +543,12 @@ public Builder mergeFrom(com.google.api.RoutingParameter other) { if (other == com.google.api.RoutingParameter.getDefaultInstance()) return this; if (!other.getField().isEmpty()) { field_ = other.field_; + bitField0_ |= 0x00000001; onChanged(); } if (!other.getPathTemplate().isEmpty()) { pathTemplate_ = other.pathTemplate_; + bitField0_ |= 0x00000002; onChanged(); } this.mergeUnknownFields(other.getUnknownFields()); @@ -573,13 +580,13 @@ public Builder mergeFrom( case 10: { field_ = input.readStringRequireUtf8(); - + bitField0_ |= 0x00000001; break; } // case 10 case 18: { pathTemplate_ = input.readStringRequireUtf8(); - + bitField0_ |= 0x00000002; break; } // case 18 default: @@ -599,7 +606,10 @@ public Builder mergeFrom( return this; } + private int bitField0_; + private java.lang.Object field_ = ""; + /** * * @@ -622,6 +632,7 @@ public java.lang.String getField() { return (java.lang.String) ref; } } + /** * * @@ -644,6 +655,7 @@ public com.google.protobuf.ByteString getFieldBytes() { return (com.google.protobuf.ByteString) ref; } } + /** * * @@ -660,11 +672,12 @@ public Builder setField(java.lang.String value) { if (value == null) { throw new NullPointerException(); } - field_ = value; + bitField0_ |= 0x00000001; onChanged(); return this; } + /** * * @@ -677,11 +690,12 @@ public Builder setField(java.lang.String value) { * @return This builder for chaining. */ public Builder clearField() { - field_ = getDefaultInstance().getField(); + bitField0_ = (bitField0_ & ~0x00000001); onChanged(); return this; } + /** * * @@ -699,13 +713,14 @@ public Builder setFieldBytes(com.google.protobuf.ByteString value) { throw new NullPointerException(); } checkByteStringIsUtf8(value); - field_ = value; + bitField0_ |= 0x00000001; onChanged(); return this; } private java.lang.Object pathTemplate_ = ""; + /** * * @@ -719,42 +734,50 @@ public Builder setFieldBytes(com.google.protobuf.ByteString value) { * - the name of the single named segment will be used as a header name, * - the match value of the segment will be used as a header value; * if the match is NOT successful, nothing will be sent. + * * Example: - * -- This is a field in the request message - * | that the header value will be extracted from. - * | - * | -- This is the key name in the - * | | routing header. - * V | - * field: "table_name" v - * path_template: "projects/*/{table_location=instances/*}/tables/*" - * ^ ^ - * | | - * In the {} brackets is the pattern that -- | - * specifies what to extract from the | - * field as a value to be sent. | - * | - * The string in the field must match the whole pattern -- - * before brackets, inside brackets, after brackets. + * + * -- This is a field in the request message + * | that the header value will be extracted from. + * | + * | -- This is the key name in the + * | | routing header. + * V | + * field: "table_name" v + * path_template: "projects/*/{table_location=instances/*}/tables/*" + * ^ ^ + * | | + * In the {} brackets is the pattern that -- | + * specifies what to extract from the | + * field as a value to be sent. | + * | + * The string in the field must match the whole pattern -- + * before brackets, inside brackets, after brackets. + * * When looking at this specific example, we can see that: * - A key-value pair with the key `table_location` - * and the value matching `instances/*` should be added - * to the x-goog-request-params routing header. + * and the value matching `instances/*` should be added + * to the x-goog-request-params routing header. * - The value is extracted from the request message's `table_name` field - * if it matches the full pattern specified: - * `projects/*/instances/*/tables/*`. + * if it matches the full pattern specified: + * `projects/*/instances/*/tables/*`. + * * **NB:** If the `path_template` field is not provided, the key name is * equal to the field name, and the whole field should be sent as a value. * This makes the pattern for the field and the value functionally equivalent * to `**`, and the configuration - * { - * field: "table_name" - * } + * + * { + * field: "table_name" + * } + * * is a functionally equivalent shorthand to: - * { - * field: "table_name" - * path_template: "{table_name=**}" - * } + * + * { + * field: "table_name" + * path_template: "{table_name=**}" + * } + * * See Example 1 for more details. *
        * @@ -773,6 +796,7 @@ public java.lang.String getPathTemplate() { return (java.lang.String) ref; } } + /** * * @@ -786,42 +810,50 @@ public java.lang.String getPathTemplate() { * - the name of the single named segment will be used as a header name, * - the match value of the segment will be used as a header value; * if the match is NOT successful, nothing will be sent. + * * Example: - * -- This is a field in the request message - * | that the header value will be extracted from. - * | - * | -- This is the key name in the - * | | routing header. - * V | - * field: "table_name" v - * path_template: "projects/*/{table_location=instances/*}/tables/*" - * ^ ^ - * | | - * In the {} brackets is the pattern that -- | - * specifies what to extract from the | - * field as a value to be sent. | - * | - * The string in the field must match the whole pattern -- - * before brackets, inside brackets, after brackets. + * + * -- This is a field in the request message + * | that the header value will be extracted from. + * | + * | -- This is the key name in the + * | | routing header. + * V | + * field: "table_name" v + * path_template: "projects/*/{table_location=instances/*}/tables/*" + * ^ ^ + * | | + * In the {} brackets is the pattern that -- | + * specifies what to extract from the | + * field as a value to be sent. | + * | + * The string in the field must match the whole pattern -- + * before brackets, inside brackets, after brackets. + * * When looking at this specific example, we can see that: * - A key-value pair with the key `table_location` - * and the value matching `instances/*` should be added - * to the x-goog-request-params routing header. + * and the value matching `instances/*` should be added + * to the x-goog-request-params routing header. * - The value is extracted from the request message's `table_name` field - * if it matches the full pattern specified: - * `projects/*/instances/*/tables/*`. + * if it matches the full pattern specified: + * `projects/*/instances/*/tables/*`. + * * **NB:** If the `path_template` field is not provided, the key name is * equal to the field name, and the whole field should be sent as a value. * This makes the pattern for the field and the value functionally equivalent * to `**`, and the configuration - * { - * field: "table_name" - * } + * + * { + * field: "table_name" + * } + * * is a functionally equivalent shorthand to: - * { - * field: "table_name" - * path_template: "{table_name=**}" - * } + * + * { + * field: "table_name" + * path_template: "{table_name=**}" + * } + * * See Example 1 for more details. *
        * @@ -840,6 +872,7 @@ public com.google.protobuf.ByteString getPathTemplateBytes() { return (com.google.protobuf.ByteString) ref; } } + /** * * @@ -853,42 +886,50 @@ public com.google.protobuf.ByteString getPathTemplateBytes() { * - the name of the single named segment will be used as a header name, * - the match value of the segment will be used as a header value; * if the match is NOT successful, nothing will be sent. + * * Example: - * -- This is a field in the request message - * | that the header value will be extracted from. - * | - * | -- This is the key name in the - * | | routing header. - * V | - * field: "table_name" v - * path_template: "projects/*/{table_location=instances/*}/tables/*" - * ^ ^ - * | | - * In the {} brackets is the pattern that -- | - * specifies what to extract from the | - * field as a value to be sent. | - * | - * The string in the field must match the whole pattern -- - * before brackets, inside brackets, after brackets. + * + * -- This is a field in the request message + * | that the header value will be extracted from. + * | + * | -- This is the key name in the + * | | routing header. + * V | + * field: "table_name" v + * path_template: "projects/*/{table_location=instances/*}/tables/*" + * ^ ^ + * | | + * In the {} brackets is the pattern that -- | + * specifies what to extract from the | + * field as a value to be sent. | + * | + * The string in the field must match the whole pattern -- + * before brackets, inside brackets, after brackets. + * * When looking at this specific example, we can see that: * - A key-value pair with the key `table_location` - * and the value matching `instances/*` should be added - * to the x-goog-request-params routing header. + * and the value matching `instances/*` should be added + * to the x-goog-request-params routing header. * - The value is extracted from the request message's `table_name` field - * if it matches the full pattern specified: - * `projects/*/instances/*/tables/*`. + * if it matches the full pattern specified: + * `projects/*/instances/*/tables/*`. + * * **NB:** If the `path_template` field is not provided, the key name is * equal to the field name, and the whole field should be sent as a value. * This makes the pattern for the field and the value functionally equivalent * to `**`, and the configuration - * { - * field: "table_name" - * } + * + * { + * field: "table_name" + * } + * * is a functionally equivalent shorthand to: - * { - * field: "table_name" - * path_template: "{table_name=**}" - * } + * + * { + * field: "table_name" + * path_template: "{table_name=**}" + * } + * * See Example 1 for more details. *
        * @@ -901,11 +942,12 @@ public Builder setPathTemplate(java.lang.String value) { if (value == null) { throw new NullPointerException(); } - pathTemplate_ = value; + bitField0_ |= 0x00000002; onChanged(); return this; } + /** * * @@ -919,42 +961,50 @@ public Builder setPathTemplate(java.lang.String value) { * - the name of the single named segment will be used as a header name, * - the match value of the segment will be used as a header value; * if the match is NOT successful, nothing will be sent. + * * Example: - * -- This is a field in the request message - * | that the header value will be extracted from. - * | - * | -- This is the key name in the - * | | routing header. - * V | - * field: "table_name" v - * path_template: "projects/*/{table_location=instances/*}/tables/*" - * ^ ^ - * | | - * In the {} brackets is the pattern that -- | - * specifies what to extract from the | - * field as a value to be sent. | - * | - * The string in the field must match the whole pattern -- - * before brackets, inside brackets, after brackets. + * + * -- This is a field in the request message + * | that the header value will be extracted from. + * | + * | -- This is the key name in the + * | | routing header. + * V | + * field: "table_name" v + * path_template: "projects/*/{table_location=instances/*}/tables/*" + * ^ ^ + * | | + * In the {} brackets is the pattern that -- | + * specifies what to extract from the | + * field as a value to be sent. | + * | + * The string in the field must match the whole pattern -- + * before brackets, inside brackets, after brackets. + * * When looking at this specific example, we can see that: * - A key-value pair with the key `table_location` - * and the value matching `instances/*` should be added - * to the x-goog-request-params routing header. + * and the value matching `instances/*` should be added + * to the x-goog-request-params routing header. * - The value is extracted from the request message's `table_name` field - * if it matches the full pattern specified: - * `projects/*/instances/*/tables/*`. + * if it matches the full pattern specified: + * `projects/*/instances/*/tables/*`. + * * **NB:** If the `path_template` field is not provided, the key name is * equal to the field name, and the whole field should be sent as a value. * This makes the pattern for the field and the value functionally equivalent * to `**`, and the configuration - * { - * field: "table_name" - * } + * + * { + * field: "table_name" + * } + * * is a functionally equivalent shorthand to: - * { - * field: "table_name" - * path_template: "{table_name=**}" - * } + * + * { + * field: "table_name" + * path_template: "{table_name=**}" + * } + * * See Example 1 for more details. *
        * @@ -963,11 +1013,12 @@ public Builder setPathTemplate(java.lang.String value) { * @return This builder for chaining. */ public Builder clearPathTemplate() { - pathTemplate_ = getDefaultInstance().getPathTemplate(); + bitField0_ = (bitField0_ & ~0x00000002); onChanged(); return this; } + /** * * @@ -981,42 +1032,50 @@ public Builder clearPathTemplate() { * - the name of the single named segment will be used as a header name, * - the match value of the segment will be used as a header value; * if the match is NOT successful, nothing will be sent. + * * Example: - * -- This is a field in the request message - * | that the header value will be extracted from. - * | - * | -- This is the key name in the - * | | routing header. - * V | - * field: "table_name" v - * path_template: "projects/*/{table_location=instances/*}/tables/*" - * ^ ^ - * | | - * In the {} brackets is the pattern that -- | - * specifies what to extract from the | - * field as a value to be sent. | - * | - * The string in the field must match the whole pattern -- - * before brackets, inside brackets, after brackets. + * + * -- This is a field in the request message + * | that the header value will be extracted from. + * | + * | -- This is the key name in the + * | | routing header. + * V | + * field: "table_name" v + * path_template: "projects/*/{table_location=instances/*}/tables/*" + * ^ ^ + * | | + * In the {} brackets is the pattern that -- | + * specifies what to extract from the | + * field as a value to be sent. | + * | + * The string in the field must match the whole pattern -- + * before brackets, inside brackets, after brackets. + * * When looking at this specific example, we can see that: * - A key-value pair with the key `table_location` - * and the value matching `instances/*` should be added - * to the x-goog-request-params routing header. + * and the value matching `instances/*` should be added + * to the x-goog-request-params routing header. * - The value is extracted from the request message's `table_name` field - * if it matches the full pattern specified: - * `projects/*/instances/*/tables/*`. + * if it matches the full pattern specified: + * `projects/*/instances/*/tables/*`. + * * **NB:** If the `path_template` field is not provided, the key name is * equal to the field name, and the whole field should be sent as a value. * This makes the pattern for the field and the value functionally equivalent * to `**`, and the configuration - * { - * field: "table_name" - * } + * + * { + * field: "table_name" + * } + * * is a functionally equivalent shorthand to: - * { - * field: "table_name" - * path_template: "{table_name=**}" - * } + * + * { + * field: "table_name" + * path_template: "{table_name=**}" + * } + * * See Example 1 for more details. *
        * @@ -1030,23 +1089,12 @@ public Builder setPathTemplateBytes(com.google.protobuf.ByteString value) { throw new NullPointerException(); } checkByteStringIsUtf8(value); - pathTemplate_ = 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.api.RoutingParameter) } diff --git a/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/RoutingParameterOrBuilder.java b/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/RoutingParameterOrBuilder.java index cb948dbd18..c810db5a0c 100644 --- a/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/RoutingParameterOrBuilder.java +++ b/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/RoutingParameterOrBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,10 +14,13 @@ * limitations under the License. */ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: google/api/routing.proto +// Protobuf Java Version: 4.33.2 package com.google.api; +@com.google.protobuf.Generated public interface RoutingParameterOrBuilder extends // @@protoc_insertion_point(interface_extends:google.api.RoutingParameter) @@ -35,6 +38,7 @@ public interface RoutingParameterOrBuilder * @return The field. */ java.lang.String getField(); + /** * * @@ -61,42 +65,50 @@ public interface RoutingParameterOrBuilder * - the name of the single named segment will be used as a header name, * - the match value of the segment will be used as a header value; * if the match is NOT successful, nothing will be sent. + * * Example: - * -- This is a field in the request message - * | that the header value will be extracted from. - * | - * | -- This is the key name in the - * | | routing header. - * V | - * field: "table_name" v - * path_template: "projects/*/{table_location=instances/*}/tables/*" - * ^ ^ - * | | - * In the {} brackets is the pattern that -- | - * specifies what to extract from the | - * field as a value to be sent. | - * | - * The string in the field must match the whole pattern -- - * before brackets, inside brackets, after brackets. + * + * -- This is a field in the request message + * | that the header value will be extracted from. + * | + * | -- This is the key name in the + * | | routing header. + * V | + * field: "table_name" v + * path_template: "projects/*/{table_location=instances/*}/tables/*" + * ^ ^ + * | | + * In the {} brackets is the pattern that -- | + * specifies what to extract from the | + * field as a value to be sent. | + * | + * The string in the field must match the whole pattern -- + * before brackets, inside brackets, after brackets. + * * When looking at this specific example, we can see that: * - A key-value pair with the key `table_location` - * and the value matching `instances/*` should be added - * to the x-goog-request-params routing header. + * and the value matching `instances/*` should be added + * to the x-goog-request-params routing header. * - The value is extracted from the request message's `table_name` field - * if it matches the full pattern specified: - * `projects/*/instances/*/tables/*`. + * if it matches the full pattern specified: + * `projects/*/instances/*/tables/*`. + * * **NB:** If the `path_template` field is not provided, the key name is * equal to the field name, and the whole field should be sent as a value. * This makes the pattern for the field and the value functionally equivalent * to `**`, and the configuration - * { - * field: "table_name" - * } + * + * { + * field: "table_name" + * } + * * is a functionally equivalent shorthand to: - * { - * field: "table_name" - * path_template: "{table_name=**}" - * } + * + * { + * field: "table_name" + * path_template: "{table_name=**}" + * } + * * See Example 1 for more details. *
        * @@ -105,6 +117,7 @@ public interface RoutingParameterOrBuilder * @return The pathTemplate. */ java.lang.String getPathTemplate(); + /** * * @@ -118,42 +131,50 @@ public interface RoutingParameterOrBuilder * - the name of the single named segment will be used as a header name, * - the match value of the segment will be used as a header value; * if the match is NOT successful, nothing will be sent. + * * Example: - * -- This is a field in the request message - * | that the header value will be extracted from. - * | - * | -- This is the key name in the - * | | routing header. - * V | - * field: "table_name" v - * path_template: "projects/*/{table_location=instances/*}/tables/*" - * ^ ^ - * | | - * In the {} brackets is the pattern that -- | - * specifies what to extract from the | - * field as a value to be sent. | - * | - * The string in the field must match the whole pattern -- - * before brackets, inside brackets, after brackets. + * + * -- This is a field in the request message + * | that the header value will be extracted from. + * | + * | -- This is the key name in the + * | | routing header. + * V | + * field: "table_name" v + * path_template: "projects/*/{table_location=instances/*}/tables/*" + * ^ ^ + * | | + * In the {} brackets is the pattern that -- | + * specifies what to extract from the | + * field as a value to be sent. | + * | + * The string in the field must match the whole pattern -- + * before brackets, inside brackets, after brackets. + * * When looking at this specific example, we can see that: * - A key-value pair with the key `table_location` - * and the value matching `instances/*` should be added - * to the x-goog-request-params routing header. + * and the value matching `instances/*` should be added + * to the x-goog-request-params routing header. * - The value is extracted from the request message's `table_name` field - * if it matches the full pattern specified: - * `projects/*/instances/*/tables/*`. + * if it matches the full pattern specified: + * `projects/*/instances/*/tables/*`. + * * **NB:** If the `path_template` field is not provided, the key name is * equal to the field name, and the whole field should be sent as a value. * This makes the pattern for the field and the value functionally equivalent * to `**`, and the configuration - * { - * field: "table_name" - * } + * + * { + * field: "table_name" + * } + * * is a functionally equivalent shorthand to: - * { - * field: "table_name" - * path_template: "{table_name=**}" - * } + * + * { + * field: "table_name" + * path_template: "{table_name=**}" + * } + * * See Example 1 for more details. * * diff --git a/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/RoutingProto.java b/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/RoutingProto.java index 31189bf5e6..4e7b377751 100644 --- a/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/RoutingProto.java +++ b/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/RoutingProto.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,13 +14,26 @@ * limitations under the License. */ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: google/api/routing.proto +// Protobuf Java Version: 4.33.2 package com.google.api; -public final class RoutingProto { +@com.google.protobuf.Generated +public final class RoutingProto extends com.google.protobuf.GeneratedFile { private RoutingProto() {} + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "RoutingProto"); + } + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistryLite registry) { registry.add(com.google.api.RoutingProto.routing); } @@ -30,6 +43,7 @@ public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry r } public static final int ROUTING_FIELD_NUMBER = 72295729; + /** * * @@ -47,11 +61,11 @@ public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry r static final com.google.protobuf.Descriptors.Descriptor internal_static_google_api_RoutingRule_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable internal_static_google_api_RoutingRule_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_google_api_RoutingParameter_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable internal_static_google_api_RoutingParameter_fieldAccessorTable; public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { @@ -79,22 +93,22 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { new com.google.protobuf.Descriptors.FileDescriptor[] { com.google.protobuf.DescriptorProtos.getDescriptor(), }); - internal_static_google_api_RoutingRule_descriptor = getDescriptor().getMessageTypes().get(0); + internal_static_google_api_RoutingRule_descriptor = getDescriptor().getMessageType(0); internal_static_google_api_RoutingRule_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_google_api_RoutingRule_descriptor, new java.lang.String[] { "RoutingParameters", }); - internal_static_google_api_RoutingParameter_descriptor = - getDescriptor().getMessageTypes().get(1); + internal_static_google_api_RoutingParameter_descriptor = getDescriptor().getMessageType(1); internal_static_google_api_RoutingParameter_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_google_api_RoutingParameter_descriptor, new java.lang.String[] { "Field", "PathTemplate", }); - routing.internalInit(descriptor.getExtensions().get(0)); + routing.internalInit(descriptor.getExtension(0)); + descriptor.resolveAllFeaturesImmutable(); com.google.protobuf.DescriptorProtos.getDescriptor(); } diff --git a/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/RoutingRule.java b/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/RoutingRule.java index 1a2c43771f..bc31392bb9 100644 --- a/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/RoutingRule.java +++ b/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/RoutingRule.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,9 @@ * limitations under the License. */ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: google/api/routing.proto +// Protobuf Java Version: 4.33.2 package com.google.api; @@ -25,281 +27,385 @@ * Specifies the routing information that should be sent along with the request * in the form of routing header. * **NOTE:** All service configuration rules follow the "last one wins" order. + * * The examples below will apply to an RPC which has the following request type: + * * Message Definition: - * message Request { - * // The name of the Table - * // Values can be of the following formats: - * // - `projects/<project>/tables/<table>` - * // - `projects/<project>/instances/<instance>/tables/<table>` - * // - `region/<region>/zones/<zone>/tables/<table>` - * string table_name = 1; - * // This value specifies routing for replication. - * // It can be in the following formats: - * // - `profiles/<profile_id>` - * // - a legacy `profile_id` that can be any string - * string app_profile_id = 2; - * } + * + * message Request { + * // The name of the Table + * // Values can be of the following formats: + * // - `projects/<project>/tables/<table>` + * // - `projects/<project>/instances/<instance>/tables/<table>` + * // - `region/<region>/zones/<zone>/tables/<table>` + * string table_name = 1; + * + * // This value specifies routing for replication. + * // It can be in the following formats: + * // - `profiles/<profile_id>` + * // - a legacy `profile_id` that can be any string + * string app_profile_id = 2; + * } + * * Example message: - * { - * table_name: projects/proj_foo/instances/instance_bar/table/table_baz, - * app_profile_id: profiles/prof_qux - * } + * + * { + * table_name: projects/proj_foo/instances/instance_bar/table/table_baz, + * app_profile_id: profiles/prof_qux + * } + * * The routing header consists of one or multiple key-value pairs. Every key * and value must be percent-encoded, and joined together in the format of * `key1=value1&key2=value2`. - * In the examples below I am skipping the percent-encoding for readablity. + * The examples below skip the percent-encoding for readability. + * * Example 1 + * * Extracting a field from the request to put into the routing header * unchanged, with the key equal to the field name. + * * annotation: - * option (google.api.routing) = { - * // Take the `app_profile_id`. - * routing_parameters { - * field: "app_profile_id" - * } - * }; + * + * option (google.api.routing) = { + * // Take the `app_profile_id`. + * routing_parameters { + * field: "app_profile_id" + * } + * }; + * * result: - * x-goog-request-params: app_profile_id=profiles/prof_qux + * + * x-goog-request-params: app_profile_id=profiles/prof_qux + * * Example 2 + * * Extracting a field from the request to put into the routing header * unchanged, with the key different from the field name. + * * annotation: - * option (google.api.routing) = { - * // Take the `app_profile_id`, but name it `routing_id` in the header. - * routing_parameters { - * field: "app_profile_id" - * path_template: "{routing_id=**}" - * } - * }; + * + * option (google.api.routing) = { + * // Take the `app_profile_id`, but name it `routing_id` in the header. + * routing_parameters { + * field: "app_profile_id" + * path_template: "{routing_id=**}" + * } + * }; + * * result: - * x-goog-request-params: routing_id=profiles/prof_qux + * + * x-goog-request-params: routing_id=profiles/prof_qux + * * Example 3 + * * Extracting a field from the request to put into the routing * header, while matching a path template syntax on the field's value. + * * NB: it is more useful to send nothing than to send garbage for the purpose * of dynamic routing, since garbage pollutes cache. Thus the matching. + * * Sub-example 3a + * * The field matches the template. + * * annotation: - * option (google.api.routing) = { - * // Take the `table_name`, if it's well-formed (with project-based - * // syntax). - * routing_parameters { - * field: "table_name" - * path_template: "{table_name=projects/*/instances/*/**}" - * } - * }; + * + * option (google.api.routing) = { + * // Take the `table_name`, if it's well-formed (with project-based + * // syntax). + * routing_parameters { + * field: "table_name" + * path_template: "{table_name=projects/*/instances/*/**}" + * } + * }; + * * result: - * x-goog-request-params: - * table_name=projects/proj_foo/instances/instance_bar/table/table_baz + * + * x-goog-request-params: + * table_name=projects/proj_foo/instances/instance_bar/table/table_baz + * * Sub-example 3b + * * The field does not match the template. + * * annotation: - * option (google.api.routing) = { - * // Take the `table_name`, if it's well-formed (with region-based - * // syntax). - * routing_parameters { - * field: "table_name" - * path_template: "{table_name=regions/*/zones/*/**}" - * } - * }; + * + * option (google.api.routing) = { + * // Take the `table_name`, if it's well-formed (with region-based + * // syntax). + * routing_parameters { + * field: "table_name" + * path_template: "{table_name=regions/*/zones/*/**}" + * } + * }; + * * result: - * <no routing header will be sent> + * + * <no routing header will be sent> + * * Sub-example 3c + * * Multiple alternative conflictingly named path templates are * specified. The one that matches is used to construct the header. + * * annotation: - * option (google.api.routing) = { - * // Take the `table_name`, if it's well-formed, whether - * // using the region- or projects-based syntax. - * routing_parameters { - * field: "table_name" - * path_template: "{table_name=regions/*/zones/*/**}" - * } - * routing_parameters { - * field: "table_name" - * path_template: "{table_name=projects/*/instances/*/**}" - * } - * }; + * + * option (google.api.routing) = { + * // Take the `table_name`, if it's well-formed, whether + * // using the region- or projects-based syntax. + * + * routing_parameters { + * field: "table_name" + * path_template: "{table_name=regions/*/zones/*/**}" + * } + * routing_parameters { + * field: "table_name" + * path_template: "{table_name=projects/*/instances/*/**}" + * } + * }; + * * result: - * x-goog-request-params: - * table_name=projects/proj_foo/instances/instance_bar/table/table_baz + * + * x-goog-request-params: + * table_name=projects/proj_foo/instances/instance_bar/table/table_baz + * * Example 4 + * * Extracting a single routing header key-value pair by matching a * template syntax on (a part of) a single request field. + * * annotation: - * option (google.api.routing) = { - * // Take just the project id from the `table_name` field. - * routing_parameters { - * field: "table_name" - * path_template: "{routing_id=projects/*}/**" - * } - * }; + * + * option (google.api.routing) = { + * // Take just the project id from the `table_name` field. + * routing_parameters { + * field: "table_name" + * path_template: "{routing_id=projects/*}/**" + * } + * }; + * * result: - * x-goog-request-params: routing_id=projects/proj_foo + * + * x-goog-request-params: routing_id=projects/proj_foo + * * Example 5 + * * Extracting a single routing header key-value pair by matching * several conflictingly named path templates on (parts of) a single request * field. The last template to match "wins" the conflict. + * * annotation: - * option (google.api.routing) = { - * // If the `table_name` does not have instances information, - * // take just the project id for routing. - * // Otherwise take project + instance. - * routing_parameters { - * field: "table_name" - * path_template: "{routing_id=projects/*}/**" - * } - * routing_parameters { - * field: "table_name" - * path_template: "{routing_id=projects/*/instances/*}/**" - * } - * }; + * + * option (google.api.routing) = { + * // If the `table_name` does not have instances information, + * // take just the project id for routing. + * // Otherwise take project + instance. + * + * routing_parameters { + * field: "table_name" + * path_template: "{routing_id=projects/*}/**" + * } + * routing_parameters { + * field: "table_name" + * path_template: "{routing_id=projects/*/instances/*}/**" + * } + * }; + * * result: - * x-goog-request-params: - * routing_id=projects/proj_foo/instances/instance_bar + * + * x-goog-request-params: + * routing_id=projects/proj_foo/instances/instance_bar + * * Example 6 + * * Extracting multiple routing header key-value pairs by matching * several non-conflicting path templates on (parts of) a single request field. + * * Sub-example 6a + * * Make the templates strict, so that if the `table_name` does not * have an instance information, nothing is sent. + * * annotation: - * option (google.api.routing) = { - * // The routing code needs two keys instead of one composite - * // but works only for the tables with the "project-instance" name - * // syntax. - * routing_parameters { - * field: "table_name" - * path_template: "{project_id=projects/*}/instances/*/**" - * } - * routing_parameters { - * field: "table_name" - * path_template: "projects/*/{instance_id=instances/*}/**" - * } - * }; + * + * option (google.api.routing) = { + * // The routing code needs two keys instead of one composite + * // but works only for the tables with the "project-instance" name + * // syntax. + * + * routing_parameters { + * field: "table_name" + * path_template: "{project_id=projects/*}/instances/*/**" + * } + * routing_parameters { + * field: "table_name" + * path_template: "projects/*/{instance_id=instances/*}/**" + * } + * }; + * * result: - * x-goog-request-params: - * project_id=projects/proj_foo&instance_id=instances/instance_bar + * + * x-goog-request-params: + * project_id=projects/proj_foo&instance_id=instances/instance_bar + * * Sub-example 6b + * * Make the templates loose, so that if the `table_name` does not * have an instance information, just the project id part is sent. + * * annotation: - * option (google.api.routing) = { - * // The routing code wants two keys instead of one composite - * // but will work with just the `project_id` for tables without - * // an instance in the `table_name`. - * routing_parameters { - * field: "table_name" - * path_template: "{project_id=projects/*}/**" - * } - * routing_parameters { - * field: "table_name" - * path_template: "projects/*/{instance_id=instances/*}/**" - * } - * }; + * + * option (google.api.routing) = { + * // The routing code wants two keys instead of one composite + * // but will work with just the `project_id` for tables without + * // an instance in the `table_name`. + * + * routing_parameters { + * field: "table_name" + * path_template: "{project_id=projects/*}/**" + * } + * routing_parameters { + * field: "table_name" + * path_template: "projects/*/{instance_id=instances/*}/**" + * } + * }; + * * result (is the same as 6a for our example message because it has the instance * information): - * x-goog-request-params: - * project_id=projects/proj_foo&instance_id=instances/instance_bar + * + * x-goog-request-params: + * project_id=projects/proj_foo&instance_id=instances/instance_bar + * * Example 7 + * * Extracting multiple routing header key-value pairs by matching * several path templates on multiple request fields. + * * NB: note that here there is no way to specify sending nothing if one of the * fields does not match its template. E.g. if the `table_name` is in the wrong * format, the `project_id` will not be sent, but the `routing_id` will be. * The backend routing code has to be aware of that and be prepared to not * receive a full complement of keys if it expects multiple. + * * annotation: - * option (google.api.routing) = { - * // The routing needs both `project_id` and `routing_id` - * // (from the `app_profile_id` field) for routing. - * routing_parameters { - * field: "table_name" - * path_template: "{project_id=projects/*}/**" - * } - * routing_parameters { - * field: "app_profile_id" - * path_template: "{routing_id=**}" - * } - * }; + * + * option (google.api.routing) = { + * // The routing needs both `project_id` and `routing_id` + * // (from the `app_profile_id` field) for routing. + * + * routing_parameters { + * field: "table_name" + * path_template: "{project_id=projects/*}/**" + * } + * routing_parameters { + * field: "app_profile_id" + * path_template: "{routing_id=**}" + * } + * }; + * * result: - * x-goog-request-params: - * project_id=projects/proj_foo&routing_id=profiles/prof_qux + * + * x-goog-request-params: + * project_id=projects/proj_foo&routing_id=profiles/prof_qux + * * Example 8 + * * Extracting a single routing header key-value pair by matching * several conflictingly named path templates on several request fields. The * last template to match "wins" the conflict. + * * annotation: - * option (google.api.routing) = { - * // The `routing_id` can be a project id or a region id depending on - * // the table name format, but only if the `app_profile_id` is not set. - * // If `app_profile_id` is set it should be used instead. - * routing_parameters { - * field: "table_name" - * path_template: "{routing_id=projects/*}/**" - * } - * routing_parameters { - * field: "table_name" - * path_template: "{routing_id=regions/*}/**" - * } - * routing_parameters { - * field: "app_profile_id" - * path_template: "{routing_id=**}" - * } - * }; + * + * option (google.api.routing) = { + * // The `routing_id` can be a project id or a region id depending on + * // the table name format, but only if the `app_profile_id` is not set. + * // If `app_profile_id` is set it should be used instead. + * + * routing_parameters { + * field: "table_name" + * path_template: "{routing_id=projects/*}/**" + * } + * routing_parameters { + * field: "table_name" + * path_template: "{routing_id=regions/*}/**" + * } + * routing_parameters { + * field: "app_profile_id" + * path_template: "{routing_id=**}" + * } + * }; + * * result: - * x-goog-request-params: routing_id=profiles/prof_qux + * + * x-goog-request-params: routing_id=profiles/prof_qux + * * Example 9 + * * Bringing it all together. + * * annotation: - * option (google.api.routing) = { - * // For routing both `table_location` and a `routing_id` are needed. - * // - * // table_location can be either an instance id or a region+zone id. - * // - * // For `routing_id`, take the value of `app_profile_id` - * // - If it's in the format `profiles/<profile_id>`, send - * // just the `<profile_id>` part. - * // - If it's any other literal, send it as is. - * // If the `app_profile_id` is empty, and the `table_name` starts with - * // the project_id, send that instead. - * routing_parameters { - * field: "table_name" - * path_template: "projects/*/{table_location=instances/*}/tables/*" - * } - * routing_parameters { - * field: "table_name" - * path_template: "{table_location=regions/*/zones/*}/tables/*" - * } - * routing_parameters { - * field: "table_name" - * path_template: "{routing_id=projects/*}/**" - * } - * routing_parameters { - * field: "app_profile_id" - * path_template: "{routing_id=**}" - * } - * routing_parameters { - * field: "app_profile_id" - * path_template: "profiles/{routing_id=*}" - * } - * }; + * + * option (google.api.routing) = { + * // For routing both `table_location` and a `routing_id` are needed. + * // + * // table_location can be either an instance id or a region+zone id. + * // + * // For `routing_id`, take the value of `app_profile_id` + * // - If it's in the format `profiles/<profile_id>`, send + * // just the `<profile_id>` part. + * // - If it's any other literal, send it as is. + * // If the `app_profile_id` is empty, and the `table_name` starts with + * // the project_id, send that instead. + * + * routing_parameters { + * field: "table_name" + * path_template: "projects/*/{table_location=instances/*}/tables/*" + * } + * routing_parameters { + * field: "table_name" + * path_template: "{table_location=regions/*/zones/*}/tables/*" + * } + * routing_parameters { + * field: "table_name" + * path_template: "{routing_id=projects/*}/**" + * } + * routing_parameters { + * field: "app_profile_id" + * path_template: "{routing_id=**}" + * } + * routing_parameters { + * field: "app_profile_id" + * path_template: "profiles/{routing_id=*}" + * } + * }; + * * result: - * x-goog-request-params: - * table_location=instances/instance_bar&routing_id=prof_qux + * + * x-goog-request-params: + * table_location=instances/instance_bar&routing_id=prof_qux * * * Protobuf type {@code google.api.RoutingRule} */ -public final class RoutingRule extends com.google.protobuf.GeneratedMessageV3 +@com.google.protobuf.Generated +public final class RoutingRule extends com.google.protobuf.GeneratedMessage implements // @@protoc_insertion_point(message_implements:google.api.RoutingRule) RoutingRuleOrBuilder { private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "RoutingRule"); + } + // Use RoutingRule.newBuilder() to construct. - private RoutingRule(com.google.protobuf.GeneratedMessageV3.Builder builder) { + private RoutingRule(com.google.protobuf.GeneratedMessage.Builder builder) { super(builder); } @@ -307,23 +413,12 @@ private RoutingRule() { routingParameters_ = java.util.Collections.emptyList(); } - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new RoutingRule(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.api.RoutingProto.internal_static_google_api_RoutingRule_descriptor; } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.api.RoutingProto.internal_static_google_api_RoutingRule_fieldAccessorTable .ensureFieldAccessorsInitialized( @@ -331,7 +426,10 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } public static final int ROUTING_PARAMETERS_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") private java.util.List routingParameters_; + /** * * @@ -350,6 +448,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { public java.util.List getRoutingParametersList() { return routingParameters_; } + /** * * @@ -369,6 +468,7 @@ public java.util.List getRoutingParametersList( getRoutingParametersOrBuilderList() { return routingParameters_; } + /** * * @@ -387,6 +487,7 @@ public java.util.List getRoutingParametersList( public int getRoutingParametersCount() { return routingParameters_.size(); } + /** * * @@ -405,6 +506,7 @@ public int getRoutingParametersCount() { public com.google.api.RoutingParameter getRoutingParameters(int index) { return routingParameters_.get(index); } + /** * * @@ -526,38 +628,38 @@ public static com.google.api.RoutingRule parseFrom( public static com.google.api.RoutingRule parseFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); } public static com.google.api.RoutingRule parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } public static com.google.api.RoutingRule parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); } public static com.google.api.RoutingRule parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( PARSER, input, extensionRegistry); } public static com.google.api.RoutingRule parseFrom(com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); } public static com.google.api.RoutingRule parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } @@ -580,10 +682,11 @@ public Builder toBuilder() { } @java.lang.Override - protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { Builder builder = new Builder(parent); return builder; } + /** * * @@ -591,275 +694,367 @@ protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.Build * Specifies the routing information that should be sent along with the request * in the form of routing header. * **NOTE:** All service configuration rules follow the "last one wins" order. + * * The examples below will apply to an RPC which has the following request type: + * * Message Definition: - * message Request { - * // The name of the Table - * // Values can be of the following formats: - * // - `projects/<project>/tables/<table>` - * // - `projects/<project>/instances/<instance>/tables/<table>` - * // - `region/<region>/zones/<zone>/tables/<table>` - * string table_name = 1; - * // This value specifies routing for replication. - * // It can be in the following formats: - * // - `profiles/<profile_id>` - * // - a legacy `profile_id` that can be any string - * string app_profile_id = 2; - * } + * + * message Request { + * // The name of the Table + * // Values can be of the following formats: + * // - `projects/<project>/tables/<table>` + * // - `projects/<project>/instances/<instance>/tables/<table>` + * // - `region/<region>/zones/<zone>/tables/<table>` + * string table_name = 1; + * + * // This value specifies routing for replication. + * // It can be in the following formats: + * // - `profiles/<profile_id>` + * // - a legacy `profile_id` that can be any string + * string app_profile_id = 2; + * } + * * Example message: - * { - * table_name: projects/proj_foo/instances/instance_bar/table/table_baz, - * app_profile_id: profiles/prof_qux - * } + * + * { + * table_name: projects/proj_foo/instances/instance_bar/table/table_baz, + * app_profile_id: profiles/prof_qux + * } + * * The routing header consists of one or multiple key-value pairs. Every key * and value must be percent-encoded, and joined together in the format of * `key1=value1&key2=value2`. - * In the examples below I am skipping the percent-encoding for readablity. + * The examples below skip the percent-encoding for readability. + * * Example 1 + * * Extracting a field from the request to put into the routing header * unchanged, with the key equal to the field name. + * * annotation: - * option (google.api.routing) = { - * // Take the `app_profile_id`. - * routing_parameters { - * field: "app_profile_id" - * } - * }; + * + * option (google.api.routing) = { + * // Take the `app_profile_id`. + * routing_parameters { + * field: "app_profile_id" + * } + * }; + * * result: - * x-goog-request-params: app_profile_id=profiles/prof_qux + * + * x-goog-request-params: app_profile_id=profiles/prof_qux + * * Example 2 + * * Extracting a field from the request to put into the routing header * unchanged, with the key different from the field name. + * * annotation: - * option (google.api.routing) = { - * // Take the `app_profile_id`, but name it `routing_id` in the header. - * routing_parameters { - * field: "app_profile_id" - * path_template: "{routing_id=**}" - * } - * }; + * + * option (google.api.routing) = { + * // Take the `app_profile_id`, but name it `routing_id` in the header. + * routing_parameters { + * field: "app_profile_id" + * path_template: "{routing_id=**}" + * } + * }; + * * result: - * x-goog-request-params: routing_id=profiles/prof_qux + * + * x-goog-request-params: routing_id=profiles/prof_qux + * * Example 3 + * * Extracting a field from the request to put into the routing * header, while matching a path template syntax on the field's value. + * * NB: it is more useful to send nothing than to send garbage for the purpose * of dynamic routing, since garbage pollutes cache. Thus the matching. + * * Sub-example 3a + * * The field matches the template. + * * annotation: - * option (google.api.routing) = { - * // Take the `table_name`, if it's well-formed (with project-based - * // syntax). - * routing_parameters { - * field: "table_name" - * path_template: "{table_name=projects/*/instances/*/**}" - * } - * }; + * + * option (google.api.routing) = { + * // Take the `table_name`, if it's well-formed (with project-based + * // syntax). + * routing_parameters { + * field: "table_name" + * path_template: "{table_name=projects/*/instances/*/**}" + * } + * }; + * * result: - * x-goog-request-params: - * table_name=projects/proj_foo/instances/instance_bar/table/table_baz + * + * x-goog-request-params: + * table_name=projects/proj_foo/instances/instance_bar/table/table_baz + * * Sub-example 3b + * * The field does not match the template. + * * annotation: - * option (google.api.routing) = { - * // Take the `table_name`, if it's well-formed (with region-based - * // syntax). - * routing_parameters { - * field: "table_name" - * path_template: "{table_name=regions/*/zones/*/**}" - * } - * }; + * + * option (google.api.routing) = { + * // Take the `table_name`, if it's well-formed (with region-based + * // syntax). + * routing_parameters { + * field: "table_name" + * path_template: "{table_name=regions/*/zones/*/**}" + * } + * }; + * * result: - * <no routing header will be sent> + * + * <no routing header will be sent> + * * Sub-example 3c + * * Multiple alternative conflictingly named path templates are * specified. The one that matches is used to construct the header. + * * annotation: - * option (google.api.routing) = { - * // Take the `table_name`, if it's well-formed, whether - * // using the region- or projects-based syntax. - * routing_parameters { - * field: "table_name" - * path_template: "{table_name=regions/*/zones/*/**}" - * } - * routing_parameters { - * field: "table_name" - * path_template: "{table_name=projects/*/instances/*/**}" - * } - * }; + * + * option (google.api.routing) = { + * // Take the `table_name`, if it's well-formed, whether + * // using the region- or projects-based syntax. + * + * routing_parameters { + * field: "table_name" + * path_template: "{table_name=regions/*/zones/*/**}" + * } + * routing_parameters { + * field: "table_name" + * path_template: "{table_name=projects/*/instances/*/**}" + * } + * }; + * * result: - * x-goog-request-params: - * table_name=projects/proj_foo/instances/instance_bar/table/table_baz + * + * x-goog-request-params: + * table_name=projects/proj_foo/instances/instance_bar/table/table_baz + * * Example 4 + * * Extracting a single routing header key-value pair by matching a * template syntax on (a part of) a single request field. + * * annotation: - * option (google.api.routing) = { - * // Take just the project id from the `table_name` field. - * routing_parameters { - * field: "table_name" - * path_template: "{routing_id=projects/*}/**" - * } - * }; + * + * option (google.api.routing) = { + * // Take just the project id from the `table_name` field. + * routing_parameters { + * field: "table_name" + * path_template: "{routing_id=projects/*}/**" + * } + * }; + * * result: - * x-goog-request-params: routing_id=projects/proj_foo + * + * x-goog-request-params: routing_id=projects/proj_foo + * * Example 5 + * * Extracting a single routing header key-value pair by matching * several conflictingly named path templates on (parts of) a single request * field. The last template to match "wins" the conflict. + * * annotation: - * option (google.api.routing) = { - * // If the `table_name` does not have instances information, - * // take just the project id for routing. - * // Otherwise take project + instance. - * routing_parameters { - * field: "table_name" - * path_template: "{routing_id=projects/*}/**" - * } - * routing_parameters { - * field: "table_name" - * path_template: "{routing_id=projects/*/instances/*}/**" - * } - * }; + * + * option (google.api.routing) = { + * // If the `table_name` does not have instances information, + * // take just the project id for routing. + * // Otherwise take project + instance. + * + * routing_parameters { + * field: "table_name" + * path_template: "{routing_id=projects/*}/**" + * } + * routing_parameters { + * field: "table_name" + * path_template: "{routing_id=projects/*/instances/*}/**" + * } + * }; + * * result: - * x-goog-request-params: - * routing_id=projects/proj_foo/instances/instance_bar + * + * x-goog-request-params: + * routing_id=projects/proj_foo/instances/instance_bar + * * Example 6 + * * Extracting multiple routing header key-value pairs by matching * several non-conflicting path templates on (parts of) a single request field. + * * Sub-example 6a + * * Make the templates strict, so that if the `table_name` does not * have an instance information, nothing is sent. + * * annotation: - * option (google.api.routing) = { - * // The routing code needs two keys instead of one composite - * // but works only for the tables with the "project-instance" name - * // syntax. - * routing_parameters { - * field: "table_name" - * path_template: "{project_id=projects/*}/instances/*/**" - * } - * routing_parameters { - * field: "table_name" - * path_template: "projects/*/{instance_id=instances/*}/**" - * } - * }; + * + * option (google.api.routing) = { + * // The routing code needs two keys instead of one composite + * // but works only for the tables with the "project-instance" name + * // syntax. + * + * routing_parameters { + * field: "table_name" + * path_template: "{project_id=projects/*}/instances/*/**" + * } + * routing_parameters { + * field: "table_name" + * path_template: "projects/*/{instance_id=instances/*}/**" + * } + * }; + * * result: - * x-goog-request-params: - * project_id=projects/proj_foo&instance_id=instances/instance_bar + * + * x-goog-request-params: + * project_id=projects/proj_foo&instance_id=instances/instance_bar + * * Sub-example 6b + * * Make the templates loose, so that if the `table_name` does not * have an instance information, just the project id part is sent. + * * annotation: - * option (google.api.routing) = { - * // The routing code wants two keys instead of one composite - * // but will work with just the `project_id` for tables without - * // an instance in the `table_name`. - * routing_parameters { - * field: "table_name" - * path_template: "{project_id=projects/*}/**" - * } - * routing_parameters { - * field: "table_name" - * path_template: "projects/*/{instance_id=instances/*}/**" - * } - * }; + * + * option (google.api.routing) = { + * // The routing code wants two keys instead of one composite + * // but will work with just the `project_id` for tables without + * // an instance in the `table_name`. + * + * routing_parameters { + * field: "table_name" + * path_template: "{project_id=projects/*}/**" + * } + * routing_parameters { + * field: "table_name" + * path_template: "projects/*/{instance_id=instances/*}/**" + * } + * }; + * * result (is the same as 6a for our example message because it has the instance * information): - * x-goog-request-params: - * project_id=projects/proj_foo&instance_id=instances/instance_bar + * + * x-goog-request-params: + * project_id=projects/proj_foo&instance_id=instances/instance_bar + * * Example 7 + * * Extracting multiple routing header key-value pairs by matching * several path templates on multiple request fields. + * * NB: note that here there is no way to specify sending nothing if one of the * fields does not match its template. E.g. if the `table_name` is in the wrong * format, the `project_id` will not be sent, but the `routing_id` will be. * The backend routing code has to be aware of that and be prepared to not * receive a full complement of keys if it expects multiple. + * * annotation: - * option (google.api.routing) = { - * // The routing needs both `project_id` and `routing_id` - * // (from the `app_profile_id` field) for routing. - * routing_parameters { - * field: "table_name" - * path_template: "{project_id=projects/*}/**" - * } - * routing_parameters { - * field: "app_profile_id" - * path_template: "{routing_id=**}" - * } - * }; + * + * option (google.api.routing) = { + * // The routing needs both `project_id` and `routing_id` + * // (from the `app_profile_id` field) for routing. + * + * routing_parameters { + * field: "table_name" + * path_template: "{project_id=projects/*}/**" + * } + * routing_parameters { + * field: "app_profile_id" + * path_template: "{routing_id=**}" + * } + * }; + * * result: - * x-goog-request-params: - * project_id=projects/proj_foo&routing_id=profiles/prof_qux + * + * x-goog-request-params: + * project_id=projects/proj_foo&routing_id=profiles/prof_qux + * * Example 8 + * * Extracting a single routing header key-value pair by matching * several conflictingly named path templates on several request fields. The * last template to match "wins" the conflict. + * * annotation: - * option (google.api.routing) = { - * // The `routing_id` can be a project id or a region id depending on - * // the table name format, but only if the `app_profile_id` is not set. - * // If `app_profile_id` is set it should be used instead. - * routing_parameters { - * field: "table_name" - * path_template: "{routing_id=projects/*}/**" - * } - * routing_parameters { - * field: "table_name" - * path_template: "{routing_id=regions/*}/**" - * } - * routing_parameters { - * field: "app_profile_id" - * path_template: "{routing_id=**}" - * } - * }; + * + * option (google.api.routing) = { + * // The `routing_id` can be a project id or a region id depending on + * // the table name format, but only if the `app_profile_id` is not set. + * // If `app_profile_id` is set it should be used instead. + * + * routing_parameters { + * field: "table_name" + * path_template: "{routing_id=projects/*}/**" + * } + * routing_parameters { + * field: "table_name" + * path_template: "{routing_id=regions/*}/**" + * } + * routing_parameters { + * field: "app_profile_id" + * path_template: "{routing_id=**}" + * } + * }; + * * result: - * x-goog-request-params: routing_id=profiles/prof_qux + * + * x-goog-request-params: routing_id=profiles/prof_qux + * * Example 9 + * * Bringing it all together. + * * annotation: - * option (google.api.routing) = { - * // For routing both `table_location` and a `routing_id` are needed. - * // - * // table_location can be either an instance id or a region+zone id. - * // - * // For `routing_id`, take the value of `app_profile_id` - * // - If it's in the format `profiles/<profile_id>`, send - * // just the `<profile_id>` part. - * // - If it's any other literal, send it as is. - * // If the `app_profile_id` is empty, and the `table_name` starts with - * // the project_id, send that instead. - * routing_parameters { - * field: "table_name" - * path_template: "projects/*/{table_location=instances/*}/tables/*" - * } - * routing_parameters { - * field: "table_name" - * path_template: "{table_location=regions/*/zones/*}/tables/*" - * } - * routing_parameters { - * field: "table_name" - * path_template: "{routing_id=projects/*}/**" - * } - * routing_parameters { - * field: "app_profile_id" - * path_template: "{routing_id=**}" - * } - * routing_parameters { - * field: "app_profile_id" - * path_template: "profiles/{routing_id=*}" - * } - * }; + * + * option (google.api.routing) = { + * // For routing both `table_location` and a `routing_id` are needed. + * // + * // table_location can be either an instance id or a region+zone id. + * // + * // For `routing_id`, take the value of `app_profile_id` + * // - If it's in the format `profiles/<profile_id>`, send + * // just the `<profile_id>` part. + * // - If it's any other literal, send it as is. + * // If the `app_profile_id` is empty, and the `table_name` starts with + * // the project_id, send that instead. + * + * routing_parameters { + * field: "table_name" + * path_template: "projects/*/{table_location=instances/*}/tables/*" + * } + * routing_parameters { + * field: "table_name" + * path_template: "{table_location=regions/*/zones/*}/tables/*" + * } + * routing_parameters { + * field: "table_name" + * path_template: "{routing_id=projects/*}/**" + * } + * routing_parameters { + * field: "app_profile_id" + * path_template: "{routing_id=**}" + * } + * routing_parameters { + * field: "app_profile_id" + * path_template: "profiles/{routing_id=*}" + * } + * }; + * * result: - * x-goog-request-params: - * table_location=instances/instance_bar&routing_id=prof_qux + * + * x-goog-request-params: + * table_location=instances/instance_bar&routing_id=prof_qux * * * Protobuf type {@code google.api.RoutingRule} */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder implements // @@protoc_insertion_point(builder_implements:google.api.RoutingRule) com.google.api.RoutingRuleOrBuilder { @@ -868,7 +1063,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.api.RoutingProto.internal_static_google_api_RoutingRule_fieldAccessorTable .ensureFieldAccessorsInitialized( @@ -878,13 +1073,14 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { // Construct using com.google.api.RoutingRule.newBuilder() private Builder() {} - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { super(parent); } @java.lang.Override public Builder clear() { super.clear(); + bitField0_ = 0; if (routingParametersBuilder_ == null) { routingParameters_ = java.util.Collections.emptyList(); } else { @@ -917,7 +1113,15 @@ public com.google.api.RoutingRule build() { @java.lang.Override public com.google.api.RoutingRule buildPartial() { com.google.api.RoutingRule result = new com.google.api.RoutingRule(this); - int from_bitField0_ = bitField0_; + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields(com.google.api.RoutingRule result) { if (routingParametersBuilder_ == null) { if (((bitField0_ & 0x00000001) != 0)) { routingParameters_ = java.util.Collections.unmodifiableList(routingParameters_); @@ -927,41 +1131,10 @@ public com.google.api.RoutingRule buildPartial() { } else { result.routingParameters_ = routingParametersBuilder_.build(); } - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.setField(field, value); - } - - @java.lang.Override - public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); } - @java.lang.Override - public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.addRepeatedField(field, value); + private void buildPartial0(com.google.api.RoutingRule result) { + int from_bitField0_ = bitField0_; } @java.lang.Override @@ -995,8 +1168,8 @@ public Builder mergeFrom(com.google.api.RoutingRule other) { routingParameters_ = other.routingParameters_; bitField0_ = (bitField0_ & ~0x00000001); routingParametersBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders - ? getRoutingParametersFieldBuilder() + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders + ? internalGetRoutingParametersFieldBuilder() : null; } else { routingParametersBuilder_.addAllMessages(other.routingParameters_); @@ -1071,7 +1244,7 @@ private void ensureRoutingParametersIsMutable() { } } - private com.google.protobuf.RepeatedFieldBuilderV3< + private com.google.protobuf.RepeatedFieldBuilder< com.google.api.RoutingParameter, com.google.api.RoutingParameter.Builder, com.google.api.RoutingParameterOrBuilder> @@ -1098,6 +1271,7 @@ public java.util.List getRoutingParametersList( return routingParametersBuilder_.getMessageList(); } } + /** * * @@ -1119,6 +1293,7 @@ public int getRoutingParametersCount() { return routingParametersBuilder_.getCount(); } } + /** * * @@ -1140,6 +1315,7 @@ public com.google.api.RoutingParameter getRoutingParameters(int index) { return routingParametersBuilder_.getMessage(index); } } + /** * * @@ -1167,6 +1343,7 @@ public Builder setRoutingParameters(int index, com.google.api.RoutingParameter v } return this; } + /** * * @@ -1192,6 +1369,7 @@ public Builder setRoutingParameters( } return this; } + /** * * @@ -1219,6 +1397,7 @@ public Builder addRoutingParameters(com.google.api.RoutingParameter value) { } return this; } + /** * * @@ -1246,6 +1425,7 @@ public Builder addRoutingParameters(int index, com.google.api.RoutingParameter v } return this; } + /** * * @@ -1270,6 +1450,7 @@ public Builder addRoutingParameters(com.google.api.RoutingParameter.Builder buil } return this; } + /** * * @@ -1295,6 +1476,7 @@ public Builder addRoutingParameters( } return this; } + /** * * @@ -1320,6 +1502,7 @@ public Builder addAllRoutingParameters( } return this; } + /** * * @@ -1344,6 +1527,7 @@ public Builder clearRoutingParameters() { } return this; } + /** * * @@ -1368,6 +1552,7 @@ public Builder removeRoutingParameters(int index) { } return this; } + /** * * @@ -1383,8 +1568,9 @@ public Builder removeRoutingParameters(int index) { * repeated .google.api.RoutingParameter routing_parameters = 2; */ public com.google.api.RoutingParameter.Builder getRoutingParametersBuilder(int index) { - return getRoutingParametersFieldBuilder().getBuilder(index); + return internalGetRoutingParametersFieldBuilder().getBuilder(index); } + /** * * @@ -1406,6 +1592,7 @@ public com.google.api.RoutingParameterOrBuilder getRoutingParametersOrBuilder(in return routingParametersBuilder_.getMessageOrBuilder(index); } } + /** * * @@ -1428,6 +1615,7 @@ public com.google.api.RoutingParameterOrBuilder getRoutingParametersOrBuilder(in return java.util.Collections.unmodifiableList(routingParameters_); } } + /** * * @@ -1443,9 +1631,10 @@ public com.google.api.RoutingParameterOrBuilder getRoutingParametersOrBuilder(in * repeated .google.api.RoutingParameter routing_parameters = 2; */ public com.google.api.RoutingParameter.Builder addRoutingParametersBuilder() { - return getRoutingParametersFieldBuilder() + return internalGetRoutingParametersFieldBuilder() .addBuilder(com.google.api.RoutingParameter.getDefaultInstance()); } + /** * * @@ -1461,9 +1650,10 @@ public com.google.api.RoutingParameter.Builder addRoutingParametersBuilder() { * repeated .google.api.RoutingParameter routing_parameters = 2; */ public com.google.api.RoutingParameter.Builder addRoutingParametersBuilder(int index) { - return getRoutingParametersFieldBuilder() + return internalGetRoutingParametersFieldBuilder() .addBuilder(index, com.google.api.RoutingParameter.getDefaultInstance()); } + /** * * @@ -1480,17 +1670,17 @@ public com.google.api.RoutingParameter.Builder addRoutingParametersBuilder(int i */ public java.util.List getRoutingParametersBuilderList() { - return getRoutingParametersFieldBuilder().getBuilderList(); + return internalGetRoutingParametersFieldBuilder().getBuilderList(); } - private com.google.protobuf.RepeatedFieldBuilderV3< + private com.google.protobuf.RepeatedFieldBuilder< com.google.api.RoutingParameter, com.google.api.RoutingParameter.Builder, com.google.api.RoutingParameterOrBuilder> - getRoutingParametersFieldBuilder() { + internalGetRoutingParametersFieldBuilder() { if (routingParametersBuilder_ == null) { routingParametersBuilder_ = - new com.google.protobuf.RepeatedFieldBuilderV3< + new com.google.protobuf.RepeatedFieldBuilder< com.google.api.RoutingParameter, com.google.api.RoutingParameter.Builder, com.google.api.RoutingParameterOrBuilder>( @@ -1503,17 +1693,6 @@ public com.google.api.RoutingParameter.Builder addRoutingParametersBuilder(int i return routingParametersBuilder_; } - @java.lang.Override - public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - // @@protoc_insertion_point(builder_scope:google.api.RoutingRule) } diff --git a/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/RoutingRuleOrBuilder.java b/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/RoutingRuleOrBuilder.java index 76b09e5eea..70a1c60691 100644 --- a/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/RoutingRuleOrBuilder.java +++ b/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/RoutingRuleOrBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,10 +14,13 @@ * limitations under the License. */ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: google/api/routing.proto +// Protobuf Java Version: 4.33.2 package com.google.api; +@com.google.protobuf.Generated public interface RoutingRuleOrBuilder extends // @@protoc_insertion_point(interface_extends:google.api.RoutingRule) @@ -38,6 +41,7 @@ public interface RoutingRuleOrBuilder * repeated .google.api.RoutingParameter routing_parameters = 2; */ java.util.List getRoutingParametersList(); + /** * * @@ -53,6 +57,7 @@ public interface RoutingRuleOrBuilder * repeated .google.api.RoutingParameter routing_parameters = 2; */ com.google.api.RoutingParameter getRoutingParameters(int index); + /** * * @@ -68,6 +73,7 @@ public interface RoutingRuleOrBuilder * repeated .google.api.RoutingParameter routing_parameters = 2; */ int getRoutingParametersCount(); + /** * * @@ -84,6 +90,7 @@ public interface RoutingRuleOrBuilder */ java.util.List getRoutingParametersOrBuilderList(); + /** * * diff --git a/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/RubySettings.java b/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/RubySettings.java index 11ef218bba..df23e3d582 100644 --- a/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/RubySettings.java +++ b/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/RubySettings.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,9 @@ * limitations under the License. */ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: google/api/client.proto +// Protobuf Java Version: 4.33.2 package com.google.api; @@ -27,43 +29,46 @@ * * Protobuf type {@code google.api.RubySettings} */ -public final class RubySettings extends com.google.protobuf.GeneratedMessageV3 +@com.google.protobuf.Generated +public final class RubySettings extends com.google.protobuf.GeneratedMessage implements // @@protoc_insertion_point(message_implements:google.api.RubySettings) RubySettingsOrBuilder { private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "RubySettings"); + } + // Use RubySettings.newBuilder() to construct. - private RubySettings(com.google.protobuf.GeneratedMessageV3.Builder builder) { + private RubySettings(com.google.protobuf.GeneratedMessage.Builder builder) { super(builder); } private RubySettings() {} - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new RubySettings(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.api.ClientProto.internal_static_google_api_RubySettings_descriptor; } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.api.ClientProto.internal_static_google_api_RubySettings_fieldAccessorTable .ensureFieldAccessorsInitialized( com.google.api.RubySettings.class, com.google.api.RubySettings.Builder.class); } + private int bitField0_; public static final int COMMON_FIELD_NUMBER = 1; private com.google.api.CommonLanguageSettings common_; + /** * * @@ -77,8 +82,9 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { */ @java.lang.Override public boolean hasCommon() { - return common_ != null; + return ((bitField0_ & 0x00000001) != 0); } + /** * * @@ -94,6 +100,7 @@ public boolean hasCommon() { public com.google.api.CommonLanguageSettings getCommon() { return common_ == null ? com.google.api.CommonLanguageSettings.getDefaultInstance() : common_; } + /** * * @@ -105,7 +112,7 @@ public com.google.api.CommonLanguageSettings getCommon() { */ @java.lang.Override public com.google.api.CommonLanguageSettingsOrBuilder getCommonOrBuilder() { - return getCommon(); + return common_ == null ? com.google.api.CommonLanguageSettings.getDefaultInstance() : common_; } private byte memoizedIsInitialized = -1; @@ -122,7 +129,7 @@ public final boolean isInitialized() { @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (common_ != null) { + if (((bitField0_ & 0x00000001) != 0)) { output.writeMessage(1, getCommon()); } getUnknownFields().writeTo(output); @@ -134,7 +141,7 @@ public int getSerializedSize() { if (size != -1) return size; size = 0; - if (common_ != null) { + if (((bitField0_ & 0x00000001) != 0)) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getCommon()); } size += getUnknownFields().getSerializedSize(); @@ -212,38 +219,38 @@ public static com.google.api.RubySettings parseFrom( public static com.google.api.RubySettings parseFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); } public static com.google.api.RubySettings parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } public static com.google.api.RubySettings parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); } public static com.google.api.RubySettings parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( PARSER, input, extensionRegistry); } public static com.google.api.RubySettings parseFrom(com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); } public static com.google.api.RubySettings parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } @@ -266,10 +273,11 @@ public Builder toBuilder() { } @java.lang.Override - protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { Builder builder = new Builder(parent); return builder; } + /** * * @@ -279,7 +287,7 @@ protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.Build * * Protobuf type {@code google.api.RubySettings} */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder implements // @@protoc_insertion_point(builder_implements:google.api.RubySettings) com.google.api.RubySettingsOrBuilder { @@ -288,7 +296,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.api.ClientProto.internal_static_google_api_RubySettings_fieldAccessorTable .ensureFieldAccessorsInitialized( @@ -296,19 +304,28 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } // Construct using com.google.api.RubySettings.newBuilder() - private Builder() {} + private Builder() { + maybeForceBuilderInitialization(); + } - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetCommonFieldBuilder(); + } } @java.lang.Override public Builder clear() { super.clear(); - if (commonBuilder_ == null) { - common_ = null; - } else { - common_ = null; + bitField0_ = 0; + common_ = null; + if (commonBuilder_ != null) { + commonBuilder_.dispose(); commonBuilder_ = null; } return this; @@ -336,46 +353,21 @@ public com.google.api.RubySettings build() { @java.lang.Override public com.google.api.RubySettings buildPartial() { com.google.api.RubySettings result = new com.google.api.RubySettings(this); - if (commonBuilder_ == null) { - result.common_ = common_; - } else { - result.common_ = commonBuilder_.build(); + if (bitField0_ != 0) { + buildPartial0(result); } 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); + private void buildPartial0(com.google.api.RubySettings result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.common_ = commonBuilder_ == null ? common_ : commonBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + result.bitField0_ |= to_bitField0_; } @java.lang.Override @@ -421,8 +413,8 @@ public Builder mergeFrom( break; case 10: { - input.readMessage(getCommonFieldBuilder().getBuilder(), extensionRegistry); - + input.readMessage(internalGetCommonFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000001; break; } // case 10 default: @@ -442,12 +434,15 @@ public Builder mergeFrom( return this; } + private int bitField0_; + private com.google.api.CommonLanguageSettings common_; - private com.google.protobuf.SingleFieldBuilderV3< + private com.google.protobuf.SingleFieldBuilder< com.google.api.CommonLanguageSettings, com.google.api.CommonLanguageSettings.Builder, com.google.api.CommonLanguageSettingsOrBuilder> commonBuilder_; + /** * * @@ -460,8 +455,9 @@ public Builder mergeFrom( * @return Whether the common field is set. */ public boolean hasCommon() { - return commonBuilder_ != null || common_ != null; + return ((bitField0_ & 0x00000001) != 0); } + /** * * @@ -482,6 +478,7 @@ public com.google.api.CommonLanguageSettings getCommon() { return commonBuilder_.getMessage(); } } + /** * * @@ -497,13 +494,14 @@ public Builder setCommon(com.google.api.CommonLanguageSettings value) { throw new NullPointerException(); } common_ = value; - onChanged(); } else { commonBuilder_.setMessage(value); } - + bitField0_ |= 0x00000001; + onChanged(); return this; } + /** * * @@ -516,13 +514,14 @@ public Builder setCommon(com.google.api.CommonLanguageSettings value) { public Builder setCommon(com.google.api.CommonLanguageSettings.Builder builderForValue) { if (commonBuilder_ == null) { common_ = builderForValue.build(); - onChanged(); } else { commonBuilder_.setMessage(builderForValue.build()); } - + bitField0_ |= 0x00000001; + onChanged(); return this; } + /** * * @@ -534,21 +533,23 @@ public Builder setCommon(com.google.api.CommonLanguageSettings.Builder builderFo */ public Builder mergeCommon(com.google.api.CommonLanguageSettings value) { if (commonBuilder_ == null) { - if (common_ != null) { - common_ = - com.google.api.CommonLanguageSettings.newBuilder(common_) - .mergeFrom(value) - .buildPartial(); + if (((bitField0_ & 0x00000001) != 0) + && common_ != null + && common_ != com.google.api.CommonLanguageSettings.getDefaultInstance()) { + getCommonBuilder().mergeFrom(value); } else { common_ = value; } - onChanged(); } else { commonBuilder_.mergeFrom(value); } - + if (common_ != null) { + bitField0_ |= 0x00000001; + onChanged(); + } return this; } + /** * * @@ -559,16 +560,16 @@ public Builder mergeCommon(com.google.api.CommonLanguageSettings value) { * .google.api.CommonLanguageSettings common = 1; */ public Builder clearCommon() { - if (commonBuilder_ == null) { - common_ = null; - onChanged(); - } else { - common_ = null; + bitField0_ = (bitField0_ & ~0x00000001); + common_ = null; + if (commonBuilder_ != null) { + commonBuilder_.dispose(); commonBuilder_ = null; } - + onChanged(); return this; } + /** * * @@ -579,10 +580,11 @@ public Builder clearCommon() { * .google.api.CommonLanguageSettings common = 1; */ public com.google.api.CommonLanguageSettings.Builder getCommonBuilder() { - + bitField0_ |= 0x00000001; onChanged(); - return getCommonFieldBuilder().getBuilder(); + return internalGetCommonFieldBuilder().getBuilder(); } + /** * * @@ -601,6 +603,7 @@ public com.google.api.CommonLanguageSettingsOrBuilder getCommonOrBuilder() { : common_; } } + /** * * @@ -610,14 +613,14 @@ public com.google.api.CommonLanguageSettingsOrBuilder getCommonOrBuilder() { * * .google.api.CommonLanguageSettings common = 1; */ - private com.google.protobuf.SingleFieldBuilderV3< + private com.google.protobuf.SingleFieldBuilder< com.google.api.CommonLanguageSettings, com.google.api.CommonLanguageSettings.Builder, com.google.api.CommonLanguageSettingsOrBuilder> - getCommonFieldBuilder() { + internalGetCommonFieldBuilder() { if (commonBuilder_ == null) { commonBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< + new com.google.protobuf.SingleFieldBuilder< com.google.api.CommonLanguageSettings, com.google.api.CommonLanguageSettings.Builder, com.google.api.CommonLanguageSettingsOrBuilder>( @@ -627,17 +630,6 @@ public com.google.api.CommonLanguageSettingsOrBuilder getCommonOrBuilder() { return commonBuilder_; } - @java.lang.Override - public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - // @@protoc_insertion_point(builder_scope:google.api.RubySettings) } diff --git a/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/RubySettingsOrBuilder.java b/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/RubySettingsOrBuilder.java index 65c7478ca4..3a72e97f72 100644 --- a/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/RubySettingsOrBuilder.java +++ b/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/RubySettingsOrBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,10 +14,13 @@ * limitations under the License. */ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: google/api/client.proto +// Protobuf Java Version: 4.33.2 package com.google.api; +@com.google.protobuf.Generated public interface RubySettingsOrBuilder extends // @@protoc_insertion_point(interface_extends:google.api.RubySettings) @@ -35,6 +38,7 @@ public interface RubySettingsOrBuilder * @return Whether the common field is set. */ boolean hasCommon(); + /** * * @@ -47,6 +51,7 @@ public interface RubySettingsOrBuilder * @return The common. */ com.google.api.CommonLanguageSettings getCommon(); + /** * * diff --git a/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/SelectiveGapicGeneration.java b/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/SelectiveGapicGeneration.java new file mode 100644 index 0000000000..af2200758b --- /dev/null +++ b/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/SelectiveGapicGeneration.java @@ -0,0 +1,827 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/api/client.proto +// Protobuf Java Version: 4.33.2 + +package com.google.api; + +/** + * + * + *
        + * This message is used to configure the generation of a subset of the RPCs in
        + * a service for client libraries.
        + * 
        + * + * Protobuf type {@code google.api.SelectiveGapicGeneration} + */ +@com.google.protobuf.Generated +public final class SelectiveGapicGeneration extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.api.SelectiveGapicGeneration) + SelectiveGapicGenerationOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "SelectiveGapicGeneration"); + } + + // Use SelectiveGapicGeneration.newBuilder() to construct. + private SelectiveGapicGeneration(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private SelectiveGapicGeneration() { + methods_ = com.google.protobuf.LazyStringArrayList.emptyList(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.api.ClientProto + .internal_static_google_api_SelectiveGapicGeneration_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.api.ClientProto + .internal_static_google_api_SelectiveGapicGeneration_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.api.SelectiveGapicGeneration.class, + com.google.api.SelectiveGapicGeneration.Builder.class); + } + + public static final int METHODS_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private com.google.protobuf.LazyStringArrayList methods_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + + /** + * + * + *
        +   * An allowlist of the fully qualified names of RPCs that should be included
        +   * on public client surfaces.
        +   * 
        + * + * repeated string methods = 1; + * + * @return A list containing the methods. + */ + public com.google.protobuf.ProtocolStringList getMethodsList() { + return methods_; + } + + /** + * + * + *
        +   * An allowlist of the fully qualified names of RPCs that should be included
        +   * on public client surfaces.
        +   * 
        + * + * repeated string methods = 1; + * + * @return The count of methods. + */ + public int getMethodsCount() { + return methods_.size(); + } + + /** + * + * + *
        +   * An allowlist of the fully qualified names of RPCs that should be included
        +   * on public client surfaces.
        +   * 
        + * + * repeated string methods = 1; + * + * @param index The index of the element to return. + * @return The methods at the given index. + */ + public java.lang.String getMethods(int index) { + return methods_.get(index); + } + + /** + * + * + *
        +   * An allowlist of the fully qualified names of RPCs that should be included
        +   * on public client surfaces.
        +   * 
        + * + * repeated string methods = 1; + * + * @param index The index of the value to return. + * @return The bytes of the methods at the given index. + */ + public com.google.protobuf.ByteString getMethodsBytes(int index) { + return methods_.getByteString(index); + } + + public static final int GENERATE_OMITTED_AS_INTERNAL_FIELD_NUMBER = 2; + private boolean generateOmittedAsInternal_ = false; + + /** + * + * + *
        +   * Setting this to true indicates to the client generators that methods
        +   * that would be excluded from the generation should instead be generated
        +   * in a way that indicates these methods should not be consumed by
        +   * end users. How this is expressed is up to individual language
        +   * implementations to decide. Some examples may be: added annotations,
        +   * obfuscated identifiers, or other language idiomatic patterns.
        +   * 
        + * + * bool generate_omitted_as_internal = 2; + * + * @return The generateOmittedAsInternal. + */ + @java.lang.Override + public boolean getGenerateOmittedAsInternal() { + return generateOmittedAsInternal_; + } + + 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 < methods_.size(); i++) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, methods_.getRaw(i)); + } + if (generateOmittedAsInternal_ != false) { + output.writeBool(2, generateOmittedAsInternal_); + } + 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 < methods_.size(); i++) { + dataSize += computeStringSizeNoTag(methods_.getRaw(i)); + } + size += dataSize; + size += 1 * getMethodsList().size(); + } + if (generateOmittedAsInternal_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(2, generateOmittedAsInternal_); + } + 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.api.SelectiveGapicGeneration)) { + return super.equals(obj); + } + com.google.api.SelectiveGapicGeneration other = (com.google.api.SelectiveGapicGeneration) obj; + + if (!getMethodsList().equals(other.getMethodsList())) return false; + if (getGenerateOmittedAsInternal() != other.getGenerateOmittedAsInternal()) 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 (getMethodsCount() > 0) { + hash = (37 * hash) + METHODS_FIELD_NUMBER; + hash = (53 * hash) + getMethodsList().hashCode(); + } + hash = (37 * hash) + GENERATE_OMITTED_AS_INTERNAL_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getGenerateOmittedAsInternal()); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.api.SelectiveGapicGeneration parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.api.SelectiveGapicGeneration parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.api.SelectiveGapicGeneration parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.api.SelectiveGapicGeneration parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.api.SelectiveGapicGeneration parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.api.SelectiveGapicGeneration parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.api.SelectiveGapicGeneration parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.api.SelectiveGapicGeneration parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.api.SelectiveGapicGeneration parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.api.SelectiveGapicGeneration parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.api.SelectiveGapicGeneration parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.api.SelectiveGapicGeneration parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.api.SelectiveGapicGeneration 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
        +   * This message is used to configure the generation of a subset of the RPCs in
        +   * a service for client libraries.
        +   * 
        + * + * Protobuf type {@code google.api.SelectiveGapicGeneration} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.api.SelectiveGapicGeneration) + com.google.api.SelectiveGapicGenerationOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.api.ClientProto + .internal_static_google_api_SelectiveGapicGeneration_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.api.ClientProto + .internal_static_google_api_SelectiveGapicGeneration_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.api.SelectiveGapicGeneration.class, + com.google.api.SelectiveGapicGeneration.Builder.class); + } + + // Construct using com.google.api.SelectiveGapicGeneration.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + methods_ = com.google.protobuf.LazyStringArrayList.emptyList(); + generateOmittedAsInternal_ = false; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.api.ClientProto + .internal_static_google_api_SelectiveGapicGeneration_descriptor; + } + + @java.lang.Override + public com.google.api.SelectiveGapicGeneration getDefaultInstanceForType() { + return com.google.api.SelectiveGapicGeneration.getDefaultInstance(); + } + + @java.lang.Override + public com.google.api.SelectiveGapicGeneration build() { + com.google.api.SelectiveGapicGeneration result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.api.SelectiveGapicGeneration buildPartial() { + com.google.api.SelectiveGapicGeneration result = + new com.google.api.SelectiveGapicGeneration(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.api.SelectiveGapicGeneration result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + methods_.makeImmutable(); + result.methods_ = methods_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.generateOmittedAsInternal_ = generateOmittedAsInternal_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.api.SelectiveGapicGeneration) { + return mergeFrom((com.google.api.SelectiveGapicGeneration) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.api.SelectiveGapicGeneration other) { + if (other == com.google.api.SelectiveGapicGeneration.getDefaultInstance()) return this; + if (!other.methods_.isEmpty()) { + if (methods_.isEmpty()) { + methods_ = other.methods_; + bitField0_ |= 0x00000001; + } else { + ensureMethodsIsMutable(); + methods_.addAll(other.methods_); + } + onChanged(); + } + if (other.getGenerateOmittedAsInternal() != false) { + setGenerateOmittedAsInternal(other.getGenerateOmittedAsInternal()); + } + 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(); + ensureMethodsIsMutable(); + methods_.add(s); + break; + } // case 10 + case 16: + { + generateOmittedAsInternal_ = input.readBool(); + 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 com.google.protobuf.LazyStringArrayList methods_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + + private void ensureMethodsIsMutable() { + if (!methods_.isModifiable()) { + methods_ = new com.google.protobuf.LazyStringArrayList(methods_); + } + bitField0_ |= 0x00000001; + } + + /** + * + * + *
        +     * An allowlist of the fully qualified names of RPCs that should be included
        +     * on public client surfaces.
        +     * 
        + * + * repeated string methods = 1; + * + * @return A list containing the methods. + */ + public com.google.protobuf.ProtocolStringList getMethodsList() { + methods_.makeImmutable(); + return methods_; + } + + /** + * + * + *
        +     * An allowlist of the fully qualified names of RPCs that should be included
        +     * on public client surfaces.
        +     * 
        + * + * repeated string methods = 1; + * + * @return The count of methods. + */ + public int getMethodsCount() { + return methods_.size(); + } + + /** + * + * + *
        +     * An allowlist of the fully qualified names of RPCs that should be included
        +     * on public client surfaces.
        +     * 
        + * + * repeated string methods = 1; + * + * @param index The index of the element to return. + * @return The methods at the given index. + */ + public java.lang.String getMethods(int index) { + return methods_.get(index); + } + + /** + * + * + *
        +     * An allowlist of the fully qualified names of RPCs that should be included
        +     * on public client surfaces.
        +     * 
        + * + * repeated string methods = 1; + * + * @param index The index of the value to return. + * @return The bytes of the methods at the given index. + */ + public com.google.protobuf.ByteString getMethodsBytes(int index) { + return methods_.getByteString(index); + } + + /** + * + * + *
        +     * An allowlist of the fully qualified names of RPCs that should be included
        +     * on public client surfaces.
        +     * 
        + * + * repeated string methods = 1; + * + * @param index The index to set the value at. + * @param value The methods to set. + * @return This builder for chaining. + */ + public Builder setMethods(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureMethodsIsMutable(); + methods_.set(index, value); + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
        +     * An allowlist of the fully qualified names of RPCs that should be included
        +     * on public client surfaces.
        +     * 
        + * + * repeated string methods = 1; + * + * @param value The methods to add. + * @return This builder for chaining. + */ + public Builder addMethods(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureMethodsIsMutable(); + methods_.add(value); + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
        +     * An allowlist of the fully qualified names of RPCs that should be included
        +     * on public client surfaces.
        +     * 
        + * + * repeated string methods = 1; + * + * @param values The methods to add. + * @return This builder for chaining. + */ + public Builder addAllMethods(java.lang.Iterable values) { + ensureMethodsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, methods_); + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
        +     * An allowlist of the fully qualified names of RPCs that should be included
        +     * on public client surfaces.
        +     * 
        + * + * repeated string methods = 1; + * + * @return This builder for chaining. + */ + public Builder clearMethods() { + methods_ = com.google.protobuf.LazyStringArrayList.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + ; + onChanged(); + return this; + } + + /** + * + * + *
        +     * An allowlist of the fully qualified names of RPCs that should be included
        +     * on public client surfaces.
        +     * 
        + * + * repeated string methods = 1; + * + * @param value The bytes of the methods to add. + * @return This builder for chaining. + */ + public Builder addMethodsBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureMethodsIsMutable(); + methods_.add(value); + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private boolean generateOmittedAsInternal_; + + /** + * + * + *
        +     * Setting this to true indicates to the client generators that methods
        +     * that would be excluded from the generation should instead be generated
        +     * in a way that indicates these methods should not be consumed by
        +     * end users. How this is expressed is up to individual language
        +     * implementations to decide. Some examples may be: added annotations,
        +     * obfuscated identifiers, or other language idiomatic patterns.
        +     * 
        + * + * bool generate_omitted_as_internal = 2; + * + * @return The generateOmittedAsInternal. + */ + @java.lang.Override + public boolean getGenerateOmittedAsInternal() { + return generateOmittedAsInternal_; + } + + /** + * + * + *
        +     * Setting this to true indicates to the client generators that methods
        +     * that would be excluded from the generation should instead be generated
        +     * in a way that indicates these methods should not be consumed by
        +     * end users. How this is expressed is up to individual language
        +     * implementations to decide. Some examples may be: added annotations,
        +     * obfuscated identifiers, or other language idiomatic patterns.
        +     * 
        + * + * bool generate_omitted_as_internal = 2; + * + * @param value The generateOmittedAsInternal to set. + * @return This builder for chaining. + */ + public Builder setGenerateOmittedAsInternal(boolean value) { + + generateOmittedAsInternal_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
        +     * Setting this to true indicates to the client generators that methods
        +     * that would be excluded from the generation should instead be generated
        +     * in a way that indicates these methods should not be consumed by
        +     * end users. How this is expressed is up to individual language
        +     * implementations to decide. Some examples may be: added annotations,
        +     * obfuscated identifiers, or other language idiomatic patterns.
        +     * 
        + * + * bool generate_omitted_as_internal = 2; + * + * @return This builder for chaining. + */ + public Builder clearGenerateOmittedAsInternal() { + bitField0_ = (bitField0_ & ~0x00000002); + generateOmittedAsInternal_ = false; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.api.SelectiveGapicGeneration) + } + + // @@protoc_insertion_point(class_scope:google.api.SelectiveGapicGeneration) + private static final com.google.api.SelectiveGapicGeneration DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.api.SelectiveGapicGeneration(); + } + + public static com.google.api.SelectiveGapicGeneration getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SelectiveGapicGeneration 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.api.SelectiveGapicGeneration getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/SelectiveGapicGenerationOrBuilder.java b/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/SelectiveGapicGenerationOrBuilder.java new file mode 100644 index 0000000000..05c7655cf5 --- /dev/null +++ b/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/SelectiveGapicGenerationOrBuilder.java @@ -0,0 +1,104 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/api/client.proto +// Protobuf Java Version: 4.33.2 + +package com.google.api; + +@com.google.protobuf.Generated +public interface SelectiveGapicGenerationOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.api.SelectiveGapicGeneration) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
        +   * An allowlist of the fully qualified names of RPCs that should be included
        +   * on public client surfaces.
        +   * 
        + * + * repeated string methods = 1; + * + * @return A list containing the methods. + */ + java.util.List getMethodsList(); + + /** + * + * + *
        +   * An allowlist of the fully qualified names of RPCs that should be included
        +   * on public client surfaces.
        +   * 
        + * + * repeated string methods = 1; + * + * @return The count of methods. + */ + int getMethodsCount(); + + /** + * + * + *
        +   * An allowlist of the fully qualified names of RPCs that should be included
        +   * on public client surfaces.
        +   * 
        + * + * repeated string methods = 1; + * + * @param index The index of the element to return. + * @return The methods at the given index. + */ + java.lang.String getMethods(int index); + + /** + * + * + *
        +   * An allowlist of the fully qualified names of RPCs that should be included
        +   * on public client surfaces.
        +   * 
        + * + * repeated string methods = 1; + * + * @param index The index of the value to return. + * @return The bytes of the methods at the given index. + */ + com.google.protobuf.ByteString getMethodsBytes(int index); + + /** + * + * + *
        +   * Setting this to true indicates to the client generators that methods
        +   * that would be excluded from the generation should instead be generated
        +   * in a way that indicates these methods should not be consumed by
        +   * end users. How this is expressed is up to individual language
        +   * implementations to decide. Some examples may be: added annotations,
        +   * obfuscated identifiers, or other language idiomatic patterns.
        +   * 
        + * + * bool generate_omitted_as_internal = 2; + * + * @return The generateOmittedAsInternal. + */ + boolean getGenerateOmittedAsInternal(); +} diff --git a/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/Service.java b/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/Service.java index f9cf8836f1..2a5f6ffc6b 100644 --- a/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/Service.java +++ b/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/Service.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,9 @@ * limitations under the License. */ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: google/api/service.proto +// Protobuf Java Version: 4.33.2 package com.google.api; @@ -28,40 +30,56 @@ * aspects to sub-sections. Each sub-section is either a proto message or a * repeated proto message that configures a specific aspect, such as auth. * For more information, see each proto message definition. + * * Example: - * type: google.api.Service - * name: calendar.googleapis.com - * title: Google Calendar API - * apis: - * - name: google.calendar.v3.Calendar - * visibility: - * rules: - * - selector: "google.calendar.v3.*" - * restriction: PREVIEW - * backend: - * rules: - * - selector: "google.calendar.v3.*" - * address: calendar.example.com - * authentication: - * providers: - * - id: google_calendar_auth - * jwks_uri: https://www.googleapis.com/oauth2/v1/certs - * issuer: https://securetoken.google.com - * rules: - * - selector: "*" - * requirements: - * provider_id: google_calendar_auth + * + * type: google.api.Service + * name: calendar.googleapis.com + * title: Google Calendar API + * apis: + * - name: google.calendar.v3.Calendar + * + * visibility: + * rules: + * - selector: "google.calendar.v3.*" + * restriction: PREVIEW + * backend: + * rules: + * - selector: "google.calendar.v3.*" + * address: calendar.example.com + * + * authentication: + * providers: + * - id: google_calendar_auth + * jwks_uri: https://www.googleapis.com/oauth2/v1/certs + * issuer: https://securetoken.google.com + * rules: + * - selector: "*" + * requirements: + * provider_id: google_calendar_auth * * * Protobuf type {@code google.api.Service} */ -public final class Service extends com.google.protobuf.GeneratedMessageV3 +@com.google.protobuf.Generated +public final class Service extends com.google.protobuf.GeneratedMessage implements // @@protoc_insertion_point(message_implements:google.api.Service) ServiceOrBuilder { private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "Service"); + } + // Use Service.newBuilder() to construct. - private Service(com.google.protobuf.GeneratedMessageV3.Builder builder) { + private Service(com.google.protobuf.GeneratedMessage.Builder builder) { super(builder); } @@ -79,31 +97,24 @@ private Service() { monitoredResources_ = java.util.Collections.emptyList(); } - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new Service(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.api.ServiceProto.internal_static_google_api_Service_descriptor; } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.api.ServiceProto.internal_static_google_api_Service_fieldAccessorTable .ensureFieldAccessorsInitialized( com.google.api.Service.class, com.google.api.Service.Builder.class); } + private int bitField0_; public static final int NAME_FIELD_NUMBER = 1; - private volatile java.lang.Object name_; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** * * @@ -130,6 +141,7 @@ public java.lang.String getName() { return s; } } + /** * * @@ -158,7 +170,10 @@ public com.google.protobuf.ByteString getNameBytes() { } public static final int TITLE_FIELD_NUMBER = 2; - private volatile java.lang.Object title_; + + @SuppressWarnings("serial") + private volatile java.lang.Object title_ = ""; + /** * * @@ -183,6 +198,7 @@ public java.lang.String getTitle() { return s; } } + /** * * @@ -209,7 +225,10 @@ public com.google.protobuf.ByteString getTitleBytes() { } public static final int PRODUCER_PROJECT_ID_FIELD_NUMBER = 22; - private volatile java.lang.Object producerProjectId_; + + @SuppressWarnings("serial") + private volatile java.lang.Object producerProjectId_ = ""; + /** * * @@ -233,6 +252,7 @@ public java.lang.String getProducerProjectId() { return s; } } + /** * * @@ -258,7 +278,10 @@ public com.google.protobuf.ByteString getProducerProjectIdBytes() { } public static final int ID_FIELD_NUMBER = 33; - private volatile java.lang.Object id_; + + @SuppressWarnings("serial") + private volatile java.lang.Object id_ = ""; + /** * * @@ -285,6 +308,7 @@ public java.lang.String getId() { return s; } } + /** * * @@ -313,16 +337,19 @@ public com.google.protobuf.ByteString getIdBytes() { } public static final int APIS_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") private java.util.List apis_; + /** * * *
            * A list of API interfaces exported by this service. Only the `name` field
        -   * of the [google.protobuf.Api][google.protobuf.Api] needs to be provided by the configuration
        -   * author, as the remaining fields will be derived from the IDL during the
        -   * normalization process. It is an error to specify an API interface here
        -   * which cannot be resolved against the associated IDL files.
        +   * of the [google.protobuf.Api][google.protobuf.Api] needs to be provided by
        +   * the configuration author, as the remaining fields will be derived from the
        +   * IDL during the normalization process. It is an error to specify an API
        +   * interface here which cannot be resolved against the associated IDL files.
            * 
        * * repeated .google.protobuf.Api apis = 3; @@ -331,15 +358,16 @@ public com.google.protobuf.ByteString getIdBytes() { public java.util.List getApisList() { return apis_; } + /** * * *
            * A list of API interfaces exported by this service. Only the `name` field
        -   * of the [google.protobuf.Api][google.protobuf.Api] needs to be provided by the configuration
        -   * author, as the remaining fields will be derived from the IDL during the
        -   * normalization process. It is an error to specify an API interface here
        -   * which cannot be resolved against the associated IDL files.
        +   * of the [google.protobuf.Api][google.protobuf.Api] needs to be provided by
        +   * the configuration author, as the remaining fields will be derived from the
        +   * IDL during the normalization process. It is an error to specify an API
        +   * interface here which cannot be resolved against the associated IDL files.
            * 
        * * repeated .google.protobuf.Api apis = 3; @@ -348,15 +376,16 @@ public java.util.List getApisList() { public java.util.List getApisOrBuilderList() { return apis_; } + /** * * *
            * A list of API interfaces exported by this service. Only the `name` field
        -   * of the [google.protobuf.Api][google.protobuf.Api] needs to be provided by the configuration
        -   * author, as the remaining fields will be derived from the IDL during the
        -   * normalization process. It is an error to specify an API interface here
        -   * which cannot be resolved against the associated IDL files.
        +   * of the [google.protobuf.Api][google.protobuf.Api] needs to be provided by
        +   * the configuration author, as the remaining fields will be derived from the
        +   * IDL during the normalization process. It is an error to specify an API
        +   * interface here which cannot be resolved against the associated IDL files.
            * 
        * * repeated .google.protobuf.Api apis = 3; @@ -365,15 +394,16 @@ public java.util.List getApisOrBuild public int getApisCount() { return apis_.size(); } + /** * * *
            * A list of API interfaces exported by this service. Only the `name` field
        -   * of the [google.protobuf.Api][google.protobuf.Api] needs to be provided by the configuration
        -   * author, as the remaining fields will be derived from the IDL during the
        -   * normalization process. It is an error to specify an API interface here
        -   * which cannot be resolved against the associated IDL files.
        +   * of the [google.protobuf.Api][google.protobuf.Api] needs to be provided by
        +   * the configuration author, as the remaining fields will be derived from the
        +   * IDL during the normalization process. It is an error to specify an API
        +   * interface here which cannot be resolved against the associated IDL files.
            * 
        * * repeated .google.protobuf.Api apis = 3; @@ -382,15 +412,16 @@ public int getApisCount() { public com.google.protobuf.Api getApis(int index) { return apis_.get(index); } + /** * * *
            * A list of API interfaces exported by this service. Only the `name` field
        -   * of the [google.protobuf.Api][google.protobuf.Api] needs to be provided by the configuration
        -   * author, as the remaining fields will be derived from the IDL during the
        -   * normalization process. It is an error to specify an API interface here
        -   * which cannot be resolved against the associated IDL files.
        +   * of the [google.protobuf.Api][google.protobuf.Api] needs to be provided by
        +   * the configuration author, as the remaining fields will be derived from the
        +   * IDL during the normalization process. It is an error to specify an API
        +   * interface here which cannot be resolved against the associated IDL files.
            * 
        * * repeated .google.protobuf.Api apis = 3; @@ -401,7 +432,10 @@ public com.google.protobuf.ApiOrBuilder getApisOrBuilder(int index) { } public static final int TYPES_FIELD_NUMBER = 4; + + @SuppressWarnings("serial") private java.util.List types_; + /** * * @@ -411,8 +445,9 @@ public com.google.protobuf.ApiOrBuilder getApisOrBuilder(int index) { * included. Messages which are not referenced but shall be included, such as * types used by the `google.protobuf.Any` type, should be listed here by * name by the configuration author. Example: - * types: - * - name: google.protobuf.Int32 + * + * types: + * - name: google.protobuf.Int32 * * * repeated .google.protobuf.Type types = 4; @@ -421,6 +456,7 @@ public com.google.protobuf.ApiOrBuilder getApisOrBuilder(int index) { public java.util.List getTypesList() { return types_; } + /** * * @@ -430,8 +466,9 @@ public java.util.List getTypesList() { * included. Messages which are not referenced but shall be included, such as * types used by the `google.protobuf.Any` type, should be listed here by * name by the configuration author. Example: - * types: - * - name: google.protobuf.Int32 + * + * types: + * - name: google.protobuf.Int32 * * * repeated .google.protobuf.Type types = 4; @@ -440,6 +477,7 @@ public java.util.List getTypesList() { public java.util.List getTypesOrBuilderList() { return types_; } + /** * * @@ -449,8 +487,9 @@ public java.util.List getTypesOrBui * included. Messages which are not referenced but shall be included, such as * types used by the `google.protobuf.Any` type, should be listed here by * name by the configuration author. Example: - * types: - * - name: google.protobuf.Int32 + * + * types: + * - name: google.protobuf.Int32 * * * repeated .google.protobuf.Type types = 4; @@ -459,6 +498,7 @@ public java.util.List getTypesOrBui public int getTypesCount() { return types_.size(); } + /** * * @@ -468,8 +508,9 @@ public int getTypesCount() { * included. Messages which are not referenced but shall be included, such as * types used by the `google.protobuf.Any` type, should be listed here by * name by the configuration author. Example: - * types: - * - name: google.protobuf.Int32 + * + * types: + * - name: google.protobuf.Int32 * * * repeated .google.protobuf.Type types = 4; @@ -478,6 +519,7 @@ public int getTypesCount() { public com.google.protobuf.Type getTypes(int index) { return types_.get(index); } + /** * * @@ -487,8 +529,9 @@ public com.google.protobuf.Type getTypes(int index) { * included. Messages which are not referenced but shall be included, such as * types used by the `google.protobuf.Any` type, should be listed here by * name by the configuration author. Example: - * types: - * - name: google.protobuf.Int32 + * + * types: + * - name: google.protobuf.Int32 * * * repeated .google.protobuf.Type types = 4; @@ -499,7 +542,10 @@ public com.google.protobuf.TypeOrBuilder getTypesOrBuilder(int index) { } public static final int ENUMS_FIELD_NUMBER = 5; + + @SuppressWarnings("serial") private java.util.List enums_; + /** * * @@ -508,8 +554,9 @@ public com.google.protobuf.TypeOrBuilder getTypesOrBuilder(int index) { * directly or indirectly by the `apis` are automatically included. Enums * which are not referenced but shall be included should be listed here by * name by the configuration author. Example: - * enums: - * - name: google.someapi.v1.SomeEnum + * + * enums: + * - name: google.someapi.v1.SomeEnum * * * repeated .google.protobuf.Enum enums = 5; @@ -518,6 +565,7 @@ public com.google.protobuf.TypeOrBuilder getTypesOrBuilder(int index) { public java.util.List getEnumsList() { return enums_; } + /** * * @@ -526,8 +574,9 @@ public java.util.List getEnumsList() { * directly or indirectly by the `apis` are automatically included. Enums * which are not referenced but shall be included should be listed here by * name by the configuration author. Example: - * enums: - * - name: google.someapi.v1.SomeEnum + * + * enums: + * - name: google.someapi.v1.SomeEnum * * * repeated .google.protobuf.Enum enums = 5; @@ -536,6 +585,7 @@ public java.util.List getEnumsList() { public java.util.List getEnumsOrBuilderList() { return enums_; } + /** * * @@ -544,8 +594,9 @@ public java.util.List getEnumsOrBui * directly or indirectly by the `apis` are automatically included. Enums * which are not referenced but shall be included should be listed here by * name by the configuration author. Example: - * enums: - * - name: google.someapi.v1.SomeEnum + * + * enums: + * - name: google.someapi.v1.SomeEnum * * * repeated .google.protobuf.Enum enums = 5; @@ -554,6 +605,7 @@ public java.util.List getEnumsOrBui public int getEnumsCount() { return enums_.size(); } + /** * * @@ -562,8 +614,9 @@ public int getEnumsCount() { * directly or indirectly by the `apis` are automatically included. Enums * which are not referenced but shall be included should be listed here by * name by the configuration author. Example: - * enums: - * - name: google.someapi.v1.SomeEnum + * + * enums: + * - name: google.someapi.v1.SomeEnum * * * repeated .google.protobuf.Enum enums = 5; @@ -572,6 +625,7 @@ public int getEnumsCount() { public com.google.protobuf.Enum getEnums(int index) { return enums_.get(index); } + /** * * @@ -580,8 +634,9 @@ public com.google.protobuf.Enum getEnums(int index) { * directly or indirectly by the `apis` are automatically included. Enums * which are not referenced but shall be included should be listed here by * name by the configuration author. Example: - * enums: - * - name: google.someapi.v1.SomeEnum + * + * enums: + * - name: google.someapi.v1.SomeEnum * * * repeated .google.protobuf.Enum enums = 5; @@ -593,6 +648,7 @@ public com.google.protobuf.EnumOrBuilder getEnumsOrBuilder(int index) { public static final int DOCUMENTATION_FIELD_NUMBER = 6; private com.google.api.Documentation documentation_; + /** * * @@ -606,8 +662,9 @@ public com.google.protobuf.EnumOrBuilder getEnumsOrBuilder(int index) { */ @java.lang.Override public boolean hasDocumentation() { - return documentation_ != null; + return ((bitField0_ & 0x00000001) != 0); } + /** * * @@ -625,6 +682,7 @@ public com.google.api.Documentation getDocumentation() { ? com.google.api.Documentation.getDefaultInstance() : documentation_; } + /** * * @@ -636,11 +694,14 @@ public com.google.api.Documentation getDocumentation() { */ @java.lang.Override public com.google.api.DocumentationOrBuilder getDocumentationOrBuilder() { - return getDocumentation(); + return documentation_ == null + ? com.google.api.Documentation.getDefaultInstance() + : documentation_; } public static final int BACKEND_FIELD_NUMBER = 8; private com.google.api.Backend backend_; + /** * * @@ -654,8 +715,9 @@ public com.google.api.DocumentationOrBuilder getDocumentationOrBuilder() { */ @java.lang.Override public boolean hasBackend() { - return backend_ != null; + return ((bitField0_ & 0x00000002) != 0); } + /** * * @@ -671,6 +733,7 @@ public boolean hasBackend() { public com.google.api.Backend getBackend() { return backend_ == null ? com.google.api.Backend.getDefaultInstance() : backend_; } + /** * * @@ -682,11 +745,12 @@ public com.google.api.Backend getBackend() { */ @java.lang.Override public com.google.api.BackendOrBuilder getBackendOrBuilder() { - return getBackend(); + return backend_ == null ? com.google.api.Backend.getDefaultInstance() : backend_; } public static final int HTTP_FIELD_NUMBER = 9; private com.google.api.Http http_; + /** * * @@ -700,8 +764,9 @@ public com.google.api.BackendOrBuilder getBackendOrBuilder() { */ @java.lang.Override public boolean hasHttp() { - return http_ != null; + return ((bitField0_ & 0x00000004) != 0); } + /** * * @@ -717,6 +782,7 @@ public boolean hasHttp() { public com.google.api.Http getHttp() { return http_ == null ? com.google.api.Http.getDefaultInstance() : http_; } + /** * * @@ -728,11 +794,12 @@ public com.google.api.Http getHttp() { */ @java.lang.Override public com.google.api.HttpOrBuilder getHttpOrBuilder() { - return getHttp(); + return http_ == null ? com.google.api.Http.getDefaultInstance() : http_; } public static final int QUOTA_FIELD_NUMBER = 10; private com.google.api.Quota quota_; + /** * * @@ -746,8 +813,9 @@ public com.google.api.HttpOrBuilder getHttpOrBuilder() { */ @java.lang.Override public boolean hasQuota() { - return quota_ != null; + return ((bitField0_ & 0x00000008) != 0); } + /** * * @@ -763,6 +831,7 @@ public boolean hasQuota() { public com.google.api.Quota getQuota() { return quota_ == null ? com.google.api.Quota.getDefaultInstance() : quota_; } + /** * * @@ -774,11 +843,12 @@ public com.google.api.Quota getQuota() { */ @java.lang.Override public com.google.api.QuotaOrBuilder getQuotaOrBuilder() { - return getQuota(); + return quota_ == null ? com.google.api.Quota.getDefaultInstance() : quota_; } public static final int AUTHENTICATION_FIELD_NUMBER = 11; private com.google.api.Authentication authentication_; + /** * * @@ -792,8 +862,9 @@ public com.google.api.QuotaOrBuilder getQuotaOrBuilder() { */ @java.lang.Override public boolean hasAuthentication() { - return authentication_ != null; + return ((bitField0_ & 0x00000010) != 0); } + /** * * @@ -811,6 +882,7 @@ public com.google.api.Authentication getAuthentication() { ? com.google.api.Authentication.getDefaultInstance() : authentication_; } + /** * * @@ -822,11 +894,14 @@ public com.google.api.Authentication getAuthentication() { */ @java.lang.Override public com.google.api.AuthenticationOrBuilder getAuthenticationOrBuilder() { - return getAuthentication(); + return authentication_ == null + ? com.google.api.Authentication.getDefaultInstance() + : authentication_; } public static final int CONTEXT_FIELD_NUMBER = 12; private com.google.api.Context context_; + /** * * @@ -840,8 +915,9 @@ public com.google.api.AuthenticationOrBuilder getAuthenticationOrBuilder() { */ @java.lang.Override public boolean hasContext() { - return context_ != null; + return ((bitField0_ & 0x00000020) != 0); } + /** * * @@ -857,6 +933,7 @@ public boolean hasContext() { public com.google.api.Context getContext() { return context_ == null ? com.google.api.Context.getDefaultInstance() : context_; } + /** * * @@ -868,11 +945,12 @@ public com.google.api.Context getContext() { */ @java.lang.Override public com.google.api.ContextOrBuilder getContextOrBuilder() { - return getContext(); + return context_ == null ? com.google.api.Context.getDefaultInstance() : context_; } public static final int USAGE_FIELD_NUMBER = 15; private com.google.api.Usage usage_; + /** * * @@ -886,8 +964,9 @@ public com.google.api.ContextOrBuilder getContextOrBuilder() { */ @java.lang.Override public boolean hasUsage() { - return usage_ != null; + return ((bitField0_ & 0x00000040) != 0); } + /** * * @@ -903,6 +982,7 @@ public boolean hasUsage() { public com.google.api.Usage getUsage() { return usage_ == null ? com.google.api.Usage.getDefaultInstance() : usage_; } + /** * * @@ -914,11 +994,14 @@ public com.google.api.Usage getUsage() { */ @java.lang.Override public com.google.api.UsageOrBuilder getUsageOrBuilder() { - return getUsage(); + return usage_ == null ? com.google.api.Usage.getDefaultInstance() : usage_; } public static final int ENDPOINTS_FIELD_NUMBER = 18; + + @SuppressWarnings("serial") private java.util.List endpoints_; + /** * * @@ -934,6 +1017,7 @@ public com.google.api.UsageOrBuilder getUsageOrBuilder() { public java.util.List getEndpointsList() { return endpoints_; } + /** * * @@ -949,6 +1033,7 @@ public java.util.List getEndpointsList() { public java.util.List getEndpointsOrBuilderList() { return endpoints_; } + /** * * @@ -964,6 +1049,7 @@ public java.util.List getEndpointsOr public int getEndpointsCount() { return endpoints_.size(); } + /** * * @@ -979,6 +1065,7 @@ public int getEndpointsCount() { public com.google.api.Endpoint getEndpoints(int index) { return endpoints_.get(index); } + /** * * @@ -997,6 +1084,7 @@ public com.google.api.EndpointOrBuilder getEndpointsOrBuilder(int index) { public static final int CONTROL_FIELD_NUMBER = 21; private com.google.api.Control control_; + /** * * @@ -1010,8 +1098,9 @@ public com.google.api.EndpointOrBuilder getEndpointsOrBuilder(int index) { */ @java.lang.Override public boolean hasControl() { - return control_ != null; + return ((bitField0_ & 0x00000080) != 0); } + /** * * @@ -1027,6 +1116,7 @@ public boolean hasControl() { public com.google.api.Control getControl() { return control_ == null ? com.google.api.Control.getDefaultInstance() : control_; } + /** * * @@ -1038,11 +1128,14 @@ public com.google.api.Control getControl() { */ @java.lang.Override public com.google.api.ControlOrBuilder getControlOrBuilder() { - return getControl(); + return control_ == null ? com.google.api.Control.getDefaultInstance() : control_; } public static final int LOGS_FIELD_NUMBER = 23; + + @SuppressWarnings("serial") private java.util.List logs_; + /** * * @@ -1056,6 +1149,7 @@ public com.google.api.ControlOrBuilder getControlOrBuilder() { public java.util.List getLogsList() { return logs_; } + /** * * @@ -1069,6 +1163,7 @@ public java.util.List getLogsList() { public java.util.List getLogsOrBuilderList() { return logs_; } + /** * * @@ -1082,6 +1177,7 @@ public java.util.List getLogsOr public int getLogsCount() { return logs_.size(); } + /** * * @@ -1095,6 +1191,7 @@ public int getLogsCount() { public com.google.api.LogDescriptor getLogs(int index) { return logs_.get(index); } + /** * * @@ -1110,7 +1207,10 @@ public com.google.api.LogDescriptorOrBuilder getLogsOrBuilder(int index) { } public static final int METRICS_FIELD_NUMBER = 24; + + @SuppressWarnings("serial") private java.util.List metrics_; + /** * * @@ -1124,6 +1224,7 @@ public com.google.api.LogDescriptorOrBuilder getLogsOrBuilder(int index) { public java.util.List getMetricsList() { return metrics_; } + /** * * @@ -1138,6 +1239,7 @@ public java.util.List getMetricsList() { getMetricsOrBuilderList() { return metrics_; } + /** * * @@ -1151,6 +1253,7 @@ public java.util.List getMetricsList() { public int getMetricsCount() { return metrics_.size(); } + /** * * @@ -1164,6 +1267,7 @@ public int getMetricsCount() { public com.google.api.MetricDescriptor getMetrics(int index) { return metrics_.get(index); } + /** * * @@ -1179,13 +1283,17 @@ public com.google.api.MetricDescriptorOrBuilder getMetricsOrBuilder(int index) { } public static final int MONITORED_RESOURCES_FIELD_NUMBER = 25; + + @SuppressWarnings("serial") private java.util.List monitoredResources_; + /** * * *
            * Defines the monitored resources used by this service. This is required
        -   * by the [Service.monitoring][google.api.Service.monitoring] and [Service.logging][google.api.Service.logging] configurations.
        +   * by the [Service.monitoring][google.api.Service.monitoring] and
        +   * [Service.logging][google.api.Service.logging] configurations.
            * 
        * * repeated .google.api.MonitoredResourceDescriptor monitored_resources = 25; @@ -1194,12 +1302,14 @@ public com.google.api.MetricDescriptorOrBuilder getMetricsOrBuilder(int index) { public java.util.List getMonitoredResourcesList() { return monitoredResources_; } + /** * * *
            * Defines the monitored resources used by this service. This is required
        -   * by the [Service.monitoring][google.api.Service.monitoring] and [Service.logging][google.api.Service.logging] configurations.
        +   * by the [Service.monitoring][google.api.Service.monitoring] and
        +   * [Service.logging][google.api.Service.logging] configurations.
            * 
        * * repeated .google.api.MonitoredResourceDescriptor monitored_resources = 25; @@ -1209,12 +1319,14 @@ public java.util.List getMonitoredRe getMonitoredResourcesOrBuilderList() { return monitoredResources_; } + /** * * *
            * Defines the monitored resources used by this service. This is required
        -   * by the [Service.monitoring][google.api.Service.monitoring] and [Service.logging][google.api.Service.logging] configurations.
        +   * by the [Service.monitoring][google.api.Service.monitoring] and
        +   * [Service.logging][google.api.Service.logging] configurations.
            * 
        * * repeated .google.api.MonitoredResourceDescriptor monitored_resources = 25; @@ -1223,12 +1335,14 @@ public java.util.List getMonitoredRe public int getMonitoredResourcesCount() { return monitoredResources_.size(); } + /** * * *
            * Defines the monitored resources used by this service. This is required
        -   * by the [Service.monitoring][google.api.Service.monitoring] and [Service.logging][google.api.Service.logging] configurations.
        +   * by the [Service.monitoring][google.api.Service.monitoring] and
        +   * [Service.logging][google.api.Service.logging] configurations.
            * 
        * * repeated .google.api.MonitoredResourceDescriptor monitored_resources = 25; @@ -1237,12 +1351,14 @@ public int getMonitoredResourcesCount() { public com.google.api.MonitoredResourceDescriptor getMonitoredResources(int index) { return monitoredResources_.get(index); } + /** * * *
            * Defines the monitored resources used by this service. This is required
        -   * by the [Service.monitoring][google.api.Service.monitoring] and [Service.logging][google.api.Service.logging] configurations.
        +   * by the [Service.monitoring][google.api.Service.monitoring] and
        +   * [Service.logging][google.api.Service.logging] configurations.
            * 
        * * repeated .google.api.MonitoredResourceDescriptor monitored_resources = 25; @@ -1255,6 +1371,7 @@ public com.google.api.MonitoredResourceDescriptorOrBuilder getMonitoredResources public static final int BILLING_FIELD_NUMBER = 26; private com.google.api.Billing billing_; + /** * * @@ -1268,8 +1385,9 @@ public com.google.api.MonitoredResourceDescriptorOrBuilder getMonitoredResources */ @java.lang.Override public boolean hasBilling() { - return billing_ != null; + return ((bitField0_ & 0x00000100) != 0); } + /** * * @@ -1285,6 +1403,7 @@ public boolean hasBilling() { public com.google.api.Billing getBilling() { return billing_ == null ? com.google.api.Billing.getDefaultInstance() : billing_; } + /** * * @@ -1296,11 +1415,12 @@ public com.google.api.Billing getBilling() { */ @java.lang.Override public com.google.api.BillingOrBuilder getBillingOrBuilder() { - return getBilling(); + return billing_ == null ? com.google.api.Billing.getDefaultInstance() : billing_; } public static final int LOGGING_FIELD_NUMBER = 27; private com.google.api.Logging logging_; + /** * * @@ -1314,8 +1434,9 @@ public com.google.api.BillingOrBuilder getBillingOrBuilder() { */ @java.lang.Override public boolean hasLogging() { - return logging_ != null; + return ((bitField0_ & 0x00000200) != 0); } + /** * * @@ -1331,6 +1452,7 @@ public boolean hasLogging() { public com.google.api.Logging getLogging() { return logging_ == null ? com.google.api.Logging.getDefaultInstance() : logging_; } + /** * * @@ -1342,11 +1464,12 @@ public com.google.api.Logging getLogging() { */ @java.lang.Override public com.google.api.LoggingOrBuilder getLoggingOrBuilder() { - return getLogging(); + return logging_ == null ? com.google.api.Logging.getDefaultInstance() : logging_; } public static final int MONITORING_FIELD_NUMBER = 28; private com.google.api.Monitoring monitoring_; + /** * * @@ -1360,8 +1483,9 @@ public com.google.api.LoggingOrBuilder getLoggingOrBuilder() { */ @java.lang.Override public boolean hasMonitoring() { - return monitoring_ != null; + return ((bitField0_ & 0x00000400) != 0); } + /** * * @@ -1377,6 +1501,7 @@ public boolean hasMonitoring() { public com.google.api.Monitoring getMonitoring() { return monitoring_ == null ? com.google.api.Monitoring.getDefaultInstance() : monitoring_; } + /** * * @@ -1388,11 +1513,12 @@ public com.google.api.Monitoring getMonitoring() { */ @java.lang.Override public com.google.api.MonitoringOrBuilder getMonitoringOrBuilder() { - return getMonitoring(); + return monitoring_ == null ? com.google.api.Monitoring.getDefaultInstance() : monitoring_; } public static final int SYSTEM_PARAMETERS_FIELD_NUMBER = 29; private com.google.api.SystemParameters systemParameters_; + /** * * @@ -1406,8 +1532,9 @@ public com.google.api.MonitoringOrBuilder getMonitoringOrBuilder() { */ @java.lang.Override public boolean hasSystemParameters() { - return systemParameters_ != null; + return ((bitField0_ & 0x00000800) != 0); } + /** * * @@ -1425,6 +1552,7 @@ public com.google.api.SystemParameters getSystemParameters() { ? com.google.api.SystemParameters.getDefaultInstance() : systemParameters_; } + /** * * @@ -1436,11 +1564,14 @@ public com.google.api.SystemParameters getSystemParameters() { */ @java.lang.Override public com.google.api.SystemParametersOrBuilder getSystemParametersOrBuilder() { - return getSystemParameters(); + return systemParameters_ == null + ? com.google.api.SystemParameters.getDefaultInstance() + : systemParameters_; } public static final int SOURCE_INFO_FIELD_NUMBER = 37; private com.google.api.SourceInfo sourceInfo_; + /** * * @@ -1454,8 +1585,9 @@ public com.google.api.SystemParametersOrBuilder getSystemParametersOrBuilder() { */ @java.lang.Override public boolean hasSourceInfo() { - return sourceInfo_ != null; + return ((bitField0_ & 0x00001000) != 0); } + /** * * @@ -1471,6 +1603,7 @@ public boolean hasSourceInfo() { public com.google.api.SourceInfo getSourceInfo() { return sourceInfo_ == null ? com.google.api.SourceInfo.getDefaultInstance() : sourceInfo_; } + /** * * @@ -1482,11 +1615,12 @@ public com.google.api.SourceInfo getSourceInfo() { */ @java.lang.Override public com.google.api.SourceInfoOrBuilder getSourceInfoOrBuilder() { - return getSourceInfo(); + return sourceInfo_ == null ? com.google.api.SourceInfo.getDefaultInstance() : sourceInfo_; } public static final int PUBLISHING_FIELD_NUMBER = 45; private com.google.api.Publishing publishing_; + /** * * @@ -1502,8 +1636,9 @@ public com.google.api.SourceInfoOrBuilder getSourceInfoOrBuilder() { */ @java.lang.Override public boolean hasPublishing() { - return publishing_ != null; + return ((bitField0_ & 0x00002000) != 0); } + /** * * @@ -1521,6 +1656,7 @@ public boolean hasPublishing() { public com.google.api.Publishing getPublishing() { return publishing_ == null ? com.google.api.Publishing.getDefaultInstance() : publishing_; } + /** * * @@ -1534,16 +1670,18 @@ public com.google.api.Publishing getPublishing() { */ @java.lang.Override public com.google.api.PublishingOrBuilder getPublishingOrBuilder() { - return getPublishing(); + return publishing_ == null ? com.google.api.Publishing.getDefaultInstance() : publishing_; } public static final int CONFIG_VERSION_FIELD_NUMBER = 20; private com.google.protobuf.UInt32Value configVersion_; + /** * * *
            * Obsolete. Do not use.
        +   *
            * This field has no semantic meaning. The service config compiler always
            * sets this field to `3`.
            * 
        @@ -1554,13 +1692,15 @@ public com.google.api.PublishingOrBuilder getPublishingOrBuilder() { */ @java.lang.Override public boolean hasConfigVersion() { - return configVersion_ != null; + return ((bitField0_ & 0x00004000) != 0); } + /** * * *
            * Obsolete. Do not use.
        +   *
            * This field has no semantic meaning. The service config compiler always
            * sets this field to `3`.
            * 
        @@ -1575,11 +1715,13 @@ public com.google.protobuf.UInt32Value getConfigVersion() { ? com.google.protobuf.UInt32Value.getDefaultInstance() : configVersion_; } + /** * * *
            * Obsolete. Do not use.
        +   *
            * This field has no semantic meaning. The service config compiler always
            * sets this field to `3`.
            * 
        @@ -1588,7 +1730,9 @@ public com.google.protobuf.UInt32Value getConfigVersion() { */ @java.lang.Override public com.google.protobuf.UInt32ValueOrBuilder getConfigVersionOrBuilder() { - return getConfigVersion(); + return configVersion_ == null + ? com.google.protobuf.UInt32Value.getDefaultInstance() + : configVersion_; } private byte memoizedIsInitialized = -1; @@ -1605,11 +1749,11 @@ public final boolean isInitialized() { @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.GeneratedMessage.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, name_); } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(title_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 2, title_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(title_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, title_); } for (int i = 0; i < apis_.size(); i++) { output.writeMessage(3, apis_.get(i)); @@ -1620,38 +1764,38 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io for (int i = 0; i < enums_.size(); i++) { output.writeMessage(5, enums_.get(i)); } - if (documentation_ != null) { + if (((bitField0_ & 0x00000001) != 0)) { output.writeMessage(6, getDocumentation()); } - if (backend_ != null) { + if (((bitField0_ & 0x00000002) != 0)) { output.writeMessage(8, getBackend()); } - if (http_ != null) { + if (((bitField0_ & 0x00000004) != 0)) { output.writeMessage(9, getHttp()); } - if (quota_ != null) { + if (((bitField0_ & 0x00000008) != 0)) { output.writeMessage(10, getQuota()); } - if (authentication_ != null) { + if (((bitField0_ & 0x00000010) != 0)) { output.writeMessage(11, getAuthentication()); } - if (context_ != null) { + if (((bitField0_ & 0x00000020) != 0)) { output.writeMessage(12, getContext()); } - if (usage_ != null) { + if (((bitField0_ & 0x00000040) != 0)) { output.writeMessage(15, getUsage()); } for (int i = 0; i < endpoints_.size(); i++) { output.writeMessage(18, endpoints_.get(i)); } - if (configVersion_ != null) { + if (((bitField0_ & 0x00004000) != 0)) { output.writeMessage(20, getConfigVersion()); } - if (control_ != null) { + if (((bitField0_ & 0x00000080) != 0)) { output.writeMessage(21, getControl()); } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(producerProjectId_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 22, producerProjectId_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(producerProjectId_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 22, producerProjectId_); } for (int i = 0; i < logs_.size(); i++) { output.writeMessage(23, logs_.get(i)); @@ -1662,25 +1806,25 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io for (int i = 0; i < monitoredResources_.size(); i++) { output.writeMessage(25, monitoredResources_.get(i)); } - if (billing_ != null) { + if (((bitField0_ & 0x00000100) != 0)) { output.writeMessage(26, getBilling()); } - if (logging_ != null) { + if (((bitField0_ & 0x00000200) != 0)) { output.writeMessage(27, getLogging()); } - if (monitoring_ != null) { + if (((bitField0_ & 0x00000400) != 0)) { output.writeMessage(28, getMonitoring()); } - if (systemParameters_ != null) { + if (((bitField0_ & 0x00000800) != 0)) { output.writeMessage(29, getSystemParameters()); } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(id_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 33, id_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(id_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 33, id_); } - if (sourceInfo_ != null) { + if (((bitField0_ & 0x00001000) != 0)) { output.writeMessage(37, getSourceInfo()); } - if (publishing_ != null) { + if (((bitField0_ & 0x00002000) != 0)) { output.writeMessage(45, getPublishing()); } getUnknownFields().writeTo(output); @@ -1692,11 +1836,11 @@ public int getSerializedSize() { 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.GeneratedMessage.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, name_); } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(title_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, title_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(title_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, title_); } for (int i = 0; i < apis_.size(); i++) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, apis_.get(i)); @@ -1707,38 +1851,38 @@ public int getSerializedSize() { for (int i = 0; i < enums_.size(); i++) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(5, enums_.get(i)); } - if (documentation_ != null) { + if (((bitField0_ & 0x00000001) != 0)) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(6, getDocumentation()); } - if (backend_ != null) { + if (((bitField0_ & 0x00000002) != 0)) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(8, getBackend()); } - if (http_ != null) { + if (((bitField0_ & 0x00000004) != 0)) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(9, getHttp()); } - if (quota_ != null) { + if (((bitField0_ & 0x00000008) != 0)) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(10, getQuota()); } - if (authentication_ != null) { + if (((bitField0_ & 0x00000010) != 0)) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(11, getAuthentication()); } - if (context_ != null) { + if (((bitField0_ & 0x00000020) != 0)) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(12, getContext()); } - if (usage_ != null) { + if (((bitField0_ & 0x00000040) != 0)) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(15, getUsage()); } for (int i = 0; i < endpoints_.size(); i++) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(18, endpoints_.get(i)); } - if (configVersion_ != null) { + if (((bitField0_ & 0x00004000) != 0)) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(20, getConfigVersion()); } - if (control_ != null) { + if (((bitField0_ & 0x00000080) != 0)) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(21, getControl()); } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(producerProjectId_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(22, producerProjectId_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(producerProjectId_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(22, producerProjectId_); } for (int i = 0; i < logs_.size(); i++) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(23, logs_.get(i)); @@ -1750,25 +1894,25 @@ public int getSerializedSize() { size += com.google.protobuf.CodedOutputStream.computeMessageSize(25, monitoredResources_.get(i)); } - if (billing_ != null) { + if (((bitField0_ & 0x00000100) != 0)) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(26, getBilling()); } - if (logging_ != null) { + if (((bitField0_ & 0x00000200) != 0)) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(27, getLogging()); } - if (monitoring_ != null) { + if (((bitField0_ & 0x00000400) != 0)) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(28, getMonitoring()); } - if (systemParameters_ != null) { + if (((bitField0_ & 0x00000800) != 0)) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(29, getSystemParameters()); } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(id_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(33, id_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(id_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(33, id_); } - if (sourceInfo_ != null) { + if (((bitField0_ & 0x00001000) != 0)) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(37, getSourceInfo()); } - if (publishing_ != null) { + if (((bitField0_ & 0x00002000) != 0)) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(45, getPublishing()); } size += getUnknownFields().getSerializedSize(); @@ -2005,38 +2149,38 @@ public static com.google.api.Service parseFrom( public static com.google.api.Service parseFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); } public static com.google.api.Service parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } public static com.google.api.Service parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); } public static com.google.api.Service parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( PARSER, input, extensionRegistry); } public static com.google.api.Service parseFrom(com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); } public static com.google.api.Service parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } @@ -2059,10 +2203,11 @@ public Builder toBuilder() { } @java.lang.Override - protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { Builder builder = new Builder(parent); return builder; } + /** * * @@ -2073,34 +2218,38 @@ protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.Build * aspects to sub-sections. Each sub-section is either a proto message or a * repeated proto message that configures a specific aspect, such as auth. * For more information, see each proto message definition. + * * Example: - * type: google.api.Service - * name: calendar.googleapis.com - * title: Google Calendar API - * apis: - * - name: google.calendar.v3.Calendar - * visibility: - * rules: - * - selector: "google.calendar.v3.*" - * restriction: PREVIEW - * backend: - * rules: - * - selector: "google.calendar.v3.*" - * address: calendar.example.com - * authentication: - * providers: - * - id: google_calendar_auth - * jwks_uri: https://www.googleapis.com/oauth2/v1/certs - * issuer: https://securetoken.google.com - * rules: - * - selector: "*" - * requirements: - * provider_id: google_calendar_auth + * + * type: google.api.Service + * name: calendar.googleapis.com + * title: Google Calendar API + * apis: + * - name: google.calendar.v3.Calendar + * + * visibility: + * rules: + * - selector: "google.calendar.v3.*" + * restriction: PREVIEW + * backend: + * rules: + * - selector: "google.calendar.v3.*" + * address: calendar.example.com + * + * authentication: + * providers: + * - id: google_calendar_auth + * jwks_uri: https://www.googleapis.com/oauth2/v1/certs + * issuer: https://securetoken.google.com + * rules: + * - selector: "*" + * requirements: + * provider_id: google_calendar_auth * * * Protobuf type {@code google.api.Service} */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder implements // @@protoc_insertion_point(builder_implements:google.api.Service) com.google.api.ServiceOrBuilder { @@ -2109,7 +2258,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.api.ServiceProto.internal_static_google_api_Service_fieldAccessorTable .ensureFieldAccessorsInitialized( @@ -2117,84 +2266,104 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } // Construct using com.google.api.Service.newBuilder() - private Builder() {} + private Builder() { + maybeForceBuilderInitialization(); + } - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetApisFieldBuilder(); + internalGetTypesFieldBuilder(); + internalGetEnumsFieldBuilder(); + internalGetDocumentationFieldBuilder(); + internalGetBackendFieldBuilder(); + internalGetHttpFieldBuilder(); + internalGetQuotaFieldBuilder(); + internalGetAuthenticationFieldBuilder(); + internalGetContextFieldBuilder(); + internalGetUsageFieldBuilder(); + internalGetEndpointsFieldBuilder(); + internalGetControlFieldBuilder(); + internalGetLogsFieldBuilder(); + internalGetMetricsFieldBuilder(); + internalGetMonitoredResourcesFieldBuilder(); + internalGetBillingFieldBuilder(); + internalGetLoggingFieldBuilder(); + internalGetMonitoringFieldBuilder(); + internalGetSystemParametersFieldBuilder(); + internalGetSourceInfoFieldBuilder(); + internalGetPublishingFieldBuilder(); + internalGetConfigVersionFieldBuilder(); + } } @java.lang.Override public Builder clear() { super.clear(); + bitField0_ = 0; name_ = ""; - title_ = ""; - producerProjectId_ = ""; - id_ = ""; - if (apisBuilder_ == null) { apis_ = java.util.Collections.emptyList(); } else { apis_ = null; apisBuilder_.clear(); } - bitField0_ = (bitField0_ & ~0x00000001); + bitField0_ = (bitField0_ & ~0x00000010); if (typesBuilder_ == null) { types_ = java.util.Collections.emptyList(); } else { types_ = null; typesBuilder_.clear(); } - bitField0_ = (bitField0_ & ~0x00000002); + bitField0_ = (bitField0_ & ~0x00000020); if (enumsBuilder_ == null) { enums_ = java.util.Collections.emptyList(); } else { enums_ = null; enumsBuilder_.clear(); } - bitField0_ = (bitField0_ & ~0x00000004); - if (documentationBuilder_ == null) { - documentation_ = null; - } else { - documentation_ = null; + bitField0_ = (bitField0_ & ~0x00000040); + documentation_ = null; + if (documentationBuilder_ != null) { + documentationBuilder_.dispose(); documentationBuilder_ = null; } - if (backendBuilder_ == null) { - backend_ = null; - } else { - backend_ = null; + backend_ = null; + if (backendBuilder_ != null) { + backendBuilder_.dispose(); backendBuilder_ = null; } - if (httpBuilder_ == null) { - http_ = null; - } else { - http_ = null; + http_ = null; + if (httpBuilder_ != null) { + httpBuilder_.dispose(); httpBuilder_ = null; } - if (quotaBuilder_ == null) { - quota_ = null; - } else { - quota_ = null; + quota_ = null; + if (quotaBuilder_ != null) { + quotaBuilder_.dispose(); quotaBuilder_ = null; } - if (authenticationBuilder_ == null) { - authentication_ = null; - } else { - authentication_ = null; + authentication_ = null; + if (authenticationBuilder_ != null) { + authenticationBuilder_.dispose(); authenticationBuilder_ = null; } - if (contextBuilder_ == null) { - context_ = null; - } else { - context_ = null; + context_ = null; + if (contextBuilder_ != null) { + contextBuilder_.dispose(); contextBuilder_ = null; } - if (usageBuilder_ == null) { - usage_ = null; - } else { - usage_ = null; + usage_ = null; + if (usageBuilder_ != null) { + usageBuilder_.dispose(); usageBuilder_ = null; } if (endpointsBuilder_ == null) { @@ -2203,11 +2372,10 @@ public Builder clear() { endpoints_ = null; endpointsBuilder_.clear(); } - bitField0_ = (bitField0_ & ~0x00000008); - if (controlBuilder_ == null) { - control_ = null; - } else { - control_ = null; + bitField0_ = (bitField0_ & ~0x00004000); + control_ = null; + if (controlBuilder_ != null) { + controlBuilder_.dispose(); controlBuilder_ = null; } if (logsBuilder_ == null) { @@ -2216,61 +2384,54 @@ public Builder clear() { logs_ = null; logsBuilder_.clear(); } - bitField0_ = (bitField0_ & ~0x00000010); + bitField0_ = (bitField0_ & ~0x00010000); if (metricsBuilder_ == null) { metrics_ = java.util.Collections.emptyList(); } else { metrics_ = null; metricsBuilder_.clear(); } - bitField0_ = (bitField0_ & ~0x00000020); + bitField0_ = (bitField0_ & ~0x00020000); if (monitoredResourcesBuilder_ == null) { monitoredResources_ = java.util.Collections.emptyList(); } else { monitoredResources_ = null; monitoredResourcesBuilder_.clear(); } - bitField0_ = (bitField0_ & ~0x00000040); - if (billingBuilder_ == null) { - billing_ = null; - } else { - billing_ = null; + bitField0_ = (bitField0_ & ~0x00040000); + billing_ = null; + if (billingBuilder_ != null) { + billingBuilder_.dispose(); billingBuilder_ = null; } - if (loggingBuilder_ == null) { - logging_ = null; - } else { - logging_ = null; + logging_ = null; + if (loggingBuilder_ != null) { + loggingBuilder_.dispose(); loggingBuilder_ = null; } - if (monitoringBuilder_ == null) { - monitoring_ = null; - } else { - monitoring_ = null; + monitoring_ = null; + if (monitoringBuilder_ != null) { + monitoringBuilder_.dispose(); monitoringBuilder_ = null; } - if (systemParametersBuilder_ == null) { - systemParameters_ = null; - } else { - systemParameters_ = null; + systemParameters_ = null; + if (systemParametersBuilder_ != null) { + systemParametersBuilder_.dispose(); systemParametersBuilder_ = null; } - if (sourceInfoBuilder_ == null) { - sourceInfo_ = null; - } else { - sourceInfo_ = null; + sourceInfo_ = null; + if (sourceInfoBuilder_ != null) { + sourceInfoBuilder_.dispose(); sourceInfoBuilder_ = null; } - if (publishingBuilder_ == null) { - publishing_ = null; - } else { - publishing_ = null; + publishing_ = null; + if (publishingBuilder_ != null) { + publishingBuilder_.dispose(); publishingBuilder_ = null; } - if (configVersionBuilder_ == null) { - configVersion_ = null; - } else { - configVersion_ = null; + configVersion_ = null; + if (configVersionBuilder_ != null) { + configVersionBuilder_.dispose(); configVersionBuilder_ = null; } return this; @@ -2298,184 +2459,160 @@ public com.google.api.Service build() { @java.lang.Override public com.google.api.Service buildPartial() { com.google.api.Service result = new com.google.api.Service(this); - int from_bitField0_ = bitField0_; - result.name_ = name_; - result.title_ = title_; - result.producerProjectId_ = producerProjectId_; - result.id_ = id_; + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields(com.google.api.Service result) { if (apisBuilder_ == null) { - if (((bitField0_ & 0x00000001) != 0)) { + if (((bitField0_ & 0x00000010) != 0)) { apis_ = java.util.Collections.unmodifiableList(apis_); - bitField0_ = (bitField0_ & ~0x00000001); + bitField0_ = (bitField0_ & ~0x00000010); } result.apis_ = apis_; } else { result.apis_ = apisBuilder_.build(); } if (typesBuilder_ == null) { - if (((bitField0_ & 0x00000002) != 0)) { + if (((bitField0_ & 0x00000020) != 0)) { types_ = java.util.Collections.unmodifiableList(types_); - bitField0_ = (bitField0_ & ~0x00000002); + bitField0_ = (bitField0_ & ~0x00000020); } result.types_ = types_; } else { result.types_ = typesBuilder_.build(); } if (enumsBuilder_ == null) { - if (((bitField0_ & 0x00000004) != 0)) { + if (((bitField0_ & 0x00000040) != 0)) { enums_ = java.util.Collections.unmodifiableList(enums_); - bitField0_ = (bitField0_ & ~0x00000004); + bitField0_ = (bitField0_ & ~0x00000040); } result.enums_ = enums_; } else { result.enums_ = enumsBuilder_.build(); } - if (documentationBuilder_ == null) { - result.documentation_ = documentation_; - } else { - result.documentation_ = documentationBuilder_.build(); - } - if (backendBuilder_ == null) { - result.backend_ = backend_; - } else { - result.backend_ = backendBuilder_.build(); - } - if (httpBuilder_ == null) { - result.http_ = http_; - } else { - result.http_ = httpBuilder_.build(); - } - if (quotaBuilder_ == null) { - result.quota_ = quota_; - } else { - result.quota_ = quotaBuilder_.build(); - } - if (authenticationBuilder_ == null) { - result.authentication_ = authentication_; - } else { - result.authentication_ = authenticationBuilder_.build(); - } - if (contextBuilder_ == null) { - result.context_ = context_; - } else { - result.context_ = contextBuilder_.build(); - } - if (usageBuilder_ == null) { - result.usage_ = usage_; - } else { - result.usage_ = usageBuilder_.build(); - } if (endpointsBuilder_ == null) { - if (((bitField0_ & 0x00000008) != 0)) { + if (((bitField0_ & 0x00004000) != 0)) { endpoints_ = java.util.Collections.unmodifiableList(endpoints_); - bitField0_ = (bitField0_ & ~0x00000008); + bitField0_ = (bitField0_ & ~0x00004000); } result.endpoints_ = endpoints_; } else { result.endpoints_ = endpointsBuilder_.build(); } - if (controlBuilder_ == null) { - result.control_ = control_; - } else { - result.control_ = controlBuilder_.build(); - } if (logsBuilder_ == null) { - if (((bitField0_ & 0x00000010) != 0)) { + if (((bitField0_ & 0x00010000) != 0)) { logs_ = java.util.Collections.unmodifiableList(logs_); - bitField0_ = (bitField0_ & ~0x00000010); + bitField0_ = (bitField0_ & ~0x00010000); } result.logs_ = logs_; } else { result.logs_ = logsBuilder_.build(); } if (metricsBuilder_ == null) { - if (((bitField0_ & 0x00000020) != 0)) { + if (((bitField0_ & 0x00020000) != 0)) { metrics_ = java.util.Collections.unmodifiableList(metrics_); - bitField0_ = (bitField0_ & ~0x00000020); + bitField0_ = (bitField0_ & ~0x00020000); } result.metrics_ = metrics_; } else { result.metrics_ = metricsBuilder_.build(); } if (monitoredResourcesBuilder_ == null) { - if (((bitField0_ & 0x00000040) != 0)) { + if (((bitField0_ & 0x00040000) != 0)) { monitoredResources_ = java.util.Collections.unmodifiableList(monitoredResources_); - bitField0_ = (bitField0_ & ~0x00000040); + bitField0_ = (bitField0_ & ~0x00040000); } result.monitoredResources_ = monitoredResources_; } else { result.monitoredResources_ = monitoredResourcesBuilder_.build(); } - if (billingBuilder_ == null) { - result.billing_ = billing_; - } else { - result.billing_ = billingBuilder_.build(); + } + + private void buildPartial0(com.google.api.Service result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; } - if (loggingBuilder_ == null) { - result.logging_ = logging_; - } else { - result.logging_ = loggingBuilder_.build(); + if (((from_bitField0_ & 0x00000002) != 0)) { + result.title_ = title_; } - if (monitoringBuilder_ == null) { - result.monitoring_ = monitoring_; - } else { - result.monitoring_ = monitoringBuilder_.build(); + if (((from_bitField0_ & 0x00000004) != 0)) { + result.producerProjectId_ = producerProjectId_; } - if (systemParametersBuilder_ == null) { - result.systemParameters_ = systemParameters_; - } else { - result.systemParameters_ = systemParametersBuilder_.build(); + if (((from_bitField0_ & 0x00000008) != 0)) { + result.id_ = id_; } - if (sourceInfoBuilder_ == null) { - result.sourceInfo_ = sourceInfo_; - } else { - result.sourceInfo_ = sourceInfoBuilder_.build(); + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000080) != 0)) { + result.documentation_ = + documentationBuilder_ == null ? documentation_ : documentationBuilder_.build(); + to_bitField0_ |= 0x00000001; } - if (publishingBuilder_ == null) { - result.publishing_ = publishing_; - } else { - result.publishing_ = publishingBuilder_.build(); + if (((from_bitField0_ & 0x00000100) != 0)) { + result.backend_ = backendBuilder_ == null ? backend_ : backendBuilder_.build(); + to_bitField0_ |= 0x00000002; } - if (configVersionBuilder_ == null) { - result.configVersion_ = configVersion_; - } else { - result.configVersion_ = configVersionBuilder_.build(); + if (((from_bitField0_ & 0x00000200) != 0)) { + result.http_ = httpBuilder_ == null ? http_ : httpBuilder_.build(); + to_bitField0_ |= 0x00000004; } - 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); + if (((from_bitField0_ & 0x00000400) != 0)) { + result.quota_ = quotaBuilder_ == null ? quota_ : quotaBuilder_.build(); + to_bitField0_ |= 0x00000008; + } + if (((from_bitField0_ & 0x00000800) != 0)) { + result.authentication_ = + authenticationBuilder_ == null ? authentication_ : authenticationBuilder_.build(); + to_bitField0_ |= 0x00000010; + } + if (((from_bitField0_ & 0x00001000) != 0)) { + result.context_ = contextBuilder_ == null ? context_ : contextBuilder_.build(); + to_bitField0_ |= 0x00000020; + } + if (((from_bitField0_ & 0x00002000) != 0)) { + result.usage_ = usageBuilder_ == null ? usage_ : usageBuilder_.build(); + to_bitField0_ |= 0x00000040; + } + if (((from_bitField0_ & 0x00008000) != 0)) { + result.control_ = controlBuilder_ == null ? control_ : controlBuilder_.build(); + to_bitField0_ |= 0x00000080; + } + if (((from_bitField0_ & 0x00080000) != 0)) { + result.billing_ = billingBuilder_ == null ? billing_ : billingBuilder_.build(); + to_bitField0_ |= 0x00000100; + } + if (((from_bitField0_ & 0x00100000) != 0)) { + result.logging_ = loggingBuilder_ == null ? logging_ : loggingBuilder_.build(); + to_bitField0_ |= 0x00000200; + } + if (((from_bitField0_ & 0x00200000) != 0)) { + result.monitoring_ = monitoringBuilder_ == null ? monitoring_ : monitoringBuilder_.build(); + to_bitField0_ |= 0x00000400; + } + if (((from_bitField0_ & 0x00400000) != 0)) { + result.systemParameters_ = + systemParametersBuilder_ == null ? systemParameters_ : systemParametersBuilder_.build(); + to_bitField0_ |= 0x00000800; + } + if (((from_bitField0_ & 0x00800000) != 0)) { + result.sourceInfo_ = sourceInfoBuilder_ == null ? sourceInfo_ : sourceInfoBuilder_.build(); + to_bitField0_ |= 0x00001000; + } + if (((from_bitField0_ & 0x01000000) != 0)) { + result.publishing_ = publishingBuilder_ == null ? publishing_ : publishingBuilder_.build(); + to_bitField0_ |= 0x00002000; + } + if (((from_bitField0_ & 0x02000000) != 0)) { + result.configVersion_ = + configVersionBuilder_ == null ? configVersion_ : configVersionBuilder_.build(); + to_bitField0_ |= 0x00004000; + } + result.bitField0_ |= to_bitField0_; } @java.lang.Override @@ -2492,25 +2629,29 @@ public Builder mergeFrom(com.google.api.Service other) { if (other == com.google.api.Service.getDefaultInstance()) return this; if (!other.getName().isEmpty()) { name_ = other.name_; + bitField0_ |= 0x00000001; onChanged(); } if (!other.getTitle().isEmpty()) { title_ = other.title_; + bitField0_ |= 0x00000002; onChanged(); } if (!other.getProducerProjectId().isEmpty()) { producerProjectId_ = other.producerProjectId_; + bitField0_ |= 0x00000004; onChanged(); } if (!other.getId().isEmpty()) { id_ = other.id_; + bitField0_ |= 0x00000008; onChanged(); } if (apisBuilder_ == null) { if (!other.apis_.isEmpty()) { if (apis_.isEmpty()) { apis_ = other.apis_; - bitField0_ = (bitField0_ & ~0x00000001); + bitField0_ = (bitField0_ & ~0x00000010); } else { ensureApisIsMutable(); apis_.addAll(other.apis_); @@ -2523,10 +2664,10 @@ public Builder mergeFrom(com.google.api.Service other) { apisBuilder_.dispose(); apisBuilder_ = null; apis_ = other.apis_; - bitField0_ = (bitField0_ & ~0x00000001); + bitField0_ = (bitField0_ & ~0x00000010); apisBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders - ? getApisFieldBuilder() + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders + ? internalGetApisFieldBuilder() : null; } else { apisBuilder_.addAllMessages(other.apis_); @@ -2537,7 +2678,7 @@ public Builder mergeFrom(com.google.api.Service other) { if (!other.types_.isEmpty()) { if (types_.isEmpty()) { types_ = other.types_; - bitField0_ = (bitField0_ & ~0x00000002); + bitField0_ = (bitField0_ & ~0x00000020); } else { ensureTypesIsMutable(); types_.addAll(other.types_); @@ -2550,10 +2691,10 @@ public Builder mergeFrom(com.google.api.Service other) { typesBuilder_.dispose(); typesBuilder_ = null; types_ = other.types_; - bitField0_ = (bitField0_ & ~0x00000002); + bitField0_ = (bitField0_ & ~0x00000020); typesBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders - ? getTypesFieldBuilder() + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders + ? internalGetTypesFieldBuilder() : null; } else { typesBuilder_.addAllMessages(other.types_); @@ -2564,7 +2705,7 @@ public Builder mergeFrom(com.google.api.Service other) { if (!other.enums_.isEmpty()) { if (enums_.isEmpty()) { enums_ = other.enums_; - bitField0_ = (bitField0_ & ~0x00000004); + bitField0_ = (bitField0_ & ~0x00000040); } else { ensureEnumsIsMutable(); enums_.addAll(other.enums_); @@ -2577,10 +2718,10 @@ public Builder mergeFrom(com.google.api.Service other) { enumsBuilder_.dispose(); enumsBuilder_ = null; enums_ = other.enums_; - bitField0_ = (bitField0_ & ~0x00000004); + bitField0_ = (bitField0_ & ~0x00000040); enumsBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders - ? getEnumsFieldBuilder() + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders + ? internalGetEnumsFieldBuilder() : null; } else { enumsBuilder_.addAllMessages(other.enums_); @@ -2612,7 +2753,7 @@ public Builder mergeFrom(com.google.api.Service other) { if (!other.endpoints_.isEmpty()) { if (endpoints_.isEmpty()) { endpoints_ = other.endpoints_; - bitField0_ = (bitField0_ & ~0x00000008); + bitField0_ = (bitField0_ & ~0x00004000); } else { ensureEndpointsIsMutable(); endpoints_.addAll(other.endpoints_); @@ -2625,10 +2766,10 @@ public Builder mergeFrom(com.google.api.Service other) { endpointsBuilder_.dispose(); endpointsBuilder_ = null; endpoints_ = other.endpoints_; - bitField0_ = (bitField0_ & ~0x00000008); + bitField0_ = (bitField0_ & ~0x00004000); endpointsBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders - ? getEndpointsFieldBuilder() + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders + ? internalGetEndpointsFieldBuilder() : null; } else { endpointsBuilder_.addAllMessages(other.endpoints_); @@ -2642,7 +2783,7 @@ public Builder mergeFrom(com.google.api.Service other) { if (!other.logs_.isEmpty()) { if (logs_.isEmpty()) { logs_ = other.logs_; - bitField0_ = (bitField0_ & ~0x00000010); + bitField0_ = (bitField0_ & ~0x00010000); } else { ensureLogsIsMutable(); logs_.addAll(other.logs_); @@ -2655,10 +2796,10 @@ public Builder mergeFrom(com.google.api.Service other) { logsBuilder_.dispose(); logsBuilder_ = null; logs_ = other.logs_; - bitField0_ = (bitField0_ & ~0x00000010); + bitField0_ = (bitField0_ & ~0x00010000); logsBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders - ? getLogsFieldBuilder() + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders + ? internalGetLogsFieldBuilder() : null; } else { logsBuilder_.addAllMessages(other.logs_); @@ -2669,7 +2810,7 @@ public Builder mergeFrom(com.google.api.Service other) { if (!other.metrics_.isEmpty()) { if (metrics_.isEmpty()) { metrics_ = other.metrics_; - bitField0_ = (bitField0_ & ~0x00000020); + bitField0_ = (bitField0_ & ~0x00020000); } else { ensureMetricsIsMutable(); metrics_.addAll(other.metrics_); @@ -2682,10 +2823,10 @@ public Builder mergeFrom(com.google.api.Service other) { metricsBuilder_.dispose(); metricsBuilder_ = null; metrics_ = other.metrics_; - bitField0_ = (bitField0_ & ~0x00000020); + bitField0_ = (bitField0_ & ~0x00020000); metricsBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders - ? getMetricsFieldBuilder() + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders + ? internalGetMetricsFieldBuilder() : null; } else { metricsBuilder_.addAllMessages(other.metrics_); @@ -2696,7 +2837,7 @@ public Builder mergeFrom(com.google.api.Service other) { if (!other.monitoredResources_.isEmpty()) { if (monitoredResources_.isEmpty()) { monitoredResources_ = other.monitoredResources_; - bitField0_ = (bitField0_ & ~0x00000040); + bitField0_ = (bitField0_ & ~0x00040000); } else { ensureMonitoredResourcesIsMutable(); monitoredResources_.addAll(other.monitoredResources_); @@ -2709,10 +2850,10 @@ public Builder mergeFrom(com.google.api.Service other) { monitoredResourcesBuilder_.dispose(); monitoredResourcesBuilder_ = null; monitoredResources_ = other.monitoredResources_; - bitField0_ = (bitField0_ & ~0x00000040); + bitField0_ = (bitField0_ & ~0x00040000); monitoredResourcesBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders - ? getMonitoredResourcesFieldBuilder() + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders + ? internalGetMonitoredResourcesFieldBuilder() : null; } else { monitoredResourcesBuilder_.addAllMessages(other.monitoredResources_); @@ -2769,13 +2910,13 @@ public Builder mergeFrom( case 10: { name_ = input.readStringRequireUtf8(); - + bitField0_ |= 0x00000001; break; } // case 10 case 18: { title_ = input.readStringRequireUtf8(); - + bitField0_ |= 0x00000002; break; } // case 18 case 26: @@ -2816,44 +2957,46 @@ public Builder mergeFrom( } // case 42 case 50: { - input.readMessage(getDocumentationFieldBuilder().getBuilder(), extensionRegistry); - + input.readMessage( + internalGetDocumentationFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000080; break; } // case 50 case 66: { - input.readMessage(getBackendFieldBuilder().getBuilder(), extensionRegistry); - + input.readMessage(internalGetBackendFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000100; break; } // case 66 case 74: { - input.readMessage(getHttpFieldBuilder().getBuilder(), extensionRegistry); - + input.readMessage(internalGetHttpFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000200; break; } // case 74 case 82: { - input.readMessage(getQuotaFieldBuilder().getBuilder(), extensionRegistry); - + input.readMessage(internalGetQuotaFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000400; break; } // case 82 case 90: { - input.readMessage(getAuthenticationFieldBuilder().getBuilder(), extensionRegistry); - + input.readMessage( + internalGetAuthenticationFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000800; break; } // case 90 case 98: { - input.readMessage(getContextFieldBuilder().getBuilder(), extensionRegistry); - + input.readMessage(internalGetContextFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00001000; break; } // case 98 case 122: { - input.readMessage(getUsageFieldBuilder().getBuilder(), extensionRegistry); - + input.readMessage(internalGetUsageFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00002000; break; } // case 122 case 146: @@ -2870,20 +3013,21 @@ public Builder mergeFrom( } // case 146 case 162: { - input.readMessage(getConfigVersionFieldBuilder().getBuilder(), extensionRegistry); - + input.readMessage( + internalGetConfigVersionFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x02000000; break; } // case 162 case 170: { - input.readMessage(getControlFieldBuilder().getBuilder(), extensionRegistry); - + input.readMessage(internalGetControlFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00008000; break; } // case 170 case 178: { producerProjectId_ = input.readStringRequireUtf8(); - + bitField0_ |= 0x00000004; break; } // case 178 case 186: @@ -2925,45 +3069,48 @@ public Builder mergeFrom( } // case 202 case 210: { - input.readMessage(getBillingFieldBuilder().getBuilder(), extensionRegistry); - + input.readMessage(internalGetBillingFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00080000; break; } // case 210 case 218: { - input.readMessage(getLoggingFieldBuilder().getBuilder(), extensionRegistry); - + input.readMessage(internalGetLoggingFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00100000; break; } // case 218 case 226: { - input.readMessage(getMonitoringFieldBuilder().getBuilder(), extensionRegistry); - + input.readMessage( + internalGetMonitoringFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00200000; break; } // case 226 case 234: { input.readMessage( - getSystemParametersFieldBuilder().getBuilder(), extensionRegistry); - + internalGetSystemParametersFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00400000; break; } // case 234 case 266: { id_ = input.readStringRequireUtf8(); - + bitField0_ |= 0x00000008; break; } // case 266 case 298: { - input.readMessage(getSourceInfoFieldBuilder().getBuilder(), extensionRegistry); - + input.readMessage( + internalGetSourceInfoFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00800000; break; } // case 298 case 362: { - input.readMessage(getPublishingFieldBuilder().getBuilder(), extensionRegistry); - + input.readMessage( + internalGetPublishingFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x01000000; break; } // case 362 default: @@ -2986,6 +3133,7 @@ public Builder mergeFrom( private int bitField0_; private java.lang.Object name_ = ""; + /** * * @@ -3011,6 +3159,7 @@ public java.lang.String getName() { return (java.lang.String) ref; } } + /** * * @@ -3036,6 +3185,7 @@ public com.google.protobuf.ByteString getNameBytes() { return (com.google.protobuf.ByteString) ref; } } + /** * * @@ -3055,11 +3205,12 @@ public Builder setName(java.lang.String value) { if (value == null) { throw new NullPointerException(); } - name_ = value; + bitField0_ |= 0x00000001; onChanged(); return this; } + /** * * @@ -3075,11 +3226,12 @@ public Builder setName(java.lang.String value) { * @return This builder for chaining. */ public Builder clearName() { - name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); onChanged(); return this; } + /** * * @@ -3100,13 +3252,14 @@ public Builder setNameBytes(com.google.protobuf.ByteString value) { throw new NullPointerException(); } checkByteStringIsUtf8(value); - name_ = value; + bitField0_ |= 0x00000001; onChanged(); return this; } private java.lang.Object title_ = ""; + /** * * @@ -3130,6 +3283,7 @@ public java.lang.String getTitle() { return (java.lang.String) ref; } } + /** * * @@ -3153,6 +3307,7 @@ public com.google.protobuf.ByteString getTitleBytes() { return (com.google.protobuf.ByteString) ref; } } + /** * * @@ -3170,11 +3325,12 @@ public Builder setTitle(java.lang.String value) { if (value == null) { throw new NullPointerException(); } - title_ = value; + bitField0_ |= 0x00000002; onChanged(); return this; } + /** * * @@ -3188,11 +3344,12 @@ public Builder setTitle(java.lang.String value) { * @return This builder for chaining. */ public Builder clearTitle() { - title_ = getDefaultInstance().getTitle(); + bitField0_ = (bitField0_ & ~0x00000002); onChanged(); return this; } + /** * * @@ -3211,13 +3368,14 @@ public Builder setTitleBytes(com.google.protobuf.ByteString value) { throw new NullPointerException(); } checkByteStringIsUtf8(value); - title_ = value; + bitField0_ |= 0x00000002; onChanged(); return this; } private java.lang.Object producerProjectId_ = ""; + /** * * @@ -3240,6 +3398,7 @@ public java.lang.String getProducerProjectId() { return (java.lang.String) ref; } } + /** * * @@ -3262,6 +3421,7 @@ public com.google.protobuf.ByteString getProducerProjectIdBytes() { return (com.google.protobuf.ByteString) ref; } } + /** * * @@ -3278,11 +3438,12 @@ public Builder setProducerProjectId(java.lang.String value) { if (value == null) { throw new NullPointerException(); } - producerProjectId_ = value; + bitField0_ |= 0x00000004; onChanged(); return this; } + /** * * @@ -3295,11 +3456,12 @@ public Builder setProducerProjectId(java.lang.String value) { * @return This builder for chaining. */ public Builder clearProducerProjectId() { - producerProjectId_ = getDefaultInstance().getProducerProjectId(); + bitField0_ = (bitField0_ & ~0x00000004); onChanged(); return this; } + /** * * @@ -3317,13 +3479,14 @@ public Builder setProducerProjectIdBytes(com.google.protobuf.ByteString value) { throw new NullPointerException(); } checkByteStringIsUtf8(value); - producerProjectId_ = value; + bitField0_ |= 0x00000004; onChanged(); return this; } private java.lang.Object id_ = ""; + /** * * @@ -3349,6 +3512,7 @@ public java.lang.String getId() { return (java.lang.String) ref; } } + /** * * @@ -3374,6 +3538,7 @@ public com.google.protobuf.ByteString getIdBytes() { return (com.google.protobuf.ByteString) ref; } } + /** * * @@ -3393,11 +3558,12 @@ public Builder setId(java.lang.String value) { if (value == null) { throw new NullPointerException(); } - id_ = value; + bitField0_ |= 0x00000008; onChanged(); return this; } + /** * * @@ -3413,11 +3579,12 @@ public Builder setId(java.lang.String value) { * @return This builder for chaining. */ public Builder clearId() { - id_ = getDefaultInstance().getId(); + bitField0_ = (bitField0_ & ~0x00000008); onChanged(); return this; } + /** * * @@ -3438,8 +3605,8 @@ public Builder setIdBytes(com.google.protobuf.ByteString value) { throw new NullPointerException(); } checkByteStringIsUtf8(value); - id_ = value; + bitField0_ |= 0x00000008; onChanged(); return this; } @@ -3447,13 +3614,13 @@ public Builder setIdBytes(com.google.protobuf.ByteString value) { private java.util.List apis_ = java.util.Collections.emptyList(); private void ensureApisIsMutable() { - if (!((bitField0_ & 0x00000001) != 0)) { + if (!((bitField0_ & 0x00000010) != 0)) { apis_ = new java.util.ArrayList(apis_); - bitField0_ |= 0x00000001; + bitField0_ |= 0x00000010; } } - private com.google.protobuf.RepeatedFieldBuilderV3< + private com.google.protobuf.RepeatedFieldBuilder< com.google.protobuf.Api, com.google.protobuf.Api.Builder, com.google.protobuf.ApiOrBuilder> @@ -3464,10 +3631,10 @@ private void ensureApisIsMutable() { * *
              * A list of API interfaces exported by this service. Only the `name` field
        -     * of the [google.protobuf.Api][google.protobuf.Api] needs to be provided by the configuration
        -     * author, as the remaining fields will be derived from the IDL during the
        -     * normalization process. It is an error to specify an API interface here
        -     * which cannot be resolved against the associated IDL files.
        +     * of the [google.protobuf.Api][google.protobuf.Api] needs to be provided by
        +     * the configuration author, as the remaining fields will be derived from the
        +     * IDL during the normalization process. It is an error to specify an API
        +     * interface here which cannot be resolved against the associated IDL files.
              * 
        * * repeated .google.protobuf.Api apis = 3; @@ -3479,15 +3646,16 @@ public java.util.List getApisList() { return apisBuilder_.getMessageList(); } } + /** * * *
              * A list of API interfaces exported by this service. Only the `name` field
        -     * of the [google.protobuf.Api][google.protobuf.Api] needs to be provided by the configuration
        -     * author, as the remaining fields will be derived from the IDL during the
        -     * normalization process. It is an error to specify an API interface here
        -     * which cannot be resolved against the associated IDL files.
        +     * of the [google.protobuf.Api][google.protobuf.Api] needs to be provided by
        +     * the configuration author, as the remaining fields will be derived from the
        +     * IDL during the normalization process. It is an error to specify an API
        +     * interface here which cannot be resolved against the associated IDL files.
              * 
        * * repeated .google.protobuf.Api apis = 3; @@ -3499,15 +3667,16 @@ public int getApisCount() { return apisBuilder_.getCount(); } } + /** * * *
              * A list of API interfaces exported by this service. Only the `name` field
        -     * of the [google.protobuf.Api][google.protobuf.Api] needs to be provided by the configuration
        -     * author, as the remaining fields will be derived from the IDL during the
        -     * normalization process. It is an error to specify an API interface here
        -     * which cannot be resolved against the associated IDL files.
        +     * of the [google.protobuf.Api][google.protobuf.Api] needs to be provided by
        +     * the configuration author, as the remaining fields will be derived from the
        +     * IDL during the normalization process. It is an error to specify an API
        +     * interface here which cannot be resolved against the associated IDL files.
              * 
        * * repeated .google.protobuf.Api apis = 3; @@ -3519,15 +3688,16 @@ public com.google.protobuf.Api getApis(int index) { return apisBuilder_.getMessage(index); } } + /** * * *
              * A list of API interfaces exported by this service. Only the `name` field
        -     * of the [google.protobuf.Api][google.protobuf.Api] needs to be provided by the configuration
        -     * author, as the remaining fields will be derived from the IDL during the
        -     * normalization process. It is an error to specify an API interface here
        -     * which cannot be resolved against the associated IDL files.
        +     * of the [google.protobuf.Api][google.protobuf.Api] needs to be provided by
        +     * the configuration author, as the remaining fields will be derived from the
        +     * IDL during the normalization process. It is an error to specify an API
        +     * interface here which cannot be resolved against the associated IDL files.
              * 
        * * repeated .google.protobuf.Api apis = 3; @@ -3545,15 +3715,16 @@ public Builder setApis(int index, com.google.protobuf.Api value) { } return this; } + /** * * *
              * A list of API interfaces exported by this service. Only the `name` field
        -     * of the [google.protobuf.Api][google.protobuf.Api] needs to be provided by the configuration
        -     * author, as the remaining fields will be derived from the IDL during the
        -     * normalization process. It is an error to specify an API interface here
        -     * which cannot be resolved against the associated IDL files.
        +     * of the [google.protobuf.Api][google.protobuf.Api] needs to be provided by
        +     * the configuration author, as the remaining fields will be derived from the
        +     * IDL during the normalization process. It is an error to specify an API
        +     * interface here which cannot be resolved against the associated IDL files.
              * 
        * * repeated .google.protobuf.Api apis = 3; @@ -3568,15 +3739,16 @@ public Builder setApis(int index, com.google.protobuf.Api.Builder builderForValu } return this; } + /** * * *
              * A list of API interfaces exported by this service. Only the `name` field
        -     * of the [google.protobuf.Api][google.protobuf.Api] needs to be provided by the configuration
        -     * author, as the remaining fields will be derived from the IDL during the
        -     * normalization process. It is an error to specify an API interface here
        -     * which cannot be resolved against the associated IDL files.
        +     * of the [google.protobuf.Api][google.protobuf.Api] needs to be provided by
        +     * the configuration author, as the remaining fields will be derived from the
        +     * IDL during the normalization process. It is an error to specify an API
        +     * interface here which cannot be resolved against the associated IDL files.
              * 
        * * repeated .google.protobuf.Api apis = 3; @@ -3594,15 +3766,16 @@ public Builder addApis(com.google.protobuf.Api value) { } return this; } + /** * * *
              * A list of API interfaces exported by this service. Only the `name` field
        -     * of the [google.protobuf.Api][google.protobuf.Api] needs to be provided by the configuration
        -     * author, as the remaining fields will be derived from the IDL during the
        -     * normalization process. It is an error to specify an API interface here
        -     * which cannot be resolved against the associated IDL files.
        +     * of the [google.protobuf.Api][google.protobuf.Api] needs to be provided by
        +     * the configuration author, as the remaining fields will be derived from the
        +     * IDL during the normalization process. It is an error to specify an API
        +     * interface here which cannot be resolved against the associated IDL files.
              * 
        * * repeated .google.protobuf.Api apis = 3; @@ -3620,15 +3793,16 @@ public Builder addApis(int index, com.google.protobuf.Api value) { } return this; } + /** * * *
              * A list of API interfaces exported by this service. Only the `name` field
        -     * of the [google.protobuf.Api][google.protobuf.Api] needs to be provided by the configuration
        -     * author, as the remaining fields will be derived from the IDL during the
        -     * normalization process. It is an error to specify an API interface here
        -     * which cannot be resolved against the associated IDL files.
        +     * of the [google.protobuf.Api][google.protobuf.Api] needs to be provided by
        +     * the configuration author, as the remaining fields will be derived from the
        +     * IDL during the normalization process. It is an error to specify an API
        +     * interface here which cannot be resolved against the associated IDL files.
              * 
        * * repeated .google.protobuf.Api apis = 3; @@ -3643,15 +3817,16 @@ public Builder addApis(com.google.protobuf.Api.Builder builderForValue) { } return this; } + /** * * *
              * A list of API interfaces exported by this service. Only the `name` field
        -     * of the [google.protobuf.Api][google.protobuf.Api] needs to be provided by the configuration
        -     * author, as the remaining fields will be derived from the IDL during the
        -     * normalization process. It is an error to specify an API interface here
        -     * which cannot be resolved against the associated IDL files.
        +     * of the [google.protobuf.Api][google.protobuf.Api] needs to be provided by
        +     * the configuration author, as the remaining fields will be derived from the
        +     * IDL during the normalization process. It is an error to specify an API
        +     * interface here which cannot be resolved against the associated IDL files.
              * 
        * * repeated .google.protobuf.Api apis = 3; @@ -3666,15 +3841,16 @@ public Builder addApis(int index, com.google.protobuf.Api.Builder builderForValu } return this; } + /** * * *
              * A list of API interfaces exported by this service. Only the `name` field
        -     * of the [google.protobuf.Api][google.protobuf.Api] needs to be provided by the configuration
        -     * author, as the remaining fields will be derived from the IDL during the
        -     * normalization process. It is an error to specify an API interface here
        -     * which cannot be resolved against the associated IDL files.
        +     * of the [google.protobuf.Api][google.protobuf.Api] needs to be provided by
        +     * the configuration author, as the remaining fields will be derived from the
        +     * IDL during the normalization process. It is an error to specify an API
        +     * interface here which cannot be resolved against the associated IDL files.
              * 
        * * repeated .google.protobuf.Api apis = 3; @@ -3689,15 +3865,16 @@ public Builder addAllApis(java.lang.Iterable } return this; } + /** * * *
              * A list of API interfaces exported by this service. Only the `name` field
        -     * of the [google.protobuf.Api][google.protobuf.Api] needs to be provided by the configuration
        -     * author, as the remaining fields will be derived from the IDL during the
        -     * normalization process. It is an error to specify an API interface here
        -     * which cannot be resolved against the associated IDL files.
        +     * of the [google.protobuf.Api][google.protobuf.Api] needs to be provided by
        +     * the configuration author, as the remaining fields will be derived from the
        +     * IDL during the normalization process. It is an error to specify an API
        +     * interface here which cannot be resolved against the associated IDL files.
              * 
        * * repeated .google.protobuf.Api apis = 3; @@ -3705,22 +3882,23 @@ public Builder addAllApis(java.lang.Iterable public Builder clearApis() { if (apisBuilder_ == null) { apis_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); + bitField0_ = (bitField0_ & ~0x00000010); onChanged(); } else { apisBuilder_.clear(); } return this; } + /** * * *
              * A list of API interfaces exported by this service. Only the `name` field
        -     * of the [google.protobuf.Api][google.protobuf.Api] needs to be provided by the configuration
        -     * author, as the remaining fields will be derived from the IDL during the
        -     * normalization process. It is an error to specify an API interface here
        -     * which cannot be resolved against the associated IDL files.
        +     * of the [google.protobuf.Api][google.protobuf.Api] needs to be provided by
        +     * the configuration author, as the remaining fields will be derived from the
        +     * IDL during the normalization process. It is an error to specify an API
        +     * interface here which cannot be resolved against the associated IDL files.
              * 
        * * repeated .google.protobuf.Api apis = 3; @@ -3735,31 +3913,33 @@ public Builder removeApis(int index) { } return this; } + /** * * *
              * A list of API interfaces exported by this service. Only the `name` field
        -     * of the [google.protobuf.Api][google.protobuf.Api] needs to be provided by the configuration
        -     * author, as the remaining fields will be derived from the IDL during the
        -     * normalization process. It is an error to specify an API interface here
        -     * which cannot be resolved against the associated IDL files.
        +     * of the [google.protobuf.Api][google.protobuf.Api] needs to be provided by
        +     * the configuration author, as the remaining fields will be derived from the
        +     * IDL during the normalization process. It is an error to specify an API
        +     * interface here which cannot be resolved against the associated IDL files.
              * 
        * * repeated .google.protobuf.Api apis = 3; */ public com.google.protobuf.Api.Builder getApisBuilder(int index) { - return getApisFieldBuilder().getBuilder(index); + return internalGetApisFieldBuilder().getBuilder(index); } + /** * * *
              * A list of API interfaces exported by this service. Only the `name` field
        -     * of the [google.protobuf.Api][google.protobuf.Api] needs to be provided by the configuration
        -     * author, as the remaining fields will be derived from the IDL during the
        -     * normalization process. It is an error to specify an API interface here
        -     * which cannot be resolved against the associated IDL files.
        +     * of the [google.protobuf.Api][google.protobuf.Api] needs to be provided by
        +     * the configuration author, as the remaining fields will be derived from the
        +     * IDL during the normalization process. It is an error to specify an API
        +     * interface here which cannot be resolved against the associated IDL files.
              * 
        * * repeated .google.protobuf.Api apis = 3; @@ -3771,15 +3951,16 @@ public com.google.protobuf.ApiOrBuilder getApisOrBuilder(int index) { return apisBuilder_.getMessageOrBuilder(index); } } + /** * * *
              * A list of API interfaces exported by this service. Only the `name` field
        -     * of the [google.protobuf.Api][google.protobuf.Api] needs to be provided by the configuration
        -     * author, as the remaining fields will be derived from the IDL during the
        -     * normalization process. It is an error to specify an API interface here
        -     * which cannot be resolved against the associated IDL files.
        +     * of the [google.protobuf.Api][google.protobuf.Api] needs to be provided by
        +     * the configuration author, as the remaining fields will be derived from the
        +     * IDL during the normalization process. It is an error to specify an API
        +     * interface here which cannot be resolved against the associated IDL files.
              * 
        * * repeated .google.protobuf.Api apis = 3; @@ -3791,67 +3972,71 @@ public java.util.List getApisOrBuild return java.util.Collections.unmodifiableList(apis_); } } + /** * * *
              * A list of API interfaces exported by this service. Only the `name` field
        -     * of the [google.protobuf.Api][google.protobuf.Api] needs to be provided by the configuration
        -     * author, as the remaining fields will be derived from the IDL during the
        -     * normalization process. It is an error to specify an API interface here
        -     * which cannot be resolved against the associated IDL files.
        +     * of the [google.protobuf.Api][google.protobuf.Api] needs to be provided by
        +     * the configuration author, as the remaining fields will be derived from the
        +     * IDL during the normalization process. It is an error to specify an API
        +     * interface here which cannot be resolved against the associated IDL files.
              * 
        * * repeated .google.protobuf.Api apis = 3; */ public com.google.protobuf.Api.Builder addApisBuilder() { - return getApisFieldBuilder().addBuilder(com.google.protobuf.Api.getDefaultInstance()); + return internalGetApisFieldBuilder().addBuilder(com.google.protobuf.Api.getDefaultInstance()); } + /** * * *
              * A list of API interfaces exported by this service. Only the `name` field
        -     * of the [google.protobuf.Api][google.protobuf.Api] needs to be provided by the configuration
        -     * author, as the remaining fields will be derived from the IDL during the
        -     * normalization process. It is an error to specify an API interface here
        -     * which cannot be resolved against the associated IDL files.
        +     * of the [google.protobuf.Api][google.protobuf.Api] needs to be provided by
        +     * the configuration author, as the remaining fields will be derived from the
        +     * IDL during the normalization process. It is an error to specify an API
        +     * interface here which cannot be resolved against the associated IDL files.
              * 
        * * repeated .google.protobuf.Api apis = 3; */ public com.google.protobuf.Api.Builder addApisBuilder(int index) { - return getApisFieldBuilder().addBuilder(index, com.google.protobuf.Api.getDefaultInstance()); + return internalGetApisFieldBuilder() + .addBuilder(index, com.google.protobuf.Api.getDefaultInstance()); } + /** * * *
              * A list of API interfaces exported by this service. Only the `name` field
        -     * of the [google.protobuf.Api][google.protobuf.Api] needs to be provided by the configuration
        -     * author, as the remaining fields will be derived from the IDL during the
        -     * normalization process. It is an error to specify an API interface here
        -     * which cannot be resolved against the associated IDL files.
        +     * of the [google.protobuf.Api][google.protobuf.Api] needs to be provided by
        +     * the configuration author, as the remaining fields will be derived from the
        +     * IDL during the normalization process. It is an error to specify an API
        +     * interface here which cannot be resolved against the associated IDL files.
              * 
        * * repeated .google.protobuf.Api apis = 3; */ public java.util.List getApisBuilderList() { - return getApisFieldBuilder().getBuilderList(); + return internalGetApisFieldBuilder().getBuilderList(); } - private com.google.protobuf.RepeatedFieldBuilderV3< + private com.google.protobuf.RepeatedFieldBuilder< com.google.protobuf.Api, com.google.protobuf.Api.Builder, com.google.protobuf.ApiOrBuilder> - getApisFieldBuilder() { + internalGetApisFieldBuilder() { if (apisBuilder_ == null) { apisBuilder_ = - new com.google.protobuf.RepeatedFieldBuilderV3< + new com.google.protobuf.RepeatedFieldBuilder< com.google.protobuf.Api, com.google.protobuf.Api.Builder, com.google.protobuf.ApiOrBuilder>( - apis_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + apis_, ((bitField0_ & 0x00000010) != 0), getParentForChildren(), isClean()); apis_ = null; } return apisBuilder_; @@ -3860,13 +4045,13 @@ public java.util.List getApisBuilderList() { private java.util.List types_ = java.util.Collections.emptyList(); private void ensureTypesIsMutable() { - if (!((bitField0_ & 0x00000002) != 0)) { + if (!((bitField0_ & 0x00000020) != 0)) { types_ = new java.util.ArrayList(types_); - bitField0_ |= 0x00000002; + bitField0_ |= 0x00000020; } } - private com.google.protobuf.RepeatedFieldBuilderV3< + private com.google.protobuf.RepeatedFieldBuilder< com.google.protobuf.Type, com.google.protobuf.Type.Builder, com.google.protobuf.TypeOrBuilder> @@ -3881,8 +4066,9 @@ private void ensureTypesIsMutable() { * included. Messages which are not referenced but shall be included, such as * types used by the `google.protobuf.Any` type, should be listed here by * name by the configuration author. Example: - * types: - * - name: google.protobuf.Int32 + * + * types: + * - name: google.protobuf.Int32 * * * repeated .google.protobuf.Type types = 4; @@ -3894,6 +4080,7 @@ public java.util.List getTypesList() { return typesBuilder_.getMessageList(); } } + /** * * @@ -3903,8 +4090,9 @@ public java.util.List getTypesList() { * included. Messages which are not referenced but shall be included, such as * types used by the `google.protobuf.Any` type, should be listed here by * name by the configuration author. Example: - * types: - * - name: google.protobuf.Int32 + * + * types: + * - name: google.protobuf.Int32 * * * repeated .google.protobuf.Type types = 4; @@ -3916,6 +4104,7 @@ public int getTypesCount() { return typesBuilder_.getCount(); } } + /** * * @@ -3925,8 +4114,9 @@ public int getTypesCount() { * included. Messages which are not referenced but shall be included, such as * types used by the `google.protobuf.Any` type, should be listed here by * name by the configuration author. Example: - * types: - * - name: google.protobuf.Int32 + * + * types: + * - name: google.protobuf.Int32 * * * repeated .google.protobuf.Type types = 4; @@ -3938,6 +4128,7 @@ public com.google.protobuf.Type getTypes(int index) { return typesBuilder_.getMessage(index); } } + /** * * @@ -3947,8 +4138,9 @@ public com.google.protobuf.Type getTypes(int index) { * included. Messages which are not referenced but shall be included, such as * types used by the `google.protobuf.Any` type, should be listed here by * name by the configuration author. Example: - * types: - * - name: google.protobuf.Int32 + * + * types: + * - name: google.protobuf.Int32 * * * repeated .google.protobuf.Type types = 4; @@ -3966,6 +4158,7 @@ public Builder setTypes(int index, com.google.protobuf.Type value) { } return this; } + /** * * @@ -3975,8 +4168,9 @@ public Builder setTypes(int index, com.google.protobuf.Type value) { * included. Messages which are not referenced but shall be included, such as * types used by the `google.protobuf.Any` type, should be listed here by * name by the configuration author. Example: - * types: - * - name: google.protobuf.Int32 + * + * types: + * - name: google.protobuf.Int32 * * * repeated .google.protobuf.Type types = 4; @@ -3991,6 +4185,7 @@ public Builder setTypes(int index, com.google.protobuf.Type.Builder builderForVa } return this; } + /** * * @@ -4000,8 +4195,9 @@ public Builder setTypes(int index, com.google.protobuf.Type.Builder builderForVa * included. Messages which are not referenced but shall be included, such as * types used by the `google.protobuf.Any` type, should be listed here by * name by the configuration author. Example: - * types: - * - name: google.protobuf.Int32 + * + * types: + * - name: google.protobuf.Int32 * * * repeated .google.protobuf.Type types = 4; @@ -4019,6 +4215,7 @@ public Builder addTypes(com.google.protobuf.Type value) { } return this; } + /** * * @@ -4028,8 +4225,9 @@ public Builder addTypes(com.google.protobuf.Type value) { * included. Messages which are not referenced but shall be included, such as * types used by the `google.protobuf.Any` type, should be listed here by * name by the configuration author. Example: - * types: - * - name: google.protobuf.Int32 + * + * types: + * - name: google.protobuf.Int32 * * * repeated .google.protobuf.Type types = 4; @@ -4047,6 +4245,7 @@ public Builder addTypes(int index, com.google.protobuf.Type value) { } return this; } + /** * * @@ -4056,8 +4255,9 @@ public Builder addTypes(int index, com.google.protobuf.Type value) { * included. Messages which are not referenced but shall be included, such as * types used by the `google.protobuf.Any` type, should be listed here by * name by the configuration author. Example: - * types: - * - name: google.protobuf.Int32 + * + * types: + * - name: google.protobuf.Int32 * * * repeated .google.protobuf.Type types = 4; @@ -4072,6 +4272,7 @@ public Builder addTypes(com.google.protobuf.Type.Builder builderForValue) { } return this; } + /** * * @@ -4081,8 +4282,9 @@ public Builder addTypes(com.google.protobuf.Type.Builder builderForValue) { * included. Messages which are not referenced but shall be included, such as * types used by the `google.protobuf.Any` type, should be listed here by * name by the configuration author. Example: - * types: - * - name: google.protobuf.Int32 + * + * types: + * - name: google.protobuf.Int32 * * * repeated .google.protobuf.Type types = 4; @@ -4097,6 +4299,7 @@ public Builder addTypes(int index, com.google.protobuf.Type.Builder builderForVa } return this; } + /** * * @@ -4106,8 +4309,9 @@ public Builder addTypes(int index, com.google.protobuf.Type.Builder builderForVa * included. Messages which are not referenced but shall be included, such as * types used by the `google.protobuf.Any` type, should be listed here by * name by the configuration author. Example: - * types: - * - name: google.protobuf.Int32 + * + * types: + * - name: google.protobuf.Int32 * * * repeated .google.protobuf.Type types = 4; @@ -4122,6 +4326,7 @@ public Builder addAllTypes(java.lang.Iterable * * repeated .google.protobuf.Type types = 4; @@ -4140,13 +4346,14 @@ public Builder addAllTypes(java.lang.Iterable * * repeated .google.protobuf.Type types = 4; @@ -4172,6 +4380,7 @@ public Builder removeTypes(int index) { } return this; } + /** * * @@ -4181,15 +4390,17 @@ public Builder removeTypes(int index) { * included. Messages which are not referenced but shall be included, such as * types used by the `google.protobuf.Any` type, should be listed here by * name by the configuration author. Example: - * types: - * - name: google.protobuf.Int32 + * + * types: + * - name: google.protobuf.Int32 * * * repeated .google.protobuf.Type types = 4; */ public com.google.protobuf.Type.Builder getTypesBuilder(int index) { - return getTypesFieldBuilder().getBuilder(index); + return internalGetTypesFieldBuilder().getBuilder(index); } + /** * * @@ -4199,8 +4410,9 @@ public com.google.protobuf.Type.Builder getTypesBuilder(int index) { * included. Messages which are not referenced but shall be included, such as * types used by the `google.protobuf.Any` type, should be listed here by * name by the configuration author. Example: - * types: - * - name: google.protobuf.Int32 + * + * types: + * - name: google.protobuf.Int32 * * * repeated .google.protobuf.Type types = 4; @@ -4212,6 +4424,7 @@ public com.google.protobuf.TypeOrBuilder getTypesOrBuilder(int index) { return typesBuilder_.getMessageOrBuilder(index); } } + /** * * @@ -4221,8 +4434,9 @@ public com.google.protobuf.TypeOrBuilder getTypesOrBuilder(int index) { * included. Messages which are not referenced but shall be included, such as * types used by the `google.protobuf.Any` type, should be listed here by * name by the configuration author. Example: - * types: - * - name: google.protobuf.Int32 + * + * types: + * - name: google.protobuf.Int32 * * * repeated .google.protobuf.Type types = 4; @@ -4234,6 +4448,7 @@ public java.util.List getTypesOrBui return java.util.Collections.unmodifiableList(types_); } } + /** * * @@ -4243,15 +4458,18 @@ public java.util.List getTypesOrBui * included. Messages which are not referenced but shall be included, such as * types used by the `google.protobuf.Any` type, should be listed here by * name by the configuration author. Example: - * types: - * - name: google.protobuf.Int32 + * + * types: + * - name: google.protobuf.Int32 * * * repeated .google.protobuf.Type types = 4; */ public com.google.protobuf.Type.Builder addTypesBuilder() { - return getTypesFieldBuilder().addBuilder(com.google.protobuf.Type.getDefaultInstance()); + return internalGetTypesFieldBuilder() + .addBuilder(com.google.protobuf.Type.getDefaultInstance()); } + /** * * @@ -4261,16 +4479,18 @@ public com.google.protobuf.Type.Builder addTypesBuilder() { * included. Messages which are not referenced but shall be included, such as * types used by the `google.protobuf.Any` type, should be listed here by * name by the configuration author. Example: - * types: - * - name: google.protobuf.Int32 + * + * types: + * - name: google.protobuf.Int32 * * * repeated .google.protobuf.Type types = 4; */ public com.google.protobuf.Type.Builder addTypesBuilder(int index) { - return getTypesFieldBuilder() + return internalGetTypesFieldBuilder() .addBuilder(index, com.google.protobuf.Type.getDefaultInstance()); } + /** * * @@ -4280,28 +4500,29 @@ public com.google.protobuf.Type.Builder addTypesBuilder(int index) { * included. Messages which are not referenced but shall be included, such as * types used by the `google.protobuf.Any` type, should be listed here by * name by the configuration author. Example: - * types: - * - name: google.protobuf.Int32 + * + * types: + * - name: google.protobuf.Int32 * * * repeated .google.protobuf.Type types = 4; */ public java.util.List getTypesBuilderList() { - return getTypesFieldBuilder().getBuilderList(); + return internalGetTypesFieldBuilder().getBuilderList(); } - private com.google.protobuf.RepeatedFieldBuilderV3< + private com.google.protobuf.RepeatedFieldBuilder< com.google.protobuf.Type, com.google.protobuf.Type.Builder, com.google.protobuf.TypeOrBuilder> - getTypesFieldBuilder() { + internalGetTypesFieldBuilder() { if (typesBuilder_ == null) { typesBuilder_ = - new com.google.protobuf.RepeatedFieldBuilderV3< + new com.google.protobuf.RepeatedFieldBuilder< com.google.protobuf.Type, com.google.protobuf.Type.Builder, com.google.protobuf.TypeOrBuilder>( - types_, ((bitField0_ & 0x00000002) != 0), getParentForChildren(), isClean()); + types_, ((bitField0_ & 0x00000020) != 0), getParentForChildren(), isClean()); types_ = null; } return typesBuilder_; @@ -4310,13 +4531,13 @@ public java.util.List getTypesBuilderList() { private java.util.List enums_ = java.util.Collections.emptyList(); private void ensureEnumsIsMutable() { - if (!((bitField0_ & 0x00000004) != 0)) { + if (!((bitField0_ & 0x00000040) != 0)) { enums_ = new java.util.ArrayList(enums_); - bitField0_ |= 0x00000004; + bitField0_ |= 0x00000040; } } - private com.google.protobuf.RepeatedFieldBuilderV3< + private com.google.protobuf.RepeatedFieldBuilder< com.google.protobuf.Enum, com.google.protobuf.Enum.Builder, com.google.protobuf.EnumOrBuilder> @@ -4330,8 +4551,9 @@ private void ensureEnumsIsMutable() { * directly or indirectly by the `apis` are automatically included. Enums * which are not referenced but shall be included should be listed here by * name by the configuration author. Example: - * enums: - * - name: google.someapi.v1.SomeEnum + * + * enums: + * - name: google.someapi.v1.SomeEnum * * * repeated .google.protobuf.Enum enums = 5; @@ -4343,6 +4565,7 @@ public java.util.List getEnumsList() { return enumsBuilder_.getMessageList(); } } + /** * * @@ -4351,8 +4574,9 @@ public java.util.List getEnumsList() { * directly or indirectly by the `apis` are automatically included. Enums * which are not referenced but shall be included should be listed here by * name by the configuration author. Example: - * enums: - * - name: google.someapi.v1.SomeEnum + * + * enums: + * - name: google.someapi.v1.SomeEnum * * * repeated .google.protobuf.Enum enums = 5; @@ -4364,6 +4588,7 @@ public int getEnumsCount() { return enumsBuilder_.getCount(); } } + /** * * @@ -4372,8 +4597,9 @@ public int getEnumsCount() { * directly or indirectly by the `apis` are automatically included. Enums * which are not referenced but shall be included should be listed here by * name by the configuration author. Example: - * enums: - * - name: google.someapi.v1.SomeEnum + * + * enums: + * - name: google.someapi.v1.SomeEnum * * * repeated .google.protobuf.Enum enums = 5; @@ -4385,6 +4611,7 @@ public com.google.protobuf.Enum getEnums(int index) { return enumsBuilder_.getMessage(index); } } + /** * * @@ -4393,8 +4620,9 @@ public com.google.protobuf.Enum getEnums(int index) { * directly or indirectly by the `apis` are automatically included. Enums * which are not referenced but shall be included should be listed here by * name by the configuration author. Example: - * enums: - * - name: google.someapi.v1.SomeEnum + * + * enums: + * - name: google.someapi.v1.SomeEnum * * * repeated .google.protobuf.Enum enums = 5; @@ -4412,6 +4640,7 @@ public Builder setEnums(int index, com.google.protobuf.Enum value) { } return this; } + /** * * @@ -4420,8 +4649,9 @@ public Builder setEnums(int index, com.google.protobuf.Enum value) { * directly or indirectly by the `apis` are automatically included. Enums * which are not referenced but shall be included should be listed here by * name by the configuration author. Example: - * enums: - * - name: google.someapi.v1.SomeEnum + * + * enums: + * - name: google.someapi.v1.SomeEnum * * * repeated .google.protobuf.Enum enums = 5; @@ -4436,6 +4666,7 @@ public Builder setEnums(int index, com.google.protobuf.Enum.Builder builderForVa } return this; } + /** * * @@ -4444,8 +4675,9 @@ public Builder setEnums(int index, com.google.protobuf.Enum.Builder builderForVa * directly or indirectly by the `apis` are automatically included. Enums * which are not referenced but shall be included should be listed here by * name by the configuration author. Example: - * enums: - * - name: google.someapi.v1.SomeEnum + * + * enums: + * - name: google.someapi.v1.SomeEnum * * * repeated .google.protobuf.Enum enums = 5; @@ -4463,6 +4695,7 @@ public Builder addEnums(com.google.protobuf.Enum value) { } return this; } + /** * * @@ -4471,8 +4704,9 @@ public Builder addEnums(com.google.protobuf.Enum value) { * directly or indirectly by the `apis` are automatically included. Enums * which are not referenced but shall be included should be listed here by * name by the configuration author. Example: - * enums: - * - name: google.someapi.v1.SomeEnum + * + * enums: + * - name: google.someapi.v1.SomeEnum * * * repeated .google.protobuf.Enum enums = 5; @@ -4490,6 +4724,7 @@ public Builder addEnums(int index, com.google.protobuf.Enum value) { } return this; } + /** * * @@ -4498,8 +4733,9 @@ public Builder addEnums(int index, com.google.protobuf.Enum value) { * directly or indirectly by the `apis` are automatically included. Enums * which are not referenced but shall be included should be listed here by * name by the configuration author. Example: - * enums: - * - name: google.someapi.v1.SomeEnum + * + * enums: + * - name: google.someapi.v1.SomeEnum * * * repeated .google.protobuf.Enum enums = 5; @@ -4514,6 +4750,7 @@ public Builder addEnums(com.google.protobuf.Enum.Builder builderForValue) { } return this; } + /** * * @@ -4522,8 +4759,9 @@ public Builder addEnums(com.google.protobuf.Enum.Builder builderForValue) { * directly or indirectly by the `apis` are automatically included. Enums * which are not referenced but shall be included should be listed here by * name by the configuration author. Example: - * enums: - * - name: google.someapi.v1.SomeEnum + * + * enums: + * - name: google.someapi.v1.SomeEnum * * * repeated .google.protobuf.Enum enums = 5; @@ -4538,6 +4776,7 @@ public Builder addEnums(int index, com.google.protobuf.Enum.Builder builderForVa } return this; } + /** * * @@ -4546,8 +4785,9 @@ public Builder addEnums(int index, com.google.protobuf.Enum.Builder builderForVa * directly or indirectly by the `apis` are automatically included. Enums * which are not referenced but shall be included should be listed here by * name by the configuration author. Example: - * enums: - * - name: google.someapi.v1.SomeEnum + * + * enums: + * - name: google.someapi.v1.SomeEnum * * * repeated .google.protobuf.Enum enums = 5; @@ -4562,6 +4802,7 @@ public Builder addAllEnums(java.lang.Iterable * * repeated .google.protobuf.Enum enums = 5; @@ -4579,13 +4821,14 @@ public Builder addAllEnums(java.lang.Iterable * * repeated .google.protobuf.Enum enums = 5; @@ -4610,6 +4854,7 @@ public Builder removeEnums(int index) { } return this; } + /** * * @@ -4618,15 +4863,17 @@ public Builder removeEnums(int index) { * directly or indirectly by the `apis` are automatically included. Enums * which are not referenced but shall be included should be listed here by * name by the configuration author. Example: - * enums: - * - name: google.someapi.v1.SomeEnum + * + * enums: + * - name: google.someapi.v1.SomeEnum * * * repeated .google.protobuf.Enum enums = 5; */ public com.google.protobuf.Enum.Builder getEnumsBuilder(int index) { - return getEnumsFieldBuilder().getBuilder(index); + return internalGetEnumsFieldBuilder().getBuilder(index); } + /** * * @@ -4635,8 +4882,9 @@ public com.google.protobuf.Enum.Builder getEnumsBuilder(int index) { * directly or indirectly by the `apis` are automatically included. Enums * which are not referenced but shall be included should be listed here by * name by the configuration author. Example: - * enums: - * - name: google.someapi.v1.SomeEnum + * + * enums: + * - name: google.someapi.v1.SomeEnum * * * repeated .google.protobuf.Enum enums = 5; @@ -4648,6 +4896,7 @@ public com.google.protobuf.EnumOrBuilder getEnumsOrBuilder(int index) { return enumsBuilder_.getMessageOrBuilder(index); } } + /** * * @@ -4656,8 +4905,9 @@ public com.google.protobuf.EnumOrBuilder getEnumsOrBuilder(int index) { * directly or indirectly by the `apis` are automatically included. Enums * which are not referenced but shall be included should be listed here by * name by the configuration author. Example: - * enums: - * - name: google.someapi.v1.SomeEnum + * + * enums: + * - name: google.someapi.v1.SomeEnum * * * repeated .google.protobuf.Enum enums = 5; @@ -4669,6 +4919,7 @@ public java.util.List getEnumsOrBui return java.util.Collections.unmodifiableList(enums_); } } + /** * * @@ -4677,15 +4928,18 @@ public java.util.List getEnumsOrBui * directly or indirectly by the `apis` are automatically included. Enums * which are not referenced but shall be included should be listed here by * name by the configuration author. Example: - * enums: - * - name: google.someapi.v1.SomeEnum + * + * enums: + * - name: google.someapi.v1.SomeEnum * * * repeated .google.protobuf.Enum enums = 5; */ public com.google.protobuf.Enum.Builder addEnumsBuilder() { - return getEnumsFieldBuilder().addBuilder(com.google.protobuf.Enum.getDefaultInstance()); + return internalGetEnumsFieldBuilder() + .addBuilder(com.google.protobuf.Enum.getDefaultInstance()); } + /** * * @@ -4694,16 +4948,18 @@ public com.google.protobuf.Enum.Builder addEnumsBuilder() { * directly or indirectly by the `apis` are automatically included. Enums * which are not referenced but shall be included should be listed here by * name by the configuration author. Example: - * enums: - * - name: google.someapi.v1.SomeEnum + * + * enums: + * - name: google.someapi.v1.SomeEnum * * * repeated .google.protobuf.Enum enums = 5; */ public com.google.protobuf.Enum.Builder addEnumsBuilder(int index) { - return getEnumsFieldBuilder() + return internalGetEnumsFieldBuilder() .addBuilder(index, com.google.protobuf.Enum.getDefaultInstance()); } + /** * * @@ -4712,39 +4968,41 @@ public com.google.protobuf.Enum.Builder addEnumsBuilder(int index) { * directly or indirectly by the `apis` are automatically included. Enums * which are not referenced but shall be included should be listed here by * name by the configuration author. Example: - * enums: - * - name: google.someapi.v1.SomeEnum + * + * enums: + * - name: google.someapi.v1.SomeEnum * * * repeated .google.protobuf.Enum enums = 5; */ public java.util.List getEnumsBuilderList() { - return getEnumsFieldBuilder().getBuilderList(); + return internalGetEnumsFieldBuilder().getBuilderList(); } - private com.google.protobuf.RepeatedFieldBuilderV3< + private com.google.protobuf.RepeatedFieldBuilder< com.google.protobuf.Enum, com.google.protobuf.Enum.Builder, com.google.protobuf.EnumOrBuilder> - getEnumsFieldBuilder() { + internalGetEnumsFieldBuilder() { if (enumsBuilder_ == null) { enumsBuilder_ = - new com.google.protobuf.RepeatedFieldBuilderV3< + new com.google.protobuf.RepeatedFieldBuilder< com.google.protobuf.Enum, com.google.protobuf.Enum.Builder, com.google.protobuf.EnumOrBuilder>( - enums_, ((bitField0_ & 0x00000004) != 0), getParentForChildren(), isClean()); + enums_, ((bitField0_ & 0x00000040) != 0), getParentForChildren(), isClean()); enums_ = null; } return enumsBuilder_; } private com.google.api.Documentation documentation_; - private com.google.protobuf.SingleFieldBuilderV3< + private com.google.protobuf.SingleFieldBuilder< com.google.api.Documentation, com.google.api.Documentation.Builder, com.google.api.DocumentationOrBuilder> documentationBuilder_; + /** * * @@ -4757,8 +5015,9 @@ public java.util.List getEnumsBuilderList() { * @return Whether the documentation field is set. */ public boolean hasDocumentation() { - return documentationBuilder_ != null || documentation_ != null; + return ((bitField0_ & 0x00000080) != 0); } + /** * * @@ -4779,6 +5038,7 @@ public com.google.api.Documentation getDocumentation() { return documentationBuilder_.getMessage(); } } + /** * * @@ -4794,13 +5054,14 @@ public Builder setDocumentation(com.google.api.Documentation value) { throw new NullPointerException(); } documentation_ = value; - onChanged(); } else { documentationBuilder_.setMessage(value); } - + bitField0_ |= 0x00000080; + onChanged(); return this; } + /** * * @@ -4813,13 +5074,14 @@ public Builder setDocumentation(com.google.api.Documentation value) { public Builder setDocumentation(com.google.api.Documentation.Builder builderForValue) { if (documentationBuilder_ == null) { documentation_ = builderForValue.build(); - onChanged(); } else { documentationBuilder_.setMessage(builderForValue.build()); } - + bitField0_ |= 0x00000080; + onChanged(); return this; } + /** * * @@ -4831,21 +5093,23 @@ public Builder setDocumentation(com.google.api.Documentation.Builder builderForV */ public Builder mergeDocumentation(com.google.api.Documentation value) { if (documentationBuilder_ == null) { - if (documentation_ != null) { - documentation_ = - com.google.api.Documentation.newBuilder(documentation_) - .mergeFrom(value) - .buildPartial(); + if (((bitField0_ & 0x00000080) != 0) + && documentation_ != null + && documentation_ != com.google.api.Documentation.getDefaultInstance()) { + getDocumentationBuilder().mergeFrom(value); } else { documentation_ = value; } - onChanged(); } else { documentationBuilder_.mergeFrom(value); } - + if (documentation_ != null) { + bitField0_ |= 0x00000080; + onChanged(); + } return this; } + /** * * @@ -4856,16 +5120,16 @@ public Builder mergeDocumentation(com.google.api.Documentation value) { * .google.api.Documentation documentation = 6; */ public Builder clearDocumentation() { - if (documentationBuilder_ == null) { - documentation_ = null; - onChanged(); - } else { - documentation_ = null; + bitField0_ = (bitField0_ & ~0x00000080); + documentation_ = null; + if (documentationBuilder_ != null) { + documentationBuilder_.dispose(); documentationBuilder_ = null; } - + onChanged(); return this; } + /** * * @@ -4876,10 +5140,11 @@ public Builder clearDocumentation() { * .google.api.Documentation documentation = 6; */ public com.google.api.Documentation.Builder getDocumentationBuilder() { - + bitField0_ |= 0x00000080; onChanged(); - return getDocumentationFieldBuilder().getBuilder(); + return internalGetDocumentationFieldBuilder().getBuilder(); } + /** * * @@ -4898,6 +5163,7 @@ public com.google.api.DocumentationOrBuilder getDocumentationOrBuilder() { : documentation_; } } + /** * * @@ -4907,14 +5173,14 @@ public com.google.api.DocumentationOrBuilder getDocumentationOrBuilder() { * * .google.api.Documentation documentation = 6; */ - private com.google.protobuf.SingleFieldBuilderV3< + private com.google.protobuf.SingleFieldBuilder< com.google.api.Documentation, com.google.api.Documentation.Builder, com.google.api.DocumentationOrBuilder> - getDocumentationFieldBuilder() { + internalGetDocumentationFieldBuilder() { if (documentationBuilder_ == null) { documentationBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< + new com.google.protobuf.SingleFieldBuilder< com.google.api.Documentation, com.google.api.Documentation.Builder, com.google.api.DocumentationOrBuilder>( @@ -4925,9 +5191,10 @@ public com.google.api.DocumentationOrBuilder getDocumentationOrBuilder() { } private com.google.api.Backend backend_; - private com.google.protobuf.SingleFieldBuilderV3< + private com.google.protobuf.SingleFieldBuilder< com.google.api.Backend, com.google.api.Backend.Builder, com.google.api.BackendOrBuilder> backendBuilder_; + /** * * @@ -4940,8 +5207,9 @@ public com.google.api.DocumentationOrBuilder getDocumentationOrBuilder() { * @return Whether the backend field is set. */ public boolean hasBackend() { - return backendBuilder_ != null || backend_ != null; + return ((bitField0_ & 0x00000100) != 0); } + /** * * @@ -4960,6 +5228,7 @@ public com.google.api.Backend getBackend() { return backendBuilder_.getMessage(); } } + /** * * @@ -4975,13 +5244,14 @@ public Builder setBackend(com.google.api.Backend value) { throw new NullPointerException(); } backend_ = value; - onChanged(); } else { backendBuilder_.setMessage(value); } - + bitField0_ |= 0x00000100; + onChanged(); return this; } + /** * * @@ -4994,13 +5264,14 @@ public Builder setBackend(com.google.api.Backend value) { public Builder setBackend(com.google.api.Backend.Builder builderForValue) { if (backendBuilder_ == null) { backend_ = builderForValue.build(); - onChanged(); } else { backendBuilder_.setMessage(builderForValue.build()); } - + bitField0_ |= 0x00000100; + onChanged(); return this; } + /** * * @@ -5012,18 +5283,23 @@ public Builder setBackend(com.google.api.Backend.Builder builderForValue) { */ public Builder mergeBackend(com.google.api.Backend value) { if (backendBuilder_ == null) { - if (backend_ != null) { - backend_ = com.google.api.Backend.newBuilder(backend_).mergeFrom(value).buildPartial(); + if (((bitField0_ & 0x00000100) != 0) + && backend_ != null + && backend_ != com.google.api.Backend.getDefaultInstance()) { + getBackendBuilder().mergeFrom(value); } else { backend_ = value; } - onChanged(); } else { backendBuilder_.mergeFrom(value); } - + if (backend_ != null) { + bitField0_ |= 0x00000100; + onChanged(); + } return this; } + /** * * @@ -5034,16 +5310,16 @@ public Builder mergeBackend(com.google.api.Backend value) { * .google.api.Backend backend = 8; */ public Builder clearBackend() { - if (backendBuilder_ == null) { - backend_ = null; - onChanged(); - } else { - backend_ = null; + bitField0_ = (bitField0_ & ~0x00000100); + backend_ = null; + if (backendBuilder_ != null) { + backendBuilder_.dispose(); backendBuilder_ = null; } - + onChanged(); return this; } + /** * * @@ -5054,10 +5330,11 @@ public Builder clearBackend() { * .google.api.Backend backend = 8; */ public com.google.api.Backend.Builder getBackendBuilder() { - + bitField0_ |= 0x00000100; onChanged(); - return getBackendFieldBuilder().getBuilder(); + return internalGetBackendFieldBuilder().getBuilder(); } + /** * * @@ -5074,6 +5351,7 @@ public com.google.api.BackendOrBuilder getBackendOrBuilder() { return backend_ == null ? com.google.api.Backend.getDefaultInstance() : backend_; } } + /** * * @@ -5083,12 +5361,12 @@ public com.google.api.BackendOrBuilder getBackendOrBuilder() { * * .google.api.Backend backend = 8; */ - private com.google.protobuf.SingleFieldBuilderV3< + private com.google.protobuf.SingleFieldBuilder< com.google.api.Backend, com.google.api.Backend.Builder, com.google.api.BackendOrBuilder> - getBackendFieldBuilder() { + internalGetBackendFieldBuilder() { if (backendBuilder_ == null) { backendBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< + new com.google.protobuf.SingleFieldBuilder< com.google.api.Backend, com.google.api.Backend.Builder, com.google.api.BackendOrBuilder>(getBackend(), getParentForChildren(), isClean()); @@ -5098,9 +5376,10 @@ public com.google.api.BackendOrBuilder getBackendOrBuilder() { } private com.google.api.Http http_; - private com.google.protobuf.SingleFieldBuilderV3< + private com.google.protobuf.SingleFieldBuilder< com.google.api.Http, com.google.api.Http.Builder, com.google.api.HttpOrBuilder> httpBuilder_; + /** * * @@ -5113,8 +5392,9 @@ public com.google.api.BackendOrBuilder getBackendOrBuilder() { * @return Whether the http field is set. */ public boolean hasHttp() { - return httpBuilder_ != null || http_ != null; + return ((bitField0_ & 0x00000200) != 0); } + /** * * @@ -5133,6 +5413,7 @@ public com.google.api.Http getHttp() { return httpBuilder_.getMessage(); } } + /** * * @@ -5148,13 +5429,14 @@ public Builder setHttp(com.google.api.Http value) { throw new NullPointerException(); } http_ = value; - onChanged(); } else { httpBuilder_.setMessage(value); } - + bitField0_ |= 0x00000200; + onChanged(); return this; } + /** * * @@ -5167,13 +5449,14 @@ public Builder setHttp(com.google.api.Http value) { public Builder setHttp(com.google.api.Http.Builder builderForValue) { if (httpBuilder_ == null) { http_ = builderForValue.build(); - onChanged(); } else { httpBuilder_.setMessage(builderForValue.build()); } - + bitField0_ |= 0x00000200; + onChanged(); return this; } + /** * * @@ -5185,18 +5468,23 @@ public Builder setHttp(com.google.api.Http.Builder builderForValue) { */ public Builder mergeHttp(com.google.api.Http value) { if (httpBuilder_ == null) { - if (http_ != null) { - http_ = com.google.api.Http.newBuilder(http_).mergeFrom(value).buildPartial(); + if (((bitField0_ & 0x00000200) != 0) + && http_ != null + && http_ != com.google.api.Http.getDefaultInstance()) { + getHttpBuilder().mergeFrom(value); } else { http_ = value; } - onChanged(); } else { httpBuilder_.mergeFrom(value); } - + if (http_ != null) { + bitField0_ |= 0x00000200; + onChanged(); + } return this; } + /** * * @@ -5207,16 +5495,16 @@ public Builder mergeHttp(com.google.api.Http value) { * .google.api.Http http = 9; */ public Builder clearHttp() { - if (httpBuilder_ == null) { - http_ = null; - onChanged(); - } else { - http_ = null; + bitField0_ = (bitField0_ & ~0x00000200); + http_ = null; + if (httpBuilder_ != null) { + httpBuilder_.dispose(); httpBuilder_ = null; } - + onChanged(); return this; } + /** * * @@ -5227,10 +5515,11 @@ public Builder clearHttp() { * .google.api.Http http = 9; */ public com.google.api.Http.Builder getHttpBuilder() { - + bitField0_ |= 0x00000200; onChanged(); - return getHttpFieldBuilder().getBuilder(); + return internalGetHttpFieldBuilder().getBuilder(); } + /** * * @@ -5247,6 +5536,7 @@ public com.google.api.HttpOrBuilder getHttpOrBuilder() { return http_ == null ? com.google.api.Http.getDefaultInstance() : http_; } } + /** * * @@ -5256,12 +5546,12 @@ public com.google.api.HttpOrBuilder getHttpOrBuilder() { * * .google.api.Http http = 9; */ - private com.google.protobuf.SingleFieldBuilderV3< + private com.google.protobuf.SingleFieldBuilder< com.google.api.Http, com.google.api.Http.Builder, com.google.api.HttpOrBuilder> - getHttpFieldBuilder() { + internalGetHttpFieldBuilder() { if (httpBuilder_ == null) { httpBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< + new com.google.protobuf.SingleFieldBuilder< com.google.api.Http, com.google.api.Http.Builder, com.google.api.HttpOrBuilder>( getHttp(), getParentForChildren(), isClean()); http_ = null; @@ -5270,9 +5560,10 @@ public com.google.api.HttpOrBuilder getHttpOrBuilder() { } private com.google.api.Quota quota_; - private com.google.protobuf.SingleFieldBuilderV3< + private com.google.protobuf.SingleFieldBuilder< com.google.api.Quota, com.google.api.Quota.Builder, com.google.api.QuotaOrBuilder> quotaBuilder_; + /** * * @@ -5285,8 +5576,9 @@ public com.google.api.HttpOrBuilder getHttpOrBuilder() { * @return Whether the quota field is set. */ public boolean hasQuota() { - return quotaBuilder_ != null || quota_ != null; + return ((bitField0_ & 0x00000400) != 0); } + /** * * @@ -5305,6 +5597,7 @@ public com.google.api.Quota getQuota() { return quotaBuilder_.getMessage(); } } + /** * * @@ -5320,13 +5613,14 @@ public Builder setQuota(com.google.api.Quota value) { throw new NullPointerException(); } quota_ = value; - onChanged(); } else { quotaBuilder_.setMessage(value); } - + bitField0_ |= 0x00000400; + onChanged(); return this; } + /** * * @@ -5339,13 +5633,14 @@ public Builder setQuota(com.google.api.Quota value) { public Builder setQuota(com.google.api.Quota.Builder builderForValue) { if (quotaBuilder_ == null) { quota_ = builderForValue.build(); - onChanged(); } else { quotaBuilder_.setMessage(builderForValue.build()); } - + bitField0_ |= 0x00000400; + onChanged(); return this; } + /** * * @@ -5357,18 +5652,23 @@ public Builder setQuota(com.google.api.Quota.Builder builderForValue) { */ public Builder mergeQuota(com.google.api.Quota value) { if (quotaBuilder_ == null) { - if (quota_ != null) { - quota_ = com.google.api.Quota.newBuilder(quota_).mergeFrom(value).buildPartial(); + if (((bitField0_ & 0x00000400) != 0) + && quota_ != null + && quota_ != com.google.api.Quota.getDefaultInstance()) { + getQuotaBuilder().mergeFrom(value); } else { quota_ = value; } - onChanged(); } else { quotaBuilder_.mergeFrom(value); } - + if (quota_ != null) { + bitField0_ |= 0x00000400; + onChanged(); + } return this; } + /** * * @@ -5379,16 +5679,16 @@ public Builder mergeQuota(com.google.api.Quota value) { * .google.api.Quota quota = 10; */ public Builder clearQuota() { - if (quotaBuilder_ == null) { - quota_ = null; - onChanged(); - } else { - quota_ = null; + bitField0_ = (bitField0_ & ~0x00000400); + quota_ = null; + if (quotaBuilder_ != null) { + quotaBuilder_.dispose(); quotaBuilder_ = null; } - + onChanged(); return this; } + /** * * @@ -5399,10 +5699,11 @@ public Builder clearQuota() { * .google.api.Quota quota = 10; */ public com.google.api.Quota.Builder getQuotaBuilder() { - + bitField0_ |= 0x00000400; onChanged(); - return getQuotaFieldBuilder().getBuilder(); + return internalGetQuotaFieldBuilder().getBuilder(); } + /** * * @@ -5419,6 +5720,7 @@ public com.google.api.QuotaOrBuilder getQuotaOrBuilder() { return quota_ == null ? com.google.api.Quota.getDefaultInstance() : quota_; } } + /** * * @@ -5428,12 +5730,12 @@ public com.google.api.QuotaOrBuilder getQuotaOrBuilder() { * * .google.api.Quota quota = 10; */ - private com.google.protobuf.SingleFieldBuilderV3< + private com.google.protobuf.SingleFieldBuilder< com.google.api.Quota, com.google.api.Quota.Builder, com.google.api.QuotaOrBuilder> - getQuotaFieldBuilder() { + internalGetQuotaFieldBuilder() { if (quotaBuilder_ == null) { quotaBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< + new com.google.protobuf.SingleFieldBuilder< com.google.api.Quota, com.google.api.Quota.Builder, com.google.api.QuotaOrBuilder>( getQuota(), getParentForChildren(), isClean()); quota_ = null; @@ -5442,11 +5744,12 @@ public com.google.api.QuotaOrBuilder getQuotaOrBuilder() { } private com.google.api.Authentication authentication_; - private com.google.protobuf.SingleFieldBuilderV3< + private com.google.protobuf.SingleFieldBuilder< com.google.api.Authentication, com.google.api.Authentication.Builder, com.google.api.AuthenticationOrBuilder> authenticationBuilder_; + /** * * @@ -5459,8 +5762,9 @@ public com.google.api.QuotaOrBuilder getQuotaOrBuilder() { * @return Whether the authentication field is set. */ public boolean hasAuthentication() { - return authenticationBuilder_ != null || authentication_ != null; + return ((bitField0_ & 0x00000800) != 0); } + /** * * @@ -5481,6 +5785,7 @@ public com.google.api.Authentication getAuthentication() { return authenticationBuilder_.getMessage(); } } + /** * * @@ -5496,13 +5801,14 @@ public Builder setAuthentication(com.google.api.Authentication value) { throw new NullPointerException(); } authentication_ = value; - onChanged(); } else { authenticationBuilder_.setMessage(value); } - + bitField0_ |= 0x00000800; + onChanged(); return this; } + /** * * @@ -5515,13 +5821,14 @@ public Builder setAuthentication(com.google.api.Authentication value) { public Builder setAuthentication(com.google.api.Authentication.Builder builderForValue) { if (authenticationBuilder_ == null) { authentication_ = builderForValue.build(); - onChanged(); } else { authenticationBuilder_.setMessage(builderForValue.build()); } - + bitField0_ |= 0x00000800; + onChanged(); return this; } + /** * * @@ -5533,21 +5840,23 @@ public Builder setAuthentication(com.google.api.Authentication.Builder builderFo */ public Builder mergeAuthentication(com.google.api.Authentication value) { if (authenticationBuilder_ == null) { - if (authentication_ != null) { - authentication_ = - com.google.api.Authentication.newBuilder(authentication_) - .mergeFrom(value) - .buildPartial(); + if (((bitField0_ & 0x00000800) != 0) + && authentication_ != null + && authentication_ != com.google.api.Authentication.getDefaultInstance()) { + getAuthenticationBuilder().mergeFrom(value); } else { authentication_ = value; } - onChanged(); } else { authenticationBuilder_.mergeFrom(value); } - + if (authentication_ != null) { + bitField0_ |= 0x00000800; + onChanged(); + } return this; } + /** * * @@ -5558,16 +5867,16 @@ public Builder mergeAuthentication(com.google.api.Authentication value) { * .google.api.Authentication authentication = 11; */ public Builder clearAuthentication() { - if (authenticationBuilder_ == null) { - authentication_ = null; - onChanged(); - } else { - authentication_ = null; + bitField0_ = (bitField0_ & ~0x00000800); + authentication_ = null; + if (authenticationBuilder_ != null) { + authenticationBuilder_.dispose(); authenticationBuilder_ = null; } - + onChanged(); return this; } + /** * * @@ -5578,10 +5887,11 @@ public Builder clearAuthentication() { * .google.api.Authentication authentication = 11; */ public com.google.api.Authentication.Builder getAuthenticationBuilder() { - + bitField0_ |= 0x00000800; onChanged(); - return getAuthenticationFieldBuilder().getBuilder(); + return internalGetAuthenticationFieldBuilder().getBuilder(); } + /** * * @@ -5600,6 +5910,7 @@ public com.google.api.AuthenticationOrBuilder getAuthenticationOrBuilder() { : authentication_; } } + /** * * @@ -5609,14 +5920,14 @@ public com.google.api.AuthenticationOrBuilder getAuthenticationOrBuilder() { * * .google.api.Authentication authentication = 11; */ - private com.google.protobuf.SingleFieldBuilderV3< + private com.google.protobuf.SingleFieldBuilder< com.google.api.Authentication, com.google.api.Authentication.Builder, com.google.api.AuthenticationOrBuilder> - getAuthenticationFieldBuilder() { + internalGetAuthenticationFieldBuilder() { if (authenticationBuilder_ == null) { authenticationBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< + new com.google.protobuf.SingleFieldBuilder< com.google.api.Authentication, com.google.api.Authentication.Builder, com.google.api.AuthenticationOrBuilder>( @@ -5627,9 +5938,10 @@ public com.google.api.AuthenticationOrBuilder getAuthenticationOrBuilder() { } private com.google.api.Context context_; - private com.google.protobuf.SingleFieldBuilderV3< + private com.google.protobuf.SingleFieldBuilder< com.google.api.Context, com.google.api.Context.Builder, com.google.api.ContextOrBuilder> contextBuilder_; + /** * * @@ -5642,8 +5954,9 @@ public com.google.api.AuthenticationOrBuilder getAuthenticationOrBuilder() { * @return Whether the context field is set. */ public boolean hasContext() { - return contextBuilder_ != null || context_ != null; + return ((bitField0_ & 0x00001000) != 0); } + /** * * @@ -5662,6 +5975,7 @@ public com.google.api.Context getContext() { return contextBuilder_.getMessage(); } } + /** * * @@ -5677,13 +5991,14 @@ public Builder setContext(com.google.api.Context value) { throw new NullPointerException(); } context_ = value; - onChanged(); } else { contextBuilder_.setMessage(value); } - + bitField0_ |= 0x00001000; + onChanged(); return this; } + /** * * @@ -5696,13 +6011,14 @@ public Builder setContext(com.google.api.Context value) { public Builder setContext(com.google.api.Context.Builder builderForValue) { if (contextBuilder_ == null) { context_ = builderForValue.build(); - onChanged(); } else { contextBuilder_.setMessage(builderForValue.build()); } - + bitField0_ |= 0x00001000; + onChanged(); return this; } + /** * * @@ -5714,18 +6030,23 @@ public Builder setContext(com.google.api.Context.Builder builderForValue) { */ public Builder mergeContext(com.google.api.Context value) { if (contextBuilder_ == null) { - if (context_ != null) { - context_ = com.google.api.Context.newBuilder(context_).mergeFrom(value).buildPartial(); + if (((bitField0_ & 0x00001000) != 0) + && context_ != null + && context_ != com.google.api.Context.getDefaultInstance()) { + getContextBuilder().mergeFrom(value); } else { context_ = value; } - onChanged(); } else { contextBuilder_.mergeFrom(value); } - + if (context_ != null) { + bitField0_ |= 0x00001000; + onChanged(); + } return this; } + /** * * @@ -5736,16 +6057,16 @@ public Builder mergeContext(com.google.api.Context value) { * .google.api.Context context = 12; */ public Builder clearContext() { - if (contextBuilder_ == null) { - context_ = null; - onChanged(); - } else { - context_ = null; + bitField0_ = (bitField0_ & ~0x00001000); + context_ = null; + if (contextBuilder_ != null) { + contextBuilder_.dispose(); contextBuilder_ = null; } - + onChanged(); return this; } + /** * * @@ -5756,10 +6077,11 @@ public Builder clearContext() { * .google.api.Context context = 12; */ public com.google.api.Context.Builder getContextBuilder() { - + bitField0_ |= 0x00001000; onChanged(); - return getContextFieldBuilder().getBuilder(); + return internalGetContextFieldBuilder().getBuilder(); } + /** * * @@ -5776,6 +6098,7 @@ public com.google.api.ContextOrBuilder getContextOrBuilder() { return context_ == null ? com.google.api.Context.getDefaultInstance() : context_; } } + /** * * @@ -5785,12 +6108,12 @@ public com.google.api.ContextOrBuilder getContextOrBuilder() { * * .google.api.Context context = 12; */ - private com.google.protobuf.SingleFieldBuilderV3< + private com.google.protobuf.SingleFieldBuilder< com.google.api.Context, com.google.api.Context.Builder, com.google.api.ContextOrBuilder> - getContextFieldBuilder() { + internalGetContextFieldBuilder() { if (contextBuilder_ == null) { contextBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< + new com.google.protobuf.SingleFieldBuilder< com.google.api.Context, com.google.api.Context.Builder, com.google.api.ContextOrBuilder>(getContext(), getParentForChildren(), isClean()); @@ -5800,9 +6123,10 @@ public com.google.api.ContextOrBuilder getContextOrBuilder() { } private com.google.api.Usage usage_; - private com.google.protobuf.SingleFieldBuilderV3< + private com.google.protobuf.SingleFieldBuilder< com.google.api.Usage, com.google.api.Usage.Builder, com.google.api.UsageOrBuilder> usageBuilder_; + /** * * @@ -5815,8 +6139,9 @@ public com.google.api.ContextOrBuilder getContextOrBuilder() { * @return Whether the usage field is set. */ public boolean hasUsage() { - return usageBuilder_ != null || usage_ != null; + return ((bitField0_ & 0x00002000) != 0); } + /** * * @@ -5835,6 +6160,7 @@ public com.google.api.Usage getUsage() { return usageBuilder_.getMessage(); } } + /** * * @@ -5850,13 +6176,14 @@ public Builder setUsage(com.google.api.Usage value) { throw new NullPointerException(); } usage_ = value; - onChanged(); } else { usageBuilder_.setMessage(value); } - + bitField0_ |= 0x00002000; + onChanged(); return this; } + /** * * @@ -5869,13 +6196,14 @@ public Builder setUsage(com.google.api.Usage value) { public Builder setUsage(com.google.api.Usage.Builder builderForValue) { if (usageBuilder_ == null) { usage_ = builderForValue.build(); - onChanged(); } else { usageBuilder_.setMessage(builderForValue.build()); } - + bitField0_ |= 0x00002000; + onChanged(); return this; } + /** * * @@ -5887,18 +6215,23 @@ public Builder setUsage(com.google.api.Usage.Builder builderForValue) { */ public Builder mergeUsage(com.google.api.Usage value) { if (usageBuilder_ == null) { - if (usage_ != null) { - usage_ = com.google.api.Usage.newBuilder(usage_).mergeFrom(value).buildPartial(); + if (((bitField0_ & 0x00002000) != 0) + && usage_ != null + && usage_ != com.google.api.Usage.getDefaultInstance()) { + getUsageBuilder().mergeFrom(value); } else { usage_ = value; } - onChanged(); } else { usageBuilder_.mergeFrom(value); } - + if (usage_ != null) { + bitField0_ |= 0x00002000; + onChanged(); + } return this; } + /** * * @@ -5909,16 +6242,16 @@ public Builder mergeUsage(com.google.api.Usage value) { * .google.api.Usage usage = 15; */ public Builder clearUsage() { - if (usageBuilder_ == null) { - usage_ = null; - onChanged(); - } else { - usage_ = null; + bitField0_ = (bitField0_ & ~0x00002000); + usage_ = null; + if (usageBuilder_ != null) { + usageBuilder_.dispose(); usageBuilder_ = null; } - + onChanged(); return this; } + /** * * @@ -5929,10 +6262,11 @@ public Builder clearUsage() { * .google.api.Usage usage = 15; */ public com.google.api.Usage.Builder getUsageBuilder() { - + bitField0_ |= 0x00002000; onChanged(); - return getUsageFieldBuilder().getBuilder(); + return internalGetUsageFieldBuilder().getBuilder(); } + /** * * @@ -5949,6 +6283,7 @@ public com.google.api.UsageOrBuilder getUsageOrBuilder() { return usage_ == null ? com.google.api.Usage.getDefaultInstance() : usage_; } } + /** * * @@ -5958,12 +6293,12 @@ public com.google.api.UsageOrBuilder getUsageOrBuilder() { * * .google.api.Usage usage = 15; */ - private com.google.protobuf.SingleFieldBuilderV3< + private com.google.protobuf.SingleFieldBuilder< com.google.api.Usage, com.google.api.Usage.Builder, com.google.api.UsageOrBuilder> - getUsageFieldBuilder() { + internalGetUsageFieldBuilder() { if (usageBuilder_ == null) { usageBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< + new com.google.protobuf.SingleFieldBuilder< com.google.api.Usage, com.google.api.Usage.Builder, com.google.api.UsageOrBuilder>( getUsage(), getParentForChildren(), isClean()); usage_ = null; @@ -5974,13 +6309,13 @@ public com.google.api.UsageOrBuilder getUsageOrBuilder() { private java.util.List endpoints_ = java.util.Collections.emptyList(); private void ensureEndpointsIsMutable() { - if (!((bitField0_ & 0x00000008) != 0)) { + if (!((bitField0_ & 0x00004000) != 0)) { endpoints_ = new java.util.ArrayList(endpoints_); - bitField0_ |= 0x00000008; + bitField0_ |= 0x00004000; } } - private com.google.protobuf.RepeatedFieldBuilderV3< + private com.google.protobuf.RepeatedFieldBuilder< com.google.api.Endpoint, com.google.api.Endpoint.Builder, com.google.api.EndpointOrBuilder> @@ -6004,6 +6339,7 @@ public java.util.List getEndpointsList() { return endpointsBuilder_.getMessageList(); } } + /** * * @@ -6022,6 +6358,7 @@ public int getEndpointsCount() { return endpointsBuilder_.getCount(); } } + /** * * @@ -6040,6 +6377,7 @@ public com.google.api.Endpoint getEndpoints(int index) { return endpointsBuilder_.getMessage(index); } } + /** * * @@ -6064,6 +6402,7 @@ public Builder setEndpoints(int index, com.google.api.Endpoint value) { } return this; } + /** * * @@ -6085,6 +6424,7 @@ public Builder setEndpoints(int index, com.google.api.Endpoint.Builder builderFo } return this; } + /** * * @@ -6109,6 +6449,7 @@ public Builder addEndpoints(com.google.api.Endpoint value) { } return this; } + /** * * @@ -6133,6 +6474,7 @@ public Builder addEndpoints(int index, com.google.api.Endpoint value) { } return this; } + /** * * @@ -6154,6 +6496,7 @@ public Builder addEndpoints(com.google.api.Endpoint.Builder builderForValue) { } return this; } + /** * * @@ -6175,6 +6518,7 @@ public Builder addEndpoints(int index, com.google.api.Endpoint.Builder builderFo } return this; } + /** * * @@ -6196,6 +6540,7 @@ public Builder addAllEndpoints(java.lang.Iterablerepeated .google.api.Endpoint endpoints = 18; */ public com.google.api.Endpoint.Builder getEndpointsBuilder(int index) { - return getEndpointsFieldBuilder().getBuilder(index); + return internalGetEndpointsFieldBuilder().getBuilder(index); } + /** * * @@ -6270,6 +6618,7 @@ public com.google.api.EndpointOrBuilder getEndpointsOrBuilder(int index) { return endpointsBuilder_.getMessageOrBuilder(index); } } + /** * * @@ -6288,6 +6637,7 @@ public java.util.List getEndpointsOr return java.util.Collections.unmodifiableList(endpoints_); } } + /** * * @@ -6300,8 +6650,10 @@ public java.util.List getEndpointsOr * repeated .google.api.Endpoint endpoints = 18; */ public com.google.api.Endpoint.Builder addEndpointsBuilder() { - return getEndpointsFieldBuilder().addBuilder(com.google.api.Endpoint.getDefaultInstance()); + return internalGetEndpointsFieldBuilder() + .addBuilder(com.google.api.Endpoint.getDefaultInstance()); } + /** * * @@ -6314,9 +6666,10 @@ public com.google.api.Endpoint.Builder addEndpointsBuilder() { * repeated .google.api.Endpoint endpoints = 18; */ public com.google.api.Endpoint.Builder addEndpointsBuilder(int index) { - return getEndpointsFieldBuilder() + return internalGetEndpointsFieldBuilder() .addBuilder(index, com.google.api.Endpoint.getDefaultInstance()); } + /** * * @@ -6329,30 +6682,31 @@ public com.google.api.Endpoint.Builder addEndpointsBuilder(int index) { * repeated .google.api.Endpoint endpoints = 18; */ public java.util.List getEndpointsBuilderList() { - return getEndpointsFieldBuilder().getBuilderList(); + return internalGetEndpointsFieldBuilder().getBuilderList(); } - private com.google.protobuf.RepeatedFieldBuilderV3< + private com.google.protobuf.RepeatedFieldBuilder< com.google.api.Endpoint, com.google.api.Endpoint.Builder, com.google.api.EndpointOrBuilder> - getEndpointsFieldBuilder() { + internalGetEndpointsFieldBuilder() { if (endpointsBuilder_ == null) { endpointsBuilder_ = - new com.google.protobuf.RepeatedFieldBuilderV3< + new com.google.protobuf.RepeatedFieldBuilder< com.google.api.Endpoint, com.google.api.Endpoint.Builder, com.google.api.EndpointOrBuilder>( - endpoints_, ((bitField0_ & 0x00000008) != 0), getParentForChildren(), isClean()); + endpoints_, ((bitField0_ & 0x00004000) != 0), getParentForChildren(), isClean()); endpoints_ = null; } return endpointsBuilder_; } private com.google.api.Control control_; - private com.google.protobuf.SingleFieldBuilderV3< + private com.google.protobuf.SingleFieldBuilder< com.google.api.Control, com.google.api.Control.Builder, com.google.api.ControlOrBuilder> controlBuilder_; + /** * * @@ -6365,8 +6719,9 @@ public java.util.List getEndpointsBuilderList() * @return Whether the control field is set. */ public boolean hasControl() { - return controlBuilder_ != null || control_ != null; + return ((bitField0_ & 0x00008000) != 0); } + /** * * @@ -6385,6 +6740,7 @@ public com.google.api.Control getControl() { return controlBuilder_.getMessage(); } } + /** * * @@ -6400,13 +6756,14 @@ public Builder setControl(com.google.api.Control value) { throw new NullPointerException(); } control_ = value; - onChanged(); } else { controlBuilder_.setMessage(value); } - + bitField0_ |= 0x00008000; + onChanged(); return this; } + /** * * @@ -6419,13 +6776,14 @@ public Builder setControl(com.google.api.Control value) { public Builder setControl(com.google.api.Control.Builder builderForValue) { if (controlBuilder_ == null) { control_ = builderForValue.build(); - onChanged(); } else { controlBuilder_.setMessage(builderForValue.build()); } - + bitField0_ |= 0x00008000; + onChanged(); return this; } + /** * * @@ -6437,18 +6795,23 @@ public Builder setControl(com.google.api.Control.Builder builderForValue) { */ public Builder mergeControl(com.google.api.Control value) { if (controlBuilder_ == null) { - if (control_ != null) { - control_ = com.google.api.Control.newBuilder(control_).mergeFrom(value).buildPartial(); + if (((bitField0_ & 0x00008000) != 0) + && control_ != null + && control_ != com.google.api.Control.getDefaultInstance()) { + getControlBuilder().mergeFrom(value); } else { control_ = value; } - onChanged(); } else { controlBuilder_.mergeFrom(value); } - + if (control_ != null) { + bitField0_ |= 0x00008000; + onChanged(); + } return this; } + /** * * @@ -6459,16 +6822,16 @@ public Builder mergeControl(com.google.api.Control value) { * .google.api.Control control = 21; */ public Builder clearControl() { - if (controlBuilder_ == null) { - control_ = null; - onChanged(); - } else { - control_ = null; + bitField0_ = (bitField0_ & ~0x00008000); + control_ = null; + if (controlBuilder_ != null) { + controlBuilder_.dispose(); controlBuilder_ = null; } - + onChanged(); return this; } + /** * * @@ -6479,10 +6842,11 @@ public Builder clearControl() { * .google.api.Control control = 21; */ public com.google.api.Control.Builder getControlBuilder() { - + bitField0_ |= 0x00008000; onChanged(); - return getControlFieldBuilder().getBuilder(); + return internalGetControlFieldBuilder().getBuilder(); } + /** * * @@ -6499,6 +6863,7 @@ public com.google.api.ControlOrBuilder getControlOrBuilder() { return control_ == null ? com.google.api.Control.getDefaultInstance() : control_; } } + /** * * @@ -6508,12 +6873,12 @@ public com.google.api.ControlOrBuilder getControlOrBuilder() { * * .google.api.Control control = 21; */ - private com.google.protobuf.SingleFieldBuilderV3< + private com.google.protobuf.SingleFieldBuilder< com.google.api.Control, com.google.api.Control.Builder, com.google.api.ControlOrBuilder> - getControlFieldBuilder() { + internalGetControlFieldBuilder() { if (controlBuilder_ == null) { controlBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< + new com.google.protobuf.SingleFieldBuilder< com.google.api.Control, com.google.api.Control.Builder, com.google.api.ControlOrBuilder>(getControl(), getParentForChildren(), isClean()); @@ -6525,13 +6890,13 @@ public com.google.api.ControlOrBuilder getControlOrBuilder() { private java.util.List logs_ = java.util.Collections.emptyList(); private void ensureLogsIsMutable() { - if (!((bitField0_ & 0x00000010) != 0)) { + if (!((bitField0_ & 0x00010000) != 0)) { logs_ = new java.util.ArrayList(logs_); - bitField0_ |= 0x00000010; + bitField0_ |= 0x00010000; } } - private com.google.protobuf.RepeatedFieldBuilderV3< + private com.google.protobuf.RepeatedFieldBuilder< com.google.api.LogDescriptor, com.google.api.LogDescriptor.Builder, com.google.api.LogDescriptorOrBuilder> @@ -6553,6 +6918,7 @@ public java.util.List getLogsList() { return logsBuilder_.getMessageList(); } } + /** * * @@ -6569,6 +6935,7 @@ public int getLogsCount() { return logsBuilder_.getCount(); } } + /** * * @@ -6585,6 +6952,7 @@ public com.google.api.LogDescriptor getLogs(int index) { return logsBuilder_.getMessage(index); } } + /** * * @@ -6607,6 +6975,7 @@ public Builder setLogs(int index, com.google.api.LogDescriptor value) { } return this; } + /** * * @@ -6626,6 +6995,7 @@ public Builder setLogs(int index, com.google.api.LogDescriptor.Builder builderFo } return this; } + /** * * @@ -6648,6 +7018,7 @@ public Builder addLogs(com.google.api.LogDescriptor value) { } return this; } + /** * * @@ -6670,6 +7041,7 @@ public Builder addLogs(int index, com.google.api.LogDescriptor value) { } return this; } + /** * * @@ -6689,6 +7061,7 @@ public Builder addLogs(com.google.api.LogDescriptor.Builder builderForValue) { } return this; } + /** * * @@ -6708,6 +7081,7 @@ public Builder addLogs(int index, com.google.api.LogDescriptor.Builder builderFo } return this; } + /** * * @@ -6727,6 +7101,7 @@ public Builder addAllLogs(java.lang.Iterablerepeated .google.api.LogDescriptor logs = 23; */ public com.google.api.LogDescriptor.Builder getLogsBuilder(int index) { - return getLogsFieldBuilder().getBuilder(index); + return internalGetLogsFieldBuilder().getBuilder(index); } + /** * * @@ -6793,6 +7171,7 @@ public com.google.api.LogDescriptorOrBuilder getLogsOrBuilder(int index) { return logsBuilder_.getMessageOrBuilder(index); } } + /** * * @@ -6809,6 +7188,7 @@ public java.util.List getLogsOr return java.util.Collections.unmodifiableList(logs_); } } + /** * * @@ -6819,8 +7199,10 @@ public java.util.List getLogsOr * repeated .google.api.LogDescriptor logs = 23; */ public com.google.api.LogDescriptor.Builder addLogsBuilder() { - return getLogsFieldBuilder().addBuilder(com.google.api.LogDescriptor.getDefaultInstance()); + return internalGetLogsFieldBuilder() + .addBuilder(com.google.api.LogDescriptor.getDefaultInstance()); } + /** * * @@ -6831,9 +7213,10 @@ public com.google.api.LogDescriptor.Builder addLogsBuilder() { * repeated .google.api.LogDescriptor logs = 23; */ public com.google.api.LogDescriptor.Builder addLogsBuilder(int index) { - return getLogsFieldBuilder() + return internalGetLogsFieldBuilder() .addBuilder(index, com.google.api.LogDescriptor.getDefaultInstance()); } + /** * * @@ -6844,21 +7227,21 @@ public com.google.api.LogDescriptor.Builder addLogsBuilder(int index) { * repeated .google.api.LogDescriptor logs = 23; */ public java.util.List getLogsBuilderList() { - return getLogsFieldBuilder().getBuilderList(); + return internalGetLogsFieldBuilder().getBuilderList(); } - private com.google.protobuf.RepeatedFieldBuilderV3< + private com.google.protobuf.RepeatedFieldBuilder< com.google.api.LogDescriptor, com.google.api.LogDescriptor.Builder, com.google.api.LogDescriptorOrBuilder> - getLogsFieldBuilder() { + internalGetLogsFieldBuilder() { if (logsBuilder_ == null) { logsBuilder_ = - new com.google.protobuf.RepeatedFieldBuilderV3< + new com.google.protobuf.RepeatedFieldBuilder< com.google.api.LogDescriptor, com.google.api.LogDescriptor.Builder, com.google.api.LogDescriptorOrBuilder>( - logs_, ((bitField0_ & 0x00000010) != 0), getParentForChildren(), isClean()); + logs_, ((bitField0_ & 0x00010000) != 0), getParentForChildren(), isClean()); logs_ = null; } return logsBuilder_; @@ -6868,13 +7251,13 @@ public java.util.List getLogsBuilderList() java.util.Collections.emptyList(); private void ensureMetricsIsMutable() { - if (!((bitField0_ & 0x00000020) != 0)) { + if (!((bitField0_ & 0x00020000) != 0)) { metrics_ = new java.util.ArrayList(metrics_); - bitField0_ |= 0x00000020; + bitField0_ |= 0x00020000; } } - private com.google.protobuf.RepeatedFieldBuilderV3< + private com.google.protobuf.RepeatedFieldBuilder< com.google.api.MetricDescriptor, com.google.api.MetricDescriptor.Builder, com.google.api.MetricDescriptorOrBuilder> @@ -6896,6 +7279,7 @@ public java.util.List getMetricsList() { return metricsBuilder_.getMessageList(); } } + /** * * @@ -6912,6 +7296,7 @@ public int getMetricsCount() { return metricsBuilder_.getCount(); } } + /** * * @@ -6928,6 +7313,7 @@ public com.google.api.MetricDescriptor getMetrics(int index) { return metricsBuilder_.getMessage(index); } } + /** * * @@ -6950,6 +7336,7 @@ public Builder setMetrics(int index, com.google.api.MetricDescriptor value) { } return this; } + /** * * @@ -6969,6 +7356,7 @@ public Builder setMetrics(int index, com.google.api.MetricDescriptor.Builder bui } return this; } + /** * * @@ -6991,6 +7379,7 @@ public Builder addMetrics(com.google.api.MetricDescriptor value) { } return this; } + /** * * @@ -7013,6 +7402,7 @@ public Builder addMetrics(int index, com.google.api.MetricDescriptor value) { } return this; } + /** * * @@ -7032,6 +7422,7 @@ public Builder addMetrics(com.google.api.MetricDescriptor.Builder builderForValu } return this; } + /** * * @@ -7051,6 +7442,7 @@ public Builder addMetrics(int index, com.google.api.MetricDescriptor.Builder bui } return this; } + /** * * @@ -7071,6 +7463,7 @@ public Builder addAllMetrics( } return this; } + /** * * @@ -7083,13 +7476,14 @@ public Builder addAllMetrics( public Builder clearMetrics() { if (metricsBuilder_ == null) { metrics_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000020); + bitField0_ = (bitField0_ & ~0x00020000); onChanged(); } else { metricsBuilder_.clear(); } return this; } + /** * * @@ -7109,6 +7503,7 @@ public Builder removeMetrics(int index) { } return this; } + /** * * @@ -7119,8 +7514,9 @@ public Builder removeMetrics(int index) { * repeated .google.api.MetricDescriptor metrics = 24; */ public com.google.api.MetricDescriptor.Builder getMetricsBuilder(int index) { - return getMetricsFieldBuilder().getBuilder(index); + return internalGetMetricsFieldBuilder().getBuilder(index); } + /** * * @@ -7137,6 +7533,7 @@ public com.google.api.MetricDescriptorOrBuilder getMetricsOrBuilder(int index) { return metricsBuilder_.getMessageOrBuilder(index); } } + /** * * @@ -7154,6 +7551,7 @@ public com.google.api.MetricDescriptorOrBuilder getMetricsOrBuilder(int index) { return java.util.Collections.unmodifiableList(metrics_); } } + /** * * @@ -7164,9 +7562,10 @@ public com.google.api.MetricDescriptorOrBuilder getMetricsOrBuilder(int index) { * repeated .google.api.MetricDescriptor metrics = 24; */ public com.google.api.MetricDescriptor.Builder addMetricsBuilder() { - return getMetricsFieldBuilder() + return internalGetMetricsFieldBuilder() .addBuilder(com.google.api.MetricDescriptor.getDefaultInstance()); } + /** * * @@ -7177,9 +7576,10 @@ public com.google.api.MetricDescriptor.Builder addMetricsBuilder() { * repeated .google.api.MetricDescriptor metrics = 24; */ public com.google.api.MetricDescriptor.Builder addMetricsBuilder(int index) { - return getMetricsFieldBuilder() + return internalGetMetricsFieldBuilder() .addBuilder(index, com.google.api.MetricDescriptor.getDefaultInstance()); } + /** * * @@ -7190,21 +7590,21 @@ public com.google.api.MetricDescriptor.Builder addMetricsBuilder(int index) { * repeated .google.api.MetricDescriptor metrics = 24; */ public java.util.List getMetricsBuilderList() { - return getMetricsFieldBuilder().getBuilderList(); + return internalGetMetricsFieldBuilder().getBuilderList(); } - private com.google.protobuf.RepeatedFieldBuilderV3< + private com.google.protobuf.RepeatedFieldBuilder< com.google.api.MetricDescriptor, com.google.api.MetricDescriptor.Builder, com.google.api.MetricDescriptorOrBuilder> - getMetricsFieldBuilder() { + internalGetMetricsFieldBuilder() { if (metricsBuilder_ == null) { metricsBuilder_ = - new com.google.protobuf.RepeatedFieldBuilderV3< + new com.google.protobuf.RepeatedFieldBuilder< com.google.api.MetricDescriptor, com.google.api.MetricDescriptor.Builder, com.google.api.MetricDescriptorOrBuilder>( - metrics_, ((bitField0_ & 0x00000020) != 0), getParentForChildren(), isClean()); + metrics_, ((bitField0_ & 0x00020000) != 0), getParentForChildren(), isClean()); metrics_ = null; } return metricsBuilder_; @@ -7214,15 +7614,15 @@ public java.util.List getMetricsBuilder java.util.Collections.emptyList(); private void ensureMonitoredResourcesIsMutable() { - if (!((bitField0_ & 0x00000040) != 0)) { + if (!((bitField0_ & 0x00040000) != 0)) { monitoredResources_ = new java.util.ArrayList( monitoredResources_); - bitField0_ |= 0x00000040; + bitField0_ |= 0x00040000; } } - private com.google.protobuf.RepeatedFieldBuilderV3< + private com.google.protobuf.RepeatedFieldBuilder< com.google.api.MonitoredResourceDescriptor, com.google.api.MonitoredResourceDescriptor.Builder, com.google.api.MonitoredResourceDescriptorOrBuilder> @@ -7233,7 +7633,8 @@ private void ensureMonitoredResourcesIsMutable() { * *
              * Defines the monitored resources used by this service. This is required
        -     * by the [Service.monitoring][google.api.Service.monitoring] and [Service.logging][google.api.Service.logging] configurations.
        +     * by the [Service.monitoring][google.api.Service.monitoring] and
        +     * [Service.logging][google.api.Service.logging] configurations.
              * 
        * * repeated .google.api.MonitoredResourceDescriptor monitored_resources = 25; @@ -7245,12 +7646,14 @@ public java.util.List getMonitoredRe return monitoredResourcesBuilder_.getMessageList(); } } + /** * * *
              * Defines the monitored resources used by this service. This is required
        -     * by the [Service.monitoring][google.api.Service.monitoring] and [Service.logging][google.api.Service.logging] configurations.
        +     * by the [Service.monitoring][google.api.Service.monitoring] and
        +     * [Service.logging][google.api.Service.logging] configurations.
              * 
        * * repeated .google.api.MonitoredResourceDescriptor monitored_resources = 25; @@ -7262,12 +7665,14 @@ public int getMonitoredResourcesCount() { return monitoredResourcesBuilder_.getCount(); } } + /** * * *
              * Defines the monitored resources used by this service. This is required
        -     * by the [Service.monitoring][google.api.Service.monitoring] and [Service.logging][google.api.Service.logging] configurations.
        +     * by the [Service.monitoring][google.api.Service.monitoring] and
        +     * [Service.logging][google.api.Service.logging] configurations.
              * 
        * * repeated .google.api.MonitoredResourceDescriptor monitored_resources = 25; @@ -7279,12 +7684,14 @@ public com.google.api.MonitoredResourceDescriptor getMonitoredResources(int inde return monitoredResourcesBuilder_.getMessage(index); } } + /** * * *
              * Defines the monitored resources used by this service. This is required
        -     * by the [Service.monitoring][google.api.Service.monitoring] and [Service.logging][google.api.Service.logging] configurations.
        +     * by the [Service.monitoring][google.api.Service.monitoring] and
        +     * [Service.logging][google.api.Service.logging] configurations.
              * 
        * * repeated .google.api.MonitoredResourceDescriptor monitored_resources = 25; @@ -7303,12 +7710,14 @@ public Builder setMonitoredResources( } return this; } + /** * * *
              * Defines the monitored resources used by this service. This is required
        -     * by the [Service.monitoring][google.api.Service.monitoring] and [Service.logging][google.api.Service.logging] configurations.
        +     * by the [Service.monitoring][google.api.Service.monitoring] and
        +     * [Service.logging][google.api.Service.logging] configurations.
              * 
        * * repeated .google.api.MonitoredResourceDescriptor monitored_resources = 25; @@ -7324,12 +7733,14 @@ public Builder setMonitoredResources( } return this; } + /** * * *
              * Defines the monitored resources used by this service. This is required
        -     * by the [Service.monitoring][google.api.Service.monitoring] and [Service.logging][google.api.Service.logging] configurations.
        +     * by the [Service.monitoring][google.api.Service.monitoring] and
        +     * [Service.logging][google.api.Service.logging] configurations.
              * 
        * * repeated .google.api.MonitoredResourceDescriptor monitored_resources = 25; @@ -7347,12 +7758,14 @@ public Builder addMonitoredResources(com.google.api.MonitoredResourceDescriptor } return this; } + /** * * *
              * Defines the monitored resources used by this service. This is required
        -     * by the [Service.monitoring][google.api.Service.monitoring] and [Service.logging][google.api.Service.logging] configurations.
        +     * by the [Service.monitoring][google.api.Service.monitoring] and
        +     * [Service.logging][google.api.Service.logging] configurations.
              * 
        * * repeated .google.api.MonitoredResourceDescriptor monitored_resources = 25; @@ -7371,12 +7784,14 @@ public Builder addMonitoredResources( } return this; } + /** * * *
              * Defines the monitored resources used by this service. This is required
        -     * by the [Service.monitoring][google.api.Service.monitoring] and [Service.logging][google.api.Service.logging] configurations.
        +     * by the [Service.monitoring][google.api.Service.monitoring] and
        +     * [Service.logging][google.api.Service.logging] configurations.
              * 
        * * repeated .google.api.MonitoredResourceDescriptor monitored_resources = 25; @@ -7392,12 +7807,14 @@ public Builder addMonitoredResources( } return this; } + /** * * *
              * Defines the monitored resources used by this service. This is required
        -     * by the [Service.monitoring][google.api.Service.monitoring] and [Service.logging][google.api.Service.logging] configurations.
        +     * by the [Service.monitoring][google.api.Service.monitoring] and
        +     * [Service.logging][google.api.Service.logging] configurations.
              * 
        * * repeated .google.api.MonitoredResourceDescriptor monitored_resources = 25; @@ -7413,12 +7830,14 @@ public Builder addMonitoredResources( } return this; } + /** * * *
              * Defines the monitored resources used by this service. This is required
        -     * by the [Service.monitoring][google.api.Service.monitoring] and [Service.logging][google.api.Service.logging] configurations.
        +     * by the [Service.monitoring][google.api.Service.monitoring] and
        +     * [Service.logging][google.api.Service.logging] configurations.
              * 
        * * repeated .google.api.MonitoredResourceDescriptor monitored_resources = 25; @@ -7434,12 +7853,14 @@ public Builder addAllMonitoredResources( } return this; } + /** * * *
              * Defines the monitored resources used by this service. This is required
        -     * by the [Service.monitoring][google.api.Service.monitoring] and [Service.logging][google.api.Service.logging] configurations.
        +     * by the [Service.monitoring][google.api.Service.monitoring] and
        +     * [Service.logging][google.api.Service.logging] configurations.
              * 
        * * repeated .google.api.MonitoredResourceDescriptor monitored_resources = 25; @@ -7447,19 +7868,21 @@ public Builder addAllMonitoredResources( public Builder clearMonitoredResources() { if (monitoredResourcesBuilder_ == null) { monitoredResources_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000040); + bitField0_ = (bitField0_ & ~0x00040000); onChanged(); } else { monitoredResourcesBuilder_.clear(); } return this; } + /** * * *
              * Defines the monitored resources used by this service. This is required
        -     * by the [Service.monitoring][google.api.Service.monitoring] and [Service.logging][google.api.Service.logging] configurations.
        +     * by the [Service.monitoring][google.api.Service.monitoring] and
        +     * [Service.logging][google.api.Service.logging] configurations.
              * 
        * * repeated .google.api.MonitoredResourceDescriptor monitored_resources = 25; @@ -7474,26 +7897,30 @@ public Builder removeMonitoredResources(int index) { } return this; } + /** * * *
              * Defines the monitored resources used by this service. This is required
        -     * by the [Service.monitoring][google.api.Service.monitoring] and [Service.logging][google.api.Service.logging] configurations.
        +     * by the [Service.monitoring][google.api.Service.monitoring] and
        +     * [Service.logging][google.api.Service.logging] configurations.
              * 
        * * repeated .google.api.MonitoredResourceDescriptor monitored_resources = 25; */ public com.google.api.MonitoredResourceDescriptor.Builder getMonitoredResourcesBuilder( int index) { - return getMonitoredResourcesFieldBuilder().getBuilder(index); + return internalGetMonitoredResourcesFieldBuilder().getBuilder(index); } + /** * * *
              * Defines the monitored resources used by this service. This is required
        -     * by the [Service.monitoring][google.api.Service.monitoring] and [Service.logging][google.api.Service.logging] configurations.
        +     * by the [Service.monitoring][google.api.Service.monitoring] and
        +     * [Service.logging][google.api.Service.logging] configurations.
              * 
        * * repeated .google.api.MonitoredResourceDescriptor monitored_resources = 25; @@ -7506,12 +7933,14 @@ public com.google.api.MonitoredResourceDescriptorOrBuilder getMonitoredResources return monitoredResourcesBuilder_.getMessageOrBuilder(index); } } + /** * * *
              * Defines the monitored resources used by this service. This is required
        -     * by the [Service.monitoring][google.api.Service.monitoring] and [Service.logging][google.api.Service.logging] configurations.
        +     * by the [Service.monitoring][google.api.Service.monitoring] and
        +     * [Service.logging][google.api.Service.logging] configurations.
              * 
        * * repeated .google.api.MonitoredResourceDescriptor monitored_resources = 25; @@ -7524,63 +7953,69 @@ public com.google.api.MonitoredResourceDescriptorOrBuilder getMonitoredResources return java.util.Collections.unmodifiableList(monitoredResources_); } } + /** * * *
              * Defines the monitored resources used by this service. This is required
        -     * by the [Service.monitoring][google.api.Service.monitoring] and [Service.logging][google.api.Service.logging] configurations.
        +     * by the [Service.monitoring][google.api.Service.monitoring] and
        +     * [Service.logging][google.api.Service.logging] configurations.
              * 
        * * repeated .google.api.MonitoredResourceDescriptor monitored_resources = 25; */ public com.google.api.MonitoredResourceDescriptor.Builder addMonitoredResourcesBuilder() { - return getMonitoredResourcesFieldBuilder() + return internalGetMonitoredResourcesFieldBuilder() .addBuilder(com.google.api.MonitoredResourceDescriptor.getDefaultInstance()); } + /** * * *
              * Defines the monitored resources used by this service. This is required
        -     * by the [Service.monitoring][google.api.Service.monitoring] and [Service.logging][google.api.Service.logging] configurations.
        +     * by the [Service.monitoring][google.api.Service.monitoring] and
        +     * [Service.logging][google.api.Service.logging] configurations.
              * 
        * * repeated .google.api.MonitoredResourceDescriptor monitored_resources = 25; */ public com.google.api.MonitoredResourceDescriptor.Builder addMonitoredResourcesBuilder( int index) { - return getMonitoredResourcesFieldBuilder() + return internalGetMonitoredResourcesFieldBuilder() .addBuilder(index, com.google.api.MonitoredResourceDescriptor.getDefaultInstance()); } + /** * * *
              * Defines the monitored resources used by this service. This is required
        -     * by the [Service.monitoring][google.api.Service.monitoring] and [Service.logging][google.api.Service.logging] configurations.
        +     * by the [Service.monitoring][google.api.Service.monitoring] and
        +     * [Service.logging][google.api.Service.logging] configurations.
              * 
        * * repeated .google.api.MonitoredResourceDescriptor monitored_resources = 25; */ public java.util.List getMonitoredResourcesBuilderList() { - return getMonitoredResourcesFieldBuilder().getBuilderList(); + return internalGetMonitoredResourcesFieldBuilder().getBuilderList(); } - private com.google.protobuf.RepeatedFieldBuilderV3< + private com.google.protobuf.RepeatedFieldBuilder< com.google.api.MonitoredResourceDescriptor, com.google.api.MonitoredResourceDescriptor.Builder, com.google.api.MonitoredResourceDescriptorOrBuilder> - getMonitoredResourcesFieldBuilder() { + internalGetMonitoredResourcesFieldBuilder() { if (monitoredResourcesBuilder_ == null) { monitoredResourcesBuilder_ = - new com.google.protobuf.RepeatedFieldBuilderV3< + new com.google.protobuf.RepeatedFieldBuilder< com.google.api.MonitoredResourceDescriptor, com.google.api.MonitoredResourceDescriptor.Builder, com.google.api.MonitoredResourceDescriptorOrBuilder>( monitoredResources_, - ((bitField0_ & 0x00000040) != 0), + ((bitField0_ & 0x00040000) != 0), getParentForChildren(), isClean()); monitoredResources_ = null; @@ -7589,9 +8024,10 @@ public com.google.api.MonitoredResourceDescriptor.Builder addMonitoredResourcesB } private com.google.api.Billing billing_; - private com.google.protobuf.SingleFieldBuilderV3< + private com.google.protobuf.SingleFieldBuilder< com.google.api.Billing, com.google.api.Billing.Builder, com.google.api.BillingOrBuilder> billingBuilder_; + /** * * @@ -7604,8 +8040,9 @@ public com.google.api.MonitoredResourceDescriptor.Builder addMonitoredResourcesB * @return Whether the billing field is set. */ public boolean hasBilling() { - return billingBuilder_ != null || billing_ != null; + return ((bitField0_ & 0x00080000) != 0); } + /** * * @@ -7624,6 +8061,7 @@ public com.google.api.Billing getBilling() { return billingBuilder_.getMessage(); } } + /** * * @@ -7639,13 +8077,14 @@ public Builder setBilling(com.google.api.Billing value) { throw new NullPointerException(); } billing_ = value; - onChanged(); } else { billingBuilder_.setMessage(value); } - + bitField0_ |= 0x00080000; + onChanged(); return this; } + /** * * @@ -7658,13 +8097,14 @@ public Builder setBilling(com.google.api.Billing value) { public Builder setBilling(com.google.api.Billing.Builder builderForValue) { if (billingBuilder_ == null) { billing_ = builderForValue.build(); - onChanged(); } else { billingBuilder_.setMessage(builderForValue.build()); } - + bitField0_ |= 0x00080000; + onChanged(); return this; } + /** * * @@ -7676,18 +8116,23 @@ public Builder setBilling(com.google.api.Billing.Builder builderForValue) { */ public Builder mergeBilling(com.google.api.Billing value) { if (billingBuilder_ == null) { - if (billing_ != null) { - billing_ = com.google.api.Billing.newBuilder(billing_).mergeFrom(value).buildPartial(); + if (((bitField0_ & 0x00080000) != 0) + && billing_ != null + && billing_ != com.google.api.Billing.getDefaultInstance()) { + getBillingBuilder().mergeFrom(value); } else { billing_ = value; } - onChanged(); } else { billingBuilder_.mergeFrom(value); } - + if (billing_ != null) { + bitField0_ |= 0x00080000; + onChanged(); + } return this; } + /** * * @@ -7698,16 +8143,16 @@ public Builder mergeBilling(com.google.api.Billing value) { * .google.api.Billing billing = 26; */ public Builder clearBilling() { - if (billingBuilder_ == null) { - billing_ = null; - onChanged(); - } else { - billing_ = null; + bitField0_ = (bitField0_ & ~0x00080000); + billing_ = null; + if (billingBuilder_ != null) { + billingBuilder_.dispose(); billingBuilder_ = null; } - + onChanged(); return this; } + /** * * @@ -7718,10 +8163,11 @@ public Builder clearBilling() { * .google.api.Billing billing = 26; */ public com.google.api.Billing.Builder getBillingBuilder() { - + bitField0_ |= 0x00080000; onChanged(); - return getBillingFieldBuilder().getBuilder(); + return internalGetBillingFieldBuilder().getBuilder(); } + /** * * @@ -7738,6 +8184,7 @@ public com.google.api.BillingOrBuilder getBillingOrBuilder() { return billing_ == null ? com.google.api.Billing.getDefaultInstance() : billing_; } } + /** * * @@ -7747,12 +8194,12 @@ public com.google.api.BillingOrBuilder getBillingOrBuilder() { * * .google.api.Billing billing = 26; */ - private com.google.protobuf.SingleFieldBuilderV3< + private com.google.protobuf.SingleFieldBuilder< com.google.api.Billing, com.google.api.Billing.Builder, com.google.api.BillingOrBuilder> - getBillingFieldBuilder() { + internalGetBillingFieldBuilder() { if (billingBuilder_ == null) { billingBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< + new com.google.protobuf.SingleFieldBuilder< com.google.api.Billing, com.google.api.Billing.Builder, com.google.api.BillingOrBuilder>(getBilling(), getParentForChildren(), isClean()); @@ -7762,9 +8209,10 @@ public com.google.api.BillingOrBuilder getBillingOrBuilder() { } private com.google.api.Logging logging_; - private com.google.protobuf.SingleFieldBuilderV3< + private com.google.protobuf.SingleFieldBuilder< com.google.api.Logging, com.google.api.Logging.Builder, com.google.api.LoggingOrBuilder> loggingBuilder_; + /** * * @@ -7777,8 +8225,9 @@ public com.google.api.BillingOrBuilder getBillingOrBuilder() { * @return Whether the logging field is set. */ public boolean hasLogging() { - return loggingBuilder_ != null || logging_ != null; + return ((bitField0_ & 0x00100000) != 0); } + /** * * @@ -7797,6 +8246,7 @@ public com.google.api.Logging getLogging() { return loggingBuilder_.getMessage(); } } + /** * * @@ -7812,13 +8262,14 @@ public Builder setLogging(com.google.api.Logging value) { throw new NullPointerException(); } logging_ = value; - onChanged(); } else { loggingBuilder_.setMessage(value); } - + bitField0_ |= 0x00100000; + onChanged(); return this; } + /** * * @@ -7831,13 +8282,14 @@ public Builder setLogging(com.google.api.Logging value) { public Builder setLogging(com.google.api.Logging.Builder builderForValue) { if (loggingBuilder_ == null) { logging_ = builderForValue.build(); - onChanged(); } else { loggingBuilder_.setMessage(builderForValue.build()); } - + bitField0_ |= 0x00100000; + onChanged(); return this; } + /** * * @@ -7849,18 +8301,23 @@ public Builder setLogging(com.google.api.Logging.Builder builderForValue) { */ public Builder mergeLogging(com.google.api.Logging value) { if (loggingBuilder_ == null) { - if (logging_ != null) { - logging_ = com.google.api.Logging.newBuilder(logging_).mergeFrom(value).buildPartial(); + if (((bitField0_ & 0x00100000) != 0) + && logging_ != null + && logging_ != com.google.api.Logging.getDefaultInstance()) { + getLoggingBuilder().mergeFrom(value); } else { logging_ = value; } - onChanged(); } else { loggingBuilder_.mergeFrom(value); } - + if (logging_ != null) { + bitField0_ |= 0x00100000; + onChanged(); + } return this; } + /** * * @@ -7871,16 +8328,16 @@ public Builder mergeLogging(com.google.api.Logging value) { * .google.api.Logging logging = 27; */ public Builder clearLogging() { - if (loggingBuilder_ == null) { - logging_ = null; - onChanged(); - } else { - logging_ = null; + bitField0_ = (bitField0_ & ~0x00100000); + logging_ = null; + if (loggingBuilder_ != null) { + loggingBuilder_.dispose(); loggingBuilder_ = null; } - + onChanged(); return this; } + /** * * @@ -7891,10 +8348,11 @@ public Builder clearLogging() { * .google.api.Logging logging = 27; */ public com.google.api.Logging.Builder getLoggingBuilder() { - + bitField0_ |= 0x00100000; onChanged(); - return getLoggingFieldBuilder().getBuilder(); + return internalGetLoggingFieldBuilder().getBuilder(); } + /** * * @@ -7911,6 +8369,7 @@ public com.google.api.LoggingOrBuilder getLoggingOrBuilder() { return logging_ == null ? com.google.api.Logging.getDefaultInstance() : logging_; } } + /** * * @@ -7920,12 +8379,12 @@ public com.google.api.LoggingOrBuilder getLoggingOrBuilder() { * * .google.api.Logging logging = 27; */ - private com.google.protobuf.SingleFieldBuilderV3< + private com.google.protobuf.SingleFieldBuilder< com.google.api.Logging, com.google.api.Logging.Builder, com.google.api.LoggingOrBuilder> - getLoggingFieldBuilder() { + internalGetLoggingFieldBuilder() { if (loggingBuilder_ == null) { loggingBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< + new com.google.protobuf.SingleFieldBuilder< com.google.api.Logging, com.google.api.Logging.Builder, com.google.api.LoggingOrBuilder>(getLogging(), getParentForChildren(), isClean()); @@ -7935,11 +8394,12 @@ public com.google.api.LoggingOrBuilder getLoggingOrBuilder() { } private com.google.api.Monitoring monitoring_; - private com.google.protobuf.SingleFieldBuilderV3< + private com.google.protobuf.SingleFieldBuilder< com.google.api.Monitoring, com.google.api.Monitoring.Builder, com.google.api.MonitoringOrBuilder> monitoringBuilder_; + /** * * @@ -7952,8 +8412,9 @@ public com.google.api.LoggingOrBuilder getLoggingOrBuilder() { * @return Whether the monitoring field is set. */ public boolean hasMonitoring() { - return monitoringBuilder_ != null || monitoring_ != null; + return ((bitField0_ & 0x00200000) != 0); } + /** * * @@ -7972,6 +8433,7 @@ public com.google.api.Monitoring getMonitoring() { return monitoringBuilder_.getMessage(); } } + /** * * @@ -7987,13 +8449,14 @@ public Builder setMonitoring(com.google.api.Monitoring value) { throw new NullPointerException(); } monitoring_ = value; - onChanged(); } else { monitoringBuilder_.setMessage(value); } - + bitField0_ |= 0x00200000; + onChanged(); return this; } + /** * * @@ -8006,13 +8469,14 @@ public Builder setMonitoring(com.google.api.Monitoring value) { public Builder setMonitoring(com.google.api.Monitoring.Builder builderForValue) { if (monitoringBuilder_ == null) { monitoring_ = builderForValue.build(); - onChanged(); } else { monitoringBuilder_.setMessage(builderForValue.build()); } - + bitField0_ |= 0x00200000; + onChanged(); return this; } + /** * * @@ -8024,19 +8488,23 @@ public Builder setMonitoring(com.google.api.Monitoring.Builder builderForValue) */ public Builder mergeMonitoring(com.google.api.Monitoring value) { if (monitoringBuilder_ == null) { - if (monitoring_ != null) { - monitoring_ = - com.google.api.Monitoring.newBuilder(monitoring_).mergeFrom(value).buildPartial(); + if (((bitField0_ & 0x00200000) != 0) + && monitoring_ != null + && monitoring_ != com.google.api.Monitoring.getDefaultInstance()) { + getMonitoringBuilder().mergeFrom(value); } else { monitoring_ = value; } - onChanged(); } else { monitoringBuilder_.mergeFrom(value); } - + if (monitoring_ != null) { + bitField0_ |= 0x00200000; + onChanged(); + } return this; } + /** * * @@ -8047,16 +8515,16 @@ public Builder mergeMonitoring(com.google.api.Monitoring value) { * .google.api.Monitoring monitoring = 28; */ public Builder clearMonitoring() { - if (monitoringBuilder_ == null) { - monitoring_ = null; - onChanged(); - } else { - monitoring_ = null; + bitField0_ = (bitField0_ & ~0x00200000); + monitoring_ = null; + if (monitoringBuilder_ != null) { + monitoringBuilder_.dispose(); monitoringBuilder_ = null; } - + onChanged(); return this; } + /** * * @@ -8067,10 +8535,11 @@ public Builder clearMonitoring() { * .google.api.Monitoring monitoring = 28; */ public com.google.api.Monitoring.Builder getMonitoringBuilder() { - + bitField0_ |= 0x00200000; onChanged(); - return getMonitoringFieldBuilder().getBuilder(); + return internalGetMonitoringFieldBuilder().getBuilder(); } + /** * * @@ -8087,6 +8556,7 @@ public com.google.api.MonitoringOrBuilder getMonitoringOrBuilder() { return monitoring_ == null ? com.google.api.Monitoring.getDefaultInstance() : monitoring_; } } + /** * * @@ -8096,14 +8566,14 @@ public com.google.api.MonitoringOrBuilder getMonitoringOrBuilder() { * * .google.api.Monitoring monitoring = 28; */ - private com.google.protobuf.SingleFieldBuilderV3< + private com.google.protobuf.SingleFieldBuilder< com.google.api.Monitoring, com.google.api.Monitoring.Builder, com.google.api.MonitoringOrBuilder> - getMonitoringFieldBuilder() { + internalGetMonitoringFieldBuilder() { if (monitoringBuilder_ == null) { monitoringBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< + new com.google.protobuf.SingleFieldBuilder< com.google.api.Monitoring, com.google.api.Monitoring.Builder, com.google.api.MonitoringOrBuilder>( @@ -8114,11 +8584,12 @@ public com.google.api.MonitoringOrBuilder getMonitoringOrBuilder() { } private com.google.api.SystemParameters systemParameters_; - private com.google.protobuf.SingleFieldBuilderV3< + private com.google.protobuf.SingleFieldBuilder< com.google.api.SystemParameters, com.google.api.SystemParameters.Builder, com.google.api.SystemParametersOrBuilder> systemParametersBuilder_; + /** * * @@ -8131,8 +8602,9 @@ public com.google.api.MonitoringOrBuilder getMonitoringOrBuilder() { * @return Whether the systemParameters field is set. */ public boolean hasSystemParameters() { - return systemParametersBuilder_ != null || systemParameters_ != null; + return ((bitField0_ & 0x00400000) != 0); } + /** * * @@ -8153,6 +8625,7 @@ public com.google.api.SystemParameters getSystemParameters() { return systemParametersBuilder_.getMessage(); } } + /** * * @@ -8168,13 +8641,14 @@ public Builder setSystemParameters(com.google.api.SystemParameters value) { throw new NullPointerException(); } systemParameters_ = value; - onChanged(); } else { systemParametersBuilder_.setMessage(value); } - + bitField0_ |= 0x00400000; + onChanged(); return this; } + /** * * @@ -8187,13 +8661,14 @@ public Builder setSystemParameters(com.google.api.SystemParameters value) { public Builder setSystemParameters(com.google.api.SystemParameters.Builder builderForValue) { if (systemParametersBuilder_ == null) { systemParameters_ = builderForValue.build(); - onChanged(); } else { systemParametersBuilder_.setMessage(builderForValue.build()); } - + bitField0_ |= 0x00400000; + onChanged(); return this; } + /** * * @@ -8205,21 +8680,23 @@ public Builder setSystemParameters(com.google.api.SystemParameters.Builder build */ public Builder mergeSystemParameters(com.google.api.SystemParameters value) { if (systemParametersBuilder_ == null) { - if (systemParameters_ != null) { - systemParameters_ = - com.google.api.SystemParameters.newBuilder(systemParameters_) - .mergeFrom(value) - .buildPartial(); + if (((bitField0_ & 0x00400000) != 0) + && systemParameters_ != null + && systemParameters_ != com.google.api.SystemParameters.getDefaultInstance()) { + getSystemParametersBuilder().mergeFrom(value); } else { systemParameters_ = value; } - onChanged(); } else { systemParametersBuilder_.mergeFrom(value); } - + if (systemParameters_ != null) { + bitField0_ |= 0x00400000; + onChanged(); + } return this; } + /** * * @@ -8230,16 +8707,16 @@ public Builder mergeSystemParameters(com.google.api.SystemParameters value) { * .google.api.SystemParameters system_parameters = 29; */ public Builder clearSystemParameters() { - if (systemParametersBuilder_ == null) { - systemParameters_ = null; - onChanged(); - } else { - systemParameters_ = null; + bitField0_ = (bitField0_ & ~0x00400000); + systemParameters_ = null; + if (systemParametersBuilder_ != null) { + systemParametersBuilder_.dispose(); systemParametersBuilder_ = null; } - + onChanged(); return this; } + /** * * @@ -8250,10 +8727,11 @@ public Builder clearSystemParameters() { * .google.api.SystemParameters system_parameters = 29; */ public com.google.api.SystemParameters.Builder getSystemParametersBuilder() { - + bitField0_ |= 0x00400000; onChanged(); - return getSystemParametersFieldBuilder().getBuilder(); + return internalGetSystemParametersFieldBuilder().getBuilder(); } + /** * * @@ -8272,6 +8750,7 @@ public com.google.api.SystemParametersOrBuilder getSystemParametersOrBuilder() { : systemParameters_; } } + /** * * @@ -8281,14 +8760,14 @@ public com.google.api.SystemParametersOrBuilder getSystemParametersOrBuilder() { * * .google.api.SystemParameters system_parameters = 29; */ - private com.google.protobuf.SingleFieldBuilderV3< + private com.google.protobuf.SingleFieldBuilder< com.google.api.SystemParameters, com.google.api.SystemParameters.Builder, com.google.api.SystemParametersOrBuilder> - getSystemParametersFieldBuilder() { + internalGetSystemParametersFieldBuilder() { if (systemParametersBuilder_ == null) { systemParametersBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< + new com.google.protobuf.SingleFieldBuilder< com.google.api.SystemParameters, com.google.api.SystemParameters.Builder, com.google.api.SystemParametersOrBuilder>( @@ -8299,11 +8778,12 @@ public com.google.api.SystemParametersOrBuilder getSystemParametersOrBuilder() { } private com.google.api.SourceInfo sourceInfo_; - private com.google.protobuf.SingleFieldBuilderV3< + private com.google.protobuf.SingleFieldBuilder< com.google.api.SourceInfo, com.google.api.SourceInfo.Builder, com.google.api.SourceInfoOrBuilder> sourceInfoBuilder_; + /** * * @@ -8316,8 +8796,9 @@ public com.google.api.SystemParametersOrBuilder getSystemParametersOrBuilder() { * @return Whether the sourceInfo field is set. */ public boolean hasSourceInfo() { - return sourceInfoBuilder_ != null || sourceInfo_ != null; + return ((bitField0_ & 0x00800000) != 0); } + /** * * @@ -8336,6 +8817,7 @@ public com.google.api.SourceInfo getSourceInfo() { return sourceInfoBuilder_.getMessage(); } } + /** * * @@ -8351,13 +8833,14 @@ public Builder setSourceInfo(com.google.api.SourceInfo value) { throw new NullPointerException(); } sourceInfo_ = value; - onChanged(); } else { sourceInfoBuilder_.setMessage(value); } - + bitField0_ |= 0x00800000; + onChanged(); return this; } + /** * * @@ -8370,13 +8853,14 @@ public Builder setSourceInfo(com.google.api.SourceInfo value) { public Builder setSourceInfo(com.google.api.SourceInfo.Builder builderForValue) { if (sourceInfoBuilder_ == null) { sourceInfo_ = builderForValue.build(); - onChanged(); } else { sourceInfoBuilder_.setMessage(builderForValue.build()); } - + bitField0_ |= 0x00800000; + onChanged(); return this; } + /** * * @@ -8388,19 +8872,23 @@ public Builder setSourceInfo(com.google.api.SourceInfo.Builder builderForValue) */ public Builder mergeSourceInfo(com.google.api.SourceInfo value) { if (sourceInfoBuilder_ == null) { - if (sourceInfo_ != null) { - sourceInfo_ = - com.google.api.SourceInfo.newBuilder(sourceInfo_).mergeFrom(value).buildPartial(); + if (((bitField0_ & 0x00800000) != 0) + && sourceInfo_ != null + && sourceInfo_ != com.google.api.SourceInfo.getDefaultInstance()) { + getSourceInfoBuilder().mergeFrom(value); } else { sourceInfo_ = value; } - onChanged(); } else { sourceInfoBuilder_.mergeFrom(value); } - + if (sourceInfo_ != null) { + bitField0_ |= 0x00800000; + onChanged(); + } return this; } + /** * * @@ -8411,16 +8899,16 @@ public Builder mergeSourceInfo(com.google.api.SourceInfo value) { * .google.api.SourceInfo source_info = 37; */ public Builder clearSourceInfo() { - if (sourceInfoBuilder_ == null) { - sourceInfo_ = null; - onChanged(); - } else { - sourceInfo_ = null; + bitField0_ = (bitField0_ & ~0x00800000); + sourceInfo_ = null; + if (sourceInfoBuilder_ != null) { + sourceInfoBuilder_.dispose(); sourceInfoBuilder_ = null; } - + onChanged(); return this; } + /** * * @@ -8431,10 +8919,11 @@ public Builder clearSourceInfo() { * .google.api.SourceInfo source_info = 37; */ public com.google.api.SourceInfo.Builder getSourceInfoBuilder() { - + bitField0_ |= 0x00800000; onChanged(); - return getSourceInfoFieldBuilder().getBuilder(); + return internalGetSourceInfoFieldBuilder().getBuilder(); } + /** * * @@ -8451,6 +8940,7 @@ public com.google.api.SourceInfoOrBuilder getSourceInfoOrBuilder() { return sourceInfo_ == null ? com.google.api.SourceInfo.getDefaultInstance() : sourceInfo_; } } + /** * * @@ -8460,14 +8950,14 @@ public com.google.api.SourceInfoOrBuilder getSourceInfoOrBuilder() { * * .google.api.SourceInfo source_info = 37; */ - private com.google.protobuf.SingleFieldBuilderV3< + private com.google.protobuf.SingleFieldBuilder< com.google.api.SourceInfo, com.google.api.SourceInfo.Builder, com.google.api.SourceInfoOrBuilder> - getSourceInfoFieldBuilder() { + internalGetSourceInfoFieldBuilder() { if (sourceInfoBuilder_ == null) { sourceInfoBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< + new com.google.protobuf.SingleFieldBuilder< com.google.api.SourceInfo, com.google.api.SourceInfo.Builder, com.google.api.SourceInfoOrBuilder>( @@ -8478,11 +8968,12 @@ public com.google.api.SourceInfoOrBuilder getSourceInfoOrBuilder() { } private com.google.api.Publishing publishing_; - private com.google.protobuf.SingleFieldBuilderV3< + private com.google.protobuf.SingleFieldBuilder< com.google.api.Publishing, com.google.api.Publishing.Builder, com.google.api.PublishingOrBuilder> publishingBuilder_; + /** * * @@ -8497,8 +8988,9 @@ public com.google.api.SourceInfoOrBuilder getSourceInfoOrBuilder() { * @return Whether the publishing field is set. */ public boolean hasPublishing() { - return publishingBuilder_ != null || publishing_ != null; + return ((bitField0_ & 0x01000000) != 0); } + /** * * @@ -8519,6 +9011,7 @@ public com.google.api.Publishing getPublishing() { return publishingBuilder_.getMessage(); } } + /** * * @@ -8536,13 +9029,14 @@ public Builder setPublishing(com.google.api.Publishing value) { throw new NullPointerException(); } publishing_ = value; - onChanged(); } else { publishingBuilder_.setMessage(value); } - + bitField0_ |= 0x01000000; + onChanged(); return this; } + /** * * @@ -8557,13 +9051,14 @@ public Builder setPublishing(com.google.api.Publishing value) { public Builder setPublishing(com.google.api.Publishing.Builder builderForValue) { if (publishingBuilder_ == null) { publishing_ = builderForValue.build(); - onChanged(); } else { publishingBuilder_.setMessage(builderForValue.build()); } - + bitField0_ |= 0x01000000; + onChanged(); return this; } + /** * * @@ -8577,19 +9072,23 @@ public Builder setPublishing(com.google.api.Publishing.Builder builderForValue) */ public Builder mergePublishing(com.google.api.Publishing value) { if (publishingBuilder_ == null) { - if (publishing_ != null) { - publishing_ = - com.google.api.Publishing.newBuilder(publishing_).mergeFrom(value).buildPartial(); + if (((bitField0_ & 0x01000000) != 0) + && publishing_ != null + && publishing_ != com.google.api.Publishing.getDefaultInstance()) { + getPublishingBuilder().mergeFrom(value); } else { publishing_ = value; } - onChanged(); } else { publishingBuilder_.mergeFrom(value); } - + if (publishing_ != null) { + bitField0_ |= 0x01000000; + onChanged(); + } return this; } + /** * * @@ -8602,16 +9101,16 @@ public Builder mergePublishing(com.google.api.Publishing value) { * .google.api.Publishing publishing = 45; */ public Builder clearPublishing() { - if (publishingBuilder_ == null) { - publishing_ = null; - onChanged(); - } else { - publishing_ = null; + bitField0_ = (bitField0_ & ~0x01000000); + publishing_ = null; + if (publishingBuilder_ != null) { + publishingBuilder_.dispose(); publishingBuilder_ = null; } - + onChanged(); return this; } + /** * * @@ -8624,10 +9123,11 @@ public Builder clearPublishing() { * .google.api.Publishing publishing = 45; */ public com.google.api.Publishing.Builder getPublishingBuilder() { - + bitField0_ |= 0x01000000; onChanged(); - return getPublishingFieldBuilder().getBuilder(); + return internalGetPublishingFieldBuilder().getBuilder(); } + /** * * @@ -8646,6 +9146,7 @@ public com.google.api.PublishingOrBuilder getPublishingOrBuilder() { return publishing_ == null ? com.google.api.Publishing.getDefaultInstance() : publishing_; } } + /** * * @@ -8657,14 +9158,14 @@ public com.google.api.PublishingOrBuilder getPublishingOrBuilder() { * * .google.api.Publishing publishing = 45; */ - private com.google.protobuf.SingleFieldBuilderV3< + private com.google.protobuf.SingleFieldBuilder< com.google.api.Publishing, com.google.api.Publishing.Builder, com.google.api.PublishingOrBuilder> - getPublishingFieldBuilder() { + internalGetPublishingFieldBuilder() { if (publishingBuilder_ == null) { publishingBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< + new com.google.protobuf.SingleFieldBuilder< com.google.api.Publishing, com.google.api.Publishing.Builder, com.google.api.PublishingOrBuilder>( @@ -8675,16 +9176,18 @@ public com.google.api.PublishingOrBuilder getPublishingOrBuilder() { } private com.google.protobuf.UInt32Value configVersion_; - private com.google.protobuf.SingleFieldBuilderV3< + private com.google.protobuf.SingleFieldBuilder< com.google.protobuf.UInt32Value, com.google.protobuf.UInt32Value.Builder, com.google.protobuf.UInt32ValueOrBuilder> configVersionBuilder_; + /** * * *
              * Obsolete. Do not use.
        +     *
              * This field has no semantic meaning. The service config compiler always
              * sets this field to `3`.
              * 
        @@ -8694,13 +9197,15 @@ public com.google.api.PublishingOrBuilder getPublishingOrBuilder() { * @return Whether the configVersion field is set. */ public boolean hasConfigVersion() { - return configVersionBuilder_ != null || configVersion_ != null; + return ((bitField0_ & 0x02000000) != 0); } + /** * * *
              * Obsolete. Do not use.
        +     *
              * This field has no semantic meaning. The service config compiler always
              * sets this field to `3`.
              * 
        @@ -8718,11 +9223,13 @@ public com.google.protobuf.UInt32Value getConfigVersion() { return configVersionBuilder_.getMessage(); } } + /** * * *
              * Obsolete. Do not use.
        +     *
              * This field has no semantic meaning. The service config compiler always
              * sets this field to `3`.
              * 
        @@ -8735,18 +9242,20 @@ public Builder setConfigVersion(com.google.protobuf.UInt32Value value) { throw new NullPointerException(); } configVersion_ = value; - onChanged(); } else { configVersionBuilder_.setMessage(value); } - + bitField0_ |= 0x02000000; + onChanged(); return this; } + /** * * *
              * Obsolete. Do not use.
        +     *
              * This field has no semantic meaning. The service config compiler always
              * sets this field to `3`.
              * 
        @@ -8756,18 +9265,20 @@ public Builder setConfigVersion(com.google.protobuf.UInt32Value value) { public Builder setConfigVersion(com.google.protobuf.UInt32Value.Builder builderForValue) { if (configVersionBuilder_ == null) { configVersion_ = builderForValue.build(); - onChanged(); } else { configVersionBuilder_.setMessage(builderForValue.build()); } - + bitField0_ |= 0x02000000; + onChanged(); return this; } + /** * * *
              * Obsolete. Do not use.
        +     *
              * This field has no semantic meaning. The service config compiler always
              * sets this field to `3`.
              * 
        @@ -8776,26 +9287,29 @@ public Builder setConfigVersion(com.google.protobuf.UInt32Value.Builder builderF */ public Builder mergeConfigVersion(com.google.protobuf.UInt32Value value) { if (configVersionBuilder_ == null) { - if (configVersion_ != null) { - configVersion_ = - com.google.protobuf.UInt32Value.newBuilder(configVersion_) - .mergeFrom(value) - .buildPartial(); + if (((bitField0_ & 0x02000000) != 0) + && configVersion_ != null + && configVersion_ != com.google.protobuf.UInt32Value.getDefaultInstance()) { + getConfigVersionBuilder().mergeFrom(value); } else { configVersion_ = value; } - onChanged(); } else { configVersionBuilder_.mergeFrom(value); } - + if (configVersion_ != null) { + bitField0_ |= 0x02000000; + onChanged(); + } return this; } + /** * * *
              * Obsolete. Do not use.
        +     *
              * This field has no semantic meaning. The service config compiler always
              * sets this field to `3`.
              * 
        @@ -8803,21 +9317,22 @@ public Builder mergeConfigVersion(com.google.protobuf.UInt32Value value) { * .google.protobuf.UInt32Value config_version = 20; */ public Builder clearConfigVersion() { - if (configVersionBuilder_ == null) { - configVersion_ = null; - onChanged(); - } else { - configVersion_ = null; + bitField0_ = (bitField0_ & ~0x02000000); + configVersion_ = null; + if (configVersionBuilder_ != null) { + configVersionBuilder_.dispose(); configVersionBuilder_ = null; } - + onChanged(); return this; } + /** * * *
              * Obsolete. Do not use.
        +     *
              * This field has no semantic meaning. The service config compiler always
              * sets this field to `3`.
              * 
        @@ -8825,15 +9340,17 @@ public Builder clearConfigVersion() { * .google.protobuf.UInt32Value config_version = 20; */ public com.google.protobuf.UInt32Value.Builder getConfigVersionBuilder() { - + bitField0_ |= 0x02000000; onChanged(); - return getConfigVersionFieldBuilder().getBuilder(); + return internalGetConfigVersionFieldBuilder().getBuilder(); } + /** * * *
              * Obsolete. Do not use.
        +     *
              * This field has no semantic meaning. The service config compiler always
              * sets this field to `3`.
              * 
        @@ -8849,25 +9366,27 @@ public com.google.protobuf.UInt32ValueOrBuilder getConfigVersionOrBuilder() { : configVersion_; } } + /** * * *
              * Obsolete. Do not use.
        +     *
              * This field has no semantic meaning. The service config compiler always
              * sets this field to `3`.
              * 
        * * .google.protobuf.UInt32Value config_version = 20; */ - private com.google.protobuf.SingleFieldBuilderV3< + private com.google.protobuf.SingleFieldBuilder< com.google.protobuf.UInt32Value, com.google.protobuf.UInt32Value.Builder, com.google.protobuf.UInt32ValueOrBuilder> - getConfigVersionFieldBuilder() { + internalGetConfigVersionFieldBuilder() { if (configVersionBuilder_ == null) { configVersionBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< + new com.google.protobuf.SingleFieldBuilder< com.google.protobuf.UInt32Value, com.google.protobuf.UInt32Value.Builder, com.google.protobuf.UInt32ValueOrBuilder>( @@ -8877,17 +9396,6 @@ public com.google.protobuf.UInt32ValueOrBuilder getConfigVersionOrBuilder() { return configVersionBuilder_; } - @java.lang.Override - public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - // @@protoc_insertion_point(builder_scope:google.api.Service) } diff --git a/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/ServiceOrBuilder.java b/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/ServiceOrBuilder.java index ee3a9cae6d..ae7e2ea7c7 100644 --- a/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/ServiceOrBuilder.java +++ b/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/ServiceOrBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,10 +14,13 @@ * limitations under the License. */ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: google/api/service.proto +// Protobuf Java Version: 4.33.2 package com.google.api; +@com.google.protobuf.Generated public interface ServiceOrBuilder extends // @@protoc_insertion_point(interface_extends:google.api.Service) @@ -38,6 +41,7 @@ public interface ServiceOrBuilder * @return The name. */ java.lang.String getName(); + /** * * @@ -67,6 +71,7 @@ public interface ServiceOrBuilder * @return The title. */ java.lang.String getTitle(); + /** * * @@ -93,6 +98,7 @@ public interface ServiceOrBuilder * @return The producerProjectId. */ java.lang.String getProducerProjectId(); + /** * * @@ -121,6 +127,7 @@ public interface ServiceOrBuilder * @return The id. */ java.lang.String getId(); + /** * * @@ -142,66 +149,70 @@ public interface ServiceOrBuilder * *
            * A list of API interfaces exported by this service. Only the `name` field
        -   * of the [google.protobuf.Api][google.protobuf.Api] needs to be provided by the configuration
        -   * author, as the remaining fields will be derived from the IDL during the
        -   * normalization process. It is an error to specify an API interface here
        -   * which cannot be resolved against the associated IDL files.
        +   * of the [google.protobuf.Api][google.protobuf.Api] needs to be provided by
        +   * the configuration author, as the remaining fields will be derived from the
        +   * IDL during the normalization process. It is an error to specify an API
        +   * interface here which cannot be resolved against the associated IDL files.
            * 
        * * repeated .google.protobuf.Api apis = 3; */ java.util.List getApisList(); + /** * * *
            * A list of API interfaces exported by this service. Only the `name` field
        -   * of the [google.protobuf.Api][google.protobuf.Api] needs to be provided by the configuration
        -   * author, as the remaining fields will be derived from the IDL during the
        -   * normalization process. It is an error to specify an API interface here
        -   * which cannot be resolved against the associated IDL files.
        +   * of the [google.protobuf.Api][google.protobuf.Api] needs to be provided by
        +   * the configuration author, as the remaining fields will be derived from the
        +   * IDL during the normalization process. It is an error to specify an API
        +   * interface here which cannot be resolved against the associated IDL files.
            * 
        * * repeated .google.protobuf.Api apis = 3; */ com.google.protobuf.Api getApis(int index); + /** * * *
            * A list of API interfaces exported by this service. Only the `name` field
        -   * of the [google.protobuf.Api][google.protobuf.Api] needs to be provided by the configuration
        -   * author, as the remaining fields will be derived from the IDL during the
        -   * normalization process. It is an error to specify an API interface here
        -   * which cannot be resolved against the associated IDL files.
        +   * of the [google.protobuf.Api][google.protobuf.Api] needs to be provided by
        +   * the configuration author, as the remaining fields will be derived from the
        +   * IDL during the normalization process. It is an error to specify an API
        +   * interface here which cannot be resolved against the associated IDL files.
            * 
        * * repeated .google.protobuf.Api apis = 3; */ int getApisCount(); + /** * * *
            * A list of API interfaces exported by this service. Only the `name` field
        -   * of the [google.protobuf.Api][google.protobuf.Api] needs to be provided by the configuration
        -   * author, as the remaining fields will be derived from the IDL during the
        -   * normalization process. It is an error to specify an API interface here
        -   * which cannot be resolved against the associated IDL files.
        +   * of the [google.protobuf.Api][google.protobuf.Api] needs to be provided by
        +   * the configuration author, as the remaining fields will be derived from the
        +   * IDL during the normalization process. It is an error to specify an API
        +   * interface here which cannot be resolved against the associated IDL files.
            * 
        * * repeated .google.protobuf.Api apis = 3; */ java.util.List getApisOrBuilderList(); + /** * * *
            * A list of API interfaces exported by this service. Only the `name` field
        -   * of the [google.protobuf.Api][google.protobuf.Api] needs to be provided by the configuration
        -   * author, as the remaining fields will be derived from the IDL during the
        -   * normalization process. It is an error to specify an API interface here
        -   * which cannot be resolved against the associated IDL files.
        +   * of the [google.protobuf.Api][google.protobuf.Api] needs to be provided by
        +   * the configuration author, as the remaining fields will be derived from the
        +   * IDL during the normalization process. It is an error to specify an API
        +   * interface here which cannot be resolved against the associated IDL files.
            * 
        * * repeated .google.protobuf.Api apis = 3; @@ -217,13 +228,15 @@ public interface ServiceOrBuilder * included. Messages which are not referenced but shall be included, such as * types used by the `google.protobuf.Any` type, should be listed here by * name by the configuration author. Example: - * types: - * - name: google.protobuf.Int32 + * + * types: + * - name: google.protobuf.Int32 * * * repeated .google.protobuf.Type types = 4; */ java.util.List getTypesList(); + /** * * @@ -233,13 +246,15 @@ public interface ServiceOrBuilder * included. Messages which are not referenced but shall be included, such as * types used by the `google.protobuf.Any` type, should be listed here by * name by the configuration author. Example: - * types: - * - name: google.protobuf.Int32 + * + * types: + * - name: google.protobuf.Int32 * * * repeated .google.protobuf.Type types = 4; */ com.google.protobuf.Type getTypes(int index); + /** * * @@ -249,13 +264,15 @@ public interface ServiceOrBuilder * included. Messages which are not referenced but shall be included, such as * types used by the `google.protobuf.Any` type, should be listed here by * name by the configuration author. Example: - * types: - * - name: google.protobuf.Int32 + * + * types: + * - name: google.protobuf.Int32 * * * repeated .google.protobuf.Type types = 4; */ int getTypesCount(); + /** * * @@ -265,13 +282,15 @@ public interface ServiceOrBuilder * included. Messages which are not referenced but shall be included, such as * types used by the `google.protobuf.Any` type, should be listed here by * name by the configuration author. Example: - * types: - * - name: google.protobuf.Int32 + * + * types: + * - name: google.protobuf.Int32 * * * repeated .google.protobuf.Type types = 4; */ java.util.List getTypesOrBuilderList(); + /** * * @@ -281,8 +300,9 @@ public interface ServiceOrBuilder * included. Messages which are not referenced but shall be included, such as * types used by the `google.protobuf.Any` type, should be listed here by * name by the configuration author. Example: - * types: - * - name: google.protobuf.Int32 + * + * types: + * - name: google.protobuf.Int32 * * * repeated .google.protobuf.Type types = 4; @@ -297,13 +317,15 @@ public interface ServiceOrBuilder * directly or indirectly by the `apis` are automatically included. Enums * which are not referenced but shall be included should be listed here by * name by the configuration author. Example: - * enums: - * - name: google.someapi.v1.SomeEnum + * + * enums: + * - name: google.someapi.v1.SomeEnum * * * repeated .google.protobuf.Enum enums = 5; */ java.util.List getEnumsList(); + /** * * @@ -312,13 +334,15 @@ public interface ServiceOrBuilder * directly or indirectly by the `apis` are automatically included. Enums * which are not referenced but shall be included should be listed here by * name by the configuration author. Example: - * enums: - * - name: google.someapi.v1.SomeEnum + * + * enums: + * - name: google.someapi.v1.SomeEnum * * * repeated .google.protobuf.Enum enums = 5; */ com.google.protobuf.Enum getEnums(int index); + /** * * @@ -327,13 +351,15 @@ public interface ServiceOrBuilder * directly or indirectly by the `apis` are automatically included. Enums * which are not referenced but shall be included should be listed here by * name by the configuration author. Example: - * enums: - * - name: google.someapi.v1.SomeEnum + * + * enums: + * - name: google.someapi.v1.SomeEnum * * * repeated .google.protobuf.Enum enums = 5; */ int getEnumsCount(); + /** * * @@ -342,13 +368,15 @@ public interface ServiceOrBuilder * directly or indirectly by the `apis` are automatically included. Enums * which are not referenced but shall be included should be listed here by * name by the configuration author. Example: - * enums: - * - name: google.someapi.v1.SomeEnum + * + * enums: + * - name: google.someapi.v1.SomeEnum * * * repeated .google.protobuf.Enum enums = 5; */ java.util.List getEnumsOrBuilderList(); + /** * * @@ -357,8 +385,9 @@ public interface ServiceOrBuilder * directly or indirectly by the `apis` are automatically included. Enums * which are not referenced but shall be included should be listed here by * name by the configuration author. Example: - * enums: - * - name: google.someapi.v1.SomeEnum + * + * enums: + * - name: google.someapi.v1.SomeEnum * * * repeated .google.protobuf.Enum enums = 5; @@ -377,6 +406,7 @@ public interface ServiceOrBuilder * @return Whether the documentation field is set. */ boolean hasDocumentation(); + /** * * @@ -389,6 +419,7 @@ public interface ServiceOrBuilder * @return The documentation. */ com.google.api.Documentation getDocumentation(); + /** * * @@ -412,6 +443,7 @@ public interface ServiceOrBuilder * @return Whether the backend field is set. */ boolean hasBackend(); + /** * * @@ -424,6 +456,7 @@ public interface ServiceOrBuilder * @return The backend. */ com.google.api.Backend getBackend(); + /** * * @@ -447,6 +480,7 @@ public interface ServiceOrBuilder * @return Whether the http field is set. */ boolean hasHttp(); + /** * * @@ -459,6 +493,7 @@ public interface ServiceOrBuilder * @return The http. */ com.google.api.Http getHttp(); + /** * * @@ -482,6 +517,7 @@ public interface ServiceOrBuilder * @return Whether the quota field is set. */ boolean hasQuota(); + /** * * @@ -494,6 +530,7 @@ public interface ServiceOrBuilder * @return The quota. */ com.google.api.Quota getQuota(); + /** * * @@ -517,6 +554,7 @@ public interface ServiceOrBuilder * @return Whether the authentication field is set. */ boolean hasAuthentication(); + /** * * @@ -529,6 +567,7 @@ public interface ServiceOrBuilder * @return The authentication. */ com.google.api.Authentication getAuthentication(); + /** * * @@ -552,6 +591,7 @@ public interface ServiceOrBuilder * @return Whether the context field is set. */ boolean hasContext(); + /** * * @@ -564,6 +604,7 @@ public interface ServiceOrBuilder * @return The context. */ com.google.api.Context getContext(); + /** * * @@ -587,6 +628,7 @@ public interface ServiceOrBuilder * @return Whether the usage field is set. */ boolean hasUsage(); + /** * * @@ -599,6 +641,7 @@ public interface ServiceOrBuilder * @return The usage. */ com.google.api.Usage getUsage(); + /** * * @@ -622,6 +665,7 @@ public interface ServiceOrBuilder * repeated .google.api.Endpoint endpoints = 18; */ java.util.List getEndpointsList(); + /** * * @@ -634,6 +678,7 @@ public interface ServiceOrBuilder * repeated .google.api.Endpoint endpoints = 18; */ com.google.api.Endpoint getEndpoints(int index); + /** * * @@ -646,6 +691,7 @@ public interface ServiceOrBuilder * repeated .google.api.Endpoint endpoints = 18; */ int getEndpointsCount(); + /** * * @@ -658,6 +704,7 @@ public interface ServiceOrBuilder * repeated .google.api.Endpoint endpoints = 18; */ java.util.List getEndpointsOrBuilderList(); + /** * * @@ -683,6 +730,7 @@ public interface ServiceOrBuilder * @return Whether the control field is set. */ boolean hasControl(); + /** * * @@ -695,6 +743,7 @@ public interface ServiceOrBuilder * @return The control. */ com.google.api.Control getControl(); + /** * * @@ -716,6 +765,7 @@ public interface ServiceOrBuilder * repeated .google.api.LogDescriptor logs = 23; */ java.util.List getLogsList(); + /** * * @@ -726,6 +776,7 @@ public interface ServiceOrBuilder * repeated .google.api.LogDescriptor logs = 23; */ com.google.api.LogDescriptor getLogs(int index); + /** * * @@ -736,6 +787,7 @@ public interface ServiceOrBuilder * repeated .google.api.LogDescriptor logs = 23; */ int getLogsCount(); + /** * * @@ -746,6 +798,7 @@ public interface ServiceOrBuilder * repeated .google.api.LogDescriptor logs = 23; */ java.util.List getLogsOrBuilderList(); + /** * * @@ -767,6 +820,7 @@ public interface ServiceOrBuilder * repeated .google.api.MetricDescriptor metrics = 24; */ java.util.List getMetricsList(); + /** * * @@ -777,6 +831,7 @@ public interface ServiceOrBuilder * repeated .google.api.MetricDescriptor metrics = 24; */ com.google.api.MetricDescriptor getMetrics(int index); + /** * * @@ -787,6 +842,7 @@ public interface ServiceOrBuilder * repeated .google.api.MetricDescriptor metrics = 24; */ int getMetricsCount(); + /** * * @@ -797,6 +853,7 @@ public interface ServiceOrBuilder * repeated .google.api.MetricDescriptor metrics = 24; */ java.util.List getMetricsOrBuilderList(); + /** * * @@ -813,52 +870,61 @@ public interface ServiceOrBuilder * *
            * Defines the monitored resources used by this service. This is required
        -   * by the [Service.monitoring][google.api.Service.monitoring] and [Service.logging][google.api.Service.logging] configurations.
        +   * by the [Service.monitoring][google.api.Service.monitoring] and
        +   * [Service.logging][google.api.Service.logging] configurations.
            * 
        * * repeated .google.api.MonitoredResourceDescriptor monitored_resources = 25; */ java.util.List getMonitoredResourcesList(); + /** * * *
            * Defines the monitored resources used by this service. This is required
        -   * by the [Service.monitoring][google.api.Service.monitoring] and [Service.logging][google.api.Service.logging] configurations.
        +   * by the [Service.monitoring][google.api.Service.monitoring] and
        +   * [Service.logging][google.api.Service.logging] configurations.
            * 
        * * repeated .google.api.MonitoredResourceDescriptor monitored_resources = 25; */ com.google.api.MonitoredResourceDescriptor getMonitoredResources(int index); + /** * * *
            * Defines the monitored resources used by this service. This is required
        -   * by the [Service.monitoring][google.api.Service.monitoring] and [Service.logging][google.api.Service.logging] configurations.
        +   * by the [Service.monitoring][google.api.Service.monitoring] and
        +   * [Service.logging][google.api.Service.logging] configurations.
            * 
        * * repeated .google.api.MonitoredResourceDescriptor monitored_resources = 25; */ int getMonitoredResourcesCount(); + /** * * *
            * Defines the monitored resources used by this service. This is required
        -   * by the [Service.monitoring][google.api.Service.monitoring] and [Service.logging][google.api.Service.logging] configurations.
        +   * by the [Service.monitoring][google.api.Service.monitoring] and
        +   * [Service.logging][google.api.Service.logging] configurations.
            * 
        * * repeated .google.api.MonitoredResourceDescriptor monitored_resources = 25; */ java.util.List getMonitoredResourcesOrBuilderList(); + /** * * *
            * Defines the monitored resources used by this service. This is required
        -   * by the [Service.monitoring][google.api.Service.monitoring] and [Service.logging][google.api.Service.logging] configurations.
        +   * by the [Service.monitoring][google.api.Service.monitoring] and
        +   * [Service.logging][google.api.Service.logging] configurations.
            * 
        * * repeated .google.api.MonitoredResourceDescriptor monitored_resources = 25; @@ -877,6 +943,7 @@ public interface ServiceOrBuilder * @return Whether the billing field is set. */ boolean hasBilling(); + /** * * @@ -889,6 +956,7 @@ public interface ServiceOrBuilder * @return The billing. */ com.google.api.Billing getBilling(); + /** * * @@ -912,6 +980,7 @@ public interface ServiceOrBuilder * @return Whether the logging field is set. */ boolean hasLogging(); + /** * * @@ -924,6 +993,7 @@ public interface ServiceOrBuilder * @return The logging. */ com.google.api.Logging getLogging(); + /** * * @@ -947,6 +1017,7 @@ public interface ServiceOrBuilder * @return Whether the monitoring field is set. */ boolean hasMonitoring(); + /** * * @@ -959,6 +1030,7 @@ public interface ServiceOrBuilder * @return The monitoring. */ com.google.api.Monitoring getMonitoring(); + /** * * @@ -982,6 +1054,7 @@ public interface ServiceOrBuilder * @return Whether the systemParameters field is set. */ boolean hasSystemParameters(); + /** * * @@ -994,6 +1067,7 @@ public interface ServiceOrBuilder * @return The systemParameters. */ com.google.api.SystemParameters getSystemParameters(); + /** * * @@ -1017,6 +1091,7 @@ public interface ServiceOrBuilder * @return Whether the sourceInfo field is set. */ boolean hasSourceInfo(); + /** * * @@ -1029,6 +1104,7 @@ public interface ServiceOrBuilder * @return The sourceInfo. */ com.google.api.SourceInfo getSourceInfo(); + /** * * @@ -1054,6 +1130,7 @@ public interface ServiceOrBuilder * @return Whether the publishing field is set. */ boolean hasPublishing(); + /** * * @@ -1068,6 +1145,7 @@ public interface ServiceOrBuilder * @return The publishing. */ com.google.api.Publishing getPublishing(); + /** * * @@ -1086,6 +1164,7 @@ public interface ServiceOrBuilder * *
            * Obsolete. Do not use.
        +   *
            * This field has no semantic meaning. The service config compiler always
            * sets this field to `3`.
            * 
        @@ -1095,11 +1174,13 @@ public interface ServiceOrBuilder * @return Whether the configVersion field is set. */ boolean hasConfigVersion(); + /** * * *
            * Obsolete. Do not use.
        +   *
            * This field has no semantic meaning. The service config compiler always
            * sets this field to `3`.
            * 
        @@ -1109,11 +1190,13 @@ public interface ServiceOrBuilder * @return The configVersion. */ com.google.protobuf.UInt32Value getConfigVersion(); + /** * * *
            * Obsolete. Do not use.
        +   *
            * This field has no semantic meaning. The service config compiler always
            * sets this field to `3`.
            * 
        diff --git a/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/ServiceProto.java b/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/ServiceProto.java index 1f5f57d815..929722248d 100644 --- a/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/ServiceProto.java +++ b/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/ServiceProto.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,13 +14,26 @@ * limitations under the License. */ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: google/api/service.proto +// Protobuf Java Version: 4.33.2 package com.google.api; -public final class ServiceProto { +@com.google.protobuf.Generated +public final class ServiceProto extends com.google.protobuf.GeneratedFile { private ServiceProto() {} + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "ServiceProto"); + } + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistryLite registry) {} public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry registry) { @@ -29,7 +42,7 @@ public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry r static final com.google.protobuf.Descriptors.Descriptor internal_static_google_api_Service_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable internal_static_google_api_Service_fieldAccessorTable; public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { @@ -111,9 +124,9 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { com.google.protobuf.TypeProto.getDescriptor(), com.google.protobuf.WrappersProto.getDescriptor(), }); - internal_static_google_api_Service_descriptor = getDescriptor().getMessageTypes().get(0); + internal_static_google_api_Service_descriptor = getDescriptor().getMessageType(0); internal_static_google_api_Service_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_google_api_Service_descriptor, new java.lang.String[] { "Name", @@ -143,6 +156,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "Publishing", "ConfigVersion", }); + descriptor.resolveAllFeaturesImmutable(); com.google.api.AuthProto.getDescriptor(); com.google.api.BackendProto.getDescriptor(); com.google.api.BillingProto.getDescriptor(); diff --git a/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/SourceInfo.java b/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/SourceInfo.java index a35ffe5eae..5b3988b4c4 100644 --- a/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/SourceInfo.java +++ b/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/SourceInfo.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,9 @@ * limitations under the License. */ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: google/api/source_info.proto +// Protobuf Java Version: 4.33.2 package com.google.api; @@ -27,13 +29,25 @@ * * Protobuf type {@code google.api.SourceInfo} */ -public final class SourceInfo extends com.google.protobuf.GeneratedMessageV3 +@com.google.protobuf.Generated +public final class SourceInfo extends com.google.protobuf.GeneratedMessage implements // @@protoc_insertion_point(message_implements:google.api.SourceInfo) SourceInfoOrBuilder { private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "SourceInfo"); + } + // Use SourceInfo.newBuilder() to construct. - private SourceInfo(com.google.protobuf.GeneratedMessageV3.Builder builder) { + private SourceInfo(com.google.protobuf.GeneratedMessage.Builder builder) { super(builder); } @@ -41,23 +55,12 @@ private SourceInfo() { sourceFiles_ = java.util.Collections.emptyList(); } - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new SourceInfo(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.api.SourceInfoProto.internal_static_google_api_SourceInfo_descriptor; } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.api.SourceInfoProto.internal_static_google_api_SourceInfo_fieldAccessorTable .ensureFieldAccessorsInitialized( @@ -65,7 +68,10 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } public static final int SOURCE_FILES_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") private java.util.List sourceFiles_; + /** * * @@ -79,6 +85,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { public java.util.List getSourceFilesList() { return sourceFiles_; } + /** * * @@ -92,6 +99,7 @@ public java.util.List getSourceFilesList() { public java.util.List getSourceFilesOrBuilderList() { return sourceFiles_; } + /** * * @@ -105,6 +113,7 @@ public java.util.List getSourceFiles public int getSourceFilesCount() { return sourceFiles_.size(); } + /** * * @@ -118,6 +127,7 @@ public int getSourceFilesCount() { public com.google.protobuf.Any getSourceFiles(int index) { return sourceFiles_.get(index); } + /** * * @@ -233,38 +243,38 @@ public static com.google.api.SourceInfo parseFrom( public static com.google.api.SourceInfo parseFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); } public static com.google.api.SourceInfo parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } public static com.google.api.SourceInfo parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); } public static com.google.api.SourceInfo parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( PARSER, input, extensionRegistry); } public static com.google.api.SourceInfo parseFrom(com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); } public static com.google.api.SourceInfo parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } @@ -287,10 +297,11 @@ public Builder toBuilder() { } @java.lang.Override - protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { Builder builder = new Builder(parent); return builder; } + /** * * @@ -300,7 +311,7 @@ protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.Build * * Protobuf type {@code google.api.SourceInfo} */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder implements // @@protoc_insertion_point(builder_implements:google.api.SourceInfo) com.google.api.SourceInfoOrBuilder { @@ -309,7 +320,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.api.SourceInfoProto.internal_static_google_api_SourceInfo_fieldAccessorTable .ensureFieldAccessorsInitialized( @@ -319,13 +330,14 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { // Construct using com.google.api.SourceInfo.newBuilder() private Builder() {} - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { super(parent); } @java.lang.Override public Builder clear() { super.clear(); + bitField0_ = 0; if (sourceFilesBuilder_ == null) { sourceFiles_ = java.util.Collections.emptyList(); } else { @@ -358,7 +370,15 @@ public com.google.api.SourceInfo build() { @java.lang.Override public com.google.api.SourceInfo buildPartial() { com.google.api.SourceInfo result = new com.google.api.SourceInfo(this); - int from_bitField0_ = bitField0_; + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields(com.google.api.SourceInfo result) { if (sourceFilesBuilder_ == null) { if (((bitField0_ & 0x00000001) != 0)) { sourceFiles_ = java.util.Collections.unmodifiableList(sourceFiles_); @@ -368,41 +388,10 @@ public com.google.api.SourceInfo buildPartial() { } else { result.sourceFiles_ = sourceFilesBuilder_.build(); } - onBuilt(); - return result; } - @java.lang.Override - public Builder clone() { - return super.clone(); - } - - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.setField(field, value); - } - - @java.lang.Override - public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - - @java.lang.Override - public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.addRepeatedField(field, value); + private void buildPartial0(com.google.api.SourceInfo result) { + int from_bitField0_ = bitField0_; } @java.lang.Override @@ -436,8 +425,8 @@ public Builder mergeFrom(com.google.api.SourceInfo other) { sourceFiles_ = other.sourceFiles_; bitField0_ = (bitField0_ & ~0x00000001); sourceFilesBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders - ? getSourceFilesFieldBuilder() + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders + ? internalGetSourceFilesFieldBuilder() : null; } else { sourceFilesBuilder_.addAllMessages(other.sourceFiles_); @@ -511,7 +500,7 @@ private void ensureSourceFilesIsMutable() { } } - private com.google.protobuf.RepeatedFieldBuilderV3< + private com.google.protobuf.RepeatedFieldBuilder< com.google.protobuf.Any, com.google.protobuf.Any.Builder, com.google.protobuf.AnyOrBuilder> @@ -533,6 +522,7 @@ public java.util.List getSourceFilesList() { return sourceFilesBuilder_.getMessageList(); } } + /** * * @@ -549,6 +539,7 @@ public int getSourceFilesCount() { return sourceFilesBuilder_.getCount(); } } + /** * * @@ -565,6 +556,7 @@ public com.google.protobuf.Any getSourceFiles(int index) { return sourceFilesBuilder_.getMessage(index); } } + /** * * @@ -587,6 +579,7 @@ public Builder setSourceFiles(int index, com.google.protobuf.Any value) { } return this; } + /** * * @@ -606,6 +599,7 @@ public Builder setSourceFiles(int index, com.google.protobuf.Any.Builder builder } return this; } + /** * * @@ -628,6 +622,7 @@ public Builder addSourceFiles(com.google.protobuf.Any value) { } return this; } + /** * * @@ -650,6 +645,7 @@ public Builder addSourceFiles(int index, com.google.protobuf.Any value) { } return this; } + /** * * @@ -669,6 +665,7 @@ public Builder addSourceFiles(com.google.protobuf.Any.Builder builderForValue) { } return this; } + /** * * @@ -688,6 +685,7 @@ public Builder addSourceFiles(int index, com.google.protobuf.Any.Builder builder } return this; } + /** * * @@ -707,6 +705,7 @@ public Builder addAllSourceFiles(java.lang.Iterablerepeated .google.protobuf.Any source_files = 1; */ public com.google.protobuf.Any.Builder getSourceFilesBuilder(int index) { - return getSourceFilesFieldBuilder().getBuilder(index); + return internalGetSourceFilesFieldBuilder().getBuilder(index); } + /** * * @@ -773,6 +775,7 @@ public com.google.protobuf.AnyOrBuilder getSourceFilesOrBuilder(int index) { return sourceFilesBuilder_.getMessageOrBuilder(index); } } + /** * * @@ -790,6 +793,7 @@ public com.google.protobuf.AnyOrBuilder getSourceFilesOrBuilder(int index) { return java.util.Collections.unmodifiableList(sourceFiles_); } } + /** * * @@ -800,8 +804,10 @@ public com.google.protobuf.AnyOrBuilder getSourceFilesOrBuilder(int index) { * repeated .google.protobuf.Any source_files = 1; */ public com.google.protobuf.Any.Builder addSourceFilesBuilder() { - return getSourceFilesFieldBuilder().addBuilder(com.google.protobuf.Any.getDefaultInstance()); + return internalGetSourceFilesFieldBuilder() + .addBuilder(com.google.protobuf.Any.getDefaultInstance()); } + /** * * @@ -812,9 +818,10 @@ public com.google.protobuf.Any.Builder addSourceFilesBuilder() { * repeated .google.protobuf.Any source_files = 1; */ public com.google.protobuf.Any.Builder addSourceFilesBuilder(int index) { - return getSourceFilesFieldBuilder() + return internalGetSourceFilesFieldBuilder() .addBuilder(index, com.google.protobuf.Any.getDefaultInstance()); } + /** * * @@ -825,17 +832,17 @@ public com.google.protobuf.Any.Builder addSourceFilesBuilder(int index) { * repeated .google.protobuf.Any source_files = 1; */ public java.util.List getSourceFilesBuilderList() { - return getSourceFilesFieldBuilder().getBuilderList(); + return internalGetSourceFilesFieldBuilder().getBuilderList(); } - private com.google.protobuf.RepeatedFieldBuilderV3< + private com.google.protobuf.RepeatedFieldBuilder< com.google.protobuf.Any, com.google.protobuf.Any.Builder, com.google.protobuf.AnyOrBuilder> - getSourceFilesFieldBuilder() { + internalGetSourceFilesFieldBuilder() { if (sourceFilesBuilder_ == null) { sourceFilesBuilder_ = - new com.google.protobuf.RepeatedFieldBuilderV3< + new com.google.protobuf.RepeatedFieldBuilder< com.google.protobuf.Any, com.google.protobuf.Any.Builder, com.google.protobuf.AnyOrBuilder>( @@ -845,17 +852,6 @@ public java.util.List getSourceFilesBuilderList return sourceFilesBuilder_; } - @java.lang.Override - public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - // @@protoc_insertion_point(builder_scope:google.api.SourceInfo) } diff --git a/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/SourceInfoOrBuilder.java b/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/SourceInfoOrBuilder.java index 48ca89ddb8..c996269e2b 100644 --- a/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/SourceInfoOrBuilder.java +++ b/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/SourceInfoOrBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,10 +14,13 @@ * limitations under the License. */ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: google/api/source_info.proto +// Protobuf Java Version: 4.33.2 package com.google.api; +@com.google.protobuf.Generated public interface SourceInfoOrBuilder extends // @@protoc_insertion_point(interface_extends:google.api.SourceInfo) @@ -33,6 +36,7 @@ public interface SourceInfoOrBuilder * repeated .google.protobuf.Any source_files = 1; */ java.util.List getSourceFilesList(); + /** * * @@ -43,6 +47,7 @@ public interface SourceInfoOrBuilder * repeated .google.protobuf.Any source_files = 1; */ com.google.protobuf.Any getSourceFiles(int index); + /** * * @@ -53,6 +58,7 @@ public interface SourceInfoOrBuilder * repeated .google.protobuf.Any source_files = 1; */ int getSourceFilesCount(); + /** * * @@ -63,6 +69,7 @@ public interface SourceInfoOrBuilder * repeated .google.protobuf.Any source_files = 1; */ java.util.List getSourceFilesOrBuilderList(); + /** * * diff --git a/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/SourceInfoProto.java b/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/SourceInfoProto.java index 7c1b540d5b..27fb1b16f5 100644 --- a/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/SourceInfoProto.java +++ b/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/SourceInfoProto.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,13 +14,26 @@ * limitations under the License. */ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: google/api/source_info.proto +// Protobuf Java Version: 4.33.2 package com.google.api; -public final class SourceInfoProto { +@com.google.protobuf.Generated +public final class SourceInfoProto extends com.google.protobuf.GeneratedFile { private SourceInfoProto() {} + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "SourceInfoProto"); + } + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistryLite registry) {} public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry registry) { @@ -29,7 +42,7 @@ public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry r static final com.google.protobuf.Descriptors.Descriptor internal_static_google_api_SourceInfo_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable internal_static_google_api_SourceInfo_fieldAccessorTable; public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { @@ -54,13 +67,14 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { new com.google.protobuf.Descriptors.FileDescriptor[] { com.google.protobuf.AnyProto.getDescriptor(), }); - internal_static_google_api_SourceInfo_descriptor = getDescriptor().getMessageTypes().get(0); + internal_static_google_api_SourceInfo_descriptor = getDescriptor().getMessageType(0); internal_static_google_api_SourceInfo_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_google_api_SourceInfo_descriptor, new java.lang.String[] { "SourceFiles", }); + descriptor.resolveAllFeaturesImmutable(); com.google.protobuf.AnyProto.getDescriptor(); } diff --git a/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/SystemParameter.java b/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/SystemParameter.java index 2fe9e527a1..454f491918 100644 --- a/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/SystemParameter.java +++ b/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/SystemParameter.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,9 @@ * limitations under the License. */ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: google/api/system_parameter.proto +// Protobuf Java Version: 4.33.2 package com.google.api; @@ -29,13 +31,25 @@ * * Protobuf type {@code google.api.SystemParameter} */ -public final class SystemParameter extends com.google.protobuf.GeneratedMessageV3 +@com.google.protobuf.Generated +public final class SystemParameter extends com.google.protobuf.GeneratedMessage implements // @@protoc_insertion_point(message_implements:google.api.SystemParameter) SystemParameterOrBuilder { private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "SystemParameter"); + } + // Use SystemParameter.newBuilder() to construct. - private SystemParameter(com.google.protobuf.GeneratedMessageV3.Builder builder) { + private SystemParameter(com.google.protobuf.GeneratedMessage.Builder builder) { super(builder); } @@ -45,24 +59,13 @@ private SystemParameter() { urlQueryParameter_ = ""; } - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new SystemParameter(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.api.SystemParameterProto .internal_static_google_api_SystemParameter_descriptor; } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.api.SystemParameterProto .internal_static_google_api_SystemParameter_fieldAccessorTable @@ -71,7 +74,10 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } public static final int NAME_FIELD_NUMBER = 1; - private volatile java.lang.Object name_; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** * * @@ -95,6 +101,7 @@ public java.lang.String getName() { return s; } } + /** * * @@ -120,7 +127,10 @@ public com.google.protobuf.ByteString getNameBytes() { } public static final int HTTP_HEADER_FIELD_NUMBER = 2; - private volatile java.lang.Object httpHeader_; + + @SuppressWarnings("serial") + private volatile java.lang.Object httpHeader_ = ""; + /** * * @@ -145,6 +155,7 @@ public java.lang.String getHttpHeader() { return s; } } + /** * * @@ -171,7 +182,10 @@ public com.google.protobuf.ByteString getHttpHeaderBytes() { } public static final int URL_QUERY_PARAMETER_FIELD_NUMBER = 3; - private volatile java.lang.Object urlQueryParameter_; + + @SuppressWarnings("serial") + private volatile java.lang.Object urlQueryParameter_ = ""; + /** * * @@ -196,6 +210,7 @@ public java.lang.String getUrlQueryParameter() { return s; } } + /** * * @@ -235,14 +250,14 @@ public final boolean isInitialized() { @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.GeneratedMessage.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, name_); } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(httpHeader_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 2, httpHeader_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(httpHeader_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, httpHeader_); } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(urlQueryParameter_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 3, urlQueryParameter_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(urlQueryParameter_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 3, urlQueryParameter_); } getUnknownFields().writeTo(output); } @@ -253,14 +268,14 @@ public int getSerializedSize() { 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.GeneratedMessage.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, name_); } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(httpHeader_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, httpHeader_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(httpHeader_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, httpHeader_); } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(urlQueryParameter_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, urlQueryParameter_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(urlQueryParameter_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(3, urlQueryParameter_); } size += getUnknownFields().getSerializedSize(); memoizedSize = size; @@ -338,38 +353,38 @@ public static com.google.api.SystemParameter parseFrom( public static com.google.api.SystemParameter parseFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); } public static com.google.api.SystemParameter parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } public static com.google.api.SystemParameter parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); } public static com.google.api.SystemParameter parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( PARSER, input, extensionRegistry); } public static com.google.api.SystemParameter parseFrom(com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); } public static com.google.api.SystemParameter parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } @@ -392,10 +407,11 @@ public Builder toBuilder() { } @java.lang.Override - protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { Builder builder = new Builder(parent); return builder; } + /** * * @@ -407,7 +423,7 @@ protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.Build * * Protobuf type {@code google.api.SystemParameter} */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder implements // @@protoc_insertion_point(builder_implements:google.api.SystemParameter) com.google.api.SystemParameterOrBuilder { @@ -417,7 +433,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.api.SystemParameterProto .internal_static_google_api_SystemParameter_fieldAccessorTable @@ -428,19 +444,17 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { // Construct using com.google.api.SystemParameter.newBuilder() private Builder() {} - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { super(parent); } @java.lang.Override public Builder clear() { super.clear(); + bitField0_ = 0; name_ = ""; - httpHeader_ = ""; - urlQueryParameter_ = ""; - return this; } @@ -467,44 +481,24 @@ public com.google.api.SystemParameter build() { @java.lang.Override public com.google.api.SystemParameter buildPartial() { com.google.api.SystemParameter result = new com.google.api.SystemParameter(this); - result.name_ = name_; - result.httpHeader_ = httpHeader_; - result.urlQueryParameter_ = urlQueryParameter_; + if (bitField0_ != 0) { + buildPartial0(result); + } 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); + private void buildPartial0(com.google.api.SystemParameter result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.httpHeader_ = httpHeader_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.urlQueryParameter_ = urlQueryParameter_; + } } @java.lang.Override @@ -521,14 +515,17 @@ public Builder mergeFrom(com.google.api.SystemParameter other) { if (other == com.google.api.SystemParameter.getDefaultInstance()) return this; if (!other.getName().isEmpty()) { name_ = other.name_; + bitField0_ |= 0x00000001; onChanged(); } if (!other.getHttpHeader().isEmpty()) { httpHeader_ = other.httpHeader_; + bitField0_ |= 0x00000002; onChanged(); } if (!other.getUrlQueryParameter().isEmpty()) { urlQueryParameter_ = other.urlQueryParameter_; + bitField0_ |= 0x00000004; onChanged(); } this.mergeUnknownFields(other.getUnknownFields()); @@ -560,19 +557,19 @@ public Builder mergeFrom( case 10: { name_ = input.readStringRequireUtf8(); - + bitField0_ |= 0x00000001; break; } // case 10 case 18: { httpHeader_ = input.readStringRequireUtf8(); - + bitField0_ |= 0x00000002; break; } // case 18 case 26: { urlQueryParameter_ = input.readStringRequireUtf8(); - + bitField0_ |= 0x00000004; break; } // case 26 default: @@ -592,7 +589,10 @@ public Builder mergeFrom( return this; } + private int bitField0_; + private java.lang.Object name_ = ""; + /** * * @@ -615,6 +615,7 @@ public java.lang.String getName() { return (java.lang.String) ref; } } + /** * * @@ -637,6 +638,7 @@ public com.google.protobuf.ByteString getNameBytes() { return (com.google.protobuf.ByteString) ref; } } + /** * * @@ -653,11 +655,12 @@ public Builder setName(java.lang.String value) { if (value == null) { throw new NullPointerException(); } - name_ = value; + bitField0_ |= 0x00000001; onChanged(); return this; } + /** * * @@ -670,11 +673,12 @@ public Builder setName(java.lang.String value) { * @return This builder for chaining. */ public Builder clearName() { - name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); onChanged(); return this; } + /** * * @@ -692,13 +696,14 @@ public Builder setNameBytes(com.google.protobuf.ByteString value) { throw new NullPointerException(); } checkByteStringIsUtf8(value); - name_ = value; + bitField0_ |= 0x00000001; onChanged(); return this; } private java.lang.Object httpHeader_ = ""; + /** * * @@ -722,6 +727,7 @@ public java.lang.String getHttpHeader() { return (java.lang.String) ref; } } + /** * * @@ -745,6 +751,7 @@ public com.google.protobuf.ByteString getHttpHeaderBytes() { return (com.google.protobuf.ByteString) ref; } } + /** * * @@ -762,11 +769,12 @@ public Builder setHttpHeader(java.lang.String value) { if (value == null) { throw new NullPointerException(); } - httpHeader_ = value; + bitField0_ |= 0x00000002; onChanged(); return this; } + /** * * @@ -780,11 +788,12 @@ public Builder setHttpHeader(java.lang.String value) { * @return This builder for chaining. */ public Builder clearHttpHeader() { - httpHeader_ = getDefaultInstance().getHttpHeader(); + bitField0_ = (bitField0_ & ~0x00000002); onChanged(); return this; } + /** * * @@ -803,13 +812,14 @@ public Builder setHttpHeaderBytes(com.google.protobuf.ByteString value) { throw new NullPointerException(); } checkByteStringIsUtf8(value); - httpHeader_ = value; + bitField0_ |= 0x00000002; onChanged(); return this; } private java.lang.Object urlQueryParameter_ = ""; + /** * * @@ -833,6 +843,7 @@ public java.lang.String getUrlQueryParameter() { return (java.lang.String) ref; } } + /** * * @@ -856,6 +867,7 @@ public com.google.protobuf.ByteString getUrlQueryParameterBytes() { return (com.google.protobuf.ByteString) ref; } } + /** * * @@ -873,11 +885,12 @@ public Builder setUrlQueryParameter(java.lang.String value) { if (value == null) { throw new NullPointerException(); } - urlQueryParameter_ = value; + bitField0_ |= 0x00000004; onChanged(); return this; } + /** * * @@ -891,11 +904,12 @@ public Builder setUrlQueryParameter(java.lang.String value) { * @return This builder for chaining. */ public Builder clearUrlQueryParameter() { - urlQueryParameter_ = getDefaultInstance().getUrlQueryParameter(); + bitField0_ = (bitField0_ & ~0x00000004); onChanged(); return this; } + /** * * @@ -914,23 +928,12 @@ public Builder setUrlQueryParameterBytes(com.google.protobuf.ByteString value) { throw new NullPointerException(); } checkByteStringIsUtf8(value); - urlQueryParameter_ = 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.api.SystemParameter) } diff --git a/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/SystemParameterOrBuilder.java b/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/SystemParameterOrBuilder.java index 6460d9734e..71888e355f 100644 --- a/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/SystemParameterOrBuilder.java +++ b/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/SystemParameterOrBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,10 +14,13 @@ * limitations under the License. */ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: google/api/system_parameter.proto +// Protobuf Java Version: 4.33.2 package com.google.api; +@com.google.protobuf.Generated public interface SystemParameterOrBuilder extends // @@protoc_insertion_point(interface_extends:google.api.SystemParameter) @@ -35,6 +38,7 @@ public interface SystemParameterOrBuilder * @return The name. */ java.lang.String getName(); + /** * * @@ -61,6 +65,7 @@ public interface SystemParameterOrBuilder * @return The httpHeader. */ java.lang.String getHttpHeader(); + /** * * @@ -88,6 +93,7 @@ public interface SystemParameterOrBuilder * @return The urlQueryParameter. */ java.lang.String getUrlQueryParameter(); + /** * * diff --git a/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/SystemParameterProto.java b/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/SystemParameterProto.java index 1d1b9c28ff..8582a8c3a3 100644 --- a/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/SystemParameterProto.java +++ b/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/SystemParameterProto.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,13 +14,26 @@ * limitations under the License. */ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: google/api/system_parameter.proto +// Protobuf Java Version: 4.33.2 package com.google.api; -public final class SystemParameterProto { +@com.google.protobuf.Generated +public final class SystemParameterProto extends com.google.protobuf.GeneratedFile { private SystemParameterProto() {} + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "SystemParameterProto"); + } + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistryLite registry) {} public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry registry) { @@ -29,15 +42,15 @@ public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry r static final com.google.protobuf.Descriptors.Descriptor internal_static_google_api_SystemParameters_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable internal_static_google_api_SystemParameters_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_google_api_SystemParameterRule_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable internal_static_google_api_SystemParameterRule_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_google_api_SystemParameter_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable internal_static_google_api_SystemParameter_fieldAccessorTable; public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { @@ -63,30 +76,28 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { descriptor = com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( descriptorData, new com.google.protobuf.Descriptors.FileDescriptor[] {}); - internal_static_google_api_SystemParameters_descriptor = - getDescriptor().getMessageTypes().get(0); + internal_static_google_api_SystemParameters_descriptor = getDescriptor().getMessageType(0); internal_static_google_api_SystemParameters_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_google_api_SystemParameters_descriptor, new java.lang.String[] { "Rules", }); - internal_static_google_api_SystemParameterRule_descriptor = - getDescriptor().getMessageTypes().get(1); + internal_static_google_api_SystemParameterRule_descriptor = getDescriptor().getMessageType(1); internal_static_google_api_SystemParameterRule_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_google_api_SystemParameterRule_descriptor, new java.lang.String[] { "Selector", "Parameters", }); - internal_static_google_api_SystemParameter_descriptor = - getDescriptor().getMessageTypes().get(2); + internal_static_google_api_SystemParameter_descriptor = getDescriptor().getMessageType(2); internal_static_google_api_SystemParameter_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_google_api_SystemParameter_descriptor, new java.lang.String[] { "Name", "HttpHeader", "UrlQueryParameter", }); + descriptor.resolveAllFeaturesImmutable(); } // @@protoc_insertion_point(outer_class_scope) diff --git a/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/SystemParameterRule.java b/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/SystemParameterRule.java index a51c856069..4dabf50c08 100644 --- a/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/SystemParameterRule.java +++ b/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/SystemParameterRule.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,9 @@ * limitations under the License. */ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: google/api/system_parameter.proto +// Protobuf Java Version: 4.33.2 package com.google.api; @@ -28,13 +30,25 @@ * * Protobuf type {@code google.api.SystemParameterRule} */ -public final class SystemParameterRule extends com.google.protobuf.GeneratedMessageV3 +@com.google.protobuf.Generated +public final class SystemParameterRule extends com.google.protobuf.GeneratedMessage implements // @@protoc_insertion_point(message_implements:google.api.SystemParameterRule) SystemParameterRuleOrBuilder { private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "SystemParameterRule"); + } + // Use SystemParameterRule.newBuilder() to construct. - private SystemParameterRule(com.google.protobuf.GeneratedMessageV3.Builder builder) { + private SystemParameterRule(com.google.protobuf.GeneratedMessage.Builder builder) { super(builder); } @@ -43,24 +57,13 @@ private SystemParameterRule() { parameters_ = java.util.Collections.emptyList(); } - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new SystemParameterRule(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.api.SystemParameterProto .internal_static_google_api_SystemParameterRule_descriptor; } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.api.SystemParameterProto .internal_static_google_api_SystemParameterRule_fieldAccessorTable @@ -70,14 +73,19 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } public static final int SELECTOR_FIELD_NUMBER = 1; - private volatile java.lang.Object selector_; + + @SuppressWarnings("serial") + private volatile java.lang.Object selector_ = ""; + /** * * *
            * Selects the methods to which this rule applies. Use '*' to indicate all
            * methods in all APIs.
        -   * Refer to [selector][google.api.DocumentationRule.selector] for syntax details.
        +   *
        +   * Refer to [selector][google.api.DocumentationRule.selector] for syntax
        +   * details.
            * 
        * * string selector = 1; @@ -96,13 +104,16 @@ public java.lang.String getSelector() { return s; } } + /** * * *
            * Selects the methods to which this rule applies. Use '*' to indicate all
            * methods in all APIs.
        -   * Refer to [selector][google.api.DocumentationRule.selector] for syntax details.
        +   *
        +   * Refer to [selector][google.api.DocumentationRule.selector] for syntax
        +   * details.
            * 
        * * string selector = 1; @@ -123,7 +134,10 @@ public com.google.protobuf.ByteString getSelectorBytes() { } public static final int PARAMETERS_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") private java.util.List parameters_; + /** * * @@ -141,6 +155,7 @@ public com.google.protobuf.ByteString getSelectorBytes() { public java.util.List getParametersList() { return parameters_; } + /** * * @@ -159,6 +174,7 @@ public java.util.List getParametersList() { getParametersOrBuilderList() { return parameters_; } + /** * * @@ -176,6 +192,7 @@ public java.util.List getParametersList() { public int getParametersCount() { return parameters_.size(); } + /** * * @@ -193,6 +210,7 @@ public int getParametersCount() { public com.google.api.SystemParameter getParameters(int index) { return parameters_.get(index); } + /** * * @@ -225,8 +243,8 @@ public final boolean isInitialized() { @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(selector_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, selector_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(selector_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, selector_); } for (int i = 0; i < parameters_.size(); i++) { output.writeMessage(2, parameters_.get(i)); @@ -240,8 +258,8 @@ public int getSerializedSize() { if (size != -1) return size; size = 0; - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(selector_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, selector_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(selector_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, selector_); } for (int i = 0; i < parameters_.size(); i++) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, parameters_.get(i)); @@ -321,38 +339,38 @@ public static com.google.api.SystemParameterRule parseFrom( public static com.google.api.SystemParameterRule parseFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); } public static com.google.api.SystemParameterRule parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } public static com.google.api.SystemParameterRule parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); } public static com.google.api.SystemParameterRule parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( PARSER, input, extensionRegistry); } public static com.google.api.SystemParameterRule parseFrom( com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); } public static com.google.api.SystemParameterRule parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } @@ -375,10 +393,11 @@ public Builder toBuilder() { } @java.lang.Override - protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { Builder builder = new Builder(parent); return builder; } + /** * * @@ -389,7 +408,7 @@ protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.Build * * Protobuf type {@code google.api.SystemParameterRule} */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder implements // @@protoc_insertion_point(builder_implements:google.api.SystemParameterRule) com.google.api.SystemParameterRuleOrBuilder { @@ -399,7 +418,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.api.SystemParameterProto .internal_static_google_api_SystemParameterRule_fieldAccessorTable @@ -411,22 +430,22 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { // Construct using com.google.api.SystemParameterRule.newBuilder() private Builder() {} - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { super(parent); } @java.lang.Override public Builder clear() { super.clear(); + bitField0_ = 0; selector_ = ""; - if (parametersBuilder_ == null) { parameters_ = java.util.Collections.emptyList(); } else { parameters_ = null; parametersBuilder_.clear(); } - bitField0_ = (bitField0_ & ~0x00000001); + bitField0_ = (bitField0_ & ~0x00000002); return this; } @@ -453,52 +472,31 @@ public com.google.api.SystemParameterRule build() { @java.lang.Override public com.google.api.SystemParameterRule buildPartial() { com.google.api.SystemParameterRule result = new com.google.api.SystemParameterRule(this); - int from_bitField0_ = bitField0_; - result.selector_ = selector_; + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields(com.google.api.SystemParameterRule result) { if (parametersBuilder_ == null) { - if (((bitField0_ & 0x00000001) != 0)) { + if (((bitField0_ & 0x00000002) != 0)) { parameters_ = java.util.Collections.unmodifiableList(parameters_); - bitField0_ = (bitField0_ & ~0x00000001); + bitField0_ = (bitField0_ & ~0x00000002); } result.parameters_ = parameters_; } else { result.parameters_ = parametersBuilder_.build(); } - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.setField(field, value); - } - - @java.lang.Override - public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - - @java.lang.Override - public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); } - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.addRepeatedField(field, value); + private void buildPartial0(com.google.api.SystemParameterRule result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.selector_ = selector_; + } } @java.lang.Override @@ -515,13 +513,14 @@ public Builder mergeFrom(com.google.api.SystemParameterRule other) { if (other == com.google.api.SystemParameterRule.getDefaultInstance()) return this; if (!other.getSelector().isEmpty()) { selector_ = other.selector_; + bitField0_ |= 0x00000001; onChanged(); } if (parametersBuilder_ == null) { if (!other.parameters_.isEmpty()) { if (parameters_.isEmpty()) { parameters_ = other.parameters_; - bitField0_ = (bitField0_ & ~0x00000001); + bitField0_ = (bitField0_ & ~0x00000002); } else { ensureParametersIsMutable(); parameters_.addAll(other.parameters_); @@ -534,10 +533,10 @@ public Builder mergeFrom(com.google.api.SystemParameterRule other) { parametersBuilder_.dispose(); parametersBuilder_ = null; parameters_ = other.parameters_; - bitField0_ = (bitField0_ & ~0x00000001); + bitField0_ = (bitField0_ & ~0x00000002); parametersBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders - ? getParametersFieldBuilder() + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders + ? internalGetParametersFieldBuilder() : null; } else { parametersBuilder_.addAllMessages(other.parameters_); @@ -573,7 +572,7 @@ public Builder mergeFrom( case 10: { selector_ = input.readStringRequireUtf8(); - + bitField0_ |= 0x00000001; break; } // case 10 case 18: @@ -608,13 +607,16 @@ public Builder mergeFrom( private int bitField0_; private java.lang.Object selector_ = ""; + /** * * *
              * Selects the methods to which this rule applies. Use '*' to indicate all
              * methods in all APIs.
        -     * Refer to [selector][google.api.DocumentationRule.selector] for syntax details.
        +     *
        +     * Refer to [selector][google.api.DocumentationRule.selector] for syntax
        +     * details.
              * 
        * * string selector = 1; @@ -632,13 +634,16 @@ public java.lang.String getSelector() { return (java.lang.String) ref; } } + /** * * *
              * Selects the methods to which this rule applies. Use '*' to indicate all
              * methods in all APIs.
        -     * Refer to [selector][google.api.DocumentationRule.selector] for syntax details.
        +     *
        +     * Refer to [selector][google.api.DocumentationRule.selector] for syntax
        +     * details.
              * 
        * * string selector = 1; @@ -656,13 +661,16 @@ public com.google.protobuf.ByteString getSelectorBytes() { return (com.google.protobuf.ByteString) ref; } } + /** * * *
              * Selects the methods to which this rule applies. Use '*' to indicate all
              * methods in all APIs.
        -     * Refer to [selector][google.api.DocumentationRule.selector] for syntax details.
        +     *
        +     * Refer to [selector][google.api.DocumentationRule.selector] for syntax
        +     * details.
              * 
        * * string selector = 1; @@ -674,18 +682,21 @@ public Builder setSelector(java.lang.String value) { if (value == null) { throw new NullPointerException(); } - selector_ = value; + bitField0_ |= 0x00000001; onChanged(); return this; } + /** * * *
              * Selects the methods to which this rule applies. Use '*' to indicate all
              * methods in all APIs.
        -     * Refer to [selector][google.api.DocumentationRule.selector] for syntax details.
        +     *
        +     * Refer to [selector][google.api.DocumentationRule.selector] for syntax
        +     * details.
              * 
        * * string selector = 1; @@ -693,18 +704,21 @@ public Builder setSelector(java.lang.String value) { * @return This builder for chaining. */ public Builder clearSelector() { - selector_ = getDefaultInstance().getSelector(); + bitField0_ = (bitField0_ & ~0x00000001); onChanged(); return this; } + /** * * *
              * Selects the methods to which this rule applies. Use '*' to indicate all
              * methods in all APIs.
        -     * Refer to [selector][google.api.DocumentationRule.selector] for syntax details.
        +     *
        +     * Refer to [selector][google.api.DocumentationRule.selector] for syntax
        +     * details.
              * 
        * * string selector = 1; @@ -717,8 +731,8 @@ public Builder setSelectorBytes(com.google.protobuf.ByteString value) { throw new NullPointerException(); } checkByteStringIsUtf8(value); - selector_ = value; + bitField0_ |= 0x00000001; onChanged(); return this; } @@ -727,13 +741,13 @@ public Builder setSelectorBytes(com.google.protobuf.ByteString value) { java.util.Collections.emptyList(); private void ensureParametersIsMutable() { - if (!((bitField0_ & 0x00000001) != 0)) { + if (!((bitField0_ & 0x00000002) != 0)) { parameters_ = new java.util.ArrayList(parameters_); - bitField0_ |= 0x00000001; + bitField0_ |= 0x00000002; } } - private com.google.protobuf.RepeatedFieldBuilderV3< + private com.google.protobuf.RepeatedFieldBuilder< com.google.api.SystemParameter, com.google.api.SystemParameter.Builder, com.google.api.SystemParameterOrBuilder> @@ -759,6 +773,7 @@ public java.util.List getParametersList() { return parametersBuilder_.getMessageList(); } } + /** * * @@ -779,6 +794,7 @@ public int getParametersCount() { return parametersBuilder_.getCount(); } } + /** * * @@ -799,6 +815,7 @@ public com.google.api.SystemParameter getParameters(int index) { return parametersBuilder_.getMessage(index); } } + /** * * @@ -825,6 +842,7 @@ public Builder setParameters(int index, com.google.api.SystemParameter value) { } return this; } + /** * * @@ -849,6 +867,7 @@ public Builder setParameters( } return this; } + /** * * @@ -875,6 +894,7 @@ public Builder addParameters(com.google.api.SystemParameter value) { } return this; } + /** * * @@ -901,6 +921,7 @@ public Builder addParameters(int index, com.google.api.SystemParameter value) { } return this; } + /** * * @@ -924,6 +945,7 @@ public Builder addParameters(com.google.api.SystemParameter.Builder builderForVa } return this; } + /** * * @@ -948,6 +970,7 @@ public Builder addParameters( } return this; } + /** * * @@ -972,6 +995,7 @@ public Builder addAllParameters( } return this; } + /** * * @@ -988,13 +1012,14 @@ public Builder addAllParameters( public Builder clearParameters() { if (parametersBuilder_ == null) { parameters_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); + bitField0_ = (bitField0_ & ~0x00000002); onChanged(); } else { parametersBuilder_.clear(); } return this; } + /** * * @@ -1018,6 +1043,7 @@ public Builder removeParameters(int index) { } return this; } + /** * * @@ -1032,8 +1058,9 @@ public Builder removeParameters(int index) { * repeated .google.api.SystemParameter parameters = 2; */ public com.google.api.SystemParameter.Builder getParametersBuilder(int index) { - return getParametersFieldBuilder().getBuilder(index); + return internalGetParametersFieldBuilder().getBuilder(index); } + /** * * @@ -1054,6 +1081,7 @@ public com.google.api.SystemParameterOrBuilder getParametersOrBuilder(int index) return parametersBuilder_.getMessageOrBuilder(index); } } + /** * * @@ -1075,6 +1103,7 @@ public com.google.api.SystemParameterOrBuilder getParametersOrBuilder(int index) return java.util.Collections.unmodifiableList(parameters_); } } + /** * * @@ -1089,9 +1118,10 @@ public com.google.api.SystemParameterOrBuilder getParametersOrBuilder(int index) * repeated .google.api.SystemParameter parameters = 2; */ public com.google.api.SystemParameter.Builder addParametersBuilder() { - return getParametersFieldBuilder() + return internalGetParametersFieldBuilder() .addBuilder(com.google.api.SystemParameter.getDefaultInstance()); } + /** * * @@ -1106,9 +1136,10 @@ public com.google.api.SystemParameter.Builder addParametersBuilder() { * repeated .google.api.SystemParameter parameters = 2; */ public com.google.api.SystemParameter.Builder addParametersBuilder(int index) { - return getParametersFieldBuilder() + return internalGetParametersFieldBuilder() .addBuilder(index, com.google.api.SystemParameter.getDefaultInstance()); } + /** * * @@ -1123,37 +1154,26 @@ public com.google.api.SystemParameter.Builder addParametersBuilder(int index) { * repeated .google.api.SystemParameter parameters = 2; */ public java.util.List getParametersBuilderList() { - return getParametersFieldBuilder().getBuilderList(); + return internalGetParametersFieldBuilder().getBuilderList(); } - private com.google.protobuf.RepeatedFieldBuilderV3< + private com.google.protobuf.RepeatedFieldBuilder< com.google.api.SystemParameter, com.google.api.SystemParameter.Builder, com.google.api.SystemParameterOrBuilder> - getParametersFieldBuilder() { + internalGetParametersFieldBuilder() { if (parametersBuilder_ == null) { parametersBuilder_ = - new com.google.protobuf.RepeatedFieldBuilderV3< + new com.google.protobuf.RepeatedFieldBuilder< com.google.api.SystemParameter, com.google.api.SystemParameter.Builder, com.google.api.SystemParameterOrBuilder>( - parameters_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + parameters_, ((bitField0_ & 0x00000002) != 0), getParentForChildren(), isClean()); parameters_ = null; } return parametersBuilder_; } - @java.lang.Override - public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - // @@protoc_insertion_point(builder_scope:google.api.SystemParameterRule) } diff --git a/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/SystemParameterRuleOrBuilder.java b/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/SystemParameterRuleOrBuilder.java index cfdbef70ff..ca14c33105 100644 --- a/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/SystemParameterRuleOrBuilder.java +++ b/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/SystemParameterRuleOrBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,10 +14,13 @@ * limitations under the License. */ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: google/api/system_parameter.proto +// Protobuf Java Version: 4.33.2 package com.google.api; +@com.google.protobuf.Generated public interface SystemParameterRuleOrBuilder extends // @@protoc_insertion_point(interface_extends:google.api.SystemParameterRule) @@ -29,7 +32,9 @@ public interface SystemParameterRuleOrBuilder *
            * Selects the methods to which this rule applies. Use '*' to indicate all
            * methods in all APIs.
        -   * Refer to [selector][google.api.DocumentationRule.selector] for syntax details.
        +   *
        +   * Refer to [selector][google.api.DocumentationRule.selector] for syntax
        +   * details.
            * 
        * * string selector = 1; @@ -37,13 +42,16 @@ public interface SystemParameterRuleOrBuilder * @return The selector. */ java.lang.String getSelector(); + /** * * *
            * Selects the methods to which this rule applies. Use '*' to indicate all
            * methods in all APIs.
        -   * Refer to [selector][google.api.DocumentationRule.selector] for syntax details.
        +   *
        +   * Refer to [selector][google.api.DocumentationRule.selector] for syntax
        +   * details.
            * 
        * * string selector = 1; @@ -66,6 +74,7 @@ public interface SystemParameterRuleOrBuilder * repeated .google.api.SystemParameter parameters = 2; */ java.util.List getParametersList(); + /** * * @@ -80,6 +89,7 @@ public interface SystemParameterRuleOrBuilder * repeated .google.api.SystemParameter parameters = 2; */ com.google.api.SystemParameter getParameters(int index); + /** * * @@ -94,6 +104,7 @@ public interface SystemParameterRuleOrBuilder * repeated .google.api.SystemParameter parameters = 2; */ int getParametersCount(); + /** * * @@ -108,6 +119,7 @@ public interface SystemParameterRuleOrBuilder * repeated .google.api.SystemParameter parameters = 2; */ java.util.List getParametersOrBuilderList(); + /** * * diff --git a/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/SystemParameters.java b/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/SystemParameters.java index a9244090dc..267230bc35 100644 --- a/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/SystemParameters.java +++ b/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/SystemParameters.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,9 @@ * limitations under the License. */ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: google/api/system_parameter.proto +// Protobuf Java Version: 4.33.2 package com.google.api; @@ -23,6 +25,7 @@ * *
          * ### System parameter configuration
        + *
          * A system parameter is a special kind of parameter defined by the API
          * system, not by an individual API. It is typically mapped to an HTTP header
          * and/or a URL query parameter. This configuration specifies which methods
        @@ -31,13 +34,25 @@
          *
          * Protobuf type {@code google.api.SystemParameters}
          */
        -public final class SystemParameters extends com.google.protobuf.GeneratedMessageV3
        +@com.google.protobuf.Generated
        +public final class SystemParameters extends com.google.protobuf.GeneratedMessage
             implements
             // @@protoc_insertion_point(message_implements:google.api.SystemParameters)
             SystemParametersOrBuilder {
           private static final long serialVersionUID = 0L;
        +
        +  static {
        +    com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion(
        +        com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC,
        +        /* major= */ 4,
        +        /* minor= */ 33,
        +        /* patch= */ 2,
        +        /* suffix= */ "",
        +        "SystemParameters");
        +  }
        +
           // Use SystemParameters.newBuilder() to construct.
        -  private SystemParameters(com.google.protobuf.GeneratedMessageV3.Builder builder) {
        +  private SystemParameters(com.google.protobuf.GeneratedMessage.Builder builder) {
             super(builder);
           }
         
        @@ -45,24 +60,13 @@ private SystemParameters() {
             rules_ = java.util.Collections.emptyList();
           }
         
        -  @java.lang.Override
        -  @SuppressWarnings({"unused"})
        -  protected java.lang.Object newInstance(UnusedPrivateParameter unused) {
        -    return new SystemParameters();
        -  }
        -
        -  @java.lang.Override
        -  public final com.google.protobuf.UnknownFieldSet getUnknownFields() {
        -    return this.unknownFields;
        -  }
        -
           public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
             return com.google.api.SystemParameterProto
                 .internal_static_google_api_SystemParameters_descriptor;
           }
         
           @java.lang.Override
        -  protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
        +  protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
               internalGetFieldAccessorTable() {
             return com.google.api.SystemParameterProto
                 .internal_static_google_api_SystemParameters_fieldAccessorTable
        @@ -71,32 +75,42 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
           }
         
           public static final int RULES_FIELD_NUMBER = 1;
        +
        +  @SuppressWarnings("serial")
           private java.util.List rules_;
        +
           /**
            *
            *
            * 
            * Define system parameters.
        +   *
            * The parameters defined here will override the default parameters
            * implemented by the system. If this field is missing from the service
            * config, default system parameters will be used. Default system parameters
            * and names is implementation-dependent.
        +   *
            * Example: define api key for all methods
        -   *     system_parameters
        -   *       rules:
        -   *         - selector: "*"
        -   *           parameters:
        -   *             - name: api_key
        -   *               url_query_parameter: api_key
        +   *
        +   * system_parameters
        +   * rules:
        +   * - selector: "*"
        +   * parameters:
        +   * - name: api_key
        +   * url_query_parameter: api_key
        +   *
        +   *
            * Example: define 2 api key names for a specific method.
        -   *     system_parameters
        -   *       rules:
        -   *         - selector: "/ListShelves"
        -   *           parameters:
        -   *             - name: api_key
        -   *               http_header: Api-Key1
        -   *             - name: api_key
        -   *               http_header: Api-Key2
        +   *
        +   * system_parameters
        +   * rules:
        +   * - selector: "/ListShelves"
        +   * parameters:
        +   * - name: api_key
        +   * http_header: Api-Key1
        +   * - name: api_key
        +   * http_header: Api-Key2
        +   *
            * **NOTE:** All service configuration rules follow "last one wins" order.
            * 
        * @@ -106,31 +120,39 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { public java.util.List getRulesList() { return rules_; } + /** * * *
            * Define system parameters.
        +   *
            * The parameters defined here will override the default parameters
            * implemented by the system. If this field is missing from the service
            * config, default system parameters will be used. Default system parameters
            * and names is implementation-dependent.
        +   *
            * Example: define api key for all methods
        -   *     system_parameters
        -   *       rules:
        -   *         - selector: "*"
        -   *           parameters:
        -   *             - name: api_key
        -   *               url_query_parameter: api_key
        +   *
        +   * system_parameters
        +   * rules:
        +   * - selector: "*"
        +   * parameters:
        +   * - name: api_key
        +   * url_query_parameter: api_key
        +   *
        +   *
            * Example: define 2 api key names for a specific method.
        -   *     system_parameters
        -   *       rules:
        -   *         - selector: "/ListShelves"
        -   *           parameters:
        -   *             - name: api_key
        -   *               http_header: Api-Key1
        -   *             - name: api_key
        -   *               http_header: Api-Key2
        +   *
        +   * system_parameters
        +   * rules:
        +   * - selector: "/ListShelves"
        +   * parameters:
        +   * - name: api_key
        +   * http_header: Api-Key1
        +   * - name: api_key
        +   * http_header: Api-Key2
        +   *
            * **NOTE:** All service configuration rules follow "last one wins" order.
            * 
        * @@ -141,31 +163,39 @@ public java.util.List getRulesList() { getRulesOrBuilderList() { return rules_; } + /** * * *
            * Define system parameters.
        +   *
            * The parameters defined here will override the default parameters
            * implemented by the system. If this field is missing from the service
            * config, default system parameters will be used. Default system parameters
            * and names is implementation-dependent.
        +   *
            * Example: define api key for all methods
        -   *     system_parameters
        -   *       rules:
        -   *         - selector: "*"
        -   *           parameters:
        -   *             - name: api_key
        -   *               url_query_parameter: api_key
        +   *
        +   * system_parameters
        +   * rules:
        +   * - selector: "*"
        +   * parameters:
        +   * - name: api_key
        +   * url_query_parameter: api_key
        +   *
        +   *
            * Example: define 2 api key names for a specific method.
        -   *     system_parameters
        -   *       rules:
        -   *         - selector: "/ListShelves"
        -   *           parameters:
        -   *             - name: api_key
        -   *               http_header: Api-Key1
        -   *             - name: api_key
        -   *               http_header: Api-Key2
        +   *
        +   * system_parameters
        +   * rules:
        +   * - selector: "/ListShelves"
        +   * parameters:
        +   * - name: api_key
        +   * http_header: Api-Key1
        +   * - name: api_key
        +   * http_header: Api-Key2
        +   *
            * **NOTE:** All service configuration rules follow "last one wins" order.
            * 
        * @@ -175,31 +205,39 @@ public java.util.List getRulesList() { public int getRulesCount() { return rules_.size(); } + /** * * *
            * Define system parameters.
        +   *
            * The parameters defined here will override the default parameters
            * implemented by the system. If this field is missing from the service
            * config, default system parameters will be used. Default system parameters
            * and names is implementation-dependent.
        +   *
            * Example: define api key for all methods
        -   *     system_parameters
        -   *       rules:
        -   *         - selector: "*"
        -   *           parameters:
        -   *             - name: api_key
        -   *               url_query_parameter: api_key
        +   *
        +   * system_parameters
        +   * rules:
        +   * - selector: "*"
        +   * parameters:
        +   * - name: api_key
        +   * url_query_parameter: api_key
        +   *
        +   *
            * Example: define 2 api key names for a specific method.
        -   *     system_parameters
        -   *       rules:
        -   *         - selector: "/ListShelves"
        -   *           parameters:
        -   *             - name: api_key
        -   *               http_header: Api-Key1
        -   *             - name: api_key
        -   *               http_header: Api-Key2
        +   *
        +   * system_parameters
        +   * rules:
        +   * - selector: "/ListShelves"
        +   * parameters:
        +   * - name: api_key
        +   * http_header: Api-Key1
        +   * - name: api_key
        +   * http_header: Api-Key2
        +   *
            * **NOTE:** All service configuration rules follow "last one wins" order.
            * 
        * @@ -209,31 +247,39 @@ public int getRulesCount() { public com.google.api.SystemParameterRule getRules(int index) { return rules_.get(index); } + /** * * *
            * Define system parameters.
        +   *
            * The parameters defined here will override the default parameters
            * implemented by the system. If this field is missing from the service
            * config, default system parameters will be used. Default system parameters
            * and names is implementation-dependent.
        +   *
            * Example: define api key for all methods
        -   *     system_parameters
        -   *       rules:
        -   *         - selector: "*"
        -   *           parameters:
        -   *             - name: api_key
        -   *               url_query_parameter: api_key
        +   *
        +   * system_parameters
        +   * rules:
        +   * - selector: "*"
        +   * parameters:
        +   * - name: api_key
        +   * url_query_parameter: api_key
        +   *
        +   *
            * Example: define 2 api key names for a specific method.
        -   *     system_parameters
        -   *       rules:
        -   *         - selector: "/ListShelves"
        -   *           parameters:
        -   *             - name: api_key
        -   *               http_header: Api-Key1
        -   *             - name: api_key
        -   *               http_header: Api-Key2
        +   *
        +   * system_parameters
        +   * rules:
        +   * - selector: "/ListShelves"
        +   * parameters:
        +   * - name: api_key
        +   * http_header: Api-Key1
        +   * - name: api_key
        +   * http_header: Api-Key2
        +   *
            * **NOTE:** All service configuration rules follow "last one wins" order.
            * 
        * @@ -345,38 +391,38 @@ public static com.google.api.SystemParameters parseFrom( public static com.google.api.SystemParameters parseFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); } public static com.google.api.SystemParameters parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } public static com.google.api.SystemParameters parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); } public static com.google.api.SystemParameters parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( PARSER, input, extensionRegistry); } public static com.google.api.SystemParameters parseFrom( com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); } public static com.google.api.SystemParameters parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } @@ -399,15 +445,17 @@ public Builder toBuilder() { } @java.lang.Override - protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { Builder builder = new Builder(parent); return builder; } + /** * * *
            * ### System parameter configuration
        +   *
            * A system parameter is a special kind of parameter defined by the API
            * system, not by an individual API. It is typically mapped to an HTTP header
            * and/or a URL query parameter. This configuration specifies which methods
        @@ -416,7 +464,7 @@ protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.Build
            *
            * Protobuf type {@code google.api.SystemParameters}
            */
        -  public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder
        +  public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder
               implements
               // @@protoc_insertion_point(builder_implements:google.api.SystemParameters)
               com.google.api.SystemParametersOrBuilder {
        @@ -426,7 +474,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
             }
         
             @java.lang.Override
        -    protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
        +    protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
                 internalGetFieldAccessorTable() {
               return com.google.api.SystemParameterProto
                   .internal_static_google_api_SystemParameters_fieldAccessorTable
        @@ -437,13 +485,14 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
             // Construct using com.google.api.SystemParameters.newBuilder()
             private Builder() {}
         
        -    private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
        +    private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) {
               super(parent);
             }
         
             @java.lang.Override
             public Builder clear() {
               super.clear();
        +      bitField0_ = 0;
               if (rulesBuilder_ == null) {
                 rules_ = java.util.Collections.emptyList();
               } else {
        @@ -477,7 +526,15 @@ public com.google.api.SystemParameters build() {
             @java.lang.Override
             public com.google.api.SystemParameters buildPartial() {
               com.google.api.SystemParameters result = new com.google.api.SystemParameters(this);
        -      int from_bitField0_ = bitField0_;
        +      buildPartialRepeatedFields(result);
        +      if (bitField0_ != 0) {
        +        buildPartial0(result);
        +      }
        +      onBuilt();
        +      return result;
        +    }
        +
        +    private void buildPartialRepeatedFields(com.google.api.SystemParameters result) {
               if (rulesBuilder_ == null) {
                 if (((bitField0_ & 0x00000001) != 0)) {
                   rules_ = java.util.Collections.unmodifiableList(rules_);
        @@ -487,41 +544,10 @@ public com.google.api.SystemParameters buildPartial() {
               } else {
                 result.rules_ = rulesBuilder_.build();
               }
        -      onBuilt();
        -      return result;
        -    }
        -
        -    @java.lang.Override
        -    public Builder clone() {
        -      return super.clone();
             }
         
        -    @java.lang.Override
        -    public Builder setField(
        -        com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) {
        -      return super.setField(field, value);
        -    }
        -
        -    @java.lang.Override
        -    public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) {
        -      return super.clearField(field);
        -    }
        -
        -    @java.lang.Override
        -    public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) {
        -      return super.clearOneof(oneof);
        -    }
        -
        -    @java.lang.Override
        -    public Builder setRepeatedField(
        -        com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) {
        -      return super.setRepeatedField(field, index, value);
        -    }
        -
        -    @java.lang.Override
        -    public Builder addRepeatedField(
        -        com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) {
        -      return super.addRepeatedField(field, value);
        +    private void buildPartial0(com.google.api.SystemParameters result) {
        +      int from_bitField0_ = bitField0_;
             }
         
             @java.lang.Override
        @@ -555,8 +581,8 @@ public Builder mergeFrom(com.google.api.SystemParameters other) {
                     rules_ = other.rules_;
                     bitField0_ = (bitField0_ & ~0x00000001);
                     rulesBuilder_ =
        -                com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders
        -                    ? getRulesFieldBuilder()
        +                com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders
        +                    ? internalGetRulesFieldBuilder()
                             : null;
                   } else {
                     rulesBuilder_.addAllMessages(other.rules_);
        @@ -631,7 +657,7 @@ private void ensureRulesIsMutable() {
               }
             }
         
        -    private com.google.protobuf.RepeatedFieldBuilderV3<
        +    private com.google.protobuf.RepeatedFieldBuilder<
                     com.google.api.SystemParameterRule,
                     com.google.api.SystemParameterRule.Builder,
                     com.google.api.SystemParameterRuleOrBuilder>
        @@ -642,26 +668,33 @@ private void ensureRulesIsMutable() {
              *
              * 
              * Define system parameters.
        +     *
              * The parameters defined here will override the default parameters
              * implemented by the system. If this field is missing from the service
              * config, default system parameters will be used. Default system parameters
              * and names is implementation-dependent.
        +     *
              * Example: define api key for all methods
        -     *     system_parameters
        -     *       rules:
        -     *         - selector: "*"
        -     *           parameters:
        -     *             - name: api_key
        -     *               url_query_parameter: api_key
        +     *
        +     * system_parameters
        +     * rules:
        +     * - selector: "*"
        +     * parameters:
        +     * - name: api_key
        +     * url_query_parameter: api_key
        +     *
        +     *
              * Example: define 2 api key names for a specific method.
        -     *     system_parameters
        -     *       rules:
        -     *         - selector: "/ListShelves"
        -     *           parameters:
        -     *             - name: api_key
        -     *               http_header: Api-Key1
        -     *             - name: api_key
        -     *               http_header: Api-Key2
        +     *
        +     * system_parameters
        +     * rules:
        +     * - selector: "/ListShelves"
        +     * parameters:
        +     * - name: api_key
        +     * http_header: Api-Key1
        +     * - name: api_key
        +     * http_header: Api-Key2
        +     *
              * **NOTE:** All service configuration rules follow "last one wins" order.
              * 
        * @@ -674,31 +707,39 @@ public java.util.List getRulesList() { return rulesBuilder_.getMessageList(); } } + /** * * *
              * Define system parameters.
        +     *
              * The parameters defined here will override the default parameters
              * implemented by the system. If this field is missing from the service
              * config, default system parameters will be used. Default system parameters
              * and names is implementation-dependent.
        +     *
              * Example: define api key for all methods
        -     *     system_parameters
        -     *       rules:
        -     *         - selector: "*"
        -     *           parameters:
        -     *             - name: api_key
        -     *               url_query_parameter: api_key
        +     *
        +     * system_parameters
        +     * rules:
        +     * - selector: "*"
        +     * parameters:
        +     * - name: api_key
        +     * url_query_parameter: api_key
        +     *
        +     *
              * Example: define 2 api key names for a specific method.
        -     *     system_parameters
        -     *       rules:
        -     *         - selector: "/ListShelves"
        -     *           parameters:
        -     *             - name: api_key
        -     *               http_header: Api-Key1
        -     *             - name: api_key
        -     *               http_header: Api-Key2
        +     *
        +     * system_parameters
        +     * rules:
        +     * - selector: "/ListShelves"
        +     * parameters:
        +     * - name: api_key
        +     * http_header: Api-Key1
        +     * - name: api_key
        +     * http_header: Api-Key2
        +     *
              * **NOTE:** All service configuration rules follow "last one wins" order.
              * 
        * @@ -711,31 +752,39 @@ public int getRulesCount() { return rulesBuilder_.getCount(); } } + /** * * *
              * Define system parameters.
        +     *
              * The parameters defined here will override the default parameters
              * implemented by the system. If this field is missing from the service
              * config, default system parameters will be used. Default system parameters
              * and names is implementation-dependent.
        +     *
              * Example: define api key for all methods
        -     *     system_parameters
        -     *       rules:
        -     *         - selector: "*"
        -     *           parameters:
        -     *             - name: api_key
        -     *               url_query_parameter: api_key
        +     *
        +     * system_parameters
        +     * rules:
        +     * - selector: "*"
        +     * parameters:
        +     * - name: api_key
        +     * url_query_parameter: api_key
        +     *
        +     *
              * Example: define 2 api key names for a specific method.
        -     *     system_parameters
        -     *       rules:
        -     *         - selector: "/ListShelves"
        -     *           parameters:
        -     *             - name: api_key
        -     *               http_header: Api-Key1
        -     *             - name: api_key
        -     *               http_header: Api-Key2
        +     *
        +     * system_parameters
        +     * rules:
        +     * - selector: "/ListShelves"
        +     * parameters:
        +     * - name: api_key
        +     * http_header: Api-Key1
        +     * - name: api_key
        +     * http_header: Api-Key2
        +     *
              * **NOTE:** All service configuration rules follow "last one wins" order.
              * 
        * @@ -748,31 +797,39 @@ public com.google.api.SystemParameterRule getRules(int index) { return rulesBuilder_.getMessage(index); } } + /** * * *
              * Define system parameters.
        +     *
              * The parameters defined here will override the default parameters
              * implemented by the system. If this field is missing from the service
              * config, default system parameters will be used. Default system parameters
              * and names is implementation-dependent.
        +     *
              * Example: define api key for all methods
        -     *     system_parameters
        -     *       rules:
        -     *         - selector: "*"
        -     *           parameters:
        -     *             - name: api_key
        -     *               url_query_parameter: api_key
        +     *
        +     * system_parameters
        +     * rules:
        +     * - selector: "*"
        +     * parameters:
        +     * - name: api_key
        +     * url_query_parameter: api_key
        +     *
        +     *
              * Example: define 2 api key names for a specific method.
        -     *     system_parameters
        -     *       rules:
        -     *         - selector: "/ListShelves"
        -     *           parameters:
        -     *             - name: api_key
        -     *               http_header: Api-Key1
        -     *             - name: api_key
        -     *               http_header: Api-Key2
        +     *
        +     * system_parameters
        +     * rules:
        +     * - selector: "/ListShelves"
        +     * parameters:
        +     * - name: api_key
        +     * http_header: Api-Key1
        +     * - name: api_key
        +     * http_header: Api-Key2
        +     *
              * **NOTE:** All service configuration rules follow "last one wins" order.
              * 
        * @@ -791,31 +848,39 @@ public Builder setRules(int index, com.google.api.SystemParameterRule value) { } return this; } + /** * * *
              * Define system parameters.
        +     *
              * The parameters defined here will override the default parameters
              * implemented by the system. If this field is missing from the service
              * config, default system parameters will be used. Default system parameters
              * and names is implementation-dependent.
        +     *
              * Example: define api key for all methods
        -     *     system_parameters
        -     *       rules:
        -     *         - selector: "*"
        -     *           parameters:
        -     *             - name: api_key
        -     *               url_query_parameter: api_key
        +     *
        +     * system_parameters
        +     * rules:
        +     * - selector: "*"
        +     * parameters:
        +     * - name: api_key
        +     * url_query_parameter: api_key
        +     *
        +     *
              * Example: define 2 api key names for a specific method.
        -     *     system_parameters
        -     *       rules:
        -     *         - selector: "/ListShelves"
        -     *           parameters:
        -     *             - name: api_key
        -     *               http_header: Api-Key1
        -     *             - name: api_key
        -     *               http_header: Api-Key2
        +     *
        +     * system_parameters
        +     * rules:
        +     * - selector: "/ListShelves"
        +     * parameters:
        +     * - name: api_key
        +     * http_header: Api-Key1
        +     * - name: api_key
        +     * http_header: Api-Key2
        +     *
              * **NOTE:** All service configuration rules follow "last one wins" order.
              * 
        * @@ -831,31 +896,39 @@ public Builder setRules(int index, com.google.api.SystemParameterRule.Builder bu } return this; } + /** * * *
              * Define system parameters.
        +     *
              * The parameters defined here will override the default parameters
              * implemented by the system. If this field is missing from the service
              * config, default system parameters will be used. Default system parameters
              * and names is implementation-dependent.
        +     *
              * Example: define api key for all methods
        -     *     system_parameters
        -     *       rules:
        -     *         - selector: "*"
        -     *           parameters:
        -     *             - name: api_key
        -     *               url_query_parameter: api_key
        +     *
        +     * system_parameters
        +     * rules:
        +     * - selector: "*"
        +     * parameters:
        +     * - name: api_key
        +     * url_query_parameter: api_key
        +     *
        +     *
              * Example: define 2 api key names for a specific method.
        -     *     system_parameters
        -     *       rules:
        -     *         - selector: "/ListShelves"
        -     *           parameters:
        -     *             - name: api_key
        -     *               http_header: Api-Key1
        -     *             - name: api_key
        -     *               http_header: Api-Key2
        +     *
        +     * system_parameters
        +     * rules:
        +     * - selector: "/ListShelves"
        +     * parameters:
        +     * - name: api_key
        +     * http_header: Api-Key1
        +     * - name: api_key
        +     * http_header: Api-Key2
        +     *
              * **NOTE:** All service configuration rules follow "last one wins" order.
              * 
        * @@ -874,31 +947,39 @@ public Builder addRules(com.google.api.SystemParameterRule value) { } return this; } + /** * * *
              * Define system parameters.
        +     *
              * The parameters defined here will override the default parameters
              * implemented by the system. If this field is missing from the service
              * config, default system parameters will be used. Default system parameters
              * and names is implementation-dependent.
        +     *
              * Example: define api key for all methods
        -     *     system_parameters
        -     *       rules:
        -     *         - selector: "*"
        -     *           parameters:
        -     *             - name: api_key
        -     *               url_query_parameter: api_key
        +     *
        +     * system_parameters
        +     * rules:
        +     * - selector: "*"
        +     * parameters:
        +     * - name: api_key
        +     * url_query_parameter: api_key
        +     *
        +     *
              * Example: define 2 api key names for a specific method.
        -     *     system_parameters
        -     *       rules:
        -     *         - selector: "/ListShelves"
        -     *           parameters:
        -     *             - name: api_key
        -     *               http_header: Api-Key1
        -     *             - name: api_key
        -     *               http_header: Api-Key2
        +     *
        +     * system_parameters
        +     * rules:
        +     * - selector: "/ListShelves"
        +     * parameters:
        +     * - name: api_key
        +     * http_header: Api-Key1
        +     * - name: api_key
        +     * http_header: Api-Key2
        +     *
              * **NOTE:** All service configuration rules follow "last one wins" order.
              * 
        * @@ -917,31 +998,39 @@ public Builder addRules(int index, com.google.api.SystemParameterRule value) { } return this; } + /** * * *
              * Define system parameters.
        +     *
              * The parameters defined here will override the default parameters
              * implemented by the system. If this field is missing from the service
              * config, default system parameters will be used. Default system parameters
              * and names is implementation-dependent.
        +     *
              * Example: define api key for all methods
        -     *     system_parameters
        -     *       rules:
        -     *         - selector: "*"
        -     *           parameters:
        -     *             - name: api_key
        -     *               url_query_parameter: api_key
        +     *
        +     * system_parameters
        +     * rules:
        +     * - selector: "*"
        +     * parameters:
        +     * - name: api_key
        +     * url_query_parameter: api_key
        +     *
        +     *
              * Example: define 2 api key names for a specific method.
        -     *     system_parameters
        -     *       rules:
        -     *         - selector: "/ListShelves"
        -     *           parameters:
        -     *             - name: api_key
        -     *               http_header: Api-Key1
        -     *             - name: api_key
        -     *               http_header: Api-Key2
        +     *
        +     * system_parameters
        +     * rules:
        +     * - selector: "/ListShelves"
        +     * parameters:
        +     * - name: api_key
        +     * http_header: Api-Key1
        +     * - name: api_key
        +     * http_header: Api-Key2
        +     *
              * **NOTE:** All service configuration rules follow "last one wins" order.
              * 
        * @@ -957,31 +1046,39 @@ public Builder addRules(com.google.api.SystemParameterRule.Builder builderForVal } return this; } + /** * * *
              * Define system parameters.
        +     *
              * The parameters defined here will override the default parameters
              * implemented by the system. If this field is missing from the service
              * config, default system parameters will be used. Default system parameters
              * and names is implementation-dependent.
        +     *
              * Example: define api key for all methods
        -     *     system_parameters
        -     *       rules:
        -     *         - selector: "*"
        -     *           parameters:
        -     *             - name: api_key
        -     *               url_query_parameter: api_key
        +     *
        +     * system_parameters
        +     * rules:
        +     * - selector: "*"
        +     * parameters:
        +     * - name: api_key
        +     * url_query_parameter: api_key
        +     *
        +     *
              * Example: define 2 api key names for a specific method.
        -     *     system_parameters
        -     *       rules:
        -     *         - selector: "/ListShelves"
        -     *           parameters:
        -     *             - name: api_key
        -     *               http_header: Api-Key1
        -     *             - name: api_key
        -     *               http_header: Api-Key2
        +     *
        +     * system_parameters
        +     * rules:
        +     * - selector: "/ListShelves"
        +     * parameters:
        +     * - name: api_key
        +     * http_header: Api-Key1
        +     * - name: api_key
        +     * http_header: Api-Key2
        +     *
              * **NOTE:** All service configuration rules follow "last one wins" order.
              * 
        * @@ -997,31 +1094,39 @@ public Builder addRules(int index, com.google.api.SystemParameterRule.Builder bu } return this; } + /** * * *
              * Define system parameters.
        +     *
              * The parameters defined here will override the default parameters
              * implemented by the system. If this field is missing from the service
              * config, default system parameters will be used. Default system parameters
              * and names is implementation-dependent.
        +     *
              * Example: define api key for all methods
        -     *     system_parameters
        -     *       rules:
        -     *         - selector: "*"
        -     *           parameters:
        -     *             - name: api_key
        -     *               url_query_parameter: api_key
        +     *
        +     * system_parameters
        +     * rules:
        +     * - selector: "*"
        +     * parameters:
        +     * - name: api_key
        +     * url_query_parameter: api_key
        +     *
        +     *
              * Example: define 2 api key names for a specific method.
        -     *     system_parameters
        -     *       rules:
        -     *         - selector: "/ListShelves"
        -     *           parameters:
        -     *             - name: api_key
        -     *               http_header: Api-Key1
        -     *             - name: api_key
        -     *               http_header: Api-Key2
        +     *
        +     * system_parameters
        +     * rules:
        +     * - selector: "/ListShelves"
        +     * parameters:
        +     * - name: api_key
        +     * http_header: Api-Key1
        +     * - name: api_key
        +     * http_header: Api-Key2
        +     *
              * **NOTE:** All service configuration rules follow "last one wins" order.
              * 
        * @@ -1038,31 +1143,39 @@ public Builder addAllRules( } return this; } + /** * * *
              * Define system parameters.
        +     *
              * The parameters defined here will override the default parameters
              * implemented by the system. If this field is missing from the service
              * config, default system parameters will be used. Default system parameters
              * and names is implementation-dependent.
        +     *
              * Example: define api key for all methods
        -     *     system_parameters
        -     *       rules:
        -     *         - selector: "*"
        -     *           parameters:
        -     *             - name: api_key
        -     *               url_query_parameter: api_key
        +     *
        +     * system_parameters
        +     * rules:
        +     * - selector: "*"
        +     * parameters:
        +     * - name: api_key
        +     * url_query_parameter: api_key
        +     *
        +     *
              * Example: define 2 api key names for a specific method.
        -     *     system_parameters
        -     *       rules:
        -     *         - selector: "/ListShelves"
        -     *           parameters:
        -     *             - name: api_key
        -     *               http_header: Api-Key1
        -     *             - name: api_key
        -     *               http_header: Api-Key2
        +     *
        +     * system_parameters
        +     * rules:
        +     * - selector: "/ListShelves"
        +     * parameters:
        +     * - name: api_key
        +     * http_header: Api-Key1
        +     * - name: api_key
        +     * http_header: Api-Key2
        +     *
              * **NOTE:** All service configuration rules follow "last one wins" order.
              * 
        * @@ -1078,31 +1191,39 @@ public Builder clearRules() { } return this; } + /** * * *
              * Define system parameters.
        +     *
              * The parameters defined here will override the default parameters
              * implemented by the system. If this field is missing from the service
              * config, default system parameters will be used. Default system parameters
              * and names is implementation-dependent.
        +     *
              * Example: define api key for all methods
        -     *     system_parameters
        -     *       rules:
        -     *         - selector: "*"
        -     *           parameters:
        -     *             - name: api_key
        -     *               url_query_parameter: api_key
        +     *
        +     * system_parameters
        +     * rules:
        +     * - selector: "*"
        +     * parameters:
        +     * - name: api_key
        +     * url_query_parameter: api_key
        +     *
        +     *
              * Example: define 2 api key names for a specific method.
        -     *     system_parameters
        -     *       rules:
        -     *         - selector: "/ListShelves"
        -     *           parameters:
        -     *             - name: api_key
        -     *               http_header: Api-Key1
        -     *             - name: api_key
        -     *               http_header: Api-Key2
        +     *
        +     * system_parameters
        +     * rules:
        +     * - selector: "/ListShelves"
        +     * parameters:
        +     * - name: api_key
        +     * http_header: Api-Key1
        +     * - name: api_key
        +     * http_header: Api-Key2
        +     *
              * **NOTE:** All service configuration rules follow "last one wins" order.
              * 
        * @@ -1118,64 +1239,80 @@ public Builder removeRules(int index) { } return this; } + /** * * *
              * Define system parameters.
        +     *
              * The parameters defined here will override the default parameters
              * implemented by the system. If this field is missing from the service
              * config, default system parameters will be used. Default system parameters
              * and names is implementation-dependent.
        +     *
              * Example: define api key for all methods
        -     *     system_parameters
        -     *       rules:
        -     *         - selector: "*"
        -     *           parameters:
        -     *             - name: api_key
        -     *               url_query_parameter: api_key
        +     *
        +     * system_parameters
        +     * rules:
        +     * - selector: "*"
        +     * parameters:
        +     * - name: api_key
        +     * url_query_parameter: api_key
        +     *
        +     *
              * Example: define 2 api key names for a specific method.
        -     *     system_parameters
        -     *       rules:
        -     *         - selector: "/ListShelves"
        -     *           parameters:
        -     *             - name: api_key
        -     *               http_header: Api-Key1
        -     *             - name: api_key
        -     *               http_header: Api-Key2
        +     *
        +     * system_parameters
        +     * rules:
        +     * - selector: "/ListShelves"
        +     * parameters:
        +     * - name: api_key
        +     * http_header: Api-Key1
        +     * - name: api_key
        +     * http_header: Api-Key2
        +     *
              * **NOTE:** All service configuration rules follow "last one wins" order.
              * 
        * * repeated .google.api.SystemParameterRule rules = 1; */ public com.google.api.SystemParameterRule.Builder getRulesBuilder(int index) { - return getRulesFieldBuilder().getBuilder(index); + return internalGetRulesFieldBuilder().getBuilder(index); } + /** * * *
              * Define system parameters.
        +     *
              * The parameters defined here will override the default parameters
              * implemented by the system. If this field is missing from the service
              * config, default system parameters will be used. Default system parameters
              * and names is implementation-dependent.
        +     *
              * Example: define api key for all methods
        -     *     system_parameters
        -     *       rules:
        -     *         - selector: "*"
        -     *           parameters:
        -     *             - name: api_key
        -     *               url_query_parameter: api_key
        +     *
        +     * system_parameters
        +     * rules:
        +     * - selector: "*"
        +     * parameters:
        +     * - name: api_key
        +     * url_query_parameter: api_key
        +     *
        +     *
              * Example: define 2 api key names for a specific method.
        -     *     system_parameters
        -     *       rules:
        -     *         - selector: "/ListShelves"
        -     *           parameters:
        -     *             - name: api_key
        -     *               http_header: Api-Key1
        -     *             - name: api_key
        -     *               http_header: Api-Key2
        +     *
        +     * system_parameters
        +     * rules:
        +     * - selector: "/ListShelves"
        +     * parameters:
        +     * - name: api_key
        +     * http_header: Api-Key1
        +     * - name: api_key
        +     * http_header: Api-Key2
        +     *
              * **NOTE:** All service configuration rules follow "last one wins" order.
              * 
        * @@ -1188,31 +1325,39 @@ public com.google.api.SystemParameterRuleOrBuilder getRulesOrBuilder(int index) return rulesBuilder_.getMessageOrBuilder(index); } } + /** * * *
              * Define system parameters.
        +     *
              * The parameters defined here will override the default parameters
              * implemented by the system. If this field is missing from the service
              * config, default system parameters will be used. Default system parameters
              * and names is implementation-dependent.
        +     *
              * Example: define api key for all methods
        -     *     system_parameters
        -     *       rules:
        -     *         - selector: "*"
        -     *           parameters:
        -     *             - name: api_key
        -     *               url_query_parameter: api_key
        +     *
        +     * system_parameters
        +     * rules:
        +     * - selector: "*"
        +     * parameters:
        +     * - name: api_key
        +     * url_query_parameter: api_key
        +     *
        +     *
              * Example: define 2 api key names for a specific method.
        -     *     system_parameters
        -     *       rules:
        -     *         - selector: "/ListShelves"
        -     *           parameters:
        -     *             - name: api_key
        -     *               http_header: Api-Key1
        -     *             - name: api_key
        -     *               http_header: Api-Key2
        +     *
        +     * system_parameters
        +     * rules:
        +     * - selector: "/ListShelves"
        +     * parameters:
        +     * - name: api_key
        +     * http_header: Api-Key1
        +     * - name: api_key
        +     * http_header: Api-Key2
        +     *
              * **NOTE:** All service configuration rules follow "last one wins" order.
              * 
        * @@ -1226,116 +1371,140 @@ public com.google.api.SystemParameterRuleOrBuilder getRulesOrBuilder(int index) return java.util.Collections.unmodifiableList(rules_); } } + /** * * *
              * Define system parameters.
        +     *
              * The parameters defined here will override the default parameters
              * implemented by the system. If this field is missing from the service
              * config, default system parameters will be used. Default system parameters
              * and names is implementation-dependent.
        +     *
              * Example: define api key for all methods
        -     *     system_parameters
        -     *       rules:
        -     *         - selector: "*"
        -     *           parameters:
        -     *             - name: api_key
        -     *               url_query_parameter: api_key
        +     *
        +     * system_parameters
        +     * rules:
        +     * - selector: "*"
        +     * parameters:
        +     * - name: api_key
        +     * url_query_parameter: api_key
        +     *
        +     *
              * Example: define 2 api key names for a specific method.
        -     *     system_parameters
        -     *       rules:
        -     *         - selector: "/ListShelves"
        -     *           parameters:
        -     *             - name: api_key
        -     *               http_header: Api-Key1
        -     *             - name: api_key
        -     *               http_header: Api-Key2
        +     *
        +     * system_parameters
        +     * rules:
        +     * - selector: "/ListShelves"
        +     * parameters:
        +     * - name: api_key
        +     * http_header: Api-Key1
        +     * - name: api_key
        +     * http_header: Api-Key2
        +     *
              * **NOTE:** All service configuration rules follow "last one wins" order.
              * 
        * * repeated .google.api.SystemParameterRule rules = 1; */ public com.google.api.SystemParameterRule.Builder addRulesBuilder() { - return getRulesFieldBuilder() + return internalGetRulesFieldBuilder() .addBuilder(com.google.api.SystemParameterRule.getDefaultInstance()); } + /** * * *
              * Define system parameters.
        +     *
              * The parameters defined here will override the default parameters
              * implemented by the system. If this field is missing from the service
              * config, default system parameters will be used. Default system parameters
              * and names is implementation-dependent.
        +     *
              * Example: define api key for all methods
        -     *     system_parameters
        -     *       rules:
        -     *         - selector: "*"
        -     *           parameters:
        -     *             - name: api_key
        -     *               url_query_parameter: api_key
        +     *
        +     * system_parameters
        +     * rules:
        +     * - selector: "*"
        +     * parameters:
        +     * - name: api_key
        +     * url_query_parameter: api_key
        +     *
        +     *
              * Example: define 2 api key names for a specific method.
        -     *     system_parameters
        -     *       rules:
        -     *         - selector: "/ListShelves"
        -     *           parameters:
        -     *             - name: api_key
        -     *               http_header: Api-Key1
        -     *             - name: api_key
        -     *               http_header: Api-Key2
        +     *
        +     * system_parameters
        +     * rules:
        +     * - selector: "/ListShelves"
        +     * parameters:
        +     * - name: api_key
        +     * http_header: Api-Key1
        +     * - name: api_key
        +     * http_header: Api-Key2
        +     *
              * **NOTE:** All service configuration rules follow "last one wins" order.
              * 
        * * repeated .google.api.SystemParameterRule rules = 1; */ public com.google.api.SystemParameterRule.Builder addRulesBuilder(int index) { - return getRulesFieldBuilder() + return internalGetRulesFieldBuilder() .addBuilder(index, com.google.api.SystemParameterRule.getDefaultInstance()); } + /** * * *
              * Define system parameters.
        +     *
              * The parameters defined here will override the default parameters
              * implemented by the system. If this field is missing from the service
              * config, default system parameters will be used. Default system parameters
              * and names is implementation-dependent.
        +     *
              * Example: define api key for all methods
        -     *     system_parameters
        -     *       rules:
        -     *         - selector: "*"
        -     *           parameters:
        -     *             - name: api_key
        -     *               url_query_parameter: api_key
        +     *
        +     * system_parameters
        +     * rules:
        +     * - selector: "*"
        +     * parameters:
        +     * - name: api_key
        +     * url_query_parameter: api_key
        +     *
        +     *
              * Example: define 2 api key names for a specific method.
        -     *     system_parameters
        -     *       rules:
        -     *         - selector: "/ListShelves"
        -     *           parameters:
        -     *             - name: api_key
        -     *               http_header: Api-Key1
        -     *             - name: api_key
        -     *               http_header: Api-Key2
        +     *
        +     * system_parameters
        +     * rules:
        +     * - selector: "/ListShelves"
        +     * parameters:
        +     * - name: api_key
        +     * http_header: Api-Key1
        +     * - name: api_key
        +     * http_header: Api-Key2
        +     *
              * **NOTE:** All service configuration rules follow "last one wins" order.
              * 
        * * repeated .google.api.SystemParameterRule rules = 1; */ public java.util.List getRulesBuilderList() { - return getRulesFieldBuilder().getBuilderList(); + return internalGetRulesFieldBuilder().getBuilderList(); } - private com.google.protobuf.RepeatedFieldBuilderV3< + private com.google.protobuf.RepeatedFieldBuilder< com.google.api.SystemParameterRule, com.google.api.SystemParameterRule.Builder, com.google.api.SystemParameterRuleOrBuilder> - getRulesFieldBuilder() { + internalGetRulesFieldBuilder() { if (rulesBuilder_ == null) { rulesBuilder_ = - new com.google.protobuf.RepeatedFieldBuilderV3< + new com.google.protobuf.RepeatedFieldBuilder< com.google.api.SystemParameterRule, com.google.api.SystemParameterRule.Builder, com.google.api.SystemParameterRuleOrBuilder>( @@ -1345,17 +1514,6 @@ public java.util.List getRulesBuilde return rulesBuilder_; } - @java.lang.Override - public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - // @@protoc_insertion_point(builder_scope:google.api.SystemParameters) } diff --git a/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/SystemParametersOrBuilder.java b/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/SystemParametersOrBuilder.java index a989804140..f8655192f4 100644 --- a/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/SystemParametersOrBuilder.java +++ b/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/SystemParametersOrBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,10 +14,13 @@ * limitations under the License. */ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: google/api/system_parameter.proto +// Protobuf Java Version: 4.33.2 package com.google.api; +@com.google.protobuf.Generated public interface SystemParametersOrBuilder extends // @@protoc_insertion_point(interface_extends:google.api.SystemParameters) @@ -28,150 +31,189 @@ public interface SystemParametersOrBuilder * *
            * Define system parameters.
        +   *
            * The parameters defined here will override the default parameters
            * implemented by the system. If this field is missing from the service
            * config, default system parameters will be used. Default system parameters
            * and names is implementation-dependent.
        +   *
            * Example: define api key for all methods
        -   *     system_parameters
        -   *       rules:
        -   *         - selector: "*"
        -   *           parameters:
        -   *             - name: api_key
        -   *               url_query_parameter: api_key
        +   *
        +   * system_parameters
        +   * rules:
        +   * - selector: "*"
        +   * parameters:
        +   * - name: api_key
        +   * url_query_parameter: api_key
        +   *
        +   *
            * Example: define 2 api key names for a specific method.
        -   *     system_parameters
        -   *       rules:
        -   *         - selector: "/ListShelves"
        -   *           parameters:
        -   *             - name: api_key
        -   *               http_header: Api-Key1
        -   *             - name: api_key
        -   *               http_header: Api-Key2
        +   *
        +   * system_parameters
        +   * rules:
        +   * - selector: "/ListShelves"
        +   * parameters:
        +   * - name: api_key
        +   * http_header: Api-Key1
        +   * - name: api_key
        +   * http_header: Api-Key2
        +   *
            * **NOTE:** All service configuration rules follow "last one wins" order.
            * 
        * * repeated .google.api.SystemParameterRule rules = 1; */ java.util.List getRulesList(); + /** * * *
            * Define system parameters.
        +   *
            * The parameters defined here will override the default parameters
            * implemented by the system. If this field is missing from the service
            * config, default system parameters will be used. Default system parameters
            * and names is implementation-dependent.
        +   *
            * Example: define api key for all methods
        -   *     system_parameters
        -   *       rules:
        -   *         - selector: "*"
        -   *           parameters:
        -   *             - name: api_key
        -   *               url_query_parameter: api_key
        +   *
        +   * system_parameters
        +   * rules:
        +   * - selector: "*"
        +   * parameters:
        +   * - name: api_key
        +   * url_query_parameter: api_key
        +   *
        +   *
            * Example: define 2 api key names for a specific method.
        -   *     system_parameters
        -   *       rules:
        -   *         - selector: "/ListShelves"
        -   *           parameters:
        -   *             - name: api_key
        -   *               http_header: Api-Key1
        -   *             - name: api_key
        -   *               http_header: Api-Key2
        +   *
        +   * system_parameters
        +   * rules:
        +   * - selector: "/ListShelves"
        +   * parameters:
        +   * - name: api_key
        +   * http_header: Api-Key1
        +   * - name: api_key
        +   * http_header: Api-Key2
        +   *
            * **NOTE:** All service configuration rules follow "last one wins" order.
            * 
        * * repeated .google.api.SystemParameterRule rules = 1; */ com.google.api.SystemParameterRule getRules(int index); + /** * * *
            * Define system parameters.
        +   *
            * The parameters defined here will override the default parameters
            * implemented by the system. If this field is missing from the service
            * config, default system parameters will be used. Default system parameters
            * and names is implementation-dependent.
        +   *
            * Example: define api key for all methods
        -   *     system_parameters
        -   *       rules:
        -   *         - selector: "*"
        -   *           parameters:
        -   *             - name: api_key
        -   *               url_query_parameter: api_key
        +   *
        +   * system_parameters
        +   * rules:
        +   * - selector: "*"
        +   * parameters:
        +   * - name: api_key
        +   * url_query_parameter: api_key
        +   *
        +   *
            * Example: define 2 api key names for a specific method.
        -   *     system_parameters
        -   *       rules:
        -   *         - selector: "/ListShelves"
        -   *           parameters:
        -   *             - name: api_key
        -   *               http_header: Api-Key1
        -   *             - name: api_key
        -   *               http_header: Api-Key2
        +   *
        +   * system_parameters
        +   * rules:
        +   * - selector: "/ListShelves"
        +   * parameters:
        +   * - name: api_key
        +   * http_header: Api-Key1
        +   * - name: api_key
        +   * http_header: Api-Key2
        +   *
            * **NOTE:** All service configuration rules follow "last one wins" order.
            * 
        * * repeated .google.api.SystemParameterRule rules = 1; */ int getRulesCount(); + /** * * *
            * Define system parameters.
        +   *
            * The parameters defined here will override the default parameters
            * implemented by the system. If this field is missing from the service
            * config, default system parameters will be used. Default system parameters
            * and names is implementation-dependent.
        +   *
            * Example: define api key for all methods
        -   *     system_parameters
        -   *       rules:
        -   *         - selector: "*"
        -   *           parameters:
        -   *             - name: api_key
        -   *               url_query_parameter: api_key
        +   *
        +   * system_parameters
        +   * rules:
        +   * - selector: "*"
        +   * parameters:
        +   * - name: api_key
        +   * url_query_parameter: api_key
        +   *
        +   *
            * Example: define 2 api key names for a specific method.
        -   *     system_parameters
        -   *       rules:
        -   *         - selector: "/ListShelves"
        -   *           parameters:
        -   *             - name: api_key
        -   *               http_header: Api-Key1
        -   *             - name: api_key
        -   *               http_header: Api-Key2
        +   *
        +   * system_parameters
        +   * rules:
        +   * - selector: "/ListShelves"
        +   * parameters:
        +   * - name: api_key
        +   * http_header: Api-Key1
        +   * - name: api_key
        +   * http_header: Api-Key2
        +   *
            * **NOTE:** All service configuration rules follow "last one wins" order.
            * 
        * * repeated .google.api.SystemParameterRule rules = 1; */ java.util.List getRulesOrBuilderList(); + /** * * *
            * Define system parameters.
        +   *
            * The parameters defined here will override the default parameters
            * implemented by the system. If this field is missing from the service
            * config, default system parameters will be used. Default system parameters
            * and names is implementation-dependent.
        +   *
            * Example: define api key for all methods
        -   *     system_parameters
        -   *       rules:
        -   *         - selector: "*"
        -   *           parameters:
        -   *             - name: api_key
        -   *               url_query_parameter: api_key
        +   *
        +   * system_parameters
        +   * rules:
        +   * - selector: "*"
        +   * parameters:
        +   * - name: api_key
        +   * url_query_parameter: api_key
        +   *
        +   *
            * Example: define 2 api key names for a specific method.
        -   *     system_parameters
        -   *       rules:
        -   *         - selector: "/ListShelves"
        -   *           parameters:
        -   *             - name: api_key
        -   *               http_header: Api-Key1
        -   *             - name: api_key
        -   *               http_header: Api-Key2
        +   *
        +   * system_parameters
        +   * rules:
        +   * - selector: "/ListShelves"
        +   * parameters:
        +   * - name: api_key
        +   * http_header: Api-Key1
        +   * - name: api_key
        +   * http_header: Api-Key2
        +   *
            * **NOTE:** All service configuration rules follow "last one wins" order.
            * 
        * diff --git a/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/TypeReference.java b/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/TypeReference.java new file mode 100644 index 0000000000..0e841e6a6d --- /dev/null +++ b/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/TypeReference.java @@ -0,0 +1,642 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/api/field_info.proto +// Protobuf Java Version: 4.33.2 + +package com.google.api; + +/** + * + * + *
        + * A reference to a message type, for use in [FieldInfo][google.api.FieldInfo].
        + * 
        + * + * Protobuf type {@code google.api.TypeReference} + */ +@com.google.protobuf.Generated +public final class TypeReference extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.api.TypeReference) + TypeReferenceOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "TypeReference"); + } + + // Use TypeReference.newBuilder() to construct. + private TypeReference(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private TypeReference() { + typeName_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.api.FieldInfoProto.internal_static_google_api_TypeReference_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.api.FieldInfoProto.internal_static_google_api_TypeReference_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.api.TypeReference.class, com.google.api.TypeReference.Builder.class); + } + + public static final int TYPE_NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object typeName_ = ""; + + /** + * + * + *
        +   * The name of the type that the annotated, generic field may represent.
        +   * If the type is in the same protobuf package, the value can be the simple
        +   * message name e.g., `"MyMessage"`. Otherwise, the value must be the
        +   * fully-qualified message name e.g., `"google.library.v1.Book"`.
        +   *
        +   * If the type(s) are unknown to the service (e.g. the field accepts generic
        +   * user input), use the wildcard `"*"` to denote this behavior.
        +   *
        +   * See [AIP-202](https://google.aip.dev/202#type-references) for more details.
        +   * 
        + * + * string type_name = 1; + * + * @return The typeName. + */ + @java.lang.Override + public java.lang.String getTypeName() { + java.lang.Object ref = typeName_; + 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(); + typeName_ = s; + return s; + } + } + + /** + * + * + *
        +   * The name of the type that the annotated, generic field may represent.
        +   * If the type is in the same protobuf package, the value can be the simple
        +   * message name e.g., `"MyMessage"`. Otherwise, the value must be the
        +   * fully-qualified message name e.g., `"google.library.v1.Book"`.
        +   *
        +   * If the type(s) are unknown to the service (e.g. the field accepts generic
        +   * user input), use the wildcard `"*"` to denote this behavior.
        +   *
        +   * See [AIP-202](https://google.aip.dev/202#type-references) for more details.
        +   * 
        + * + * string type_name = 1; + * + * @return The bytes for typeName. + */ + @java.lang.Override + public com.google.protobuf.ByteString getTypeNameBytes() { + java.lang.Object ref = typeName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + typeName_ = 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.GeneratedMessage.isStringEmpty(typeName_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, typeName_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(typeName_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, typeName_); + } + 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.api.TypeReference)) { + return super.equals(obj); + } + com.google.api.TypeReference other = (com.google.api.TypeReference) obj; + + if (!getTypeName().equals(other.getTypeName())) 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) + TYPE_NAME_FIELD_NUMBER; + hash = (53 * hash) + getTypeName().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.api.TypeReference parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.api.TypeReference parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.api.TypeReference parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.api.TypeReference parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.api.TypeReference parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.api.TypeReference parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.api.TypeReference parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.api.TypeReference parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.api.TypeReference parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.api.TypeReference parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.api.TypeReference parseFrom(com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.api.TypeReference parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.api.TypeReference 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
        +   * A reference to a message type, for use in [FieldInfo][google.api.FieldInfo].
        +   * 
        + * + * Protobuf type {@code google.api.TypeReference} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.api.TypeReference) + com.google.api.TypeReferenceOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.api.FieldInfoProto.internal_static_google_api_TypeReference_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.api.FieldInfoProto + .internal_static_google_api_TypeReference_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.api.TypeReference.class, com.google.api.TypeReference.Builder.class); + } + + // Construct using com.google.api.TypeReference.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + typeName_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.api.FieldInfoProto.internal_static_google_api_TypeReference_descriptor; + } + + @java.lang.Override + public com.google.api.TypeReference getDefaultInstanceForType() { + return com.google.api.TypeReference.getDefaultInstance(); + } + + @java.lang.Override + public com.google.api.TypeReference build() { + com.google.api.TypeReference result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.api.TypeReference buildPartial() { + com.google.api.TypeReference result = new com.google.api.TypeReference(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.api.TypeReference result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.typeName_ = typeName_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.api.TypeReference) { + return mergeFrom((com.google.api.TypeReference) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.api.TypeReference other) { + if (other == com.google.api.TypeReference.getDefaultInstance()) return this; + if (!other.getTypeName().isEmpty()) { + typeName_ = other.typeName_; + 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: + { + typeName_ = 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 typeName_ = ""; + + /** + * + * + *
        +     * The name of the type that the annotated, generic field may represent.
        +     * If the type is in the same protobuf package, the value can be the simple
        +     * message name e.g., `"MyMessage"`. Otherwise, the value must be the
        +     * fully-qualified message name e.g., `"google.library.v1.Book"`.
        +     *
        +     * If the type(s) are unknown to the service (e.g. the field accepts generic
        +     * user input), use the wildcard `"*"` to denote this behavior.
        +     *
        +     * See [AIP-202](https://google.aip.dev/202#type-references) for more details.
        +     * 
        + * + * string type_name = 1; + * + * @return The typeName. + */ + public java.lang.String getTypeName() { + java.lang.Object ref = typeName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + typeName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
        +     * The name of the type that the annotated, generic field may represent.
        +     * If the type is in the same protobuf package, the value can be the simple
        +     * message name e.g., `"MyMessage"`. Otherwise, the value must be the
        +     * fully-qualified message name e.g., `"google.library.v1.Book"`.
        +     *
        +     * If the type(s) are unknown to the service (e.g. the field accepts generic
        +     * user input), use the wildcard `"*"` to denote this behavior.
        +     *
        +     * See [AIP-202](https://google.aip.dev/202#type-references) for more details.
        +     * 
        + * + * string type_name = 1; + * + * @return The bytes for typeName. + */ + public com.google.protobuf.ByteString getTypeNameBytes() { + java.lang.Object ref = typeName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + typeName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
        +     * The name of the type that the annotated, generic field may represent.
        +     * If the type is in the same protobuf package, the value can be the simple
        +     * message name e.g., `"MyMessage"`. Otherwise, the value must be the
        +     * fully-qualified message name e.g., `"google.library.v1.Book"`.
        +     *
        +     * If the type(s) are unknown to the service (e.g. the field accepts generic
        +     * user input), use the wildcard `"*"` to denote this behavior.
        +     *
        +     * See [AIP-202](https://google.aip.dev/202#type-references) for more details.
        +     * 
        + * + * string type_name = 1; + * + * @param value The typeName to set. + * @return This builder for chaining. + */ + public Builder setTypeName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + typeName_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
        +     * The name of the type that the annotated, generic field may represent.
        +     * If the type is in the same protobuf package, the value can be the simple
        +     * message name e.g., `"MyMessage"`. Otherwise, the value must be the
        +     * fully-qualified message name e.g., `"google.library.v1.Book"`.
        +     *
        +     * If the type(s) are unknown to the service (e.g. the field accepts generic
        +     * user input), use the wildcard `"*"` to denote this behavior.
        +     *
        +     * See [AIP-202](https://google.aip.dev/202#type-references) for more details.
        +     * 
        + * + * string type_name = 1; + * + * @return This builder for chaining. + */ + public Builder clearTypeName() { + typeName_ = getDefaultInstance().getTypeName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
        +     * The name of the type that the annotated, generic field may represent.
        +     * If the type is in the same protobuf package, the value can be the simple
        +     * message name e.g., `"MyMessage"`. Otherwise, the value must be the
        +     * fully-qualified message name e.g., `"google.library.v1.Book"`.
        +     *
        +     * If the type(s) are unknown to the service (e.g. the field accepts generic
        +     * user input), use the wildcard `"*"` to denote this behavior.
        +     *
        +     * See [AIP-202](https://google.aip.dev/202#type-references) for more details.
        +     * 
        + * + * string type_name = 1; + * + * @param value The bytes for typeName to set. + * @return This builder for chaining. + */ + public Builder setTypeNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + typeName_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.api.TypeReference) + } + + // @@protoc_insertion_point(class_scope:google.api.TypeReference) + private static final com.google.api.TypeReference DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.api.TypeReference(); + } + + public static com.google.api.TypeReference getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public TypeReference 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.api.TypeReference getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/TypeReferenceOrBuilder.java b/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/TypeReferenceOrBuilder.java new file mode 100644 index 0000000000..54af4c1581 --- /dev/null +++ b/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/TypeReferenceOrBuilder.java @@ -0,0 +1,70 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/api/field_info.proto +// Protobuf Java Version: 4.33.2 + +package com.google.api; + +@com.google.protobuf.Generated +public interface TypeReferenceOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.api.TypeReference) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
        +   * The name of the type that the annotated, generic field may represent.
        +   * If the type is in the same protobuf package, the value can be the simple
        +   * message name e.g., `"MyMessage"`. Otherwise, the value must be the
        +   * fully-qualified message name e.g., `"google.library.v1.Book"`.
        +   *
        +   * If the type(s) are unknown to the service (e.g. the field accepts generic
        +   * user input), use the wildcard `"*"` to denote this behavior.
        +   *
        +   * See [AIP-202](https://google.aip.dev/202#type-references) for more details.
        +   * 
        + * + * string type_name = 1; + * + * @return The typeName. + */ + java.lang.String getTypeName(); + + /** + * + * + *
        +   * The name of the type that the annotated, generic field may represent.
        +   * If the type is in the same protobuf package, the value can be the simple
        +   * message name e.g., `"MyMessage"`. Otherwise, the value must be the
        +   * fully-qualified message name e.g., `"google.library.v1.Book"`.
        +   *
        +   * If the type(s) are unknown to the service (e.g. the field accepts generic
        +   * user input), use the wildcard `"*"` to denote this behavior.
        +   *
        +   * See [AIP-202](https://google.aip.dev/202#type-references) for more details.
        +   * 
        + * + * string type_name = 1; + * + * @return The bytes for typeName. + */ + com.google.protobuf.ByteString getTypeNameBytes(); +} diff --git a/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/Usage.java b/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/Usage.java index 6cd73a5bc2..062bb4af8c 100644 --- a/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/Usage.java +++ b/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/Usage.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,9 @@ * limitations under the License. */ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: google/api/usage.proto +// Protobuf Java Version: 4.33.2 package com.google.api; @@ -27,39 +29,40 @@ * * Protobuf type {@code google.api.Usage} */ -public final class Usage extends com.google.protobuf.GeneratedMessageV3 +@com.google.protobuf.Generated +public final class Usage extends com.google.protobuf.GeneratedMessage implements // @@protoc_insertion_point(message_implements:google.api.Usage) UsageOrBuilder { private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "Usage"); + } + // Use Usage.newBuilder() to construct. - private Usage(com.google.protobuf.GeneratedMessageV3.Builder builder) { + private Usage(com.google.protobuf.GeneratedMessage.Builder builder) { super(builder); } private Usage() { - requirements_ = com.google.protobuf.LazyStringArrayList.EMPTY; + requirements_ = com.google.protobuf.LazyStringArrayList.emptyList(); rules_ = java.util.Collections.emptyList(); producerNotificationChannel_ = ""; } - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new Usage(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.api.UsageProto.internal_static_google_api_Usage_descriptor; } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.api.UsageProto.internal_static_google_api_Usage_fieldAccessorTable .ensureFieldAccessorsInitialized( @@ -67,7 +70,11 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } public static final int REQUIREMENTS_FIELD_NUMBER = 1; - private com.google.protobuf.LazyStringList requirements_; + + @SuppressWarnings("serial") + private com.google.protobuf.LazyStringArrayList requirements_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + /** * * @@ -75,6 +82,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { * Requirements that must be satisfied before a consumer project can use the * service. Each requirement is of the form <service.name>/<requirement-id>; * for example 'serviceusage.googleapis.com/billing-enabled'. + * * For Google APIs, a Terms of Service requirement must be included here. * Google Cloud APIs must include "serviceusage.googleapis.com/tos/cloud". * Other Google APIs should include @@ -89,6 +97,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { public com.google.protobuf.ProtocolStringList getRequirementsList() { return requirements_; } + /** * * @@ -96,6 +105,7 @@ public com.google.protobuf.ProtocolStringList getRequirementsList() { * Requirements that must be satisfied before a consumer project can use the * service. Each requirement is of the form <service.name>/<requirement-id>; * for example 'serviceusage.googleapis.com/billing-enabled'. + * * For Google APIs, a Terms of Service requirement must be included here. * Google Cloud APIs must include "serviceusage.googleapis.com/tos/cloud". * Other Google APIs should include @@ -110,6 +120,7 @@ public com.google.protobuf.ProtocolStringList getRequirementsList() { public int getRequirementsCount() { return requirements_.size(); } + /** * * @@ -117,6 +128,7 @@ public int getRequirementsCount() { * Requirements that must be satisfied before a consumer project can use the * service. Each requirement is of the form <service.name>/<requirement-id>; * for example 'serviceusage.googleapis.com/billing-enabled'. + * * For Google APIs, a Terms of Service requirement must be included here. * Google Cloud APIs must include "serviceusage.googleapis.com/tos/cloud". * Other Google APIs should include @@ -132,6 +144,7 @@ public int getRequirementsCount() { public java.lang.String getRequirements(int index) { return requirements_.get(index); } + /** * * @@ -139,6 +152,7 @@ public java.lang.String getRequirements(int index) { * Requirements that must be satisfied before a consumer project can use the * service. Each requirement is of the form <service.name>/<requirement-id>; * for example 'serviceusage.googleapis.com/billing-enabled'. + * * For Google APIs, a Terms of Service requirement must be included here. * Google Cloud APIs must include "serviceusage.googleapis.com/tos/cloud". * Other Google APIs should include @@ -156,12 +170,16 @@ public com.google.protobuf.ByteString getRequirementsBytes(int index) { } public static final int RULES_FIELD_NUMBER = 6; + + @SuppressWarnings("serial") private java.util.List rules_; + /** * * *
            * A list of usage rules that apply to individual API methods.
        +   *
            * **NOTE:** All service configuration rules follow "last one wins" order.
            * 
        * @@ -171,11 +189,13 @@ public com.google.protobuf.ByteString getRequirementsBytes(int index) { public java.util.List getRulesList() { return rules_; } + /** * * *
            * A list of usage rules that apply to individual API methods.
        +   *
            * **NOTE:** All service configuration rules follow "last one wins" order.
            * 
        * @@ -185,11 +205,13 @@ public java.util.List getRulesList() { public java.util.List getRulesOrBuilderList() { return rules_; } + /** * * *
            * A list of usage rules that apply to individual API methods.
        +   *
            * **NOTE:** All service configuration rules follow "last one wins" order.
            * 
        * @@ -199,11 +221,13 @@ public java.util.List getRulesOrBui public int getRulesCount() { return rules_.size(); } + /** * * *
            * A list of usage rules that apply to individual API methods.
        +   *
            * **NOTE:** All service configuration rules follow "last one wins" order.
            * 
        * @@ -213,11 +237,13 @@ public int getRulesCount() { public com.google.api.UsageRule getRules(int index) { return rules_.get(index); } + /** * * *
            * A list of usage rules that apply to individual API methods.
        +   *
            * **NOTE:** All service configuration rules follow "last one wins" order.
            * 
        * @@ -229,13 +255,17 @@ public com.google.api.UsageRuleOrBuilder getRulesOrBuilder(int index) { } public static final int PRODUCER_NOTIFICATION_CHANNEL_FIELD_NUMBER = 7; - private volatile java.lang.Object producerNotificationChannel_; + + @SuppressWarnings("serial") + private volatile java.lang.Object producerNotificationChannel_ = ""; + /** * * *
            * The full resource name of a channel used for sending notifications to the
            * service producer.
        +   *
            * Google Service Management currently only supports
            * [Google Cloud Pub/Sub](https://cloud.google.com/pubsub) as a notification
            * channel. To use Google Cloud Pub/Sub as the channel, this must be the name
        @@ -259,12 +289,14 @@ public java.lang.String getProducerNotificationChannel() {
               return s;
             }
           }
        +
           /**
            *
            *
            * 
            * The full resource name of a channel used for sending notifications to the
            * service producer.
        +   *
            * Google Service Management currently only supports
            * [Google Cloud Pub/Sub](https://cloud.google.com/pubsub) as a notification
            * channel. To use Google Cloud Pub/Sub as the channel, this must be the name
        @@ -304,13 +336,13 @@ public final boolean isInitialized() {
           @java.lang.Override
           public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException {
             for (int i = 0; i < requirements_.size(); i++) {
        -      com.google.protobuf.GeneratedMessageV3.writeString(output, 1, requirements_.getRaw(i));
        +      com.google.protobuf.GeneratedMessage.writeString(output, 1, requirements_.getRaw(i));
             }
             for (int i = 0; i < rules_.size(); i++) {
               output.writeMessage(6, rules_.get(i));
             }
        -    if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(producerNotificationChannel_)) {
        -      com.google.protobuf.GeneratedMessageV3.writeString(output, 7, producerNotificationChannel_);
        +    if (!com.google.protobuf.GeneratedMessage.isStringEmpty(producerNotificationChannel_)) {
        +      com.google.protobuf.GeneratedMessage.writeString(output, 7, producerNotificationChannel_);
             }
             getUnknownFields().writeTo(output);
           }
        @@ -332,9 +364,9 @@ public int getSerializedSize() {
             for (int i = 0; i < rules_.size(); i++) {
               size += com.google.protobuf.CodedOutputStream.computeMessageSize(6, rules_.get(i));
             }
        -    if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(producerNotificationChannel_)) {
        +    if (!com.google.protobuf.GeneratedMessage.isStringEmpty(producerNotificationChannel_)) {
               size +=
        -          com.google.protobuf.GeneratedMessageV3.computeStringSize(7, producerNotificationChannel_);
        +          com.google.protobuf.GeneratedMessage.computeStringSize(7, producerNotificationChannel_);
             }
             size += getUnknownFields().getSerializedSize();
             memoizedSize = size;
        @@ -417,38 +449,38 @@ public static com.google.api.Usage parseFrom(
         
           public static com.google.api.Usage parseFrom(java.io.InputStream input)
               throws java.io.IOException {
        -    return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
        +    return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input);
           }
         
           public static com.google.api.Usage parseFrom(
               java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
               throws java.io.IOException {
        -    return com.google.protobuf.GeneratedMessageV3.parseWithIOException(
        +    return com.google.protobuf.GeneratedMessage.parseWithIOException(
                 PARSER, input, extensionRegistry);
           }
         
           public static com.google.api.Usage parseDelimitedFrom(java.io.InputStream input)
               throws java.io.IOException {
        -    return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input);
        +    return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input);
           }
         
           public static com.google.api.Usage parseDelimitedFrom(
               java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
               throws java.io.IOException {
        -    return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(
        +    return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(
                 PARSER, input, extensionRegistry);
           }
         
           public static com.google.api.Usage parseFrom(com.google.protobuf.CodedInputStream input)
               throws java.io.IOException {
        -    return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
        +    return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input);
           }
         
           public static com.google.api.Usage parseFrom(
               com.google.protobuf.CodedInputStream input,
               com.google.protobuf.ExtensionRegistryLite extensionRegistry)
               throws java.io.IOException {
        -    return com.google.protobuf.GeneratedMessageV3.parseWithIOException(
        +    return com.google.protobuf.GeneratedMessage.parseWithIOException(
                 PARSER, input, extensionRegistry);
           }
         
        @@ -471,10 +503,11 @@ public Builder toBuilder() {
           }
         
           @java.lang.Override
        -  protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
        +  protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) {
             Builder builder = new Builder(parent);
             return builder;
           }
        +
           /**
            *
            *
        @@ -484,7 +517,7 @@ protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.Build
            *
            * Protobuf type {@code google.api.Usage}
            */
        -  public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder
        +  public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder
               implements
               // @@protoc_insertion_point(builder_implements:google.api.Usage)
               com.google.api.UsageOrBuilder {
        @@ -493,7 +526,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
             }
         
             @java.lang.Override
        -    protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
        +    protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
                 internalGetFieldAccessorTable() {
               return com.google.api.UsageProto.internal_static_google_api_Usage_fieldAccessorTable
                   .ensureFieldAccessorsInitialized(
        @@ -503,15 +536,15 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
             // Construct using com.google.api.Usage.newBuilder()
             private Builder() {}
         
        -    private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
        +    private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) {
               super(parent);
             }
         
             @java.lang.Override
             public Builder clear() {
               super.clear();
        -      requirements_ = com.google.protobuf.LazyStringArrayList.EMPTY;
        -      bitField0_ = (bitField0_ & ~0x00000001);
        +      bitField0_ = 0;
        +      requirements_ = com.google.protobuf.LazyStringArrayList.emptyList();
               if (rulesBuilder_ == null) {
                 rules_ = java.util.Collections.emptyList();
               } else {
        @@ -520,7 +553,6 @@ public Builder clear() {
               }
               bitField0_ = (bitField0_ & ~0x00000002);
               producerNotificationChannel_ = "";
        -
               return this;
             }
         
        @@ -546,12 +578,15 @@ public com.google.api.Usage build() {
             @java.lang.Override
             public com.google.api.Usage buildPartial() {
               com.google.api.Usage result = new com.google.api.Usage(this);
        -      int from_bitField0_ = bitField0_;
        -      if (((bitField0_ & 0x00000001) != 0)) {
        -        requirements_ = requirements_.getUnmodifiableView();
        -        bitField0_ = (bitField0_ & ~0x00000001);
        +      buildPartialRepeatedFields(result);
        +      if (bitField0_ != 0) {
        +        buildPartial0(result);
               }
        -      result.requirements_ = requirements_;
        +      onBuilt();
        +      return result;
        +    }
        +
        +    private void buildPartialRepeatedFields(com.google.api.Usage result) {
               if (rulesBuilder_ == null) {
                 if (((bitField0_ & 0x00000002) != 0)) {
                   rules_ = java.util.Collections.unmodifiableList(rules_);
        @@ -561,42 +596,17 @@ public com.google.api.Usage buildPartial() {
               } else {
                 result.rules_ = rulesBuilder_.build();
               }
        -      result.producerNotificationChannel_ = producerNotificationChannel_;
        -      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);
        +    private void buildPartial0(com.google.api.Usage result) {
        +      int from_bitField0_ = bitField0_;
        +      if (((from_bitField0_ & 0x00000001) != 0)) {
        +        requirements_.makeImmutable();
        +        result.requirements_ = requirements_;
        +      }
        +      if (((from_bitField0_ & 0x00000004) != 0)) {
        +        result.producerNotificationChannel_ = producerNotificationChannel_;
        +      }
             }
         
             @java.lang.Override
        @@ -614,7 +624,7 @@ public Builder mergeFrom(com.google.api.Usage other) {
               if (!other.requirements_.isEmpty()) {
                 if (requirements_.isEmpty()) {
                   requirements_ = other.requirements_;
        -          bitField0_ = (bitField0_ & ~0x00000001);
        +          bitField0_ |= 0x00000001;
                 } else {
                   ensureRequirementsIsMutable();
                   requirements_.addAll(other.requirements_);
        @@ -640,8 +650,8 @@ public Builder mergeFrom(com.google.api.Usage other) {
                     rules_ = other.rules_;
                     bitField0_ = (bitField0_ & ~0x00000002);
                     rulesBuilder_ =
        -                com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders
        -                    ? getRulesFieldBuilder()
        +                com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders
        +                    ? internalGetRulesFieldBuilder()
                             : null;
                   } else {
                     rulesBuilder_.addAllMessages(other.rules_);
        @@ -650,6 +660,7 @@ public Builder mergeFrom(com.google.api.Usage other) {
               }
               if (!other.getProducerNotificationChannel().isEmpty()) {
                 producerNotificationChannel_ = other.producerNotificationChannel_;
        +        bitField0_ |= 0x00000004;
                 onChanged();
               }
               this.mergeUnknownFields(other.getUnknownFields());
        @@ -700,7 +711,7 @@ public Builder mergeFrom(
                     case 58:
                       {
                         producerNotificationChannel_ = input.readStringRequireUtf8();
        -
        +                bitField0_ |= 0x00000004;
                         break;
                       } // case 58
                     default:
        @@ -722,15 +733,16 @@ public Builder mergeFrom(
         
             private int bitField0_;
         
        -    private com.google.protobuf.LazyStringList requirements_ =
        -        com.google.protobuf.LazyStringArrayList.EMPTY;
        +    private com.google.protobuf.LazyStringArrayList requirements_ =
        +        com.google.protobuf.LazyStringArrayList.emptyList();
         
             private void ensureRequirementsIsMutable() {
        -      if (!((bitField0_ & 0x00000001) != 0)) {
        +      if (!requirements_.isModifiable()) {
                 requirements_ = new com.google.protobuf.LazyStringArrayList(requirements_);
        -        bitField0_ |= 0x00000001;
               }
        +      bitField0_ |= 0x00000001;
             }
        +
             /**
              *
              *
        @@ -738,6 +750,7 @@ private void ensureRequirementsIsMutable() {
              * Requirements that must be satisfied before a consumer project can use the
              * service. Each requirement is of the form <service.name>/<requirement-id>;
              * for example 'serviceusage.googleapis.com/billing-enabled'.
        +     *
              * For Google APIs, a Terms of Service requirement must be included here.
              * Google Cloud APIs must include "serviceusage.googleapis.com/tos/cloud".
              * Other Google APIs should include
        @@ -750,8 +763,10 @@ private void ensureRequirementsIsMutable() {
              * @return A list containing the requirements.
              */
             public com.google.protobuf.ProtocolStringList getRequirementsList() {
        -      return requirements_.getUnmodifiableView();
        +      requirements_.makeImmutable();
        +      return requirements_;
             }
        +
             /**
              *
              *
        @@ -759,6 +774,7 @@ public com.google.protobuf.ProtocolStringList getRequirementsList() {
              * Requirements that must be satisfied before a consumer project can use the
              * service. Each requirement is of the form <service.name>/<requirement-id>;
              * for example 'serviceusage.googleapis.com/billing-enabled'.
        +     *
              * For Google APIs, a Terms of Service requirement must be included here.
              * Google Cloud APIs must include "serviceusage.googleapis.com/tos/cloud".
              * Other Google APIs should include
        @@ -773,6 +789,7 @@ public com.google.protobuf.ProtocolStringList getRequirementsList() {
             public int getRequirementsCount() {
               return requirements_.size();
             }
        +
             /**
              *
              *
        @@ -780,6 +797,7 @@ public int getRequirementsCount() {
              * Requirements that must be satisfied before a consumer project can use the
              * service. Each requirement is of the form <service.name>/<requirement-id>;
              * for example 'serviceusage.googleapis.com/billing-enabled'.
        +     *
              * For Google APIs, a Terms of Service requirement must be included here.
              * Google Cloud APIs must include "serviceusage.googleapis.com/tos/cloud".
              * Other Google APIs should include
        @@ -795,6 +813,7 @@ public int getRequirementsCount() {
             public java.lang.String getRequirements(int index) {
               return requirements_.get(index);
             }
        +
             /**
              *
              *
        @@ -802,6 +821,7 @@ public java.lang.String getRequirements(int index) {
              * Requirements that must be satisfied before a consumer project can use the
              * service. Each requirement is of the form <service.name>/<requirement-id>;
              * for example 'serviceusage.googleapis.com/billing-enabled'.
        +     *
              * For Google APIs, a Terms of Service requirement must be included here.
              * Google Cloud APIs must include "serviceusage.googleapis.com/tos/cloud".
              * Other Google APIs should include
        @@ -817,6 +837,7 @@ public java.lang.String getRequirements(int index) {
             public com.google.protobuf.ByteString getRequirementsBytes(int index) {
               return requirements_.getByteString(index);
             }
        +
             /**
              *
              *
        @@ -824,6 +845,7 @@ public com.google.protobuf.ByteString getRequirementsBytes(int index) {
              * Requirements that must be satisfied before a consumer project can use the
              * service. Each requirement is of the form <service.name>/<requirement-id>;
              * for example 'serviceusage.googleapis.com/billing-enabled'.
        +     *
              * For Google APIs, a Terms of Service requirement must be included here.
              * Google Cloud APIs must include "serviceusage.googleapis.com/tos/cloud".
              * Other Google APIs should include
        @@ -843,9 +865,11 @@ public Builder setRequirements(int index, java.lang.String value) {
               }
               ensureRequirementsIsMutable();
               requirements_.set(index, value);
        +      bitField0_ |= 0x00000001;
               onChanged();
               return this;
             }
        +
             /**
              *
              *
        @@ -853,6 +877,7 @@ public Builder setRequirements(int index, java.lang.String value) {
              * Requirements that must be satisfied before a consumer project can use the
              * service. Each requirement is of the form <service.name>/<requirement-id>;
              * for example 'serviceusage.googleapis.com/billing-enabled'.
        +     *
              * For Google APIs, a Terms of Service requirement must be included here.
              * Google Cloud APIs must include "serviceusage.googleapis.com/tos/cloud".
              * Other Google APIs should include
        @@ -871,9 +896,11 @@ public Builder addRequirements(java.lang.String value) {
               }
               ensureRequirementsIsMutable();
               requirements_.add(value);
        +      bitField0_ |= 0x00000001;
               onChanged();
               return this;
             }
        +
             /**
              *
              *
        @@ -881,6 +908,7 @@ public Builder addRequirements(java.lang.String value) {
              * Requirements that must be satisfied before a consumer project can use the
              * service. Each requirement is of the form <service.name>/<requirement-id>;
              * for example 'serviceusage.googleapis.com/billing-enabled'.
        +     *
              * For Google APIs, a Terms of Service requirement must be included here.
              * Google Cloud APIs must include "serviceusage.googleapis.com/tos/cloud".
              * Other Google APIs should include
        @@ -896,9 +924,11 @@ public Builder addRequirements(java.lang.String value) {
             public Builder addAllRequirements(java.lang.Iterable values) {
               ensureRequirementsIsMutable();
               com.google.protobuf.AbstractMessageLite.Builder.addAll(values, requirements_);
        +      bitField0_ |= 0x00000001;
               onChanged();
               return this;
             }
        +
             /**
              *
              *
        @@ -906,6 +936,7 @@ public Builder addAllRequirements(java.lang.Iterable values) {
              * Requirements that must be satisfied before a consumer project can use the
              * service. Each requirement is of the form <service.name>/<requirement-id>;
              * for example 'serviceusage.googleapis.com/billing-enabled'.
        +     *
              * For Google APIs, a Terms of Service requirement must be included here.
              * Google Cloud APIs must include "serviceusage.googleapis.com/tos/cloud".
              * Other Google APIs should include
        @@ -918,11 +949,13 @@ public Builder addAllRequirements(java.lang.Iterable values) {
              * @return This builder for chaining.
              */
             public Builder clearRequirements() {
        -      requirements_ = com.google.protobuf.LazyStringArrayList.EMPTY;
        +      requirements_ = com.google.protobuf.LazyStringArrayList.emptyList();
               bitField0_ = (bitField0_ & ~0x00000001);
        +      ;
               onChanged();
               return this;
             }
        +
             /**
              *
              *
        @@ -930,6 +963,7 @@ public Builder clearRequirements() {
              * Requirements that must be satisfied before a consumer project can use the
              * service. Each requirement is of the form <service.name>/<requirement-id>;
              * for example 'serviceusage.googleapis.com/billing-enabled'.
        +     *
              * For Google APIs, a Terms of Service requirement must be included here.
              * Google Cloud APIs must include "serviceusage.googleapis.com/tos/cloud".
              * Other Google APIs should include
        @@ -949,6 +983,7 @@ public Builder addRequirementsBytes(com.google.protobuf.ByteString value) {
               checkByteStringIsUtf8(value);
               ensureRequirementsIsMutable();
               requirements_.add(value);
        +      bitField0_ |= 0x00000001;
               onChanged();
               return this;
             }
        @@ -962,7 +997,7 @@ private void ensureRulesIsMutable() {
               }
             }
         
        -    private com.google.protobuf.RepeatedFieldBuilderV3<
        +    private com.google.protobuf.RepeatedFieldBuilder<
                     com.google.api.UsageRule,
                     com.google.api.UsageRule.Builder,
                     com.google.api.UsageRuleOrBuilder>
        @@ -973,6 +1008,7 @@ private void ensureRulesIsMutable() {
              *
              * 
              * A list of usage rules that apply to individual API methods.
        +     *
              * **NOTE:** All service configuration rules follow "last one wins" order.
              * 
        * @@ -985,11 +1021,13 @@ public java.util.List getRulesList() { return rulesBuilder_.getMessageList(); } } + /** * * *
              * A list of usage rules that apply to individual API methods.
        +     *
              * **NOTE:** All service configuration rules follow "last one wins" order.
              * 
        * @@ -1002,11 +1040,13 @@ public int getRulesCount() { return rulesBuilder_.getCount(); } } + /** * * *
              * A list of usage rules that apply to individual API methods.
        +     *
              * **NOTE:** All service configuration rules follow "last one wins" order.
              * 
        * @@ -1019,11 +1059,13 @@ public com.google.api.UsageRule getRules(int index) { return rulesBuilder_.getMessage(index); } } + /** * * *
              * A list of usage rules that apply to individual API methods.
        +     *
              * **NOTE:** All service configuration rules follow "last one wins" order.
              * 
        * @@ -1042,11 +1084,13 @@ public Builder setRules(int index, com.google.api.UsageRule value) { } return this; } + /** * * *
              * A list of usage rules that apply to individual API methods.
        +     *
              * **NOTE:** All service configuration rules follow "last one wins" order.
              * 
        * @@ -1062,11 +1106,13 @@ public Builder setRules(int index, com.google.api.UsageRule.Builder builderForVa } return this; } + /** * * *
              * A list of usage rules that apply to individual API methods.
        +     *
              * **NOTE:** All service configuration rules follow "last one wins" order.
              * 
        * @@ -1085,11 +1131,13 @@ public Builder addRules(com.google.api.UsageRule value) { } return this; } + /** * * *
              * A list of usage rules that apply to individual API methods.
        +     *
              * **NOTE:** All service configuration rules follow "last one wins" order.
              * 
        * @@ -1108,11 +1156,13 @@ public Builder addRules(int index, com.google.api.UsageRule value) { } return this; } + /** * * *
              * A list of usage rules that apply to individual API methods.
        +     *
              * **NOTE:** All service configuration rules follow "last one wins" order.
              * 
        * @@ -1128,11 +1178,13 @@ public Builder addRules(com.google.api.UsageRule.Builder builderForValue) { } return this; } + /** * * *
              * A list of usage rules that apply to individual API methods.
        +     *
              * **NOTE:** All service configuration rules follow "last one wins" order.
              * 
        * @@ -1148,11 +1200,13 @@ public Builder addRules(int index, com.google.api.UsageRule.Builder builderForVa } return this; } + /** * * *
              * A list of usage rules that apply to individual API methods.
        +     *
              * **NOTE:** All service configuration rules follow "last one wins" order.
              * 
        * @@ -1168,11 +1222,13 @@ public Builder addAllRules(java.lang.Iterable * A list of usage rules that apply to individual API methods. + * * **NOTE:** All service configuration rules follow "last one wins" order. *
        * @@ -1188,11 +1244,13 @@ public Builder clearRules() { } return this; } + /** * * *
              * A list of usage rules that apply to individual API methods.
        +     *
              * **NOTE:** All service configuration rules follow "last one wins" order.
              * 
        * @@ -1208,24 +1266,28 @@ public Builder removeRules(int index) { } return this; } + /** * * *
              * A list of usage rules that apply to individual API methods.
        +     *
              * **NOTE:** All service configuration rules follow "last one wins" order.
              * 
        * * repeated .google.api.UsageRule rules = 6; */ public com.google.api.UsageRule.Builder getRulesBuilder(int index) { - return getRulesFieldBuilder().getBuilder(index); + return internalGetRulesFieldBuilder().getBuilder(index); } + /** * * *
              * A list of usage rules that apply to individual API methods.
        +     *
              * **NOTE:** All service configuration rules follow "last one wins" order.
              * 
        * @@ -1238,11 +1300,13 @@ public com.google.api.UsageRuleOrBuilder getRulesOrBuilder(int index) { return rulesBuilder_.getMessageOrBuilder(index); } } + /** * * *
              * A list of usage rules that apply to individual API methods.
        +     *
              * **NOTE:** All service configuration rules follow "last one wins" order.
              * 
        * @@ -1255,55 +1319,62 @@ public java.util.List getRulesOrBui return java.util.Collections.unmodifiableList(rules_); } } + /** * * *
              * A list of usage rules that apply to individual API methods.
        +     *
              * **NOTE:** All service configuration rules follow "last one wins" order.
              * 
        * * repeated .google.api.UsageRule rules = 6; */ public com.google.api.UsageRule.Builder addRulesBuilder() { - return getRulesFieldBuilder().addBuilder(com.google.api.UsageRule.getDefaultInstance()); + return internalGetRulesFieldBuilder() + .addBuilder(com.google.api.UsageRule.getDefaultInstance()); } + /** * * *
              * A list of usage rules that apply to individual API methods.
        +     *
              * **NOTE:** All service configuration rules follow "last one wins" order.
              * 
        * * repeated .google.api.UsageRule rules = 6; */ public com.google.api.UsageRule.Builder addRulesBuilder(int index) { - return getRulesFieldBuilder() + return internalGetRulesFieldBuilder() .addBuilder(index, com.google.api.UsageRule.getDefaultInstance()); } + /** * * *
              * A list of usage rules that apply to individual API methods.
        +     *
              * **NOTE:** All service configuration rules follow "last one wins" order.
              * 
        * * repeated .google.api.UsageRule rules = 6; */ public java.util.List getRulesBuilderList() { - return getRulesFieldBuilder().getBuilderList(); + return internalGetRulesFieldBuilder().getBuilderList(); } - private com.google.protobuf.RepeatedFieldBuilderV3< + private com.google.protobuf.RepeatedFieldBuilder< com.google.api.UsageRule, com.google.api.UsageRule.Builder, com.google.api.UsageRuleOrBuilder> - getRulesFieldBuilder() { + internalGetRulesFieldBuilder() { if (rulesBuilder_ == null) { rulesBuilder_ = - new com.google.protobuf.RepeatedFieldBuilderV3< + new com.google.protobuf.RepeatedFieldBuilder< com.google.api.UsageRule, com.google.api.UsageRule.Builder, com.google.api.UsageRuleOrBuilder>( @@ -1314,12 +1385,14 @@ public java.util.List getRulesBuilderList() { } private java.lang.Object producerNotificationChannel_ = ""; + /** * * *
              * The full resource name of a channel used for sending notifications to the
              * service producer.
        +     *
              * Google Service Management currently only supports
              * [Google Cloud Pub/Sub](https://cloud.google.com/pubsub) as a notification
              * channel. To use Google Cloud Pub/Sub as the channel, this must be the name
        @@ -1342,12 +1415,14 @@ public java.lang.String getProducerNotificationChannel() {
                 return (java.lang.String) ref;
               }
             }
        +
             /**
              *
              *
              * 
              * The full resource name of a channel used for sending notifications to the
              * service producer.
        +     *
              * Google Service Management currently only supports
              * [Google Cloud Pub/Sub](https://cloud.google.com/pubsub) as a notification
              * channel. To use Google Cloud Pub/Sub as the channel, this must be the name
        @@ -1370,12 +1445,14 @@ public com.google.protobuf.ByteString getProducerNotificationChannelBytes() {
                 return (com.google.protobuf.ByteString) ref;
               }
             }
        +
             /**
              *
              *
              * 
              * The full resource name of a channel used for sending notifications to the
              * service producer.
        +     *
              * Google Service Management currently only supports
              * [Google Cloud Pub/Sub](https://cloud.google.com/pubsub) as a notification
              * channel. To use Google Cloud Pub/Sub as the channel, this must be the name
        @@ -1392,17 +1469,19 @@ public Builder setProducerNotificationChannel(java.lang.String value) {
               if (value == null) {
                 throw new NullPointerException();
               }
        -
               producerNotificationChannel_ = value;
        +      bitField0_ |= 0x00000004;
               onChanged();
               return this;
             }
        +
             /**
              *
              *
              * 
              * The full resource name of a channel used for sending notifications to the
              * service producer.
        +     *
              * Google Service Management currently only supports
              * [Google Cloud Pub/Sub](https://cloud.google.com/pubsub) as a notification
              * channel. To use Google Cloud Pub/Sub as the channel, this must be the name
        @@ -1415,17 +1494,19 @@ public Builder setProducerNotificationChannel(java.lang.String value) {
              * @return This builder for chaining.
              */
             public Builder clearProducerNotificationChannel() {
        -
               producerNotificationChannel_ = getDefaultInstance().getProducerNotificationChannel();
        +      bitField0_ = (bitField0_ & ~0x00000004);
               onChanged();
               return this;
             }
        +
             /**
              *
              *
              * 
              * The full resource name of a channel used for sending notifications to the
              * service producer.
        +     *
              * Google Service Management currently only supports
              * [Google Cloud Pub/Sub](https://cloud.google.com/pubsub) as a notification
              * channel. To use Google Cloud Pub/Sub as the channel, this must be the name
        @@ -1443,23 +1524,12 @@ public Builder setProducerNotificationChannelBytes(com.google.protobuf.ByteStrin
                 throw new NullPointerException();
               }
               checkByteStringIsUtf8(value);
        -
               producerNotificationChannel_ = 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.api.Usage)
           }
         
        diff --git a/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/UsageOrBuilder.java b/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/UsageOrBuilder.java
        index ff0c52dd41..5579ac6b7f 100644
        --- a/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/UsageOrBuilder.java
        +++ b/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/UsageOrBuilder.java
        @@ -1,5 +1,5 @@
         /*
        - * Copyright 2020 Google LLC
        + * Copyright 2026 Google LLC
          *
          * Licensed under the Apache License, Version 2.0 (the "License");
          * you may not use this file except in compliance with the License.
        @@ -14,10 +14,13 @@
          * limitations under the License.
          */
         // Generated by the protocol buffer compiler.  DO NOT EDIT!
        +// NO CHECKED-IN PROTOBUF GENCODE
         // source: google/api/usage.proto
        +// Protobuf Java Version: 4.33.2
         
         package com.google.api;
         
        +@com.google.protobuf.Generated
         public interface UsageOrBuilder
             extends
             // @@protoc_insertion_point(interface_extends:google.api.Usage)
        @@ -30,6 +33,7 @@ public interface UsageOrBuilder
            * Requirements that must be satisfied before a consumer project can use the
            * service. Each requirement is of the form <service.name>/<requirement-id>;
            * for example 'serviceusage.googleapis.com/billing-enabled'.
        +   *
            * For Google APIs, a Terms of Service requirement must be included here.
            * Google Cloud APIs must include "serviceusage.googleapis.com/tos/cloud".
            * Other Google APIs should include
        @@ -42,6 +46,7 @@ public interface UsageOrBuilder
            * @return A list containing the requirements.
            */
           java.util.List getRequirementsList();
        +
           /**
            *
            *
        @@ -49,6 +54,7 @@ public interface UsageOrBuilder
            * Requirements that must be satisfied before a consumer project can use the
            * service. Each requirement is of the form <service.name>/<requirement-id>;
            * for example 'serviceusage.googleapis.com/billing-enabled'.
        +   *
            * For Google APIs, a Terms of Service requirement must be included here.
            * Google Cloud APIs must include "serviceusage.googleapis.com/tos/cloud".
            * Other Google APIs should include
        @@ -61,6 +67,7 @@ public interface UsageOrBuilder
            * @return The count of requirements.
            */
           int getRequirementsCount();
        +
           /**
            *
            *
        @@ -68,6 +75,7 @@ public interface UsageOrBuilder
            * Requirements that must be satisfied before a consumer project can use the
            * service. Each requirement is of the form <service.name>/<requirement-id>;
            * for example 'serviceusage.googleapis.com/billing-enabled'.
        +   *
            * For Google APIs, a Terms of Service requirement must be included here.
            * Google Cloud APIs must include "serviceusage.googleapis.com/tos/cloud".
            * Other Google APIs should include
        @@ -81,6 +89,7 @@ public interface UsageOrBuilder
            * @return The requirements at the given index.
            */
           java.lang.String getRequirements(int index);
        +
           /**
            *
            *
        @@ -88,6 +97,7 @@ public interface UsageOrBuilder
            * Requirements that must be satisfied before a consumer project can use the
            * service. Each requirement is of the form <service.name>/<requirement-id>;
            * for example 'serviceusage.googleapis.com/billing-enabled'.
        +   *
            * For Google APIs, a Terms of Service requirement must be included here.
            * Google Cloud APIs must include "serviceusage.googleapis.com/tos/cloud".
            * Other Google APIs should include
        @@ -107,50 +117,59 @@ public interface UsageOrBuilder
            *
            * 
            * A list of usage rules that apply to individual API methods.
        +   *
            * **NOTE:** All service configuration rules follow "last one wins" order.
            * 
        * * repeated .google.api.UsageRule rules = 6; */ java.util.List getRulesList(); + /** * * *
            * A list of usage rules that apply to individual API methods.
        +   *
            * **NOTE:** All service configuration rules follow "last one wins" order.
            * 
        * * repeated .google.api.UsageRule rules = 6; */ com.google.api.UsageRule getRules(int index); + /** * * *
            * A list of usage rules that apply to individual API methods.
        +   *
            * **NOTE:** All service configuration rules follow "last one wins" order.
            * 
        * * repeated .google.api.UsageRule rules = 6; */ int getRulesCount(); + /** * * *
            * A list of usage rules that apply to individual API methods.
        +   *
            * **NOTE:** All service configuration rules follow "last one wins" order.
            * 
        * * repeated .google.api.UsageRule rules = 6; */ java.util.List getRulesOrBuilderList(); + /** * * *
            * A list of usage rules that apply to individual API methods.
        +   *
            * **NOTE:** All service configuration rules follow "last one wins" order.
            * 
        * @@ -164,6 +183,7 @@ public interface UsageOrBuilder *
            * The full resource name of a channel used for sending notifications to the
            * service producer.
        +   *
            * Google Service Management currently only supports
            * [Google Cloud Pub/Sub](https://cloud.google.com/pubsub) as a notification
            * channel. To use Google Cloud Pub/Sub as the channel, this must be the name
        @@ -176,12 +196,14 @@ public interface UsageOrBuilder
            * @return The producerNotificationChannel.
            */
           java.lang.String getProducerNotificationChannel();
        +
           /**
            *
            *
            * 
            * The full resource name of a channel used for sending notifications to the
            * service producer.
        +   *
            * Google Service Management currently only supports
            * [Google Cloud Pub/Sub](https://cloud.google.com/pubsub) as a notification
            * channel. To use Google Cloud Pub/Sub as the channel, this must be the name
        diff --git a/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/UsageProto.java b/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/UsageProto.java
        index 07163a828c..f932fcfca0 100644
        --- a/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/UsageProto.java
        +++ b/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/UsageProto.java
        @@ -1,5 +1,5 @@
         /*
        - * Copyright 2020 Google LLC
        + * Copyright 2026 Google LLC
          *
          * Licensed under the Apache License, Version 2.0 (the "License");
          * you may not use this file except in compliance with the License.
        @@ -14,13 +14,26 @@
          * limitations under the License.
          */
         // Generated by the protocol buffer compiler.  DO NOT EDIT!
        +// NO CHECKED-IN PROTOBUF GENCODE
         // source: google/api/usage.proto
        +// Protobuf Java Version: 4.33.2
         
         package com.google.api;
         
        -public final class UsageProto {
        +@com.google.protobuf.Generated
        +public final class UsageProto extends com.google.protobuf.GeneratedFile {
           private UsageProto() {}
         
        +  static {
        +    com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion(
        +        com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC,
        +        /* major= */ 4,
        +        /* minor= */ 33,
        +        /* patch= */ 2,
        +        /* suffix= */ "",
        +        "UsageProto");
        +  }
        +
           public static void registerAllExtensions(com.google.protobuf.ExtensionRegistryLite registry) {}
         
           public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry registry) {
        @@ -29,11 +42,11 @@ public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry r
         
           static final com.google.protobuf.Descriptors.Descriptor
               internal_static_google_api_Usage_descriptor;
        -  static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
        +  static final com.google.protobuf.GeneratedMessage.FieldAccessorTable
               internal_static_google_api_Usage_fieldAccessorTable;
           static final com.google.protobuf.Descriptors.Descriptor
               internal_static_google_api_UsageRule_descriptor;
        -  static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
        +  static final com.google.protobuf.GeneratedMessage.FieldAccessorTable
               internal_static_google_api_UsageRule_fieldAccessorTable;
         
           public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() {
        @@ -57,20 +70,21 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() {
             descriptor =
                 com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom(
                     descriptorData, new com.google.protobuf.Descriptors.FileDescriptor[] {});
        -    internal_static_google_api_Usage_descriptor = getDescriptor().getMessageTypes().get(0);
        +    internal_static_google_api_Usage_descriptor = getDescriptor().getMessageType(0);
             internal_static_google_api_Usage_fieldAccessorTable =
        -        new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
        +        new com.google.protobuf.GeneratedMessage.FieldAccessorTable(
                     internal_static_google_api_Usage_descriptor,
                     new java.lang.String[] {
                       "Requirements", "Rules", "ProducerNotificationChannel",
                     });
        -    internal_static_google_api_UsageRule_descriptor = getDescriptor().getMessageTypes().get(1);
        +    internal_static_google_api_UsageRule_descriptor = getDescriptor().getMessageType(1);
             internal_static_google_api_UsageRule_fieldAccessorTable =
        -        new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
        +        new com.google.protobuf.GeneratedMessage.FieldAccessorTable(
                     internal_static_google_api_UsageRule_descriptor,
                     new java.lang.String[] {
                       "Selector", "AllowUnregisteredCalls", "SkipServiceControl",
                     });
        +    descriptor.resolveAllFeaturesImmutable();
           }
         
           // @@protoc_insertion_point(outer_class_scope)
        diff --git a/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/UsageRule.java b/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/UsageRule.java
        index 4bcca4d312..d011c39799 100644
        --- a/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/UsageRule.java
        +++ b/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/UsageRule.java
        @@ -1,5 +1,5 @@
         /*
        - * Copyright 2020 Google LLC
        + * Copyright 2026 Google LLC
          *
          * Licensed under the Apache License, Version 2.0 (the "License");
          * you may not use this file except in compliance with the License.
        @@ -14,7 +14,9 @@
          * limitations under the License.
          */
         // Generated by the protocol buffer compiler.  DO NOT EDIT!
        +// NO CHECKED-IN PROTOBUF GENCODE
         // source: google/api/usage.proto
        +// Protobuf Java Version: 4.33.2
         
         package com.google.api;
         
        @@ -23,34 +25,53 @@
          *
          * 
          * Usage configuration rules for the service.
        + *
          * NOTE: Under development.
        + *
        + *
          * Use this rule to configure unregistered calls for the service. Unregistered
          * calls are calls that do not contain consumer project identity.
          * (Example: calls that do not contain an API key).
          * By default, API methods do not allow unregistered calls, and each method call
          * must be identified by a consumer project identity. Use this rule to
          * allow/disallow unregistered calls.
        + *
          * Example of an API that wants to allow unregistered calls for entire service.
        - *     usage:
        - *       rules:
        - *       - selector: "*"
        - *         allow_unregistered_calls: true
        + *
        + * usage:
        + * rules:
        + * - selector: "*"
        + * allow_unregistered_calls: true
        + *
          * Example of a method that wants to allow unregistered calls.
        - *     usage:
        - *       rules:
        - *       - selector: "google.example.library.v1.LibraryService.CreateBook"
        - *         allow_unregistered_calls: true
        + *
        + * usage:
        + * rules:
        + * - selector: "google.example.library.v1.LibraryService.CreateBook"
        + * allow_unregistered_calls: true
          * 
        * * Protobuf type {@code google.api.UsageRule} */ -public final class UsageRule extends com.google.protobuf.GeneratedMessageV3 +@com.google.protobuf.Generated +public final class UsageRule extends com.google.protobuf.GeneratedMessage implements // @@protoc_insertion_point(message_implements:google.api.UsageRule) UsageRuleOrBuilder { private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "UsageRule"); + } + // Use UsageRule.newBuilder() to construct. - private UsageRule(com.google.protobuf.GeneratedMessageV3.Builder builder) { + private UsageRule(com.google.protobuf.GeneratedMessage.Builder builder) { super(builder); } @@ -58,23 +79,12 @@ private UsageRule() { selector_ = ""; } - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new UsageRule(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.api.UsageProto.internal_static_google_api_UsageRule_descriptor; } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.api.UsageProto.internal_static_google_api_UsageRule_fieldAccessorTable .ensureFieldAccessorsInitialized( @@ -82,14 +92,19 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } public static final int SELECTOR_FIELD_NUMBER = 1; - private volatile java.lang.Object selector_; + + @SuppressWarnings("serial") + private volatile java.lang.Object selector_ = ""; + /** * * *
            * Selects the methods to which this rule applies. Use '*' to indicate all
            * methods in all APIs.
        -   * Refer to [selector][google.api.DocumentationRule.selector] for syntax details.
        +   *
        +   * Refer to [selector][google.api.DocumentationRule.selector] for syntax
        +   * details.
            * 
        * * string selector = 1; @@ -108,13 +123,16 @@ public java.lang.String getSelector() { return s; } } + /** * * *
            * Selects the methods to which this rule applies. Use '*' to indicate all
            * methods in all APIs.
        -   * Refer to [selector][google.api.DocumentationRule.selector] for syntax details.
        +   *
        +   * Refer to [selector][google.api.DocumentationRule.selector] for syntax
        +   * details.
            * 
        * * string selector = 1; @@ -135,7 +153,8 @@ public com.google.protobuf.ByteString getSelectorBytes() { } public static final int ALLOW_UNREGISTERED_CALLS_FIELD_NUMBER = 2; - private boolean allowUnregisteredCalls_; + private boolean allowUnregisteredCalls_ = false; + /** * * @@ -154,7 +173,8 @@ public boolean getAllowUnregisteredCalls() { } public static final int SKIP_SERVICE_CONTROL_FIELD_NUMBER = 3; - private boolean skipServiceControl_; + private boolean skipServiceControl_ = false; + /** * * @@ -188,8 +208,8 @@ public final boolean isInitialized() { @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(selector_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, selector_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(selector_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, selector_); } if (allowUnregisteredCalls_ != false) { output.writeBool(2, allowUnregisteredCalls_); @@ -206,8 +226,8 @@ public int getSerializedSize() { if (size != -1) return size; size = 0; - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(selector_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, selector_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(selector_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, selector_); } if (allowUnregisteredCalls_ != false) { size += com.google.protobuf.CodedOutputStream.computeBoolSize(2, allowUnregisteredCalls_); @@ -291,38 +311,38 @@ public static com.google.api.UsageRule parseFrom( public static com.google.api.UsageRule parseFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); } public static com.google.api.UsageRule parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } public static com.google.api.UsageRule parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); } public static com.google.api.UsageRule parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( PARSER, input, extensionRegistry); } public static com.google.api.UsageRule parseFrom(com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); } public static com.google.api.UsageRule parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } @@ -345,37 +365,45 @@ public Builder toBuilder() { } @java.lang.Override - protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { Builder builder = new Builder(parent); return builder; } + /** * * *
            * Usage configuration rules for the service.
        +   *
            * NOTE: Under development.
        +   *
        +   *
            * Use this rule to configure unregistered calls for the service. Unregistered
            * calls are calls that do not contain consumer project identity.
            * (Example: calls that do not contain an API key).
            * By default, API methods do not allow unregistered calls, and each method call
            * must be identified by a consumer project identity. Use this rule to
            * allow/disallow unregistered calls.
        +   *
            * Example of an API that wants to allow unregistered calls for entire service.
        -   *     usage:
        -   *       rules:
        -   *       - selector: "*"
        -   *         allow_unregistered_calls: true
        +   *
        +   * usage:
        +   * rules:
        +   * - selector: "*"
        +   * allow_unregistered_calls: true
        +   *
            * Example of a method that wants to allow unregistered calls.
        -   *     usage:
        -   *       rules:
        -   *       - selector: "google.example.library.v1.LibraryService.CreateBook"
        -   *         allow_unregistered_calls: true
        +   *
        +   * usage:
        +   * rules:
        +   * - selector: "google.example.library.v1.LibraryService.CreateBook"
        +   * allow_unregistered_calls: true
            * 
        * * Protobuf type {@code google.api.UsageRule} */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder implements // @@protoc_insertion_point(builder_implements:google.api.UsageRule) com.google.api.UsageRuleOrBuilder { @@ -384,7 +412,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.api.UsageProto.internal_static_google_api_UsageRule_fieldAccessorTable .ensureFieldAccessorsInitialized( @@ -394,19 +422,17 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { // Construct using com.google.api.UsageRule.newBuilder() private Builder() {} - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { super(parent); } @java.lang.Override public Builder clear() { super.clear(); + bitField0_ = 0; selector_ = ""; - allowUnregisteredCalls_ = false; - skipServiceControl_ = false; - return this; } @@ -432,44 +458,24 @@ public com.google.api.UsageRule build() { @java.lang.Override public com.google.api.UsageRule buildPartial() { com.google.api.UsageRule result = new com.google.api.UsageRule(this); - result.selector_ = selector_; - result.allowUnregisteredCalls_ = allowUnregisteredCalls_; - result.skipServiceControl_ = skipServiceControl_; + if (bitField0_ != 0) { + buildPartial0(result); + } 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); + private void buildPartial0(com.google.api.UsageRule result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.selector_ = selector_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.allowUnregisteredCalls_ = allowUnregisteredCalls_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.skipServiceControl_ = skipServiceControl_; + } } @java.lang.Override @@ -486,6 +492,7 @@ public Builder mergeFrom(com.google.api.UsageRule other) { if (other == com.google.api.UsageRule.getDefaultInstance()) return this; if (!other.getSelector().isEmpty()) { selector_ = other.selector_; + bitField0_ |= 0x00000001; onChanged(); } if (other.getAllowUnregisteredCalls() != false) { @@ -523,19 +530,19 @@ public Builder mergeFrom( case 10: { selector_ = input.readStringRequireUtf8(); - + bitField0_ |= 0x00000001; break; } // case 10 case 16: { allowUnregisteredCalls_ = input.readBool(); - + bitField0_ |= 0x00000002; break; } // case 16 case 24: { skipServiceControl_ = input.readBool(); - + bitField0_ |= 0x00000004; break; } // case 24 default: @@ -555,14 +562,19 @@ public Builder mergeFrom( return this; } + private int bitField0_; + private java.lang.Object selector_ = ""; + /** * * *
              * Selects the methods to which this rule applies. Use '*' to indicate all
              * methods in all APIs.
        -     * Refer to [selector][google.api.DocumentationRule.selector] for syntax details.
        +     *
        +     * Refer to [selector][google.api.DocumentationRule.selector] for syntax
        +     * details.
              * 
        * * string selector = 1; @@ -580,13 +592,16 @@ public java.lang.String getSelector() { return (java.lang.String) ref; } } + /** * * *
              * Selects the methods to which this rule applies. Use '*' to indicate all
              * methods in all APIs.
        -     * Refer to [selector][google.api.DocumentationRule.selector] for syntax details.
        +     *
        +     * Refer to [selector][google.api.DocumentationRule.selector] for syntax
        +     * details.
              * 
        * * string selector = 1; @@ -604,13 +619,16 @@ public com.google.protobuf.ByteString getSelectorBytes() { return (com.google.protobuf.ByteString) ref; } } + /** * * *
              * Selects the methods to which this rule applies. Use '*' to indicate all
              * methods in all APIs.
        -     * Refer to [selector][google.api.DocumentationRule.selector] for syntax details.
        +     *
        +     * Refer to [selector][google.api.DocumentationRule.selector] for syntax
        +     * details.
              * 
        * * string selector = 1; @@ -622,18 +640,21 @@ public Builder setSelector(java.lang.String value) { if (value == null) { throw new NullPointerException(); } - selector_ = value; + bitField0_ |= 0x00000001; onChanged(); return this; } + /** * * *
              * Selects the methods to which this rule applies. Use '*' to indicate all
              * methods in all APIs.
        -     * Refer to [selector][google.api.DocumentationRule.selector] for syntax details.
        +     *
        +     * Refer to [selector][google.api.DocumentationRule.selector] for syntax
        +     * details.
              * 
        * * string selector = 1; @@ -641,18 +662,21 @@ public Builder setSelector(java.lang.String value) { * @return This builder for chaining. */ public Builder clearSelector() { - selector_ = getDefaultInstance().getSelector(); + bitField0_ = (bitField0_ & ~0x00000001); onChanged(); return this; } + /** * * *
              * Selects the methods to which this rule applies. Use '*' to indicate all
              * methods in all APIs.
        -     * Refer to [selector][google.api.DocumentationRule.selector] for syntax details.
        +     *
        +     * Refer to [selector][google.api.DocumentationRule.selector] for syntax
        +     * details.
              * 
        * * string selector = 1; @@ -665,13 +689,14 @@ public Builder setSelectorBytes(com.google.protobuf.ByteString value) { throw new NullPointerException(); } checkByteStringIsUtf8(value); - selector_ = value; + bitField0_ |= 0x00000001; onChanged(); return this; } private boolean allowUnregisteredCalls_; + /** * * @@ -688,6 +713,7 @@ public Builder setSelectorBytes(com.google.protobuf.ByteString value) { public boolean getAllowUnregisteredCalls() { return allowUnregisteredCalls_; } + /** * * @@ -704,9 +730,11 @@ public boolean getAllowUnregisteredCalls() { public Builder setAllowUnregisteredCalls(boolean value) { allowUnregisteredCalls_ = value; + bitField0_ |= 0x00000002; onChanged(); return this; } + /** * * @@ -720,13 +748,14 @@ public Builder setAllowUnregisteredCalls(boolean value) { * @return This builder for chaining. */ public Builder clearAllowUnregisteredCalls() { - + bitField0_ = (bitField0_ & ~0x00000002); allowUnregisteredCalls_ = false; onChanged(); return this; } private boolean skipServiceControl_; + /** * * @@ -745,6 +774,7 @@ public Builder clearAllowUnregisteredCalls() { public boolean getSkipServiceControl() { return skipServiceControl_; } + /** * * @@ -763,9 +793,11 @@ public boolean getSkipServiceControl() { public Builder setSkipServiceControl(boolean value) { skipServiceControl_ = value; + bitField0_ |= 0x00000004; onChanged(); return this; } + /** * * @@ -781,23 +813,12 @@ public Builder setSkipServiceControl(boolean value) { * @return This builder for chaining. */ public Builder clearSkipServiceControl() { - + bitField0_ = (bitField0_ & ~0x00000004); skipServiceControl_ = false; onChanged(); return this; } - @java.lang.Override - public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - // @@protoc_insertion_point(builder_scope:google.api.UsageRule) } diff --git a/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/UsageRuleOrBuilder.java b/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/UsageRuleOrBuilder.java index f3c9487787..71a6dedd1e 100644 --- a/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/UsageRuleOrBuilder.java +++ b/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/UsageRuleOrBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,10 +14,13 @@ * limitations under the License. */ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: google/api/usage.proto +// Protobuf Java Version: 4.33.2 package com.google.api; +@com.google.protobuf.Generated public interface UsageRuleOrBuilder extends // @@protoc_insertion_point(interface_extends:google.api.UsageRule) @@ -29,7 +32,9 @@ public interface UsageRuleOrBuilder *
            * Selects the methods to which this rule applies. Use '*' to indicate all
            * methods in all APIs.
        -   * Refer to [selector][google.api.DocumentationRule.selector] for syntax details.
        +   *
        +   * Refer to [selector][google.api.DocumentationRule.selector] for syntax
        +   * details.
            * 
        * * string selector = 1; @@ -37,13 +42,16 @@ public interface UsageRuleOrBuilder * @return The selector. */ java.lang.String getSelector(); + /** * * *
            * Selects the methods to which this rule applies. Use '*' to indicate all
            * methods in all APIs.
        -   * Refer to [selector][google.api.DocumentationRule.selector] for syntax details.
        +   *
        +   * Refer to [selector][google.api.DocumentationRule.selector] for syntax
        +   * details.
            * 
        * * string selector = 1; diff --git a/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/Visibility.java b/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/Visibility.java index 328a2c1d58..938761f2a1 100644 --- a/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/Visibility.java +++ b/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/Visibility.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,9 @@ * limitations under the License. */ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: google/api/visibility.proto +// Protobuf Java Version: 4.33.2 package com.google.api; @@ -26,31 +28,48 @@ * such as whether an application can call a visibility-restricted method. * The restriction is expressed by applying visibility labels on service * elements. The visibility labels are elsewhere linked to service consumers. + * * A service can define multiple visibility labels, but a service consumer * should be granted at most one visibility label. Multiple visibility * labels for a single service consumer are not supported. + * * If an element and all its parents have no visibility label, its visibility * is unconditionally granted. + * * Example: - * visibility: - * rules: - * - selector: google.calendar.Calendar.EnhancedSearch - * restriction: PREVIEW - * - selector: google.calendar.Calendar.Delegate - * restriction: INTERNAL + * + * visibility: + * rules: + * - selector: google.calendar.Calendar.EnhancedSearch + * restriction: PREVIEW + * - selector: google.calendar.Calendar.Delegate + * restriction: INTERNAL + * * Here, all methods are publicly visible except for the restricted methods * EnhancedSearch and Delegate. *
        * * Protobuf type {@code google.api.Visibility} */ -public final class Visibility extends com.google.protobuf.GeneratedMessageV3 +@com.google.protobuf.Generated +public final class Visibility extends com.google.protobuf.GeneratedMessage implements // @@protoc_insertion_point(message_implements:google.api.Visibility) VisibilityOrBuilder { private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "Visibility"); + } + // Use Visibility.newBuilder() to construct. - private Visibility(com.google.protobuf.GeneratedMessageV3.Builder builder) { + private Visibility(com.google.protobuf.GeneratedMessage.Builder builder) { super(builder); } @@ -58,23 +77,12 @@ private Visibility() { rules_ = java.util.Collections.emptyList(); } - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new Visibility(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.api.VisibilityProto.internal_static_google_api_Visibility_descriptor; } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.api.VisibilityProto.internal_static_google_api_Visibility_fieldAccessorTable .ensureFieldAccessorsInitialized( @@ -82,12 +90,16 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } public static final int RULES_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") private java.util.List rules_; + /** * * *
            * A list of visibility rules that apply to individual API elements.
        +   *
            * **NOTE:** All service configuration rules follow "last one wins" order.
            * 
        * @@ -97,11 +109,13 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { public java.util.List getRulesList() { return rules_; } + /** * * *
            * A list of visibility rules that apply to individual API elements.
        +   *
            * **NOTE:** All service configuration rules follow "last one wins" order.
            * 
        * @@ -111,11 +125,13 @@ public java.util.List getRulesList() { public java.util.List getRulesOrBuilderList() { return rules_; } + /** * * *
            * A list of visibility rules that apply to individual API elements.
        +   *
            * **NOTE:** All service configuration rules follow "last one wins" order.
            * 
        * @@ -125,11 +141,13 @@ public java.util.List getRules public int getRulesCount() { return rules_.size(); } + /** * * *
            * A list of visibility rules that apply to individual API elements.
        +   *
            * **NOTE:** All service configuration rules follow "last one wins" order.
            * 
        * @@ -139,11 +157,13 @@ public int getRulesCount() { public com.google.api.VisibilityRule getRules(int index) { return rules_.get(index); } + /** * * *
            * A list of visibility rules that apply to individual API elements.
        +   *
            * **NOTE:** All service configuration rules follow "last one wins" order.
            * 
        * @@ -255,38 +275,38 @@ public static com.google.api.Visibility parseFrom( public static com.google.api.Visibility parseFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); } public static com.google.api.Visibility parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } public static com.google.api.Visibility parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); } public static com.google.api.Visibility parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( PARSER, input, extensionRegistry); } public static com.google.api.Visibility parseFrom(com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); } public static com.google.api.Visibility parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } @@ -309,10 +329,11 @@ public Builder toBuilder() { } @java.lang.Override - protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { Builder builder = new Builder(parent); return builder; } + /** * * @@ -321,25 +342,30 @@ protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.Build * such as whether an application can call a visibility-restricted method. * The restriction is expressed by applying visibility labels on service * elements. The visibility labels are elsewhere linked to service consumers. + * * A service can define multiple visibility labels, but a service consumer * should be granted at most one visibility label. Multiple visibility * labels for a single service consumer are not supported. + * * If an element and all its parents have no visibility label, its visibility * is unconditionally granted. + * * Example: - * visibility: - * rules: - * - selector: google.calendar.Calendar.EnhancedSearch - * restriction: PREVIEW - * - selector: google.calendar.Calendar.Delegate - * restriction: INTERNAL + * + * visibility: + * rules: + * - selector: google.calendar.Calendar.EnhancedSearch + * restriction: PREVIEW + * - selector: google.calendar.Calendar.Delegate + * restriction: INTERNAL + * * Here, all methods are publicly visible except for the restricted methods * EnhancedSearch and Delegate. *
        * * Protobuf type {@code google.api.Visibility} */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder implements // @@protoc_insertion_point(builder_implements:google.api.Visibility) com.google.api.VisibilityOrBuilder { @@ -348,7 +374,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.api.VisibilityProto.internal_static_google_api_Visibility_fieldAccessorTable .ensureFieldAccessorsInitialized( @@ -358,13 +384,14 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { // Construct using com.google.api.Visibility.newBuilder() private Builder() {} - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { super(parent); } @java.lang.Override public Builder clear() { super.clear(); + bitField0_ = 0; if (rulesBuilder_ == null) { rules_ = java.util.Collections.emptyList(); } else { @@ -397,7 +424,15 @@ public com.google.api.Visibility build() { @java.lang.Override public com.google.api.Visibility buildPartial() { com.google.api.Visibility result = new com.google.api.Visibility(this); - int from_bitField0_ = bitField0_; + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields(com.google.api.Visibility result) { if (rulesBuilder_ == null) { if (((bitField0_ & 0x00000001) != 0)) { rules_ = java.util.Collections.unmodifiableList(rules_); @@ -407,41 +442,10 @@ public com.google.api.Visibility buildPartial() { } else { result.rules_ = rulesBuilder_.build(); } - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.setField(field, value); - } - - @java.lang.Override - public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); } - @java.lang.Override - public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.addRepeatedField(field, value); + private void buildPartial0(com.google.api.Visibility result) { + int from_bitField0_ = bitField0_; } @java.lang.Override @@ -475,8 +479,8 @@ public Builder mergeFrom(com.google.api.Visibility other) { rules_ = other.rules_; bitField0_ = (bitField0_ & ~0x00000001); rulesBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders - ? getRulesFieldBuilder() + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders + ? internalGetRulesFieldBuilder() : null; } else { rulesBuilder_.addAllMessages(other.rules_); @@ -550,7 +554,7 @@ private void ensureRulesIsMutable() { } } - private com.google.protobuf.RepeatedFieldBuilderV3< + private com.google.protobuf.RepeatedFieldBuilder< com.google.api.VisibilityRule, com.google.api.VisibilityRule.Builder, com.google.api.VisibilityRuleOrBuilder> @@ -561,6 +565,7 @@ private void ensureRulesIsMutable() { * *
              * A list of visibility rules that apply to individual API elements.
        +     *
              * **NOTE:** All service configuration rules follow "last one wins" order.
              * 
        * @@ -573,11 +578,13 @@ public java.util.List getRulesList() { return rulesBuilder_.getMessageList(); } } + /** * * *
              * A list of visibility rules that apply to individual API elements.
        +     *
              * **NOTE:** All service configuration rules follow "last one wins" order.
              * 
        * @@ -590,11 +597,13 @@ public int getRulesCount() { return rulesBuilder_.getCount(); } } + /** * * *
              * A list of visibility rules that apply to individual API elements.
        +     *
              * **NOTE:** All service configuration rules follow "last one wins" order.
              * 
        * @@ -607,11 +616,13 @@ public com.google.api.VisibilityRule getRules(int index) { return rulesBuilder_.getMessage(index); } } + /** * * *
              * A list of visibility rules that apply to individual API elements.
        +     *
              * **NOTE:** All service configuration rules follow "last one wins" order.
              * 
        * @@ -630,11 +641,13 @@ public Builder setRules(int index, com.google.api.VisibilityRule value) { } return this; } + /** * * *
              * A list of visibility rules that apply to individual API elements.
        +     *
              * **NOTE:** All service configuration rules follow "last one wins" order.
              * 
        * @@ -650,11 +663,13 @@ public Builder setRules(int index, com.google.api.VisibilityRule.Builder builder } return this; } + /** * * *
              * A list of visibility rules that apply to individual API elements.
        +     *
              * **NOTE:** All service configuration rules follow "last one wins" order.
              * 
        * @@ -673,11 +688,13 @@ public Builder addRules(com.google.api.VisibilityRule value) { } return this; } + /** * * *
              * A list of visibility rules that apply to individual API elements.
        +     *
              * **NOTE:** All service configuration rules follow "last one wins" order.
              * 
        * @@ -696,11 +713,13 @@ public Builder addRules(int index, com.google.api.VisibilityRule value) { } return this; } + /** * * *
              * A list of visibility rules that apply to individual API elements.
        +     *
              * **NOTE:** All service configuration rules follow "last one wins" order.
              * 
        * @@ -716,11 +735,13 @@ public Builder addRules(com.google.api.VisibilityRule.Builder builderForValue) { } return this; } + /** * * *
              * A list of visibility rules that apply to individual API elements.
        +     *
              * **NOTE:** All service configuration rules follow "last one wins" order.
              * 
        * @@ -736,11 +757,13 @@ public Builder addRules(int index, com.google.api.VisibilityRule.Builder builder } return this; } + /** * * *
              * A list of visibility rules that apply to individual API elements.
        +     *
              * **NOTE:** All service configuration rules follow "last one wins" order.
              * 
        * @@ -756,11 +779,13 @@ public Builder addAllRules(java.lang.Iterable * A list of visibility rules that apply to individual API elements. + * * **NOTE:** All service configuration rules follow "last one wins" order. *
        * @@ -776,11 +801,13 @@ public Builder clearRules() { } return this; } + /** * * *
              * A list of visibility rules that apply to individual API elements.
        +     *
              * **NOTE:** All service configuration rules follow "last one wins" order.
              * 
        * @@ -796,24 +823,28 @@ public Builder removeRules(int index) { } return this; } + /** * * *
              * A list of visibility rules that apply to individual API elements.
        +     *
              * **NOTE:** All service configuration rules follow "last one wins" order.
              * 
        * * repeated .google.api.VisibilityRule rules = 1; */ public com.google.api.VisibilityRule.Builder getRulesBuilder(int index) { - return getRulesFieldBuilder().getBuilder(index); + return internalGetRulesFieldBuilder().getBuilder(index); } + /** * * *
              * A list of visibility rules that apply to individual API elements.
        +     *
              * **NOTE:** All service configuration rules follow "last one wins" order.
              * 
        * @@ -826,11 +857,13 @@ public com.google.api.VisibilityRuleOrBuilder getRulesOrBuilder(int index) { return rulesBuilder_.getMessageOrBuilder(index); } } + /** * * *
              * A list of visibility rules that apply to individual API elements.
        +     *
              * **NOTE:** All service configuration rules follow "last one wins" order.
              * 
        * @@ -844,55 +877,62 @@ public com.google.api.VisibilityRuleOrBuilder getRulesOrBuilder(int index) { return java.util.Collections.unmodifiableList(rules_); } } + /** * * *
              * A list of visibility rules that apply to individual API elements.
        +     *
              * **NOTE:** All service configuration rules follow "last one wins" order.
              * 
        * * repeated .google.api.VisibilityRule rules = 1; */ public com.google.api.VisibilityRule.Builder addRulesBuilder() { - return getRulesFieldBuilder().addBuilder(com.google.api.VisibilityRule.getDefaultInstance()); + return internalGetRulesFieldBuilder() + .addBuilder(com.google.api.VisibilityRule.getDefaultInstance()); } + /** * * *
              * A list of visibility rules that apply to individual API elements.
        +     *
              * **NOTE:** All service configuration rules follow "last one wins" order.
              * 
        * * repeated .google.api.VisibilityRule rules = 1; */ public com.google.api.VisibilityRule.Builder addRulesBuilder(int index) { - return getRulesFieldBuilder() + return internalGetRulesFieldBuilder() .addBuilder(index, com.google.api.VisibilityRule.getDefaultInstance()); } + /** * * *
              * A list of visibility rules that apply to individual API elements.
        +     *
              * **NOTE:** All service configuration rules follow "last one wins" order.
              * 
        * * repeated .google.api.VisibilityRule rules = 1; */ public java.util.List getRulesBuilderList() { - return getRulesFieldBuilder().getBuilderList(); + return internalGetRulesFieldBuilder().getBuilderList(); } - private com.google.protobuf.RepeatedFieldBuilderV3< + private com.google.protobuf.RepeatedFieldBuilder< com.google.api.VisibilityRule, com.google.api.VisibilityRule.Builder, com.google.api.VisibilityRuleOrBuilder> - getRulesFieldBuilder() { + internalGetRulesFieldBuilder() { if (rulesBuilder_ == null) { rulesBuilder_ = - new com.google.protobuf.RepeatedFieldBuilderV3< + new com.google.protobuf.RepeatedFieldBuilder< com.google.api.VisibilityRule, com.google.api.VisibilityRule.Builder, com.google.api.VisibilityRuleOrBuilder>( @@ -902,17 +942,6 @@ public java.util.List getRulesBuilderList return rulesBuilder_; } - @java.lang.Override - public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - // @@protoc_insertion_point(builder_scope:google.api.Visibility) } diff --git a/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/VisibilityOrBuilder.java b/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/VisibilityOrBuilder.java index 40544aa4bb..a5e8d99090 100644 --- a/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/VisibilityOrBuilder.java +++ b/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/VisibilityOrBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,10 +14,13 @@ * limitations under the License. */ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: google/api/visibility.proto +// Protobuf Java Version: 4.33.2 package com.google.api; +@com.google.protobuf.Generated public interface VisibilityOrBuilder extends // @@protoc_insertion_point(interface_extends:google.api.Visibility) @@ -28,50 +31,59 @@ public interface VisibilityOrBuilder * *
            * A list of visibility rules that apply to individual API elements.
        +   *
            * **NOTE:** All service configuration rules follow "last one wins" order.
            * 
        * * repeated .google.api.VisibilityRule rules = 1; */ java.util.List getRulesList(); + /** * * *
            * A list of visibility rules that apply to individual API elements.
        +   *
            * **NOTE:** All service configuration rules follow "last one wins" order.
            * 
        * * repeated .google.api.VisibilityRule rules = 1; */ com.google.api.VisibilityRule getRules(int index); + /** * * *
            * A list of visibility rules that apply to individual API elements.
        +   *
            * **NOTE:** All service configuration rules follow "last one wins" order.
            * 
        * * repeated .google.api.VisibilityRule rules = 1; */ int getRulesCount(); + /** * * *
            * A list of visibility rules that apply to individual API elements.
        +   *
            * **NOTE:** All service configuration rules follow "last one wins" order.
            * 
        * * repeated .google.api.VisibilityRule rules = 1; */ java.util.List getRulesOrBuilderList(); + /** * * *
            * A list of visibility rules that apply to individual API elements.
        +   *
            * **NOTE:** All service configuration rules follow "last one wins" order.
            * 
        * diff --git a/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/VisibilityProto.java b/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/VisibilityProto.java index aaa371cf61..aed907b7cd 100644 --- a/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/VisibilityProto.java +++ b/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/VisibilityProto.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,13 +14,26 @@ * limitations under the License. */ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: google/api/visibility.proto +// Protobuf Java Version: 4.33.2 package com.google.api; -public final class VisibilityProto { +@com.google.protobuf.Generated +public final class VisibilityProto extends com.google.protobuf.GeneratedFile { private VisibilityProto() {} + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "VisibilityProto"); + } + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistryLite registry) { registry.add(com.google.api.VisibilityProto.enumVisibility); registry.add(com.google.api.VisibilityProto.valueVisibility); @@ -35,6 +48,7 @@ public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry r } public static final int ENUM_VISIBILITY_FIELD_NUMBER = 72295727; + /** * * @@ -52,6 +66,7 @@ public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry r com.google.api.VisibilityRule.getDefaultInstance()); public static final int VALUE_VISIBILITY_FIELD_NUMBER = 72295727; + /** * * @@ -69,6 +84,7 @@ public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry r com.google.api.VisibilityRule.getDefaultInstance()); public static final int FIELD_VISIBILITY_FIELD_NUMBER = 72295727; + /** * * @@ -86,6 +102,7 @@ public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry r com.google.api.VisibilityRule.getDefaultInstance()); public static final int MESSAGE_VISIBILITY_FIELD_NUMBER = 72295727; + /** * * @@ -103,6 +120,7 @@ public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry r com.google.api.VisibilityRule.getDefaultInstance()); public static final int METHOD_VISIBILITY_FIELD_NUMBER = 72295727; + /** * * @@ -120,6 +138,7 @@ public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry r com.google.api.VisibilityRule.getDefaultInstance()); public static final int API_VISIBILITY_FIELD_NUMBER = 72295727; + /** * * @@ -138,11 +157,11 @@ public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry r static final com.google.protobuf.Descriptors.Descriptor internal_static_google_api_Visibility_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable internal_static_google_api_Visibility_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_google_api_VisibilityRule_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable internal_static_google_api_VisibilityRule_fieldAccessorTable; public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { @@ -171,10 +190,10 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + "\030\257\312\274\" \001(\0132\032.google.api.VisibilityRule:V\n" + "\016api_visibility\022\037.google.protobuf.Servic" + "eOptions\030\257\312\274\" \001(\0132\032.google.api.Visibilit" - + "yRuleBn\n\016com.google.apiB\017VisibilityProto" + + "yRuleBk\n\016com.google.apiB\017VisibilityProto" + "P\001Z?google.golang.org/genproto/googleapi" - + "s/api/visibility;visibility\370\001\001\242\002\004GAPIb\006p" - + "roto3" + + "s/api/visibility;visibility\242\002\004GAPIb\006prot" + + "o3" }; descriptor = com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( @@ -182,26 +201,27 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { new com.google.protobuf.Descriptors.FileDescriptor[] { com.google.protobuf.DescriptorProtos.getDescriptor(), }); - internal_static_google_api_Visibility_descriptor = getDescriptor().getMessageTypes().get(0); + internal_static_google_api_Visibility_descriptor = getDescriptor().getMessageType(0); internal_static_google_api_Visibility_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_google_api_Visibility_descriptor, new java.lang.String[] { "Rules", }); - internal_static_google_api_VisibilityRule_descriptor = getDescriptor().getMessageTypes().get(1); + internal_static_google_api_VisibilityRule_descriptor = getDescriptor().getMessageType(1); internal_static_google_api_VisibilityRule_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_google_api_VisibilityRule_descriptor, new java.lang.String[] { "Selector", "Restriction", }); - enumVisibility.internalInit(descriptor.getExtensions().get(0)); - valueVisibility.internalInit(descriptor.getExtensions().get(1)); - fieldVisibility.internalInit(descriptor.getExtensions().get(2)); - messageVisibility.internalInit(descriptor.getExtensions().get(3)); - methodVisibility.internalInit(descriptor.getExtensions().get(4)); - apiVisibility.internalInit(descriptor.getExtensions().get(5)); + enumVisibility.internalInit(descriptor.getExtension(0)); + valueVisibility.internalInit(descriptor.getExtension(1)); + fieldVisibility.internalInit(descriptor.getExtension(2)); + messageVisibility.internalInit(descriptor.getExtension(3)); + methodVisibility.internalInit(descriptor.getExtension(4)); + apiVisibility.internalInit(descriptor.getExtension(5)); + descriptor.resolveAllFeaturesImmutable(); com.google.protobuf.DescriptorProtos.getDescriptor(); } diff --git a/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/VisibilityRule.java b/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/VisibilityRule.java index b17af76f69..e9c7003d12 100644 --- a/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/VisibilityRule.java +++ b/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/VisibilityRule.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,9 @@ * limitations under the License. */ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: google/api/visibility.proto +// Protobuf Java Version: 4.33.2 package com.google.api; @@ -28,13 +30,25 @@ * * Protobuf type {@code google.api.VisibilityRule} */ -public final class VisibilityRule extends com.google.protobuf.GeneratedMessageV3 +@com.google.protobuf.Generated +public final class VisibilityRule extends com.google.protobuf.GeneratedMessage implements // @@protoc_insertion_point(message_implements:google.api.VisibilityRule) VisibilityRuleOrBuilder { private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "VisibilityRule"); + } + // Use VisibilityRule.newBuilder() to construct. - private VisibilityRule(com.google.protobuf.GeneratedMessageV3.Builder builder) { + private VisibilityRule(com.google.protobuf.GeneratedMessage.Builder builder) { super(builder); } @@ -43,23 +57,12 @@ private VisibilityRule() { restriction_ = ""; } - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new VisibilityRule(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.api.VisibilityProto.internal_static_google_api_VisibilityRule_descriptor; } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.api.VisibilityProto .internal_static_google_api_VisibilityRule_fieldAccessorTable @@ -68,12 +71,16 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } public static final int SELECTOR_FIELD_NUMBER = 1; - private volatile java.lang.Object selector_; + + @SuppressWarnings("serial") + private volatile java.lang.Object selector_ = ""; + /** * * *
            * Selects methods, messages, fields, enums, etc. to which this rule applies.
        +   *
            * Refer to [selector][google.api.DocumentationRule.selector] for syntax
            * details.
            * 
        @@ -94,11 +101,13 @@ public java.lang.String getSelector() { return s; } } + /** * * *
            * Selects methods, messages, fields, enums, etc. to which this rule applies.
        +   *
            * Refer to [selector][google.api.DocumentationRule.selector] for syntax
            * details.
            * 
        @@ -121,20 +130,27 @@ public com.google.protobuf.ByteString getSelectorBytes() { } public static final int RESTRICTION_FIELD_NUMBER = 2; - private volatile java.lang.Object restriction_; + + @SuppressWarnings("serial") + private volatile java.lang.Object restriction_ = ""; + /** * * *
            * A comma-separated list of visibility labels that apply to the `selector`.
            * Any of the listed labels can be used to grant the visibility.
        +   *
            * If a rule has multiple labels, removing one of the labels but not all of
            * them can break clients.
        +   *
            * Example:
        -   *     visibility:
        -   *       rules:
        -   *       - selector: google.calendar.Calendar.EnhancedSearch
        -   *         restriction: INTERNAL, PREVIEW
        +   *
        +   * visibility:
        +   * rules:
        +   * - selector: google.calendar.Calendar.EnhancedSearch
        +   * restriction: INTERNAL, PREVIEW
        +   *
            * Removing INTERNAL from this restriction will break clients that rely on
            * this method and only had access to it through INTERNAL.
            * 
        @@ -155,19 +171,24 @@ public java.lang.String getRestriction() { return s; } } + /** * * *
            * A comma-separated list of visibility labels that apply to the `selector`.
            * Any of the listed labels can be used to grant the visibility.
        +   *
            * If a rule has multiple labels, removing one of the labels but not all of
            * them can break clients.
        +   *
            * Example:
        -   *     visibility:
        -   *       rules:
        -   *       - selector: google.calendar.Calendar.EnhancedSearch
        -   *         restriction: INTERNAL, PREVIEW
        +   *
        +   * visibility:
        +   * rules:
        +   * - selector: google.calendar.Calendar.EnhancedSearch
        +   * restriction: INTERNAL, PREVIEW
        +   *
            * Removing INTERNAL from this restriction will break clients that rely on
            * this method and only had access to it through INTERNAL.
            * 
        @@ -203,11 +224,11 @@ public final boolean isInitialized() { @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(selector_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, selector_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(selector_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, selector_); } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(restriction_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 2, restriction_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(restriction_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, restriction_); } getUnknownFields().writeTo(output); } @@ -218,11 +239,11 @@ public int getSerializedSize() { if (size != -1) return size; size = 0; - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(selector_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, selector_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(selector_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, selector_); } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(restriction_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, restriction_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(restriction_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, restriction_); } size += getUnknownFields().getSerializedSize(); memoizedSize = size; @@ -297,38 +318,38 @@ public static com.google.api.VisibilityRule parseFrom( public static com.google.api.VisibilityRule parseFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); } public static com.google.api.VisibilityRule parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } public static com.google.api.VisibilityRule parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); } public static com.google.api.VisibilityRule parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( PARSER, input, extensionRegistry); } public static com.google.api.VisibilityRule parseFrom(com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); } public static com.google.api.VisibilityRule parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } @@ -351,10 +372,11 @@ public Builder toBuilder() { } @java.lang.Override - protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { Builder builder = new Builder(parent); return builder; } + /** * * @@ -365,7 +387,7 @@ protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.Build * * Protobuf type {@code google.api.VisibilityRule} */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder implements // @@protoc_insertion_point(builder_implements:google.api.VisibilityRule) com.google.api.VisibilityRuleOrBuilder { @@ -374,7 +396,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.api.VisibilityProto .internal_static_google_api_VisibilityRule_fieldAccessorTable @@ -385,17 +407,16 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { // Construct using com.google.api.VisibilityRule.newBuilder() private Builder() {} - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { super(parent); } @java.lang.Override public Builder clear() { super.clear(); + bitField0_ = 0; selector_ = ""; - restriction_ = ""; - return this; } @@ -421,43 +442,21 @@ public com.google.api.VisibilityRule build() { @java.lang.Override public com.google.api.VisibilityRule buildPartial() { com.google.api.VisibilityRule result = new com.google.api.VisibilityRule(this); - result.selector_ = selector_; - result.restriction_ = restriction_; + if (bitField0_ != 0) { + buildPartial0(result); + } 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); + private void buildPartial0(com.google.api.VisibilityRule result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.selector_ = selector_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.restriction_ = restriction_; + } } @java.lang.Override @@ -474,10 +473,12 @@ public Builder mergeFrom(com.google.api.VisibilityRule other) { if (other == com.google.api.VisibilityRule.getDefaultInstance()) return this; if (!other.getSelector().isEmpty()) { selector_ = other.selector_; + bitField0_ |= 0x00000001; onChanged(); } if (!other.getRestriction().isEmpty()) { restriction_ = other.restriction_; + bitField0_ |= 0x00000002; onChanged(); } this.mergeUnknownFields(other.getUnknownFields()); @@ -509,13 +510,13 @@ public Builder mergeFrom( case 10: { selector_ = input.readStringRequireUtf8(); - + bitField0_ |= 0x00000001; break; } // case 10 case 18: { restriction_ = input.readStringRequireUtf8(); - + bitField0_ |= 0x00000002; break; } // case 18 default: @@ -535,12 +536,16 @@ public Builder mergeFrom( return this; } + private int bitField0_; + private java.lang.Object selector_ = ""; + /** * * *
              * Selects methods, messages, fields, enums, etc. to which this rule applies.
        +     *
              * Refer to [selector][google.api.DocumentationRule.selector] for syntax
              * details.
              * 
        @@ -560,11 +565,13 @@ public java.lang.String getSelector() { return (java.lang.String) ref; } } + /** * * *
              * Selects methods, messages, fields, enums, etc. to which this rule applies.
        +     *
              * Refer to [selector][google.api.DocumentationRule.selector] for syntax
              * details.
              * 
        @@ -584,11 +591,13 @@ public com.google.protobuf.ByteString getSelectorBytes() { return (com.google.protobuf.ByteString) ref; } } + /** * * *
              * Selects methods, messages, fields, enums, etc. to which this rule applies.
        +     *
              * Refer to [selector][google.api.DocumentationRule.selector] for syntax
              * details.
              * 
        @@ -602,16 +611,18 @@ public Builder setSelector(java.lang.String value) { if (value == null) { throw new NullPointerException(); } - selector_ = value; + bitField0_ |= 0x00000001; onChanged(); return this; } + /** * * *
              * Selects methods, messages, fields, enums, etc. to which this rule applies.
        +     *
              * Refer to [selector][google.api.DocumentationRule.selector] for syntax
              * details.
              * 
        @@ -621,16 +632,18 @@ public Builder setSelector(java.lang.String value) { * @return This builder for chaining. */ public Builder clearSelector() { - selector_ = getDefaultInstance().getSelector(); + bitField0_ = (bitField0_ & ~0x00000001); onChanged(); return this; } + /** * * *
              * Selects methods, messages, fields, enums, etc. to which this rule applies.
        +     *
              * Refer to [selector][google.api.DocumentationRule.selector] for syntax
              * details.
              * 
        @@ -645,26 +658,31 @@ public Builder setSelectorBytes(com.google.protobuf.ByteString value) { throw new NullPointerException(); } checkByteStringIsUtf8(value); - selector_ = value; + bitField0_ |= 0x00000001; onChanged(); return this; } private java.lang.Object restriction_ = ""; + /** * * *
              * A comma-separated list of visibility labels that apply to the `selector`.
              * Any of the listed labels can be used to grant the visibility.
        +     *
              * If a rule has multiple labels, removing one of the labels but not all of
              * them can break clients.
        +     *
              * Example:
        -     *     visibility:
        -     *       rules:
        -     *       - selector: google.calendar.Calendar.EnhancedSearch
        -     *         restriction: INTERNAL, PREVIEW
        +     *
        +     * visibility:
        +     * rules:
        +     * - selector: google.calendar.Calendar.EnhancedSearch
        +     * restriction: INTERNAL, PREVIEW
        +     *
              * Removing INTERNAL from this restriction will break clients that rely on
              * this method and only had access to it through INTERNAL.
              * 
        @@ -684,19 +702,24 @@ public java.lang.String getRestriction() { return (java.lang.String) ref; } } + /** * * *
              * A comma-separated list of visibility labels that apply to the `selector`.
              * Any of the listed labels can be used to grant the visibility.
        +     *
              * If a rule has multiple labels, removing one of the labels but not all of
              * them can break clients.
        +     *
              * Example:
        -     *     visibility:
        -     *       rules:
        -     *       - selector: google.calendar.Calendar.EnhancedSearch
        -     *         restriction: INTERNAL, PREVIEW
        +     *
        +     * visibility:
        +     * rules:
        +     * - selector: google.calendar.Calendar.EnhancedSearch
        +     * restriction: INTERNAL, PREVIEW
        +     *
              * Removing INTERNAL from this restriction will break clients that rely on
              * this method and only had access to it through INTERNAL.
              * 
        @@ -716,19 +739,24 @@ public com.google.protobuf.ByteString getRestrictionBytes() { return (com.google.protobuf.ByteString) ref; } } + /** * * *
              * A comma-separated list of visibility labels that apply to the `selector`.
              * Any of the listed labels can be used to grant the visibility.
        +     *
              * If a rule has multiple labels, removing one of the labels but not all of
              * them can break clients.
        +     *
              * Example:
        -     *     visibility:
        -     *       rules:
        -     *       - selector: google.calendar.Calendar.EnhancedSearch
        -     *         restriction: INTERNAL, PREVIEW
        +     *
        +     * visibility:
        +     * rules:
        +     * - selector: google.calendar.Calendar.EnhancedSearch
        +     * restriction: INTERNAL, PREVIEW
        +     *
              * Removing INTERNAL from this restriction will break clients that rely on
              * this method and only had access to it through INTERNAL.
              * 
        @@ -742,24 +770,29 @@ public Builder setRestriction(java.lang.String value) { if (value == null) { throw new NullPointerException(); } - restriction_ = value; + bitField0_ |= 0x00000002; onChanged(); return this; } + /** * * *
              * A comma-separated list of visibility labels that apply to the `selector`.
              * Any of the listed labels can be used to grant the visibility.
        +     *
              * If a rule has multiple labels, removing one of the labels but not all of
              * them can break clients.
        +     *
              * Example:
        -     *     visibility:
        -     *       rules:
        -     *       - selector: google.calendar.Calendar.EnhancedSearch
        -     *         restriction: INTERNAL, PREVIEW
        +     *
        +     * visibility:
        +     * rules:
        +     * - selector: google.calendar.Calendar.EnhancedSearch
        +     * restriction: INTERNAL, PREVIEW
        +     *
              * Removing INTERNAL from this restriction will break clients that rely on
              * this method and only had access to it through INTERNAL.
              * 
        @@ -769,24 +802,29 @@ public Builder setRestriction(java.lang.String value) { * @return This builder for chaining. */ public Builder clearRestriction() { - restriction_ = getDefaultInstance().getRestriction(); + bitField0_ = (bitField0_ & ~0x00000002); onChanged(); return this; } + /** * * *
              * A comma-separated list of visibility labels that apply to the `selector`.
              * Any of the listed labels can be used to grant the visibility.
        +     *
              * If a rule has multiple labels, removing one of the labels but not all of
              * them can break clients.
        +     *
              * Example:
        -     *     visibility:
        -     *       rules:
        -     *       - selector: google.calendar.Calendar.EnhancedSearch
        -     *         restriction: INTERNAL, PREVIEW
        +     *
        +     * visibility:
        +     * rules:
        +     * - selector: google.calendar.Calendar.EnhancedSearch
        +     * restriction: INTERNAL, PREVIEW
        +     *
              * Removing INTERNAL from this restriction will break clients that rely on
              * this method and only had access to it through INTERNAL.
              * 
        @@ -801,23 +839,12 @@ public Builder setRestrictionBytes(com.google.protobuf.ByteString value) { throw new NullPointerException(); } checkByteStringIsUtf8(value); - restriction_ = 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.api.VisibilityRule) } diff --git a/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/VisibilityRuleOrBuilder.java b/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/VisibilityRuleOrBuilder.java index 8321e03e4f..a587d5fc09 100644 --- a/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/VisibilityRuleOrBuilder.java +++ b/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/VisibilityRuleOrBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,10 +14,13 @@ * limitations under the License. */ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: google/api/visibility.proto +// Protobuf Java Version: 4.33.2 package com.google.api; +@com.google.protobuf.Generated public interface VisibilityRuleOrBuilder extends // @@protoc_insertion_point(interface_extends:google.api.VisibilityRule) @@ -28,6 +31,7 @@ public interface VisibilityRuleOrBuilder * *
            * Selects methods, messages, fields, enums, etc. to which this rule applies.
        +   *
            * Refer to [selector][google.api.DocumentationRule.selector] for syntax
            * details.
            * 
        @@ -37,11 +41,13 @@ public interface VisibilityRuleOrBuilder * @return The selector. */ java.lang.String getSelector(); + /** * * *
            * Selects methods, messages, fields, enums, etc. to which this rule applies.
        +   *
            * Refer to [selector][google.api.DocumentationRule.selector] for syntax
            * details.
            * 
        @@ -58,13 +64,17 @@ public interface VisibilityRuleOrBuilder *
            * A comma-separated list of visibility labels that apply to the `selector`.
            * Any of the listed labels can be used to grant the visibility.
        +   *
            * If a rule has multiple labels, removing one of the labels but not all of
            * them can break clients.
        +   *
            * Example:
        -   *     visibility:
        -   *       rules:
        -   *       - selector: google.calendar.Calendar.EnhancedSearch
        -   *         restriction: INTERNAL, PREVIEW
        +   *
        +   * visibility:
        +   * rules:
        +   * - selector: google.calendar.Calendar.EnhancedSearch
        +   * restriction: INTERNAL, PREVIEW
        +   *
            * Removing INTERNAL from this restriction will break clients that rely on
            * this method and only had access to it through INTERNAL.
            * 
        @@ -74,19 +84,24 @@ public interface VisibilityRuleOrBuilder * @return The restriction. */ java.lang.String getRestriction(); + /** * * *
            * A comma-separated list of visibility labels that apply to the `selector`.
            * Any of the listed labels can be used to grant the visibility.
        +   *
            * If a rule has multiple labels, removing one of the labels but not all of
            * them can break clients.
        +   *
            * Example:
        -   *     visibility:
        -   *       rules:
        -   *       - selector: google.calendar.Calendar.EnhancedSearch
        -   *         restriction: INTERNAL, PREVIEW
        +   *
        +   * visibility:
        +   * rules:
        +   * - selector: google.calendar.Calendar.EnhancedSearch
        +   * restriction: INTERNAL, PREVIEW
        +   *
            * Removing INTERNAL from this restriction will break clients that rely on
            * this method and only had access to it through INTERNAL.
            * 
        diff --git a/java-common-protos/proto-google-common-protos/src/main/java/com/google/apps/card/v1/Action.java b/java-common-protos/proto-google-common-protos/src/main/java/com/google/apps/card/v1/Action.java new file mode 100644 index 0000000000..cbb83f259f --- /dev/null +++ b/java-common-protos/proto-google-common-protos/src/main/java/com/google/apps/card/v1/Action.java @@ -0,0 +1,3399 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/apps/card/v1/card.proto +// Protobuf Java Version: 4.33.2 + +package com.google.apps.card.v1; + +/** + * + * + *
        + * An action that describes the behavior when the form is submitted.
        + * For example, you can invoke an Apps Script script to handle the form.
        + * If the action is triggered, the form values are sent to the server.
        + *
        + * [Google Workspace add-ons and Chat
        + * apps](https://developers.google.com/workspace/extend):
        + * 
        + * + * Protobuf type {@code google.apps.card.v1.Action} + */ +@com.google.protobuf.Generated +public final class Action extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.apps.card.v1.Action) + ActionOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "Action"); + } + + // Use Action.newBuilder() to construct. + private Action(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private Action() { + function_ = ""; + parameters_ = java.util.Collections.emptyList(); + loadIndicator_ = 0; + interaction_ = 0; + requiredWidgets_ = com.google.protobuf.LazyStringArrayList.emptyList(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.apps.card.v1.CardProto.internal_static_google_apps_card_v1_Action_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.apps.card.v1.CardProto + .internal_static_google_apps_card_v1_Action_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.apps.card.v1.Action.class, com.google.apps.card.v1.Action.Builder.class); + } + + /** + * + * + *
        +   * Specifies the loading indicator that the action displays while
        +   * making the call to the action.
        +   *
        +   * [Google Workspace add-ons and Chat
        +   * apps](https://developers.google.com/workspace/extend):
        +   * 
        + * + * Protobuf enum {@code google.apps.card.v1.Action.LoadIndicator} + */ + public enum LoadIndicator implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
        +     * Displays a spinner to indicate that content is loading.
        +     * 
        + * + * SPINNER = 0; + */ + SPINNER(0), + /** + * + * + *
        +     * Nothing is displayed.
        +     * 
        + * + * NONE = 1; + */ + NONE(1), + UNRECOGNIZED(-1), + ; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "LoadIndicator"); + } + + /** + * + * + *
        +     * Displays a spinner to indicate that content is loading.
        +     * 
        + * + * SPINNER = 0; + */ + public static final int SPINNER_VALUE = 0; + + /** + * + * + *
        +     * Nothing is displayed.
        +     * 
        + * + * NONE = 1; + */ + public static final int NONE_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 LoadIndicator 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 LoadIndicator forNumber(int value) { + switch (value) { + case 0: + return SPINNER; + case 1: + return NONE; + 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 LoadIndicator findValueByNumber(int number) { + return LoadIndicator.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 com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.apps.card.v1.Action.getDescriptor().getEnumTypes().get(0); + } + + private static final LoadIndicator[] VALUES = values(); + + public static LoadIndicator 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 LoadIndicator(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.apps.card.v1.Action.LoadIndicator) + } + + /** + * + * + *
        +   * Optional. Required when opening a
        +   * [dialog](https://developers.google.com/workspace/chat/dialogs).
        +   *
        +   * What to do in response to an interaction with a user, such as a user
        +   * clicking a button in a card message.
        +   *
        +   * If unspecified, the app responds by executing an `action`—like opening a
        +   * link or running a function—as normal.
        +   *
        +   * By specifying an `interaction`, the app can respond in special interactive
        +   * ways. For example, by setting `interaction` to `OPEN_DIALOG`, the app can
        +   * open a [dialog](https://developers.google.com/workspace/chat/dialogs).
        +   *
        +   * When specified, a loading indicator isn't shown. If specified for
        +   * an add-on, the entire card is stripped and nothing is shown in the client.
        +   *
        +   * [Google Chat apps](https://developers.google.com/workspace/chat):
        +   * 
        + * + * Protobuf enum {@code google.apps.card.v1.Action.Interaction} + */ + public enum Interaction implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
        +     * Default value. The `action` executes as normal.
        +     * 
        + * + * INTERACTION_UNSPECIFIED = 0; + */ + INTERACTION_UNSPECIFIED(0), + /** + * + * + *
        +     * Opens a [dialog](https://developers.google.com/workspace/chat/dialogs), a
        +     * windowed, card-based interface that Chat apps use to interact with users.
        +     *
        +     * Only supported by Chat apps in response to button-clicks on card
        +     * messages. If specified for
        +     * an add-on, the entire card is stripped and nothing is shown in the
        +     * client.
        +     *
        +     * [Google Chat apps](https://developers.google.com/workspace/chat):
        +     * 
        + * + * OPEN_DIALOG = 1; + */ + OPEN_DIALOG(1), + UNRECOGNIZED(-1), + ; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "Interaction"); + } + + /** + * + * + *
        +     * Default value. The `action` executes as normal.
        +     * 
        + * + * INTERACTION_UNSPECIFIED = 0; + */ + public static final int INTERACTION_UNSPECIFIED_VALUE = 0; + + /** + * + * + *
        +     * Opens a [dialog](https://developers.google.com/workspace/chat/dialogs), a
        +     * windowed, card-based interface that Chat apps use to interact with users.
        +     *
        +     * Only supported by Chat apps in response to button-clicks on card
        +     * messages. If specified for
        +     * an add-on, the entire card is stripped and nothing is shown in the
        +     * client.
        +     *
        +     * [Google Chat apps](https://developers.google.com/workspace/chat):
        +     * 
        + * + * OPEN_DIALOG = 1; + */ + public static final int OPEN_DIALOG_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 Interaction 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 Interaction forNumber(int value) { + switch (value) { + case 0: + return INTERACTION_UNSPECIFIED; + case 1: + return OPEN_DIALOG; + 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 Interaction findValueByNumber(int number) { + return Interaction.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 com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.apps.card.v1.Action.getDescriptor().getEnumTypes().get(1); + } + + private static final Interaction[] VALUES = values(); + + public static Interaction 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 Interaction(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.apps.card.v1.Action.Interaction) + } + + public interface ActionParameterOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.apps.card.v1.Action.ActionParameter) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
        +     * The name of the parameter for the action script.
        +     * 
        + * + * string key = 1; + * + * @return The key. + */ + java.lang.String getKey(); + + /** + * + * + *
        +     * The name of the parameter for the action script.
        +     * 
        + * + * string key = 1; + * + * @return The bytes for key. + */ + com.google.protobuf.ByteString getKeyBytes(); + + /** + * + * + *
        +     * The value of the parameter.
        +     * 
        + * + * string value = 2; + * + * @return The value. + */ + java.lang.String getValue(); + + /** + * + * + *
        +     * The value of the parameter.
        +     * 
        + * + * string value = 2; + * + * @return The bytes for value. + */ + com.google.protobuf.ByteString getValueBytes(); + } + + /** + * + * + *
        +   * List of string parameters to supply when the action method is invoked.
        +   * For example, consider three snooze buttons: snooze now, snooze one day,
        +   * or snooze next week. You might use `action method = snooze()`, passing the
        +   * snooze type and snooze time in the list of string parameters.
        +   *
        +   * To learn more, see
        +   * [`CommonEventObject`](https://developers.google.com/workspace/chat/api/reference/rest/v1/Event#commoneventobject).
        +   *
        +   * [Google Workspace add-ons and Chat
        +   * apps](https://developers.google.com/workspace/extend):
        +   * 
        + * + * Protobuf type {@code google.apps.card.v1.Action.ActionParameter} + */ + public static final class ActionParameter extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.apps.card.v1.Action.ActionParameter) + ActionParameterOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "ActionParameter"); + } + + // Use ActionParameter.newBuilder() to construct. + private ActionParameter(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private ActionParameter() { + key_ = ""; + value_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.apps.card.v1.CardProto + .internal_static_google_apps_card_v1_Action_ActionParameter_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.apps.card.v1.CardProto + .internal_static_google_apps_card_v1_Action_ActionParameter_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.apps.card.v1.Action.ActionParameter.class, + com.google.apps.card.v1.Action.ActionParameter.Builder.class); + } + + public static final int KEY_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object key_ = ""; + + /** + * + * + *
        +     * The name of the parameter for the action script.
        +     * 
        + * + * string key = 1; + * + * @return The key. + */ + @java.lang.Override + public java.lang.String getKey() { + java.lang.Object ref = key_; + 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(); + key_ = s; + return s; + } + } + + /** + * + * + *
        +     * The name of the parameter for the action script.
        +     * 
        + * + * string key = 1; + * + * @return The bytes for key. + */ + @java.lang.Override + public com.google.protobuf.ByteString getKeyBytes() { + java.lang.Object ref = key_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + key_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int VALUE_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object value_ = ""; + + /** + * + * + *
        +     * The value of the parameter.
        +     * 
        + * + * string value = 2; + * + * @return The value. + */ + @java.lang.Override + public java.lang.String getValue() { + java.lang.Object ref = value_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + value_ = s; + return s; + } + } + + /** + * + * + *
        +     * The value of the parameter.
        +     * 
        + * + * string value = 2; + * + * @return The bytes for value. + */ + @java.lang.Override + public com.google.protobuf.ByteString getValueBytes() { + java.lang.Object ref = value_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + value_ = 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.GeneratedMessage.isStringEmpty(key_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, key_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(value_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, value_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(key_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, key_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(value_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, value_); + } + 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.apps.card.v1.Action.ActionParameter)) { + return super.equals(obj); + } + com.google.apps.card.v1.Action.ActionParameter other = + (com.google.apps.card.v1.Action.ActionParameter) obj; + + if (!getKey().equals(other.getKey())) return false; + if (!getValue().equals(other.getValue())) 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) + KEY_FIELD_NUMBER; + hash = (53 * hash) + getKey().hashCode(); + hash = (37 * hash) + VALUE_FIELD_NUMBER; + hash = (53 * hash) + getValue().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.apps.card.v1.Action.ActionParameter parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.apps.card.v1.Action.ActionParameter parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.apps.card.v1.Action.ActionParameter parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.apps.card.v1.Action.ActionParameter 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.apps.card.v1.Action.ActionParameter parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.apps.card.v1.Action.ActionParameter parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.apps.card.v1.Action.ActionParameter parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.apps.card.v1.Action.ActionParameter parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.apps.card.v1.Action.ActionParameter parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.apps.card.v1.Action.ActionParameter parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.apps.card.v1.Action.ActionParameter parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.apps.card.v1.Action.ActionParameter parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.apps.card.v1.Action.ActionParameter 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
        +     * List of string parameters to supply when the action method is invoked.
        +     * For example, consider three snooze buttons: snooze now, snooze one day,
        +     * or snooze next week. You might use `action method = snooze()`, passing the
        +     * snooze type and snooze time in the list of string parameters.
        +     *
        +     * To learn more, see
        +     * [`CommonEventObject`](https://developers.google.com/workspace/chat/api/reference/rest/v1/Event#commoneventobject).
        +     *
        +     * [Google Workspace add-ons and Chat
        +     * apps](https://developers.google.com/workspace/extend):
        +     * 
        + * + * Protobuf type {@code google.apps.card.v1.Action.ActionParameter} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.apps.card.v1.Action.ActionParameter) + com.google.apps.card.v1.Action.ActionParameterOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.apps.card.v1.CardProto + .internal_static_google_apps_card_v1_Action_ActionParameter_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.apps.card.v1.CardProto + .internal_static_google_apps_card_v1_Action_ActionParameter_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.apps.card.v1.Action.ActionParameter.class, + com.google.apps.card.v1.Action.ActionParameter.Builder.class); + } + + // Construct using com.google.apps.card.v1.Action.ActionParameter.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + key_ = ""; + value_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.apps.card.v1.CardProto + .internal_static_google_apps_card_v1_Action_ActionParameter_descriptor; + } + + @java.lang.Override + public com.google.apps.card.v1.Action.ActionParameter getDefaultInstanceForType() { + return com.google.apps.card.v1.Action.ActionParameter.getDefaultInstance(); + } + + @java.lang.Override + public com.google.apps.card.v1.Action.ActionParameter build() { + com.google.apps.card.v1.Action.ActionParameter result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.apps.card.v1.Action.ActionParameter buildPartial() { + com.google.apps.card.v1.Action.ActionParameter result = + new com.google.apps.card.v1.Action.ActionParameter(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.apps.card.v1.Action.ActionParameter result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.key_ = key_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.value_ = value_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.apps.card.v1.Action.ActionParameter) { + return mergeFrom((com.google.apps.card.v1.Action.ActionParameter) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.apps.card.v1.Action.ActionParameter other) { + if (other == com.google.apps.card.v1.Action.ActionParameter.getDefaultInstance()) + return this; + if (!other.getKey().isEmpty()) { + key_ = other.key_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getValue().isEmpty()) { + value_ = other.value_; + 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: + { + key_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + value_ = 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.lang.Object key_ = ""; + + /** + * + * + *
        +       * The name of the parameter for the action script.
        +       * 
        + * + * string key = 1; + * + * @return The key. + */ + public java.lang.String getKey() { + java.lang.Object ref = key_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + key_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
        +       * The name of the parameter for the action script.
        +       * 
        + * + * string key = 1; + * + * @return The bytes for key. + */ + public com.google.protobuf.ByteString getKeyBytes() { + java.lang.Object ref = key_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + key_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
        +       * The name of the parameter for the action script.
        +       * 
        + * + * string key = 1; + * + * @param value The key to set. + * @return This builder for chaining. + */ + public Builder setKey(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + key_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
        +       * The name of the parameter for the action script.
        +       * 
        + * + * string key = 1; + * + * @return This builder for chaining. + */ + public Builder clearKey() { + key_ = getDefaultInstance().getKey(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
        +       * The name of the parameter for the action script.
        +       * 
        + * + * string key = 1; + * + * @param value The bytes for key to set. + * @return This builder for chaining. + */ + public Builder setKeyBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + key_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object value_ = ""; + + /** + * + * + *
        +       * The value of the parameter.
        +       * 
        + * + * string value = 2; + * + * @return The value. + */ + public java.lang.String getValue() { + java.lang.Object ref = value_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + value_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
        +       * The value of the parameter.
        +       * 
        + * + * string value = 2; + * + * @return The bytes for value. + */ + public com.google.protobuf.ByteString getValueBytes() { + java.lang.Object ref = value_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + value_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
        +       * The value of the parameter.
        +       * 
        + * + * string value = 2; + * + * @param value The value to set. + * @return This builder for chaining. + */ + public Builder setValue(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + value_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
        +       * The value of the parameter.
        +       * 
        + * + * string value = 2; + * + * @return This builder for chaining. + */ + public Builder clearValue() { + value_ = getDefaultInstance().getValue(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
        +       * The value of the parameter.
        +       * 
        + * + * string value = 2; + * + * @param value The bytes for value to set. + * @return This builder for chaining. + */ + public Builder setValueBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + value_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.apps.card.v1.Action.ActionParameter) + } + + // @@protoc_insertion_point(class_scope:google.apps.card.v1.Action.ActionParameter) + private static final com.google.apps.card.v1.Action.ActionParameter DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.apps.card.v1.Action.ActionParameter(); + } + + public static com.google.apps.card.v1.Action.ActionParameter getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ActionParameter 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.apps.card.v1.Action.ActionParameter getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public static final int FUNCTION_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object function_ = ""; + + /** + * + * + *
        +   * A custom function to invoke when the containing element is
        +   * clicked or otherwise activated.
        +   *
        +   * For example usage, see [Read form
        +   * data](https://developers.google.com/workspace/chat/read-form-data).
        +   * 
        + * + * string function = 1; + * + * @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; + } + } + + /** + * + * + *
        +   * A custom function to invoke when the containing element is
        +   * clicked or otherwise activated.
        +   *
        +   * For example usage, see [Read form
        +   * data](https://developers.google.com/workspace/chat/read-form-data).
        +   * 
        + * + * string function = 1; + * + * @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; + } + } + + public static final int PARAMETERS_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private java.util.List parameters_; + + /** + * + * + *
        +   * List of action parameters.
        +   * 
        + * + * repeated .google.apps.card.v1.Action.ActionParameter parameters = 2; + */ + @java.lang.Override + public java.util.List getParametersList() { + return parameters_; + } + + /** + * + * + *
        +   * List of action parameters.
        +   * 
        + * + * repeated .google.apps.card.v1.Action.ActionParameter parameters = 2; + */ + @java.lang.Override + public java.util.List + getParametersOrBuilderList() { + return parameters_; + } + + /** + * + * + *
        +   * List of action parameters.
        +   * 
        + * + * repeated .google.apps.card.v1.Action.ActionParameter parameters = 2; + */ + @java.lang.Override + public int getParametersCount() { + return parameters_.size(); + } + + /** + * + * + *
        +   * List of action parameters.
        +   * 
        + * + * repeated .google.apps.card.v1.Action.ActionParameter parameters = 2; + */ + @java.lang.Override + public com.google.apps.card.v1.Action.ActionParameter getParameters(int index) { + return parameters_.get(index); + } + + /** + * + * + *
        +   * List of action parameters.
        +   * 
        + * + * repeated .google.apps.card.v1.Action.ActionParameter parameters = 2; + */ + @java.lang.Override + public com.google.apps.card.v1.Action.ActionParameterOrBuilder getParametersOrBuilder(int index) { + return parameters_.get(index); + } + + public static final int LOAD_INDICATOR_FIELD_NUMBER = 3; + private int loadIndicator_ = 0; + + /** + * + * + *
        +   * Specifies the loading indicator that the action displays while
        +   * making the call to the action.
        +   * 
        + * + * .google.apps.card.v1.Action.LoadIndicator load_indicator = 3; + * + * @return The enum numeric value on the wire for loadIndicator. + */ + @java.lang.Override + public int getLoadIndicatorValue() { + return loadIndicator_; + } + + /** + * + * + *
        +   * Specifies the loading indicator that the action displays while
        +   * making the call to the action.
        +   * 
        + * + * .google.apps.card.v1.Action.LoadIndicator load_indicator = 3; + * + * @return The loadIndicator. + */ + @java.lang.Override + public com.google.apps.card.v1.Action.LoadIndicator getLoadIndicator() { + com.google.apps.card.v1.Action.LoadIndicator result = + com.google.apps.card.v1.Action.LoadIndicator.forNumber(loadIndicator_); + return result == null ? com.google.apps.card.v1.Action.LoadIndicator.UNRECOGNIZED : result; + } + + public static final int PERSIST_VALUES_FIELD_NUMBER = 4; + private boolean persistValues_ = false; + + /** + * + * + *
        +   * Indicates whether form values persist after the action. The default value
        +   * is `false`.
        +   *
        +   * If `true`, form values remain after the action is triggered. To let the
        +   * user make changes while the action is being processed, set
        +   * [`LoadIndicator`](https://developers.google.com/workspace/add-ons/reference/rpc/google.apps.card.v1#loadindicator)
        +   * to `NONE`. For [card
        +   * messages](https://developers.google.com/workspace/chat/api/guides/v1/messages/create#create)
        +   * in Chat apps, you must also set the action's
        +   * [`ResponseType`](https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces.messages#responsetype)
        +   * to `UPDATE_MESSAGE` and use the same
        +   * [`card_id`](https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces.messages#CardWithId)
        +   * from the card that contained the action.
        +   *
        +   * If `false`, the form values are cleared when the action is triggered.
        +   * To prevent the user from making changes while the action is being
        +   * processed, set
        +   * [`LoadIndicator`](https://developers.google.com/workspace/add-ons/reference/rpc/google.apps.card.v1#loadindicator)
        +   * to `SPINNER`.
        +   * 
        + * + * bool persist_values = 4; + * + * @return The persistValues. + */ + @java.lang.Override + public boolean getPersistValues() { + return persistValues_; + } + + public static final int INTERACTION_FIELD_NUMBER = 5; + private int interaction_ = 0; + + /** + * + * + *
        +   * Optional. Required when opening a
        +   * [dialog](https://developers.google.com/workspace/chat/dialogs).
        +   *
        +   * What to do in response to an interaction with a user, such as a user
        +   * clicking a button in a card message.
        +   *
        +   * If unspecified, the app responds by executing an `action`—like opening a
        +   * link or running a function—as normal.
        +   *
        +   * By specifying an `interaction`, the app can respond in special interactive
        +   * ways. For example, by setting `interaction` to `OPEN_DIALOG`, the app can
        +   * open a [dialog](https://developers.google.com/workspace/chat/dialogs). When
        +   * specified, a loading indicator isn't shown. If specified for
        +   * an add-on, the entire card is stripped and nothing is shown in the client.
        +   *
        +   * [Google Chat apps](https://developers.google.com/workspace/chat):
        +   * 
        + * + * .google.apps.card.v1.Action.Interaction interaction = 5; + * + * @return The enum numeric value on the wire for interaction. + */ + @java.lang.Override + public int getInteractionValue() { + return interaction_; + } + + /** + * + * + *
        +   * Optional. Required when opening a
        +   * [dialog](https://developers.google.com/workspace/chat/dialogs).
        +   *
        +   * What to do in response to an interaction with a user, such as a user
        +   * clicking a button in a card message.
        +   *
        +   * If unspecified, the app responds by executing an `action`—like opening a
        +   * link or running a function—as normal.
        +   *
        +   * By specifying an `interaction`, the app can respond in special interactive
        +   * ways. For example, by setting `interaction` to `OPEN_DIALOG`, the app can
        +   * open a [dialog](https://developers.google.com/workspace/chat/dialogs). When
        +   * specified, a loading indicator isn't shown. If specified for
        +   * an add-on, the entire card is stripped and nothing is shown in the client.
        +   *
        +   * [Google Chat apps](https://developers.google.com/workspace/chat):
        +   * 
        + * + * .google.apps.card.v1.Action.Interaction interaction = 5; + * + * @return The interaction. + */ + @java.lang.Override + public com.google.apps.card.v1.Action.Interaction getInteraction() { + com.google.apps.card.v1.Action.Interaction result = + com.google.apps.card.v1.Action.Interaction.forNumber(interaction_); + return result == null ? com.google.apps.card.v1.Action.Interaction.UNRECOGNIZED : result; + } + + public static final int REQUIRED_WIDGETS_FIELD_NUMBER = 6; + + @SuppressWarnings("serial") + private com.google.protobuf.LazyStringArrayList requiredWidgets_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + + /** + * + * + *
        +   * Optional. Fill this list with the names of widgets that this Action
        +   * needs for a valid submission.
        +   *
        +   * If the widgets listed here don't have a value when this Action is invoked,
        +   * the form submission is aborted.
        +   *
        +   * [Google Workspace add-ons and Chat
        +   * apps](https://developers.google.com/workspace/extend):
        +   * 
        + * + * repeated string required_widgets = 6; + * + * @return A list containing the requiredWidgets. + */ + public com.google.protobuf.ProtocolStringList getRequiredWidgetsList() { + return requiredWidgets_; + } + + /** + * + * + *
        +   * Optional. Fill this list with the names of widgets that this Action
        +   * needs for a valid submission.
        +   *
        +   * If the widgets listed here don't have a value when this Action is invoked,
        +   * the form submission is aborted.
        +   *
        +   * [Google Workspace add-ons and Chat
        +   * apps](https://developers.google.com/workspace/extend):
        +   * 
        + * + * repeated string required_widgets = 6; + * + * @return The count of requiredWidgets. + */ + public int getRequiredWidgetsCount() { + return requiredWidgets_.size(); + } + + /** + * + * + *
        +   * Optional. Fill this list with the names of widgets that this Action
        +   * needs for a valid submission.
        +   *
        +   * If the widgets listed here don't have a value when this Action is invoked,
        +   * the form submission is aborted.
        +   *
        +   * [Google Workspace add-ons and Chat
        +   * apps](https://developers.google.com/workspace/extend):
        +   * 
        + * + * repeated string required_widgets = 6; + * + * @param index The index of the element to return. + * @return The requiredWidgets at the given index. + */ + public java.lang.String getRequiredWidgets(int index) { + return requiredWidgets_.get(index); + } + + /** + * + * + *
        +   * Optional. Fill this list with the names of widgets that this Action
        +   * needs for a valid submission.
        +   *
        +   * If the widgets listed here don't have a value when this Action is invoked,
        +   * the form submission is aborted.
        +   *
        +   * [Google Workspace add-ons and Chat
        +   * apps](https://developers.google.com/workspace/extend):
        +   * 
        + * + * repeated string required_widgets = 6; + * + * @param index The index of the value to return. + * @return The bytes of the requiredWidgets at the given index. + */ + public com.google.protobuf.ByteString getRequiredWidgetsBytes(int index) { + return requiredWidgets_.getByteString(index); + } + + public static final int ALL_WIDGETS_ARE_REQUIRED_FIELD_NUMBER = 7; + private boolean allWidgetsAreRequired_ = false; + + /** + * + * + *
        +   * Optional. If this is true, then all widgets are considered required by
        +   * this action.
        +   *
        +   * [Google Workspace add-ons and Chat
        +   * apps](https://developers.google.com/workspace/extend):
        +   * 
        + * + * bool all_widgets_are_required = 7; + * + * @return The allWidgetsAreRequired. + */ + @java.lang.Override + public boolean getAllWidgetsAreRequired() { + return allWidgetsAreRequired_; + } + + 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.GeneratedMessage.isStringEmpty(function_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, function_); + } + for (int i = 0; i < parameters_.size(); i++) { + output.writeMessage(2, parameters_.get(i)); + } + if (loadIndicator_ != com.google.apps.card.v1.Action.LoadIndicator.SPINNER.getNumber()) { + output.writeEnum(3, loadIndicator_); + } + if (persistValues_ != false) { + output.writeBool(4, persistValues_); + } + if (interaction_ + != com.google.apps.card.v1.Action.Interaction.INTERACTION_UNSPECIFIED.getNumber()) { + output.writeEnum(5, interaction_); + } + for (int i = 0; i < requiredWidgets_.size(); i++) { + com.google.protobuf.GeneratedMessage.writeString(output, 6, requiredWidgets_.getRaw(i)); + } + if (allWidgetsAreRequired_ != false) { + output.writeBool(7, allWidgetsAreRequired_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(function_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, function_); + } + for (int i = 0; i < parameters_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, parameters_.get(i)); + } + if (loadIndicator_ != com.google.apps.card.v1.Action.LoadIndicator.SPINNER.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(3, loadIndicator_); + } + if (persistValues_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(4, persistValues_); + } + if (interaction_ + != com.google.apps.card.v1.Action.Interaction.INTERACTION_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(5, interaction_); + } + { + int dataSize = 0; + for (int i = 0; i < requiredWidgets_.size(); i++) { + dataSize += computeStringSizeNoTag(requiredWidgets_.getRaw(i)); + } + size += dataSize; + size += 1 * getRequiredWidgetsList().size(); + } + if (allWidgetsAreRequired_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(7, allWidgetsAreRequired_); + } + 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.apps.card.v1.Action)) { + return super.equals(obj); + } + com.google.apps.card.v1.Action other = (com.google.apps.card.v1.Action) obj; + + if (!getFunction().equals(other.getFunction())) return false; + if (!getParametersList().equals(other.getParametersList())) return false; + if (loadIndicator_ != other.loadIndicator_) return false; + if (getPersistValues() != other.getPersistValues()) return false; + if (interaction_ != other.interaction_) return false; + if (!getRequiredWidgetsList().equals(other.getRequiredWidgetsList())) return false; + if (getAllWidgetsAreRequired() != other.getAllWidgetsAreRequired()) 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) + FUNCTION_FIELD_NUMBER; + hash = (53 * hash) + getFunction().hashCode(); + if (getParametersCount() > 0) { + hash = (37 * hash) + PARAMETERS_FIELD_NUMBER; + hash = (53 * hash) + getParametersList().hashCode(); + } + hash = (37 * hash) + LOAD_INDICATOR_FIELD_NUMBER; + hash = (53 * hash) + loadIndicator_; + hash = (37 * hash) + PERSIST_VALUES_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getPersistValues()); + hash = (37 * hash) + INTERACTION_FIELD_NUMBER; + hash = (53 * hash) + interaction_; + if (getRequiredWidgetsCount() > 0) { + hash = (37 * hash) + REQUIRED_WIDGETS_FIELD_NUMBER; + hash = (53 * hash) + getRequiredWidgetsList().hashCode(); + } + hash = (37 * hash) + ALL_WIDGETS_ARE_REQUIRED_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getAllWidgetsAreRequired()); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.apps.card.v1.Action parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.apps.card.v1.Action parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.apps.card.v1.Action parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.apps.card.v1.Action 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.apps.card.v1.Action parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.apps.card.v1.Action parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.apps.card.v1.Action parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.apps.card.v1.Action parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.apps.card.v1.Action parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.apps.card.v1.Action parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.apps.card.v1.Action parseFrom(com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.apps.card.v1.Action parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.apps.card.v1.Action 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
        +   * An action that describes the behavior when the form is submitted.
        +   * For example, you can invoke an Apps Script script to handle the form.
        +   * If the action is triggered, the form values are sent to the server.
        +   *
        +   * [Google Workspace add-ons and Chat
        +   * apps](https://developers.google.com/workspace/extend):
        +   * 
        + * + * Protobuf type {@code google.apps.card.v1.Action} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.apps.card.v1.Action) + com.google.apps.card.v1.ActionOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.apps.card.v1.CardProto + .internal_static_google_apps_card_v1_Action_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.apps.card.v1.CardProto + .internal_static_google_apps_card_v1_Action_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.apps.card.v1.Action.class, com.google.apps.card.v1.Action.Builder.class); + } + + // Construct using com.google.apps.card.v1.Action.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + function_ = ""; + if (parametersBuilder_ == null) { + parameters_ = java.util.Collections.emptyList(); + } else { + parameters_ = null; + parametersBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000002); + loadIndicator_ = 0; + persistValues_ = false; + interaction_ = 0; + requiredWidgets_ = com.google.protobuf.LazyStringArrayList.emptyList(); + allWidgetsAreRequired_ = false; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.apps.card.v1.CardProto + .internal_static_google_apps_card_v1_Action_descriptor; + } + + @java.lang.Override + public com.google.apps.card.v1.Action getDefaultInstanceForType() { + return com.google.apps.card.v1.Action.getDefaultInstance(); + } + + @java.lang.Override + public com.google.apps.card.v1.Action build() { + com.google.apps.card.v1.Action result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.apps.card.v1.Action buildPartial() { + com.google.apps.card.v1.Action result = new com.google.apps.card.v1.Action(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields(com.google.apps.card.v1.Action result) { + if (parametersBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0)) { + parameters_ = java.util.Collections.unmodifiableList(parameters_); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.parameters_ = parameters_; + } else { + result.parameters_ = parametersBuilder_.build(); + } + } + + private void buildPartial0(com.google.apps.card.v1.Action result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.function_ = function_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.loadIndicator_ = loadIndicator_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.persistValues_ = persistValues_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.interaction_ = interaction_; + } + if (((from_bitField0_ & 0x00000020) != 0)) { + requiredWidgets_.makeImmutable(); + result.requiredWidgets_ = requiredWidgets_; + } + if (((from_bitField0_ & 0x00000040) != 0)) { + result.allWidgetsAreRequired_ = allWidgetsAreRequired_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.apps.card.v1.Action) { + return mergeFrom((com.google.apps.card.v1.Action) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.apps.card.v1.Action other) { + if (other == com.google.apps.card.v1.Action.getDefaultInstance()) return this; + if (!other.getFunction().isEmpty()) { + function_ = other.function_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (parametersBuilder_ == null) { + if (!other.parameters_.isEmpty()) { + if (parameters_.isEmpty()) { + parameters_ = other.parameters_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureParametersIsMutable(); + parameters_.addAll(other.parameters_); + } + onChanged(); + } + } else { + if (!other.parameters_.isEmpty()) { + if (parametersBuilder_.isEmpty()) { + parametersBuilder_.dispose(); + parametersBuilder_ = null; + parameters_ = other.parameters_; + bitField0_ = (bitField0_ & ~0x00000002); + parametersBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders + ? internalGetParametersFieldBuilder() + : null; + } else { + parametersBuilder_.addAllMessages(other.parameters_); + } + } + } + if (other.loadIndicator_ != 0) { + setLoadIndicatorValue(other.getLoadIndicatorValue()); + } + if (other.getPersistValues() != false) { + setPersistValues(other.getPersistValues()); + } + if (other.interaction_ != 0) { + setInteractionValue(other.getInteractionValue()); + } + if (!other.requiredWidgets_.isEmpty()) { + if (requiredWidgets_.isEmpty()) { + requiredWidgets_ = other.requiredWidgets_; + bitField0_ |= 0x00000020; + } else { + ensureRequiredWidgetsIsMutable(); + requiredWidgets_.addAll(other.requiredWidgets_); + } + onChanged(); + } + if (other.getAllWidgetsAreRequired() != false) { + setAllWidgetsAreRequired(other.getAllWidgetsAreRequired()); + } + 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: + { + function_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + com.google.apps.card.v1.Action.ActionParameter m = + input.readMessage( + com.google.apps.card.v1.Action.ActionParameter.parser(), extensionRegistry); + if (parametersBuilder_ == null) { + ensureParametersIsMutable(); + parameters_.add(m); + } else { + parametersBuilder_.addMessage(m); + } + break; + } // case 18 + case 24: + { + loadIndicator_ = input.readEnum(); + bitField0_ |= 0x00000004; + break; + } // case 24 + case 32: + { + persistValues_ = input.readBool(); + bitField0_ |= 0x00000008; + break; + } // case 32 + case 40: + { + interaction_ = input.readEnum(); + bitField0_ |= 0x00000010; + break; + } // case 40 + case 50: + { + java.lang.String s = input.readStringRequireUtf8(); + ensureRequiredWidgetsIsMutable(); + requiredWidgets_.add(s); + break; + } // case 50 + case 56: + { + allWidgetsAreRequired_ = input.readBool(); + bitField0_ |= 0x00000040; + break; + } // case 56 + 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 function_ = ""; + + /** + * + * + *
        +     * A custom function to invoke when the containing element is
        +     * clicked or otherwise activated.
        +     *
        +     * For example usage, see [Read form
        +     * data](https://developers.google.com/workspace/chat/read-form-data).
        +     * 
        + * + * string function = 1; + * + * @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; + } + } + + /** + * + * + *
        +     * A custom function to invoke when the containing element is
        +     * clicked or otherwise activated.
        +     *
        +     * For example usage, see [Read form
        +     * data](https://developers.google.com/workspace/chat/read-form-data).
        +     * 
        + * + * string function = 1; + * + * @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; + } + } + + /** + * + * + *
        +     * A custom function to invoke when the containing element is
        +     * clicked or otherwise activated.
        +     *
        +     * For example usage, see [Read form
        +     * data](https://developers.google.com/workspace/chat/read-form-data).
        +     * 
        + * + * string function = 1; + * + * @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_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
        +     * A custom function to invoke when the containing element is
        +     * clicked or otherwise activated.
        +     *
        +     * For example usage, see [Read form
        +     * data](https://developers.google.com/workspace/chat/read-form-data).
        +     * 
        + * + * string function = 1; + * + * @return This builder for chaining. + */ + public Builder clearFunction() { + function_ = getDefaultInstance().getFunction(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
        +     * A custom function to invoke when the containing element is
        +     * clicked or otherwise activated.
        +     *
        +     * For example usage, see [Read form
        +     * data](https://developers.google.com/workspace/chat/read-form-data).
        +     * 
        + * + * string function = 1; + * + * @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_ |= 0x00000001; + onChanged(); + return this; + } + + private java.util.List parameters_ = + java.util.Collections.emptyList(); + + private void ensureParametersIsMutable() { + if (!((bitField0_ & 0x00000002) != 0)) { + parameters_ = + new java.util.ArrayList(parameters_); + bitField0_ |= 0x00000002; + } + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.google.apps.card.v1.Action.ActionParameter, + com.google.apps.card.v1.Action.ActionParameter.Builder, + com.google.apps.card.v1.Action.ActionParameterOrBuilder> + parametersBuilder_; + + /** + * + * + *
        +     * List of action parameters.
        +     * 
        + * + * repeated .google.apps.card.v1.Action.ActionParameter parameters = 2; + */ + public java.util.List getParametersList() { + if (parametersBuilder_ == null) { + return java.util.Collections.unmodifiableList(parameters_); + } else { + return parametersBuilder_.getMessageList(); + } + } + + /** + * + * + *
        +     * List of action parameters.
        +     * 
        + * + * repeated .google.apps.card.v1.Action.ActionParameter parameters = 2; + */ + public int getParametersCount() { + if (parametersBuilder_ == null) { + return parameters_.size(); + } else { + return parametersBuilder_.getCount(); + } + } + + /** + * + * + *
        +     * List of action parameters.
        +     * 
        + * + * repeated .google.apps.card.v1.Action.ActionParameter parameters = 2; + */ + public com.google.apps.card.v1.Action.ActionParameter getParameters(int index) { + if (parametersBuilder_ == null) { + return parameters_.get(index); + } else { + return parametersBuilder_.getMessage(index); + } + } + + /** + * + * + *
        +     * List of action parameters.
        +     * 
        + * + * repeated .google.apps.card.v1.Action.ActionParameter parameters = 2; + */ + public Builder setParameters(int index, com.google.apps.card.v1.Action.ActionParameter value) { + if (parametersBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureParametersIsMutable(); + parameters_.set(index, value); + onChanged(); + } else { + parametersBuilder_.setMessage(index, value); + } + return this; + } + + /** + * + * + *
        +     * List of action parameters.
        +     * 
        + * + * repeated .google.apps.card.v1.Action.ActionParameter parameters = 2; + */ + public Builder setParameters( + int index, com.google.apps.card.v1.Action.ActionParameter.Builder builderForValue) { + if (parametersBuilder_ == null) { + ensureParametersIsMutable(); + parameters_.set(index, builderForValue.build()); + onChanged(); + } else { + parametersBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
        +     * List of action parameters.
        +     * 
        + * + * repeated .google.apps.card.v1.Action.ActionParameter parameters = 2; + */ + public Builder addParameters(com.google.apps.card.v1.Action.ActionParameter value) { + if (parametersBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureParametersIsMutable(); + parameters_.add(value); + onChanged(); + } else { + parametersBuilder_.addMessage(value); + } + return this; + } + + /** + * + * + *
        +     * List of action parameters.
        +     * 
        + * + * repeated .google.apps.card.v1.Action.ActionParameter parameters = 2; + */ + public Builder addParameters(int index, com.google.apps.card.v1.Action.ActionParameter value) { + if (parametersBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureParametersIsMutable(); + parameters_.add(index, value); + onChanged(); + } else { + parametersBuilder_.addMessage(index, value); + } + return this; + } + + /** + * + * + *
        +     * List of action parameters.
        +     * 
        + * + * repeated .google.apps.card.v1.Action.ActionParameter parameters = 2; + */ + public Builder addParameters( + com.google.apps.card.v1.Action.ActionParameter.Builder builderForValue) { + if (parametersBuilder_ == null) { + ensureParametersIsMutable(); + parameters_.add(builderForValue.build()); + onChanged(); + } else { + parametersBuilder_.addMessage(builderForValue.build()); + } + return this; + } + + /** + * + * + *
        +     * List of action parameters.
        +     * 
        + * + * repeated .google.apps.card.v1.Action.ActionParameter parameters = 2; + */ + public Builder addParameters( + int index, com.google.apps.card.v1.Action.ActionParameter.Builder builderForValue) { + if (parametersBuilder_ == null) { + ensureParametersIsMutable(); + parameters_.add(index, builderForValue.build()); + onChanged(); + } else { + parametersBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
        +     * List of action parameters.
        +     * 
        + * + * repeated .google.apps.card.v1.Action.ActionParameter parameters = 2; + */ + public Builder addAllParameters( + java.lang.Iterable values) { + if (parametersBuilder_ == null) { + ensureParametersIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, parameters_); + onChanged(); + } else { + parametersBuilder_.addAllMessages(values); + } + return this; + } + + /** + * + * + *
        +     * List of action parameters.
        +     * 
        + * + * repeated .google.apps.card.v1.Action.ActionParameter parameters = 2; + */ + public Builder clearParameters() { + if (parametersBuilder_ == null) { + parameters_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + } else { + parametersBuilder_.clear(); + } + return this; + } + + /** + * + * + *
        +     * List of action parameters.
        +     * 
        + * + * repeated .google.apps.card.v1.Action.ActionParameter parameters = 2; + */ + public Builder removeParameters(int index) { + if (parametersBuilder_ == null) { + ensureParametersIsMutable(); + parameters_.remove(index); + onChanged(); + } else { + parametersBuilder_.remove(index); + } + return this; + } + + /** + * + * + *
        +     * List of action parameters.
        +     * 
        + * + * repeated .google.apps.card.v1.Action.ActionParameter parameters = 2; + */ + public com.google.apps.card.v1.Action.ActionParameter.Builder getParametersBuilder(int index) { + return internalGetParametersFieldBuilder().getBuilder(index); + } + + /** + * + * + *
        +     * List of action parameters.
        +     * 
        + * + * repeated .google.apps.card.v1.Action.ActionParameter parameters = 2; + */ + public com.google.apps.card.v1.Action.ActionParameterOrBuilder getParametersOrBuilder( + int index) { + if (parametersBuilder_ == null) { + return parameters_.get(index); + } else { + return parametersBuilder_.getMessageOrBuilder(index); + } + } + + /** + * + * + *
        +     * List of action parameters.
        +     * 
        + * + * repeated .google.apps.card.v1.Action.ActionParameter parameters = 2; + */ + public java.util.List + getParametersOrBuilderList() { + if (parametersBuilder_ != null) { + return parametersBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(parameters_); + } + } + + /** + * + * + *
        +     * List of action parameters.
        +     * 
        + * + * repeated .google.apps.card.v1.Action.ActionParameter parameters = 2; + */ + public com.google.apps.card.v1.Action.ActionParameter.Builder addParametersBuilder() { + return internalGetParametersFieldBuilder() + .addBuilder(com.google.apps.card.v1.Action.ActionParameter.getDefaultInstance()); + } + + /** + * + * + *
        +     * List of action parameters.
        +     * 
        + * + * repeated .google.apps.card.v1.Action.ActionParameter parameters = 2; + */ + public com.google.apps.card.v1.Action.ActionParameter.Builder addParametersBuilder(int index) { + return internalGetParametersFieldBuilder() + .addBuilder(index, com.google.apps.card.v1.Action.ActionParameter.getDefaultInstance()); + } + + /** + * + * + *
        +     * List of action parameters.
        +     * 
        + * + * repeated .google.apps.card.v1.Action.ActionParameter parameters = 2; + */ + public java.util.List + getParametersBuilderList() { + return internalGetParametersFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.google.apps.card.v1.Action.ActionParameter, + com.google.apps.card.v1.Action.ActionParameter.Builder, + com.google.apps.card.v1.Action.ActionParameterOrBuilder> + internalGetParametersFieldBuilder() { + if (parametersBuilder_ == null) { + parametersBuilder_ = + new com.google.protobuf.RepeatedFieldBuilder< + com.google.apps.card.v1.Action.ActionParameter, + com.google.apps.card.v1.Action.ActionParameter.Builder, + com.google.apps.card.v1.Action.ActionParameterOrBuilder>( + parameters_, ((bitField0_ & 0x00000002) != 0), getParentForChildren(), isClean()); + parameters_ = null; + } + return parametersBuilder_; + } + + private int loadIndicator_ = 0; + + /** + * + * + *
        +     * Specifies the loading indicator that the action displays while
        +     * making the call to the action.
        +     * 
        + * + * .google.apps.card.v1.Action.LoadIndicator load_indicator = 3; + * + * @return The enum numeric value on the wire for loadIndicator. + */ + @java.lang.Override + public int getLoadIndicatorValue() { + return loadIndicator_; + } + + /** + * + * + *
        +     * Specifies the loading indicator that the action displays while
        +     * making the call to the action.
        +     * 
        + * + * .google.apps.card.v1.Action.LoadIndicator load_indicator = 3; + * + * @param value The enum numeric value on the wire for loadIndicator to set. + * @return This builder for chaining. + */ + public Builder setLoadIndicatorValue(int value) { + loadIndicator_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
        +     * Specifies the loading indicator that the action displays while
        +     * making the call to the action.
        +     * 
        + * + * .google.apps.card.v1.Action.LoadIndicator load_indicator = 3; + * + * @return The loadIndicator. + */ + @java.lang.Override + public com.google.apps.card.v1.Action.LoadIndicator getLoadIndicator() { + com.google.apps.card.v1.Action.LoadIndicator result = + com.google.apps.card.v1.Action.LoadIndicator.forNumber(loadIndicator_); + return result == null ? com.google.apps.card.v1.Action.LoadIndicator.UNRECOGNIZED : result; + } + + /** + * + * + *
        +     * Specifies the loading indicator that the action displays while
        +     * making the call to the action.
        +     * 
        + * + * .google.apps.card.v1.Action.LoadIndicator load_indicator = 3; + * + * @param value The loadIndicator to set. + * @return This builder for chaining. + */ + public Builder setLoadIndicator(com.google.apps.card.v1.Action.LoadIndicator value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000004; + loadIndicator_ = value.getNumber(); + onChanged(); + return this; + } + + /** + * + * + *
        +     * Specifies the loading indicator that the action displays while
        +     * making the call to the action.
        +     * 
        + * + * .google.apps.card.v1.Action.LoadIndicator load_indicator = 3; + * + * @return This builder for chaining. + */ + public Builder clearLoadIndicator() { + bitField0_ = (bitField0_ & ~0x00000004); + loadIndicator_ = 0; + onChanged(); + return this; + } + + private boolean persistValues_; + + /** + * + * + *
        +     * Indicates whether form values persist after the action. The default value
        +     * is `false`.
        +     *
        +     * If `true`, form values remain after the action is triggered. To let the
        +     * user make changes while the action is being processed, set
        +     * [`LoadIndicator`](https://developers.google.com/workspace/add-ons/reference/rpc/google.apps.card.v1#loadindicator)
        +     * to `NONE`. For [card
        +     * messages](https://developers.google.com/workspace/chat/api/guides/v1/messages/create#create)
        +     * in Chat apps, you must also set the action's
        +     * [`ResponseType`](https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces.messages#responsetype)
        +     * to `UPDATE_MESSAGE` and use the same
        +     * [`card_id`](https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces.messages#CardWithId)
        +     * from the card that contained the action.
        +     *
        +     * If `false`, the form values are cleared when the action is triggered.
        +     * To prevent the user from making changes while the action is being
        +     * processed, set
        +     * [`LoadIndicator`](https://developers.google.com/workspace/add-ons/reference/rpc/google.apps.card.v1#loadindicator)
        +     * to `SPINNER`.
        +     * 
        + * + * bool persist_values = 4; + * + * @return The persistValues. + */ + @java.lang.Override + public boolean getPersistValues() { + return persistValues_; + } + + /** + * + * + *
        +     * Indicates whether form values persist after the action. The default value
        +     * is `false`.
        +     *
        +     * If `true`, form values remain after the action is triggered. To let the
        +     * user make changes while the action is being processed, set
        +     * [`LoadIndicator`](https://developers.google.com/workspace/add-ons/reference/rpc/google.apps.card.v1#loadindicator)
        +     * to `NONE`. For [card
        +     * messages](https://developers.google.com/workspace/chat/api/guides/v1/messages/create#create)
        +     * in Chat apps, you must also set the action's
        +     * [`ResponseType`](https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces.messages#responsetype)
        +     * to `UPDATE_MESSAGE` and use the same
        +     * [`card_id`](https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces.messages#CardWithId)
        +     * from the card that contained the action.
        +     *
        +     * If `false`, the form values are cleared when the action is triggered.
        +     * To prevent the user from making changes while the action is being
        +     * processed, set
        +     * [`LoadIndicator`](https://developers.google.com/workspace/add-ons/reference/rpc/google.apps.card.v1#loadindicator)
        +     * to `SPINNER`.
        +     * 
        + * + * bool persist_values = 4; + * + * @param value The persistValues to set. + * @return This builder for chaining. + */ + public Builder setPersistValues(boolean value) { + + persistValues_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + /** + * + * + *
        +     * Indicates whether form values persist after the action. The default value
        +     * is `false`.
        +     *
        +     * If `true`, form values remain after the action is triggered. To let the
        +     * user make changes while the action is being processed, set
        +     * [`LoadIndicator`](https://developers.google.com/workspace/add-ons/reference/rpc/google.apps.card.v1#loadindicator)
        +     * to `NONE`. For [card
        +     * messages](https://developers.google.com/workspace/chat/api/guides/v1/messages/create#create)
        +     * in Chat apps, you must also set the action's
        +     * [`ResponseType`](https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces.messages#responsetype)
        +     * to `UPDATE_MESSAGE` and use the same
        +     * [`card_id`](https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces.messages#CardWithId)
        +     * from the card that contained the action.
        +     *
        +     * If `false`, the form values are cleared when the action is triggered.
        +     * To prevent the user from making changes while the action is being
        +     * processed, set
        +     * [`LoadIndicator`](https://developers.google.com/workspace/add-ons/reference/rpc/google.apps.card.v1#loadindicator)
        +     * to `SPINNER`.
        +     * 
        + * + * bool persist_values = 4; + * + * @return This builder for chaining. + */ + public Builder clearPersistValues() { + bitField0_ = (bitField0_ & ~0x00000008); + persistValues_ = false; + onChanged(); + return this; + } + + private int interaction_ = 0; + + /** + * + * + *
        +     * Optional. Required when opening a
        +     * [dialog](https://developers.google.com/workspace/chat/dialogs).
        +     *
        +     * What to do in response to an interaction with a user, such as a user
        +     * clicking a button in a card message.
        +     *
        +     * If unspecified, the app responds by executing an `action`—like opening a
        +     * link or running a function—as normal.
        +     *
        +     * By specifying an `interaction`, the app can respond in special interactive
        +     * ways. For example, by setting `interaction` to `OPEN_DIALOG`, the app can
        +     * open a [dialog](https://developers.google.com/workspace/chat/dialogs). When
        +     * specified, a loading indicator isn't shown. If specified for
        +     * an add-on, the entire card is stripped and nothing is shown in the client.
        +     *
        +     * [Google Chat apps](https://developers.google.com/workspace/chat):
        +     * 
        + * + * .google.apps.card.v1.Action.Interaction interaction = 5; + * + * @return The enum numeric value on the wire for interaction. + */ + @java.lang.Override + public int getInteractionValue() { + return interaction_; + } + + /** + * + * + *
        +     * Optional. Required when opening a
        +     * [dialog](https://developers.google.com/workspace/chat/dialogs).
        +     *
        +     * What to do in response to an interaction with a user, such as a user
        +     * clicking a button in a card message.
        +     *
        +     * If unspecified, the app responds by executing an `action`—like opening a
        +     * link or running a function—as normal.
        +     *
        +     * By specifying an `interaction`, the app can respond in special interactive
        +     * ways. For example, by setting `interaction` to `OPEN_DIALOG`, the app can
        +     * open a [dialog](https://developers.google.com/workspace/chat/dialogs). When
        +     * specified, a loading indicator isn't shown. If specified for
        +     * an add-on, the entire card is stripped and nothing is shown in the client.
        +     *
        +     * [Google Chat apps](https://developers.google.com/workspace/chat):
        +     * 
        + * + * .google.apps.card.v1.Action.Interaction interaction = 5; + * + * @param value The enum numeric value on the wire for interaction to set. + * @return This builder for chaining. + */ + public Builder setInteractionValue(int value) { + interaction_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + /** + * + * + *
        +     * Optional. Required when opening a
        +     * [dialog](https://developers.google.com/workspace/chat/dialogs).
        +     *
        +     * What to do in response to an interaction with a user, such as a user
        +     * clicking a button in a card message.
        +     *
        +     * If unspecified, the app responds by executing an `action`—like opening a
        +     * link or running a function—as normal.
        +     *
        +     * By specifying an `interaction`, the app can respond in special interactive
        +     * ways. For example, by setting `interaction` to `OPEN_DIALOG`, the app can
        +     * open a [dialog](https://developers.google.com/workspace/chat/dialogs). When
        +     * specified, a loading indicator isn't shown. If specified for
        +     * an add-on, the entire card is stripped and nothing is shown in the client.
        +     *
        +     * [Google Chat apps](https://developers.google.com/workspace/chat):
        +     * 
        + * + * .google.apps.card.v1.Action.Interaction interaction = 5; + * + * @return The interaction. + */ + @java.lang.Override + public com.google.apps.card.v1.Action.Interaction getInteraction() { + com.google.apps.card.v1.Action.Interaction result = + com.google.apps.card.v1.Action.Interaction.forNumber(interaction_); + return result == null ? com.google.apps.card.v1.Action.Interaction.UNRECOGNIZED : result; + } + + /** + * + * + *
        +     * Optional. Required when opening a
        +     * [dialog](https://developers.google.com/workspace/chat/dialogs).
        +     *
        +     * What to do in response to an interaction with a user, such as a user
        +     * clicking a button in a card message.
        +     *
        +     * If unspecified, the app responds by executing an `action`—like opening a
        +     * link or running a function—as normal.
        +     *
        +     * By specifying an `interaction`, the app can respond in special interactive
        +     * ways. For example, by setting `interaction` to `OPEN_DIALOG`, the app can
        +     * open a [dialog](https://developers.google.com/workspace/chat/dialogs). When
        +     * specified, a loading indicator isn't shown. If specified for
        +     * an add-on, the entire card is stripped and nothing is shown in the client.
        +     *
        +     * [Google Chat apps](https://developers.google.com/workspace/chat):
        +     * 
        + * + * .google.apps.card.v1.Action.Interaction interaction = 5; + * + * @param value The interaction to set. + * @return This builder for chaining. + */ + public Builder setInteraction(com.google.apps.card.v1.Action.Interaction value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000010; + interaction_ = value.getNumber(); + onChanged(); + return this; + } + + /** + * + * + *
        +     * Optional. Required when opening a
        +     * [dialog](https://developers.google.com/workspace/chat/dialogs).
        +     *
        +     * What to do in response to an interaction with a user, such as a user
        +     * clicking a button in a card message.
        +     *
        +     * If unspecified, the app responds by executing an `action`—like opening a
        +     * link or running a function—as normal.
        +     *
        +     * By specifying an `interaction`, the app can respond in special interactive
        +     * ways. For example, by setting `interaction` to `OPEN_DIALOG`, the app can
        +     * open a [dialog](https://developers.google.com/workspace/chat/dialogs). When
        +     * specified, a loading indicator isn't shown. If specified for
        +     * an add-on, the entire card is stripped and nothing is shown in the client.
        +     *
        +     * [Google Chat apps](https://developers.google.com/workspace/chat):
        +     * 
        + * + * .google.apps.card.v1.Action.Interaction interaction = 5; + * + * @return This builder for chaining. + */ + public Builder clearInteraction() { + bitField0_ = (bitField0_ & ~0x00000010); + interaction_ = 0; + onChanged(); + return this; + } + + private com.google.protobuf.LazyStringArrayList requiredWidgets_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + + private void ensureRequiredWidgetsIsMutable() { + if (!requiredWidgets_.isModifiable()) { + requiredWidgets_ = new com.google.protobuf.LazyStringArrayList(requiredWidgets_); + } + bitField0_ |= 0x00000020; + } + + /** + * + * + *
        +     * Optional. Fill this list with the names of widgets that this Action
        +     * needs for a valid submission.
        +     *
        +     * If the widgets listed here don't have a value when this Action is invoked,
        +     * the form submission is aborted.
        +     *
        +     * [Google Workspace add-ons and Chat
        +     * apps](https://developers.google.com/workspace/extend):
        +     * 
        + * + * repeated string required_widgets = 6; + * + * @return A list containing the requiredWidgets. + */ + public com.google.protobuf.ProtocolStringList getRequiredWidgetsList() { + requiredWidgets_.makeImmutable(); + return requiredWidgets_; + } + + /** + * + * + *
        +     * Optional. Fill this list with the names of widgets that this Action
        +     * needs for a valid submission.
        +     *
        +     * If the widgets listed here don't have a value when this Action is invoked,
        +     * the form submission is aborted.
        +     *
        +     * [Google Workspace add-ons and Chat
        +     * apps](https://developers.google.com/workspace/extend):
        +     * 
        + * + * repeated string required_widgets = 6; + * + * @return The count of requiredWidgets. + */ + public int getRequiredWidgetsCount() { + return requiredWidgets_.size(); + } + + /** + * + * + *
        +     * Optional. Fill this list with the names of widgets that this Action
        +     * needs for a valid submission.
        +     *
        +     * If the widgets listed here don't have a value when this Action is invoked,
        +     * the form submission is aborted.
        +     *
        +     * [Google Workspace add-ons and Chat
        +     * apps](https://developers.google.com/workspace/extend):
        +     * 
        + * + * repeated string required_widgets = 6; + * + * @param index The index of the element to return. + * @return The requiredWidgets at the given index. + */ + public java.lang.String getRequiredWidgets(int index) { + return requiredWidgets_.get(index); + } + + /** + * + * + *
        +     * Optional. Fill this list with the names of widgets that this Action
        +     * needs for a valid submission.
        +     *
        +     * If the widgets listed here don't have a value when this Action is invoked,
        +     * the form submission is aborted.
        +     *
        +     * [Google Workspace add-ons and Chat
        +     * apps](https://developers.google.com/workspace/extend):
        +     * 
        + * + * repeated string required_widgets = 6; + * + * @param index The index of the value to return. + * @return The bytes of the requiredWidgets at the given index. + */ + public com.google.protobuf.ByteString getRequiredWidgetsBytes(int index) { + return requiredWidgets_.getByteString(index); + } + + /** + * + * + *
        +     * Optional. Fill this list with the names of widgets that this Action
        +     * needs for a valid submission.
        +     *
        +     * If the widgets listed here don't have a value when this Action is invoked,
        +     * the form submission is aborted.
        +     *
        +     * [Google Workspace add-ons and Chat
        +     * apps](https://developers.google.com/workspace/extend):
        +     * 
        + * + * repeated string required_widgets = 6; + * + * @param index The index to set the value at. + * @param value The requiredWidgets to set. + * @return This builder for chaining. + */ + public Builder setRequiredWidgets(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureRequiredWidgetsIsMutable(); + requiredWidgets_.set(index, value); + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + + /** + * + * + *
        +     * Optional. Fill this list with the names of widgets that this Action
        +     * needs for a valid submission.
        +     *
        +     * If the widgets listed here don't have a value when this Action is invoked,
        +     * the form submission is aborted.
        +     *
        +     * [Google Workspace add-ons and Chat
        +     * apps](https://developers.google.com/workspace/extend):
        +     * 
        + * + * repeated string required_widgets = 6; + * + * @param value The requiredWidgets to add. + * @return This builder for chaining. + */ + public Builder addRequiredWidgets(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureRequiredWidgetsIsMutable(); + requiredWidgets_.add(value); + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + + /** + * + * + *
        +     * Optional. Fill this list with the names of widgets that this Action
        +     * needs for a valid submission.
        +     *
        +     * If the widgets listed here don't have a value when this Action is invoked,
        +     * the form submission is aborted.
        +     *
        +     * [Google Workspace add-ons and Chat
        +     * apps](https://developers.google.com/workspace/extend):
        +     * 
        + * + * repeated string required_widgets = 6; + * + * @param values The requiredWidgets to add. + * @return This builder for chaining. + */ + public Builder addAllRequiredWidgets(java.lang.Iterable values) { + ensureRequiredWidgetsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, requiredWidgets_); + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + + /** + * + * + *
        +     * Optional. Fill this list with the names of widgets that this Action
        +     * needs for a valid submission.
        +     *
        +     * If the widgets listed here don't have a value when this Action is invoked,
        +     * the form submission is aborted.
        +     *
        +     * [Google Workspace add-ons and Chat
        +     * apps](https://developers.google.com/workspace/extend):
        +     * 
        + * + * repeated string required_widgets = 6; + * + * @return This builder for chaining. + */ + public Builder clearRequiredWidgets() { + requiredWidgets_ = com.google.protobuf.LazyStringArrayList.emptyList(); + bitField0_ = (bitField0_ & ~0x00000020); + ; + onChanged(); + return this; + } + + /** + * + * + *
        +     * Optional. Fill this list with the names of widgets that this Action
        +     * needs for a valid submission.
        +     *
        +     * If the widgets listed here don't have a value when this Action is invoked,
        +     * the form submission is aborted.
        +     *
        +     * [Google Workspace add-ons and Chat
        +     * apps](https://developers.google.com/workspace/extend):
        +     * 
        + * + * repeated string required_widgets = 6; + * + * @param value The bytes of the requiredWidgets to add. + * @return This builder for chaining. + */ + public Builder addRequiredWidgetsBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureRequiredWidgetsIsMutable(); + requiredWidgets_.add(value); + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + + private boolean allWidgetsAreRequired_; + + /** + * + * + *
        +     * Optional. If this is true, then all widgets are considered required by
        +     * this action.
        +     *
        +     * [Google Workspace add-ons and Chat
        +     * apps](https://developers.google.com/workspace/extend):
        +     * 
        + * + * bool all_widgets_are_required = 7; + * + * @return The allWidgetsAreRequired. + */ + @java.lang.Override + public boolean getAllWidgetsAreRequired() { + return allWidgetsAreRequired_; + } + + /** + * + * + *
        +     * Optional. If this is true, then all widgets are considered required by
        +     * this action.
        +     *
        +     * [Google Workspace add-ons and Chat
        +     * apps](https://developers.google.com/workspace/extend):
        +     * 
        + * + * bool all_widgets_are_required = 7; + * + * @param value The allWidgetsAreRequired to set. + * @return This builder for chaining. + */ + public Builder setAllWidgetsAreRequired(boolean value) { + + allWidgetsAreRequired_ = value; + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + + /** + * + * + *
        +     * Optional. If this is true, then all widgets are considered required by
        +     * this action.
        +     *
        +     * [Google Workspace add-ons and Chat
        +     * apps](https://developers.google.com/workspace/extend):
        +     * 
        + * + * bool all_widgets_are_required = 7; + * + * @return This builder for chaining. + */ + public Builder clearAllWidgetsAreRequired() { + bitField0_ = (bitField0_ & ~0x00000040); + allWidgetsAreRequired_ = false; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.apps.card.v1.Action) + } + + // @@protoc_insertion_point(class_scope:google.apps.card.v1.Action) + private static final com.google.apps.card.v1.Action DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.apps.card.v1.Action(); + } + + public static com.google.apps.card.v1.Action getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Action 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.apps.card.v1.Action getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-common-protos/proto-google-common-protos/src/main/java/com/google/apps/card/v1/ActionOrBuilder.java b/java-common-protos/proto-google-common-protos/src/main/java/com/google/apps/card/v1/ActionOrBuilder.java new file mode 100644 index 0000000000..f42588abde --- /dev/null +++ b/java-common-protos/proto-google-common-protos/src/main/java/com/google/apps/card/v1/ActionOrBuilder.java @@ -0,0 +1,332 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/apps/card/v1/card.proto +// Protobuf Java Version: 4.33.2 + +package com.google.apps.card.v1; + +@com.google.protobuf.Generated +public interface ActionOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.apps.card.v1.Action) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
        +   * A custom function to invoke when the containing element is
        +   * clicked or otherwise activated.
        +   *
        +   * For example usage, see [Read form
        +   * data](https://developers.google.com/workspace/chat/read-form-data).
        +   * 
        + * + * string function = 1; + * + * @return The function. + */ + java.lang.String getFunction(); + + /** + * + * + *
        +   * A custom function to invoke when the containing element is
        +   * clicked or otherwise activated.
        +   *
        +   * For example usage, see [Read form
        +   * data](https://developers.google.com/workspace/chat/read-form-data).
        +   * 
        + * + * string function = 1; + * + * @return The bytes for function. + */ + com.google.protobuf.ByteString getFunctionBytes(); + + /** + * + * + *
        +   * List of action parameters.
        +   * 
        + * + * repeated .google.apps.card.v1.Action.ActionParameter parameters = 2; + */ + java.util.List getParametersList(); + + /** + * + * + *
        +   * List of action parameters.
        +   * 
        + * + * repeated .google.apps.card.v1.Action.ActionParameter parameters = 2; + */ + com.google.apps.card.v1.Action.ActionParameter getParameters(int index); + + /** + * + * + *
        +   * List of action parameters.
        +   * 
        + * + * repeated .google.apps.card.v1.Action.ActionParameter parameters = 2; + */ + int getParametersCount(); + + /** + * + * + *
        +   * List of action parameters.
        +   * 
        + * + * repeated .google.apps.card.v1.Action.ActionParameter parameters = 2; + */ + java.util.List + getParametersOrBuilderList(); + + /** + * + * + *
        +   * List of action parameters.
        +   * 
        + * + * repeated .google.apps.card.v1.Action.ActionParameter parameters = 2; + */ + com.google.apps.card.v1.Action.ActionParameterOrBuilder getParametersOrBuilder(int index); + + /** + * + * + *
        +   * Specifies the loading indicator that the action displays while
        +   * making the call to the action.
        +   * 
        + * + * .google.apps.card.v1.Action.LoadIndicator load_indicator = 3; + * + * @return The enum numeric value on the wire for loadIndicator. + */ + int getLoadIndicatorValue(); + + /** + * + * + *
        +   * Specifies the loading indicator that the action displays while
        +   * making the call to the action.
        +   * 
        + * + * .google.apps.card.v1.Action.LoadIndicator load_indicator = 3; + * + * @return The loadIndicator. + */ + com.google.apps.card.v1.Action.LoadIndicator getLoadIndicator(); + + /** + * + * + *
        +   * Indicates whether form values persist after the action. The default value
        +   * is `false`.
        +   *
        +   * If `true`, form values remain after the action is triggered. To let the
        +   * user make changes while the action is being processed, set
        +   * [`LoadIndicator`](https://developers.google.com/workspace/add-ons/reference/rpc/google.apps.card.v1#loadindicator)
        +   * to `NONE`. For [card
        +   * messages](https://developers.google.com/workspace/chat/api/guides/v1/messages/create#create)
        +   * in Chat apps, you must also set the action's
        +   * [`ResponseType`](https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces.messages#responsetype)
        +   * to `UPDATE_MESSAGE` and use the same
        +   * [`card_id`](https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces.messages#CardWithId)
        +   * from the card that contained the action.
        +   *
        +   * If `false`, the form values are cleared when the action is triggered.
        +   * To prevent the user from making changes while the action is being
        +   * processed, set
        +   * [`LoadIndicator`](https://developers.google.com/workspace/add-ons/reference/rpc/google.apps.card.v1#loadindicator)
        +   * to `SPINNER`.
        +   * 
        + * + * bool persist_values = 4; + * + * @return The persistValues. + */ + boolean getPersistValues(); + + /** + * + * + *
        +   * Optional. Required when opening a
        +   * [dialog](https://developers.google.com/workspace/chat/dialogs).
        +   *
        +   * What to do in response to an interaction with a user, such as a user
        +   * clicking a button in a card message.
        +   *
        +   * If unspecified, the app responds by executing an `action`—like opening a
        +   * link or running a function—as normal.
        +   *
        +   * By specifying an `interaction`, the app can respond in special interactive
        +   * ways. For example, by setting `interaction` to `OPEN_DIALOG`, the app can
        +   * open a [dialog](https://developers.google.com/workspace/chat/dialogs). When
        +   * specified, a loading indicator isn't shown. If specified for
        +   * an add-on, the entire card is stripped and nothing is shown in the client.
        +   *
        +   * [Google Chat apps](https://developers.google.com/workspace/chat):
        +   * 
        + * + * .google.apps.card.v1.Action.Interaction interaction = 5; + * + * @return The enum numeric value on the wire for interaction. + */ + int getInteractionValue(); + + /** + * + * + *
        +   * Optional. Required when opening a
        +   * [dialog](https://developers.google.com/workspace/chat/dialogs).
        +   *
        +   * What to do in response to an interaction with a user, such as a user
        +   * clicking a button in a card message.
        +   *
        +   * If unspecified, the app responds by executing an `action`—like opening a
        +   * link or running a function—as normal.
        +   *
        +   * By specifying an `interaction`, the app can respond in special interactive
        +   * ways. For example, by setting `interaction` to `OPEN_DIALOG`, the app can
        +   * open a [dialog](https://developers.google.com/workspace/chat/dialogs). When
        +   * specified, a loading indicator isn't shown. If specified for
        +   * an add-on, the entire card is stripped and nothing is shown in the client.
        +   *
        +   * [Google Chat apps](https://developers.google.com/workspace/chat):
        +   * 
        + * + * .google.apps.card.v1.Action.Interaction interaction = 5; + * + * @return The interaction. + */ + com.google.apps.card.v1.Action.Interaction getInteraction(); + + /** + * + * + *
        +   * Optional. Fill this list with the names of widgets that this Action
        +   * needs for a valid submission.
        +   *
        +   * If the widgets listed here don't have a value when this Action is invoked,
        +   * the form submission is aborted.
        +   *
        +   * [Google Workspace add-ons and Chat
        +   * apps](https://developers.google.com/workspace/extend):
        +   * 
        + * + * repeated string required_widgets = 6; + * + * @return A list containing the requiredWidgets. + */ + java.util.List getRequiredWidgetsList(); + + /** + * + * + *
        +   * Optional. Fill this list with the names of widgets that this Action
        +   * needs for a valid submission.
        +   *
        +   * If the widgets listed here don't have a value when this Action is invoked,
        +   * the form submission is aborted.
        +   *
        +   * [Google Workspace add-ons and Chat
        +   * apps](https://developers.google.com/workspace/extend):
        +   * 
        + * + * repeated string required_widgets = 6; + * + * @return The count of requiredWidgets. + */ + int getRequiredWidgetsCount(); + + /** + * + * + *
        +   * Optional. Fill this list with the names of widgets that this Action
        +   * needs for a valid submission.
        +   *
        +   * If the widgets listed here don't have a value when this Action is invoked,
        +   * the form submission is aborted.
        +   *
        +   * [Google Workspace add-ons and Chat
        +   * apps](https://developers.google.com/workspace/extend):
        +   * 
        + * + * repeated string required_widgets = 6; + * + * @param index The index of the element to return. + * @return The requiredWidgets at the given index. + */ + java.lang.String getRequiredWidgets(int index); + + /** + * + * + *
        +   * Optional. Fill this list with the names of widgets that this Action
        +   * needs for a valid submission.
        +   *
        +   * If the widgets listed here don't have a value when this Action is invoked,
        +   * the form submission is aborted.
        +   *
        +   * [Google Workspace add-ons and Chat
        +   * apps](https://developers.google.com/workspace/extend):
        +   * 
        + * + * repeated string required_widgets = 6; + * + * @param index The index of the value to return. + * @return The bytes of the requiredWidgets at the given index. + */ + com.google.protobuf.ByteString getRequiredWidgetsBytes(int index); + + /** + * + * + *
        +   * Optional. If this is true, then all widgets are considered required by
        +   * this action.
        +   *
        +   * [Google Workspace add-ons and Chat
        +   * apps](https://developers.google.com/workspace/extend):
        +   * 
        + * + * bool all_widgets_are_required = 7; + * + * @return The allWidgetsAreRequired. + */ + boolean getAllWidgetsAreRequired(); +} diff --git a/java-common-protos/proto-google-common-protos/src/main/java/com/google/apps/card/v1/BorderStyle.java b/java-common-protos/proto-google-common-protos/src/main/java/com/google/apps/card/v1/BorderStyle.java new file mode 100644 index 0000000000..98a20743a2 --- /dev/null +++ b/java-common-protos/proto-google-common-protos/src/main/java/com/google/apps/card/v1/BorderStyle.java @@ -0,0 +1,1346 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/apps/card/v1/card.proto +// Protobuf Java Version: 4.33.2 + +package com.google.apps.card.v1; + +/** + * + * + *
        + * The style options for the border of a card or widget, including the border
        + * type and color.
        + *
        + * [Google Workspace add-ons and Chat
        + * apps](https://developers.google.com/workspace/extend):
        + * 
        + * + * Protobuf type {@code google.apps.card.v1.BorderStyle} + */ +@com.google.protobuf.Generated +public final class BorderStyle extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.apps.card.v1.BorderStyle) + BorderStyleOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "BorderStyle"); + } + + // Use BorderStyle.newBuilder() to construct. + private BorderStyle(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private BorderStyle() { + type_ = 0; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.apps.card.v1.CardProto + .internal_static_google_apps_card_v1_BorderStyle_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.apps.card.v1.CardProto + .internal_static_google_apps_card_v1_BorderStyle_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.apps.card.v1.BorderStyle.class, + com.google.apps.card.v1.BorderStyle.Builder.class); + } + + /** + * + * + *
        +   * Represents the border types applied to widgets.
        +   *
        +   * [Google Workspace add-ons
        +   * and Chat apps](https://developers.google.com/workspace/extend):
        +   * 
        + * + * Protobuf enum {@code google.apps.card.v1.BorderStyle.BorderType} + */ + public enum BorderType implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
        +     * Don't use. Unspecified.
        +     * 
        + * + * BORDER_TYPE_UNSPECIFIED = 0; + */ + BORDER_TYPE_UNSPECIFIED(0), + /** + * + * + *
        +     * No border.
        +     * 
        + * + * NO_BORDER = 1; + */ + NO_BORDER(1), + /** + * + * + *
        +     * Default value. Outline.
        +     * 
        + * + * STROKE = 2; + */ + STROKE(2), + UNRECOGNIZED(-1), + ; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "BorderType"); + } + + /** + * + * + *
        +     * Don't use. Unspecified.
        +     * 
        + * + * BORDER_TYPE_UNSPECIFIED = 0; + */ + public static final int BORDER_TYPE_UNSPECIFIED_VALUE = 0; + + /** + * + * + *
        +     * No border.
        +     * 
        + * + * NO_BORDER = 1; + */ + public static final int NO_BORDER_VALUE = 1; + + /** + * + * + *
        +     * Default value. Outline.
        +     * 
        + * + * STROKE = 2; + */ + public static final int STROKE_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 BorderType 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 BorderType forNumber(int value) { + switch (value) { + case 0: + return BORDER_TYPE_UNSPECIFIED; + case 1: + return NO_BORDER; + case 2: + return STROKE; + 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 BorderType findValueByNumber(int number) { + return BorderType.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 com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.apps.card.v1.BorderStyle.getDescriptor().getEnumTypes().get(0); + } + + private static final BorderType[] VALUES = values(); + + public static BorderType 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 BorderType(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.apps.card.v1.BorderStyle.BorderType) + } + + private int bitField0_; + public static final int TYPE_FIELD_NUMBER = 1; + private int type_ = 0; + + /** + * + * + *
        +   * The border type.
        +   * 
        + * + * .google.apps.card.v1.BorderStyle.BorderType type = 1; + * + * @return The enum numeric value on the wire for type. + */ + @java.lang.Override + public int getTypeValue() { + return type_; + } + + /** + * + * + *
        +   * The border type.
        +   * 
        + * + * .google.apps.card.v1.BorderStyle.BorderType type = 1; + * + * @return The type. + */ + @java.lang.Override + public com.google.apps.card.v1.BorderStyle.BorderType getType() { + com.google.apps.card.v1.BorderStyle.BorderType result = + com.google.apps.card.v1.BorderStyle.BorderType.forNumber(type_); + return result == null ? com.google.apps.card.v1.BorderStyle.BorderType.UNRECOGNIZED : result; + } + + public static final int STROKE_COLOR_FIELD_NUMBER = 2; + private com.google.type.Color strokeColor_; + + /** + * + * + *
        +   * The colors to use when the type is `BORDER_TYPE_STROKE`.
        +   *
        +   * To set the stroke color, specify a value for the `red`, `green`, and `blue`
        +   * fields.
        +   * The value must be a float number between 0 and 1 based on the RGB color
        +   * value, where `0` (0/255) represents the absence of color  and `1` (255/255)
        +   * represents the maximum intensity of the color.
        +   *
        +   * For example, the following sets the color to red at its maximum intensity:
        +   *
        +   * ```
        +   * "color": {
        +   * "red": 1,
        +   * "green": 0,
        +   * "blue": 0,
        +   * }
        +   * ```
        +   *
        +   * The `alpha` field is unavailable for stroke color. If specified, this field
        +   * is ignored.
        +   * 
        + * + * .google.type.Color stroke_color = 2; + * + * @return Whether the strokeColor field is set. + */ + @java.lang.Override + public boolean hasStrokeColor() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
        +   * The colors to use when the type is `BORDER_TYPE_STROKE`.
        +   *
        +   * To set the stroke color, specify a value for the `red`, `green`, and `blue`
        +   * fields.
        +   * The value must be a float number between 0 and 1 based on the RGB color
        +   * value, where `0` (0/255) represents the absence of color  and `1` (255/255)
        +   * represents the maximum intensity of the color.
        +   *
        +   * For example, the following sets the color to red at its maximum intensity:
        +   *
        +   * ```
        +   * "color": {
        +   * "red": 1,
        +   * "green": 0,
        +   * "blue": 0,
        +   * }
        +   * ```
        +   *
        +   * The `alpha` field is unavailable for stroke color. If specified, this field
        +   * is ignored.
        +   * 
        + * + * .google.type.Color stroke_color = 2; + * + * @return The strokeColor. + */ + @java.lang.Override + public com.google.type.Color getStrokeColor() { + return strokeColor_ == null ? com.google.type.Color.getDefaultInstance() : strokeColor_; + } + + /** + * + * + *
        +   * The colors to use when the type is `BORDER_TYPE_STROKE`.
        +   *
        +   * To set the stroke color, specify a value for the `red`, `green`, and `blue`
        +   * fields.
        +   * The value must be a float number between 0 and 1 based on the RGB color
        +   * value, where `0` (0/255) represents the absence of color  and `1` (255/255)
        +   * represents the maximum intensity of the color.
        +   *
        +   * For example, the following sets the color to red at its maximum intensity:
        +   *
        +   * ```
        +   * "color": {
        +   * "red": 1,
        +   * "green": 0,
        +   * "blue": 0,
        +   * }
        +   * ```
        +   *
        +   * The `alpha` field is unavailable for stroke color. If specified, this field
        +   * is ignored.
        +   * 
        + * + * .google.type.Color stroke_color = 2; + */ + @java.lang.Override + public com.google.type.ColorOrBuilder getStrokeColorOrBuilder() { + return strokeColor_ == null ? com.google.type.Color.getDefaultInstance() : strokeColor_; + } + + public static final int CORNER_RADIUS_FIELD_NUMBER = 3; + private int cornerRadius_ = 0; + + /** + * + * + *
        +   * The corner radius for the border.
        +   * 
        + * + * int32 corner_radius = 3; + * + * @return The cornerRadius. + */ + @java.lang.Override + public int getCornerRadius() { + return cornerRadius_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (type_ + != com.google.apps.card.v1.BorderStyle.BorderType.BORDER_TYPE_UNSPECIFIED.getNumber()) { + output.writeEnum(1, type_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(2, getStrokeColor()); + } + if (cornerRadius_ != 0) { + output.writeInt32(3, cornerRadius_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (type_ + != com.google.apps.card.v1.BorderStyle.BorderType.BORDER_TYPE_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(1, type_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getStrokeColor()); + } + if (cornerRadius_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(3, cornerRadius_); + } + 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.apps.card.v1.BorderStyle)) { + return super.equals(obj); + } + com.google.apps.card.v1.BorderStyle other = (com.google.apps.card.v1.BorderStyle) obj; + + if (type_ != other.type_) return false; + if (hasStrokeColor() != other.hasStrokeColor()) return false; + if (hasStrokeColor()) { + if (!getStrokeColor().equals(other.getStrokeColor())) return false; + } + if (getCornerRadius() != other.getCornerRadius()) 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) + TYPE_FIELD_NUMBER; + hash = (53 * hash) + type_; + if (hasStrokeColor()) { + hash = (37 * hash) + STROKE_COLOR_FIELD_NUMBER; + hash = (53 * hash) + getStrokeColor().hashCode(); + } + hash = (37 * hash) + CORNER_RADIUS_FIELD_NUMBER; + hash = (53 * hash) + getCornerRadius(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.apps.card.v1.BorderStyle parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.apps.card.v1.BorderStyle parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.apps.card.v1.BorderStyle parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.apps.card.v1.BorderStyle 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.apps.card.v1.BorderStyle parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.apps.card.v1.BorderStyle parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.apps.card.v1.BorderStyle parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.apps.card.v1.BorderStyle parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.apps.card.v1.BorderStyle parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.apps.card.v1.BorderStyle parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.apps.card.v1.BorderStyle parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.apps.card.v1.BorderStyle parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.apps.card.v1.BorderStyle 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
        +   * The style options for the border of a card or widget, including the border
        +   * type and color.
        +   *
        +   * [Google Workspace add-ons and Chat
        +   * apps](https://developers.google.com/workspace/extend):
        +   * 
        + * + * Protobuf type {@code google.apps.card.v1.BorderStyle} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.apps.card.v1.BorderStyle) + com.google.apps.card.v1.BorderStyleOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.apps.card.v1.CardProto + .internal_static_google_apps_card_v1_BorderStyle_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.apps.card.v1.CardProto + .internal_static_google_apps_card_v1_BorderStyle_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.apps.card.v1.BorderStyle.class, + com.google.apps.card.v1.BorderStyle.Builder.class); + } + + // Construct using com.google.apps.card.v1.BorderStyle.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetStrokeColorFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + type_ = 0; + strokeColor_ = null; + if (strokeColorBuilder_ != null) { + strokeColorBuilder_.dispose(); + strokeColorBuilder_ = null; + } + cornerRadius_ = 0; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.apps.card.v1.CardProto + .internal_static_google_apps_card_v1_BorderStyle_descriptor; + } + + @java.lang.Override + public com.google.apps.card.v1.BorderStyle getDefaultInstanceForType() { + return com.google.apps.card.v1.BorderStyle.getDefaultInstance(); + } + + @java.lang.Override + public com.google.apps.card.v1.BorderStyle build() { + com.google.apps.card.v1.BorderStyle result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.apps.card.v1.BorderStyle buildPartial() { + com.google.apps.card.v1.BorderStyle result = new com.google.apps.card.v1.BorderStyle(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.apps.card.v1.BorderStyle result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.type_ = type_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.strokeColor_ = + strokeColorBuilder_ == null ? strokeColor_ : strokeColorBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.cornerRadius_ = cornerRadius_; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.apps.card.v1.BorderStyle) { + return mergeFrom((com.google.apps.card.v1.BorderStyle) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.apps.card.v1.BorderStyle other) { + if (other == com.google.apps.card.v1.BorderStyle.getDefaultInstance()) return this; + if (other.type_ != 0) { + setTypeValue(other.getTypeValue()); + } + if (other.hasStrokeColor()) { + mergeStrokeColor(other.getStrokeColor()); + } + if (other.getCornerRadius() != 0) { + setCornerRadius(other.getCornerRadius()); + } + 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: + { + type_ = input.readEnum(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 18: + { + input.readMessage( + internalGetStrokeColorFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 24: + { + cornerRadius_ = 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 int type_ = 0; + + /** + * + * + *
        +     * The border type.
        +     * 
        + * + * .google.apps.card.v1.BorderStyle.BorderType type = 1; + * + * @return The enum numeric value on the wire for type. + */ + @java.lang.Override + public int getTypeValue() { + return type_; + } + + /** + * + * + *
        +     * The border type.
        +     * 
        + * + * .google.apps.card.v1.BorderStyle.BorderType type = 1; + * + * @param value The enum numeric value on the wire for type to set. + * @return This builder for chaining. + */ + public Builder setTypeValue(int value) { + type_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
        +     * The border type.
        +     * 
        + * + * .google.apps.card.v1.BorderStyle.BorderType type = 1; + * + * @return The type. + */ + @java.lang.Override + public com.google.apps.card.v1.BorderStyle.BorderType getType() { + com.google.apps.card.v1.BorderStyle.BorderType result = + com.google.apps.card.v1.BorderStyle.BorderType.forNumber(type_); + return result == null ? com.google.apps.card.v1.BorderStyle.BorderType.UNRECOGNIZED : result; + } + + /** + * + * + *
        +     * The border type.
        +     * 
        + * + * .google.apps.card.v1.BorderStyle.BorderType type = 1; + * + * @param value The type to set. + * @return This builder for chaining. + */ + public Builder setType(com.google.apps.card.v1.BorderStyle.BorderType value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000001; + type_ = value.getNumber(); + onChanged(); + return this; + } + + /** + * + * + *
        +     * The border type.
        +     * 
        + * + * .google.apps.card.v1.BorderStyle.BorderType type = 1; + * + * @return This builder for chaining. + */ + public Builder clearType() { + bitField0_ = (bitField0_ & ~0x00000001); + type_ = 0; + onChanged(); + return this; + } + + private com.google.type.Color strokeColor_; + private com.google.protobuf.SingleFieldBuilder< + com.google.type.Color, com.google.type.Color.Builder, com.google.type.ColorOrBuilder> + strokeColorBuilder_; + + /** + * + * + *
        +     * The colors to use when the type is `BORDER_TYPE_STROKE`.
        +     *
        +     * To set the stroke color, specify a value for the `red`, `green`, and `blue`
        +     * fields.
        +     * The value must be a float number between 0 and 1 based on the RGB color
        +     * value, where `0` (0/255) represents the absence of color  and `1` (255/255)
        +     * represents the maximum intensity of the color.
        +     *
        +     * For example, the following sets the color to red at its maximum intensity:
        +     *
        +     * ```
        +     * "color": {
        +     * "red": 1,
        +     * "green": 0,
        +     * "blue": 0,
        +     * }
        +     * ```
        +     *
        +     * The `alpha` field is unavailable for stroke color. If specified, this field
        +     * is ignored.
        +     * 
        + * + * .google.type.Color stroke_color = 2; + * + * @return Whether the strokeColor field is set. + */ + public boolean hasStrokeColor() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
        +     * The colors to use when the type is `BORDER_TYPE_STROKE`.
        +     *
        +     * To set the stroke color, specify a value for the `red`, `green`, and `blue`
        +     * fields.
        +     * The value must be a float number between 0 and 1 based on the RGB color
        +     * value, where `0` (0/255) represents the absence of color  and `1` (255/255)
        +     * represents the maximum intensity of the color.
        +     *
        +     * For example, the following sets the color to red at its maximum intensity:
        +     *
        +     * ```
        +     * "color": {
        +     * "red": 1,
        +     * "green": 0,
        +     * "blue": 0,
        +     * }
        +     * ```
        +     *
        +     * The `alpha` field is unavailable for stroke color. If specified, this field
        +     * is ignored.
        +     * 
        + * + * .google.type.Color stroke_color = 2; + * + * @return The strokeColor. + */ + public com.google.type.Color getStrokeColor() { + if (strokeColorBuilder_ == null) { + return strokeColor_ == null ? com.google.type.Color.getDefaultInstance() : strokeColor_; + } else { + return strokeColorBuilder_.getMessage(); + } + } + + /** + * + * + *
        +     * The colors to use when the type is `BORDER_TYPE_STROKE`.
        +     *
        +     * To set the stroke color, specify a value for the `red`, `green`, and `blue`
        +     * fields.
        +     * The value must be a float number between 0 and 1 based on the RGB color
        +     * value, where `0` (0/255) represents the absence of color  and `1` (255/255)
        +     * represents the maximum intensity of the color.
        +     *
        +     * For example, the following sets the color to red at its maximum intensity:
        +     *
        +     * ```
        +     * "color": {
        +     * "red": 1,
        +     * "green": 0,
        +     * "blue": 0,
        +     * }
        +     * ```
        +     *
        +     * The `alpha` field is unavailable for stroke color. If specified, this field
        +     * is ignored.
        +     * 
        + * + * .google.type.Color stroke_color = 2; + */ + public Builder setStrokeColor(com.google.type.Color value) { + if (strokeColorBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + strokeColor_ = value; + } else { + strokeColorBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
        +     * The colors to use when the type is `BORDER_TYPE_STROKE`.
        +     *
        +     * To set the stroke color, specify a value for the `red`, `green`, and `blue`
        +     * fields.
        +     * The value must be a float number between 0 and 1 based on the RGB color
        +     * value, where `0` (0/255) represents the absence of color  and `1` (255/255)
        +     * represents the maximum intensity of the color.
        +     *
        +     * For example, the following sets the color to red at its maximum intensity:
        +     *
        +     * ```
        +     * "color": {
        +     * "red": 1,
        +     * "green": 0,
        +     * "blue": 0,
        +     * }
        +     * ```
        +     *
        +     * The `alpha` field is unavailable for stroke color. If specified, this field
        +     * is ignored.
        +     * 
        + * + * .google.type.Color stroke_color = 2; + */ + public Builder setStrokeColor(com.google.type.Color.Builder builderForValue) { + if (strokeColorBuilder_ == null) { + strokeColor_ = builderForValue.build(); + } else { + strokeColorBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
        +     * The colors to use when the type is `BORDER_TYPE_STROKE`.
        +     *
        +     * To set the stroke color, specify a value for the `red`, `green`, and `blue`
        +     * fields.
        +     * The value must be a float number between 0 and 1 based on the RGB color
        +     * value, where `0` (0/255) represents the absence of color  and `1` (255/255)
        +     * represents the maximum intensity of the color.
        +     *
        +     * For example, the following sets the color to red at its maximum intensity:
        +     *
        +     * ```
        +     * "color": {
        +     * "red": 1,
        +     * "green": 0,
        +     * "blue": 0,
        +     * }
        +     * ```
        +     *
        +     * The `alpha` field is unavailable for stroke color. If specified, this field
        +     * is ignored.
        +     * 
        + * + * .google.type.Color stroke_color = 2; + */ + public Builder mergeStrokeColor(com.google.type.Color value) { + if (strokeColorBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && strokeColor_ != null + && strokeColor_ != com.google.type.Color.getDefaultInstance()) { + getStrokeColorBuilder().mergeFrom(value); + } else { + strokeColor_ = value; + } + } else { + strokeColorBuilder_.mergeFrom(value); + } + if (strokeColor_ != null) { + bitField0_ |= 0x00000002; + onChanged(); + } + return this; + } + + /** + * + * + *
        +     * The colors to use when the type is `BORDER_TYPE_STROKE`.
        +     *
        +     * To set the stroke color, specify a value for the `red`, `green`, and `blue`
        +     * fields.
        +     * The value must be a float number between 0 and 1 based on the RGB color
        +     * value, where `0` (0/255) represents the absence of color  and `1` (255/255)
        +     * represents the maximum intensity of the color.
        +     *
        +     * For example, the following sets the color to red at its maximum intensity:
        +     *
        +     * ```
        +     * "color": {
        +     * "red": 1,
        +     * "green": 0,
        +     * "blue": 0,
        +     * }
        +     * ```
        +     *
        +     * The `alpha` field is unavailable for stroke color. If specified, this field
        +     * is ignored.
        +     * 
        + * + * .google.type.Color stroke_color = 2; + */ + public Builder clearStrokeColor() { + bitField0_ = (bitField0_ & ~0x00000002); + strokeColor_ = null; + if (strokeColorBuilder_ != null) { + strokeColorBuilder_.dispose(); + strokeColorBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
        +     * The colors to use when the type is `BORDER_TYPE_STROKE`.
        +     *
        +     * To set the stroke color, specify a value for the `red`, `green`, and `blue`
        +     * fields.
        +     * The value must be a float number between 0 and 1 based on the RGB color
        +     * value, where `0` (0/255) represents the absence of color  and `1` (255/255)
        +     * represents the maximum intensity of the color.
        +     *
        +     * For example, the following sets the color to red at its maximum intensity:
        +     *
        +     * ```
        +     * "color": {
        +     * "red": 1,
        +     * "green": 0,
        +     * "blue": 0,
        +     * }
        +     * ```
        +     *
        +     * The `alpha` field is unavailable for stroke color. If specified, this field
        +     * is ignored.
        +     * 
        + * + * .google.type.Color stroke_color = 2; + */ + public com.google.type.Color.Builder getStrokeColorBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return internalGetStrokeColorFieldBuilder().getBuilder(); + } + + /** + * + * + *
        +     * The colors to use when the type is `BORDER_TYPE_STROKE`.
        +     *
        +     * To set the stroke color, specify a value for the `red`, `green`, and `blue`
        +     * fields.
        +     * The value must be a float number between 0 and 1 based on the RGB color
        +     * value, where `0` (0/255) represents the absence of color  and `1` (255/255)
        +     * represents the maximum intensity of the color.
        +     *
        +     * For example, the following sets the color to red at its maximum intensity:
        +     *
        +     * ```
        +     * "color": {
        +     * "red": 1,
        +     * "green": 0,
        +     * "blue": 0,
        +     * }
        +     * ```
        +     *
        +     * The `alpha` field is unavailable for stroke color. If specified, this field
        +     * is ignored.
        +     * 
        + * + * .google.type.Color stroke_color = 2; + */ + public com.google.type.ColorOrBuilder getStrokeColorOrBuilder() { + if (strokeColorBuilder_ != null) { + return strokeColorBuilder_.getMessageOrBuilder(); + } else { + return strokeColor_ == null ? com.google.type.Color.getDefaultInstance() : strokeColor_; + } + } + + /** + * + * + *
        +     * The colors to use when the type is `BORDER_TYPE_STROKE`.
        +     *
        +     * To set the stroke color, specify a value for the `red`, `green`, and `blue`
        +     * fields.
        +     * The value must be a float number between 0 and 1 based on the RGB color
        +     * value, where `0` (0/255) represents the absence of color  and `1` (255/255)
        +     * represents the maximum intensity of the color.
        +     *
        +     * For example, the following sets the color to red at its maximum intensity:
        +     *
        +     * ```
        +     * "color": {
        +     * "red": 1,
        +     * "green": 0,
        +     * "blue": 0,
        +     * }
        +     * ```
        +     *
        +     * The `alpha` field is unavailable for stroke color. If specified, this field
        +     * is ignored.
        +     * 
        + * + * .google.type.Color stroke_color = 2; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.type.Color, com.google.type.Color.Builder, com.google.type.ColorOrBuilder> + internalGetStrokeColorFieldBuilder() { + if (strokeColorBuilder_ == null) { + strokeColorBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.type.Color, + com.google.type.Color.Builder, + com.google.type.ColorOrBuilder>( + getStrokeColor(), getParentForChildren(), isClean()); + strokeColor_ = null; + } + return strokeColorBuilder_; + } + + private int cornerRadius_; + + /** + * + * + *
        +     * The corner radius for the border.
        +     * 
        + * + * int32 corner_radius = 3; + * + * @return The cornerRadius. + */ + @java.lang.Override + public int getCornerRadius() { + return cornerRadius_; + } + + /** + * + * + *
        +     * The corner radius for the border.
        +     * 
        + * + * int32 corner_radius = 3; + * + * @param value The cornerRadius to set. + * @return This builder for chaining. + */ + public Builder setCornerRadius(int value) { + + cornerRadius_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
        +     * The corner radius for the border.
        +     * 
        + * + * int32 corner_radius = 3; + * + * @return This builder for chaining. + */ + public Builder clearCornerRadius() { + bitField0_ = (bitField0_ & ~0x00000004); + cornerRadius_ = 0; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.apps.card.v1.BorderStyle) + } + + // @@protoc_insertion_point(class_scope:google.apps.card.v1.BorderStyle) + private static final com.google.apps.card.v1.BorderStyle DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.apps.card.v1.BorderStyle(); + } + + public static com.google.apps.card.v1.BorderStyle getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public BorderStyle 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.apps.card.v1.BorderStyle getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-common-protos/proto-google-common-protos/src/main/java/com/google/apps/card/v1/BorderStyleOrBuilder.java b/java-common-protos/proto-google-common-protos/src/main/java/com/google/apps/card/v1/BorderStyleOrBuilder.java new file mode 100644 index 0000000000..a0f7bb69f9 --- /dev/null +++ b/java-common-protos/proto-google-common-protos/src/main/java/com/google/apps/card/v1/BorderStyleOrBuilder.java @@ -0,0 +1,161 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/apps/card/v1/card.proto +// Protobuf Java Version: 4.33.2 + +package com.google.apps.card.v1; + +@com.google.protobuf.Generated +public interface BorderStyleOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.apps.card.v1.BorderStyle) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
        +   * The border type.
        +   * 
        + * + * .google.apps.card.v1.BorderStyle.BorderType type = 1; + * + * @return The enum numeric value on the wire for type. + */ + int getTypeValue(); + + /** + * + * + *
        +   * The border type.
        +   * 
        + * + * .google.apps.card.v1.BorderStyle.BorderType type = 1; + * + * @return The type. + */ + com.google.apps.card.v1.BorderStyle.BorderType getType(); + + /** + * + * + *
        +   * The colors to use when the type is `BORDER_TYPE_STROKE`.
        +   *
        +   * To set the stroke color, specify a value for the `red`, `green`, and `blue`
        +   * fields.
        +   * The value must be a float number between 0 and 1 based on the RGB color
        +   * value, where `0` (0/255) represents the absence of color  and `1` (255/255)
        +   * represents the maximum intensity of the color.
        +   *
        +   * For example, the following sets the color to red at its maximum intensity:
        +   *
        +   * ```
        +   * "color": {
        +   * "red": 1,
        +   * "green": 0,
        +   * "blue": 0,
        +   * }
        +   * ```
        +   *
        +   * The `alpha` field is unavailable for stroke color. If specified, this field
        +   * is ignored.
        +   * 
        + * + * .google.type.Color stroke_color = 2; + * + * @return Whether the strokeColor field is set. + */ + boolean hasStrokeColor(); + + /** + * + * + *
        +   * The colors to use when the type is `BORDER_TYPE_STROKE`.
        +   *
        +   * To set the stroke color, specify a value for the `red`, `green`, and `blue`
        +   * fields.
        +   * The value must be a float number between 0 and 1 based on the RGB color
        +   * value, where `0` (0/255) represents the absence of color  and `1` (255/255)
        +   * represents the maximum intensity of the color.
        +   *
        +   * For example, the following sets the color to red at its maximum intensity:
        +   *
        +   * ```
        +   * "color": {
        +   * "red": 1,
        +   * "green": 0,
        +   * "blue": 0,
        +   * }
        +   * ```
        +   *
        +   * The `alpha` field is unavailable for stroke color. If specified, this field
        +   * is ignored.
        +   * 
        + * + * .google.type.Color stroke_color = 2; + * + * @return The strokeColor. + */ + com.google.type.Color getStrokeColor(); + + /** + * + * + *
        +   * The colors to use when the type is `BORDER_TYPE_STROKE`.
        +   *
        +   * To set the stroke color, specify a value for the `red`, `green`, and `blue`
        +   * fields.
        +   * The value must be a float number between 0 and 1 based on the RGB color
        +   * value, where `0` (0/255) represents the absence of color  and `1` (255/255)
        +   * represents the maximum intensity of the color.
        +   *
        +   * For example, the following sets the color to red at its maximum intensity:
        +   *
        +   * ```
        +   * "color": {
        +   * "red": 1,
        +   * "green": 0,
        +   * "blue": 0,
        +   * }
        +   * ```
        +   *
        +   * The `alpha` field is unavailable for stroke color. If specified, this field
        +   * is ignored.
        +   * 
        + * + * .google.type.Color stroke_color = 2; + */ + com.google.type.ColorOrBuilder getStrokeColorOrBuilder(); + + /** + * + * + *
        +   * The corner radius for the border.
        +   * 
        + * + * int32 corner_radius = 3; + * + * @return The cornerRadius. + */ + int getCornerRadius(); +} diff --git a/java-common-protos/proto-google-common-protos/src/main/java/com/google/apps/card/v1/Button.java b/java-common-protos/proto-google-common-protos/src/main/java/com/google/apps/card/v1/Button.java new file mode 100644 index 0000000000..6f2062964d --- /dev/null +++ b/java-common-protos/proto-google-common-protos/src/main/java/com/google/apps/card/v1/Button.java @@ -0,0 +1,2450 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/apps/card/v1/card.proto +// Protobuf Java Version: 4.33.2 + +package com.google.apps.card.v1; + +/** + * + * + *
        + * A text, icon, or text and icon button that users can click. For an example in
        + * Google Chat apps, see
        + * [Add a
        + * button](https://developers.google.com/workspace/chat/design-interactive-card-dialog#add_a_button).
        + *
        + * To make an image a clickable button, specify an
        + * [`Image`][google.apps.card.v1.Image] (not an
        + * [`ImageComponent`][google.apps.card.v1.ImageComponent]) and set an
        + * `onClick` action.
        + *
        + * [Google Workspace
        + * add-ons and Chat apps](https://developers.google.com/workspace/extend):
        + * 
        + * + * Protobuf type {@code google.apps.card.v1.Button} + */ +@com.google.protobuf.Generated +public final class Button extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.apps.card.v1.Button) + ButtonOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "Button"); + } + + // Use Button.newBuilder() to construct. + private Button(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private Button() { + text_ = ""; + altText_ = ""; + type_ = 0; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.apps.card.v1.CardProto.internal_static_google_apps_card_v1_Button_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.apps.card.v1.CardProto + .internal_static_google_apps_card_v1_Button_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.apps.card.v1.Button.class, com.google.apps.card.v1.Button.Builder.class); + } + + /** + * + * + *
        +   * Optional. The
        +   * [type](https://m3.material.io/components/all-buttons#9134ac95-678e-49ae-a50a-e71948011b05)
        +   * of a button. If `color` field is set, the `type` is forced to `FILLED`.
        +   *
        +   * [Google Chat apps](https://developers.google.com/workspace/chat):
        +   * 
        + * + * Protobuf enum {@code google.apps.card.v1.Button.Type} + */ + public enum Type implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
        +     * Don't use. Unspecified.
        +     * 
        + * + * TYPE_UNSPECIFIED = 0; + */ + TYPE_UNSPECIFIED(0), + /** + * + * + *
        +     * Outlined buttons are medium-emphasis buttons. They usually contain
        +     * actions that are important, but aren’t the primary action in a Chat app
        +     * or an add-on.
        +     * 
        + * + * OUTLINED = 1; + */ + OUTLINED(1), + /** + * + * + *
        +     * A filled button has a container with a solid color. It has the most
        +     * visual impact and is recommended for the important and primary action in
        +     * a Chat app or an add-on.
        +     * 
        + * + * FILLED = 2; + */ + FILLED(2), + /** + * + * + *
        +     * A filled tonal button is an alternative middle ground between filled and
        +     * outlined buttons. They’re useful in contexts where a lower-priority
        +     * button requires slightly more emphasis than an outline button would give.
        +     * 
        + * + * FILLED_TONAL = 3; + */ + FILLED_TONAL(3), + /** + * + * + *
        +     * A button does not have an invisible container in its default state. It is
        +     * often used for the lowest priority actions, especially when presenting
        +     * multiple options.
        +     * 
        + * + * BORDERLESS = 4; + */ + BORDERLESS(4), + UNRECOGNIZED(-1), + ; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "Type"); + } + + /** + * + * + *
        +     * Don't use. Unspecified.
        +     * 
        + * + * TYPE_UNSPECIFIED = 0; + */ + public static final int TYPE_UNSPECIFIED_VALUE = 0; + + /** + * + * + *
        +     * Outlined buttons are medium-emphasis buttons. They usually contain
        +     * actions that are important, but aren’t the primary action in a Chat app
        +     * or an add-on.
        +     * 
        + * + * OUTLINED = 1; + */ + public static final int OUTLINED_VALUE = 1; + + /** + * + * + *
        +     * A filled button has a container with a solid color. It has the most
        +     * visual impact and is recommended for the important and primary action in
        +     * a Chat app or an add-on.
        +     * 
        + * + * FILLED = 2; + */ + public static final int FILLED_VALUE = 2; + + /** + * + * + *
        +     * A filled tonal button is an alternative middle ground between filled and
        +     * outlined buttons. They’re useful in contexts where a lower-priority
        +     * button requires slightly more emphasis than an outline button would give.
        +     * 
        + * + * FILLED_TONAL = 3; + */ + public static final int FILLED_TONAL_VALUE = 3; + + /** + * + * + *
        +     * A button does not have an invisible container in its default state. It is
        +     * often used for the lowest priority actions, especially when presenting
        +     * multiple options.
        +     * 
        + * + * BORDERLESS = 4; + */ + public static final int BORDERLESS_VALUE = 4; + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static Type valueOf(int value) { + return forNumber(value); + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + */ + public static Type forNumber(int value) { + switch (value) { + case 0: + return TYPE_UNSPECIFIED; + case 1: + return OUTLINED; + case 2: + return FILLED; + case 3: + return FILLED_TONAL; + case 4: + return BORDERLESS; + default: + return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap internalGetValueMap() { + return internalValueMap; + } + + private static final com.google.protobuf.Internal.EnumLiteMap internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public Type findValueByNumber(int number) { + return Type.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { + 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 com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.apps.card.v1.Button.getDescriptor().getEnumTypes().get(0); + } + + private static final Type[] VALUES = values(); + + public static Type valueOf(com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException("EnumValueDescriptor is not for this type."); + } + if (desc.getIndex() == -1) { + return UNRECOGNIZED; + } + return VALUES[desc.getIndex()]; + } + + private final int value; + + private Type(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.apps.card.v1.Button.Type) + } + + private int bitField0_; + public static final int TEXT_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object text_ = ""; + + /** + * + * + *
        +   * The text displayed inside the button.
        +   * 
        + * + * string text = 1; + * + * @return The text. + */ + @java.lang.Override + public java.lang.String getText() { + java.lang.Object ref = text_; + 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(); + text_ = s; + return s; + } + } + + /** + * + * + *
        +   * The text displayed inside the button.
        +   * 
        + * + * string text = 1; + * + * @return The bytes for text. + */ + @java.lang.Override + public com.google.protobuf.ByteString getTextBytes() { + java.lang.Object ref = text_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + text_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int ICON_FIELD_NUMBER = 2; + private com.google.apps.card.v1.Icon icon_; + + /** + * + * + *
        +   * An icon displayed inside the button. If both `icon` and `text` are set,
        +   * then the icon appears before the text.
        +   * 
        + * + * .google.apps.card.v1.Icon icon = 2; + * + * @return Whether the icon field is set. + */ + @java.lang.Override + public boolean hasIcon() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
        +   * An icon displayed inside the button. If both `icon` and `text` are set,
        +   * then the icon appears before the text.
        +   * 
        + * + * .google.apps.card.v1.Icon icon = 2; + * + * @return The icon. + */ + @java.lang.Override + public com.google.apps.card.v1.Icon getIcon() { + return icon_ == null ? com.google.apps.card.v1.Icon.getDefaultInstance() : icon_; + } + + /** + * + * + *
        +   * An icon displayed inside the button. If both `icon` and `text` are set,
        +   * then the icon appears before the text.
        +   * 
        + * + * .google.apps.card.v1.Icon icon = 2; + */ + @java.lang.Override + public com.google.apps.card.v1.IconOrBuilder getIconOrBuilder() { + return icon_ == null ? com.google.apps.card.v1.Icon.getDefaultInstance() : icon_; + } + + public static final int COLOR_FIELD_NUMBER = 3; + private com.google.type.Color color_; + + /** + * + * + *
        +   * Optional. The color of the button. If set, the button `type` is set to
        +   * `FILLED` and the color of `text` and `icon` fields are set to a
        +   * contrasting color for readability. For example, if the button color is
        +   * set to blue, any text or icons in the button are set to white.
        +   *
        +   * To set the button color, specify a value for the `red`, `green`, and `blue`
        +   * fields.
        +   * The value must be a float number between 0 and 1 based on the RGB color
        +   * value, where `0` (0/255) represents the absence of color  and `1` (255/255)
        +   * represents the maximum intensity of the color.
        +   *
        +   * For example, the following sets the color to red at its maximum intensity:
        +   *
        +   * ```
        +   * "color": {
        +   * "red": 1,
        +   * "green": 0,
        +   * "blue": 0,
        +   * }
        +   * ```
        +   *
        +   * The `alpha` field is unavailable for button color. If specified, this field
        +   * is ignored.
        +   * 
        + * + * .google.type.Color color = 3; + * + * @return Whether the color field is set. + */ + @java.lang.Override + public boolean hasColor() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
        +   * Optional. The color of the button. If set, the button `type` is set to
        +   * `FILLED` and the color of `text` and `icon` fields are set to a
        +   * contrasting color for readability. For example, if the button color is
        +   * set to blue, any text or icons in the button are set to white.
        +   *
        +   * To set the button color, specify a value for the `red`, `green`, and `blue`
        +   * fields.
        +   * The value must be a float number between 0 and 1 based on the RGB color
        +   * value, where `0` (0/255) represents the absence of color  and `1` (255/255)
        +   * represents the maximum intensity of the color.
        +   *
        +   * For example, the following sets the color to red at its maximum intensity:
        +   *
        +   * ```
        +   * "color": {
        +   * "red": 1,
        +   * "green": 0,
        +   * "blue": 0,
        +   * }
        +   * ```
        +   *
        +   * The `alpha` field is unavailable for button color. If specified, this field
        +   * is ignored.
        +   * 
        + * + * .google.type.Color color = 3; + * + * @return The color. + */ + @java.lang.Override + public com.google.type.Color getColor() { + return color_ == null ? com.google.type.Color.getDefaultInstance() : color_; + } + + /** + * + * + *
        +   * Optional. The color of the button. If set, the button `type` is set to
        +   * `FILLED` and the color of `text` and `icon` fields are set to a
        +   * contrasting color for readability. For example, if the button color is
        +   * set to blue, any text or icons in the button are set to white.
        +   *
        +   * To set the button color, specify a value for the `red`, `green`, and `blue`
        +   * fields.
        +   * The value must be a float number between 0 and 1 based on the RGB color
        +   * value, where `0` (0/255) represents the absence of color  and `1` (255/255)
        +   * represents the maximum intensity of the color.
        +   *
        +   * For example, the following sets the color to red at its maximum intensity:
        +   *
        +   * ```
        +   * "color": {
        +   * "red": 1,
        +   * "green": 0,
        +   * "blue": 0,
        +   * }
        +   * ```
        +   *
        +   * The `alpha` field is unavailable for button color. If specified, this field
        +   * is ignored.
        +   * 
        + * + * .google.type.Color color = 3; + */ + @java.lang.Override + public com.google.type.ColorOrBuilder getColorOrBuilder() { + return color_ == null ? com.google.type.Color.getDefaultInstance() : color_; + } + + public static final int ON_CLICK_FIELD_NUMBER = 4; + private com.google.apps.card.v1.OnClick onClick_; + + /** + * + * + *
        +   * Required. The action to perform when a user clicks the button, such as
        +   * opening a hyperlink or running a custom function.
        +   * 
        + * + * .google.apps.card.v1.OnClick on_click = 4; + * + * @return Whether the onClick field is set. + */ + @java.lang.Override + public boolean hasOnClick() { + return ((bitField0_ & 0x00000004) != 0); + } + + /** + * + * + *
        +   * Required. The action to perform when a user clicks the button, such as
        +   * opening a hyperlink or running a custom function.
        +   * 
        + * + * .google.apps.card.v1.OnClick on_click = 4; + * + * @return The onClick. + */ + @java.lang.Override + public com.google.apps.card.v1.OnClick getOnClick() { + return onClick_ == null ? com.google.apps.card.v1.OnClick.getDefaultInstance() : onClick_; + } + + /** + * + * + *
        +   * Required. The action to perform when a user clicks the button, such as
        +   * opening a hyperlink or running a custom function.
        +   * 
        + * + * .google.apps.card.v1.OnClick on_click = 4; + */ + @java.lang.Override + public com.google.apps.card.v1.OnClickOrBuilder getOnClickOrBuilder() { + return onClick_ == null ? com.google.apps.card.v1.OnClick.getDefaultInstance() : onClick_; + } + + public static final int DISABLED_FIELD_NUMBER = 5; + private boolean disabled_ = false; + + /** + * + * + *
        +   * If `true`, the button is displayed in an inactive state and doesn't respond
        +   * to user actions.
        +   * 
        + * + * bool disabled = 5; + * + * @return The disabled. + */ + @java.lang.Override + public boolean getDisabled() { + return disabled_; + } + + public static final int ALT_TEXT_FIELD_NUMBER = 6; + + @SuppressWarnings("serial") + private volatile java.lang.Object altText_ = ""; + + /** + * + * + *
        +   * The alternative text that's used for accessibility.
        +   *
        +   * Set descriptive text that lets users know what the button does. For
        +   * example, if a button opens a hyperlink, you might write: "Opens a new
        +   * browser tab and navigates to the Google Chat developer documentation at
        +   * https://developers.google.com/workspace/chat".
        +   * 
        + * + * string alt_text = 6; + * + * @return The altText. + */ + @java.lang.Override + public java.lang.String getAltText() { + java.lang.Object ref = altText_; + 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(); + altText_ = s; + return s; + } + } + + /** + * + * + *
        +   * The alternative text that's used for accessibility.
        +   *
        +   * Set descriptive text that lets users know what the button does. For
        +   * example, if a button opens a hyperlink, you might write: "Opens a new
        +   * browser tab and navigates to the Google Chat developer documentation at
        +   * https://developers.google.com/workspace/chat".
        +   * 
        + * + * string alt_text = 6; + * + * @return The bytes for altText. + */ + @java.lang.Override + public com.google.protobuf.ByteString getAltTextBytes() { + java.lang.Object ref = altText_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + altText_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int TYPE_FIELD_NUMBER = 7; + private int type_ = 0; + + /** + * + * + *
        +   * Optional. The type of a button. If unset, button type defaults to
        +   * `OUTLINED`. If the `color` field is set, the button type is forced to
        +   * `FILLED` and any value set for this field is ignored.
        +   * 
        + * + * .google.apps.card.v1.Button.Type type = 7; + * + * @return The enum numeric value on the wire for type. + */ + @java.lang.Override + public int getTypeValue() { + return type_; + } + + /** + * + * + *
        +   * Optional. The type of a button. If unset, button type defaults to
        +   * `OUTLINED`. If the `color` field is set, the button type is forced to
        +   * `FILLED` and any value set for this field is ignored.
        +   * 
        + * + * .google.apps.card.v1.Button.Type type = 7; + * + * @return The type. + */ + @java.lang.Override + public com.google.apps.card.v1.Button.Type getType() { + com.google.apps.card.v1.Button.Type result = + com.google.apps.card.v1.Button.Type.forNumber(type_); + return result == null ? com.google.apps.card.v1.Button.Type.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.GeneratedMessage.isStringEmpty(text_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, text_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(2, getIcon()); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeMessage(3, getColor()); + } + if (((bitField0_ & 0x00000004) != 0)) { + output.writeMessage(4, getOnClick()); + } + if (disabled_ != false) { + output.writeBool(5, disabled_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(altText_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 6, altText_); + } + if (type_ != com.google.apps.card.v1.Button.Type.TYPE_UNSPECIFIED.getNumber()) { + output.writeEnum(7, type_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(text_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, text_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getIcon()); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getColor()); + } + if (((bitField0_ & 0x00000004) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, getOnClick()); + } + if (disabled_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(5, disabled_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(altText_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(6, altText_); + } + if (type_ != com.google.apps.card.v1.Button.Type.TYPE_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(7, type_); + } + 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.apps.card.v1.Button)) { + return super.equals(obj); + } + com.google.apps.card.v1.Button other = (com.google.apps.card.v1.Button) obj; + + if (!getText().equals(other.getText())) return false; + if (hasIcon() != other.hasIcon()) return false; + if (hasIcon()) { + if (!getIcon().equals(other.getIcon())) return false; + } + if (hasColor() != other.hasColor()) return false; + if (hasColor()) { + if (!getColor().equals(other.getColor())) return false; + } + if (hasOnClick() != other.hasOnClick()) return false; + if (hasOnClick()) { + if (!getOnClick().equals(other.getOnClick())) return false; + } + if (getDisabled() != other.getDisabled()) return false; + if (!getAltText().equals(other.getAltText())) return false; + if (type_ != other.type_) 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) + TEXT_FIELD_NUMBER; + hash = (53 * hash) + getText().hashCode(); + if (hasIcon()) { + hash = (37 * hash) + ICON_FIELD_NUMBER; + hash = (53 * hash) + getIcon().hashCode(); + } + if (hasColor()) { + hash = (37 * hash) + COLOR_FIELD_NUMBER; + hash = (53 * hash) + getColor().hashCode(); + } + if (hasOnClick()) { + hash = (37 * hash) + ON_CLICK_FIELD_NUMBER; + hash = (53 * hash) + getOnClick().hashCode(); + } + hash = (37 * hash) + DISABLED_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getDisabled()); + hash = (37 * hash) + ALT_TEXT_FIELD_NUMBER; + hash = (53 * hash) + getAltText().hashCode(); + hash = (37 * hash) + TYPE_FIELD_NUMBER; + hash = (53 * hash) + type_; + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.apps.card.v1.Button parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.apps.card.v1.Button parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.apps.card.v1.Button parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.apps.card.v1.Button 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.apps.card.v1.Button parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.apps.card.v1.Button parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.apps.card.v1.Button parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.apps.card.v1.Button parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.apps.card.v1.Button parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.apps.card.v1.Button parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.apps.card.v1.Button parseFrom(com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.apps.card.v1.Button parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.apps.card.v1.Button 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
        +   * A text, icon, or text and icon button that users can click. For an example in
        +   * Google Chat apps, see
        +   * [Add a
        +   * button](https://developers.google.com/workspace/chat/design-interactive-card-dialog#add_a_button).
        +   *
        +   * To make an image a clickable button, specify an
        +   * [`Image`][google.apps.card.v1.Image] (not an
        +   * [`ImageComponent`][google.apps.card.v1.ImageComponent]) and set an
        +   * `onClick` action.
        +   *
        +   * [Google Workspace
        +   * add-ons and Chat apps](https://developers.google.com/workspace/extend):
        +   * 
        + * + * Protobuf type {@code google.apps.card.v1.Button} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.apps.card.v1.Button) + com.google.apps.card.v1.ButtonOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.apps.card.v1.CardProto + .internal_static_google_apps_card_v1_Button_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.apps.card.v1.CardProto + .internal_static_google_apps_card_v1_Button_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.apps.card.v1.Button.class, com.google.apps.card.v1.Button.Builder.class); + } + + // Construct using com.google.apps.card.v1.Button.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetIconFieldBuilder(); + internalGetColorFieldBuilder(); + internalGetOnClickFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + text_ = ""; + icon_ = null; + if (iconBuilder_ != null) { + iconBuilder_.dispose(); + iconBuilder_ = null; + } + color_ = null; + if (colorBuilder_ != null) { + colorBuilder_.dispose(); + colorBuilder_ = null; + } + onClick_ = null; + if (onClickBuilder_ != null) { + onClickBuilder_.dispose(); + onClickBuilder_ = null; + } + disabled_ = false; + altText_ = ""; + type_ = 0; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.apps.card.v1.CardProto + .internal_static_google_apps_card_v1_Button_descriptor; + } + + @java.lang.Override + public com.google.apps.card.v1.Button getDefaultInstanceForType() { + return com.google.apps.card.v1.Button.getDefaultInstance(); + } + + @java.lang.Override + public com.google.apps.card.v1.Button build() { + com.google.apps.card.v1.Button result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.apps.card.v1.Button buildPartial() { + com.google.apps.card.v1.Button result = new com.google.apps.card.v1.Button(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.apps.card.v1.Button result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.text_ = text_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.icon_ = iconBuilder_ == null ? icon_ : iconBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.color_ = colorBuilder_ == null ? color_ : colorBuilder_.build(); + to_bitField0_ |= 0x00000002; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.onClick_ = onClickBuilder_ == null ? onClick_ : onClickBuilder_.build(); + to_bitField0_ |= 0x00000004; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.disabled_ = disabled_; + } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.altText_ = altText_; + } + if (((from_bitField0_ & 0x00000040) != 0)) { + result.type_ = type_; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.apps.card.v1.Button) { + return mergeFrom((com.google.apps.card.v1.Button) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.apps.card.v1.Button other) { + if (other == com.google.apps.card.v1.Button.getDefaultInstance()) return this; + if (!other.getText().isEmpty()) { + text_ = other.text_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.hasIcon()) { + mergeIcon(other.getIcon()); + } + if (other.hasColor()) { + mergeColor(other.getColor()); + } + if (other.hasOnClick()) { + mergeOnClick(other.getOnClick()); + } + if (other.getDisabled() != false) { + setDisabled(other.getDisabled()); + } + if (!other.getAltText().isEmpty()) { + altText_ = other.altText_; + bitField0_ |= 0x00000020; + onChanged(); + } + if (other.type_ != 0) { + setTypeValue(other.getTypeValue()); + } + 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: + { + text_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + input.readMessage(internalGetIconFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + input.readMessage(internalGetColorFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 34: + { + input.readMessage(internalGetOnClickFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000008; + break; + } // case 34 + case 40: + { + disabled_ = input.readBool(); + bitField0_ |= 0x00000010; + break; + } // case 40 + case 50: + { + altText_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000020; + break; + } // case 50 + case 56: + { + type_ = input.readEnum(); + bitField0_ |= 0x00000040; + break; + } // case 56 + 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 text_ = ""; + + /** + * + * + *
        +     * The text displayed inside the button.
        +     * 
        + * + * string text = 1; + * + * @return The text. + */ + public java.lang.String getText() { + java.lang.Object ref = text_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + text_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
        +     * The text displayed inside the button.
        +     * 
        + * + * string text = 1; + * + * @return The bytes for text. + */ + public com.google.protobuf.ByteString getTextBytes() { + java.lang.Object ref = text_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + text_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
        +     * The text displayed inside the button.
        +     * 
        + * + * string text = 1; + * + * @param value The text to set. + * @return This builder for chaining. + */ + public Builder setText(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + text_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
        +     * The text displayed inside the button.
        +     * 
        + * + * string text = 1; + * + * @return This builder for chaining. + */ + public Builder clearText() { + text_ = getDefaultInstance().getText(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
        +     * The text displayed inside the button.
        +     * 
        + * + * string text = 1; + * + * @param value The bytes for text to set. + * @return This builder for chaining. + */ + public Builder setTextBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + text_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private com.google.apps.card.v1.Icon icon_; + private com.google.protobuf.SingleFieldBuilder< + com.google.apps.card.v1.Icon, + com.google.apps.card.v1.Icon.Builder, + com.google.apps.card.v1.IconOrBuilder> + iconBuilder_; + + /** + * + * + *
        +     * An icon displayed inside the button. If both `icon` and `text` are set,
        +     * then the icon appears before the text.
        +     * 
        + * + * .google.apps.card.v1.Icon icon = 2; + * + * @return Whether the icon field is set. + */ + public boolean hasIcon() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
        +     * An icon displayed inside the button. If both `icon` and `text` are set,
        +     * then the icon appears before the text.
        +     * 
        + * + * .google.apps.card.v1.Icon icon = 2; + * + * @return The icon. + */ + public com.google.apps.card.v1.Icon getIcon() { + if (iconBuilder_ == null) { + return icon_ == null ? com.google.apps.card.v1.Icon.getDefaultInstance() : icon_; + } else { + return iconBuilder_.getMessage(); + } + } + + /** + * + * + *
        +     * An icon displayed inside the button. If both `icon` and `text` are set,
        +     * then the icon appears before the text.
        +     * 
        + * + * .google.apps.card.v1.Icon icon = 2; + */ + public Builder setIcon(com.google.apps.card.v1.Icon value) { + if (iconBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + icon_ = value; + } else { + iconBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
        +     * An icon displayed inside the button. If both `icon` and `text` are set,
        +     * then the icon appears before the text.
        +     * 
        + * + * .google.apps.card.v1.Icon icon = 2; + */ + public Builder setIcon(com.google.apps.card.v1.Icon.Builder builderForValue) { + if (iconBuilder_ == null) { + icon_ = builderForValue.build(); + } else { + iconBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
        +     * An icon displayed inside the button. If both `icon` and `text` are set,
        +     * then the icon appears before the text.
        +     * 
        + * + * .google.apps.card.v1.Icon icon = 2; + */ + public Builder mergeIcon(com.google.apps.card.v1.Icon value) { + if (iconBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && icon_ != null + && icon_ != com.google.apps.card.v1.Icon.getDefaultInstance()) { + getIconBuilder().mergeFrom(value); + } else { + icon_ = value; + } + } else { + iconBuilder_.mergeFrom(value); + } + if (icon_ != null) { + bitField0_ |= 0x00000002; + onChanged(); + } + return this; + } + + /** + * + * + *
        +     * An icon displayed inside the button. If both `icon` and `text` are set,
        +     * then the icon appears before the text.
        +     * 
        + * + * .google.apps.card.v1.Icon icon = 2; + */ + public Builder clearIcon() { + bitField0_ = (bitField0_ & ~0x00000002); + icon_ = null; + if (iconBuilder_ != null) { + iconBuilder_.dispose(); + iconBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
        +     * An icon displayed inside the button. If both `icon` and `text` are set,
        +     * then the icon appears before the text.
        +     * 
        + * + * .google.apps.card.v1.Icon icon = 2; + */ + public com.google.apps.card.v1.Icon.Builder getIconBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return internalGetIconFieldBuilder().getBuilder(); + } + + /** + * + * + *
        +     * An icon displayed inside the button. If both `icon` and `text` are set,
        +     * then the icon appears before the text.
        +     * 
        + * + * .google.apps.card.v1.Icon icon = 2; + */ + public com.google.apps.card.v1.IconOrBuilder getIconOrBuilder() { + if (iconBuilder_ != null) { + return iconBuilder_.getMessageOrBuilder(); + } else { + return icon_ == null ? com.google.apps.card.v1.Icon.getDefaultInstance() : icon_; + } + } + + /** + * + * + *
        +     * An icon displayed inside the button. If both `icon` and `text` are set,
        +     * then the icon appears before the text.
        +     * 
        + * + * .google.apps.card.v1.Icon icon = 2; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.apps.card.v1.Icon, + com.google.apps.card.v1.Icon.Builder, + com.google.apps.card.v1.IconOrBuilder> + internalGetIconFieldBuilder() { + if (iconBuilder_ == null) { + iconBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.apps.card.v1.Icon, + com.google.apps.card.v1.Icon.Builder, + com.google.apps.card.v1.IconOrBuilder>( + getIcon(), getParentForChildren(), isClean()); + icon_ = null; + } + return iconBuilder_; + } + + private com.google.type.Color color_; + private com.google.protobuf.SingleFieldBuilder< + com.google.type.Color, com.google.type.Color.Builder, com.google.type.ColorOrBuilder> + colorBuilder_; + + /** + * + * + *
        +     * Optional. The color of the button. If set, the button `type` is set to
        +     * `FILLED` and the color of `text` and `icon` fields are set to a
        +     * contrasting color for readability. For example, if the button color is
        +     * set to blue, any text or icons in the button are set to white.
        +     *
        +     * To set the button color, specify a value for the `red`, `green`, and `blue`
        +     * fields.
        +     * The value must be a float number between 0 and 1 based on the RGB color
        +     * value, where `0` (0/255) represents the absence of color  and `1` (255/255)
        +     * represents the maximum intensity of the color.
        +     *
        +     * For example, the following sets the color to red at its maximum intensity:
        +     *
        +     * ```
        +     * "color": {
        +     * "red": 1,
        +     * "green": 0,
        +     * "blue": 0,
        +     * }
        +     * ```
        +     *
        +     * The `alpha` field is unavailable for button color. If specified, this field
        +     * is ignored.
        +     * 
        + * + * .google.type.Color color = 3; + * + * @return Whether the color field is set. + */ + public boolean hasColor() { + return ((bitField0_ & 0x00000004) != 0); + } + + /** + * + * + *
        +     * Optional. The color of the button. If set, the button `type` is set to
        +     * `FILLED` and the color of `text` and `icon` fields are set to a
        +     * contrasting color for readability. For example, if the button color is
        +     * set to blue, any text or icons in the button are set to white.
        +     *
        +     * To set the button color, specify a value for the `red`, `green`, and `blue`
        +     * fields.
        +     * The value must be a float number between 0 and 1 based on the RGB color
        +     * value, where `0` (0/255) represents the absence of color  and `1` (255/255)
        +     * represents the maximum intensity of the color.
        +     *
        +     * For example, the following sets the color to red at its maximum intensity:
        +     *
        +     * ```
        +     * "color": {
        +     * "red": 1,
        +     * "green": 0,
        +     * "blue": 0,
        +     * }
        +     * ```
        +     *
        +     * The `alpha` field is unavailable for button color. If specified, this field
        +     * is ignored.
        +     * 
        + * + * .google.type.Color color = 3; + * + * @return The color. + */ + public com.google.type.Color getColor() { + if (colorBuilder_ == null) { + return color_ == null ? com.google.type.Color.getDefaultInstance() : color_; + } else { + return colorBuilder_.getMessage(); + } + } + + /** + * + * + *
        +     * Optional. The color of the button. If set, the button `type` is set to
        +     * `FILLED` and the color of `text` and `icon` fields are set to a
        +     * contrasting color for readability. For example, if the button color is
        +     * set to blue, any text or icons in the button are set to white.
        +     *
        +     * To set the button color, specify a value for the `red`, `green`, and `blue`
        +     * fields.
        +     * The value must be a float number between 0 and 1 based on the RGB color
        +     * value, where `0` (0/255) represents the absence of color  and `1` (255/255)
        +     * represents the maximum intensity of the color.
        +     *
        +     * For example, the following sets the color to red at its maximum intensity:
        +     *
        +     * ```
        +     * "color": {
        +     * "red": 1,
        +     * "green": 0,
        +     * "blue": 0,
        +     * }
        +     * ```
        +     *
        +     * The `alpha` field is unavailable for button color. If specified, this field
        +     * is ignored.
        +     * 
        + * + * .google.type.Color color = 3; + */ + public Builder setColor(com.google.type.Color value) { + if (colorBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + color_ = value; + } else { + colorBuilder_.setMessage(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
        +     * Optional. The color of the button. If set, the button `type` is set to
        +     * `FILLED` and the color of `text` and `icon` fields are set to a
        +     * contrasting color for readability. For example, if the button color is
        +     * set to blue, any text or icons in the button are set to white.
        +     *
        +     * To set the button color, specify a value for the `red`, `green`, and `blue`
        +     * fields.
        +     * The value must be a float number between 0 and 1 based on the RGB color
        +     * value, where `0` (0/255) represents the absence of color  and `1` (255/255)
        +     * represents the maximum intensity of the color.
        +     *
        +     * For example, the following sets the color to red at its maximum intensity:
        +     *
        +     * ```
        +     * "color": {
        +     * "red": 1,
        +     * "green": 0,
        +     * "blue": 0,
        +     * }
        +     * ```
        +     *
        +     * The `alpha` field is unavailable for button color. If specified, this field
        +     * is ignored.
        +     * 
        + * + * .google.type.Color color = 3; + */ + public Builder setColor(com.google.type.Color.Builder builderForValue) { + if (colorBuilder_ == null) { + color_ = builderForValue.build(); + } else { + colorBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
        +     * Optional. The color of the button. If set, the button `type` is set to
        +     * `FILLED` and the color of `text` and `icon` fields are set to a
        +     * contrasting color for readability. For example, if the button color is
        +     * set to blue, any text or icons in the button are set to white.
        +     *
        +     * To set the button color, specify a value for the `red`, `green`, and `blue`
        +     * fields.
        +     * The value must be a float number between 0 and 1 based on the RGB color
        +     * value, where `0` (0/255) represents the absence of color  and `1` (255/255)
        +     * represents the maximum intensity of the color.
        +     *
        +     * For example, the following sets the color to red at its maximum intensity:
        +     *
        +     * ```
        +     * "color": {
        +     * "red": 1,
        +     * "green": 0,
        +     * "blue": 0,
        +     * }
        +     * ```
        +     *
        +     * The `alpha` field is unavailable for button color. If specified, this field
        +     * is ignored.
        +     * 
        + * + * .google.type.Color color = 3; + */ + public Builder mergeColor(com.google.type.Color value) { + if (colorBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0) + && color_ != null + && color_ != com.google.type.Color.getDefaultInstance()) { + getColorBuilder().mergeFrom(value); + } else { + color_ = value; + } + } else { + colorBuilder_.mergeFrom(value); + } + if (color_ != null) { + bitField0_ |= 0x00000004; + onChanged(); + } + return this; + } + + /** + * + * + *
        +     * Optional. The color of the button. If set, the button `type` is set to
        +     * `FILLED` and the color of `text` and `icon` fields are set to a
        +     * contrasting color for readability. For example, if the button color is
        +     * set to blue, any text or icons in the button are set to white.
        +     *
        +     * To set the button color, specify a value for the `red`, `green`, and `blue`
        +     * fields.
        +     * The value must be a float number between 0 and 1 based on the RGB color
        +     * value, where `0` (0/255) represents the absence of color  and `1` (255/255)
        +     * represents the maximum intensity of the color.
        +     *
        +     * For example, the following sets the color to red at its maximum intensity:
        +     *
        +     * ```
        +     * "color": {
        +     * "red": 1,
        +     * "green": 0,
        +     * "blue": 0,
        +     * }
        +     * ```
        +     *
        +     * The `alpha` field is unavailable for button color. If specified, this field
        +     * is ignored.
        +     * 
        + * + * .google.type.Color color = 3; + */ + public Builder clearColor() { + bitField0_ = (bitField0_ & ~0x00000004); + color_ = null; + if (colorBuilder_ != null) { + colorBuilder_.dispose(); + colorBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
        +     * Optional. The color of the button. If set, the button `type` is set to
        +     * `FILLED` and the color of `text` and `icon` fields are set to a
        +     * contrasting color for readability. For example, if the button color is
        +     * set to blue, any text or icons in the button are set to white.
        +     *
        +     * To set the button color, specify a value for the `red`, `green`, and `blue`
        +     * fields.
        +     * The value must be a float number between 0 and 1 based on the RGB color
        +     * value, where `0` (0/255) represents the absence of color  and `1` (255/255)
        +     * represents the maximum intensity of the color.
        +     *
        +     * For example, the following sets the color to red at its maximum intensity:
        +     *
        +     * ```
        +     * "color": {
        +     * "red": 1,
        +     * "green": 0,
        +     * "blue": 0,
        +     * }
        +     * ```
        +     *
        +     * The `alpha` field is unavailable for button color. If specified, this field
        +     * is ignored.
        +     * 
        + * + * .google.type.Color color = 3; + */ + public com.google.type.Color.Builder getColorBuilder() { + bitField0_ |= 0x00000004; + onChanged(); + return internalGetColorFieldBuilder().getBuilder(); + } + + /** + * + * + *
        +     * Optional. The color of the button. If set, the button `type` is set to
        +     * `FILLED` and the color of `text` and `icon` fields are set to a
        +     * contrasting color for readability. For example, if the button color is
        +     * set to blue, any text or icons in the button are set to white.
        +     *
        +     * To set the button color, specify a value for the `red`, `green`, and `blue`
        +     * fields.
        +     * The value must be a float number between 0 and 1 based on the RGB color
        +     * value, where `0` (0/255) represents the absence of color  and `1` (255/255)
        +     * represents the maximum intensity of the color.
        +     *
        +     * For example, the following sets the color to red at its maximum intensity:
        +     *
        +     * ```
        +     * "color": {
        +     * "red": 1,
        +     * "green": 0,
        +     * "blue": 0,
        +     * }
        +     * ```
        +     *
        +     * The `alpha` field is unavailable for button color. If specified, this field
        +     * is ignored.
        +     * 
        + * + * .google.type.Color color = 3; + */ + public com.google.type.ColorOrBuilder getColorOrBuilder() { + if (colorBuilder_ != null) { + return colorBuilder_.getMessageOrBuilder(); + } else { + return color_ == null ? com.google.type.Color.getDefaultInstance() : color_; + } + } + + /** + * + * + *
        +     * Optional. The color of the button. If set, the button `type` is set to
        +     * `FILLED` and the color of `text` and `icon` fields are set to a
        +     * contrasting color for readability. For example, if the button color is
        +     * set to blue, any text or icons in the button are set to white.
        +     *
        +     * To set the button color, specify a value for the `red`, `green`, and `blue`
        +     * fields.
        +     * The value must be a float number between 0 and 1 based on the RGB color
        +     * value, where `0` (0/255) represents the absence of color  and `1` (255/255)
        +     * represents the maximum intensity of the color.
        +     *
        +     * For example, the following sets the color to red at its maximum intensity:
        +     *
        +     * ```
        +     * "color": {
        +     * "red": 1,
        +     * "green": 0,
        +     * "blue": 0,
        +     * }
        +     * ```
        +     *
        +     * The `alpha` field is unavailable for button color. If specified, this field
        +     * is ignored.
        +     * 
        + * + * .google.type.Color color = 3; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.type.Color, com.google.type.Color.Builder, com.google.type.ColorOrBuilder> + internalGetColorFieldBuilder() { + if (colorBuilder_ == null) { + colorBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.type.Color, + com.google.type.Color.Builder, + com.google.type.ColorOrBuilder>(getColor(), getParentForChildren(), isClean()); + color_ = null; + } + return colorBuilder_; + } + + private com.google.apps.card.v1.OnClick onClick_; + private com.google.protobuf.SingleFieldBuilder< + com.google.apps.card.v1.OnClick, + com.google.apps.card.v1.OnClick.Builder, + com.google.apps.card.v1.OnClickOrBuilder> + onClickBuilder_; + + /** + * + * + *
        +     * Required. The action to perform when a user clicks the button, such as
        +     * opening a hyperlink or running a custom function.
        +     * 
        + * + * .google.apps.card.v1.OnClick on_click = 4; + * + * @return Whether the onClick field is set. + */ + public boolean hasOnClick() { + return ((bitField0_ & 0x00000008) != 0); + } + + /** + * + * + *
        +     * Required. The action to perform when a user clicks the button, such as
        +     * opening a hyperlink or running a custom function.
        +     * 
        + * + * .google.apps.card.v1.OnClick on_click = 4; + * + * @return The onClick. + */ + public com.google.apps.card.v1.OnClick getOnClick() { + if (onClickBuilder_ == null) { + return onClick_ == null ? com.google.apps.card.v1.OnClick.getDefaultInstance() : onClick_; + } else { + return onClickBuilder_.getMessage(); + } + } + + /** + * + * + *
        +     * Required. The action to perform when a user clicks the button, such as
        +     * opening a hyperlink or running a custom function.
        +     * 
        + * + * .google.apps.card.v1.OnClick on_click = 4; + */ + public Builder setOnClick(com.google.apps.card.v1.OnClick value) { + if (onClickBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + onClick_ = value; + } else { + onClickBuilder_.setMessage(value); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + /** + * + * + *
        +     * Required. The action to perform when a user clicks the button, such as
        +     * opening a hyperlink or running a custom function.
        +     * 
        + * + * .google.apps.card.v1.OnClick on_click = 4; + */ + public Builder setOnClick(com.google.apps.card.v1.OnClick.Builder builderForValue) { + if (onClickBuilder_ == null) { + onClick_ = builderForValue.build(); + } else { + onClickBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + /** + * + * + *
        +     * Required. The action to perform when a user clicks the button, such as
        +     * opening a hyperlink or running a custom function.
        +     * 
        + * + * .google.apps.card.v1.OnClick on_click = 4; + */ + public Builder mergeOnClick(com.google.apps.card.v1.OnClick value) { + if (onClickBuilder_ == null) { + if (((bitField0_ & 0x00000008) != 0) + && onClick_ != null + && onClick_ != com.google.apps.card.v1.OnClick.getDefaultInstance()) { + getOnClickBuilder().mergeFrom(value); + } else { + onClick_ = value; + } + } else { + onClickBuilder_.mergeFrom(value); + } + if (onClick_ != null) { + bitField0_ |= 0x00000008; + onChanged(); + } + return this; + } + + /** + * + * + *
        +     * Required. The action to perform when a user clicks the button, such as
        +     * opening a hyperlink or running a custom function.
        +     * 
        + * + * .google.apps.card.v1.OnClick on_click = 4; + */ + public Builder clearOnClick() { + bitField0_ = (bitField0_ & ~0x00000008); + onClick_ = null; + if (onClickBuilder_ != null) { + onClickBuilder_.dispose(); + onClickBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
        +     * Required. The action to perform when a user clicks the button, such as
        +     * opening a hyperlink or running a custom function.
        +     * 
        + * + * .google.apps.card.v1.OnClick on_click = 4; + */ + public com.google.apps.card.v1.OnClick.Builder getOnClickBuilder() { + bitField0_ |= 0x00000008; + onChanged(); + return internalGetOnClickFieldBuilder().getBuilder(); + } + + /** + * + * + *
        +     * Required. The action to perform when a user clicks the button, such as
        +     * opening a hyperlink or running a custom function.
        +     * 
        + * + * .google.apps.card.v1.OnClick on_click = 4; + */ + public com.google.apps.card.v1.OnClickOrBuilder getOnClickOrBuilder() { + if (onClickBuilder_ != null) { + return onClickBuilder_.getMessageOrBuilder(); + } else { + return onClick_ == null ? com.google.apps.card.v1.OnClick.getDefaultInstance() : onClick_; + } + } + + /** + * + * + *
        +     * Required. The action to perform when a user clicks the button, such as
        +     * opening a hyperlink or running a custom function.
        +     * 
        + * + * .google.apps.card.v1.OnClick on_click = 4; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.apps.card.v1.OnClick, + com.google.apps.card.v1.OnClick.Builder, + com.google.apps.card.v1.OnClickOrBuilder> + internalGetOnClickFieldBuilder() { + if (onClickBuilder_ == null) { + onClickBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.apps.card.v1.OnClick, + com.google.apps.card.v1.OnClick.Builder, + com.google.apps.card.v1.OnClickOrBuilder>( + getOnClick(), getParentForChildren(), isClean()); + onClick_ = null; + } + return onClickBuilder_; + } + + private boolean disabled_; + + /** + * + * + *
        +     * If `true`, the button is displayed in an inactive state and doesn't respond
        +     * to user actions.
        +     * 
        + * + * bool disabled = 5; + * + * @return The disabled. + */ + @java.lang.Override + public boolean getDisabled() { + return disabled_; + } + + /** + * + * + *
        +     * If `true`, the button is displayed in an inactive state and doesn't respond
        +     * to user actions.
        +     * 
        + * + * bool disabled = 5; + * + * @param value The disabled to set. + * @return This builder for chaining. + */ + public Builder setDisabled(boolean value) { + + disabled_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + /** + * + * + *
        +     * If `true`, the button is displayed in an inactive state and doesn't respond
        +     * to user actions.
        +     * 
        + * + * bool disabled = 5; + * + * @return This builder for chaining. + */ + public Builder clearDisabled() { + bitField0_ = (bitField0_ & ~0x00000010); + disabled_ = false; + onChanged(); + return this; + } + + private java.lang.Object altText_ = ""; + + /** + * + * + *
        +     * The alternative text that's used for accessibility.
        +     *
        +     * Set descriptive text that lets users know what the button does. For
        +     * example, if a button opens a hyperlink, you might write: "Opens a new
        +     * browser tab and navigates to the Google Chat developer documentation at
        +     * https://developers.google.com/workspace/chat".
        +     * 
        + * + * string alt_text = 6; + * + * @return The altText. + */ + public java.lang.String getAltText() { + java.lang.Object ref = altText_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + altText_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
        +     * The alternative text that's used for accessibility.
        +     *
        +     * Set descriptive text that lets users know what the button does. For
        +     * example, if a button opens a hyperlink, you might write: "Opens a new
        +     * browser tab and navigates to the Google Chat developer documentation at
        +     * https://developers.google.com/workspace/chat".
        +     * 
        + * + * string alt_text = 6; + * + * @return The bytes for altText. + */ + public com.google.protobuf.ByteString getAltTextBytes() { + java.lang.Object ref = altText_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + altText_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
        +     * The alternative text that's used for accessibility.
        +     *
        +     * Set descriptive text that lets users know what the button does. For
        +     * example, if a button opens a hyperlink, you might write: "Opens a new
        +     * browser tab and navigates to the Google Chat developer documentation at
        +     * https://developers.google.com/workspace/chat".
        +     * 
        + * + * string alt_text = 6; + * + * @param value The altText to set. + * @return This builder for chaining. + */ + public Builder setAltText(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + altText_ = value; + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + + /** + * + * + *
        +     * The alternative text that's used for accessibility.
        +     *
        +     * Set descriptive text that lets users know what the button does. For
        +     * example, if a button opens a hyperlink, you might write: "Opens a new
        +     * browser tab and navigates to the Google Chat developer documentation at
        +     * https://developers.google.com/workspace/chat".
        +     * 
        + * + * string alt_text = 6; + * + * @return This builder for chaining. + */ + public Builder clearAltText() { + altText_ = getDefaultInstance().getAltText(); + bitField0_ = (bitField0_ & ~0x00000020); + onChanged(); + return this; + } + + /** + * + * + *
        +     * The alternative text that's used for accessibility.
        +     *
        +     * Set descriptive text that lets users know what the button does. For
        +     * example, if a button opens a hyperlink, you might write: "Opens a new
        +     * browser tab and navigates to the Google Chat developer documentation at
        +     * https://developers.google.com/workspace/chat".
        +     * 
        + * + * string alt_text = 6; + * + * @param value The bytes for altText to set. + * @return This builder for chaining. + */ + public Builder setAltTextBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + altText_ = value; + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + + private int type_ = 0; + + /** + * + * + *
        +     * Optional. The type of a button. If unset, button type defaults to
        +     * `OUTLINED`. If the `color` field is set, the button type is forced to
        +     * `FILLED` and any value set for this field is ignored.
        +     * 
        + * + * .google.apps.card.v1.Button.Type type = 7; + * + * @return The enum numeric value on the wire for type. + */ + @java.lang.Override + public int getTypeValue() { + return type_; + } + + /** + * + * + *
        +     * Optional. The type of a button. If unset, button type defaults to
        +     * `OUTLINED`. If the `color` field is set, the button type is forced to
        +     * `FILLED` and any value set for this field is ignored.
        +     * 
        + * + * .google.apps.card.v1.Button.Type type = 7; + * + * @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_ |= 0x00000040; + onChanged(); + return this; + } + + /** + * + * + *
        +     * Optional. The type of a button. If unset, button type defaults to
        +     * `OUTLINED`. If the `color` field is set, the button type is forced to
        +     * `FILLED` and any value set for this field is ignored.
        +     * 
        + * + * .google.apps.card.v1.Button.Type type = 7; + * + * @return The type. + */ + @java.lang.Override + public com.google.apps.card.v1.Button.Type getType() { + com.google.apps.card.v1.Button.Type result = + com.google.apps.card.v1.Button.Type.forNumber(type_); + return result == null ? com.google.apps.card.v1.Button.Type.UNRECOGNIZED : result; + } + + /** + * + * + *
        +     * Optional. The type of a button. If unset, button type defaults to
        +     * `OUTLINED`. If the `color` field is set, the button type is forced to
        +     * `FILLED` and any value set for this field is ignored.
        +     * 
        + * + * .google.apps.card.v1.Button.Type type = 7; + * + * @param value The type to set. + * @return This builder for chaining. + */ + public Builder setType(com.google.apps.card.v1.Button.Type value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000040; + type_ = value.getNumber(); + onChanged(); + return this; + } + + /** + * + * + *
        +     * Optional. The type of a button. If unset, button type defaults to
        +     * `OUTLINED`. If the `color` field is set, the button type is forced to
        +     * `FILLED` and any value set for this field is ignored.
        +     * 
        + * + * .google.apps.card.v1.Button.Type type = 7; + * + * @return This builder for chaining. + */ + public Builder clearType() { + bitField0_ = (bitField0_ & ~0x00000040); + type_ = 0; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.apps.card.v1.Button) + } + + // @@protoc_insertion_point(class_scope:google.apps.card.v1.Button) + private static final com.google.apps.card.v1.Button DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.apps.card.v1.Button(); + } + + public static com.google.apps.card.v1.Button getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser
        * * string method_name = 8; @@ -149,6 +161,7 @@ public java.lang.String getMethodName() { return s; } } + /** * * @@ -156,8 +169,9 @@ public java.lang.String getMethodName() { * The name of the service method or operation. * For API calls, this should be the name of the API method. * For example, - * "google.cloud.bigquery.v2.TableService.InsertTable" - * "google.logging.v2.ConfigServiceV2.CreateSink" + * + * "google.cloud.bigquery.v2.TableService.InsertTable" + * "google.logging.v2.ConfigServiceV2.CreateSink" *
        * * string method_name = 8; @@ -178,7 +192,10 @@ public com.google.protobuf.ByteString getMethodNameBytes() { } public static final int RESOURCE_NAME_FIELD_NUMBER = 11; - private volatile java.lang.Object resourceName_; + + @SuppressWarnings("serial") + private volatile java.lang.Object resourceName_ = ""; + /** * * @@ -186,8 +203,9 @@ public com.google.protobuf.ByteString getMethodNameBytes() { * The resource or collection that is the target of the operation. * The name is a scheme-less URI, not including the API service name. * For example: - * "projects/PROJECT_ID/zones/us-central1-a/instances" - * "projects/PROJECT_ID/datasets/DATASET_ID" + * + * "projects/PROJECT_ID/zones/us-central1-a/instances" + * "projects/PROJECT_ID/datasets/DATASET_ID" *
        * * string resource_name = 11; @@ -206,6 +224,7 @@ public java.lang.String getResourceName() { return s; } } + /** * * @@ -213,8 +232,9 @@ public java.lang.String getResourceName() { * The resource or collection that is the target of the operation. * The name is a scheme-less URI, not including the API service name. * For example: - * "projects/PROJECT_ID/zones/us-central1-a/instances" - * "projects/PROJECT_ID/datasets/DATASET_ID" + * + * "projects/PROJECT_ID/zones/us-central1-a/instances" + * "projects/PROJECT_ID/datasets/DATASET_ID" *
        * * string resource_name = 11; @@ -236,6 +256,7 @@ public com.google.protobuf.ByteString getResourceNameBytes() { public static final int RESOURCE_LOCATION_FIELD_NUMBER = 20; private com.google.cloud.audit.ResourceLocation resourceLocation_; + /** * * @@ -249,8 +270,9 @@ public com.google.protobuf.ByteString getResourceNameBytes() { */ @java.lang.Override public boolean hasResourceLocation() { - return resourceLocation_ != null; + return ((bitField0_ & 0x00000001) != 0); } + /** * * @@ -268,6 +290,7 @@ public com.google.cloud.audit.ResourceLocation getResourceLocation() { ? com.google.cloud.audit.ResourceLocation.getDefaultInstance() : resourceLocation_; } + /** * * @@ -279,11 +302,14 @@ public com.google.cloud.audit.ResourceLocation getResourceLocation() { */ @java.lang.Override public com.google.cloud.audit.ResourceLocationOrBuilder getResourceLocationOrBuilder() { - return getResourceLocation(); + return resourceLocation_ == null + ? com.google.cloud.audit.ResourceLocation.getDefaultInstance() + : resourceLocation_; } public static final int RESOURCE_ORIGINAL_STATE_FIELD_NUMBER = 19; private com.google.protobuf.Struct resourceOriginalState_; + /** * * @@ -303,8 +329,9 @@ public com.google.cloud.audit.ResourceLocationOrBuilder getResourceLocationOrBui */ @java.lang.Override public boolean hasResourceOriginalState() { - return resourceOriginalState_ != null; + return ((bitField0_ & 0x00000002) != 0); } + /** * * @@ -328,6 +355,7 @@ public com.google.protobuf.Struct getResourceOriginalState() { ? com.google.protobuf.Struct.getDefaultInstance() : resourceOriginalState_; } + /** * * @@ -345,11 +373,14 @@ public com.google.protobuf.Struct getResourceOriginalState() { */ @java.lang.Override public com.google.protobuf.StructOrBuilder getResourceOriginalStateOrBuilder() { - return getResourceOriginalState(); + return resourceOriginalState_ == null + ? com.google.protobuf.Struct.getDefaultInstance() + : resourceOriginalState_; } public static final int NUM_RESPONSE_ITEMS_FIELD_NUMBER = 12; - private long numResponseItems_; + private long numResponseItems_ = 0L; + /** * * @@ -369,6 +400,7 @@ public long getNumResponseItems() { public static final int STATUS_FIELD_NUMBER = 2; private com.google.rpc.Status status_; + /** * * @@ -382,8 +414,9 @@ public long getNumResponseItems() { */ @java.lang.Override public boolean hasStatus() { - return status_ != null; + return ((bitField0_ & 0x00000004) != 0); } + /** * * @@ -399,6 +432,7 @@ public boolean hasStatus() { public com.google.rpc.Status getStatus() { return status_ == null ? com.google.rpc.Status.getDefaultInstance() : status_; } + /** * * @@ -410,11 +444,12 @@ public com.google.rpc.Status getStatus() { */ @java.lang.Override public com.google.rpc.StatusOrBuilder getStatusOrBuilder() { - return getStatus(); + return status_ == null ? com.google.rpc.Status.getDefaultInstance() : status_; } public static final int AUTHENTICATION_INFO_FIELD_NUMBER = 3; private com.google.cloud.audit.AuthenticationInfo authenticationInfo_; + /** * * @@ -428,8 +463,9 @@ public com.google.rpc.StatusOrBuilder getStatusOrBuilder() { */ @java.lang.Override public boolean hasAuthenticationInfo() { - return authenticationInfo_ != null; + return ((bitField0_ & 0x00000008) != 0); } + /** * * @@ -447,6 +483,7 @@ public com.google.cloud.audit.AuthenticationInfo getAuthenticationInfo() { ? com.google.cloud.audit.AuthenticationInfo.getDefaultInstance() : authenticationInfo_; } + /** * * @@ -458,11 +495,16 @@ public com.google.cloud.audit.AuthenticationInfo getAuthenticationInfo() { */ @java.lang.Override public com.google.cloud.audit.AuthenticationInfoOrBuilder getAuthenticationInfoOrBuilder() { - return getAuthenticationInfo(); + return authenticationInfo_ == null + ? com.google.cloud.audit.AuthenticationInfo.getDefaultInstance() + : authenticationInfo_; } public static final int AUTHORIZATION_INFO_FIELD_NUMBER = 9; + + @SuppressWarnings("serial") private java.util.List authorizationInfo_; + /** * * @@ -478,6 +520,7 @@ public com.google.cloud.audit.AuthenticationInfoOrBuilder getAuthenticationInfoO public java.util.List getAuthorizationInfoList() { return authorizationInfo_; } + /** * * @@ -494,6 +537,7 @@ public java.util.List getAuthorization getAuthorizationInfoOrBuilderList() { return authorizationInfo_; } + /** * * @@ -509,6 +553,7 @@ public java.util.List getAuthorization public int getAuthorizationInfoCount() { return authorizationInfo_.size(); } + /** * * @@ -524,6 +569,7 @@ public int getAuthorizationInfoCount() { public com.google.cloud.audit.AuthorizationInfo getAuthorizationInfo(int index) { return authorizationInfo_.get(index); } + /** * * @@ -543,6 +589,7 @@ public com.google.cloud.audit.AuthorizationInfoOrBuilder getAuthorizationInfoOrB public static final int POLICY_VIOLATION_INFO_FIELD_NUMBER = 25; private com.google.cloud.audit.PolicyViolationInfo policyViolationInfo_; + /** * * @@ -558,8 +605,9 @@ public com.google.cloud.audit.AuthorizationInfoOrBuilder getAuthorizationInfoOrB */ @java.lang.Override public boolean hasPolicyViolationInfo() { - return policyViolationInfo_ != null; + return ((bitField0_ & 0x00000010) != 0); } + /** * * @@ -579,6 +627,7 @@ public com.google.cloud.audit.PolicyViolationInfo getPolicyViolationInfo() { ? com.google.cloud.audit.PolicyViolationInfo.getDefaultInstance() : policyViolationInfo_; } + /** * * @@ -592,11 +641,14 @@ public com.google.cloud.audit.PolicyViolationInfo getPolicyViolationInfo() { */ @java.lang.Override public com.google.cloud.audit.PolicyViolationInfoOrBuilder getPolicyViolationInfoOrBuilder() { - return getPolicyViolationInfo(); + return policyViolationInfo_ == null + ? com.google.cloud.audit.PolicyViolationInfo.getDefaultInstance() + : policyViolationInfo_; } public static final int REQUEST_METADATA_FIELD_NUMBER = 4; private com.google.cloud.audit.RequestMetadata requestMetadata_; + /** * * @@ -610,8 +662,9 @@ public com.google.cloud.audit.PolicyViolationInfoOrBuilder getPolicyViolationInf */ @java.lang.Override public boolean hasRequestMetadata() { - return requestMetadata_ != null; + return ((bitField0_ & 0x00000020) != 0); } + /** * * @@ -629,6 +682,7 @@ public com.google.cloud.audit.RequestMetadata getRequestMetadata() { ? com.google.cloud.audit.RequestMetadata.getDefaultInstance() : requestMetadata_; } + /** * * @@ -640,11 +694,14 @@ public com.google.cloud.audit.RequestMetadata getRequestMetadata() { */ @java.lang.Override public com.google.cloud.audit.RequestMetadataOrBuilder getRequestMetadataOrBuilder() { - return getRequestMetadata(); + return requestMetadata_ == null + ? com.google.cloud.audit.RequestMetadata.getDefaultInstance() + : requestMetadata_; } public static final int REQUEST_FIELD_NUMBER = 16; private com.google.protobuf.Struct request_; + /** * * @@ -663,8 +720,9 @@ public com.google.cloud.audit.RequestMetadataOrBuilder getRequestMetadataOrBuild */ @java.lang.Override public boolean hasRequest() { - return request_ != null; + return ((bitField0_ & 0x00000040) != 0); } + /** * * @@ -685,6 +743,7 @@ public boolean hasRequest() { public com.google.protobuf.Struct getRequest() { return request_ == null ? com.google.protobuf.Struct.getDefaultInstance() : request_; } + /** * * @@ -701,11 +760,12 @@ public com.google.protobuf.Struct getRequest() { */ @java.lang.Override public com.google.protobuf.StructOrBuilder getRequestOrBuilder() { - return getRequest(); + return request_ == null ? com.google.protobuf.Struct.getDefaultInstance() : request_; } public static final int RESPONSE_FIELD_NUMBER = 17; private com.google.protobuf.Struct response_; + /** * * @@ -724,8 +784,9 @@ public com.google.protobuf.StructOrBuilder getRequestOrBuilder() { */ @java.lang.Override public boolean hasResponse() { - return response_ != null; + return ((bitField0_ & 0x00000080) != 0); } + /** * * @@ -746,6 +807,7 @@ public boolean hasResponse() { public com.google.protobuf.Struct getResponse() { return response_ == null ? com.google.protobuf.Struct.getDefaultInstance() : response_; } + /** * * @@ -762,11 +824,12 @@ public com.google.protobuf.Struct getResponse() { */ @java.lang.Override public com.google.protobuf.StructOrBuilder getResponseOrBuilder() { - return getResponse(); + return response_ == null ? com.google.protobuf.Struct.getDefaultInstance() : response_; } public static final int METADATA_FIELD_NUMBER = 18; private com.google.protobuf.Struct metadata_; + /** * * @@ -781,8 +844,9 @@ public com.google.protobuf.StructOrBuilder getResponseOrBuilder() { */ @java.lang.Override public boolean hasMetadata() { - return metadata_ != null; + return ((bitField0_ & 0x00000100) != 0); } + /** * * @@ -799,6 +863,7 @@ public boolean hasMetadata() { public com.google.protobuf.Struct getMetadata() { return metadata_ == null ? com.google.protobuf.Struct.getDefaultInstance() : metadata_; } + /** * * @@ -811,11 +876,12 @@ public com.google.protobuf.Struct getMetadata() { */ @java.lang.Override public com.google.protobuf.StructOrBuilder getMetadataOrBuilder() { - return getMetadata(); + return metadata_ == null ? com.google.protobuf.Struct.getDefaultInstance() : metadata_; } public static final int SERVICE_DATA_FIELD_NUMBER = 15; private com.google.protobuf.Any serviceData_; + /** * * @@ -834,8 +900,9 @@ public com.google.protobuf.StructOrBuilder getMetadataOrBuilder() { @java.lang.Override @java.lang.Deprecated public boolean hasServiceData() { - return serviceData_ != null; + return ((bitField0_ & 0x00000200) != 0); } + /** * * @@ -856,6 +923,7 @@ public boolean hasServiceData() { public com.google.protobuf.Any getServiceData() { return serviceData_ == null ? com.google.protobuf.Any.getDefaultInstance() : serviceData_; } + /** * * @@ -870,7 +938,7 @@ public com.google.protobuf.Any getServiceData() { @java.lang.Override @java.lang.Deprecated public com.google.protobuf.AnyOrBuilder getServiceDataOrBuilder() { - return getServiceData(); + return serviceData_ == null ? com.google.protobuf.Any.getDefaultInstance() : serviceData_; } private byte memoizedIsInitialized = -1; @@ -887,49 +955,49 @@ public final boolean isInitialized() { @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (status_ != null) { + if (((bitField0_ & 0x00000004) != 0)) { output.writeMessage(2, getStatus()); } - if (authenticationInfo_ != null) { + if (((bitField0_ & 0x00000008) != 0)) { output.writeMessage(3, getAuthenticationInfo()); } - if (requestMetadata_ != null) { + if (((bitField0_ & 0x00000020) != 0)) { output.writeMessage(4, getRequestMetadata()); } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(serviceName_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 7, serviceName_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(serviceName_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 7, serviceName_); } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(methodName_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 8, methodName_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(methodName_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 8, methodName_); } for (int i = 0; i < authorizationInfo_.size(); i++) { output.writeMessage(9, authorizationInfo_.get(i)); } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(resourceName_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 11, resourceName_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(resourceName_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 11, resourceName_); } if (numResponseItems_ != 0L) { output.writeInt64(12, numResponseItems_); } - if (serviceData_ != null) { + if (((bitField0_ & 0x00000200) != 0)) { output.writeMessage(15, getServiceData()); } - if (request_ != null) { + if (((bitField0_ & 0x00000040) != 0)) { output.writeMessage(16, getRequest()); } - if (response_ != null) { + if (((bitField0_ & 0x00000080) != 0)) { output.writeMessage(17, getResponse()); } - if (metadata_ != null) { + if (((bitField0_ & 0x00000100) != 0)) { output.writeMessage(18, getMetadata()); } - if (resourceOriginalState_ != null) { + if (((bitField0_ & 0x00000002) != 0)) { output.writeMessage(19, getResourceOriginalState()); } - if (resourceLocation_ != null) { + if (((bitField0_ & 0x00000001) != 0)) { output.writeMessage(20, getResourceLocation()); } - if (policyViolationInfo_ != null) { + if (((bitField0_ & 0x00000010) != 0)) { output.writeMessage(25, getPolicyViolationInfo()); } getUnknownFields().writeTo(output); @@ -941,51 +1009,51 @@ public int getSerializedSize() { if (size != -1) return size; size = 0; - if (status_ != null) { + if (((bitField0_ & 0x00000004) != 0)) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getStatus()); } - if (authenticationInfo_ != null) { + if (((bitField0_ & 0x00000008) != 0)) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getAuthenticationInfo()); } - if (requestMetadata_ != null) { + if (((bitField0_ & 0x00000020) != 0)) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, getRequestMetadata()); } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(serviceName_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(7, serviceName_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(serviceName_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(7, serviceName_); } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(methodName_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(8, methodName_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(methodName_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(8, methodName_); } for (int i = 0; i < authorizationInfo_.size(); i++) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(9, authorizationInfo_.get(i)); } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(resourceName_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(11, resourceName_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(resourceName_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(11, resourceName_); } if (numResponseItems_ != 0L) { size += com.google.protobuf.CodedOutputStream.computeInt64Size(12, numResponseItems_); } - if (serviceData_ != null) { + if (((bitField0_ & 0x00000200) != 0)) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(15, getServiceData()); } - if (request_ != null) { + if (((bitField0_ & 0x00000040) != 0)) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(16, getRequest()); } - if (response_ != null) { + if (((bitField0_ & 0x00000080) != 0)) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(17, getResponse()); } - if (metadata_ != null) { + if (((bitField0_ & 0x00000100) != 0)) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(18, getMetadata()); } - if (resourceOriginalState_ != null) { + if (((bitField0_ & 0x00000002) != 0)) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(19, getResourceOriginalState()); } - if (resourceLocation_ != null) { + if (((bitField0_ & 0x00000001) != 0)) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(20, getResourceLocation()); } - if (policyViolationInfo_ != null) { + if (((bitField0_ & 0x00000010) != 0)) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(25, getPolicyViolationInfo()); } @@ -1153,38 +1221,38 @@ public static com.google.cloud.audit.AuditLog parseFrom( public static com.google.cloud.audit.AuditLog parseFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); } public static com.google.cloud.audit.AuditLog parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } public static com.google.cloud.audit.AuditLog parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); } public static com.google.cloud.audit.AuditLog parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( PARSER, input, extensionRegistry); } public static com.google.cloud.audit.AuditLog parseFrom( com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); } public static com.google.cloud.audit.AuditLog parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } @@ -1207,10 +1275,11 @@ public Builder toBuilder() { } @java.lang.Override - protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { Builder builder = new Builder(parent); return builder; } + /** * * @@ -1220,7 +1289,7 @@ protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.Build * * Protobuf type {@code google.cloud.audit.AuditLog} */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder implements // @@protoc_insertion_point(builder_implements:google.cloud.audit.AuditLog) com.google.cloud.audit.AuditLogOrBuilder { @@ -1230,7 +1299,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.cloud.audit.AuditLogProto .internal_static_google_cloud_audit_AuditLog_fieldAccessorTable @@ -1239,45 +1308,57 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } // Construct using com.google.cloud.audit.AuditLog.newBuilder() - private Builder() {} + private Builder() { + maybeForceBuilderInitialization(); + } - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetResourceLocationFieldBuilder(); + internalGetResourceOriginalStateFieldBuilder(); + internalGetStatusFieldBuilder(); + internalGetAuthenticationInfoFieldBuilder(); + internalGetAuthorizationInfoFieldBuilder(); + internalGetPolicyViolationInfoFieldBuilder(); + internalGetRequestMetadataFieldBuilder(); + internalGetRequestFieldBuilder(); + internalGetResponseFieldBuilder(); + internalGetMetadataFieldBuilder(); + internalGetServiceDataFieldBuilder(); + } } @java.lang.Override public Builder clear() { super.clear(); + bitField0_ = 0; serviceName_ = ""; - methodName_ = ""; - resourceName_ = ""; - - if (resourceLocationBuilder_ == null) { - resourceLocation_ = null; - } else { - resourceLocation_ = null; + resourceLocation_ = null; + if (resourceLocationBuilder_ != null) { + resourceLocationBuilder_.dispose(); resourceLocationBuilder_ = null; } - if (resourceOriginalStateBuilder_ == null) { - resourceOriginalState_ = null; - } else { - resourceOriginalState_ = null; + resourceOriginalState_ = null; + if (resourceOriginalStateBuilder_ != null) { + resourceOriginalStateBuilder_.dispose(); resourceOriginalStateBuilder_ = null; } numResponseItems_ = 0L; - - if (statusBuilder_ == null) { - status_ = null; - } else { - status_ = null; + status_ = null; + if (statusBuilder_ != null) { + statusBuilder_.dispose(); statusBuilder_ = null; } - if (authenticationInfoBuilder_ == null) { - authenticationInfo_ = null; - } else { - authenticationInfo_ = null; + authenticationInfo_ = null; + if (authenticationInfoBuilder_ != null) { + authenticationInfoBuilder_.dispose(); authenticationInfoBuilder_ = null; } if (authorizationInfoBuilder_ == null) { @@ -1286,41 +1367,35 @@ public Builder clear() { authorizationInfo_ = null; authorizationInfoBuilder_.clear(); } - bitField0_ = (bitField0_ & ~0x00000001); - if (policyViolationInfoBuilder_ == null) { - policyViolationInfo_ = null; - } else { - policyViolationInfo_ = null; + bitField0_ = (bitField0_ & ~0x00000100); + policyViolationInfo_ = null; + if (policyViolationInfoBuilder_ != null) { + policyViolationInfoBuilder_.dispose(); policyViolationInfoBuilder_ = null; } - if (requestMetadataBuilder_ == null) { - requestMetadata_ = null; - } else { - requestMetadata_ = null; + requestMetadata_ = null; + if (requestMetadataBuilder_ != null) { + requestMetadataBuilder_.dispose(); requestMetadataBuilder_ = null; } - if (requestBuilder_ == null) { - request_ = null; - } else { - request_ = null; + request_ = null; + if (requestBuilder_ != null) { + requestBuilder_.dispose(); requestBuilder_ = null; } - if (responseBuilder_ == null) { - response_ = null; - } else { - response_ = null; + response_ = null; + if (responseBuilder_ != null) { + responseBuilder_.dispose(); responseBuilder_ = null; } - if (metadataBuilder_ == null) { - metadata_ = null; - } else { - metadata_ = null; + metadata_ = null; + if (metadataBuilder_ != null) { + metadataBuilder_.dispose(); metadataBuilder_ = null; } - if (serviceDataBuilder_ == null) { - serviceData_ = null; - } else { - serviceData_ = null; + serviceData_ = null; + if (serviceDataBuilder_ != null) { + serviceDataBuilder_.dispose(); serviceDataBuilder_ = null; } return this; @@ -1349,105 +1424,94 @@ public com.google.cloud.audit.AuditLog build() { @java.lang.Override public com.google.cloud.audit.AuditLog buildPartial() { com.google.cloud.audit.AuditLog result = new com.google.cloud.audit.AuditLog(this); - int from_bitField0_ = bitField0_; - result.serviceName_ = serviceName_; - result.methodName_ = methodName_; - result.resourceName_ = resourceName_; - if (resourceLocationBuilder_ == null) { - result.resourceLocation_ = resourceLocation_; - } else { - result.resourceLocation_ = resourceLocationBuilder_.build(); - } - if (resourceOriginalStateBuilder_ == null) { - result.resourceOriginalState_ = resourceOriginalState_; - } else { - result.resourceOriginalState_ = resourceOriginalStateBuilder_.build(); - } - result.numResponseItems_ = numResponseItems_; - if (statusBuilder_ == null) { - result.status_ = status_; - } else { - result.status_ = statusBuilder_.build(); - } - if (authenticationInfoBuilder_ == null) { - result.authenticationInfo_ = authenticationInfo_; - } else { - result.authenticationInfo_ = authenticationInfoBuilder_.build(); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields(com.google.cloud.audit.AuditLog result) { if (authorizationInfoBuilder_ == null) { - if (((bitField0_ & 0x00000001) != 0)) { + if (((bitField0_ & 0x00000100) != 0)) { authorizationInfo_ = java.util.Collections.unmodifiableList(authorizationInfo_); - bitField0_ = (bitField0_ & ~0x00000001); + bitField0_ = (bitField0_ & ~0x00000100); } result.authorizationInfo_ = authorizationInfo_; } else { result.authorizationInfo_ = authorizationInfoBuilder_.build(); } - if (policyViolationInfoBuilder_ == null) { - result.policyViolationInfo_ = policyViolationInfo_; - } else { - result.policyViolationInfo_ = policyViolationInfoBuilder_.build(); - } - if (requestMetadataBuilder_ == null) { - result.requestMetadata_ = requestMetadata_; - } else { - result.requestMetadata_ = requestMetadataBuilder_.build(); - } - if (requestBuilder_ == null) { - result.request_ = request_; - } else { - result.request_ = requestBuilder_.build(); - } - if (responseBuilder_ == null) { - result.response_ = response_; - } else { - result.response_ = responseBuilder_.build(); - } - if (metadataBuilder_ == null) { - result.metadata_ = metadata_; - } else { - result.metadata_ = metadataBuilder_.build(); - } - if (serviceDataBuilder_ == null) { - result.serviceData_ = serviceData_; - } else { - result.serviceData_ = serviceDataBuilder_.build(); - } - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.setField(field, value); - } - - @java.lang.Override - public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - - @java.lang.Override - public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); } - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.addRepeatedField(field, value); + private void buildPartial0(com.google.cloud.audit.AuditLog result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.serviceName_ = serviceName_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.methodName_ = methodName_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.resourceName_ = resourceName_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000008) != 0)) { + result.resourceLocation_ = + resourceLocationBuilder_ == null ? resourceLocation_ : resourceLocationBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.resourceOriginalState_ = + resourceOriginalStateBuilder_ == null + ? resourceOriginalState_ + : resourceOriginalStateBuilder_.build(); + to_bitField0_ |= 0x00000002; + } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.numResponseItems_ = numResponseItems_; + } + if (((from_bitField0_ & 0x00000040) != 0)) { + result.status_ = statusBuilder_ == null ? status_ : statusBuilder_.build(); + to_bitField0_ |= 0x00000004; + } + if (((from_bitField0_ & 0x00000080) != 0)) { + result.authenticationInfo_ = + authenticationInfoBuilder_ == null + ? authenticationInfo_ + : authenticationInfoBuilder_.build(); + to_bitField0_ |= 0x00000008; + } + if (((from_bitField0_ & 0x00000200) != 0)) { + result.policyViolationInfo_ = + policyViolationInfoBuilder_ == null + ? policyViolationInfo_ + : policyViolationInfoBuilder_.build(); + to_bitField0_ |= 0x00000010; + } + if (((from_bitField0_ & 0x00000400) != 0)) { + result.requestMetadata_ = + requestMetadataBuilder_ == null ? requestMetadata_ : requestMetadataBuilder_.build(); + to_bitField0_ |= 0x00000020; + } + if (((from_bitField0_ & 0x00000800) != 0)) { + result.request_ = requestBuilder_ == null ? request_ : requestBuilder_.build(); + to_bitField0_ |= 0x00000040; + } + if (((from_bitField0_ & 0x00001000) != 0)) { + result.response_ = responseBuilder_ == null ? response_ : responseBuilder_.build(); + to_bitField0_ |= 0x00000080; + } + if (((from_bitField0_ & 0x00002000) != 0)) { + result.metadata_ = metadataBuilder_ == null ? metadata_ : metadataBuilder_.build(); + to_bitField0_ |= 0x00000100; + } + if (((from_bitField0_ & 0x00004000) != 0)) { + result.serviceData_ = + serviceDataBuilder_ == null ? serviceData_ : serviceDataBuilder_.build(); + to_bitField0_ |= 0x00000200; + } + result.bitField0_ |= to_bitField0_; } @java.lang.Override @@ -1464,14 +1528,17 @@ public Builder mergeFrom(com.google.cloud.audit.AuditLog other) { if (other == com.google.cloud.audit.AuditLog.getDefaultInstance()) return this; if (!other.getServiceName().isEmpty()) { serviceName_ = other.serviceName_; + bitField0_ |= 0x00000001; onChanged(); } if (!other.getMethodName().isEmpty()) { methodName_ = other.methodName_; + bitField0_ |= 0x00000002; onChanged(); } if (!other.getResourceName().isEmpty()) { resourceName_ = other.resourceName_; + bitField0_ |= 0x00000004; onChanged(); } if (other.hasResourceLocation()) { @@ -1493,7 +1560,7 @@ public Builder mergeFrom(com.google.cloud.audit.AuditLog other) { if (!other.authorizationInfo_.isEmpty()) { if (authorizationInfo_.isEmpty()) { authorizationInfo_ = other.authorizationInfo_; - bitField0_ = (bitField0_ & ~0x00000001); + bitField0_ = (bitField0_ & ~0x00000100); } else { ensureAuthorizationInfoIsMutable(); authorizationInfo_.addAll(other.authorizationInfo_); @@ -1506,10 +1573,10 @@ public Builder mergeFrom(com.google.cloud.audit.AuditLog other) { authorizationInfoBuilder_.dispose(); authorizationInfoBuilder_ = null; authorizationInfo_ = other.authorizationInfo_; - bitField0_ = (bitField0_ & ~0x00000001); + bitField0_ = (bitField0_ & ~0x00000100); authorizationInfoBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders - ? getAuthorizationInfoFieldBuilder() + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders + ? internalGetAuthorizationInfoFieldBuilder() : null; } else { authorizationInfoBuilder_.addAllMessages(other.authorizationInfo_); @@ -1562,33 +1629,34 @@ public Builder mergeFrom( break; case 18: { - input.readMessage(getStatusFieldBuilder().getBuilder(), extensionRegistry); - + input.readMessage(internalGetStatusFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000040; break; } // case 18 case 26: { input.readMessage( - getAuthenticationInfoFieldBuilder().getBuilder(), extensionRegistry); - + internalGetAuthenticationInfoFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000080; break; } // case 26 case 34: { - input.readMessage(getRequestMetadataFieldBuilder().getBuilder(), extensionRegistry); - + input.readMessage( + internalGetRequestMetadataFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000400; break; } // case 34 case 58: { serviceName_ = input.readStringRequireUtf8(); - + bitField0_ |= 0x00000001; break; } // case 58 case 66: { methodName_ = input.readStringRequireUtf8(); - + bitField0_ |= 0x00000002; break; } // case 66 case 74: @@ -1607,58 +1675,61 @@ public Builder mergeFrom( case 90: { resourceName_ = input.readStringRequireUtf8(); - + bitField0_ |= 0x00000004; break; } // case 90 case 96: { numResponseItems_ = input.readInt64(); - + bitField0_ |= 0x00000020; break; } // case 96 case 122: { - input.readMessage(getServiceDataFieldBuilder().getBuilder(), extensionRegistry); - + input.readMessage( + internalGetServiceDataFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00004000; break; } // case 122 case 130: { - input.readMessage(getRequestFieldBuilder().getBuilder(), extensionRegistry); - + input.readMessage(internalGetRequestFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000800; break; } // case 130 case 138: { - input.readMessage(getResponseFieldBuilder().getBuilder(), extensionRegistry); - + input.readMessage( + internalGetResponseFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00001000; break; } // case 138 case 146: { - input.readMessage(getMetadataFieldBuilder().getBuilder(), extensionRegistry); - + input.readMessage( + internalGetMetadataFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00002000; break; } // case 146 case 154: { input.readMessage( - getResourceOriginalStateFieldBuilder().getBuilder(), extensionRegistry); - + internalGetResourceOriginalStateFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000010; break; } // case 154 case 162: { input.readMessage( - getResourceLocationFieldBuilder().getBuilder(), extensionRegistry); - + internalGetResourceLocationFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000008; break; } // case 162 case 202: { input.readMessage( - getPolicyViolationInfoFieldBuilder().getBuilder(), extensionRegistry); - + internalGetPolicyViolationInfoFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000200; break; } // case 202 default: @@ -1681,6 +1752,7 @@ public Builder mergeFrom( private int bitField0_; private java.lang.Object serviceName_ = ""; + /** * * @@ -1704,6 +1776,7 @@ public java.lang.String getServiceName() { return (java.lang.String) ref; } } + /** * * @@ -1727,6 +1800,7 @@ public com.google.protobuf.ByteString getServiceNameBytes() { return (com.google.protobuf.ByteString) ref; } } + /** * * @@ -1744,11 +1818,12 @@ public Builder setServiceName(java.lang.String value) { if (value == null) { throw new NullPointerException(); } - serviceName_ = value; + bitField0_ |= 0x00000001; onChanged(); return this; } + /** * * @@ -1762,11 +1837,12 @@ public Builder setServiceName(java.lang.String value) { * @return This builder for chaining. */ public Builder clearServiceName() { - serviceName_ = getDefaultInstance().getServiceName(); + bitField0_ = (bitField0_ & ~0x00000001); onChanged(); return this; } + /** * * @@ -1785,13 +1861,14 @@ public Builder setServiceNameBytes(com.google.protobuf.ByteString value) { throw new NullPointerException(); } checkByteStringIsUtf8(value); - serviceName_ = value; + bitField0_ |= 0x00000001; onChanged(); return this; } private java.lang.Object methodName_ = ""; + /** * * @@ -1799,8 +1876,9 @@ public Builder setServiceNameBytes(com.google.protobuf.ByteString value) { * The name of the service method or operation. * For API calls, this should be the name of the API method. * For example, - * "google.cloud.bigquery.v2.TableService.InsertTable" - * "google.logging.v2.ConfigServiceV2.CreateSink" + * + * "google.cloud.bigquery.v2.TableService.InsertTable" + * "google.logging.v2.ConfigServiceV2.CreateSink" *
        * * string method_name = 8; @@ -1818,6 +1896,7 @@ public java.lang.String getMethodName() { return (java.lang.String) ref; } } + /** * * @@ -1825,8 +1904,9 @@ public java.lang.String getMethodName() { * The name of the service method or operation. * For API calls, this should be the name of the API method. * For example, - * "google.cloud.bigquery.v2.TableService.InsertTable" - * "google.logging.v2.ConfigServiceV2.CreateSink" + * + * "google.cloud.bigquery.v2.TableService.InsertTable" + * "google.logging.v2.ConfigServiceV2.CreateSink" *
        * * string method_name = 8; @@ -1844,6 +1924,7 @@ public com.google.protobuf.ByteString getMethodNameBytes() { return (com.google.protobuf.ByteString) ref; } } + /** * * @@ -1851,8 +1932,9 @@ public com.google.protobuf.ByteString getMethodNameBytes() { * The name of the service method or operation. * For API calls, this should be the name of the API method. * For example, - * "google.cloud.bigquery.v2.TableService.InsertTable" - * "google.logging.v2.ConfigServiceV2.CreateSink" + * + * "google.cloud.bigquery.v2.TableService.InsertTable" + * "google.logging.v2.ConfigServiceV2.CreateSink" *
        * * string method_name = 8; @@ -1864,11 +1946,12 @@ public Builder setMethodName(java.lang.String value) { if (value == null) { throw new NullPointerException(); } - methodName_ = value; + bitField0_ |= 0x00000002; onChanged(); return this; } + /** * * @@ -1876,8 +1959,9 @@ public Builder setMethodName(java.lang.String value) { * The name of the service method or operation. * For API calls, this should be the name of the API method. * For example, - * "google.cloud.bigquery.v2.TableService.InsertTable" - * "google.logging.v2.ConfigServiceV2.CreateSink" + * + * "google.cloud.bigquery.v2.TableService.InsertTable" + * "google.logging.v2.ConfigServiceV2.CreateSink" * * * string method_name = 8; @@ -1885,11 +1969,12 @@ public Builder setMethodName(java.lang.String value) { * @return This builder for chaining. */ public Builder clearMethodName() { - methodName_ = getDefaultInstance().getMethodName(); + bitField0_ = (bitField0_ & ~0x00000002); onChanged(); return this; } + /** * * @@ -1897,8 +1982,9 @@ public Builder clearMethodName() { * The name of the service method or operation. * For API calls, this should be the name of the API method. * For example, - * "google.cloud.bigquery.v2.TableService.InsertTable" - * "google.logging.v2.ConfigServiceV2.CreateSink" + * + * "google.cloud.bigquery.v2.TableService.InsertTable" + * "google.logging.v2.ConfigServiceV2.CreateSink" * * * string method_name = 8; @@ -1911,13 +1997,14 @@ public Builder setMethodNameBytes(com.google.protobuf.ByteString value) { throw new NullPointerException(); } checkByteStringIsUtf8(value); - methodName_ = value; + bitField0_ |= 0x00000002; onChanged(); return this; } private java.lang.Object resourceName_ = ""; + /** * * @@ -1925,8 +2012,9 @@ public Builder setMethodNameBytes(com.google.protobuf.ByteString value) { * The resource or collection that is the target of the operation. * The name is a scheme-less URI, not including the API service name. * For example: - * "projects/PROJECT_ID/zones/us-central1-a/instances" - * "projects/PROJECT_ID/datasets/DATASET_ID" + * + * "projects/PROJECT_ID/zones/us-central1-a/instances" + * "projects/PROJECT_ID/datasets/DATASET_ID" * * * string resource_name = 11; @@ -1944,6 +2032,7 @@ public java.lang.String getResourceName() { return (java.lang.String) ref; } } + /** * * @@ -1951,8 +2040,9 @@ public java.lang.String getResourceName() { * The resource or collection that is the target of the operation. * The name is a scheme-less URI, not including the API service name. * For example: - * "projects/PROJECT_ID/zones/us-central1-a/instances" - * "projects/PROJECT_ID/datasets/DATASET_ID" + * + * "projects/PROJECT_ID/zones/us-central1-a/instances" + * "projects/PROJECT_ID/datasets/DATASET_ID" * * * string resource_name = 11; @@ -1970,6 +2060,7 @@ public com.google.protobuf.ByteString getResourceNameBytes() { return (com.google.protobuf.ByteString) ref; } } + /** * * @@ -1977,8 +2068,9 @@ public com.google.protobuf.ByteString getResourceNameBytes() { * The resource or collection that is the target of the operation. * The name is a scheme-less URI, not including the API service name. * For example: - * "projects/PROJECT_ID/zones/us-central1-a/instances" - * "projects/PROJECT_ID/datasets/DATASET_ID" + * + * "projects/PROJECT_ID/zones/us-central1-a/instances" + * "projects/PROJECT_ID/datasets/DATASET_ID" * * * string resource_name = 11; @@ -1990,11 +2082,12 @@ public Builder setResourceName(java.lang.String value) { if (value == null) { throw new NullPointerException(); } - resourceName_ = value; + bitField0_ |= 0x00000004; onChanged(); return this; } + /** * * @@ -2002,8 +2095,9 @@ public Builder setResourceName(java.lang.String value) { * The resource or collection that is the target of the operation. * The name is a scheme-less URI, not including the API service name. * For example: - * "projects/PROJECT_ID/zones/us-central1-a/instances" - * "projects/PROJECT_ID/datasets/DATASET_ID" + * + * "projects/PROJECT_ID/zones/us-central1-a/instances" + * "projects/PROJECT_ID/datasets/DATASET_ID" * * * string resource_name = 11; @@ -2011,11 +2105,12 @@ public Builder setResourceName(java.lang.String value) { * @return This builder for chaining. */ public Builder clearResourceName() { - resourceName_ = getDefaultInstance().getResourceName(); + bitField0_ = (bitField0_ & ~0x00000004); onChanged(); return this; } + /** * * @@ -2023,8 +2118,9 @@ public Builder clearResourceName() { * The resource or collection that is the target of the operation. * The name is a scheme-less URI, not including the API service name. * For example: - * "projects/PROJECT_ID/zones/us-central1-a/instances" - * "projects/PROJECT_ID/datasets/DATASET_ID" + * + * "projects/PROJECT_ID/zones/us-central1-a/instances" + * "projects/PROJECT_ID/datasets/DATASET_ID" * * * string resource_name = 11; @@ -2037,18 +2133,19 @@ public Builder setResourceNameBytes(com.google.protobuf.ByteString value) { throw new NullPointerException(); } checkByteStringIsUtf8(value); - resourceName_ = value; + bitField0_ |= 0x00000004; onChanged(); return this; } private com.google.cloud.audit.ResourceLocation resourceLocation_; - private com.google.protobuf.SingleFieldBuilderV3< + private com.google.protobuf.SingleFieldBuilder< com.google.cloud.audit.ResourceLocation, com.google.cloud.audit.ResourceLocation.Builder, com.google.cloud.audit.ResourceLocationOrBuilder> resourceLocationBuilder_; + /** * * @@ -2061,8 +2158,9 @@ public Builder setResourceNameBytes(com.google.protobuf.ByteString value) { * @return Whether the resourceLocation field is set. */ public boolean hasResourceLocation() { - return resourceLocationBuilder_ != null || resourceLocation_ != null; + return ((bitField0_ & 0x00000008) != 0); } + /** * * @@ -2083,6 +2181,7 @@ public com.google.cloud.audit.ResourceLocation getResourceLocation() { return resourceLocationBuilder_.getMessage(); } } + /** * * @@ -2098,13 +2197,14 @@ public Builder setResourceLocation(com.google.cloud.audit.ResourceLocation value throw new NullPointerException(); } resourceLocation_ = value; - onChanged(); } else { resourceLocationBuilder_.setMessage(value); } - + bitField0_ |= 0x00000008; + onChanged(); return this; } + /** * * @@ -2118,13 +2218,14 @@ public Builder setResourceLocation( com.google.cloud.audit.ResourceLocation.Builder builderForValue) { if (resourceLocationBuilder_ == null) { resourceLocation_ = builderForValue.build(); - onChanged(); } else { resourceLocationBuilder_.setMessage(builderForValue.build()); } - + bitField0_ |= 0x00000008; + onChanged(); return this; } + /** * * @@ -2136,21 +2237,23 @@ public Builder setResourceLocation( */ public Builder mergeResourceLocation(com.google.cloud.audit.ResourceLocation value) { if (resourceLocationBuilder_ == null) { - if (resourceLocation_ != null) { - resourceLocation_ = - com.google.cloud.audit.ResourceLocation.newBuilder(resourceLocation_) - .mergeFrom(value) - .buildPartial(); + if (((bitField0_ & 0x00000008) != 0) + && resourceLocation_ != null + && resourceLocation_ != com.google.cloud.audit.ResourceLocation.getDefaultInstance()) { + getResourceLocationBuilder().mergeFrom(value); } else { resourceLocation_ = value; } - onChanged(); } else { resourceLocationBuilder_.mergeFrom(value); } - + if (resourceLocation_ != null) { + bitField0_ |= 0x00000008; + onChanged(); + } return this; } + /** * * @@ -2161,16 +2264,16 @@ public Builder mergeResourceLocation(com.google.cloud.audit.ResourceLocation val * .google.cloud.audit.ResourceLocation resource_location = 20; */ public Builder clearResourceLocation() { - if (resourceLocationBuilder_ == null) { - resourceLocation_ = null; - onChanged(); - } else { - resourceLocation_ = null; + bitField0_ = (bitField0_ & ~0x00000008); + resourceLocation_ = null; + if (resourceLocationBuilder_ != null) { + resourceLocationBuilder_.dispose(); resourceLocationBuilder_ = null; } - + onChanged(); return this; } + /** * * @@ -2181,10 +2284,11 @@ public Builder clearResourceLocation() { * .google.cloud.audit.ResourceLocation resource_location = 20; */ public com.google.cloud.audit.ResourceLocation.Builder getResourceLocationBuilder() { - + bitField0_ |= 0x00000008; onChanged(); - return getResourceLocationFieldBuilder().getBuilder(); + return internalGetResourceLocationFieldBuilder().getBuilder(); } + /** * * @@ -2203,6 +2307,7 @@ public com.google.cloud.audit.ResourceLocationOrBuilder getResourceLocationOrBui : resourceLocation_; } } + /** * * @@ -2212,14 +2317,14 @@ public com.google.cloud.audit.ResourceLocationOrBuilder getResourceLocationOrBui * * .google.cloud.audit.ResourceLocation resource_location = 20; */ - private com.google.protobuf.SingleFieldBuilderV3< + private com.google.protobuf.SingleFieldBuilder< com.google.cloud.audit.ResourceLocation, com.google.cloud.audit.ResourceLocation.Builder, com.google.cloud.audit.ResourceLocationOrBuilder> - getResourceLocationFieldBuilder() { + internalGetResourceLocationFieldBuilder() { if (resourceLocationBuilder_ == null) { resourceLocationBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< + new com.google.protobuf.SingleFieldBuilder< com.google.cloud.audit.ResourceLocation, com.google.cloud.audit.ResourceLocation.Builder, com.google.cloud.audit.ResourceLocationOrBuilder>( @@ -2230,11 +2335,12 @@ public com.google.cloud.audit.ResourceLocationOrBuilder getResourceLocationOrBui } private com.google.protobuf.Struct resourceOriginalState_; - private com.google.protobuf.SingleFieldBuilderV3< + private com.google.protobuf.SingleFieldBuilder< com.google.protobuf.Struct, com.google.protobuf.Struct.Builder, com.google.protobuf.StructOrBuilder> resourceOriginalStateBuilder_; + /** * * @@ -2253,8 +2359,9 @@ public com.google.cloud.audit.ResourceLocationOrBuilder getResourceLocationOrBui * @return Whether the resourceOriginalState field is set. */ public boolean hasResourceOriginalState() { - return resourceOriginalStateBuilder_ != null || resourceOriginalState_ != null; + return ((bitField0_ & 0x00000010) != 0); } + /** * * @@ -2281,6 +2388,7 @@ public com.google.protobuf.Struct getResourceOriginalState() { return resourceOriginalStateBuilder_.getMessage(); } } + /** * * @@ -2302,13 +2410,14 @@ public Builder setResourceOriginalState(com.google.protobuf.Struct value) { throw new NullPointerException(); } resourceOriginalState_ = value; - onChanged(); } else { resourceOriginalStateBuilder_.setMessage(value); } - + bitField0_ |= 0x00000010; + onChanged(); return this; } + /** * * @@ -2327,13 +2436,14 @@ public Builder setResourceOriginalState(com.google.protobuf.Struct value) { public Builder setResourceOriginalState(com.google.protobuf.Struct.Builder builderForValue) { if (resourceOriginalStateBuilder_ == null) { resourceOriginalState_ = builderForValue.build(); - onChanged(); } else { resourceOriginalStateBuilder_.setMessage(builderForValue.build()); } - + bitField0_ |= 0x00000010; + onChanged(); return this; } + /** * * @@ -2351,21 +2461,23 @@ public Builder setResourceOriginalState(com.google.protobuf.Struct.Builder build */ public Builder mergeResourceOriginalState(com.google.protobuf.Struct value) { if (resourceOriginalStateBuilder_ == null) { - if (resourceOriginalState_ != null) { - resourceOriginalState_ = - com.google.protobuf.Struct.newBuilder(resourceOriginalState_) - .mergeFrom(value) - .buildPartial(); + if (((bitField0_ & 0x00000010) != 0) + && resourceOriginalState_ != null + && resourceOriginalState_ != com.google.protobuf.Struct.getDefaultInstance()) { + getResourceOriginalStateBuilder().mergeFrom(value); } else { resourceOriginalState_ = value; } - onChanged(); } else { resourceOriginalStateBuilder_.mergeFrom(value); } - + if (resourceOriginalState_ != null) { + bitField0_ |= 0x00000010; + onChanged(); + } return this; } + /** * * @@ -2382,16 +2494,16 @@ public Builder mergeResourceOriginalState(com.google.protobuf.Struct value) { * .google.protobuf.Struct resource_original_state = 19; */ public Builder clearResourceOriginalState() { - if (resourceOriginalStateBuilder_ == null) { - resourceOriginalState_ = null; - onChanged(); - } else { - resourceOriginalState_ = null; + bitField0_ = (bitField0_ & ~0x00000010); + resourceOriginalState_ = null; + if (resourceOriginalStateBuilder_ != null) { + resourceOriginalStateBuilder_.dispose(); resourceOriginalStateBuilder_ = null; } - + onChanged(); return this; } + /** * * @@ -2408,10 +2520,11 @@ public Builder clearResourceOriginalState() { * .google.protobuf.Struct resource_original_state = 19; */ public com.google.protobuf.Struct.Builder getResourceOriginalStateBuilder() { - + bitField0_ |= 0x00000010; onChanged(); - return getResourceOriginalStateFieldBuilder().getBuilder(); + return internalGetResourceOriginalStateFieldBuilder().getBuilder(); } + /** * * @@ -2436,6 +2549,7 @@ public com.google.protobuf.StructOrBuilder getResourceOriginalStateOrBuilder() { : resourceOriginalState_; } } + /** * * @@ -2451,14 +2565,14 @@ public com.google.protobuf.StructOrBuilder getResourceOriginalStateOrBuilder() { * * .google.protobuf.Struct resource_original_state = 19; */ - private com.google.protobuf.SingleFieldBuilderV3< + private com.google.protobuf.SingleFieldBuilder< com.google.protobuf.Struct, com.google.protobuf.Struct.Builder, com.google.protobuf.StructOrBuilder> - getResourceOriginalStateFieldBuilder() { + internalGetResourceOriginalStateFieldBuilder() { if (resourceOriginalStateBuilder_ == null) { resourceOriginalStateBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< + new com.google.protobuf.SingleFieldBuilder< com.google.protobuf.Struct, com.google.protobuf.Struct.Builder, com.google.protobuf.StructOrBuilder>( @@ -2469,6 +2583,7 @@ public com.google.protobuf.StructOrBuilder getResourceOriginalStateOrBuilder() { } private long numResponseItems_; + /** * * @@ -2485,6 +2600,7 @@ public com.google.protobuf.StructOrBuilder getResourceOriginalStateOrBuilder() { public long getNumResponseItems() { return numResponseItems_; } + /** * * @@ -2501,9 +2617,11 @@ public long getNumResponseItems() { public Builder setNumResponseItems(long value) { numResponseItems_ = value; + bitField0_ |= 0x00000020; onChanged(); return this; } + /** * * @@ -2517,16 +2635,17 @@ public Builder setNumResponseItems(long value) { * @return This builder for chaining. */ public Builder clearNumResponseItems() { - + bitField0_ = (bitField0_ & ~0x00000020); numResponseItems_ = 0L; onChanged(); return this; } private com.google.rpc.Status status_; - private com.google.protobuf.SingleFieldBuilderV3< + private com.google.protobuf.SingleFieldBuilder< com.google.rpc.Status, com.google.rpc.Status.Builder, com.google.rpc.StatusOrBuilder> statusBuilder_; + /** * * @@ -2539,8 +2658,9 @@ public Builder clearNumResponseItems() { * @return Whether the status field is set. */ public boolean hasStatus() { - return statusBuilder_ != null || status_ != null; + return ((bitField0_ & 0x00000040) != 0); } + /** * * @@ -2559,6 +2679,7 @@ public com.google.rpc.Status getStatus() { return statusBuilder_.getMessage(); } } + /** * * @@ -2574,13 +2695,14 @@ public Builder setStatus(com.google.rpc.Status value) { throw new NullPointerException(); } status_ = value; - onChanged(); } else { statusBuilder_.setMessage(value); } - + bitField0_ |= 0x00000040; + onChanged(); return this; } + /** * * @@ -2593,13 +2715,14 @@ public Builder setStatus(com.google.rpc.Status value) { public Builder setStatus(com.google.rpc.Status.Builder builderForValue) { if (statusBuilder_ == null) { status_ = builderForValue.build(); - onChanged(); } else { statusBuilder_.setMessage(builderForValue.build()); } - + bitField0_ |= 0x00000040; + onChanged(); return this; } + /** * * @@ -2611,18 +2734,23 @@ public Builder setStatus(com.google.rpc.Status.Builder builderForValue) { */ public Builder mergeStatus(com.google.rpc.Status value) { if (statusBuilder_ == null) { - if (status_ != null) { - status_ = com.google.rpc.Status.newBuilder(status_).mergeFrom(value).buildPartial(); + if (((bitField0_ & 0x00000040) != 0) + && status_ != null + && status_ != com.google.rpc.Status.getDefaultInstance()) { + getStatusBuilder().mergeFrom(value); } else { status_ = value; } - onChanged(); } else { statusBuilder_.mergeFrom(value); } - + if (status_ != null) { + bitField0_ |= 0x00000040; + onChanged(); + } return this; } + /** * * @@ -2633,16 +2761,16 @@ public Builder mergeStatus(com.google.rpc.Status value) { * .google.rpc.Status status = 2; */ public Builder clearStatus() { - if (statusBuilder_ == null) { - status_ = null; - onChanged(); - } else { - status_ = null; + bitField0_ = (bitField0_ & ~0x00000040); + status_ = null; + if (statusBuilder_ != null) { + statusBuilder_.dispose(); statusBuilder_ = null; } - + onChanged(); return this; } + /** * * @@ -2653,10 +2781,11 @@ public Builder clearStatus() { * .google.rpc.Status status = 2; */ public com.google.rpc.Status.Builder getStatusBuilder() { - + bitField0_ |= 0x00000040; onChanged(); - return getStatusFieldBuilder().getBuilder(); + return internalGetStatusFieldBuilder().getBuilder(); } + /** * * @@ -2673,6 +2802,7 @@ public com.google.rpc.StatusOrBuilder getStatusOrBuilder() { return status_ == null ? com.google.rpc.Status.getDefaultInstance() : status_; } } + /** * * @@ -2682,12 +2812,12 @@ public com.google.rpc.StatusOrBuilder getStatusOrBuilder() { * * .google.rpc.Status status = 2; */ - private com.google.protobuf.SingleFieldBuilderV3< + private com.google.protobuf.SingleFieldBuilder< com.google.rpc.Status, com.google.rpc.Status.Builder, com.google.rpc.StatusOrBuilder> - getStatusFieldBuilder() { + internalGetStatusFieldBuilder() { if (statusBuilder_ == null) { statusBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< + new com.google.protobuf.SingleFieldBuilder< com.google.rpc.Status, com.google.rpc.Status.Builder, com.google.rpc.StatusOrBuilder>(getStatus(), getParentForChildren(), isClean()); @@ -2697,11 +2827,12 @@ public com.google.rpc.StatusOrBuilder getStatusOrBuilder() { } private com.google.cloud.audit.AuthenticationInfo authenticationInfo_; - private com.google.protobuf.SingleFieldBuilderV3< + private com.google.protobuf.SingleFieldBuilder< com.google.cloud.audit.AuthenticationInfo, com.google.cloud.audit.AuthenticationInfo.Builder, com.google.cloud.audit.AuthenticationInfoOrBuilder> authenticationInfoBuilder_; + /** * * @@ -2714,8 +2845,9 @@ public com.google.rpc.StatusOrBuilder getStatusOrBuilder() { * @return Whether the authenticationInfo field is set. */ public boolean hasAuthenticationInfo() { - return authenticationInfoBuilder_ != null || authenticationInfo_ != null; + return ((bitField0_ & 0x00000080) != 0); } + /** * * @@ -2736,6 +2868,7 @@ public com.google.cloud.audit.AuthenticationInfo getAuthenticationInfo() { return authenticationInfoBuilder_.getMessage(); } } + /** * * @@ -2751,13 +2884,14 @@ public Builder setAuthenticationInfo(com.google.cloud.audit.AuthenticationInfo v throw new NullPointerException(); } authenticationInfo_ = value; - onChanged(); } else { authenticationInfoBuilder_.setMessage(value); } - + bitField0_ |= 0x00000080; + onChanged(); return this; } + /** * * @@ -2771,13 +2905,14 @@ public Builder setAuthenticationInfo( com.google.cloud.audit.AuthenticationInfo.Builder builderForValue) { if (authenticationInfoBuilder_ == null) { authenticationInfo_ = builderForValue.build(); - onChanged(); } else { authenticationInfoBuilder_.setMessage(builderForValue.build()); } - + bitField0_ |= 0x00000080; + onChanged(); return this; } + /** * * @@ -2789,21 +2924,24 @@ public Builder setAuthenticationInfo( */ public Builder mergeAuthenticationInfo(com.google.cloud.audit.AuthenticationInfo value) { if (authenticationInfoBuilder_ == null) { - if (authenticationInfo_ != null) { - authenticationInfo_ = - com.google.cloud.audit.AuthenticationInfo.newBuilder(authenticationInfo_) - .mergeFrom(value) - .buildPartial(); + if (((bitField0_ & 0x00000080) != 0) + && authenticationInfo_ != null + && authenticationInfo_ + != com.google.cloud.audit.AuthenticationInfo.getDefaultInstance()) { + getAuthenticationInfoBuilder().mergeFrom(value); } else { authenticationInfo_ = value; } - onChanged(); } else { authenticationInfoBuilder_.mergeFrom(value); } - + if (authenticationInfo_ != null) { + bitField0_ |= 0x00000080; + onChanged(); + } return this; } + /** * * @@ -2814,16 +2952,16 @@ public Builder mergeAuthenticationInfo(com.google.cloud.audit.AuthenticationInfo * .google.cloud.audit.AuthenticationInfo authentication_info = 3; */ public Builder clearAuthenticationInfo() { - if (authenticationInfoBuilder_ == null) { - authenticationInfo_ = null; - onChanged(); - } else { - authenticationInfo_ = null; + bitField0_ = (bitField0_ & ~0x00000080); + authenticationInfo_ = null; + if (authenticationInfoBuilder_ != null) { + authenticationInfoBuilder_.dispose(); authenticationInfoBuilder_ = null; } - + onChanged(); return this; } + /** * * @@ -2834,10 +2972,11 @@ public Builder clearAuthenticationInfo() { * .google.cloud.audit.AuthenticationInfo authentication_info = 3; */ public com.google.cloud.audit.AuthenticationInfo.Builder getAuthenticationInfoBuilder() { - + bitField0_ |= 0x00000080; onChanged(); - return getAuthenticationInfoFieldBuilder().getBuilder(); + return internalGetAuthenticationInfoFieldBuilder().getBuilder(); } + /** * * @@ -2856,6 +2995,7 @@ public com.google.cloud.audit.AuthenticationInfoOrBuilder getAuthenticationInfoO : authenticationInfo_; } } + /** * * @@ -2865,14 +3005,14 @@ public com.google.cloud.audit.AuthenticationInfoOrBuilder getAuthenticationInfoO * * .google.cloud.audit.AuthenticationInfo authentication_info = 3; */ - private com.google.protobuf.SingleFieldBuilderV3< + private com.google.protobuf.SingleFieldBuilder< com.google.cloud.audit.AuthenticationInfo, com.google.cloud.audit.AuthenticationInfo.Builder, com.google.cloud.audit.AuthenticationInfoOrBuilder> - getAuthenticationInfoFieldBuilder() { + internalGetAuthenticationInfoFieldBuilder() { if (authenticationInfoBuilder_ == null) { authenticationInfoBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< + new com.google.protobuf.SingleFieldBuilder< com.google.cloud.audit.AuthenticationInfo, com.google.cloud.audit.AuthenticationInfo.Builder, com.google.cloud.audit.AuthenticationInfoOrBuilder>( @@ -2886,14 +3026,14 @@ public com.google.cloud.audit.AuthenticationInfoOrBuilder getAuthenticationInfoO java.util.Collections.emptyList(); private void ensureAuthorizationInfoIsMutable() { - if (!((bitField0_ & 0x00000001) != 0)) { + if (!((bitField0_ & 0x00000100) != 0)) { authorizationInfo_ = new java.util.ArrayList(authorizationInfo_); - bitField0_ |= 0x00000001; + bitField0_ |= 0x00000100; } } - private com.google.protobuf.RepeatedFieldBuilderV3< + private com.google.protobuf.RepeatedFieldBuilder< com.google.cloud.audit.AuthorizationInfo, com.google.cloud.audit.AuthorizationInfo.Builder, com.google.cloud.audit.AuthorizationInfoOrBuilder> @@ -2917,6 +3057,7 @@ public java.util.List getAuthorization return authorizationInfoBuilder_.getMessageList(); } } + /** * * @@ -2935,6 +3076,7 @@ public int getAuthorizationInfoCount() { return authorizationInfoBuilder_.getCount(); } } + /** * * @@ -2953,6 +3095,7 @@ public com.google.cloud.audit.AuthorizationInfo getAuthorizationInfo(int index) return authorizationInfoBuilder_.getMessage(index); } } + /** * * @@ -2977,6 +3120,7 @@ public Builder setAuthorizationInfo(int index, com.google.cloud.audit.Authorizat } return this; } + /** * * @@ -2999,6 +3143,7 @@ public Builder setAuthorizationInfo( } return this; } + /** * * @@ -3023,6 +3168,7 @@ public Builder addAuthorizationInfo(com.google.cloud.audit.AuthorizationInfo val } return this; } + /** * * @@ -3047,6 +3193,7 @@ public Builder addAuthorizationInfo(int index, com.google.cloud.audit.Authorizat } return this; } + /** * * @@ -3069,6 +3216,7 @@ public Builder addAuthorizationInfo( } return this; } + /** * * @@ -3091,6 +3239,7 @@ public Builder addAuthorizationInfo( } return this; } + /** * * @@ -3113,6 +3262,7 @@ public Builder addAllAuthorizationInfo( } return this; } + /** * * @@ -3127,13 +3277,14 @@ public Builder addAllAuthorizationInfo( public Builder clearAuthorizationInfo() { if (authorizationInfoBuilder_ == null) { authorizationInfo_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); + bitField0_ = (bitField0_ & ~0x00000100); onChanged(); } else { authorizationInfoBuilder_.clear(); } return this; } + /** * * @@ -3155,6 +3306,7 @@ public Builder removeAuthorizationInfo(int index) { } return this; } + /** * * @@ -3167,8 +3319,9 @@ public Builder removeAuthorizationInfo(int index) { * repeated .google.cloud.audit.AuthorizationInfo authorization_info = 9; */ public com.google.cloud.audit.AuthorizationInfo.Builder getAuthorizationInfoBuilder(int index) { - return getAuthorizationInfoFieldBuilder().getBuilder(index); + return internalGetAuthorizationInfoFieldBuilder().getBuilder(index); } + /** * * @@ -3188,6 +3341,7 @@ public com.google.cloud.audit.AuthorizationInfoOrBuilder getAuthorizationInfoOrB return authorizationInfoBuilder_.getMessageOrBuilder(index); } } + /** * * @@ -3207,6 +3361,7 @@ public com.google.cloud.audit.AuthorizationInfoOrBuilder getAuthorizationInfoOrB return java.util.Collections.unmodifiableList(authorizationInfo_); } } + /** * * @@ -3219,9 +3374,10 @@ public com.google.cloud.audit.AuthorizationInfoOrBuilder getAuthorizationInfoOrB * repeated .google.cloud.audit.AuthorizationInfo authorization_info = 9; */ public com.google.cloud.audit.AuthorizationInfo.Builder addAuthorizationInfoBuilder() { - return getAuthorizationInfoFieldBuilder() + return internalGetAuthorizationInfoFieldBuilder() .addBuilder(com.google.cloud.audit.AuthorizationInfo.getDefaultInstance()); } + /** * * @@ -3234,9 +3390,10 @@ public com.google.cloud.audit.AuthorizationInfo.Builder addAuthorizationInfoBuil * repeated .google.cloud.audit.AuthorizationInfo authorization_info = 9; */ public com.google.cloud.audit.AuthorizationInfo.Builder addAuthorizationInfoBuilder(int index) { - return getAuthorizationInfoFieldBuilder() + return internalGetAuthorizationInfoFieldBuilder() .addBuilder(index, com.google.cloud.audit.AuthorizationInfo.getDefaultInstance()); } + /** * * @@ -3250,22 +3407,22 @@ public com.google.cloud.audit.AuthorizationInfo.Builder addAuthorizationInfoBuil */ public java.util.List getAuthorizationInfoBuilderList() { - return getAuthorizationInfoFieldBuilder().getBuilderList(); + return internalGetAuthorizationInfoFieldBuilder().getBuilderList(); } - private com.google.protobuf.RepeatedFieldBuilderV3< + private com.google.protobuf.RepeatedFieldBuilder< com.google.cloud.audit.AuthorizationInfo, com.google.cloud.audit.AuthorizationInfo.Builder, com.google.cloud.audit.AuthorizationInfoOrBuilder> - getAuthorizationInfoFieldBuilder() { + internalGetAuthorizationInfoFieldBuilder() { if (authorizationInfoBuilder_ == null) { authorizationInfoBuilder_ = - new com.google.protobuf.RepeatedFieldBuilderV3< + new com.google.protobuf.RepeatedFieldBuilder< com.google.cloud.audit.AuthorizationInfo, com.google.cloud.audit.AuthorizationInfo.Builder, com.google.cloud.audit.AuthorizationInfoOrBuilder>( authorizationInfo_, - ((bitField0_ & 0x00000001) != 0), + ((bitField0_ & 0x00000100) != 0), getParentForChildren(), isClean()); authorizationInfo_ = null; @@ -3274,11 +3431,12 @@ public com.google.cloud.audit.AuthorizationInfo.Builder addAuthorizationInfoBuil } private com.google.cloud.audit.PolicyViolationInfo policyViolationInfo_; - private com.google.protobuf.SingleFieldBuilderV3< + private com.google.protobuf.SingleFieldBuilder< com.google.cloud.audit.PolicyViolationInfo, com.google.cloud.audit.PolicyViolationInfo.Builder, com.google.cloud.audit.PolicyViolationInfoOrBuilder> policyViolationInfoBuilder_; + /** * * @@ -3293,8 +3451,9 @@ public com.google.cloud.audit.AuthorizationInfo.Builder addAuthorizationInfoBuil * @return Whether the policyViolationInfo field is set. */ public boolean hasPolicyViolationInfo() { - return policyViolationInfoBuilder_ != null || policyViolationInfo_ != null; + return ((bitField0_ & 0x00000200) != 0); } + /** * * @@ -3317,6 +3476,7 @@ public com.google.cloud.audit.PolicyViolationInfo getPolicyViolationInfo() { return policyViolationInfoBuilder_.getMessage(); } } + /** * * @@ -3334,13 +3494,14 @@ public Builder setPolicyViolationInfo(com.google.cloud.audit.PolicyViolationInfo throw new NullPointerException(); } policyViolationInfo_ = value; - onChanged(); } else { policyViolationInfoBuilder_.setMessage(value); } - + bitField0_ |= 0x00000200; + onChanged(); return this; } + /** * * @@ -3356,13 +3517,14 @@ public Builder setPolicyViolationInfo( com.google.cloud.audit.PolicyViolationInfo.Builder builderForValue) { if (policyViolationInfoBuilder_ == null) { policyViolationInfo_ = builderForValue.build(); - onChanged(); } else { policyViolationInfoBuilder_.setMessage(builderForValue.build()); } - + bitField0_ |= 0x00000200; + onChanged(); return this; } + /** * * @@ -3376,21 +3538,24 @@ public Builder setPolicyViolationInfo( */ public Builder mergePolicyViolationInfo(com.google.cloud.audit.PolicyViolationInfo value) { if (policyViolationInfoBuilder_ == null) { - if (policyViolationInfo_ != null) { - policyViolationInfo_ = - com.google.cloud.audit.PolicyViolationInfo.newBuilder(policyViolationInfo_) - .mergeFrom(value) - .buildPartial(); + if (((bitField0_ & 0x00000200) != 0) + && policyViolationInfo_ != null + && policyViolationInfo_ + != com.google.cloud.audit.PolicyViolationInfo.getDefaultInstance()) { + getPolicyViolationInfoBuilder().mergeFrom(value); } else { policyViolationInfo_ = value; } - onChanged(); } else { policyViolationInfoBuilder_.mergeFrom(value); } - + if (policyViolationInfo_ != null) { + bitField0_ |= 0x00000200; + onChanged(); + } return this; } + /** * * @@ -3403,16 +3568,16 @@ public Builder mergePolicyViolationInfo(com.google.cloud.audit.PolicyViolationIn * .google.cloud.audit.PolicyViolationInfo policy_violation_info = 25; */ public Builder clearPolicyViolationInfo() { - if (policyViolationInfoBuilder_ == null) { - policyViolationInfo_ = null; - onChanged(); - } else { - policyViolationInfo_ = null; + bitField0_ = (bitField0_ & ~0x00000200); + policyViolationInfo_ = null; + if (policyViolationInfoBuilder_ != null) { + policyViolationInfoBuilder_.dispose(); policyViolationInfoBuilder_ = null; } - + onChanged(); return this; } + /** * * @@ -3425,10 +3590,11 @@ public Builder clearPolicyViolationInfo() { * .google.cloud.audit.PolicyViolationInfo policy_violation_info = 25; */ public com.google.cloud.audit.PolicyViolationInfo.Builder getPolicyViolationInfoBuilder() { - + bitField0_ |= 0x00000200; onChanged(); - return getPolicyViolationInfoFieldBuilder().getBuilder(); + return internalGetPolicyViolationInfoFieldBuilder().getBuilder(); } + /** * * @@ -3449,6 +3615,7 @@ public com.google.cloud.audit.PolicyViolationInfoOrBuilder getPolicyViolationInf : policyViolationInfo_; } } + /** * * @@ -3460,14 +3627,14 @@ public com.google.cloud.audit.PolicyViolationInfoOrBuilder getPolicyViolationInf * * .google.cloud.audit.PolicyViolationInfo policy_violation_info = 25; */ - private com.google.protobuf.SingleFieldBuilderV3< + private com.google.protobuf.SingleFieldBuilder< com.google.cloud.audit.PolicyViolationInfo, com.google.cloud.audit.PolicyViolationInfo.Builder, com.google.cloud.audit.PolicyViolationInfoOrBuilder> - getPolicyViolationInfoFieldBuilder() { + internalGetPolicyViolationInfoFieldBuilder() { if (policyViolationInfoBuilder_ == null) { policyViolationInfoBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< + new com.google.protobuf.SingleFieldBuilder< com.google.cloud.audit.PolicyViolationInfo, com.google.cloud.audit.PolicyViolationInfo.Builder, com.google.cloud.audit.PolicyViolationInfoOrBuilder>( @@ -3478,11 +3645,12 @@ public com.google.cloud.audit.PolicyViolationInfoOrBuilder getPolicyViolationInf } private com.google.cloud.audit.RequestMetadata requestMetadata_; - private com.google.protobuf.SingleFieldBuilderV3< + private com.google.protobuf.SingleFieldBuilder< com.google.cloud.audit.RequestMetadata, com.google.cloud.audit.RequestMetadata.Builder, com.google.cloud.audit.RequestMetadataOrBuilder> requestMetadataBuilder_; + /** * * @@ -3495,8 +3663,9 @@ public com.google.cloud.audit.PolicyViolationInfoOrBuilder getPolicyViolationInf * @return Whether the requestMetadata field is set. */ public boolean hasRequestMetadata() { - return requestMetadataBuilder_ != null || requestMetadata_ != null; + return ((bitField0_ & 0x00000400) != 0); } + /** * * @@ -3517,6 +3686,7 @@ public com.google.cloud.audit.RequestMetadata getRequestMetadata() { return requestMetadataBuilder_.getMessage(); } } + /** * * @@ -3532,13 +3702,14 @@ public Builder setRequestMetadata(com.google.cloud.audit.RequestMetadata value) throw new NullPointerException(); } requestMetadata_ = value; - onChanged(); } else { requestMetadataBuilder_.setMessage(value); } - + bitField0_ |= 0x00000400; + onChanged(); return this; } + /** * * @@ -3552,13 +3723,14 @@ public Builder setRequestMetadata( com.google.cloud.audit.RequestMetadata.Builder builderForValue) { if (requestMetadataBuilder_ == null) { requestMetadata_ = builderForValue.build(); - onChanged(); } else { requestMetadataBuilder_.setMessage(builderForValue.build()); } - + bitField0_ |= 0x00000400; + onChanged(); return this; } + /** * * @@ -3570,21 +3742,23 @@ public Builder setRequestMetadata( */ public Builder mergeRequestMetadata(com.google.cloud.audit.RequestMetadata value) { if (requestMetadataBuilder_ == null) { - if (requestMetadata_ != null) { - requestMetadata_ = - com.google.cloud.audit.RequestMetadata.newBuilder(requestMetadata_) - .mergeFrom(value) - .buildPartial(); + if (((bitField0_ & 0x00000400) != 0) + && requestMetadata_ != null + && requestMetadata_ != com.google.cloud.audit.RequestMetadata.getDefaultInstance()) { + getRequestMetadataBuilder().mergeFrom(value); } else { requestMetadata_ = value; } - onChanged(); } else { requestMetadataBuilder_.mergeFrom(value); } - + if (requestMetadata_ != null) { + bitField0_ |= 0x00000400; + onChanged(); + } return this; } + /** * * @@ -3595,16 +3769,16 @@ public Builder mergeRequestMetadata(com.google.cloud.audit.RequestMetadata value * .google.cloud.audit.RequestMetadata request_metadata = 4; */ public Builder clearRequestMetadata() { - if (requestMetadataBuilder_ == null) { - requestMetadata_ = null; - onChanged(); - } else { - requestMetadata_ = null; + bitField0_ = (bitField0_ & ~0x00000400); + requestMetadata_ = null; + if (requestMetadataBuilder_ != null) { + requestMetadataBuilder_.dispose(); requestMetadataBuilder_ = null; } - + onChanged(); return this; } + /** * * @@ -3615,10 +3789,11 @@ public Builder clearRequestMetadata() { * .google.cloud.audit.RequestMetadata request_metadata = 4; */ public com.google.cloud.audit.RequestMetadata.Builder getRequestMetadataBuilder() { - + bitField0_ |= 0x00000400; onChanged(); - return getRequestMetadataFieldBuilder().getBuilder(); + return internalGetRequestMetadataFieldBuilder().getBuilder(); } + /** * * @@ -3637,6 +3812,7 @@ public com.google.cloud.audit.RequestMetadataOrBuilder getRequestMetadataOrBuild : requestMetadata_; } } + /** * * @@ -3646,14 +3822,14 @@ public com.google.cloud.audit.RequestMetadataOrBuilder getRequestMetadataOrBuild * * .google.cloud.audit.RequestMetadata request_metadata = 4; */ - private com.google.protobuf.SingleFieldBuilderV3< + private com.google.protobuf.SingleFieldBuilder< com.google.cloud.audit.RequestMetadata, com.google.cloud.audit.RequestMetadata.Builder, com.google.cloud.audit.RequestMetadataOrBuilder> - getRequestMetadataFieldBuilder() { + internalGetRequestMetadataFieldBuilder() { if (requestMetadataBuilder_ == null) { requestMetadataBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< + new com.google.protobuf.SingleFieldBuilder< com.google.cloud.audit.RequestMetadata, com.google.cloud.audit.RequestMetadata.Builder, com.google.cloud.audit.RequestMetadataOrBuilder>( @@ -3664,11 +3840,12 @@ public com.google.cloud.audit.RequestMetadataOrBuilder getRequestMetadataOrBuild } private com.google.protobuf.Struct request_; - private com.google.protobuf.SingleFieldBuilderV3< + private com.google.protobuf.SingleFieldBuilder< com.google.protobuf.Struct, com.google.protobuf.Struct.Builder, com.google.protobuf.StructOrBuilder> requestBuilder_; + /** * * @@ -3686,8 +3863,9 @@ public com.google.cloud.audit.RequestMetadataOrBuilder getRequestMetadataOrBuild * @return Whether the request field is set. */ public boolean hasRequest() { - return requestBuilder_ != null || request_ != null; + return ((bitField0_ & 0x00000800) != 0); } + /** * * @@ -3711,6 +3889,7 @@ public com.google.protobuf.Struct getRequest() { return requestBuilder_.getMessage(); } } + /** * * @@ -3731,13 +3910,14 @@ public Builder setRequest(com.google.protobuf.Struct value) { throw new NullPointerException(); } request_ = value; - onChanged(); } else { requestBuilder_.setMessage(value); } - + bitField0_ |= 0x00000800; + onChanged(); return this; } + /** * * @@ -3755,13 +3935,14 @@ public Builder setRequest(com.google.protobuf.Struct value) { public Builder setRequest(com.google.protobuf.Struct.Builder builderForValue) { if (requestBuilder_ == null) { request_ = builderForValue.build(); - onChanged(); } else { requestBuilder_.setMessage(builderForValue.build()); } - + bitField0_ |= 0x00000800; + onChanged(); return this; } + /** * * @@ -3778,19 +3959,23 @@ public Builder setRequest(com.google.protobuf.Struct.Builder builderForValue) { */ public Builder mergeRequest(com.google.protobuf.Struct value) { if (requestBuilder_ == null) { - if (request_ != null) { - request_ = - com.google.protobuf.Struct.newBuilder(request_).mergeFrom(value).buildPartial(); + if (((bitField0_ & 0x00000800) != 0) + && request_ != null + && request_ != com.google.protobuf.Struct.getDefaultInstance()) { + getRequestBuilder().mergeFrom(value); } else { request_ = value; } - onChanged(); } else { requestBuilder_.mergeFrom(value); } - + if (request_ != null) { + bitField0_ |= 0x00000800; + onChanged(); + } return this; } + /** * * @@ -3806,16 +3991,16 @@ public Builder mergeRequest(com.google.protobuf.Struct value) { * .google.protobuf.Struct request = 16; */ public Builder clearRequest() { - if (requestBuilder_ == null) { - request_ = null; - onChanged(); - } else { - request_ = null; + bitField0_ = (bitField0_ & ~0x00000800); + request_ = null; + if (requestBuilder_ != null) { + requestBuilder_.dispose(); requestBuilder_ = null; } - + onChanged(); return this; } + /** * * @@ -3831,10 +4016,11 @@ public Builder clearRequest() { * .google.protobuf.Struct request = 16; */ public com.google.protobuf.Struct.Builder getRequestBuilder() { - + bitField0_ |= 0x00000800; onChanged(); - return getRequestFieldBuilder().getBuilder(); + return internalGetRequestFieldBuilder().getBuilder(); } + /** * * @@ -3856,6 +4042,7 @@ public com.google.protobuf.StructOrBuilder getRequestOrBuilder() { return request_ == null ? com.google.protobuf.Struct.getDefaultInstance() : request_; } } + /** * * @@ -3870,14 +4057,14 @@ public com.google.protobuf.StructOrBuilder getRequestOrBuilder() { * * .google.protobuf.Struct request = 16; */ - private com.google.protobuf.SingleFieldBuilderV3< + private com.google.protobuf.SingleFieldBuilder< com.google.protobuf.Struct, com.google.protobuf.Struct.Builder, com.google.protobuf.StructOrBuilder> - getRequestFieldBuilder() { + internalGetRequestFieldBuilder() { if (requestBuilder_ == null) { requestBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< + new com.google.protobuf.SingleFieldBuilder< com.google.protobuf.Struct, com.google.protobuf.Struct.Builder, com.google.protobuf.StructOrBuilder>( @@ -3888,11 +4075,12 @@ public com.google.protobuf.StructOrBuilder getRequestOrBuilder() { } private com.google.protobuf.Struct response_; - private com.google.protobuf.SingleFieldBuilderV3< + private com.google.protobuf.SingleFieldBuilder< com.google.protobuf.Struct, com.google.protobuf.Struct.Builder, com.google.protobuf.StructOrBuilder> responseBuilder_; + /** * * @@ -3910,8 +4098,9 @@ public com.google.protobuf.StructOrBuilder getRequestOrBuilder() { * @return Whether the response field is set. */ public boolean hasResponse() { - return responseBuilder_ != null || response_ != null; + return ((bitField0_ & 0x00001000) != 0); } + /** * * @@ -3935,6 +4124,7 @@ public com.google.protobuf.Struct getResponse() { return responseBuilder_.getMessage(); } } + /** * * @@ -3955,13 +4145,14 @@ public Builder setResponse(com.google.protobuf.Struct value) { throw new NullPointerException(); } response_ = value; - onChanged(); } else { responseBuilder_.setMessage(value); } - + bitField0_ |= 0x00001000; + onChanged(); return this; } + /** * * @@ -3979,13 +4170,14 @@ public Builder setResponse(com.google.protobuf.Struct value) { public Builder setResponse(com.google.protobuf.Struct.Builder builderForValue) { if (responseBuilder_ == null) { response_ = builderForValue.build(); - onChanged(); } else { responseBuilder_.setMessage(builderForValue.build()); } - + bitField0_ |= 0x00001000; + onChanged(); return this; } + /** * * @@ -4002,19 +4194,23 @@ public Builder setResponse(com.google.protobuf.Struct.Builder builderForValue) { */ public Builder mergeResponse(com.google.protobuf.Struct value) { if (responseBuilder_ == null) { - if (response_ != null) { - response_ = - com.google.protobuf.Struct.newBuilder(response_).mergeFrom(value).buildPartial(); + if (((bitField0_ & 0x00001000) != 0) + && response_ != null + && response_ != com.google.protobuf.Struct.getDefaultInstance()) { + getResponseBuilder().mergeFrom(value); } else { response_ = value; } - onChanged(); } else { responseBuilder_.mergeFrom(value); } - + if (response_ != null) { + bitField0_ |= 0x00001000; + onChanged(); + } return this; } + /** * * @@ -4030,16 +4226,16 @@ public Builder mergeResponse(com.google.protobuf.Struct value) { * .google.protobuf.Struct response = 17; */ public Builder clearResponse() { - if (responseBuilder_ == null) { - response_ = null; - onChanged(); - } else { - response_ = null; + bitField0_ = (bitField0_ & ~0x00001000); + response_ = null; + if (responseBuilder_ != null) { + responseBuilder_.dispose(); responseBuilder_ = null; } - + onChanged(); return this; } + /** * * @@ -4055,10 +4251,11 @@ public Builder clearResponse() { * .google.protobuf.Struct response = 17; */ public com.google.protobuf.Struct.Builder getResponseBuilder() { - + bitField0_ |= 0x00001000; onChanged(); - return getResponseFieldBuilder().getBuilder(); + return internalGetResponseFieldBuilder().getBuilder(); } + /** * * @@ -4080,6 +4277,7 @@ public com.google.protobuf.StructOrBuilder getResponseOrBuilder() { return response_ == null ? com.google.protobuf.Struct.getDefaultInstance() : response_; } } + /** * * @@ -4094,14 +4292,14 @@ public com.google.protobuf.StructOrBuilder getResponseOrBuilder() { * * .google.protobuf.Struct response = 17; */ - private com.google.protobuf.SingleFieldBuilderV3< + private com.google.protobuf.SingleFieldBuilder< com.google.protobuf.Struct, com.google.protobuf.Struct.Builder, com.google.protobuf.StructOrBuilder> - getResponseFieldBuilder() { + internalGetResponseFieldBuilder() { if (responseBuilder_ == null) { responseBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< + new com.google.protobuf.SingleFieldBuilder< com.google.protobuf.Struct, com.google.protobuf.Struct.Builder, com.google.protobuf.StructOrBuilder>( @@ -4112,11 +4310,12 @@ public com.google.protobuf.StructOrBuilder getResponseOrBuilder() { } private com.google.protobuf.Struct metadata_; - private com.google.protobuf.SingleFieldBuilderV3< + private com.google.protobuf.SingleFieldBuilder< com.google.protobuf.Struct, com.google.protobuf.Struct.Builder, com.google.protobuf.StructOrBuilder> metadataBuilder_; + /** * * @@ -4130,8 +4329,9 @@ public com.google.protobuf.StructOrBuilder getResponseOrBuilder() { * @return Whether the metadata field is set. */ public boolean hasMetadata() { - return metadataBuilder_ != null || metadata_ != null; + return ((bitField0_ & 0x00002000) != 0); } + /** * * @@ -4151,6 +4351,7 @@ public com.google.protobuf.Struct getMetadata() { return metadataBuilder_.getMessage(); } } + /** * * @@ -4167,13 +4368,14 @@ public Builder setMetadata(com.google.protobuf.Struct value) { throw new NullPointerException(); } metadata_ = value; - onChanged(); } else { metadataBuilder_.setMessage(value); } - + bitField0_ |= 0x00002000; + onChanged(); return this; } + /** * * @@ -4187,13 +4389,14 @@ public Builder setMetadata(com.google.protobuf.Struct value) { public Builder setMetadata(com.google.protobuf.Struct.Builder builderForValue) { if (metadataBuilder_ == null) { metadata_ = builderForValue.build(); - onChanged(); } else { metadataBuilder_.setMessage(builderForValue.build()); } - + bitField0_ |= 0x00002000; + onChanged(); return this; } + /** * * @@ -4206,19 +4409,23 @@ public Builder setMetadata(com.google.protobuf.Struct.Builder builderForValue) { */ public Builder mergeMetadata(com.google.protobuf.Struct value) { if (metadataBuilder_ == null) { - if (metadata_ != null) { - metadata_ = - com.google.protobuf.Struct.newBuilder(metadata_).mergeFrom(value).buildPartial(); + if (((bitField0_ & 0x00002000) != 0) + && metadata_ != null + && metadata_ != com.google.protobuf.Struct.getDefaultInstance()) { + getMetadataBuilder().mergeFrom(value); } else { metadata_ = value; } - onChanged(); } else { metadataBuilder_.mergeFrom(value); } - + if (metadata_ != null) { + bitField0_ |= 0x00002000; + onChanged(); + } return this; } + /** * * @@ -4230,16 +4437,16 @@ public Builder mergeMetadata(com.google.protobuf.Struct value) { * .google.protobuf.Struct metadata = 18; */ public Builder clearMetadata() { - if (metadataBuilder_ == null) { - metadata_ = null; - onChanged(); - } else { - metadata_ = null; + bitField0_ = (bitField0_ & ~0x00002000); + metadata_ = null; + if (metadataBuilder_ != null) { + metadataBuilder_.dispose(); metadataBuilder_ = null; } - + onChanged(); return this; } + /** * * @@ -4251,10 +4458,11 @@ public Builder clearMetadata() { * .google.protobuf.Struct metadata = 18; */ public com.google.protobuf.Struct.Builder getMetadataBuilder() { - + bitField0_ |= 0x00002000; onChanged(); - return getMetadataFieldBuilder().getBuilder(); + return internalGetMetadataFieldBuilder().getBuilder(); } + /** * * @@ -4272,6 +4480,7 @@ public com.google.protobuf.StructOrBuilder getMetadataOrBuilder() { return metadata_ == null ? com.google.protobuf.Struct.getDefaultInstance() : metadata_; } } + /** * * @@ -4282,14 +4491,14 @@ public com.google.protobuf.StructOrBuilder getMetadataOrBuilder() { * * .google.protobuf.Struct metadata = 18; */ - private com.google.protobuf.SingleFieldBuilderV3< + private com.google.protobuf.SingleFieldBuilder< com.google.protobuf.Struct, com.google.protobuf.Struct.Builder, com.google.protobuf.StructOrBuilder> - getMetadataFieldBuilder() { + internalGetMetadataFieldBuilder() { if (metadataBuilder_ == null) { metadataBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< + new com.google.protobuf.SingleFieldBuilder< com.google.protobuf.Struct, com.google.protobuf.Struct.Builder, com.google.protobuf.StructOrBuilder>( @@ -4300,11 +4509,12 @@ public com.google.protobuf.StructOrBuilder getMetadataOrBuilder() { } private com.google.protobuf.Any serviceData_; - private com.google.protobuf.SingleFieldBuilderV3< + private com.google.protobuf.SingleFieldBuilder< com.google.protobuf.Any, com.google.protobuf.Any.Builder, com.google.protobuf.AnyOrBuilder> serviceDataBuilder_; + /** * * @@ -4322,8 +4532,9 @@ public com.google.protobuf.StructOrBuilder getMetadataOrBuilder() { */ @java.lang.Deprecated public boolean hasServiceData() { - return serviceDataBuilder_ != null || serviceData_ != null; + return ((bitField0_ & 0x00004000) != 0); } + /** * * @@ -4347,6 +4558,7 @@ public com.google.protobuf.Any getServiceData() { return serviceDataBuilder_.getMessage(); } } + /** * * @@ -4365,13 +4577,14 @@ public Builder setServiceData(com.google.protobuf.Any value) { throw new NullPointerException(); } serviceData_ = value; - onChanged(); } else { serviceDataBuilder_.setMessage(value); } - + bitField0_ |= 0x00004000; + onChanged(); return this; } + /** * * @@ -4387,13 +4600,14 @@ public Builder setServiceData(com.google.protobuf.Any value) { public Builder setServiceData(com.google.protobuf.Any.Builder builderForValue) { if (serviceDataBuilder_ == null) { serviceData_ = builderForValue.build(); - onChanged(); } else { serviceDataBuilder_.setMessage(builderForValue.build()); } - + bitField0_ |= 0x00004000; + onChanged(); return this; } + /** * * @@ -4408,19 +4622,23 @@ public Builder setServiceData(com.google.protobuf.Any.Builder builderForValue) { @java.lang.Deprecated public Builder mergeServiceData(com.google.protobuf.Any value) { if (serviceDataBuilder_ == null) { - if (serviceData_ != null) { - serviceData_ = - com.google.protobuf.Any.newBuilder(serviceData_).mergeFrom(value).buildPartial(); + if (((bitField0_ & 0x00004000) != 0) + && serviceData_ != null + && serviceData_ != com.google.protobuf.Any.getDefaultInstance()) { + getServiceDataBuilder().mergeFrom(value); } else { serviceData_ = value; } - onChanged(); } else { serviceDataBuilder_.mergeFrom(value); } - + if (serviceData_ != null) { + bitField0_ |= 0x00004000; + onChanged(); + } return this; } + /** * * @@ -4434,16 +4652,16 @@ public Builder mergeServiceData(com.google.protobuf.Any value) { */ @java.lang.Deprecated public Builder clearServiceData() { - if (serviceDataBuilder_ == null) { - serviceData_ = null; - onChanged(); - } else { - serviceData_ = null; + bitField0_ = (bitField0_ & ~0x00004000); + serviceData_ = null; + if (serviceDataBuilder_ != null) { + serviceDataBuilder_.dispose(); serviceDataBuilder_ = null; } - + onChanged(); return this; } + /** * * @@ -4457,10 +4675,11 @@ public Builder clearServiceData() { */ @java.lang.Deprecated public com.google.protobuf.Any.Builder getServiceDataBuilder() { - + bitField0_ |= 0x00004000; onChanged(); - return getServiceDataFieldBuilder().getBuilder(); + return internalGetServiceDataFieldBuilder().getBuilder(); } + /** * * @@ -4480,6 +4699,7 @@ public com.google.protobuf.AnyOrBuilder getServiceDataOrBuilder() { return serviceData_ == null ? com.google.protobuf.Any.getDefaultInstance() : serviceData_; } } + /** * * @@ -4491,14 +4711,14 @@ public com.google.protobuf.AnyOrBuilder getServiceDataOrBuilder() { * * .google.protobuf.Any service_data = 15 [deprecated = true]; */ - private com.google.protobuf.SingleFieldBuilderV3< + private com.google.protobuf.SingleFieldBuilder< com.google.protobuf.Any, com.google.protobuf.Any.Builder, com.google.protobuf.AnyOrBuilder> - getServiceDataFieldBuilder() { + internalGetServiceDataFieldBuilder() { if (serviceDataBuilder_ == null) { serviceDataBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< + new com.google.protobuf.SingleFieldBuilder< com.google.protobuf.Any, com.google.protobuf.Any.Builder, com.google.protobuf.AnyOrBuilder>( @@ -4508,17 +4728,6 @@ public com.google.protobuf.AnyOrBuilder getServiceDataOrBuilder() { return serviceDataBuilder_; } - @java.lang.Override - public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - // @@protoc_insertion_point(builder_scope:google.cloud.audit.AuditLog) } diff --git a/java-common-protos/proto-google-common-protos/src/main/java/com/google/cloud/audit/AuditLogOrBuilder.java b/java-common-protos/proto-google-common-protos/src/main/java/com/google/cloud/audit/AuditLogOrBuilder.java index 6577487192..c82ba59a27 100644 --- a/java-common-protos/proto-google-common-protos/src/main/java/com/google/cloud/audit/AuditLogOrBuilder.java +++ b/java-common-protos/proto-google-common-protos/src/main/java/com/google/cloud/audit/AuditLogOrBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,10 +14,13 @@ * limitations under the License. */ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: google/cloud/audit/audit_log.proto +// Protobuf Java Version: 4.33.2 package com.google.cloud.audit; +@com.google.protobuf.Generated public interface AuditLogOrBuilder extends // @@protoc_insertion_point(interface_extends:google.cloud.audit.AuditLog) @@ -36,6 +39,7 @@ public interface AuditLogOrBuilder * @return The serviceName. */ java.lang.String getServiceName(); + /** * * @@ -57,8 +61,9 @@ public interface AuditLogOrBuilder * The name of the service method or operation. * For API calls, this should be the name of the API method. * For example, - * "google.cloud.bigquery.v2.TableService.InsertTable" - * "google.logging.v2.ConfigServiceV2.CreateSink" + * + * "google.cloud.bigquery.v2.TableService.InsertTable" + * "google.logging.v2.ConfigServiceV2.CreateSink" * * * string method_name = 8; @@ -66,6 +71,7 @@ public interface AuditLogOrBuilder * @return The methodName. */ java.lang.String getMethodName(); + /** * * @@ -73,8 +79,9 @@ public interface AuditLogOrBuilder * The name of the service method or operation. * For API calls, this should be the name of the API method. * For example, - * "google.cloud.bigquery.v2.TableService.InsertTable" - * "google.logging.v2.ConfigServiceV2.CreateSink" + * + * "google.cloud.bigquery.v2.TableService.InsertTable" + * "google.logging.v2.ConfigServiceV2.CreateSink" * * * string method_name = 8; @@ -90,8 +97,9 @@ public interface AuditLogOrBuilder * The resource or collection that is the target of the operation. * The name is a scheme-less URI, not including the API service name. * For example: - * "projects/PROJECT_ID/zones/us-central1-a/instances" - * "projects/PROJECT_ID/datasets/DATASET_ID" + * + * "projects/PROJECT_ID/zones/us-central1-a/instances" + * "projects/PROJECT_ID/datasets/DATASET_ID" * * * string resource_name = 11; @@ -99,6 +107,7 @@ public interface AuditLogOrBuilder * @return The resourceName. */ java.lang.String getResourceName(); + /** * * @@ -106,8 +115,9 @@ public interface AuditLogOrBuilder * The resource or collection that is the target of the operation. * The name is a scheme-less URI, not including the API service name. * For example: - * "projects/PROJECT_ID/zones/us-central1-a/instances" - * "projects/PROJECT_ID/datasets/DATASET_ID" + * + * "projects/PROJECT_ID/zones/us-central1-a/instances" + * "projects/PROJECT_ID/datasets/DATASET_ID" * * * string resource_name = 11; @@ -128,6 +138,7 @@ public interface AuditLogOrBuilder * @return Whether the resourceLocation field is set. */ boolean hasResourceLocation(); + /** * * @@ -140,6 +151,7 @@ public interface AuditLogOrBuilder * @return The resourceLocation. */ com.google.cloud.audit.ResourceLocation getResourceLocation(); + /** * * @@ -169,6 +181,7 @@ public interface AuditLogOrBuilder * @return Whether the resourceOriginalState field is set. */ boolean hasResourceOriginalState(); + /** * * @@ -187,6 +200,7 @@ public interface AuditLogOrBuilder * @return The resourceOriginalState. */ com.google.protobuf.Struct getResourceOriginalState(); + /** * * @@ -230,6 +244,7 @@ public interface AuditLogOrBuilder * @return Whether the status field is set. */ boolean hasStatus(); + /** * * @@ -242,6 +257,7 @@ public interface AuditLogOrBuilder * @return The status. */ com.google.rpc.Status getStatus(); + /** * * @@ -265,6 +281,7 @@ public interface AuditLogOrBuilder * @return Whether the authenticationInfo field is set. */ boolean hasAuthenticationInfo(); + /** * * @@ -277,6 +294,7 @@ public interface AuditLogOrBuilder * @return The authenticationInfo. */ com.google.cloud.audit.AuthenticationInfo getAuthenticationInfo(); + /** * * @@ -300,6 +318,7 @@ public interface AuditLogOrBuilder * repeated .google.cloud.audit.AuthorizationInfo authorization_info = 9; */ java.util.List getAuthorizationInfoList(); + /** * * @@ -312,6 +331,7 @@ public interface AuditLogOrBuilder * repeated .google.cloud.audit.AuthorizationInfo authorization_info = 9; */ com.google.cloud.audit.AuthorizationInfo getAuthorizationInfo(int index); + /** * * @@ -324,6 +344,7 @@ public interface AuditLogOrBuilder * repeated .google.cloud.audit.AuthorizationInfo authorization_info = 9; */ int getAuthorizationInfoCount(); + /** * * @@ -337,6 +358,7 @@ public interface AuditLogOrBuilder */ java.util.List getAuthorizationInfoOrBuilderList(); + /** * * @@ -364,6 +386,7 @@ public interface AuditLogOrBuilder * @return Whether the policyViolationInfo field is set. */ boolean hasPolicyViolationInfo(); + /** * * @@ -378,6 +401,7 @@ public interface AuditLogOrBuilder * @return The policyViolationInfo. */ com.google.cloud.audit.PolicyViolationInfo getPolicyViolationInfo(); + /** * * @@ -403,6 +427,7 @@ public interface AuditLogOrBuilder * @return Whether the requestMetadata field is set. */ boolean hasRequestMetadata(); + /** * * @@ -415,6 +440,7 @@ public interface AuditLogOrBuilder * @return The requestMetadata. */ com.google.cloud.audit.RequestMetadata getRequestMetadata(); + /** * * @@ -443,6 +469,7 @@ public interface AuditLogOrBuilder * @return Whether the request field is set. */ boolean hasRequest(); + /** * * @@ -460,6 +487,7 @@ public interface AuditLogOrBuilder * @return The request. */ com.google.protobuf.Struct getRequest(); + /** * * @@ -493,6 +521,7 @@ public interface AuditLogOrBuilder * @return Whether the response field is set. */ boolean hasResponse(); + /** * * @@ -510,6 +539,7 @@ public interface AuditLogOrBuilder * @return The response. */ com.google.protobuf.Struct getResponse(); + /** * * @@ -539,6 +569,7 @@ public interface AuditLogOrBuilder * @return Whether the metadata field is set. */ boolean hasMetadata(); + /** * * @@ -552,6 +583,7 @@ public interface AuditLogOrBuilder * @return The metadata. */ com.google.protobuf.Struct getMetadata(); + /** * * @@ -581,6 +613,7 @@ public interface AuditLogOrBuilder */ @java.lang.Deprecated boolean hasServiceData(); + /** * * @@ -598,6 +631,7 @@ public interface AuditLogOrBuilder */ @java.lang.Deprecated com.google.protobuf.Any getServiceData(); + /** * * diff --git a/java-common-protos/proto-google-common-protos/src/main/java/com/google/cloud/audit/AuditLogProto.java b/java-common-protos/proto-google-common-protos/src/main/java/com/google/cloud/audit/AuditLogProto.java index 2269b3f77e..258c2d4ab4 100644 --- a/java-common-protos/proto-google-common-protos/src/main/java/com/google/cloud/audit/AuditLogProto.java +++ b/java-common-protos/proto-google-common-protos/src/main/java/com/google/cloud/audit/AuditLogProto.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,13 +14,26 @@ * limitations under the License. */ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: google/cloud/audit/audit_log.proto +// Protobuf Java Version: 4.33.2 package com.google.cloud.audit; -public final class AuditLogProto { +@com.google.protobuf.Generated +public final class AuditLogProto extends com.google.protobuf.GeneratedFile { private AuditLogProto() {} + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "AuditLogProto"); + } + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistryLite registry) {} public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry registry) { @@ -29,51 +42,51 @@ public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry r static final com.google.protobuf.Descriptors.Descriptor internal_static_google_cloud_audit_AuditLog_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable internal_static_google_cloud_audit_AuditLog_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_google_cloud_audit_AuthenticationInfo_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable internal_static_google_cloud_audit_AuthenticationInfo_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_google_cloud_audit_AuthorizationInfo_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable internal_static_google_cloud_audit_AuthorizationInfo_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_google_cloud_audit_RequestMetadata_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable internal_static_google_cloud_audit_RequestMetadata_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_google_cloud_audit_ResourceLocation_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable internal_static_google_cloud_audit_ResourceLocation_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_google_cloud_audit_ServiceAccountDelegationInfo_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable internal_static_google_cloud_audit_ServiceAccountDelegationInfo_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_google_cloud_audit_ServiceAccountDelegationInfo_FirstPartyPrincipal_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable internal_static_google_cloud_audit_ServiceAccountDelegationInfo_FirstPartyPrincipal_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_google_cloud_audit_ServiceAccountDelegationInfo_ThirdPartyPrincipal_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable internal_static_google_cloud_audit_ServiceAccountDelegationInfo_ThirdPartyPrincipal_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_google_cloud_audit_PolicyViolationInfo_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable internal_static_google_cloud_audit_PolicyViolationInfo_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_google_cloud_audit_OrgPolicyViolationInfo_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable internal_static_google_cloud_audit_OrgPolicyViolationInfo_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_google_cloud_audit_OrgPolicyViolationInfo_ResourceTagsEntry_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable internal_static_google_cloud_audit_OrgPolicyViolationInfo_ResourceTagsEntry_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_google_cloud_audit_ViolationInfo_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable internal_static_google_cloud_audit_ViolationInfo_fieldAccessorTable; public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { @@ -114,50 +127,55 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + "key_name\030\005 \001(\t\022Y\n\037service_account_delega" + "tion_info\030\006 \003(\01320.google.cloud.audit.Ser" + "viceAccountDelegationInfo\022\031\n\021principal_s" - + "ubject\030\010 \001(\t\"\226\001\n\021AuthorizationInfo\022\020\n\010re" + + "ubject\030\010 \001(\t\"\330\002\n\021AuthorizationInfo\022\020\n\010re" + "source\030\001 \001(\t\022\022\n\npermission\030\002 \001(\t\022\017\n\007gran" + "ted\030\003 \001(\010\022J\n\023resource_attributes\030\005 \001(\0132-" + ".google.rpc.context.AttributeContext.Res" - + "ource\"\365\001\n\017RequestMetadata\022\021\n\tcaller_ip\030\001" - + " \001(\t\022\"\n\032caller_supplied_user_agent\030\002 \001(\t" - + "\022\026\n\016caller_network\030\003 \001(\t\022H\n\022request_attr" - + "ibutes\030\007 \001(\0132,.google.rpc.context.Attrib" - + "uteContext.Request\022I\n\026destination_attrib" - + "utes\030\010 \001(\0132).google.rpc.context.Attribut" - + "eContext.Peer\"I\n\020ResourceLocation\022\031\n\021cur" - + "rent_locations\030\001 \003(\t\022\032\n\022original_locatio" - + "ns\030\002 \003(\t\"\303\003\n\034ServiceAccountDelegationInf" - + "o\022\031\n\021principal_subject\030\003 \001(\t\022e\n\025first_pa" - + "rty_principal\030\001 \001(\0132D.google.cloud.audit" - + ".ServiceAccountDelegationInfo.FirstParty" - + "PrincipalH\000\022e\n\025third_party_principal\030\002 \001" - + "(\0132D.google.cloud.audit.ServiceAccountDe" - + "legationInfo.ThirdPartyPrincipalH\000\032a\n\023Fi" - + "rstPartyPrincipal\022\027\n\017principal_email\030\001 \001" - + "(\t\0221\n\020service_metadata\030\002 \001(\0132\027.google.pr" - + "otobuf.Struct\032J\n\023ThirdPartyPrincipal\0223\n\022" - + "third_party_claims\030\001 \001(\0132\027.google.protob" - + "uf.StructB\013\n\tAuthority\"d\n\023PolicyViolatio" - + "nInfo\022M\n\031org_policy_violation_info\030\001 \001(\013" - + "2*.google.cloud.audit.OrgPolicyViolation" - + "Info\"\262\002\n\026OrgPolicyViolationInfo\022-\n\007paylo" - + "ad\030\001 \001(\0132\027.google.protobuf.StructB\003\340A\001\022\032" - + "\n\rresource_type\030\002 \001(\tB\003\340A\001\022X\n\rresource_t" - + "ags\030\003 \003(\0132<.google.cloud.audit.OrgPolicy" - + "ViolationInfo.ResourceTagsEntryB\003\340A\001\022>\n\016" - + "violation_info\030\004 \003(\0132!.google.cloud.audi" - + "t.ViolationInfoB\003\340A\001\0323\n\021ResourceTagsEntr" - + "y\022\013\n\003key\030\001 \001(\t\022\r\n\005value\030\002 \001(\t:\0028\001\"\227\002\n\rVi" - + "olationInfo\022\027\n\nconstraint\030\001 \001(\tB\003\340A\001\022\032\n\r" - + "error_message\030\002 \001(\tB\003\340A\001\022\032\n\rchecked_valu" - + "e\030\003 \001(\tB\003\340A\001\022F\n\013policy_type\030\004 \001(\0162,.goog" - + "le.cloud.audit.ViolationInfo.PolicyTypeB" - + "\003\340A\001\"m\n\nPolicyType\022\033\n\027POLICY_TYPE_UNSPEC" - + "IFIED\020\000\022\026\n\022BOOLEAN_CONSTRAINT\020\001\022\023\n\017LIST_" - + "CONSTRAINT\020\002\022\025\n\021CUSTOM_CONSTRAINT\020\003Be\n\026c" - + "om.google.cloud.auditB\rAuditLogProtoP\001Z7" - + "google.golang.org/genproto/googleapis/cl" - + "oud/audit;audit\370\001\001b\006proto3" + + "ource\022M\n\017permission_type\030\007 \001(\01624.google." + + "cloud.audit.AuthorizationInfo.Permission" + + "Type\"q\n\016PermissionType\022\037\n\033PERMISSION_TYP" + + "E_UNSPECIFIED\020\000\022\016\n\nADMIN_READ\020\001\022\017\n\013ADMIN" + + "_WRITE\020\002\022\r\n\tDATA_READ\020\003\022\016\n\nDATA_WRITE\020\004\"" + + "\365\001\n\017RequestMetadata\022\021\n\tcaller_ip\030\001 \001(\t\022\"" + + "\n\032caller_supplied_user_agent\030\002 \001(\t\022\026\n\016ca" + + "ller_network\030\003 \001(\t\022H\n\022request_attributes" + + "\030\007 \001(\0132,.google.rpc.context.AttributeCon" + + "text.Request\022I\n\026destination_attributes\030\010" + + " \001(\0132).google.rpc.context.AttributeConte" + + "xt.Peer\"I\n\020ResourceLocation\022\031\n\021current_l" + + "ocations\030\001 \003(\t\022\032\n\022original_locations\030\002 \003" + + "(\t\"\303\003\n\034ServiceAccountDelegationInfo\022\031\n\021p" + + "rincipal_subject\030\003 \001(\t\022e\n\025first_party_pr" + + "incipal\030\001 \001(\0132D.google.cloud.audit.Servi" + + "ceAccountDelegationInfo.FirstPartyPrinci" + + "palH\000\022e\n\025third_party_principal\030\002 \001(\0132D.g" + + "oogle.cloud.audit.ServiceAccountDelegati" + + "onInfo.ThirdPartyPrincipalH\000\032a\n\023FirstPar" + + "tyPrincipal\022\027\n\017principal_email\030\001 \001(\t\0221\n\020" + + "service_metadata\030\002 \001(\0132\027.google.protobuf" + + ".Struct\032J\n\023ThirdPartyPrincipal\0223\n\022third_" + + "party_claims\030\001 \001(\0132\027.google.protobuf.Str" + + "uctB\013\n\tAuthority\"d\n\023PolicyViolationInfo\022" + + "M\n\031org_policy_violation_info\030\001 \001(\0132*.goo" + + "gle.cloud.audit.OrgPolicyViolationInfo\"\262" + + "\002\n\026OrgPolicyViolationInfo\022-\n\007payload\030\001 \001" + + "(\0132\027.google.protobuf.StructB\003\340A\001\022\032\n\rreso" + + "urce_type\030\002 \001(\tB\003\340A\001\022X\n\rresource_tags\030\003 " + + "\003(\0132<.google.cloud.audit.OrgPolicyViolat" + + "ionInfo.ResourceTagsEntryB\003\340A\001\022>\n\016violat" + + "ion_info\030\004 \003(\0132!.google.cloud.audit.Viol" + + "ationInfoB\003\340A\001\0323\n\021ResourceTagsEntry\022\013\n\003k" + + "ey\030\001 \001(\t\022\r\n\005value\030\002 \001(\t:\0028\001\"\227\002\n\rViolatio" + + "nInfo\022\027\n\nconstraint\030\001 \001(\tB\003\340A\001\022\032\n\rerror_" + + "message\030\002 \001(\tB\003\340A\001\022\032\n\rchecked_value\030\003 \001(" + + "\tB\003\340A\001\022F\n\013policy_type\030\004 \001(\0162,.google.clo" + + "ud.audit.ViolationInfo.PolicyTypeB\003\340A\001\"m" + + "\n\nPolicyType\022\033\n\027POLICY_TYPE_UNSPECIFIED\020" + + "\000\022\026\n\022BOOLEAN_CONSTRAINT\020\001\022\023\n\017LIST_CONSTR" + + "AINT\020\002\022\025\n\021CUSTOM_CONSTRAINT\020\003Be\n\026com.goo" + + "gle.cloud.auditB\rAuditLogProtoP\001Z7google" + + ".golang.org/genproto/googleapis/cloud/au" + + "dit;audit\370\001\001b\006proto3" }; descriptor = com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( @@ -169,10 +187,9 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { com.google.rpc.context.AttributeContextProto.getDescriptor(), com.google.rpc.StatusProto.getDescriptor(), }); - internal_static_google_cloud_audit_AuditLog_descriptor = - getDescriptor().getMessageTypes().get(0); + internal_static_google_cloud_audit_AuditLog_descriptor = getDescriptor().getMessageType(0); internal_static_google_cloud_audit_AuditLog_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_google_cloud_audit_AuditLog_descriptor, new java.lang.String[] { "ServiceName", @@ -192,9 +209,9 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "ServiceData", }); internal_static_google_cloud_audit_AuthenticationInfo_descriptor = - getDescriptor().getMessageTypes().get(1); + getDescriptor().getMessageType(1); internal_static_google_cloud_audit_AuthenticationInfo_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_google_cloud_audit_AuthenticationInfo_descriptor, new java.lang.String[] { "PrincipalEmail", @@ -205,17 +222,17 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "PrincipalSubject", }); internal_static_google_cloud_audit_AuthorizationInfo_descriptor = - getDescriptor().getMessageTypes().get(2); + getDescriptor().getMessageType(2); internal_static_google_cloud_audit_AuthorizationInfo_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_google_cloud_audit_AuthorizationInfo_descriptor, new java.lang.String[] { - "Resource", "Permission", "Granted", "ResourceAttributes", + "Resource", "Permission", "Granted", "ResourceAttributes", "PermissionType", }); internal_static_google_cloud_audit_RequestMetadata_descriptor = - getDescriptor().getMessageTypes().get(3); + getDescriptor().getMessageType(3); internal_static_google_cloud_audit_RequestMetadata_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_google_cloud_audit_RequestMetadata_descriptor, new java.lang.String[] { "CallerIp", @@ -225,85 +242,79 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "DestinationAttributes", }); internal_static_google_cloud_audit_ResourceLocation_descriptor = - getDescriptor().getMessageTypes().get(4); + getDescriptor().getMessageType(4); internal_static_google_cloud_audit_ResourceLocation_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_google_cloud_audit_ResourceLocation_descriptor, new java.lang.String[] { "CurrentLocations", "OriginalLocations", }); internal_static_google_cloud_audit_ServiceAccountDelegationInfo_descriptor = - getDescriptor().getMessageTypes().get(5); + getDescriptor().getMessageType(5); internal_static_google_cloud_audit_ServiceAccountDelegationInfo_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_google_cloud_audit_ServiceAccountDelegationInfo_descriptor, new java.lang.String[] { "PrincipalSubject", "FirstPartyPrincipal", "ThirdPartyPrincipal", "Authority", }); internal_static_google_cloud_audit_ServiceAccountDelegationInfo_FirstPartyPrincipal_descriptor = - internal_static_google_cloud_audit_ServiceAccountDelegationInfo_descriptor - .getNestedTypes() - .get(0); + internal_static_google_cloud_audit_ServiceAccountDelegationInfo_descriptor.getNestedType(0); internal_static_google_cloud_audit_ServiceAccountDelegationInfo_FirstPartyPrincipal_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_google_cloud_audit_ServiceAccountDelegationInfo_FirstPartyPrincipal_descriptor, new java.lang.String[] { "PrincipalEmail", "ServiceMetadata", }); internal_static_google_cloud_audit_ServiceAccountDelegationInfo_ThirdPartyPrincipal_descriptor = - internal_static_google_cloud_audit_ServiceAccountDelegationInfo_descriptor - .getNestedTypes() - .get(1); + internal_static_google_cloud_audit_ServiceAccountDelegationInfo_descriptor.getNestedType(1); internal_static_google_cloud_audit_ServiceAccountDelegationInfo_ThirdPartyPrincipal_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_google_cloud_audit_ServiceAccountDelegationInfo_ThirdPartyPrincipal_descriptor, new java.lang.String[] { "ThirdPartyClaims", }); internal_static_google_cloud_audit_PolicyViolationInfo_descriptor = - getDescriptor().getMessageTypes().get(6); + getDescriptor().getMessageType(6); internal_static_google_cloud_audit_PolicyViolationInfo_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_google_cloud_audit_PolicyViolationInfo_descriptor, new java.lang.String[] { "OrgPolicyViolationInfo", }); internal_static_google_cloud_audit_OrgPolicyViolationInfo_descriptor = - getDescriptor().getMessageTypes().get(7); + getDescriptor().getMessageType(7); internal_static_google_cloud_audit_OrgPolicyViolationInfo_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_google_cloud_audit_OrgPolicyViolationInfo_descriptor, new java.lang.String[] { "Payload", "ResourceType", "ResourceTags", "ViolationInfo", }); internal_static_google_cloud_audit_OrgPolicyViolationInfo_ResourceTagsEntry_descriptor = - internal_static_google_cloud_audit_OrgPolicyViolationInfo_descriptor - .getNestedTypes() - .get(0); + internal_static_google_cloud_audit_OrgPolicyViolationInfo_descriptor.getNestedType(0); internal_static_google_cloud_audit_OrgPolicyViolationInfo_ResourceTagsEntry_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_google_cloud_audit_OrgPolicyViolationInfo_ResourceTagsEntry_descriptor, new java.lang.String[] { "Key", "Value", }); - internal_static_google_cloud_audit_ViolationInfo_descriptor = - getDescriptor().getMessageTypes().get(8); + internal_static_google_cloud_audit_ViolationInfo_descriptor = getDescriptor().getMessageType(8); internal_static_google_cloud_audit_ViolationInfo_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_google_cloud_audit_ViolationInfo_descriptor, new java.lang.String[] { "Constraint", "ErrorMessage", "CheckedValue", "PolicyType", }); - com.google.protobuf.ExtensionRegistry registry = - com.google.protobuf.ExtensionRegistry.newInstance(); - registry.add(com.google.api.FieldBehaviorProto.fieldBehavior); - com.google.protobuf.Descriptors.FileDescriptor.internalUpdateFileDescriptor( - descriptor, registry); + descriptor.resolveAllFeaturesImmutable(); com.google.api.FieldBehaviorProto.getDescriptor(); com.google.protobuf.AnyProto.getDescriptor(); com.google.protobuf.StructProto.getDescriptor(); com.google.rpc.context.AttributeContextProto.getDescriptor(); com.google.rpc.StatusProto.getDescriptor(); + com.google.protobuf.ExtensionRegistry registry = + com.google.protobuf.ExtensionRegistry.newInstance(); + registry.add(com.google.api.FieldBehaviorProto.fieldBehavior); + com.google.protobuf.Descriptors.FileDescriptor.internalUpdateFileDescriptor( + descriptor, registry); } // @@protoc_insertion_point(outer_class_scope) diff --git a/java-common-protos/proto-google-common-protos/src/main/java/com/google/cloud/audit/AuthenticationInfo.java b/java-common-protos/proto-google-common-protos/src/main/java/com/google/cloud/audit/AuthenticationInfo.java index d3c4627e8b..ed51d503a7 100644 --- a/java-common-protos/proto-google-common-protos/src/main/java/com/google/cloud/audit/AuthenticationInfo.java +++ b/java-common-protos/proto-google-common-protos/src/main/java/com/google/cloud/audit/AuthenticationInfo.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,9 @@ * limitations under the License. */ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: google/cloud/audit/audit_log.proto +// Protobuf Java Version: 4.33.2 package com.google.cloud.audit; @@ -27,13 +29,25 @@ * * Protobuf type {@code google.cloud.audit.AuthenticationInfo} */ -public final class AuthenticationInfo extends com.google.protobuf.GeneratedMessageV3 +@com.google.protobuf.Generated +public final class AuthenticationInfo extends com.google.protobuf.GeneratedMessage implements // @@protoc_insertion_point(message_implements:google.cloud.audit.AuthenticationInfo) AuthenticationInfoOrBuilder { private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "AuthenticationInfo"); + } + // Use AuthenticationInfo.newBuilder() to construct. - private AuthenticationInfo(com.google.protobuf.GeneratedMessageV3.Builder builder) { + private AuthenticationInfo(com.google.protobuf.GeneratedMessage.Builder builder) { super(builder); } @@ -45,24 +59,13 @@ private AuthenticationInfo() { principalSubject_ = ""; } - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new AuthenticationInfo(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.cloud.audit.AuditLogProto .internal_static_google_cloud_audit_AuthenticationInfo_descriptor; } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.cloud.audit.AuditLogProto .internal_static_google_cloud_audit_AuthenticationInfo_fieldAccessorTable @@ -71,8 +74,12 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { com.google.cloud.audit.AuthenticationInfo.Builder.class); } + private int bitField0_; public static final int PRINCIPAL_EMAIL_FIELD_NUMBER = 1; - private volatile java.lang.Object principalEmail_; + + @SuppressWarnings("serial") + private volatile java.lang.Object principalEmail_ = ""; + /** * * @@ -101,6 +108,7 @@ public java.lang.String getPrincipalEmail() { return s; } } + /** * * @@ -131,7 +139,10 @@ public com.google.protobuf.ByteString getPrincipalEmailBytes() { } public static final int AUTHORITY_SELECTOR_FIELD_NUMBER = 2; - private volatile java.lang.Object authoritySelector_; + + @SuppressWarnings("serial") + private volatile java.lang.Object authoritySelector_ = ""; + /** * * @@ -156,6 +167,7 @@ public java.lang.String getAuthoritySelector() { return s; } } + /** * * @@ -183,6 +195,7 @@ public com.google.protobuf.ByteString getAuthoritySelectorBytes() { public static final int THIRD_PARTY_PRINCIPAL_FIELD_NUMBER = 4; private com.google.protobuf.Struct thirdPartyPrincipal_; + /** * * @@ -199,8 +212,9 @@ public com.google.protobuf.ByteString getAuthoritySelectorBytes() { */ @java.lang.Override public boolean hasThirdPartyPrincipal() { - return thirdPartyPrincipal_ != null; + return ((bitField0_ & 0x00000001) != 0); } + /** * * @@ -221,6 +235,7 @@ public com.google.protobuf.Struct getThirdPartyPrincipal() { ? com.google.protobuf.Struct.getDefaultInstance() : thirdPartyPrincipal_; } + /** * * @@ -235,11 +250,16 @@ public com.google.protobuf.Struct getThirdPartyPrincipal() { */ @java.lang.Override public com.google.protobuf.StructOrBuilder getThirdPartyPrincipalOrBuilder() { - return getThirdPartyPrincipal(); + return thirdPartyPrincipal_ == null + ? com.google.protobuf.Struct.getDefaultInstance() + : thirdPartyPrincipal_; } public static final int SERVICE_ACCOUNT_KEY_NAME_FIELD_NUMBER = 5; - private volatile java.lang.Object serviceAccountKeyName_; + + @SuppressWarnings("serial") + private volatile java.lang.Object serviceAccountKeyName_ = ""; + /** * * @@ -247,6 +267,7 @@ public com.google.protobuf.StructOrBuilder getThirdPartyPrincipalOrBuilder() { * The name of the service account key used to create or exchange * credentials for authenticating the service account making the request. * This is a scheme-less URI full resource name. For example: + * * "//iam.googleapis.com/projects/{PROJECT_ID}/serviceAccounts/{ACCOUNT}/keys/{key}" * * @@ -266,6 +287,7 @@ public java.lang.String getServiceAccountKeyName() { return s; } } + /** * * @@ -273,6 +295,7 @@ public java.lang.String getServiceAccountKeyName() { * The name of the service account key used to create or exchange * credentials for authenticating the service account making the request. * This is a scheme-less URI full resource name. For example: + * * "//iam.googleapis.com/projects/{PROJECT_ID}/serviceAccounts/{ACCOUNT}/keys/{key}" * * @@ -294,8 +317,11 @@ public com.google.protobuf.ByteString getServiceAccountKeyNameBytes() { } public static final int SERVICE_ACCOUNT_DELEGATION_INFO_FIELD_NUMBER = 6; + + @SuppressWarnings("serial") private java.util.List serviceAccountDelegationInfo_; + /** * * @@ -316,6 +342,7 @@ public com.google.protobuf.ByteString getServiceAccountKeyNameBytes() { getServiceAccountDelegationInfoList() { return serviceAccountDelegationInfo_; } + /** * * @@ -336,6 +363,7 @@ public com.google.protobuf.ByteString getServiceAccountKeyNameBytes() { getServiceAccountDelegationInfoOrBuilderList() { return serviceAccountDelegationInfo_; } + /** * * @@ -355,6 +383,7 @@ public com.google.protobuf.ByteString getServiceAccountKeyNameBytes() { public int getServiceAccountDelegationInfoCount() { return serviceAccountDelegationInfo_.size(); } + /** * * @@ -375,6 +404,7 @@ public com.google.cloud.audit.ServiceAccountDelegationInfo getServiceAccountDele int index) { return serviceAccountDelegationInfo_.get(index); } + /** * * @@ -397,7 +427,10 @@ public com.google.cloud.audit.ServiceAccountDelegationInfo getServiceAccountDele } public static final int PRINCIPAL_SUBJECT_FIELD_NUMBER = 8; - private volatile java.lang.Object principalSubject_; + + @SuppressWarnings("serial") + private volatile java.lang.Object principalSubject_ = ""; + /** * * @@ -422,6 +455,7 @@ public java.lang.String getPrincipalSubject() { return s; } } + /** * * @@ -461,23 +495,23 @@ public final boolean isInitialized() { @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(principalEmail_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, principalEmail_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(principalEmail_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, principalEmail_); } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(authoritySelector_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 2, authoritySelector_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(authoritySelector_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, authoritySelector_); } - if (thirdPartyPrincipal_ != null) { + if (((bitField0_ & 0x00000001) != 0)) { output.writeMessage(4, getThirdPartyPrincipal()); } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(serviceAccountKeyName_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 5, serviceAccountKeyName_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(serviceAccountKeyName_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 5, serviceAccountKeyName_); } for (int i = 0; i < serviceAccountDelegationInfo_.size(); i++) { output.writeMessage(6, serviceAccountDelegationInfo_.get(i)); } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(principalSubject_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 8, principalSubject_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(principalSubject_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 8, principalSubject_); } getUnknownFields().writeTo(output); } @@ -488,25 +522,25 @@ public int getSerializedSize() { if (size != -1) return size; size = 0; - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(principalEmail_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, principalEmail_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(principalEmail_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, principalEmail_); } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(authoritySelector_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, authoritySelector_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(authoritySelector_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, authoritySelector_); } - if (thirdPartyPrincipal_ != null) { + if (((bitField0_ & 0x00000001) != 0)) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, getThirdPartyPrincipal()); } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(serviceAccountKeyName_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, serviceAccountKeyName_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(serviceAccountKeyName_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(5, serviceAccountKeyName_); } for (int i = 0; i < serviceAccountDelegationInfo_.size(); i++) { size += com.google.protobuf.CodedOutputStream.computeMessageSize( 6, serviceAccountDelegationInfo_.get(i)); } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(principalSubject_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(8, principalSubject_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(principalSubject_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(8, principalSubject_); } size += getUnknownFields().getSerializedSize(); memoizedSize = size; @@ -603,38 +637,38 @@ public static com.google.cloud.audit.AuthenticationInfo parseFrom( public static com.google.cloud.audit.AuthenticationInfo parseFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); } public static com.google.cloud.audit.AuthenticationInfo parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } public static com.google.cloud.audit.AuthenticationInfo parseDelimitedFrom( java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); } public static com.google.cloud.audit.AuthenticationInfo parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( PARSER, input, extensionRegistry); } public static com.google.cloud.audit.AuthenticationInfo parseFrom( com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); } public static com.google.cloud.audit.AuthenticationInfo parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } @@ -657,10 +691,11 @@ public Builder toBuilder() { } @java.lang.Override - protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { Builder builder = new Builder(parent); return builder; } + /** * * @@ -670,7 +705,7 @@ protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.Build * * Protobuf type {@code google.cloud.audit.AuthenticationInfo} */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder implements // @@protoc_insertion_point(builder_implements:google.cloud.audit.AuthenticationInfo) com.google.cloud.audit.AuthenticationInfoOrBuilder { @@ -680,7 +715,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.cloud.audit.AuditLogProto .internal_static_google_cloud_audit_AuthenticationInfo_fieldAccessorTable @@ -690,36 +725,42 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } // Construct using com.google.cloud.audit.AuthenticationInfo.newBuilder() - private Builder() {} + private Builder() { + maybeForceBuilderInitialization(); + } - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetThirdPartyPrincipalFieldBuilder(); + internalGetServiceAccountDelegationInfoFieldBuilder(); + } } @java.lang.Override public Builder clear() { super.clear(); + bitField0_ = 0; principalEmail_ = ""; - authoritySelector_ = ""; - - if (thirdPartyPrincipalBuilder_ == null) { - thirdPartyPrincipal_ = null; - } else { - thirdPartyPrincipal_ = null; + thirdPartyPrincipal_ = null; + if (thirdPartyPrincipalBuilder_ != null) { + thirdPartyPrincipalBuilder_.dispose(); thirdPartyPrincipalBuilder_ = null; } serviceAccountKeyName_ = ""; - if (serviceAccountDelegationInfoBuilder_ == null) { serviceAccountDelegationInfo_ = java.util.Collections.emptyList(); } else { serviceAccountDelegationInfo_ = null; serviceAccountDelegationInfoBuilder_.clear(); } - bitField0_ = (bitField0_ & ~0x00000001); + bitField0_ = (bitField0_ & ~0x00000010); principalSubject_ = ""; - return this; } @@ -747,61 +788,50 @@ public com.google.cloud.audit.AuthenticationInfo build() { public com.google.cloud.audit.AuthenticationInfo buildPartial() { com.google.cloud.audit.AuthenticationInfo result = new com.google.cloud.audit.AuthenticationInfo(this); - int from_bitField0_ = bitField0_; - result.principalEmail_ = principalEmail_; - result.authoritySelector_ = authoritySelector_; - if (thirdPartyPrincipalBuilder_ == null) { - result.thirdPartyPrincipal_ = thirdPartyPrincipal_; - } else { - result.thirdPartyPrincipal_ = thirdPartyPrincipalBuilder_.build(); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); } - result.serviceAccountKeyName_ = serviceAccountKeyName_; + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields(com.google.cloud.audit.AuthenticationInfo result) { if (serviceAccountDelegationInfoBuilder_ == null) { - if (((bitField0_ & 0x00000001) != 0)) { + if (((bitField0_ & 0x00000010) != 0)) { serviceAccountDelegationInfo_ = java.util.Collections.unmodifiableList(serviceAccountDelegationInfo_); - bitField0_ = (bitField0_ & ~0x00000001); + bitField0_ = (bitField0_ & ~0x00000010); } result.serviceAccountDelegationInfo_ = serviceAccountDelegationInfo_; } else { result.serviceAccountDelegationInfo_ = serviceAccountDelegationInfoBuilder_.build(); } - result.principalSubject_ = principalSubject_; - 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); + private void buildPartial0(com.google.cloud.audit.AuthenticationInfo result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.principalEmail_ = principalEmail_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.authoritySelector_ = authoritySelector_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000004) != 0)) { + result.thirdPartyPrincipal_ = + thirdPartyPrincipalBuilder_ == null + ? thirdPartyPrincipal_ + : thirdPartyPrincipalBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.serviceAccountKeyName_ = serviceAccountKeyName_; + } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.principalSubject_ = principalSubject_; + } + result.bitField0_ |= to_bitField0_; } @java.lang.Override @@ -818,10 +848,12 @@ public Builder mergeFrom(com.google.cloud.audit.AuthenticationInfo other) { if (other == com.google.cloud.audit.AuthenticationInfo.getDefaultInstance()) return this; if (!other.getPrincipalEmail().isEmpty()) { principalEmail_ = other.principalEmail_; + bitField0_ |= 0x00000001; onChanged(); } if (!other.getAuthoritySelector().isEmpty()) { authoritySelector_ = other.authoritySelector_; + bitField0_ |= 0x00000002; onChanged(); } if (other.hasThirdPartyPrincipal()) { @@ -829,13 +861,14 @@ public Builder mergeFrom(com.google.cloud.audit.AuthenticationInfo other) { } if (!other.getServiceAccountKeyName().isEmpty()) { serviceAccountKeyName_ = other.serviceAccountKeyName_; + bitField0_ |= 0x00000008; onChanged(); } if (serviceAccountDelegationInfoBuilder_ == null) { if (!other.serviceAccountDelegationInfo_.isEmpty()) { if (serviceAccountDelegationInfo_.isEmpty()) { serviceAccountDelegationInfo_ = other.serviceAccountDelegationInfo_; - bitField0_ = (bitField0_ & ~0x00000001); + bitField0_ = (bitField0_ & ~0x00000010); } else { ensureServiceAccountDelegationInfoIsMutable(); serviceAccountDelegationInfo_.addAll(other.serviceAccountDelegationInfo_); @@ -848,10 +881,10 @@ public Builder mergeFrom(com.google.cloud.audit.AuthenticationInfo other) { serviceAccountDelegationInfoBuilder_.dispose(); serviceAccountDelegationInfoBuilder_ = null; serviceAccountDelegationInfo_ = other.serviceAccountDelegationInfo_; - bitField0_ = (bitField0_ & ~0x00000001); + bitField0_ = (bitField0_ & ~0x00000010); serviceAccountDelegationInfoBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders - ? getServiceAccountDelegationInfoFieldBuilder() + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders + ? internalGetServiceAccountDelegationInfoFieldBuilder() : null; } else { serviceAccountDelegationInfoBuilder_.addAllMessages( @@ -861,6 +894,7 @@ public Builder mergeFrom(com.google.cloud.audit.AuthenticationInfo other) { } if (!other.getPrincipalSubject().isEmpty()) { principalSubject_ = other.principalSubject_; + bitField0_ |= 0x00000020; onChanged(); } this.mergeUnknownFields(other.getUnknownFields()); @@ -892,26 +926,26 @@ public Builder mergeFrom( case 10: { principalEmail_ = input.readStringRequireUtf8(); - + bitField0_ |= 0x00000001; break; } // case 10 case 18: { authoritySelector_ = input.readStringRequireUtf8(); - + bitField0_ |= 0x00000002; break; } // case 18 case 34: { input.readMessage( - getThirdPartyPrincipalFieldBuilder().getBuilder(), extensionRegistry); - + internalGetThirdPartyPrincipalFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000004; break; } // case 34 case 42: { serviceAccountKeyName_ = input.readStringRequireUtf8(); - + bitField0_ |= 0x00000008; break; } // case 42 case 50: @@ -931,7 +965,7 @@ public Builder mergeFrom( case 66: { principalSubject_ = input.readStringRequireUtf8(); - + bitField0_ |= 0x00000020; break; } // case 66 default: @@ -954,6 +988,7 @@ public Builder mergeFrom( private int bitField0_; private java.lang.Object principalEmail_ = ""; + /** * * @@ -981,6 +1016,7 @@ public java.lang.String getPrincipalEmail() { return (java.lang.String) ref; } } + /** * * @@ -1008,6 +1044,7 @@ public com.google.protobuf.ByteString getPrincipalEmailBytes() { return (com.google.protobuf.ByteString) ref; } } + /** * * @@ -1029,11 +1066,12 @@ public Builder setPrincipalEmail(java.lang.String value) { if (value == null) { throw new NullPointerException(); } - principalEmail_ = value; + bitField0_ |= 0x00000001; onChanged(); return this; } + /** * * @@ -1051,11 +1089,12 @@ public Builder setPrincipalEmail(java.lang.String value) { * @return This builder for chaining. */ public Builder clearPrincipalEmail() { - principalEmail_ = getDefaultInstance().getPrincipalEmail(); + bitField0_ = (bitField0_ & ~0x00000001); onChanged(); return this; } + /** * * @@ -1078,13 +1117,14 @@ public Builder setPrincipalEmailBytes(com.google.protobuf.ByteString value) { throw new NullPointerException(); } checkByteStringIsUtf8(value); - principalEmail_ = value; + bitField0_ |= 0x00000001; onChanged(); return this; } private java.lang.Object authoritySelector_ = ""; + /** * * @@ -1108,6 +1148,7 @@ public java.lang.String getAuthoritySelector() { return (java.lang.String) ref; } } + /** * * @@ -1131,6 +1172,7 @@ public com.google.protobuf.ByteString getAuthoritySelectorBytes() { return (com.google.protobuf.ByteString) ref; } } + /** * * @@ -1148,11 +1190,12 @@ public Builder setAuthoritySelector(java.lang.String value) { if (value == null) { throw new NullPointerException(); } - authoritySelector_ = value; + bitField0_ |= 0x00000002; onChanged(); return this; } + /** * * @@ -1166,11 +1209,12 @@ public Builder setAuthoritySelector(java.lang.String value) { * @return This builder for chaining. */ public Builder clearAuthoritySelector() { - authoritySelector_ = getDefaultInstance().getAuthoritySelector(); + bitField0_ = (bitField0_ & ~0x00000002); onChanged(); return this; } + /** * * @@ -1189,18 +1233,19 @@ public Builder setAuthoritySelectorBytes(com.google.protobuf.ByteString value) { throw new NullPointerException(); } checkByteStringIsUtf8(value); - authoritySelector_ = value; + bitField0_ |= 0x00000002; onChanged(); return this; } private com.google.protobuf.Struct thirdPartyPrincipal_; - private com.google.protobuf.SingleFieldBuilderV3< + private com.google.protobuf.SingleFieldBuilder< com.google.protobuf.Struct, com.google.protobuf.Struct.Builder, com.google.protobuf.StructOrBuilder> thirdPartyPrincipalBuilder_; + /** * * @@ -1216,8 +1261,9 @@ public Builder setAuthoritySelectorBytes(com.google.protobuf.ByteString value) { * @return Whether the thirdPartyPrincipal field is set. */ public boolean hasThirdPartyPrincipal() { - return thirdPartyPrincipalBuilder_ != null || thirdPartyPrincipal_ != null; + return ((bitField0_ & 0x00000004) != 0); } + /** * * @@ -1241,6 +1287,7 @@ public com.google.protobuf.Struct getThirdPartyPrincipal() { return thirdPartyPrincipalBuilder_.getMessage(); } } + /** * * @@ -1259,13 +1306,14 @@ public Builder setThirdPartyPrincipal(com.google.protobuf.Struct value) { throw new NullPointerException(); } thirdPartyPrincipal_ = value; - onChanged(); } else { thirdPartyPrincipalBuilder_.setMessage(value); } - + bitField0_ |= 0x00000004; + onChanged(); return this; } + /** * * @@ -1281,13 +1329,14 @@ public Builder setThirdPartyPrincipal(com.google.protobuf.Struct value) { public Builder setThirdPartyPrincipal(com.google.protobuf.Struct.Builder builderForValue) { if (thirdPartyPrincipalBuilder_ == null) { thirdPartyPrincipal_ = builderForValue.build(); - onChanged(); } else { thirdPartyPrincipalBuilder_.setMessage(builderForValue.build()); } - + bitField0_ |= 0x00000004; + onChanged(); return this; } + /** * * @@ -1302,21 +1351,23 @@ public Builder setThirdPartyPrincipal(com.google.protobuf.Struct.Builder builder */ public Builder mergeThirdPartyPrincipal(com.google.protobuf.Struct value) { if (thirdPartyPrincipalBuilder_ == null) { - if (thirdPartyPrincipal_ != null) { - thirdPartyPrincipal_ = - com.google.protobuf.Struct.newBuilder(thirdPartyPrincipal_) - .mergeFrom(value) - .buildPartial(); + if (((bitField0_ & 0x00000004) != 0) + && thirdPartyPrincipal_ != null + && thirdPartyPrincipal_ != com.google.protobuf.Struct.getDefaultInstance()) { + getThirdPartyPrincipalBuilder().mergeFrom(value); } else { thirdPartyPrincipal_ = value; } - onChanged(); } else { thirdPartyPrincipalBuilder_.mergeFrom(value); } - + if (thirdPartyPrincipal_ != null) { + bitField0_ |= 0x00000004; + onChanged(); + } return this; } + /** * * @@ -1330,16 +1381,16 @@ public Builder mergeThirdPartyPrincipal(com.google.protobuf.Struct value) { * .google.protobuf.Struct third_party_principal = 4; */ public Builder clearThirdPartyPrincipal() { - if (thirdPartyPrincipalBuilder_ == null) { - thirdPartyPrincipal_ = null; - onChanged(); - } else { - thirdPartyPrincipal_ = null; + bitField0_ = (bitField0_ & ~0x00000004); + thirdPartyPrincipal_ = null; + if (thirdPartyPrincipalBuilder_ != null) { + thirdPartyPrincipalBuilder_.dispose(); thirdPartyPrincipalBuilder_ = null; } - + onChanged(); return this; } + /** * * @@ -1353,10 +1404,11 @@ public Builder clearThirdPartyPrincipal() { * .google.protobuf.Struct third_party_principal = 4; */ public com.google.protobuf.Struct.Builder getThirdPartyPrincipalBuilder() { - + bitField0_ |= 0x00000004; onChanged(); - return getThirdPartyPrincipalFieldBuilder().getBuilder(); + return internalGetThirdPartyPrincipalFieldBuilder().getBuilder(); } + /** * * @@ -1378,6 +1430,7 @@ public com.google.protobuf.StructOrBuilder getThirdPartyPrincipalOrBuilder() { : thirdPartyPrincipal_; } } + /** * * @@ -1390,14 +1443,14 @@ public com.google.protobuf.StructOrBuilder getThirdPartyPrincipalOrBuilder() { * * .google.protobuf.Struct third_party_principal = 4; */ - private com.google.protobuf.SingleFieldBuilderV3< + private com.google.protobuf.SingleFieldBuilder< com.google.protobuf.Struct, com.google.protobuf.Struct.Builder, com.google.protobuf.StructOrBuilder> - getThirdPartyPrincipalFieldBuilder() { + internalGetThirdPartyPrincipalFieldBuilder() { if (thirdPartyPrincipalBuilder_ == null) { thirdPartyPrincipalBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< + new com.google.protobuf.SingleFieldBuilder< com.google.protobuf.Struct, com.google.protobuf.Struct.Builder, com.google.protobuf.StructOrBuilder>( @@ -1408,6 +1461,7 @@ public com.google.protobuf.StructOrBuilder getThirdPartyPrincipalOrBuilder() { } private java.lang.Object serviceAccountKeyName_ = ""; + /** * * @@ -1415,6 +1469,7 @@ public com.google.protobuf.StructOrBuilder getThirdPartyPrincipalOrBuilder() { * The name of the service account key used to create or exchange * credentials for authenticating the service account making the request. * This is a scheme-less URI full resource name. For example: + * * "//iam.googleapis.com/projects/{PROJECT_ID}/serviceAccounts/{ACCOUNT}/keys/{key}" * * @@ -1433,6 +1488,7 @@ public java.lang.String getServiceAccountKeyName() { return (java.lang.String) ref; } } + /** * * @@ -1440,6 +1496,7 @@ public java.lang.String getServiceAccountKeyName() { * The name of the service account key used to create or exchange * credentials for authenticating the service account making the request. * This is a scheme-less URI full resource name. For example: + * * "//iam.googleapis.com/projects/{PROJECT_ID}/serviceAccounts/{ACCOUNT}/keys/{key}" * * @@ -1458,6 +1515,7 @@ public com.google.protobuf.ByteString getServiceAccountKeyNameBytes() { return (com.google.protobuf.ByteString) ref; } } + /** * * @@ -1465,6 +1523,7 @@ public com.google.protobuf.ByteString getServiceAccountKeyNameBytes() { * The name of the service account key used to create or exchange * credentials for authenticating the service account making the request. * This is a scheme-less URI full resource name. For example: + * * "//iam.googleapis.com/projects/{PROJECT_ID}/serviceAccounts/{ACCOUNT}/keys/{key}" * * @@ -1477,11 +1536,12 @@ public Builder setServiceAccountKeyName(java.lang.String value) { if (value == null) { throw new NullPointerException(); } - serviceAccountKeyName_ = value; + bitField0_ |= 0x00000008; onChanged(); return this; } + /** * * @@ -1489,6 +1549,7 @@ public Builder setServiceAccountKeyName(java.lang.String value) { * The name of the service account key used to create or exchange * credentials for authenticating the service account making the request. * This is a scheme-less URI full resource name. For example: + * * "//iam.googleapis.com/projects/{PROJECT_ID}/serviceAccounts/{ACCOUNT}/keys/{key}" * * @@ -1497,11 +1558,12 @@ public Builder setServiceAccountKeyName(java.lang.String value) { * @return This builder for chaining. */ public Builder clearServiceAccountKeyName() { - serviceAccountKeyName_ = getDefaultInstance().getServiceAccountKeyName(); + bitField0_ = (bitField0_ & ~0x00000008); onChanged(); return this; } + /** * * @@ -1509,6 +1571,7 @@ public Builder clearServiceAccountKeyName() { * The name of the service account key used to create or exchange * credentials for authenticating the service account making the request. * This is a scheme-less URI full resource name. For example: + * * "//iam.googleapis.com/projects/{PROJECT_ID}/serviceAccounts/{ACCOUNT}/keys/{key}" * * @@ -1522,8 +1585,8 @@ public Builder setServiceAccountKeyNameBytes(com.google.protobuf.ByteString valu throw new NullPointerException(); } checkByteStringIsUtf8(value); - serviceAccountKeyName_ = value; + bitField0_ |= 0x00000008; onChanged(); return this; } @@ -1532,15 +1595,15 @@ public Builder setServiceAccountKeyNameBytes(com.google.protobuf.ByteString valu serviceAccountDelegationInfo_ = java.util.Collections.emptyList(); private void ensureServiceAccountDelegationInfoIsMutable() { - if (!((bitField0_ & 0x00000001) != 0)) { + if (!((bitField0_ & 0x00000010) != 0)) { serviceAccountDelegationInfo_ = new java.util.ArrayList( serviceAccountDelegationInfo_); - bitField0_ |= 0x00000001; + bitField0_ |= 0x00000010; } } - private com.google.protobuf.RepeatedFieldBuilderV3< + private com.google.protobuf.RepeatedFieldBuilder< com.google.cloud.audit.ServiceAccountDelegationInfo, com.google.cloud.audit.ServiceAccountDelegationInfo.Builder, com.google.cloud.audit.ServiceAccountDelegationInfoOrBuilder> @@ -1569,6 +1632,7 @@ private void ensureServiceAccountDelegationInfoIsMutable() { return serviceAccountDelegationInfoBuilder_.getMessageList(); } } + /** * * @@ -1591,6 +1655,7 @@ public int getServiceAccountDelegationInfoCount() { return serviceAccountDelegationInfoBuilder_.getCount(); } } + /** * * @@ -1614,6 +1679,7 @@ public com.google.cloud.audit.ServiceAccountDelegationInfo getServiceAccountDele return serviceAccountDelegationInfoBuilder_.getMessage(index); } } + /** * * @@ -1643,6 +1709,7 @@ public Builder setServiceAccountDelegationInfo( } return this; } + /** * * @@ -1669,6 +1736,7 @@ public Builder setServiceAccountDelegationInfo( } return this; } + /** * * @@ -1698,6 +1766,7 @@ public Builder addServiceAccountDelegationInfo( } return this; } + /** * * @@ -1727,6 +1796,7 @@ public Builder addServiceAccountDelegationInfo( } return this; } + /** * * @@ -1753,6 +1823,7 @@ public Builder addServiceAccountDelegationInfo( } return this; } + /** * * @@ -1779,6 +1850,7 @@ public Builder addServiceAccountDelegationInfo( } return this; } + /** * * @@ -1806,6 +1878,7 @@ public Builder addAllServiceAccountDelegationInfo( } return this; } + /** * * @@ -1824,13 +1897,14 @@ public Builder addAllServiceAccountDelegationInfo( public Builder clearServiceAccountDelegationInfo() { if (serviceAccountDelegationInfoBuilder_ == null) { serviceAccountDelegationInfo_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); + bitField0_ = (bitField0_ & ~0x00000010); onChanged(); } else { serviceAccountDelegationInfoBuilder_.clear(); } return this; } + /** * * @@ -1856,6 +1930,7 @@ public Builder removeServiceAccountDelegationInfo(int index) { } return this; } + /** * * @@ -1873,8 +1948,9 @@ public Builder removeServiceAccountDelegationInfo(int index) { */ public com.google.cloud.audit.ServiceAccountDelegationInfo.Builder getServiceAccountDelegationInfoBuilder(int index) { - return getServiceAccountDelegationInfoFieldBuilder().getBuilder(index); + return internalGetServiceAccountDelegationInfoFieldBuilder().getBuilder(index); } + /** * * @@ -1898,6 +1974,7 @@ public Builder removeServiceAccountDelegationInfo(int index) { return serviceAccountDelegationInfoBuilder_.getMessageOrBuilder(index); } } + /** * * @@ -1921,6 +1998,7 @@ public Builder removeServiceAccountDelegationInfo(int index) { return java.util.Collections.unmodifiableList(serviceAccountDelegationInfo_); } } + /** * * @@ -1938,9 +2016,10 @@ public Builder removeServiceAccountDelegationInfo(int index) { */ public com.google.cloud.audit.ServiceAccountDelegationInfo.Builder addServiceAccountDelegationInfoBuilder() { - return getServiceAccountDelegationInfoFieldBuilder() + return internalGetServiceAccountDelegationInfoFieldBuilder() .addBuilder(com.google.cloud.audit.ServiceAccountDelegationInfo.getDefaultInstance()); } + /** * * @@ -1958,10 +2037,11 @@ public Builder removeServiceAccountDelegationInfo(int index) { */ public com.google.cloud.audit.ServiceAccountDelegationInfo.Builder addServiceAccountDelegationInfoBuilder(int index) { - return getServiceAccountDelegationInfoFieldBuilder() + return internalGetServiceAccountDelegationInfoFieldBuilder() .addBuilder( index, com.google.cloud.audit.ServiceAccountDelegationInfo.getDefaultInstance()); } + /** * * @@ -1979,22 +2059,22 @@ public Builder removeServiceAccountDelegationInfo(int index) { */ public java.util.List getServiceAccountDelegationInfoBuilderList() { - return getServiceAccountDelegationInfoFieldBuilder().getBuilderList(); + return internalGetServiceAccountDelegationInfoFieldBuilder().getBuilderList(); } - private com.google.protobuf.RepeatedFieldBuilderV3< + private com.google.protobuf.RepeatedFieldBuilder< com.google.cloud.audit.ServiceAccountDelegationInfo, com.google.cloud.audit.ServiceAccountDelegationInfo.Builder, com.google.cloud.audit.ServiceAccountDelegationInfoOrBuilder> - getServiceAccountDelegationInfoFieldBuilder() { + internalGetServiceAccountDelegationInfoFieldBuilder() { if (serviceAccountDelegationInfoBuilder_ == null) { serviceAccountDelegationInfoBuilder_ = - new com.google.protobuf.RepeatedFieldBuilderV3< + new com.google.protobuf.RepeatedFieldBuilder< com.google.cloud.audit.ServiceAccountDelegationInfo, com.google.cloud.audit.ServiceAccountDelegationInfo.Builder, com.google.cloud.audit.ServiceAccountDelegationInfoOrBuilder>( serviceAccountDelegationInfo_, - ((bitField0_ & 0x00000001) != 0), + ((bitField0_ & 0x00000010) != 0), getParentForChildren(), isClean()); serviceAccountDelegationInfo_ = null; @@ -2003,6 +2083,7 @@ public Builder removeServiceAccountDelegationInfo(int index) { } private java.lang.Object principalSubject_ = ""; + /** * * @@ -2026,6 +2107,7 @@ public java.lang.String getPrincipalSubject() { return (java.lang.String) ref; } } + /** * * @@ -2049,6 +2131,7 @@ public com.google.protobuf.ByteString getPrincipalSubjectBytes() { return (com.google.protobuf.ByteString) ref; } } + /** * * @@ -2066,11 +2149,12 @@ public Builder setPrincipalSubject(java.lang.String value) { if (value == null) { throw new NullPointerException(); } - principalSubject_ = value; + bitField0_ |= 0x00000020; onChanged(); return this; } + /** * * @@ -2084,11 +2168,12 @@ public Builder setPrincipalSubject(java.lang.String value) { * @return This builder for chaining. */ public Builder clearPrincipalSubject() { - principalSubject_ = getDefaultInstance().getPrincipalSubject(); + bitField0_ = (bitField0_ & ~0x00000020); onChanged(); return this; } + /** * * @@ -2107,23 +2192,12 @@ public Builder setPrincipalSubjectBytes(com.google.protobuf.ByteString value) { throw new NullPointerException(); } checkByteStringIsUtf8(value); - principalSubject_ = value; + bitField0_ |= 0x00000020; onChanged(); return this; } - @java.lang.Override - public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - // @@protoc_insertion_point(builder_scope:google.cloud.audit.AuthenticationInfo) } diff --git a/java-common-protos/proto-google-common-protos/src/main/java/com/google/cloud/audit/AuthenticationInfoOrBuilder.java b/java-common-protos/proto-google-common-protos/src/main/java/com/google/cloud/audit/AuthenticationInfoOrBuilder.java index 2dfe54d9ea..2ea80c3089 100644 --- a/java-common-protos/proto-google-common-protos/src/main/java/com/google/cloud/audit/AuthenticationInfoOrBuilder.java +++ b/java-common-protos/proto-google-common-protos/src/main/java/com/google/cloud/audit/AuthenticationInfoOrBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,10 +14,13 @@ * limitations under the License. */ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: google/cloud/audit/audit_log.proto +// Protobuf Java Version: 4.33.2 package com.google.cloud.audit; +@com.google.protobuf.Generated public interface AuthenticationInfoOrBuilder extends // @@protoc_insertion_point(interface_extends:google.cloud.audit.AuthenticationInfo) @@ -40,6 +43,7 @@ public interface AuthenticationInfoOrBuilder * @return The principalEmail. */ java.lang.String getPrincipalEmail(); + /** * * @@ -71,6 +75,7 @@ public interface AuthenticationInfoOrBuilder * @return The authoritySelector. */ java.lang.String getAuthoritySelector(); + /** * * @@ -100,6 +105,7 @@ public interface AuthenticationInfoOrBuilder * @return Whether the thirdPartyPrincipal field is set. */ boolean hasThirdPartyPrincipal(); + /** * * @@ -115,6 +121,7 @@ public interface AuthenticationInfoOrBuilder * @return The thirdPartyPrincipal. */ com.google.protobuf.Struct getThirdPartyPrincipal(); + /** * * @@ -136,6 +143,7 @@ public interface AuthenticationInfoOrBuilder * The name of the service account key used to create or exchange * credentials for authenticating the service account making the request. * This is a scheme-less URI full resource name. For example: + * * "//iam.googleapis.com/projects/{PROJECT_ID}/serviceAccounts/{ACCOUNT}/keys/{key}" * * @@ -144,6 +152,7 @@ public interface AuthenticationInfoOrBuilder * @return The serviceAccountKeyName. */ java.lang.String getServiceAccountKeyName(); + /** * * @@ -151,6 +160,7 @@ public interface AuthenticationInfoOrBuilder * The name of the service account key used to create or exchange * credentials for authenticating the service account making the request. * This is a scheme-less URI full resource name. For example: + * * "//iam.googleapis.com/projects/{PROJECT_ID}/serviceAccounts/{ACCOUNT}/keys/{key}" * * @@ -177,6 +187,7 @@ public interface AuthenticationInfoOrBuilder */ java.util.List getServiceAccountDelegationInfoList(); + /** * * @@ -193,6 +204,7 @@ public interface AuthenticationInfoOrBuilder * */ com.google.cloud.audit.ServiceAccountDelegationInfo getServiceAccountDelegationInfo(int index); + /** * * @@ -209,6 +221,7 @@ public interface AuthenticationInfoOrBuilder * */ int getServiceAccountDelegationInfoCount(); + /** * * @@ -226,6 +239,7 @@ public interface AuthenticationInfoOrBuilder */ java.util.List getServiceAccountDelegationInfoOrBuilderList(); + /** * * @@ -257,6 +271,7 @@ public interface AuthenticationInfoOrBuilder * @return The principalSubject. */ java.lang.String getPrincipalSubject(); + /** * * diff --git a/java-common-protos/proto-google-common-protos/src/main/java/com/google/cloud/audit/AuthorizationInfo.java b/java-common-protos/proto-google-common-protos/src/main/java/com/google/cloud/audit/AuthorizationInfo.java index 4983366351..e474f9a35d 100644 --- a/java-common-protos/proto-google-common-protos/src/main/java/com/google/cloud/audit/AuthorizationInfo.java +++ b/java-common-protos/proto-google-common-protos/src/main/java/com/google/cloud/audit/AuthorizationInfo.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,9 @@ * limitations under the License. */ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: google/cloud/audit/audit_log.proto +// Protobuf Java Version: 4.33.2 package com.google.cloud.audit; @@ -27,30 +29,32 @@ * * Protobuf type {@code google.cloud.audit.AuthorizationInfo} */ -public final class AuthorizationInfo extends com.google.protobuf.GeneratedMessageV3 +@com.google.protobuf.Generated +public final class AuthorizationInfo extends com.google.protobuf.GeneratedMessage implements // @@protoc_insertion_point(message_implements:google.cloud.audit.AuthorizationInfo) AuthorizationInfoOrBuilder { private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "AuthorizationInfo"); + } + // Use AuthorizationInfo.newBuilder() to construct. - private AuthorizationInfo(com.google.protobuf.GeneratedMessageV3.Builder builder) { + private AuthorizationInfo(com.google.protobuf.GeneratedMessage.Builder builder) { super(builder); } private AuthorizationInfo() { resource_ = ""; permission_ = ""; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new AuthorizationInfo(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; + permissionType_ = 0; } public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { @@ -59,7 +63,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.cloud.audit.AuditLogProto .internal_static_google_cloud_audit_AuthorizationInfo_fieldAccessorTable @@ -68,17 +72,237 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { com.google.cloud.audit.AuthorizationInfo.Builder.class); } + /** + * + * + *
        +   * The list of valid permission types that can be checked.
        +   * 
        + * + * Protobuf enum {@code google.cloud.audit.AuthorizationInfo.PermissionType} + */ + public enum PermissionType implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
        +     * Default. Should not be used.
        +     * 
        + * + * PERMISSION_TYPE_UNSPECIFIED = 0; + */ + PERMISSION_TYPE_UNSPECIFIED(0), + /** + * + * + *
        +     * Permissions that gate reading resource configuration or metadata.
        +     * 
        + * + * ADMIN_READ = 1; + */ + ADMIN_READ(1), + /** + * + * + *
        +     * Permissions that gate modification of resource configuration or metadata.
        +     * 
        + * + * ADMIN_WRITE = 2; + */ + ADMIN_WRITE(2), + /** + * + * + *
        +     * Permissions that gate reading user-provided data.
        +     * 
        + * + * DATA_READ = 3; + */ + DATA_READ(3), + /** + * + * + *
        +     * Permissions that gate writing user-provided data.
        +     * 
        + * + * DATA_WRITE = 4; + */ + DATA_WRITE(4), + UNRECOGNIZED(-1), + ; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "PermissionType"); + } + + /** + * + * + *
        +     * Default. Should not be used.
        +     * 
        + * + * PERMISSION_TYPE_UNSPECIFIED = 0; + */ + public static final int PERMISSION_TYPE_UNSPECIFIED_VALUE = 0; + + /** + * + * + *
        +     * Permissions that gate reading resource configuration or metadata.
        +     * 
        + * + * ADMIN_READ = 1; + */ + public static final int ADMIN_READ_VALUE = 1; + + /** + * + * + *
        +     * Permissions that gate modification of resource configuration or metadata.
        +     * 
        + * + * ADMIN_WRITE = 2; + */ + public static final int ADMIN_WRITE_VALUE = 2; + + /** + * + * + *
        +     * Permissions that gate reading user-provided data.
        +     * 
        + * + * DATA_READ = 3; + */ + public static final int DATA_READ_VALUE = 3; + + /** + * + * + *
        +     * Permissions that gate writing user-provided data.
        +     * 
        + * + * DATA_WRITE = 4; + */ + public static final int DATA_WRITE_VALUE = 4; + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static PermissionType 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 PermissionType forNumber(int value) { + switch (value) { + case 0: + return PERMISSION_TYPE_UNSPECIFIED; + case 1: + return ADMIN_READ; + case 2: + return ADMIN_WRITE; + case 3: + return DATA_READ; + case 4: + return DATA_WRITE; + 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 PermissionType findValueByNumber(int number) { + return PermissionType.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 com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.cloud.audit.AuthorizationInfo.getDescriptor().getEnumTypes().get(0); + } + + private static final PermissionType[] VALUES = values(); + + public static PermissionType 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 PermissionType(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.audit.AuthorizationInfo.PermissionType) + } + + private int bitField0_; public static final int RESOURCE_FIELD_NUMBER = 1; - private volatile java.lang.Object resource_; + + @SuppressWarnings("serial") + private volatile java.lang.Object resource_ = ""; + /** * * *
            * The resource being accessed, as a REST-style or cloud resource string.
            * For example:
        -   *     bigquery.googleapis.com/projects/PROJECTID/datasets/DATASETID
        +   *
        +   * bigquery.googleapis.com/projects/PROJECTID/datasets/DATASETID
            * or
        -   *     projects/PROJECTID/datasets/DATASETID
        +   * projects/PROJECTID/datasets/DATASETID
            * 
        * * string resource = 1; @@ -97,15 +321,17 @@ public java.lang.String getResource() { return s; } } + /** * * *
            * The resource being accessed, as a REST-style or cloud resource string.
            * For example:
        -   *     bigquery.googleapis.com/projects/PROJECTID/datasets/DATASETID
        +   *
        +   * bigquery.googleapis.com/projects/PROJECTID/datasets/DATASETID
            * or
        -   *     projects/PROJECTID/datasets/DATASETID
        +   * projects/PROJECTID/datasets/DATASETID
            * 
        * * string resource = 1; @@ -126,7 +352,10 @@ public com.google.protobuf.ByteString getResourceBytes() { } public static final int PERMISSION_FIELD_NUMBER = 2; - private volatile java.lang.Object permission_; + + @SuppressWarnings("serial") + private volatile java.lang.Object permission_ = ""; + /** * * @@ -150,6 +379,7 @@ public java.lang.String getPermission() { return s; } } + /** * * @@ -175,7 +405,8 @@ public com.google.protobuf.ByteString getPermissionBytes() { } public static final int GRANTED_FIELD_NUMBER = 3; - private boolean granted_; + private boolean granted_ = false; + /** * * @@ -195,12 +426,14 @@ public boolean getGranted() { public static final int RESOURCE_ATTRIBUTES_FIELD_NUMBER = 5; private com.google.rpc.context.AttributeContext.Resource resourceAttributes_; + /** * * *
            * Resource attributes used in IAM condition evaluation. This field contains
            * resource attributes like resource type and resource name.
        +   *
            * To get the whole view of the attributes used in IAM
            * condition evaluation, the user must also look into
            * `AuditLog.request_metadata.request_attributes`.
        @@ -212,14 +445,16 @@ public boolean getGranted() {
            */
           @java.lang.Override
           public boolean hasResourceAttributes() {
        -    return resourceAttributes_ != null;
        +    return ((bitField0_ & 0x00000001) != 0);
           }
        +
           /**
            *
            *
            * 
            * Resource attributes used in IAM condition evaluation. This field contains
            * resource attributes like resource type and resource name.
        +   *
            * To get the whole view of the attributes used in IAM
            * condition evaluation, the user must also look into
            * `AuditLog.request_metadata.request_attributes`.
        @@ -235,12 +470,14 @@ public com.google.rpc.context.AttributeContext.Resource getResourceAttributes()
                 ? com.google.rpc.context.AttributeContext.Resource.getDefaultInstance()
                 : resourceAttributes_;
           }
        +
           /**
            *
            *
            * 
            * Resource attributes used in IAM condition evaluation. This field contains
            * resource attributes like resource type and resource name.
        +   *
            * To get the whole view of the attributes used in IAM
            * condition evaluation, the user must also look into
            * `AuditLog.request_metadata.request_attributes`.
        @@ -251,7 +488,52 @@ public com.google.rpc.context.AttributeContext.Resource getResourceAttributes()
           @java.lang.Override
           public com.google.rpc.context.AttributeContext.ResourceOrBuilder
               getResourceAttributesOrBuilder() {
        -    return getResourceAttributes();
        +    return resourceAttributes_ == null
        +        ? com.google.rpc.context.AttributeContext.Resource.getDefaultInstance()
        +        : resourceAttributes_;
        +  }
        +
        +  public static final int PERMISSION_TYPE_FIELD_NUMBER = 7;
        +  private int permissionType_ = 0;
        +
        +  /**
        +   *
        +   *
        +   * 
        +   * The type of the permission that was checked. For data access audit logs
        +   * this corresponds with the permission type that must be enabled in the
        +   * project/folder/organization IAM policy in order for the log to be written.
        +   * 
        + * + * .google.cloud.audit.AuthorizationInfo.PermissionType permission_type = 7; + * + * @return The enum numeric value on the wire for permissionType. + */ + @java.lang.Override + public int getPermissionTypeValue() { + return permissionType_; + } + + /** + * + * + *
        +   * The type of the permission that was checked. For data access audit logs
        +   * this corresponds with the permission type that must be enabled in the
        +   * project/folder/organization IAM policy in order for the log to be written.
        +   * 
        + * + * .google.cloud.audit.AuthorizationInfo.PermissionType permission_type = 7; + * + * @return The permissionType. + */ + @java.lang.Override + public com.google.cloud.audit.AuthorizationInfo.PermissionType getPermissionType() { + com.google.cloud.audit.AuthorizationInfo.PermissionType result = + com.google.cloud.audit.AuthorizationInfo.PermissionType.forNumber(permissionType_); + return result == null + ? com.google.cloud.audit.AuthorizationInfo.PermissionType.UNRECOGNIZED + : result; } private byte memoizedIsInitialized = -1; @@ -268,18 +550,23 @@ public final boolean isInitialized() { @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(resource_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, resource_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(resource_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, resource_); } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(permission_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 2, permission_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(permission_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, permission_); } if (granted_ != false) { output.writeBool(3, granted_); } - if (resourceAttributes_ != null) { + if (((bitField0_ & 0x00000001) != 0)) { output.writeMessage(5, getResourceAttributes()); } + if (permissionType_ + != com.google.cloud.audit.AuthorizationInfo.PermissionType.PERMISSION_TYPE_UNSPECIFIED + .getNumber()) { + output.writeEnum(7, permissionType_); + } getUnknownFields().writeTo(output); } @@ -289,18 +576,23 @@ public int getSerializedSize() { if (size != -1) return size; size = 0; - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(resource_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, resource_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(resource_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, resource_); } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(permission_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, permission_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(permission_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, permission_); } if (granted_ != false) { size += com.google.protobuf.CodedOutputStream.computeBoolSize(3, granted_); } - if (resourceAttributes_ != null) { + if (((bitField0_ & 0x00000001) != 0)) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(5, getResourceAttributes()); } + if (permissionType_ + != com.google.cloud.audit.AuthorizationInfo.PermissionType.PERMISSION_TYPE_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(7, permissionType_); + } size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; @@ -323,6 +615,7 @@ public boolean equals(final java.lang.Object obj) { if (hasResourceAttributes()) { if (!getResourceAttributes().equals(other.getResourceAttributes())) return false; } + if (permissionType_ != other.permissionType_) return false; if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -344,6 +637,8 @@ public int hashCode() { hash = (37 * hash) + RESOURCE_ATTRIBUTES_FIELD_NUMBER; hash = (53 * hash) + getResourceAttributes().hashCode(); } + hash = (37 * hash) + PERMISSION_TYPE_FIELD_NUMBER; + hash = (53 * hash) + permissionType_; hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; @@ -386,38 +681,38 @@ public static com.google.cloud.audit.AuthorizationInfo parseFrom( public static com.google.cloud.audit.AuthorizationInfo parseFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); } public static com.google.cloud.audit.AuthorizationInfo parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } public static com.google.cloud.audit.AuthorizationInfo parseDelimitedFrom( java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); } public static com.google.cloud.audit.AuthorizationInfo parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( PARSER, input, extensionRegistry); } public static com.google.cloud.audit.AuthorizationInfo parseFrom( com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); } public static com.google.cloud.audit.AuthorizationInfo parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } @@ -440,10 +735,11 @@ public Builder toBuilder() { } @java.lang.Override - protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { Builder builder = new Builder(parent); return builder; } + /** * * @@ -453,7 +749,7 @@ protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.Build * * Protobuf type {@code google.cloud.audit.AuthorizationInfo} */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder implements // @@protoc_insertion_point(builder_implements:google.cloud.audit.AuthorizationInfo) com.google.cloud.audit.AuthorizationInfoOrBuilder { @@ -463,7 +759,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.cloud.audit.AuditLogProto .internal_static_google_cloud_audit_AuthorizationInfo_fieldAccessorTable @@ -473,27 +769,34 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } // Construct using com.google.cloud.audit.AuthorizationInfo.newBuilder() - private Builder() {} + private Builder() { + maybeForceBuilderInitialization(); + } - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetResourceAttributesFieldBuilder(); + } } @java.lang.Override public Builder clear() { super.clear(); + bitField0_ = 0; resource_ = ""; - permission_ = ""; - granted_ = false; - - if (resourceAttributesBuilder_ == null) { - resourceAttributes_ = null; - } else { - resourceAttributes_ = null; + resourceAttributes_ = null; + if (resourceAttributesBuilder_ != null) { + resourceAttributesBuilder_.dispose(); resourceAttributesBuilder_ = null; } + permissionType_ = 0; return this; } @@ -521,49 +824,36 @@ public com.google.cloud.audit.AuthorizationInfo build() { public com.google.cloud.audit.AuthorizationInfo buildPartial() { com.google.cloud.audit.AuthorizationInfo result = new com.google.cloud.audit.AuthorizationInfo(this); - result.resource_ = resource_; - result.permission_ = permission_; - result.granted_ = granted_; - if (resourceAttributesBuilder_ == null) { - result.resourceAttributes_ = resourceAttributes_; - } else { - result.resourceAttributes_ = resourceAttributesBuilder_.build(); + if (bitField0_ != 0) { + buildPartial0(result); } 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); + private void buildPartial0(com.google.cloud.audit.AuthorizationInfo result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.resource_ = resource_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.permission_ = permission_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.granted_ = granted_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000008) != 0)) { + result.resourceAttributes_ = + resourceAttributesBuilder_ == null + ? resourceAttributes_ + : resourceAttributesBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.permissionType_ = permissionType_; + } + result.bitField0_ |= to_bitField0_; } @java.lang.Override @@ -580,10 +870,12 @@ public Builder mergeFrom(com.google.cloud.audit.AuthorizationInfo other) { if (other == com.google.cloud.audit.AuthorizationInfo.getDefaultInstance()) return this; if (!other.getResource().isEmpty()) { resource_ = other.resource_; + bitField0_ |= 0x00000001; onChanged(); } if (!other.getPermission().isEmpty()) { permission_ = other.permission_; + bitField0_ |= 0x00000002; onChanged(); } if (other.getGranted() != false) { @@ -592,6 +884,9 @@ public Builder mergeFrom(com.google.cloud.audit.AuthorizationInfo other) { if (other.hasResourceAttributes()) { mergeResourceAttributes(other.getResourceAttributes()); } + if (other.permissionType_ != 0) { + setPermissionTypeValue(other.getPermissionTypeValue()); + } this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; @@ -621,28 +916,34 @@ public Builder mergeFrom( case 10: { resource_ = input.readStringRequireUtf8(); - + bitField0_ |= 0x00000001; break; } // case 10 case 18: { permission_ = input.readStringRequireUtf8(); - + bitField0_ |= 0x00000002; break; } // case 18 case 24: { granted_ = input.readBool(); - + bitField0_ |= 0x00000004; break; } // case 24 case 42: { input.readMessage( - getResourceAttributesFieldBuilder().getBuilder(), extensionRegistry); - + internalGetResourceAttributesFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000008; break; } // case 42 + case 56: + { + permissionType_ = input.readEnum(); + bitField0_ |= 0x00000010; + break; + } // case 56 default: { if (!super.parseUnknownField(input, extensionRegistry, tag)) { @@ -660,16 +961,20 @@ public Builder mergeFrom( return this; } + private int bitField0_; + private java.lang.Object resource_ = ""; + /** * * *
              * The resource being accessed, as a REST-style or cloud resource string.
              * For example:
        -     *     bigquery.googleapis.com/projects/PROJECTID/datasets/DATASETID
        +     *
        +     * bigquery.googleapis.com/projects/PROJECTID/datasets/DATASETID
              * or
        -     *     projects/PROJECTID/datasets/DATASETID
        +     * projects/PROJECTID/datasets/DATASETID
              * 
        * * string resource = 1; @@ -687,15 +992,17 @@ public java.lang.String getResource() { return (java.lang.String) ref; } } + /** * * *
              * The resource being accessed, as a REST-style or cloud resource string.
              * For example:
        -     *     bigquery.googleapis.com/projects/PROJECTID/datasets/DATASETID
        +     *
        +     * bigquery.googleapis.com/projects/PROJECTID/datasets/DATASETID
              * or
        -     *     projects/PROJECTID/datasets/DATASETID
        +     * projects/PROJECTID/datasets/DATASETID
              * 
        * * string resource = 1; @@ -713,15 +1020,17 @@ public com.google.protobuf.ByteString getResourceBytes() { return (com.google.protobuf.ByteString) ref; } } + /** * * *
              * The resource being accessed, as a REST-style or cloud resource string.
              * For example:
        -     *     bigquery.googleapis.com/projects/PROJECTID/datasets/DATASETID
        +     *
        +     * bigquery.googleapis.com/projects/PROJECTID/datasets/DATASETID
              * or
        -     *     projects/PROJECTID/datasets/DATASETID
        +     * projects/PROJECTID/datasets/DATASETID
              * 
        * * string resource = 1; @@ -733,20 +1042,22 @@ public Builder setResource(java.lang.String value) { if (value == null) { throw new NullPointerException(); } - resource_ = value; + bitField0_ |= 0x00000001; onChanged(); return this; } + /** * * *
              * The resource being accessed, as a REST-style or cloud resource string.
              * For example:
        -     *     bigquery.googleapis.com/projects/PROJECTID/datasets/DATASETID
        +     *
        +     * bigquery.googleapis.com/projects/PROJECTID/datasets/DATASETID
              * or
        -     *     projects/PROJECTID/datasets/DATASETID
        +     * projects/PROJECTID/datasets/DATASETID
              * 
        * * string resource = 1; @@ -754,20 +1065,22 @@ public Builder setResource(java.lang.String value) { * @return This builder for chaining. */ public Builder clearResource() { - resource_ = getDefaultInstance().getResource(); + bitField0_ = (bitField0_ & ~0x00000001); onChanged(); return this; } + /** * * *
              * The resource being accessed, as a REST-style or cloud resource string.
              * For example:
        -     *     bigquery.googleapis.com/projects/PROJECTID/datasets/DATASETID
        +     *
        +     * bigquery.googleapis.com/projects/PROJECTID/datasets/DATASETID
              * or
        -     *     projects/PROJECTID/datasets/DATASETID
        +     * projects/PROJECTID/datasets/DATASETID
              * 
        * * string resource = 1; @@ -780,13 +1093,14 @@ public Builder setResourceBytes(com.google.protobuf.ByteString value) { throw new NullPointerException(); } checkByteStringIsUtf8(value); - resource_ = value; + bitField0_ |= 0x00000001; onChanged(); return this; } private java.lang.Object permission_ = ""; + /** * * @@ -809,6 +1123,7 @@ public java.lang.String getPermission() { return (java.lang.String) ref; } } + /** * * @@ -831,6 +1146,7 @@ public com.google.protobuf.ByteString getPermissionBytes() { return (com.google.protobuf.ByteString) ref; } } + /** * * @@ -847,11 +1163,12 @@ public Builder setPermission(java.lang.String value) { if (value == null) { throw new NullPointerException(); } - permission_ = value; + bitField0_ |= 0x00000002; onChanged(); return this; } + /** * * @@ -864,11 +1181,12 @@ public Builder setPermission(java.lang.String value) { * @return This builder for chaining. */ public Builder clearPermission() { - permission_ = getDefaultInstance().getPermission(); + bitField0_ = (bitField0_ & ~0x00000002); onChanged(); return this; } + /** * * @@ -886,13 +1204,14 @@ public Builder setPermissionBytes(com.google.protobuf.ByteString value) { throw new NullPointerException(); } checkByteStringIsUtf8(value); - permission_ = value; + bitField0_ |= 0x00000002; onChanged(); return this; } private boolean granted_; + /** * * @@ -909,6 +1228,7 @@ public Builder setPermissionBytes(com.google.protobuf.ByteString value) { public boolean getGranted() { return granted_; } + /** * * @@ -925,9 +1245,11 @@ public boolean getGranted() { public Builder setGranted(boolean value) { granted_ = value; + bitField0_ |= 0x00000004; onChanged(); return this; } + /** * * @@ -941,24 +1263,26 @@ public Builder setGranted(boolean value) { * @return This builder for chaining. */ public Builder clearGranted() { - + bitField0_ = (bitField0_ & ~0x00000004); granted_ = false; onChanged(); return this; } private com.google.rpc.context.AttributeContext.Resource resourceAttributes_; - private com.google.protobuf.SingleFieldBuilderV3< + private com.google.protobuf.SingleFieldBuilder< com.google.rpc.context.AttributeContext.Resource, com.google.rpc.context.AttributeContext.Resource.Builder, com.google.rpc.context.AttributeContext.ResourceOrBuilder> resourceAttributesBuilder_; + /** * * *
              * Resource attributes used in IAM condition evaluation. This field contains
              * resource attributes like resource type and resource name.
        +     *
              * To get the whole view of the attributes used in IAM
              * condition evaluation, the user must also look into
              * `AuditLog.request_metadata.request_attributes`.
        @@ -969,14 +1293,16 @@ public Builder clearGranted() {
              * @return Whether the resourceAttributes field is set.
              */
             public boolean hasResourceAttributes() {
        -      return resourceAttributesBuilder_ != null || resourceAttributes_ != null;
        +      return ((bitField0_ & 0x00000008) != 0);
             }
        +
             /**
              *
              *
              * 
              * Resource attributes used in IAM condition evaluation. This field contains
              * resource attributes like resource type and resource name.
        +     *
              * To get the whole view of the attributes used in IAM
              * condition evaluation, the user must also look into
              * `AuditLog.request_metadata.request_attributes`.
        @@ -995,12 +1321,14 @@ public com.google.rpc.context.AttributeContext.Resource getResourceAttributes()
                 return resourceAttributesBuilder_.getMessage();
               }
             }
        +
             /**
              *
              *
              * 
              * Resource attributes used in IAM condition evaluation. This field contains
              * resource attributes like resource type and resource name.
        +     *
              * To get the whole view of the attributes used in IAM
              * condition evaluation, the user must also look into
              * `AuditLog.request_metadata.request_attributes`.
        @@ -1014,19 +1342,21 @@ public Builder setResourceAttributes(com.google.rpc.context.AttributeContext.Res
                   throw new NullPointerException();
                 }
                 resourceAttributes_ = value;
        -        onChanged();
               } else {
                 resourceAttributesBuilder_.setMessage(value);
               }
        -
        +      bitField0_ |= 0x00000008;
        +      onChanged();
               return this;
             }
        +
             /**
              *
              *
              * 
              * Resource attributes used in IAM condition evaluation. This field contains
              * resource attributes like resource type and resource name.
        +     *
              * To get the whole view of the attributes used in IAM
              * condition evaluation, the user must also look into
              * `AuditLog.request_metadata.request_attributes`.
        @@ -1038,19 +1368,21 @@ public Builder setResourceAttributes(
                 com.google.rpc.context.AttributeContext.Resource.Builder builderForValue) {
               if (resourceAttributesBuilder_ == null) {
                 resourceAttributes_ = builderForValue.build();
        -        onChanged();
               } else {
                 resourceAttributesBuilder_.setMessage(builderForValue.build());
               }
        -
        +      bitField0_ |= 0x00000008;
        +      onChanged();
               return this;
             }
        +
             /**
              *
              *
              * 
              * Resource attributes used in IAM condition evaluation. This field contains
              * resource attributes like resource type and resource name.
        +     *
              * To get the whole view of the attributes used in IAM
              * condition evaluation, the user must also look into
              * `AuditLog.request_metadata.request_attributes`.
        @@ -1060,27 +1392,31 @@ public Builder setResourceAttributes(
              */
             public Builder mergeResourceAttributes(com.google.rpc.context.AttributeContext.Resource value) {
               if (resourceAttributesBuilder_ == null) {
        -        if (resourceAttributes_ != null) {
        -          resourceAttributes_ =
        -              com.google.rpc.context.AttributeContext.Resource.newBuilder(resourceAttributes_)
        -                  .mergeFrom(value)
        -                  .buildPartial();
        +        if (((bitField0_ & 0x00000008) != 0)
        +            && resourceAttributes_ != null
        +            && resourceAttributes_
        +                != com.google.rpc.context.AttributeContext.Resource.getDefaultInstance()) {
        +          getResourceAttributesBuilder().mergeFrom(value);
                 } else {
                   resourceAttributes_ = value;
                 }
        -        onChanged();
               } else {
                 resourceAttributesBuilder_.mergeFrom(value);
               }
        -
        +      if (resourceAttributes_ != null) {
        +        bitField0_ |= 0x00000008;
        +        onChanged();
        +      }
               return this;
             }
        +
             /**
              *
              *
              * 
              * Resource attributes used in IAM condition evaluation. This field contains
              * resource attributes like resource type and resource name.
        +     *
              * To get the whole view of the attributes used in IAM
              * condition evaluation, the user must also look into
              * `AuditLog.request_metadata.request_attributes`.
        @@ -1089,22 +1425,23 @@ public Builder mergeResourceAttributes(com.google.rpc.context.AttributeContext.R
              * .google.rpc.context.AttributeContext.Resource resource_attributes = 5;
              */
             public Builder clearResourceAttributes() {
        -      if (resourceAttributesBuilder_ == null) {
        -        resourceAttributes_ = null;
        -        onChanged();
        -      } else {
        -        resourceAttributes_ = null;
        +      bitField0_ = (bitField0_ & ~0x00000008);
        +      resourceAttributes_ = null;
        +      if (resourceAttributesBuilder_ != null) {
        +        resourceAttributesBuilder_.dispose();
                 resourceAttributesBuilder_ = null;
               }
        -
        +      onChanged();
               return this;
             }
        +
             /**
              *
              *
              * 
              * Resource attributes used in IAM condition evaluation. This field contains
              * resource attributes like resource type and resource name.
        +     *
              * To get the whole view of the attributes used in IAM
              * condition evaluation, the user must also look into
              * `AuditLog.request_metadata.request_attributes`.
        @@ -1113,16 +1450,18 @@ public Builder clearResourceAttributes() {
              * .google.rpc.context.AttributeContext.Resource resource_attributes = 5;
              */
             public com.google.rpc.context.AttributeContext.Resource.Builder getResourceAttributesBuilder() {
        -
        +      bitField0_ |= 0x00000008;
               onChanged();
        -      return getResourceAttributesFieldBuilder().getBuilder();
        +      return internalGetResourceAttributesFieldBuilder().getBuilder();
             }
        +
             /**
              *
              *
              * 
              * Resource attributes used in IAM condition evaluation. This field contains
              * resource attributes like resource type and resource name.
        +     *
              * To get the whole view of the attributes used in IAM
              * condition evaluation, the user must also look into
              * `AuditLog.request_metadata.request_attributes`.
        @@ -1140,12 +1479,14 @@ public com.google.rpc.context.AttributeContext.Resource.Builder getResourceAttri
                     : resourceAttributes_;
               }
             }
        +
             /**
              *
              *
              * 
              * Resource attributes used in IAM condition evaluation. This field contains
              * resource attributes like resource type and resource name.
        +     *
              * To get the whole view of the attributes used in IAM
              * condition evaluation, the user must also look into
              * `AuditLog.request_metadata.request_attributes`.
        @@ -1153,14 +1494,14 @@ public com.google.rpc.context.AttributeContext.Resource.Builder getResourceAttri
              *
              * .google.rpc.context.AttributeContext.Resource resource_attributes = 5;
              */
        -    private com.google.protobuf.SingleFieldBuilderV3<
        +    private com.google.protobuf.SingleFieldBuilder<
                     com.google.rpc.context.AttributeContext.Resource,
                     com.google.rpc.context.AttributeContext.Resource.Builder,
                     com.google.rpc.context.AttributeContext.ResourceOrBuilder>
        -        getResourceAttributesFieldBuilder() {
        +        internalGetResourceAttributesFieldBuilder() {
               if (resourceAttributesBuilder_ == null) {
                 resourceAttributesBuilder_ =
        -            new com.google.protobuf.SingleFieldBuilderV3<
        +            new com.google.protobuf.SingleFieldBuilder<
                         com.google.rpc.context.AttributeContext.Resource,
                         com.google.rpc.context.AttributeContext.Resource.Builder,
                         com.google.rpc.context.AttributeContext.ResourceOrBuilder>(
        @@ -1170,15 +1511,112 @@ public com.google.rpc.context.AttributeContext.Resource.Builder getResourceAttri
               return resourceAttributesBuilder_;
             }
         
        +    private int permissionType_ = 0;
        +
        +    /**
        +     *
        +     *
        +     * 
        +     * The type of the permission that was checked. For data access audit logs
        +     * this corresponds with the permission type that must be enabled in the
        +     * project/folder/organization IAM policy in order for the log to be written.
        +     * 
        + * + * .google.cloud.audit.AuthorizationInfo.PermissionType permission_type = 7; + * + * @return The enum numeric value on the wire for permissionType. + */ @java.lang.Override - public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); + public int getPermissionTypeValue() { + return permissionType_; } + /** + * + * + *
        +     * The type of the permission that was checked. For data access audit logs
        +     * this corresponds with the permission type that must be enabled in the
        +     * project/folder/organization IAM policy in order for the log to be written.
        +     * 
        + * + * .google.cloud.audit.AuthorizationInfo.PermissionType permission_type = 7; + * + * @param value The enum numeric value on the wire for permissionType to set. + * @return This builder for chaining. + */ + public Builder setPermissionTypeValue(int value) { + permissionType_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + /** + * + * + *
        +     * The type of the permission that was checked. For data access audit logs
        +     * this corresponds with the permission type that must be enabled in the
        +     * project/folder/organization IAM policy in order for the log to be written.
        +     * 
        + * + * .google.cloud.audit.AuthorizationInfo.PermissionType permission_type = 7; + * + * @return The permissionType. + */ @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); + public com.google.cloud.audit.AuthorizationInfo.PermissionType getPermissionType() { + com.google.cloud.audit.AuthorizationInfo.PermissionType result = + com.google.cloud.audit.AuthorizationInfo.PermissionType.forNumber(permissionType_); + return result == null + ? com.google.cloud.audit.AuthorizationInfo.PermissionType.UNRECOGNIZED + : result; + } + + /** + * + * + *
        +     * The type of the permission that was checked. For data access audit logs
        +     * this corresponds with the permission type that must be enabled in the
        +     * project/folder/organization IAM policy in order for the log to be written.
        +     * 
        + * + * .google.cloud.audit.AuthorizationInfo.PermissionType permission_type = 7; + * + * @param value The permissionType to set. + * @return This builder for chaining. + */ + public Builder setPermissionType( + com.google.cloud.audit.AuthorizationInfo.PermissionType value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000010; + permissionType_ = value.getNumber(); + onChanged(); + return this; + } + + /** + * + * + *
        +     * The type of the permission that was checked. For data access audit logs
        +     * this corresponds with the permission type that must be enabled in the
        +     * project/folder/organization IAM policy in order for the log to be written.
        +     * 
        + * + * .google.cloud.audit.AuthorizationInfo.PermissionType permission_type = 7; + * + * @return This builder for chaining. + */ + public Builder clearPermissionType() { + bitField0_ = (bitField0_ & ~0x00000010); + permissionType_ = 0; + onChanged(); + return this; } // @@protoc_insertion_point(builder_scope:google.cloud.audit.AuthorizationInfo) diff --git a/java-common-protos/proto-google-common-protos/src/main/java/com/google/cloud/audit/AuthorizationInfoOrBuilder.java b/java-common-protos/proto-google-common-protos/src/main/java/com/google/cloud/audit/AuthorizationInfoOrBuilder.java index fe0764ec63..da414d61b9 100644 --- a/java-common-protos/proto-google-common-protos/src/main/java/com/google/cloud/audit/AuthorizationInfoOrBuilder.java +++ b/java-common-protos/proto-google-common-protos/src/main/java/com/google/cloud/audit/AuthorizationInfoOrBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,10 +14,13 @@ * limitations under the License. */ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: google/cloud/audit/audit_log.proto +// Protobuf Java Version: 4.33.2 package com.google.cloud.audit; +@com.google.protobuf.Generated public interface AuthorizationInfoOrBuilder extends // @@protoc_insertion_point(interface_extends:google.cloud.audit.AuthorizationInfo) @@ -29,9 +32,10 @@ public interface AuthorizationInfoOrBuilder *
            * The resource being accessed, as a REST-style or cloud resource string.
            * For example:
        -   *     bigquery.googleapis.com/projects/PROJECTID/datasets/DATASETID
        +   *
        +   * bigquery.googleapis.com/projects/PROJECTID/datasets/DATASETID
            * or
        -   *     projects/PROJECTID/datasets/DATASETID
        +   * projects/PROJECTID/datasets/DATASETID
            * 
        * * string resource = 1; @@ -39,15 +43,17 @@ public interface AuthorizationInfoOrBuilder * @return The resource. */ java.lang.String getResource(); + /** * * *
            * The resource being accessed, as a REST-style or cloud resource string.
            * For example:
        -   *     bigquery.googleapis.com/projects/PROJECTID/datasets/DATASETID
        +   *
        +   * bigquery.googleapis.com/projects/PROJECTID/datasets/DATASETID
            * or
        -   *     projects/PROJECTID/datasets/DATASETID
        +   * projects/PROJECTID/datasets/DATASETID
            * 
        * * string resource = 1; @@ -68,6 +74,7 @@ public interface AuthorizationInfoOrBuilder * @return The permission. */ java.lang.String getPermission(); + /** * * @@ -101,6 +108,7 @@ public interface AuthorizationInfoOrBuilder *
            * Resource attributes used in IAM condition evaluation. This field contains
            * resource attributes like resource type and resource name.
        +   *
            * To get the whole view of the attributes used in IAM
            * condition evaluation, the user must also look into
            * `AuditLog.request_metadata.request_attributes`.
        @@ -111,12 +119,14 @@ public interface AuthorizationInfoOrBuilder
            * @return Whether the resourceAttributes field is set.
            */
           boolean hasResourceAttributes();
        +
           /**
            *
            *
            * 
            * Resource attributes used in IAM condition evaluation. This field contains
            * resource attributes like resource type and resource name.
        +   *
            * To get the whole view of the attributes used in IAM
            * condition evaluation, the user must also look into
            * `AuditLog.request_metadata.request_attributes`.
        @@ -127,12 +137,14 @@ public interface AuthorizationInfoOrBuilder
            * @return The resourceAttributes.
            */
           com.google.rpc.context.AttributeContext.Resource getResourceAttributes();
        +
           /**
            *
            *
            * 
            * Resource attributes used in IAM condition evaluation. This field contains
            * resource attributes like resource type and resource name.
        +   *
            * To get the whole view of the attributes used in IAM
            * condition evaluation, the user must also look into
            * `AuditLog.request_metadata.request_attributes`.
        @@ -141,4 +153,34 @@ public interface AuthorizationInfoOrBuilder
            * .google.rpc.context.AttributeContext.Resource resource_attributes = 5;
            */
           com.google.rpc.context.AttributeContext.ResourceOrBuilder getResourceAttributesOrBuilder();
        +
        +  /**
        +   *
        +   *
        +   * 
        +   * The type of the permission that was checked. For data access audit logs
        +   * this corresponds with the permission type that must be enabled in the
        +   * project/folder/organization IAM policy in order for the log to be written.
        +   * 
        + * + * .google.cloud.audit.AuthorizationInfo.PermissionType permission_type = 7; + * + * @return The enum numeric value on the wire for permissionType. + */ + int getPermissionTypeValue(); + + /** + * + * + *
        +   * The type of the permission that was checked. For data access audit logs
        +   * this corresponds with the permission type that must be enabled in the
        +   * project/folder/organization IAM policy in order for the log to be written.
        +   * 
        + * + * .google.cloud.audit.AuthorizationInfo.PermissionType permission_type = 7; + * + * @return The permissionType. + */ + com.google.cloud.audit.AuthorizationInfo.PermissionType getPermissionType(); } diff --git a/java-common-protos/proto-google-common-protos/src/main/java/com/google/cloud/audit/OrgPolicyViolationInfo.java b/java-common-protos/proto-google-common-protos/src/main/java/com/google/cloud/audit/OrgPolicyViolationInfo.java index d7c61fadeb..bc629b26ff 100644 --- a/java-common-protos/proto-google-common-protos/src/main/java/com/google/cloud/audit/OrgPolicyViolationInfo.java +++ b/java-common-protos/proto-google-common-protos/src/main/java/com/google/cloud/audit/OrgPolicyViolationInfo.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,9 @@ * limitations under the License. */ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: google/cloud/audit/audit_log.proto +// Protobuf Java Version: 4.33.2 package com.google.cloud.audit; @@ -27,13 +29,25 @@ * * Protobuf type {@code google.cloud.audit.OrgPolicyViolationInfo} */ -public final class OrgPolicyViolationInfo extends com.google.protobuf.GeneratedMessageV3 +@com.google.protobuf.Generated +public final class OrgPolicyViolationInfo extends com.google.protobuf.GeneratedMessage implements // @@protoc_insertion_point(message_implements:google.cloud.audit.OrgPolicyViolationInfo) OrgPolicyViolationInfoOrBuilder { private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "OrgPolicyViolationInfo"); + } + // Use OrgPolicyViolationInfo.newBuilder() to construct. - private OrgPolicyViolationInfo(com.google.protobuf.GeneratedMessageV3.Builder builder) { + private OrgPolicyViolationInfo(com.google.protobuf.GeneratedMessage.Builder builder) { super(builder); } @@ -42,17 +56,6 @@ private OrgPolicyViolationInfo() { violationInfo_ = java.util.Collections.emptyList(); } - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new OrgPolicyViolationInfo(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.cloud.audit.AuditLogProto .internal_static_google_cloud_audit_OrgPolicyViolationInfo_descriptor; @@ -60,7 +63,8 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { @SuppressWarnings({"rawtypes"}) @java.lang.Override - protected com.google.protobuf.MapField internalGetMapField(int number) { + protected com.google.protobuf.MapFieldReflectionAccessor internalGetMapFieldReflection( + int number) { switch (number) { case 3: return internalGetResourceTags(); @@ -70,7 +74,7 @@ protected com.google.protobuf.MapField internalGetMapField(int number) { } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.cloud.audit.AuditLogProto .internal_static_google_cloud_audit_OrgPolicyViolationInfo_fieldAccessorTable @@ -79,8 +83,10 @@ protected com.google.protobuf.MapField internalGetMapField(int number) { com.google.cloud.audit.OrgPolicyViolationInfo.Builder.class); } + private int bitField0_; public static final int PAYLOAD_FIELD_NUMBER = 1; private com.google.protobuf.Struct payload_; + /** * * @@ -96,8 +102,9 @@ protected com.google.protobuf.MapField internalGetMapField(int number) { */ @java.lang.Override public boolean hasPayload() { - return payload_ != null; + return ((bitField0_ & 0x00000001) != 0); } + /** * * @@ -115,6 +122,7 @@ public boolean hasPayload() { public com.google.protobuf.Struct getPayload() { return payload_ == null ? com.google.protobuf.Struct.getDefaultInstance() : payload_; } + /** * * @@ -128,11 +136,14 @@ public com.google.protobuf.Struct getPayload() { */ @java.lang.Override public com.google.protobuf.StructOrBuilder getPayloadOrBuilder() { - return getPayload(); + return payload_ == null ? com.google.protobuf.Struct.getDefaultInstance() : payload_; } public static final int RESOURCE_TYPE_FIELD_NUMBER = 2; - private volatile java.lang.Object resourceType_; + + @SuppressWarnings("serial") + private volatile java.lang.Object resourceType_ = ""; + /** * * @@ -157,6 +168,7 @@ public java.lang.String getResourceType() { return s; } } + /** * * @@ -195,6 +207,7 @@ private static final class ResourceTagsDefaultEntryHolder { ""); } + @SuppressWarnings("serial") private com.google.protobuf.MapField resourceTags_; private com.google.protobuf.MapField @@ -209,6 +222,7 @@ private static final class ResourceTagsDefaultEntryHolder { public int getResourceTagsCount() { return internalGetResourceTags().getMap().size(); } + /** * * @@ -216,6 +230,7 @@ public int getResourceTagsCount() { * Optional. Tags referenced on the resource at the time of evaluation. These also * include the federated tags, if they are supplied in the CheckOrgPolicy * or CheckCustomConstraints Requests. + * * Optional field as of now. These tags are the Cloud tags that are * available on the resource during the policy evaluation and will * be available as part of the OrgPolicy check response for logging purposes. @@ -231,12 +246,14 @@ public boolean containsResourceTags(java.lang.String key) { } return internalGetResourceTags().getMap().containsKey(key); } + /** Use {@link #getResourceTagsMap()} instead. */ @java.lang.Override @java.lang.Deprecated public java.util.Map getResourceTags() { return getResourceTagsMap(); } + /** * * @@ -244,6 +261,7 @@ public java.util.Map getResourceTags() { * Optional. Tags referenced on the resource at the time of evaluation. These also * include the federated tags, if they are supplied in the CheckOrgPolicy * or CheckCustomConstraints Requests. + * * Optional field as of now. These tags are the Cloud tags that are * available on the resource during the policy evaluation and will * be available as part of the OrgPolicy check response for logging purposes. @@ -256,6 +274,7 @@ public java.util.Map getResourceTags() { public java.util.Map getResourceTagsMap() { return internalGetResourceTags().getMap(); } + /** * * @@ -263,6 +282,7 @@ public java.util.Map getResourceTagsMap() { * Optional. Tags referenced on the resource at the time of evaluation. These also * include the federated tags, if they are supplied in the CheckOrgPolicy * or CheckCustomConstraints Requests. + * * Optional field as of now. These tags are the Cloud tags that are * available on the resource during the policy evaluation and will * be available as part of the OrgPolicy check response for logging purposes. @@ -272,14 +292,17 @@ public java.util.Map getResourceTagsMap() { * */ @java.lang.Override - public java.lang.String getResourceTagsOrDefault( - java.lang.String key, java.lang.String defaultValue) { + public /* nullable */ java.lang.String getResourceTagsOrDefault( + java.lang.String key, + /* nullable */ + java.lang.String defaultValue) { if (key == null) { throw new NullPointerException("map key"); } java.util.Map map = internalGetResourceTags().getMap(); return map.containsKey(key) ? map.get(key) : defaultValue; } + /** * * @@ -287,6 +310,7 @@ public java.lang.String getResourceTagsOrDefault( * Optional. Tags referenced on the resource at the time of evaluation. These also * include the federated tags, if they are supplied in the CheckOrgPolicy * or CheckCustomConstraints Requests. + * * Optional field as of now. These tags are the Cloud tags that are * available on the resource during the policy evaluation and will * be available as part of the OrgPolicy check response for logging purposes. @@ -308,7 +332,10 @@ public java.lang.String getResourceTagsOrThrow(java.lang.String key) { } public static final int VIOLATION_INFO_FIELD_NUMBER = 4; + + @SuppressWarnings("serial") private java.util.List violationInfo_; + /** * * @@ -324,6 +351,7 @@ public java.lang.String getResourceTagsOrThrow(java.lang.String key) { public java.util.List getViolationInfoList() { return violationInfo_; } + /** * * @@ -340,6 +368,7 @@ public java.util.List getViolationInfoList getViolationInfoOrBuilderList() { return violationInfo_; } + /** * * @@ -355,6 +384,7 @@ public java.util.List getViolationInfoList public int getViolationInfoCount() { return violationInfo_.size(); } + /** * * @@ -370,6 +400,7 @@ public int getViolationInfoCount() { public com.google.cloud.audit.ViolationInfo getViolationInfo(int index) { return violationInfo_.get(index); } + /** * * @@ -400,13 +431,13 @@ public final boolean isInitialized() { @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (payload_ != null) { + if (((bitField0_ & 0x00000001) != 0)) { output.writeMessage(1, getPayload()); } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(resourceType_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 2, resourceType_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(resourceType_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, resourceType_); } - com.google.protobuf.GeneratedMessageV3.serializeStringMapTo( + com.google.protobuf.GeneratedMessage.serializeStringMapTo( output, internalGetResourceTags(), ResourceTagsDefaultEntryHolder.defaultEntry, 3); for (int i = 0; i < violationInfo_.size(); i++) { output.writeMessage(4, violationInfo_.get(i)); @@ -420,11 +451,11 @@ public int getSerializedSize() { if (size != -1) return size; size = 0; - if (payload_ != null) { + if (((bitField0_ & 0x00000001) != 0)) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getPayload()); } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(resourceType_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, resourceType_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(resourceType_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, resourceType_); } for (java.util.Map.Entry entry : internalGetResourceTags().getMap().entrySet()) { @@ -529,38 +560,38 @@ public static com.google.cloud.audit.OrgPolicyViolationInfo parseFrom( public static com.google.cloud.audit.OrgPolicyViolationInfo parseFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); } public static com.google.cloud.audit.OrgPolicyViolationInfo parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } public static com.google.cloud.audit.OrgPolicyViolationInfo parseDelimitedFrom( java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); } public static com.google.cloud.audit.OrgPolicyViolationInfo parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( PARSER, input, extensionRegistry); } public static com.google.cloud.audit.OrgPolicyViolationInfo parseFrom( com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); } public static com.google.cloud.audit.OrgPolicyViolationInfo parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } @@ -583,10 +614,11 @@ public Builder toBuilder() { } @java.lang.Override - protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { Builder builder = new Builder(parent); return builder; } + /** * * @@ -596,7 +628,7 @@ protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.Build * * Protobuf type {@code google.cloud.audit.OrgPolicyViolationInfo} */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder implements // @@protoc_insertion_point(builder_implements:google.cloud.audit.OrgPolicyViolationInfo) com.google.cloud.audit.OrgPolicyViolationInfoOrBuilder { @@ -606,7 +638,8 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } @SuppressWarnings({"rawtypes"}) - protected com.google.protobuf.MapField internalGetMapField(int number) { + protected com.google.protobuf.MapFieldReflectionAccessor internalGetMapFieldReflection( + int number) { switch (number) { case 3: return internalGetResourceTags(); @@ -616,7 +649,8 @@ protected com.google.protobuf.MapField internalGetMapField(int number) { } @SuppressWarnings({"rawtypes"}) - protected com.google.protobuf.MapField internalGetMutableMapField(int number) { + protected com.google.protobuf.MapFieldReflectionAccessor internalGetMutableMapFieldReflection( + int number) { switch (number) { case 3: return internalGetMutableResourceTags(); @@ -626,7 +660,7 @@ protected com.google.protobuf.MapField internalGetMutableMapField(int number) { } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.cloud.audit.AuditLogProto .internal_static_google_cloud_audit_OrgPolicyViolationInfo_fieldAccessorTable @@ -636,23 +670,32 @@ protected com.google.protobuf.MapField internalGetMutableMapField(int number) { } // Construct using com.google.cloud.audit.OrgPolicyViolationInfo.newBuilder() - private Builder() {} + private Builder() { + maybeForceBuilderInitialization(); + } - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetPayloadFieldBuilder(); + internalGetViolationInfoFieldBuilder(); + } } @java.lang.Override public Builder clear() { super.clear(); - if (payloadBuilder_ == null) { - payload_ = null; - } else { - payload_ = null; + bitField0_ = 0; + payload_ = null; + if (payloadBuilder_ != null) { + payloadBuilder_.dispose(); payloadBuilder_ = null; } resourceType_ = ""; - internalGetMutableResourceTags().clear(); if (violationInfoBuilder_ == null) { violationInfo_ = java.util.Collections.emptyList(); @@ -660,7 +703,7 @@ public Builder clear() { violationInfo_ = null; violationInfoBuilder_.clear(); } - bitField0_ = (bitField0_ & ~0x00000002); + bitField0_ = (bitField0_ & ~0x00000008); return this; } @@ -688,59 +731,41 @@ public com.google.cloud.audit.OrgPolicyViolationInfo build() { public com.google.cloud.audit.OrgPolicyViolationInfo buildPartial() { com.google.cloud.audit.OrgPolicyViolationInfo result = new com.google.cloud.audit.OrgPolicyViolationInfo(this); - int from_bitField0_ = bitField0_; - if (payloadBuilder_ == null) { - result.payload_ = payload_; - } else { - result.payload_ = payloadBuilder_.build(); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); } - result.resourceType_ = resourceType_; - result.resourceTags_ = internalGetResourceTags(); - result.resourceTags_.makeImmutable(); + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields(com.google.cloud.audit.OrgPolicyViolationInfo result) { if (violationInfoBuilder_ == null) { - if (((bitField0_ & 0x00000002) != 0)) { + if (((bitField0_ & 0x00000008) != 0)) { violationInfo_ = java.util.Collections.unmodifiableList(violationInfo_); - bitField0_ = (bitField0_ & ~0x00000002); + bitField0_ = (bitField0_ & ~0x00000008); } result.violationInfo_ = violationInfo_; } else { result.violationInfo_ = violationInfoBuilder_.build(); } - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.setField(field, value); } - @java.lang.Override - public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - - @java.lang.Override - public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.addRepeatedField(field, value); + private void buildPartial0(com.google.cloud.audit.OrgPolicyViolationInfo result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.payload_ = payloadBuilder_ == null ? payload_ : payloadBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.resourceType_ = resourceType_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.resourceTags_ = internalGetResourceTags(); + result.resourceTags_.makeImmutable(); + } + result.bitField0_ |= to_bitField0_; } @java.lang.Override @@ -760,14 +785,16 @@ public Builder mergeFrom(com.google.cloud.audit.OrgPolicyViolationInfo other) { } if (!other.getResourceType().isEmpty()) { resourceType_ = other.resourceType_; + bitField0_ |= 0x00000002; onChanged(); } internalGetMutableResourceTags().mergeFrom(other.internalGetResourceTags()); + bitField0_ |= 0x00000004; if (violationInfoBuilder_ == null) { if (!other.violationInfo_.isEmpty()) { if (violationInfo_.isEmpty()) { violationInfo_ = other.violationInfo_; - bitField0_ = (bitField0_ & ~0x00000002); + bitField0_ = (bitField0_ & ~0x00000008); } else { ensureViolationInfoIsMutable(); violationInfo_.addAll(other.violationInfo_); @@ -780,10 +807,10 @@ public Builder mergeFrom(com.google.cloud.audit.OrgPolicyViolationInfo other) { violationInfoBuilder_.dispose(); violationInfoBuilder_ = null; violationInfo_ = other.violationInfo_; - bitField0_ = (bitField0_ & ~0x00000002); + bitField0_ = (bitField0_ & ~0x00000008); violationInfoBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders - ? getViolationInfoFieldBuilder() + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders + ? internalGetViolationInfoFieldBuilder() : null; } else { violationInfoBuilder_.addAllMessages(other.violationInfo_); @@ -818,14 +845,14 @@ public Builder mergeFrom( break; case 10: { - input.readMessage(getPayloadFieldBuilder().getBuilder(), extensionRegistry); - + input.readMessage(internalGetPayloadFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000001; break; } // case 10 case 18: { resourceType_ = input.readStringRequireUtf8(); - + bitField0_ |= 0x00000002; break; } // case 18 case 26: @@ -837,6 +864,7 @@ public Builder mergeFrom( internalGetMutableResourceTags() .getMutableMap() .put(resourceTags__.getKey(), resourceTags__.getValue()); + bitField0_ |= 0x00000004; break; } // case 26 case 34: @@ -872,11 +900,12 @@ public Builder mergeFrom( private int bitField0_; private com.google.protobuf.Struct payload_; - private com.google.protobuf.SingleFieldBuilderV3< + private com.google.protobuf.SingleFieldBuilder< com.google.protobuf.Struct, com.google.protobuf.Struct.Builder, com.google.protobuf.StructOrBuilder> payloadBuilder_; + /** * * @@ -891,8 +920,9 @@ public Builder mergeFrom( * @return Whether the payload field is set. */ public boolean hasPayload() { - return payloadBuilder_ != null || payload_ != null; + return ((bitField0_ & 0x00000001) != 0); } + /** * * @@ -913,6 +943,7 @@ public com.google.protobuf.Struct getPayload() { return payloadBuilder_.getMessage(); } } + /** * * @@ -930,13 +961,14 @@ public Builder setPayload(com.google.protobuf.Struct value) { throw new NullPointerException(); } payload_ = value; - onChanged(); } else { payloadBuilder_.setMessage(value); } - + bitField0_ |= 0x00000001; + onChanged(); return this; } + /** * * @@ -951,13 +983,14 @@ public Builder setPayload(com.google.protobuf.Struct value) { public Builder setPayload(com.google.protobuf.Struct.Builder builderForValue) { if (payloadBuilder_ == null) { payload_ = builderForValue.build(); - onChanged(); } else { payloadBuilder_.setMessage(builderForValue.build()); } - + bitField0_ |= 0x00000001; + onChanged(); return this; } + /** * * @@ -971,19 +1004,23 @@ public Builder setPayload(com.google.protobuf.Struct.Builder builderForValue) { */ public Builder mergePayload(com.google.protobuf.Struct value) { if (payloadBuilder_ == null) { - if (payload_ != null) { - payload_ = - com.google.protobuf.Struct.newBuilder(payload_).mergeFrom(value).buildPartial(); + if (((bitField0_ & 0x00000001) != 0) + && payload_ != null + && payload_ != com.google.protobuf.Struct.getDefaultInstance()) { + getPayloadBuilder().mergeFrom(value); } else { payload_ = value; } - onChanged(); } else { payloadBuilder_.mergeFrom(value); } - + if (payload_ != null) { + bitField0_ |= 0x00000001; + onChanged(); + } return this; } + /** * * @@ -996,16 +1033,16 @@ public Builder mergePayload(com.google.protobuf.Struct value) { * .google.protobuf.Struct payload = 1 [(.google.api.field_behavior) = OPTIONAL]; */ public Builder clearPayload() { - if (payloadBuilder_ == null) { - payload_ = null; - onChanged(); - } else { - payload_ = null; + bitField0_ = (bitField0_ & ~0x00000001); + payload_ = null; + if (payloadBuilder_ != null) { + payloadBuilder_.dispose(); payloadBuilder_ = null; } - + onChanged(); return this; } + /** * * @@ -1018,10 +1055,11 @@ public Builder clearPayload() { * .google.protobuf.Struct payload = 1 [(.google.api.field_behavior) = OPTIONAL]; */ public com.google.protobuf.Struct.Builder getPayloadBuilder() { - + bitField0_ |= 0x00000001; onChanged(); - return getPayloadFieldBuilder().getBuilder(); + return internalGetPayloadFieldBuilder().getBuilder(); } + /** * * @@ -1040,6 +1078,7 @@ public com.google.protobuf.StructOrBuilder getPayloadOrBuilder() { return payload_ == null ? com.google.protobuf.Struct.getDefaultInstance() : payload_; } } + /** * * @@ -1051,14 +1090,14 @@ public com.google.protobuf.StructOrBuilder getPayloadOrBuilder() { * * .google.protobuf.Struct payload = 1 [(.google.api.field_behavior) = OPTIONAL]; */ - private com.google.protobuf.SingleFieldBuilderV3< + private com.google.protobuf.SingleFieldBuilder< com.google.protobuf.Struct, com.google.protobuf.Struct.Builder, com.google.protobuf.StructOrBuilder> - getPayloadFieldBuilder() { + internalGetPayloadFieldBuilder() { if (payloadBuilder_ == null) { payloadBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< + new com.google.protobuf.SingleFieldBuilder< com.google.protobuf.Struct, com.google.protobuf.Struct.Builder, com.google.protobuf.StructOrBuilder>( @@ -1069,6 +1108,7 @@ public com.google.protobuf.StructOrBuilder getPayloadOrBuilder() { } private java.lang.Object resourceType_ = ""; + /** * * @@ -1092,6 +1132,7 @@ public java.lang.String getResourceType() { return (java.lang.String) ref; } } + /** * * @@ -1115,6 +1156,7 @@ public com.google.protobuf.ByteString getResourceTypeBytes() { return (com.google.protobuf.ByteString) ref; } } + /** * * @@ -1132,11 +1174,12 @@ public Builder setResourceType(java.lang.String value) { if (value == null) { throw new NullPointerException(); } - resourceType_ = value; + bitField0_ |= 0x00000002; onChanged(); return this; } + /** * * @@ -1150,11 +1193,12 @@ public Builder setResourceType(java.lang.String value) { * @return This builder for chaining. */ public Builder clearResourceType() { - resourceType_ = getDefaultInstance().getResourceType(); + bitField0_ = (bitField0_ & ~0x00000002); onChanged(); return this; } + /** * * @@ -1173,8 +1217,8 @@ public Builder setResourceTypeBytes(com.google.protobuf.ByteString value) { throw new NullPointerException(); } checkByteStringIsUtf8(value); - resourceType_ = value; + bitField0_ |= 0x00000002; onChanged(); return this; } @@ -1192,8 +1236,6 @@ public Builder setResourceTypeBytes(com.google.protobuf.ByteString value) { private com.google.protobuf.MapField internalGetMutableResourceTags() { - onChanged(); - ; if (resourceTags_ == null) { resourceTags_ = com.google.protobuf.MapField.newMapField(ResourceTagsDefaultEntryHolder.defaultEntry); @@ -1201,12 +1243,15 @@ public Builder setResourceTypeBytes(com.google.protobuf.ByteString value) { if (!resourceTags_.isMutable()) { resourceTags_ = resourceTags_.copy(); } + bitField0_ |= 0x00000004; + onChanged(); return resourceTags_; } public int getResourceTagsCount() { return internalGetResourceTags().getMap().size(); } + /** * * @@ -1214,6 +1259,7 @@ public int getResourceTagsCount() { * Optional. Tags referenced on the resource at the time of evaluation. These also * include the federated tags, if they are supplied in the CheckOrgPolicy * or CheckCustomConstraints Requests. + * * Optional field as of now. These tags are the Cloud tags that are * available on the resource during the policy evaluation and will * be available as part of the OrgPolicy check response for logging purposes. @@ -1229,12 +1275,14 @@ public boolean containsResourceTags(java.lang.String key) { } return internalGetResourceTags().getMap().containsKey(key); } + /** Use {@link #getResourceTagsMap()} instead. */ @java.lang.Override @java.lang.Deprecated public java.util.Map getResourceTags() { return getResourceTagsMap(); } + /** * * @@ -1242,6 +1290,7 @@ public java.util.Map getResourceTags() { * Optional. Tags referenced on the resource at the time of evaluation. These also * include the federated tags, if they are supplied in the CheckOrgPolicy * or CheckCustomConstraints Requests. + * * Optional field as of now. These tags are the Cloud tags that are * available on the resource during the policy evaluation and will * be available as part of the OrgPolicy check response for logging purposes. @@ -1254,6 +1303,7 @@ public java.util.Map getResourceTags() { public java.util.Map getResourceTagsMap() { return internalGetResourceTags().getMap(); } + /** * * @@ -1261,6 +1311,7 @@ public java.util.Map getResourceTagsMap() { * Optional. Tags referenced on the resource at the time of evaluation. These also * include the federated tags, if they are supplied in the CheckOrgPolicy * or CheckCustomConstraints Requests. + * * Optional field as of now. These tags are the Cloud tags that are * available on the resource during the policy evaluation and will * be available as part of the OrgPolicy check response for logging purposes. @@ -1270,14 +1321,17 @@ public java.util.Map getResourceTagsMap() { * */ @java.lang.Override - public java.lang.String getResourceTagsOrDefault( - java.lang.String key, java.lang.String defaultValue) { + public /* nullable */ java.lang.String getResourceTagsOrDefault( + java.lang.String key, + /* nullable */ + java.lang.String defaultValue) { if (key == null) { throw new NullPointerException("map key"); } java.util.Map map = internalGetResourceTags().getMap(); return map.containsKey(key) ? map.get(key) : defaultValue; } + /** * * @@ -1285,6 +1339,7 @@ public java.lang.String getResourceTagsOrDefault( * Optional. Tags referenced on the resource at the time of evaluation. These also * include the federated tags, if they are supplied in the CheckOrgPolicy * or CheckCustomConstraints Requests. + * * Optional field as of now. These tags are the Cloud tags that are * available on the resource during the policy evaluation and will * be available as part of the OrgPolicy check response for logging purposes. @@ -1306,9 +1361,11 @@ public java.lang.String getResourceTagsOrThrow(java.lang.String key) { } public Builder clearResourceTags() { + bitField0_ = (bitField0_ & ~0x00000004); internalGetMutableResourceTags().getMutableMap().clear(); return this; } + /** * * @@ -1316,6 +1373,7 @@ public Builder clearResourceTags() { * Optional. Tags referenced on the resource at the time of evaluation. These also * include the federated tags, if they are supplied in the CheckOrgPolicy * or CheckCustomConstraints Requests. + * * Optional field as of now. These tags are the Cloud tags that are * available on the resource during the policy evaluation and will * be available as part of the OrgPolicy check response for logging purposes. @@ -1331,11 +1389,14 @@ public Builder removeResourceTags(java.lang.String key) { internalGetMutableResourceTags().getMutableMap().remove(key); return this; } + /** Use alternate mutation accessors instead. */ @java.lang.Deprecated public java.util.Map getMutableResourceTags() { + bitField0_ |= 0x00000004; return internalGetMutableResourceTags().getMutableMap(); } + /** * * @@ -1343,6 +1404,7 @@ public java.util.Map getMutableResourceTags( * Optional. Tags referenced on the resource at the time of evaluation. These also * include the federated tags, if they are supplied in the CheckOrgPolicy * or CheckCustomConstraints Requests. + * * Optional field as of now. These tags are the Cloud tags that are * available on the resource during the policy evaluation and will * be available as part of the OrgPolicy check response for logging purposes. @@ -1358,10 +1420,11 @@ public Builder putResourceTags(java.lang.String key, java.lang.String value) { if (value == null) { throw new NullPointerException("map value"); } - internalGetMutableResourceTags().getMutableMap().put(key, value); + bitField0_ |= 0x00000004; return this; } + /** * * @@ -1369,6 +1432,7 @@ public Builder putResourceTags(java.lang.String key, java.lang.String value) { * Optional. Tags referenced on the resource at the time of evaluation. These also * include the federated tags, if they are supplied in the CheckOrgPolicy * or CheckCustomConstraints Requests. + * * Optional field as of now. These tags are the Cloud tags that are * available on the resource during the policy evaluation and will * be available as part of the OrgPolicy check response for logging purposes. @@ -1379,6 +1443,7 @@ public Builder putResourceTags(java.lang.String key, java.lang.String value) { */ public Builder putAllResourceTags(java.util.Map values) { internalGetMutableResourceTags().getMutableMap().putAll(values); + bitField0_ |= 0x00000004; return this; } @@ -1386,14 +1451,14 @@ public Builder putAllResourceTags(java.util.Map(violationInfo_); - bitField0_ |= 0x00000002; + bitField0_ |= 0x00000008; } } - private com.google.protobuf.RepeatedFieldBuilderV3< + private com.google.protobuf.RepeatedFieldBuilder< com.google.cloud.audit.ViolationInfo, com.google.cloud.audit.ViolationInfo.Builder, com.google.cloud.audit.ViolationInfoOrBuilder> @@ -1417,6 +1482,7 @@ public java.util.List getViolationInfoList return violationInfoBuilder_.getMessageList(); } } + /** * * @@ -1435,6 +1501,7 @@ public int getViolationInfoCount() { return violationInfoBuilder_.getCount(); } } + /** * * @@ -1453,6 +1520,7 @@ public com.google.cloud.audit.ViolationInfo getViolationInfo(int index) { return violationInfoBuilder_.getMessage(index); } } + /** * * @@ -1477,6 +1545,7 @@ public Builder setViolationInfo(int index, com.google.cloud.audit.ViolationInfo } return this; } + /** * * @@ -1499,6 +1568,7 @@ public Builder setViolationInfo( } return this; } + /** * * @@ -1523,6 +1593,7 @@ public Builder addViolationInfo(com.google.cloud.audit.ViolationInfo value) { } return this; } + /** * * @@ -1547,6 +1618,7 @@ public Builder addViolationInfo(int index, com.google.cloud.audit.ViolationInfo } return this; } + /** * * @@ -1568,6 +1640,7 @@ public Builder addViolationInfo(com.google.cloud.audit.ViolationInfo.Builder bui } return this; } + /** * * @@ -1590,6 +1663,7 @@ public Builder addViolationInfo( } return this; } + /** * * @@ -1612,6 +1686,7 @@ public Builder addAllViolationInfo( } return this; } + /** * * @@ -1626,13 +1701,14 @@ public Builder addAllViolationInfo( public Builder clearViolationInfo() { if (violationInfoBuilder_ == null) { violationInfo_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000002); + bitField0_ = (bitField0_ & ~0x00000008); onChanged(); } else { violationInfoBuilder_.clear(); } return this; } + /** * * @@ -1654,6 +1730,7 @@ public Builder removeViolationInfo(int index) { } return this; } + /** * * @@ -1666,8 +1743,9 @@ public Builder removeViolationInfo(int index) { * */ public com.google.cloud.audit.ViolationInfo.Builder getViolationInfoBuilder(int index) { - return getViolationInfoFieldBuilder().getBuilder(index); + return internalGetViolationInfoFieldBuilder().getBuilder(index); } + /** * * @@ -1686,6 +1764,7 @@ public com.google.cloud.audit.ViolationInfoOrBuilder getViolationInfoOrBuilder(i return violationInfoBuilder_.getMessageOrBuilder(index); } } + /** * * @@ -1705,6 +1784,7 @@ public com.google.cloud.audit.ViolationInfoOrBuilder getViolationInfoOrBuilder(i return java.util.Collections.unmodifiableList(violationInfo_); } } + /** * * @@ -1717,9 +1797,10 @@ public com.google.cloud.audit.ViolationInfoOrBuilder getViolationInfoOrBuilder(i * */ public com.google.cloud.audit.ViolationInfo.Builder addViolationInfoBuilder() { - return getViolationInfoFieldBuilder() + return internalGetViolationInfoFieldBuilder() .addBuilder(com.google.cloud.audit.ViolationInfo.getDefaultInstance()); } + /** * * @@ -1732,9 +1813,10 @@ public com.google.cloud.audit.ViolationInfo.Builder addViolationInfoBuilder() { * */ public com.google.cloud.audit.ViolationInfo.Builder addViolationInfoBuilder(int index) { - return getViolationInfoFieldBuilder() + return internalGetViolationInfoFieldBuilder() .addBuilder(index, com.google.cloud.audit.ViolationInfo.getDefaultInstance()); } + /** * * @@ -1748,22 +1830,22 @@ public com.google.cloud.audit.ViolationInfo.Builder addViolationInfoBuilder(int */ public java.util.List getViolationInfoBuilderList() { - return getViolationInfoFieldBuilder().getBuilderList(); + return internalGetViolationInfoFieldBuilder().getBuilderList(); } - private com.google.protobuf.RepeatedFieldBuilderV3< + private com.google.protobuf.RepeatedFieldBuilder< com.google.cloud.audit.ViolationInfo, com.google.cloud.audit.ViolationInfo.Builder, com.google.cloud.audit.ViolationInfoOrBuilder> - getViolationInfoFieldBuilder() { + internalGetViolationInfoFieldBuilder() { if (violationInfoBuilder_ == null) { violationInfoBuilder_ = - new com.google.protobuf.RepeatedFieldBuilderV3< + new com.google.protobuf.RepeatedFieldBuilder< com.google.cloud.audit.ViolationInfo, com.google.cloud.audit.ViolationInfo.Builder, com.google.cloud.audit.ViolationInfoOrBuilder>( violationInfo_, - ((bitField0_ & 0x00000002) != 0), + ((bitField0_ & 0x00000008) != 0), getParentForChildren(), isClean()); violationInfo_ = null; @@ -1771,17 +1853,6 @@ public com.google.cloud.audit.ViolationInfo.Builder addViolationInfoBuilder(int return violationInfoBuilder_; } - @java.lang.Override - public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - // @@protoc_insertion_point(builder_scope:google.cloud.audit.OrgPolicyViolationInfo) } diff --git a/java-common-protos/proto-google-common-protos/src/main/java/com/google/cloud/audit/OrgPolicyViolationInfoOrBuilder.java b/java-common-protos/proto-google-common-protos/src/main/java/com/google/cloud/audit/OrgPolicyViolationInfoOrBuilder.java index a41399ce41..0d2670e210 100644 --- a/java-common-protos/proto-google-common-protos/src/main/java/com/google/cloud/audit/OrgPolicyViolationInfoOrBuilder.java +++ b/java-common-protos/proto-google-common-protos/src/main/java/com/google/cloud/audit/OrgPolicyViolationInfoOrBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,10 +14,13 @@ * limitations under the License. */ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: google/cloud/audit/audit_log.proto +// Protobuf Java Version: 4.33.2 package com.google.cloud.audit; +@com.google.protobuf.Generated public interface OrgPolicyViolationInfoOrBuilder extends // @@protoc_insertion_point(interface_extends:google.cloud.audit.OrgPolicyViolationInfo) @@ -37,6 +40,7 @@ public interface OrgPolicyViolationInfoOrBuilder * @return Whether the payload field is set. */ boolean hasPayload(); + /** * * @@ -51,6 +55,7 @@ public interface OrgPolicyViolationInfoOrBuilder * @return The payload. */ com.google.protobuf.Struct getPayload(); + /** * * @@ -77,6 +82,7 @@ public interface OrgPolicyViolationInfoOrBuilder * @return The resourceType. */ java.lang.String getResourceType(); + /** * * @@ -98,6 +104,7 @@ public interface OrgPolicyViolationInfoOrBuilder * Optional. Tags referenced on the resource at the time of evaluation. These also * include the federated tags, if they are supplied in the CheckOrgPolicy * or CheckCustomConstraints Requests. + * * Optional field as of now. These tags are the Cloud tags that are * available on the resource during the policy evaluation and will * be available as part of the OrgPolicy check response for logging purposes. @@ -107,6 +114,7 @@ public interface OrgPolicyViolationInfoOrBuilder * */ int getResourceTagsCount(); + /** * * @@ -114,6 +122,7 @@ public interface OrgPolicyViolationInfoOrBuilder * Optional. Tags referenced on the resource at the time of evaluation. These also * include the federated tags, if they are supplied in the CheckOrgPolicy * or CheckCustomConstraints Requests. + * * Optional field as of now. These tags are the Cloud tags that are * available on the resource during the policy evaluation and will * be available as part of the OrgPolicy check response for logging purposes. @@ -123,9 +132,11 @@ public interface OrgPolicyViolationInfoOrBuilder * */ boolean containsResourceTags(java.lang.String key); + /** Use {@link #getResourceTagsMap()} instead. */ @java.lang.Deprecated java.util.Map getResourceTags(); + /** * * @@ -133,6 +144,7 @@ public interface OrgPolicyViolationInfoOrBuilder * Optional. Tags referenced on the resource at the time of evaluation. These also * include the federated tags, if they are supplied in the CheckOrgPolicy * or CheckCustomConstraints Requests. + * * Optional field as of now. These tags are the Cloud tags that are * available on the resource during the policy evaluation and will * be available as part of the OrgPolicy check response for logging purposes. @@ -142,6 +154,7 @@ public interface OrgPolicyViolationInfoOrBuilder * */ java.util.Map getResourceTagsMap(); + /** * * @@ -149,6 +162,7 @@ public interface OrgPolicyViolationInfoOrBuilder * Optional. Tags referenced on the resource at the time of evaluation. These also * include the federated tags, if they are supplied in the CheckOrgPolicy * or CheckCustomConstraints Requests. + * * Optional field as of now. These tags are the Cloud tags that are * available on the resource during the policy evaluation and will * be available as part of the OrgPolicy check response for logging purposes. @@ -157,12 +171,12 @@ public interface OrgPolicyViolationInfoOrBuilder * map<string, string> resource_tags = 3 [(.google.api.field_behavior) = OPTIONAL]; * */ - /* nullable */ java.lang.String getResourceTagsOrDefault( java.lang.String key, /* nullable */ java.lang.String defaultValue); + /** * * @@ -170,6 +184,7 @@ java.lang.String getResourceTagsOrDefault( * Optional. Tags referenced on the resource at the time of evaluation. These also * include the federated tags, if they are supplied in the CheckOrgPolicy * or CheckCustomConstraints Requests. + * * Optional field as of now. These tags are the Cloud tags that are * available on the resource during the policy evaluation and will * be available as part of the OrgPolicy check response for logging purposes. @@ -192,6 +207,7 @@ java.lang.String getResourceTagsOrDefault( * */ java.util.List getViolationInfoList(); + /** * * @@ -204,6 +220,7 @@ java.lang.String getResourceTagsOrDefault( * */ com.google.cloud.audit.ViolationInfo getViolationInfo(int index); + /** * * @@ -216,6 +233,7 @@ java.lang.String getResourceTagsOrDefault( * */ int getViolationInfoCount(); + /** * * @@ -229,6 +247,7 @@ java.lang.String getResourceTagsOrDefault( */ java.util.List getViolationInfoOrBuilderList(); + /** * * diff --git a/java-common-protos/proto-google-common-protos/src/main/java/com/google/cloud/audit/PolicyViolationInfo.java b/java-common-protos/proto-google-common-protos/src/main/java/com/google/cloud/audit/PolicyViolationInfo.java index 4f8d213fb3..1ab64e30bd 100644 --- a/java-common-protos/proto-google-common-protos/src/main/java/com/google/cloud/audit/PolicyViolationInfo.java +++ b/java-common-protos/proto-google-common-protos/src/main/java/com/google/cloud/audit/PolicyViolationInfo.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,9 @@ * limitations under the License. */ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: google/cloud/audit/audit_log.proto +// Protobuf Java Version: 4.33.2 package com.google.cloud.audit; @@ -27,36 +29,37 @@ * * Protobuf type {@code google.cloud.audit.PolicyViolationInfo} */ -public final class PolicyViolationInfo extends com.google.protobuf.GeneratedMessageV3 +@com.google.protobuf.Generated +public final class PolicyViolationInfo extends com.google.protobuf.GeneratedMessage implements // @@protoc_insertion_point(message_implements:google.cloud.audit.PolicyViolationInfo) PolicyViolationInfoOrBuilder { private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "PolicyViolationInfo"); + } + // Use PolicyViolationInfo.newBuilder() to construct. - private PolicyViolationInfo(com.google.protobuf.GeneratedMessageV3.Builder builder) { + private PolicyViolationInfo(com.google.protobuf.GeneratedMessage.Builder builder) { super(builder); } private PolicyViolationInfo() {} - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new PolicyViolationInfo(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.cloud.audit.AuditLogProto .internal_static_google_cloud_audit_PolicyViolationInfo_descriptor; } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.cloud.audit.AuditLogProto .internal_static_google_cloud_audit_PolicyViolationInfo_fieldAccessorTable @@ -65,8 +68,10 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { com.google.cloud.audit.PolicyViolationInfo.Builder.class); } + private int bitField0_; public static final int ORG_POLICY_VIOLATION_INFO_FIELD_NUMBER = 1; private com.google.cloud.audit.OrgPolicyViolationInfo orgPolicyViolationInfo_; + /** * * @@ -80,8 +85,9 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { */ @java.lang.Override public boolean hasOrgPolicyViolationInfo() { - return orgPolicyViolationInfo_ != null; + return ((bitField0_ & 0x00000001) != 0); } + /** * * @@ -99,6 +105,7 @@ public com.google.cloud.audit.OrgPolicyViolationInfo getOrgPolicyViolationInfo() ? com.google.cloud.audit.OrgPolicyViolationInfo.getDefaultInstance() : orgPolicyViolationInfo_; } + /** * * @@ -111,7 +118,9 @@ public com.google.cloud.audit.OrgPolicyViolationInfo getOrgPolicyViolationInfo() @java.lang.Override public com.google.cloud.audit.OrgPolicyViolationInfoOrBuilder getOrgPolicyViolationInfoOrBuilder() { - return getOrgPolicyViolationInfo(); + return orgPolicyViolationInfo_ == null + ? com.google.cloud.audit.OrgPolicyViolationInfo.getDefaultInstance() + : orgPolicyViolationInfo_; } private byte memoizedIsInitialized = -1; @@ -128,7 +137,7 @@ public final boolean isInitialized() { @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (orgPolicyViolationInfo_ != null) { + if (((bitField0_ & 0x00000001) != 0)) { output.writeMessage(1, getOrgPolicyViolationInfo()); } getUnknownFields().writeTo(output); @@ -140,7 +149,7 @@ public int getSerializedSize() { if (size != -1) return size; size = 0; - if (orgPolicyViolationInfo_ != null) { + if (((bitField0_ & 0x00000001) != 0)) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getOrgPolicyViolationInfo()); } @@ -221,38 +230,38 @@ public static com.google.cloud.audit.PolicyViolationInfo parseFrom( public static com.google.cloud.audit.PolicyViolationInfo parseFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); } public static com.google.cloud.audit.PolicyViolationInfo parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } public static com.google.cloud.audit.PolicyViolationInfo parseDelimitedFrom( java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); } public static com.google.cloud.audit.PolicyViolationInfo parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( PARSER, input, extensionRegistry); } public static com.google.cloud.audit.PolicyViolationInfo parseFrom( com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); } public static com.google.cloud.audit.PolicyViolationInfo parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } @@ -275,10 +284,11 @@ public Builder toBuilder() { } @java.lang.Override - protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { Builder builder = new Builder(parent); return builder; } + /** * * @@ -288,7 +298,7 @@ protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.Build * * Protobuf type {@code google.cloud.audit.PolicyViolationInfo} */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder implements // @@protoc_insertion_point(builder_implements:google.cloud.audit.PolicyViolationInfo) com.google.cloud.audit.PolicyViolationInfoOrBuilder { @@ -298,7 +308,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.cloud.audit.AuditLogProto .internal_static_google_cloud_audit_PolicyViolationInfo_fieldAccessorTable @@ -308,19 +318,28 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } // Construct using com.google.cloud.audit.PolicyViolationInfo.newBuilder() - private Builder() {} + private Builder() { + maybeForceBuilderInitialization(); + } - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetOrgPolicyViolationInfoFieldBuilder(); + } } @java.lang.Override public Builder clear() { super.clear(); - if (orgPolicyViolationInfoBuilder_ == null) { - orgPolicyViolationInfo_ = null; - } else { - orgPolicyViolationInfo_ = null; + bitField0_ = 0; + orgPolicyViolationInfo_ = null; + if (orgPolicyViolationInfoBuilder_ != null) { + orgPolicyViolationInfoBuilder_.dispose(); orgPolicyViolationInfoBuilder_ = null; } return this; @@ -350,46 +369,24 @@ public com.google.cloud.audit.PolicyViolationInfo build() { public com.google.cloud.audit.PolicyViolationInfo buildPartial() { com.google.cloud.audit.PolicyViolationInfo result = new com.google.cloud.audit.PolicyViolationInfo(this); - if (orgPolicyViolationInfoBuilder_ == null) { - result.orgPolicyViolationInfo_ = orgPolicyViolationInfo_; - } else { - result.orgPolicyViolationInfo_ = orgPolicyViolationInfoBuilder_.build(); + if (bitField0_ != 0) { + buildPartial0(result); } 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); + private void buildPartial0(com.google.cloud.audit.PolicyViolationInfo result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.orgPolicyViolationInfo_ = + orgPolicyViolationInfoBuilder_ == null + ? orgPolicyViolationInfo_ + : orgPolicyViolationInfoBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + result.bitField0_ |= to_bitField0_; } @java.lang.Override @@ -436,8 +433,9 @@ public Builder mergeFrom( case 10: { input.readMessage( - getOrgPolicyViolationInfoFieldBuilder().getBuilder(), extensionRegistry); - + internalGetOrgPolicyViolationInfoFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00000001; break; } // case 10 default: @@ -457,12 +455,15 @@ public Builder mergeFrom( return this; } + private int bitField0_; + private com.google.cloud.audit.OrgPolicyViolationInfo orgPolicyViolationInfo_; - private com.google.protobuf.SingleFieldBuilderV3< + private com.google.protobuf.SingleFieldBuilder< com.google.cloud.audit.OrgPolicyViolationInfo, com.google.cloud.audit.OrgPolicyViolationInfo.Builder, com.google.cloud.audit.OrgPolicyViolationInfoOrBuilder> orgPolicyViolationInfoBuilder_; + /** * * @@ -475,8 +476,9 @@ public Builder mergeFrom( * @return Whether the orgPolicyViolationInfo field is set. */ public boolean hasOrgPolicyViolationInfo() { - return orgPolicyViolationInfoBuilder_ != null || orgPolicyViolationInfo_ != null; + return ((bitField0_ & 0x00000001) != 0); } + /** * * @@ -497,6 +499,7 @@ public com.google.cloud.audit.OrgPolicyViolationInfo getOrgPolicyViolationInfo() return orgPolicyViolationInfoBuilder_.getMessage(); } } + /** * * @@ -512,13 +515,14 @@ public Builder setOrgPolicyViolationInfo(com.google.cloud.audit.OrgPolicyViolati throw new NullPointerException(); } orgPolicyViolationInfo_ = value; - onChanged(); } else { orgPolicyViolationInfoBuilder_.setMessage(value); } - + bitField0_ |= 0x00000001; + onChanged(); return this; } + /** * * @@ -532,13 +536,14 @@ public Builder setOrgPolicyViolationInfo( com.google.cloud.audit.OrgPolicyViolationInfo.Builder builderForValue) { if (orgPolicyViolationInfoBuilder_ == null) { orgPolicyViolationInfo_ = builderForValue.build(); - onChanged(); } else { orgPolicyViolationInfoBuilder_.setMessage(builderForValue.build()); } - + bitField0_ |= 0x00000001; + onChanged(); return this; } + /** * * @@ -551,21 +556,24 @@ public Builder setOrgPolicyViolationInfo( public Builder mergeOrgPolicyViolationInfo( com.google.cloud.audit.OrgPolicyViolationInfo value) { if (orgPolicyViolationInfoBuilder_ == null) { - if (orgPolicyViolationInfo_ != null) { - orgPolicyViolationInfo_ = - com.google.cloud.audit.OrgPolicyViolationInfo.newBuilder(orgPolicyViolationInfo_) - .mergeFrom(value) - .buildPartial(); + if (((bitField0_ & 0x00000001) != 0) + && orgPolicyViolationInfo_ != null + && orgPolicyViolationInfo_ + != com.google.cloud.audit.OrgPolicyViolationInfo.getDefaultInstance()) { + getOrgPolicyViolationInfoBuilder().mergeFrom(value); } else { orgPolicyViolationInfo_ = value; } - onChanged(); } else { orgPolicyViolationInfoBuilder_.mergeFrom(value); } - + if (orgPolicyViolationInfo_ != null) { + bitField0_ |= 0x00000001; + onChanged(); + } return this; } + /** * * @@ -576,16 +584,16 @@ public Builder mergeOrgPolicyViolationInfo( * .google.cloud.audit.OrgPolicyViolationInfo org_policy_violation_info = 1; */ public Builder clearOrgPolicyViolationInfo() { - if (orgPolicyViolationInfoBuilder_ == null) { - orgPolicyViolationInfo_ = null; - onChanged(); - } else { - orgPolicyViolationInfo_ = null; + bitField0_ = (bitField0_ & ~0x00000001); + orgPolicyViolationInfo_ = null; + if (orgPolicyViolationInfoBuilder_ != null) { + orgPolicyViolationInfoBuilder_.dispose(); orgPolicyViolationInfoBuilder_ = null; } - + onChanged(); return this; } + /** * * @@ -597,10 +605,11 @@ public Builder clearOrgPolicyViolationInfo() { */ public com.google.cloud.audit.OrgPolicyViolationInfo.Builder getOrgPolicyViolationInfoBuilder() { - + bitField0_ |= 0x00000001; onChanged(); - return getOrgPolicyViolationInfoFieldBuilder().getBuilder(); + return internalGetOrgPolicyViolationInfoFieldBuilder().getBuilder(); } + /** * * @@ -620,6 +629,7 @@ public Builder clearOrgPolicyViolationInfo() { : orgPolicyViolationInfo_; } } + /** * * @@ -629,14 +639,14 @@ public Builder clearOrgPolicyViolationInfo() { * * .google.cloud.audit.OrgPolicyViolationInfo org_policy_violation_info = 1; */ - private com.google.protobuf.SingleFieldBuilderV3< + private com.google.protobuf.SingleFieldBuilder< com.google.cloud.audit.OrgPolicyViolationInfo, com.google.cloud.audit.OrgPolicyViolationInfo.Builder, com.google.cloud.audit.OrgPolicyViolationInfoOrBuilder> - getOrgPolicyViolationInfoFieldBuilder() { + internalGetOrgPolicyViolationInfoFieldBuilder() { if (orgPolicyViolationInfoBuilder_ == null) { orgPolicyViolationInfoBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< + new com.google.protobuf.SingleFieldBuilder< com.google.cloud.audit.OrgPolicyViolationInfo, com.google.cloud.audit.OrgPolicyViolationInfo.Builder, com.google.cloud.audit.OrgPolicyViolationInfoOrBuilder>( @@ -646,17 +656,6 @@ public Builder clearOrgPolicyViolationInfo() { return orgPolicyViolationInfoBuilder_; } - @java.lang.Override - public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - // @@protoc_insertion_point(builder_scope:google.cloud.audit.PolicyViolationInfo) } diff --git a/java-common-protos/proto-google-common-protos/src/main/java/com/google/cloud/audit/PolicyViolationInfoOrBuilder.java b/java-common-protos/proto-google-common-protos/src/main/java/com/google/cloud/audit/PolicyViolationInfoOrBuilder.java index c0da04a1ae..33f24869af 100644 --- a/java-common-protos/proto-google-common-protos/src/main/java/com/google/cloud/audit/PolicyViolationInfoOrBuilder.java +++ b/java-common-protos/proto-google-common-protos/src/main/java/com/google/cloud/audit/PolicyViolationInfoOrBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,10 +14,13 @@ * limitations under the License. */ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: google/cloud/audit/audit_log.proto +// Protobuf Java Version: 4.33.2 package com.google.cloud.audit; +@com.google.protobuf.Generated public interface PolicyViolationInfoOrBuilder extends // @@protoc_insertion_point(interface_extends:google.cloud.audit.PolicyViolationInfo) @@ -35,6 +38,7 @@ public interface PolicyViolationInfoOrBuilder * @return Whether the orgPolicyViolationInfo field is set. */ boolean hasOrgPolicyViolationInfo(); + /** * * @@ -47,6 +51,7 @@ public interface PolicyViolationInfoOrBuilder * @return The orgPolicyViolationInfo. */ com.google.cloud.audit.OrgPolicyViolationInfo getOrgPolicyViolationInfo(); + /** * * diff --git a/java-common-protos/proto-google-common-protos/src/main/java/com/google/cloud/audit/RequestMetadata.java b/java-common-protos/proto-google-common-protos/src/main/java/com/google/cloud/audit/RequestMetadata.java index a9789399ec..93f3322441 100644 --- a/java-common-protos/proto-google-common-protos/src/main/java/com/google/cloud/audit/RequestMetadata.java +++ b/java-common-protos/proto-google-common-protos/src/main/java/com/google/cloud/audit/RequestMetadata.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,9 @@ * limitations under the License. */ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: google/cloud/audit/audit_log.proto +// Protobuf Java Version: 4.33.2 package com.google.cloud.audit; @@ -27,13 +29,25 @@ * * Protobuf type {@code google.cloud.audit.RequestMetadata} */ -public final class RequestMetadata extends com.google.protobuf.GeneratedMessageV3 +@com.google.protobuf.Generated +public final class RequestMetadata extends com.google.protobuf.GeneratedMessage implements // @@protoc_insertion_point(message_implements:google.cloud.audit.RequestMetadata) RequestMetadataOrBuilder { private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "RequestMetadata"); + } + // Use RequestMetadata.newBuilder() to construct. - private RequestMetadata(com.google.protobuf.GeneratedMessageV3.Builder builder) { + private RequestMetadata(com.google.protobuf.GeneratedMessage.Builder builder) { super(builder); } @@ -43,24 +57,13 @@ private RequestMetadata() { callerNetwork_ = ""; } - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new RequestMetadata(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.cloud.audit.AuditLogProto .internal_static_google_cloud_audit_RequestMetadata_descriptor; } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.cloud.audit.AuditLogProto .internal_static_google_cloud_audit_RequestMetadata_fieldAccessorTable @@ -69,8 +72,12 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { com.google.cloud.audit.RequestMetadata.Builder.class); } + private int bitField0_; public static final int CALLER_IP_FIELD_NUMBER = 1; - private volatile java.lang.Object callerIp_; + + @SuppressWarnings("serial") + private volatile java.lang.Object callerIp_ = ""; + /** * * @@ -104,6 +111,7 @@ public java.lang.String getCallerIp() { return s; } } + /** * * @@ -139,7 +147,10 @@ public com.google.protobuf.ByteString getCallerIpBytes() { } public static final int CALLER_SUPPLIED_USER_AGENT_FIELD_NUMBER = 2; - private volatile java.lang.Object callerSuppliedUserAgent_; + + @SuppressWarnings("serial") + private volatile java.lang.Object callerSuppliedUserAgent_ = ""; + /** * * @@ -147,13 +158,14 @@ public com.google.protobuf.ByteString getCallerIpBytes() { * The user agent of the caller. * This information is not authenticated and should be treated accordingly. * For example: + * * + `google-api-python-client/1.4.0`: - * The request was made by the Google API client for Python. + * The request was made by the Google API client for Python. * + `Cloud SDK Command Line Tool apitools-client/1.0 gcloud/0.9.62`: - * The request was made by the Google Cloud SDK CLI (gcloud). + * The request was made by the Google Cloud SDK CLI (gcloud). * + `AppEngine-Google; (+http://code.google.com/appengine; appid: * s~my-project`: - * The request was made from the `my-project` App Engine app. + * The request was made from the `my-project` App Engine app. *
        * * string caller_supplied_user_agent = 2; @@ -172,6 +184,7 @@ public java.lang.String getCallerSuppliedUserAgent() { return s; } } + /** * * @@ -179,13 +192,14 @@ public java.lang.String getCallerSuppliedUserAgent() { * The user agent of the caller. * This information is not authenticated and should be treated accordingly. * For example: + * * + `google-api-python-client/1.4.0`: - * The request was made by the Google API client for Python. + * The request was made by the Google API client for Python. * + `Cloud SDK Command Line Tool apitools-client/1.0 gcloud/0.9.62`: - * The request was made by the Google Cloud SDK CLI (gcloud). + * The request was made by the Google Cloud SDK CLI (gcloud). * + `AppEngine-Google; (+http://code.google.com/appengine; appid: * s~my-project`: - * The request was made from the `my-project` App Engine app. + * The request was made from the `my-project` App Engine app. *
        * * string caller_supplied_user_agent = 2; @@ -206,7 +220,10 @@ public com.google.protobuf.ByteString getCallerSuppliedUserAgentBytes() { } public static final int CALLER_NETWORK_FIELD_NUMBER = 3; - private volatile java.lang.Object callerNetwork_; + + @SuppressWarnings("serial") + private volatile java.lang.Object callerNetwork_ = ""; + /** * * @@ -216,7 +233,8 @@ public com.google.protobuf.ByteString getCallerSuppliedUserAgentBytes() { * (or project) as the accessed resource. * See https://cloud.google.com/compute/docs/vpc/ for more information. * This is a scheme-less URI full resource name. For example: - * "//compute.googleapis.com/projects/PROJECT_ID/global/networks/NETWORK_ID" + * + * "//compute.googleapis.com/projects/PROJECT_ID/global/networks/NETWORK_ID" *
        * * string caller_network = 3; @@ -235,6 +253,7 @@ public java.lang.String getCallerNetwork() { return s; } } + /** * * @@ -244,7 +263,8 @@ public java.lang.String getCallerNetwork() { * (or project) as the accessed resource. * See https://cloud.google.com/compute/docs/vpc/ for more information. * This is a scheme-less URI full resource name. For example: - * "//compute.googleapis.com/projects/PROJECT_ID/global/networks/NETWORK_ID" + * + * "//compute.googleapis.com/projects/PROJECT_ID/global/networks/NETWORK_ID" *
        * * string caller_network = 3; @@ -266,6 +286,7 @@ public com.google.protobuf.ByteString getCallerNetworkBytes() { public static final int REQUEST_ATTRIBUTES_FIELD_NUMBER = 7; private com.google.rpc.context.AttributeContext.Request requestAttributes_; + /** * * @@ -273,6 +294,8 @@ public com.google.protobuf.ByteString getCallerNetworkBytes() { * Request attributes used in IAM condition evaluation. This field contains * request attributes like request time and access levels associated with * the request. + * + * * To get the whole view of the attributes used in IAM * condition evaluation, the user must also look into * `AuditLog.authentication_info.resource_attributes`. @@ -284,8 +307,9 @@ public com.google.protobuf.ByteString getCallerNetworkBytes() { */ @java.lang.Override public boolean hasRequestAttributes() { - return requestAttributes_ != null; + return ((bitField0_ & 0x00000001) != 0); } + /** * * @@ -293,6 +317,8 @@ public boolean hasRequestAttributes() { * Request attributes used in IAM condition evaluation. This field contains * request attributes like request time and access levels associated with * the request. + * + * * To get the whole view of the attributes used in IAM * condition evaluation, the user must also look into * `AuditLog.authentication_info.resource_attributes`. @@ -308,6 +334,7 @@ public com.google.rpc.context.AttributeContext.Request getRequestAttributes() { ? com.google.rpc.context.AttributeContext.Request.getDefaultInstance() : requestAttributes_; } + /** * * @@ -315,6 +342,8 @@ public com.google.rpc.context.AttributeContext.Request getRequestAttributes() { * Request attributes used in IAM condition evaluation. This field contains * request attributes like request time and access levels associated with * the request. + * + * * To get the whole view of the attributes used in IAM * condition evaluation, the user must also look into * `AuditLog.authentication_info.resource_attributes`. @@ -324,11 +353,14 @@ public com.google.rpc.context.AttributeContext.Request getRequestAttributes() { */ @java.lang.Override public com.google.rpc.context.AttributeContext.RequestOrBuilder getRequestAttributesOrBuilder() { - return getRequestAttributes(); + return requestAttributes_ == null + ? com.google.rpc.context.AttributeContext.Request.getDefaultInstance() + : requestAttributes_; } public static final int DESTINATION_ATTRIBUTES_FIELD_NUMBER = 8; private com.google.rpc.context.AttributeContext.Peer destinationAttributes_; + /** * * @@ -346,8 +378,9 @@ public com.google.rpc.context.AttributeContext.RequestOrBuilder getRequestAttrib */ @java.lang.Override public boolean hasDestinationAttributes() { - return destinationAttributes_ != null; + return ((bitField0_ & 0x00000002) != 0); } + /** * * @@ -369,6 +402,7 @@ public com.google.rpc.context.AttributeContext.Peer getDestinationAttributes() { ? com.google.rpc.context.AttributeContext.Peer.getDefaultInstance() : destinationAttributes_; } + /** * * @@ -384,7 +418,9 @@ public com.google.rpc.context.AttributeContext.Peer getDestinationAttributes() { */ @java.lang.Override public com.google.rpc.context.AttributeContext.PeerOrBuilder getDestinationAttributesOrBuilder() { - return getDestinationAttributes(); + return destinationAttributes_ == null + ? com.google.rpc.context.AttributeContext.Peer.getDefaultInstance() + : destinationAttributes_; } private byte memoizedIsInitialized = -1; @@ -401,19 +437,19 @@ public final boolean isInitialized() { @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(callerIp_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, callerIp_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(callerIp_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, callerIp_); } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(callerSuppliedUserAgent_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 2, callerSuppliedUserAgent_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(callerSuppliedUserAgent_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, callerSuppliedUserAgent_); } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(callerNetwork_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 3, callerNetwork_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(callerNetwork_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 3, callerNetwork_); } - if (requestAttributes_ != null) { + if (((bitField0_ & 0x00000001) != 0)) { output.writeMessage(7, getRequestAttributes()); } - if (destinationAttributes_ != null) { + if (((bitField0_ & 0x00000002) != 0)) { output.writeMessage(8, getDestinationAttributes()); } getUnknownFields().writeTo(output); @@ -425,19 +461,19 @@ public int getSerializedSize() { if (size != -1) return size; size = 0; - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(callerIp_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, callerIp_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(callerIp_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, callerIp_); } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(callerSuppliedUserAgent_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, callerSuppliedUserAgent_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(callerSuppliedUserAgent_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, callerSuppliedUserAgent_); } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(callerNetwork_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, callerNetwork_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(callerNetwork_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(3, callerNetwork_); } - if (requestAttributes_ != null) { + if (((bitField0_ & 0x00000001) != 0)) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(7, getRequestAttributes()); } - if (destinationAttributes_ != null) { + if (((bitField0_ & 0x00000002) != 0)) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(8, getDestinationAttributes()); } @@ -534,38 +570,38 @@ public static com.google.cloud.audit.RequestMetadata parseFrom( public static com.google.cloud.audit.RequestMetadata parseFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); } public static com.google.cloud.audit.RequestMetadata parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } public static com.google.cloud.audit.RequestMetadata parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); } public static com.google.cloud.audit.RequestMetadata parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( PARSER, input, extensionRegistry); } public static com.google.cloud.audit.RequestMetadata parseFrom( com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); } public static com.google.cloud.audit.RequestMetadata parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } @@ -588,10 +624,11 @@ public Builder toBuilder() { } @java.lang.Override - protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { Builder builder = new Builder(parent); return builder; } + /** * * @@ -601,7 +638,7 @@ protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.Build * * Protobuf type {@code google.cloud.audit.RequestMetadata} */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder implements // @@protoc_insertion_point(builder_implements:google.cloud.audit.RequestMetadata) com.google.cloud.audit.RequestMetadataOrBuilder { @@ -611,7 +648,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.cloud.audit.AuditLogProto .internal_static_google_cloud_audit_RequestMetadata_fieldAccessorTable @@ -621,31 +658,37 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } // Construct using com.google.cloud.audit.RequestMetadata.newBuilder() - private Builder() {} + private Builder() { + maybeForceBuilderInitialization(); + } - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetRequestAttributesFieldBuilder(); + internalGetDestinationAttributesFieldBuilder(); + } } @java.lang.Override public Builder clear() { super.clear(); + bitField0_ = 0; callerIp_ = ""; - callerSuppliedUserAgent_ = ""; - callerNetwork_ = ""; - - if (requestAttributesBuilder_ == null) { - requestAttributes_ = null; - } else { - requestAttributes_ = null; + requestAttributes_ = null; + if (requestAttributesBuilder_ != null) { + requestAttributesBuilder_.dispose(); requestAttributesBuilder_ = null; } - if (destinationAttributesBuilder_ == null) { - destinationAttributes_ = null; - } else { - destinationAttributes_ = null; + destinationAttributes_ = null; + if (destinationAttributesBuilder_ != null) { + destinationAttributesBuilder_.dispose(); destinationAttributesBuilder_ = null; } return this; @@ -675,54 +718,40 @@ public com.google.cloud.audit.RequestMetadata build() { public com.google.cloud.audit.RequestMetadata buildPartial() { com.google.cloud.audit.RequestMetadata result = new com.google.cloud.audit.RequestMetadata(this); - result.callerIp_ = callerIp_; - result.callerSuppliedUserAgent_ = callerSuppliedUserAgent_; - result.callerNetwork_ = callerNetwork_; - if (requestAttributesBuilder_ == null) { - result.requestAttributes_ = requestAttributes_; - } else { - result.requestAttributes_ = requestAttributesBuilder_.build(); - } - if (destinationAttributesBuilder_ == null) { - result.destinationAttributes_ = destinationAttributes_; - } else { - result.destinationAttributes_ = destinationAttributesBuilder_.build(); + if (bitField0_ != 0) { + buildPartial0(result); } 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); + private void buildPartial0(com.google.cloud.audit.RequestMetadata result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.callerIp_ = callerIp_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.callerSuppliedUserAgent_ = callerSuppliedUserAgent_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.callerNetwork_ = callerNetwork_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000008) != 0)) { + result.requestAttributes_ = + requestAttributesBuilder_ == null + ? requestAttributes_ + : requestAttributesBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.destinationAttributes_ = + destinationAttributesBuilder_ == null + ? destinationAttributes_ + : destinationAttributesBuilder_.build(); + to_bitField0_ |= 0x00000002; + } + result.bitField0_ |= to_bitField0_; } @java.lang.Override @@ -739,14 +768,17 @@ public Builder mergeFrom(com.google.cloud.audit.RequestMetadata other) { if (other == com.google.cloud.audit.RequestMetadata.getDefaultInstance()) return this; if (!other.getCallerIp().isEmpty()) { callerIp_ = other.callerIp_; + bitField0_ |= 0x00000001; onChanged(); } if (!other.getCallerSuppliedUserAgent().isEmpty()) { callerSuppliedUserAgent_ = other.callerSuppliedUserAgent_; + bitField0_ |= 0x00000002; onChanged(); } if (!other.getCallerNetwork().isEmpty()) { callerNetwork_ = other.callerNetwork_; + bitField0_ |= 0x00000004; onChanged(); } if (other.hasRequestAttributes()) { @@ -784,33 +816,33 @@ public Builder mergeFrom( case 10: { callerIp_ = input.readStringRequireUtf8(); - + bitField0_ |= 0x00000001; break; } // case 10 case 18: { callerSuppliedUserAgent_ = input.readStringRequireUtf8(); - + bitField0_ |= 0x00000002; break; } // case 18 case 26: { callerNetwork_ = input.readStringRequireUtf8(); - + bitField0_ |= 0x00000004; break; } // case 26 case 58: { input.readMessage( - getRequestAttributesFieldBuilder().getBuilder(), extensionRegistry); - + internalGetRequestAttributesFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000008; break; } // case 58 case 66: { input.readMessage( - getDestinationAttributesFieldBuilder().getBuilder(), extensionRegistry); - + internalGetDestinationAttributesFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000010; break; } // case 66 default: @@ -830,7 +862,10 @@ public Builder mergeFrom( return this; } + private int bitField0_; + private java.lang.Object callerIp_ = ""; + /** * * @@ -863,6 +898,7 @@ public java.lang.String getCallerIp() { return (java.lang.String) ref; } } + /** * * @@ -895,6 +931,7 @@ public com.google.protobuf.ByteString getCallerIpBytes() { return (com.google.protobuf.ByteString) ref; } } + /** * * @@ -921,11 +958,12 @@ public Builder setCallerIp(java.lang.String value) { if (value == null) { throw new NullPointerException(); } - callerIp_ = value; + bitField0_ |= 0x00000001; onChanged(); return this; } + /** * * @@ -948,11 +986,12 @@ public Builder setCallerIp(java.lang.String value) { * @return This builder for chaining. */ public Builder clearCallerIp() { - callerIp_ = getDefaultInstance().getCallerIp(); + bitField0_ = (bitField0_ & ~0x00000001); onChanged(); return this; } + /** * * @@ -980,13 +1019,14 @@ public Builder setCallerIpBytes(com.google.protobuf.ByteString value) { throw new NullPointerException(); } checkByteStringIsUtf8(value); - callerIp_ = value; + bitField0_ |= 0x00000001; onChanged(); return this; } private java.lang.Object callerSuppliedUserAgent_ = ""; + /** * * @@ -994,13 +1034,14 @@ public Builder setCallerIpBytes(com.google.protobuf.ByteString value) { * The user agent of the caller. * This information is not authenticated and should be treated accordingly. * For example: + * * + `google-api-python-client/1.4.0`: - * The request was made by the Google API client for Python. + * The request was made by the Google API client for Python. * + `Cloud SDK Command Line Tool apitools-client/1.0 gcloud/0.9.62`: - * The request was made by the Google Cloud SDK CLI (gcloud). + * The request was made by the Google Cloud SDK CLI (gcloud). * + `AppEngine-Google; (+http://code.google.com/appengine; appid: * s~my-project`: - * The request was made from the `my-project` App Engine app. + * The request was made from the `my-project` App Engine app. *
        * * string caller_supplied_user_agent = 2; @@ -1018,6 +1059,7 @@ public java.lang.String getCallerSuppliedUserAgent() { return (java.lang.String) ref; } } + /** * * @@ -1025,13 +1067,14 @@ public java.lang.String getCallerSuppliedUserAgent() { * The user agent of the caller. * This information is not authenticated and should be treated accordingly. * For example: + * * + `google-api-python-client/1.4.0`: - * The request was made by the Google API client for Python. + * The request was made by the Google API client for Python. * + `Cloud SDK Command Line Tool apitools-client/1.0 gcloud/0.9.62`: - * The request was made by the Google Cloud SDK CLI (gcloud). + * The request was made by the Google Cloud SDK CLI (gcloud). * + `AppEngine-Google; (+http://code.google.com/appengine; appid: * s~my-project`: - * The request was made from the `my-project` App Engine app. + * The request was made from the `my-project` App Engine app. *
        * * string caller_supplied_user_agent = 2; @@ -1049,6 +1092,7 @@ public com.google.protobuf.ByteString getCallerSuppliedUserAgentBytes() { return (com.google.protobuf.ByteString) ref; } } + /** * * @@ -1056,13 +1100,14 @@ public com.google.protobuf.ByteString getCallerSuppliedUserAgentBytes() { * The user agent of the caller. * This information is not authenticated and should be treated accordingly. * For example: + * * + `google-api-python-client/1.4.0`: - * The request was made by the Google API client for Python. + * The request was made by the Google API client for Python. * + `Cloud SDK Command Line Tool apitools-client/1.0 gcloud/0.9.62`: - * The request was made by the Google Cloud SDK CLI (gcloud). + * The request was made by the Google Cloud SDK CLI (gcloud). * + `AppEngine-Google; (+http://code.google.com/appengine; appid: * s~my-project`: - * The request was made from the `my-project` App Engine app. + * The request was made from the `my-project` App Engine app. *
        * * string caller_supplied_user_agent = 2; @@ -1074,11 +1119,12 @@ public Builder setCallerSuppliedUserAgent(java.lang.String value) { if (value == null) { throw new NullPointerException(); } - callerSuppliedUserAgent_ = value; + bitField0_ |= 0x00000002; onChanged(); return this; } + /** * * @@ -1086,13 +1132,14 @@ public Builder setCallerSuppliedUserAgent(java.lang.String value) { * The user agent of the caller. * This information is not authenticated and should be treated accordingly. * For example: + * * + `google-api-python-client/1.4.0`: - * The request was made by the Google API client for Python. + * The request was made by the Google API client for Python. * + `Cloud SDK Command Line Tool apitools-client/1.0 gcloud/0.9.62`: - * The request was made by the Google Cloud SDK CLI (gcloud). + * The request was made by the Google Cloud SDK CLI (gcloud). * + `AppEngine-Google; (+http://code.google.com/appengine; appid: * s~my-project`: - * The request was made from the `my-project` App Engine app. + * The request was made from the `my-project` App Engine app. *
        * * string caller_supplied_user_agent = 2; @@ -1100,11 +1147,12 @@ public Builder setCallerSuppliedUserAgent(java.lang.String value) { * @return This builder for chaining. */ public Builder clearCallerSuppliedUserAgent() { - callerSuppliedUserAgent_ = getDefaultInstance().getCallerSuppliedUserAgent(); + bitField0_ = (bitField0_ & ~0x00000002); onChanged(); return this; } + /** * * @@ -1112,13 +1160,14 @@ public Builder clearCallerSuppliedUserAgent() { * The user agent of the caller. * This information is not authenticated and should be treated accordingly. * For example: + * * + `google-api-python-client/1.4.0`: - * The request was made by the Google API client for Python. + * The request was made by the Google API client for Python. * + `Cloud SDK Command Line Tool apitools-client/1.0 gcloud/0.9.62`: - * The request was made by the Google Cloud SDK CLI (gcloud). + * The request was made by the Google Cloud SDK CLI (gcloud). * + `AppEngine-Google; (+http://code.google.com/appengine; appid: * s~my-project`: - * The request was made from the `my-project` App Engine app. + * The request was made from the `my-project` App Engine app. *
        * * string caller_supplied_user_agent = 2; @@ -1131,13 +1180,14 @@ public Builder setCallerSuppliedUserAgentBytes(com.google.protobuf.ByteString va throw new NullPointerException(); } checkByteStringIsUtf8(value); - callerSuppliedUserAgent_ = value; + bitField0_ |= 0x00000002; onChanged(); return this; } private java.lang.Object callerNetwork_ = ""; + /** * * @@ -1147,7 +1197,8 @@ public Builder setCallerSuppliedUserAgentBytes(com.google.protobuf.ByteString va * (or project) as the accessed resource. * See https://cloud.google.com/compute/docs/vpc/ for more information. * This is a scheme-less URI full resource name. For example: - * "//compute.googleapis.com/projects/PROJECT_ID/global/networks/NETWORK_ID" + * + * "//compute.googleapis.com/projects/PROJECT_ID/global/networks/NETWORK_ID" *
        * * string caller_network = 3; @@ -1165,6 +1216,7 @@ public java.lang.String getCallerNetwork() { return (java.lang.String) ref; } } + /** * * @@ -1174,7 +1226,8 @@ public java.lang.String getCallerNetwork() { * (or project) as the accessed resource. * See https://cloud.google.com/compute/docs/vpc/ for more information. * This is a scheme-less URI full resource name. For example: - * "//compute.googleapis.com/projects/PROJECT_ID/global/networks/NETWORK_ID" + * + * "//compute.googleapis.com/projects/PROJECT_ID/global/networks/NETWORK_ID" *
        * * string caller_network = 3; @@ -1192,6 +1245,7 @@ public com.google.protobuf.ByteString getCallerNetworkBytes() { return (com.google.protobuf.ByteString) ref; } } + /** * * @@ -1201,7 +1255,8 @@ public com.google.protobuf.ByteString getCallerNetworkBytes() { * (or project) as the accessed resource. * See https://cloud.google.com/compute/docs/vpc/ for more information. * This is a scheme-less URI full resource name. For example: - * "//compute.googleapis.com/projects/PROJECT_ID/global/networks/NETWORK_ID" + * + * "//compute.googleapis.com/projects/PROJECT_ID/global/networks/NETWORK_ID" *
        * * string caller_network = 3; @@ -1213,11 +1268,12 @@ public Builder setCallerNetwork(java.lang.String value) { if (value == null) { throw new NullPointerException(); } - callerNetwork_ = value; + bitField0_ |= 0x00000004; onChanged(); return this; } + /** * * @@ -1227,7 +1283,8 @@ public Builder setCallerNetwork(java.lang.String value) { * (or project) as the accessed resource. * See https://cloud.google.com/compute/docs/vpc/ for more information. * This is a scheme-less URI full resource name. For example: - * "//compute.googleapis.com/projects/PROJECT_ID/global/networks/NETWORK_ID" + * + * "//compute.googleapis.com/projects/PROJECT_ID/global/networks/NETWORK_ID" *
        * * string caller_network = 3; @@ -1235,11 +1292,12 @@ public Builder setCallerNetwork(java.lang.String value) { * @return This builder for chaining. */ public Builder clearCallerNetwork() { - callerNetwork_ = getDefaultInstance().getCallerNetwork(); + bitField0_ = (bitField0_ & ~0x00000004); onChanged(); return this; } + /** * * @@ -1249,7 +1307,8 @@ public Builder clearCallerNetwork() { * (or project) as the accessed resource. * See https://cloud.google.com/compute/docs/vpc/ for more information. * This is a scheme-less URI full resource name. For example: - * "//compute.googleapis.com/projects/PROJECT_ID/global/networks/NETWORK_ID" + * + * "//compute.googleapis.com/projects/PROJECT_ID/global/networks/NETWORK_ID" *
        * * string caller_network = 3; @@ -1262,18 +1321,19 @@ public Builder setCallerNetworkBytes(com.google.protobuf.ByteString value) { throw new NullPointerException(); } checkByteStringIsUtf8(value); - callerNetwork_ = value; + bitField0_ |= 0x00000004; onChanged(); return this; } private com.google.rpc.context.AttributeContext.Request requestAttributes_; - private com.google.protobuf.SingleFieldBuilderV3< + private com.google.protobuf.SingleFieldBuilder< com.google.rpc.context.AttributeContext.Request, com.google.rpc.context.AttributeContext.Request.Builder, com.google.rpc.context.AttributeContext.RequestOrBuilder> requestAttributesBuilder_; + /** * * @@ -1281,6 +1341,8 @@ public Builder setCallerNetworkBytes(com.google.protobuf.ByteString value) { * Request attributes used in IAM condition evaluation. This field contains * request attributes like request time and access levels associated with * the request. + * + * * To get the whole view of the attributes used in IAM * condition evaluation, the user must also look into * `AuditLog.authentication_info.resource_attributes`. @@ -1291,8 +1353,9 @@ public Builder setCallerNetworkBytes(com.google.protobuf.ByteString value) { * @return Whether the requestAttributes field is set. */ public boolean hasRequestAttributes() { - return requestAttributesBuilder_ != null || requestAttributes_ != null; + return ((bitField0_ & 0x00000008) != 0); } + /** * * @@ -1300,6 +1363,8 @@ public boolean hasRequestAttributes() { * Request attributes used in IAM condition evaluation. This field contains * request attributes like request time and access levels associated with * the request. + * + * * To get the whole view of the attributes used in IAM * condition evaluation, the user must also look into * `AuditLog.authentication_info.resource_attributes`. @@ -1318,6 +1383,7 @@ public com.google.rpc.context.AttributeContext.Request getRequestAttributes() { return requestAttributesBuilder_.getMessage(); } } + /** * * @@ -1325,6 +1391,8 @@ public com.google.rpc.context.AttributeContext.Request getRequestAttributes() { * Request attributes used in IAM condition evaluation. This field contains * request attributes like request time and access levels associated with * the request. + * + * * To get the whole view of the attributes used in IAM * condition evaluation, the user must also look into * `AuditLog.authentication_info.resource_attributes`. @@ -1338,13 +1406,14 @@ public Builder setRequestAttributes(com.google.rpc.context.AttributeContext.Requ throw new NullPointerException(); } requestAttributes_ = value; - onChanged(); } else { requestAttributesBuilder_.setMessage(value); } - + bitField0_ |= 0x00000008; + onChanged(); return this; } + /** * * @@ -1352,6 +1421,8 @@ public Builder setRequestAttributes(com.google.rpc.context.AttributeContext.Requ * Request attributes used in IAM condition evaluation. This field contains * request attributes like request time and access levels associated with * the request. + * + * * To get the whole view of the attributes used in IAM * condition evaluation, the user must also look into * `AuditLog.authentication_info.resource_attributes`. @@ -1363,13 +1434,14 @@ public Builder setRequestAttributes( com.google.rpc.context.AttributeContext.Request.Builder builderForValue) { if (requestAttributesBuilder_ == null) { requestAttributes_ = builderForValue.build(); - onChanged(); } else { requestAttributesBuilder_.setMessage(builderForValue.build()); } - + bitField0_ |= 0x00000008; + onChanged(); return this; } + /** * * @@ -1377,6 +1449,8 @@ public Builder setRequestAttributes( * Request attributes used in IAM condition evaluation. This field contains * request attributes like request time and access levels associated with * the request. + * + * * To get the whole view of the attributes used in IAM * condition evaluation, the user must also look into * `AuditLog.authentication_info.resource_attributes`. @@ -1386,21 +1460,24 @@ public Builder setRequestAttributes( */ public Builder mergeRequestAttributes(com.google.rpc.context.AttributeContext.Request value) { if (requestAttributesBuilder_ == null) { - if (requestAttributes_ != null) { - requestAttributes_ = - com.google.rpc.context.AttributeContext.Request.newBuilder(requestAttributes_) - .mergeFrom(value) - .buildPartial(); + if (((bitField0_ & 0x00000008) != 0) + && requestAttributes_ != null + && requestAttributes_ + != com.google.rpc.context.AttributeContext.Request.getDefaultInstance()) { + getRequestAttributesBuilder().mergeFrom(value); } else { requestAttributes_ = value; } - onChanged(); } else { requestAttributesBuilder_.mergeFrom(value); } - + if (requestAttributes_ != null) { + bitField0_ |= 0x00000008; + onChanged(); + } return this; } + /** * * @@ -1408,6 +1485,8 @@ public Builder mergeRequestAttributes(com.google.rpc.context.AttributeContext.Re * Request attributes used in IAM condition evaluation. This field contains * request attributes like request time and access levels associated with * the request. + * + * * To get the whole view of the attributes used in IAM * condition evaluation, the user must also look into * `AuditLog.authentication_info.resource_attributes`. @@ -1416,16 +1495,16 @@ public Builder mergeRequestAttributes(com.google.rpc.context.AttributeContext.Re * .google.rpc.context.AttributeContext.Request request_attributes = 7; */ public Builder clearRequestAttributes() { - if (requestAttributesBuilder_ == null) { - requestAttributes_ = null; - onChanged(); - } else { - requestAttributes_ = null; + bitField0_ = (bitField0_ & ~0x00000008); + requestAttributes_ = null; + if (requestAttributesBuilder_ != null) { + requestAttributesBuilder_.dispose(); requestAttributesBuilder_ = null; } - + onChanged(); return this; } + /** * * @@ -1433,6 +1512,8 @@ public Builder clearRequestAttributes() { * Request attributes used in IAM condition evaluation. This field contains * request attributes like request time and access levels associated with * the request. + * + * * To get the whole view of the attributes used in IAM * condition evaluation, the user must also look into * `AuditLog.authentication_info.resource_attributes`. @@ -1441,10 +1522,11 @@ public Builder clearRequestAttributes() { * .google.rpc.context.AttributeContext.Request request_attributes = 7; */ public com.google.rpc.context.AttributeContext.Request.Builder getRequestAttributesBuilder() { - + bitField0_ |= 0x00000008; onChanged(); - return getRequestAttributesFieldBuilder().getBuilder(); + return internalGetRequestAttributesFieldBuilder().getBuilder(); } + /** * * @@ -1452,6 +1534,8 @@ public com.google.rpc.context.AttributeContext.Request.Builder getRequestAttribu * Request attributes used in IAM condition evaluation. This field contains * request attributes like request time and access levels associated with * the request. + * + * * To get the whole view of the attributes used in IAM * condition evaluation, the user must also look into * `AuditLog.authentication_info.resource_attributes`. @@ -1469,6 +1553,7 @@ public com.google.rpc.context.AttributeContext.Request.Builder getRequestAttribu : requestAttributes_; } } + /** * * @@ -1476,6 +1561,8 @@ public com.google.rpc.context.AttributeContext.Request.Builder getRequestAttribu * Request attributes used in IAM condition evaluation. This field contains * request attributes like request time and access levels associated with * the request. + * + * * To get the whole view of the attributes used in IAM * condition evaluation, the user must also look into * `AuditLog.authentication_info.resource_attributes`. @@ -1483,14 +1570,14 @@ public com.google.rpc.context.AttributeContext.Request.Builder getRequestAttribu * * .google.rpc.context.AttributeContext.Request request_attributes = 7; */ - private com.google.protobuf.SingleFieldBuilderV3< + private com.google.protobuf.SingleFieldBuilder< com.google.rpc.context.AttributeContext.Request, com.google.rpc.context.AttributeContext.Request.Builder, com.google.rpc.context.AttributeContext.RequestOrBuilder> - getRequestAttributesFieldBuilder() { + internalGetRequestAttributesFieldBuilder() { if (requestAttributesBuilder_ == null) { requestAttributesBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< + new com.google.protobuf.SingleFieldBuilder< com.google.rpc.context.AttributeContext.Request, com.google.rpc.context.AttributeContext.Request.Builder, com.google.rpc.context.AttributeContext.RequestOrBuilder>( @@ -1501,11 +1588,12 @@ public com.google.rpc.context.AttributeContext.Request.Builder getRequestAttribu } private com.google.rpc.context.AttributeContext.Peer destinationAttributes_; - private com.google.protobuf.SingleFieldBuilderV3< + private com.google.protobuf.SingleFieldBuilder< com.google.rpc.context.AttributeContext.Peer, com.google.rpc.context.AttributeContext.Peer.Builder, com.google.rpc.context.AttributeContext.PeerOrBuilder> destinationAttributesBuilder_; + /** * * @@ -1522,8 +1610,9 @@ public com.google.rpc.context.AttributeContext.Request.Builder getRequestAttribu * @return Whether the destinationAttributes field is set. */ public boolean hasDestinationAttributes() { - return destinationAttributesBuilder_ != null || destinationAttributes_ != null; + return ((bitField0_ & 0x00000010) != 0); } + /** * * @@ -1548,6 +1637,7 @@ public com.google.rpc.context.AttributeContext.Peer getDestinationAttributes() { return destinationAttributesBuilder_.getMessage(); } } + /** * * @@ -1567,13 +1657,14 @@ public Builder setDestinationAttributes(com.google.rpc.context.AttributeContext. throw new NullPointerException(); } destinationAttributes_ = value; - onChanged(); } else { destinationAttributesBuilder_.setMessage(value); } - + bitField0_ |= 0x00000010; + onChanged(); return this; } + /** * * @@ -1591,13 +1682,14 @@ public Builder setDestinationAttributes( com.google.rpc.context.AttributeContext.Peer.Builder builderForValue) { if (destinationAttributesBuilder_ == null) { destinationAttributes_ = builderForValue.build(); - onChanged(); } else { destinationAttributesBuilder_.setMessage(builderForValue.build()); } - + bitField0_ |= 0x00000010; + onChanged(); return this; } + /** * * @@ -1613,21 +1705,24 @@ public Builder setDestinationAttributes( */ public Builder mergeDestinationAttributes(com.google.rpc.context.AttributeContext.Peer value) { if (destinationAttributesBuilder_ == null) { - if (destinationAttributes_ != null) { - destinationAttributes_ = - com.google.rpc.context.AttributeContext.Peer.newBuilder(destinationAttributes_) - .mergeFrom(value) - .buildPartial(); + if (((bitField0_ & 0x00000010) != 0) + && destinationAttributes_ != null + && destinationAttributes_ + != com.google.rpc.context.AttributeContext.Peer.getDefaultInstance()) { + getDestinationAttributesBuilder().mergeFrom(value); } else { destinationAttributes_ = value; } - onChanged(); } else { destinationAttributesBuilder_.mergeFrom(value); } - + if (destinationAttributes_ != null) { + bitField0_ |= 0x00000010; + onChanged(); + } return this; } + /** * * @@ -1642,16 +1737,16 @@ public Builder mergeDestinationAttributes(com.google.rpc.context.AttributeContex * .google.rpc.context.AttributeContext.Peer destination_attributes = 8; */ public Builder clearDestinationAttributes() { - if (destinationAttributesBuilder_ == null) { - destinationAttributes_ = null; - onChanged(); - } else { - destinationAttributes_ = null; + bitField0_ = (bitField0_ & ~0x00000010); + destinationAttributes_ = null; + if (destinationAttributesBuilder_ != null) { + destinationAttributesBuilder_.dispose(); destinationAttributesBuilder_ = null; } - + onChanged(); return this; } + /** * * @@ -1666,10 +1761,11 @@ public Builder clearDestinationAttributes() { * .google.rpc.context.AttributeContext.Peer destination_attributes = 8; */ public com.google.rpc.context.AttributeContext.Peer.Builder getDestinationAttributesBuilder() { - + bitField0_ |= 0x00000010; onChanged(); - return getDestinationAttributesFieldBuilder().getBuilder(); + return internalGetDestinationAttributesFieldBuilder().getBuilder(); } + /** * * @@ -1693,6 +1789,7 @@ public com.google.rpc.context.AttributeContext.Peer.Builder getDestinationAttrib : destinationAttributes_; } } + /** * * @@ -1706,14 +1803,14 @@ public com.google.rpc.context.AttributeContext.Peer.Builder getDestinationAttrib * * .google.rpc.context.AttributeContext.Peer destination_attributes = 8; */ - private com.google.protobuf.SingleFieldBuilderV3< + private com.google.protobuf.SingleFieldBuilder< com.google.rpc.context.AttributeContext.Peer, com.google.rpc.context.AttributeContext.Peer.Builder, com.google.rpc.context.AttributeContext.PeerOrBuilder> - getDestinationAttributesFieldBuilder() { + internalGetDestinationAttributesFieldBuilder() { if (destinationAttributesBuilder_ == null) { destinationAttributesBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< + new com.google.protobuf.SingleFieldBuilder< com.google.rpc.context.AttributeContext.Peer, com.google.rpc.context.AttributeContext.Peer.Builder, com.google.rpc.context.AttributeContext.PeerOrBuilder>( @@ -1723,17 +1820,6 @@ public com.google.rpc.context.AttributeContext.Peer.Builder getDestinationAttrib return destinationAttributesBuilder_; } - @java.lang.Override - public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - // @@protoc_insertion_point(builder_scope:google.cloud.audit.RequestMetadata) } diff --git a/java-common-protos/proto-google-common-protos/src/main/java/com/google/cloud/audit/RequestMetadataOrBuilder.java b/java-common-protos/proto-google-common-protos/src/main/java/com/google/cloud/audit/RequestMetadataOrBuilder.java index 593541486f..eea3992cd7 100644 --- a/java-common-protos/proto-google-common-protos/src/main/java/com/google/cloud/audit/RequestMetadataOrBuilder.java +++ b/java-common-protos/proto-google-common-protos/src/main/java/com/google/cloud/audit/RequestMetadataOrBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,10 +14,13 @@ * limitations under the License. */ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: google/cloud/audit/audit_log.proto +// Protobuf Java Version: 4.33.2 package com.google.cloud.audit; +@com.google.protobuf.Generated public interface RequestMetadataOrBuilder extends // @@protoc_insertion_point(interface_extends:google.cloud.audit.RequestMetadata) @@ -45,6 +48,7 @@ public interface RequestMetadataOrBuilder * @return The callerIp. */ java.lang.String getCallerIp(); + /** * * @@ -75,13 +79,14 @@ public interface RequestMetadataOrBuilder * The user agent of the caller. * This information is not authenticated and should be treated accordingly. * For example: + * * + `google-api-python-client/1.4.0`: - * The request was made by the Google API client for Python. + * The request was made by the Google API client for Python. * + `Cloud SDK Command Line Tool apitools-client/1.0 gcloud/0.9.62`: - * The request was made by the Google Cloud SDK CLI (gcloud). + * The request was made by the Google Cloud SDK CLI (gcloud). * + `AppEngine-Google; (+http://code.google.com/appengine; appid: * s~my-project`: - * The request was made from the `my-project` App Engine app. + * The request was made from the `my-project` App Engine app. *
        * * string caller_supplied_user_agent = 2; @@ -89,6 +94,7 @@ public interface RequestMetadataOrBuilder * @return The callerSuppliedUserAgent. */ java.lang.String getCallerSuppliedUserAgent(); + /** * * @@ -96,13 +102,14 @@ public interface RequestMetadataOrBuilder * The user agent of the caller. * This information is not authenticated and should be treated accordingly. * For example: + * * + `google-api-python-client/1.4.0`: - * The request was made by the Google API client for Python. + * The request was made by the Google API client for Python. * + `Cloud SDK Command Line Tool apitools-client/1.0 gcloud/0.9.62`: - * The request was made by the Google Cloud SDK CLI (gcloud). + * The request was made by the Google Cloud SDK CLI (gcloud). * + `AppEngine-Google; (+http://code.google.com/appengine; appid: * s~my-project`: - * The request was made from the `my-project` App Engine app. + * The request was made from the `my-project` App Engine app. * * * string caller_supplied_user_agent = 2; @@ -120,7 +127,8 @@ public interface RequestMetadataOrBuilder * (or project) as the accessed resource. * See https://cloud.google.com/compute/docs/vpc/ for more information. * This is a scheme-less URI full resource name. For example: - * "//compute.googleapis.com/projects/PROJECT_ID/global/networks/NETWORK_ID" + * + * "//compute.googleapis.com/projects/PROJECT_ID/global/networks/NETWORK_ID" * * * string caller_network = 3; @@ -128,6 +136,7 @@ public interface RequestMetadataOrBuilder * @return The callerNetwork. */ java.lang.String getCallerNetwork(); + /** * * @@ -137,7 +146,8 @@ public interface RequestMetadataOrBuilder * (or project) as the accessed resource. * See https://cloud.google.com/compute/docs/vpc/ for more information. * This is a scheme-less URI full resource name. For example: - * "//compute.googleapis.com/projects/PROJECT_ID/global/networks/NETWORK_ID" + * + * "//compute.googleapis.com/projects/PROJECT_ID/global/networks/NETWORK_ID" * * * string caller_network = 3; @@ -153,6 +163,8 @@ public interface RequestMetadataOrBuilder * Request attributes used in IAM condition evaluation. This field contains * request attributes like request time and access levels associated with * the request. + * + * * To get the whole view of the attributes used in IAM * condition evaluation, the user must also look into * `AuditLog.authentication_info.resource_attributes`. @@ -163,6 +175,7 @@ public interface RequestMetadataOrBuilder * @return Whether the requestAttributes field is set. */ boolean hasRequestAttributes(); + /** * * @@ -170,6 +183,8 @@ public interface RequestMetadataOrBuilder * Request attributes used in IAM condition evaluation. This field contains * request attributes like request time and access levels associated with * the request. + * + * * To get the whole view of the attributes used in IAM * condition evaluation, the user must also look into * `AuditLog.authentication_info.resource_attributes`. @@ -180,6 +195,7 @@ public interface RequestMetadataOrBuilder * @return The requestAttributes. */ com.google.rpc.context.AttributeContext.Request getRequestAttributes(); + /** * * @@ -187,6 +203,8 @@ public interface RequestMetadataOrBuilder * Request attributes used in IAM condition evaluation. This field contains * request attributes like request time and access levels associated with * the request. + * + * * To get the whole view of the attributes used in IAM * condition evaluation, the user must also look into * `AuditLog.authentication_info.resource_attributes`. @@ -212,6 +230,7 @@ public interface RequestMetadataOrBuilder * @return Whether the destinationAttributes field is set. */ boolean hasDestinationAttributes(); + /** * * @@ -228,6 +247,7 @@ public interface RequestMetadataOrBuilder * @return The destinationAttributes. */ com.google.rpc.context.AttributeContext.Peer getDestinationAttributes(); + /** * * diff --git a/java-common-protos/proto-google-common-protos/src/main/java/com/google/cloud/audit/ResourceLocation.java b/java-common-protos/proto-google-common-protos/src/main/java/com/google/cloud/audit/ResourceLocation.java index a745982081..77e8c69c13 100644 --- a/java-common-protos/proto-google-common-protos/src/main/java/com/google/cloud/audit/ResourceLocation.java +++ b/java-common-protos/proto-google-common-protos/src/main/java/com/google/cloud/audit/ResourceLocation.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,9 @@ * limitations under the License. */ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: google/cloud/audit/audit_log.proto +// Protobuf Java Version: 4.33.2 package com.google.cloud.audit; @@ -27,30 +29,31 @@ * * Protobuf type {@code google.cloud.audit.ResourceLocation} */ -public final class ResourceLocation extends com.google.protobuf.GeneratedMessageV3 +@com.google.protobuf.Generated +public final class ResourceLocation extends com.google.protobuf.GeneratedMessage implements // @@protoc_insertion_point(message_implements:google.cloud.audit.ResourceLocation) ResourceLocationOrBuilder { private static final long serialVersionUID = 0L; - // Use ResourceLocation.newBuilder() to construct. - private ResourceLocation(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private ResourceLocation() { - currentLocations_ = com.google.protobuf.LazyStringArrayList.EMPTY; - originalLocations_ = com.google.protobuf.LazyStringArrayList.EMPTY; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "ResourceLocation"); } - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new ResourceLocation(); + // Use ResourceLocation.newBuilder() to construct. + private ResourceLocation(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); } - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; + private ResourceLocation() { + currentLocations_ = com.google.protobuf.LazyStringArrayList.emptyList(); + originalLocations_ = com.google.protobuf.LazyStringArrayList.emptyList(); } public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { @@ -59,7 +62,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.cloud.audit.AuditLogProto .internal_static_google_cloud_audit_ResourceLocation_fieldAccessorTable @@ -69,7 +72,11 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } public static final int CURRENT_LOCATIONS_FIELD_NUMBER = 1; - private com.google.protobuf.LazyStringList currentLocations_; + + @SuppressWarnings("serial") + private com.google.protobuf.LazyStringArrayList currentLocations_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + /** * * @@ -78,9 +85,10 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { * Requests to create or delete a location based resource must populate * the 'current_locations' field and not the 'original_locations' field. * For example: - * "europe-west1-a" - * "us-east1" - * "nam3" + * + * "europe-west1-a" + * "us-east1" + * "nam3" * * * repeated string current_locations = 1; @@ -90,6 +98,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { public com.google.protobuf.ProtocolStringList getCurrentLocationsList() { return currentLocations_; } + /** * * @@ -98,9 +107,10 @@ public com.google.protobuf.ProtocolStringList getCurrentLocationsList() { * Requests to create or delete a location based resource must populate * the 'current_locations' field and not the 'original_locations' field. * For example: - * "europe-west1-a" - * "us-east1" - * "nam3" + * + * "europe-west1-a" + * "us-east1" + * "nam3" * * * repeated string current_locations = 1; @@ -110,6 +120,7 @@ public com.google.protobuf.ProtocolStringList getCurrentLocationsList() { public int getCurrentLocationsCount() { return currentLocations_.size(); } + /** * * @@ -118,9 +129,10 @@ public int getCurrentLocationsCount() { * Requests to create or delete a location based resource must populate * the 'current_locations' field and not the 'original_locations' field. * For example: - * "europe-west1-a" - * "us-east1" - * "nam3" + * + * "europe-west1-a" + * "us-east1" + * "nam3" * * * repeated string current_locations = 1; @@ -131,6 +143,7 @@ public int getCurrentLocationsCount() { public java.lang.String getCurrentLocations(int index) { return currentLocations_.get(index); } + /** * * @@ -139,9 +152,10 @@ public java.lang.String getCurrentLocations(int index) { * Requests to create or delete a location based resource must populate * the 'current_locations' field and not the 'original_locations' field. * For example: - * "europe-west1-a" - * "us-east1" - * "nam3" + * + * "europe-west1-a" + * "us-east1" + * "nam3" * * * repeated string current_locations = 1; @@ -154,7 +168,11 @@ public com.google.protobuf.ByteString getCurrentLocationsBytes(int index) { } public static final int ORIGINAL_LOCATIONS_FIELD_NUMBER = 2; - private com.google.protobuf.LazyStringList originalLocations_; + + @SuppressWarnings("serial") + private com.google.protobuf.LazyStringArrayList originalLocations_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + /** * * @@ -163,9 +181,10 @@ public com.google.protobuf.ByteString getCurrentLocationsBytes(int index) { * Requests that mutate the resource's location must populate both the * 'original_locations' as well as the 'current_locations' fields. * For example: - * "europe-west1-a" - * "us-east1" - * "nam3" + * + * "europe-west1-a" + * "us-east1" + * "nam3" * * * repeated string original_locations = 2; @@ -175,6 +194,7 @@ public com.google.protobuf.ByteString getCurrentLocationsBytes(int index) { public com.google.protobuf.ProtocolStringList getOriginalLocationsList() { return originalLocations_; } + /** * * @@ -183,9 +203,10 @@ public com.google.protobuf.ProtocolStringList getOriginalLocationsList() { * Requests that mutate the resource's location must populate both the * 'original_locations' as well as the 'current_locations' fields. * For example: - * "europe-west1-a" - * "us-east1" - * "nam3" + * + * "europe-west1-a" + * "us-east1" + * "nam3" * * * repeated string original_locations = 2; @@ -195,6 +216,7 @@ public com.google.protobuf.ProtocolStringList getOriginalLocationsList() { public int getOriginalLocationsCount() { return originalLocations_.size(); } + /** * * @@ -203,9 +225,10 @@ public int getOriginalLocationsCount() { * Requests that mutate the resource's location must populate both the * 'original_locations' as well as the 'current_locations' fields. * For example: - * "europe-west1-a" - * "us-east1" - * "nam3" + * + * "europe-west1-a" + * "us-east1" + * "nam3" * * * repeated string original_locations = 2; @@ -216,6 +239,7 @@ public int getOriginalLocationsCount() { public java.lang.String getOriginalLocations(int index) { return originalLocations_.get(index); } + /** * * @@ -224,9 +248,10 @@ public java.lang.String getOriginalLocations(int index) { * Requests that mutate the resource's location must populate both the * 'original_locations' as well as the 'current_locations' fields. * For example: - * "europe-west1-a" - * "us-east1" - * "nam3" + * + * "europe-west1-a" + * "us-east1" + * "nam3" * * * repeated string original_locations = 2; @@ -253,10 +278,10 @@ public final boolean isInitialized() { @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { for (int i = 0; i < currentLocations_.size(); i++) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, currentLocations_.getRaw(i)); + com.google.protobuf.GeneratedMessage.writeString(output, 1, currentLocations_.getRaw(i)); } for (int i = 0; i < originalLocations_.size(); i++) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 2, originalLocations_.getRaw(i)); + com.google.protobuf.GeneratedMessage.writeString(output, 2, originalLocations_.getRaw(i)); } getUnknownFields().writeTo(output); } @@ -361,38 +386,38 @@ public static com.google.cloud.audit.ResourceLocation parseFrom( public static com.google.cloud.audit.ResourceLocation parseFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); } public static com.google.cloud.audit.ResourceLocation parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } public static com.google.cloud.audit.ResourceLocation parseDelimitedFrom( java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); } public static com.google.cloud.audit.ResourceLocation parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( PARSER, input, extensionRegistry); } public static com.google.cloud.audit.ResourceLocation parseFrom( com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); } public static com.google.cloud.audit.ResourceLocation parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } @@ -415,10 +440,11 @@ public Builder toBuilder() { } @java.lang.Override - protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { Builder builder = new Builder(parent); return builder; } + /** * * @@ -428,7 +454,7 @@ protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.Build * * Protobuf type {@code google.cloud.audit.ResourceLocation} */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder implements // @@protoc_insertion_point(builder_implements:google.cloud.audit.ResourceLocation) com.google.cloud.audit.ResourceLocationOrBuilder { @@ -438,7 +464,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.cloud.audit.AuditLogProto .internal_static_google_cloud_audit_ResourceLocation_fieldAccessorTable @@ -450,17 +476,16 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { // Construct using com.google.cloud.audit.ResourceLocation.newBuilder() private Builder() {} - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { super(parent); } @java.lang.Override public Builder clear() { super.clear(); - currentLocations_ = com.google.protobuf.LazyStringArrayList.EMPTY; - bitField0_ = (bitField0_ & ~0x00000001); - originalLocations_ = com.google.protobuf.LazyStringArrayList.EMPTY; - bitField0_ = (bitField0_ & ~0x00000002); + bitField0_ = 0; + currentLocations_ = com.google.protobuf.LazyStringArrayList.emptyList(); + originalLocations_ = com.google.protobuf.LazyStringArrayList.emptyList(); return this; } @@ -488,52 +513,23 @@ public com.google.cloud.audit.ResourceLocation build() { public com.google.cloud.audit.ResourceLocation buildPartial() { com.google.cloud.audit.ResourceLocation result = new com.google.cloud.audit.ResourceLocation(this); - int from_bitField0_ = bitField0_; - if (((bitField0_ & 0x00000001) != 0)) { - currentLocations_ = currentLocations_.getUnmodifiableView(); - bitField0_ = (bitField0_ & ~0x00000001); - } - result.currentLocations_ = currentLocations_; - if (((bitField0_ & 0x00000002) != 0)) { - originalLocations_ = originalLocations_.getUnmodifiableView(); - bitField0_ = (bitField0_ & ~0x00000002); + if (bitField0_ != 0) { + buildPartial0(result); } - result.originalLocations_ = originalLocations_; 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); + private void buildPartial0(com.google.cloud.audit.ResourceLocation result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + currentLocations_.makeImmutable(); + result.currentLocations_ = currentLocations_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + originalLocations_.makeImmutable(); + result.originalLocations_ = originalLocations_; + } } @java.lang.Override @@ -551,7 +547,7 @@ public Builder mergeFrom(com.google.cloud.audit.ResourceLocation other) { if (!other.currentLocations_.isEmpty()) { if (currentLocations_.isEmpty()) { currentLocations_ = other.currentLocations_; - bitField0_ = (bitField0_ & ~0x00000001); + bitField0_ |= 0x00000001; } else { ensureCurrentLocationsIsMutable(); currentLocations_.addAll(other.currentLocations_); @@ -561,7 +557,7 @@ public Builder mergeFrom(com.google.cloud.audit.ResourceLocation other) { if (!other.originalLocations_.isEmpty()) { if (originalLocations_.isEmpty()) { originalLocations_ = other.originalLocations_; - bitField0_ = (bitField0_ & ~0x00000002); + bitField0_ |= 0x00000002; } else { ensureOriginalLocationsIsMutable(); originalLocations_.addAll(other.originalLocations_); @@ -627,15 +623,16 @@ public Builder mergeFrom( private int bitField0_; - private com.google.protobuf.LazyStringList currentLocations_ = - com.google.protobuf.LazyStringArrayList.EMPTY; + private com.google.protobuf.LazyStringArrayList currentLocations_ = + com.google.protobuf.LazyStringArrayList.emptyList(); private void ensureCurrentLocationsIsMutable() { - if (!((bitField0_ & 0x00000001) != 0)) { + if (!currentLocations_.isModifiable()) { currentLocations_ = new com.google.protobuf.LazyStringArrayList(currentLocations_); - bitField0_ |= 0x00000001; } + bitField0_ |= 0x00000001; } + /** * * @@ -644,9 +641,10 @@ private void ensureCurrentLocationsIsMutable() { * Requests to create or delete a location based resource must populate * the 'current_locations' field and not the 'original_locations' field. * For example: - * "europe-west1-a" - * "us-east1" - * "nam3" + * + * "europe-west1-a" + * "us-east1" + * "nam3" * * * repeated string current_locations = 1; @@ -654,8 +652,10 @@ private void ensureCurrentLocationsIsMutable() { * @return A list containing the currentLocations. */ public com.google.protobuf.ProtocolStringList getCurrentLocationsList() { - return currentLocations_.getUnmodifiableView(); + currentLocations_.makeImmutable(); + return currentLocations_; } + /** * * @@ -664,9 +664,10 @@ public com.google.protobuf.ProtocolStringList getCurrentLocationsList() { * Requests to create or delete a location based resource must populate * the 'current_locations' field and not the 'original_locations' field. * For example: - * "europe-west1-a" - * "us-east1" - * "nam3" + * + * "europe-west1-a" + * "us-east1" + * "nam3" * * * repeated string current_locations = 1; @@ -676,6 +677,7 @@ public com.google.protobuf.ProtocolStringList getCurrentLocationsList() { public int getCurrentLocationsCount() { return currentLocations_.size(); } + /** * * @@ -684,9 +686,10 @@ public int getCurrentLocationsCount() { * Requests to create or delete a location based resource must populate * the 'current_locations' field and not the 'original_locations' field. * For example: - * "europe-west1-a" - * "us-east1" - * "nam3" + * + * "europe-west1-a" + * "us-east1" + * "nam3" * * * repeated string current_locations = 1; @@ -697,6 +700,7 @@ public int getCurrentLocationsCount() { public java.lang.String getCurrentLocations(int index) { return currentLocations_.get(index); } + /** * * @@ -705,9 +709,10 @@ public java.lang.String getCurrentLocations(int index) { * Requests to create or delete a location based resource must populate * the 'current_locations' field and not the 'original_locations' field. * For example: - * "europe-west1-a" - * "us-east1" - * "nam3" + * + * "europe-west1-a" + * "us-east1" + * "nam3" * * * repeated string current_locations = 1; @@ -718,6 +723,7 @@ public java.lang.String getCurrentLocations(int index) { public com.google.protobuf.ByteString getCurrentLocationsBytes(int index) { return currentLocations_.getByteString(index); } + /** * * @@ -726,9 +732,10 @@ public com.google.protobuf.ByteString getCurrentLocationsBytes(int index) { * Requests to create or delete a location based resource must populate * the 'current_locations' field and not the 'original_locations' field. * For example: - * "europe-west1-a" - * "us-east1" - * "nam3" + * + * "europe-west1-a" + * "us-east1" + * "nam3" * * * repeated string current_locations = 1; @@ -743,9 +750,11 @@ public Builder setCurrentLocations(int index, java.lang.String value) { } ensureCurrentLocationsIsMutable(); currentLocations_.set(index, value); + bitField0_ |= 0x00000001; onChanged(); return this; } + /** * * @@ -754,9 +763,10 @@ public Builder setCurrentLocations(int index, java.lang.String value) { * Requests to create or delete a location based resource must populate * the 'current_locations' field and not the 'original_locations' field. * For example: - * "europe-west1-a" - * "us-east1" - * "nam3" + * + * "europe-west1-a" + * "us-east1" + * "nam3" * * * repeated string current_locations = 1; @@ -770,9 +780,11 @@ public Builder addCurrentLocations(java.lang.String value) { } ensureCurrentLocationsIsMutable(); currentLocations_.add(value); + bitField0_ |= 0x00000001; onChanged(); return this; } + /** * * @@ -781,9 +793,10 @@ public Builder addCurrentLocations(java.lang.String value) { * Requests to create or delete a location based resource must populate * the 'current_locations' field and not the 'original_locations' field. * For example: - * "europe-west1-a" - * "us-east1" - * "nam3" + * + * "europe-west1-a" + * "us-east1" + * "nam3" * * * repeated string current_locations = 1; @@ -794,9 +807,11 @@ public Builder addCurrentLocations(java.lang.String value) { public Builder addAllCurrentLocations(java.lang.Iterable values) { ensureCurrentLocationsIsMutable(); com.google.protobuf.AbstractMessageLite.Builder.addAll(values, currentLocations_); + bitField0_ |= 0x00000001; onChanged(); return this; } + /** * * @@ -805,9 +820,10 @@ public Builder addAllCurrentLocations(java.lang.Iterable value * Requests to create or delete a location based resource must populate * the 'current_locations' field and not the 'original_locations' field. * For example: - * "europe-west1-a" - * "us-east1" - * "nam3" + * + * "europe-west1-a" + * "us-east1" + * "nam3" * * * repeated string current_locations = 1; @@ -815,11 +831,13 @@ public Builder addAllCurrentLocations(java.lang.Iterable value * @return This builder for chaining. */ public Builder clearCurrentLocations() { - currentLocations_ = com.google.protobuf.LazyStringArrayList.EMPTY; + currentLocations_ = com.google.protobuf.LazyStringArrayList.emptyList(); bitField0_ = (bitField0_ & ~0x00000001); + ; onChanged(); return this; } + /** * * @@ -828,9 +846,10 @@ public Builder clearCurrentLocations() { * Requests to create or delete a location based resource must populate * the 'current_locations' field and not the 'original_locations' field. * For example: - * "europe-west1-a" - * "us-east1" - * "nam3" + * + * "europe-west1-a" + * "us-east1" + * "nam3" * * * repeated string current_locations = 1; @@ -845,19 +864,21 @@ public Builder addCurrentLocationsBytes(com.google.protobuf.ByteString value) { checkByteStringIsUtf8(value); ensureCurrentLocationsIsMutable(); currentLocations_.add(value); + bitField0_ |= 0x00000001; onChanged(); return this; } - private com.google.protobuf.LazyStringList originalLocations_ = - com.google.protobuf.LazyStringArrayList.EMPTY; + private com.google.protobuf.LazyStringArrayList originalLocations_ = + com.google.protobuf.LazyStringArrayList.emptyList(); private void ensureOriginalLocationsIsMutable() { - if (!((bitField0_ & 0x00000002) != 0)) { + if (!originalLocations_.isModifiable()) { originalLocations_ = new com.google.protobuf.LazyStringArrayList(originalLocations_); - bitField0_ |= 0x00000002; } + bitField0_ |= 0x00000002; } + /** * * @@ -866,9 +887,10 @@ private void ensureOriginalLocationsIsMutable() { * Requests that mutate the resource's location must populate both the * 'original_locations' as well as the 'current_locations' fields. * For example: - * "europe-west1-a" - * "us-east1" - * "nam3" + * + * "europe-west1-a" + * "us-east1" + * "nam3" * * * repeated string original_locations = 2; @@ -876,8 +898,10 @@ private void ensureOriginalLocationsIsMutable() { * @return A list containing the originalLocations. */ public com.google.protobuf.ProtocolStringList getOriginalLocationsList() { - return originalLocations_.getUnmodifiableView(); + originalLocations_.makeImmutable(); + return originalLocations_; } + /** * * @@ -886,9 +910,10 @@ public com.google.protobuf.ProtocolStringList getOriginalLocationsList() { * Requests that mutate the resource's location must populate both the * 'original_locations' as well as the 'current_locations' fields. * For example: - * "europe-west1-a" - * "us-east1" - * "nam3" + * + * "europe-west1-a" + * "us-east1" + * "nam3" * * * repeated string original_locations = 2; @@ -898,6 +923,7 @@ public com.google.protobuf.ProtocolStringList getOriginalLocationsList() { public int getOriginalLocationsCount() { return originalLocations_.size(); } + /** * * @@ -906,9 +932,10 @@ public int getOriginalLocationsCount() { * Requests that mutate the resource's location must populate both the * 'original_locations' as well as the 'current_locations' fields. * For example: - * "europe-west1-a" - * "us-east1" - * "nam3" + * + * "europe-west1-a" + * "us-east1" + * "nam3" * * * repeated string original_locations = 2; @@ -919,6 +946,7 @@ public int getOriginalLocationsCount() { public java.lang.String getOriginalLocations(int index) { return originalLocations_.get(index); } + /** * * @@ -927,9 +955,10 @@ public java.lang.String getOriginalLocations(int index) { * Requests that mutate the resource's location must populate both the * 'original_locations' as well as the 'current_locations' fields. * For example: - * "europe-west1-a" - * "us-east1" - * "nam3" + * + * "europe-west1-a" + * "us-east1" + * "nam3" * * * repeated string original_locations = 2; @@ -940,6 +969,7 @@ public java.lang.String getOriginalLocations(int index) { public com.google.protobuf.ByteString getOriginalLocationsBytes(int index) { return originalLocations_.getByteString(index); } + /** * * @@ -948,9 +978,10 @@ public com.google.protobuf.ByteString getOriginalLocationsBytes(int index) { * Requests that mutate the resource's location must populate both the * 'original_locations' as well as the 'current_locations' fields. * For example: - * "europe-west1-a" - * "us-east1" - * "nam3" + * + * "europe-west1-a" + * "us-east1" + * "nam3" * * * repeated string original_locations = 2; @@ -965,9 +996,11 @@ public Builder setOriginalLocations(int index, java.lang.String value) { } ensureOriginalLocationsIsMutable(); originalLocations_.set(index, value); + bitField0_ |= 0x00000002; onChanged(); return this; } + /** * * @@ -976,9 +1009,10 @@ public Builder setOriginalLocations(int index, java.lang.String value) { * Requests that mutate the resource's location must populate both the * 'original_locations' as well as the 'current_locations' fields. * For example: - * "europe-west1-a" - * "us-east1" - * "nam3" + * + * "europe-west1-a" + * "us-east1" + * "nam3" * * * repeated string original_locations = 2; @@ -992,9 +1026,11 @@ public Builder addOriginalLocations(java.lang.String value) { } ensureOriginalLocationsIsMutable(); originalLocations_.add(value); + bitField0_ |= 0x00000002; onChanged(); return this; } + /** * * @@ -1003,9 +1039,10 @@ public Builder addOriginalLocations(java.lang.String value) { * Requests that mutate the resource's location must populate both the * 'original_locations' as well as the 'current_locations' fields. * For example: - * "europe-west1-a" - * "us-east1" - * "nam3" + * + * "europe-west1-a" + * "us-east1" + * "nam3" * * * repeated string original_locations = 2; @@ -1016,9 +1053,11 @@ public Builder addOriginalLocations(java.lang.String value) { public Builder addAllOriginalLocations(java.lang.Iterable values) { ensureOriginalLocationsIsMutable(); com.google.protobuf.AbstractMessageLite.Builder.addAll(values, originalLocations_); + bitField0_ |= 0x00000002; onChanged(); return this; } + /** * * @@ -1027,9 +1066,10 @@ public Builder addAllOriginalLocations(java.lang.Iterable valu * Requests that mutate the resource's location must populate both the * 'original_locations' as well as the 'current_locations' fields. * For example: - * "europe-west1-a" - * "us-east1" - * "nam3" + * + * "europe-west1-a" + * "us-east1" + * "nam3" * * * repeated string original_locations = 2; @@ -1037,11 +1077,13 @@ public Builder addAllOriginalLocations(java.lang.Iterable valu * @return This builder for chaining. */ public Builder clearOriginalLocations() { - originalLocations_ = com.google.protobuf.LazyStringArrayList.EMPTY; + originalLocations_ = com.google.protobuf.LazyStringArrayList.emptyList(); bitField0_ = (bitField0_ & ~0x00000002); + ; onChanged(); return this; } + /** * * @@ -1050,9 +1092,10 @@ public Builder clearOriginalLocations() { * Requests that mutate the resource's location must populate both the * 'original_locations' as well as the 'current_locations' fields. * For example: - * "europe-west1-a" - * "us-east1" - * "nam3" + * + * "europe-west1-a" + * "us-east1" + * "nam3" * * * repeated string original_locations = 2; @@ -1067,21 +1110,11 @@ public Builder addOriginalLocationsBytes(com.google.protobuf.ByteString value) { checkByteStringIsUtf8(value); ensureOriginalLocationsIsMutable(); originalLocations_.add(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.cloud.audit.ResourceLocation) } diff --git a/java-common-protos/proto-google-common-protos/src/main/java/com/google/cloud/audit/ResourceLocationOrBuilder.java b/java-common-protos/proto-google-common-protos/src/main/java/com/google/cloud/audit/ResourceLocationOrBuilder.java index 2a0e76f4af..7694a725cb 100644 --- a/java-common-protos/proto-google-common-protos/src/main/java/com/google/cloud/audit/ResourceLocationOrBuilder.java +++ b/java-common-protos/proto-google-common-protos/src/main/java/com/google/cloud/audit/ResourceLocationOrBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,10 +14,13 @@ * limitations under the License. */ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: google/cloud/audit/audit_log.proto +// Protobuf Java Version: 4.33.2 package com.google.cloud.audit; +@com.google.protobuf.Generated public interface ResourceLocationOrBuilder extends // @@protoc_insertion_point(interface_extends:google.cloud.audit.ResourceLocation) @@ -31,9 +34,10 @@ public interface ResourceLocationOrBuilder * Requests to create or delete a location based resource must populate * the 'current_locations' field and not the 'original_locations' field. * For example: - * "europe-west1-a" - * "us-east1" - * "nam3" + * + * "europe-west1-a" + * "us-east1" + * "nam3" * * * repeated string current_locations = 1; @@ -41,6 +45,7 @@ public interface ResourceLocationOrBuilder * @return A list containing the currentLocations. */ java.util.List getCurrentLocationsList(); + /** * * @@ -49,9 +54,10 @@ public interface ResourceLocationOrBuilder * Requests to create or delete a location based resource must populate * the 'current_locations' field and not the 'original_locations' field. * For example: - * "europe-west1-a" - * "us-east1" - * "nam3" + * + * "europe-west1-a" + * "us-east1" + * "nam3" * * * repeated string current_locations = 1; @@ -59,6 +65,7 @@ public interface ResourceLocationOrBuilder * @return The count of currentLocations. */ int getCurrentLocationsCount(); + /** * * @@ -67,9 +74,10 @@ public interface ResourceLocationOrBuilder * Requests to create or delete a location based resource must populate * the 'current_locations' field and not the 'original_locations' field. * For example: - * "europe-west1-a" - * "us-east1" - * "nam3" + * + * "europe-west1-a" + * "us-east1" + * "nam3" * * * repeated string current_locations = 1; @@ -78,6 +86,7 @@ public interface ResourceLocationOrBuilder * @return The currentLocations at the given index. */ java.lang.String getCurrentLocations(int index); + /** * * @@ -86,9 +95,10 @@ public interface ResourceLocationOrBuilder * Requests to create or delete a location based resource must populate * the 'current_locations' field and not the 'original_locations' field. * For example: - * "europe-west1-a" - * "us-east1" - * "nam3" + * + * "europe-west1-a" + * "us-east1" + * "nam3" * * * repeated string current_locations = 1; @@ -106,9 +116,10 @@ public interface ResourceLocationOrBuilder * Requests that mutate the resource's location must populate both the * 'original_locations' as well as the 'current_locations' fields. * For example: - * "europe-west1-a" - * "us-east1" - * "nam3" + * + * "europe-west1-a" + * "us-east1" + * "nam3" * * * repeated string original_locations = 2; @@ -116,6 +127,7 @@ public interface ResourceLocationOrBuilder * @return A list containing the originalLocations. */ java.util.List getOriginalLocationsList(); + /** * * @@ -124,9 +136,10 @@ public interface ResourceLocationOrBuilder * Requests that mutate the resource's location must populate both the * 'original_locations' as well as the 'current_locations' fields. * For example: - * "europe-west1-a" - * "us-east1" - * "nam3" + * + * "europe-west1-a" + * "us-east1" + * "nam3" * * * repeated string original_locations = 2; @@ -134,6 +147,7 @@ public interface ResourceLocationOrBuilder * @return The count of originalLocations. */ int getOriginalLocationsCount(); + /** * * @@ -142,9 +156,10 @@ public interface ResourceLocationOrBuilder * Requests that mutate the resource's location must populate both the * 'original_locations' as well as the 'current_locations' fields. * For example: - * "europe-west1-a" - * "us-east1" - * "nam3" + * + * "europe-west1-a" + * "us-east1" + * "nam3" * * * repeated string original_locations = 2; @@ -153,6 +168,7 @@ public interface ResourceLocationOrBuilder * @return The originalLocations at the given index. */ java.lang.String getOriginalLocations(int index); + /** * * @@ -161,9 +177,10 @@ public interface ResourceLocationOrBuilder * Requests that mutate the resource's location must populate both the * 'original_locations' as well as the 'current_locations' fields. * For example: - * "europe-west1-a" - * "us-east1" - * "nam3" + * + * "europe-west1-a" + * "us-east1" + * "nam3" * * * repeated string original_locations = 2; diff --git a/java-common-protos/proto-google-common-protos/src/main/java/com/google/cloud/audit/ServiceAccountDelegationInfo.java b/java-common-protos/proto-google-common-protos/src/main/java/com/google/cloud/audit/ServiceAccountDelegationInfo.java index 8128d5afd5..d31843945f 100644 --- a/java-common-protos/proto-google-common-protos/src/main/java/com/google/cloud/audit/ServiceAccountDelegationInfo.java +++ b/java-common-protos/proto-google-common-protos/src/main/java/com/google/cloud/audit/ServiceAccountDelegationInfo.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,9 @@ * limitations under the License. */ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: google/cloud/audit/audit_log.proto +// Protobuf Java Version: 4.33.2 package com.google.cloud.audit; @@ -27,13 +29,25 @@ * * Protobuf type {@code google.cloud.audit.ServiceAccountDelegationInfo} */ -public final class ServiceAccountDelegationInfo extends com.google.protobuf.GeneratedMessageV3 +@com.google.protobuf.Generated +public final class ServiceAccountDelegationInfo extends com.google.protobuf.GeneratedMessage implements // @@protoc_insertion_point(message_implements:google.cloud.audit.ServiceAccountDelegationInfo) ServiceAccountDelegationInfoOrBuilder { private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "ServiceAccountDelegationInfo"); + } + // Use ServiceAccountDelegationInfo.newBuilder() to construct. - private ServiceAccountDelegationInfo(com.google.protobuf.GeneratedMessageV3.Builder builder) { + private ServiceAccountDelegationInfo(com.google.protobuf.GeneratedMessage.Builder builder) { super(builder); } @@ -41,24 +55,13 @@ private ServiceAccountDelegationInfo() { principalSubject_ = ""; } - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new ServiceAccountDelegationInfo(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.cloud.audit.AuditLogProto .internal_static_google_cloud_audit_ServiceAccountDelegationInfo_descriptor; } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.cloud.audit.AuditLogProto .internal_static_google_cloud_audit_ServiceAccountDelegationInfo_fieldAccessorTable @@ -84,6 +87,7 @@ public interface FirstPartyPrincipalOrBuilder * @return The principalEmail. */ java.lang.String getPrincipalEmail(); + /** * * @@ -109,6 +113,7 @@ public interface FirstPartyPrincipalOrBuilder * @return Whether the serviceMetadata field is set. */ boolean hasServiceMetadata(); + /** * * @@ -121,6 +126,7 @@ public interface FirstPartyPrincipalOrBuilder * @return The serviceMetadata. */ com.google.protobuf.Struct getServiceMetadata(); + /** * * @@ -132,6 +138,7 @@ public interface FirstPartyPrincipalOrBuilder */ com.google.protobuf.StructOrBuilder getServiceMetadataOrBuilder(); } + /** * * @@ -141,13 +148,24 @@ public interface FirstPartyPrincipalOrBuilder * * Protobuf type {@code google.cloud.audit.ServiceAccountDelegationInfo.FirstPartyPrincipal} */ - public static final class FirstPartyPrincipal extends com.google.protobuf.GeneratedMessageV3 + public static final class FirstPartyPrincipal extends com.google.protobuf.GeneratedMessage implements // @@protoc_insertion_point(message_implements:google.cloud.audit.ServiceAccountDelegationInfo.FirstPartyPrincipal) FirstPartyPrincipalOrBuilder { private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "FirstPartyPrincipal"); + } + // Use FirstPartyPrincipal.newBuilder() to construct. - private FirstPartyPrincipal(com.google.protobuf.GeneratedMessageV3.Builder builder) { + private FirstPartyPrincipal(com.google.protobuf.GeneratedMessage.Builder builder) { super(builder); } @@ -155,24 +173,13 @@ private FirstPartyPrincipal() { principalEmail_ = ""; } - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new FirstPartyPrincipal(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.cloud.audit.AuditLogProto .internal_static_google_cloud_audit_ServiceAccountDelegationInfo_FirstPartyPrincipal_descriptor; } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.cloud.audit.AuditLogProto .internal_static_google_cloud_audit_ServiceAccountDelegationInfo_FirstPartyPrincipal_fieldAccessorTable @@ -182,8 +189,12 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { .class); } + private int bitField0_; public static final int PRINCIPAL_EMAIL_FIELD_NUMBER = 1; - private volatile java.lang.Object principalEmail_; + + @SuppressWarnings("serial") + private volatile java.lang.Object principalEmail_ = ""; + /** * * @@ -207,6 +218,7 @@ public java.lang.String getPrincipalEmail() { return s; } } + /** * * @@ -233,6 +245,7 @@ public com.google.protobuf.ByteString getPrincipalEmailBytes() { public static final int SERVICE_METADATA_FIELD_NUMBER = 2; private com.google.protobuf.Struct serviceMetadata_; + /** * * @@ -246,8 +259,9 @@ public com.google.protobuf.ByteString getPrincipalEmailBytes() { */ @java.lang.Override public boolean hasServiceMetadata() { - return serviceMetadata_ != null; + return ((bitField0_ & 0x00000001) != 0); } + /** * * @@ -265,6 +279,7 @@ public com.google.protobuf.Struct getServiceMetadata() { ? com.google.protobuf.Struct.getDefaultInstance() : serviceMetadata_; } + /** * * @@ -276,7 +291,9 @@ public com.google.protobuf.Struct getServiceMetadata() { */ @java.lang.Override public com.google.protobuf.StructOrBuilder getServiceMetadataOrBuilder() { - return getServiceMetadata(); + return serviceMetadata_ == null + ? com.google.protobuf.Struct.getDefaultInstance() + : serviceMetadata_; } private byte memoizedIsInitialized = -1; @@ -293,10 +310,10 @@ public final boolean isInitialized() { @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(principalEmail_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, principalEmail_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(principalEmail_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, principalEmail_); } - if (serviceMetadata_ != null) { + if (((bitField0_ & 0x00000001) != 0)) { output.writeMessage(2, getServiceMetadata()); } getUnknownFields().writeTo(output); @@ -308,10 +325,10 @@ public int getSerializedSize() { if (size != -1) return size; size = 0; - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(principalEmail_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, principalEmail_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(principalEmail_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, principalEmail_); } - if (serviceMetadata_ != null) { + if (((bitField0_ & 0x00000001) != 0)) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getServiceMetadata()); } size += getUnknownFields().getSerializedSize(); @@ -395,39 +412,39 @@ public static com.google.cloud.audit.ServiceAccountDelegationInfo.FirstPartyPrin public static com.google.cloud.audit.ServiceAccountDelegationInfo.FirstPartyPrincipal parseFrom( java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); } public static com.google.cloud.audit.ServiceAccountDelegationInfo.FirstPartyPrincipal parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } public static com.google.cloud.audit.ServiceAccountDelegationInfo.FirstPartyPrincipal parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); } public static com.google.cloud.audit.ServiceAccountDelegationInfo.FirstPartyPrincipal parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( PARSER, input, extensionRegistry); } public static com.google.cloud.audit.ServiceAccountDelegationInfo.FirstPartyPrincipal parseFrom( com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); } public static com.google.cloud.audit.ServiceAccountDelegationInfo.FirstPartyPrincipal parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } @@ -451,11 +468,11 @@ public Builder toBuilder() { } @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { Builder builder = new Builder(parent); return builder; } + /** * * @@ -465,8 +482,7 @@ protected Builder newBuilderForType( * * Protobuf type {@code google.cloud.audit.ServiceAccountDelegationInfo.FirstPartyPrincipal} */ - public static final class Builder - extends com.google.protobuf.GeneratedMessageV3.Builder + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder implements // @@protoc_insertion_point(builder_implements:google.cloud.audit.ServiceAccountDelegationInfo.FirstPartyPrincipal) com.google.cloud.audit.ServiceAccountDelegationInfo.FirstPartyPrincipalOrBuilder { @@ -476,7 +492,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.cloud.audit.AuditLogProto .internal_static_google_cloud_audit_ServiceAccountDelegationInfo_FirstPartyPrincipal_fieldAccessorTable @@ -488,21 +504,29 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { // Construct using // com.google.cloud.audit.ServiceAccountDelegationInfo.FirstPartyPrincipal.newBuilder() - private Builder() {} + private Builder() { + maybeForceBuilderInitialization(); + } - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetServiceMetadataFieldBuilder(); + } } @java.lang.Override public Builder clear() { super.clear(); + bitField0_ = 0; principalEmail_ = ""; - - if (serviceMetadataBuilder_ == null) { - serviceMetadata_ = null; - } else { - serviceMetadata_ = null; + serviceMetadata_ = null; + if (serviceMetadataBuilder_ != null) { + serviceMetadataBuilder_.dispose(); serviceMetadataBuilder_ = null; } return this; @@ -536,49 +560,26 @@ public com.google.cloud.audit.ServiceAccountDelegationInfo.FirstPartyPrincipal b buildPartial() { com.google.cloud.audit.ServiceAccountDelegationInfo.FirstPartyPrincipal result = new com.google.cloud.audit.ServiceAccountDelegationInfo.FirstPartyPrincipal(this); - result.principalEmail_ = principalEmail_; - if (serviceMetadataBuilder_ == null) { - result.serviceMetadata_ = serviceMetadata_; - } else { - result.serviceMetadata_ = serviceMetadataBuilder_.build(); + if (bitField0_ != 0) { + buildPartial0(result); } 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); + private void buildPartial0( + com.google.cloud.audit.ServiceAccountDelegationInfo.FirstPartyPrincipal result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.principalEmail_ = principalEmail_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.serviceMetadata_ = + serviceMetadataBuilder_ == null ? serviceMetadata_ : serviceMetadataBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + result.bitField0_ |= to_bitField0_; } @java.lang.Override @@ -600,6 +601,7 @@ public Builder mergeFrom( .getDefaultInstance()) return this; if (!other.getPrincipalEmail().isEmpty()) { principalEmail_ = other.principalEmail_; + bitField0_ |= 0x00000001; onChanged(); } if (other.hasServiceMetadata()) { @@ -634,14 +636,14 @@ public Builder mergeFrom( case 10: { principalEmail_ = input.readStringRequireUtf8(); - + bitField0_ |= 0x00000001; break; } // case 10 case 18: { input.readMessage( - getServiceMetadataFieldBuilder().getBuilder(), extensionRegistry); - + internalGetServiceMetadataFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; break; } // case 18 default: @@ -661,7 +663,10 @@ public Builder mergeFrom( return this; } + private int bitField0_; + private java.lang.Object principalEmail_ = ""; + /** * * @@ -684,6 +689,7 @@ public java.lang.String getPrincipalEmail() { return (java.lang.String) ref; } } + /** * * @@ -706,6 +712,7 @@ public com.google.protobuf.ByteString getPrincipalEmailBytes() { return (com.google.protobuf.ByteString) ref; } } + /** * * @@ -722,11 +729,12 @@ public Builder setPrincipalEmail(java.lang.String value) { if (value == null) { throw new NullPointerException(); } - principalEmail_ = value; + bitField0_ |= 0x00000001; onChanged(); return this; } + /** * * @@ -739,11 +747,12 @@ public Builder setPrincipalEmail(java.lang.String value) { * @return This builder for chaining. */ public Builder clearPrincipalEmail() { - principalEmail_ = getDefaultInstance().getPrincipalEmail(); + bitField0_ = (bitField0_ & ~0x00000001); onChanged(); return this; } + /** * * @@ -761,18 +770,19 @@ public Builder setPrincipalEmailBytes(com.google.protobuf.ByteString value) { throw new NullPointerException(); } checkByteStringIsUtf8(value); - principalEmail_ = value; + bitField0_ |= 0x00000001; onChanged(); return this; } private com.google.protobuf.Struct serviceMetadata_; - private com.google.protobuf.SingleFieldBuilderV3< + private com.google.protobuf.SingleFieldBuilder< com.google.protobuf.Struct, com.google.protobuf.Struct.Builder, com.google.protobuf.StructOrBuilder> serviceMetadataBuilder_; + /** * * @@ -785,8 +795,9 @@ public Builder setPrincipalEmailBytes(com.google.protobuf.ByteString value) { * @return Whether the serviceMetadata field is set. */ public boolean hasServiceMetadata() { - return serviceMetadataBuilder_ != null || serviceMetadata_ != null; + return ((bitField0_ & 0x00000002) != 0); } + /** * * @@ -807,6 +818,7 @@ public com.google.protobuf.Struct getServiceMetadata() { return serviceMetadataBuilder_.getMessage(); } } + /** * * @@ -822,13 +834,14 @@ public Builder setServiceMetadata(com.google.protobuf.Struct value) { throw new NullPointerException(); } serviceMetadata_ = value; - onChanged(); } else { serviceMetadataBuilder_.setMessage(value); } - + bitField0_ |= 0x00000002; + onChanged(); return this; } + /** * * @@ -841,13 +854,14 @@ public Builder setServiceMetadata(com.google.protobuf.Struct value) { public Builder setServiceMetadata(com.google.protobuf.Struct.Builder builderForValue) { if (serviceMetadataBuilder_ == null) { serviceMetadata_ = builderForValue.build(); - onChanged(); } else { serviceMetadataBuilder_.setMessage(builderForValue.build()); } - + bitField0_ |= 0x00000002; + onChanged(); return this; } + /** * * @@ -859,21 +873,23 @@ public Builder setServiceMetadata(com.google.protobuf.Struct.Builder builderForV */ public Builder mergeServiceMetadata(com.google.protobuf.Struct value) { if (serviceMetadataBuilder_ == null) { - if (serviceMetadata_ != null) { - serviceMetadata_ = - com.google.protobuf.Struct.newBuilder(serviceMetadata_) - .mergeFrom(value) - .buildPartial(); + if (((bitField0_ & 0x00000002) != 0) + && serviceMetadata_ != null + && serviceMetadata_ != com.google.protobuf.Struct.getDefaultInstance()) { + getServiceMetadataBuilder().mergeFrom(value); } else { serviceMetadata_ = value; } - onChanged(); } else { serviceMetadataBuilder_.mergeFrom(value); } - + if (serviceMetadata_ != null) { + bitField0_ |= 0x00000002; + onChanged(); + } return this; } + /** * * @@ -884,16 +900,16 @@ public Builder mergeServiceMetadata(com.google.protobuf.Struct value) { * .google.protobuf.Struct service_metadata = 2; */ public Builder clearServiceMetadata() { - if (serviceMetadataBuilder_ == null) { - serviceMetadata_ = null; - onChanged(); - } else { - serviceMetadata_ = null; + bitField0_ = (bitField0_ & ~0x00000002); + serviceMetadata_ = null; + if (serviceMetadataBuilder_ != null) { + serviceMetadataBuilder_.dispose(); serviceMetadataBuilder_ = null; } - + onChanged(); return this; } + /** * * @@ -904,10 +920,11 @@ public Builder clearServiceMetadata() { * .google.protobuf.Struct service_metadata = 2; */ public com.google.protobuf.Struct.Builder getServiceMetadataBuilder() { - + bitField0_ |= 0x00000002; onChanged(); - return getServiceMetadataFieldBuilder().getBuilder(); + return internalGetServiceMetadataFieldBuilder().getBuilder(); } + /** * * @@ -926,6 +943,7 @@ public com.google.protobuf.StructOrBuilder getServiceMetadataOrBuilder() { : serviceMetadata_; } } + /** * * @@ -935,14 +953,14 @@ public com.google.protobuf.StructOrBuilder getServiceMetadataOrBuilder() { * * .google.protobuf.Struct service_metadata = 2; */ - private com.google.protobuf.SingleFieldBuilderV3< + private com.google.protobuf.SingleFieldBuilder< com.google.protobuf.Struct, com.google.protobuf.Struct.Builder, com.google.protobuf.StructOrBuilder> - getServiceMetadataFieldBuilder() { + internalGetServiceMetadataFieldBuilder() { if (serviceMetadataBuilder_ == null) { serviceMetadataBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< + new com.google.protobuf.SingleFieldBuilder< com.google.protobuf.Struct, com.google.protobuf.Struct.Builder, com.google.protobuf.StructOrBuilder>( @@ -952,18 +970,6 @@ public com.google.protobuf.StructOrBuilder getServiceMetadataOrBuilder() { return serviceMetadataBuilder_; } - @java.lang.Override - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - // @@protoc_insertion_point(builder_scope:google.cloud.audit.ServiceAccountDelegationInfo.FirstPartyPrincipal) } @@ -1037,6 +1043,7 @@ public interface ThirdPartyPrincipalOrBuilder * @return Whether the thirdPartyClaims field is set. */ boolean hasThirdPartyClaims(); + /** * * @@ -1049,6 +1056,7 @@ public interface ThirdPartyPrincipalOrBuilder * @return The thirdPartyClaims. */ com.google.protobuf.Struct getThirdPartyClaims(); + /** * * @@ -1060,6 +1068,7 @@ public interface ThirdPartyPrincipalOrBuilder */ com.google.protobuf.StructOrBuilder getThirdPartyClaimsOrBuilder(); } + /** * * @@ -1069,36 +1078,36 @@ public interface ThirdPartyPrincipalOrBuilder * * Protobuf type {@code google.cloud.audit.ServiceAccountDelegationInfo.ThirdPartyPrincipal} */ - public static final class ThirdPartyPrincipal extends com.google.protobuf.GeneratedMessageV3 + public static final class ThirdPartyPrincipal extends com.google.protobuf.GeneratedMessage implements // @@protoc_insertion_point(message_implements:google.cloud.audit.ServiceAccountDelegationInfo.ThirdPartyPrincipal) ThirdPartyPrincipalOrBuilder { private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "ThirdPartyPrincipal"); + } + // Use ThirdPartyPrincipal.newBuilder() to construct. - private ThirdPartyPrincipal(com.google.protobuf.GeneratedMessageV3.Builder builder) { + private ThirdPartyPrincipal(com.google.protobuf.GeneratedMessage.Builder builder) { super(builder); } private ThirdPartyPrincipal() {} - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new ThirdPartyPrincipal(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.cloud.audit.AuditLogProto .internal_static_google_cloud_audit_ServiceAccountDelegationInfo_ThirdPartyPrincipal_descriptor; } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.cloud.audit.AuditLogProto .internal_static_google_cloud_audit_ServiceAccountDelegationInfo_ThirdPartyPrincipal_fieldAccessorTable @@ -1108,8 +1117,10 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { .class); } + private int bitField0_; public static final int THIRD_PARTY_CLAIMS_FIELD_NUMBER = 1; private com.google.protobuf.Struct thirdPartyClaims_; + /** * * @@ -1123,8 +1134,9 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { */ @java.lang.Override public boolean hasThirdPartyClaims() { - return thirdPartyClaims_ != null; + return ((bitField0_ & 0x00000001) != 0); } + /** * * @@ -1142,6 +1154,7 @@ public com.google.protobuf.Struct getThirdPartyClaims() { ? com.google.protobuf.Struct.getDefaultInstance() : thirdPartyClaims_; } + /** * * @@ -1153,7 +1166,9 @@ public com.google.protobuf.Struct getThirdPartyClaims() { */ @java.lang.Override public com.google.protobuf.StructOrBuilder getThirdPartyClaimsOrBuilder() { - return getThirdPartyClaims(); + return thirdPartyClaims_ == null + ? com.google.protobuf.Struct.getDefaultInstance() + : thirdPartyClaims_; } private byte memoizedIsInitialized = -1; @@ -1170,7 +1185,7 @@ public final boolean isInitialized() { @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (thirdPartyClaims_ != null) { + if (((bitField0_ & 0x00000001) != 0)) { output.writeMessage(1, getThirdPartyClaims()); } getUnknownFields().writeTo(output); @@ -1182,7 +1197,7 @@ public int getSerializedSize() { if (size != -1) return size; size = 0; - if (thirdPartyClaims_ != null) { + if (((bitField0_ & 0x00000001) != 0)) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getThirdPartyClaims()); } size += getUnknownFields().getSerializedSize(); @@ -1263,39 +1278,39 @@ public static com.google.cloud.audit.ServiceAccountDelegationInfo.ThirdPartyPrin public static com.google.cloud.audit.ServiceAccountDelegationInfo.ThirdPartyPrincipal parseFrom( java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); } public static com.google.cloud.audit.ServiceAccountDelegationInfo.ThirdPartyPrincipal parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } public static com.google.cloud.audit.ServiceAccountDelegationInfo.ThirdPartyPrincipal parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); } public static com.google.cloud.audit.ServiceAccountDelegationInfo.ThirdPartyPrincipal parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( PARSER, input, extensionRegistry); } public static com.google.cloud.audit.ServiceAccountDelegationInfo.ThirdPartyPrincipal parseFrom( com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); } public static com.google.cloud.audit.ServiceAccountDelegationInfo.ThirdPartyPrincipal parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } @@ -1319,11 +1334,11 @@ public Builder toBuilder() { } @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { Builder builder = new Builder(parent); return builder; } + /** * * @@ -1333,8 +1348,7 @@ protected Builder newBuilderForType( * * Protobuf type {@code google.cloud.audit.ServiceAccountDelegationInfo.ThirdPartyPrincipal} */ - public static final class Builder - extends com.google.protobuf.GeneratedMessageV3.Builder + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder implements // @@protoc_insertion_point(builder_implements:google.cloud.audit.ServiceAccountDelegationInfo.ThirdPartyPrincipal) com.google.cloud.audit.ServiceAccountDelegationInfo.ThirdPartyPrincipalOrBuilder { @@ -1344,7 +1358,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.cloud.audit.AuditLogProto .internal_static_google_cloud_audit_ServiceAccountDelegationInfo_ThirdPartyPrincipal_fieldAccessorTable @@ -1356,19 +1370,28 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { // Construct using // com.google.cloud.audit.ServiceAccountDelegationInfo.ThirdPartyPrincipal.newBuilder() - private Builder() {} + private Builder() { + maybeForceBuilderInitialization(); + } - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetThirdPartyClaimsFieldBuilder(); + } } @java.lang.Override public Builder clear() { super.clear(); - if (thirdPartyClaimsBuilder_ == null) { - thirdPartyClaims_ = null; - } else { - thirdPartyClaims_ = null; + bitField0_ = 0; + thirdPartyClaims_ = null; + if (thirdPartyClaimsBuilder_ != null) { + thirdPartyClaimsBuilder_.dispose(); thirdPartyClaimsBuilder_ = null; } return this; @@ -1402,48 +1425,25 @@ public com.google.cloud.audit.ServiceAccountDelegationInfo.ThirdPartyPrincipal b buildPartial() { com.google.cloud.audit.ServiceAccountDelegationInfo.ThirdPartyPrincipal result = new com.google.cloud.audit.ServiceAccountDelegationInfo.ThirdPartyPrincipal(this); - if (thirdPartyClaimsBuilder_ == null) { - result.thirdPartyClaims_ = thirdPartyClaims_; - } else { - result.thirdPartyClaims_ = thirdPartyClaimsBuilder_.build(); + if (bitField0_ != 0) { + buildPartial0(result); } 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); + private void buildPartial0( + com.google.cloud.audit.ServiceAccountDelegationInfo.ThirdPartyPrincipal result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.thirdPartyClaims_ = + thirdPartyClaimsBuilder_ == null + ? thirdPartyClaims_ + : thirdPartyClaimsBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + result.bitField0_ |= to_bitField0_; } @java.lang.Override @@ -1495,8 +1495,8 @@ public Builder mergeFrom( case 10: { input.readMessage( - getThirdPartyClaimsFieldBuilder().getBuilder(), extensionRegistry); - + internalGetThirdPartyClaimsFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000001; break; } // case 10 default: @@ -1516,12 +1516,15 @@ public Builder mergeFrom( return this; } + private int bitField0_; + private com.google.protobuf.Struct thirdPartyClaims_; - private com.google.protobuf.SingleFieldBuilderV3< + private com.google.protobuf.SingleFieldBuilder< com.google.protobuf.Struct, com.google.protobuf.Struct.Builder, com.google.protobuf.StructOrBuilder> thirdPartyClaimsBuilder_; + /** * * @@ -1534,8 +1537,9 @@ public Builder mergeFrom( * @return Whether the thirdPartyClaims field is set. */ public boolean hasThirdPartyClaims() { - return thirdPartyClaimsBuilder_ != null || thirdPartyClaims_ != null; + return ((bitField0_ & 0x00000001) != 0); } + /** * * @@ -1556,6 +1560,7 @@ public com.google.protobuf.Struct getThirdPartyClaims() { return thirdPartyClaimsBuilder_.getMessage(); } } + /** * * @@ -1571,13 +1576,14 @@ public Builder setThirdPartyClaims(com.google.protobuf.Struct value) { throw new NullPointerException(); } thirdPartyClaims_ = value; - onChanged(); } else { thirdPartyClaimsBuilder_.setMessage(value); } - + bitField0_ |= 0x00000001; + onChanged(); return this; } + /** * * @@ -1590,13 +1596,14 @@ public Builder setThirdPartyClaims(com.google.protobuf.Struct value) { public Builder setThirdPartyClaims(com.google.protobuf.Struct.Builder builderForValue) { if (thirdPartyClaimsBuilder_ == null) { thirdPartyClaims_ = builderForValue.build(); - onChanged(); } else { thirdPartyClaimsBuilder_.setMessage(builderForValue.build()); } - + bitField0_ |= 0x00000001; + onChanged(); return this; } + /** * * @@ -1608,21 +1615,23 @@ public Builder setThirdPartyClaims(com.google.protobuf.Struct.Builder builderFor */ public Builder mergeThirdPartyClaims(com.google.protobuf.Struct value) { if (thirdPartyClaimsBuilder_ == null) { - if (thirdPartyClaims_ != null) { - thirdPartyClaims_ = - com.google.protobuf.Struct.newBuilder(thirdPartyClaims_) - .mergeFrom(value) - .buildPartial(); + if (((bitField0_ & 0x00000001) != 0) + && thirdPartyClaims_ != null + && thirdPartyClaims_ != com.google.protobuf.Struct.getDefaultInstance()) { + getThirdPartyClaimsBuilder().mergeFrom(value); } else { thirdPartyClaims_ = value; } - onChanged(); } else { thirdPartyClaimsBuilder_.mergeFrom(value); } - + if (thirdPartyClaims_ != null) { + bitField0_ |= 0x00000001; + onChanged(); + } return this; } + /** * * @@ -1633,16 +1642,16 @@ public Builder mergeThirdPartyClaims(com.google.protobuf.Struct value) { * .google.protobuf.Struct third_party_claims = 1; */ public Builder clearThirdPartyClaims() { - if (thirdPartyClaimsBuilder_ == null) { - thirdPartyClaims_ = null; - onChanged(); - } else { - thirdPartyClaims_ = null; + bitField0_ = (bitField0_ & ~0x00000001); + thirdPartyClaims_ = null; + if (thirdPartyClaimsBuilder_ != null) { + thirdPartyClaimsBuilder_.dispose(); thirdPartyClaimsBuilder_ = null; } - + onChanged(); return this; } + /** * * @@ -1653,10 +1662,11 @@ public Builder clearThirdPartyClaims() { * .google.protobuf.Struct third_party_claims = 1; */ public com.google.protobuf.Struct.Builder getThirdPartyClaimsBuilder() { - + bitField0_ |= 0x00000001; onChanged(); - return getThirdPartyClaimsFieldBuilder().getBuilder(); + return internalGetThirdPartyClaimsFieldBuilder().getBuilder(); } + /** * * @@ -1675,6 +1685,7 @@ public com.google.protobuf.StructOrBuilder getThirdPartyClaimsOrBuilder() { : thirdPartyClaims_; } } + /** * * @@ -1684,14 +1695,14 @@ public com.google.protobuf.StructOrBuilder getThirdPartyClaimsOrBuilder() { * * .google.protobuf.Struct third_party_claims = 1; */ - private com.google.protobuf.SingleFieldBuilderV3< + private com.google.protobuf.SingleFieldBuilder< com.google.protobuf.Struct, com.google.protobuf.Struct.Builder, com.google.protobuf.StructOrBuilder> - getThirdPartyClaimsFieldBuilder() { + internalGetThirdPartyClaimsFieldBuilder() { if (thirdPartyClaimsBuilder_ == null) { thirdPartyClaimsBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< + new com.google.protobuf.SingleFieldBuilder< com.google.protobuf.Struct, com.google.protobuf.Struct.Builder, com.google.protobuf.StructOrBuilder>( @@ -1701,18 +1712,6 @@ public com.google.protobuf.StructOrBuilder getThirdPartyClaimsOrBuilder() { return thirdPartyClaimsBuilder_; } - @java.lang.Override - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - // @@protoc_insertion_point(builder_scope:google.cloud.audit.ServiceAccountDelegationInfo.ThirdPartyPrincipal) } @@ -1770,6 +1769,8 @@ public com.google.protobuf.Parser getParserForType() { } private int authorityCase_ = 0; + + @SuppressWarnings("serial") private java.lang.Object authority_; public enum AuthorityCase @@ -1784,6 +1785,7 @@ public enum AuthorityCase private AuthorityCase(int value) { this.value = value; } + /** * @param value The number of the enum to look for. * @return The enum associated with the given number. @@ -1817,7 +1819,10 @@ public AuthorityCase getAuthorityCase() { } public static final int PRINCIPAL_SUBJECT_FIELD_NUMBER = 3; - private volatile java.lang.Object principalSubject_; + + @SuppressWarnings("serial") + private volatile java.lang.Object principalSubject_ = ""; + /** * * @@ -1846,6 +1851,7 @@ public java.lang.String getPrincipalSubject() { return s; } } + /** * * @@ -1876,6 +1882,7 @@ public com.google.protobuf.ByteString getPrincipalSubjectBytes() { } public static final int FIRST_PARTY_PRINCIPAL_FIELD_NUMBER = 1; + /** * * @@ -1893,6 +1900,7 @@ public com.google.protobuf.ByteString getPrincipalSubjectBytes() { public boolean hasFirstPartyPrincipal() { return authorityCase_ == 1; } + /** * * @@ -1915,6 +1923,7 @@ public boolean hasFirstPartyPrincipal() { return com.google.cloud.audit.ServiceAccountDelegationInfo.FirstPartyPrincipal .getDefaultInstance(); } + /** * * @@ -1937,6 +1946,7 @@ public boolean hasFirstPartyPrincipal() { } public static final int THIRD_PARTY_PRINCIPAL_FIELD_NUMBER = 2; + /** * * @@ -1954,6 +1964,7 @@ public boolean hasFirstPartyPrincipal() { public boolean hasThirdPartyPrincipal() { return authorityCase_ == 2; } + /** * * @@ -1976,6 +1987,7 @@ public boolean hasThirdPartyPrincipal() { return com.google.cloud.audit.ServiceAccountDelegationInfo.ThirdPartyPrincipal .getDefaultInstance(); } + /** * * @@ -2019,8 +2031,8 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io output.writeMessage( 2, (com.google.cloud.audit.ServiceAccountDelegationInfo.ThirdPartyPrincipal) authority_); } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(principalSubject_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 3, principalSubject_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(principalSubject_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 3, principalSubject_); } getUnknownFields().writeTo(output); } @@ -2043,8 +2055,8 @@ public int getSerializedSize() { 2, (com.google.cloud.audit.ServiceAccountDelegationInfo.ThirdPartyPrincipal) authority_); } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(principalSubject_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, principalSubject_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(principalSubject_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(3, principalSubject_); } size += getUnknownFields().getSerializedSize(); memoizedSize = size; @@ -2141,38 +2153,38 @@ public static com.google.cloud.audit.ServiceAccountDelegationInfo parseFrom( public static com.google.cloud.audit.ServiceAccountDelegationInfo parseFrom( java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); } public static com.google.cloud.audit.ServiceAccountDelegationInfo parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } public static com.google.cloud.audit.ServiceAccountDelegationInfo parseDelimitedFrom( java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); } public static com.google.cloud.audit.ServiceAccountDelegationInfo parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( PARSER, input, extensionRegistry); } public static com.google.cloud.audit.ServiceAccountDelegationInfo parseFrom( com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); } public static com.google.cloud.audit.ServiceAccountDelegationInfo parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } @@ -2195,10 +2207,11 @@ public Builder toBuilder() { } @java.lang.Override - protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { Builder builder = new Builder(parent); return builder; } + /** * * @@ -2208,7 +2221,7 @@ protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.Build * * Protobuf type {@code google.cloud.audit.ServiceAccountDelegationInfo} */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder implements // @@protoc_insertion_point(builder_implements:google.cloud.audit.ServiceAccountDelegationInfo) com.google.cloud.audit.ServiceAccountDelegationInfoOrBuilder { @@ -2218,7 +2231,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.cloud.audit.AuditLogProto .internal_static_google_cloud_audit_ServiceAccountDelegationInfo_fieldAccessorTable @@ -2230,15 +2243,15 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { // Construct using com.google.cloud.audit.ServiceAccountDelegationInfo.newBuilder() private Builder() {} - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { super(parent); } @java.lang.Override public Builder clear() { super.clear(); + bitField0_ = 0; principalSubject_ = ""; - if (firstPartyPrincipalBuilder_ != null) { firstPartyPrincipalBuilder_.clear(); } @@ -2274,57 +2287,30 @@ public com.google.cloud.audit.ServiceAccountDelegationInfo build() { public com.google.cloud.audit.ServiceAccountDelegationInfo buildPartial() { com.google.cloud.audit.ServiceAccountDelegationInfo result = new com.google.cloud.audit.ServiceAccountDelegationInfo(this); - result.principalSubject_ = principalSubject_; - if (authorityCase_ == 1) { - if (firstPartyPrincipalBuilder_ == null) { - result.authority_ = authority_; - } else { - result.authority_ = firstPartyPrincipalBuilder_.build(); - } - } - if (authorityCase_ == 2) { - if (thirdPartyPrincipalBuilder_ == null) { - result.authority_ = authority_; - } else { - result.authority_ = thirdPartyPrincipalBuilder_.build(); - } + if (bitField0_ != 0) { + buildPartial0(result); } - result.authorityCase_ = authorityCase_; + buildPartialOneofs(result); 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); + private void buildPartial0(com.google.cloud.audit.ServiceAccountDelegationInfo result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.principalSubject_ = principalSubject_; + } } - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.addRepeatedField(field, value); + private void buildPartialOneofs(com.google.cloud.audit.ServiceAccountDelegationInfo result) { + result.authorityCase_ = authorityCase_; + result.authority_ = this.authority_; + if (authorityCase_ == 1 && firstPartyPrincipalBuilder_ != null) { + result.authority_ = firstPartyPrincipalBuilder_.build(); + } + if (authorityCase_ == 2 && thirdPartyPrincipalBuilder_ != null) { + result.authority_ = thirdPartyPrincipalBuilder_.build(); + } } @java.lang.Override @@ -2342,6 +2328,7 @@ public Builder mergeFrom(com.google.cloud.audit.ServiceAccountDelegationInfo oth return this; if (!other.getPrincipalSubject().isEmpty()) { principalSubject_ = other.principalSubject_; + bitField0_ |= 0x00000001; onChanged(); } switch (other.getAuthorityCase()) { @@ -2389,21 +2376,21 @@ public Builder mergeFrom( case 10: { input.readMessage( - getFirstPartyPrincipalFieldBuilder().getBuilder(), extensionRegistry); + internalGetFirstPartyPrincipalFieldBuilder().getBuilder(), extensionRegistry); authorityCase_ = 1; break; } // case 10 case 18: { input.readMessage( - getThirdPartyPrincipalFieldBuilder().getBuilder(), extensionRegistry); + internalGetThirdPartyPrincipalFieldBuilder().getBuilder(), extensionRegistry); authorityCase_ = 2; break; } // case 18 case 26: { principalSubject_ = input.readStringRequireUtf8(); - + bitField0_ |= 0x00000001; break; } // case 26 default: @@ -2437,7 +2424,10 @@ public Builder clearAuthority() { return this; } + private int bitField0_; + private java.lang.Object principalSubject_ = ""; + /** * * @@ -2465,6 +2455,7 @@ public java.lang.String getPrincipalSubject() { return (java.lang.String) ref; } } + /** * * @@ -2492,6 +2483,7 @@ public com.google.protobuf.ByteString getPrincipalSubjectBytes() { return (com.google.protobuf.ByteString) ref; } } + /** * * @@ -2513,11 +2505,12 @@ public Builder setPrincipalSubject(java.lang.String value) { if (value == null) { throw new NullPointerException(); } - principalSubject_ = value; + bitField0_ |= 0x00000001; onChanged(); return this; } + /** * * @@ -2535,11 +2528,12 @@ public Builder setPrincipalSubject(java.lang.String value) { * @return This builder for chaining. */ public Builder clearPrincipalSubject() { - principalSubject_ = getDefaultInstance().getPrincipalSubject(); + bitField0_ = (bitField0_ & ~0x00000001); onChanged(); return this; } + /** * * @@ -2562,17 +2556,18 @@ public Builder setPrincipalSubjectBytes(com.google.protobuf.ByteString value) { throw new NullPointerException(); } checkByteStringIsUtf8(value); - principalSubject_ = value; + bitField0_ |= 0x00000001; onChanged(); return this; } - private com.google.protobuf.SingleFieldBuilderV3< + private com.google.protobuf.SingleFieldBuilder< com.google.cloud.audit.ServiceAccountDelegationInfo.FirstPartyPrincipal, com.google.cloud.audit.ServiceAccountDelegationInfo.FirstPartyPrincipal.Builder, com.google.cloud.audit.ServiceAccountDelegationInfo.FirstPartyPrincipalOrBuilder> firstPartyPrincipalBuilder_; + /** * * @@ -2590,6 +2585,7 @@ public Builder setPrincipalSubjectBytes(com.google.protobuf.ByteString value) { public boolean hasFirstPartyPrincipal() { return authorityCase_ == 1; } + /** * * @@ -2621,6 +2617,7 @@ public boolean hasFirstPartyPrincipal() { .getDefaultInstance(); } } + /** * * @@ -2646,6 +2643,7 @@ public Builder setFirstPartyPrincipal( authorityCase_ = 1; return this; } + /** * * @@ -2669,6 +2667,7 @@ public Builder setFirstPartyPrincipal( authorityCase_ = 1; return this; } + /** * * @@ -2707,6 +2706,7 @@ public Builder mergeFirstPartyPrincipal( authorityCase_ = 1; return this; } + /** * * @@ -2734,6 +2734,7 @@ public Builder clearFirstPartyPrincipal() { } return this; } + /** * * @@ -2747,8 +2748,9 @@ public Builder clearFirstPartyPrincipal() { */ public com.google.cloud.audit.ServiceAccountDelegationInfo.FirstPartyPrincipal.Builder getFirstPartyPrincipalBuilder() { - return getFirstPartyPrincipalFieldBuilder().getBuilder(); + return internalGetFirstPartyPrincipalFieldBuilder().getBuilder(); } + /** * * @@ -2774,6 +2776,7 @@ public Builder clearFirstPartyPrincipal() { .getDefaultInstance(); } } + /** * * @@ -2785,11 +2788,11 @@ public Builder clearFirstPartyPrincipal() { * .google.cloud.audit.ServiceAccountDelegationInfo.FirstPartyPrincipal first_party_principal = 1; * */ - private com.google.protobuf.SingleFieldBuilderV3< + private com.google.protobuf.SingleFieldBuilder< com.google.cloud.audit.ServiceAccountDelegationInfo.FirstPartyPrincipal, com.google.cloud.audit.ServiceAccountDelegationInfo.FirstPartyPrincipal.Builder, com.google.cloud.audit.ServiceAccountDelegationInfo.FirstPartyPrincipalOrBuilder> - getFirstPartyPrincipalFieldBuilder() { + internalGetFirstPartyPrincipalFieldBuilder() { if (firstPartyPrincipalBuilder_ == null) { if (!(authorityCase_ == 1)) { authority_ = @@ -2797,7 +2800,7 @@ public Builder clearFirstPartyPrincipal() { .getDefaultInstance(); } firstPartyPrincipalBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< + new com.google.protobuf.SingleFieldBuilder< com.google.cloud.audit.ServiceAccountDelegationInfo.FirstPartyPrincipal, com.google.cloud.audit.ServiceAccountDelegationInfo.FirstPartyPrincipal.Builder, com.google.cloud.audit.ServiceAccountDelegationInfo.FirstPartyPrincipalOrBuilder>( @@ -2809,15 +2812,15 @@ public Builder clearFirstPartyPrincipal() { } authorityCase_ = 1; onChanged(); - ; return firstPartyPrincipalBuilder_; } - private com.google.protobuf.SingleFieldBuilderV3< + private com.google.protobuf.SingleFieldBuilder< com.google.cloud.audit.ServiceAccountDelegationInfo.ThirdPartyPrincipal, com.google.cloud.audit.ServiceAccountDelegationInfo.ThirdPartyPrincipal.Builder, com.google.cloud.audit.ServiceAccountDelegationInfo.ThirdPartyPrincipalOrBuilder> thirdPartyPrincipalBuilder_; + /** * * @@ -2835,6 +2838,7 @@ public Builder clearFirstPartyPrincipal() { public boolean hasThirdPartyPrincipal() { return authorityCase_ == 2; } + /** * * @@ -2866,6 +2870,7 @@ public boolean hasThirdPartyPrincipal() { .getDefaultInstance(); } } + /** * * @@ -2891,6 +2896,7 @@ public Builder setThirdPartyPrincipal( authorityCase_ = 2; return this; } + /** * * @@ -2914,6 +2920,7 @@ public Builder setThirdPartyPrincipal( authorityCase_ = 2; return this; } + /** * * @@ -2952,6 +2959,7 @@ public Builder mergeThirdPartyPrincipal( authorityCase_ = 2; return this; } + /** * * @@ -2979,6 +2987,7 @@ public Builder clearThirdPartyPrincipal() { } return this; } + /** * * @@ -2992,8 +3001,9 @@ public Builder clearThirdPartyPrincipal() { */ public com.google.cloud.audit.ServiceAccountDelegationInfo.ThirdPartyPrincipal.Builder getThirdPartyPrincipalBuilder() { - return getThirdPartyPrincipalFieldBuilder().getBuilder(); + return internalGetThirdPartyPrincipalFieldBuilder().getBuilder(); } + /** * * @@ -3019,6 +3029,7 @@ public Builder clearThirdPartyPrincipal() { .getDefaultInstance(); } } + /** * * @@ -3030,11 +3041,11 @@ public Builder clearThirdPartyPrincipal() { * .google.cloud.audit.ServiceAccountDelegationInfo.ThirdPartyPrincipal third_party_principal = 2; * */ - private com.google.protobuf.SingleFieldBuilderV3< + private com.google.protobuf.SingleFieldBuilder< com.google.cloud.audit.ServiceAccountDelegationInfo.ThirdPartyPrincipal, com.google.cloud.audit.ServiceAccountDelegationInfo.ThirdPartyPrincipal.Builder, com.google.cloud.audit.ServiceAccountDelegationInfo.ThirdPartyPrincipalOrBuilder> - getThirdPartyPrincipalFieldBuilder() { + internalGetThirdPartyPrincipalFieldBuilder() { if (thirdPartyPrincipalBuilder_ == null) { if (!(authorityCase_ == 2)) { authority_ = @@ -3042,7 +3053,7 @@ public Builder clearThirdPartyPrincipal() { .getDefaultInstance(); } thirdPartyPrincipalBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< + new com.google.protobuf.SingleFieldBuilder< com.google.cloud.audit.ServiceAccountDelegationInfo.ThirdPartyPrincipal, com.google.cloud.audit.ServiceAccountDelegationInfo.ThirdPartyPrincipal.Builder, com.google.cloud.audit.ServiceAccountDelegationInfo.ThirdPartyPrincipalOrBuilder>( @@ -3054,21 +3065,9 @@ public Builder clearThirdPartyPrincipal() { } authorityCase_ = 2; onChanged(); - ; return thirdPartyPrincipalBuilder_; } - @java.lang.Override - public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - // @@protoc_insertion_point(builder_scope:google.cloud.audit.ServiceAccountDelegationInfo) } diff --git a/java-common-protos/proto-google-common-protos/src/main/java/com/google/cloud/audit/ServiceAccountDelegationInfoOrBuilder.java b/java-common-protos/proto-google-common-protos/src/main/java/com/google/cloud/audit/ServiceAccountDelegationInfoOrBuilder.java index 6dd5b65ce7..8309cba82f 100644 --- a/java-common-protos/proto-google-common-protos/src/main/java/com/google/cloud/audit/ServiceAccountDelegationInfoOrBuilder.java +++ b/java-common-protos/proto-google-common-protos/src/main/java/com/google/cloud/audit/ServiceAccountDelegationInfoOrBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,10 +14,13 @@ * limitations under the License. */ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: google/cloud/audit/audit_log.proto +// Protobuf Java Version: 4.33.2 package com.google.cloud.audit; +@com.google.protobuf.Generated public interface ServiceAccountDelegationInfoOrBuilder extends // @@protoc_insertion_point(interface_extends:google.cloud.audit.ServiceAccountDelegationInfo) @@ -40,6 +43,7 @@ public interface ServiceAccountDelegationInfoOrBuilder * @return The principalSubject. */ java.lang.String getPrincipalSubject(); + /** * * @@ -72,6 +76,7 @@ public interface ServiceAccountDelegationInfoOrBuilder * @return Whether the firstPartyPrincipal field is set. */ boolean hasFirstPartyPrincipal(); + /** * * @@ -86,6 +91,7 @@ public interface ServiceAccountDelegationInfoOrBuilder * @return The firstPartyPrincipal. */ com.google.cloud.audit.ServiceAccountDelegationInfo.FirstPartyPrincipal getFirstPartyPrincipal(); + /** * * @@ -114,6 +120,7 @@ public interface ServiceAccountDelegationInfoOrBuilder * @return Whether the thirdPartyPrincipal field is set. */ boolean hasThirdPartyPrincipal(); + /** * * @@ -128,6 +135,7 @@ public interface ServiceAccountDelegationInfoOrBuilder * @return The thirdPartyPrincipal. */ com.google.cloud.audit.ServiceAccountDelegationInfo.ThirdPartyPrincipal getThirdPartyPrincipal(); + /** * * @@ -142,5 +150,5 @@ public interface ServiceAccountDelegationInfoOrBuilder com.google.cloud.audit.ServiceAccountDelegationInfo.ThirdPartyPrincipalOrBuilder getThirdPartyPrincipalOrBuilder(); - public com.google.cloud.audit.ServiceAccountDelegationInfo.AuthorityCase getAuthorityCase(); + com.google.cloud.audit.ServiceAccountDelegationInfo.AuthorityCase getAuthorityCase(); } diff --git a/java-common-protos/proto-google-common-protos/src/main/java/com/google/cloud/audit/ViolationInfo.java b/java-common-protos/proto-google-common-protos/src/main/java/com/google/cloud/audit/ViolationInfo.java index 8137443e70..26664a5877 100644 --- a/java-common-protos/proto-google-common-protos/src/main/java/com/google/cloud/audit/ViolationInfo.java +++ b/java-common-protos/proto-google-common-protos/src/main/java/com/google/cloud/audit/ViolationInfo.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,9 @@ * limitations under the License. */ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: google/cloud/audit/audit_log.proto +// Protobuf Java Version: 4.33.2 package com.google.cloud.audit; @@ -27,13 +29,25 @@ * * Protobuf type {@code google.cloud.audit.ViolationInfo} */ -public final class ViolationInfo extends com.google.protobuf.GeneratedMessageV3 +@com.google.protobuf.Generated +public final class ViolationInfo extends com.google.protobuf.GeneratedMessage implements // @@protoc_insertion_point(message_implements:google.cloud.audit.ViolationInfo) ViolationInfoOrBuilder { private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "ViolationInfo"); + } + // Use ViolationInfo.newBuilder() to construct. - private ViolationInfo(com.google.protobuf.GeneratedMessageV3.Builder builder) { + private ViolationInfo(com.google.protobuf.GeneratedMessage.Builder builder) { super(builder); } @@ -44,24 +58,13 @@ private ViolationInfo() { policyType_ = 0; } - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new ViolationInfo(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.cloud.audit.AuditLogProto .internal_static_google_cloud_audit_ViolationInfo_descriptor; } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.cloud.audit.AuditLogProto .internal_static_google_cloud_audit_ViolationInfo_fieldAccessorTable @@ -123,6 +126,16 @@ public enum PolicyType implements com.google.protobuf.ProtocolMessageEnum { UNRECOGNIZED(-1), ; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "PolicyType"); + } + /** * * @@ -133,6 +146,7 @@ public enum PolicyType implements com.google.protobuf.ProtocolMessageEnum { * POLICY_TYPE_UNSPECIFIED = 0; */ public static final int POLICY_TYPE_UNSPECIFIED_VALUE = 0; + /** * * @@ -143,6 +157,7 @@ public enum PolicyType implements com.google.protobuf.ProtocolMessageEnum { * BOOLEAN_CONSTRAINT = 1; */ public static final int BOOLEAN_CONSTRAINT_VALUE = 1; + /** * * @@ -153,6 +168,7 @@ public enum PolicyType implements com.google.protobuf.ProtocolMessageEnum { * LIST_CONSTRAINT = 2; */ public static final int LIST_CONSTRAINT_VALUE = 2; + /** * * @@ -224,7 +240,7 @@ public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType return getDescriptor(); } - public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + public static com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { return com.google.cloud.audit.ViolationInfo.getDescriptor().getEnumTypes().get(0); } @@ -250,7 +266,10 @@ private PolicyType(int value) { } public static final int CONSTRAINT_FIELD_NUMBER = 1; - private volatile java.lang.Object constraint_; + + @SuppressWarnings("serial") + private volatile java.lang.Object constraint_ = ""; + /** * * @@ -274,6 +293,7 @@ public java.lang.String getConstraint() { return s; } } + /** * * @@ -299,7 +319,10 @@ public com.google.protobuf.ByteString getConstraintBytes() { } public static final int ERROR_MESSAGE_FIELD_NUMBER = 2; - private volatile java.lang.Object errorMessage_; + + @SuppressWarnings("serial") + private volatile java.lang.Object errorMessage_ = ""; + /** * * @@ -323,6 +346,7 @@ public java.lang.String getErrorMessage() { return s; } } + /** * * @@ -348,7 +372,10 @@ public com.google.protobuf.ByteString getErrorMessageBytes() { } public static final int CHECKED_VALUE_FIELD_NUMBER = 3; - private volatile java.lang.Object checkedValue_; + + @SuppressWarnings("serial") + private volatile java.lang.Object checkedValue_ = ""; + /** * * @@ -374,6 +401,7 @@ public java.lang.String getCheckedValue() { return s; } } + /** * * @@ -401,7 +429,8 @@ public com.google.protobuf.ByteString getCheckedValueBytes() { } public static final int POLICY_TYPE_FIELD_NUMBER = 4; - private int policyType_; + private int policyType_ = 0; + /** * * @@ -419,6 +448,7 @@ public com.google.protobuf.ByteString getCheckedValueBytes() { public int getPolicyTypeValue() { return policyType_; } + /** * * @@ -434,9 +464,8 @@ public int getPolicyTypeValue() { */ @java.lang.Override public com.google.cloud.audit.ViolationInfo.PolicyType getPolicyType() { - @SuppressWarnings("deprecation") com.google.cloud.audit.ViolationInfo.PolicyType result = - com.google.cloud.audit.ViolationInfo.PolicyType.valueOf(policyType_); + com.google.cloud.audit.ViolationInfo.PolicyType.forNumber(policyType_); return result == null ? com.google.cloud.audit.ViolationInfo.PolicyType.UNRECOGNIZED : result; } @@ -454,14 +483,14 @@ public final boolean isInitialized() { @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(constraint_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, constraint_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(constraint_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, constraint_); } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(errorMessage_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 2, errorMessage_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(errorMessage_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, errorMessage_); } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(checkedValue_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 3, checkedValue_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(checkedValue_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 3, checkedValue_); } if (policyType_ != com.google.cloud.audit.ViolationInfo.PolicyType.POLICY_TYPE_UNSPECIFIED.getNumber()) { @@ -476,14 +505,14 @@ public int getSerializedSize() { if (size != -1) return size; size = 0; - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(constraint_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, constraint_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(constraint_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, constraint_); } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(errorMessage_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, errorMessage_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(errorMessage_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, errorMessage_); } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(checkedValue_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, checkedValue_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(checkedValue_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(3, checkedValue_); } if (policyType_ != com.google.cloud.audit.ViolationInfo.PolicyType.POLICY_TYPE_UNSPECIFIED.getNumber()) { @@ -568,38 +597,38 @@ public static com.google.cloud.audit.ViolationInfo parseFrom( public static com.google.cloud.audit.ViolationInfo parseFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); } public static com.google.cloud.audit.ViolationInfo parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } public static com.google.cloud.audit.ViolationInfo parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); } public static com.google.cloud.audit.ViolationInfo parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( PARSER, input, extensionRegistry); } public static com.google.cloud.audit.ViolationInfo parseFrom( com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); } public static com.google.cloud.audit.ViolationInfo parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } @@ -622,10 +651,11 @@ public Builder toBuilder() { } @java.lang.Override - protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { Builder builder = new Builder(parent); return builder; } + /** * * @@ -635,7 +665,7 @@ protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.Build * * Protobuf type {@code google.cloud.audit.ViolationInfo} */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder implements // @@protoc_insertion_point(builder_implements:google.cloud.audit.ViolationInfo) com.google.cloud.audit.ViolationInfoOrBuilder { @@ -645,7 +675,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.cloud.audit.AuditLogProto .internal_static_google_cloud_audit_ViolationInfo_fieldAccessorTable @@ -657,21 +687,18 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { // Construct using com.google.cloud.audit.ViolationInfo.newBuilder() private Builder() {} - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { super(parent); } @java.lang.Override public Builder clear() { super.clear(); + bitField0_ = 0; constraint_ = ""; - errorMessage_ = ""; - checkedValue_ = ""; - policyType_ = 0; - return this; } @@ -698,45 +725,27 @@ public com.google.cloud.audit.ViolationInfo build() { @java.lang.Override public com.google.cloud.audit.ViolationInfo buildPartial() { com.google.cloud.audit.ViolationInfo result = new com.google.cloud.audit.ViolationInfo(this); - result.constraint_ = constraint_; - result.errorMessage_ = errorMessage_; - result.checkedValue_ = checkedValue_; - result.policyType_ = policyType_; + if (bitField0_ != 0) { + buildPartial0(result); + } 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); + private void buildPartial0(com.google.cloud.audit.ViolationInfo result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.constraint_ = constraint_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.errorMessage_ = errorMessage_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.checkedValue_ = checkedValue_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.policyType_ = policyType_; + } } @java.lang.Override @@ -753,14 +762,17 @@ public Builder mergeFrom(com.google.cloud.audit.ViolationInfo other) { if (other == com.google.cloud.audit.ViolationInfo.getDefaultInstance()) return this; if (!other.getConstraint().isEmpty()) { constraint_ = other.constraint_; + bitField0_ |= 0x00000001; onChanged(); } if (!other.getErrorMessage().isEmpty()) { errorMessage_ = other.errorMessage_; + bitField0_ |= 0x00000002; onChanged(); } if (!other.getCheckedValue().isEmpty()) { checkedValue_ = other.checkedValue_; + bitField0_ |= 0x00000004; onChanged(); } if (other.policyType_ != 0) { @@ -795,25 +807,25 @@ public Builder mergeFrom( case 10: { constraint_ = input.readStringRequireUtf8(); - + bitField0_ |= 0x00000001; break; } // case 10 case 18: { errorMessage_ = input.readStringRequireUtf8(); - + bitField0_ |= 0x00000002; break; } // case 18 case 26: { checkedValue_ = input.readStringRequireUtf8(); - + bitField0_ |= 0x00000004; break; } // case 26 case 32: { policyType_ = input.readEnum(); - + bitField0_ |= 0x00000008; break; } // case 32 default: @@ -833,7 +845,10 @@ public Builder mergeFrom( return this; } + private int bitField0_; + private java.lang.Object constraint_ = ""; + /** * * @@ -856,6 +871,7 @@ public java.lang.String getConstraint() { return (java.lang.String) ref; } } + /** * * @@ -878,6 +894,7 @@ public com.google.protobuf.ByteString getConstraintBytes() { return (com.google.protobuf.ByteString) ref; } } + /** * * @@ -894,11 +911,12 @@ public Builder setConstraint(java.lang.String value) { if (value == null) { throw new NullPointerException(); } - constraint_ = value; + bitField0_ |= 0x00000001; onChanged(); return this; } + /** * * @@ -911,11 +929,12 @@ public Builder setConstraint(java.lang.String value) { * @return This builder for chaining. */ public Builder clearConstraint() { - constraint_ = getDefaultInstance().getConstraint(); + bitField0_ = (bitField0_ & ~0x00000001); onChanged(); return this; } + /** * * @@ -933,13 +952,14 @@ public Builder setConstraintBytes(com.google.protobuf.ByteString value) { throw new NullPointerException(); } checkByteStringIsUtf8(value); - constraint_ = value; + bitField0_ |= 0x00000001; onChanged(); return this; } private java.lang.Object errorMessage_ = ""; + /** * * @@ -962,6 +982,7 @@ public java.lang.String getErrorMessage() { return (java.lang.String) ref; } } + /** * * @@ -984,6 +1005,7 @@ public com.google.protobuf.ByteString getErrorMessageBytes() { return (com.google.protobuf.ByteString) ref; } } + /** * * @@ -1000,11 +1022,12 @@ public Builder setErrorMessage(java.lang.String value) { if (value == null) { throw new NullPointerException(); } - errorMessage_ = value; + bitField0_ |= 0x00000002; onChanged(); return this; } + /** * * @@ -1017,11 +1040,12 @@ public Builder setErrorMessage(java.lang.String value) { * @return This builder for chaining. */ public Builder clearErrorMessage() { - errorMessage_ = getDefaultInstance().getErrorMessage(); + bitField0_ = (bitField0_ & ~0x00000002); onChanged(); return this; } + /** * * @@ -1039,13 +1063,14 @@ public Builder setErrorMessageBytes(com.google.protobuf.ByteString value) { throw new NullPointerException(); } checkByteStringIsUtf8(value); - errorMessage_ = value; + bitField0_ |= 0x00000002; onChanged(); return this; } private java.lang.Object checkedValue_ = ""; + /** * * @@ -1070,6 +1095,7 @@ public java.lang.String getCheckedValue() { return (java.lang.String) ref; } } + /** * * @@ -1094,6 +1120,7 @@ public com.google.protobuf.ByteString getCheckedValueBytes() { return (com.google.protobuf.ByteString) ref; } } + /** * * @@ -1112,11 +1139,12 @@ public Builder setCheckedValue(java.lang.String value) { if (value == null) { throw new NullPointerException(); } - checkedValue_ = value; + bitField0_ |= 0x00000004; onChanged(); return this; } + /** * * @@ -1131,11 +1159,12 @@ public Builder setCheckedValue(java.lang.String value) { * @return This builder for chaining. */ public Builder clearCheckedValue() { - checkedValue_ = getDefaultInstance().getCheckedValue(); + bitField0_ = (bitField0_ & ~0x00000004); onChanged(); return this; } + /** * * @@ -1155,13 +1184,14 @@ public Builder setCheckedValueBytes(com.google.protobuf.ByteString value) { throw new NullPointerException(); } checkByteStringIsUtf8(value); - checkedValue_ = value; + bitField0_ |= 0x00000004; onChanged(); return this; } private int policyType_ = 0; + /** * * @@ -1179,6 +1209,7 @@ public Builder setCheckedValueBytes(com.google.protobuf.ByteString value) { public int getPolicyTypeValue() { return policyType_; } + /** * * @@ -1194,11 +1225,12 @@ public int getPolicyTypeValue() { * @return This builder for chaining. */ public Builder setPolicyTypeValue(int value) { - policyType_ = value; + bitField0_ |= 0x00000008; onChanged(); return this; } + /** * * @@ -1214,11 +1246,11 @@ public Builder setPolicyTypeValue(int value) { */ @java.lang.Override public com.google.cloud.audit.ViolationInfo.PolicyType getPolicyType() { - @SuppressWarnings("deprecation") com.google.cloud.audit.ViolationInfo.PolicyType result = - com.google.cloud.audit.ViolationInfo.PolicyType.valueOf(policyType_); + com.google.cloud.audit.ViolationInfo.PolicyType.forNumber(policyType_); return result == null ? com.google.cloud.audit.ViolationInfo.PolicyType.UNRECOGNIZED : result; } + /** * * @@ -1237,11 +1269,12 @@ public Builder setPolicyType(com.google.cloud.audit.ViolationInfo.PolicyType val if (value == null) { throw new NullPointerException(); } - + bitField0_ |= 0x00000008; policyType_ = value.getNumber(); onChanged(); return this; } + /** * * @@ -1256,23 +1289,12 @@ public Builder setPolicyType(com.google.cloud.audit.ViolationInfo.PolicyType val * @return This builder for chaining. */ public Builder clearPolicyType() { - + bitField0_ = (bitField0_ & ~0x00000008); policyType_ = 0; onChanged(); return this; } - @java.lang.Override - public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - // @@protoc_insertion_point(builder_scope:google.cloud.audit.ViolationInfo) } diff --git a/java-common-protos/proto-google-common-protos/src/main/java/com/google/cloud/audit/ViolationInfoOrBuilder.java b/java-common-protos/proto-google-common-protos/src/main/java/com/google/cloud/audit/ViolationInfoOrBuilder.java index 080151eff4..3cfcf83c3e 100644 --- a/java-common-protos/proto-google-common-protos/src/main/java/com/google/cloud/audit/ViolationInfoOrBuilder.java +++ b/java-common-protos/proto-google-common-protos/src/main/java/com/google/cloud/audit/ViolationInfoOrBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,10 +14,13 @@ * limitations under the License. */ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: google/cloud/audit/audit_log.proto +// Protobuf Java Version: 4.33.2 package com.google.cloud.audit; +@com.google.protobuf.Generated public interface ViolationInfoOrBuilder extends // @@protoc_insertion_point(interface_extends:google.cloud.audit.ViolationInfo) @@ -35,6 +38,7 @@ public interface ViolationInfoOrBuilder * @return The constraint. */ java.lang.String getConstraint(); + /** * * @@ -60,6 +64,7 @@ public interface ViolationInfoOrBuilder * @return The errorMessage. */ java.lang.String getErrorMessage(); + /** * * @@ -87,6 +92,7 @@ public interface ViolationInfoOrBuilder * @return The checkedValue. */ java.lang.String getCheckedValue(); + /** * * @@ -116,6 +122,7 @@ public interface ViolationInfoOrBuilder * @return The enum numeric value on the wire for policyType. */ int getPolicyTypeValue(); + /** * * diff --git a/java-common-protos/proto-google-common-protos/src/main/java/com/google/cloud/location/GetLocationRequest.java b/java-common-protos/proto-google-common-protos/src/main/java/com/google/cloud/location/GetLocationRequest.java index fe5cbbd1de..ac05921fc2 100644 --- a/java-common-protos/proto-google-common-protos/src/main/java/com/google/cloud/location/GetLocationRequest.java +++ b/java-common-protos/proto-google-common-protos/src/main/java/com/google/cloud/location/GetLocationRequest.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,9 @@ * limitations under the License. */ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: google/cloud/location/locations.proto +// Protobuf Java Version: 4.33.2 package com.google.cloud.location; @@ -27,13 +29,25 @@ * * Protobuf type {@code google.cloud.location.GetLocationRequest} */ -public final class GetLocationRequest extends com.google.protobuf.GeneratedMessageV3 +@com.google.protobuf.Generated +public final class GetLocationRequest extends com.google.protobuf.GeneratedMessage implements // @@protoc_insertion_point(message_implements:google.cloud.location.GetLocationRequest) GetLocationRequestOrBuilder { private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "GetLocationRequest"); + } + // Use GetLocationRequest.newBuilder() to construct. - private GetLocationRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + private GetLocationRequest(com.google.protobuf.GeneratedMessage.Builder builder) { super(builder); } @@ -41,24 +55,13 @@ private GetLocationRequest() { name_ = ""; } - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new GetLocationRequest(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.cloud.location.LocationsProto .internal_static_google_cloud_location_GetLocationRequest_descriptor; } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.cloud.location.LocationsProto .internal_static_google_cloud_location_GetLocationRequest_fieldAccessorTable @@ -68,7 +71,10 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } public static final int NAME_FIELD_NUMBER = 1; - private volatile java.lang.Object name_; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** * * @@ -92,6 +98,7 @@ public java.lang.String getName() { return s; } } + /** * * @@ -130,8 +137,8 @@ public final boolean isInitialized() { @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.GeneratedMessage.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, name_); } getUnknownFields().writeTo(output); } @@ -142,8 +149,8 @@ public int getSerializedSize() { 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.GeneratedMessage.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, name_); } size += getUnknownFields().getSerializedSize(); memoizedSize = size; @@ -217,38 +224,38 @@ public static com.google.cloud.location.GetLocationRequest parseFrom( public static com.google.cloud.location.GetLocationRequest parseFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); } public static com.google.cloud.location.GetLocationRequest parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } public static com.google.cloud.location.GetLocationRequest parseDelimitedFrom( java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); } public static com.google.cloud.location.GetLocationRequest parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( PARSER, input, extensionRegistry); } public static com.google.cloud.location.GetLocationRequest parseFrom( com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); } public static com.google.cloud.location.GetLocationRequest parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } @@ -271,10 +278,11 @@ public Builder toBuilder() { } @java.lang.Override - protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { Builder builder = new Builder(parent); return builder; } + /** * * @@ -284,7 +292,7 @@ protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.Build * * Protobuf type {@code google.cloud.location.GetLocationRequest} */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder implements // @@protoc_insertion_point(builder_implements:google.cloud.location.GetLocationRequest) com.google.cloud.location.GetLocationRequestOrBuilder { @@ -294,7 +302,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.cloud.location.LocationsProto .internal_static_google_cloud_location_GetLocationRequest_fieldAccessorTable @@ -306,15 +314,15 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { // Construct using com.google.cloud.location.GetLocationRequest.newBuilder() private Builder() {} - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { super(parent); } @java.lang.Override public Builder clear() { super.clear(); + bitField0_ = 0; name_ = ""; - return this; } @@ -342,42 +350,18 @@ public com.google.cloud.location.GetLocationRequest build() { public com.google.cloud.location.GetLocationRequest buildPartial() { com.google.cloud.location.GetLocationRequest result = new com.google.cloud.location.GetLocationRequest(this); - result.name_ = name_; + if (bitField0_ != 0) { + buildPartial0(result); + } 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); + private void buildPartial0(com.google.cloud.location.GetLocationRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } } @java.lang.Override @@ -394,6 +378,7 @@ public Builder mergeFrom(com.google.cloud.location.GetLocationRequest other) { if (other == com.google.cloud.location.GetLocationRequest.getDefaultInstance()) return this; if (!other.getName().isEmpty()) { name_ = other.name_; + bitField0_ |= 0x00000001; onChanged(); } this.mergeUnknownFields(other.getUnknownFields()); @@ -425,7 +410,7 @@ public Builder mergeFrom( case 10: { name_ = input.readStringRequireUtf8(); - + bitField0_ |= 0x00000001; break; } // case 10 default: @@ -445,7 +430,10 @@ public Builder mergeFrom( return this; } + private int bitField0_; + private java.lang.Object name_ = ""; + /** * * @@ -468,6 +456,7 @@ public java.lang.String getName() { return (java.lang.String) ref; } } + /** * * @@ -490,6 +479,7 @@ public com.google.protobuf.ByteString getNameBytes() { return (com.google.protobuf.ByteString) ref; } } + /** * * @@ -506,11 +496,12 @@ public Builder setName(java.lang.String value) { if (value == null) { throw new NullPointerException(); } - name_ = value; + bitField0_ |= 0x00000001; onChanged(); return this; } + /** * * @@ -523,11 +514,12 @@ public Builder setName(java.lang.String value) { * @return This builder for chaining. */ public Builder clearName() { - name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); onChanged(); return this; } + /** * * @@ -545,23 +537,12 @@ public Builder setNameBytes(com.google.protobuf.ByteString value) { 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.cloud.location.GetLocationRequest) } diff --git a/java-common-protos/proto-google-common-protos/src/main/java/com/google/cloud/location/GetLocationRequestOrBuilder.java b/java-common-protos/proto-google-common-protos/src/main/java/com/google/cloud/location/GetLocationRequestOrBuilder.java index a8f3d0f9b5..bf78c3f9b4 100644 --- a/java-common-protos/proto-google-common-protos/src/main/java/com/google/cloud/location/GetLocationRequestOrBuilder.java +++ b/java-common-protos/proto-google-common-protos/src/main/java/com/google/cloud/location/GetLocationRequestOrBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,10 +14,13 @@ * limitations under the License. */ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: google/cloud/location/locations.proto +// Protobuf Java Version: 4.33.2 package com.google.cloud.location; +@com.google.protobuf.Generated public interface GetLocationRequestOrBuilder extends // @@protoc_insertion_point(interface_extends:google.cloud.location.GetLocationRequest) @@ -35,6 +38,7 @@ public interface GetLocationRequestOrBuilder * @return The name. */ java.lang.String getName(); + /** * * diff --git a/java-common-protos/proto-google-common-protos/src/main/java/com/google/cloud/location/ListLocationsRequest.java b/java-common-protos/proto-google-common-protos/src/main/java/com/google/cloud/location/ListLocationsRequest.java index feebcfe536..ac5a60c9d3 100644 --- a/java-common-protos/proto-google-common-protos/src/main/java/com/google/cloud/location/ListLocationsRequest.java +++ b/java-common-protos/proto-google-common-protos/src/main/java/com/google/cloud/location/ListLocationsRequest.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,9 @@ * limitations under the License. */ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: google/cloud/location/locations.proto +// Protobuf Java Version: 4.33.2 package com.google.cloud.location; @@ -27,13 +29,25 @@ * * Protobuf type {@code google.cloud.location.ListLocationsRequest} */ -public final class ListLocationsRequest extends com.google.protobuf.GeneratedMessageV3 +@com.google.protobuf.Generated +public final class ListLocationsRequest extends com.google.protobuf.GeneratedMessage implements // @@protoc_insertion_point(message_implements:google.cloud.location.ListLocationsRequest) ListLocationsRequestOrBuilder { private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "ListLocationsRequest"); + } + // Use ListLocationsRequest.newBuilder() to construct. - private ListLocationsRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + private ListLocationsRequest(com.google.protobuf.GeneratedMessage.Builder builder) { super(builder); } @@ -43,24 +57,13 @@ private ListLocationsRequest() { pageToken_ = ""; } - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new ListLocationsRequest(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.cloud.location.LocationsProto .internal_static_google_cloud_location_ListLocationsRequest_descriptor; } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.cloud.location.LocationsProto .internal_static_google_cloud_location_ListLocationsRequest_fieldAccessorTable @@ -70,7 +73,10 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } public static final int NAME_FIELD_NUMBER = 1; - private volatile java.lang.Object name_; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** * * @@ -94,6 +100,7 @@ public java.lang.String getName() { return s; } } + /** * * @@ -119,7 +126,10 @@ public com.google.protobuf.ByteString getNameBytes() { } public static final int FILTER_FIELD_NUMBER = 2; - private volatile java.lang.Object filter_; + + @SuppressWarnings("serial") + private volatile java.lang.Object filter_ = ""; + /** * * @@ -143,6 +153,7 @@ public java.lang.String getFilter() { return s; } } + /** * * @@ -168,7 +179,8 @@ public com.google.protobuf.ByteString getFilterBytes() { } public static final int PAGE_SIZE_FIELD_NUMBER = 3; - private int pageSize_; + private int pageSize_ = 0; + /** * * @@ -186,7 +198,10 @@ public int getPageSize() { } public static final int PAGE_TOKEN_FIELD_NUMBER = 4; - private volatile java.lang.Object pageToken_; + + @SuppressWarnings("serial") + private volatile java.lang.Object pageToken_ = ""; + /** * * @@ -210,6 +225,7 @@ public java.lang.String getPageToken() { return s; } } + /** * * @@ -248,17 +264,17 @@ public final boolean isInitialized() { @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.GeneratedMessage.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, name_); } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(filter_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 2, filter_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(filter_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, filter_); } if (pageSize_ != 0) { output.writeInt32(3, pageSize_); } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(pageToken_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 4, pageToken_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(pageToken_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 4, pageToken_); } getUnknownFields().writeTo(output); } @@ -269,17 +285,17 @@ public int getSerializedSize() { 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.GeneratedMessage.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, name_); } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(filter_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, filter_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(filter_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, filter_); } if (pageSize_ != 0) { size += com.google.protobuf.CodedOutputStream.computeInt32Size(3, pageSize_); } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(pageToken_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, pageToken_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(pageToken_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(4, pageToken_); } size += getUnknownFields().getSerializedSize(); memoizedSize = size; @@ -362,38 +378,38 @@ public static com.google.cloud.location.ListLocationsRequest parseFrom( public static com.google.cloud.location.ListLocationsRequest parseFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); } public static com.google.cloud.location.ListLocationsRequest parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } public static com.google.cloud.location.ListLocationsRequest parseDelimitedFrom( java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); } public static com.google.cloud.location.ListLocationsRequest parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( PARSER, input, extensionRegistry); } public static com.google.cloud.location.ListLocationsRequest parseFrom( com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); } public static com.google.cloud.location.ListLocationsRequest parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } @@ -416,10 +432,11 @@ public Builder toBuilder() { } @java.lang.Override - protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { Builder builder = new Builder(parent); return builder; } + /** * * @@ -429,7 +446,7 @@ protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.Build * * Protobuf type {@code google.cloud.location.ListLocationsRequest} */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder implements // @@protoc_insertion_point(builder_implements:google.cloud.location.ListLocationsRequest) com.google.cloud.location.ListLocationsRequestOrBuilder { @@ -439,7 +456,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.cloud.location.LocationsProto .internal_static_google_cloud_location_ListLocationsRequest_fieldAccessorTable @@ -451,21 +468,18 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { // Construct using com.google.cloud.location.ListLocationsRequest.newBuilder() private Builder() {} - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { super(parent); } @java.lang.Override public Builder clear() { super.clear(); + bitField0_ = 0; name_ = ""; - filter_ = ""; - pageSize_ = 0; - pageToken_ = ""; - return this; } @@ -493,45 +507,27 @@ public com.google.cloud.location.ListLocationsRequest build() { public com.google.cloud.location.ListLocationsRequest buildPartial() { com.google.cloud.location.ListLocationsRequest result = new com.google.cloud.location.ListLocationsRequest(this); - result.name_ = name_; - result.filter_ = filter_; - result.pageSize_ = pageSize_; - result.pageToken_ = pageToken_; + if (bitField0_ != 0) { + buildPartial0(result); + } 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); + private void buildPartial0(com.google.cloud.location.ListLocationsRequest 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.pageSize_ = pageSize_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.pageToken_ = pageToken_; + } } @java.lang.Override @@ -548,10 +544,12 @@ public Builder mergeFrom(com.google.cloud.location.ListLocationsRequest other) { if (other == com.google.cloud.location.ListLocationsRequest.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.getPageSize() != 0) { @@ -559,6 +557,7 @@ public Builder mergeFrom(com.google.cloud.location.ListLocationsRequest other) { } if (!other.getPageToken().isEmpty()) { pageToken_ = other.pageToken_; + bitField0_ |= 0x00000008; onChanged(); } this.mergeUnknownFields(other.getUnknownFields()); @@ -590,25 +589,25 @@ public Builder mergeFrom( case 10: { name_ = input.readStringRequireUtf8(); - + bitField0_ |= 0x00000001; break; } // case 10 case 18: { filter_ = input.readStringRequireUtf8(); - + bitField0_ |= 0x00000002; break; } // case 18 case 24: { pageSize_ = input.readInt32(); - + bitField0_ |= 0x00000004; break; } // case 24 case 34: { pageToken_ = input.readStringRequireUtf8(); - + bitField0_ |= 0x00000008; break; } // case 34 default: @@ -628,7 +627,10 @@ public Builder mergeFrom( return this; } + private int bitField0_; + private java.lang.Object name_ = ""; + /** * * @@ -651,6 +653,7 @@ public java.lang.String getName() { return (java.lang.String) ref; } } + /** * * @@ -673,6 +676,7 @@ public com.google.protobuf.ByteString getNameBytes() { return (com.google.protobuf.ByteString) ref; } } + /** * * @@ -689,11 +693,12 @@ public Builder setName(java.lang.String value) { if (value == null) { throw new NullPointerException(); } - name_ = value; + bitField0_ |= 0x00000001; onChanged(); return this; } + /** * * @@ -706,11 +711,12 @@ public Builder setName(java.lang.String value) { * @return This builder for chaining. */ public Builder clearName() { - name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); onChanged(); return this; } + /** * * @@ -728,13 +734,14 @@ public Builder setNameBytes(com.google.protobuf.ByteString value) { throw new NullPointerException(); } checkByteStringIsUtf8(value); - name_ = value; + bitField0_ |= 0x00000001; onChanged(); return this; } private java.lang.Object filter_ = ""; + /** * * @@ -757,6 +764,7 @@ public java.lang.String getFilter() { return (java.lang.String) ref; } } + /** * * @@ -779,6 +787,7 @@ public com.google.protobuf.ByteString getFilterBytes() { return (com.google.protobuf.ByteString) ref; } } + /** * * @@ -795,11 +804,12 @@ public Builder setFilter(java.lang.String value) { if (value == null) { throw new NullPointerException(); } - filter_ = value; + bitField0_ |= 0x00000002; onChanged(); return this; } + /** * * @@ -812,11 +822,12 @@ public Builder setFilter(java.lang.String value) { * @return This builder for chaining. */ public Builder clearFilter() { - filter_ = getDefaultInstance().getFilter(); + bitField0_ = (bitField0_ & ~0x00000002); onChanged(); return this; } + /** * * @@ -834,13 +845,14 @@ public Builder setFilterBytes(com.google.protobuf.ByteString value) { throw new NullPointerException(); } checkByteStringIsUtf8(value); - filter_ = value; + bitField0_ |= 0x00000002; onChanged(); return this; } private int pageSize_; + /** * * @@ -856,6 +868,7 @@ public Builder setFilterBytes(com.google.protobuf.ByteString value) { public int getPageSize() { return pageSize_; } + /** * * @@ -871,9 +884,11 @@ public int getPageSize() { public Builder setPageSize(int value) { pageSize_ = value; + bitField0_ |= 0x00000004; onChanged(); return this; } + /** * * @@ -886,13 +901,14 @@ public Builder setPageSize(int value) { * @return This builder for chaining. */ public Builder clearPageSize() { - + bitField0_ = (bitField0_ & ~0x00000004); pageSize_ = 0; onChanged(); return this; } private java.lang.Object pageToken_ = ""; + /** * * @@ -915,6 +931,7 @@ public java.lang.String getPageToken() { return (java.lang.String) ref; } } + /** * * @@ -937,6 +954,7 @@ public com.google.protobuf.ByteString getPageTokenBytes() { return (com.google.protobuf.ByteString) ref; } } + /** * * @@ -953,11 +971,12 @@ public Builder setPageToken(java.lang.String value) { if (value == null) { throw new NullPointerException(); } - pageToken_ = value; + bitField0_ |= 0x00000008; onChanged(); return this; } + /** * * @@ -970,11 +989,12 @@ public Builder setPageToken(java.lang.String value) { * @return This builder for chaining. */ public Builder clearPageToken() { - pageToken_ = getDefaultInstance().getPageToken(); + bitField0_ = (bitField0_ & ~0x00000008); onChanged(); return this; } + /** * * @@ -992,23 +1012,12 @@ public Builder setPageTokenBytes(com.google.protobuf.ByteString value) { 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.cloud.location.ListLocationsRequest) } diff --git a/java-common-protos/proto-google-common-protos/src/main/java/com/google/cloud/location/ListLocationsRequestOrBuilder.java b/java-common-protos/proto-google-common-protos/src/main/java/com/google/cloud/location/ListLocationsRequestOrBuilder.java index 3a3f39a7f7..3f553d10cf 100644 --- a/java-common-protos/proto-google-common-protos/src/main/java/com/google/cloud/location/ListLocationsRequestOrBuilder.java +++ b/java-common-protos/proto-google-common-protos/src/main/java/com/google/cloud/location/ListLocationsRequestOrBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,10 +14,13 @@ * limitations under the License. */ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: google/cloud/location/locations.proto +// Protobuf Java Version: 4.33.2 package com.google.cloud.location; +@com.google.protobuf.Generated public interface ListLocationsRequestOrBuilder extends // @@protoc_insertion_point(interface_extends:google.cloud.location.ListLocationsRequest) @@ -35,6 +38,7 @@ public interface ListLocationsRequestOrBuilder * @return The name. */ java.lang.String getName(); + /** * * @@ -60,6 +64,7 @@ public interface ListLocationsRequestOrBuilder * @return The filter. */ java.lang.String getFilter(); + /** * * @@ -98,6 +103,7 @@ public interface ListLocationsRequestOrBuilder * @return The pageToken. */ java.lang.String getPageToken(); + /** * * diff --git a/java-common-protos/proto-google-common-protos/src/main/java/com/google/cloud/location/ListLocationsResponse.java b/java-common-protos/proto-google-common-protos/src/main/java/com/google/cloud/location/ListLocationsResponse.java index 6bb4a4dd7a..177a397770 100644 --- a/java-common-protos/proto-google-common-protos/src/main/java/com/google/cloud/location/ListLocationsResponse.java +++ b/java-common-protos/proto-google-common-protos/src/main/java/com/google/cloud/location/ListLocationsResponse.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,9 @@ * limitations under the License. */ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: google/cloud/location/locations.proto +// Protobuf Java Version: 4.33.2 package com.google.cloud.location; @@ -27,13 +29,25 @@ * * Protobuf type {@code google.cloud.location.ListLocationsResponse} */ -public final class ListLocationsResponse extends com.google.protobuf.GeneratedMessageV3 +@com.google.protobuf.Generated +public final class ListLocationsResponse extends com.google.protobuf.GeneratedMessage implements // @@protoc_insertion_point(message_implements:google.cloud.location.ListLocationsResponse) ListLocationsResponseOrBuilder { private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "ListLocationsResponse"); + } + // Use ListLocationsResponse.newBuilder() to construct. - private ListLocationsResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + private ListLocationsResponse(com.google.protobuf.GeneratedMessage.Builder builder) { super(builder); } @@ -42,24 +56,13 @@ private ListLocationsResponse() { nextPageToken_ = ""; } - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new ListLocationsResponse(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.cloud.location.LocationsProto .internal_static_google_cloud_location_ListLocationsResponse_descriptor; } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.cloud.location.LocationsProto .internal_static_google_cloud_location_ListLocationsResponse_fieldAccessorTable @@ -69,7 +72,10 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } public static final int LOCATIONS_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") private java.util.List locations_; + /** * * @@ -83,6 +89,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { public java.util.List getLocationsList() { return locations_; } + /** * * @@ -97,6 +104,7 @@ public java.util.List getLocationsList() { getLocationsOrBuilderList() { return locations_; } + /** * * @@ -110,6 +118,7 @@ public java.util.List getLocationsList() { public int getLocationsCount() { return locations_.size(); } + /** * * @@ -123,6 +132,7 @@ public int getLocationsCount() { public com.google.cloud.location.Location getLocations(int index) { return locations_.get(index); } + /** * * @@ -138,7 +148,10 @@ public com.google.cloud.location.LocationOrBuilder getLocationsOrBuilder(int ind } public static final int NEXT_PAGE_TOKEN_FIELD_NUMBER = 2; - private volatile java.lang.Object nextPageToken_; + + @SuppressWarnings("serial") + private volatile java.lang.Object nextPageToken_ = ""; + /** * * @@ -162,6 +175,7 @@ public java.lang.String getNextPageToken() { return s; } } + /** * * @@ -203,8 +217,8 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io for (int i = 0; i < locations_.size(); i++) { output.writeMessage(1, locations_.get(i)); } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nextPageToken_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 2, nextPageToken_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(nextPageToken_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, nextPageToken_); } getUnknownFields().writeTo(output); } @@ -218,8 +232,8 @@ public int getSerializedSize() { for (int i = 0; i < locations_.size(); i++) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, locations_.get(i)); } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nextPageToken_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, nextPageToken_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(nextPageToken_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, nextPageToken_); } size += getUnknownFields().getSerializedSize(); memoizedSize = size; @@ -298,38 +312,38 @@ public static com.google.cloud.location.ListLocationsResponse parseFrom( public static com.google.cloud.location.ListLocationsResponse parseFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); } public static com.google.cloud.location.ListLocationsResponse parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } public static com.google.cloud.location.ListLocationsResponse parseDelimitedFrom( java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); } public static com.google.cloud.location.ListLocationsResponse parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( PARSER, input, extensionRegistry); } public static com.google.cloud.location.ListLocationsResponse parseFrom( com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); } public static com.google.cloud.location.ListLocationsResponse parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } @@ -352,10 +366,11 @@ public Builder toBuilder() { } @java.lang.Override - protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { Builder builder = new Builder(parent); return builder; } + /** * * @@ -365,7 +380,7 @@ protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.Build * * Protobuf type {@code google.cloud.location.ListLocationsResponse} */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder implements // @@protoc_insertion_point(builder_implements:google.cloud.location.ListLocationsResponse) com.google.cloud.location.ListLocationsResponseOrBuilder { @@ -375,7 +390,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.cloud.location.LocationsProto .internal_static_google_cloud_location_ListLocationsResponse_fieldAccessorTable @@ -387,13 +402,14 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { // Construct using com.google.cloud.location.ListLocationsResponse.newBuilder() private Builder() {} - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { super(parent); } @java.lang.Override public Builder clear() { super.clear(); + bitField0_ = 0; if (locationsBuilder_ == null) { locations_ = java.util.Collections.emptyList(); } else { @@ -402,7 +418,6 @@ public Builder clear() { } bitField0_ = (bitField0_ & ~0x00000001); nextPageToken_ = ""; - return this; } @@ -430,7 +445,16 @@ public com.google.cloud.location.ListLocationsResponse build() { public com.google.cloud.location.ListLocationsResponse buildPartial() { com.google.cloud.location.ListLocationsResponse result = new com.google.cloud.location.ListLocationsResponse(this); - int from_bitField0_ = bitField0_; + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields( + com.google.cloud.location.ListLocationsResponse result) { if (locationsBuilder_ == null) { if (((bitField0_ & 0x00000001) != 0)) { locations_ = java.util.Collections.unmodifiableList(locations_); @@ -440,42 +464,13 @@ public com.google.cloud.location.ListLocationsResponse buildPartial() { } else { result.locations_ = locationsBuilder_.build(); } - result.nextPageToken_ = nextPageToken_; - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.setField(field, value); } - @java.lang.Override - public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - - @java.lang.Override - public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.addRepeatedField(field, value); + private void buildPartial0(com.google.cloud.location.ListLocationsResponse result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.nextPageToken_ = nextPageToken_; + } } @java.lang.Override @@ -510,8 +505,8 @@ public Builder mergeFrom(com.google.cloud.location.ListLocationsResponse other) locations_ = other.locations_; bitField0_ = (bitField0_ & ~0x00000001); locationsBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders - ? getLocationsFieldBuilder() + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders + ? internalGetLocationsFieldBuilder() : null; } else { locationsBuilder_.addAllMessages(other.locations_); @@ -520,6 +515,7 @@ public Builder mergeFrom(com.google.cloud.location.ListLocationsResponse other) } if (!other.getNextPageToken().isEmpty()) { nextPageToken_ = other.nextPageToken_; + bitField0_ |= 0x00000002; onChanged(); } this.mergeUnknownFields(other.getUnknownFields()); @@ -564,7 +560,7 @@ public Builder mergeFrom( case 18: { nextPageToken_ = input.readStringRequireUtf8(); - + bitField0_ |= 0x00000002; break; } // case 18 default: @@ -596,7 +592,7 @@ private void ensureLocationsIsMutable() { } } - private com.google.protobuf.RepeatedFieldBuilderV3< + private com.google.protobuf.RepeatedFieldBuilder< com.google.cloud.location.Location, com.google.cloud.location.Location.Builder, com.google.cloud.location.LocationOrBuilder> @@ -618,6 +614,7 @@ public java.util.List getLocationsList() { return locationsBuilder_.getMessageList(); } } + /** * * @@ -634,6 +631,7 @@ public int getLocationsCount() { return locationsBuilder_.getCount(); } } + /** * * @@ -650,6 +648,7 @@ public com.google.cloud.location.Location getLocations(int index) { return locationsBuilder_.getMessage(index); } } + /** * * @@ -672,6 +671,7 @@ public Builder setLocations(int index, com.google.cloud.location.Location value) } return this; } + /** * * @@ -692,6 +692,7 @@ public Builder setLocations( } return this; } + /** * * @@ -714,6 +715,7 @@ public Builder addLocations(com.google.cloud.location.Location value) { } return this; } + /** * * @@ -736,6 +738,7 @@ public Builder addLocations(int index, com.google.cloud.location.Location value) } return this; } + /** * * @@ -755,6 +758,7 @@ public Builder addLocations(com.google.cloud.location.Location.Builder builderFo } return this; } + /** * * @@ -775,6 +779,7 @@ public Builder addLocations( } return this; } + /** * * @@ -795,6 +800,7 @@ public Builder addAllLocations( } return this; } + /** * * @@ -814,6 +820,7 @@ public Builder clearLocations() { } return this; } + /** * * @@ -833,6 +840,7 @@ public Builder removeLocations(int index) { } return this; } + /** * * @@ -843,8 +851,9 @@ public Builder removeLocations(int index) { * repeated .google.cloud.location.Location locations = 1; */ public com.google.cloud.location.Location.Builder getLocationsBuilder(int index) { - return getLocationsFieldBuilder().getBuilder(index); + return internalGetLocationsFieldBuilder().getBuilder(index); } + /** * * @@ -861,6 +870,7 @@ public com.google.cloud.location.LocationOrBuilder getLocationsOrBuilder(int ind return locationsBuilder_.getMessageOrBuilder(index); } } + /** * * @@ -878,6 +888,7 @@ public com.google.cloud.location.LocationOrBuilder getLocationsOrBuilder(int ind return java.util.Collections.unmodifiableList(locations_); } } + /** * * @@ -888,9 +899,10 @@ public com.google.cloud.location.LocationOrBuilder getLocationsOrBuilder(int ind * repeated .google.cloud.location.Location locations = 1; */ public com.google.cloud.location.Location.Builder addLocationsBuilder() { - return getLocationsFieldBuilder() + return internalGetLocationsFieldBuilder() .addBuilder(com.google.cloud.location.Location.getDefaultInstance()); } + /** * * @@ -901,9 +913,10 @@ public com.google.cloud.location.Location.Builder addLocationsBuilder() { * repeated .google.cloud.location.Location locations = 1; */ public com.google.cloud.location.Location.Builder addLocationsBuilder(int index) { - return getLocationsFieldBuilder() + return internalGetLocationsFieldBuilder() .addBuilder(index, com.google.cloud.location.Location.getDefaultInstance()); } + /** * * @@ -914,17 +927,17 @@ public com.google.cloud.location.Location.Builder addLocationsBuilder(int index) * repeated .google.cloud.location.Location locations = 1; */ public java.util.List getLocationsBuilderList() { - return getLocationsFieldBuilder().getBuilderList(); + return internalGetLocationsFieldBuilder().getBuilderList(); } - private com.google.protobuf.RepeatedFieldBuilderV3< + private com.google.protobuf.RepeatedFieldBuilder< com.google.cloud.location.Location, com.google.cloud.location.Location.Builder, com.google.cloud.location.LocationOrBuilder> - getLocationsFieldBuilder() { + internalGetLocationsFieldBuilder() { if (locationsBuilder_ == null) { locationsBuilder_ = - new com.google.protobuf.RepeatedFieldBuilderV3< + new com.google.protobuf.RepeatedFieldBuilder< com.google.cloud.location.Location, com.google.cloud.location.Location.Builder, com.google.cloud.location.LocationOrBuilder>( @@ -935,6 +948,7 @@ public java.util.List getLocationsBu } private java.lang.Object nextPageToken_ = ""; + /** * * @@ -957,6 +971,7 @@ public java.lang.String getNextPageToken() { return (java.lang.String) ref; } } + /** * * @@ -979,6 +994,7 @@ public com.google.protobuf.ByteString getNextPageTokenBytes() { return (com.google.protobuf.ByteString) ref; } } + /** * * @@ -995,11 +1011,12 @@ public Builder setNextPageToken(java.lang.String value) { if (value == null) { throw new NullPointerException(); } - nextPageToken_ = value; + bitField0_ |= 0x00000002; onChanged(); return this; } + /** * * @@ -1012,11 +1029,12 @@ public Builder setNextPageToken(java.lang.String value) { * @return This builder for chaining. */ public Builder clearNextPageToken() { - nextPageToken_ = getDefaultInstance().getNextPageToken(); + bitField0_ = (bitField0_ & ~0x00000002); onChanged(); return this; } + /** * * @@ -1034,23 +1052,12 @@ public Builder setNextPageTokenBytes(com.google.protobuf.ByteString value) { 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.cloud.location.ListLocationsResponse) } diff --git a/java-common-protos/proto-google-common-protos/src/main/java/com/google/cloud/location/ListLocationsResponseOrBuilder.java b/java-common-protos/proto-google-common-protos/src/main/java/com/google/cloud/location/ListLocationsResponseOrBuilder.java index 704771cc48..80ddc9331f 100644 --- a/java-common-protos/proto-google-common-protos/src/main/java/com/google/cloud/location/ListLocationsResponseOrBuilder.java +++ b/java-common-protos/proto-google-common-protos/src/main/java/com/google/cloud/location/ListLocationsResponseOrBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,10 +14,13 @@ * limitations under the License. */ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: google/cloud/location/locations.proto +// Protobuf Java Version: 4.33.2 package com.google.cloud.location; +@com.google.protobuf.Generated public interface ListLocationsResponseOrBuilder extends // @@protoc_insertion_point(interface_extends:google.cloud.location.ListLocationsResponse) @@ -33,6 +36,7 @@ public interface ListLocationsResponseOrBuilder * repeated .google.cloud.location.Location locations = 1; */ java.util.List getLocationsList(); + /** * * @@ -43,6 +47,7 @@ public interface ListLocationsResponseOrBuilder * repeated .google.cloud.location.Location locations = 1; */ com.google.cloud.location.Location getLocations(int index); + /** * * @@ -53,6 +58,7 @@ public interface ListLocationsResponseOrBuilder * repeated .google.cloud.location.Location locations = 1; */ int getLocationsCount(); + /** * * @@ -63,6 +69,7 @@ public interface ListLocationsResponseOrBuilder * repeated .google.cloud.location.Location locations = 1; */ java.util.List getLocationsOrBuilderList(); + /** * * @@ -86,6 +93,7 @@ public interface ListLocationsResponseOrBuilder * @return The nextPageToken. */ java.lang.String getNextPageToken(); + /** * * diff --git a/java-common-protos/proto-google-common-protos/src/main/java/com/google/cloud/location/Location.java b/java-common-protos/proto-google-common-protos/src/main/java/com/google/cloud/location/Location.java index bcd19d5c9a..a8a0b46a65 100644 --- a/java-common-protos/proto-google-common-protos/src/main/java/com/google/cloud/location/Location.java +++ b/java-common-protos/proto-google-common-protos/src/main/java/com/google/cloud/location/Location.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,9 @@ * limitations under the License. */ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: google/cloud/location/locations.proto +// Protobuf Java Version: 4.33.2 package com.google.cloud.location; @@ -27,13 +29,25 @@ * * Protobuf type {@code google.cloud.location.Location} */ -public final class Location extends com.google.protobuf.GeneratedMessageV3 +@com.google.protobuf.Generated +public final class Location extends com.google.protobuf.GeneratedMessage implements // @@protoc_insertion_point(message_implements:google.cloud.location.Location) LocationOrBuilder { private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "Location"); + } + // Use Location.newBuilder() to construct. - private Location(com.google.protobuf.GeneratedMessageV3.Builder builder) { + private Location(com.google.protobuf.GeneratedMessage.Builder builder) { super(builder); } @@ -43,17 +57,6 @@ private Location() { displayName_ = ""; } - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new Location(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.cloud.location.LocationsProto .internal_static_google_cloud_location_Location_descriptor; @@ -61,7 +64,8 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { @SuppressWarnings({"rawtypes"}) @java.lang.Override - protected com.google.protobuf.MapField internalGetMapField(int number) { + protected com.google.protobuf.MapFieldReflectionAccessor internalGetMapFieldReflection( + int number) { switch (number) { case 2: return internalGetLabels(); @@ -71,7 +75,7 @@ protected com.google.protobuf.MapField internalGetMapField(int number) { } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.cloud.location.LocationsProto .internal_static_google_cloud_location_Location_fieldAccessorTable @@ -80,8 +84,12 @@ protected com.google.protobuf.MapField internalGetMapField(int number) { com.google.cloud.location.Location.Builder.class); } + private int bitField0_; public static final int NAME_FIELD_NUMBER = 1; - private volatile java.lang.Object name_; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** * * @@ -106,6 +114,7 @@ public java.lang.String getName() { return s; } } + /** * * @@ -132,7 +141,10 @@ public com.google.protobuf.ByteString getNameBytes() { } public static final int LOCATION_ID_FIELD_NUMBER = 4; - private volatile java.lang.Object locationId_; + + @SuppressWarnings("serial") + private volatile java.lang.Object locationId_ = ""; + /** * * @@ -156,6 +168,7 @@ public java.lang.String getLocationId() { return s; } } + /** * * @@ -181,7 +194,10 @@ public com.google.protobuf.ByteString getLocationIdBytes() { } public static final int DISPLAY_NAME_FIELD_NUMBER = 5; - private volatile java.lang.Object displayName_; + + @SuppressWarnings("serial") + private volatile java.lang.Object displayName_ = ""; + /** * * @@ -206,6 +222,7 @@ public java.lang.String getDisplayName() { return s; } } + /** * * @@ -244,6 +261,7 @@ private static final class LabelsDefaultEntryHolder { ""); } + @SuppressWarnings("serial") private com.google.protobuf.MapField labels_; private com.google.protobuf.MapField internalGetLabels() { @@ -256,12 +274,14 @@ private com.google.protobuf.MapField interna public int getLabelsCount() { return internalGetLabels().getMap().size(); } + /** * * *
            * Cross-service attributes for the location. For example
        -   *     {"cloud.googleapis.com/region": "us-east1"}
        +   *
        +   * {"cloud.googleapis.com/region": "us-east1"}
            * 
        * * map<string, string> labels = 2; @@ -273,18 +293,21 @@ public boolean containsLabels(java.lang.String key) { } return internalGetLabels().getMap().containsKey(key); } + /** Use {@link #getLabelsMap()} instead. */ @java.lang.Override @java.lang.Deprecated public java.util.Map getLabels() { return getLabelsMap(); } + /** * * *
            * Cross-service attributes for the location. For example
        -   *     {"cloud.googleapis.com/region": "us-east1"}
        +   *
        +   * {"cloud.googleapis.com/region": "us-east1"}
            * 
        * * map<string, string> labels = 2; @@ -293,30 +316,37 @@ public java.util.Map getLabels() { public java.util.Map getLabelsMap() { return internalGetLabels().getMap(); } + /** * * *
            * Cross-service attributes for the location. For example
        -   *     {"cloud.googleapis.com/region": "us-east1"}
        +   *
        +   * {"cloud.googleapis.com/region": "us-east1"}
            * 
        * * map<string, string> labels = 2; */ @java.lang.Override - public java.lang.String getLabelsOrDefault(java.lang.String key, java.lang.String defaultValue) { + 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; } + /** * * *
            * Cross-service attributes for the location. For example
        -   *     {"cloud.googleapis.com/region": "us-east1"}
        +   *
        +   * {"cloud.googleapis.com/region": "us-east1"}
            * 
        * * map<string, string> labels = 2; @@ -335,6 +365,7 @@ public java.lang.String getLabelsOrThrow(java.lang.String key) { public static final int METADATA_FIELD_NUMBER = 3; private com.google.protobuf.Any metadata_; + /** * * @@ -349,8 +380,9 @@ public java.lang.String getLabelsOrThrow(java.lang.String key) { */ @java.lang.Override public boolean hasMetadata() { - return metadata_ != null; + return ((bitField0_ & 0x00000001) != 0); } + /** * * @@ -367,6 +399,7 @@ public boolean hasMetadata() { public com.google.protobuf.Any getMetadata() { return metadata_ == null ? com.google.protobuf.Any.getDefaultInstance() : metadata_; } + /** * * @@ -379,7 +412,7 @@ public com.google.protobuf.Any getMetadata() { */ @java.lang.Override public com.google.protobuf.AnyOrBuilder getMetadataOrBuilder() { - return getMetadata(); + return metadata_ == null ? com.google.protobuf.Any.getDefaultInstance() : metadata_; } private byte memoizedIsInitialized = -1; @@ -396,19 +429,19 @@ public final boolean isInitialized() { @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.GeneratedMessage.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, name_); } - com.google.protobuf.GeneratedMessageV3.serializeStringMapTo( + com.google.protobuf.GeneratedMessage.serializeStringMapTo( output, internalGetLabels(), LabelsDefaultEntryHolder.defaultEntry, 2); - if (metadata_ != null) { + if (((bitField0_ & 0x00000001) != 0)) { output.writeMessage(3, getMetadata()); } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(locationId_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 4, locationId_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(locationId_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 4, locationId_); } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(displayName_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 5, displayName_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(displayName_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 5, displayName_); } getUnknownFields().writeTo(output); } @@ -419,8 +452,8 @@ public int getSerializedSize() { 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.GeneratedMessage.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, name_); } for (java.util.Map.Entry entry : internalGetLabels().getMap().entrySet()) { @@ -432,14 +465,14 @@ public int getSerializedSize() { .build(); size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, labels__); } - if (metadata_ != null) { + if (((bitField0_ & 0x00000001) != 0)) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getMetadata()); } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(locationId_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, locationId_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(locationId_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(4, locationId_); } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(displayName_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, displayName_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(displayName_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(5, displayName_); } size += getUnknownFields().getSerializedSize(); memoizedSize = size; @@ -530,38 +563,38 @@ public static com.google.cloud.location.Location parseFrom( public static com.google.cloud.location.Location parseFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); } public static com.google.cloud.location.Location parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } public static com.google.cloud.location.Location parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); } public static com.google.cloud.location.Location parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( PARSER, input, extensionRegistry); } public static com.google.cloud.location.Location parseFrom( com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); } public static com.google.cloud.location.Location parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } @@ -584,10 +617,11 @@ public Builder toBuilder() { } @java.lang.Override - protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { Builder builder = new Builder(parent); return builder; } + /** * * @@ -597,7 +631,7 @@ protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.Build * * Protobuf type {@code google.cloud.location.Location} */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder implements // @@protoc_insertion_point(builder_implements:google.cloud.location.Location) com.google.cloud.location.LocationOrBuilder { @@ -607,7 +641,8 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } @SuppressWarnings({"rawtypes"}) - protected com.google.protobuf.MapField internalGetMapField(int number) { + protected com.google.protobuf.MapFieldReflectionAccessor internalGetMapFieldReflection( + int number) { switch (number) { case 2: return internalGetLabels(); @@ -617,7 +652,8 @@ protected com.google.protobuf.MapField internalGetMapField(int number) { } @SuppressWarnings({"rawtypes"}) - protected com.google.protobuf.MapField internalGetMutableMapField(int number) { + protected com.google.protobuf.MapFieldReflectionAccessor internalGetMutableMapFieldReflection( + int number) { switch (number) { case 2: return internalGetMutableLabels(); @@ -627,7 +663,7 @@ protected com.google.protobuf.MapField internalGetMutableMapField(int number) { } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.cloud.location.LocationsProto .internal_static_google_cloud_location_Location_fieldAccessorTable @@ -637,26 +673,32 @@ protected com.google.protobuf.MapField internalGetMutableMapField(int number) { } // Construct using com.google.cloud.location.Location.newBuilder() - private Builder() {} + private Builder() { + maybeForceBuilderInitialization(); + } - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetMetadataFieldBuilder(); + } } @java.lang.Override public Builder clear() { super.clear(); + bitField0_ = 0; name_ = ""; - locationId_ = ""; - displayName_ = ""; - internalGetMutableLabels().clear(); - if (metadataBuilder_ == null) { - metadata_ = null; - } else { - metadata_ = null; + metadata_ = null; + if (metadataBuilder_ != null) { + metadataBuilder_.dispose(); metadataBuilder_ = null; } return this; @@ -685,52 +727,34 @@ public com.google.cloud.location.Location build() { @java.lang.Override public com.google.cloud.location.Location buildPartial() { com.google.cloud.location.Location result = new com.google.cloud.location.Location(this); - int from_bitField0_ = bitField0_; - result.name_ = name_; - result.locationId_ = locationId_; - result.displayName_ = displayName_; - result.labels_ = internalGetLabels(); - result.labels_.makeImmutable(); - if (metadataBuilder_ == null) { - result.metadata_ = metadata_; - } else { - result.metadata_ = metadataBuilder_.build(); + if (bitField0_ != 0) { + buildPartial0(result); } 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); + private void buildPartial0(com.google.cloud.location.Location result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.locationId_ = locationId_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.displayName_ = displayName_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.labels_ = internalGetLabels(); + result.labels_.makeImmutable(); + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000010) != 0)) { + result.metadata_ = metadataBuilder_ == null ? metadata_ : metadataBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + result.bitField0_ |= to_bitField0_; } @java.lang.Override @@ -747,17 +771,21 @@ public Builder mergeFrom(com.google.cloud.location.Location other) { if (other == com.google.cloud.location.Location.getDefaultInstance()) return this; if (!other.getName().isEmpty()) { name_ = other.name_; + bitField0_ |= 0x00000001; onChanged(); } if (!other.getLocationId().isEmpty()) { locationId_ = other.locationId_; + bitField0_ |= 0x00000002; onChanged(); } if (!other.getDisplayName().isEmpty()) { displayName_ = other.displayName_; + bitField0_ |= 0x00000004; onChanged(); } internalGetMutableLabels().mergeFrom(other.internalGetLabels()); + bitField0_ |= 0x00000008; if (other.hasMetadata()) { mergeMetadata(other.getMetadata()); } @@ -790,7 +818,7 @@ public Builder mergeFrom( case 10: { name_ = input.readStringRequireUtf8(); - + bitField0_ |= 0x00000001; break; } // case 10 case 18: @@ -802,24 +830,26 @@ public Builder mergeFrom( internalGetMutableLabels() .getMutableMap() .put(labels__.getKey(), labels__.getValue()); + bitField0_ |= 0x00000008; break; } // case 18 case 26: { - input.readMessage(getMetadataFieldBuilder().getBuilder(), extensionRegistry); - + input.readMessage( + internalGetMetadataFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000010; break; } // case 26 case 34: { locationId_ = input.readStringRequireUtf8(); - + bitField0_ |= 0x00000002; break; } // case 34 case 42: { displayName_ = input.readStringRequireUtf8(); - + bitField0_ |= 0x00000004; break; } // case 42 default: @@ -842,6 +872,7 @@ public Builder mergeFrom( private int bitField0_; private java.lang.Object name_ = ""; + /** * * @@ -865,6 +896,7 @@ public java.lang.String getName() { return (java.lang.String) ref; } } + /** * * @@ -888,6 +920,7 @@ public com.google.protobuf.ByteString getNameBytes() { return (com.google.protobuf.ByteString) ref; } } + /** * * @@ -905,11 +938,12 @@ public Builder setName(java.lang.String value) { if (value == null) { throw new NullPointerException(); } - name_ = value; + bitField0_ |= 0x00000001; onChanged(); return this; } + /** * * @@ -923,11 +957,12 @@ public Builder setName(java.lang.String value) { * @return This builder for chaining. */ public Builder clearName() { - name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); onChanged(); return this; } + /** * * @@ -946,13 +981,14 @@ public Builder setNameBytes(com.google.protobuf.ByteString value) { throw new NullPointerException(); } checkByteStringIsUtf8(value); - name_ = value; + bitField0_ |= 0x00000001; onChanged(); return this; } private java.lang.Object locationId_ = ""; + /** * * @@ -975,6 +1011,7 @@ public java.lang.String getLocationId() { return (java.lang.String) ref; } } + /** * * @@ -997,6 +1034,7 @@ public com.google.protobuf.ByteString getLocationIdBytes() { return (com.google.protobuf.ByteString) ref; } } + /** * * @@ -1013,11 +1051,12 @@ public Builder setLocationId(java.lang.String value) { if (value == null) { throw new NullPointerException(); } - locationId_ = value; + bitField0_ |= 0x00000002; onChanged(); return this; } + /** * * @@ -1030,11 +1069,12 @@ public Builder setLocationId(java.lang.String value) { * @return This builder for chaining. */ public Builder clearLocationId() { - locationId_ = getDefaultInstance().getLocationId(); + bitField0_ = (bitField0_ & ~0x00000002); onChanged(); return this; } + /** * * @@ -1052,13 +1092,14 @@ public Builder setLocationIdBytes(com.google.protobuf.ByteString value) { throw new NullPointerException(); } checkByteStringIsUtf8(value); - locationId_ = value; + bitField0_ |= 0x00000002; onChanged(); return this; } private java.lang.Object displayName_ = ""; + /** * * @@ -1082,6 +1123,7 @@ public java.lang.String getDisplayName() { return (java.lang.String) ref; } } + /** * * @@ -1105,6 +1147,7 @@ public com.google.protobuf.ByteString getDisplayNameBytes() { return (com.google.protobuf.ByteString) ref; } } + /** * * @@ -1122,11 +1165,12 @@ public Builder setDisplayName(java.lang.String value) { if (value == null) { throw new NullPointerException(); } - displayName_ = value; + bitField0_ |= 0x00000004; onChanged(); return this; } + /** * * @@ -1140,11 +1184,12 @@ public Builder setDisplayName(java.lang.String value) { * @return This builder for chaining. */ public Builder clearDisplayName() { - displayName_ = getDefaultInstance().getDisplayName(); + bitField0_ = (bitField0_ & ~0x00000004); onChanged(); return this; } + /** * * @@ -1163,8 +1208,8 @@ public Builder setDisplayNameBytes(com.google.protobuf.ByteString value) { throw new NullPointerException(); } checkByteStringIsUtf8(value); - displayName_ = value; + bitField0_ |= 0x00000004; onChanged(); return this; } @@ -1180,26 +1225,28 @@ private com.google.protobuf.MapField interna private com.google.protobuf.MapField internalGetMutableLabels() { - onChanged(); - ; if (labels_ == null) { labels_ = com.google.protobuf.MapField.newMapField(LabelsDefaultEntryHolder.defaultEntry); } if (!labels_.isMutable()) { labels_ = labels_.copy(); } + bitField0_ |= 0x00000008; + onChanged(); return labels_; } public int getLabelsCount() { return internalGetLabels().getMap().size(); } + /** * * *
              * Cross-service attributes for the location. For example
        -     *     {"cloud.googleapis.com/region": "us-east1"}
        +     *
        +     * {"cloud.googleapis.com/region": "us-east1"}
              * 
        * * map<string, string> labels = 2; @@ -1211,18 +1258,21 @@ public boolean containsLabels(java.lang.String key) { } return internalGetLabels().getMap().containsKey(key); } + /** Use {@link #getLabelsMap()} instead. */ @java.lang.Override @java.lang.Deprecated public java.util.Map getLabels() { return getLabelsMap(); } + /** * * *
              * Cross-service attributes for the location. For example
        -     *     {"cloud.googleapis.com/region": "us-east1"}
        +     *
        +     * {"cloud.googleapis.com/region": "us-east1"}
              * 
        * * map<string, string> labels = 2; @@ -1231,31 +1281,37 @@ public java.util.Map getLabels() { public java.util.Map getLabelsMap() { return internalGetLabels().getMap(); } + /** * * *
              * Cross-service attributes for the location. For example
        -     *     {"cloud.googleapis.com/region": "us-east1"}
        +     *
        +     * {"cloud.googleapis.com/region": "us-east1"}
              * 
        * * map<string, string> labels = 2; */ @java.lang.Override - public java.lang.String getLabelsOrDefault( - java.lang.String key, java.lang.String defaultValue) { + 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; } + /** * * *
              * Cross-service attributes for the location. For example
        -     *     {"cloud.googleapis.com/region": "us-east1"}
        +     *
        +     * {"cloud.googleapis.com/region": "us-east1"}
              * 
        * * map<string, string> labels = 2; @@ -1273,15 +1329,18 @@ public java.lang.String getLabelsOrThrow(java.lang.String key) { } public Builder clearLabels() { + bitField0_ = (bitField0_ & ~0x00000008); internalGetMutableLabels().getMutableMap().clear(); return this; } + /** * * *
              * Cross-service attributes for the location. For example
        -     *     {"cloud.googleapis.com/region": "us-east1"}
        +     *
        +     * {"cloud.googleapis.com/region": "us-east1"}
              * 
        * * map<string, string> labels = 2; @@ -1293,17 +1352,21 @@ public Builder removeLabels(java.lang.String key) { internalGetMutableLabels().getMutableMap().remove(key); return this; } + /** Use alternate mutation accessors instead. */ @java.lang.Deprecated public java.util.Map getMutableLabels() { + bitField0_ |= 0x00000008; return internalGetMutableLabels().getMutableMap(); } + /** * * *
              * Cross-service attributes for the location. For example
        -     *     {"cloud.googleapis.com/region": "us-east1"}
        +     *
        +     * {"cloud.googleapis.com/region": "us-east1"}
              * 
        * * map<string, string> labels = 2; @@ -1315,31 +1378,35 @@ public Builder putLabels(java.lang.String key, java.lang.String value) { if (value == null) { throw new NullPointerException("map value"); } - internalGetMutableLabels().getMutableMap().put(key, value); + bitField0_ |= 0x00000008; return this; } + /** * * *
              * Cross-service attributes for the location. For example
        -     *     {"cloud.googleapis.com/region": "us-east1"}
        +     *
        +     * {"cloud.googleapis.com/region": "us-east1"}
              * 
        * * map<string, string> labels = 2; */ public Builder putAllLabels(java.util.Map values) { internalGetMutableLabels().getMutableMap().putAll(values); + bitField0_ |= 0x00000008; return this; } private com.google.protobuf.Any metadata_; - private com.google.protobuf.SingleFieldBuilderV3< + private com.google.protobuf.SingleFieldBuilder< com.google.protobuf.Any, com.google.protobuf.Any.Builder, com.google.protobuf.AnyOrBuilder> metadataBuilder_; + /** * * @@ -1353,8 +1420,9 @@ public Builder putAllLabels(java.util.Map va * @return Whether the metadata field is set. */ public boolean hasMetadata() { - return metadataBuilder_ != null || metadata_ != null; + return ((bitField0_ & 0x00000010) != 0); } + /** * * @@ -1374,6 +1442,7 @@ public com.google.protobuf.Any getMetadata() { return metadataBuilder_.getMessage(); } } + /** * * @@ -1390,13 +1459,14 @@ public Builder setMetadata(com.google.protobuf.Any value) { throw new NullPointerException(); } metadata_ = value; - onChanged(); } else { metadataBuilder_.setMessage(value); } - + bitField0_ |= 0x00000010; + onChanged(); return this; } + /** * * @@ -1410,13 +1480,14 @@ public Builder setMetadata(com.google.protobuf.Any value) { public Builder setMetadata(com.google.protobuf.Any.Builder builderForValue) { if (metadataBuilder_ == null) { metadata_ = builderForValue.build(); - onChanged(); } else { metadataBuilder_.setMessage(builderForValue.build()); } - + bitField0_ |= 0x00000010; + onChanged(); return this; } + /** * * @@ -1429,18 +1500,23 @@ public Builder setMetadata(com.google.protobuf.Any.Builder builderForValue) { */ public Builder mergeMetadata(com.google.protobuf.Any value) { if (metadataBuilder_ == null) { - if (metadata_ != null) { - metadata_ = com.google.protobuf.Any.newBuilder(metadata_).mergeFrom(value).buildPartial(); + if (((bitField0_ & 0x00000010) != 0) + && metadata_ != null + && metadata_ != com.google.protobuf.Any.getDefaultInstance()) { + getMetadataBuilder().mergeFrom(value); } else { metadata_ = value; } - onChanged(); } else { metadataBuilder_.mergeFrom(value); } - + if (metadata_ != null) { + bitField0_ |= 0x00000010; + onChanged(); + } return this; } + /** * * @@ -1452,16 +1528,16 @@ public Builder mergeMetadata(com.google.protobuf.Any value) { * .google.protobuf.Any metadata = 3; */ public Builder clearMetadata() { - if (metadataBuilder_ == null) { - metadata_ = null; - onChanged(); - } else { - metadata_ = null; + bitField0_ = (bitField0_ & ~0x00000010); + metadata_ = null; + if (metadataBuilder_ != null) { + metadataBuilder_.dispose(); metadataBuilder_ = null; } - + onChanged(); return this; } + /** * * @@ -1473,10 +1549,11 @@ public Builder clearMetadata() { * .google.protobuf.Any metadata = 3; */ public com.google.protobuf.Any.Builder getMetadataBuilder() { - + bitField0_ |= 0x00000010; onChanged(); - return getMetadataFieldBuilder().getBuilder(); + return internalGetMetadataFieldBuilder().getBuilder(); } + /** * * @@ -1494,6 +1571,7 @@ public com.google.protobuf.AnyOrBuilder getMetadataOrBuilder() { return metadata_ == null ? com.google.protobuf.Any.getDefaultInstance() : metadata_; } } + /** * * @@ -1504,14 +1582,14 @@ public com.google.protobuf.AnyOrBuilder getMetadataOrBuilder() { * * .google.protobuf.Any metadata = 3; */ - private com.google.protobuf.SingleFieldBuilderV3< + private com.google.protobuf.SingleFieldBuilder< com.google.protobuf.Any, com.google.protobuf.Any.Builder, com.google.protobuf.AnyOrBuilder> - getMetadataFieldBuilder() { + internalGetMetadataFieldBuilder() { if (metadataBuilder_ == null) { metadataBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< + new com.google.protobuf.SingleFieldBuilder< com.google.protobuf.Any, com.google.protobuf.Any.Builder, com.google.protobuf.AnyOrBuilder>(getMetadata(), getParentForChildren(), isClean()); @@ -1520,17 +1598,6 @@ public com.google.protobuf.AnyOrBuilder getMetadataOrBuilder() { return metadataBuilder_; } - @java.lang.Override - public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - // @@protoc_insertion_point(builder_scope:google.cloud.location.Location) } diff --git a/java-common-protos/proto-google-common-protos/src/main/java/com/google/cloud/location/LocationOrBuilder.java b/java-common-protos/proto-google-common-protos/src/main/java/com/google/cloud/location/LocationOrBuilder.java index e1fb6694c6..4dd3fe2fb8 100644 --- a/java-common-protos/proto-google-common-protos/src/main/java/com/google/cloud/location/LocationOrBuilder.java +++ b/java-common-protos/proto-google-common-protos/src/main/java/com/google/cloud/location/LocationOrBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,10 +14,13 @@ * limitations under the License. */ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: google/cloud/location/locations.proto +// Protobuf Java Version: 4.33.2 package com.google.cloud.location; +@com.google.protobuf.Generated public interface LocationOrBuilder extends // @@protoc_insertion_point(interface_extends:google.cloud.location.Location) @@ -36,6 +39,7 @@ public interface LocationOrBuilder * @return The name. */ java.lang.String getName(); + /** * * @@ -62,6 +66,7 @@ public interface LocationOrBuilder * @return The locationId. */ java.lang.String getLocationId(); + /** * * @@ -88,6 +93,7 @@ public interface LocationOrBuilder * @return The displayName. */ java.lang.String getDisplayName(); + /** * * @@ -107,59 +113,68 @@ public interface LocationOrBuilder * *
            * Cross-service attributes for the location. For example
        -   *     {"cloud.googleapis.com/region": "us-east1"}
        +   *
        +   * {"cloud.googleapis.com/region": "us-east1"}
            * 
        * * map<string, string> labels = 2; */ int getLabelsCount(); + /** * * *
            * Cross-service attributes for the location. For example
        -   *     {"cloud.googleapis.com/region": "us-east1"}
        +   *
        +   * {"cloud.googleapis.com/region": "us-east1"}
            * 
        * * map<string, string> labels = 2; */ boolean containsLabels(java.lang.String key); + /** Use {@link #getLabelsMap()} instead. */ @java.lang.Deprecated java.util.Map getLabels(); + /** * * *
            * Cross-service attributes for the location. For example
        -   *     {"cloud.googleapis.com/region": "us-east1"}
        +   *
        +   * {"cloud.googleapis.com/region": "us-east1"}
            * 
        * * map<string, string> labels = 2; */ java.util.Map getLabelsMap(); + /** * * *
            * Cross-service attributes for the location. For example
        -   *     {"cloud.googleapis.com/region": "us-east1"}
        +   *
        +   * {"cloud.googleapis.com/region": "us-east1"}
            * 
        * * map<string, string> labels = 2; */ - /* nullable */ java.lang.String getLabelsOrDefault( java.lang.String key, /* nullable */ java.lang.String defaultValue); + /** * * *
            * Cross-service attributes for the location. For example
        -   *     {"cloud.googleapis.com/region": "us-east1"}
        +   *
        +   * {"cloud.googleapis.com/region": "us-east1"}
            * 
        * * map<string, string> labels = 2; @@ -179,6 +194,7 @@ java.lang.String getLabelsOrDefault( * @return Whether the metadata field is set. */ boolean hasMetadata(); + /** * * @@ -192,6 +208,7 @@ java.lang.String getLabelsOrDefault( * @return The metadata. */ com.google.protobuf.Any getMetadata(); + /** * * diff --git a/java-common-protos/proto-google-common-protos/src/main/java/com/google/cloud/location/LocationsProto.java b/java-common-protos/proto-google-common-protos/src/main/java/com/google/cloud/location/LocationsProto.java index d2b6da3066..1eaaff7096 100644 --- a/java-common-protos/proto-google-common-protos/src/main/java/com/google/cloud/location/LocationsProto.java +++ b/java-common-protos/proto-google-common-protos/src/main/java/com/google/cloud/location/LocationsProto.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,13 +14,26 @@ * limitations under the License. */ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: google/cloud/location/locations.proto +// Protobuf Java Version: 4.33.2 package com.google.cloud.location; -public final class LocationsProto { +@com.google.protobuf.Generated +public final class LocationsProto extends com.google.protobuf.GeneratedFile { private LocationsProto() {} + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "LocationsProto"); + } + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistryLite registry) {} public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry registry) { @@ -29,23 +42,23 @@ public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry r static final com.google.protobuf.Descriptors.Descriptor internal_static_google_cloud_location_ListLocationsRequest_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable internal_static_google_cloud_location_ListLocationsRequest_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_google_cloud_location_ListLocationsResponse_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable internal_static_google_cloud_location_ListLocationsResponse_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_google_cloud_location_GetLocationRequest_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable internal_static_google_cloud_location_GetLocationRequest_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_google_cloud_location_Location_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable internal_static_google_cloud_location_Location_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_google_cloud_location_Location_LabelsEntry_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable internal_static_google_cloud_location_Location_LabelsEntry_fieldAccessorTable; public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { @@ -56,35 +69,40 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { static { java.lang.String[] descriptorData = { - "\n%google/cloud/location/locations.proto\022" + "\n" + + "%google/cloud/location/locations.proto\022" + "\025google.cloud.location\032\034google/api/annot" - + "ations.proto\032\031google/protobuf/any.proto\032" - + "\027google/api/client.proto\"[\n\024ListLocation" - + "sRequest\022\014\n\004name\030\001 \001(\t\022\016\n\006filter\030\002 \001(\t\022\021" - + "\n\tpage_size\030\003 \001(\005\022\022\n\npage_token\030\004 \001(\t\"d\n" - + "\025ListLocationsResponse\0222\n\tlocations\030\001 \003(" - + "\0132\037.google.cloud.location.Location\022\027\n\017ne" - + "xt_page_token\030\002 \001(\t\"\"\n\022GetLocationReques" - + "t\022\014\n\004name\030\001 \001(\t\"\327\001\n\010Location\022\014\n\004name\030\001 \001" - + "(\t\022\023\n\013location_id\030\004 \001(\t\022\024\n\014display_name\030" - + "\005 \001(\t\022;\n\006labels\030\002 \003(\0132+.google.cloud.loc" - + "ation.Location.LabelsEntry\022&\n\010metadata\030\003" - + " \001(\0132\024.google.protobuf.Any\032-\n\013LabelsEntr" - + "y\022\013\n\003key\030\001 \001(\t\022\r\n\005value\030\002 \001(\t:\0028\0012\244\003\n\tLo" - + "cations\022\253\001\n\rListLocations\022+.google.cloud" - + ".location.ListLocationsRequest\032,.google." + + "ations.proto\032\031google/protobuf/any.proto\032\027google/api/client.proto\"[\n" + + "\024ListLocationsRequest\022\014\n" + + "\004name\030\001 \001(\t\022\016\n" + + "\006filter\030\002 \001(\t\022\021\n" + + "\tpage_size\030\003 \001(\005\022\022\n\n" + + "page_token\030\004 \001(\t\"d\n" + + "\025ListLocationsResponse\0222\n" + + "\tlocations\030\001 \003(\0132\037.google.cloud.location.Location\022\027\n" + + "\017next_page_token\030\002 \001(\t\"\"\n" + + "\022GetLocationRequest\022\014\n" + + "\004name\030\001 \001(\t\"\327\001\n" + + "\010Location\022\014\n" + + "\004name\030\001 \001(\t\022\023\n" + + "\013location_id\030\004 \001(\t\022\024\n" + + "\014display_name\030\005 \001(\t\022;\n" + + "\006labels\030\002 \003(\0132+.google.cloud.location.Location.LabelsEntry\022&\n" + + "\010metadata\030\003 \001(\0132\024.google.protobuf.Any\032-\n" + + "\013LabelsEntry\022\013\n" + + "\003key\030\001 \001(\t\022\r\n" + + "\005value\030\002 \001(\t:\0028\0012\244\003\n" + + "\tLocations\022\253\001\n\r" + + "ListLocations\022+.google.cloud.location.ListLocationsRequest\032,.google." + "cloud.location.ListLocationsResponse\"?\202\323" - + "\344\223\0029\022\024/v1/{name=locations}Z!\022\037/v1/{name=" - + "projects/*}/locations\022\236\001\n\013GetLocation\022)." - + "google.cloud.location.GetLocationRequest" + + "\344\223\0029\022\024/v1/{name=locations}Z!\022\037/v1/{name=projects/*}/locations\022\236\001\n" + + "\013GetLocation\022).google.cloud.location.GetLocationRequest" + "\032\037.google.cloud.location.Location\"C\202\323\344\223\002" + "=\022\026/v1/{name=locations/*}Z#\022!/v1/{name=p" + "rojects/*/locations/*}\032H\312A\024cloud.googlea" - + "pis.com\322A.https://www.googleapis.com/aut" - + "h/cloud-platformBo\n\031com.google.cloud.loc" - + "ationB\016LocationsProtoP\001Z=google.golang.o" - + "rg/genproto/googleapis/cloud/location;lo" - + "cation\370\001\001b\006proto3" + + "pis.com\322A.https://www.googleapis.com/auth/cloud-platformBo\n" + + "\031com.google.cloud.locationB\016LocationsProtoP\001Z=google.golang.o" + + "rg/genproto/googleapis/cloud/location;location\370\001\001b\006proto3" }; descriptor = com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( @@ -95,45 +113,48 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { com.google.api.ClientProto.getDescriptor(), }); internal_static_google_cloud_location_ListLocationsRequest_descriptor = - getDescriptor().getMessageTypes().get(0); + getDescriptor().getMessageType(0); internal_static_google_cloud_location_ListLocationsRequest_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_google_cloud_location_ListLocationsRequest_descriptor, new java.lang.String[] { "Name", "Filter", "PageSize", "PageToken", }); internal_static_google_cloud_location_ListLocationsResponse_descriptor = - getDescriptor().getMessageTypes().get(1); + getDescriptor().getMessageType(1); internal_static_google_cloud_location_ListLocationsResponse_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_google_cloud_location_ListLocationsResponse_descriptor, new java.lang.String[] { "Locations", "NextPageToken", }); internal_static_google_cloud_location_GetLocationRequest_descriptor = - getDescriptor().getMessageTypes().get(2); + getDescriptor().getMessageType(2); internal_static_google_cloud_location_GetLocationRequest_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_google_cloud_location_GetLocationRequest_descriptor, new java.lang.String[] { "Name", }); - internal_static_google_cloud_location_Location_descriptor = - getDescriptor().getMessageTypes().get(3); + internal_static_google_cloud_location_Location_descriptor = getDescriptor().getMessageType(3); internal_static_google_cloud_location_Location_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_google_cloud_location_Location_descriptor, new java.lang.String[] { "Name", "LocationId", "DisplayName", "Labels", "Metadata", }); internal_static_google_cloud_location_Location_LabelsEntry_descriptor = - internal_static_google_cloud_location_Location_descriptor.getNestedTypes().get(0); + internal_static_google_cloud_location_Location_descriptor.getNestedType(0); internal_static_google_cloud_location_Location_LabelsEntry_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_google_cloud_location_Location_LabelsEntry_descriptor, new java.lang.String[] { "Key", "Value", }); + descriptor.resolveAllFeaturesImmutable(); + com.google.api.AnnotationsProto.getDescriptor(); + com.google.protobuf.AnyProto.getDescriptor(); + com.google.api.ClientProto.getDescriptor(); com.google.protobuf.ExtensionRegistry registry = com.google.protobuf.ExtensionRegistry.newInstance(); registry.add(com.google.api.ClientProto.defaultHost); @@ -141,9 +162,6 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { registry.add(com.google.api.ClientProto.oauthScopes); com.google.protobuf.Descriptors.FileDescriptor.internalUpdateFileDescriptor( descriptor, registry); - com.google.api.AnnotationsProto.getDescriptor(); - com.google.protobuf.AnyProto.getDescriptor(); - com.google.api.ClientProto.getDescriptor(); } // @@protoc_insertion_point(outer_class_scope) diff --git a/java-common-protos/proto-google-common-protos/src/main/java/com/google/geo/type/Viewport.java b/java-common-protos/proto-google-common-protos/src/main/java/com/google/geo/type/Viewport.java index f4a41457b2..bb1b37549f 100644 --- a/java-common-protos/proto-google-common-protos/src/main/java/com/google/geo/type/Viewport.java +++ b/java-common-protos/proto-google-common-protos/src/main/java/com/google/geo/type/Viewport.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,9 @@ * limitations under the License. */ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: google/geo/type/viewport.proto +// Protobuf Java Version: 4.33.2 package com.google.geo.type; @@ -27,61 +29,70 @@ * its boundary. The latitude bounds must range between -90 to 90 degrees * inclusive, and the longitude bounds must range between -180 to 180 degrees * inclusive. Various cases include: - * - If `low` = `high`, the viewport consists of that single point. - * - If `low.longitude` > `high.longitude`, the longitude range is inverted - * (the viewport crosses the 180 degree longitude line). - * - If `low.longitude` = -180 degrees and `high.longitude` = 180 degrees, - * the viewport includes all longitudes. - * - If `low.longitude` = 180 degrees and `high.longitude` = -180 degrees, - * the longitude range is empty. - * - If `low.latitude` > `high.latitude`, the latitude range is empty. + * + * - If `low` = `high`, the viewport consists of that single point. + * + * - If `low.longitude` > `high.longitude`, the longitude range is inverted + * (the viewport crosses the 180 degree longitude line). + * + * - If `low.longitude` = -180 degrees and `high.longitude` = 180 degrees, + * the viewport includes all longitudes. + * + * - If `low.longitude` = 180 degrees and `high.longitude` = -180 degrees, + * the longitude range is empty. + * + * - If `low.latitude` > `high.latitude`, the latitude range is empty. + * * Both `low` and `high` must be populated, and the represented box cannot be * empty (as specified by the definitions above). An empty viewport will result * in an error. + * * For example, this viewport fully encloses New York City: + * * { - * "low": { - * "latitude": 40.477398, - * "longitude": -74.259087 - * }, - * "high": { - * "latitude": 40.91618, - * "longitude": -73.70018 - * } + * "low": { + * "latitude": 40.477398, + * "longitude": -74.259087 + * }, + * "high": { + * "latitude": 40.91618, + * "longitude": -73.70018 + * } * } * * * Protobuf type {@code google.geo.type.Viewport} */ -public final class Viewport extends com.google.protobuf.GeneratedMessageV3 +@com.google.protobuf.Generated +public final class Viewport extends com.google.protobuf.GeneratedMessage implements // @@protoc_insertion_point(message_implements:google.geo.type.Viewport) ViewportOrBuilder { private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "Viewport"); + } + // Use Viewport.newBuilder() to construct. - private Viewport(com.google.protobuf.GeneratedMessageV3.Builder builder) { + private Viewport(com.google.protobuf.GeneratedMessage.Builder builder) { super(builder); } private Viewport() {} - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new Viewport(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.geo.type.ViewportProto.internal_static_google_geo_type_Viewport_descriptor; } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.geo.type.ViewportProto .internal_static_google_geo_type_Viewport_fieldAccessorTable @@ -89,8 +100,10 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { com.google.geo.type.Viewport.class, com.google.geo.type.Viewport.Builder.class); } + private int bitField0_; public static final int LOW_FIELD_NUMBER = 1; private com.google.type.LatLng low_; + /** * * @@ -104,8 +117,9 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { */ @java.lang.Override public boolean hasLow() { - return low_ != null; + return ((bitField0_ & 0x00000001) != 0); } + /** * * @@ -121,6 +135,7 @@ public boolean hasLow() { public com.google.type.LatLng getLow() { return low_ == null ? com.google.type.LatLng.getDefaultInstance() : low_; } + /** * * @@ -132,11 +147,12 @@ public com.google.type.LatLng getLow() { */ @java.lang.Override public com.google.type.LatLngOrBuilder getLowOrBuilder() { - return getLow(); + return low_ == null ? com.google.type.LatLng.getDefaultInstance() : low_; } public static final int HIGH_FIELD_NUMBER = 2; private com.google.type.LatLng high_; + /** * * @@ -150,8 +166,9 @@ public com.google.type.LatLngOrBuilder getLowOrBuilder() { */ @java.lang.Override public boolean hasHigh() { - return high_ != null; + return ((bitField0_ & 0x00000002) != 0); } + /** * * @@ -167,6 +184,7 @@ public boolean hasHigh() { public com.google.type.LatLng getHigh() { return high_ == null ? com.google.type.LatLng.getDefaultInstance() : high_; } + /** * * @@ -178,7 +196,7 @@ public com.google.type.LatLng getHigh() { */ @java.lang.Override public com.google.type.LatLngOrBuilder getHighOrBuilder() { - return getHigh(); + return high_ == null ? com.google.type.LatLng.getDefaultInstance() : high_; } private byte memoizedIsInitialized = -1; @@ -195,10 +213,10 @@ public final boolean isInitialized() { @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (low_ != null) { + if (((bitField0_ & 0x00000001) != 0)) { output.writeMessage(1, getLow()); } - if (high_ != null) { + if (((bitField0_ & 0x00000002) != 0)) { output.writeMessage(2, getHigh()); } getUnknownFields().writeTo(output); @@ -210,10 +228,10 @@ public int getSerializedSize() { if (size != -1) return size; size = 0; - if (low_ != null) { + if (((bitField0_ & 0x00000001) != 0)) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getLow()); } - if (high_ != null) { + if (((bitField0_ & 0x00000002) != 0)) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getHigh()); } size += getUnknownFields().getSerializedSize(); @@ -299,38 +317,38 @@ public static com.google.geo.type.Viewport parseFrom( public static com.google.geo.type.Viewport parseFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); } public static com.google.geo.type.Viewport parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } public static com.google.geo.type.Viewport parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); } public static com.google.geo.type.Viewport parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( PARSER, input, extensionRegistry); } public static com.google.geo.type.Viewport parseFrom(com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); } public static com.google.geo.type.Viewport parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } @@ -353,10 +371,11 @@ public Builder toBuilder() { } @java.lang.Override - protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { Builder builder = new Builder(parent); return builder; } + /** * * @@ -366,33 +385,41 @@ protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.Build * its boundary. The latitude bounds must range between -90 to 90 degrees * inclusive, and the longitude bounds must range between -180 to 180 degrees * inclusive. Various cases include: - * - If `low` = `high`, the viewport consists of that single point. - * - If `low.longitude` > `high.longitude`, the longitude range is inverted - * (the viewport crosses the 180 degree longitude line). - * - If `low.longitude` = -180 degrees and `high.longitude` = 180 degrees, - * the viewport includes all longitudes. - * - If `low.longitude` = 180 degrees and `high.longitude` = -180 degrees, - * the longitude range is empty. - * - If `low.latitude` > `high.latitude`, the latitude range is empty. + * + * - If `low` = `high`, the viewport consists of that single point. + * + * - If `low.longitude` > `high.longitude`, the longitude range is inverted + * (the viewport crosses the 180 degree longitude line). + * + * - If `low.longitude` = -180 degrees and `high.longitude` = 180 degrees, + * the viewport includes all longitudes. + * + * - If `low.longitude` = 180 degrees and `high.longitude` = -180 degrees, + * the longitude range is empty. + * + * - If `low.latitude` > `high.latitude`, the latitude range is empty. + * * Both `low` and `high` must be populated, and the represented box cannot be * empty (as specified by the definitions above). An empty viewport will result * in an error. + * * For example, this viewport fully encloses New York City: + * * { - * "low": { - * "latitude": 40.477398, - * "longitude": -74.259087 - * }, - * "high": { - * "latitude": 40.91618, - * "longitude": -73.70018 - * } + * "low": { + * "latitude": 40.477398, + * "longitude": -74.259087 + * }, + * "high": { + * "latitude": 40.91618, + * "longitude": -73.70018 + * } * } * * * Protobuf type {@code google.geo.type.Viewport} */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder implements // @@protoc_insertion_point(builder_implements:google.geo.type.Viewport) com.google.geo.type.ViewportOrBuilder { @@ -401,7 +428,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.geo.type.ViewportProto .internal_static_google_geo_type_Viewport_fieldAccessorTable @@ -410,25 +437,34 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } // Construct using com.google.geo.type.Viewport.newBuilder() - private Builder() {} + private Builder() { + maybeForceBuilderInitialization(); + } - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetLowFieldBuilder(); + internalGetHighFieldBuilder(); + } } @java.lang.Override public Builder clear() { super.clear(); - if (lowBuilder_ == null) { - low_ = null; - } else { - low_ = null; + bitField0_ = 0; + low_ = null; + if (lowBuilder_ != null) { + lowBuilder_.dispose(); lowBuilder_ = null; } - if (highBuilder_ == null) { - high_ = null; - } else { - high_ = null; + high_ = null; + if (highBuilder_ != null) { + highBuilder_.dispose(); highBuilder_ = null; } return this; @@ -456,51 +492,25 @@ public com.google.geo.type.Viewport build() { @java.lang.Override public com.google.geo.type.Viewport buildPartial() { com.google.geo.type.Viewport result = new com.google.geo.type.Viewport(this); - if (lowBuilder_ == null) { - result.low_ = low_; - } else { - result.low_ = lowBuilder_.build(); - } - if (highBuilder_ == null) { - result.high_ = high_; - } else { - result.high_ = highBuilder_.build(); + if (bitField0_ != 0) { + buildPartial0(result); } 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); + private void buildPartial0(com.google.geo.type.Viewport result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.low_ = lowBuilder_ == null ? low_ : lowBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.high_ = highBuilder_ == null ? high_ : highBuilder_.build(); + to_bitField0_ |= 0x00000002; + } + result.bitField0_ |= to_bitField0_; } @java.lang.Override @@ -549,14 +559,14 @@ public Builder mergeFrom( break; case 10: { - input.readMessage(getLowFieldBuilder().getBuilder(), extensionRegistry); - + input.readMessage(internalGetLowFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000001; break; } // case 10 case 18: { - input.readMessage(getHighFieldBuilder().getBuilder(), extensionRegistry); - + input.readMessage(internalGetHighFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; break; } // case 18 default: @@ -576,10 +586,13 @@ public Builder mergeFrom( return this; } + private int bitField0_; + private com.google.type.LatLng low_; - private com.google.protobuf.SingleFieldBuilderV3< + private com.google.protobuf.SingleFieldBuilder< com.google.type.LatLng, com.google.type.LatLng.Builder, com.google.type.LatLngOrBuilder> lowBuilder_; + /** * * @@ -592,8 +605,9 @@ public Builder mergeFrom( * @return Whether the low field is set. */ public boolean hasLow() { - return lowBuilder_ != null || low_ != null; + return ((bitField0_ & 0x00000001) != 0); } + /** * * @@ -612,6 +626,7 @@ public com.google.type.LatLng getLow() { return lowBuilder_.getMessage(); } } + /** * * @@ -627,13 +642,14 @@ public Builder setLow(com.google.type.LatLng value) { throw new NullPointerException(); } low_ = value; - onChanged(); } else { lowBuilder_.setMessage(value); } - + bitField0_ |= 0x00000001; + onChanged(); return this; } + /** * * @@ -646,13 +662,14 @@ public Builder setLow(com.google.type.LatLng value) { public Builder setLow(com.google.type.LatLng.Builder builderForValue) { if (lowBuilder_ == null) { low_ = builderForValue.build(); - onChanged(); } else { lowBuilder_.setMessage(builderForValue.build()); } - + bitField0_ |= 0x00000001; + onChanged(); return this; } + /** * * @@ -664,18 +681,23 @@ public Builder setLow(com.google.type.LatLng.Builder builderForValue) { */ public Builder mergeLow(com.google.type.LatLng value) { if (lowBuilder_ == null) { - if (low_ != null) { - low_ = com.google.type.LatLng.newBuilder(low_).mergeFrom(value).buildPartial(); + if (((bitField0_ & 0x00000001) != 0) + && low_ != null + && low_ != com.google.type.LatLng.getDefaultInstance()) { + getLowBuilder().mergeFrom(value); } else { low_ = value; } - onChanged(); } else { lowBuilder_.mergeFrom(value); } - + if (low_ != null) { + bitField0_ |= 0x00000001; + onChanged(); + } return this; } + /** * * @@ -686,16 +708,16 @@ public Builder mergeLow(com.google.type.LatLng value) { * .google.type.LatLng low = 1; */ public Builder clearLow() { - if (lowBuilder_ == null) { - low_ = null; - onChanged(); - } else { - low_ = null; + bitField0_ = (bitField0_ & ~0x00000001); + low_ = null; + if (lowBuilder_ != null) { + lowBuilder_.dispose(); lowBuilder_ = null; } - + onChanged(); return this; } + /** * * @@ -706,10 +728,11 @@ public Builder clearLow() { * .google.type.LatLng low = 1; */ public com.google.type.LatLng.Builder getLowBuilder() { - + bitField0_ |= 0x00000001; onChanged(); - return getLowFieldBuilder().getBuilder(); + return internalGetLowFieldBuilder().getBuilder(); } + /** * * @@ -726,6 +749,7 @@ public com.google.type.LatLngOrBuilder getLowOrBuilder() { return low_ == null ? com.google.type.LatLng.getDefaultInstance() : low_; } } + /** * * @@ -735,12 +759,12 @@ public com.google.type.LatLngOrBuilder getLowOrBuilder() { * * .google.type.LatLng low = 1; */ - private com.google.protobuf.SingleFieldBuilderV3< + private com.google.protobuf.SingleFieldBuilder< com.google.type.LatLng, com.google.type.LatLng.Builder, com.google.type.LatLngOrBuilder> - getLowFieldBuilder() { + internalGetLowFieldBuilder() { if (lowBuilder_ == null) { lowBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< + new com.google.protobuf.SingleFieldBuilder< com.google.type.LatLng, com.google.type.LatLng.Builder, com.google.type.LatLngOrBuilder>(getLow(), getParentForChildren(), isClean()); @@ -750,9 +774,10 @@ public com.google.type.LatLngOrBuilder getLowOrBuilder() { } private com.google.type.LatLng high_; - private com.google.protobuf.SingleFieldBuilderV3< + private com.google.protobuf.SingleFieldBuilder< com.google.type.LatLng, com.google.type.LatLng.Builder, com.google.type.LatLngOrBuilder> highBuilder_; + /** * * @@ -765,8 +790,9 @@ public com.google.type.LatLngOrBuilder getLowOrBuilder() { * @return Whether the high field is set. */ public boolean hasHigh() { - return highBuilder_ != null || high_ != null; + return ((bitField0_ & 0x00000002) != 0); } + /** * * @@ -785,6 +811,7 @@ public com.google.type.LatLng getHigh() { return highBuilder_.getMessage(); } } + /** * * @@ -800,13 +827,14 @@ public Builder setHigh(com.google.type.LatLng value) { throw new NullPointerException(); } high_ = value; - onChanged(); } else { highBuilder_.setMessage(value); } - + bitField0_ |= 0x00000002; + onChanged(); return this; } + /** * * @@ -819,13 +847,14 @@ public Builder setHigh(com.google.type.LatLng value) { public Builder setHigh(com.google.type.LatLng.Builder builderForValue) { if (highBuilder_ == null) { high_ = builderForValue.build(); - onChanged(); } else { highBuilder_.setMessage(builderForValue.build()); } - + bitField0_ |= 0x00000002; + onChanged(); return this; } + /** * * @@ -837,18 +866,23 @@ public Builder setHigh(com.google.type.LatLng.Builder builderForValue) { */ public Builder mergeHigh(com.google.type.LatLng value) { if (highBuilder_ == null) { - if (high_ != null) { - high_ = com.google.type.LatLng.newBuilder(high_).mergeFrom(value).buildPartial(); + if (((bitField0_ & 0x00000002) != 0) + && high_ != null + && high_ != com.google.type.LatLng.getDefaultInstance()) { + getHighBuilder().mergeFrom(value); } else { high_ = value; } - onChanged(); } else { highBuilder_.mergeFrom(value); } - + if (high_ != null) { + bitField0_ |= 0x00000002; + onChanged(); + } return this; } + /** * * @@ -859,16 +893,16 @@ public Builder mergeHigh(com.google.type.LatLng value) { * .google.type.LatLng high = 2; */ public Builder clearHigh() { - if (highBuilder_ == null) { - high_ = null; - onChanged(); - } else { - high_ = null; + bitField0_ = (bitField0_ & ~0x00000002); + high_ = null; + if (highBuilder_ != null) { + highBuilder_.dispose(); highBuilder_ = null; } - + onChanged(); return this; } + /** * * @@ -879,10 +913,11 @@ public Builder clearHigh() { * .google.type.LatLng high = 2; */ public com.google.type.LatLng.Builder getHighBuilder() { - + bitField0_ |= 0x00000002; onChanged(); - return getHighFieldBuilder().getBuilder(); + return internalGetHighFieldBuilder().getBuilder(); } + /** * * @@ -899,6 +934,7 @@ public com.google.type.LatLngOrBuilder getHighOrBuilder() { return high_ == null ? com.google.type.LatLng.getDefaultInstance() : high_; } } + /** * * @@ -908,12 +944,12 @@ public com.google.type.LatLngOrBuilder getHighOrBuilder() { * * .google.type.LatLng high = 2; */ - private com.google.protobuf.SingleFieldBuilderV3< + private com.google.protobuf.SingleFieldBuilder< com.google.type.LatLng, com.google.type.LatLng.Builder, com.google.type.LatLngOrBuilder> - getHighFieldBuilder() { + internalGetHighFieldBuilder() { if (highBuilder_ == null) { highBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< + new com.google.protobuf.SingleFieldBuilder< com.google.type.LatLng, com.google.type.LatLng.Builder, com.google.type.LatLngOrBuilder>(getHigh(), getParentForChildren(), isClean()); @@ -922,17 +958,6 @@ public com.google.type.LatLngOrBuilder getHighOrBuilder() { return highBuilder_; } - @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.geo.type.Viewport) } diff --git a/java-common-protos/proto-google-common-protos/src/main/java/com/google/geo/type/ViewportOrBuilder.java b/java-common-protos/proto-google-common-protos/src/main/java/com/google/geo/type/ViewportOrBuilder.java index a0299e2517..c763a52f40 100644 --- a/java-common-protos/proto-google-common-protos/src/main/java/com/google/geo/type/ViewportOrBuilder.java +++ b/java-common-protos/proto-google-common-protos/src/main/java/com/google/geo/type/ViewportOrBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,10 +14,13 @@ * limitations under the License. */ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: google/geo/type/viewport.proto +// Protobuf Java Version: 4.33.2 package com.google.geo.type; +@com.google.protobuf.Generated public interface ViewportOrBuilder extends // @@protoc_insertion_point(interface_extends:google.geo.type.Viewport) @@ -35,6 +38,7 @@ public interface ViewportOrBuilder * @return Whether the low field is set. */ boolean hasLow(); + /** * * @@ -47,6 +51,7 @@ public interface ViewportOrBuilder * @return The low. */ com.google.type.LatLng getLow(); + /** * * @@ -70,6 +75,7 @@ public interface ViewportOrBuilder * @return Whether the high field is set. */ boolean hasHigh(); + /** * * @@ -82,6 +88,7 @@ public interface ViewportOrBuilder * @return The high. */ com.google.type.LatLng getHigh(); + /** * * diff --git a/java-common-protos/proto-google-common-protos/src/main/java/com/google/geo/type/ViewportProto.java b/java-common-protos/proto-google-common-protos/src/main/java/com/google/geo/type/ViewportProto.java index 2d6c618e3a..42b254e874 100644 --- a/java-common-protos/proto-google-common-protos/src/main/java/com/google/geo/type/ViewportProto.java +++ b/java-common-protos/proto-google-common-protos/src/main/java/com/google/geo/type/ViewportProto.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,13 +14,26 @@ * limitations under the License. */ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: google/geo/type/viewport.proto +// Protobuf Java Version: 4.33.2 package com.google.geo.type; -public final class ViewportProto { +@com.google.protobuf.Generated +public final class ViewportProto extends com.google.protobuf.GeneratedFile { private ViewportProto() {} + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "ViewportProto"); + } + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistryLite registry) {} public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry registry) { @@ -29,7 +42,7 @@ public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry r static final com.google.protobuf.Descriptors.Descriptor internal_static_google_geo_type_Viewport_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable internal_static_google_geo_type_Viewport_fieldAccessorTable; public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { @@ -54,13 +67,14 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { new com.google.protobuf.Descriptors.FileDescriptor[] { com.google.type.LatLngProto.getDescriptor(), }); - internal_static_google_geo_type_Viewport_descriptor = getDescriptor().getMessageTypes().get(0); + internal_static_google_geo_type_Viewport_descriptor = getDescriptor().getMessageType(0); internal_static_google_geo_type_Viewport_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_google_geo_type_Viewport_descriptor, new java.lang.String[] { "Low", "High", }); + descriptor.resolveAllFeaturesImmutable(); com.google.type.LatLngProto.getDescriptor(); } diff --git a/java-common-protos/proto-google-common-protos/src/main/java/com/google/logging/type/HttpRequest.java b/java-common-protos/proto-google-common-protos/src/main/java/com/google/logging/type/HttpRequest.java index 210ae36d52..c61b95ad0f 100644 --- a/java-common-protos/proto-google-common-protos/src/main/java/com/google/logging/type/HttpRequest.java +++ b/java-common-protos/proto-google-common-protos/src/main/java/com/google/logging/type/HttpRequest.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,9 @@ * limitations under the License. */ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: google/logging/type/http_request.proto +// Protobuf Java Version: 4.33.2 package com.google.logging.type; @@ -29,13 +31,25 @@ * * Protobuf type {@code google.logging.type.HttpRequest} */ -public final class HttpRequest extends com.google.protobuf.GeneratedMessageV3 +@com.google.protobuf.Generated +public final class HttpRequest extends com.google.protobuf.GeneratedMessage implements // @@protoc_insertion_point(message_implements:google.logging.type.HttpRequest) HttpRequestOrBuilder { private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "HttpRequest"); + } + // Use HttpRequest.newBuilder() to construct. - private HttpRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + private HttpRequest(com.google.protobuf.GeneratedMessage.Builder builder) { super(builder); } @@ -49,24 +63,13 @@ private HttpRequest() { protocol_ = ""; } - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new HttpRequest(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.logging.type.HttpRequestProto .internal_static_google_logging_type_HttpRequest_descriptor; } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.logging.type.HttpRequestProto .internal_static_google_logging_type_HttpRequest_fieldAccessorTable @@ -75,8 +78,12 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { com.google.logging.type.HttpRequest.Builder.class); } + private int bitField0_; public static final int REQUEST_METHOD_FIELD_NUMBER = 1; - private volatile java.lang.Object requestMethod_; + + @SuppressWarnings("serial") + private volatile java.lang.Object requestMethod_ = ""; + /** * * @@ -100,6 +107,7 @@ public java.lang.String getRequestMethod() { return s; } } + /** * * @@ -125,7 +133,10 @@ public com.google.protobuf.ByteString getRequestMethodBytes() { } public static final int REQUEST_URL_FIELD_NUMBER = 2; - private volatile java.lang.Object requestUrl_; + + @SuppressWarnings("serial") + private volatile java.lang.Object requestUrl_ = ""; + /** * * @@ -151,6 +162,7 @@ public java.lang.String getRequestUrl() { return s; } } + /** * * @@ -178,7 +190,8 @@ public com.google.protobuf.ByteString getRequestUrlBytes() { } public static final int REQUEST_SIZE_FIELD_NUMBER = 3; - private long requestSize_; + private long requestSize_ = 0L; + /** * * @@ -197,7 +210,8 @@ public long getRequestSize() { } public static final int STATUS_FIELD_NUMBER = 4; - private int status_; + private int status_ = 0; + /** * * @@ -216,7 +230,8 @@ public int getStatus() { } public static final int RESPONSE_SIZE_FIELD_NUMBER = 5; - private long responseSize_; + private long responseSize_ = 0L; + /** * * @@ -235,7 +250,10 @@ public long getResponseSize() { } public static final int USER_AGENT_FIELD_NUMBER = 6; - private volatile java.lang.Object userAgent_; + + @SuppressWarnings("serial") + private volatile java.lang.Object userAgent_ = ""; + /** * * @@ -261,6 +279,7 @@ public java.lang.String getUserAgent() { return s; } } + /** * * @@ -288,7 +307,10 @@ public com.google.protobuf.ByteString getUserAgentBytes() { } public static final int REMOTE_IP_FIELD_NUMBER = 7; - private volatile java.lang.Object remoteIp_; + + @SuppressWarnings("serial") + private volatile java.lang.Object remoteIp_ = ""; + /** * * @@ -314,6 +336,7 @@ public java.lang.String getRemoteIp() { return s; } } + /** * * @@ -341,7 +364,10 @@ public com.google.protobuf.ByteString getRemoteIpBytes() { } public static final int SERVER_IP_FIELD_NUMBER = 13; - private volatile java.lang.Object serverIp_; + + @SuppressWarnings("serial") + private volatile java.lang.Object serverIp_ = ""; + /** * * @@ -367,6 +393,7 @@ public java.lang.String getServerIp() { return s; } } + /** * * @@ -394,14 +421,17 @@ public com.google.protobuf.ByteString getServerIpBytes() { } public static final int REFERER_FIELD_NUMBER = 8; - private volatile java.lang.Object referer_; + + @SuppressWarnings("serial") + private volatile java.lang.Object referer_ = ""; + /** * * *
            * The referer URL of the request, as defined in
            * [HTTP/1.1 Header Field
        -   * Definitions](http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html).
        +   * Definitions](https://datatracker.ietf.org/doc/html/rfc2616#section-14.36).
            * 
        * * string referer = 8; @@ -420,13 +450,14 @@ public java.lang.String getReferer() { return s; } } + /** * * *
            * The referer URL of the request, as defined in
            * [HTTP/1.1 Header Field
        -   * Definitions](http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html).
        +   * Definitions](https://datatracker.ietf.org/doc/html/rfc2616#section-14.36).
            * 
        * * string referer = 8; @@ -448,6 +479,7 @@ public com.google.protobuf.ByteString getRefererBytes() { public static final int LATENCY_FIELD_NUMBER = 14; private com.google.protobuf.Duration latency_; + /** * * @@ -462,8 +494,9 @@ public com.google.protobuf.ByteString getRefererBytes() { */ @java.lang.Override public boolean hasLatency() { - return latency_ != null; + return ((bitField0_ & 0x00000001) != 0); } + /** * * @@ -480,6 +513,7 @@ public boolean hasLatency() { public com.google.protobuf.Duration getLatency() { return latency_ == null ? com.google.protobuf.Duration.getDefaultInstance() : latency_; } + /** * * @@ -492,11 +526,12 @@ public com.google.protobuf.Duration getLatency() { */ @java.lang.Override public com.google.protobuf.DurationOrBuilder getLatencyOrBuilder() { - return getLatency(); + return latency_ == null ? com.google.protobuf.Duration.getDefaultInstance() : latency_; } public static final int CACHE_LOOKUP_FIELD_NUMBER = 11; - private boolean cacheLookup_; + private boolean cacheLookup_ = false; + /** * * @@ -514,7 +549,8 @@ public boolean getCacheLookup() { } public static final int CACHE_HIT_FIELD_NUMBER = 9; - private boolean cacheHit_; + private boolean cacheHit_ = false; + /** * * @@ -533,7 +569,8 @@ public boolean getCacheHit() { } public static final int CACHE_VALIDATED_WITH_ORIGIN_SERVER_FIELD_NUMBER = 10; - private boolean cacheValidatedWithOriginServer_; + private boolean cacheValidatedWithOriginServer_ = false; + /** * * @@ -553,7 +590,8 @@ public boolean getCacheValidatedWithOriginServer() { } public static final int CACHE_FILL_BYTES_FIELD_NUMBER = 12; - private long cacheFillBytes_; + private long cacheFillBytes_ = 0L; + /** * * @@ -572,7 +610,10 @@ public long getCacheFillBytes() { } public static final int PROTOCOL_FIELD_NUMBER = 15; - private volatile java.lang.Object protocol_; + + @SuppressWarnings("serial") + private volatile java.lang.Object protocol_ = ""; + /** * * @@ -596,6 +637,7 @@ public java.lang.String getProtocol() { return s; } } + /** * * @@ -634,11 +676,11 @@ public final boolean isInitialized() { @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(requestMethod_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, requestMethod_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(requestMethod_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, requestMethod_); } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(requestUrl_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 2, requestUrl_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(requestUrl_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, requestUrl_); } if (requestSize_ != 0L) { output.writeInt64(3, requestSize_); @@ -649,14 +691,14 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (responseSize_ != 0L) { output.writeInt64(5, responseSize_); } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(userAgent_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 6, userAgent_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(userAgent_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 6, userAgent_); } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(remoteIp_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 7, remoteIp_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(remoteIp_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 7, remoteIp_); } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(referer_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 8, referer_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(referer_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 8, referer_); } if (cacheHit_ != false) { output.writeBool(9, cacheHit_); @@ -670,14 +712,14 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (cacheFillBytes_ != 0L) { output.writeInt64(12, cacheFillBytes_); } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(serverIp_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 13, serverIp_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(serverIp_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 13, serverIp_); } - if (latency_ != null) { + if (((bitField0_ & 0x00000001) != 0)) { output.writeMessage(14, getLatency()); } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(protocol_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 15, protocol_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(protocol_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 15, protocol_); } getUnknownFields().writeTo(output); } @@ -688,11 +730,11 @@ public int getSerializedSize() { if (size != -1) return size; size = 0; - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(requestMethod_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, requestMethod_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(requestMethod_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, requestMethod_); } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(requestUrl_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, requestUrl_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(requestUrl_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, requestUrl_); } if (requestSize_ != 0L) { size += com.google.protobuf.CodedOutputStream.computeInt64Size(3, requestSize_); @@ -703,14 +745,14 @@ public int getSerializedSize() { if (responseSize_ != 0L) { size += com.google.protobuf.CodedOutputStream.computeInt64Size(5, responseSize_); } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(userAgent_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(6, userAgent_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(userAgent_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(6, userAgent_); } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(remoteIp_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(7, remoteIp_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(remoteIp_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(7, remoteIp_); } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(referer_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(8, referer_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(referer_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(8, referer_); } if (cacheHit_ != false) { size += com.google.protobuf.CodedOutputStream.computeBoolSize(9, cacheHit_); @@ -726,14 +768,14 @@ public int getSerializedSize() { if (cacheFillBytes_ != 0L) { size += com.google.protobuf.CodedOutputStream.computeInt64Size(12, cacheFillBytes_); } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(serverIp_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(13, serverIp_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(serverIp_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(13, serverIp_); } - if (latency_ != null) { + if (((bitField0_ & 0x00000001) != 0)) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(14, getLatency()); } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(protocol_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(15, protocol_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(protocol_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(15, protocol_); } size += getUnknownFields().getSerializedSize(); memoizedSize = size; @@ -854,38 +896,38 @@ public static com.google.logging.type.HttpRequest parseFrom( public static com.google.logging.type.HttpRequest parseFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); } public static com.google.logging.type.HttpRequest parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } public static com.google.logging.type.HttpRequest parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); } public static com.google.logging.type.HttpRequest parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( PARSER, input, extensionRegistry); } public static com.google.logging.type.HttpRequest parseFrom( com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); } public static com.google.logging.type.HttpRequest parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } @@ -908,10 +950,11 @@ public Builder toBuilder() { } @java.lang.Override - protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { Builder builder = new Builder(parent); return builder; } + /** * * @@ -923,7 +966,7 @@ protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.Build * * Protobuf type {@code google.logging.type.HttpRequest} */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder implements // @@protoc_insertion_point(builder_implements:google.logging.type.HttpRequest) com.google.logging.type.HttpRequestOrBuilder { @@ -933,7 +976,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.logging.type.HttpRequestProto .internal_static_google_logging_type_HttpRequest_fieldAccessorTable @@ -943,49 +986,44 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } // Construct using com.google.logging.type.HttpRequest.newBuilder() - private Builder() {} + private Builder() { + maybeForceBuilderInitialization(); + } - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetLatencyFieldBuilder(); + } } @java.lang.Override public Builder clear() { super.clear(); + bitField0_ = 0; requestMethod_ = ""; - requestUrl_ = ""; - requestSize_ = 0L; - status_ = 0; - responseSize_ = 0L; - userAgent_ = ""; - remoteIp_ = ""; - serverIp_ = ""; - referer_ = ""; - - if (latencyBuilder_ == null) { - latency_ = null; - } else { - latency_ = null; + latency_ = null; + if (latencyBuilder_ != null) { + latencyBuilder_.dispose(); latencyBuilder_ = null; } cacheLookup_ = false; - cacheHit_ = false; - cacheValidatedWithOriginServer_ = false; - cacheFillBytes_ = 0L; - protocol_ = ""; - return this; } @@ -1012,60 +1050,63 @@ public com.google.logging.type.HttpRequest build() { @java.lang.Override public com.google.logging.type.HttpRequest buildPartial() { com.google.logging.type.HttpRequest result = new com.google.logging.type.HttpRequest(this); - result.requestMethod_ = requestMethod_; - result.requestUrl_ = requestUrl_; - result.requestSize_ = requestSize_; - result.status_ = status_; - result.responseSize_ = responseSize_; - result.userAgent_ = userAgent_; - result.remoteIp_ = remoteIp_; - result.serverIp_ = serverIp_; - result.referer_ = referer_; - if (latencyBuilder_ == null) { - result.latency_ = latency_; - } else { - result.latency_ = latencyBuilder_.build(); + if (bitField0_ != 0) { + buildPartial0(result); } - result.cacheLookup_ = cacheLookup_; - result.cacheHit_ = cacheHit_; - result.cacheValidatedWithOriginServer_ = cacheValidatedWithOriginServer_; - result.cacheFillBytes_ = cacheFillBytes_; - result.protocol_ = protocol_; onBuilt(); return result; } - @java.lang.Override - public Builder clone() { - return super.clone(); - } - - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.setField(field, value); - } - - @java.lang.Override - public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - - @java.lang.Override - public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.addRepeatedField(field, value); + private void buildPartial0(com.google.logging.type.HttpRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.requestMethod_ = requestMethod_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.requestUrl_ = requestUrl_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.requestSize_ = requestSize_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.status_ = status_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.responseSize_ = responseSize_; + } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.userAgent_ = userAgent_; + } + if (((from_bitField0_ & 0x00000040) != 0)) { + result.remoteIp_ = remoteIp_; + } + if (((from_bitField0_ & 0x00000080) != 0)) { + result.serverIp_ = serverIp_; + } + if (((from_bitField0_ & 0x00000100) != 0)) { + result.referer_ = referer_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000200) != 0)) { + result.latency_ = latencyBuilder_ == null ? latency_ : latencyBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000400) != 0)) { + result.cacheLookup_ = cacheLookup_; + } + if (((from_bitField0_ & 0x00000800) != 0)) { + result.cacheHit_ = cacheHit_; + } + if (((from_bitField0_ & 0x00001000) != 0)) { + result.cacheValidatedWithOriginServer_ = cacheValidatedWithOriginServer_; + } + if (((from_bitField0_ & 0x00002000) != 0)) { + result.cacheFillBytes_ = cacheFillBytes_; + } + if (((from_bitField0_ & 0x00004000) != 0)) { + result.protocol_ = protocol_; + } + result.bitField0_ |= to_bitField0_; } @java.lang.Override @@ -1082,10 +1123,12 @@ public Builder mergeFrom(com.google.logging.type.HttpRequest other) { if (other == com.google.logging.type.HttpRequest.getDefaultInstance()) return this; if (!other.getRequestMethod().isEmpty()) { requestMethod_ = other.requestMethod_; + bitField0_ |= 0x00000001; onChanged(); } if (!other.getRequestUrl().isEmpty()) { requestUrl_ = other.requestUrl_; + bitField0_ |= 0x00000002; onChanged(); } if (other.getRequestSize() != 0L) { @@ -1099,18 +1142,22 @@ public Builder mergeFrom(com.google.logging.type.HttpRequest other) { } if (!other.getUserAgent().isEmpty()) { userAgent_ = other.userAgent_; + bitField0_ |= 0x00000020; onChanged(); } if (!other.getRemoteIp().isEmpty()) { remoteIp_ = other.remoteIp_; + bitField0_ |= 0x00000040; onChanged(); } if (!other.getServerIp().isEmpty()) { serverIp_ = other.serverIp_; + bitField0_ |= 0x00000080; onChanged(); } if (!other.getReferer().isEmpty()) { referer_ = other.referer_; + bitField0_ |= 0x00000100; onChanged(); } if (other.hasLatency()) { @@ -1130,6 +1177,7 @@ public Builder mergeFrom(com.google.logging.type.HttpRequest other) { } if (!other.getProtocol().isEmpty()) { protocol_ = other.protocol_; + bitField0_ |= 0x00004000; onChanged(); } this.mergeUnknownFields(other.getUnknownFields()); @@ -1161,91 +1209,91 @@ public Builder mergeFrom( case 10: { requestMethod_ = input.readStringRequireUtf8(); - + bitField0_ |= 0x00000001; break; } // case 10 case 18: { requestUrl_ = input.readStringRequireUtf8(); - + bitField0_ |= 0x00000002; break; } // case 18 case 24: { requestSize_ = input.readInt64(); - + bitField0_ |= 0x00000004; break; } // case 24 case 32: { status_ = input.readInt32(); - + bitField0_ |= 0x00000008; break; } // case 32 case 40: { responseSize_ = input.readInt64(); - + bitField0_ |= 0x00000010; break; } // case 40 case 50: { userAgent_ = input.readStringRequireUtf8(); - + bitField0_ |= 0x00000020; break; } // case 50 case 58: { remoteIp_ = input.readStringRequireUtf8(); - + bitField0_ |= 0x00000040; break; } // case 58 case 66: { referer_ = input.readStringRequireUtf8(); - + bitField0_ |= 0x00000100; break; } // case 66 case 72: { cacheHit_ = input.readBool(); - + bitField0_ |= 0x00000800; break; } // case 72 case 80: { cacheValidatedWithOriginServer_ = input.readBool(); - + bitField0_ |= 0x00001000; break; } // case 80 case 88: { cacheLookup_ = input.readBool(); - + bitField0_ |= 0x00000400; break; } // case 88 case 96: { cacheFillBytes_ = input.readInt64(); - + bitField0_ |= 0x00002000; break; } // case 96 case 106: { serverIp_ = input.readStringRequireUtf8(); - + bitField0_ |= 0x00000080; break; } // case 106 case 114: { - input.readMessage(getLatencyFieldBuilder().getBuilder(), extensionRegistry); - + input.readMessage(internalGetLatencyFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000200; break; } // case 114 case 122: { protocol_ = input.readStringRequireUtf8(); - + bitField0_ |= 0x00004000; break; } // case 122 default: @@ -1265,7 +1313,10 @@ public Builder mergeFrom( return this; } + private int bitField0_; + private java.lang.Object requestMethod_ = ""; + /** * * @@ -1288,6 +1339,7 @@ public java.lang.String getRequestMethod() { return (java.lang.String) ref; } } + /** * * @@ -1310,6 +1362,7 @@ public com.google.protobuf.ByteString getRequestMethodBytes() { return (com.google.protobuf.ByteString) ref; } } + /** * * @@ -1326,11 +1379,12 @@ public Builder setRequestMethod(java.lang.String value) { if (value == null) { throw new NullPointerException(); } - requestMethod_ = value; + bitField0_ |= 0x00000001; onChanged(); return this; } + /** * * @@ -1343,11 +1397,12 @@ public Builder setRequestMethod(java.lang.String value) { * @return This builder for chaining. */ public Builder clearRequestMethod() { - requestMethod_ = getDefaultInstance().getRequestMethod(); + bitField0_ = (bitField0_ & ~0x00000001); onChanged(); return this; } + /** * * @@ -1365,13 +1420,14 @@ public Builder setRequestMethodBytes(com.google.protobuf.ByteString value) { throw new NullPointerException(); } checkByteStringIsUtf8(value); - requestMethod_ = value; + bitField0_ |= 0x00000001; onChanged(); return this; } private java.lang.Object requestUrl_ = ""; + /** * * @@ -1396,6 +1452,7 @@ public java.lang.String getRequestUrl() { return (java.lang.String) ref; } } + /** * * @@ -1420,6 +1477,7 @@ public com.google.protobuf.ByteString getRequestUrlBytes() { return (com.google.protobuf.ByteString) ref; } } + /** * * @@ -1438,11 +1496,12 @@ public Builder setRequestUrl(java.lang.String value) { if (value == null) { throw new NullPointerException(); } - requestUrl_ = value; + bitField0_ |= 0x00000002; onChanged(); return this; } + /** * * @@ -1457,11 +1516,12 @@ public Builder setRequestUrl(java.lang.String value) { * @return This builder for chaining. */ public Builder clearRequestUrl() { - requestUrl_ = getDefaultInstance().getRequestUrl(); + bitField0_ = (bitField0_ & ~0x00000002); onChanged(); return this; } + /** * * @@ -1481,13 +1541,14 @@ public Builder setRequestUrlBytes(com.google.protobuf.ByteString value) { throw new NullPointerException(); } checkByteStringIsUtf8(value); - requestUrl_ = value; + bitField0_ |= 0x00000002; onChanged(); return this; } private long requestSize_; + /** * * @@ -1504,6 +1565,7 @@ public Builder setRequestUrlBytes(com.google.protobuf.ByteString value) { public long getRequestSize() { return requestSize_; } + /** * * @@ -1520,9 +1582,11 @@ public long getRequestSize() { public Builder setRequestSize(long value) { requestSize_ = value; + bitField0_ |= 0x00000004; onChanged(); return this; } + /** * * @@ -1536,13 +1600,14 @@ public Builder setRequestSize(long value) { * @return This builder for chaining. */ public Builder clearRequestSize() { - + bitField0_ = (bitField0_ & ~0x00000004); requestSize_ = 0L; onChanged(); return this; } private int status_; + /** * * @@ -1559,6 +1624,7 @@ public Builder clearRequestSize() { public int getStatus() { return status_; } + /** * * @@ -1575,9 +1641,11 @@ public int getStatus() { public Builder setStatus(int value) { status_ = value; + bitField0_ |= 0x00000008; onChanged(); return this; } + /** * * @@ -1591,13 +1659,14 @@ public Builder setStatus(int value) { * @return This builder for chaining. */ public Builder clearStatus() { - + bitField0_ = (bitField0_ & ~0x00000008); status_ = 0; onChanged(); return this; } private long responseSize_; + /** * * @@ -1614,6 +1683,7 @@ public Builder clearStatus() { public long getResponseSize() { return responseSize_; } + /** * * @@ -1630,9 +1700,11 @@ public long getResponseSize() { public Builder setResponseSize(long value) { responseSize_ = value; + bitField0_ |= 0x00000010; onChanged(); return this; } + /** * * @@ -1646,13 +1718,14 @@ public Builder setResponseSize(long value) { * @return This builder for chaining. */ public Builder clearResponseSize() { - + bitField0_ = (bitField0_ & ~0x00000010); responseSize_ = 0L; onChanged(); return this; } private java.lang.Object userAgent_ = ""; + /** * * @@ -1677,6 +1750,7 @@ public java.lang.String getUserAgent() { return (java.lang.String) ref; } } + /** * * @@ -1701,6 +1775,7 @@ public com.google.protobuf.ByteString getUserAgentBytes() { return (com.google.protobuf.ByteString) ref; } } + /** * * @@ -1719,11 +1794,12 @@ public Builder setUserAgent(java.lang.String value) { if (value == null) { throw new NullPointerException(); } - userAgent_ = value; + bitField0_ |= 0x00000020; onChanged(); return this; } + /** * * @@ -1738,11 +1814,12 @@ public Builder setUserAgent(java.lang.String value) { * @return This builder for chaining. */ public Builder clearUserAgent() { - userAgent_ = getDefaultInstance().getUserAgent(); + bitField0_ = (bitField0_ & ~0x00000020); onChanged(); return this; } + /** * * @@ -1762,13 +1839,14 @@ public Builder setUserAgentBytes(com.google.protobuf.ByteString value) { throw new NullPointerException(); } checkByteStringIsUtf8(value); - userAgent_ = value; + bitField0_ |= 0x00000020; onChanged(); return this; } private java.lang.Object remoteIp_ = ""; + /** * * @@ -1793,6 +1871,7 @@ public java.lang.String getRemoteIp() { return (java.lang.String) ref; } } + /** * * @@ -1817,6 +1896,7 @@ public com.google.protobuf.ByteString getRemoteIpBytes() { return (com.google.protobuf.ByteString) ref; } } + /** * * @@ -1835,11 +1915,12 @@ public Builder setRemoteIp(java.lang.String value) { if (value == null) { throw new NullPointerException(); } - remoteIp_ = value; + bitField0_ |= 0x00000040; onChanged(); return this; } + /** * * @@ -1854,11 +1935,12 @@ public Builder setRemoteIp(java.lang.String value) { * @return This builder for chaining. */ public Builder clearRemoteIp() { - remoteIp_ = getDefaultInstance().getRemoteIp(); + bitField0_ = (bitField0_ & ~0x00000040); onChanged(); return this; } + /** * * @@ -1878,13 +1960,14 @@ public Builder setRemoteIpBytes(com.google.protobuf.ByteString value) { throw new NullPointerException(); } checkByteStringIsUtf8(value); - remoteIp_ = value; + bitField0_ |= 0x00000040; onChanged(); return this; } private java.lang.Object serverIp_ = ""; + /** * * @@ -1909,6 +1992,7 @@ public java.lang.String getServerIp() { return (java.lang.String) ref; } } + /** * * @@ -1933,6 +2017,7 @@ public com.google.protobuf.ByteString getServerIpBytes() { return (com.google.protobuf.ByteString) ref; } } + /** * * @@ -1951,11 +2036,12 @@ public Builder setServerIp(java.lang.String value) { if (value == null) { throw new NullPointerException(); } - serverIp_ = value; + bitField0_ |= 0x00000080; onChanged(); return this; } + /** * * @@ -1970,11 +2056,12 @@ public Builder setServerIp(java.lang.String value) { * @return This builder for chaining. */ public Builder clearServerIp() { - serverIp_ = getDefaultInstance().getServerIp(); + bitField0_ = (bitField0_ & ~0x00000080); onChanged(); return this; } + /** * * @@ -1994,20 +2081,21 @@ public Builder setServerIpBytes(com.google.protobuf.ByteString value) { throw new NullPointerException(); } checkByteStringIsUtf8(value); - serverIp_ = value; + bitField0_ |= 0x00000080; onChanged(); return this; } private java.lang.Object referer_ = ""; + /** * * *
              * The referer URL of the request, as defined in
              * [HTTP/1.1 Header Field
        -     * Definitions](http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html).
        +     * Definitions](https://datatracker.ietf.org/doc/html/rfc2616#section-14.36).
              * 
        * * string referer = 8; @@ -2025,13 +2113,14 @@ public java.lang.String getReferer() { return (java.lang.String) ref; } } + /** * * *
              * The referer URL of the request, as defined in
              * [HTTP/1.1 Header Field
        -     * Definitions](http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html).
        +     * Definitions](https://datatracker.ietf.org/doc/html/rfc2616#section-14.36).
              * 
        * * string referer = 8; @@ -2049,13 +2138,14 @@ public com.google.protobuf.ByteString getRefererBytes() { return (com.google.protobuf.ByteString) ref; } } + /** * * *
              * The referer URL of the request, as defined in
              * [HTTP/1.1 Header Field
        -     * Definitions](http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html).
        +     * Definitions](https://datatracker.ietf.org/doc/html/rfc2616#section-14.36).
              * 
        * * string referer = 8; @@ -2067,18 +2157,19 @@ public Builder setReferer(java.lang.String value) { if (value == null) { throw new NullPointerException(); } - referer_ = value; + bitField0_ |= 0x00000100; onChanged(); return this; } + /** * * *
              * The referer URL of the request, as defined in
              * [HTTP/1.1 Header Field
        -     * Definitions](http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html).
        +     * Definitions](https://datatracker.ietf.org/doc/html/rfc2616#section-14.36).
              * 
        * * string referer = 8; @@ -2086,18 +2177,19 @@ public Builder setReferer(java.lang.String value) { * @return This builder for chaining. */ public Builder clearReferer() { - referer_ = getDefaultInstance().getReferer(); + bitField0_ = (bitField0_ & ~0x00000100); onChanged(); return this; } + /** * * *
              * The referer URL of the request, as defined in
              * [HTTP/1.1 Header Field
        -     * Definitions](http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html).
        +     * Definitions](https://datatracker.ietf.org/doc/html/rfc2616#section-14.36).
              * 
        * * string referer = 8; @@ -2110,18 +2202,19 @@ public Builder setRefererBytes(com.google.protobuf.ByteString value) { throw new NullPointerException(); } checkByteStringIsUtf8(value); - referer_ = value; + bitField0_ |= 0x00000100; onChanged(); return this; } private com.google.protobuf.Duration latency_; - private com.google.protobuf.SingleFieldBuilderV3< + private com.google.protobuf.SingleFieldBuilder< com.google.protobuf.Duration, com.google.protobuf.Duration.Builder, com.google.protobuf.DurationOrBuilder> latencyBuilder_; + /** * * @@ -2135,8 +2228,9 @@ public Builder setRefererBytes(com.google.protobuf.ByteString value) { * @return Whether the latency field is set. */ public boolean hasLatency() { - return latencyBuilder_ != null || latency_ != null; + return ((bitField0_ & 0x00000200) != 0); } + /** * * @@ -2156,6 +2250,7 @@ public com.google.protobuf.Duration getLatency() { return latencyBuilder_.getMessage(); } } + /** * * @@ -2172,13 +2267,14 @@ public Builder setLatency(com.google.protobuf.Duration value) { throw new NullPointerException(); } latency_ = value; - onChanged(); } else { latencyBuilder_.setMessage(value); } - + bitField0_ |= 0x00000200; + onChanged(); return this; } + /** * * @@ -2192,13 +2288,14 @@ public Builder setLatency(com.google.protobuf.Duration value) { public Builder setLatency(com.google.protobuf.Duration.Builder builderForValue) { if (latencyBuilder_ == null) { latency_ = builderForValue.build(); - onChanged(); } else { latencyBuilder_.setMessage(builderForValue.build()); } - + bitField0_ |= 0x00000200; + onChanged(); return this; } + /** * * @@ -2211,19 +2308,23 @@ public Builder setLatency(com.google.protobuf.Duration.Builder builderForValue) */ public Builder mergeLatency(com.google.protobuf.Duration value) { if (latencyBuilder_ == null) { - if (latency_ != null) { - latency_ = - com.google.protobuf.Duration.newBuilder(latency_).mergeFrom(value).buildPartial(); + if (((bitField0_ & 0x00000200) != 0) + && latency_ != null + && latency_ != com.google.protobuf.Duration.getDefaultInstance()) { + getLatencyBuilder().mergeFrom(value); } else { latency_ = value; } - onChanged(); } else { latencyBuilder_.mergeFrom(value); } - + if (latency_ != null) { + bitField0_ |= 0x00000200; + onChanged(); + } return this; } + /** * * @@ -2235,16 +2336,16 @@ public Builder mergeLatency(com.google.protobuf.Duration value) { * .google.protobuf.Duration latency = 14; */ public Builder clearLatency() { - if (latencyBuilder_ == null) { - latency_ = null; - onChanged(); - } else { - latency_ = null; + bitField0_ = (bitField0_ & ~0x00000200); + latency_ = null; + if (latencyBuilder_ != null) { + latencyBuilder_.dispose(); latencyBuilder_ = null; } - + onChanged(); return this; } + /** * * @@ -2256,10 +2357,11 @@ public Builder clearLatency() { * .google.protobuf.Duration latency = 14; */ public com.google.protobuf.Duration.Builder getLatencyBuilder() { - + bitField0_ |= 0x00000200; onChanged(); - return getLatencyFieldBuilder().getBuilder(); + return internalGetLatencyFieldBuilder().getBuilder(); } + /** * * @@ -2277,6 +2379,7 @@ public com.google.protobuf.DurationOrBuilder getLatencyOrBuilder() { return latency_ == null ? com.google.protobuf.Duration.getDefaultInstance() : latency_; } } + /** * * @@ -2287,14 +2390,14 @@ public com.google.protobuf.DurationOrBuilder getLatencyOrBuilder() { * * .google.protobuf.Duration latency = 14; */ - private com.google.protobuf.SingleFieldBuilderV3< + private com.google.protobuf.SingleFieldBuilder< com.google.protobuf.Duration, com.google.protobuf.Duration.Builder, com.google.protobuf.DurationOrBuilder> - getLatencyFieldBuilder() { + internalGetLatencyFieldBuilder() { if (latencyBuilder_ == null) { latencyBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< + new com.google.protobuf.SingleFieldBuilder< com.google.protobuf.Duration, com.google.protobuf.Duration.Builder, com.google.protobuf.DurationOrBuilder>( @@ -2305,6 +2408,7 @@ public com.google.protobuf.DurationOrBuilder getLatencyOrBuilder() { } private boolean cacheLookup_; + /** * * @@ -2320,6 +2424,7 @@ public com.google.protobuf.DurationOrBuilder getLatencyOrBuilder() { public boolean getCacheLookup() { return cacheLookup_; } + /** * * @@ -2335,9 +2440,11 @@ public boolean getCacheLookup() { public Builder setCacheLookup(boolean value) { cacheLookup_ = value; + bitField0_ |= 0x00000400; onChanged(); return this; } + /** * * @@ -2350,13 +2457,14 @@ public Builder setCacheLookup(boolean value) { * @return This builder for chaining. */ public Builder clearCacheLookup() { - + bitField0_ = (bitField0_ & ~0x00000400); cacheLookup_ = false; onChanged(); return this; } private boolean cacheHit_; + /** * * @@ -2373,6 +2481,7 @@ public Builder clearCacheLookup() { public boolean getCacheHit() { return cacheHit_; } + /** * * @@ -2389,9 +2498,11 @@ public boolean getCacheHit() { public Builder setCacheHit(boolean value) { cacheHit_ = value; + bitField0_ |= 0x00000800; onChanged(); return this; } + /** * * @@ -2405,13 +2516,14 @@ public Builder setCacheHit(boolean value) { * @return This builder for chaining. */ public Builder clearCacheHit() { - + bitField0_ = (bitField0_ & ~0x00000800); cacheHit_ = false; onChanged(); return this; } private boolean cacheValidatedWithOriginServer_; + /** * * @@ -2429,6 +2541,7 @@ public Builder clearCacheHit() { public boolean getCacheValidatedWithOriginServer() { return cacheValidatedWithOriginServer_; } + /** * * @@ -2446,9 +2559,11 @@ public boolean getCacheValidatedWithOriginServer() { public Builder setCacheValidatedWithOriginServer(boolean value) { cacheValidatedWithOriginServer_ = value; + bitField0_ |= 0x00001000; onChanged(); return this; } + /** * * @@ -2463,13 +2578,14 @@ public Builder setCacheValidatedWithOriginServer(boolean value) { * @return This builder for chaining. */ public Builder clearCacheValidatedWithOriginServer() { - + bitField0_ = (bitField0_ & ~0x00001000); cacheValidatedWithOriginServer_ = false; onChanged(); return this; } private long cacheFillBytes_; + /** * * @@ -2486,6 +2602,7 @@ public Builder clearCacheValidatedWithOriginServer() { public long getCacheFillBytes() { return cacheFillBytes_; } + /** * * @@ -2502,9 +2619,11 @@ public long getCacheFillBytes() { public Builder setCacheFillBytes(long value) { cacheFillBytes_ = value; + bitField0_ |= 0x00002000; onChanged(); return this; } + /** * * @@ -2518,13 +2637,14 @@ public Builder setCacheFillBytes(long value) { * @return This builder for chaining. */ public Builder clearCacheFillBytes() { - + bitField0_ = (bitField0_ & ~0x00002000); cacheFillBytes_ = 0L; onChanged(); return this; } private java.lang.Object protocol_ = ""; + /** * * @@ -2547,6 +2667,7 @@ public java.lang.String getProtocol() { return (java.lang.String) ref; } } + /** * * @@ -2569,6 +2690,7 @@ public com.google.protobuf.ByteString getProtocolBytes() { return (com.google.protobuf.ByteString) ref; } } + /** * * @@ -2585,11 +2707,12 @@ public Builder setProtocol(java.lang.String value) { if (value == null) { throw new NullPointerException(); } - protocol_ = value; + bitField0_ |= 0x00004000; onChanged(); return this; } + /** * * @@ -2602,11 +2725,12 @@ public Builder setProtocol(java.lang.String value) { * @return This builder for chaining. */ public Builder clearProtocol() { - protocol_ = getDefaultInstance().getProtocol(); + bitField0_ = (bitField0_ & ~0x00004000); onChanged(); return this; } + /** * * @@ -2624,23 +2748,12 @@ public Builder setProtocolBytes(com.google.protobuf.ByteString value) { throw new NullPointerException(); } checkByteStringIsUtf8(value); - protocol_ = value; + bitField0_ |= 0x00004000; 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.type.HttpRequest) } diff --git a/java-common-protos/proto-google-common-protos/src/main/java/com/google/logging/type/HttpRequestOrBuilder.java b/java-common-protos/proto-google-common-protos/src/main/java/com/google/logging/type/HttpRequestOrBuilder.java index 3cce91ad99..5c7ddf9777 100644 --- a/java-common-protos/proto-google-common-protos/src/main/java/com/google/logging/type/HttpRequestOrBuilder.java +++ b/java-common-protos/proto-google-common-protos/src/main/java/com/google/logging/type/HttpRequestOrBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,10 +14,13 @@ * limitations under the License. */ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: google/logging/type/http_request.proto +// Protobuf Java Version: 4.33.2 package com.google.logging.type; +@com.google.protobuf.Generated public interface HttpRequestOrBuilder extends // @@protoc_insertion_point(interface_extends:google.logging.type.HttpRequest) @@ -35,6 +38,7 @@ public interface HttpRequestOrBuilder * @return The requestMethod. */ java.lang.String getRequestMethod(); + /** * * @@ -62,6 +66,7 @@ public interface HttpRequestOrBuilder * @return The requestUrl. */ java.lang.String getRequestUrl(); + /** * * @@ -133,6 +138,7 @@ public interface HttpRequestOrBuilder * @return The userAgent. */ java.lang.String getUserAgent(); + /** * * @@ -162,6 +168,7 @@ public interface HttpRequestOrBuilder * @return The remoteIp. */ java.lang.String getRemoteIp(); + /** * * @@ -191,6 +198,7 @@ public interface HttpRequestOrBuilder * @return The serverIp. */ java.lang.String getServerIp(); + /** * * @@ -212,7 +220,7 @@ public interface HttpRequestOrBuilder *
            * The referer URL of the request, as defined in
            * [HTTP/1.1 Header Field
        -   * Definitions](http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html).
        +   * Definitions](https://datatracker.ietf.org/doc/html/rfc2616#section-14.36).
            * 
        * * string referer = 8; @@ -220,13 +228,14 @@ public interface HttpRequestOrBuilder * @return The referer. */ java.lang.String getReferer(); + /** * * *
            * The referer URL of the request, as defined in
            * [HTTP/1.1 Header Field
        -   * Definitions](http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html).
        +   * Definitions](https://datatracker.ietf.org/doc/html/rfc2616#section-14.36).
            * 
        * * string referer = 8; @@ -248,6 +257,7 @@ public interface HttpRequestOrBuilder * @return Whether the latency field is set. */ boolean hasLatency(); + /** * * @@ -261,6 +271,7 @@ public interface HttpRequestOrBuilder * @return The latency. */ com.google.protobuf.Duration getLatency(); + /** * * @@ -341,6 +352,7 @@ public interface HttpRequestOrBuilder * @return The protocol. */ java.lang.String getProtocol(); + /** * * diff --git a/java-common-protos/proto-google-common-protos/src/main/java/com/google/logging/type/HttpRequestProto.java b/java-common-protos/proto-google-common-protos/src/main/java/com/google/logging/type/HttpRequestProto.java index 39fdf74853..07b18ac1f7 100644 --- a/java-common-protos/proto-google-common-protos/src/main/java/com/google/logging/type/HttpRequestProto.java +++ b/java-common-protos/proto-google-common-protos/src/main/java/com/google/logging/type/HttpRequestProto.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,13 +14,26 @@ * limitations under the License. */ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: google/logging/type/http_request.proto +// Protobuf Java Version: 4.33.2 package com.google.logging.type; -public final class HttpRequestProto { +@com.google.protobuf.Generated +public final class HttpRequestProto extends com.google.protobuf.GeneratedFile { private HttpRequestProto() {} + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "HttpRequestProto"); + } + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistryLite registry) {} public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry registry) { @@ -29,7 +42,7 @@ public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry r static final com.google.protobuf.Descriptors.Descriptor internal_static_google_logging_type_HttpRequest_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable internal_static_google_logging_type_HttpRequest_fieldAccessorTable; public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { @@ -64,10 +77,9 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { new com.google.protobuf.Descriptors.FileDescriptor[] { com.google.protobuf.DurationProto.getDescriptor(), }); - internal_static_google_logging_type_HttpRequest_descriptor = - getDescriptor().getMessageTypes().get(0); + internal_static_google_logging_type_HttpRequest_descriptor = getDescriptor().getMessageType(0); internal_static_google_logging_type_HttpRequest_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_google_logging_type_HttpRequest_descriptor, new java.lang.String[] { "RequestMethod", @@ -86,6 +98,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "CacheFillBytes", "Protocol", }); + descriptor.resolveAllFeaturesImmutable(); com.google.protobuf.DurationProto.getDescriptor(); } diff --git a/java-common-protos/proto-google-common-protos/src/main/java/com/google/logging/type/LogSeverity.java b/java-common-protos/proto-google-common-protos/src/main/java/com/google/logging/type/LogSeverity.java index 4ec7bfe118..65625611fd 100644 --- a/java-common-protos/proto-google-common-protos/src/main/java/com/google/logging/type/LogSeverity.java +++ b/java-common-protos/proto-google-common-protos/src/main/java/com/google/logging/type/LogSeverity.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,9 @@ * limitations under the License. */ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: google/logging/type/log_severity.proto +// Protobuf Java Version: 4.33.2 package com.google.logging.type; @@ -26,10 +28,13 @@ * standard severity levels listed below. For your reference, the levels are * assigned the listed numeric values. The effect of using numeric values other * than those listed is undefined. + * * You can filter for log entries by severity. For example, the following * filter expression will match log entries with severities `INFO`, `NOTICE`, * and `WARNING`: - * severity > DEBUG AND severity <= WARNING + * + * severity > DEBUG AND severity <= WARNING + * * If you are writing log entries, you should map other severity encodings to * one of these standard levels. For example, you might map all of Java's FINE, * FINER, and FINEST levels to `LogSeverity.DEBUG`. You can preserve the @@ -38,6 +43,7 @@ * * Protobuf enum {@code google.logging.type.LogSeverity} */ +@com.google.protobuf.Generated public enum LogSeverity implements com.google.protobuf.ProtocolMessageEnum { /** * @@ -133,6 +139,16 @@ public enum LogSeverity implements com.google.protobuf.ProtocolMessageEnum { UNRECOGNIZED(-1), ; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "LogSeverity"); + } + /** * * @@ -143,6 +159,7 @@ public enum LogSeverity implements com.google.protobuf.ProtocolMessageEnum { * DEFAULT = 0; */ public static final int DEFAULT_VALUE = 0; + /** * * @@ -153,6 +170,7 @@ public enum LogSeverity implements com.google.protobuf.ProtocolMessageEnum { * DEBUG = 100; */ public static final int DEBUG_VALUE = 100; + /** * * @@ -163,6 +181,7 @@ public enum LogSeverity implements com.google.protobuf.ProtocolMessageEnum { * INFO = 200; */ public static final int INFO_VALUE = 200; + /** * * @@ -174,6 +193,7 @@ public enum LogSeverity implements com.google.protobuf.ProtocolMessageEnum { * NOTICE = 300; */ public static final int NOTICE_VALUE = 300; + /** * * @@ -184,6 +204,7 @@ public enum LogSeverity implements com.google.protobuf.ProtocolMessageEnum { * WARNING = 400; */ public static final int WARNING_VALUE = 400; + /** * * @@ -194,6 +215,7 @@ public enum LogSeverity implements com.google.protobuf.ProtocolMessageEnum { * ERROR = 500; */ public static final int ERROR_VALUE = 500; + /** * * @@ -204,6 +226,7 @@ public enum LogSeverity implements com.google.protobuf.ProtocolMessageEnum { * CRITICAL = 600; */ public static final int CRITICAL_VALUE = 600; + /** * * @@ -214,6 +237,7 @@ public enum LogSeverity implements com.google.protobuf.ProtocolMessageEnum { * ALERT = 700; */ public static final int ALERT_VALUE = 700; + /** * * @@ -295,7 +319,7 @@ public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType return getDescriptor(); } - public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + public static com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { return com.google.logging.type.LogSeverityProto.getDescriptor().getEnumTypes().get(0); } diff --git a/java-common-protos/proto-google-common-protos/src/main/java/com/google/logging/type/LogSeverityProto.java b/java-common-protos/proto-google-common-protos/src/main/java/com/google/logging/type/LogSeverityProto.java index 3f205fc516..708d6c6c08 100644 --- a/java-common-protos/proto-google-common-protos/src/main/java/com/google/logging/type/LogSeverityProto.java +++ b/java-common-protos/proto-google-common-protos/src/main/java/com/google/logging/type/LogSeverityProto.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,13 +14,26 @@ * limitations under the License. */ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: google/logging/type/log_severity.proto +// Protobuf Java Version: 4.33.2 package com.google.logging.type; -public final class LogSeverityProto { +@com.google.protobuf.Generated +public final class LogSeverityProto extends com.google.protobuf.GeneratedFile { private LogSeverityProto() {} + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "LogSeverityProto"); + } + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistryLite registry) {} public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry registry) { @@ -35,21 +48,28 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { static { java.lang.String[] descriptorData = { - "\n&google/logging/type/log_severity.proto" - + "\022\023google.logging.type*\202\001\n\013LogSeverity\022\013\n" - + "\007DEFAULT\020\000\022\t\n\005DEBUG\020d\022\t\n\004INFO\020\310\001\022\013\n\006NOTI" - + "CE\020\254\002\022\014\n\007WARNING\020\220\003\022\n\n\005ERROR\020\364\003\022\r\n\010CRITI" - + "CAL\020\330\004\022\n\n\005ALERT\020\274\005\022\016\n\tEMERGENCY\020\240\006B\305\001\n\027c" - + "om.google.logging.typeB\020LogSeverityProto" + "\n" + + "&google/logging/type/log_severity.proto\022\023google.logging.type*\202\001\n" + + "\013LogSeverity\022\013\n" + + "\007DEFAULT\020\000\022\t\n" + + "\005DEBUG\020d\022\t\n" + + "\004INFO\020\310\001\022\013\n" + + "\006NOTICE\020\254\002\022\014\n" + + "\007WARNING\020\220\003\022\n\n" + + "\005ERROR\020\364\003\022\r\n" + + "\010CRITICAL\020\330\004\022\n\n" + + "\005ALERT\020\274\005\022\016\n" + + "\tEMERGENCY\020\240\006B\305\001\n" + + "\027com.google.logging.typeB\020LogSeverityProto" + "P\001Z8google.golang.org/genproto/googleapi" + "s/logging/type;ltype\242\002\004GLOG\252\002\031Google.Clo" + "ud.Logging.Type\312\002\031Google\\Cloud\\Logging\\T" - + "ype\352\002\034Google::Cloud::Logging::Typeb\006prot" - + "o3" + + "ype\352\002\034Google::Cloud::Logging::Typeb\006proto3" }; descriptor = com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( descriptorData, new com.google.protobuf.Descriptors.FileDescriptor[] {}); + descriptor.resolveAllFeaturesImmutable(); } // @@protoc_insertion_point(outer_class_scope) diff --git a/java-common-protos/proto-google-common-protos/src/main/java/com/google/longrunning/CancelOperationRequest.java b/java-common-protos/proto-google-common-protos/src/main/java/com/google/longrunning/CancelOperationRequest.java index 667ad12bd3..3361598e23 100644 --- a/java-common-protos/proto-google-common-protos/src/main/java/com/google/longrunning/CancelOperationRequest.java +++ b/java-common-protos/proto-google-common-protos/src/main/java/com/google/longrunning/CancelOperationRequest.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,9 @@ * limitations under the License. */ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: google/longrunning/operations.proto +// Protobuf Java Version: 4.33.2 package com.google.longrunning; @@ -22,18 +24,31 @@ * * *
        - * The request message for [Operations.CancelOperation][google.longrunning.Operations.CancelOperation].
        + * The request message for
        + * [Operations.CancelOperation][google.longrunning.Operations.CancelOperation].
          * 
        * * Protobuf type {@code google.longrunning.CancelOperationRequest} */ -public final class CancelOperationRequest extends com.google.protobuf.GeneratedMessageV3 +@com.google.protobuf.Generated +public final class CancelOperationRequest extends com.google.protobuf.GeneratedMessage implements // @@protoc_insertion_point(message_implements:google.longrunning.CancelOperationRequest) CancelOperationRequestOrBuilder { private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "CancelOperationRequest"); + } + // Use CancelOperationRequest.newBuilder() to construct. - private CancelOperationRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + private CancelOperationRequest(com.google.protobuf.GeneratedMessage.Builder builder) { super(builder); } @@ -41,24 +56,13 @@ private CancelOperationRequest() { name_ = ""; } - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new CancelOperationRequest(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.longrunning.OperationsProto .internal_static_google_longrunning_CancelOperationRequest_descriptor; } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.longrunning.OperationsProto .internal_static_google_longrunning_CancelOperationRequest_fieldAccessorTable @@ -68,7 +72,10 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } public static final int NAME_FIELD_NUMBER = 1; - private volatile java.lang.Object name_; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** * * @@ -92,6 +99,7 @@ public java.lang.String getName() { return s; } } + /** * * @@ -130,8 +138,8 @@ public final boolean isInitialized() { @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.GeneratedMessage.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, name_); } getUnknownFields().writeTo(output); } @@ -142,8 +150,8 @@ public int getSerializedSize() { 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.GeneratedMessage.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, name_); } size += getUnknownFields().getSerializedSize(); memoizedSize = size; @@ -217,38 +225,38 @@ public static com.google.longrunning.CancelOperationRequest parseFrom( public static com.google.longrunning.CancelOperationRequest parseFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); } public static com.google.longrunning.CancelOperationRequest parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } public static com.google.longrunning.CancelOperationRequest parseDelimitedFrom( java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); } public static com.google.longrunning.CancelOperationRequest parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( PARSER, input, extensionRegistry); } public static com.google.longrunning.CancelOperationRequest parseFrom( com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); } public static com.google.longrunning.CancelOperationRequest parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } @@ -271,20 +279,22 @@ public Builder toBuilder() { } @java.lang.Override - protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { Builder builder = new Builder(parent); return builder; } + /** * * *
        -   * The request message for [Operations.CancelOperation][google.longrunning.Operations.CancelOperation].
        +   * The request message for
        +   * [Operations.CancelOperation][google.longrunning.Operations.CancelOperation].
            * 
        * * Protobuf type {@code google.longrunning.CancelOperationRequest} */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder implements // @@protoc_insertion_point(builder_implements:google.longrunning.CancelOperationRequest) com.google.longrunning.CancelOperationRequestOrBuilder { @@ -294,7 +304,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.longrunning.OperationsProto .internal_static_google_longrunning_CancelOperationRequest_fieldAccessorTable @@ -306,15 +316,15 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { // Construct using com.google.longrunning.CancelOperationRequest.newBuilder() private Builder() {} - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { super(parent); } @java.lang.Override public Builder clear() { super.clear(); + bitField0_ = 0; name_ = ""; - return this; } @@ -342,42 +352,18 @@ public com.google.longrunning.CancelOperationRequest build() { public com.google.longrunning.CancelOperationRequest buildPartial() { com.google.longrunning.CancelOperationRequest result = new com.google.longrunning.CancelOperationRequest(this); - result.name_ = name_; + if (bitField0_ != 0) { + buildPartial0(result); + } 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); + private void buildPartial0(com.google.longrunning.CancelOperationRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } } @java.lang.Override @@ -394,6 +380,7 @@ public Builder mergeFrom(com.google.longrunning.CancelOperationRequest other) { if (other == com.google.longrunning.CancelOperationRequest.getDefaultInstance()) return this; if (!other.getName().isEmpty()) { name_ = other.name_; + bitField0_ |= 0x00000001; onChanged(); } this.mergeUnknownFields(other.getUnknownFields()); @@ -425,7 +412,7 @@ public Builder mergeFrom( case 10: { name_ = input.readStringRequireUtf8(); - + bitField0_ |= 0x00000001; break; } // case 10 default: @@ -445,7 +432,10 @@ public Builder mergeFrom( return this; } + private int bitField0_; + private java.lang.Object name_ = ""; + /** * * @@ -468,6 +458,7 @@ public java.lang.String getName() { return (java.lang.String) ref; } } + /** * * @@ -490,6 +481,7 @@ public com.google.protobuf.ByteString getNameBytes() { return (com.google.protobuf.ByteString) ref; } } + /** * * @@ -506,11 +498,12 @@ public Builder setName(java.lang.String value) { if (value == null) { throw new NullPointerException(); } - name_ = value; + bitField0_ |= 0x00000001; onChanged(); return this; } + /** * * @@ -523,11 +516,12 @@ public Builder setName(java.lang.String value) { * @return This builder for chaining. */ public Builder clearName() { - name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); onChanged(); return this; } + /** * * @@ -545,23 +539,12 @@ public Builder setNameBytes(com.google.protobuf.ByteString value) { 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.longrunning.CancelOperationRequest) } diff --git a/java-common-protos/proto-google-common-protos/src/main/java/com/google/longrunning/CancelOperationRequestOrBuilder.java b/java-common-protos/proto-google-common-protos/src/main/java/com/google/longrunning/CancelOperationRequestOrBuilder.java index 6dbf21a0f6..cb7837f05f 100644 --- a/java-common-protos/proto-google-common-protos/src/main/java/com/google/longrunning/CancelOperationRequestOrBuilder.java +++ b/java-common-protos/proto-google-common-protos/src/main/java/com/google/longrunning/CancelOperationRequestOrBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,10 +14,13 @@ * limitations under the License. */ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: google/longrunning/operations.proto +// Protobuf Java Version: 4.33.2 package com.google.longrunning; +@com.google.protobuf.Generated public interface CancelOperationRequestOrBuilder extends // @@protoc_insertion_point(interface_extends:google.longrunning.CancelOperationRequest) @@ -35,6 +38,7 @@ public interface CancelOperationRequestOrBuilder * @return The name. */ java.lang.String getName(); + /** * * diff --git a/java-common-protos/proto-google-common-protos/src/main/java/com/google/longrunning/DeleteOperationRequest.java b/java-common-protos/proto-google-common-protos/src/main/java/com/google/longrunning/DeleteOperationRequest.java index 0e8530ef0d..2990e04b8f 100644 --- a/java-common-protos/proto-google-common-protos/src/main/java/com/google/longrunning/DeleteOperationRequest.java +++ b/java-common-protos/proto-google-common-protos/src/main/java/com/google/longrunning/DeleteOperationRequest.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,9 @@ * limitations under the License. */ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: google/longrunning/operations.proto +// Protobuf Java Version: 4.33.2 package com.google.longrunning; @@ -22,18 +24,31 @@ * * *
        - * The request message for [Operations.DeleteOperation][google.longrunning.Operations.DeleteOperation].
        + * The request message for
        + * [Operations.DeleteOperation][google.longrunning.Operations.DeleteOperation].
          * 
        * * Protobuf type {@code google.longrunning.DeleteOperationRequest} */ -public final class DeleteOperationRequest extends com.google.protobuf.GeneratedMessageV3 +@com.google.protobuf.Generated +public final class DeleteOperationRequest extends com.google.protobuf.GeneratedMessage implements // @@protoc_insertion_point(message_implements:google.longrunning.DeleteOperationRequest) DeleteOperationRequestOrBuilder { private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "DeleteOperationRequest"); + } + // Use DeleteOperationRequest.newBuilder() to construct. - private DeleteOperationRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + private DeleteOperationRequest(com.google.protobuf.GeneratedMessage.Builder builder) { super(builder); } @@ -41,24 +56,13 @@ private DeleteOperationRequest() { name_ = ""; } - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new DeleteOperationRequest(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.longrunning.OperationsProto .internal_static_google_longrunning_DeleteOperationRequest_descriptor; } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.longrunning.OperationsProto .internal_static_google_longrunning_DeleteOperationRequest_fieldAccessorTable @@ -68,7 +72,10 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } public static final int NAME_FIELD_NUMBER = 1; - private volatile java.lang.Object name_; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** * * @@ -92,6 +99,7 @@ public java.lang.String getName() { return s; } } + /** * * @@ -130,8 +138,8 @@ public final boolean isInitialized() { @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.GeneratedMessage.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, name_); } getUnknownFields().writeTo(output); } @@ -142,8 +150,8 @@ public int getSerializedSize() { 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.GeneratedMessage.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, name_); } size += getUnknownFields().getSerializedSize(); memoizedSize = size; @@ -217,38 +225,38 @@ public static com.google.longrunning.DeleteOperationRequest parseFrom( public static com.google.longrunning.DeleteOperationRequest parseFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); } public static com.google.longrunning.DeleteOperationRequest parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } public static com.google.longrunning.DeleteOperationRequest parseDelimitedFrom( java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); } public static com.google.longrunning.DeleteOperationRequest parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( PARSER, input, extensionRegistry); } public static com.google.longrunning.DeleteOperationRequest parseFrom( com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); } public static com.google.longrunning.DeleteOperationRequest parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } @@ -271,20 +279,22 @@ public Builder toBuilder() { } @java.lang.Override - protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { Builder builder = new Builder(parent); return builder; } + /** * * *
        -   * The request message for [Operations.DeleteOperation][google.longrunning.Operations.DeleteOperation].
        +   * The request message for
        +   * [Operations.DeleteOperation][google.longrunning.Operations.DeleteOperation].
            * 
        * * Protobuf type {@code google.longrunning.DeleteOperationRequest} */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder implements // @@protoc_insertion_point(builder_implements:google.longrunning.DeleteOperationRequest) com.google.longrunning.DeleteOperationRequestOrBuilder { @@ -294,7 +304,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.longrunning.OperationsProto .internal_static_google_longrunning_DeleteOperationRequest_fieldAccessorTable @@ -306,15 +316,15 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { // Construct using com.google.longrunning.DeleteOperationRequest.newBuilder() private Builder() {} - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { super(parent); } @java.lang.Override public Builder clear() { super.clear(); + bitField0_ = 0; name_ = ""; - return this; } @@ -342,42 +352,18 @@ public com.google.longrunning.DeleteOperationRequest build() { public com.google.longrunning.DeleteOperationRequest buildPartial() { com.google.longrunning.DeleteOperationRequest result = new com.google.longrunning.DeleteOperationRequest(this); - result.name_ = name_; + if (bitField0_ != 0) { + buildPartial0(result); + } 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); + private void buildPartial0(com.google.longrunning.DeleteOperationRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } } @java.lang.Override @@ -394,6 +380,7 @@ public Builder mergeFrom(com.google.longrunning.DeleteOperationRequest other) { if (other == com.google.longrunning.DeleteOperationRequest.getDefaultInstance()) return this; if (!other.getName().isEmpty()) { name_ = other.name_; + bitField0_ |= 0x00000001; onChanged(); } this.mergeUnknownFields(other.getUnknownFields()); @@ -425,7 +412,7 @@ public Builder mergeFrom( case 10: { name_ = input.readStringRequireUtf8(); - + bitField0_ |= 0x00000001; break; } // case 10 default: @@ -445,7 +432,10 @@ public Builder mergeFrom( return this; } + private int bitField0_; + private java.lang.Object name_ = ""; + /** * * @@ -468,6 +458,7 @@ public java.lang.String getName() { return (java.lang.String) ref; } } + /** * * @@ -490,6 +481,7 @@ public com.google.protobuf.ByteString getNameBytes() { return (com.google.protobuf.ByteString) ref; } } + /** * * @@ -506,11 +498,12 @@ public Builder setName(java.lang.String value) { if (value == null) { throw new NullPointerException(); } - name_ = value; + bitField0_ |= 0x00000001; onChanged(); return this; } + /** * * @@ -523,11 +516,12 @@ public Builder setName(java.lang.String value) { * @return This builder for chaining. */ public Builder clearName() { - name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); onChanged(); return this; } + /** * * @@ -545,23 +539,12 @@ public Builder setNameBytes(com.google.protobuf.ByteString value) { 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.longrunning.DeleteOperationRequest) } diff --git a/java-common-protos/proto-google-common-protos/src/main/java/com/google/longrunning/DeleteOperationRequestOrBuilder.java b/java-common-protos/proto-google-common-protos/src/main/java/com/google/longrunning/DeleteOperationRequestOrBuilder.java index 3d39fee204..1429e10525 100644 --- a/java-common-protos/proto-google-common-protos/src/main/java/com/google/longrunning/DeleteOperationRequestOrBuilder.java +++ b/java-common-protos/proto-google-common-protos/src/main/java/com/google/longrunning/DeleteOperationRequestOrBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,10 +14,13 @@ * limitations under the License. */ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: google/longrunning/operations.proto +// Protobuf Java Version: 4.33.2 package com.google.longrunning; +@com.google.protobuf.Generated public interface DeleteOperationRequestOrBuilder extends // @@protoc_insertion_point(interface_extends:google.longrunning.DeleteOperationRequest) @@ -35,6 +38,7 @@ public interface DeleteOperationRequestOrBuilder * @return The name. */ java.lang.String getName(); + /** * * diff --git a/java-common-protos/proto-google-common-protos/src/main/java/com/google/longrunning/GetOperationRequest.java b/java-common-protos/proto-google-common-protos/src/main/java/com/google/longrunning/GetOperationRequest.java index 5d46681a3d..5bcf10dc4c 100644 --- a/java-common-protos/proto-google-common-protos/src/main/java/com/google/longrunning/GetOperationRequest.java +++ b/java-common-protos/proto-google-common-protos/src/main/java/com/google/longrunning/GetOperationRequest.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,9 @@ * limitations under the License. */ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: google/longrunning/operations.proto +// Protobuf Java Version: 4.33.2 package com.google.longrunning; @@ -22,18 +24,31 @@ * * *
        - * The request message for [Operations.GetOperation][google.longrunning.Operations.GetOperation].
        + * The request message for
        + * [Operations.GetOperation][google.longrunning.Operations.GetOperation].
          * 
        * * Protobuf type {@code google.longrunning.GetOperationRequest} */ -public final class GetOperationRequest extends com.google.protobuf.GeneratedMessageV3 +@com.google.protobuf.Generated +public final class GetOperationRequest extends com.google.protobuf.GeneratedMessage implements // @@protoc_insertion_point(message_implements:google.longrunning.GetOperationRequest) GetOperationRequestOrBuilder { private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "GetOperationRequest"); + } + // Use GetOperationRequest.newBuilder() to construct. - private GetOperationRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + private GetOperationRequest(com.google.protobuf.GeneratedMessage.Builder builder) { super(builder); } @@ -41,24 +56,13 @@ private GetOperationRequest() { name_ = ""; } - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new GetOperationRequest(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.longrunning.OperationsProto .internal_static_google_longrunning_GetOperationRequest_descriptor; } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.longrunning.OperationsProto .internal_static_google_longrunning_GetOperationRequest_fieldAccessorTable @@ -68,7 +72,10 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } public static final int NAME_FIELD_NUMBER = 1; - private volatile java.lang.Object name_; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** * * @@ -92,6 +99,7 @@ public java.lang.String getName() { return s; } } + /** * * @@ -130,8 +138,8 @@ public final boolean isInitialized() { @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.GeneratedMessage.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, name_); } getUnknownFields().writeTo(output); } @@ -142,8 +150,8 @@ public int getSerializedSize() { 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.GeneratedMessage.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, name_); } size += getUnknownFields().getSerializedSize(); memoizedSize = size; @@ -217,38 +225,38 @@ public static com.google.longrunning.GetOperationRequest parseFrom( public static com.google.longrunning.GetOperationRequest parseFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); } public static com.google.longrunning.GetOperationRequest parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } public static com.google.longrunning.GetOperationRequest parseDelimitedFrom( java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); } public static com.google.longrunning.GetOperationRequest parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( PARSER, input, extensionRegistry); } public static com.google.longrunning.GetOperationRequest parseFrom( com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); } public static com.google.longrunning.GetOperationRequest parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } @@ -271,20 +279,22 @@ public Builder toBuilder() { } @java.lang.Override - protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { Builder builder = new Builder(parent); return builder; } + /** * * *
        -   * The request message for [Operations.GetOperation][google.longrunning.Operations.GetOperation].
        +   * The request message for
        +   * [Operations.GetOperation][google.longrunning.Operations.GetOperation].
            * 
        * * Protobuf type {@code google.longrunning.GetOperationRequest} */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder implements // @@protoc_insertion_point(builder_implements:google.longrunning.GetOperationRequest) com.google.longrunning.GetOperationRequestOrBuilder { @@ -294,7 +304,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.longrunning.OperationsProto .internal_static_google_longrunning_GetOperationRequest_fieldAccessorTable @@ -306,15 +316,15 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { // Construct using com.google.longrunning.GetOperationRequest.newBuilder() private Builder() {} - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { super(parent); } @java.lang.Override public Builder clear() { super.clear(); + bitField0_ = 0; name_ = ""; - return this; } @@ -342,42 +352,18 @@ public com.google.longrunning.GetOperationRequest build() { public com.google.longrunning.GetOperationRequest buildPartial() { com.google.longrunning.GetOperationRequest result = new com.google.longrunning.GetOperationRequest(this); - result.name_ = name_; + if (bitField0_ != 0) { + buildPartial0(result); + } 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); + private void buildPartial0(com.google.longrunning.GetOperationRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } } @java.lang.Override @@ -394,6 +380,7 @@ public Builder mergeFrom(com.google.longrunning.GetOperationRequest other) { if (other == com.google.longrunning.GetOperationRequest.getDefaultInstance()) return this; if (!other.getName().isEmpty()) { name_ = other.name_; + bitField0_ |= 0x00000001; onChanged(); } this.mergeUnknownFields(other.getUnknownFields()); @@ -425,7 +412,7 @@ public Builder mergeFrom( case 10: { name_ = input.readStringRequireUtf8(); - + bitField0_ |= 0x00000001; break; } // case 10 default: @@ -445,7 +432,10 @@ public Builder mergeFrom( return this; } + private int bitField0_; + private java.lang.Object name_ = ""; + /** * * @@ -468,6 +458,7 @@ public java.lang.String getName() { return (java.lang.String) ref; } } + /** * * @@ -490,6 +481,7 @@ public com.google.protobuf.ByteString getNameBytes() { return (com.google.protobuf.ByteString) ref; } } + /** * * @@ -506,11 +498,12 @@ public Builder setName(java.lang.String value) { if (value == null) { throw new NullPointerException(); } - name_ = value; + bitField0_ |= 0x00000001; onChanged(); return this; } + /** * * @@ -523,11 +516,12 @@ public Builder setName(java.lang.String value) { * @return This builder for chaining. */ public Builder clearName() { - name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); onChanged(); return this; } + /** * * @@ -545,23 +539,12 @@ public Builder setNameBytes(com.google.protobuf.ByteString value) { 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.longrunning.GetOperationRequest) } diff --git a/java-common-protos/proto-google-common-protos/src/main/java/com/google/longrunning/GetOperationRequestOrBuilder.java b/java-common-protos/proto-google-common-protos/src/main/java/com/google/longrunning/GetOperationRequestOrBuilder.java index fb60fb1fa7..97d4436604 100644 --- a/java-common-protos/proto-google-common-protos/src/main/java/com/google/longrunning/GetOperationRequestOrBuilder.java +++ b/java-common-protos/proto-google-common-protos/src/main/java/com/google/longrunning/GetOperationRequestOrBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,10 +14,13 @@ * limitations under the License. */ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: google/longrunning/operations.proto +// Protobuf Java Version: 4.33.2 package com.google.longrunning; +@com.google.protobuf.Generated public interface GetOperationRequestOrBuilder extends // @@protoc_insertion_point(interface_extends:google.longrunning.GetOperationRequest) @@ -35,6 +38,7 @@ public interface GetOperationRequestOrBuilder * @return The name. */ java.lang.String getName(); + /** * * diff --git a/java-common-protos/proto-google-common-protos/src/main/java/com/google/longrunning/ListOperationsRequest.java b/java-common-protos/proto-google-common-protos/src/main/java/com/google/longrunning/ListOperationsRequest.java index 39ba4f6f8e..88c53c29d6 100644 --- a/java-common-protos/proto-google-common-protos/src/main/java/com/google/longrunning/ListOperationsRequest.java +++ b/java-common-protos/proto-google-common-protos/src/main/java/com/google/longrunning/ListOperationsRequest.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,9 @@ * limitations under the License. */ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: google/longrunning/operations.proto +// Protobuf Java Version: 4.33.2 package com.google.longrunning; @@ -22,18 +24,31 @@ * * *
        - * The request message for [Operations.ListOperations][google.longrunning.Operations.ListOperations].
        + * The request message for
        + * [Operations.ListOperations][google.longrunning.Operations.ListOperations].
          * 
        * * Protobuf type {@code google.longrunning.ListOperationsRequest} */ -public final class ListOperationsRequest extends com.google.protobuf.GeneratedMessageV3 +@com.google.protobuf.Generated +public final class ListOperationsRequest extends com.google.protobuf.GeneratedMessage implements // @@protoc_insertion_point(message_implements:google.longrunning.ListOperationsRequest) ListOperationsRequestOrBuilder { private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "ListOperationsRequest"); + } + // Use ListOperationsRequest.newBuilder() to construct. - private ListOperationsRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + private ListOperationsRequest(com.google.protobuf.GeneratedMessage.Builder builder) { super(builder); } @@ -43,24 +58,13 @@ private ListOperationsRequest() { pageToken_ = ""; } - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new ListOperationsRequest(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.longrunning.OperationsProto .internal_static_google_longrunning_ListOperationsRequest_descriptor; } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.longrunning.OperationsProto .internal_static_google_longrunning_ListOperationsRequest_fieldAccessorTable @@ -70,7 +74,10 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } public static final int NAME_FIELD_NUMBER = 4; - private volatile java.lang.Object name_; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** * * @@ -94,6 +101,7 @@ public java.lang.String getName() { return s; } } + /** * * @@ -119,7 +127,10 @@ public com.google.protobuf.ByteString getNameBytes() { } public static final int FILTER_FIELD_NUMBER = 1; - private volatile java.lang.Object filter_; + + @SuppressWarnings("serial") + private volatile java.lang.Object filter_ = ""; + /** * * @@ -143,6 +154,7 @@ public java.lang.String getFilter() { return s; } } + /** * * @@ -168,7 +180,8 @@ public com.google.protobuf.ByteString getFilterBytes() { } public static final int PAGE_SIZE_FIELD_NUMBER = 2; - private int pageSize_; + private int pageSize_ = 0; + /** * * @@ -186,7 +199,10 @@ public int getPageSize() { } public static final int PAGE_TOKEN_FIELD_NUMBER = 3; - private volatile java.lang.Object pageToken_; + + @SuppressWarnings("serial") + private volatile java.lang.Object pageToken_ = ""; + /** * * @@ -210,6 +226,7 @@ public java.lang.String getPageToken() { return s; } } + /** * * @@ -234,6 +251,34 @@ public com.google.protobuf.ByteString getPageTokenBytes() { } } + public static final int RETURN_PARTIAL_SUCCESS_FIELD_NUMBER = 5; + private boolean returnPartialSuccess_ = false; + + /** + * + * + *
        +   * When set to `true`, operations that are reachable are returned as normal,
        +   * and those that are unreachable are returned in the
        +   * [ListOperationsResponse.unreachable] field.
        +   *
        +   * This can only be `true` when reading across collections e.g. when `parent`
        +   * is set to `"projects/example/locations/-"`.
        +   *
        +   * This field is not by default supported and will result in an
        +   * `UNIMPLEMENTED` error if set unless explicitly documented otherwise in
        +   * service or product specific documentation.
        +   * 
        + * + * bool return_partial_success = 5; + * + * @return The returnPartialSuccess. + */ + @java.lang.Override + public boolean getReturnPartialSuccess() { + return returnPartialSuccess_; + } + private byte memoizedIsInitialized = -1; @java.lang.Override @@ -248,17 +293,20 @@ public final boolean isInitialized() { @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, 1, filter_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(filter_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, filter_); } if (pageSize_ != 0) { output.writeInt32(2, pageSize_); } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(pageToken_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 3, pageToken_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(pageToken_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 3, pageToken_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 4, name_); } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 4, name_); + if (returnPartialSuccess_ != false) { + output.writeBool(5, returnPartialSuccess_); } getUnknownFields().writeTo(output); } @@ -269,17 +317,20 @@ public int getSerializedSize() { if (size != -1) return size; size = 0; - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(filter_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, filter_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(filter_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, filter_); } 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_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(pageToken_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(3, pageToken_); } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, name_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(4, name_); + } + if (returnPartialSuccess_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(5, returnPartialSuccess_); } size += getUnknownFields().getSerializedSize(); memoizedSize = size; @@ -301,6 +352,7 @@ public boolean equals(final java.lang.Object obj) { if (!getFilter().equals(other.getFilter())) return false; if (getPageSize() != other.getPageSize()) return false; if (!getPageToken().equals(other.getPageToken())) return false; + if (getReturnPartialSuccess() != other.getReturnPartialSuccess()) return false; if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -320,6 +372,8 @@ public int hashCode() { hash = (53 * hash) + getPageSize(); hash = (37 * hash) + PAGE_TOKEN_FIELD_NUMBER; hash = (53 * hash) + getPageToken().hashCode(); + hash = (37 * hash) + RETURN_PARTIAL_SUCCESS_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getReturnPartialSuccess()); hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; @@ -362,38 +416,38 @@ public static com.google.longrunning.ListOperationsRequest parseFrom( public static com.google.longrunning.ListOperationsRequest parseFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); } public static com.google.longrunning.ListOperationsRequest parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } public static com.google.longrunning.ListOperationsRequest parseDelimitedFrom( java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); } public static com.google.longrunning.ListOperationsRequest parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( PARSER, input, extensionRegistry); } public static com.google.longrunning.ListOperationsRequest parseFrom( com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); } public static com.google.longrunning.ListOperationsRequest parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } @@ -416,20 +470,22 @@ public Builder toBuilder() { } @java.lang.Override - protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { Builder builder = new Builder(parent); return builder; } + /** * * *
        -   * The request message for [Operations.ListOperations][google.longrunning.Operations.ListOperations].
        +   * The request message for
        +   * [Operations.ListOperations][google.longrunning.Operations.ListOperations].
            * 
        * * Protobuf type {@code google.longrunning.ListOperationsRequest} */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder implements // @@protoc_insertion_point(builder_implements:google.longrunning.ListOperationsRequest) com.google.longrunning.ListOperationsRequestOrBuilder { @@ -439,7 +495,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.longrunning.OperationsProto .internal_static_google_longrunning_ListOperationsRequest_fieldAccessorTable @@ -451,21 +507,19 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { // Construct using com.google.longrunning.ListOperationsRequest.newBuilder() private Builder() {} - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { super(parent); } @java.lang.Override public Builder clear() { super.clear(); + bitField0_ = 0; name_ = ""; - filter_ = ""; - pageSize_ = 0; - pageToken_ = ""; - + returnPartialSuccess_ = false; return this; } @@ -493,45 +547,30 @@ public com.google.longrunning.ListOperationsRequest build() { public com.google.longrunning.ListOperationsRequest buildPartial() { com.google.longrunning.ListOperationsRequest result = new com.google.longrunning.ListOperationsRequest(this); - result.name_ = name_; - result.filter_ = filter_; - result.pageSize_ = pageSize_; - result.pageToken_ = pageToken_; + if (bitField0_ != 0) { + buildPartial0(result); + } 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); + private void buildPartial0(com.google.longrunning.ListOperationsRequest 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.pageSize_ = pageSize_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.pageToken_ = pageToken_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.returnPartialSuccess_ = returnPartialSuccess_; + } } @java.lang.Override @@ -548,10 +587,12 @@ public Builder mergeFrom(com.google.longrunning.ListOperationsRequest other) { if (other == com.google.longrunning.ListOperationsRequest.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.getPageSize() != 0) { @@ -559,8 +600,12 @@ public Builder mergeFrom(com.google.longrunning.ListOperationsRequest other) { } if (!other.getPageToken().isEmpty()) { pageToken_ = other.pageToken_; + bitField0_ |= 0x00000008; onChanged(); } + if (other.getReturnPartialSuccess() != false) { + setReturnPartialSuccess(other.getReturnPartialSuccess()); + } this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; @@ -590,27 +635,33 @@ public Builder mergeFrom( case 10: { filter_ = input.readStringRequireUtf8(); - + bitField0_ |= 0x00000002; break; } // case 10 case 16: { pageSize_ = input.readInt32(); - + bitField0_ |= 0x00000004; break; } // case 16 case 26: { pageToken_ = input.readStringRequireUtf8(); - + bitField0_ |= 0x00000008; break; } // case 26 case 34: { name_ = input.readStringRequireUtf8(); - + bitField0_ |= 0x00000001; break; } // case 34 + case 40: + { + returnPartialSuccess_ = input.readBool(); + bitField0_ |= 0x00000010; + break; + } // case 40 default: { if (!super.parseUnknownField(input, extensionRegistry, tag)) { @@ -628,7 +679,10 @@ public Builder mergeFrom( return this; } + private int bitField0_; + private java.lang.Object name_ = ""; + /** * * @@ -651,6 +705,7 @@ public java.lang.String getName() { return (java.lang.String) ref; } } + /** * * @@ -673,6 +728,7 @@ public com.google.protobuf.ByteString getNameBytes() { return (com.google.protobuf.ByteString) ref; } } + /** * * @@ -689,11 +745,12 @@ public Builder setName(java.lang.String value) { if (value == null) { throw new NullPointerException(); } - name_ = value; + bitField0_ |= 0x00000001; onChanged(); return this; } + /** * * @@ -706,11 +763,12 @@ public Builder setName(java.lang.String value) { * @return This builder for chaining. */ public Builder clearName() { - name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); onChanged(); return this; } + /** * * @@ -728,13 +786,14 @@ public Builder setNameBytes(com.google.protobuf.ByteString value) { throw new NullPointerException(); } checkByteStringIsUtf8(value); - name_ = value; + bitField0_ |= 0x00000001; onChanged(); return this; } private java.lang.Object filter_ = ""; + /** * * @@ -757,6 +816,7 @@ public java.lang.String getFilter() { return (java.lang.String) ref; } } + /** * * @@ -779,6 +839,7 @@ public com.google.protobuf.ByteString getFilterBytes() { return (com.google.protobuf.ByteString) ref; } } + /** * * @@ -795,11 +856,12 @@ public Builder setFilter(java.lang.String value) { if (value == null) { throw new NullPointerException(); } - filter_ = value; + bitField0_ |= 0x00000002; onChanged(); return this; } + /** * * @@ -812,11 +874,12 @@ public Builder setFilter(java.lang.String value) { * @return This builder for chaining. */ public Builder clearFilter() { - filter_ = getDefaultInstance().getFilter(); + bitField0_ = (bitField0_ & ~0x00000002); onChanged(); return this; } + /** * * @@ -834,13 +897,14 @@ public Builder setFilterBytes(com.google.protobuf.ByteString value) { throw new NullPointerException(); } checkByteStringIsUtf8(value); - filter_ = value; + bitField0_ |= 0x00000002; onChanged(); return this; } private int pageSize_; + /** * * @@ -856,6 +920,7 @@ public Builder setFilterBytes(com.google.protobuf.ByteString value) { public int getPageSize() { return pageSize_; } + /** * * @@ -871,9 +936,11 @@ public int getPageSize() { public Builder setPageSize(int value) { pageSize_ = value; + bitField0_ |= 0x00000004; onChanged(); return this; } + /** * * @@ -886,13 +953,14 @@ public Builder setPageSize(int value) { * @return This builder for chaining. */ public Builder clearPageSize() { - + bitField0_ = (bitField0_ & ~0x00000004); pageSize_ = 0; onChanged(); return this; } private java.lang.Object pageToken_ = ""; + /** * * @@ -915,6 +983,7 @@ public java.lang.String getPageToken() { return (java.lang.String) ref; } } + /** * * @@ -937,6 +1006,7 @@ public com.google.protobuf.ByteString getPageTokenBytes() { return (com.google.protobuf.ByteString) ref; } } + /** * * @@ -953,11 +1023,12 @@ public Builder setPageToken(java.lang.String value) { if (value == null) { throw new NullPointerException(); } - pageToken_ = value; + bitField0_ |= 0x00000008; onChanged(); return this; } + /** * * @@ -970,11 +1041,12 @@ public Builder setPageToken(java.lang.String value) { * @return This builder for chaining. */ public Builder clearPageToken() { - pageToken_ = getDefaultInstance().getPageToken(); + bitField0_ = (bitField0_ & ~0x00000008); onChanged(); return this; } + /** * * @@ -992,21 +1064,93 @@ public Builder setPageTokenBytes(com.google.protobuf.ByteString value) { throw new NullPointerException(); } checkByteStringIsUtf8(value); - pageToken_ = value; + bitField0_ |= 0x00000008; onChanged(); return this; } + private boolean returnPartialSuccess_; + + /** + * + * + *
        +     * When set to `true`, operations that are reachable are returned as normal,
        +     * and those that are unreachable are returned in the
        +     * [ListOperationsResponse.unreachable] field.
        +     *
        +     * This can only be `true` when reading across collections e.g. when `parent`
        +     * is set to `"projects/example/locations/-"`.
        +     *
        +     * This field is not by default supported and will result in an
        +     * `UNIMPLEMENTED` error if set unless explicitly documented otherwise in
        +     * service or product specific documentation.
        +     * 
        + * + * bool return_partial_success = 5; + * + * @return The returnPartialSuccess. + */ @java.lang.Override - public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); + public boolean getReturnPartialSuccess() { + return returnPartialSuccess_; } - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); + /** + * + * + *
        +     * When set to `true`, operations that are reachable are returned as normal,
        +     * and those that are unreachable are returned in the
        +     * [ListOperationsResponse.unreachable] field.
        +     *
        +     * This can only be `true` when reading across collections e.g. when `parent`
        +     * is set to `"projects/example/locations/-"`.
        +     *
        +     * This field is not by default supported and will result in an
        +     * `UNIMPLEMENTED` error if set unless explicitly documented otherwise in
        +     * service or product specific documentation.
        +     * 
        + * + * bool return_partial_success = 5; + * + * @param value The returnPartialSuccess to set. + * @return This builder for chaining. + */ + public Builder setReturnPartialSuccess(boolean value) { + + returnPartialSuccess_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + /** + * + * + *
        +     * When set to `true`, operations that are reachable are returned as normal,
        +     * and those that are unreachable are returned in the
        +     * [ListOperationsResponse.unreachable] field.
        +     *
        +     * This can only be `true` when reading across collections e.g. when `parent`
        +     * is set to `"projects/example/locations/-"`.
        +     *
        +     * This field is not by default supported and will result in an
        +     * `UNIMPLEMENTED` error if set unless explicitly documented otherwise in
        +     * service or product specific documentation.
        +     * 
        + * + * bool return_partial_success = 5; + * + * @return This builder for chaining. + */ + public Builder clearReturnPartialSuccess() { + bitField0_ = (bitField0_ & ~0x00000010); + returnPartialSuccess_ = false; + onChanged(); + return this; } // @@protoc_insertion_point(builder_scope:google.longrunning.ListOperationsRequest) diff --git a/java-common-protos/proto-google-common-protos/src/main/java/com/google/longrunning/ListOperationsRequestOrBuilder.java b/java-common-protos/proto-google-common-protos/src/main/java/com/google/longrunning/ListOperationsRequestOrBuilder.java index 1b2dbeea22..fa28584e34 100644 --- a/java-common-protos/proto-google-common-protos/src/main/java/com/google/longrunning/ListOperationsRequestOrBuilder.java +++ b/java-common-protos/proto-google-common-protos/src/main/java/com/google/longrunning/ListOperationsRequestOrBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,10 +14,13 @@ * limitations under the License. */ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: google/longrunning/operations.proto +// Protobuf Java Version: 4.33.2 package com.google.longrunning; +@com.google.protobuf.Generated public interface ListOperationsRequestOrBuilder extends // @@protoc_insertion_point(interface_extends:google.longrunning.ListOperationsRequest) @@ -35,6 +38,7 @@ public interface ListOperationsRequestOrBuilder * @return The name. */ java.lang.String getName(); + /** * * @@ -60,6 +64,7 @@ public interface ListOperationsRequestOrBuilder * @return The filter. */ java.lang.String getFilter(); + /** * * @@ -98,6 +103,7 @@ public interface ListOperationsRequestOrBuilder * @return The pageToken. */ java.lang.String getPageToken(); + /** * * @@ -110,4 +116,26 @@ public interface ListOperationsRequestOrBuilder * @return The bytes for pageToken. */ com.google.protobuf.ByteString getPageTokenBytes(); + + /** + * + * + *
        +   * When set to `true`, operations that are reachable are returned as normal,
        +   * and those that are unreachable are returned in the
        +   * [ListOperationsResponse.unreachable] field.
        +   *
        +   * This can only be `true` when reading across collections e.g. when `parent`
        +   * is set to `"projects/example/locations/-"`.
        +   *
        +   * This field is not by default supported and will result in an
        +   * `UNIMPLEMENTED` error if set unless explicitly documented otherwise in
        +   * service or product specific documentation.
        +   * 
        + * + * bool return_partial_success = 5; + * + * @return The returnPartialSuccess. + */ + boolean getReturnPartialSuccess(); } diff --git a/java-common-protos/proto-google-common-protos/src/main/java/com/google/longrunning/ListOperationsResponse.java b/java-common-protos/proto-google-common-protos/src/main/java/com/google/longrunning/ListOperationsResponse.java index 06d2173cf3..9fa10a304d 100644 --- a/java-common-protos/proto-google-common-protos/src/main/java/com/google/longrunning/ListOperationsResponse.java +++ b/java-common-protos/proto-google-common-protos/src/main/java/com/google/longrunning/ListOperationsResponse.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,9 @@ * limitations under the License. */ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: google/longrunning/operations.proto +// Protobuf Java Version: 4.33.2 package com.google.longrunning; @@ -22,35 +24,38 @@ * * *
        - * The response message for [Operations.ListOperations][google.longrunning.Operations.ListOperations].
        + * The response message for
        + * [Operations.ListOperations][google.longrunning.Operations.ListOperations].
          * 
        * * Protobuf type {@code google.longrunning.ListOperationsResponse} */ -public final class ListOperationsResponse extends com.google.protobuf.GeneratedMessageV3 +@com.google.protobuf.Generated +public final class ListOperationsResponse extends com.google.protobuf.GeneratedMessage implements // @@protoc_insertion_point(message_implements:google.longrunning.ListOperationsResponse) ListOperationsResponseOrBuilder { private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "ListOperationsResponse"); + } + // Use ListOperationsResponse.newBuilder() to construct. - private ListOperationsResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + private ListOperationsResponse(com.google.protobuf.GeneratedMessage.Builder builder) { super(builder); } private ListOperationsResponse() { operations_ = java.util.Collections.emptyList(); nextPageToken_ = ""; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new ListOperationsResponse(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; + unreachable_ = com.google.protobuf.LazyStringArrayList.emptyList(); } public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { @@ -59,7 +64,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.longrunning.OperationsProto .internal_static_google_longrunning_ListOperationsResponse_fieldAccessorTable @@ -69,7 +74,10 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } public static final int OPERATIONS_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") private java.util.List operations_; + /** * * @@ -83,6 +91,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { public java.util.List getOperationsList() { return operations_; } + /** * * @@ -97,6 +106,7 @@ public java.util.List getOperationsList() { getOperationsOrBuilderList() { return operations_; } + /** * * @@ -110,6 +120,7 @@ public java.util.List getOperationsList() { public int getOperationsCount() { return operations_.size(); } + /** * * @@ -123,6 +134,7 @@ public int getOperationsCount() { public com.google.longrunning.Operation getOperations(int index) { return operations_.get(index); } + /** * * @@ -138,7 +150,10 @@ public com.google.longrunning.OperationOrBuilder getOperationsOrBuilder(int inde } public static final int NEXT_PAGE_TOKEN_FIELD_NUMBER = 2; - private volatile java.lang.Object nextPageToken_; + + @SuppressWarnings("serial") + private volatile java.lang.Object nextPageToken_ = ""; + /** * * @@ -162,6 +177,7 @@ public java.lang.String getNextPageToken() { return s; } } + /** * * @@ -186,6 +202,86 @@ public com.google.protobuf.ByteString getNextPageTokenBytes() { } } + public static final int UNREACHABLE_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private com.google.protobuf.LazyStringArrayList unreachable_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + + /** + * + * + *
        +   * Unordered list. Unreachable resources. Populated when the request sets
        +   * `ListOperationsRequest.return_partial_success` and reads across
        +   * collections e.g. when attempting to list all resources across all supported
        +   * locations.
        +   * 
        + * + * repeated string unreachable = 3 [(.google.api.field_behavior) = UNORDERED_LIST]; + * + * @return A list containing the unreachable. + */ + public com.google.protobuf.ProtocolStringList getUnreachableList() { + return unreachable_; + } + + /** + * + * + *
        +   * Unordered list. Unreachable resources. Populated when the request sets
        +   * `ListOperationsRequest.return_partial_success` and reads across
        +   * collections e.g. when attempting to list all resources across all supported
        +   * locations.
        +   * 
        + * + * repeated string unreachable = 3 [(.google.api.field_behavior) = UNORDERED_LIST]; + * + * @return The count of unreachable. + */ + public int getUnreachableCount() { + return unreachable_.size(); + } + + /** + * + * + *
        +   * Unordered list. Unreachable resources. Populated when the request sets
        +   * `ListOperationsRequest.return_partial_success` and reads across
        +   * collections e.g. when attempting to list all resources across all supported
        +   * locations.
        +   * 
        + * + * repeated string unreachable = 3 [(.google.api.field_behavior) = UNORDERED_LIST]; + * + * @param index The index of the element to return. + * @return The unreachable at the given index. + */ + public java.lang.String getUnreachable(int index) { + return unreachable_.get(index); + } + + /** + * + * + *
        +   * Unordered list. Unreachable resources. Populated when the request sets
        +   * `ListOperationsRequest.return_partial_success` and reads across
        +   * collections e.g. when attempting to list all resources across all supported
        +   * locations.
        +   * 
        + * + * repeated string unreachable = 3 [(.google.api.field_behavior) = UNORDERED_LIST]; + * + * @param index The index of the value to return. + * @return The bytes of the unreachable at the given index. + */ + public com.google.protobuf.ByteString getUnreachableBytes(int index) { + return unreachable_.getByteString(index); + } + private byte memoizedIsInitialized = -1; @java.lang.Override @@ -203,8 +299,11 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io for (int i = 0; i < operations_.size(); i++) { output.writeMessage(1, operations_.get(i)); } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nextPageToken_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 2, nextPageToken_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(nextPageToken_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, nextPageToken_); + } + for (int i = 0; i < unreachable_.size(); i++) { + com.google.protobuf.GeneratedMessage.writeString(output, 3, unreachable_.getRaw(i)); } getUnknownFields().writeTo(output); } @@ -218,8 +317,16 @@ public int getSerializedSize() { for (int i = 0; i < operations_.size(); i++) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, operations_.get(i)); } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nextPageToken_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, nextPageToken_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(nextPageToken_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, nextPageToken_); + } + { + int dataSize = 0; + for (int i = 0; i < unreachable_.size(); i++) { + dataSize += computeStringSizeNoTag(unreachable_.getRaw(i)); + } + size += dataSize; + size += 1 * getUnreachableList().size(); } size += getUnknownFields().getSerializedSize(); memoizedSize = size; @@ -239,6 +346,7 @@ public boolean equals(final java.lang.Object obj) { if (!getOperationsList().equals(other.getOperationsList())) return false; if (!getNextPageToken().equals(other.getNextPageToken())) return false; + if (!getUnreachableList().equals(other.getUnreachableList())) return false; if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -256,6 +364,10 @@ public int hashCode() { } hash = (37 * hash) + NEXT_PAGE_TOKEN_FIELD_NUMBER; hash = (53 * hash) + getNextPageToken().hashCode(); + if (getUnreachableCount() > 0) { + hash = (37 * hash) + UNREACHABLE_FIELD_NUMBER; + hash = (53 * hash) + getUnreachableList().hashCode(); + } hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; @@ -298,38 +410,38 @@ public static com.google.longrunning.ListOperationsResponse parseFrom( public static com.google.longrunning.ListOperationsResponse parseFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); } public static com.google.longrunning.ListOperationsResponse parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } public static com.google.longrunning.ListOperationsResponse parseDelimitedFrom( java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); } public static com.google.longrunning.ListOperationsResponse parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( PARSER, input, extensionRegistry); } public static com.google.longrunning.ListOperationsResponse parseFrom( com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); } public static com.google.longrunning.ListOperationsResponse parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } @@ -352,20 +464,22 @@ public Builder toBuilder() { } @java.lang.Override - protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { Builder builder = new Builder(parent); return builder; } + /** * * *
        -   * The response message for [Operations.ListOperations][google.longrunning.Operations.ListOperations].
        +   * The response message for
        +   * [Operations.ListOperations][google.longrunning.Operations.ListOperations].
            * 
        * * Protobuf type {@code google.longrunning.ListOperationsResponse} */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder implements // @@protoc_insertion_point(builder_implements:google.longrunning.ListOperationsResponse) com.google.longrunning.ListOperationsResponseOrBuilder { @@ -375,7 +489,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.longrunning.OperationsProto .internal_static_google_longrunning_ListOperationsResponse_fieldAccessorTable @@ -387,13 +501,14 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { // Construct using com.google.longrunning.ListOperationsResponse.newBuilder() private Builder() {} - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { super(parent); } @java.lang.Override public Builder clear() { super.clear(); + bitField0_ = 0; if (operationsBuilder_ == null) { operations_ = java.util.Collections.emptyList(); } else { @@ -402,7 +517,7 @@ public Builder clear() { } bitField0_ = (bitField0_ & ~0x00000001); nextPageToken_ = ""; - + unreachable_ = com.google.protobuf.LazyStringArrayList.emptyList(); return this; } @@ -430,7 +545,15 @@ public com.google.longrunning.ListOperationsResponse build() { public com.google.longrunning.ListOperationsResponse buildPartial() { com.google.longrunning.ListOperationsResponse result = new com.google.longrunning.ListOperationsResponse(this); - int from_bitField0_ = bitField0_; + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields(com.google.longrunning.ListOperationsResponse result) { if (operationsBuilder_ == null) { if (((bitField0_ & 0x00000001) != 0)) { operations_ = java.util.Collections.unmodifiableList(operations_); @@ -440,42 +563,17 @@ public com.google.longrunning.ListOperationsResponse buildPartial() { } else { result.operations_ = operationsBuilder_.build(); } - result.nextPageToken_ = nextPageToken_; - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.setField(field, value); - } - - @java.lang.Override - public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); } - @java.lang.Override - public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.addRepeatedField(field, value); + private void buildPartial0(com.google.longrunning.ListOperationsResponse result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.nextPageToken_ = nextPageToken_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + unreachable_.makeImmutable(); + result.unreachable_ = unreachable_; + } } @java.lang.Override @@ -509,8 +607,8 @@ public Builder mergeFrom(com.google.longrunning.ListOperationsResponse other) { operations_ = other.operations_; bitField0_ = (bitField0_ & ~0x00000001); operationsBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders - ? getOperationsFieldBuilder() + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders + ? internalGetOperationsFieldBuilder() : null; } else { operationsBuilder_.addAllMessages(other.operations_); @@ -519,6 +617,17 @@ public Builder mergeFrom(com.google.longrunning.ListOperationsResponse other) { } if (!other.getNextPageToken().isEmpty()) { nextPageToken_ = other.nextPageToken_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (!other.unreachable_.isEmpty()) { + if (unreachable_.isEmpty()) { + unreachable_ = other.unreachable_; + bitField0_ |= 0x00000004; + } else { + ensureUnreachableIsMutable(); + unreachable_.addAll(other.unreachable_); + } onChanged(); } this.mergeUnknownFields(other.getUnknownFields()); @@ -562,9 +671,16 @@ public Builder mergeFrom( case 18: { nextPageToken_ = input.readStringRequireUtf8(); - + bitField0_ |= 0x00000002; break; } // case 18 + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + ensureUnreachableIsMutable(); + unreachable_.add(s); + break; + } // case 26 default: { if (!super.parseUnknownField(input, extensionRegistry, tag)) { @@ -594,7 +710,7 @@ private void ensureOperationsIsMutable() { } } - private com.google.protobuf.RepeatedFieldBuilderV3< + private com.google.protobuf.RepeatedFieldBuilder< com.google.longrunning.Operation, com.google.longrunning.Operation.Builder, com.google.longrunning.OperationOrBuilder> @@ -616,6 +732,7 @@ public java.util.List getOperationsList() { return operationsBuilder_.getMessageList(); } } + /** * * @@ -632,6 +749,7 @@ public int getOperationsCount() { return operationsBuilder_.getCount(); } } + /** * * @@ -648,6 +766,7 @@ public com.google.longrunning.Operation getOperations(int index) { return operationsBuilder_.getMessage(index); } } + /** * * @@ -670,6 +789,7 @@ public Builder setOperations(int index, com.google.longrunning.Operation value) } return this; } + /** * * @@ -690,6 +810,7 @@ public Builder setOperations( } return this; } + /** * * @@ -712,6 +833,7 @@ public Builder addOperations(com.google.longrunning.Operation value) { } return this; } + /** * * @@ -734,6 +856,7 @@ public Builder addOperations(int index, com.google.longrunning.Operation value) } return this; } + /** * * @@ -753,6 +876,7 @@ public Builder addOperations(com.google.longrunning.Operation.Builder builderFor } return this; } + /** * * @@ -773,6 +897,7 @@ public Builder addOperations( } return this; } + /** * * @@ -793,6 +918,7 @@ public Builder addAllOperations( } return this; } + /** * * @@ -812,6 +938,7 @@ public Builder clearOperations() { } return this; } + /** * * @@ -831,6 +958,7 @@ public Builder removeOperations(int index) { } return this; } + /** * * @@ -841,8 +969,9 @@ public Builder removeOperations(int index) { * repeated .google.longrunning.Operation operations = 1; */ public com.google.longrunning.Operation.Builder getOperationsBuilder(int index) { - return getOperationsFieldBuilder().getBuilder(index); + return internalGetOperationsFieldBuilder().getBuilder(index); } + /** * * @@ -859,6 +988,7 @@ public com.google.longrunning.OperationOrBuilder getOperationsOrBuilder(int inde return operationsBuilder_.getMessageOrBuilder(index); } } + /** * * @@ -876,6 +1006,7 @@ public com.google.longrunning.OperationOrBuilder getOperationsOrBuilder(int inde return java.util.Collections.unmodifiableList(operations_); } } + /** * * @@ -886,9 +1017,10 @@ public com.google.longrunning.OperationOrBuilder getOperationsOrBuilder(int inde * repeated .google.longrunning.Operation operations = 1; */ public com.google.longrunning.Operation.Builder addOperationsBuilder() { - return getOperationsFieldBuilder() + return internalGetOperationsFieldBuilder() .addBuilder(com.google.longrunning.Operation.getDefaultInstance()); } + /** * * @@ -899,9 +1031,10 @@ public com.google.longrunning.Operation.Builder addOperationsBuilder() { * repeated .google.longrunning.Operation operations = 1; */ public com.google.longrunning.Operation.Builder addOperationsBuilder(int index) { - return getOperationsFieldBuilder() + return internalGetOperationsFieldBuilder() .addBuilder(index, com.google.longrunning.Operation.getDefaultInstance()); } + /** * * @@ -912,17 +1045,17 @@ public com.google.longrunning.Operation.Builder addOperationsBuilder(int index) * repeated .google.longrunning.Operation operations = 1; */ public java.util.List getOperationsBuilderList() { - return getOperationsFieldBuilder().getBuilderList(); + return internalGetOperationsFieldBuilder().getBuilderList(); } - private com.google.protobuf.RepeatedFieldBuilderV3< + private com.google.protobuf.RepeatedFieldBuilder< com.google.longrunning.Operation, com.google.longrunning.Operation.Builder, com.google.longrunning.OperationOrBuilder> - getOperationsFieldBuilder() { + internalGetOperationsFieldBuilder() { if (operationsBuilder_ == null) { operationsBuilder_ = - new com.google.protobuf.RepeatedFieldBuilderV3< + new com.google.protobuf.RepeatedFieldBuilder< com.google.longrunning.Operation, com.google.longrunning.Operation.Builder, com.google.longrunning.OperationOrBuilder>( @@ -933,6 +1066,7 @@ public java.util.List getOperationsBui } private java.lang.Object nextPageToken_ = ""; + /** * * @@ -955,6 +1089,7 @@ public java.lang.String getNextPageToken() { return (java.lang.String) ref; } } + /** * * @@ -977,6 +1112,7 @@ public com.google.protobuf.ByteString getNextPageTokenBytes() { return (com.google.protobuf.ByteString) ref; } } + /** * * @@ -993,11 +1129,12 @@ public Builder setNextPageToken(java.lang.String value) { if (value == null) { throw new NullPointerException(); } - nextPageToken_ = value; + bitField0_ |= 0x00000002; onChanged(); return this; } + /** * * @@ -1010,11 +1147,12 @@ public Builder setNextPageToken(java.lang.String value) { * @return This builder for chaining. */ public Builder clearNextPageToken() { - nextPageToken_ = getDefaultInstance().getNextPageToken(); + bitField0_ = (bitField0_ & ~0x00000002); onChanged(); return this; } + /** * * @@ -1032,21 +1170,220 @@ public Builder setNextPageTokenBytes(com.google.protobuf.ByteString value) { 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); + private com.google.protobuf.LazyStringArrayList unreachable_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + + private void ensureUnreachableIsMutable() { + if (!unreachable_.isModifiable()) { + unreachable_ = new com.google.protobuf.LazyStringArrayList(unreachable_); + } + bitField0_ |= 0x00000004; } - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); + /** + * + * + *
        +     * Unordered list. Unreachable resources. Populated when the request sets
        +     * `ListOperationsRequest.return_partial_success` and reads across
        +     * collections e.g. when attempting to list all resources across all supported
        +     * locations.
        +     * 
        + * + * repeated string unreachable = 3 [(.google.api.field_behavior) = UNORDERED_LIST]; + * + * @return A list containing the unreachable. + */ + public com.google.protobuf.ProtocolStringList getUnreachableList() { + unreachable_.makeImmutable(); + return unreachable_; + } + + /** + * + * + *
        +     * Unordered list. Unreachable resources. Populated when the request sets
        +     * `ListOperationsRequest.return_partial_success` and reads across
        +     * collections e.g. when attempting to list all resources across all supported
        +     * locations.
        +     * 
        + * + * repeated string unreachable = 3 [(.google.api.field_behavior) = UNORDERED_LIST]; + * + * @return The count of unreachable. + */ + public int getUnreachableCount() { + return unreachable_.size(); + } + + /** + * + * + *
        +     * Unordered list. Unreachable resources. Populated when the request sets
        +     * `ListOperationsRequest.return_partial_success` and reads across
        +     * collections e.g. when attempting to list all resources across all supported
        +     * locations.
        +     * 
        + * + * repeated string unreachable = 3 [(.google.api.field_behavior) = UNORDERED_LIST]; + * + * @param index The index of the element to return. + * @return The unreachable at the given index. + */ + public java.lang.String getUnreachable(int index) { + return unreachable_.get(index); + } + + /** + * + * + *
        +     * Unordered list. Unreachable resources. Populated when the request sets
        +     * `ListOperationsRequest.return_partial_success` and reads across
        +     * collections e.g. when attempting to list all resources across all supported
        +     * locations.
        +     * 
        + * + * repeated string unreachable = 3 [(.google.api.field_behavior) = UNORDERED_LIST]; + * + * @param index The index of the value to return. + * @return The bytes of the unreachable at the given index. + */ + public com.google.protobuf.ByteString getUnreachableBytes(int index) { + return unreachable_.getByteString(index); + } + + /** + * + * + *
        +     * Unordered list. Unreachable resources. Populated when the request sets
        +     * `ListOperationsRequest.return_partial_success` and reads across
        +     * collections e.g. when attempting to list all resources across all supported
        +     * locations.
        +     * 
        + * + * repeated string unreachable = 3 [(.google.api.field_behavior) = UNORDERED_LIST]; + * + * @param index The index to set the value at. + * @param value The unreachable to set. + * @return This builder for chaining. + */ + public Builder setUnreachable(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureUnreachableIsMutable(); + unreachable_.set(index, value); + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
        +     * Unordered list. Unreachable resources. Populated when the request sets
        +     * `ListOperationsRequest.return_partial_success` and reads across
        +     * collections e.g. when attempting to list all resources across all supported
        +     * locations.
        +     * 
        + * + * repeated string unreachable = 3 [(.google.api.field_behavior) = UNORDERED_LIST]; + * + * @param value The unreachable to add. + * @return This builder for chaining. + */ + public Builder addUnreachable(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureUnreachableIsMutable(); + unreachable_.add(value); + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
        +     * Unordered list. Unreachable resources. Populated when the request sets
        +     * `ListOperationsRequest.return_partial_success` and reads across
        +     * collections e.g. when attempting to list all resources across all supported
        +     * locations.
        +     * 
        + * + * repeated string unreachable = 3 [(.google.api.field_behavior) = UNORDERED_LIST]; + * + * @param values The unreachable to add. + * @return This builder for chaining. + */ + public Builder addAllUnreachable(java.lang.Iterable values) { + ensureUnreachableIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, unreachable_); + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
        +     * Unordered list. Unreachable resources. Populated when the request sets
        +     * `ListOperationsRequest.return_partial_success` and reads across
        +     * collections e.g. when attempting to list all resources across all supported
        +     * locations.
        +     * 
        + * + * repeated string unreachable = 3 [(.google.api.field_behavior) = UNORDERED_LIST]; + * + * @return This builder for chaining. + */ + public Builder clearUnreachable() { + unreachable_ = com.google.protobuf.LazyStringArrayList.emptyList(); + bitField0_ = (bitField0_ & ~0x00000004); + ; + onChanged(); + return this; + } + + /** + * + * + *
        +     * Unordered list. Unreachable resources. Populated when the request sets
        +     * `ListOperationsRequest.return_partial_success` and reads across
        +     * collections e.g. when attempting to list all resources across all supported
        +     * locations.
        +     * 
        + * + * repeated string unreachable = 3 [(.google.api.field_behavior) = UNORDERED_LIST]; + * + * @param value The bytes of the unreachable to add. + * @return This builder for chaining. + */ + public Builder addUnreachableBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureUnreachableIsMutable(); + unreachable_.add(value); + bitField0_ |= 0x00000004; + onChanged(); + return this; } // @@protoc_insertion_point(builder_scope:google.longrunning.ListOperationsResponse) diff --git a/java-common-protos/proto-google-common-protos/src/main/java/com/google/longrunning/ListOperationsResponseOrBuilder.java b/java-common-protos/proto-google-common-protos/src/main/java/com/google/longrunning/ListOperationsResponseOrBuilder.java index 405051b914..d8f0d5b375 100644 --- a/java-common-protos/proto-google-common-protos/src/main/java/com/google/longrunning/ListOperationsResponseOrBuilder.java +++ b/java-common-protos/proto-google-common-protos/src/main/java/com/google/longrunning/ListOperationsResponseOrBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,10 +14,13 @@ * limitations under the License. */ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: google/longrunning/operations.proto +// Protobuf Java Version: 4.33.2 package com.google.longrunning; +@com.google.protobuf.Generated public interface ListOperationsResponseOrBuilder extends // @@protoc_insertion_point(interface_extends:google.longrunning.ListOperationsResponse) @@ -33,6 +36,7 @@ public interface ListOperationsResponseOrBuilder * repeated .google.longrunning.Operation operations = 1; */ java.util.List getOperationsList(); + /** * * @@ -43,6 +47,7 @@ public interface ListOperationsResponseOrBuilder * repeated .google.longrunning.Operation operations = 1; */ com.google.longrunning.Operation getOperations(int index); + /** * * @@ -53,6 +58,7 @@ public interface ListOperationsResponseOrBuilder * repeated .google.longrunning.Operation operations = 1; */ int getOperationsCount(); + /** * * @@ -63,6 +69,7 @@ public interface ListOperationsResponseOrBuilder * repeated .google.longrunning.Operation operations = 1; */ java.util.List getOperationsOrBuilderList(); + /** * * @@ -86,6 +93,7 @@ public interface ListOperationsResponseOrBuilder * @return The nextPageToken. */ java.lang.String getNextPageToken(); + /** * * @@ -98,4 +106,70 @@ public interface ListOperationsResponseOrBuilder * @return The bytes for nextPageToken. */ com.google.protobuf.ByteString getNextPageTokenBytes(); + + /** + * + * + *
        +   * Unordered list. Unreachable resources. Populated when the request sets
        +   * `ListOperationsRequest.return_partial_success` and reads across
        +   * collections e.g. when attempting to list all resources across all supported
        +   * locations.
        +   * 
        + * + * repeated string unreachable = 3 [(.google.api.field_behavior) = UNORDERED_LIST]; + * + * @return A list containing the unreachable. + */ + java.util.List getUnreachableList(); + + /** + * + * + *
        +   * Unordered list. Unreachable resources. Populated when the request sets
        +   * `ListOperationsRequest.return_partial_success` and reads across
        +   * collections e.g. when attempting to list all resources across all supported
        +   * locations.
        +   * 
        + * + * repeated string unreachable = 3 [(.google.api.field_behavior) = UNORDERED_LIST]; + * + * @return The count of unreachable. + */ + int getUnreachableCount(); + + /** + * + * + *
        +   * Unordered list. Unreachable resources. Populated when the request sets
        +   * `ListOperationsRequest.return_partial_success` and reads across
        +   * collections e.g. when attempting to list all resources across all supported
        +   * locations.
        +   * 
        + * + * repeated string unreachable = 3 [(.google.api.field_behavior) = UNORDERED_LIST]; + * + * @param index The index of the element to return. + * @return The unreachable at the given index. + */ + java.lang.String getUnreachable(int index); + + /** + * + * + *
        +   * Unordered list. Unreachable resources. Populated when the request sets
        +   * `ListOperationsRequest.return_partial_success` and reads across
        +   * collections e.g. when attempting to list all resources across all supported
        +   * locations.
        +   * 
        + * + * repeated string unreachable = 3 [(.google.api.field_behavior) = UNORDERED_LIST]; + * + * @param index The index of the value to return. + * @return The bytes of the unreachable at the given index. + */ + com.google.protobuf.ByteString getUnreachableBytes(int index); } diff --git a/java-common-protos/proto-google-common-protos/src/main/java/com/google/longrunning/Operation.java b/java-common-protos/proto-google-common-protos/src/main/java/com/google/longrunning/Operation.java index 1f1601dabd..006ce854b3 100644 --- a/java-common-protos/proto-google-common-protos/src/main/java/com/google/longrunning/Operation.java +++ b/java-common-protos/proto-google-common-protos/src/main/java/com/google/longrunning/Operation.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,9 @@ * limitations under the License. */ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: google/longrunning/operations.proto +// Protobuf Java Version: 4.33.2 package com.google.longrunning; @@ -28,13 +30,25 @@ * * Protobuf type {@code google.longrunning.Operation} */ -public final class Operation extends com.google.protobuf.GeneratedMessageV3 +@com.google.protobuf.Generated +public final class Operation extends com.google.protobuf.GeneratedMessage implements // @@protoc_insertion_point(message_implements:google.longrunning.Operation) OperationOrBuilder { private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "Operation"); + } + // Use Operation.newBuilder() to construct. - private Operation(com.google.protobuf.GeneratedMessageV3.Builder builder) { + private Operation(com.google.protobuf.GeneratedMessage.Builder builder) { super(builder); } @@ -42,24 +56,13 @@ private Operation() { name_ = ""; } - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new Operation(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.longrunning.OperationsProto .internal_static_google_longrunning_Operation_descriptor; } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.longrunning.OperationsProto .internal_static_google_longrunning_Operation_fieldAccessorTable @@ -67,7 +70,10 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { com.google.longrunning.Operation.class, com.google.longrunning.Operation.Builder.class); } + private int bitField0_; private int resultCase_ = 0; + + @SuppressWarnings("serial") private java.lang.Object result_; public enum ResultCase @@ -82,6 +88,7 @@ public enum ResultCase private ResultCase(int value) { this.value = value; } + /** * @param value The number of the enum to look for. * @return The enum associated with the given number. @@ -115,7 +122,10 @@ public ResultCase getResultCase() { } public static final int NAME_FIELD_NUMBER = 1; - private volatile java.lang.Object name_; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** * * @@ -141,6 +151,7 @@ public java.lang.String getName() { return s; } } + /** * * @@ -169,6 +180,7 @@ public com.google.protobuf.ByteString getNameBytes() { public static final int METADATA_FIELD_NUMBER = 2; private com.google.protobuf.Any metadata_; + /** * * @@ -185,8 +197,9 @@ public com.google.protobuf.ByteString getNameBytes() { */ @java.lang.Override public boolean hasMetadata() { - return metadata_ != null; + return ((bitField0_ & 0x00000001) != 0); } + /** * * @@ -205,6 +218,7 @@ public boolean hasMetadata() { public com.google.protobuf.Any getMetadata() { return metadata_ == null ? com.google.protobuf.Any.getDefaultInstance() : metadata_; } + /** * * @@ -219,11 +233,12 @@ public com.google.protobuf.Any getMetadata() { */ @java.lang.Override public com.google.protobuf.AnyOrBuilder getMetadataOrBuilder() { - return getMetadata(); + return metadata_ == null ? com.google.protobuf.Any.getDefaultInstance() : metadata_; } public static final int DONE_FIELD_NUMBER = 3; - private boolean done_; + private boolean done_ = false; + /** * * @@ -243,6 +258,7 @@ public boolean getDone() { } public static final int ERROR_FIELD_NUMBER = 4; + /** * * @@ -258,6 +274,7 @@ public boolean getDone() { public boolean hasError() { return resultCase_ == 4; } + /** * * @@ -276,6 +293,7 @@ public com.google.rpc.Status getError() { } return com.google.rpc.Status.getDefaultInstance(); } + /** * * @@ -294,11 +312,12 @@ public com.google.rpc.StatusOrBuilder getErrorOrBuilder() { } public static final int RESPONSE_FIELD_NUMBER = 5; + /** * * *
        -   * The normal response of the operation in case of success.  If the original
        +   * The normal, successful response of the operation.  If the original
            * method returns no data on success, such as `Delete`, the response is
            * `google.protobuf.Empty`.  If the original method is standard
            * `Get`/`Create`/`Update`, the response should be the resource.  For other
        @@ -316,11 +335,12 @@ public com.google.rpc.StatusOrBuilder getErrorOrBuilder() {
           public boolean hasResponse() {
             return resultCase_ == 5;
           }
        +
           /**
            *
            *
            * 
        -   * The normal response of the operation in case of success.  If the original
        +   * The normal, successful response of the operation.  If the original
            * method returns no data on success, such as `Delete`, the response is
            * `google.protobuf.Empty`.  If the original method is standard
            * `Get`/`Create`/`Update`, the response should be the resource.  For other
        @@ -341,11 +361,12 @@ public com.google.protobuf.Any getResponse() {
             }
             return com.google.protobuf.Any.getDefaultInstance();
           }
        +
           /**
            *
            *
            * 
        -   * The normal response of the operation in case of success.  If the original
        +   * The normal, successful response of the operation.  If the original
            * method returns no data on success, such as `Delete`, the response is
            * `google.protobuf.Empty`.  If the original method is standard
            * `Get`/`Create`/`Update`, the response should be the resource.  For other
        @@ -379,10 +400,10 @@ public final boolean isInitialized() {
         
           @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.GeneratedMessage.isStringEmpty(name_)) {
        +      com.google.protobuf.GeneratedMessage.writeString(output, 1, name_);
             }
        -    if (metadata_ != null) {
        +    if (((bitField0_ & 0x00000001) != 0)) {
               output.writeMessage(2, getMetadata());
             }
             if (done_ != false) {
        @@ -403,10 +424,10 @@ public int getSerializedSize() {
             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.GeneratedMessage.isStringEmpty(name_)) {
        +      size += com.google.protobuf.GeneratedMessage.computeStringSize(1, name_);
             }
        -    if (metadata_ != null) {
        +    if (((bitField0_ & 0x00000001) != 0)) {
               size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getMetadata());
             }
             if (done_ != false) {
        @@ -526,38 +547,38 @@ public static com.google.longrunning.Operation parseFrom(
         
           public static com.google.longrunning.Operation parseFrom(java.io.InputStream input)
               throws java.io.IOException {
        -    return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
        +    return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input);
           }
         
           public static com.google.longrunning.Operation parseFrom(
               java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
               throws java.io.IOException {
        -    return com.google.protobuf.GeneratedMessageV3.parseWithIOException(
        +    return com.google.protobuf.GeneratedMessage.parseWithIOException(
                 PARSER, input, extensionRegistry);
           }
         
           public static com.google.longrunning.Operation parseDelimitedFrom(java.io.InputStream input)
               throws java.io.IOException {
        -    return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input);
        +    return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input);
           }
         
           public static com.google.longrunning.Operation parseDelimitedFrom(
               java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
               throws java.io.IOException {
        -    return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(
        +    return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(
                 PARSER, input, extensionRegistry);
           }
         
           public static com.google.longrunning.Operation parseFrom(
               com.google.protobuf.CodedInputStream input) throws java.io.IOException {
        -    return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
        +    return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input);
           }
         
           public static com.google.longrunning.Operation parseFrom(
               com.google.protobuf.CodedInputStream input,
               com.google.protobuf.ExtensionRegistryLite extensionRegistry)
               throws java.io.IOException {
        -    return com.google.protobuf.GeneratedMessageV3.parseWithIOException(
        +    return com.google.protobuf.GeneratedMessage.parseWithIOException(
                 PARSER, input, extensionRegistry);
           }
         
        @@ -580,10 +601,11 @@ public Builder toBuilder() {
           }
         
           @java.lang.Override
        -  protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
        +  protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) {
             Builder builder = new Builder(parent);
             return builder;
           }
        +
           /**
            *
            *
        @@ -594,7 +616,7 @@ protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.Build
            *
            * Protobuf type {@code google.longrunning.Operation}
            */
        -  public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder
        +  public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder
               implements
               // @@protoc_insertion_point(builder_implements:google.longrunning.Operation)
               com.google.longrunning.OperationOrBuilder {
        @@ -604,7 +626,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
             }
         
             @java.lang.Override
        -    protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
        +    protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
                 internalGetFieldAccessorTable() {
               return com.google.longrunning.OperationsProto
                   .internal_static_google_longrunning_Operation_fieldAccessorTable
        @@ -614,25 +636,32 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
             }
         
             // Construct using com.google.longrunning.Operation.newBuilder()
        -    private Builder() {}
        +    private Builder() {
        +      maybeForceBuilderInitialization();
        +    }
         
        -    private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
        +    private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) {
               super(parent);
        +      maybeForceBuilderInitialization();
        +    }
        +
        +    private void maybeForceBuilderInitialization() {
        +      if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) {
        +        internalGetMetadataFieldBuilder();
        +      }
             }
         
             @java.lang.Override
             public Builder clear() {
               super.clear();
        +      bitField0_ = 0;
               name_ = "";
        -
        -      if (metadataBuilder_ == null) {
        -        metadata_ = null;
        -      } else {
        -        metadata_ = null;
        +      metadata_ = null;
        +      if (metadataBuilder_ != null) {
        +        metadataBuilder_.dispose();
                 metadataBuilder_ = null;
               }
               done_ = false;
        -
               if (errorBuilder_ != null) {
                 errorBuilder_.clear();
               }
        @@ -667,63 +696,39 @@ public com.google.longrunning.Operation build() {
             @java.lang.Override
             public com.google.longrunning.Operation buildPartial() {
               com.google.longrunning.Operation result = new com.google.longrunning.Operation(this);
        -      result.name_ = name_;
        -      if (metadataBuilder_ == null) {
        -        result.metadata_ = metadata_;
        -      } else {
        -        result.metadata_ = metadataBuilder_.build();
        -      }
        -      result.done_ = done_;
        -      if (resultCase_ == 4) {
        -        if (errorBuilder_ == null) {
        -          result.result_ = result_;
        -        } else {
        -          result.result_ = errorBuilder_.build();
        -        }
        +      if (bitField0_ != 0) {
        +        buildPartial0(result);
               }
        -      if (resultCase_ == 5) {
        -        if (responseBuilder_ == null) {
        -          result.result_ = result_;
        -        } else {
        -          result.result_ = responseBuilder_.build();
        -        }
        -      }
        -      result.resultCase_ = resultCase_;
        +      buildPartialOneofs(result);
               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);
        +    private void buildPartial0(com.google.longrunning.Operation result) {
        +      int from_bitField0_ = bitField0_;
        +      if (((from_bitField0_ & 0x00000001) != 0)) {
        +        result.name_ = name_;
        +      }
        +      int to_bitField0_ = 0;
        +      if (((from_bitField0_ & 0x00000002) != 0)) {
        +        result.metadata_ = metadataBuilder_ == null ? metadata_ : metadataBuilder_.build();
        +        to_bitField0_ |= 0x00000001;
        +      }
        +      if (((from_bitField0_ & 0x00000004) != 0)) {
        +        result.done_ = done_;
        +      }
        +      result.bitField0_ |= to_bitField0_;
             }
         
        -    @java.lang.Override
        -    public Builder addRepeatedField(
        -        com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) {
        -      return super.addRepeatedField(field, value);
        +    private void buildPartialOneofs(com.google.longrunning.Operation result) {
        +      result.resultCase_ = resultCase_;
        +      result.result_ = this.result_;
        +      if (resultCase_ == 4 && errorBuilder_ != null) {
        +        result.result_ = errorBuilder_.build();
        +      }
        +      if (resultCase_ == 5 && responseBuilder_ != null) {
        +        result.result_ = responseBuilder_.build();
        +      }
             }
         
             @java.lang.Override
        @@ -740,6 +745,7 @@ public Builder mergeFrom(com.google.longrunning.Operation other) {
               if (other == com.google.longrunning.Operation.getDefaultInstance()) return this;
               if (!other.getName().isEmpty()) {
                 name_ = other.name_;
        +        bitField0_ |= 0x00000001;
                 onChanged();
               }
               if (other.hasMetadata()) {
        @@ -793,30 +799,32 @@ public Builder mergeFrom(
                     case 10:
                       {
                         name_ = input.readStringRequireUtf8();
        -
        +                bitField0_ |= 0x00000001;
                         break;
                       } // case 10
                     case 18:
                       {
        -                input.readMessage(getMetadataFieldBuilder().getBuilder(), extensionRegistry);
        -
        +                input.readMessage(
        +                    internalGetMetadataFieldBuilder().getBuilder(), extensionRegistry);
        +                bitField0_ |= 0x00000002;
                         break;
                       } // case 18
                     case 24:
                       {
                         done_ = input.readBool();
        -
        +                bitField0_ |= 0x00000004;
                         break;
                       } // case 24
                     case 34:
                       {
        -                input.readMessage(getErrorFieldBuilder().getBuilder(), extensionRegistry);
        +                input.readMessage(internalGetErrorFieldBuilder().getBuilder(), extensionRegistry);
                         resultCase_ = 4;
                         break;
                       } // case 34
                     case 42:
                       {
        -                input.readMessage(getResponseFieldBuilder().getBuilder(), extensionRegistry);
        +                input.readMessage(
        +                    internalGetResponseFieldBuilder().getBuilder(), extensionRegistry);
                         resultCase_ = 5;
                         break;
                       } // case 42
        @@ -851,7 +859,10 @@ public Builder clearResult() {
               return this;
             }
         
        +    private int bitField0_;
        +
             private java.lang.Object name_ = "";
        +
             /**
              *
              *
        @@ -876,6 +887,7 @@ public java.lang.String getName() {
                 return (java.lang.String) ref;
               }
             }
        +
             /**
              *
              *
        @@ -900,6 +912,7 @@ public com.google.protobuf.ByteString getNameBytes() {
                 return (com.google.protobuf.ByteString) ref;
               }
             }
        +
             /**
              *
              *
        @@ -918,11 +931,12 @@ public Builder setName(java.lang.String value) {
               if (value == null) {
                 throw new NullPointerException();
               }
        -
               name_ = value;
        +      bitField0_ |= 0x00000001;
               onChanged();
               return this;
             }
        +
             /**
              *
              *
        @@ -937,11 +951,12 @@ public Builder setName(java.lang.String value) {
              * @return This builder for chaining.
              */
             public Builder clearName() {
        -
               name_ = getDefaultInstance().getName();
        +      bitField0_ = (bitField0_ & ~0x00000001);
               onChanged();
               return this;
             }
        +
             /**
              *
              *
        @@ -961,18 +976,19 @@ public Builder setNameBytes(com.google.protobuf.ByteString value) {
                 throw new NullPointerException();
               }
               checkByteStringIsUtf8(value);
        -
               name_ = value;
        +      bitField0_ |= 0x00000001;
               onChanged();
               return this;
             }
         
             private com.google.protobuf.Any metadata_;
        -    private com.google.protobuf.SingleFieldBuilderV3<
        +    private com.google.protobuf.SingleFieldBuilder<
                     com.google.protobuf.Any,
                     com.google.protobuf.Any.Builder,
                     com.google.protobuf.AnyOrBuilder>
                 metadataBuilder_;
        +
             /**
              *
              *
        @@ -988,8 +1004,9 @@ public Builder setNameBytes(com.google.protobuf.ByteString value) {
              * @return Whether the metadata field is set.
              */
             public boolean hasMetadata() {
        -      return metadataBuilder_ != null || metadata_ != null;
        +      return ((bitField0_ & 0x00000002) != 0);
             }
        +
             /**
              *
              *
        @@ -1011,6 +1028,7 @@ public com.google.protobuf.Any getMetadata() {
                 return metadataBuilder_.getMessage();
               }
             }
        +
             /**
              *
              *
        @@ -1029,13 +1047,14 @@ public Builder setMetadata(com.google.protobuf.Any value) {
                   throw new NullPointerException();
                 }
                 metadata_ = value;
        -        onChanged();
               } else {
                 metadataBuilder_.setMessage(value);
               }
        -
        +      bitField0_ |= 0x00000002;
        +      onChanged();
               return this;
             }
        +
             /**
              *
              *
        @@ -1051,13 +1070,14 @@ public Builder setMetadata(com.google.protobuf.Any value) {
             public Builder setMetadata(com.google.protobuf.Any.Builder builderForValue) {
               if (metadataBuilder_ == null) {
                 metadata_ = builderForValue.build();
        -        onChanged();
               } else {
                 metadataBuilder_.setMessage(builderForValue.build());
               }
        -
        +      bitField0_ |= 0x00000002;
        +      onChanged();
               return this;
             }
        +
             /**
              *
              *
        @@ -1072,18 +1092,23 @@ public Builder setMetadata(com.google.protobuf.Any.Builder builderForValue) {
              */
             public Builder mergeMetadata(com.google.protobuf.Any value) {
               if (metadataBuilder_ == null) {
        -        if (metadata_ != null) {
        -          metadata_ = com.google.protobuf.Any.newBuilder(metadata_).mergeFrom(value).buildPartial();
        +        if (((bitField0_ & 0x00000002) != 0)
        +            && metadata_ != null
        +            && metadata_ != com.google.protobuf.Any.getDefaultInstance()) {
        +          getMetadataBuilder().mergeFrom(value);
                 } else {
                   metadata_ = value;
                 }
        -        onChanged();
               } else {
                 metadataBuilder_.mergeFrom(value);
               }
        -
        +      if (metadata_ != null) {
        +        bitField0_ |= 0x00000002;
        +        onChanged();
        +      }
               return this;
             }
        +
             /**
              *
              *
        @@ -1097,16 +1122,16 @@ public Builder mergeMetadata(com.google.protobuf.Any value) {
              * .google.protobuf.Any metadata = 2;
              */
             public Builder clearMetadata() {
        -      if (metadataBuilder_ == null) {
        -        metadata_ = null;
        -        onChanged();
        -      } else {
        -        metadata_ = null;
        +      bitField0_ = (bitField0_ & ~0x00000002);
        +      metadata_ = null;
        +      if (metadataBuilder_ != null) {
        +        metadataBuilder_.dispose();
                 metadataBuilder_ = null;
               }
        -
        +      onChanged();
               return this;
             }
        +
             /**
              *
              *
        @@ -1120,10 +1145,11 @@ public Builder clearMetadata() {
              * .google.protobuf.Any metadata = 2;
              */
             public com.google.protobuf.Any.Builder getMetadataBuilder() {
        -
        +      bitField0_ |= 0x00000002;
               onChanged();
        -      return getMetadataFieldBuilder().getBuilder();
        +      return internalGetMetadataFieldBuilder().getBuilder();
             }
        +
             /**
              *
              *
        @@ -1143,6 +1169,7 @@ public com.google.protobuf.AnyOrBuilder getMetadataOrBuilder() {
                 return metadata_ == null ? com.google.protobuf.Any.getDefaultInstance() : metadata_;
               }
             }
        +
             /**
              *
              *
        @@ -1155,14 +1182,14 @@ public com.google.protobuf.AnyOrBuilder getMetadataOrBuilder() {
              *
              * .google.protobuf.Any metadata = 2;
              */
        -    private com.google.protobuf.SingleFieldBuilderV3<
        +    private com.google.protobuf.SingleFieldBuilder<
                     com.google.protobuf.Any,
                     com.google.protobuf.Any.Builder,
                     com.google.protobuf.AnyOrBuilder>
        -        getMetadataFieldBuilder() {
        +        internalGetMetadataFieldBuilder() {
               if (metadataBuilder_ == null) {
                 metadataBuilder_ =
        -            new com.google.protobuf.SingleFieldBuilderV3<
        +            new com.google.protobuf.SingleFieldBuilder<
                         com.google.protobuf.Any,
                         com.google.protobuf.Any.Builder,
                         com.google.protobuf.AnyOrBuilder>(getMetadata(), getParentForChildren(), isClean());
        @@ -1172,6 +1199,7 @@ public com.google.protobuf.AnyOrBuilder getMetadataOrBuilder() {
             }
         
             private boolean done_;
        +
             /**
              *
              *
        @@ -1189,6 +1217,7 @@ public com.google.protobuf.AnyOrBuilder getMetadataOrBuilder() {
             public boolean getDone() {
               return done_;
             }
        +
             /**
              *
              *
        @@ -1206,9 +1235,11 @@ public boolean getDone() {
             public Builder setDone(boolean value) {
         
               done_ = value;
        +      bitField0_ |= 0x00000004;
               onChanged();
               return this;
             }
        +
             /**
              *
              *
        @@ -1223,15 +1254,16 @@ public Builder setDone(boolean value) {
              * @return This builder for chaining.
              */
             public Builder clearDone() {
        -
        +      bitField0_ = (bitField0_ & ~0x00000004);
               done_ = false;
               onChanged();
               return this;
             }
         
        -    private com.google.protobuf.SingleFieldBuilderV3<
        +    private com.google.protobuf.SingleFieldBuilder<
                     com.google.rpc.Status, com.google.rpc.Status.Builder, com.google.rpc.StatusOrBuilder>
                 errorBuilder_;
        +
             /**
              *
              *
        @@ -1247,6 +1279,7 @@ public Builder clearDone() {
             public boolean hasError() {
               return resultCase_ == 4;
             }
        +
             /**
              *
              *
        @@ -1272,6 +1305,7 @@ public com.google.rpc.Status getError() {
                 return com.google.rpc.Status.getDefaultInstance();
               }
             }
        +
             /**
              *
              *
        @@ -1294,6 +1328,7 @@ public Builder setError(com.google.rpc.Status value) {
               resultCase_ = 4;
               return this;
             }
        +
             /**
              *
              *
        @@ -1313,6 +1348,7 @@ public Builder setError(com.google.rpc.Status.Builder builderForValue) {
               resultCase_ = 4;
               return this;
             }
        +
             /**
              *
              *
        @@ -1343,6 +1379,7 @@ public Builder mergeError(com.google.rpc.Status value) {
               resultCase_ = 4;
               return this;
             }
        +
             /**
              *
              *
        @@ -1368,6 +1405,7 @@ public Builder clearError() {
               }
               return this;
             }
        +
             /**
              *
              *
        @@ -1378,8 +1416,9 @@ public Builder clearError() {
              * .google.rpc.Status error = 4;
              */
             public com.google.rpc.Status.Builder getErrorBuilder() {
        -      return getErrorFieldBuilder().getBuilder();
        +      return internalGetErrorFieldBuilder().getBuilder();
             }
        +
             /**
              *
              *
        @@ -1400,6 +1439,7 @@ public com.google.rpc.StatusOrBuilder getErrorOrBuilder() {
                 return com.google.rpc.Status.getDefaultInstance();
               }
             }
        +
             /**
              *
              *
        @@ -1409,15 +1449,15 @@ public com.google.rpc.StatusOrBuilder getErrorOrBuilder() {
              *
              * .google.rpc.Status error = 4;
              */
        -    private com.google.protobuf.SingleFieldBuilderV3<
        +    private com.google.protobuf.SingleFieldBuilder<
                     com.google.rpc.Status, com.google.rpc.Status.Builder, com.google.rpc.StatusOrBuilder>
        -        getErrorFieldBuilder() {
        +        internalGetErrorFieldBuilder() {
               if (errorBuilder_ == null) {
                 if (!(resultCase_ == 4)) {
                   result_ = com.google.rpc.Status.getDefaultInstance();
                 }
                 errorBuilder_ =
        -            new com.google.protobuf.SingleFieldBuilderV3<
        +            new com.google.protobuf.SingleFieldBuilder<
                         com.google.rpc.Status,
                         com.google.rpc.Status.Builder,
                         com.google.rpc.StatusOrBuilder>(
        @@ -1426,20 +1466,20 @@ public com.google.rpc.StatusOrBuilder getErrorOrBuilder() {
               }
               resultCase_ = 4;
               onChanged();
        -      ;
               return errorBuilder_;
             }
         
        -    private com.google.protobuf.SingleFieldBuilderV3<
        +    private com.google.protobuf.SingleFieldBuilder<
                     com.google.protobuf.Any,
                     com.google.protobuf.Any.Builder,
                     com.google.protobuf.AnyOrBuilder>
                 responseBuilder_;
        +
             /**
              *
              *
              * 
        -     * The normal response of the operation in case of success.  If the original
        +     * The normal, successful response of the operation.  If the original
              * method returns no data on success, such as `Delete`, the response is
              * `google.protobuf.Empty`.  If the original method is standard
              * `Get`/`Create`/`Update`, the response should be the resource.  For other
        @@ -1457,11 +1497,12 @@ public com.google.rpc.StatusOrBuilder getErrorOrBuilder() {
             public boolean hasResponse() {
               return resultCase_ == 5;
             }
        +
             /**
              *
              *
              * 
        -     * The normal response of the operation in case of success.  If the original
        +     * The normal, successful response of the operation.  If the original
              * method returns no data on success, such as `Delete`, the response is
              * `google.protobuf.Empty`.  If the original method is standard
              * `Get`/`Create`/`Update`, the response should be the resource.  For other
        @@ -1489,11 +1530,12 @@ public com.google.protobuf.Any getResponse() {
                 return com.google.protobuf.Any.getDefaultInstance();
               }
             }
        +
             /**
              *
              *
              * 
        -     * The normal response of the operation in case of success.  If the original
        +     * The normal, successful response of the operation.  If the original
              * method returns no data on success, such as `Delete`, the response is
              * `google.protobuf.Empty`.  If the original method is standard
              * `Get`/`Create`/`Update`, the response should be the resource.  For other
        @@ -1518,11 +1560,12 @@ public Builder setResponse(com.google.protobuf.Any value) {
               resultCase_ = 5;
               return this;
             }
        +
             /**
              *
              *
              * 
        -     * The normal response of the operation in case of success.  If the original
        +     * The normal, successful response of the operation.  If the original
              * method returns no data on success, such as `Delete`, the response is
              * `google.protobuf.Empty`.  If the original method is standard
              * `Get`/`Create`/`Update`, the response should be the resource.  For other
        @@ -1544,11 +1587,12 @@ public Builder setResponse(com.google.protobuf.Any.Builder builderForValue) {
               resultCase_ = 5;
               return this;
             }
        +
             /**
              *
              *
              * 
        -     * The normal response of the operation in case of success.  If the original
        +     * The normal, successful response of the operation.  If the original
              * method returns no data on success, such as `Delete`, the response is
              * `google.protobuf.Empty`.  If the original method is standard
              * `Get`/`Create`/`Update`, the response should be the resource.  For other
        @@ -1581,11 +1625,12 @@ public Builder mergeResponse(com.google.protobuf.Any value) {
               resultCase_ = 5;
               return this;
             }
        +
             /**
              *
              *
              * 
        -     * The normal response of the operation in case of success.  If the original
        +     * The normal, successful response of the operation.  If the original
              * method returns no data on success, such as `Delete`, the response is
              * `google.protobuf.Empty`.  If the original method is standard
              * `Get`/`Create`/`Update`, the response should be the resource.  For other
        @@ -1613,11 +1658,12 @@ public Builder clearResponse() {
               }
               return this;
             }
        +
             /**
              *
              *
              * 
        -     * The normal response of the operation in case of success.  If the original
        +     * The normal, successful response of the operation.  If the original
              * method returns no data on success, such as `Delete`, the response is
              * `google.protobuf.Empty`.  If the original method is standard
              * `Get`/`Create`/`Update`, the response should be the resource.  For other
        @@ -1630,13 +1676,14 @@ public Builder clearResponse() {
              * .google.protobuf.Any response = 5;
              */
             public com.google.protobuf.Any.Builder getResponseBuilder() {
        -      return getResponseFieldBuilder().getBuilder();
        +      return internalGetResponseFieldBuilder().getBuilder();
             }
        +
             /**
              *
              *
              * 
        -     * The normal response of the operation in case of success.  If the original
        +     * The normal, successful response of the operation.  If the original
              * method returns no data on success, such as `Delete`, the response is
              * `google.protobuf.Empty`.  If the original method is standard
              * `Get`/`Create`/`Update`, the response should be the resource.  For other
        @@ -1659,11 +1706,12 @@ public com.google.protobuf.AnyOrBuilder getResponseOrBuilder() {
                 return com.google.protobuf.Any.getDefaultInstance();
               }
             }
        +
             /**
              *
              *
              * 
        -     * The normal response of the operation in case of success.  If the original
        +     * The normal, successful response of the operation.  If the original
              * method returns no data on success, such as `Delete`, the response is
              * `google.protobuf.Empty`.  If the original method is standard
              * `Get`/`Create`/`Update`, the response should be the resource.  For other
        @@ -1675,17 +1723,17 @@ public com.google.protobuf.AnyOrBuilder getResponseOrBuilder() {
              *
              * .google.protobuf.Any response = 5;
              */
        -    private com.google.protobuf.SingleFieldBuilderV3<
        +    private com.google.protobuf.SingleFieldBuilder<
                     com.google.protobuf.Any,
                     com.google.protobuf.Any.Builder,
                     com.google.protobuf.AnyOrBuilder>
        -        getResponseFieldBuilder() {
        +        internalGetResponseFieldBuilder() {
               if (responseBuilder_ == null) {
                 if (!(resultCase_ == 5)) {
                   result_ = com.google.protobuf.Any.getDefaultInstance();
                 }
                 responseBuilder_ =
        -            new com.google.protobuf.SingleFieldBuilderV3<
        +            new com.google.protobuf.SingleFieldBuilder<
                         com.google.protobuf.Any,
                         com.google.protobuf.Any.Builder,
                         com.google.protobuf.AnyOrBuilder>(
        @@ -1694,21 +1742,9 @@ public com.google.protobuf.AnyOrBuilder getResponseOrBuilder() {
               }
               resultCase_ = 5;
               onChanged();
        -      ;
               return responseBuilder_;
             }
         
        -    @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.longrunning.Operation)
           }
         
        diff --git a/java-common-protos/proto-google-common-protos/src/main/java/com/google/longrunning/OperationInfo.java b/java-common-protos/proto-google-common-protos/src/main/java/com/google/longrunning/OperationInfo.java
        index d6511558c0..bcf27aaa88 100644
        --- a/java-common-protos/proto-google-common-protos/src/main/java/com/google/longrunning/OperationInfo.java
        +++ b/java-common-protos/proto-google-common-protos/src/main/java/com/google/longrunning/OperationInfo.java
        @@ -1,5 +1,5 @@
         /*
        - * Copyright 2020 Google LLC
        + * Copyright 2026 Google LLC
          *
          * Licensed under the Apache License, Version 2.0 (the "License");
          * you may not use this file except in compliance with the License.
        @@ -14,7 +14,9 @@
          * limitations under the License.
          */
         // Generated by the protocol buffer compiler.  DO NOT EDIT!
        +// NO CHECKED-IN PROTOBUF GENCODE
         // source: google/longrunning/operations.proto
        +// Protobuf Java Version: 4.33.2
         
         package com.google.longrunning;
         
        @@ -23,25 +25,38 @@
          *
          * 
          * A message representing the message types used by a long-running operation.
        + *
          * Example:
        - *   rpc LongRunningRecognize(LongRunningRecognizeRequest)
        - *       returns (google.longrunning.Operation) {
        - *     option (google.longrunning.operation_info) = {
        - *       response_type: "LongRunningRecognizeResponse"
        - *       metadata_type: "LongRunningRecognizeMetadata"
        - *     };
        - *   }
        + *
        + * rpc Export(ExportRequest) returns (google.longrunning.Operation) {
        + * option (google.longrunning.operation_info) = {
        + * response_type: "ExportResponse"
        + * metadata_type: "ExportMetadata"
        + * };
        + * }
          * 
        * * Protobuf type {@code google.longrunning.OperationInfo} */ -public final class OperationInfo extends com.google.protobuf.GeneratedMessageV3 +@com.google.protobuf.Generated +public final class OperationInfo extends com.google.protobuf.GeneratedMessage implements // @@protoc_insertion_point(message_implements:google.longrunning.OperationInfo) OperationInfoOrBuilder { private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "OperationInfo"); + } + // Use OperationInfo.newBuilder() to construct. - private OperationInfo(com.google.protobuf.GeneratedMessageV3.Builder builder) { + private OperationInfo(com.google.protobuf.GeneratedMessage.Builder builder) { super(builder); } @@ -50,24 +65,13 @@ private OperationInfo() { metadataType_ = ""; } - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new OperationInfo(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.longrunning.OperationsProto .internal_static_google_longrunning_OperationInfo_descriptor; } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.longrunning.OperationsProto .internal_static_google_longrunning_OperationInfo_fieldAccessorTable @@ -77,7 +81,10 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } public static final int RESPONSE_TYPE_FIELD_NUMBER = 1; - private volatile java.lang.Object responseType_; + + @SuppressWarnings("serial") + private volatile java.lang.Object responseType_ = ""; + /** * * @@ -85,8 +92,10 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { * Required. The message name of the primary return type for this * long-running operation. * This type will be used to deserialize the LRO's response. + * * If the response is in a different package from the rpc, a fully-qualified * message name must be used (e.g. `google.protobuf.Struct`). + * * Note: Altering this value constitutes a breaking change. *
        * @@ -106,6 +115,7 @@ public java.lang.String getResponseType() { return s; } } + /** * * @@ -113,8 +123,10 @@ public java.lang.String getResponseType() { * Required. The message name of the primary return type for this * long-running operation. * This type will be used to deserialize the LRO's response. + * * If the response is in a different package from the rpc, a fully-qualified * message name must be used (e.g. `google.protobuf.Struct`). + * * Note: Altering this value constitutes a breaking change. *
        * @@ -136,15 +148,20 @@ public com.google.protobuf.ByteString getResponseTypeBytes() { } public static final int METADATA_TYPE_FIELD_NUMBER = 2; - private volatile java.lang.Object metadataType_; + + @SuppressWarnings("serial") + private volatile java.lang.Object metadataType_ = ""; + /** * * *
            * Required. The message name of the metadata type for this long-running
            * operation.
        +   *
            * If the response is in a different package from the rpc, a fully-qualified
            * message name must be used (e.g. `google.protobuf.Struct`).
        +   *
            * Note: Altering this value constitutes a breaking change.
            * 
        * @@ -164,14 +181,17 @@ public java.lang.String getMetadataType() { return s; } } + /** * * *
            * Required. The message name of the metadata type for this long-running
            * operation.
        +   *
            * If the response is in a different package from the rpc, a fully-qualified
            * message name must be used (e.g. `google.protobuf.Struct`).
        +   *
            * Note: Altering this value constitutes a breaking change.
            * 
        * @@ -206,11 +226,11 @@ public final boolean isInitialized() { @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(responseType_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, responseType_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(responseType_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, responseType_); } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(metadataType_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 2, metadataType_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(metadataType_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, metadataType_); } getUnknownFields().writeTo(output); } @@ -221,11 +241,11 @@ public int getSerializedSize() { if (size != -1) return size; size = 0; - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(responseType_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, responseType_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(responseType_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, responseType_); } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(metadataType_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, metadataType_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(metadataType_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, metadataType_); } size += getUnknownFields().getSerializedSize(); memoizedSize = size; @@ -300,38 +320,38 @@ public static com.google.longrunning.OperationInfo parseFrom( public static com.google.longrunning.OperationInfo parseFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); } public static com.google.longrunning.OperationInfo parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } public static com.google.longrunning.OperationInfo parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); } public static com.google.longrunning.OperationInfo parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( PARSER, input, extensionRegistry); } public static com.google.longrunning.OperationInfo parseFrom( com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); } public static com.google.longrunning.OperationInfo parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } @@ -354,28 +374,30 @@ public Builder toBuilder() { } @java.lang.Override - protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { Builder builder = new Builder(parent); return builder; } + /** * * *
            * A message representing the message types used by a long-running operation.
        +   *
            * Example:
        -   *   rpc LongRunningRecognize(LongRunningRecognizeRequest)
        -   *       returns (google.longrunning.Operation) {
        -   *     option (google.longrunning.operation_info) = {
        -   *       response_type: "LongRunningRecognizeResponse"
        -   *       metadata_type: "LongRunningRecognizeMetadata"
        -   *     };
        -   *   }
        +   *
        +   * rpc Export(ExportRequest) returns (google.longrunning.Operation) {
        +   * option (google.longrunning.operation_info) = {
        +   * response_type: "ExportResponse"
        +   * metadata_type: "ExportMetadata"
        +   * };
        +   * }
            * 
        * * Protobuf type {@code google.longrunning.OperationInfo} */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder implements // @@protoc_insertion_point(builder_implements:google.longrunning.OperationInfo) com.google.longrunning.OperationInfoOrBuilder { @@ -385,7 +407,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.longrunning.OperationsProto .internal_static_google_longrunning_OperationInfo_fieldAccessorTable @@ -397,17 +419,16 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { // Construct using com.google.longrunning.OperationInfo.newBuilder() private Builder() {} - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { super(parent); } @java.lang.Override public Builder clear() { super.clear(); + bitField0_ = 0; responseType_ = ""; - metadataType_ = ""; - return this; } @@ -434,43 +455,21 @@ public com.google.longrunning.OperationInfo build() { @java.lang.Override public com.google.longrunning.OperationInfo buildPartial() { com.google.longrunning.OperationInfo result = new com.google.longrunning.OperationInfo(this); - result.responseType_ = responseType_; - result.metadataType_ = metadataType_; + if (bitField0_ != 0) { + buildPartial0(result); + } 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); + private void buildPartial0(com.google.longrunning.OperationInfo result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.responseType_ = responseType_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.metadataType_ = metadataType_; + } } @java.lang.Override @@ -487,10 +486,12 @@ public Builder mergeFrom(com.google.longrunning.OperationInfo other) { if (other == com.google.longrunning.OperationInfo.getDefaultInstance()) return this; if (!other.getResponseType().isEmpty()) { responseType_ = other.responseType_; + bitField0_ |= 0x00000001; onChanged(); } if (!other.getMetadataType().isEmpty()) { metadataType_ = other.metadataType_; + bitField0_ |= 0x00000002; onChanged(); } this.mergeUnknownFields(other.getUnknownFields()); @@ -522,13 +523,13 @@ public Builder mergeFrom( case 10: { responseType_ = input.readStringRequireUtf8(); - + bitField0_ |= 0x00000001; break; } // case 10 case 18: { metadataType_ = input.readStringRequireUtf8(); - + bitField0_ |= 0x00000002; break; } // case 18 default: @@ -548,7 +549,10 @@ public Builder mergeFrom( return this; } + private int bitField0_; + private java.lang.Object responseType_ = ""; + /** * * @@ -556,8 +560,10 @@ public Builder mergeFrom( * Required. The message name of the primary return type for this * long-running operation. * This type will be used to deserialize the LRO's response. + * * If the response is in a different package from the rpc, a fully-qualified * message name must be used (e.g. `google.protobuf.Struct`). + * * Note: Altering this value constitutes a breaking change. *
        * @@ -576,6 +582,7 @@ public java.lang.String getResponseType() { return (java.lang.String) ref; } } + /** * * @@ -583,8 +590,10 @@ public java.lang.String getResponseType() { * Required. The message name of the primary return type for this * long-running operation. * This type will be used to deserialize the LRO's response. + * * If the response is in a different package from the rpc, a fully-qualified * message name must be used (e.g. `google.protobuf.Struct`). + * * Note: Altering this value constitutes a breaking change. *
        * @@ -603,6 +612,7 @@ public com.google.protobuf.ByteString getResponseTypeBytes() { return (com.google.protobuf.ByteString) ref; } } + /** * * @@ -610,8 +620,10 @@ public com.google.protobuf.ByteString getResponseTypeBytes() { * Required. The message name of the primary return type for this * long-running operation. * This type will be used to deserialize the LRO's response. + * * If the response is in a different package from the rpc, a fully-qualified * message name must be used (e.g. `google.protobuf.Struct`). + * * Note: Altering this value constitutes a breaking change. *
        * @@ -624,11 +636,12 @@ public Builder setResponseType(java.lang.String value) { if (value == null) { throw new NullPointerException(); } - responseType_ = value; + bitField0_ |= 0x00000001; onChanged(); return this; } + /** * * @@ -636,8 +649,10 @@ public Builder setResponseType(java.lang.String value) { * Required. The message name of the primary return type for this * long-running operation. * This type will be used to deserialize the LRO's response. + * * If the response is in a different package from the rpc, a fully-qualified * message name must be used (e.g. `google.protobuf.Struct`). + * * Note: Altering this value constitutes a breaking change. *
        * @@ -646,11 +661,12 @@ public Builder setResponseType(java.lang.String value) { * @return This builder for chaining. */ public Builder clearResponseType() { - responseType_ = getDefaultInstance().getResponseType(); + bitField0_ = (bitField0_ & ~0x00000001); onChanged(); return this; } + /** * * @@ -658,8 +674,10 @@ public Builder clearResponseType() { * Required. The message name of the primary return type for this * long-running operation. * This type will be used to deserialize the LRO's response. + * * If the response is in a different package from the rpc, a fully-qualified * message name must be used (e.g. `google.protobuf.Struct`). + * * Note: Altering this value constitutes a breaking change. *
        * @@ -673,21 +691,24 @@ public Builder setResponseTypeBytes(com.google.protobuf.ByteString value) { throw new NullPointerException(); } checkByteStringIsUtf8(value); - responseType_ = value; + bitField0_ |= 0x00000001; onChanged(); return this; } private java.lang.Object metadataType_ = ""; + /** * * *
              * Required. The message name of the metadata type for this long-running
              * operation.
        +     *
              * If the response is in a different package from the rpc, a fully-qualified
              * message name must be used (e.g. `google.protobuf.Struct`).
        +     *
              * Note: Altering this value constitutes a breaking change.
              * 
        * @@ -706,14 +727,17 @@ public java.lang.String getMetadataType() { return (java.lang.String) ref; } } + /** * * *
              * Required. The message name of the metadata type for this long-running
              * operation.
        +     *
              * If the response is in a different package from the rpc, a fully-qualified
              * message name must be used (e.g. `google.protobuf.Struct`).
        +     *
              * Note: Altering this value constitutes a breaking change.
              * 
        * @@ -732,14 +756,17 @@ public com.google.protobuf.ByteString getMetadataTypeBytes() { return (com.google.protobuf.ByteString) ref; } } + /** * * *
              * Required. The message name of the metadata type for this long-running
              * operation.
        +     *
              * If the response is in a different package from the rpc, a fully-qualified
              * message name must be used (e.g. `google.protobuf.Struct`).
        +     *
              * Note: Altering this value constitutes a breaking change.
              * 
        * @@ -752,19 +779,22 @@ public Builder setMetadataType(java.lang.String value) { if (value == null) { throw new NullPointerException(); } - metadataType_ = value; + bitField0_ |= 0x00000002; onChanged(); return this; } + /** * * *
              * Required. The message name of the metadata type for this long-running
              * operation.
        +     *
              * If the response is in a different package from the rpc, a fully-qualified
              * message name must be used (e.g. `google.protobuf.Struct`).
        +     *
              * Note: Altering this value constitutes a breaking change.
              * 
        * @@ -773,19 +803,22 @@ public Builder setMetadataType(java.lang.String value) { * @return This builder for chaining. */ public Builder clearMetadataType() { - metadataType_ = getDefaultInstance().getMetadataType(); + bitField0_ = (bitField0_ & ~0x00000002); onChanged(); return this; } + /** * * *
              * Required. The message name of the metadata type for this long-running
              * operation.
        +     *
              * If the response is in a different package from the rpc, a fully-qualified
              * message name must be used (e.g. `google.protobuf.Struct`).
        +     *
              * Note: Altering this value constitutes a breaking change.
              * 
        * @@ -799,23 +832,12 @@ public Builder setMetadataTypeBytes(com.google.protobuf.ByteString value) { throw new NullPointerException(); } checkByteStringIsUtf8(value); - metadataType_ = 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.longrunning.OperationInfo) } diff --git a/java-common-protos/proto-google-common-protos/src/main/java/com/google/longrunning/OperationInfoOrBuilder.java b/java-common-protos/proto-google-common-protos/src/main/java/com/google/longrunning/OperationInfoOrBuilder.java index 2e65c6e69c..50014f018e 100644 --- a/java-common-protos/proto-google-common-protos/src/main/java/com/google/longrunning/OperationInfoOrBuilder.java +++ b/java-common-protos/proto-google-common-protos/src/main/java/com/google/longrunning/OperationInfoOrBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,10 +14,13 @@ * limitations under the License. */ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: google/longrunning/operations.proto +// Protobuf Java Version: 4.33.2 package com.google.longrunning; +@com.google.protobuf.Generated public interface OperationInfoOrBuilder extends // @@protoc_insertion_point(interface_extends:google.longrunning.OperationInfo) @@ -30,8 +33,10 @@ public interface OperationInfoOrBuilder * Required. The message name of the primary return type for this * long-running operation. * This type will be used to deserialize the LRO's response. + * * If the response is in a different package from the rpc, a fully-qualified * message name must be used (e.g. `google.protobuf.Struct`). + * * Note: Altering this value constitutes a breaking change. *
        * @@ -40,6 +45,7 @@ public interface OperationInfoOrBuilder * @return The responseType. */ java.lang.String getResponseType(); + /** * * @@ -47,8 +53,10 @@ public interface OperationInfoOrBuilder * Required. The message name of the primary return type for this * long-running operation. * This type will be used to deserialize the LRO's response. + * * If the response is in a different package from the rpc, a fully-qualified * message name must be used (e.g. `google.protobuf.Struct`). + * * Note: Altering this value constitutes a breaking change. *
        * @@ -64,8 +72,10 @@ public interface OperationInfoOrBuilder *
            * Required. The message name of the metadata type for this long-running
            * operation.
        +   *
            * If the response is in a different package from the rpc, a fully-qualified
            * message name must be used (e.g. `google.protobuf.Struct`).
        +   *
            * Note: Altering this value constitutes a breaking change.
            * 
        * @@ -74,14 +84,17 @@ public interface OperationInfoOrBuilder * @return The metadataType. */ java.lang.String getMetadataType(); + /** * * *
            * Required. The message name of the metadata type for this long-running
            * operation.
        +   *
            * If the response is in a different package from the rpc, a fully-qualified
            * message name must be used (e.g. `google.protobuf.Struct`).
        +   *
            * Note: Altering this value constitutes a breaking change.
            * 
        * diff --git a/java-common-protos/proto-google-common-protos/src/main/java/com/google/longrunning/OperationOrBuilder.java b/java-common-protos/proto-google-common-protos/src/main/java/com/google/longrunning/OperationOrBuilder.java index beb4b5e4d0..a315168885 100644 --- a/java-common-protos/proto-google-common-protos/src/main/java/com/google/longrunning/OperationOrBuilder.java +++ b/java-common-protos/proto-google-common-protos/src/main/java/com/google/longrunning/OperationOrBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,10 +14,13 @@ * limitations under the License. */ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: google/longrunning/operations.proto +// Protobuf Java Version: 4.33.2 package com.google.longrunning; +@com.google.protobuf.Generated public interface OperationOrBuilder extends // @@protoc_insertion_point(interface_extends:google.longrunning.Operation) @@ -37,6 +40,7 @@ public interface OperationOrBuilder * @return The name. */ java.lang.String getName(); + /** * * @@ -67,6 +71,7 @@ public interface OperationOrBuilder * @return Whether the metadata field is set. */ boolean hasMetadata(); + /** * * @@ -82,6 +87,7 @@ public interface OperationOrBuilder * @return The metadata. */ com.google.protobuf.Any getMetadata(); + /** * * @@ -123,6 +129,7 @@ public interface OperationOrBuilder * @return Whether the error field is set. */ boolean hasError(); + /** * * @@ -135,6 +142,7 @@ public interface OperationOrBuilder * @return The error. */ com.google.rpc.Status getError(); + /** * * @@ -150,7 +158,7 @@ public interface OperationOrBuilder * * *
        -   * The normal response of the operation in case of success.  If the original
        +   * The normal, successful response of the operation.  If the original
            * method returns no data on success, such as `Delete`, the response is
            * `google.protobuf.Empty`.  If the original method is standard
            * `Get`/`Create`/`Update`, the response should be the resource.  For other
        @@ -165,11 +173,12 @@ public interface OperationOrBuilder
            * @return Whether the response field is set.
            */
           boolean hasResponse();
        +
           /**
            *
            *
            * 
        -   * The normal response of the operation in case of success.  If the original
        +   * The normal, successful response of the operation.  If the original
            * method returns no data on success, such as `Delete`, the response is
            * `google.protobuf.Empty`.  If the original method is standard
            * `Get`/`Create`/`Update`, the response should be the resource.  For other
        @@ -184,11 +193,12 @@ public interface OperationOrBuilder
            * @return The response.
            */
           com.google.protobuf.Any getResponse();
        +
           /**
            *
            *
            * 
        -   * The normal response of the operation in case of success.  If the original
        +   * The normal, successful response of the operation.  If the original
            * method returns no data on success, such as `Delete`, the response is
            * `google.protobuf.Empty`.  If the original method is standard
            * `Get`/`Create`/`Update`, the response should be the resource.  For other
        @@ -202,5 +212,5 @@ public interface OperationOrBuilder
            */
           com.google.protobuf.AnyOrBuilder getResponseOrBuilder();
         
        -  public com.google.longrunning.Operation.ResultCase getResultCase();
        +  com.google.longrunning.Operation.ResultCase getResultCase();
         }
        diff --git a/java-common-protos/proto-google-common-protos/src/main/java/com/google/longrunning/OperationsProto.java b/java-common-protos/proto-google-common-protos/src/main/java/com/google/longrunning/OperationsProto.java
        index 010227c11c..5e90a61e40 100644
        --- a/java-common-protos/proto-google-common-protos/src/main/java/com/google/longrunning/OperationsProto.java
        +++ b/java-common-protos/proto-google-common-protos/src/main/java/com/google/longrunning/OperationsProto.java
        @@ -1,5 +1,5 @@
         /*
        - * Copyright 2020 Google LLC
        + * Copyright 2026 Google LLC
          *
          * Licensed under the Apache License, Version 2.0 (the "License");
          * you may not use this file except in compliance with the License.
        @@ -14,13 +14,26 @@
          * limitations under the License.
          */
         // Generated by the protocol buffer compiler.  DO NOT EDIT!
        +// NO CHECKED-IN PROTOBUF GENCODE
         // source: google/longrunning/operations.proto
        +// Protobuf Java Version: 4.33.2
         
         package com.google.longrunning;
         
        -public final class OperationsProto {
        +@com.google.protobuf.Generated
        +public final class OperationsProto extends com.google.protobuf.GeneratedFile {
           private OperationsProto() {}
         
        +  static {
        +    com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion(
        +        com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC,
        +        /* major= */ 4,
        +        /* minor= */ 33,
        +        /* patch= */ 2,
        +        /* suffix= */ "",
        +        "OperationsProto");
        +  }
        +
           public static void registerAllExtensions(com.google.protobuf.ExtensionRegistryLite registry) {
             registry.add(com.google.longrunning.OperationsProto.operationInfo);
           }
        @@ -30,6 +43,7 @@ public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry r
           }
         
           public static final int OPERATION_INFO_FIELD_NUMBER = 1049;
        +
           /**
            *
            *
        @@ -37,6 +51,7 @@ public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry r
            * Additional information regarding long-running operations.
            * In particular, this specifies the types that are returned from
            * long-running operations.
        +   *
            * Required for methods that return `google.longrunning.Operation`; invalid
            * otherwise.
            * 
        @@ -52,35 +67,35 @@ public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry r static final com.google.protobuf.Descriptors.Descriptor internal_static_google_longrunning_Operation_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable internal_static_google_longrunning_Operation_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_google_longrunning_GetOperationRequest_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable internal_static_google_longrunning_GetOperationRequest_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_google_longrunning_ListOperationsRequest_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable internal_static_google_longrunning_ListOperationsRequest_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_google_longrunning_ListOperationsResponse_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable internal_static_google_longrunning_ListOperationsResponse_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_google_longrunning_CancelOperationRequest_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable internal_static_google_longrunning_CancelOperationRequest_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_google_longrunning_DeleteOperationRequest_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable internal_static_google_longrunning_DeleteOperationRequest_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_google_longrunning_WaitOperationRequest_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable internal_static_google_longrunning_WaitOperationRequest_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_google_longrunning_OperationInfo_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable internal_static_google_longrunning_OperationInfo_fieldAccessorTable; public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { @@ -91,52 +106,61 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { static { java.lang.String[] descriptorData = { - "\n#google/longrunning/operations.proto\022\022g" + "\n" + + "#google/longrunning/operations.proto\022\022g" + "oogle.longrunning\032\034google/api/annotation" - + "s.proto\032\027google/api/client.proto\032\031google" - + "/protobuf/any.proto\032\036google/protobuf/dur" - + "ation.proto\032\033google/protobuf/empty.proto" - + "\032\027google/rpc/status.proto\032 google/protob" - + "uf/descriptor.proto\"\250\001\n\tOperation\022\014\n\004nam" - + "e\030\001 \001(\t\022&\n\010metadata\030\002 \001(\0132\024.google.proto" - + "buf.Any\022\014\n\004done\030\003 \001(\010\022#\n\005error\030\004 \001(\0132\022.g" - + "oogle.rpc.StatusH\000\022(\n\010response\030\005 \001(\0132\024.g" - + "oogle.protobuf.AnyH\000B\010\n\006result\"#\n\023GetOpe" - + "rationRequest\022\014\n\004name\030\001 \001(\t\"\\\n\025ListOpera" - + "tionsRequest\022\014\n\004name\030\004 \001(\t\022\016\n\006filter\030\001 \001" - + "(\t\022\021\n\tpage_size\030\002 \001(\005\022\022\n\npage_token\030\003 \001(" - + "\t\"d\n\026ListOperationsResponse\0221\n\noperation" - + "s\030\001 \003(\0132\035.google.longrunning.Operation\022\027" - + "\n\017next_page_token\030\002 \001(\t\"&\n\026CancelOperati" - + "onRequest\022\014\n\004name\030\001 \001(\t\"&\n\026DeleteOperati" - + "onRequest\022\014\n\004name\030\001 \001(\t\"P\n\024WaitOperation" - + "Request\022\014\n\004name\030\001 \001(\t\022*\n\007timeout\030\002 \001(\0132\031" - + ".google.protobuf.Duration\"=\n\rOperationIn" - + "fo\022\025\n\rresponse_type\030\001 \001(\t\022\025\n\rmetadata_ty" - + "pe\030\002 \001(\t2\252\005\n\nOperations\022\224\001\n\016ListOperatio" - + "ns\022).google.longrunning.ListOperationsRe" - + "quest\032*.google.longrunning.ListOperation" - + "sResponse\"+\202\323\344\223\002\027\022\025/v1/{name=operations}" - + "\332A\013name,filter\022\177\n\014GetOperation\022\'.google." - + "longrunning.GetOperationRequest\032\035.google" - + ".longrunning.Operation\"\'\202\323\344\223\002\032\022\030/v1/{nam" - + "e=operations/**}\332A\004name\022~\n\017DeleteOperati" - + "on\022*.google.longrunning.DeleteOperationR" - + "equest\032\026.google.protobuf.Empty\"\'\202\323\344\223\002\032*\030" - + "/v1/{name=operations/**}\332A\004name\022\210\001\n\017Canc" - + "elOperation\022*.google.longrunning.CancelO" - + "perationRequest\032\026.google.protobuf.Empty\"" - + "1\202\323\344\223\002$\"\037/v1/{name=operations/**}:cancel" - + ":\001*\332A\004name\022Z\n\rWaitOperation\022(.google.lon" - + "grunning.WaitOperationRequest\032\035.google.l" - + "ongrunning.Operation\"\000\032\035\312A\032longrunning.g" - + "oogleapis.com:Z\n\016operation_info\022\036.google" - + ".protobuf.MethodOptions\030\231\010 \001(\0132!.google." - + "longrunning.OperationInfoB\227\001\n\026com.google" - + ".longrunningB\017OperationsProtoP\001Z=google." - + "golang.org/genproto/googleapis/longrunni" - + "ng;longrunning\370\001\001\252\002\022Google.LongRunning\312\002" - + "\022Google\\LongRunningb\006proto3" + + "s.proto\032\027google/api/client.proto\032\037google" + + "/api/field_behavior.proto\032\031google/protobuf/any.proto\032" + + " google/protobuf/descriptor.proto\032\036google/protobuf/duration.proto\032\033" + + "google/protobuf/empty.proto\032\027google/rpc/status.proto\"\250\001\n" + + "\tOperation\022\014\n" + + "\004name\030\001 \001(\t\022&\n" + + "\010metadata\030\002 \001(\0132\024.google.protobuf.Any\022\014\n" + + "\004done\030\003 \001(\010\022#\n" + + "\005error\030\004 \001(\0132\022.google.rpc.StatusH\000\022(\n" + + "\010response\030\005 \001(\0132\024.google.protobuf.AnyH\000B\010\n" + + "\006result\"#\n" + + "\023GetOperationRequest\022\014\n" + + "\004name\030\001 \001(\t\"|\n" + + "\025ListOperationsRequest\022\014\n" + + "\004name\030\004 \001(\t\022\016\n" + + "\006filter\030\001 \001(\t\022\021\n" + + "\tpage_size\030\002 \001(\005\022\022\n\n" + + "page_token\030\003 \001(\t\022\036\n" + + "\026return_partial_success\030\005 \001(\010\"~\n" + + "\026ListOperationsResponse\0221\n\n" + + "operations\030\001 \003(\0132\035.google.longrunning.Operation\022\027\n" + + "\017next_page_token\030\002 \001(\t\022\030\n" + + "\013unreachable\030\003 \003(\tB\003\340A\006\"&\n" + + "\026CancelOperationRequest\022\014\n" + + "\004name\030\001 \001(\t\"&\n" + + "\026DeleteOperationRequest\022\014\n" + + "\004name\030\001 \001(\t\"P\n" + + "\024WaitOperationRequest\022\014\n" + + "\004name\030\001 \001(\t\022*\n" + + "\007timeout\030\002 \001(\0132\031.google.protobuf.Duration\"=\n\r" + + "OperationInfo\022\025\n\r" + + "response_type\030\001 \001(\t\022\025\n\r" + + "metadata_type\030\002 \001(\t2\252\005\n\n" + + "Operations\022\224\001\n" + + "\016ListOperations\022).google.longrunning.ListO" + + "perationsRequest\032*.google.longrunning.Li" + + "stOperationsResponse\"+\332A\013name,filter\202\323\344\223\002\027\022\025/v1/{name=operations}\022\177\n" + + "\014GetOperation\022\'.google.longrunning.GetOperationReque" + + "st\032\035.google.longrunning.Operation\"\'\332A\004name\202\323\344\223\002\032\022\030/v1/{name=operations/**}\022~\n" + + "\017DeleteOperation\022*.google.longrunning.Delet" + + "eOperationRequest\032\026.google.protobuf.Empt" + + "y\"\'\332A\004name\202\323\344\223\002\032*\030/v1/{name=operations/**}\022\210\001\n" + + "\017CancelOperation\022*.google.longrunning.CancelOperationRequest\032\026.google.prot" + + "obuf.Empty\"1\332A\004name\202\323\344\223\002$\"\037/v1/{name=operations/**}:cancel:\001*\022Z\n\r" + + "WaitOperation\022(.google.longrunning.WaitOperationRequest" + + "\032\035.google.longrunning.Operation\"\000\032\035\312A\032longrunning.googleapis.com:Z\n" + + "\016operation_info\022\036.google.protobuf.MethodOptions\030\231\010" + + " \001(\0132!.google.longrunning.OperationInfoB\242\001\n" + + "\026com.google.longrunningB\017OperationsProto" + + "P\001ZCcloud.google.com/go/longrunning/auto" + + "gen/longrunningpb;longrunningpb\242\002\005GLRUN\252" + + "\002\022Google.LongRunning\312\002\022Google\\LongRunningb\006proto3" }; descriptor = com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( @@ -144,91 +168,93 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { new com.google.protobuf.Descriptors.FileDescriptor[] { com.google.api.AnnotationsProto.getDescriptor(), com.google.api.ClientProto.getDescriptor(), + com.google.api.FieldBehaviorProto.getDescriptor(), com.google.protobuf.AnyProto.getDescriptor(), + com.google.protobuf.DescriptorProtos.getDescriptor(), com.google.protobuf.DurationProto.getDescriptor(), com.google.protobuf.EmptyProto.getDescriptor(), com.google.rpc.StatusProto.getDescriptor(), - com.google.protobuf.DescriptorProtos.getDescriptor(), }); - internal_static_google_longrunning_Operation_descriptor = - getDescriptor().getMessageTypes().get(0); + internal_static_google_longrunning_Operation_descriptor = getDescriptor().getMessageType(0); internal_static_google_longrunning_Operation_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_google_longrunning_Operation_descriptor, new java.lang.String[] { "Name", "Metadata", "Done", "Error", "Response", "Result", }); internal_static_google_longrunning_GetOperationRequest_descriptor = - getDescriptor().getMessageTypes().get(1); + getDescriptor().getMessageType(1); internal_static_google_longrunning_GetOperationRequest_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_google_longrunning_GetOperationRequest_descriptor, new java.lang.String[] { "Name", }); internal_static_google_longrunning_ListOperationsRequest_descriptor = - getDescriptor().getMessageTypes().get(2); + getDescriptor().getMessageType(2); internal_static_google_longrunning_ListOperationsRequest_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_google_longrunning_ListOperationsRequest_descriptor, new java.lang.String[] { - "Name", "Filter", "PageSize", "PageToken", + "Name", "Filter", "PageSize", "PageToken", "ReturnPartialSuccess", }); internal_static_google_longrunning_ListOperationsResponse_descriptor = - getDescriptor().getMessageTypes().get(3); + getDescriptor().getMessageType(3); internal_static_google_longrunning_ListOperationsResponse_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_google_longrunning_ListOperationsResponse_descriptor, new java.lang.String[] { - "Operations", "NextPageToken", + "Operations", "NextPageToken", "Unreachable", }); internal_static_google_longrunning_CancelOperationRequest_descriptor = - getDescriptor().getMessageTypes().get(4); + getDescriptor().getMessageType(4); internal_static_google_longrunning_CancelOperationRequest_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_google_longrunning_CancelOperationRequest_descriptor, new java.lang.String[] { "Name", }); internal_static_google_longrunning_DeleteOperationRequest_descriptor = - getDescriptor().getMessageTypes().get(5); + getDescriptor().getMessageType(5); internal_static_google_longrunning_DeleteOperationRequest_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_google_longrunning_DeleteOperationRequest_descriptor, new java.lang.String[] { "Name", }); internal_static_google_longrunning_WaitOperationRequest_descriptor = - getDescriptor().getMessageTypes().get(6); + getDescriptor().getMessageType(6); internal_static_google_longrunning_WaitOperationRequest_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_google_longrunning_WaitOperationRequest_descriptor, new java.lang.String[] { "Name", "Timeout", }); - internal_static_google_longrunning_OperationInfo_descriptor = - getDescriptor().getMessageTypes().get(7); + internal_static_google_longrunning_OperationInfo_descriptor = getDescriptor().getMessageType(7); internal_static_google_longrunning_OperationInfo_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_google_longrunning_OperationInfo_descriptor, new java.lang.String[] { "ResponseType", "MetadataType", }); - operationInfo.internalInit(descriptor.getExtensions().get(0)); + operationInfo.internalInit(descriptor.getExtension(0)); + descriptor.resolveAllFeaturesImmutable(); + com.google.api.AnnotationsProto.getDescriptor(); + com.google.api.ClientProto.getDescriptor(); + com.google.api.FieldBehaviorProto.getDescriptor(); + com.google.protobuf.AnyProto.getDescriptor(); + com.google.protobuf.DescriptorProtos.getDescriptor(); + com.google.protobuf.DurationProto.getDescriptor(); + com.google.protobuf.EmptyProto.getDescriptor(); + com.google.rpc.StatusProto.getDescriptor(); 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); com.google.protobuf.Descriptors.FileDescriptor.internalUpdateFileDescriptor( descriptor, registry); - com.google.api.AnnotationsProto.getDescriptor(); - com.google.api.ClientProto.getDescriptor(); - com.google.protobuf.AnyProto.getDescriptor(); - com.google.protobuf.DurationProto.getDescriptor(); - com.google.protobuf.EmptyProto.getDescriptor(); - com.google.rpc.StatusProto.getDescriptor(); - com.google.protobuf.DescriptorProtos.getDescriptor(); } // @@protoc_insertion_point(outer_class_scope) diff --git a/java-common-protos/proto-google-common-protos/src/main/java/com/google/longrunning/WaitOperationRequest.java b/java-common-protos/proto-google-common-protos/src/main/java/com/google/longrunning/WaitOperationRequest.java index 24e6006cbd..831233a719 100644 --- a/java-common-protos/proto-google-common-protos/src/main/java/com/google/longrunning/WaitOperationRequest.java +++ b/java-common-protos/proto-google-common-protos/src/main/java/com/google/longrunning/WaitOperationRequest.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,9 @@ * limitations under the License. */ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: google/longrunning/operations.proto +// Protobuf Java Version: 4.33.2 package com.google.longrunning; @@ -22,18 +24,31 @@ * * *
        - * The request message for [Operations.WaitOperation][google.longrunning.Operations.WaitOperation].
        + * The request message for
        + * [Operations.WaitOperation][google.longrunning.Operations.WaitOperation].
          * 
        * * Protobuf type {@code google.longrunning.WaitOperationRequest} */ -public final class WaitOperationRequest extends com.google.protobuf.GeneratedMessageV3 +@com.google.protobuf.Generated +public final class WaitOperationRequest extends com.google.protobuf.GeneratedMessage implements // @@protoc_insertion_point(message_implements:google.longrunning.WaitOperationRequest) WaitOperationRequestOrBuilder { private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "WaitOperationRequest"); + } + // Use WaitOperationRequest.newBuilder() to construct. - private WaitOperationRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + private WaitOperationRequest(com.google.protobuf.GeneratedMessage.Builder builder) { super(builder); } @@ -41,24 +56,13 @@ private WaitOperationRequest() { name_ = ""; } - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new WaitOperationRequest(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.longrunning.OperationsProto .internal_static_google_longrunning_WaitOperationRequest_descriptor; } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.longrunning.OperationsProto .internal_static_google_longrunning_WaitOperationRequest_fieldAccessorTable @@ -67,8 +71,12 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { com.google.longrunning.WaitOperationRequest.Builder.class); } + private int bitField0_; public static final int NAME_FIELD_NUMBER = 1; - private volatile java.lang.Object name_; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** * * @@ -92,6 +100,7 @@ public java.lang.String getName() { return s; } } + /** * * @@ -118,6 +127,7 @@ public com.google.protobuf.ByteString getNameBytes() { public static final int TIMEOUT_FIELD_NUMBER = 2; private com.google.protobuf.Duration timeout_; + /** * * @@ -133,8 +143,9 @@ public com.google.protobuf.ByteString getNameBytes() { */ @java.lang.Override public boolean hasTimeout() { - return timeout_ != null; + return ((bitField0_ & 0x00000001) != 0); } + /** * * @@ -152,6 +163,7 @@ public boolean hasTimeout() { public com.google.protobuf.Duration getTimeout() { return timeout_ == null ? com.google.protobuf.Duration.getDefaultInstance() : timeout_; } + /** * * @@ -165,7 +177,7 @@ public com.google.protobuf.Duration getTimeout() { */ @java.lang.Override public com.google.protobuf.DurationOrBuilder getTimeoutOrBuilder() { - return getTimeout(); + return timeout_ == null ? com.google.protobuf.Duration.getDefaultInstance() : timeout_; } private byte memoizedIsInitialized = -1; @@ -182,10 +194,10 @@ public final boolean isInitialized() { @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.GeneratedMessage.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, name_); } - if (timeout_ != null) { + if (((bitField0_ & 0x00000001) != 0)) { output.writeMessage(2, getTimeout()); } getUnknownFields().writeTo(output); @@ -197,10 +209,10 @@ public int getSerializedSize() { 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.GeneratedMessage.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, name_); } - if (timeout_ != null) { + if (((bitField0_ & 0x00000001) != 0)) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getTimeout()); } size += getUnknownFields().getSerializedSize(); @@ -283,38 +295,38 @@ public static com.google.longrunning.WaitOperationRequest parseFrom( public static com.google.longrunning.WaitOperationRequest parseFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); } public static com.google.longrunning.WaitOperationRequest parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } public static com.google.longrunning.WaitOperationRequest parseDelimitedFrom( java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); } public static com.google.longrunning.WaitOperationRequest parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( PARSER, input, extensionRegistry); } public static com.google.longrunning.WaitOperationRequest parseFrom( com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); } public static com.google.longrunning.WaitOperationRequest parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } @@ -337,20 +349,22 @@ public Builder toBuilder() { } @java.lang.Override - protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { Builder builder = new Builder(parent); return builder; } + /** * * *
        -   * The request message for [Operations.WaitOperation][google.longrunning.Operations.WaitOperation].
        +   * The request message for
        +   * [Operations.WaitOperation][google.longrunning.Operations.WaitOperation].
            * 
        * * Protobuf type {@code google.longrunning.WaitOperationRequest} */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder implements // @@protoc_insertion_point(builder_implements:google.longrunning.WaitOperationRequest) com.google.longrunning.WaitOperationRequestOrBuilder { @@ -360,7 +374,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.longrunning.OperationsProto .internal_static_google_longrunning_WaitOperationRequest_fieldAccessorTable @@ -370,21 +384,29 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } // Construct using com.google.longrunning.WaitOperationRequest.newBuilder() - private Builder() {} + private Builder() { + maybeForceBuilderInitialization(); + } - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetTimeoutFieldBuilder(); + } } @java.lang.Override public Builder clear() { super.clear(); + bitField0_ = 0; name_ = ""; - - if (timeoutBuilder_ == null) { - timeout_ = null; - } else { - timeout_ = null; + timeout_ = null; + if (timeoutBuilder_ != null) { + timeoutBuilder_.dispose(); timeoutBuilder_ = null; } return this; @@ -414,47 +436,24 @@ public com.google.longrunning.WaitOperationRequest build() { public com.google.longrunning.WaitOperationRequest buildPartial() { com.google.longrunning.WaitOperationRequest result = new com.google.longrunning.WaitOperationRequest(this); - result.name_ = name_; - if (timeoutBuilder_ == null) { - result.timeout_ = timeout_; - } else { - result.timeout_ = timeoutBuilder_.build(); + if (bitField0_ != 0) { + buildPartial0(result); } 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); + private void buildPartial0(com.google.longrunning.WaitOperationRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.timeout_ = timeoutBuilder_ == null ? timeout_ : timeoutBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + result.bitField0_ |= to_bitField0_; } @java.lang.Override @@ -471,6 +470,7 @@ public Builder mergeFrom(com.google.longrunning.WaitOperationRequest other) { if (other == com.google.longrunning.WaitOperationRequest.getDefaultInstance()) return this; if (!other.getName().isEmpty()) { name_ = other.name_; + bitField0_ |= 0x00000001; onChanged(); } if (other.hasTimeout()) { @@ -505,13 +505,13 @@ public Builder mergeFrom( case 10: { name_ = input.readStringRequireUtf8(); - + bitField0_ |= 0x00000001; break; } // case 10 case 18: { - input.readMessage(getTimeoutFieldBuilder().getBuilder(), extensionRegistry); - + input.readMessage(internalGetTimeoutFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; break; } // case 18 default: @@ -531,7 +531,10 @@ public Builder mergeFrom( return this; } + private int bitField0_; + private java.lang.Object name_ = ""; + /** * * @@ -554,6 +557,7 @@ public java.lang.String getName() { return (java.lang.String) ref; } } + /** * * @@ -576,6 +580,7 @@ public com.google.protobuf.ByteString getNameBytes() { return (com.google.protobuf.ByteString) ref; } } + /** * * @@ -592,11 +597,12 @@ public Builder setName(java.lang.String value) { if (value == null) { throw new NullPointerException(); } - name_ = value; + bitField0_ |= 0x00000001; onChanged(); return this; } + /** * * @@ -609,11 +615,12 @@ public Builder setName(java.lang.String value) { * @return This builder for chaining. */ public Builder clearName() { - name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); onChanged(); return this; } + /** * * @@ -631,18 +638,19 @@ public Builder setNameBytes(com.google.protobuf.ByteString value) { throw new NullPointerException(); } checkByteStringIsUtf8(value); - name_ = value; + bitField0_ |= 0x00000001; onChanged(); return this; } private com.google.protobuf.Duration timeout_; - private com.google.protobuf.SingleFieldBuilderV3< + private com.google.protobuf.SingleFieldBuilder< com.google.protobuf.Duration, com.google.protobuf.Duration.Builder, com.google.protobuf.DurationOrBuilder> timeoutBuilder_; + /** * * @@ -657,8 +665,9 @@ public Builder setNameBytes(com.google.protobuf.ByteString value) { * @return Whether the timeout field is set. */ public boolean hasTimeout() { - return timeoutBuilder_ != null || timeout_ != null; + return ((bitField0_ & 0x00000002) != 0); } + /** * * @@ -679,6 +688,7 @@ public com.google.protobuf.Duration getTimeout() { return timeoutBuilder_.getMessage(); } } + /** * * @@ -696,13 +706,14 @@ public Builder setTimeout(com.google.protobuf.Duration value) { throw new NullPointerException(); } timeout_ = value; - onChanged(); } else { timeoutBuilder_.setMessage(value); } - + bitField0_ |= 0x00000002; + onChanged(); return this; } + /** * * @@ -717,13 +728,14 @@ public Builder setTimeout(com.google.protobuf.Duration value) { public Builder setTimeout(com.google.protobuf.Duration.Builder builderForValue) { if (timeoutBuilder_ == null) { timeout_ = builderForValue.build(); - onChanged(); } else { timeoutBuilder_.setMessage(builderForValue.build()); } - + bitField0_ |= 0x00000002; + onChanged(); return this; } + /** * * @@ -737,19 +749,23 @@ public Builder setTimeout(com.google.protobuf.Duration.Builder builderForValue) */ public Builder mergeTimeout(com.google.protobuf.Duration value) { if (timeoutBuilder_ == null) { - if (timeout_ != null) { - timeout_ = - com.google.protobuf.Duration.newBuilder(timeout_).mergeFrom(value).buildPartial(); + if (((bitField0_ & 0x00000002) != 0) + && timeout_ != null + && timeout_ != com.google.protobuf.Duration.getDefaultInstance()) { + getTimeoutBuilder().mergeFrom(value); } else { timeout_ = value; } - onChanged(); } else { timeoutBuilder_.mergeFrom(value); } - + if (timeout_ != null) { + bitField0_ |= 0x00000002; + onChanged(); + } return this; } + /** * * @@ -762,16 +778,16 @@ public Builder mergeTimeout(com.google.protobuf.Duration value) { * .google.protobuf.Duration timeout = 2; */ public Builder clearTimeout() { - if (timeoutBuilder_ == null) { - timeout_ = null; - onChanged(); - } else { - timeout_ = null; + bitField0_ = (bitField0_ & ~0x00000002); + timeout_ = null; + if (timeoutBuilder_ != null) { + timeoutBuilder_.dispose(); timeoutBuilder_ = null; } - + onChanged(); return this; } + /** * * @@ -784,10 +800,11 @@ public Builder clearTimeout() { * .google.protobuf.Duration timeout = 2; */ public com.google.protobuf.Duration.Builder getTimeoutBuilder() { - + bitField0_ |= 0x00000002; onChanged(); - return getTimeoutFieldBuilder().getBuilder(); + return internalGetTimeoutFieldBuilder().getBuilder(); } + /** * * @@ -806,6 +823,7 @@ public com.google.protobuf.DurationOrBuilder getTimeoutOrBuilder() { return timeout_ == null ? com.google.protobuf.Duration.getDefaultInstance() : timeout_; } } + /** * * @@ -817,14 +835,14 @@ public com.google.protobuf.DurationOrBuilder getTimeoutOrBuilder() { * * .google.protobuf.Duration timeout = 2; */ - private com.google.protobuf.SingleFieldBuilderV3< + private com.google.protobuf.SingleFieldBuilder< com.google.protobuf.Duration, com.google.protobuf.Duration.Builder, com.google.protobuf.DurationOrBuilder> - getTimeoutFieldBuilder() { + internalGetTimeoutFieldBuilder() { if (timeoutBuilder_ == null) { timeoutBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< + new com.google.protobuf.SingleFieldBuilder< com.google.protobuf.Duration, com.google.protobuf.Duration.Builder, com.google.protobuf.DurationOrBuilder>( @@ -834,17 +852,6 @@ public com.google.protobuf.DurationOrBuilder getTimeoutOrBuilder() { return timeoutBuilder_; } - @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.longrunning.WaitOperationRequest) } diff --git a/java-common-protos/proto-google-common-protos/src/main/java/com/google/longrunning/WaitOperationRequestOrBuilder.java b/java-common-protos/proto-google-common-protos/src/main/java/com/google/longrunning/WaitOperationRequestOrBuilder.java index 4fe1f938b9..9f26e4acf5 100644 --- a/java-common-protos/proto-google-common-protos/src/main/java/com/google/longrunning/WaitOperationRequestOrBuilder.java +++ b/java-common-protos/proto-google-common-protos/src/main/java/com/google/longrunning/WaitOperationRequestOrBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,10 +14,13 @@ * limitations under the License. */ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: google/longrunning/operations.proto +// Protobuf Java Version: 4.33.2 package com.google.longrunning; +@com.google.protobuf.Generated public interface WaitOperationRequestOrBuilder extends // @@protoc_insertion_point(interface_extends:google.longrunning.WaitOperationRequest) @@ -35,6 +38,7 @@ public interface WaitOperationRequestOrBuilder * @return The name. */ java.lang.String getName(); + /** * * @@ -62,6 +66,7 @@ public interface WaitOperationRequestOrBuilder * @return Whether the timeout field is set. */ boolean hasTimeout(); + /** * * @@ -76,6 +81,7 @@ public interface WaitOperationRequestOrBuilder * @return The timeout. */ com.google.protobuf.Duration getTimeout(); + /** * * diff --git a/java-common-protos/proto-google-common-protos/src/main/java/com/google/rpc/BadRequest.java b/java-common-protos/proto-google-common-protos/src/main/java/com/google/rpc/BadRequest.java index d0e4ee071c..13c627c6d5 100644 --- a/java-common-protos/proto-google-common-protos/src/main/java/com/google/rpc/BadRequest.java +++ b/java-common-protos/proto-google-common-protos/src/main/java/com/google/rpc/BadRequest.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,9 @@ * limitations under the License. */ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: google/rpc/error_details.proto +// Protobuf Java Version: 4.33.2 package com.google.rpc; @@ -28,13 +30,25 @@ * * Protobuf type {@code google.rpc.BadRequest} */ -public final class BadRequest extends com.google.protobuf.GeneratedMessageV3 +@com.google.protobuf.Generated +public final class BadRequest extends com.google.protobuf.GeneratedMessage implements // @@protoc_insertion_point(message_implements:google.rpc.BadRequest) BadRequestOrBuilder { private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "BadRequest"); + } + // Use BadRequest.newBuilder() to construct. - private BadRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + private BadRequest(com.google.protobuf.GeneratedMessage.Builder builder) { super(builder); } @@ -42,23 +56,12 @@ private BadRequest() { fieldViolations_ = java.util.Collections.emptyList(); } - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new BadRequest(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.rpc.ErrorDetailsProto.internal_static_google_rpc_BadRequest_descriptor; } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.rpc.ErrorDetailsProto.internal_static_google_rpc_BadRequest_fieldAccessorTable .ensureFieldAccessorsInitialized( @@ -74,9 +77,43 @@ public interface FieldViolationOrBuilder * * *
        -     * A path leading to a field in the request body. The value will be a
        +     * A path that leads to a field in the request body. The value will be a
              * sequence of dot-separated identifiers that identify a protocol buffer
        -     * field. E.g., "field_violations.field" would identify this field.
        +     * field.
        +     *
        +     * Consider the following:
        +     *
        +     * message CreateContactRequest {
        +     * message EmailAddress {
        +     * enum Type {
        +     * TYPE_UNSPECIFIED = 0;
        +     * HOME = 1;
        +     * WORK = 2;
        +     * }
        +     *
        +     * optional string email = 1;
        +     * repeated EmailType type = 2;
        +     * }
        +     *
        +     * string full_name = 1;
        +     * repeated EmailAddress email_addresses = 2;
        +     * }
        +     *
        +     * In this example, in proto `field` could take one of the following values:
        +     *
        +     * * `full_name` for a violation in the `full_name` value
        +     * * `email_addresses[1].email` for a violation in the `email` field of the
        +     * first `email_addresses` message
        +     * * `email_addresses[3].type[2]` for a violation in the second `type`
        +     * value in the third `email_addresses` message.
        +     *
        +     * In JSON, the same values are represented as:
        +     *
        +     * * `fullName` for a violation in the `fullName` value
        +     * * `emailAddresses[1].email` for a violation in the `email` field of the
        +     * first `emailAddresses` message
        +     * * `emailAddresses[3].type[2]` for a violation in the second `type`
        +     * value in the third `emailAddresses` message.
              * 
        * * string field = 1; @@ -84,13 +121,48 @@ public interface FieldViolationOrBuilder * @return The field. */ java.lang.String getField(); + /** * * *
        -     * A path leading to a field in the request body. The value will be a
        +     * A path that leads to a field in the request body. The value will be a
              * sequence of dot-separated identifiers that identify a protocol buffer
        -     * field. E.g., "field_violations.field" would identify this field.
        +     * field.
        +     *
        +     * Consider the following:
        +     *
        +     * message CreateContactRequest {
        +     * message EmailAddress {
        +     * enum Type {
        +     * TYPE_UNSPECIFIED = 0;
        +     * HOME = 1;
        +     * WORK = 2;
        +     * }
        +     *
        +     * optional string email = 1;
        +     * repeated EmailType type = 2;
        +     * }
        +     *
        +     * string full_name = 1;
        +     * repeated EmailAddress email_addresses = 2;
        +     * }
        +     *
        +     * In this example, in proto `field` could take one of the following values:
        +     *
        +     * * `full_name` for a violation in the `full_name` value
        +     * * `email_addresses[1].email` for a violation in the `email` field of the
        +     * first `email_addresses` message
        +     * * `email_addresses[3].type[2]` for a violation in the second `type`
        +     * value in the third `email_addresses` message.
        +     *
        +     * In JSON, the same values are represented as:
        +     *
        +     * * `fullName` for a violation in the `fullName` value
        +     * * `emailAddresses[1].email` for a violation in the `email` field of the
        +     * first `emailAddresses` message
        +     * * `emailAddresses[3].type[2]` for a violation in the second `type`
        +     * value in the third `emailAddresses` message.
              * 
        * * string field = 1; @@ -111,6 +183,7 @@ public interface FieldViolationOrBuilder * @return The description. */ java.lang.String getDescription(); + /** * * @@ -123,7 +196,84 @@ public interface FieldViolationOrBuilder * @return The bytes for description. */ com.google.protobuf.ByteString getDescriptionBytes(); + + /** + * + * + *
        +     * The reason of the field-level error. This is a constant value that
        +     * identifies the proximate cause of the field-level error. It should
        +     * uniquely identify the type of the FieldViolation within the scope of the
        +     * google.rpc.ErrorInfo.domain. This should be at most 63
        +     * characters and match a regular expression of `[A-Z][A-Z0-9_]+[A-Z0-9]`,
        +     * which represents UPPER_SNAKE_CASE.
        +     * 
        + * + * string reason = 3; + * + * @return The reason. + */ + java.lang.String getReason(); + + /** + * + * + *
        +     * The reason of the field-level error. This is a constant value that
        +     * identifies the proximate cause of the field-level error. It should
        +     * uniquely identify the type of the FieldViolation within the scope of the
        +     * google.rpc.ErrorInfo.domain. This should be at most 63
        +     * characters and match a regular expression of `[A-Z][A-Z0-9_]+[A-Z0-9]`,
        +     * which represents UPPER_SNAKE_CASE.
        +     * 
        + * + * string reason = 3; + * + * @return The bytes for reason. + */ + com.google.protobuf.ByteString getReasonBytes(); + + /** + * + * + *
        +     * Provides a localized error message for field-level errors that is safe to
        +     * return to the API consumer.
        +     * 
        + * + * .google.rpc.LocalizedMessage localized_message = 4; + * + * @return Whether the localizedMessage field is set. + */ + boolean hasLocalizedMessage(); + + /** + * + * + *
        +     * Provides a localized error message for field-level errors that is safe to
        +     * return to the API consumer.
        +     * 
        + * + * .google.rpc.LocalizedMessage localized_message = 4; + * + * @return The localizedMessage. + */ + com.google.rpc.LocalizedMessage getLocalizedMessage(); + + /** + * + * + *
        +     * Provides a localized error message for field-level errors that is safe to
        +     * return to the API consumer.
        +     * 
        + * + * .google.rpc.LocalizedMessage localized_message = 4; + */ + com.google.rpc.LocalizedMessageOrBuilder getLocalizedMessageOrBuilder(); } + /** * * @@ -133,30 +283,31 @@ public interface FieldViolationOrBuilder * * Protobuf type {@code google.rpc.BadRequest.FieldViolation} */ - public static final class FieldViolation extends com.google.protobuf.GeneratedMessageV3 + public static final class FieldViolation extends com.google.protobuf.GeneratedMessage implements // @@protoc_insertion_point(message_implements:google.rpc.BadRequest.FieldViolation) FieldViolationOrBuilder { private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "FieldViolation"); + } + // Use FieldViolation.newBuilder() to construct. - private FieldViolation(com.google.protobuf.GeneratedMessageV3.Builder builder) { + private FieldViolation(com.google.protobuf.GeneratedMessage.Builder builder) { super(builder); } private FieldViolation() { field_ = ""; description_ = ""; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new FieldViolation(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; + reason_ = ""; } public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { @@ -165,7 +316,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.rpc.ErrorDetailsProto .internal_static_google_rpc_BadRequest_FieldViolation_fieldAccessorTable @@ -174,15 +325,53 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { com.google.rpc.BadRequest.FieldViolation.Builder.class); } + private int bitField0_; public static final int FIELD_FIELD_NUMBER = 1; - private volatile java.lang.Object field_; + + @SuppressWarnings("serial") + private volatile java.lang.Object field_ = ""; + /** * * *
        -     * A path leading to a field in the request body. The value will be a
        +     * A path that leads to a field in the request body. The value will be a
              * sequence of dot-separated identifiers that identify a protocol buffer
        -     * field. E.g., "field_violations.field" would identify this field.
        +     * field.
        +     *
        +     * Consider the following:
        +     *
        +     * message CreateContactRequest {
        +     * message EmailAddress {
        +     * enum Type {
        +     * TYPE_UNSPECIFIED = 0;
        +     * HOME = 1;
        +     * WORK = 2;
        +     * }
        +     *
        +     * optional string email = 1;
        +     * repeated EmailType type = 2;
        +     * }
        +     *
        +     * string full_name = 1;
        +     * repeated EmailAddress email_addresses = 2;
        +     * }
        +     *
        +     * In this example, in proto `field` could take one of the following values:
        +     *
        +     * * `full_name` for a violation in the `full_name` value
        +     * * `email_addresses[1].email` for a violation in the `email` field of the
        +     * first `email_addresses` message
        +     * * `email_addresses[3].type[2]` for a violation in the second `type`
        +     * value in the third `email_addresses` message.
        +     *
        +     * In JSON, the same values are represented as:
        +     *
        +     * * `fullName` for a violation in the `fullName` value
        +     * * `emailAddresses[1].email` for a violation in the `email` field of the
        +     * first `emailAddresses` message
        +     * * `emailAddresses[3].type[2]` for a violation in the second `type`
        +     * value in the third `emailAddresses` message.
              * 
        * * string field = 1; @@ -201,13 +390,48 @@ public java.lang.String getField() { return s; } } + /** * * *
        -     * A path leading to a field in the request body. The value will be a
        +     * A path that leads to a field in the request body. The value will be a
              * sequence of dot-separated identifiers that identify a protocol buffer
        -     * field. E.g., "field_violations.field" would identify this field.
        +     * field.
        +     *
        +     * Consider the following:
        +     *
        +     * message CreateContactRequest {
        +     * message EmailAddress {
        +     * enum Type {
        +     * TYPE_UNSPECIFIED = 0;
        +     * HOME = 1;
        +     * WORK = 2;
        +     * }
        +     *
        +     * optional string email = 1;
        +     * repeated EmailType type = 2;
        +     * }
        +     *
        +     * string full_name = 1;
        +     * repeated EmailAddress email_addresses = 2;
        +     * }
        +     *
        +     * In this example, in proto `field` could take one of the following values:
        +     *
        +     * * `full_name` for a violation in the `full_name` value
        +     * * `email_addresses[1].email` for a violation in the `email` field of the
        +     * first `email_addresses` message
        +     * * `email_addresses[3].type[2]` for a violation in the second `type`
        +     * value in the third `email_addresses` message.
        +     *
        +     * In JSON, the same values are represented as:
        +     *
        +     * * `fullName` for a violation in the `fullName` value
        +     * * `emailAddresses[1].email` for a violation in the `email` field of the
        +     * first `emailAddresses` message
        +     * * `emailAddresses[3].type[2]` for a violation in the second `type`
        +     * value in the third `emailAddresses` message.
              * 
        * * string field = 1; @@ -228,7 +452,10 @@ public com.google.protobuf.ByteString getFieldBytes() { } public static final int DESCRIPTION_FIELD_NUMBER = 2; - private volatile java.lang.Object description_; + + @SuppressWarnings("serial") + private volatile java.lang.Object description_ = ""; + /** * * @@ -252,6 +479,7 @@ public java.lang.String getDescription() { return s; } } + /** * * @@ -276,6 +504,125 @@ public com.google.protobuf.ByteString getDescriptionBytes() { } } + public static final int REASON_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object reason_ = ""; + + /** + * + * + *
        +     * The reason of the field-level error. This is a constant value that
        +     * identifies the proximate cause of the field-level error. It should
        +     * uniquely identify the type of the FieldViolation within the scope of the
        +     * google.rpc.ErrorInfo.domain. This should be at most 63
        +     * characters and match a regular expression of `[A-Z][A-Z0-9_]+[A-Z0-9]`,
        +     * which represents UPPER_SNAKE_CASE.
        +     * 
        + * + * string reason = 3; + * + * @return The reason. + */ + @java.lang.Override + public java.lang.String getReason() { + java.lang.Object ref = reason_; + 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(); + reason_ = s; + return s; + } + } + + /** + * + * + *
        +     * The reason of the field-level error. This is a constant value that
        +     * identifies the proximate cause of the field-level error. It should
        +     * uniquely identify the type of the FieldViolation within the scope of the
        +     * google.rpc.ErrorInfo.domain. This should be at most 63
        +     * characters and match a regular expression of `[A-Z][A-Z0-9_]+[A-Z0-9]`,
        +     * which represents UPPER_SNAKE_CASE.
        +     * 
        + * + * string reason = 3; + * + * @return The bytes for reason. + */ + @java.lang.Override + public com.google.protobuf.ByteString getReasonBytes() { + java.lang.Object ref = reason_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + reason_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int LOCALIZED_MESSAGE_FIELD_NUMBER = 4; + private com.google.rpc.LocalizedMessage localizedMessage_; + + /** + * + * + *
        +     * Provides a localized error message for field-level errors that is safe to
        +     * return to the API consumer.
        +     * 
        + * + * .google.rpc.LocalizedMessage localized_message = 4; + * + * @return Whether the localizedMessage field is set. + */ + @java.lang.Override + public boolean hasLocalizedMessage() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
        +     * Provides a localized error message for field-level errors that is safe to
        +     * return to the API consumer.
        +     * 
        + * + * .google.rpc.LocalizedMessage localized_message = 4; + * + * @return The localizedMessage. + */ + @java.lang.Override + public com.google.rpc.LocalizedMessage getLocalizedMessage() { + return localizedMessage_ == null + ? com.google.rpc.LocalizedMessage.getDefaultInstance() + : localizedMessage_; + } + + /** + * + * + *
        +     * Provides a localized error message for field-level errors that is safe to
        +     * return to the API consumer.
        +     * 
        + * + * .google.rpc.LocalizedMessage localized_message = 4; + */ + @java.lang.Override + public com.google.rpc.LocalizedMessageOrBuilder getLocalizedMessageOrBuilder() { + return localizedMessage_ == null + ? com.google.rpc.LocalizedMessage.getDefaultInstance() + : localizedMessage_; + } + private byte memoizedIsInitialized = -1; @java.lang.Override @@ -290,11 +637,17 @@ public final boolean isInitialized() { @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(field_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, field_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(field_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, field_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(description_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, description_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(reason_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 3, reason_); } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(description_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 2, description_); + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(4, getLocalizedMessage()); } getUnknownFields().writeTo(output); } @@ -305,11 +658,17 @@ public int getSerializedSize() { if (size != -1) return size; size = 0; - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(field_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, field_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(field_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, field_); } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(description_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, description_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(description_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, description_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(reason_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(3, reason_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, getLocalizedMessage()); } size += getUnknownFields().getSerializedSize(); memoizedSize = size; @@ -329,6 +688,11 @@ public boolean equals(final java.lang.Object obj) { if (!getField().equals(other.getField())) return false; if (!getDescription().equals(other.getDescription())) return false; + if (!getReason().equals(other.getReason())) return false; + if (hasLocalizedMessage() != other.hasLocalizedMessage()) return false; + if (hasLocalizedMessage()) { + if (!getLocalizedMessage().equals(other.getLocalizedMessage())) return false; + } if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -344,6 +708,12 @@ public int hashCode() { hash = (53 * hash) + getField().hashCode(); hash = (37 * hash) + DESCRIPTION_FIELD_NUMBER; hash = (53 * hash) + getDescription().hashCode(); + hash = (37 * hash) + REASON_FIELD_NUMBER; + hash = (53 * hash) + getReason().hashCode(); + if (hasLocalizedMessage()) { + hash = (37 * hash) + LOCALIZED_MESSAGE_FIELD_NUMBER; + hash = (53 * hash) + getLocalizedMessage().hashCode(); + } hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; @@ -386,38 +756,38 @@ public static com.google.rpc.BadRequest.FieldViolation parseFrom( public static com.google.rpc.BadRequest.FieldViolation parseFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); } public static com.google.rpc.BadRequest.FieldViolation parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } public static com.google.rpc.BadRequest.FieldViolation parseDelimitedFrom( java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); } public static com.google.rpc.BadRequest.FieldViolation parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( PARSER, input, extensionRegistry); } public static com.google.rpc.BadRequest.FieldViolation parseFrom( com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); } public static com.google.rpc.BadRequest.FieldViolation parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } @@ -440,11 +810,11 @@ public Builder toBuilder() { } @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { Builder builder = new Builder(parent); return builder; } + /** * * @@ -454,8 +824,7 @@ protected Builder newBuilderForType( * * Protobuf type {@code google.rpc.BadRequest.FieldViolation} */ - public static final class Builder - extends com.google.protobuf.GeneratedMessageV3.Builder + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder implements // @@protoc_insertion_point(builder_implements:google.rpc.BadRequest.FieldViolation) com.google.rpc.BadRequest.FieldViolationOrBuilder { @@ -465,7 +834,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.rpc.ErrorDetailsProto .internal_static_google_rpc_BadRequest_FieldViolation_fieldAccessorTable @@ -475,19 +844,33 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } // Construct using com.google.rpc.BadRequest.FieldViolation.newBuilder() - private Builder() {} + private Builder() { + maybeForceBuilderInitialization(); + } - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetLocalizedMessageFieldBuilder(); + } } @java.lang.Override public Builder clear() { super.clear(); + bitField0_ = 0; field_ = ""; - description_ = ""; - + reason_ = ""; + localizedMessage_ = null; + if (localizedMessageBuilder_ != null) { + localizedMessageBuilder_.dispose(); + localizedMessageBuilder_ = null; + } return this; } @@ -515,45 +898,33 @@ public com.google.rpc.BadRequest.FieldViolation build() { public com.google.rpc.BadRequest.FieldViolation buildPartial() { com.google.rpc.BadRequest.FieldViolation result = new com.google.rpc.BadRequest.FieldViolation(this); - result.field_ = field_; - result.description_ = description_; + if (bitField0_ != 0) { + buildPartial0(result); + } 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); + private void buildPartial0(com.google.rpc.BadRequest.FieldViolation result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.field_ = field_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.description_ = description_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.reason_ = reason_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000008) != 0)) { + result.localizedMessage_ = + localizedMessageBuilder_ == null + ? localizedMessage_ + : localizedMessageBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + result.bitField0_ |= to_bitField0_; } @java.lang.Override @@ -570,12 +941,22 @@ public Builder mergeFrom(com.google.rpc.BadRequest.FieldViolation other) { if (other == com.google.rpc.BadRequest.FieldViolation.getDefaultInstance()) return this; if (!other.getField().isEmpty()) { field_ = other.field_; + bitField0_ |= 0x00000001; onChanged(); } if (!other.getDescription().isEmpty()) { description_ = other.description_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (!other.getReason().isEmpty()) { + reason_ = other.reason_; + bitField0_ |= 0x00000004; onChanged(); } + if (other.hasLocalizedMessage()) { + mergeLocalizedMessage(other.getLocalizedMessage()); + } this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; @@ -605,15 +986,28 @@ public Builder mergeFrom( case 10: { field_ = input.readStringRequireUtf8(); - + bitField0_ |= 0x00000001; break; } // case 10 case 18: { description_ = input.readStringRequireUtf8(); - + bitField0_ |= 0x00000002; break; } // case 18 + case 26: + { + reason_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 34: + { + input.readMessage( + internalGetLocalizedMessageFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000008; + break; + } // case 34 default: { if (!super.parseUnknownField(input, extensionRegistry, tag)) { @@ -631,238 +1025,747 @@ public Builder mergeFrom( return this; } - private java.lang.Object field_ = ""; + private int bitField0_; + + private java.lang.Object field_ = ""; + + /** + * + * + *
        +       * A path that leads to a field in the request body. The value will be a
        +       * sequence of dot-separated identifiers that identify a protocol buffer
        +       * field.
        +       *
        +       * Consider the following:
        +       *
        +       * message CreateContactRequest {
        +       * message EmailAddress {
        +       * enum Type {
        +       * TYPE_UNSPECIFIED = 0;
        +       * HOME = 1;
        +       * WORK = 2;
        +       * }
        +       *
        +       * optional string email = 1;
        +       * repeated EmailType type = 2;
        +       * }
        +       *
        +       * string full_name = 1;
        +       * repeated EmailAddress email_addresses = 2;
        +       * }
        +       *
        +       * In this example, in proto `field` could take one of the following values:
        +       *
        +       * * `full_name` for a violation in the `full_name` value
        +       * * `email_addresses[1].email` for a violation in the `email` field of the
        +       * first `email_addresses` message
        +       * * `email_addresses[3].type[2]` for a violation in the second `type`
        +       * value in the third `email_addresses` message.
        +       *
        +       * In JSON, the same values are represented as:
        +       *
        +       * * `fullName` for a violation in the `fullName` value
        +       * * `emailAddresses[1].email` for a violation in the `email` field of the
        +       * first `emailAddresses` message
        +       * * `emailAddresses[3].type[2]` for a violation in the second `type`
        +       * value in the third `emailAddresses` message.
        +       * 
        + * + * string field = 1; + * + * @return The field. + */ + public java.lang.String getField() { + java.lang.Object ref = field_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + field_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
        +       * A path that leads to a field in the request body. The value will be a
        +       * sequence of dot-separated identifiers that identify a protocol buffer
        +       * field.
        +       *
        +       * Consider the following:
        +       *
        +       * message CreateContactRequest {
        +       * message EmailAddress {
        +       * enum Type {
        +       * TYPE_UNSPECIFIED = 0;
        +       * HOME = 1;
        +       * WORK = 2;
        +       * }
        +       *
        +       * optional string email = 1;
        +       * repeated EmailType type = 2;
        +       * }
        +       *
        +       * string full_name = 1;
        +       * repeated EmailAddress email_addresses = 2;
        +       * }
        +       *
        +       * In this example, in proto `field` could take one of the following values:
        +       *
        +       * * `full_name` for a violation in the `full_name` value
        +       * * `email_addresses[1].email` for a violation in the `email` field of the
        +       * first `email_addresses` message
        +       * * `email_addresses[3].type[2]` for a violation in the second `type`
        +       * value in the third `email_addresses` message.
        +       *
        +       * In JSON, the same values are represented as:
        +       *
        +       * * `fullName` for a violation in the `fullName` value
        +       * * `emailAddresses[1].email` for a violation in the `email` field of the
        +       * first `emailAddresses` message
        +       * * `emailAddresses[3].type[2]` for a violation in the second `type`
        +       * value in the third `emailAddresses` message.
        +       * 
        + * + * string field = 1; + * + * @return The bytes for field. + */ + public com.google.protobuf.ByteString getFieldBytes() { + java.lang.Object ref = field_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + field_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
        +       * A path that leads to a field in the request body. The value will be a
        +       * sequence of dot-separated identifiers that identify a protocol buffer
        +       * field.
        +       *
        +       * Consider the following:
        +       *
        +       * message CreateContactRequest {
        +       * message EmailAddress {
        +       * enum Type {
        +       * TYPE_UNSPECIFIED = 0;
        +       * HOME = 1;
        +       * WORK = 2;
        +       * }
        +       *
        +       * optional string email = 1;
        +       * repeated EmailType type = 2;
        +       * }
        +       *
        +       * string full_name = 1;
        +       * repeated EmailAddress email_addresses = 2;
        +       * }
        +       *
        +       * In this example, in proto `field` could take one of the following values:
        +       *
        +       * * `full_name` for a violation in the `full_name` value
        +       * * `email_addresses[1].email` for a violation in the `email` field of the
        +       * first `email_addresses` message
        +       * * `email_addresses[3].type[2]` for a violation in the second `type`
        +       * value in the third `email_addresses` message.
        +       *
        +       * In JSON, the same values are represented as:
        +       *
        +       * * `fullName` for a violation in the `fullName` value
        +       * * `emailAddresses[1].email` for a violation in the `email` field of the
        +       * first `emailAddresses` message
        +       * * `emailAddresses[3].type[2]` for a violation in the second `type`
        +       * value in the third `emailAddresses` message.
        +       * 
        + * + * string field = 1; + * + * @param value The field to set. + * @return This builder for chaining. + */ + public Builder setField(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + field_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
        +       * A path that leads to a field in the request body. The value will be a
        +       * sequence of dot-separated identifiers that identify a protocol buffer
        +       * field.
        +       *
        +       * Consider the following:
        +       *
        +       * message CreateContactRequest {
        +       * message EmailAddress {
        +       * enum Type {
        +       * TYPE_UNSPECIFIED = 0;
        +       * HOME = 1;
        +       * WORK = 2;
        +       * }
        +       *
        +       * optional string email = 1;
        +       * repeated EmailType type = 2;
        +       * }
        +       *
        +       * string full_name = 1;
        +       * repeated EmailAddress email_addresses = 2;
        +       * }
        +       *
        +       * In this example, in proto `field` could take one of the following values:
        +       *
        +       * * `full_name` for a violation in the `full_name` value
        +       * * `email_addresses[1].email` for a violation in the `email` field of the
        +       * first `email_addresses` message
        +       * * `email_addresses[3].type[2]` for a violation in the second `type`
        +       * value in the third `email_addresses` message.
        +       *
        +       * In JSON, the same values are represented as:
        +       *
        +       * * `fullName` for a violation in the `fullName` value
        +       * * `emailAddresses[1].email` for a violation in the `email` field of the
        +       * first `emailAddresses` message
        +       * * `emailAddresses[3].type[2]` for a violation in the second `type`
        +       * value in the third `emailAddresses` message.
        +       * 
        + * + * string field = 1; + * + * @return This builder for chaining. + */ + public Builder clearField() { + field_ = getDefaultInstance().getField(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
        +       * A path that leads to a field in the request body. The value will be a
        +       * sequence of dot-separated identifiers that identify a protocol buffer
        +       * field.
        +       *
        +       * Consider the following:
        +       *
        +       * message CreateContactRequest {
        +       * message EmailAddress {
        +       * enum Type {
        +       * TYPE_UNSPECIFIED = 0;
        +       * HOME = 1;
        +       * WORK = 2;
        +       * }
        +       *
        +       * optional string email = 1;
        +       * repeated EmailType type = 2;
        +       * }
        +       *
        +       * string full_name = 1;
        +       * repeated EmailAddress email_addresses = 2;
        +       * }
        +       *
        +       * In this example, in proto `field` could take one of the following values:
        +       *
        +       * * `full_name` for a violation in the `full_name` value
        +       * * `email_addresses[1].email` for a violation in the `email` field of the
        +       * first `email_addresses` message
        +       * * `email_addresses[3].type[2]` for a violation in the second `type`
        +       * value in the third `email_addresses` message.
        +       *
        +       * In JSON, the same values are represented as:
        +       *
        +       * * `fullName` for a violation in the `fullName` value
        +       * * `emailAddresses[1].email` for a violation in the `email` field of the
        +       * first `emailAddresses` message
        +       * * `emailAddresses[3].type[2]` for a violation in the second `type`
        +       * value in the third `emailAddresses` message.
        +       * 
        + * + * string field = 1; + * + * @param value The bytes for field to set. + * @return This builder for chaining. + */ + public Builder setFieldBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + field_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object description_ = ""; + /** * * *
        -       * A path leading to a field in the request body. The value will be a
        -       * sequence of dot-separated identifiers that identify a protocol buffer
        -       * field. E.g., "field_violations.field" would identify this field.
        +       * A description of why the request element is bad.
                * 
        * - * string field = 1; + * string description = 2; * - * @return The field. + * @return The description. */ - public java.lang.String getField() { - java.lang.Object ref = field_; + 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(); - field_ = s; + description_ = s; return s; } else { return (java.lang.String) ref; } } + /** * * *
        -       * A path leading to a field in the request body. The value will be a
        -       * sequence of dot-separated identifiers that identify a protocol buffer
        -       * field. E.g., "field_violations.field" would identify this field.
        +       * A description of why the request element is bad.
                * 
        * - * string field = 1; + * string description = 2; * - * @return The bytes for field. + * @return The bytes for description. */ - public com.google.protobuf.ByteString getFieldBytes() { - java.lang.Object ref = field_; + 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); - field_ = b; + description_ = b; return b; } else { return (com.google.protobuf.ByteString) ref; } } + /** * * *
        -       * A path leading to a field in the request body. The value will be a
        -       * sequence of dot-separated identifiers that identify a protocol buffer
        -       * field. E.g., "field_violations.field" would identify this field.
        +       * A description of why the request element is bad.
                * 
        * - * string field = 1; + * string description = 2; * - * @param value The field to set. + * @param value The description to set. * @return This builder for chaining. */ - public Builder setField(java.lang.String value) { + public Builder setDescription(java.lang.String value) { if (value == null) { throw new NullPointerException(); } - - field_ = value; + description_ = value; + bitField0_ |= 0x00000002; onChanged(); return this; } + /** * * *
        -       * A path leading to a field in the request body. The value will be a
        -       * sequence of dot-separated identifiers that identify a protocol buffer
        -       * field. E.g., "field_violations.field" would identify this field.
        +       * A description of why the request element is bad.
                * 
        * - * string field = 1; + * string description = 2; * * @return This builder for chaining. */ - public Builder clearField() { - - field_ = getDefaultInstance().getField(); + public Builder clearDescription() { + description_ = getDefaultInstance().getDescription(); + bitField0_ = (bitField0_ & ~0x00000002); onChanged(); return this; } + /** * * *
        -       * A path leading to a field in the request body. The value will be a
        -       * sequence of dot-separated identifiers that identify a protocol buffer
        -       * field. E.g., "field_violations.field" would identify this field.
        +       * A description of why the request element is bad.
                * 
        * - * string field = 1; + * string description = 2; * - * @param value The bytes for field to set. + * @param value The bytes for description to set. * @return This builder for chaining. */ - public Builder setFieldBytes(com.google.protobuf.ByteString value) { + public Builder setDescriptionBytes(com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); } checkByteStringIsUtf8(value); - - field_ = value; + description_ = value; + bitField0_ |= 0x00000002; onChanged(); return this; } - private java.lang.Object description_ = ""; + private java.lang.Object reason_ = ""; + /** * * *
        -       * A description of why the request element is bad.
        +       * The reason of the field-level error. This is a constant value that
        +       * identifies the proximate cause of the field-level error. It should
        +       * uniquely identify the type of the FieldViolation within the scope of the
        +       * google.rpc.ErrorInfo.domain. This should be at most 63
        +       * characters and match a regular expression of `[A-Z][A-Z0-9_]+[A-Z0-9]`,
        +       * which represents UPPER_SNAKE_CASE.
                * 
        * - * string description = 2; + * string reason = 3; * - * @return The description. + * @return The reason. */ - public java.lang.String getDescription() { - java.lang.Object ref = description_; + public java.lang.String getReason() { + java.lang.Object ref = reason_; if (!(ref instanceof java.lang.String)) { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; java.lang.String s = bs.toStringUtf8(); - description_ = s; + reason_ = s; return s; } else { return (java.lang.String) ref; } } + /** * * *
        -       * A description of why the request element is bad.
        +       * The reason of the field-level error. This is a constant value that
        +       * identifies the proximate cause of the field-level error. It should
        +       * uniquely identify the type of the FieldViolation within the scope of the
        +       * google.rpc.ErrorInfo.domain. This should be at most 63
        +       * characters and match a regular expression of `[A-Z][A-Z0-9_]+[A-Z0-9]`,
        +       * which represents UPPER_SNAKE_CASE.
                * 
        * - * string description = 2; + * string reason = 3; * - * @return The bytes for description. + * @return The bytes for reason. */ - public com.google.protobuf.ByteString getDescriptionBytes() { - java.lang.Object ref = description_; + public com.google.protobuf.ByteString getReasonBytes() { + java.lang.Object ref = reason_; if (ref instanceof String) { com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - description_ = b; + reason_ = b; return b; } else { return (com.google.protobuf.ByteString) ref; } } + /** * * *
        -       * A description of why the request element is bad.
        +       * The reason of the field-level error. This is a constant value that
        +       * identifies the proximate cause of the field-level error. It should
        +       * uniquely identify the type of the FieldViolation within the scope of the
        +       * google.rpc.ErrorInfo.domain. This should be at most 63
        +       * characters and match a regular expression of `[A-Z][A-Z0-9_]+[A-Z0-9]`,
        +       * which represents UPPER_SNAKE_CASE.
                * 
        * - * string description = 2; + * string reason = 3; * - * @param value The description to set. + * @param value The reason to set. * @return This builder for chaining. */ - public Builder setDescription(java.lang.String value) { + public Builder setReason(java.lang.String value) { if (value == null) { throw new NullPointerException(); } - - description_ = value; + reason_ = value; + bitField0_ |= 0x00000004; onChanged(); return this; } + /** * * *
        -       * A description of why the request element is bad.
        +       * The reason of the field-level error. This is a constant value that
        +       * identifies the proximate cause of the field-level error. It should
        +       * uniquely identify the type of the FieldViolation within the scope of the
        +       * google.rpc.ErrorInfo.domain. This should be at most 63
        +       * characters and match a regular expression of `[A-Z][A-Z0-9_]+[A-Z0-9]`,
        +       * which represents UPPER_SNAKE_CASE.
                * 
        * - * string description = 2; + * string reason = 3; * * @return This builder for chaining. */ - public Builder clearDescription() { - - description_ = getDefaultInstance().getDescription(); + public Builder clearReason() { + reason_ = getDefaultInstance().getReason(); + bitField0_ = (bitField0_ & ~0x00000004); onChanged(); return this; } + /** * * *
        -       * A description of why the request element is bad.
        +       * The reason of the field-level error. This is a constant value that
        +       * identifies the proximate cause of the field-level error. It should
        +       * uniquely identify the type of the FieldViolation within the scope of the
        +       * google.rpc.ErrorInfo.domain. This should be at most 63
        +       * characters and match a regular expression of `[A-Z][A-Z0-9_]+[A-Z0-9]`,
        +       * which represents UPPER_SNAKE_CASE.
                * 
        * - * string description = 2; + * string reason = 3; * - * @param value The bytes for description to set. + * @param value The bytes for reason to set. * @return This builder for chaining. */ - public Builder setDescriptionBytes(com.google.protobuf.ByteString value) { + public Builder setReasonBytes(com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); } checkByteStringIsUtf8(value); + reason_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } - description_ = value; + private com.google.rpc.LocalizedMessage localizedMessage_; + private com.google.protobuf.SingleFieldBuilder< + com.google.rpc.LocalizedMessage, + com.google.rpc.LocalizedMessage.Builder, + com.google.rpc.LocalizedMessageOrBuilder> + localizedMessageBuilder_; + + /** + * + * + *
        +       * Provides a localized error message for field-level errors that is safe to
        +       * return to the API consumer.
        +       * 
        + * + * .google.rpc.LocalizedMessage localized_message = 4; + * + * @return Whether the localizedMessage field is set. + */ + public boolean hasLocalizedMessage() { + return ((bitField0_ & 0x00000008) != 0); + } + + /** + * + * + *
        +       * Provides a localized error message for field-level errors that is safe to
        +       * return to the API consumer.
        +       * 
        + * + * .google.rpc.LocalizedMessage localized_message = 4; + * + * @return The localizedMessage. + */ + public com.google.rpc.LocalizedMessage getLocalizedMessage() { + if (localizedMessageBuilder_ == null) { + return localizedMessage_ == null + ? com.google.rpc.LocalizedMessage.getDefaultInstance() + : localizedMessage_; + } else { + return localizedMessageBuilder_.getMessage(); + } + } + + /** + * + * + *
        +       * Provides a localized error message for field-level errors that is safe to
        +       * return to the API consumer.
        +       * 
        + * + * .google.rpc.LocalizedMessage localized_message = 4; + */ + public Builder setLocalizedMessage(com.google.rpc.LocalizedMessage value) { + if (localizedMessageBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + localizedMessage_ = value; + } else { + localizedMessageBuilder_.setMessage(value); + } + bitField0_ |= 0x00000008; onChanged(); return this; } - @java.lang.Override - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); + /** + * + * + *
        +       * Provides a localized error message for field-level errors that is safe to
        +       * return to the API consumer.
        +       * 
        + * + * .google.rpc.LocalizedMessage localized_message = 4; + */ + public Builder setLocalizedMessage(com.google.rpc.LocalizedMessage.Builder builderForValue) { + if (localizedMessageBuilder_ == null) { + localizedMessage_ = builderForValue.build(); + } else { + localizedMessageBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; } - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); + /** + * + * + *
        +       * Provides a localized error message for field-level errors that is safe to
        +       * return to the API consumer.
        +       * 
        + * + * .google.rpc.LocalizedMessage localized_message = 4; + */ + public Builder mergeLocalizedMessage(com.google.rpc.LocalizedMessage value) { + if (localizedMessageBuilder_ == null) { + if (((bitField0_ & 0x00000008) != 0) + && localizedMessage_ != null + && localizedMessage_ != com.google.rpc.LocalizedMessage.getDefaultInstance()) { + getLocalizedMessageBuilder().mergeFrom(value); + } else { + localizedMessage_ = value; + } + } else { + localizedMessageBuilder_.mergeFrom(value); + } + if (localizedMessage_ != null) { + bitField0_ |= 0x00000008; + onChanged(); + } + return this; + } + + /** + * + * + *
        +       * Provides a localized error message for field-level errors that is safe to
        +       * return to the API consumer.
        +       * 
        + * + * .google.rpc.LocalizedMessage localized_message = 4; + */ + public Builder clearLocalizedMessage() { + bitField0_ = (bitField0_ & ~0x00000008); + localizedMessage_ = null; + if (localizedMessageBuilder_ != null) { + localizedMessageBuilder_.dispose(); + localizedMessageBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
        +       * Provides a localized error message for field-level errors that is safe to
        +       * return to the API consumer.
        +       * 
        + * + * .google.rpc.LocalizedMessage localized_message = 4; + */ + public com.google.rpc.LocalizedMessage.Builder getLocalizedMessageBuilder() { + bitField0_ |= 0x00000008; + onChanged(); + return internalGetLocalizedMessageFieldBuilder().getBuilder(); + } + + /** + * + * + *
        +       * Provides a localized error message for field-level errors that is safe to
        +       * return to the API consumer.
        +       * 
        + * + * .google.rpc.LocalizedMessage localized_message = 4; + */ + public com.google.rpc.LocalizedMessageOrBuilder getLocalizedMessageOrBuilder() { + if (localizedMessageBuilder_ != null) { + return localizedMessageBuilder_.getMessageOrBuilder(); + } else { + return localizedMessage_ == null + ? com.google.rpc.LocalizedMessage.getDefaultInstance() + : localizedMessage_; + } + } + + /** + * + * + *
        +       * Provides a localized error message for field-level errors that is safe to
        +       * return to the API consumer.
        +       * 
        + * + * .google.rpc.LocalizedMessage localized_message = 4; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.rpc.LocalizedMessage, + com.google.rpc.LocalizedMessage.Builder, + com.google.rpc.LocalizedMessageOrBuilder> + internalGetLocalizedMessageFieldBuilder() { + if (localizedMessageBuilder_ == null) { + localizedMessageBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.rpc.LocalizedMessage, + com.google.rpc.LocalizedMessage.Builder, + com.google.rpc.LocalizedMessageOrBuilder>( + getLocalizedMessage(), getParentForChildren(), isClean()); + localizedMessage_ = null; + } + return localizedMessageBuilder_; } // @@protoc_insertion_point(builder_scope:google.rpc.BadRequest.FieldViolation) @@ -918,7 +1821,10 @@ public com.google.rpc.BadRequest.FieldViolation getDefaultInstanceForType() { } public static final int FIELD_VIOLATIONS_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") private java.util.List fieldViolations_; + /** * * @@ -932,6 +1838,7 @@ public com.google.rpc.BadRequest.FieldViolation getDefaultInstanceForType() { public java.util.List getFieldViolationsList() { return fieldViolations_; } + /** * * @@ -946,6 +1853,7 @@ public java.util.List getFieldViolatio getFieldViolationsOrBuilderList() { return fieldViolations_; } + /** * * @@ -959,6 +1867,7 @@ public java.util.List getFieldViolatio public int getFieldViolationsCount() { return fieldViolations_.size(); } + /** * * @@ -972,6 +1881,7 @@ public int getFieldViolationsCount() { public com.google.rpc.BadRequest.FieldViolation getFieldViolations(int index) { return fieldViolations_.get(index); } + /** * * @@ -1087,38 +1997,38 @@ public static com.google.rpc.BadRequest parseFrom( public static com.google.rpc.BadRequest parseFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); } public static com.google.rpc.BadRequest parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } public static com.google.rpc.BadRequest parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); } public static com.google.rpc.BadRequest parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( PARSER, input, extensionRegistry); } public static com.google.rpc.BadRequest parseFrom(com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); } public static com.google.rpc.BadRequest parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } @@ -1141,10 +2051,11 @@ public Builder toBuilder() { } @java.lang.Override - protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { Builder builder = new Builder(parent); return builder; } + /** * * @@ -1155,7 +2066,7 @@ protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.Build * * Protobuf type {@code google.rpc.BadRequest} */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder implements // @@protoc_insertion_point(builder_implements:google.rpc.BadRequest) com.google.rpc.BadRequestOrBuilder { @@ -1164,7 +2075,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.rpc.ErrorDetailsProto .internal_static_google_rpc_BadRequest_fieldAccessorTable @@ -1175,13 +2086,14 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { // Construct using com.google.rpc.BadRequest.newBuilder() private Builder() {} - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { super(parent); } @java.lang.Override public Builder clear() { super.clear(); + bitField0_ = 0; if (fieldViolationsBuilder_ == null) { fieldViolations_ = java.util.Collections.emptyList(); } else { @@ -1214,7 +2126,15 @@ public com.google.rpc.BadRequest build() { @java.lang.Override public com.google.rpc.BadRequest buildPartial() { com.google.rpc.BadRequest result = new com.google.rpc.BadRequest(this); - int from_bitField0_ = bitField0_; + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields(com.google.rpc.BadRequest result) { if (fieldViolationsBuilder_ == null) { if (((bitField0_ & 0x00000001) != 0)) { fieldViolations_ = java.util.Collections.unmodifiableList(fieldViolations_); @@ -1224,41 +2144,10 @@ public com.google.rpc.BadRequest buildPartial() { } else { result.fieldViolations_ = fieldViolationsBuilder_.build(); } - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.setField(field, value); - } - - @java.lang.Override - public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - - @java.lang.Override - public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); } - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.addRepeatedField(field, value); + private void buildPartial0(com.google.rpc.BadRequest result) { + int from_bitField0_ = bitField0_; } @java.lang.Override @@ -1292,8 +2181,8 @@ public Builder mergeFrom(com.google.rpc.BadRequest other) { fieldViolations_ = other.fieldViolations_; bitField0_ = (bitField0_ & ~0x00000001); fieldViolationsBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders - ? getFieldViolationsFieldBuilder() + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders + ? internalGetFieldViolationsFieldBuilder() : null; } else { fieldViolationsBuilder_.addAllMessages(other.fieldViolations_); @@ -1369,7 +2258,7 @@ private void ensureFieldViolationsIsMutable() { } } - private com.google.protobuf.RepeatedFieldBuilderV3< + private com.google.protobuf.RepeatedFieldBuilder< com.google.rpc.BadRequest.FieldViolation, com.google.rpc.BadRequest.FieldViolation.Builder, com.google.rpc.BadRequest.FieldViolationOrBuilder> @@ -1391,6 +2280,7 @@ public java.util.List getFieldViolatio return fieldViolationsBuilder_.getMessageList(); } } + /** * * @@ -1407,6 +2297,7 @@ public int getFieldViolationsCount() { return fieldViolationsBuilder_.getCount(); } } + /** * * @@ -1423,6 +2314,7 @@ public com.google.rpc.BadRequest.FieldViolation getFieldViolations(int index) { return fieldViolationsBuilder_.getMessage(index); } } + /** * * @@ -1445,6 +2337,7 @@ public Builder setFieldViolations(int index, com.google.rpc.BadRequest.FieldViol } return this; } + /** * * @@ -1465,6 +2358,7 @@ public Builder setFieldViolations( } return this; } + /** * * @@ -1487,6 +2381,7 @@ public Builder addFieldViolations(com.google.rpc.BadRequest.FieldViolation value } return this; } + /** * * @@ -1509,6 +2404,7 @@ public Builder addFieldViolations(int index, com.google.rpc.BadRequest.FieldViol } return this; } + /** * * @@ -1529,6 +2425,7 @@ public Builder addFieldViolations( } return this; } + /** * * @@ -1549,6 +2446,7 @@ public Builder addFieldViolations( } return this; } + /** * * @@ -1569,6 +2467,7 @@ public Builder addAllFieldViolations( } return this; } + /** * * @@ -1588,6 +2487,7 @@ public Builder clearFieldViolations() { } return this; } + /** * * @@ -1607,6 +2507,7 @@ public Builder removeFieldViolations(int index) { } return this; } + /** * * @@ -1617,8 +2518,9 @@ public Builder removeFieldViolations(int index) { * repeated .google.rpc.BadRequest.FieldViolation field_violations = 1; */ public com.google.rpc.BadRequest.FieldViolation.Builder getFieldViolationsBuilder(int index) { - return getFieldViolationsFieldBuilder().getBuilder(index); + return internalGetFieldViolationsFieldBuilder().getBuilder(index); } + /** * * @@ -1636,6 +2538,7 @@ public com.google.rpc.BadRequest.FieldViolationOrBuilder getFieldViolationsOrBui return fieldViolationsBuilder_.getMessageOrBuilder(index); } } + /** * * @@ -1653,6 +2556,7 @@ public com.google.rpc.BadRequest.FieldViolationOrBuilder getFieldViolationsOrBui return java.util.Collections.unmodifiableList(fieldViolations_); } } + /** * * @@ -1663,9 +2567,10 @@ public com.google.rpc.BadRequest.FieldViolationOrBuilder getFieldViolationsOrBui * repeated .google.rpc.BadRequest.FieldViolation field_violations = 1; */ public com.google.rpc.BadRequest.FieldViolation.Builder addFieldViolationsBuilder() { - return getFieldViolationsFieldBuilder() + return internalGetFieldViolationsFieldBuilder() .addBuilder(com.google.rpc.BadRequest.FieldViolation.getDefaultInstance()); } + /** * * @@ -1676,9 +2581,10 @@ public com.google.rpc.BadRequest.FieldViolation.Builder addFieldViolationsBuilde * repeated .google.rpc.BadRequest.FieldViolation field_violations = 1; */ public com.google.rpc.BadRequest.FieldViolation.Builder addFieldViolationsBuilder(int index) { - return getFieldViolationsFieldBuilder() + return internalGetFieldViolationsFieldBuilder() .addBuilder(index, com.google.rpc.BadRequest.FieldViolation.getDefaultInstance()); } + /** * * @@ -1690,17 +2596,17 @@ public com.google.rpc.BadRequest.FieldViolation.Builder addFieldViolationsBuilde */ public java.util.List getFieldViolationsBuilderList() { - return getFieldViolationsFieldBuilder().getBuilderList(); + return internalGetFieldViolationsFieldBuilder().getBuilderList(); } - private com.google.protobuf.RepeatedFieldBuilderV3< + private com.google.protobuf.RepeatedFieldBuilder< com.google.rpc.BadRequest.FieldViolation, com.google.rpc.BadRequest.FieldViolation.Builder, com.google.rpc.BadRequest.FieldViolationOrBuilder> - getFieldViolationsFieldBuilder() { + internalGetFieldViolationsFieldBuilder() { if (fieldViolationsBuilder_ == null) { fieldViolationsBuilder_ = - new com.google.protobuf.RepeatedFieldBuilderV3< + new com.google.protobuf.RepeatedFieldBuilder< com.google.rpc.BadRequest.FieldViolation, com.google.rpc.BadRequest.FieldViolation.Builder, com.google.rpc.BadRequest.FieldViolationOrBuilder>( @@ -1713,17 +2619,6 @@ public com.google.rpc.BadRequest.FieldViolation.Builder addFieldViolationsBuilde return fieldViolationsBuilder_; } - @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.rpc.BadRequest) } diff --git a/java-common-protos/proto-google-common-protos/src/main/java/com/google/rpc/BadRequestOrBuilder.java b/java-common-protos/proto-google-common-protos/src/main/java/com/google/rpc/BadRequestOrBuilder.java index 46524361cc..d77e30ec34 100644 --- a/java-common-protos/proto-google-common-protos/src/main/java/com/google/rpc/BadRequestOrBuilder.java +++ b/java-common-protos/proto-google-common-protos/src/main/java/com/google/rpc/BadRequestOrBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,10 +14,13 @@ * limitations under the License. */ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: google/rpc/error_details.proto +// Protobuf Java Version: 4.33.2 package com.google.rpc; +@com.google.protobuf.Generated public interface BadRequestOrBuilder extends // @@protoc_insertion_point(interface_extends:google.rpc.BadRequest) @@ -33,6 +36,7 @@ public interface BadRequestOrBuilder * repeated .google.rpc.BadRequest.FieldViolation field_violations = 1; */ java.util.List getFieldViolationsList(); + /** * * @@ -43,6 +47,7 @@ public interface BadRequestOrBuilder * repeated .google.rpc.BadRequest.FieldViolation field_violations = 1; */ com.google.rpc.BadRequest.FieldViolation getFieldViolations(int index); + /** * * @@ -53,6 +58,7 @@ public interface BadRequestOrBuilder * repeated .google.rpc.BadRequest.FieldViolation field_violations = 1; */ int getFieldViolationsCount(); + /** * * @@ -64,6 +70,7 @@ public interface BadRequestOrBuilder */ java.util.List getFieldViolationsOrBuilderList(); + /** * * diff --git a/java-common-protos/proto-google-common-protos/src/main/java/com/google/rpc/Code.java b/java-common-protos/proto-google-common-protos/src/main/java/com/google/rpc/Code.java index e1c5d2e81d..9538325f70 100644 --- a/java-common-protos/proto-google-common-protos/src/main/java/com/google/rpc/Code.java +++ b/java-common-protos/proto-google-common-protos/src/main/java/com/google/rpc/Code.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,9 @@ * limitations under the License. */ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: google/rpc/code.proto +// Protobuf Java Version: 4.33.2 package com.google.rpc; @@ -23,6 +25,8 @@ * *
          * The canonical error codes for gRPC APIs.
        + *
        + *
          * Sometimes multiple error codes may apply.  Services should return
          * the most specific error code that applies.  For example, prefer
          * `OUT_OF_RANGE` over `FAILED_PRECONDITION` if both codes apply.
        @@ -31,12 +35,14 @@
          *
          * Protobuf enum {@code google.rpc.Code}
          */
        +@com.google.protobuf.Generated
         public enum Code implements com.google.protobuf.ProtocolMessageEnum {
           /**
            *
            *
            * 
        -   * Not an error; returned on success
        +   * Not an error; returned on success.
        +   *
            * HTTP Mapping: 200 OK
            * 
        * @@ -48,6 +54,7 @@ public enum Code implements com.google.protobuf.ProtocolMessageEnum { * *
            * The operation was cancelled, typically by the caller.
        +   *
            * HTTP Mapping: 499 Client Closed Request
            * 
        * @@ -63,6 +70,7 @@ public enum Code implements com.google.protobuf.ProtocolMessageEnum { * an error space that is not known in this address space. Also * errors raised by APIs that do not return enough error information * may be converted to this error. + * * HTTP Mapping: 500 Internal Server Error *
        * @@ -77,6 +85,7 @@ public enum Code implements com.google.protobuf.ProtocolMessageEnum { * from `FAILED_PRECONDITION`. `INVALID_ARGUMENT` indicates arguments * that are problematic regardless of the state of the system * (e.g., a malformed file name). + * * HTTP Mapping: 400 Bad Request *
        * @@ -92,6 +101,7 @@ public enum Code implements com.google.protobuf.ProtocolMessageEnum { * even if the operation has completed successfully. For example, a * successful response from a server could have been delayed long * enough for the deadline to expire. + * * HTTP Mapping: 504 Gateway Timeout *
        * @@ -103,11 +113,13 @@ public enum Code implements com.google.protobuf.ProtocolMessageEnum { * *
            * Some requested entity (e.g., file or directory) was not found.
        +   *
            * Note to server developers: if a request is denied for an entire class
        -   * of users, such as gradual feature rollout or undocumented whitelist,
        +   * of users, such as gradual feature rollout or undocumented allowlist,
            * `NOT_FOUND` may be used. If a request is denied for some users within
            * a class of users, such as user-based access control, `PERMISSION_DENIED`
            * must be used.
        +   *
            * HTTP Mapping: 404 Not Found
            * 
        * @@ -120,6 +132,7 @@ public enum Code implements com.google.protobuf.ProtocolMessageEnum { *
            * The entity that a client attempted to create (e.g., file or directory)
            * already exists.
        +   *
            * HTTP Mapping: 409 Conflict
            * 
        * @@ -138,6 +151,7 @@ public enum Code implements com.google.protobuf.ProtocolMessageEnum { * instead for those errors). This error code does not imply the * request is valid or the requested entity exists or satisfies * other pre-conditions. + * * HTTP Mapping: 403 Forbidden *
        * @@ -150,6 +164,7 @@ public enum Code implements com.google.protobuf.ProtocolMessageEnum { *
            * The request does not have valid authentication credentials for the
            * operation.
        +   *
            * HTTP Mapping: 401 Unauthorized
            * 
        * @@ -162,6 +177,7 @@ public enum Code implements com.google.protobuf.ProtocolMessageEnum { *
            * Some resource has been exhausted, perhaps a per-user quota, or
            * perhaps the entire file system is out of space.
        +   *
            * HTTP Mapping: 429 Too Many Requests
            * 
        * @@ -176,17 +192,19 @@ public enum Code implements com.google.protobuf.ProtocolMessageEnum { * required for the operation's execution. For example, the directory * to be deleted is non-empty, an rmdir operation is applied to * a non-directory, etc. + * * Service implementors can use the following guidelines to decide * between `FAILED_PRECONDITION`, `ABORTED`, and `UNAVAILABLE`: - * (a) Use `UNAVAILABLE` if the client can retry just the failing call. - * (b) Use `ABORTED` if the client should retry at a higher level - * (e.g., when a client-specified test-and-set fails, indicating the - * client should restart a read-modify-write sequence). - * (c) Use `FAILED_PRECONDITION` if the client should not retry until - * the system state has been explicitly fixed. E.g., if an "rmdir" - * fails because the directory is non-empty, `FAILED_PRECONDITION` - * should be returned since the client should not retry unless - * the files are deleted from the directory. + * (a) Use `UNAVAILABLE` if the client can retry just the failing call. + * (b) Use `ABORTED` if the client should retry at a higher level. For + * example, when a client-specified test-and-set fails, indicating the + * client should restart a read-modify-write sequence. + * (c) Use `FAILED_PRECONDITION` if the client should not retry until + * the system state has been explicitly fixed. For example, if an "rmdir" + * fails because the directory is non-empty, `FAILED_PRECONDITION` + * should be returned since the client should not retry unless + * the files are deleted from the directory. + * * HTTP Mapping: 400 Bad Request *
        * @@ -199,8 +217,10 @@ public enum Code implements com.google.protobuf.ProtocolMessageEnum { *
            * The operation was aborted, typically due to a concurrency issue such as
            * a sequencer check failure or transaction abort.
        +   *
            * See the guidelines above for deciding between `FAILED_PRECONDITION`,
            * `ABORTED`, and `UNAVAILABLE`.
        +   *
            * HTTP Mapping: 409 Conflict
            * 
        * @@ -213,17 +233,20 @@ public enum Code implements com.google.protobuf.ProtocolMessageEnum { *
            * The operation was attempted past the valid range.  E.g., seeking or
            * reading past end-of-file.
        +   *
            * Unlike `INVALID_ARGUMENT`, this error indicates a problem that may
            * be fixed if the system state changes. For example, a 32-bit file
            * system will generate `INVALID_ARGUMENT` if asked to read at an
            * offset that is not in the range [0,2^32-1], but it will generate
            * `OUT_OF_RANGE` if asked to read from an offset past the current
            * file size.
        +   *
            * There is a fair bit of overlap between `FAILED_PRECONDITION` and
            * `OUT_OF_RANGE`.  We recommend using `OUT_OF_RANGE` (the more specific
            * error) when it applies so that callers who are iterating through
            * a space can easily look for an `OUT_OF_RANGE` error to detect when
            * they are done.
        +   *
            * HTTP Mapping: 400 Bad Request
            * 
        * @@ -236,6 +259,7 @@ public enum Code implements com.google.protobuf.ProtocolMessageEnum { *
            * The operation is not implemented or is not supported/enabled in this
            * service.
        +   *
            * HTTP Mapping: 501 Not Implemented
            * 
        * @@ -249,6 +273,7 @@ public enum Code implements com.google.protobuf.ProtocolMessageEnum { * Internal errors. This means that some invariants expected by the * underlying system have been broken. This error code is reserved * for serious errors. + * * HTTP Mapping: 500 Internal Server Error *
        * @@ -263,8 +288,10 @@ public enum Code implements com.google.protobuf.ProtocolMessageEnum { * transient condition, which can be corrected by retrying with * a backoff. Note that it is not always safe to retry * non-idempotent operations. + * * See the guidelines above for deciding between `FAILED_PRECONDITION`, * `ABORTED`, and `UNAVAILABLE`. + * * HTTP Mapping: 503 Service Unavailable * * @@ -276,6 +303,7 @@ public enum Code implements com.google.protobuf.ProtocolMessageEnum { * *
            * Unrecoverable data loss or corruption.
        +   *
            * HTTP Mapping: 500 Internal Server Error
            * 
        * @@ -285,28 +313,42 @@ public enum Code implements com.google.protobuf.ProtocolMessageEnum { UNRECOGNIZED(-1), ; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "Code"); + } + /** * * *
        -   * Not an error; returned on success
        +   * Not an error; returned on success.
        +   *
            * HTTP Mapping: 200 OK
            * 
        * * OK = 0; */ public static final int OK_VALUE = 0; + /** * * *
            * The operation was cancelled, typically by the caller.
        +   *
            * HTTP Mapping: 499 Client Closed Request
            * 
        * * CANCELLED = 1; */ public static final int CANCELLED_VALUE = 1; + /** * * @@ -316,12 +358,14 @@ public enum Code implements com.google.protobuf.ProtocolMessageEnum { * an error space that is not known in this address space. Also * errors raised by APIs that do not return enough error information * may be converted to this error. + * * HTTP Mapping: 500 Internal Server Error * * * UNKNOWN = 2; */ public static final int UNKNOWN_VALUE = 2; + /** * * @@ -330,12 +374,14 @@ public enum Code implements com.google.protobuf.ProtocolMessageEnum { * from `FAILED_PRECONDITION`. `INVALID_ARGUMENT` indicates arguments * that are problematic regardless of the state of the system * (e.g., a malformed file name). + * * HTTP Mapping: 400 Bad Request * * * INVALID_ARGUMENT = 3; */ public static final int INVALID_ARGUMENT_VALUE = 3; + /** * * @@ -345,40 +391,47 @@ public enum Code implements com.google.protobuf.ProtocolMessageEnum { * even if the operation has completed successfully. For example, a * successful response from a server could have been delayed long * enough for the deadline to expire. + * * HTTP Mapping: 504 Gateway Timeout * * * DEADLINE_EXCEEDED = 4; */ public static final int DEADLINE_EXCEEDED_VALUE = 4; + /** * * *
            * Some requested entity (e.g., file or directory) was not found.
        +   *
            * Note to server developers: if a request is denied for an entire class
        -   * of users, such as gradual feature rollout or undocumented whitelist,
        +   * of users, such as gradual feature rollout or undocumented allowlist,
            * `NOT_FOUND` may be used. If a request is denied for some users within
            * a class of users, such as user-based access control, `PERMISSION_DENIED`
            * must be used.
        +   *
            * HTTP Mapping: 404 Not Found
            * 
        * * NOT_FOUND = 5; */ public static final int NOT_FOUND_VALUE = 5; + /** * * *
            * The entity that a client attempted to create (e.g., file or directory)
            * already exists.
        +   *
            * HTTP Mapping: 409 Conflict
            * 
        * * ALREADY_EXISTS = 6; */ public static final int ALREADY_EXISTS_VALUE = 6; + /** * * @@ -391,36 +444,42 @@ public enum Code implements com.google.protobuf.ProtocolMessageEnum { * instead for those errors). This error code does not imply the * request is valid or the requested entity exists or satisfies * other pre-conditions. + * * HTTP Mapping: 403 Forbidden * * * PERMISSION_DENIED = 7; */ public static final int PERMISSION_DENIED_VALUE = 7; + /** * * *
            * The request does not have valid authentication credentials for the
            * operation.
        +   *
            * HTTP Mapping: 401 Unauthorized
            * 
        * * UNAUTHENTICATED = 16; */ public static final int UNAUTHENTICATED_VALUE = 16; + /** * * *
            * Some resource has been exhausted, perhaps a per-user quota, or
            * perhaps the entire file system is out of space.
        +   *
            * HTTP Mapping: 429 Too Many Requests
            * 
        * * RESOURCE_EXHAUSTED = 8; */ public static final int RESOURCE_EXHAUSTED_VALUE = 8; + /** * * @@ -429,72 +488,84 @@ public enum Code implements com.google.protobuf.ProtocolMessageEnum { * required for the operation's execution. For example, the directory * to be deleted is non-empty, an rmdir operation is applied to * a non-directory, etc. + * * Service implementors can use the following guidelines to decide * between `FAILED_PRECONDITION`, `ABORTED`, and `UNAVAILABLE`: - * (a) Use `UNAVAILABLE` if the client can retry just the failing call. - * (b) Use `ABORTED` if the client should retry at a higher level - * (e.g., when a client-specified test-and-set fails, indicating the - * client should restart a read-modify-write sequence). - * (c) Use `FAILED_PRECONDITION` if the client should not retry until - * the system state has been explicitly fixed. E.g., if an "rmdir" - * fails because the directory is non-empty, `FAILED_PRECONDITION` - * should be returned since the client should not retry unless - * the files are deleted from the directory. + * (a) Use `UNAVAILABLE` if the client can retry just the failing call. + * (b) Use `ABORTED` if the client should retry at a higher level. For + * example, when a client-specified test-and-set fails, indicating the + * client should restart a read-modify-write sequence. + * (c) Use `FAILED_PRECONDITION` if the client should not retry until + * the system state has been explicitly fixed. For example, if an "rmdir" + * fails because the directory is non-empty, `FAILED_PRECONDITION` + * should be returned since the client should not retry unless + * the files are deleted from the directory. + * * HTTP Mapping: 400 Bad Request * * * FAILED_PRECONDITION = 9; */ public static final int FAILED_PRECONDITION_VALUE = 9; + /** * * *
            * The operation was aborted, typically due to a concurrency issue such as
            * a sequencer check failure or transaction abort.
        +   *
            * See the guidelines above for deciding between `FAILED_PRECONDITION`,
            * `ABORTED`, and `UNAVAILABLE`.
        +   *
            * HTTP Mapping: 409 Conflict
            * 
        * * ABORTED = 10; */ public static final int ABORTED_VALUE = 10; + /** * * *
            * The operation was attempted past the valid range.  E.g., seeking or
            * reading past end-of-file.
        +   *
            * Unlike `INVALID_ARGUMENT`, this error indicates a problem that may
            * be fixed if the system state changes. For example, a 32-bit file
            * system will generate `INVALID_ARGUMENT` if asked to read at an
            * offset that is not in the range [0,2^32-1], but it will generate
            * `OUT_OF_RANGE` if asked to read from an offset past the current
            * file size.
        +   *
            * There is a fair bit of overlap between `FAILED_PRECONDITION` and
            * `OUT_OF_RANGE`.  We recommend using `OUT_OF_RANGE` (the more specific
            * error) when it applies so that callers who are iterating through
            * a space can easily look for an `OUT_OF_RANGE` error to detect when
            * they are done.
        +   *
            * HTTP Mapping: 400 Bad Request
            * 
        * * OUT_OF_RANGE = 11; */ public static final int OUT_OF_RANGE_VALUE = 11; + /** * * *
            * The operation is not implemented or is not supported/enabled in this
            * service.
        +   *
            * HTTP Mapping: 501 Not Implemented
            * 
        * * UNIMPLEMENTED = 12; */ public static final int UNIMPLEMENTED_VALUE = 12; + /** * * @@ -502,12 +573,14 @@ public enum Code implements com.google.protobuf.ProtocolMessageEnum { * Internal errors. This means that some invariants expected by the * underlying system have been broken. This error code is reserved * for serious errors. + * * HTTP Mapping: 500 Internal Server Error * * * INTERNAL = 13; */ public static final int INTERNAL_VALUE = 13; + /** * * @@ -516,19 +589,23 @@ public enum Code implements com.google.protobuf.ProtocolMessageEnum { * transient condition, which can be corrected by retrying with * a backoff. Note that it is not always safe to retry * non-idempotent operations. + * * See the guidelines above for deciding between `FAILED_PRECONDITION`, * `ABORTED`, and `UNAVAILABLE`. + * * HTTP Mapping: 503 Service Unavailable * * * UNAVAILABLE = 14; */ public static final int UNAVAILABLE_VALUE = 14; + /** * * *
            * Unrecoverable data loss or corruption.
        +   *
            * HTTP Mapping: 500 Internal Server Error
            * 
        * @@ -622,7 +699,7 @@ public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType return getDescriptor(); } - public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + public static com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { return com.google.rpc.CodeProto.getDescriptor().getEnumTypes().get(0); } diff --git a/java-common-protos/proto-google-common-protos/src/main/java/com/google/rpc/CodeProto.java b/java-common-protos/proto-google-common-protos/src/main/java/com/google/rpc/CodeProto.java index f63ced744c..e954e49bbe 100644 --- a/java-common-protos/proto-google-common-protos/src/main/java/com/google/rpc/CodeProto.java +++ b/java-common-protos/proto-google-common-protos/src/main/java/com/google/rpc/CodeProto.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,13 +14,26 @@ * limitations under the License. */ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: google/rpc/code.proto +// Protobuf Java Version: 4.33.2 package com.google.rpc; -public final class CodeProto { +@com.google.protobuf.Generated +public final class CodeProto extends com.google.protobuf.GeneratedFile { private CodeProto() {} + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "CodeProto"); + } + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistryLite registry) {} public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry registry) { @@ -51,6 +64,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { descriptor = com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( descriptorData, new com.google.protobuf.Descriptors.FileDescriptor[] {}); + descriptor.resolveAllFeaturesImmutable(); } // @@protoc_insertion_point(outer_class_scope) diff --git a/java-common-protos/proto-google-common-protos/src/main/java/com/google/rpc/DebugInfo.java b/java-common-protos/proto-google-common-protos/src/main/java/com/google/rpc/DebugInfo.java index cf5e887fba..c7054d1e9a 100644 --- a/java-common-protos/proto-google-common-protos/src/main/java/com/google/rpc/DebugInfo.java +++ b/java-common-protos/proto-google-common-protos/src/main/java/com/google/rpc/DebugInfo.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,9 @@ * limitations under the License. */ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: google/rpc/error_details.proto +// Protobuf Java Version: 4.33.2 package com.google.rpc; @@ -27,38 +29,39 @@ * * Protobuf type {@code google.rpc.DebugInfo} */ -public final class DebugInfo extends com.google.protobuf.GeneratedMessageV3 +@com.google.protobuf.Generated +public final class DebugInfo extends com.google.protobuf.GeneratedMessage implements // @@protoc_insertion_point(message_implements:google.rpc.DebugInfo) DebugInfoOrBuilder { private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "DebugInfo"); + } + // Use DebugInfo.newBuilder() to construct. - private DebugInfo(com.google.protobuf.GeneratedMessageV3.Builder builder) { + private DebugInfo(com.google.protobuf.GeneratedMessage.Builder builder) { super(builder); } private DebugInfo() { - stackEntries_ = com.google.protobuf.LazyStringArrayList.EMPTY; + stackEntries_ = com.google.protobuf.LazyStringArrayList.emptyList(); detail_ = ""; } - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new DebugInfo(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.rpc.ErrorDetailsProto.internal_static_google_rpc_DebugInfo_descriptor; } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.rpc.ErrorDetailsProto.internal_static_google_rpc_DebugInfo_fieldAccessorTable .ensureFieldAccessorsInitialized( @@ -66,7 +69,11 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } public static final int STACK_ENTRIES_FIELD_NUMBER = 1; - private com.google.protobuf.LazyStringList stackEntries_; + + @SuppressWarnings("serial") + private com.google.protobuf.LazyStringArrayList stackEntries_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + /** * * @@ -81,6 +88,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { public com.google.protobuf.ProtocolStringList getStackEntriesList() { return stackEntries_; } + /** * * @@ -95,6 +103,7 @@ public com.google.protobuf.ProtocolStringList getStackEntriesList() { public int getStackEntriesCount() { return stackEntries_.size(); } + /** * * @@ -110,6 +119,7 @@ public int getStackEntriesCount() { public java.lang.String getStackEntries(int index) { return stackEntries_.get(index); } + /** * * @@ -127,7 +137,10 @@ public com.google.protobuf.ByteString getStackEntriesBytes(int index) { } public static final int DETAIL_FIELD_NUMBER = 2; - private volatile java.lang.Object detail_; + + @SuppressWarnings("serial") + private volatile java.lang.Object detail_ = ""; + /** * * @@ -151,6 +164,7 @@ public java.lang.String getDetail() { return s; } } + /** * * @@ -190,10 +204,10 @@ public final boolean isInitialized() { @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { for (int i = 0; i < stackEntries_.size(); i++) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, stackEntries_.getRaw(i)); + com.google.protobuf.GeneratedMessage.writeString(output, 1, stackEntries_.getRaw(i)); } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(detail_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 2, detail_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(detail_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, detail_); } getUnknownFields().writeTo(output); } @@ -212,8 +226,8 @@ public int getSerializedSize() { size += dataSize; size += 1 * getStackEntriesList().size(); } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(detail_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, detail_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(detail_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, detail_); } size += getUnknownFields().getSerializedSize(); memoizedSize = size; @@ -290,38 +304,38 @@ public static com.google.rpc.DebugInfo parseFrom( public static com.google.rpc.DebugInfo parseFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); } public static com.google.rpc.DebugInfo parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } public static com.google.rpc.DebugInfo parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); } public static com.google.rpc.DebugInfo parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( PARSER, input, extensionRegistry); } public static com.google.rpc.DebugInfo parseFrom(com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); } public static com.google.rpc.DebugInfo parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } @@ -344,10 +358,11 @@ public Builder toBuilder() { } @java.lang.Override - protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { Builder builder = new Builder(parent); return builder; } + /** * * @@ -357,7 +372,7 @@ protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.Build * * Protobuf type {@code google.rpc.DebugInfo} */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder implements // @@protoc_insertion_point(builder_implements:google.rpc.DebugInfo) com.google.rpc.DebugInfoOrBuilder { @@ -366,7 +381,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.rpc.ErrorDetailsProto .internal_static_google_rpc_DebugInfo_fieldAccessorTable @@ -377,17 +392,16 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { // Construct using com.google.rpc.DebugInfo.newBuilder() private Builder() {} - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { super(parent); } @java.lang.Override public Builder clear() { super.clear(); - stackEntries_ = com.google.protobuf.LazyStringArrayList.EMPTY; - bitField0_ = (bitField0_ & ~0x00000001); + bitField0_ = 0; + stackEntries_ = com.google.protobuf.LazyStringArrayList.emptyList(); detail_ = ""; - return this; } @@ -413,48 +427,22 @@ public com.google.rpc.DebugInfo build() { @java.lang.Override public com.google.rpc.DebugInfo buildPartial() { com.google.rpc.DebugInfo result = new com.google.rpc.DebugInfo(this); - int from_bitField0_ = bitField0_; - if (((bitField0_ & 0x00000001) != 0)) { - stackEntries_ = stackEntries_.getUnmodifiableView(); - bitField0_ = (bitField0_ & ~0x00000001); + if (bitField0_ != 0) { + buildPartial0(result); } - result.stackEntries_ = stackEntries_; - result.detail_ = detail_; onBuilt(); return result; } - @java.lang.Override - public Builder clone() { - return super.clone(); - } - - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.setField(field, value); - } - - @java.lang.Override - public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - - @java.lang.Override - public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.addRepeatedField(field, value); + private void buildPartial0(com.google.rpc.DebugInfo result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + stackEntries_.makeImmutable(); + result.stackEntries_ = stackEntries_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.detail_ = detail_; + } } @java.lang.Override @@ -472,7 +460,7 @@ public Builder mergeFrom(com.google.rpc.DebugInfo other) { if (!other.stackEntries_.isEmpty()) { if (stackEntries_.isEmpty()) { stackEntries_ = other.stackEntries_; - bitField0_ = (bitField0_ & ~0x00000001); + bitField0_ |= 0x00000001; } else { ensureStackEntriesIsMutable(); stackEntries_.addAll(other.stackEntries_); @@ -481,6 +469,7 @@ public Builder mergeFrom(com.google.rpc.DebugInfo other) { } if (!other.getDetail().isEmpty()) { detail_ = other.detail_; + bitField0_ |= 0x00000002; onChanged(); } this.mergeUnknownFields(other.getUnknownFields()); @@ -519,7 +508,7 @@ public Builder mergeFrom( case 18: { detail_ = input.readStringRequireUtf8(); - + bitField0_ |= 0x00000002; break; } // case 18 default: @@ -541,15 +530,16 @@ public Builder mergeFrom( private int bitField0_; - private com.google.protobuf.LazyStringList stackEntries_ = - com.google.protobuf.LazyStringArrayList.EMPTY; + private com.google.protobuf.LazyStringArrayList stackEntries_ = + com.google.protobuf.LazyStringArrayList.emptyList(); private void ensureStackEntriesIsMutable() { - if (!((bitField0_ & 0x00000001) != 0)) { + if (!stackEntries_.isModifiable()) { stackEntries_ = new com.google.protobuf.LazyStringArrayList(stackEntries_); - bitField0_ |= 0x00000001; } + bitField0_ |= 0x00000001; } + /** * * @@ -562,8 +552,10 @@ private void ensureStackEntriesIsMutable() { * @return A list containing the stackEntries. */ public com.google.protobuf.ProtocolStringList getStackEntriesList() { - return stackEntries_.getUnmodifiableView(); + stackEntries_.makeImmutable(); + return stackEntries_; } + /** * * @@ -578,6 +570,7 @@ public com.google.protobuf.ProtocolStringList getStackEntriesList() { public int getStackEntriesCount() { return stackEntries_.size(); } + /** * * @@ -593,6 +586,7 @@ public int getStackEntriesCount() { public java.lang.String getStackEntries(int index) { return stackEntries_.get(index); } + /** * * @@ -608,6 +602,7 @@ public java.lang.String getStackEntries(int index) { public com.google.protobuf.ByteString getStackEntriesBytes(int index) { return stackEntries_.getByteString(index); } + /** * * @@ -627,9 +622,11 @@ public Builder setStackEntries(int index, java.lang.String value) { } ensureStackEntriesIsMutable(); stackEntries_.set(index, value); + bitField0_ |= 0x00000001; onChanged(); return this; } + /** * * @@ -648,9 +645,11 @@ public Builder addStackEntries(java.lang.String value) { } ensureStackEntriesIsMutable(); stackEntries_.add(value); + bitField0_ |= 0x00000001; onChanged(); return this; } + /** * * @@ -666,9 +665,11 @@ public Builder addStackEntries(java.lang.String value) { public Builder addAllStackEntries(java.lang.Iterable values) { ensureStackEntriesIsMutable(); com.google.protobuf.AbstractMessageLite.Builder.addAll(values, stackEntries_); + bitField0_ |= 0x00000001; onChanged(); return this; } + /** * * @@ -681,11 +682,13 @@ public Builder addAllStackEntries(java.lang.Iterable values) { * @return This builder for chaining. */ public Builder clearStackEntries() { - stackEntries_ = com.google.protobuf.LazyStringArrayList.EMPTY; + stackEntries_ = com.google.protobuf.LazyStringArrayList.emptyList(); bitField0_ = (bitField0_ & ~0x00000001); + ; onChanged(); return this; } + /** * * @@ -705,11 +708,13 @@ public Builder addStackEntriesBytes(com.google.protobuf.ByteString value) { checkByteStringIsUtf8(value); ensureStackEntriesIsMutable(); stackEntries_.add(value); + bitField0_ |= 0x00000001; onChanged(); return this; } private java.lang.Object detail_ = ""; + /** * * @@ -732,6 +737,7 @@ public java.lang.String getDetail() { return (java.lang.String) ref; } } + /** * * @@ -754,6 +760,7 @@ public com.google.protobuf.ByteString getDetailBytes() { return (com.google.protobuf.ByteString) ref; } } + /** * * @@ -770,11 +777,12 @@ public Builder setDetail(java.lang.String value) { if (value == null) { throw new NullPointerException(); } - detail_ = value; + bitField0_ |= 0x00000002; onChanged(); return this; } + /** * * @@ -787,11 +795,12 @@ public Builder setDetail(java.lang.String value) { * @return This builder for chaining. */ public Builder clearDetail() { - detail_ = getDefaultInstance().getDetail(); + bitField0_ = (bitField0_ & ~0x00000002); onChanged(); return this; } + /** * * @@ -809,23 +818,12 @@ public Builder setDetailBytes(com.google.protobuf.ByteString value) { throw new NullPointerException(); } checkByteStringIsUtf8(value); - detail_ = 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.rpc.DebugInfo) } diff --git a/java-common-protos/proto-google-common-protos/src/main/java/com/google/rpc/DebugInfoOrBuilder.java b/java-common-protos/proto-google-common-protos/src/main/java/com/google/rpc/DebugInfoOrBuilder.java index 5be2796ee3..7d7640e56c 100644 --- a/java-common-protos/proto-google-common-protos/src/main/java/com/google/rpc/DebugInfoOrBuilder.java +++ b/java-common-protos/proto-google-common-protos/src/main/java/com/google/rpc/DebugInfoOrBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,10 +14,13 @@ * limitations under the License. */ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: google/rpc/error_details.proto +// Protobuf Java Version: 4.33.2 package com.google.rpc; +@com.google.protobuf.Generated public interface DebugInfoOrBuilder extends // @@protoc_insertion_point(interface_extends:google.rpc.DebugInfo) @@ -35,6 +38,7 @@ public interface DebugInfoOrBuilder * @return A list containing the stackEntries. */ java.util.List getStackEntriesList(); + /** * * @@ -47,6 +51,7 @@ public interface DebugInfoOrBuilder * @return The count of stackEntries. */ int getStackEntriesCount(); + /** * * @@ -60,6 +65,7 @@ public interface DebugInfoOrBuilder * @return The stackEntries at the given index. */ java.lang.String getStackEntries(int index); + /** * * @@ -86,6 +92,7 @@ public interface DebugInfoOrBuilder * @return The detail. */ java.lang.String getDetail(); + /** * * diff --git a/java-common-protos/proto-google-common-protos/src/main/java/com/google/rpc/ErrorDetailsProto.java b/java-common-protos/proto-google-common-protos/src/main/java/com/google/rpc/ErrorDetailsProto.java index 7dcca5d020..5ad462854e 100644 --- a/java-common-protos/proto-google-common-protos/src/main/java/com/google/rpc/ErrorDetailsProto.java +++ b/java-common-protos/proto-google-common-protos/src/main/java/com/google/rpc/ErrorDetailsProto.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,78 +14,95 @@ * limitations under the License. */ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: google/rpc/error_details.proto +// Protobuf Java Version: 4.33.2 package com.google.rpc; -public final class ErrorDetailsProto { +@com.google.protobuf.Generated +public final class ErrorDetailsProto extends com.google.protobuf.GeneratedFile { private ErrorDetailsProto() {} + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "ErrorDetailsProto"); + } + 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_rpc_ErrorInfo_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_rpc_ErrorInfo_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_rpc_ErrorInfo_MetadataEntry_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_rpc_ErrorInfo_MetadataEntry_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_google_rpc_RetryInfo_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable internal_static_google_rpc_RetryInfo_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_google_rpc_DebugInfo_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable internal_static_google_rpc_DebugInfo_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_google_rpc_QuotaFailure_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable internal_static_google_rpc_QuotaFailure_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_google_rpc_QuotaFailure_Violation_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable internal_static_google_rpc_QuotaFailure_Violation_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_rpc_ErrorInfo_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_rpc_ErrorInfo_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_rpc_ErrorInfo_MetadataEntry_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_rpc_ErrorInfo_MetadataEntry_fieldAccessorTable; + internal_static_google_rpc_QuotaFailure_Violation_QuotaDimensionsEntry_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_rpc_QuotaFailure_Violation_QuotaDimensionsEntry_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_google_rpc_PreconditionFailure_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable internal_static_google_rpc_PreconditionFailure_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_google_rpc_PreconditionFailure_Violation_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable internal_static_google_rpc_PreconditionFailure_Violation_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_google_rpc_BadRequest_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable internal_static_google_rpc_BadRequest_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_google_rpc_BadRequest_FieldViolation_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable internal_static_google_rpc_BadRequest_FieldViolation_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_google_rpc_RequestInfo_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable internal_static_google_rpc_RequestInfo_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_google_rpc_ResourceInfo_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable internal_static_google_rpc_ResourceInfo_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_google_rpc_Help_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable internal_static_google_rpc_Help_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_google_rpc_Help_Link_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable internal_static_google_rpc_Help_Link_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_google_rpc_LocalizedMessage_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable internal_static_google_rpc_LocalizedMessage_fieldAccessorTable; public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { @@ -96,36 +113,68 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { static { java.lang.String[] descriptorData = { - "\n\036google/rpc/error_details.proto\022\ngoogle" - + ".rpc\032\036google/protobuf/duration.proto\";\n\t" - + "RetryInfo\022.\n\013retry_delay\030\001 \001(\0132\031.google." - + "protobuf.Duration\"2\n\tDebugInfo\022\025\n\rstack_" - + "entries\030\001 \003(\t\022\016\n\006detail\030\002 \001(\t\"y\n\014QuotaFa" - + "ilure\0226\n\nviolations\030\001 \003(\0132\".google.rpc.Q" - + "uotaFailure.Violation\0321\n\tViolation\022\017\n\007su" - + "bject\030\001 \001(\t\022\023\n\013description\030\002 \001(\t\"\223\001\n\tErr" - + "orInfo\022\016\n\006reason\030\001 \001(\t\022\016\n\006domain\030\002 \001(\t\0225" - + "\n\010metadata\030\003 \003(\0132#.google.rpc.ErrorInfo." - + "MetadataEntry\032/\n\rMetadataEntry\022\013\n\003key\030\001 " - + "\001(\t\022\r\n\005value\030\002 \001(\t:\0028\001\"\225\001\n\023PreconditionF" - + "ailure\022=\n\nviolations\030\001 \003(\0132).google.rpc." - + "PreconditionFailure.Violation\032?\n\tViolati" - + "on\022\014\n\004type\030\001 \001(\t\022\017\n\007subject\030\002 \001(\t\022\023\n\013des" - + "cription\030\003 \001(\t\"\203\001\n\nBadRequest\022?\n\020field_v" - + "iolations\030\001 \003(\0132%.google.rpc.BadRequest." - + "FieldViolation\0324\n\016FieldViolation\022\r\n\005fiel" - + "d\030\001 \001(\t\022\023\n\013description\030\002 \001(\t\"7\n\013RequestI" - + "nfo\022\022\n\nrequest_id\030\001 \001(\t\022\024\n\014serving_data\030" - + "\002 \001(\t\"`\n\014ResourceInfo\022\025\n\rresource_type\030\001" - + " \001(\t\022\025\n\rresource_name\030\002 \001(\t\022\r\n\005owner\030\003 \001" - + "(\t\022\023\n\013description\030\004 \001(\t\"V\n\004Help\022$\n\005links" - + "\030\001 \003(\0132\025.google.rpc.Help.Link\032(\n\004Link\022\023\n" - + "\013description\030\001 \001(\t\022\013\n\003url\030\002 \001(\t\"3\n\020Local" - + "izedMessage\022\016\n\006locale\030\001 \001(\t\022\017\n\007message\030\002" - + " \001(\tBl\n\016com.google.rpcB\021ErrorDetailsProt" - + "oP\001Z?google.golang.org/genproto/googleap" - + "is/rpc/errdetails;errdetails\242\002\003RPCb\006prot" - + "o3" + "\n" + + "\036google/rpc/error_details.proto\022\n" + + "google.rpc\032\036google/protobuf/duration.proto\"\223\001\n" + + "\tErrorInfo\022\016\n" + + "\006reason\030\001 \001(\t\022\016\n" + + "\006domain\030\002 \001(\t\0225\n" + + "\010metadata\030\003 \003(\0132#.google.rpc.ErrorInfo.MetadataEntry\032/\n\r" + + "MetadataEntry\022\013\n" + + "\003key\030\001 \001(\t\022\r\n" + + "\005value\030\002 \001(\t:\0028\001\";\n" + + "\tRetryInfo\022.\n" + + "\013retry_delay\030\001 \001(\0132\031.google.protobuf.Duration\"2\n" + + "\tDebugInfo\022\025\n\r" + + "stack_entries\030\001 \003(\t\022\016\n" + + "\006detail\030\002 \001(\t\"\217\003\n" + + "\014QuotaFailure\0226\n\n" + + "violations\030\001 \003(\0132\".google.rpc.QuotaFailure.Violation\032\306\002\n" + + "\tViolation\022\017\n" + + "\007subject\030\001 \001(\t\022\023\n" + + "\013description\030\002 \001(\t\022\023\n" + + "\013api_service\030\003 \001(\t\022\024\n" + + "\014quota_metric\030\004 \001(\t\022\020\n" + + "\010quota_id\030\005 \001(\t\022Q\n" + + "\020quota_dimensions\030\006 \003(\01327.google" + + ".rpc.QuotaFailure.Violation.QuotaDimensionsEntry\022\023\n" + + "\013quota_value\030\007 \001(\003\022\037\n" + + "\022future_quota_value\030\010 \001(\003H\000\210\001\001\0326\n" + + "\024QuotaDimensionsEntry\022\013\n" + + "\003key\030\001 \001(\t\022\r\n" + + "\005value\030\002 \001(\t:\0028\001B\025\n" + + "\023_future_quota_value\"\225\001\n" + + "\023PreconditionFailure\022=\n\n" + + "violations\030\001 \003(\0132).google.rpc.PreconditionFailure.Violation\032?\n" + + "\tViolation\022\014\n" + + "\004type\030\001 \001(\t\022\017\n" + + "\007subject\030\002 \001(\t\022\023\n" + + "\013description\030\003 \001(\t\"\314\001\n\n" + + "BadRequest\022?\n" + + "\020field_violations\030\001 \003(\0132%.google.rpc.BadRequest.FieldViolation\032}\n" + + "\016FieldViolation\022\r\n" + + "\005field\030\001 \001(\t\022\023\n" + + "\013description\030\002 \001(\t\022\016\n" + + "\006reason\030\003 \001(\t\0227\n" + + "\021localized_message\030\004 \001(\0132\034.google.rpc.LocalizedMessage\"7\n" + + "\013RequestInfo\022\022\n\n" + + "request_id\030\001 \001(\t\022\024\n" + + "\014serving_data\030\002 \001(\t\"`\n" + + "\014ResourceInfo\022\025\n\r" + + "resource_type\030\001 \001(\t\022\025\n\r" + + "resource_name\030\002 \001(\t\022\r\n" + + "\005owner\030\003 \001(\t\022\023\n" + + "\013description\030\004 \001(\t\"V\n" + + "\004Help\022$\n" + + "\005links\030\001 \003(\0132\025.google.rpc.Help.Link\032(\n" + + "\004Link\022\023\n" + + "\013description\030\001 \001(\t\022\013\n" + + "\003url\030\002 \001(\t\"3\n" + + "\020LocalizedMessage\022\016\n" + + "\006locale\030\001 \001(\t\022\017\n" + + "\007message\030\002 \001(\tBl\n" + + "\016com.google.rpcB\021ErrorDetailsProtoP\001Z?goo" + + "gle.golang.org/genproto/googleapis/rpc/errdetails;errdetails\242\002\003RPCb\006proto3" }; descriptor = com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( @@ -133,118 +182,132 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { new com.google.protobuf.Descriptors.FileDescriptor[] { com.google.protobuf.DurationProto.getDescriptor(), }); - internal_static_google_rpc_RetryInfo_descriptor = getDescriptor().getMessageTypes().get(0); + internal_static_google_rpc_ErrorInfo_descriptor = getDescriptor().getMessageType(0); + internal_static_google_rpc_ErrorInfo_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_rpc_ErrorInfo_descriptor, + new java.lang.String[] { + "Reason", "Domain", "Metadata", + }); + internal_static_google_rpc_ErrorInfo_MetadataEntry_descriptor = + internal_static_google_rpc_ErrorInfo_descriptor.getNestedType(0); + internal_static_google_rpc_ErrorInfo_MetadataEntry_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_rpc_ErrorInfo_MetadataEntry_descriptor, + new java.lang.String[] { + "Key", "Value", + }); + internal_static_google_rpc_RetryInfo_descriptor = getDescriptor().getMessageType(1); internal_static_google_rpc_RetryInfo_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_google_rpc_RetryInfo_descriptor, new java.lang.String[] { "RetryDelay", }); - internal_static_google_rpc_DebugInfo_descriptor = getDescriptor().getMessageTypes().get(1); + internal_static_google_rpc_DebugInfo_descriptor = getDescriptor().getMessageType(2); internal_static_google_rpc_DebugInfo_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_google_rpc_DebugInfo_descriptor, new java.lang.String[] { "StackEntries", "Detail", }); - internal_static_google_rpc_QuotaFailure_descriptor = getDescriptor().getMessageTypes().get(2); + internal_static_google_rpc_QuotaFailure_descriptor = getDescriptor().getMessageType(3); internal_static_google_rpc_QuotaFailure_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_google_rpc_QuotaFailure_descriptor, new java.lang.String[] { "Violations", }); internal_static_google_rpc_QuotaFailure_Violation_descriptor = - internal_static_google_rpc_QuotaFailure_descriptor.getNestedTypes().get(0); + internal_static_google_rpc_QuotaFailure_descriptor.getNestedType(0); internal_static_google_rpc_QuotaFailure_Violation_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_google_rpc_QuotaFailure_Violation_descriptor, new java.lang.String[] { - "Subject", "Description", + "Subject", + "Description", + "ApiService", + "QuotaMetric", + "QuotaId", + "QuotaDimensions", + "QuotaValue", + "FutureQuotaValue", }); - internal_static_google_rpc_ErrorInfo_descriptor = getDescriptor().getMessageTypes().get(3); - internal_static_google_rpc_ErrorInfo_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_google_rpc_ErrorInfo_descriptor, - new java.lang.String[] { - "Reason", "Domain", "Metadata", - }); - internal_static_google_rpc_ErrorInfo_MetadataEntry_descriptor = - internal_static_google_rpc_ErrorInfo_descriptor.getNestedTypes().get(0); - internal_static_google_rpc_ErrorInfo_MetadataEntry_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_google_rpc_ErrorInfo_MetadataEntry_descriptor, + internal_static_google_rpc_QuotaFailure_Violation_QuotaDimensionsEntry_descriptor = + internal_static_google_rpc_QuotaFailure_Violation_descriptor.getNestedType(0); + internal_static_google_rpc_QuotaFailure_Violation_QuotaDimensionsEntry_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_rpc_QuotaFailure_Violation_QuotaDimensionsEntry_descriptor, new java.lang.String[] { "Key", "Value", }); - internal_static_google_rpc_PreconditionFailure_descriptor = - getDescriptor().getMessageTypes().get(4); + internal_static_google_rpc_PreconditionFailure_descriptor = getDescriptor().getMessageType(4); internal_static_google_rpc_PreconditionFailure_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_google_rpc_PreconditionFailure_descriptor, new java.lang.String[] { "Violations", }); internal_static_google_rpc_PreconditionFailure_Violation_descriptor = - internal_static_google_rpc_PreconditionFailure_descriptor.getNestedTypes().get(0); + internal_static_google_rpc_PreconditionFailure_descriptor.getNestedType(0); internal_static_google_rpc_PreconditionFailure_Violation_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_google_rpc_PreconditionFailure_Violation_descriptor, new java.lang.String[] { "Type", "Subject", "Description", }); - internal_static_google_rpc_BadRequest_descriptor = getDescriptor().getMessageTypes().get(5); + internal_static_google_rpc_BadRequest_descriptor = getDescriptor().getMessageType(5); internal_static_google_rpc_BadRequest_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_google_rpc_BadRequest_descriptor, new java.lang.String[] { "FieldViolations", }); internal_static_google_rpc_BadRequest_FieldViolation_descriptor = - internal_static_google_rpc_BadRequest_descriptor.getNestedTypes().get(0); + internal_static_google_rpc_BadRequest_descriptor.getNestedType(0); internal_static_google_rpc_BadRequest_FieldViolation_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_google_rpc_BadRequest_FieldViolation_descriptor, new java.lang.String[] { - "Field", "Description", + "Field", "Description", "Reason", "LocalizedMessage", }); - internal_static_google_rpc_RequestInfo_descriptor = getDescriptor().getMessageTypes().get(6); + internal_static_google_rpc_RequestInfo_descriptor = getDescriptor().getMessageType(6); internal_static_google_rpc_RequestInfo_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_google_rpc_RequestInfo_descriptor, new java.lang.String[] { "RequestId", "ServingData", }); - internal_static_google_rpc_ResourceInfo_descriptor = getDescriptor().getMessageTypes().get(7); + internal_static_google_rpc_ResourceInfo_descriptor = getDescriptor().getMessageType(7); internal_static_google_rpc_ResourceInfo_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_google_rpc_ResourceInfo_descriptor, new java.lang.String[] { "ResourceType", "ResourceName", "Owner", "Description", }); - internal_static_google_rpc_Help_descriptor = getDescriptor().getMessageTypes().get(8); + internal_static_google_rpc_Help_descriptor = getDescriptor().getMessageType(8); internal_static_google_rpc_Help_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_google_rpc_Help_descriptor, new java.lang.String[] { "Links", }); internal_static_google_rpc_Help_Link_descriptor = - internal_static_google_rpc_Help_descriptor.getNestedTypes().get(0); + internal_static_google_rpc_Help_descriptor.getNestedType(0); internal_static_google_rpc_Help_Link_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_google_rpc_Help_Link_descriptor, new java.lang.String[] { "Description", "Url", }); - internal_static_google_rpc_LocalizedMessage_descriptor = - getDescriptor().getMessageTypes().get(9); + internal_static_google_rpc_LocalizedMessage_descriptor = getDescriptor().getMessageType(9); internal_static_google_rpc_LocalizedMessage_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_google_rpc_LocalizedMessage_descriptor, new java.lang.String[] { "Locale", "Message", }); + descriptor.resolveAllFeaturesImmutable(); com.google.protobuf.DurationProto.getDescriptor(); } diff --git a/java-common-protos/proto-google-common-protos/src/main/java/com/google/rpc/ErrorInfo.java b/java-common-protos/proto-google-common-protos/src/main/java/com/google/rpc/ErrorInfo.java index a05d2dc69f..a7559d34b6 100644 --- a/java-common-protos/proto-google-common-protos/src/main/java/com/google/rpc/ErrorInfo.java +++ b/java-common-protos/proto-google-common-protos/src/main/java/com/google/rpc/ErrorInfo.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,9 @@ * limitations under the License. */ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: google/rpc/error_details.proto +// Protobuf Java Version: 4.33.2 package com.google.rpc; @@ -23,35 +25,52 @@ * *
          * Describes the cause of the error with structured details.
        + *
          * Example of an error when contacting the "pubsub.googleapis.com" API when it
          * is not enabled:
        - *     { "reason": "API_DISABLED"
        - *       "domain": "googleapis.com"
        - *       "metadata": {
        - *         "resource": "projects/123",
        - *         "service": "pubsub.googleapis.com"
        - *       }
        - *     }
        + *
        + * { "reason": "API_DISABLED"
        + * "domain": "googleapis.com"
        + * "metadata": {
        + * "resource": "projects/123",
        + * "service": "pubsub.googleapis.com"
        + * }
        + * }
        + *
          * This response indicates that the pubsub.googleapis.com API is not enabled.
        + *
          * Example of an error that is returned when attempting to create a Spanner
          * instance in a region that is out of stock:
        - *     { "reason": "STOCKOUT"
        - *       "domain": "spanner.googleapis.com",
        - *       "metadata": {
        - *         "availableRegions": "us-central1,us-east2"
        - *       }
        - *     }
        + *
        + * { "reason": "STOCKOUT"
        + * "domain": "spanner.googleapis.com",
        + * "metadata": {
        + * "availableRegions": "us-central1,us-east2"
        + * }
        + * }
          * 
        * * Protobuf type {@code google.rpc.ErrorInfo} */ -public final class ErrorInfo extends com.google.protobuf.GeneratedMessageV3 +@com.google.protobuf.Generated +public final class ErrorInfo extends com.google.protobuf.GeneratedMessage implements // @@protoc_insertion_point(message_implements:google.rpc.ErrorInfo) ErrorInfoOrBuilder { private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "ErrorInfo"); + } + // Use ErrorInfo.newBuilder() to construct. - private ErrorInfo(com.google.protobuf.GeneratedMessageV3.Builder builder) { + private ErrorInfo(com.google.protobuf.GeneratedMessage.Builder builder) { super(builder); } @@ -60,24 +79,14 @@ private ErrorInfo() { domain_ = ""; } - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new ErrorInfo(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.rpc.ErrorDetailsProto.internal_static_google_rpc_ErrorInfo_descriptor; } @SuppressWarnings({"rawtypes"}) @java.lang.Override - protected com.google.protobuf.MapField internalGetMapField(int number) { + protected com.google.protobuf.MapFieldReflectionAccessor internalGetMapFieldReflection( + int number) { switch (number) { case 3: return internalGetMetadata(); @@ -87,7 +96,7 @@ protected com.google.protobuf.MapField internalGetMapField(int number) { } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.rpc.ErrorDetailsProto.internal_static_google_rpc_ErrorInfo_fieldAccessorTable .ensureFieldAccessorsInitialized( @@ -95,15 +104,19 @@ protected com.google.protobuf.MapField internalGetMapField(int number) { } public static final int REASON_FIELD_NUMBER = 1; - private volatile java.lang.Object reason_; + + @SuppressWarnings("serial") + private volatile java.lang.Object reason_ = ""; + /** * * *
            * The reason of the error. This is a constant value that identifies the
            * proximate cause of the error. Error reasons are unique within a particular
        -   * domain of errors. This should be at most 63 characters and match
        -   * /[A-Z0-9_]+/.
        +   * domain of errors. This should be at most 63 characters and match a
        +   * regular expression of `[A-Z][A-Z0-9_]+[A-Z0-9]`, which represents
        +   * UPPER_SNAKE_CASE.
            * 
        * * string reason = 1; @@ -122,14 +135,16 @@ public java.lang.String getReason() { return s; } } + /** * * *
            * The reason of the error. This is a constant value that identifies the
            * proximate cause of the error. Error reasons are unique within a particular
        -   * domain of errors. This should be at most 63 characters and match
        -   * /[A-Z0-9_]+/.
        +   * domain of errors. This should be at most 63 characters and match a
        +   * regular expression of `[A-Z][A-Z0-9_]+[A-Z0-9]`, which represents
        +   * UPPER_SNAKE_CASE.
            * 
        * * string reason = 1; @@ -150,7 +165,10 @@ public com.google.protobuf.ByteString getReasonBytes() { } public static final int DOMAIN_FIELD_NUMBER = 2; - private volatile java.lang.Object domain_; + + @SuppressWarnings("serial") + private volatile java.lang.Object domain_ = ""; + /** * * @@ -179,6 +197,7 @@ public java.lang.String getDomain() { return s; } } + /** * * @@ -221,6 +240,7 @@ private static final class MetadataDefaultEntryHolder { ""); } + @SuppressWarnings("serial") private com.google.protobuf.MapField metadata_; private com.google.protobuf.MapField internalGetMetadata() { @@ -233,16 +253,19 @@ private com.google.protobuf.MapField interna public int getMetadataCount() { return internalGetMetadata().getMap().size(); } + /** * * *
            * Additional structured details about this error.
        -   * Keys should match /[a-zA-Z0-9-_]/ and be limited to 64 characters in
        +   *
        +   * Keys must match a regular expression of `[a-z][a-zA-Z0-9-_]+` but should
        +   * ideally be lowerCamelCase. Also, they must be limited to 64 characters in
            * length. When identifying the current value of an exceeded limit, the units
            * should be contained in the key, not the value.  For example, rather than
        -   * {"instanceLimit": "100/request"}, should be returned as,
        -   * {"instanceLimitPerRequest": "100"}, if the client exceeds the number of
        +   * `{"instanceLimit": "100/request"}`, should be returned as,
        +   * `{"instanceLimitPerRequest": "100"}`, if the client exceeds the number of
            * instances that can be created in a single (batch) request.
            * 
        * @@ -255,22 +278,26 @@ public boolean containsMetadata(java.lang.String key) { } return internalGetMetadata().getMap().containsKey(key); } + /** Use {@link #getMetadataMap()} instead. */ @java.lang.Override @java.lang.Deprecated public java.util.Map getMetadata() { return getMetadataMap(); } + /** * * *
            * Additional structured details about this error.
        -   * Keys should match /[a-zA-Z0-9-_]/ and be limited to 64 characters in
        +   *
        +   * Keys must match a regular expression of `[a-z][a-zA-Z0-9-_]+` but should
        +   * ideally be lowerCamelCase. Also, they must be limited to 64 characters in
            * length. When identifying the current value of an exceeded limit, the units
            * should be contained in the key, not the value.  For example, rather than
        -   * {"instanceLimit": "100/request"}, should be returned as,
        -   * {"instanceLimitPerRequest": "100"}, if the client exceeds the number of
        +   * `{"instanceLimit": "100/request"}`, should be returned as,
        +   * `{"instanceLimitPerRequest": "100"}`, if the client exceeds the number of
            * instances that can be created in a single (batch) request.
            * 
        * @@ -280,40 +307,48 @@ public java.util.Map getMetadata() { public java.util.Map getMetadataMap() { return internalGetMetadata().getMap(); } + /** * * *
            * Additional structured details about this error.
        -   * Keys should match /[a-zA-Z0-9-_]/ and be limited to 64 characters in
        +   *
        +   * Keys must match a regular expression of `[a-z][a-zA-Z0-9-_]+` but should
        +   * ideally be lowerCamelCase. Also, they must be limited to 64 characters in
            * length. When identifying the current value of an exceeded limit, the units
            * should be contained in the key, not the value.  For example, rather than
        -   * {"instanceLimit": "100/request"}, should be returned as,
        -   * {"instanceLimitPerRequest": "100"}, if the client exceeds the number of
        +   * `{"instanceLimit": "100/request"}`, should be returned as,
        +   * `{"instanceLimitPerRequest": "100"}`, if the client exceeds the number of
            * instances that can be created in a single (batch) request.
            * 
        * * map<string, string> metadata = 3; */ @java.lang.Override - public java.lang.String getMetadataOrDefault( - java.lang.String key, java.lang.String defaultValue) { + public /* nullable */ java.lang.String getMetadataOrDefault( + java.lang.String key, + /* nullable */ + java.lang.String defaultValue) { if (key == null) { throw new NullPointerException("map key"); } java.util.Map map = internalGetMetadata().getMap(); return map.containsKey(key) ? map.get(key) : defaultValue; } + /** * * *
            * Additional structured details about this error.
        -   * Keys should match /[a-zA-Z0-9-_]/ and be limited to 64 characters in
        +   *
        +   * Keys must match a regular expression of `[a-z][a-zA-Z0-9-_]+` but should
        +   * ideally be lowerCamelCase. Also, they must be limited to 64 characters in
            * length. When identifying the current value of an exceeded limit, the units
            * should be contained in the key, not the value.  For example, rather than
        -   * {"instanceLimit": "100/request"}, should be returned as,
        -   * {"instanceLimitPerRequest": "100"}, if the client exceeds the number of
        +   * `{"instanceLimit": "100/request"}`, should be returned as,
        +   * `{"instanceLimitPerRequest": "100"}`, if the client exceeds the number of
            * instances that can be created in a single (batch) request.
            * 
        * @@ -345,13 +380,13 @@ public final boolean isInitialized() { @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(reason_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, reason_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(reason_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, reason_); } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(domain_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 2, domain_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(domain_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, domain_); } - com.google.protobuf.GeneratedMessageV3.serializeStringMapTo( + com.google.protobuf.GeneratedMessage.serializeStringMapTo( output, internalGetMetadata(), MetadataDefaultEntryHolder.defaultEntry, 3); getUnknownFields().writeTo(output); } @@ -362,11 +397,11 @@ public int getSerializedSize() { if (size != -1) return size; size = 0; - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(reason_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, reason_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(reason_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, reason_); } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(domain_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, domain_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(domain_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, domain_); } for (java.util.Map.Entry entry : internalGetMetadata().getMap().entrySet()) { @@ -456,38 +491,38 @@ public static com.google.rpc.ErrorInfo parseFrom( public static com.google.rpc.ErrorInfo parseFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); } public static com.google.rpc.ErrorInfo parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } public static com.google.rpc.ErrorInfo parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); } public static com.google.rpc.ErrorInfo parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( PARSER, input, extensionRegistry); } public static com.google.rpc.ErrorInfo parseFrom(com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); } public static com.google.rpc.ErrorInfo parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } @@ -510,38 +545,44 @@ public Builder toBuilder() { } @java.lang.Override - protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { Builder builder = new Builder(parent); return builder; } + /** * * *
            * Describes the cause of the error with structured details.
        +   *
            * Example of an error when contacting the "pubsub.googleapis.com" API when it
            * is not enabled:
        -   *     { "reason": "API_DISABLED"
        -   *       "domain": "googleapis.com"
        -   *       "metadata": {
        -   *         "resource": "projects/123",
        -   *         "service": "pubsub.googleapis.com"
        -   *       }
        -   *     }
        +   *
        +   * { "reason": "API_DISABLED"
        +   * "domain": "googleapis.com"
        +   * "metadata": {
        +   * "resource": "projects/123",
        +   * "service": "pubsub.googleapis.com"
        +   * }
        +   * }
        +   *
            * This response indicates that the pubsub.googleapis.com API is not enabled.
        +   *
            * Example of an error that is returned when attempting to create a Spanner
            * instance in a region that is out of stock:
        -   *     { "reason": "STOCKOUT"
        -   *       "domain": "spanner.googleapis.com",
        -   *       "metadata": {
        -   *         "availableRegions": "us-central1,us-east2"
        -   *       }
        -   *     }
        +   *
        +   * { "reason": "STOCKOUT"
        +   * "domain": "spanner.googleapis.com",
        +   * "metadata": {
        +   * "availableRegions": "us-central1,us-east2"
        +   * }
        +   * }
            * 
        * * Protobuf type {@code google.rpc.ErrorInfo} */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder implements // @@protoc_insertion_point(builder_implements:google.rpc.ErrorInfo) com.google.rpc.ErrorInfoOrBuilder { @@ -550,7 +591,8 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } @SuppressWarnings({"rawtypes"}) - protected com.google.protobuf.MapField internalGetMapField(int number) { + protected com.google.protobuf.MapFieldReflectionAccessor internalGetMapFieldReflection( + int number) { switch (number) { case 3: return internalGetMetadata(); @@ -560,7 +602,8 @@ protected com.google.protobuf.MapField internalGetMapField(int number) { } @SuppressWarnings({"rawtypes"}) - protected com.google.protobuf.MapField internalGetMutableMapField(int number) { + protected com.google.protobuf.MapFieldReflectionAccessor internalGetMutableMapFieldReflection( + int number) { switch (number) { case 3: return internalGetMutableMetadata(); @@ -570,7 +613,7 @@ protected com.google.protobuf.MapField internalGetMutableMapField(int number) { } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.rpc.ErrorDetailsProto .internal_static_google_rpc_ErrorInfo_fieldAccessorTable @@ -581,17 +624,16 @@ protected com.google.protobuf.MapField internalGetMutableMapField(int number) { // Construct using com.google.rpc.ErrorInfo.newBuilder() private Builder() {} - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { super(parent); } @java.lang.Override public Builder clear() { super.clear(); + bitField0_ = 0; reason_ = ""; - domain_ = ""; - internalGetMutableMetadata().clear(); return this; } @@ -618,46 +660,25 @@ public com.google.rpc.ErrorInfo build() { @java.lang.Override public com.google.rpc.ErrorInfo buildPartial() { com.google.rpc.ErrorInfo result = new com.google.rpc.ErrorInfo(this); - int from_bitField0_ = bitField0_; - result.reason_ = reason_; - result.domain_ = domain_; - result.metadata_ = internalGetMetadata(); - result.metadata_.makeImmutable(); + if (bitField0_ != 0) { + buildPartial0(result); + } 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); + private void buildPartial0(com.google.rpc.ErrorInfo result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.reason_ = reason_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.domain_ = domain_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.metadata_ = internalGetMetadata(); + result.metadata_.makeImmutable(); + } } @java.lang.Override @@ -674,13 +695,16 @@ public Builder mergeFrom(com.google.rpc.ErrorInfo other) { if (other == com.google.rpc.ErrorInfo.getDefaultInstance()) return this; if (!other.getReason().isEmpty()) { reason_ = other.reason_; + bitField0_ |= 0x00000001; onChanged(); } if (!other.getDomain().isEmpty()) { domain_ = other.domain_; + bitField0_ |= 0x00000002; onChanged(); } internalGetMutableMetadata().mergeFrom(other.internalGetMetadata()); + bitField0_ |= 0x00000004; this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; @@ -710,13 +734,13 @@ public Builder mergeFrom( case 10: { reason_ = input.readStringRequireUtf8(); - + bitField0_ |= 0x00000001; break; } // case 10 case 18: { domain_ = input.readStringRequireUtf8(); - + bitField0_ |= 0x00000002; break; } // case 18 case 26: @@ -728,6 +752,7 @@ public Builder mergeFrom( internalGetMutableMetadata() .getMutableMap() .put(metadata__.getKey(), metadata__.getValue()); + bitField0_ |= 0x00000004; break; } // case 26 default: @@ -750,14 +775,16 @@ public Builder mergeFrom( private int bitField0_; private java.lang.Object reason_ = ""; + /** * * *
              * The reason of the error. This is a constant value that identifies the
              * proximate cause of the error. Error reasons are unique within a particular
        -     * domain of errors. This should be at most 63 characters and match
        -     * /[A-Z0-9_]+/.
        +     * domain of errors. This should be at most 63 characters and match a
        +     * regular expression of `[A-Z][A-Z0-9_]+[A-Z0-9]`, which represents
        +     * UPPER_SNAKE_CASE.
              * 
        * * string reason = 1; @@ -775,14 +802,16 @@ public java.lang.String getReason() { return (java.lang.String) ref; } } + /** * * *
              * The reason of the error. This is a constant value that identifies the
              * proximate cause of the error. Error reasons are unique within a particular
        -     * domain of errors. This should be at most 63 characters and match
        -     * /[A-Z0-9_]+/.
        +     * domain of errors. This should be at most 63 characters and match a
        +     * regular expression of `[A-Z][A-Z0-9_]+[A-Z0-9]`, which represents
        +     * UPPER_SNAKE_CASE.
              * 
        * * string reason = 1; @@ -800,14 +829,16 @@ public com.google.protobuf.ByteString getReasonBytes() { return (com.google.protobuf.ByteString) ref; } } + /** * * *
              * The reason of the error. This is a constant value that identifies the
              * proximate cause of the error. Error reasons are unique within a particular
        -     * domain of errors. This should be at most 63 characters and match
        -     * /[A-Z0-9_]+/.
        +     * domain of errors. This should be at most 63 characters and match a
        +     * regular expression of `[A-Z][A-Z0-9_]+[A-Z0-9]`, which represents
        +     * UPPER_SNAKE_CASE.
              * 
        * * string reason = 1; @@ -819,19 +850,21 @@ public Builder setReason(java.lang.String value) { if (value == null) { throw new NullPointerException(); } - reason_ = value; + bitField0_ |= 0x00000001; onChanged(); return this; } + /** * * *
              * The reason of the error. This is a constant value that identifies the
              * proximate cause of the error. Error reasons are unique within a particular
        -     * domain of errors. This should be at most 63 characters and match
        -     * /[A-Z0-9_]+/.
        +     * domain of errors. This should be at most 63 characters and match a
        +     * regular expression of `[A-Z][A-Z0-9_]+[A-Z0-9]`, which represents
        +     * UPPER_SNAKE_CASE.
              * 
        * * string reason = 1; @@ -839,19 +872,21 @@ public Builder setReason(java.lang.String value) { * @return This builder for chaining. */ public Builder clearReason() { - reason_ = getDefaultInstance().getReason(); + bitField0_ = (bitField0_ & ~0x00000001); onChanged(); return this; } + /** * * *
              * The reason of the error. This is a constant value that identifies the
              * proximate cause of the error. Error reasons are unique within a particular
        -     * domain of errors. This should be at most 63 characters and match
        -     * /[A-Z0-9_]+/.
        +     * domain of errors. This should be at most 63 characters and match a
        +     * regular expression of `[A-Z][A-Z0-9_]+[A-Z0-9]`, which represents
        +     * UPPER_SNAKE_CASE.
              * 
        * * string reason = 1; @@ -864,13 +899,14 @@ public Builder setReasonBytes(com.google.protobuf.ByteString value) { throw new NullPointerException(); } checkByteStringIsUtf8(value); - reason_ = value; + bitField0_ |= 0x00000001; onChanged(); return this; } private java.lang.Object domain_ = ""; + /** * * @@ -898,6 +934,7 @@ public java.lang.String getDomain() { return (java.lang.String) ref; } } + /** * * @@ -925,6 +962,7 @@ public com.google.protobuf.ByteString getDomainBytes() { return (com.google.protobuf.ByteString) ref; } } + /** * * @@ -946,11 +984,12 @@ public Builder setDomain(java.lang.String value) { if (value == null) { throw new NullPointerException(); } - domain_ = value; + bitField0_ |= 0x00000002; onChanged(); return this; } + /** * * @@ -968,11 +1007,12 @@ public Builder setDomain(java.lang.String value) { * @return This builder for chaining. */ public Builder clearDomain() { - domain_ = getDefaultInstance().getDomain(); + bitField0_ = (bitField0_ & ~0x00000002); onChanged(); return this; } + /** * * @@ -995,8 +1035,8 @@ public Builder setDomainBytes(com.google.protobuf.ByteString value) { throw new NullPointerException(); } checkByteStringIsUtf8(value); - domain_ = value; + bitField0_ |= 0x00000002; onChanged(); return this; } @@ -1012,8 +1052,6 @@ private com.google.protobuf.MapField interna private com.google.protobuf.MapField internalGetMutableMetadata() { - onChanged(); - ; if (metadata_ == null) { metadata_ = com.google.protobuf.MapField.newMapField(MetadataDefaultEntryHolder.defaultEntry); @@ -1021,22 +1059,27 @@ private com.google.protobuf.MapField interna if (!metadata_.isMutable()) { metadata_ = metadata_.copy(); } + bitField0_ |= 0x00000004; + onChanged(); return metadata_; } public int getMetadataCount() { return internalGetMetadata().getMap().size(); } + /** * * *
              * Additional structured details about this error.
        -     * Keys should match /[a-zA-Z0-9-_]/ and be limited to 64 characters in
        +     *
        +     * Keys must match a regular expression of `[a-z][a-zA-Z0-9-_]+` but should
        +     * ideally be lowerCamelCase. Also, they must be limited to 64 characters in
              * length. When identifying the current value of an exceeded limit, the units
              * should be contained in the key, not the value.  For example, rather than
        -     * {"instanceLimit": "100/request"}, should be returned as,
        -     * {"instanceLimitPerRequest": "100"}, if the client exceeds the number of
        +     * `{"instanceLimit": "100/request"}`, should be returned as,
        +     * `{"instanceLimitPerRequest": "100"}`, if the client exceeds the number of
              * instances that can be created in a single (batch) request.
              * 
        * @@ -1049,22 +1092,26 @@ public boolean containsMetadata(java.lang.String key) { } return internalGetMetadata().getMap().containsKey(key); } + /** Use {@link #getMetadataMap()} instead. */ @java.lang.Override @java.lang.Deprecated public java.util.Map getMetadata() { return getMetadataMap(); } + /** * * *
              * Additional structured details about this error.
        -     * Keys should match /[a-zA-Z0-9-_]/ and be limited to 64 characters in
        +     *
        +     * Keys must match a regular expression of `[a-z][a-zA-Z0-9-_]+` but should
        +     * ideally be lowerCamelCase. Also, they must be limited to 64 characters in
              * length. When identifying the current value of an exceeded limit, the units
              * should be contained in the key, not the value.  For example, rather than
        -     * {"instanceLimit": "100/request"}, should be returned as,
        -     * {"instanceLimitPerRequest": "100"}, if the client exceeds the number of
        +     * `{"instanceLimit": "100/request"}`, should be returned as,
        +     * `{"instanceLimitPerRequest": "100"}`, if the client exceeds the number of
              * instances that can be created in a single (batch) request.
              * 
        * @@ -1074,40 +1121,48 @@ public java.util.Map getMetadata() { public java.util.Map getMetadataMap() { return internalGetMetadata().getMap(); } + /** * * *
              * Additional structured details about this error.
        -     * Keys should match /[a-zA-Z0-9-_]/ and be limited to 64 characters in
        +     *
        +     * Keys must match a regular expression of `[a-z][a-zA-Z0-9-_]+` but should
        +     * ideally be lowerCamelCase. Also, they must be limited to 64 characters in
              * length. When identifying the current value of an exceeded limit, the units
              * should be contained in the key, not the value.  For example, rather than
        -     * {"instanceLimit": "100/request"}, should be returned as,
        -     * {"instanceLimitPerRequest": "100"}, if the client exceeds the number of
        +     * `{"instanceLimit": "100/request"}`, should be returned as,
        +     * `{"instanceLimitPerRequest": "100"}`, if the client exceeds the number of
              * instances that can be created in a single (batch) request.
              * 
        * * map<string, string> metadata = 3; */ @java.lang.Override - public java.lang.String getMetadataOrDefault( - java.lang.String key, java.lang.String defaultValue) { + public /* nullable */ java.lang.String getMetadataOrDefault( + java.lang.String key, + /* nullable */ + java.lang.String defaultValue) { if (key == null) { throw new NullPointerException("map key"); } java.util.Map map = internalGetMetadata().getMap(); return map.containsKey(key) ? map.get(key) : defaultValue; } + /** * * *
              * Additional structured details about this error.
        -     * Keys should match /[a-zA-Z0-9-_]/ and be limited to 64 characters in
        +     *
        +     * Keys must match a regular expression of `[a-z][a-zA-Z0-9-_]+` but should
        +     * ideally be lowerCamelCase. Also, they must be limited to 64 characters in
              * length. When identifying the current value of an exceeded limit, the units
              * should be contained in the key, not the value.  For example, rather than
        -     * {"instanceLimit": "100/request"}, should be returned as,
        -     * {"instanceLimitPerRequest": "100"}, if the client exceeds the number of
        +     * `{"instanceLimit": "100/request"}`, should be returned as,
        +     * `{"instanceLimitPerRequest": "100"}`, if the client exceeds the number of
              * instances that can be created in a single (batch) request.
              * 
        * @@ -1126,19 +1181,23 @@ public java.lang.String getMetadataOrThrow(java.lang.String key) { } public Builder clearMetadata() { + bitField0_ = (bitField0_ & ~0x00000004); internalGetMutableMetadata().getMutableMap().clear(); return this; } + /** * * *
              * Additional structured details about this error.
        -     * Keys should match /[a-zA-Z0-9-_]/ and be limited to 64 characters in
        +     *
        +     * Keys must match a regular expression of `[a-z][a-zA-Z0-9-_]+` but should
        +     * ideally be lowerCamelCase. Also, they must be limited to 64 characters in
              * length. When identifying the current value of an exceeded limit, the units
              * should be contained in the key, not the value.  For example, rather than
        -     * {"instanceLimit": "100/request"}, should be returned as,
        -     * {"instanceLimitPerRequest": "100"}, if the client exceeds the number of
        +     * `{"instanceLimit": "100/request"}`, should be returned as,
        +     * `{"instanceLimitPerRequest": "100"}`, if the client exceeds the number of
              * instances that can be created in a single (batch) request.
              * 
        * @@ -1151,21 +1210,26 @@ public Builder removeMetadata(java.lang.String key) { internalGetMutableMetadata().getMutableMap().remove(key); return this; } + /** Use alternate mutation accessors instead. */ @java.lang.Deprecated public java.util.Map getMutableMetadata() { + bitField0_ |= 0x00000004; return internalGetMutableMetadata().getMutableMap(); } + /** * * *
              * Additional structured details about this error.
        -     * Keys should match /[a-zA-Z0-9-_]/ and be limited to 64 characters in
        +     *
        +     * Keys must match a regular expression of `[a-z][a-zA-Z0-9-_]+` but should
        +     * ideally be lowerCamelCase. Also, they must be limited to 64 characters in
              * length. When identifying the current value of an exceeded limit, the units
              * should be contained in the key, not the value.  For example, rather than
        -     * {"instanceLimit": "100/request"}, should be returned as,
        -     * {"instanceLimitPerRequest": "100"}, if the client exceeds the number of
        +     * `{"instanceLimit": "100/request"}`, should be returned as,
        +     * `{"instanceLimitPerRequest": "100"}`, if the client exceeds the number of
              * instances that can be created in a single (batch) request.
              * 
        * @@ -1178,20 +1242,23 @@ public Builder putMetadata(java.lang.String key, java.lang.String value) { if (value == null) { throw new NullPointerException("map value"); } - internalGetMutableMetadata().getMutableMap().put(key, value); + bitField0_ |= 0x00000004; return this; } + /** * * *
              * Additional structured details about this error.
        -     * Keys should match /[a-zA-Z0-9-_]/ and be limited to 64 characters in
        +     *
        +     * Keys must match a regular expression of `[a-z][a-zA-Z0-9-_]+` but should
        +     * ideally be lowerCamelCase. Also, they must be limited to 64 characters in
              * length. When identifying the current value of an exceeded limit, the units
              * should be contained in the key, not the value.  For example, rather than
        -     * {"instanceLimit": "100/request"}, should be returned as,
        -     * {"instanceLimitPerRequest": "100"}, if the client exceeds the number of
        +     * `{"instanceLimit": "100/request"}`, should be returned as,
        +     * `{"instanceLimitPerRequest": "100"}`, if the client exceeds the number of
              * instances that can be created in a single (batch) request.
              * 
        * @@ -1199,20 +1266,10 @@ public Builder putMetadata(java.lang.String key, java.lang.String value) { */ public Builder putAllMetadata(java.util.Map values) { internalGetMutableMetadata().getMutableMap().putAll(values); + bitField0_ |= 0x00000004; 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.rpc.ErrorInfo) } diff --git a/java-common-protos/proto-google-common-protos/src/main/java/com/google/rpc/ErrorInfoOrBuilder.java b/java-common-protos/proto-google-common-protos/src/main/java/com/google/rpc/ErrorInfoOrBuilder.java index 17a27407b2..4806275780 100644 --- a/java-common-protos/proto-google-common-protos/src/main/java/com/google/rpc/ErrorInfoOrBuilder.java +++ b/java-common-protos/proto-google-common-protos/src/main/java/com/google/rpc/ErrorInfoOrBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,10 +14,13 @@ * limitations under the License. */ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: google/rpc/error_details.proto +// Protobuf Java Version: 4.33.2 package com.google.rpc; +@com.google.protobuf.Generated public interface ErrorInfoOrBuilder extends // @@protoc_insertion_point(interface_extends:google.rpc.ErrorInfo) @@ -29,8 +32,9 @@ public interface ErrorInfoOrBuilder *
            * The reason of the error. This is a constant value that identifies the
            * proximate cause of the error. Error reasons are unique within a particular
        -   * domain of errors. This should be at most 63 characters and match
        -   * /[A-Z0-9_]+/.
        +   * domain of errors. This should be at most 63 characters and match a
        +   * regular expression of `[A-Z][A-Z0-9_]+[A-Z0-9]`, which represents
        +   * UPPER_SNAKE_CASE.
            * 
        * * string reason = 1; @@ -38,14 +42,16 @@ public interface ErrorInfoOrBuilder * @return The reason. */ java.lang.String getReason(); + /** * * *
            * The reason of the error. This is a constant value that identifies the
            * proximate cause of the error. Error reasons are unique within a particular
        -   * domain of errors. This should be at most 63 characters and match
        -   * /[A-Z0-9_]+/.
        +   * domain of errors. This should be at most 63 characters and match a
        +   * regular expression of `[A-Z][A-Z0-9_]+[A-Z0-9]`, which represents
        +   * UPPER_SNAKE_CASE.
            * 
        * * string reason = 1; @@ -71,6 +77,7 @@ public interface ErrorInfoOrBuilder * @return The domain. */ java.lang.String getDomain(); + /** * * @@ -94,83 +101,97 @@ public interface ErrorInfoOrBuilder * *
            * Additional structured details about this error.
        -   * Keys should match /[a-zA-Z0-9-_]/ and be limited to 64 characters in
        +   *
        +   * Keys must match a regular expression of `[a-z][a-zA-Z0-9-_]+` but should
        +   * ideally be lowerCamelCase. Also, they must be limited to 64 characters in
            * length. When identifying the current value of an exceeded limit, the units
            * should be contained in the key, not the value.  For example, rather than
        -   * {"instanceLimit": "100/request"}, should be returned as,
        -   * {"instanceLimitPerRequest": "100"}, if the client exceeds the number of
        +   * `{"instanceLimit": "100/request"}`, should be returned as,
        +   * `{"instanceLimitPerRequest": "100"}`, if the client exceeds the number of
            * instances that can be created in a single (batch) request.
            * 
        * * map<string, string> metadata = 3; */ int getMetadataCount(); + /** * * *
            * Additional structured details about this error.
        -   * Keys should match /[a-zA-Z0-9-_]/ and be limited to 64 characters in
        +   *
        +   * Keys must match a regular expression of `[a-z][a-zA-Z0-9-_]+` but should
        +   * ideally be lowerCamelCase. Also, they must be limited to 64 characters in
            * length. When identifying the current value of an exceeded limit, the units
            * should be contained in the key, not the value.  For example, rather than
        -   * {"instanceLimit": "100/request"}, should be returned as,
        -   * {"instanceLimitPerRequest": "100"}, if the client exceeds the number of
        +   * `{"instanceLimit": "100/request"}`, should be returned as,
        +   * `{"instanceLimitPerRequest": "100"}`, if the client exceeds the number of
            * instances that can be created in a single (batch) request.
            * 
        * * map<string, string> metadata = 3; */ boolean containsMetadata(java.lang.String key); + /** Use {@link #getMetadataMap()} instead. */ @java.lang.Deprecated java.util.Map getMetadata(); + /** * * *
            * Additional structured details about this error.
        -   * Keys should match /[a-zA-Z0-9-_]/ and be limited to 64 characters in
        +   *
        +   * Keys must match a regular expression of `[a-z][a-zA-Z0-9-_]+` but should
        +   * ideally be lowerCamelCase. Also, they must be limited to 64 characters in
            * length. When identifying the current value of an exceeded limit, the units
            * should be contained in the key, not the value.  For example, rather than
        -   * {"instanceLimit": "100/request"}, should be returned as,
        -   * {"instanceLimitPerRequest": "100"}, if the client exceeds the number of
        +   * `{"instanceLimit": "100/request"}`, should be returned as,
        +   * `{"instanceLimitPerRequest": "100"}`, if the client exceeds the number of
            * instances that can be created in a single (batch) request.
            * 
        * * map<string, string> metadata = 3; */ java.util.Map getMetadataMap(); + /** * * *
            * Additional structured details about this error.
        -   * Keys should match /[a-zA-Z0-9-_]/ and be limited to 64 characters in
        +   *
        +   * Keys must match a regular expression of `[a-z][a-zA-Z0-9-_]+` but should
        +   * ideally be lowerCamelCase. Also, they must be limited to 64 characters in
            * length. When identifying the current value of an exceeded limit, the units
            * should be contained in the key, not the value.  For example, rather than
        -   * {"instanceLimit": "100/request"}, should be returned as,
        -   * {"instanceLimitPerRequest": "100"}, if the client exceeds the number of
        +   * `{"instanceLimit": "100/request"}`, should be returned as,
        +   * `{"instanceLimitPerRequest": "100"}`, if the client exceeds the number of
            * instances that can be created in a single (batch) request.
            * 
        * * map<string, string> metadata = 3; */ - /* nullable */ java.lang.String getMetadataOrDefault( java.lang.String key, /* nullable */ java.lang.String defaultValue); + /** * * *
            * Additional structured details about this error.
        -   * Keys should match /[a-zA-Z0-9-_]/ and be limited to 64 characters in
        +   *
        +   * Keys must match a regular expression of `[a-z][a-zA-Z0-9-_]+` but should
        +   * ideally be lowerCamelCase. Also, they must be limited to 64 characters in
            * length. When identifying the current value of an exceeded limit, the units
            * should be contained in the key, not the value.  For example, rather than
        -   * {"instanceLimit": "100/request"}, should be returned as,
        -   * {"instanceLimitPerRequest": "100"}, if the client exceeds the number of
        +   * `{"instanceLimit": "100/request"}`, should be returned as,
        +   * `{"instanceLimitPerRequest": "100"}`, if the client exceeds the number of
            * instances that can be created in a single (batch) request.
            * 
        * diff --git a/java-common-protos/proto-google-common-protos/src/main/java/com/google/rpc/Help.java b/java-common-protos/proto-google-common-protos/src/main/java/com/google/rpc/Help.java index d1568fa989..ec2e21e6d5 100644 --- a/java-common-protos/proto-google-common-protos/src/main/java/com/google/rpc/Help.java +++ b/java-common-protos/proto-google-common-protos/src/main/java/com/google/rpc/Help.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,9 @@ * limitations under the License. */ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: google/rpc/error_details.proto +// Protobuf Java Version: 4.33.2 package com.google.rpc; @@ -23,6 +25,7 @@ * *
          * Provides links to documentation or for performing an out of band action.
        + *
          * For example, if a quota check failed with an error indicating the calling
          * project hasn't enabled the accessed service, this can contain a URL pointing
          * directly to the right place in the developer console to flip the bit.
        @@ -30,13 +33,25 @@
          *
          * Protobuf type {@code google.rpc.Help}
          */
        -public final class Help extends com.google.protobuf.GeneratedMessageV3
        +@com.google.protobuf.Generated
        +public final class Help extends com.google.protobuf.GeneratedMessage
             implements
             // @@protoc_insertion_point(message_implements:google.rpc.Help)
             HelpOrBuilder {
           private static final long serialVersionUID = 0L;
        +
        +  static {
        +    com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion(
        +        com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC,
        +        /* major= */ 4,
        +        /* minor= */ 33,
        +        /* patch= */ 2,
        +        /* suffix= */ "",
        +        "Help");
        +  }
        +
           // Use Help.newBuilder() to construct.
        -  private Help(com.google.protobuf.GeneratedMessageV3.Builder builder) {
        +  private Help(com.google.protobuf.GeneratedMessage.Builder builder) {
             super(builder);
           }
         
        @@ -44,23 +59,12 @@ private Help() {
             links_ = java.util.Collections.emptyList();
           }
         
        -  @java.lang.Override
        -  @SuppressWarnings({"unused"})
        -  protected java.lang.Object newInstance(UnusedPrivateParameter unused) {
        -    return new Help();
        -  }
        -
        -  @java.lang.Override
        -  public final com.google.protobuf.UnknownFieldSet getUnknownFields() {
        -    return this.unknownFields;
        -  }
        -
           public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
             return com.google.rpc.ErrorDetailsProto.internal_static_google_rpc_Help_descriptor;
           }
         
           @java.lang.Override
        -  protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
        +  protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
               internalGetFieldAccessorTable() {
             return com.google.rpc.ErrorDetailsProto.internal_static_google_rpc_Help_fieldAccessorTable
                 .ensureFieldAccessorsInitialized(
        @@ -84,6 +88,7 @@ public interface LinkOrBuilder
              * @return The description.
              */
             java.lang.String getDescription();
        +
             /**
              *
              *
        @@ -109,6 +114,7 @@ public interface LinkOrBuilder
              * @return The url.
              */
             java.lang.String getUrl();
        +
             /**
              *
              *
        @@ -122,6 +128,7 @@ public interface LinkOrBuilder
              */
             com.google.protobuf.ByteString getUrlBytes();
           }
        +
           /**
            *
            *
        @@ -131,13 +138,24 @@ public interface LinkOrBuilder
            *
            * Protobuf type {@code google.rpc.Help.Link}
            */
        -  public static final class Link extends com.google.protobuf.GeneratedMessageV3
        +  public static final class Link extends com.google.protobuf.GeneratedMessage
               implements
               // @@protoc_insertion_point(message_implements:google.rpc.Help.Link)
               LinkOrBuilder {
             private static final long serialVersionUID = 0L;
        +
        +    static {
        +      com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion(
        +          com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC,
        +          /* major= */ 4,
        +          /* minor= */ 33,
        +          /* patch= */ 2,
        +          /* suffix= */ "",
        +          "Link");
        +    }
        +
             // Use Link.newBuilder() to construct.
        -    private Link(com.google.protobuf.GeneratedMessageV3.Builder builder) {
        +    private Link(com.google.protobuf.GeneratedMessage.Builder builder) {
               super(builder);
             }
         
        @@ -146,23 +164,12 @@ private Link() {
               url_ = "";
             }
         
        -    @java.lang.Override
        -    @SuppressWarnings({"unused"})
        -    protected java.lang.Object newInstance(UnusedPrivateParameter unused) {
        -      return new Link();
        -    }
        -
        -    @java.lang.Override
        -    public final com.google.protobuf.UnknownFieldSet getUnknownFields() {
        -      return this.unknownFields;
        -    }
        -
             public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
               return com.google.rpc.ErrorDetailsProto.internal_static_google_rpc_Help_Link_descriptor;
             }
         
             @java.lang.Override
        -    protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
        +    protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
                 internalGetFieldAccessorTable() {
               return com.google.rpc.ErrorDetailsProto
                   .internal_static_google_rpc_Help_Link_fieldAccessorTable
        @@ -171,7 +178,10 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
             }
         
             public static final int DESCRIPTION_FIELD_NUMBER = 1;
        -    private volatile java.lang.Object description_;
        +
        +    @SuppressWarnings("serial")
        +    private volatile java.lang.Object description_ = "";
        +
             /**
              *
              *
        @@ -195,6 +205,7 @@ public java.lang.String getDescription() {
                 return s;
               }
             }
        +
             /**
              *
              *
        @@ -220,7 +231,10 @@ public com.google.protobuf.ByteString getDescriptionBytes() {
             }
         
             public static final int URL_FIELD_NUMBER = 2;
        -    private volatile java.lang.Object url_;
        +
        +    @SuppressWarnings("serial")
        +    private volatile java.lang.Object url_ = "";
        +
             /**
              *
              *
        @@ -244,6 +258,7 @@ public java.lang.String getUrl() {
                 return s;
               }
             }
        +
             /**
              *
              *
        @@ -282,11 +297,11 @@ public final boolean isInitialized() {
         
             @java.lang.Override
             public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException {
        -      if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(description_)) {
        -        com.google.protobuf.GeneratedMessageV3.writeString(output, 1, description_);
        +      if (!com.google.protobuf.GeneratedMessage.isStringEmpty(description_)) {
        +        com.google.protobuf.GeneratedMessage.writeString(output, 1, description_);
               }
        -      if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(url_)) {
        -        com.google.protobuf.GeneratedMessageV3.writeString(output, 2, url_);
        +      if (!com.google.protobuf.GeneratedMessage.isStringEmpty(url_)) {
        +        com.google.protobuf.GeneratedMessage.writeString(output, 2, url_);
               }
               getUnknownFields().writeTo(output);
             }
        @@ -297,11 +312,11 @@ public int getSerializedSize() {
               if (size != -1) return size;
         
               size = 0;
        -      if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(description_)) {
        -        size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, description_);
        +      if (!com.google.protobuf.GeneratedMessage.isStringEmpty(description_)) {
        +        size += com.google.protobuf.GeneratedMessage.computeStringSize(1, description_);
               }
        -      if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(url_)) {
        -        size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, url_);
        +      if (!com.google.protobuf.GeneratedMessage.isStringEmpty(url_)) {
        +        size += com.google.protobuf.GeneratedMessage.computeStringSize(2, url_);
               }
               size += getUnknownFields().getSerializedSize();
               memoizedSize = size;
        @@ -376,38 +391,38 @@ public static com.google.rpc.Help.Link parseFrom(
         
             public static com.google.rpc.Help.Link parseFrom(java.io.InputStream input)
                 throws java.io.IOException {
        -      return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
        +      return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input);
             }
         
             public static com.google.rpc.Help.Link parseFrom(
                 java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
                 throws java.io.IOException {
        -      return com.google.protobuf.GeneratedMessageV3.parseWithIOException(
        +      return com.google.protobuf.GeneratedMessage.parseWithIOException(
                   PARSER, input, extensionRegistry);
             }
         
             public static com.google.rpc.Help.Link parseDelimitedFrom(java.io.InputStream input)
                 throws java.io.IOException {
        -      return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input);
        +      return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input);
             }
         
             public static com.google.rpc.Help.Link parseDelimitedFrom(
                 java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
                 throws java.io.IOException {
        -      return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(
        +      return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(
                   PARSER, input, extensionRegistry);
             }
         
             public static com.google.rpc.Help.Link parseFrom(com.google.protobuf.CodedInputStream input)
                 throws java.io.IOException {
        -      return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
        +      return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input);
             }
         
             public static com.google.rpc.Help.Link parseFrom(
                 com.google.protobuf.CodedInputStream input,
                 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
                 throws java.io.IOException {
        -      return com.google.protobuf.GeneratedMessageV3.parseWithIOException(
        +      return com.google.protobuf.GeneratedMessage.parseWithIOException(
                   PARSER, input, extensionRegistry);
             }
         
        @@ -430,11 +445,11 @@ public Builder toBuilder() {
             }
         
             @java.lang.Override
        -    protected Builder newBuilderForType(
        -        com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
        +    protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) {
               Builder builder = new Builder(parent);
               return builder;
             }
        +
             /**
              *
              *
        @@ -444,8 +459,7 @@ protected Builder newBuilderForType(
              *
              * Protobuf type {@code google.rpc.Help.Link}
              */
        -    public static final class Builder
        -        extends com.google.protobuf.GeneratedMessageV3.Builder
        +    public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder
                 implements
                 // @@protoc_insertion_point(builder_implements:google.rpc.Help.Link)
                 com.google.rpc.Help.LinkOrBuilder {
        @@ -454,7 +468,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
               }
         
               @java.lang.Override
        -      protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
        +      protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
                   internalGetFieldAccessorTable() {
                 return com.google.rpc.ErrorDetailsProto
                     .internal_static_google_rpc_Help_Link_fieldAccessorTable
        @@ -465,17 +479,16 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
               // Construct using com.google.rpc.Help.Link.newBuilder()
               private Builder() {}
         
        -      private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
        +      private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) {
                 super(parent);
               }
         
               @java.lang.Override
               public Builder clear() {
                 super.clear();
        +        bitField0_ = 0;
                 description_ = "";
        -
                 url_ = "";
        -
                 return this;
               }
         
        @@ -501,45 +514,21 @@ public com.google.rpc.Help.Link build() {
               @java.lang.Override
               public com.google.rpc.Help.Link buildPartial() {
                 com.google.rpc.Help.Link result = new com.google.rpc.Help.Link(this);
        -        result.description_ = description_;
        -        result.url_ = url_;
        +        if (bitField0_ != 0) {
        +          buildPartial0(result);
        +        }
                 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);
        +      private void buildPartial0(com.google.rpc.Help.Link result) {
        +        int from_bitField0_ = bitField0_;
        +        if (((from_bitField0_ & 0x00000001) != 0)) {
        +          result.description_ = description_;
        +        }
        +        if (((from_bitField0_ & 0x00000002) != 0)) {
        +          result.url_ = url_;
        +        }
               }
         
               @java.lang.Override
        @@ -556,10 +545,12 @@ public Builder mergeFrom(com.google.rpc.Help.Link other) {
                 if (other == com.google.rpc.Help.Link.getDefaultInstance()) return this;
                 if (!other.getDescription().isEmpty()) {
                   description_ = other.description_;
        +          bitField0_ |= 0x00000001;
                   onChanged();
                 }
                 if (!other.getUrl().isEmpty()) {
                   url_ = other.url_;
        +          bitField0_ |= 0x00000002;
                   onChanged();
                 }
                 this.mergeUnknownFields(other.getUnknownFields());
        @@ -591,13 +582,13 @@ public Builder mergeFrom(
                       case 10:
                         {
                           description_ = input.readStringRequireUtf8();
        -
        +                  bitField0_ |= 0x00000001;
                           break;
                         } // case 10
                       case 18:
                         {
                           url_ = input.readStringRequireUtf8();
        -
        +                  bitField0_ |= 0x00000002;
                           break;
                         } // case 18
                       default:
        @@ -617,7 +608,10 @@ public Builder mergeFrom(
                 return this;
               }
         
        +      private int bitField0_;
        +
               private java.lang.Object description_ = "";
        +
               /**
                *
                *
        @@ -640,6 +634,7 @@ public java.lang.String getDescription() {
                   return (java.lang.String) ref;
                 }
               }
        +
               /**
                *
                *
        @@ -662,6 +657,7 @@ public com.google.protobuf.ByteString getDescriptionBytes() {
                   return (com.google.protobuf.ByteString) ref;
                 }
               }
        +
               /**
                *
                *
        @@ -678,11 +674,12 @@ public Builder setDescription(java.lang.String value) {
                 if (value == null) {
                   throw new NullPointerException();
                 }
        -
                 description_ = value;
        +        bitField0_ |= 0x00000001;
                 onChanged();
                 return this;
               }
        +
               /**
                *
                *
        @@ -695,11 +692,12 @@ public Builder setDescription(java.lang.String value) {
                * @return This builder for chaining.
                */
               public Builder clearDescription() {
        -
                 description_ = getDefaultInstance().getDescription();
        +        bitField0_ = (bitField0_ & ~0x00000001);
                 onChanged();
                 return this;
               }
        +
               /**
                *
                *
        @@ -717,13 +715,14 @@ public Builder setDescriptionBytes(com.google.protobuf.ByteString value) {
                   throw new NullPointerException();
                 }
                 checkByteStringIsUtf8(value);
        -
                 description_ = value;
        +        bitField0_ |= 0x00000001;
                 onChanged();
                 return this;
               }
         
               private java.lang.Object url_ = "";
        +
               /**
                *
                *
        @@ -746,6 +745,7 @@ public java.lang.String getUrl() {
                   return (java.lang.String) ref;
                 }
               }
        +
               /**
                *
                *
        @@ -768,6 +768,7 @@ public com.google.protobuf.ByteString getUrlBytes() {
                   return (com.google.protobuf.ByteString) ref;
                 }
               }
        +
               /**
                *
                *
        @@ -784,11 +785,12 @@ public Builder setUrl(java.lang.String value) {
                 if (value == null) {
                   throw new NullPointerException();
                 }
        -
                 url_ = value;
        +        bitField0_ |= 0x00000002;
                 onChanged();
                 return this;
               }
        +
               /**
                *
                *
        @@ -801,11 +803,12 @@ public Builder setUrl(java.lang.String value) {
                * @return This builder for chaining.
                */
               public Builder clearUrl() {
        -
                 url_ = getDefaultInstance().getUrl();
        +        bitField0_ = (bitField0_ & ~0x00000002);
                 onChanged();
                 return this;
               }
        +
               /**
                *
                *
        @@ -823,24 +826,12 @@ public Builder setUrlBytes(com.google.protobuf.ByteString value) {
                   throw new NullPointerException();
                 }
                 checkByteStringIsUtf8(value);
        -
                 url_ = 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.rpc.Help.Link)
             }
         
        @@ -894,7 +885,10 @@ public com.google.rpc.Help.Link getDefaultInstanceForType() {
           }
         
           public static final int LINKS_FIELD_NUMBER = 1;
        +
        +  @SuppressWarnings("serial")
           private java.util.List links_;
        +
           /**
            *
            *
        @@ -908,6 +902,7 @@ public com.google.rpc.Help.Link getDefaultInstanceForType() {
           public java.util.List getLinksList() {
             return links_;
           }
        +
           /**
            *
            *
        @@ -921,6 +916,7 @@ public java.util.List getLinksList() {
           public java.util.List getLinksOrBuilderList() {
             return links_;
           }
        +
           /**
            *
            *
        @@ -934,6 +930,7 @@ public java.util.List getLinksOrBui
           public int getLinksCount() {
             return links_.size();
           }
        +
           /**
            *
            *
        @@ -947,6 +944,7 @@ public int getLinksCount() {
           public com.google.rpc.Help.Link getLinks(int index) {
             return links_.get(index);
           }
        +
           /**
            *
            *
        @@ -1062,38 +1060,38 @@ public static com.google.rpc.Help parseFrom(
         
           public static com.google.rpc.Help parseFrom(java.io.InputStream input)
               throws java.io.IOException {
        -    return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
        +    return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input);
           }
         
           public static com.google.rpc.Help parseFrom(
               java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
               throws java.io.IOException {
        -    return com.google.protobuf.GeneratedMessageV3.parseWithIOException(
        +    return com.google.protobuf.GeneratedMessage.parseWithIOException(
                 PARSER, input, extensionRegistry);
           }
         
           public static com.google.rpc.Help parseDelimitedFrom(java.io.InputStream input)
               throws java.io.IOException {
        -    return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input);
        +    return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input);
           }
         
           public static com.google.rpc.Help parseDelimitedFrom(
               java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
               throws java.io.IOException {
        -    return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(
        +    return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(
                 PARSER, input, extensionRegistry);
           }
         
           public static com.google.rpc.Help parseFrom(com.google.protobuf.CodedInputStream input)
               throws java.io.IOException {
        -    return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
        +    return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input);
           }
         
           public static com.google.rpc.Help parseFrom(
               com.google.protobuf.CodedInputStream input,
               com.google.protobuf.ExtensionRegistryLite extensionRegistry)
               throws java.io.IOException {
        -    return com.google.protobuf.GeneratedMessageV3.parseWithIOException(
        +    return com.google.protobuf.GeneratedMessage.parseWithIOException(
                 PARSER, input, extensionRegistry);
           }
         
        @@ -1116,15 +1114,17 @@ public Builder toBuilder() {
           }
         
           @java.lang.Override
        -  protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
        +  protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) {
             Builder builder = new Builder(parent);
             return builder;
           }
        +
           /**
            *
            *
            * 
            * Provides links to documentation or for performing an out of band action.
        +   *
            * For example, if a quota check failed with an error indicating the calling
            * project hasn't enabled the accessed service, this can contain a URL pointing
            * directly to the right place in the developer console to flip the bit.
        @@ -1132,7 +1132,7 @@ protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.Build
            *
            * Protobuf type {@code google.rpc.Help}
            */
        -  public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder
        +  public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder
               implements
               // @@protoc_insertion_point(builder_implements:google.rpc.Help)
               com.google.rpc.HelpOrBuilder {
        @@ -1141,7 +1141,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
             }
         
             @java.lang.Override
        -    protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
        +    protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
                 internalGetFieldAccessorTable() {
               return com.google.rpc.ErrorDetailsProto.internal_static_google_rpc_Help_fieldAccessorTable
                   .ensureFieldAccessorsInitialized(
        @@ -1151,13 +1151,14 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
             // Construct using com.google.rpc.Help.newBuilder()
             private Builder() {}
         
        -    private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
        +    private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) {
               super(parent);
             }
         
             @java.lang.Override
             public Builder clear() {
               super.clear();
        +      bitField0_ = 0;
               if (linksBuilder_ == null) {
                 links_ = java.util.Collections.emptyList();
               } else {
        @@ -1190,7 +1191,15 @@ public com.google.rpc.Help build() {
             @java.lang.Override
             public com.google.rpc.Help buildPartial() {
               com.google.rpc.Help result = new com.google.rpc.Help(this);
        -      int from_bitField0_ = bitField0_;
        +      buildPartialRepeatedFields(result);
        +      if (bitField0_ != 0) {
        +        buildPartial0(result);
        +      }
        +      onBuilt();
        +      return result;
        +    }
        +
        +    private void buildPartialRepeatedFields(com.google.rpc.Help result) {
               if (linksBuilder_ == null) {
                 if (((bitField0_ & 0x00000001) != 0)) {
                   links_ = java.util.Collections.unmodifiableList(links_);
        @@ -1200,41 +1209,10 @@ public com.google.rpc.Help buildPartial() {
               } else {
                 result.links_ = linksBuilder_.build();
               }
        -      onBuilt();
        -      return result;
        -    }
        -
        -    @java.lang.Override
        -    public Builder clone() {
        -      return super.clone();
        -    }
        -
        -    @java.lang.Override
        -    public Builder setField(
        -        com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) {
        -      return super.setField(field, value);
             }
         
        -    @java.lang.Override
        -    public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) {
        -      return super.clearField(field);
        -    }
        -
        -    @java.lang.Override
        -    public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) {
        -      return super.clearOneof(oneof);
        -    }
        -
        -    @java.lang.Override
        -    public Builder setRepeatedField(
        -        com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) {
        -      return super.setRepeatedField(field, index, value);
        -    }
        -
        -    @java.lang.Override
        -    public Builder addRepeatedField(
        -        com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) {
        -      return super.addRepeatedField(field, value);
        +    private void buildPartial0(com.google.rpc.Help result) {
        +      int from_bitField0_ = bitField0_;
             }
         
             @java.lang.Override
        @@ -1268,8 +1246,8 @@ public Builder mergeFrom(com.google.rpc.Help other) {
                     links_ = other.links_;
                     bitField0_ = (bitField0_ & ~0x00000001);
                     linksBuilder_ =
        -                com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders
        -                    ? getLinksFieldBuilder()
        +                com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders
        +                    ? internalGetLinksFieldBuilder()
                             : null;
                   } else {
                     linksBuilder_.addAllMessages(other.links_);
        @@ -1342,7 +1320,7 @@ private void ensureLinksIsMutable() {
               }
             }
         
        -    private com.google.protobuf.RepeatedFieldBuilderV3<
        +    private com.google.protobuf.RepeatedFieldBuilder<
                     com.google.rpc.Help.Link,
                     com.google.rpc.Help.Link.Builder,
                     com.google.rpc.Help.LinkOrBuilder>
        @@ -1364,6 +1342,7 @@ public java.util.List getLinksList() {
                 return linksBuilder_.getMessageList();
               }
             }
        +
             /**
              *
              *
        @@ -1380,6 +1359,7 @@ public int getLinksCount() {
                 return linksBuilder_.getCount();
               }
             }
        +
             /**
              *
              *
        @@ -1396,6 +1376,7 @@ public com.google.rpc.Help.Link getLinks(int index) {
                 return linksBuilder_.getMessage(index);
               }
             }
        +
             /**
              *
              *
        @@ -1418,6 +1399,7 @@ public Builder setLinks(int index, com.google.rpc.Help.Link value) {
               }
               return this;
             }
        +
             /**
              *
              *
        @@ -1437,6 +1419,7 @@ public Builder setLinks(int index, com.google.rpc.Help.Link.Builder builderForVa
               }
               return this;
             }
        +
             /**
              *
              *
        @@ -1459,6 +1442,7 @@ public Builder addLinks(com.google.rpc.Help.Link value) {
               }
               return this;
             }
        +
             /**
              *
              *
        @@ -1481,6 +1465,7 @@ public Builder addLinks(int index, com.google.rpc.Help.Link value) {
               }
               return this;
             }
        +
             /**
              *
              *
        @@ -1500,6 +1485,7 @@ public Builder addLinks(com.google.rpc.Help.Link.Builder builderForValue) {
               }
               return this;
             }
        +
             /**
              *
              *
        @@ -1519,6 +1505,7 @@ public Builder addLinks(int index, com.google.rpc.Help.Link.Builder builderForVa
               }
               return this;
             }
        +
             /**
              *
              *
        @@ -1538,6 +1525,7 @@ public Builder addAllLinks(java.lang.Iterablerepeated .google.rpc.Help.Link links = 1;
              */
             public com.google.rpc.Help.Link.Builder getLinksBuilder(int index) {
        -      return getLinksFieldBuilder().getBuilder(index);
        +      return internalGetLinksFieldBuilder().getBuilder(index);
             }
        +
             /**
              *
              *
        @@ -1604,6 +1595,7 @@ public com.google.rpc.Help.LinkOrBuilder getLinksOrBuilder(int index) {
                 return linksBuilder_.getMessageOrBuilder(index);
               }
             }
        +
             /**
              *
              *
        @@ -1620,6 +1612,7 @@ public java.util.List getLinksOrBui
                 return java.util.Collections.unmodifiableList(links_);
               }
             }
        +
             /**
              *
              *
        @@ -1630,8 +1623,10 @@ public java.util.List getLinksOrBui
              * repeated .google.rpc.Help.Link links = 1;
              */
             public com.google.rpc.Help.Link.Builder addLinksBuilder() {
        -      return getLinksFieldBuilder().addBuilder(com.google.rpc.Help.Link.getDefaultInstance());
        +      return internalGetLinksFieldBuilder()
        +          .addBuilder(com.google.rpc.Help.Link.getDefaultInstance());
             }
        +
             /**
              *
              *
        @@ -1642,9 +1637,10 @@ public com.google.rpc.Help.Link.Builder addLinksBuilder() {
              * repeated .google.rpc.Help.Link links = 1;
              */
             public com.google.rpc.Help.Link.Builder addLinksBuilder(int index) {
        -      return getLinksFieldBuilder()
        +      return internalGetLinksFieldBuilder()
                   .addBuilder(index, com.google.rpc.Help.Link.getDefaultInstance());
             }
        +
             /**
              *
              *
        @@ -1655,17 +1651,17 @@ public com.google.rpc.Help.Link.Builder addLinksBuilder(int index) {
              * repeated .google.rpc.Help.Link links = 1;
              */
             public java.util.List getLinksBuilderList() {
        -      return getLinksFieldBuilder().getBuilderList();
        +      return internalGetLinksFieldBuilder().getBuilderList();
             }
         
        -    private com.google.protobuf.RepeatedFieldBuilderV3<
        +    private com.google.protobuf.RepeatedFieldBuilder<
                     com.google.rpc.Help.Link,
                     com.google.rpc.Help.Link.Builder,
                     com.google.rpc.Help.LinkOrBuilder>
        -        getLinksFieldBuilder() {
        +        internalGetLinksFieldBuilder() {
               if (linksBuilder_ == null) {
                 linksBuilder_ =
        -            new com.google.protobuf.RepeatedFieldBuilderV3<
        +            new com.google.protobuf.RepeatedFieldBuilder<
                         com.google.rpc.Help.Link,
                         com.google.rpc.Help.Link.Builder,
                         com.google.rpc.Help.LinkOrBuilder>(
        @@ -1675,17 +1671,6 @@ public java.util.List getLinksBuilderList() {
               return linksBuilder_;
             }
         
        -    @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.rpc.Help)
           }
         
        diff --git a/java-common-protos/proto-google-common-protos/src/main/java/com/google/rpc/HelpOrBuilder.java b/java-common-protos/proto-google-common-protos/src/main/java/com/google/rpc/HelpOrBuilder.java
        index 57cd5e0d3f..ca4cd1950e 100644
        --- a/java-common-protos/proto-google-common-protos/src/main/java/com/google/rpc/HelpOrBuilder.java
        +++ b/java-common-protos/proto-google-common-protos/src/main/java/com/google/rpc/HelpOrBuilder.java
        @@ -1,5 +1,5 @@
         /*
        - * Copyright 2020 Google LLC
        + * Copyright 2026 Google LLC
          *
          * Licensed under the Apache License, Version 2.0 (the "License");
          * you may not use this file except in compliance with the License.
        @@ -14,10 +14,13 @@
          * limitations under the License.
          */
         // Generated by the protocol buffer compiler.  DO NOT EDIT!
        +// NO CHECKED-IN PROTOBUF GENCODE
         // source: google/rpc/error_details.proto
        +// Protobuf Java Version: 4.33.2
         
         package com.google.rpc;
         
        +@com.google.protobuf.Generated
         public interface HelpOrBuilder
             extends
             // @@protoc_insertion_point(interface_extends:google.rpc.Help)
        @@ -33,6 +36,7 @@ public interface HelpOrBuilder
            * repeated .google.rpc.Help.Link links = 1;
            */
           java.util.List getLinksList();
        +
           /**
            *
            *
        @@ -43,6 +47,7 @@ public interface HelpOrBuilder
            * repeated .google.rpc.Help.Link links = 1;
            */
           com.google.rpc.Help.Link getLinks(int index);
        +
           /**
            *
            *
        @@ -53,6 +58,7 @@ public interface HelpOrBuilder
            * repeated .google.rpc.Help.Link links = 1;
            */
           int getLinksCount();
        +
           /**
            *
            *
        @@ -63,6 +69,7 @@ public interface HelpOrBuilder
            * repeated .google.rpc.Help.Link links = 1;
            */
           java.util.List getLinksOrBuilderList();
        +
           /**
            *
            *
        diff --git a/java-common-protos/proto-google-common-protos/src/main/java/com/google/rpc/LocalizedMessage.java b/java-common-protos/proto-google-common-protos/src/main/java/com/google/rpc/LocalizedMessage.java
        index ee374c5480..fadc458ec7 100644
        --- a/java-common-protos/proto-google-common-protos/src/main/java/com/google/rpc/LocalizedMessage.java
        +++ b/java-common-protos/proto-google-common-protos/src/main/java/com/google/rpc/LocalizedMessage.java
        @@ -1,5 +1,5 @@
         /*
        - * Copyright 2020 Google LLC
        + * Copyright 2026 Google LLC
          *
          * Licensed under the Apache License, Version 2.0 (the "License");
          * you may not use this file except in compliance with the License.
        @@ -14,7 +14,9 @@
          * limitations under the License.
          */
         // Generated by the protocol buffer compiler.  DO NOT EDIT!
        +// NO CHECKED-IN PROTOBUF GENCODE
         // source: google/rpc/error_details.proto
        +// Protobuf Java Version: 4.33.2
         
         package com.google.rpc;
         
        @@ -28,13 +30,25 @@
          *
          * Protobuf type {@code google.rpc.LocalizedMessage}
          */
        -public final class LocalizedMessage extends com.google.protobuf.GeneratedMessageV3
        +@com.google.protobuf.Generated
        +public final class LocalizedMessage extends com.google.protobuf.GeneratedMessage
             implements
             // @@protoc_insertion_point(message_implements:google.rpc.LocalizedMessage)
             LocalizedMessageOrBuilder {
           private static final long serialVersionUID = 0L;
        +
        +  static {
        +    com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion(
        +        com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC,
        +        /* major= */ 4,
        +        /* minor= */ 33,
        +        /* patch= */ 2,
        +        /* suffix= */ "",
        +        "LocalizedMessage");
        +  }
        +
           // Use LocalizedMessage.newBuilder() to construct.
        -  private LocalizedMessage(com.google.protobuf.GeneratedMessageV3.Builder builder) {
        +  private LocalizedMessage(com.google.protobuf.GeneratedMessage.Builder builder) {
             super(builder);
           }
         
        @@ -43,23 +57,12 @@ private LocalizedMessage() {
             message_ = "";
           }
         
        -  @java.lang.Override
        -  @SuppressWarnings({"unused"})
        -  protected java.lang.Object newInstance(UnusedPrivateParameter unused) {
        -    return new LocalizedMessage();
        -  }
        -
        -  @java.lang.Override
        -  public final com.google.protobuf.UnknownFieldSet getUnknownFields() {
        -    return this.unknownFields;
        -  }
        -
           public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
             return com.google.rpc.ErrorDetailsProto.internal_static_google_rpc_LocalizedMessage_descriptor;
           }
         
           @java.lang.Override
        -  protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
        +  protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
               internalGetFieldAccessorTable() {
             return com.google.rpc.ErrorDetailsProto
                 .internal_static_google_rpc_LocalizedMessage_fieldAccessorTable
        @@ -68,13 +71,16 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
           }
         
           public static final int LOCALE_FIELD_NUMBER = 1;
        -  private volatile java.lang.Object locale_;
        +
        +  @SuppressWarnings("serial")
        +  private volatile java.lang.Object locale_ = "";
        +
           /**
            *
            *
            * 
            * The locale used following the specification defined at
        -   * http://www.rfc-editor.org/rfc/bcp/bcp47.txt.
        +   * https://www.rfc-editor.org/rfc/bcp/bcp47.txt.
            * Examples are: "en-US", "fr-CH", "es-MX"
            * 
        * @@ -94,12 +100,13 @@ public java.lang.String getLocale() { return s; } } + /** * * *
            * The locale used following the specification defined at
        -   * http://www.rfc-editor.org/rfc/bcp/bcp47.txt.
        +   * https://www.rfc-editor.org/rfc/bcp/bcp47.txt.
            * Examples are: "en-US", "fr-CH", "es-MX"
            * 
        * @@ -121,7 +128,10 @@ public com.google.protobuf.ByteString getLocaleBytes() { } public static final int MESSAGE_FIELD_NUMBER = 2; - private volatile java.lang.Object message_; + + @SuppressWarnings("serial") + private volatile java.lang.Object message_ = ""; + /** * * @@ -145,6 +155,7 @@ public java.lang.String getMessage() { return s; } } + /** * * @@ -183,11 +194,11 @@ public final boolean isInitialized() { @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(locale_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, locale_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(locale_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, locale_); } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(message_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 2, message_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(message_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, message_); } getUnknownFields().writeTo(output); } @@ -198,11 +209,11 @@ public int getSerializedSize() { if (size != -1) return size; size = 0; - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(locale_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, locale_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(locale_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, locale_); } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(message_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, message_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(message_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, message_); } size += getUnknownFields().getSerializedSize(); memoizedSize = size; @@ -277,38 +288,38 @@ public static com.google.rpc.LocalizedMessage parseFrom( public static com.google.rpc.LocalizedMessage parseFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); } public static com.google.rpc.LocalizedMessage parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } public static com.google.rpc.LocalizedMessage parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); } public static com.google.rpc.LocalizedMessage parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( PARSER, input, extensionRegistry); } public static com.google.rpc.LocalizedMessage parseFrom( com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); } public static com.google.rpc.LocalizedMessage parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } @@ -331,10 +342,11 @@ public Builder toBuilder() { } @java.lang.Override - protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { Builder builder = new Builder(parent); return builder; } + /** * * @@ -345,7 +357,7 @@ protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.Build * * Protobuf type {@code google.rpc.LocalizedMessage} */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder implements // @@protoc_insertion_point(builder_implements:google.rpc.LocalizedMessage) com.google.rpc.LocalizedMessageOrBuilder { @@ -355,7 +367,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.rpc.ErrorDetailsProto .internal_static_google_rpc_LocalizedMessage_fieldAccessorTable @@ -366,17 +378,16 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { // Construct using com.google.rpc.LocalizedMessage.newBuilder() private Builder() {} - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { super(parent); } @java.lang.Override public Builder clear() { super.clear(); + bitField0_ = 0; locale_ = ""; - message_ = ""; - return this; } @@ -403,43 +414,21 @@ public com.google.rpc.LocalizedMessage build() { @java.lang.Override public com.google.rpc.LocalizedMessage buildPartial() { com.google.rpc.LocalizedMessage result = new com.google.rpc.LocalizedMessage(this); - result.locale_ = locale_; - result.message_ = message_; + if (bitField0_ != 0) { + buildPartial0(result); + } 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); + private void buildPartial0(com.google.rpc.LocalizedMessage result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.locale_ = locale_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.message_ = message_; + } } @java.lang.Override @@ -456,10 +445,12 @@ public Builder mergeFrom(com.google.rpc.LocalizedMessage other) { if (other == com.google.rpc.LocalizedMessage.getDefaultInstance()) return this; if (!other.getLocale().isEmpty()) { locale_ = other.locale_; + bitField0_ |= 0x00000001; onChanged(); } if (!other.getMessage().isEmpty()) { message_ = other.message_; + bitField0_ |= 0x00000002; onChanged(); } this.mergeUnknownFields(other.getUnknownFields()); @@ -491,13 +482,13 @@ public Builder mergeFrom( case 10: { locale_ = input.readStringRequireUtf8(); - + bitField0_ |= 0x00000001; break; } // case 10 case 18: { message_ = input.readStringRequireUtf8(); - + bitField0_ |= 0x00000002; break; } // case 18 default: @@ -517,13 +508,16 @@ public Builder mergeFrom( return this; } + private int bitField0_; + private java.lang.Object locale_ = ""; + /** * * *
              * The locale used following the specification defined at
        -     * http://www.rfc-editor.org/rfc/bcp/bcp47.txt.
        +     * https://www.rfc-editor.org/rfc/bcp/bcp47.txt.
              * Examples are: "en-US", "fr-CH", "es-MX"
              * 
        * @@ -542,12 +536,13 @@ public java.lang.String getLocale() { return (java.lang.String) ref; } } + /** * * *
              * The locale used following the specification defined at
        -     * http://www.rfc-editor.org/rfc/bcp/bcp47.txt.
        +     * https://www.rfc-editor.org/rfc/bcp/bcp47.txt.
              * Examples are: "en-US", "fr-CH", "es-MX"
              * 
        * @@ -566,12 +561,13 @@ public com.google.protobuf.ByteString getLocaleBytes() { return (com.google.protobuf.ByteString) ref; } } + /** * * *
              * The locale used following the specification defined at
        -     * http://www.rfc-editor.org/rfc/bcp/bcp47.txt.
        +     * https://www.rfc-editor.org/rfc/bcp/bcp47.txt.
              * Examples are: "en-US", "fr-CH", "es-MX"
              * 
        * @@ -584,17 +580,18 @@ public Builder setLocale(java.lang.String value) { if (value == null) { throw new NullPointerException(); } - locale_ = value; + bitField0_ |= 0x00000001; onChanged(); return this; } + /** * * *
              * The locale used following the specification defined at
        -     * http://www.rfc-editor.org/rfc/bcp/bcp47.txt.
        +     * https://www.rfc-editor.org/rfc/bcp/bcp47.txt.
              * Examples are: "en-US", "fr-CH", "es-MX"
              * 
        * @@ -603,17 +600,18 @@ public Builder setLocale(java.lang.String value) { * @return This builder for chaining. */ public Builder clearLocale() { - locale_ = getDefaultInstance().getLocale(); + bitField0_ = (bitField0_ & ~0x00000001); onChanged(); return this; } + /** * * *
              * The locale used following the specification defined at
        -     * http://www.rfc-editor.org/rfc/bcp/bcp47.txt.
        +     * https://www.rfc-editor.org/rfc/bcp/bcp47.txt.
              * Examples are: "en-US", "fr-CH", "es-MX"
              * 
        * @@ -627,13 +625,14 @@ public Builder setLocaleBytes(com.google.protobuf.ByteString value) { throw new NullPointerException(); } checkByteStringIsUtf8(value); - locale_ = value; + bitField0_ |= 0x00000001; onChanged(); return this; } private java.lang.Object message_ = ""; + /** * * @@ -656,6 +655,7 @@ public java.lang.String getMessage() { return (java.lang.String) ref; } } + /** * * @@ -678,6 +678,7 @@ public com.google.protobuf.ByteString getMessageBytes() { return (com.google.protobuf.ByteString) ref; } } + /** * * @@ -694,11 +695,12 @@ public Builder setMessage(java.lang.String value) { if (value == null) { throw new NullPointerException(); } - message_ = value; + bitField0_ |= 0x00000002; onChanged(); return this; } + /** * * @@ -711,11 +713,12 @@ public Builder setMessage(java.lang.String value) { * @return This builder for chaining. */ public Builder clearMessage() { - message_ = getDefaultInstance().getMessage(); + bitField0_ = (bitField0_ & ~0x00000002); onChanged(); return this; } + /** * * @@ -733,23 +736,12 @@ public Builder setMessageBytes(com.google.protobuf.ByteString value) { throw new NullPointerException(); } checkByteStringIsUtf8(value); - message_ = 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.rpc.LocalizedMessage) } diff --git a/java-common-protos/proto-google-common-protos/src/main/java/com/google/rpc/LocalizedMessageOrBuilder.java b/java-common-protos/proto-google-common-protos/src/main/java/com/google/rpc/LocalizedMessageOrBuilder.java index 218162863b..9d1fd25139 100644 --- a/java-common-protos/proto-google-common-protos/src/main/java/com/google/rpc/LocalizedMessageOrBuilder.java +++ b/java-common-protos/proto-google-common-protos/src/main/java/com/google/rpc/LocalizedMessageOrBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,10 +14,13 @@ * limitations under the License. */ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: google/rpc/error_details.proto +// Protobuf Java Version: 4.33.2 package com.google.rpc; +@com.google.protobuf.Generated public interface LocalizedMessageOrBuilder extends // @@protoc_insertion_point(interface_extends:google.rpc.LocalizedMessage) @@ -28,7 +31,7 @@ public interface LocalizedMessageOrBuilder * *
            * The locale used following the specification defined at
        -   * http://www.rfc-editor.org/rfc/bcp/bcp47.txt.
        +   * https://www.rfc-editor.org/rfc/bcp/bcp47.txt.
            * Examples are: "en-US", "fr-CH", "es-MX"
            * 
        * @@ -37,12 +40,13 @@ public interface LocalizedMessageOrBuilder * @return The locale. */ java.lang.String getLocale(); + /** * * *
            * The locale used following the specification defined at
        -   * http://www.rfc-editor.org/rfc/bcp/bcp47.txt.
        +   * https://www.rfc-editor.org/rfc/bcp/bcp47.txt.
            * Examples are: "en-US", "fr-CH", "es-MX"
            * 
        * @@ -64,6 +68,7 @@ public interface LocalizedMessageOrBuilder * @return The message. */ java.lang.String getMessage(); + /** * * diff --git a/java-common-protos/proto-google-common-protos/src/main/java/com/google/rpc/PreconditionFailure.java b/java-common-protos/proto-google-common-protos/src/main/java/com/google/rpc/PreconditionFailure.java index bb4d9a0cc1..5b5e5fb66b 100644 --- a/java-common-protos/proto-google-common-protos/src/main/java/com/google/rpc/PreconditionFailure.java +++ b/java-common-protos/proto-google-common-protos/src/main/java/com/google/rpc/PreconditionFailure.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,9 @@ * limitations under the License. */ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: google/rpc/error_details.proto +// Protobuf Java Version: 4.33.2 package com.google.rpc; @@ -23,6 +25,7 @@ * *
          * Describes what preconditions have failed.
        + *
          * For example, if an RPC failed because it required the Terms of Service to be
          * acknowledged, it could list the terms of service violation in the
          * PreconditionFailure message.
        @@ -30,13 +33,25 @@
          *
          * Protobuf type {@code google.rpc.PreconditionFailure}
          */
        -public final class PreconditionFailure extends com.google.protobuf.GeneratedMessageV3
        +@com.google.protobuf.Generated
        +public final class PreconditionFailure extends com.google.protobuf.GeneratedMessage
             implements
             // @@protoc_insertion_point(message_implements:google.rpc.PreconditionFailure)
             PreconditionFailureOrBuilder {
           private static final long serialVersionUID = 0L;
        +
        +  static {
        +    com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion(
        +        com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC,
        +        /* major= */ 4,
        +        /* minor= */ 33,
        +        /* patch= */ 2,
        +        /* suffix= */ "",
        +        "PreconditionFailure");
        +  }
        +
           // Use PreconditionFailure.newBuilder() to construct.
        -  private PreconditionFailure(com.google.protobuf.GeneratedMessageV3.Builder builder) {
        +  private PreconditionFailure(com.google.protobuf.GeneratedMessage.Builder builder) {
             super(builder);
           }
         
        @@ -44,24 +59,13 @@ private PreconditionFailure() {
             violations_ = java.util.Collections.emptyList();
           }
         
        -  @java.lang.Override
        -  @SuppressWarnings({"unused"})
        -  protected java.lang.Object newInstance(UnusedPrivateParameter unused) {
        -    return new PreconditionFailure();
        -  }
        -
        -  @java.lang.Override
        -  public final com.google.protobuf.UnknownFieldSet getUnknownFields() {
        -    return this.unknownFields;
        -  }
        -
           public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
             return com.google.rpc.ErrorDetailsProto
                 .internal_static_google_rpc_PreconditionFailure_descriptor;
           }
         
           @java.lang.Override
        -  protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
        +  protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
               internalGetFieldAccessorTable() {
             return com.google.rpc.ErrorDetailsProto
                 .internal_static_google_rpc_PreconditionFailure_fieldAccessorTable
        @@ -89,6 +93,7 @@ public interface ViolationOrBuilder
              * @return The type.
              */
             java.lang.String getType();
        +
             /**
              *
              *
        @@ -118,6 +123,7 @@ public interface ViolationOrBuilder
              * @return The subject.
              */
             java.lang.String getSubject();
        +
             /**
              *
              *
        @@ -139,6 +145,7 @@ public interface ViolationOrBuilder
              * 
              * A description of how the precondition failed. Developers can use this
              * description to understand how to fix the failure.
        +     *
              * For example: "Terms of service not accepted".
              * 
        * @@ -147,12 +154,14 @@ public interface ViolationOrBuilder * @return The description. */ java.lang.String getDescription(); + /** * * *
              * A description of how the precondition failed. Developers can use this
              * description to understand how to fix the failure.
        +     *
              * For example: "Terms of service not accepted".
              * 
        * @@ -162,6 +171,7 @@ public interface ViolationOrBuilder */ com.google.protobuf.ByteString getDescriptionBytes(); } + /** * * @@ -171,13 +181,24 @@ public interface ViolationOrBuilder * * Protobuf type {@code google.rpc.PreconditionFailure.Violation} */ - public static final class Violation extends com.google.protobuf.GeneratedMessageV3 + public static final class Violation extends com.google.protobuf.GeneratedMessage implements // @@protoc_insertion_point(message_implements:google.rpc.PreconditionFailure.Violation) ViolationOrBuilder { private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "Violation"); + } + // Use Violation.newBuilder() to construct. - private Violation(com.google.protobuf.GeneratedMessageV3.Builder builder) { + private Violation(com.google.protobuf.GeneratedMessage.Builder builder) { super(builder); } @@ -187,24 +208,13 @@ private Violation() { description_ = ""; } - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new Violation(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.rpc.ErrorDetailsProto .internal_static_google_rpc_PreconditionFailure_Violation_descriptor; } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.rpc.ErrorDetailsProto .internal_static_google_rpc_PreconditionFailure_Violation_fieldAccessorTable @@ -214,7 +224,10 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } public static final int TYPE_FIELD_NUMBER = 1; - private volatile java.lang.Object type_; + + @SuppressWarnings("serial") + private volatile java.lang.Object type_ = ""; + /** * * @@ -240,6 +253,7 @@ public java.lang.String getType() { return s; } } + /** * * @@ -267,7 +281,10 @@ public com.google.protobuf.ByteString getTypeBytes() { } public static final int SUBJECT_FIELD_NUMBER = 2; - private volatile java.lang.Object subject_; + + @SuppressWarnings("serial") + private volatile java.lang.Object subject_ = ""; + /** * * @@ -293,6 +310,7 @@ public java.lang.String getSubject() { return s; } } + /** * * @@ -320,13 +338,17 @@ public com.google.protobuf.ByteString getSubjectBytes() { } public static final int DESCRIPTION_FIELD_NUMBER = 3; - private volatile java.lang.Object description_; + + @SuppressWarnings("serial") + private volatile java.lang.Object description_ = ""; + /** * * *
              * A description of how the precondition failed. Developers can use this
              * description to understand how to fix the failure.
        +     *
              * For example: "Terms of service not accepted".
              * 
        * @@ -346,12 +368,14 @@ public java.lang.String getDescription() { return s; } } + /** * * *
              * A description of how the precondition failed. Developers can use this
              * description to understand how to fix the failure.
        +     *
              * For example: "Terms of service not accepted".
              * 
        * @@ -386,14 +410,14 @@ public final boolean isInitialized() { @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(type_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, type_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(type_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, type_); } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(subject_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 2, subject_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(subject_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, subject_); } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(description_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 3, description_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(description_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 3, description_); } getUnknownFields().writeTo(output); } @@ -404,14 +428,14 @@ public int getSerializedSize() { if (size != -1) return size; size = 0; - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(type_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, type_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(type_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, type_); } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(subject_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, subject_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(subject_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, subject_); } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(description_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, description_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(description_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(3, description_); } size += getUnknownFields().getSerializedSize(); memoizedSize = size; @@ -491,38 +515,38 @@ public static com.google.rpc.PreconditionFailure.Violation parseFrom( public static com.google.rpc.PreconditionFailure.Violation parseFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); } public static com.google.rpc.PreconditionFailure.Violation parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } public static com.google.rpc.PreconditionFailure.Violation parseDelimitedFrom( java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); } public static com.google.rpc.PreconditionFailure.Violation parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( PARSER, input, extensionRegistry); } public static com.google.rpc.PreconditionFailure.Violation parseFrom( com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); } public static com.google.rpc.PreconditionFailure.Violation parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } @@ -545,11 +569,11 @@ public Builder toBuilder() { } @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { Builder builder = new Builder(parent); return builder; } + /** * * @@ -559,8 +583,7 @@ protected Builder newBuilderForType( * * Protobuf type {@code google.rpc.PreconditionFailure.Violation} */ - public static final class Builder - extends com.google.protobuf.GeneratedMessageV3.Builder + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder implements // @@protoc_insertion_point(builder_implements:google.rpc.PreconditionFailure.Violation) com.google.rpc.PreconditionFailure.ViolationOrBuilder { @@ -570,7 +593,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.rpc.ErrorDetailsProto .internal_static_google_rpc_PreconditionFailure_Violation_fieldAccessorTable @@ -582,19 +605,17 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { // Construct using com.google.rpc.PreconditionFailure.Violation.newBuilder() private Builder() {} - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { super(parent); } @java.lang.Override public Builder clear() { super.clear(); + bitField0_ = 0; type_ = ""; - subject_ = ""; - description_ = ""; - return this; } @@ -622,46 +643,24 @@ public com.google.rpc.PreconditionFailure.Violation build() { public com.google.rpc.PreconditionFailure.Violation buildPartial() { com.google.rpc.PreconditionFailure.Violation result = new com.google.rpc.PreconditionFailure.Violation(this); - result.type_ = type_; - result.subject_ = subject_; - result.description_ = description_; + if (bitField0_ != 0) { + buildPartial0(result); + } 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); + private void buildPartial0(com.google.rpc.PreconditionFailure.Violation result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.type_ = type_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.subject_ = subject_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.description_ = description_; + } } @java.lang.Override @@ -678,14 +677,17 @@ public Builder mergeFrom(com.google.rpc.PreconditionFailure.Violation other) { if (other == com.google.rpc.PreconditionFailure.Violation.getDefaultInstance()) return this; if (!other.getType().isEmpty()) { type_ = other.type_; + bitField0_ |= 0x00000001; onChanged(); } if (!other.getSubject().isEmpty()) { subject_ = other.subject_; + bitField0_ |= 0x00000002; onChanged(); } if (!other.getDescription().isEmpty()) { description_ = other.description_; + bitField0_ |= 0x00000004; onChanged(); } this.mergeUnknownFields(other.getUnknownFields()); @@ -717,19 +719,19 @@ public Builder mergeFrom( case 10: { type_ = input.readStringRequireUtf8(); - + bitField0_ |= 0x00000001; break; } // case 10 case 18: { subject_ = input.readStringRequireUtf8(); - + bitField0_ |= 0x00000002; break; } // case 18 case 26: { description_ = input.readStringRequireUtf8(); - + bitField0_ |= 0x00000004; break; } // case 26 default: @@ -749,7 +751,10 @@ public Builder mergeFrom( return this; } + private int bitField0_; + private java.lang.Object type_ = ""; + /** * * @@ -774,6 +779,7 @@ public java.lang.String getType() { return (java.lang.String) ref; } } + /** * * @@ -798,6 +804,7 @@ public com.google.protobuf.ByteString getTypeBytes() { return (com.google.protobuf.ByteString) ref; } } + /** * * @@ -816,11 +823,12 @@ public Builder setType(java.lang.String value) { if (value == null) { throw new NullPointerException(); } - type_ = value; + bitField0_ |= 0x00000001; onChanged(); return this; } + /** * * @@ -835,11 +843,12 @@ public Builder setType(java.lang.String value) { * @return This builder for chaining. */ public Builder clearType() { - type_ = getDefaultInstance().getType(); + bitField0_ = (bitField0_ & ~0x00000001); onChanged(); return this; } + /** * * @@ -859,13 +868,14 @@ public Builder setTypeBytes(com.google.protobuf.ByteString value) { throw new NullPointerException(); } checkByteStringIsUtf8(value); - type_ = value; + bitField0_ |= 0x00000001; onChanged(); return this; } private java.lang.Object subject_ = ""; + /** * * @@ -890,6 +900,7 @@ public java.lang.String getSubject() { return (java.lang.String) ref; } } + /** * * @@ -914,6 +925,7 @@ public com.google.protobuf.ByteString getSubjectBytes() { return (com.google.protobuf.ByteString) ref; } } + /** * * @@ -932,11 +944,12 @@ public Builder setSubject(java.lang.String value) { if (value == null) { throw new NullPointerException(); } - subject_ = value; + bitField0_ |= 0x00000002; onChanged(); return this; } + /** * * @@ -951,11 +964,12 @@ public Builder setSubject(java.lang.String value) { * @return This builder for chaining. */ public Builder clearSubject() { - subject_ = getDefaultInstance().getSubject(); + bitField0_ = (bitField0_ & ~0x00000002); onChanged(); return this; } + /** * * @@ -975,19 +989,21 @@ public Builder setSubjectBytes(com.google.protobuf.ByteString value) { throw new NullPointerException(); } checkByteStringIsUtf8(value); - subject_ = value; + bitField0_ |= 0x00000002; onChanged(); return this; } private java.lang.Object description_ = ""; + /** * * *
                * A description of how the precondition failed. Developers can use this
                * description to understand how to fix the failure.
        +       *
                * For example: "Terms of service not accepted".
                * 
        * @@ -1006,12 +1022,14 @@ public java.lang.String getDescription() { return (java.lang.String) ref; } } + /** * * *
                * A description of how the precondition failed. Developers can use this
                * description to understand how to fix the failure.
        +       *
                * For example: "Terms of service not accepted".
                * 
        * @@ -1030,12 +1048,14 @@ public com.google.protobuf.ByteString getDescriptionBytes() { return (com.google.protobuf.ByteString) ref; } } + /** * * *
                * A description of how the precondition failed. Developers can use this
                * description to understand how to fix the failure.
        +       *
                * For example: "Terms of service not accepted".
                * 
        * @@ -1048,17 +1068,19 @@ public Builder setDescription(java.lang.String value) { if (value == null) { throw new NullPointerException(); } - description_ = value; + bitField0_ |= 0x00000004; onChanged(); return this; } + /** * * *
                * A description of how the precondition failed. Developers can use this
                * description to understand how to fix the failure.
        +       *
                * For example: "Terms of service not accepted".
                * 
        * @@ -1067,17 +1089,19 @@ public Builder setDescription(java.lang.String value) { * @return This builder for chaining. */ public Builder clearDescription() { - description_ = getDefaultInstance().getDescription(); + bitField0_ = (bitField0_ & ~0x00000004); onChanged(); return this; } + /** * * *
                * A description of how the precondition failed. Developers can use this
                * description to understand how to fix the failure.
        +       *
                * For example: "Terms of service not accepted".
                * 
        * @@ -1091,24 +1115,12 @@ public Builder setDescriptionBytes(com.google.protobuf.ByteString value) { throw new NullPointerException(); } checkByteStringIsUtf8(value); - description_ = 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.rpc.PreconditionFailure.Violation) } @@ -1162,7 +1174,10 @@ public com.google.rpc.PreconditionFailure.Violation getDefaultInstanceForType() } public static final int VIOLATIONS_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") private java.util.List violations_; + /** * * @@ -1176,6 +1191,7 @@ public com.google.rpc.PreconditionFailure.Violation getDefaultInstanceForType() public java.util.List getViolationsList() { return violations_; } + /** * * @@ -1190,6 +1206,7 @@ public java.util.List getViolation getViolationsOrBuilderList() { return violations_; } + /** * * @@ -1203,6 +1220,7 @@ public java.util.List getViolation public int getViolationsCount() { return violations_.size(); } + /** * * @@ -1216,6 +1234,7 @@ public int getViolationsCount() { public com.google.rpc.PreconditionFailure.Violation getViolations(int index) { return violations_.get(index); } + /** * * @@ -1331,38 +1350,38 @@ public static com.google.rpc.PreconditionFailure parseFrom( public static com.google.rpc.PreconditionFailure parseFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); } public static com.google.rpc.PreconditionFailure parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } public static com.google.rpc.PreconditionFailure parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); } public static com.google.rpc.PreconditionFailure parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( PARSER, input, extensionRegistry); } public static com.google.rpc.PreconditionFailure parseFrom( com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); } public static com.google.rpc.PreconditionFailure parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } @@ -1385,15 +1404,17 @@ public Builder toBuilder() { } @java.lang.Override - protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { Builder builder = new Builder(parent); return builder; } + /** * * *
            * Describes what preconditions have failed.
        +   *
            * For example, if an RPC failed because it required the Terms of Service to be
            * acknowledged, it could list the terms of service violation in the
            * PreconditionFailure message.
        @@ -1401,7 +1422,7 @@ protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.Build
            *
            * Protobuf type {@code google.rpc.PreconditionFailure}
            */
        -  public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder
        +  public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder
               implements
               // @@protoc_insertion_point(builder_implements:google.rpc.PreconditionFailure)
               com.google.rpc.PreconditionFailureOrBuilder {
        @@ -1411,7 +1432,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
             }
         
             @java.lang.Override
        -    protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
        +    protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
                 internalGetFieldAccessorTable() {
               return com.google.rpc.ErrorDetailsProto
                   .internal_static_google_rpc_PreconditionFailure_fieldAccessorTable
        @@ -1423,13 +1444,14 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
             // Construct using com.google.rpc.PreconditionFailure.newBuilder()
             private Builder() {}
         
        -    private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
        +    private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) {
               super(parent);
             }
         
             @java.lang.Override
             public Builder clear() {
               super.clear();
        +      bitField0_ = 0;
               if (violationsBuilder_ == null) {
                 violations_ = java.util.Collections.emptyList();
               } else {
        @@ -1463,7 +1485,15 @@ public com.google.rpc.PreconditionFailure build() {
             @java.lang.Override
             public com.google.rpc.PreconditionFailure buildPartial() {
               com.google.rpc.PreconditionFailure result = new com.google.rpc.PreconditionFailure(this);
        -      int from_bitField0_ = bitField0_;
        +      buildPartialRepeatedFields(result);
        +      if (bitField0_ != 0) {
        +        buildPartial0(result);
        +      }
        +      onBuilt();
        +      return result;
        +    }
        +
        +    private void buildPartialRepeatedFields(com.google.rpc.PreconditionFailure result) {
               if (violationsBuilder_ == null) {
                 if (((bitField0_ & 0x00000001) != 0)) {
                   violations_ = java.util.Collections.unmodifiableList(violations_);
        @@ -1473,41 +1503,10 @@ public com.google.rpc.PreconditionFailure buildPartial() {
               } else {
                 result.violations_ = violationsBuilder_.build();
               }
        -      onBuilt();
        -      return result;
             }
         
        -    @java.lang.Override
        -    public Builder clone() {
        -      return super.clone();
        -    }
        -
        -    @java.lang.Override
        -    public Builder setField(
        -        com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) {
        -      return super.setField(field, value);
        -    }
        -
        -    @java.lang.Override
        -    public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) {
        -      return super.clearField(field);
        -    }
        -
        -    @java.lang.Override
        -    public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) {
        -      return super.clearOneof(oneof);
        -    }
        -
        -    @java.lang.Override
        -    public Builder setRepeatedField(
        -        com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) {
        -      return super.setRepeatedField(field, index, value);
        -    }
        -
        -    @java.lang.Override
        -    public Builder addRepeatedField(
        -        com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) {
        -      return super.addRepeatedField(field, value);
        +    private void buildPartial0(com.google.rpc.PreconditionFailure result) {
        +      int from_bitField0_ = bitField0_;
             }
         
             @java.lang.Override
        @@ -1541,8 +1540,8 @@ public Builder mergeFrom(com.google.rpc.PreconditionFailure other) {
                     violations_ = other.violations_;
                     bitField0_ = (bitField0_ & ~0x00000001);
                     violationsBuilder_ =
        -                com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders
        -                    ? getViolationsFieldBuilder()
        +                com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders
        +                    ? internalGetViolationsFieldBuilder()
                             : null;
                   } else {
                     violationsBuilder_.addAllMessages(other.violations_);
        @@ -1618,7 +1617,7 @@ private void ensureViolationsIsMutable() {
               }
             }
         
        -    private com.google.protobuf.RepeatedFieldBuilderV3<
        +    private com.google.protobuf.RepeatedFieldBuilder<
                     com.google.rpc.PreconditionFailure.Violation,
                     com.google.rpc.PreconditionFailure.Violation.Builder,
                     com.google.rpc.PreconditionFailure.ViolationOrBuilder>
        @@ -1640,6 +1639,7 @@ public java.util.List getViolation
                 return violationsBuilder_.getMessageList();
               }
             }
        +
             /**
              *
              *
        @@ -1656,6 +1656,7 @@ public int getViolationsCount() {
                 return violationsBuilder_.getCount();
               }
             }
        +
             /**
              *
              *
        @@ -1672,6 +1673,7 @@ public com.google.rpc.PreconditionFailure.Violation getViolations(int index) {
                 return violationsBuilder_.getMessage(index);
               }
             }
        +
             /**
              *
              *
        @@ -1694,6 +1696,7 @@ public Builder setViolations(int index, com.google.rpc.PreconditionFailure.Viola
               }
               return this;
             }
        +
             /**
              *
              *
        @@ -1714,6 +1717,7 @@ public Builder setViolations(
               }
               return this;
             }
        +
             /**
              *
              *
        @@ -1736,6 +1740,7 @@ public Builder addViolations(com.google.rpc.PreconditionFailure.Violation value)
               }
               return this;
             }
        +
             /**
              *
              *
        @@ -1758,6 +1763,7 @@ public Builder addViolations(int index, com.google.rpc.PreconditionFailure.Viola
               }
               return this;
             }
        +
             /**
              *
              *
        @@ -1778,6 +1784,7 @@ public Builder addViolations(
               }
               return this;
             }
        +
             /**
              *
              *
        @@ -1798,6 +1805,7 @@ public Builder addViolations(
               }
               return this;
             }
        +
             /**
              *
              *
        @@ -1818,6 +1826,7 @@ public Builder addAllViolations(
               }
               return this;
             }
        +
             /**
              *
              *
        @@ -1837,6 +1846,7 @@ public Builder clearViolations() {
               }
               return this;
             }
        +
             /**
              *
              *
        @@ -1856,6 +1866,7 @@ public Builder removeViolations(int index) {
               }
               return this;
             }
        +
             /**
              *
              *
        @@ -1866,8 +1877,9 @@ public Builder removeViolations(int index) {
              * repeated .google.rpc.PreconditionFailure.Violation violations = 1;
              */
             public com.google.rpc.PreconditionFailure.Violation.Builder getViolationsBuilder(int index) {
        -      return getViolationsFieldBuilder().getBuilder(index);
        +      return internalGetViolationsFieldBuilder().getBuilder(index);
             }
        +
             /**
              *
              *
        @@ -1884,6 +1896,7 @@ public com.google.rpc.PreconditionFailure.ViolationOrBuilder getViolationsOrBuil
                 return violationsBuilder_.getMessageOrBuilder(index);
               }
             }
        +
             /**
              *
              *
        @@ -1901,6 +1914,7 @@ public com.google.rpc.PreconditionFailure.ViolationOrBuilder getViolationsOrBuil
                 return java.util.Collections.unmodifiableList(violations_);
               }
             }
        +
             /**
              *
              *
        @@ -1911,9 +1925,10 @@ public com.google.rpc.PreconditionFailure.ViolationOrBuilder getViolationsOrBuil
              * repeated .google.rpc.PreconditionFailure.Violation violations = 1;
              */
             public com.google.rpc.PreconditionFailure.Violation.Builder addViolationsBuilder() {
        -      return getViolationsFieldBuilder()
        +      return internalGetViolationsFieldBuilder()
                   .addBuilder(com.google.rpc.PreconditionFailure.Violation.getDefaultInstance());
             }
        +
             /**
              *
              *
        @@ -1924,9 +1939,10 @@ public com.google.rpc.PreconditionFailure.Violation.Builder addViolationsBuilder
              * repeated .google.rpc.PreconditionFailure.Violation violations = 1;
              */
             public com.google.rpc.PreconditionFailure.Violation.Builder addViolationsBuilder(int index) {
        -      return getViolationsFieldBuilder()
        +      return internalGetViolationsFieldBuilder()
                   .addBuilder(index, com.google.rpc.PreconditionFailure.Violation.getDefaultInstance());
             }
        +
             /**
              *
              *
        @@ -1938,17 +1954,17 @@ public com.google.rpc.PreconditionFailure.Violation.Builder addViolationsBuilder
              */
             public java.util.List
                 getViolationsBuilderList() {
        -      return getViolationsFieldBuilder().getBuilderList();
        +      return internalGetViolationsFieldBuilder().getBuilderList();
             }
         
        -    private com.google.protobuf.RepeatedFieldBuilderV3<
        +    private com.google.protobuf.RepeatedFieldBuilder<
                     com.google.rpc.PreconditionFailure.Violation,
                     com.google.rpc.PreconditionFailure.Violation.Builder,
                     com.google.rpc.PreconditionFailure.ViolationOrBuilder>
        -        getViolationsFieldBuilder() {
        +        internalGetViolationsFieldBuilder() {
               if (violationsBuilder_ == null) {
                 violationsBuilder_ =
        -            new com.google.protobuf.RepeatedFieldBuilderV3<
        +            new com.google.protobuf.RepeatedFieldBuilder<
                         com.google.rpc.PreconditionFailure.Violation,
                         com.google.rpc.PreconditionFailure.Violation.Builder,
                         com.google.rpc.PreconditionFailure.ViolationOrBuilder>(
        @@ -1958,17 +1974,6 @@ public com.google.rpc.PreconditionFailure.Violation.Builder addViolationsBuilder
               return violationsBuilder_;
             }
         
        -    @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.rpc.PreconditionFailure)
           }
         
        diff --git a/java-common-protos/proto-google-common-protos/src/main/java/com/google/rpc/PreconditionFailureOrBuilder.java b/java-common-protos/proto-google-common-protos/src/main/java/com/google/rpc/PreconditionFailureOrBuilder.java
        index bb6e7756fd..b48c2d9437 100644
        --- a/java-common-protos/proto-google-common-protos/src/main/java/com/google/rpc/PreconditionFailureOrBuilder.java
        +++ b/java-common-protos/proto-google-common-protos/src/main/java/com/google/rpc/PreconditionFailureOrBuilder.java
        @@ -1,5 +1,5 @@
         /*
        - * Copyright 2020 Google LLC
        + * Copyright 2026 Google LLC
          *
          * Licensed under the Apache License, Version 2.0 (the "License");
          * you may not use this file except in compliance with the License.
        @@ -14,10 +14,13 @@
          * limitations under the License.
          */
         // Generated by the protocol buffer compiler.  DO NOT EDIT!
        +// NO CHECKED-IN PROTOBUF GENCODE
         // source: google/rpc/error_details.proto
        +// Protobuf Java Version: 4.33.2
         
         package com.google.rpc;
         
        +@com.google.protobuf.Generated
         public interface PreconditionFailureOrBuilder
             extends
             // @@protoc_insertion_point(interface_extends:google.rpc.PreconditionFailure)
        @@ -33,6 +36,7 @@ public interface PreconditionFailureOrBuilder
            * repeated .google.rpc.PreconditionFailure.Violation violations = 1;
            */
           java.util.List getViolationsList();
        +
           /**
            *
            *
        @@ -43,6 +47,7 @@ public interface PreconditionFailureOrBuilder
            * repeated .google.rpc.PreconditionFailure.Violation violations = 1;
            */
           com.google.rpc.PreconditionFailure.Violation getViolations(int index);
        +
           /**
            *
            *
        @@ -53,6 +58,7 @@ public interface PreconditionFailureOrBuilder
            * repeated .google.rpc.PreconditionFailure.Violation violations = 1;
            */
           int getViolationsCount();
        +
           /**
            *
            *
        @@ -64,6 +70,7 @@ public interface PreconditionFailureOrBuilder
            */
           java.util.List
               getViolationsOrBuilderList();
        +
           /**
            *
            *
        diff --git a/java-common-protos/proto-google-common-protos/src/main/java/com/google/rpc/QuotaFailure.java b/java-common-protos/proto-google-common-protos/src/main/java/com/google/rpc/QuotaFailure.java
        index d0527f31c7..15f8ed58b5 100644
        --- a/java-common-protos/proto-google-common-protos/src/main/java/com/google/rpc/QuotaFailure.java
        +++ b/java-common-protos/proto-google-common-protos/src/main/java/com/google/rpc/QuotaFailure.java
        @@ -1,5 +1,5 @@
         /*
        - * Copyright 2020 Google LLC
        + * Copyright 2026 Google LLC
          *
          * Licensed under the Apache License, Version 2.0 (the "License");
          * you may not use this file except in compliance with the License.
        @@ -14,7 +14,9 @@
          * limitations under the License.
          */
         // Generated by the protocol buffer compiler.  DO NOT EDIT!
        +// NO CHECKED-IN PROTOBUF GENCODE
         // source: google/rpc/error_details.proto
        +// Protobuf Java Version: 4.33.2
         
         package com.google.rpc;
         
        @@ -23,25 +25,39 @@
          *
          * 
          * Describes how a quota check failed.
        + *
          * For example if a daily limit was exceeded for the calling project,
          * a service could respond with a QuotaFailure detail containing the project
          * id and the description of the quota limit that was exceeded.  If the
          * calling project hasn't enabled the service in the developer console, then
          * a service could respond with the project id and set `service_disabled`
          * to true.
        + *
          * Also see RetryInfo and Help types for other details about handling a
          * quota failure.
          * 
        * * Protobuf type {@code google.rpc.QuotaFailure} */ -public final class QuotaFailure extends com.google.protobuf.GeneratedMessageV3 +@com.google.protobuf.Generated +public final class QuotaFailure extends com.google.protobuf.GeneratedMessage implements // @@protoc_insertion_point(message_implements:google.rpc.QuotaFailure) QuotaFailureOrBuilder { private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "QuotaFailure"); + } + // Use QuotaFailure.newBuilder() to construct. - private QuotaFailure(com.google.protobuf.GeneratedMessageV3.Builder builder) { + private QuotaFailure(com.google.protobuf.GeneratedMessage.Builder builder) { super(builder); } @@ -49,23 +65,12 @@ private QuotaFailure() { violations_ = java.util.Collections.emptyList(); } - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new QuotaFailure(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.rpc.ErrorDetailsProto.internal_static_google_rpc_QuotaFailure_descriptor; } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.rpc.ErrorDetailsProto .internal_static_google_rpc_QuotaFailure_fieldAccessorTable @@ -92,6 +97,7 @@ public interface ViolationOrBuilder * @return The subject. */ java.lang.String getSubject(); + /** * * @@ -115,6 +121,7 @@ public interface ViolationOrBuilder * description to find more about the quota configuration in the service's * public documentation, or find the relevant quota limit to adjust through * developer console. + * * For example: "Service disabled" or "Daily Limit for read operations * exceeded". *
        @@ -124,6 +131,7 @@ public interface ViolationOrBuilder * @return The description. */ java.lang.String getDescription(); + /** * * @@ -132,6 +140,7 @@ public interface ViolationOrBuilder * description to find more about the quota configuration in the service's * public documentation, or find the relevant quota limit to adjust through * developer console. + * * For example: "Service disabled" or "Daily Limit for read operations * exceeded". *
        @@ -141,7 +150,323 @@ public interface ViolationOrBuilder * @return The bytes for description. */ com.google.protobuf.ByteString getDescriptionBytes(); + + /** + * + * + *
        +     * The API Service from which the `QuotaFailure.Violation` orginates. In
        +     * some cases, Quota issues originate from an API Service other than the one
        +     * that was called. In other words, a dependency of the called API Service
        +     * could be the cause of the `QuotaFailure`, and this field would have the
        +     * dependency API service name.
        +     *
        +     * For example, if the called API is Kubernetes Engine API
        +     * (container.googleapis.com), and a quota violation occurs in the
        +     * Kubernetes Engine API itself, this field would be
        +     * "container.googleapis.com". On the other hand, if the quota violation
        +     * occurs when the Kubernetes Engine API creates VMs in the Compute Engine
        +     * API (compute.googleapis.com), this field would be
        +     * "compute.googleapis.com".
        +     * 
        + * + * string api_service = 3; + * + * @return The apiService. + */ + java.lang.String getApiService(); + + /** + * + * + *
        +     * The API Service from which the `QuotaFailure.Violation` orginates. In
        +     * some cases, Quota issues originate from an API Service other than the one
        +     * that was called. In other words, a dependency of the called API Service
        +     * could be the cause of the `QuotaFailure`, and this field would have the
        +     * dependency API service name.
        +     *
        +     * For example, if the called API is Kubernetes Engine API
        +     * (container.googleapis.com), and a quota violation occurs in the
        +     * Kubernetes Engine API itself, this field would be
        +     * "container.googleapis.com". On the other hand, if the quota violation
        +     * occurs when the Kubernetes Engine API creates VMs in the Compute Engine
        +     * API (compute.googleapis.com), this field would be
        +     * "compute.googleapis.com".
        +     * 
        + * + * string api_service = 3; + * + * @return The bytes for apiService. + */ + com.google.protobuf.ByteString getApiServiceBytes(); + + /** + * + * + *
        +     * The metric of the violated quota. A quota metric is a named counter to
        +     * measure usage, such as API requests or CPUs. When an activity occurs in a
        +     * service, such as Virtual Machine allocation, one or more quota metrics
        +     * may be affected.
        +     *
        +     * For example, "compute.googleapis.com/cpus_per_vm_family",
        +     * "storage.googleapis.com/internet_egress_bandwidth".
        +     * 
        + * + * string quota_metric = 4; + * + * @return The quotaMetric. + */ + java.lang.String getQuotaMetric(); + + /** + * + * + *
        +     * The metric of the violated quota. A quota metric is a named counter to
        +     * measure usage, such as API requests or CPUs. When an activity occurs in a
        +     * service, such as Virtual Machine allocation, one or more quota metrics
        +     * may be affected.
        +     *
        +     * For example, "compute.googleapis.com/cpus_per_vm_family",
        +     * "storage.googleapis.com/internet_egress_bandwidth".
        +     * 
        + * + * string quota_metric = 4; + * + * @return The bytes for quotaMetric. + */ + com.google.protobuf.ByteString getQuotaMetricBytes(); + + /** + * + * + *
        +     * The id of the violated quota. Also know as "limit name", this is the
        +     * unique identifier of a quota in the context of an API service.
        +     *
        +     * For example, "CPUS-PER-VM-FAMILY-per-project-region".
        +     * 
        + * + * string quota_id = 5; + * + * @return The quotaId. + */ + java.lang.String getQuotaId(); + + /** + * + * + *
        +     * The id of the violated quota. Also know as "limit name", this is the
        +     * unique identifier of a quota in the context of an API service.
        +     *
        +     * For example, "CPUS-PER-VM-FAMILY-per-project-region".
        +     * 
        + * + * string quota_id = 5; + * + * @return The bytes for quotaId. + */ + com.google.protobuf.ByteString getQuotaIdBytes(); + + /** + * + * + *
        +     * The dimensions of the violated quota. Every non-global quota is enforced
        +     * on a set of dimensions. While quota metric defines what to count, the
        +     * dimensions specify for what aspects the counter should be increased.
        +     *
        +     * For example, the quota "CPUs per region per VM family" enforces a limit
        +     * on the metric "compute.googleapis.com/cpus_per_vm_family" on dimensions
        +     * "region" and "vm_family". And if the violation occurred in region
        +     * "us-central1" and for VM family "n1", the quota_dimensions would be,
        +     *
        +     * {
        +     * "region": "us-central1",
        +     * "vm_family": "n1",
        +     * }
        +     *
        +     * When a quota is enforced globally, the quota_dimensions would always be
        +     * empty.
        +     * 
        + * + * map<string, string> quota_dimensions = 6; + */ + int getQuotaDimensionsCount(); + + /** + * + * + *
        +     * The dimensions of the violated quota. Every non-global quota is enforced
        +     * on a set of dimensions. While quota metric defines what to count, the
        +     * dimensions specify for what aspects the counter should be increased.
        +     *
        +     * For example, the quota "CPUs per region per VM family" enforces a limit
        +     * on the metric "compute.googleapis.com/cpus_per_vm_family" on dimensions
        +     * "region" and "vm_family". And if the violation occurred in region
        +     * "us-central1" and for VM family "n1", the quota_dimensions would be,
        +     *
        +     * {
        +     * "region": "us-central1",
        +     * "vm_family": "n1",
        +     * }
        +     *
        +     * When a quota is enforced globally, the quota_dimensions would always be
        +     * empty.
        +     * 
        + * + * map<string, string> quota_dimensions = 6; + */ + boolean containsQuotaDimensions(java.lang.String key); + + /** Use {@link #getQuotaDimensionsMap()} instead. */ + @java.lang.Deprecated + java.util.Map getQuotaDimensions(); + + /** + * + * + *
        +     * The dimensions of the violated quota. Every non-global quota is enforced
        +     * on a set of dimensions. While quota metric defines what to count, the
        +     * dimensions specify for what aspects the counter should be increased.
        +     *
        +     * For example, the quota "CPUs per region per VM family" enforces a limit
        +     * on the metric "compute.googleapis.com/cpus_per_vm_family" on dimensions
        +     * "region" and "vm_family". And if the violation occurred in region
        +     * "us-central1" and for VM family "n1", the quota_dimensions would be,
        +     *
        +     * {
        +     * "region": "us-central1",
        +     * "vm_family": "n1",
        +     * }
        +     *
        +     * When a quota is enforced globally, the quota_dimensions would always be
        +     * empty.
        +     * 
        + * + * map<string, string> quota_dimensions = 6; + */ + java.util.Map getQuotaDimensionsMap(); + + /** + * + * + *
        +     * The dimensions of the violated quota. Every non-global quota is enforced
        +     * on a set of dimensions. While quota metric defines what to count, the
        +     * dimensions specify for what aspects the counter should be increased.
        +     *
        +     * For example, the quota "CPUs per region per VM family" enforces a limit
        +     * on the metric "compute.googleapis.com/cpus_per_vm_family" on dimensions
        +     * "region" and "vm_family". And if the violation occurred in region
        +     * "us-central1" and for VM family "n1", the quota_dimensions would be,
        +     *
        +     * {
        +     * "region": "us-central1",
        +     * "vm_family": "n1",
        +     * }
        +     *
        +     * When a quota is enforced globally, the quota_dimensions would always be
        +     * empty.
        +     * 
        + * + * map<string, string> quota_dimensions = 6; + */ + /* nullable */ + java.lang.String getQuotaDimensionsOrDefault( + java.lang.String key, + /* nullable */ + java.lang.String defaultValue); + + /** + * + * + *
        +     * The dimensions of the violated quota. Every non-global quota is enforced
        +     * on a set of dimensions. While quota metric defines what to count, the
        +     * dimensions specify for what aspects the counter should be increased.
        +     *
        +     * For example, the quota "CPUs per region per VM family" enforces a limit
        +     * on the metric "compute.googleapis.com/cpus_per_vm_family" on dimensions
        +     * "region" and "vm_family". And if the violation occurred in region
        +     * "us-central1" and for VM family "n1", the quota_dimensions would be,
        +     *
        +     * {
        +     * "region": "us-central1",
        +     * "vm_family": "n1",
        +     * }
        +     *
        +     * When a quota is enforced globally, the quota_dimensions would always be
        +     * empty.
        +     * 
        + * + * map<string, string> quota_dimensions = 6; + */ + java.lang.String getQuotaDimensionsOrThrow(java.lang.String key); + + /** + * + * + *
        +     * The enforced quota value at the time of the `QuotaFailure`.
        +     *
        +     * For example, if the enforced quota value at the time of the
        +     * `QuotaFailure` on the number of CPUs is "10", then the value of this
        +     * field would reflect this quantity.
        +     * 
        + * + * int64 quota_value = 7; + * + * @return The quotaValue. + */ + long getQuotaValue(); + + /** + * + * + *
        +     * The new quota value being rolled out at the time of the violation. At the
        +     * completion of the rollout, this value will be enforced in place of
        +     * quota_value. If no rollout is in progress at the time of the violation,
        +     * this field is not set.
        +     *
        +     * For example, if at the time of the violation a rollout is in progress
        +     * changing the number of CPUs quota from 10 to 20, 20 would be the value of
        +     * this field.
        +     * 
        + * + * optional int64 future_quota_value = 8; + * + * @return Whether the futureQuotaValue field is set. + */ + boolean hasFutureQuotaValue(); + + /** + * + * + *
        +     * The new quota value being rolled out at the time of the violation. At the
        +     * completion of the rollout, this value will be enforced in place of
        +     * quota_value. If no rollout is in progress at the time of the violation,
        +     * this field is not set.
        +     *
        +     * For example, if at the time of the violation a rollout is in progress
        +     * changing the number of CPUs quota from 10 to 20, 20 would be the value of
        +     * this field.
        +     * 
        + * + * optional int64 future_quota_value = 8; + * + * @return The futureQuotaValue. + */ + long getFutureQuotaValue(); } + /** * * @@ -152,30 +477,33 @@ public interface ViolationOrBuilder * * Protobuf type {@code google.rpc.QuotaFailure.Violation} */ - public static final class Violation extends com.google.protobuf.GeneratedMessageV3 + public static final class Violation extends com.google.protobuf.GeneratedMessage implements // @@protoc_insertion_point(message_implements:google.rpc.QuotaFailure.Violation) ViolationOrBuilder { private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "Violation"); + } + // Use Violation.newBuilder() to construct. - private Violation(com.google.protobuf.GeneratedMessageV3.Builder builder) { + private Violation(com.google.protobuf.GeneratedMessage.Builder builder) { super(builder); } private Violation() { subject_ = ""; description_ = ""; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new Violation(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; + apiService_ = ""; + quotaMetric_ = ""; + quotaId_ = ""; } public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { @@ -183,8 +511,20 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { .internal_static_google_rpc_QuotaFailure_Violation_descriptor; } + @SuppressWarnings({"rawtypes"}) + @java.lang.Override + protected com.google.protobuf.MapFieldReflectionAccessor internalGetMapFieldReflection( + int number) { + switch (number) { + case 6: + return internalGetQuotaDimensions(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.rpc.ErrorDetailsProto .internal_static_google_rpc_QuotaFailure_Violation_fieldAccessorTable @@ -193,8 +533,12 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { com.google.rpc.QuotaFailure.Violation.Builder.class); } + private int bitField0_; public static final int SUBJECT_FIELD_NUMBER = 1; - private volatile java.lang.Object subject_; + + @SuppressWarnings("serial") + private volatile java.lang.Object subject_ = ""; + /** * * @@ -220,6 +564,7 @@ public java.lang.String getSubject() { return s; } } + /** * * @@ -247,7 +592,10 @@ public com.google.protobuf.ByteString getSubjectBytes() { } public static final int DESCRIPTION_FIELD_NUMBER = 2; - private volatile java.lang.Object description_; + + @SuppressWarnings("serial") + private volatile java.lang.Object description_ = ""; + /** * * @@ -256,6 +604,7 @@ public com.google.protobuf.ByteString getSubjectBytes() { * description to find more about the quota configuration in the service's * public documentation, or find the relevant quota limit to adjust through * developer console. + * * For example: "Service disabled" or "Daily Limit for read operations * exceeded". *
        @@ -276,6 +625,7 @@ public java.lang.String getDescription() { return s; } } + /** * * @@ -284,6 +634,7 @@ public java.lang.String getDescription() { * description to find more about the quota configuration in the service's * public documentation, or find the relevant quota limit to adjust through * developer console. + * * For example: "Service disabled" or "Daily Limit for read operations * exceeded". *
        @@ -305,64 +656,557 @@ public com.google.protobuf.ByteString getDescriptionBytes() { } } - private byte memoizedIsInitialized = -1; - - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; + public static final int API_SERVICE_FIELD_NUMBER = 3; - memoizedIsInitialized = 1; - return true; - } + @SuppressWarnings("serial") + private volatile java.lang.Object apiService_ = ""; + /** + * + * + *
        +     * The API Service from which the `QuotaFailure.Violation` orginates. In
        +     * some cases, Quota issues originate from an API Service other than the one
        +     * that was called. In other words, a dependency of the called API Service
        +     * could be the cause of the `QuotaFailure`, and this field would have the
        +     * dependency API service name.
        +     *
        +     * For example, if the called API is Kubernetes Engine API
        +     * (container.googleapis.com), and a quota violation occurs in the
        +     * Kubernetes Engine API itself, this field would be
        +     * "container.googleapis.com". On the other hand, if the quota violation
        +     * occurs when the Kubernetes Engine API creates VMs in the Compute Engine
        +     * API (compute.googleapis.com), this field would be
        +     * "compute.googleapis.com".
        +     * 
        + * + * string api_service = 3; + * + * @return The apiService. + */ @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(subject_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, subject_); - } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(description_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 2, description_); + public java.lang.String getApiService() { + java.lang.Object ref = apiService_; + 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(); + apiService_ = s; + return s; } - getUnknownFields().writeTo(output); } + /** + * + * + *
        +     * The API Service from which the `QuotaFailure.Violation` orginates. In
        +     * some cases, Quota issues originate from an API Service other than the one
        +     * that was called. In other words, a dependency of the called API Service
        +     * could be the cause of the `QuotaFailure`, and this field would have the
        +     * dependency API service name.
        +     *
        +     * For example, if the called API is Kubernetes Engine API
        +     * (container.googleapis.com), and a quota violation occurs in the
        +     * Kubernetes Engine API itself, this field would be
        +     * "container.googleapis.com". On the other hand, if the quota violation
        +     * occurs when the Kubernetes Engine API creates VMs in the Compute Engine
        +     * API (compute.googleapis.com), this field would be
        +     * "compute.googleapis.com".
        +     * 
        + * + * string api_service = 3; + * + * @return The bytes for apiService. + */ @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(subject_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, subject_); - } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(description_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, description_); + public com.google.protobuf.ByteString getApiServiceBytes() { + java.lang.Object ref = apiService_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + apiService_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; } - size += getUnknownFields().getSerializedSize(); - memoizedSize = size; - return size; } + public static final int QUOTA_METRIC_FIELD_NUMBER = 4; + + @SuppressWarnings("serial") + private volatile java.lang.Object quotaMetric_ = ""; + + /** + * + * + *
        +     * The metric of the violated quota. A quota metric is a named counter to
        +     * measure usage, such as API requests or CPUs. When an activity occurs in a
        +     * service, such as Virtual Machine allocation, one or more quota metrics
        +     * may be affected.
        +     *
        +     * For example, "compute.googleapis.com/cpus_per_vm_family",
        +     * "storage.googleapis.com/internet_egress_bandwidth".
        +     * 
        + * + * string quota_metric = 4; + * + * @return The quotaMetric. + */ @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof com.google.rpc.QuotaFailure.Violation)) { - return super.equals(obj); + public java.lang.String getQuotaMetric() { + java.lang.Object ref = quotaMetric_; + 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(); + quotaMetric_ = s; + return s; } - com.google.rpc.QuotaFailure.Violation other = (com.google.rpc.QuotaFailure.Violation) obj; - - if (!getSubject().equals(other.getSubject())) return false; - if (!getDescription().equals(other.getDescription())) return false; - if (!getUnknownFields().equals(other.getUnknownFields())) return false; - return true; } + /** + * + * + *
        +     * The metric of the violated quota. A quota metric is a named counter to
        +     * measure usage, such as API requests or CPUs. When an activity occurs in a
        +     * service, such as Virtual Machine allocation, one or more quota metrics
        +     * may be affected.
        +     *
        +     * For example, "compute.googleapis.com/cpus_per_vm_family",
        +     * "storage.googleapis.com/internet_egress_bandwidth".
        +     * 
        + * + * string quota_metric = 4; + * + * @return The bytes for quotaMetric. + */ @java.lang.Override - public int hashCode() { + public com.google.protobuf.ByteString getQuotaMetricBytes() { + java.lang.Object ref = quotaMetric_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + quotaMetric_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int QUOTA_ID_FIELD_NUMBER = 5; + + @SuppressWarnings("serial") + private volatile java.lang.Object quotaId_ = ""; + + /** + * + * + *
        +     * The id of the violated quota. Also know as "limit name", this is the
        +     * unique identifier of a quota in the context of an API service.
        +     *
        +     * For example, "CPUS-PER-VM-FAMILY-per-project-region".
        +     * 
        + * + * string quota_id = 5; + * + * @return The quotaId. + */ + @java.lang.Override + public java.lang.String getQuotaId() { + java.lang.Object ref = quotaId_; + 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(); + quotaId_ = s; + return s; + } + } + + /** + * + * + *
        +     * The id of the violated quota. Also know as "limit name", this is the
        +     * unique identifier of a quota in the context of an API service.
        +     *
        +     * For example, "CPUS-PER-VM-FAMILY-per-project-region".
        +     * 
        + * + * string quota_id = 5; + * + * @return The bytes for quotaId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getQuotaIdBytes() { + java.lang.Object ref = quotaId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + quotaId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int QUOTA_DIMENSIONS_FIELD_NUMBER = 6; + + private static final class QuotaDimensionsDefaultEntryHolder { + static final com.google.protobuf.MapEntry defaultEntry = + com.google.protobuf.MapEntry.newDefaultInstance( + com.google.rpc.ErrorDetailsProto + .internal_static_google_rpc_QuotaFailure_Violation_QuotaDimensionsEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.STRING, + ""); + } + + @SuppressWarnings("serial") + private com.google.protobuf.MapField quotaDimensions_; + + private com.google.protobuf.MapField + internalGetQuotaDimensions() { + if (quotaDimensions_ == null) { + return com.google.protobuf.MapField.emptyMapField( + QuotaDimensionsDefaultEntryHolder.defaultEntry); + } + return quotaDimensions_; + } + + public int getQuotaDimensionsCount() { + return internalGetQuotaDimensions().getMap().size(); + } + + /** + * + * + *
        +     * The dimensions of the violated quota. Every non-global quota is enforced
        +     * on a set of dimensions. While quota metric defines what to count, the
        +     * dimensions specify for what aspects the counter should be increased.
        +     *
        +     * For example, the quota "CPUs per region per VM family" enforces a limit
        +     * on the metric "compute.googleapis.com/cpus_per_vm_family" on dimensions
        +     * "region" and "vm_family". And if the violation occurred in region
        +     * "us-central1" and for VM family "n1", the quota_dimensions would be,
        +     *
        +     * {
        +     * "region": "us-central1",
        +     * "vm_family": "n1",
        +     * }
        +     *
        +     * When a quota is enforced globally, the quota_dimensions would always be
        +     * empty.
        +     * 
        + * + * map<string, string> quota_dimensions = 6; + */ + @java.lang.Override + public boolean containsQuotaDimensions(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + return internalGetQuotaDimensions().getMap().containsKey(key); + } + + /** Use {@link #getQuotaDimensionsMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getQuotaDimensions() { + return getQuotaDimensionsMap(); + } + + /** + * + * + *
        +     * The dimensions of the violated quota. Every non-global quota is enforced
        +     * on a set of dimensions. While quota metric defines what to count, the
        +     * dimensions specify for what aspects the counter should be increased.
        +     *
        +     * For example, the quota "CPUs per region per VM family" enforces a limit
        +     * on the metric "compute.googleapis.com/cpus_per_vm_family" on dimensions
        +     * "region" and "vm_family". And if the violation occurred in region
        +     * "us-central1" and for VM family "n1", the quota_dimensions would be,
        +     *
        +     * {
        +     * "region": "us-central1",
        +     * "vm_family": "n1",
        +     * }
        +     *
        +     * When a quota is enforced globally, the quota_dimensions would always be
        +     * empty.
        +     * 
        + * + * map<string, string> quota_dimensions = 6; + */ + @java.lang.Override + public java.util.Map getQuotaDimensionsMap() { + return internalGetQuotaDimensions().getMap(); + } + + /** + * + * + *
        +     * The dimensions of the violated quota. Every non-global quota is enforced
        +     * on a set of dimensions. While quota metric defines what to count, the
        +     * dimensions specify for what aspects the counter should be increased.
        +     *
        +     * For example, the quota "CPUs per region per VM family" enforces a limit
        +     * on the metric "compute.googleapis.com/cpus_per_vm_family" on dimensions
        +     * "region" and "vm_family". And if the violation occurred in region
        +     * "us-central1" and for VM family "n1", the quota_dimensions would be,
        +     *
        +     * {
        +     * "region": "us-central1",
        +     * "vm_family": "n1",
        +     * }
        +     *
        +     * When a quota is enforced globally, the quota_dimensions would always be
        +     * empty.
        +     * 
        + * + * map<string, string> quota_dimensions = 6; + */ + @java.lang.Override + public /* nullable */ java.lang.String getQuotaDimensionsOrDefault( + java.lang.String key, + /* nullable */ + java.lang.String defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetQuotaDimensions().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + + /** + * + * + *
        +     * The dimensions of the violated quota. Every non-global quota is enforced
        +     * on a set of dimensions. While quota metric defines what to count, the
        +     * dimensions specify for what aspects the counter should be increased.
        +     *
        +     * For example, the quota "CPUs per region per VM family" enforces a limit
        +     * on the metric "compute.googleapis.com/cpus_per_vm_family" on dimensions
        +     * "region" and "vm_family". And if the violation occurred in region
        +     * "us-central1" and for VM family "n1", the quota_dimensions would be,
        +     *
        +     * {
        +     * "region": "us-central1",
        +     * "vm_family": "n1",
        +     * }
        +     *
        +     * When a quota is enforced globally, the quota_dimensions would always be
        +     * empty.
        +     * 
        + * + * map<string, string> quota_dimensions = 6; + */ + @java.lang.Override + public java.lang.String getQuotaDimensionsOrThrow(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetQuotaDimensions().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public static final int QUOTA_VALUE_FIELD_NUMBER = 7; + private long quotaValue_ = 0L; + + /** + * + * + *
        +     * The enforced quota value at the time of the `QuotaFailure`.
        +     *
        +     * For example, if the enforced quota value at the time of the
        +     * `QuotaFailure` on the number of CPUs is "10", then the value of this
        +     * field would reflect this quantity.
        +     * 
        + * + * int64 quota_value = 7; + * + * @return The quotaValue. + */ + @java.lang.Override + public long getQuotaValue() { + return quotaValue_; + } + + public static final int FUTURE_QUOTA_VALUE_FIELD_NUMBER = 8; + private long futureQuotaValue_ = 0L; + + /** + * + * + *
        +     * The new quota value being rolled out at the time of the violation. At the
        +     * completion of the rollout, this value will be enforced in place of
        +     * quota_value. If no rollout is in progress at the time of the violation,
        +     * this field is not set.
        +     *
        +     * For example, if at the time of the violation a rollout is in progress
        +     * changing the number of CPUs quota from 10 to 20, 20 would be the value of
        +     * this field.
        +     * 
        + * + * optional int64 future_quota_value = 8; + * + * @return Whether the futureQuotaValue field is set. + */ + @java.lang.Override + public boolean hasFutureQuotaValue() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
        +     * The new quota value being rolled out at the time of the violation. At the
        +     * completion of the rollout, this value will be enforced in place of
        +     * quota_value. If no rollout is in progress at the time of the violation,
        +     * this field is not set.
        +     *
        +     * For example, if at the time of the violation a rollout is in progress
        +     * changing the number of CPUs quota from 10 to 20, 20 would be the value of
        +     * this field.
        +     * 
        + * + * optional int64 future_quota_value = 8; + * + * @return The futureQuotaValue. + */ + @java.lang.Override + public long getFutureQuotaValue() { + return futureQuotaValue_; + } + + 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.GeneratedMessage.isStringEmpty(subject_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, subject_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(description_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, description_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(apiService_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 3, apiService_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(quotaMetric_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 4, quotaMetric_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(quotaId_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 5, quotaId_); + } + com.google.protobuf.GeneratedMessage.serializeStringMapTo( + output, internalGetQuotaDimensions(), QuotaDimensionsDefaultEntryHolder.defaultEntry, 6); + if (quotaValue_ != 0L) { + output.writeInt64(7, quotaValue_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeInt64(8, futureQuotaValue_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(subject_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, subject_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(description_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, description_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(apiService_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(3, apiService_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(quotaMetric_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(4, quotaMetric_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(quotaId_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(5, quotaId_); + } + for (java.util.Map.Entry entry : + internalGetQuotaDimensions().getMap().entrySet()) { + com.google.protobuf.MapEntry quotaDimensions__ = + QuotaDimensionsDefaultEntryHolder.defaultEntry + .newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream.computeMessageSize(6, quotaDimensions__); + } + if (quotaValue_ != 0L) { + size += com.google.protobuf.CodedOutputStream.computeInt64Size(7, quotaValue_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeInt64Size(8, futureQuotaValue_); + } + 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.rpc.QuotaFailure.Violation)) { + return super.equals(obj); + } + com.google.rpc.QuotaFailure.Violation other = (com.google.rpc.QuotaFailure.Violation) obj; + + if (!getSubject().equals(other.getSubject())) return false; + if (!getDescription().equals(other.getDescription())) return false; + if (!getApiService().equals(other.getApiService())) return false; + if (!getQuotaMetric().equals(other.getQuotaMetric())) return false; + if (!getQuotaId().equals(other.getQuotaId())) return false; + if (!internalGetQuotaDimensions().equals(other.internalGetQuotaDimensions())) return false; + if (getQuotaValue() != other.getQuotaValue()) return false; + if (hasFutureQuotaValue() != other.hasFutureQuotaValue()) return false; + if (hasFutureQuotaValue()) { + if (getFutureQuotaValue() != other.getFutureQuotaValue()) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { if (memoizedHashCode != 0) { return memoizedHashCode; } @@ -372,6 +1216,22 @@ public int hashCode() { hash = (53 * hash) + getSubject().hashCode(); hash = (37 * hash) + DESCRIPTION_FIELD_NUMBER; hash = (53 * hash) + getDescription().hashCode(); + hash = (37 * hash) + API_SERVICE_FIELD_NUMBER; + hash = (53 * hash) + getApiService().hashCode(); + hash = (37 * hash) + QUOTA_METRIC_FIELD_NUMBER; + hash = (53 * hash) + getQuotaMetric().hashCode(); + hash = (37 * hash) + QUOTA_ID_FIELD_NUMBER; + hash = (53 * hash) + getQuotaId().hashCode(); + if (!internalGetQuotaDimensions().getMap().isEmpty()) { + hash = (37 * hash) + QUOTA_DIMENSIONS_FIELD_NUMBER; + hash = (53 * hash) + internalGetQuotaDimensions().hashCode(); + } + hash = (37 * hash) + QUOTA_VALUE_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getQuotaValue()); + if (hasFutureQuotaValue()) { + hash = (37 * hash) + FUTURE_QUOTA_VALUE_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getFutureQuotaValue()); + } hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; @@ -414,38 +1274,38 @@ public static com.google.rpc.QuotaFailure.Violation parseFrom( public static com.google.rpc.QuotaFailure.Violation parseFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); } public static com.google.rpc.QuotaFailure.Violation parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } public static com.google.rpc.QuotaFailure.Violation parseDelimitedFrom( java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); } public static com.google.rpc.QuotaFailure.Violation parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( PARSER, input, extensionRegistry); } public static com.google.rpc.QuotaFailure.Violation parseFrom( com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); } public static com.google.rpc.QuotaFailure.Violation parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } @@ -468,11 +1328,11 @@ public Builder toBuilder() { } @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { Builder builder = new Builder(parent); return builder; } + /** * * @@ -483,8 +1343,7 @@ protected Builder newBuilderForType( * * Protobuf type {@code google.rpc.QuotaFailure.Violation} */ - public static final class Builder - extends com.google.protobuf.GeneratedMessageV3.Builder + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder implements // @@protoc_insertion_point(builder_implements:google.rpc.QuotaFailure.Violation) com.google.rpc.QuotaFailure.ViolationOrBuilder { @@ -493,8 +1352,30 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { .internal_static_google_rpc_QuotaFailure_Violation_descriptor; } + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapFieldReflectionAccessor internalGetMapFieldReflection( + int number) { + switch (number) { + case 6: + return internalGetQuotaDimensions(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapFieldReflectionAccessor internalGetMutableMapFieldReflection( + int number) { + switch (number) { + case 6: + return internalGetMutableQuotaDimensions(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.rpc.ErrorDetailsProto .internal_static_google_rpc_QuotaFailure_Violation_fieldAccessorTable @@ -506,17 +1387,22 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { // Construct using com.google.rpc.QuotaFailure.Violation.newBuilder() private Builder() {} - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { super(parent); } @java.lang.Override public Builder clear() { super.clear(); + bitField0_ = 0; subject_ = ""; - description_ = ""; - + apiService_ = ""; + quotaMetric_ = ""; + quotaId_ = ""; + internalGetMutableQuotaDimensions().clear(); + quotaValue_ = 0L; + futureQuotaValue_ = 0L; return this; } @@ -544,45 +1430,43 @@ public com.google.rpc.QuotaFailure.Violation build() { public com.google.rpc.QuotaFailure.Violation buildPartial() { com.google.rpc.QuotaFailure.Violation result = new com.google.rpc.QuotaFailure.Violation(this); - result.subject_ = subject_; - result.description_ = description_; + if (bitField0_ != 0) { + buildPartial0(result); + } 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); + private void buildPartial0(com.google.rpc.QuotaFailure.Violation result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.subject_ = subject_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.description_ = description_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.apiService_ = apiService_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.quotaMetric_ = quotaMetric_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.quotaId_ = quotaId_; + } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.quotaDimensions_ = internalGetQuotaDimensions(); + result.quotaDimensions_.makeImmutable(); + } + if (((from_bitField0_ & 0x00000040) != 0)) { + result.quotaValue_ = quotaValue_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000080) != 0)) { + result.futureQuotaValue_ = futureQuotaValue_; + to_bitField0_ |= 0x00000001; + } + result.bitField0_ |= to_bitField0_; } @java.lang.Override @@ -599,12 +1483,37 @@ public Builder mergeFrom(com.google.rpc.QuotaFailure.Violation other) { if (other == com.google.rpc.QuotaFailure.Violation.getDefaultInstance()) return this; if (!other.getSubject().isEmpty()) { subject_ = other.subject_; + bitField0_ |= 0x00000001; onChanged(); } if (!other.getDescription().isEmpty()) { description_ = other.description_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (!other.getApiService().isEmpty()) { + apiService_ = other.apiService_; + bitField0_ |= 0x00000004; + onChanged(); + } + if (!other.getQuotaMetric().isEmpty()) { + quotaMetric_ = other.quotaMetric_; + bitField0_ |= 0x00000008; + onChanged(); + } + if (!other.getQuotaId().isEmpty()) { + quotaId_ = other.quotaId_; + bitField0_ |= 0x00000010; onChanged(); } + internalGetMutableQuotaDimensions().mergeFrom(other.internalGetQuotaDimensions()); + bitField0_ |= 0x00000020; + if (other.getQuotaValue() != 0L) { + setQuotaValue(other.getQuotaValue()); + } + if (other.hasFutureQuotaValue()) { + setFutureQuotaValue(other.getFutureQuotaValue()); + } this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; @@ -634,24 +1543,67 @@ public Builder mergeFrom( case 10: { subject_ = input.readStringRequireUtf8(); - + bitField0_ |= 0x00000001; break; } // case 10 case 18: { description_ = input.readStringRequireUtf8(); - + bitField0_ |= 0x00000002; break; } // case 18 - default: + case 26: { - if (!super.parseUnknownField(input, extensionRegistry, tag)) { - done = true; // was an endgroup tag - } + apiService_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; break; - } // default: - } // switch (tag) - } // while (!done) + } // case 26 + case 34: + { + quotaMetric_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000008; + break; + } // case 34 + case 42: + { + quotaId_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000010; + break; + } // case 42 + case 50: + { + com.google.protobuf.MapEntry + quotaDimensions__ = + input.readMessage( + QuotaDimensionsDefaultEntryHolder.defaultEntry.getParserForType(), + extensionRegistry); + internalGetMutableQuotaDimensions() + .getMutableMap() + .put(quotaDimensions__.getKey(), quotaDimensions__.getValue()); + bitField0_ |= 0x00000020; + break; + } // case 50 + case 56: + { + quotaValue_ = input.readInt64(); + bitField0_ |= 0x00000040; + break; + } // case 56 + case 64: + { + futureQuotaValue_ = input.readInt64(); + bitField0_ |= 0x00000080; + break; + } // case 64 + 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 { @@ -660,265 +1612,1160 @@ public Builder mergeFrom( return this; } + private int bitField0_; + private java.lang.Object subject_ = ""; + + /** + * + * + *
        +       * The subject on which the quota check failed.
        +       * For example, "clientip:<ip address of client>" or "project:<Google
        +       * developer project id>".
        +       * 
        + * + * string subject = 1; + * + * @return The subject. + */ + public java.lang.String getSubject() { + java.lang.Object ref = subject_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + subject_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
        +       * The subject on which the quota check failed.
        +       * For example, "clientip:<ip address of client>" or "project:<Google
        +       * developer project id>".
        +       * 
        + * + * string subject = 1; + * + * @return The bytes for subject. + */ + public com.google.protobuf.ByteString getSubjectBytes() { + java.lang.Object ref = subject_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + subject_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
        +       * The subject on which the quota check failed.
        +       * For example, "clientip:<ip address of client>" or "project:<Google
        +       * developer project id>".
        +       * 
        + * + * string subject = 1; + * + * @param value The subject to set. + * @return This builder for chaining. + */ + public Builder setSubject(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + subject_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
        +       * The subject on which the quota check failed.
        +       * For example, "clientip:<ip address of client>" or "project:<Google
        +       * developer project id>".
        +       * 
        + * + * string subject = 1; + * + * @return This builder for chaining. + */ + public Builder clearSubject() { + subject_ = getDefaultInstance().getSubject(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
        +       * The subject on which the quota check failed.
        +       * For example, "clientip:<ip address of client>" or "project:<Google
        +       * developer project id>".
        +       * 
        + * + * string subject = 1; + * + * @param value The bytes for subject to set. + * @return This builder for chaining. + */ + public Builder setSubjectBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + subject_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object description_ = ""; + + /** + * + * + *
        +       * A description of how the quota check failed. Clients can use this
        +       * description to find more about the quota configuration in the service's
        +       * public documentation, or find the relevant quota limit to adjust through
        +       * developer console.
        +       *
        +       * For example: "Service disabled" or "Daily Limit for read operations
        +       * exceeded".
        +       * 
        + * + * 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; + } + } + + /** + * + * + *
        +       * A description of how the quota check failed. Clients can use this
        +       * description to find more about the quota configuration in the service's
        +       * public documentation, or find the relevant quota limit to adjust through
        +       * developer console.
        +       *
        +       * For example: "Service disabled" or "Daily Limit for read operations
        +       * exceeded".
        +       * 
        + * + * 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; + } + } + + /** + * + * + *
        +       * A description of how the quota check failed. Clients can use this
        +       * description to find more about the quota configuration in the service's
        +       * public documentation, or find the relevant quota limit to adjust through
        +       * developer console.
        +       *
        +       * For example: "Service disabled" or "Daily Limit for read operations
        +       * exceeded".
        +       * 
        + * + * 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; + } + + /** + * + * + *
        +       * A description of how the quota check failed. Clients can use this
        +       * description to find more about the quota configuration in the service's
        +       * public documentation, or find the relevant quota limit to adjust through
        +       * developer console.
        +       *
        +       * For example: "Service disabled" or "Daily Limit for read operations
        +       * exceeded".
        +       * 
        + * + * string description = 2; + * + * @return This builder for chaining. + */ + public Builder clearDescription() { + description_ = getDefaultInstance().getDescription(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
        +       * A description of how the quota check failed. Clients can use this
        +       * description to find more about the quota configuration in the service's
        +       * public documentation, or find the relevant quota limit to adjust through
        +       * developer console.
        +       *
        +       * For example: "Service disabled" or "Daily Limit for read operations
        +       * exceeded".
        +       * 
        + * + * 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 java.lang.Object apiService_ = ""; + + /** + * + * + *
        +       * The API Service from which the `QuotaFailure.Violation` orginates. In
        +       * some cases, Quota issues originate from an API Service other than the one
        +       * that was called. In other words, a dependency of the called API Service
        +       * could be the cause of the `QuotaFailure`, and this field would have the
        +       * dependency API service name.
        +       *
        +       * For example, if the called API is Kubernetes Engine API
        +       * (container.googleapis.com), and a quota violation occurs in the
        +       * Kubernetes Engine API itself, this field would be
        +       * "container.googleapis.com". On the other hand, if the quota violation
        +       * occurs when the Kubernetes Engine API creates VMs in the Compute Engine
        +       * API (compute.googleapis.com), this field would be
        +       * "compute.googleapis.com".
        +       * 
        + * + * string api_service = 3; + * + * @return The apiService. + */ + public java.lang.String getApiService() { + java.lang.Object ref = apiService_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + apiService_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
        +       * The API Service from which the `QuotaFailure.Violation` orginates. In
        +       * some cases, Quota issues originate from an API Service other than the one
        +       * that was called. In other words, a dependency of the called API Service
        +       * could be the cause of the `QuotaFailure`, and this field would have the
        +       * dependency API service name.
        +       *
        +       * For example, if the called API is Kubernetes Engine API
        +       * (container.googleapis.com), and a quota violation occurs in the
        +       * Kubernetes Engine API itself, this field would be
        +       * "container.googleapis.com". On the other hand, if the quota violation
        +       * occurs when the Kubernetes Engine API creates VMs in the Compute Engine
        +       * API (compute.googleapis.com), this field would be
        +       * "compute.googleapis.com".
        +       * 
        + * + * string api_service = 3; + * + * @return The bytes for apiService. + */ + public com.google.protobuf.ByteString getApiServiceBytes() { + java.lang.Object ref = apiService_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + apiService_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
        +       * The API Service from which the `QuotaFailure.Violation` orginates. In
        +       * some cases, Quota issues originate from an API Service other than the one
        +       * that was called. In other words, a dependency of the called API Service
        +       * could be the cause of the `QuotaFailure`, and this field would have the
        +       * dependency API service name.
        +       *
        +       * For example, if the called API is Kubernetes Engine API
        +       * (container.googleapis.com), and a quota violation occurs in the
        +       * Kubernetes Engine API itself, this field would be
        +       * "container.googleapis.com". On the other hand, if the quota violation
        +       * occurs when the Kubernetes Engine API creates VMs in the Compute Engine
        +       * API (compute.googleapis.com), this field would be
        +       * "compute.googleapis.com".
        +       * 
        + * + * string api_service = 3; + * + * @param value The apiService to set. + * @return This builder for chaining. + */ + public Builder setApiService(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + apiService_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
        +       * The API Service from which the `QuotaFailure.Violation` orginates. In
        +       * some cases, Quota issues originate from an API Service other than the one
        +       * that was called. In other words, a dependency of the called API Service
        +       * could be the cause of the `QuotaFailure`, and this field would have the
        +       * dependency API service name.
        +       *
        +       * For example, if the called API is Kubernetes Engine API
        +       * (container.googleapis.com), and a quota violation occurs in the
        +       * Kubernetes Engine API itself, this field would be
        +       * "container.googleapis.com". On the other hand, if the quota violation
        +       * occurs when the Kubernetes Engine API creates VMs in the Compute Engine
        +       * API (compute.googleapis.com), this field would be
        +       * "compute.googleapis.com".
        +       * 
        + * + * string api_service = 3; + * + * @return This builder for chaining. + */ + public Builder clearApiService() { + apiService_ = getDefaultInstance().getApiService(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + + /** + * + * + *
        +       * The API Service from which the `QuotaFailure.Violation` orginates. In
        +       * some cases, Quota issues originate from an API Service other than the one
        +       * that was called. In other words, a dependency of the called API Service
        +       * could be the cause of the `QuotaFailure`, and this field would have the
        +       * dependency API service name.
        +       *
        +       * For example, if the called API is Kubernetes Engine API
        +       * (container.googleapis.com), and a quota violation occurs in the
        +       * Kubernetes Engine API itself, this field would be
        +       * "container.googleapis.com". On the other hand, if the quota violation
        +       * occurs when the Kubernetes Engine API creates VMs in the Compute Engine
        +       * API (compute.googleapis.com), this field would be
        +       * "compute.googleapis.com".
        +       * 
        + * + * string api_service = 3; + * + * @param value The bytes for apiService to set. + * @return This builder for chaining. + */ + public Builder setApiServiceBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + apiService_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + private java.lang.Object quotaMetric_ = ""; + + /** + * + * + *
        +       * The metric of the violated quota. A quota metric is a named counter to
        +       * measure usage, such as API requests or CPUs. When an activity occurs in a
        +       * service, such as Virtual Machine allocation, one or more quota metrics
        +       * may be affected.
        +       *
        +       * For example, "compute.googleapis.com/cpus_per_vm_family",
        +       * "storage.googleapis.com/internet_egress_bandwidth".
        +       * 
        + * + * string quota_metric = 4; + * + * @return The quotaMetric. + */ + public java.lang.String getQuotaMetric() { + java.lang.Object ref = quotaMetric_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + quotaMetric_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
        +       * The metric of the violated quota. A quota metric is a named counter to
        +       * measure usage, such as API requests or CPUs. When an activity occurs in a
        +       * service, such as Virtual Machine allocation, one or more quota metrics
        +       * may be affected.
        +       *
        +       * For example, "compute.googleapis.com/cpus_per_vm_family",
        +       * "storage.googleapis.com/internet_egress_bandwidth".
        +       * 
        + * + * string quota_metric = 4; + * + * @return The bytes for quotaMetric. + */ + public com.google.protobuf.ByteString getQuotaMetricBytes() { + java.lang.Object ref = quotaMetric_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + quotaMetric_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
        +       * The metric of the violated quota. A quota metric is a named counter to
        +       * measure usage, such as API requests or CPUs. When an activity occurs in a
        +       * service, such as Virtual Machine allocation, one or more quota metrics
        +       * may be affected.
        +       *
        +       * For example, "compute.googleapis.com/cpus_per_vm_family",
        +       * "storage.googleapis.com/internet_egress_bandwidth".
        +       * 
        + * + * string quota_metric = 4; + * + * @param value The quotaMetric to set. + * @return This builder for chaining. + */ + public Builder setQuotaMetric(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + quotaMetric_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + /** + * + * + *
        +       * The metric of the violated quota. A quota metric is a named counter to
        +       * measure usage, such as API requests or CPUs. When an activity occurs in a
        +       * service, such as Virtual Machine allocation, one or more quota metrics
        +       * may be affected.
        +       *
        +       * For example, "compute.googleapis.com/cpus_per_vm_family",
        +       * "storage.googleapis.com/internet_egress_bandwidth".
        +       * 
        + * + * string quota_metric = 4; + * + * @return This builder for chaining. + */ + public Builder clearQuotaMetric() { + quotaMetric_ = getDefaultInstance().getQuotaMetric(); + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + return this; + } + + /** + * + * + *
        +       * The metric of the violated quota. A quota metric is a named counter to
        +       * measure usage, such as API requests or CPUs. When an activity occurs in a
        +       * service, such as Virtual Machine allocation, one or more quota metrics
        +       * may be affected.
        +       *
        +       * For example, "compute.googleapis.com/cpus_per_vm_family",
        +       * "storage.googleapis.com/internet_egress_bandwidth".
        +       * 
        + * + * string quota_metric = 4; + * + * @param value The bytes for quotaMetric to set. + * @return This builder for chaining. + */ + public Builder setQuotaMetricBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + quotaMetric_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + private java.lang.Object quotaId_ = ""; + + /** + * + * + *
        +       * The id of the violated quota. Also know as "limit name", this is the
        +       * unique identifier of a quota in the context of an API service.
        +       *
        +       * For example, "CPUS-PER-VM-FAMILY-per-project-region".
        +       * 
        + * + * string quota_id = 5; + * + * @return The quotaId. + */ + public java.lang.String getQuotaId() { + java.lang.Object ref = quotaId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + quotaId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
        +       * The id of the violated quota. Also know as "limit name", this is the
        +       * unique identifier of a quota in the context of an API service.
        +       *
        +       * For example, "CPUS-PER-VM-FAMILY-per-project-region".
        +       * 
        + * + * string quota_id = 5; + * + * @return The bytes for quotaId. + */ + public com.google.protobuf.ByteString getQuotaIdBytes() { + java.lang.Object ref = quotaId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + quotaId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
        +       * The id of the violated quota. Also know as "limit name", this is the
        +       * unique identifier of a quota in the context of an API service.
        +       *
        +       * For example, "CPUS-PER-VM-FAMILY-per-project-region".
        +       * 
        + * + * string quota_id = 5; + * + * @param value The quotaId to set. + * @return This builder for chaining. + */ + public Builder setQuotaId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + quotaId_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + /** + * + * + *
        +       * The id of the violated quota. Also know as "limit name", this is the
        +       * unique identifier of a quota in the context of an API service.
        +       *
        +       * For example, "CPUS-PER-VM-FAMILY-per-project-region".
        +       * 
        + * + * string quota_id = 5; + * + * @return This builder for chaining. + */ + public Builder clearQuotaId() { + quotaId_ = getDefaultInstance().getQuotaId(); + bitField0_ = (bitField0_ & ~0x00000010); + onChanged(); + return this; + } + + /** + * + * + *
        +       * The id of the violated quota. Also know as "limit name", this is the
        +       * unique identifier of a quota in the context of an API service.
        +       *
        +       * For example, "CPUS-PER-VM-FAMILY-per-project-region".
        +       * 
        + * + * string quota_id = 5; + * + * @param value The bytes for quotaId to set. + * @return This builder for chaining. + */ + public Builder setQuotaIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + quotaId_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + private com.google.protobuf.MapField quotaDimensions_; + + private com.google.protobuf.MapField + internalGetQuotaDimensions() { + if (quotaDimensions_ == null) { + return com.google.protobuf.MapField.emptyMapField( + QuotaDimensionsDefaultEntryHolder.defaultEntry); + } + return quotaDimensions_; + } + + private com.google.protobuf.MapField + internalGetMutableQuotaDimensions() { + if (quotaDimensions_ == null) { + quotaDimensions_ = + com.google.protobuf.MapField.newMapField( + QuotaDimensionsDefaultEntryHolder.defaultEntry); + } + if (!quotaDimensions_.isMutable()) { + quotaDimensions_ = quotaDimensions_.copy(); + } + bitField0_ |= 0x00000020; + onChanged(); + return quotaDimensions_; + } + + public int getQuotaDimensionsCount() { + return internalGetQuotaDimensions().getMap().size(); + } + + /** + * + * + *
        +       * The dimensions of the violated quota. Every non-global quota is enforced
        +       * on a set of dimensions. While quota metric defines what to count, the
        +       * dimensions specify for what aspects the counter should be increased.
        +       *
        +       * For example, the quota "CPUs per region per VM family" enforces a limit
        +       * on the metric "compute.googleapis.com/cpus_per_vm_family" on dimensions
        +       * "region" and "vm_family". And if the violation occurred in region
        +       * "us-central1" and for VM family "n1", the quota_dimensions would be,
        +       *
        +       * {
        +       * "region": "us-central1",
        +       * "vm_family": "n1",
        +       * }
        +       *
        +       * When a quota is enforced globally, the quota_dimensions would always be
        +       * empty.
        +       * 
        + * + * map<string, string> quota_dimensions = 6; + */ + @java.lang.Override + public boolean containsQuotaDimensions(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + return internalGetQuotaDimensions().getMap().containsKey(key); + } + + /** Use {@link #getQuotaDimensionsMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getQuotaDimensions() { + return getQuotaDimensionsMap(); + } + + /** + * + * + *
        +       * The dimensions of the violated quota. Every non-global quota is enforced
        +       * on a set of dimensions. While quota metric defines what to count, the
        +       * dimensions specify for what aspects the counter should be increased.
        +       *
        +       * For example, the quota "CPUs per region per VM family" enforces a limit
        +       * on the metric "compute.googleapis.com/cpus_per_vm_family" on dimensions
        +       * "region" and "vm_family". And if the violation occurred in region
        +       * "us-central1" and for VM family "n1", the quota_dimensions would be,
        +       *
        +       * {
        +       * "region": "us-central1",
        +       * "vm_family": "n1",
        +       * }
        +       *
        +       * When a quota is enforced globally, the quota_dimensions would always be
        +       * empty.
        +       * 
        + * + * map<string, string> quota_dimensions = 6; + */ + @java.lang.Override + public java.util.Map getQuotaDimensionsMap() { + return internalGetQuotaDimensions().getMap(); + } + + /** + * + * + *
        +       * The dimensions of the violated quota. Every non-global quota is enforced
        +       * on a set of dimensions. While quota metric defines what to count, the
        +       * dimensions specify for what aspects the counter should be increased.
        +       *
        +       * For example, the quota "CPUs per region per VM family" enforces a limit
        +       * on the metric "compute.googleapis.com/cpus_per_vm_family" on dimensions
        +       * "region" and "vm_family". And if the violation occurred in region
        +       * "us-central1" and for VM family "n1", the quota_dimensions would be,
        +       *
        +       * {
        +       * "region": "us-central1",
        +       * "vm_family": "n1",
        +       * }
        +       *
        +       * When a quota is enforced globally, the quota_dimensions would always be
        +       * empty.
        +       * 
        + * + * map<string, string> quota_dimensions = 6; + */ + @java.lang.Override + public /* nullable */ java.lang.String getQuotaDimensionsOrDefault( + java.lang.String key, + /* nullable */ + java.lang.String defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = + internalGetQuotaDimensions().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** * * *
        -       * The subject on which the quota check failed.
        -       * For example, "clientip:<ip address of client>" or "project:<Google
        -       * developer project id>".
        -       * 
        + * The dimensions of the violated quota. Every non-global quota is enforced + * on a set of dimensions. While quota metric defines what to count, the + * dimensions specify for what aspects the counter should be increased. * - * string subject = 1; + * For example, the quota "CPUs per region per VM family" enforces a limit + * on the metric "compute.googleapis.com/cpus_per_vm_family" on dimensions + * "region" and "vm_family". And if the violation occurred in region + * "us-central1" and for VM family "n1", the quota_dimensions would be, * - * @return The subject. + * { + * "region": "us-central1", + * "vm_family": "n1", + * } + * + * When a quota is enforced globally, the quota_dimensions would always be + * empty. + * + * + * map<string, string> quota_dimensions = 6; */ - public java.lang.String getSubject() { - java.lang.Object ref = subject_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - subject_ = s; - return s; - } else { - return (java.lang.String) ref; + @java.lang.Override + public java.lang.String getQuotaDimensionsOrThrow(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = + internalGetQuotaDimensions().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); } + return map.get(key); } + + public Builder clearQuotaDimensions() { + bitField0_ = (bitField0_ & ~0x00000020); + internalGetMutableQuotaDimensions().getMutableMap().clear(); + return this; + } + /** * * *
        -       * The subject on which the quota check failed.
        -       * For example, "clientip:<ip address of client>" or "project:<Google
        -       * developer project id>".
        -       * 
        + * The dimensions of the violated quota. Every non-global quota is enforced + * on a set of dimensions. While quota metric defines what to count, the + * dimensions specify for what aspects the counter should be increased. * - * string subject = 1; + * For example, the quota "CPUs per region per VM family" enforces a limit + * on the metric "compute.googleapis.com/cpus_per_vm_family" on dimensions + * "region" and "vm_family". And if the violation occurred in region + * "us-central1" and for VM family "n1", the quota_dimensions would be, * - * @return The bytes for subject. + * { + * "region": "us-central1", + * "vm_family": "n1", + * } + * + * When a quota is enforced globally, the quota_dimensions would always be + * empty. + * + * + * map<string, string> quota_dimensions = 6; */ - public com.google.protobuf.ByteString getSubjectBytes() { - java.lang.Object ref = subject_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - subject_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; + public Builder removeQuotaDimensions(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); } + internalGetMutableQuotaDimensions().getMutableMap().remove(key); + return this; + } + + /** Use alternate mutation accessors instead. */ + @java.lang.Deprecated + public java.util.Map getMutableQuotaDimensions() { + bitField0_ |= 0x00000020; + return internalGetMutableQuotaDimensions().getMutableMap(); } + /** * * *
        -       * The subject on which the quota check failed.
        -       * For example, "clientip:<ip address of client>" or "project:<Google
        -       * developer project id>".
        -       * 
        + * The dimensions of the violated quota. Every non-global quota is enforced + * on a set of dimensions. While quota metric defines what to count, the + * dimensions specify for what aspects the counter should be increased. * - * string subject = 1; + * For example, the quota "CPUs per region per VM family" enforces a limit + * on the metric "compute.googleapis.com/cpus_per_vm_family" on dimensions + * "region" and "vm_family". And if the violation occurred in region + * "us-central1" and for VM family "n1", the quota_dimensions would be, * - * @param value The subject to set. - * @return This builder for chaining. + * { + * "region": "us-central1", + * "vm_family": "n1", + * } + * + * When a quota is enforced globally, the quota_dimensions would always be + * empty. + * + * + * map<string, string> quota_dimensions = 6; */ - public Builder setSubject(java.lang.String value) { + public Builder putQuotaDimensions(java.lang.String key, java.lang.String value) { + if (key == null) { + throw new NullPointerException("map key"); + } if (value == null) { - throw new NullPointerException(); + throw new NullPointerException("map value"); } + internalGetMutableQuotaDimensions().getMutableMap().put(key, value); + bitField0_ |= 0x00000020; + return this; + } - subject_ = value; - onChanged(); + /** + * + * + *
        +       * The dimensions of the violated quota. Every non-global quota is enforced
        +       * on a set of dimensions. While quota metric defines what to count, the
        +       * dimensions specify for what aspects the counter should be increased.
        +       *
        +       * For example, the quota "CPUs per region per VM family" enforces a limit
        +       * on the metric "compute.googleapis.com/cpus_per_vm_family" on dimensions
        +       * "region" and "vm_family". And if the violation occurred in region
        +       * "us-central1" and for VM family "n1", the quota_dimensions would be,
        +       *
        +       * {
        +       * "region": "us-central1",
        +       * "vm_family": "n1",
        +       * }
        +       *
        +       * When a quota is enforced globally, the quota_dimensions would always be
        +       * empty.
        +       * 
        + * + * map<string, string> quota_dimensions = 6; + */ + public Builder putAllQuotaDimensions( + java.util.Map values) { + internalGetMutableQuotaDimensions().getMutableMap().putAll(values); + bitField0_ |= 0x00000020; return this; } + + private long quotaValue_; + /** * * *
        -       * The subject on which the quota check failed.
        -       * For example, "clientip:<ip address of client>" or "project:<Google
        -       * developer project id>".
        +       * The enforced quota value at the time of the `QuotaFailure`.
        +       *
        +       * For example, if the enforced quota value at the time of the
        +       * `QuotaFailure` on the number of CPUs is "10", then the value of this
        +       * field would reflect this quantity.
                * 
        * - * string subject = 1; + * int64 quota_value = 7; * - * @return This builder for chaining. + * @return The quotaValue. */ - public Builder clearSubject() { - - subject_ = getDefaultInstance().getSubject(); - onChanged(); - return this; + @java.lang.Override + public long getQuotaValue() { + return quotaValue_; } + /** * * *
        -       * The subject on which the quota check failed.
        -       * For example, "clientip:<ip address of client>" or "project:<Google
        -       * developer project id>".
        +       * The enforced quota value at the time of the `QuotaFailure`.
        +       *
        +       * For example, if the enforced quota value at the time of the
        +       * `QuotaFailure` on the number of CPUs is "10", then the value of this
        +       * field would reflect this quantity.
                * 
        * - * string subject = 1; + * int64 quota_value = 7; * - * @param value The bytes for subject to set. + * @param value The quotaValue to set. * @return This builder for chaining. */ - public Builder setSubjectBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); + public Builder setQuotaValue(long value) { - subject_ = value; + quotaValue_ = value; + bitField0_ |= 0x00000040; onChanged(); return this; } - private java.lang.Object description_ = ""; /** * * *
        -       * A description of how the quota check failed. Clients can use this
        -       * description to find more about the quota configuration in the service's
        -       * public documentation, or find the relevant quota limit to adjust through
        -       * developer console.
        -       * For example: "Service disabled" or "Daily Limit for read operations
        -       * exceeded".
        +       * The enforced quota value at the time of the `QuotaFailure`.
        +       *
        +       * For example, if the enforced quota value at the time of the
        +       * `QuotaFailure` on the number of CPUs is "10", then the value of this
        +       * field would reflect this quantity.
                * 
        * - * string description = 2; + * int64 quota_value = 7; * - * @return The description. + * @return This builder for chaining. */ - 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; - } + public Builder clearQuotaValue() { + bitField0_ = (bitField0_ & ~0x00000040); + quotaValue_ = 0L; + onChanged(); + return this; } + + private long futureQuotaValue_; + /** * * *
        -       * A description of how the quota check failed. Clients can use this
        -       * description to find more about the quota configuration in the service's
        -       * public documentation, or find the relevant quota limit to adjust through
        -       * developer console.
        -       * For example: "Service disabled" or "Daily Limit for read operations
        -       * exceeded".
        +       * The new quota value being rolled out at the time of the violation. At the
        +       * completion of the rollout, this value will be enforced in place of
        +       * quota_value. If no rollout is in progress at the time of the violation,
        +       * this field is not set.
        +       *
        +       * For example, if at the time of the violation a rollout is in progress
        +       * changing the number of CPUs quota from 10 to 20, 20 would be the value of
        +       * this field.
                * 
        * - * string description = 2; + * optional int64 future_quota_value = 8; * - * @return The bytes for description. + * @return Whether the futureQuotaValue field is set. */ - 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; - } + @java.lang.Override + public boolean hasFutureQuotaValue() { + return ((bitField0_ & 0x00000080) != 0); } + /** * * *
        -       * A description of how the quota check failed. Clients can use this
        -       * description to find more about the quota configuration in the service's
        -       * public documentation, or find the relevant quota limit to adjust through
        -       * developer console.
        -       * For example: "Service disabled" or "Daily Limit for read operations
        -       * exceeded".
        +       * The new quota value being rolled out at the time of the violation. At the
        +       * completion of the rollout, this value will be enforced in place of
        +       * quota_value. If no rollout is in progress at the time of the violation,
        +       * this field is not set.
        +       *
        +       * For example, if at the time of the violation a rollout is in progress
        +       * changing the number of CPUs quota from 10 to 20, 20 would be the value of
        +       * this field.
                * 
        * - * string description = 2; + * optional int64 future_quota_value = 8; * - * @param value The description to set. - * @return This builder for chaining. + * @return The futureQuotaValue. */ - public Builder setDescription(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - description_ = value; - onChanged(); - return this; + @java.lang.Override + public long getFutureQuotaValue() { + return futureQuotaValue_; } + /** * * *
        -       * A description of how the quota check failed. Clients can use this
        -       * description to find more about the quota configuration in the service's
        -       * public documentation, or find the relevant quota limit to adjust through
        -       * developer console.
        -       * For example: "Service disabled" or "Daily Limit for read operations
        -       * exceeded".
        +       * The new quota value being rolled out at the time of the violation. At the
        +       * completion of the rollout, this value will be enforced in place of
        +       * quota_value. If no rollout is in progress at the time of the violation,
        +       * this field is not set.
        +       *
        +       * For example, if at the time of the violation a rollout is in progress
        +       * changing the number of CPUs quota from 10 to 20, 20 would be the value of
        +       * this field.
                * 
        * - * string description = 2; + * optional int64 future_quota_value = 8; * + * @param value The futureQuotaValue to set. * @return This builder for chaining. */ - public Builder clearDescription() { + public Builder setFutureQuotaValue(long value) { - description_ = getDefaultInstance().getDescription(); + futureQuotaValue_ = value; + bitField0_ |= 0x00000080; onChanged(); return this; } + /** * * *
        -       * A description of how the quota check failed. Clients can use this
        -       * description to find more about the quota configuration in the service's
        -       * public documentation, or find the relevant quota limit to adjust through
        -       * developer console.
        -       * For example: "Service disabled" or "Daily Limit for read operations
        -       * exceeded".
        +       * The new quota value being rolled out at the time of the violation. At the
        +       * completion of the rollout, this value will be enforced in place of
        +       * quota_value. If no rollout is in progress at the time of the violation,
        +       * this field is not set.
        +       *
        +       * For example, if at the time of the violation a rollout is in progress
        +       * changing the number of CPUs quota from 10 to 20, 20 would be the value of
        +       * this field.
                * 
        * - * string description = 2; + * optional int64 future_quota_value = 8; * - * @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; + public Builder clearFutureQuotaValue() { + bitField0_ = (bitField0_ & ~0x00000080); + futureQuotaValue_ = 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.rpc.QuotaFailure.Violation) } @@ -972,7 +2819,10 @@ public com.google.rpc.QuotaFailure.Violation getDefaultInstanceForType() { } public static final int VIOLATIONS_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") private java.util.List violations_; + /** * * @@ -986,6 +2836,7 @@ public com.google.rpc.QuotaFailure.Violation getDefaultInstanceForType() { public java.util.List getViolationsList() { return violations_; } + /** * * @@ -1000,6 +2851,7 @@ public java.util.List getViolationsList() getViolationsOrBuilderList() { return violations_; } + /** * * @@ -1013,6 +2865,7 @@ public java.util.List getViolationsList() public int getViolationsCount() { return violations_.size(); } + /** * * @@ -1026,6 +2879,7 @@ public int getViolationsCount() { public com.google.rpc.QuotaFailure.Violation getViolations(int index) { return violations_.get(index); } + /** * * @@ -1141,38 +2995,38 @@ public static com.google.rpc.QuotaFailure parseFrom( public static com.google.rpc.QuotaFailure parseFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); } public static com.google.rpc.QuotaFailure parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } public static com.google.rpc.QuotaFailure parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); } public static com.google.rpc.QuotaFailure parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( PARSER, input, extensionRegistry); } public static com.google.rpc.QuotaFailure parseFrom(com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); } public static com.google.rpc.QuotaFailure parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } @@ -1195,28 +3049,31 @@ public Builder toBuilder() { } @java.lang.Override - protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { Builder builder = new Builder(parent); return builder; } + /** * * *
            * Describes how a quota check failed.
        +   *
            * For example if a daily limit was exceeded for the calling project,
            * a service could respond with a QuotaFailure detail containing the project
            * id and the description of the quota limit that was exceeded.  If the
            * calling project hasn't enabled the service in the developer console, then
            * a service could respond with the project id and set `service_disabled`
            * to true.
        +   *
            * Also see RetryInfo and Help types for other details about handling a
            * quota failure.
            * 
        * * Protobuf type {@code google.rpc.QuotaFailure} */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder implements // @@protoc_insertion_point(builder_implements:google.rpc.QuotaFailure) com.google.rpc.QuotaFailureOrBuilder { @@ -1225,7 +3082,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.rpc.ErrorDetailsProto .internal_static_google_rpc_QuotaFailure_fieldAccessorTable @@ -1236,13 +3093,14 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { // Construct using com.google.rpc.QuotaFailure.newBuilder() private Builder() {} - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { super(parent); } @java.lang.Override public Builder clear() { super.clear(); + bitField0_ = 0; if (violationsBuilder_ == null) { violations_ = java.util.Collections.emptyList(); } else { @@ -1275,7 +3133,15 @@ public com.google.rpc.QuotaFailure build() { @java.lang.Override public com.google.rpc.QuotaFailure buildPartial() { com.google.rpc.QuotaFailure result = new com.google.rpc.QuotaFailure(this); - int from_bitField0_ = bitField0_; + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields(com.google.rpc.QuotaFailure result) { if (violationsBuilder_ == null) { if (((bitField0_ & 0x00000001) != 0)) { violations_ = java.util.Collections.unmodifiableList(violations_); @@ -1285,41 +3151,10 @@ public com.google.rpc.QuotaFailure buildPartial() { } else { result.violations_ = violationsBuilder_.build(); } - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.setField(field, value); - } - - @java.lang.Override - public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - - @java.lang.Override - public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); } - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.addRepeatedField(field, value); + private void buildPartial0(com.google.rpc.QuotaFailure result) { + int from_bitField0_ = bitField0_; } @java.lang.Override @@ -1353,8 +3188,8 @@ public Builder mergeFrom(com.google.rpc.QuotaFailure other) { violations_ = other.violations_; bitField0_ = (bitField0_ & ~0x00000001); violationsBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders - ? getViolationsFieldBuilder() + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders + ? internalGetViolationsFieldBuilder() : null; } else { violationsBuilder_.addAllMessages(other.violations_); @@ -1429,7 +3264,7 @@ private void ensureViolationsIsMutable() { } } - private com.google.protobuf.RepeatedFieldBuilderV3< + private com.google.protobuf.RepeatedFieldBuilder< com.google.rpc.QuotaFailure.Violation, com.google.rpc.QuotaFailure.Violation.Builder, com.google.rpc.QuotaFailure.ViolationOrBuilder> @@ -1451,6 +3286,7 @@ public java.util.List getViolationsList() return violationsBuilder_.getMessageList(); } } + /** * * @@ -1467,6 +3303,7 @@ public int getViolationsCount() { return violationsBuilder_.getCount(); } } + /** * * @@ -1483,6 +3320,7 @@ public com.google.rpc.QuotaFailure.Violation getViolations(int index) { return violationsBuilder_.getMessage(index); } } + /** * * @@ -1505,6 +3343,7 @@ public Builder setViolations(int index, com.google.rpc.QuotaFailure.Violation va } return this; } + /** * * @@ -1525,6 +3364,7 @@ public Builder setViolations( } return this; } + /** * * @@ -1547,6 +3387,7 @@ public Builder addViolations(com.google.rpc.QuotaFailure.Violation value) { } return this; } + /** * * @@ -1569,6 +3410,7 @@ public Builder addViolations(int index, com.google.rpc.QuotaFailure.Violation va } return this; } + /** * * @@ -1588,6 +3430,7 @@ public Builder addViolations(com.google.rpc.QuotaFailure.Violation.Builder build } return this; } + /** * * @@ -1608,6 +3451,7 @@ public Builder addViolations( } return this; } + /** * * @@ -1628,6 +3472,7 @@ public Builder addAllViolations( } return this; } + /** * * @@ -1647,6 +3492,7 @@ public Builder clearViolations() { } return this; } + /** * * @@ -1666,6 +3512,7 @@ public Builder removeViolations(int index) { } return this; } + /** * * @@ -1676,8 +3523,9 @@ public Builder removeViolations(int index) { * repeated .google.rpc.QuotaFailure.Violation violations = 1; */ public com.google.rpc.QuotaFailure.Violation.Builder getViolationsBuilder(int index) { - return getViolationsFieldBuilder().getBuilder(index); + return internalGetViolationsFieldBuilder().getBuilder(index); } + /** * * @@ -1694,6 +3542,7 @@ public com.google.rpc.QuotaFailure.ViolationOrBuilder getViolationsOrBuilder(int return violationsBuilder_.getMessageOrBuilder(index); } } + /** * * @@ -1711,6 +3560,7 @@ public com.google.rpc.QuotaFailure.ViolationOrBuilder getViolationsOrBuilder(int return java.util.Collections.unmodifiableList(violations_); } } + /** * * @@ -1721,9 +3571,10 @@ public com.google.rpc.QuotaFailure.ViolationOrBuilder getViolationsOrBuilder(int * repeated .google.rpc.QuotaFailure.Violation violations = 1; */ public com.google.rpc.QuotaFailure.Violation.Builder addViolationsBuilder() { - return getViolationsFieldBuilder() + return internalGetViolationsFieldBuilder() .addBuilder(com.google.rpc.QuotaFailure.Violation.getDefaultInstance()); } + /** * * @@ -1734,9 +3585,10 @@ public com.google.rpc.QuotaFailure.Violation.Builder addViolationsBuilder() { * repeated .google.rpc.QuotaFailure.Violation violations = 1; */ public com.google.rpc.QuotaFailure.Violation.Builder addViolationsBuilder(int index) { - return getViolationsFieldBuilder() + return internalGetViolationsFieldBuilder() .addBuilder(index, com.google.rpc.QuotaFailure.Violation.getDefaultInstance()); } + /** * * @@ -1748,17 +3600,17 @@ public com.google.rpc.QuotaFailure.Violation.Builder addViolationsBuilder(int in */ public java.util.List getViolationsBuilderList() { - return getViolationsFieldBuilder().getBuilderList(); + return internalGetViolationsFieldBuilder().getBuilderList(); } - private com.google.protobuf.RepeatedFieldBuilderV3< + private com.google.protobuf.RepeatedFieldBuilder< com.google.rpc.QuotaFailure.Violation, com.google.rpc.QuotaFailure.Violation.Builder, com.google.rpc.QuotaFailure.ViolationOrBuilder> - getViolationsFieldBuilder() { + internalGetViolationsFieldBuilder() { if (violationsBuilder_ == null) { violationsBuilder_ = - new com.google.protobuf.RepeatedFieldBuilderV3< + new com.google.protobuf.RepeatedFieldBuilder< com.google.rpc.QuotaFailure.Violation, com.google.rpc.QuotaFailure.Violation.Builder, com.google.rpc.QuotaFailure.ViolationOrBuilder>( @@ -1768,17 +3620,6 @@ public com.google.rpc.QuotaFailure.Violation.Builder addViolationsBuilder(int in return violationsBuilder_; } - @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.rpc.QuotaFailure) } diff --git a/java-common-protos/proto-google-common-protos/src/main/java/com/google/rpc/QuotaFailureOrBuilder.java b/java-common-protos/proto-google-common-protos/src/main/java/com/google/rpc/QuotaFailureOrBuilder.java index a5c1b5f176..cf740ee267 100644 --- a/java-common-protos/proto-google-common-protos/src/main/java/com/google/rpc/QuotaFailureOrBuilder.java +++ b/java-common-protos/proto-google-common-protos/src/main/java/com/google/rpc/QuotaFailureOrBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,10 +14,13 @@ * limitations under the License. */ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: google/rpc/error_details.proto +// Protobuf Java Version: 4.33.2 package com.google.rpc; +@com.google.protobuf.Generated public interface QuotaFailureOrBuilder extends // @@protoc_insertion_point(interface_extends:google.rpc.QuotaFailure) @@ -33,6 +36,7 @@ public interface QuotaFailureOrBuilder * repeated .google.rpc.QuotaFailure.Violation violations = 1; */ java.util.List getViolationsList(); + /** * * @@ -43,6 +47,7 @@ public interface QuotaFailureOrBuilder * repeated .google.rpc.QuotaFailure.Violation violations = 1; */ com.google.rpc.QuotaFailure.Violation getViolations(int index); + /** * * @@ -53,6 +58,7 @@ public interface QuotaFailureOrBuilder * repeated .google.rpc.QuotaFailure.Violation violations = 1; */ int getViolationsCount(); + /** * * @@ -64,6 +70,7 @@ public interface QuotaFailureOrBuilder */ java.util.List getViolationsOrBuilderList(); + /** * * diff --git a/java-common-protos/proto-google-common-protos/src/main/java/com/google/rpc/RequestInfo.java b/java-common-protos/proto-google-common-protos/src/main/java/com/google/rpc/RequestInfo.java index 8bb7455ef9..7577d13274 100644 --- a/java-common-protos/proto-google-common-protos/src/main/java/com/google/rpc/RequestInfo.java +++ b/java-common-protos/proto-google-common-protos/src/main/java/com/google/rpc/RequestInfo.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,9 @@ * limitations under the License. */ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: google/rpc/error_details.proto +// Protobuf Java Version: 4.33.2 package com.google.rpc; @@ -28,13 +30,25 @@ * * Protobuf type {@code google.rpc.RequestInfo} */ -public final class RequestInfo extends com.google.protobuf.GeneratedMessageV3 +@com.google.protobuf.Generated +public final class RequestInfo extends com.google.protobuf.GeneratedMessage implements // @@protoc_insertion_point(message_implements:google.rpc.RequestInfo) RequestInfoOrBuilder { private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "RequestInfo"); + } + // Use RequestInfo.newBuilder() to construct. - private RequestInfo(com.google.protobuf.GeneratedMessageV3.Builder builder) { + private RequestInfo(com.google.protobuf.GeneratedMessage.Builder builder) { super(builder); } @@ -43,23 +57,12 @@ private RequestInfo() { servingData_ = ""; } - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new RequestInfo(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.rpc.ErrorDetailsProto.internal_static_google_rpc_RequestInfo_descriptor; } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.rpc.ErrorDetailsProto .internal_static_google_rpc_RequestInfo_fieldAccessorTable @@ -68,7 +71,10 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } public static final int REQUEST_ID_FIELD_NUMBER = 1; - private volatile java.lang.Object requestId_; + + @SuppressWarnings("serial") + private volatile java.lang.Object requestId_ = ""; + /** * * @@ -93,6 +99,7 @@ public java.lang.String getRequestId() { return s; } } + /** * * @@ -119,7 +126,10 @@ public com.google.protobuf.ByteString getRequestIdBytes() { } public static final int SERVING_DATA_FIELD_NUMBER = 2; - private volatile java.lang.Object servingData_; + + @SuppressWarnings("serial") + private volatile java.lang.Object servingData_ = ""; + /** * * @@ -144,6 +154,7 @@ public java.lang.String getServingData() { return s; } } + /** * * @@ -183,11 +194,11 @@ public final boolean isInitialized() { @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(requestId_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, requestId_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(requestId_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, requestId_); } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(servingData_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 2, servingData_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(servingData_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, servingData_); } getUnknownFields().writeTo(output); } @@ -198,11 +209,11 @@ public int getSerializedSize() { if (size != -1) return size; size = 0; - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(requestId_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, requestId_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(requestId_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, requestId_); } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(servingData_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, servingData_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(servingData_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, servingData_); } size += getUnknownFields().getSerializedSize(); memoizedSize = size; @@ -277,38 +288,38 @@ public static com.google.rpc.RequestInfo parseFrom( public static com.google.rpc.RequestInfo parseFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); } public static com.google.rpc.RequestInfo parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } public static com.google.rpc.RequestInfo parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); } public static com.google.rpc.RequestInfo parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( PARSER, input, extensionRegistry); } public static com.google.rpc.RequestInfo parseFrom(com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); } public static com.google.rpc.RequestInfo parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } @@ -331,10 +342,11 @@ public Builder toBuilder() { } @java.lang.Override - protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { Builder builder = new Builder(parent); return builder; } + /** * * @@ -345,7 +357,7 @@ protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.Build * * Protobuf type {@code google.rpc.RequestInfo} */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder implements // @@protoc_insertion_point(builder_implements:google.rpc.RequestInfo) com.google.rpc.RequestInfoOrBuilder { @@ -354,7 +366,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.rpc.ErrorDetailsProto .internal_static_google_rpc_RequestInfo_fieldAccessorTable @@ -365,17 +377,16 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { // Construct using com.google.rpc.RequestInfo.newBuilder() private Builder() {} - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { super(parent); } @java.lang.Override public Builder clear() { super.clear(); + bitField0_ = 0; requestId_ = ""; - servingData_ = ""; - return this; } @@ -401,43 +412,21 @@ public com.google.rpc.RequestInfo build() { @java.lang.Override public com.google.rpc.RequestInfo buildPartial() { com.google.rpc.RequestInfo result = new com.google.rpc.RequestInfo(this); - result.requestId_ = requestId_; - result.servingData_ = servingData_; + if (bitField0_ != 0) { + buildPartial0(result); + } 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); + private void buildPartial0(com.google.rpc.RequestInfo result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.requestId_ = requestId_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.servingData_ = servingData_; + } } @java.lang.Override @@ -454,10 +443,12 @@ public Builder mergeFrom(com.google.rpc.RequestInfo other) { if (other == com.google.rpc.RequestInfo.getDefaultInstance()) return this; if (!other.getRequestId().isEmpty()) { requestId_ = other.requestId_; + bitField0_ |= 0x00000001; onChanged(); } if (!other.getServingData().isEmpty()) { servingData_ = other.servingData_; + bitField0_ |= 0x00000002; onChanged(); } this.mergeUnknownFields(other.getUnknownFields()); @@ -489,13 +480,13 @@ public Builder mergeFrom( case 10: { requestId_ = input.readStringRequireUtf8(); - + bitField0_ |= 0x00000001; break; } // case 10 case 18: { servingData_ = input.readStringRequireUtf8(); - + bitField0_ |= 0x00000002; break; } // case 18 default: @@ -515,7 +506,10 @@ public Builder mergeFrom( return this; } + private int bitField0_; + private java.lang.Object requestId_ = ""; + /** * * @@ -539,6 +533,7 @@ public java.lang.String getRequestId() { return (java.lang.String) ref; } } + /** * * @@ -562,6 +557,7 @@ public com.google.protobuf.ByteString getRequestIdBytes() { return (com.google.protobuf.ByteString) ref; } } + /** * * @@ -579,11 +575,12 @@ public Builder setRequestId(java.lang.String value) { if (value == null) { throw new NullPointerException(); } - requestId_ = value; + bitField0_ |= 0x00000001; onChanged(); return this; } + /** * * @@ -597,11 +594,12 @@ public Builder setRequestId(java.lang.String value) { * @return This builder for chaining. */ public Builder clearRequestId() { - requestId_ = getDefaultInstance().getRequestId(); + bitField0_ = (bitField0_ & ~0x00000001); onChanged(); return this; } + /** * * @@ -620,13 +618,14 @@ public Builder setRequestIdBytes(com.google.protobuf.ByteString value) { throw new NullPointerException(); } checkByteStringIsUtf8(value); - requestId_ = value; + bitField0_ |= 0x00000001; onChanged(); return this; } private java.lang.Object servingData_ = ""; + /** * * @@ -650,6 +649,7 @@ public java.lang.String getServingData() { return (java.lang.String) ref; } } + /** * * @@ -673,6 +673,7 @@ public com.google.protobuf.ByteString getServingDataBytes() { return (com.google.protobuf.ByteString) ref; } } + /** * * @@ -690,11 +691,12 @@ public Builder setServingData(java.lang.String value) { if (value == null) { throw new NullPointerException(); } - servingData_ = value; + bitField0_ |= 0x00000002; onChanged(); return this; } + /** * * @@ -708,11 +710,12 @@ public Builder setServingData(java.lang.String value) { * @return This builder for chaining. */ public Builder clearServingData() { - servingData_ = getDefaultInstance().getServingData(); + bitField0_ = (bitField0_ & ~0x00000002); onChanged(); return this; } + /** * * @@ -731,23 +734,12 @@ public Builder setServingDataBytes(com.google.protobuf.ByteString value) { throw new NullPointerException(); } checkByteStringIsUtf8(value); - servingData_ = 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.rpc.RequestInfo) } diff --git a/java-common-protos/proto-google-common-protos/src/main/java/com/google/rpc/RequestInfoOrBuilder.java b/java-common-protos/proto-google-common-protos/src/main/java/com/google/rpc/RequestInfoOrBuilder.java index aed43d732d..87c6cb56c5 100644 --- a/java-common-protos/proto-google-common-protos/src/main/java/com/google/rpc/RequestInfoOrBuilder.java +++ b/java-common-protos/proto-google-common-protos/src/main/java/com/google/rpc/RequestInfoOrBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,10 +14,13 @@ * limitations under the License. */ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: google/rpc/error_details.proto +// Protobuf Java Version: 4.33.2 package com.google.rpc; +@com.google.protobuf.Generated public interface RequestInfoOrBuilder extends // @@protoc_insertion_point(interface_extends:google.rpc.RequestInfo) @@ -36,6 +39,7 @@ public interface RequestInfoOrBuilder * @return The requestId. */ java.lang.String getRequestId(); + /** * * @@ -63,6 +67,7 @@ public interface RequestInfoOrBuilder * @return The servingData. */ java.lang.String getServingData(); + /** * * diff --git a/java-common-protos/proto-google-common-protos/src/main/java/com/google/rpc/ResourceInfo.java b/java-common-protos/proto-google-common-protos/src/main/java/com/google/rpc/ResourceInfo.java index f8e113819e..b973ba82b3 100644 --- a/java-common-protos/proto-google-common-protos/src/main/java/com/google/rpc/ResourceInfo.java +++ b/java-common-protos/proto-google-common-protos/src/main/java/com/google/rpc/ResourceInfo.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,9 @@ * limitations under the License. */ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: google/rpc/error_details.proto +// Protobuf Java Version: 4.33.2 package com.google.rpc; @@ -27,13 +29,25 @@ * * Protobuf type {@code google.rpc.ResourceInfo} */ -public final class ResourceInfo extends com.google.protobuf.GeneratedMessageV3 +@com.google.protobuf.Generated +public final class ResourceInfo extends com.google.protobuf.GeneratedMessage implements // @@protoc_insertion_point(message_implements:google.rpc.ResourceInfo) ResourceInfoOrBuilder { private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "ResourceInfo"); + } + // Use ResourceInfo.newBuilder() to construct. - private ResourceInfo(com.google.protobuf.GeneratedMessageV3.Builder builder) { + private ResourceInfo(com.google.protobuf.GeneratedMessage.Builder builder) { super(builder); } @@ -44,23 +58,12 @@ private ResourceInfo() { description_ = ""; } - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new ResourceInfo(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.rpc.ErrorDetailsProto.internal_static_google_rpc_ResourceInfo_descriptor; } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.rpc.ErrorDetailsProto .internal_static_google_rpc_ResourceInfo_fieldAccessorTable @@ -69,7 +72,10 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } public static final int RESOURCE_TYPE_FIELD_NUMBER = 1; - private volatile java.lang.Object resourceType_; + + @SuppressWarnings("serial") + private volatile java.lang.Object resourceType_ = ""; + /** * * @@ -95,6 +101,7 @@ public java.lang.String getResourceType() { return s; } } + /** * * @@ -122,14 +129,18 @@ public com.google.protobuf.ByteString getResourceTypeBytes() { } public static final int RESOURCE_NAME_FIELD_NUMBER = 2; - private volatile java.lang.Object resourceName_; + + @SuppressWarnings("serial") + private volatile java.lang.Object resourceName_ = ""; + /** * * *
            * The name of the resource being accessed.  For example, a shared calendar
            * name: "example.com_4fghdhgsrgh@group.calendar.google.com", if the current
        -   * error is [google.rpc.Code.PERMISSION_DENIED][google.rpc.Code.PERMISSION_DENIED].
        +   * error is
        +   * [google.rpc.Code.PERMISSION_DENIED][google.rpc.Code.PERMISSION_DENIED].
            * 
        * * string resource_name = 2; @@ -148,13 +159,15 @@ public java.lang.String getResourceName() { return s; } } + /** * * *
            * The name of the resource being accessed.  For example, a shared calendar
            * name: "example.com_4fghdhgsrgh@group.calendar.google.com", if the current
        -   * error is [google.rpc.Code.PERMISSION_DENIED][google.rpc.Code.PERMISSION_DENIED].
        +   * error is
        +   * [google.rpc.Code.PERMISSION_DENIED][google.rpc.Code.PERMISSION_DENIED].
            * 
        * * string resource_name = 2; @@ -175,7 +188,10 @@ public com.google.protobuf.ByteString getResourceNameBytes() { } public static final int OWNER_FIELD_NUMBER = 3; - private volatile java.lang.Object owner_; + + @SuppressWarnings("serial") + private volatile java.lang.Object owner_ = ""; + /** * * @@ -201,6 +217,7 @@ public java.lang.String getOwner() { return s; } } + /** * * @@ -228,7 +245,10 @@ public com.google.protobuf.ByteString getOwnerBytes() { } public static final int DESCRIPTION_FIELD_NUMBER = 4; - private volatile java.lang.Object description_; + + @SuppressWarnings("serial") + private volatile java.lang.Object description_ = ""; + /** * * @@ -254,6 +274,7 @@ public java.lang.String getDescription() { return s; } } + /** * * @@ -294,17 +315,17 @@ public final boolean isInitialized() { @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(resourceType_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, resourceType_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(resourceType_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, resourceType_); } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(resourceName_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 2, resourceName_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(resourceName_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, resourceName_); } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(owner_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 3, owner_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(owner_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 3, owner_); } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(description_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 4, description_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(description_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 4, description_); } getUnknownFields().writeTo(output); } @@ -315,17 +336,17 @@ public int getSerializedSize() { if (size != -1) return size; size = 0; - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(resourceType_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, resourceType_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(resourceType_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, resourceType_); } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(resourceName_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, resourceName_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(resourceName_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, resourceName_); } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(owner_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, owner_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(owner_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(3, owner_); } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(description_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, description_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(description_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(4, description_); } size += getUnknownFields().getSerializedSize(); memoizedSize = size; @@ -406,38 +427,38 @@ public static com.google.rpc.ResourceInfo parseFrom( public static com.google.rpc.ResourceInfo parseFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); } public static com.google.rpc.ResourceInfo parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } public static com.google.rpc.ResourceInfo parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); } public static com.google.rpc.ResourceInfo parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( PARSER, input, extensionRegistry); } public static com.google.rpc.ResourceInfo parseFrom(com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); } public static com.google.rpc.ResourceInfo parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } @@ -460,10 +481,11 @@ public Builder toBuilder() { } @java.lang.Override - protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { Builder builder = new Builder(parent); return builder; } + /** * * @@ -473,7 +495,7 @@ protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.Build * * Protobuf type {@code google.rpc.ResourceInfo} */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder implements // @@protoc_insertion_point(builder_implements:google.rpc.ResourceInfo) com.google.rpc.ResourceInfoOrBuilder { @@ -482,7 +504,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.rpc.ErrorDetailsProto .internal_static_google_rpc_ResourceInfo_fieldAccessorTable @@ -493,21 +515,18 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { // Construct using com.google.rpc.ResourceInfo.newBuilder() private Builder() {} - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { super(parent); } @java.lang.Override public Builder clear() { super.clear(); + bitField0_ = 0; resourceType_ = ""; - resourceName_ = ""; - owner_ = ""; - description_ = ""; - return this; } @@ -533,45 +552,27 @@ public com.google.rpc.ResourceInfo build() { @java.lang.Override public com.google.rpc.ResourceInfo buildPartial() { com.google.rpc.ResourceInfo result = new com.google.rpc.ResourceInfo(this); - result.resourceType_ = resourceType_; - result.resourceName_ = resourceName_; - result.owner_ = owner_; - result.description_ = description_; + if (bitField0_ != 0) { + buildPartial0(result); + } 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); + private void buildPartial0(com.google.rpc.ResourceInfo result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.resourceType_ = resourceType_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.resourceName_ = resourceName_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.owner_ = owner_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.description_ = description_; + } } @java.lang.Override @@ -588,18 +589,22 @@ public Builder mergeFrom(com.google.rpc.ResourceInfo other) { if (other == com.google.rpc.ResourceInfo.getDefaultInstance()) return this; if (!other.getResourceType().isEmpty()) { resourceType_ = other.resourceType_; + bitField0_ |= 0x00000001; onChanged(); } if (!other.getResourceName().isEmpty()) { resourceName_ = other.resourceName_; + bitField0_ |= 0x00000002; onChanged(); } if (!other.getOwner().isEmpty()) { owner_ = other.owner_; + bitField0_ |= 0x00000004; onChanged(); } if (!other.getDescription().isEmpty()) { description_ = other.description_; + bitField0_ |= 0x00000008; onChanged(); } this.mergeUnknownFields(other.getUnknownFields()); @@ -631,25 +636,25 @@ public Builder mergeFrom( case 10: { resourceType_ = input.readStringRequireUtf8(); - + bitField0_ |= 0x00000001; break; } // case 10 case 18: { resourceName_ = input.readStringRequireUtf8(); - + bitField0_ |= 0x00000002; break; } // case 18 case 26: { owner_ = input.readStringRequireUtf8(); - + bitField0_ |= 0x00000004; break; } // case 26 case 34: { description_ = input.readStringRequireUtf8(); - + bitField0_ |= 0x00000008; break; } // case 34 default: @@ -669,7 +674,10 @@ public Builder mergeFrom( return this; } + private int bitField0_; + private java.lang.Object resourceType_ = ""; + /** * * @@ -694,6 +702,7 @@ public java.lang.String getResourceType() { return (java.lang.String) ref; } } + /** * * @@ -718,6 +727,7 @@ public com.google.protobuf.ByteString getResourceTypeBytes() { return (com.google.protobuf.ByteString) ref; } } + /** * * @@ -736,11 +746,12 @@ public Builder setResourceType(java.lang.String value) { if (value == null) { throw new NullPointerException(); } - resourceType_ = value; + bitField0_ |= 0x00000001; onChanged(); return this; } + /** * * @@ -755,11 +766,12 @@ public Builder setResourceType(java.lang.String value) { * @return This builder for chaining. */ public Builder clearResourceType() { - resourceType_ = getDefaultInstance().getResourceType(); + bitField0_ = (bitField0_ & ~0x00000001); onChanged(); return this; } + /** * * @@ -779,20 +791,22 @@ public Builder setResourceTypeBytes(com.google.protobuf.ByteString value) { throw new NullPointerException(); } checkByteStringIsUtf8(value); - resourceType_ = value; + bitField0_ |= 0x00000001; onChanged(); return this; } private java.lang.Object resourceName_ = ""; + /** * * *
              * The name of the resource being accessed.  For example, a shared calendar
              * name: "example.com_4fghdhgsrgh@group.calendar.google.com", if the current
        -     * error is [google.rpc.Code.PERMISSION_DENIED][google.rpc.Code.PERMISSION_DENIED].
        +     * error is
        +     * [google.rpc.Code.PERMISSION_DENIED][google.rpc.Code.PERMISSION_DENIED].
              * 
        * * string resource_name = 2; @@ -810,13 +824,15 @@ public java.lang.String getResourceName() { return (java.lang.String) ref; } } + /** * * *
              * The name of the resource being accessed.  For example, a shared calendar
              * name: "example.com_4fghdhgsrgh@group.calendar.google.com", if the current
        -     * error is [google.rpc.Code.PERMISSION_DENIED][google.rpc.Code.PERMISSION_DENIED].
        +     * error is
        +     * [google.rpc.Code.PERMISSION_DENIED][google.rpc.Code.PERMISSION_DENIED].
              * 
        * * string resource_name = 2; @@ -834,13 +850,15 @@ public com.google.protobuf.ByteString getResourceNameBytes() { return (com.google.protobuf.ByteString) ref; } } + /** * * *
              * The name of the resource being accessed.  For example, a shared calendar
              * name: "example.com_4fghdhgsrgh@group.calendar.google.com", if the current
        -     * error is [google.rpc.Code.PERMISSION_DENIED][google.rpc.Code.PERMISSION_DENIED].
        +     * error is
        +     * [google.rpc.Code.PERMISSION_DENIED][google.rpc.Code.PERMISSION_DENIED].
              * 
        * * string resource_name = 2; @@ -852,18 +870,20 @@ public Builder setResourceName(java.lang.String value) { if (value == null) { throw new NullPointerException(); } - resourceName_ = value; + bitField0_ |= 0x00000002; onChanged(); return this; } + /** * * *
              * The name of the resource being accessed.  For example, a shared calendar
              * name: "example.com_4fghdhgsrgh@group.calendar.google.com", if the current
        -     * error is [google.rpc.Code.PERMISSION_DENIED][google.rpc.Code.PERMISSION_DENIED].
        +     * error is
        +     * [google.rpc.Code.PERMISSION_DENIED][google.rpc.Code.PERMISSION_DENIED].
              * 
        * * string resource_name = 2; @@ -871,18 +891,20 @@ public Builder setResourceName(java.lang.String value) { * @return This builder for chaining. */ public Builder clearResourceName() { - resourceName_ = getDefaultInstance().getResourceName(); + bitField0_ = (bitField0_ & ~0x00000002); onChanged(); return this; } + /** * * *
              * The name of the resource being accessed.  For example, a shared calendar
              * name: "example.com_4fghdhgsrgh@group.calendar.google.com", if the current
        -     * error is [google.rpc.Code.PERMISSION_DENIED][google.rpc.Code.PERMISSION_DENIED].
        +     * error is
        +     * [google.rpc.Code.PERMISSION_DENIED][google.rpc.Code.PERMISSION_DENIED].
              * 
        * * string resource_name = 2; @@ -895,13 +917,14 @@ public Builder setResourceNameBytes(com.google.protobuf.ByteString value) { throw new NullPointerException(); } checkByteStringIsUtf8(value); - resourceName_ = value; + bitField0_ |= 0x00000002; onChanged(); return this; } private java.lang.Object owner_ = ""; + /** * * @@ -926,6 +949,7 @@ public java.lang.String getOwner() { return (java.lang.String) ref; } } + /** * * @@ -950,6 +974,7 @@ public com.google.protobuf.ByteString getOwnerBytes() { return (com.google.protobuf.ByteString) ref; } } + /** * * @@ -968,11 +993,12 @@ public Builder setOwner(java.lang.String value) { if (value == null) { throw new NullPointerException(); } - owner_ = value; + bitField0_ |= 0x00000004; onChanged(); return this; } + /** * * @@ -987,11 +1013,12 @@ public Builder setOwner(java.lang.String value) { * @return This builder for chaining. */ public Builder clearOwner() { - owner_ = getDefaultInstance().getOwner(); + bitField0_ = (bitField0_ & ~0x00000004); onChanged(); return this; } + /** * * @@ -1011,13 +1038,14 @@ public Builder setOwnerBytes(com.google.protobuf.ByteString value) { throw new NullPointerException(); } checkByteStringIsUtf8(value); - owner_ = value; + bitField0_ |= 0x00000004; onChanged(); return this; } private java.lang.Object description_ = ""; + /** * * @@ -1042,6 +1070,7 @@ public java.lang.String getDescription() { return (java.lang.String) ref; } } + /** * * @@ -1066,6 +1095,7 @@ public com.google.protobuf.ByteString getDescriptionBytes() { return (com.google.protobuf.ByteString) ref; } } + /** * * @@ -1084,11 +1114,12 @@ public Builder setDescription(java.lang.String value) { if (value == null) { throw new NullPointerException(); } - description_ = value; + bitField0_ |= 0x00000008; onChanged(); return this; } + /** * * @@ -1103,11 +1134,12 @@ public Builder setDescription(java.lang.String value) { * @return This builder for chaining. */ public Builder clearDescription() { - description_ = getDefaultInstance().getDescription(); + bitField0_ = (bitField0_ & ~0x00000008); onChanged(); return this; } + /** * * @@ -1127,23 +1159,12 @@ public Builder setDescriptionBytes(com.google.protobuf.ByteString value) { throw new NullPointerException(); } checkByteStringIsUtf8(value); - description_ = 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.rpc.ResourceInfo) } diff --git a/java-common-protos/proto-google-common-protos/src/main/java/com/google/rpc/ResourceInfoOrBuilder.java b/java-common-protos/proto-google-common-protos/src/main/java/com/google/rpc/ResourceInfoOrBuilder.java index 3038fb4506..d247164149 100644 --- a/java-common-protos/proto-google-common-protos/src/main/java/com/google/rpc/ResourceInfoOrBuilder.java +++ b/java-common-protos/proto-google-common-protos/src/main/java/com/google/rpc/ResourceInfoOrBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,10 +14,13 @@ * limitations under the License. */ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: google/rpc/error_details.proto +// Protobuf Java Version: 4.33.2 package com.google.rpc; +@com.google.protobuf.Generated public interface ResourceInfoOrBuilder extends // @@protoc_insertion_point(interface_extends:google.rpc.ResourceInfo) @@ -37,6 +40,7 @@ public interface ResourceInfoOrBuilder * @return The resourceType. */ java.lang.String getResourceType(); + /** * * @@ -58,7 +62,8 @@ public interface ResourceInfoOrBuilder *
            * The name of the resource being accessed.  For example, a shared calendar
            * name: "example.com_4fghdhgsrgh@group.calendar.google.com", if the current
        -   * error is [google.rpc.Code.PERMISSION_DENIED][google.rpc.Code.PERMISSION_DENIED].
        +   * error is
        +   * [google.rpc.Code.PERMISSION_DENIED][google.rpc.Code.PERMISSION_DENIED].
            * 
        * * string resource_name = 2; @@ -66,13 +71,15 @@ public interface ResourceInfoOrBuilder * @return The resourceName. */ java.lang.String getResourceName(); + /** * * *
            * The name of the resource being accessed.  For example, a shared calendar
            * name: "example.com_4fghdhgsrgh@group.calendar.google.com", if the current
        -   * error is [google.rpc.Code.PERMISSION_DENIED][google.rpc.Code.PERMISSION_DENIED].
        +   * error is
        +   * [google.rpc.Code.PERMISSION_DENIED][google.rpc.Code.PERMISSION_DENIED].
            * 
        * * string resource_name = 2; @@ -95,6 +102,7 @@ public interface ResourceInfoOrBuilder * @return The owner. */ java.lang.String getOwner(); + /** * * @@ -124,6 +132,7 @@ public interface ResourceInfoOrBuilder * @return The description. */ java.lang.String getDescription(); + /** * * diff --git a/java-common-protos/proto-google-common-protos/src/main/java/com/google/rpc/RetryInfo.java b/java-common-protos/proto-google-common-protos/src/main/java/com/google/rpc/RetryInfo.java index d167726741..16b092ed5c 100644 --- a/java-common-protos/proto-google-common-protos/src/main/java/com/google/rpc/RetryInfo.java +++ b/java-common-protos/proto-google-common-protos/src/main/java/com/google/rpc/RetryInfo.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,9 @@ * limitations under the License. */ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: google/rpc/error_details.proto +// Protobuf Java Version: 4.33.2 package com.google.rpc; @@ -25,8 +27,10 @@ * Describes when the clients can retry a failed request. Clients could ignore * the recommendation here or retry when this information is missing from error * responses. + * * It's always recommended that clients should use exponential backoff when * retrying. + * * Clients should wait until `retry_delay` amount of time has passed since * receiving the error response before retrying. If retrying requests also * fail, clients should use an exponential backoff scheme to gradually increase @@ -37,43 +41,46 @@ * * Protobuf type {@code google.rpc.RetryInfo} */ -public final class RetryInfo extends com.google.protobuf.GeneratedMessageV3 +@com.google.protobuf.Generated +public final class RetryInfo extends com.google.protobuf.GeneratedMessage implements // @@protoc_insertion_point(message_implements:google.rpc.RetryInfo) RetryInfoOrBuilder { private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "RetryInfo"); + } + // Use RetryInfo.newBuilder() to construct. - private RetryInfo(com.google.protobuf.GeneratedMessageV3.Builder builder) { + private RetryInfo(com.google.protobuf.GeneratedMessage.Builder builder) { super(builder); } private RetryInfo() {} - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new RetryInfo(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.rpc.ErrorDetailsProto.internal_static_google_rpc_RetryInfo_descriptor; } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.rpc.ErrorDetailsProto.internal_static_google_rpc_RetryInfo_fieldAccessorTable .ensureFieldAccessorsInitialized( com.google.rpc.RetryInfo.class, com.google.rpc.RetryInfo.Builder.class); } + private int bitField0_; public static final int RETRY_DELAY_FIELD_NUMBER = 1; private com.google.protobuf.Duration retryDelay_; + /** * * @@ -87,8 +94,9 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { */ @java.lang.Override public boolean hasRetryDelay() { - return retryDelay_ != null; + return ((bitField0_ & 0x00000001) != 0); } + /** * * @@ -104,6 +112,7 @@ public boolean hasRetryDelay() { public com.google.protobuf.Duration getRetryDelay() { return retryDelay_ == null ? com.google.protobuf.Duration.getDefaultInstance() : retryDelay_; } + /** * * @@ -115,7 +124,7 @@ public com.google.protobuf.Duration getRetryDelay() { */ @java.lang.Override public com.google.protobuf.DurationOrBuilder getRetryDelayOrBuilder() { - return getRetryDelay(); + return retryDelay_ == null ? com.google.protobuf.Duration.getDefaultInstance() : retryDelay_; } private byte memoizedIsInitialized = -1; @@ -132,7 +141,7 @@ public final boolean isInitialized() { @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (retryDelay_ != null) { + if (((bitField0_ & 0x00000001) != 0)) { output.writeMessage(1, getRetryDelay()); } getUnknownFields().writeTo(output); @@ -144,7 +153,7 @@ public int getSerializedSize() { if (size != -1) return size; size = 0; - if (retryDelay_ != null) { + if (((bitField0_ & 0x00000001) != 0)) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getRetryDelay()); } size += getUnknownFields().getSerializedSize(); @@ -222,38 +231,38 @@ public static com.google.rpc.RetryInfo parseFrom( public static com.google.rpc.RetryInfo parseFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); } public static com.google.rpc.RetryInfo parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } public static com.google.rpc.RetryInfo parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); } public static com.google.rpc.RetryInfo parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( PARSER, input, extensionRegistry); } public static com.google.rpc.RetryInfo parseFrom(com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); } public static com.google.rpc.RetryInfo parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } @@ -276,10 +285,11 @@ public Builder toBuilder() { } @java.lang.Override - protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { Builder builder = new Builder(parent); return builder; } + /** * * @@ -287,8 +297,10 @@ protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.Build * Describes when the clients can retry a failed request. Clients could ignore * the recommendation here or retry when this information is missing from error * responses. + * * It's always recommended that clients should use exponential backoff when * retrying. + * * Clients should wait until `retry_delay` amount of time has passed since * receiving the error response before retrying. If retrying requests also * fail, clients should use an exponential backoff scheme to gradually increase @@ -299,7 +311,7 @@ protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.Build * * Protobuf type {@code google.rpc.RetryInfo} */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder implements // @@protoc_insertion_point(builder_implements:google.rpc.RetryInfo) com.google.rpc.RetryInfoOrBuilder { @@ -308,7 +320,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.rpc.ErrorDetailsProto .internal_static_google_rpc_RetryInfo_fieldAccessorTable @@ -317,19 +329,28 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } // Construct using com.google.rpc.RetryInfo.newBuilder() - private Builder() {} + private Builder() { + maybeForceBuilderInitialization(); + } - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetRetryDelayFieldBuilder(); + } } @java.lang.Override public Builder clear() { super.clear(); - if (retryDelayBuilder_ == null) { - retryDelay_ = null; - } else { - retryDelay_ = null; + bitField0_ = 0; + retryDelay_ = null; + if (retryDelayBuilder_ != null) { + retryDelayBuilder_.dispose(); retryDelayBuilder_ = null; } return this; @@ -357,46 +378,21 @@ public com.google.rpc.RetryInfo build() { @java.lang.Override public com.google.rpc.RetryInfo buildPartial() { com.google.rpc.RetryInfo result = new com.google.rpc.RetryInfo(this); - if (retryDelayBuilder_ == null) { - result.retryDelay_ = retryDelay_; - } else { - result.retryDelay_ = retryDelayBuilder_.build(); + if (bitField0_ != 0) { + buildPartial0(result); } 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); + private void buildPartial0(com.google.rpc.RetryInfo result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.retryDelay_ = retryDelayBuilder_ == null ? retryDelay_ : retryDelayBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + result.bitField0_ |= to_bitField0_; } @java.lang.Override @@ -442,8 +438,9 @@ public Builder mergeFrom( break; case 10: { - input.readMessage(getRetryDelayFieldBuilder().getBuilder(), extensionRegistry); - + input.readMessage( + internalGetRetryDelayFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000001; break; } // case 10 default: @@ -463,12 +460,15 @@ public Builder mergeFrom( return this; } + private int bitField0_; + private com.google.protobuf.Duration retryDelay_; - private com.google.protobuf.SingleFieldBuilderV3< + private com.google.protobuf.SingleFieldBuilder< com.google.protobuf.Duration, com.google.protobuf.Duration.Builder, com.google.protobuf.DurationOrBuilder> retryDelayBuilder_; + /** * * @@ -481,8 +481,9 @@ public Builder mergeFrom( * @return Whether the retryDelay field is set. */ public boolean hasRetryDelay() { - return retryDelayBuilder_ != null || retryDelay_ != null; + return ((bitField0_ & 0x00000001) != 0); } + /** * * @@ -503,6 +504,7 @@ public com.google.protobuf.Duration getRetryDelay() { return retryDelayBuilder_.getMessage(); } } + /** * * @@ -518,13 +520,14 @@ public Builder setRetryDelay(com.google.protobuf.Duration value) { throw new NullPointerException(); } retryDelay_ = value; - onChanged(); } else { retryDelayBuilder_.setMessage(value); } - + bitField0_ |= 0x00000001; + onChanged(); return this; } + /** * * @@ -537,13 +540,14 @@ public Builder setRetryDelay(com.google.protobuf.Duration value) { public Builder setRetryDelay(com.google.protobuf.Duration.Builder builderForValue) { if (retryDelayBuilder_ == null) { retryDelay_ = builderForValue.build(); - onChanged(); } else { retryDelayBuilder_.setMessage(builderForValue.build()); } - + bitField0_ |= 0x00000001; + onChanged(); return this; } + /** * * @@ -555,19 +559,23 @@ public Builder setRetryDelay(com.google.protobuf.Duration.Builder builderForValu */ public Builder mergeRetryDelay(com.google.protobuf.Duration value) { if (retryDelayBuilder_ == null) { - if (retryDelay_ != null) { - retryDelay_ = - com.google.protobuf.Duration.newBuilder(retryDelay_).mergeFrom(value).buildPartial(); + if (((bitField0_ & 0x00000001) != 0) + && retryDelay_ != null + && retryDelay_ != com.google.protobuf.Duration.getDefaultInstance()) { + getRetryDelayBuilder().mergeFrom(value); } else { retryDelay_ = value; } - onChanged(); } else { retryDelayBuilder_.mergeFrom(value); } - + if (retryDelay_ != null) { + bitField0_ |= 0x00000001; + onChanged(); + } return this; } + /** * * @@ -578,16 +586,16 @@ public Builder mergeRetryDelay(com.google.protobuf.Duration value) { * .google.protobuf.Duration retry_delay = 1; */ public Builder clearRetryDelay() { - if (retryDelayBuilder_ == null) { - retryDelay_ = null; - onChanged(); - } else { - retryDelay_ = null; + bitField0_ = (bitField0_ & ~0x00000001); + retryDelay_ = null; + if (retryDelayBuilder_ != null) { + retryDelayBuilder_.dispose(); retryDelayBuilder_ = null; } - + onChanged(); return this; } + /** * * @@ -598,10 +606,11 @@ public Builder clearRetryDelay() { * .google.protobuf.Duration retry_delay = 1; */ public com.google.protobuf.Duration.Builder getRetryDelayBuilder() { - + bitField0_ |= 0x00000001; onChanged(); - return getRetryDelayFieldBuilder().getBuilder(); + return internalGetRetryDelayFieldBuilder().getBuilder(); } + /** * * @@ -620,6 +629,7 @@ public com.google.protobuf.DurationOrBuilder getRetryDelayOrBuilder() { : retryDelay_; } } + /** * * @@ -629,14 +639,14 @@ public com.google.protobuf.DurationOrBuilder getRetryDelayOrBuilder() { * * .google.protobuf.Duration retry_delay = 1; */ - private com.google.protobuf.SingleFieldBuilderV3< + private com.google.protobuf.SingleFieldBuilder< com.google.protobuf.Duration, com.google.protobuf.Duration.Builder, com.google.protobuf.DurationOrBuilder> - getRetryDelayFieldBuilder() { + internalGetRetryDelayFieldBuilder() { if (retryDelayBuilder_ == null) { retryDelayBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< + new com.google.protobuf.SingleFieldBuilder< com.google.protobuf.Duration, com.google.protobuf.Duration.Builder, com.google.protobuf.DurationOrBuilder>( @@ -646,17 +656,6 @@ public com.google.protobuf.DurationOrBuilder getRetryDelayOrBuilder() { return retryDelayBuilder_; } - @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.rpc.RetryInfo) } diff --git a/java-common-protos/proto-google-common-protos/src/main/java/com/google/rpc/RetryInfoOrBuilder.java b/java-common-protos/proto-google-common-protos/src/main/java/com/google/rpc/RetryInfoOrBuilder.java index 08eddc2a1e..1337024776 100644 --- a/java-common-protos/proto-google-common-protos/src/main/java/com/google/rpc/RetryInfoOrBuilder.java +++ b/java-common-protos/proto-google-common-protos/src/main/java/com/google/rpc/RetryInfoOrBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,10 +14,13 @@ * limitations under the License. */ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: google/rpc/error_details.proto +// Protobuf Java Version: 4.33.2 package com.google.rpc; +@com.google.protobuf.Generated public interface RetryInfoOrBuilder extends // @@protoc_insertion_point(interface_extends:google.rpc.RetryInfo) @@ -35,6 +38,7 @@ public interface RetryInfoOrBuilder * @return Whether the retryDelay field is set. */ boolean hasRetryDelay(); + /** * * @@ -47,6 +51,7 @@ public interface RetryInfoOrBuilder * @return The retryDelay. */ com.google.protobuf.Duration getRetryDelay(); + /** * * diff --git a/java-common-protos/proto-google-common-protos/src/main/java/com/google/rpc/Status.java b/java-common-protos/proto-google-common-protos/src/main/java/com/google/rpc/Status.java index 1ffd404dd6..2f7b650ebe 100644 --- a/java-common-protos/proto-google-common-protos/src/main/java/com/google/rpc/Status.java +++ b/java-common-protos/proto-google-common-protos/src/main/java/com/google/rpc/Status.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,9 @@ * limitations under the License. */ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: google/rpc/status.proto +// Protobuf Java Version: 4.33.2 package com.google.rpc; @@ -26,19 +28,32 @@ * different programming environments, including REST APIs and RPC APIs. It is * used by [gRPC](https://github.com/grpc). Each `Status` message contains * three pieces of data: error code, error message, and error details. + * * You can find out more about this error model and how to work with it in the * [API Design Guide](https://cloud.google.com/apis/design/errors). * * * Protobuf type {@code google.rpc.Status} */ -public final class Status extends com.google.protobuf.GeneratedMessageV3 +@com.google.protobuf.Generated +public final class Status extends com.google.protobuf.GeneratedMessage implements // @@protoc_insertion_point(message_implements:google.rpc.Status) StatusOrBuilder { private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "Status"); + } + // Use Status.newBuilder() to construct. - private Status(com.google.protobuf.GeneratedMessageV3.Builder builder) { + private Status(com.google.protobuf.GeneratedMessage.Builder builder) { super(builder); } @@ -47,23 +62,12 @@ private Status() { details_ = java.util.Collections.emptyList(); } - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new Status(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.rpc.StatusProto.internal_static_google_rpc_Status_descriptor; } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.rpc.StatusProto.internal_static_google_rpc_Status_fieldAccessorTable .ensureFieldAccessorsInitialized( @@ -71,12 +75,14 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } public static final int CODE_FIELD_NUMBER = 1; - private int code_; + private int code_ = 0; + /** * * *
        -   * The status code, which should be an enum value of [google.rpc.Code][google.rpc.Code].
        +   * The status code, which should be an enum value of
        +   * [google.rpc.Code][google.rpc.Code].
            * 
        * * int32 code = 1; @@ -89,14 +95,18 @@ public int getCode() { } public static final int MESSAGE_FIELD_NUMBER = 2; - private volatile java.lang.Object message_; + + @SuppressWarnings("serial") + private volatile java.lang.Object message_ = ""; + /** * * *
            * A developer-facing error message, which should be in English. Any
            * user-facing error message should be localized and sent in the
        -   * [google.rpc.Status.details][google.rpc.Status.details] field, or localized by the client.
        +   * [google.rpc.Status.details][google.rpc.Status.details] field, or localized
        +   * by the client.
            * 
        * * string message = 2; @@ -115,13 +125,15 @@ public java.lang.String getMessage() { return s; } } + /** * * *
            * A developer-facing error message, which should be in English. Any
            * user-facing error message should be localized and sent in the
        -   * [google.rpc.Status.details][google.rpc.Status.details] field, or localized by the client.
        +   * [google.rpc.Status.details][google.rpc.Status.details] field, or localized
        +   * by the client.
            * 
        * * string message = 2; @@ -142,7 +154,10 @@ public com.google.protobuf.ByteString getMessageBytes() { } public static final int DETAILS_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") private java.util.List details_; + /** * * @@ -157,6 +172,7 @@ public com.google.protobuf.ByteString getMessageBytes() { public java.util.List getDetailsList() { return details_; } + /** * * @@ -171,6 +187,7 @@ public java.util.List getDetailsList() { public java.util.List getDetailsOrBuilderList() { return details_; } + /** * * @@ -185,6 +202,7 @@ public java.util.List getDetailsOrBu public int getDetailsCount() { return details_.size(); } + /** * * @@ -199,6 +217,7 @@ public int getDetailsCount() { public com.google.protobuf.Any getDetails(int index) { return details_.get(index); } + /** * * @@ -231,8 +250,8 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (code_ != 0) { output.writeInt32(1, code_); } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(message_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 2, message_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(message_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, message_); } for (int i = 0; i < details_.size(); i++) { output.writeMessage(3, details_.get(i)); @@ -249,8 +268,8 @@ public int getSerializedSize() { if (code_ != 0) { size += com.google.protobuf.CodedOutputStream.computeInt32Size(1, code_); } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(message_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, message_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(message_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, message_); } for (int i = 0; i < details_.size(); i++) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, details_.get(i)); @@ -333,38 +352,38 @@ public static com.google.rpc.Status parseFrom( public static com.google.rpc.Status parseFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); } public static com.google.rpc.Status parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } public static com.google.rpc.Status parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); } public static com.google.rpc.Status parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( PARSER, input, extensionRegistry); } public static com.google.rpc.Status parseFrom(com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); } public static com.google.rpc.Status parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } @@ -387,10 +406,11 @@ public Builder toBuilder() { } @java.lang.Override - protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { Builder builder = new Builder(parent); return builder; } + /** * * @@ -399,13 +419,14 @@ protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.Build * different programming environments, including REST APIs and RPC APIs. It is * used by [gRPC](https://github.com/grpc). Each `Status` message contains * three pieces of data: error code, error message, and error details. + * * You can find out more about this error model and how to work with it in the * [API Design Guide](https://cloud.google.com/apis/design/errors). * * * Protobuf type {@code google.rpc.Status} */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder implements // @@protoc_insertion_point(builder_implements:google.rpc.Status) com.google.rpc.StatusOrBuilder { @@ -414,7 +435,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.rpc.StatusProto.internal_static_google_rpc_Status_fieldAccessorTable .ensureFieldAccessorsInitialized( @@ -424,24 +445,23 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { // Construct using com.google.rpc.Status.newBuilder() private Builder() {} - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { super(parent); } @java.lang.Override public Builder clear() { super.clear(); + bitField0_ = 0; code_ = 0; - message_ = ""; - if (detailsBuilder_ == null) { details_ = java.util.Collections.emptyList(); } else { details_ = null; detailsBuilder_.clear(); } - bitField0_ = (bitField0_ & ~0x00000001); + bitField0_ = (bitField0_ & ~0x00000004); return this; } @@ -467,53 +487,34 @@ public com.google.rpc.Status build() { @java.lang.Override public com.google.rpc.Status buildPartial() { com.google.rpc.Status result = new com.google.rpc.Status(this); - int from_bitField0_ = bitField0_; - result.code_ = code_; - result.message_ = message_; + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields(com.google.rpc.Status result) { if (detailsBuilder_ == null) { - if (((bitField0_ & 0x00000001) != 0)) { + if (((bitField0_ & 0x00000004) != 0)) { details_ = java.util.Collections.unmodifiableList(details_); - bitField0_ = (bitField0_ & ~0x00000001); + bitField0_ = (bitField0_ & ~0x00000004); } result.details_ = details_; } else { result.details_ = detailsBuilder_.build(); } - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.setField(field, value); - } - - @java.lang.Override - public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - - @java.lang.Override - public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); } - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.addRepeatedField(field, value); + private void buildPartial0(com.google.rpc.Status result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.code_ = code_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.message_ = message_; + } } @java.lang.Override @@ -533,13 +534,14 @@ public Builder mergeFrom(com.google.rpc.Status other) { } if (!other.getMessage().isEmpty()) { message_ = other.message_; + bitField0_ |= 0x00000002; onChanged(); } if (detailsBuilder_ == null) { if (!other.details_.isEmpty()) { if (details_.isEmpty()) { details_ = other.details_; - bitField0_ = (bitField0_ & ~0x00000001); + bitField0_ = (bitField0_ & ~0x00000004); } else { ensureDetailsIsMutable(); details_.addAll(other.details_); @@ -552,10 +554,10 @@ public Builder mergeFrom(com.google.rpc.Status other) { detailsBuilder_.dispose(); detailsBuilder_ = null; details_ = other.details_; - bitField0_ = (bitField0_ & ~0x00000001); + bitField0_ = (bitField0_ & ~0x00000004); detailsBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders - ? getDetailsFieldBuilder() + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders + ? internalGetDetailsFieldBuilder() : null; } else { detailsBuilder_.addAllMessages(other.details_); @@ -591,13 +593,13 @@ public Builder mergeFrom( case 8: { code_ = input.readInt32(); - + bitField0_ |= 0x00000001; break; } // case 8 case 18: { message_ = input.readStringRequireUtf8(); - + bitField0_ |= 0x00000002; break; } // case 18 case 26: @@ -632,11 +634,13 @@ public Builder mergeFrom( private int bitField0_; private int code_; + /** * * *
        -     * The status code, which should be an enum value of [google.rpc.Code][google.rpc.Code].
        +     * The status code, which should be an enum value of
        +     * [google.rpc.Code][google.rpc.Code].
              * 
        * * int32 code = 1; @@ -647,11 +651,13 @@ public Builder mergeFrom( public int getCode() { return code_; } + /** * * *
        -     * The status code, which should be an enum value of [google.rpc.Code][google.rpc.Code].
        +     * The status code, which should be an enum value of
        +     * [google.rpc.Code][google.rpc.Code].
              * 
        * * int32 code = 1; @@ -662,14 +668,17 @@ public int getCode() { public Builder setCode(int value) { code_ = value; + bitField0_ |= 0x00000001; onChanged(); return this; } + /** * * *
        -     * The status code, which should be an enum value of [google.rpc.Code][google.rpc.Code].
        +     * The status code, which should be an enum value of
        +     * [google.rpc.Code][google.rpc.Code].
              * 
        * * int32 code = 1; @@ -677,20 +686,22 @@ public Builder setCode(int value) { * @return This builder for chaining. */ public Builder clearCode() { - + bitField0_ = (bitField0_ & ~0x00000001); code_ = 0; onChanged(); return this; } private java.lang.Object message_ = ""; + /** * * *
              * A developer-facing error message, which should be in English. Any
              * user-facing error message should be localized and sent in the
        -     * [google.rpc.Status.details][google.rpc.Status.details] field, or localized by the client.
        +     * [google.rpc.Status.details][google.rpc.Status.details] field, or localized
        +     * by the client.
              * 
        * * string message = 2; @@ -708,13 +719,15 @@ public java.lang.String getMessage() { return (java.lang.String) ref; } } + /** * * *
              * A developer-facing error message, which should be in English. Any
              * user-facing error message should be localized and sent in the
        -     * [google.rpc.Status.details][google.rpc.Status.details] field, or localized by the client.
        +     * [google.rpc.Status.details][google.rpc.Status.details] field, or localized
        +     * by the client.
              * 
        * * string message = 2; @@ -732,13 +745,15 @@ public com.google.protobuf.ByteString getMessageBytes() { return (com.google.protobuf.ByteString) ref; } } + /** * * *
              * A developer-facing error message, which should be in English. Any
              * user-facing error message should be localized and sent in the
        -     * [google.rpc.Status.details][google.rpc.Status.details] field, or localized by the client.
        +     * [google.rpc.Status.details][google.rpc.Status.details] field, or localized
        +     * by the client.
              * 
        * * string message = 2; @@ -750,18 +765,20 @@ public Builder setMessage(java.lang.String value) { if (value == null) { throw new NullPointerException(); } - message_ = value; + bitField0_ |= 0x00000002; onChanged(); return this; } + /** * * *
              * A developer-facing error message, which should be in English. Any
              * user-facing error message should be localized and sent in the
        -     * [google.rpc.Status.details][google.rpc.Status.details] field, or localized by the client.
        +     * [google.rpc.Status.details][google.rpc.Status.details] field, or localized
        +     * by the client.
              * 
        * * string message = 2; @@ -769,18 +786,20 @@ public Builder setMessage(java.lang.String value) { * @return This builder for chaining. */ public Builder clearMessage() { - message_ = getDefaultInstance().getMessage(); + bitField0_ = (bitField0_ & ~0x00000002); onChanged(); return this; } + /** * * *
              * A developer-facing error message, which should be in English. Any
              * user-facing error message should be localized and sent in the
        -     * [google.rpc.Status.details][google.rpc.Status.details] field, or localized by the client.
        +     * [google.rpc.Status.details][google.rpc.Status.details] field, or localized
        +     * by the client.
              * 
        * * string message = 2; @@ -793,8 +812,8 @@ public Builder setMessageBytes(com.google.protobuf.ByteString value) { throw new NullPointerException(); } checkByteStringIsUtf8(value); - message_ = value; + bitField0_ |= 0x00000002; onChanged(); return this; } @@ -802,13 +821,13 @@ public Builder setMessageBytes(com.google.protobuf.ByteString value) { private java.util.List details_ = java.util.Collections.emptyList(); private void ensureDetailsIsMutable() { - if (!((bitField0_ & 0x00000001) != 0)) { + if (!((bitField0_ & 0x00000004) != 0)) { details_ = new java.util.ArrayList(details_); - bitField0_ |= 0x00000001; + bitField0_ |= 0x00000004; } } - private com.google.protobuf.RepeatedFieldBuilderV3< + private com.google.protobuf.RepeatedFieldBuilder< com.google.protobuf.Any, com.google.protobuf.Any.Builder, com.google.protobuf.AnyOrBuilder> @@ -831,6 +850,7 @@ public java.util.List getDetailsList() { return detailsBuilder_.getMessageList(); } } + /** * * @@ -848,6 +868,7 @@ public int getDetailsCount() { return detailsBuilder_.getCount(); } } + /** * * @@ -865,6 +886,7 @@ public com.google.protobuf.Any getDetails(int index) { return detailsBuilder_.getMessage(index); } } + /** * * @@ -888,6 +910,7 @@ public Builder setDetails(int index, com.google.protobuf.Any value) { } return this; } + /** * * @@ -908,6 +931,7 @@ public Builder setDetails(int index, com.google.protobuf.Any.Builder builderForV } return this; } + /** * * @@ -931,6 +955,7 @@ public Builder addDetails(com.google.protobuf.Any value) { } return this; } + /** * * @@ -954,6 +979,7 @@ public Builder addDetails(int index, com.google.protobuf.Any value) { } return this; } + /** * * @@ -974,6 +1000,7 @@ public Builder addDetails(com.google.protobuf.Any.Builder builderForValue) { } return this; } + /** * * @@ -994,6 +1021,7 @@ public Builder addDetails(int index, com.google.protobuf.Any.Builder builderForV } return this; } + /** * * @@ -1014,6 +1042,7 @@ public Builder addAllDetails(java.lang.Iterablerepeated .google.protobuf.Any details = 3; */ public com.google.protobuf.Any.Builder getDetailsBuilder(int index) { - return getDetailsFieldBuilder().getBuilder(index); + return internalGetDetailsFieldBuilder().getBuilder(index); } + /** * * @@ -1084,6 +1116,7 @@ public com.google.protobuf.AnyOrBuilder getDetailsOrBuilder(int index) { return detailsBuilder_.getMessageOrBuilder(index); } } + /** * * @@ -1101,6 +1134,7 @@ public java.util.List getDetailsOrBu return java.util.Collections.unmodifiableList(details_); } } + /** * * @@ -1112,8 +1146,10 @@ public java.util.List getDetailsOrBu * repeated .google.protobuf.Any details = 3; */ public com.google.protobuf.Any.Builder addDetailsBuilder() { - return getDetailsFieldBuilder().addBuilder(com.google.protobuf.Any.getDefaultInstance()); + return internalGetDetailsFieldBuilder() + .addBuilder(com.google.protobuf.Any.getDefaultInstance()); } + /** * * @@ -1125,9 +1161,10 @@ public com.google.protobuf.Any.Builder addDetailsBuilder() { * repeated .google.protobuf.Any details = 3; */ public com.google.protobuf.Any.Builder addDetailsBuilder(int index) { - return getDetailsFieldBuilder() + return internalGetDetailsFieldBuilder() .addBuilder(index, com.google.protobuf.Any.getDefaultInstance()); } + /** * * @@ -1139,37 +1176,26 @@ public com.google.protobuf.Any.Builder addDetailsBuilder(int index) { * repeated .google.protobuf.Any details = 3; */ public java.util.List getDetailsBuilderList() { - return getDetailsFieldBuilder().getBuilderList(); + return internalGetDetailsFieldBuilder().getBuilderList(); } - private com.google.protobuf.RepeatedFieldBuilderV3< + private com.google.protobuf.RepeatedFieldBuilder< com.google.protobuf.Any, com.google.protobuf.Any.Builder, com.google.protobuf.AnyOrBuilder> - getDetailsFieldBuilder() { + internalGetDetailsFieldBuilder() { if (detailsBuilder_ == null) { detailsBuilder_ = - new com.google.protobuf.RepeatedFieldBuilderV3< + new com.google.protobuf.RepeatedFieldBuilder< com.google.protobuf.Any, com.google.protobuf.Any.Builder, com.google.protobuf.AnyOrBuilder>( - details_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + details_, ((bitField0_ & 0x00000004) != 0), getParentForChildren(), isClean()); details_ = null; } return detailsBuilder_; } - @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.rpc.Status) } diff --git a/java-common-protos/proto-google-common-protos/src/main/java/com/google/rpc/StatusOrBuilder.java b/java-common-protos/proto-google-common-protos/src/main/java/com/google/rpc/StatusOrBuilder.java index c4b026ede7..3b4cdc9c06 100644 --- a/java-common-protos/proto-google-common-protos/src/main/java/com/google/rpc/StatusOrBuilder.java +++ b/java-common-protos/proto-google-common-protos/src/main/java/com/google/rpc/StatusOrBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,10 +14,13 @@ * limitations under the License. */ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: google/rpc/status.proto +// Protobuf Java Version: 4.33.2 package com.google.rpc; +@com.google.protobuf.Generated public interface StatusOrBuilder extends // @@protoc_insertion_point(interface_extends:google.rpc.Status) @@ -27,7 +30,8 @@ public interface StatusOrBuilder * * *
        -   * The status code, which should be an enum value of [google.rpc.Code][google.rpc.Code].
        +   * The status code, which should be an enum value of
        +   * [google.rpc.Code][google.rpc.Code].
            * 
        * * int32 code = 1; @@ -42,7 +46,8 @@ public interface StatusOrBuilder *
            * A developer-facing error message, which should be in English. Any
            * user-facing error message should be localized and sent in the
        -   * [google.rpc.Status.details][google.rpc.Status.details] field, or localized by the client.
        +   * [google.rpc.Status.details][google.rpc.Status.details] field, or localized
        +   * by the client.
            * 
        * * string message = 2; @@ -50,13 +55,15 @@ public interface StatusOrBuilder * @return The message. */ java.lang.String getMessage(); + /** * * *
            * A developer-facing error message, which should be in English. Any
            * user-facing error message should be localized and sent in the
        -   * [google.rpc.Status.details][google.rpc.Status.details] field, or localized by the client.
        +   * [google.rpc.Status.details][google.rpc.Status.details] field, or localized
        +   * by the client.
            * 
        * * string message = 2; @@ -76,6 +83,7 @@ public interface StatusOrBuilder * repeated .google.protobuf.Any details = 3; */ java.util.List getDetailsList(); + /** * * @@ -87,6 +95,7 @@ public interface StatusOrBuilder * repeated .google.protobuf.Any details = 3; */ com.google.protobuf.Any getDetails(int index); + /** * * @@ -98,6 +107,7 @@ public interface StatusOrBuilder * repeated .google.protobuf.Any details = 3; */ int getDetailsCount(); + /** * * @@ -109,6 +119,7 @@ public interface StatusOrBuilder * repeated .google.protobuf.Any details = 3; */ java.util.List getDetailsOrBuilderList(); + /** * * diff --git a/java-common-protos/proto-google-common-protos/src/main/java/com/google/rpc/StatusProto.java b/java-common-protos/proto-google-common-protos/src/main/java/com/google/rpc/StatusProto.java index 19260c0654..1b4d32b103 100644 --- a/java-common-protos/proto-google-common-protos/src/main/java/com/google/rpc/StatusProto.java +++ b/java-common-protos/proto-google-common-protos/src/main/java/com/google/rpc/StatusProto.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,13 +14,26 @@ * limitations under the License. */ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: google/rpc/status.proto +// Protobuf Java Version: 4.33.2 package com.google.rpc; -public final class StatusProto { +@com.google.protobuf.Generated +public final class StatusProto extends com.google.protobuf.GeneratedFile { private StatusProto() {} + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "StatusProto"); + } + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistryLite registry) {} public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry registry) { @@ -29,7 +42,7 @@ public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry r static final com.google.protobuf.Descriptors.Descriptor internal_static_google_rpc_Status_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable internal_static_google_rpc_Status_fieldAccessorTable; public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { @@ -40,13 +53,15 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { static { java.lang.String[] descriptorData = { - "\n\027google/rpc/status.proto\022\ngoogle.rpc\032\031g" - + "oogle/protobuf/any.proto\"N\n\006Status\022\014\n\004co" - + "de\030\001 \001(\005\022\017\n\007message\030\002 \001(\t\022%\n\007details\030\003 \003" - + "(\0132\024.google.protobuf.AnyBa\n\016com.google.r" - + "pcB\013StatusProtoP\001Z7google.golang.org/gen" - + "proto/googleapis/rpc/status;status\370\001\001\242\002\003" - + "RPCb\006proto3" + "\n" + + "\027google/rpc/status.proto\022\n" + + "google.rpc\032\031google/protobuf/any.proto\"N\n" + + "\006Status\022\014\n" + + "\004code\030\001 \001(\005\022\017\n" + + "\007message\030\002 \001(\t\022%\n" + + "\007details\030\003 \003(\0132\024.google.protobuf.AnyBa\n" + + "\016com.google.rpcB\013StatusProtoP\001Z7google.golang.org/gen" + + "proto/googleapis/rpc/status;status\370\001\001\242\002\003RPCb\006proto3" }; descriptor = com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( @@ -54,13 +69,14 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { new com.google.protobuf.Descriptors.FileDescriptor[] { com.google.protobuf.AnyProto.getDescriptor(), }); - internal_static_google_rpc_Status_descriptor = getDescriptor().getMessageTypes().get(0); + internal_static_google_rpc_Status_descriptor = getDescriptor().getMessageType(0); internal_static_google_rpc_Status_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_google_rpc_Status_descriptor, new java.lang.String[] { "Code", "Message", "Details", }); + descriptor.resolveAllFeaturesImmutable(); com.google.protobuf.AnyProto.getDescriptor(); } diff --git a/java-common-protos/proto-google-common-protos/src/main/java/com/google/rpc/context/AttributeContext.java b/java-common-protos/proto-google-common-protos/src/main/java/com/google/rpc/context/AttributeContext.java index d2bdf934e5..2dc5a7f15e 100644 --- a/java-common-protos/proto-google-common-protos/src/main/java/com/google/rpc/context/AttributeContext.java +++ b/java-common-protos/proto-google-common-protos/src/main/java/com/google/rpc/context/AttributeContext.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,9 @@ * limitations under the License. */ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: google/rpc/context/attribute_context.proto +// Protobuf Java Version: 4.33.2 package com.google.rpc.context; @@ -23,15 +25,19 @@ * *
          * This message defines the standard attribute vocabulary for Google APIs.
        + *
          * An attribute is a piece of metadata that describes an activity on a network
          * service. For example, the size of an HTTP request, or the status code of
          * an HTTP response.
        + *
          * Each attribute has a type and a name, which is logically defined as
          * a proto message field in `AttributeContext`. The field type becomes the
          * attribute type, and the field path becomes the attribute name. For example,
          * the attribute `source.ip` maps to field `AttributeContext.source.ip`.
        + *
          * This message definition is guaranteed not to have any wire breaking change.
          * So you can use it directly for passing attributes across different systems.
        + *
          * NOTE: Different system may generate different subset of attributes. Please
          * verify the system specification before relying on an attribute generated
          * a system.
        @@ -39,13 +45,25 @@
          *
          * Protobuf type {@code google.rpc.context.AttributeContext}
          */
        -public final class AttributeContext extends com.google.protobuf.GeneratedMessageV3
        +@com.google.protobuf.Generated
        +public final class AttributeContext extends com.google.protobuf.GeneratedMessage
             implements
             // @@protoc_insertion_point(message_implements:google.rpc.context.AttributeContext)
             AttributeContextOrBuilder {
           private static final long serialVersionUID = 0L;
        +
        +  static {
        +    com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion(
        +        com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC,
        +        /* major= */ 4,
        +        /* minor= */ 33,
        +        /* patch= */ 2,
        +        /* suffix= */ "",
        +        "AttributeContext");
        +  }
        +
           // Use AttributeContext.newBuilder() to construct.
        -  private AttributeContext(com.google.protobuf.GeneratedMessageV3.Builder builder) {
        +  private AttributeContext(com.google.protobuf.GeneratedMessage.Builder builder) {
             super(builder);
           }
         
        @@ -53,24 +71,13 @@ private AttributeContext() {
             extensions_ = java.util.Collections.emptyList();
           }
         
        -  @java.lang.Override
        -  @SuppressWarnings({"unused"})
        -  protected java.lang.Object newInstance(UnusedPrivateParameter unused) {
        -    return new AttributeContext();
        -  }
        -
        -  @java.lang.Override
        -  public final com.google.protobuf.UnknownFieldSet getUnknownFields() {
        -    return this.unknownFields;
        -  }
        -
           public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
             return com.google.rpc.context.AttributeContextProto
                 .internal_static_google_rpc_context_AttributeContext_descriptor;
           }
         
           @java.lang.Override
        -  protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
        +  protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
               internalGetFieldAccessorTable() {
             return com.google.rpc.context.AttributeContextProto
                 .internal_static_google_rpc_context_AttributeContext_fieldAccessorTable
        @@ -96,6 +103,7 @@ public interface PeerOrBuilder
              * @return The ip.
              */
             java.lang.String getIp();
        +
             /**
              *
              *
        @@ -132,6 +140,7 @@ public interface PeerOrBuilder
              * map<string, string> labels = 6;
              */
             int getLabelsCount();
        +
             /**
              *
              *
        @@ -142,9 +151,11 @@ public interface PeerOrBuilder
              * map<string, string> labels = 6;
              */
             boolean containsLabels(java.lang.String key);
        +
             /** Use {@link #getLabelsMap()} instead. */
             @java.lang.Deprecated
             java.util.Map getLabels();
        +
             /**
              *
              *
        @@ -155,6 +166,7 @@ public interface PeerOrBuilder
              * map<string, string> labels = 6;
              */
             java.util.Map getLabelsMap();
        +
             /**
              *
              *
        @@ -164,12 +176,12 @@ public interface PeerOrBuilder
              *
              * map<string, string> labels = 6;
              */
        -
             /* nullable */
             java.lang.String getLabelsOrDefault(
                 java.lang.String key,
                 /* nullable */
                 java.lang.String defaultValue);
        +
             /**
              *
              *
        @@ -187,7 +199,7 @@ java.lang.String getLabelsOrDefault(
              * 
              * The identity of this peer. Similar to `Request.auth.principal`, but
              * relative to the peer instead of the request. For example, the
        -     * idenity associated with a load balancer that forwared the request.
        +     * identity associated with a load balancer that forwarded the request.
              * 
        * * string principal = 7; @@ -195,13 +207,14 @@ java.lang.String getLabelsOrDefault( * @return The principal. */ java.lang.String getPrincipal(); + /** * * *
              * The identity of this peer. Similar to `Request.auth.principal`, but
              * relative to the peer instead of the request. For example, the
        -     * idenity associated with a load balancer that forwared the request.
        +     * identity associated with a load balancer that forwarded the request.
              * 
        * * string principal = 7; @@ -224,6 +237,7 @@ java.lang.String getLabelsOrDefault( * @return The regionCode. */ java.lang.String getRegionCode(); + /** * * @@ -239,6 +253,7 @@ java.lang.String getLabelsOrDefault( */ com.google.protobuf.ByteString getRegionCodeBytes(); } + /** * * @@ -251,13 +266,24 @@ java.lang.String getLabelsOrDefault( * * Protobuf type {@code google.rpc.context.AttributeContext.Peer} */ - public static final class Peer extends com.google.protobuf.GeneratedMessageV3 + public static final class Peer extends com.google.protobuf.GeneratedMessage implements // @@protoc_insertion_point(message_implements:google.rpc.context.AttributeContext.Peer) PeerOrBuilder { private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "Peer"); + } + // Use Peer.newBuilder() to construct. - private Peer(com.google.protobuf.GeneratedMessageV3.Builder builder) { + private Peer(com.google.protobuf.GeneratedMessage.Builder builder) { super(builder); } @@ -267,17 +293,6 @@ private Peer() { regionCode_ = ""; } - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new Peer(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.rpc.context.AttributeContextProto .internal_static_google_rpc_context_AttributeContext_Peer_descriptor; @@ -285,7 +300,8 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { @SuppressWarnings({"rawtypes"}) @java.lang.Override - protected com.google.protobuf.MapField internalGetMapField(int number) { + protected com.google.protobuf.MapFieldReflectionAccessor internalGetMapFieldReflection( + int number) { switch (number) { case 6: return internalGetLabels(); @@ -295,7 +311,7 @@ protected com.google.protobuf.MapField internalGetMapField(int number) { } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.rpc.context.AttributeContextProto .internal_static_google_rpc_context_AttributeContext_Peer_fieldAccessorTable @@ -305,7 +321,10 @@ protected com.google.protobuf.MapField internalGetMapField(int number) { } public static final int IP_FIELD_NUMBER = 1; - private volatile java.lang.Object ip_; + + @SuppressWarnings("serial") + private volatile java.lang.Object ip_ = ""; + /** * * @@ -329,6 +348,7 @@ public java.lang.String getIp() { return s; } } + /** * * @@ -354,7 +374,8 @@ public com.google.protobuf.ByteString getIpBytes() { } public static final int PORT_FIELD_NUMBER = 2; - private long port_; + private long port_ = 0L; + /** * * @@ -384,6 +405,7 @@ private static final class LabelsDefaultEntryHolder { ""); } + @SuppressWarnings("serial") private com.google.protobuf.MapField labels_; private com.google.protobuf.MapField internalGetLabels() { @@ -396,6 +418,7 @@ private com.google.protobuf.MapField interna public int getLabelsCount() { return internalGetLabels().getMap().size(); } + /** * * @@ -412,12 +435,14 @@ public boolean containsLabels(java.lang.String key) { } return internalGetLabels().getMap().containsKey(key); } + /** Use {@link #getLabelsMap()} instead. */ @java.lang.Override @java.lang.Deprecated public java.util.Map getLabels() { return getLabelsMap(); } + /** * * @@ -431,6 +456,7 @@ public java.util.Map getLabels() { public java.util.Map getLabelsMap() { return internalGetLabels().getMap(); } + /** * * @@ -441,14 +467,17 @@ public java.util.Map getLabelsMap() { * map<string, string> labels = 6; */ @java.lang.Override - public java.lang.String getLabelsOrDefault( - java.lang.String key, java.lang.String defaultValue) { + 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; } + /** * * @@ -471,14 +500,17 @@ public java.lang.String getLabelsOrThrow(java.lang.String key) { } public static final int PRINCIPAL_FIELD_NUMBER = 7; - private volatile java.lang.Object principal_; + + @SuppressWarnings("serial") + private volatile java.lang.Object principal_ = ""; + /** * * *
              * The identity of this peer. Similar to `Request.auth.principal`, but
              * relative to the peer instead of the request. For example, the
        -     * idenity associated with a load balancer that forwared the request.
        +     * identity associated with a load balancer that forwarded the request.
              * 
        * * string principal = 7; @@ -497,13 +529,14 @@ public java.lang.String getPrincipal() { return s; } } + /** * * *
              * The identity of this peer. Similar to `Request.auth.principal`, but
              * relative to the peer instead of the request. For example, the
        -     * idenity associated with a load balancer that forwared the request.
        +     * identity associated with a load balancer that forwarded the request.
              * 
        * * string principal = 7; @@ -524,7 +557,10 @@ public com.google.protobuf.ByteString getPrincipalBytes() { } public static final int REGION_CODE_FIELD_NUMBER = 8; - private volatile java.lang.Object regionCode_; + + @SuppressWarnings("serial") + private volatile java.lang.Object regionCode_ = ""; + /** * * @@ -550,6 +586,7 @@ public java.lang.String getRegionCode() { return s; } } + /** * * @@ -590,19 +627,19 @@ public final boolean isInitialized() { @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(ip_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, ip_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(ip_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, ip_); } if (port_ != 0L) { output.writeInt64(2, port_); } - com.google.protobuf.GeneratedMessageV3.serializeStringMapTo( + com.google.protobuf.GeneratedMessage.serializeStringMapTo( output, internalGetLabels(), LabelsDefaultEntryHolder.defaultEntry, 6); - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(principal_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 7, principal_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(principal_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 7, principal_); } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(regionCode_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 8, regionCode_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(regionCode_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 8, regionCode_); } getUnknownFields().writeTo(output); } @@ -613,8 +650,8 @@ public int getSerializedSize() { if (size != -1) return size; size = 0; - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(ip_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, ip_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(ip_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, ip_); } if (port_ != 0L) { size += com.google.protobuf.CodedOutputStream.computeInt64Size(2, port_); @@ -629,11 +666,11 @@ public int getSerializedSize() { .build(); size += com.google.protobuf.CodedOutputStream.computeMessageSize(6, labels__); } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(principal_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(7, principal_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(principal_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(7, principal_); } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(regionCode_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(8, regionCode_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(regionCode_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(8, regionCode_); } size += getUnknownFields().getSerializedSize(); memoizedSize = size; @@ -721,38 +758,38 @@ public static com.google.rpc.context.AttributeContext.Peer parseFrom( public static com.google.rpc.context.AttributeContext.Peer parseFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); } public static com.google.rpc.context.AttributeContext.Peer parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } public static com.google.rpc.context.AttributeContext.Peer parseDelimitedFrom( java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); } public static com.google.rpc.context.AttributeContext.Peer parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( PARSER, input, extensionRegistry); } public static com.google.rpc.context.AttributeContext.Peer parseFrom( com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); } public static com.google.rpc.context.AttributeContext.Peer parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } @@ -775,11 +812,11 @@ public Builder toBuilder() { } @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { Builder builder = new Builder(parent); return builder; } + /** * * @@ -792,8 +829,7 @@ protected Builder newBuilderForType( * * Protobuf type {@code google.rpc.context.AttributeContext.Peer} */ - public static final class Builder - extends com.google.protobuf.GeneratedMessageV3.Builder + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder implements // @@protoc_insertion_point(builder_implements:google.rpc.context.AttributeContext.Peer) com.google.rpc.context.AttributeContext.PeerOrBuilder { @@ -803,7 +839,8 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } @SuppressWarnings({"rawtypes"}) - protected com.google.protobuf.MapField internalGetMapField(int number) { + protected com.google.protobuf.MapFieldReflectionAccessor internalGetMapFieldReflection( + int number) { switch (number) { case 6: return internalGetLabels(); @@ -813,7 +850,8 @@ protected com.google.protobuf.MapField internalGetMapField(int number) { } @SuppressWarnings({"rawtypes"}) - protected com.google.protobuf.MapField internalGetMutableMapField(int number) { + protected com.google.protobuf.MapFieldReflectionAccessor internalGetMutableMapFieldReflection( + int number) { switch (number) { case 6: return internalGetMutableLabels(); @@ -823,7 +861,7 @@ protected com.google.protobuf.MapField internalGetMutableMapField(int number) { } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.rpc.context.AttributeContextProto .internal_static_google_rpc_context_AttributeContext_Peer_fieldAccessorTable @@ -835,22 +873,19 @@ protected com.google.protobuf.MapField internalGetMutableMapField(int number) { // Construct using com.google.rpc.context.AttributeContext.Peer.newBuilder() private Builder() {} - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { super(parent); } @java.lang.Override public Builder clear() { super.clear(); + bitField0_ = 0; ip_ = ""; - port_ = 0L; - internalGetMutableLabels().clear(); principal_ = ""; - regionCode_ = ""; - return this; } @@ -878,50 +913,31 @@ public com.google.rpc.context.AttributeContext.Peer build() { public com.google.rpc.context.AttributeContext.Peer buildPartial() { com.google.rpc.context.AttributeContext.Peer result = new com.google.rpc.context.AttributeContext.Peer(this); - int from_bitField0_ = bitField0_; - result.ip_ = ip_; - result.port_ = port_; - result.labels_ = internalGetLabels(); - result.labels_.makeImmutable(); - result.principal_ = principal_; - result.regionCode_ = regionCode_; + if (bitField0_ != 0) { + buildPartial0(result); + } 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); + private void buildPartial0(com.google.rpc.context.AttributeContext.Peer result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.ip_ = ip_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.port_ = port_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.labels_ = internalGetLabels(); + result.labels_.makeImmutable(); + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.principal_ = principal_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.regionCode_ = regionCode_; + } } @java.lang.Override @@ -938,18 +954,22 @@ public Builder mergeFrom(com.google.rpc.context.AttributeContext.Peer other) { if (other == com.google.rpc.context.AttributeContext.Peer.getDefaultInstance()) return this; if (!other.getIp().isEmpty()) { ip_ = other.ip_; + bitField0_ |= 0x00000001; onChanged(); } if (other.getPort() != 0L) { setPort(other.getPort()); } internalGetMutableLabels().mergeFrom(other.internalGetLabels()); + bitField0_ |= 0x00000004; if (!other.getPrincipal().isEmpty()) { principal_ = other.principal_; + bitField0_ |= 0x00000008; onChanged(); } if (!other.getRegionCode().isEmpty()) { regionCode_ = other.regionCode_; + bitField0_ |= 0x00000010; onChanged(); } this.mergeUnknownFields(other.getUnknownFields()); @@ -981,13 +1001,13 @@ public Builder mergeFrom( case 10: { ip_ = input.readStringRequireUtf8(); - + bitField0_ |= 0x00000001; break; } // case 10 case 16: { port_ = input.readInt64(); - + bitField0_ |= 0x00000002; break; } // case 16 case 50: @@ -999,18 +1019,19 @@ public Builder mergeFrom( internalGetMutableLabels() .getMutableMap() .put(labels__.getKey(), labels__.getValue()); + bitField0_ |= 0x00000004; break; } // case 50 case 58: { principal_ = input.readStringRequireUtf8(); - + bitField0_ |= 0x00000008; break; } // case 58 case 66: { regionCode_ = input.readStringRequireUtf8(); - + bitField0_ |= 0x00000010; break; } // case 66 default: @@ -1033,6 +1054,7 @@ public Builder mergeFrom( private int bitField0_; private java.lang.Object ip_ = ""; + /** * * @@ -1055,6 +1077,7 @@ public java.lang.String getIp() { return (java.lang.String) ref; } } + /** * * @@ -1077,6 +1100,7 @@ public com.google.protobuf.ByteString getIpBytes() { return (com.google.protobuf.ByteString) ref; } } + /** * * @@ -1093,11 +1117,12 @@ public Builder setIp(java.lang.String value) { if (value == null) { throw new NullPointerException(); } - ip_ = value; + bitField0_ |= 0x00000001; onChanged(); return this; } + /** * * @@ -1110,11 +1135,12 @@ public Builder setIp(java.lang.String value) { * @return This builder for chaining. */ public Builder clearIp() { - ip_ = getDefaultInstance().getIp(); + bitField0_ = (bitField0_ & ~0x00000001); onChanged(); return this; } + /** * * @@ -1132,13 +1158,14 @@ public Builder setIpBytes(com.google.protobuf.ByteString value) { throw new NullPointerException(); } checkByteStringIsUtf8(value); - ip_ = value; + bitField0_ |= 0x00000001; onChanged(); return this; } private long port_; + /** * * @@ -1154,6 +1181,7 @@ public Builder setIpBytes(com.google.protobuf.ByteString value) { public long getPort() { return port_; } + /** * * @@ -1169,9 +1197,11 @@ public long getPort() { public Builder setPort(long value) { port_ = value; + bitField0_ |= 0x00000002; onChanged(); return this; } + /** * * @@ -1184,7 +1214,7 @@ public Builder setPort(long value) { * @return This builder for chaining. */ public Builder clearPort() { - + bitField0_ = (bitField0_ & ~0x00000002); port_ = 0L; onChanged(); return this; @@ -1201,20 +1231,21 @@ private com.google.protobuf.MapField interna private com.google.protobuf.MapField internalGetMutableLabels() { - onChanged(); - ; 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(); } + /** * * @@ -1231,12 +1262,14 @@ public boolean containsLabels(java.lang.String key) { } return internalGetLabels().getMap().containsKey(key); } + /** Use {@link #getLabelsMap()} instead. */ @java.lang.Override @java.lang.Deprecated public java.util.Map getLabels() { return getLabelsMap(); } + /** * * @@ -1250,6 +1283,7 @@ public java.util.Map getLabels() { public java.util.Map getLabelsMap() { return internalGetLabels().getMap(); } + /** * * @@ -1260,14 +1294,17 @@ public java.util.Map getLabelsMap() { * map<string, string> labels = 6; */ @java.lang.Override - public java.lang.String getLabelsOrDefault( - java.lang.String key, java.lang.String defaultValue) { + 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; } + /** * * @@ -1290,9 +1327,11 @@ public java.lang.String getLabelsOrThrow(java.lang.String key) { } public Builder clearLabels() { + bitField0_ = (bitField0_ & ~0x00000004); internalGetMutableLabels().getMutableMap().clear(); return this; } + /** * * @@ -1309,11 +1348,14 @@ public Builder removeLabels(java.lang.String 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(); } + /** * * @@ -1330,10 +1372,11 @@ public Builder putLabels(java.lang.String key, java.lang.String value) { if (value == null) { throw new NullPointerException("map value"); } - internalGetMutableLabels().getMutableMap().put(key, value); + bitField0_ |= 0x00000004; return this; } + /** * * @@ -1345,17 +1388,19 @@ public Builder putLabels(java.lang.String key, java.lang.String value) { */ public Builder putAllLabels(java.util.Map values) { internalGetMutableLabels().getMutableMap().putAll(values); + bitField0_ |= 0x00000004; return this; } private java.lang.Object principal_ = ""; + /** * * *
                * The identity of this peer. Similar to `Request.auth.principal`, but
                * relative to the peer instead of the request. For example, the
        -       * idenity associated with a load balancer that forwared the request.
        +       * identity associated with a load balancer that forwarded the request.
                * 
        * * string principal = 7; @@ -1373,13 +1418,14 @@ public java.lang.String getPrincipal() { return (java.lang.String) ref; } } + /** * * *
                * The identity of this peer. Similar to `Request.auth.principal`, but
                * relative to the peer instead of the request. For example, the
        -       * idenity associated with a load balancer that forwared the request.
        +       * identity associated with a load balancer that forwarded the request.
                * 
        * * string principal = 7; @@ -1397,13 +1443,14 @@ public com.google.protobuf.ByteString getPrincipalBytes() { return (com.google.protobuf.ByteString) ref; } } + /** * * *
                * The identity of this peer. Similar to `Request.auth.principal`, but
                * relative to the peer instead of the request. For example, the
        -       * idenity associated with a load balancer that forwared the request.
        +       * identity associated with a load balancer that forwarded the request.
                * 
        * * string principal = 7; @@ -1415,18 +1462,19 @@ public Builder setPrincipal(java.lang.String value) { if (value == null) { throw new NullPointerException(); } - principal_ = value; + bitField0_ |= 0x00000008; onChanged(); return this; } + /** * * *
                * The identity of this peer. Similar to `Request.auth.principal`, but
                * relative to the peer instead of the request. For example, the
        -       * idenity associated with a load balancer that forwared the request.
        +       * identity associated with a load balancer that forwarded the request.
                * 
        * * string principal = 7; @@ -1434,18 +1482,19 @@ public Builder setPrincipal(java.lang.String value) { * @return This builder for chaining. */ public Builder clearPrincipal() { - principal_ = getDefaultInstance().getPrincipal(); + bitField0_ = (bitField0_ & ~0x00000008); onChanged(); return this; } + /** * * *
                * The identity of this peer. Similar to `Request.auth.principal`, but
                * relative to the peer instead of the request. For example, the
        -       * idenity associated with a load balancer that forwared the request.
        +       * identity associated with a load balancer that forwarded the request.
                * 
        * * string principal = 7; @@ -1458,13 +1507,14 @@ public Builder setPrincipalBytes(com.google.protobuf.ByteString value) { throw new NullPointerException(); } checkByteStringIsUtf8(value); - principal_ = value; + bitField0_ |= 0x00000008; onChanged(); return this; } private java.lang.Object regionCode_ = ""; + /** * * @@ -1489,6 +1539,7 @@ public java.lang.String getRegionCode() { return (java.lang.String) ref; } } + /** * * @@ -1513,6 +1564,7 @@ public com.google.protobuf.ByteString getRegionCodeBytes() { return (com.google.protobuf.ByteString) ref; } } + /** * * @@ -1531,11 +1583,12 @@ public Builder setRegionCode(java.lang.String value) { if (value == null) { throw new NullPointerException(); } - regionCode_ = value; + bitField0_ |= 0x00000010; onChanged(); return this; } + /** * * @@ -1550,11 +1603,12 @@ public Builder setRegionCode(java.lang.String value) { * @return This builder for chaining. */ public Builder clearRegionCode() { - regionCode_ = getDefaultInstance().getRegionCode(); + bitField0_ = (bitField0_ & ~0x00000010); onChanged(); return this; } + /** * * @@ -1574,24 +1628,12 @@ public Builder setRegionCodeBytes(com.google.protobuf.ByteString value) { throw new NullPointerException(); } checkByteStringIsUtf8(value); - regionCode_ = 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.rpc.context.AttributeContext.Peer) } @@ -1663,6 +1705,7 @@ public interface ApiOrBuilder * @return The service. */ java.lang.String getService(); + /** * * @@ -1692,6 +1735,7 @@ public interface ApiOrBuilder * @return The operation. */ java.lang.String getOperation(); + /** * * @@ -1720,6 +1764,7 @@ public interface ApiOrBuilder * @return The protocol. */ java.lang.String getProtocol(); + /** * * @@ -1747,6 +1792,7 @@ public interface ApiOrBuilder * @return The version. */ java.lang.String getVersion(); + /** * * @@ -1761,6 +1807,7 @@ public interface ApiOrBuilder */ com.google.protobuf.ByteString getVersionBytes(); } + /** * * @@ -1772,13 +1819,24 @@ public interface ApiOrBuilder * * Protobuf type {@code google.rpc.context.AttributeContext.Api} */ - public static final class Api extends com.google.protobuf.GeneratedMessageV3 + public static final class Api extends com.google.protobuf.GeneratedMessage implements // @@protoc_insertion_point(message_implements:google.rpc.context.AttributeContext.Api) ApiOrBuilder { private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "Api"); + } + // Use Api.newBuilder() to construct. - private Api(com.google.protobuf.GeneratedMessageV3.Builder builder) { + private Api(com.google.protobuf.GeneratedMessage.Builder builder) { super(builder); } @@ -1789,24 +1847,13 @@ private Api() { version_ = ""; } - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new Api(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.rpc.context.AttributeContextProto .internal_static_google_rpc_context_AttributeContext_Api_descriptor; } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.rpc.context.AttributeContextProto .internal_static_google_rpc_context_AttributeContext_Api_fieldAccessorTable @@ -1816,7 +1863,10 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } public static final int SERVICE_FIELD_NUMBER = 1; - private volatile java.lang.Object service_; + + @SuppressWarnings("serial") + private volatile java.lang.Object service_ = ""; + /** * * @@ -1842,6 +1892,7 @@ public java.lang.String getService() { return s; } } + /** * * @@ -1869,7 +1920,10 @@ public com.google.protobuf.ByteString getServiceBytes() { } public static final int OPERATION_FIELD_NUMBER = 2; - private volatile java.lang.Object operation_; + + @SuppressWarnings("serial") + private volatile java.lang.Object operation_ = ""; + /** * * @@ -1895,6 +1949,7 @@ public java.lang.String getOperation() { return s; } } + /** * * @@ -1922,7 +1977,10 @@ public com.google.protobuf.ByteString getOperationBytes() { } public static final int PROTOCOL_FIELD_NUMBER = 3; - private volatile java.lang.Object protocol_; + + @SuppressWarnings("serial") + private volatile java.lang.Object protocol_ = ""; + /** * * @@ -1947,6 +2005,7 @@ public java.lang.String getProtocol() { return s; } } + /** * * @@ -1973,7 +2032,10 @@ public com.google.protobuf.ByteString getProtocolBytes() { } public static final int VERSION_FIELD_NUMBER = 4; - private volatile java.lang.Object version_; + + @SuppressWarnings("serial") + private volatile java.lang.Object version_ = ""; + /** * * @@ -1998,6 +2060,7 @@ public java.lang.String getVersion() { return s; } } + /** * * @@ -2037,17 +2100,17 @@ public final boolean isInitialized() { @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(service_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, service_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(service_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, service_); } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(operation_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 2, operation_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(operation_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, operation_); } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(protocol_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 3, protocol_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(protocol_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 3, protocol_); } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(version_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 4, version_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(version_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 4, version_); } getUnknownFields().writeTo(output); } @@ -2058,17 +2121,17 @@ public int getSerializedSize() { if (size != -1) return size; size = 0; - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(service_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, service_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(service_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, service_); } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(operation_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, operation_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(operation_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, operation_); } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(protocol_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, protocol_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(protocol_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(3, protocol_); } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(version_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, version_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(version_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(4, version_); } size += getUnknownFields().getSerializedSize(); memoizedSize = size; @@ -2151,38 +2214,38 @@ public static com.google.rpc.context.AttributeContext.Api parseFrom( public static com.google.rpc.context.AttributeContext.Api parseFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); } public static com.google.rpc.context.AttributeContext.Api parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } public static com.google.rpc.context.AttributeContext.Api parseDelimitedFrom( java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); } public static com.google.rpc.context.AttributeContext.Api parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( PARSER, input, extensionRegistry); } public static com.google.rpc.context.AttributeContext.Api parseFrom( com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); } public static com.google.rpc.context.AttributeContext.Api parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } @@ -2205,11 +2268,11 @@ public Builder toBuilder() { } @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { Builder builder = new Builder(parent); return builder; } + /** * * @@ -2221,8 +2284,7 @@ protected Builder newBuilderForType( * * Protobuf type {@code google.rpc.context.AttributeContext.Api} */ - public static final class Builder - extends com.google.protobuf.GeneratedMessageV3.Builder + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder implements // @@protoc_insertion_point(builder_implements:google.rpc.context.AttributeContext.Api) com.google.rpc.context.AttributeContext.ApiOrBuilder { @@ -2232,7 +2294,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.rpc.context.AttributeContextProto .internal_static_google_rpc_context_AttributeContext_Api_fieldAccessorTable @@ -2244,21 +2306,18 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { // Construct using com.google.rpc.context.AttributeContext.Api.newBuilder() private Builder() {} - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { super(parent); } @java.lang.Override public Builder clear() { super.clear(); + bitField0_ = 0; service_ = ""; - operation_ = ""; - protocol_ = ""; - version_ = ""; - return this; } @@ -2286,47 +2345,27 @@ public com.google.rpc.context.AttributeContext.Api build() { public com.google.rpc.context.AttributeContext.Api buildPartial() { com.google.rpc.context.AttributeContext.Api result = new com.google.rpc.context.AttributeContext.Api(this); - result.service_ = service_; - result.operation_ = operation_; - result.protocol_ = protocol_; - result.version_ = version_; + if (bitField0_ != 0) { + buildPartial0(result); + } 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); + private void buildPartial0(com.google.rpc.context.AttributeContext.Api result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.service_ = service_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.operation_ = operation_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.protocol_ = protocol_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.version_ = version_; + } } @java.lang.Override @@ -2343,18 +2382,22 @@ public Builder mergeFrom(com.google.rpc.context.AttributeContext.Api other) { if (other == com.google.rpc.context.AttributeContext.Api.getDefaultInstance()) return this; if (!other.getService().isEmpty()) { service_ = other.service_; + bitField0_ |= 0x00000001; onChanged(); } if (!other.getOperation().isEmpty()) { operation_ = other.operation_; + bitField0_ |= 0x00000002; onChanged(); } if (!other.getProtocol().isEmpty()) { protocol_ = other.protocol_; + bitField0_ |= 0x00000004; onChanged(); } if (!other.getVersion().isEmpty()) { version_ = other.version_; + bitField0_ |= 0x00000008; onChanged(); } this.mergeUnknownFields(other.getUnknownFields()); @@ -2386,25 +2429,25 @@ public Builder mergeFrom( case 10: { service_ = input.readStringRequireUtf8(); - + bitField0_ |= 0x00000001; break; } // case 10 case 18: { operation_ = input.readStringRequireUtf8(); - + bitField0_ |= 0x00000002; break; } // case 18 case 26: { protocol_ = input.readStringRequireUtf8(); - + bitField0_ |= 0x00000004; break; } // case 26 case 34: { version_ = input.readStringRequireUtf8(); - + bitField0_ |= 0x00000008; break; } // case 34 default: @@ -2424,7 +2467,10 @@ public Builder mergeFrom( return this; } + private int bitField0_; + private java.lang.Object service_ = ""; + /** * * @@ -2449,6 +2495,7 @@ public java.lang.String getService() { return (java.lang.String) ref; } } + /** * * @@ -2473,6 +2520,7 @@ public com.google.protobuf.ByteString getServiceBytes() { return (com.google.protobuf.ByteString) ref; } } + /** * * @@ -2491,11 +2539,12 @@ public Builder setService(java.lang.String value) { if (value == null) { throw new NullPointerException(); } - service_ = value; + bitField0_ |= 0x00000001; onChanged(); return this; } + /** * * @@ -2510,11 +2559,12 @@ public Builder setService(java.lang.String value) { * @return This builder for chaining. */ public Builder clearService() { - service_ = getDefaultInstance().getService(); + bitField0_ = (bitField0_ & ~0x00000001); onChanged(); return this; } + /** * * @@ -2534,13 +2584,14 @@ public Builder setServiceBytes(com.google.protobuf.ByteString value) { throw new NullPointerException(); } checkByteStringIsUtf8(value); - service_ = value; + bitField0_ |= 0x00000001; onChanged(); return this; } private java.lang.Object operation_ = ""; + /** * * @@ -2565,6 +2616,7 @@ public java.lang.String getOperation() { return (java.lang.String) ref; } } + /** * * @@ -2589,6 +2641,7 @@ public com.google.protobuf.ByteString getOperationBytes() { return (com.google.protobuf.ByteString) ref; } } + /** * * @@ -2607,11 +2660,12 @@ public Builder setOperation(java.lang.String value) { if (value == null) { throw new NullPointerException(); } - operation_ = value; + bitField0_ |= 0x00000002; onChanged(); return this; } + /** * * @@ -2626,11 +2680,12 @@ public Builder setOperation(java.lang.String value) { * @return This builder for chaining. */ public Builder clearOperation() { - operation_ = getDefaultInstance().getOperation(); + bitField0_ = (bitField0_ & ~0x00000002); onChanged(); return this; } + /** * * @@ -2650,13 +2705,14 @@ public Builder setOperationBytes(com.google.protobuf.ByteString value) { throw new NullPointerException(); } checkByteStringIsUtf8(value); - operation_ = value; + bitField0_ |= 0x00000002; onChanged(); return this; } private java.lang.Object protocol_ = ""; + /** * * @@ -2680,6 +2736,7 @@ public java.lang.String getProtocol() { return (java.lang.String) ref; } } + /** * * @@ -2703,6 +2760,7 @@ public com.google.protobuf.ByteString getProtocolBytes() { return (com.google.protobuf.ByteString) ref; } } + /** * * @@ -2720,11 +2778,12 @@ public Builder setProtocol(java.lang.String value) { if (value == null) { throw new NullPointerException(); } - protocol_ = value; + bitField0_ |= 0x00000004; onChanged(); return this; } + /** * * @@ -2738,11 +2797,12 @@ public Builder setProtocol(java.lang.String value) { * @return This builder for chaining. */ public Builder clearProtocol() { - protocol_ = getDefaultInstance().getProtocol(); + bitField0_ = (bitField0_ & ~0x00000004); onChanged(); return this; } + /** * * @@ -2761,13 +2821,14 @@ public Builder setProtocolBytes(com.google.protobuf.ByteString value) { throw new NullPointerException(); } checkByteStringIsUtf8(value); - protocol_ = value; + bitField0_ |= 0x00000004; onChanged(); return this; } private java.lang.Object version_ = ""; + /** * * @@ -2791,6 +2852,7 @@ public java.lang.String getVersion() { return (java.lang.String) ref; } } + /** * * @@ -2814,6 +2876,7 @@ public com.google.protobuf.ByteString getVersionBytes() { return (com.google.protobuf.ByteString) ref; } } + /** * * @@ -2831,11 +2894,12 @@ public Builder setVersion(java.lang.String value) { if (value == null) { throw new NullPointerException(); } - version_ = value; + bitField0_ |= 0x00000008; onChanged(); return this; } + /** * * @@ -2849,11 +2913,12 @@ public Builder setVersion(java.lang.String value) { * @return This builder for chaining. */ public Builder clearVersion() { - version_ = getDefaultInstance().getVersion(); + bitField0_ = (bitField0_ & ~0x00000008); onChanged(); return this; } + /** * * @@ -2872,24 +2937,12 @@ public Builder setVersionBytes(com.google.protobuf.ByteString value) { throw new NullPointerException(); } checkByteStringIsUtf8(value); - version_ = 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.rpc.context.AttributeContext.Api) } @@ -2963,6 +3016,7 @@ public interface AuthOrBuilder * @return The principal. */ java.lang.String getPrincipal(); + /** * * @@ -2988,12 +3042,14 @@ public interface AuthOrBuilder * the audience (`aud`) claim within a JWT. The audience * value(s) depends on the `issuer`, but typically include one or more of * the following pieces of information: + * * * The services intended to receive the credential. For example, - * ["https://pubsub.googleapis.com/", "https://storage.googleapis.com/"]. + * ["https://pubsub.googleapis.com/", "https://storage.googleapis.com/"]. * * A set of service-based scopes. For example, - * ["https://www.googleapis.com/auth/cloud-platform"]. + * ["https://www.googleapis.com/auth/cloud-platform"]. * * The client id of an app, such as the Firebase project id for JWTs - * from Firebase Auth. + * from Firebase Auth. + * * Consult the documentation for the credential issuer to determine the * information provided. *
        @@ -3003,6 +3059,7 @@ public interface AuthOrBuilder * @return A list containing the audiences. */ java.util.List getAudiencesList(); + /** * * @@ -3011,12 +3068,14 @@ public interface AuthOrBuilder * the audience (`aud`) claim within a JWT. The audience * value(s) depends on the `issuer`, but typically include one or more of * the following pieces of information: + * * * The services intended to receive the credential. For example, - * ["https://pubsub.googleapis.com/", "https://storage.googleapis.com/"]. + * ["https://pubsub.googleapis.com/", "https://storage.googleapis.com/"]. * * A set of service-based scopes. For example, - * ["https://www.googleapis.com/auth/cloud-platform"]. + * ["https://www.googleapis.com/auth/cloud-platform"]. * * The client id of an app, such as the Firebase project id for JWTs - * from Firebase Auth. + * from Firebase Auth. + * * Consult the documentation for the credential issuer to determine the * information provided. * @@ -3026,6 +3085,7 @@ public interface AuthOrBuilder * @return The count of audiences. */ int getAudiencesCount(); + /** * * @@ -3034,12 +3094,14 @@ public interface AuthOrBuilder * the audience (`aud`) claim within a JWT. The audience * value(s) depends on the `issuer`, but typically include one or more of * the following pieces of information: + * * * The services intended to receive the credential. For example, - * ["https://pubsub.googleapis.com/", "https://storage.googleapis.com/"]. + * ["https://pubsub.googleapis.com/", "https://storage.googleapis.com/"]. * * A set of service-based scopes. For example, - * ["https://www.googleapis.com/auth/cloud-platform"]. + * ["https://www.googleapis.com/auth/cloud-platform"]. * * The client id of an app, such as the Firebase project id for JWTs - * from Firebase Auth. + * from Firebase Auth. + * * Consult the documentation for the credential issuer to determine the * information provided. * @@ -3050,6 +3112,7 @@ public interface AuthOrBuilder * @return The audiences at the given index. */ java.lang.String getAudiences(int index); + /** * * @@ -3058,12 +3121,14 @@ public interface AuthOrBuilder * the audience (`aud`) claim within a JWT. The audience * value(s) depends on the `issuer`, but typically include one or more of * the following pieces of information: + * * * The services intended to receive the credential. For example, - * ["https://pubsub.googleapis.com/", "https://storage.googleapis.com/"]. + * ["https://pubsub.googleapis.com/", "https://storage.googleapis.com/"]. * * A set of service-based scopes. For example, - * ["https://www.googleapis.com/auth/cloud-platform"]. + * ["https://www.googleapis.com/auth/cloud-platform"]. * * The client id of an app, such as the Firebase project id for JWTs - * from Firebase Auth. + * from Firebase Auth. + * * Consult the documentation for the credential issuer to determine the * information provided. * @@ -3090,6 +3155,7 @@ public interface AuthOrBuilder * @return The presenter. */ java.lang.String getPresenter(); + /** * * @@ -3114,13 +3180,15 @@ public interface AuthOrBuilder * `{key: value}` pairs for standard and private claims. The following * is a subset of the standard required and optional claims that would * typically be presented for a Google-based JWT: - * {'iss': 'accounts.google.com', - * 'sub': '113289723416554971153', - * 'aud': ['123456789012', 'pubsub.googleapis.com'], - * 'azp': '123456789012.apps.googleusercontent.com', - * 'email': 'jsmith@example.com', - * 'iat': 1353601026, - * 'exp': 1353604926} + * + * {'iss': 'accounts.google.com', + * 'sub': '113289723416554971153', + * 'aud': ['123456789012', 'pubsub.googleapis.com'], + * 'azp': '123456789012.apps.googleusercontent.com', + * 'email': 'jsmith@example.com', + * 'iat': 1353601026, + * 'exp': 1353604926} + * * SAML assertions are similarly specified, but with an identity provider * dependent structure. * @@ -3130,6 +3198,7 @@ public interface AuthOrBuilder * @return Whether the claims field is set. */ boolean hasClaims(); + /** * * @@ -3138,13 +3207,15 @@ public interface AuthOrBuilder * `{key: value}` pairs for standard and private claims. The following * is a subset of the standard required and optional claims that would * typically be presented for a Google-based JWT: - * {'iss': 'accounts.google.com', - * 'sub': '113289723416554971153', - * 'aud': ['123456789012', 'pubsub.googleapis.com'], - * 'azp': '123456789012.apps.googleusercontent.com', - * 'email': 'jsmith@example.com', - * 'iat': 1353601026, - * 'exp': 1353604926} + * + * {'iss': 'accounts.google.com', + * 'sub': '113289723416554971153', + * 'aud': ['123456789012', 'pubsub.googleapis.com'], + * 'azp': '123456789012.apps.googleusercontent.com', + * 'email': 'jsmith@example.com', + * 'iat': 1353601026, + * 'exp': 1353604926} + * * SAML assertions are similarly specified, but with an identity provider * dependent structure. * @@ -3154,6 +3225,7 @@ public interface AuthOrBuilder * @return The claims. */ com.google.protobuf.Struct getClaims(); + /** * * @@ -3162,13 +3234,15 @@ public interface AuthOrBuilder * `{key: value}` pairs for standard and private claims. The following * is a subset of the standard required and optional claims that would * typically be presented for a Google-based JWT: - * {'iss': 'accounts.google.com', - * 'sub': '113289723416554971153', - * 'aud': ['123456789012', 'pubsub.googleapis.com'], - * 'azp': '123456789012.apps.googleusercontent.com', - * 'email': 'jsmith@example.com', - * 'iat': 1353601026, - * 'exp': 1353604926} + * + * {'iss': 'accounts.google.com', + * 'sub': '113289723416554971153', + * 'aud': ['123456789012', 'pubsub.googleapis.com'], + * 'azp': '123456789012.apps.googleusercontent.com', + * 'email': 'jsmith@example.com', + * 'iat': 1353601026, + * 'exp': 1353604926} + * * SAML assertions are similarly specified, but with an identity provider * dependent structure. * @@ -3185,6 +3259,7 @@ public interface AuthOrBuilder * accessed by authenticated requester. It is part of Secure GCP processing * for the incoming request. An access level string has the format: * "//{api_service_name}/accessPolicies/{policy_id}/accessLevels/{short_name}" + * * Example: * "//accesscontextmanager.googleapis.com/accessPolicies/MY_POLICY_ID/accessLevels/MY_LEVEL" * @@ -3194,6 +3269,7 @@ public interface AuthOrBuilder * @return A list containing the accessLevels. */ java.util.List getAccessLevelsList(); + /** * * @@ -3202,6 +3278,7 @@ public interface AuthOrBuilder * accessed by authenticated requester. It is part of Secure GCP processing * for the incoming request. An access level string has the format: * "//{api_service_name}/accessPolicies/{policy_id}/accessLevels/{short_name}" + * * Example: * "//accesscontextmanager.googleapis.com/accessPolicies/MY_POLICY_ID/accessLevels/MY_LEVEL" * @@ -3211,6 +3288,7 @@ public interface AuthOrBuilder * @return The count of accessLevels. */ int getAccessLevelsCount(); + /** * * @@ -3219,6 +3297,7 @@ public interface AuthOrBuilder * accessed by authenticated requester. It is part of Secure GCP processing * for the incoming request. An access level string has the format: * "//{api_service_name}/accessPolicies/{policy_id}/accessLevels/{short_name}" + * * Example: * "//accesscontextmanager.googleapis.com/accessPolicies/MY_POLICY_ID/accessLevels/MY_LEVEL" * @@ -3229,6 +3308,7 @@ public interface AuthOrBuilder * @return The accessLevels at the given index. */ java.lang.String getAccessLevels(int index); + /** * * @@ -3237,6 +3317,7 @@ public interface AuthOrBuilder * accessed by authenticated requester. It is part of Secure GCP processing * for the incoming request. An access level string has the format: * "//{api_service_name}/accessPolicies/{policy_id}/accessLevels/{short_name}" + * * Example: * "//accesscontextmanager.googleapis.com/accessPolicies/MY_POLICY_ID/accessLevels/MY_LEVEL" * @@ -3248,6 +3329,7 @@ public interface AuthOrBuilder */ com.google.protobuf.ByteString getAccessLevelsBytes(int index); } + /** * * @@ -3259,32 +3341,32 @@ public interface AuthOrBuilder * * Protobuf type {@code google.rpc.context.AttributeContext.Auth} */ - public static final class Auth extends com.google.protobuf.GeneratedMessageV3 + public static final class Auth extends com.google.protobuf.GeneratedMessage implements // @@protoc_insertion_point(message_implements:google.rpc.context.AttributeContext.Auth) AuthOrBuilder { private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "Auth"); + } + // Use Auth.newBuilder() to construct. - private Auth(com.google.protobuf.GeneratedMessageV3.Builder builder) { + private Auth(com.google.protobuf.GeneratedMessage.Builder builder) { super(builder); } private Auth() { principal_ = ""; - audiences_ = com.google.protobuf.LazyStringArrayList.EMPTY; + audiences_ = com.google.protobuf.LazyStringArrayList.emptyList(); presenter_ = ""; - accessLevels_ = com.google.protobuf.LazyStringArrayList.EMPTY; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new Auth(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; + accessLevels_ = com.google.protobuf.LazyStringArrayList.emptyList(); } public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { @@ -3293,7 +3375,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.rpc.context.AttributeContextProto .internal_static_google_rpc_context_AttributeContext_Auth_fieldAccessorTable @@ -3302,8 +3384,12 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { com.google.rpc.context.AttributeContext.Auth.Builder.class); } + private int bitField0_; public static final int PRINCIPAL_FIELD_NUMBER = 1; - private volatile java.lang.Object principal_; + + @SuppressWarnings("serial") + private volatile java.lang.Object principal_ = ""; + /** * * @@ -3331,6 +3417,7 @@ public java.lang.String getPrincipal() { return s; } } + /** * * @@ -3360,7 +3447,11 @@ public com.google.protobuf.ByteString getPrincipalBytes() { } public static final int AUDIENCES_FIELD_NUMBER = 2; - private com.google.protobuf.LazyStringList audiences_; + + @SuppressWarnings("serial") + private com.google.protobuf.LazyStringArrayList audiences_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + /** * * @@ -3369,12 +3460,14 @@ public com.google.protobuf.ByteString getPrincipalBytes() { * the audience (`aud`) claim within a JWT. The audience * value(s) depends on the `issuer`, but typically include one or more of * the following pieces of information: + * * * The services intended to receive the credential. For example, - * ["https://pubsub.googleapis.com/", "https://storage.googleapis.com/"]. + * ["https://pubsub.googleapis.com/", "https://storage.googleapis.com/"]. * * A set of service-based scopes. For example, - * ["https://www.googleapis.com/auth/cloud-platform"]. + * ["https://www.googleapis.com/auth/cloud-platform"]. * * The client id of an app, such as the Firebase project id for JWTs - * from Firebase Auth. + * from Firebase Auth. + * * Consult the documentation for the credential issuer to determine the * information provided. * @@ -3386,6 +3479,7 @@ public com.google.protobuf.ByteString getPrincipalBytes() { public com.google.protobuf.ProtocolStringList getAudiencesList() { return audiences_; } + /** * * @@ -3394,12 +3488,14 @@ public com.google.protobuf.ProtocolStringList getAudiencesList() { * the audience (`aud`) claim within a JWT. The audience * value(s) depends on the `issuer`, but typically include one or more of * the following pieces of information: + * * * The services intended to receive the credential. For example, - * ["https://pubsub.googleapis.com/", "https://storage.googleapis.com/"]. + * ["https://pubsub.googleapis.com/", "https://storage.googleapis.com/"]. * * A set of service-based scopes. For example, - * ["https://www.googleapis.com/auth/cloud-platform"]. + * ["https://www.googleapis.com/auth/cloud-platform"]. * * The client id of an app, such as the Firebase project id for JWTs - * from Firebase Auth. + * from Firebase Auth. + * * Consult the documentation for the credential issuer to determine the * information provided. * @@ -3411,6 +3507,7 @@ public com.google.protobuf.ProtocolStringList getAudiencesList() { public int getAudiencesCount() { return audiences_.size(); } + /** * * @@ -3419,12 +3516,14 @@ public int getAudiencesCount() { * the audience (`aud`) claim within a JWT. The audience * value(s) depends on the `issuer`, but typically include one or more of * the following pieces of information: + * * * The services intended to receive the credential. For example, - * ["https://pubsub.googleapis.com/", "https://storage.googleapis.com/"]. + * ["https://pubsub.googleapis.com/", "https://storage.googleapis.com/"]. * * A set of service-based scopes. For example, - * ["https://www.googleapis.com/auth/cloud-platform"]. + * ["https://www.googleapis.com/auth/cloud-platform"]. * * The client id of an app, such as the Firebase project id for JWTs - * from Firebase Auth. + * from Firebase Auth. + * * Consult the documentation for the credential issuer to determine the * information provided. * @@ -3437,6 +3536,7 @@ public int getAudiencesCount() { public java.lang.String getAudiences(int index) { return audiences_.get(index); } + /** * * @@ -3445,12 +3545,14 @@ public java.lang.String getAudiences(int index) { * the audience (`aud`) claim within a JWT. The audience * value(s) depends on the `issuer`, but typically include one or more of * the following pieces of information: + * * * The services intended to receive the credential. For example, - * ["https://pubsub.googleapis.com/", "https://storage.googleapis.com/"]. + * ["https://pubsub.googleapis.com/", "https://storage.googleapis.com/"]. * * A set of service-based scopes. For example, - * ["https://www.googleapis.com/auth/cloud-platform"]. + * ["https://www.googleapis.com/auth/cloud-platform"]. * * The client id of an app, such as the Firebase project id for JWTs - * from Firebase Auth. + * from Firebase Auth. + * * Consult the documentation for the credential issuer to determine the * information provided. * @@ -3465,7 +3567,10 @@ public com.google.protobuf.ByteString getAudiencesBytes(int index) { } public static final int PRESENTER_FIELD_NUMBER = 3; - private volatile java.lang.Object presenter_; + + @SuppressWarnings("serial") + private volatile java.lang.Object presenter_ = ""; + /** * * @@ -3492,6 +3597,7 @@ public java.lang.String getPresenter() { return s; } } + /** * * @@ -3521,6 +3627,7 @@ public com.google.protobuf.ByteString getPresenterBytes() { public static final int CLAIMS_FIELD_NUMBER = 4; private com.google.protobuf.Struct claims_; + /** * * @@ -3529,13 +3636,15 @@ public com.google.protobuf.ByteString getPresenterBytes() { * `{key: value}` pairs for standard and private claims. The following * is a subset of the standard required and optional claims that would * typically be presented for a Google-based JWT: - * {'iss': 'accounts.google.com', - * 'sub': '113289723416554971153', - * 'aud': ['123456789012', 'pubsub.googleapis.com'], - * 'azp': '123456789012.apps.googleusercontent.com', - * 'email': 'jsmith@example.com', - * 'iat': 1353601026, - * 'exp': 1353604926} + * + * {'iss': 'accounts.google.com', + * 'sub': '113289723416554971153', + * 'aud': ['123456789012', 'pubsub.googleapis.com'], + * 'azp': '123456789012.apps.googleusercontent.com', + * 'email': 'jsmith@example.com', + * 'iat': 1353601026, + * 'exp': 1353604926} + * * SAML assertions are similarly specified, but with an identity provider * dependent structure. * @@ -3546,8 +3655,9 @@ public com.google.protobuf.ByteString getPresenterBytes() { */ @java.lang.Override public boolean hasClaims() { - return claims_ != null; + return ((bitField0_ & 0x00000001) != 0); } + /** * * @@ -3556,13 +3666,15 @@ public boolean hasClaims() { * `{key: value}` pairs for standard and private claims. The following * is a subset of the standard required and optional claims that would * typically be presented for a Google-based JWT: - * {'iss': 'accounts.google.com', - * 'sub': '113289723416554971153', - * 'aud': ['123456789012', 'pubsub.googleapis.com'], - * 'azp': '123456789012.apps.googleusercontent.com', - * 'email': 'jsmith@example.com', - * 'iat': 1353601026, - * 'exp': 1353604926} + * + * {'iss': 'accounts.google.com', + * 'sub': '113289723416554971153', + * 'aud': ['123456789012', 'pubsub.googleapis.com'], + * 'azp': '123456789012.apps.googleusercontent.com', + * 'email': 'jsmith@example.com', + * 'iat': 1353601026, + * 'exp': 1353604926} + * * SAML assertions are similarly specified, but with an identity provider * dependent structure. * @@ -3575,6 +3687,7 @@ public boolean hasClaims() { public com.google.protobuf.Struct getClaims() { return claims_ == null ? com.google.protobuf.Struct.getDefaultInstance() : claims_; } + /** * * @@ -3583,13 +3696,15 @@ public com.google.protobuf.Struct getClaims() { * `{key: value}` pairs for standard and private claims. The following * is a subset of the standard required and optional claims that would * typically be presented for a Google-based JWT: - * {'iss': 'accounts.google.com', - * 'sub': '113289723416554971153', - * 'aud': ['123456789012', 'pubsub.googleapis.com'], - * 'azp': '123456789012.apps.googleusercontent.com', - * 'email': 'jsmith@example.com', - * 'iat': 1353601026, - * 'exp': 1353604926} + * + * {'iss': 'accounts.google.com', + * 'sub': '113289723416554971153', + * 'aud': ['123456789012', 'pubsub.googleapis.com'], + * 'azp': '123456789012.apps.googleusercontent.com', + * 'email': 'jsmith@example.com', + * 'iat': 1353601026, + * 'exp': 1353604926} + * * SAML assertions are similarly specified, but with an identity provider * dependent structure. * @@ -3598,11 +3713,15 @@ public com.google.protobuf.Struct getClaims() { */ @java.lang.Override public com.google.protobuf.StructOrBuilder getClaimsOrBuilder() { - return getClaims(); + return claims_ == null ? com.google.protobuf.Struct.getDefaultInstance() : claims_; } public static final int ACCESS_LEVELS_FIELD_NUMBER = 5; - private com.google.protobuf.LazyStringList accessLevels_; + + @SuppressWarnings("serial") + private com.google.protobuf.LazyStringArrayList accessLevels_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + /** * * @@ -3611,6 +3730,7 @@ public com.google.protobuf.StructOrBuilder getClaimsOrBuilder() { * accessed by authenticated requester. It is part of Secure GCP processing * for the incoming request. An access level string has the format: * "//{api_service_name}/accessPolicies/{policy_id}/accessLevels/{short_name}" + * * Example: * "//accesscontextmanager.googleapis.com/accessPolicies/MY_POLICY_ID/accessLevels/MY_LEVEL" * @@ -3622,6 +3742,7 @@ public com.google.protobuf.StructOrBuilder getClaimsOrBuilder() { public com.google.protobuf.ProtocolStringList getAccessLevelsList() { return accessLevels_; } + /** * * @@ -3630,6 +3751,7 @@ public com.google.protobuf.ProtocolStringList getAccessLevelsList() { * accessed by authenticated requester. It is part of Secure GCP processing * for the incoming request. An access level string has the format: * "//{api_service_name}/accessPolicies/{policy_id}/accessLevels/{short_name}" + * * Example: * "//accesscontextmanager.googleapis.com/accessPolicies/MY_POLICY_ID/accessLevels/MY_LEVEL" * @@ -3641,6 +3763,7 @@ public com.google.protobuf.ProtocolStringList getAccessLevelsList() { public int getAccessLevelsCount() { return accessLevels_.size(); } + /** * * @@ -3649,6 +3772,7 @@ public int getAccessLevelsCount() { * accessed by authenticated requester. It is part of Secure GCP processing * for the incoming request. An access level string has the format: * "//{api_service_name}/accessPolicies/{policy_id}/accessLevels/{short_name}" + * * Example: * "//accesscontextmanager.googleapis.com/accessPolicies/MY_POLICY_ID/accessLevels/MY_LEVEL" * @@ -3661,6 +3785,7 @@ public int getAccessLevelsCount() { public java.lang.String getAccessLevels(int index) { return accessLevels_.get(index); } + /** * * @@ -3669,6 +3794,7 @@ public java.lang.String getAccessLevels(int index) { * accessed by authenticated requester. It is part of Secure GCP processing * for the incoming request. An access level string has the format: * "//{api_service_name}/accessPolicies/{policy_id}/accessLevels/{short_name}" + * * Example: * "//accesscontextmanager.googleapis.com/accessPolicies/MY_POLICY_ID/accessLevels/MY_LEVEL" * @@ -3696,20 +3822,20 @@ public final boolean isInitialized() { @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(principal_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, principal_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(principal_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, principal_); } for (int i = 0; i < audiences_.size(); i++) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 2, audiences_.getRaw(i)); + com.google.protobuf.GeneratedMessage.writeString(output, 2, audiences_.getRaw(i)); } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(presenter_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 3, presenter_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(presenter_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 3, presenter_); } - if (claims_ != null) { + if (((bitField0_ & 0x00000001) != 0)) { output.writeMessage(4, getClaims()); } for (int i = 0; i < accessLevels_.size(); i++) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 5, accessLevels_.getRaw(i)); + com.google.protobuf.GeneratedMessage.writeString(output, 5, accessLevels_.getRaw(i)); } getUnknownFields().writeTo(output); } @@ -3720,8 +3846,8 @@ public int getSerializedSize() { if (size != -1) return size; size = 0; - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(principal_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, principal_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(principal_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, principal_); } { int dataSize = 0; @@ -3731,10 +3857,10 @@ public int getSerializedSize() { size += dataSize; size += 1 * getAudiencesList().size(); } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(presenter_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, presenter_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(presenter_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(3, presenter_); } - if (claims_ != null) { + if (((bitField0_ & 0x00000001) != 0)) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, getClaims()); } { @@ -3838,38 +3964,38 @@ public static com.google.rpc.context.AttributeContext.Auth parseFrom( public static com.google.rpc.context.AttributeContext.Auth parseFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); } public static com.google.rpc.context.AttributeContext.Auth parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } public static com.google.rpc.context.AttributeContext.Auth parseDelimitedFrom( java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); } public static com.google.rpc.context.AttributeContext.Auth parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( PARSER, input, extensionRegistry); } public static com.google.rpc.context.AttributeContext.Auth parseFrom( com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); } public static com.google.rpc.context.AttributeContext.Auth parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } @@ -3892,11 +4018,11 @@ public Builder toBuilder() { } @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { Builder builder = new Builder(parent); return builder; } + /** * * @@ -3908,8 +4034,7 @@ protected Builder newBuilderForType( * * Protobuf type {@code google.rpc.context.AttributeContext.Auth} */ - public static final class Builder - extends com.google.protobuf.GeneratedMessageV3.Builder + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder implements // @@protoc_insertion_point(builder_implements:google.rpc.context.AttributeContext.Auth) com.google.rpc.context.AttributeContext.AuthOrBuilder { @@ -3919,7 +4044,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.rpc.context.AttributeContextProto .internal_static_google_rpc_context_AttributeContext_Auth_fieldAccessorTable @@ -3929,29 +4054,34 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } // Construct using com.google.rpc.context.AttributeContext.Auth.newBuilder() - private Builder() {} + private Builder() { + maybeForceBuilderInitialization(); + } - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetClaimsFieldBuilder(); + } } @java.lang.Override public Builder clear() { super.clear(); + bitField0_ = 0; principal_ = ""; - - audiences_ = com.google.protobuf.LazyStringArrayList.EMPTY; - bitField0_ = (bitField0_ & ~0x00000001); + audiences_ = com.google.protobuf.LazyStringArrayList.emptyList(); presenter_ = ""; - - if (claimsBuilder_ == null) { - claims_ = null; - } else { - claims_ = null; + claims_ = null; + if (claimsBuilder_ != null) { + claimsBuilder_.dispose(); claimsBuilder_ = null; } - accessLevels_ = com.google.protobuf.LazyStringArrayList.EMPTY; - bitField0_ = (bitField0_ & ~0x00000002); + accessLevels_ = com.google.protobuf.LazyStringArrayList.emptyList(); return this; } @@ -3979,61 +4109,35 @@ public com.google.rpc.context.AttributeContext.Auth build() { public com.google.rpc.context.AttributeContext.Auth buildPartial() { com.google.rpc.context.AttributeContext.Auth result = new com.google.rpc.context.AttributeContext.Auth(this); - int from_bitField0_ = bitField0_; - result.principal_ = principal_; - if (((bitField0_ & 0x00000001) != 0)) { - audiences_ = audiences_.getUnmodifiableView(); - bitField0_ = (bitField0_ & ~0x00000001); - } - result.audiences_ = audiences_; - result.presenter_ = presenter_; - if (claimsBuilder_ == null) { - result.claims_ = claims_; - } else { - result.claims_ = claimsBuilder_.build(); - } - if (((bitField0_ & 0x00000002) != 0)) { - accessLevels_ = accessLevels_.getUnmodifiableView(); - bitField0_ = (bitField0_ & ~0x00000002); + if (bitField0_ != 0) { + buildPartial0(result); } - result.accessLevels_ = accessLevels_; 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); + private void buildPartial0(com.google.rpc.context.AttributeContext.Auth result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.principal_ = principal_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + audiences_.makeImmutable(); + result.audiences_ = audiences_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.presenter_ = presenter_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000008) != 0)) { + result.claims_ = claimsBuilder_ == null ? claims_ : claimsBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + accessLevels_.makeImmutable(); + result.accessLevels_ = accessLevels_; + } + result.bitField0_ |= to_bitField0_; } @java.lang.Override @@ -4050,12 +4154,13 @@ public Builder mergeFrom(com.google.rpc.context.AttributeContext.Auth other) { if (other == com.google.rpc.context.AttributeContext.Auth.getDefaultInstance()) return this; if (!other.getPrincipal().isEmpty()) { principal_ = other.principal_; + bitField0_ |= 0x00000001; onChanged(); } if (!other.audiences_.isEmpty()) { if (audiences_.isEmpty()) { audiences_ = other.audiences_; - bitField0_ = (bitField0_ & ~0x00000001); + bitField0_ |= 0x00000002; } else { ensureAudiencesIsMutable(); audiences_.addAll(other.audiences_); @@ -4064,6 +4169,7 @@ public Builder mergeFrom(com.google.rpc.context.AttributeContext.Auth other) { } if (!other.getPresenter().isEmpty()) { presenter_ = other.presenter_; + bitField0_ |= 0x00000004; onChanged(); } if (other.hasClaims()) { @@ -4072,7 +4178,7 @@ public Builder mergeFrom(com.google.rpc.context.AttributeContext.Auth other) { if (!other.accessLevels_.isEmpty()) { if (accessLevels_.isEmpty()) { accessLevels_ = other.accessLevels_; - bitField0_ = (bitField0_ & ~0x00000002); + bitField0_ |= 0x00000010; } else { ensureAccessLevelsIsMutable(); accessLevels_.addAll(other.accessLevels_); @@ -4108,7 +4214,7 @@ public Builder mergeFrom( case 10: { principal_ = input.readStringRequireUtf8(); - + bitField0_ |= 0x00000001; break; } // case 10 case 18: @@ -4121,13 +4227,14 @@ public Builder mergeFrom( case 26: { presenter_ = input.readStringRequireUtf8(); - + bitField0_ |= 0x00000004; break; } // case 26 case 34: { - input.readMessage(getClaimsFieldBuilder().getBuilder(), extensionRegistry); - + input.readMessage( + internalGetClaimsFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000008; break; } // case 34 case 42: @@ -4157,6 +4264,7 @@ public Builder mergeFrom( private int bitField0_; private java.lang.Object principal_ = ""; + /** * * @@ -4183,6 +4291,7 @@ public java.lang.String getPrincipal() { return (java.lang.String) ref; } } + /** * * @@ -4209,6 +4318,7 @@ public com.google.protobuf.ByteString getPrincipalBytes() { return (com.google.protobuf.ByteString) ref; } } + /** * * @@ -4229,11 +4339,12 @@ public Builder setPrincipal(java.lang.String value) { if (value == null) { throw new NullPointerException(); } - principal_ = value; + bitField0_ |= 0x00000001; onChanged(); return this; } + /** * * @@ -4250,11 +4361,12 @@ public Builder setPrincipal(java.lang.String value) { * @return This builder for chaining. */ public Builder clearPrincipal() { - principal_ = getDefaultInstance().getPrincipal(); + bitField0_ = (bitField0_ & ~0x00000001); onChanged(); return this; } + /** * * @@ -4276,21 +4388,22 @@ public Builder setPrincipalBytes(com.google.protobuf.ByteString value) { throw new NullPointerException(); } checkByteStringIsUtf8(value); - principal_ = value; + bitField0_ |= 0x00000001; onChanged(); return this; } - private com.google.protobuf.LazyStringList audiences_ = - com.google.protobuf.LazyStringArrayList.EMPTY; + private com.google.protobuf.LazyStringArrayList audiences_ = + com.google.protobuf.LazyStringArrayList.emptyList(); private void ensureAudiencesIsMutable() { - if (!((bitField0_ & 0x00000001) != 0)) { + if (!audiences_.isModifiable()) { audiences_ = new com.google.protobuf.LazyStringArrayList(audiences_); - bitField0_ |= 0x00000001; } + bitField0_ |= 0x00000002; } + /** * * @@ -4299,12 +4412,14 @@ private void ensureAudiencesIsMutable() { * the audience (`aud`) claim within a JWT. The audience * value(s) depends on the `issuer`, but typically include one or more of * the following pieces of information: + * * * The services intended to receive the credential. For example, - * ["https://pubsub.googleapis.com/", "https://storage.googleapis.com/"]. + * ["https://pubsub.googleapis.com/", "https://storage.googleapis.com/"]. * * A set of service-based scopes. For example, - * ["https://www.googleapis.com/auth/cloud-platform"]. + * ["https://www.googleapis.com/auth/cloud-platform"]. * * The client id of an app, such as the Firebase project id for JWTs - * from Firebase Auth. + * from Firebase Auth. + * * Consult the documentation for the credential issuer to determine the * information provided. * @@ -4314,8 +4429,10 @@ private void ensureAudiencesIsMutable() { * @return A list containing the audiences. */ public com.google.protobuf.ProtocolStringList getAudiencesList() { - return audiences_.getUnmodifiableView(); + audiences_.makeImmutable(); + return audiences_; } + /** * * @@ -4324,12 +4441,14 @@ public com.google.protobuf.ProtocolStringList getAudiencesList() { * the audience (`aud`) claim within a JWT. The audience * value(s) depends on the `issuer`, but typically include one or more of * the following pieces of information: + * * * The services intended to receive the credential. For example, - * ["https://pubsub.googleapis.com/", "https://storage.googleapis.com/"]. + * ["https://pubsub.googleapis.com/", "https://storage.googleapis.com/"]. * * A set of service-based scopes. For example, - * ["https://www.googleapis.com/auth/cloud-platform"]. + * ["https://www.googleapis.com/auth/cloud-platform"]. * * The client id of an app, such as the Firebase project id for JWTs - * from Firebase Auth. + * from Firebase Auth. + * * Consult the documentation for the credential issuer to determine the * information provided. * @@ -4341,6 +4460,7 @@ public com.google.protobuf.ProtocolStringList getAudiencesList() { public int getAudiencesCount() { return audiences_.size(); } + /** * * @@ -4349,12 +4469,14 @@ public int getAudiencesCount() { * the audience (`aud`) claim within a JWT. The audience * value(s) depends on the `issuer`, but typically include one or more of * the following pieces of information: + * * * The services intended to receive the credential. For example, - * ["https://pubsub.googleapis.com/", "https://storage.googleapis.com/"]. + * ["https://pubsub.googleapis.com/", "https://storage.googleapis.com/"]. * * A set of service-based scopes. For example, - * ["https://www.googleapis.com/auth/cloud-platform"]. + * ["https://www.googleapis.com/auth/cloud-platform"]. * * The client id of an app, such as the Firebase project id for JWTs - * from Firebase Auth. + * from Firebase Auth. + * * Consult the documentation for the credential issuer to determine the * information provided. * @@ -4367,6 +4489,7 @@ public int getAudiencesCount() { public java.lang.String getAudiences(int index) { return audiences_.get(index); } + /** * * @@ -4375,12 +4498,14 @@ public java.lang.String getAudiences(int index) { * the audience (`aud`) claim within a JWT. The audience * value(s) depends on the `issuer`, but typically include one or more of * the following pieces of information: + * * * The services intended to receive the credential. For example, - * ["https://pubsub.googleapis.com/", "https://storage.googleapis.com/"]. + * ["https://pubsub.googleapis.com/", "https://storage.googleapis.com/"]. * * A set of service-based scopes. For example, - * ["https://www.googleapis.com/auth/cloud-platform"]. + * ["https://www.googleapis.com/auth/cloud-platform"]. * * The client id of an app, such as the Firebase project id for JWTs - * from Firebase Auth. + * from Firebase Auth. + * * Consult the documentation for the credential issuer to determine the * information provided. * @@ -4393,6 +4518,7 @@ public java.lang.String getAudiences(int index) { public com.google.protobuf.ByteString getAudiencesBytes(int index) { return audiences_.getByteString(index); } + /** * * @@ -4401,12 +4527,14 @@ public com.google.protobuf.ByteString getAudiencesBytes(int index) { * the audience (`aud`) claim within a JWT. The audience * value(s) depends on the `issuer`, but typically include one or more of * the following pieces of information: + * * * The services intended to receive the credential. For example, - * ["https://pubsub.googleapis.com/", "https://storage.googleapis.com/"]. + * ["https://pubsub.googleapis.com/", "https://storage.googleapis.com/"]. * * A set of service-based scopes. For example, - * ["https://www.googleapis.com/auth/cloud-platform"]. + * ["https://www.googleapis.com/auth/cloud-platform"]. * * The client id of an app, such as the Firebase project id for JWTs - * from Firebase Auth. + * from Firebase Auth. + * * Consult the documentation for the credential issuer to determine the * information provided. * @@ -4423,9 +4551,11 @@ public Builder setAudiences(int index, java.lang.String value) { } ensureAudiencesIsMutable(); audiences_.set(index, value); + bitField0_ |= 0x00000002; onChanged(); return this; } + /** * * @@ -4434,12 +4564,14 @@ public Builder setAudiences(int index, java.lang.String value) { * the audience (`aud`) claim within a JWT. The audience * value(s) depends on the `issuer`, but typically include one or more of * the following pieces of information: + * * * The services intended to receive the credential. For example, - * ["https://pubsub.googleapis.com/", "https://storage.googleapis.com/"]. + * ["https://pubsub.googleapis.com/", "https://storage.googleapis.com/"]. * * A set of service-based scopes. For example, - * ["https://www.googleapis.com/auth/cloud-platform"]. + * ["https://www.googleapis.com/auth/cloud-platform"]. * * The client id of an app, such as the Firebase project id for JWTs - * from Firebase Auth. + * from Firebase Auth. + * * Consult the documentation for the credential issuer to determine the * information provided. * @@ -4455,9 +4587,11 @@ public Builder addAudiences(java.lang.String value) { } ensureAudiencesIsMutable(); audiences_.add(value); + bitField0_ |= 0x00000002; onChanged(); return this; } + /** * * @@ -4466,12 +4600,14 @@ public Builder addAudiences(java.lang.String value) { * the audience (`aud`) claim within a JWT. The audience * value(s) depends on the `issuer`, but typically include one or more of * the following pieces of information: + * * * The services intended to receive the credential. For example, - * ["https://pubsub.googleapis.com/", "https://storage.googleapis.com/"]. + * ["https://pubsub.googleapis.com/", "https://storage.googleapis.com/"]. * * A set of service-based scopes. For example, - * ["https://www.googleapis.com/auth/cloud-platform"]. + * ["https://www.googleapis.com/auth/cloud-platform"]. * * The client id of an app, such as the Firebase project id for JWTs - * from Firebase Auth. + * from Firebase Auth. + * * Consult the documentation for the credential issuer to determine the * information provided. * @@ -4484,9 +4620,11 @@ public Builder addAudiences(java.lang.String value) { public Builder addAllAudiences(java.lang.Iterable values) { ensureAudiencesIsMutable(); com.google.protobuf.AbstractMessageLite.Builder.addAll(values, audiences_); + bitField0_ |= 0x00000002; onChanged(); return this; } + /** * * @@ -4495,12 +4633,14 @@ public Builder addAllAudiences(java.lang.Iterable values) { * the audience (`aud`) claim within a JWT. The audience * value(s) depends on the `issuer`, but typically include one or more of * the following pieces of information: + * * * The services intended to receive the credential. For example, - * ["https://pubsub.googleapis.com/", "https://storage.googleapis.com/"]. + * ["https://pubsub.googleapis.com/", "https://storage.googleapis.com/"]. * * A set of service-based scopes. For example, - * ["https://www.googleapis.com/auth/cloud-platform"]. + * ["https://www.googleapis.com/auth/cloud-platform"]. * * The client id of an app, such as the Firebase project id for JWTs - * from Firebase Auth. + * from Firebase Auth. + * * Consult the documentation for the credential issuer to determine the * information provided. * @@ -4510,11 +4650,13 @@ public Builder addAllAudiences(java.lang.Iterable values) { * @return This builder for chaining. */ public Builder clearAudiences() { - audiences_ = com.google.protobuf.LazyStringArrayList.EMPTY; - bitField0_ = (bitField0_ & ~0x00000001); + audiences_ = com.google.protobuf.LazyStringArrayList.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + ; onChanged(); return this; } + /** * * @@ -4523,12 +4665,14 @@ public Builder clearAudiences() { * the audience (`aud`) claim within a JWT. The audience * value(s) depends on the `issuer`, but typically include one or more of * the following pieces of information: + * * * The services intended to receive the credential. For example, - * ["https://pubsub.googleapis.com/", "https://storage.googleapis.com/"]. + * ["https://pubsub.googleapis.com/", "https://storage.googleapis.com/"]. * * A set of service-based scopes. For example, - * ["https://www.googleapis.com/auth/cloud-platform"]. + * ["https://www.googleapis.com/auth/cloud-platform"]. * * The client id of an app, such as the Firebase project id for JWTs - * from Firebase Auth. + * from Firebase Auth. + * * Consult the documentation for the credential issuer to determine the * information provided. * @@ -4545,11 +4689,13 @@ public Builder addAudiencesBytes(com.google.protobuf.ByteString value) { checkByteStringIsUtf8(value); ensureAudiencesIsMutable(); audiences_.add(value); + bitField0_ |= 0x00000002; onChanged(); return this; } private java.lang.Object presenter_ = ""; + /** * * @@ -4575,6 +4721,7 @@ public java.lang.String getPresenter() { return (java.lang.String) ref; } } + /** * * @@ -4600,6 +4747,7 @@ public com.google.protobuf.ByteString getPresenterBytes() { return (com.google.protobuf.ByteString) ref; } } + /** * * @@ -4619,11 +4767,12 @@ public Builder setPresenter(java.lang.String value) { if (value == null) { throw new NullPointerException(); } - presenter_ = value; + bitField0_ |= 0x00000004; onChanged(); return this; } + /** * * @@ -4639,11 +4788,12 @@ public Builder setPresenter(java.lang.String value) { * @return This builder for chaining. */ public Builder clearPresenter() { - presenter_ = getDefaultInstance().getPresenter(); + bitField0_ = (bitField0_ & ~0x00000004); onChanged(); return this; } + /** * * @@ -4664,18 +4814,19 @@ public Builder setPresenterBytes(com.google.protobuf.ByteString value) { throw new NullPointerException(); } checkByteStringIsUtf8(value); - presenter_ = value; + bitField0_ |= 0x00000004; onChanged(); return this; } private com.google.protobuf.Struct claims_; - private com.google.protobuf.SingleFieldBuilderV3< + private com.google.protobuf.SingleFieldBuilder< com.google.protobuf.Struct, com.google.protobuf.Struct.Builder, com.google.protobuf.StructOrBuilder> claimsBuilder_; + /** * * @@ -4684,13 +4835,15 @@ public Builder setPresenterBytes(com.google.protobuf.ByteString value) { * `{key: value}` pairs for standard and private claims. The following * is a subset of the standard required and optional claims that would * typically be presented for a Google-based JWT: - * {'iss': 'accounts.google.com', - * 'sub': '113289723416554971153', - * 'aud': ['123456789012', 'pubsub.googleapis.com'], - * 'azp': '123456789012.apps.googleusercontent.com', - * 'email': 'jsmith@example.com', - * 'iat': 1353601026, - * 'exp': 1353604926} + * + * {'iss': 'accounts.google.com', + * 'sub': '113289723416554971153', + * 'aud': ['123456789012', 'pubsub.googleapis.com'], + * 'azp': '123456789012.apps.googleusercontent.com', + * 'email': 'jsmith@example.com', + * 'iat': 1353601026, + * 'exp': 1353604926} + * * SAML assertions are similarly specified, but with an identity provider * dependent structure. * @@ -4700,8 +4853,9 @@ public Builder setPresenterBytes(com.google.protobuf.ByteString value) { * @return Whether the claims field is set. */ public boolean hasClaims() { - return claimsBuilder_ != null || claims_ != null; + return ((bitField0_ & 0x00000008) != 0); } + /** * * @@ -4710,13 +4864,15 @@ public boolean hasClaims() { * `{key: value}` pairs for standard and private claims. The following * is a subset of the standard required and optional claims that would * typically be presented for a Google-based JWT: - * {'iss': 'accounts.google.com', - * 'sub': '113289723416554971153', - * 'aud': ['123456789012', 'pubsub.googleapis.com'], - * 'azp': '123456789012.apps.googleusercontent.com', - * 'email': 'jsmith@example.com', - * 'iat': 1353601026, - * 'exp': 1353604926} + * + * {'iss': 'accounts.google.com', + * 'sub': '113289723416554971153', + * 'aud': ['123456789012', 'pubsub.googleapis.com'], + * 'azp': '123456789012.apps.googleusercontent.com', + * 'email': 'jsmith@example.com', + * 'iat': 1353601026, + * 'exp': 1353604926} + * * SAML assertions are similarly specified, but with an identity provider * dependent structure. * @@ -4732,6 +4888,7 @@ public com.google.protobuf.Struct getClaims() { return claimsBuilder_.getMessage(); } } + /** * * @@ -4740,13 +4897,15 @@ public com.google.protobuf.Struct getClaims() { * `{key: value}` pairs for standard and private claims. The following * is a subset of the standard required and optional claims that would * typically be presented for a Google-based JWT: - * {'iss': 'accounts.google.com', - * 'sub': '113289723416554971153', - * 'aud': ['123456789012', 'pubsub.googleapis.com'], - * 'azp': '123456789012.apps.googleusercontent.com', - * 'email': 'jsmith@example.com', - * 'iat': 1353601026, - * 'exp': 1353604926} + * + * {'iss': 'accounts.google.com', + * 'sub': '113289723416554971153', + * 'aud': ['123456789012', 'pubsub.googleapis.com'], + * 'azp': '123456789012.apps.googleusercontent.com', + * 'email': 'jsmith@example.com', + * 'iat': 1353601026, + * 'exp': 1353604926} + * * SAML assertions are similarly specified, but with an identity provider * dependent structure. * @@ -4759,13 +4918,14 @@ public Builder setClaims(com.google.protobuf.Struct value) { throw new NullPointerException(); } claims_ = value; - onChanged(); } else { claimsBuilder_.setMessage(value); } - + bitField0_ |= 0x00000008; + onChanged(); return this; } + /** * * @@ -4774,13 +4934,15 @@ public Builder setClaims(com.google.protobuf.Struct value) { * `{key: value}` pairs for standard and private claims. The following * is a subset of the standard required and optional claims that would * typically be presented for a Google-based JWT: - * {'iss': 'accounts.google.com', - * 'sub': '113289723416554971153', - * 'aud': ['123456789012', 'pubsub.googleapis.com'], - * 'azp': '123456789012.apps.googleusercontent.com', - * 'email': 'jsmith@example.com', - * 'iat': 1353601026, - * 'exp': 1353604926} + * + * {'iss': 'accounts.google.com', + * 'sub': '113289723416554971153', + * 'aud': ['123456789012', 'pubsub.googleapis.com'], + * 'azp': '123456789012.apps.googleusercontent.com', + * 'email': 'jsmith@example.com', + * 'iat': 1353601026, + * 'exp': 1353604926} + * * SAML assertions are similarly specified, but with an identity provider * dependent structure. * @@ -4790,13 +4952,14 @@ public Builder setClaims(com.google.protobuf.Struct value) { public Builder setClaims(com.google.protobuf.Struct.Builder builderForValue) { if (claimsBuilder_ == null) { claims_ = builderForValue.build(); - onChanged(); } else { claimsBuilder_.setMessage(builderForValue.build()); } - + bitField0_ |= 0x00000008; + onChanged(); return this; } + /** * * @@ -4805,13 +4968,15 @@ public Builder setClaims(com.google.protobuf.Struct.Builder builderForValue) { * `{key: value}` pairs for standard and private claims. The following * is a subset of the standard required and optional claims that would * typically be presented for a Google-based JWT: - * {'iss': 'accounts.google.com', - * 'sub': '113289723416554971153', - * 'aud': ['123456789012', 'pubsub.googleapis.com'], - * 'azp': '123456789012.apps.googleusercontent.com', - * 'email': 'jsmith@example.com', - * 'iat': 1353601026, - * 'exp': 1353604926} + * + * {'iss': 'accounts.google.com', + * 'sub': '113289723416554971153', + * 'aud': ['123456789012', 'pubsub.googleapis.com'], + * 'azp': '123456789012.apps.googleusercontent.com', + * 'email': 'jsmith@example.com', + * 'iat': 1353601026, + * 'exp': 1353604926} + * * SAML assertions are similarly specified, but with an identity provider * dependent structure. * @@ -4820,19 +4985,23 @@ public Builder setClaims(com.google.protobuf.Struct.Builder builderForValue) { */ public Builder mergeClaims(com.google.protobuf.Struct value) { if (claimsBuilder_ == null) { - if (claims_ != null) { - claims_ = - com.google.protobuf.Struct.newBuilder(claims_).mergeFrom(value).buildPartial(); + if (((bitField0_ & 0x00000008) != 0) + && claims_ != null + && claims_ != com.google.protobuf.Struct.getDefaultInstance()) { + getClaimsBuilder().mergeFrom(value); } else { claims_ = value; } - onChanged(); } else { claimsBuilder_.mergeFrom(value); } - + if (claims_ != null) { + bitField0_ |= 0x00000008; + onChanged(); + } return this; } + /** * * @@ -4841,13 +5010,15 @@ public Builder mergeClaims(com.google.protobuf.Struct value) { * `{key: value}` pairs for standard and private claims. The following * is a subset of the standard required and optional claims that would * typically be presented for a Google-based JWT: - * {'iss': 'accounts.google.com', - * 'sub': '113289723416554971153', - * 'aud': ['123456789012', 'pubsub.googleapis.com'], - * 'azp': '123456789012.apps.googleusercontent.com', - * 'email': 'jsmith@example.com', - * 'iat': 1353601026, - * 'exp': 1353604926} + * + * {'iss': 'accounts.google.com', + * 'sub': '113289723416554971153', + * 'aud': ['123456789012', 'pubsub.googleapis.com'], + * 'azp': '123456789012.apps.googleusercontent.com', + * 'email': 'jsmith@example.com', + * 'iat': 1353601026, + * 'exp': 1353604926} + * * SAML assertions are similarly specified, but with an identity provider * dependent structure. * @@ -4855,16 +5026,16 @@ public Builder mergeClaims(com.google.protobuf.Struct value) { * .google.protobuf.Struct claims = 4; */ public Builder clearClaims() { - if (claimsBuilder_ == null) { - claims_ = null; - onChanged(); - } else { - claims_ = null; + bitField0_ = (bitField0_ & ~0x00000008); + claims_ = null; + if (claimsBuilder_ != null) { + claimsBuilder_.dispose(); claimsBuilder_ = null; } - + onChanged(); return this; } + /** * * @@ -4873,13 +5044,15 @@ public Builder clearClaims() { * `{key: value}` pairs for standard and private claims. The following * is a subset of the standard required and optional claims that would * typically be presented for a Google-based JWT: - * {'iss': 'accounts.google.com', - * 'sub': '113289723416554971153', - * 'aud': ['123456789012', 'pubsub.googleapis.com'], - * 'azp': '123456789012.apps.googleusercontent.com', - * 'email': 'jsmith@example.com', - * 'iat': 1353601026, - * 'exp': 1353604926} + * + * {'iss': 'accounts.google.com', + * 'sub': '113289723416554971153', + * 'aud': ['123456789012', 'pubsub.googleapis.com'], + * 'azp': '123456789012.apps.googleusercontent.com', + * 'email': 'jsmith@example.com', + * 'iat': 1353601026, + * 'exp': 1353604926} + * * SAML assertions are similarly specified, but with an identity provider * dependent structure. * @@ -4887,10 +5060,11 @@ public Builder clearClaims() { * .google.protobuf.Struct claims = 4; */ public com.google.protobuf.Struct.Builder getClaimsBuilder() { - + bitField0_ |= 0x00000008; onChanged(); - return getClaimsFieldBuilder().getBuilder(); + return internalGetClaimsFieldBuilder().getBuilder(); } + /** * * @@ -4899,13 +5073,15 @@ public com.google.protobuf.Struct.Builder getClaimsBuilder() { * `{key: value}` pairs for standard and private claims. The following * is a subset of the standard required and optional claims that would * typically be presented for a Google-based JWT: - * {'iss': 'accounts.google.com', - * 'sub': '113289723416554971153', - * 'aud': ['123456789012', 'pubsub.googleapis.com'], - * 'azp': '123456789012.apps.googleusercontent.com', - * 'email': 'jsmith@example.com', - * 'iat': 1353601026, - * 'exp': 1353604926} + * + * {'iss': 'accounts.google.com', + * 'sub': '113289723416554971153', + * 'aud': ['123456789012', 'pubsub.googleapis.com'], + * 'azp': '123456789012.apps.googleusercontent.com', + * 'email': 'jsmith@example.com', + * 'iat': 1353601026, + * 'exp': 1353604926} + * * SAML assertions are similarly specified, but with an identity provider * dependent structure. * @@ -4919,6 +5095,7 @@ public com.google.protobuf.StructOrBuilder getClaimsOrBuilder() { return claims_ == null ? com.google.protobuf.Struct.getDefaultInstance() : claims_; } } + /** * * @@ -4927,27 +5104,29 @@ public com.google.protobuf.StructOrBuilder getClaimsOrBuilder() { * `{key: value}` pairs for standard and private claims. The following * is a subset of the standard required and optional claims that would * typically be presented for a Google-based JWT: - * {'iss': 'accounts.google.com', - * 'sub': '113289723416554971153', - * 'aud': ['123456789012', 'pubsub.googleapis.com'], - * 'azp': '123456789012.apps.googleusercontent.com', - * 'email': 'jsmith@example.com', - * 'iat': 1353601026, - * 'exp': 1353604926} + * + * {'iss': 'accounts.google.com', + * 'sub': '113289723416554971153', + * 'aud': ['123456789012', 'pubsub.googleapis.com'], + * 'azp': '123456789012.apps.googleusercontent.com', + * 'email': 'jsmith@example.com', + * 'iat': 1353601026, + * 'exp': 1353604926} + * * SAML assertions are similarly specified, but with an identity provider * dependent structure. * * * .google.protobuf.Struct claims = 4; */ - private com.google.protobuf.SingleFieldBuilderV3< + private com.google.protobuf.SingleFieldBuilder< com.google.protobuf.Struct, com.google.protobuf.Struct.Builder, com.google.protobuf.StructOrBuilder> - getClaimsFieldBuilder() { + internalGetClaimsFieldBuilder() { if (claimsBuilder_ == null) { claimsBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< + new com.google.protobuf.SingleFieldBuilder< com.google.protobuf.Struct, com.google.protobuf.Struct.Builder, com.google.protobuf.StructOrBuilder>( @@ -4957,15 +5136,16 @@ public com.google.protobuf.StructOrBuilder getClaimsOrBuilder() { return claimsBuilder_; } - private com.google.protobuf.LazyStringList accessLevels_ = - com.google.protobuf.LazyStringArrayList.EMPTY; + private com.google.protobuf.LazyStringArrayList accessLevels_ = + com.google.protobuf.LazyStringArrayList.emptyList(); private void ensureAccessLevelsIsMutable() { - if (!((bitField0_ & 0x00000002) != 0)) { + if (!accessLevels_.isModifiable()) { accessLevels_ = new com.google.protobuf.LazyStringArrayList(accessLevels_); - bitField0_ |= 0x00000002; } + bitField0_ |= 0x00000010; } + /** * * @@ -4974,6 +5154,7 @@ private void ensureAccessLevelsIsMutable() { * accessed by authenticated requester. It is part of Secure GCP processing * for the incoming request. An access level string has the format: * "//{api_service_name}/accessPolicies/{policy_id}/accessLevels/{short_name}" + * * Example: * "//accesscontextmanager.googleapis.com/accessPolicies/MY_POLICY_ID/accessLevels/MY_LEVEL" * @@ -4983,8 +5164,10 @@ private void ensureAccessLevelsIsMutable() { * @return A list containing the accessLevels. */ public com.google.protobuf.ProtocolStringList getAccessLevelsList() { - return accessLevels_.getUnmodifiableView(); + accessLevels_.makeImmutable(); + return accessLevels_; } + /** * * @@ -4993,6 +5176,7 @@ public com.google.protobuf.ProtocolStringList getAccessLevelsList() { * accessed by authenticated requester. It is part of Secure GCP processing * for the incoming request. An access level string has the format: * "//{api_service_name}/accessPolicies/{policy_id}/accessLevels/{short_name}" + * * Example: * "//accesscontextmanager.googleapis.com/accessPolicies/MY_POLICY_ID/accessLevels/MY_LEVEL" * @@ -5004,6 +5188,7 @@ public com.google.protobuf.ProtocolStringList getAccessLevelsList() { public int getAccessLevelsCount() { return accessLevels_.size(); } + /** * * @@ -5012,6 +5197,7 @@ public int getAccessLevelsCount() { * accessed by authenticated requester. It is part of Secure GCP processing * for the incoming request. An access level string has the format: * "//{api_service_name}/accessPolicies/{policy_id}/accessLevels/{short_name}" + * * Example: * "//accesscontextmanager.googleapis.com/accessPolicies/MY_POLICY_ID/accessLevels/MY_LEVEL" * @@ -5024,6 +5210,7 @@ public int getAccessLevelsCount() { public java.lang.String getAccessLevels(int index) { return accessLevels_.get(index); } + /** * * @@ -5032,6 +5219,7 @@ public java.lang.String getAccessLevels(int index) { * accessed by authenticated requester. It is part of Secure GCP processing * for the incoming request. An access level string has the format: * "//{api_service_name}/accessPolicies/{policy_id}/accessLevels/{short_name}" + * * Example: * "//accesscontextmanager.googleapis.com/accessPolicies/MY_POLICY_ID/accessLevels/MY_LEVEL" * @@ -5044,6 +5232,7 @@ public java.lang.String getAccessLevels(int index) { public com.google.protobuf.ByteString getAccessLevelsBytes(int index) { return accessLevels_.getByteString(index); } + /** * * @@ -5052,6 +5241,7 @@ public com.google.protobuf.ByteString getAccessLevelsBytes(int index) { * accessed by authenticated requester. It is part of Secure GCP processing * for the incoming request. An access level string has the format: * "//{api_service_name}/accessPolicies/{policy_id}/accessLevels/{short_name}" + * * Example: * "//accesscontextmanager.googleapis.com/accessPolicies/MY_POLICY_ID/accessLevels/MY_LEVEL" * @@ -5068,9 +5258,11 @@ public Builder setAccessLevels(int index, java.lang.String value) { } ensureAccessLevelsIsMutable(); accessLevels_.set(index, value); + bitField0_ |= 0x00000010; onChanged(); return this; } + /** * * @@ -5079,6 +5271,7 @@ public Builder setAccessLevels(int index, java.lang.String value) { * accessed by authenticated requester. It is part of Secure GCP processing * for the incoming request. An access level string has the format: * "//{api_service_name}/accessPolicies/{policy_id}/accessLevels/{short_name}" + * * Example: * "//accesscontextmanager.googleapis.com/accessPolicies/MY_POLICY_ID/accessLevels/MY_LEVEL" * @@ -5094,9 +5287,11 @@ public Builder addAccessLevels(java.lang.String value) { } ensureAccessLevelsIsMutable(); accessLevels_.add(value); + bitField0_ |= 0x00000010; onChanged(); return this; } + /** * * @@ -5105,6 +5300,7 @@ public Builder addAccessLevels(java.lang.String value) { * accessed by authenticated requester. It is part of Secure GCP processing * for the incoming request. An access level string has the format: * "//{api_service_name}/accessPolicies/{policy_id}/accessLevels/{short_name}" + * * Example: * "//accesscontextmanager.googleapis.com/accessPolicies/MY_POLICY_ID/accessLevels/MY_LEVEL" * @@ -5117,9 +5313,11 @@ public Builder addAccessLevels(java.lang.String value) { public Builder addAllAccessLevels(java.lang.Iterable values) { ensureAccessLevelsIsMutable(); com.google.protobuf.AbstractMessageLite.Builder.addAll(values, accessLevels_); + bitField0_ |= 0x00000010; onChanged(); return this; } + /** * * @@ -5128,6 +5326,7 @@ public Builder addAllAccessLevels(java.lang.Iterable values) { * accessed by authenticated requester. It is part of Secure GCP processing * for the incoming request. An access level string has the format: * "//{api_service_name}/accessPolicies/{policy_id}/accessLevels/{short_name}" + * * Example: * "//accesscontextmanager.googleapis.com/accessPolicies/MY_POLICY_ID/accessLevels/MY_LEVEL" * @@ -5137,11 +5336,13 @@ public Builder addAllAccessLevels(java.lang.Iterable values) { * @return This builder for chaining. */ public Builder clearAccessLevels() { - accessLevels_ = com.google.protobuf.LazyStringArrayList.EMPTY; - bitField0_ = (bitField0_ & ~0x00000002); + accessLevels_ = com.google.protobuf.LazyStringArrayList.emptyList(); + bitField0_ = (bitField0_ & ~0x00000010); + ; onChanged(); return this; } + /** * * @@ -5150,6 +5351,7 @@ public Builder clearAccessLevels() { * accessed by authenticated requester. It is part of Secure GCP processing * for the incoming request. An access level string has the format: * "//{api_service_name}/accessPolicies/{policy_id}/accessLevels/{short_name}" + * * Example: * "//accesscontextmanager.googleapis.com/accessPolicies/MY_POLICY_ID/accessLevels/MY_LEVEL" * @@ -5166,22 +5368,11 @@ public Builder addAccessLevelsBytes(com.google.protobuf.ByteString value) { checkByteStringIsUtf8(value); ensureAccessLevelsIsMutable(); accessLevels_.add(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.rpc.context.AttributeContext.Auth) } @@ -5253,6 +5444,7 @@ public interface RequestOrBuilder * @return The id. */ java.lang.String getId(); + /** * * @@ -5280,6 +5472,7 @@ public interface RequestOrBuilder * @return The method. */ java.lang.String getMethod(); + /** * * @@ -5305,6 +5498,7 @@ public interface RequestOrBuilder * map<string, string> headers = 3; */ int getHeadersCount(); + /** * * @@ -5317,9 +5511,11 @@ public interface RequestOrBuilder * map<string, string> headers = 3; */ boolean containsHeaders(java.lang.String key); + /** Use {@link #getHeadersMap()} instead. */ @java.lang.Deprecated java.util.Map getHeaders(); + /** * * @@ -5332,6 +5528,7 @@ public interface RequestOrBuilder * map<string, string> headers = 3; */ java.util.Map getHeadersMap(); + /** * * @@ -5343,12 +5540,12 @@ public interface RequestOrBuilder * * map<string, string> headers = 3; */ - /* nullable */ java.lang.String getHeadersOrDefault( java.lang.String key, /* nullable */ java.lang.String defaultValue); + /** * * @@ -5366,7 +5563,7 @@ java.lang.String getHeadersOrDefault( * * *
        -     * The HTTP URL path.
        +     * The HTTP URL path, excluding the query parameters.
              * 
        * * string path = 4; @@ -5374,11 +5571,12 @@ java.lang.String getHeadersOrDefault( * @return The path. */ java.lang.String getPath(); + /** * * *
        -     * The HTTP URL path.
        +     * The HTTP URL path, excluding the query parameters.
              * 
        * * string path = 4; @@ -5399,6 +5597,7 @@ java.lang.String getHeadersOrDefault( * @return The host. */ java.lang.String getHost(); + /** * * @@ -5424,6 +5623,7 @@ java.lang.String getHeadersOrDefault( * @return The scheme. */ java.lang.String getScheme(); + /** * * @@ -5450,6 +5650,7 @@ java.lang.String getHeadersOrDefault( * @return The query. */ java.lang.String getQuery(); + /** * * @@ -5477,6 +5678,7 @@ java.lang.String getHeadersOrDefault( * @return Whether the time field is set. */ boolean hasTime(); + /** * * @@ -5490,6 +5692,7 @@ java.lang.String getHeadersOrDefault( * @return The time. */ com.google.protobuf.Timestamp getTime(); + /** * * @@ -5530,6 +5733,7 @@ java.lang.String getHeadersOrDefault( * @return The protocol. */ java.lang.String getProtocol(); + /** * * @@ -5559,6 +5763,7 @@ java.lang.String getHeadersOrDefault( * @return The reason. */ java.lang.String getReason(); + /** * * @@ -5586,6 +5791,7 @@ java.lang.String getHeadersOrDefault( * @return Whether the auth field is set. */ boolean hasAuth(); + /** * * @@ -5599,6 +5805,7 @@ java.lang.String getHeadersOrDefault( * @return The auth. */ com.google.rpc.context.AttributeContext.Auth getAuth(); + /** * * @@ -5611,6 +5818,7 @@ java.lang.String getHeadersOrDefault( */ com.google.rpc.context.AttributeContext.AuthOrBuilder getAuthOrBuilder(); } + /** * * @@ -5622,13 +5830,24 @@ java.lang.String getHeadersOrDefault( * * Protobuf type {@code google.rpc.context.AttributeContext.Request} */ - public static final class Request extends com.google.protobuf.GeneratedMessageV3 + public static final class Request extends com.google.protobuf.GeneratedMessage implements // @@protoc_insertion_point(message_implements:google.rpc.context.AttributeContext.Request) RequestOrBuilder { private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "Request"); + } + // Use Request.newBuilder() to construct. - private Request(com.google.protobuf.GeneratedMessageV3.Builder builder) { + private Request(com.google.protobuf.GeneratedMessage.Builder builder) { super(builder); } @@ -5643,17 +5862,6 @@ private Request() { reason_ = ""; } - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new Request(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.rpc.context.AttributeContextProto .internal_static_google_rpc_context_AttributeContext_Request_descriptor; @@ -5661,7 +5869,8 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { @SuppressWarnings({"rawtypes"}) @java.lang.Override - protected com.google.protobuf.MapField internalGetMapField(int number) { + protected com.google.protobuf.MapFieldReflectionAccessor internalGetMapFieldReflection( + int number) { switch (number) { case 3: return internalGetHeaders(); @@ -5671,7 +5880,7 @@ protected com.google.protobuf.MapField internalGetMapField(int number) { } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.rpc.context.AttributeContextProto .internal_static_google_rpc_context_AttributeContext_Request_fieldAccessorTable @@ -5680,8 +5889,12 @@ protected com.google.protobuf.MapField internalGetMapField(int number) { com.google.rpc.context.AttributeContext.Request.Builder.class); } + private int bitField0_; public static final int ID_FIELD_NUMBER = 1; - private volatile java.lang.Object id_; + + @SuppressWarnings("serial") + private volatile java.lang.Object id_ = ""; + /** * * @@ -5707,6 +5920,7 @@ public java.lang.String getId() { return s; } } + /** * * @@ -5734,7 +5948,10 @@ public com.google.protobuf.ByteString getIdBytes() { } public static final int METHOD_FIELD_NUMBER = 2; - private volatile java.lang.Object method_; + + @SuppressWarnings("serial") + private volatile java.lang.Object method_ = ""; + /** * * @@ -5758,6 +5975,7 @@ public java.lang.String getMethod() { return s; } } + /** * * @@ -5795,6 +6013,7 @@ private static final class HeadersDefaultEntryHolder { ""); } + @SuppressWarnings("serial") private com.google.protobuf.MapField headers_; private com.google.protobuf.MapField internalGetHeaders() { @@ -5807,6 +6026,7 @@ private com.google.protobuf.MapField interna public int getHeadersCount() { return internalGetHeaders().getMap().size(); } + /** * * @@ -5825,12 +6045,14 @@ public boolean containsHeaders(java.lang.String key) { } return internalGetHeaders().getMap().containsKey(key); } + /** Use {@link #getHeadersMap()} instead. */ @java.lang.Override @java.lang.Deprecated public java.util.Map getHeaders() { return getHeadersMap(); } + /** * * @@ -5846,6 +6068,7 @@ public java.util.Map getHeaders() { public java.util.Map getHeadersMap() { return internalGetHeaders().getMap(); } + /** * * @@ -5858,14 +6081,17 @@ public java.util.Map getHeadersMap() { * map<string, string> headers = 3; */ @java.lang.Override - public java.lang.String getHeadersOrDefault( - java.lang.String key, java.lang.String defaultValue) { + public /* nullable */ java.lang.String getHeadersOrDefault( + java.lang.String key, + /* nullable */ + java.lang.String defaultValue) { if (key == null) { throw new NullPointerException("map key"); } java.util.Map map = internalGetHeaders().getMap(); return map.containsKey(key) ? map.get(key) : defaultValue; } + /** * * @@ -5890,12 +6116,15 @@ public java.lang.String getHeadersOrThrow(java.lang.String key) { } public static final int PATH_FIELD_NUMBER = 4; - private volatile java.lang.Object path_; + + @SuppressWarnings("serial") + private volatile java.lang.Object path_ = ""; + /** * * *
        -     * The HTTP URL path.
        +     * The HTTP URL path, excluding the query parameters.
              * 
        * * string path = 4; @@ -5914,11 +6143,12 @@ public java.lang.String getPath() { return s; } } + /** * * *
        -     * The HTTP URL path.
        +     * The HTTP URL path, excluding the query parameters.
              * 
        * * string path = 4; @@ -5939,7 +6169,10 @@ public com.google.protobuf.ByteString getPathBytes() { } public static final int HOST_FIELD_NUMBER = 5; - private volatile java.lang.Object host_; + + @SuppressWarnings("serial") + private volatile java.lang.Object host_ = ""; + /** * * @@ -5963,6 +6196,7 @@ public java.lang.String getHost() { return s; } } + /** * * @@ -5988,7 +6222,10 @@ public com.google.protobuf.ByteString getHostBytes() { } public static final int SCHEME_FIELD_NUMBER = 6; - private volatile java.lang.Object scheme_; + + @SuppressWarnings("serial") + private volatile java.lang.Object scheme_ = ""; + /** * * @@ -6012,6 +6249,7 @@ public java.lang.String getScheme() { return s; } } + /** * * @@ -6037,7 +6275,10 @@ public com.google.protobuf.ByteString getSchemeBytes() { } public static final int QUERY_FIELD_NUMBER = 7; - private volatile java.lang.Object query_; + + @SuppressWarnings("serial") + private volatile java.lang.Object query_ = ""; + /** * * @@ -6062,6 +6303,7 @@ public java.lang.String getQuery() { return s; } } + /** * * @@ -6089,6 +6331,7 @@ public com.google.protobuf.ByteString getQueryBytes() { public static final int TIME_FIELD_NUMBER = 9; private com.google.protobuf.Timestamp time_; + /** * * @@ -6103,8 +6346,9 @@ public com.google.protobuf.ByteString getQueryBytes() { */ @java.lang.Override public boolean hasTime() { - return time_ != null; + return ((bitField0_ & 0x00000001) != 0); } + /** * * @@ -6121,6 +6365,7 @@ public boolean hasTime() { public com.google.protobuf.Timestamp getTime() { return time_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : time_; } + /** * * @@ -6133,11 +6378,12 @@ public com.google.protobuf.Timestamp getTime() { */ @java.lang.Override public com.google.protobuf.TimestampOrBuilder getTimeOrBuilder() { - return getTime(); + return time_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : time_; } public static final int SIZE_FIELD_NUMBER = 10; - private long size_; + private long size_ = 0L; + /** * * @@ -6155,7 +6401,10 @@ public long getSize() { } public static final int PROTOCOL_FIELD_NUMBER = 11; - private volatile java.lang.Object protocol_; + + @SuppressWarnings("serial") + private volatile java.lang.Object protocol_ = ""; + /** * * @@ -6182,6 +6431,7 @@ public java.lang.String getProtocol() { return s; } } + /** * * @@ -6210,7 +6460,10 @@ public com.google.protobuf.ByteString getProtocolBytes() { } public static final int REASON_FIELD_NUMBER = 12; - private volatile java.lang.Object reason_; + + @SuppressWarnings("serial") + private volatile java.lang.Object reason_ = ""; + /** * * @@ -6235,6 +6488,7 @@ public java.lang.String getReason() { return s; } } + /** * * @@ -6262,6 +6516,7 @@ public com.google.protobuf.ByteString getReasonBytes() { public static final int AUTH_FIELD_NUMBER = 13; private com.google.rpc.context.AttributeContext.Auth auth_; + /** * * @@ -6276,8 +6531,9 @@ public com.google.protobuf.ByteString getReasonBytes() { */ @java.lang.Override public boolean hasAuth() { - return auth_ != null; + return ((bitField0_ & 0x00000002) != 0); } + /** * * @@ -6296,6 +6552,7 @@ public com.google.rpc.context.AttributeContext.Auth getAuth() { ? com.google.rpc.context.AttributeContext.Auth.getDefaultInstance() : auth_; } + /** * * @@ -6308,7 +6565,9 @@ public com.google.rpc.context.AttributeContext.Auth getAuth() { */ @java.lang.Override public com.google.rpc.context.AttributeContext.AuthOrBuilder getAuthOrBuilder() { - return getAuth(); + return auth_ == null + ? com.google.rpc.context.AttributeContext.Auth.getDefaultInstance() + : auth_; } private byte memoizedIsInitialized = -1; @@ -6325,39 +6584,39 @@ public final boolean isInitialized() { @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.GeneratedMessage.isStringEmpty(id_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, id_); } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(method_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 2, method_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(method_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, method_); } - com.google.protobuf.GeneratedMessageV3.serializeStringMapTo( + com.google.protobuf.GeneratedMessage.serializeStringMapTo( output, internalGetHeaders(), HeadersDefaultEntryHolder.defaultEntry, 3); - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(path_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 4, path_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(path_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 4, path_); } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(host_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 5, host_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(host_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 5, host_); } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(scheme_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 6, scheme_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(scheme_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 6, scheme_); } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(query_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 7, query_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(query_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 7, query_); } - if (time_ != null) { + if (((bitField0_ & 0x00000001) != 0)) { output.writeMessage(9, getTime()); } if (size_ != 0L) { output.writeInt64(10, size_); } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(protocol_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 11, protocol_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(protocol_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 11, protocol_); } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(reason_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 12, reason_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(reason_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 12, reason_); } - if (auth_ != null) { + if (((bitField0_ & 0x00000002) != 0)) { output.writeMessage(13, getAuth()); } getUnknownFields().writeTo(output); @@ -6369,11 +6628,11 @@ public int getSerializedSize() { 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.GeneratedMessage.isStringEmpty(id_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, id_); } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(method_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, method_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(method_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, method_); } for (java.util.Map.Entry entry : internalGetHeaders().getMap().entrySet()) { @@ -6385,31 +6644,31 @@ public int getSerializedSize() { .build(); size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, headers__); } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(path_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, path_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(path_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(4, path_); } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(host_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, host_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(host_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(5, host_); } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(scheme_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(6, scheme_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(scheme_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(6, scheme_); } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(query_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(7, query_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(query_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(7, query_); } - if (time_ != null) { + if (((bitField0_ & 0x00000001) != 0)) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(9, getTime()); } if (size_ != 0L) { size += com.google.protobuf.CodedOutputStream.computeInt64Size(10, size_); } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(protocol_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(11, protocol_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(protocol_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(11, protocol_); } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(reason_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(12, reason_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(reason_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(12, reason_); } - if (auth_ != null) { + if (((bitField0_ & 0x00000002) != 0)) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(13, getAuth()); } size += getUnknownFields().getSerializedSize(); @@ -6529,38 +6788,38 @@ public static com.google.rpc.context.AttributeContext.Request parseFrom( public static com.google.rpc.context.AttributeContext.Request parseFrom( java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); } public static com.google.rpc.context.AttributeContext.Request parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } public static com.google.rpc.context.AttributeContext.Request parseDelimitedFrom( java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); } public static com.google.rpc.context.AttributeContext.Request parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( PARSER, input, extensionRegistry); } public static com.google.rpc.context.AttributeContext.Request parseFrom( com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); } public static com.google.rpc.context.AttributeContext.Request parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } @@ -6583,11 +6842,11 @@ public Builder toBuilder() { } @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { Builder builder = new Builder(parent); return builder; } + /** * * @@ -6599,8 +6858,7 @@ protected Builder newBuilderForType( * * Protobuf type {@code google.rpc.context.AttributeContext.Request} */ - public static final class Builder - extends com.google.protobuf.GeneratedMessageV3.Builder + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder implements // @@protoc_insertion_point(builder_implements:google.rpc.context.AttributeContext.Request) com.google.rpc.context.AttributeContext.RequestOrBuilder { @@ -6610,7 +6868,8 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } @SuppressWarnings({"rawtypes"}) - protected com.google.protobuf.MapField internalGetMapField(int number) { + protected com.google.protobuf.MapFieldReflectionAccessor internalGetMapFieldReflection( + int number) { switch (number) { case 3: return internalGetHeaders(); @@ -6620,7 +6879,8 @@ protected com.google.protobuf.MapField internalGetMapField(int number) { } @SuppressWarnings({"rawtypes"}) - protected com.google.protobuf.MapField internalGetMutableMapField(int number) { + protected com.google.protobuf.MapFieldReflectionAccessor internalGetMutableMapFieldReflection( + int number) { switch (number) { case 3: return internalGetMutableHeaders(); @@ -6630,7 +6890,7 @@ protected com.google.protobuf.MapField internalGetMutableMapField(int number) { } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.rpc.context.AttributeContextProto .internal_static_google_rpc_context_AttributeContext_Request_fieldAccessorTable @@ -6640,44 +6900,44 @@ protected com.google.protobuf.MapField internalGetMutableMapField(int number) { } // Construct using com.google.rpc.context.AttributeContext.Request.newBuilder() - private Builder() {} + private Builder() { + maybeForceBuilderInitialization(); + } - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetTimeFieldBuilder(); + internalGetAuthFieldBuilder(); + } } @java.lang.Override public Builder clear() { super.clear(); + bitField0_ = 0; id_ = ""; - method_ = ""; - internalGetMutableHeaders().clear(); path_ = ""; - host_ = ""; - scheme_ = ""; - query_ = ""; - - if (timeBuilder_ == null) { - time_ = null; - } else { - time_ = null; + time_ = null; + if (timeBuilder_ != null) { + timeBuilder_.dispose(); timeBuilder_ = null; } size_ = 0L; - protocol_ = ""; - reason_ = ""; - - if (authBuilder_ == null) { - auth_ = null; - } else { - auth_ = null; + auth_ = null; + if (authBuilder_ != null) { + authBuilder_.dispose(); authBuilder_ = null; } return this; @@ -6707,65 +6967,56 @@ public com.google.rpc.context.AttributeContext.Request build() { public com.google.rpc.context.AttributeContext.Request buildPartial() { com.google.rpc.context.AttributeContext.Request result = new com.google.rpc.context.AttributeContext.Request(this); - int from_bitField0_ = bitField0_; - result.id_ = id_; - result.method_ = method_; - result.headers_ = internalGetHeaders(); - result.headers_.makeImmutable(); - result.path_ = path_; - result.host_ = host_; - result.scheme_ = scheme_; - result.query_ = query_; - if (timeBuilder_ == null) { - result.time_ = time_; - } else { - result.time_ = timeBuilder_.build(); - } - result.size_ = size_; - result.protocol_ = protocol_; - result.reason_ = reason_; - if (authBuilder_ == null) { - result.auth_ = auth_; - } else { - result.auth_ = authBuilder_.build(); + if (bitField0_ != 0) { + buildPartial0(result); } 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); + private void buildPartial0(com.google.rpc.context.AttributeContext.Request result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.id_ = id_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.method_ = method_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.headers_ = internalGetHeaders(); + result.headers_.makeImmutable(); + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.path_ = path_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.host_ = host_; + } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.scheme_ = scheme_; + } + if (((from_bitField0_ & 0x00000040) != 0)) { + result.query_ = query_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000080) != 0)) { + result.time_ = timeBuilder_ == null ? time_ : timeBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000100) != 0)) { + result.size_ = size_; + } + if (((from_bitField0_ & 0x00000200) != 0)) { + result.protocol_ = protocol_; + } + if (((from_bitField0_ & 0x00000400) != 0)) { + result.reason_ = reason_; + } + if (((from_bitField0_ & 0x00000800) != 0)) { + result.auth_ = authBuilder_ == null ? auth_ : authBuilder_.build(); + to_bitField0_ |= 0x00000002; + } + result.bitField0_ |= to_bitField0_; } @java.lang.Override @@ -6783,27 +7034,34 @@ public Builder mergeFrom(com.google.rpc.context.AttributeContext.Request other) return this; if (!other.getId().isEmpty()) { id_ = other.id_; + bitField0_ |= 0x00000001; onChanged(); } if (!other.getMethod().isEmpty()) { method_ = other.method_; + bitField0_ |= 0x00000002; onChanged(); } internalGetMutableHeaders().mergeFrom(other.internalGetHeaders()); + bitField0_ |= 0x00000004; if (!other.getPath().isEmpty()) { path_ = other.path_; + bitField0_ |= 0x00000008; onChanged(); } if (!other.getHost().isEmpty()) { host_ = other.host_; + bitField0_ |= 0x00000010; onChanged(); } if (!other.getScheme().isEmpty()) { scheme_ = other.scheme_; + bitField0_ |= 0x00000020; onChanged(); } if (!other.getQuery().isEmpty()) { query_ = other.query_; + bitField0_ |= 0x00000040; onChanged(); } if (other.hasTime()) { @@ -6814,10 +7072,12 @@ public Builder mergeFrom(com.google.rpc.context.AttributeContext.Request other) } if (!other.getProtocol().isEmpty()) { protocol_ = other.protocol_; + bitField0_ |= 0x00000200; onChanged(); } if (!other.getReason().isEmpty()) { reason_ = other.reason_; + bitField0_ |= 0x00000400; onChanged(); } if (other.hasAuth()) { @@ -6852,13 +7112,13 @@ public Builder mergeFrom( case 10: { id_ = input.readStringRequireUtf8(); - + bitField0_ |= 0x00000001; break; } // case 10 case 18: { method_ = input.readStringRequireUtf8(); - + bitField0_ |= 0x00000002; break; } // case 18 case 26: @@ -6870,60 +7130,61 @@ public Builder mergeFrom( internalGetMutableHeaders() .getMutableMap() .put(headers__.getKey(), headers__.getValue()); + bitField0_ |= 0x00000004; break; } // case 26 case 34: { path_ = input.readStringRequireUtf8(); - + bitField0_ |= 0x00000008; break; } // case 34 case 42: { host_ = input.readStringRequireUtf8(); - + bitField0_ |= 0x00000010; break; } // case 42 case 50: { scheme_ = input.readStringRequireUtf8(); - + bitField0_ |= 0x00000020; break; } // case 50 case 58: { query_ = input.readStringRequireUtf8(); - + bitField0_ |= 0x00000040; break; } // case 58 case 74: { - input.readMessage(getTimeFieldBuilder().getBuilder(), extensionRegistry); - + input.readMessage(internalGetTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000080; break; } // case 74 case 80: { size_ = input.readInt64(); - + bitField0_ |= 0x00000100; break; } // case 80 case 90: { protocol_ = input.readStringRequireUtf8(); - + bitField0_ |= 0x00000200; break; } // case 90 case 98: { reason_ = input.readStringRequireUtf8(); - + bitField0_ |= 0x00000400; break; } // case 98 case 106: { - input.readMessage(getAuthFieldBuilder().getBuilder(), extensionRegistry); - + input.readMessage(internalGetAuthFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000800; break; } // case 106 default: @@ -6946,6 +7207,7 @@ public Builder mergeFrom( private int bitField0_; private java.lang.Object id_ = ""; + /** * * @@ -6970,6 +7232,7 @@ public java.lang.String getId() { return (java.lang.String) ref; } } + /** * * @@ -6994,6 +7257,7 @@ public com.google.protobuf.ByteString getIdBytes() { return (com.google.protobuf.ByteString) ref; } } + /** * * @@ -7012,11 +7276,12 @@ public Builder setId(java.lang.String value) { if (value == null) { throw new NullPointerException(); } - id_ = value; + bitField0_ |= 0x00000001; onChanged(); return this; } + /** * * @@ -7031,11 +7296,12 @@ public Builder setId(java.lang.String value) { * @return This builder for chaining. */ public Builder clearId() { - id_ = getDefaultInstance().getId(); + bitField0_ = (bitField0_ & ~0x00000001); onChanged(); return this; } + /** * * @@ -7055,13 +7321,14 @@ public Builder setIdBytes(com.google.protobuf.ByteString value) { throw new NullPointerException(); } checkByteStringIsUtf8(value); - id_ = value; + bitField0_ |= 0x00000001; onChanged(); return this; } private java.lang.Object method_ = ""; + /** * * @@ -7084,6 +7351,7 @@ public java.lang.String getMethod() { return (java.lang.String) ref; } } + /** * * @@ -7106,6 +7374,7 @@ public com.google.protobuf.ByteString getMethodBytes() { return (com.google.protobuf.ByteString) ref; } } + /** * * @@ -7122,11 +7391,12 @@ public Builder setMethod(java.lang.String value) { if (value == null) { throw new NullPointerException(); } - method_ = value; + bitField0_ |= 0x00000002; onChanged(); return this; } + /** * * @@ -7139,11 +7409,12 @@ public Builder setMethod(java.lang.String value) { * @return This builder for chaining. */ public Builder clearMethod() { - method_ = getDefaultInstance().getMethod(); + bitField0_ = (bitField0_ & ~0x00000002); onChanged(); return this; } + /** * * @@ -7161,8 +7432,8 @@ public Builder setMethodBytes(com.google.protobuf.ByteString value) { throw new NullPointerException(); } checkByteStringIsUtf8(value); - method_ = value; + bitField0_ |= 0x00000002; onChanged(); return this; } @@ -7179,8 +7450,6 @@ public Builder setMethodBytes(com.google.protobuf.ByteString value) { private com.google.protobuf.MapField internalGetMutableHeaders() { - onChanged(); - ; if (headers_ == null) { headers_ = com.google.protobuf.MapField.newMapField(HeadersDefaultEntryHolder.defaultEntry); @@ -7188,12 +7457,15 @@ public Builder setMethodBytes(com.google.protobuf.ByteString value) { if (!headers_.isMutable()) { headers_ = headers_.copy(); } + bitField0_ |= 0x00000004; + onChanged(); return headers_; } public int getHeadersCount() { return internalGetHeaders().getMap().size(); } + /** * * @@ -7212,12 +7484,14 @@ public boolean containsHeaders(java.lang.String key) { } return internalGetHeaders().getMap().containsKey(key); } + /** Use {@link #getHeadersMap()} instead. */ @java.lang.Override @java.lang.Deprecated public java.util.Map getHeaders() { return getHeadersMap(); } + /** * * @@ -7233,6 +7507,7 @@ public java.util.Map getHeaders() { public java.util.Map getHeadersMap() { return internalGetHeaders().getMap(); } + /** * * @@ -7245,14 +7520,17 @@ public java.util.Map getHeadersMap() { * map<string, string> headers = 3; */ @java.lang.Override - public java.lang.String getHeadersOrDefault( - java.lang.String key, java.lang.String defaultValue) { + public /* nullable */ java.lang.String getHeadersOrDefault( + java.lang.String key, + /* nullable */ + java.lang.String defaultValue) { if (key == null) { throw new NullPointerException("map key"); } java.util.Map map = internalGetHeaders().getMap(); return map.containsKey(key) ? map.get(key) : defaultValue; } + /** * * @@ -7277,9 +7555,11 @@ public java.lang.String getHeadersOrThrow(java.lang.String key) { } public Builder clearHeaders() { + bitField0_ = (bitField0_ & ~0x00000004); internalGetMutableHeaders().getMutableMap().clear(); return this; } + /** * * @@ -7298,11 +7578,14 @@ public Builder removeHeaders(java.lang.String key) { internalGetMutableHeaders().getMutableMap().remove(key); return this; } + /** Use alternate mutation accessors instead. */ @java.lang.Deprecated public java.util.Map getMutableHeaders() { + bitField0_ |= 0x00000004; return internalGetMutableHeaders().getMutableMap(); } + /** * * @@ -7321,10 +7604,11 @@ public Builder putHeaders(java.lang.String key, java.lang.String value) { if (value == null) { throw new NullPointerException("map value"); } - internalGetMutableHeaders().getMutableMap().put(key, value); + bitField0_ |= 0x00000004; return this; } + /** * * @@ -7338,15 +7622,17 @@ public Builder putHeaders(java.lang.String key, java.lang.String value) { */ public Builder putAllHeaders(java.util.Map values) { internalGetMutableHeaders().getMutableMap().putAll(values); + bitField0_ |= 0x00000004; return this; } private java.lang.Object path_ = ""; + /** * * *
        -       * The HTTP URL path.
        +       * The HTTP URL path, excluding the query parameters.
                * 
        * * string path = 4; @@ -7364,11 +7650,12 @@ public java.lang.String getPath() { return (java.lang.String) ref; } } + /** * * *
        -       * The HTTP URL path.
        +       * The HTTP URL path, excluding the query parameters.
                * 
        * * string path = 4; @@ -7386,11 +7673,12 @@ public com.google.protobuf.ByteString getPathBytes() { return (com.google.protobuf.ByteString) ref; } } + /** * * *
        -       * The HTTP URL path.
        +       * The HTTP URL path, excluding the query parameters.
                * 
        * * string path = 4; @@ -7402,16 +7690,17 @@ public Builder setPath(java.lang.String value) { if (value == null) { throw new NullPointerException(); } - path_ = value; + bitField0_ |= 0x00000008; onChanged(); return this; } + /** * * *
        -       * The HTTP URL path.
        +       * The HTTP URL path, excluding the query parameters.
                * 
        * * string path = 4; @@ -7419,16 +7708,17 @@ public Builder setPath(java.lang.String value) { * @return This builder for chaining. */ public Builder clearPath() { - path_ = getDefaultInstance().getPath(); + bitField0_ = (bitField0_ & ~0x00000008); onChanged(); return this; } + /** * * *
        -       * The HTTP URL path.
        +       * The HTTP URL path, excluding the query parameters.
                * 
        * * string path = 4; @@ -7441,13 +7731,14 @@ public Builder setPathBytes(com.google.protobuf.ByteString value) { throw new NullPointerException(); } checkByteStringIsUtf8(value); - path_ = value; + bitField0_ |= 0x00000008; onChanged(); return this; } private java.lang.Object host_ = ""; + /** * * @@ -7470,6 +7761,7 @@ public java.lang.String getHost() { return (java.lang.String) ref; } } + /** * * @@ -7492,6 +7784,7 @@ public com.google.protobuf.ByteString getHostBytes() { return (com.google.protobuf.ByteString) ref; } } + /** * * @@ -7508,11 +7801,12 @@ public Builder setHost(java.lang.String value) { if (value == null) { throw new NullPointerException(); } - host_ = value; + bitField0_ |= 0x00000010; onChanged(); return this; } + /** * * @@ -7525,11 +7819,12 @@ public Builder setHost(java.lang.String value) { * @return This builder for chaining. */ public Builder clearHost() { - host_ = getDefaultInstance().getHost(); + bitField0_ = (bitField0_ & ~0x00000010); onChanged(); return this; } + /** * * @@ -7547,13 +7842,14 @@ public Builder setHostBytes(com.google.protobuf.ByteString value) { throw new NullPointerException(); } checkByteStringIsUtf8(value); - host_ = value; + bitField0_ |= 0x00000010; onChanged(); return this; } private java.lang.Object scheme_ = ""; + /** * * @@ -7576,6 +7872,7 @@ public java.lang.String getScheme() { return (java.lang.String) ref; } } + /** * * @@ -7598,6 +7895,7 @@ public com.google.protobuf.ByteString getSchemeBytes() { return (com.google.protobuf.ByteString) ref; } } + /** * * @@ -7614,11 +7912,12 @@ public Builder setScheme(java.lang.String value) { if (value == null) { throw new NullPointerException(); } - scheme_ = value; + bitField0_ |= 0x00000020; onChanged(); return this; } + /** * * @@ -7631,11 +7930,12 @@ public Builder setScheme(java.lang.String value) { * @return This builder for chaining. */ public Builder clearScheme() { - scheme_ = getDefaultInstance().getScheme(); + bitField0_ = (bitField0_ & ~0x00000020); onChanged(); return this; } + /** * * @@ -7653,13 +7953,14 @@ public Builder setSchemeBytes(com.google.protobuf.ByteString value) { throw new NullPointerException(); } checkByteStringIsUtf8(value); - scheme_ = value; + bitField0_ |= 0x00000020; onChanged(); return this; } private java.lang.Object query_ = ""; + /** * * @@ -7683,6 +7984,7 @@ public java.lang.String getQuery() { return (java.lang.String) ref; } } + /** * * @@ -7706,6 +8008,7 @@ public com.google.protobuf.ByteString getQueryBytes() { return (com.google.protobuf.ByteString) ref; } } + /** * * @@ -7723,11 +8026,12 @@ public Builder setQuery(java.lang.String value) { if (value == null) { throw new NullPointerException(); } - query_ = value; + bitField0_ |= 0x00000040; onChanged(); return this; } + /** * * @@ -7741,11 +8045,12 @@ public Builder setQuery(java.lang.String value) { * @return This builder for chaining. */ public Builder clearQuery() { - query_ = getDefaultInstance().getQuery(); + bitField0_ = (bitField0_ & ~0x00000040); onChanged(); return this; } + /** * * @@ -7764,18 +8069,19 @@ public Builder setQueryBytes(com.google.protobuf.ByteString value) { throw new NullPointerException(); } checkByteStringIsUtf8(value); - query_ = value; + bitField0_ |= 0x00000040; onChanged(); return this; } private com.google.protobuf.Timestamp time_; - private com.google.protobuf.SingleFieldBuilderV3< + private com.google.protobuf.SingleFieldBuilder< com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder> timeBuilder_; + /** * * @@ -7789,8 +8095,9 @@ public Builder setQueryBytes(com.google.protobuf.ByteString value) { * @return Whether the time field is set. */ public boolean hasTime() { - return timeBuilder_ != null || time_ != null; + return ((bitField0_ & 0x00000080) != 0); } + /** * * @@ -7810,6 +8117,7 @@ public com.google.protobuf.Timestamp getTime() { return timeBuilder_.getMessage(); } } + /** * * @@ -7826,13 +8134,14 @@ public Builder setTime(com.google.protobuf.Timestamp value) { throw new NullPointerException(); } time_ = value; - onChanged(); } else { timeBuilder_.setMessage(value); } - + bitField0_ |= 0x00000080; + onChanged(); return this; } + /** * * @@ -7846,13 +8155,14 @@ public Builder setTime(com.google.protobuf.Timestamp value) { public Builder setTime(com.google.protobuf.Timestamp.Builder builderForValue) { if (timeBuilder_ == null) { time_ = builderForValue.build(); - onChanged(); } else { timeBuilder_.setMessage(builderForValue.build()); } - + bitField0_ |= 0x00000080; + onChanged(); return this; } + /** * * @@ -7865,18 +8175,23 @@ public Builder setTime(com.google.protobuf.Timestamp.Builder builderForValue) { */ public Builder mergeTime(com.google.protobuf.Timestamp value) { if (timeBuilder_ == null) { - if (time_ != null) { - time_ = com.google.protobuf.Timestamp.newBuilder(time_).mergeFrom(value).buildPartial(); + if (((bitField0_ & 0x00000080) != 0) + && time_ != null + && time_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getTimeBuilder().mergeFrom(value); } else { time_ = value; } - onChanged(); } else { timeBuilder_.mergeFrom(value); } - + if (time_ != null) { + bitField0_ |= 0x00000080; + onChanged(); + } return this; } + /** * * @@ -7888,16 +8203,16 @@ public Builder mergeTime(com.google.protobuf.Timestamp value) { * .google.protobuf.Timestamp time = 9; */ public Builder clearTime() { - if (timeBuilder_ == null) { - time_ = null; - onChanged(); - } else { - time_ = null; + bitField0_ = (bitField0_ & ~0x00000080); + time_ = null; + if (timeBuilder_ != null) { + timeBuilder_.dispose(); timeBuilder_ = null; } - + onChanged(); return this; } + /** * * @@ -7909,10 +8224,11 @@ public Builder clearTime() { * .google.protobuf.Timestamp time = 9; */ public com.google.protobuf.Timestamp.Builder getTimeBuilder() { - + bitField0_ |= 0x00000080; onChanged(); - return getTimeFieldBuilder().getBuilder(); + return internalGetTimeFieldBuilder().getBuilder(); } + /** * * @@ -7930,6 +8246,7 @@ public com.google.protobuf.TimestampOrBuilder getTimeOrBuilder() { return time_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : time_; } } + /** * * @@ -7940,14 +8257,14 @@ public com.google.protobuf.TimestampOrBuilder getTimeOrBuilder() { * * .google.protobuf.Timestamp time = 9; */ - private com.google.protobuf.SingleFieldBuilderV3< + private com.google.protobuf.SingleFieldBuilder< com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder> - getTimeFieldBuilder() { + internalGetTimeFieldBuilder() { if (timeBuilder_ == null) { timeBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< + new com.google.protobuf.SingleFieldBuilder< com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder>( @@ -7958,6 +8275,7 @@ public com.google.protobuf.TimestampOrBuilder getTimeOrBuilder() { } private long size_; + /** * * @@ -7973,6 +8291,7 @@ public com.google.protobuf.TimestampOrBuilder getTimeOrBuilder() { public long getSize() { return size_; } + /** * * @@ -7988,9 +8307,11 @@ public long getSize() { public Builder setSize(long value) { size_ = value; + bitField0_ |= 0x00000100; onChanged(); return this; } + /** * * @@ -8003,13 +8324,14 @@ public Builder setSize(long value) { * @return This builder for chaining. */ public Builder clearSize() { - + bitField0_ = (bitField0_ & ~0x00000100); size_ = 0L; onChanged(); return this; } private java.lang.Object protocol_ = ""; + /** * * @@ -8035,6 +8357,7 @@ public java.lang.String getProtocol() { return (java.lang.String) ref; } } + /** * * @@ -8060,6 +8383,7 @@ public com.google.protobuf.ByteString getProtocolBytes() { return (com.google.protobuf.ByteString) ref; } } + /** * * @@ -8079,11 +8403,12 @@ public Builder setProtocol(java.lang.String value) { if (value == null) { throw new NullPointerException(); } - protocol_ = value; + bitField0_ |= 0x00000200; onChanged(); return this; } + /** * * @@ -8099,11 +8424,12 @@ public Builder setProtocol(java.lang.String value) { * @return This builder for chaining. */ public Builder clearProtocol() { - protocol_ = getDefaultInstance().getProtocol(); + bitField0_ = (bitField0_ & ~0x00000200); onChanged(); return this; } + /** * * @@ -8124,13 +8450,14 @@ public Builder setProtocolBytes(com.google.protobuf.ByteString value) { throw new NullPointerException(); } checkByteStringIsUtf8(value); - protocol_ = value; + bitField0_ |= 0x00000200; onChanged(); return this; } private java.lang.Object reason_ = ""; + /** * * @@ -8154,6 +8481,7 @@ public java.lang.String getReason() { return (java.lang.String) ref; } } + /** * * @@ -8177,6 +8505,7 @@ public com.google.protobuf.ByteString getReasonBytes() { return (com.google.protobuf.ByteString) ref; } } + /** * * @@ -8194,11 +8523,12 @@ public Builder setReason(java.lang.String value) { if (value == null) { throw new NullPointerException(); } - reason_ = value; + bitField0_ |= 0x00000400; onChanged(); return this; } + /** * * @@ -8212,11 +8542,12 @@ public Builder setReason(java.lang.String value) { * @return This builder for chaining. */ public Builder clearReason() { - reason_ = getDefaultInstance().getReason(); + bitField0_ = (bitField0_ & ~0x00000400); onChanged(); return this; } + /** * * @@ -8235,18 +8566,19 @@ public Builder setReasonBytes(com.google.protobuf.ByteString value) { throw new NullPointerException(); } checkByteStringIsUtf8(value); - reason_ = value; + bitField0_ |= 0x00000400; onChanged(); return this; } private com.google.rpc.context.AttributeContext.Auth auth_; - private com.google.protobuf.SingleFieldBuilderV3< + private com.google.protobuf.SingleFieldBuilder< com.google.rpc.context.AttributeContext.Auth, com.google.rpc.context.AttributeContext.Auth.Builder, com.google.rpc.context.AttributeContext.AuthOrBuilder> authBuilder_; + /** * * @@ -8260,8 +8592,9 @@ public Builder setReasonBytes(com.google.protobuf.ByteString value) { * @return Whether the auth field is set. */ public boolean hasAuth() { - return authBuilder_ != null || auth_ != null; + return ((bitField0_ & 0x00000800) != 0); } + /** * * @@ -8283,6 +8616,7 @@ public com.google.rpc.context.AttributeContext.Auth getAuth() { return authBuilder_.getMessage(); } } + /** * * @@ -8299,13 +8633,14 @@ public Builder setAuth(com.google.rpc.context.AttributeContext.Auth value) { throw new NullPointerException(); } auth_ = value; - onChanged(); } else { authBuilder_.setMessage(value); } - + bitField0_ |= 0x00000800; + onChanged(); return this; } + /** * * @@ -8319,13 +8654,14 @@ public Builder setAuth(com.google.rpc.context.AttributeContext.Auth value) { public Builder setAuth(com.google.rpc.context.AttributeContext.Auth.Builder builderForValue) { if (authBuilder_ == null) { auth_ = builderForValue.build(); - onChanged(); } else { authBuilder_.setMessage(builderForValue.build()); } - + bitField0_ |= 0x00000800; + onChanged(); return this; } + /** * * @@ -8338,21 +8674,23 @@ public Builder setAuth(com.google.rpc.context.AttributeContext.Auth.Builder buil */ public Builder mergeAuth(com.google.rpc.context.AttributeContext.Auth value) { if (authBuilder_ == null) { - if (auth_ != null) { - auth_ = - com.google.rpc.context.AttributeContext.Auth.newBuilder(auth_) - .mergeFrom(value) - .buildPartial(); + if (((bitField0_ & 0x00000800) != 0) + && auth_ != null + && auth_ != com.google.rpc.context.AttributeContext.Auth.getDefaultInstance()) { + getAuthBuilder().mergeFrom(value); } else { auth_ = value; } - onChanged(); } else { authBuilder_.mergeFrom(value); } - + if (auth_ != null) { + bitField0_ |= 0x00000800; + onChanged(); + } return this; } + /** * * @@ -8364,16 +8702,16 @@ public Builder mergeAuth(com.google.rpc.context.AttributeContext.Auth value) { * .google.rpc.context.AttributeContext.Auth auth = 13; */ public Builder clearAuth() { - if (authBuilder_ == null) { - auth_ = null; - onChanged(); - } else { - auth_ = null; + bitField0_ = (bitField0_ & ~0x00000800); + auth_ = null; + if (authBuilder_ != null) { + authBuilder_.dispose(); authBuilder_ = null; } - + onChanged(); return this; } + /** * * @@ -8385,10 +8723,11 @@ public Builder clearAuth() { * .google.rpc.context.AttributeContext.Auth auth = 13; */ public com.google.rpc.context.AttributeContext.Auth.Builder getAuthBuilder() { - + bitField0_ |= 0x00000800; onChanged(); - return getAuthFieldBuilder().getBuilder(); + return internalGetAuthFieldBuilder().getBuilder(); } + /** * * @@ -8408,6 +8747,7 @@ public com.google.rpc.context.AttributeContext.AuthOrBuilder getAuthOrBuilder() : auth_; } } + /** * * @@ -8418,14 +8758,14 @@ public com.google.rpc.context.AttributeContext.AuthOrBuilder getAuthOrBuilder() * * .google.rpc.context.AttributeContext.Auth auth = 13; */ - private com.google.protobuf.SingleFieldBuilderV3< + private com.google.protobuf.SingleFieldBuilder< com.google.rpc.context.AttributeContext.Auth, com.google.rpc.context.AttributeContext.Auth.Builder, com.google.rpc.context.AttributeContext.AuthOrBuilder> - getAuthFieldBuilder() { + internalGetAuthFieldBuilder() { if (authBuilder_ == null) { authBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< + new com.google.protobuf.SingleFieldBuilder< com.google.rpc.context.AttributeContext.Auth, com.google.rpc.context.AttributeContext.Auth.Builder, com.google.rpc.context.AttributeContext.AuthOrBuilder>( @@ -8435,18 +8775,6 @@ public com.google.rpc.context.AttributeContext.AuthOrBuilder getAuthOrBuilder() return authBuilder_; } - @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.rpc.context.AttributeContext.Request) } @@ -8542,6 +8870,7 @@ public interface ResponseOrBuilder * map<string, string> headers = 3; */ int getHeadersCount(); + /** * * @@ -8554,9 +8883,11 @@ public interface ResponseOrBuilder * map<string, string> headers = 3; */ boolean containsHeaders(java.lang.String key); + /** Use {@link #getHeadersMap()} instead. */ @java.lang.Deprecated java.util.Map getHeaders(); + /** * * @@ -8569,6 +8900,7 @@ public interface ResponseOrBuilder * map<string, string> headers = 3; */ java.util.Map getHeadersMap(); + /** * * @@ -8580,12 +8912,12 @@ public interface ResponseOrBuilder * * map<string, string> headers = 3; */ - /* nullable */ java.lang.String getHeadersOrDefault( java.lang.String key, /* nullable */ java.lang.String defaultValue); + /** * * @@ -8612,6 +8944,7 @@ java.lang.String getHeadersOrDefault( * @return Whether the time field is set. */ boolean hasTime(); + /** * * @@ -8625,6 +8958,7 @@ java.lang.String getHeadersOrDefault( * @return The time. */ com.google.protobuf.Timestamp getTime(); + /** * * @@ -8641,7 +8975,7 @@ java.lang.String getHeadersOrDefault( * * *
        -     * The length of time it takes the backend service to fully respond to a
        +     * The amount of time it takes the backend service to fully respond to a
              * request. Measured from when the destination service starts to send the
              * request to the backend until when the destination service receives the
              * complete response from the backend.
        @@ -8652,11 +8986,12 @@ java.lang.String getHeadersOrDefault(
              * @return Whether the backendLatency field is set.
              */
             boolean hasBackendLatency();
        +
             /**
              *
              *
              * 
        -     * The length of time it takes the backend service to fully respond to a
        +     * The amount of time it takes the backend service to fully respond to a
              * request. Measured from when the destination service starts to send the
              * request to the backend until when the destination service receives the
              * complete response from the backend.
        @@ -8667,11 +9002,12 @@ java.lang.String getHeadersOrDefault(
              * @return The backendLatency.
              */
             com.google.protobuf.Duration getBackendLatency();
        +
             /**
              *
              *
              * 
        -     * The length of time it takes the backend service to fully respond to a
        +     * The amount of time it takes the backend service to fully respond to a
              * request. Measured from when the destination service starts to send the
              * request to the backend until when the destination service receives the
              * complete response from the backend.
        @@ -8681,6 +9017,7 @@ java.lang.String getHeadersOrDefault(
              */
             com.google.protobuf.DurationOrBuilder getBackendLatencyOrBuilder();
           }
        +
           /**
            *
            *
        @@ -8691,29 +9028,29 @@ java.lang.String getHeadersOrDefault(
            *
            * Protobuf type {@code google.rpc.context.AttributeContext.Response}
            */
        -  public static final class Response extends com.google.protobuf.GeneratedMessageV3
        +  public static final class Response extends com.google.protobuf.GeneratedMessage
               implements
               // @@protoc_insertion_point(message_implements:google.rpc.context.AttributeContext.Response)
               ResponseOrBuilder {
             private static final long serialVersionUID = 0L;
        +
        +    static {
        +      com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion(
        +          com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC,
        +          /* major= */ 4,
        +          /* minor= */ 33,
        +          /* patch= */ 2,
        +          /* suffix= */ "",
        +          "Response");
        +    }
        +
             // Use Response.newBuilder() to construct.
        -    private Response(com.google.protobuf.GeneratedMessageV3.Builder builder) {
        +    private Response(com.google.protobuf.GeneratedMessage.Builder builder) {
               super(builder);
             }
         
             private Response() {}
         
        -    @java.lang.Override
        -    @SuppressWarnings({"unused"})
        -    protected java.lang.Object newInstance(UnusedPrivateParameter unused) {
        -      return new Response();
        -    }
        -
        -    @java.lang.Override
        -    public final com.google.protobuf.UnknownFieldSet getUnknownFields() {
        -      return this.unknownFields;
        -    }
        -
             public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
               return com.google.rpc.context.AttributeContextProto
                   .internal_static_google_rpc_context_AttributeContext_Response_descriptor;
        @@ -8721,7 +9058,8 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
         
             @SuppressWarnings({"rawtypes"})
             @java.lang.Override
        -    protected com.google.protobuf.MapField internalGetMapField(int number) {
        +    protected com.google.protobuf.MapFieldReflectionAccessor internalGetMapFieldReflection(
        +        int number) {
               switch (number) {
                 case 3:
                   return internalGetHeaders();
        @@ -8731,7 +9069,7 @@ protected com.google.protobuf.MapField internalGetMapField(int number) {
             }
         
             @java.lang.Override
        -    protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
        +    protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
                 internalGetFieldAccessorTable() {
               return com.google.rpc.context.AttributeContextProto
                   .internal_static_google_rpc_context_AttributeContext_Response_fieldAccessorTable
        @@ -8740,8 +9078,10 @@ protected com.google.protobuf.MapField internalGetMapField(int number) {
                       com.google.rpc.context.AttributeContext.Response.Builder.class);
             }
         
        +    private int bitField0_;
             public static final int CODE_FIELD_NUMBER = 1;
        -    private long code_;
        +    private long code_ = 0L;
        +
             /**
              *
              *
        @@ -8759,7 +9099,8 @@ public long getCode() {
             }
         
             public static final int SIZE_FIELD_NUMBER = 2;
        -    private long size_;
        +    private long size_ = 0L;
        +
             /**
              *
              *
        @@ -8789,6 +9130,7 @@ private static final class HeadersDefaultEntryHolder {
                       "");
             }
         
        +    @SuppressWarnings("serial")
             private com.google.protobuf.MapField headers_;
         
             private com.google.protobuf.MapField internalGetHeaders() {
        @@ -8801,6 +9143,7 @@ private com.google.protobuf.MapField interna
             public int getHeadersCount() {
               return internalGetHeaders().getMap().size();
             }
        +
             /**
              *
              *
        @@ -8819,12 +9162,14 @@ public boolean containsHeaders(java.lang.String key) {
               }
               return internalGetHeaders().getMap().containsKey(key);
             }
        +
             /** Use {@link #getHeadersMap()} instead. */
             @java.lang.Override
             @java.lang.Deprecated
             public java.util.Map getHeaders() {
               return getHeadersMap();
             }
        +
             /**
              *
              *
        @@ -8840,6 +9185,7 @@ public java.util.Map getHeaders() {
             public java.util.Map getHeadersMap() {
               return internalGetHeaders().getMap();
             }
        +
             /**
              *
              *
        @@ -8852,14 +9198,17 @@ public java.util.Map getHeadersMap() {
              * map<string, string> headers = 3;
              */
             @java.lang.Override
        -    public java.lang.String getHeadersOrDefault(
        -        java.lang.String key, java.lang.String defaultValue) {
        +    public /* nullable */ java.lang.String getHeadersOrDefault(
        +        java.lang.String key,
        +        /* nullable */
        +        java.lang.String defaultValue) {
               if (key == null) {
                 throw new NullPointerException("map key");
               }
               java.util.Map map = internalGetHeaders().getMap();
               return map.containsKey(key) ? map.get(key) : defaultValue;
             }
        +
             /**
              *
              *
        @@ -8885,6 +9234,7 @@ public java.lang.String getHeadersOrThrow(java.lang.String key) {
         
             public static final int TIME_FIELD_NUMBER = 4;
             private com.google.protobuf.Timestamp time_;
        +
             /**
              *
              *
        @@ -8899,8 +9249,9 @@ public java.lang.String getHeadersOrThrow(java.lang.String key) {
              */
             @java.lang.Override
             public boolean hasTime() {
        -      return time_ != null;
        +      return ((bitField0_ & 0x00000001) != 0);
             }
        +
             /**
              *
              *
        @@ -8917,6 +9268,7 @@ public boolean hasTime() {
             public com.google.protobuf.Timestamp getTime() {
               return time_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : time_;
             }
        +
             /**
              *
              *
        @@ -8929,16 +9281,17 @@ public com.google.protobuf.Timestamp getTime() {
              */
             @java.lang.Override
             public com.google.protobuf.TimestampOrBuilder getTimeOrBuilder() {
        -      return getTime();
        +      return time_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : time_;
             }
         
             public static final int BACKEND_LATENCY_FIELD_NUMBER = 5;
             private com.google.protobuf.Duration backendLatency_;
        +
             /**
              *
              *
              * 
        -     * The length of time it takes the backend service to fully respond to a
        +     * The amount of time it takes the backend service to fully respond to a
              * request. Measured from when the destination service starts to send the
              * request to the backend until when the destination service receives the
              * complete response from the backend.
        @@ -8950,13 +9303,14 @@ public com.google.protobuf.TimestampOrBuilder getTimeOrBuilder() {
              */
             @java.lang.Override
             public boolean hasBackendLatency() {
        -      return backendLatency_ != null;
        +      return ((bitField0_ & 0x00000002) != 0);
             }
        +
             /**
              *
              *
              * 
        -     * The length of time it takes the backend service to fully respond to a
        +     * The amount of time it takes the backend service to fully respond to a
              * request. Measured from when the destination service starts to send the
              * request to the backend until when the destination service receives the
              * complete response from the backend.
        @@ -8972,11 +9326,12 @@ public com.google.protobuf.Duration getBackendLatency() {
                   ? com.google.protobuf.Duration.getDefaultInstance()
                   : backendLatency_;
             }
        +
             /**
              *
              *
              * 
        -     * The length of time it takes the backend service to fully respond to a
        +     * The amount of time it takes the backend service to fully respond to a
              * request. Measured from when the destination service starts to send the
              * request to the backend until when the destination service receives the
              * complete response from the backend.
        @@ -8986,7 +9341,9 @@ public com.google.protobuf.Duration getBackendLatency() {
              */
             @java.lang.Override
             public com.google.protobuf.DurationOrBuilder getBackendLatencyOrBuilder() {
        -      return getBackendLatency();
        +      return backendLatency_ == null
        +          ? com.google.protobuf.Duration.getDefaultInstance()
        +          : backendLatency_;
             }
         
             private byte memoizedIsInitialized = -1;
        @@ -9009,12 +9366,12 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io
               if (size_ != 0L) {
                 output.writeInt64(2, size_);
               }
        -      com.google.protobuf.GeneratedMessageV3.serializeStringMapTo(
        +      com.google.protobuf.GeneratedMessage.serializeStringMapTo(
                   output, internalGetHeaders(), HeadersDefaultEntryHolder.defaultEntry, 3);
        -      if (time_ != null) {
        +      if (((bitField0_ & 0x00000001) != 0)) {
                 output.writeMessage(4, getTime());
               }
        -      if (backendLatency_ != null) {
        +      if (((bitField0_ & 0x00000002) != 0)) {
                 output.writeMessage(5, getBackendLatency());
               }
               getUnknownFields().writeTo(output);
        @@ -9042,10 +9399,10 @@ public int getSerializedSize() {
                         .build();
                 size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, headers__);
               }
        -      if (time_ != null) {
        +      if (((bitField0_ & 0x00000001) != 0)) {
                 size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, getTime());
               }
        -      if (backendLatency_ != null) {
        +      if (((bitField0_ & 0x00000002) != 0)) {
                 size += com.google.protobuf.CodedOutputStream.computeMessageSize(5, getBackendLatency());
               }
               size += getUnknownFields().getSerializedSize();
        @@ -9144,38 +9501,38 @@ public static com.google.rpc.context.AttributeContext.Response parseFrom(
         
             public static com.google.rpc.context.AttributeContext.Response parseFrom(
                 java.io.InputStream input) throws java.io.IOException {
        -      return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
        +      return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input);
             }
         
             public static com.google.rpc.context.AttributeContext.Response parseFrom(
                 java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
                 throws java.io.IOException {
        -      return com.google.protobuf.GeneratedMessageV3.parseWithIOException(
        +      return com.google.protobuf.GeneratedMessage.parseWithIOException(
                   PARSER, input, extensionRegistry);
             }
         
             public static com.google.rpc.context.AttributeContext.Response parseDelimitedFrom(
                 java.io.InputStream input) throws java.io.IOException {
        -      return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input);
        +      return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input);
             }
         
             public static com.google.rpc.context.AttributeContext.Response parseDelimitedFrom(
                 java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
                 throws java.io.IOException {
        -      return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(
        +      return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(
                   PARSER, input, extensionRegistry);
             }
         
             public static com.google.rpc.context.AttributeContext.Response parseFrom(
                 com.google.protobuf.CodedInputStream input) throws java.io.IOException {
        -      return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
        +      return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input);
             }
         
             public static com.google.rpc.context.AttributeContext.Response parseFrom(
                 com.google.protobuf.CodedInputStream input,
                 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
                 throws java.io.IOException {
        -      return com.google.protobuf.GeneratedMessageV3.parseWithIOException(
        +      return com.google.protobuf.GeneratedMessage.parseWithIOException(
                   PARSER, input, extensionRegistry);
             }
         
        @@ -9198,11 +9555,11 @@ public Builder toBuilder() {
             }
         
             @java.lang.Override
        -    protected Builder newBuilderForType(
        -        com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
        +    protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) {
               Builder builder = new Builder(parent);
               return builder;
             }
        +
             /**
              *
              *
        @@ -9213,8 +9570,7 @@ protected Builder newBuilderForType(
              *
              * Protobuf type {@code google.rpc.context.AttributeContext.Response}
              */
        -    public static final class Builder
        -        extends com.google.protobuf.GeneratedMessageV3.Builder
        +    public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder
                 implements
                 // @@protoc_insertion_point(builder_implements:google.rpc.context.AttributeContext.Response)
                 com.google.rpc.context.AttributeContext.ResponseOrBuilder {
        @@ -9224,7 +9580,8 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
               }
         
               @SuppressWarnings({"rawtypes"})
        -      protected com.google.protobuf.MapField internalGetMapField(int number) {
        +      protected com.google.protobuf.MapFieldReflectionAccessor internalGetMapFieldReflection(
        +          int number) {
                 switch (number) {
                   case 3:
                     return internalGetHeaders();
        @@ -9234,7 +9591,8 @@ protected com.google.protobuf.MapField internalGetMapField(int number) {
               }
         
               @SuppressWarnings({"rawtypes"})
        -      protected com.google.protobuf.MapField internalGetMutableMapField(int number) {
        +      protected com.google.protobuf.MapFieldReflectionAccessor internalGetMutableMapFieldReflection(
        +          int number) {
                 switch (number) {
                   case 3:
                     return internalGetMutableHeaders();
        @@ -9244,7 +9602,7 @@ protected com.google.protobuf.MapField internalGetMutableMapField(int number) {
               }
         
               @java.lang.Override
        -      protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
        +      protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
                   internalGetFieldAccessorTable() {
                 return com.google.rpc.context.AttributeContextProto
                     .internal_static_google_rpc_context_AttributeContext_Response_fieldAccessorTable
        @@ -9254,30 +9612,37 @@ protected com.google.protobuf.MapField internalGetMutableMapField(int number) {
               }
         
               // Construct using com.google.rpc.context.AttributeContext.Response.newBuilder()
        -      private Builder() {}
        +      private Builder() {
        +        maybeForceBuilderInitialization();
        +      }
         
        -      private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
        +      private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) {
                 super(parent);
        +        maybeForceBuilderInitialization();
        +      }
        +
        +      private void maybeForceBuilderInitialization() {
        +        if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) {
        +          internalGetTimeFieldBuilder();
        +          internalGetBackendLatencyFieldBuilder();
        +        }
               }
         
               @java.lang.Override
               public Builder clear() {
                 super.clear();
        +        bitField0_ = 0;
                 code_ = 0L;
        -
                 size_ = 0L;
        -
                 internalGetMutableHeaders().clear();
        -        if (timeBuilder_ == null) {
        -          time_ = null;
        -        } else {
        -          time_ = null;
        +        time_ = null;
        +        if (timeBuilder_ != null) {
        +          timeBuilder_.dispose();
                   timeBuilder_ = null;
                 }
        -        if (backendLatencyBuilder_ == null) {
        -          backendLatency_ = null;
        -        } else {
        -          backendLatency_ = null;
        +        backendLatency_ = null;
        +        if (backendLatencyBuilder_ != null) {
        +          backendLatencyBuilder_.dispose();
                   backendLatencyBuilder_ = null;
                 }
                 return this;
        @@ -9307,58 +9672,36 @@ public com.google.rpc.context.AttributeContext.Response build() {
               public com.google.rpc.context.AttributeContext.Response buildPartial() {
                 com.google.rpc.context.AttributeContext.Response result =
                     new com.google.rpc.context.AttributeContext.Response(this);
        -        int from_bitField0_ = bitField0_;
        -        result.code_ = code_;
        -        result.size_ = size_;
        -        result.headers_ = internalGetHeaders();
        -        result.headers_.makeImmutable();
        -        if (timeBuilder_ == null) {
        -          result.time_ = time_;
        -        } else {
        -          result.time_ = timeBuilder_.build();
        -        }
        -        if (backendLatencyBuilder_ == null) {
        -          result.backendLatency_ = backendLatency_;
        -        } else {
        -          result.backendLatency_ = backendLatencyBuilder_.build();
        +        if (bitField0_ != 0) {
        +          buildPartial0(result);
                 }
                 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);
        +      private void buildPartial0(com.google.rpc.context.AttributeContext.Response result) {
        +        int from_bitField0_ = bitField0_;
        +        if (((from_bitField0_ & 0x00000001) != 0)) {
        +          result.code_ = code_;
        +        }
        +        if (((from_bitField0_ & 0x00000002) != 0)) {
        +          result.size_ = size_;
        +        }
        +        if (((from_bitField0_ & 0x00000004) != 0)) {
        +          result.headers_ = internalGetHeaders();
        +          result.headers_.makeImmutable();
        +        }
        +        int to_bitField0_ = 0;
        +        if (((from_bitField0_ & 0x00000008) != 0)) {
        +          result.time_ = timeBuilder_ == null ? time_ : timeBuilder_.build();
        +          to_bitField0_ |= 0x00000001;
        +        }
        +        if (((from_bitField0_ & 0x00000010) != 0)) {
        +          result.backendLatency_ =
        +              backendLatencyBuilder_ == null ? backendLatency_ : backendLatencyBuilder_.build();
        +          to_bitField0_ |= 0x00000002;
        +        }
        +        result.bitField0_ |= to_bitField0_;
               }
         
               @java.lang.Override
        @@ -9381,6 +9724,7 @@ public Builder mergeFrom(com.google.rpc.context.AttributeContext.Response other)
                   setSize(other.getSize());
                 }
                 internalGetMutableHeaders().mergeFrom(other.internalGetHeaders());
        +        bitField0_ |= 0x00000004;
                 if (other.hasTime()) {
                   mergeTime(other.getTime());
                 }
        @@ -9416,13 +9760,13 @@ public Builder mergeFrom(
                       case 8:
                         {
                           code_ = input.readInt64();
        -
        +                  bitField0_ |= 0x00000001;
                           break;
                         } // case 8
                       case 16:
                         {
                           size_ = input.readInt64();
        -
        +                  bitField0_ |= 0x00000002;
                           break;
                         } // case 16
                       case 26:
        @@ -9434,19 +9778,20 @@ public Builder mergeFrom(
                           internalGetMutableHeaders()
                               .getMutableMap()
                               .put(headers__.getKey(), headers__.getValue());
        +                  bitField0_ |= 0x00000004;
                           break;
                         } // case 26
                       case 34:
                         {
        -                  input.readMessage(getTimeFieldBuilder().getBuilder(), extensionRegistry);
        -
        +                  input.readMessage(internalGetTimeFieldBuilder().getBuilder(), extensionRegistry);
        +                  bitField0_ |= 0x00000008;
                           break;
                         } // case 34
                       case 42:
                         {
                           input.readMessage(
        -                      getBackendLatencyFieldBuilder().getBuilder(), extensionRegistry);
        -
        +                      internalGetBackendLatencyFieldBuilder().getBuilder(), extensionRegistry);
        +                  bitField0_ |= 0x00000010;
                           break;
                         } // case 42
                       default:
        @@ -9469,6 +9814,7 @@ public Builder mergeFrom(
               private int bitField0_;
         
               private long code_;
        +
               /**
                *
                *
        @@ -9484,6 +9830,7 @@ public Builder mergeFrom(
               public long getCode() {
                 return code_;
               }
        +
               /**
                *
                *
        @@ -9499,9 +9846,11 @@ public long getCode() {
               public Builder setCode(long value) {
         
                 code_ = value;
        +        bitField0_ |= 0x00000001;
                 onChanged();
                 return this;
               }
        +
               /**
                *
                *
        @@ -9514,13 +9863,14 @@ public Builder setCode(long value) {
                * @return This builder for chaining.
                */
               public Builder clearCode() {
        -
        +        bitField0_ = (bitField0_ & ~0x00000001);
                 code_ = 0L;
                 onChanged();
                 return this;
               }
         
               private long size_;
        +
               /**
                *
                *
        @@ -9536,6 +9886,7 @@ public Builder clearCode() {
               public long getSize() {
                 return size_;
               }
        +
               /**
                *
                *
        @@ -9551,9 +9902,11 @@ public long getSize() {
               public Builder setSize(long value) {
         
                 size_ = value;
        +        bitField0_ |= 0x00000002;
                 onChanged();
                 return this;
               }
        +
               /**
                *
                *
        @@ -9566,7 +9919,7 @@ public Builder setSize(long value) {
                * @return This builder for chaining.
                */
               public Builder clearSize() {
        -
        +        bitField0_ = (bitField0_ & ~0x00000002);
                 size_ = 0L;
                 onChanged();
                 return this;
        @@ -9584,8 +9937,6 @@ public Builder clearSize() {
         
               private com.google.protobuf.MapField
                   internalGetMutableHeaders() {
        -        onChanged();
        -        ;
                 if (headers_ == null) {
                   headers_ =
                       com.google.protobuf.MapField.newMapField(HeadersDefaultEntryHolder.defaultEntry);
        @@ -9593,12 +9944,15 @@ public Builder clearSize() {
                 if (!headers_.isMutable()) {
                   headers_ = headers_.copy();
                 }
        +        bitField0_ |= 0x00000004;
        +        onChanged();
                 return headers_;
               }
         
               public int getHeadersCount() {
                 return internalGetHeaders().getMap().size();
               }
        +
               /**
                *
                *
        @@ -9617,12 +9971,14 @@ public boolean containsHeaders(java.lang.String key) {
                 }
                 return internalGetHeaders().getMap().containsKey(key);
               }
        +
               /** Use {@link #getHeadersMap()} instead. */
               @java.lang.Override
               @java.lang.Deprecated
               public java.util.Map getHeaders() {
                 return getHeadersMap();
               }
        +
               /**
                *
                *
        @@ -9638,6 +9994,7 @@ public java.util.Map getHeaders() {
               public java.util.Map getHeadersMap() {
                 return internalGetHeaders().getMap();
               }
        +
               /**
                *
                *
        @@ -9650,14 +10007,17 @@ public java.util.Map getHeadersMap() {
                * map<string, string> headers = 3;
                */
               @java.lang.Override
        -      public java.lang.String getHeadersOrDefault(
        -          java.lang.String key, java.lang.String defaultValue) {
        +      public /* nullable */ java.lang.String getHeadersOrDefault(
        +          java.lang.String key,
        +          /* nullable */
        +          java.lang.String defaultValue) {
                 if (key == null) {
                   throw new NullPointerException("map key");
                 }
                 java.util.Map map = internalGetHeaders().getMap();
                 return map.containsKey(key) ? map.get(key) : defaultValue;
               }
        +
               /**
                *
                *
        @@ -9682,9 +10042,11 @@ public java.lang.String getHeadersOrThrow(java.lang.String key) {
               }
         
               public Builder clearHeaders() {
        +        bitField0_ = (bitField0_ & ~0x00000004);
                 internalGetMutableHeaders().getMutableMap().clear();
                 return this;
               }
        +
               /**
                *
                *
        @@ -9703,11 +10065,14 @@ public Builder removeHeaders(java.lang.String key) {
                 internalGetMutableHeaders().getMutableMap().remove(key);
                 return this;
               }
        +
               /** Use alternate mutation accessors instead. */
               @java.lang.Deprecated
               public java.util.Map getMutableHeaders() {
        +        bitField0_ |= 0x00000004;
                 return internalGetMutableHeaders().getMutableMap();
               }
        +
               /**
                *
                *
        @@ -9726,10 +10091,11 @@ public Builder putHeaders(java.lang.String key, java.lang.String value) {
                 if (value == null) {
                   throw new NullPointerException("map value");
                 }
        -
                 internalGetMutableHeaders().getMutableMap().put(key, value);
        +        bitField0_ |= 0x00000004;
                 return this;
               }
        +
               /**
                *
                *
        @@ -9743,15 +10109,17 @@ public Builder putHeaders(java.lang.String key, java.lang.String value) {
                */
               public Builder putAllHeaders(java.util.Map values) {
                 internalGetMutableHeaders().getMutableMap().putAll(values);
        +        bitField0_ |= 0x00000004;
                 return this;
               }
         
               private com.google.protobuf.Timestamp time_;
        -      private com.google.protobuf.SingleFieldBuilderV3<
        +      private com.google.protobuf.SingleFieldBuilder<
                       com.google.protobuf.Timestamp,
                       com.google.protobuf.Timestamp.Builder,
                       com.google.protobuf.TimestampOrBuilder>
                   timeBuilder_;
        +
               /**
                *
                *
        @@ -9765,8 +10133,9 @@ public Builder putAllHeaders(java.util.Map v
                * @return Whether the time field is set.
                */
               public boolean hasTime() {
        -        return timeBuilder_ != null || time_ != null;
        +        return ((bitField0_ & 0x00000008) != 0);
               }
        +
               /**
                *
                *
        @@ -9786,6 +10155,7 @@ public com.google.protobuf.Timestamp getTime() {
                   return timeBuilder_.getMessage();
                 }
               }
        +
               /**
                *
                *
        @@ -9802,13 +10172,14 @@ public Builder setTime(com.google.protobuf.Timestamp value) {
                     throw new NullPointerException();
                   }
                   time_ = value;
        -          onChanged();
                 } else {
                   timeBuilder_.setMessage(value);
                 }
        -
        +        bitField0_ |= 0x00000008;
        +        onChanged();
                 return this;
               }
        +
               /**
                *
                *
        @@ -9822,13 +10193,14 @@ public Builder setTime(com.google.protobuf.Timestamp value) {
               public Builder setTime(com.google.protobuf.Timestamp.Builder builderForValue) {
                 if (timeBuilder_ == null) {
                   time_ = builderForValue.build();
        -          onChanged();
                 } else {
                   timeBuilder_.setMessage(builderForValue.build());
                 }
        -
        +        bitField0_ |= 0x00000008;
        +        onChanged();
                 return this;
               }
        +
               /**
                *
                *
        @@ -9841,18 +10213,23 @@ public Builder setTime(com.google.protobuf.Timestamp.Builder builderForValue) {
                */
               public Builder mergeTime(com.google.protobuf.Timestamp value) {
                 if (timeBuilder_ == null) {
        -          if (time_ != null) {
        -            time_ = com.google.protobuf.Timestamp.newBuilder(time_).mergeFrom(value).buildPartial();
        +          if (((bitField0_ & 0x00000008) != 0)
        +              && time_ != null
        +              && time_ != com.google.protobuf.Timestamp.getDefaultInstance()) {
        +            getTimeBuilder().mergeFrom(value);
                   } else {
                     time_ = value;
                   }
        -          onChanged();
                 } else {
                   timeBuilder_.mergeFrom(value);
                 }
        -
        +        if (time_ != null) {
        +          bitField0_ |= 0x00000008;
        +          onChanged();
        +        }
                 return this;
               }
        +
               /**
                *
                *
        @@ -9864,16 +10241,16 @@ public Builder mergeTime(com.google.protobuf.Timestamp value) {
                * .google.protobuf.Timestamp time = 4;
                */
               public Builder clearTime() {
        -        if (timeBuilder_ == null) {
        -          time_ = null;
        -          onChanged();
        -        } else {
        -          time_ = null;
        +        bitField0_ = (bitField0_ & ~0x00000008);
        +        time_ = null;
        +        if (timeBuilder_ != null) {
        +          timeBuilder_.dispose();
                   timeBuilder_ = null;
                 }
        -
        +        onChanged();
                 return this;
               }
        +
               /**
                *
                *
        @@ -9885,10 +10262,11 @@ public Builder clearTime() {
                * .google.protobuf.Timestamp time = 4;
                */
               public com.google.protobuf.Timestamp.Builder getTimeBuilder() {
        -
        +        bitField0_ |= 0x00000008;
                 onChanged();
        -        return getTimeFieldBuilder().getBuilder();
        +        return internalGetTimeFieldBuilder().getBuilder();
               }
        +
               /**
                *
                *
        @@ -9906,6 +10284,7 @@ public com.google.protobuf.TimestampOrBuilder getTimeOrBuilder() {
                   return time_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : time_;
                 }
               }
        +
               /**
                *
                *
        @@ -9916,14 +10295,14 @@ public com.google.protobuf.TimestampOrBuilder getTimeOrBuilder() {
                *
                * .google.protobuf.Timestamp time = 4;
                */
        -      private com.google.protobuf.SingleFieldBuilderV3<
        +      private com.google.protobuf.SingleFieldBuilder<
                       com.google.protobuf.Timestamp,
                       com.google.protobuf.Timestamp.Builder,
                       com.google.protobuf.TimestampOrBuilder>
        -          getTimeFieldBuilder() {
        +          internalGetTimeFieldBuilder() {
                 if (timeBuilder_ == null) {
                   timeBuilder_ =
        -              new com.google.protobuf.SingleFieldBuilderV3<
        +              new com.google.protobuf.SingleFieldBuilder<
                           com.google.protobuf.Timestamp,
                           com.google.protobuf.Timestamp.Builder,
                           com.google.protobuf.TimestampOrBuilder>(
        @@ -9934,16 +10313,17 @@ public com.google.protobuf.TimestampOrBuilder getTimeOrBuilder() {
               }
         
               private com.google.protobuf.Duration backendLatency_;
        -      private com.google.protobuf.SingleFieldBuilderV3<
        +      private com.google.protobuf.SingleFieldBuilder<
                       com.google.protobuf.Duration,
                       com.google.protobuf.Duration.Builder,
                       com.google.protobuf.DurationOrBuilder>
                   backendLatencyBuilder_;
        +
               /**
                *
                *
                * 
        -       * The length of time it takes the backend service to fully respond to a
        +       * The amount of time it takes the backend service to fully respond to a
                * request. Measured from when the destination service starts to send the
                * request to the backend until when the destination service receives the
                * complete response from the backend.
        @@ -9954,13 +10334,14 @@ public com.google.protobuf.TimestampOrBuilder getTimeOrBuilder() {
                * @return Whether the backendLatency field is set.
                */
               public boolean hasBackendLatency() {
        -        return backendLatencyBuilder_ != null || backendLatency_ != null;
        +        return ((bitField0_ & 0x00000010) != 0);
               }
        +
               /**
                *
                *
                * 
        -       * The length of time it takes the backend service to fully respond to a
        +       * The amount of time it takes the backend service to fully respond to a
                * request. Measured from when the destination service starts to send the
                * request to the backend until when the destination service receives the
                * complete response from the backend.
        @@ -9979,11 +10360,12 @@ public com.google.protobuf.Duration getBackendLatency() {
                   return backendLatencyBuilder_.getMessage();
                 }
               }
        +
               /**
                *
                *
                * 
        -       * The length of time it takes the backend service to fully respond to a
        +       * The amount of time it takes the backend service to fully respond to a
                * request. Measured from when the destination service starts to send the
                * request to the backend until when the destination service receives the
                * complete response from the backend.
        @@ -9997,18 +10379,19 @@ public Builder setBackendLatency(com.google.protobuf.Duration value) {
                     throw new NullPointerException();
                   }
                   backendLatency_ = value;
        -          onChanged();
                 } else {
                   backendLatencyBuilder_.setMessage(value);
                 }
        -
        +        bitField0_ |= 0x00000010;
        +        onChanged();
                 return this;
               }
        +
               /**
                *
                *
                * 
        -       * The length of time it takes the backend service to fully respond to a
        +       * The amount of time it takes the backend service to fully respond to a
                * request. Measured from when the destination service starts to send the
                * request to the backend until when the destination service receives the
                * complete response from the backend.
        @@ -10019,18 +10402,19 @@ public Builder setBackendLatency(com.google.protobuf.Duration value) {
               public Builder setBackendLatency(com.google.protobuf.Duration.Builder builderForValue) {
                 if (backendLatencyBuilder_ == null) {
                   backendLatency_ = builderForValue.build();
        -          onChanged();
                 } else {
                   backendLatencyBuilder_.setMessage(builderForValue.build());
                 }
        -
        +        bitField0_ |= 0x00000010;
        +        onChanged();
                 return this;
               }
        +
               /**
                *
                *
                * 
        -       * The length of time it takes the backend service to fully respond to a
        +       * The amount of time it takes the backend service to fully respond to a
                * request. Measured from when the destination service starts to send the
                * request to the backend until when the destination service receives the
                * complete response from the backend.
        @@ -10040,26 +10424,28 @@ public Builder setBackendLatency(com.google.protobuf.Duration.Builder builderFor
                */
               public Builder mergeBackendLatency(com.google.protobuf.Duration value) {
                 if (backendLatencyBuilder_ == null) {
        -          if (backendLatency_ != null) {
        -            backendLatency_ =
        -                com.google.protobuf.Duration.newBuilder(backendLatency_)
        -                    .mergeFrom(value)
        -                    .buildPartial();
        +          if (((bitField0_ & 0x00000010) != 0)
        +              && backendLatency_ != null
        +              && backendLatency_ != com.google.protobuf.Duration.getDefaultInstance()) {
        +            getBackendLatencyBuilder().mergeFrom(value);
                   } else {
                     backendLatency_ = value;
                   }
        -          onChanged();
                 } else {
                   backendLatencyBuilder_.mergeFrom(value);
                 }
        -
        +        if (backendLatency_ != null) {
        +          bitField0_ |= 0x00000010;
        +          onChanged();
        +        }
                 return this;
               }
        +
               /**
                *
                *
                * 
        -       * The length of time it takes the backend service to fully respond to a
        +       * The amount of time it takes the backend service to fully respond to a
                * request. Measured from when the destination service starts to send the
                * request to the backend until when the destination service receives the
                * complete response from the backend.
        @@ -10068,21 +10454,21 @@ public Builder mergeBackendLatency(com.google.protobuf.Duration value) {
                * .google.protobuf.Duration backend_latency = 5;
                */
               public Builder clearBackendLatency() {
        -        if (backendLatencyBuilder_ == null) {
        -          backendLatency_ = null;
        -          onChanged();
        -        } else {
        -          backendLatency_ = null;
        +        bitField0_ = (bitField0_ & ~0x00000010);
        +        backendLatency_ = null;
        +        if (backendLatencyBuilder_ != null) {
        +          backendLatencyBuilder_.dispose();
                   backendLatencyBuilder_ = null;
                 }
        -
        +        onChanged();
                 return this;
               }
        +
               /**
                *
                *
                * 
        -       * The length of time it takes the backend service to fully respond to a
        +       * The amount of time it takes the backend service to fully respond to a
                * request. Measured from when the destination service starts to send the
                * request to the backend until when the destination service receives the
                * complete response from the backend.
        @@ -10091,15 +10477,16 @@ public Builder clearBackendLatency() {
                * .google.protobuf.Duration backend_latency = 5;
                */
               public com.google.protobuf.Duration.Builder getBackendLatencyBuilder() {
        -
        +        bitField0_ |= 0x00000010;
                 onChanged();
        -        return getBackendLatencyFieldBuilder().getBuilder();
        +        return internalGetBackendLatencyFieldBuilder().getBuilder();
               }
        +
               /**
                *
                *
                * 
        -       * The length of time it takes the backend service to fully respond to a
        +       * The amount of time it takes the backend service to fully respond to a
                * request. Measured from when the destination service starts to send the
                * request to the backend until when the destination service receives the
                * complete response from the backend.
        @@ -10116,11 +10503,12 @@ public com.google.protobuf.DurationOrBuilder getBackendLatencyOrBuilder() {
                       : backendLatency_;
                 }
               }
        +
               /**
                *
                *
                * 
        -       * The length of time it takes the backend service to fully respond to a
        +       * The amount of time it takes the backend service to fully respond to a
                * request. Measured from when the destination service starts to send the
                * request to the backend until when the destination service receives the
                * complete response from the backend.
        @@ -10128,14 +10516,14 @@ public com.google.protobuf.DurationOrBuilder getBackendLatencyOrBuilder() {
                *
                * .google.protobuf.Duration backend_latency = 5;
                */
        -      private com.google.protobuf.SingleFieldBuilderV3<
        +      private com.google.protobuf.SingleFieldBuilder<
                       com.google.protobuf.Duration,
                       com.google.protobuf.Duration.Builder,
                       com.google.protobuf.DurationOrBuilder>
        -          getBackendLatencyFieldBuilder() {
        +          internalGetBackendLatencyFieldBuilder() {
                 if (backendLatencyBuilder_ == null) {
                   backendLatencyBuilder_ =
        -              new com.google.protobuf.SingleFieldBuilderV3<
        +              new com.google.protobuf.SingleFieldBuilder<
                           com.google.protobuf.Duration,
                           com.google.protobuf.Duration.Builder,
                           com.google.protobuf.DurationOrBuilder>(
        @@ -10145,18 +10533,6 @@ public com.google.protobuf.DurationOrBuilder getBackendLatencyOrBuilder() {
                 return backendLatencyBuilder_;
               }
         
        -      @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.rpc.context.AttributeContext.Response)
             }
         
        @@ -10228,6 +10604,7 @@ public interface ResourceOrBuilder
              * @return The service.
              */
             java.lang.String getService();
        +
             /**
              *
              *
        @@ -10250,12 +10627,14 @@ public interface ResourceOrBuilder
              * The stable identifier (name) of a resource on the `service`. A resource
              * can be logically identified as "//{resource.service}/{resource.name}".
              * The differences between a resource name and a URI are:
        +     *
              * *   Resource name is a logical identifier, independent of network
        -     *     protocol and API version. For example,
        -     *     `//pubsub.googleapis.com/projects/123/topics/news-feed`.
        +     * protocol and API version. For example,
        +     * `//pubsub.googleapis.com/projects/123/topics/news-feed`.
              * *   URI often includes protocol and version information, so it can
        -     *     be used directly by applications. For example,
        -     *     `https://pubsub.googleapis.com/v1/projects/123/topics/news-feed`.
        +     * be used directly by applications. For example,
        +     * `https://pubsub.googleapis.com/v1/projects/123/topics/news-feed`.
        +     *
              * See https://cloud.google.com/apis/design/resource_names for details.
              * 
        * @@ -10264,6 +10643,7 @@ public interface ResourceOrBuilder * @return The name. */ java.lang.String getName(); + /** * * @@ -10271,12 +10651,14 @@ public interface ResourceOrBuilder * The stable identifier (name) of a resource on the `service`. A resource * can be logically identified as "//{resource.service}/{resource.name}". * The differences between a resource name and a URI are: + * * * Resource name is a logical identifier, independent of network - * protocol and API version. For example, - * `//pubsub.googleapis.com/projects/123/topics/news-feed`. + * protocol and API version. For example, + * `//pubsub.googleapis.com/projects/123/topics/news-feed`. * * URI often includes protocol and version information, so it can - * be used directly by applications. For example, - * `https://pubsub.googleapis.com/v1/projects/123/topics/news-feed`. + * be used directly by applications. For example, + * `https://pubsub.googleapis.com/v1/projects/123/topics/news-feed`. + * * See https://cloud.google.com/apis/design/resource_names for details. *
        * @@ -10292,7 +10674,9 @@ public interface ResourceOrBuilder *
              * The type of the resource. The syntax is platform-specific because
              * different platforms define their resources differently.
        -     * For Google APIs, the type format must be "{service}/{kind}".
        +     *
        +     * For Google APIs, the type format must be "{service}/{kind}", such as
        +     * "pubsub.googleapis.com/Topic".
              * 
        * * string type = 3; @@ -10300,13 +10684,16 @@ public interface ResourceOrBuilder * @return The type. */ java.lang.String getType(); + /** * * *
              * The type of the resource. The syntax is platform-specific because
              * different platforms define their resources differently.
        -     * For Google APIs, the type format must be "{service}/{kind}".
        +     *
        +     * For Google APIs, the type format must be "{service}/{kind}", such as
        +     * "pubsub.googleapis.com/Topic".
              * 
        * * string type = 3; @@ -10326,6 +10713,7 @@ public interface ResourceOrBuilder * map<string, string> labels = 4; */ int getLabelsCount(); + /** * * @@ -10337,9 +10725,11 @@ public interface ResourceOrBuilder * map<string, string> labels = 4; */ boolean containsLabels(java.lang.String key); + /** Use {@link #getLabelsMap()} instead. */ @java.lang.Deprecated java.util.Map getLabels(); + /** * * @@ -10351,6 +10741,7 @@ public interface ResourceOrBuilder * map<string, string> labels = 4; */ java.util.Map getLabelsMap(); + /** * * @@ -10361,12 +10752,12 @@ public interface ResourceOrBuilder * * map<string, string> labels = 4; */ - /* nullable */ java.lang.String getLabelsOrDefault( java.lang.String key, /* nullable */ java.lang.String defaultValue); + /** * * @@ -10395,6 +10786,7 @@ java.lang.String getLabelsOrDefault( * @return The uid. */ java.lang.String getUid(); + /** * * @@ -10419,12 +10811,15 @@ java.lang.String getLabelsOrDefault( * Annotations is an unstructured key-value map stored with a resource that * may be set by external tools to store and retrieve arbitrary metadata. * They are not queryable and should be preserved when modifying objects. - * More info: https://kubernetes.io/docs/user-guide/annotations + * + * More info: + * https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/ *
        * * map<string, string> annotations = 6; */ int getAnnotationsCount(); + /** * * @@ -10432,15 +10827,19 @@ java.lang.String getLabelsOrDefault( * Annotations is an unstructured key-value map stored with a resource that * may be set by external tools to store and retrieve arbitrary metadata. * They are not queryable and should be preserved when modifying objects. - * More info: https://kubernetes.io/docs/user-guide/annotations + * + * More info: + * https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/ *
        * * map<string, string> annotations = 6; */ boolean containsAnnotations(java.lang.String key); + /** Use {@link #getAnnotationsMap()} instead. */ @java.lang.Deprecated java.util.Map getAnnotations(); + /** * * @@ -10448,12 +10847,15 @@ java.lang.String getLabelsOrDefault( * Annotations is an unstructured key-value map stored with a resource that * may be set by external tools to store and retrieve arbitrary metadata. * They are not queryable and should be preserved when modifying objects. - * More info: https://kubernetes.io/docs/user-guide/annotations + * + * More info: + * https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/ *
        * * map<string, string> annotations = 6; */ java.util.Map getAnnotationsMap(); + /** * * @@ -10461,17 +10863,19 @@ java.lang.String getLabelsOrDefault( * Annotations is an unstructured key-value map stored with a resource that * may be set by external tools to store and retrieve arbitrary metadata. * They are not queryable and should be preserved when modifying objects. - * More info: https://kubernetes.io/docs/user-guide/annotations + * + * More info: + * https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/ *
        * * map<string, string> annotations = 6; */ - /* nullable */ java.lang.String getAnnotationsOrDefault( java.lang.String key, /* nullable */ java.lang.String defaultValue); + /** * * @@ -10479,7 +10883,9 @@ java.lang.String getAnnotationsOrDefault( * Annotations is an unstructured key-value map stored with a resource that * may be set by external tools to store and retrieve arbitrary metadata. * They are not queryable and should be preserved when modifying objects. - * More info: https://kubernetes.io/docs/user-guide/annotations + * + * More info: + * https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/ *
        * * map<string, string> annotations = 6; @@ -10498,6 +10904,7 @@ java.lang.String getAnnotationsOrDefault( * @return The displayName. */ java.lang.String getDisplayName(); + /** * * @@ -10524,6 +10931,7 @@ java.lang.String getAnnotationsOrDefault( * @return Whether the createTime field is set. */ boolean hasCreateTime(); + /** * * @@ -10537,6 +10945,7 @@ java.lang.String getAnnotationsOrDefault( * @return The createTime. */ com.google.protobuf.Timestamp getCreateTime(); + /** * * @@ -10563,6 +10972,7 @@ java.lang.String getAnnotationsOrDefault( * @return Whether the updateTime field is set. */ boolean hasUpdateTime(); + /** * * @@ -10577,6 +10987,7 @@ java.lang.String getAnnotationsOrDefault( * @return The updateTime. */ com.google.protobuf.Timestamp getUpdateTime(); + /** * * @@ -10603,6 +11014,7 @@ java.lang.String getAnnotationsOrDefault( * @return Whether the deleteTime field is set. */ boolean hasDeleteTime(); + /** * * @@ -10616,6 +11028,7 @@ java.lang.String getAnnotationsOrDefault( * @return The deleteTime. */ com.google.protobuf.Timestamp getDeleteTime(); + /** * * @@ -10642,6 +11055,7 @@ java.lang.String getAnnotationsOrDefault( * @return The etag. */ java.lang.String getEtag(); + /** * * @@ -10664,6 +11078,7 @@ java.lang.String getAnnotationsOrDefault( * Immutable. The location of the resource. The location encoding is * specific to the service provider, and new encoding may be introduced * as the service evolves. + * * For Google Cloud products, the encoding is what is used by Google Cloud * APIs, such as `us-east1`, `aws-us-east-1`, and `azure-eastus2`. The * semantics of `location` is identical to the @@ -10675,6 +11090,7 @@ java.lang.String getAnnotationsOrDefault( * @return The location. */ java.lang.String getLocation(); + /** * * @@ -10682,6 +11098,7 @@ java.lang.String getAnnotationsOrDefault( * Immutable. The location of the resource. The location encoding is * specific to the service provider, and new encoding may be introduced * as the service evolves. + * * For Google Cloud products, the encoding is what is used by Google Cloud * APIs, such as `us-east1`, `aws-us-east-1`, and `azure-eastus2`. The * semantics of `location` is identical to the @@ -10694,6 +11111,7 @@ java.lang.String getAnnotationsOrDefault( */ com.google.protobuf.ByteString getLocationBytes(); } + /** * * @@ -10705,13 +11123,24 @@ java.lang.String getAnnotationsOrDefault( * * Protobuf type {@code google.rpc.context.AttributeContext.Resource} */ - public static final class Resource extends com.google.protobuf.GeneratedMessageV3 + public static final class Resource extends com.google.protobuf.GeneratedMessage implements // @@protoc_insertion_point(message_implements:google.rpc.context.AttributeContext.Resource) ResourceOrBuilder { private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "Resource"); + } + // Use Resource.newBuilder() to construct. - private Resource(com.google.protobuf.GeneratedMessageV3.Builder builder) { + private Resource(com.google.protobuf.GeneratedMessage.Builder builder) { super(builder); } @@ -10725,17 +11154,6 @@ private Resource() { location_ = ""; } - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new Resource(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.rpc.context.AttributeContextProto .internal_static_google_rpc_context_AttributeContext_Resource_descriptor; @@ -10743,7 +11161,8 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { @SuppressWarnings({"rawtypes"}) @java.lang.Override - protected com.google.protobuf.MapField internalGetMapField(int number) { + protected com.google.protobuf.MapFieldReflectionAccessor internalGetMapFieldReflection( + int number) { switch (number) { case 4: return internalGetLabels(); @@ -10755,7 +11174,7 @@ protected com.google.protobuf.MapField internalGetMapField(int number) { } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.rpc.context.AttributeContextProto .internal_static_google_rpc_context_AttributeContext_Resource_fieldAccessorTable @@ -10764,8 +11183,12 @@ protected com.google.protobuf.MapField internalGetMapField(int number) { com.google.rpc.context.AttributeContext.Resource.Builder.class); } + private int bitField0_; public static final int SERVICE_FIELD_NUMBER = 1; - private volatile java.lang.Object service_; + + @SuppressWarnings("serial") + private volatile java.lang.Object service_ = ""; + /** * * @@ -10791,6 +11214,7 @@ public java.lang.String getService() { return s; } } + /** * * @@ -10818,7 +11242,10 @@ public com.google.protobuf.ByteString getServiceBytes() { } public static final int NAME_FIELD_NUMBER = 2; - private volatile java.lang.Object name_; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** * * @@ -10826,12 +11253,14 @@ public com.google.protobuf.ByteString getServiceBytes() { * The stable identifier (name) of a resource on the `service`. A resource * can be logically identified as "//{resource.service}/{resource.name}". * The differences between a resource name and a URI are: + * * * Resource name is a logical identifier, independent of network - * protocol and API version. For example, - * `//pubsub.googleapis.com/projects/123/topics/news-feed`. + * protocol and API version. For example, + * `//pubsub.googleapis.com/projects/123/topics/news-feed`. * * URI often includes protocol and version information, so it can - * be used directly by applications. For example, - * `https://pubsub.googleapis.com/v1/projects/123/topics/news-feed`. + * be used directly by applications. For example, + * `https://pubsub.googleapis.com/v1/projects/123/topics/news-feed`. + * * See https://cloud.google.com/apis/design/resource_names for details. *
        * @@ -10851,6 +11280,7 @@ public java.lang.String getName() { return s; } } + /** * * @@ -10858,12 +11288,14 @@ public java.lang.String getName() { * The stable identifier (name) of a resource on the `service`. A resource * can be logically identified as "//{resource.service}/{resource.name}". * The differences between a resource name and a URI are: + * * * Resource name is a logical identifier, independent of network - * protocol and API version. For example, - * `//pubsub.googleapis.com/projects/123/topics/news-feed`. + * protocol and API version. For example, + * `//pubsub.googleapis.com/projects/123/topics/news-feed`. * * URI often includes protocol and version information, so it can - * be used directly by applications. For example, - * `https://pubsub.googleapis.com/v1/projects/123/topics/news-feed`. + * be used directly by applications. For example, + * `https://pubsub.googleapis.com/v1/projects/123/topics/news-feed`. + * * See https://cloud.google.com/apis/design/resource_names for details. *
        * @@ -10885,14 +11317,19 @@ public com.google.protobuf.ByteString getNameBytes() { } public static final int TYPE_FIELD_NUMBER = 3; - private volatile java.lang.Object type_; + + @SuppressWarnings("serial") + private volatile java.lang.Object type_ = ""; + /** * * *
              * The type of the resource. The syntax is platform-specific because
              * different platforms define their resources differently.
        -     * For Google APIs, the type format must be "{service}/{kind}".
        +     *
        +     * For Google APIs, the type format must be "{service}/{kind}", such as
        +     * "pubsub.googleapis.com/Topic".
              * 
        * * string type = 3; @@ -10911,13 +11348,16 @@ public java.lang.String getType() { return s; } } + /** * * *
              * The type of the resource. The syntax is platform-specific because
              * different platforms define their resources differently.
        -     * For Google APIs, the type format must be "{service}/{kind}".
        +     *
        +     * For Google APIs, the type format must be "{service}/{kind}", such as
        +     * "pubsub.googleapis.com/Topic".
              * 
        * * string type = 3; @@ -10950,6 +11390,7 @@ private static final class LabelsDefaultEntryHolder { ""); } + @SuppressWarnings("serial") private com.google.protobuf.MapField labels_; private com.google.protobuf.MapField internalGetLabels() { @@ -10962,6 +11403,7 @@ private com.google.protobuf.MapField interna public int getLabelsCount() { return internalGetLabels().getMap().size(); } + /** * * @@ -10979,12 +11421,14 @@ public boolean containsLabels(java.lang.String key) { } return internalGetLabels().getMap().containsKey(key); } + /** Use {@link #getLabelsMap()} instead. */ @java.lang.Override @java.lang.Deprecated public java.util.Map getLabels() { return getLabelsMap(); } + /** * * @@ -10999,6 +11443,7 @@ public java.util.Map getLabels() { public java.util.Map getLabelsMap() { return internalGetLabels().getMap(); } + /** * * @@ -11010,14 +11455,17 @@ public java.util.Map getLabelsMap() { * map<string, string> labels = 4; */ @java.lang.Override - public java.lang.String getLabelsOrDefault( - java.lang.String key, java.lang.String defaultValue) { + 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; } + /** * * @@ -11041,7 +11489,10 @@ public java.lang.String getLabelsOrThrow(java.lang.String key) { } public static final int UID_FIELD_NUMBER = 5; - private volatile java.lang.Object uid_; + + @SuppressWarnings("serial") + private volatile java.lang.Object uid_ = ""; + /** * * @@ -11069,6 +11520,7 @@ public java.lang.String getUid() { return s; } } + /** * * @@ -11110,6 +11562,7 @@ private static final class AnnotationsDefaultEntryHolder { ""); } + @SuppressWarnings("serial") private com.google.protobuf.MapField annotations_; private com.google.protobuf.MapField @@ -11124,6 +11577,7 @@ private static final class AnnotationsDefaultEntryHolder { public int getAnnotationsCount() { return internalGetAnnotations().getMap().size(); } + /** * * @@ -11131,7 +11585,9 @@ public int getAnnotationsCount() { * Annotations is an unstructured key-value map stored with a resource that * may be set by external tools to store and retrieve arbitrary metadata. * They are not queryable and should be preserved when modifying objects. - * More info: https://kubernetes.io/docs/user-guide/annotations + * + * More info: + * https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/ *
        * * map<string, string> annotations = 6; @@ -11143,12 +11599,14 @@ public boolean containsAnnotations(java.lang.String key) { } return internalGetAnnotations().getMap().containsKey(key); } + /** Use {@link #getAnnotationsMap()} instead. */ @java.lang.Override @java.lang.Deprecated public java.util.Map getAnnotations() { return getAnnotationsMap(); } + /** * * @@ -11156,7 +11614,9 @@ public java.util.Map getAnnotations() { * Annotations is an unstructured key-value map stored with a resource that * may be set by external tools to store and retrieve arbitrary metadata. * They are not queryable and should be preserved when modifying objects. - * More info: https://kubernetes.io/docs/user-guide/annotations + * + * More info: + * https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/ *
        * * map<string, string> annotations = 6; @@ -11165,6 +11625,7 @@ public java.util.Map getAnnotations() { public java.util.Map getAnnotationsMap() { return internalGetAnnotations().getMap(); } + /** * * @@ -11172,20 +11633,25 @@ public java.util.Map getAnnotationsMap() { * Annotations is an unstructured key-value map stored with a resource that * may be set by external tools to store and retrieve arbitrary metadata. * They are not queryable and should be preserved when modifying objects. - * More info: https://kubernetes.io/docs/user-guide/annotations + * + * More info: + * https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/ *
        * * map<string, string> annotations = 6; */ @java.lang.Override - public java.lang.String getAnnotationsOrDefault( - java.lang.String key, java.lang.String defaultValue) { + public /* nullable */ java.lang.String getAnnotationsOrDefault( + java.lang.String key, + /* nullable */ + java.lang.String defaultValue) { if (key == null) { throw new NullPointerException("map key"); } java.util.Map map = internalGetAnnotations().getMap(); return map.containsKey(key) ? map.get(key) : defaultValue; } + /** * * @@ -11193,7 +11659,9 @@ public java.lang.String getAnnotationsOrDefault( * Annotations is an unstructured key-value map stored with a resource that * may be set by external tools to store and retrieve arbitrary metadata. * They are not queryable and should be preserved when modifying objects. - * More info: https://kubernetes.io/docs/user-guide/annotations + * + * More info: + * https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/ *
        * * map<string, string> annotations = 6; @@ -11211,7 +11679,10 @@ public java.lang.String getAnnotationsOrThrow(java.lang.String key) { } public static final int DISPLAY_NAME_FIELD_NUMBER = 7; - private volatile java.lang.Object displayName_; + + @SuppressWarnings("serial") + private volatile java.lang.Object displayName_ = ""; + /** * * @@ -11235,6 +11706,7 @@ public java.lang.String getDisplayName() { return s; } } + /** * * @@ -11261,6 +11733,7 @@ public com.google.protobuf.ByteString getDisplayNameBytes() { public static final int CREATE_TIME_FIELD_NUMBER = 8; private com.google.protobuf.Timestamp createTime_; + /** * * @@ -11275,8 +11748,9 @@ public com.google.protobuf.ByteString getDisplayNameBytes() { */ @java.lang.Override public boolean hasCreateTime() { - return createTime_ != null; + return ((bitField0_ & 0x00000001) != 0); } + /** * * @@ -11293,6 +11767,7 @@ public boolean hasCreateTime() { public com.google.protobuf.Timestamp getCreateTime() { return createTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : createTime_; } + /** * * @@ -11305,11 +11780,12 @@ public com.google.protobuf.Timestamp getCreateTime() { */ @java.lang.Override public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { - return getCreateTime(); + return createTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : createTime_; } public static final int UPDATE_TIME_FIELD_NUMBER = 9; private com.google.protobuf.Timestamp updateTime_; + /** * * @@ -11325,8 +11801,9 @@ public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { */ @java.lang.Override public boolean hasUpdateTime() { - return updateTime_ != null; + return ((bitField0_ & 0x00000002) != 0); } + /** * * @@ -11344,6 +11821,7 @@ public boolean hasUpdateTime() { public com.google.protobuf.Timestamp getUpdateTime() { return updateTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : updateTime_; } + /** * * @@ -11357,11 +11835,12 @@ public com.google.protobuf.Timestamp getUpdateTime() { */ @java.lang.Override public com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder() { - return getUpdateTime(); + return updateTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : updateTime_; } public static final int DELETE_TIME_FIELD_NUMBER = 10; private com.google.protobuf.Timestamp deleteTime_; + /** * * @@ -11376,8 +11855,9 @@ public com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder() { */ @java.lang.Override public boolean hasDeleteTime() { - return deleteTime_ != null; + return ((bitField0_ & 0x00000004) != 0); } + /** * * @@ -11394,6 +11874,7 @@ public boolean hasDeleteTime() { public com.google.protobuf.Timestamp getDeleteTime() { return deleteTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : deleteTime_; } + /** * * @@ -11406,11 +11887,14 @@ public com.google.protobuf.Timestamp getDeleteTime() { */ @java.lang.Override public com.google.protobuf.TimestampOrBuilder getDeleteTimeOrBuilder() { - return getDeleteTime(); + return deleteTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : deleteTime_; } public static final int ETAG_FIELD_NUMBER = 11; - private volatile java.lang.Object etag_; + + @SuppressWarnings("serial") + private volatile java.lang.Object etag_ = ""; + /** * * @@ -11436,6 +11920,7 @@ public java.lang.String getEtag() { return s; } } + /** * * @@ -11463,7 +11948,10 @@ public com.google.protobuf.ByteString getEtagBytes() { } public static final int LOCATION_FIELD_NUMBER = 12; - private volatile java.lang.Object location_; + + @SuppressWarnings("serial") + private volatile java.lang.Object location_ = ""; + /** * * @@ -11471,6 +11959,7 @@ public com.google.protobuf.ByteString getEtagBytes() { * Immutable. The location of the resource. The location encoding is * specific to the service provider, and new encoding may be introduced * as the service evolves. + * * For Google Cloud products, the encoding is what is used by Google Cloud * APIs, such as `us-east1`, `aws-us-east-1`, and `azure-eastus2`. The * semantics of `location` is identical to the @@ -11493,6 +11982,7 @@ public java.lang.String getLocation() { return s; } } + /** * * @@ -11500,6 +11990,7 @@ public java.lang.String getLocation() { * Immutable. The location of the resource. The location encoding is * specific to the service provider, and new encoding may be introduced * as the service evolves. + * * For Google Cloud products, the encoding is what is used by Google Cloud * APIs, such as `us-east1`, `aws-us-east-1`, and `azure-eastus2`. The * semantics of `location` is identical to the @@ -11537,39 +12028,39 @@ public final boolean isInitialized() { @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(service_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, service_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(service_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, service_); } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 2, name_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, name_); } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(type_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 3, type_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(type_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 3, type_); } - com.google.protobuf.GeneratedMessageV3.serializeStringMapTo( + com.google.protobuf.GeneratedMessage.serializeStringMapTo( output, internalGetLabels(), LabelsDefaultEntryHolder.defaultEntry, 4); - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(uid_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 5, uid_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(uid_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 5, uid_); } - com.google.protobuf.GeneratedMessageV3.serializeStringMapTo( + com.google.protobuf.GeneratedMessage.serializeStringMapTo( output, internalGetAnnotations(), AnnotationsDefaultEntryHolder.defaultEntry, 6); - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(displayName_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 7, displayName_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(displayName_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 7, displayName_); } - if (createTime_ != null) { + if (((bitField0_ & 0x00000001) != 0)) { output.writeMessage(8, getCreateTime()); } - if (updateTime_ != null) { + if (((bitField0_ & 0x00000002) != 0)) { output.writeMessage(9, getUpdateTime()); } - if (deleteTime_ != null) { + if (((bitField0_ & 0x00000004) != 0)) { output.writeMessage(10, getDeleteTime()); } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(etag_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 11, etag_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(etag_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 11, etag_); } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(location_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 12, location_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(location_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 12, location_); } getUnknownFields().writeTo(output); } @@ -11580,14 +12071,14 @@ public int getSerializedSize() { if (size != -1) return size; size = 0; - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(service_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, service_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(service_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, service_); } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, name_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, name_); } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(type_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, type_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(type_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(3, type_); } for (java.util.Map.Entry entry : internalGetLabels().getMap().entrySet()) { @@ -11599,8 +12090,8 @@ public int getSerializedSize() { .build(); size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, labels__); } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(uid_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, uid_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(uid_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(5, uid_); } for (java.util.Map.Entry entry : internalGetAnnotations().getMap().entrySet()) { @@ -11612,23 +12103,23 @@ public int getSerializedSize() { .build(); size += com.google.protobuf.CodedOutputStream.computeMessageSize(6, annotations__); } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(displayName_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(7, displayName_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(displayName_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(7, displayName_); } - if (createTime_ != null) { + if (((bitField0_ & 0x00000001) != 0)) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(8, getCreateTime()); } - if (updateTime_ != null) { + if (((bitField0_ & 0x00000002) != 0)) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(9, getUpdateTime()); } - if (deleteTime_ != null) { + if (((bitField0_ & 0x00000004) != 0)) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(10, getDeleteTime()); } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(etag_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(11, etag_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(etag_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(11, etag_); } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(location_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(12, location_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(location_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(12, location_); } size += getUnknownFields().getSerializedSize(); memoizedSize = size; @@ -11754,38 +12245,38 @@ public static com.google.rpc.context.AttributeContext.Resource parseFrom( public static com.google.rpc.context.AttributeContext.Resource parseFrom( java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); } public static com.google.rpc.context.AttributeContext.Resource parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } public static com.google.rpc.context.AttributeContext.Resource parseDelimitedFrom( java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); } public static com.google.rpc.context.AttributeContext.Resource parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( PARSER, input, extensionRegistry); } public static com.google.rpc.context.AttributeContext.Resource parseFrom( com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); } public static com.google.rpc.context.AttributeContext.Resource parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } @@ -11808,11 +12299,11 @@ public Builder toBuilder() { } @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { Builder builder = new Builder(parent); return builder; } + /** * * @@ -11824,8 +12315,7 @@ protected Builder newBuilderForType( * * Protobuf type {@code google.rpc.context.AttributeContext.Resource} */ - public static final class Builder - extends com.google.protobuf.GeneratedMessageV3.Builder + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder implements // @@protoc_insertion_point(builder_implements:google.rpc.context.AttributeContext.Resource) com.google.rpc.context.AttributeContext.ResourceOrBuilder { @@ -11835,7 +12325,8 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } @SuppressWarnings({"rawtypes"}) - protected com.google.protobuf.MapField internalGetMapField(int number) { + protected com.google.protobuf.MapFieldReflectionAccessor internalGetMapFieldReflection( + int number) { switch (number) { case 4: return internalGetLabels(); @@ -11847,7 +12338,8 @@ protected com.google.protobuf.MapField internalGetMapField(int number) { } @SuppressWarnings({"rawtypes"}) - protected com.google.protobuf.MapField internalGetMutableMapField(int number) { + protected com.google.protobuf.MapFieldReflectionAccessor internalGetMutableMapFieldReflection( + int number) { switch (number) { case 4: return internalGetMutableLabels(); @@ -11859,7 +12351,7 @@ protected com.google.protobuf.MapField internalGetMutableMapField(int number) { } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.rpc.context.AttributeContextProto .internal_static_google_rpc_context_AttributeContext_Resource_fieldAccessorTable @@ -11869,49 +12361,51 @@ protected com.google.protobuf.MapField internalGetMutableMapField(int number) { } // Construct using com.google.rpc.context.AttributeContext.Resource.newBuilder() - private Builder() {} + private Builder() { + maybeForceBuilderInitialization(); + } - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetCreateTimeFieldBuilder(); + internalGetUpdateTimeFieldBuilder(); + internalGetDeleteTimeFieldBuilder(); + } } @java.lang.Override public Builder clear() { super.clear(); + bitField0_ = 0; service_ = ""; - name_ = ""; - type_ = ""; - internalGetMutableLabels().clear(); uid_ = ""; - internalGetMutableAnnotations().clear(); displayName_ = ""; - - if (createTimeBuilder_ == null) { - createTime_ = null; - } else { - createTime_ = null; + createTime_ = null; + if (createTimeBuilder_ != null) { + createTimeBuilder_.dispose(); createTimeBuilder_ = null; } - if (updateTimeBuilder_ == null) { - updateTime_ = null; - } else { - updateTime_ = null; + updateTime_ = null; + if (updateTimeBuilder_ != null) { + updateTimeBuilder_.dispose(); updateTimeBuilder_ = null; } - if (deleteTimeBuilder_ == null) { - deleteTime_ = null; - } else { - deleteTime_ = null; + deleteTime_ = null; + if (deleteTimeBuilder_ != null) { + deleteTimeBuilder_.dispose(); deleteTimeBuilder_ = null; } etag_ = ""; - location_ = ""; - return this; } @@ -11939,70 +12433,61 @@ public com.google.rpc.context.AttributeContext.Resource build() { public com.google.rpc.context.AttributeContext.Resource buildPartial() { com.google.rpc.context.AttributeContext.Resource result = new com.google.rpc.context.AttributeContext.Resource(this); - int from_bitField0_ = bitField0_; - result.service_ = service_; - result.name_ = name_; - result.type_ = type_; - result.labels_ = internalGetLabels(); - result.labels_.makeImmutable(); - result.uid_ = uid_; - result.annotations_ = internalGetAnnotations(); - result.annotations_.makeImmutable(); - result.displayName_ = displayName_; - if (createTimeBuilder_ == null) { - result.createTime_ = createTime_; - } else { - result.createTime_ = createTimeBuilder_.build(); - } - if (updateTimeBuilder_ == null) { - result.updateTime_ = updateTime_; - } else { - result.updateTime_ = updateTimeBuilder_.build(); + if (bitField0_ != 0) { + buildPartial0(result); } - if (deleteTimeBuilder_ == null) { - result.deleteTime_ = deleteTime_; - } else { - result.deleteTime_ = deleteTimeBuilder_.build(); - } - result.etag_ = etag_; - result.location_ = location_; 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); + private void buildPartial0(com.google.rpc.context.AttributeContext.Resource result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.service_ = service_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.name_ = name_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.type_ = type_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.labels_ = internalGetLabels(); + result.labels_.makeImmutable(); + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.uid_ = uid_; + } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.annotations_ = internalGetAnnotations(); + result.annotations_.makeImmutable(); + } + if (((from_bitField0_ & 0x00000040) != 0)) { + result.displayName_ = displayName_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000080) != 0)) { + result.createTime_ = + createTimeBuilder_ == null ? createTime_ : createTimeBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000100) != 0)) { + result.updateTime_ = + updateTimeBuilder_ == null ? updateTime_ : updateTimeBuilder_.build(); + to_bitField0_ |= 0x00000002; + } + if (((from_bitField0_ & 0x00000200) != 0)) { + result.deleteTime_ = + deleteTimeBuilder_ == null ? deleteTime_ : deleteTimeBuilder_.build(); + to_bitField0_ |= 0x00000004; + } + if (((from_bitField0_ & 0x00000400) != 0)) { + result.etag_ = etag_; + } + if (((from_bitField0_ & 0x00000800) != 0)) { + result.location_ = location_; + } + result.bitField0_ |= to_bitField0_; } @java.lang.Override @@ -12020,24 +12505,31 @@ public Builder mergeFrom(com.google.rpc.context.AttributeContext.Resource other) return this; if (!other.getService().isEmpty()) { service_ = other.service_; + bitField0_ |= 0x00000001; onChanged(); } if (!other.getName().isEmpty()) { name_ = other.name_; + bitField0_ |= 0x00000002; onChanged(); } if (!other.getType().isEmpty()) { type_ = other.type_; + bitField0_ |= 0x00000004; onChanged(); } internalGetMutableLabels().mergeFrom(other.internalGetLabels()); + bitField0_ |= 0x00000008; if (!other.getUid().isEmpty()) { uid_ = other.uid_; + bitField0_ |= 0x00000010; onChanged(); } internalGetMutableAnnotations().mergeFrom(other.internalGetAnnotations()); + bitField0_ |= 0x00000020; if (!other.getDisplayName().isEmpty()) { displayName_ = other.displayName_; + bitField0_ |= 0x00000040; onChanged(); } if (other.hasCreateTime()) { @@ -12051,10 +12543,12 @@ public Builder mergeFrom(com.google.rpc.context.AttributeContext.Resource other) } if (!other.getEtag().isEmpty()) { etag_ = other.etag_; + bitField0_ |= 0x00000400; onChanged(); } if (!other.getLocation().isEmpty()) { location_ = other.location_; + bitField0_ |= 0x00000800; onChanged(); } this.mergeUnknownFields(other.getUnknownFields()); @@ -12086,19 +12580,19 @@ public Builder mergeFrom( case 10: { service_ = input.readStringRequireUtf8(); - + bitField0_ |= 0x00000001; break; } // case 10 case 18: { name_ = input.readStringRequireUtf8(); - + bitField0_ |= 0x00000002; break; } // case 18 case 26: { type_ = input.readStringRequireUtf8(); - + bitField0_ |= 0x00000004; break; } // case 26 case 34: @@ -12110,12 +12604,13 @@ public Builder mergeFrom( internalGetMutableLabels() .getMutableMap() .put(labels__.getKey(), labels__.getValue()); + bitField0_ |= 0x00000008; break; } // case 34 case 42: { uid_ = input.readStringRequireUtf8(); - + bitField0_ |= 0x00000010; break; } // case 42 case 50: @@ -12127,42 +12622,46 @@ public Builder mergeFrom( internalGetMutableAnnotations() .getMutableMap() .put(annotations__.getKey(), annotations__.getValue()); + bitField0_ |= 0x00000020; break; } // case 50 case 58: { displayName_ = input.readStringRequireUtf8(); - + bitField0_ |= 0x00000040; break; } // case 58 case 66: { - input.readMessage(getCreateTimeFieldBuilder().getBuilder(), extensionRegistry); - + input.readMessage( + internalGetCreateTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000080; break; } // case 66 case 74: { - input.readMessage(getUpdateTimeFieldBuilder().getBuilder(), extensionRegistry); - + input.readMessage( + internalGetUpdateTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000100; break; } // case 74 case 82: { - input.readMessage(getDeleteTimeFieldBuilder().getBuilder(), extensionRegistry); - + input.readMessage( + internalGetDeleteTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000200; break; } // case 82 case 90: { etag_ = input.readStringRequireUtf8(); - + bitField0_ |= 0x00000400; break; } // case 90 case 98: { location_ = input.readStringRequireUtf8(); - + bitField0_ |= 0x00000800; break; } // case 98 default: @@ -12185,6 +12684,7 @@ public Builder mergeFrom( private int bitField0_; private java.lang.Object service_ = ""; + /** * * @@ -12209,6 +12709,7 @@ public java.lang.String getService() { return (java.lang.String) ref; } } + /** * * @@ -12233,6 +12734,7 @@ public com.google.protobuf.ByteString getServiceBytes() { return (com.google.protobuf.ByteString) ref; } } + /** * * @@ -12251,11 +12753,12 @@ public Builder setService(java.lang.String value) { if (value == null) { throw new NullPointerException(); } - service_ = value; + bitField0_ |= 0x00000001; onChanged(); return this; } + /** * * @@ -12270,11 +12773,12 @@ public Builder setService(java.lang.String value) { * @return This builder for chaining. */ public Builder clearService() { - service_ = getDefaultInstance().getService(); + bitField0_ = (bitField0_ & ~0x00000001); onChanged(); return this; } + /** * * @@ -12294,13 +12798,14 @@ public Builder setServiceBytes(com.google.protobuf.ByteString value) { throw new NullPointerException(); } checkByteStringIsUtf8(value); - service_ = value; + bitField0_ |= 0x00000001; onChanged(); return this; } private java.lang.Object name_ = ""; + /** * * @@ -12308,12 +12813,14 @@ public Builder setServiceBytes(com.google.protobuf.ByteString value) { * The stable identifier (name) of a resource on the `service`. A resource * can be logically identified as "//{resource.service}/{resource.name}". * The differences between a resource name and a URI are: + * * * Resource name is a logical identifier, independent of network - * protocol and API version. For example, - * `//pubsub.googleapis.com/projects/123/topics/news-feed`. + * protocol and API version. For example, + * `//pubsub.googleapis.com/projects/123/topics/news-feed`. * * URI often includes protocol and version information, so it can - * be used directly by applications. For example, - * `https://pubsub.googleapis.com/v1/projects/123/topics/news-feed`. + * be used directly by applications. For example, + * `https://pubsub.googleapis.com/v1/projects/123/topics/news-feed`. + * * See https://cloud.google.com/apis/design/resource_names for details. *
        * @@ -12332,6 +12839,7 @@ public java.lang.String getName() { return (java.lang.String) ref; } } + /** * * @@ -12339,12 +12847,14 @@ public java.lang.String getName() { * The stable identifier (name) of a resource on the `service`. A resource * can be logically identified as "//{resource.service}/{resource.name}". * The differences between a resource name and a URI are: + * * * Resource name is a logical identifier, independent of network - * protocol and API version. For example, - * `//pubsub.googleapis.com/projects/123/topics/news-feed`. + * protocol and API version. For example, + * `//pubsub.googleapis.com/projects/123/topics/news-feed`. * * URI often includes protocol and version information, so it can - * be used directly by applications. For example, - * `https://pubsub.googleapis.com/v1/projects/123/topics/news-feed`. + * be used directly by applications. For example, + * `https://pubsub.googleapis.com/v1/projects/123/topics/news-feed`. + * * See https://cloud.google.com/apis/design/resource_names for details. *
        * @@ -12363,6 +12873,7 @@ public com.google.protobuf.ByteString getNameBytes() { return (com.google.protobuf.ByteString) ref; } } + /** * * @@ -12370,12 +12881,14 @@ public com.google.protobuf.ByteString getNameBytes() { * The stable identifier (name) of a resource on the `service`. A resource * can be logically identified as "//{resource.service}/{resource.name}". * The differences between a resource name and a URI are: + * * * Resource name is a logical identifier, independent of network - * protocol and API version. For example, - * `//pubsub.googleapis.com/projects/123/topics/news-feed`. + * protocol and API version. For example, + * `//pubsub.googleapis.com/projects/123/topics/news-feed`. * * URI often includes protocol and version information, so it can - * be used directly by applications. For example, - * `https://pubsub.googleapis.com/v1/projects/123/topics/news-feed`. + * be used directly by applications. For example, + * `https://pubsub.googleapis.com/v1/projects/123/topics/news-feed`. + * * See https://cloud.google.com/apis/design/resource_names for details. * * @@ -12388,11 +12901,12 @@ public Builder setName(java.lang.String value) { if (value == null) { throw new NullPointerException(); } - name_ = value; + bitField0_ |= 0x00000002; onChanged(); return this; } + /** * * @@ -12400,12 +12914,14 @@ public Builder setName(java.lang.String value) { * The stable identifier (name) of a resource on the `service`. A resource * can be logically identified as "//{resource.service}/{resource.name}". * The differences between a resource name and a URI are: + * * * Resource name is a logical identifier, independent of network - * protocol and API version. For example, - * `//pubsub.googleapis.com/projects/123/topics/news-feed`. + * protocol and API version. For example, + * `//pubsub.googleapis.com/projects/123/topics/news-feed`. * * URI often includes protocol and version information, so it can - * be used directly by applications. For example, - * `https://pubsub.googleapis.com/v1/projects/123/topics/news-feed`. + * be used directly by applications. For example, + * `https://pubsub.googleapis.com/v1/projects/123/topics/news-feed`. + * * See https://cloud.google.com/apis/design/resource_names for details. * * @@ -12414,11 +12930,12 @@ public Builder setName(java.lang.String value) { * @return This builder for chaining. */ public Builder clearName() { - name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000002); onChanged(); return this; } + /** * * @@ -12426,12 +12943,14 @@ public Builder clearName() { * The stable identifier (name) of a resource on the `service`. A resource * can be logically identified as "//{resource.service}/{resource.name}". * The differences between a resource name and a URI are: + * * * Resource name is a logical identifier, independent of network - * protocol and API version. For example, - * `//pubsub.googleapis.com/projects/123/topics/news-feed`. + * protocol and API version. For example, + * `//pubsub.googleapis.com/projects/123/topics/news-feed`. * * URI often includes protocol and version information, so it can - * be used directly by applications. For example, - * `https://pubsub.googleapis.com/v1/projects/123/topics/news-feed`. + * be used directly by applications. For example, + * `https://pubsub.googleapis.com/v1/projects/123/topics/news-feed`. + * * See https://cloud.google.com/apis/design/resource_names for details. * * @@ -12445,20 +12964,23 @@ public Builder setNameBytes(com.google.protobuf.ByteString value) { throw new NullPointerException(); } checkByteStringIsUtf8(value); - name_ = value; + bitField0_ |= 0x00000002; onChanged(); return this; } private java.lang.Object type_ = ""; + /** * * *
                * The type of the resource. The syntax is platform-specific because
                * different platforms define their resources differently.
        -       * For Google APIs, the type format must be "{service}/{kind}".
        +       *
        +       * For Google APIs, the type format must be "{service}/{kind}", such as
        +       * "pubsub.googleapis.com/Topic".
                * 
        * * string type = 3; @@ -12476,13 +12998,16 @@ public java.lang.String getType() { return (java.lang.String) ref; } } + /** * * *
                * The type of the resource. The syntax is platform-specific because
                * different platforms define their resources differently.
        -       * For Google APIs, the type format must be "{service}/{kind}".
        +       *
        +       * For Google APIs, the type format must be "{service}/{kind}", such as
        +       * "pubsub.googleapis.com/Topic".
                * 
        * * string type = 3; @@ -12500,13 +13025,16 @@ public com.google.protobuf.ByteString getTypeBytes() { return (com.google.protobuf.ByteString) ref; } } + /** * * *
                * The type of the resource. The syntax is platform-specific because
                * different platforms define their resources differently.
        -       * For Google APIs, the type format must be "{service}/{kind}".
        +       *
        +       * For Google APIs, the type format must be "{service}/{kind}", such as
        +       * "pubsub.googleapis.com/Topic".
                * 
        * * string type = 3; @@ -12518,18 +13046,21 @@ public Builder setType(java.lang.String value) { if (value == null) { throw new NullPointerException(); } - type_ = value; + bitField0_ |= 0x00000004; onChanged(); return this; } + /** * * *
                * The type of the resource. The syntax is platform-specific because
                * different platforms define their resources differently.
        -       * For Google APIs, the type format must be "{service}/{kind}".
        +       *
        +       * For Google APIs, the type format must be "{service}/{kind}", such as
        +       * "pubsub.googleapis.com/Topic".
                * 
        * * string type = 3; @@ -12537,18 +13068,21 @@ public Builder setType(java.lang.String value) { * @return This builder for chaining. */ public Builder clearType() { - type_ = getDefaultInstance().getType(); + bitField0_ = (bitField0_ & ~0x00000004); onChanged(); return this; } + /** * * *
                * The type of the resource. The syntax is platform-specific because
                * different platforms define their resources differently.
        -       * For Google APIs, the type format must be "{service}/{kind}".
        +       *
        +       * For Google APIs, the type format must be "{service}/{kind}", such as
        +       * "pubsub.googleapis.com/Topic".
                * 
        * * string type = 3; @@ -12561,8 +13095,8 @@ public Builder setTypeBytes(com.google.protobuf.ByteString value) { throw new NullPointerException(); } checkByteStringIsUtf8(value); - type_ = value; + bitField0_ |= 0x00000004; onChanged(); return this; } @@ -12578,20 +13112,21 @@ private com.google.protobuf.MapField interna private com.google.protobuf.MapField internalGetMutableLabels() { - onChanged(); - ; if (labels_ == null) { labels_ = com.google.protobuf.MapField.newMapField(LabelsDefaultEntryHolder.defaultEntry); } if (!labels_.isMutable()) { labels_ = labels_.copy(); } + bitField0_ |= 0x00000008; + onChanged(); return labels_; } public int getLabelsCount() { return internalGetLabels().getMap().size(); } + /** * * @@ -12609,12 +13144,14 @@ public boolean containsLabels(java.lang.String key) { } return internalGetLabels().getMap().containsKey(key); } + /** Use {@link #getLabelsMap()} instead. */ @java.lang.Override @java.lang.Deprecated public java.util.Map getLabels() { return getLabelsMap(); } + /** * * @@ -12629,6 +13166,7 @@ public java.util.Map getLabels() { public java.util.Map getLabelsMap() { return internalGetLabels().getMap(); } + /** * * @@ -12640,14 +13178,17 @@ public java.util.Map getLabelsMap() { * map<string, string> labels = 4; */ @java.lang.Override - public java.lang.String getLabelsOrDefault( - java.lang.String key, java.lang.String defaultValue) { + 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; } + /** * * @@ -12671,9 +13212,11 @@ public java.lang.String getLabelsOrThrow(java.lang.String key) { } public Builder clearLabels() { + bitField0_ = (bitField0_ & ~0x00000008); internalGetMutableLabels().getMutableMap().clear(); return this; } + /** * * @@ -12691,11 +13234,14 @@ public Builder removeLabels(java.lang.String key) { internalGetMutableLabels().getMutableMap().remove(key); return this; } + /** Use alternate mutation accessors instead. */ @java.lang.Deprecated public java.util.Map getMutableLabels() { + bitField0_ |= 0x00000008; return internalGetMutableLabels().getMutableMap(); } + /** * * @@ -12713,10 +13259,11 @@ public Builder putLabels(java.lang.String key, java.lang.String value) { if (value == null) { throw new NullPointerException("map value"); } - internalGetMutableLabels().getMutableMap().put(key, value); + bitField0_ |= 0x00000008; return this; } + /** * * @@ -12729,10 +13276,12 @@ public Builder putLabels(java.lang.String key, java.lang.String value) { */ public Builder putAllLabels(java.util.Map values) { internalGetMutableLabels().getMutableMap().putAll(values); + bitField0_ |= 0x00000008; return this; } private java.lang.Object uid_ = ""; + /** * * @@ -12759,6 +13308,7 @@ public java.lang.String getUid() { return (java.lang.String) ref; } } + /** * * @@ -12785,6 +13335,7 @@ public com.google.protobuf.ByteString getUidBytes() { return (com.google.protobuf.ByteString) ref; } } + /** * * @@ -12805,11 +13356,12 @@ public Builder setUid(java.lang.String value) { if (value == null) { throw new NullPointerException(); } - uid_ = value; + bitField0_ |= 0x00000010; onChanged(); return this; } + /** * * @@ -12826,11 +13378,12 @@ public Builder setUid(java.lang.String value) { * @return This builder for chaining. */ public Builder clearUid() { - uid_ = getDefaultInstance().getUid(); + bitField0_ = (bitField0_ & ~0x00000010); onChanged(); return this; } + /** * * @@ -12852,8 +13405,8 @@ public Builder setUidBytes(com.google.protobuf.ByteString value) { throw new NullPointerException(); } checkByteStringIsUtf8(value); - uid_ = value; + bitField0_ |= 0x00000010; onChanged(); return this; } @@ -12871,8 +13424,6 @@ public Builder setUidBytes(com.google.protobuf.ByteString value) { private com.google.protobuf.MapField internalGetMutableAnnotations() { - onChanged(); - ; if (annotations_ == null) { annotations_ = com.google.protobuf.MapField.newMapField(AnnotationsDefaultEntryHolder.defaultEntry); @@ -12880,12 +13431,15 @@ public Builder setUidBytes(com.google.protobuf.ByteString value) { if (!annotations_.isMutable()) { annotations_ = annotations_.copy(); } + bitField0_ |= 0x00000020; + onChanged(); return annotations_; } public int getAnnotationsCount() { return internalGetAnnotations().getMap().size(); } + /** * * @@ -12893,7 +13447,9 @@ public int getAnnotationsCount() { * Annotations is an unstructured key-value map stored with a resource that * may be set by external tools to store and retrieve arbitrary metadata. * They are not queryable and should be preserved when modifying objects. - * More info: https://kubernetes.io/docs/user-guide/annotations + * + * More info: + * https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/ * * * map<string, string> annotations = 6; @@ -12905,12 +13461,14 @@ public boolean containsAnnotations(java.lang.String key) { } return internalGetAnnotations().getMap().containsKey(key); } + /** Use {@link #getAnnotationsMap()} instead. */ @java.lang.Override @java.lang.Deprecated public java.util.Map getAnnotations() { return getAnnotationsMap(); } + /** * * @@ -12918,7 +13476,9 @@ public java.util.Map getAnnotations() { * Annotations is an unstructured key-value map stored with a resource that * may be set by external tools to store and retrieve arbitrary metadata. * They are not queryable and should be preserved when modifying objects. - * More info: https://kubernetes.io/docs/user-guide/annotations + * + * More info: + * https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/ * * * map<string, string> annotations = 6; @@ -12927,6 +13487,7 @@ public java.util.Map getAnnotations() { public java.util.Map getAnnotationsMap() { return internalGetAnnotations().getMap(); } + /** * * @@ -12934,20 +13495,25 @@ public java.util.Map getAnnotationsMap() { * Annotations is an unstructured key-value map stored with a resource that * may be set by external tools to store and retrieve arbitrary metadata. * They are not queryable and should be preserved when modifying objects. - * More info: https://kubernetes.io/docs/user-guide/annotations + * + * More info: + * https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/ * * * map<string, string> annotations = 6; */ @java.lang.Override - public java.lang.String getAnnotationsOrDefault( - java.lang.String key, java.lang.String defaultValue) { + public /* nullable */ java.lang.String getAnnotationsOrDefault( + java.lang.String key, + /* nullable */ + java.lang.String defaultValue) { if (key == null) { throw new NullPointerException("map key"); } java.util.Map map = internalGetAnnotations().getMap(); return map.containsKey(key) ? map.get(key) : defaultValue; } + /** * * @@ -12955,7 +13521,9 @@ public java.lang.String getAnnotationsOrDefault( * Annotations is an unstructured key-value map stored with a resource that * may be set by external tools to store and retrieve arbitrary metadata. * They are not queryable and should be preserved when modifying objects. - * More info: https://kubernetes.io/docs/user-guide/annotations + * + * More info: + * https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/ * * * map<string, string> annotations = 6; @@ -12973,9 +13541,11 @@ public java.lang.String getAnnotationsOrThrow(java.lang.String key) { } public Builder clearAnnotations() { + bitField0_ = (bitField0_ & ~0x00000020); internalGetMutableAnnotations().getMutableMap().clear(); return this; } + /** * * @@ -12983,7 +13553,9 @@ public Builder clearAnnotations() { * Annotations is an unstructured key-value map stored with a resource that * may be set by external tools to store and retrieve arbitrary metadata. * They are not queryable and should be preserved when modifying objects. - * More info: https://kubernetes.io/docs/user-guide/annotations + * + * More info: + * https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/ * * * map<string, string> annotations = 6; @@ -12995,11 +13567,14 @@ public Builder removeAnnotations(java.lang.String key) { internalGetMutableAnnotations().getMutableMap().remove(key); return this; } + /** Use alternate mutation accessors instead. */ @java.lang.Deprecated public java.util.Map getMutableAnnotations() { + bitField0_ |= 0x00000020; return internalGetMutableAnnotations().getMutableMap(); } + /** * * @@ -13007,7 +13582,9 @@ public java.util.Map getMutableAnnotations() * Annotations is an unstructured key-value map stored with a resource that * may be set by external tools to store and retrieve arbitrary metadata. * They are not queryable and should be preserved when modifying objects. - * More info: https://kubernetes.io/docs/user-guide/annotations + * + * More info: + * https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/ * * * map<string, string> annotations = 6; @@ -13019,10 +13596,11 @@ public Builder putAnnotations(java.lang.String key, java.lang.String value) { if (value == null) { throw new NullPointerException("map value"); } - internalGetMutableAnnotations().getMutableMap().put(key, value); + bitField0_ |= 0x00000020; return this; } + /** * * @@ -13030,17 +13608,21 @@ public Builder putAnnotations(java.lang.String key, java.lang.String value) { * Annotations is an unstructured key-value map stored with a resource that * may be set by external tools to store and retrieve arbitrary metadata. * They are not queryable and should be preserved when modifying objects. - * More info: https://kubernetes.io/docs/user-guide/annotations + * + * More info: + * https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/ * * * map<string, string> annotations = 6; */ public Builder putAllAnnotations(java.util.Map values) { internalGetMutableAnnotations().getMutableMap().putAll(values); + bitField0_ |= 0x00000020; return this; } private java.lang.Object displayName_ = ""; + /** * * @@ -13063,6 +13645,7 @@ public java.lang.String getDisplayName() { return (java.lang.String) ref; } } + /** * * @@ -13085,6 +13668,7 @@ public com.google.protobuf.ByteString getDisplayNameBytes() { return (com.google.protobuf.ByteString) ref; } } + /** * * @@ -13101,11 +13685,12 @@ public Builder setDisplayName(java.lang.String value) { if (value == null) { throw new NullPointerException(); } - displayName_ = value; + bitField0_ |= 0x00000040; onChanged(); return this; } + /** * * @@ -13118,11 +13703,12 @@ public Builder setDisplayName(java.lang.String value) { * @return This builder for chaining. */ public Builder clearDisplayName() { - displayName_ = getDefaultInstance().getDisplayName(); + bitField0_ = (bitField0_ & ~0x00000040); onChanged(); return this; } + /** * * @@ -13140,18 +13726,19 @@ public Builder setDisplayNameBytes(com.google.protobuf.ByteString value) { throw new NullPointerException(); } checkByteStringIsUtf8(value); - displayName_ = value; + bitField0_ |= 0x00000040; onChanged(); return this; } private com.google.protobuf.Timestamp createTime_; - private com.google.protobuf.SingleFieldBuilderV3< + private com.google.protobuf.SingleFieldBuilder< com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder> createTimeBuilder_; + /** * * @@ -13165,8 +13752,9 @@ public Builder setDisplayNameBytes(com.google.protobuf.ByteString value) { * @return Whether the createTime field is set. */ public boolean hasCreateTime() { - return createTimeBuilder_ != null || createTime_ != null; + return ((bitField0_ & 0x00000080) != 0); } + /** * * @@ -13188,6 +13776,7 @@ public com.google.protobuf.Timestamp getCreateTime() { return createTimeBuilder_.getMessage(); } } + /** * * @@ -13204,13 +13793,14 @@ public Builder setCreateTime(com.google.protobuf.Timestamp value) { throw new NullPointerException(); } createTime_ = value; - onChanged(); } else { createTimeBuilder_.setMessage(value); } - + bitField0_ |= 0x00000080; + onChanged(); return this; } + /** * * @@ -13224,13 +13814,14 @@ public Builder setCreateTime(com.google.protobuf.Timestamp value) { public Builder setCreateTime(com.google.protobuf.Timestamp.Builder builderForValue) { if (createTimeBuilder_ == null) { createTime_ = builderForValue.build(); - onChanged(); } else { createTimeBuilder_.setMessage(builderForValue.build()); } - + bitField0_ |= 0x00000080; + onChanged(); return this; } + /** * * @@ -13243,21 +13834,23 @@ public Builder setCreateTime(com.google.protobuf.Timestamp.Builder builderForVal */ public Builder mergeCreateTime(com.google.protobuf.Timestamp value) { if (createTimeBuilder_ == null) { - if (createTime_ != null) { - createTime_ = - com.google.protobuf.Timestamp.newBuilder(createTime_) - .mergeFrom(value) - .buildPartial(); + if (((bitField0_ & 0x00000080) != 0) + && createTime_ != null + && createTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getCreateTimeBuilder().mergeFrom(value); } else { createTime_ = value; } - onChanged(); } else { createTimeBuilder_.mergeFrom(value); } - + if (createTime_ != null) { + bitField0_ |= 0x00000080; + onChanged(); + } return this; } + /** * * @@ -13269,16 +13862,16 @@ public Builder mergeCreateTime(com.google.protobuf.Timestamp value) { * .google.protobuf.Timestamp create_time = 8; */ public Builder clearCreateTime() { - if (createTimeBuilder_ == null) { - createTime_ = null; - onChanged(); - } else { - createTime_ = null; + bitField0_ = (bitField0_ & ~0x00000080); + createTime_ = null; + if (createTimeBuilder_ != null) { + createTimeBuilder_.dispose(); createTimeBuilder_ = null; } - + onChanged(); return this; } + /** * * @@ -13290,10 +13883,11 @@ public Builder clearCreateTime() { * .google.protobuf.Timestamp create_time = 8; */ public com.google.protobuf.Timestamp.Builder getCreateTimeBuilder() { - + bitField0_ |= 0x00000080; onChanged(); - return getCreateTimeFieldBuilder().getBuilder(); + return internalGetCreateTimeFieldBuilder().getBuilder(); } + /** * * @@ -13313,6 +13907,7 @@ public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { : createTime_; } } + /** * * @@ -13323,14 +13918,14 @@ public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { * * .google.protobuf.Timestamp create_time = 8; */ - private com.google.protobuf.SingleFieldBuilderV3< + private com.google.protobuf.SingleFieldBuilder< com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder> - getCreateTimeFieldBuilder() { + internalGetCreateTimeFieldBuilder() { if (createTimeBuilder_ == null) { createTimeBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< + new com.google.protobuf.SingleFieldBuilder< com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder>( @@ -13341,11 +13936,12 @@ public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { } private com.google.protobuf.Timestamp updateTime_; - private com.google.protobuf.SingleFieldBuilderV3< + private com.google.protobuf.SingleFieldBuilder< com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder> updateTimeBuilder_; + /** * * @@ -13360,8 +13956,9 @@ public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { * @return Whether the updateTime field is set. */ public boolean hasUpdateTime() { - return updateTimeBuilder_ != null || updateTime_ != null; + return ((bitField0_ & 0x00000100) != 0); } + /** * * @@ -13384,6 +13981,7 @@ public com.google.protobuf.Timestamp getUpdateTime() { return updateTimeBuilder_.getMessage(); } } + /** * * @@ -13401,13 +13999,14 @@ public Builder setUpdateTime(com.google.protobuf.Timestamp value) { throw new NullPointerException(); } updateTime_ = value; - onChanged(); } else { updateTimeBuilder_.setMessage(value); } - + bitField0_ |= 0x00000100; + onChanged(); return this; } + /** * * @@ -13422,13 +14021,14 @@ public Builder setUpdateTime(com.google.protobuf.Timestamp value) { public Builder setUpdateTime(com.google.protobuf.Timestamp.Builder builderForValue) { if (updateTimeBuilder_ == null) { updateTime_ = builderForValue.build(); - onChanged(); } else { updateTimeBuilder_.setMessage(builderForValue.build()); } - + bitField0_ |= 0x00000100; + onChanged(); return this; } + /** * * @@ -13442,21 +14042,23 @@ public Builder setUpdateTime(com.google.protobuf.Timestamp.Builder builderForVal */ public Builder mergeUpdateTime(com.google.protobuf.Timestamp value) { if (updateTimeBuilder_ == null) { - if (updateTime_ != null) { - updateTime_ = - com.google.protobuf.Timestamp.newBuilder(updateTime_) - .mergeFrom(value) - .buildPartial(); + if (((bitField0_ & 0x00000100) != 0) + && updateTime_ != null + && updateTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getUpdateTimeBuilder().mergeFrom(value); } else { updateTime_ = value; } - onChanged(); } else { updateTimeBuilder_.mergeFrom(value); } - + if (updateTime_ != null) { + bitField0_ |= 0x00000100; + onChanged(); + } return this; } + /** * * @@ -13469,16 +14071,16 @@ public Builder mergeUpdateTime(com.google.protobuf.Timestamp value) { * .google.protobuf.Timestamp update_time = 9; */ public Builder clearUpdateTime() { - if (updateTimeBuilder_ == null) { - updateTime_ = null; - onChanged(); - } else { - updateTime_ = null; + bitField0_ = (bitField0_ & ~0x00000100); + updateTime_ = null; + if (updateTimeBuilder_ != null) { + updateTimeBuilder_.dispose(); updateTimeBuilder_ = null; } - + onChanged(); return this; } + /** * * @@ -13491,10 +14093,11 @@ public Builder clearUpdateTime() { * .google.protobuf.Timestamp update_time = 9; */ public com.google.protobuf.Timestamp.Builder getUpdateTimeBuilder() { - + bitField0_ |= 0x00000100; onChanged(); - return getUpdateTimeFieldBuilder().getBuilder(); + return internalGetUpdateTimeFieldBuilder().getBuilder(); } + /** * * @@ -13515,6 +14118,7 @@ public com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder() { : updateTime_; } } + /** * * @@ -13526,14 +14130,14 @@ public com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder() { * * .google.protobuf.Timestamp update_time = 9; */ - private com.google.protobuf.SingleFieldBuilderV3< + private com.google.protobuf.SingleFieldBuilder< com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder> - getUpdateTimeFieldBuilder() { + internalGetUpdateTimeFieldBuilder() { if (updateTimeBuilder_ == null) { updateTimeBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< + new com.google.protobuf.SingleFieldBuilder< com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder>( @@ -13544,11 +14148,12 @@ public com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder() { } private com.google.protobuf.Timestamp deleteTime_; - private com.google.protobuf.SingleFieldBuilderV3< + private com.google.protobuf.SingleFieldBuilder< com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder> deleteTimeBuilder_; + /** * * @@ -13562,8 +14167,9 @@ public com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder() { * @return Whether the deleteTime field is set. */ public boolean hasDeleteTime() { - return deleteTimeBuilder_ != null || deleteTime_ != null; + return ((bitField0_ & 0x00000200) != 0); } + /** * * @@ -13585,6 +14191,7 @@ public com.google.protobuf.Timestamp getDeleteTime() { return deleteTimeBuilder_.getMessage(); } } + /** * * @@ -13601,13 +14208,14 @@ public Builder setDeleteTime(com.google.protobuf.Timestamp value) { throw new NullPointerException(); } deleteTime_ = value; - onChanged(); } else { deleteTimeBuilder_.setMessage(value); } - + bitField0_ |= 0x00000200; + onChanged(); return this; } + /** * * @@ -13621,13 +14229,14 @@ public Builder setDeleteTime(com.google.protobuf.Timestamp value) { public Builder setDeleteTime(com.google.protobuf.Timestamp.Builder builderForValue) { if (deleteTimeBuilder_ == null) { deleteTime_ = builderForValue.build(); - onChanged(); } else { deleteTimeBuilder_.setMessage(builderForValue.build()); } - + bitField0_ |= 0x00000200; + onChanged(); return this; } + /** * * @@ -13640,21 +14249,23 @@ public Builder setDeleteTime(com.google.protobuf.Timestamp.Builder builderForVal */ public Builder mergeDeleteTime(com.google.protobuf.Timestamp value) { if (deleteTimeBuilder_ == null) { - if (deleteTime_ != null) { - deleteTime_ = - com.google.protobuf.Timestamp.newBuilder(deleteTime_) - .mergeFrom(value) - .buildPartial(); + if (((bitField0_ & 0x00000200) != 0) + && deleteTime_ != null + && deleteTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getDeleteTimeBuilder().mergeFrom(value); } else { deleteTime_ = value; } - onChanged(); } else { deleteTimeBuilder_.mergeFrom(value); } - + if (deleteTime_ != null) { + bitField0_ |= 0x00000200; + onChanged(); + } return this; } + /** * * @@ -13666,16 +14277,16 @@ public Builder mergeDeleteTime(com.google.protobuf.Timestamp value) { * .google.protobuf.Timestamp delete_time = 10; */ public Builder clearDeleteTime() { - if (deleteTimeBuilder_ == null) { - deleteTime_ = null; - onChanged(); - } else { - deleteTime_ = null; + bitField0_ = (bitField0_ & ~0x00000200); + deleteTime_ = null; + if (deleteTimeBuilder_ != null) { + deleteTimeBuilder_.dispose(); deleteTimeBuilder_ = null; } - + onChanged(); return this; } + /** * * @@ -13687,10 +14298,11 @@ public Builder clearDeleteTime() { * .google.protobuf.Timestamp delete_time = 10; */ public com.google.protobuf.Timestamp.Builder getDeleteTimeBuilder() { - + bitField0_ |= 0x00000200; onChanged(); - return getDeleteTimeFieldBuilder().getBuilder(); + return internalGetDeleteTimeFieldBuilder().getBuilder(); } + /** * * @@ -13710,6 +14322,7 @@ public com.google.protobuf.TimestampOrBuilder getDeleteTimeOrBuilder() { : deleteTime_; } } + /** * * @@ -13720,14 +14333,14 @@ public com.google.protobuf.TimestampOrBuilder getDeleteTimeOrBuilder() { * * .google.protobuf.Timestamp delete_time = 10; */ - private com.google.protobuf.SingleFieldBuilderV3< + private com.google.protobuf.SingleFieldBuilder< com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder> - getDeleteTimeFieldBuilder() { + internalGetDeleteTimeFieldBuilder() { if (deleteTimeBuilder_ == null) { deleteTimeBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< + new com.google.protobuf.SingleFieldBuilder< com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder>( @@ -13738,6 +14351,7 @@ public com.google.protobuf.TimestampOrBuilder getDeleteTimeOrBuilder() { } private java.lang.Object etag_ = ""; + /** * * @@ -13762,6 +14376,7 @@ public java.lang.String getEtag() { return (java.lang.String) ref; } } + /** * * @@ -13786,6 +14401,7 @@ public com.google.protobuf.ByteString getEtagBytes() { return (com.google.protobuf.ByteString) ref; } } + /** * * @@ -13804,11 +14420,12 @@ public Builder setEtag(java.lang.String value) { if (value == null) { throw new NullPointerException(); } - etag_ = value; + bitField0_ |= 0x00000400; onChanged(); return this; } + /** * * @@ -13823,11 +14440,12 @@ public Builder setEtag(java.lang.String value) { * @return This builder for chaining. */ public Builder clearEtag() { - etag_ = getDefaultInstance().getEtag(); + bitField0_ = (bitField0_ & ~0x00000400); onChanged(); return this; } + /** * * @@ -13847,13 +14465,14 @@ public Builder setEtagBytes(com.google.protobuf.ByteString value) { throw new NullPointerException(); } checkByteStringIsUtf8(value); - etag_ = value; + bitField0_ |= 0x00000400; onChanged(); return this; } private java.lang.Object location_ = ""; + /** * * @@ -13861,6 +14480,7 @@ public Builder setEtagBytes(com.google.protobuf.ByteString value) { * Immutable. The location of the resource. The location encoding is * specific to the service provider, and new encoding may be introduced * as the service evolves. + * * For Google Cloud products, the encoding is what is used by Google Cloud * APIs, such as `us-east1`, `aws-us-east-1`, and `azure-eastus2`. The * semantics of `location` is identical to the @@ -13882,6 +14502,7 @@ public java.lang.String getLocation() { return (java.lang.String) ref; } } + /** * * @@ -13889,6 +14510,7 @@ public java.lang.String getLocation() { * Immutable. The location of the resource. The location encoding is * specific to the service provider, and new encoding may be introduced * as the service evolves. + * * For Google Cloud products, the encoding is what is used by Google Cloud * APIs, such as `us-east1`, `aws-us-east-1`, and `azure-eastus2`. The * semantics of `location` is identical to the @@ -13910,6 +14532,7 @@ public com.google.protobuf.ByteString getLocationBytes() { return (com.google.protobuf.ByteString) ref; } } + /** * * @@ -13917,6 +14540,7 @@ public com.google.protobuf.ByteString getLocationBytes() { * Immutable. The location of the resource. The location encoding is * specific to the service provider, and new encoding may be introduced * as the service evolves. + * * For Google Cloud products, the encoding is what is used by Google Cloud * APIs, such as `us-east1`, `aws-us-east-1`, and `azure-eastus2`. The * semantics of `location` is identical to the @@ -13932,11 +14556,12 @@ public Builder setLocation(java.lang.String value) { if (value == null) { throw new NullPointerException(); } - location_ = value; + bitField0_ |= 0x00000800; onChanged(); return this; } + /** * * @@ -13944,6 +14569,7 @@ public Builder setLocation(java.lang.String value) { * Immutable. The location of the resource. The location encoding is * specific to the service provider, and new encoding may be introduced * as the service evolves. + * * For Google Cloud products, the encoding is what is used by Google Cloud * APIs, such as `us-east1`, `aws-us-east-1`, and `azure-eastus2`. The * semantics of `location` is identical to the @@ -13955,11 +14581,12 @@ public Builder setLocation(java.lang.String value) { * @return This builder for chaining. */ public Builder clearLocation() { - location_ = getDefaultInstance().getLocation(); + bitField0_ = (bitField0_ & ~0x00000800); onChanged(); return this; } + /** * * @@ -13967,6 +14594,7 @@ public Builder clearLocation() { * Immutable. The location of the resource. The location encoding is * specific to the service provider, and new encoding may be introduced * as the service evolves. + * * For Google Cloud products, the encoding is what is used by Google Cloud * APIs, such as `us-east1`, `aws-us-east-1`, and `azure-eastus2`. The * semantics of `location` is identical to the @@ -13983,24 +14611,12 @@ public Builder setLocationBytes(com.google.protobuf.ByteString value) { throw new NullPointerException(); } checkByteStringIsUtf8(value); - location_ = value; + bitField0_ |= 0x00000800; 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.rpc.context.AttributeContext.Resource) } @@ -14053,8 +14669,10 @@ public com.google.rpc.context.AttributeContext.Resource getDefaultInstanceForTyp } } + private int bitField0_; public static final int ORIGIN_FIELD_NUMBER = 7; private com.google.rpc.context.AttributeContext.Peer origin_; + /** * * @@ -14070,8 +14688,9 @@ public com.google.rpc.context.AttributeContext.Resource getDefaultInstanceForTyp */ @java.lang.Override public boolean hasOrigin() { - return origin_ != null; + return ((bitField0_ & 0x00000001) != 0); } + /** * * @@ -14091,6 +14710,7 @@ public com.google.rpc.context.AttributeContext.Peer getOrigin() { ? com.google.rpc.context.AttributeContext.Peer.getDefaultInstance() : origin_; } + /** * * @@ -14104,11 +14724,14 @@ public com.google.rpc.context.AttributeContext.Peer getOrigin() { */ @java.lang.Override public com.google.rpc.context.AttributeContext.PeerOrBuilder getOriginOrBuilder() { - return getOrigin(); + return origin_ == null + ? com.google.rpc.context.AttributeContext.Peer.getDefaultInstance() + : origin_; } public static final int SOURCE_FIELD_NUMBER = 1; private com.google.rpc.context.AttributeContext.Peer source_; + /** * * @@ -14124,8 +14747,9 @@ public com.google.rpc.context.AttributeContext.PeerOrBuilder getOriginOrBuilder( */ @java.lang.Override public boolean hasSource() { - return source_ != null; + return ((bitField0_ & 0x00000002) != 0); } + /** * * @@ -14145,6 +14769,7 @@ public com.google.rpc.context.AttributeContext.Peer getSource() { ? com.google.rpc.context.AttributeContext.Peer.getDefaultInstance() : source_; } + /** * * @@ -14158,11 +14783,14 @@ public com.google.rpc.context.AttributeContext.Peer getSource() { */ @java.lang.Override public com.google.rpc.context.AttributeContext.PeerOrBuilder getSourceOrBuilder() { - return getSource(); + return source_ == null + ? com.google.rpc.context.AttributeContext.Peer.getDefaultInstance() + : source_; } public static final int DESTINATION_FIELD_NUMBER = 2; private com.google.rpc.context.AttributeContext.Peer destination_; + /** * * @@ -14178,8 +14806,9 @@ public com.google.rpc.context.AttributeContext.PeerOrBuilder getSourceOrBuilder( */ @java.lang.Override public boolean hasDestination() { - return destination_ != null; + return ((bitField0_ & 0x00000004) != 0); } + /** * * @@ -14199,6 +14828,7 @@ public com.google.rpc.context.AttributeContext.Peer getDestination() { ? com.google.rpc.context.AttributeContext.Peer.getDefaultInstance() : destination_; } + /** * * @@ -14212,11 +14842,14 @@ public com.google.rpc.context.AttributeContext.Peer getDestination() { */ @java.lang.Override public com.google.rpc.context.AttributeContext.PeerOrBuilder getDestinationOrBuilder() { - return getDestination(); + return destination_ == null + ? com.google.rpc.context.AttributeContext.Peer.getDefaultInstance() + : destination_; } public static final int REQUEST_FIELD_NUMBER = 3; private com.google.rpc.context.AttributeContext.Request request_; + /** * * @@ -14230,8 +14863,9 @@ public com.google.rpc.context.AttributeContext.PeerOrBuilder getDestinationOrBui */ @java.lang.Override public boolean hasRequest() { - return request_ != null; + return ((bitField0_ & 0x00000008) != 0); } + /** * * @@ -14249,6 +14883,7 @@ public com.google.rpc.context.AttributeContext.Request getRequest() { ? com.google.rpc.context.AttributeContext.Request.getDefaultInstance() : request_; } + /** * * @@ -14260,11 +14895,14 @@ public com.google.rpc.context.AttributeContext.Request getRequest() { */ @java.lang.Override public com.google.rpc.context.AttributeContext.RequestOrBuilder getRequestOrBuilder() { - return getRequest(); + return request_ == null + ? com.google.rpc.context.AttributeContext.Request.getDefaultInstance() + : request_; } public static final int RESPONSE_FIELD_NUMBER = 4; private com.google.rpc.context.AttributeContext.Response response_; + /** * * @@ -14278,8 +14916,9 @@ public com.google.rpc.context.AttributeContext.RequestOrBuilder getRequestOrBuil */ @java.lang.Override public boolean hasResponse() { - return response_ != null; + return ((bitField0_ & 0x00000010) != 0); } + /** * * @@ -14297,6 +14936,7 @@ public com.google.rpc.context.AttributeContext.Response getResponse() { ? com.google.rpc.context.AttributeContext.Response.getDefaultInstance() : response_; } + /** * * @@ -14308,11 +14948,14 @@ public com.google.rpc.context.AttributeContext.Response getResponse() { */ @java.lang.Override public com.google.rpc.context.AttributeContext.ResponseOrBuilder getResponseOrBuilder() { - return getResponse(); + return response_ == null + ? com.google.rpc.context.AttributeContext.Response.getDefaultInstance() + : response_; } public static final int RESOURCE_FIELD_NUMBER = 5; private com.google.rpc.context.AttributeContext.Resource resource_; + /** * * @@ -14328,8 +14971,9 @@ public com.google.rpc.context.AttributeContext.ResponseOrBuilder getResponseOrBu */ @java.lang.Override public boolean hasResource() { - return resource_ != null; + return ((bitField0_ & 0x00000020) != 0); } + /** * * @@ -14349,6 +14993,7 @@ public com.google.rpc.context.AttributeContext.Resource getResource() { ? com.google.rpc.context.AttributeContext.Resource.getDefaultInstance() : resource_; } + /** * * @@ -14362,11 +15007,14 @@ public com.google.rpc.context.AttributeContext.Resource getResource() { */ @java.lang.Override public com.google.rpc.context.AttributeContext.ResourceOrBuilder getResourceOrBuilder() { - return getResource(); + return resource_ == null + ? com.google.rpc.context.AttributeContext.Resource.getDefaultInstance() + : resource_; } public static final int API_FIELD_NUMBER = 6; private com.google.rpc.context.AttributeContext.Api api_; + /** * * @@ -14380,8 +15028,9 @@ public com.google.rpc.context.AttributeContext.ResourceOrBuilder getResourceOrBu */ @java.lang.Override public boolean hasApi() { - return api_ != null; + return ((bitField0_ & 0x00000040) != 0); } + /** * * @@ -14397,6 +15046,7 @@ public boolean hasApi() { public com.google.rpc.context.AttributeContext.Api getApi() { return api_ == null ? com.google.rpc.context.AttributeContext.Api.getDefaultInstance() : api_; } + /** * * @@ -14408,11 +15058,14 @@ public com.google.rpc.context.AttributeContext.Api getApi() { */ @java.lang.Override public com.google.rpc.context.AttributeContext.ApiOrBuilder getApiOrBuilder() { - return getApi(); + return api_ == null ? com.google.rpc.context.AttributeContext.Api.getDefaultInstance() : api_; } public static final int EXTENSIONS_FIELD_NUMBER = 8; + + @SuppressWarnings("serial") private java.util.List extensions_; + /** * * @@ -14426,6 +15079,7 @@ public com.google.rpc.context.AttributeContext.ApiOrBuilder getApiOrBuilder() { public java.util.List getExtensionsList() { return extensions_; } + /** * * @@ -14439,6 +15093,7 @@ public java.util.List getExtensionsList() { public java.util.List getExtensionsOrBuilderList() { return extensions_; } + /** * * @@ -14452,6 +15107,7 @@ public java.util.List getExtensionsO public int getExtensionsCount() { return extensions_.size(); } + /** * * @@ -14465,6 +15121,7 @@ public int getExtensionsCount() { public com.google.protobuf.Any getExtensions(int index) { return extensions_.get(index); } + /** * * @@ -14493,25 +15150,25 @@ public final boolean isInitialized() { @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (source_ != null) { + if (((bitField0_ & 0x00000002) != 0)) { output.writeMessage(1, getSource()); } - if (destination_ != null) { + if (((bitField0_ & 0x00000004) != 0)) { output.writeMessage(2, getDestination()); } - if (request_ != null) { + if (((bitField0_ & 0x00000008) != 0)) { output.writeMessage(3, getRequest()); } - if (response_ != null) { + if (((bitField0_ & 0x00000010) != 0)) { output.writeMessage(4, getResponse()); } - if (resource_ != null) { + if (((bitField0_ & 0x00000020) != 0)) { output.writeMessage(5, getResource()); } - if (api_ != null) { + if (((bitField0_ & 0x00000040) != 0)) { output.writeMessage(6, getApi()); } - if (origin_ != null) { + if (((bitField0_ & 0x00000001) != 0)) { output.writeMessage(7, getOrigin()); } for (int i = 0; i < extensions_.size(); i++) { @@ -14526,25 +15183,25 @@ public int getSerializedSize() { if (size != -1) return size; size = 0; - if (source_ != null) { + if (((bitField0_ & 0x00000002) != 0)) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getSource()); } - if (destination_ != null) { + if (((bitField0_ & 0x00000004) != 0)) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getDestination()); } - if (request_ != null) { + if (((bitField0_ & 0x00000008) != 0)) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getRequest()); } - if (response_ != null) { + if (((bitField0_ & 0x00000010) != 0)) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, getResponse()); } - if (resource_ != null) { + if (((bitField0_ & 0x00000020) != 0)) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(5, getResource()); } - if (api_ != null) { + if (((bitField0_ & 0x00000040) != 0)) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(6, getApi()); } - if (origin_ != null) { + if (((bitField0_ & 0x00000001) != 0)) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(7, getOrigin()); } for (int i = 0; i < extensions_.size(); i++) { @@ -14679,38 +15336,38 @@ public static com.google.rpc.context.AttributeContext parseFrom( public static com.google.rpc.context.AttributeContext parseFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); } public static com.google.rpc.context.AttributeContext parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } public static com.google.rpc.context.AttributeContext parseDelimitedFrom( java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); } public static com.google.rpc.context.AttributeContext parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( PARSER, input, extensionRegistry); } public static com.google.rpc.context.AttributeContext parseFrom( com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); } public static com.google.rpc.context.AttributeContext parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } @@ -14733,24 +15390,29 @@ public Builder toBuilder() { } @java.lang.Override - protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { Builder builder = new Builder(parent); return builder; } + /** * * *
            * This message defines the standard attribute vocabulary for Google APIs.
        +   *
            * An attribute is a piece of metadata that describes an activity on a network
            * service. For example, the size of an HTTP request, or the status code of
            * an HTTP response.
        +   *
            * Each attribute has a type and a name, which is logically defined as
            * a proto message field in `AttributeContext`. The field type becomes the
            * attribute type, and the field path becomes the attribute name. For example,
            * the attribute `source.ip` maps to field `AttributeContext.source.ip`.
        +   *
            * This message definition is guaranteed not to have any wire breaking change.
            * So you can use it directly for passing attributes across different systems.
        +   *
            * NOTE: Different system may generate different subset of attributes. Please
            * verify the system specification before relying on an attribute generated
            * a system.
        @@ -14758,7 +15420,7 @@ protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.Build
            *
            * Protobuf type {@code google.rpc.context.AttributeContext}
            */
        -  public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder
        +  public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder
               implements
               // @@protoc_insertion_point(builder_implements:google.rpc.context.AttributeContext)
               com.google.rpc.context.AttributeContextOrBuilder {
        @@ -14768,7 +15430,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
             }
         
             @java.lang.Override
        -    protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
        +    protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
                 internalGetFieldAccessorTable() {
               return com.google.rpc.context.AttributeContextProto
                   .internal_static_google_rpc_context_AttributeContext_fieldAccessorTable
        @@ -14778,55 +15440,65 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
             }
         
             // Construct using com.google.rpc.context.AttributeContext.newBuilder()
        -    private Builder() {}
        +    private Builder() {
        +      maybeForceBuilderInitialization();
        +    }
         
        -    private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
        +    private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) {
               super(parent);
        +      maybeForceBuilderInitialization();
        +    }
        +
        +    private void maybeForceBuilderInitialization() {
        +      if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) {
        +        internalGetOriginFieldBuilder();
        +        internalGetSourceFieldBuilder();
        +        internalGetDestinationFieldBuilder();
        +        internalGetRequestFieldBuilder();
        +        internalGetResponseFieldBuilder();
        +        internalGetResourceFieldBuilder();
        +        internalGetApiFieldBuilder();
        +        internalGetExtensionsFieldBuilder();
        +      }
             }
         
             @java.lang.Override
             public Builder clear() {
               super.clear();
        -      if (originBuilder_ == null) {
        -        origin_ = null;
        -      } else {
        -        origin_ = null;
        +      bitField0_ = 0;
        +      origin_ = null;
        +      if (originBuilder_ != null) {
        +        originBuilder_.dispose();
                 originBuilder_ = null;
               }
        -      if (sourceBuilder_ == null) {
        -        source_ = null;
        -      } else {
        -        source_ = null;
        +      source_ = null;
        +      if (sourceBuilder_ != null) {
        +        sourceBuilder_.dispose();
                 sourceBuilder_ = null;
               }
        -      if (destinationBuilder_ == null) {
        -        destination_ = null;
        -      } else {
        -        destination_ = null;
        +      destination_ = null;
        +      if (destinationBuilder_ != null) {
        +        destinationBuilder_.dispose();
                 destinationBuilder_ = null;
               }
        -      if (requestBuilder_ == null) {
        -        request_ = null;
        -      } else {
        -        request_ = null;
        +      request_ = null;
        +      if (requestBuilder_ != null) {
        +        requestBuilder_.dispose();
                 requestBuilder_ = null;
               }
        -      if (responseBuilder_ == null) {
        -        response_ = null;
        -      } else {
        -        response_ = null;
        +      response_ = null;
        +      if (responseBuilder_ != null) {
        +        responseBuilder_.dispose();
                 responseBuilder_ = null;
               }
        -      if (resourceBuilder_ == null) {
        -        resource_ = null;
        -      } else {
        -        resource_ = null;
        +      resource_ = null;
        +      if (resourceBuilder_ != null) {
        +        resourceBuilder_.dispose();
                 resourceBuilder_ = null;
               }
        -      if (apiBuilder_ == null) {
        -        api_ = null;
        -      } else {
        -        api_ = null;
        +      api_ = null;
        +      if (apiBuilder_ != null) {
        +        apiBuilder_.dispose();
                 apiBuilder_ = null;
               }
               if (extensionsBuilder_ == null) {
        @@ -14835,7 +15507,7 @@ public Builder clear() {
                 extensions_ = null;
                 extensionsBuilder_.clear();
               }
        -      bitField0_ = (bitField0_ & ~0x00000001);
        +      bitField0_ = (bitField0_ & ~0x00000080);
               return this;
             }
         
        @@ -14863,86 +15535,59 @@ public com.google.rpc.context.AttributeContext build() {
             public com.google.rpc.context.AttributeContext buildPartial() {
               com.google.rpc.context.AttributeContext result =
                   new com.google.rpc.context.AttributeContext(this);
        -      int from_bitField0_ = bitField0_;
        -      if (originBuilder_ == null) {
        -        result.origin_ = origin_;
        -      } else {
        -        result.origin_ = originBuilder_.build();
        -      }
        -      if (sourceBuilder_ == null) {
        -        result.source_ = source_;
        -      } else {
        -        result.source_ = sourceBuilder_.build();
        -      }
        -      if (destinationBuilder_ == null) {
        -        result.destination_ = destination_;
        -      } else {
        -        result.destination_ = destinationBuilder_.build();
        -      }
        -      if (requestBuilder_ == null) {
        -        result.request_ = request_;
        -      } else {
        -        result.request_ = requestBuilder_.build();
        -      }
        -      if (responseBuilder_ == null) {
        -        result.response_ = response_;
        -      } else {
        -        result.response_ = responseBuilder_.build();
        -      }
        -      if (resourceBuilder_ == null) {
        -        result.resource_ = resource_;
        -      } else {
        -        result.resource_ = resourceBuilder_.build();
        -      }
        -      if (apiBuilder_ == null) {
        -        result.api_ = api_;
        -      } else {
        -        result.api_ = apiBuilder_.build();
        +      buildPartialRepeatedFields(result);
        +      if (bitField0_ != 0) {
        +        buildPartial0(result);
               }
        +      onBuilt();
        +      return result;
        +    }
        +
        +    private void buildPartialRepeatedFields(com.google.rpc.context.AttributeContext result) {
               if (extensionsBuilder_ == null) {
        -        if (((bitField0_ & 0x00000001) != 0)) {
        +        if (((bitField0_ & 0x00000080) != 0)) {
                   extensions_ = java.util.Collections.unmodifiableList(extensions_);
        -          bitField0_ = (bitField0_ & ~0x00000001);
        +          bitField0_ = (bitField0_ & ~0x00000080);
                 }
                 result.extensions_ = extensions_;
               } else {
                 result.extensions_ = extensionsBuilder_.build();
               }
        -      onBuilt();
        -      return result;
        -    }
        -
        -    @java.lang.Override
        -    public Builder clone() {
        -      return super.clone();
        -    }
        -
        -    @java.lang.Override
        -    public Builder setField(
        -        com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) {
        -      return super.setField(field, value);
             }
         
        -    @java.lang.Override
        -    public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) {
        -      return super.clearField(field);
        -    }
        -
        -    @java.lang.Override
        -    public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) {
        -      return super.clearOneof(oneof);
        -    }
        -
        -    @java.lang.Override
        -    public Builder setRepeatedField(
        -        com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) {
        -      return super.setRepeatedField(field, index, value);
        -    }
        -
        -    @java.lang.Override
        -    public Builder addRepeatedField(
        -        com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) {
        -      return super.addRepeatedField(field, value);
        +    private void buildPartial0(com.google.rpc.context.AttributeContext result) {
        +      int from_bitField0_ = bitField0_;
        +      int to_bitField0_ = 0;
        +      if (((from_bitField0_ & 0x00000001) != 0)) {
        +        result.origin_ = originBuilder_ == null ? origin_ : originBuilder_.build();
        +        to_bitField0_ |= 0x00000001;
        +      }
        +      if (((from_bitField0_ & 0x00000002) != 0)) {
        +        result.source_ = sourceBuilder_ == null ? source_ : sourceBuilder_.build();
        +        to_bitField0_ |= 0x00000002;
        +      }
        +      if (((from_bitField0_ & 0x00000004) != 0)) {
        +        result.destination_ =
        +            destinationBuilder_ == null ? destination_ : destinationBuilder_.build();
        +        to_bitField0_ |= 0x00000004;
        +      }
        +      if (((from_bitField0_ & 0x00000008) != 0)) {
        +        result.request_ = requestBuilder_ == null ? request_ : requestBuilder_.build();
        +        to_bitField0_ |= 0x00000008;
        +      }
        +      if (((from_bitField0_ & 0x00000010) != 0)) {
        +        result.response_ = responseBuilder_ == null ? response_ : responseBuilder_.build();
        +        to_bitField0_ |= 0x00000010;
        +      }
        +      if (((from_bitField0_ & 0x00000020) != 0)) {
        +        result.resource_ = resourceBuilder_ == null ? resource_ : resourceBuilder_.build();
        +        to_bitField0_ |= 0x00000020;
        +      }
        +      if (((from_bitField0_ & 0x00000040) != 0)) {
        +        result.api_ = apiBuilder_ == null ? api_ : apiBuilder_.build();
        +        to_bitField0_ |= 0x00000040;
        +      }
        +      result.bitField0_ |= to_bitField0_;
             }
         
             @java.lang.Override
        @@ -14982,7 +15627,7 @@ public Builder mergeFrom(com.google.rpc.context.AttributeContext other) {
                 if (!other.extensions_.isEmpty()) {
                   if (extensions_.isEmpty()) {
                     extensions_ = other.extensions_;
        -            bitField0_ = (bitField0_ & ~0x00000001);
        +            bitField0_ = (bitField0_ & ~0x00000080);
                   } else {
                     ensureExtensionsIsMutable();
                     extensions_.addAll(other.extensions_);
        @@ -14995,10 +15640,10 @@ public Builder mergeFrom(com.google.rpc.context.AttributeContext other) {
                     extensionsBuilder_.dispose();
                     extensionsBuilder_ = null;
                     extensions_ = other.extensions_;
        -            bitField0_ = (bitField0_ & ~0x00000001);
        +            bitField0_ = (bitField0_ & ~0x00000080);
                     extensionsBuilder_ =
        -                com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders
        -                    ? getExtensionsFieldBuilder()
        +                com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders
        +                    ? internalGetExtensionsFieldBuilder()
                             : null;
                   } else {
                     extensionsBuilder_.addAllMessages(other.extensions_);
        @@ -15033,44 +15678,47 @@ public Builder mergeFrom(
                       break;
                     case 10:
                       {
        -                input.readMessage(getSourceFieldBuilder().getBuilder(), extensionRegistry);
        -
        +                input.readMessage(internalGetSourceFieldBuilder().getBuilder(), extensionRegistry);
        +                bitField0_ |= 0x00000002;
                         break;
                       } // case 10
                     case 18:
                       {
        -                input.readMessage(getDestinationFieldBuilder().getBuilder(), extensionRegistry);
        -
        +                input.readMessage(
        +                    internalGetDestinationFieldBuilder().getBuilder(), extensionRegistry);
        +                bitField0_ |= 0x00000004;
                         break;
                       } // case 18
                     case 26:
                       {
        -                input.readMessage(getRequestFieldBuilder().getBuilder(), extensionRegistry);
        -
        +                input.readMessage(internalGetRequestFieldBuilder().getBuilder(), extensionRegistry);
        +                bitField0_ |= 0x00000008;
                         break;
                       } // case 26
                     case 34:
                       {
        -                input.readMessage(getResponseFieldBuilder().getBuilder(), extensionRegistry);
        -
        +                input.readMessage(
        +                    internalGetResponseFieldBuilder().getBuilder(), extensionRegistry);
        +                bitField0_ |= 0x00000010;
                         break;
                       } // case 34
                     case 42:
                       {
        -                input.readMessage(getResourceFieldBuilder().getBuilder(), extensionRegistry);
        -
        +                input.readMessage(
        +                    internalGetResourceFieldBuilder().getBuilder(), extensionRegistry);
        +                bitField0_ |= 0x00000020;
                         break;
                       } // case 42
                     case 50:
                       {
        -                input.readMessage(getApiFieldBuilder().getBuilder(), extensionRegistry);
        -
        +                input.readMessage(internalGetApiFieldBuilder().getBuilder(), extensionRegistry);
        +                bitField0_ |= 0x00000040;
                         break;
                       } // case 50
                     case 58:
                       {
        -                input.readMessage(getOriginFieldBuilder().getBuilder(), extensionRegistry);
        -
        +                input.readMessage(internalGetOriginFieldBuilder().getBuilder(), extensionRegistry);
        +                bitField0_ |= 0x00000001;
                         break;
                       } // case 58
                     case 66:
        @@ -15105,11 +15753,12 @@ public Builder mergeFrom(
             private int bitField0_;
         
             private com.google.rpc.context.AttributeContext.Peer origin_;
        -    private com.google.protobuf.SingleFieldBuilderV3<
        +    private com.google.protobuf.SingleFieldBuilder<
                     com.google.rpc.context.AttributeContext.Peer,
                     com.google.rpc.context.AttributeContext.Peer.Builder,
                     com.google.rpc.context.AttributeContext.PeerOrBuilder>
                 originBuilder_;
        +
             /**
              *
              *
        @@ -15124,8 +15773,9 @@ public Builder mergeFrom(
              * @return Whether the origin field is set.
              */
             public boolean hasOrigin() {
        -      return originBuilder_ != null || origin_ != null;
        +      return ((bitField0_ & 0x00000001) != 0);
             }
        +
             /**
              *
              *
        @@ -15148,6 +15798,7 @@ public com.google.rpc.context.AttributeContext.Peer getOrigin() {
                 return originBuilder_.getMessage();
               }
             }
        +
             /**
              *
              *
        @@ -15165,13 +15816,14 @@ public Builder setOrigin(com.google.rpc.context.AttributeContext.Peer value) {
                   throw new NullPointerException();
                 }
                 origin_ = value;
        -        onChanged();
               } else {
                 originBuilder_.setMessage(value);
               }
        -
        +      bitField0_ |= 0x00000001;
        +      onChanged();
               return this;
             }
        +
             /**
              *
              *
        @@ -15186,13 +15838,14 @@ public Builder setOrigin(com.google.rpc.context.AttributeContext.Peer value) {
             public Builder setOrigin(com.google.rpc.context.AttributeContext.Peer.Builder builderForValue) {
               if (originBuilder_ == null) {
                 origin_ = builderForValue.build();
        -        onChanged();
               } else {
                 originBuilder_.setMessage(builderForValue.build());
               }
        -
        +      bitField0_ |= 0x00000001;
        +      onChanged();
               return this;
             }
        +
             /**
              *
              *
        @@ -15206,21 +15859,23 @@ public Builder setOrigin(com.google.rpc.context.AttributeContext.Peer.Builder bu
              */
             public Builder mergeOrigin(com.google.rpc.context.AttributeContext.Peer value) {
               if (originBuilder_ == null) {
        -        if (origin_ != null) {
        -          origin_ =
        -              com.google.rpc.context.AttributeContext.Peer.newBuilder(origin_)
        -                  .mergeFrom(value)
        -                  .buildPartial();
        +        if (((bitField0_ & 0x00000001) != 0)
        +            && origin_ != null
        +            && origin_ != com.google.rpc.context.AttributeContext.Peer.getDefaultInstance()) {
        +          getOriginBuilder().mergeFrom(value);
                 } else {
                   origin_ = value;
                 }
        -        onChanged();
               } else {
                 originBuilder_.mergeFrom(value);
               }
        -
        +      if (origin_ != null) {
        +        bitField0_ |= 0x00000001;
        +        onChanged();
        +      }
               return this;
             }
        +
             /**
              *
              *
        @@ -15233,16 +15888,16 @@ public Builder mergeOrigin(com.google.rpc.context.AttributeContext.Peer value) {
              * .google.rpc.context.AttributeContext.Peer origin = 7;
              */
             public Builder clearOrigin() {
        -      if (originBuilder_ == null) {
        -        origin_ = null;
        -        onChanged();
        -      } else {
        -        origin_ = null;
        +      bitField0_ = (bitField0_ & ~0x00000001);
        +      origin_ = null;
        +      if (originBuilder_ != null) {
        +        originBuilder_.dispose();
                 originBuilder_ = null;
               }
        -
        +      onChanged();
               return this;
             }
        +
             /**
              *
              *
        @@ -15255,10 +15910,11 @@ public Builder clearOrigin() {
              * .google.rpc.context.AttributeContext.Peer origin = 7;
              */
             public com.google.rpc.context.AttributeContext.Peer.Builder getOriginBuilder() {
        -
        +      bitField0_ |= 0x00000001;
               onChanged();
        -      return getOriginFieldBuilder().getBuilder();
        +      return internalGetOriginFieldBuilder().getBuilder();
             }
        +
             /**
              *
              *
        @@ -15279,6 +15935,7 @@ public com.google.rpc.context.AttributeContext.PeerOrBuilder getOriginOrBuilder(
                     : origin_;
               }
             }
        +
             /**
              *
              *
        @@ -15290,14 +15947,14 @@ public com.google.rpc.context.AttributeContext.PeerOrBuilder getOriginOrBuilder(
              *
              * .google.rpc.context.AttributeContext.Peer origin = 7;
              */
        -    private com.google.protobuf.SingleFieldBuilderV3<
        +    private com.google.protobuf.SingleFieldBuilder<
                     com.google.rpc.context.AttributeContext.Peer,
                     com.google.rpc.context.AttributeContext.Peer.Builder,
                     com.google.rpc.context.AttributeContext.PeerOrBuilder>
        -        getOriginFieldBuilder() {
        +        internalGetOriginFieldBuilder() {
               if (originBuilder_ == null) {
                 originBuilder_ =
        -            new com.google.protobuf.SingleFieldBuilderV3<
        +            new com.google.protobuf.SingleFieldBuilder<
                         com.google.rpc.context.AttributeContext.Peer,
                         com.google.rpc.context.AttributeContext.Peer.Builder,
                         com.google.rpc.context.AttributeContext.PeerOrBuilder>(
        @@ -15308,11 +15965,12 @@ public com.google.rpc.context.AttributeContext.PeerOrBuilder getOriginOrBuilder(
             }
         
             private com.google.rpc.context.AttributeContext.Peer source_;
        -    private com.google.protobuf.SingleFieldBuilderV3<
        +    private com.google.protobuf.SingleFieldBuilder<
                     com.google.rpc.context.AttributeContext.Peer,
                     com.google.rpc.context.AttributeContext.Peer.Builder,
                     com.google.rpc.context.AttributeContext.PeerOrBuilder>
                 sourceBuilder_;
        +
             /**
              *
              *
        @@ -15327,8 +15985,9 @@ public com.google.rpc.context.AttributeContext.PeerOrBuilder getOriginOrBuilder(
              * @return Whether the source field is set.
              */
             public boolean hasSource() {
        -      return sourceBuilder_ != null || source_ != null;
        +      return ((bitField0_ & 0x00000002) != 0);
             }
        +
             /**
              *
              *
        @@ -15351,6 +16010,7 @@ public com.google.rpc.context.AttributeContext.Peer getSource() {
                 return sourceBuilder_.getMessage();
               }
             }
        +
             /**
              *
              *
        @@ -15368,13 +16028,14 @@ public Builder setSource(com.google.rpc.context.AttributeContext.Peer value) {
                   throw new NullPointerException();
                 }
                 source_ = value;
        -        onChanged();
               } else {
                 sourceBuilder_.setMessage(value);
               }
        -
        +      bitField0_ |= 0x00000002;
        +      onChanged();
               return this;
             }
        +
             /**
              *
              *
        @@ -15389,13 +16050,14 @@ public Builder setSource(com.google.rpc.context.AttributeContext.Peer value) {
             public Builder setSource(com.google.rpc.context.AttributeContext.Peer.Builder builderForValue) {
               if (sourceBuilder_ == null) {
                 source_ = builderForValue.build();
        -        onChanged();
               } else {
                 sourceBuilder_.setMessage(builderForValue.build());
               }
        -
        +      bitField0_ |= 0x00000002;
        +      onChanged();
               return this;
             }
        +
             /**
              *
              *
        @@ -15409,21 +16071,23 @@ public Builder setSource(com.google.rpc.context.AttributeContext.Peer.Builder bu
              */
             public Builder mergeSource(com.google.rpc.context.AttributeContext.Peer value) {
               if (sourceBuilder_ == null) {
        -        if (source_ != null) {
        -          source_ =
        -              com.google.rpc.context.AttributeContext.Peer.newBuilder(source_)
        -                  .mergeFrom(value)
        -                  .buildPartial();
        +        if (((bitField0_ & 0x00000002) != 0)
        +            && source_ != null
        +            && source_ != com.google.rpc.context.AttributeContext.Peer.getDefaultInstance()) {
        +          getSourceBuilder().mergeFrom(value);
                 } else {
                   source_ = value;
                 }
        -        onChanged();
               } else {
                 sourceBuilder_.mergeFrom(value);
               }
        -
        +      if (source_ != null) {
        +        bitField0_ |= 0x00000002;
        +        onChanged();
        +      }
               return this;
             }
        +
             /**
              *
              *
        @@ -15436,16 +16100,16 @@ public Builder mergeSource(com.google.rpc.context.AttributeContext.Peer value) {
              * .google.rpc.context.AttributeContext.Peer source = 1;
              */
             public Builder clearSource() {
        -      if (sourceBuilder_ == null) {
        -        source_ = null;
        -        onChanged();
        -      } else {
        -        source_ = null;
        +      bitField0_ = (bitField0_ & ~0x00000002);
        +      source_ = null;
        +      if (sourceBuilder_ != null) {
        +        sourceBuilder_.dispose();
                 sourceBuilder_ = null;
               }
        -
        +      onChanged();
               return this;
             }
        +
             /**
              *
              *
        @@ -15458,10 +16122,11 @@ public Builder clearSource() {
              * .google.rpc.context.AttributeContext.Peer source = 1;
              */
             public com.google.rpc.context.AttributeContext.Peer.Builder getSourceBuilder() {
        -
        +      bitField0_ |= 0x00000002;
               onChanged();
        -      return getSourceFieldBuilder().getBuilder();
        +      return internalGetSourceFieldBuilder().getBuilder();
             }
        +
             /**
              *
              *
        @@ -15482,6 +16147,7 @@ public com.google.rpc.context.AttributeContext.PeerOrBuilder getSourceOrBuilder(
                     : source_;
               }
             }
        +
             /**
              *
              *
        @@ -15493,14 +16159,14 @@ public com.google.rpc.context.AttributeContext.PeerOrBuilder getSourceOrBuilder(
              *
              * .google.rpc.context.AttributeContext.Peer source = 1;
              */
        -    private com.google.protobuf.SingleFieldBuilderV3<
        +    private com.google.protobuf.SingleFieldBuilder<
                     com.google.rpc.context.AttributeContext.Peer,
                     com.google.rpc.context.AttributeContext.Peer.Builder,
                     com.google.rpc.context.AttributeContext.PeerOrBuilder>
        -        getSourceFieldBuilder() {
        +        internalGetSourceFieldBuilder() {
               if (sourceBuilder_ == null) {
                 sourceBuilder_ =
        -            new com.google.protobuf.SingleFieldBuilderV3<
        +            new com.google.protobuf.SingleFieldBuilder<
                         com.google.rpc.context.AttributeContext.Peer,
                         com.google.rpc.context.AttributeContext.Peer.Builder,
                         com.google.rpc.context.AttributeContext.PeerOrBuilder>(
        @@ -15511,11 +16177,12 @@ public com.google.rpc.context.AttributeContext.PeerOrBuilder getSourceOrBuilder(
             }
         
             private com.google.rpc.context.AttributeContext.Peer destination_;
        -    private com.google.protobuf.SingleFieldBuilderV3<
        +    private com.google.protobuf.SingleFieldBuilder<
                     com.google.rpc.context.AttributeContext.Peer,
                     com.google.rpc.context.AttributeContext.Peer.Builder,
                     com.google.rpc.context.AttributeContext.PeerOrBuilder>
                 destinationBuilder_;
        +
             /**
              *
              *
        @@ -15530,8 +16197,9 @@ public com.google.rpc.context.AttributeContext.PeerOrBuilder getSourceOrBuilder(
              * @return Whether the destination field is set.
              */
             public boolean hasDestination() {
        -      return destinationBuilder_ != null || destination_ != null;
        +      return ((bitField0_ & 0x00000004) != 0);
             }
        +
             /**
              *
              *
        @@ -15554,6 +16222,7 @@ public com.google.rpc.context.AttributeContext.Peer getDestination() {
                 return destinationBuilder_.getMessage();
               }
             }
        +
             /**
              *
              *
        @@ -15571,13 +16240,14 @@ public Builder setDestination(com.google.rpc.context.AttributeContext.Peer value
                   throw new NullPointerException();
                 }
                 destination_ = value;
        -        onChanged();
               } else {
                 destinationBuilder_.setMessage(value);
               }
        -
        +      bitField0_ |= 0x00000004;
        +      onChanged();
               return this;
             }
        +
             /**
              *
              *
        @@ -15593,13 +16263,14 @@ public Builder setDestination(
                 com.google.rpc.context.AttributeContext.Peer.Builder builderForValue) {
               if (destinationBuilder_ == null) {
                 destination_ = builderForValue.build();
        -        onChanged();
               } else {
                 destinationBuilder_.setMessage(builderForValue.build());
               }
        -
        +      bitField0_ |= 0x00000004;
        +      onChanged();
               return this;
             }
        +
             /**
              *
              *
        @@ -15613,21 +16284,23 @@ public Builder setDestination(
              */
             public Builder mergeDestination(com.google.rpc.context.AttributeContext.Peer value) {
               if (destinationBuilder_ == null) {
        -        if (destination_ != null) {
        -          destination_ =
        -              com.google.rpc.context.AttributeContext.Peer.newBuilder(destination_)
        -                  .mergeFrom(value)
        -                  .buildPartial();
        +        if (((bitField0_ & 0x00000004) != 0)
        +            && destination_ != null
        +            && destination_ != com.google.rpc.context.AttributeContext.Peer.getDefaultInstance()) {
        +          getDestinationBuilder().mergeFrom(value);
                 } else {
                   destination_ = value;
                 }
        -        onChanged();
               } else {
                 destinationBuilder_.mergeFrom(value);
               }
        -
        +      if (destination_ != null) {
        +        bitField0_ |= 0x00000004;
        +        onChanged();
        +      }
               return this;
             }
        +
             /**
              *
              *
        @@ -15640,16 +16313,16 @@ public Builder mergeDestination(com.google.rpc.context.AttributeContext.Peer val
              * .google.rpc.context.AttributeContext.Peer destination = 2;
              */
             public Builder clearDestination() {
        -      if (destinationBuilder_ == null) {
        -        destination_ = null;
        -        onChanged();
        -      } else {
        -        destination_ = null;
        +      bitField0_ = (bitField0_ & ~0x00000004);
        +      destination_ = null;
        +      if (destinationBuilder_ != null) {
        +        destinationBuilder_.dispose();
                 destinationBuilder_ = null;
               }
        -
        +      onChanged();
               return this;
             }
        +
             /**
              *
              *
        @@ -15662,10 +16335,11 @@ public Builder clearDestination() {
              * .google.rpc.context.AttributeContext.Peer destination = 2;
              */
             public com.google.rpc.context.AttributeContext.Peer.Builder getDestinationBuilder() {
        -
        +      bitField0_ |= 0x00000004;
               onChanged();
        -      return getDestinationFieldBuilder().getBuilder();
        +      return internalGetDestinationFieldBuilder().getBuilder();
             }
        +
             /**
              *
              *
        @@ -15686,6 +16360,7 @@ public com.google.rpc.context.AttributeContext.PeerOrBuilder getDestinationOrBui
                     : destination_;
               }
             }
        +
             /**
              *
              *
        @@ -15697,14 +16372,14 @@ public com.google.rpc.context.AttributeContext.PeerOrBuilder getDestinationOrBui
              *
              * .google.rpc.context.AttributeContext.Peer destination = 2;
              */
        -    private com.google.protobuf.SingleFieldBuilderV3<
        +    private com.google.protobuf.SingleFieldBuilder<
                     com.google.rpc.context.AttributeContext.Peer,
                     com.google.rpc.context.AttributeContext.Peer.Builder,
                     com.google.rpc.context.AttributeContext.PeerOrBuilder>
        -        getDestinationFieldBuilder() {
        +        internalGetDestinationFieldBuilder() {
               if (destinationBuilder_ == null) {
                 destinationBuilder_ =
        -            new com.google.protobuf.SingleFieldBuilderV3<
        +            new com.google.protobuf.SingleFieldBuilder<
                         com.google.rpc.context.AttributeContext.Peer,
                         com.google.rpc.context.AttributeContext.Peer.Builder,
                         com.google.rpc.context.AttributeContext.PeerOrBuilder>(
        @@ -15715,11 +16390,12 @@ public com.google.rpc.context.AttributeContext.PeerOrBuilder getDestinationOrBui
             }
         
             private com.google.rpc.context.AttributeContext.Request request_;
        -    private com.google.protobuf.SingleFieldBuilderV3<
        +    private com.google.protobuf.SingleFieldBuilder<
                     com.google.rpc.context.AttributeContext.Request,
                     com.google.rpc.context.AttributeContext.Request.Builder,
                     com.google.rpc.context.AttributeContext.RequestOrBuilder>
                 requestBuilder_;
        +
             /**
              *
              *
        @@ -15732,8 +16408,9 @@ public com.google.rpc.context.AttributeContext.PeerOrBuilder getDestinationOrBui
              * @return Whether the request field is set.
              */
             public boolean hasRequest() {
        -      return requestBuilder_ != null || request_ != null;
        +      return ((bitField0_ & 0x00000008) != 0);
             }
        +
             /**
              *
              *
        @@ -15754,6 +16431,7 @@ public com.google.rpc.context.AttributeContext.Request getRequest() {
                 return requestBuilder_.getMessage();
               }
             }
        +
             /**
              *
              *
        @@ -15769,13 +16447,14 @@ public Builder setRequest(com.google.rpc.context.AttributeContext.Request value)
                   throw new NullPointerException();
                 }
                 request_ = value;
        -        onChanged();
               } else {
                 requestBuilder_.setMessage(value);
               }
        -
        +      bitField0_ |= 0x00000008;
        +      onChanged();
               return this;
             }
        +
             /**
              *
              *
        @@ -15789,13 +16468,14 @@ public Builder setRequest(
                 com.google.rpc.context.AttributeContext.Request.Builder builderForValue) {
               if (requestBuilder_ == null) {
                 request_ = builderForValue.build();
        -        onChanged();
               } else {
                 requestBuilder_.setMessage(builderForValue.build());
               }
        -
        +      bitField0_ |= 0x00000008;
        +      onChanged();
               return this;
             }
        +
             /**
              *
              *
        @@ -15807,21 +16487,23 @@ public Builder setRequest(
              */
             public Builder mergeRequest(com.google.rpc.context.AttributeContext.Request value) {
               if (requestBuilder_ == null) {
        -        if (request_ != null) {
        -          request_ =
        -              com.google.rpc.context.AttributeContext.Request.newBuilder(request_)
        -                  .mergeFrom(value)
        -                  .buildPartial();
        +        if (((bitField0_ & 0x00000008) != 0)
        +            && request_ != null
        +            && request_ != com.google.rpc.context.AttributeContext.Request.getDefaultInstance()) {
        +          getRequestBuilder().mergeFrom(value);
                 } else {
                   request_ = value;
                 }
        -        onChanged();
               } else {
                 requestBuilder_.mergeFrom(value);
               }
        -
        +      if (request_ != null) {
        +        bitField0_ |= 0x00000008;
        +        onChanged();
        +      }
               return this;
             }
        +
             /**
              *
              *
        @@ -15832,16 +16514,16 @@ public Builder mergeRequest(com.google.rpc.context.AttributeContext.Request valu
              * .google.rpc.context.AttributeContext.Request request = 3;
              */
             public Builder clearRequest() {
        -      if (requestBuilder_ == null) {
        -        request_ = null;
        -        onChanged();
        -      } else {
        -        request_ = null;
        +      bitField0_ = (bitField0_ & ~0x00000008);
        +      request_ = null;
        +      if (requestBuilder_ != null) {
        +        requestBuilder_.dispose();
                 requestBuilder_ = null;
               }
        -
        +      onChanged();
               return this;
             }
        +
             /**
              *
              *
        @@ -15852,10 +16534,11 @@ public Builder clearRequest() {
              * .google.rpc.context.AttributeContext.Request request = 3;
              */
             public com.google.rpc.context.AttributeContext.Request.Builder getRequestBuilder() {
        -
        +      bitField0_ |= 0x00000008;
               onChanged();
        -      return getRequestFieldBuilder().getBuilder();
        +      return internalGetRequestFieldBuilder().getBuilder();
             }
        +
             /**
              *
              *
        @@ -15874,6 +16557,7 @@ public com.google.rpc.context.AttributeContext.RequestOrBuilder getRequestOrBuil
                     : request_;
               }
             }
        +
             /**
              *
              *
        @@ -15883,14 +16567,14 @@ public com.google.rpc.context.AttributeContext.RequestOrBuilder getRequestOrBuil
              *
              * .google.rpc.context.AttributeContext.Request request = 3;
              */
        -    private com.google.protobuf.SingleFieldBuilderV3<
        +    private com.google.protobuf.SingleFieldBuilder<
                     com.google.rpc.context.AttributeContext.Request,
                     com.google.rpc.context.AttributeContext.Request.Builder,
                     com.google.rpc.context.AttributeContext.RequestOrBuilder>
        -        getRequestFieldBuilder() {
        +        internalGetRequestFieldBuilder() {
               if (requestBuilder_ == null) {
                 requestBuilder_ =
        -            new com.google.protobuf.SingleFieldBuilderV3<
        +            new com.google.protobuf.SingleFieldBuilder<
                         com.google.rpc.context.AttributeContext.Request,
                         com.google.rpc.context.AttributeContext.Request.Builder,
                         com.google.rpc.context.AttributeContext.RequestOrBuilder>(
        @@ -15901,11 +16585,12 @@ public com.google.rpc.context.AttributeContext.RequestOrBuilder getRequestOrBuil
             }
         
             private com.google.rpc.context.AttributeContext.Response response_;
        -    private com.google.protobuf.SingleFieldBuilderV3<
        +    private com.google.protobuf.SingleFieldBuilder<
                     com.google.rpc.context.AttributeContext.Response,
                     com.google.rpc.context.AttributeContext.Response.Builder,
                     com.google.rpc.context.AttributeContext.ResponseOrBuilder>
                 responseBuilder_;
        +
             /**
              *
              *
        @@ -15918,8 +16603,9 @@ public com.google.rpc.context.AttributeContext.RequestOrBuilder getRequestOrBuil
              * @return Whether the response field is set.
              */
             public boolean hasResponse() {
        -      return responseBuilder_ != null || response_ != null;
        +      return ((bitField0_ & 0x00000010) != 0);
             }
        +
             /**
              *
              *
        @@ -15940,6 +16626,7 @@ public com.google.rpc.context.AttributeContext.Response getResponse() {
                 return responseBuilder_.getMessage();
               }
             }
        +
             /**
              *
              *
        @@ -15955,13 +16642,14 @@ public Builder setResponse(com.google.rpc.context.AttributeContext.Response valu
                   throw new NullPointerException();
                 }
                 response_ = value;
        -        onChanged();
               } else {
                 responseBuilder_.setMessage(value);
               }
        -
        +      bitField0_ |= 0x00000010;
        +      onChanged();
               return this;
             }
        +
             /**
              *
              *
        @@ -15975,13 +16663,14 @@ public Builder setResponse(
                 com.google.rpc.context.AttributeContext.Response.Builder builderForValue) {
               if (responseBuilder_ == null) {
                 response_ = builderForValue.build();
        -        onChanged();
               } else {
                 responseBuilder_.setMessage(builderForValue.build());
               }
        -
        +      bitField0_ |= 0x00000010;
        +      onChanged();
               return this;
             }
        +
             /**
              *
              *
        @@ -15993,21 +16682,23 @@ public Builder setResponse(
              */
             public Builder mergeResponse(com.google.rpc.context.AttributeContext.Response value) {
               if (responseBuilder_ == null) {
        -        if (response_ != null) {
        -          response_ =
        -              com.google.rpc.context.AttributeContext.Response.newBuilder(response_)
        -                  .mergeFrom(value)
        -                  .buildPartial();
        +        if (((bitField0_ & 0x00000010) != 0)
        +            && response_ != null
        +            && response_ != com.google.rpc.context.AttributeContext.Response.getDefaultInstance()) {
        +          getResponseBuilder().mergeFrom(value);
                 } else {
                   response_ = value;
                 }
        -        onChanged();
               } else {
                 responseBuilder_.mergeFrom(value);
               }
        -
        +      if (response_ != null) {
        +        bitField0_ |= 0x00000010;
        +        onChanged();
        +      }
               return this;
             }
        +
             /**
              *
              *
        @@ -16018,16 +16709,16 @@ public Builder mergeResponse(com.google.rpc.context.AttributeContext.Response va
              * .google.rpc.context.AttributeContext.Response response = 4;
              */
             public Builder clearResponse() {
        -      if (responseBuilder_ == null) {
        -        response_ = null;
        -        onChanged();
        -      } else {
        -        response_ = null;
        +      bitField0_ = (bitField0_ & ~0x00000010);
        +      response_ = null;
        +      if (responseBuilder_ != null) {
        +        responseBuilder_.dispose();
                 responseBuilder_ = null;
               }
        -
        +      onChanged();
               return this;
             }
        +
             /**
              *
              *
        @@ -16038,10 +16729,11 @@ public Builder clearResponse() {
              * .google.rpc.context.AttributeContext.Response response = 4;
              */
             public com.google.rpc.context.AttributeContext.Response.Builder getResponseBuilder() {
        -
        +      bitField0_ |= 0x00000010;
               onChanged();
        -      return getResponseFieldBuilder().getBuilder();
        +      return internalGetResponseFieldBuilder().getBuilder();
             }
        +
             /**
              *
              *
        @@ -16060,6 +16752,7 @@ public com.google.rpc.context.AttributeContext.ResponseOrBuilder getResponseOrBu
                     : response_;
               }
             }
        +
             /**
              *
              *
        @@ -16069,14 +16762,14 @@ public com.google.rpc.context.AttributeContext.ResponseOrBuilder getResponseOrBu
              *
              * .google.rpc.context.AttributeContext.Response response = 4;
              */
        -    private com.google.protobuf.SingleFieldBuilderV3<
        +    private com.google.protobuf.SingleFieldBuilder<
                     com.google.rpc.context.AttributeContext.Response,
                     com.google.rpc.context.AttributeContext.Response.Builder,
                     com.google.rpc.context.AttributeContext.ResponseOrBuilder>
        -        getResponseFieldBuilder() {
        +        internalGetResponseFieldBuilder() {
               if (responseBuilder_ == null) {
                 responseBuilder_ =
        -            new com.google.protobuf.SingleFieldBuilderV3<
        +            new com.google.protobuf.SingleFieldBuilder<
                         com.google.rpc.context.AttributeContext.Response,
                         com.google.rpc.context.AttributeContext.Response.Builder,
                         com.google.rpc.context.AttributeContext.ResponseOrBuilder>(
        @@ -16087,11 +16780,12 @@ public com.google.rpc.context.AttributeContext.ResponseOrBuilder getResponseOrBu
             }
         
             private com.google.rpc.context.AttributeContext.Resource resource_;
        -    private com.google.protobuf.SingleFieldBuilderV3<
        +    private com.google.protobuf.SingleFieldBuilder<
                     com.google.rpc.context.AttributeContext.Resource,
                     com.google.rpc.context.AttributeContext.Resource.Builder,
                     com.google.rpc.context.AttributeContext.ResourceOrBuilder>
                 resourceBuilder_;
        +
             /**
              *
              *
        @@ -16106,8 +16800,9 @@ public com.google.rpc.context.AttributeContext.ResponseOrBuilder getResponseOrBu
              * @return Whether the resource field is set.
              */
             public boolean hasResource() {
        -      return resourceBuilder_ != null || resource_ != null;
        +      return ((bitField0_ & 0x00000020) != 0);
             }
        +
             /**
              *
              *
        @@ -16130,6 +16825,7 @@ public com.google.rpc.context.AttributeContext.Resource getResource() {
                 return resourceBuilder_.getMessage();
               }
             }
        +
             /**
              *
              *
        @@ -16147,13 +16843,14 @@ public Builder setResource(com.google.rpc.context.AttributeContext.Resource valu
                   throw new NullPointerException();
                 }
                 resource_ = value;
        -        onChanged();
               } else {
                 resourceBuilder_.setMessage(value);
               }
        -
        +      bitField0_ |= 0x00000020;
        +      onChanged();
               return this;
             }
        +
             /**
              *
              *
        @@ -16169,13 +16866,14 @@ public Builder setResource(
                 com.google.rpc.context.AttributeContext.Resource.Builder builderForValue) {
               if (resourceBuilder_ == null) {
                 resource_ = builderForValue.build();
        -        onChanged();
               } else {
                 resourceBuilder_.setMessage(builderForValue.build());
               }
        -
        +      bitField0_ |= 0x00000020;
        +      onChanged();
               return this;
             }
        +
             /**
              *
              *
        @@ -16189,21 +16887,23 @@ public Builder setResource(
              */
             public Builder mergeResource(com.google.rpc.context.AttributeContext.Resource value) {
               if (resourceBuilder_ == null) {
        -        if (resource_ != null) {
        -          resource_ =
        -              com.google.rpc.context.AttributeContext.Resource.newBuilder(resource_)
        -                  .mergeFrom(value)
        -                  .buildPartial();
        +        if (((bitField0_ & 0x00000020) != 0)
        +            && resource_ != null
        +            && resource_ != com.google.rpc.context.AttributeContext.Resource.getDefaultInstance()) {
        +          getResourceBuilder().mergeFrom(value);
                 } else {
                   resource_ = value;
                 }
        -        onChanged();
               } else {
                 resourceBuilder_.mergeFrom(value);
               }
        -
        +      if (resource_ != null) {
        +        bitField0_ |= 0x00000020;
        +        onChanged();
        +      }
               return this;
             }
        +
             /**
              *
              *
        @@ -16216,16 +16916,16 @@ public Builder mergeResource(com.google.rpc.context.AttributeContext.Resource va
              * .google.rpc.context.AttributeContext.Resource resource = 5;
              */
             public Builder clearResource() {
        -      if (resourceBuilder_ == null) {
        -        resource_ = null;
        -        onChanged();
        -      } else {
        -        resource_ = null;
        +      bitField0_ = (bitField0_ & ~0x00000020);
        +      resource_ = null;
        +      if (resourceBuilder_ != null) {
        +        resourceBuilder_.dispose();
                 resourceBuilder_ = null;
               }
        -
        +      onChanged();
               return this;
             }
        +
             /**
              *
              *
        @@ -16238,10 +16938,11 @@ public Builder clearResource() {
              * .google.rpc.context.AttributeContext.Resource resource = 5;
              */
             public com.google.rpc.context.AttributeContext.Resource.Builder getResourceBuilder() {
        -
        +      bitField0_ |= 0x00000020;
               onChanged();
        -      return getResourceFieldBuilder().getBuilder();
        +      return internalGetResourceFieldBuilder().getBuilder();
             }
        +
             /**
              *
              *
        @@ -16262,6 +16963,7 @@ public com.google.rpc.context.AttributeContext.ResourceOrBuilder getResourceOrBu
                     : resource_;
               }
             }
        +
             /**
              *
              *
        @@ -16273,14 +16975,14 @@ public com.google.rpc.context.AttributeContext.ResourceOrBuilder getResourceOrBu
              *
              * .google.rpc.context.AttributeContext.Resource resource = 5;
              */
        -    private com.google.protobuf.SingleFieldBuilderV3<
        +    private com.google.protobuf.SingleFieldBuilder<
                     com.google.rpc.context.AttributeContext.Resource,
                     com.google.rpc.context.AttributeContext.Resource.Builder,
                     com.google.rpc.context.AttributeContext.ResourceOrBuilder>
        -        getResourceFieldBuilder() {
        +        internalGetResourceFieldBuilder() {
               if (resourceBuilder_ == null) {
                 resourceBuilder_ =
        -            new com.google.protobuf.SingleFieldBuilderV3<
        +            new com.google.protobuf.SingleFieldBuilder<
                         com.google.rpc.context.AttributeContext.Resource,
                         com.google.rpc.context.AttributeContext.Resource.Builder,
                         com.google.rpc.context.AttributeContext.ResourceOrBuilder>(
        @@ -16291,11 +16993,12 @@ public com.google.rpc.context.AttributeContext.ResourceOrBuilder getResourceOrBu
             }
         
             private com.google.rpc.context.AttributeContext.Api api_;
        -    private com.google.protobuf.SingleFieldBuilderV3<
        +    private com.google.protobuf.SingleFieldBuilder<
                     com.google.rpc.context.AttributeContext.Api,
                     com.google.rpc.context.AttributeContext.Api.Builder,
                     com.google.rpc.context.AttributeContext.ApiOrBuilder>
                 apiBuilder_;
        +
             /**
              *
              *
        @@ -16308,8 +17011,9 @@ public com.google.rpc.context.AttributeContext.ResourceOrBuilder getResourceOrBu
              * @return Whether the api field is set.
              */
             public boolean hasApi() {
        -      return apiBuilder_ != null || api_ != null;
        +      return ((bitField0_ & 0x00000040) != 0);
             }
        +
             /**
              *
              *
        @@ -16330,6 +17034,7 @@ public com.google.rpc.context.AttributeContext.Api getApi() {
                 return apiBuilder_.getMessage();
               }
             }
        +
             /**
              *
              *
        @@ -16345,13 +17050,14 @@ public Builder setApi(com.google.rpc.context.AttributeContext.Api value) {
                   throw new NullPointerException();
                 }
                 api_ = value;
        -        onChanged();
               } else {
                 apiBuilder_.setMessage(value);
               }
        -
        +      bitField0_ |= 0x00000040;
        +      onChanged();
               return this;
             }
        +
             /**
              *
              *
        @@ -16364,13 +17070,14 @@ public Builder setApi(com.google.rpc.context.AttributeContext.Api value) {
             public Builder setApi(com.google.rpc.context.AttributeContext.Api.Builder builderForValue) {
               if (apiBuilder_ == null) {
                 api_ = builderForValue.build();
        -        onChanged();
               } else {
                 apiBuilder_.setMessage(builderForValue.build());
               }
        -
        +      bitField0_ |= 0x00000040;
        +      onChanged();
               return this;
             }
        +
             /**
              *
              *
        @@ -16382,21 +17089,23 @@ public Builder setApi(com.google.rpc.context.AttributeContext.Api.Builder builde
              */
             public Builder mergeApi(com.google.rpc.context.AttributeContext.Api value) {
               if (apiBuilder_ == null) {
        -        if (api_ != null) {
        -          api_ =
        -              com.google.rpc.context.AttributeContext.Api.newBuilder(api_)
        -                  .mergeFrom(value)
        -                  .buildPartial();
        +        if (((bitField0_ & 0x00000040) != 0)
        +            && api_ != null
        +            && api_ != com.google.rpc.context.AttributeContext.Api.getDefaultInstance()) {
        +          getApiBuilder().mergeFrom(value);
                 } else {
                   api_ = value;
                 }
        -        onChanged();
               } else {
                 apiBuilder_.mergeFrom(value);
               }
        -
        +      if (api_ != null) {
        +        bitField0_ |= 0x00000040;
        +        onChanged();
        +      }
               return this;
             }
        +
             /**
              *
              *
        @@ -16407,16 +17116,16 @@ public Builder mergeApi(com.google.rpc.context.AttributeContext.Api value) {
              * .google.rpc.context.AttributeContext.Api api = 6;
              */
             public Builder clearApi() {
        -      if (apiBuilder_ == null) {
        -        api_ = null;
        -        onChanged();
        -      } else {
        -        api_ = null;
        +      bitField0_ = (bitField0_ & ~0x00000040);
        +      api_ = null;
        +      if (apiBuilder_ != null) {
        +        apiBuilder_.dispose();
                 apiBuilder_ = null;
               }
        -
        +      onChanged();
               return this;
             }
        +
             /**
              *
              *
        @@ -16427,10 +17136,11 @@ public Builder clearApi() {
              * .google.rpc.context.AttributeContext.Api api = 6;
              */
             public com.google.rpc.context.AttributeContext.Api.Builder getApiBuilder() {
        -
        +      bitField0_ |= 0x00000040;
               onChanged();
        -      return getApiFieldBuilder().getBuilder();
        +      return internalGetApiFieldBuilder().getBuilder();
             }
        +
             /**
              *
              *
        @@ -16449,6 +17159,7 @@ public com.google.rpc.context.AttributeContext.ApiOrBuilder getApiOrBuilder() {
                     : api_;
               }
             }
        +
             /**
              *
              *
        @@ -16458,14 +17169,14 @@ public com.google.rpc.context.AttributeContext.ApiOrBuilder getApiOrBuilder() {
              *
              * .google.rpc.context.AttributeContext.Api api = 6;
              */
        -    private com.google.protobuf.SingleFieldBuilderV3<
        +    private com.google.protobuf.SingleFieldBuilder<
                     com.google.rpc.context.AttributeContext.Api,
                     com.google.rpc.context.AttributeContext.Api.Builder,
                     com.google.rpc.context.AttributeContext.ApiOrBuilder>
        -        getApiFieldBuilder() {
        +        internalGetApiFieldBuilder() {
               if (apiBuilder_ == null) {
                 apiBuilder_ =
        -            new com.google.protobuf.SingleFieldBuilderV3<
        +            new com.google.protobuf.SingleFieldBuilder<
                         com.google.rpc.context.AttributeContext.Api,
                         com.google.rpc.context.AttributeContext.Api.Builder,
                         com.google.rpc.context.AttributeContext.ApiOrBuilder>(
        @@ -16478,13 +17189,13 @@ public com.google.rpc.context.AttributeContext.ApiOrBuilder getApiOrBuilder() {
             private java.util.List extensions_ = java.util.Collections.emptyList();
         
             private void ensureExtensionsIsMutable() {
        -      if (!((bitField0_ & 0x00000001) != 0)) {
        +      if (!((bitField0_ & 0x00000080) != 0)) {
                 extensions_ = new java.util.ArrayList(extensions_);
        -        bitField0_ |= 0x00000001;
        +        bitField0_ |= 0x00000080;
               }
             }
         
        -    private com.google.protobuf.RepeatedFieldBuilderV3<
        +    private com.google.protobuf.RepeatedFieldBuilder<
                     com.google.protobuf.Any,
                     com.google.protobuf.Any.Builder,
                     com.google.protobuf.AnyOrBuilder>
        @@ -16506,6 +17217,7 @@ public java.util.List getExtensionsList() {
                 return extensionsBuilder_.getMessageList();
               }
             }
        +
             /**
              *
              *
        @@ -16522,6 +17234,7 @@ public int getExtensionsCount() {
                 return extensionsBuilder_.getCount();
               }
             }
        +
             /**
              *
              *
        @@ -16538,6 +17251,7 @@ public com.google.protobuf.Any getExtensions(int index) {
                 return extensionsBuilder_.getMessage(index);
               }
             }
        +
             /**
              *
              *
        @@ -16560,6 +17274,7 @@ public Builder setExtensions(int index, com.google.protobuf.Any value) {
               }
               return this;
             }
        +
             /**
              *
              *
        @@ -16579,6 +17294,7 @@ public Builder setExtensions(int index, com.google.protobuf.Any.Builder builderF
               }
               return this;
             }
        +
             /**
              *
              *
        @@ -16601,6 +17317,7 @@ public Builder addExtensions(com.google.protobuf.Any value) {
               }
               return this;
             }
        +
             /**
              *
              *
        @@ -16623,6 +17340,7 @@ public Builder addExtensions(int index, com.google.protobuf.Any value) {
               }
               return this;
             }
        +
             /**
              *
              *
        @@ -16642,6 +17360,7 @@ public Builder addExtensions(com.google.protobuf.Any.Builder builderForValue) {
               }
               return this;
             }
        +
             /**
              *
              *
        @@ -16661,6 +17380,7 @@ public Builder addExtensions(int index, com.google.protobuf.Any.Builder builderF
               }
               return this;
             }
        +
             /**
              *
              *
        @@ -16680,6 +17400,7 @@ public Builder addAllExtensions(java.lang.Iterablerepeated .google.protobuf.Any extensions = 8;
              */
             public com.google.protobuf.Any.Builder getExtensionsBuilder(int index) {
        -      return getExtensionsFieldBuilder().getBuilder(index);
        +      return internalGetExtensionsFieldBuilder().getBuilder(index);
             }
        +
             /**
              *
              *
        @@ -16746,6 +17470,7 @@ public com.google.protobuf.AnyOrBuilder getExtensionsOrBuilder(int index) {
                 return extensionsBuilder_.getMessageOrBuilder(index);
               }
             }
        +
             /**
              *
              *
        @@ -16762,6 +17487,7 @@ public java.util.List getExtensionsO
                 return java.util.Collections.unmodifiableList(extensions_);
               }
             }
        +
             /**
              *
              *
        @@ -16772,8 +17498,10 @@ public java.util.List getExtensionsO
              * repeated .google.protobuf.Any extensions = 8;
              */
             public com.google.protobuf.Any.Builder addExtensionsBuilder() {
        -      return getExtensionsFieldBuilder().addBuilder(com.google.protobuf.Any.getDefaultInstance());
        +      return internalGetExtensionsFieldBuilder()
        +          .addBuilder(com.google.protobuf.Any.getDefaultInstance());
             }
        +
             /**
              *
              *
        @@ -16784,9 +17512,10 @@ public com.google.protobuf.Any.Builder addExtensionsBuilder() {
              * repeated .google.protobuf.Any extensions = 8;
              */
             public com.google.protobuf.Any.Builder addExtensionsBuilder(int index) {
        -      return getExtensionsFieldBuilder()
        +      return internalGetExtensionsFieldBuilder()
                   .addBuilder(index, com.google.protobuf.Any.getDefaultInstance());
             }
        +
             /**
              *
              *
        @@ -16797,37 +17526,26 @@ public com.google.protobuf.Any.Builder addExtensionsBuilder(int index) {
              * repeated .google.protobuf.Any extensions = 8;
              */
             public java.util.List getExtensionsBuilderList() {
        -      return getExtensionsFieldBuilder().getBuilderList();
        +      return internalGetExtensionsFieldBuilder().getBuilderList();
             }
         
        -    private com.google.protobuf.RepeatedFieldBuilderV3<
        +    private com.google.protobuf.RepeatedFieldBuilder<
                     com.google.protobuf.Any,
                     com.google.protobuf.Any.Builder,
                     com.google.protobuf.AnyOrBuilder>
        -        getExtensionsFieldBuilder() {
        +        internalGetExtensionsFieldBuilder() {
               if (extensionsBuilder_ == null) {
                 extensionsBuilder_ =
        -            new com.google.protobuf.RepeatedFieldBuilderV3<
        +            new com.google.protobuf.RepeatedFieldBuilder<
                         com.google.protobuf.Any,
                         com.google.protobuf.Any.Builder,
                         com.google.protobuf.AnyOrBuilder>(
        -                extensions_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean());
        +                extensions_, ((bitField0_ & 0x00000080) != 0), getParentForChildren(), isClean());
                 extensions_ = null;
               }
               return extensionsBuilder_;
             }
         
        -    @java.lang.Override
        -    public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) {
        -      return super.setUnknownFields(unknownFields);
        -    }
        -
        -    @java.lang.Override
        -    public final Builder mergeUnknownFields(
        -        final com.google.protobuf.UnknownFieldSet unknownFields) {
        -      return super.mergeUnknownFields(unknownFields);
        -    }
        -
             // @@protoc_insertion_point(builder_scope:google.rpc.context.AttributeContext)
           }
         
        diff --git a/java-common-protos/proto-google-common-protos/src/main/java/com/google/rpc/context/AttributeContextOrBuilder.java b/java-common-protos/proto-google-common-protos/src/main/java/com/google/rpc/context/AttributeContextOrBuilder.java
        index c80e79e9d1..80ae9f0966 100644
        --- a/java-common-protos/proto-google-common-protos/src/main/java/com/google/rpc/context/AttributeContextOrBuilder.java
        +++ b/java-common-protos/proto-google-common-protos/src/main/java/com/google/rpc/context/AttributeContextOrBuilder.java
        @@ -1,5 +1,5 @@
         /*
        - * Copyright 2020 Google LLC
        + * Copyright 2026 Google LLC
          *
          * Licensed under the Apache License, Version 2.0 (the "License");
          * you may not use this file except in compliance with the License.
        @@ -14,10 +14,13 @@
          * limitations under the License.
          */
         // Generated by the protocol buffer compiler.  DO NOT EDIT!
        +// NO CHECKED-IN PROTOBUF GENCODE
         // source: google/rpc/context/attribute_context.proto
        +// Protobuf Java Version: 4.33.2
         
         package com.google.rpc.context;
         
        +@com.google.protobuf.Generated
         public interface AttributeContextOrBuilder
             extends
             // @@protoc_insertion_point(interface_extends:google.rpc.context.AttributeContext)
        @@ -37,6 +40,7 @@ public interface AttributeContextOrBuilder
            * @return Whether the origin field is set.
            */
           boolean hasOrigin();
        +
           /**
            *
            *
        @@ -51,6 +55,7 @@ public interface AttributeContextOrBuilder
            * @return The origin.
            */
           com.google.rpc.context.AttributeContext.Peer getOrigin();
        +
           /**
            *
            *
        @@ -78,6 +83,7 @@ public interface AttributeContextOrBuilder
            * @return Whether the source field is set.
            */
           boolean hasSource();
        +
           /**
            *
            *
        @@ -92,6 +98,7 @@ public interface AttributeContextOrBuilder
            * @return The source.
            */
           com.google.rpc.context.AttributeContext.Peer getSource();
        +
           /**
            *
            *
        @@ -119,6 +126,7 @@ public interface AttributeContextOrBuilder
            * @return Whether the destination field is set.
            */
           boolean hasDestination();
        +
           /**
            *
            *
        @@ -133,6 +141,7 @@ public interface AttributeContextOrBuilder
            * @return The destination.
            */
           com.google.rpc.context.AttributeContext.Peer getDestination();
        +
           /**
            *
            *
        @@ -158,6 +167,7 @@ public interface AttributeContextOrBuilder
            * @return Whether the request field is set.
            */
           boolean hasRequest();
        +
           /**
            *
            *
        @@ -170,6 +180,7 @@ public interface AttributeContextOrBuilder
            * @return The request.
            */
           com.google.rpc.context.AttributeContext.Request getRequest();
        +
           /**
            *
            *
        @@ -193,6 +204,7 @@ public interface AttributeContextOrBuilder
            * @return Whether the response field is set.
            */
           boolean hasResponse();
        +
           /**
            *
            *
        @@ -205,6 +217,7 @@ public interface AttributeContextOrBuilder
            * @return The response.
            */
           com.google.rpc.context.AttributeContext.Response getResponse();
        +
           /**
            *
            *
        @@ -230,6 +243,7 @@ public interface AttributeContextOrBuilder
            * @return Whether the resource field is set.
            */
           boolean hasResource();
        +
           /**
            *
            *
        @@ -244,6 +258,7 @@ public interface AttributeContextOrBuilder
            * @return The resource.
            */
           com.google.rpc.context.AttributeContext.Resource getResource();
        +
           /**
            *
            *
        @@ -269,6 +284,7 @@ public interface AttributeContextOrBuilder
            * @return Whether the api field is set.
            */
           boolean hasApi();
        +
           /**
            *
            *
        @@ -281,6 +297,7 @@ public interface AttributeContextOrBuilder
            * @return The api.
            */
           com.google.rpc.context.AttributeContext.Api getApi();
        +
           /**
            *
            *
        @@ -302,6 +319,7 @@ public interface AttributeContextOrBuilder
            * repeated .google.protobuf.Any extensions = 8;
            */
           java.util.List getExtensionsList();
        +
           /**
            *
            *
        @@ -312,6 +330,7 @@ public interface AttributeContextOrBuilder
            * repeated .google.protobuf.Any extensions = 8;
            */
           com.google.protobuf.Any getExtensions(int index);
        +
           /**
            *
            *
        @@ -322,6 +341,7 @@ public interface AttributeContextOrBuilder
            * repeated .google.protobuf.Any extensions = 8;
            */
           int getExtensionsCount();
        +
           /**
            *
            *
        @@ -332,6 +352,7 @@ public interface AttributeContextOrBuilder
            * repeated .google.protobuf.Any extensions = 8;
            */
           java.util.List getExtensionsOrBuilderList();
        +
           /**
            *
            *
        diff --git a/java-common-protos/proto-google-common-protos/src/main/java/com/google/rpc/context/AttributeContextProto.java b/java-common-protos/proto-google-common-protos/src/main/java/com/google/rpc/context/AttributeContextProto.java
        index 0761c33a79..afbf3e2bf6 100644
        --- a/java-common-protos/proto-google-common-protos/src/main/java/com/google/rpc/context/AttributeContextProto.java
        +++ b/java-common-protos/proto-google-common-protos/src/main/java/com/google/rpc/context/AttributeContextProto.java
        @@ -1,5 +1,5 @@
         /*
        - * Copyright 2020 Google LLC
        + * Copyright 2026 Google LLC
          *
          * Licensed under the Apache License, Version 2.0 (the "License");
          * you may not use this file except in compliance with the License.
        @@ -14,13 +14,26 @@
          * limitations under the License.
          */
         // Generated by the protocol buffer compiler.  DO NOT EDIT!
        +// NO CHECKED-IN PROTOBUF GENCODE
         // source: google/rpc/context/attribute_context.proto
        +// Protobuf Java Version: 4.33.2
         
         package com.google.rpc.context;
         
        -public final class AttributeContextProto {
        +@com.google.protobuf.Generated
        +public final class AttributeContextProto extends com.google.protobuf.GeneratedFile {
           private AttributeContextProto() {}
         
        +  static {
        +    com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion(
        +        com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC,
        +        /* major= */ 4,
        +        /* minor= */ 33,
        +        /* patch= */ 2,
        +        /* suffix= */ "",
        +        "AttributeContextProto");
        +  }
        +
           public static void registerAllExtensions(com.google.protobuf.ExtensionRegistryLite registry) {}
         
           public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry registry) {
        @@ -29,51 +42,51 @@ public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry r
         
           static final com.google.protobuf.Descriptors.Descriptor
               internal_static_google_rpc_context_AttributeContext_descriptor;
        -  static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
        +  static final com.google.protobuf.GeneratedMessage.FieldAccessorTable
               internal_static_google_rpc_context_AttributeContext_fieldAccessorTable;
           static final com.google.protobuf.Descriptors.Descriptor
               internal_static_google_rpc_context_AttributeContext_Peer_descriptor;
        -  static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
        +  static final com.google.protobuf.GeneratedMessage.FieldAccessorTable
               internal_static_google_rpc_context_AttributeContext_Peer_fieldAccessorTable;
           static final com.google.protobuf.Descriptors.Descriptor
               internal_static_google_rpc_context_AttributeContext_Peer_LabelsEntry_descriptor;
        -  static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
        +  static final com.google.protobuf.GeneratedMessage.FieldAccessorTable
               internal_static_google_rpc_context_AttributeContext_Peer_LabelsEntry_fieldAccessorTable;
           static final com.google.protobuf.Descriptors.Descriptor
               internal_static_google_rpc_context_AttributeContext_Api_descriptor;
        -  static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
        +  static final com.google.protobuf.GeneratedMessage.FieldAccessorTable
               internal_static_google_rpc_context_AttributeContext_Api_fieldAccessorTable;
           static final com.google.protobuf.Descriptors.Descriptor
               internal_static_google_rpc_context_AttributeContext_Auth_descriptor;
        -  static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
        +  static final com.google.protobuf.GeneratedMessage.FieldAccessorTable
               internal_static_google_rpc_context_AttributeContext_Auth_fieldAccessorTable;
           static final com.google.protobuf.Descriptors.Descriptor
               internal_static_google_rpc_context_AttributeContext_Request_descriptor;
        -  static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
        +  static final com.google.protobuf.GeneratedMessage.FieldAccessorTable
               internal_static_google_rpc_context_AttributeContext_Request_fieldAccessorTable;
           static final com.google.protobuf.Descriptors.Descriptor
               internal_static_google_rpc_context_AttributeContext_Request_HeadersEntry_descriptor;
        -  static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
        +  static final com.google.protobuf.GeneratedMessage.FieldAccessorTable
               internal_static_google_rpc_context_AttributeContext_Request_HeadersEntry_fieldAccessorTable;
           static final com.google.protobuf.Descriptors.Descriptor
               internal_static_google_rpc_context_AttributeContext_Response_descriptor;
        -  static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
        +  static final com.google.protobuf.GeneratedMessage.FieldAccessorTable
               internal_static_google_rpc_context_AttributeContext_Response_fieldAccessorTable;
           static final com.google.protobuf.Descriptors.Descriptor
               internal_static_google_rpc_context_AttributeContext_Response_HeadersEntry_descriptor;
        -  static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
        +  static final com.google.protobuf.GeneratedMessage.FieldAccessorTable
               internal_static_google_rpc_context_AttributeContext_Response_HeadersEntry_fieldAccessorTable;
           static final com.google.protobuf.Descriptors.Descriptor
               internal_static_google_rpc_context_AttributeContext_Resource_descriptor;
        -  static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
        +  static final com.google.protobuf.GeneratedMessage.FieldAccessorTable
               internal_static_google_rpc_context_AttributeContext_Resource_fieldAccessorTable;
           static final com.google.protobuf.Descriptors.Descriptor
               internal_static_google_rpc_context_AttributeContext_Resource_LabelsEntry_descriptor;
        -  static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
        +  static final com.google.protobuf.GeneratedMessage.FieldAccessorTable
               internal_static_google_rpc_context_AttributeContext_Resource_LabelsEntry_fieldAccessorTable;
           static final com.google.protobuf.Descriptors.Descriptor
               internal_static_google_rpc_context_AttributeContext_Resource_AnnotationsEntry_descriptor;
        -  static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
        +  static final com.google.protobuf.GeneratedMessage.FieldAccessorTable
               internal_static_google_rpc_context_AttributeContext_Resource_AnnotationsEntry_fieldAccessorTable;
         
           public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() {
        @@ -84,66 +97,95 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() {
         
           static {
             java.lang.String[] descriptorData = {
        -      "\n*google/rpc/context/attribute_context.p"
        +      "\n"
        +          + "*google/rpc/context/attribute_context.p"
                   + "roto\022\022google.rpc.context\032\031google/protobu"
                   + "f/any.proto\032\036google/protobuf/duration.pr"
        -          + "oto\032\034google/protobuf/struct.proto\032\037googl"
        -          + "e/protobuf/timestamp.proto\"\203\020\n\020Attribute"
        -          + "Context\0229\n\006origin\030\007 \001(\0132).google.rpc.con"
        -          + "text.AttributeContext.Peer\0229\n\006source\030\001 \001"
        -          + "(\0132).google.rpc.context.AttributeContext"
        -          + ".Peer\022>\n\013destination\030\002 \001(\0132).google.rpc."
        -          + "context.AttributeContext.Peer\022=\n\007request"
        -          + "\030\003 \001(\0132,.google.rpc.context.AttributeCon"
        -          + "text.Request\022?\n\010response\030\004 \001(\0132-.google."
        -          + "rpc.context.AttributeContext.Response\022?\n"
        -          + "\010resource\030\005 \001(\0132-.google.rpc.context.Att"
        -          + "ributeContext.Resource\0225\n\003api\030\006 \001(\0132(.go"
        -          + "ogle.rpc.context.AttributeContext.Api\022(\n"
        -          + "\nextensions\030\010 \003(\0132\024.google.protobuf.Any\032"
        -          + "\276\001\n\004Peer\022\n\n\002ip\030\001 \001(\t\022\014\n\004port\030\002 \001(\003\022E\n\006la"
        -          + "bels\030\006 \003(\01325.google.rpc.context.Attribut"
        -          + "eContext.Peer.LabelsEntry\022\021\n\tprincipal\030\007"
        -          + " \001(\t\022\023\n\013region_code\030\010 \001(\t\032-\n\013LabelsEntry"
        -          + "\022\013\n\003key\030\001 \001(\t\022\r\n\005value\030\002 \001(\t:\0028\001\032L\n\003Api\022"
        -          + "\017\n\007service\030\001 \001(\t\022\021\n\toperation\030\002 \001(\t\022\020\n\010p"
        -          + "rotocol\030\003 \001(\t\022\017\n\007version\030\004 \001(\t\032\177\n\004Auth\022\021"
        -          + "\n\tprincipal\030\001 \001(\t\022\021\n\taudiences\030\002 \003(\t\022\021\n\t"
        -          + "presenter\030\003 \001(\t\022\'\n\006claims\030\004 \001(\0132\027.google"
        -          + ".protobuf.Struct\022\025\n\raccess_levels\030\005 \003(\t\032"
        -          + "\357\002\n\007Request\022\n\n\002id\030\001 \001(\t\022\016\n\006method\030\002 \001(\t\022"
        -          + "J\n\007headers\030\003 \003(\01329.google.rpc.context.At"
        -          + "tributeContext.Request.HeadersEntry\022\014\n\004p"
        -          + "ath\030\004 \001(\t\022\014\n\004host\030\005 \001(\t\022\016\n\006scheme\030\006 \001(\t\022"
        -          + "\r\n\005query\030\007 \001(\t\022(\n\004time\030\t \001(\0132\032.google.pr"
        -          + "otobuf.Timestamp\022\014\n\004size\030\n \001(\003\022\020\n\010protoc"
        -          + "ol\030\013 \001(\t\022\016\n\006reason\030\014 \001(\t\0227\n\004auth\030\r \001(\0132)"
        -          + ".google.rpc.context.AttributeContext.Aut"
        -          + "h\032.\n\014HeadersEntry\022\013\n\003key\030\001 \001(\t\022\r\n\005value\030"
        -          + "\002 \001(\t:\0028\001\032\201\002\n\010Response\022\014\n\004code\030\001 \001(\003\022\014\n\004"
        -          + "size\030\002 \001(\003\022K\n\007headers\030\003 \003(\0132:.google.rpc"
        -          + ".context.AttributeContext.Response.Heade"
        -          + "rsEntry\022(\n\004time\030\004 \001(\0132\032.google.protobuf."
        -          + "Timestamp\0222\n\017backend_latency\030\005 \001(\0132\031.goo"
        -          + "gle.protobuf.Duration\032.\n\014HeadersEntry\022\013\n"
        -          + "\003key\030\001 \001(\t\022\r\n\005value\030\002 \001(\t:\0028\001\032\220\004\n\010Resour"
        -          + "ce\022\017\n\007service\030\001 \001(\t\022\014\n\004name\030\002 \001(\t\022\014\n\004typ"
        -          + "e\030\003 \001(\t\022I\n\006labels\030\004 \003(\01329.google.rpc.con"
        -          + "text.AttributeContext.Resource.LabelsEnt"
        -          + "ry\022\013\n\003uid\030\005 \001(\t\022S\n\013annotations\030\006 \003(\0132>.g"
        -          + "oogle.rpc.context.AttributeContext.Resou"
        -          + "rce.AnnotationsEntry\022\024\n\014display_name\030\007 \001"
        -          + "(\t\022/\n\013create_time\030\010 \001(\0132\032.google.protobu"
        -          + "f.Timestamp\022/\n\013update_time\030\t \001(\0132\032.googl"
        -          + "e.protobuf.Timestamp\022/\n\013delete_time\030\n \001("
        -          + "\0132\032.google.protobuf.Timestamp\022\014\n\004etag\030\013 "
        -          + "\001(\t\022\020\n\010location\030\014 \001(\t\032-\n\013LabelsEntry\022\013\n\003"
        -          + "key\030\001 \001(\t\022\r\n\005value\030\002 \001(\t:\0028\001\0322\n\020Annotati"
        -          + "onsEntry\022\013\n\003key\030\001 \001(\t\022\r\n\005value\030\002 \001(\t:\0028\001"
        -          + "B\213\001\n\026com.google.rpc.contextB\025AttributeCo"
        -          + "ntextProtoP\001ZUgoogle.golang.org/genproto"
        -          + "/googleapis/rpc/context/attribute_contex"
        -          + "t;attribute_context\370\001\001b\006proto3"
        +          + "oto\032\034google/protobuf/struct.proto\032\037google/protobuf/timestamp.proto\"\203\020\n"
        +          + "\020AttributeContext\0229\n"
        +          + "\006origin\030\007 \001(\0132).google.rpc.context.AttributeContext.Peer\0229\n"
        +          + "\006source\030\001 \001(\0132).google.rpc.context.AttributeContext.Peer\022>\n"
        +          + "\013destination\030\002 \001(\0132).google.rpc.context.AttributeContext.Peer\022=\n"
        +          + "\007request\030\003 \001(\0132,.google.rpc.context.AttributeContext.Request\022?\n"
        +          + "\010response\030\004 \001(\0132-.google.rpc.context.AttributeContext.Response\022?\n"
        +          + "\010resource\030\005 \001(\0132-.google.rpc.context.AttributeContext.Resource\0225\n"
        +          + "\003api\030\006 \001(\0132(.google.rpc.context.AttributeContext.Api\022(\n"
        +          + "\n"
        +          + "extensions\030\010 \003(\0132\024.google.protobuf.Any\032\276\001\n"
        +          + "\004Peer\022\n\n"
        +          + "\002ip\030\001 \001(\t\022\014\n"
        +          + "\004port\030\002 \001(\003\022E\n"
        +          + "\006labels\030\006"
        +          + " \003(\01325.google.rpc.context.AttributeContext.Peer.LabelsEntry\022\021\n"
        +          + "\tprincipal\030\007 \001(\t\022\023\n"
        +          + "\013region_code\030\010 \001(\t\032-\n"
        +          + "\013LabelsEntry\022\013\n"
        +          + "\003key\030\001 \001(\t\022\r\n"
        +          + "\005value\030\002 \001(\t:\0028\001\032L\n"
        +          + "\003Api\022\017\n"
        +          + "\007service\030\001 \001(\t\022\021\n"
        +          + "\toperation\030\002 \001(\t\022\020\n"
        +          + "\010protocol\030\003 \001(\t\022\017\n"
        +          + "\007version\030\004 \001(\t\032\177\n"
        +          + "\004Auth\022\021\n"
        +          + "\tprincipal\030\001 \001(\t\022\021\n"
        +          + "\taudiences\030\002 \003(\t\022\021\n"
        +          + "\tpresenter\030\003 \001(\t\022\'\n"
        +          + "\006claims\030\004 \001(\0132\027.google.protobuf.Struct\022\025\n\r"
        +          + "access_levels\030\005 \003(\t\032\357\002\n"
        +          + "\007Request\022\n\n"
        +          + "\002id\030\001 \001(\t\022\016\n"
        +          + "\006method\030\002 \001(\t\022J\n"
        +          + "\007headers\030\003"
        +          + " \003(\01329.google.rpc.context.AttributeContext.Request.HeadersEntry\022\014\n"
        +          + "\004path\030\004 \001(\t\022\014\n"
        +          + "\004host\030\005 \001(\t\022\016\n"
        +          + "\006scheme\030\006 \001(\t\022\r\n"
        +          + "\005query\030\007 \001(\t\022(\n"
        +          + "\004time\030\t \001(\0132\032.google.protobuf.Timestamp\022\014\n"
        +          + "\004size\030\n"
        +          + " \001(\003\022\020\n"
        +          + "\010protocol\030\013 \001(\t\022\016\n"
        +          + "\006reason\030\014 \001(\t\0227\n"
        +          + "\004auth\030\r"
        +          + " \001(\0132).google.rpc.context.AttributeContext.Auth\032.\n"
        +          + "\014HeadersEntry\022\013\n"
        +          + "\003key\030\001 \001(\t\022\r\n"
        +          + "\005value\030\002 \001(\t:\0028\001\032\201\002\n"
        +          + "\010Response\022\014\n"
        +          + "\004code\030\001 \001(\003\022\014\n"
        +          + "\004size\030\002 \001(\003\022K\n"
        +          + "\007headers\030\003 \003(\0132:.google.rpc"
        +          + ".context.AttributeContext.Response.HeadersEntry\022(\n"
        +          + "\004time\030\004 \001(\0132\032.google.protobuf.Timestamp\0222\n"
        +          + "\017backend_latency\030\005 \001(\0132\031.google.protobuf.Duration\032.\n"
        +          + "\014HeadersEntry\022\013\n"
        +          + "\003key\030\001 \001(\t\022\r\n"
        +          + "\005value\030\002 \001(\t:\0028\001\032\220\004\n"
        +          + "\010Resource\022\017\n"
        +          + "\007service\030\001 \001(\t\022\014\n"
        +          + "\004name\030\002 \001(\t\022\014\n"
        +          + "\004type\030\003 \001(\t\022I\n"
        +          + "\006labels\030\004 \003(\01329.google.rpc.con"
        +          + "text.AttributeContext.Resource.LabelsEntry\022\013\n"
        +          + "\003uid\030\005 \001(\t\022S\n"
        +          + "\013annotations\030\006 \003(\0132>.g"
        +          + "oogle.rpc.context.AttributeContext.Resource.AnnotationsEntry\022\024\n"
        +          + "\014display_name\030\007 \001(\t\022/\n"
        +          + "\013create_time\030\010 \001(\0132\032.google.protobuf.Timestamp\022/\n"
        +          + "\013update_time\030\t \001(\0132\032.google.protobuf.Timestamp\022/\n"
        +          + "\013delete_time\030\n"
        +          + " \001(\0132\032.google.protobuf.Timestamp\022\014\n"
        +          + "\004etag\030\013 \001(\t\022\020\n"
        +          + "\010location\030\014 \001(\t\032-\n"
        +          + "\013LabelsEntry\022\013\n"
        +          + "\003key\030\001 \001(\t\022\r\n"
        +          + "\005value\030\002 \001(\t:\0028\001\0322\n"
        +          + "\020AnnotationsEntry\022\013\n"
        +          + "\003key\030\001 \001(\t\022\r\n"
        +          + "\005value\030\002 \001(\t:\0028\001B\213\001\n"
        +          + "\026com.google.rpc.contextB\025AttributeContextProtoP\001ZUgoogle.golang.org/genproto"
        +          + "/googleapis/rpc/context/attribute_context;attribute_context\370\001\001b\006proto3"
             };
             descriptor =
                 com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom(
        @@ -155,9 +197,9 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() {
                       com.google.protobuf.TimestampProto.getDescriptor(),
                     });
             internal_static_google_rpc_context_AttributeContext_descriptor =
        -        getDescriptor().getMessageTypes().get(0);
        +        getDescriptor().getMessageType(0);
             internal_static_google_rpc_context_AttributeContext_fieldAccessorTable =
        -        new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
        +        new com.google.protobuf.GeneratedMessage.FieldAccessorTable(
                     internal_static_google_rpc_context_AttributeContext_descriptor,
                     new java.lang.String[] {
                       "Origin",
        @@ -170,41 +212,41 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() {
                       "Extensions",
                     });
             internal_static_google_rpc_context_AttributeContext_Peer_descriptor =
        -        internal_static_google_rpc_context_AttributeContext_descriptor.getNestedTypes().get(0);
        +        internal_static_google_rpc_context_AttributeContext_descriptor.getNestedType(0);
             internal_static_google_rpc_context_AttributeContext_Peer_fieldAccessorTable =
        -        new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
        +        new com.google.protobuf.GeneratedMessage.FieldAccessorTable(
                     internal_static_google_rpc_context_AttributeContext_Peer_descriptor,
                     new java.lang.String[] {
                       "Ip", "Port", "Labels", "Principal", "RegionCode",
                     });
             internal_static_google_rpc_context_AttributeContext_Peer_LabelsEntry_descriptor =
        -        internal_static_google_rpc_context_AttributeContext_Peer_descriptor.getNestedTypes().get(0);
        +        internal_static_google_rpc_context_AttributeContext_Peer_descriptor.getNestedType(0);
             internal_static_google_rpc_context_AttributeContext_Peer_LabelsEntry_fieldAccessorTable =
        -        new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
        +        new com.google.protobuf.GeneratedMessage.FieldAccessorTable(
                     internal_static_google_rpc_context_AttributeContext_Peer_LabelsEntry_descriptor,
                     new java.lang.String[] {
                       "Key", "Value",
                     });
             internal_static_google_rpc_context_AttributeContext_Api_descriptor =
        -        internal_static_google_rpc_context_AttributeContext_descriptor.getNestedTypes().get(1);
        +        internal_static_google_rpc_context_AttributeContext_descriptor.getNestedType(1);
             internal_static_google_rpc_context_AttributeContext_Api_fieldAccessorTable =
        -        new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
        +        new com.google.protobuf.GeneratedMessage.FieldAccessorTable(
                     internal_static_google_rpc_context_AttributeContext_Api_descriptor,
                     new java.lang.String[] {
                       "Service", "Operation", "Protocol", "Version",
                     });
             internal_static_google_rpc_context_AttributeContext_Auth_descriptor =
        -        internal_static_google_rpc_context_AttributeContext_descriptor.getNestedTypes().get(2);
        +        internal_static_google_rpc_context_AttributeContext_descriptor.getNestedType(2);
             internal_static_google_rpc_context_AttributeContext_Auth_fieldAccessorTable =
        -        new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
        +        new com.google.protobuf.GeneratedMessage.FieldAccessorTable(
                     internal_static_google_rpc_context_AttributeContext_Auth_descriptor,
                     new java.lang.String[] {
                       "Principal", "Audiences", "Presenter", "Claims", "AccessLevels",
                     });
             internal_static_google_rpc_context_AttributeContext_Request_descriptor =
        -        internal_static_google_rpc_context_AttributeContext_descriptor.getNestedTypes().get(3);
        +        internal_static_google_rpc_context_AttributeContext_descriptor.getNestedType(3);
             internal_static_google_rpc_context_AttributeContext_Request_fieldAccessorTable =
        -        new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
        +        new com.google.protobuf.GeneratedMessage.FieldAccessorTable(
                     internal_static_google_rpc_context_AttributeContext_Request_descriptor,
                     new java.lang.String[] {
                       "Id",
        @@ -221,37 +263,33 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() {
                       "Auth",
                     });
             internal_static_google_rpc_context_AttributeContext_Request_HeadersEntry_descriptor =
        -        internal_static_google_rpc_context_AttributeContext_Request_descriptor
        -            .getNestedTypes()
        -            .get(0);
        +        internal_static_google_rpc_context_AttributeContext_Request_descriptor.getNestedType(0);
             internal_static_google_rpc_context_AttributeContext_Request_HeadersEntry_fieldAccessorTable =
        -        new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
        +        new com.google.protobuf.GeneratedMessage.FieldAccessorTable(
                     internal_static_google_rpc_context_AttributeContext_Request_HeadersEntry_descriptor,
                     new java.lang.String[] {
                       "Key", "Value",
                     });
             internal_static_google_rpc_context_AttributeContext_Response_descriptor =
        -        internal_static_google_rpc_context_AttributeContext_descriptor.getNestedTypes().get(4);
        +        internal_static_google_rpc_context_AttributeContext_descriptor.getNestedType(4);
             internal_static_google_rpc_context_AttributeContext_Response_fieldAccessorTable =
        -        new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
        +        new com.google.protobuf.GeneratedMessage.FieldAccessorTable(
                     internal_static_google_rpc_context_AttributeContext_Response_descriptor,
                     new java.lang.String[] {
                       "Code", "Size", "Headers", "Time", "BackendLatency",
                     });
             internal_static_google_rpc_context_AttributeContext_Response_HeadersEntry_descriptor =
        -        internal_static_google_rpc_context_AttributeContext_Response_descriptor
        -            .getNestedTypes()
        -            .get(0);
        +        internal_static_google_rpc_context_AttributeContext_Response_descriptor.getNestedType(0);
             internal_static_google_rpc_context_AttributeContext_Response_HeadersEntry_fieldAccessorTable =
        -        new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
        +        new com.google.protobuf.GeneratedMessage.FieldAccessorTable(
                     internal_static_google_rpc_context_AttributeContext_Response_HeadersEntry_descriptor,
                     new java.lang.String[] {
                       "Key", "Value",
                     });
             internal_static_google_rpc_context_AttributeContext_Resource_descriptor =
        -        internal_static_google_rpc_context_AttributeContext_descriptor.getNestedTypes().get(5);
        +        internal_static_google_rpc_context_AttributeContext_descriptor.getNestedType(5);
             internal_static_google_rpc_context_AttributeContext_Resource_fieldAccessorTable =
        -        new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
        +        new com.google.protobuf.GeneratedMessage.FieldAccessorTable(
                     internal_static_google_rpc_context_AttributeContext_Resource_descriptor,
                     new java.lang.String[] {
                       "Service",
        @@ -268,25 +306,22 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() {
                       "Location",
                     });
             internal_static_google_rpc_context_AttributeContext_Resource_LabelsEntry_descriptor =
        -        internal_static_google_rpc_context_AttributeContext_Resource_descriptor
        -            .getNestedTypes()
        -            .get(0);
        +        internal_static_google_rpc_context_AttributeContext_Resource_descriptor.getNestedType(0);
             internal_static_google_rpc_context_AttributeContext_Resource_LabelsEntry_fieldAccessorTable =
        -        new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
        +        new com.google.protobuf.GeneratedMessage.FieldAccessorTable(
                     internal_static_google_rpc_context_AttributeContext_Resource_LabelsEntry_descriptor,
                     new java.lang.String[] {
                       "Key", "Value",
                     });
             internal_static_google_rpc_context_AttributeContext_Resource_AnnotationsEntry_descriptor =
        -        internal_static_google_rpc_context_AttributeContext_Resource_descriptor
        -            .getNestedTypes()
        -            .get(1);
        +        internal_static_google_rpc_context_AttributeContext_Resource_descriptor.getNestedType(1);
             internal_static_google_rpc_context_AttributeContext_Resource_AnnotationsEntry_fieldAccessorTable =
        -        new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
        +        new com.google.protobuf.GeneratedMessage.FieldAccessorTable(
                     internal_static_google_rpc_context_AttributeContext_Resource_AnnotationsEntry_descriptor,
                     new java.lang.String[] {
                       "Key", "Value",
                     });
        +    descriptor.resolveAllFeaturesImmutable();
             com.google.protobuf.AnyProto.getDescriptor();
             com.google.protobuf.DurationProto.getDescriptor();
             com.google.protobuf.StructProto.getDescriptor();
        diff --git a/java-common-protos/proto-google-common-protos/src/main/java/com/google/rpc/context/AuditContext.java b/java-common-protos/proto-google-common-protos/src/main/java/com/google/rpc/context/AuditContext.java
        new file mode 100644
        index 0000000000..f8edd37521
        --- /dev/null
        +++ b/java-common-protos/proto-google-common-protos/src/main/java/com/google/rpc/context/AuditContext.java
        @@ -0,0 +1,1436 @@
        +/*
        + * Copyright 2026 Google LLC
        + *
        + * Licensed under the Apache License, Version 2.0 (the "License");
        + * you may not use this file except in compliance with the License.
        + * You may obtain a copy of the License at
        + *
        + *     https://www.apache.org/licenses/LICENSE-2.0
        + *
        + * Unless required by applicable law or agreed to in writing, software
        + * distributed under the License is distributed on an "AS IS" BASIS,
        + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
        + * See the License for the specific language governing permissions and
        + * limitations under the License.
        + */
        +// Generated by the protocol buffer compiler.  DO NOT EDIT!
        +// NO CHECKED-IN PROTOBUF GENCODE
        +// source: google/rpc/context/audit_context.proto
        +// Protobuf Java Version: 4.33.2
        +
        +package com.google.rpc.context;
        +
        +/**
        + *
        + *
        + * 
        + * `AuditContext` provides information that is needed for audit logging.
        + * 
        + * + * Protobuf type {@code google.rpc.context.AuditContext} + */ +@com.google.protobuf.Generated +public final class AuditContext extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.rpc.context.AuditContext) + AuditContextOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "AuditContext"); + } + + // Use AuditContext.newBuilder() to construct. + private AuditContext(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private AuditContext() { + auditLog_ = com.google.protobuf.ByteString.EMPTY; + targetResource_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.rpc.context.AuditContextProto + .internal_static_google_rpc_context_AuditContext_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.rpc.context.AuditContextProto + .internal_static_google_rpc_context_AuditContext_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.rpc.context.AuditContext.class, + com.google.rpc.context.AuditContext.Builder.class); + } + + private int bitField0_; + public static final int AUDIT_LOG_FIELD_NUMBER = 1; + private com.google.protobuf.ByteString auditLog_ = com.google.protobuf.ByteString.EMPTY; + + /** + * + * + *
        +   * Serialized audit log.
        +   * 
        + * + * bytes audit_log = 1; + * + * @return The auditLog. + */ + @java.lang.Override + public com.google.protobuf.ByteString getAuditLog() { + return auditLog_; + } + + public static final int SCRUBBED_REQUEST_FIELD_NUMBER = 2; + private com.google.protobuf.Struct scrubbedRequest_; + + /** + * + * + *
        +   * An API request message that is scrubbed based on the method annotation.
        +   * This field should only be filled if audit_log field is present.
        +   * Service Control will use this to assemble a complete log for Cloud Audit
        +   * Logs and Google internal audit logs.
        +   * 
        + * + * .google.protobuf.Struct scrubbed_request = 2; + * + * @return Whether the scrubbedRequest field is set. + */ + @java.lang.Override + public boolean hasScrubbedRequest() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
        +   * An API request message that is scrubbed based on the method annotation.
        +   * This field should only be filled if audit_log field is present.
        +   * Service Control will use this to assemble a complete log for Cloud Audit
        +   * Logs and Google internal audit logs.
        +   * 
        + * + * .google.protobuf.Struct scrubbed_request = 2; + * + * @return The scrubbedRequest. + */ + @java.lang.Override + public com.google.protobuf.Struct getScrubbedRequest() { + return scrubbedRequest_ == null + ? com.google.protobuf.Struct.getDefaultInstance() + : scrubbedRequest_; + } + + /** + * + * + *
        +   * An API request message that is scrubbed based on the method annotation.
        +   * This field should only be filled if audit_log field is present.
        +   * Service Control will use this to assemble a complete log for Cloud Audit
        +   * Logs and Google internal audit logs.
        +   * 
        + * + * .google.protobuf.Struct scrubbed_request = 2; + */ + @java.lang.Override + public com.google.protobuf.StructOrBuilder getScrubbedRequestOrBuilder() { + return scrubbedRequest_ == null + ? com.google.protobuf.Struct.getDefaultInstance() + : scrubbedRequest_; + } + + public static final int SCRUBBED_RESPONSE_FIELD_NUMBER = 3; + private com.google.protobuf.Struct scrubbedResponse_; + + /** + * + * + *
        +   * An API response message that is scrubbed based on the method annotation.
        +   * This field should only be filled if audit_log field is present.
        +   * Service Control will use this to assemble a complete log for Cloud Audit
        +   * Logs and Google internal audit logs.
        +   * 
        + * + * .google.protobuf.Struct scrubbed_response = 3; + * + * @return Whether the scrubbedResponse field is set. + */ + @java.lang.Override + public boolean hasScrubbedResponse() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
        +   * An API response message that is scrubbed based on the method annotation.
        +   * This field should only be filled if audit_log field is present.
        +   * Service Control will use this to assemble a complete log for Cloud Audit
        +   * Logs and Google internal audit logs.
        +   * 
        + * + * .google.protobuf.Struct scrubbed_response = 3; + * + * @return The scrubbedResponse. + */ + @java.lang.Override + public com.google.protobuf.Struct getScrubbedResponse() { + return scrubbedResponse_ == null + ? com.google.protobuf.Struct.getDefaultInstance() + : scrubbedResponse_; + } + + /** + * + * + *
        +   * An API response message that is scrubbed based on the method annotation.
        +   * This field should only be filled if audit_log field is present.
        +   * Service Control will use this to assemble a complete log for Cloud Audit
        +   * Logs and Google internal audit logs.
        +   * 
        + * + * .google.protobuf.Struct scrubbed_response = 3; + */ + @java.lang.Override + public com.google.protobuf.StructOrBuilder getScrubbedResponseOrBuilder() { + return scrubbedResponse_ == null + ? com.google.protobuf.Struct.getDefaultInstance() + : scrubbedResponse_; + } + + public static final int SCRUBBED_RESPONSE_ITEM_COUNT_FIELD_NUMBER = 4; + private int scrubbedResponseItemCount_ = 0; + + /** + * + * + *
        +   * Number of scrubbed response items.
        +   * 
        + * + * int32 scrubbed_response_item_count = 4; + * + * @return The scrubbedResponseItemCount. + */ + @java.lang.Override + public int getScrubbedResponseItemCount() { + return scrubbedResponseItemCount_; + } + + public static final int TARGET_RESOURCE_FIELD_NUMBER = 5; + + @SuppressWarnings("serial") + private volatile java.lang.Object targetResource_ = ""; + + /** + * + * + *
        +   * Audit resource name which is scrubbed.
        +   * 
        + * + * string target_resource = 5; + * + * @return The targetResource. + */ + @java.lang.Override + public java.lang.String getTargetResource() { + java.lang.Object ref = targetResource_; + 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(); + targetResource_ = s; + return s; + } + } + + /** + * + * + *
        +   * Audit resource name which is scrubbed.
        +   * 
        + * + * string target_resource = 5; + * + * @return The bytes for targetResource. + */ + @java.lang.Override + public com.google.protobuf.ByteString getTargetResourceBytes() { + java.lang.Object ref = targetResource_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + targetResource_ = 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 (!auditLog_.isEmpty()) { + output.writeBytes(1, auditLog_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(2, getScrubbedRequest()); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeMessage(3, getScrubbedResponse()); + } + if (scrubbedResponseItemCount_ != 0) { + output.writeInt32(4, scrubbedResponseItemCount_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(targetResource_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 5, targetResource_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!auditLog_.isEmpty()) { + size += com.google.protobuf.CodedOutputStream.computeBytesSize(1, auditLog_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getScrubbedRequest()); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getScrubbedResponse()); + } + if (scrubbedResponseItemCount_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(4, scrubbedResponseItemCount_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(targetResource_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(5, targetResource_); + } + 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.rpc.context.AuditContext)) { + return super.equals(obj); + } + com.google.rpc.context.AuditContext other = (com.google.rpc.context.AuditContext) obj; + + if (!getAuditLog().equals(other.getAuditLog())) return false; + if (hasScrubbedRequest() != other.hasScrubbedRequest()) return false; + if (hasScrubbedRequest()) { + if (!getScrubbedRequest().equals(other.getScrubbedRequest())) return false; + } + if (hasScrubbedResponse() != other.hasScrubbedResponse()) return false; + if (hasScrubbedResponse()) { + if (!getScrubbedResponse().equals(other.getScrubbedResponse())) return false; + } + if (getScrubbedResponseItemCount() != other.getScrubbedResponseItemCount()) return false; + if (!getTargetResource().equals(other.getTargetResource())) 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) + AUDIT_LOG_FIELD_NUMBER; + hash = (53 * hash) + getAuditLog().hashCode(); + if (hasScrubbedRequest()) { + hash = (37 * hash) + SCRUBBED_REQUEST_FIELD_NUMBER; + hash = (53 * hash) + getScrubbedRequest().hashCode(); + } + if (hasScrubbedResponse()) { + hash = (37 * hash) + SCRUBBED_RESPONSE_FIELD_NUMBER; + hash = (53 * hash) + getScrubbedResponse().hashCode(); + } + hash = (37 * hash) + SCRUBBED_RESPONSE_ITEM_COUNT_FIELD_NUMBER; + hash = (53 * hash) + getScrubbedResponseItemCount(); + hash = (37 * hash) + TARGET_RESOURCE_FIELD_NUMBER; + hash = (53 * hash) + getTargetResource().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.rpc.context.AuditContext parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.rpc.context.AuditContext parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.rpc.context.AuditContext parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.rpc.context.AuditContext 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.rpc.context.AuditContext parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.rpc.context.AuditContext parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.rpc.context.AuditContext parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.rpc.context.AuditContext parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.rpc.context.AuditContext parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.rpc.context.AuditContext parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.rpc.context.AuditContext parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.rpc.context.AuditContext parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.rpc.context.AuditContext 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
        +   * `AuditContext` provides information that is needed for audit logging.
        +   * 
        + * + * Protobuf type {@code google.rpc.context.AuditContext} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.rpc.context.AuditContext) + com.google.rpc.context.AuditContextOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.rpc.context.AuditContextProto + .internal_static_google_rpc_context_AuditContext_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.rpc.context.AuditContextProto + .internal_static_google_rpc_context_AuditContext_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.rpc.context.AuditContext.class, + com.google.rpc.context.AuditContext.Builder.class); + } + + // Construct using com.google.rpc.context.AuditContext.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetScrubbedRequestFieldBuilder(); + internalGetScrubbedResponseFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + auditLog_ = com.google.protobuf.ByteString.EMPTY; + scrubbedRequest_ = null; + if (scrubbedRequestBuilder_ != null) { + scrubbedRequestBuilder_.dispose(); + scrubbedRequestBuilder_ = null; + } + scrubbedResponse_ = null; + if (scrubbedResponseBuilder_ != null) { + scrubbedResponseBuilder_.dispose(); + scrubbedResponseBuilder_ = null; + } + scrubbedResponseItemCount_ = 0; + targetResource_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.rpc.context.AuditContextProto + .internal_static_google_rpc_context_AuditContext_descriptor; + } + + @java.lang.Override + public com.google.rpc.context.AuditContext getDefaultInstanceForType() { + return com.google.rpc.context.AuditContext.getDefaultInstance(); + } + + @java.lang.Override + public com.google.rpc.context.AuditContext build() { + com.google.rpc.context.AuditContext result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.rpc.context.AuditContext buildPartial() { + com.google.rpc.context.AuditContext result = new com.google.rpc.context.AuditContext(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.rpc.context.AuditContext result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.auditLog_ = auditLog_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.scrubbedRequest_ = + scrubbedRequestBuilder_ == null ? scrubbedRequest_ : scrubbedRequestBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.scrubbedResponse_ = + scrubbedResponseBuilder_ == null ? scrubbedResponse_ : scrubbedResponseBuilder_.build(); + to_bitField0_ |= 0x00000002; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.scrubbedResponseItemCount_ = scrubbedResponseItemCount_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.targetResource_ = targetResource_; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.rpc.context.AuditContext) { + return mergeFrom((com.google.rpc.context.AuditContext) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.rpc.context.AuditContext other) { + if (other == com.google.rpc.context.AuditContext.getDefaultInstance()) return this; + if (!other.getAuditLog().isEmpty()) { + setAuditLog(other.getAuditLog()); + } + if (other.hasScrubbedRequest()) { + mergeScrubbedRequest(other.getScrubbedRequest()); + } + if (other.hasScrubbedResponse()) { + mergeScrubbedResponse(other.getScrubbedResponse()); + } + if (other.getScrubbedResponseItemCount() != 0) { + setScrubbedResponseItemCount(other.getScrubbedResponseItemCount()); + } + if (!other.getTargetResource().isEmpty()) { + targetResource_ = other.targetResource_; + 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: + { + auditLog_ = input.readBytes(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + input.readMessage( + internalGetScrubbedRequestFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + input.readMessage( + internalGetScrubbedResponseFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 32: + { + scrubbedResponseItemCount_ = input.readInt32(); + bitField0_ |= 0x00000008; + break; + } // case 32 + case 42: + { + targetResource_ = input.readStringRequireUtf8(); + 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 com.google.protobuf.ByteString auditLog_ = com.google.protobuf.ByteString.EMPTY; + + /** + * + * + *
        +     * Serialized audit log.
        +     * 
        + * + * bytes audit_log = 1; + * + * @return The auditLog. + */ + @java.lang.Override + public com.google.protobuf.ByteString getAuditLog() { + return auditLog_; + } + + /** + * + * + *
        +     * Serialized audit log.
        +     * 
        + * + * bytes audit_log = 1; + * + * @param value The auditLog to set. + * @return This builder for chaining. + */ + public Builder setAuditLog(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + auditLog_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
        +     * Serialized audit log.
        +     * 
        + * + * bytes audit_log = 1; + * + * @return This builder for chaining. + */ + public Builder clearAuditLog() { + bitField0_ = (bitField0_ & ~0x00000001); + auditLog_ = getDefaultInstance().getAuditLog(); + onChanged(); + return this; + } + + private com.google.protobuf.Struct scrubbedRequest_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Struct, + com.google.protobuf.Struct.Builder, + com.google.protobuf.StructOrBuilder> + scrubbedRequestBuilder_; + + /** + * + * + *
        +     * An API request message that is scrubbed based on the method annotation.
        +     * This field should only be filled if audit_log field is present.
        +     * Service Control will use this to assemble a complete log for Cloud Audit
        +     * Logs and Google internal audit logs.
        +     * 
        + * + * .google.protobuf.Struct scrubbed_request = 2; + * + * @return Whether the scrubbedRequest field is set. + */ + public boolean hasScrubbedRequest() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
        +     * An API request message that is scrubbed based on the method annotation.
        +     * This field should only be filled if audit_log field is present.
        +     * Service Control will use this to assemble a complete log for Cloud Audit
        +     * Logs and Google internal audit logs.
        +     * 
        + * + * .google.protobuf.Struct scrubbed_request = 2; + * + * @return The scrubbedRequest. + */ + public com.google.protobuf.Struct getScrubbedRequest() { + if (scrubbedRequestBuilder_ == null) { + return scrubbedRequest_ == null + ? com.google.protobuf.Struct.getDefaultInstance() + : scrubbedRequest_; + } else { + return scrubbedRequestBuilder_.getMessage(); + } + } + + /** + * + * + *
        +     * An API request message that is scrubbed based on the method annotation.
        +     * This field should only be filled if audit_log field is present.
        +     * Service Control will use this to assemble a complete log for Cloud Audit
        +     * Logs and Google internal audit logs.
        +     * 
        + * + * .google.protobuf.Struct scrubbed_request = 2; + */ + public Builder setScrubbedRequest(com.google.protobuf.Struct value) { + if (scrubbedRequestBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + scrubbedRequest_ = value; + } else { + scrubbedRequestBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
        +     * An API request message that is scrubbed based on the method annotation.
        +     * This field should only be filled if audit_log field is present.
        +     * Service Control will use this to assemble a complete log for Cloud Audit
        +     * Logs and Google internal audit logs.
        +     * 
        + * + * .google.protobuf.Struct scrubbed_request = 2; + */ + public Builder setScrubbedRequest(com.google.protobuf.Struct.Builder builderForValue) { + if (scrubbedRequestBuilder_ == null) { + scrubbedRequest_ = builderForValue.build(); + } else { + scrubbedRequestBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
        +     * An API request message that is scrubbed based on the method annotation.
        +     * This field should only be filled if audit_log field is present.
        +     * Service Control will use this to assemble a complete log for Cloud Audit
        +     * Logs and Google internal audit logs.
        +     * 
        + * + * .google.protobuf.Struct scrubbed_request = 2; + */ + public Builder mergeScrubbedRequest(com.google.protobuf.Struct value) { + if (scrubbedRequestBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && scrubbedRequest_ != null + && scrubbedRequest_ != com.google.protobuf.Struct.getDefaultInstance()) { + getScrubbedRequestBuilder().mergeFrom(value); + } else { + scrubbedRequest_ = value; + } + } else { + scrubbedRequestBuilder_.mergeFrom(value); + } + if (scrubbedRequest_ != null) { + bitField0_ |= 0x00000002; + onChanged(); + } + return this; + } + + /** + * + * + *
        +     * An API request message that is scrubbed based on the method annotation.
        +     * This field should only be filled if audit_log field is present.
        +     * Service Control will use this to assemble a complete log for Cloud Audit
        +     * Logs and Google internal audit logs.
        +     * 
        + * + * .google.protobuf.Struct scrubbed_request = 2; + */ + public Builder clearScrubbedRequest() { + bitField0_ = (bitField0_ & ~0x00000002); + scrubbedRequest_ = null; + if (scrubbedRequestBuilder_ != null) { + scrubbedRequestBuilder_.dispose(); + scrubbedRequestBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
        +     * An API request message that is scrubbed based on the method annotation.
        +     * This field should only be filled if audit_log field is present.
        +     * Service Control will use this to assemble a complete log for Cloud Audit
        +     * Logs and Google internal audit logs.
        +     * 
        + * + * .google.protobuf.Struct scrubbed_request = 2; + */ + public com.google.protobuf.Struct.Builder getScrubbedRequestBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return internalGetScrubbedRequestFieldBuilder().getBuilder(); + } + + /** + * + * + *
        +     * An API request message that is scrubbed based on the method annotation.
        +     * This field should only be filled if audit_log field is present.
        +     * Service Control will use this to assemble a complete log for Cloud Audit
        +     * Logs and Google internal audit logs.
        +     * 
        + * + * .google.protobuf.Struct scrubbed_request = 2; + */ + public com.google.protobuf.StructOrBuilder getScrubbedRequestOrBuilder() { + if (scrubbedRequestBuilder_ != null) { + return scrubbedRequestBuilder_.getMessageOrBuilder(); + } else { + return scrubbedRequest_ == null + ? com.google.protobuf.Struct.getDefaultInstance() + : scrubbedRequest_; + } + } + + /** + * + * + *
        +     * An API request message that is scrubbed based on the method annotation.
        +     * This field should only be filled if audit_log field is present.
        +     * Service Control will use this to assemble a complete log for Cloud Audit
        +     * Logs and Google internal audit logs.
        +     * 
        + * + * .google.protobuf.Struct scrubbed_request = 2; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Struct, + com.google.protobuf.Struct.Builder, + com.google.protobuf.StructOrBuilder> + internalGetScrubbedRequestFieldBuilder() { + if (scrubbedRequestBuilder_ == null) { + scrubbedRequestBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Struct, + com.google.protobuf.Struct.Builder, + com.google.protobuf.StructOrBuilder>( + getScrubbedRequest(), getParentForChildren(), isClean()); + scrubbedRequest_ = null; + } + return scrubbedRequestBuilder_; + } + + private com.google.protobuf.Struct scrubbedResponse_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Struct, + com.google.protobuf.Struct.Builder, + com.google.protobuf.StructOrBuilder> + scrubbedResponseBuilder_; + + /** + * + * + *
        +     * An API response message that is scrubbed based on the method annotation.
        +     * This field should only be filled if audit_log field is present.
        +     * Service Control will use this to assemble a complete log for Cloud Audit
        +     * Logs and Google internal audit logs.
        +     * 
        + * + * .google.protobuf.Struct scrubbed_response = 3; + * + * @return Whether the scrubbedResponse field is set. + */ + public boolean hasScrubbedResponse() { + return ((bitField0_ & 0x00000004) != 0); + } + + /** + * + * + *
        +     * An API response message that is scrubbed based on the method annotation.
        +     * This field should only be filled if audit_log field is present.
        +     * Service Control will use this to assemble a complete log for Cloud Audit
        +     * Logs and Google internal audit logs.
        +     * 
        + * + * .google.protobuf.Struct scrubbed_response = 3; + * + * @return The scrubbedResponse. + */ + public com.google.protobuf.Struct getScrubbedResponse() { + if (scrubbedResponseBuilder_ == null) { + return scrubbedResponse_ == null + ? com.google.protobuf.Struct.getDefaultInstance() + : scrubbedResponse_; + } else { + return scrubbedResponseBuilder_.getMessage(); + } + } + + /** + * + * + *
        +     * An API response message that is scrubbed based on the method annotation.
        +     * This field should only be filled if audit_log field is present.
        +     * Service Control will use this to assemble a complete log for Cloud Audit
        +     * Logs and Google internal audit logs.
        +     * 
        + * + * .google.protobuf.Struct scrubbed_response = 3; + */ + public Builder setScrubbedResponse(com.google.protobuf.Struct value) { + if (scrubbedResponseBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + scrubbedResponse_ = value; + } else { + scrubbedResponseBuilder_.setMessage(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
        +     * An API response message that is scrubbed based on the method annotation.
        +     * This field should only be filled if audit_log field is present.
        +     * Service Control will use this to assemble a complete log for Cloud Audit
        +     * Logs and Google internal audit logs.
        +     * 
        + * + * .google.protobuf.Struct scrubbed_response = 3; + */ + public Builder setScrubbedResponse(com.google.protobuf.Struct.Builder builderForValue) { + if (scrubbedResponseBuilder_ == null) { + scrubbedResponse_ = builderForValue.build(); + } else { + scrubbedResponseBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
        +     * An API response message that is scrubbed based on the method annotation.
        +     * This field should only be filled if audit_log field is present.
        +     * Service Control will use this to assemble a complete log for Cloud Audit
        +     * Logs and Google internal audit logs.
        +     * 
        + * + * .google.protobuf.Struct scrubbed_response = 3; + */ + public Builder mergeScrubbedResponse(com.google.protobuf.Struct value) { + if (scrubbedResponseBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0) + && scrubbedResponse_ != null + && scrubbedResponse_ != com.google.protobuf.Struct.getDefaultInstance()) { + getScrubbedResponseBuilder().mergeFrom(value); + } else { + scrubbedResponse_ = value; + } + } else { + scrubbedResponseBuilder_.mergeFrom(value); + } + if (scrubbedResponse_ != null) { + bitField0_ |= 0x00000004; + onChanged(); + } + return this; + } + + /** + * + * + *
        +     * An API response message that is scrubbed based on the method annotation.
        +     * This field should only be filled if audit_log field is present.
        +     * Service Control will use this to assemble a complete log for Cloud Audit
        +     * Logs and Google internal audit logs.
        +     * 
        + * + * .google.protobuf.Struct scrubbed_response = 3; + */ + public Builder clearScrubbedResponse() { + bitField0_ = (bitField0_ & ~0x00000004); + scrubbedResponse_ = null; + if (scrubbedResponseBuilder_ != null) { + scrubbedResponseBuilder_.dispose(); + scrubbedResponseBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
        +     * An API response message that is scrubbed based on the method annotation.
        +     * This field should only be filled if audit_log field is present.
        +     * Service Control will use this to assemble a complete log for Cloud Audit
        +     * Logs and Google internal audit logs.
        +     * 
        + * + * .google.protobuf.Struct scrubbed_response = 3; + */ + public com.google.protobuf.Struct.Builder getScrubbedResponseBuilder() { + bitField0_ |= 0x00000004; + onChanged(); + return internalGetScrubbedResponseFieldBuilder().getBuilder(); + } + + /** + * + * + *
        +     * An API response message that is scrubbed based on the method annotation.
        +     * This field should only be filled if audit_log field is present.
        +     * Service Control will use this to assemble a complete log for Cloud Audit
        +     * Logs and Google internal audit logs.
        +     * 
        + * + * .google.protobuf.Struct scrubbed_response = 3; + */ + public com.google.protobuf.StructOrBuilder getScrubbedResponseOrBuilder() { + if (scrubbedResponseBuilder_ != null) { + return scrubbedResponseBuilder_.getMessageOrBuilder(); + } else { + return scrubbedResponse_ == null + ? com.google.protobuf.Struct.getDefaultInstance() + : scrubbedResponse_; + } + } + + /** + * + * + *
        +     * An API response message that is scrubbed based on the method annotation.
        +     * This field should only be filled if audit_log field is present.
        +     * Service Control will use this to assemble a complete log for Cloud Audit
        +     * Logs and Google internal audit logs.
        +     * 
        + * + * .google.protobuf.Struct scrubbed_response = 3; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Struct, + com.google.protobuf.Struct.Builder, + com.google.protobuf.StructOrBuilder> + internalGetScrubbedResponseFieldBuilder() { + if (scrubbedResponseBuilder_ == null) { + scrubbedResponseBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Struct, + com.google.protobuf.Struct.Builder, + com.google.protobuf.StructOrBuilder>( + getScrubbedResponse(), getParentForChildren(), isClean()); + scrubbedResponse_ = null; + } + return scrubbedResponseBuilder_; + } + + private int scrubbedResponseItemCount_; + + /** + * + * + *
        +     * Number of scrubbed response items.
        +     * 
        + * + * int32 scrubbed_response_item_count = 4; + * + * @return The scrubbedResponseItemCount. + */ + @java.lang.Override + public int getScrubbedResponseItemCount() { + return scrubbedResponseItemCount_; + } + + /** + * + * + *
        +     * Number of scrubbed response items.
        +     * 
        + * + * int32 scrubbed_response_item_count = 4; + * + * @param value The scrubbedResponseItemCount to set. + * @return This builder for chaining. + */ + public Builder setScrubbedResponseItemCount(int value) { + + scrubbedResponseItemCount_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + /** + * + * + *
        +     * Number of scrubbed response items.
        +     * 
        + * + * int32 scrubbed_response_item_count = 4; + * + * @return This builder for chaining. + */ + public Builder clearScrubbedResponseItemCount() { + bitField0_ = (bitField0_ & ~0x00000008); + scrubbedResponseItemCount_ = 0; + onChanged(); + return this; + } + + private java.lang.Object targetResource_ = ""; + + /** + * + * + *
        +     * Audit resource name which is scrubbed.
        +     * 
        + * + * string target_resource = 5; + * + * @return The targetResource. + */ + public java.lang.String getTargetResource() { + java.lang.Object ref = targetResource_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + targetResource_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
        +     * Audit resource name which is scrubbed.
        +     * 
        + * + * string target_resource = 5; + * + * @return The bytes for targetResource. + */ + public com.google.protobuf.ByteString getTargetResourceBytes() { + java.lang.Object ref = targetResource_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + targetResource_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
        +     * Audit resource name which is scrubbed.
        +     * 
        + * + * string target_resource = 5; + * + * @param value The targetResource to set. + * @return This builder for chaining. + */ + public Builder setTargetResource(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + targetResource_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + /** + * + * + *
        +     * Audit resource name which is scrubbed.
        +     * 
        + * + * string target_resource = 5; + * + * @return This builder for chaining. + */ + public Builder clearTargetResource() { + targetResource_ = getDefaultInstance().getTargetResource(); + bitField0_ = (bitField0_ & ~0x00000010); + onChanged(); + return this; + } + + /** + * + * + *
        +     * Audit resource name which is scrubbed.
        +     * 
        + * + * string target_resource = 5; + * + * @param value The bytes for targetResource to set. + * @return This builder for chaining. + */ + public Builder setTargetResourceBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + targetResource_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.rpc.context.AuditContext) + } + + // @@protoc_insertion_point(class_scope:google.rpc.context.AuditContext) + private static final com.google.rpc.context.AuditContext DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.rpc.context.AuditContext(); + } + + public static com.google.rpc.context.AuditContext getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public AuditContext 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.rpc.context.AuditContext getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-common-protos/proto-google-common-protos/src/main/java/com/google/rpc/context/AuditContextOrBuilder.java b/java-common-protos/proto-google-common-protos/src/main/java/com/google/rpc/context/AuditContextOrBuilder.java new file mode 100644 index 0000000000..cf82eb1955 --- /dev/null +++ b/java-common-protos/proto-google-common-protos/src/main/java/com/google/rpc/context/AuditContextOrBuilder.java @@ -0,0 +1,172 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/rpc/context/audit_context.proto +// Protobuf Java Version: 4.33.2 + +package com.google.rpc.context; + +@com.google.protobuf.Generated +public interface AuditContextOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.rpc.context.AuditContext) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
        +   * Serialized audit log.
        +   * 
        + * + * bytes audit_log = 1; + * + * @return The auditLog. + */ + com.google.protobuf.ByteString getAuditLog(); + + /** + * + * + *
        +   * An API request message that is scrubbed based on the method annotation.
        +   * This field should only be filled if audit_log field is present.
        +   * Service Control will use this to assemble a complete log for Cloud Audit
        +   * Logs and Google internal audit logs.
        +   * 
        + * + * .google.protobuf.Struct scrubbed_request = 2; + * + * @return Whether the scrubbedRequest field is set. + */ + boolean hasScrubbedRequest(); + + /** + * + * + *
        +   * An API request message that is scrubbed based on the method annotation.
        +   * This field should only be filled if audit_log field is present.
        +   * Service Control will use this to assemble a complete log for Cloud Audit
        +   * Logs and Google internal audit logs.
        +   * 
        + * + * .google.protobuf.Struct scrubbed_request = 2; + * + * @return The scrubbedRequest. + */ + com.google.protobuf.Struct getScrubbedRequest(); + + /** + * + * + *
        +   * An API request message that is scrubbed based on the method annotation.
        +   * This field should only be filled if audit_log field is present.
        +   * Service Control will use this to assemble a complete log for Cloud Audit
        +   * Logs and Google internal audit logs.
        +   * 
        + * + * .google.protobuf.Struct scrubbed_request = 2; + */ + com.google.protobuf.StructOrBuilder getScrubbedRequestOrBuilder(); + + /** + * + * + *
        +   * An API response message that is scrubbed based on the method annotation.
        +   * This field should only be filled if audit_log field is present.
        +   * Service Control will use this to assemble a complete log for Cloud Audit
        +   * Logs and Google internal audit logs.
        +   * 
        + * + * .google.protobuf.Struct scrubbed_response = 3; + * + * @return Whether the scrubbedResponse field is set. + */ + boolean hasScrubbedResponse(); + + /** + * + * + *
        +   * An API response message that is scrubbed based on the method annotation.
        +   * This field should only be filled if audit_log field is present.
        +   * Service Control will use this to assemble a complete log for Cloud Audit
        +   * Logs and Google internal audit logs.
        +   * 
        + * + * .google.protobuf.Struct scrubbed_response = 3; + * + * @return The scrubbedResponse. + */ + com.google.protobuf.Struct getScrubbedResponse(); + + /** + * + * + *
        +   * An API response message that is scrubbed based on the method annotation.
        +   * This field should only be filled if audit_log field is present.
        +   * Service Control will use this to assemble a complete log for Cloud Audit
        +   * Logs and Google internal audit logs.
        +   * 
        + * + * .google.protobuf.Struct scrubbed_response = 3; + */ + com.google.protobuf.StructOrBuilder getScrubbedResponseOrBuilder(); + + /** + * + * + *
        +   * Number of scrubbed response items.
        +   * 
        + * + * int32 scrubbed_response_item_count = 4; + * + * @return The scrubbedResponseItemCount. + */ + int getScrubbedResponseItemCount(); + + /** + * + * + *
        +   * Audit resource name which is scrubbed.
        +   * 
        + * + * string target_resource = 5; + * + * @return The targetResource. + */ + java.lang.String getTargetResource(); + + /** + * + * + *
        +   * Audit resource name which is scrubbed.
        +   * 
        + * + * string target_resource = 5; + * + * @return The bytes for targetResource. + */ + com.google.protobuf.ByteString getTargetResourceBytes(); +} diff --git a/java-common-protos/proto-google-common-protos/src/main/java/com/google/rpc/context/AuditContextProto.java b/java-common-protos/proto-google-common-protos/src/main/java/com/google/rpc/context/AuditContextProto.java new file mode 100644 index 0000000000..4cae7f4313 --- /dev/null +++ b/java-common-protos/proto-google-common-protos/src/main/java/com/google/rpc/context/AuditContextProto.java @@ -0,0 +1,90 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/rpc/context/audit_context.proto +// Protobuf Java Version: 4.33.2 + +package com.google.rpc.context; + +@com.google.protobuf.Generated +public final class AuditContextProto extends com.google.protobuf.GeneratedFile { + private AuditContextProto() {} + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "AuditContextProto"); + } + + 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_rpc_context_AuditContext_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_rpc_context_AuditContext_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/rpc/context/audit_context.proto" + + "\022\022google.rpc.context\032\034google/protobuf/st" + + "ruct.proto\"\307\001\n\014AuditContext\022\021\n\taudit_log" + + "\030\001 \001(\014\0221\n\020scrubbed_request\030\002 \001(\0132\027.googl" + + "e.protobuf.Struct\0222\n\021scrubbed_response\030\003" + + " \001(\0132\027.google.protobuf.Struct\022$\n\034scrubbe" + + "d_response_item_count\030\004 \001(\005\022\027\n\017target_re" + + "source\030\005 \001(\tBh\n\026com.google.rpc.contextB\021" + + "AuditContextProtoP\001Z9google.golang.org/g" + + "enproto/googleapis/rpc/context;contextb\006" + + "proto3" + }; + descriptor = + com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( + descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + com.google.protobuf.StructProto.getDescriptor(), + }); + internal_static_google_rpc_context_AuditContext_descriptor = getDescriptor().getMessageType(0); + internal_static_google_rpc_context_AuditContext_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_rpc_context_AuditContext_descriptor, + new java.lang.String[] { + "AuditLog", + "ScrubbedRequest", + "ScrubbedResponse", + "ScrubbedResponseItemCount", + "TargetResource", + }); + descriptor.resolveAllFeaturesImmutable(); + com.google.protobuf.StructProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/java-common-protos/proto-google-common-protos/src/main/java/com/google/shopping/type/Channel.java b/java-common-protos/proto-google-common-protos/src/main/java/com/google/shopping/type/Channel.java new file mode 100644 index 0000000000..070686e6c2 --- /dev/null +++ b/java-common-protos/proto-google-common-protos/src/main/java/com/google/shopping/type/Channel.java @@ -0,0 +1,564 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/shopping/type/types.proto +// Protobuf Java Version: 4.33.2 + +package com.google.shopping.type; + +/** + * + * + *
        + * [Channel](https://support.google.com/merchants/answer/7361332) of a product.
        + *
        + * Channel is used to distinguish between online and local products.
        + * 
        + * + * Protobuf type {@code google.shopping.type.Channel} + */ +@com.google.protobuf.Generated +public final class Channel extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.shopping.type.Channel) + ChannelOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "Channel"); + } + + // Use Channel.newBuilder() to construct. + private Channel(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private Channel() {} + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.shopping.type.TypesProto + .internal_static_google_shopping_type_Channel_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.shopping.type.TypesProto + .internal_static_google_shopping_type_Channel_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.shopping.type.Channel.class, com.google.shopping.type.Channel.Builder.class); + } + + /** + * + * + *
        +   * Channel values.
        +   * 
        + * + * Protobuf enum {@code google.shopping.type.Channel.ChannelEnum} + */ + public enum ChannelEnum implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
        +     * Not specified.
        +     * 
        + * + * CHANNEL_ENUM_UNSPECIFIED = 0; + */ + CHANNEL_ENUM_UNSPECIFIED(0), + /** + * + * + *
        +     * Online product.
        +     * 
        + * + * ONLINE = 1; + */ + ONLINE(1), + /** + * + * + *
        +     * Local product.
        +     * 
        + * + * LOCAL = 2; + */ + LOCAL(2), + UNRECOGNIZED(-1), + ; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "ChannelEnum"); + } + + /** + * + * + *
        +     * Not specified.
        +     * 
        + * + * CHANNEL_ENUM_UNSPECIFIED = 0; + */ + public static final int CHANNEL_ENUM_UNSPECIFIED_VALUE = 0; + + /** + * + * + *
        +     * Online product.
        +     * 
        + * + * ONLINE = 1; + */ + public static final int ONLINE_VALUE = 1; + + /** + * + * + *
        +     * Local product.
        +     * 
        + * + * LOCAL = 2; + */ + public static final int LOCAL_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 ChannelEnum 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 ChannelEnum forNumber(int value) { + switch (value) { + case 0: + return CHANNEL_ENUM_UNSPECIFIED; + case 1: + return ONLINE; + case 2: + return LOCAL; + 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 ChannelEnum findValueByNumber(int number) { + return ChannelEnum.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 com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.shopping.type.Channel.getDescriptor().getEnumTypes().get(0); + } + + private static final ChannelEnum[] VALUES = values(); + + public static ChannelEnum 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 ChannelEnum(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.shopping.type.Channel.ChannelEnum) + } + + 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.shopping.type.Channel)) { + return super.equals(obj); + } + com.google.shopping.type.Channel other = (com.google.shopping.type.Channel) 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.shopping.type.Channel parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.shopping.type.Channel parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.shopping.type.Channel parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.shopping.type.Channel 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.shopping.type.Channel parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.shopping.type.Channel parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.shopping.type.Channel parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.shopping.type.Channel parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.shopping.type.Channel parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.shopping.type.Channel parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.shopping.type.Channel parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.shopping.type.Channel parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.shopping.type.Channel 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
        +   * [Channel](https://support.google.com/merchants/answer/7361332) of a product.
        +   *
        +   * Channel is used to distinguish between online and local products.
        +   * 
        + * + * Protobuf type {@code google.shopping.type.Channel} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.shopping.type.Channel) + com.google.shopping.type.ChannelOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.shopping.type.TypesProto + .internal_static_google_shopping_type_Channel_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.shopping.type.TypesProto + .internal_static_google_shopping_type_Channel_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.shopping.type.Channel.class, + com.google.shopping.type.Channel.Builder.class); + } + + // Construct using com.google.shopping.type.Channel.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.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.shopping.type.TypesProto + .internal_static_google_shopping_type_Channel_descriptor; + } + + @java.lang.Override + public com.google.shopping.type.Channel getDefaultInstanceForType() { + return com.google.shopping.type.Channel.getDefaultInstance(); + } + + @java.lang.Override + public com.google.shopping.type.Channel build() { + com.google.shopping.type.Channel result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.shopping.type.Channel buildPartial() { + com.google.shopping.type.Channel result = new com.google.shopping.type.Channel(this); + onBuilt(); + return result; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.shopping.type.Channel) { + return mergeFrom((com.google.shopping.type.Channel) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.shopping.type.Channel other) { + if (other == com.google.shopping.type.Channel.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; + } + + // @@protoc_insertion_point(builder_scope:google.shopping.type.Channel) + } + + // @@protoc_insertion_point(class_scope:google.shopping.type.Channel) + private static final com.google.shopping.type.Channel DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.shopping.type.Channel(); + } + + public static com.google.shopping.type.Channel getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Channel 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.shopping.type.Channel getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-common-protos/proto-google-common-protos/src/main/java/com/google/shopping/type/ChannelOrBuilder.java b/java-common-protos/proto-google-common-protos/src/main/java/com/google/shopping/type/ChannelOrBuilder.java new file mode 100644 index 0000000000..128f6691d6 --- /dev/null +++ b/java-common-protos/proto-google-common-protos/src/main/java/com/google/shopping/type/ChannelOrBuilder.java @@ -0,0 +1,27 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/shopping/type/types.proto +// Protobuf Java Version: 4.33.2 + +package com.google.shopping.type; + +@com.google.protobuf.Generated +public interface ChannelOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.shopping.type.Channel) + com.google.protobuf.MessageOrBuilder {} diff --git a/java-common-protos/proto-google-common-protos/src/main/java/com/google/shopping/type/CustomAttribute.java b/java-common-protos/proto-google-common-protos/src/main/java/com/google/shopping/type/CustomAttribute.java new file mode 100644 index 0000000000..78be0d48cd --- /dev/null +++ b/java-common-protos/proto-google-common-protos/src/main/java/com/google/shopping/type/CustomAttribute.java @@ -0,0 +1,1410 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/shopping/type/types.proto +// Protobuf Java Version: 4.33.2 + +package com.google.shopping.type; + +/** + * + * + *
        + * A message that represents custom attributes. Exactly one of `value` or
        + * `group_values` must not be empty.
        + * 
        + * + * Protobuf type {@code google.shopping.type.CustomAttribute} + */ +@com.google.protobuf.Generated +public final class CustomAttribute extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.shopping.type.CustomAttribute) + CustomAttributeOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "CustomAttribute"); + } + + // Use CustomAttribute.newBuilder() to construct. + private CustomAttribute(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private CustomAttribute() { + name_ = ""; + value_ = ""; + groupValues_ = java.util.Collections.emptyList(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.shopping.type.TypesProto + .internal_static_google_shopping_type_CustomAttribute_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.shopping.type.TypesProto + .internal_static_google_shopping_type_CustomAttribute_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.shopping.type.CustomAttribute.class, + com.google.shopping.type.CustomAttribute.Builder.class); + } + + private int bitField0_; + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + + /** + * + * + *
        +   * The name of the attribute.
        +   * 
        + * + * optional string name = 1; + * + * @return Whether the name field is set. + */ + @java.lang.Override + public boolean hasName() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
        +   * The name of the attribute.
        +   * 
        + * + * optional 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 name of the attribute.
        +   * 
        + * + * optional 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 VALUE_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object value_ = ""; + + /** + * + * + *
        +   * The value of the attribute. If `value` is not empty, `group_values` must be
        +   * empty.
        +   * 
        + * + * optional string value = 2; + * + * @return Whether the value field is set. + */ + @java.lang.Override + public boolean hasValue() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
        +   * The value of the attribute. If `value` is not empty, `group_values` must be
        +   * empty.
        +   * 
        + * + * optional string value = 2; + * + * @return The value. + */ + @java.lang.Override + public java.lang.String getValue() { + java.lang.Object ref = value_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + value_ = s; + return s; + } + } + + /** + * + * + *
        +   * The value of the attribute. If `value` is not empty, `group_values` must be
        +   * empty.
        +   * 
        + * + * optional string value = 2; + * + * @return The bytes for value. + */ + @java.lang.Override + public com.google.protobuf.ByteString getValueBytes() { + java.lang.Object ref = value_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + value_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int GROUP_VALUES_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private java.util.List groupValues_; + + /** + * + * + *
        +   * Subattributes within this attribute group.  If
        +   * `group_values` is not empty, `value` must be empty.
        +   * 
        + * + * repeated .google.shopping.type.CustomAttribute group_values = 3; + */ + @java.lang.Override + public java.util.List getGroupValuesList() { + return groupValues_; + } + + /** + * + * + *
        +   * Subattributes within this attribute group.  If
        +   * `group_values` is not empty, `value` must be empty.
        +   * 
        + * + * repeated .google.shopping.type.CustomAttribute group_values = 3; + */ + @java.lang.Override + public java.util.List + getGroupValuesOrBuilderList() { + return groupValues_; + } + + /** + * + * + *
        +   * Subattributes within this attribute group.  If
        +   * `group_values` is not empty, `value` must be empty.
        +   * 
        + * + * repeated .google.shopping.type.CustomAttribute group_values = 3; + */ + @java.lang.Override + public int getGroupValuesCount() { + return groupValues_.size(); + } + + /** + * + * + *
        +   * Subattributes within this attribute group.  If
        +   * `group_values` is not empty, `value` must be empty.
        +   * 
        + * + * repeated .google.shopping.type.CustomAttribute group_values = 3; + */ + @java.lang.Override + public com.google.shopping.type.CustomAttribute getGroupValues(int index) { + return groupValues_.get(index); + } + + /** + * + * + *
        +   * Subattributes within this attribute group.  If
        +   * `group_values` is not empty, `value` must be empty.
        +   * 
        + * + * repeated .google.shopping.type.CustomAttribute group_values = 3; + */ + @java.lang.Override + public com.google.shopping.type.CustomAttributeOrBuilder getGroupValuesOrBuilder(int index) { + return groupValues_.get(index); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (((bitField0_ & 0x00000001) != 0)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, name_); + } + if (((bitField0_ & 0x00000002) != 0)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, value_); + } + for (int i = 0; i < groupValues_.size(); i++) { + output.writeMessage(3, groupValues_.get(i)); + } + 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.GeneratedMessage.computeStringSize(1, name_); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, value_); + } + for (int i = 0; i < groupValues_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, groupValues_.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.shopping.type.CustomAttribute)) { + return super.equals(obj); + } + com.google.shopping.type.CustomAttribute other = (com.google.shopping.type.CustomAttribute) obj; + + if (hasName() != other.hasName()) return false; + if (hasName()) { + if (!getName().equals(other.getName())) return false; + } + if (hasValue() != other.hasValue()) return false; + if (hasValue()) { + if (!getValue().equals(other.getValue())) return false; + } + if (!getGroupValuesList().equals(other.getGroupValuesList())) 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 (hasName()) { + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + } + if (hasValue()) { + hash = (37 * hash) + VALUE_FIELD_NUMBER; + hash = (53 * hash) + getValue().hashCode(); + } + if (getGroupValuesCount() > 0) { + hash = (37 * hash) + GROUP_VALUES_FIELD_NUMBER; + hash = (53 * hash) + getGroupValuesList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.shopping.type.CustomAttribute parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.shopping.type.CustomAttribute parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.shopping.type.CustomAttribute parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.shopping.type.CustomAttribute 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.shopping.type.CustomAttribute parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.shopping.type.CustomAttribute parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.shopping.type.CustomAttribute parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.shopping.type.CustomAttribute parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.shopping.type.CustomAttribute parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.shopping.type.CustomAttribute parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.shopping.type.CustomAttribute parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.shopping.type.CustomAttribute parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.shopping.type.CustomAttribute 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
        +   * A message that represents custom attributes. Exactly one of `value` or
        +   * `group_values` must not be empty.
        +   * 
        + * + * Protobuf type {@code google.shopping.type.CustomAttribute} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.shopping.type.CustomAttribute) + com.google.shopping.type.CustomAttributeOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.shopping.type.TypesProto + .internal_static_google_shopping_type_CustomAttribute_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.shopping.type.TypesProto + .internal_static_google_shopping_type_CustomAttribute_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.shopping.type.CustomAttribute.class, + com.google.shopping.type.CustomAttribute.Builder.class); + } + + // Construct using com.google.shopping.type.CustomAttribute.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + value_ = ""; + if (groupValuesBuilder_ == null) { + groupValues_ = java.util.Collections.emptyList(); + } else { + groupValues_ = null; + groupValuesBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000004); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.shopping.type.TypesProto + .internal_static_google_shopping_type_CustomAttribute_descriptor; + } + + @java.lang.Override + public com.google.shopping.type.CustomAttribute getDefaultInstanceForType() { + return com.google.shopping.type.CustomAttribute.getDefaultInstance(); + } + + @java.lang.Override + public com.google.shopping.type.CustomAttribute build() { + com.google.shopping.type.CustomAttribute result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.shopping.type.CustomAttribute buildPartial() { + com.google.shopping.type.CustomAttribute result = + new com.google.shopping.type.CustomAttribute(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields(com.google.shopping.type.CustomAttribute result) { + if (groupValuesBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0)) { + groupValues_ = java.util.Collections.unmodifiableList(groupValues_); + bitField0_ = (bitField0_ & ~0x00000004); + } + result.groupValues_ = groupValues_; + } else { + result.groupValues_ = groupValuesBuilder_.build(); + } + } + + private void buildPartial0(com.google.shopping.type.CustomAttribute result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.value_ = value_; + to_bitField0_ |= 0x00000002; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.shopping.type.CustomAttribute) { + return mergeFrom((com.google.shopping.type.CustomAttribute) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.shopping.type.CustomAttribute other) { + if (other == com.google.shopping.type.CustomAttribute.getDefaultInstance()) return this; + if (other.hasName()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.hasValue()) { + value_ = other.value_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (groupValuesBuilder_ == null) { + if (!other.groupValues_.isEmpty()) { + if (groupValues_.isEmpty()) { + groupValues_ = other.groupValues_; + bitField0_ = (bitField0_ & ~0x00000004); + } else { + ensureGroupValuesIsMutable(); + groupValues_.addAll(other.groupValues_); + } + onChanged(); + } + } else { + if (!other.groupValues_.isEmpty()) { + if (groupValuesBuilder_.isEmpty()) { + groupValuesBuilder_.dispose(); + groupValuesBuilder_ = null; + groupValues_ = other.groupValues_; + bitField0_ = (bitField0_ & ~0x00000004); + groupValuesBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders + ? internalGetGroupValuesFieldBuilder() + : null; + } else { + groupValuesBuilder_.addAllMessages(other.groupValues_); + } + } + } + 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: + { + value_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + com.google.shopping.type.CustomAttribute m = + input.readMessage( + com.google.shopping.type.CustomAttribute.parser(), extensionRegistry); + if (groupValuesBuilder_ == null) { + ensureGroupValuesIsMutable(); + groupValues_.add(m); + } else { + groupValuesBuilder_.addMessage(m); + } + 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_ = ""; + + /** + * + * + *
        +     * The name of the attribute.
        +     * 
        + * + * optional string name = 1; + * + * @return Whether the name field is set. + */ + public boolean hasName() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
        +     * The name of the attribute.
        +     * 
        + * + * optional 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 name of the attribute.
        +     * 
        + * + * optional 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 name of the attribute.
        +     * 
        + * + * optional 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 name of the attribute.
        +     * 
        + * + * optional string name = 1; + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
        +     * The name of the attribute.
        +     * 
        + * + * optional 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 value_ = ""; + + /** + * + * + *
        +     * The value of the attribute. If `value` is not empty, `group_values` must be
        +     * empty.
        +     * 
        + * + * optional string value = 2; + * + * @return Whether the value field is set. + */ + public boolean hasValue() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
        +     * The value of the attribute. If `value` is not empty, `group_values` must be
        +     * empty.
        +     * 
        + * + * optional string value = 2; + * + * @return The value. + */ + public java.lang.String getValue() { + java.lang.Object ref = value_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + value_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
        +     * The value of the attribute. If `value` is not empty, `group_values` must be
        +     * empty.
        +     * 
        + * + * optional string value = 2; + * + * @return The bytes for value. + */ + public com.google.protobuf.ByteString getValueBytes() { + java.lang.Object ref = value_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + value_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
        +     * The value of the attribute. If `value` is not empty, `group_values` must be
        +     * empty.
        +     * 
        + * + * optional string value = 2; + * + * @param value The value to set. + * @return This builder for chaining. + */ + public Builder setValue(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + value_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
        +     * The value of the attribute. If `value` is not empty, `group_values` must be
        +     * empty.
        +     * 
        + * + * optional string value = 2; + * + * @return This builder for chaining. + */ + public Builder clearValue() { + value_ = getDefaultInstance().getValue(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
        +     * The value of the attribute. If `value` is not empty, `group_values` must be
        +     * empty.
        +     * 
        + * + * optional string value = 2; + * + * @param value The bytes for value to set. + * @return This builder for chaining. + */ + public Builder setValueBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + value_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private java.util.List groupValues_ = + java.util.Collections.emptyList(); + + private void ensureGroupValuesIsMutable() { + if (!((bitField0_ & 0x00000004) != 0)) { + groupValues_ = + new java.util.ArrayList(groupValues_); + bitField0_ |= 0x00000004; + } + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.google.shopping.type.CustomAttribute, + com.google.shopping.type.CustomAttribute.Builder, + com.google.shopping.type.CustomAttributeOrBuilder> + groupValuesBuilder_; + + /** + * + * + *
        +     * Subattributes within this attribute group.  If
        +     * `group_values` is not empty, `value` must be empty.
        +     * 
        + * + * repeated .google.shopping.type.CustomAttribute group_values = 3; + */ + public java.util.List getGroupValuesList() { + if (groupValuesBuilder_ == null) { + return java.util.Collections.unmodifiableList(groupValues_); + } else { + return groupValuesBuilder_.getMessageList(); + } + } + + /** + * + * + *
        +     * Subattributes within this attribute group.  If
        +     * `group_values` is not empty, `value` must be empty.
        +     * 
        + * + * repeated .google.shopping.type.CustomAttribute group_values = 3; + */ + public int getGroupValuesCount() { + if (groupValuesBuilder_ == null) { + return groupValues_.size(); + } else { + return groupValuesBuilder_.getCount(); + } + } + + /** + * + * + *
        +     * Subattributes within this attribute group.  If
        +     * `group_values` is not empty, `value` must be empty.
        +     * 
        + * + * repeated .google.shopping.type.CustomAttribute group_values = 3; + */ + public com.google.shopping.type.CustomAttribute getGroupValues(int index) { + if (groupValuesBuilder_ == null) { + return groupValues_.get(index); + } else { + return groupValuesBuilder_.getMessage(index); + } + } + + /** + * + * + *
        +     * Subattributes within this attribute group.  If
        +     * `group_values` is not empty, `value` must be empty.
        +     * 
        + * + * repeated .google.shopping.type.CustomAttribute group_values = 3; + */ + public Builder setGroupValues(int index, com.google.shopping.type.CustomAttribute value) { + if (groupValuesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureGroupValuesIsMutable(); + groupValues_.set(index, value); + onChanged(); + } else { + groupValuesBuilder_.setMessage(index, value); + } + return this; + } + + /** + * + * + *
        +     * Subattributes within this attribute group.  If
        +     * `group_values` is not empty, `value` must be empty.
        +     * 
        + * + * repeated .google.shopping.type.CustomAttribute group_values = 3; + */ + public Builder setGroupValues( + int index, com.google.shopping.type.CustomAttribute.Builder builderForValue) { + if (groupValuesBuilder_ == null) { + ensureGroupValuesIsMutable(); + groupValues_.set(index, builderForValue.build()); + onChanged(); + } else { + groupValuesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
        +     * Subattributes within this attribute group.  If
        +     * `group_values` is not empty, `value` must be empty.
        +     * 
        + * + * repeated .google.shopping.type.CustomAttribute group_values = 3; + */ + public Builder addGroupValues(com.google.shopping.type.CustomAttribute value) { + if (groupValuesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureGroupValuesIsMutable(); + groupValues_.add(value); + onChanged(); + } else { + groupValuesBuilder_.addMessage(value); + } + return this; + } + + /** + * + * + *
        +     * Subattributes within this attribute group.  If
        +     * `group_values` is not empty, `value` must be empty.
        +     * 
        + * + * repeated .google.shopping.type.CustomAttribute group_values = 3; + */ + public Builder addGroupValues(int index, com.google.shopping.type.CustomAttribute value) { + if (groupValuesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureGroupValuesIsMutable(); + groupValues_.add(index, value); + onChanged(); + } else { + groupValuesBuilder_.addMessage(index, value); + } + return this; + } + + /** + * + * + *
        +     * Subattributes within this attribute group.  If
        +     * `group_values` is not empty, `value` must be empty.
        +     * 
        + * + * repeated .google.shopping.type.CustomAttribute group_values = 3; + */ + public Builder addGroupValues( + com.google.shopping.type.CustomAttribute.Builder builderForValue) { + if (groupValuesBuilder_ == null) { + ensureGroupValuesIsMutable(); + groupValues_.add(builderForValue.build()); + onChanged(); + } else { + groupValuesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + + /** + * + * + *
        +     * Subattributes within this attribute group.  If
        +     * `group_values` is not empty, `value` must be empty.
        +     * 
        + * + * repeated .google.shopping.type.CustomAttribute group_values = 3; + */ + public Builder addGroupValues( + int index, com.google.shopping.type.CustomAttribute.Builder builderForValue) { + if (groupValuesBuilder_ == null) { + ensureGroupValuesIsMutable(); + groupValues_.add(index, builderForValue.build()); + onChanged(); + } else { + groupValuesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
        +     * Subattributes within this attribute group.  If
        +     * `group_values` is not empty, `value` must be empty.
        +     * 
        + * + * repeated .google.shopping.type.CustomAttribute group_values = 3; + */ + public Builder addAllGroupValues( + java.lang.Iterable values) { + if (groupValuesBuilder_ == null) { + ensureGroupValuesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, groupValues_); + onChanged(); + } else { + groupValuesBuilder_.addAllMessages(values); + } + return this; + } + + /** + * + * + *
        +     * Subattributes within this attribute group.  If
        +     * `group_values` is not empty, `value` must be empty.
        +     * 
        + * + * repeated .google.shopping.type.CustomAttribute group_values = 3; + */ + public Builder clearGroupValues() { + if (groupValuesBuilder_ == null) { + groupValues_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + } else { + groupValuesBuilder_.clear(); + } + return this; + } + + /** + * + * + *
        +     * Subattributes within this attribute group.  If
        +     * `group_values` is not empty, `value` must be empty.
        +     * 
        + * + * repeated .google.shopping.type.CustomAttribute group_values = 3; + */ + public Builder removeGroupValues(int index) { + if (groupValuesBuilder_ == null) { + ensureGroupValuesIsMutable(); + groupValues_.remove(index); + onChanged(); + } else { + groupValuesBuilder_.remove(index); + } + return this; + } + + /** + * + * + *
        +     * Subattributes within this attribute group.  If
        +     * `group_values` is not empty, `value` must be empty.
        +     * 
        + * + * repeated .google.shopping.type.CustomAttribute group_values = 3; + */ + public com.google.shopping.type.CustomAttribute.Builder getGroupValuesBuilder(int index) { + return internalGetGroupValuesFieldBuilder().getBuilder(index); + } + + /** + * + * + *
        +     * Subattributes within this attribute group.  If
        +     * `group_values` is not empty, `value` must be empty.
        +     * 
        + * + * repeated .google.shopping.type.CustomAttribute group_values = 3; + */ + public com.google.shopping.type.CustomAttributeOrBuilder getGroupValuesOrBuilder(int index) { + if (groupValuesBuilder_ == null) { + return groupValues_.get(index); + } else { + return groupValuesBuilder_.getMessageOrBuilder(index); + } + } + + /** + * + * + *
        +     * Subattributes within this attribute group.  If
        +     * `group_values` is not empty, `value` must be empty.
        +     * 
        + * + * repeated .google.shopping.type.CustomAttribute group_values = 3; + */ + public java.util.List + getGroupValuesOrBuilderList() { + if (groupValuesBuilder_ != null) { + return groupValuesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(groupValues_); + } + } + + /** + * + * + *
        +     * Subattributes within this attribute group.  If
        +     * `group_values` is not empty, `value` must be empty.
        +     * 
        + * + * repeated .google.shopping.type.CustomAttribute group_values = 3; + */ + public com.google.shopping.type.CustomAttribute.Builder addGroupValuesBuilder() { + return internalGetGroupValuesFieldBuilder() + .addBuilder(com.google.shopping.type.CustomAttribute.getDefaultInstance()); + } + + /** + * + * + *
        +     * Subattributes within this attribute group.  If
        +     * `group_values` is not empty, `value` must be empty.
        +     * 
        + * + * repeated .google.shopping.type.CustomAttribute group_values = 3; + */ + public com.google.shopping.type.CustomAttribute.Builder addGroupValuesBuilder(int index) { + return internalGetGroupValuesFieldBuilder() + .addBuilder(index, com.google.shopping.type.CustomAttribute.getDefaultInstance()); + } + + /** + * + * + *
        +     * Subattributes within this attribute group.  If
        +     * `group_values` is not empty, `value` must be empty.
        +     * 
        + * + * repeated .google.shopping.type.CustomAttribute group_values = 3; + */ + public java.util.List + getGroupValuesBuilderList() { + return internalGetGroupValuesFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.google.shopping.type.CustomAttribute, + com.google.shopping.type.CustomAttribute.Builder, + com.google.shopping.type.CustomAttributeOrBuilder> + internalGetGroupValuesFieldBuilder() { + if (groupValuesBuilder_ == null) { + groupValuesBuilder_ = + new com.google.protobuf.RepeatedFieldBuilder< + com.google.shopping.type.CustomAttribute, + com.google.shopping.type.CustomAttribute.Builder, + com.google.shopping.type.CustomAttributeOrBuilder>( + groupValues_, ((bitField0_ & 0x00000004) != 0), getParentForChildren(), isClean()); + groupValues_ = null; + } + return groupValuesBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.shopping.type.CustomAttribute) + } + + // @@protoc_insertion_point(class_scope:google.shopping.type.CustomAttribute) + private static final com.google.shopping.type.CustomAttribute DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.shopping.type.CustomAttribute(); + } + + public static com.google.shopping.type.CustomAttribute getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CustomAttribute 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.shopping.type.CustomAttribute getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-common-protos/proto-google-common-protos/src/main/java/com/google/shopping/type/CustomAttributeOrBuilder.java b/java-common-protos/proto-google-common-protos/src/main/java/com/google/shopping/type/CustomAttributeOrBuilder.java new file mode 100644 index 0000000000..99b137213a --- /dev/null +++ b/java-common-protos/proto-google-common-protos/src/main/java/com/google/shopping/type/CustomAttributeOrBuilder.java @@ -0,0 +1,170 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/shopping/type/types.proto +// Protobuf Java Version: 4.33.2 + +package com.google.shopping.type; + +@com.google.protobuf.Generated +public interface CustomAttributeOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.shopping.type.CustomAttribute) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
        +   * The name of the attribute.
        +   * 
        + * + * optional string name = 1; + * + * @return Whether the name field is set. + */ + boolean hasName(); + + /** + * + * + *
        +   * The name of the attribute.
        +   * 
        + * + * optional string name = 1; + * + * @return The name. + */ + java.lang.String getName(); + + /** + * + * + *
        +   * The name of the attribute.
        +   * 
        + * + * optional string name = 1; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
        +   * The value of the attribute. If `value` is not empty, `group_values` must be
        +   * empty.
        +   * 
        + * + * optional string value = 2; + * + * @return Whether the value field is set. + */ + boolean hasValue(); + + /** + * + * + *
        +   * The value of the attribute. If `value` is not empty, `group_values` must be
        +   * empty.
        +   * 
        + * + * optional string value = 2; + * + * @return The value. + */ + java.lang.String getValue(); + + /** + * + * + *
        +   * The value of the attribute. If `value` is not empty, `group_values` must be
        +   * empty.
        +   * 
        + * + * optional string value = 2; + * + * @return The bytes for value. + */ + com.google.protobuf.ByteString getValueBytes(); + + /** + * + * + *
        +   * Subattributes within this attribute group.  If
        +   * `group_values` is not empty, `value` must be empty.
        +   * 
        + * + * repeated .google.shopping.type.CustomAttribute group_values = 3; + */ + java.util.List getGroupValuesList(); + + /** + * + * + *
        +   * Subattributes within this attribute group.  If
        +   * `group_values` is not empty, `value` must be empty.
        +   * 
        + * + * repeated .google.shopping.type.CustomAttribute group_values = 3; + */ + com.google.shopping.type.CustomAttribute getGroupValues(int index); + + /** + * + * + *
        +   * Subattributes within this attribute group.  If
        +   * `group_values` is not empty, `value` must be empty.
        +   * 
        + * + * repeated .google.shopping.type.CustomAttribute group_values = 3; + */ + int getGroupValuesCount(); + + /** + * + * + *
        +   * Subattributes within this attribute group.  If
        +   * `group_values` is not empty, `value` must be empty.
        +   * 
        + * + * repeated .google.shopping.type.CustomAttribute group_values = 3; + */ + java.util.List + getGroupValuesOrBuilderList(); + + /** + * + * + *
        +   * Subattributes within this attribute group.  If
        +   * `group_values` is not empty, `value` must be empty.
        +   * 
        + * + * repeated .google.shopping.type.CustomAttribute group_values = 3; + */ + com.google.shopping.type.CustomAttributeOrBuilder getGroupValuesOrBuilder(int index); +} diff --git a/java-common-protos/proto-google-common-protos/src/main/java/com/google/shopping/type/Destination.java b/java-common-protos/proto-google-common-protos/src/main/java/com/google/shopping/type/Destination.java new file mode 100644 index 0000000000..ac650a1234 --- /dev/null +++ b/java-common-protos/proto-google-common-protos/src/main/java/com/google/shopping/type/Destination.java @@ -0,0 +1,805 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/shopping/type/types.proto +// Protobuf Java Version: 4.33.2 + +package com.google.shopping.type; + +/** + * + * + *
        + * Destinations available for a product.
        + *
        + * Destinations are used in Merchant Center to allow you to control where the
        + * products from your data feed should be displayed.
        + * 
        + * + * Protobuf type {@code google.shopping.type.Destination} + */ +@com.google.protobuf.Generated +public final class Destination extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.shopping.type.Destination) + DestinationOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "Destination"); + } + + // Use Destination.newBuilder() to construct. + private Destination(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private Destination() {} + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.shopping.type.TypesProto + .internal_static_google_shopping_type_Destination_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.shopping.type.TypesProto + .internal_static_google_shopping_type_Destination_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.shopping.type.Destination.class, + com.google.shopping.type.Destination.Builder.class); + } + + /** + * + * + *
        +   * Destination values.
        +   * 
        + * + * Protobuf enum {@code google.shopping.type.Destination.DestinationEnum} + */ + public enum DestinationEnum implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
        +     * Not specified.
        +     * 
        + * + * DESTINATION_ENUM_UNSPECIFIED = 0; + */ + DESTINATION_ENUM_UNSPECIFIED(0), + /** + * + * + *
        +     * [Shopping ads](https://support.google.com/google-ads/answer/2454022).
        +     * 
        + * + * SHOPPING_ADS = 1; + */ + SHOPPING_ADS(1), + /** + * + * + *
        +     * [Display ads](https://support.google.com/merchants/answer/6069387).
        +     * 
        + * + * DISPLAY_ADS = 2; + */ + DISPLAY_ADS(2), + /** + * + * + *
        +     * [Local inventory
        +     * ads](https://support.google.com/merchants/answer/3057972).
        +     * 
        + * + * LOCAL_INVENTORY_ADS = 3; + */ + LOCAL_INVENTORY_ADS(3), + /** + * + * + *
        +     * [Free listings](https://support.google.com/merchants/answer/9199328).
        +     * 
        + * + * FREE_LISTINGS = 4; + */ + FREE_LISTINGS(4), + /** + * + * + *
        +     * [Free local product
        +     * listings](https://support.google.com/merchants/answer/9825611).
        +     * 
        + * + * FREE_LOCAL_LISTINGS = 5; + */ + FREE_LOCAL_LISTINGS(5), + /** + * + * + *
        +     * [YouTube Shopping](https://support.google.com/merchants/answer/12362804).
        +     * 
        + * + * YOUTUBE_SHOPPING = 6; + */ + YOUTUBE_SHOPPING(6), + /** + * + * + *
        +     * Youtube shopping checkout.
        +     * 
        + * + * YOUTUBE_SHOPPING_CHECKOUT = 7; + */ + YOUTUBE_SHOPPING_CHECKOUT(7), + /** + * + * + *
        +     * [Youtube Affiliate](https://support.google.com/youtube/answer/13376398).
        +     * 
        + * + * YOUTUBE_AFFILIATE = 8; + */ + YOUTUBE_AFFILIATE(8), + /** + * + * + *
        +     * [Free vehicle
        +     * listings](https://support.google.com/merchants/answer/11189169).
        +     * 
        + * + * FREE_VEHICLE_LISTINGS = 9; + */ + FREE_VEHICLE_LISTINGS(9), + /** + * + * + *
        +     * [Vehicle ads](https://support.google.com/merchants/answer/11189169).
        +     * 
        + * + * VEHICLE_ADS = 10; + */ + VEHICLE_ADS(10), + /** + * + * + *
        +     * [Cloud retail](https://cloud.google.com/solutions/retail).
        +     * 
        + * + * CLOUD_RETAIL = 11; + */ + CLOUD_RETAIL(11), + /** + * + * + *
        +     * [Local cloud retail](https://cloud.google.com/solutions/retail).
        +     * 
        + * + * LOCAL_CLOUD_RETAIL = 12; + */ + LOCAL_CLOUD_RETAIL(12), + UNRECOGNIZED(-1), + ; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "DestinationEnum"); + } + + /** + * + * + *
        +     * Not specified.
        +     * 
        + * + * DESTINATION_ENUM_UNSPECIFIED = 0; + */ + public static final int DESTINATION_ENUM_UNSPECIFIED_VALUE = 0; + + /** + * + * + *
        +     * [Shopping ads](https://support.google.com/google-ads/answer/2454022).
        +     * 
        + * + * SHOPPING_ADS = 1; + */ + public static final int SHOPPING_ADS_VALUE = 1; + + /** + * + * + *
        +     * [Display ads](https://support.google.com/merchants/answer/6069387).
        +     * 
        + * + * DISPLAY_ADS = 2; + */ + public static final int DISPLAY_ADS_VALUE = 2; + + /** + * + * + *
        +     * [Local inventory
        +     * ads](https://support.google.com/merchants/answer/3057972).
        +     * 
        + * + * LOCAL_INVENTORY_ADS = 3; + */ + public static final int LOCAL_INVENTORY_ADS_VALUE = 3; + + /** + * + * + *
        +     * [Free listings](https://support.google.com/merchants/answer/9199328).
        +     * 
        + * + * FREE_LISTINGS = 4; + */ + public static final int FREE_LISTINGS_VALUE = 4; + + /** + * + * + *
        +     * [Free local product
        +     * listings](https://support.google.com/merchants/answer/9825611).
        +     * 
        + * + * FREE_LOCAL_LISTINGS = 5; + */ + public static final int FREE_LOCAL_LISTINGS_VALUE = 5; + + /** + * + * + *
        +     * [YouTube Shopping](https://support.google.com/merchants/answer/12362804).
        +     * 
        + * + * YOUTUBE_SHOPPING = 6; + */ + public static final int YOUTUBE_SHOPPING_VALUE = 6; + + /** + * + * + *
        +     * Youtube shopping checkout.
        +     * 
        + * + * YOUTUBE_SHOPPING_CHECKOUT = 7; + */ + public static final int YOUTUBE_SHOPPING_CHECKOUT_VALUE = 7; + + /** + * + * + *
        +     * [Youtube Affiliate](https://support.google.com/youtube/answer/13376398).
        +     * 
        + * + * YOUTUBE_AFFILIATE = 8; + */ + public static final int YOUTUBE_AFFILIATE_VALUE = 8; + + /** + * + * + *
        +     * [Free vehicle
        +     * listings](https://support.google.com/merchants/answer/11189169).
        +     * 
        + * + * FREE_VEHICLE_LISTINGS = 9; + */ + public static final int FREE_VEHICLE_LISTINGS_VALUE = 9; + + /** + * + * + *
        +     * [Vehicle ads](https://support.google.com/merchants/answer/11189169).
        +     * 
        + * + * VEHICLE_ADS = 10; + */ + public static final int VEHICLE_ADS_VALUE = 10; + + /** + * + * + *
        +     * [Cloud retail](https://cloud.google.com/solutions/retail).
        +     * 
        + * + * CLOUD_RETAIL = 11; + */ + public static final int CLOUD_RETAIL_VALUE = 11; + + /** + * + * + *
        +     * [Local cloud retail](https://cloud.google.com/solutions/retail).
        +     * 
        + * + * LOCAL_CLOUD_RETAIL = 12; + */ + public static final int LOCAL_CLOUD_RETAIL_VALUE = 12; + + 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 DestinationEnum 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 DestinationEnum forNumber(int value) { + switch (value) { + case 0: + return DESTINATION_ENUM_UNSPECIFIED; + case 1: + return SHOPPING_ADS; + case 2: + return DISPLAY_ADS; + case 3: + return LOCAL_INVENTORY_ADS; + case 4: + return FREE_LISTINGS; + case 5: + return FREE_LOCAL_LISTINGS; + case 6: + return YOUTUBE_SHOPPING; + case 7: + return YOUTUBE_SHOPPING_CHECKOUT; + case 8: + return YOUTUBE_AFFILIATE; + case 9: + return FREE_VEHICLE_LISTINGS; + case 10: + return VEHICLE_ADS; + case 11: + return CLOUD_RETAIL; + case 12: + return LOCAL_CLOUD_RETAIL; + 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 DestinationEnum findValueByNumber(int number) { + return DestinationEnum.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 com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.shopping.type.Destination.getDescriptor().getEnumTypes().get(0); + } + + private static final DestinationEnum[] VALUES = values(); + + public static DestinationEnum 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 DestinationEnum(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.shopping.type.Destination.DestinationEnum) + } + + 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.shopping.type.Destination)) { + return super.equals(obj); + } + com.google.shopping.type.Destination other = (com.google.shopping.type.Destination) 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.shopping.type.Destination parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.shopping.type.Destination parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.shopping.type.Destination parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.shopping.type.Destination 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.shopping.type.Destination parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.shopping.type.Destination parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.shopping.type.Destination parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.shopping.type.Destination parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.shopping.type.Destination parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.shopping.type.Destination parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.shopping.type.Destination parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.shopping.type.Destination parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.shopping.type.Destination 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
        +   * Destinations available for a product.
        +   *
        +   * Destinations are used in Merchant Center to allow you to control where the
        +   * products from your data feed should be displayed.
        +   * 
        + * + * Protobuf type {@code google.shopping.type.Destination} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.shopping.type.Destination) + com.google.shopping.type.DestinationOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.shopping.type.TypesProto + .internal_static_google_shopping_type_Destination_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.shopping.type.TypesProto + .internal_static_google_shopping_type_Destination_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.shopping.type.Destination.class, + com.google.shopping.type.Destination.Builder.class); + } + + // Construct using com.google.shopping.type.Destination.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.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.shopping.type.TypesProto + .internal_static_google_shopping_type_Destination_descriptor; + } + + @java.lang.Override + public com.google.shopping.type.Destination getDefaultInstanceForType() { + return com.google.shopping.type.Destination.getDefaultInstance(); + } + + @java.lang.Override + public com.google.shopping.type.Destination build() { + com.google.shopping.type.Destination result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.shopping.type.Destination buildPartial() { + com.google.shopping.type.Destination result = new com.google.shopping.type.Destination(this); + onBuilt(); + return result; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.shopping.type.Destination) { + return mergeFrom((com.google.shopping.type.Destination) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.shopping.type.Destination other) { + if (other == com.google.shopping.type.Destination.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; + } + + // @@protoc_insertion_point(builder_scope:google.shopping.type.Destination) + } + + // @@protoc_insertion_point(class_scope:google.shopping.type.Destination) + private static final com.google.shopping.type.Destination DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.shopping.type.Destination(); + } + + public static com.google.shopping.type.Destination getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Destination 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.shopping.type.Destination getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-common-protos/proto-google-common-protos/src/main/java/com/google/shopping/type/DestinationOrBuilder.java b/java-common-protos/proto-google-common-protos/src/main/java/com/google/shopping/type/DestinationOrBuilder.java new file mode 100644 index 0000000000..5ad7855124 --- /dev/null +++ b/java-common-protos/proto-google-common-protos/src/main/java/com/google/shopping/type/DestinationOrBuilder.java @@ -0,0 +1,27 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/shopping/type/types.proto +// Protobuf Java Version: 4.33.2 + +package com.google.shopping.type; + +@com.google.protobuf.Generated +public interface DestinationOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.shopping.type.Destination) + com.google.protobuf.MessageOrBuilder {} diff --git a/java-common-protos/proto-google-common-protos/src/main/java/com/google/shopping/type/Price.java b/java-common-protos/proto-google-common-protos/src/main/java/com/google/shopping/type/Price.java new file mode 100644 index 0000000000..eb5d4b6ea6 --- /dev/null +++ b/java-common-protos/proto-google-common-protos/src/main/java/com/google/shopping/type/Price.java @@ -0,0 +1,786 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/shopping/type/types.proto +// Protobuf Java Version: 4.33.2 + +package com.google.shopping.type; + +/** + * + * + *
        + * The price represented as a number and currency.
        + * 
        + * + * Protobuf type {@code google.shopping.type.Price} + */ +@com.google.protobuf.Generated +public final class Price extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.shopping.type.Price) + PriceOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "Price"); + } + + // Use Price.newBuilder() to construct. + private Price(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private Price() { + currencyCode_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.shopping.type.TypesProto + .internal_static_google_shopping_type_Price_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.shopping.type.TypesProto + .internal_static_google_shopping_type_Price_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.shopping.type.Price.class, com.google.shopping.type.Price.Builder.class); + } + + private int bitField0_; + public static final int AMOUNT_MICROS_FIELD_NUMBER = 1; + private long amountMicros_ = 0L; + + /** + * + * + *
        +   * The price represented as a number in micros (1 million micros is an
        +   * equivalent to one's currency standard unit, for example, 1 USD = 1000000
        +   * micros).
        +   * 
        + * + * optional int64 amount_micros = 1; + * + * @return Whether the amountMicros field is set. + */ + @java.lang.Override + public boolean hasAmountMicros() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
        +   * The price represented as a number in micros (1 million micros is an
        +   * equivalent to one's currency standard unit, for example, 1 USD = 1000000
        +   * micros).
        +   * 
        + * + * optional int64 amount_micros = 1; + * + * @return The amountMicros. + */ + @java.lang.Override + public long getAmountMicros() { + return amountMicros_; + } + + public static final int CURRENCY_CODE_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object currencyCode_ = ""; + + /** + * + * + *
        +   * The currency of the price using three-letter acronyms according to [ISO
        +   * 4217](http://en.wikipedia.org/wiki/ISO_4217).
        +   * 
        + * + * optional string currency_code = 2; + * + * @return Whether the currencyCode field is set. + */ + @java.lang.Override + public boolean hasCurrencyCode() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
        +   * The currency of the price using three-letter acronyms according to [ISO
        +   * 4217](http://en.wikipedia.org/wiki/ISO_4217).
        +   * 
        + * + * optional string currency_code = 2; + * + * @return The currencyCode. + */ + @java.lang.Override + public java.lang.String getCurrencyCode() { + java.lang.Object ref = currencyCode_; + 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(); + currencyCode_ = s; + return s; + } + } + + /** + * + * + *
        +   * The currency of the price using three-letter acronyms according to [ISO
        +   * 4217](http://en.wikipedia.org/wiki/ISO_4217).
        +   * 
        + * + * optional string currency_code = 2; + * + * @return The bytes for currencyCode. + */ + @java.lang.Override + public com.google.protobuf.ByteString getCurrencyCodeBytes() { + java.lang.Object ref = currencyCode_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + currencyCode_ = 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.writeInt64(1, amountMicros_); + } + if (((bitField0_ & 0x00000002) != 0)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, currencyCode_); + } + 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.computeInt64Size(1, amountMicros_); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, currencyCode_); + } + 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.shopping.type.Price)) { + return super.equals(obj); + } + com.google.shopping.type.Price other = (com.google.shopping.type.Price) obj; + + if (hasAmountMicros() != other.hasAmountMicros()) return false; + if (hasAmountMicros()) { + if (getAmountMicros() != other.getAmountMicros()) return false; + } + if (hasCurrencyCode() != other.hasCurrencyCode()) return false; + if (hasCurrencyCode()) { + if (!getCurrencyCode().equals(other.getCurrencyCode())) 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 (hasAmountMicros()) { + hash = (37 * hash) + AMOUNT_MICROS_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getAmountMicros()); + } + if (hasCurrencyCode()) { + hash = (37 * hash) + CURRENCY_CODE_FIELD_NUMBER; + hash = (53 * hash) + getCurrencyCode().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.shopping.type.Price parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.shopping.type.Price parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.shopping.type.Price parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.shopping.type.Price 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.shopping.type.Price parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.shopping.type.Price parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.shopping.type.Price parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.shopping.type.Price parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.shopping.type.Price parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.shopping.type.Price parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.shopping.type.Price parseFrom(com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.shopping.type.Price parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.shopping.type.Price 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
        +   * The price represented as a number and currency.
        +   * 
        + * + * Protobuf type {@code google.shopping.type.Price} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.shopping.type.Price) + com.google.shopping.type.PriceOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.shopping.type.TypesProto + .internal_static_google_shopping_type_Price_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.shopping.type.TypesProto + .internal_static_google_shopping_type_Price_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.shopping.type.Price.class, com.google.shopping.type.Price.Builder.class); + } + + // Construct using com.google.shopping.type.Price.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + amountMicros_ = 0L; + currencyCode_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.shopping.type.TypesProto + .internal_static_google_shopping_type_Price_descriptor; + } + + @java.lang.Override + public com.google.shopping.type.Price getDefaultInstanceForType() { + return com.google.shopping.type.Price.getDefaultInstance(); + } + + @java.lang.Override + public com.google.shopping.type.Price build() { + com.google.shopping.type.Price result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.shopping.type.Price buildPartial() { + com.google.shopping.type.Price result = new com.google.shopping.type.Price(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.shopping.type.Price result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.amountMicros_ = amountMicros_; + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.currencyCode_ = currencyCode_; + to_bitField0_ |= 0x00000002; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.shopping.type.Price) { + return mergeFrom((com.google.shopping.type.Price) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.shopping.type.Price other) { + if (other == com.google.shopping.type.Price.getDefaultInstance()) return this; + if (other.hasAmountMicros()) { + setAmountMicros(other.getAmountMicros()); + } + if (other.hasCurrencyCode()) { + currencyCode_ = other.currencyCode_; + 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: + { + amountMicros_ = input.readInt64(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 18: + { + currencyCode_ = 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 long amountMicros_; + + /** + * + * + *
        +     * The price represented as a number in micros (1 million micros is an
        +     * equivalent to one's currency standard unit, for example, 1 USD = 1000000
        +     * micros).
        +     * 
        + * + * optional int64 amount_micros = 1; + * + * @return Whether the amountMicros field is set. + */ + @java.lang.Override + public boolean hasAmountMicros() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
        +     * The price represented as a number in micros (1 million micros is an
        +     * equivalent to one's currency standard unit, for example, 1 USD = 1000000
        +     * micros).
        +     * 
        + * + * optional int64 amount_micros = 1; + * + * @return The amountMicros. + */ + @java.lang.Override + public long getAmountMicros() { + return amountMicros_; + } + + /** + * + * + *
        +     * The price represented as a number in micros (1 million micros is an
        +     * equivalent to one's currency standard unit, for example, 1 USD = 1000000
        +     * micros).
        +     * 
        + * + * optional int64 amount_micros = 1; + * + * @param value The amountMicros to set. + * @return This builder for chaining. + */ + public Builder setAmountMicros(long value) { + + amountMicros_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
        +     * The price represented as a number in micros (1 million micros is an
        +     * equivalent to one's currency standard unit, for example, 1 USD = 1000000
        +     * micros).
        +     * 
        + * + * optional int64 amount_micros = 1; + * + * @return This builder for chaining. + */ + public Builder clearAmountMicros() { + bitField0_ = (bitField0_ & ~0x00000001); + amountMicros_ = 0L; + onChanged(); + return this; + } + + private java.lang.Object currencyCode_ = ""; + + /** + * + * + *
        +     * The currency of the price using three-letter acronyms according to [ISO
        +     * 4217](http://en.wikipedia.org/wiki/ISO_4217).
        +     * 
        + * + * optional string currency_code = 2; + * + * @return Whether the currencyCode field is set. + */ + public boolean hasCurrencyCode() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
        +     * The currency of the price using three-letter acronyms according to [ISO
        +     * 4217](http://en.wikipedia.org/wiki/ISO_4217).
        +     * 
        + * + * optional string currency_code = 2; + * + * @return The currencyCode. + */ + public java.lang.String getCurrencyCode() { + java.lang.Object ref = currencyCode_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + currencyCode_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
        +     * The currency of the price using three-letter acronyms according to [ISO
        +     * 4217](http://en.wikipedia.org/wiki/ISO_4217).
        +     * 
        + * + * optional string currency_code = 2; + * + * @return The bytes for currencyCode. + */ + public com.google.protobuf.ByteString getCurrencyCodeBytes() { + java.lang.Object ref = currencyCode_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + currencyCode_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
        +     * The currency of the price using three-letter acronyms according to [ISO
        +     * 4217](http://en.wikipedia.org/wiki/ISO_4217).
        +     * 
        + * + * optional string currency_code = 2; + * + * @param value The currencyCode to set. + * @return This builder for chaining. + */ + public Builder setCurrencyCode(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + currencyCode_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
        +     * The currency of the price using three-letter acronyms according to [ISO
        +     * 4217](http://en.wikipedia.org/wiki/ISO_4217).
        +     * 
        + * + * optional string currency_code = 2; + * + * @return This builder for chaining. + */ + public Builder clearCurrencyCode() { + currencyCode_ = getDefaultInstance().getCurrencyCode(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
        +     * The currency of the price using three-letter acronyms according to [ISO
        +     * 4217](http://en.wikipedia.org/wiki/ISO_4217).
        +     * 
        + * + * optional string currency_code = 2; + * + * @param value The bytes for currencyCode to set. + * @return This builder for chaining. + */ + public Builder setCurrencyCodeBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + currencyCode_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.shopping.type.Price) + } + + // @@protoc_insertion_point(class_scope:google.shopping.type.Price) + private static final com.google.shopping.type.Price DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.shopping.type.Price(); + } + + public static com.google.shopping.type.Price getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Price 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.shopping.type.Price getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-common-protos/proto-google-common-protos/src/main/java/com/google/shopping/type/PriceOrBuilder.java b/java-common-protos/proto-google-common-protos/src/main/java/com/google/shopping/type/PriceOrBuilder.java new file mode 100644 index 0000000000..98d726b147 --- /dev/null +++ b/java-common-protos/proto-google-common-protos/src/main/java/com/google/shopping/type/PriceOrBuilder.java @@ -0,0 +1,100 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/shopping/type/types.proto +// Protobuf Java Version: 4.33.2 + +package com.google.shopping.type; + +@com.google.protobuf.Generated +public interface PriceOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.shopping.type.Price) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
        +   * The price represented as a number in micros (1 million micros is an
        +   * equivalent to one's currency standard unit, for example, 1 USD = 1000000
        +   * micros).
        +   * 
        + * + * optional int64 amount_micros = 1; + * + * @return Whether the amountMicros field is set. + */ + boolean hasAmountMicros(); + + /** + * + * + *
        +   * The price represented as a number in micros (1 million micros is an
        +   * equivalent to one's currency standard unit, for example, 1 USD = 1000000
        +   * micros).
        +   * 
        + * + * optional int64 amount_micros = 1; + * + * @return The amountMicros. + */ + long getAmountMicros(); + + /** + * + * + *
        +   * The currency of the price using three-letter acronyms according to [ISO
        +   * 4217](http://en.wikipedia.org/wiki/ISO_4217).
        +   * 
        + * + * optional string currency_code = 2; + * + * @return Whether the currencyCode field is set. + */ + boolean hasCurrencyCode(); + + /** + * + * + *
        +   * The currency of the price using three-letter acronyms according to [ISO
        +   * 4217](http://en.wikipedia.org/wiki/ISO_4217).
        +   * 
        + * + * optional string currency_code = 2; + * + * @return The currencyCode. + */ + java.lang.String getCurrencyCode(); + + /** + * + * + *
        +   * The currency of the price using three-letter acronyms according to [ISO
        +   * 4217](http://en.wikipedia.org/wiki/ISO_4217).
        +   * 
        + * + * optional string currency_code = 2; + * + * @return The bytes for currencyCode. + */ + com.google.protobuf.ByteString getCurrencyCodeBytes(); +} diff --git a/java-common-protos/proto-google-common-protos/src/main/java/com/google/shopping/type/ReportingContext.java b/java-common-protos/proto-google-common-protos/src/main/java/com/google/shopping/type/ReportingContext.java new file mode 100644 index 0000000000..af38a69ecf --- /dev/null +++ b/java-common-protos/proto-google-common-protos/src/main/java/com/google/shopping/type/ReportingContext.java @@ -0,0 +1,997 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/shopping/type/types.proto +// Protobuf Java Version: 4.33.2 + +package com.google.shopping.type; + +/** + * + * + *
        + * Reporting contexts that your account and product issues apply to.
        + *
        + * Reporting contexts are groups of surfaces and formats for product results on
        + * Google. They can represent the entire destination (for example, [Shopping
        + * ads](https://support.google.com/merchants/answer/6149970)) or a subset of
        + * formats within a destination (for example, [Demand Gen
        + * ads](https://support.google.com/merchants/answer/13389785)).
        + * 
        + * + * Protobuf type {@code google.shopping.type.ReportingContext} + */ +@com.google.protobuf.Generated +public final class ReportingContext extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.shopping.type.ReportingContext) + ReportingContextOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "ReportingContext"); + } + + // Use ReportingContext.newBuilder() to construct. + private ReportingContext(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private ReportingContext() {} + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.shopping.type.TypesProto + .internal_static_google_shopping_type_ReportingContext_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.shopping.type.TypesProto + .internal_static_google_shopping_type_ReportingContext_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.shopping.type.ReportingContext.class, + com.google.shopping.type.ReportingContext.Builder.class); + } + + /** + * + * + *
        +   * Reporting context values.
        +   * 
        + * + * Protobuf enum {@code google.shopping.type.ReportingContext.ReportingContextEnum} + */ + public enum ReportingContextEnum implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
        +     * Not specified.
        +     * 
        + * + * REPORTING_CONTEXT_ENUM_UNSPECIFIED = 0; + */ + REPORTING_CONTEXT_ENUM_UNSPECIFIED(0), + /** + * + * + *
        +     * [Shopping ads](https://support.google.com/merchants/answer/6149970).
        +     * 
        + * + * SHOPPING_ADS = 1; + */ + SHOPPING_ADS(1), + /** + * + * + *
        +     * Deprecated:  Use `DEMAND_GEN_ADS` instead.
        +     * [Discovery and Demand Gen
        +     * ads](https://support.google.com/merchants/answer/13389785).
        +     * 
        + * + * DISCOVERY_ADS = 2 [deprecated = true]; + */ + @java.lang.Deprecated + DISCOVERY_ADS(2), + /** + * + * + *
        +     * [Demand Gen ads](https://support.google.com/merchants/answer/13389785).
        +     * 
        + * + * DEMAND_GEN_ADS = 13; + */ + DEMAND_GEN_ADS(13), + /** + * + * + *
        +     * [Demand Gen ads on Discover
        +     * surface](https://support.google.com/merchants/answer/13389785).
        +     * 
        + * + * DEMAND_GEN_ADS_DISCOVER_SURFACE = 14; + */ + DEMAND_GEN_ADS_DISCOVER_SURFACE(14), + /** + * + * + *
        +     * [Video ads](https://support.google.com/google-ads/answer/6340491).
        +     * 
        + * + * VIDEO_ADS = 3; + */ + VIDEO_ADS(3), + /** + * + * + *
        +     * [Display ads](https://support.google.com/merchants/answer/6069387).
        +     * 
        + * + * DISPLAY_ADS = 4; + */ + DISPLAY_ADS(4), + /** + * + * + *
        +     * [Local inventory
        +     * ads](https://support.google.com/merchants/answer/3271956).
        +     * 
        + * + * LOCAL_INVENTORY_ADS = 5; + */ + LOCAL_INVENTORY_ADS(5), + /** + * + * + *
        +     * [Vehicle inventory
        +     * ads](https://support.google.com/merchants/answer/11544533).
        +     * 
        + * + * VEHICLE_INVENTORY_ADS = 6; + */ + VEHICLE_INVENTORY_ADS(6), + /** + * + * + *
        +     * [Free product
        +     * listings](https://support.google.com/merchants/answer/9199328).
        +     * 
        + * + * FREE_LISTINGS = 7; + */ + FREE_LISTINGS(7), + /** + * + * + *
        +     * [Free product listings on UCP
        +     * checkout](https://developers.google.com/merchant/ucp).
        +     * 
        + * + * FREE_LISTINGS_UCP_CHECKOUT = 19; + */ + FREE_LISTINGS_UCP_CHECKOUT(19), + /** + * + * + *
        +     * [Free local product
        +     * listings](https://support.google.com/merchants/answer/9825611).
        +     * 
        + * + * FREE_LOCAL_LISTINGS = 8; + */ + FREE_LOCAL_LISTINGS(8), + /** + * + * + *
        +     * [Free local vehicle
        +     * listings](https://support.google.com/merchants/answer/11544533).
        +     * 
        + * + * FREE_LOCAL_VEHICLE_LISTINGS = 9; + */ + FREE_LOCAL_VEHICLE_LISTINGS(9), + /** + * + * + *
        +     * [Youtube Affiliate](https://support.google.com/youtube/answer/13376398).
        +     * 
        + * + * YOUTUBE_AFFILIATE = 18; + */ + YOUTUBE_AFFILIATE(18), + /** + * + * + *
        +     * [YouTube
        +     * Shopping](https://support.google.com/merchants/answer/13478370).
        +     * 
        + * + * YOUTUBE_SHOPPING = 10; + */ + YOUTUBE_SHOPPING(10), + /** + * + * + *
        +     * [Cloud retail](https://cloud.google.com/solutions/retail).
        +     * 
        + * + * CLOUD_RETAIL = 11; + */ + CLOUD_RETAIL(11), + /** + * + * + *
        +     * [Local cloud retail](https://cloud.google.com/solutions/retail).
        +     * 
        + * + * LOCAL_CLOUD_RETAIL = 12; + */ + LOCAL_CLOUD_RETAIL(12), + /** + * + * + *
        +     * [Product
        +     * Reviews](https://support.google.com/merchants/answer/14620732).
        +     * 
        + * + * PRODUCT_REVIEWS = 15; + */ + PRODUCT_REVIEWS(15), + /** + * + * + *
        +     * [Merchant
        +     * Reviews](https://developers.google.com/merchant-review-feeds).
        +     * 
        + * + * MERCHANT_REVIEWS = 16; + */ + MERCHANT_REVIEWS(16), + /** + * + * + *
        +     * YouTube Checkout
        +     * .
        +     * 
        + * + * YOUTUBE_CHECKOUT = 17; + */ + YOUTUBE_CHECKOUT(17), + UNRECOGNIZED(-1), + ; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "ReportingContextEnum"); + } + + /** + * + * + *
        +     * Not specified.
        +     * 
        + * + * REPORTING_CONTEXT_ENUM_UNSPECIFIED = 0; + */ + public static final int REPORTING_CONTEXT_ENUM_UNSPECIFIED_VALUE = 0; + + /** + * + * + *
        +     * [Shopping ads](https://support.google.com/merchants/answer/6149970).
        +     * 
        + * + * SHOPPING_ADS = 1; + */ + public static final int SHOPPING_ADS_VALUE = 1; + + /** + * + * + *
        +     * Deprecated:  Use `DEMAND_GEN_ADS` instead.
        +     * [Discovery and Demand Gen
        +     * ads](https://support.google.com/merchants/answer/13389785).
        +     * 
        + * + * DISCOVERY_ADS = 2 [deprecated = true]; + */ + @java.lang.Deprecated public static final int DISCOVERY_ADS_VALUE = 2; + + /** + * + * + *
        +     * [Demand Gen ads](https://support.google.com/merchants/answer/13389785).
        +     * 
        + * + * DEMAND_GEN_ADS = 13; + */ + public static final int DEMAND_GEN_ADS_VALUE = 13; + + /** + * + * + *
        +     * [Demand Gen ads on Discover
        +     * surface](https://support.google.com/merchants/answer/13389785).
        +     * 
        + * + * DEMAND_GEN_ADS_DISCOVER_SURFACE = 14; + */ + public static final int DEMAND_GEN_ADS_DISCOVER_SURFACE_VALUE = 14; + + /** + * + * + *
        +     * [Video ads](https://support.google.com/google-ads/answer/6340491).
        +     * 
        + * + * VIDEO_ADS = 3; + */ + public static final int VIDEO_ADS_VALUE = 3; + + /** + * + * + *
        +     * [Display ads](https://support.google.com/merchants/answer/6069387).
        +     * 
        + * + * DISPLAY_ADS = 4; + */ + public static final int DISPLAY_ADS_VALUE = 4; + + /** + * + * + *
        +     * [Local inventory
        +     * ads](https://support.google.com/merchants/answer/3271956).
        +     * 
        + * + * LOCAL_INVENTORY_ADS = 5; + */ + public static final int LOCAL_INVENTORY_ADS_VALUE = 5; + + /** + * + * + *
        +     * [Vehicle inventory
        +     * ads](https://support.google.com/merchants/answer/11544533).
        +     * 
        + * + * VEHICLE_INVENTORY_ADS = 6; + */ + public static final int VEHICLE_INVENTORY_ADS_VALUE = 6; + + /** + * + * + *
        +     * [Free product
        +     * listings](https://support.google.com/merchants/answer/9199328).
        +     * 
        + * + * FREE_LISTINGS = 7; + */ + public static final int FREE_LISTINGS_VALUE = 7; + + /** + * + * + *
        +     * [Free product listings on UCP
        +     * checkout](https://developers.google.com/merchant/ucp).
        +     * 
        + * + * FREE_LISTINGS_UCP_CHECKOUT = 19; + */ + public static final int FREE_LISTINGS_UCP_CHECKOUT_VALUE = 19; + + /** + * + * + *
        +     * [Free local product
        +     * listings](https://support.google.com/merchants/answer/9825611).
        +     * 
        + * + * FREE_LOCAL_LISTINGS = 8; + */ + public static final int FREE_LOCAL_LISTINGS_VALUE = 8; + + /** + * + * + *
        +     * [Free local vehicle
        +     * listings](https://support.google.com/merchants/answer/11544533).
        +     * 
        + * + * FREE_LOCAL_VEHICLE_LISTINGS = 9; + */ + public static final int FREE_LOCAL_VEHICLE_LISTINGS_VALUE = 9; + + /** + * + * + *
        +     * [Youtube Affiliate](https://support.google.com/youtube/answer/13376398).
        +     * 
        + * + * YOUTUBE_AFFILIATE = 18; + */ + public static final int YOUTUBE_AFFILIATE_VALUE = 18; + + /** + * + * + *
        +     * [YouTube
        +     * Shopping](https://support.google.com/merchants/answer/13478370).
        +     * 
        + * + * YOUTUBE_SHOPPING = 10; + */ + public static final int YOUTUBE_SHOPPING_VALUE = 10; + + /** + * + * + *
        +     * [Cloud retail](https://cloud.google.com/solutions/retail).
        +     * 
        + * + * CLOUD_RETAIL = 11; + */ + public static final int CLOUD_RETAIL_VALUE = 11; + + /** + * + * + *
        +     * [Local cloud retail](https://cloud.google.com/solutions/retail).
        +     * 
        + * + * LOCAL_CLOUD_RETAIL = 12; + */ + public static final int LOCAL_CLOUD_RETAIL_VALUE = 12; + + /** + * + * + *
        +     * [Product
        +     * Reviews](https://support.google.com/merchants/answer/14620732).
        +     * 
        + * + * PRODUCT_REVIEWS = 15; + */ + public static final int PRODUCT_REVIEWS_VALUE = 15; + + /** + * + * + *
        +     * [Merchant
        +     * Reviews](https://developers.google.com/merchant-review-feeds).
        +     * 
        + * + * MERCHANT_REVIEWS = 16; + */ + public static final int MERCHANT_REVIEWS_VALUE = 16; + + /** + * + * + *
        +     * YouTube Checkout
        +     * .
        +     * 
        + * + * YOUTUBE_CHECKOUT = 17; + */ + public static final int YOUTUBE_CHECKOUT_VALUE = 17; + + 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 ReportingContextEnum 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 ReportingContextEnum forNumber(int value) { + switch (value) { + case 0: + return REPORTING_CONTEXT_ENUM_UNSPECIFIED; + case 1: + return SHOPPING_ADS; + case 2: + return DISCOVERY_ADS; + case 13: + return DEMAND_GEN_ADS; + case 14: + return DEMAND_GEN_ADS_DISCOVER_SURFACE; + case 3: + return VIDEO_ADS; + case 4: + return DISPLAY_ADS; + case 5: + return LOCAL_INVENTORY_ADS; + case 6: + return VEHICLE_INVENTORY_ADS; + case 7: + return FREE_LISTINGS; + case 19: + return FREE_LISTINGS_UCP_CHECKOUT; + case 8: + return FREE_LOCAL_LISTINGS; + case 9: + return FREE_LOCAL_VEHICLE_LISTINGS; + case 18: + return YOUTUBE_AFFILIATE; + case 10: + return YOUTUBE_SHOPPING; + case 11: + return CLOUD_RETAIL; + case 12: + return LOCAL_CLOUD_RETAIL; + case 15: + return PRODUCT_REVIEWS; + case 16: + return MERCHANT_REVIEWS; + case 17: + return YOUTUBE_CHECKOUT; + 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 ReportingContextEnum findValueByNumber(int number) { + return ReportingContextEnum.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 com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.shopping.type.ReportingContext.getDescriptor().getEnumTypes().get(0); + } + + private static final ReportingContextEnum[] VALUES = values(); + + public static ReportingContextEnum 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 ReportingContextEnum(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.shopping.type.ReportingContext.ReportingContextEnum) + } + + 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.shopping.type.ReportingContext)) { + return super.equals(obj); + } + com.google.shopping.type.ReportingContext other = + (com.google.shopping.type.ReportingContext) 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.shopping.type.ReportingContext parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.shopping.type.ReportingContext parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.shopping.type.ReportingContext parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.shopping.type.ReportingContext 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.shopping.type.ReportingContext parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.shopping.type.ReportingContext parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.shopping.type.ReportingContext parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.shopping.type.ReportingContext parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.shopping.type.ReportingContext parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.shopping.type.ReportingContext parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.shopping.type.ReportingContext parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.shopping.type.ReportingContext parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.shopping.type.ReportingContext 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
        +   * Reporting contexts that your account and product issues apply to.
        +   *
        +   * Reporting contexts are groups of surfaces and formats for product results on
        +   * Google. They can represent the entire destination (for example, [Shopping
        +   * ads](https://support.google.com/merchants/answer/6149970)) or a subset of
        +   * formats within a destination (for example, [Demand Gen
        +   * ads](https://support.google.com/merchants/answer/13389785)).
        +   * 
        + * + * Protobuf type {@code google.shopping.type.ReportingContext} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.shopping.type.ReportingContext) + com.google.shopping.type.ReportingContextOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.shopping.type.TypesProto + .internal_static_google_shopping_type_ReportingContext_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.shopping.type.TypesProto + .internal_static_google_shopping_type_ReportingContext_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.shopping.type.ReportingContext.class, + com.google.shopping.type.ReportingContext.Builder.class); + } + + // Construct using com.google.shopping.type.ReportingContext.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.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.shopping.type.TypesProto + .internal_static_google_shopping_type_ReportingContext_descriptor; + } + + @java.lang.Override + public com.google.shopping.type.ReportingContext getDefaultInstanceForType() { + return com.google.shopping.type.ReportingContext.getDefaultInstance(); + } + + @java.lang.Override + public com.google.shopping.type.ReportingContext build() { + com.google.shopping.type.ReportingContext result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.shopping.type.ReportingContext buildPartial() { + com.google.shopping.type.ReportingContext result = + new com.google.shopping.type.ReportingContext(this); + onBuilt(); + return result; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.shopping.type.ReportingContext) { + return mergeFrom((com.google.shopping.type.ReportingContext) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.shopping.type.ReportingContext other) { + if (other == com.google.shopping.type.ReportingContext.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; + } + + // @@protoc_insertion_point(builder_scope:google.shopping.type.ReportingContext) + } + + // @@protoc_insertion_point(class_scope:google.shopping.type.ReportingContext) + private static final com.google.shopping.type.ReportingContext DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.shopping.type.ReportingContext(); + } + + public static com.google.shopping.type.ReportingContext getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ReportingContext 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.shopping.type.ReportingContext getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-common-protos/proto-google-common-protos/src/main/java/com/google/shopping/type/ReportingContextOrBuilder.java b/java-common-protos/proto-google-common-protos/src/main/java/com/google/shopping/type/ReportingContextOrBuilder.java new file mode 100644 index 0000000000..d51fbf9ca9 --- /dev/null +++ b/java-common-protos/proto-google-common-protos/src/main/java/com/google/shopping/type/ReportingContextOrBuilder.java @@ -0,0 +1,27 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/shopping/type/types.proto +// Protobuf Java Version: 4.33.2 + +package com.google.shopping.type; + +@com.google.protobuf.Generated +public interface ReportingContextOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.shopping.type.ReportingContext) + com.google.protobuf.MessageOrBuilder {} diff --git a/java-common-protos/proto-google-common-protos/src/main/java/com/google/shopping/type/TypesProto.java b/java-common-protos/proto-google-common-protos/src/main/java/com/google/shopping/type/TypesProto.java new file mode 100644 index 0000000000..d9127e98eb --- /dev/null +++ b/java-common-protos/proto-google-common-protos/src/main/java/com/google/shopping/type/TypesProto.java @@ -0,0 +1,189 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/shopping/type/types.proto +// Protobuf Java Version: 4.33.2 + +package com.google.shopping.type; + +@com.google.protobuf.Generated +public final class TypesProto extends com.google.protobuf.GeneratedFile { + private TypesProto() {} + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "TypesProto"); + } + + 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_shopping_type_Weight_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_shopping_type_Weight_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_shopping_type_Price_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_shopping_type_Price_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_shopping_type_CustomAttribute_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_shopping_type_CustomAttribute_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_shopping_type_Destination_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_shopping_type_Destination_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_shopping_type_ReportingContext_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_shopping_type_ReportingContext_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_shopping_type_Channel_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_shopping_type_Channel_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/shopping/type/types.proto\022\024google.shopping.type\"\261\001\n" + + "\006Weight\022\032\n\r" + + "amount_micros\030\001 \001(\003H\000\210\001\001\0225\n" + + "\004unit\030\002 \001(\0162\'.google.shopping.type.Weight.WeightUnit\"B\n\n" + + "WeightUnit\022\033\n" + + "\027WEIGHT_UNIT_UNSPECIFIED\020\000\022\t\n" + + "\005POUND\020\001\022\014\n" + + "\010KILOGRAM\020\002B\020\n" + + "\016_amount_micros\"c\n" + + "\005Price\022\032\n\r" + + "amount_micros\030\001 \001(\003H\000\210\001\001\022\032\n\r" + + "currency_code\030\002 \001(\tH\001\210\001\001B\020\n" + + "\016_amount_microsB\020\n" + + "\016_currency_code\"\210\001\n" + + "\017CustomAttribute\022\021\n" + + "\004name\030\001 \001(\tH\000\210\001\001\022\022\n" + + "\005value\030\002 \001(\tH\001\210\001\001\022;\n" + + "\014group_values\030\003 \003(\0132%.google.shopping.type.CustomAttributeB\007\n" + + "\005_nameB\010\n" + + "\006_value\"\315\002\n" + + "\013Destination\"\275\002\n" + + "\017DestinationEnum\022 \n" + + "\034DESTINATION_ENUM_UNSPECIFIED\020\000\022\020\n" + + "\014SHOPPING_ADS\020\001\022\017\n" + + "\013DISPLAY_ADS\020\002\022\027\n" + + "\023LOCAL_INVENTORY_ADS\020\003\022\021\n\r" + + "FREE_LISTINGS\020\004\022\027\n" + + "\023FREE_LOCAL_LISTINGS\020\005\022\024\n" + + "\020YOUTUBE_SHOPPING\020\006\022\035\n" + + "\031YOUTUBE_SHOPPING_CHECKOUT\020\007\022\025\n" + + "\021YOUTUBE_AFFILIATE\020\010\022\031\n" + + "\025FREE_VEHICLE_LISTINGS\020\t\022\017\n" + + "\013VEHICLE_ADS\020\n" + + "\022\020\n" + + "\014CLOUD_RETAIL\020\013\022\026\n" + + "\022LOCAL_CLOUD_RETAIL\020\014\"\216\004\n" + + "\020ReportingContext\"\371\003\n" + + "\024ReportingContextEnum\022&\n" + + "\"REPORTING_CONTEXT_ENUM_UNSPECIFIED\020\000\022\020\n" + + "\014SHOPPING_ADS\020\001\022\025\n\r" + + "DISCOVERY_ADS\020\002\032\002\010\001\022\022\n" + + "\016DEMAND_GEN_ADS\020\r" + + "\022#\n" + + "\037DEMAND_GEN_ADS_DISCOVER_SURFACE\020\016\022\r\n" + + "\tVIDEO_ADS\020\003\022\017\n" + + "\013DISPLAY_ADS\020\004\022\027\n" + + "\023LOCAL_INVENTORY_ADS\020\005\022\031\n" + + "\025VEHICLE_INVENTORY_ADS\020\006\022\021\n\r" + + "FREE_LISTINGS\020\007\022\036\n" + + "\032FREE_LISTINGS_UCP_CHECKOUT\020\023\022\027\n" + + "\023FREE_LOCAL_LISTINGS\020\010\022\037\n" + + "\033FREE_LOCAL_VEHICLE_LISTINGS\020\t\022\025\n" + + "\021YOUTUBE_AFFILIATE\020\022\022\024\n" + + "\020YOUTUBE_SHOPPING\020\n" + + "\022\020\n" + + "\014CLOUD_RETAIL\020\013\022\026\n" + + "\022LOCAL_CLOUD_RETAIL\020\014\022\023\n" + + "\017PRODUCT_REVIEWS\020\017\022\024\n" + + "\020MERCHANT_REVIEWS\020\020\022\024\n" + + "\020YOUTUBE_CHECKOUT\020\021\"M\n" + + "\007Channel\"B\n" + + "\013ChannelEnum\022\034\n" + + "\030CHANNEL_ENUM_UNSPECIFIED\020\000\022\n\n" + + "\006ONLINE\020\001\022\t\n" + + "\005LOCAL\020\002Bp\n" + + "\030com.google.shopping.typeB\n" + + "TypesProtoP\001Z/cloud.google.com/go/shopping/type/typepb;typepb\252\002\024Google" + + ".Shopping.Typeb\006proto3" + }; + descriptor = + com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( + descriptorData, new com.google.protobuf.Descriptors.FileDescriptor[] {}); + internal_static_google_shopping_type_Weight_descriptor = getDescriptor().getMessageType(0); + internal_static_google_shopping_type_Weight_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_shopping_type_Weight_descriptor, + new java.lang.String[] { + "AmountMicros", "Unit", + }); + internal_static_google_shopping_type_Price_descriptor = getDescriptor().getMessageType(1); + internal_static_google_shopping_type_Price_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_shopping_type_Price_descriptor, + new java.lang.String[] { + "AmountMicros", "CurrencyCode", + }); + internal_static_google_shopping_type_CustomAttribute_descriptor = + getDescriptor().getMessageType(2); + internal_static_google_shopping_type_CustomAttribute_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_shopping_type_CustomAttribute_descriptor, + new java.lang.String[] { + "Name", "Value", "GroupValues", + }); + internal_static_google_shopping_type_Destination_descriptor = getDescriptor().getMessageType(3); + internal_static_google_shopping_type_Destination_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_shopping_type_Destination_descriptor, new java.lang.String[] {}); + internal_static_google_shopping_type_ReportingContext_descriptor = + getDescriptor().getMessageType(4); + internal_static_google_shopping_type_ReportingContext_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_shopping_type_ReportingContext_descriptor, + new java.lang.String[] {}); + internal_static_google_shopping_type_Channel_descriptor = getDescriptor().getMessageType(5); + internal_static_google_shopping_type_Channel_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_shopping_type_Channel_descriptor, new java.lang.String[] {}); + descriptor.resolveAllFeaturesImmutable(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/java-common-protos/proto-google-common-protos/src/main/java/com/google/shopping/type/Weight.java b/java-common-protos/proto-google-common-protos/src/main/java/com/google/shopping/type/Weight.java new file mode 100644 index 0000000000..e9970e7c48 --- /dev/null +++ b/java-common-protos/proto-google-common-protos/src/main/java/com/google/shopping/type/Weight.java @@ -0,0 +1,894 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/shopping/type/types.proto +// Protobuf Java Version: 4.33.2 + +package com.google.shopping.type; + +/** + * + * + *
        + * The weight represented as the value in string and the unit.
        + * 
        + * + * Protobuf type {@code google.shopping.type.Weight} + */ +@com.google.protobuf.Generated +public final class Weight extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.shopping.type.Weight) + WeightOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "Weight"); + } + + // Use Weight.newBuilder() to construct. + private Weight(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private Weight() { + unit_ = 0; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.shopping.type.TypesProto + .internal_static_google_shopping_type_Weight_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.shopping.type.TypesProto + .internal_static_google_shopping_type_Weight_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.shopping.type.Weight.class, com.google.shopping.type.Weight.Builder.class); + } + + /** + * + * + *
        +   * The weight unit.
        +   * 
        + * + * Protobuf enum {@code google.shopping.type.Weight.WeightUnit} + */ + public enum WeightUnit implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
        +     * unit unspecified
        +     * 
        + * + * WEIGHT_UNIT_UNSPECIFIED = 0; + */ + WEIGHT_UNIT_UNSPECIFIED(0), + /** + * + * + *
        +     * lb unit.
        +     * 
        + * + * POUND = 1; + */ + POUND(1), + /** + * + * + *
        +     * kg unit.
        +     * 
        + * + * KILOGRAM = 2; + */ + KILOGRAM(2), + UNRECOGNIZED(-1), + ; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "WeightUnit"); + } + + /** + * + * + *
        +     * unit unspecified
        +     * 
        + * + * WEIGHT_UNIT_UNSPECIFIED = 0; + */ + public static final int WEIGHT_UNIT_UNSPECIFIED_VALUE = 0; + + /** + * + * + *
        +     * lb unit.
        +     * 
        + * + * POUND = 1; + */ + public static final int POUND_VALUE = 1; + + /** + * + * + *
        +     * kg unit.
        +     * 
        + * + * KILOGRAM = 2; + */ + public static final int KILOGRAM_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 WeightUnit 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 WeightUnit forNumber(int value) { + switch (value) { + case 0: + return WEIGHT_UNIT_UNSPECIFIED; + case 1: + return POUND; + case 2: + return KILOGRAM; + 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 WeightUnit findValueByNumber(int number) { + return WeightUnit.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 com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.shopping.type.Weight.getDescriptor().getEnumTypes().get(0); + } + + private static final WeightUnit[] VALUES = values(); + + public static WeightUnit 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 WeightUnit(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.shopping.type.Weight.WeightUnit) + } + + private int bitField0_; + public static final int AMOUNT_MICROS_FIELD_NUMBER = 1; + private long amountMicros_ = 0L; + + /** + * + * + *
        +   * Required. The weight represented as a number in micros (1 million micros is
        +   * an equivalent to one's currency standard unit, for example, 1 kg = 1000000
        +   * micros).
        +   * This field can also be set as infinity by setting to -1.
        +   * This field only support -1 and positive value.
        +   * 
        + * + * optional int64 amount_micros = 1; + * + * @return Whether the amountMicros field is set. + */ + @java.lang.Override + public boolean hasAmountMicros() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
        +   * Required. The weight represented as a number in micros (1 million micros is
        +   * an equivalent to one's currency standard unit, for example, 1 kg = 1000000
        +   * micros).
        +   * This field can also be set as infinity by setting to -1.
        +   * This field only support -1 and positive value.
        +   * 
        + * + * optional int64 amount_micros = 1; + * + * @return The amountMicros. + */ + @java.lang.Override + public long getAmountMicros() { + return amountMicros_; + } + + public static final int UNIT_FIELD_NUMBER = 2; + private int unit_ = 0; + + /** + * + * + *
        +   * Required. The weight unit.
        +   * Acceptable values are: kg and lb
        +   * 
        + * + * .google.shopping.type.Weight.WeightUnit unit = 2; + * + * @return The enum numeric value on the wire for unit. + */ + @java.lang.Override + public int getUnitValue() { + return unit_; + } + + /** + * + * + *
        +   * Required. The weight unit.
        +   * Acceptable values are: kg and lb
        +   * 
        + * + * .google.shopping.type.Weight.WeightUnit unit = 2; + * + * @return The unit. + */ + @java.lang.Override + public com.google.shopping.type.Weight.WeightUnit getUnit() { + com.google.shopping.type.Weight.WeightUnit result = + com.google.shopping.type.Weight.WeightUnit.forNumber(unit_); + return result == null ? com.google.shopping.type.Weight.WeightUnit.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 (((bitField0_ & 0x00000001) != 0)) { + output.writeInt64(1, amountMicros_); + } + if (unit_ != com.google.shopping.type.Weight.WeightUnit.WEIGHT_UNIT_UNSPECIFIED.getNumber()) { + output.writeEnum(2, unit_); + } + 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.computeInt64Size(1, amountMicros_); + } + if (unit_ != com.google.shopping.type.Weight.WeightUnit.WEIGHT_UNIT_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(2, unit_); + } + 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.shopping.type.Weight)) { + return super.equals(obj); + } + com.google.shopping.type.Weight other = (com.google.shopping.type.Weight) obj; + + if (hasAmountMicros() != other.hasAmountMicros()) return false; + if (hasAmountMicros()) { + if (getAmountMicros() != other.getAmountMicros()) return false; + } + if (unit_ != other.unit_) 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 (hasAmountMicros()) { + hash = (37 * hash) + AMOUNT_MICROS_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getAmountMicros()); + } + hash = (37 * hash) + UNIT_FIELD_NUMBER; + hash = (53 * hash) + unit_; + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.shopping.type.Weight parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.shopping.type.Weight parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.shopping.type.Weight parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.shopping.type.Weight 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.shopping.type.Weight parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.shopping.type.Weight parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.shopping.type.Weight parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.shopping.type.Weight parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.shopping.type.Weight parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.shopping.type.Weight parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.shopping.type.Weight parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.shopping.type.Weight parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.shopping.type.Weight 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
        +   * The weight represented as the value in string and the unit.
        +   * 
        + * + * Protobuf type {@code google.shopping.type.Weight} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.shopping.type.Weight) + com.google.shopping.type.WeightOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.shopping.type.TypesProto + .internal_static_google_shopping_type_Weight_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.shopping.type.TypesProto + .internal_static_google_shopping_type_Weight_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.shopping.type.Weight.class, com.google.shopping.type.Weight.Builder.class); + } + + // Construct using com.google.shopping.type.Weight.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + amountMicros_ = 0L; + unit_ = 0; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.shopping.type.TypesProto + .internal_static_google_shopping_type_Weight_descriptor; + } + + @java.lang.Override + public com.google.shopping.type.Weight getDefaultInstanceForType() { + return com.google.shopping.type.Weight.getDefaultInstance(); + } + + @java.lang.Override + public com.google.shopping.type.Weight build() { + com.google.shopping.type.Weight result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.shopping.type.Weight buildPartial() { + com.google.shopping.type.Weight result = new com.google.shopping.type.Weight(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.shopping.type.Weight result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.amountMicros_ = amountMicros_; + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.unit_ = unit_; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.shopping.type.Weight) { + return mergeFrom((com.google.shopping.type.Weight) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.shopping.type.Weight other) { + if (other == com.google.shopping.type.Weight.getDefaultInstance()) return this; + if (other.hasAmountMicros()) { + setAmountMicros(other.getAmountMicros()); + } + if (other.unit_ != 0) { + setUnitValue(other.getUnitValue()); + } + 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: + { + amountMicros_ = input.readInt64(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 16: + { + unit_ = input.readEnum(); + 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 long amountMicros_; + + /** + * + * + *
        +     * Required. The weight represented as a number in micros (1 million micros is
        +     * an equivalent to one's currency standard unit, for example, 1 kg = 1000000
        +     * micros).
        +     * This field can also be set as infinity by setting to -1.
        +     * This field only support -1 and positive value.
        +     * 
        + * + * optional int64 amount_micros = 1; + * + * @return Whether the amountMicros field is set. + */ + @java.lang.Override + public boolean hasAmountMicros() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
        +     * Required. The weight represented as a number in micros (1 million micros is
        +     * an equivalent to one's currency standard unit, for example, 1 kg = 1000000
        +     * micros).
        +     * This field can also be set as infinity by setting to -1.
        +     * This field only support -1 and positive value.
        +     * 
        + * + * optional int64 amount_micros = 1; + * + * @return The amountMicros. + */ + @java.lang.Override + public long getAmountMicros() { + return amountMicros_; + } + + /** + * + * + *
        +     * Required. The weight represented as a number in micros (1 million micros is
        +     * an equivalent to one's currency standard unit, for example, 1 kg = 1000000
        +     * micros).
        +     * This field can also be set as infinity by setting to -1.
        +     * This field only support -1 and positive value.
        +     * 
        + * + * optional int64 amount_micros = 1; + * + * @param value The amountMicros to set. + * @return This builder for chaining. + */ + public Builder setAmountMicros(long value) { + + amountMicros_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
        +     * Required. The weight represented as a number in micros (1 million micros is
        +     * an equivalent to one's currency standard unit, for example, 1 kg = 1000000
        +     * micros).
        +     * This field can also be set as infinity by setting to -1.
        +     * This field only support -1 and positive value.
        +     * 
        + * + * optional int64 amount_micros = 1; + * + * @return This builder for chaining. + */ + public Builder clearAmountMicros() { + bitField0_ = (bitField0_ & ~0x00000001); + amountMicros_ = 0L; + onChanged(); + return this; + } + + private int unit_ = 0; + + /** + * + * + *
        +     * Required. The weight unit.
        +     * Acceptable values are: kg and lb
        +     * 
        + * + * .google.shopping.type.Weight.WeightUnit unit = 2; + * + * @return The enum numeric value on the wire for unit. + */ + @java.lang.Override + public int getUnitValue() { + return unit_; + } + + /** + * + * + *
        +     * Required. The weight unit.
        +     * Acceptable values are: kg and lb
        +     * 
        + * + * .google.shopping.type.Weight.WeightUnit unit = 2; + * + * @param value The enum numeric value on the wire for unit to set. + * @return This builder for chaining. + */ + public Builder setUnitValue(int value) { + unit_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
        +     * Required. The weight unit.
        +     * Acceptable values are: kg and lb
        +     * 
        + * + * .google.shopping.type.Weight.WeightUnit unit = 2; + * + * @return The unit. + */ + @java.lang.Override + public com.google.shopping.type.Weight.WeightUnit getUnit() { + com.google.shopping.type.Weight.WeightUnit result = + com.google.shopping.type.Weight.WeightUnit.forNumber(unit_); + return result == null ? com.google.shopping.type.Weight.WeightUnit.UNRECOGNIZED : result; + } + + /** + * + * + *
        +     * Required. The weight unit.
        +     * Acceptable values are: kg and lb
        +     * 
        + * + * .google.shopping.type.Weight.WeightUnit unit = 2; + * + * @param value The unit to set. + * @return This builder for chaining. + */ + public Builder setUnit(com.google.shopping.type.Weight.WeightUnit value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000002; + unit_ = value.getNumber(); + onChanged(); + return this; + } + + /** + * + * + *
        +     * Required. The weight unit.
        +     * Acceptable values are: kg and lb
        +     * 
        + * + * .google.shopping.type.Weight.WeightUnit unit = 2; + * + * @return This builder for chaining. + */ + public Builder clearUnit() { + bitField0_ = (bitField0_ & ~0x00000002); + unit_ = 0; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.shopping.type.Weight) + } + + // @@protoc_insertion_point(class_scope:google.shopping.type.Weight) + private static final com.google.shopping.type.Weight DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.shopping.type.Weight(); + } + + public static com.google.shopping.type.Weight getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Weight 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.shopping.type.Weight getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-common-protos/proto-google-common-protos/src/main/java/com/google/shopping/type/WeightOrBuilder.java b/java-common-protos/proto-google-common-protos/src/main/java/com/google/shopping/type/WeightOrBuilder.java new file mode 100644 index 0000000000..1c7308b124 --- /dev/null +++ b/java-common-protos/proto-google-common-protos/src/main/java/com/google/shopping/type/WeightOrBuilder.java @@ -0,0 +1,90 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/shopping/type/types.proto +// Protobuf Java Version: 4.33.2 + +package com.google.shopping.type; + +@com.google.protobuf.Generated +public interface WeightOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.shopping.type.Weight) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
        +   * Required. The weight represented as a number in micros (1 million micros is
        +   * an equivalent to one's currency standard unit, for example, 1 kg = 1000000
        +   * micros).
        +   * This field can also be set as infinity by setting to -1.
        +   * This field only support -1 and positive value.
        +   * 
        + * + * optional int64 amount_micros = 1; + * + * @return Whether the amountMicros field is set. + */ + boolean hasAmountMicros(); + + /** + * + * + *
        +   * Required. The weight represented as a number in micros (1 million micros is
        +   * an equivalent to one's currency standard unit, for example, 1 kg = 1000000
        +   * micros).
        +   * This field can also be set as infinity by setting to -1.
        +   * This field only support -1 and positive value.
        +   * 
        + * + * optional int64 amount_micros = 1; + * + * @return The amountMicros. + */ + long getAmountMicros(); + + /** + * + * + *
        +   * Required. The weight unit.
        +   * Acceptable values are: kg and lb
        +   * 
        + * + * .google.shopping.type.Weight.WeightUnit unit = 2; + * + * @return The enum numeric value on the wire for unit. + */ + int getUnitValue(); + + /** + * + * + *
        +   * Required. The weight unit.
        +   * Acceptable values are: kg and lb
        +   * 
        + * + * .google.shopping.type.Weight.WeightUnit unit = 2; + * + * @return The unit. + */ + com.google.shopping.type.Weight.WeightUnit getUnit(); +} diff --git a/java-common-protos/proto-google-common-protos/src/main/java/com/google/type/CalendarPeriod.java b/java-common-protos/proto-google-common-protos/src/main/java/com/google/type/CalendarPeriod.java index 6ff4490e35..e34b4321b3 100644 --- a/java-common-protos/proto-google-common-protos/src/main/java/com/google/type/CalendarPeriod.java +++ b/java-common-protos/proto-google-common-protos/src/main/java/com/google/type/CalendarPeriod.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,9 @@ * limitations under the License. */ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: google/type/calendar_period.proto +// Protobuf Java Version: 4.33.2 package com.google.type; @@ -29,6 +31,7 @@ * * Protobuf enum {@code google.type.CalendarPeriod} */ +@com.google.protobuf.Generated public enum CalendarPeriod implements com.google.protobuf.ProtocolMessageEnum { /** * @@ -117,6 +120,16 @@ public enum CalendarPeriod implements com.google.protobuf.ProtocolMessageEnum { UNRECOGNIZED(-1), ; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "CalendarPeriod"); + } + /** * * @@ -127,6 +140,7 @@ public enum CalendarPeriod implements com.google.protobuf.ProtocolMessageEnum { * CALENDAR_PERIOD_UNSPECIFIED = 0; */ public static final int CALENDAR_PERIOD_UNSPECIFIED_VALUE = 0; + /** * * @@ -137,6 +151,7 @@ public enum CalendarPeriod implements com.google.protobuf.ProtocolMessageEnum { * DAY = 1; */ public static final int DAY_VALUE = 1; + /** * * @@ -148,6 +163,7 @@ public enum CalendarPeriod implements com.google.protobuf.ProtocolMessageEnum { * WEEK = 2; */ public static final int WEEK_VALUE = 2; + /** * * @@ -160,6 +176,7 @@ public enum CalendarPeriod implements com.google.protobuf.ProtocolMessageEnum { * FORTNIGHT = 3; */ public static final int FORTNIGHT_VALUE = 3; + /** * * @@ -170,6 +187,7 @@ public enum CalendarPeriod implements com.google.protobuf.ProtocolMessageEnum { * MONTH = 4; */ public static final int MONTH_VALUE = 4; + /** * * @@ -181,6 +199,7 @@ public enum CalendarPeriod implements com.google.protobuf.ProtocolMessageEnum { * QUARTER = 5; */ public static final int QUARTER_VALUE = 5; + /** * * @@ -191,6 +210,7 @@ public enum CalendarPeriod implements com.google.protobuf.ProtocolMessageEnum { * HALF = 6; */ public static final int HALF_VALUE = 6; + /** * * @@ -270,7 +290,7 @@ public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType return getDescriptor(); } - public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + public static com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { return com.google.type.CalendarPeriodProto.getDescriptor().getEnumTypes().get(0); } diff --git a/java-common-protos/proto-google-common-protos/src/main/java/com/google/type/CalendarPeriodProto.java b/java-common-protos/proto-google-common-protos/src/main/java/com/google/type/CalendarPeriodProto.java index c4f038504c..6c3a8acc3b 100644 --- a/java-common-protos/proto-google-common-protos/src/main/java/com/google/type/CalendarPeriodProto.java +++ b/java-common-protos/proto-google-common-protos/src/main/java/com/google/type/CalendarPeriodProto.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,13 +14,26 @@ * limitations under the License. */ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: google/type/calendar_period.proto +// Protobuf Java Version: 4.33.2 package com.google.type; -public final class CalendarPeriodProto { +@com.google.protobuf.Generated +public final class CalendarPeriodProto extends com.google.protobuf.GeneratedFile { private CalendarPeriodProto() {} + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "CalendarPeriodProto"); + } + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistryLite registry) {} public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry registry) { @@ -47,6 +60,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { descriptor = com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( descriptorData, new com.google.protobuf.Descriptors.FileDescriptor[] {}); + descriptor.resolveAllFeaturesImmutable(); } // @@protoc_insertion_point(outer_class_scope) diff --git a/java-common-protos/proto-google-common-protos/src/main/java/com/google/type/Color.java b/java-common-protos/proto-google-common-protos/src/main/java/com/google/type/Color.java index d2ff65edbd..d60fd6f8a6 100644 --- a/java-common-protos/proto-google-common-protos/src/main/java/com/google/type/Color.java +++ b/java-common-protos/proto-google-common-protos/src/main/java/com/google/type/Color.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,9 @@ * limitations under the License. */ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: google/type/color.proto +// Protobuf Java Version: 4.33.2 package com.google.type; @@ -29,147 +31,167 @@ * can also be trivially provided to UIColor's `+colorWithRed:green:blue:alpha` * method in iOS; and, with just a little work, it can be easily formatted into * a CSS `rgba()` string in JavaScript. + * * This reference page doesn't carry information about the absolute color * space * that should be used to interpret the RGB value (e.g. sRGB, Adobe RGB, * DCI-P3, BT.2020, etc.). By default, applications should assume the sRGB color * space. + * * When color equality needs to be decided, implementations, unless * documented otherwise, treat two colors as equal if all their red, * green, blue, and alpha values each differ by at most 1e-5. + * * Example (Java): - * import com.google.type.Color; - * // ... - * public static java.awt.Color fromProto(Color protocolor) { - * float alpha = protocolor.hasAlpha() - * ? protocolor.getAlpha().getValue() - * : 1.0; - * return new java.awt.Color( - * protocolor.getRed(), - * protocolor.getGreen(), - * protocolor.getBlue(), - * alpha); - * } - * public static Color toProto(java.awt.Color color) { - * float red = (float) color.getRed(); - * float green = (float) color.getGreen(); - * float blue = (float) color.getBlue(); - * float denominator = 255.0; - * Color.Builder resultBuilder = - * Color - * .newBuilder() - * .setRed(red / denominator) - * .setGreen(green / denominator) - * .setBlue(blue / denominator); - * int alpha = color.getAlpha(); - * if (alpha != 255) { - * result.setAlpha( - * FloatValue - * .newBuilder() - * .setValue(((float) alpha) / denominator) - * .build()); - * } - * return resultBuilder.build(); - * } - * // ... + * + * import com.google.type.Color; + * + * // ... + * public static java.awt.Color fromProto(Color protocolor) { + * float alpha = protocolor.hasAlpha() + * ? protocolor.getAlpha().getValue() + * : 1.0; + * + * return new java.awt.Color( + * protocolor.getRed(), + * protocolor.getGreen(), + * protocolor.getBlue(), + * alpha); + * } + * + * public static Color toProto(java.awt.Color color) { + * float red = (float) color.getRed(); + * float green = (float) color.getGreen(); + * float blue = (float) color.getBlue(); + * float denominator = 255.0; + * Color.Builder resultBuilder = + * Color + * .newBuilder() + * .setRed(red / denominator) + * .setGreen(green / denominator) + * .setBlue(blue / denominator); + * int alpha = color.getAlpha(); + * if (alpha != 255) { + * result.setAlpha( + * FloatValue + * .newBuilder() + * .setValue(((float) alpha) / denominator) + * .build()); + * } + * return resultBuilder.build(); + * } + * // ... + * * Example (iOS / Obj-C): - * // ... - * static UIColor* fromProto(Color* protocolor) { - * float red = [protocolor red]; - * float green = [protocolor green]; - * float blue = [protocolor blue]; - * FloatValue* alpha_wrapper = [protocolor alpha]; - * float alpha = 1.0; - * if (alpha_wrapper != nil) { - * alpha = [alpha_wrapper value]; - * } - * return [UIColor colorWithRed:red green:green blue:blue alpha:alpha]; - * } - * static Color* toProto(UIColor* color) { - * CGFloat red, green, blue, alpha; - * if (![color getRed:&red green:&green blue:&blue alpha:&alpha]) { - * return nil; - * } - * Color* result = [[Color alloc] init]; - * [result setRed:red]; - * [result setGreen:green]; - * [result setBlue:blue]; - * if (alpha <= 0.9999) { - * [result setAlpha:floatWrapperWithValue(alpha)]; - * } - * [result autorelease]; - * return result; - * } - * // ... - * Example (JavaScript): - * // ... - * var protoToCssColor = function(rgb_color) { - * var redFrac = rgb_color.red || 0.0; - * var greenFrac = rgb_color.green || 0.0; - * var blueFrac = rgb_color.blue || 0.0; - * var red = Math.floor(redFrac * 255); - * var green = Math.floor(greenFrac * 255); - * var blue = Math.floor(blueFrac * 255); - * if (!('alpha' in rgb_color)) { - * return rgbToCssColor(red, green, blue); - * } - * var alphaFrac = rgb_color.alpha.value || 0.0; - * var rgbParams = [red, green, blue].join(','); - * return ['rgba(', rgbParams, ',', alphaFrac, ')'].join(''); - * }; - * var rgbToCssColor = function(red, green, blue) { - * var rgbNumber = new Number((red << 16) | (green << 8) | blue); - * var hexString = rgbNumber.toString(16); - * var missingZeros = 6 - hexString.length; - * var resultBuilder = ['#']; - * for (var i = 0; i < missingZeros; i++) { - * resultBuilder.push('0'); - * } - * resultBuilder.push(hexString); - * return resultBuilder.join(''); - * }; - * // ... + * + * // ... + * static UIColor* fromProto(Color* protocolor) { + * float red = [protocolor red]; + * float green = [protocolor green]; + * float blue = [protocolor blue]; + * FloatValue* alpha_wrapper = [protocolor alpha]; + * float alpha = 1.0; + * if (alpha_wrapper != nil) { + * alpha = [alpha_wrapper value]; + * } + * return [UIColor colorWithRed:red green:green blue:blue alpha:alpha]; + * } + * + * static Color* toProto(UIColor* color) { + * CGFloat red, green, blue, alpha; + * if (![color getRed:&red green:&green blue:&blue alpha:&alpha]) { + * return nil; + * } + * Color* result = [[Color alloc] init]; + * [result setRed:red]; + * [result setGreen:green]; + * [result setBlue:blue]; + * if (alpha <= 0.9999) { + * [result setAlpha:floatWrapperWithValue(alpha)]; + * } + * [result autorelease]; + * return result; + * } + * // ... + * + * Example (JavaScript): + * + * // ... + * + * var protoToCssColor = function(rgb_color) { + * var redFrac = rgb_color.red || 0.0; + * var greenFrac = rgb_color.green || 0.0; + * var blueFrac = rgb_color.blue || 0.0; + * var red = Math.floor(redFrac * 255); + * var green = Math.floor(greenFrac * 255); + * var blue = Math.floor(blueFrac * 255); + * + * if (!('alpha' in rgb_color)) { + * return rgbToCssColor(red, green, blue); + * } + * + * var alphaFrac = rgb_color.alpha.value || 0.0; + * var rgbParams = [red, green, blue].join(','); + * return ['rgba(', rgbParams, ',', alphaFrac, ')'].join(''); + * }; + * + * var rgbToCssColor = function(red, green, blue) { + * var rgbNumber = new Number((red << 16) | (green << 8) | blue); + * var hexString = rgbNumber.toString(16); + * var missingZeros = 6 - hexString.length; + * var resultBuilder = ['#']; + * for (var i = 0; i < missingZeros; i++) { + * resultBuilder.push('0'); + * } + * resultBuilder.push(hexString); + * return resultBuilder.join(''); + * }; + * + * // ... *
        * * Protobuf type {@code google.type.Color} */ -public final class Color extends com.google.protobuf.GeneratedMessageV3 +@com.google.protobuf.Generated +public final class Color extends com.google.protobuf.GeneratedMessage implements // @@protoc_insertion_point(message_implements:google.type.Color) ColorOrBuilder { private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "Color"); + } + // Use Color.newBuilder() to construct. - private Color(com.google.protobuf.GeneratedMessageV3.Builder builder) { + private Color(com.google.protobuf.GeneratedMessage.Builder builder) { super(builder); } private Color() {} - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new Color(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.type.ColorProto.internal_static_google_type_Color_descriptor; } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.type.ColorProto.internal_static_google_type_Color_fieldAccessorTable .ensureFieldAccessorsInitialized( com.google.type.Color.class, com.google.type.Color.Builder.class); } + private int bitField0_; public static final int RED_FIELD_NUMBER = 1; - private float red_; + private float red_ = 0F; + /** * * @@ -187,7 +209,8 @@ public float getRed() { } public static final int GREEN_FIELD_NUMBER = 2; - private float green_; + private float green_ = 0F; + /** * * @@ -205,7 +228,8 @@ public float getGreen() { } public static final int BLUE_FIELD_NUMBER = 3; - private float blue_; + private float blue_ = 0F; + /** * * @@ -224,13 +248,16 @@ public float getBlue() { public static final int ALPHA_FIELD_NUMBER = 4; private com.google.protobuf.FloatValue alpha_; + /** * * *
            * The fraction of this color that should be applied to the pixel. That is,
            * the final pixel color is defined by the equation:
        -   *   `pixel color = alpha * (this color) + (1.0 - alpha) * (background color)`
        +   *
        +   * `pixel color = alpha * (this color) + (1.0 - alpha) * (background color)`
        +   *
            * This means that a value of 1.0 corresponds to a solid color, whereas
            * a value of 0.0 corresponds to a completely transparent color. This
            * uses a wrapper message rather than a simple float scalar so that it is
        @@ -245,15 +272,18 @@ public float getBlue() {
            */
           @java.lang.Override
           public boolean hasAlpha() {
        -    return alpha_ != null;
        +    return ((bitField0_ & 0x00000001) != 0);
           }
        +
           /**
            *
            *
            * 
            * The fraction of this color that should be applied to the pixel. That is,
            * the final pixel color is defined by the equation:
        -   *   `pixel color = alpha * (this color) + (1.0 - alpha) * (background color)`
        +   *
        +   * `pixel color = alpha * (this color) + (1.0 - alpha) * (background color)`
        +   *
            * This means that a value of 1.0 corresponds to a solid color, whereas
            * a value of 0.0 corresponds to a completely transparent color. This
            * uses a wrapper message rather than a simple float scalar so that it is
        @@ -270,13 +300,16 @@ public boolean hasAlpha() {
           public com.google.protobuf.FloatValue getAlpha() {
             return alpha_ == null ? com.google.protobuf.FloatValue.getDefaultInstance() : alpha_;
           }
        +
           /**
            *
            *
            * 
            * The fraction of this color that should be applied to the pixel. That is,
            * the final pixel color is defined by the equation:
        -   *   `pixel color = alpha * (this color) + (1.0 - alpha) * (background color)`
        +   *
        +   * `pixel color = alpha * (this color) + (1.0 - alpha) * (background color)`
        +   *
            * This means that a value of 1.0 corresponds to a solid color, whereas
            * a value of 0.0 corresponds to a completely transparent color. This
            * uses a wrapper message rather than a simple float scalar so that it is
        @@ -289,7 +322,7 @@ public com.google.protobuf.FloatValue getAlpha() {
            */
           @java.lang.Override
           public com.google.protobuf.FloatValueOrBuilder getAlphaOrBuilder() {
        -    return getAlpha();
        +    return alpha_ == null ? com.google.protobuf.FloatValue.getDefaultInstance() : alpha_;
           }
         
           private byte memoizedIsInitialized = -1;
        @@ -315,7 +348,7 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io
             if (java.lang.Float.floatToRawIntBits(blue_) != 0) {
               output.writeFloat(3, blue_);
             }
        -    if (alpha_ != null) {
        +    if (((bitField0_ & 0x00000001) != 0)) {
               output.writeMessage(4, getAlpha());
             }
             getUnknownFields().writeTo(output);
        @@ -336,7 +369,7 @@ public int getSerializedSize() {
             if (java.lang.Float.floatToRawIntBits(blue_) != 0) {
               size += com.google.protobuf.CodedOutputStream.computeFloatSize(3, blue_);
             }
        -    if (alpha_ != null) {
        +    if (((bitField0_ & 0x00000001) != 0)) {
               size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, getAlpha());
             }
             size += getUnknownFields().getSerializedSize();
        @@ -426,38 +459,38 @@ public static com.google.type.Color parseFrom(
         
           public static com.google.type.Color parseFrom(java.io.InputStream input)
               throws java.io.IOException {
        -    return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
        +    return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input);
           }
         
           public static com.google.type.Color parseFrom(
               java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
               throws java.io.IOException {
        -    return com.google.protobuf.GeneratedMessageV3.parseWithIOException(
        +    return com.google.protobuf.GeneratedMessage.parseWithIOException(
                 PARSER, input, extensionRegistry);
           }
         
           public static com.google.type.Color parseDelimitedFrom(java.io.InputStream input)
               throws java.io.IOException {
        -    return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input);
        +    return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input);
           }
         
           public static com.google.type.Color parseDelimitedFrom(
               java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
               throws java.io.IOException {
        -    return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(
        +    return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(
                 PARSER, input, extensionRegistry);
           }
         
           public static com.google.type.Color parseFrom(com.google.protobuf.CodedInputStream input)
               throws java.io.IOException {
        -    return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
        +    return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input);
           }
         
           public static com.google.type.Color parseFrom(
               com.google.protobuf.CodedInputStream input,
               com.google.protobuf.ExtensionRegistryLite extensionRegistry)
               throws java.io.IOException {
        -    return com.google.protobuf.GeneratedMessageV3.parseWithIOException(
        +    return com.google.protobuf.GeneratedMessage.parseWithIOException(
                 PARSER, input, extensionRegistry);
           }
         
        @@ -480,10 +513,11 @@ public Builder toBuilder() {
           }
         
           @java.lang.Override
        -  protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
        +  protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) {
             Builder builder = new Builder(parent);
             return builder;
           }
        +
           /**
            *
            *
        @@ -495,111 +529,128 @@ protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.Build
            * can also be trivially provided to UIColor's `+colorWithRed:green:blue:alpha`
            * method in iOS; and, with just a little work, it can be easily formatted into
            * a CSS `rgba()` string in JavaScript.
        +   *
            * This reference page doesn't carry information about the absolute color
            * space
            * that should be used to interpret the RGB value (e.g. sRGB, Adobe RGB,
            * DCI-P3, BT.2020, etc.). By default, applications should assume the sRGB color
            * space.
        +   *
            * When color equality needs to be decided, implementations, unless
            * documented otherwise, treat two colors as equal if all their red,
            * green, blue, and alpha values each differ by at most 1e-5.
        +   *
            * Example (Java):
        -   *      import com.google.type.Color;
        -   *      // ...
        -   *      public static java.awt.Color fromProto(Color protocolor) {
        -   *        float alpha = protocolor.hasAlpha()
        -   *            ? protocolor.getAlpha().getValue()
        -   *            : 1.0;
        -   *        return new java.awt.Color(
        -   *            protocolor.getRed(),
        -   *            protocolor.getGreen(),
        -   *            protocolor.getBlue(),
        -   *            alpha);
        -   *      }
        -   *      public static Color toProto(java.awt.Color color) {
        -   *        float red = (float) color.getRed();
        -   *        float green = (float) color.getGreen();
        -   *        float blue = (float) color.getBlue();
        -   *        float denominator = 255.0;
        -   *        Color.Builder resultBuilder =
        -   *            Color
        -   *                .newBuilder()
        -   *                .setRed(red / denominator)
        -   *                .setGreen(green / denominator)
        -   *                .setBlue(blue / denominator);
        -   *        int alpha = color.getAlpha();
        -   *        if (alpha != 255) {
        -   *          result.setAlpha(
        -   *              FloatValue
        -   *                  .newBuilder()
        -   *                  .setValue(((float) alpha) / denominator)
        -   *                  .build());
        -   *        }
        -   *        return resultBuilder.build();
        -   *      }
        -   *      // ...
        +   *
        +   * import com.google.type.Color;
        +   *
        +   * // ...
        +   * public static java.awt.Color fromProto(Color protocolor) {
        +   * float alpha = protocolor.hasAlpha()
        +   * ? protocolor.getAlpha().getValue()
        +   * : 1.0;
        +   *
        +   * return new java.awt.Color(
        +   * protocolor.getRed(),
        +   * protocolor.getGreen(),
        +   * protocolor.getBlue(),
        +   * alpha);
        +   * }
        +   *
        +   * public static Color toProto(java.awt.Color color) {
        +   * float red = (float) color.getRed();
        +   * float green = (float) color.getGreen();
        +   * float blue = (float) color.getBlue();
        +   * float denominator = 255.0;
        +   * Color.Builder resultBuilder =
        +   * Color
        +   * .newBuilder()
        +   * .setRed(red / denominator)
        +   * .setGreen(green / denominator)
        +   * .setBlue(blue / denominator);
        +   * int alpha = color.getAlpha();
        +   * if (alpha != 255) {
        +   * result.setAlpha(
        +   * FloatValue
        +   * .newBuilder()
        +   * .setValue(((float) alpha) / denominator)
        +   * .build());
        +   * }
        +   * return resultBuilder.build();
        +   * }
        +   * // ...
        +   *
            * Example (iOS / Obj-C):
        -   *      // ...
        -   *      static UIColor* fromProto(Color* protocolor) {
        -   *         float red = [protocolor red];
        -   *         float green = [protocolor green];
        -   *         float blue = [protocolor blue];
        -   *         FloatValue* alpha_wrapper = [protocolor alpha];
        -   *         float alpha = 1.0;
        -   *         if (alpha_wrapper != nil) {
        -   *           alpha = [alpha_wrapper value];
        -   *         }
        -   *         return [UIColor colorWithRed:red green:green blue:blue alpha:alpha];
        -   *      }
        -   *      static Color* toProto(UIColor* color) {
        -   *          CGFloat red, green, blue, alpha;
        -   *          if (![color getRed:&red green:&green blue:&blue alpha:&alpha]) {
        -   *            return nil;
        -   *          }
        -   *          Color* result = [[Color alloc] init];
        -   *          [result setRed:red];
        -   *          [result setGreen:green];
        -   *          [result setBlue:blue];
        -   *          if (alpha <= 0.9999) {
        -   *            [result setAlpha:floatWrapperWithValue(alpha)];
        -   *          }
        -   *          [result autorelease];
        -   *          return result;
        -   *     }
        -   *     // ...
        -   *  Example (JavaScript):
        -   *     // ...
        -   *     var protoToCssColor = function(rgb_color) {
        -   *        var redFrac = rgb_color.red || 0.0;
        -   *        var greenFrac = rgb_color.green || 0.0;
        -   *        var blueFrac = rgb_color.blue || 0.0;
        -   *        var red = Math.floor(redFrac * 255);
        -   *        var green = Math.floor(greenFrac * 255);
        -   *        var blue = Math.floor(blueFrac * 255);
        -   *        if (!('alpha' in rgb_color)) {
        -   *           return rgbToCssColor(red, green, blue);
        -   *        }
        -   *        var alphaFrac = rgb_color.alpha.value || 0.0;
        -   *        var rgbParams = [red, green, blue].join(',');
        -   *        return ['rgba(', rgbParams, ',', alphaFrac, ')'].join('');
        -   *     };
        -   *     var rgbToCssColor = function(red, green, blue) {
        -   *       var rgbNumber = new Number((red << 16) | (green << 8) | blue);
        -   *       var hexString = rgbNumber.toString(16);
        -   *       var missingZeros = 6 - hexString.length;
        -   *       var resultBuilder = ['#'];
        -   *       for (var i = 0; i < missingZeros; i++) {
        -   *          resultBuilder.push('0');
        -   *       }
        -   *       resultBuilder.push(hexString);
        -   *       return resultBuilder.join('');
        -   *     };
        -   *     // ...
        +   *
        +   * // ...
        +   * static UIColor* fromProto(Color* protocolor) {
        +   * float red = [protocolor red];
        +   * float green = [protocolor green];
        +   * float blue = [protocolor blue];
        +   * FloatValue* alpha_wrapper = [protocolor alpha];
        +   * float alpha = 1.0;
        +   * if (alpha_wrapper != nil) {
        +   * alpha = [alpha_wrapper value];
        +   * }
        +   * return [UIColor colorWithRed:red green:green blue:blue alpha:alpha];
        +   * }
        +   *
        +   * static Color* toProto(UIColor* color) {
        +   * CGFloat red, green, blue, alpha;
        +   * if (![color getRed:&red green:&green blue:&blue alpha:&alpha]) {
        +   * return nil;
        +   * }
        +   * Color* result = [[Color alloc] init];
        +   * [result setRed:red];
        +   * [result setGreen:green];
        +   * [result setBlue:blue];
        +   * if (alpha <= 0.9999) {
        +   * [result setAlpha:floatWrapperWithValue(alpha)];
        +   * }
        +   * [result autorelease];
        +   * return result;
        +   * }
        +   * // ...
        +   *
        +   * Example (JavaScript):
        +   *
        +   * // ...
        +   *
        +   * var protoToCssColor = function(rgb_color) {
        +   * var redFrac = rgb_color.red || 0.0;
        +   * var greenFrac = rgb_color.green || 0.0;
        +   * var blueFrac = rgb_color.blue || 0.0;
        +   * var red = Math.floor(redFrac * 255);
        +   * var green = Math.floor(greenFrac * 255);
        +   * var blue = Math.floor(blueFrac * 255);
        +   *
        +   * if (!('alpha' in rgb_color)) {
        +   * return rgbToCssColor(red, green, blue);
        +   * }
        +   *
        +   * var alphaFrac = rgb_color.alpha.value || 0.0;
        +   * var rgbParams = [red, green, blue].join(',');
        +   * return ['rgba(', rgbParams, ',', alphaFrac, ')'].join('');
        +   * };
        +   *
        +   * var rgbToCssColor = function(red, green, blue) {
        +   * var rgbNumber = new Number((red << 16) | (green << 8) | blue);
        +   * var hexString = rgbNumber.toString(16);
        +   * var missingZeros = 6 - hexString.length;
        +   * var resultBuilder = ['#'];
        +   * for (var i = 0; i < missingZeros; i++) {
        +   * resultBuilder.push('0');
        +   * }
        +   * resultBuilder.push(hexString);
        +   * return resultBuilder.join('');
        +   * };
        +   *
        +   * // ...
            * 
        * * Protobuf type {@code google.type.Color} */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder implements // @@protoc_insertion_point(builder_implements:google.type.Color) com.google.type.ColorOrBuilder { @@ -608,7 +659,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.type.ColorProto.internal_static_google_type_Color_fieldAccessorTable .ensureFieldAccessorsInitialized( @@ -616,25 +667,31 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } // Construct using com.google.type.Color.newBuilder() - private Builder() {} + private Builder() { + maybeForceBuilderInitialization(); + } - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetAlphaFieldBuilder(); + } } @java.lang.Override public Builder clear() { super.clear(); + bitField0_ = 0; red_ = 0F; - green_ = 0F; - blue_ = 0F; - - if (alphaBuilder_ == null) { - alpha_ = null; - } else { - alpha_ = null; + alpha_ = null; + if (alphaBuilder_ != null) { + alphaBuilder_.dispose(); alphaBuilder_ = null; } return this; @@ -662,49 +719,30 @@ public com.google.type.Color build() { @java.lang.Override public com.google.type.Color buildPartial() { com.google.type.Color result = new com.google.type.Color(this); - result.red_ = red_; - result.green_ = green_; - result.blue_ = blue_; - if (alphaBuilder_ == null) { - result.alpha_ = alpha_; - } else { - result.alpha_ = alphaBuilder_.build(); + if (bitField0_ != 0) { + buildPartial0(result); } 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); + private void buildPartial0(com.google.type.Color result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.red_ = red_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.green_ = green_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.blue_ = blue_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000008) != 0)) { + result.alpha_ = alphaBuilder_ == null ? alpha_ : alphaBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + result.bitField0_ |= to_bitField0_; } @java.lang.Override @@ -719,13 +757,13 @@ public Builder mergeFrom(com.google.protobuf.Message other) { public Builder mergeFrom(com.google.type.Color other) { if (other == com.google.type.Color.getDefaultInstance()) return this; - if (other.getRed() != 0F) { + if (java.lang.Float.floatToRawIntBits(other.getRed()) != 0) { setRed(other.getRed()); } - if (other.getGreen() != 0F) { + if (java.lang.Float.floatToRawIntBits(other.getGreen()) != 0) { setGreen(other.getGreen()); } - if (other.getBlue() != 0F) { + if (java.lang.Float.floatToRawIntBits(other.getBlue()) != 0) { setBlue(other.getBlue()); } if (other.hasAlpha()) { @@ -760,25 +798,25 @@ public Builder mergeFrom( case 13: { red_ = input.readFloat(); - + bitField0_ |= 0x00000001; break; } // case 13 case 21: { green_ = input.readFloat(); - + bitField0_ |= 0x00000002; break; } // case 21 case 29: { blue_ = input.readFloat(); - + bitField0_ |= 0x00000004; break; } // case 29 case 34: { - input.readMessage(getAlphaFieldBuilder().getBuilder(), extensionRegistry); - + input.readMessage(internalGetAlphaFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000008; break; } // case 34 default: @@ -798,7 +836,10 @@ public Builder mergeFrom( return this; } + private int bitField0_; + private float red_; + /** * * @@ -814,6 +855,7 @@ public Builder mergeFrom( public float getRed() { return red_; } + /** * * @@ -829,9 +871,11 @@ public float getRed() { public Builder setRed(float value) { red_ = value; + bitField0_ |= 0x00000001; onChanged(); return this; } + /** * * @@ -844,13 +888,14 @@ public Builder setRed(float value) { * @return This builder for chaining. */ public Builder clearRed() { - + bitField0_ = (bitField0_ & ~0x00000001); red_ = 0F; onChanged(); return this; } private float green_; + /** * * @@ -866,6 +911,7 @@ public Builder clearRed() { public float getGreen() { return green_; } + /** * * @@ -881,9 +927,11 @@ public float getGreen() { public Builder setGreen(float value) { green_ = value; + bitField0_ |= 0x00000002; onChanged(); return this; } + /** * * @@ -896,13 +944,14 @@ public Builder setGreen(float value) { * @return This builder for chaining. */ public Builder clearGreen() { - + bitField0_ = (bitField0_ & ~0x00000002); green_ = 0F; onChanged(); return this; } private float blue_; + /** * * @@ -918,6 +967,7 @@ public Builder clearGreen() { public float getBlue() { return blue_; } + /** * * @@ -933,9 +983,11 @@ public float getBlue() { public Builder setBlue(float value) { blue_ = value; + bitField0_ |= 0x00000004; onChanged(); return this; } + /** * * @@ -948,25 +1000,28 @@ public Builder setBlue(float value) { * @return This builder for chaining. */ public Builder clearBlue() { - + bitField0_ = (bitField0_ & ~0x00000004); blue_ = 0F; onChanged(); return this; } private com.google.protobuf.FloatValue alpha_; - private com.google.protobuf.SingleFieldBuilderV3< + private com.google.protobuf.SingleFieldBuilder< com.google.protobuf.FloatValue, com.google.protobuf.FloatValue.Builder, com.google.protobuf.FloatValueOrBuilder> alphaBuilder_; + /** * * *
              * The fraction of this color that should be applied to the pixel. That is,
              * the final pixel color is defined by the equation:
        -     *   `pixel color = alpha * (this color) + (1.0 - alpha) * (background color)`
        +     *
        +     * `pixel color = alpha * (this color) + (1.0 - alpha) * (background color)`
        +     *
              * This means that a value of 1.0 corresponds to a solid color, whereas
              * a value of 0.0 corresponds to a completely transparent color. This
              * uses a wrapper message rather than a simple float scalar so that it is
        @@ -980,15 +1035,18 @@ public Builder clearBlue() {
              * @return Whether the alpha field is set.
              */
             public boolean hasAlpha() {
        -      return alphaBuilder_ != null || alpha_ != null;
        +      return ((bitField0_ & 0x00000008) != 0);
             }
        +
             /**
              *
              *
              * 
              * The fraction of this color that should be applied to the pixel. That is,
              * the final pixel color is defined by the equation:
        -     *   `pixel color = alpha * (this color) + (1.0 - alpha) * (background color)`
        +     *
        +     * `pixel color = alpha * (this color) + (1.0 - alpha) * (background color)`
        +     *
              * This means that a value of 1.0 corresponds to a solid color, whereas
              * a value of 0.0 corresponds to a completely transparent color. This
              * uses a wrapper message rather than a simple float scalar so that it is
        @@ -1008,13 +1066,16 @@ public com.google.protobuf.FloatValue getAlpha() {
                 return alphaBuilder_.getMessage();
               }
             }
        +
             /**
              *
              *
              * 
              * The fraction of this color that should be applied to the pixel. That is,
              * the final pixel color is defined by the equation:
        -     *   `pixel color = alpha * (this color) + (1.0 - alpha) * (background color)`
        +     *
        +     * `pixel color = alpha * (this color) + (1.0 - alpha) * (background color)`
        +     *
              * This means that a value of 1.0 corresponds to a solid color, whereas
              * a value of 0.0 corresponds to a completely transparent color. This
              * uses a wrapper message rather than a simple float scalar so that it is
        @@ -1031,20 +1092,23 @@ public Builder setAlpha(com.google.protobuf.FloatValue value) {
                   throw new NullPointerException();
                 }
                 alpha_ = value;
        -        onChanged();
               } else {
                 alphaBuilder_.setMessage(value);
               }
        -
        +      bitField0_ |= 0x00000008;
        +      onChanged();
               return this;
             }
        +
             /**
              *
              *
              * 
              * The fraction of this color that should be applied to the pixel. That is,
              * the final pixel color is defined by the equation:
        -     *   `pixel color = alpha * (this color) + (1.0 - alpha) * (background color)`
        +     *
        +     * `pixel color = alpha * (this color) + (1.0 - alpha) * (background color)`
        +     *
              * This means that a value of 1.0 corresponds to a solid color, whereas
              * a value of 0.0 corresponds to a completely transparent color. This
              * uses a wrapper message rather than a simple float scalar so that it is
        @@ -1058,20 +1122,23 @@ public Builder setAlpha(com.google.protobuf.FloatValue value) {
             public Builder setAlpha(com.google.protobuf.FloatValue.Builder builderForValue) {
               if (alphaBuilder_ == null) {
                 alpha_ = builderForValue.build();
        -        onChanged();
               } else {
                 alphaBuilder_.setMessage(builderForValue.build());
               }
        -
        +      bitField0_ |= 0x00000008;
        +      onChanged();
               return this;
             }
        +
             /**
              *
              *
              * 
              * The fraction of this color that should be applied to the pixel. That is,
              * the final pixel color is defined by the equation:
        -     *   `pixel color = alpha * (this color) + (1.0 - alpha) * (background color)`
        +     *
        +     * `pixel color = alpha * (this color) + (1.0 - alpha) * (background color)`
        +     *
              * This means that a value of 1.0 corresponds to a solid color, whereas
              * a value of 0.0 corresponds to a completely transparent color. This
              * uses a wrapper message rather than a simple float scalar so that it is
        @@ -1084,26 +1151,32 @@ public Builder setAlpha(com.google.protobuf.FloatValue.Builder builderForValue)
              */
             public Builder mergeAlpha(com.google.protobuf.FloatValue value) {
               if (alphaBuilder_ == null) {
        -        if (alpha_ != null) {
        -          alpha_ =
        -              com.google.protobuf.FloatValue.newBuilder(alpha_).mergeFrom(value).buildPartial();
        +        if (((bitField0_ & 0x00000008) != 0)
        +            && alpha_ != null
        +            && alpha_ != com.google.protobuf.FloatValue.getDefaultInstance()) {
        +          getAlphaBuilder().mergeFrom(value);
                 } else {
                   alpha_ = value;
                 }
        -        onChanged();
               } else {
                 alphaBuilder_.mergeFrom(value);
               }
        -
        +      if (alpha_ != null) {
        +        bitField0_ |= 0x00000008;
        +        onChanged();
        +      }
               return this;
             }
        +
             /**
              *
              *
              * 
              * The fraction of this color that should be applied to the pixel. That is,
              * the final pixel color is defined by the equation:
        -     *   `pixel color = alpha * (this color) + (1.0 - alpha) * (background color)`
        +     *
        +     * `pixel color = alpha * (this color) + (1.0 - alpha) * (background color)`
        +     *
              * This means that a value of 1.0 corresponds to a solid color, whereas
              * a value of 0.0 corresponds to a completely transparent color. This
              * uses a wrapper message rather than a simple float scalar so that it is
        @@ -1115,23 +1188,25 @@ public Builder mergeAlpha(com.google.protobuf.FloatValue value) {
              * .google.protobuf.FloatValue alpha = 4;
              */
             public Builder clearAlpha() {
        -      if (alphaBuilder_ == null) {
        -        alpha_ = null;
        -        onChanged();
        -      } else {
        -        alpha_ = null;
        +      bitField0_ = (bitField0_ & ~0x00000008);
        +      alpha_ = null;
        +      if (alphaBuilder_ != null) {
        +        alphaBuilder_.dispose();
                 alphaBuilder_ = null;
               }
        -
        +      onChanged();
               return this;
             }
        +
             /**
              *
              *
              * 
              * The fraction of this color that should be applied to the pixel. That is,
              * the final pixel color is defined by the equation:
        -     *   `pixel color = alpha * (this color) + (1.0 - alpha) * (background color)`
        +     *
        +     * `pixel color = alpha * (this color) + (1.0 - alpha) * (background color)`
        +     *
              * This means that a value of 1.0 corresponds to a solid color, whereas
              * a value of 0.0 corresponds to a completely transparent color. This
              * uses a wrapper message rather than a simple float scalar so that it is
        @@ -1143,17 +1218,20 @@ public Builder clearAlpha() {
              * .google.protobuf.FloatValue alpha = 4;
              */
             public com.google.protobuf.FloatValue.Builder getAlphaBuilder() {
        -
        +      bitField0_ |= 0x00000008;
               onChanged();
        -      return getAlphaFieldBuilder().getBuilder();
        +      return internalGetAlphaFieldBuilder().getBuilder();
             }
        +
             /**
              *
              *
              * 
              * The fraction of this color that should be applied to the pixel. That is,
              * the final pixel color is defined by the equation:
        -     *   `pixel color = alpha * (this color) + (1.0 - alpha) * (background color)`
        +     *
        +     * `pixel color = alpha * (this color) + (1.0 - alpha) * (background color)`
        +     *
              * This means that a value of 1.0 corresponds to a solid color, whereas
              * a value of 0.0 corresponds to a completely transparent color. This
              * uses a wrapper message rather than a simple float scalar so that it is
        @@ -1171,13 +1249,16 @@ public com.google.protobuf.FloatValueOrBuilder getAlphaOrBuilder() {
                 return alpha_ == null ? com.google.protobuf.FloatValue.getDefaultInstance() : alpha_;
               }
             }
        +
             /**
              *
              *
              * 
              * The fraction of this color that should be applied to the pixel. That is,
              * the final pixel color is defined by the equation:
        -     *   `pixel color = alpha * (this color) + (1.0 - alpha) * (background color)`
        +     *
        +     * `pixel color = alpha * (this color) + (1.0 - alpha) * (background color)`
        +     *
              * This means that a value of 1.0 corresponds to a solid color, whereas
              * a value of 0.0 corresponds to a completely transparent color. This
              * uses a wrapper message rather than a simple float scalar so that it is
        @@ -1188,14 +1269,14 @@ public com.google.protobuf.FloatValueOrBuilder getAlphaOrBuilder() {
              *
              * .google.protobuf.FloatValue alpha = 4;
              */
        -    private com.google.protobuf.SingleFieldBuilderV3<
        +    private com.google.protobuf.SingleFieldBuilder<
                     com.google.protobuf.FloatValue,
                     com.google.protobuf.FloatValue.Builder,
                     com.google.protobuf.FloatValueOrBuilder>
        -        getAlphaFieldBuilder() {
        +        internalGetAlphaFieldBuilder() {
               if (alphaBuilder_ == null) {
                 alphaBuilder_ =
        -            new com.google.protobuf.SingleFieldBuilderV3<
        +            new com.google.protobuf.SingleFieldBuilder<
                         com.google.protobuf.FloatValue,
                         com.google.protobuf.FloatValue.Builder,
                         com.google.protobuf.FloatValueOrBuilder>(
        @@ -1205,17 +1286,6 @@ public com.google.protobuf.FloatValueOrBuilder getAlphaOrBuilder() {
               return alphaBuilder_;
             }
         
        -    @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.type.Color)
           }
         
        diff --git a/java-common-protos/proto-google-common-protos/src/main/java/com/google/type/ColorOrBuilder.java b/java-common-protos/proto-google-common-protos/src/main/java/com/google/type/ColorOrBuilder.java
        index f789a85df7..9e77c2b147 100644
        --- a/java-common-protos/proto-google-common-protos/src/main/java/com/google/type/ColorOrBuilder.java
        +++ b/java-common-protos/proto-google-common-protos/src/main/java/com/google/type/ColorOrBuilder.java
        @@ -1,5 +1,5 @@
         /*
        - * Copyright 2020 Google LLC
        + * Copyright 2026 Google LLC
          *
          * Licensed under the Apache License, Version 2.0 (the "License");
          * you may not use this file except in compliance with the License.
        @@ -14,10 +14,13 @@
          * limitations under the License.
          */
         // Generated by the protocol buffer compiler.  DO NOT EDIT!
        +// NO CHECKED-IN PROTOBUF GENCODE
         // source: google/type/color.proto
        +// Protobuf Java Version: 4.33.2
         
         package com.google.type;
         
        +@com.google.protobuf.Generated
         public interface ColorOrBuilder
             extends
             // @@protoc_insertion_point(interface_extends:google.type.Color)
        @@ -68,7 +71,9 @@ public interface ColorOrBuilder
            * 
            * The fraction of this color that should be applied to the pixel. That is,
            * the final pixel color is defined by the equation:
        -   *   `pixel color = alpha * (this color) + (1.0 - alpha) * (background color)`
        +   *
        +   * `pixel color = alpha * (this color) + (1.0 - alpha) * (background color)`
        +   *
            * This means that a value of 1.0 corresponds to a solid color, whereas
            * a value of 0.0 corresponds to a completely transparent color. This
            * uses a wrapper message rather than a simple float scalar so that it is
        @@ -82,13 +87,16 @@ public interface ColorOrBuilder
            * @return Whether the alpha field is set.
            */
           boolean hasAlpha();
        +
           /**
            *
            *
            * 
            * The fraction of this color that should be applied to the pixel. That is,
            * the final pixel color is defined by the equation:
        -   *   `pixel color = alpha * (this color) + (1.0 - alpha) * (background color)`
        +   *
        +   * `pixel color = alpha * (this color) + (1.0 - alpha) * (background color)`
        +   *
            * This means that a value of 1.0 corresponds to a solid color, whereas
            * a value of 0.0 corresponds to a completely transparent color. This
            * uses a wrapper message rather than a simple float scalar so that it is
        @@ -102,13 +110,16 @@ public interface ColorOrBuilder
            * @return The alpha.
            */
           com.google.protobuf.FloatValue getAlpha();
        +
           /**
            *
            *
            * 
            * The fraction of this color that should be applied to the pixel. That is,
            * the final pixel color is defined by the equation:
        -   *   `pixel color = alpha * (this color) + (1.0 - alpha) * (background color)`
        +   *
        +   * `pixel color = alpha * (this color) + (1.0 - alpha) * (background color)`
        +   *
            * This means that a value of 1.0 corresponds to a solid color, whereas
            * a value of 0.0 corresponds to a completely transparent color. This
            * uses a wrapper message rather than a simple float scalar so that it is
        diff --git a/java-common-protos/proto-google-common-protos/src/main/java/com/google/type/ColorProto.java b/java-common-protos/proto-google-common-protos/src/main/java/com/google/type/ColorProto.java
        index 1a93525b1c..b80ef0003d 100644
        --- a/java-common-protos/proto-google-common-protos/src/main/java/com/google/type/ColorProto.java
        +++ b/java-common-protos/proto-google-common-protos/src/main/java/com/google/type/ColorProto.java
        @@ -1,5 +1,5 @@
         /*
        - * Copyright 2020 Google LLC
        + * Copyright 2026 Google LLC
          *
          * Licensed under the Apache License, Version 2.0 (the "License");
          * you may not use this file except in compliance with the License.
        @@ -14,13 +14,26 @@
          * limitations under the License.
          */
         // Generated by the protocol buffer compiler.  DO NOT EDIT!
        +// NO CHECKED-IN PROTOBUF GENCODE
         // source: google/type/color.proto
        +// Protobuf Java Version: 4.33.2
         
         package com.google.type;
         
        -public final class ColorProto {
        +@com.google.protobuf.Generated
        +public final class ColorProto extends com.google.protobuf.GeneratedFile {
           private ColorProto() {}
         
        +  static {
        +    com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion(
        +        com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC,
        +        /* major= */ 4,
        +        /* minor= */ 33,
        +        /* patch= */ 2,
        +        /* suffix= */ "",
        +        "ColorProto");
        +  }
        +
           public static void registerAllExtensions(com.google.protobuf.ExtensionRegistryLite registry) {}
         
           public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry registry) {
        @@ -29,7 +42,7 @@ public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry r
         
           static final com.google.protobuf.Descriptors.Descriptor
               internal_static_google_type_Color_descriptor;
        -  static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
        +  static final com.google.protobuf.GeneratedMessage.FieldAccessorTable
               internal_static_google_type_Color_fieldAccessorTable;
         
           public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() {
        @@ -40,12 +53,15 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() {
         
           static {
             java.lang.String[] descriptorData = {
        -      "\n\027google/type/color.proto\022\013google.type\032\036"
        -          + "google/protobuf/wrappers.proto\"]\n\005Color\022"
        -          + "\013\n\003red\030\001 \001(\002\022\r\n\005green\030\002 \001(\002\022\014\n\004blue\030\003 \001("
        -          + "\002\022*\n\005alpha\030\004 \001(\0132\033.google.protobuf.Float"
        -          + "ValueB`\n\017com.google.typeB\nColorProtoP\001Z6"
        -          + "google.golang.org/genproto/googleapis/ty"
        +      "\n"
        +          + "\027google/type/color.proto\022\013google.type\032\036google/protobuf/wrappers.proto\"]\n"
        +          + "\005Color\022\013\n"
        +          + "\003red\030\001 \001(\002\022\r\n"
        +          + "\005green\030\002 \001(\002\022\014\n"
        +          + "\004blue\030\003 \001(\002\022*\n"
        +          + "\005alpha\030\004 \001(\0132\033.google.protobuf.FloatValueB`\n"
        +          + "\017com.google.typeB\n"
        +          + "ColorProtoP\001Z6google.golang.org/genproto/googleapis/ty"
                   + "pe/color;color\370\001\001\242\002\003GTPb\006proto3"
             };
             descriptor =
        @@ -54,13 +70,14 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() {
                     new com.google.protobuf.Descriptors.FileDescriptor[] {
                       com.google.protobuf.WrappersProto.getDescriptor(),
                     });
        -    internal_static_google_type_Color_descriptor = getDescriptor().getMessageTypes().get(0);
        +    internal_static_google_type_Color_descriptor = getDescriptor().getMessageType(0);
             internal_static_google_type_Color_fieldAccessorTable =
        -        new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
        +        new com.google.protobuf.GeneratedMessage.FieldAccessorTable(
                     internal_static_google_type_Color_descriptor,
                     new java.lang.String[] {
                       "Red", "Green", "Blue", "Alpha",
                     });
        +    descriptor.resolveAllFeaturesImmutable();
             com.google.protobuf.WrappersProto.getDescriptor();
           }
         
        diff --git a/java-common-protos/proto-google-common-protos/src/main/java/com/google/type/Date.java b/java-common-protos/proto-google-common-protos/src/main/java/com/google/type/Date.java
        index a951785a3d..1c04a154b2 100644
        --- a/java-common-protos/proto-google-common-protos/src/main/java/com/google/type/Date.java
        +++ b/java-common-protos/proto-google-common-protos/src/main/java/com/google/type/Date.java
        @@ -1,5 +1,5 @@
         /*
        - * Copyright 2020 Google LLC
        + * Copyright 2026 Google LLC
          *
          * Licensed under the Apache License, Version 2.0 (the "License");
          * you may not use this file except in compliance with the License.
        @@ -14,7 +14,9 @@
          * limitations under the License.
          */
         // Generated by the protocol buffer compiler.  DO NOT EDIT!
        +// NO CHECKED-IN PROTOBUF GENCODE
         // source: google/type/date.proto
        +// Protobuf Java Version: 4.33.2
         
         package com.google.type;
         
        @@ -26,46 +28,49 @@
          * day and time zone are either specified elsewhere or are insignificant. The
          * date is relative to the Gregorian Calendar. This can represent one of the
          * following:
        + *
          * * A full date, with non-zero year, month, and day values
          * * A month and day value, with a zero year, such as an anniversary
          * * A year on its own, with zero month and day values
          * * A year and month value, with a zero day, such as a credit card expiration
          * date
        + *
          * Related types are [google.type.TimeOfDay][google.type.TimeOfDay] and
          * `google.protobuf.Timestamp`.
          * 
        * * Protobuf type {@code google.type.Date} */ -public final class Date extends com.google.protobuf.GeneratedMessageV3 +@com.google.protobuf.Generated +public final class Date extends com.google.protobuf.GeneratedMessage implements // @@protoc_insertion_point(message_implements:google.type.Date) DateOrBuilder { private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "Date"); + } + // Use Date.newBuilder() to construct. - private Date(com.google.protobuf.GeneratedMessageV3.Builder builder) { + private Date(com.google.protobuf.GeneratedMessage.Builder builder) { super(builder); } private Date() {} - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new Date(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.type.DateProto.internal_static_google_type_Date_descriptor; } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.type.DateProto.internal_static_google_type_Date_fieldAccessorTable .ensureFieldAccessorsInitialized( @@ -73,7 +78,8 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } public static final int YEAR_FIELD_NUMBER = 1; - private int year_; + private int year_ = 0; + /** * * @@ -92,7 +98,8 @@ public int getYear() { } public static final int MONTH_FIELD_NUMBER = 2; - private int month_; + private int month_ = 0; + /** * * @@ -111,7 +118,8 @@ public int getMonth() { } public static final int DAY_FIELD_NUMBER = 3; - private int day_; + private int day_ = 0; + /** * * @@ -247,38 +255,38 @@ public static com.google.type.Date parseFrom( public static com.google.type.Date parseFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); } public static com.google.type.Date parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } public static com.google.type.Date parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); } public static com.google.type.Date parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( PARSER, input, extensionRegistry); } public static com.google.type.Date parseFrom(com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); } public static com.google.type.Date parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } @@ -301,10 +309,11 @@ public Builder toBuilder() { } @java.lang.Override - protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { Builder builder = new Builder(parent); return builder; } + /** * * @@ -313,18 +322,20 @@ protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.Build * day and time zone are either specified elsewhere or are insignificant. The * date is relative to the Gregorian Calendar. This can represent one of the * following: + * * * A full date, with non-zero year, month, and day values * * A month and day value, with a zero year, such as an anniversary * * A year on its own, with zero month and day values * * A year and month value, with a zero day, such as a credit card expiration * date + * * Related types are [google.type.TimeOfDay][google.type.TimeOfDay] and * `google.protobuf.Timestamp`. *
        * * Protobuf type {@code google.type.Date} */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder implements // @@protoc_insertion_point(builder_implements:google.type.Date) com.google.type.DateOrBuilder { @@ -333,7 +344,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.type.DateProto.internal_static_google_type_Date_fieldAccessorTable .ensureFieldAccessorsInitialized( @@ -343,19 +354,17 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { // Construct using com.google.type.Date.newBuilder() private Builder() {} - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { super(parent); } @java.lang.Override public Builder clear() { super.clear(); + bitField0_ = 0; year_ = 0; - month_ = 0; - day_ = 0; - return this; } @@ -381,44 +390,24 @@ public com.google.type.Date build() { @java.lang.Override public com.google.type.Date buildPartial() { com.google.type.Date result = new com.google.type.Date(this); - result.year_ = year_; - result.month_ = month_; - result.day_ = day_; + if (bitField0_ != 0) { + buildPartial0(result); + } 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); + private void buildPartial0(com.google.type.Date result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.year_ = year_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.month_ = month_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.day_ = day_; + } } @java.lang.Override @@ -471,19 +460,19 @@ public Builder mergeFrom( case 8: { year_ = input.readInt32(); - + bitField0_ |= 0x00000001; break; } // case 8 case 16: { month_ = input.readInt32(); - + bitField0_ |= 0x00000002; break; } // case 16 case 24: { day_ = input.readInt32(); - + bitField0_ |= 0x00000004; break; } // case 24 default: @@ -503,7 +492,10 @@ public Builder mergeFrom( return this; } + private int bitField0_; + private int year_; + /** * * @@ -520,6 +512,7 @@ public Builder mergeFrom( public int getYear() { return year_; } + /** * * @@ -536,9 +529,11 @@ public int getYear() { public Builder setYear(int value) { year_ = value; + bitField0_ |= 0x00000001; onChanged(); return this; } + /** * * @@ -552,13 +547,14 @@ public Builder setYear(int value) { * @return This builder for chaining. */ public Builder clearYear() { - + bitField0_ = (bitField0_ & ~0x00000001); year_ = 0; onChanged(); return this; } private int month_; + /** * * @@ -575,6 +571,7 @@ public Builder clearYear() { public int getMonth() { return month_; } + /** * * @@ -591,9 +588,11 @@ public int getMonth() { public Builder setMonth(int value) { month_ = value; + bitField0_ |= 0x00000002; onChanged(); return this; } + /** * * @@ -607,13 +606,14 @@ public Builder setMonth(int value) { * @return This builder for chaining. */ public Builder clearMonth() { - + bitField0_ = (bitField0_ & ~0x00000002); month_ = 0; onChanged(); return this; } private int day_; + /** * * @@ -631,6 +631,7 @@ public Builder clearMonth() { public int getDay() { return day_; } + /** * * @@ -648,9 +649,11 @@ public int getDay() { public Builder setDay(int value) { day_ = value; + bitField0_ |= 0x00000004; onChanged(); return this; } + /** * * @@ -665,23 +668,12 @@ public Builder setDay(int value) { * @return This builder for chaining. */ public Builder clearDay() { - + bitField0_ = (bitField0_ & ~0x00000004); day_ = 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.type.Date) } diff --git a/java-common-protos/proto-google-common-protos/src/main/java/com/google/type/DateOrBuilder.java b/java-common-protos/proto-google-common-protos/src/main/java/com/google/type/DateOrBuilder.java index d3b2a3cb04..714476e92f 100644 --- a/java-common-protos/proto-google-common-protos/src/main/java/com/google/type/DateOrBuilder.java +++ b/java-common-protos/proto-google-common-protos/src/main/java/com/google/type/DateOrBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,10 +14,13 @@ * limitations under the License. */ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: google/type/date.proto +// Protobuf Java Version: 4.33.2 package com.google.type; +@com.google.protobuf.Generated public interface DateOrBuilder extends // @@protoc_insertion_point(interface_extends:google.type.Date) diff --git a/java-common-protos/proto-google-common-protos/src/main/java/com/google/type/DateProto.java b/java-common-protos/proto-google-common-protos/src/main/java/com/google/type/DateProto.java index f9fd29cc94..834120366c 100644 --- a/java-common-protos/proto-google-common-protos/src/main/java/com/google/type/DateProto.java +++ b/java-common-protos/proto-google-common-protos/src/main/java/com/google/type/DateProto.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,13 +14,26 @@ * limitations under the License. */ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: google/type/date.proto +// Protobuf Java Version: 4.33.2 package com.google.type; -public final class DateProto { +@com.google.protobuf.Generated +public final class DateProto extends com.google.protobuf.GeneratedFile { private DateProto() {} + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "DateProto"); + } + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistryLite registry) {} public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry registry) { @@ -29,7 +42,7 @@ public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry r static final com.google.protobuf.Descriptors.Descriptor internal_static_google_type_Date_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable internal_static_google_type_Date_fieldAccessorTable; public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { @@ -40,22 +53,26 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { static { java.lang.String[] descriptorData = { - "\n\026google/type/date.proto\022\013google.type\"0\n" - + "\004Date\022\014\n\004year\030\001 \001(\005\022\r\n\005month\030\002 \001(\005\022\013\n\003da" - + "y\030\003 \001(\005B]\n\017com.google.typeB\tDateProtoP\001Z" - + "4google.golang.org/genproto/googleapis/t" + "\n" + + "\026google/type/date.proto\022\013google.type\"0\n" + + "\004Date\022\014\n" + + "\004year\030\001 \001(\005\022\r\n" + + "\005month\030\002 \001(\005\022\013\n" + + "\003day\030\003 \001(\005B]\n" + + "\017com.google.typeB\tDateProtoP\001Z4google.golang.org/genproto/googleapis/t" + "ype/date;date\370\001\001\242\002\003GTPb\006proto3" }; descriptor = com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( descriptorData, new com.google.protobuf.Descriptors.FileDescriptor[] {}); - internal_static_google_type_Date_descriptor = getDescriptor().getMessageTypes().get(0); + internal_static_google_type_Date_descriptor = getDescriptor().getMessageType(0); internal_static_google_type_Date_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_google_type_Date_descriptor, new java.lang.String[] { "Year", "Month", "Day", }); + descriptor.resolveAllFeaturesImmutable(); } // @@protoc_insertion_point(outer_class_scope) diff --git a/java-common-protos/proto-google-common-protos/src/main/java/com/google/type/DateTime.java b/java-common-protos/proto-google-common-protos/src/main/java/com/google/type/DateTime.java index af4b978fc2..7ced5f12ae 100644 --- a/java-common-protos/proto-google-common-protos/src/main/java/com/google/type/DateTime.java +++ b/java-common-protos/proto-google-common-protos/src/main/java/com/google/type/DateTime.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,9 @@ * limitations under the License. */ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: google/type/datetime.proto +// Protobuf Java Version: 4.33.2 package com.google.type; @@ -23,56 +25,63 @@ * *
          * Represents civil time (or occasionally physical time).
        + *
          * This type can represent a civil time in one of a few possible ways:
        - *  * When utc_offset is set and time_zone is unset: a civil time on a calendar
        - *    day with a particular offset from UTC.
        - *  * When time_zone is set and utc_offset is unset: a civil time on a calendar
        - *    day in a particular time zone.
        - *  * When neither time_zone nor utc_offset is set: a civil time on a calendar
        - *    day in local time.
        + *
        + * * When utc_offset is set and time_zone is unset: a civil time on a calendar
        + * day with a particular offset from UTC.
        + * * When time_zone is set and utc_offset is unset: a civil time on a calendar
        + * day in a particular time zone.
        + * * When neither time_zone nor utc_offset is set: a civil time on a calendar
        + * day in local time.
        + *
          * The date is relative to the Proleptic Gregorian Calendar.
        + *
          * If year is 0, the DateTime is considered not to have a specific year. month
          * and day must have valid, non-zero values.
        + *
          * This type may also be used to represent a physical time if all the date and
          * time fields are set and either case of the `time_offset` oneof is set.
          * Consider using `Timestamp` message for physical time instead. If your use
          * case also would like to store the user's timezone, that can be done in
          * another field.
        + *
          * This type is more flexible than some applications may want. Make sure to
          * document and validate your application's limitations.
          * 
        * * Protobuf type {@code google.type.DateTime} */ -public final class DateTime extends com.google.protobuf.GeneratedMessageV3 +@com.google.protobuf.Generated +public final class DateTime extends com.google.protobuf.GeneratedMessage implements // @@protoc_insertion_point(message_implements:google.type.DateTime) DateTimeOrBuilder { private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "DateTime"); + } + // Use DateTime.newBuilder() to construct. - private DateTime(com.google.protobuf.GeneratedMessageV3.Builder builder) { + private DateTime(com.google.protobuf.GeneratedMessage.Builder builder) { super(builder); } private DateTime() {} - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new DateTime(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.type.DateTimeProto.internal_static_google_type_DateTime_descriptor; } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.type.DateTimeProto.internal_static_google_type_DateTime_fieldAccessorTable .ensureFieldAccessorsInitialized( @@ -80,6 +89,8 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } private int timeOffsetCase_ = 0; + + @SuppressWarnings("serial") private java.lang.Object timeOffset_; public enum TimeOffsetCase @@ -94,6 +105,7 @@ public enum TimeOffsetCase private TimeOffsetCase(int value) { this.value = value; } + /** * @param value The number of the enum to look for. * @return The enum associated with the given number. @@ -127,7 +139,8 @@ public TimeOffsetCase getTimeOffsetCase() { } public static final int YEAR_FIELD_NUMBER = 1; - private int year_; + private int year_ = 0; + /** * * @@ -146,7 +159,8 @@ public int getYear() { } public static final int MONTH_FIELD_NUMBER = 2; - private int month_; + private int month_ = 0; + /** * * @@ -164,7 +178,8 @@ public int getMonth() { } public static final int DAY_FIELD_NUMBER = 3; - private int day_; + private int day_ = 0; + /** * * @@ -183,7 +198,8 @@ public int getDay() { } public static final int HOURS_FIELD_NUMBER = 4; - private int hours_; + private int hours_ = 0; + /** * * @@ -203,7 +219,8 @@ public int getHours() { } public static final int MINUTES_FIELD_NUMBER = 5; - private int minutes_; + private int minutes_ = 0; + /** * * @@ -221,7 +238,8 @@ public int getMinutes() { } public static final int SECONDS_FIELD_NUMBER = 6; - private int seconds_; + private int seconds_ = 0; + /** * * @@ -240,7 +258,8 @@ public int getSeconds() { } public static final int NANOS_FIELD_NUMBER = 7; - private int nanos_; + private int nanos_ = 0; + /** * * @@ -259,6 +278,7 @@ public int getNanos() { } public static final int UTC_OFFSET_FIELD_NUMBER = 8; + /** * * @@ -276,6 +296,7 @@ public int getNanos() { public boolean hasUtcOffset() { return timeOffsetCase_ == 8; } + /** * * @@ -296,6 +317,7 @@ public com.google.protobuf.Duration getUtcOffset() { } return com.google.protobuf.Duration.getDefaultInstance(); } + /** * * @@ -316,6 +338,7 @@ public com.google.protobuf.DurationOrBuilder getUtcOffsetOrBuilder() { } public static final int TIME_ZONE_FIELD_NUMBER = 9; + /** * * @@ -331,6 +354,7 @@ public com.google.protobuf.DurationOrBuilder getUtcOffsetOrBuilder() { public boolean hasTimeZone() { return timeOffsetCase_ == 9; } + /** * * @@ -349,6 +373,7 @@ public com.google.type.TimeZone getTimeZone() { } return com.google.type.TimeZone.getDefaultInstance(); } + /** * * @@ -558,38 +583,38 @@ public static com.google.type.DateTime parseFrom( public static com.google.type.DateTime parseFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); } public static com.google.type.DateTime parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } public static com.google.type.DateTime parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); } public static com.google.type.DateTime parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( PARSER, input, extensionRegistry); } public static com.google.type.DateTime parseFrom(com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); } public static com.google.type.DateTime parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } @@ -612,37 +637,44 @@ public Builder toBuilder() { } @java.lang.Override - protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { Builder builder = new Builder(parent); return builder; } + /** * * *
            * Represents civil time (or occasionally physical time).
        +   *
            * This type can represent a civil time in one of a few possible ways:
        -   *  * When utc_offset is set and time_zone is unset: a civil time on a calendar
        -   *    day with a particular offset from UTC.
        -   *  * When time_zone is set and utc_offset is unset: a civil time on a calendar
        -   *    day in a particular time zone.
        -   *  * When neither time_zone nor utc_offset is set: a civil time on a calendar
        -   *    day in local time.
        +   *
        +   * * When utc_offset is set and time_zone is unset: a civil time on a calendar
        +   * day with a particular offset from UTC.
        +   * * When time_zone is set and utc_offset is unset: a civil time on a calendar
        +   * day in a particular time zone.
        +   * * When neither time_zone nor utc_offset is set: a civil time on a calendar
        +   * day in local time.
        +   *
            * The date is relative to the Proleptic Gregorian Calendar.
        +   *
            * If year is 0, the DateTime is considered not to have a specific year. month
            * and day must have valid, non-zero values.
        +   *
            * This type may also be used to represent a physical time if all the date and
            * time fields are set and either case of the `time_offset` oneof is set.
            * Consider using `Timestamp` message for physical time instead. If your use
            * case also would like to store the user's timezone, that can be done in
            * another field.
        +   *
            * This type is more flexible than some applications may want. Make sure to
            * document and validate your application's limitations.
            * 
        * * Protobuf type {@code google.type.DateTime} */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder implements // @@protoc_insertion_point(builder_implements:google.type.DateTime) com.google.type.DateTimeOrBuilder { @@ -651,7 +683,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.type.DateTimeProto.internal_static_google_type_DateTime_fieldAccessorTable .ensureFieldAccessorsInitialized( @@ -661,27 +693,21 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { // Construct using com.google.type.DateTime.newBuilder() private Builder() {} - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { super(parent); } @java.lang.Override public Builder clear() { super.clear(); + bitField0_ = 0; year_ = 0; - month_ = 0; - day_ = 0; - hours_ = 0; - minutes_ = 0; - seconds_ = 0; - nanos_ = 0; - if (utcOffsetBuilder_ != null) { utcOffsetBuilder_.clear(); } @@ -715,63 +741,48 @@ public com.google.type.DateTime build() { @java.lang.Override public com.google.type.DateTime buildPartial() { com.google.type.DateTime result = new com.google.type.DateTime(this); - result.year_ = year_; - result.month_ = month_; - result.day_ = day_; - result.hours_ = hours_; - result.minutes_ = minutes_; - result.seconds_ = seconds_; - result.nanos_ = nanos_; - if (timeOffsetCase_ == 8) { - if (utcOffsetBuilder_ == null) { - result.timeOffset_ = timeOffset_; - } else { - result.timeOffset_ = utcOffsetBuilder_.build(); - } + if (bitField0_ != 0) { + buildPartial0(result); } - if (timeOffsetCase_ == 9) { - if (timeZoneBuilder_ == null) { - result.timeOffset_ = timeOffset_; - } else { - result.timeOffset_ = timeZoneBuilder_.build(); - } - } - result.timeOffsetCase_ = timeOffsetCase_; + buildPartialOneofs(result); 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); + private void buildPartial0(com.google.type.DateTime result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.year_ = year_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.month_ = month_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.day_ = day_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.hours_ = hours_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.minutes_ = minutes_; + } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.seconds_ = seconds_; + } + if (((from_bitField0_ & 0x00000040) != 0)) { + result.nanos_ = nanos_; + } } - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.addRepeatedField(field, value); + private void buildPartialOneofs(com.google.type.DateTime result) { + result.timeOffsetCase_ = timeOffsetCase_; + result.timeOffset_ = this.timeOffset_; + if (timeOffsetCase_ == 8 && utcOffsetBuilder_ != null) { + result.timeOffset_ = utcOffsetBuilder_.build(); + } + if (timeOffsetCase_ == 9 && timeZoneBuilder_ != null) { + result.timeOffset_ = timeZoneBuilder_.build(); + } } @java.lang.Override @@ -852,54 +863,56 @@ public Builder mergeFrom( case 8: { year_ = input.readInt32(); - + bitField0_ |= 0x00000001; break; } // case 8 case 16: { month_ = input.readInt32(); - + bitField0_ |= 0x00000002; break; } // case 16 case 24: { day_ = input.readInt32(); - + bitField0_ |= 0x00000004; break; } // case 24 case 32: { hours_ = input.readInt32(); - + bitField0_ |= 0x00000008; break; } // case 32 case 40: { minutes_ = input.readInt32(); - + bitField0_ |= 0x00000010; break; } // case 40 case 48: { seconds_ = input.readInt32(); - + bitField0_ |= 0x00000020; break; } // case 48 case 56: { nanos_ = input.readInt32(); - + bitField0_ |= 0x00000040; break; } // case 56 case 66: { - input.readMessage(getUtcOffsetFieldBuilder().getBuilder(), extensionRegistry); + input.readMessage( + internalGetUtcOffsetFieldBuilder().getBuilder(), extensionRegistry); timeOffsetCase_ = 8; break; } // case 66 case 74: { - input.readMessage(getTimeZoneFieldBuilder().getBuilder(), extensionRegistry); + input.readMessage( + internalGetTimeZoneFieldBuilder().getBuilder(), extensionRegistry); timeOffsetCase_ = 9; break; } // case 74 @@ -934,7 +947,10 @@ public Builder clearTimeOffset() { return this; } + private int bitField0_; + private int year_; + /** * * @@ -951,6 +967,7 @@ public Builder clearTimeOffset() { public int getYear() { return year_; } + /** * * @@ -967,9 +984,11 @@ public int getYear() { public Builder setYear(int value) { year_ = value; + bitField0_ |= 0x00000001; onChanged(); return this; } + /** * * @@ -983,13 +1002,14 @@ public Builder setYear(int value) { * @return This builder for chaining. */ public Builder clearYear() { - + bitField0_ = (bitField0_ & ~0x00000001); year_ = 0; onChanged(); return this; } private int month_; + /** * * @@ -1005,6 +1025,7 @@ public Builder clearYear() { public int getMonth() { return month_; } + /** * * @@ -1020,9 +1041,11 @@ public int getMonth() { public Builder setMonth(int value) { month_ = value; + bitField0_ |= 0x00000002; onChanged(); return this; } + /** * * @@ -1035,13 +1058,14 @@ public Builder setMonth(int value) { * @return This builder for chaining. */ public Builder clearMonth() { - + bitField0_ = (bitField0_ & ~0x00000002); month_ = 0; onChanged(); return this; } private int day_; + /** * * @@ -1058,6 +1082,7 @@ public Builder clearMonth() { public int getDay() { return day_; } + /** * * @@ -1074,9 +1099,11 @@ public int getDay() { public Builder setDay(int value) { day_ = value; + bitField0_ |= 0x00000004; onChanged(); return this; } + /** * * @@ -1090,13 +1117,14 @@ public Builder setDay(int value) { * @return This builder for chaining. */ public Builder clearDay() { - + bitField0_ = (bitField0_ & ~0x00000004); day_ = 0; onChanged(); return this; } private int hours_; + /** * * @@ -1114,6 +1142,7 @@ public Builder clearDay() { public int getHours() { return hours_; } + /** * * @@ -1131,9 +1160,11 @@ public int getHours() { public Builder setHours(int value) { hours_ = value; + bitField0_ |= 0x00000008; onChanged(); return this; } + /** * * @@ -1148,13 +1179,14 @@ public Builder setHours(int value) { * @return This builder for chaining. */ public Builder clearHours() { - + bitField0_ = (bitField0_ & ~0x00000008); hours_ = 0; onChanged(); return this; } private int minutes_; + /** * * @@ -1170,6 +1202,7 @@ public Builder clearHours() { public int getMinutes() { return minutes_; } + /** * * @@ -1185,9 +1218,11 @@ public int getMinutes() { public Builder setMinutes(int value) { minutes_ = value; + bitField0_ |= 0x00000010; onChanged(); return this; } + /** * * @@ -1200,13 +1235,14 @@ public Builder setMinutes(int value) { * @return This builder for chaining. */ public Builder clearMinutes() { - + bitField0_ = (bitField0_ & ~0x00000010); minutes_ = 0; onChanged(); return this; } private int seconds_; + /** * * @@ -1223,6 +1259,7 @@ public Builder clearMinutes() { public int getSeconds() { return seconds_; } + /** * * @@ -1239,9 +1276,11 @@ public int getSeconds() { public Builder setSeconds(int value) { seconds_ = value; + bitField0_ |= 0x00000020; onChanged(); return this; } + /** * * @@ -1255,13 +1294,14 @@ public Builder setSeconds(int value) { * @return This builder for chaining. */ public Builder clearSeconds() { - + bitField0_ = (bitField0_ & ~0x00000020); seconds_ = 0; onChanged(); return this; } private int nanos_; + /** * * @@ -1278,6 +1318,7 @@ public Builder clearSeconds() { public int getNanos() { return nanos_; } + /** * * @@ -1294,9 +1335,11 @@ public int getNanos() { public Builder setNanos(int value) { nanos_ = value; + bitField0_ |= 0x00000040; onChanged(); return this; } + /** * * @@ -1310,17 +1353,18 @@ public Builder setNanos(int value) { * @return This builder for chaining. */ public Builder clearNanos() { - + bitField0_ = (bitField0_ & ~0x00000040); nanos_ = 0; onChanged(); return this; } - private com.google.protobuf.SingleFieldBuilderV3< + private com.google.protobuf.SingleFieldBuilder< com.google.protobuf.Duration, com.google.protobuf.Duration.Builder, com.google.protobuf.DurationOrBuilder> utcOffsetBuilder_; + /** * * @@ -1338,6 +1382,7 @@ public Builder clearNanos() { public boolean hasUtcOffset() { return timeOffsetCase_ == 8; } + /** * * @@ -1365,6 +1410,7 @@ public com.google.protobuf.Duration getUtcOffset() { return com.google.protobuf.Duration.getDefaultInstance(); } } + /** * * @@ -1389,6 +1435,7 @@ public Builder setUtcOffset(com.google.protobuf.Duration value) { timeOffsetCase_ = 8; return this; } + /** * * @@ -1410,6 +1457,7 @@ public Builder setUtcOffset(com.google.protobuf.Duration.Builder builderForValue timeOffsetCase_ = 8; return this; } + /** * * @@ -1443,6 +1491,7 @@ public Builder mergeUtcOffset(com.google.protobuf.Duration value) { timeOffsetCase_ = 8; return this; } + /** * * @@ -1470,6 +1519,7 @@ public Builder clearUtcOffset() { } return this; } + /** * * @@ -1482,8 +1532,9 @@ public Builder clearUtcOffset() { * .google.protobuf.Duration utc_offset = 8; */ public com.google.protobuf.Duration.Builder getUtcOffsetBuilder() { - return getUtcOffsetFieldBuilder().getBuilder(); + return internalGetUtcOffsetFieldBuilder().getBuilder(); } + /** * * @@ -1506,6 +1557,7 @@ public com.google.protobuf.DurationOrBuilder getUtcOffsetOrBuilder() { return com.google.protobuf.Duration.getDefaultInstance(); } } + /** * * @@ -1517,17 +1569,17 @@ public com.google.protobuf.DurationOrBuilder getUtcOffsetOrBuilder() { * * .google.protobuf.Duration utc_offset = 8; */ - private com.google.protobuf.SingleFieldBuilderV3< + private com.google.protobuf.SingleFieldBuilder< com.google.protobuf.Duration, com.google.protobuf.Duration.Builder, com.google.protobuf.DurationOrBuilder> - getUtcOffsetFieldBuilder() { + internalGetUtcOffsetFieldBuilder() { if (utcOffsetBuilder_ == null) { if (!(timeOffsetCase_ == 8)) { timeOffset_ = com.google.protobuf.Duration.getDefaultInstance(); } utcOffsetBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< + new com.google.protobuf.SingleFieldBuilder< com.google.protobuf.Duration, com.google.protobuf.Duration.Builder, com.google.protobuf.DurationOrBuilder>( @@ -1536,15 +1588,15 @@ public com.google.protobuf.DurationOrBuilder getUtcOffsetOrBuilder() { } timeOffsetCase_ = 8; onChanged(); - ; return utcOffsetBuilder_; } - private com.google.protobuf.SingleFieldBuilderV3< + private com.google.protobuf.SingleFieldBuilder< com.google.type.TimeZone, com.google.type.TimeZone.Builder, com.google.type.TimeZoneOrBuilder> timeZoneBuilder_; + /** * * @@ -1560,6 +1612,7 @@ public com.google.protobuf.DurationOrBuilder getUtcOffsetOrBuilder() { public boolean hasTimeZone() { return timeOffsetCase_ == 9; } + /** * * @@ -1585,6 +1638,7 @@ public com.google.type.TimeZone getTimeZone() { return com.google.type.TimeZone.getDefaultInstance(); } } + /** * * @@ -1607,6 +1661,7 @@ public Builder setTimeZone(com.google.type.TimeZone value) { timeOffsetCase_ = 9; return this; } + /** * * @@ -1626,6 +1681,7 @@ public Builder setTimeZone(com.google.type.TimeZone.Builder builderForValue) { timeOffsetCase_ = 9; return this; } + /** * * @@ -1656,6 +1712,7 @@ public Builder mergeTimeZone(com.google.type.TimeZone value) { timeOffsetCase_ = 9; return this; } + /** * * @@ -1681,6 +1738,7 @@ public Builder clearTimeZone() { } return this; } + /** * * @@ -1691,8 +1749,9 @@ public Builder clearTimeZone() { * .google.type.TimeZone time_zone = 9; */ public com.google.type.TimeZone.Builder getTimeZoneBuilder() { - return getTimeZoneFieldBuilder().getBuilder(); + return internalGetTimeZoneFieldBuilder().getBuilder(); } + /** * * @@ -1713,6 +1772,7 @@ public com.google.type.TimeZoneOrBuilder getTimeZoneOrBuilder() { return com.google.type.TimeZone.getDefaultInstance(); } } + /** * * @@ -1722,17 +1782,17 @@ public com.google.type.TimeZoneOrBuilder getTimeZoneOrBuilder() { * * .google.type.TimeZone time_zone = 9; */ - private com.google.protobuf.SingleFieldBuilderV3< + private com.google.protobuf.SingleFieldBuilder< com.google.type.TimeZone, com.google.type.TimeZone.Builder, com.google.type.TimeZoneOrBuilder> - getTimeZoneFieldBuilder() { + internalGetTimeZoneFieldBuilder() { if (timeZoneBuilder_ == null) { if (!(timeOffsetCase_ == 9)) { timeOffset_ = com.google.type.TimeZone.getDefaultInstance(); } timeZoneBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< + new com.google.protobuf.SingleFieldBuilder< com.google.type.TimeZone, com.google.type.TimeZone.Builder, com.google.type.TimeZoneOrBuilder>( @@ -1741,21 +1801,9 @@ public com.google.type.TimeZoneOrBuilder getTimeZoneOrBuilder() { } timeOffsetCase_ = 9; onChanged(); - ; return timeZoneBuilder_; } - @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.type.DateTime) } diff --git a/java-common-protos/proto-google-common-protos/src/main/java/com/google/type/DateTimeOrBuilder.java b/java-common-protos/proto-google-common-protos/src/main/java/com/google/type/DateTimeOrBuilder.java index fb8329d59c..8de4a99ea8 100644 --- a/java-common-protos/proto-google-common-protos/src/main/java/com/google/type/DateTimeOrBuilder.java +++ b/java-common-protos/proto-google-common-protos/src/main/java/com/google/type/DateTimeOrBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,10 +14,13 @@ * limitations under the License. */ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: google/type/datetime.proto +// Protobuf Java Version: 4.33.2 package com.google.type; +@com.google.protobuf.Generated public interface DateTimeOrBuilder extends // @@protoc_insertion_point(interface_extends:google.type.DateTime) @@ -134,6 +137,7 @@ public interface DateTimeOrBuilder * @return Whether the utcOffset field is set. */ boolean hasUtcOffset(); + /** * * @@ -148,6 +152,7 @@ public interface DateTimeOrBuilder * @return The utcOffset. */ com.google.protobuf.Duration getUtcOffset(); + /** * * @@ -173,6 +178,7 @@ public interface DateTimeOrBuilder * @return Whether the timeZone field is set. */ boolean hasTimeZone(); + /** * * @@ -185,6 +191,7 @@ public interface DateTimeOrBuilder * @return The timeZone. */ com.google.type.TimeZone getTimeZone(); + /** * * @@ -196,5 +203,5 @@ public interface DateTimeOrBuilder */ com.google.type.TimeZoneOrBuilder getTimeZoneOrBuilder(); - public com.google.type.DateTime.TimeOffsetCase getTimeOffsetCase(); + com.google.type.DateTime.TimeOffsetCase getTimeOffsetCase(); } diff --git a/java-common-protos/proto-google-common-protos/src/main/java/com/google/type/DateTimeProto.java b/java-common-protos/proto-google-common-protos/src/main/java/com/google/type/DateTimeProto.java index 403e98100c..098f3e4b96 100644 --- a/java-common-protos/proto-google-common-protos/src/main/java/com/google/type/DateTimeProto.java +++ b/java-common-protos/proto-google-common-protos/src/main/java/com/google/type/DateTimeProto.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,13 +14,26 @@ * limitations under the License. */ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: google/type/datetime.proto +// Protobuf Java Version: 4.33.2 package com.google.type; -public final class DateTimeProto { +@com.google.protobuf.Generated +public final class DateTimeProto extends com.google.protobuf.GeneratedFile { private DateTimeProto() {} + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "DateTimeProto"); + } + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistryLite registry) {} public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry registry) { @@ -29,11 +42,11 @@ public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry r static final com.google.protobuf.Descriptors.Descriptor internal_static_google_type_DateTime_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable internal_static_google_type_DateTime_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_google_type_TimeZone_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable internal_static_google_type_TimeZone_fieldAccessorTable; public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { @@ -44,17 +57,24 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { static { java.lang.String[] descriptorData = { - "\n\032google/type/datetime.proto\022\013google.typ" - + "e\032\036google/protobuf/duration.proto\"\340\001\n\010Da" - + "teTime\022\014\n\004year\030\001 \001(\005\022\r\n\005month\030\002 \001(\005\022\013\n\003d" - + "ay\030\003 \001(\005\022\r\n\005hours\030\004 \001(\005\022\017\n\007minutes\030\005 \001(\005" - + "\022\017\n\007seconds\030\006 \001(\005\022\r\n\005nanos\030\007 \001(\005\022/\n\nutc_" - + "offset\030\010 \001(\0132\031.google.protobuf.DurationH" - + "\000\022*\n\ttime_zone\030\t \001(\0132\025.google.type.TimeZ" - + "oneH\000B\r\n\013time_offset\"\'\n\010TimeZone\022\n\n\002id\030\001" - + " \001(\t\022\017\n\007version\030\002 \001(\tBi\n\017com.google.type" - + "B\rDateTimeProtoP\001ZDAY_OF_WEEK_UNSPECIFIED = 0; */ public static final int DAY_OF_WEEK_UNSPECIFIED_VALUE = 0; + /** * * @@ -131,6 +145,7 @@ public enum DayOfWeek implements com.google.protobuf.ProtocolMessageEnum { * MONDAY = 1; */ public static final int MONDAY_VALUE = 1; + /** * * @@ -141,6 +156,7 @@ public enum DayOfWeek implements com.google.protobuf.ProtocolMessageEnum { * TUESDAY = 2; */ public static final int TUESDAY_VALUE = 2; + /** * * @@ -151,6 +167,7 @@ public enum DayOfWeek implements com.google.protobuf.ProtocolMessageEnum { * WEDNESDAY = 3; */ public static final int WEDNESDAY_VALUE = 3; + /** * * @@ -161,6 +178,7 @@ public enum DayOfWeek implements com.google.protobuf.ProtocolMessageEnum { * THURSDAY = 4; */ public static final int THURSDAY_VALUE = 4; + /** * * @@ -171,6 +189,7 @@ public enum DayOfWeek implements com.google.protobuf.ProtocolMessageEnum { * FRIDAY = 5; */ public static final int FRIDAY_VALUE = 5; + /** * * @@ -181,6 +200,7 @@ public enum DayOfWeek implements com.google.protobuf.ProtocolMessageEnum { * SATURDAY = 6; */ public static final int SATURDAY_VALUE = 6; + /** * * @@ -260,7 +280,7 @@ public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType return getDescriptor(); } - public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + public static com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { return com.google.type.DayOfWeekProto.getDescriptor().getEnumTypes().get(0); } diff --git a/java-common-protos/proto-google-common-protos/src/main/java/com/google/type/DayOfWeekProto.java b/java-common-protos/proto-google-common-protos/src/main/java/com/google/type/DayOfWeekProto.java index 010e7d2801..77df37163f 100644 --- a/java-common-protos/proto-google-common-protos/src/main/java/com/google/type/DayOfWeekProto.java +++ b/java-common-protos/proto-google-common-protos/src/main/java/com/google/type/DayOfWeekProto.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,13 +14,26 @@ * limitations under the License. */ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: google/type/dayofweek.proto +// Protobuf Java Version: 4.33.2 package com.google.type; -public final class DayOfWeekProto { +@com.google.protobuf.Generated +public final class DayOfWeekProto extends com.google.protobuf.GeneratedFile { private DayOfWeekProto() {} + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "DayOfWeekProto"); + } + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistryLite registry) {} public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry registry) { @@ -47,6 +60,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { descriptor = com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( descriptorData, new com.google.protobuf.Descriptors.FileDescriptor[] {}); + descriptor.resolveAllFeaturesImmutable(); } // @@protoc_insertion_point(outer_class_scope) diff --git a/java-common-protos/proto-google-common-protos/src/main/java/com/google/type/Decimal.java b/java-common-protos/proto-google-common-protos/src/main/java/com/google/type/Decimal.java index ecbc56d259..7e2cbef93a 100644 --- a/java-common-protos/proto-google-common-protos/src/main/java/com/google/type/Decimal.java +++ b/java-common-protos/proto-google-common-protos/src/main/java/com/google/type/Decimal.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,9 @@ * limitations under the License. */ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: google/type/decimal.proto +// Protobuf Java Version: 4.33.2 package com.google.type; @@ -25,6 +27,7 @@ * A representation of a decimal value, such as 2.5. Clients may convert values * into language-native decimal formats, such as Java's [BigDecimal][] or * Python's [decimal.Decimal][]. + * * [BigDecimal]: * https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/math/BigDecimal.html * [decimal.Decimal]: https://docs.python.org/3/library/decimal.html @@ -32,13 +35,25 @@ * * Protobuf type {@code google.type.Decimal} */ -public final class Decimal extends com.google.protobuf.GeneratedMessageV3 +@com.google.protobuf.Generated +public final class Decimal extends com.google.protobuf.GeneratedMessage implements // @@protoc_insertion_point(message_implements:google.type.Decimal) DecimalOrBuilder { private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "Decimal"); + } + // Use Decimal.newBuilder() to construct. - private Decimal(com.google.protobuf.GeneratedMessageV3.Builder builder) { + private Decimal(com.google.protobuf.GeneratedMessage.Builder builder) { super(builder); } @@ -46,23 +61,12 @@ private Decimal() { value_ = ""; } - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new Decimal(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.type.DecimalProto.internal_static_google_type_Decimal_descriptor; } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.type.DecimalProto.internal_static_google_type_Decimal_fieldAccessorTable .ensureFieldAccessorsInitialized( @@ -70,53 +74,72 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } public static final int VALUE_FIELD_NUMBER = 1; - private volatile java.lang.Object value_; + + @SuppressWarnings("serial") + private volatile java.lang.Object value_ = ""; + /** * * *
            * The decimal value, as a string.
        +   *
            * The string representation consists of an optional sign, `+` (`U+002B`)
            * or `-` (`U+002D`), followed by a sequence of zero or more decimal digits
            * ("the integer"), optionally followed by a fraction, optionally followed
            * by an exponent.
        +   *
            * The fraction consists of a decimal point followed by zero or more decimal
            * digits. The string must contain at least one digit in either the integer
            * or the fraction. The number formed by the sign, the integer and the
            * fraction is referred to as the significand.
        +   *
            * The exponent consists of the character `e` (`U+0065`) or `E` (`U+0045`)
            * followed by one or more decimal digits.
        +   *
            * Services **should** normalize decimal values before storing them by:
        -   *   - Removing an explicitly-provided `+` sign (`+2.5` -> `2.5`).
        -   *   - Replacing a zero-length integer value with `0` (`.5` -> `0.5`).
        -   *   - Coercing the exponent character to lower-case (`2.5E8` -> `2.5e8`).
        -   *   - Removing an explicitly-provided zero exponent (`2.5e0` -> `2.5`).
        +   *
        +   * - Removing an explicitly-provided `+` sign (`+2.5` -> `2.5`).
        +   * - Replacing a zero-length integer value with `0` (`.5` -> `0.5`).
        +   * - Coercing the exponent character to lower-case (`2.5E8` -> `2.5e8`).
        +   * - Removing an explicitly-provided zero exponent (`2.5e0` -> `2.5`).
        +   *
            * Services **may** perform additional normalization based on its own needs
            * and the internal decimal implementation selected, such as shifting the
            * decimal point and exponent value together (example: `2.5e-1` <-> `0.25`).
            * Additionally, services **may** preserve trailing zeroes in the fraction
            * to indicate increased precision, but are not required to do so.
        +   *
            * Note that only the `.` character is supported to divide the integer
            * and the fraction; `,` **should not** be supported regardless of locale.
            * Additionally, thousand separators **should not** be supported. If a
            * service does support them, values **must** be normalized.
        +   *
            * The ENBF grammar is:
        -   *     DecimalString =
        -   *       [Sign] Significand [Exponent];
        -   *     Sign = '+' | '-';
        -   *     Significand =
        -   *       Digits ['.'] [Digits] | [Digits] '.' Digits;
        -   *     Exponent = ('e' | 'E') [Sign] Digits;
        -   *     Digits = { '0' | '1' | '2' | '3' | '4' | '5' | '6' | '7' | '8' | '9' };
        +   *
        +   * DecimalString =
        +   * [Sign] Significand [Exponent];
        +   *
        +   * Sign = '+' | '-';
        +   *
        +   * Significand =
        +   * Digits ['.'] [Digits] | [Digits] '.' Digits;
        +   *
        +   * Exponent = ('e' | 'E') [Sign] Digits;
        +   *
        +   * Digits = { '0' | '1' | '2' | '3' | '4' | '5' | '6' | '7' | '8' | '9' };
        +   *
            * Services **should** clearly document the range of supported values, the
            * maximum supported precision (total number of digits), and, if applicable,
            * the scale (number of digits after the decimal point), as well as how it
            * behaves when receiving out-of-bounds values.
        +   *
            * Services **may** choose to accept values passed as input even when the
            * value has a higher precision or scale than the service supports, and
            * **should** round the value to fit the supported scale. Alternatively, the
            * service **may** error with `400 Bad Request` (`INVALID_ARGUMENT` in gRPC)
            * if precision would be lost.
        +   *
            * Services **should** error with `400 Bad Request` (`INVALID_ARGUMENT` in
            * gRPC) if the service receives a value outside of the supported range.
            * 
        @@ -137,52 +160,69 @@ public java.lang.String getValue() { return s; } } + /** * * *
            * The decimal value, as a string.
        +   *
            * The string representation consists of an optional sign, `+` (`U+002B`)
            * or `-` (`U+002D`), followed by a sequence of zero or more decimal digits
            * ("the integer"), optionally followed by a fraction, optionally followed
            * by an exponent.
        +   *
            * The fraction consists of a decimal point followed by zero or more decimal
            * digits. The string must contain at least one digit in either the integer
            * or the fraction. The number formed by the sign, the integer and the
            * fraction is referred to as the significand.
        +   *
            * The exponent consists of the character `e` (`U+0065`) or `E` (`U+0045`)
            * followed by one or more decimal digits.
        +   *
            * Services **should** normalize decimal values before storing them by:
        -   *   - Removing an explicitly-provided `+` sign (`+2.5` -> `2.5`).
        -   *   - Replacing a zero-length integer value with `0` (`.5` -> `0.5`).
        -   *   - Coercing the exponent character to lower-case (`2.5E8` -> `2.5e8`).
        -   *   - Removing an explicitly-provided zero exponent (`2.5e0` -> `2.5`).
        +   *
        +   * - Removing an explicitly-provided `+` sign (`+2.5` -> `2.5`).
        +   * - Replacing a zero-length integer value with `0` (`.5` -> `0.5`).
        +   * - Coercing the exponent character to lower-case (`2.5E8` -> `2.5e8`).
        +   * - Removing an explicitly-provided zero exponent (`2.5e0` -> `2.5`).
        +   *
            * Services **may** perform additional normalization based on its own needs
            * and the internal decimal implementation selected, such as shifting the
            * decimal point and exponent value together (example: `2.5e-1` <-> `0.25`).
            * Additionally, services **may** preserve trailing zeroes in the fraction
            * to indicate increased precision, but are not required to do so.
        +   *
            * Note that only the `.` character is supported to divide the integer
            * and the fraction; `,` **should not** be supported regardless of locale.
            * Additionally, thousand separators **should not** be supported. If a
            * service does support them, values **must** be normalized.
        +   *
            * The ENBF grammar is:
        -   *     DecimalString =
        -   *       [Sign] Significand [Exponent];
        -   *     Sign = '+' | '-';
        -   *     Significand =
        -   *       Digits ['.'] [Digits] | [Digits] '.' Digits;
        -   *     Exponent = ('e' | 'E') [Sign] Digits;
        -   *     Digits = { '0' | '1' | '2' | '3' | '4' | '5' | '6' | '7' | '8' | '9' };
        +   *
        +   * DecimalString =
        +   * [Sign] Significand [Exponent];
        +   *
        +   * Sign = '+' | '-';
        +   *
        +   * Significand =
        +   * Digits ['.'] [Digits] | [Digits] '.' Digits;
        +   *
        +   * Exponent = ('e' | 'E') [Sign] Digits;
        +   *
        +   * Digits = { '0' | '1' | '2' | '3' | '4' | '5' | '6' | '7' | '8' | '9' };
        +   *
            * Services **should** clearly document the range of supported values, the
            * maximum supported precision (total number of digits), and, if applicable,
            * the scale (number of digits after the decimal point), as well as how it
            * behaves when receiving out-of-bounds values.
        +   *
            * Services **may** choose to accept values passed as input even when the
            * value has a higher precision or scale than the service supports, and
            * **should** round the value to fit the supported scale. Alternatively, the
            * service **may** error with `400 Bad Request` (`INVALID_ARGUMENT` in gRPC)
            * if precision would be lost.
        +   *
            * Services **should** error with `400 Bad Request` (`INVALID_ARGUMENT` in
            * gRPC) if the service receives a value outside of the supported range.
            * 
        @@ -218,8 +258,8 @@ public final boolean isInitialized() { @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(value_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, value_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(value_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, value_); } getUnknownFields().writeTo(output); } @@ -230,8 +270,8 @@ public int getSerializedSize() { if (size != -1) return size; size = 0; - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(value_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, value_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(value_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, value_); } size += getUnknownFields().getSerializedSize(); memoizedSize = size; @@ -303,38 +343,38 @@ public static com.google.type.Decimal parseFrom( public static com.google.type.Decimal parseFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); } public static com.google.type.Decimal parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } public static com.google.type.Decimal parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); } public static com.google.type.Decimal parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( PARSER, input, extensionRegistry); } public static com.google.type.Decimal parseFrom(com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); } public static com.google.type.Decimal parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } @@ -357,10 +397,11 @@ public Builder toBuilder() { } @java.lang.Override - protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { Builder builder = new Builder(parent); return builder; } + /** * * @@ -368,6 +409,7 @@ protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.Build * A representation of a decimal value, such as 2.5. Clients may convert values * into language-native decimal formats, such as Java's [BigDecimal][] or * Python's [decimal.Decimal][]. + * * [BigDecimal]: * https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/math/BigDecimal.html * [decimal.Decimal]: https://docs.python.org/3/library/decimal.html @@ -375,7 +417,7 @@ protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.Build * * Protobuf type {@code google.type.Decimal} */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder implements // @@protoc_insertion_point(builder_implements:google.type.Decimal) com.google.type.DecimalOrBuilder { @@ -384,7 +426,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.type.DecimalProto.internal_static_google_type_Decimal_fieldAccessorTable .ensureFieldAccessorsInitialized( @@ -394,15 +436,15 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { // Construct using com.google.type.Decimal.newBuilder() private Builder() {} - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { super(parent); } @java.lang.Override public Builder clear() { super.clear(); + bitField0_ = 0; value_ = ""; - return this; } @@ -428,42 +470,18 @@ public com.google.type.Decimal build() { @java.lang.Override public com.google.type.Decimal buildPartial() { com.google.type.Decimal result = new com.google.type.Decimal(this); - result.value_ = value_; + if (bitField0_ != 0) { + buildPartial0(result); + } 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); + private void buildPartial0(com.google.type.Decimal result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.value_ = value_; + } } @java.lang.Override @@ -480,6 +498,7 @@ public Builder mergeFrom(com.google.type.Decimal other) { if (other == com.google.type.Decimal.getDefaultInstance()) return this; if (!other.getValue().isEmpty()) { value_ = other.value_; + bitField0_ |= 0x00000001; onChanged(); } this.mergeUnknownFields(other.getUnknownFields()); @@ -511,7 +530,7 @@ public Builder mergeFrom( case 10: { value_ = input.readStringRequireUtf8(); - + bitField0_ |= 0x00000001; break; } // case 10 default: @@ -531,53 +550,72 @@ public Builder mergeFrom( return this; } + private int bitField0_; + private java.lang.Object value_ = ""; + /** * * *
              * The decimal value, as a string.
        +     *
              * The string representation consists of an optional sign, `+` (`U+002B`)
              * or `-` (`U+002D`), followed by a sequence of zero or more decimal digits
              * ("the integer"), optionally followed by a fraction, optionally followed
              * by an exponent.
        +     *
              * The fraction consists of a decimal point followed by zero or more decimal
              * digits. The string must contain at least one digit in either the integer
              * or the fraction. The number formed by the sign, the integer and the
              * fraction is referred to as the significand.
        +     *
              * The exponent consists of the character `e` (`U+0065`) or `E` (`U+0045`)
              * followed by one or more decimal digits.
        +     *
              * Services **should** normalize decimal values before storing them by:
        -     *   - Removing an explicitly-provided `+` sign (`+2.5` -> `2.5`).
        -     *   - Replacing a zero-length integer value with `0` (`.5` -> `0.5`).
        -     *   - Coercing the exponent character to lower-case (`2.5E8` -> `2.5e8`).
        -     *   - Removing an explicitly-provided zero exponent (`2.5e0` -> `2.5`).
        +     *
        +     * - Removing an explicitly-provided `+` sign (`+2.5` -> `2.5`).
        +     * - Replacing a zero-length integer value with `0` (`.5` -> `0.5`).
        +     * - Coercing the exponent character to lower-case (`2.5E8` -> `2.5e8`).
        +     * - Removing an explicitly-provided zero exponent (`2.5e0` -> `2.5`).
        +     *
              * Services **may** perform additional normalization based on its own needs
              * and the internal decimal implementation selected, such as shifting the
              * decimal point and exponent value together (example: `2.5e-1` <-> `0.25`).
              * Additionally, services **may** preserve trailing zeroes in the fraction
              * to indicate increased precision, but are not required to do so.
        +     *
              * Note that only the `.` character is supported to divide the integer
              * and the fraction; `,` **should not** be supported regardless of locale.
              * Additionally, thousand separators **should not** be supported. If a
              * service does support them, values **must** be normalized.
        +     *
              * The ENBF grammar is:
        -     *     DecimalString =
        -     *       [Sign] Significand [Exponent];
        -     *     Sign = '+' | '-';
        -     *     Significand =
        -     *       Digits ['.'] [Digits] | [Digits] '.' Digits;
        -     *     Exponent = ('e' | 'E') [Sign] Digits;
        -     *     Digits = { '0' | '1' | '2' | '3' | '4' | '5' | '6' | '7' | '8' | '9' };
        +     *
        +     * DecimalString =
        +     * [Sign] Significand [Exponent];
        +     *
        +     * Sign = '+' | '-';
        +     *
        +     * Significand =
        +     * Digits ['.'] [Digits] | [Digits] '.' Digits;
        +     *
        +     * Exponent = ('e' | 'E') [Sign] Digits;
        +     *
        +     * Digits = { '0' | '1' | '2' | '3' | '4' | '5' | '6' | '7' | '8' | '9' };
        +     *
              * Services **should** clearly document the range of supported values, the
              * maximum supported precision (total number of digits), and, if applicable,
              * the scale (number of digits after the decimal point), as well as how it
              * behaves when receiving out-of-bounds values.
        +     *
              * Services **may** choose to accept values passed as input even when the
              * value has a higher precision or scale than the service supports, and
              * **should** round the value to fit the supported scale. Alternatively, the
              * service **may** error with `400 Bad Request` (`INVALID_ARGUMENT` in gRPC)
              * if precision would be lost.
        +     *
              * Services **should** error with `400 Bad Request` (`INVALID_ARGUMENT` in
              * gRPC) if the service receives a value outside of the supported range.
              * 
        @@ -597,52 +635,69 @@ public java.lang.String getValue() { return (java.lang.String) ref; } } + /** * * *
              * The decimal value, as a string.
        +     *
              * The string representation consists of an optional sign, `+` (`U+002B`)
              * or `-` (`U+002D`), followed by a sequence of zero or more decimal digits
              * ("the integer"), optionally followed by a fraction, optionally followed
              * by an exponent.
        +     *
              * The fraction consists of a decimal point followed by zero or more decimal
              * digits. The string must contain at least one digit in either the integer
              * or the fraction. The number formed by the sign, the integer and the
              * fraction is referred to as the significand.
        +     *
              * The exponent consists of the character `e` (`U+0065`) or `E` (`U+0045`)
              * followed by one or more decimal digits.
        +     *
              * Services **should** normalize decimal values before storing them by:
        -     *   - Removing an explicitly-provided `+` sign (`+2.5` -> `2.5`).
        -     *   - Replacing a zero-length integer value with `0` (`.5` -> `0.5`).
        -     *   - Coercing the exponent character to lower-case (`2.5E8` -> `2.5e8`).
        -     *   - Removing an explicitly-provided zero exponent (`2.5e0` -> `2.5`).
        +     *
        +     * - Removing an explicitly-provided `+` sign (`+2.5` -> `2.5`).
        +     * - Replacing a zero-length integer value with `0` (`.5` -> `0.5`).
        +     * - Coercing the exponent character to lower-case (`2.5E8` -> `2.5e8`).
        +     * - Removing an explicitly-provided zero exponent (`2.5e0` -> `2.5`).
        +     *
              * Services **may** perform additional normalization based on its own needs
              * and the internal decimal implementation selected, such as shifting the
              * decimal point and exponent value together (example: `2.5e-1` <-> `0.25`).
              * Additionally, services **may** preserve trailing zeroes in the fraction
              * to indicate increased precision, but are not required to do so.
        +     *
              * Note that only the `.` character is supported to divide the integer
              * and the fraction; `,` **should not** be supported regardless of locale.
              * Additionally, thousand separators **should not** be supported. If a
              * service does support them, values **must** be normalized.
        +     *
              * The ENBF grammar is:
        -     *     DecimalString =
        -     *       [Sign] Significand [Exponent];
        -     *     Sign = '+' | '-';
        -     *     Significand =
        -     *       Digits ['.'] [Digits] | [Digits] '.' Digits;
        -     *     Exponent = ('e' | 'E') [Sign] Digits;
        -     *     Digits = { '0' | '1' | '2' | '3' | '4' | '5' | '6' | '7' | '8' | '9' };
        +     *
        +     * DecimalString =
        +     * [Sign] Significand [Exponent];
        +     *
        +     * Sign = '+' | '-';
        +     *
        +     * Significand =
        +     * Digits ['.'] [Digits] | [Digits] '.' Digits;
        +     *
        +     * Exponent = ('e' | 'E') [Sign] Digits;
        +     *
        +     * Digits = { '0' | '1' | '2' | '3' | '4' | '5' | '6' | '7' | '8' | '9' };
        +     *
              * Services **should** clearly document the range of supported values, the
              * maximum supported precision (total number of digits), and, if applicable,
              * the scale (number of digits after the decimal point), as well as how it
              * behaves when receiving out-of-bounds values.
        +     *
              * Services **may** choose to accept values passed as input even when the
              * value has a higher precision or scale than the service supports, and
              * **should** round the value to fit the supported scale. Alternatively, the
              * service **may** error with `400 Bad Request` (`INVALID_ARGUMENT` in gRPC)
              * if precision would be lost.
        +     *
              * Services **should** error with `400 Bad Request` (`INVALID_ARGUMENT` in
              * gRPC) if the service receives a value outside of the supported range.
              * 
        @@ -662,52 +717,69 @@ public com.google.protobuf.ByteString getValueBytes() { return (com.google.protobuf.ByteString) ref; } } + /** * * *
              * The decimal value, as a string.
        +     *
              * The string representation consists of an optional sign, `+` (`U+002B`)
              * or `-` (`U+002D`), followed by a sequence of zero or more decimal digits
              * ("the integer"), optionally followed by a fraction, optionally followed
              * by an exponent.
        +     *
              * The fraction consists of a decimal point followed by zero or more decimal
              * digits. The string must contain at least one digit in either the integer
              * or the fraction. The number formed by the sign, the integer and the
              * fraction is referred to as the significand.
        +     *
              * The exponent consists of the character `e` (`U+0065`) or `E` (`U+0045`)
              * followed by one or more decimal digits.
        +     *
              * Services **should** normalize decimal values before storing them by:
        -     *   - Removing an explicitly-provided `+` sign (`+2.5` -> `2.5`).
        -     *   - Replacing a zero-length integer value with `0` (`.5` -> `0.5`).
        -     *   - Coercing the exponent character to lower-case (`2.5E8` -> `2.5e8`).
        -     *   - Removing an explicitly-provided zero exponent (`2.5e0` -> `2.5`).
        +     *
        +     * - Removing an explicitly-provided `+` sign (`+2.5` -> `2.5`).
        +     * - Replacing a zero-length integer value with `0` (`.5` -> `0.5`).
        +     * - Coercing the exponent character to lower-case (`2.5E8` -> `2.5e8`).
        +     * - Removing an explicitly-provided zero exponent (`2.5e0` -> `2.5`).
        +     *
              * Services **may** perform additional normalization based on its own needs
              * and the internal decimal implementation selected, such as shifting the
              * decimal point and exponent value together (example: `2.5e-1` <-> `0.25`).
              * Additionally, services **may** preserve trailing zeroes in the fraction
              * to indicate increased precision, but are not required to do so.
        +     *
              * Note that only the `.` character is supported to divide the integer
              * and the fraction; `,` **should not** be supported regardless of locale.
              * Additionally, thousand separators **should not** be supported. If a
              * service does support them, values **must** be normalized.
        +     *
              * The ENBF grammar is:
        -     *     DecimalString =
        -     *       [Sign] Significand [Exponent];
        -     *     Sign = '+' | '-';
        -     *     Significand =
        -     *       Digits ['.'] [Digits] | [Digits] '.' Digits;
        -     *     Exponent = ('e' | 'E') [Sign] Digits;
        -     *     Digits = { '0' | '1' | '2' | '3' | '4' | '5' | '6' | '7' | '8' | '9' };
        +     *
        +     * DecimalString =
        +     * [Sign] Significand [Exponent];
        +     *
        +     * Sign = '+' | '-';
        +     *
        +     * Significand =
        +     * Digits ['.'] [Digits] | [Digits] '.' Digits;
        +     *
        +     * Exponent = ('e' | 'E') [Sign] Digits;
        +     *
        +     * Digits = { '0' | '1' | '2' | '3' | '4' | '5' | '6' | '7' | '8' | '9' };
        +     *
              * Services **should** clearly document the range of supported values, the
              * maximum supported precision (total number of digits), and, if applicable,
              * the scale (number of digits after the decimal point), as well as how it
              * behaves when receiving out-of-bounds values.
        +     *
              * Services **may** choose to accept values passed as input even when the
              * value has a higher precision or scale than the service supports, and
              * **should** round the value to fit the supported scale. Alternatively, the
              * service **may** error with `400 Bad Request` (`INVALID_ARGUMENT` in gRPC)
              * if precision would be lost.
        +     *
              * Services **should** error with `400 Bad Request` (`INVALID_ARGUMENT` in
              * gRPC) if the service receives a value outside of the supported range.
              * 
        @@ -721,57 +793,74 @@ public Builder setValue(java.lang.String value) { if (value == null) { throw new NullPointerException(); } - value_ = value; + bitField0_ |= 0x00000001; onChanged(); return this; } + /** * * *
              * The decimal value, as a string.
        +     *
              * The string representation consists of an optional sign, `+` (`U+002B`)
              * or `-` (`U+002D`), followed by a sequence of zero or more decimal digits
              * ("the integer"), optionally followed by a fraction, optionally followed
              * by an exponent.
        +     *
              * The fraction consists of a decimal point followed by zero or more decimal
              * digits. The string must contain at least one digit in either the integer
              * or the fraction. The number formed by the sign, the integer and the
              * fraction is referred to as the significand.
        +     *
              * The exponent consists of the character `e` (`U+0065`) or `E` (`U+0045`)
              * followed by one or more decimal digits.
        +     *
              * Services **should** normalize decimal values before storing them by:
        -     *   - Removing an explicitly-provided `+` sign (`+2.5` -> `2.5`).
        -     *   - Replacing a zero-length integer value with `0` (`.5` -> `0.5`).
        -     *   - Coercing the exponent character to lower-case (`2.5E8` -> `2.5e8`).
        -     *   - Removing an explicitly-provided zero exponent (`2.5e0` -> `2.5`).
        +     *
        +     * - Removing an explicitly-provided `+` sign (`+2.5` -> `2.5`).
        +     * - Replacing a zero-length integer value with `0` (`.5` -> `0.5`).
        +     * - Coercing the exponent character to lower-case (`2.5E8` -> `2.5e8`).
        +     * - Removing an explicitly-provided zero exponent (`2.5e0` -> `2.5`).
        +     *
              * Services **may** perform additional normalization based on its own needs
              * and the internal decimal implementation selected, such as shifting the
              * decimal point and exponent value together (example: `2.5e-1` <-> `0.25`).
              * Additionally, services **may** preserve trailing zeroes in the fraction
              * to indicate increased precision, but are not required to do so.
        +     *
              * Note that only the `.` character is supported to divide the integer
              * and the fraction; `,` **should not** be supported regardless of locale.
              * Additionally, thousand separators **should not** be supported. If a
              * service does support them, values **must** be normalized.
        +     *
              * The ENBF grammar is:
        -     *     DecimalString =
        -     *       [Sign] Significand [Exponent];
        -     *     Sign = '+' | '-';
        -     *     Significand =
        -     *       Digits ['.'] [Digits] | [Digits] '.' Digits;
        -     *     Exponent = ('e' | 'E') [Sign] Digits;
        -     *     Digits = { '0' | '1' | '2' | '3' | '4' | '5' | '6' | '7' | '8' | '9' };
        +     *
        +     * DecimalString =
        +     * [Sign] Significand [Exponent];
        +     *
        +     * Sign = '+' | '-';
        +     *
        +     * Significand =
        +     * Digits ['.'] [Digits] | [Digits] '.' Digits;
        +     *
        +     * Exponent = ('e' | 'E') [Sign] Digits;
        +     *
        +     * Digits = { '0' | '1' | '2' | '3' | '4' | '5' | '6' | '7' | '8' | '9' };
        +     *
              * Services **should** clearly document the range of supported values, the
              * maximum supported precision (total number of digits), and, if applicable,
              * the scale (number of digits after the decimal point), as well as how it
              * behaves when receiving out-of-bounds values.
        +     *
              * Services **may** choose to accept values passed as input even when the
              * value has a higher precision or scale than the service supports, and
              * **should** round the value to fit the supported scale. Alternatively, the
              * service **may** error with `400 Bad Request` (`INVALID_ARGUMENT` in gRPC)
              * if precision would be lost.
        +     *
              * Services **should** error with `400 Bad Request` (`INVALID_ARGUMENT` in
              * gRPC) if the service receives a value outside of the supported range.
              * 
        @@ -781,57 +870,74 @@ public Builder setValue(java.lang.String value) { * @return This builder for chaining. */ public Builder clearValue() { - value_ = getDefaultInstance().getValue(); + bitField0_ = (bitField0_ & ~0x00000001); onChanged(); return this; } + /** * * *
              * The decimal value, as a string.
        +     *
              * The string representation consists of an optional sign, `+` (`U+002B`)
              * or `-` (`U+002D`), followed by a sequence of zero or more decimal digits
              * ("the integer"), optionally followed by a fraction, optionally followed
              * by an exponent.
        +     *
              * The fraction consists of a decimal point followed by zero or more decimal
              * digits. The string must contain at least one digit in either the integer
              * or the fraction. The number formed by the sign, the integer and the
              * fraction is referred to as the significand.
        +     *
              * The exponent consists of the character `e` (`U+0065`) or `E` (`U+0045`)
              * followed by one or more decimal digits.
        +     *
              * Services **should** normalize decimal values before storing them by:
        -     *   - Removing an explicitly-provided `+` sign (`+2.5` -> `2.5`).
        -     *   - Replacing a zero-length integer value with `0` (`.5` -> `0.5`).
        -     *   - Coercing the exponent character to lower-case (`2.5E8` -> `2.5e8`).
        -     *   - Removing an explicitly-provided zero exponent (`2.5e0` -> `2.5`).
        +     *
        +     * - Removing an explicitly-provided `+` sign (`+2.5` -> `2.5`).
        +     * - Replacing a zero-length integer value with `0` (`.5` -> `0.5`).
        +     * - Coercing the exponent character to lower-case (`2.5E8` -> `2.5e8`).
        +     * - Removing an explicitly-provided zero exponent (`2.5e0` -> `2.5`).
        +     *
              * Services **may** perform additional normalization based on its own needs
              * and the internal decimal implementation selected, such as shifting the
              * decimal point and exponent value together (example: `2.5e-1` <-> `0.25`).
              * Additionally, services **may** preserve trailing zeroes in the fraction
              * to indicate increased precision, but are not required to do so.
        +     *
              * Note that only the `.` character is supported to divide the integer
              * and the fraction; `,` **should not** be supported regardless of locale.
              * Additionally, thousand separators **should not** be supported. If a
              * service does support them, values **must** be normalized.
        +     *
              * The ENBF grammar is:
        -     *     DecimalString =
        -     *       [Sign] Significand [Exponent];
        -     *     Sign = '+' | '-';
        -     *     Significand =
        -     *       Digits ['.'] [Digits] | [Digits] '.' Digits;
        -     *     Exponent = ('e' | 'E') [Sign] Digits;
        -     *     Digits = { '0' | '1' | '2' | '3' | '4' | '5' | '6' | '7' | '8' | '9' };
        +     *
        +     * DecimalString =
        +     * [Sign] Significand [Exponent];
        +     *
        +     * Sign = '+' | '-';
        +     *
        +     * Significand =
        +     * Digits ['.'] [Digits] | [Digits] '.' Digits;
        +     *
        +     * Exponent = ('e' | 'E') [Sign] Digits;
        +     *
        +     * Digits = { '0' | '1' | '2' | '3' | '4' | '5' | '6' | '7' | '8' | '9' };
        +     *
              * Services **should** clearly document the range of supported values, the
              * maximum supported precision (total number of digits), and, if applicable,
              * the scale (number of digits after the decimal point), as well as how it
              * behaves when receiving out-of-bounds values.
        +     *
              * Services **may** choose to accept values passed as input even when the
              * value has a higher precision or scale than the service supports, and
              * **should** round the value to fit the supported scale. Alternatively, the
              * service **may** error with `400 Bad Request` (`INVALID_ARGUMENT` in gRPC)
              * if precision would be lost.
        +     *
              * Services **should** error with `400 Bad Request` (`INVALID_ARGUMENT` in
              * gRPC) if the service receives a value outside of the supported range.
              * 
        @@ -846,23 +952,12 @@ public Builder setValueBytes(com.google.protobuf.ByteString value) { throw new NullPointerException(); } checkByteStringIsUtf8(value); - value_ = 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.type.Decimal) } diff --git a/java-common-protos/proto-google-common-protos/src/main/java/com/google/type/DecimalOrBuilder.java b/java-common-protos/proto-google-common-protos/src/main/java/com/google/type/DecimalOrBuilder.java index 15e152ccc9..d3645b66e5 100644 --- a/java-common-protos/proto-google-common-protos/src/main/java/com/google/type/DecimalOrBuilder.java +++ b/java-common-protos/proto-google-common-protos/src/main/java/com/google/type/DecimalOrBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,10 +14,13 @@ * limitations under the License. */ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: google/type/decimal.proto +// Protobuf Java Version: 4.33.2 package com.google.type; +@com.google.protobuf.Generated public interface DecimalOrBuilder extends // @@protoc_insertion_point(interface_extends:google.type.Decimal) @@ -28,47 +31,63 @@ public interface DecimalOrBuilder * *
            * The decimal value, as a string.
        +   *
            * The string representation consists of an optional sign, `+` (`U+002B`)
            * or `-` (`U+002D`), followed by a sequence of zero or more decimal digits
            * ("the integer"), optionally followed by a fraction, optionally followed
            * by an exponent.
        +   *
            * The fraction consists of a decimal point followed by zero or more decimal
            * digits. The string must contain at least one digit in either the integer
            * or the fraction. The number formed by the sign, the integer and the
            * fraction is referred to as the significand.
        +   *
            * The exponent consists of the character `e` (`U+0065`) or `E` (`U+0045`)
            * followed by one or more decimal digits.
        +   *
            * Services **should** normalize decimal values before storing them by:
        -   *   - Removing an explicitly-provided `+` sign (`+2.5` -> `2.5`).
        -   *   - Replacing a zero-length integer value with `0` (`.5` -> `0.5`).
        -   *   - Coercing the exponent character to lower-case (`2.5E8` -> `2.5e8`).
        -   *   - Removing an explicitly-provided zero exponent (`2.5e0` -> `2.5`).
        +   *
        +   * - Removing an explicitly-provided `+` sign (`+2.5` -> `2.5`).
        +   * - Replacing a zero-length integer value with `0` (`.5` -> `0.5`).
        +   * - Coercing the exponent character to lower-case (`2.5E8` -> `2.5e8`).
        +   * - Removing an explicitly-provided zero exponent (`2.5e0` -> `2.5`).
        +   *
            * Services **may** perform additional normalization based on its own needs
            * and the internal decimal implementation selected, such as shifting the
            * decimal point and exponent value together (example: `2.5e-1` <-> `0.25`).
            * Additionally, services **may** preserve trailing zeroes in the fraction
            * to indicate increased precision, but are not required to do so.
        +   *
            * Note that only the `.` character is supported to divide the integer
            * and the fraction; `,` **should not** be supported regardless of locale.
            * Additionally, thousand separators **should not** be supported. If a
            * service does support them, values **must** be normalized.
        +   *
            * The ENBF grammar is:
        -   *     DecimalString =
        -   *       [Sign] Significand [Exponent];
        -   *     Sign = '+' | '-';
        -   *     Significand =
        -   *       Digits ['.'] [Digits] | [Digits] '.' Digits;
        -   *     Exponent = ('e' | 'E') [Sign] Digits;
        -   *     Digits = { '0' | '1' | '2' | '3' | '4' | '5' | '6' | '7' | '8' | '9' };
        +   *
        +   * DecimalString =
        +   * [Sign] Significand [Exponent];
        +   *
        +   * Sign = '+' | '-';
        +   *
        +   * Significand =
        +   * Digits ['.'] [Digits] | [Digits] '.' Digits;
        +   *
        +   * Exponent = ('e' | 'E') [Sign] Digits;
        +   *
        +   * Digits = { '0' | '1' | '2' | '3' | '4' | '5' | '6' | '7' | '8' | '9' };
        +   *
            * Services **should** clearly document the range of supported values, the
            * maximum supported precision (total number of digits), and, if applicable,
            * the scale (number of digits after the decimal point), as well as how it
            * behaves when receiving out-of-bounds values.
        +   *
            * Services **may** choose to accept values passed as input even when the
            * value has a higher precision or scale than the service supports, and
            * **should** round the value to fit the supported scale. Alternatively, the
            * service **may** error with `400 Bad Request` (`INVALID_ARGUMENT` in gRPC)
            * if precision would be lost.
        +   *
            * Services **should** error with `400 Bad Request` (`INVALID_ARGUMENT` in
            * gRPC) if the service receives a value outside of the supported range.
            * 
        @@ -78,52 +97,69 @@ public interface DecimalOrBuilder * @return The value. */ java.lang.String getValue(); + /** * * *
            * The decimal value, as a string.
        +   *
            * The string representation consists of an optional sign, `+` (`U+002B`)
            * or `-` (`U+002D`), followed by a sequence of zero or more decimal digits
            * ("the integer"), optionally followed by a fraction, optionally followed
            * by an exponent.
        +   *
            * The fraction consists of a decimal point followed by zero or more decimal
            * digits. The string must contain at least one digit in either the integer
            * or the fraction. The number formed by the sign, the integer and the
            * fraction is referred to as the significand.
        +   *
            * The exponent consists of the character `e` (`U+0065`) or `E` (`U+0045`)
            * followed by one or more decimal digits.
        +   *
            * Services **should** normalize decimal values before storing them by:
        -   *   - Removing an explicitly-provided `+` sign (`+2.5` -> `2.5`).
        -   *   - Replacing a zero-length integer value with `0` (`.5` -> `0.5`).
        -   *   - Coercing the exponent character to lower-case (`2.5E8` -> `2.5e8`).
        -   *   - Removing an explicitly-provided zero exponent (`2.5e0` -> `2.5`).
        +   *
        +   * - Removing an explicitly-provided `+` sign (`+2.5` -> `2.5`).
        +   * - Replacing a zero-length integer value with `0` (`.5` -> `0.5`).
        +   * - Coercing the exponent character to lower-case (`2.5E8` -> `2.5e8`).
        +   * - Removing an explicitly-provided zero exponent (`2.5e0` -> `2.5`).
        +   *
            * Services **may** perform additional normalization based on its own needs
            * and the internal decimal implementation selected, such as shifting the
            * decimal point and exponent value together (example: `2.5e-1` <-> `0.25`).
            * Additionally, services **may** preserve trailing zeroes in the fraction
            * to indicate increased precision, but are not required to do so.
        +   *
            * Note that only the `.` character is supported to divide the integer
            * and the fraction; `,` **should not** be supported regardless of locale.
            * Additionally, thousand separators **should not** be supported. If a
            * service does support them, values **must** be normalized.
        +   *
            * The ENBF grammar is:
        -   *     DecimalString =
        -   *       [Sign] Significand [Exponent];
        -   *     Sign = '+' | '-';
        -   *     Significand =
        -   *       Digits ['.'] [Digits] | [Digits] '.' Digits;
        -   *     Exponent = ('e' | 'E') [Sign] Digits;
        -   *     Digits = { '0' | '1' | '2' | '3' | '4' | '5' | '6' | '7' | '8' | '9' };
        +   *
        +   * DecimalString =
        +   * [Sign] Significand [Exponent];
        +   *
        +   * Sign = '+' | '-';
        +   *
        +   * Significand =
        +   * Digits ['.'] [Digits] | [Digits] '.' Digits;
        +   *
        +   * Exponent = ('e' | 'E') [Sign] Digits;
        +   *
        +   * Digits = { '0' | '1' | '2' | '3' | '4' | '5' | '6' | '7' | '8' | '9' };
        +   *
            * Services **should** clearly document the range of supported values, the
            * maximum supported precision (total number of digits), and, if applicable,
            * the scale (number of digits after the decimal point), as well as how it
            * behaves when receiving out-of-bounds values.
        +   *
            * Services **may** choose to accept values passed as input even when the
            * value has a higher precision or scale than the service supports, and
            * **should** round the value to fit the supported scale. Alternatively, the
            * service **may** error with `400 Bad Request` (`INVALID_ARGUMENT` in gRPC)
            * if precision would be lost.
        +   *
            * Services **should** error with `400 Bad Request` (`INVALID_ARGUMENT` in
            * gRPC) if the service receives a value outside of the supported range.
            * 
        diff --git a/java-common-protos/proto-google-common-protos/src/main/java/com/google/type/DecimalProto.java b/java-common-protos/proto-google-common-protos/src/main/java/com/google/type/DecimalProto.java index 56ac896667..b659de2354 100644 --- a/java-common-protos/proto-google-common-protos/src/main/java/com/google/type/DecimalProto.java +++ b/java-common-protos/proto-google-common-protos/src/main/java/com/google/type/DecimalProto.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,13 +14,26 @@ * limitations under the License. */ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: google/type/decimal.proto +// Protobuf Java Version: 4.33.2 package com.google.type; -public final class DecimalProto { +@com.google.protobuf.Generated +public final class DecimalProto extends com.google.protobuf.GeneratedFile { private DecimalProto() {} + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "DecimalProto"); + } + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistryLite registry) {} public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry registry) { @@ -29,7 +42,7 @@ public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry r static final com.google.protobuf.Descriptors.Descriptor internal_static_google_type_Decimal_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable internal_static_google_type_Decimal_fieldAccessorTable; public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { @@ -49,13 +62,14 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { descriptor = com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( descriptorData, new com.google.protobuf.Descriptors.FileDescriptor[] {}); - internal_static_google_type_Decimal_descriptor = getDescriptor().getMessageTypes().get(0); + internal_static_google_type_Decimal_descriptor = getDescriptor().getMessageType(0); internal_static_google_type_Decimal_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_google_type_Decimal_descriptor, new java.lang.String[] { "Value", }); + descriptor.resolveAllFeaturesImmutable(); } // @@protoc_insertion_point(outer_class_scope) diff --git a/java-common-protos/proto-google-common-protos/src/main/java/com/google/type/Expr.java b/java-common-protos/proto-google-common-protos/src/main/java/com/google/type/Expr.java index e238c36c2a..b9e40968be 100644 --- a/java-common-protos/proto-google-common-protos/src/main/java/com/google/type/Expr.java +++ b/java-common-protos/proto-google-common-protos/src/main/java/com/google/type/Expr.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,9 @@ * limitations under the License. */ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: google/type/expr.proto +// Protobuf Java Version: 4.33.2 package com.google.type; @@ -25,22 +27,31 @@ * Represents a textual expression in the Common Expression Language (CEL) * syntax. CEL is a C-like expression language. The syntax and semantics of CEL * are documented at https://github.com/google/cel-spec. + * * Example (Comparison): - * title: "Summary size limit" - * description: "Determines if a summary is less than 100 chars" - * expression: "document.summary.size() < 100" + * + * title: "Summary size limit" + * description: "Determines if a summary is less than 100 chars" + * expression: "document.summary.size() < 100" + * * Example (Equality): - * title: "Requestor is owner" - * description: "Determines if requestor is the document owner" - * expression: "document.owner == request.auth.claims.email" + * + * title: "Requestor is owner" + * description: "Determines if requestor is the document owner" + * expression: "document.owner == request.auth.claims.email" + * * Example (Logic): - * title: "Public documents" - * description: "Determine whether the document should be publicly visible" - * expression: "document.type != 'private' && document.type != 'internal'" + * + * title: "Public documents" + * description: "Determine whether the document should be publicly visible" + * expression: "document.type != 'private' && document.type != 'internal'" + * * Example (Data Manipulation): - * title: "Notification string" - * description: "Create a notification string with a timestamp." - * expression: "'New message received at ' + string(document.create_time)" + * + * title: "Notification string" + * description: "Create a notification string with a timestamp." + * expression: "'New message received at ' + string(document.create_time)" + * * The exact variables and functions that may be referenced within an expression * are determined by the service that evaluates it. See the service * documentation for additional information. @@ -48,13 +59,25 @@ * * Protobuf type {@code google.type.Expr} */ -public final class Expr extends com.google.protobuf.GeneratedMessageV3 +@com.google.protobuf.Generated +public final class Expr extends com.google.protobuf.GeneratedMessage implements // @@protoc_insertion_point(message_implements:google.type.Expr) ExprOrBuilder { private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "Expr"); + } + // Use Expr.newBuilder() to construct. - private Expr(com.google.protobuf.GeneratedMessageV3.Builder builder) { + private Expr(com.google.protobuf.GeneratedMessage.Builder builder) { super(builder); } @@ -65,23 +88,12 @@ private Expr() { location_ = ""; } - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new Expr(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.type.ExprProto.internal_static_google_type_Expr_descriptor; } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.type.ExprProto.internal_static_google_type_Expr_fieldAccessorTable .ensureFieldAccessorsInitialized( @@ -89,7 +101,10 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } public static final int EXPRESSION_FIELD_NUMBER = 1; - private volatile java.lang.Object expression_; + + @SuppressWarnings("serial") + private volatile java.lang.Object expression_ = ""; + /** * * @@ -114,6 +129,7 @@ public java.lang.String getExpression() { return s; } } + /** * * @@ -140,7 +156,10 @@ public com.google.protobuf.ByteString getExpressionBytes() { } public static final int TITLE_FIELD_NUMBER = 2; - private volatile java.lang.Object title_; + + @SuppressWarnings("serial") + private volatile java.lang.Object title_ = ""; + /** * * @@ -166,6 +185,7 @@ public java.lang.String getTitle() { return s; } } + /** * * @@ -193,7 +213,10 @@ public com.google.protobuf.ByteString getTitleBytes() { } public static final int DESCRIPTION_FIELD_NUMBER = 3; - private volatile java.lang.Object description_; + + @SuppressWarnings("serial") + private volatile java.lang.Object description_ = ""; + /** * * @@ -218,6 +241,7 @@ public java.lang.String getDescription() { return s; } } + /** * * @@ -244,7 +268,10 @@ public com.google.protobuf.ByteString getDescriptionBytes() { } public static final int LOCATION_FIELD_NUMBER = 4; - private volatile java.lang.Object location_; + + @SuppressWarnings("serial") + private volatile java.lang.Object location_ = ""; + /** * * @@ -269,6 +296,7 @@ public java.lang.String getLocation() { return s; } } + /** * * @@ -308,17 +336,17 @@ public final boolean isInitialized() { @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(expression_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, expression_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(expression_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, expression_); } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(title_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 2, title_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(title_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, title_); } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(description_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 3, description_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(description_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 3, description_); } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(location_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 4, location_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(location_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 4, location_); } getUnknownFields().writeTo(output); } @@ -329,17 +357,17 @@ public int getSerializedSize() { if (size != -1) return size; size = 0; - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(expression_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, expression_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(expression_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, expression_); } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(title_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, title_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(title_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, title_); } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(description_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, description_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(description_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(3, description_); } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(location_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, location_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(location_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(4, location_); } size += getUnknownFields().getSerializedSize(); memoizedSize = size; @@ -420,38 +448,38 @@ public static com.google.type.Expr parseFrom( public static com.google.type.Expr parseFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); } public static com.google.type.Expr parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } public static com.google.type.Expr parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); } public static com.google.type.Expr parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( PARSER, input, extensionRegistry); } public static com.google.type.Expr parseFrom(com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); } public static com.google.type.Expr parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } @@ -474,10 +502,11 @@ public Builder toBuilder() { } @java.lang.Override - protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { Builder builder = new Builder(parent); return builder; } + /** * * @@ -485,22 +514,31 @@ protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.Build * Represents a textual expression in the Common Expression Language (CEL) * syntax. CEL is a C-like expression language. The syntax and semantics of CEL * are documented at https://github.com/google/cel-spec. + * * Example (Comparison): - * title: "Summary size limit" - * description: "Determines if a summary is less than 100 chars" - * expression: "document.summary.size() < 100" + * + * title: "Summary size limit" + * description: "Determines if a summary is less than 100 chars" + * expression: "document.summary.size() < 100" + * * Example (Equality): - * title: "Requestor is owner" - * description: "Determines if requestor is the document owner" - * expression: "document.owner == request.auth.claims.email" + * + * title: "Requestor is owner" + * description: "Determines if requestor is the document owner" + * expression: "document.owner == request.auth.claims.email" + * * Example (Logic): - * title: "Public documents" - * description: "Determine whether the document should be publicly visible" - * expression: "document.type != 'private' && document.type != 'internal'" + * + * title: "Public documents" + * description: "Determine whether the document should be publicly visible" + * expression: "document.type != 'private' && document.type != 'internal'" + * * Example (Data Manipulation): - * title: "Notification string" - * description: "Create a notification string with a timestamp." - * expression: "'New message received at ' + string(document.create_time)" + * + * title: "Notification string" + * description: "Create a notification string with a timestamp." + * expression: "'New message received at ' + string(document.create_time)" + * * The exact variables and functions that may be referenced within an expression * are determined by the service that evaluates it. See the service * documentation for additional information. @@ -508,7 +546,7 @@ protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.Build * * Protobuf type {@code google.type.Expr} */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder implements // @@protoc_insertion_point(builder_implements:google.type.Expr) com.google.type.ExprOrBuilder { @@ -517,7 +555,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.type.ExprProto.internal_static_google_type_Expr_fieldAccessorTable .ensureFieldAccessorsInitialized( @@ -527,21 +565,18 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { // Construct using com.google.type.Expr.newBuilder() private Builder() {} - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { super(parent); } @java.lang.Override public Builder clear() { super.clear(); + bitField0_ = 0; expression_ = ""; - title_ = ""; - description_ = ""; - location_ = ""; - return this; } @@ -567,45 +602,27 @@ public com.google.type.Expr build() { @java.lang.Override public com.google.type.Expr buildPartial() { com.google.type.Expr result = new com.google.type.Expr(this); - result.expression_ = expression_; - result.title_ = title_; - result.description_ = description_; - result.location_ = location_; + if (bitField0_ != 0) { + buildPartial0(result); + } 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); + private void buildPartial0(com.google.type.Expr result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.expression_ = expression_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.title_ = title_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.description_ = description_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.location_ = location_; + } } @java.lang.Override @@ -622,18 +639,22 @@ public Builder mergeFrom(com.google.type.Expr other) { if (other == com.google.type.Expr.getDefaultInstance()) return this; if (!other.getExpression().isEmpty()) { expression_ = other.expression_; + bitField0_ |= 0x00000001; onChanged(); } if (!other.getTitle().isEmpty()) { title_ = other.title_; + bitField0_ |= 0x00000002; onChanged(); } if (!other.getDescription().isEmpty()) { description_ = other.description_; + bitField0_ |= 0x00000004; onChanged(); } if (!other.getLocation().isEmpty()) { location_ = other.location_; + bitField0_ |= 0x00000008; onChanged(); } this.mergeUnknownFields(other.getUnknownFields()); @@ -665,25 +686,25 @@ public Builder mergeFrom( case 10: { expression_ = input.readStringRequireUtf8(); - + bitField0_ |= 0x00000001; break; } // case 10 case 18: { title_ = input.readStringRequireUtf8(); - + bitField0_ |= 0x00000002; break; } // case 18 case 26: { description_ = input.readStringRequireUtf8(); - + bitField0_ |= 0x00000004; break; } // case 26 case 34: { location_ = input.readStringRequireUtf8(); - + bitField0_ |= 0x00000008; break; } // case 34 default: @@ -703,7 +724,10 @@ public Builder mergeFrom( return this; } + private int bitField0_; + private java.lang.Object expression_ = ""; + /** * * @@ -727,6 +751,7 @@ public java.lang.String getExpression() { return (java.lang.String) ref; } } + /** * * @@ -750,6 +775,7 @@ public com.google.protobuf.ByteString getExpressionBytes() { return (com.google.protobuf.ByteString) ref; } } + /** * * @@ -767,11 +793,12 @@ public Builder setExpression(java.lang.String value) { if (value == null) { throw new NullPointerException(); } - expression_ = value; + bitField0_ |= 0x00000001; onChanged(); return this; } + /** * * @@ -785,11 +812,12 @@ public Builder setExpression(java.lang.String value) { * @return This builder for chaining. */ public Builder clearExpression() { - expression_ = getDefaultInstance().getExpression(); + bitField0_ = (bitField0_ & ~0x00000001); onChanged(); return this; } + /** * * @@ -808,13 +836,14 @@ public Builder setExpressionBytes(com.google.protobuf.ByteString value) { throw new NullPointerException(); } checkByteStringIsUtf8(value); - expression_ = value; + bitField0_ |= 0x00000001; onChanged(); return this; } private java.lang.Object title_ = ""; + /** * * @@ -839,6 +868,7 @@ public java.lang.String getTitle() { return (java.lang.String) ref; } } + /** * * @@ -863,6 +893,7 @@ public com.google.protobuf.ByteString getTitleBytes() { return (com.google.protobuf.ByteString) ref; } } + /** * * @@ -881,11 +912,12 @@ public Builder setTitle(java.lang.String value) { if (value == null) { throw new NullPointerException(); } - title_ = value; + bitField0_ |= 0x00000002; onChanged(); return this; } + /** * * @@ -900,11 +932,12 @@ public Builder setTitle(java.lang.String value) { * @return This builder for chaining. */ public Builder clearTitle() { - title_ = getDefaultInstance().getTitle(); + bitField0_ = (bitField0_ & ~0x00000002); onChanged(); return this; } + /** * * @@ -924,13 +957,14 @@ public Builder setTitleBytes(com.google.protobuf.ByteString value) { throw new NullPointerException(); } checkByteStringIsUtf8(value); - title_ = value; + bitField0_ |= 0x00000002; onChanged(); return this; } private java.lang.Object description_ = ""; + /** * * @@ -954,6 +988,7 @@ public java.lang.String getDescription() { return (java.lang.String) ref; } } + /** * * @@ -977,6 +1012,7 @@ public com.google.protobuf.ByteString getDescriptionBytes() { return (com.google.protobuf.ByteString) ref; } } + /** * * @@ -994,11 +1030,12 @@ public Builder setDescription(java.lang.String value) { if (value == null) { throw new NullPointerException(); } - description_ = value; + bitField0_ |= 0x00000004; onChanged(); return this; } + /** * * @@ -1012,11 +1049,12 @@ public Builder setDescription(java.lang.String value) { * @return This builder for chaining. */ public Builder clearDescription() { - description_ = getDefaultInstance().getDescription(); + bitField0_ = (bitField0_ & ~0x00000004); onChanged(); return this; } + /** * * @@ -1035,13 +1073,14 @@ public Builder setDescriptionBytes(com.google.protobuf.ByteString value) { throw new NullPointerException(); } checkByteStringIsUtf8(value); - description_ = value; + bitField0_ |= 0x00000004; onChanged(); return this; } private java.lang.Object location_ = ""; + /** * * @@ -1065,6 +1104,7 @@ public java.lang.String getLocation() { return (java.lang.String) ref; } } + /** * * @@ -1088,6 +1128,7 @@ public com.google.protobuf.ByteString getLocationBytes() { return (com.google.protobuf.ByteString) ref; } } + /** * * @@ -1105,11 +1146,12 @@ public Builder setLocation(java.lang.String value) { if (value == null) { throw new NullPointerException(); } - location_ = value; + bitField0_ |= 0x00000008; onChanged(); return this; } + /** * * @@ -1123,11 +1165,12 @@ public Builder setLocation(java.lang.String value) { * @return This builder for chaining. */ public Builder clearLocation() { - location_ = getDefaultInstance().getLocation(); + bitField0_ = (bitField0_ & ~0x00000008); onChanged(); return this; } + /** * * @@ -1146,23 +1189,12 @@ public Builder setLocationBytes(com.google.protobuf.ByteString value) { throw new NullPointerException(); } checkByteStringIsUtf8(value); - location_ = 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.type.Expr) } diff --git a/java-common-protos/proto-google-common-protos/src/main/java/com/google/type/ExprOrBuilder.java b/java-common-protos/proto-google-common-protos/src/main/java/com/google/type/ExprOrBuilder.java index 5d442ca063..1668b2247c 100644 --- a/java-common-protos/proto-google-common-protos/src/main/java/com/google/type/ExprOrBuilder.java +++ b/java-common-protos/proto-google-common-protos/src/main/java/com/google/type/ExprOrBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,10 +14,13 @@ * limitations under the License. */ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: google/type/expr.proto +// Protobuf Java Version: 4.33.2 package com.google.type; +@com.google.protobuf.Generated public interface ExprOrBuilder extends // @@protoc_insertion_point(interface_extends:google.type.Expr) @@ -36,6 +39,7 @@ public interface ExprOrBuilder * @return The expression. */ java.lang.String getExpression(); + /** * * @@ -64,6 +68,7 @@ public interface ExprOrBuilder * @return The title. */ java.lang.String getTitle(); + /** * * @@ -92,6 +97,7 @@ public interface ExprOrBuilder * @return The description. */ java.lang.String getDescription(); + /** * * @@ -119,6 +125,7 @@ public interface ExprOrBuilder * @return The location. */ java.lang.String getLocation(); + /** * * diff --git a/java-common-protos/proto-google-common-protos/src/main/java/com/google/type/ExprProto.java b/java-common-protos/proto-google-common-protos/src/main/java/com/google/type/ExprProto.java index bc47445ad3..73ecc15f4a 100644 --- a/java-common-protos/proto-google-common-protos/src/main/java/com/google/type/ExprProto.java +++ b/java-common-protos/proto-google-common-protos/src/main/java/com/google/type/ExprProto.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,13 +14,26 @@ * limitations under the License. */ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: google/type/expr.proto +// Protobuf Java Version: 4.33.2 package com.google.type; -public final class ExprProto { +@com.google.protobuf.Generated +public final class ExprProto extends com.google.protobuf.GeneratedFile { private ExprProto() {} + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "ExprProto"); + } + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistryLite registry) {} public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry registry) { @@ -29,7 +42,7 @@ public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry r static final com.google.protobuf.Descriptors.Descriptor internal_static_google_type_Expr_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable internal_static_google_type_Expr_fieldAccessorTable; public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { @@ -50,13 +63,14 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { descriptor = com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( descriptorData, new com.google.protobuf.Descriptors.FileDescriptor[] {}); - internal_static_google_type_Expr_descriptor = getDescriptor().getMessageTypes().get(0); + internal_static_google_type_Expr_descriptor = getDescriptor().getMessageType(0); internal_static_google_type_Expr_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_google_type_Expr_descriptor, new java.lang.String[] { "Expression", "Title", "Description", "Location", }); + descriptor.resolveAllFeaturesImmutable(); } // @@protoc_insertion_point(outer_class_scope) diff --git a/java-common-protos/proto-google-common-protos/src/main/java/com/google/type/Fraction.java b/java-common-protos/proto-google-common-protos/src/main/java/com/google/type/Fraction.java index f3a3a54890..715f531bac 100644 --- a/java-common-protos/proto-google-common-protos/src/main/java/com/google/type/Fraction.java +++ b/java-common-protos/proto-google-common-protos/src/main/java/com/google/type/Fraction.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,9 @@ * limitations under the License. */ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: google/type/fraction.proto +// Protobuf Java Version: 4.33.2 package com.google.type; @@ -27,35 +29,36 @@ * * Protobuf type {@code google.type.Fraction} */ -public final class Fraction extends com.google.protobuf.GeneratedMessageV3 +@com.google.protobuf.Generated +public final class Fraction extends com.google.protobuf.GeneratedMessage implements // @@protoc_insertion_point(message_implements:google.type.Fraction) FractionOrBuilder { private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "Fraction"); + } + // Use Fraction.newBuilder() to construct. - private Fraction(com.google.protobuf.GeneratedMessageV3.Builder builder) { + private Fraction(com.google.protobuf.GeneratedMessage.Builder builder) { super(builder); } private Fraction() {} - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new Fraction(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.type.FractionProto.internal_static_google_type_Fraction_descriptor; } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.type.FractionProto.internal_static_google_type_Fraction_fieldAccessorTable .ensureFieldAccessorsInitialized( @@ -63,7 +66,8 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } public static final int NUMERATOR_FIELD_NUMBER = 1; - private long numerator_; + private long numerator_ = 0L; + /** * * @@ -81,7 +85,8 @@ public long getNumerator() { } public static final int DENOMINATOR_FIELD_NUMBER = 2; - private long denominator_; + private long denominator_ = 0L; + /** * * @@ -207,38 +212,38 @@ public static com.google.type.Fraction parseFrom( public static com.google.type.Fraction parseFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); } public static com.google.type.Fraction parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } public static com.google.type.Fraction parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); } public static com.google.type.Fraction parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( PARSER, input, extensionRegistry); } public static com.google.type.Fraction parseFrom(com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); } public static com.google.type.Fraction parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } @@ -261,10 +266,11 @@ public Builder toBuilder() { } @java.lang.Override - protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { Builder builder = new Builder(parent); return builder; } + /** * * @@ -274,7 +280,7 @@ protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.Build * * Protobuf type {@code google.type.Fraction} */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder implements // @@protoc_insertion_point(builder_implements:google.type.Fraction) com.google.type.FractionOrBuilder { @@ -283,7 +289,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.type.FractionProto.internal_static_google_type_Fraction_fieldAccessorTable .ensureFieldAccessorsInitialized( @@ -293,17 +299,16 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { // Construct using com.google.type.Fraction.newBuilder() private Builder() {} - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { super(parent); } @java.lang.Override public Builder clear() { super.clear(); + bitField0_ = 0; numerator_ = 0L; - denominator_ = 0L; - return this; } @@ -329,43 +334,21 @@ public com.google.type.Fraction build() { @java.lang.Override public com.google.type.Fraction buildPartial() { com.google.type.Fraction result = new com.google.type.Fraction(this); - result.numerator_ = numerator_; - result.denominator_ = denominator_; + if (bitField0_ != 0) { + buildPartial0(result); + } 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); + private void buildPartial0(com.google.type.Fraction result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.numerator_ = numerator_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.denominator_ = denominator_; + } } @java.lang.Override @@ -415,13 +398,13 @@ public Builder mergeFrom( case 8: { numerator_ = input.readInt64(); - + bitField0_ |= 0x00000001; break; } // case 8 case 16: { denominator_ = input.readInt64(); - + bitField0_ |= 0x00000002; break; } // case 16 default: @@ -441,7 +424,10 @@ public Builder mergeFrom( return this; } + private int bitField0_; + private long numerator_; + /** * * @@ -457,6 +443,7 @@ public Builder mergeFrom( public long getNumerator() { return numerator_; } + /** * * @@ -472,9 +459,11 @@ public long getNumerator() { public Builder setNumerator(long value) { numerator_ = value; + bitField0_ |= 0x00000001; onChanged(); return this; } + /** * * @@ -487,13 +476,14 @@ public Builder setNumerator(long value) { * @return This builder for chaining. */ public Builder clearNumerator() { - + bitField0_ = (bitField0_ & ~0x00000001); numerator_ = 0L; onChanged(); return this; } private long denominator_; + /** * * @@ -510,6 +500,7 @@ public Builder clearNumerator() { public long getDenominator() { return denominator_; } + /** * * @@ -526,9 +517,11 @@ public long getDenominator() { public Builder setDenominator(long value) { denominator_ = value; + bitField0_ |= 0x00000002; onChanged(); return this; } + /** * * @@ -542,23 +535,12 @@ public Builder setDenominator(long value) { * @return This builder for chaining. */ public Builder clearDenominator() { - + bitField0_ = (bitField0_ & ~0x00000002); denominator_ = 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.type.Fraction) } diff --git a/java-common-protos/proto-google-common-protos/src/main/java/com/google/type/FractionOrBuilder.java b/java-common-protos/proto-google-common-protos/src/main/java/com/google/type/FractionOrBuilder.java index 57c5d51a29..918bdb0281 100644 --- a/java-common-protos/proto-google-common-protos/src/main/java/com/google/type/FractionOrBuilder.java +++ b/java-common-protos/proto-google-common-protos/src/main/java/com/google/type/FractionOrBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,10 +14,13 @@ * limitations under the License. */ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: google/type/fraction.proto +// Protobuf Java Version: 4.33.2 package com.google.type; +@com.google.protobuf.Generated public interface FractionOrBuilder extends // @@protoc_insertion_point(interface_extends:google.type.Fraction) diff --git a/java-common-protos/proto-google-common-protos/src/main/java/com/google/type/FractionProto.java b/java-common-protos/proto-google-common-protos/src/main/java/com/google/type/FractionProto.java index dea8f4ea46..2efd8fdddc 100644 --- a/java-common-protos/proto-google-common-protos/src/main/java/com/google/type/FractionProto.java +++ b/java-common-protos/proto-google-common-protos/src/main/java/com/google/type/FractionProto.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,13 +14,26 @@ * limitations under the License. */ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: google/type/fraction.proto +// Protobuf Java Version: 4.33.2 package com.google.type; -public final class FractionProto { +@com.google.protobuf.Generated +public final class FractionProto extends com.google.protobuf.GeneratedFile { private FractionProto() {} + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "FractionProto"); + } + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistryLite registry) {} public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry registry) { @@ -29,7 +42,7 @@ public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry r static final com.google.protobuf.Descriptors.Descriptor internal_static_google_type_Fraction_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable internal_static_google_type_Fraction_fieldAccessorTable; public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { @@ -50,13 +63,14 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { descriptor = com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( descriptorData, new com.google.protobuf.Descriptors.FileDescriptor[] {}); - internal_static_google_type_Fraction_descriptor = getDescriptor().getMessageTypes().get(0); + internal_static_google_type_Fraction_descriptor = getDescriptor().getMessageType(0); internal_static_google_type_Fraction_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_google_type_Fraction_descriptor, new java.lang.String[] { "Numerator", "Denominator", }); + descriptor.resolveAllFeaturesImmutable(); } // @@protoc_insertion_point(outer_class_scope) diff --git a/java-common-protos/proto-google-common-protos/src/main/java/com/google/type/Interval.java b/java-common-protos/proto-google-common-protos/src/main/java/com/google/type/Interval.java index 6759226178..778a2f2ae5 100644 --- a/java-common-protos/proto-google-common-protos/src/main/java/com/google/type/Interval.java +++ b/java-common-protos/proto-google-common-protos/src/main/java/com/google/type/Interval.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,9 @@ * limitations under the License. */ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: google/type/interval.proto +// Protobuf Java Version: 4.33.2 package com.google.type; @@ -24,6 +26,7 @@ *
          * Represents a time interval, encoded as a Timestamp start (inclusive) and a
          * Timestamp end (exclusive).
        + *
          * The start must be less than or equal to the end.
          * When the start equals the end, the interval is empty (matches no time).
          * When both start and end are unspecified, the interval matches any time.
        @@ -31,48 +34,52 @@
          *
          * Protobuf type {@code google.type.Interval}
          */
        -public final class Interval extends com.google.protobuf.GeneratedMessageV3
        +@com.google.protobuf.Generated
        +public final class Interval extends com.google.protobuf.GeneratedMessage
             implements
             // @@protoc_insertion_point(message_implements:google.type.Interval)
             IntervalOrBuilder {
           private static final long serialVersionUID = 0L;
        +
        +  static {
        +    com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion(
        +        com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC,
        +        /* major= */ 4,
        +        /* minor= */ 33,
        +        /* patch= */ 2,
        +        /* suffix= */ "",
        +        "Interval");
        +  }
        +
           // Use Interval.newBuilder() to construct.
        -  private Interval(com.google.protobuf.GeneratedMessageV3.Builder builder) {
        +  private Interval(com.google.protobuf.GeneratedMessage.Builder builder) {
             super(builder);
           }
         
           private Interval() {}
         
        -  @java.lang.Override
        -  @SuppressWarnings({"unused"})
        -  protected java.lang.Object newInstance(UnusedPrivateParameter unused) {
        -    return new Interval();
        -  }
        -
        -  @java.lang.Override
        -  public final com.google.protobuf.UnknownFieldSet getUnknownFields() {
        -    return this.unknownFields;
        -  }
        -
           public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
             return com.google.type.IntervalProto.internal_static_google_type_Interval_descriptor;
           }
         
           @java.lang.Override
        -  protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
        +  protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
               internalGetFieldAccessorTable() {
             return com.google.type.IntervalProto.internal_static_google_type_Interval_fieldAccessorTable
                 .ensureFieldAccessorsInitialized(
                     com.google.type.Interval.class, com.google.type.Interval.Builder.class);
           }
         
        +  private int bitField0_;
           public static final int START_TIME_FIELD_NUMBER = 1;
           private com.google.protobuf.Timestamp startTime_;
        +
           /**
            *
            *
            * 
            * Optional. Inclusive start of the interval.
        +   *
            * If specified, a Timestamp matching this interval will have to be the same
            * or after the start.
            * 
        @@ -83,13 +90,15 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { */ @java.lang.Override public boolean hasStartTime() { - return startTime_ != null; + return ((bitField0_ & 0x00000001) != 0); } + /** * * *
            * Optional. Inclusive start of the interval.
        +   *
            * If specified, a Timestamp matching this interval will have to be the same
            * or after the start.
            * 
        @@ -102,11 +111,13 @@ public boolean hasStartTime() { public com.google.protobuf.Timestamp getStartTime() { return startTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : startTime_; } + /** * * *
            * Optional. Inclusive start of the interval.
        +   *
            * If specified, a Timestamp matching this interval will have to be the same
            * or after the start.
            * 
        @@ -115,16 +126,18 @@ public com.google.protobuf.Timestamp getStartTime() { */ @java.lang.Override public com.google.protobuf.TimestampOrBuilder getStartTimeOrBuilder() { - return getStartTime(); + return startTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : startTime_; } public static final int END_TIME_FIELD_NUMBER = 2; private com.google.protobuf.Timestamp endTime_; + /** * * *
            * Optional. Exclusive end of the interval.
        +   *
            * If specified, a Timestamp matching this interval will have to be before the
            * end.
            * 
        @@ -135,13 +148,15 @@ public com.google.protobuf.TimestampOrBuilder getStartTimeOrBuilder() { */ @java.lang.Override public boolean hasEndTime() { - return endTime_ != null; + return ((bitField0_ & 0x00000002) != 0); } + /** * * *
            * Optional. Exclusive end of the interval.
        +   *
            * If specified, a Timestamp matching this interval will have to be before the
            * end.
            * 
        @@ -154,11 +169,13 @@ public boolean hasEndTime() { public com.google.protobuf.Timestamp getEndTime() { return endTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : endTime_; } + /** * * *
            * Optional. Exclusive end of the interval.
        +   *
            * If specified, a Timestamp matching this interval will have to be before the
            * end.
            * 
        @@ -167,7 +184,7 @@ public com.google.protobuf.Timestamp getEndTime() { */ @java.lang.Override public com.google.protobuf.TimestampOrBuilder getEndTimeOrBuilder() { - return getEndTime(); + return endTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : endTime_; } private byte memoizedIsInitialized = -1; @@ -184,10 +201,10 @@ public final boolean isInitialized() { @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (startTime_ != null) { + if (((bitField0_ & 0x00000001) != 0)) { output.writeMessage(1, getStartTime()); } - if (endTime_ != null) { + if (((bitField0_ & 0x00000002) != 0)) { output.writeMessage(2, getEndTime()); } getUnknownFields().writeTo(output); @@ -199,10 +216,10 @@ public int getSerializedSize() { if (size != -1) return size; size = 0; - if (startTime_ != null) { + if (((bitField0_ & 0x00000001) != 0)) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getStartTime()); } - if (endTime_ != null) { + if (((bitField0_ & 0x00000002) != 0)) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getEndTime()); } size += getUnknownFields().getSerializedSize(); @@ -288,38 +305,38 @@ public static com.google.type.Interval parseFrom( public static com.google.type.Interval parseFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); } public static com.google.type.Interval parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } public static com.google.type.Interval parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); } public static com.google.type.Interval parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( PARSER, input, extensionRegistry); } public static com.google.type.Interval parseFrom(com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); } public static com.google.type.Interval parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } @@ -342,16 +359,18 @@ public Builder toBuilder() { } @java.lang.Override - protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { Builder builder = new Builder(parent); return builder; } + /** * * *
            * Represents a time interval, encoded as a Timestamp start (inclusive) and a
            * Timestamp end (exclusive).
        +   *
            * The start must be less than or equal to the end.
            * When the start equals the end, the interval is empty (matches no time).
            * When both start and end are unspecified, the interval matches any time.
        @@ -359,7 +378,7 @@ protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.Build
            *
            * Protobuf type {@code google.type.Interval}
            */
        -  public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder
        +  public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder
               implements
               // @@protoc_insertion_point(builder_implements:google.type.Interval)
               com.google.type.IntervalOrBuilder {
        @@ -368,7 +387,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
             }
         
             @java.lang.Override
        -    protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
        +    protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
                 internalGetFieldAccessorTable() {
               return com.google.type.IntervalProto.internal_static_google_type_Interval_fieldAccessorTable
                   .ensureFieldAccessorsInitialized(
        @@ -376,25 +395,34 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
             }
         
             // Construct using com.google.type.Interval.newBuilder()
        -    private Builder() {}
        +    private Builder() {
        +      maybeForceBuilderInitialization();
        +    }
         
        -    private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
        +    private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) {
               super(parent);
        +      maybeForceBuilderInitialization();
        +    }
        +
        +    private void maybeForceBuilderInitialization() {
        +      if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) {
        +        internalGetStartTimeFieldBuilder();
        +        internalGetEndTimeFieldBuilder();
        +      }
             }
         
             @java.lang.Override
             public Builder clear() {
               super.clear();
        -      if (startTimeBuilder_ == null) {
        -        startTime_ = null;
        -      } else {
        -        startTime_ = null;
        +      bitField0_ = 0;
        +      startTime_ = null;
        +      if (startTimeBuilder_ != null) {
        +        startTimeBuilder_.dispose();
                 startTimeBuilder_ = null;
               }
        -      if (endTimeBuilder_ == null) {
        -        endTime_ = null;
        -      } else {
        -        endTime_ = null;
        +      endTime_ = null;
        +      if (endTimeBuilder_ != null) {
        +        endTimeBuilder_.dispose();
                 endTimeBuilder_ = null;
               }
               return this;
        @@ -422,51 +450,25 @@ public com.google.type.Interval build() {
             @java.lang.Override
             public com.google.type.Interval buildPartial() {
               com.google.type.Interval result = new com.google.type.Interval(this);
        -      if (startTimeBuilder_ == null) {
        -        result.startTime_ = startTime_;
        -      } else {
        -        result.startTime_ = startTimeBuilder_.build();
        -      }
        -      if (endTimeBuilder_ == null) {
        -        result.endTime_ = endTime_;
        -      } else {
        -        result.endTime_ = endTimeBuilder_.build();
        +      if (bitField0_ != 0) {
        +        buildPartial0(result);
               }
               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);
        +    private void buildPartial0(com.google.type.Interval 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;
        +      }
        +      result.bitField0_ |= to_bitField0_;
             }
         
             @java.lang.Override
        @@ -515,14 +517,15 @@ public Builder mergeFrom(
                       break;
                     case 10:
                       {
        -                input.readMessage(getStartTimeFieldBuilder().getBuilder(), extensionRegistry);
        -
        +                input.readMessage(
        +                    internalGetStartTimeFieldBuilder().getBuilder(), extensionRegistry);
        +                bitField0_ |= 0x00000001;
                         break;
                       } // case 10
                     case 18:
                       {
        -                input.readMessage(getEndTimeFieldBuilder().getBuilder(), extensionRegistry);
        -
        +                input.readMessage(internalGetEndTimeFieldBuilder().getBuilder(), extensionRegistry);
        +                bitField0_ |= 0x00000002;
                         break;
                       } // case 18
                     default:
        @@ -542,17 +545,21 @@ public Builder mergeFrom(
               return this;
             }
         
        +    private int bitField0_;
        +
             private com.google.protobuf.Timestamp startTime_;
        -    private com.google.protobuf.SingleFieldBuilderV3<
        +    private com.google.protobuf.SingleFieldBuilder<
                     com.google.protobuf.Timestamp,
                     com.google.protobuf.Timestamp.Builder,
                     com.google.protobuf.TimestampOrBuilder>
                 startTimeBuilder_;
        +
             /**
              *
              *
              * 
              * Optional. Inclusive start of the interval.
        +     *
              * If specified, a Timestamp matching this interval will have to be the same
              * or after the start.
              * 
        @@ -562,13 +569,15 @@ public Builder mergeFrom( * @return Whether the startTime field is set. */ public boolean hasStartTime() { - return startTimeBuilder_ != null || startTime_ != null; + return ((bitField0_ & 0x00000001) != 0); } + /** * * *
              * Optional. Inclusive start of the interval.
        +     *
              * If specified, a Timestamp matching this interval will have to be the same
              * or after the start.
              * 
        @@ -584,11 +593,13 @@ public com.google.protobuf.Timestamp getStartTime() { return startTimeBuilder_.getMessage(); } } + /** * * *
              * Optional. Inclusive start of the interval.
        +     *
              * If specified, a Timestamp matching this interval will have to be the same
              * or after the start.
              * 
        @@ -601,18 +612,20 @@ public Builder setStartTime(com.google.protobuf.Timestamp value) { throw new NullPointerException(); } startTime_ = value; - onChanged(); } else { startTimeBuilder_.setMessage(value); } - + bitField0_ |= 0x00000001; + onChanged(); return this; } + /** * * *
              * Optional. Inclusive start of the interval.
        +     *
              * If specified, a Timestamp matching this interval will have to be the same
              * or after the start.
              * 
        @@ -622,18 +635,20 @@ public Builder setStartTime(com.google.protobuf.Timestamp value) { public Builder setStartTime(com.google.protobuf.Timestamp.Builder builderForValue) { if (startTimeBuilder_ == null) { startTime_ = builderForValue.build(); - onChanged(); } else { startTimeBuilder_.setMessage(builderForValue.build()); } - + bitField0_ |= 0x00000001; + onChanged(); return this; } + /** * * *
              * Optional. Inclusive start of the interval.
        +     *
              * If specified, a Timestamp matching this interval will have to be the same
              * or after the start.
              * 
        @@ -642,24 +657,29 @@ public Builder setStartTime(com.google.protobuf.Timestamp.Builder builderForValu */ public Builder mergeStartTime(com.google.protobuf.Timestamp value) { if (startTimeBuilder_ == null) { - if (startTime_ != null) { - startTime_ = - com.google.protobuf.Timestamp.newBuilder(startTime_).mergeFrom(value).buildPartial(); + if (((bitField0_ & 0x00000001) != 0) + && startTime_ != null + && startTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getStartTimeBuilder().mergeFrom(value); } else { startTime_ = value; } - onChanged(); } else { startTimeBuilder_.mergeFrom(value); } - + if (startTime_ != null) { + bitField0_ |= 0x00000001; + onChanged(); + } return this; } + /** * * *
              * Optional. Inclusive start of the interval.
        +     *
              * If specified, a Timestamp matching this interval will have to be the same
              * or after the start.
              * 
        @@ -667,21 +687,22 @@ public Builder mergeStartTime(com.google.protobuf.Timestamp value) { * .google.protobuf.Timestamp start_time = 1; */ public Builder clearStartTime() { - if (startTimeBuilder_ == null) { - startTime_ = null; - onChanged(); - } else { - startTime_ = null; + bitField0_ = (bitField0_ & ~0x00000001); + startTime_ = null; + if (startTimeBuilder_ != null) { + startTimeBuilder_.dispose(); startTimeBuilder_ = null; } - + onChanged(); return this; } + /** * * *
              * Optional. Inclusive start of the interval.
        +     *
              * If specified, a Timestamp matching this interval will have to be the same
              * or after the start.
              * 
        @@ -689,15 +710,17 @@ public Builder clearStartTime() { * .google.protobuf.Timestamp start_time = 1; */ public com.google.protobuf.Timestamp.Builder getStartTimeBuilder() { - + bitField0_ |= 0x00000001; onChanged(); - return getStartTimeFieldBuilder().getBuilder(); + return internalGetStartTimeFieldBuilder().getBuilder(); } + /** * * *
              * Optional. Inclusive start of the interval.
        +     *
              * If specified, a Timestamp matching this interval will have to be the same
              * or after the start.
              * 
        @@ -711,25 +734,27 @@ public com.google.protobuf.TimestampOrBuilder getStartTimeOrBuilder() { return startTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : startTime_; } } + /** * * *
              * Optional. Inclusive start of the interval.
        +     *
              * If specified, a Timestamp matching this interval will have to be the same
              * or after the start.
              * 
        * * .google.protobuf.Timestamp start_time = 1; */ - private com.google.protobuf.SingleFieldBuilderV3< + private com.google.protobuf.SingleFieldBuilder< com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder> - getStartTimeFieldBuilder() { + internalGetStartTimeFieldBuilder() { if (startTimeBuilder_ == null) { startTimeBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< + new com.google.protobuf.SingleFieldBuilder< com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder>( @@ -740,16 +765,18 @@ public com.google.protobuf.TimestampOrBuilder getStartTimeOrBuilder() { } private com.google.protobuf.Timestamp endTime_; - private com.google.protobuf.SingleFieldBuilderV3< + private com.google.protobuf.SingleFieldBuilder< com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder> endTimeBuilder_; + /** * * *
              * Optional. Exclusive end of the interval.
        +     *
              * If specified, a Timestamp matching this interval will have to be before the
              * end.
              * 
        @@ -759,13 +786,15 @@ public com.google.protobuf.TimestampOrBuilder getStartTimeOrBuilder() { * @return Whether the endTime field is set. */ public boolean hasEndTime() { - return endTimeBuilder_ != null || endTime_ != null; + return ((bitField0_ & 0x00000002) != 0); } + /** * * *
              * Optional. Exclusive end of the interval.
        +     *
              * If specified, a Timestamp matching this interval will have to be before the
              * end.
              * 
        @@ -781,11 +810,13 @@ public com.google.protobuf.Timestamp getEndTime() { return endTimeBuilder_.getMessage(); } } + /** * * *
              * Optional. Exclusive end of the interval.
        +     *
              * If specified, a Timestamp matching this interval will have to be before the
              * end.
              * 
        @@ -798,18 +829,20 @@ public Builder setEndTime(com.google.protobuf.Timestamp value) { throw new NullPointerException(); } endTime_ = value; - onChanged(); } else { endTimeBuilder_.setMessage(value); } - + bitField0_ |= 0x00000002; + onChanged(); return this; } + /** * * *
              * Optional. Exclusive end of the interval.
        +     *
              * If specified, a Timestamp matching this interval will have to be before the
              * end.
              * 
        @@ -819,18 +852,20 @@ public Builder setEndTime(com.google.protobuf.Timestamp value) { public Builder setEndTime(com.google.protobuf.Timestamp.Builder builderForValue) { if (endTimeBuilder_ == null) { endTime_ = builderForValue.build(); - onChanged(); } else { endTimeBuilder_.setMessage(builderForValue.build()); } - + bitField0_ |= 0x00000002; + onChanged(); return this; } + /** * * *
              * Optional. Exclusive end of the interval.
        +     *
              * If specified, a Timestamp matching this interval will have to be before the
              * end.
              * 
        @@ -839,24 +874,29 @@ public Builder setEndTime(com.google.protobuf.Timestamp.Builder builderForValue) */ public Builder mergeEndTime(com.google.protobuf.Timestamp value) { if (endTimeBuilder_ == null) { - if (endTime_ != null) { - endTime_ = - com.google.protobuf.Timestamp.newBuilder(endTime_).mergeFrom(value).buildPartial(); + if (((bitField0_ & 0x00000002) != 0) + && endTime_ != null + && endTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getEndTimeBuilder().mergeFrom(value); } else { endTime_ = value; } - onChanged(); } else { endTimeBuilder_.mergeFrom(value); } - + if (endTime_ != null) { + bitField0_ |= 0x00000002; + onChanged(); + } return this; } + /** * * *
              * Optional. Exclusive end of the interval.
        +     *
              * If specified, a Timestamp matching this interval will have to be before the
              * end.
              * 
        @@ -864,21 +904,22 @@ public Builder mergeEndTime(com.google.protobuf.Timestamp value) { * .google.protobuf.Timestamp end_time = 2; */ public Builder clearEndTime() { - if (endTimeBuilder_ == null) { - endTime_ = null; - onChanged(); - } else { - endTime_ = null; + bitField0_ = (bitField0_ & ~0x00000002); + endTime_ = null; + if (endTimeBuilder_ != null) { + endTimeBuilder_.dispose(); endTimeBuilder_ = null; } - + onChanged(); return this; } + /** * * *
              * Optional. Exclusive end of the interval.
        +     *
              * If specified, a Timestamp matching this interval will have to be before the
              * end.
              * 
        @@ -886,15 +927,17 @@ public Builder clearEndTime() { * .google.protobuf.Timestamp end_time = 2; */ public com.google.protobuf.Timestamp.Builder getEndTimeBuilder() { - + bitField0_ |= 0x00000002; onChanged(); - return getEndTimeFieldBuilder().getBuilder(); + return internalGetEndTimeFieldBuilder().getBuilder(); } + /** * * *
              * Optional. Exclusive end of the interval.
        +     *
              * If specified, a Timestamp matching this interval will have to be before the
              * end.
              * 
        @@ -908,25 +951,27 @@ public com.google.protobuf.TimestampOrBuilder getEndTimeOrBuilder() { return endTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : endTime_; } } + /** * * *
              * Optional. Exclusive end of the interval.
        +     *
              * If specified, a Timestamp matching this interval will have to be before the
              * end.
              * 
        * * .google.protobuf.Timestamp end_time = 2; */ - private com.google.protobuf.SingleFieldBuilderV3< + private com.google.protobuf.SingleFieldBuilder< com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder> - getEndTimeFieldBuilder() { + internalGetEndTimeFieldBuilder() { if (endTimeBuilder_ == null) { endTimeBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< + new com.google.protobuf.SingleFieldBuilder< com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder>( @@ -936,17 +981,6 @@ public com.google.protobuf.TimestampOrBuilder getEndTimeOrBuilder() { return endTimeBuilder_; } - @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.type.Interval) } diff --git a/java-common-protos/proto-google-common-protos/src/main/java/com/google/type/IntervalOrBuilder.java b/java-common-protos/proto-google-common-protos/src/main/java/com/google/type/IntervalOrBuilder.java index 3267b41792..19d30f94b4 100644 --- a/java-common-protos/proto-google-common-protos/src/main/java/com/google/type/IntervalOrBuilder.java +++ b/java-common-protos/proto-google-common-protos/src/main/java/com/google/type/IntervalOrBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,10 +14,13 @@ * limitations under the License. */ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: google/type/interval.proto +// Protobuf Java Version: 4.33.2 package com.google.type; +@com.google.protobuf.Generated public interface IntervalOrBuilder extends // @@protoc_insertion_point(interface_extends:google.type.Interval) @@ -28,6 +31,7 @@ public interface IntervalOrBuilder * *
            * Optional. Inclusive start of the interval.
        +   *
            * If specified, a Timestamp matching this interval will have to be the same
            * or after the start.
            * 
        @@ -37,11 +41,13 @@ public interface IntervalOrBuilder * @return Whether the startTime field is set. */ boolean hasStartTime(); + /** * * *
            * Optional. Inclusive start of the interval.
        +   *
            * If specified, a Timestamp matching this interval will have to be the same
            * or after the start.
            * 
        @@ -51,11 +57,13 @@ public interface IntervalOrBuilder * @return The startTime. */ com.google.protobuf.Timestamp getStartTime(); + /** * * *
            * Optional. Inclusive start of the interval.
        +   *
            * If specified, a Timestamp matching this interval will have to be the same
            * or after the start.
            * 
        @@ -69,6 +77,7 @@ public interface IntervalOrBuilder * *
            * Optional. Exclusive end of the interval.
        +   *
            * If specified, a Timestamp matching this interval will have to be before the
            * end.
            * 
        @@ -78,11 +87,13 @@ public interface IntervalOrBuilder * @return Whether the endTime field is set. */ boolean hasEndTime(); + /** * * *
            * Optional. Exclusive end of the interval.
        +   *
            * If specified, a Timestamp matching this interval will have to be before the
            * end.
            * 
        @@ -92,11 +103,13 @@ public interface IntervalOrBuilder * @return The endTime. */ com.google.protobuf.Timestamp getEndTime(); + /** * * *
            * Optional. Exclusive end of the interval.
        +   *
            * If specified, a Timestamp matching this interval will have to be before the
            * end.
            * 
        diff --git a/java-common-protos/proto-google-common-protos/src/main/java/com/google/type/IntervalProto.java b/java-common-protos/proto-google-common-protos/src/main/java/com/google/type/IntervalProto.java index ca3a9527b3..a544688a67 100644 --- a/java-common-protos/proto-google-common-protos/src/main/java/com/google/type/IntervalProto.java +++ b/java-common-protos/proto-google-common-protos/src/main/java/com/google/type/IntervalProto.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,13 +14,26 @@ * limitations under the License. */ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: google/type/interval.proto +// Protobuf Java Version: 4.33.2 package com.google.type; -public final class IntervalProto { +@com.google.protobuf.Generated +public final class IntervalProto extends com.google.protobuf.GeneratedFile { private IntervalProto() {} + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "IntervalProto"); + } + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistryLite registry) {} public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry registry) { @@ -29,7 +42,7 @@ public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry r static final com.google.protobuf.Descriptors.Descriptor internal_static_google_type_Interval_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable internal_static_google_type_Interval_fieldAccessorTable; public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { @@ -55,13 +68,14 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { new com.google.protobuf.Descriptors.FileDescriptor[] { com.google.protobuf.TimestampProto.getDescriptor(), }); - internal_static_google_type_Interval_descriptor = getDescriptor().getMessageTypes().get(0); + internal_static_google_type_Interval_descriptor = getDescriptor().getMessageType(0); internal_static_google_type_Interval_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_google_type_Interval_descriptor, new java.lang.String[] { "StartTime", "EndTime", }); + descriptor.resolveAllFeaturesImmutable(); com.google.protobuf.TimestampProto.getDescriptor(); } diff --git a/java-common-protos/proto-google-common-protos/src/main/java/com/google/type/LatLng.java b/java-common-protos/proto-google-common-protos/src/main/java/com/google/type/LatLng.java index d26cf25c67..9334eeb47d 100644 --- a/java-common-protos/proto-google-common-protos/src/main/java/com/google/type/LatLng.java +++ b/java-common-protos/proto-google-common-protos/src/main/java/com/google/type/LatLng.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,9 @@ * limitations under the License. */ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: google/type/latlng.proto +// Protobuf Java Version: 4.33.2 package com.google.type; @@ -31,35 +33,36 @@ * * Protobuf type {@code google.type.LatLng} */ -public final class LatLng extends com.google.protobuf.GeneratedMessageV3 +@com.google.protobuf.Generated +public final class LatLng extends com.google.protobuf.GeneratedMessage implements // @@protoc_insertion_point(message_implements:google.type.LatLng) LatLngOrBuilder { private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "LatLng"); + } + // Use LatLng.newBuilder() to construct. - private LatLng(com.google.protobuf.GeneratedMessageV3.Builder builder) { + private LatLng(com.google.protobuf.GeneratedMessage.Builder builder) { super(builder); } private LatLng() {} - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new LatLng(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.type.LatLngProto.internal_static_google_type_LatLng_descriptor; } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.type.LatLngProto.internal_static_google_type_LatLng_fieldAccessorTable .ensureFieldAccessorsInitialized( @@ -67,7 +70,8 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } public static final int LATITUDE_FIELD_NUMBER = 1; - private double latitude_; + private double latitude_ = 0D; + /** * * @@ -85,7 +89,8 @@ public double getLatitude() { } public static final int LONGITUDE_FIELD_NUMBER = 2; - private double longitude_; + private double longitude_ = 0D; + /** * * @@ -218,38 +223,38 @@ public static com.google.type.LatLng parseFrom( public static com.google.type.LatLng parseFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); } public static com.google.type.LatLng parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } public static com.google.type.LatLng parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); } public static com.google.type.LatLng parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( PARSER, input, extensionRegistry); } public static com.google.type.LatLng parseFrom(com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); } public static com.google.type.LatLng parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } @@ -272,10 +277,11 @@ public Builder toBuilder() { } @java.lang.Override - protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { Builder builder = new Builder(parent); return builder; } + /** * * @@ -289,7 +295,7 @@ protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.Build * * Protobuf type {@code google.type.LatLng} */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder implements // @@protoc_insertion_point(builder_implements:google.type.LatLng) com.google.type.LatLngOrBuilder { @@ -298,7 +304,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.type.LatLngProto.internal_static_google_type_LatLng_fieldAccessorTable .ensureFieldAccessorsInitialized( @@ -308,17 +314,16 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { // Construct using com.google.type.LatLng.newBuilder() private Builder() {} - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { super(parent); } @java.lang.Override public Builder clear() { super.clear(); + bitField0_ = 0; latitude_ = 0D; - longitude_ = 0D; - return this; } @@ -344,43 +349,21 @@ public com.google.type.LatLng build() { @java.lang.Override public com.google.type.LatLng buildPartial() { com.google.type.LatLng result = new com.google.type.LatLng(this); - result.latitude_ = latitude_; - result.longitude_ = longitude_; + if (bitField0_ != 0) { + buildPartial0(result); + } 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); + private void buildPartial0(com.google.type.LatLng result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.latitude_ = latitude_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.longitude_ = longitude_; + } } @java.lang.Override @@ -395,10 +378,10 @@ public Builder mergeFrom(com.google.protobuf.Message other) { public Builder mergeFrom(com.google.type.LatLng other) { if (other == com.google.type.LatLng.getDefaultInstance()) return this; - if (other.getLatitude() != 0D) { + if (java.lang.Double.doubleToRawLongBits(other.getLatitude()) != 0) { setLatitude(other.getLatitude()); } - if (other.getLongitude() != 0D) { + if (java.lang.Double.doubleToRawLongBits(other.getLongitude()) != 0) { setLongitude(other.getLongitude()); } this.mergeUnknownFields(other.getUnknownFields()); @@ -430,13 +413,13 @@ public Builder mergeFrom( case 9: { latitude_ = input.readDouble(); - + bitField0_ |= 0x00000001; break; } // case 9 case 17: { longitude_ = input.readDouble(); - + bitField0_ |= 0x00000002; break; } // case 17 default: @@ -456,7 +439,10 @@ public Builder mergeFrom( return this; } + private int bitField0_; + private double latitude_; + /** * * @@ -472,6 +458,7 @@ public Builder mergeFrom( public double getLatitude() { return latitude_; } + /** * * @@ -487,9 +474,11 @@ public double getLatitude() { public Builder setLatitude(double value) { latitude_ = value; + bitField0_ |= 0x00000001; onChanged(); return this; } + /** * * @@ -502,13 +491,14 @@ public Builder setLatitude(double value) { * @return This builder for chaining. */ public Builder clearLatitude() { - + bitField0_ = (bitField0_ & ~0x00000001); latitude_ = 0D; onChanged(); return this; } private double longitude_; + /** * * @@ -524,6 +514,7 @@ public Builder clearLatitude() { public double getLongitude() { return longitude_; } + /** * * @@ -539,9 +530,11 @@ public double getLongitude() { public Builder setLongitude(double value) { longitude_ = value; + bitField0_ |= 0x00000002; onChanged(); return this; } + /** * * @@ -554,23 +547,12 @@ public Builder setLongitude(double value) { * @return This builder for chaining. */ public Builder clearLongitude() { - + bitField0_ = (bitField0_ & ~0x00000002); longitude_ = 0D; onChanged(); return this; } - @java.lang.Override - public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - // @@protoc_insertion_point(builder_scope:google.type.LatLng) } diff --git a/java-common-protos/proto-google-common-protos/src/main/java/com/google/type/LatLngOrBuilder.java b/java-common-protos/proto-google-common-protos/src/main/java/com/google/type/LatLngOrBuilder.java index 978f42810e..e0a830d0f9 100644 --- a/java-common-protos/proto-google-common-protos/src/main/java/com/google/type/LatLngOrBuilder.java +++ b/java-common-protos/proto-google-common-protos/src/main/java/com/google/type/LatLngOrBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,10 +14,13 @@ * limitations under the License. */ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: google/type/latlng.proto +// Protobuf Java Version: 4.33.2 package com.google.type; +@com.google.protobuf.Generated public interface LatLngOrBuilder extends // @@protoc_insertion_point(interface_extends:google.type.LatLng) diff --git a/java-common-protos/proto-google-common-protos/src/main/java/com/google/type/LatLngProto.java b/java-common-protos/proto-google-common-protos/src/main/java/com/google/type/LatLngProto.java index 5302d9e746..e0b02c31f7 100644 --- a/java-common-protos/proto-google-common-protos/src/main/java/com/google/type/LatLngProto.java +++ b/java-common-protos/proto-google-common-protos/src/main/java/com/google/type/LatLngProto.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,13 +14,26 @@ * limitations under the License. */ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: google/type/latlng.proto +// Protobuf Java Version: 4.33.2 package com.google.type; -public final class LatLngProto { +@com.google.protobuf.Generated +public final class LatLngProto extends com.google.protobuf.GeneratedFile { private LatLngProto() {} + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "LatLngProto"); + } + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistryLite registry) {} public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry registry) { @@ -29,7 +42,7 @@ public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry r static final com.google.protobuf.Descriptors.Descriptor internal_static_google_type_LatLng_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable internal_static_google_type_LatLng_fieldAccessorTable; public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { @@ -49,13 +62,14 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { descriptor = com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( descriptorData, new com.google.protobuf.Descriptors.FileDescriptor[] {}); - internal_static_google_type_LatLng_descriptor = getDescriptor().getMessageTypes().get(0); + internal_static_google_type_LatLng_descriptor = getDescriptor().getMessageType(0); internal_static_google_type_LatLng_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_google_type_LatLng_descriptor, new java.lang.String[] { "Latitude", "Longitude", }); + descriptor.resolveAllFeaturesImmutable(); } // @@protoc_insertion_point(outer_class_scope) diff --git a/java-common-protos/proto-google-common-protos/src/main/java/com/google/type/LocalizedText.java b/java-common-protos/proto-google-common-protos/src/main/java/com/google/type/LocalizedText.java index 9cc41509dc..677c731de9 100644 --- a/java-common-protos/proto-google-common-protos/src/main/java/com/google/type/LocalizedText.java +++ b/java-common-protos/proto-google-common-protos/src/main/java/com/google/type/LocalizedText.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,9 @@ * limitations under the License. */ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: google/type/localized_text.proto +// Protobuf Java Version: 4.33.2 package com.google.type; @@ -27,13 +29,25 @@ * * Protobuf type {@code google.type.LocalizedText} */ -public final class LocalizedText extends com.google.protobuf.GeneratedMessageV3 +@com.google.protobuf.Generated +public final class LocalizedText extends com.google.protobuf.GeneratedMessage implements // @@protoc_insertion_point(message_implements:google.type.LocalizedText) LocalizedTextOrBuilder { private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "LocalizedText"); + } + // Use LocalizedText.newBuilder() to construct. - private LocalizedText(com.google.protobuf.GeneratedMessageV3.Builder builder) { + private LocalizedText(com.google.protobuf.GeneratedMessage.Builder builder) { super(builder); } @@ -42,23 +56,12 @@ private LocalizedText() { languageCode_ = ""; } - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new LocalizedText(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.type.LocalizedTextProto.internal_static_google_type_LocalizedText_descriptor; } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.type.LocalizedTextProto .internal_static_google_type_LocalizedText_fieldAccessorTable @@ -67,7 +70,10 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } public static final int TEXT_FIELD_NUMBER = 1; - private volatile java.lang.Object text_; + + @SuppressWarnings("serial") + private volatile java.lang.Object text_ = ""; + /** * * @@ -91,6 +97,7 @@ public java.lang.String getText() { return s; } } + /** * * @@ -116,12 +123,16 @@ public com.google.protobuf.ByteString getTextBytes() { } public static final int LANGUAGE_CODE_FIELD_NUMBER = 2; - private volatile java.lang.Object languageCode_; + + @SuppressWarnings("serial") + private volatile java.lang.Object languageCode_ = ""; + /** * * *
            * The text's BCP-47 language code, such as "en-US" or "sr-Latn".
        +   *
            * For more information, see
            * http://www.unicode.org/reports/tr35/#Unicode_locale_identifier.
            * 
        @@ -142,11 +153,13 @@ public java.lang.String getLanguageCode() { return s; } } + /** * * *
            * The text's BCP-47 language code, such as "en-US" or "sr-Latn".
        +   *
            * For more information, see
            * http://www.unicode.org/reports/tr35/#Unicode_locale_identifier.
            * 
        @@ -182,11 +195,11 @@ public final boolean isInitialized() { @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(text_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, text_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(text_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, text_); } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(languageCode_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 2, languageCode_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(languageCode_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, languageCode_); } getUnknownFields().writeTo(output); } @@ -197,11 +210,11 @@ public int getSerializedSize() { if (size != -1) return size; size = 0; - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(text_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, text_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(text_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, text_); } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(languageCode_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, languageCode_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(languageCode_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, languageCode_); } size += getUnknownFields().getSerializedSize(); memoizedSize = size; @@ -276,38 +289,38 @@ public static com.google.type.LocalizedText parseFrom( public static com.google.type.LocalizedText parseFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); } public static com.google.type.LocalizedText parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } public static com.google.type.LocalizedText parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); } public static com.google.type.LocalizedText parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( PARSER, input, extensionRegistry); } public static com.google.type.LocalizedText parseFrom(com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); } public static com.google.type.LocalizedText parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } @@ -330,10 +343,11 @@ public Builder toBuilder() { } @java.lang.Override - protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { Builder builder = new Builder(parent); return builder; } + /** * * @@ -343,7 +357,7 @@ protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.Build * * Protobuf type {@code google.type.LocalizedText} */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder implements // @@protoc_insertion_point(builder_implements:google.type.LocalizedText) com.google.type.LocalizedTextOrBuilder { @@ -353,7 +367,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.type.LocalizedTextProto .internal_static_google_type_LocalizedText_fieldAccessorTable @@ -364,17 +378,16 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { // Construct using com.google.type.LocalizedText.newBuilder() private Builder() {} - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { super(parent); } @java.lang.Override public Builder clear() { super.clear(); + bitField0_ = 0; text_ = ""; - languageCode_ = ""; - return this; } @@ -401,43 +414,21 @@ public com.google.type.LocalizedText build() { @java.lang.Override public com.google.type.LocalizedText buildPartial() { com.google.type.LocalizedText result = new com.google.type.LocalizedText(this); - result.text_ = text_; - result.languageCode_ = languageCode_; + if (bitField0_ != 0) { + buildPartial0(result); + } 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); + private void buildPartial0(com.google.type.LocalizedText result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.text_ = text_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.languageCode_ = languageCode_; + } } @java.lang.Override @@ -454,10 +445,12 @@ public Builder mergeFrom(com.google.type.LocalizedText other) { if (other == com.google.type.LocalizedText.getDefaultInstance()) return this; if (!other.getText().isEmpty()) { text_ = other.text_; + bitField0_ |= 0x00000001; onChanged(); } if (!other.getLanguageCode().isEmpty()) { languageCode_ = other.languageCode_; + bitField0_ |= 0x00000002; onChanged(); } this.mergeUnknownFields(other.getUnknownFields()); @@ -489,13 +482,13 @@ public Builder mergeFrom( case 10: { text_ = input.readStringRequireUtf8(); - + bitField0_ |= 0x00000001; break; } // case 10 case 18: { languageCode_ = input.readStringRequireUtf8(); - + bitField0_ |= 0x00000002; break; } // case 18 default: @@ -515,7 +508,10 @@ public Builder mergeFrom( return this; } + private int bitField0_; + private java.lang.Object text_ = ""; + /** * * @@ -538,6 +534,7 @@ public java.lang.String getText() { return (java.lang.String) ref; } } + /** * * @@ -560,6 +557,7 @@ public com.google.protobuf.ByteString getTextBytes() { return (com.google.protobuf.ByteString) ref; } } + /** * * @@ -576,11 +574,12 @@ public Builder setText(java.lang.String value) { if (value == null) { throw new NullPointerException(); } - text_ = value; + bitField0_ |= 0x00000001; onChanged(); return this; } + /** * * @@ -593,11 +592,12 @@ public Builder setText(java.lang.String value) { * @return This builder for chaining. */ public Builder clearText() { - text_ = getDefaultInstance().getText(); + bitField0_ = (bitField0_ & ~0x00000001); onChanged(); return this; } + /** * * @@ -615,18 +615,20 @@ public Builder setTextBytes(com.google.protobuf.ByteString value) { throw new NullPointerException(); } checkByteStringIsUtf8(value); - text_ = value; + bitField0_ |= 0x00000001; onChanged(); return this; } private java.lang.Object languageCode_ = ""; + /** * * *
              * The text's BCP-47 language code, such as "en-US" or "sr-Latn".
        +     *
              * For more information, see
              * http://www.unicode.org/reports/tr35/#Unicode_locale_identifier.
              * 
        @@ -646,11 +648,13 @@ public java.lang.String getLanguageCode() { return (java.lang.String) ref; } } + /** * * *
              * The text's BCP-47 language code, such as "en-US" or "sr-Latn".
        +     *
              * For more information, see
              * http://www.unicode.org/reports/tr35/#Unicode_locale_identifier.
              * 
        @@ -670,11 +674,13 @@ public com.google.protobuf.ByteString getLanguageCodeBytes() { return (com.google.protobuf.ByteString) ref; } } + /** * * *
              * The text's BCP-47 language code, such as "en-US" or "sr-Latn".
        +     *
              * For more information, see
              * http://www.unicode.org/reports/tr35/#Unicode_locale_identifier.
              * 
        @@ -688,16 +694,18 @@ public Builder setLanguageCode(java.lang.String value) { if (value == null) { throw new NullPointerException(); } - languageCode_ = value; + bitField0_ |= 0x00000002; onChanged(); return this; } + /** * * *
              * The text's BCP-47 language code, such as "en-US" or "sr-Latn".
        +     *
              * For more information, see
              * http://www.unicode.org/reports/tr35/#Unicode_locale_identifier.
              * 
        @@ -707,16 +715,18 @@ public Builder setLanguageCode(java.lang.String value) { * @return This builder for chaining. */ public Builder clearLanguageCode() { - languageCode_ = getDefaultInstance().getLanguageCode(); + bitField0_ = (bitField0_ & ~0x00000002); onChanged(); return this; } + /** * * *
              * The text's BCP-47 language code, such as "en-US" or "sr-Latn".
        +     *
              * For more information, see
              * http://www.unicode.org/reports/tr35/#Unicode_locale_identifier.
              * 
        @@ -731,23 +741,12 @@ public Builder setLanguageCodeBytes(com.google.protobuf.ByteString value) { throw new NullPointerException(); } checkByteStringIsUtf8(value); - languageCode_ = 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.type.LocalizedText) } diff --git a/java-common-protos/proto-google-common-protos/src/main/java/com/google/type/LocalizedTextOrBuilder.java b/java-common-protos/proto-google-common-protos/src/main/java/com/google/type/LocalizedTextOrBuilder.java index c103886996..4260bcd2d7 100644 --- a/java-common-protos/proto-google-common-protos/src/main/java/com/google/type/LocalizedTextOrBuilder.java +++ b/java-common-protos/proto-google-common-protos/src/main/java/com/google/type/LocalizedTextOrBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,10 +14,13 @@ * limitations under the License. */ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: google/type/localized_text.proto +// Protobuf Java Version: 4.33.2 package com.google.type; +@com.google.protobuf.Generated public interface LocalizedTextOrBuilder extends // @@protoc_insertion_point(interface_extends:google.type.LocalizedText) @@ -35,6 +38,7 @@ public interface LocalizedTextOrBuilder * @return The text. */ java.lang.String getText(); + /** * * @@ -53,6 +57,7 @@ public interface LocalizedTextOrBuilder * *
            * The text's BCP-47 language code, such as "en-US" or "sr-Latn".
        +   *
            * For more information, see
            * http://www.unicode.org/reports/tr35/#Unicode_locale_identifier.
            * 
        @@ -62,11 +67,13 @@ public interface LocalizedTextOrBuilder * @return The languageCode. */ java.lang.String getLanguageCode(); + /** * * *
            * The text's BCP-47 language code, such as "en-US" or "sr-Latn".
        +   *
            * For more information, see
            * http://www.unicode.org/reports/tr35/#Unicode_locale_identifier.
            * 
        diff --git a/java-common-protos/proto-google-common-protos/src/main/java/com/google/type/LocalizedTextProto.java b/java-common-protos/proto-google-common-protos/src/main/java/com/google/type/LocalizedTextProto.java index 4d1559b6ae..7f3c40fbeb 100644 --- a/java-common-protos/proto-google-common-protos/src/main/java/com/google/type/LocalizedTextProto.java +++ b/java-common-protos/proto-google-common-protos/src/main/java/com/google/type/LocalizedTextProto.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,13 +14,26 @@ * limitations under the License. */ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: google/type/localized_text.proto +// Protobuf Java Version: 4.33.2 package com.google.type; -public final class LocalizedTextProto { +@com.google.protobuf.Generated +public final class LocalizedTextProto extends com.google.protobuf.GeneratedFile { private LocalizedTextProto() {} + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "LocalizedTextProto"); + } + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistryLite registry) {} public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry registry) { @@ -29,7 +42,7 @@ public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry r static final com.google.protobuf.Descriptors.Descriptor internal_static_google_type_LocalizedText_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable internal_static_google_type_LocalizedText_fieldAccessorTable; public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { @@ -50,13 +63,14 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { descriptor = com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( descriptorData, new com.google.protobuf.Descriptors.FileDescriptor[] {}); - internal_static_google_type_LocalizedText_descriptor = getDescriptor().getMessageTypes().get(0); + internal_static_google_type_LocalizedText_descriptor = getDescriptor().getMessageType(0); internal_static_google_type_LocalizedText_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_google_type_LocalizedText_descriptor, new java.lang.String[] { "Text", "LanguageCode", }); + descriptor.resolveAllFeaturesImmutable(); } // @@protoc_insertion_point(outer_class_scope) diff --git a/java-common-protos/proto-google-common-protos/src/main/java/com/google/type/Money.java b/java-common-protos/proto-google-common-protos/src/main/java/com/google/type/Money.java index b8d63fdab2..d8b13d2eca 100644 --- a/java-common-protos/proto-google-common-protos/src/main/java/com/google/type/Money.java +++ b/java-common-protos/proto-google-common-protos/src/main/java/com/google/type/Money.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,9 @@ * limitations under the License. */ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: google/type/money.proto +// Protobuf Java Version: 4.33.2 package com.google.type; @@ -27,13 +29,25 @@ * * Protobuf type {@code google.type.Money} */ -public final class Money extends com.google.protobuf.GeneratedMessageV3 +@com.google.protobuf.Generated +public final class Money extends com.google.protobuf.GeneratedMessage implements // @@protoc_insertion_point(message_implements:google.type.Money) MoneyOrBuilder { private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "Money"); + } + // Use Money.newBuilder() to construct. - private Money(com.google.protobuf.GeneratedMessageV3.Builder builder) { + private Money(com.google.protobuf.GeneratedMessage.Builder builder) { super(builder); } @@ -41,23 +55,12 @@ private Money() { currencyCode_ = ""; } - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new Money(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.type.MoneyProto.internal_static_google_type_Money_descriptor; } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.type.MoneyProto.internal_static_google_type_Money_fieldAccessorTable .ensureFieldAccessorsInitialized( @@ -65,7 +68,10 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } public static final int CURRENCY_CODE_FIELD_NUMBER = 1; - private volatile java.lang.Object currencyCode_; + + @SuppressWarnings("serial") + private volatile java.lang.Object currencyCode_ = ""; + /** * * @@ -89,6 +95,7 @@ public java.lang.String getCurrencyCode() { return s; } } + /** * * @@ -114,7 +121,8 @@ public com.google.protobuf.ByteString getCurrencyCodeBytes() { } public static final int UNITS_FIELD_NUMBER = 2; - private long units_; + private long units_ = 0L; + /** * * @@ -133,7 +141,8 @@ public long getUnits() { } public static final int NANOS_FIELD_NUMBER = 3; - private int nanos_; + private int nanos_ = 0; + /** * * @@ -169,8 +178,8 @@ public final boolean isInitialized() { @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(currencyCode_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, currencyCode_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(currencyCode_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, currencyCode_); } if (units_ != 0L) { output.writeInt64(2, units_); @@ -187,8 +196,8 @@ public int getSerializedSize() { if (size != -1) return size; size = 0; - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(currencyCode_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, currencyCode_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(currencyCode_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, currencyCode_); } if (units_ != 0L) { size += com.google.protobuf.CodedOutputStream.computeInt64Size(2, units_); @@ -272,38 +281,38 @@ public static com.google.type.Money parseFrom( public static com.google.type.Money parseFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); } public static com.google.type.Money parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } public static com.google.type.Money parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); } public static com.google.type.Money parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( PARSER, input, extensionRegistry); } public static com.google.type.Money parseFrom(com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); } public static com.google.type.Money parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } @@ -326,10 +335,11 @@ public Builder toBuilder() { } @java.lang.Override - protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { Builder builder = new Builder(parent); return builder; } + /** * * @@ -339,7 +349,7 @@ protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.Build * * Protobuf type {@code google.type.Money} */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder implements // @@protoc_insertion_point(builder_implements:google.type.Money) com.google.type.MoneyOrBuilder { @@ -348,7 +358,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.type.MoneyProto.internal_static_google_type_Money_fieldAccessorTable .ensureFieldAccessorsInitialized( @@ -358,19 +368,17 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { // Construct using com.google.type.Money.newBuilder() private Builder() {} - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { super(parent); } @java.lang.Override public Builder clear() { super.clear(); + bitField0_ = 0; currencyCode_ = ""; - units_ = 0L; - nanos_ = 0; - return this; } @@ -396,44 +404,24 @@ public com.google.type.Money build() { @java.lang.Override public com.google.type.Money buildPartial() { com.google.type.Money result = new com.google.type.Money(this); - result.currencyCode_ = currencyCode_; - result.units_ = units_; - result.nanos_ = nanos_; + if (bitField0_ != 0) { + buildPartial0(result); + } 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); + private void buildPartial0(com.google.type.Money result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.currencyCode_ = currencyCode_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.units_ = units_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.nanos_ = nanos_; + } } @java.lang.Override @@ -450,6 +438,7 @@ public Builder mergeFrom(com.google.type.Money other) { if (other == com.google.type.Money.getDefaultInstance()) return this; if (!other.getCurrencyCode().isEmpty()) { currencyCode_ = other.currencyCode_; + bitField0_ |= 0x00000001; onChanged(); } if (other.getUnits() != 0L) { @@ -487,19 +476,19 @@ public Builder mergeFrom( case 10: { currencyCode_ = input.readStringRequireUtf8(); - + bitField0_ |= 0x00000001; break; } // case 10 case 16: { units_ = input.readInt64(); - + bitField0_ |= 0x00000002; break; } // case 16 case 24: { nanos_ = input.readInt32(); - + bitField0_ |= 0x00000004; break; } // case 24 default: @@ -519,7 +508,10 @@ public Builder mergeFrom( return this; } + private int bitField0_; + private java.lang.Object currencyCode_ = ""; + /** * * @@ -542,6 +534,7 @@ public java.lang.String getCurrencyCode() { return (java.lang.String) ref; } } + /** * * @@ -564,6 +557,7 @@ public com.google.protobuf.ByteString getCurrencyCodeBytes() { return (com.google.protobuf.ByteString) ref; } } + /** * * @@ -580,11 +574,12 @@ public Builder setCurrencyCode(java.lang.String value) { if (value == null) { throw new NullPointerException(); } - currencyCode_ = value; + bitField0_ |= 0x00000001; onChanged(); return this; } + /** * * @@ -597,11 +592,12 @@ public Builder setCurrencyCode(java.lang.String value) { * @return This builder for chaining. */ public Builder clearCurrencyCode() { - currencyCode_ = getDefaultInstance().getCurrencyCode(); + bitField0_ = (bitField0_ & ~0x00000001); onChanged(); return this; } + /** * * @@ -619,13 +615,14 @@ public Builder setCurrencyCodeBytes(com.google.protobuf.ByteString value) { throw new NullPointerException(); } checkByteStringIsUtf8(value); - currencyCode_ = value; + bitField0_ |= 0x00000001; onChanged(); return this; } private long units_; + /** * * @@ -642,6 +639,7 @@ public Builder setCurrencyCodeBytes(com.google.protobuf.ByteString value) { public long getUnits() { return units_; } + /** * * @@ -658,9 +656,11 @@ public long getUnits() { public Builder setUnits(long value) { units_ = value; + bitField0_ |= 0x00000002; onChanged(); return this; } + /** * * @@ -674,13 +674,14 @@ public Builder setUnits(long value) { * @return This builder for chaining. */ public Builder clearUnits() { - + bitField0_ = (bitField0_ & ~0x00000002); units_ = 0L; onChanged(); return this; } private int nanos_; + /** * * @@ -701,6 +702,7 @@ public Builder clearUnits() { public int getNanos() { return nanos_; } + /** * * @@ -721,9 +723,11 @@ public int getNanos() { public Builder setNanos(int value) { nanos_ = value; + bitField0_ |= 0x00000004; onChanged(); return this; } + /** * * @@ -741,23 +745,12 @@ public Builder setNanos(int value) { * @return This builder for chaining. */ public Builder clearNanos() { - + bitField0_ = (bitField0_ & ~0x00000004); nanos_ = 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.type.Money) } diff --git a/java-common-protos/proto-google-common-protos/src/main/java/com/google/type/MoneyOrBuilder.java b/java-common-protos/proto-google-common-protos/src/main/java/com/google/type/MoneyOrBuilder.java index 4495acb93a..78f2b061a1 100644 --- a/java-common-protos/proto-google-common-protos/src/main/java/com/google/type/MoneyOrBuilder.java +++ b/java-common-protos/proto-google-common-protos/src/main/java/com/google/type/MoneyOrBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,10 +14,13 @@ * limitations under the License. */ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: google/type/money.proto +// Protobuf Java Version: 4.33.2 package com.google.type; +@com.google.protobuf.Generated public interface MoneyOrBuilder extends // @@protoc_insertion_point(interface_extends:google.type.Money) @@ -35,6 +38,7 @@ public interface MoneyOrBuilder * @return The currencyCode. */ java.lang.String getCurrencyCode(); + /** * * diff --git a/java-common-protos/proto-google-common-protos/src/main/java/com/google/type/MoneyProto.java b/java-common-protos/proto-google-common-protos/src/main/java/com/google/type/MoneyProto.java index d6d549e9ef..74101e52eb 100644 --- a/java-common-protos/proto-google-common-protos/src/main/java/com/google/type/MoneyProto.java +++ b/java-common-protos/proto-google-common-protos/src/main/java/com/google/type/MoneyProto.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,13 +14,26 @@ * limitations under the License. */ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: google/type/money.proto +// Protobuf Java Version: 4.33.2 package com.google.type; -public final class MoneyProto { +@com.google.protobuf.Generated +public final class MoneyProto extends com.google.protobuf.GeneratedFile { private MoneyProto() {} + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "MoneyProto"); + } + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistryLite registry) {} public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry registry) { @@ -29,7 +42,7 @@ public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry r static final com.google.protobuf.Descriptors.Descriptor internal_static_google_type_Money_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable internal_static_google_type_Money_fieldAccessorTable; public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { @@ -50,13 +63,14 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { descriptor = com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( descriptorData, new com.google.protobuf.Descriptors.FileDescriptor[] {}); - internal_static_google_type_Money_descriptor = getDescriptor().getMessageTypes().get(0); + internal_static_google_type_Money_descriptor = getDescriptor().getMessageType(0); internal_static_google_type_Money_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_google_type_Money_descriptor, new java.lang.String[] { "CurrencyCode", "Units", "Nanos", }); + descriptor.resolveAllFeaturesImmutable(); } // @@protoc_insertion_point(outer_class_scope) diff --git a/java-common-protos/proto-google-common-protos/src/main/java/com/google/type/Month.java b/java-common-protos/proto-google-common-protos/src/main/java/com/google/type/Month.java index 07bb37a9de..832ec0e2ca 100644 --- a/java-common-protos/proto-google-common-protos/src/main/java/com/google/type/Month.java +++ b/java-common-protos/proto-google-common-protos/src/main/java/com/google/type/Month.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,9 @@ * limitations under the License. */ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: google/type/month.proto +// Protobuf Java Version: 4.33.2 package com.google.type; @@ -27,6 +29,7 @@ * * Protobuf enum {@code google.type.Month} */ +@com.google.protobuf.Generated public enum Month implements com.google.protobuf.ProtocolMessageEnum { /** * @@ -161,6 +164,16 @@ public enum Month implements com.google.protobuf.ProtocolMessageEnum { UNRECOGNIZED(-1), ; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "Month"); + } + /** * * @@ -171,6 +184,7 @@ public enum Month implements com.google.protobuf.ProtocolMessageEnum { * MONTH_UNSPECIFIED = 0; */ public static final int MONTH_UNSPECIFIED_VALUE = 0; + /** * * @@ -181,6 +195,7 @@ public enum Month implements com.google.protobuf.ProtocolMessageEnum { * JANUARY = 1; */ public static final int JANUARY_VALUE = 1; + /** * * @@ -191,6 +206,7 @@ public enum Month implements com.google.protobuf.ProtocolMessageEnum { * FEBRUARY = 2; */ public static final int FEBRUARY_VALUE = 2; + /** * * @@ -201,6 +217,7 @@ public enum Month implements com.google.protobuf.ProtocolMessageEnum { * MARCH = 3; */ public static final int MARCH_VALUE = 3; + /** * * @@ -211,6 +228,7 @@ public enum Month implements com.google.protobuf.ProtocolMessageEnum { * APRIL = 4; */ public static final int APRIL_VALUE = 4; + /** * * @@ -221,6 +239,7 @@ public enum Month implements com.google.protobuf.ProtocolMessageEnum { * MAY = 5; */ public static final int MAY_VALUE = 5; + /** * * @@ -231,6 +250,7 @@ public enum Month implements com.google.protobuf.ProtocolMessageEnum { * JUNE = 6; */ public static final int JUNE_VALUE = 6; + /** * * @@ -241,6 +261,7 @@ public enum Month implements com.google.protobuf.ProtocolMessageEnum { * JULY = 7; */ public static final int JULY_VALUE = 7; + /** * * @@ -251,6 +272,7 @@ public enum Month implements com.google.protobuf.ProtocolMessageEnum { * AUGUST = 8; */ public static final int AUGUST_VALUE = 8; + /** * * @@ -261,6 +283,7 @@ public enum Month implements com.google.protobuf.ProtocolMessageEnum { * SEPTEMBER = 9; */ public static final int SEPTEMBER_VALUE = 9; + /** * * @@ -271,6 +294,7 @@ public enum Month implements com.google.protobuf.ProtocolMessageEnum { * OCTOBER = 10; */ public static final int OCTOBER_VALUE = 10; + /** * * @@ -281,6 +305,7 @@ public enum Month implements com.google.protobuf.ProtocolMessageEnum { * NOVEMBER = 11; */ public static final int NOVEMBER_VALUE = 11; + /** * * @@ -370,7 +395,7 @@ public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType return getDescriptor(); } - public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + public static com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { return com.google.type.MonthProto.getDescriptor().getEnumTypes().get(0); } diff --git a/java-common-protos/proto-google-common-protos/src/main/java/com/google/type/MonthProto.java b/java-common-protos/proto-google-common-protos/src/main/java/com/google/type/MonthProto.java index bfe5ee28ba..a17aa6385a 100644 --- a/java-common-protos/proto-google-common-protos/src/main/java/com/google/type/MonthProto.java +++ b/java-common-protos/proto-google-common-protos/src/main/java/com/google/type/MonthProto.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,13 +14,26 @@ * limitations under the License. */ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: google/type/month.proto +// Protobuf Java Version: 4.33.2 package com.google.type; -public final class MonthProto { +@com.google.protobuf.Generated +public final class MonthProto extends com.google.protobuf.GeneratedFile { private MonthProto() {} + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "MonthProto"); + } + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistryLite registry) {} public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry registry) { @@ -35,18 +48,31 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { static { java.lang.String[] descriptorData = { - "\n\027google/type/month.proto\022\013google.type*\260" - + "\001\n\005Month\022\025\n\021MONTH_UNSPECIFIED\020\000\022\013\n\007JANUA" - + "RY\020\001\022\014\n\010FEBRUARY\020\002\022\t\n\005MARCH\020\003\022\t\n\005APRIL\020\004" - + "\022\007\n\003MAY\020\005\022\010\n\004JUNE\020\006\022\010\n\004JULY\020\007\022\n\n\006AUGUST\020" - + "\010\022\r\n\tSEPTEMBER\020\t\022\013\n\007OCTOBER\020\n\022\014\n\010NOVEMBE" - + "R\020\013\022\014\n\010DECEMBER\020\014B]\n\017com.google.typeB\nMo" - + "nthProtoP\001Z6google.golang.org/genproto/g" + "\n" + + "\027google/type/month.proto\022\013google.type*\260\001\n" + + "\005Month\022\025\n" + + "\021MONTH_UNSPECIFIED\020\000\022\013\n" + + "\007JANUARY\020\001\022\014\n" + + "\010FEBRUARY\020\002\022\t\n" + + "\005MARCH\020\003\022\t\n" + + "\005APRIL\020\004\022\007\n" + + "\003MAY\020\005\022\010\n" + + "\004JUNE\020\006\022\010\n" + + "\004JULY\020\007\022\n\n" + + "\006AUGUST\020\010\022\r\n" + + "\tSEPTEMBER\020\t\022\013\n" + + "\007OCTOBER\020\n" + + "\022\014\n" + + "\010NOVEMBER\020\013\022\014\n" + + "\010DECEMBER\020\014B]\n" + + "\017com.google.typeB\n" + + "MonthProtoP\001Z6google.golang.org/genproto/g" + "oogleapis/type/month;month\242\002\003GTPb\006proto3" }; descriptor = com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( descriptorData, new com.google.protobuf.Descriptors.FileDescriptor[] {}); + descriptor.resolveAllFeaturesImmutable(); } // @@protoc_insertion_point(outer_class_scope) diff --git a/java-common-protos/proto-google-common-protos/src/main/java/com/google/type/PhoneNumber.java b/java-common-protos/proto-google-common-protos/src/main/java/com/google/type/PhoneNumber.java index 0c98c60dba..ae69972c2d 100644 --- a/java-common-protos/proto-google-common-protos/src/main/java/com/google/type/PhoneNumber.java +++ b/java-common-protos/proto-google-common-protos/src/main/java/com/google/type/PhoneNumber.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,9 @@ * limitations under the License. */ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: google/type/phone_number.proto +// Protobuf Java Version: 4.33.2 package com.google.type; @@ -23,35 +25,54 @@ * *
          * An object representing a phone number, suitable as an API wire format.
        + *
          * This representation:
        - *  - should not be used for locale-specific formatting of a phone number, such
        - *    as "+1 (650) 253-0000 ext. 123"
        - *  - is not designed for efficient storage
        - *  - may not be suitable for dialing - specialized libraries (see references)
        - *    should be used to parse the number for that purpose
        + *
        + * - should not be used for locale-specific formatting of a phone number, such
        + * as "+1 (650) 253-0000 ext. 123"
        + *
        + * - is not designed for efficient storage
        + * - may not be suitable for dialing - specialized libraries (see references)
        + * should be used to parse the number for that purpose
        + *
          * To do something meaningful with this number, such as format it for various
          * use-cases, convert it to an `i18n.phonenumbers.PhoneNumber` object first.
        + *
          * For instance, in Java this would be:
        - *    com.google.type.PhoneNumber wireProto =
        - *        com.google.type.PhoneNumber.newBuilder().build();
        - *    com.google.i18n.phonenumbers.Phonenumber.PhoneNumber phoneNumber =
        - *        PhoneNumberUtil.getInstance().parse(wireProto.getE164Number(), "ZZ");
        - *    if (!wireProto.getExtension().isEmpty()) {
        - *      phoneNumber.setExtension(wireProto.getExtension());
        - *    }
        - *  Reference(s):
        - *   - https://github.com/google/libphonenumber
        + *
        + * com.google.type.PhoneNumber wireProto =
        + * com.google.type.PhoneNumber.newBuilder().build();
        + * com.google.i18n.phonenumbers.Phonenumber.PhoneNumber phoneNumber =
        + * PhoneNumberUtil.getInstance().parse(wireProto.getE164Number(), "ZZ");
        + * if (!wireProto.getExtension().isEmpty()) {
        + * phoneNumber.setExtension(wireProto.getExtension());
        + * }
        + *
        + * Reference(s):
        + * - https://github.com/google/libphonenumber
          * 
        * * Protobuf type {@code google.type.PhoneNumber} */ -public final class PhoneNumber extends com.google.protobuf.GeneratedMessageV3 +@com.google.protobuf.Generated +public final class PhoneNumber extends com.google.protobuf.GeneratedMessage implements // @@protoc_insertion_point(message_implements:google.type.PhoneNumber) PhoneNumberOrBuilder { private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "PhoneNumber"); + } + // Use PhoneNumber.newBuilder() to construct. - private PhoneNumber(com.google.protobuf.GeneratedMessageV3.Builder builder) { + private PhoneNumber(com.google.protobuf.GeneratedMessage.Builder builder) { super(builder); } @@ -59,23 +80,12 @@ private PhoneNumber() { extension_ = ""; } - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new PhoneNumber(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.type.PhoneNumberProto.internal_static_google_type_PhoneNumber_descriptor; } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.type.PhoneNumberProto .internal_static_google_type_PhoneNumber_fieldAccessorTable @@ -94,8 +104,9 @@ public interface ShortCodeOrBuilder *
              * Required. The BCP-47 region code of the location where calls to this
              * short code can be made, such as "US" and "BB".
        +     *
              * Reference(s):
        -     *  - http://www.unicode.org/reports/tr35/#unicode_region_subtag
        +     * - http://www.unicode.org/reports/tr35/#unicode_region_subtag
              * 
        * * string region_code = 1; @@ -103,14 +114,16 @@ public interface ShortCodeOrBuilder * @return The regionCode. */ java.lang.String getRegionCode(); + /** * * *
              * Required. The BCP-47 region code of the location where calls to this
              * short code can be made, such as "US" and "BB".
        +     *
              * Reference(s):
        -     *  - http://www.unicode.org/reports/tr35/#unicode_region_subtag
        +     * - http://www.unicode.org/reports/tr35/#unicode_region_subtag
              * 
        * * string region_code = 1; @@ -132,6 +145,7 @@ public interface ShortCodeOrBuilder * @return The number. */ java.lang.String getNumber(); + /** * * @@ -146,6 +160,7 @@ public interface ShortCodeOrBuilder */ com.google.protobuf.ByteString getNumberBytes(); } + /** * * @@ -154,6 +169,7 @@ public interface ShortCodeOrBuilder * typically much shorter than regular phone numbers and can be used to * address messages in MMS and SMS systems, as well as for abbreviated dialing * (e.g. "Text 611 to see how many minutes you have remaining on your plan."). + * * Short codes are restricted to a region and are not internationally * dialable, which means the same short code can exist in different regions, * with different usage and pricing, even if those regions share the same @@ -162,13 +178,24 @@ public interface ShortCodeOrBuilder * * Protobuf type {@code google.type.PhoneNumber.ShortCode} */ - public static final class ShortCode extends com.google.protobuf.GeneratedMessageV3 + public static final class ShortCode extends com.google.protobuf.GeneratedMessage implements // @@protoc_insertion_point(message_implements:google.type.PhoneNumber.ShortCode) ShortCodeOrBuilder { private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "ShortCode"); + } + // Use ShortCode.newBuilder() to construct. - private ShortCode(com.google.protobuf.GeneratedMessageV3.Builder builder) { + private ShortCode(com.google.protobuf.GeneratedMessage.Builder builder) { super(builder); } @@ -177,24 +204,13 @@ private ShortCode() { number_ = ""; } - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new ShortCode(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.type.PhoneNumberProto .internal_static_google_type_PhoneNumber_ShortCode_descriptor; } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.type.PhoneNumberProto .internal_static_google_type_PhoneNumber_ShortCode_fieldAccessorTable @@ -204,15 +220,19 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } public static final int REGION_CODE_FIELD_NUMBER = 1; - private volatile java.lang.Object regionCode_; + + @SuppressWarnings("serial") + private volatile java.lang.Object regionCode_ = ""; + /** * * *
              * Required. The BCP-47 region code of the location where calls to this
              * short code can be made, such as "US" and "BB".
        +     *
              * Reference(s):
        -     *  - http://www.unicode.org/reports/tr35/#unicode_region_subtag
        +     * - http://www.unicode.org/reports/tr35/#unicode_region_subtag
              * 
        * * string region_code = 1; @@ -231,14 +251,16 @@ public java.lang.String getRegionCode() { return s; } } + /** * * *
              * Required. The BCP-47 region code of the location where calls to this
              * short code can be made, such as "US" and "BB".
        +     *
              * Reference(s):
        -     *  - http://www.unicode.org/reports/tr35/#unicode_region_subtag
        +     * - http://www.unicode.org/reports/tr35/#unicode_region_subtag
              * 
        * * string region_code = 1; @@ -259,7 +281,10 @@ public com.google.protobuf.ByteString getRegionCodeBytes() { } public static final int NUMBER_FIELD_NUMBER = 2; - private volatile java.lang.Object number_; + + @SuppressWarnings("serial") + private volatile java.lang.Object number_ = ""; + /** * * @@ -284,6 +309,7 @@ public java.lang.String getNumber() { return s; } } + /** * * @@ -323,11 +349,11 @@ public final boolean isInitialized() { @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(regionCode_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, regionCode_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(regionCode_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, regionCode_); } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(number_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 2, number_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(number_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, number_); } getUnknownFields().writeTo(output); } @@ -338,11 +364,11 @@ public int getSerializedSize() { if (size != -1) return size; size = 0; - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(regionCode_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, regionCode_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(regionCode_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, regionCode_); } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(number_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, number_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(number_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, number_); } size += getUnknownFields().getSerializedSize(); memoizedSize = size; @@ -418,38 +444,38 @@ public static com.google.type.PhoneNumber.ShortCode parseFrom( public static com.google.type.PhoneNumber.ShortCode parseFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); } public static com.google.type.PhoneNumber.ShortCode parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } public static com.google.type.PhoneNumber.ShortCode parseDelimitedFrom( java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); } public static com.google.type.PhoneNumber.ShortCode parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( PARSER, input, extensionRegistry); } public static com.google.type.PhoneNumber.ShortCode parseFrom( com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); } public static com.google.type.PhoneNumber.ShortCode parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } @@ -472,11 +498,11 @@ public Builder toBuilder() { } @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { Builder builder = new Builder(parent); return builder; } + /** * * @@ -485,6 +511,7 @@ protected Builder newBuilderForType( * typically much shorter than regular phone numbers and can be used to * address messages in MMS and SMS systems, as well as for abbreviated dialing * (e.g. "Text 611 to see how many minutes you have remaining on your plan."). + * * Short codes are restricted to a region and are not internationally * dialable, which means the same short code can exist in different regions, * with different usage and pricing, even if those regions share the same @@ -493,8 +520,7 @@ protected Builder newBuilderForType( * * Protobuf type {@code google.type.PhoneNumber.ShortCode} */ - public static final class Builder - extends com.google.protobuf.GeneratedMessageV3.Builder + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder implements // @@protoc_insertion_point(builder_implements:google.type.PhoneNumber.ShortCode) com.google.type.PhoneNumber.ShortCodeOrBuilder { @@ -504,7 +530,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.type.PhoneNumberProto .internal_static_google_type_PhoneNumber_ShortCode_fieldAccessorTable @@ -516,17 +542,16 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { // Construct using com.google.type.PhoneNumber.ShortCode.newBuilder() private Builder() {} - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { super(parent); } @java.lang.Override public Builder clear() { super.clear(); + bitField0_ = 0; regionCode_ = ""; - number_ = ""; - return this; } @@ -554,45 +579,21 @@ public com.google.type.PhoneNumber.ShortCode build() { public com.google.type.PhoneNumber.ShortCode buildPartial() { com.google.type.PhoneNumber.ShortCode result = new com.google.type.PhoneNumber.ShortCode(this); - result.regionCode_ = regionCode_; - result.number_ = number_; + if (bitField0_ != 0) { + buildPartial0(result); + } 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); + private void buildPartial0(com.google.type.PhoneNumber.ShortCode result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.regionCode_ = regionCode_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.number_ = number_; + } } @java.lang.Override @@ -609,10 +610,12 @@ public Builder mergeFrom(com.google.type.PhoneNumber.ShortCode other) { if (other == com.google.type.PhoneNumber.ShortCode.getDefaultInstance()) return this; if (!other.getRegionCode().isEmpty()) { regionCode_ = other.regionCode_; + bitField0_ |= 0x00000001; onChanged(); } if (!other.getNumber().isEmpty()) { number_ = other.number_; + bitField0_ |= 0x00000002; onChanged(); } this.mergeUnknownFields(other.getUnknownFields()); @@ -644,13 +647,13 @@ public Builder mergeFrom( case 10: { regionCode_ = input.readStringRequireUtf8(); - + bitField0_ |= 0x00000001; break; } // case 10 case 18: { number_ = input.readStringRequireUtf8(); - + bitField0_ |= 0x00000002; break; } // case 18 default: @@ -670,15 +673,19 @@ public Builder mergeFrom( return this; } + private int bitField0_; + private java.lang.Object regionCode_ = ""; + /** * * *
                * Required. The BCP-47 region code of the location where calls to this
                * short code can be made, such as "US" and "BB".
        +       *
                * Reference(s):
        -       *  - http://www.unicode.org/reports/tr35/#unicode_region_subtag
        +       * - http://www.unicode.org/reports/tr35/#unicode_region_subtag
                * 
        * * string region_code = 1; @@ -696,14 +703,16 @@ public java.lang.String getRegionCode() { return (java.lang.String) ref; } } + /** * * *
                * Required. The BCP-47 region code of the location where calls to this
                * short code can be made, such as "US" and "BB".
        +       *
                * Reference(s):
        -       *  - http://www.unicode.org/reports/tr35/#unicode_region_subtag
        +       * - http://www.unicode.org/reports/tr35/#unicode_region_subtag
                * 
        * * string region_code = 1; @@ -721,14 +730,16 @@ public com.google.protobuf.ByteString getRegionCodeBytes() { return (com.google.protobuf.ByteString) ref; } } + /** * * *
                * Required. The BCP-47 region code of the location where calls to this
                * short code can be made, such as "US" and "BB".
        +       *
                * Reference(s):
        -       *  - http://www.unicode.org/reports/tr35/#unicode_region_subtag
        +       * - http://www.unicode.org/reports/tr35/#unicode_region_subtag
                * 
        * * string region_code = 1; @@ -740,19 +751,21 @@ public Builder setRegionCode(java.lang.String value) { if (value == null) { throw new NullPointerException(); } - regionCode_ = value; + bitField0_ |= 0x00000001; onChanged(); return this; } + /** * * *
                * Required. The BCP-47 region code of the location where calls to this
                * short code can be made, such as "US" and "BB".
        +       *
                * Reference(s):
        -       *  - http://www.unicode.org/reports/tr35/#unicode_region_subtag
        +       * - http://www.unicode.org/reports/tr35/#unicode_region_subtag
                * 
        * * string region_code = 1; @@ -760,19 +773,21 @@ public Builder setRegionCode(java.lang.String value) { * @return This builder for chaining. */ public Builder clearRegionCode() { - regionCode_ = getDefaultInstance().getRegionCode(); + bitField0_ = (bitField0_ & ~0x00000001); onChanged(); return this; } + /** * * *
                * Required. The BCP-47 region code of the location where calls to this
                * short code can be made, such as "US" and "BB".
        +       *
                * Reference(s):
        -       *  - http://www.unicode.org/reports/tr35/#unicode_region_subtag
        +       * - http://www.unicode.org/reports/tr35/#unicode_region_subtag
                * 
        * * string region_code = 1; @@ -785,13 +800,14 @@ public Builder setRegionCodeBytes(com.google.protobuf.ByteString value) { throw new NullPointerException(); } checkByteStringIsUtf8(value); - regionCode_ = value; + bitField0_ |= 0x00000001; onChanged(); return this; } private java.lang.Object number_ = ""; + /** * * @@ -815,6 +831,7 @@ public java.lang.String getNumber() { return (java.lang.String) ref; } } + /** * * @@ -838,6 +855,7 @@ public com.google.protobuf.ByteString getNumberBytes() { return (com.google.protobuf.ByteString) ref; } } + /** * * @@ -855,11 +873,12 @@ public Builder setNumber(java.lang.String value) { if (value == null) { throw new NullPointerException(); } - number_ = value; + bitField0_ |= 0x00000002; onChanged(); return this; } + /** * * @@ -873,11 +892,12 @@ public Builder setNumber(java.lang.String value) { * @return This builder for chaining. */ public Builder clearNumber() { - number_ = getDefaultInstance().getNumber(); + bitField0_ = (bitField0_ & ~0x00000002); onChanged(); return this; } + /** * * @@ -896,24 +916,12 @@ public Builder setNumberBytes(com.google.protobuf.ByteString value) { throw new NullPointerException(); } checkByteStringIsUtf8(value); - number_ = 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.type.PhoneNumber.ShortCode) } @@ -967,6 +975,8 @@ public com.google.type.PhoneNumber.ShortCode getDefaultInstanceForType() { } private int kindCase_ = 0; + + @SuppressWarnings("serial") private java.lang.Object kind_; public enum KindCase @@ -981,6 +991,7 @@ public enum KindCase private KindCase(int value) { this.value = value; } + /** * @param value The number of the enum to look for. * @return The enum associated with the given number. @@ -1014,6 +1025,7 @@ public KindCase getKindCase() { } public static final int E164_NUMBER_FIELD_NUMBER = 1; + /** * * @@ -1022,15 +1034,17 @@ public KindCase getKindCase() { * phone number that uses a relaxed ITU E.164 format consisting of the * country calling code (1 to 3 digits) and the subscriber number, with no * additional spaces or formatting, e.g.: - * - correct: "+15552220123" - * - incorrect: "+1 (555) 222-01234 x123". + * - correct: "+15552220123" + * - incorrect: "+1 (555) 222-01234 x123". + * * The ITU E.164 format limits the latter to 12 digits, but in practice not * all countries respect that, so we relax that restriction here. * National-only numbers are not allowed. + * * References: - * - https://www.itu.int/rec/T-REC-E.164-201011-I - * - https://en.wikipedia.org/wiki/E.164. - * - https://en.wikipedia.org/wiki/List_of_country_calling_codes + * - https://www.itu.int/rec/T-REC-E.164-201011-I + * - https://en.wikipedia.org/wiki/E.164. + * - https://en.wikipedia.org/wiki/List_of_country_calling_codes *
        * * string e164_number = 1; @@ -1040,6 +1054,7 @@ public KindCase getKindCase() { public boolean hasE164Number() { return kindCase_ == 1; } + /** * * @@ -1048,15 +1063,17 @@ public boolean hasE164Number() { * phone number that uses a relaxed ITU E.164 format consisting of the * country calling code (1 to 3 digits) and the subscriber number, with no * additional spaces or formatting, e.g.: - * - correct: "+15552220123" - * - incorrect: "+1 (555) 222-01234 x123". + * - correct: "+15552220123" + * - incorrect: "+1 (555) 222-01234 x123". + * * The ITU E.164 format limits the latter to 12 digits, but in practice not * all countries respect that, so we relax that restriction here. * National-only numbers are not allowed. + * * References: - * - https://www.itu.int/rec/T-REC-E.164-201011-I - * - https://en.wikipedia.org/wiki/E.164. - * - https://en.wikipedia.org/wiki/List_of_country_calling_codes + * - https://www.itu.int/rec/T-REC-E.164-201011-I + * - https://en.wikipedia.org/wiki/E.164. + * - https://en.wikipedia.org/wiki/List_of_country_calling_codes *
        * * string e164_number = 1; @@ -1079,6 +1096,7 @@ public java.lang.String getE164Number() { return s; } } + /** * * @@ -1087,15 +1105,17 @@ public java.lang.String getE164Number() { * phone number that uses a relaxed ITU E.164 format consisting of the * country calling code (1 to 3 digits) and the subscriber number, with no * additional spaces or formatting, e.g.: - * - correct: "+15552220123" - * - incorrect: "+1 (555) 222-01234 x123". + * - correct: "+15552220123" + * - incorrect: "+1 (555) 222-01234 x123". + * * The ITU E.164 format limits the latter to 12 digits, but in practice not * all countries respect that, so we relax that restriction here. * National-only numbers are not allowed. + * * References: - * - https://www.itu.int/rec/T-REC-E.164-201011-I - * - https://en.wikipedia.org/wiki/E.164. - * - https://en.wikipedia.org/wiki/List_of_country_calling_codes + * - https://www.itu.int/rec/T-REC-E.164-201011-I + * - https://en.wikipedia.org/wiki/E.164. + * - https://en.wikipedia.org/wiki/List_of_country_calling_codes *
        * * string e164_number = 1; @@ -1120,13 +1140,15 @@ public com.google.protobuf.ByteString getE164NumberBytes() { } public static final int SHORT_CODE_FIELD_NUMBER = 2; + /** * * *
            * A short code.
        +   *
            * Reference(s):
        -   *  - https://en.wikipedia.org/wiki/Short_code
        +   * - https://en.wikipedia.org/wiki/Short_code
            * 
        * * .google.type.PhoneNumber.ShortCode short_code = 2; @@ -1137,13 +1159,15 @@ public com.google.protobuf.ByteString getE164NumberBytes() { public boolean hasShortCode() { return kindCase_ == 2; } + /** * * *
            * A short code.
        +   *
            * Reference(s):
        -   *  - https://en.wikipedia.org/wiki/Short_code
        +   * - https://en.wikipedia.org/wiki/Short_code
            * 
        * * .google.type.PhoneNumber.ShortCode short_code = 2; @@ -1157,13 +1181,15 @@ public com.google.type.PhoneNumber.ShortCode getShortCode() { } return com.google.type.PhoneNumber.ShortCode.getDefaultInstance(); } + /** * * *
            * A short code.
        +   *
            * Reference(s):
        -   *  - https://en.wikipedia.org/wiki/Short_code
        +   * - https://en.wikipedia.org/wiki/Short_code
            * 
        * * .google.type.PhoneNumber.ShortCode short_code = 2; @@ -1177,7 +1203,10 @@ public com.google.type.PhoneNumber.ShortCodeOrBuilder getShortCodeOrBuilder() { } public static final int EXTENSION_FIELD_NUMBER = 3; - private volatile java.lang.Object extension_; + + @SuppressWarnings("serial") + private volatile java.lang.Object extension_ = ""; + /** * * @@ -1186,6 +1215,7 @@ public com.google.type.PhoneNumber.ShortCodeOrBuilder getShortCodeOrBuilder() { * recommendations, except for being defined as a series of numbers with a * maximum length of 40 digits. Other than digits, some other dialing * characters such as ',' (indicating a wait) or '#' may be stored here. + * * Note that no regions currently use extensions with short codes, so this * field is normally only set in conjunction with an E.164 number. It is held * separately from the E.164 number to allow for short code extensions in the @@ -1208,6 +1238,7 @@ public java.lang.String getExtension() { return s; } } + /** * * @@ -1216,6 +1247,7 @@ public java.lang.String getExtension() { * recommendations, except for being defined as a series of numbers with a * maximum length of 40 digits. Other than digits, some other dialing * characters such as ',' (indicating a wait) or '#' may be stored here. + * * Note that no regions currently use extensions with short codes, so this * field is normally only set in conjunction with an E.164 number. It is held * separately from the E.164 number to allow for short code extensions in the @@ -1254,13 +1286,13 @@ public final boolean isInitialized() { @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { if (kindCase_ == 1) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, kind_); + com.google.protobuf.GeneratedMessage.writeString(output, 1, kind_); } if (kindCase_ == 2) { output.writeMessage(2, (com.google.type.PhoneNumber.ShortCode) kind_); } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(extension_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 3, extension_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(extension_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 3, extension_); } getUnknownFields().writeTo(output); } @@ -1272,15 +1304,15 @@ public int getSerializedSize() { size = 0; if (kindCase_ == 1) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, kind_); + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, kind_); } if (kindCase_ == 2) { size += com.google.protobuf.CodedOutputStream.computeMessageSize( 2, (com.google.type.PhoneNumber.ShortCode) kind_); } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(extension_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, extension_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(extension_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(3, extension_); } size += getUnknownFields().getSerializedSize(); memoizedSize = size; @@ -1375,38 +1407,38 @@ public static com.google.type.PhoneNumber parseFrom( public static com.google.type.PhoneNumber parseFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); } public static com.google.type.PhoneNumber parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } public static com.google.type.PhoneNumber parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); } public static com.google.type.PhoneNumber parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( PARSER, input, extensionRegistry); } public static com.google.type.PhoneNumber parseFrom(com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); } public static com.google.type.PhoneNumber parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } @@ -1429,38 +1461,46 @@ public Builder toBuilder() { } @java.lang.Override - protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { Builder builder = new Builder(parent); return builder; } + /** * * *
            * An object representing a phone number, suitable as an API wire format.
        +   *
            * This representation:
        -   *  - should not be used for locale-specific formatting of a phone number, such
        -   *    as "+1 (650) 253-0000 ext. 123"
        -   *  - is not designed for efficient storage
        -   *  - may not be suitable for dialing - specialized libraries (see references)
        -   *    should be used to parse the number for that purpose
        +   *
        +   * - should not be used for locale-specific formatting of a phone number, such
        +   * as "+1 (650) 253-0000 ext. 123"
        +   *
        +   * - is not designed for efficient storage
        +   * - may not be suitable for dialing - specialized libraries (see references)
        +   * should be used to parse the number for that purpose
        +   *
            * To do something meaningful with this number, such as format it for various
            * use-cases, convert it to an `i18n.phonenumbers.PhoneNumber` object first.
        +   *
            * For instance, in Java this would be:
        -   *    com.google.type.PhoneNumber wireProto =
        -   *        com.google.type.PhoneNumber.newBuilder().build();
        -   *    com.google.i18n.phonenumbers.Phonenumber.PhoneNumber phoneNumber =
        -   *        PhoneNumberUtil.getInstance().parse(wireProto.getE164Number(), "ZZ");
        -   *    if (!wireProto.getExtension().isEmpty()) {
        -   *      phoneNumber.setExtension(wireProto.getExtension());
        -   *    }
        -   *  Reference(s):
        -   *   - https://github.com/google/libphonenumber
        +   *
        +   * com.google.type.PhoneNumber wireProto =
        +   * com.google.type.PhoneNumber.newBuilder().build();
        +   * com.google.i18n.phonenumbers.Phonenumber.PhoneNumber phoneNumber =
        +   * PhoneNumberUtil.getInstance().parse(wireProto.getE164Number(), "ZZ");
        +   * if (!wireProto.getExtension().isEmpty()) {
        +   * phoneNumber.setExtension(wireProto.getExtension());
        +   * }
        +   *
        +   * Reference(s):
        +   * - https://github.com/google/libphonenumber
            * 
        * * Protobuf type {@code google.type.PhoneNumber} */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder implements // @@protoc_insertion_point(builder_implements:google.type.PhoneNumber) com.google.type.PhoneNumberOrBuilder { @@ -1469,7 +1509,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.type.PhoneNumberProto .internal_static_google_type_PhoneNumber_fieldAccessorTable @@ -1480,18 +1520,18 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { // Construct using com.google.type.PhoneNumber.newBuilder() private Builder() {} - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { super(parent); } @java.lang.Override public Builder clear() { super.clear(); + bitField0_ = 0; if (shortCodeBuilder_ != null) { shortCodeBuilder_.clear(); } extension_ = ""; - kindCase_ = 0; kind_ = null; return this; @@ -1519,53 +1559,27 @@ public com.google.type.PhoneNumber build() { @java.lang.Override public com.google.type.PhoneNumber buildPartial() { com.google.type.PhoneNumber result = new com.google.type.PhoneNumber(this); - if (kindCase_ == 1) { - result.kind_ = kind_; + if (bitField0_ != 0) { + buildPartial0(result); } - if (kindCase_ == 2) { - if (shortCodeBuilder_ == null) { - result.kind_ = kind_; - } else { - result.kind_ = shortCodeBuilder_.build(); - } - } - result.extension_ = extension_; - result.kindCase_ = kindCase_; + buildPartialOneofs(result); 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); + private void buildPartial0(com.google.type.PhoneNumber result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000004) != 0)) { + result.extension_ = extension_; + } } - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.addRepeatedField(field, value); + private void buildPartialOneofs(com.google.type.PhoneNumber result) { + result.kindCase_ = kindCase_; + result.kind_ = this.kind_; + if (kindCase_ == 2 && shortCodeBuilder_ != null) { + result.kind_ = shortCodeBuilder_.build(); + } } @java.lang.Override @@ -1582,6 +1596,7 @@ public Builder mergeFrom(com.google.type.PhoneNumber other) { if (other == com.google.type.PhoneNumber.getDefaultInstance()) return this; if (!other.getExtension().isEmpty()) { extension_ = other.extension_; + bitField0_ |= 0x00000004; onChanged(); } switch (other.getKindCase()) { @@ -1637,14 +1652,15 @@ public Builder mergeFrom( } // case 10 case 18: { - input.readMessage(getShortCodeFieldBuilder().getBuilder(), extensionRegistry); + input.readMessage( + internalGetShortCodeFieldBuilder().getBuilder(), extensionRegistry); kindCase_ = 2; break; } // case 18 case 26: { extension_ = input.readStringRequireUtf8(); - + bitField0_ |= 0x00000004; break; } // case 26 default: @@ -1678,6 +1694,8 @@ public Builder clearKind() { return this; } + private int bitField0_; + /** * * @@ -1686,15 +1704,17 @@ public Builder clearKind() { * phone number that uses a relaxed ITU E.164 format consisting of the * country calling code (1 to 3 digits) and the subscriber number, with no * additional spaces or formatting, e.g.: - * - correct: "+15552220123" - * - incorrect: "+1 (555) 222-01234 x123". + * - correct: "+15552220123" + * - incorrect: "+1 (555) 222-01234 x123". + * * The ITU E.164 format limits the latter to 12 digits, but in practice not * all countries respect that, so we relax that restriction here. * National-only numbers are not allowed. + * * References: - * - https://www.itu.int/rec/T-REC-E.164-201011-I - * - https://en.wikipedia.org/wiki/E.164. - * - https://en.wikipedia.org/wiki/List_of_country_calling_codes + * - https://www.itu.int/rec/T-REC-E.164-201011-I + * - https://en.wikipedia.org/wiki/E.164. + * - https://en.wikipedia.org/wiki/List_of_country_calling_codes *
        * * string e164_number = 1; @@ -1705,6 +1725,7 @@ public Builder clearKind() { public boolean hasE164Number() { return kindCase_ == 1; } + /** * * @@ -1713,15 +1734,17 @@ public boolean hasE164Number() { * phone number that uses a relaxed ITU E.164 format consisting of the * country calling code (1 to 3 digits) and the subscriber number, with no * additional spaces or formatting, e.g.: - * - correct: "+15552220123" - * - incorrect: "+1 (555) 222-01234 x123". + * - correct: "+15552220123" + * - incorrect: "+1 (555) 222-01234 x123". + * * The ITU E.164 format limits the latter to 12 digits, but in practice not * all countries respect that, so we relax that restriction here. * National-only numbers are not allowed. + * * References: - * - https://www.itu.int/rec/T-REC-E.164-201011-I - * - https://en.wikipedia.org/wiki/E.164. - * - https://en.wikipedia.org/wiki/List_of_country_calling_codes + * - https://www.itu.int/rec/T-REC-E.164-201011-I + * - https://en.wikipedia.org/wiki/E.164. + * - https://en.wikipedia.org/wiki/List_of_country_calling_codes *
        * * string e164_number = 1; @@ -1745,6 +1768,7 @@ public java.lang.String getE164Number() { return (java.lang.String) ref; } } + /** * * @@ -1753,15 +1777,17 @@ public java.lang.String getE164Number() { * phone number that uses a relaxed ITU E.164 format consisting of the * country calling code (1 to 3 digits) and the subscriber number, with no * additional spaces or formatting, e.g.: - * - correct: "+15552220123" - * - incorrect: "+1 (555) 222-01234 x123". + * - correct: "+15552220123" + * - incorrect: "+1 (555) 222-01234 x123". + * * The ITU E.164 format limits the latter to 12 digits, but in practice not * all countries respect that, so we relax that restriction here. * National-only numbers are not allowed. + * * References: - * - https://www.itu.int/rec/T-REC-E.164-201011-I - * - https://en.wikipedia.org/wiki/E.164. - * - https://en.wikipedia.org/wiki/List_of_country_calling_codes + * - https://www.itu.int/rec/T-REC-E.164-201011-I + * - https://en.wikipedia.org/wiki/E.164. + * - https://en.wikipedia.org/wiki/List_of_country_calling_codes *
        * * string e164_number = 1; @@ -1785,6 +1811,7 @@ public com.google.protobuf.ByteString getE164NumberBytes() { return (com.google.protobuf.ByteString) ref; } } + /** * * @@ -1793,15 +1820,17 @@ public com.google.protobuf.ByteString getE164NumberBytes() { * phone number that uses a relaxed ITU E.164 format consisting of the * country calling code (1 to 3 digits) and the subscriber number, with no * additional spaces or formatting, e.g.: - * - correct: "+15552220123" - * - incorrect: "+1 (555) 222-01234 x123". + * - correct: "+15552220123" + * - incorrect: "+1 (555) 222-01234 x123". + * * The ITU E.164 format limits the latter to 12 digits, but in practice not * all countries respect that, so we relax that restriction here. * National-only numbers are not allowed. + * * References: - * - https://www.itu.int/rec/T-REC-E.164-201011-I - * - https://en.wikipedia.org/wiki/E.164. - * - https://en.wikipedia.org/wiki/List_of_country_calling_codes + * - https://www.itu.int/rec/T-REC-E.164-201011-I + * - https://en.wikipedia.org/wiki/E.164. + * - https://en.wikipedia.org/wiki/List_of_country_calling_codes *
        * * string e164_number = 1; @@ -1818,6 +1847,7 @@ public Builder setE164Number(java.lang.String value) { onChanged(); return this; } + /** * * @@ -1826,15 +1856,17 @@ public Builder setE164Number(java.lang.String value) { * phone number that uses a relaxed ITU E.164 format consisting of the * country calling code (1 to 3 digits) and the subscriber number, with no * additional spaces or formatting, e.g.: - * - correct: "+15552220123" - * - incorrect: "+1 (555) 222-01234 x123". + * - correct: "+15552220123" + * - incorrect: "+1 (555) 222-01234 x123". + * * The ITU E.164 format limits the latter to 12 digits, but in practice not * all countries respect that, so we relax that restriction here. * National-only numbers are not allowed. + * * References: - * - https://www.itu.int/rec/T-REC-E.164-201011-I - * - https://en.wikipedia.org/wiki/E.164. - * - https://en.wikipedia.org/wiki/List_of_country_calling_codes + * - https://www.itu.int/rec/T-REC-E.164-201011-I + * - https://en.wikipedia.org/wiki/E.164. + * - https://en.wikipedia.org/wiki/List_of_country_calling_codes *
        * * string e164_number = 1; @@ -1849,6 +1881,7 @@ public Builder clearE164Number() { } return this; } + /** * * @@ -1857,15 +1890,17 @@ public Builder clearE164Number() { * phone number that uses a relaxed ITU E.164 format consisting of the * country calling code (1 to 3 digits) and the subscriber number, with no * additional spaces or formatting, e.g.: - * - correct: "+15552220123" - * - incorrect: "+1 (555) 222-01234 x123". + * - correct: "+15552220123" + * - incorrect: "+1 (555) 222-01234 x123". + * * The ITU E.164 format limits the latter to 12 digits, but in practice not * all countries respect that, so we relax that restriction here. * National-only numbers are not allowed. + * * References: - * - https://www.itu.int/rec/T-REC-E.164-201011-I - * - https://en.wikipedia.org/wiki/E.164. - * - https://en.wikipedia.org/wiki/List_of_country_calling_codes + * - https://www.itu.int/rec/T-REC-E.164-201011-I + * - https://en.wikipedia.org/wiki/E.164. + * - https://en.wikipedia.org/wiki/List_of_country_calling_codes *
        * * string e164_number = 1; @@ -1884,18 +1919,20 @@ public Builder setE164NumberBytes(com.google.protobuf.ByteString value) { return this; } - private com.google.protobuf.SingleFieldBuilderV3< + private com.google.protobuf.SingleFieldBuilder< com.google.type.PhoneNumber.ShortCode, com.google.type.PhoneNumber.ShortCode.Builder, com.google.type.PhoneNumber.ShortCodeOrBuilder> shortCodeBuilder_; + /** * * *
              * A short code.
        +     *
              * Reference(s):
        -     *  - https://en.wikipedia.org/wiki/Short_code
        +     * - https://en.wikipedia.org/wiki/Short_code
              * 
        * * .google.type.PhoneNumber.ShortCode short_code = 2; @@ -1906,13 +1943,15 @@ public Builder setE164NumberBytes(com.google.protobuf.ByteString value) { public boolean hasShortCode() { return kindCase_ == 2; } + /** * * *
              * A short code.
        +     *
              * Reference(s):
        -     *  - https://en.wikipedia.org/wiki/Short_code
        +     * - https://en.wikipedia.org/wiki/Short_code
              * 
        * * .google.type.PhoneNumber.ShortCode short_code = 2; @@ -1933,13 +1972,15 @@ public com.google.type.PhoneNumber.ShortCode getShortCode() { return com.google.type.PhoneNumber.ShortCode.getDefaultInstance(); } } + /** * * *
              * A short code.
        +     *
              * Reference(s):
        -     *  - https://en.wikipedia.org/wiki/Short_code
        +     * - https://en.wikipedia.org/wiki/Short_code
              * 
        * * .google.type.PhoneNumber.ShortCode short_code = 2; @@ -1957,13 +1998,15 @@ public Builder setShortCode(com.google.type.PhoneNumber.ShortCode value) { kindCase_ = 2; return this; } + /** * * *
              * A short code.
        +     *
              * Reference(s):
        -     *  - https://en.wikipedia.org/wiki/Short_code
        +     * - https://en.wikipedia.org/wiki/Short_code
              * 
        * * .google.type.PhoneNumber.ShortCode short_code = 2; @@ -1978,13 +2021,15 @@ public Builder setShortCode(com.google.type.PhoneNumber.ShortCode.Builder builde kindCase_ = 2; return this; } + /** * * *
              * A short code.
        +     *
              * Reference(s):
        -     *  - https://en.wikipedia.org/wiki/Short_code
        +     * - https://en.wikipedia.org/wiki/Short_code
              * 
        * * .google.type.PhoneNumber.ShortCode short_code = 2; @@ -2011,13 +2056,15 @@ public Builder mergeShortCode(com.google.type.PhoneNumber.ShortCode value) { kindCase_ = 2; return this; } + /** * * *
              * A short code.
        +     *
              * Reference(s):
        -     *  - https://en.wikipedia.org/wiki/Short_code
        +     * - https://en.wikipedia.org/wiki/Short_code
              * 
        * * .google.type.PhoneNumber.ShortCode short_code = 2; @@ -2038,27 +2085,31 @@ public Builder clearShortCode() { } return this; } + /** * * *
              * A short code.
        +     *
              * Reference(s):
        -     *  - https://en.wikipedia.org/wiki/Short_code
        +     * - https://en.wikipedia.org/wiki/Short_code
              * 
        * * .google.type.PhoneNumber.ShortCode short_code = 2; */ public com.google.type.PhoneNumber.ShortCode.Builder getShortCodeBuilder() { - return getShortCodeFieldBuilder().getBuilder(); + return internalGetShortCodeFieldBuilder().getBuilder(); } + /** * * *
              * A short code.
        +     *
              * Reference(s):
        -     *  - https://en.wikipedia.org/wiki/Short_code
        +     * - https://en.wikipedia.org/wiki/Short_code
              * 
        * * .google.type.PhoneNumber.ShortCode short_code = 2; @@ -2074,28 +2125,30 @@ public com.google.type.PhoneNumber.ShortCodeOrBuilder getShortCodeOrBuilder() { return com.google.type.PhoneNumber.ShortCode.getDefaultInstance(); } } + /** * * *
              * A short code.
        +     *
              * Reference(s):
        -     *  - https://en.wikipedia.org/wiki/Short_code
        +     * - https://en.wikipedia.org/wiki/Short_code
              * 
        * * .google.type.PhoneNumber.ShortCode short_code = 2; */ - private com.google.protobuf.SingleFieldBuilderV3< + private com.google.protobuf.SingleFieldBuilder< com.google.type.PhoneNumber.ShortCode, com.google.type.PhoneNumber.ShortCode.Builder, com.google.type.PhoneNumber.ShortCodeOrBuilder> - getShortCodeFieldBuilder() { + internalGetShortCodeFieldBuilder() { if (shortCodeBuilder_ == null) { if (!(kindCase_ == 2)) { kind_ = com.google.type.PhoneNumber.ShortCode.getDefaultInstance(); } shortCodeBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< + new com.google.protobuf.SingleFieldBuilder< com.google.type.PhoneNumber.ShortCode, com.google.type.PhoneNumber.ShortCode.Builder, com.google.type.PhoneNumber.ShortCodeOrBuilder>( @@ -2104,11 +2157,11 @@ public com.google.type.PhoneNumber.ShortCodeOrBuilder getShortCodeOrBuilder() { } kindCase_ = 2; onChanged(); - ; return shortCodeBuilder_; } private java.lang.Object extension_ = ""; + /** * * @@ -2117,6 +2170,7 @@ public com.google.type.PhoneNumber.ShortCodeOrBuilder getShortCodeOrBuilder() { * recommendations, except for being defined as a series of numbers with a * maximum length of 40 digits. Other than digits, some other dialing * characters such as ',' (indicating a wait) or '#' may be stored here. + * * Note that no regions currently use extensions with short codes, so this * field is normally only set in conjunction with an E.164 number. It is held * separately from the E.164 number to allow for short code extensions in the @@ -2138,6 +2192,7 @@ public java.lang.String getExtension() { return (java.lang.String) ref; } } + /** * * @@ -2146,6 +2201,7 @@ public java.lang.String getExtension() { * recommendations, except for being defined as a series of numbers with a * maximum length of 40 digits. Other than digits, some other dialing * characters such as ',' (indicating a wait) or '#' may be stored here. + * * Note that no regions currently use extensions with short codes, so this * field is normally only set in conjunction with an E.164 number. It is held * separately from the E.164 number to allow for short code extensions in the @@ -2167,6 +2223,7 @@ public com.google.protobuf.ByteString getExtensionBytes() { return (com.google.protobuf.ByteString) ref; } } + /** * * @@ -2175,6 +2232,7 @@ public com.google.protobuf.ByteString getExtensionBytes() { * recommendations, except for being defined as a series of numbers with a * maximum length of 40 digits. Other than digits, some other dialing * characters such as ',' (indicating a wait) or '#' may be stored here. + * * Note that no regions currently use extensions with short codes, so this * field is normally only set in conjunction with an E.164 number. It is held * separately from the E.164 number to allow for short code extensions in the @@ -2190,11 +2248,12 @@ public Builder setExtension(java.lang.String value) { if (value == null) { throw new NullPointerException(); } - extension_ = value; + bitField0_ |= 0x00000004; onChanged(); return this; } + /** * * @@ -2203,6 +2262,7 @@ public Builder setExtension(java.lang.String value) { * recommendations, except for being defined as a series of numbers with a * maximum length of 40 digits. Other than digits, some other dialing * characters such as ',' (indicating a wait) or '#' may be stored here. + * * Note that no regions currently use extensions with short codes, so this * field is normally only set in conjunction with an E.164 number. It is held * separately from the E.164 number to allow for short code extensions in the @@ -2214,11 +2274,12 @@ public Builder setExtension(java.lang.String value) { * @return This builder for chaining. */ public Builder clearExtension() { - extension_ = getDefaultInstance().getExtension(); + bitField0_ = (bitField0_ & ~0x00000004); onChanged(); return this; } + /** * * @@ -2227,6 +2288,7 @@ public Builder clearExtension() { * recommendations, except for being defined as a series of numbers with a * maximum length of 40 digits. Other than digits, some other dialing * characters such as ',' (indicating a wait) or '#' may be stored here. + * * Note that no regions currently use extensions with short codes, so this * field is normally only set in conjunction with an E.164 number. It is held * separately from the E.164 number to allow for short code extensions in the @@ -2243,23 +2305,12 @@ public Builder setExtensionBytes(com.google.protobuf.ByteString value) { throw new NullPointerException(); } checkByteStringIsUtf8(value); - extension_ = 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.type.PhoneNumber) } diff --git a/java-common-protos/proto-google-common-protos/src/main/java/com/google/type/PhoneNumberOrBuilder.java b/java-common-protos/proto-google-common-protos/src/main/java/com/google/type/PhoneNumberOrBuilder.java index 00bd363c71..8f90afe7cf 100644 --- a/java-common-protos/proto-google-common-protos/src/main/java/com/google/type/PhoneNumberOrBuilder.java +++ b/java-common-protos/proto-google-common-protos/src/main/java/com/google/type/PhoneNumberOrBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,10 +14,13 @@ * limitations under the License. */ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: google/type/phone_number.proto +// Protobuf Java Version: 4.33.2 package com.google.type; +@com.google.protobuf.Generated public interface PhoneNumberOrBuilder extends // @@protoc_insertion_point(interface_extends:google.type.PhoneNumber) @@ -31,15 +34,17 @@ public interface PhoneNumberOrBuilder * phone number that uses a relaxed ITU E.164 format consisting of the * country calling code (1 to 3 digits) and the subscriber number, with no * additional spaces or formatting, e.g.: - * - correct: "+15552220123" - * - incorrect: "+1 (555) 222-01234 x123". + * - correct: "+15552220123" + * - incorrect: "+1 (555) 222-01234 x123". + * * The ITU E.164 format limits the latter to 12 digits, but in practice not * all countries respect that, so we relax that restriction here. * National-only numbers are not allowed. + * * References: - * - https://www.itu.int/rec/T-REC-E.164-201011-I - * - https://en.wikipedia.org/wiki/E.164. - * - https://en.wikipedia.org/wiki/List_of_country_calling_codes + * - https://www.itu.int/rec/T-REC-E.164-201011-I + * - https://en.wikipedia.org/wiki/E.164. + * - https://en.wikipedia.org/wiki/List_of_country_calling_codes *
        * * string e164_number = 1; @@ -47,6 +52,7 @@ public interface PhoneNumberOrBuilder * @return Whether the e164Number field is set. */ boolean hasE164Number(); + /** * * @@ -55,15 +61,17 @@ public interface PhoneNumberOrBuilder * phone number that uses a relaxed ITU E.164 format consisting of the * country calling code (1 to 3 digits) and the subscriber number, with no * additional spaces or formatting, e.g.: - * - correct: "+15552220123" - * - incorrect: "+1 (555) 222-01234 x123". + * - correct: "+15552220123" + * - incorrect: "+1 (555) 222-01234 x123". + * * The ITU E.164 format limits the latter to 12 digits, but in practice not * all countries respect that, so we relax that restriction here. * National-only numbers are not allowed. + * * References: - * - https://www.itu.int/rec/T-REC-E.164-201011-I - * - https://en.wikipedia.org/wiki/E.164. - * - https://en.wikipedia.org/wiki/List_of_country_calling_codes + * - https://www.itu.int/rec/T-REC-E.164-201011-I + * - https://en.wikipedia.org/wiki/E.164. + * - https://en.wikipedia.org/wiki/List_of_country_calling_codes *
        * * string e164_number = 1; @@ -71,6 +79,7 @@ public interface PhoneNumberOrBuilder * @return The e164Number. */ java.lang.String getE164Number(); + /** * * @@ -79,15 +88,17 @@ public interface PhoneNumberOrBuilder * phone number that uses a relaxed ITU E.164 format consisting of the * country calling code (1 to 3 digits) and the subscriber number, with no * additional spaces or formatting, e.g.: - * - correct: "+15552220123" - * - incorrect: "+1 (555) 222-01234 x123". + * - correct: "+15552220123" + * - incorrect: "+1 (555) 222-01234 x123". + * * The ITU E.164 format limits the latter to 12 digits, but in practice not * all countries respect that, so we relax that restriction here. * National-only numbers are not allowed. + * * References: - * - https://www.itu.int/rec/T-REC-E.164-201011-I - * - https://en.wikipedia.org/wiki/E.164. - * - https://en.wikipedia.org/wiki/List_of_country_calling_codes + * - https://www.itu.int/rec/T-REC-E.164-201011-I + * - https://en.wikipedia.org/wiki/E.164. + * - https://en.wikipedia.org/wiki/List_of_country_calling_codes *
        * * string e164_number = 1; @@ -101,8 +112,9 @@ public interface PhoneNumberOrBuilder * *
            * A short code.
        +   *
            * Reference(s):
        -   *  - https://en.wikipedia.org/wiki/Short_code
        +   * - https://en.wikipedia.org/wiki/Short_code
            * 
        * * .google.type.PhoneNumber.ShortCode short_code = 2; @@ -110,13 +122,15 @@ public interface PhoneNumberOrBuilder * @return Whether the shortCode field is set. */ boolean hasShortCode(); + /** * * *
            * A short code.
        +   *
            * Reference(s):
        -   *  - https://en.wikipedia.org/wiki/Short_code
        +   * - https://en.wikipedia.org/wiki/Short_code
            * 
        * * .google.type.PhoneNumber.ShortCode short_code = 2; @@ -124,13 +138,15 @@ public interface PhoneNumberOrBuilder * @return The shortCode. */ com.google.type.PhoneNumber.ShortCode getShortCode(); + /** * * *
            * A short code.
        +   *
            * Reference(s):
        -   *  - https://en.wikipedia.org/wiki/Short_code
        +   * - https://en.wikipedia.org/wiki/Short_code
            * 
        * * .google.type.PhoneNumber.ShortCode short_code = 2; @@ -145,6 +161,7 @@ public interface PhoneNumberOrBuilder * recommendations, except for being defined as a series of numbers with a * maximum length of 40 digits. Other than digits, some other dialing * characters such as ',' (indicating a wait) or '#' may be stored here. + * * Note that no regions currently use extensions with short codes, so this * field is normally only set in conjunction with an E.164 number. It is held * separately from the E.164 number to allow for short code extensions in the @@ -156,6 +173,7 @@ public interface PhoneNumberOrBuilder * @return The extension. */ java.lang.String getExtension(); + /** * * @@ -164,6 +182,7 @@ public interface PhoneNumberOrBuilder * recommendations, except for being defined as a series of numbers with a * maximum length of 40 digits. Other than digits, some other dialing * characters such as ',' (indicating a wait) or '#' may be stored here. + * * Note that no regions currently use extensions with short codes, so this * field is normally only set in conjunction with an E.164 number. It is held * separately from the E.164 number to allow for short code extensions in the @@ -176,5 +195,5 @@ public interface PhoneNumberOrBuilder */ com.google.protobuf.ByteString getExtensionBytes(); - public com.google.type.PhoneNumber.KindCase getKindCase(); + com.google.type.PhoneNumber.KindCase getKindCase(); } diff --git a/java-common-protos/proto-google-common-protos/src/main/java/com/google/type/PhoneNumberProto.java b/java-common-protos/proto-google-common-protos/src/main/java/com/google/type/PhoneNumberProto.java index f69641eec3..f1ef562dc0 100644 --- a/java-common-protos/proto-google-common-protos/src/main/java/com/google/type/PhoneNumberProto.java +++ b/java-common-protos/proto-google-common-protos/src/main/java/com/google/type/PhoneNumberProto.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,13 +14,26 @@ * limitations under the License. */ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: google/type/phone_number.proto +// Protobuf Java Version: 4.33.2 package com.google.type; -public final class PhoneNumberProto { +@com.google.protobuf.Generated +public final class PhoneNumberProto extends com.google.protobuf.GeneratedFile { private PhoneNumberProto() {} + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "PhoneNumberProto"); + } + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistryLite registry) {} public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry registry) { @@ -29,11 +42,11 @@ public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry r static final com.google.protobuf.Descriptors.Descriptor internal_static_google_type_PhoneNumber_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable internal_static_google_type_PhoneNumber_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_google_type_PhoneNumber_ShortCode_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable internal_static_google_type_PhoneNumber_ShortCode_fieldAccessorTable; public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { @@ -57,21 +70,22 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { descriptor = com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( descriptorData, new com.google.protobuf.Descriptors.FileDescriptor[] {}); - internal_static_google_type_PhoneNumber_descriptor = getDescriptor().getMessageTypes().get(0); + internal_static_google_type_PhoneNumber_descriptor = getDescriptor().getMessageType(0); internal_static_google_type_PhoneNumber_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_google_type_PhoneNumber_descriptor, new java.lang.String[] { "E164Number", "ShortCode", "Extension", "Kind", }); internal_static_google_type_PhoneNumber_ShortCode_descriptor = - internal_static_google_type_PhoneNumber_descriptor.getNestedTypes().get(0); + internal_static_google_type_PhoneNumber_descriptor.getNestedType(0); internal_static_google_type_PhoneNumber_ShortCode_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_google_type_PhoneNumber_ShortCode_descriptor, new java.lang.String[] { "RegionCode", "Number", }); + descriptor.resolveAllFeaturesImmutable(); } // @@protoc_insertion_point(outer_class_scope) diff --git a/java-common-protos/proto-google-common-protos/src/main/java/com/google/type/PostalAddress.java b/java-common-protos/proto-google-common-protos/src/main/java/com/google/type/PostalAddress.java index 2741f8d5c8..6d954aefba 100644 --- a/java-common-protos/proto-google-common-protos/src/main/java/com/google/type/PostalAddress.java +++ b/java-common-protos/proto-google-common-protos/src/main/java/com/google/type/PostalAddress.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,9 @@ * limitations under the License. */ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: google/type/postal_address.proto +// Protobuf Java Version: 4.33.2 package com.google.type; @@ -27,26 +29,41 @@ * Box or similar. * It is not intended to model geographical locations (roads, towns, * mountains). + * * In typical usage an address would be created via user input or from importing * existing data, depending on the type of process. + * * Advice on address input / editing: - * - Use an i18n-ready address widget such as - * https://github.com/google/libaddressinput) + * - Use an i18n-ready address widget such as + * https://github.com/google/libaddressinput) * - Users should not be presented with UI elements for input or editing of - * fields outside countries where that field is used. + * fields outside countries where that field is used. + * * For more guidance on how to use this schema, please see: * https://support.google.com/business/answer/6397478 *
        * * Protobuf type {@code google.type.PostalAddress} */ -public final class PostalAddress extends com.google.protobuf.GeneratedMessageV3 +@com.google.protobuf.Generated +public final class PostalAddress extends com.google.protobuf.GeneratedMessage implements // @@protoc_insertion_point(message_implements:google.type.PostalAddress) PostalAddressOrBuilder { private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "PostalAddress"); + } + // Use PostalAddress.newBuilder() to construct. - private PostalAddress(com.google.protobuf.GeneratedMessageV3.Builder builder) { + private PostalAddress(com.google.protobuf.GeneratedMessage.Builder builder) { super(builder); } @@ -58,28 +75,17 @@ private PostalAddress() { administrativeArea_ = ""; locality_ = ""; sublocality_ = ""; - addressLines_ = com.google.protobuf.LazyStringArrayList.EMPTY; - recipients_ = com.google.protobuf.LazyStringArrayList.EMPTY; + addressLines_ = com.google.protobuf.LazyStringArrayList.emptyList(); + recipients_ = com.google.protobuf.LazyStringArrayList.emptyList(); organization_ = ""; } - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new PostalAddress(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.type.PostalAddressProto.internal_static_google_type_PostalAddress_descriptor; } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.type.PostalAddressProto .internal_static_google_type_PostalAddress_fieldAccessorTable @@ -88,13 +94,15 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } public static final int REVISION_FIELD_NUMBER = 1; - private int revision_; + private int revision_ = 0; + /** * * *
            * The schema revision of the `PostalAddress`. This must be set to 0, which is
            * the latest revision.
        +   *
            * All new revisions **must** be backward compatible with old revisions.
            * 
        * @@ -108,7 +116,10 @@ public int getRevision() { } public static final int REGION_CODE_FIELD_NUMBER = 2; - private volatile java.lang.Object regionCode_; + + @SuppressWarnings("serial") + private volatile java.lang.Object regionCode_ = ""; + /** * * @@ -136,6 +147,7 @@ public java.lang.String getRegionCode() { return s; } } + /** * * @@ -165,7 +177,10 @@ public com.google.protobuf.ByteString getRegionCodeBytes() { } public static final int LANGUAGE_CODE_FIELD_NUMBER = 3; - private volatile java.lang.Object languageCode_; + + @SuppressWarnings("serial") + private volatile java.lang.Object languageCode_ = ""; + /** * * @@ -177,8 +192,10 @@ public com.google.protobuf.ByteString getRegionCodeBytes() { * This can affect formatting in certain countries, but is not critical * to the correctness of the data and will never affect any validation or * other non-formatting related operations. + * * If this value is not known, it should be omitted (rather than specifying a * possibly incorrect default). + * * Examples: "zh-Hant", "ja", "ja-Latn", "en". *
        * @@ -198,6 +215,7 @@ public java.lang.String getLanguageCode() { return s; } } + /** * * @@ -209,8 +227,10 @@ public java.lang.String getLanguageCode() { * This can affect formatting in certain countries, but is not critical * to the correctness of the data and will never affect any validation or * other non-formatting related operations. + * * If this value is not known, it should be omitted (rather than specifying a * possibly incorrect default). + * * Examples: "zh-Hant", "ja", "ja-Latn", "en". * * @@ -232,7 +252,10 @@ public com.google.protobuf.ByteString getLanguageCodeBytes() { } public static final int POSTAL_CODE_FIELD_NUMBER = 4; - private volatile java.lang.Object postalCode_; + + @SuppressWarnings("serial") + private volatile java.lang.Object postalCode_ = ""; + /** * * @@ -259,6 +282,7 @@ public java.lang.String getPostalCode() { return s; } } + /** * * @@ -287,7 +311,10 @@ public com.google.protobuf.ByteString getPostalCodeBytes() { } public static final int SORTING_CODE_FIELD_NUMBER = 5; - private volatile java.lang.Object sortingCode_; + + @SuppressWarnings("serial") + private volatile java.lang.Object sortingCode_ = ""; + /** * * @@ -315,6 +342,7 @@ public java.lang.String getSortingCode() { return s; } } + /** * * @@ -344,7 +372,10 @@ public com.google.protobuf.ByteString getSortingCodeBytes() { } public static final int ADMINISTRATIVE_AREA_FIELD_NUMBER = 6; - private volatile java.lang.Object administrativeArea_; + + @SuppressWarnings("serial") + private volatile java.lang.Object administrativeArea_ = ""; + /** * * @@ -374,6 +405,7 @@ public java.lang.String getAdministrativeArea() { return s; } } + /** * * @@ -405,7 +437,10 @@ public com.google.protobuf.ByteString getAdministrativeAreaBytes() { } public static final int LOCALITY_FIELD_NUMBER = 7; - private volatile java.lang.Object locality_; + + @SuppressWarnings("serial") + private volatile java.lang.Object locality_ = ""; + /** * * @@ -432,6 +467,7 @@ public java.lang.String getLocality() { return s; } } + /** * * @@ -460,7 +496,10 @@ public com.google.protobuf.ByteString getLocalityBytes() { } public static final int SUBLOCALITY_FIELD_NUMBER = 8; - private volatile java.lang.Object sublocality_; + + @SuppressWarnings("serial") + private volatile java.lang.Object sublocality_ = ""; + /** * * @@ -485,6 +524,7 @@ public java.lang.String getSublocality() { return s; } } + /** * * @@ -511,12 +551,17 @@ public com.google.protobuf.ByteString getSublocalityBytes() { } public static final int ADDRESS_LINES_FIELD_NUMBER = 9; - private com.google.protobuf.LazyStringList addressLines_; + + @SuppressWarnings("serial") + private com.google.protobuf.LazyStringArrayList addressLines_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + /** * * *
            * Unstructured address lines describing the lower levels of an address.
        +   *
            * Because values in address_lines do not have type information and may
            * sometimes contain multiple values in a single field (e.g.
            * "Austin, TX"), it is important that the line order is clear. The order of
        @@ -525,12 +570,14 @@ public com.google.protobuf.ByteString getSublocalityBytes() {
            * used to make it explicit (e.g. "ja" for large-to-small ordering and
            * "ja-Latn" or "en" for small-to-large). This way, the most specific line of
            * an address can be selected based on the language.
        +   *
            * The minimum permitted structural representation of an address consists
            * of a region_code with all remaining information placed in the
            * address_lines. It would be possible to format such an address very
            * approximately without geocoding, but no semantic reasoning could be
            * made about any of the address components until it was at least
            * partially resolved.
        +   *
            * Creating an address only containing a region_code and address_lines, and
            * then geocoding is the recommended way to handle completely unstructured
            * addresses (as opposed to guessing which parts of the address should be
        @@ -544,11 +591,13 @@ public com.google.protobuf.ByteString getSublocalityBytes() {
           public com.google.protobuf.ProtocolStringList getAddressLinesList() {
             return addressLines_;
           }
        +
           /**
            *
            *
            * 
            * Unstructured address lines describing the lower levels of an address.
        +   *
            * Because values in address_lines do not have type information and may
            * sometimes contain multiple values in a single field (e.g.
            * "Austin, TX"), it is important that the line order is clear. The order of
        @@ -557,12 +606,14 @@ public com.google.protobuf.ProtocolStringList getAddressLinesList() {
            * used to make it explicit (e.g. "ja" for large-to-small ordering and
            * "ja-Latn" or "en" for small-to-large). This way, the most specific line of
            * an address can be selected based on the language.
        +   *
            * The minimum permitted structural representation of an address consists
            * of a region_code with all remaining information placed in the
            * address_lines. It would be possible to format such an address very
            * approximately without geocoding, but no semantic reasoning could be
            * made about any of the address components until it was at least
            * partially resolved.
        +   *
            * Creating an address only containing a region_code and address_lines, and
            * then geocoding is the recommended way to handle completely unstructured
            * addresses (as opposed to guessing which parts of the address should be
        @@ -576,11 +627,13 @@ public com.google.protobuf.ProtocolStringList getAddressLinesList() {
           public int getAddressLinesCount() {
             return addressLines_.size();
           }
        +
           /**
            *
            *
            * 
            * Unstructured address lines describing the lower levels of an address.
        +   *
            * Because values in address_lines do not have type information and may
            * sometimes contain multiple values in a single field (e.g.
            * "Austin, TX"), it is important that the line order is clear. The order of
        @@ -589,12 +642,14 @@ public int getAddressLinesCount() {
            * used to make it explicit (e.g. "ja" for large-to-small ordering and
            * "ja-Latn" or "en" for small-to-large). This way, the most specific line of
            * an address can be selected based on the language.
        +   *
            * The minimum permitted structural representation of an address consists
            * of a region_code with all remaining information placed in the
            * address_lines. It would be possible to format such an address very
            * approximately without geocoding, but no semantic reasoning could be
            * made about any of the address components until it was at least
            * partially resolved.
        +   *
            * Creating an address only containing a region_code and address_lines, and
            * then geocoding is the recommended way to handle completely unstructured
            * addresses (as opposed to guessing which parts of the address should be
        @@ -609,11 +664,13 @@ public int getAddressLinesCount() {
           public java.lang.String getAddressLines(int index) {
             return addressLines_.get(index);
           }
        +
           /**
            *
            *
            * 
            * Unstructured address lines describing the lower levels of an address.
        +   *
            * Because values in address_lines do not have type information and may
            * sometimes contain multiple values in a single field (e.g.
            * "Austin, TX"), it is important that the line order is clear. The order of
        @@ -622,12 +679,14 @@ public java.lang.String getAddressLines(int index) {
            * used to make it explicit (e.g. "ja" for large-to-small ordering and
            * "ja-Latn" or "en" for small-to-large). This way, the most specific line of
            * an address can be selected based on the language.
        +   *
            * The minimum permitted structural representation of an address consists
            * of a region_code with all remaining information placed in the
            * address_lines. It would be possible to format such an address very
            * approximately without geocoding, but no semantic reasoning could be
            * made about any of the address components until it was at least
            * partially resolved.
        +   *
            * Creating an address only containing a region_code and address_lines, and
            * then geocoding is the recommended way to handle completely unstructured
            * addresses (as opposed to guessing which parts of the address should be
        @@ -644,7 +703,11 @@ public com.google.protobuf.ByteString getAddressLinesBytes(int index) {
           }
         
           public static final int RECIPIENTS_FIELD_NUMBER = 10;
        -  private com.google.protobuf.LazyStringList recipients_;
        +
        +  @SuppressWarnings("serial")
        +  private com.google.protobuf.LazyStringArrayList recipients_ =
        +      com.google.protobuf.LazyStringArrayList.emptyList();
        +
           /**
            *
            *
        @@ -661,6 +724,7 @@ public com.google.protobuf.ByteString getAddressLinesBytes(int index) {
           public com.google.protobuf.ProtocolStringList getRecipientsList() {
             return recipients_;
           }
        +
           /**
            *
            *
        @@ -677,6 +741,7 @@ public com.google.protobuf.ProtocolStringList getRecipientsList() {
           public int getRecipientsCount() {
             return recipients_.size();
           }
        +
           /**
            *
            *
        @@ -694,6 +759,7 @@ public int getRecipientsCount() {
           public java.lang.String getRecipients(int index) {
             return recipients_.get(index);
           }
        +
           /**
            *
            *
        @@ -713,7 +779,10 @@ public com.google.protobuf.ByteString getRecipientsBytes(int index) {
           }
         
           public static final int ORGANIZATION_FIELD_NUMBER = 11;
        -  private volatile java.lang.Object organization_;
        +
        +  @SuppressWarnings("serial")
        +  private volatile java.lang.Object organization_ = "";
        +
           /**
            *
            *
        @@ -737,6 +806,7 @@ public java.lang.String getOrganization() {
               return s;
             }
           }
        +
           /**
            *
            *
        @@ -778,35 +848,35 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io
             if (revision_ != 0) {
               output.writeInt32(1, revision_);
             }
        -    if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(regionCode_)) {
        -      com.google.protobuf.GeneratedMessageV3.writeString(output, 2, regionCode_);
        +    if (!com.google.protobuf.GeneratedMessage.isStringEmpty(regionCode_)) {
        +      com.google.protobuf.GeneratedMessage.writeString(output, 2, regionCode_);
             }
        -    if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(languageCode_)) {
        -      com.google.protobuf.GeneratedMessageV3.writeString(output, 3, languageCode_);
        +    if (!com.google.protobuf.GeneratedMessage.isStringEmpty(languageCode_)) {
        +      com.google.protobuf.GeneratedMessage.writeString(output, 3, languageCode_);
             }
        -    if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(postalCode_)) {
        -      com.google.protobuf.GeneratedMessageV3.writeString(output, 4, postalCode_);
        +    if (!com.google.protobuf.GeneratedMessage.isStringEmpty(postalCode_)) {
        +      com.google.protobuf.GeneratedMessage.writeString(output, 4, postalCode_);
             }
        -    if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(sortingCode_)) {
        -      com.google.protobuf.GeneratedMessageV3.writeString(output, 5, sortingCode_);
        +    if (!com.google.protobuf.GeneratedMessage.isStringEmpty(sortingCode_)) {
        +      com.google.protobuf.GeneratedMessage.writeString(output, 5, sortingCode_);
             }
        -    if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(administrativeArea_)) {
        -      com.google.protobuf.GeneratedMessageV3.writeString(output, 6, administrativeArea_);
        +    if (!com.google.protobuf.GeneratedMessage.isStringEmpty(administrativeArea_)) {
        +      com.google.protobuf.GeneratedMessage.writeString(output, 6, administrativeArea_);
             }
        -    if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(locality_)) {
        -      com.google.protobuf.GeneratedMessageV3.writeString(output, 7, locality_);
        +    if (!com.google.protobuf.GeneratedMessage.isStringEmpty(locality_)) {
        +      com.google.protobuf.GeneratedMessage.writeString(output, 7, locality_);
             }
        -    if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(sublocality_)) {
        -      com.google.protobuf.GeneratedMessageV3.writeString(output, 8, sublocality_);
        +    if (!com.google.protobuf.GeneratedMessage.isStringEmpty(sublocality_)) {
        +      com.google.protobuf.GeneratedMessage.writeString(output, 8, sublocality_);
             }
             for (int i = 0; i < addressLines_.size(); i++) {
        -      com.google.protobuf.GeneratedMessageV3.writeString(output, 9, addressLines_.getRaw(i));
        +      com.google.protobuf.GeneratedMessage.writeString(output, 9, addressLines_.getRaw(i));
             }
             for (int i = 0; i < recipients_.size(); i++) {
        -      com.google.protobuf.GeneratedMessageV3.writeString(output, 10, recipients_.getRaw(i));
        +      com.google.protobuf.GeneratedMessage.writeString(output, 10, recipients_.getRaw(i));
             }
        -    if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(organization_)) {
        -      com.google.protobuf.GeneratedMessageV3.writeString(output, 11, organization_);
        +    if (!com.google.protobuf.GeneratedMessage.isStringEmpty(organization_)) {
        +      com.google.protobuf.GeneratedMessage.writeString(output, 11, organization_);
             }
             getUnknownFields().writeTo(output);
           }
        @@ -820,26 +890,26 @@ public int getSerializedSize() {
             if (revision_ != 0) {
               size += com.google.protobuf.CodedOutputStream.computeInt32Size(1, revision_);
             }
        -    if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(regionCode_)) {
        -      size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, regionCode_);
        +    if (!com.google.protobuf.GeneratedMessage.isStringEmpty(regionCode_)) {
        +      size += com.google.protobuf.GeneratedMessage.computeStringSize(2, regionCode_);
             }
        -    if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(languageCode_)) {
        -      size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, languageCode_);
        +    if (!com.google.protobuf.GeneratedMessage.isStringEmpty(languageCode_)) {
        +      size += com.google.protobuf.GeneratedMessage.computeStringSize(3, languageCode_);
             }
        -    if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(postalCode_)) {
        -      size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, postalCode_);
        +    if (!com.google.protobuf.GeneratedMessage.isStringEmpty(postalCode_)) {
        +      size += com.google.protobuf.GeneratedMessage.computeStringSize(4, postalCode_);
             }
        -    if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(sortingCode_)) {
        -      size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, sortingCode_);
        +    if (!com.google.protobuf.GeneratedMessage.isStringEmpty(sortingCode_)) {
        +      size += com.google.protobuf.GeneratedMessage.computeStringSize(5, sortingCode_);
             }
        -    if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(administrativeArea_)) {
        -      size += com.google.protobuf.GeneratedMessageV3.computeStringSize(6, administrativeArea_);
        +    if (!com.google.protobuf.GeneratedMessage.isStringEmpty(administrativeArea_)) {
        +      size += com.google.protobuf.GeneratedMessage.computeStringSize(6, administrativeArea_);
             }
        -    if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(locality_)) {
        -      size += com.google.protobuf.GeneratedMessageV3.computeStringSize(7, locality_);
        +    if (!com.google.protobuf.GeneratedMessage.isStringEmpty(locality_)) {
        +      size += com.google.protobuf.GeneratedMessage.computeStringSize(7, locality_);
             }
        -    if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(sublocality_)) {
        -      size += com.google.protobuf.GeneratedMessageV3.computeStringSize(8, sublocality_);
        +    if (!com.google.protobuf.GeneratedMessage.isStringEmpty(sublocality_)) {
        +      size += com.google.protobuf.GeneratedMessage.computeStringSize(8, sublocality_);
             }
             {
               int dataSize = 0;
        @@ -857,8 +927,8 @@ public int getSerializedSize() {
               size += dataSize;
               size += 1 * getRecipientsList().size();
             }
        -    if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(organization_)) {
        -      size += com.google.protobuf.GeneratedMessageV3.computeStringSize(11, organization_);
        +    if (!com.google.protobuf.GeneratedMessage.isStringEmpty(organization_)) {
        +      size += com.google.protobuf.GeneratedMessage.computeStringSize(11, organization_);
             }
             size += getUnknownFields().getSerializedSize();
             memoizedSize = size;
        @@ -964,38 +1034,38 @@ public static com.google.type.PostalAddress parseFrom(
         
           public static com.google.type.PostalAddress parseFrom(java.io.InputStream input)
               throws java.io.IOException {
        -    return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
        +    return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input);
           }
         
           public static com.google.type.PostalAddress parseFrom(
               java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
               throws java.io.IOException {
        -    return com.google.protobuf.GeneratedMessageV3.parseWithIOException(
        +    return com.google.protobuf.GeneratedMessage.parseWithIOException(
                 PARSER, input, extensionRegistry);
           }
         
           public static com.google.type.PostalAddress parseDelimitedFrom(java.io.InputStream input)
               throws java.io.IOException {
        -    return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input);
        +    return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input);
           }
         
           public static com.google.type.PostalAddress parseDelimitedFrom(
               java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
               throws java.io.IOException {
        -    return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(
        +    return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(
                 PARSER, input, extensionRegistry);
           }
         
           public static com.google.type.PostalAddress parseFrom(com.google.protobuf.CodedInputStream input)
               throws java.io.IOException {
        -    return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
        +    return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input);
           }
         
           public static com.google.type.PostalAddress parseFrom(
               com.google.protobuf.CodedInputStream input,
               com.google.protobuf.ExtensionRegistryLite extensionRegistry)
               throws java.io.IOException {
        -    return com.google.protobuf.GeneratedMessageV3.parseWithIOException(
        +    return com.google.protobuf.GeneratedMessage.parseWithIOException(
                 PARSER, input, extensionRegistry);
           }
         
        @@ -1018,10 +1088,11 @@ public Builder toBuilder() {
           }
         
           @java.lang.Override
        -  protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
        +  protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) {
             Builder builder = new Builder(parent);
             return builder;
           }
        +
           /**
            *
            *
        @@ -1031,20 +1102,23 @@ protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.Build
            * Box or similar.
            * It is not intended to model geographical locations (roads, towns,
            * mountains).
        +   *
            * In typical usage an address would be created via user input or from importing
            * existing data, depending on the type of process.
        +   *
            * Advice on address input / editing:
        -   *  - Use an i18n-ready address widget such as
        -   *    https://github.com/google/libaddressinput)
        +   * - Use an i18n-ready address widget such as
        +   * https://github.com/google/libaddressinput)
            * - Users should not be presented with UI elements for input or editing of
        -   *   fields outside countries where that field is used.
        +   * fields outside countries where that field is used.
        +   *
            * For more guidance on how to use this schema, please see:
            * https://support.google.com/business/answer/6397478
            * 
        * * Protobuf type {@code google.type.PostalAddress} */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder implements // @@protoc_insertion_point(builder_implements:google.type.PostalAddress) com.google.type.PostalAddressOrBuilder { @@ -1054,7 +1128,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.type.PostalAddressProto .internal_static_google_type_PostalAddress_fieldAccessorTable @@ -1065,35 +1139,25 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { // Construct using com.google.type.PostalAddress.newBuilder() private Builder() {} - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { super(parent); } @java.lang.Override public Builder clear() { super.clear(); + bitField0_ = 0; revision_ = 0; - regionCode_ = ""; - languageCode_ = ""; - postalCode_ = ""; - sortingCode_ = ""; - administrativeArea_ = ""; - locality_ = ""; - sublocality_ = ""; - - addressLines_ = com.google.protobuf.LazyStringArrayList.EMPTY; - bitField0_ = (bitField0_ & ~0x00000001); - recipients_ = com.google.protobuf.LazyStringArrayList.EMPTY; - bitField0_ = (bitField0_ & ~0x00000002); + addressLines_ = com.google.protobuf.LazyStringArrayList.emptyList(); + recipients_ = com.google.protobuf.LazyStringArrayList.emptyList(); organization_ = ""; - return this; } @@ -1120,61 +1184,50 @@ public com.google.type.PostalAddress build() { @java.lang.Override public com.google.type.PostalAddress buildPartial() { com.google.type.PostalAddress result = new com.google.type.PostalAddress(this); - int from_bitField0_ = bitField0_; - result.revision_ = revision_; - result.regionCode_ = regionCode_; - result.languageCode_ = languageCode_; - result.postalCode_ = postalCode_; - result.sortingCode_ = sortingCode_; - result.administrativeArea_ = administrativeArea_; - result.locality_ = locality_; - result.sublocality_ = sublocality_; - if (((bitField0_ & 0x00000001) != 0)) { - addressLines_ = addressLines_.getUnmodifiableView(); - bitField0_ = (bitField0_ & ~0x00000001); - } - result.addressLines_ = addressLines_; - if (((bitField0_ & 0x00000002) != 0)) { - recipients_ = recipients_.getUnmodifiableView(); - bitField0_ = (bitField0_ & ~0x00000002); - } - result.recipients_ = recipients_; - result.organization_ = organization_; + if (bitField0_ != 0) { + buildPartial0(result); + } 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); + private void buildPartial0(com.google.type.PostalAddress result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.revision_ = revision_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.regionCode_ = regionCode_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.languageCode_ = languageCode_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.postalCode_ = postalCode_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.sortingCode_ = sortingCode_; + } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.administrativeArea_ = administrativeArea_; + } + if (((from_bitField0_ & 0x00000040) != 0)) { + result.locality_ = locality_; + } + if (((from_bitField0_ & 0x00000080) != 0)) { + result.sublocality_ = sublocality_; + } + if (((from_bitField0_ & 0x00000100) != 0)) { + addressLines_.makeImmutable(); + result.addressLines_ = addressLines_; + } + if (((from_bitField0_ & 0x00000200) != 0)) { + recipients_.makeImmutable(); + result.recipients_ = recipients_; + } + if (((from_bitField0_ & 0x00000400) != 0)) { + result.organization_ = organization_; + } } @java.lang.Override @@ -1194,36 +1247,43 @@ public Builder mergeFrom(com.google.type.PostalAddress other) { } if (!other.getRegionCode().isEmpty()) { regionCode_ = other.regionCode_; + bitField0_ |= 0x00000002; onChanged(); } if (!other.getLanguageCode().isEmpty()) { languageCode_ = other.languageCode_; + bitField0_ |= 0x00000004; onChanged(); } if (!other.getPostalCode().isEmpty()) { postalCode_ = other.postalCode_; + bitField0_ |= 0x00000008; onChanged(); } if (!other.getSortingCode().isEmpty()) { sortingCode_ = other.sortingCode_; + bitField0_ |= 0x00000010; onChanged(); } if (!other.getAdministrativeArea().isEmpty()) { administrativeArea_ = other.administrativeArea_; + bitField0_ |= 0x00000020; onChanged(); } if (!other.getLocality().isEmpty()) { locality_ = other.locality_; + bitField0_ |= 0x00000040; onChanged(); } if (!other.getSublocality().isEmpty()) { sublocality_ = other.sublocality_; + bitField0_ |= 0x00000080; onChanged(); } if (!other.addressLines_.isEmpty()) { if (addressLines_.isEmpty()) { addressLines_ = other.addressLines_; - bitField0_ = (bitField0_ & ~0x00000001); + bitField0_ |= 0x00000100; } else { ensureAddressLinesIsMutable(); addressLines_.addAll(other.addressLines_); @@ -1233,7 +1293,7 @@ public Builder mergeFrom(com.google.type.PostalAddress other) { if (!other.recipients_.isEmpty()) { if (recipients_.isEmpty()) { recipients_ = other.recipients_; - bitField0_ = (bitField0_ & ~0x00000002); + bitField0_ |= 0x00000200; } else { ensureRecipientsIsMutable(); recipients_.addAll(other.recipients_); @@ -1242,6 +1302,7 @@ public Builder mergeFrom(com.google.type.PostalAddress other) { } if (!other.getOrganization().isEmpty()) { organization_ = other.organization_; + bitField0_ |= 0x00000400; onChanged(); } this.mergeUnknownFields(other.getUnknownFields()); @@ -1273,49 +1334,49 @@ public Builder mergeFrom( case 8: { revision_ = input.readInt32(); - + bitField0_ |= 0x00000001; break; } // case 8 case 18: { regionCode_ = input.readStringRequireUtf8(); - + bitField0_ |= 0x00000002; break; } // case 18 case 26: { languageCode_ = input.readStringRequireUtf8(); - + bitField0_ |= 0x00000004; break; } // case 26 case 34: { postalCode_ = input.readStringRequireUtf8(); - + bitField0_ |= 0x00000008; break; } // case 34 case 42: { sortingCode_ = input.readStringRequireUtf8(); - + bitField0_ |= 0x00000010; break; } // case 42 case 50: { administrativeArea_ = input.readStringRequireUtf8(); - + bitField0_ |= 0x00000020; break; } // case 50 case 58: { locality_ = input.readStringRequireUtf8(); - + bitField0_ |= 0x00000040; break; } // case 58 case 66: { sublocality_ = input.readStringRequireUtf8(); - + bitField0_ |= 0x00000080; break; } // case 66 case 74: @@ -1335,7 +1396,7 @@ public Builder mergeFrom( case 90: { organization_ = input.readStringRequireUtf8(); - + bitField0_ |= 0x00000400; break; } // case 90 default: @@ -1358,12 +1419,14 @@ public Builder mergeFrom( private int bitField0_; private int revision_; + /** * * *
              * The schema revision of the `PostalAddress`. This must be set to 0, which is
              * the latest revision.
        +     *
              * All new revisions **must** be backward compatible with old revisions.
              * 
        * @@ -1375,12 +1438,14 @@ public Builder mergeFrom( public int getRevision() { return revision_; } + /** * * *
              * The schema revision of the `PostalAddress`. This must be set to 0, which is
              * the latest revision.
        +     *
              * All new revisions **must** be backward compatible with old revisions.
              * 
        * @@ -1392,15 +1457,18 @@ public int getRevision() { public Builder setRevision(int value) { revision_ = value; + bitField0_ |= 0x00000001; onChanged(); return this; } + /** * * *
              * The schema revision of the `PostalAddress`. This must be set to 0, which is
              * the latest revision.
        +     *
              * All new revisions **must** be backward compatible with old revisions.
              * 
        * @@ -1409,13 +1477,14 @@ public Builder setRevision(int value) { * @return This builder for chaining. */ public Builder clearRevision() { - + bitField0_ = (bitField0_ & ~0x00000001); revision_ = 0; onChanged(); return this; } private java.lang.Object regionCode_ = ""; + /** * * @@ -1442,6 +1511,7 @@ public java.lang.String getRegionCode() { return (java.lang.String) ref; } } + /** * * @@ -1468,6 +1538,7 @@ public com.google.protobuf.ByteString getRegionCodeBytes() { return (com.google.protobuf.ByteString) ref; } } + /** * * @@ -1488,11 +1559,12 @@ public Builder setRegionCode(java.lang.String value) { if (value == null) { throw new NullPointerException(); } - regionCode_ = value; + bitField0_ |= 0x00000002; onChanged(); return this; } + /** * * @@ -1509,11 +1581,12 @@ public Builder setRegionCode(java.lang.String value) { * @return This builder for chaining. */ public Builder clearRegionCode() { - regionCode_ = getDefaultInstance().getRegionCode(); + bitField0_ = (bitField0_ & ~0x00000002); onChanged(); return this; } + /** * * @@ -1535,13 +1608,14 @@ public Builder setRegionCodeBytes(com.google.protobuf.ByteString value) { throw new NullPointerException(); } checkByteStringIsUtf8(value); - regionCode_ = value; + bitField0_ |= 0x00000002; onChanged(); return this; } private java.lang.Object languageCode_ = ""; + /** * * @@ -1553,8 +1627,10 @@ public Builder setRegionCodeBytes(com.google.protobuf.ByteString value) { * This can affect formatting in certain countries, but is not critical * to the correctness of the data and will never affect any validation or * other non-formatting related operations. + * * If this value is not known, it should be omitted (rather than specifying a * possibly incorrect default). + * * Examples: "zh-Hant", "ja", "ja-Latn", "en". *
        * @@ -1573,6 +1649,7 @@ public java.lang.String getLanguageCode() { return (java.lang.String) ref; } } + /** * * @@ -1584,8 +1661,10 @@ public java.lang.String getLanguageCode() { * This can affect formatting in certain countries, but is not critical * to the correctness of the data and will never affect any validation or * other non-formatting related operations. + * * If this value is not known, it should be omitted (rather than specifying a * possibly incorrect default). + * * Examples: "zh-Hant", "ja", "ja-Latn", "en". *
        * @@ -1604,6 +1683,7 @@ public com.google.protobuf.ByteString getLanguageCodeBytes() { return (com.google.protobuf.ByteString) ref; } } + /** * * @@ -1615,8 +1695,10 @@ public com.google.protobuf.ByteString getLanguageCodeBytes() { * This can affect formatting in certain countries, but is not critical * to the correctness of the data and will never affect any validation or * other non-formatting related operations. + * * If this value is not known, it should be omitted (rather than specifying a * possibly incorrect default). + * * Examples: "zh-Hant", "ja", "ja-Latn", "en". *
        * @@ -1629,11 +1711,12 @@ public Builder setLanguageCode(java.lang.String value) { if (value == null) { throw new NullPointerException(); } - languageCode_ = value; + bitField0_ |= 0x00000004; onChanged(); return this; } + /** * * @@ -1645,8 +1728,10 @@ public Builder setLanguageCode(java.lang.String value) { * This can affect formatting in certain countries, but is not critical * to the correctness of the data and will never affect any validation or * other non-formatting related operations. + * * If this value is not known, it should be omitted (rather than specifying a * possibly incorrect default). + * * Examples: "zh-Hant", "ja", "ja-Latn", "en". * * @@ -1655,11 +1740,12 @@ public Builder setLanguageCode(java.lang.String value) { * @return This builder for chaining. */ public Builder clearLanguageCode() { - languageCode_ = getDefaultInstance().getLanguageCode(); + bitField0_ = (bitField0_ & ~0x00000004); onChanged(); return this; } + /** * * @@ -1671,8 +1757,10 @@ public Builder clearLanguageCode() { * This can affect formatting in certain countries, but is not critical * to the correctness of the data and will never affect any validation or * other non-formatting related operations. + * * If this value is not known, it should be omitted (rather than specifying a * possibly incorrect default). + * * Examples: "zh-Hant", "ja", "ja-Latn", "en". * * @@ -1686,13 +1774,14 @@ public Builder setLanguageCodeBytes(com.google.protobuf.ByteString value) { throw new NullPointerException(); } checkByteStringIsUtf8(value); - languageCode_ = value; + bitField0_ |= 0x00000004; onChanged(); return this; } private java.lang.Object postalCode_ = ""; + /** * * @@ -1718,6 +1807,7 @@ public java.lang.String getPostalCode() { return (java.lang.String) ref; } } + /** * * @@ -1743,6 +1833,7 @@ public com.google.protobuf.ByteString getPostalCodeBytes() { return (com.google.protobuf.ByteString) ref; } } + /** * * @@ -1762,11 +1853,12 @@ public Builder setPostalCode(java.lang.String value) { if (value == null) { throw new NullPointerException(); } - postalCode_ = value; + bitField0_ |= 0x00000008; onChanged(); return this; } + /** * * @@ -1782,11 +1874,12 @@ public Builder setPostalCode(java.lang.String value) { * @return This builder for chaining. */ public Builder clearPostalCode() { - postalCode_ = getDefaultInstance().getPostalCode(); + bitField0_ = (bitField0_ & ~0x00000008); onChanged(); return this; } + /** * * @@ -1807,13 +1900,14 @@ public Builder setPostalCodeBytes(com.google.protobuf.ByteString value) { throw new NullPointerException(); } checkByteStringIsUtf8(value); - postalCode_ = value; + bitField0_ |= 0x00000008; onChanged(); return this; } private java.lang.Object sortingCode_ = ""; + /** * * @@ -1840,6 +1934,7 @@ public java.lang.String getSortingCode() { return (java.lang.String) ref; } } + /** * * @@ -1866,6 +1961,7 @@ public com.google.protobuf.ByteString getSortingCodeBytes() { return (com.google.protobuf.ByteString) ref; } } + /** * * @@ -1886,11 +1982,12 @@ public Builder setSortingCode(java.lang.String value) { if (value == null) { throw new NullPointerException(); } - sortingCode_ = value; + bitField0_ |= 0x00000010; onChanged(); return this; } + /** * * @@ -1907,11 +2004,12 @@ public Builder setSortingCode(java.lang.String value) { * @return This builder for chaining. */ public Builder clearSortingCode() { - sortingCode_ = getDefaultInstance().getSortingCode(); + bitField0_ = (bitField0_ & ~0x00000010); onChanged(); return this; } + /** * * @@ -1933,13 +2031,14 @@ public Builder setSortingCodeBytes(com.google.protobuf.ByteString value) { throw new NullPointerException(); } checkByteStringIsUtf8(value); - sortingCode_ = value; + bitField0_ |= 0x00000010; onChanged(); return this; } private java.lang.Object administrativeArea_ = ""; + /** * * @@ -1968,6 +2067,7 @@ public java.lang.String getAdministrativeArea() { return (java.lang.String) ref; } } + /** * * @@ -1996,6 +2096,7 @@ public com.google.protobuf.ByteString getAdministrativeAreaBytes() { return (com.google.protobuf.ByteString) ref; } } + /** * * @@ -2018,11 +2119,12 @@ public Builder setAdministrativeArea(java.lang.String value) { if (value == null) { throw new NullPointerException(); } - administrativeArea_ = value; + bitField0_ |= 0x00000020; onChanged(); return this; } + /** * * @@ -2041,11 +2143,12 @@ public Builder setAdministrativeArea(java.lang.String value) { * @return This builder for chaining. */ public Builder clearAdministrativeArea() { - administrativeArea_ = getDefaultInstance().getAdministrativeArea(); + bitField0_ = (bitField0_ & ~0x00000020); onChanged(); return this; } + /** * * @@ -2069,13 +2172,14 @@ public Builder setAdministrativeAreaBytes(com.google.protobuf.ByteString value) throw new NullPointerException(); } checkByteStringIsUtf8(value); - administrativeArea_ = value; + bitField0_ |= 0x00000020; onChanged(); return this; } private java.lang.Object locality_ = ""; + /** * * @@ -2101,6 +2205,7 @@ public java.lang.String getLocality() { return (java.lang.String) ref; } } + /** * * @@ -2126,6 +2231,7 @@ public com.google.protobuf.ByteString getLocalityBytes() { return (com.google.protobuf.ByteString) ref; } } + /** * * @@ -2145,11 +2251,12 @@ public Builder setLocality(java.lang.String value) { if (value == null) { throw new NullPointerException(); } - locality_ = value; + bitField0_ |= 0x00000040; onChanged(); return this; } + /** * * @@ -2165,11 +2272,12 @@ public Builder setLocality(java.lang.String value) { * @return This builder for chaining. */ public Builder clearLocality() { - locality_ = getDefaultInstance().getLocality(); + bitField0_ = (bitField0_ & ~0x00000040); onChanged(); return this; } + /** * * @@ -2190,13 +2298,14 @@ public Builder setLocalityBytes(com.google.protobuf.ByteString value) { throw new NullPointerException(); } checkByteStringIsUtf8(value); - locality_ = value; + bitField0_ |= 0x00000040; onChanged(); return this; } private java.lang.Object sublocality_ = ""; + /** * * @@ -2220,6 +2329,7 @@ public java.lang.String getSublocality() { return (java.lang.String) ref; } } + /** * * @@ -2243,6 +2353,7 @@ public com.google.protobuf.ByteString getSublocalityBytes() { return (com.google.protobuf.ByteString) ref; } } + /** * * @@ -2260,11 +2371,12 @@ public Builder setSublocality(java.lang.String value) { if (value == null) { throw new NullPointerException(); } - sublocality_ = value; + bitField0_ |= 0x00000080; onChanged(); return this; } + /** * * @@ -2278,11 +2390,12 @@ public Builder setSublocality(java.lang.String value) { * @return This builder for chaining. */ public Builder clearSublocality() { - sublocality_ = getDefaultInstance().getSublocality(); + bitField0_ = (bitField0_ & ~0x00000080); onChanged(); return this; } + /** * * @@ -2301,26 +2414,28 @@ public Builder setSublocalityBytes(com.google.protobuf.ByteString value) { throw new NullPointerException(); } checkByteStringIsUtf8(value); - sublocality_ = value; + bitField0_ |= 0x00000080; onChanged(); return this; } - private com.google.protobuf.LazyStringList addressLines_ = - com.google.protobuf.LazyStringArrayList.EMPTY; + private com.google.protobuf.LazyStringArrayList addressLines_ = + com.google.protobuf.LazyStringArrayList.emptyList(); private void ensureAddressLinesIsMutable() { - if (!((bitField0_ & 0x00000001) != 0)) { + if (!addressLines_.isModifiable()) { addressLines_ = new com.google.protobuf.LazyStringArrayList(addressLines_); - bitField0_ |= 0x00000001; } + bitField0_ |= 0x00000100; } + /** * * *
              * Unstructured address lines describing the lower levels of an address.
        +     *
              * Because values in address_lines do not have type information and may
              * sometimes contain multiple values in a single field (e.g.
              * "Austin, TX"), it is important that the line order is clear. The order of
        @@ -2329,12 +2444,14 @@ private void ensureAddressLinesIsMutable() {
              * used to make it explicit (e.g. "ja" for large-to-small ordering and
              * "ja-Latn" or "en" for small-to-large). This way, the most specific line of
              * an address can be selected based on the language.
        +     *
              * The minimum permitted structural representation of an address consists
              * of a region_code with all remaining information placed in the
              * address_lines. It would be possible to format such an address very
              * approximately without geocoding, but no semantic reasoning could be
              * made about any of the address components until it was at least
              * partially resolved.
        +     *
              * Creating an address only containing a region_code and address_lines, and
              * then geocoding is the recommended way to handle completely unstructured
              * addresses (as opposed to guessing which parts of the address should be
        @@ -2346,13 +2463,16 @@ private void ensureAddressLinesIsMutable() {
              * @return A list containing the addressLines.
              */
             public com.google.protobuf.ProtocolStringList getAddressLinesList() {
        -      return addressLines_.getUnmodifiableView();
        +      addressLines_.makeImmutable();
        +      return addressLines_;
             }
        +
             /**
              *
              *
              * 
              * Unstructured address lines describing the lower levels of an address.
        +     *
              * Because values in address_lines do not have type information and may
              * sometimes contain multiple values in a single field (e.g.
              * "Austin, TX"), it is important that the line order is clear. The order of
        @@ -2361,12 +2481,14 @@ public com.google.protobuf.ProtocolStringList getAddressLinesList() {
              * used to make it explicit (e.g. "ja" for large-to-small ordering and
              * "ja-Latn" or "en" for small-to-large). This way, the most specific line of
              * an address can be selected based on the language.
        +     *
              * The minimum permitted structural representation of an address consists
              * of a region_code with all remaining information placed in the
              * address_lines. It would be possible to format such an address very
              * approximately without geocoding, but no semantic reasoning could be
              * made about any of the address components until it was at least
              * partially resolved.
        +     *
              * Creating an address only containing a region_code and address_lines, and
              * then geocoding is the recommended way to handle completely unstructured
              * addresses (as opposed to guessing which parts of the address should be
        @@ -2380,11 +2502,13 @@ public com.google.protobuf.ProtocolStringList getAddressLinesList() {
             public int getAddressLinesCount() {
               return addressLines_.size();
             }
        +
             /**
              *
              *
              * 
              * Unstructured address lines describing the lower levels of an address.
        +     *
              * Because values in address_lines do not have type information and may
              * sometimes contain multiple values in a single field (e.g.
              * "Austin, TX"), it is important that the line order is clear. The order of
        @@ -2393,12 +2517,14 @@ public int getAddressLinesCount() {
              * used to make it explicit (e.g. "ja" for large-to-small ordering and
              * "ja-Latn" or "en" for small-to-large). This way, the most specific line of
              * an address can be selected based on the language.
        +     *
              * The minimum permitted structural representation of an address consists
              * of a region_code with all remaining information placed in the
              * address_lines. It would be possible to format such an address very
              * approximately without geocoding, but no semantic reasoning could be
              * made about any of the address components until it was at least
              * partially resolved.
        +     *
              * Creating an address only containing a region_code and address_lines, and
              * then geocoding is the recommended way to handle completely unstructured
              * addresses (as opposed to guessing which parts of the address should be
        @@ -2413,11 +2539,13 @@ public int getAddressLinesCount() {
             public java.lang.String getAddressLines(int index) {
               return addressLines_.get(index);
             }
        +
             /**
              *
              *
              * 
              * Unstructured address lines describing the lower levels of an address.
        +     *
              * Because values in address_lines do not have type information and may
              * sometimes contain multiple values in a single field (e.g.
              * "Austin, TX"), it is important that the line order is clear. The order of
        @@ -2426,12 +2554,14 @@ public java.lang.String getAddressLines(int index) {
              * used to make it explicit (e.g. "ja" for large-to-small ordering and
              * "ja-Latn" or "en" for small-to-large). This way, the most specific line of
              * an address can be selected based on the language.
        +     *
              * The minimum permitted structural representation of an address consists
              * of a region_code with all remaining information placed in the
              * address_lines. It would be possible to format such an address very
              * approximately without geocoding, but no semantic reasoning could be
              * made about any of the address components until it was at least
              * partially resolved.
        +     *
              * Creating an address only containing a region_code and address_lines, and
              * then geocoding is the recommended way to handle completely unstructured
              * addresses (as opposed to guessing which parts of the address should be
        @@ -2446,11 +2576,13 @@ public java.lang.String getAddressLines(int index) {
             public com.google.protobuf.ByteString getAddressLinesBytes(int index) {
               return addressLines_.getByteString(index);
             }
        +
             /**
              *
              *
              * 
              * Unstructured address lines describing the lower levels of an address.
        +     *
              * Because values in address_lines do not have type information and may
              * sometimes contain multiple values in a single field (e.g.
              * "Austin, TX"), it is important that the line order is clear. The order of
        @@ -2459,12 +2591,14 @@ public com.google.protobuf.ByteString getAddressLinesBytes(int index) {
              * used to make it explicit (e.g. "ja" for large-to-small ordering and
              * "ja-Latn" or "en" for small-to-large). This way, the most specific line of
              * an address can be selected based on the language.
        +     *
              * The minimum permitted structural representation of an address consists
              * of a region_code with all remaining information placed in the
              * address_lines. It would be possible to format such an address very
              * approximately without geocoding, but no semantic reasoning could be
              * made about any of the address components until it was at least
              * partially resolved.
        +     *
              * Creating an address only containing a region_code and address_lines, and
              * then geocoding is the recommended way to handle completely unstructured
              * addresses (as opposed to guessing which parts of the address should be
        @@ -2483,14 +2617,17 @@ public Builder setAddressLines(int index, java.lang.String value) {
               }
               ensureAddressLinesIsMutable();
               addressLines_.set(index, value);
        +      bitField0_ |= 0x00000100;
               onChanged();
               return this;
             }
        +
             /**
              *
              *
              * 
              * Unstructured address lines describing the lower levels of an address.
        +     *
              * Because values in address_lines do not have type information and may
              * sometimes contain multiple values in a single field (e.g.
              * "Austin, TX"), it is important that the line order is clear. The order of
        @@ -2499,12 +2636,14 @@ public Builder setAddressLines(int index, java.lang.String value) {
              * used to make it explicit (e.g. "ja" for large-to-small ordering and
              * "ja-Latn" or "en" for small-to-large). This way, the most specific line of
              * an address can be selected based on the language.
        +     *
              * The minimum permitted structural representation of an address consists
              * of a region_code with all remaining information placed in the
              * address_lines. It would be possible to format such an address very
              * approximately without geocoding, but no semantic reasoning could be
              * made about any of the address components until it was at least
              * partially resolved.
        +     *
              * Creating an address only containing a region_code and address_lines, and
              * then geocoding is the recommended way to handle completely unstructured
              * addresses (as opposed to guessing which parts of the address should be
        @@ -2522,14 +2661,17 @@ public Builder addAddressLines(java.lang.String value) {
               }
               ensureAddressLinesIsMutable();
               addressLines_.add(value);
        +      bitField0_ |= 0x00000100;
               onChanged();
               return this;
             }
        +
             /**
              *
              *
              * 
              * Unstructured address lines describing the lower levels of an address.
        +     *
              * Because values in address_lines do not have type information and may
              * sometimes contain multiple values in a single field (e.g.
              * "Austin, TX"), it is important that the line order is clear. The order of
        @@ -2538,12 +2680,14 @@ public Builder addAddressLines(java.lang.String value) {
              * used to make it explicit (e.g. "ja" for large-to-small ordering and
              * "ja-Latn" or "en" for small-to-large). This way, the most specific line of
              * an address can be selected based on the language.
        +     *
              * The minimum permitted structural representation of an address consists
              * of a region_code with all remaining information placed in the
              * address_lines. It would be possible to format such an address very
              * approximately without geocoding, but no semantic reasoning could be
              * made about any of the address components until it was at least
              * partially resolved.
        +     *
              * Creating an address only containing a region_code and address_lines, and
              * then geocoding is the recommended way to handle completely unstructured
              * addresses (as opposed to guessing which parts of the address should be
        @@ -2558,14 +2702,17 @@ public Builder addAddressLines(java.lang.String value) {
             public Builder addAllAddressLines(java.lang.Iterable values) {
               ensureAddressLinesIsMutable();
               com.google.protobuf.AbstractMessageLite.Builder.addAll(values, addressLines_);
        +      bitField0_ |= 0x00000100;
               onChanged();
               return this;
             }
        +
             /**
              *
              *
              * 
              * Unstructured address lines describing the lower levels of an address.
        +     *
              * Because values in address_lines do not have type information and may
              * sometimes contain multiple values in a single field (e.g.
              * "Austin, TX"), it is important that the line order is clear. The order of
        @@ -2574,12 +2721,14 @@ public Builder addAllAddressLines(java.lang.Iterable values) {
              * used to make it explicit (e.g. "ja" for large-to-small ordering and
              * "ja-Latn" or "en" for small-to-large). This way, the most specific line of
              * an address can be selected based on the language.
        +     *
              * The minimum permitted structural representation of an address consists
              * of a region_code with all remaining information placed in the
              * address_lines. It would be possible to format such an address very
              * approximately without geocoding, but no semantic reasoning could be
              * made about any of the address components until it was at least
              * partially resolved.
        +     *
              * Creating an address only containing a region_code and address_lines, and
              * then geocoding is the recommended way to handle completely unstructured
              * addresses (as opposed to guessing which parts of the address should be
        @@ -2591,16 +2740,19 @@ public Builder addAllAddressLines(java.lang.Iterable values) {
              * @return This builder for chaining.
              */
             public Builder clearAddressLines() {
        -      addressLines_ = com.google.protobuf.LazyStringArrayList.EMPTY;
        -      bitField0_ = (bitField0_ & ~0x00000001);
        +      addressLines_ = com.google.protobuf.LazyStringArrayList.emptyList();
        +      bitField0_ = (bitField0_ & ~0x00000100);
        +      ;
               onChanged();
               return this;
             }
        +
             /**
              *
              *
              * 
              * Unstructured address lines describing the lower levels of an address.
        +     *
              * Because values in address_lines do not have type information and may
              * sometimes contain multiple values in a single field (e.g.
              * "Austin, TX"), it is important that the line order is clear. The order of
        @@ -2609,12 +2761,14 @@ public Builder clearAddressLines() {
              * used to make it explicit (e.g. "ja" for large-to-small ordering and
              * "ja-Latn" or "en" for small-to-large). This way, the most specific line of
              * an address can be selected based on the language.
        +     *
              * The minimum permitted structural representation of an address consists
              * of a region_code with all remaining information placed in the
              * address_lines. It would be possible to format such an address very
              * approximately without geocoding, but no semantic reasoning could be
              * made about any of the address components until it was at least
              * partially resolved.
        +     *
              * Creating an address only containing a region_code and address_lines, and
              * then geocoding is the recommended way to handle completely unstructured
              * addresses (as opposed to guessing which parts of the address should be
        @@ -2633,19 +2787,21 @@ public Builder addAddressLinesBytes(com.google.protobuf.ByteString value) {
               checkByteStringIsUtf8(value);
               ensureAddressLinesIsMutable();
               addressLines_.add(value);
        +      bitField0_ |= 0x00000100;
               onChanged();
               return this;
             }
         
        -    private com.google.protobuf.LazyStringList recipients_ =
        -        com.google.protobuf.LazyStringArrayList.EMPTY;
        +    private com.google.protobuf.LazyStringArrayList recipients_ =
        +        com.google.protobuf.LazyStringArrayList.emptyList();
         
             private void ensureRecipientsIsMutable() {
        -      if (!((bitField0_ & 0x00000002) != 0)) {
        +      if (!recipients_.isModifiable()) {
                 recipients_ = new com.google.protobuf.LazyStringArrayList(recipients_);
        -        bitField0_ |= 0x00000002;
               }
        +      bitField0_ |= 0x00000200;
             }
        +
             /**
              *
              *
        @@ -2660,8 +2816,10 @@ private void ensureRecipientsIsMutable() {
              * @return A list containing the recipients.
              */
             public com.google.protobuf.ProtocolStringList getRecipientsList() {
        -      return recipients_.getUnmodifiableView();
        +      recipients_.makeImmutable();
        +      return recipients_;
             }
        +
             /**
              *
              *
        @@ -2678,6 +2836,7 @@ public com.google.protobuf.ProtocolStringList getRecipientsList() {
             public int getRecipientsCount() {
               return recipients_.size();
             }
        +
             /**
              *
              *
        @@ -2695,6 +2854,7 @@ public int getRecipientsCount() {
             public java.lang.String getRecipients(int index) {
               return recipients_.get(index);
             }
        +
             /**
              *
              *
        @@ -2712,6 +2872,7 @@ public java.lang.String getRecipients(int index) {
             public com.google.protobuf.ByteString getRecipientsBytes(int index) {
               return recipients_.getByteString(index);
             }
        +
             /**
              *
              *
        @@ -2733,9 +2894,11 @@ public Builder setRecipients(int index, java.lang.String value) {
               }
               ensureRecipientsIsMutable();
               recipients_.set(index, value);
        +      bitField0_ |= 0x00000200;
               onChanged();
               return this;
             }
        +
             /**
              *
              *
        @@ -2756,9 +2919,11 @@ public Builder addRecipients(java.lang.String value) {
               }
               ensureRecipientsIsMutable();
               recipients_.add(value);
        +      bitField0_ |= 0x00000200;
               onChanged();
               return this;
             }
        +
             /**
              *
              *
        @@ -2776,9 +2941,11 @@ public Builder addRecipients(java.lang.String value) {
             public Builder addAllRecipients(java.lang.Iterable values) {
               ensureRecipientsIsMutable();
               com.google.protobuf.AbstractMessageLite.Builder.addAll(values, recipients_);
        +      bitField0_ |= 0x00000200;
               onChanged();
               return this;
             }
        +
             /**
              *
              *
        @@ -2793,11 +2960,13 @@ public Builder addAllRecipients(java.lang.Iterable values) {
              * @return This builder for chaining.
              */
             public Builder clearRecipients() {
        -      recipients_ = com.google.protobuf.LazyStringArrayList.EMPTY;
        -      bitField0_ = (bitField0_ & ~0x00000002);
        +      recipients_ = com.google.protobuf.LazyStringArrayList.emptyList();
        +      bitField0_ = (bitField0_ & ~0x00000200);
        +      ;
               onChanged();
               return this;
             }
        +
             /**
              *
              *
        @@ -2819,11 +2988,13 @@ public Builder addRecipientsBytes(com.google.protobuf.ByteString value) {
               checkByteStringIsUtf8(value);
               ensureRecipientsIsMutable();
               recipients_.add(value);
        +      bitField0_ |= 0x00000200;
               onChanged();
               return this;
             }
         
             private java.lang.Object organization_ = "";
        +
             /**
              *
              *
        @@ -2846,6 +3017,7 @@ public java.lang.String getOrganization() {
                 return (java.lang.String) ref;
               }
             }
        +
             /**
              *
              *
        @@ -2868,6 +3040,7 @@ public com.google.protobuf.ByteString getOrganizationBytes() {
                 return (com.google.protobuf.ByteString) ref;
               }
             }
        +
             /**
              *
              *
        @@ -2884,11 +3057,12 @@ public Builder setOrganization(java.lang.String value) {
               if (value == null) {
                 throw new NullPointerException();
               }
        -
               organization_ = value;
        +      bitField0_ |= 0x00000400;
               onChanged();
               return this;
             }
        +
             /**
              *
              *
        @@ -2901,11 +3075,12 @@ public Builder setOrganization(java.lang.String value) {
              * @return This builder for chaining.
              */
             public Builder clearOrganization() {
        -
               organization_ = getDefaultInstance().getOrganization();
        +      bitField0_ = (bitField0_ & ~0x00000400);
               onChanged();
               return this;
             }
        +
             /**
              *
              *
        @@ -2923,23 +3098,12 @@ public Builder setOrganizationBytes(com.google.protobuf.ByteString value) {
                 throw new NullPointerException();
               }
               checkByteStringIsUtf8(value);
        -
               organization_ = value;
        +      bitField0_ |= 0x00000400;
               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.type.PostalAddress)
           }
         
        diff --git a/java-common-protos/proto-google-common-protos/src/main/java/com/google/type/PostalAddressOrBuilder.java b/java-common-protos/proto-google-common-protos/src/main/java/com/google/type/PostalAddressOrBuilder.java
        index a760feb104..a207ac5afd 100644
        --- a/java-common-protos/proto-google-common-protos/src/main/java/com/google/type/PostalAddressOrBuilder.java
        +++ b/java-common-protos/proto-google-common-protos/src/main/java/com/google/type/PostalAddressOrBuilder.java
        @@ -1,5 +1,5 @@
         /*
        - * Copyright 2020 Google LLC
        + * Copyright 2026 Google LLC
          *
          * Licensed under the Apache License, Version 2.0 (the "License");
          * you may not use this file except in compliance with the License.
        @@ -14,10 +14,13 @@
          * limitations under the License.
          */
         // Generated by the protocol buffer compiler.  DO NOT EDIT!
        +// NO CHECKED-IN PROTOBUF GENCODE
         // source: google/type/postal_address.proto
        +// Protobuf Java Version: 4.33.2
         
         package com.google.type;
         
        +@com.google.protobuf.Generated
         public interface PostalAddressOrBuilder
             extends
             // @@protoc_insertion_point(interface_extends:google.type.PostalAddress)
        @@ -29,6 +32,7 @@ public interface PostalAddressOrBuilder
            * 
            * The schema revision of the `PostalAddress`. This must be set to 0, which is
            * the latest revision.
        +   *
            * All new revisions **must** be backward compatible with old revisions.
            * 
        * @@ -54,6 +58,7 @@ public interface PostalAddressOrBuilder * @return The regionCode. */ java.lang.String getRegionCode(); + /** * * @@ -82,8 +87,10 @@ public interface PostalAddressOrBuilder * This can affect formatting in certain countries, but is not critical * to the correctness of the data and will never affect any validation or * other non-formatting related operations. + * * If this value is not known, it should be omitted (rather than specifying a * possibly incorrect default). + * * Examples: "zh-Hant", "ja", "ja-Latn", "en". *
        * @@ -92,6 +99,7 @@ public interface PostalAddressOrBuilder * @return The languageCode. */ java.lang.String getLanguageCode(); + /** * * @@ -103,8 +111,10 @@ public interface PostalAddressOrBuilder * This can affect formatting in certain countries, but is not critical * to the correctness of the data and will never affect any validation or * other non-formatting related operations. + * * If this value is not known, it should be omitted (rather than specifying a * possibly incorrect default). + * * Examples: "zh-Hant", "ja", "ja-Latn", "en". *
        * @@ -129,6 +139,7 @@ public interface PostalAddressOrBuilder * @return The postalCode. */ java.lang.String getPostalCode(); + /** * * @@ -161,6 +172,7 @@ public interface PostalAddressOrBuilder * @return The sortingCode. */ java.lang.String getSortingCode(); + /** * * @@ -196,6 +208,7 @@ public interface PostalAddressOrBuilder * @return The administrativeArea. */ java.lang.String getAdministrativeArea(); + /** * * @@ -230,6 +243,7 @@ public interface PostalAddressOrBuilder * @return The locality. */ java.lang.String getLocality(); + /** * * @@ -259,6 +273,7 @@ public interface PostalAddressOrBuilder * @return The sublocality. */ java.lang.String getSublocality(); + /** * * @@ -278,6 +293,7 @@ public interface PostalAddressOrBuilder * *
            * Unstructured address lines describing the lower levels of an address.
        +   *
            * Because values in address_lines do not have type information and may
            * sometimes contain multiple values in a single field (e.g.
            * "Austin, TX"), it is important that the line order is clear. The order of
        @@ -286,12 +302,14 @@ public interface PostalAddressOrBuilder
            * used to make it explicit (e.g. "ja" for large-to-small ordering and
            * "ja-Latn" or "en" for small-to-large). This way, the most specific line of
            * an address can be selected based on the language.
        +   *
            * The minimum permitted structural representation of an address consists
            * of a region_code with all remaining information placed in the
            * address_lines. It would be possible to format such an address very
            * approximately without geocoding, but no semantic reasoning could be
            * made about any of the address components until it was at least
            * partially resolved.
        +   *
            * Creating an address only containing a region_code and address_lines, and
            * then geocoding is the recommended way to handle completely unstructured
            * addresses (as opposed to guessing which parts of the address should be
        @@ -303,11 +321,13 @@ public interface PostalAddressOrBuilder
            * @return A list containing the addressLines.
            */
           java.util.List getAddressLinesList();
        +
           /**
            *
            *
            * 
            * Unstructured address lines describing the lower levels of an address.
        +   *
            * Because values in address_lines do not have type information and may
            * sometimes contain multiple values in a single field (e.g.
            * "Austin, TX"), it is important that the line order is clear. The order of
        @@ -316,12 +336,14 @@ public interface PostalAddressOrBuilder
            * used to make it explicit (e.g. "ja" for large-to-small ordering and
            * "ja-Latn" or "en" for small-to-large). This way, the most specific line of
            * an address can be selected based on the language.
        +   *
            * The minimum permitted structural representation of an address consists
            * of a region_code with all remaining information placed in the
            * address_lines. It would be possible to format such an address very
            * approximately without geocoding, but no semantic reasoning could be
            * made about any of the address components until it was at least
            * partially resolved.
        +   *
            * Creating an address only containing a region_code and address_lines, and
            * then geocoding is the recommended way to handle completely unstructured
            * addresses (as opposed to guessing which parts of the address should be
        @@ -333,11 +355,13 @@ public interface PostalAddressOrBuilder
            * @return The count of addressLines.
            */
           int getAddressLinesCount();
        +
           /**
            *
            *
            * 
            * Unstructured address lines describing the lower levels of an address.
        +   *
            * Because values in address_lines do not have type information and may
            * sometimes contain multiple values in a single field (e.g.
            * "Austin, TX"), it is important that the line order is clear. The order of
        @@ -346,12 +370,14 @@ public interface PostalAddressOrBuilder
            * used to make it explicit (e.g. "ja" for large-to-small ordering and
            * "ja-Latn" or "en" for small-to-large). This way, the most specific line of
            * an address can be selected based on the language.
        +   *
            * The minimum permitted structural representation of an address consists
            * of a region_code with all remaining information placed in the
            * address_lines. It would be possible to format such an address very
            * approximately without geocoding, but no semantic reasoning could be
            * made about any of the address components until it was at least
            * partially resolved.
        +   *
            * Creating an address only containing a region_code and address_lines, and
            * then geocoding is the recommended way to handle completely unstructured
            * addresses (as opposed to guessing which parts of the address should be
        @@ -364,11 +390,13 @@ public interface PostalAddressOrBuilder
            * @return The addressLines at the given index.
            */
           java.lang.String getAddressLines(int index);
        +
           /**
            *
            *
            * 
            * Unstructured address lines describing the lower levels of an address.
        +   *
            * Because values in address_lines do not have type information and may
            * sometimes contain multiple values in a single field (e.g.
            * "Austin, TX"), it is important that the line order is clear. The order of
        @@ -377,12 +405,14 @@ public interface PostalAddressOrBuilder
            * used to make it explicit (e.g. "ja" for large-to-small ordering and
            * "ja-Latn" or "en" for small-to-large). This way, the most specific line of
            * an address can be selected based on the language.
        +   *
            * The minimum permitted structural representation of an address consists
            * of a region_code with all remaining information placed in the
            * address_lines. It would be possible to format such an address very
            * approximately without geocoding, but no semantic reasoning could be
            * made about any of the address components until it was at least
            * partially resolved.
        +   *
            * Creating an address only containing a region_code and address_lines, and
            * then geocoding is the recommended way to handle completely unstructured
            * addresses (as opposed to guessing which parts of the address should be
        @@ -410,6 +440,7 @@ public interface PostalAddressOrBuilder
            * @return A list containing the recipients.
            */
           java.util.List getRecipientsList();
        +
           /**
            *
            *
        @@ -424,6 +455,7 @@ public interface PostalAddressOrBuilder
            * @return The count of recipients.
            */
           int getRecipientsCount();
        +
           /**
            *
            *
        @@ -439,6 +471,7 @@ public interface PostalAddressOrBuilder
            * @return The recipients at the given index.
            */
           java.lang.String getRecipients(int index);
        +
           /**
            *
            *
        @@ -467,6 +500,7 @@ public interface PostalAddressOrBuilder
            * @return The organization.
            */
           java.lang.String getOrganization();
        +
           /**
            *
            *
        diff --git a/java-common-protos/proto-google-common-protos/src/main/java/com/google/type/PostalAddressProto.java b/java-common-protos/proto-google-common-protos/src/main/java/com/google/type/PostalAddressProto.java
        index 1586e1a670..3cf23944f8 100644
        --- a/java-common-protos/proto-google-common-protos/src/main/java/com/google/type/PostalAddressProto.java
        +++ b/java-common-protos/proto-google-common-protos/src/main/java/com/google/type/PostalAddressProto.java
        @@ -1,5 +1,5 @@
         /*
        - * Copyright 2020 Google LLC
        + * Copyright 2026 Google LLC
          *
          * Licensed under the Apache License, Version 2.0 (the "License");
          * you may not use this file except in compliance with the License.
        @@ -14,13 +14,26 @@
          * limitations under the License.
          */
         // Generated by the protocol buffer compiler.  DO NOT EDIT!
        +// NO CHECKED-IN PROTOBUF GENCODE
         // source: google/type/postal_address.proto
        +// Protobuf Java Version: 4.33.2
         
         package com.google.type;
         
        -public final class PostalAddressProto {
        +@com.google.protobuf.Generated
        +public final class PostalAddressProto extends com.google.protobuf.GeneratedFile {
           private PostalAddressProto() {}
         
        +  static {
        +    com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion(
        +        com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC,
        +        /* major= */ 4,
        +        /* minor= */ 33,
        +        /* patch= */ 2,
        +        /* suffix= */ "",
        +        "PostalAddressProto");
        +  }
        +
           public static void registerAllExtensions(com.google.protobuf.ExtensionRegistryLite registry) {}
         
           public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry registry) {
        @@ -29,7 +42,7 @@ public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry r
         
           static final com.google.protobuf.Descriptors.Descriptor
               internal_static_google_type_PostalAddress_descriptor;
        -  static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
        +  static final com.google.protobuf.GeneratedMessage.FieldAccessorTable
               internal_static_google_type_PostalAddress_fieldAccessorTable;
         
           public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() {
        @@ -55,9 +68,9 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() {
             descriptor =
                 com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom(
                     descriptorData, new com.google.protobuf.Descriptors.FileDescriptor[] {});
        -    internal_static_google_type_PostalAddress_descriptor = getDescriptor().getMessageTypes().get(0);
        +    internal_static_google_type_PostalAddress_descriptor = getDescriptor().getMessageType(0);
             internal_static_google_type_PostalAddress_fieldAccessorTable =
        -        new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
        +        new com.google.protobuf.GeneratedMessage.FieldAccessorTable(
                     internal_static_google_type_PostalAddress_descriptor,
                     new java.lang.String[] {
                       "Revision",
        @@ -72,6 +85,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() {
                       "Recipients",
                       "Organization",
                     });
        +    descriptor.resolveAllFeaturesImmutable();
           }
         
           // @@protoc_insertion_point(outer_class_scope)
        diff --git a/java-common-protos/proto-google-common-protos/src/main/java/com/google/type/Quaternion.java b/java-common-protos/proto-google-common-protos/src/main/java/com/google/type/Quaternion.java
        index 37e3bf81b6..031501d555 100644
        --- a/java-common-protos/proto-google-common-protos/src/main/java/com/google/type/Quaternion.java
        +++ b/java-common-protos/proto-google-common-protos/src/main/java/com/google/type/Quaternion.java
        @@ -1,5 +1,5 @@
         /*
        - * Copyright 2020 Google LLC
        + * Copyright 2026 Google LLC
          *
          * Licensed under the Apache License, Version 2.0 (the "License");
          * you may not use this file except in compliance with the License.
        @@ -14,7 +14,9 @@
          * limitations under the License.
          */
         // Generated by the protocol buffer compiler.  DO NOT EDIT!
        +// NO CHECKED-IN PROTOBUF GENCODE
         // source: google/type/quaternion.proto
        +// Protobuf Java Version: 4.33.2
         
         package com.google.type;
         
        @@ -25,41 +27,53 @@
          * A quaternion is defined as the quotient of two directed lines in a
          * three-dimensional space or equivalently as the quotient of two Euclidean
          * vectors (https://en.wikipedia.org/wiki/Quaternion).
        + *
          * Quaternions are often used in calculations involving three-dimensional
          * rotations (https://en.wikipedia.org/wiki/Quaternions_and_spatial_rotation),
          * as they provide greater mathematical robustness by avoiding the gimbal lock
          * problems that can be encountered when using Euler angles
          * (https://en.wikipedia.org/wiki/Gimbal_lock).
        + *
          * Quaternions are generally represented in this form:
        - *     w + xi + yj + zk
        + *
        + * w + xi + yj + zk
        + *
          * where x, y, z, and w are real numbers, and i, j, and k are three imaginary
          * numbers.
        + *
          * Our naming choice `(x, y, z, w)` comes from the desire to avoid confusion for
          * those interested in the geometric properties of the quaternion in the 3D
          * Cartesian space. Other texts often use alternative names or subscripts, such
          * as `(a, b, c, d)`, `(1, i, j, k)`, or `(0, 1, 2, 3)`, which are perhaps
          * better suited for mathematical interpretations.
        + *
          * To avoid any confusion, as well as to maintain compatibility with a large
          * number of software libraries, the quaternions represented using the protocol
          * buffer below *must* follow the Hamilton convention, which defines `ij = k`
          * (i.e. a right-handed algebra), and therefore:
        - *     i^2 = j^2 = k^2 = ijk = −1
        - *     ij = −ji = k
        - *     jk = −kj = i
        - *     ki = −ik = j
        + *
        + * i^2 = j^2 = k^2 = ijk = −1
        + * ij = −ji = k
        + * jk = −kj = i
        + * ki = −ik = j
        + *
          * Please DO NOT use this to represent quaternions that follow the JPL
          * convention, or any of the other quaternion flavors out there.
        + *
          * Definitions:
        - *   - Quaternion norm (or magnitude): `sqrt(x^2 + y^2 + z^2 + w^2)`.
        - *   - Unit (or normalized) quaternion: a quaternion whose norm is 1.
        - *   - Pure quaternion: a quaternion whose scalar component (`w`) is 0.
        - *   - Rotation quaternion: a unit quaternion used to represent rotation.
        - *   - Orientation quaternion: a unit quaternion used to represent orientation.
        + *
        + * - Quaternion norm (or magnitude): `sqrt(x^2 + y^2 + z^2 + w^2)`.
        + * - Unit (or normalized) quaternion: a quaternion whose norm is 1.
        + * - Pure quaternion: a quaternion whose scalar component (`w`) is 0.
        + * - Rotation quaternion: a unit quaternion used to represent rotation.
        + * - Orientation quaternion: a unit quaternion used to represent orientation.
        + *
          * A quaternion can be normalized by dividing it by its norm. The resulting
          * quaternion maintains the same direction, but has a norm of 1, i.e. it moves
          * on the unit sphere. This is generally necessary for rotation and orientation
          * quaternions, to avoid rounding errors:
          * https://en.wikipedia.org/wiki/Rotation_formalisms_in_three_dimensions
        + *
          * Note that `(x, y, z, w)` and `(-x, -y, -z, -w)` represent the same rotation,
          * but normalization would be even more useful, e.g. for comparison purposes, if
          * it would produce a unique representation. It is thus recommended that `w` be
        @@ -69,35 +83,36 @@
          *
          * Protobuf type {@code google.type.Quaternion}
          */
        -public final class Quaternion extends com.google.protobuf.GeneratedMessageV3
        +@com.google.protobuf.Generated
        +public final class Quaternion extends com.google.protobuf.GeneratedMessage
             implements
             // @@protoc_insertion_point(message_implements:google.type.Quaternion)
             QuaternionOrBuilder {
           private static final long serialVersionUID = 0L;
        +
        +  static {
        +    com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion(
        +        com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC,
        +        /* major= */ 4,
        +        /* minor= */ 33,
        +        /* patch= */ 2,
        +        /* suffix= */ "",
        +        "Quaternion");
        +  }
        +
           // Use Quaternion.newBuilder() to construct.
        -  private Quaternion(com.google.protobuf.GeneratedMessageV3.Builder builder) {
        +  private Quaternion(com.google.protobuf.GeneratedMessage.Builder builder) {
             super(builder);
           }
         
           private Quaternion() {}
         
        -  @java.lang.Override
        -  @SuppressWarnings({"unused"})
        -  protected java.lang.Object newInstance(UnusedPrivateParameter unused) {
        -    return new Quaternion();
        -  }
        -
        -  @java.lang.Override
        -  public final com.google.protobuf.UnknownFieldSet getUnknownFields() {
        -    return this.unknownFields;
        -  }
        -
           public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
             return com.google.type.QuaternionProto.internal_static_google_type_Quaternion_descriptor;
           }
         
           @java.lang.Override
        -  protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
        +  protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
               internalGetFieldAccessorTable() {
             return com.google.type.QuaternionProto.internal_static_google_type_Quaternion_fieldAccessorTable
                 .ensureFieldAccessorsInitialized(
        @@ -105,7 +120,8 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
           }
         
           public static final int X_FIELD_NUMBER = 1;
        -  private double x_;
        +  private double x_ = 0D;
        +
           /**
            *
            *
        @@ -123,7 +139,8 @@ public double getX() {
           }
         
           public static final int Y_FIELD_NUMBER = 2;
        -  private double y_;
        +  private double y_ = 0D;
        +
           /**
            *
            *
        @@ -141,7 +158,8 @@ public double getY() {
           }
         
           public static final int Z_FIELD_NUMBER = 3;
        -  private double z_;
        +  private double z_ = 0D;
        +
           /**
            *
            *
        @@ -159,7 +177,8 @@ public double getZ() {
           }
         
           public static final int W_FIELD_NUMBER = 4;
        -  private double w_;
        +  private double w_ = 0D;
        +
           /**
            *
            *
        @@ -314,38 +333,38 @@ public static com.google.type.Quaternion parseFrom(
         
           public static com.google.type.Quaternion parseFrom(java.io.InputStream input)
               throws java.io.IOException {
        -    return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
        +    return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input);
           }
         
           public static com.google.type.Quaternion parseFrom(
               java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
               throws java.io.IOException {
        -    return com.google.protobuf.GeneratedMessageV3.parseWithIOException(
        +    return com.google.protobuf.GeneratedMessage.parseWithIOException(
                 PARSER, input, extensionRegistry);
           }
         
           public static com.google.type.Quaternion parseDelimitedFrom(java.io.InputStream input)
               throws java.io.IOException {
        -    return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input);
        +    return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input);
           }
         
           public static com.google.type.Quaternion parseDelimitedFrom(
               java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
               throws java.io.IOException {
        -    return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(
        +    return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(
                 PARSER, input, extensionRegistry);
           }
         
           public static com.google.type.Quaternion parseFrom(com.google.protobuf.CodedInputStream input)
               throws java.io.IOException {
        -    return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
        +    return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input);
           }
         
           public static com.google.type.Quaternion parseFrom(
               com.google.protobuf.CodedInputStream input,
               com.google.protobuf.ExtensionRegistryLite extensionRegistry)
               throws java.io.IOException {
        -    return com.google.protobuf.GeneratedMessageV3.parseWithIOException(
        +    return com.google.protobuf.GeneratedMessage.parseWithIOException(
                 PARSER, input, extensionRegistry);
           }
         
        @@ -368,10 +387,11 @@ public Builder toBuilder() {
           }
         
           @java.lang.Override
        -  protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
        +  protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) {
             Builder builder = new Builder(parent);
             return builder;
           }
        +
           /**
            *
            *
        @@ -379,41 +399,53 @@ protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.Build
            * A quaternion is defined as the quotient of two directed lines in a
            * three-dimensional space or equivalently as the quotient of two Euclidean
            * vectors (https://en.wikipedia.org/wiki/Quaternion).
        +   *
            * Quaternions are often used in calculations involving three-dimensional
            * rotations (https://en.wikipedia.org/wiki/Quaternions_and_spatial_rotation),
            * as they provide greater mathematical robustness by avoiding the gimbal lock
            * problems that can be encountered when using Euler angles
            * (https://en.wikipedia.org/wiki/Gimbal_lock).
        +   *
            * Quaternions are generally represented in this form:
        -   *     w + xi + yj + zk
        +   *
        +   * w + xi + yj + zk
        +   *
            * where x, y, z, and w are real numbers, and i, j, and k are three imaginary
            * numbers.
        +   *
            * Our naming choice `(x, y, z, w)` comes from the desire to avoid confusion for
            * those interested in the geometric properties of the quaternion in the 3D
            * Cartesian space. Other texts often use alternative names or subscripts, such
            * as `(a, b, c, d)`, `(1, i, j, k)`, or `(0, 1, 2, 3)`, which are perhaps
            * better suited for mathematical interpretations.
        +   *
            * To avoid any confusion, as well as to maintain compatibility with a large
            * number of software libraries, the quaternions represented using the protocol
            * buffer below *must* follow the Hamilton convention, which defines `ij = k`
            * (i.e. a right-handed algebra), and therefore:
        -   *     i^2 = j^2 = k^2 = ijk = −1
        -   *     ij = −ji = k
        -   *     jk = −kj = i
        -   *     ki = −ik = j
        +   *
        +   * i^2 = j^2 = k^2 = ijk = −1
        +   * ij = −ji = k
        +   * jk = −kj = i
        +   * ki = −ik = j
        +   *
            * Please DO NOT use this to represent quaternions that follow the JPL
            * convention, or any of the other quaternion flavors out there.
        +   *
            * Definitions:
        -   *   - Quaternion norm (or magnitude): `sqrt(x^2 + y^2 + z^2 + w^2)`.
        -   *   - Unit (or normalized) quaternion: a quaternion whose norm is 1.
        -   *   - Pure quaternion: a quaternion whose scalar component (`w`) is 0.
        -   *   - Rotation quaternion: a unit quaternion used to represent rotation.
        -   *   - Orientation quaternion: a unit quaternion used to represent orientation.
        +   *
        +   * - Quaternion norm (or magnitude): `sqrt(x^2 + y^2 + z^2 + w^2)`.
        +   * - Unit (or normalized) quaternion: a quaternion whose norm is 1.
        +   * - Pure quaternion: a quaternion whose scalar component (`w`) is 0.
        +   * - Rotation quaternion: a unit quaternion used to represent rotation.
        +   * - Orientation quaternion: a unit quaternion used to represent orientation.
        +   *
            * A quaternion can be normalized by dividing it by its norm. The resulting
            * quaternion maintains the same direction, but has a norm of 1, i.e. it moves
            * on the unit sphere. This is generally necessary for rotation and orientation
            * quaternions, to avoid rounding errors:
            * https://en.wikipedia.org/wiki/Rotation_formalisms_in_three_dimensions
        +   *
            * Note that `(x, y, z, w)` and `(-x, -y, -z, -w)` represent the same rotation,
            * but normalization would be even more useful, e.g. for comparison purposes, if
            * it would produce a unique representation. It is thus recommended that `w` be
        @@ -423,7 +455,7 @@ protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.Build
            *
            * Protobuf type {@code google.type.Quaternion}
            */
        -  public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder
        +  public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder
               implements
               // @@protoc_insertion_point(builder_implements:google.type.Quaternion)
               com.google.type.QuaternionOrBuilder {
        @@ -432,7 +464,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
             }
         
             @java.lang.Override
        -    protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
        +    protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
                 internalGetFieldAccessorTable() {
               return com.google.type.QuaternionProto
                   .internal_static_google_type_Quaternion_fieldAccessorTable
        @@ -443,21 +475,18 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
             // Construct using com.google.type.Quaternion.newBuilder()
             private Builder() {}
         
        -    private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
        +    private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) {
               super(parent);
             }
         
             @java.lang.Override
             public Builder clear() {
               super.clear();
        +      bitField0_ = 0;
               x_ = 0D;
        -
               y_ = 0D;
        -
               z_ = 0D;
        -
               w_ = 0D;
        -
               return this;
             }
         
        @@ -483,45 +512,27 @@ public com.google.type.Quaternion build() {
             @java.lang.Override
             public com.google.type.Quaternion buildPartial() {
               com.google.type.Quaternion result = new com.google.type.Quaternion(this);
        -      result.x_ = x_;
        -      result.y_ = y_;
        -      result.z_ = z_;
        -      result.w_ = w_;
        +      if (bitField0_ != 0) {
        +        buildPartial0(result);
        +      }
               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);
        +    private void buildPartial0(com.google.type.Quaternion result) {
        +      int from_bitField0_ = bitField0_;
        +      if (((from_bitField0_ & 0x00000001) != 0)) {
        +        result.x_ = x_;
        +      }
        +      if (((from_bitField0_ & 0x00000002) != 0)) {
        +        result.y_ = y_;
        +      }
        +      if (((from_bitField0_ & 0x00000004) != 0)) {
        +        result.z_ = z_;
        +      }
        +      if (((from_bitField0_ & 0x00000008) != 0)) {
        +        result.w_ = w_;
        +      }
             }
         
             @java.lang.Override
        @@ -536,16 +547,16 @@ public Builder mergeFrom(com.google.protobuf.Message other) {
         
             public Builder mergeFrom(com.google.type.Quaternion other) {
               if (other == com.google.type.Quaternion.getDefaultInstance()) return this;
        -      if (other.getX() != 0D) {
        +      if (java.lang.Double.doubleToRawLongBits(other.getX()) != 0) {
                 setX(other.getX());
               }
        -      if (other.getY() != 0D) {
        +      if (java.lang.Double.doubleToRawLongBits(other.getY()) != 0) {
                 setY(other.getY());
               }
        -      if (other.getZ() != 0D) {
        +      if (java.lang.Double.doubleToRawLongBits(other.getZ()) != 0) {
                 setZ(other.getZ());
               }
        -      if (other.getW() != 0D) {
        +      if (java.lang.Double.doubleToRawLongBits(other.getW()) != 0) {
                 setW(other.getW());
               }
               this.mergeUnknownFields(other.getUnknownFields());
        @@ -577,25 +588,25 @@ public Builder mergeFrom(
                     case 9:
                       {
                         x_ = input.readDouble();
        -
        +                bitField0_ |= 0x00000001;
                         break;
                       } // case 9
                     case 17:
                       {
                         y_ = input.readDouble();
        -
        +                bitField0_ |= 0x00000002;
                         break;
                       } // case 17
                     case 25:
                       {
                         z_ = input.readDouble();
        -
        +                bitField0_ |= 0x00000004;
                         break;
                       } // case 25
                     case 33:
                       {
                         w_ = input.readDouble();
        -
        +                bitField0_ |= 0x00000008;
                         break;
                       } // case 33
                     default:
        @@ -615,7 +626,10 @@ public Builder mergeFrom(
               return this;
             }
         
        +    private int bitField0_;
        +
             private double x_;
        +
             /**
              *
              *
        @@ -631,6 +645,7 @@ public Builder mergeFrom(
             public double getX() {
               return x_;
             }
        +
             /**
              *
              *
        @@ -646,9 +661,11 @@ public double getX() {
             public Builder setX(double value) {
         
               x_ = value;
        +      bitField0_ |= 0x00000001;
               onChanged();
               return this;
             }
        +
             /**
              *
              *
        @@ -661,13 +678,14 @@ public Builder setX(double value) {
              * @return This builder for chaining.
              */
             public Builder clearX() {
        -
        +      bitField0_ = (bitField0_ & ~0x00000001);
               x_ = 0D;
               onChanged();
               return this;
             }
         
             private double y_;
        +
             /**
              *
              *
        @@ -683,6 +701,7 @@ public Builder clearX() {
             public double getY() {
               return y_;
             }
        +
             /**
              *
              *
        @@ -698,9 +717,11 @@ public double getY() {
             public Builder setY(double value) {
         
               y_ = value;
        +      bitField0_ |= 0x00000002;
               onChanged();
               return this;
             }
        +
             /**
              *
              *
        @@ -713,13 +734,14 @@ public Builder setY(double value) {
              * @return This builder for chaining.
              */
             public Builder clearY() {
        -
        +      bitField0_ = (bitField0_ & ~0x00000002);
               y_ = 0D;
               onChanged();
               return this;
             }
         
             private double z_;
        +
             /**
              *
              *
        @@ -735,6 +757,7 @@ public Builder clearY() {
             public double getZ() {
               return z_;
             }
        +
             /**
              *
              *
        @@ -750,9 +773,11 @@ public double getZ() {
             public Builder setZ(double value) {
         
               z_ = value;
        +      bitField0_ |= 0x00000004;
               onChanged();
               return this;
             }
        +
             /**
              *
              *
        @@ -765,13 +790,14 @@ public Builder setZ(double value) {
              * @return This builder for chaining.
              */
             public Builder clearZ() {
        -
        +      bitField0_ = (bitField0_ & ~0x00000004);
               z_ = 0D;
               onChanged();
               return this;
             }
         
             private double w_;
        +
             /**
              *
              *
        @@ -787,6 +813,7 @@ public Builder clearZ() {
             public double getW() {
               return w_;
             }
        +
             /**
              *
              *
        @@ -802,9 +829,11 @@ public double getW() {
             public Builder setW(double value) {
         
               w_ = value;
        +      bitField0_ |= 0x00000008;
               onChanged();
               return this;
             }
        +
             /**
              *
              *
        @@ -817,23 +846,12 @@ public Builder setW(double value) {
              * @return This builder for chaining.
              */
             public Builder clearW() {
        -
        +      bitField0_ = (bitField0_ & ~0x00000008);
               w_ = 0D;
               onChanged();
               return this;
             }
         
        -    @java.lang.Override
        -    public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) {
        -      return super.setUnknownFields(unknownFields);
        -    }
        -
        -    @java.lang.Override
        -    public final Builder mergeUnknownFields(
        -        final com.google.protobuf.UnknownFieldSet unknownFields) {
        -      return super.mergeUnknownFields(unknownFields);
        -    }
        -
             // @@protoc_insertion_point(builder_scope:google.type.Quaternion)
           }
         
        diff --git a/java-common-protos/proto-google-common-protos/src/main/java/com/google/type/QuaternionOrBuilder.java b/java-common-protos/proto-google-common-protos/src/main/java/com/google/type/QuaternionOrBuilder.java
        index ed98241545..1ec0e6c947 100644
        --- a/java-common-protos/proto-google-common-protos/src/main/java/com/google/type/QuaternionOrBuilder.java
        +++ b/java-common-protos/proto-google-common-protos/src/main/java/com/google/type/QuaternionOrBuilder.java
        @@ -1,5 +1,5 @@
         /*
        - * Copyright 2020 Google LLC
        + * Copyright 2026 Google LLC
          *
          * Licensed under the Apache License, Version 2.0 (the "License");
          * you may not use this file except in compliance with the License.
        @@ -14,10 +14,13 @@
          * limitations under the License.
          */
         // Generated by the protocol buffer compiler.  DO NOT EDIT!
        +// NO CHECKED-IN PROTOBUF GENCODE
         // source: google/type/quaternion.proto
        +// Protobuf Java Version: 4.33.2
         
         package com.google.type;
         
        +@com.google.protobuf.Generated
         public interface QuaternionOrBuilder
             extends
             // @@protoc_insertion_point(interface_extends:google.type.Quaternion)
        diff --git a/java-common-protos/proto-google-common-protos/src/main/java/com/google/type/QuaternionProto.java b/java-common-protos/proto-google-common-protos/src/main/java/com/google/type/QuaternionProto.java
        index 068b26b377..704adf128e 100644
        --- a/java-common-protos/proto-google-common-protos/src/main/java/com/google/type/QuaternionProto.java
        +++ b/java-common-protos/proto-google-common-protos/src/main/java/com/google/type/QuaternionProto.java
        @@ -1,5 +1,5 @@
         /*
        - * Copyright 2020 Google LLC
        + * Copyright 2026 Google LLC
          *
          * Licensed under the Apache License, Version 2.0 (the "License");
          * you may not use this file except in compliance with the License.
        @@ -14,13 +14,26 @@
          * limitations under the License.
          */
         // Generated by the protocol buffer compiler.  DO NOT EDIT!
        +// NO CHECKED-IN PROTOBUF GENCODE
         // source: google/type/quaternion.proto
        +// Protobuf Java Version: 4.33.2
         
         package com.google.type;
         
        -public final class QuaternionProto {
        +@com.google.protobuf.Generated
        +public final class QuaternionProto extends com.google.protobuf.GeneratedFile {
           private QuaternionProto() {}
         
        +  static {
        +    com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion(
        +        com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC,
        +        /* major= */ 4,
        +        /* minor= */ 33,
        +        /* patch= */ 2,
        +        /* suffix= */ "",
        +        "QuaternionProto");
        +  }
        +
           public static void registerAllExtensions(com.google.protobuf.ExtensionRegistryLite registry) {}
         
           public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry registry) {
        @@ -29,7 +42,7 @@ public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry r
         
           static final com.google.protobuf.Descriptors.Descriptor
               internal_static_google_type_Quaternion_descriptor;
        -  static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
        +  static final com.google.protobuf.GeneratedMessage.FieldAccessorTable
               internal_static_google_type_Quaternion_fieldAccessorTable;
         
           public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() {
        @@ -50,13 +63,14 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() {
             descriptor =
                 com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom(
                     descriptorData, new com.google.protobuf.Descriptors.FileDescriptor[] {});
        -    internal_static_google_type_Quaternion_descriptor = getDescriptor().getMessageTypes().get(0);
        +    internal_static_google_type_Quaternion_descriptor = getDescriptor().getMessageType(0);
             internal_static_google_type_Quaternion_fieldAccessorTable =
        -        new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
        +        new com.google.protobuf.GeneratedMessage.FieldAccessorTable(
                     internal_static_google_type_Quaternion_descriptor,
                     new java.lang.String[] {
                       "X", "Y", "Z", "W",
                     });
        +    descriptor.resolveAllFeaturesImmutable();
           }
         
           // @@protoc_insertion_point(outer_class_scope)
        diff --git a/java-common-protos/proto-google-common-protos/src/main/java/com/google/type/TimeOfDay.java b/java-common-protos/proto-google-common-protos/src/main/java/com/google/type/TimeOfDay.java
        index 7e834b442b..b9013280e0 100644
        --- a/java-common-protos/proto-google-common-protos/src/main/java/com/google/type/TimeOfDay.java
        +++ b/java-common-protos/proto-google-common-protos/src/main/java/com/google/type/TimeOfDay.java
        @@ -1,5 +1,5 @@
         /*
        - * Copyright 2020 Google LLC
        + * Copyright 2026 Google LLC
          *
          * Licensed under the Apache License, Version 2.0 (the "License");
          * you may not use this file except in compliance with the License.
        @@ -14,7 +14,9 @@
          * limitations under the License.
          */
         // Generated by the protocol buffer compiler.  DO NOT EDIT!
        +// NO CHECKED-IN PROTOBUF GENCODE
         // source: google/type/timeofday.proto
        +// Protobuf Java Version: 4.33.2
         
         package com.google.type;
         
        @@ -30,35 +32,36 @@
          *
          * Protobuf type {@code google.type.TimeOfDay}
          */
        -public final class TimeOfDay extends com.google.protobuf.GeneratedMessageV3
        +@com.google.protobuf.Generated
        +public final class TimeOfDay extends com.google.protobuf.GeneratedMessage
             implements
             // @@protoc_insertion_point(message_implements:google.type.TimeOfDay)
             TimeOfDayOrBuilder {
           private static final long serialVersionUID = 0L;
        +
        +  static {
        +    com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion(
        +        com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC,
        +        /* major= */ 4,
        +        /* minor= */ 33,
        +        /* patch= */ 2,
        +        /* suffix= */ "",
        +        "TimeOfDay");
        +  }
        +
           // Use TimeOfDay.newBuilder() to construct.
        -  private TimeOfDay(com.google.protobuf.GeneratedMessageV3.Builder builder) {
        +  private TimeOfDay(com.google.protobuf.GeneratedMessage.Builder builder) {
             super(builder);
           }
         
           private TimeOfDay() {}
         
        -  @java.lang.Override
        -  @SuppressWarnings({"unused"})
        -  protected java.lang.Object newInstance(UnusedPrivateParameter unused) {
        -    return new TimeOfDay();
        -  }
        -
        -  @java.lang.Override
        -  public final com.google.protobuf.UnknownFieldSet getUnknownFields() {
        -    return this.unknownFields;
        -  }
        -
           public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
             return com.google.type.TimeOfDayProto.internal_static_google_type_TimeOfDay_descriptor;
           }
         
           @java.lang.Override
        -  protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
        +  protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
               internalGetFieldAccessorTable() {
             return com.google.type.TimeOfDayProto.internal_static_google_type_TimeOfDay_fieldAccessorTable
                 .ensureFieldAccessorsInitialized(
        @@ -66,7 +69,8 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
           }
         
           public static final int HOURS_FIELD_NUMBER = 1;
        -  private int hours_;
        +  private int hours_ = 0;
        +
           /**
            *
            *
        @@ -85,7 +89,8 @@ public int getHours() {
           }
         
           public static final int MINUTES_FIELD_NUMBER = 2;
        -  private int minutes_;
        +  private int minutes_ = 0;
        +
           /**
            *
            *
        @@ -103,7 +108,8 @@ public int getMinutes() {
           }
         
           public static final int SECONDS_FIELD_NUMBER = 3;
        -  private int seconds_;
        +  private int seconds_ = 0;
        +
           /**
            *
            *
        @@ -122,7 +128,8 @@ public int getSeconds() {
           }
         
           public static final int NANOS_FIELD_NUMBER = 4;
        -  private int nanos_;
        +  private int nanos_ = 0;
        +
           /**
            *
            *
        @@ -265,38 +272,38 @@ public static com.google.type.TimeOfDay parseFrom(
         
           public static com.google.type.TimeOfDay parseFrom(java.io.InputStream input)
               throws java.io.IOException {
        -    return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
        +    return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input);
           }
         
           public static com.google.type.TimeOfDay parseFrom(
               java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
               throws java.io.IOException {
        -    return com.google.protobuf.GeneratedMessageV3.parseWithIOException(
        +    return com.google.protobuf.GeneratedMessage.parseWithIOException(
                 PARSER, input, extensionRegistry);
           }
         
           public static com.google.type.TimeOfDay parseDelimitedFrom(java.io.InputStream input)
               throws java.io.IOException {
        -    return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input);
        +    return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input);
           }
         
           public static com.google.type.TimeOfDay parseDelimitedFrom(
               java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
               throws java.io.IOException {
        -    return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(
        +    return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(
                 PARSER, input, extensionRegistry);
           }
         
           public static com.google.type.TimeOfDay parseFrom(com.google.protobuf.CodedInputStream input)
               throws java.io.IOException {
        -    return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
        +    return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input);
           }
         
           public static com.google.type.TimeOfDay parseFrom(
               com.google.protobuf.CodedInputStream input,
               com.google.protobuf.ExtensionRegistryLite extensionRegistry)
               throws java.io.IOException {
        -    return com.google.protobuf.GeneratedMessageV3.parseWithIOException(
        +    return com.google.protobuf.GeneratedMessage.parseWithIOException(
                 PARSER, input, extensionRegistry);
           }
         
        @@ -319,10 +326,11 @@ public Builder toBuilder() {
           }
         
           @java.lang.Override
        -  protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
        +  protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) {
             Builder builder = new Builder(parent);
             return builder;
           }
        +
           /**
            *
            *
        @@ -335,7 +343,7 @@ protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.Build
            *
            * Protobuf type {@code google.type.TimeOfDay}
            */
        -  public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder
        +  public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder
               implements
               // @@protoc_insertion_point(builder_implements:google.type.TimeOfDay)
               com.google.type.TimeOfDayOrBuilder {
        @@ -344,7 +352,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
             }
         
             @java.lang.Override
        -    protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
        +    protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
                 internalGetFieldAccessorTable() {
               return com.google.type.TimeOfDayProto.internal_static_google_type_TimeOfDay_fieldAccessorTable
                   .ensureFieldAccessorsInitialized(
        @@ -354,21 +362,18 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
             // Construct using com.google.type.TimeOfDay.newBuilder()
             private Builder() {}
         
        -    private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
        +    private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) {
               super(parent);
             }
         
             @java.lang.Override
             public Builder clear() {
               super.clear();
        +      bitField0_ = 0;
               hours_ = 0;
        -
               minutes_ = 0;
        -
               seconds_ = 0;
        -
               nanos_ = 0;
        -
               return this;
             }
         
        @@ -394,45 +399,27 @@ public com.google.type.TimeOfDay build() {
             @java.lang.Override
             public com.google.type.TimeOfDay buildPartial() {
               com.google.type.TimeOfDay result = new com.google.type.TimeOfDay(this);
        -      result.hours_ = hours_;
        -      result.minutes_ = minutes_;
        -      result.seconds_ = seconds_;
        -      result.nanos_ = nanos_;
        +      if (bitField0_ != 0) {
        +        buildPartial0(result);
        +      }
               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);
        +    private void buildPartial0(com.google.type.TimeOfDay result) {
        +      int from_bitField0_ = bitField0_;
        +      if (((from_bitField0_ & 0x00000001) != 0)) {
        +        result.hours_ = hours_;
        +      }
        +      if (((from_bitField0_ & 0x00000002) != 0)) {
        +        result.minutes_ = minutes_;
        +      }
        +      if (((from_bitField0_ & 0x00000004) != 0)) {
        +        result.seconds_ = seconds_;
        +      }
        +      if (((from_bitField0_ & 0x00000008) != 0)) {
        +        result.nanos_ = nanos_;
        +      }
             }
         
             @java.lang.Override
        @@ -488,25 +475,25 @@ public Builder mergeFrom(
                     case 8:
                       {
                         hours_ = input.readInt32();
        -
        +                bitField0_ |= 0x00000001;
                         break;
                       } // case 8
                     case 16:
                       {
                         minutes_ = input.readInt32();
        -
        +                bitField0_ |= 0x00000002;
                         break;
                       } // case 16
                     case 24:
                       {
                         seconds_ = input.readInt32();
        -
        +                bitField0_ |= 0x00000004;
                         break;
                       } // case 24
                     case 32:
                       {
                         nanos_ = input.readInt32();
        -
        +                bitField0_ |= 0x00000008;
                         break;
                       } // case 32
                     default:
        @@ -526,7 +513,10 @@ public Builder mergeFrom(
               return this;
             }
         
        +    private int bitField0_;
        +
             private int hours_;
        +
             /**
              *
              *
        @@ -543,6 +533,7 @@ public Builder mergeFrom(
             public int getHours() {
               return hours_;
             }
        +
             /**
              *
              *
        @@ -559,9 +550,11 @@ public int getHours() {
             public Builder setHours(int value) {
         
               hours_ = value;
        +      bitField0_ |= 0x00000001;
               onChanged();
               return this;
             }
        +
             /**
              *
              *
        @@ -575,13 +568,14 @@ public Builder setHours(int value) {
              * @return This builder for chaining.
              */
             public Builder clearHours() {
        -
        +      bitField0_ = (bitField0_ & ~0x00000001);
               hours_ = 0;
               onChanged();
               return this;
             }
         
             private int minutes_;
        +
             /**
              *
              *
        @@ -597,6 +591,7 @@ public Builder clearHours() {
             public int getMinutes() {
               return minutes_;
             }
        +
             /**
              *
              *
        @@ -612,9 +607,11 @@ public int getMinutes() {
             public Builder setMinutes(int value) {
         
               minutes_ = value;
        +      bitField0_ |= 0x00000002;
               onChanged();
               return this;
             }
        +
             /**
              *
              *
        @@ -627,13 +624,14 @@ public Builder setMinutes(int value) {
              * @return This builder for chaining.
              */
             public Builder clearMinutes() {
        -
        +      bitField0_ = (bitField0_ & ~0x00000002);
               minutes_ = 0;
               onChanged();
               return this;
             }
         
             private int seconds_;
        +
             /**
              *
              *
        @@ -650,6 +648,7 @@ public Builder clearMinutes() {
             public int getSeconds() {
               return seconds_;
             }
        +
             /**
              *
              *
        @@ -666,9 +665,11 @@ public int getSeconds() {
             public Builder setSeconds(int value) {
         
               seconds_ = value;
        +      bitField0_ |= 0x00000004;
               onChanged();
               return this;
             }
        +
             /**
              *
              *
        @@ -682,13 +683,14 @@ public Builder setSeconds(int value) {
              * @return This builder for chaining.
              */
             public Builder clearSeconds() {
        -
        +      bitField0_ = (bitField0_ & ~0x00000004);
               seconds_ = 0;
               onChanged();
               return this;
             }
         
             private int nanos_;
        +
             /**
              *
              *
        @@ -704,6 +706,7 @@ public Builder clearSeconds() {
             public int getNanos() {
               return nanos_;
             }
        +
             /**
              *
              *
        @@ -719,9 +722,11 @@ public int getNanos() {
             public Builder setNanos(int value) {
         
               nanos_ = value;
        +      bitField0_ |= 0x00000008;
               onChanged();
               return this;
             }
        +
             /**
              *
              *
        @@ -734,23 +739,12 @@ public Builder setNanos(int value) {
              * @return This builder for chaining.
              */
             public Builder clearNanos() {
        -
        +      bitField0_ = (bitField0_ & ~0x00000008);
               nanos_ = 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.type.TimeOfDay)
           }
         
        diff --git a/java-common-protos/proto-google-common-protos/src/main/java/com/google/type/TimeOfDayOrBuilder.java b/java-common-protos/proto-google-common-protos/src/main/java/com/google/type/TimeOfDayOrBuilder.java
        index 080bf80354..f536a040dc 100644
        --- a/java-common-protos/proto-google-common-protos/src/main/java/com/google/type/TimeOfDayOrBuilder.java
        +++ b/java-common-protos/proto-google-common-protos/src/main/java/com/google/type/TimeOfDayOrBuilder.java
        @@ -1,5 +1,5 @@
         /*
        - * Copyright 2020 Google LLC
        + * Copyright 2026 Google LLC
          *
          * Licensed under the Apache License, Version 2.0 (the "License");
          * you may not use this file except in compliance with the License.
        @@ -14,10 +14,13 @@
          * limitations under the License.
          */
         // Generated by the protocol buffer compiler.  DO NOT EDIT!
        +// NO CHECKED-IN PROTOBUF GENCODE
         // source: google/type/timeofday.proto
        +// Protobuf Java Version: 4.33.2
         
         package com.google.type;
         
        +@com.google.protobuf.Generated
         public interface TimeOfDayOrBuilder
             extends
             // @@protoc_insertion_point(interface_extends:google.type.TimeOfDay)
        diff --git a/java-common-protos/proto-google-common-protos/src/main/java/com/google/type/TimeOfDayProto.java b/java-common-protos/proto-google-common-protos/src/main/java/com/google/type/TimeOfDayProto.java
        index ffa69a4167..3a5f4c5449 100644
        --- a/java-common-protos/proto-google-common-protos/src/main/java/com/google/type/TimeOfDayProto.java
        +++ b/java-common-protos/proto-google-common-protos/src/main/java/com/google/type/TimeOfDayProto.java
        @@ -1,5 +1,5 @@
         /*
        - * Copyright 2020 Google LLC
        + * Copyright 2026 Google LLC
          *
          * Licensed under the Apache License, Version 2.0 (the "License");
          * you may not use this file except in compliance with the License.
        @@ -14,13 +14,26 @@
          * limitations under the License.
          */
         // Generated by the protocol buffer compiler.  DO NOT EDIT!
        +// NO CHECKED-IN PROTOBUF GENCODE
         // source: google/type/timeofday.proto
        +// Protobuf Java Version: 4.33.2
         
         package com.google.type;
         
        -public final class TimeOfDayProto {
        +@com.google.protobuf.Generated
        +public final class TimeOfDayProto extends com.google.protobuf.GeneratedFile {
           private TimeOfDayProto() {}
         
        +  static {
        +    com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion(
        +        com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC,
        +        /* major= */ 4,
        +        /* minor= */ 33,
        +        /* patch= */ 2,
        +        /* suffix= */ "",
        +        "TimeOfDayProto");
        +  }
        +
           public static void registerAllExtensions(com.google.protobuf.ExtensionRegistryLite registry) {}
         
           public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry registry) {
        @@ -29,7 +42,7 @@ public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry r
         
           static final com.google.protobuf.Descriptors.Descriptor
               internal_static_google_type_TimeOfDay_descriptor;
        -  static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
        +  static final com.google.protobuf.GeneratedMessage.FieldAccessorTable
               internal_static_google_type_TimeOfDay_fieldAccessorTable;
         
           public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() {
        @@ -40,23 +53,28 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() {
         
           static {
             java.lang.String[] descriptorData = {
        -      "\n\033google/type/timeofday.proto\022\013google.ty"
        -          + "pe\"K\n\tTimeOfDay\022\r\n\005hours\030\001 \001(\005\022\017\n\007minute"
        -          + "s\030\002 \001(\005\022\017\n\007seconds\030\003 \001(\005\022\r\n\005nanos\030\004 \001(\005B"
        -          + "l\n\017com.google.typeB\016TimeOfDayProtoP\001Z>go"
        +      "\n"
        +          + "\033google/type/timeofday.proto\022\013google.type\"K\n"
        +          + "\tTimeOfDay\022\r\n"
        +          + "\005hours\030\001 \001(\005\022\017\n"
        +          + "\007minutes\030\002 \001(\005\022\017\n"
        +          + "\007seconds\030\003 \001(\005\022\r\n"
        +          + "\005nanos\030\004 \001(\005Bl\n"
        +          + "\017com.google.typeB\016TimeOfDayProtoP\001Z>go"
                   + "ogle.golang.org/genproto/googleapis/type"
                   + "/timeofday;timeofday\370\001\001\242\002\003GTPb\006proto3"
             };
             descriptor =
                 com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom(
                     descriptorData, new com.google.protobuf.Descriptors.FileDescriptor[] {});
        -    internal_static_google_type_TimeOfDay_descriptor = getDescriptor().getMessageTypes().get(0);
        +    internal_static_google_type_TimeOfDay_descriptor = getDescriptor().getMessageType(0);
             internal_static_google_type_TimeOfDay_fieldAccessorTable =
        -        new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
        +        new com.google.protobuf.GeneratedMessage.FieldAccessorTable(
                     internal_static_google_type_TimeOfDay_descriptor,
                     new java.lang.String[] {
                       "Hours", "Minutes", "Seconds", "Nanos",
                     });
        +    descriptor.resolveAllFeaturesImmutable();
           }
         
           // @@protoc_insertion_point(outer_class_scope)
        diff --git a/java-common-protos/proto-google-common-protos/src/main/java/com/google/type/TimeZone.java b/java-common-protos/proto-google-common-protos/src/main/java/com/google/type/TimeZone.java
        index c7e01c9c87..8f761f3cb5 100644
        --- a/java-common-protos/proto-google-common-protos/src/main/java/com/google/type/TimeZone.java
        +++ b/java-common-protos/proto-google-common-protos/src/main/java/com/google/type/TimeZone.java
        @@ -1,5 +1,5 @@
         /*
        - * Copyright 2020 Google LLC
        + * Copyright 2026 Google LLC
          *
          * Licensed under the Apache License, Version 2.0 (the "License");
          * you may not use this file except in compliance with the License.
        @@ -14,7 +14,9 @@
          * limitations under the License.
          */
         // Generated by the protocol buffer compiler.  DO NOT EDIT!
        +// NO CHECKED-IN PROTOBUF GENCODE
         // source: google/type/datetime.proto
        +// Protobuf Java Version: 4.33.2
         
         package com.google.type;
         
        @@ -28,13 +30,25 @@
          *
          * Protobuf type {@code google.type.TimeZone}
          */
        -public final class TimeZone extends com.google.protobuf.GeneratedMessageV3
        +@com.google.protobuf.Generated
        +public final class TimeZone extends com.google.protobuf.GeneratedMessage
             implements
             // @@protoc_insertion_point(message_implements:google.type.TimeZone)
             TimeZoneOrBuilder {
           private static final long serialVersionUID = 0L;
        +
        +  static {
        +    com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion(
        +        com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC,
        +        /* major= */ 4,
        +        /* minor= */ 33,
        +        /* patch= */ 2,
        +        /* suffix= */ "",
        +        "TimeZone");
        +  }
        +
           // Use TimeZone.newBuilder() to construct.
        -  private TimeZone(com.google.protobuf.GeneratedMessageV3.Builder builder) {
        +  private TimeZone(com.google.protobuf.GeneratedMessage.Builder builder) {
             super(builder);
           }
         
        @@ -43,23 +57,12 @@ private TimeZone() {
             version_ = "";
           }
         
        -  @java.lang.Override
        -  @SuppressWarnings({"unused"})
        -  protected java.lang.Object newInstance(UnusedPrivateParameter unused) {
        -    return new TimeZone();
        -  }
        -
        -  @java.lang.Override
        -  public final com.google.protobuf.UnknownFieldSet getUnknownFields() {
        -    return this.unknownFields;
        -  }
        -
           public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
             return com.google.type.DateTimeProto.internal_static_google_type_TimeZone_descriptor;
           }
         
           @java.lang.Override
        -  protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
        +  protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
               internalGetFieldAccessorTable() {
             return com.google.type.DateTimeProto.internal_static_google_type_TimeZone_fieldAccessorTable
                 .ensureFieldAccessorsInitialized(
        @@ -67,7 +70,10 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
           }
         
           public static final int ID_FIELD_NUMBER = 1;
        -  private volatile java.lang.Object id_;
        +
        +  @SuppressWarnings("serial")
        +  private volatile java.lang.Object id_ = "";
        +
           /**
            *
            *
        @@ -91,6 +97,7 @@ public java.lang.String getId() {
               return s;
             }
           }
        +
           /**
            *
            *
        @@ -116,7 +123,10 @@ public com.google.protobuf.ByteString getIdBytes() {
           }
         
           public static final int VERSION_FIELD_NUMBER = 2;
        -  private volatile java.lang.Object version_;
        +
        +  @SuppressWarnings("serial")
        +  private volatile java.lang.Object version_ = "";
        +
           /**
            *
            *
        @@ -140,6 +150,7 @@ public java.lang.String getVersion() {
               return s;
             }
           }
        +
           /**
            *
            *
        @@ -178,11 +189,11 @@ public final boolean isInitialized() {
         
           @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.GeneratedMessage.isStringEmpty(id_)) {
        +      com.google.protobuf.GeneratedMessage.writeString(output, 1, id_);
             }
        -    if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(version_)) {
        -      com.google.protobuf.GeneratedMessageV3.writeString(output, 2, version_);
        +    if (!com.google.protobuf.GeneratedMessage.isStringEmpty(version_)) {
        +      com.google.protobuf.GeneratedMessage.writeString(output, 2, version_);
             }
             getUnknownFields().writeTo(output);
           }
        @@ -193,11 +204,11 @@ public int getSerializedSize() {
             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.GeneratedMessage.isStringEmpty(id_)) {
        +      size += com.google.protobuf.GeneratedMessage.computeStringSize(1, id_);
             }
        -    if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(version_)) {
        -      size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, version_);
        +    if (!com.google.protobuf.GeneratedMessage.isStringEmpty(version_)) {
        +      size += com.google.protobuf.GeneratedMessage.computeStringSize(2, version_);
             }
             size += getUnknownFields().getSerializedSize();
             memoizedSize = size;
        @@ -272,38 +283,38 @@ public static com.google.type.TimeZone parseFrom(
         
           public static com.google.type.TimeZone parseFrom(java.io.InputStream input)
               throws java.io.IOException {
        -    return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
        +    return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input);
           }
         
           public static com.google.type.TimeZone parseFrom(
               java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
               throws java.io.IOException {
        -    return com.google.protobuf.GeneratedMessageV3.parseWithIOException(
        +    return com.google.protobuf.GeneratedMessage.parseWithIOException(
                 PARSER, input, extensionRegistry);
           }
         
           public static com.google.type.TimeZone parseDelimitedFrom(java.io.InputStream input)
               throws java.io.IOException {
        -    return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input);
        +    return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input);
           }
         
           public static com.google.type.TimeZone parseDelimitedFrom(
               java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
               throws java.io.IOException {
        -    return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(
        +    return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(
                 PARSER, input, extensionRegistry);
           }
         
           public static com.google.type.TimeZone parseFrom(com.google.protobuf.CodedInputStream input)
               throws java.io.IOException {
        -    return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
        +    return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input);
           }
         
           public static com.google.type.TimeZone parseFrom(
               com.google.protobuf.CodedInputStream input,
               com.google.protobuf.ExtensionRegistryLite extensionRegistry)
               throws java.io.IOException {
        -    return com.google.protobuf.GeneratedMessageV3.parseWithIOException(
        +    return com.google.protobuf.GeneratedMessage.parseWithIOException(
                 PARSER, input, extensionRegistry);
           }
         
        @@ -326,10 +337,11 @@ public Builder toBuilder() {
           }
         
           @java.lang.Override
        -  protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
        +  protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) {
             Builder builder = new Builder(parent);
             return builder;
           }
        +
           /**
            *
            *
        @@ -340,7 +352,7 @@ protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.Build
            *
            * Protobuf type {@code google.type.TimeZone}
            */
        -  public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder
        +  public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder
               implements
               // @@protoc_insertion_point(builder_implements:google.type.TimeZone)
               com.google.type.TimeZoneOrBuilder {
        @@ -349,7 +361,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
             }
         
             @java.lang.Override
        -    protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
        +    protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
                 internalGetFieldAccessorTable() {
               return com.google.type.DateTimeProto.internal_static_google_type_TimeZone_fieldAccessorTable
                   .ensureFieldAccessorsInitialized(
        @@ -359,17 +371,16 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
             // Construct using com.google.type.TimeZone.newBuilder()
             private Builder() {}
         
        -    private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
        +    private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) {
               super(parent);
             }
         
             @java.lang.Override
             public Builder clear() {
               super.clear();
        +      bitField0_ = 0;
               id_ = "";
        -
               version_ = "";
        -
               return this;
             }
         
        @@ -395,43 +406,21 @@ public com.google.type.TimeZone build() {
             @java.lang.Override
             public com.google.type.TimeZone buildPartial() {
               com.google.type.TimeZone result = new com.google.type.TimeZone(this);
        -      result.id_ = id_;
        -      result.version_ = version_;
        +      if (bitField0_ != 0) {
        +        buildPartial0(result);
        +      }
               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);
        +    private void buildPartial0(com.google.type.TimeZone result) {
        +      int from_bitField0_ = bitField0_;
        +      if (((from_bitField0_ & 0x00000001) != 0)) {
        +        result.id_ = id_;
        +      }
        +      if (((from_bitField0_ & 0x00000002) != 0)) {
        +        result.version_ = version_;
        +      }
             }
         
             @java.lang.Override
        @@ -448,10 +437,12 @@ public Builder mergeFrom(com.google.type.TimeZone other) {
               if (other == com.google.type.TimeZone.getDefaultInstance()) return this;
               if (!other.getId().isEmpty()) {
                 id_ = other.id_;
        +        bitField0_ |= 0x00000001;
                 onChanged();
               }
               if (!other.getVersion().isEmpty()) {
                 version_ = other.version_;
        +        bitField0_ |= 0x00000002;
                 onChanged();
               }
               this.mergeUnknownFields(other.getUnknownFields());
        @@ -483,13 +474,13 @@ public Builder mergeFrom(
                     case 10:
                       {
                         id_ = input.readStringRequireUtf8();
        -
        +                bitField0_ |= 0x00000001;
                         break;
                       } // case 10
                     case 18:
                       {
                         version_ = input.readStringRequireUtf8();
        -
        +                bitField0_ |= 0x00000002;
                         break;
                       } // case 18
                     default:
        @@ -509,7 +500,10 @@ public Builder mergeFrom(
               return this;
             }
         
        +    private int bitField0_;
        +
             private java.lang.Object id_ = "";
        +
             /**
              *
              *
        @@ -532,6 +526,7 @@ public java.lang.String getId() {
                 return (java.lang.String) ref;
               }
             }
        +
             /**
              *
              *
        @@ -554,6 +549,7 @@ public com.google.protobuf.ByteString getIdBytes() {
                 return (com.google.protobuf.ByteString) ref;
               }
             }
        +
             /**
              *
              *
        @@ -570,11 +566,12 @@ public Builder setId(java.lang.String value) {
               if (value == null) {
                 throw new NullPointerException();
               }
        -
               id_ = value;
        +      bitField0_ |= 0x00000001;
               onChanged();
               return this;
             }
        +
             /**
              *
              *
        @@ -587,11 +584,12 @@ public Builder setId(java.lang.String value) {
              * @return This builder for chaining.
              */
             public Builder clearId() {
        -
               id_ = getDefaultInstance().getId();
        +      bitField0_ = (bitField0_ & ~0x00000001);
               onChanged();
               return this;
             }
        +
             /**
              *
              *
        @@ -609,13 +607,14 @@ public Builder setIdBytes(com.google.protobuf.ByteString value) {
                 throw new NullPointerException();
               }
               checkByteStringIsUtf8(value);
        -
               id_ = value;
        +      bitField0_ |= 0x00000001;
               onChanged();
               return this;
             }
         
             private java.lang.Object version_ = "";
        +
             /**
              *
              *
        @@ -638,6 +637,7 @@ public java.lang.String getVersion() {
                 return (java.lang.String) ref;
               }
             }
        +
             /**
              *
              *
        @@ -660,6 +660,7 @@ public com.google.protobuf.ByteString getVersionBytes() {
                 return (com.google.protobuf.ByteString) ref;
               }
             }
        +
             /**
              *
              *
        @@ -676,11 +677,12 @@ public Builder setVersion(java.lang.String value) {
               if (value == null) {
                 throw new NullPointerException();
               }
        -
               version_ = value;
        +      bitField0_ |= 0x00000002;
               onChanged();
               return this;
             }
        +
             /**
              *
              *
        @@ -693,11 +695,12 @@ public Builder setVersion(java.lang.String value) {
              * @return This builder for chaining.
              */
             public Builder clearVersion() {
        -
               version_ = getDefaultInstance().getVersion();
        +      bitField0_ = (bitField0_ & ~0x00000002);
               onChanged();
               return this;
             }
        +
             /**
              *
              *
        @@ -715,23 +718,12 @@ public Builder setVersionBytes(com.google.protobuf.ByteString value) {
                 throw new NullPointerException();
               }
               checkByteStringIsUtf8(value);
        -
               version_ = 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.type.TimeZone)
           }
         
        diff --git a/java-common-protos/proto-google-common-protos/src/main/java/com/google/type/TimeZoneOrBuilder.java b/java-common-protos/proto-google-common-protos/src/main/java/com/google/type/TimeZoneOrBuilder.java
        index 29c25159da..c92bba2ddf 100644
        --- a/java-common-protos/proto-google-common-protos/src/main/java/com/google/type/TimeZoneOrBuilder.java
        +++ b/java-common-protos/proto-google-common-protos/src/main/java/com/google/type/TimeZoneOrBuilder.java
        @@ -1,5 +1,5 @@
         /*
        - * Copyright 2020 Google LLC
        + * Copyright 2026 Google LLC
          *
          * Licensed under the Apache License, Version 2.0 (the "License");
          * you may not use this file except in compliance with the License.
        @@ -14,10 +14,13 @@
          * limitations under the License.
          */
         // Generated by the protocol buffer compiler.  DO NOT EDIT!
        +// NO CHECKED-IN PROTOBUF GENCODE
         // source: google/type/datetime.proto
        +// Protobuf Java Version: 4.33.2
         
         package com.google.type;
         
        +@com.google.protobuf.Generated
         public interface TimeZoneOrBuilder
             extends
             // @@protoc_insertion_point(interface_extends:google.type.TimeZone)
        @@ -35,6 +38,7 @@ public interface TimeZoneOrBuilder
            * @return The id.
            */
           java.lang.String getId();
        +
           /**
            *
            *
        @@ -60,6 +64,7 @@ public interface TimeZoneOrBuilder
            * @return The version.
            */
           java.lang.String getVersion();
        +
           /**
            *
            *
        diff --git a/java-common-protos/proto-google-common-protos/src/main/proto/google/api/annotations.proto b/java-common-protos/proto-google-common-protos/src/main/proto/google/api/annotations.proto
        index efdab3db6c..417edd8fa1 100644
        --- a/java-common-protos/proto-google-common-protos/src/main/proto/google/api/annotations.proto
        +++ b/java-common-protos/proto-google-common-protos/src/main/proto/google/api/annotations.proto
        @@ -1,4 +1,4 @@
        -// Copyright 2015 Google LLC
        +// Copyright 2025 Google LLC
         //
         // Licensed under the Apache License, Version 2.0 (the "License");
         // you may not use this file except in compliance with the License.
        diff --git a/java-common-protos/proto-google-common-protos/src/main/proto/google/api/auth.proto b/java-common-protos/proto-google-common-protos/src/main/proto/google/api/auth.proto
        index 21a8ce1b0a..cb640bd68c 100644
        --- a/java-common-protos/proto-google-common-protos/src/main/proto/google/api/auth.proto
        +++ b/java-common-protos/proto-google-common-protos/src/main/proto/google/api/auth.proto
        @@ -1,4 +1,4 @@
        -// Copyright 2015 Google LLC
        +// Copyright 2025 Google LLC
         //
         // Licensed under the Apache License, Version 2.0 (the "License");
         // you may not use this file except in compliance with the License.
        @@ -62,7 +62,8 @@ message Authentication {
         message AuthenticationRule {
           // Selects the methods to which this rule applies.
           //
        -  // Refer to [selector][google.api.DocumentationRule.selector] for syntax details.
        +  // Refer to [selector][google.api.DocumentationRule.selector] for syntax
        +  // details.
           string selector = 1;
         
           // The requirements for OAuth credentials.
        diff --git a/java-common-protos/proto-google-common-protos/src/main/proto/google/api/backend.proto b/java-common-protos/proto-google-common-protos/src/main/proto/google/api/backend.proto
        index 1a3b705f62..8d2206e535 100644
        --- a/java-common-protos/proto-google-common-protos/src/main/proto/google/api/backend.proto
        +++ b/java-common-protos/proto-google-common-protos/src/main/proto/google/api/backend.proto
        @@ -1,4 +1,4 @@
        -// Copyright 2015 Google LLC
        +// Copyright 2025 Google LLC
         //
         // Licensed under the Apache License, Version 2.0 (the "License");
         // you may not use this file except in compliance with the License.
        @@ -91,7 +91,8 @@ message BackendRule {
         
           // Selects the methods to which this rule applies.
           //
        -  // Refer to [selector][google.api.DocumentationRule.selector] for syntax details.
        +  // Refer to [selector][google.api.DocumentationRule.selector] for syntax
        +  // details.
           string selector = 1;
         
           // The address of the API backend.
        @@ -178,4 +179,7 @@ message BackendRule {
           // https://www.iana.org/assignments/tls-extensiontype-values/tls-extensiontype-values.xhtml#alpn-protocol-ids
           // for more details on the supported values.
           string protocol = 9;
        +
        +  // The map between request protocol and the backend address.
        +  map overrides_by_request_protocol = 10;
         }
        diff --git a/java-common-protos/proto-google-common-protos/src/main/proto/google/api/billing.proto b/java-common-protos/proto-google-common-protos/src/main/proto/google/api/billing.proto
        index e94c2ec581..7c82274229 100644
        --- a/java-common-protos/proto-google-common-protos/src/main/proto/google/api/billing.proto
        +++ b/java-common-protos/proto-google-common-protos/src/main/proto/google/api/billing.proto
        @@ -1,4 +1,4 @@
        -// Copyright 2015 Google LLC
        +// Copyright 2025 Google LLC
         //
         // Licensed under the Apache License, Version 2.0 (the "License");
         // you may not use this file except in compliance with the License.
        @@ -59,11 +59,13 @@ message Billing {
           // bill against consumer project).
           message BillingDestination {
             // The monitored resource type. The type must be defined in
        -    // [Service.monitored_resources][google.api.Service.monitored_resources] section.
        +    // [Service.monitored_resources][google.api.Service.monitored_resources]
        +    // section.
             string monitored_resource = 1;
         
             // Names of the metrics to report to this billing destination.
        -    // Each name must be defined in [Service.metrics][google.api.Service.metrics] section.
        +    // Each name must be defined in
        +    // [Service.metrics][google.api.Service.metrics] section.
             repeated string metrics = 2;
           }
         
        diff --git a/java-common-protos/proto-google-common-protos/src/main/proto/google/api/client.proto b/java-common-protos/proto-google-common-protos/src/main/proto/google/api/client.proto
        index 323846f44d..3d692560ab 100644
        --- a/java-common-protos/proto-google-common-protos/src/main/proto/google/api/client.proto
        +++ b/java-common-protos/proto-google-common-protos/src/main/proto/google/api/client.proto
        @@ -1,4 +1,4 @@
        -// Copyright 2018 Google LLC
        +// Copyright 2025 Google LLC
         //
         // Licensed under the Apache License, Version 2.0 (the "License");
         // you may not use this file except in compliance with the License.
        @@ -98,21 +98,42 @@ extend google.protobuf.ServiceOptions {
           //     ...
           //   }
           string oauth_scopes = 1050;
        +
        +  // The API version of this service, which should be sent by version-aware
        +  // clients to the service. This allows services to abide by the schema and
        +  // behavior of the service at the time this API version was deployed.
        +  // The format of the API version must be treated as opaque by clients.
        +  // Services may use a format with an apparent structure, but clients must
        +  // not rely on this to determine components within an API version, or attempt
        +  // to construct other valid API versions. Note that this is for upcoming
        +  // functionality and may not be implemented for all services.
        +  //
        +  // Example:
        +  //
        +  //   service Foo {
        +  //     option (google.api.api_version) = "v1_20230821_preview";
        +  //   }
        +  string api_version = 525000001;
         }
         
         // Required information for every language.
         message CommonLanguageSettings {
           // Link to automatically generated reference documentation.  Example:
           // https://cloud.google.com/nodejs/docs/reference/asset/latest
        -  string reference_docs_uri = 1;
        +  string reference_docs_uri = 1 [deprecated = true];
         
           // The destination where API teams want this client library to be published.
           repeated ClientLibraryDestination destinations = 2;
        +
        +  // Configuration for which RPCs should be generated in the GAPIC client.
        +  SelectiveGapicGeneration selective_gapic_generation = 3;
         }
         
         // Details about how and where to publish client libraries.
         message ClientLibrarySettings {
        -  // Version of the API to apply these settings to.
        +  // Version of the API to apply these settings to. This is the full protobuf
        +  // package for the API, ending in the version element.
        +  // Examples: "google.cloud.speech.v1" and "google.spanner.admin.database.v1".
           string version = 1;
         
           // Launch stage of this version of the API.
        @@ -155,7 +176,7 @@ message Publishing {
           // long-running operation pattern.
           repeated MethodSettings method_settings = 2;
         
        -  // Link to a place that API users can report issues.  Example:
        +  // Link to a *public* URI where users can report issues.  Example:
           // https://issuetracker.google.com/issues/new?component=190865&template=1161103
           string new_issue_uri = 101;
         
        @@ -186,6 +207,14 @@ message Publishing {
           // times in this list, then the last one wins.  Settings from earlier
           // settings with the same version string are discarded.
           repeated ClientLibrarySettings library_settings = 109;
        +
        +  // Optional link to proto reference documentation.  Example:
        +  // https://cloud.google.com/pubsub/lite/docs/reference/rpc
        +  string proto_reference_documentation_uri = 110;
        +
        +  // Optional link to REST reference documentation.  Example:
        +  // https://cloud.google.com/pubsub/lite/docs/reference/rest
        +  string rest_reference_documentation_uri = 111;
         }
         
         // Settings for Java client libraries.
        @@ -237,8 +266,34 @@ message PhpSettings {
         
         // Settings for Python client libraries.
         message PythonSettings {
        +  // Experimental features to be included during client library generation.
        +  // These fields will be deprecated once the feature graduates and is enabled
        +  // by default.
        +  message ExperimentalFeatures {
        +    // Enables generation of asynchronous REST clients if `rest` transport is
        +    // enabled. By default, asynchronous REST clients will not be generated.
        +    // This feature will be enabled by default 1 month after launching the
        +    // feature in preview packages.
        +    bool rest_async_io_enabled = 1;
        +
        +    // Enables generation of protobuf code using new types that are more
        +    // Pythonic which are included in `protobuf>=5.29.x`. This feature will be
        +    // enabled by default 1 month after launching the feature in preview
        +    // packages.
        +    bool protobuf_pythonic_types_enabled = 2;
        +
        +    // Disables generation of an unversioned Python package for this client
        +    // library. This means that the module names will need to be versioned in
        +    // import statements. For example `import google.cloud.library_v2` instead
        +    // of `import google.cloud.library`.
        +    bool unversioned_package_disabled = 3;
        +  }
        +
           // Some settings.
           CommonLanguageSettings common = 1;
        +
        +  // Experimental features to be included during client library generation.
        +  ExperimentalFeatures experimental_features = 2;
         }
         
         // Settings for Node client libraries.
        @@ -251,6 +306,36 @@ message NodeSettings {
         message DotnetSettings {
           // Some settings.
           CommonLanguageSettings common = 1;
        +
        +  // Map from original service names to renamed versions.
        +  // This is used when the default generated types
        +  // would cause a naming conflict. (Neither name is
        +  // fully-qualified.)
        +  // Example: Subscriber to SubscriberServiceApi.
        +  map renamed_services = 2;
        +
        +  // Map from full resource types to the effective short name
        +  // for the resource. This is used when otherwise resource
        +  // named from different services would cause naming collisions.
        +  // Example entry:
        +  // "datalabeling.googleapis.com/Dataset": "DataLabelingDataset"
        +  map renamed_resources = 3;
        +
        +  // List of full resource types to ignore during generation.
        +  // This is typically used for API-specific Location resources,
        +  // which should be handled by the generator as if they were actually
        +  // the common Location resources.
        +  // Example entry: "documentai.googleapis.com/Location"
        +  repeated string ignored_resources = 4;
        +
        +  // Namespaces which must be aliased in snippets due to
        +  // a known (but non-generator-predictable) naming collision
        +  repeated string forced_namespace_aliases = 5;
        +
        +  // Method signatures (in the form "service.method(signature)")
        +  // which are provided separately, so shouldn't be generated.
        +  // Snippets *calling* these methods are still generated, however.
        +  repeated string handwritten_signatures = 6;
         }
         
         // Settings for Ruby client libraries.
        @@ -263,6 +348,16 @@ message RubySettings {
         message GoSettings {
           // Some settings.
           CommonLanguageSettings common = 1;
        +
        +  // Map of service names to renamed services. Keys are the package relative
        +  // service names and values are the name to be used for the service client
        +  // and call options.
        +  //
        +  // publishing:
        +  //   go_settings:
        +  //     renamed_services:
        +  //       Publisher: TopicAdmin
        +  map renamed_services = 2;
         }
         
         // Describes the generator configuration for a method.
        @@ -293,6 +388,13 @@ message MethodSettings {
         
           // The fully qualified name of the method, for which the options below apply.
           // This is used to find the method to apply the options.
        +  //
        +  // Example:
        +  //
        +  //    publishing:
        +  //      method_settings:
        +  //      - selector: google.storage.control.v2.StorageControl.CreateFolder
        +  //        # method settings for CreateFolder...
           string selector = 1;
         
           // Describes settings to use for long-running operations when generating
        @@ -301,18 +403,28 @@ message MethodSettings {
           //
           // Example of a YAML configuration::
           //
        -  //  publishing:
        -  //    method_behavior:
        -  //      - selector: CreateAdDomain
        +  //    publishing:
        +  //      method_settings:
        +  //      - selector: google.cloud.speech.v2.Speech.BatchRecognize
           //        long_running:
        -  //          initial_poll_delay:
        -  //            seconds: 60 # 1 minute
        +  //          initial_poll_delay: 60s # 1 minute
           //          poll_delay_multiplier: 1.5
        -  //          max_poll_delay:
        -  //            seconds: 360 # 6 minutes
        -  //          total_poll_timeout:
        -  //             seconds: 54000 # 90 minutes
        +  //          max_poll_delay: 360s # 6 minutes
        +  //          total_poll_timeout: 54000s # 90 minutes
           LongRunning long_running = 2;
        +
        +  // List of top-level fields of the request message, that should be
        +  // automatically populated by the client libraries based on their
        +  // (google.api.field_info).format. Currently supported format: UUID4.
        +  //
        +  // Example of a YAML configuration:
        +  //
        +  //    publishing:
        +  //      method_settings:
        +  //      - selector: google.example.v1.ExampleService.CreateExample
        +  //        auto_populated_fields:
        +  //        - request_id
        +  repeated string auto_populated_fields = 3;
         }
         
         // The organization for which the client libraries are being published.
        @@ -332,6 +444,15 @@ enum ClientLibraryOrganization {
         
           // Street View Org.
           STREET_VIEW = 4;
        +
        +  // Shopping Org.
        +  SHOPPING = 5;
        +
        +  // Geo Org.
        +  GEO = 6;
        +
        +  // Generative AI - https://developers.generativeai.google
        +  GENERATIVE_AI = 7;
         }
         
         // To where should client libraries be published?
        @@ -347,3 +468,19 @@ enum ClientLibraryDestination {
           // Publish the library to package managers like nuget.org and npmjs.com.
           PACKAGE_MANAGER = 20;
         }
        +
        +// This message is used to configure the generation of a subset of the RPCs in
        +// a service for client libraries.
        +message SelectiveGapicGeneration {
        +  // An allowlist of the fully qualified names of RPCs that should be included
        +  // on public client surfaces.
        +  repeated string methods = 1;
        +
        +  // Setting this to true indicates to the client generators that methods
        +  // that would be excluded from the generation should instead be generated
        +  // in a way that indicates these methods should not be consumed by
        +  // end users. How this is expressed is up to individual language
        +  // implementations to decide. Some examples may be: added annotations,
        +  // obfuscated identifiers, or other language idiomatic patterns.
        +  bool generate_omitted_as_internal = 2;
        +}
        diff --git a/java-common-protos/proto-google-common-protos/src/main/proto/google/api/config_change.proto b/java-common-protos/proto-google-common-protos/src/main/proto/google/api/config_change.proto
        index f1fcde4f79..c1cc0e8b05 100644
        --- a/java-common-protos/proto-google-common-protos/src/main/proto/google/api/config_change.proto
        +++ b/java-common-protos/proto-google-common-protos/src/main/proto/google/api/config_change.proto
        @@ -1,4 +1,4 @@
        -// Copyright 2015 Google LLC
        +// Copyright 2025 Google LLC
         //
         // Licensed under the Apache License, Version 2.0 (the "License");
         // you may not use this file except in compliance with the License.
        diff --git a/java-common-protos/proto-google-common-protos/src/main/proto/google/api/consumer.proto b/java-common-protos/proto-google-common-protos/src/main/proto/google/api/consumer.proto
        index b7e5df1c8d..303604900b 100644
        --- a/java-common-protos/proto-google-common-protos/src/main/proto/google/api/consumer.proto
        +++ b/java-common-protos/proto-google-common-protos/src/main/proto/google/api/consumer.proto
        @@ -1,4 +1,4 @@
        -// Copyright 2016 Google LLC
        +// Copyright 2025 Google LLC
         //
         // Licensed under the Apache License, Version 2.0 (the "License");
         // you may not use this file except in compliance with the License.
        diff --git a/java-common-protos/proto-google-common-protos/src/main/proto/google/api/context.proto b/java-common-protos/proto-google-common-protos/src/main/proto/google/api/context.proto
        index 8e776ecfc3..5b137f5f79 100644
        --- a/java-common-protos/proto-google-common-protos/src/main/proto/google/api/context.proto
        +++ b/java-common-protos/proto-google-common-protos/src/main/proto/google/api/context.proto
        @@ -1,4 +1,4 @@
        -// Copyright 2015 Google LLC
        +// Copyright 2025 Google LLC
         //
         // Licensed under the Apache License, Version 2.0 (the "License");
         // you may not use this file except in compliance with the License.
        @@ -70,13 +70,16 @@ message Context {
         message ContextRule {
           // Selects the methods to which this rule applies.
           //
        -  // Refer to [selector][google.api.DocumentationRule.selector] for syntax details.
        +  // Refer to [selector][google.api.DocumentationRule.selector] for syntax
        +  // details.
           string selector = 1;
         
        -  // A list of full type names of requested contexts.
        +  // A list of full type names of requested contexts, only the requested context
        +  // will be made available to the backend.
           repeated string requested = 2;
         
        -  // A list of full type names of provided contexts.
        +  // A list of full type names of provided contexts. It is used to support
        +  // propagating HTTP headers and ETags from the response extension.
           repeated string provided = 3;
         
           // A list of full type names or extension IDs of extensions allowed in grpc
        diff --git a/java-common-protos/proto-google-common-protos/src/main/proto/google/api/control.proto b/java-common-protos/proto-google-common-protos/src/main/proto/google/api/control.proto
        index 5e14dee30f..ce3f2871d7 100644
        --- a/java-common-protos/proto-google-common-protos/src/main/proto/google/api/control.proto
        +++ b/java-common-protos/proto-google-common-protos/src/main/proto/google/api/control.proto
        @@ -1,4 +1,4 @@
        -// Copyright 2015 Google LLC
        +// Copyright 2025 Google LLC
         //
         // Licensed under the Apache License, Version 2.0 (the "License");
         // you may not use this file except in compliance with the License.
        @@ -16,6 +16,8 @@ syntax = "proto3";
         
         package google.api;
         
        +import "google/api/policy.proto";
        +
         option go_package = "google.golang.org/genproto/googleapis/api/serviceconfig;serviceconfig";
         option java_multiple_files = true;
         option java_outer_classname = "ControlProto";
        @@ -33,4 +35,7 @@ message Control {
           // feature (like quota and billing) will be enabled. The recommended value for
           // most services is servicecontrol.googleapis.com
           string environment = 1;
        +
        +  // Defines policies applying to the API methods of the service.
        +  repeated MethodPolicy method_policies = 4;
         }
        diff --git a/java-common-protos/proto-google-common-protos/src/main/proto/google/api/distribution.proto b/java-common-protos/proto-google-common-protos/src/main/proto/google/api/distribution.proto
        index b079a43891..215be7d364 100644
        --- a/java-common-protos/proto-google-common-protos/src/main/proto/google/api/distribution.proto
        +++ b/java-common-protos/proto-google-common-protos/src/main/proto/google/api/distribution.proto
        @@ -1,4 +1,4 @@
        -// Copyright 2015 Google LLC
        +// Copyright 2025 Google LLC
         //
         // Licensed under the Apache License, Version 2.0 (the "License");
         // you may not use this file except in compliance with the License.
        @@ -73,6 +73,7 @@ message Distribution {
             // following boundaries:
             //
             //    Upper bound (0 <= i < N-1):     offset + (width * i).
        +    //
             //    Lower bound (1 <= i < N):       offset + (width * (i - 1)).
             message Linear {
               // Must be greater than 0.
        @@ -93,6 +94,7 @@ message Distribution {
             // following boundaries:
             //
             //    Upper bound (0 <= i < N-1):     scale * (growth_factor ^ i).
        +    //
             //    Lower bound (1 <= i < N):       scale * (growth_factor ^ (i - 1)).
             message Exponential {
               // Must be greater than 0.
        diff --git a/java-common-protos/proto-google-common-protos/src/main/proto/google/api/documentation.proto b/java-common-protos/proto-google-common-protos/src/main/proto/google/api/documentation.proto
        index d15562db50..b94a06d473 100644
        --- a/java-common-protos/proto-google-common-protos/src/main/proto/google/api/documentation.proto
        +++ b/java-common-protos/proto-google-common-protos/src/main/proto/google/api/documentation.proto
        @@ -1,4 +1,4 @@
        -// Copyright 2015 Google LLC
        +// Copyright 2025 Google LLC
         //
         // Licensed under the Apache License, Version 2.0 (the "License");
         // you may not use this file except in compliance with the License.
        @@ -34,7 +34,7 @@ option objc_class_prefix = "GAPI";
         //     content: (== include google/foo/overview.md ==)
         //   - name: Tutorial
         //     content: (== include google/foo/tutorial.md ==)
        -//     subpages;
        +//     subpages:
         //     - name: Java
         //       content: (== include google/foo/tutorial_java.md ==)
         //   rules:
        @@ -157,9 +157,9 @@ message Page {
           // `[Java][Tutorial.Java]`.
           string name = 1;
         
        -  // The Markdown content of the page. You can use (== include {path}
        -  // ==) to include content from a Markdown file. The content can be
        -  // used to produce the documentation page such as HTML format page.
        +  // The Markdown content of the page. You can use ```(== include {path}
        +  // ==)``` to include content from a Markdown file. The content can be used
        +  // to produce the documentation page such as HTML format page.
           string content = 2;
         
           // Subpages of this page. The order of subpages specified here will be
        diff --git a/java-common-protos/proto-google-common-protos/src/main/proto/google/api/endpoint.proto b/java-common-protos/proto-google-common-protos/src/main/proto/google/api/endpoint.proto
        index 3b9f6a16c1..a9fa9992a4 100644
        --- a/java-common-protos/proto-google-common-protos/src/main/proto/google/api/endpoint.proto
        +++ b/java-common-protos/proto-google-common-protos/src/main/proto/google/api/endpoint.proto
        @@ -1,4 +1,4 @@
        -// Copyright 2015 Google LLC
        +// Copyright 2025 Google LLC
         //
         // Licensed under the Apache License, Version 2.0 (the "License");
         // you may not use this file except in compliance with the License.
        @@ -47,14 +47,10 @@ message Endpoint {
           // The canonical name of this endpoint.
           string name = 1;
         
        -  // Unimplemented. Dot not use.
        -  //
        -  // DEPRECATED: This field is no longer supported. Instead of using aliases,
        -  // please specify multiple [google.api.Endpoint][google.api.Endpoint] for each
        -  // of the intended aliases.
        -  //
        -  // Additional names that this endpoint will be hosted on.
        -  repeated string aliases = 2 [deprecated = true];
        +  // Aliases for this endpoint, these will be served by the same UrlMap as the
        +  // parent endpoint, and will be provisioned in the GCP stack for the Regional
        +  // Endpoints.
        +  repeated string aliases = 2;
         
           // The specification of an Internet routable address of API frontend that will
           // handle requests to this [API
        diff --git a/java-common-protos/proto-google-common-protos/src/main/proto/google/api/error_reason.proto b/java-common-protos/proto-google-common-protos/src/main/proto/google/api/error_reason.proto
        index 3b1d0e2123..030888ae33 100644
        --- a/java-common-protos/proto-google-common-protos/src/main/proto/google/api/error_reason.proto
        +++ b/java-common-protos/proto-google-common-protos/src/main/proto/google/api/error_reason.proto
        @@ -1,4 +1,4 @@
        -// Copyright 2020 Google LLC
        +// Copyright 2025 Google LLC
         //
         // Licensed under the Apache License, Version 2.0 (the "License");
         // you may not use this file except in compliance with the License.
        @@ -532,4 +532,91 @@ enum ErrorReason {
           //   }
           // }
           ORG_RESTRICTION_HEADER_INVALID = 28;
        +
        +  // Unimplemented. Do not use.
        +  //
        +  // The request is calling a service that is not visible to the consumer.
        +  //
        +  // Example of an ErrorInfo when the consumer "projects/123" contacting
        +  //  "pubsub.googleapis.com" service which is not visible to the consumer.
        +  //
        +  //     { "reason": "SERVICE_NOT_VISIBLE",
        +  //       "domain": "googleapis.com",
        +  //       "metadata": {
        +  //         "consumer": "projects/123",
        +  //         "service": "pubsub.googleapis.com"
        +  //       }
        +  //     }
        +  //
        +  // This response indicates the "pubsub.googleapis.com" is not visible to
        +  // "projects/123" (or it may not exist).
        +  SERVICE_NOT_VISIBLE = 29;
        +
        +  // The request is related to a project for which GCP access is suspended.
        +  //
        +  // Example of an ErrorInfo when the consumer "projects/123" fails to contact
        +  // "pubsub.googleapis.com" service because GCP access is suspended:
        +  //
        +  //     { "reason": "GCP_SUSPENDED",
        +  //       "domain": "googleapis.com",
        +  //       "metadata": {
        +  //         "consumer": "projects/123",
        +  //         "service": "pubsub.googleapis.com"
        +  //       }
        +  //     }
        +  //
        +  // This response indicates the associated GCP account has been suspended.
        +  GCP_SUSPENDED = 30;
        +
        +  // The request violates the location policies when creating resources in
        +  // the restricted region.
        +  //
        +  // Example of an ErrorInfo when creating the Cloud Storage Bucket by
        +  // "projects/123" for service storage.googleapis.com:
        +  //
        +  //     { "reason": "LOCATION_POLICY_VIOLATED",
        +  //       "domain": "googleapis.com",
        +  //       "metadata": {
        +  //         "consumer": "projects/123",
        +  //         "service": "storage.googleapis.com",
        +  //       }
        +  //     }
        +  //
        +  // This response indicates creating the Cloud Storage Bucket in
        +  // "locations/asia-northeast3" violates at least one location policy.
        +  // The troubleshooting guidance is provided in the Help links.
        +  LOCATION_POLICY_VIOLATED = 31;
        +
        +  // The request is denied because origin request header is missing.
        +  //
        +  // Example of an ErrorInfo when
        +  // accessing "pubsub.googleapis.com" service with an empty "Origin" request
        +  // header.
        +  //
        +  // {
        +  //   reason: "MISSING_ORIGIN"
        +  //   domain: "googleapis.com"
        +  //   metadata {
        +  //     "consumer":"projects/123456"
        +  //     "service": "pubsub.googleapis.com"
        +  //   }
        +  // }
        +  MISSING_ORIGIN = 33;
        +
        +  // The request is denied because the request contains more than one credential
        +  // type that are individually acceptable, but not together. The customer
        +  // should retry their request with only one set of credentials.
        +  //
        +  // Example of an ErrorInfo when
        +  // accessing "pubsub.googleapis.com" service with overloaded credentials.
        +  //
        +  // {
        +  //   reason: "OVERLOADED_CREDENTIALS"
        +  //   domain: "googleapis.com"
        +  //   metadata {
        +  //     "consumer":"projects/123456"
        +  //     "service": "pubsub.googleapis.com"
        +  //   }
        +  // }
        +  OVERLOADED_CREDENTIALS = 34;
         }
        diff --git a/java-common-protos/proto-google-common-protos/src/main/proto/google/api/field_behavior.proto b/java-common-protos/proto-google-common-protos/src/main/proto/google/api/field_behavior.proto
        index c4abe3b670..1fdaaed11a 100644
        --- a/java-common-protos/proto-google-common-protos/src/main/proto/google/api/field_behavior.proto
        +++ b/java-common-protos/proto-google-common-protos/src/main/proto/google/api/field_behavior.proto
        @@ -1,4 +1,4 @@
        -// Copyright 2018 Google LLC
        +// Copyright 2025 Google LLC
         //
         // Licensed under the Apache License, Version 2.0 (the "License");
         // you may not use this file except in compliance with the License.
        @@ -37,7 +37,7 @@ extend google.protobuf.FieldOptions {
           //   google.protobuf.Timestamp expire_time = 1
           //     [(google.api.field_behavior) = OUTPUT_ONLY,
           //      (google.api.field_behavior) = IMMUTABLE];
        -  repeated google.api.FieldBehavior field_behavior = 1052;
        +  repeated google.api.FieldBehavior field_behavior = 1052 [packed = false];
         }
         
         // An indicator of the behavior of a given field (for example, that a field
        @@ -87,4 +87,18 @@ enum FieldBehavior {
           // a non-empty value will be returned. The user will not be aware of what
           // non-empty value to expect.
           NON_EMPTY_DEFAULT = 7;
        +
        +  // Denotes that the field in a resource (a message annotated with
        +  // google.api.resource) is used in the resource name to uniquely identify the
        +  // resource. For AIP-compliant APIs, this should only be applied to the
        +  // `name` field on the resource.
        +  //
        +  // This behavior should not be applied to references to other resources within
        +  // the message.
        +  //
        +  // The identifier field of resources often have different field behavior
        +  // depending on the request it is embedded in (e.g. for Create methods name
        +  // is optional and unused, while for Update methods it is required). Instead
        +  // of method-specific annotations, only `IDENTIFIER` is required.
        +  IDENTIFIER = 8;
         }
        diff --git a/java-common-protos/proto-google-common-protos/src/main/proto/google/api/field_info.proto b/java-common-protos/proto-google-common-protos/src/main/proto/google/api/field_info.proto
        new file mode 100644
        index 0000000000..aaa07a1815
        --- /dev/null
        +++ b/java-common-protos/proto-google-common-protos/src/main/proto/google/api/field_info.proto
        @@ -0,0 +1,106 @@
        +// Copyright 2025 Google LLC
        +//
        +// Licensed under the Apache License, Version 2.0 (the "License");
        +// you may not use this file except in compliance with the License.
        +// You may obtain a copy of the License at
        +//
        +//     http://www.apache.org/licenses/LICENSE-2.0
        +//
        +// Unless required by applicable law or agreed to in writing, software
        +// distributed under the License is distributed on an "AS IS" BASIS,
        +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
        +// See the License for the specific language governing permissions and
        +// limitations under the License.
        +
        +syntax = "proto3";
        +
        +package google.api;
        +
        +import "google/protobuf/descriptor.proto";
        +
        +option go_package = "google.golang.org/genproto/googleapis/api/annotations;annotations";
        +option java_multiple_files = true;
        +option java_outer_classname = "FieldInfoProto";
        +option java_package = "com.google.api";
        +option objc_class_prefix = "GAPI";
        +
        +extend google.protobuf.FieldOptions {
        +  // Rich semantic descriptor of an API field beyond the basic typing.
        +  //
        +  // Examples:
        +  //
        +  //     string request_id = 1 [(google.api.field_info).format = UUID4];
        +  //     string old_ip_address = 2 [(google.api.field_info).format = IPV4];
        +  //     string new_ip_address = 3 [(google.api.field_info).format = IPV6];
        +  //     string actual_ip_address = 4 [
        +  //       (google.api.field_info).format = IPV4_OR_IPV6
        +  //     ];
        +  //     google.protobuf.Any generic_field = 5 [
        +  //       (google.api.field_info).referenced_types = {type_name: "ActualType"},
        +  //       (google.api.field_info).referenced_types = {type_name: "OtherType"},
        +  //     ];
        +  //     google.protobuf.Any generic_user_input = 5 [
        +  //       (google.api.field_info).referenced_types = {type_name: "*"},
        +  //     ];
        +  google.api.FieldInfo field_info = 291403980;
        +}
        +
        +// Rich semantic information of an API field beyond basic typing.
        +message FieldInfo {
        +  // The standard format of a field value. The supported formats are all backed
        +  // by either an RFC defined by the IETF or a Google-defined AIP.
        +  enum Format {
        +    // Default, unspecified value.
        +    FORMAT_UNSPECIFIED = 0;
        +
        +    // Universally Unique Identifier, version 4, value as defined by
        +    // https://datatracker.ietf.org/doc/html/rfc4122. The value may be
        +    // normalized to entirely lowercase letters. For example, the value
        +    // `F47AC10B-58CC-0372-8567-0E02B2C3D479` would be normalized to
        +    // `f47ac10b-58cc-0372-8567-0e02b2c3d479`.
        +    UUID4 = 1;
        +
        +    // Internet Protocol v4 value as defined by [RFC
        +    // 791](https://datatracker.ietf.org/doc/html/rfc791). The value may be
        +    // condensed, with leading zeros in each octet stripped. For example,
        +    // `001.022.233.040` would be condensed to `1.22.233.40`.
        +    IPV4 = 2;
        +
        +    // Internet Protocol v6 value as defined by [RFC
        +    // 2460](https://datatracker.ietf.org/doc/html/rfc2460). The value may be
        +    // normalized to entirely lowercase letters with zeros compressed, following
        +    // [RFC 5952](https://datatracker.ietf.org/doc/html/rfc5952). For example,
        +    // the value `2001:0DB8:0::0` would be normalized to `2001:db8::`.
        +    IPV6 = 3;
        +
        +    // An IP address in either v4 or v6 format as described by the individual
        +    // values defined herein. See the comments on the IPV4 and IPV6 types for
        +    // allowed normalizations of each.
        +    IPV4_OR_IPV6 = 4;
        +  }
        +
        +  // The standard format of a field value. This does not explicitly configure
        +  // any API consumer, just documents the API's format for the field it is
        +  // applied to.
        +  Format format = 1;
        +
        +  // The type(s) that the annotated, generic field may represent.
        +  //
        +  // Currently, this must only be used on fields of type `google.protobuf.Any`.
        +  // Supporting other generic types may be considered in the future.
        +  repeated TypeReference referenced_types = 2;
        +}
        +
        +// A reference to a message type, for use in [FieldInfo][google.api.FieldInfo].
        +message TypeReference {
        +  // The name of the type that the annotated, generic field may represent.
        +  // If the type is in the same protobuf package, the value can be the simple
        +  // message name e.g., `"MyMessage"`. Otherwise, the value must be the
        +  // fully-qualified message name e.g., `"google.library.v1.Book"`.
        +  //
        +  // If the type(s) are unknown to the service (e.g. the field accepts generic
        +  // user input), use the wildcard `"*"` to denote this behavior.
        +  //
        +  // See [AIP-202](https://google.aip.dev/202#type-references) for more details.
        +  string type_name = 1;
        +}
        diff --git a/java-common-protos/proto-google-common-protos/src/main/proto/google/api/http.proto b/java-common-protos/proto-google-common-protos/src/main/proto/google/api/http.proto
        index 113fa936a0..57621b5374 100644
        --- a/java-common-protos/proto-google-common-protos/src/main/proto/google/api/http.proto
        +++ b/java-common-protos/proto-google-common-protos/src/main/proto/google/api/http.proto
        @@ -1,4 +1,4 @@
        -// Copyright 2015 Google LLC
        +// Copyright 2025 Google LLC
         //
         // Licensed under the Apache License, Version 2.0 (the "License");
         // you may not use this file except in compliance with the License.
        @@ -16,7 +16,6 @@ syntax = "proto3";
         
         package google.api;
         
        -option cc_enable_arenas = true;
         option go_package = "google.golang.org/genproto/googleapis/api/annotations;annotations";
         option java_multiple_files = true;
         option java_outer_classname = "HttpProto";
        @@ -41,7 +40,7 @@ message Http {
           bool fully_decode_reserved_expansion = 2;
         }
         
        -// # gRPC Transcoding
        +// gRPC Transcoding
         //
         // gRPC Transcoding is a feature for mapping between a gRPC method and one or
         // more HTTP REST endpoints. It allows developers to build a single API service
        @@ -82,9 +81,8 @@ message Http {
         //
         // This enables an HTTP REST to gRPC mapping as below:
         //
        -// HTTP | gRPC
        -// -----|-----
        -// `GET /v1/messages/123456`  | `GetMessage(name: "messages/123456")`
        +// - HTTP: `GET /v1/messages/123456`
        +// - gRPC: `GetMessage(name: "messages/123456")`
         //
         // Any fields in the request message which are not bound by the path template
         // automatically become HTTP query parameters if there is no HTTP request body.
        @@ -108,11 +106,9 @@ message Http {
         //
         // This enables a HTTP JSON to RPC mapping as below:
         //
        -// HTTP | gRPC
        -// -----|-----
        -// `GET /v1/messages/123456?revision=2&sub.subfield=foo` |
        -// `GetMessage(message_id: "123456" revision: 2 sub: SubMessage(subfield:
        -// "foo"))`
        +// - HTTP: `GET /v1/messages/123456?revision=2&sub.subfield=foo`
        +// - gRPC: `GetMessage(message_id: "123456" revision: 2 sub:
        +// SubMessage(subfield: "foo"))`
         //
         // Note that fields which are mapped to URL query parameters must have a
         // primitive type or a repeated primitive type or a non-repeated message type.
        @@ -142,10 +138,8 @@ message Http {
         // representation of the JSON in the request body is determined by
         // protos JSON encoding:
         //
        -// HTTP | gRPC
        -// -----|-----
        -// `PATCH /v1/messages/123456 { "text": "Hi!" }` | `UpdateMessage(message_id:
        -// "123456" message { text: "Hi!" })`
        +// - HTTP: `PATCH /v1/messages/123456 { "text": "Hi!" }`
        +// - gRPC: `UpdateMessage(message_id: "123456" message { text: "Hi!" })`
         //
         // The special name `*` can be used in the body mapping to define that
         // every field not bound by the path template should be mapped to the
        @@ -168,10 +162,8 @@ message Http {
         //
         // The following HTTP JSON to RPC mapping is enabled:
         //
        -// HTTP | gRPC
        -// -----|-----
        -// `PATCH /v1/messages/123456 { "text": "Hi!" }` | `UpdateMessage(message_id:
        -// "123456" text: "Hi!")`
        +// - HTTP: `PATCH /v1/messages/123456 { "text": "Hi!" }`
        +// - gRPC: `UpdateMessage(message_id: "123456" text: "Hi!")`
         //
         // Note that when using `*` in the body mapping, it is not possible to
         // have HTTP parameters, as all fields not bound by the path end in
        @@ -199,29 +191,32 @@ message Http {
         //
         // This enables the following two alternative HTTP JSON to RPC mappings:
         //
        -// HTTP | gRPC
        -// -----|-----
        -// `GET /v1/messages/123456` | `GetMessage(message_id: "123456")`
        -// `GET /v1/users/me/messages/123456` | `GetMessage(user_id: "me" message_id:
        -// "123456")`
        +// - HTTP: `GET /v1/messages/123456`
        +// - gRPC: `GetMessage(message_id: "123456")`
         //
        -// ## Rules for HTTP mapping
        +// - HTTP: `GET /v1/users/me/messages/123456`
        +// - gRPC: `GetMessage(user_id: "me" message_id: "123456")`
        +//
        +// Rules for HTTP mapping
         //
         // 1. Leaf request fields (recursive expansion nested messages in the request
         //    message) are classified into three categories:
         //    - Fields referred by the path template. They are passed via the URL path.
        -//    - Fields referred by the [HttpRule.body][google.api.HttpRule.body]. They are passed via the HTTP
        +//    - Fields referred by the [HttpRule.body][google.api.HttpRule.body]. They
        +//    are passed via the HTTP
         //      request body.
         //    - All other fields are passed via the URL query parameters, and the
         //      parameter name is the field path in the request message. A repeated
         //      field can be represented as multiple query parameters under the same
         //      name.
        -//  2. If [HttpRule.body][google.api.HttpRule.body] is "*", there is no URL query parameter, all fields
        +//  2. If [HttpRule.body][google.api.HttpRule.body] is "*", there is no URL
        +//  query parameter, all fields
         //     are passed via URL path and HTTP request body.
        -//  3. If [HttpRule.body][google.api.HttpRule.body] is omitted, there is no HTTP request body, all
        +//  3. If [HttpRule.body][google.api.HttpRule.body] is omitted, there is no HTTP
        +//  request body, all
         //     fields are passed via URL path and URL query parameters.
         //
        -// ### Path template syntax
        +// Path template syntax
         //
         //     Template = "/" Segments [ Verb ] ;
         //     Segments = Segment { "/" Segment } ;
        @@ -260,7 +255,7 @@ message Http {
         // Document](https://developers.google.com/discovery/v1/reference/apis) as
         // `{+var}`.
         //
        -// ## Using gRPC API Service Configuration
        +// Using gRPC API Service Configuration
         //
         // gRPC API Service Configuration (service config) is a configuration language
         // for configuring a gRPC service to become a user-facing product. The
        @@ -275,15 +270,14 @@ message Http {
         // specified in the service config will override any matching transcoding
         // configuration in the proto.
         //
        -// Example:
        +// The following example selects a gRPC method and applies an `HttpRule` to it:
         //
         //     http:
         //       rules:
        -//         # Selects a gRPC method and applies HttpRule to it.
         //         - selector: example.v1.Messaging.GetMessage
         //           get: /v1/messages/{message_id}/{sub.subfield}
         //
        -// ## Special notes
        +// Special notes
         //
         // When gRPC Transcoding is used to map a gRPC to JSON REST endpoints, the
         // proto to JSON conversion must follow the [proto3
        @@ -313,7 +307,8 @@ message Http {
         message HttpRule {
           // Selects a method to which this rule applies.
           //
        -  // Refer to [selector][google.api.DocumentationRule.selector] for syntax details.
        +  // Refer to [selector][google.api.DocumentationRule.selector] for syntax
        +  // details.
           string selector = 1;
         
           // Determines the URL pattern is matched by this rules. This pattern can be
        diff --git a/java-common-protos/proto-google-common-protos/src/main/proto/google/api/httpbody.proto b/java-common-protos/proto-google-common-protos/src/main/proto/google/api/httpbody.proto
        index 00c80aba9d..e3e17c8acb 100644
        --- a/java-common-protos/proto-google-common-protos/src/main/proto/google/api/httpbody.proto
        +++ b/java-common-protos/proto-google-common-protos/src/main/proto/google/api/httpbody.proto
        @@ -1,4 +1,4 @@
        -// Copyright 2015 Google LLC
        +// Copyright 2025 Google LLC
         //
         // Licensed under the Apache License, Version 2.0 (the "License");
         // you may not use this file except in compliance with the License.
        @@ -18,7 +18,6 @@ package google.api;
         
         import "google/protobuf/any.proto";
         
        -option cc_enable_arenas = true;
         option go_package = "google.golang.org/genproto/googleapis/api/httpbody;httpbody";
         option java_multiple_files = true;
         option java_outer_classname = "HttpBodyProto";
        diff --git a/java-common-protos/proto-google-common-protos/src/main/proto/google/api/label.proto b/java-common-protos/proto-google-common-protos/src/main/proto/google/api/label.proto
        index af294c91ca..739e4e95ed 100644
        --- a/java-common-protos/proto-google-common-protos/src/main/proto/google/api/label.proto
        +++ b/java-common-protos/proto-google-common-protos/src/main/proto/google/api/label.proto
        @@ -1,4 +1,4 @@
        -// Copyright 2015 Google LLC
        +// Copyright 2025 Google LLC
         //
         // Licensed under the Apache License, Version 2.0 (the "License");
         // you may not use this file except in compliance with the License.
        @@ -16,7 +16,6 @@ syntax = "proto3";
         
         package google.api;
         
        -option cc_enable_arenas = true;
         option go_package = "google.golang.org/genproto/googleapis/api/label;label";
         option java_multiple_files = true;
         option java_outer_classname = "LabelProto";
        diff --git a/java-common-protos/proto-google-common-protos/src/main/proto/google/api/launch_stage.proto b/java-common-protos/proto-google-common-protos/src/main/proto/google/api/launch_stage.proto
        index 6524db5756..1e86c1ad17 100644
        --- a/java-common-protos/proto-google-common-protos/src/main/proto/google/api/launch_stage.proto
        +++ b/java-common-protos/proto-google-common-protos/src/main/proto/google/api/launch_stage.proto
        @@ -1,4 +1,4 @@
        -// Copyright 2015 Google LLC
        +// Copyright 2025 Google LLC
         //
         // Licensed under the Apache License, Version 2.0 (the "License");
         // you may not use this file except in compliance with the License.
        diff --git a/java-common-protos/proto-google-common-protos/src/main/proto/google/api/log.proto b/java-common-protos/proto-google-common-protos/src/main/proto/google/api/log.proto
        index 22ee289372..3d55e408be 100644
        --- a/java-common-protos/proto-google-common-protos/src/main/proto/google/api/log.proto
        +++ b/java-common-protos/proto-google-common-protos/src/main/proto/google/api/log.proto
        @@ -1,4 +1,4 @@
        -// Copyright 2015 Google LLC
        +// Copyright 2025 Google LLC
         //
         // Licensed under the Apache License, Version 2.0 (the "License");
         // you may not use this file except in compliance with the License.
        diff --git a/java-common-protos/proto-google-common-protos/src/main/proto/google/api/logging.proto b/java-common-protos/proto-google-common-protos/src/main/proto/google/api/logging.proto
        index e60f77ca50..613e005ed5 100644
        --- a/java-common-protos/proto-google-common-protos/src/main/proto/google/api/logging.proto
        +++ b/java-common-protos/proto-google-common-protos/src/main/proto/google/api/logging.proto
        @@ -1,4 +1,4 @@
        -// Copyright 2015 Google LLC
        +// Copyright 2025 Google LLC
         //
         // Licensed under the Apache License, Version 2.0 (the "License");
         // you may not use this file except in compliance with the License.
        @@ -56,13 +56,14 @@ message Logging {
           // or the consumer project).
           message LoggingDestination {
             // The monitored resource type. The type must be defined in the
        -    // [Service.monitored_resources][google.api.Service.monitored_resources] section.
        +    // [Service.monitored_resources][google.api.Service.monitored_resources]
        +    // section.
             string monitored_resource = 3;
         
             // Names of the logs to be sent to this destination. Each name must
        -    // be defined in the [Service.logs][google.api.Service.logs] section. If the log name is
        -    // not a domain scoped name, it will be automatically prefixed with
        -    // the service name followed by "/".
        +    // be defined in the [Service.logs][google.api.Service.logs] section. If the
        +    // log name is not a domain scoped name, it will be automatically prefixed
        +    // with the service name followed by "/".
             repeated string logs = 1;
           }
         
        diff --git a/java-common-protos/proto-google-common-protos/src/main/proto/google/api/metric.proto b/java-common-protos/proto-google-common-protos/src/main/proto/google/api/metric.proto
        index c206666f63..9da49ba0cd 100644
        --- a/java-common-protos/proto-google-common-protos/src/main/proto/google/api/metric.proto
        +++ b/java-common-protos/proto-google-common-protos/src/main/proto/google/api/metric.proto
        @@ -1,4 +1,4 @@
        -// Copyright 2015 Google LLC
        +// Copyright 2025 Google LLC
         //
         // Licensed under the Apache License, Version 2.0 (the "License");
         // you may not use this file except in compliance with the License.
        @@ -80,7 +80,24 @@ message MetricDescriptor {
         
           // Additional annotations that can be used to guide the usage of a metric.
           message MetricDescriptorMetadata {
        -    // Deprecated. Must use the [MetricDescriptor.launch_stage][google.api.MetricDescriptor.launch_stage] instead.
        +    // The resource hierarchy level of the timeseries data of a metric.
        +    enum TimeSeriesResourceHierarchyLevel {
        +      // Do not use this default value.
        +      TIME_SERIES_RESOURCE_HIERARCHY_LEVEL_UNSPECIFIED = 0;
        +
        +      // Scopes a metric to a project.
        +      PROJECT = 1;
        +
        +      // Scopes a metric to an organization.
        +      ORGANIZATION = 2;
        +
        +      // Scopes a metric to a folder.
        +      FOLDER = 3;
        +    }
        +
        +    // Deprecated. Must use the
        +    // [MetricDescriptor.launch_stage][google.api.MetricDescriptor.launch_stage]
        +    // instead.
             LaunchStage launch_stage = 1 [deprecated = true];
         
             // The sampling period of metric data points. For metrics which are written
        @@ -93,6 +110,10 @@ message MetricDescriptor {
             // age are guaranteed to be ingested and available to be read, excluding
             // data loss due to errors.
             google.protobuf.Duration ingest_delay = 3;
        +
        +    // The scope of the timeseries data of the metric.
        +    repeated TimeSeriesResourceHierarchyLevel
        +        time_series_resource_hierarchy_level = 4;
           }
         
           // The resource name of the metric descriptor.
        @@ -245,17 +266,19 @@ message MetricDescriptor {
         
           // Read-only. If present, then a [time
           // series][google.monitoring.v3.TimeSeries], which is identified partially by
        -  // a metric type and a [MonitoredResourceDescriptor][google.api.MonitoredResourceDescriptor], that is associated
        -  // with this metric type can only be associated with one of the monitored
        -  // resource types listed here.
        +  // a metric type and a
        +  // [MonitoredResourceDescriptor][google.api.MonitoredResourceDescriptor], that
        +  // is associated with this metric type can only be associated with one of the
        +  // monitored resource types listed here.
           repeated string monitored_resource_types = 13;
         }
         
         // A specific metric, identified by specifying values for all of the
         // labels of a [`MetricDescriptor`][google.api.MetricDescriptor].
         message Metric {
        -  // An existing metric type, see [google.api.MetricDescriptor][google.api.MetricDescriptor].
        -  // For example, `custom.googleapis.com/invoice/paid/amount`.
        +  // An existing metric type, see
        +  // [google.api.MetricDescriptor][google.api.MetricDescriptor]. For example,
        +  // `custom.googleapis.com/invoice/paid/amount`.
           string type = 3;
         
           // The set of label values that uniquely identify this metric. All
        diff --git a/java-common-protos/proto-google-common-protos/src/main/proto/google/api/monitored_resource.proto b/java-common-protos/proto-google-common-protos/src/main/proto/google/api/monitored_resource.proto
        index 8b97baa104..36abe14ca0 100644
        --- a/java-common-protos/proto-google-common-protos/src/main/proto/google/api/monitored_resource.proto
        +++ b/java-common-protos/proto-google-common-protos/src/main/proto/google/api/monitored_resource.proto
        @@ -1,4 +1,4 @@
        -// Copyright 2015 Google LLC
        +// Copyright 2025 Google LLC
         //
         // Licensed under the Apache License, Version 2.0 (the "License");
         // you may not use this file except in compliance with the License.
        @@ -20,16 +20,16 @@ import "google/api/label.proto";
         import "google/api/launch_stage.proto";
         import "google/protobuf/struct.proto";
         
        -option cc_enable_arenas = true;
         option go_package = "google.golang.org/genproto/googleapis/api/monitoredres;monitoredres";
         option java_multiple_files = true;
         option java_outer_classname = "MonitoredResourceProto";
         option java_package = "com.google.api";
         option objc_class_prefix = "GAPI";
         
        -// An object that describes the schema of a [MonitoredResource][google.api.MonitoredResource] object using a
        -// type name and a set of labels.  For example, the monitored resource
        -// descriptor for Google Compute Engine VM instances has a type of
        +// An object that describes the schema of a
        +// [MonitoredResource][google.api.MonitoredResource] object using a type name
        +// and a set of labels.  For example, the monitored resource descriptor for
        +// Google Compute Engine VM instances has a type of
         // `"gce_instance"` and specifies the use of the labels `"instance_id"` and
         // `"zone"` to identify particular VM instances.
         //
        @@ -48,7 +48,7 @@ message MonitoredResourceDescriptor {
         
           // Required. The monitored resource type. For example, the type
           // `"cloudsql_database"` represents databases in Google Cloud SQL.
        -  //  For a list of types, see [Monitoring resource
        +  //  For a list of types, see [Monitored resource
           //  types](https://cloud.google.com/monitoring/api/resources)
           // and [Logging resource
           // types](https://cloud.google.com/logging/docs/api/v2/resource-list).
        @@ -76,11 +76,13 @@ message MonitoredResourceDescriptor {
         // An object representing a resource that can be used for monitoring, logging,
         // billing, or other purposes. Examples include virtual machine instances,
         // databases, and storage devices such as disks. The `type` field identifies a
        -// [MonitoredResourceDescriptor][google.api.MonitoredResourceDescriptor] object that describes the resource's
        -// schema. Information in the `labels` field identifies the actual resource and
        -// its attributes according to the schema. For example, a particular Compute
        -// Engine VM instance could be represented by the following object, because the
        -// [MonitoredResourceDescriptor][google.api.MonitoredResourceDescriptor] for `"gce_instance"` has labels
        +// [MonitoredResourceDescriptor][google.api.MonitoredResourceDescriptor] object
        +// that describes the resource's schema. Information in the `labels` field
        +// identifies the actual resource and its attributes according to the schema.
        +// For example, a particular Compute Engine VM instance could be represented by
        +// the following object, because the
        +// [MonitoredResourceDescriptor][google.api.MonitoredResourceDescriptor] for
        +// `"gce_instance"` has labels
         // `"project_id"`, `"instance_id"` and `"zone"`:
         //
         //     { "type": "gce_instance",
        @@ -89,10 +91,12 @@ message MonitoredResourceDescriptor {
         //                   "zone": "us-central1-a" }}
         message MonitoredResource {
           // Required. The monitored resource type. This field must match
        -  // the `type` field of a [MonitoredResourceDescriptor][google.api.MonitoredResourceDescriptor] object. For
        -  // example, the type of a Compute Engine VM instance is `gce_instance`.
        -  // Some descriptors include the service name in the type; for example,
        -  // the type of a Datastream stream is `datastream.googleapis.com/Stream`.
        +  // the `type` field of a
        +  // [MonitoredResourceDescriptor][google.api.MonitoredResourceDescriptor]
        +  // object. For example, the type of a Compute Engine VM instance is
        +  // `gce_instance`. Some descriptors include the service name in the type; for
        +  // example, the type of a Datastream stream is
        +  // `datastream.googleapis.com/Stream`.
           string type = 1;
         
           // Required. Values for all of the labels listed in the associated monitored
        @@ -101,12 +105,12 @@ message MonitoredResource {
           map labels = 2;
         }
         
        -// Auxiliary metadata for a [MonitoredResource][google.api.MonitoredResource] object.
        -// [MonitoredResource][google.api.MonitoredResource] objects contain the minimum set of information to
        -// uniquely identify a monitored resource instance. There is some other useful
        -// auxiliary metadata. Monitoring and Logging use an ingestion
        -// pipeline to extract metadata for cloud resources of all types, and store
        -// the metadata in this message.
        +// Auxiliary metadata for a [MonitoredResource][google.api.MonitoredResource]
        +// object. [MonitoredResource][google.api.MonitoredResource] objects contain the
        +// minimum set of information to uniquely identify a monitored resource
        +// instance. There is some other useful auxiliary metadata. Monitoring and
        +// Logging use an ingestion pipeline to extract metadata for cloud resources of
        +// all types, and store the metadata in this message.
         message MonitoredResourceMetadata {
           // Output only. Values for predefined system metadata labels.
           // System labels are a kind of metadata extracted by Google, including
        diff --git a/java-common-protos/proto-google-common-protos/src/main/proto/google/api/monitoring.proto b/java-common-protos/proto-google-common-protos/src/main/proto/google/api/monitoring.proto
        index 60770ec5a3..5c3b2d9d90 100644
        --- a/java-common-protos/proto-google-common-protos/src/main/proto/google/api/monitoring.proto
        +++ b/java-common-protos/proto-google-common-protos/src/main/proto/google/api/monitoring.proto
        @@ -1,4 +1,4 @@
        -// Copyright 2015 Google LLC
        +// Copyright 2025 Google LLC
         //
         // Licensed under the Apache License, Version 2.0 (the "License");
         // you may not use this file except in compliance with the License.
        @@ -79,11 +79,13 @@ message Monitoring {
           // or the consumer project).
           message MonitoringDestination {
             // The monitored resource type. The type must be defined in
        -    // [Service.monitored_resources][google.api.Service.monitored_resources] section.
        +    // [Service.monitored_resources][google.api.Service.monitored_resources]
        +    // section.
             string monitored_resource = 1;
         
             // Types of the metrics to report to this monitoring destination.
        -    // Each type must be defined in [Service.metrics][google.api.Service.metrics] section.
        +    // Each type must be defined in
        +    // [Service.metrics][google.api.Service.metrics] section.
             repeated string metrics = 2;
           }
         
        diff --git a/java-common-protos/proto-google-common-protos/src/main/proto/google/api/policy.proto b/java-common-protos/proto-google-common-protos/src/main/proto/google/api/policy.proto
        new file mode 100644
        index 0000000000..cc577a169b
        --- /dev/null
        +++ b/java-common-protos/proto-google-common-protos/src/main/proto/google/api/policy.proto
        @@ -0,0 +1,82 @@
        +// Copyright 2025 Google LLC
        +//
        +// Licensed under the Apache License, Version 2.0 (the "License");
        +// you may not use this file except in compliance with the License.
        +// You may obtain a copy of the License at
        +//
        +//     http://www.apache.org/licenses/LICENSE-2.0
        +//
        +// Unless required by applicable law or agreed to in writing, software
        +// distributed under the License is distributed on an "AS IS" BASIS,
        +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
        +// See the License for the specific language governing permissions and
        +// limitations under the License.
        +
        +syntax = "proto3";
        +
        +package google.api;
        +
        +import "google/protobuf/descriptor.proto";
        +
        +option go_package = "google.golang.org/genproto/googleapis/api/serviceconfig;serviceconfig";
        +option java_multiple_files = true;
        +option java_outer_classname = "PolicyProto";
        +option java_package = "com.google.api";
        +option objc_class_prefix = "GAPI";
        +
        +extend google.protobuf.FieldOptions {
        +  // See [FieldPolicy][].
        +  google.api.FieldPolicy field_policy = 158361448;
        +}
        +
        +extend google.protobuf.MethodOptions {
        +  // See [MethodPolicy][].
        +  google.api.MethodPolicy method_policy = 161893301;
        +}
        +
        +// Google API Policy Annotation
        +//
        +// This message defines a simple API policy annotation that can be used to
        +// annotate API request and response message fields with applicable policies.
        +// One field may have multiple applicable policies that must all be satisfied
        +// before a request can be processed. This policy annotation is used to
        +// generate the overall policy that will be used for automatic runtime
        +// policy enforcement and documentation generation.
        +message FieldPolicy {
        +  // Selects one or more request or response message fields to apply this
        +  // `FieldPolicy`.
        +  //
        +  // When a `FieldPolicy` is used in proto annotation, the selector must
        +  // be left as empty. The service config generator will automatically fill
        +  // the correct value.
        +  //
        +  // When a `FieldPolicy` is used in service config, the selector must be a
        +  // comma-separated string with valid request or response field paths,
        +  // such as "foo.bar" or "foo.bar,foo.baz".
        +  string selector = 1;
        +
        +  // Specifies the required permission(s) for the resource referred to by the
        +  // field. It requires the field contains a valid resource reference, and
        +  // the request must pass the permission checks to proceed. For example,
        +  // "resourcemanager.projects.get".
        +  string resource_permission = 2;
        +
        +  // Specifies the resource type for the resource referred to by the field.
        +  string resource_type = 3;
        +}
        +
        +// Defines policies applying to an RPC method.
        +message MethodPolicy {
        +  // Selects a method to which these policies should be enforced, for example,
        +  // "google.pubsub.v1.Subscriber.CreateSubscription".
        +  //
        +  // Refer to [selector][google.api.DocumentationRule.selector] for syntax
        +  // details.
        +  //
        +  // NOTE: This field must not be set in the proto annotation. It will be
        +  // automatically filled by the service config compiler .
        +  string selector = 9;
        +
        +  // Policies that are applicable to the request message.
        +  repeated FieldPolicy request_policies = 2;
        +}
        diff --git a/java-common-protos/proto-google-common-protos/src/main/proto/google/api/quota.proto b/java-common-protos/proto-google-common-protos/src/main/proto/google/api/quota.proto
        index 3272cdae5c..9e7fb3bf65 100644
        --- a/java-common-protos/proto-google-common-protos/src/main/proto/google/api/quota.proto
        +++ b/java-common-protos/proto-google-common-protos/src/main/proto/google/api/quota.proto
        @@ -1,4 +1,4 @@
        -// Copyright 2015 Google LLC
        +// Copyright 2025 Google LLC
         //
         // Licensed under the Apache License, Version 2.0 (the "License");
         // you may not use this file except in compliance with the License.
        @@ -87,7 +87,8 @@ message Quota {
         message MetricRule {
           // Selects the methods to which this rule applies.
           //
        -  // Refer to [selector][google.api.DocumentationRule.selector] for syntax details.
        +  // Refer to [selector][google.api.DocumentationRule.selector] for syntax
        +  // details.
           string selector = 1;
         
           // Metrics to update when the selected methods are called, and the associated
        @@ -160,8 +161,8 @@ message QuotaLimit {
           string metric = 8;
         
           // Specify the unit of the quota limit. It uses the same syntax as
        -  // [Metric.unit][]. The supported unit kinds are determined by the quota
        -  // backend system.
        +  // [MetricDescriptor.unit][google.api.MetricDescriptor.unit]. The supported
        +  // unit kinds are determined by the quota backend system.
           //
           // Here are some examples:
           // * "1/min/{project}" for quota per minute per project.
        diff --git a/java-common-protos/proto-google-common-protos/src/main/proto/google/api/resource.proto b/java-common-protos/proto-google-common-protos/src/main/proto/google/api/resource.proto
        index 0ce0344f57..5669cbc985 100644
        --- a/java-common-protos/proto-google-common-protos/src/main/proto/google/api/resource.proto
        +++ b/java-common-protos/proto-google-common-protos/src/main/proto/google/api/resource.proto
        @@ -1,4 +1,4 @@
        -// Copyright 2018 Google LLC
        +// Copyright 2025 Google LLC
         //
         // Licensed under the Apache License, Version 2.0 (the "License");
         // you may not use this file except in compliance with the License.
        @@ -18,7 +18,6 @@ package google.api;
         
         import "google/protobuf/descriptor.proto";
         
        -option cc_enable_arenas = true;
         option go_package = "google.golang.org/genproto/googleapis/api/annotations;annotations";
         option java_multiple_files = true;
         option java_outer_classname = "ResourceProto";
        @@ -179,8 +178,13 @@ message ResourceDescriptor {
         
           // The plural name used in the resource name and permission names, such as
           // 'projects' for the resource name of 'projects/{project}' and the permission
        -  // name of 'cloudresourcemanager.googleapis.com/projects.get'. It is the same
        -  // concept of the `plural` field in k8s CRD spec
        +  // name of 'cloudresourcemanager.googleapis.com/projects.get'. One exception
        +  // to this is for Nested Collections that have stuttering names, as defined
        +  // in [AIP-122](https://google.aip.dev/122#nested-collections), where the
        +  // collection ID in the resource name pattern does not necessarily directly
        +  // match the `plural` value.
        +  //
        +  // It is the same concept of the `plural` field in k8s CRD spec
           // https://kubernetes.io/docs/tasks/access-kubernetes-api/custom-resources/custom-resource-definitions/
           //
           // Note: The plural form is required even for singleton resources. See
        diff --git a/java-common-protos/proto-google-common-protos/src/main/proto/google/api/routing.proto b/java-common-protos/proto-google-common-protos/src/main/proto/google/api/routing.proto
        index 0138283890..4fcb2acb6c 100644
        --- a/java-common-protos/proto-google-common-protos/src/main/proto/google/api/routing.proto
        +++ b/java-common-protos/proto-google-common-protos/src/main/proto/google/api/routing.proto
        @@ -1,4 +1,4 @@
        -// Copyright 2021 Google LLC
        +// Copyright 2025 Google LLC
         //
         // Licensed under the Apache License, Version 2.0 (the "License");
         // you may not use this file except in compliance with the License.
        @@ -62,7 +62,7 @@ extend google.protobuf.MethodOptions {
         // The routing header consists of one or multiple key-value pairs. Every key
         // and value must be percent-encoded, and joined together in the format of
         // `key1=value1&key2=value2`.
        -// In the examples below I am skipping the percent-encoding for readablity.
        +// The examples below skip the percent-encoding for readability.
         //
         // Example 1
         //
        diff --git a/java-common-protos/proto-google-common-protos/src/main/proto/google/api/service.proto b/java-common-protos/proto-google-common-protos/src/main/proto/google/api/service.proto
        index a901863428..598b75a0e4 100644
        --- a/java-common-protos/proto-google-common-protos/src/main/proto/google/api/service.proto
        +++ b/java-common-protos/proto-google-common-protos/src/main/proto/google/api/service.proto
        @@ -1,4 +1,4 @@
        -// Copyright 2015 Google LLC
        +// Copyright 2025 Google LLC
         //
         // Licensed under the Apache License, Version 2.0 (the "License");
         // you may not use this file except in compliance with the License.
        @@ -98,10 +98,10 @@ message Service {
           string id = 33;
         
           // A list of API interfaces exported by this service. Only the `name` field
        -  // of the [google.protobuf.Api][google.protobuf.Api] needs to be provided by the configuration
        -  // author, as the remaining fields will be derived from the IDL during the
        -  // normalization process. It is an error to specify an API interface here
        -  // which cannot be resolved against the associated IDL files.
        +  // of the [google.protobuf.Api][google.protobuf.Api] needs to be provided by
        +  // the configuration author, as the remaining fields will be derived from the
        +  // IDL during the normalization process. It is an error to specify an API
        +  // interface here which cannot be resolved against the associated IDL files.
           repeated google.protobuf.Api apis = 3;
         
           // A list of all proto message types included in this API service.
        @@ -159,7 +159,8 @@ message Service {
           repeated MetricDescriptor metrics = 24;
         
           // Defines the monitored resources used by this service. This is required
        -  // by the [Service.monitoring][google.api.Service.monitoring] and [Service.logging][google.api.Service.logging] configurations.
        +  // by the [Service.monitoring][google.api.Service.monitoring] and
        +  // [Service.logging][google.api.Service.logging] configurations.
           repeated MonitoredResourceDescriptor monitored_resources = 25;
         
           // Billing configuration.
        diff --git a/java-common-protos/proto-google-common-protos/src/main/proto/google/api/source_info.proto b/java-common-protos/proto-google-common-protos/src/main/proto/google/api/source_info.proto
        index cbdd625cdb..3257b5a722 100644
        --- a/java-common-protos/proto-google-common-protos/src/main/proto/google/api/source_info.proto
        +++ b/java-common-protos/proto-google-common-protos/src/main/proto/google/api/source_info.proto
        @@ -1,4 +1,4 @@
        -// Copyright 2015 Google LLC
        +// Copyright 2025 Google LLC
         //
         // Licensed under the Apache License, Version 2.0 (the "License");
         // you may not use this file except in compliance with the License.
        diff --git a/java-common-protos/proto-google-common-protos/src/main/proto/google/api/system_parameter.proto b/java-common-protos/proto-google-common-protos/src/main/proto/google/api/system_parameter.proto
        index 7d0b1d572e..15b93f913e 100644
        --- a/java-common-protos/proto-google-common-protos/src/main/proto/google/api/system_parameter.proto
        +++ b/java-common-protos/proto-google-common-protos/src/main/proto/google/api/system_parameter.proto
        @@ -1,4 +1,4 @@
        -// Copyright 2015 Google LLC
        +// Copyright 2025 Google LLC
         //
         // Licensed under the Apache License, Version 2.0 (the "License");
         // you may not use this file except in compliance with the License.
        @@ -67,7 +67,8 @@ message SystemParameterRule {
           // Selects the methods to which this rule applies. Use '*' to indicate all
           // methods in all APIs.
           //
        -  // Refer to [selector][google.api.DocumentationRule.selector] for syntax details.
        +  // Refer to [selector][google.api.DocumentationRule.selector] for syntax
        +  // details.
           string selector = 1;
         
           // Define parameters. Multiple names may be defined for a parameter.
        diff --git a/java-common-protos/proto-google-common-protos/src/main/proto/google/api/usage.proto b/java-common-protos/proto-google-common-protos/src/main/proto/google/api/usage.proto
        index ad2764c90f..4b7aa5fdf2 100644
        --- a/java-common-protos/proto-google-common-protos/src/main/proto/google/api/usage.proto
        +++ b/java-common-protos/proto-google-common-protos/src/main/proto/google/api/usage.proto
        @@ -1,4 +1,4 @@
        -// Copyright 2015 Google LLC
        +// Copyright 2025 Google LLC
         //
         // Licensed under the Apache License, Version 2.0 (the "License");
         // you may not use this file except in compliance with the License.
        @@ -80,7 +80,8 @@ message UsageRule {
           // Selects the methods to which this rule applies. Use '*' to indicate all
           // methods in all APIs.
           //
        -  // Refer to [selector][google.api.DocumentationRule.selector] for syntax details.
        +  // Refer to [selector][google.api.DocumentationRule.selector] for syntax
        +  // details.
           string selector = 1;
         
           // If true, the selected method allows unregistered calls, e.g. calls
        diff --git a/java-common-protos/proto-google-common-protos/src/main/proto/google/api/visibility.proto b/java-common-protos/proto-google-common-protos/src/main/proto/google/api/visibility.proto
        index 0be4581d14..0ab5bdc1c9 100644
        --- a/java-common-protos/proto-google-common-protos/src/main/proto/google/api/visibility.proto
        +++ b/java-common-protos/proto-google-common-protos/src/main/proto/google/api/visibility.proto
        @@ -1,4 +1,4 @@
        -// Copyright 2021 Google LLC
        +// Copyright 2025 Google LLC
         //
         // Licensed under the Apache License, Version 2.0 (the "License");
         // you may not use this file except in compliance with the License.
        @@ -18,7 +18,6 @@ package google.api;
         
         import "google/protobuf/descriptor.proto";
         
        -option cc_enable_arenas = true;
         option go_package = "google.golang.org/genproto/googleapis/api/visibility;visibility";
         option java_multiple_files = true;
         option java_outer_classname = "VisibilityProto";
        diff --git a/java-common-protos/proto-google-common-protos/src/main/proto/google/apps/card/v1/card.proto b/java-common-protos/proto-google-common-protos/src/main/proto/google/apps/card/v1/card.proto
        new file mode 100644
        index 0000000000..c6f659256c
        --- /dev/null
        +++ b/java-common-protos/proto-google-common-protos/src/main/proto/google/apps/card/v1/card.proto
        @@ -0,0 +1,2459 @@
        +// Copyright 2026 Google LLC
        +//
        +// Licensed under the Apache License, Version 2.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.apps.card.v1;
        +
        +import "google/type/color.proto";
        +
        +option csharp_namespace = "Google.Apps.Card.V1";
        +option go_package = "google.golang.org/genproto/googleapis/apps/card/v1;card";
        +option java_multiple_files = true;
        +option java_outer_classname = "CardProto";
        +option java_package = "com.google.apps.card.v1";
        +option php_namespace = "Google\\Apps\\Card\\V1";
        +option ruby_package = "Google::Apps::Card::V1";
        +
        +// A card interface displayed in a Google Chat message or Google Workspace
        +// add-on.
        +//
        +// Cards support a defined layout, interactive UI elements like buttons, and
        +// rich media like images. Use cards to present detailed information,
        +// gather information from users, and guide users to take a next step.
        +//
        +// [Card builder](https://addons.gsuite.google.com/uikit/builder)
        +//
        +// To learn how
        +// to build cards, see the following documentation:
        +//
        +// * For Google Chat apps, see [Design the components of a card or
        +//   dialog](https://developers.google.com/workspace/chat/design-components-card-dialog).
        +// * For Google Workspace add-ons, see [Card-based
        +// interfaces](https://developers.google.com/apps-script/add-ons/concepts/cards).
        +//
        +// Note: You can add up to 100 widgets per card. Any widgets beyond this
        +// limit are ignored. This limit applies to both card messages and dialogs
        +// in Google Chat apps, and to cards in Google Workspace add-ons.
        +//
        +// **Example: Card message for a Google Chat app**
        +//
        +// ![Example contact
        +// card](https://developers.google.com/workspace/chat/images/card_api_reference.png)
        +//
        +// To create the sample card message in Google Chat, use the following JSON:
        +//
        +// ```
        +// {
        +//   "cardsV2": [
        +//     {
        +//       "cardId": "unique-card-id",
        +//       "card": {
        +//         "header": {
        +//            "title": "Sasha",
        +//            "subtitle": "Software Engineer",
        +//            "imageUrl":
        +//            "https://developers.google.com/workspace/chat/images/quickstart-app-avatar.png",
        +//            "imageType": "CIRCLE",
        +//            "imageAltText": "Avatar for Sasha"
        +//          },
        +//          "sections": [
        +//            {
        +//              "header": "Contact Info",
        +//              "collapsible": true,
        +//              "uncollapsibleWidgetsCount": 1,
        +//              "widgets": [
        +//                {
        +//                  "decoratedText": {
        +//                    "startIcon": {
        +//                      "knownIcon": "EMAIL"
        +//                    },
        +//                    "text": "sasha@example.com"
        +//                  }
        +//                },
        +//                {
        +//                  "decoratedText": {
        +//                    "startIcon": {
        +//                      "knownIcon": "PERSON"
        +//                    },
        +//                    "text": "Online"
        +//                  }
        +//                },
        +//                {
        +//                  "decoratedText": {
        +//                    "startIcon": {
        +//                      "knownIcon": "PHONE"
        +//                    },
        +//                    "text": "+1 (555) 555-1234"
        +//                  }
        +//                },
        +//                {
        +//                  "buttonList": {
        +//                    "buttons": [
        +//                      {
        +//                        "text": "Share",
        +//                        "onClick": {
        +//                         "openLink": {
        +//                            "url": "https://example.com/share"
        +//                          }
        +//                        }
        +//                      },
        +//                      {
        +//                        "text": "Edit",
        +//                        "onClick": {
        +//                          "action": {
        +//                            "function": "goToView",
        +//                            "parameters": [
        +//                              {
        +//                                "key": "viewType",
        +//                                "value": "EDIT"
        +//                              }
        +//                            ]
        +//                          }
        +//                        }
        +//                      }
        +//                    ]
        +//                  }
        +//                }
        +//              ]
        +//            }
        +//          ]
        +//        }
        +//     }
        +//   ]
        +// }
        +// ```
        +message Card {
        +  // Represents a card header. For an example in Google Chat apps, see [Add a
        +  // header](https://developers.google.com/workspace/chat/design-components-card-dialog#add_a_header).
        +  //
        +  // [Google Workspace add-ons and Chat
        +  // apps](https://developers.google.com/workspace/extend):
        +  message CardHeader {
        +    // Required. The title of the card header.
        +    // The header has a fixed height: if both a
        +    // title and subtitle are specified, each takes up one line. If only the
        +    // title is specified, it takes up both lines.
        +    string title = 1;
        +
        +    // The subtitle of the card header. If specified, appears on its own line
        +    // below the `title`.
        +    string subtitle = 2;
        +
        +    // The shape used to crop the image.
        +    //
        +    // [Google Workspace add-ons and Chat
        +    // apps](https://developers.google.com/workspace/extend):
        +    Widget.ImageType image_type = 3;
        +
        +    // The HTTPS URL of the image in the card header.
        +    string image_url = 4;
        +
        +    // The alternative text of this image that's used for accessibility.
        +    string image_alt_text = 5;
        +  }
        +
        +  // A section contains a collection of widgets that are rendered
        +  // vertically in the order that they're specified.
        +  //
        +  // [Google Workspace add-ons and Chat
        +  // apps](https://developers.google.com/workspace/extend):
        +  message Section {
        +    // Text that appears at the top of a section.
        +    // Supports simple HTML formatted text. For more information
        +    // about formatting text, see
        +    // [Formatting text in Google Chat
        +    // apps](https://developers.google.com/workspace/chat/format-messages#card-formatting)
        +    // and
        +    // [Formatting
        +    // text in Google Workspace
        +    // add-ons](https://developers.google.com/apps-script/add-ons/concepts/widgets#text_formatting).
        +    string header = 1;
        +
        +    // All the widgets in the section.
        +    // Must contain at least one widget.
        +    repeated Widget widgets = 2;
        +
        +    // Indicates whether this section is collapsible.
        +    //
        +    // Collapsible sections hide some or all widgets, but users can expand the
        +    // section to reveal the hidden widgets by clicking **Show more**. Users
        +    // can hide the widgets again by clicking **Show less**.
        +    //
        +    // To determine which widgets are hidden, specify
        +    // `uncollapsibleWidgetsCount`.
        +    bool collapsible = 5;
        +
        +    // The number of uncollapsible widgets which remain visible even when a
        +    // section is collapsed.
        +    //
        +    // For example, when a section
        +    // contains five widgets and the `uncollapsibleWidgetsCount` is set to `2`,
        +    // the first two widgets are always shown and the last three are collapsed
        +    // by default. The `uncollapsibleWidgetsCount` is taken into account only
        +    // when `collapsible` is `true`.
        +    int32 uncollapsible_widgets_count = 6;
        +
        +    // Optional. Define the expand and collapse button of the section.
        +    // This button will be shown only if the section is collapsible.
        +    // If this field isn't set, the default button is used.
        +    CollapseControl collapse_control = 8;
        +  }
        +
        +  // The divider style of a card. Currently only used for dividers betweens card
        +  // sections.
        +  //
        +  // [Google Workspace add-ons and Chat
        +  // apps](https://developers.google.com/workspace/extend):
        +  enum DividerStyle {
        +    // Don't use. Unspecified.
        +    DIVIDER_STYLE_UNSPECIFIED = 0;
        +
        +    // Default option. Render a solid divider.
        +    SOLID_DIVIDER = 1;
        +
        +    // If set, no divider is rendered. This style completely removes the divider
        +    // from the layout. The result is equivalent to not adding a divider at all.
        +    NO_DIVIDER = 2;
        +  }
        +
        +  // A card action is the action associated with the card. For example,
        +  // an invoice card might include actions such as delete invoice, email
        +  // invoice, or open the invoice in a browser.
        +  //
        +  // [Google Workspace
        +  // add-ons](https://developers.google.com/workspace/add-ons):
        +  message CardAction {
        +    // The label that displays as the action menu item.
        +    string action_label = 1;
        +
        +    // The `onClick` action for this action item.
        +    OnClick on_click = 2;
        +  }
        +
        +  // A list of widgets that can be displayed in a containing layout, such
        +  // as a `CarouselCard`.
        +  // [Google Chat apps](https://developers.google.com/workspace/chat):
        +  message NestedWidget {
        +    oneof data {
        +      // A text paragraph widget.
        +      TextParagraph text_paragraph = 1;
        +
        +      // A button list widget.
        +      ButtonList button_list = 3;
        +
        +      // An image widget.
        +      Image image = 10;
        +    }
        +  }
        +
        +  // A persistent (sticky) footer that that appears at the bottom of the card.
        +  //
        +  // Setting `fixedFooter` without specifying a `primaryButton` or a
        +  // `secondaryButton` causes an error.
        +  //
        +  // For Chat apps, you can use fixed footers in
        +  // [dialogs](https://developers.google.com/workspace/chat/dialogs), but not
        +  // [card
        +  // messages](https://developers.google.com/workspace/chat/create-messages#create).
        +  // For an example in Google Chat apps, see [Add a persistent
        +  // footer](https://developers.google.com/workspace/chat/design-components-card-dialog#add_a_persistent_footer).
        +  //
        +  // [Google Workspace add-ons and Chat
        +  // apps](https://developers.google.com/workspace/extend):
        +  message CardFixedFooter {
        +    // The primary button of the fixed footer. The button must be a text button
        +    // with text and color set.
        +    Button primary_button = 1;
        +
        +    // The secondary button of the fixed footer.  The button must be a text
        +    // button with text and color set.
        +    // If `secondaryButton` is set, you must also set `primaryButton`.
        +    Button secondary_button = 2;
        +  }
        +
        +  // In Google Workspace add-ons,
        +  // determines how a card is displayed.
        +  //
        +  // [Google Workspace
        +  // add-ons](https://developers.google.com/workspace/add-ons):
        +  enum DisplayStyle {
        +    // Don't use. Unspecified.
        +    DISPLAY_STYLE_UNSPECIFIED = 0;
        +
        +    // The header of the card appears at the bottom of the
        +    // sidebar, partially covering the current top card of the stack. Clicking
        +    // the header pops the card into the card stack. If the card has no header,
        +    // a generated header is used instead.
        +    PEEK = 1;
        +
        +    // Default value. The card is shown by replacing the view of the top card in
        +    // the card stack.
        +    REPLACE = 2;
        +  }
        +
        +  // The header of the card. A header usually contains a leading image and a
        +  // title. Headers always appear at the top of a card.
        +  CardHeader header = 1;
        +
        +  // Contains a collection of widgets. Each section has its own, optional
        +  // header. Sections are visually separated by a line divider. For an example
        +  // in Google Chat apps, see [Define a section of a
        +  // card](https://developers.google.com/workspace/chat/design-components-card-dialog#define_a_section_of_a_card).
        +  repeated Section sections = 2;
        +
        +  // The divider style between the header, sections and footer.
        +  DividerStyle section_divider_style = 9;
        +
        +  // The card's actions. Actions are added to the card's toolbar menu.
        +  //
        +  // [Google Workspace
        +  // add-ons](https://developers.google.com/workspace/add-ons):
        +  //
        +  // For example, the following JSON constructs a card action menu with
        +  // `Settings` and `Send Feedback` options:
        +  //
        +  // ```
        +  // "card_actions": [
        +  //   {
        +  //     "actionLabel": "Settings",
        +  //     "onClick": {
        +  //       "action": {
        +  //         "functionName": "goToView",
        +  //         "parameters": [
        +  //           {
        +  //             "key": "viewType",
        +  //             "value": "SETTING"
        +  //          }
        +  //         ],
        +  //         "loadIndicator": "LoadIndicator.SPINNER"
        +  //       }
        +  //     }
        +  //   },
        +  //   {
        +  //     "actionLabel": "Send Feedback",
        +  //     "onClick": {
        +  //       "openLink": {
        +  //         "url": "https://example.com/feedback"
        +  //       }
        +  //     }
        +  //   }
        +  // ]
        +  // ```
        +  repeated CardAction card_actions = 3;
        +
        +  // Name of the card. Used as a card identifier in card navigation.
        +  //
        +  // [Google Workspace
        +  // add-ons](https://developers.google.com/workspace/add-ons):
        +  string name = 4;
        +
        +  // The fixed footer shown at the bottom of this card.
        +  //
        +  // Setting `fixedFooter` without specifying a `primaryButton` or a
        +  // `secondaryButton` causes an error. For Chat apps, you can use fixed footers
        +  // in
        +  // [dialogs](https://developers.google.com/workspace/chat/dialogs), but not
        +  // [card
        +  // messages](https://developers.google.com/workspace/chat/create-messages#create).
        +  //
        +  // [Google Workspace add-ons and Chat
        +  // apps](https://developers.google.com/workspace/extend):
        +  CardFixedFooter fixed_footer = 5;
        +
        +  // In Google Workspace add-ons, sets the display properties of the
        +  // `peekCardHeader`.
        +  //
        +  // [Google Workspace
        +  // add-ons](https://developers.google.com/workspace/add-ons):
        +  DisplayStyle display_style = 6;
        +
        +  // When displaying contextual content, the peek card header acts as a
        +  // placeholder so that the user can navigate forward between the homepage
        +  // cards and the contextual cards.
        +  //
        +  // [Google Workspace
        +  // add-ons](https://developers.google.com/workspace/add-ons):
        +  CardHeader peek_card_header = 7;
        +}
        +
        +// Each card is made up of widgets.
        +//
        +// A widget is a composite object that can represent one of text, images,
        +// buttons, and other object types.
        +message Widget {
        +  // The shape used to crop the image.
        +  //
        +  // [Google Workspace add-ons and Chat
        +  // apps](https://developers.google.com/workspace/extend):
        +  enum ImageType {
        +    // Default value. Applies a square mask to the image. For example, a 4x3
        +    // image becomes 3x3.
        +    SQUARE = 0;
        +
        +    // Applies a circular mask to the image. For example, a 4x3 image becomes a
        +    // circle with a diameter of 3.
        +    CIRCLE = 1;
        +  }
        +
        +  // Specifies whether widgets align to the left, right, or center of a column.
        +  //
        +  // [Google Chat apps](https://developers.google.com/workspace/chat):
        +  enum HorizontalAlignment {
        +    // Don't use. Unspecified.
        +    HORIZONTAL_ALIGNMENT_UNSPECIFIED = 0;
        +
        +    // Default value. Aligns widgets to the start position of the column. For
        +    // left-to-right layouts, aligns to the left. For right-to-left layouts,
        +    // aligns to the right.
        +    START = 1;
        +
        +    // Aligns widgets to the center of the column.
        +    CENTER = 2;
        +
        +    // Aligns widgets to the end position of the column. For left-to-right
        +    // layouts, aligns widgets to the right. For right-to-left layouts, aligns
        +    // widgets to the left.
        +    END = 3;
        +  }
        +
        +  // Represents vertical alignment attribute.
        +  enum VerticalAlignment {
        +    // Unspecified type. Do not use.
        +    VERTICAL_ALIGNMENT_UNSPECIFIED = 0;
        +
        +    // Alignment to the top position.
        +    TOP = 1;
        +
        +    // Alignment to the middle position.
        +    MIDDLE = 2;
        +
        +    // Alignment to the bottom position.
        +    BOTTOM = 3;
        +  }
        +
        +  // A widget can only have one of the following items. You can use multiple
        +  // widget fields to display more items.
        +  oneof data {
        +    // Displays a text paragraph. Supports simple HTML formatted text. For more
        +    // information about formatting text, see
        +    // [Formatting text in Google Chat
        +    // apps](https://developers.google.com/workspace/chat/format-messages#card-formatting)
        +    // and
        +    // [Formatting
        +    // text in Google Workspace
        +    // add-ons](https://developers.google.com/apps-script/add-ons/concepts/widgets#text_formatting).
        +    //
        +    // For example, the following JSON creates a bolded text:
        +    // ```
        +    // "textParagraph": {
        +    //   "text": "  bold text"
        +    // }
        +    // ```
        +    TextParagraph text_paragraph = 1;
        +
        +    // Displays an image.
        +    //
        +    // For example, the following JSON creates an image with alternative text:
        +    // ```
        +    // "image": {
        +    //   "imageUrl":
        +    //   "https://developers.google.com/workspace/chat/images/quickstart-app-avatar.png",
        +    //   "altText": "Chat app avatar"
        +    // }
        +    // ```
        +    Image image = 2;
        +
        +    // Displays a decorated text item.
        +    //
        +    // For example, the following JSON creates a decorated text widget showing
        +    // email address:
        +    //
        +    // ```
        +    // "decoratedText": {
        +    //   "icon": {
        +    //     "knownIcon": "EMAIL"
        +    //   },
        +    //   "topLabel": "Email Address",
        +    //   "text": "sasha@example.com",
        +    //   "bottomLabel": "This is a new Email address!",
        +    //   "switchControl": {
        +    //     "name": "has_send_welcome_email_to_sasha",
        +    //     "selected": false,
        +    //     "controlType": "CHECKBOX"
        +    //   }
        +    // }
        +    // ```
        +    DecoratedText decorated_text = 3;
        +
        +    // A list of buttons.
        +    //
        +    // For example, the following JSON creates two buttons. The first
        +    // is a blue text button and the second is an image button that opens a
        +    // link:
        +    // ```
        +    // "buttonList": {
        +    //   "buttons": [
        +    //     {
        +    //       "text": "Edit",
        +    //       "color": {
        +    //         "red": 0,
        +    //         "green": 0,
        +    //         "blue": 1,
        +    //       },
        +    //       "disabled": true,
        +    //     },
        +    //     {
        +    //       "icon": {
        +    //         "knownIcon": "INVITE",
        +    //         "altText": "check calendar"
        +    //       },
        +    //       "onClick": {
        +    //         "openLink": {
        +    //           "url": "https://example.com/calendar"
        +    //         }
        +    //       }
        +    //     }
        +    //   ]
        +    // }
        +    // ```
        +    ButtonList button_list = 4;
        +
        +    // Displays a text box that users can type into.
        +    //
        +    // For example, the following JSON creates a text input for an email
        +    // address:
        +    //
        +    // ```
        +    // "textInput": {
        +    //   "name": "mailing_address",
        +    //   "label": "Mailing Address"
        +    // }
        +    // ```
        +    //
        +    // As another example, the following JSON creates a text input for a
        +    // programming language with static suggestions:
        +    // ```
        +    // "textInput": {
        +    //   "name": "preferred_programing_language",
        +    //   "label": "Preferred Language",
        +    //   "initialSuggestions": {
        +    //     "items": [
        +    //       {
        +    //         "text": "C++"
        +    //       },
        +    //       {
        +    //         "text": "Java"
        +    //       },
        +    //       {
        +    //         "text": "JavaScript"
        +    //       },
        +    //       {
        +    //         "text": "Python"
        +    //       }
        +    //     ]
        +    //   }
        +    // }
        +    // ```
        +    TextInput text_input = 5;
        +
        +    // Displays a selection control that lets users select items. Selection
        +    // controls can be checkboxes, radio buttons, switches, or dropdown menus.
        +    //
        +    // For example, the following JSON creates a dropdown menu that lets users
        +    // choose a size:
        +    //
        +    // ```
        +    // "selectionInput": {
        +    //   "name": "size",
        +    //   "label": "Size"
        +    //   "type": "DROPDOWN",
        +    //   "items": [
        +    //     {
        +    //       "text": "S",
        +    //       "value": "small",
        +    //       "selected": false
        +    //     },
        +    //     {
        +    //       "text": "M",
        +    //       "value": "medium",
        +    //       "selected": true
        +    //     },
        +    //     {
        +    //       "text": "L",
        +    //       "value": "large",
        +    //       "selected": false
        +    //     },
        +    //     {
        +    //       "text": "XL",
        +    //       "value": "extra_large",
        +    //       "selected": false
        +    //     }
        +    //   ]
        +    // }
        +    // ```
        +    SelectionInput selection_input = 6;
        +
        +    // Displays a widget that lets users input a date, time, or date and time.
        +    //
        +    // For example, the following JSON creates a date time picker to schedule an
        +    // appointment:
        +    //
        +    //
        +    // ```
        +    // "dateTimePicker": {
        +    //   "name": "appointment_time",
        +    //   "label": "Book your appointment at:",
        +    //   "type": "DATE_AND_TIME",
        +    //   "valueMsEpoch": 796435200000
        +    // }
        +    // ```
        +    DateTimePicker date_time_picker = 7;
        +
        +    // Displays a horizontal line divider between widgets.
        +    //
        +    // For example, the following JSON creates a divider:
        +    // ```
        +    // "divider": {
        +    // }
        +    // ```
        +    Divider divider = 9;
        +
        +    // Displays a grid with a collection of items.
        +    //
        +    // A grid supports any number of columns and items. The number of rows is
        +    // determined by the upper bounds of the number items divided by the number
        +    // of columns. A grid with 10 items and 2 columns has 5 rows. A grid with 11
        +    // items and 2 columns has 6 rows.
        +    //
        +    // [Google Workspace add-ons and
        +    // Chat apps](https://developers.google.com/workspace/extend):
        +    //
        +    // For example, the following JSON creates a 2 column grid with a single
        +    // item:
        +    //
        +    // ```
        +    // "grid": {
        +    //   "title": "A fine collection of items",
        +    //   "columnCount": 2,
        +    //   "borderStyle": {
        +    //     "type": "STROKE",
        +    //     "cornerRadius": 4
        +    //   },
        +    //   "items": [
        +    //     {
        +    //       "image": {
        +    //         "imageUri": "https://www.example.com/image.png",
        +    //         "cropStyle": {
        +    //           "type": "SQUARE"
        +    //         },
        +    //         "borderStyle": {
        +    //           "type": "STROKE"
        +    //         }
        +    //       },
        +    //       "title": "An item",
        +    //       "textAlignment": "CENTER"
        +    //     }
        +    //   ],
        +    //   "onClick": {
        +    //     "openLink": {
        +    //       "url": "https://www.example.com"
        +    //     }
        +    //   }
        +    // }
        +    // ```
        +    Grid grid = 10;
        +
        +    // Displays up to 2 columns.
        +    //
        +    // To include more than 2 columns, or to use rows, use the `Grid` widget.
        +    //
        +    // For example, the following JSON creates 2 columns that each contain
        +    // text paragraphs:
        +    //
        +    // ```
        +    // "columns": {
        +    //   "columnItems": [
        +    //     {
        +    //       "horizontalSizeStyle": "FILL_AVAILABLE_SPACE",
        +    //       "horizontalAlignment": "CENTER",
        +    //       "verticalAlignment": "CENTER",
        +    //       "widgets": [
        +    //         {
        +    //           "textParagraph": {
        +    //             "text": "First column text paragraph"
        +    //           }
        +    //         }
        +    //       ]
        +    //     },
        +    //     {
        +    //       "horizontalSizeStyle": "FILL_AVAILABLE_SPACE",
        +    //       "horizontalAlignment": "CENTER",
        +    //       "verticalAlignment": "CENTER",
        +    //       "widgets": [
        +    //         {
        +    //           "textParagraph": {
        +    //             "text": "Second column text paragraph"
        +    //           }
        +    //         }
        +    //       ]
        +    //     }
        +    //   ]
        +    // }
        +    // ```
        +    Columns columns = 11;
        +
        +    // A carousel contains a collection of nested widgets.
        +    // For example, this is a JSON representation of a carousel that contains
        +    // two text paragraphs.
        +    //
        +    // ```
        +    // {
        +    //   "widgets": [
        +    //     {
        +    //       "textParagraph": {
        +    //         "text": "First text paragraph in the carousel."
        +    //       }
        +    //     },
        +    //     {
        +    //       "textParagraph": {
        +    //         "text": "Second text paragraph in the carousel."
        +    //       }
        +    //     }
        +    //   ]
        +    // }
        +    // ```
        +    Carousel carousel = 13;
        +
        +    // A list of chips.
        +    //
        +    // For example, the following JSON creates two chips. The first
        +    // is a text chip and the second is an icon chip that opens a
        +    // link:
        +    // ```
        +    // "chipList": {
        +    //   "chips": [
        +    //     {
        +    //       "text": "Edit",
        +    //       "disabled": true,
        +    //     },
        +    //     {
        +    //       "icon": {
        +    //         "knownIcon": "INVITE",
        +    //         "altText": "check calendar"
        +    //       },
        +    //       "onClick": {
        +    //         "openLink": {
        +    //           "url": "https://example.com/calendar"
        +    //         }
        +    //       }
        +    //     }
        +    //   ]
        +    // }
        +    // ```
        +    ChipList chip_list = 14;
        +  }
        +
        +  // Specifies whether widgets align to the left, right, or center of a column.
        +  HorizontalAlignment horizontal_alignment = 8;
        +}
        +
        +// A paragraph of text that supports formatting. For an example in
        +// Google Chat apps, see [Add a paragraph of formatted
        +// text](https://developers.google.com/workspace/chat/add-text-image-card-dialog#add_a_paragraph_of_formatted_text).
        +// For more information
        +// about formatting text, see
        +// [Formatting text in Google Chat
        +// apps](https://developers.google.com/workspace/chat/format-messages#card-formatting)
        +// and
        +// [Formatting
        +// text in Google Workspace
        +// add-ons](https://developers.google.com/apps-script/add-ons/concepts/widgets#text_formatting).
        +//
        +// [Google Workspace add-ons and
        +// Chat apps](https://developers.google.com/workspace/extend):
        +message TextParagraph {
        +  // Syntax to use for formatting text.
        +  //
        +  // [Google Chat apps](https://developers.google.com/workspace/chat):
        +  enum TextSyntax {
        +    // The text is rendered as HTML if unspecified.
        +    TEXT_SYNTAX_UNSPECIFIED = 0;
        +
        +    // The text is rendered as HTML. This is the default value.
        +    HTML = 1;
        +
        +    // The text is rendered as Markdown.
        +    MARKDOWN = 2;
        +  }
        +
        +  // The text that's shown in the widget.
        +  string text = 1;
        +
        +  // The maximum number of lines of text that are displayed in the widget. If
        +  // the text exceeds the specified maximum number of lines, the excess
        +  // content is concealed behind a **show more** button. If the text is equal or
        +  // shorter than the specified maximum number of lines, a **show more** button
        +  // isn't displayed.
        +  //
        +  // The default value is 0, in which case
        +  // all context is displayed. Negative values are ignored.
        +  int32 max_lines = 2;
        +
        +  // The syntax of the text. If not set, the text is rendered as HTML.
        +  //
        +  // [Google Chat apps](https://developers.google.com/workspace/chat):
        +  TextSyntax text_syntax = 4;
        +}
        +
        +// An image that is specified by a URL and can have an `onClick` action. For an
        +// example, see [Add an
        +// image](https://developers.google.com/workspace/chat/add-text-image-card-dialog#add_an_image).
        +//
        +// [Google Workspace add-ons and Chat
        +// apps](https://developers.google.com/workspace/extend):
        +message Image {
        +  // The HTTPS URL that hosts the image.
        +  //
        +  // For example:
        +  //
        +  // ```
        +  // https://developers.google.com/workspace/chat/images/quickstart-app-avatar.png
        +  // ```
        +  string image_url = 1;
        +
        +  // When a user clicks the image, the click triggers this action.
        +  OnClick on_click = 2;
        +
        +  // The alternative text of this image that's used for accessibility.
        +  string alt_text = 3;
        +}
        +
        +// Displays a divider between widgets as a horizontal line. For an example in
        +// Google Chat apps, see
        +// [Add a horizontal divider between
        +// widgets](https://developers.google.com/workspace/chat/format-structure-card-dialog#add_a_horizontal_divider_between_widgets).
        +//
        +// [Google Workspace add-ons and Chat
        +// apps](https://developers.google.com/workspace/extend):
        +//
        +// For example, the following JSON creates a divider:
        +//
        +// ```
        +// "divider": {}
        +// ```
        +message Divider {}
        +
        +// A widget that displays text with optional decorations such as a label above
        +// or below the text, an icon in front of the text, a selection widget, or a
        +// button after the text. For an example in
        +// Google Chat apps, see [Display text with decorative
        +// text](https://developers.google.com/workspace/chat/add-text-image-card-dialog#display_text_with_decorative_elements).
        +//
        +// [Google Workspace add-ons and Chat
        +// apps](https://developers.google.com/workspace/extend):
        +message DecoratedText {
        +  // Either a toggle-style switch or a checkbox inside a `decoratedText` widget.
        +  //
        +  // [Google Workspace add-ons and Chat
        +  // apps](https://developers.google.com/workspace/extend):
        +  //
        +  // Only supported in the `decoratedText` widget.
        +  message SwitchControl {
        +    // How the switch appears in the user interface.
        +    //
        +    // [Google Workspace add-ons
        +    // and Chat apps](https://developers.google.com/workspace/extend):
        +    enum ControlType {
        +      // A toggle-style switch.
        +      SWITCH = 0;
        +
        +      // Deprecated in favor of `CHECK_BOX`.
        +      CHECKBOX = 1;
        +
        +      // A checkbox.
        +      CHECK_BOX = 2;
        +    }
        +
        +    // The name by which the switch widget is identified in a form input event.
        +    //
        +    // For details about working with form inputs, see [Receive form
        +    // data](https://developers.google.com/workspace/chat/read-form-data).
        +    string name = 1;
        +
        +    // The value entered by a user, returned as part of a form input event.
        +    //
        +    // For details about working with form inputs, see [Receive form
        +    // data](https://developers.google.com/workspace/chat/read-form-data).
        +    string value = 2;
        +
        +    // When `true`, the switch is selected.
        +    bool selected = 3;
        +
        +    // The action to perform when the switch state is changed, such as what
        +    //  function to run.
        +    Action on_change_action = 4;
        +
        +    // How the switch appears in the user interface.
        +    //
        +    // [Google Workspace add-ons
        +    // and Chat apps](https://developers.google.com/workspace/extend):
        +    ControlType control_type = 5;
        +  }
        +
        +  // Deprecated in favor of `startIcon`.
        +  Icon icon = 1 [deprecated = true];
        +
        +  // The icon displayed in front of the text.
        +  Icon start_icon = 12;
        +
        +  // Optional. Vertical alignment of the start icon. If not set, the icon
        +  // will be vertically centered.
        +  //
        +  // [Google Chat apps](https://developers.google.com/workspace/chat):
        +  Widget.VerticalAlignment start_icon_vertical_alignment = 13;
        +
        +  // The text that appears above `text`. Always truncates.
        +  string top_label = 3;
        +
        +  // `TextParagraph` equivalent of `top_label`. Always truncates. Allows for
        +  // more complex formatting than `top_label`.
        +  //
        +  // [Google Chat apps](https://developers.google.com/workspace/chat):
        +  TextParagraph top_label_text = 17;
        +
        +  // Required. The primary text.
        +  //
        +  // Supports simple formatting. For more information
        +  // about formatting text, see
        +  // [Formatting text in Google Chat
        +  // apps](https://developers.google.com/workspace/chat/format-messages#card-formatting)
        +  // and
        +  // [Formatting
        +  // text in Google Workspace
        +  // add-ons](https://developers.google.com/apps-script/add-ons/concepts/widgets#text_formatting).
        +  string text = 4;
        +
        +  // `TextParagraph` equivalent of `text`. Allows for more complex formatting
        +  // than `text`.
        +  //
        +  // [Google Chat apps](https://developers.google.com/workspace/chat):
        +  TextParagraph content_text = 18;
        +
        +  // The wrap text setting. If `true`, the text wraps and displays on
        +  // multiple lines. Otherwise, the text is truncated.
        +  //
        +  // Only applies to `text`, not `topLabel` and `bottomLabel`.
        +  bool wrap_text = 5;
        +
        +  // The text that appears below `text`. Always wraps.
        +  string bottom_label = 6;
        +
        +  // `TextParagraph` equivalent of `bottom_label`. Always wraps. Allows for
        +  // more complex formatting than `bottom_label`.
        +  //
        +  // [Google Chat apps](https://developers.google.com/workspace/chat):
        +  TextParagraph bottom_label_text = 19;
        +
        +  // This action is triggered when users click `topLabel` or `bottomLabel`.
        +  OnClick on_click = 7;
        +
        +  // A button, switch, checkbox, or image that appears to the right-hand side
        +  // of text in the `decoratedText` widget.
        +  oneof control {
        +    // A button that a user can click to trigger an action.
        +    Button button = 8;
        +
        +    // A switch widget that a user can click to change its state and trigger an
        +    // action.
        +    SwitchControl switch_control = 9;
        +
        +    // An icon displayed after the text.
        +    //
        +    // Supports
        +    // [built-in](https://developers.google.com/workspace/chat/format-messages#builtinicons)
        +    // and
        +    // [custom](https://developers.google.com/workspace/chat/format-messages#customicons)
        +    // icons.
        +    Icon end_icon = 11;
        +  }
        +}
        +
        +// A field in which users can enter text. Supports suggestions and on-change
        +// actions.
        +// Supports form submission validation. When `Action.all_widgets_are_required`
        +// is set to `true` or this widget is specified in `Action.required_widgets`,
        +// the submission action is blocked unless a value is entered. For an example in
        +// Google Chat apps, see [Add a field in which a user can enter
        +// text](https://developers.google.com/workspace/chat/design-interactive-card-dialog#add_a_field_in_which_a_user_can_enter_text).
        +//
        +// Chat apps receive and can process the value of entered text during form input
        +// events. For details about working with form inputs, see [Receive form
        +// data](https://developers.google.com/workspace/chat/read-form-data).
        +//
        +// When you need to collect undefined or abstract data from users,
        +// use a text input. To collect defined or enumerated data from users, use the
        +// [SelectionInput][google.apps.card.v1.SelectionInput] widget.
        +//
        +// [Google Workspace add-ons and Chat
        +// apps](https://developers.google.com/workspace/extend):
        +message TextInput {
        +  // How a text input field appears in the user interface. For example,
        +  // whether it's a single line input field, or a multi-line input. If
        +  // `initialSuggestions` is specified, `type` is always `SINGLE_LINE`,
        +  // even if it's set to `MULTIPLE_LINE`.
        +  //
        +  // [Google Workspace add-ons and Chat
        +  // apps](https://developers.google.com/workspace/extend):
        +  enum Type {
        +    // The text input field has a fixed height of one line.
        +    SINGLE_LINE = 0;
        +
        +    // The text input field has a fixed height of multiple lines.
        +    MULTIPLE_LINE = 1;
        +  }
        +
        +  // The name by which the text input is identified in a form input event.
        +  //
        +  // For details about working with form inputs, see [Receive form
        +  // data](https://developers.google.com/workspace/chat/read-form-data).
        +  string name = 1;
        +
        +  // The text that appears above the text input field in the user interface.
        +  //
        +  // Specify text that helps the user enter the information your app needs.
        +  // For example, if you are asking someone's name, but specifically need their
        +  // surname, write `surname` instead of `name`.
        +  //
        +  // Required if `hintText` is unspecified. Otherwise, optional.
        +  string label = 2;
        +
        +  // Text that appears below the text input field meant to assist users by
        +  // prompting them to enter a certain value. This text is always visible.
        +  //
        +  // Required if `label` is unspecified. Otherwise, optional.
        +  string hint_text = 3;
        +
        +  // The value entered by a user, returned as part of a form input event.
        +  //
        +  // For details about working with form inputs, see [Receive form
        +  // data](https://developers.google.com/workspace/chat/read-form-data).
        +  string value = 4;
        +
        +  // How a text input field appears in the user interface.
        +  // For example, whether the field is single or multi-line.
        +  Type type = 5;
        +
        +  // What to do when a change occurs in the text input field. For example, a
        +  // user adding to the field or deleting text.
        +  //
        +  // Examples of actions to take include running a custom function or opening
        +  // a [dialog](https://developers.google.com/workspace/chat/dialogs)
        +  // in Google Chat.
        +  Action on_change_action = 6;
        +
        +  // Suggested values that users can enter. These values appear when users click
        +  // inside the text input field. As users type, the suggested values
        +  // dynamically filter to match what the users have typed.
        +  //
        +  // For example, a text input field for programming language might suggest
        +  // Java, JavaScript, Python, and C++. When users start typing `Jav`, the list
        +  // of suggestions filters to show just `Java` and `JavaScript`.
        +  //
        +  // Suggested values help guide users to enter values that your app can make
        +  // sense of. When referring to JavaScript, some users might enter `javascript`
        +  // and others `java script`. Suggesting `JavaScript` can standardize how users
        +  // interact with your app.
        +  //
        +  // When specified, `TextInput.type` is always `SINGLE_LINE`, even if it's set
        +  // to `MULTIPLE_LINE`.
        +  //
        +  // [Google Workspace
        +  // add-ons and Chat apps](https://developers.google.com/workspace/extend):
        +  Suggestions initial_suggestions = 7;
        +
        +  // Optional. Specify what action to take when the text input field provides
        +  // suggestions to users who interact with it.
        +  //
        +  // If unspecified, the suggestions are set by `initialSuggestions` and
        +  // are processed by the client.
        +  //
        +  // If specified, the app takes the action specified here, such as running
        +  // a custom function.
        +  //
        +  // [Google Workspace
        +  // add-ons](https://developers.google.com/workspace/add-ons):
        +  Action auto_complete_action = 8;
        +
        +  // Specify the input format validation necessary for this text field.
        +  //
        +  // [Google Workspace add-ons and Chat
        +  // apps](https://developers.google.com/workspace/extend):
        +  Validation validation = 11;
        +
        +  // Text that appears in the text input field when the field is empty.
        +  // Use this text to prompt users to enter a value. For example, `Enter a
        +  // number from 0 to 100`.
        +  //
        +  // [Google Chat apps](https://developers.google.com/workspace/chat):
        +  string placeholder_text = 12;
        +}
        +
        +// Suggested values that users can enter. These values appear when users click
        +// inside the text input field. As users type, the suggested values
        +// dynamically filter to match what the users have typed.
        +//
        +// For example, a text input field for programming language might suggest
        +// Java, JavaScript, Python, and C++. When users start typing `Jav`, the list
        +// of suggestions filters to show `Java` and `JavaScript`.
        +//
        +// Suggested values help guide users to enter values that your app can make
        +// sense of. When referring to JavaScript, some users might enter `javascript`
        +// and others `java script`. Suggesting `JavaScript` can standardize how users
        +// interact with your app.
        +//
        +// When specified, `TextInput.type` is always `SINGLE_LINE`, even if it's set
        +// to `MULTIPLE_LINE`.
        +//
        +// [Google Workspace
        +// add-ons and Chat apps](https://developers.google.com/workspace/extend):
        +message Suggestions {
        +  // One suggested value that users can enter in a text input field.
        +  //
        +  // [Google Workspace add-ons and Chat
        +  // apps](https://developers.google.com/workspace/extend):
        +  message SuggestionItem {
        +    oneof content {
        +      // The value of a suggested input to a text input field. This is
        +      // equivalent to what users enter themselves.
        +      string text = 1;
        +    }
        +  }
        +
        +  // A list of suggestions used for autocomplete recommendations in text input
        +  // fields.
        +  repeated SuggestionItem items = 1;
        +}
        +
        +// A list of buttons layed out horizontally. For an example in
        +// Google Chat apps, see
        +// [Add a
        +// button](https://developers.google.com/workspace/chat/design-interactive-card-dialog#add_a_button).
        +//
        +// [Google Workspace add-ons and Chat
        +// apps](https://developers.google.com/workspace/extend):
        +message ButtonList {
        +  // An array of buttons.
        +  repeated Button buttons = 1;
        +}
        +
        +// A widget that creates one or more UI items that users can select.
        +// Supports form submission validation for `dropdown` and `multiselect` menus
        +// only. When `Action.all_widgets_are_required` is set to `true` or this widget
        +// is specified in `Action.required_widgets`, the submission action is blocked
        +// unless a value is selected. For example, a dropdown menu or checkboxes. You
        +// can use this widget to collect data that can be predicted or enumerated. For
        +// an example in Google Chat apps, see [Add selectable UI
        +// elements](/workspace/chat/design-interactive-card-dialog#add_selectable_ui_elements).
        +//
        +// Chat apps can process the value of items that users select or input. For
        +// details about working with form inputs, see [Receive form
        +// data](https://developers.google.com/workspace/chat/read-form-data).
        +//
        +// To collect undefined or abstract data from users, use
        +// the [TextInput][google.apps.card.v1.TextInput] widget.
        +//
        +// [Google Workspace add-ons
        +// and Chat apps](https://developers.google.com/workspace/extend):
        +message SelectionInput {
        +  // The format for the items that users can select. Different options support
        +  // different types of interactions. For example, users can select multiple
        +  // checkboxes, but can only select one item from a dropdown menu.
        +  //
        +  // Each selection input supports one type of selection. Mixing checkboxes
        +  // and switches, for example, isn't supported.
        +  //
        +  // [Google Workspace add-ons and Chat
        +  // apps](https://developers.google.com/workspace/extend):
        +  enum SelectionType {
        +    // A set of checkboxes. Users can select one or more checkboxes.
        +    CHECK_BOX = 0;
        +
        +    // A set of radio buttons. Users can select one radio button.
        +    RADIO_BUTTON = 1;
        +
        +    // A set of switches. Users can turn on one or more switches.
        +    SWITCH = 2;
        +
        +    // A dropdown menu. Users can select one item from the menu.
        +    //
        +    // For Google Chat apps, you can populate items using a dynamic data source
        +    // and autosuggest items as users type in the menu. For example, users can
        +    // start typing the name of a Google Chat space and the widget autosuggests
        +    // the space. To dynamically populate items for a dropdown menu, use one of
        +    // the following types of data sources:
        +    //
        +    //  * Google Workspace data: Items are populated using data from Google
        +    //    Workspace, such as Google Workspace users or Google Chat spaces.
        +    //  * External data: Items are populated from an external data
        +    //    source outside of Google Workspace.
        +    //
        +    // For examples of how to implement dropdown menus for Chat apps, see
        +    // [Add a dropdown
        +    // menu](https://developers.google.com/workspace/chat/design-interactive-card-dialog#dropdown-menu)
        +    // and [Dynamically populate drop-down
        +    // menus](https://developers.google.com/workspace/chat/design-interactive-card-dialog#dynamic-dropdown-menu).
        +    //
        +    // [Google Workspace add-ons and Chat
        +    // apps](https://developers.google.com/workspace/extend):
        +    DROPDOWN = 3;
        +
        +    // A menu with a text box. Users can type and select one or more items.
        +    // For Google Workspace add-ons, you must populate items using a static
        +    // array of `SelectionItem` objects.
        +    //
        +    // For Google Chat apps, you can also populate items using a dynamic data
        +    // source and autosuggest items as users type in the menu. For example,
        +    // users can start typing the name of a Google Chat space and the widget
        +    // autosuggests the space. To dynamically populate items for a multiselect
        +    // menu, use one of the following types of data sources:
        +    //
        +    //  * Google Workspace data: Items are populated using data from Google
        +    //    Workspace, such as Google Workspace users or Google Chat spaces.
        +    //  * External data: Items are populated from an external data
        +    //    source outside of Google Workspace.
        +    //
        +    // For examples of how to implement multiselect menus for Chat apps, see
        +    // [Add a multiselect
        +    // menu](https://developers.google.com/workspace/chat/design-interactive-card-dialog#multiselect-menu).
        +    //
        +    // [Google Workspace add-ons and Chat
        +    // apps](https://developers.google.com/workspace/extend):
        +    MULTI_SELECT = 4;
        +  }
        +
        +  // An item that users can select in a selection input, such as a checkbox
        +  // or switch. Supports up to 100 items.
        +  //
        +  // [Google Workspace add-ons and Chat
        +  // apps](https://developers.google.com/workspace/extend):
        +  message SelectionItem {
        +    // The text that identifies or describes the item to users.
        +    string text = 1;
        +
        +    // The value associated with this item. The client should use this as a form
        +    // input value.
        +    //
        +    // For details about working with form inputs, see [Receive form
        +    // data](https://developers.google.com/workspace/chat/read-form-data).
        +    string value = 2;
        +
        +    // Whether the item is selected by default. If the selection input only
        +    // accepts one value (such as for radio buttons or a dropdown menu), only
        +    // set this field for one item.
        +    bool selected = 3;
        +
        +    // For multiselect menus, the URL for the icon displayed next to
        +    // the item's `text` field. Supports PNG and JPEG files. Must be an `HTTPS`
        +    // URL. For example,
        +    // `https://developers.google.com/workspace/chat/images/quickstart-app-avatar.png`.
        +    oneof start_icon {
        +      string start_icon_uri = 4;
        +    }
        +
        +    // For multiselect menus, a text description or label that's
        +    // displayed below the item's `text` field.
        +    string bottom_text = 5;
        +  }
        +
        +  // For a
        +  // [`SelectionInput`][google.apps.card.v1.SelectionInput] widget that uses a
        +  // multiselect menu, a data source from Google Workspace. Used to populate
        +  // items in a multiselect menu.
        +  //
        +  // [Google Chat apps](https://developers.google.com/workspace/chat):
        +  message PlatformDataSource {
        +    // A data source shared by all [Google Workspace
        +    // applications]
        +    // (https://developers.google.com/workspace/chat/api/reference/rest/v1/HostApp).
        +    //
        +    // [Google Chat apps](https://developers.google.com/workspace/chat):
        +    enum CommonDataSource {
        +      // Default value. Don't use.
        +      UNKNOWN = 0;
        +
        +      // Google Workspace users. The user can only view and select users from
        +      // their Google Workspace organization.
        +      USER = 1;
        +    }
        +
        +    // The data source.
        +    oneof data_source {
        +      // A data source shared by all Google Workspace applications, such as
        +      // users in a Google Workspace organization.
        +      CommonDataSource common_data_source = 1;
        +    }
        +  }
        +
        +  // Required. The name that identifies the selection input in a form input
        +  // event.
        +  //
        +  // For details about working with form inputs, see [Receive form
        +  // data](https://developers.google.com/workspace/chat/read-form-data).
        +  string name = 1;
        +
        +  // The text that appears above the selection input field in the user
        +  // interface.
        +  //
        +  // Specify text that helps the user enter the information your app needs.
        +  // For example, if users are selecting the urgency of a work ticket from a
        +  // drop-down menu, the label might be "Urgency" or "Select urgency".
        +  string label = 2;
        +
        +  // The type of items that are displayed to users in a `SelectionInput` widget.
        +  // Selection types support different types of interactions. For example, users
        +  // can select one or more checkboxes, but they can only select one value from
        +  // a dropdown menu.
        +  SelectionType type = 3;
        +
        +  // An array of selectable items. For example, an array of radio buttons or
        +  // checkboxes. Supports up to 100 items.
        +  repeated SelectionItem items = 4;
        +
        +  // If specified, the form is submitted when the selection changes. If not
        +  // specified, you must specify a separate button that submits the form.
        +  //
        +  // For details about working with form inputs, see [Receive form
        +  // data](https://developers.google.com/workspace/chat/read-form-data).
        +  Action on_change_action = 5;
        +
        +  // For multiselect menus, the maximum number of items that a user can select.
        +  // Minimum value is 1 item. If unspecified, defaults to 3 items.
        +  optional int32 multi_select_max_selected_items = 6;
        +
        +  // For multiselect menus, the number of text characters that a user inputs
        +  // before the menu returns suggested selection items.
        +  //
        +  // If unset, the multiselect menu uses the following default values:
        +  //
        +  // * If the menu uses a static array of `SelectionInput` items, defaults to
        +  //   0 characters and immediately populates items from the array.
        +  // * If the menu uses a dynamic data source (`multi_select_data_source`),
        +  //  defaults to 3 characters before querying the data source to return
        +  //  suggested items.
        +  int32 multi_select_min_query_length = 7;
        +
        +  // For a multiselect menu, a data source that dynamically populates
        +  // selection items.
        +  //
        +  // [Google Chat apps](https://developers.google.com/workspace/chat):
        +  oneof multi_select_data_source {
        +    // An external data source, such as a relational database.
        +    Action external_data_source = 8;
        +
        +    // A data source from Google Workspace.
        +    PlatformDataSource platform_data_source = 9;
        +  }
        +}
        +
        +// Lets users input a date, a time, or both a date and a time.
        +// Supports form submission validation. When `Action.all_widgets_are_required`
        +// is set to `true` or this widget is specified in `Action.required_widgets`,
        +// the submission action is blocked unless a value is selected. For an example
        +// in Google Chat apps, see [Let a user pick a date and
        +// time](https://developers.google.com/workspace/chat/design-interactive-card-dialog#let_a_user_pick_a_date_and_time).
        +//
        +// Users can input text or use the picker to select dates and times. If users
        +// input an invalid date or time, the picker shows an error that prompts users
        +// to input the information correctly.
        +//
        +// [Google Workspace
        +// add-ons and Chat apps](https://developers.google.com/workspace/extend):
        +message DateTimePicker {
        +  // The format for the date and time in the `DateTimePicker` widget.
        +  // Determines whether users can input a date, a time, or both a date and time.
        +  //
        +  // [Google Workspace add-ons and Chat
        +  // apps](https://developers.google.com/workspace/extend):
        +  enum DateTimePickerType {
        +    // Users input a date and time.
        +    DATE_AND_TIME = 0;
        +
        +    // Users input a date.
        +    DATE_ONLY = 1;
        +
        +    // Users input a time.
        +    TIME_ONLY = 2;
        +  }
        +
        +  // The name by which the `DateTimePicker` is identified in a form input event.
        +  //
        +  // For details about working with form inputs, see [Receive form
        +  // data](https://developers.google.com/workspace/chat/read-form-data).
        +  string name = 1;
        +
        +  // The text that prompts users to input a date, a time, or a date and time.
        +  // For example, if users are scheduling an appointment, use a label such as
        +  // `Appointment date` or `Appointment date and time`.
        +  string label = 2;
        +
        +  // Whether the widget supports inputting a date, a time, or the date and time.
        +  DateTimePickerType type = 3;
        +
        +  // Optional. The default value displayed in the widget, in milliseconds since
        +  // [Unix epoch time](https://en.wikipedia.org/wiki/Unix_time).
        +  //
        +  // Specify the value based on the type of picker (`DateTimePickerType`):
        +  //
        +  // * `DATE_AND_TIME`: a calendar date and time in UTC. For example, to
        +  //   represent January 1, 2023 at 12:00 PM UTC, use `1672574400000`.
        +  // * `DATE_ONLY`: a calendar date at 00:00:00 UTC. For example, to represent
        +  //   January 1, 2023, use `1672531200000`.
        +  // * `TIME_ONLY`: a time in UTC. For example, to represent 12:00 PM, use
        +  //   `43200000` (or `12 * 60 * 60 * 1000`).
        +  optional int64 value_ms_epoch = 4;
        +
        +  // The number representing the time zone offset from UTC, in minutes.
        +  // If set, the `value_ms_epoch` is displayed in the specified time zone.
        +  // If unset, the value defaults to the user's time zone setting.
        +  int32 timezone_offset_date = 5;
        +
        +  // Triggered when the user clicks **Save** or **Clear** from the
        +  // `DateTimePicker` interface.
        +  Action on_change_action = 6;
        +}
        +
        +// A widget that presents a pop-up menu with one or more actions that users can
        +// invoke. For example, showing non-primary actions in a card. You can use this
        +// widget when actions don't fit in the available space. To use, specify this
        +// widget in the `OnClick` action of widgets that support it. For example, in a
        +// `Button`.
        +//
        +// [Google Workspace add-ons and Chat
        +// apps](https://developers.google.com/workspace/extend):
        +message OverflowMenu {
        +  // An option that users can invoke in an overflow menu.
        +  //
        +  // [Google Workspace add-ons and Chat
        +  // apps](https://developers.google.com/workspace/extend):
        +  message OverflowMenuItem {
        +    // The icon displayed in front of the text.
        +    Icon start_icon = 1;
        +
        +    // Required. The text that identifies or describes the item to users.
        +    string text = 2;
        +
        +    // Required. The action invoked when a menu option is selected.
        +    // This `OnClick` cannot contain an `OverflowMenu`, any specified
        +    // `OverflowMenu` is dropped and the menu item disabled.
        +    OnClick on_click = 3;
        +
        +    // Whether the menu option is disabled.
        +    // Defaults to false.
        +    bool disabled = 4;
        +  }
        +
        +  // Required. The list of menu options.
        +  repeated OverflowMenuItem items = 1;
        +}
        +
        +// A text, icon, or text and icon button that users can click. For an example in
        +// Google Chat apps, see
        +// [Add a
        +// button](https://developers.google.com/workspace/chat/design-interactive-card-dialog#add_a_button).
        +//
        +// To make an image a clickable button, specify an
        +// [`Image`][google.apps.card.v1.Image] (not an
        +// [`ImageComponent`][google.apps.card.v1.ImageComponent]) and set an
        +// `onClick` action.
        +//
        +// [Google Workspace
        +// add-ons and Chat apps](https://developers.google.com/workspace/extend):
        +message Button {
        +  // Optional. The
        +  // [type](https://m3.material.io/components/all-buttons#9134ac95-678e-49ae-a50a-e71948011b05)
        +  // of a button. If `color` field is set, the `type` is forced to `FILLED`.
        +  //
        +  // [Google Chat apps](https://developers.google.com/workspace/chat):
        +  enum Type {
        +    // Don't use. Unspecified.
        +    TYPE_UNSPECIFIED = 0;
        +
        +    // Outlined buttons are medium-emphasis buttons. They usually contain
        +    // actions that are important, but aren’t the primary action in a Chat app
        +    // or an add-on.
        +    OUTLINED = 1;
        +
        +    // A filled button has a container with a solid color. It has the most
        +    // visual impact and is recommended for the important and primary action in
        +    // a Chat app or an add-on.
        +    FILLED = 2;
        +
        +    // A filled tonal button is an alternative middle ground between filled and
        +    // outlined buttons. They’re useful in contexts where a lower-priority
        +    // button requires slightly more emphasis than an outline button would give.
        +    FILLED_TONAL = 3;
        +
        +    // A button does not have an invisible container in its default state. It is
        +    // often used for the lowest priority actions, especially when presenting
        +    // multiple options.
        +    BORDERLESS = 4;
        +  }
        +
        +  // The text displayed inside the button.
        +  string text = 1;
        +
        +  // An icon displayed inside the button. If both `icon` and `text` are set,
        +  // then the icon appears before the text.
        +  Icon icon = 2;
        +
        +  // Optional. The color of the button. If set, the button `type` is set to
        +  // `FILLED` and the color of `text` and `icon` fields are set to a
        +  // contrasting color for readability. For example, if the button color is
        +  // set to blue, any text or icons in the button are set to white.
        +  //
        +  // To set the button color, specify a value for the `red`, `green`, and `blue`
        +  // fields.
        +  // The value must be a float number between 0 and 1 based on the RGB color
        +  // value, where `0` (0/255) represents the absence of color  and `1` (255/255)
        +  // represents the maximum intensity of the color.
        +  //
        +  // For example, the following sets the color to red at its maximum intensity:
        +  //
        +  // ```
        +  // "color": {
        +  //    "red": 1,
        +  //    "green": 0,
        +  //    "blue": 0,
        +  // }
        +  // ```
        +  //
        +  // The `alpha` field is unavailable for button color. If specified, this field
        +  // is ignored.
        +  google.type.Color color = 3;
        +
        +  // Required. The action to perform when a user clicks the button, such as
        +  // opening a hyperlink or running a custom function.
        +  OnClick on_click = 4;
        +
        +  // If `true`, the button is displayed in an inactive state and doesn't respond
        +  // to user actions.
        +  bool disabled = 5;
        +
        +  // The alternative text that's used for accessibility.
        +  //
        +  // Set descriptive text that lets users know what the button does. For
        +  // example, if a button opens a hyperlink, you might write: "Opens a new
        +  // browser tab and navigates to the Google Chat developer documentation at
        +  // https://developers.google.com/workspace/chat".
        +  string alt_text = 6;
        +
        +  // Optional. The type of a button. If unset, button type defaults to
        +  // `OUTLINED`. If the `color` field is set, the button type is forced to
        +  // `FILLED` and any value set for this field is ignored.
        +  Type type = 7;
        +}
        +
        +// An icon displayed in a widget on a card. For an example in Google Chat apps,
        +// see [Add an
        +// icon](https://developers.google.com/workspace/chat/add-text-image-card-dialog#add_an_icon).
        +//
        +// Supports
        +// [built-in](https://developers.google.com/workspace/chat/format-messages#builtinicons)
        +// and
        +// [custom](https://developers.google.com/workspace/chat/format-messages#customicons)
        +// icons.
        +//
        +// [Google Workspace add-ons and Chat
        +// apps](https://developers.google.com/workspace/extend):
        +message Icon {
        +  // The icon displayed in the widget on the card.
        +  oneof icons {
        +    // Display one of the built-in icons provided by Google Workspace.
        +    //
        +    // For example, to display an airplane icon, specify `AIRPLANE`.
        +    // For a bus, specify `BUS`.
        +    //
        +    // For a full list of supported icons, see [built-in
        +    // icons](https://developers.google.com/workspace/chat/format-messages#builtinicons).
        +    string known_icon = 1;
        +
        +    // Display a custom icon hosted at an HTTPS URL.
        +    //
        +    // For example:
        +    //
        +    // ```
        +    // "iconUrl":
        +    // "https://developers.google.com/workspace/chat/images/quickstart-app-avatar.png"
        +    // ```
        +    //
        +    // Supported file types include `.png` and `.jpg`.
        +    string icon_url = 2;
        +
        +    // Display one of the [Google Material
        +    // Icons](https://fonts.google.com/icons).
        +    //
        +    // For example, to display a [checkbox
        +    // icon](https://fonts.google.com/icons?selected=Material%20Symbols%20Outlined%3Acheck_box%3AFILL%400%3Bwght%40400%3BGRAD%400%3Bopsz%4048),
        +    // use
        +    // ```
        +    // "material_icon": {
        +    //   "name": "check_box"
        +    // }
        +    // ```
        +    //
        +    // [Google Chat apps](https://developers.google.com/workspace/chat):
        +    MaterialIcon material_icon = 5;
        +  }
        +
        +  // Optional. A description of the icon used for accessibility.
        +  // If unspecified, the default value `Button` is provided. As a best practice,
        +  // you should set a helpful description for what the icon displays, and if
        +  // applicable, what it does. For example, `A user's account portrait`, or
        +  // `Opens a new browser tab and navigates to the Google Chat developer
        +  // documentation at https://developers.google.com/workspace/chat`.
        +  //
        +  // If the icon is set in a [`Button`][google.apps.card.v1.Button], the
        +  // `altText` appears as helper text when the user hovers over the button.
        +  // However, if the button also sets `text`, the icon's `altText` is ignored.
        +  string alt_text = 3;
        +
        +  // The crop style applied to the image. In some cases, applying a
        +  // `CIRCLE` crop causes the image to be drawn larger than a built-in
        +  // icon.
        +  Widget.ImageType image_type = 4;
        +}
        +
        +// A [Google Material Icon](https://fonts.google.com/icons), which includes over
        +// 2500+ options.
        +//
        +// For example, to display a [checkbox
        +// icon](https://fonts.google.com/icons?selected=Material%20Symbols%20Outlined%3Acheck_box%3AFILL%400%3Bwght%40400%3BGRAD%400%3Bopsz%4048)
        +// with customized weight and grade, write the following:
        +//
        +// ```
        +// {
        +//   "name": "check_box",
        +//   "fill": true,
        +//   "weight": 300,
        +//   "grade": -25
        +// }
        +// ```
        +//
        +// [Google Chat apps](https://developers.google.com/workspace/chat):
        +message MaterialIcon {
        +  // The icon name defined in the [Google Material
        +  // Icon](https://fonts.google.com/icons), for example, `check_box`. Any
        +  // invalid names are abandoned and replaced with empty string and
        +  // results in the icon failing to render.
        +  string name = 1;
        +
        +  // Whether the icon renders as filled. Default value is false.
        +  //
        +  // To preview different icon settings, go to
        +  // [Google Font Icons](https://fonts.google.com/icons) and adjust the
        +  // settings under **Customize**.
        +  bool fill = 2;
        +
        +  // The stroke weight of the icon. Choose from {100, 200, 300, 400,
        +  // 500, 600, 700}. If absent, default value is 400. If any other value is
        +  // specified, the default value is used.
        +  //
        +  // To preview different icon settings, go to
        +  // [Google Font Icons](https://fonts.google.com/icons) and adjust the
        +  // settings under **Customize**.
        +  int32 weight = 3;
        +
        +  // Weight and grade affect a symbol’s thickness. Adjustments to grade are more
        +  // granular than adjustments to weight and have a small impact on the size of
        +  // the symbol. Choose from {-25, 0, 200}. If absent, default value is 0. If
        +  // any other value is specified, the default value is used.
        +  //
        +  // To preview different icon settings, go to
        +  // [Google Font Icons](https://fonts.google.com/icons) and adjust the
        +  // settings under **Customize**.
        +  int32 grade = 4;
        +}
        +
        +// Represents the crop style applied to an image.
        +//
        +// [Google Workspace add-ons and
        +// Chat apps](https://developers.google.com/workspace/extend):
        +//
        +// For example, here's how to apply a 16:9 aspect ratio:
        +//
        +// ```
        +// cropStyle {
        +//  "type": "RECTANGLE_CUSTOM",
        +//  "aspectRatio": 16/9
        +// }
        +// ```
        +message ImageCropStyle {
        +  // Represents the crop style applied to an image.
        +  //
        +  // [Google Workspace add-ons
        +  // and Chat apps](https://developers.google.com/workspace/extend):
        +  enum ImageCropType {
        +    // Don't use. Unspecified.
        +    IMAGE_CROP_TYPE_UNSPECIFIED = 0;
        +
        +    // Default value. Applies a square crop.
        +    SQUARE = 1;
        +
        +    // Applies a circular crop.
        +    CIRCLE = 2;
        +
        +    // Applies a rectangular crop with a custom aspect ratio. Set the custom
        +    // aspect ratio with `aspectRatio`.
        +    RECTANGLE_CUSTOM = 3;
        +
        +    // Applies a rectangular crop with a 4:3 aspect ratio.
        +    RECTANGLE_4_3 = 4;
        +  }
        +
        +  // The crop type.
        +  ImageCropType type = 1;
        +
        +  // The aspect ratio to use if the crop type is `RECTANGLE_CUSTOM`.
        +  //
        +  // For example, here's how to apply a 16:9 aspect ratio:
        +  //
        +  // ```
        +  // cropStyle {
        +  //  "type": "RECTANGLE_CUSTOM",
        +  //  "aspectRatio": 16/9
        +  // }
        +  // ```
        +  double aspect_ratio = 2;
        +}
        +
        +// The style options for the border of a card or widget, including the border
        +// type and color.
        +//
        +// [Google Workspace add-ons and Chat
        +// apps](https://developers.google.com/workspace/extend):
        +message BorderStyle {
        +  // Represents the border types applied to widgets.
        +  //
        +  // [Google Workspace add-ons
        +  // and Chat apps](https://developers.google.com/workspace/extend):
        +  enum BorderType {
        +    // Don't use. Unspecified.
        +    BORDER_TYPE_UNSPECIFIED = 0;
        +
        +    // No border.
        +    NO_BORDER = 1;
        +
        +    // Default value. Outline.
        +    STROKE = 2;
        +  }
        +
        +  // The border type.
        +  BorderType type = 1;
        +
        +  // The colors to use when the type is `BORDER_TYPE_STROKE`.
        +  //
        +  // To set the stroke color, specify a value for the `red`, `green`, and `blue`
        +  // fields.
        +  // The value must be a float number between 0 and 1 based on the RGB color
        +  // value, where `0` (0/255) represents the absence of color  and `1` (255/255)
        +  // represents the maximum intensity of the color.
        +  //
        +  // For example, the following sets the color to red at its maximum intensity:
        +  //
        +  // ```
        +  // "color": {
        +  //    "red": 1,
        +  //    "green": 0,
        +  //    "blue": 0,
        +  // }
        +  // ```
        +  //
        +  // The `alpha` field is unavailable for stroke color. If specified, this field
        +  // is ignored.
        +  google.type.Color stroke_color = 2;
        +
        +  // The corner radius for the border.
        +  int32 corner_radius = 3;
        +}
        +
        +// Represents an image.
        +//
        +// [Google Workspace add-ons and Chat
        +// apps](https://developers.google.com/workspace/extend):
        +message ImageComponent {
        +  // The image URL.
        +  string image_uri = 1;
        +
        +  // The accessibility label for the image.
        +  string alt_text = 2;
        +
        +  // The crop style to apply to the image.
        +  ImageCropStyle crop_style = 3;
        +
        +  // The border style to apply to the image.
        +  BorderStyle border_style = 4;
        +}
        +
        +// Displays a grid with a collection of items. Items can only include text or
        +// images. For responsive columns, or to include more than text or images, use
        +// [`Columns`][google.apps.card.v1.Columns]. For an example in Google Chat apps,
        +// see [Display a Grid with a collection of
        +// items](https://developers.google.com/workspace/chat/format-structure-card-dialog#display_a_grid_with_a_collection_of_items).
        +//
        +// A grid supports any number of columns and items. The number of rows is
        +// determined by items divided by columns. A grid with
        +// 10 items and 2 columns has 5 rows. A grid with 11 items and 2 columns
        +// has 6 rows.
        +//
        +// [Google Workspace add-ons and Chat
        +// apps](https://developers.google.com/workspace/extend):
        +//
        +// For example, the following JSON creates a 2 column grid with a single
        +// item:
        +//
        +// ```
        +// "grid": {
        +//   "title": "A fine collection of items",
        +//   "columnCount": 2,
        +//   "borderStyle": {
        +//     "type": "STROKE",
        +//     "cornerRadius": 4
        +//   },
        +//   "items": [
        +//     {
        +//       "image": {
        +//         "imageUri": "https://www.example.com/image.png",
        +//         "cropStyle": {
        +//           "type": "SQUARE"
        +//         },
        +//         "borderStyle": {
        +//           "type": "STROKE"
        +//         }
        +//       },
        +//       "title": "An item",
        +//       "textAlignment": "CENTER"
        +//     }
        +//   ],
        +//   "onClick": {
        +//     "openLink": {
        +//       "url": "https://www.example.com"
        +//     }
        +//   }
        +// }
        +// ```
        +message Grid {
        +  // Represents an item in a grid layout. Items can contain text, an image, or
        +  // both text and an image.
        +  //
        +  // [Google Workspace add-ons and Chat
        +  // apps](https://developers.google.com/workspace/extend):
        +  message GridItem {
        +    // Represents the various layout options available for a grid item.
        +    //
        +    // [Google Workspace add-ons and Chat
        +    // apps](https://developers.google.com/workspace/extend):
        +    enum GridItemLayout {
        +      // Don't use. Unspecified.
        +      GRID_ITEM_LAYOUT_UNSPECIFIED = 0;
        +
        +      // The title and subtitle are shown below the grid item's image.
        +      TEXT_BELOW = 1;
        +
        +      // The title and subtitle are shown above the grid item's image.
        +      TEXT_ABOVE = 2;
        +    }
        +
        +    // A user-specified identifier for this grid item. This identifier is
        +    // returned in the parent grid's `onClick` callback parameters.
        +    string id = 1;
        +
        +    // The image that displays in the grid item.
        +    ImageComponent image = 2;
        +
        +    // The grid item's title.
        +    string title = 3;
        +
        +    // The grid item's subtitle.
        +    string subtitle = 4;
        +
        +    // The layout to use for the grid item.
        +    GridItemLayout layout = 9;
        +  }
        +
        +  // The text that displays in the grid header.
        +  string title = 1;
        +
        +  // The items to display in the grid.
        +  repeated GridItem items = 2;
        +
        +  // The border style to apply to each grid item.
        +  BorderStyle border_style = 3;
        +
        +  // The number of columns to display in the grid. A default value
        +  // is used if this field isn't specified, and that default value is
        +  // different depending on where the grid is shown (dialog versus companion).
        +  int32 column_count = 4;
        +
        +  // This callback is reused by each individual grid item, but with the
        +  // item's identifier and index in the items list added to the callback's
        +  // parameters.
        +  OnClick on_click = 5;
        +}
        +
        +// The `Columns` widget displays up to 2 columns in a card or dialog. You can
        +// add widgets to each column; the widgets appear in the order that they are
        +// specified. For an example in Google Chat apps, see
        +// [Display cards and dialogs in
        +// columns](https://developers.google.com/workspace/chat/format-structure-card-dialog#display_cards_and_dialogs_in_columns).
        +//
        +// The height of each column is determined by the taller column. For example, if
        +// the first column is taller than the second column, both columns have the
        +// height of the first column. Because each column can contain a different
        +// number of widgets, you can't define rows or align widgets between the
        +// columns.
        +//
        +// Columns are displayed side-by-side. You can customize the width of each
        +// column using the `HorizontalSizeStyle` field. If the user's
        +// screen width is too narrow, the second column wraps below the first:
        +//
        +// * On web, the second column wraps if the screen width is less than or equal
        +//   to 480 pixels.
        +// * On iOS devices, the second column wraps if the screen width is
        +//   less than or equal to 300 pt.
        +// * On Android devices, the second column wraps if the screen width is
        +//   less than or equal to 320 dp.
        +//
        +// To include more than two columns, or to use rows, use the
        +// [`Grid`][google.apps.card.v1.Grid] widget.
        +//
        +// [Google Workspace add-ons and Chat
        +// apps](https://developers.google.com/workspace/extend):
        +// The add-on UIs that support columns include:
        +//
        +// * The dialog displayed when users open the add-on from an email draft.
        +// * The dialog displayed when users open the add-on from the
        +// **Add attachment** menu in a Google Calendar event.
        +message Columns {
        +  // A column.
        +  //
        +  // [Google Workspace add-ons and Chat
        +  // apps](https://developers.google.com/workspace/extend)
        +  message Column {
        +    // Specifies how a column fills the width of the card. The width of each
        +    // column depends on both the `HorizontalSizeStyle` and the width of the
        +    // widgets within the column.
        +    //
        +    // [Google Workspace add-ons and Chat
        +    // apps](https://developers.google.com/workspace/extend)
        +    enum HorizontalSizeStyle {
        +      // Don't use. Unspecified.
        +      HORIZONTAL_SIZE_STYLE_UNSPECIFIED = 0;
        +
        +      // Default value. Column fills the available space, up to 70% of the
        +      // card's width. If both columns are set to `FILL_AVAILABLE_SPACE`, each
        +      // column fills 50% of the space.
        +      FILL_AVAILABLE_SPACE = 1;
        +
        +      // Column fills the least amount of space possible and no more than 30% of
        +      // the card's width.
        +      FILL_MINIMUM_SPACE = 2;
        +    }
        +
        +    // Specifies whether widgets align to the top, bottom, or center of a
        +    // column.
        +    //
        +    // [Google Workspace add-ons and Chat
        +    // apps](https://developers.google.com/workspace/extend)
        +    enum VerticalAlignment {
        +      // Don't use. Unspecified.
        +      VERTICAL_ALIGNMENT_UNSPECIFIED = 0;
        +
        +      // Default value. Aligns widgets to the center of a column.
        +      CENTER = 1;
        +
        +      // Aligns widgets to the top of a column.
        +      TOP = 2;
        +
        +      // Aligns widgets to the bottom of a column.
        +      BOTTOM = 3;
        +    }
        +
        +    // The supported widgets that you can include in a column.
        +    //
        +    // [Google Workspace add-ons and Chat
        +    // apps](https://developers.google.com/workspace/extend)
        +    message Widgets {
        +      oneof data {
        +        // [TextParagraph][google.apps.card.v1.TextParagraph] widget.
        +        TextParagraph text_paragraph = 1;
        +
        +        // [Image][google.apps.card.v1.Image] widget.
        +        Image image = 2;
        +
        +        // [DecoratedText][google.apps.card.v1.DecoratedText] widget.
        +        DecoratedText decorated_text = 3;
        +
        +        // [ButtonList][google.apps.card.v1.ButtonList] widget.
        +        ButtonList button_list = 4;
        +
        +        // [TextInput][google.apps.card.v1.TextInput] widget.
        +        TextInput text_input = 5;
        +
        +        // [SelectionInput][google.apps.card.v1.SelectionInput] widget.
        +        SelectionInput selection_input = 6;
        +
        +        // [DateTimePicker][google.apps.card.v1.DateTimePicker] widget.
        +        DateTimePicker date_time_picker = 7;
        +
        +        // [ChipList][google.apps.card.v1.ChipList] widget.
        +        ChipList chip_list = 8;
        +      }
        +    }
        +
        +    // Specifies how a column fills the width of the card.
        +    HorizontalSizeStyle horizontal_size_style = 1;
        +
        +    // Specifies whether widgets align to the left, right, or center of a
        +    // column.
        +    Widget.HorizontalAlignment horizontal_alignment = 2;
        +
        +    // Specifies whether widgets align to the top, bottom, or center of a
        +    // column.
        +    VerticalAlignment vertical_alignment = 3;
        +
        +    // An array of widgets included in a column. Widgets appear in the order
        +    // that they are specified.
        +    repeated Widgets widgets = 4;
        +  }
        +
        +  // An array of columns. You can include up to 2 columns in a card or dialog.
        +  repeated Column column_items = 2;
        +}
        +
        +// A carousel, also known as a slider, rotates and displays a list of widgets in
        +// a slideshow format, with buttons navigating to the previous or next widget.
        +//
        +// For example, this is a JSON representation of a carousel that contains three
        +// text paragraph widgets.
        +//
        +// ```
        +// {
        +//   "carouselCards": [
        +//     {
        +//       "widgets": [
        +//         {
        +//           "textParagraph": {
        +//             "text": "First text paragraph in carousel",
        +//           }
        +//         }
        +//       ]
        +//     },
        +//     {
        +//       "widgets": [
        +//         {
        +//           "textParagraph": {
        +//             "text": "Second text paragraph in carousel",
        +//           }
        +//         }
        +//       ]
        +//     },
        +//     {
        +//       "widgets": [
        +//         {
        +//           "textParagraph": {
        +//             "text": "Third text paragraph in carousel",
        +//           }
        +//         }
        +//       ]
        +//     }
        +//   ]
        +// }
        +// ```
        +//
        +// [Google Chat apps](https://developers.google.com/workspace/chat):
        +message Carousel {
        +  // A card that can be displayed as a carousel item.
        +  // [Google Chat apps](https://developers.google.com/workspace/chat):
        +  message CarouselCard {
        +    // A list of widgets displayed in the carousel card. The widgets are
        +    // displayed in the order that they are specified.
        +    repeated Card.NestedWidget widgets = 1;
        +
        +    // A list of widgets displayed at the bottom of the carousel card. The
        +    // widgets are displayed in the order that they are specified.
        +    repeated Card.NestedWidget footer_widgets = 2;
        +  }
        +
        +  // A list of cards included in the carousel.
        +  repeated CarouselCard carousel_cards = 4;
        +}
        +
        +// Represent an expand and collapse control.
        +//
        +// [Google Workspace add-ons and Chat
        +// apps](https://developers.google.com/workspace/extend):
        +message CollapseControl {
        +  // The horizontal alignment of the expand and collapse button.
        +  Widget.HorizontalAlignment horizontal_alignment = 1;
        +
        +  // Optional. Define a customizable button to expand the section.
        +  // Both expand_button and collapse_button field must be set. Only one
        +  // field set will not take into effect.
        +  // If this field isn't set, the default button is used.
        +  Button expand_button = 2;
        +
        +  // Optional. Define a customizable button to collapse the section.
        +  // Both expand_button and collapse_button field must be set. Only one
        +  // field set will not take into effect.
        +  // If this field isn't set, the default button is used.
        +  Button collapse_button = 3;
        +}
        +
        +// Represents how to respond when users click an interactive element on
        +// a card, such as a button.
        +//
        +// [Google Workspace add-ons and Chat
        +// apps](https://developers.google.com/workspace/extend):
        +message OnClick {
        +  oneof data {
        +    // If specified, an action is triggered by this `onClick`.
        +    Action action = 1;
        +
        +    // If specified, this `onClick` triggers an open link action.
        +    OpenLink open_link = 2;
        +
        +    // An add-on triggers this action when the action needs to open a
        +    // link. This differs from the `open_link` above in that this needs to talk
        +    // to server to get the link. Thus some preparation work is required for
        +    // web client to do before the open link action response comes back.
        +    //
        +    // [Google Workspace
        +    // add-ons](https://developers.google.com/workspace/add-ons):
        +    Action open_dynamic_link_action = 3;
        +
        +    // A new card is pushed to the card stack after clicking if specified.
        +    //
        +    // [Google Workspace
        +    // add-ons](https://developers.google.com/workspace/add-ons):
        +    Card card = 4;
        +
        +    // If specified, this `onClick` opens an overflow menu.
        +    OverflowMenu overflow_menu = 8;
        +  }
        +}
        +
        +// Represents an `onClick` event that opens a hyperlink.
        +//
        +// [Google Workspace add-ons and Chat
        +// apps](https://developers.google.com/workspace/extend):
        +message OpenLink {
        +  // When an `OnClick` action opens a link, then the client can either open it
        +  // as a full-size window (if that's the frame used by the client), or an
        +  // overlay (such as a pop-up). The implementation depends on the client
        +  // platform capabilities, and the value selected might be ignored if the
        +  // client doesn't support it. `FULL_SIZE` is supported by all clients.
        +  //
        +  // [Google Workspace
        +  // add-ons](https://developers.google.com/workspace/add-ons):
        +  enum OpenAs {
        +    // The link opens as a full-size window (if that's the frame used by the
        +    // client).
        +    FULL_SIZE = 0;
        +
        +    // The link opens as an overlay, such as a pop-up.
        +    OVERLAY = 1;
        +  }
        +
        +  // What the client does when a link opened by an `OnClick` action is closed.
        +  //
        +  // Implementation depends on client platform capabilities. For example, a web
        +  // browser might open a link in a pop-up window with an `OnClose` handler.
        +  //
        +  // If both `OnOpen` and `OnClose` handlers are set, and the client platform
        +  // can't support both values, `OnClose` takes precedence.
        +  //
        +  // [Google Workspace
        +  // add-ons](https://developers.google.com/workspace/add-ons):
        +  enum OnClose {
        +    // Default value. The card doesn't reload; nothing happens.
        +    NOTHING = 0;
        +
        +    // Reloads the card after the child window closes.
        +    //
        +    // If used in conjunction with
        +    // [`OpenAs.OVERLAY`](https://developers.google.com/workspace/add-ons/reference/rpc/google.apps.card.v1#openas),
        +    // the child window acts as a modal dialog and the parent card is blocked
        +    // until the child window closes.
        +    RELOAD = 1;
        +  }
        +
        +  // The URL to open.
        +  string url = 1;
        +
        +  // How to open a link.
        +  //
        +  // [Google Workspace
        +  // add-ons](https://developers.google.com/workspace/add-ons):
        +  OpenAs open_as = 2;
        +
        +  // Whether the client forgets about a link after opening it, or observes it
        +  // until the window closes.
        +  //
        +  // [Google Workspace
        +  // add-ons](https://developers.google.com/workspace/add-ons):
        +  OnClose on_close = 3;
        +}
        +
        +// An action that describes the behavior when the form is submitted.
        +// For example, you can invoke an Apps Script script to handle the form.
        +// If the action is triggered, the form values are sent to the server.
        +//
        +// [Google Workspace add-ons and Chat
        +// apps](https://developers.google.com/workspace/extend):
        +message Action {
        +  // List of string parameters to supply when the action method is invoked.
        +  // For example, consider three snooze buttons: snooze now, snooze one day,
        +  // or snooze next week. You might use `action method = snooze()`, passing the
        +  // snooze type and snooze time in the list of string parameters.
        +  //
        +  // To learn more, see
        +  // [`CommonEventObject`](https://developers.google.com/workspace/chat/api/reference/rest/v1/Event#commoneventobject).
        +  //
        +  // [Google Workspace add-ons and Chat
        +  // apps](https://developers.google.com/workspace/extend):
        +  message ActionParameter {
        +    // The name of the parameter for the action script.
        +    string key = 1;
        +
        +    // The value of the parameter.
        +    string value = 2;
        +  }
        +
        +  // Specifies the loading indicator that the action displays while
        +  // making the call to the action.
        +  //
        +  // [Google Workspace add-ons and Chat
        +  // apps](https://developers.google.com/workspace/extend):
        +  enum LoadIndicator {
        +    // Displays a spinner to indicate that content is loading.
        +    SPINNER = 0;
        +
        +    // Nothing is displayed.
        +    NONE = 1;
        +  }
        +
        +  // Optional. Required when opening a
        +  // [dialog](https://developers.google.com/workspace/chat/dialogs).
        +  //
        +  // What to do in response to an interaction with a user, such as a user
        +  // clicking a button in a card message.
        +  //
        +  // If unspecified, the app responds by executing an `action`—like opening a
        +  // link or running a function—as normal.
        +  //
        +  // By specifying an `interaction`, the app can respond in special interactive
        +  // ways. For example, by setting `interaction` to `OPEN_DIALOG`, the app can
        +  // open a [dialog](https://developers.google.com/workspace/chat/dialogs).
        +  //
        +  // When specified, a loading indicator isn't shown. If specified for
        +  // an add-on, the entire card is stripped and nothing is shown in the client.
        +  //
        +  // [Google Chat apps](https://developers.google.com/workspace/chat):
        +  enum Interaction {
        +    // Default value. The `action` executes as normal.
        +    INTERACTION_UNSPECIFIED = 0;
        +
        +    // Opens a [dialog](https://developers.google.com/workspace/chat/dialogs), a
        +    // windowed, card-based interface that Chat apps use to interact with users.
        +    //
        +    // Only supported by Chat apps in response to button-clicks on card
        +    // messages. If specified for
        +    // an add-on, the entire card is stripped and nothing is shown in the
        +    // client.
        +    //
        +    // [Google Chat apps](https://developers.google.com/workspace/chat):
        +    OPEN_DIALOG = 1;
        +  }
        +
        +  // A custom function to invoke when the containing element is
        +  // clicked or otherwise activated.
        +  //
        +  // For example usage, see [Read form
        +  // data](https://developers.google.com/workspace/chat/read-form-data).
        +  string function = 1;
        +
        +  // List of action parameters.
        +  repeated ActionParameter parameters = 2;
        +
        +  // Specifies the loading indicator that the action displays while
        +  // making the call to the action.
        +  LoadIndicator load_indicator = 3;
        +
        +  // Indicates whether form values persist after the action. The default value
        +  // is `false`.
        +  //
        +  // If `true`, form values remain after the action is triggered. To let the
        +  // user make changes while the action is being processed, set
        +  // [`LoadIndicator`](https://developers.google.com/workspace/add-ons/reference/rpc/google.apps.card.v1#loadindicator)
        +  // to `NONE`. For [card
        +  // messages](https://developers.google.com/workspace/chat/api/guides/v1/messages/create#create)
        +  // in Chat apps, you must also set the action's
        +  // [`ResponseType`](https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces.messages#responsetype)
        +  // to `UPDATE_MESSAGE` and use the same
        +  // [`card_id`](https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces.messages#CardWithId)
        +  // from the card that contained the action.
        +  //
        +  // If `false`, the form values are cleared when the action is triggered.
        +  // To prevent the user from making changes while the action is being
        +  // processed, set
        +  // [`LoadIndicator`](https://developers.google.com/workspace/add-ons/reference/rpc/google.apps.card.v1#loadindicator)
        +  // to `SPINNER`.
        +  bool persist_values = 4;
        +
        +  // Optional. Required when opening a
        +  // [dialog](https://developers.google.com/workspace/chat/dialogs).
        +  //
        +  // What to do in response to an interaction with a user, such as a user
        +  // clicking a button in a card message.
        +  //
        +  // If unspecified, the app responds by executing an `action`—like opening a
        +  // link or running a function—as normal.
        +  //
        +  // By specifying an `interaction`, the app can respond in special interactive
        +  // ways. For example, by setting `interaction` to `OPEN_DIALOG`, the app can
        +  // open a [dialog](https://developers.google.com/workspace/chat/dialogs). When
        +  // specified, a loading indicator isn't shown. If specified for
        +  // an add-on, the entire card is stripped and nothing is shown in the client.
        +  //
        +  // [Google Chat apps](https://developers.google.com/workspace/chat):
        +  Interaction interaction = 5;
        +
        +  // Optional. Fill this list with the names of widgets that this Action
        +  // needs for a valid submission.
        +  //
        +  // If the widgets listed here don't have a value when this Action is invoked,
        +  // the form submission is aborted.
        +  //
        +  // [Google Workspace add-ons and Chat
        +  // apps](https://developers.google.com/workspace/extend):
        +  repeated string required_widgets = 6;
        +
        +  // Optional. If this is true, then all widgets are considered required by
        +  // this action.
        +  //
        +  // [Google Workspace add-ons and Chat
        +  // apps](https://developers.google.com/workspace/extend):
        +  bool all_widgets_are_required = 7;
        +}
        +
        +// Represents the necessary data for validating the widget it's attached to.
        +//
        +// [Google Workspace add-ons and Chat
        +// apps](https://developers.google.com/workspace/extend):
        +message Validation {
        +  // The type of the input widget.
        +  enum InputType {
        +    // Unspecified type. Do not use.
        +    INPUT_TYPE_UNSPECIFIED = 0;
        +
        +    // Regular text that accepts all characters.
        +    TEXT = 1;
        +
        +    // An integer value.
        +    INTEGER = 2;
        +
        +    // A float value.
        +    FLOAT = 3;
        +
        +    // An email address.
        +    EMAIL = 4;
        +
        +    // A emoji selected from system-provided emoji picker.
        +    EMOJI_PICKER = 5;
        +  }
        +
        +  // Specify the character limit for text input widgets.  Note that this is
        +  // only used for text input and is ignored for other widgets.
        +  //
        +  // [Google Workspace add-ons and Chat
        +  // apps](https://developers.google.com/workspace/extend):
        +  int32 character_limit = 1;
        +
        +  // Specify the type of the input widgets.
        +  //
        +  // [Google Workspace add-ons and Chat
        +  // apps](https://developers.google.com/workspace/extend):
        +  InputType input_type = 2;
        +}
        +
        +// A list of chips layed out horizontally, which can either scroll horizontally
        +// or wrap to the next line.
        +//
        +// [Google Workspace add-ons and Chat
        +// apps](https://developers.google.com/workspace/extend):
        +message ChipList {
        +  // The chip list layout.
        +  enum Layout {
        +    // Don't use. Unspecified.
        +    LAYOUT_UNSPECIFIED = 0;
        +
        +    // Default value. The chip list wraps to the next line if there isn't enough
        +    // horizontal space.
        +    WRAPPED = 1;
        +
        +    // The chips scroll horizontally if they don't fit in the available space.
        +    HORIZONTAL_SCROLLABLE = 2;
        +  }
        +
        +  // Specified chip list layout.
        +  Layout layout = 1;
        +
        +  // An array of chips.
        +  repeated Chip chips = 2;
        +}
        +
        +// A text, icon, or text and icon chip that users can click.
        +//
        +// [Google Workspace add-ons and Chat
        +// apps](https://developers.google.com/workspace/extend):
        +message Chip {
        +  // The icon image. If both `icon` and `text` are set, then the icon appears
        +  // before the text.
        +  Icon icon = 1;
        +
        +  // The text displayed inside the chip.
        +  string label = 2;
        +
        +  // Optional. The action to perform when a user clicks the chip, such as
        +  // opening a hyperlink or running a custom function.
        +  OnClick on_click = 3;
        +
        +  // Whether the chip is in an active state and responds to user actions.
        +  // Defaults to `true`.
        +  // Deprecated. Use `disabled` instead.
        +  bool enabled = 4 [deprecated = true];
        +
        +  // Whether the chip is in an inactive state and ignores user actions.
        +  // Defaults to `false`.
        +  bool disabled = 6;
        +
        +  // The alternative text that's used for accessibility.
        +  //
        +  // Set descriptive text that lets users know what the chip does. For
        +  // example, if a chip opens a hyperlink, write: "Opens a new
        +  // browser tab and navigates to the Google Chat developer documentation at
        +  // https://developers.google.com/workspace/chat".
        +  string alt_text = 5;
        +}
        diff --git a/java-common-protos/proto-google-common-protos/src/main/proto/google/cloud/audit/audit_log.proto b/java-common-protos/proto-google-common-protos/src/main/proto/google/cloud/audit/audit_log.proto
        index ed4ae5f48f..c43d605306 100644
        --- a/java-common-protos/proto-google-common-protos/src/main/proto/google/cloud/audit/audit_log.proto
        +++ b/java-common-protos/proto-google-common-protos/src/main/proto/google/cloud/audit/audit_log.proto
        @@ -1,4 +1,4 @@
        -// Copyright 2022 Google LLC
        +// Copyright 2025 Google LLC
         //
         // Licensed under the Apache License, Version 2.0 (the "License");
         // you may not use this file except in compliance with the License.
        @@ -152,6 +152,24 @@ message AuthenticationInfo {
         
         // Authorization information for the operation.
         message AuthorizationInfo {
        +  // The list of valid permission types that can be checked.
        +  enum PermissionType {
        +    // Default. Should not be used.
        +    PERMISSION_TYPE_UNSPECIFIED = 0;
        +
        +    // Permissions that gate reading resource configuration or metadata.
        +    ADMIN_READ = 1;
        +
        +    // Permissions that gate modification of resource configuration or metadata.
        +    ADMIN_WRITE = 2;
        +
        +    // Permissions that gate reading user-provided data.
        +    DATA_READ = 3;
        +
        +    // Permissions that gate writing user-provided data.
        +    DATA_WRITE = 4;
        +  }
        +
           // The resource being accessed, as a REST-style or cloud resource string.
           // For example:
           //
        @@ -174,6 +192,11 @@ message AuthorizationInfo {
           // condition evaluation, the user must also look into
           // `AuditLog.request_metadata.request_attributes`.
           google.rpc.context.AttributeContext.Resource resource_attributes = 5;
        +
        +  // The type of the permission that was checked. For data access audit logs
        +  // this corresponds with the permission type that must be enabled in the
        +  // project/folder/organization IAM policy in order for the log to be written.
        +  PermissionType permission_type = 7;
         }
         
         // Metadata about the request.
        diff --git a/java-common-protos/proto-google-common-protos/src/main/proto/google/cloud/extended_operations.proto b/java-common-protos/proto-google-common-protos/src/main/proto/google/cloud/extended_operations.proto
        index 1477d2d69a..69f44ddac8 100644
        --- a/java-common-protos/proto-google-common-protos/src/main/proto/google/cloud/extended_operations.proto
        +++ b/java-common-protos/proto-google-common-protos/src/main/proto/google/cloud/extended_operations.proto
        @@ -1,4 +1,4 @@
        -// Copyright 2021 Google LLC.
        +// Copyright 2025 Google LLC
         //
         // Licensed under the Apache License, Version 2.0 (the "License");
         // you may not use this file except in compliance with the License.
        diff --git a/java-common-protos/proto-google-common-protos/src/main/proto/google/cloud/location/locations.proto b/java-common-protos/proto-google-common-protos/src/main/proto/google/cloud/location/locations.proto
        new file mode 100644
        index 0000000000..36a0b0e89d
        --- /dev/null
        +++ b/java-common-protos/proto-google-common-protos/src/main/proto/google/cloud/location/locations.proto
        @@ -0,0 +1,108 @@
        +// Copyright 2025 Google LLC
        +//
        +// Licensed under the Apache License, Version 2.0 (the "License");
        +// you may not use this file except in compliance with the License.
        +// You may obtain a copy of the License at
        +//
        +//     http://www.apache.org/licenses/LICENSE-2.0
        +//
        +// Unless required by applicable law or agreed to in writing, software
        +// distributed under the License is distributed on an "AS IS" BASIS,
        +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
        +// See the License for the specific language governing permissions and
        +// limitations under the License.
        +
        +syntax = "proto3";
        +
        +package google.cloud.location;
        +
        +import "google/api/annotations.proto";
        +import "google/protobuf/any.proto";
        +import "google/api/client.proto";
        +
        +option cc_enable_arenas = true;
        +option go_package = "google.golang.org/genproto/googleapis/cloud/location;location";
        +option java_multiple_files = true;
        +option java_outer_classname = "LocationsProto";
        +option java_package = "com.google.cloud.location";
        +
        +// An abstract interface that provides location-related information for
        +// a service. Service-specific metadata is provided through the
        +// [Location.metadata][google.cloud.location.Location.metadata] field.
        +service Locations {
        +  option (google.api.default_host) = "cloud.googleapis.com";
        +  option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform";
        +
        +  // Lists information about the supported locations for this service.
        +  rpc ListLocations(ListLocationsRequest) returns (ListLocationsResponse) {
        +    option (google.api.http) = {
        +      get: "/v1/{name=locations}"
        +      additional_bindings {
        +        get: "/v1/{name=projects/*}/locations"
        +      }
        +    };
        +  }
        +
        +  // Gets information about a location.
        +  rpc GetLocation(GetLocationRequest) returns (Location) {
        +    option (google.api.http) = {
        +      get: "/v1/{name=locations/*}"
        +      additional_bindings {
        +        get: "/v1/{name=projects/*/locations/*}"
        +      }
        +    };
        +  }
        +}
        +
        +// The request message for [Locations.ListLocations][google.cloud.location.Locations.ListLocations].
        +message ListLocationsRequest {
        +  // The resource that owns the locations collection, if applicable.
        +  string name = 1;
        +
        +  // The standard list filter.
        +  string filter = 2;
        +
        +  // The standard list page size.
        +  int32 page_size = 3;
        +
        +  // The standard list page token.
        +  string page_token = 4;
        +}
        +
        +// The response message for [Locations.ListLocations][google.cloud.location.Locations.ListLocations].
        +message ListLocationsResponse {
        +  // A list of locations that matches the specified filter in the request.
        +  repeated Location locations = 1;
        +
        +  // The standard List next-page token.
        +  string next_page_token = 2;
        +}
        +
        +// The request message for [Locations.GetLocation][google.cloud.location.Locations.GetLocation].
        +message GetLocationRequest {
        +  // Resource name for the location.
        +  string name = 1;
        +}
        +
        +// A resource that represents Google Cloud Platform location.
        +message Location {
        +  // Resource name for the location, which may vary between implementations.
        +  // For example: `"projects/example-project/locations/us-east1"`
        +  string name = 1;
        +
        +  // The canonical id for this location. For example: `"us-east1"`.
        +  string location_id = 4;
        +
        +  // The friendly name for this location, typically a nearby city name.
        +  // For example, "Tokyo".
        +  string display_name = 5;
        +
        +  // Cross-service attributes for the location. For example
        +  //
        +  //     {"cloud.googleapis.com/region": "us-east1"}
        +  map labels = 2;
        +
        +  // Service-specific metadata. For example the available capacity at the given
        +  // location.
        +  google.protobuf.Any metadata = 3;
        +}
        diff --git a/java-common-protos/proto-google-common-protos/src/main/proto/google/geo/type/viewport.proto b/java-common-protos/proto-google-common-protos/src/main/proto/google/geo/type/viewport.proto
        index ad5029f836..08c0cce8cf 100644
        --- a/java-common-protos/proto-google-common-protos/src/main/proto/google/geo/type/viewport.proto
        +++ b/java-common-protos/proto-google-common-protos/src/main/proto/google/geo/type/viewport.proto
        @@ -1,4 +1,4 @@
        -// Copyright 2019 Google LLC.
        +// Copyright 2025 Google LLC
         //
         // Licensed under the Apache License, Version 2.0 (the "License");
         // you may not use this file except in compliance with the License.
        diff --git a/java-common-protos/proto-google-common-protos/src/main/proto/google/logging/type/http_request.proto b/java-common-protos/proto-google-common-protos/src/main/proto/google/logging/type/http_request.proto
        index b878d60dce..b31522b69c 100644
        --- a/java-common-protos/proto-google-common-protos/src/main/proto/google/logging/type/http_request.proto
        +++ b/java-common-protos/proto-google-common-protos/src/main/proto/google/logging/type/http_request.proto
        @@ -1,4 +1,4 @@
        -// Copyright 2022 Google LLC
        +// Copyright 2025 Google LLC
         //
         // Licensed under the Apache License, Version 2.0 (the "License");
         // you may not use this file except in compliance with the License.
        @@ -67,7 +67,7 @@ message HttpRequest {
         
           // The referer URL of the request, as defined in
           // [HTTP/1.1 Header Field
        -  // Definitions](http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html).
        +  // Definitions](https://datatracker.ietf.org/doc/html/rfc2616#section-14.36).
           string referer = 8;
         
           // The request processing latency on the server, from the time the request was
        diff --git a/java-common-protos/proto-google-common-protos/src/main/proto/google/logging/type/log_severity.proto b/java-common-protos/proto-google-common-protos/src/main/proto/google/logging/type/log_severity.proto
        index bed71935f9..406b8173a3 100644
        --- a/java-common-protos/proto-google-common-protos/src/main/proto/google/logging/type/log_severity.proto
        +++ b/java-common-protos/proto-google-common-protos/src/main/proto/google/logging/type/log_severity.proto
        @@ -1,4 +1,4 @@
        -// Copyright 2022 Google LLC
        +// Copyright 2025 Google LLC
         //
         // Licensed under the Apache License, Version 2.0 (the "License");
         // you may not use this file except in compliance with the License.
        diff --git a/java-common-protos/proto-google-common-protos/src/main/proto/google/longrunning/operations.proto b/java-common-protos/proto-google-common-protos/src/main/proto/google/longrunning/operations.proto
        index c1fdc6f529..63df207d25 100644
        --- a/java-common-protos/proto-google-common-protos/src/main/proto/google/longrunning/operations.proto
        +++ b/java-common-protos/proto-google-common-protos/src/main/proto/google/longrunning/operations.proto
        @@ -1,4 +1,4 @@
        -// Copyright 2020 Google LLC
        +// Copyright 2025 Google LLC
         //
         // Licensed under the Apache License, Version 2.0 (the "License");
         // you may not use this file except in compliance with the License.
        @@ -18,18 +18,19 @@ package google.longrunning;
         
         import "google/api/annotations.proto";
         import "google/api/client.proto";
        +import "google/api/field_behavior.proto";
         import "google/protobuf/any.proto";
        +import "google/protobuf/descriptor.proto";
         import "google/protobuf/duration.proto";
         import "google/protobuf/empty.proto";
         import "google/rpc/status.proto";
        -import "google/protobuf/descriptor.proto";
         
        -option cc_enable_arenas = true;
         option csharp_namespace = "Google.LongRunning";
        -option go_package = "google.golang.org/genproto/googleapis/longrunning;longrunning";
        +option go_package = "cloud.google.com/go/longrunning/autogen/longrunningpb;longrunningpb";
         option java_multiple_files = true;
         option java_outer_classname = "OperationsProto";
         option java_package = "com.google.longrunning";
        +option objc_class_prefix = "GLRUN";
         option php_namespace = "Google\\LongRunning";
         
         extend google.protobuf.MethodOptions {
        @@ -45,25 +46,17 @@ extend google.protobuf.MethodOptions {
         // Manages long-running operations with an API service.
         //
         // When an API method normally takes long time to complete, it can be designed
        -// to return [Operation][google.longrunning.Operation] to the client, and the client can use this
        -// interface to receive the real response asynchronously by polling the
        -// operation resource, or pass the operation resource to another API (such as
        -// Google Cloud Pub/Sub API) to receive the response.  Any API service that
        -// returns long-running operations should implement the `Operations` interface
        -// so developers can have a consistent client experience.
        +// to return [Operation][google.longrunning.Operation] to the client, and the
        +// client can use this interface to receive the real response asynchronously by
        +// polling the operation resource, or pass the operation resource to another API
        +// (such as Pub/Sub API) to receive the response.  Any API service that returns
        +// long-running operations should implement the `Operations` interface so
        +// developers can have a consistent client experience.
         service Operations {
           option (google.api.default_host) = "longrunning.googleapis.com";
         
           // Lists operations that match the specified filter in the request. If the
           // server doesn't support this method, it returns `UNIMPLEMENTED`.
        -  //
        -  // NOTE: the `name` binding allows API services to override the binding
        -  // to use different resource name schemes, such as `users/*/operations`. To
        -  // override the binding, API services can add a binding such as
        -  // `"/v1/{name=users/*}/operations"` to their service configuration.
        -  // For backwards compatibility, the default name includes the operations
        -  // collection id, however overriding users must ensure the name binding
        -  // is the parent resource, without the operations collection id.
           rpc ListOperations(ListOperationsRequest) returns (ListOperationsResponse) {
             option (google.api.http) = {
               get: "/v1/{name=operations}"
        @@ -100,8 +93,9 @@ service Operations {
           // other methods to check whether the cancellation succeeded or whether the
           // operation completed despite cancellation. On successful cancellation,
           // the operation is not deleted; instead, it becomes an operation with
        -  // an [Operation.error][google.longrunning.Operation.error] value with a [google.rpc.Status.code][google.rpc.Status.code] of 1,
        -  // corresponding to `Code.CANCELLED`.
        +  // an [Operation.error][google.longrunning.Operation.error] value with a
        +  // [google.rpc.Status.code][google.rpc.Status.code] of `1`, corresponding to
        +  // `Code.CANCELLED`.
           rpc CancelOperation(CancelOperationRequest) returns (google.protobuf.Empty) {
             option (google.api.http) = {
               post: "/v1/{name=operations/**}:cancel"
        @@ -119,8 +113,7 @@ service Operations {
           // Note that this method is on a best-effort basis.  It may return the latest
           // state before the specified timeout (including immediately), meaning even an
           // immediate response is no guarantee that the operation is done.
        -  rpc WaitOperation(WaitOperationRequest) returns (Operation) {
        -  }
        +  rpc WaitOperation(WaitOperationRequest) returns (Operation) {}
         }
         
         // This resource represents a long-running operation that is the result of a
        @@ -144,12 +137,13 @@ message Operation {
         
           // The operation result, which can be either an `error` or a valid `response`.
           // If `done` == `false`, neither `error` nor `response` is set.
        -  // If `done` == `true`, exactly one of `error` or `response` is set.
        +  // If `done` == `true`, exactly one of `error` or `response` can be set.
        +  // Some services might not provide the result.
           oneof result {
             // The error result of the operation in case of failure or cancellation.
             google.rpc.Status error = 4;
         
        -    // The normal response of the operation in case of success.  If the original
        +    // The normal, successful response of the operation.  If the original
             // method returns no data on success, such as `Delete`, the response is
             // `google.protobuf.Empty`.  If the original method is standard
             // `Get`/`Create`/`Update`, the response should be the resource.  For other
        @@ -161,13 +155,15 @@ message Operation {
           }
         }
         
        -// The request message for [Operations.GetOperation][google.longrunning.Operations.GetOperation].
        +// The request message for
        +// [Operations.GetOperation][google.longrunning.Operations.GetOperation].
         message GetOperationRequest {
           // The name of the operation resource.
           string name = 1;
         }
         
        -// The request message for [Operations.ListOperations][google.longrunning.Operations.ListOperations].
        +// The request message for
        +// [Operations.ListOperations][google.longrunning.Operations.ListOperations].
         message ListOperationsRequest {
           // The name of the operation's parent resource.
           string name = 4;
        @@ -180,30 +176,53 @@ message ListOperationsRequest {
         
           // The standard list page token.
           string page_token = 3;
        +
        +  // When set to `true`, operations that are reachable are returned as normal,
        +  // and those that are unreachable are returned in the
        +  // [ListOperationsResponse.unreachable] field.
        +  //
        +  // This can only be `true` when reading across collections e.g. when `parent`
        +  // is set to `"projects/example/locations/-"`.
        +  //
        +  // This field is not by default supported and will result in an
        +  // `UNIMPLEMENTED` error if set unless explicitly documented otherwise in
        +  // service or product specific documentation.
        +  bool return_partial_success = 5;
         }
         
        -// The response message for [Operations.ListOperations][google.longrunning.Operations.ListOperations].
        +// The response message for
        +// [Operations.ListOperations][google.longrunning.Operations.ListOperations].
         message ListOperationsResponse {
           // A list of operations that matches the specified filter in the request.
           repeated Operation operations = 1;
         
           // The standard List next-page token.
           string next_page_token = 2;
        +
        +  // Unordered list. Unreachable resources. Populated when the request sets
        +  // `ListOperationsRequest.return_partial_success` and reads across
        +  // collections e.g. when attempting to list all resources across all supported
        +  // locations.
        +  repeated string unreachable = 3
        +      [(google.api.field_behavior) = UNORDERED_LIST];
         }
         
        -// The request message for [Operations.CancelOperation][google.longrunning.Operations.CancelOperation].
        +// The request message for
        +// [Operations.CancelOperation][google.longrunning.Operations.CancelOperation].
         message CancelOperationRequest {
           // The name of the operation resource to be cancelled.
           string name = 1;
         }
         
        -// The request message for [Operations.DeleteOperation][google.longrunning.Operations.DeleteOperation].
        +// The request message for
        +// [Operations.DeleteOperation][google.longrunning.Operations.DeleteOperation].
         message DeleteOperationRequest {
           // The name of the operation resource to be deleted.
           string name = 1;
         }
         
        -// The request message for [Operations.WaitOperation][google.longrunning.Operations.WaitOperation].
        +// The request message for
        +// [Operations.WaitOperation][google.longrunning.Operations.WaitOperation].
         message WaitOperationRequest {
           // The name of the operation resource to wait on.
           string name = 1;
        @@ -218,13 +237,12 @@ message WaitOperationRequest {
         //
         // Example:
         //
        -//   rpc LongRunningRecognize(LongRunningRecognizeRequest)
        -//       returns (google.longrunning.Operation) {
        -//     option (google.longrunning.operation_info) = {
        -//       response_type: "LongRunningRecognizeResponse"
        -//       metadata_type: "LongRunningRecognizeMetadata"
        -//     };
        -//   }
        +//     rpc Export(ExportRequest) returns (google.longrunning.Operation) {
        +//       option (google.longrunning.operation_info) = {
        +//         response_type: "ExportResponse"
        +//         metadata_type: "ExportMetadata"
        +//       };
        +//     }
         message OperationInfo {
           // Required. The message name of the primary return type for this
           // long-running operation.
        diff --git a/java-common-protos/proto-google-common-protos/src/main/proto/google/rpc/code.proto b/java-common-protos/proto-google-common-protos/src/main/proto/google/rpc/code.proto
        index 98ae0ac18f..aa6ce15378 100644
        --- a/java-common-protos/proto-google-common-protos/src/main/proto/google/rpc/code.proto
        +++ b/java-common-protos/proto-google-common-protos/src/main/proto/google/rpc/code.proto
        @@ -1,4 +1,4 @@
        -// Copyright 2020 Google LLC
        +// Copyright 2025 Google LLC
         //
         // Licensed under the Apache License, Version 2.0 (the "License");
         // you may not use this file except in compliance with the License.
        @@ -30,7 +30,7 @@ option objc_class_prefix = "RPC";
         // `OUT_OF_RANGE` over `FAILED_PRECONDITION` if both codes apply.
         // Similarly prefer `NOT_FOUND` or `ALREADY_EXISTS` over `FAILED_PRECONDITION`.
         enum Code {
        -  // Not an error; returned on success
        +  // Not an error; returned on success.
           //
           // HTTP Mapping: 200 OK
           OK = 0;
        @@ -69,7 +69,7 @@ enum Code {
           // Some requested entity (e.g., file or directory) was not found.
           //
           // Note to server developers: if a request is denied for an entire class
        -  // of users, such as gradual feature rollout or undocumented whitelist,
        +  // of users, such as gradual feature rollout or undocumented allowlist,
           // `NOT_FOUND` may be used. If a request is denied for some users within
           // a class of users, such as user-based access control, `PERMISSION_DENIED`
           // must be used.
        @@ -115,11 +115,11 @@ enum Code {
           // Service implementors can use the following guidelines to decide
           // between `FAILED_PRECONDITION`, `ABORTED`, and `UNAVAILABLE`:
           //  (a) Use `UNAVAILABLE` if the client can retry just the failing call.
        -  //  (b) Use `ABORTED` if the client should retry at a higher level
        -  //      (e.g., when a client-specified test-and-set fails, indicating the
        -  //      client should restart a read-modify-write sequence).
        +  //  (b) Use `ABORTED` if the client should retry at a higher level. For
        +  //      example, when a client-specified test-and-set fails, indicating the
        +  //      client should restart a read-modify-write sequence.
           //  (c) Use `FAILED_PRECONDITION` if the client should not retry until
        -  //      the system state has been explicitly fixed.  E.g., if an "rmdir"
        +  //      the system state has been explicitly fixed. For example, if an "rmdir"
           //      fails because the directory is non-empty, `FAILED_PRECONDITION`
           //      should be returned since the client should not retry unless
           //      the files are deleted from the directory.
        diff --git a/java-common-protos/proto-google-common-protos/src/main/proto/google/rpc/context/attribute_context.proto b/java-common-protos/proto-google-common-protos/src/main/proto/google/rpc/context/attribute_context.proto
        index 30fe6f25ab..5727660091 100644
        --- a/java-common-protos/proto-google-common-protos/src/main/proto/google/rpc/context/attribute_context.proto
        +++ b/java-common-protos/proto-google-common-protos/src/main/proto/google/rpc/context/attribute_context.proto
        @@ -1,4 +1,4 @@
        -// Copyright 2020 Google LLC
        +// Copyright 2025 Google LLC
         //
         // Licensed under the Apache License, Version 2.0 (the "License");
         // you may not use this file except in compliance with the License.
        @@ -61,7 +61,7 @@ message AttributeContext {
         
             // The identity of this peer. Similar to `Request.auth.principal`, but
             // relative to the peer instead of the request. For example, the
        -    // idenity associated with a load balancer that forwared the request.
        +    // identity associated with a load balancer that forwarded the request.
             string principal = 7;
         
             // The CLDR country/region code associated with the above IP address.
        @@ -170,7 +170,7 @@ message AttributeContext {
             // lowercased, because HTTP header keys are case-insensitive.
             map headers = 3;
         
        -    // The HTTP URL path.
        +    // The HTTP URL path, excluding the query parameters.
             string path = 4;
         
             // The HTTP request `Host` header value.
        @@ -223,7 +223,7 @@ message AttributeContext {
             // the response.
             google.protobuf.Timestamp time = 4;
         
        -    // The length of time it takes the backend service to fully respond to a
        +    // The amount of time it takes the backend service to fully respond to a
             // request. Measured from when the destination service starts to send the
             // request to the backend until when the destination service receives the
             // complete response from the backend.
        @@ -256,7 +256,8 @@ message AttributeContext {
             // The type of the resource. The syntax is platform-specific because
             // different platforms define their resources differently.
             //
        -    // For Google APIs, the type format must be "{service}/{kind}".
        +    // For Google APIs, the type format must be "{service}/{kind}", such as
        +    // "pubsub.googleapis.com/Topic".
             string type = 3;
         
             // The labels or tags on the resource, such as AWS resource tags and
        @@ -274,7 +275,8 @@ message AttributeContext {
             // may be set by external tools to store and retrieve arbitrary metadata.
             // They are not queryable and should be preserved when modifying objects.
             //
        -    // More info: https://kubernetes.io/docs/user-guide/annotations
        +    // More info:
        +    // https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/
             map annotations = 6;
         
             // Mutable. The display name set by clients. Must be <= 63 characters.
        diff --git a/java-common-protos/proto-google-common-protos/src/main/proto/google/rpc/context/audit_context.proto b/java-common-protos/proto-google-common-protos/src/main/proto/google/rpc/context/audit_context.proto
        new file mode 100644
        index 0000000000..fddfab22a2
        --- /dev/null
        +++ b/java-common-protos/proto-google-common-protos/src/main/proto/google/rpc/context/audit_context.proto
        @@ -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.
        +
        +syntax = "proto3";
        +
        +package google.rpc.context;
        +
        +import "google/protobuf/struct.proto";
        +
        +option go_package = "google.golang.org/genproto/googleapis/rpc/context;context";
        +option java_multiple_files = true;
        +option java_outer_classname = "AuditContextProto";
        +option java_package = "com.google.rpc.context";
        +
        +// `AuditContext` provides information that is needed for audit logging.
        +message AuditContext {
        +  // Serialized audit log.
        +  bytes audit_log = 1;
        +
        +  // An API request message that is scrubbed based on the method annotation.
        +  // This field should only be filled if audit_log field is present.
        +  // Service Control will use this to assemble a complete log for Cloud Audit
        +  // Logs and Google internal audit logs.
        +  google.protobuf.Struct scrubbed_request = 2;
        +
        +  // An API response message that is scrubbed based on the method annotation.
        +  // This field should only be filled if audit_log field is present.
        +  // Service Control will use this to assemble a complete log for Cloud Audit
        +  // Logs and Google internal audit logs.
        +  google.protobuf.Struct scrubbed_response = 3;
        +
        +  // Number of scrubbed response items.
        +  int32 scrubbed_response_item_count = 4;
        +
        +  // Audit resource name which is scrubbed.
        +  string target_resource = 5;
        +}
        diff --git a/java-common-protos/proto-google-common-protos/src/main/proto/google/rpc/error_details.proto b/java-common-protos/proto-google-common-protos/src/main/proto/google/rpc/error_details.proto
        index c4d6c4b78c..4f9ecff035 100644
        --- a/java-common-protos/proto-google-common-protos/src/main/proto/google/rpc/error_details.proto
        +++ b/java-common-protos/proto-google-common-protos/src/main/proto/google/rpc/error_details.proto
        @@ -1,4 +1,4 @@
        -// Copyright 2020 Google LLC
        +// Copyright 2025 Google LLC
         //
         // Licensed under the Apache License, Version 2.0 (the "License");
         // you may not use this file except in compliance with the License.
        @@ -24,6 +24,58 @@ option java_outer_classname = "ErrorDetailsProto";
         option java_package = "com.google.rpc";
         option objc_class_prefix = "RPC";
         
        +// Describes the cause of the error with structured details.
        +//
        +// Example of an error when contacting the "pubsub.googleapis.com" API when it
        +// is not enabled:
        +//
        +//     { "reason": "API_DISABLED"
        +//       "domain": "googleapis.com"
        +//       "metadata": {
        +//         "resource": "projects/123",
        +//         "service": "pubsub.googleapis.com"
        +//       }
        +//     }
        +//
        +// This response indicates that the pubsub.googleapis.com API is not enabled.
        +//
        +// Example of an error that is returned when attempting to create a Spanner
        +// instance in a region that is out of stock:
        +//
        +//     { "reason": "STOCKOUT"
        +//       "domain": "spanner.googleapis.com",
        +//       "metadata": {
        +//         "availableRegions": "us-central1,us-east2"
        +//       }
        +//     }
        +message ErrorInfo {
        +  // The reason of the error. This is a constant value that identifies the
        +  // proximate cause of the error. Error reasons are unique within a particular
        +  // domain of errors. This should be at most 63 characters and match a
        +  // regular expression of `[A-Z][A-Z0-9_]+[A-Z0-9]`, which represents
        +  // UPPER_SNAKE_CASE.
        +  string reason = 1;
        +
        +  // The logical grouping to which the "reason" belongs. The error domain
        +  // is typically the registered service name of the tool or product that
        +  // generates the error. Example: "pubsub.googleapis.com". If the error is
        +  // generated by some common infrastructure, the error domain must be a
        +  // globally unique value that identifies the infrastructure. For Google API
        +  // infrastructure, the error domain is "googleapis.com".
        +  string domain = 2;
        +
        +  // Additional structured details about this error.
        +  //
        +  // Keys must match a regular expression of `[a-z][a-zA-Z0-9-_]+` but should
        +  // ideally be lowerCamelCase. Also, they must be limited to 64 characters in
        +  // length. When identifying the current value of an exceeded limit, the units
        +  // should be contained in the key, not the value.  For example, rather than
        +  // `{"instanceLimit": "100/request"}`, should be returned as,
        +  // `{"instanceLimitPerRequest": "100"}`, if the client exceeds the number of
        +  // instances that can be created in a single (batch) request.
        +  map metadata = 3;
        +}
        +
         // Describes when the clients can retry a failed request. Clients could ignore
         // the recommendation here or retry when this information is missing from error
         // responses.
        @@ -79,60 +131,75 @@ message QuotaFailure {
             // For example: "Service disabled" or "Daily Limit for read operations
             // exceeded".
             string description = 2;
        -  }
         
        -  // Describes all quota violations.
        -  repeated Violation violations = 1;
        -}
        +    // The API Service from which the `QuotaFailure.Violation` orginates. In
        +    // some cases, Quota issues originate from an API Service other than the one
        +    // that was called. In other words, a dependency of the called API Service
        +    // could be the cause of the `QuotaFailure`, and this field would have the
        +    // dependency API service name.
        +    //
        +    // For example, if the called API is Kubernetes Engine API
        +    // (container.googleapis.com), and a quota violation occurs in the
        +    // Kubernetes Engine API itself, this field would be
        +    // "container.googleapis.com". On the other hand, if the quota violation
        +    // occurs when the Kubernetes Engine API creates VMs in the Compute Engine
        +    // API (compute.googleapis.com), this field would be
        +    // "compute.googleapis.com".
        +    string api_service = 3;
         
        -// Describes the cause of the error with structured details.
        -//
        -// Example of an error when contacting the "pubsub.googleapis.com" API when it
        -// is not enabled:
        -//
        -//     { "reason": "API_DISABLED"
        -//       "domain": "googleapis.com"
        -//       "metadata": {
        -//         "resource": "projects/123",
        -//         "service": "pubsub.googleapis.com"
        -//       }
        -//     }
        -//
        -// This response indicates that the pubsub.googleapis.com API is not enabled.
        -//
        -// Example of an error that is returned when attempting to create a Spanner
        -// instance in a region that is out of stock:
        -//
        -//     { "reason": "STOCKOUT"
        -//       "domain": "spanner.googleapis.com",
        -//       "metadata": {
        -//         "availableRegions": "us-central1,us-east2"
        -//       }
        -//     }
        -message ErrorInfo {
        -  // The reason of the error. This is a constant value that identifies the
        -  // proximate cause of the error. Error reasons are unique within a particular
        -  // domain of errors. This should be at most 63 characters and match
        -  // /[A-Z0-9_]+/.
        -  string reason = 1;
        +    // The metric of the violated quota. A quota metric is a named counter to
        +    // measure usage, such as API requests or CPUs. When an activity occurs in a
        +    // service, such as Virtual Machine allocation, one or more quota metrics
        +    // may be affected.
        +    //
        +    // For example, "compute.googleapis.com/cpus_per_vm_family",
        +    // "storage.googleapis.com/internet_egress_bandwidth".
        +    string quota_metric = 4;
         
        -  // The logical grouping to which the "reason" belongs. The error domain
        -  // is typically the registered service name of the tool or product that
        -  // generates the error. Example: "pubsub.googleapis.com". If the error is
        -  // generated by some common infrastructure, the error domain must be a
        -  // globally unique value that identifies the infrastructure. For Google API
        -  // infrastructure, the error domain is "googleapis.com".
        -  string domain = 2;
        +    // The id of the violated quota. Also know as "limit name", this is the
        +    // unique identifier of a quota in the context of an API service.
        +    //
        +    // For example, "CPUS-PER-VM-FAMILY-per-project-region".
        +    string quota_id = 5;
         
        -  // Additional structured details about this error.
        -  //
        -  // Keys should match /[a-zA-Z0-9-_]/ and be limited to 64 characters in
        -  // length. When identifying the current value of an exceeded limit, the units
        -  // should be contained in the key, not the value.  For example, rather than
        -  // {"instanceLimit": "100/request"}, should be returned as,
        -  // {"instanceLimitPerRequest": "100"}, if the client exceeds the number of
        -  // instances that can be created in a single (batch) request.
        -  map metadata = 3;
        +    // The dimensions of the violated quota. Every non-global quota is enforced
        +    // on a set of dimensions. While quota metric defines what to count, the
        +    // dimensions specify for what aspects the counter should be increased.
        +    //
        +    // For example, the quota "CPUs per region per VM family" enforces a limit
        +    // on the metric "compute.googleapis.com/cpus_per_vm_family" on dimensions
        +    // "region" and "vm_family". And if the violation occurred in region
        +    // "us-central1" and for VM family "n1", the quota_dimensions would be,
        +    //
        +    // {
        +    //   "region": "us-central1",
        +    //   "vm_family": "n1",
        +    // }
        +    //
        +    // When a quota is enforced globally, the quota_dimensions would always be
        +    // empty.
        +    map quota_dimensions = 6;
        +
        +    // The enforced quota value at the time of the `QuotaFailure`.
        +    //
        +    // For example, if the enforced quota value at the time of the
        +    // `QuotaFailure` on the number of CPUs is "10", then the value of this
        +    // field would reflect this quantity.
        +    int64 quota_value = 7;
        +
        +    // The new quota value being rolled out at the time of the violation. At the
        +    // completion of the rollout, this value will be enforced in place of
        +    // quota_value. If no rollout is in progress at the time of the violation,
        +    // this field is not set.
        +    //
        +    // For example, if at the time of the violation a rollout is in progress
        +    // changing the number of CPUs quota from 10 to 20, 20 would be the value of
        +    // this field.
        +    optional int64 future_quota_value = 8;
        +  }
        +
        +  // Describes all quota violations.
        +  repeated Violation violations = 1;
         }
         
         // Describes what preconditions have failed.
        @@ -169,13 +236,59 @@ message PreconditionFailure {
         message BadRequest {
           // A message type used to describe a single bad request field.
           message FieldViolation {
        -    // A path leading to a field in the request body. The value will be a
        +    // A path that leads to a field in the request body. The value will be a
             // sequence of dot-separated identifiers that identify a protocol buffer
        -    // field. E.g., "field_violations.field" would identify this field.
        +    // field.
        +    //
        +    // Consider the following:
        +    //
        +    //     message CreateContactRequest {
        +    //       message EmailAddress {
        +    //         enum Type {
        +    //           TYPE_UNSPECIFIED = 0;
        +    //           HOME = 1;
        +    //           WORK = 2;
        +    //         }
        +    //
        +    //         optional string email = 1;
        +    //         repeated EmailType type = 2;
        +    //       }
        +    //
        +    //       string full_name = 1;
        +    //       repeated EmailAddress email_addresses = 2;
        +    //     }
        +    //
        +    // In this example, in proto `field` could take one of the following values:
        +    //
        +    // * `full_name` for a violation in the `full_name` value
        +    // * `email_addresses[1].email` for a violation in the `email` field of the
        +    //   first `email_addresses` message
        +    // * `email_addresses[3].type[2]` for a violation in the second `type`
        +    //   value in the third `email_addresses` message.
        +    //
        +    // In JSON, the same values are represented as:
        +    //
        +    // * `fullName` for a violation in the `fullName` value
        +    // * `emailAddresses[1].email` for a violation in the `email` field of the
        +    //   first `emailAddresses` message
        +    // * `emailAddresses[3].type[2]` for a violation in the second `type`
        +    //   value in the third `emailAddresses` message.
             string field = 1;
         
             // A description of why the request element is bad.
             string description = 2;
        +
        +    // The reason of the field-level error. This is a constant value that
        +    // identifies the proximate cause of the field-level error. It should
        +    // uniquely identify the type of the FieldViolation within the scope of the
        +    // google.rpc.ErrorInfo.domain. This should be at most 63
        +    // characters and match a regular expression of `[A-Z][A-Z0-9_]+[A-Z0-9]`,
        +    // which represents UPPER_SNAKE_CASE.
        +    string reason = 3;
        +
        +    // Provides a localized error message for field-level errors that is safe to
        +    // return to the API consumer.
        +    LocalizedMessage localized_message = 4;
           }
         
           // Describes all violations in a client request.
        @@ -203,7 +316,8 @@ message ResourceInfo {
         
           // The name of the resource being accessed.  For example, a shared calendar
           // name: "example.com_4fghdhgsrgh@group.calendar.google.com", if the current
        -  // error is [google.rpc.Code.PERMISSION_DENIED][google.rpc.Code.PERMISSION_DENIED].
        +  // error is
        +  // [google.rpc.Code.PERMISSION_DENIED][google.rpc.Code.PERMISSION_DENIED].
           string resource_name = 2;
         
           // The owner of the resource (optional).
        @@ -240,7 +354,7 @@ message Help {
         // which can be attached to an RPC error.
         message LocalizedMessage {
           // The locale used following the specification defined at
        -  // http://www.rfc-editor.org/rfc/bcp/bcp47.txt.
        +  // https://www.rfc-editor.org/rfc/bcp/bcp47.txt.
           // Examples are: "en-US", "fr-CH", "es-MX"
           string locale = 1;
         
        diff --git a/java-common-protos/proto-google-common-protos/src/main/proto/google/rpc/status.proto b/java-common-protos/proto-google-common-protos/src/main/proto/google/rpc/status.proto
        index 3b1f7a932f..dc14c9438c 100644
        --- a/java-common-protos/proto-google-common-protos/src/main/proto/google/rpc/status.proto
        +++ b/java-common-protos/proto-google-common-protos/src/main/proto/google/rpc/status.proto
        @@ -1,4 +1,4 @@
        -// Copyright 2020 Google LLC
        +// Copyright 2025 Google LLC
         //
         // Licensed under the Apache License, Version 2.0 (the "License");
         // you may not use this file except in compliance with the License.
        @@ -33,12 +33,14 @@ option objc_class_prefix = "RPC";
         // You can find out more about this error model and how to work with it in the
         // [API Design Guide](https://cloud.google.com/apis/design/errors).
         message Status {
        -  // The status code, which should be an enum value of [google.rpc.Code][google.rpc.Code].
        +  // The status code, which should be an enum value of
        +  // [google.rpc.Code][google.rpc.Code].
           int32 code = 1;
         
           // A developer-facing error message, which should be in English. Any
           // user-facing error message should be localized and sent in the
        -  // [google.rpc.Status.details][google.rpc.Status.details] field, or localized by the client.
        +  // [google.rpc.Status.details][google.rpc.Status.details] field, or localized
        +  // by the client.
           string message = 2;
         
           // A list of messages that carry the error details.  There is a common set of
        diff --git a/java-common-protos/proto-google-common-protos/src/main/proto/google/shopping/type/types.proto b/java-common-protos/proto-google-common-protos/src/main/proto/google/shopping/type/types.proto
        new file mode 100644
        index 0000000000..962e3345c6
        --- /dev/null
        +++ b/java-common-protos/proto-google-common-protos/src/main/proto/google/shopping/type/types.proto
        @@ -0,0 +1,229 @@
        +// Copyright 2026 Google LLC
        +//
        +// Licensed under the Apache License, Version 2.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.shopping.type;
        +
        +option csharp_namespace = "Google.Shopping.Type";
        +option go_package = "cloud.google.com/go/shopping/type/typepb;typepb";
        +option java_multiple_files = true;
        +option java_outer_classname = "TypesProto";
        +option java_package = "com.google.shopping.type";
        +
        +// The weight represented as the value in string and the unit.
        +message Weight {
        +  // The weight unit.
        +  enum WeightUnit {
        +    // unit unspecified
        +    WEIGHT_UNIT_UNSPECIFIED = 0;
        +
        +    // lb unit.
        +    POUND = 1;
        +
        +    // kg unit.
        +    KILOGRAM = 2;
        +  }
        +
        +  // Required. The weight represented as a number in micros (1 million micros is
        +  // an equivalent to one's currency standard unit, for example, 1 kg = 1000000
        +  // micros).
        +  // This field can also be set as infinity by setting to -1.
        +  // This field only support -1 and positive value.
        +  optional int64 amount_micros = 1;
        +
        +  // Required. The weight unit.
        +  // Acceptable values are: kg and lb
        +  WeightUnit unit = 2;
        +}
        +
        +// The price represented as a number and currency.
        +message Price {
        +  // The price represented as a number in micros (1 million micros is an
        +  // equivalent to one's currency standard unit, for example, 1 USD = 1000000
        +  // micros).
        +  optional int64 amount_micros = 1;
        +
        +  // The currency of the price using three-letter acronyms according to [ISO
        +  // 4217](http://en.wikipedia.org/wiki/ISO_4217).
        +  optional string currency_code = 2;
        +}
        +
        +// A message that represents custom attributes. Exactly one of `value` or
        +// `group_values` must not be empty.
        +message CustomAttribute {
        +  // The name of the attribute.
        +  optional string name = 1;
        +
        +  // The value of the attribute. If `value` is not empty, `group_values` must be
        +  // empty.
        +  optional string value = 2;
        +
        +  // Subattributes within this attribute group.  If
        +  // `group_values` is not empty, `value` must be empty.
        +  repeated CustomAttribute group_values = 3;
        +}
        +
        +// Destinations available for a product.
        +//
        +// Destinations are used in Merchant Center to allow you to control where the
        +// products from your data feed should be displayed.
        +message Destination {
        +  // Destination values.
        +  enum DestinationEnum {
        +    // Not specified.
        +    DESTINATION_ENUM_UNSPECIFIED = 0;
        +
        +    // [Shopping ads](https://support.google.com/google-ads/answer/2454022).
        +    SHOPPING_ADS = 1;
        +
        +    // [Display ads](https://support.google.com/merchants/answer/6069387).
        +    DISPLAY_ADS = 2;
        +
        +    // [Local inventory
        +    // ads](https://support.google.com/merchants/answer/3057972).
        +    LOCAL_INVENTORY_ADS = 3;
        +
        +    // [Free listings](https://support.google.com/merchants/answer/9199328).
        +    FREE_LISTINGS = 4;
        +
        +    // [Free local product
        +    // listings](https://support.google.com/merchants/answer/9825611).
        +    FREE_LOCAL_LISTINGS = 5;
        +
        +    // [YouTube Shopping](https://support.google.com/merchants/answer/12362804).
        +    YOUTUBE_SHOPPING = 6;
        +
        +    // Youtube shopping checkout.
        +    YOUTUBE_SHOPPING_CHECKOUT = 7;
        +
        +    // [Youtube Affiliate](https://support.google.com/youtube/answer/13376398).
        +    YOUTUBE_AFFILIATE = 8;
        +
        +    // [Free vehicle
        +    // listings](https://support.google.com/merchants/answer/11189169).
        +    FREE_VEHICLE_LISTINGS = 9;
        +
        +    // [Vehicle ads](https://support.google.com/merchants/answer/11189169).
        +    VEHICLE_ADS = 10;
        +
        +    // [Cloud retail](https://cloud.google.com/solutions/retail).
        +    CLOUD_RETAIL = 11;
        +
        +    // [Local cloud retail](https://cloud.google.com/solutions/retail).
        +    LOCAL_CLOUD_RETAIL = 12;
        +  }
        +}
        +
        +// Reporting contexts that your account and product issues apply to.
        +//
        +// Reporting contexts are groups of surfaces and formats for product results on
        +// Google. They can represent the entire destination (for example, [Shopping
        +// ads](https://support.google.com/merchants/answer/6149970)) or a subset of
        +// formats within a destination (for example, [Demand Gen
        +// ads](https://support.google.com/merchants/answer/13389785)).
        +message ReportingContext {
        +  // Reporting context values.
        +  enum ReportingContextEnum {
        +    // Not specified.
        +    REPORTING_CONTEXT_ENUM_UNSPECIFIED = 0;
        +
        +    // [Shopping ads](https://support.google.com/merchants/answer/6149970).
        +    SHOPPING_ADS = 1;
        +
        +    // Deprecated:  Use `DEMAND_GEN_ADS` instead.
        +    // [Discovery and Demand Gen
        +    // ads](https://support.google.com/merchants/answer/13389785).
        +    DISCOVERY_ADS = 2 [deprecated = true];
        +
        +    // [Demand Gen ads](https://support.google.com/merchants/answer/13389785).
        +    DEMAND_GEN_ADS = 13;
        +
        +    // [Demand Gen ads on Discover
        +    // surface](https://support.google.com/merchants/answer/13389785).
        +    DEMAND_GEN_ADS_DISCOVER_SURFACE = 14;
        +
        +    // [Video ads](https://support.google.com/google-ads/answer/6340491).
        +    VIDEO_ADS = 3;
        +
        +    // [Display ads](https://support.google.com/merchants/answer/6069387).
        +    DISPLAY_ADS = 4;
        +
        +    // [Local inventory
        +    // ads](https://support.google.com/merchants/answer/3271956).
        +    LOCAL_INVENTORY_ADS = 5;
        +
        +    // [Vehicle inventory
        +    // ads](https://support.google.com/merchants/answer/11544533).
        +    VEHICLE_INVENTORY_ADS = 6;
        +
        +    // [Free product
        +    // listings](https://support.google.com/merchants/answer/9199328).
        +    FREE_LISTINGS = 7;
        +
        +    // [Free product listings on UCP
        +    // checkout](https://developers.google.com/merchant/ucp).
        +    FREE_LISTINGS_UCP_CHECKOUT = 19;
        +
        +    // [Free local product
        +    // listings](https://support.google.com/merchants/answer/9825611).
        +    FREE_LOCAL_LISTINGS = 8;
        +
        +    // [Free local vehicle
        +    // listings](https://support.google.com/merchants/answer/11544533).
        +    FREE_LOCAL_VEHICLE_LISTINGS = 9;
        +
        +    // [Youtube Affiliate](https://support.google.com/youtube/answer/13376398).
        +    YOUTUBE_AFFILIATE = 18;
        +
        +    // [YouTube
        +    // Shopping](https://support.google.com/merchants/answer/13478370).
        +    YOUTUBE_SHOPPING = 10;
        +
        +    // [Cloud retail](https://cloud.google.com/solutions/retail).
        +    CLOUD_RETAIL = 11;
        +
        +    // [Local cloud retail](https://cloud.google.com/solutions/retail).
        +    LOCAL_CLOUD_RETAIL = 12;
        +
        +    // [Product
        +    // Reviews](https://support.google.com/merchants/answer/14620732).
        +    PRODUCT_REVIEWS = 15;
        +
        +    // [Merchant
        +    // Reviews](https://developers.google.com/merchant-review-feeds).
        +    MERCHANT_REVIEWS = 16;
        +
        +    // YouTube Checkout
        +    // .
        +    YOUTUBE_CHECKOUT = 17;
        +  }
        +}
        +
        +// [Channel](https://support.google.com/merchants/answer/7361332) of a product.
        +//
        +// Channel is used to distinguish between online and local products.
        +message Channel {
        +  // Channel values.
        +  enum ChannelEnum {
        +    // Not specified.
        +    CHANNEL_ENUM_UNSPECIFIED = 0;
        +
        +    // Online product.
        +    ONLINE = 1;
        +
        +    // Local product.
        +    LOCAL = 2;
        +  }
        +}
        diff --git a/java-common-protos/proto-google-common-protos/src/main/proto/google/type/calendar_period.proto b/java-common-protos/proto-google-common-protos/src/main/proto/google/type/calendar_period.proto
        index 82f5690b75..57d360add3 100644
        --- a/java-common-protos/proto-google-common-protos/src/main/proto/google/type/calendar_period.proto
        +++ b/java-common-protos/proto-google-common-protos/src/main/proto/google/type/calendar_period.proto
        @@ -1,4 +1,4 @@
        -// Copyright 2021 Google LLC
        +// Copyright 2025 Google LLC
         //
         // Licensed under the Apache License, Version 2.0 (the "License");
         // you may not use this file except in compliance with the License.
        diff --git a/java-common-protos/proto-google-common-protos/src/main/proto/google/type/color.proto b/java-common-protos/proto-google-common-protos/src/main/proto/google/type/color.proto
        index 5dc85a6a38..26508db9fc 100644
        --- a/java-common-protos/proto-google-common-protos/src/main/proto/google/type/color.proto
        +++ b/java-common-protos/proto-google-common-protos/src/main/proto/google/type/color.proto
        @@ -1,4 +1,4 @@
        -// Copyright 2021 Google LLC
        +// Copyright 2025 Google LLC
         //
         // Licensed under the Apache License, Version 2.0 (the "License");
         // you may not use this file except in compliance with the License.
        diff --git a/java-common-protos/proto-google-common-protos/src/main/proto/google/type/date.proto b/java-common-protos/proto-google-common-protos/src/main/proto/google/type/date.proto
        index e4e730e6f5..6f63436e5e 100644
        --- a/java-common-protos/proto-google-common-protos/src/main/proto/google/type/date.proto
        +++ b/java-common-protos/proto-google-common-protos/src/main/proto/google/type/date.proto
        @@ -1,4 +1,4 @@
        -// Copyright 2021 Google LLC
        +// Copyright 2025 Google LLC
         //
         // Licensed under the Apache License, Version 2.0 (the "License");
         // you may not use this file except in compliance with the License.
        diff --git a/java-common-protos/proto-google-common-protos/src/main/proto/google/type/datetime.proto b/java-common-protos/proto-google-common-protos/src/main/proto/google/type/datetime.proto
        index cfed85d70a..9f0d62b069 100644
        --- a/java-common-protos/proto-google-common-protos/src/main/proto/google/type/datetime.proto
        +++ b/java-common-protos/proto-google-common-protos/src/main/proto/google/type/datetime.proto
        @@ -1,4 +1,4 @@
        -// Copyright 2021 Google LLC
        +// Copyright 2025 Google LLC
         //
         // Licensed under the Apache License, Version 2.0 (the "License");
         // you may not use this file except in compliance with the License.
        diff --git a/java-common-protos/proto-google-common-protos/src/main/proto/google/type/dayofweek.proto b/java-common-protos/proto-google-common-protos/src/main/proto/google/type/dayofweek.proto
        index 4c80c62ec0..5684bec35e 100644
        --- a/java-common-protos/proto-google-common-protos/src/main/proto/google/type/dayofweek.proto
        +++ b/java-common-protos/proto-google-common-protos/src/main/proto/google/type/dayofweek.proto
        @@ -1,4 +1,4 @@
        -// Copyright 2021 Google LLC
        +// Copyright 2025 Google LLC
         //
         // Licensed under the Apache License, Version 2.0 (the "License");
         // you may not use this file except in compliance with the License.
        diff --git a/java-common-protos/proto-google-common-protos/src/main/proto/google/type/decimal.proto b/java-common-protos/proto-google-common-protos/src/main/proto/google/type/decimal.proto
        index beb18a5d8d..77a06db0e5 100644
        --- a/java-common-protos/proto-google-common-protos/src/main/proto/google/type/decimal.proto
        +++ b/java-common-protos/proto-google-common-protos/src/main/proto/google/type/decimal.proto
        @@ -1,4 +1,4 @@
        -// Copyright 2021 Google LLC
        +// Copyright 2025 Google LLC
         //
         // Licensed under the Apache License, Version 2.0 (the "License");
         // you may not use this file except in compliance with the License.
        diff --git a/java-common-protos/proto-google-common-protos/src/main/proto/google/type/expr.proto b/java-common-protos/proto-google-common-protos/src/main/proto/google/type/expr.proto
        index af0778cf95..97c4f7da0f 100644
        --- a/java-common-protos/proto-google-common-protos/src/main/proto/google/type/expr.proto
        +++ b/java-common-protos/proto-google-common-protos/src/main/proto/google/type/expr.proto
        @@ -1,4 +1,4 @@
        -// Copyright 2021 Google LLC
        +// Copyright 2025 Google LLC
         //
         // Licensed under the Apache License, Version 2.0 (the "License");
         // you may not use this file except in compliance with the License.
        diff --git a/java-common-protos/proto-google-common-protos/src/main/proto/google/type/fraction.proto b/java-common-protos/proto-google-common-protos/src/main/proto/google/type/fraction.proto
        index 6c5ae6e2a2..b3b0d0f380 100644
        --- a/java-common-protos/proto-google-common-protos/src/main/proto/google/type/fraction.proto
        +++ b/java-common-protos/proto-google-common-protos/src/main/proto/google/type/fraction.proto
        @@ -1,4 +1,4 @@
        -// Copyright 2021 Google LLC
        +// Copyright 2025 Google LLC
         //
         // Licensed under the Apache License, Version 2.0 (the "License");
         // you may not use this file except in compliance with the License.
        diff --git a/java-common-protos/proto-google-common-protos/src/main/proto/google/type/interval.proto b/java-common-protos/proto-google-common-protos/src/main/proto/google/type/interval.proto
        index 9702324cd4..d9b2427145 100644
        --- a/java-common-protos/proto-google-common-protos/src/main/proto/google/type/interval.proto
        +++ b/java-common-protos/proto-google-common-protos/src/main/proto/google/type/interval.proto
        @@ -1,4 +1,4 @@
        -// Copyright 2021 Google LLC
        +// Copyright 2025 Google LLC
         //
         // Licensed under the Apache License, Version 2.0 (the "License");
         // you may not use this file except in compliance with the License.
        diff --git a/java-common-protos/proto-google-common-protos/src/main/proto/google/type/latlng.proto b/java-common-protos/proto-google-common-protos/src/main/proto/google/type/latlng.proto
        index 9231456e32..6714f65bd5 100644
        --- a/java-common-protos/proto-google-common-protos/src/main/proto/google/type/latlng.proto
        +++ b/java-common-protos/proto-google-common-protos/src/main/proto/google/type/latlng.proto
        @@ -1,4 +1,4 @@
        -// Copyright 2021 Google LLC
        +// Copyright 2025 Google LLC
         //
         // Licensed under the Apache License, Version 2.0 (the "License");
         // you may not use this file except in compliance with the License.
        diff --git a/java-common-protos/proto-google-common-protos/src/main/proto/google/type/localized_text.proto b/java-common-protos/proto-google-common-protos/src/main/proto/google/type/localized_text.proto
        index 5c6922b8c0..3971e81116 100644
        --- a/java-common-protos/proto-google-common-protos/src/main/proto/google/type/localized_text.proto
        +++ b/java-common-protos/proto-google-common-protos/src/main/proto/google/type/localized_text.proto
        @@ -1,4 +1,4 @@
        -// Copyright 2021 Google LLC
        +// Copyright 2025 Google LLC
         //
         // Licensed under the Apache License, Version 2.0 (the "License");
         // you may not use this file except in compliance with the License.
        diff --git a/java-common-protos/proto-google-common-protos/src/main/proto/google/type/money.proto b/java-common-protos/proto-google-common-protos/src/main/proto/google/type/money.proto
        index 98d6494e42..f67aa51f0e 100644
        --- a/java-common-protos/proto-google-common-protos/src/main/proto/google/type/money.proto
        +++ b/java-common-protos/proto-google-common-protos/src/main/proto/google/type/money.proto
        @@ -1,4 +1,4 @@
        -// Copyright 2021 Google LLC
        +// Copyright 2025 Google LLC
         //
         // Licensed under the Apache License, Version 2.0 (the "License");
         // you may not use this file except in compliance with the License.
        diff --git a/java-common-protos/proto-google-common-protos/src/main/proto/google/type/month.proto b/java-common-protos/proto-google-common-protos/src/main/proto/google/type/month.proto
        index 99e7551b14..169282ae98 100644
        --- a/java-common-protos/proto-google-common-protos/src/main/proto/google/type/month.proto
        +++ b/java-common-protos/proto-google-common-protos/src/main/proto/google/type/month.proto
        @@ -1,4 +1,4 @@
        -// Copyright 2021 Google LLC
        +// Copyright 2025 Google LLC
         //
         // Licensed under the Apache License, Version 2.0 (the "License");
         // you may not use this file except in compliance with the License.
        diff --git a/java-common-protos/proto-google-common-protos/src/main/proto/google/type/phone_number.proto b/java-common-protos/proto-google-common-protos/src/main/proto/google/type/phone_number.proto
        index 7bbb7d8732..23dbc6bdf1 100644
        --- a/java-common-protos/proto-google-common-protos/src/main/proto/google/type/phone_number.proto
        +++ b/java-common-protos/proto-google-common-protos/src/main/proto/google/type/phone_number.proto
        @@ -1,4 +1,4 @@
        -// Copyright 2021 Google LLC
        +// Copyright 2025 Google LLC
         //
         // Licensed under the Apache License, Version 2.0 (the "License");
         // you may not use this file except in compliance with the License.
        diff --git a/java-common-protos/proto-google-common-protos/src/main/proto/google/type/postal_address.proto b/java-common-protos/proto-google-common-protos/src/main/proto/google/type/postal_address.proto
        index c57c7c31a2..e58d5c3504 100644
        --- a/java-common-protos/proto-google-common-protos/src/main/proto/google/type/postal_address.proto
        +++ b/java-common-protos/proto-google-common-protos/src/main/proto/google/type/postal_address.proto
        @@ -1,4 +1,4 @@
        -// Copyright 2021 Google LLC
        +// Copyright 2025 Google LLC
         //
         // Licensed under the Apache License, Version 2.0 (the "License");
         // you may not use this file except in compliance with the License.
        diff --git a/java-common-protos/proto-google-common-protos/src/main/proto/google/type/quaternion.proto b/java-common-protos/proto-google-common-protos/src/main/proto/google/type/quaternion.proto
        index dfb822deff..18c7b74255 100644
        --- a/java-common-protos/proto-google-common-protos/src/main/proto/google/type/quaternion.proto
        +++ b/java-common-protos/proto-google-common-protos/src/main/proto/google/type/quaternion.proto
        @@ -1,4 +1,4 @@
        -// Copyright 2021 Google LLC
        +// Copyright 2025 Google LLC
         //
         // Licensed under the Apache License, Version 2.0 (the "License");
         // you may not use this file except in compliance with the License.
        diff --git a/java-common-protos/proto-google-common-protos/src/main/proto/google/type/timeofday.proto b/java-common-protos/proto-google-common-protos/src/main/proto/google/type/timeofday.proto
        index 5cb48aa936..cd6a80574b 100644
        --- a/java-common-protos/proto-google-common-protos/src/main/proto/google/type/timeofday.proto
        +++ b/java-common-protos/proto-google-common-protos/src/main/proto/google/type/timeofday.proto
        @@ -1,4 +1,4 @@
        -// Copyright 2021 Google LLC
        +// Copyright 2025 Google LLC
         //
         // Licensed under the Apache License, Version 2.0 (the "License");
         // you may not use this file except in compliance with the License.
        diff --git a/java-common-protos/renovate.json b/java-common-protos/renovate.json
        deleted file mode 100644
        index 642980d5c3..0000000000
        --- a/java-common-protos/renovate.json
        +++ /dev/null
        @@ -1,75 +0,0 @@
        -{
        -  "extends": [
        -    ":separateMajorReleases",
        -    ":combinePatchMinorReleases",
        -    ":ignoreUnstable",
        -    ":prImmediately",
        -    ":updateNotScheduled",
        -    ":automergeDisabled",
        -    ":ignoreModulesAndTests",
        -    ":maintainLockFilesDisabled",
        -    ":autodetectPinVersions"
        -  ],
        -  "ignorePaths": [".kokoro/requirements.txt"],
        -  "packageRules": [
        -    {
        -      "packagePatterns": [
        -        "^com.google.guava:"
        -      ],
        -      "versionScheme": "docker"
        -    },
        -    {
        -      "packagePatterns": [
        -        "*"
        -      ],
        -      "semanticCommitType": "deps",
        -      "semanticCommitScope": null
        -    },
        -    {
        -      "packagePatterns": [
        -        "^org.apache.maven",
        -        "^org.jacoco:",
        -        "^org.codehaus.mojo:",
        -        "^org.sonatype.plugins:",
        -        "^com.coveo:",
        -        "^com.google.cloud:google-cloud-shared-config"
        -      ],
        -      "semanticCommitType": "build",
        -      "semanticCommitScope": "deps"
        -    },
        -    {
        -      "packagePatterns": [
        -        "^com.google.api.grpc:proto-google-common-protos",
        -        "^com.google.cloud:libraries-bom",
        -        "^com.google.cloud.samples:shared-configuration"
        -      ],
        -      "semanticCommitType": "chore",
        -      "semanticCommitScope": "deps"
        -    },
        -    {
        -      "packagePatterns": [
        -        "^junit:junit",
        -        "^com.google.truth:truth",
        -        "^org.mockito:mockito-core",
        -        "^org.objenesis:objenesis",
        -        "^com.google.cloud:google-cloud-conformance-tests"
        -      ],
        -      "semanticCommitType": "test",
        -      "semanticCommitScope": "deps"
        -    },
        -    {
        -      "packagePatterns": [
        -        "^com.google.cloud:google-cloud-"
        -      ],
        -      "ignoreUnstable": false
        -    },
        -    {
        -      "packagePatterns": [
        -        "^com.fasterxml.jackson.core"
        -      ],
        -      "groupName": "jackson dependencies"
        -    }
        -  ],
        -  "semanticCommits": true,
        -  "dependencyDashboard": true
        -}
        diff --git a/java-common-protos/synth.metadata b/java-common-protos/synth.metadata
        deleted file mode 100644
        index 1a268ee46a..0000000000
        --- a/java-common-protos/synth.metadata
        +++ /dev/null
        @@ -1,415 +0,0 @@
        -{
        -  "sources": [
        -    {
        -      "git": {
        -        "name": ".",
        -        "remote": "https://github.com/googleapis/java-common-protos.git",
        -        "sha": "607b1666178627065579d8471f41213d59d7e5d1"
        -      }
        -    },
        -    {
        -      "git": {
        -        "name": "googleapis",
        -        "remote": "https://github.com/googleapis/googleapis.git",
        -        "sha": "2921f9fb3bfbd16f6b2da0104373e2b47a80a65e",
        -        "internalRef": "408420890"
        -      }
        -    },
        -    {
        -      "git": {
        -        "name": "synthtool",
        -        "remote": "https://github.com/googleapis/synthtool.git",
        -        "sha": "7a7c48f96e90d1cdc3ab0cc8293279fdcb10fd36"
        -      }
        -    }
        -  ],
        -  "generatedFiles": [
        -    ".github/CODEOWNERS",
        -    ".github/ISSUE_TEMPLATE/bug_report.md",
        -    ".github/ISSUE_TEMPLATE/feature_request.md",
        -    ".github/ISSUE_TEMPLATE/support_request.md",
        -    ".github/PULL_REQUEST_TEMPLATE.md",
        -    ".github/blunderbuss.yml",
        -    ".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",
        -    ".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/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/graalvm-native.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",
        -    "CONTRIBUTING.md",
        -    "LICENSE",
        -    "SECURITY.md",
        -    "codecov.yaml",
        -    "grpc-google-common-protos/src/main/java/com/google/longrunning/OperationsGrpc.java",
        -    "java.header",
        -    "license-checks.xml",
        -    "proto-google-common-protos/src/main/java/com/google/api/Advice.java",
        -    "proto-google-common-protos/src/main/java/com/google/api/AdviceOrBuilder.java",
        -    "proto-google-common-protos/src/main/java/com/google/api/AnnotationsProto.java",
        -    "proto-google-common-protos/src/main/java/com/google/api/AuthProto.java",
        -    "proto-google-common-protos/src/main/java/com/google/api/AuthProvider.java",
        -    "proto-google-common-protos/src/main/java/com/google/api/AuthProviderOrBuilder.java",
        -    "proto-google-common-protos/src/main/java/com/google/api/AuthRequirement.java",
        -    "proto-google-common-protos/src/main/java/com/google/api/AuthRequirementOrBuilder.java",
        -    "proto-google-common-protos/src/main/java/com/google/api/Authentication.java",
        -    "proto-google-common-protos/src/main/java/com/google/api/AuthenticationOrBuilder.java",
        -    "proto-google-common-protos/src/main/java/com/google/api/AuthenticationRule.java",
        -    "proto-google-common-protos/src/main/java/com/google/api/AuthenticationRuleOrBuilder.java",
        -    "proto-google-common-protos/src/main/java/com/google/api/Backend.java",
        -    "proto-google-common-protos/src/main/java/com/google/api/BackendOrBuilder.java",
        -    "proto-google-common-protos/src/main/java/com/google/api/BackendProto.java",
        -    "proto-google-common-protos/src/main/java/com/google/api/BackendRule.java",
        -    "proto-google-common-protos/src/main/java/com/google/api/BackendRuleOrBuilder.java",
        -    "proto-google-common-protos/src/main/java/com/google/api/Billing.java",
        -    "proto-google-common-protos/src/main/java/com/google/api/BillingOrBuilder.java",
        -    "proto-google-common-protos/src/main/java/com/google/api/BillingProto.java",
        -    "proto-google-common-protos/src/main/java/com/google/api/ChangeType.java",
        -    "proto-google-common-protos/src/main/java/com/google/api/ClientProto.java",
        -    "proto-google-common-protos/src/main/java/com/google/api/ConfigChange.java",
        -    "proto-google-common-protos/src/main/java/com/google/api/ConfigChangeOrBuilder.java",
        -    "proto-google-common-protos/src/main/java/com/google/api/ConfigChangeProto.java",
        -    "proto-google-common-protos/src/main/java/com/google/api/ConsumerProto.java",
        -    "proto-google-common-protos/src/main/java/com/google/api/Context.java",
        -    "proto-google-common-protos/src/main/java/com/google/api/ContextOrBuilder.java",
        -    "proto-google-common-protos/src/main/java/com/google/api/ContextProto.java",
        -    "proto-google-common-protos/src/main/java/com/google/api/ContextRule.java",
        -    "proto-google-common-protos/src/main/java/com/google/api/ContextRuleOrBuilder.java",
        -    "proto-google-common-protos/src/main/java/com/google/api/Control.java",
        -    "proto-google-common-protos/src/main/java/com/google/api/ControlOrBuilder.java",
        -    "proto-google-common-protos/src/main/java/com/google/api/ControlProto.java",
        -    "proto-google-common-protos/src/main/java/com/google/api/CustomHttpPattern.java",
        -    "proto-google-common-protos/src/main/java/com/google/api/CustomHttpPatternOrBuilder.java",
        -    "proto-google-common-protos/src/main/java/com/google/api/Distribution.java",
        -    "proto-google-common-protos/src/main/java/com/google/api/DistributionOrBuilder.java",
        -    "proto-google-common-protos/src/main/java/com/google/api/DistributionProto.java",
        -    "proto-google-common-protos/src/main/java/com/google/api/Documentation.java",
        -    "proto-google-common-protos/src/main/java/com/google/api/DocumentationOrBuilder.java",
        -    "proto-google-common-protos/src/main/java/com/google/api/DocumentationProto.java",
        -    "proto-google-common-protos/src/main/java/com/google/api/DocumentationRule.java",
        -    "proto-google-common-protos/src/main/java/com/google/api/DocumentationRuleOrBuilder.java",
        -    "proto-google-common-protos/src/main/java/com/google/api/Endpoint.java",
        -    "proto-google-common-protos/src/main/java/com/google/api/EndpointOrBuilder.java",
        -    "proto-google-common-protos/src/main/java/com/google/api/EndpointProto.java",
        -    "proto-google-common-protos/src/main/java/com/google/api/ErrorReason.java",
        -    "proto-google-common-protos/src/main/java/com/google/api/ErrorReasonProto.java",
        -    "proto-google-common-protos/src/main/java/com/google/api/FieldBehavior.java",
        -    "proto-google-common-protos/src/main/java/com/google/api/FieldBehaviorProto.java",
        -    "proto-google-common-protos/src/main/java/com/google/api/Http.java",
        -    "proto-google-common-protos/src/main/java/com/google/api/HttpBody.java",
        -    "proto-google-common-protos/src/main/java/com/google/api/HttpBodyOrBuilder.java",
        -    "proto-google-common-protos/src/main/java/com/google/api/HttpBodyProto.java",
        -    "proto-google-common-protos/src/main/java/com/google/api/HttpOrBuilder.java",
        -    "proto-google-common-protos/src/main/java/com/google/api/HttpProto.java",
        -    "proto-google-common-protos/src/main/java/com/google/api/HttpRule.java",
        -    "proto-google-common-protos/src/main/java/com/google/api/HttpRuleOrBuilder.java",
        -    "proto-google-common-protos/src/main/java/com/google/api/JwtLocation.java",
        -    "proto-google-common-protos/src/main/java/com/google/api/JwtLocationOrBuilder.java",
        -    "proto-google-common-protos/src/main/java/com/google/api/LabelDescriptor.java",
        -    "proto-google-common-protos/src/main/java/com/google/api/LabelDescriptorOrBuilder.java",
        -    "proto-google-common-protos/src/main/java/com/google/api/LabelProto.java",
        -    "proto-google-common-protos/src/main/java/com/google/api/LaunchStage.java",
        -    "proto-google-common-protos/src/main/java/com/google/api/LaunchStageProto.java",
        -    "proto-google-common-protos/src/main/java/com/google/api/LogDescriptor.java",
        -    "proto-google-common-protos/src/main/java/com/google/api/LogDescriptorOrBuilder.java",
        -    "proto-google-common-protos/src/main/java/com/google/api/LogProto.java",
        -    "proto-google-common-protos/src/main/java/com/google/api/Logging.java",
        -    "proto-google-common-protos/src/main/java/com/google/api/LoggingOrBuilder.java",
        -    "proto-google-common-protos/src/main/java/com/google/api/LoggingProto.java",
        -    "proto-google-common-protos/src/main/java/com/google/api/Metric.java",
        -    "proto-google-common-protos/src/main/java/com/google/api/MetricDescriptor.java",
        -    "proto-google-common-protos/src/main/java/com/google/api/MetricDescriptorOrBuilder.java",
        -    "proto-google-common-protos/src/main/java/com/google/api/MetricOrBuilder.java",
        -    "proto-google-common-protos/src/main/java/com/google/api/MetricProto.java",
        -    "proto-google-common-protos/src/main/java/com/google/api/MetricRule.java",
        -    "proto-google-common-protos/src/main/java/com/google/api/MetricRuleOrBuilder.java",
        -    "proto-google-common-protos/src/main/java/com/google/api/MonitoredResource.java",
        -    "proto-google-common-protos/src/main/java/com/google/api/MonitoredResourceDescriptor.java",
        -    "proto-google-common-protos/src/main/java/com/google/api/MonitoredResourceDescriptorOrBuilder.java",
        -    "proto-google-common-protos/src/main/java/com/google/api/MonitoredResourceMetadata.java",
        -    "proto-google-common-protos/src/main/java/com/google/api/MonitoredResourceMetadataOrBuilder.java",
        -    "proto-google-common-protos/src/main/java/com/google/api/MonitoredResourceOrBuilder.java",
        -    "proto-google-common-protos/src/main/java/com/google/api/MonitoredResourceProto.java",
        -    "proto-google-common-protos/src/main/java/com/google/api/Monitoring.java",
        -    "proto-google-common-protos/src/main/java/com/google/api/MonitoringOrBuilder.java",
        -    "proto-google-common-protos/src/main/java/com/google/api/MonitoringProto.java",
        -    "proto-google-common-protos/src/main/java/com/google/api/OAuthRequirements.java",
        -    "proto-google-common-protos/src/main/java/com/google/api/OAuthRequirementsOrBuilder.java",
        -    "proto-google-common-protos/src/main/java/com/google/api/Page.java",
        -    "proto-google-common-protos/src/main/java/com/google/api/PageOrBuilder.java",
        -    "proto-google-common-protos/src/main/java/com/google/api/ProjectProperties.java",
        -    "proto-google-common-protos/src/main/java/com/google/api/ProjectPropertiesOrBuilder.java",
        -    "proto-google-common-protos/src/main/java/com/google/api/Property.java",
        -    "proto-google-common-protos/src/main/java/com/google/api/PropertyOrBuilder.java",
        -    "proto-google-common-protos/src/main/java/com/google/api/Quota.java",
        -    "proto-google-common-protos/src/main/java/com/google/api/QuotaLimit.java",
        -    "proto-google-common-protos/src/main/java/com/google/api/QuotaLimitOrBuilder.java",
        -    "proto-google-common-protos/src/main/java/com/google/api/QuotaOrBuilder.java",
        -    "proto-google-common-protos/src/main/java/com/google/api/QuotaProto.java",
        -    "proto-google-common-protos/src/main/java/com/google/api/ResourceDescriptor.java",
        -    "proto-google-common-protos/src/main/java/com/google/api/ResourceDescriptorOrBuilder.java",
        -    "proto-google-common-protos/src/main/java/com/google/api/ResourceProto.java",
        -    "proto-google-common-protos/src/main/java/com/google/api/ResourceReference.java",
        -    "proto-google-common-protos/src/main/java/com/google/api/ResourceReferenceOrBuilder.java",
        -    "proto-google-common-protos/src/main/java/com/google/api/RoutingParameter.java",
        -    "proto-google-common-protos/src/main/java/com/google/api/RoutingParameterOrBuilder.java",
        -    "proto-google-common-protos/src/main/java/com/google/api/RoutingProto.java",
        -    "proto-google-common-protos/src/main/java/com/google/api/RoutingRule.java",
        -    "proto-google-common-protos/src/main/java/com/google/api/RoutingRuleOrBuilder.java",
        -    "proto-google-common-protos/src/main/java/com/google/api/Service.java",
        -    "proto-google-common-protos/src/main/java/com/google/api/ServiceOrBuilder.java",
        -    "proto-google-common-protos/src/main/java/com/google/api/ServiceProto.java",
        -    "proto-google-common-protos/src/main/java/com/google/api/SourceInfo.java",
        -    "proto-google-common-protos/src/main/java/com/google/api/SourceInfoOrBuilder.java",
        -    "proto-google-common-protos/src/main/java/com/google/api/SourceInfoProto.java",
        -    "proto-google-common-protos/src/main/java/com/google/api/SystemParameter.java",
        -    "proto-google-common-protos/src/main/java/com/google/api/SystemParameterOrBuilder.java",
        -    "proto-google-common-protos/src/main/java/com/google/api/SystemParameterProto.java",
        -    "proto-google-common-protos/src/main/java/com/google/api/SystemParameterRule.java",
        -    "proto-google-common-protos/src/main/java/com/google/api/SystemParameterRuleOrBuilder.java",
        -    "proto-google-common-protos/src/main/java/com/google/api/SystemParameters.java",
        -    "proto-google-common-protos/src/main/java/com/google/api/SystemParametersOrBuilder.java",
        -    "proto-google-common-protos/src/main/java/com/google/api/Usage.java",
        -    "proto-google-common-protos/src/main/java/com/google/api/UsageOrBuilder.java",
        -    "proto-google-common-protos/src/main/java/com/google/api/UsageProto.java",
        -    "proto-google-common-protos/src/main/java/com/google/api/UsageRule.java",
        -    "proto-google-common-protos/src/main/java/com/google/api/UsageRuleOrBuilder.java",
        -    "proto-google-common-protos/src/main/java/com/google/api/Visibility.java",
        -    "proto-google-common-protos/src/main/java/com/google/api/VisibilityOrBuilder.java",
        -    "proto-google-common-protos/src/main/java/com/google/api/VisibilityProto.java",
        -    "proto-google-common-protos/src/main/java/com/google/api/VisibilityRule.java",
        -    "proto-google-common-protos/src/main/java/com/google/api/VisibilityRuleOrBuilder.java",
        -    "proto-google-common-protos/src/main/java/com/google/cloud/ExtendedOperationsProto.java",
        -    "proto-google-common-protos/src/main/java/com/google/cloud/OperationResponseMapping.java",
        -    "proto-google-common-protos/src/main/java/com/google/cloud/audit/AuditLog.java",
        -    "proto-google-common-protos/src/main/java/com/google/cloud/audit/AuditLogOrBuilder.java",
        -    "proto-google-common-protos/src/main/java/com/google/cloud/audit/AuditLogProto.java",
        -    "proto-google-common-protos/src/main/java/com/google/cloud/audit/AuthenticationInfo.java",
        -    "proto-google-common-protos/src/main/java/com/google/cloud/audit/AuthenticationInfoOrBuilder.java",
        -    "proto-google-common-protos/src/main/java/com/google/cloud/audit/AuthorizationInfo.java",
        -    "proto-google-common-protos/src/main/java/com/google/cloud/audit/AuthorizationInfoOrBuilder.java",
        -    "proto-google-common-protos/src/main/java/com/google/cloud/audit/BigQueryAuditMetadata.java",
        -    "proto-google-common-protos/src/main/java/com/google/cloud/audit/BigQueryAuditMetadataOrBuilder.java",
        -    "proto-google-common-protos/src/main/java/com/google/cloud/audit/BigQueryAuditMetadataProto.java",
        -    "proto-google-common-protos/src/main/java/com/google/cloud/audit/RequestMetadata.java",
        -    "proto-google-common-protos/src/main/java/com/google/cloud/audit/RequestMetadataOrBuilder.java",
        -    "proto-google-common-protos/src/main/java/com/google/cloud/audit/ResourceLocation.java",
        -    "proto-google-common-protos/src/main/java/com/google/cloud/audit/ResourceLocationOrBuilder.java",
        -    "proto-google-common-protos/src/main/java/com/google/cloud/audit/ServiceAccountDelegationInfo.java",
        -    "proto-google-common-protos/src/main/java/com/google/cloud/audit/ServiceAccountDelegationInfoOrBuilder.java",
        -    "proto-google-common-protos/src/main/java/com/google/geo/type/Viewport.java",
        -    "proto-google-common-protos/src/main/java/com/google/geo/type/ViewportOrBuilder.java",
        -    "proto-google-common-protos/src/main/java/com/google/geo/type/ViewportProto.java",
        -    "proto-google-common-protos/src/main/java/com/google/logging/type/HttpRequest.java",
        -    "proto-google-common-protos/src/main/java/com/google/logging/type/HttpRequestOrBuilder.java",
        -    "proto-google-common-protos/src/main/java/com/google/logging/type/HttpRequestProto.java",
        -    "proto-google-common-protos/src/main/java/com/google/logging/type/LogSeverity.java",
        -    "proto-google-common-protos/src/main/java/com/google/logging/type/LogSeverityProto.java",
        -    "proto-google-common-protos/src/main/java/com/google/longrunning/CancelOperationRequest.java",
        -    "proto-google-common-protos/src/main/java/com/google/longrunning/CancelOperationRequestOrBuilder.java",
        -    "proto-google-common-protos/src/main/java/com/google/longrunning/DeleteOperationRequest.java",
        -    "proto-google-common-protos/src/main/java/com/google/longrunning/DeleteOperationRequestOrBuilder.java",
        -    "proto-google-common-protos/src/main/java/com/google/longrunning/GetOperationRequest.java",
        -    "proto-google-common-protos/src/main/java/com/google/longrunning/GetOperationRequestOrBuilder.java",
        -    "proto-google-common-protos/src/main/java/com/google/longrunning/ListOperationsRequest.java",
        -    "proto-google-common-protos/src/main/java/com/google/longrunning/ListOperationsRequestOrBuilder.java",
        -    "proto-google-common-protos/src/main/java/com/google/longrunning/ListOperationsResponse.java",
        -    "proto-google-common-protos/src/main/java/com/google/longrunning/ListOperationsResponseOrBuilder.java",
        -    "proto-google-common-protos/src/main/java/com/google/longrunning/Operation.java",
        -    "proto-google-common-protos/src/main/java/com/google/longrunning/OperationInfo.java",
        -    "proto-google-common-protos/src/main/java/com/google/longrunning/OperationInfoOrBuilder.java",
        -    "proto-google-common-protos/src/main/java/com/google/longrunning/OperationOrBuilder.java",
        -    "proto-google-common-protos/src/main/java/com/google/longrunning/OperationsProto.java",
        -    "proto-google-common-protos/src/main/java/com/google/longrunning/WaitOperationRequest.java",
        -    "proto-google-common-protos/src/main/java/com/google/longrunning/WaitOperationRequestOrBuilder.java",
        -    "proto-google-common-protos/src/main/java/com/google/rpc/BadRequest.java",
        -    "proto-google-common-protos/src/main/java/com/google/rpc/BadRequestOrBuilder.java",
        -    "proto-google-common-protos/src/main/java/com/google/rpc/Code.java",
        -    "proto-google-common-protos/src/main/java/com/google/rpc/CodeProto.java",
        -    "proto-google-common-protos/src/main/java/com/google/rpc/DebugInfo.java",
        -    "proto-google-common-protos/src/main/java/com/google/rpc/DebugInfoOrBuilder.java",
        -    "proto-google-common-protos/src/main/java/com/google/rpc/ErrorDetailsProto.java",
        -    "proto-google-common-protos/src/main/java/com/google/rpc/ErrorInfo.java",
        -    "proto-google-common-protos/src/main/java/com/google/rpc/ErrorInfoOrBuilder.java",
        -    "proto-google-common-protos/src/main/java/com/google/rpc/Help.java",
        -    "proto-google-common-protos/src/main/java/com/google/rpc/HelpOrBuilder.java",
        -    "proto-google-common-protos/src/main/java/com/google/rpc/LocalizedMessage.java",
        -    "proto-google-common-protos/src/main/java/com/google/rpc/LocalizedMessageOrBuilder.java",
        -    "proto-google-common-protos/src/main/java/com/google/rpc/PreconditionFailure.java",
        -    "proto-google-common-protos/src/main/java/com/google/rpc/PreconditionFailureOrBuilder.java",
        -    "proto-google-common-protos/src/main/java/com/google/rpc/QuotaFailure.java",
        -    "proto-google-common-protos/src/main/java/com/google/rpc/QuotaFailureOrBuilder.java",
        -    "proto-google-common-protos/src/main/java/com/google/rpc/RequestInfo.java",
        -    "proto-google-common-protos/src/main/java/com/google/rpc/RequestInfoOrBuilder.java",
        -    "proto-google-common-protos/src/main/java/com/google/rpc/ResourceInfo.java",
        -    "proto-google-common-protos/src/main/java/com/google/rpc/ResourceInfoOrBuilder.java",
        -    "proto-google-common-protos/src/main/java/com/google/rpc/RetryInfo.java",
        -    "proto-google-common-protos/src/main/java/com/google/rpc/RetryInfoOrBuilder.java",
        -    "proto-google-common-protos/src/main/java/com/google/rpc/Status.java",
        -    "proto-google-common-protos/src/main/java/com/google/rpc/StatusOrBuilder.java",
        -    "proto-google-common-protos/src/main/java/com/google/rpc/StatusProto.java",
        -    "proto-google-common-protos/src/main/java/com/google/rpc/context/AttributeContext.java",
        -    "proto-google-common-protos/src/main/java/com/google/rpc/context/AttributeContextOrBuilder.java",
        -    "proto-google-common-protos/src/main/java/com/google/rpc/context/AttributeContextProto.java",
        -    "proto-google-common-protos/src/main/java/com/google/type/CalendarPeriod.java",
        -    "proto-google-common-protos/src/main/java/com/google/type/CalendarPeriodProto.java",
        -    "proto-google-common-protos/src/main/java/com/google/type/Color.java",
        -    "proto-google-common-protos/src/main/java/com/google/type/ColorOrBuilder.java",
        -    "proto-google-common-protos/src/main/java/com/google/type/ColorProto.java",
        -    "proto-google-common-protos/src/main/java/com/google/type/Date.java",
        -    "proto-google-common-protos/src/main/java/com/google/type/DateOrBuilder.java",
        -    "proto-google-common-protos/src/main/java/com/google/type/DateProto.java",
        -    "proto-google-common-protos/src/main/java/com/google/type/DateTime.java",
        -    "proto-google-common-protos/src/main/java/com/google/type/DateTimeOrBuilder.java",
        -    "proto-google-common-protos/src/main/java/com/google/type/DateTimeProto.java",
        -    "proto-google-common-protos/src/main/java/com/google/type/DayOfWeek.java",
        -    "proto-google-common-protos/src/main/java/com/google/type/DayOfWeekProto.java",
        -    "proto-google-common-protos/src/main/java/com/google/type/Decimal.java",
        -    "proto-google-common-protos/src/main/java/com/google/type/DecimalOrBuilder.java",
        -    "proto-google-common-protos/src/main/java/com/google/type/DecimalProto.java",
        -    "proto-google-common-protos/src/main/java/com/google/type/Expr.java",
        -    "proto-google-common-protos/src/main/java/com/google/type/ExprOrBuilder.java",
        -    "proto-google-common-protos/src/main/java/com/google/type/ExprProto.java",
        -    "proto-google-common-protos/src/main/java/com/google/type/Fraction.java",
        -    "proto-google-common-protos/src/main/java/com/google/type/FractionOrBuilder.java",
        -    "proto-google-common-protos/src/main/java/com/google/type/FractionProto.java",
        -    "proto-google-common-protos/src/main/java/com/google/type/Interval.java",
        -    "proto-google-common-protos/src/main/java/com/google/type/IntervalOrBuilder.java",
        -    "proto-google-common-protos/src/main/java/com/google/type/IntervalProto.java",
        -    "proto-google-common-protos/src/main/java/com/google/type/LatLng.java",
        -    "proto-google-common-protos/src/main/java/com/google/type/LatLngOrBuilder.java",
        -    "proto-google-common-protos/src/main/java/com/google/type/LatLngProto.java",
        -    "proto-google-common-protos/src/main/java/com/google/type/LocalizedText.java",
        -    "proto-google-common-protos/src/main/java/com/google/type/LocalizedTextOrBuilder.java",
        -    "proto-google-common-protos/src/main/java/com/google/type/LocalizedTextProto.java",
        -    "proto-google-common-protos/src/main/java/com/google/type/Money.java",
        -    "proto-google-common-protos/src/main/java/com/google/type/MoneyOrBuilder.java",
        -    "proto-google-common-protos/src/main/java/com/google/type/MoneyProto.java",
        -    "proto-google-common-protos/src/main/java/com/google/type/Month.java",
        -    "proto-google-common-protos/src/main/java/com/google/type/MonthProto.java",
        -    "proto-google-common-protos/src/main/java/com/google/type/PhoneNumber.java",
        -    "proto-google-common-protos/src/main/java/com/google/type/PhoneNumberOrBuilder.java",
        -    "proto-google-common-protos/src/main/java/com/google/type/PhoneNumberProto.java",
        -    "proto-google-common-protos/src/main/java/com/google/type/PostalAddress.java",
        -    "proto-google-common-protos/src/main/java/com/google/type/PostalAddressOrBuilder.java",
        -    "proto-google-common-protos/src/main/java/com/google/type/PostalAddressProto.java",
        -    "proto-google-common-protos/src/main/java/com/google/type/Quaternion.java",
        -    "proto-google-common-protos/src/main/java/com/google/type/QuaternionOrBuilder.java",
        -    "proto-google-common-protos/src/main/java/com/google/type/QuaternionProto.java",
        -    "proto-google-common-protos/src/main/java/com/google/type/TimeOfDay.java",
        -    "proto-google-common-protos/src/main/java/com/google/type/TimeOfDayOrBuilder.java",
        -    "proto-google-common-protos/src/main/java/com/google/type/TimeOfDayProto.java",
        -    "proto-google-common-protos/src/main/java/com/google/type/TimeZone.java",
        -    "proto-google-common-protos/src/main/java/com/google/type/TimeZoneOrBuilder.java",
        -    "proto-google-common-protos/src/main/proto/google/api/annotations.proto",
        -    "proto-google-common-protos/src/main/proto/google/api/auth.proto",
        -    "proto-google-common-protos/src/main/proto/google/api/backend.proto",
        -    "proto-google-common-protos/src/main/proto/google/api/billing.proto",
        -    "proto-google-common-protos/src/main/proto/google/api/client.proto",
        -    "proto-google-common-protos/src/main/proto/google/api/config_change.proto",
        -    "proto-google-common-protos/src/main/proto/google/api/consumer.proto",
        -    "proto-google-common-protos/src/main/proto/google/api/context.proto",
        -    "proto-google-common-protos/src/main/proto/google/api/control.proto",
        -    "proto-google-common-protos/src/main/proto/google/api/distribution.proto",
        -    "proto-google-common-protos/src/main/proto/google/api/documentation.proto",
        -    "proto-google-common-protos/src/main/proto/google/api/endpoint.proto",
        -    "proto-google-common-protos/src/main/proto/google/api/error_reason.proto",
        -    "proto-google-common-protos/src/main/proto/google/api/field_behavior.proto",
        -    "proto-google-common-protos/src/main/proto/google/api/http.proto",
        -    "proto-google-common-protos/src/main/proto/google/api/httpbody.proto",
        -    "proto-google-common-protos/src/main/proto/google/api/label.proto",
        -    "proto-google-common-protos/src/main/proto/google/api/launch_stage.proto",
        -    "proto-google-common-protos/src/main/proto/google/api/log.proto",
        -    "proto-google-common-protos/src/main/proto/google/api/logging.proto",
        -    "proto-google-common-protos/src/main/proto/google/api/metric.proto",
        -    "proto-google-common-protos/src/main/proto/google/api/monitored_resource.proto",
        -    "proto-google-common-protos/src/main/proto/google/api/monitoring.proto",
        -    "proto-google-common-protos/src/main/proto/google/api/quota.proto",
        -    "proto-google-common-protos/src/main/proto/google/api/resource.proto",
        -    "proto-google-common-protos/src/main/proto/google/api/routing.proto",
        -    "proto-google-common-protos/src/main/proto/google/api/service.proto",
        -    "proto-google-common-protos/src/main/proto/google/api/source_info.proto",
        -    "proto-google-common-protos/src/main/proto/google/api/system_parameter.proto",
        -    "proto-google-common-protos/src/main/proto/google/api/usage.proto",
        -    "proto-google-common-protos/src/main/proto/google/api/visibility.proto",
        -    "proto-google-common-protos/src/main/proto/google/cloud/audit/audit_log.proto",
        -    "proto-google-common-protos/src/main/proto/google/cloud/audit/bigquery_audit_metadata.proto",
        -    "proto-google-common-protos/src/main/proto/google/cloud/common_resources.proto",
        -    "proto-google-common-protos/src/main/proto/google/cloud/extended_operations.proto",
        -    "proto-google-common-protos/src/main/proto/google/geo/type/viewport.proto",
        -    "proto-google-common-protos/src/main/proto/google/logging/type/http_request.proto",
        -    "proto-google-common-protos/src/main/proto/google/logging/type/log_severity.proto",
        -    "proto-google-common-protos/src/main/proto/google/longrunning/operations.proto",
        -    "proto-google-common-protos/src/main/proto/google/rpc/code.proto",
        -    "proto-google-common-protos/src/main/proto/google/rpc/context/attribute_context.proto",
        -    "proto-google-common-protos/src/main/proto/google/rpc/error_details.proto",
        -    "proto-google-common-protos/src/main/proto/google/rpc/status.proto",
        -    "proto-google-common-protos/src/main/proto/google/type/calendar_period.proto",
        -    "proto-google-common-protos/src/main/proto/google/type/color.proto",
        -    "proto-google-common-protos/src/main/proto/google/type/date.proto",
        -    "proto-google-common-protos/src/main/proto/google/type/datetime.proto",
        -    "proto-google-common-protos/src/main/proto/google/type/dayofweek.proto",
        -    "proto-google-common-protos/src/main/proto/google/type/decimal.proto",
        -    "proto-google-common-protos/src/main/proto/google/type/expr.proto",
        -    "proto-google-common-protos/src/main/proto/google/type/fraction.proto",
        -    "proto-google-common-protos/src/main/proto/google/type/interval.proto",
        -    "proto-google-common-protos/src/main/proto/google/type/latlng.proto",
        -    "proto-google-common-protos/src/main/proto/google/type/localized_text.proto",
        -    "proto-google-common-protos/src/main/proto/google/type/money.proto",
        -    "proto-google-common-protos/src/main/proto/google/type/month.proto",
        -    "proto-google-common-protos/src/main/proto/google/type/phone_number.proto",
        -    "proto-google-common-protos/src/main/proto/google/type/postal_address.proto",
        -    "proto-google-common-protos/src/main/proto/google/type/quaternion.proto",
        -    "proto-google-common-protos/src/main/proto/google/type/timeofday.proto",
        -    "renovate.json"
        -  ]
        -}
        \ No newline at end of file
        diff --git a/java-core/.repo-metadata.json b/java-core/.repo-metadata.json
        new file mode 100644
        index 0000000000..125e818f5e
        --- /dev/null
        +++ b/java-core/.repo-metadata.json
        @@ -0,0 +1,13 @@
        +{
        +  "api_shortname": "google-cloud-core",
        +  "product_documentation": "https://github.com/googleapis/sdk-platform-java/tree/main/java-core",
        +  "client_documentation": "https://cloud.google.com/java/docs/reference/google-cloud-core/latest/overview",
        +  "api_description": "A set of classes and utilities used in Google Cloud Java libraries.",
        +  "name_pretty": "Google Cloud Core",
        +  "release_level": "stable",
        +  "language": "java",
        +  "repo": "googleapis/sdk-platform-java",
        +  "repo_short": "java-core",
        +  "library_type": "CORE",
        +  "distribution_name": "com.google.cloud:google-cloud-core"
        +}
        diff --git a/java-core/CHANGELOG.md b/java-core/CHANGELOG.md
        new file mode 100644
        index 0000000000..59ea2dd72f
        --- /dev/null
        +++ b/java-core/CHANGELOG.md
        @@ -0,0 +1,1277 @@
        +# Changelog
        +
        +## [2.9.4](https://github.com/googleapis/java-core/compare/v2.9.3...v2.9.4) (2023-01-20)
        +
        +
        +### Bug Fixes
        +
        +* **java:** Skip fixing poms for special modules ([#1744](https://github.com/googleapis/java-core/issues/1744)) ([#1080](https://github.com/googleapis/java-core/issues/1080)) ([db2cc2f](https://github.com/googleapis/java-core/commit/db2cc2fcd03342948c6c4e753d012d08000e7733))
        +
        +## [2.9.3](https://github.com/googleapis/java-core/compare/v2.9.2...v2.9.3) (2023-01-19)
        +
        +
        +### Dependencies
        +
        +* Update dependency com.google.api:api-common to v2.5.0 ([#1083](https://github.com/googleapis/java-core/issues/1083)) ([dc3e6c7](https://github.com/googleapis/java-core/commit/dc3e6c713f3b65b59a0d814cddd1509583db081c))
        +* Update dependency com.google.api:gax-bom to v2.22.0 ([#1084](https://github.com/googleapis/java-core/issues/1084)) ([5b94330](https://github.com/googleapis/java-core/commit/5b94330a90920f106e70a0ec7823026c3c87d55e))
        +* Update dependency com.google.api.grpc:proto-google-common-protos to v2.13.0 ([#1081](https://github.com/googleapis/java-core/issues/1081)) ([d4bfd0e](https://github.com/googleapis/java-core/commit/d4bfd0efea78e3266f237fbb620ab5441abf0003))
        +* Update dependency com.google.api.grpc:proto-google-iam-v1 to v1.8.0 ([#1082](https://github.com/googleapis/java-core/issues/1082)) ([bbda002](https://github.com/googleapis/java-core/commit/bbda002fc193af2b6a52fae54f1238c5ce66dc6e))
        +
        +## [2.9.2](https://github.com/googleapis/java-core/compare/v2.9.1...v2.9.2) (2023-01-18)
        +
        +
        +### Dependencies
        +
        +* Update dependency io.grpc:grpc-bom to v1.52.1 ([#1073](https://github.com/googleapis/java-core/issues/1073)) ([a45ec31](https://github.com/googleapis/java-core/commit/a45ec316782d2d2a1d3af149f338daf028d94206))
        +
        +## [2.9.1](https://github.com/googleapis/java-core/compare/v2.9.0...v2.9.1) (2023-01-09)
        +
        +
        +### Bug Fixes
        +
        +* Make title and description of Condition Nullable ([#1063](https://github.com/googleapis/java-core/issues/1063)) ([1238462](https://github.com/googleapis/java-core/commit/12384628ab07b7edb04181c79ed07e742277e4c4))
        +
        +
        +### Documentation
        +
        +* Update javadocs for ReadChannel to be more clear about the behavior ([#1050](https://github.com/googleapis/java-core/issues/1050)) ([8b574f6](https://github.com/googleapis/java-core/commit/8b574f66c6e77b31ec8d544319a116f5c19804b9))
        +
        +
        +### Dependencies
        +
        +* Update dependency com.google.api-client:google-api-client-bom to v2.1.2 ([#1064](https://github.com/googleapis/java-core/issues/1064)) ([6bf1c24](https://github.com/googleapis/java-core/commit/6bf1c2414978340cb997acb18e98815e20028718))
        +* Update dependency com.google.api:api-common to v2.3.1 ([#1053](https://github.com/googleapis/java-core/issues/1053)) ([43ce490](https://github.com/googleapis/java-core/commit/43ce49083ebdfada11732ff82aa407c69311f4c9))
        +* Update dependency com.google.api:api-common to v2.4.0 ([#1069](https://github.com/googleapis/java-core/issues/1069)) ([083bc07](https://github.com/googleapis/java-core/commit/083bc071f4529cd2a827cd4586e5c02690f4ffcd))
        +* Update dependency com.google.api:gax-bom to v2.21.0 ([#1070](https://github.com/googleapis/java-core/issues/1070)) ([e133832](https://github.com/googleapis/java-core/commit/e133832eb6e81089745e21d9b0188cb91af0a51b))
        +* Update dependency com.google.api.grpc:proto-google-common-protos to v2.12.0 ([#1067](https://github.com/googleapis/java-core/issues/1067)) ([bfab3ad](https://github.com/googleapis/java-core/commit/bfab3adbcefea538d50d567297eb491650ad19ba))
        +* Update dependency com.google.api.grpc:proto-google-iam-v1 to v1.6.23 ([#1060](https://github.com/googleapis/java-core/issues/1060)) ([a2e5c4e](https://github.com/googleapis/java-core/commit/a2e5c4eb35824ee019b0d0b8f984144f07d76c0a))
        +* Update dependency com.google.api.grpc:proto-google-iam-v1 to v1.7.0 ([#1068](https://github.com/googleapis/java-core/issues/1068)) ([404f222](https://github.com/googleapis/java-core/commit/404f2220ea85253945f470a6370870cce248c11e))
        +* Update dependency com.google.auth:google-auth-library-bom to v1.14.0 ([#1056](https://github.com/googleapis/java-core/issues/1056)) ([328628d](https://github.com/googleapis/java-core/commit/328628da55cea6d27c4fe4ed2aaa14bf2bc59a58))
        +* Update dependency com.google.code.gson:gson to v2.10.1 ([#1066](https://github.com/googleapis/java-core/issues/1066)) ([a4b941e](https://github.com/googleapis/java-core/commit/a4b941e8daed4650bd019a7c03602cd617bdcad2))
        +* Update dependency com.google.errorprone:error_prone_annotations to v2.17.0 ([#1061](https://github.com/googleapis/java-core/issues/1061)) ([e7159c2](https://github.com/googleapis/java-core/commit/e7159c28eb4882395cc351d3dbd29db74a75c271))
        +* Update dependency com.google.errorprone:error_prone_annotations to v2.18.0 ([#1071](https://github.com/googleapis/java-core/issues/1071)) ([b85690f](https://github.com/googleapis/java-core/commit/b85690fdcf0803502412bf5af418c17b43a718e7))
        +* Update dependency com.google.protobuf:protobuf-bom to v3.21.12 ([#1054](https://github.com/googleapis/java-core/issues/1054)) ([3fc149e](https://github.com/googleapis/java-core/commit/3fc149e28a8724b100717c0ddfb138338401fea9))
        +* Update dependency io.grpc:grpc-bom to v1.51.1 ([#1058](https://github.com/googleapis/java-core/issues/1058)) ([d8ca14c](https://github.com/googleapis/java-core/commit/d8ca14cdb10d5af41396b40702a4abd7c9b5b15c))
        +* Update dependency org.easymock:easymock to v5.1.0 ([#1062](https://github.com/googleapis/java-core/issues/1062)) ([4c0095d](https://github.com/googleapis/java-core/commit/4c0095daa0a17564c972434e4824c03b2204e3e0))
        +* Update dependency org.threeten:threetenbp to v1.6.5 ([#1052](https://github.com/googleapis/java-core/issues/1052)) ([7e12b5d](https://github.com/googleapis/java-core/commit/7e12b5d137db97d95320416cd80e467bb300c499))
        +
        +## [2.9.0](https://github.com/googleapis/java-core/compare/v2.8.28...v2.9.0) (2022-12-05)
        +
        +
        +### Features
        +
        +* Next release from main branch is 2.9.0 ([#1018](https://github.com/googleapis/java-core/issues/1018)) ([e53bf16](https://github.com/googleapis/java-core/commit/e53bf165791149ae4bcbe8ab21f14d8c6331680c))
        +* Support get CREDENTIAL_ENV_NAME from properties ([#782](https://github.com/googleapis/java-core/issues/782)) ([2bb7d57](https://github.com/googleapis/java-core/commit/2bb7d576a3da2185a9756c7b4f5386bf67824d1d))
        +
        +
        +### Dependencies
        +
        +* Update dependency com.google.api-client:google-api-client-bom to v2.1.1 ([#1045](https://github.com/googleapis/java-core/issues/1045)) ([c957f18](https://github.com/googleapis/java-core/commit/c957f1882a93cadc19964912ab57eb8119ccf529))
        +* Update dependency com.google.api:gax-bom to v2.20.1 ([#1049](https://github.com/googleapis/java-core/issues/1049)) ([46af789](https://github.com/googleapis/java-core/commit/46af7892e49c5967e2fcd82bca21332cad5b5458))
        +* Update dependency com.google.api.grpc:proto-google-common-protos to v2.11.0 ([#1046](https://github.com/googleapis/java-core/issues/1046)) ([b0d785a](https://github.com/googleapis/java-core/commit/b0d785a0c77c193a8fdc25f4b43ed26ac1b478bc))
        +* Update dependency com.google.api.grpc:proto-google-iam-v1 to v1.6.10 ([#1028](https://github.com/googleapis/java-core/issues/1028)) ([399899a](https://github.com/googleapis/java-core/commit/399899a4a1bcffb4bdbf5ee2898b5f6050ea00a6))
        +* Update dependency com.google.api.grpc:proto-google-iam-v1 to v1.6.11 ([#1029](https://github.com/googleapis/java-core/issues/1029)) ([0e33024](https://github.com/googleapis/java-core/commit/0e3302464ff613fa082d6f165155d6a825cf4294))
        +* Update dependency com.google.api.grpc:proto-google-iam-v1 to v1.6.12 ([#1031](https://github.com/googleapis/java-core/issues/1031)) ([3705e63](https://github.com/googleapis/java-core/commit/3705e63d3291f4d0d9c6346f32c43f209983e801))
        +* Update dependency com.google.api.grpc:proto-google-iam-v1 to v1.6.13 ([#1033](https://github.com/googleapis/java-core/issues/1033)) ([3256faa](https://github.com/googleapis/java-core/commit/3256faa6301939492a07d2c5d02d3a5eb3c75c5e))
        +* Update dependency com.google.api.grpc:proto-google-iam-v1 to v1.6.14 ([#1034](https://github.com/googleapis/java-core/issues/1034)) ([03d481b](https://github.com/googleapis/java-core/commit/03d481be4aa7e4885acc6fb204f92606a514db0f))
        +* Update dependency com.google.api.grpc:proto-google-iam-v1 to v1.6.15 ([#1035](https://github.com/googleapis/java-core/issues/1035)) ([a0f1915](https://github.com/googleapis/java-core/commit/a0f191579b61db1cfa984d9aba56a293c577f56e))
        +* Update dependency com.google.api.grpc:proto-google-iam-v1 to v1.6.16 ([#1036](https://github.com/googleapis/java-core/issues/1036)) ([d236920](https://github.com/googleapis/java-core/commit/d236920a6ddbbac523db19534f5944d38a5feed2))
        +* Update dependency com.google.api.grpc:proto-google-iam-v1 to v1.6.17 ([#1037](https://github.com/googleapis/java-core/issues/1037)) ([c06c8e1](https://github.com/googleapis/java-core/commit/c06c8e19cbf7f8e2e4fe387a685cc36fc8be674d))
        +* Update dependency com.google.api.grpc:proto-google-iam-v1 to v1.6.18 ([#1040](https://github.com/googleapis/java-core/issues/1040)) ([2baec55](https://github.com/googleapis/java-core/commit/2baec55331fa1e74a9199adcb7eb44b7ac886a6e))
        +* Update dependency com.google.api.grpc:proto-google-iam-v1 to v1.6.20 ([#1041](https://github.com/googleapis/java-core/issues/1041)) ([ee64ef7](https://github.com/googleapis/java-core/commit/ee64ef76995061a238957705405b56f4bd4870f9))
        +* Update dependency com.google.api.grpc:proto-google-iam-v1 to v1.6.21 ([#1042](https://github.com/googleapis/java-core/issues/1042)) ([df6f385](https://github.com/googleapis/java-core/commit/df6f3857871604663626dbbe6b262fc8b3db1dc3))
        +* Update dependency com.google.api.grpc:proto-google-iam-v1 to v1.6.22 ([#1043](https://github.com/googleapis/java-core/issues/1043)) ([84c3820](https://github.com/googleapis/java-core/commit/84c382042cedc934cc571b32de7aa058ac025e9e))
        +* Update dependency com.google.api.grpc:proto-google-iam-v1 to v1.6.9 ([#1024](https://github.com/googleapis/java-core/issues/1024)) ([3bb2fae](https://github.com/googleapis/java-core/commit/3bb2fae3c4c96301985f2e4c51d0a6bc9d737341))
        +* Update dependency com.google.auth:google-auth-library-bom to v1.13.0 ([#1030](https://github.com/googleapis/java-core/issues/1030)) ([799e584](https://github.com/googleapis/java-core/commit/799e584645fb03c96f7e93156770c9afa631eff6))
        +* Update dependency com.google.protobuf:protobuf-bom to v3.21.10 ([#1048](https://github.com/googleapis/java-core/issues/1048)) ([ea0d8d4](https://github.com/googleapis/java-core/commit/ea0d8d4ce7732353506d70c9c16ee6c2d9f01b23))
        +* Update dependency io.grpc:grpc-bom to v1.51.0 ([#1032](https://github.com/googleapis/java-core/issues/1032)) ([2572bcc](https://github.com/googleapis/java-core/commit/2572bcc6f62e713009ebcb4c41a2e5ec4ba57707))
        +
        +## [2.8.28](https://github.com/googleapis/java-core/compare/v2.8.27...v2.8.28) (2022-11-09)
        +
        +
        +### Dependencies
        +
        +* Update dependency com.google.api.grpc:proto-google-iam-v1 to v1.6.8 ([#1020](https://github.com/googleapis/java-core/issues/1020)) ([e8b3608](https://github.com/googleapis/java-core/commit/e8b360836633345db0a8010590cf9a9753e1a1f9))
        +
        +## [2.8.27](https://github.com/googleapis/java-core/compare/v2.8.26...v2.8.27) (2022-11-07)
        +
        +
        +### Dependencies
        +
        +* Update dependency com.google.api:gax-bom to v2.19.5 ([#1014](https://github.com/googleapis/java-core/issues/1014)) ([00753f8](https://github.com/googleapis/java-core/commit/00753f88745ad0232658b634aadf5250c6daad01))
        +
        +## [2.8.26](https://github.com/googleapis/java-core/compare/v2.8.25...v2.8.26) (2022-11-07)
        +
        +
        +### Dependencies
        +
        +* Update dependency com.google.api-client:google-api-client-bom to v2.0.1 ([#1011](https://github.com/googleapis/java-core/issues/1011)) ([e52b05c](https://github.com/googleapis/java-core/commit/e52b05c0b4973258d7d783af725182d5ba834c25))
        +* Update dependency com.google.api.grpc:proto-google-common-protos to v2.10.0 ([#1010](https://github.com/googleapis/java-core/issues/1010)) ([db9d19e](https://github.com/googleapis/java-core/commit/db9d19e9e760bef0c543f7e5da6af172a7ceca06))
        +* Update dependency com.google.api.grpc:proto-google-iam-v1 to v1.6.7 ([#1005](https://github.com/googleapis/java-core/issues/1005)) ([45513e6](https://github.com/googleapis/java-core/commit/45513e639543ca2025d4c4c4cd84f5735c067443))
        +
        +## [2.8.25](https://github.com/googleapis/java-core/compare/v2.8.24...v2.8.25) (2022-10-31)
        +
        +
        +### Dependencies
        +
        +* Update dependency com.google.api:api-common to v2.2.2 ([#999](https://github.com/googleapis/java-core/issues/999)) ([e639a64](https://github.com/googleapis/java-core/commit/e639a641c3041c829b8e58eeed79df6352e1c7eb))
        +* Update dependency com.google.http-client:google-http-client-bom to v1.42.3 ([#1001](https://github.com/googleapis/java-core/issues/1001)) ([8e35c4f](https://github.com/googleapis/java-core/commit/8e35c4ffe5c12f0e4e570b04d0563640c688eb91))
        +* Update dependency com.google.protobuf:protobuf-bom to v3.21.9 ([#998](https://github.com/googleapis/java-core/issues/998)) ([ce2d265](https://github.com/googleapis/java-core/commit/ce2d265669cd8fb43d1de43f02c53384c1d73a0d))
        +* Update dependency org.threeten:threetenbp to v1.6.4 ([#1003](https://github.com/googleapis/java-core/issues/1003)) ([a69f122](https://github.com/googleapis/java-core/commit/a69f122b6bd84f6a3ddb496f77a1aa1fba072d13))
        +
        +## [2.8.24](https://github.com/googleapis/java-core/compare/v2.8.23...v2.8.24) (2022-10-26)
        +
        +
        +### Dependencies
        +
        +* Update dependency com.google.api.grpc:proto-google-iam-v1 to v1.6.6 ([#994](https://github.com/googleapis/java-core/issues/994)) ([8a7b330](https://github.com/googleapis/java-core/commit/8a7b3304f714261501c64180abfc94edaa86d9d4))
        +* Update dependency com.google.code.gson:gson to v2.10 ([#995](https://github.com/googleapis/java-core/issues/995)) ([5b947a2](https://github.com/googleapis/java-core/commit/5b947a2486979ba26175753fcf054ba3d4904b35))
        +
        +## [2.8.23](https://github.com/googleapis/java-core/compare/v2.8.22...v2.8.23) (2022-10-24)
        +
        +
        +### Dependencies
        +
        +* Update dependency io.grpc:grpc-bom to v1.50.2 ([#990](https://github.com/googleapis/java-core/issues/990)) ([42b1081](https://github.com/googleapis/java-core/commit/42b108100173041925cc705f596f388bab26d954))
        +* Update dependency org.easymock:easymock to v5 ([#980](https://github.com/googleapis/java-core/issues/980)) ([64be350](https://github.com/googleapis/java-core/commit/64be350d3713af1a95ca51997194a15c7292f7ae))
        +
        +## [2.8.22](https://github.com/googleapis/java-core/compare/v2.8.21...v2.8.22) (2022-10-19)
        +
        +
        +### Dependencies
        +
        +* Update dependency com.google.api:gax-bom to v2.19.4 ([#987](https://github.com/googleapis/java-core/issues/987)) ([70a959b](https://github.com/googleapis/java-core/commit/70a959bd01884ec4e9ec4705a25442bf06e9bb73))
        +* Update dependency com.google.api.grpc:proto-google-iam-v1 to v1.6.4 ([#976](https://github.com/googleapis/java-core/issues/976)) ([ddf887f](https://github.com/googleapis/java-core/commit/ddf887fa35872299c1b65cd03934595a89c2ab4c))
        +* Update dependency com.google.auth:google-auth-library-bom to v1.12.0 ([#981](https://github.com/googleapis/java-core/issues/981)) ([87c5616](https://github.com/googleapis/java-core/commit/87c5616ff8a5c4e96ff761b25cf1423505bdc4e2))
        +* Update dependency com.google.auth:google-auth-library-bom to v1.12.1 ([#983](https://github.com/googleapis/java-core/issues/983)) ([ddf787a](https://github.com/googleapis/java-core/commit/ddf787a470a8f4b8416b09bf3bb656f249b1caf5))
        +* Update dependency com.google.errorprone:error_prone_annotations to v2.16 ([#977](https://github.com/googleapis/java-core/issues/977)) ([6f9f78e](https://github.com/googleapis/java-core/commit/6f9f78ef38d586e1cded056451658b77c5a093b7))
        +* Update dependency com.google.protobuf:protobuf-bom to v3.21.8 ([#984](https://github.com/googleapis/java-core/issues/984)) ([234c9a7](https://github.com/googleapis/java-core/commit/234c9a7788c32692b1e7f9686a6b7329d758acb9))
        +* Update dependency io.grpc:grpc-bom to v1.50.0 ([#978](https://github.com/googleapis/java-core/issues/978)) ([024fb77](https://github.com/googleapis/java-core/commit/024fb77b67b4a0f9d8dfcd8315376a0b4937a0da))
        +* Update dependency io.grpc:grpc-bom to v1.50.1 ([#985](https://github.com/googleapis/java-core/issues/985)) ([8b71163](https://github.com/googleapis/java-core/commit/8b71163725178ffcbbaae21c6d1fc530be77b9b4))
        +* Update dependency org.threeten:threetenbp to v1.6.3 ([#979](https://github.com/googleapis/java-core/issues/979)) ([f51ea92](https://github.com/googleapis/java-core/commit/f51ea92c8bd1ebe0c7a2796d435cceafd037ce06))
        +
        +## [2.8.21](https://github.com/googleapis/java-core/compare/v2.8.20...v2.8.21) (2022-10-10)
        +
        +
        +### Dependencies
        +
        +* Update dependency com.google.api.grpc:proto-google-iam-v1 to v1.6.2 ([#971](https://github.com/googleapis/java-core/issues/971)) ([5d778fc](https://github.com/googleapis/java-core/commit/5d778fc0d78e67cbcc4eb061da3b66dd3cab440e))
        +* Update dependency com.google.api.grpc:proto-google-iam-v1 to v1.6.3 ([#974](https://github.com/googleapis/java-core/issues/974)) ([1b7fcb9](https://github.com/googleapis/java-core/commit/1b7fcb978da55f8d30cf66941bc8208853fef116))
        +
        +## [2.8.20](https://github.com/googleapis/java-core/compare/v2.8.19...v2.8.20) (2022-10-02)
        +
        +
        +### Dependencies
        +
        +* Update dependency com.google.api:gax-bom to v2.19.2 ([#969](https://github.com/googleapis/java-core/issues/969)) ([1151449](https://github.com/googleapis/java-core/commit/1151449c061ab51c45982444db5f9da9d2ce4fb7))
        +* Update dependency com.google.api.grpc:proto-google-common-protos to v2.9.6 ([#967](https://github.com/googleapis/java-core/issues/967)) ([4a7b524](https://github.com/googleapis/java-core/commit/4a7b524fa366484825bedbc0a4f86d4551a6a0e8))
        +* Update dependency io.grpc:grpc-bom to v1.49.2 ([#966](https://github.com/googleapis/java-core/issues/966)) ([b7738aa](https://github.com/googleapis/java-core/commit/b7738aa71fb9cf0994e4ad1dae4bae433754cda0))
        +
        +## [2.8.19](https://github.com/googleapis/java-core/compare/v2.8.18...v2.8.19) (2022-09-30)
        +
        +
        +### Dependencies
        +
        +* Update dependency com.google.api.grpc:proto-google-common-protos to v2.9.5 ([#963](https://github.com/googleapis/java-core/issues/963)) ([1ee2f9a](https://github.com/googleapis/java-core/commit/1ee2f9acd3968b21974a550b6732fe68b18085f4))
        +
        +## [2.8.18](https://github.com/googleapis/java-core/compare/v2.8.17...v2.8.18) (2022-09-30)
        +
        +
        +### Dependencies
        +
        +* Update dependency com.google.protobuf:protobuf-bom to v3.21.7 ([#960](https://github.com/googleapis/java-core/issues/960)) ([1fcd95f](https://github.com/googleapis/java-core/commit/1fcd95f2401b66a79383bd79729595334493b0e4))
        +
        +## [2.8.17](https://github.com/googleapis/java-core/compare/v2.8.16...v2.8.17) (2022-09-28)
        +
        +
        +### Dependencies
        +
        +* Update dependency cachetools to v5 ([#943](https://github.com/googleapis/java-core/issues/943)) ([c6c511d](https://github.com/googleapis/java-core/commit/c6c511d82534e96fe5b42ad9e4886aaa18efaef3))
        +* Update dependency certifi to v2022.9.24 ([#934](https://github.com/googleapis/java-core/issues/934)) ([c756885](https://github.com/googleapis/java-core/commit/c75688575c3c19d0d8a1a2b25c6fe3eb99c229cb))
        +* Update dependency charset-normalizer to v2.1.1 ([#938](https://github.com/googleapis/java-core/issues/938)) ([1520f65](https://github.com/googleapis/java-core/commit/1520f65cf6655aed9767d9470e3729a0fc270b9e))
        +* Update dependency click to v8.1.3 ([#946](https://github.com/googleapis/java-core/issues/946)) ([6f7a7f5](https://github.com/googleapis/java-core/commit/6f7a7f5f318a7c3586fa79a7a0013bca562b059e))
        +* Update dependency com.google.api.grpc:proto-google-common-protos to v2.9.4 ([#945](https://github.com/googleapis/java-core/issues/945)) ([307e406](https://github.com/googleapis/java-core/commit/307e40688d55af3cb96e38972af6035cf846c595))
        +* Update dependency gcp-releasetool to v1.8.8 ([#935](https://github.com/googleapis/java-core/issues/935)) ([a5ba3b8](https://github.com/googleapis/java-core/commit/a5ba3b8d6bc43734bb01b0ba04e11b5262db526b))
        +* Update dependency google-api-core to v2.10.1 ([#947](https://github.com/googleapis/java-core/issues/947)) ([1f3da64](https://github.com/googleapis/java-core/commit/1f3da6450b1a5093aadaa9f299fc797773cc8480))
        +* Update dependency google-auth to v2.12.0 ([#948](https://github.com/googleapis/java-core/issues/948)) ([361da3d](https://github.com/googleapis/java-core/commit/361da3dcaecadd708546447737c5a7c1d9799834))
        +* Update dependency google-cloud-core to v2.3.2 ([#936](https://github.com/googleapis/java-core/issues/936)) ([99c0013](https://github.com/googleapis/java-core/commit/99c001309e1f72b84c41b7df55ff26c9f182863a))
        +* Update dependency google-cloud-storage to v2.5.0 ([#949](https://github.com/googleapis/java-core/issues/949)) ([cd6cbfb](https://github.com/googleapis/java-core/commit/cd6cbfb3b1c45e2f55d51edee74621a7dbe06401))
        +* Update dependency google-crc32c to v1.5.0 ([#950](https://github.com/googleapis/java-core/issues/950)) ([abd5ff9](https://github.com/googleapis/java-core/commit/abd5ff9321304b1238f4dd6fa0b4dd57665b46cc))
        +* Update dependency googleapis-common-protos to v1.56.4 ([#937](https://github.com/googleapis/java-core/issues/937)) ([bd7d676](https://github.com/googleapis/java-core/commit/bd7d676c3f221b59768815ccca000c7763aeb7f9))
        +* Update dependency importlib-metadata to v4.12.0 ([#951](https://github.com/googleapis/java-core/issues/951)) ([f0d1fe8](https://github.com/googleapis/java-core/commit/f0d1fe8cc2079216b95d8fd24a46de5161801b35))
        +* Update dependency jeepney to v0.8.0 ([#952](https://github.com/googleapis/java-core/issues/952)) ([342614b](https://github.com/googleapis/java-core/commit/342614b1275877fb41e8241f0c6061286989df13))
        +* Update dependency jinja2 to v3.1.2 ([#953](https://github.com/googleapis/java-core/issues/953)) ([a1542bf](https://github.com/googleapis/java-core/commit/a1542bf8938a72c85b20f97e642dde3666ea0b04))
        +* Update dependency keyring to v23.9.3 ([#954](https://github.com/googleapis/java-core/issues/954)) ([34bbdae](https://github.com/googleapis/java-core/commit/34bbdaeb312cce804d92d6b041e3098b8a6c04bc))
        +* Update dependency markupsafe to v2.1.1 ([#955](https://github.com/googleapis/java-core/issues/955)) ([cb444b0](https://github.com/googleapis/java-core/commit/cb444b0d274af29ffa3076bd89c42acedf514749))
        +* Update dependency protobuf to v3.20.2 ([#956](https://github.com/googleapis/java-core/issues/956)) ([949b4fe](https://github.com/googleapis/java-core/commit/949b4feab38e8b0f0b32ae80067dc07da5a2a383))
        +* Update dependency protobuf to v4 ([#944](https://github.com/googleapis/java-core/issues/944)) ([9d379e2](https://github.com/googleapis/java-core/commit/9d379e202dd8bedf0c3bbaab3d3ba593813285d9))
        +* Update dependency pyjwt to v2.5.0 ([#939](https://github.com/googleapis/java-core/issues/939)) ([bd4896e](https://github.com/googleapis/java-core/commit/bd4896ed5d0413472ae100b60e5f632506214a97))
        +* Update dependency requests to v2.28.1 ([#940](https://github.com/googleapis/java-core/issues/940)) ([f64fef9](https://github.com/googleapis/java-core/commit/f64fef9ef365b43e1ec195db312862000db18627))
        +* Update dependency typing-extensions to v4.3.0 ([#941](https://github.com/googleapis/java-core/issues/941)) ([3b8f163](https://github.com/googleapis/java-core/commit/3b8f163789f5cb11a4b461411cb7c1e132439449))
        +* Update dependency zipp to v3.8.1 ([#942](https://github.com/googleapis/java-core/issues/942)) ([96ccc51](https://github.com/googleapis/java-core/commit/96ccc51c7107fbbcea6564cdf71fcedb05364761))
        +
        +## [2.8.16](https://github.com/googleapis/java-core/compare/v2.8.15...v2.8.16) (2022-09-26)
        +
        +
        +### Dependencies
        +
        +* Update dependency org.threeten:threetenbp to v1.6.2 ([#929](https://github.com/googleapis/java-core/issues/929)) ([2f797f9](https://github.com/googleapis/java-core/commit/2f797f990eacc112dd982e7a8f9155bc229b7bf3))
        +
        +## [2.8.15](https://github.com/googleapis/java-core/compare/v2.8.14...v2.8.15) (2022-09-23)
        +
        +
        +### Dependencies
        +
        +* Update dependency com.google.api.grpc:proto-google-iam-v1 to v1.6.0 ([#925](https://github.com/googleapis/java-core/issues/925)) ([a5475c5](https://github.com/googleapis/java-core/commit/a5475c5333ca97392c9e64a883826ea1bd976a01))
        +* Update dependency com.google.api.grpc:proto-google-iam-v1 to v1.6.1 ([#926](https://github.com/googleapis/java-core/issues/926)) ([3bc96fb](https://github.com/googleapis/java-core/commit/3bc96fbba4907d4ac3d24915870132fed596c0d3))
        +
        +## [2.8.14](https://github.com/googleapis/java-core/compare/v2.8.13...v2.8.14) (2022-09-20)
        +
        +
        +### Dependencies
        +
        +* Update dependency com.google.api.grpc:proto-google-common-protos to v2.9.3 ([#922](https://github.com/googleapis/java-core/issues/922)) ([96b5b4e](https://github.com/googleapis/java-core/commit/96b5b4e00004c28cd2d726c2161e94778f6a1c01))
        +
        +## [2.8.13](https://github.com/googleapis/java-core/compare/v2.8.12...v2.8.13) (2022-09-20)
        +
        +
        +### Dependencies
        +
        +* Update dependency io.grpc:grpc-bom to v1.49.1 ([#919](https://github.com/googleapis/java-core/issues/919)) ([2d481ba](https://github.com/googleapis/java-core/commit/2d481ba500e247d8fee49abe30a9eb84bdcc8d07))
        +
        +## [2.8.12](https://github.com/googleapis/java-core/compare/v2.8.11...v2.8.12) (2022-09-14)
        +
        +
        +### Dependencies
        +
        +* Update dependency com.google.api:gax-bom to v2.19.1 ([#915](https://github.com/googleapis/java-core/issues/915)) ([2647fde](https://github.com/googleapis/java-core/commit/2647fdee8e2b168f3364af8e76abfe2903578b29))
        +* Update dependency com.google.protobuf:protobuf-bom to v3.21.6 ([#916](https://github.com/googleapis/java-core/issues/916)) ([a7db234](https://github.com/googleapis/java-core/commit/a7db234800481ffba71d3222542971dbcd212d8e))
        +
        +## [2.8.11](https://github.com/googleapis/java-core/compare/v2.8.10...v2.8.11) (2022-09-08)
        +
        +
        +### Dependencies
        +
        +* Update dependency com.google.auth:google-auth-library-bom to v1.11.0 ([#911](https://github.com/googleapis/java-core/issues/911)) ([4656905](https://github.com/googleapis/java-core/commit/4656905956504e4bc4fe224d1f8cd70bbab614d8))
        +
        +## [2.8.10](https://github.com/googleapis/java-core/compare/v2.8.9...v2.8.10) (2022-08-24)
        +
        +
        +### Dependencies
        +
        +* update dependency com.google.api:gax-bom to v2.19.0 ([#907](https://github.com/googleapis/java-core/issues/907)) ([51b824c](https://github.com/googleapis/java-core/commit/51b824c225fd7095138e1ec2b6d47af4e2a34352))
        +* update dependency io.grpc:grpc-bom to v1.49.0 ([#908](https://github.com/googleapis/java-core/issues/908)) ([fbccd2d](https://github.com/googleapis/java-core/commit/fbccd2daceb0984c7cb95f84f89a116e54bf4ddc))
        +
        +## [2.8.9](https://github.com/googleapis/java-core/compare/v2.8.8...v2.8.9) (2022-08-16)
        +
        +
        +### Dependencies
        +
        +* update dependency com.google.auth:google-auth-library-bom to v1.10.0 ([#900](https://github.com/googleapis/java-core/issues/900)) ([c01b47a](https://github.com/googleapis/java-core/commit/c01b47a122a9036f8c594cb583dab3512a257597))
        +* update dependency com.google.protobuf:protobuf-bom to v3.21.5 ([#901](https://github.com/googleapis/java-core/issues/901)) ([13e2fd6](https://github.com/googleapis/java-core/commit/13e2fd6fbae1d34385ec500aaf4a2b38e19dd6de))
        +* update dependency org.threeten:threetenbp to v1.6.1 ([#902](https://github.com/googleapis/java-core/issues/902)) ([02dac62](https://github.com/googleapis/java-core/commit/02dac62784a6614291836917b022a32745312157))
        +
        +## [2.8.8](https://github.com/googleapis/java-core/compare/v2.8.7...v2.8.8) (2022-08-04)
        +
        +
        +### Dependencies
        +
        +* update dependency com.google.errorprone:error_prone_annotations to v2.15.0 ([#897](https://github.com/googleapis/java-core/issues/897)) ([29e4fc9](https://github.com/googleapis/java-core/commit/29e4fc93d5d4d50f7de85eae7a8150314cca6f43))
        +
        +## [2.8.7](https://github.com/googleapis/java-core/compare/v2.8.6...v2.8.7) (2022-08-03)
        +
        +
        +### Dependencies
        +
        +* update dependency com.google.auth:google-auth-library-bom to v1.9.0 ([#894](https://github.com/googleapis/java-core/issues/894)) ([82aaa16](https://github.com/googleapis/java-core/commit/82aaa16cd9813984a0c92d944eb1ad956759a8e5))
        +* update dependency io.grpc:grpc-bom to v1.48.1 ([#891](https://github.com/googleapis/java-core/issues/891)) ([0b0f9b8](https://github.com/googleapis/java-core/commit/0b0f9b89757b801e8334c764644d7b66032d36d1))
        +
        +## [2.8.6](https://github.com/googleapis/java-core/compare/v2.8.5...v2.8.6) (2022-08-02)
        +
        +
        +### Dependencies
        +
        +* update dependency com.google.api:gax-bom to v2.18.7 ([#890](https://github.com/googleapis/java-core/issues/890)) ([c67bed5](https://github.com/googleapis/java-core/commit/c67bed5281b458e78780cdd918235b5d073917c7))
        +* update dependency com.google.code.gson:gson to v2.9.1 ([#888](https://github.com/googleapis/java-core/issues/888)) ([7b799c6](https://github.com/googleapis/java-core/commit/7b799c66f4aaf057242e9a231b920e49a7c964e9))
        +
        +## [2.8.5](https://github.com/googleapis/java-core/compare/v2.8.4...v2.8.5) (2022-07-29)
        +
        +
        +### Dependencies
        +
        +* update dependency com.google.api:gax-bom to v2.18.6 ([#885](https://github.com/googleapis/java-core/issues/885)) ([7fa028c](https://github.com/googleapis/java-core/commit/7fa028c0e78bd21583c8687582da24834bd54449))
        +
        +## [2.8.4](https://github.com/googleapis/java-core/compare/v2.8.3...v2.8.4) (2022-07-27)
        +
        +
        +### Documentation
        +
        +* update javadocs for ReadChannel#limit to be more clear ([#880](https://github.com/googleapis/java-core/issues/880)) ([c7de4e2](https://github.com/googleapis/java-core/commit/c7de4e2871d6a32cacc7aab69d826f3afd6301ef))
        +
        +
        +### Dependencies
        +
        +* Update google-cloud-shared-config to v1.5.3 ([#882](https://github.com/googleapis/java-core/issues/882)) ([aabb0b4](https://github.com/googleapis/java-core/commit/aabb0b42076f8a02e7b31d604add567fa909df6c))
        +
        +## [2.8.3](https://github.com/googleapis/java-core/compare/v2.8.2...v2.8.3) (2022-07-26)
        +
        +
        +### Dependencies
        +
        +* update dependency com.google.api-client:google-api-client-bom to v2 ([#868](https://github.com/googleapis/java-core/issues/868)) ([e117c40](https://github.com/googleapis/java-core/commit/e117c40f31acf16a45bdbeeb727ba26d80eb6a51))
        +* update dependency com.google.api:gax-bom to v2.18.4 ([#864](https://github.com/googleapis/java-core/issues/864)) ([bd40b1d](https://github.com/googleapis/java-core/commit/bd40b1d1b36cdcfa833047609e2488594b112be1))
        +* update dependency com.google.api:gax-bom to v2.18.5 ([#876](https://github.com/googleapis/java-core/issues/876)) ([d8dc7fb](https://github.com/googleapis/java-core/commit/d8dc7fbdb0d65e493ca4154658c63e80d89ab600))
        +* update dependency com.google.api.grpc:proto-google-common-protos to v2.9.2 ([#870](https://github.com/googleapis/java-core/issues/870)) ([7e961e9](https://github.com/googleapis/java-core/commit/7e961e945d5e049a1a1bb2592e9c155b5937e33b))
        +* update dependency com.google.api.grpc:proto-google-iam-v1 to v1.5.2 ([#865](https://github.com/googleapis/java-core/issues/865)) ([fe7b974](https://github.com/googleapis/java-core/commit/fe7b974a0eae82711ca96edf412944309d5d6202))
        +* update dependency com.google.auth:google-auth-library-bom to v1.8.1 ([#856](https://github.com/googleapis/java-core/issues/856)) ([92df5d3](https://github.com/googleapis/java-core/commit/92df5d3c248214970d38432e8c264d151298d1e6))
        +* update dependency com.google.http-client:google-http-client-bom to v1.42.2 ([#871](https://github.com/googleapis/java-core/issues/871)) ([1972e8e](https://github.com/googleapis/java-core/commit/1972e8e45e11597e56609aa5fcd44e61958d5857))
        +* update dependency com.google.protobuf:protobuf-bom to v3.21.3 ([#874](https://github.com/googleapis/java-core/issues/874)) ([1e18977](https://github.com/googleapis/java-core/commit/1e18977820ac766157156fb6246bd318d207971c))
        +* update dependency com.google.protobuf:protobuf-bom to v3.21.4 ([#877](https://github.com/googleapis/java-core/issues/877)) ([d12fb5e](https://github.com/googleapis/java-core/commit/d12fb5e4eb8aa42015df84abf31f56408c8b64d8))
        +* update dependency io.grpc:grpc-bom to v1.48.0 ([#873](https://github.com/googleapis/java-core/issues/873)) ([a45b075](https://github.com/googleapis/java-core/commit/a45b075e414049550c51ff0097337e45128fc499))
        +
        +## [2.8.2](https://github.com/googleapis/java-core/compare/v2.8.1...v2.8.2) (2022-07-13)
        +
        +
        +### Bug Fixes
        +
        +* enable longpaths support for windows test ([#1485](https://github.com/googleapis/java-core/issues/1485)) ([#866](https://github.com/googleapis/java-core/issues/866)) ([3add981](https://github.com/googleapis/java-core/commit/3add98191ecfc00f324ef214b98d02cfb143d08e))
        +
        +
        +### Dependencies
        +
        +* update dependency com.google.api-client:google-api-client-bom to v1.35.2 ([#859](https://github.com/googleapis/java-core/issues/859)) ([c26a33d](https://github.com/googleapis/java-core/commit/c26a33d44df2405653ee5161f5335b423d334c93))
        +* update dependency com.google.api:gax-bom to v2.18.3 ([#860](https://github.com/googleapis/java-core/issues/860)) ([f16395e](https://github.com/googleapis/java-core/commit/f16395e005b253a1cccadcd77b6403617cf72467))
        +* update dependency com.google.api.grpc:proto-google-common-protos to v2.9.1 ([#855](https://github.com/googleapis/java-core/issues/855)) ([f7fc1cc](https://github.com/googleapis/java-core/commit/f7fc1cca6e79a17313c1d9c522dc93ea6df44645))
        +* update dependency com.google.api.grpc:proto-google-iam-v1 to v1.5.0 ([#862](https://github.com/googleapis/java-core/issues/862)) ([fc82590](https://github.com/googleapis/java-core/commit/fc82590ca3022449300f18bb6d0109521aa73cbc))
        +* update dependency com.google.http-client:google-http-client-bom to v1.42.1 ([#861](https://github.com/googleapis/java-core/issues/861)) ([3849fdf](https://github.com/googleapis/java-core/commit/3849fdf14e863d23b097b0d625e3a11b47f5d99b))
        +
        +## [2.8.1](https://github.com/googleapis/java-core/compare/v2.8.0...v2.8.1) (2022-06-27)
        +
        +
        +### Dependencies
        +
        +* update dependency com.google.protobuf:protobuf-bom to v3.21.2 ([#851](https://github.com/googleapis/java-core/issues/851)) ([c0f09f0](https://github.com/googleapis/java-core/commit/c0f09f0fcd57a2d90e0a99b17c9e346df8651d65))
        +
        +## [2.8.0](https://github.com/googleapis/java-core/compare/v2.7.1...v2.8.0) (2022-06-21)
        +
        +
        +### Features
        +
        +* add build scripts for native image testing in Java 17 ([#1440](https://github.com/googleapis/java-core/issues/1440)) ([#836](https://github.com/googleapis/java-core/issues/836)) ([8826d9b](https://github.com/googleapis/java-core/commit/8826d9bc05eb9e4a54c40e8578de85ed79c50e99))
        +
        +
        +### Dependencies
        +
        +* update dependency com.google.api-client:google-api-client-bom to v1.35.1 ([#843](https://github.com/googleapis/java-core/issues/843)) ([9ffe0c5](https://github.com/googleapis/java-core/commit/9ffe0c5b25761abf7ff1bea091aa1db057dff2d0))
        +* update dependency com.google.api:api-common to v2.2.1 ([#844](https://github.com/googleapis/java-core/issues/844)) ([69dde56](https://github.com/googleapis/java-core/commit/69dde5641546b678a385b1ed3a2c7a020f81d285))
        +* update dependency com.google.api:gax-bom to v2.18.2 ([#849](https://github.com/googleapis/java-core/issues/849)) ([11764b0](https://github.com/googleapis/java-core/commit/11764b04629c5bfbc9b0d68174782cc126dc1646))
        +* update dependency com.google.api.grpc:proto-google-common-protos to v2.9.0 ([#846](https://github.com/googleapis/java-core/issues/846)) ([5dced6d](https://github.com/googleapis/java-core/commit/5dced6d25ce0f3e7587d7ac1f6f3713f3b2a18c2))
        +* update dependency com.google.api.grpc:proto-google-iam-v1 to v1.4.0 ([#838](https://github.com/googleapis/java-core/issues/838)) ([b0a7afe](https://github.com/googleapis/java-core/commit/b0a7afe342a5e15436d439b9cc1e3c58f894ab66))
        +* update dependency com.google.api.grpc:proto-google-iam-v1 to v1.4.1 ([#848](https://github.com/googleapis/java-core/issues/848)) ([8260997](https://github.com/googleapis/java-core/commit/826099767b0aabe0db26eff2f612f0847b451366))
        +* update dependency com.google.errorprone:error_prone_annotations to v2.14.0 ([#839](https://github.com/googleapis/java-core/issues/839)) ([3459fb6](https://github.com/googleapis/java-core/commit/3459fb668557b982cef5682ce47d3c978b83d69c))
        +* update dependency com.google.http-client:google-http-client-bom to v1.42.0 ([#845](https://github.com/googleapis/java-core/issues/845)) ([2d2c873](https://github.com/googleapis/java-core/commit/2d2c873e274b26f4687d569cc3b8ae58c3c5ed54))
        +* update dependency com.google.protobuf:protobuf-bom to v3.21.0 ([#840](https://github.com/googleapis/java-core/issues/840)) ([037da15](https://github.com/googleapis/java-core/commit/037da15b2aed1719e768ba5b4e001caf25952adc))
        +* update dependency com.google.protobuf:protobuf-bom to v3.21.1 ([#841](https://github.com/googleapis/java-core/issues/841)) ([04b8862](https://github.com/googleapis/java-core/commit/04b886224128f1525ad8398815dc62dac87680af))
        +* update dependency io.grpc:grpc-bom to v1.47.0 ([#842](https://github.com/googleapis/java-core/issues/842)) ([40984e2](https://github.com/googleapis/java-core/commit/40984e23242ba954b6ca741ca3f02ec89e92ae57))
        +
        +### [2.7.1](https://github.com/googleapis/java-core/compare/v2.7.0...v2.7.1) (2022-05-19)
        +
        +
        +### Dependencies
        +
        +* update dependency com.google.api:gax-bom to v2.18.1 ([#833](https://github.com/googleapis/java-core/issues/833)) ([7541115](https://github.com/googleapis/java-core/commit/7541115095e0ae28d938a4c9621fd0f82892fe55))
        +
        +## [2.7.0](https://github.com/googleapis/java-core/compare/v2.6.1...v2.7.0) (2022-05-18)
        +
        +
        +### Features
        +
        +* **java:** remove native-image-support module ([#820](https://github.com/googleapis/java-core/issues/820)) ([a53ef6d](https://github.com/googleapis/java-core/commit/a53ef6d7ba05eeba82998378455f0aea58f24381))
        +* next release from main branch is 2.7.0 ([#807](https://github.com/googleapis/java-core/issues/807)) ([5a2c608](https://github.com/googleapis/java-core/commit/5a2c608e375d15ec83ca71232627bce1f167e750))
        +
        +
        +### Bug Fixes
        +
        +* remove native-image-support module from version.txt ([#822](https://github.com/googleapis/java-core/issues/822)) ([92e7efc](https://github.com/googleapis/java-core/commit/92e7efc4974911f7ce30021a280c9002a44dab47))
        +
        +
        +### Dependencies
        +
        +* update dependency com.google.api-client:google-api-client-bom to v1.34.1 ([#823](https://github.com/googleapis/java-core/issues/823)) ([71105c6](https://github.com/googleapis/java-core/commit/71105c64918d6444e321fa3de5fc402e577ebc7d))
        +* update dependency com.google.api:api-common to v2.2.0 ([#827](https://github.com/googleapis/java-core/issues/827)) ([05a02d6](https://github.com/googleapis/java-core/commit/05a02d6b16cb06b9f1dea0814912e5a32913fca8))
        +* update dependency com.google.api:gax-bom to v2.17.0 ([#826](https://github.com/googleapis/java-core/issues/826)) ([c90188e](https://github.com/googleapis/java-core/commit/c90188e9a94ae71d71105d908173f1bd7e77c1cb))
        +* update dependency com.google.api:gax-bom to v2.18.0 ([#829](https://github.com/googleapis/java-core/issues/829)) ([5537e7f](https://github.com/googleapis/java-core/commit/5537e7f80d5db94038b24a393e310120fab62e8c))
        +* update dependency com.google.api.grpc:proto-google-iam-v1 to v1.3.2 ([#805](https://github.com/googleapis/java-core/issues/805)) ([493ac03](https://github.com/googleapis/java-core/commit/493ac038d3ca9f603cd47969fde0da68a1f9bfd0))
        +* update dependency com.google.api.grpc:proto-google-iam-v1 to v1.3.3 ([#814](https://github.com/googleapis/java-core/issues/814)) ([e809baa](https://github.com/googleapis/java-core/commit/e809baa69672d3eca2dc348f55615dc072a8fbe3))
        +* update dependency com.google.api.grpc:proto-google-iam-v1 to v1.3.4 ([#825](https://github.com/googleapis/java-core/issues/825)) ([5ce12ee](https://github.com/googleapis/java-core/commit/5ce12ee0c10e2bdb5981e6ca02966d7eb802ca6c))
        +* update dependency com.google.auth:google-auth-library-bom to v1.7.0 ([#828](https://github.com/googleapis/java-core/issues/828)) ([2abca2c](https://github.com/googleapis/java-core/commit/2abca2c135ba2337d546d5c97bcdd5901e91301a))
        +* update dependency com.google.cloud:native-image-support to v0.14.0 ([#824](https://github.com/googleapis/java-core/issues/824)) ([997a34a](https://github.com/googleapis/java-core/commit/997a34a15a59bb1818fff3d1fbce195a05d12da3))
        +* update dependency com.google.errorprone:error_prone_annotations to v2.13.1 ([#806](https://github.com/googleapis/java-core/issues/806)) ([9fc5811](https://github.com/googleapis/java-core/commit/9fc5811eae52288acd9fb0b967e5737848fe7c5e))
        +* update dependency com.google.http-client:google-http-client-bom to v1.41.8 ([#821](https://github.com/googleapis/java-core/issues/821)) ([c7e3d6e](https://github.com/googleapis/java-core/commit/c7e3d6ef437d9f85dab450b54d63f7218b89788b))
        +* update dependency com.google.protobuf:protobuf-bom to v3.20.1 ([#813](https://github.com/googleapis/java-core/issues/813)) ([a9c8c92](https://github.com/googleapis/java-core/commit/a9c8c92086c0266e14f86a957944c0cc4ab26ee6))
        +* update dependency io.grpc:grpc-bom to v1.46.0 ([#815](https://github.com/googleapis/java-core/issues/815)) ([03c9bfe](https://github.com/googleapis/java-core/commit/03c9bfe4210a6c3995adf89be28b7c8aab402fb3))
        +* update opencensus.version to v0.31.1 ([#819](https://github.com/googleapis/java-core/issues/819)) ([1800d3a](https://github.com/googleapis/java-core/commit/1800d3aa3ff7315947681b648f822f2cf9656a3b))
        +
        +### [2.6.1](https://github.com/googleapis/java-core/compare/v2.6.0...v2.6.1) (2022-04-14)
        +
        +
        +### Dependencies
        +
        +* update dependency com.google.errorprone:error_prone_annotations to v2.13.0 ([#802](https://github.com/googleapis/java-core/issues/802)) ([042b08e](https://github.com/googleapis/java-core/commit/042b08e3cf05dba7e006f802dbc60f95b6da99ef))
        +
        +## [2.6.0](https://github.com/googleapis/java-core/compare/v2.5.11...v2.6.0) (2022-04-14)
        +
        +
        +### Features
        +
        +* **java:** remove GoogleJsonClentFeature and OpenCensusFeature after relocation ([#793](https://github.com/googleapis/java-core/issues/793)) ([2880112](https://github.com/googleapis/java-core/commit/28801121a50583118286419ac91332a201285c4c))
        +* **java:** remove Netty Native Image configuration after relocation to gax ([#771](https://github.com/googleapis/java-core/issues/771)) ([9ba04f9](https://github.com/googleapis/java-core/commit/9ba04f9f135e1ff7344bb45eeb5796154616ef20))
        +* **java:** remove protobuf Native Image configuration ([#784](https://github.com/googleapis/java-core/issues/784)) ([0bc8549](https://github.com/googleapis/java-core/commit/0bc8549d3364ac169f21cc00c00497cd59998106))
        +* remove native-image.properties settings  after relocation ([#794](https://github.com/googleapis/java-core/issues/794)) ([e24bfdd](https://github.com/googleapis/java-core/commit/e24bfddbb9f588fbf69cdc0022cdf67f2c628278))
        +* remove resource-config after relocation ([#795](https://github.com/googleapis/java-core/issues/795)) ([87e2973](https://github.com/googleapis/java-core/commit/87e29733c3714b39000e5fa3d232c35ce69955a2))
        +* remove substitutions after relocation to gax ([#789](https://github.com/googleapis/java-core/issues/789)) ([29291e9](https://github.com/googleapis/java-core/commit/29291e9f50e4500ef5d5c1fe30098d025b216f9a))
        +
        +
        +### Bug Fixes
        +
        +* **java:** register test class for reflection to fix native image test ([#766](https://github.com/googleapis/java-core/issues/766)) ([6fe52c3](https://github.com/googleapis/java-core/commit/6fe52c3424546cad7b8158668d3f8a655b56af41))
        +
        +
        +### Dependencies
        +
        +* revert protobuf to 3.19 and common-protos 2.8.3 ([#798](https://github.com/googleapis/java-core/issues/798)) ([0f36a84](https://github.com/googleapis/java-core/commit/0f36a848a03c50d5d0187241bccd66fdb0cea862))
        +* update dependency com.google.api-client:google-api-client-bom to v1.34.0 ([#800](https://github.com/googleapis/java-core/issues/800)) ([8430aee](https://github.com/googleapis/java-core/commit/8430aee231100ef13296f22f09265589b2aa0252))
        +* update dependency com.google.api:gax-bom to v2.16.0 ([#785](https://github.com/googleapis/java-core/issues/785)) ([fd435b0](https://github.com/googleapis/java-core/commit/fd435b00f01fac1dc96b5f401b403d67809fa1eb))
        +* update dependency com.google.api.grpc:proto-google-common-protos to v2.8.1 ([#792](https://github.com/googleapis/java-core/issues/792)) ([4d201ac](https://github.com/googleapis/java-core/commit/4d201ac5dc694c9e4a4f06c5580a0c707ea68b87))
        +* update dependency com.google.api.grpc:proto-google-common-protos to v2.8.2 ([#796](https://github.com/googleapis/java-core/issues/796)) ([dc28a0f](https://github.com/googleapis/java-core/commit/dc28a0f2d58bcf4eb3c9b9f129ce8d88470e94e6))
        +* update dependency com.google.api.grpc:proto-google-iam-v1 to v1.3.0 ([#783](https://github.com/googleapis/java-core/issues/783)) ([4ed5ba4](https://github.com/googleapis/java-core/commit/4ed5ba4d096cb19f60186cbcfc789f5b058b07f8))
        +* update dependency com.google.api.grpc:proto-google-iam-v1 to v1.3.1 ([#799](https://github.com/googleapis/java-core/issues/799)) ([fce5315](https://github.com/googleapis/java-core/commit/fce531519184225e103a8faad54e81ae9232210a))
        +* update dependency com.google.errorprone:error_prone_annotations to v2.12.1 ([#788](https://github.com/googleapis/java-core/issues/788)) ([4e71f68](https://github.com/googleapis/java-core/commit/4e71f680142bf8cffaa519dcb0fd2916458674e2))
        +* update dependency com.google.http-client:google-http-client-bom to v1.41.6 ([#791](https://github.com/googleapis/java-core/issues/791)) ([fe006c6](https://github.com/googleapis/java-core/commit/fe006c60e6cbaff8127a9f6f6792c6a6ce9ff26b))
        +* update dependency com.google.http-client:google-http-client-bom to v1.41.7 ([#797](https://github.com/googleapis/java-core/issues/797)) ([570f8d5](https://github.com/googleapis/java-core/commit/570f8d5870044d1f3026b4aec49a6800d904f1be))
        +* update dependency com.google.protobuf:protobuf-bom to v3.20.0 ([#787](https://github.com/googleapis/java-core/issues/787)) ([19202bc](https://github.com/googleapis/java-core/commit/19202bcb76e28977e0f2c9b02c75c83644bfb438))
        +* update dependency io.grpc:grpc-bom to v1.45.1 ([#780](https://github.com/googleapis/java-core/issues/780)) ([6e3bf35](https://github.com/googleapis/java-core/commit/6e3bf35c501028ac293a401f55c14f1d97fa3953))
        +
        +### [2.5.11](https://github.com/googleapis/java-core/compare/v2.5.10...v2.5.11) (2022-03-28)
        +
        +
        +### Bug Fixes
        +
        +* **java:** Register Spanner classes for reflection to fix Native Image tests ([#760](https://github.com/googleapis/java-core/issues/760)) ([257de0f](https://github.com/googleapis/java-core/commit/257de0f71963550ce11aca608fdf9a99672ff19a))
        +
        +
        +### Dependencies
        +
        +* update dependency com.google.api-client:google-api-client-bom to v1.33.4 ([#776](https://github.com/googleapis/java-core/issues/776)) ([1b6fb2a](https://github.com/googleapis/java-core/commit/1b6fb2a5b9602f5ff8375deb15f5121851b09bd1))
        +* update dependency com.google.api:api-common to v2.1.5 ([#768](https://github.com/googleapis/java-core/issues/768)) ([c76c332](https://github.com/googleapis/java-core/commit/c76c332b5676bffad2a1e75b094790c9b0488447))
        +* update dependency com.google.api:gax-bom to v2.13.0 ([#774](https://github.com/googleapis/java-core/issues/774)) ([8075c54](https://github.com/googleapis/java-core/commit/8075c54a127496a5330671652678b03f5abdd5c9))
        +* update dependency com.google.api.grpc:proto-google-common-protos to v2.8.0 ([#770](https://github.com/googleapis/java-core/issues/770)) ([6809477](https://github.com/googleapis/java-core/commit/680947779ac9bc58f60c6c18750aac6b756e73b2))
        +* update dependency com.google.api.grpc:proto-google-iam-v1 to v1.2.10 ([#763](https://github.com/googleapis/java-core/issues/763)) ([9f2eb5f](https://github.com/googleapis/java-core/commit/9f2eb5fed5d9dc91ee01068a2c4eec9acef38c86))
        +* update dependency com.google.auth:google-auth-library-bom to v1.6.0 ([#765](https://github.com/googleapis/java-core/issues/765)) ([2eb1924](https://github.com/googleapis/java-core/commit/2eb19241f119f39de7d07ee863c9c78a3e7f11a4))
        +* update dependency com.google.guava:guava to 31.1-jre ([#772](https://github.com/googleapis/java-core/issues/772)) ([060adf3](https://github.com/googleapis/java-core/commit/060adf35bf6afdd4b31d790e5484f63eac777a11))
        +* update dependency com.google.http-client:google-http-client-bom to v1.41.5 ([#769](https://github.com/googleapis/java-core/issues/769)) ([999be7a](https://github.com/googleapis/java-core/commit/999be7ab10459b33ab001b5bd84d650aeb13313f))
        +* update dependency org.threeten:threetenbp to v1.6.0 ([#767](https://github.com/googleapis/java-core/issues/767)) ([9a4a438](https://github.com/googleapis/java-core/commit/9a4a438e04acfd0ec15cdfac5da3610223fe0071))
        +
        +### [2.5.10](https://github.com/googleapis/java-core/compare/v2.5.9...v2.5.10) (2022-03-10)
        +
        +
        +### Dependencies
        +
        +* update dependency com.google.api.grpc:proto-google-iam-v1 to v1.2.9 ([#759](https://github.com/googleapis/java-core/issues/759)) ([9585d4e](https://github.com/googleapis/java-core/commit/9585d4ea8377c087b33e63e46672a79d52e04a4b))
        +
        +### [2.5.9](https://github.com/googleapis/java-core/compare/v2.5.8...v2.5.9) (2022-03-09)
        +
        +
        +### Dependencies
        +
        +* update dependency io.grpc:grpc-bom to v1.45.0 ([#756](https://github.com/googleapis/java-core/issues/756)) ([403b10a](https://github.com/googleapis/java-core/commit/403b10accfe2694dc2a5fac63a374d00585df5bb))
        +
        +### [2.5.8](https://github.com/googleapis/java-core/compare/v2.5.7...v2.5.8) (2022-03-08)
        +
        +
        +### Dependencies
        +
        +* update dependency com.google.api.grpc:proto-google-iam-v1 to v1.2.8 ([#753](https://github.com/googleapis/java-core/issues/753)) ([6866b84](https://github.com/googleapis/java-core/commit/6866b8407162ecbff7ed5a6eec5e3e4d130fcfa7))
        +
        +### [2.5.7](https://github.com/googleapis/java-core/compare/v2.5.6...v2.5.7) (2022-03-08)
        +
        +
        +### Dependencies
        +
        +* update dependency com.google.api.grpc:proto-google-iam-v1 to v1.2.7 ([#748](https://github.com/googleapis/java-core/issues/748)) ([91cc595](https://github.com/googleapis/java-core/commit/91cc595c7df73af8e71e4feeb663c973e6bcc8e5))
        +
        +### [2.5.6](https://github.com/googleapis/java-core/compare/v2.5.5...v2.5.6) (2022-03-01)
        +
        +
        +### Dependencies
        +
        +* update dependency com.google.api.grpc:proto-google-iam-v1 to v1.2.6 ([#742](https://github.com/googleapis/java-core/issues/742)) ([474e56c](https://github.com/googleapis/java-core/commit/474e56cca19f9d7b61f62585ee06f1fbdba0ae46))
        +
        +### [2.5.5](https://github.com/googleapis/java-core/compare/v2.5.4...v2.5.5) (2022-02-28)
        +
        +
        +### Bug Fixes
        +
        +* **java:** initialize spanner test environment class at build-time ([#734](https://github.com/googleapis/java-core/issues/734)) ([684934e](https://github.com/googleapis/java-core/commit/684934efb28e4ed5f5f975aab91adad25bf1ab52))
        +* **java:** initialize TestTag at build time ([#732](https://github.com/googleapis/java-core/issues/732)) ([a5f1dc2](https://github.com/googleapis/java-core/commit/a5f1dc2ed3d71404d699830ba4bea8824e67d0e8))
        +
        +
        +### Dependencies
        +
        +* update actions/setup-java action to v3 ([#739](https://github.com/googleapis/java-core/issues/739)) ([46322e3](https://github.com/googleapis/java-core/commit/46322e3a9929195c223fc6399860c1cab4d81eb5))
        +* update dependency com.google.api.grpc:proto-google-common-protos to v2.7.4 ([#728](https://github.com/googleapis/java-core/issues/728)) ([3b83bd7](https://github.com/googleapis/java-core/commit/3b83bd7dce6a369c6668f0967572ae08df1b77d8))
        +* update dependency com.google.api.grpc:proto-google-iam-v1 to v1.2.4 ([#729](https://github.com/googleapis/java-core/issues/729)) ([0759c2b](https://github.com/googleapis/java-core/commit/0759c2b8163d45bf87692e2f131df76dac5f178e))
        +* update dependency com.google.api.grpc:proto-google-iam-v1 to v1.2.5 ([#735](https://github.com/googleapis/java-core/issues/735)) ([cefbf97](https://github.com/googleapis/java-core/commit/cefbf978ac21f00b3c4558ebc40ef1f6355ea156))
        +* update dependency com.google.auth:google-auth-library-bom to v1.5.3 ([#737](https://github.com/googleapis/java-core/issues/737)) ([a1cb8d8](https://github.com/googleapis/java-core/commit/a1cb8d81db34142937c85be5c4502036a4b7939d))
        +* update dependency com.google.code.gson:gson to v2.9.0 ([#727](https://github.com/googleapis/java-core/issues/727)) ([faf8a44](https://github.com/googleapis/java-core/commit/faf8a44e8823ecae44d543e6f5c2a9d8598f04fe))
        +* update dependency com.google.http-client:google-http-client-bom to v1.41.4 ([#730](https://github.com/googleapis/java-core/issues/730)) ([1975b61](https://github.com/googleapis/java-core/commit/1975b617e23f7dd0b263e9acb4010b3126e5d7e7))
        +* update dependency io.grpc:grpc-bom to v1.44.1 ([#736](https://github.com/googleapis/java-core/issues/736)) ([4ca315c](https://github.com/googleapis/java-core/commit/4ca315ca400e020badbdf27bb92d1b67680a2e73))
        +
        +### [2.5.4](https://github.com/googleapis/java-core/compare/v2.5.3...v2.5.4) (2022-02-11)
        +
        +
        +### Dependencies
        +
        +* update actions/github-script action to v6 ([#724](https://github.com/googleapis/java-core/issues/724)) ([b8673d3](https://github.com/googleapis/java-core/commit/b8673d3b3ae08cbfed135cd7ff9d891c04e90611))
        +
        +### [2.5.3](https://github.com/googleapis/java-core/compare/v2.5.2...v2.5.3) (2022-02-10)
        +
        +
        +### Dependencies
        +
        +* update dependency com.google.api:gax-bom to v2.12.2 ([#719](https://github.com/googleapis/java-core/issues/719)) ([4de90d0](https://github.com/googleapis/java-core/commit/4de90d05c152c21a1ebb98f6cbff0f9b9c39e5d2))
        +* update dependency com.google.http-client:google-http-client-bom to v1.41.3 ([#720](https://github.com/googleapis/java-core/issues/720)) ([d2a5b4f](https://github.com/googleapis/java-core/commit/d2a5b4ffa598f232b84655a7ac146bfa2e1f24c9))
        +
        +### [2.5.2](https://github.com/googleapis/java-core/compare/v2.5.1...v2.5.2) (2022-02-09)
        +
        +
        +### Dependencies
        +
        +* update dependency com.google.api.grpc:proto-google-iam-v1 to v1.2.3 ([#716](https://github.com/googleapis/java-core/issues/716)) ([100e41e](https://github.com/googleapis/java-core/commit/100e41e092f35f6e6d187de45bb6dc3e4e760052))
        +
        +### [2.5.1](https://github.com/googleapis/java-core/compare/v2.5.0...v2.5.1) (2022-02-08)
        +
        +
        +### Dependencies
        +
        +* update dependency com.google.api-client:google-api-client-bom to v1.33.2 ([#709](https://github.com/googleapis/java-core/issues/709)) ([de08f4e](https://github.com/googleapis/java-core/commit/de08f4eea6cf4e7813c8da1f6adb28e1e56fd1cd))
        +* update dependency com.google.api:api-common to v2.1.4 ([#712](https://github.com/googleapis/java-core/issues/712)) ([9cc49de](https://github.com/googleapis/java-core/commit/9cc49de654d57e8efdb97c8e3c7f9d8723e79eb9))
        +* update dependency com.google.api.grpc:proto-google-common-protos to v2.7.3 ([#710](https://github.com/googleapis/java-core/issues/710)) ([a5f1991](https://github.com/googleapis/java-core/commit/a5f199157319dfb82cbb24d1b4249d924118de84))
        +* update dependency com.google.api.grpc:proto-google-iam-v1 to v1.2.2 ([#705](https://github.com/googleapis/java-core/issues/705)) ([b8722b9](https://github.com/googleapis/java-core/commit/b8722b998966b21cd2d9e6208627c34ff046accf))
        +
        +## [2.5.0](https://github.com/googleapis/java-core/compare/v2.4.0...v2.5.0) (2022-02-02)
        +
        +
        +### Features
        +
        +* add limit support to ReadChannel ([#688](https://github.com/googleapis/java-core/issues/688)) ([476109e](https://github.com/googleapis/java-core/commit/476109e1943c1a9561cc636ffc64ab8cdd1888f9))
        +
        +
        +### Bug Fixes
        +
        +* **java:** Initialize AsyncSSLPrivateKeyMethod (a grpc netty class) at run-time ([#702](https://github.com/googleapis/java-core/issues/702)) ([24146a3](https://github.com/googleapis/java-core/commit/24146a35a10ae06238de9556c24dab5dbd3bcaff))
        +
        +
        +### Dependencies
        +
        +* update dependency com.google.api:gax-bom to v2.12.0 ([#698](https://github.com/googleapis/java-core/issues/698)) ([c10aab8](https://github.com/googleapis/java-core/commit/c10aab8a57ff0aad07a700540085e2ed7521b1a1))
        +* update dependency com.google.protobuf:protobuf-bom to v3.19.4 ([#699](https://github.com/googleapis/java-core/issues/699)) ([5d163f5](https://github.com/googleapis/java-core/commit/5d163f591547cd8e0e508b9c824a17da2074b264))
        +
        +## [2.4.0](https://github.com/googleapis/java-core/compare/v2.3.5...v2.4.0) (2022-01-28)
        +
        +
        +### Features
        +
        +* **java:** Add native-image support classes to java-core module  ([#637](https://github.com/googleapis/java-core/issues/637)) ([154bc18](https://github.com/googleapis/java-core/commit/154bc18ba86328d29665c502db1d35e265c92bbf))
        +
        +
        +### Bug Fixes
        +
        +* **java:** initialize LoggerFactory at build time ([#685](https://github.com/googleapis/java-core/issues/685)) ([eb3aba2](https://github.com/googleapis/java-core/commit/eb3aba2455a0ab6ffec2c6beb3f3cbb4bcb6008d))
        +
        +
        +### Dependencies
        +
        +* **java:** update actions/github-script action to v5 ([#1339](https://github.com/googleapis/java-core/issues/1339)) ([#689](https://github.com/googleapis/java-core/issues/689)) ([eb462c7](https://github.com/googleapis/java-core/commit/eb462c7b1a005ce37d1be58900a244f6b807e5d5))
        +* update dependency com.google.api-client:google-api-client-bom to v1.33.1 ([#684](https://github.com/googleapis/java-core/issues/684)) ([9ff47e6](https://github.com/googleapis/java-core/commit/9ff47e68d0c435d7636d89b03369aabbdfe3663b))
        +* update dependency com.google.api:api-common to v2.1.3 ([#694](https://github.com/googleapis/java-core/issues/694)) ([684ae80](https://github.com/googleapis/java-core/commit/684ae805b8d25747830ce9266fd51a287c018cc9))
        +* update dependency com.google.api:gax-bom to v2.11.0 ([#677](https://github.com/googleapis/java-core/issues/677)) ([1a578bd](https://github.com/googleapis/java-core/commit/1a578bdee2fa229ffbdd8fdde3d66d7e29dedf98))
        +* update dependency com.google.api.grpc:proto-google-common-protos to v2.7.2 ([#695](https://github.com/googleapis/java-core/issues/695)) ([1085d2c](https://github.com/googleapis/java-core/commit/1085d2cb1d7e8391f981d1f4b97c7724b0107e94))
        +* update dependency com.google.api.grpc:proto-google-iam-v1 to v1.2.1 ([#667](https://github.com/googleapis/java-core/issues/667)) ([b57ec04](https://github.com/googleapis/java-core/commit/b57ec047234a1a044458980a8cf7de6a3156bf41))
        +* update dependency com.google.auth:google-auth-library-bom to v1.4.0 ([#681](https://github.com/googleapis/java-core/issues/681)) ([3273b1e](https://github.com/googleapis/java-core/commit/3273b1ed0b1db610790e7832a6c92797a341cc7d))
        +* update dependency com.google.errorprone:error_prone_annotations to v2.11.0 ([#687](https://github.com/googleapis/java-core/issues/687)) ([dc4d18d](https://github.com/googleapis/java-core/commit/dc4d18de86695fddbcb9d221cc53fdca3faf09f5))
        +* update dependency com.google.http-client:google-http-client-bom to v1.41.1 ([#683](https://github.com/googleapis/java-core/issues/683)) ([45cb753](https://github.com/googleapis/java-core/commit/45cb7535151cfcffa282b4c8d9cd56265cca2ece))
        +* update dependency com.google.http-client:google-http-client-bom to v1.41.2 ([#696](https://github.com/googleapis/java-core/issues/696)) ([f4875c0](https://github.com/googleapis/java-core/commit/f4875c0deecfea3728925e5ee0ef95ee90852301))
        +* update dependency com.google.protobuf:protobuf-bom to v3.19.3 ([#674](https://github.com/googleapis/java-core/issues/674)) ([c54f997](https://github.com/googleapis/java-core/commit/c54f9973b71c91c1fde0a1d128957cd022a27902))
        +* update dependency io.grpc:grpc-bom to v1.43.2 ([#665](https://github.com/googleapis/java-core/issues/665)) ([752ba6e](https://github.com/googleapis/java-core/commit/752ba6e384c382d0e39d8335640eaaea2beee9e1))
        +* update dependency io.grpc:grpc-bom to v1.44.0 ([#693](https://github.com/googleapis/java-core/issues/693)) ([ed85045](https://github.com/googleapis/java-core/commit/ed850455995fc5b5c2dae3595116721316f63698))
        +* update dependency org.easymock:easymock to v4 ([#668](https://github.com/googleapis/java-core/issues/668)) ([c36e976](https://github.com/googleapis/java-core/commit/c36e976c0379c1119dfe643dc3131f2e52130c5c))
        +* update dependency org.graalvm.sdk:graal-sdk to v22 ([#680](https://github.com/googleapis/java-core/issues/680)) ([0f535f8](https://github.com/googleapis/java-core/commit/0f535f869f7ce68192f821d0f3361634676dddf7))
        +* update graalvm.version to v21.3.1 ([#679](https://github.com/googleapis/java-core/issues/679)) ([dfb305a](https://github.com/googleapis/java-core/commit/dfb305acaf9d6db91727e42509fc6b043f07a5ce))
        +* update graalvm.version to v22.0.0.2 ([#691](https://github.com/googleapis/java-core/issues/691)) ([780b734](https://github.com/googleapis/java-core/commit/780b734bb4f26fab49065f303d102033b2c3a3d0))
        +* update opencensus.version to v0.30.0 ([#646](https://github.com/googleapis/java-core/issues/646)) ([c2caaa7](https://github.com/googleapis/java-core/commit/c2caaa7cb2c094318e611ba2c082a8a31fee21ea))
        +* update opencensus.version to v0.31.0 ([#692](https://github.com/googleapis/java-core/issues/692)) ([bdf7d4e](https://github.com/googleapis/java-core/commit/bdf7d4ec05c5314e5f2667287ed3e7cb83667c35))
        +
        +### [2.3.5](https://www.github.com/googleapis/java-core/compare/v2.3.4...v2.3.5) (2022-01-06)
        +
        +
        +### Dependencies
        +
        +* update dependency com.google.api:api-common to v2.1.2 ([#661](https://www.github.com/googleapis/java-core/issues/661)) ([0a136d8](https://www.github.com/googleapis/java-core/commit/0a136d8122f6c5042808cbfee9e58dc53e368da6))
        +* update gax.version to v2.8.1 ([#663](https://www.github.com/googleapis/java-core/issues/663)) ([7c09aa5](https://www.github.com/googleapis/java-core/commit/7c09aa5729408a395f1a8fae94744f9d33638b1a))
        +
        +### [2.3.4](https://www.github.com/googleapis/java-core/compare/v2.3.3...v2.3.4) (2022-01-06)
        +
        +
        +### Bug Fixes
        +
        +* fixed compilation warnings from error prone ([e6e7040](https://www.github.com/googleapis/java-core/commit/e6e7040305b19ec9d5468f4cd44d7a29d0d5e470))
        +* **java:** add -ntp flag to native image testing command ([#1299](https://www.github.com/googleapis/java-core/issues/1299)) ([#643](https://www.github.com/googleapis/java-core/issues/643)) ([0f4c1db](https://www.github.com/googleapis/java-core/commit/0f4c1dbbd89d82f5cc86c2b684d6645699b835b3))
        +* **java:** run Maven in plain console-friendly mode ([#1301](https://www.github.com/googleapis/java-core/issues/1301)) ([#652](https://www.github.com/googleapis/java-core/issues/652)) ([ab2fa93](https://www.github.com/googleapis/java-core/commit/ab2fa93ba0434f593abb063afad44dc923bf462a))
        +
        +
        +### Dependencies
        +
        +* update dependency com.google.api-client:google-api-client-bom to v1.33.0 ([#658](https://www.github.com/googleapis/java-core/issues/658)) ([d417ebd](https://www.github.com/googleapis/java-core/commit/d417ebd7bedc9d4e983f32c87a8d61163502cf1d))
        +* update dependency com.google.api:gax-bom to v2.8.0 ([#659](https://www.github.com/googleapis/java-core/issues/659)) ([91717ab](https://www.github.com/googleapis/java-core/commit/91717ab9361a31976727b26d08837e8b3838bdb4))
        +* update dependency com.google.api.grpc:proto-google-common-protos to v2.7.1 ([#656](https://www.github.com/googleapis/java-core/issues/656)) ([ecfbdc1](https://www.github.com/googleapis/java-core/commit/ecfbdc181087d37d38f7911b9962953f5d246434))
        +* update dependency com.google.api.grpc:proto-google-iam-v1 to v1.2.0 ([#645](https://www.github.com/googleapis/java-core/issues/645)) ([3926b54](https://www.github.com/googleapis/java-core/commit/3926b5423893635dd709b8fc6037fb896396ff13))
        +* update dependency com.google.http-client:google-http-client-bom to v1.41.0 ([#657](https://www.github.com/googleapis/java-core/issues/657)) ([41a5120](https://www.github.com/googleapis/java-core/commit/41a51201a3712f71f6cf3be3c29db68360b2405f))
        +* update dependency com.google.protobuf:protobuf-bom to v3.19.2 ([#655](https://www.github.com/googleapis/java-core/issues/655)) ([eb6c037](https://www.github.com/googleapis/java-core/commit/eb6c03729af41e6d7bd9db80644b8ddfd22e78ec))
        +* update dependency io.grpc:grpc-bom to v1.43.1 ([#647](https://www.github.com/googleapis/java-core/issues/647)) ([275b882](https://www.github.com/googleapis/java-core/commit/275b882918f7625daeb3e98ab26b7b0a2f2cdb7b))
        +
        +### [2.3.3](https://www.github.com/googleapis/java-core/compare/v2.3.2...v2.3.3) (2021-12-02)
        +
        +
        +### Dependencies
        +
        +* update dependency com.google.api:gax-bom to v2.7.1 ([#640](https://www.github.com/googleapis/java-core/issues/640)) ([18e033b](https://www.github.com/googleapis/java-core/commit/18e033bdafe536a42ada9f93b0a2b502caea0bcf))
        +
        +### [2.3.2](https://www.github.com/googleapis/java-core/compare/v2.3.1...v2.3.2) (2021-12-02)
        +
        +
        +### Dependencies
        +
        +* update dependency com.google.api:api-common to v2.1.1 ([#632](https://www.github.com/googleapis/java-core/issues/632)) ([b9bb47a](https://www.github.com/googleapis/java-core/commit/b9bb47a0b0a6b132c516361d23750a92a32e53be))
        +* update dependency com.google.api.grpc:proto-google-common-protos to v2.7.0 ([#638](https://www.github.com/googleapis/java-core/issues/638)) ([74862a8](https://www.github.com/googleapis/java-core/commit/74862a8864eb7bffe6659d1e2a261dd5b934d6ff))
        +
        +### [2.3.1](https://www.github.com/googleapis/java-core/compare/v2.3.0...v2.3.1) (2021-11-15)
        +
        +
        +### Dependencies
        +
        +* update dependency io.grpc:grpc-bom to v1.42.1 ([#629](https://www.github.com/googleapis/java-core/issues/629)) ([85fcd99](https://www.github.com/googleapis/java-core/commit/85fcd99237d7526b1b373d07204c4114c49b08b8))
        +
        +## [2.3.0](https://www.github.com/googleapis/java-core/compare/v2.2.0...v2.3.0) (2021-11-11)
        +
        +
        +### Features
        +
        +* next release from main branch is 2.3.0 ([#602](https://www.github.com/googleapis/java-core/issues/602)) ([34fa5f1](https://www.github.com/googleapis/java-core/commit/34fa5f1e750629d4431d5f97eb8b09ee65ebc016))
        +
        +
        +### Bug Fixes
        +
        +* **java:** java 17 dependency arguments ([#1266](https://www.github.com/googleapis/java-core/issues/1266)) ([#612](https://www.github.com/googleapis/java-core/issues/612)) ([5be3eff](https://www.github.com/googleapis/java-core/commit/5be3eff4041ca39d513979b948afe99f27bb1d20))
        +
        +
        +### Dependencies
        +
        +* update dependency com.google.api:api-common to v2.1.0 ([#613](https://www.github.com/googleapis/java-core/issues/613)) ([62d6ab8](https://www.github.com/googleapis/java-core/commit/62d6ab8b5a7c5edb4482d7afda5b87f4832226ca))
        +* update dependency com.google.api:gax-bom to v2.7.0 ([#626](https://www.github.com/googleapis/java-core/issues/626)) ([4a1e965](https://www.github.com/googleapis/java-core/commit/4a1e96551e16a5abc5d8f71f9e096a284fc59528))
        +* update dependency com.google.api.grpc:proto-google-iam-v1 to v1.1.7 ([#604](https://www.github.com/googleapis/java-core/issues/604)) ([0d36d59](https://www.github.com/googleapis/java-core/commit/0d36d59e4ff8817ba5984579188bfc6d7745348d))
        +* update dependency com.google.auth:google-auth-library-bom to v1.2.2 ([#610](https://www.github.com/googleapis/java-core/issues/610)) ([c5e33d8](https://www.github.com/googleapis/java-core/commit/c5e33d87d211c22a93ea2e0de1776e7f2fbf6ef7))
        +* update dependency com.google.auth:google-auth-library-bom to v1.3.0 ([#627](https://www.github.com/googleapis/java-core/issues/627)) ([f4403b2](https://www.github.com/googleapis/java-core/commit/f4403b2af856cc6ce45e2aab277d7e78baa6ecfe))
        +* update dependency com.google.code.gson:gson to v2.8.9 ([#615](https://www.github.com/googleapis/java-core/issues/615)) ([ec0e387](https://www.github.com/googleapis/java-core/commit/ec0e387d3c96467218406ef4c5da5e59a11e8b7a))
        +* update dependency com.google.errorprone:error_prone_annotations to v2.10.0 ([#618](https://www.github.com/googleapis/java-core/issues/618)) ([21139a8](https://www.github.com/googleapis/java-core/commit/21139a83821b12b5312e470c61b45ca76a0b921a))
        +* update dependency com.google.protobuf:protobuf-bom to v3.19.1 ([#609](https://www.github.com/googleapis/java-core/issues/609)) ([28e6333](https://www.github.com/googleapis/java-core/commit/28e6333080fbe10ad8ecdfeef12d80af204f71fd))
        +* update dependency io.grpc:grpc-bom to v1.42.0 ([#619](https://www.github.com/googleapis/java-core/issues/619)) ([da4cbd5](https://www.github.com/googleapis/java-core/commit/da4cbd5ccc54a81f89635435a2045cfa0de8d722))
        +* update dependency org.threeten:threetenbp to v1.5.2 ([#624](https://www.github.com/googleapis/java-core/issues/624)) ([91eec9d](https://www.github.com/googleapis/java-core/commit/91eec9d83285e10cd9ecf3e75cb99b9a9d40cb89))
        +
        +## [2.2.0](https://www.github.com/googleapis/java-core/compare/v2.1.8...v2.2.0) (2021-10-18)
        +
        +
        +### Features
        +
        +* next release from main branch is 2.2.0 ([#596](https://www.github.com/googleapis/java-core/issues/596)) ([cca72b8](https://www.github.com/googleapis/java-core/commit/cca72b82b45e01207bd45c6a2b988981c213c6fd))
        +
        +
        +### Dependencies
        +
        +* update dependency com.google.api:gax-bom to v2.6.1 ([#600](https://www.github.com/googleapis/java-core/issues/600)) ([a0cff6a](https://www.github.com/googleapis/java-core/commit/a0cff6a83506d1da3a8aacd6eafc39ff1ab11583))
        +
        +### [2.1.8](https://www.github.com/googleapis/java-core/compare/v2.1.7...v2.1.8) (2021-10-15)
        +
        +
        +### Dependencies
        +
        +* update dependency com.google.api-client:google-api-client-bom to v1.32.2 ([#593](https://www.github.com/googleapis/java-core/issues/593)) ([644fc6f](https://www.github.com/googleapis/java-core/commit/644fc6f728b0791c61d85f34c535c09dff862c1d))
        +* update dependency com.google.api:api-common to v2.0.4 ([#585](https://www.github.com/googleapis/java-core/issues/585)) ([ad4e4b7](https://www.github.com/googleapis/java-core/commit/ad4e4b7e076d8bd52bf621615301ec810917db43))
        +* update dependency com.google.api:api-common to v2.0.5 ([#589](https://www.github.com/googleapis/java-core/issues/589)) ([c30cc40](https://www.github.com/googleapis/java-core/commit/c30cc40cd8687f79c7154503ee1f602089d62f2d))
        +* update dependency com.google.api:gax-bom to v2.6.0 ([#594](https://www.github.com/googleapis/java-core/issues/594)) ([710cbe6](https://www.github.com/googleapis/java-core/commit/710cbe6e5121f118a5f4be327e8eeeceddfa04fb))
        +* update dependency com.google.api.grpc:proto-google-common-protos to v2.6.0 ([#578](https://www.github.com/googleapis/java-core/issues/578)) ([113b686](https://www.github.com/googleapis/java-core/commit/113b6868f98caa64d713f02729c3f16d878252ff))
        +* update dependency com.google.api.grpc:proto-google-iam-v1 to v1.1.3 ([#574](https://www.github.com/googleapis/java-core/issues/574)) ([338444b](https://www.github.com/googleapis/java-core/commit/338444bd4d169bb7fd41242e790c74596948178b))
        +* update dependency com.google.api.grpc:proto-google-iam-v1 to v1.1.4 ([#584](https://www.github.com/googleapis/java-core/issues/584)) ([57211ce](https://www.github.com/googleapis/java-core/commit/57211ce15e9b1a4c1b7468fed217e4ab46ec0a5d))
        +* update dependency com.google.api.grpc:proto-google-iam-v1 to v1.1.5 ([#587](https://www.github.com/googleapis/java-core/issues/587)) ([55f9f4e](https://www.github.com/googleapis/java-core/commit/55f9f4e084defaf8a243bf21afd67302be802b25))
        +* update dependency com.google.api.grpc:proto-google-iam-v1 to v1.1.6 ([#590](https://www.github.com/googleapis/java-core/issues/590)) ([f534c46](https://www.github.com/googleapis/java-core/commit/f534c462fadb479c6fd934c24ac8cd24e06e2698))
        +* update dependency com.google.auth:google-auth-library-bom to v1.2.0 ([#581](https://www.github.com/googleapis/java-core/issues/581)) ([c32d2c5](https://www.github.com/googleapis/java-core/commit/c32d2c552dfa04b8e5eab27a115ac10832898473))
        +* update dependency com.google.auth:google-auth-library-bom to v1.2.1 ([#591](https://www.github.com/googleapis/java-core/issues/591)) ([046f95d](https://www.github.com/googleapis/java-core/commit/046f95d8ed0811dd278c40fcfeb2c042e6535996))
        +* update dependency com.google.guava:guava-bom to v31 ([#577](https://www.github.com/googleapis/java-core/issues/577)) ([4a987fb](https://www.github.com/googleapis/java-core/commit/4a987fbd3f1bd69b0b923fc9a691fc60908ad1cc))
        +* update dependency com.google.http-client:google-http-client-bom to v1.40.1 ([#588](https://www.github.com/googleapis/java-core/issues/588)) ([3d36d77](https://www.github.com/googleapis/java-core/commit/3d36d77e6db9856c276d6263036764c60f32b7b3))
        +* update dependency com.google.protobuf:protobuf-bom to v3.18.1 ([#583](https://www.github.com/googleapis/java-core/issues/583)) ([47da21c](https://www.github.com/googleapis/java-core/commit/47da21c793be9477323a234f7e3beaf6b705cd7d))
        +
        +### [2.1.7](https://www.github.com/googleapis/java-core/compare/v2.1.6...v2.1.7) (2021-09-23)
        +
        +
        +### Dependencies
        +
        +* update dependency io.grpc:grpc-bom to v1.41.0 ([#569](https://www.github.com/googleapis/java-core/issues/569)) ([36703e9](https://www.github.com/googleapis/java-core/commit/36703e9a1f2d97d465a13220027a27f813da14a8))
        +
        +### [2.1.6](https://www.github.com/googleapis/java-core/compare/v2.1.5...v2.1.6) (2021-09-21)
        +
        +
        +### Dependencies
        +
        +* update dependency com.google.api:gax-bom to v2.5.0 ([#565](https://www.github.com/googleapis/java-core/issues/565)) ([3ce8e28](https://www.github.com/googleapis/java-core/commit/3ce8e28813858ea932dc5c54324441f2f0c52d46))
        +
        +### [2.1.5](https://www.github.com/googleapis/java-core/compare/v2.1.4...v2.1.5) (2021-09-21)
        +
        +
        +### Dependencies
        +
        +* downgrading protobuf to 3.17.3 ([#562](https://www.github.com/googleapis/java-core/issues/562)) ([5711b83](https://www.github.com/googleapis/java-core/commit/5711b835a19238df1bfa1f2e4dfc115495a55c9b))
        +
        +### [2.1.4](https://www.github.com/googleapis/java-core/compare/v2.1.3...v2.1.4) (2021-09-15)
        +
        +
        +### Dependencies
        +
        +* update dependency com.google.api.grpc:proto-google-iam-v1 to v1.1.1 ([#556](https://www.github.com/googleapis/java-core/issues/556)) ([095efa1](https://www.github.com/googleapis/java-core/commit/095efa1fc1fffde34c6c38a88fee8f91bd495bfc))
        +* update dependency com.google.api.grpc:proto-google-iam-v1 to v1.1.2 ([#559](https://www.github.com/googleapis/java-core/issues/559)) ([3cda672](https://www.github.com/googleapis/java-core/commit/3cda672059727642d1b90f8bcc6bb34546f6893d))
        +* update dependency com.google.protobuf:protobuf-bom to v3.18.0 ([#558](https://www.github.com/googleapis/java-core/issues/558)) ([85766e6](https://www.github.com/googleapis/java-core/commit/85766e67f0a9f381593ea2d6e9c8f30fc0ba2993))
        +
        +### [2.1.3](https://www.github.com/googleapis/java-core/compare/v2.1.2...v2.1.3) (2021-09-10)
        +
        +
        +### Dependencies
        +
        +* update dependency com.google.api:gax-bom to v2.4.1 ([#549](https://www.github.com/googleapis/java-core/issues/549)) ([0b4be35](https://www.github.com/googleapis/java-core/commit/0b4be350d47cab58f3bb4e53d34e913e736a522b))
        +
        +### [2.1.2](https://www.github.com/googleapis/java-core/compare/v2.1.1...v2.1.2) (2021-08-31)
        +
        +
        +### Dependencies
        +
        +* update dependency com.google.api:api-common to v2.0.2 ([#534](https://www.github.com/googleapis/java-core/issues/534)) ([1883c81](https://www.github.com/googleapis/java-core/commit/1883c81cb0fdf2f4b34a3a3a17987206d8c452aa))
        +* update dependency com.google.api:gax-bom to v2.4.0 ([#540](https://www.github.com/googleapis/java-core/issues/540)) ([06b0d6e](https://www.github.com/googleapis/java-core/commit/06b0d6e3ff3c3b6e2aa440a9f893f9b27e0d66d1))
        +* update dependency com.google.api.grpc:proto-google-common-protos to v2.5.0 ([#539](https://www.github.com/googleapis/java-core/issues/539)) ([9d5a0b0](https://www.github.com/googleapis/java-core/commit/9d5a0b0918f6a1ab264f1ba272dcd8f22b670a7f))
        +* update dependency com.google.http-client:google-http-client-bom to v1.40.0 ([#538](https://www.github.com/googleapis/java-core/issues/538)) ([150e07d](https://www.github.com/googleapis/java-core/commit/150e07ddb884d163d0efbcf786f04a713d29ed81))
        +* update dependency io.grpc:grpc-bom to v1.40.1 ([#535](https://www.github.com/googleapis/java-core/issues/535)) ([3cd48a9](https://www.github.com/googleapis/java-core/commit/3cd48a902691ddddb9df9f74517648ca35b5bfd7))
        +
        +### [2.1.1](https://www.github.com/googleapis/java-core/compare/v2.1.0...v2.1.1) (2021-08-24)
        +
        +
        +### Dependencies
        +
        +* update dependency com.google.api.grpc:proto-google-iam-v1 to v1.1.0 ([#531](https://www.github.com/googleapis/java-core/issues/531)) ([1b27f8c](https://www.github.com/googleapis/java-core/commit/1b27f8cbfaffcc9b19103b471db237f2448d7cb8))
        +
        +## [2.1.0](https://www.github.com/googleapis/java-core/compare/v2.0.5...v2.1.0) (2021-08-23)
        +
        +
        +### Features
        +
        +* support downloading an emulator from an access controlled URL ([#513](https://www.github.com/googleapis/java-core/issues/513)) ([f42a707](https://www.github.com/googleapis/java-core/commit/f42a7078522461018da96196a67657809d28b15b))
        +
        +
        +### Dependencies
        +
        +* update dependency com.google.api:gax-bom to v2.3.0 ([#523](https://www.github.com/googleapis/java-core/issues/523)) ([6fa1d96](https://www.github.com/googleapis/java-core/commit/6fa1d96d07a7d255e7564407364216436cad6ca3))
        +* update dependency com.google.auth:google-auth-library-bom to v1.1.0 ([#526](https://www.github.com/googleapis/java-core/issues/526)) ([0fc1532](https://www.github.com/googleapis/java-core/commit/0fc1532183148d09c3005a68e528c6c438cb6ddd))
        +* update dependency com.google.code.gson:gson to v2.8.8 ([#529](https://www.github.com/googleapis/java-core/issues/529)) ([92b7f97](https://www.github.com/googleapis/java-core/commit/92b7f9715eeab0a07b64437a62dd47e5eed006de))
        +* update dependency com.google.errorprone:error_prone_annotations to v2.9.0 ([#528](https://www.github.com/googleapis/java-core/issues/528)) ([5ecba07](https://www.github.com/googleapis/java-core/commit/5ecba07336499fc6fddae4cfdc2bc12105ec9b66))
        +* update dependency io.grpc:grpc-bom to v1.40.0 ([#525](https://www.github.com/googleapis/java-core/issues/525)) ([a1e81f7](https://www.github.com/googleapis/java-core/commit/a1e81f73a4cc29e7186adf37f1cb718c1a88f41e))
        +
        +### [2.0.5](https://www.github.com/googleapis/java-core/compare/v2.0.4...v2.0.5) (2021-08-11)
        +
        +
        +### Dependencies
        +
        +* update dependency com.google.api:gax-bom to v2.1.0 ([#519](https://www.github.com/googleapis/java-core/issues/519)) ([266e2f7](https://www.github.com/googleapis/java-core/commit/266e2f75e83fe1fd635a1528deb38131b8bfc742))
        +
        +### [2.0.4](https://www.github.com/googleapis/java-core/compare/v2.0.3...v2.0.4) (2021-08-11)
        +
        +
        +### Dependencies
        +
        +* update dependency com.google.api:api-common to v2.0.1 ([#516](https://www.github.com/googleapis/java-core/issues/516)) ([aa6abf3](https://www.github.com/googleapis/java-core/commit/aa6abf3cc458ca117ec009fb29a14fd4f5409ef3))
        +
        +### [2.0.3](https://www.github.com/googleapis/java-core/compare/v2.0.2...v2.0.3) (2021-08-10)
        +
        +
        +### Dependencies
        +
        +* update dependency com.google.errorprone:error_prone_annotations to v2.8.1 ([#512](https://www.github.com/googleapis/java-core/issues/512)) ([6127b8f](https://www.github.com/googleapis/java-core/commit/6127b8f23ec267a4cf8daa794b88a5cd97f054e3))
        +
        +### [2.0.2](https://www.github.com/googleapis/java-core/compare/v2.0.1...v2.0.2) (2021-08-03)
        +
        +
        +### Features
        +
        +* release 2.0.2 ([#509](https://www.github.com/googleapis/java-core/issues/509)) ([afbb532](https://www.github.com/googleapis/java-core/commit/afbb532965a9ab6f9e3eafbf9d5d8502dd29d1bb))
        +
        +### [2.0.1](https://www.github.com/googleapis/java-core/compare/v2.0.0...v2.0.1) (2021-08-03)
        +
        +
        +### Dependencies
        +
        +* update dependency com.google.api:gax-bom to v2 ([#506](https://www.github.com/googleapis/java-core/issues/506)) ([a0c49a2](https://www.github.com/googleapis/java-core/commit/a0c49a2eb2579df78afccc6db021e78c3bd58493))
        +
        +## [2.0.0](https://www.github.com/googleapis/java-core/compare/v1.95.4...v2.0.0) (2021-07-29)
        +
        +
        +### Features
        +
        +* promote to 2.0.0 ([#504](https://www.github.com/googleapis/java-core/issues/504)) ([48076ba](https://www.github.com/googleapis/java-core/commit/48076bafa2a89dc6b3ad88a698166da8ebb144f4))
        +
        +
        +### Bug Fixes
        +
        +* Add shopt -s nullglob to dependencies script ([1fa147c](https://www.github.com/googleapis/java-core/commit/1fa147c9cded08f9eea4a717c622c0b33ad239d0))
        +* Update dependencies.sh to not break on mac ([#484](https://www.github.com/googleapis/java-core/issues/484)) ([1fa147c](https://www.github.com/googleapis/java-core/commit/1fa147c9cded08f9eea4a717c622c0b33ad239d0))
        +
        +
        +### Dependencies
        +
        +* update dependency com.google.api:api-common to v1.10.6 ([#494](https://www.github.com/googleapis/java-core/issues/494)) ([1353d7b](https://www.github.com/googleapis/java-core/commit/1353d7b42dc98110733d279404f9295067f632cf))
        +* update dependency com.google.api:api-common to v2 ([#497](https://www.github.com/googleapis/java-core/issues/497)) ([05edb6e](https://www.github.com/googleapis/java-core/commit/05edb6ec2156978b49e72f16de35a935acd43ca8))
        +* update dependency com.google.api:gax-bom to v1.66.0 ([#483](https://www.github.com/googleapis/java-core/issues/483)) ([0698c66](https://www.github.com/googleapis/java-core/commit/0698c6679877e0666c684ea5c5daaf8ebae7c15c))
        +* update dependency com.google.api:gax-bom to v1.67.0 ([#491](https://www.github.com/googleapis/java-core/issues/491)) ([65f4a1e](https://www.github.com/googleapis/java-core/commit/65f4a1e4ace1ec70cd2a151233c626d80874beb4))
        +* update dependency com.google.auth:google-auth-library-bom to v0.27.0 ([#489](https://www.github.com/googleapis/java-core/issues/489)) ([21b0afe](https://www.github.com/googleapis/java-core/commit/21b0afea717805dfd5c93929d2a72de86f048781))
        +* update dependency com.google.auth:google-auth-library-bom to v1 ([#496](https://www.github.com/googleapis/java-core/issues/496)) ([9cddefc](https://www.github.com/googleapis/java-core/commit/9cddefc0fdb0eb400121db0faf18bf1bdfdfc7f5))
        +* update dependency com.google.errorprone:error_prone_annotations to v2.8.0 ([#492](https://www.github.com/googleapis/java-core/issues/492)) ([acd03c0](https://www.github.com/googleapis/java-core/commit/acd03c00896a1e8f6ab948823e5a5ebd5b741115))
        +* update dependency io.grpc:grpc-bom to v1.39.0 ([#482](https://www.github.com/googleapis/java-core/issues/482)) ([02e69d4](https://www.github.com/googleapis/java-core/commit/02e69d46d3b8a71b6286915e08e987a5fc9ce8a6))
        +* update guava 30.1.1-jre ([#503](https://www.github.com/googleapis/java-core/issues/503)) ([cac0c63](https://www.github.com/googleapis/java-core/commit/cac0c6367d42afb8af2dec56b9eec4de2e95978e))
        +
        +### [1.95.4](https://www.github.com/googleapis/java-core/compare/v1.95.3...v1.95.4) (2021-06-25)
        +
        +
        +### Dependencies
        +
        +* update dependency com.google.api-client:google-api-client-bom to v1.32.1 ([#479](https://www.github.com/googleapis/java-core/issues/479)) ([5f9f732](https://www.github.com/googleapis/java-core/commit/5f9f73212c8073c3b590206f69a2446c8bce2c75))
        +
        +### [1.95.3](https://www.github.com/googleapis/java-core/compare/v1.95.2...v1.95.3) (2021-06-23)
        +
        +
        +### Dependencies
        +
        +* update dependency com.google.api:api-common to v1.10.4 ([#475](https://www.github.com/googleapis/java-core/issues/475)) ([5c8223d](https://www.github.com/googleapis/java-core/commit/5c8223df9d4e30b6f2fadd4985c3bcfc5b0ff4ec))
        +* update dependency io.grpc:grpc-bom to v1.38.1 ([#476](https://www.github.com/googleapis/java-core/issues/476)) ([b6a7923](https://www.github.com/googleapis/java-core/commit/b6a7923e255f0146e126bad2296e12e9d591c04d))
        +
        +### [1.95.2](https://www.github.com/googleapis/java-core/compare/v1.95.1...v1.95.2) (2021-06-09)
        +
        +
        +### Dependencies
        +
        +* update dependency com.google.api:gax-bom to v1.65.1 ([#471](https://www.github.com/googleapis/java-core/issues/471)) ([3814364](https://www.github.com/googleapis/java-core/commit/381436415073b728b4deb3f82fd129c887205c19))
        +
        +### [1.95.1](https://www.github.com/googleapis/java-core/compare/v1.95.0...v1.95.1) (2021-06-09)
        +
        +
        +### Dependencies
        +
        +* update dependency com.google.protobuf:protobuf-bom to v3.17.3 ([#468](https://www.github.com/googleapis/java-core/issues/468)) ([d456df2](https://www.github.com/googleapis/java-core/commit/d456df20269cfb531adf7bcc7694d0ffff7b1962))
        +
        +## [1.95.0](https://www.github.com/googleapis/java-core/compare/v1.94.8...v1.95.0) (2021-06-03)
        +
        +
        +### Features
        +
        +* add `gcf-owl-bot[bot]` to `ignoreAuthors` ([#453](https://www.github.com/googleapis/java-core/issues/453)) ([33d8edf](https://www.github.com/googleapis/java-core/commit/33d8edf12d20f2bbdaedb1f1cd5a9194357934f1))
        +
        +
        +### Dependencies
        +
        +* update dependency com.google.api-client:google-api-client-bom to v1.31.5 ([#446](https://www.github.com/googleapis/java-core/issues/446)) ([fa83a61](https://www.github.com/googleapis/java-core/commit/fa83a618050cdac519eadda5e8a72c2f9cbfeac0))
        +* update dependency com.google.api:gax-bom to v1.64.0-sp.1 ([#443](https://www.github.com/googleapis/java-core/issues/443)) ([19efb61](https://www.github.com/googleapis/java-core/commit/19efb61af60bb5867ebc4c603ac528f277ef6ed0))
        +* update dependency com.google.api:gax-bom to v1.65.0 ([#464](https://www.github.com/googleapis/java-core/issues/464)) ([bb15bf9](https://www.github.com/googleapis/java-core/commit/bb15bf9fb9cf571afc5050e4eaf055e556cb534b))
        +* update dependency com.google.api.grpc:proto-google-common-protos to v2.2.2 ([#449](https://www.github.com/googleapis/java-core/issues/449)) ([42bf8ea](https://www.github.com/googleapis/java-core/commit/42bf8eae15854e01566bac7e094f9b08f273c24e))
        +* update dependency com.google.api.grpc:proto-google-common-protos to v2.3.0 ([#458](https://www.github.com/googleapis/java-core/issues/458)) ([eb930c2](https://www.github.com/googleapis/java-core/commit/eb930c2c690e58d0e1c00abe16ee5671a0bb5144))
        +* update dependency com.google.api.grpc:proto-google-common-protos to v2.3.1 ([#463](https://www.github.com/googleapis/java-core/issues/463)) ([c2b2907](https://www.github.com/googleapis/java-core/commit/c2b29070e5d07b8c7e1d4c76d297d349f6c4d7a3))
        +* update dependency com.google.api.grpc:proto-google-common-protos to v2.3.2 ([#466](https://www.github.com/googleapis/java-core/issues/466)) ([fd68350](https://www.github.com/googleapis/java-core/commit/fd683505e85dd92f77d4a9723015f610716283f7))
        +* update dependency com.google.api.grpc:proto-google-iam-v1 to v1.0.14 ([#439](https://www.github.com/googleapis/java-core/issues/439)) ([c32bd33](https://www.github.com/googleapis/java-core/commit/c32bd33a9d79bc4388b75842a629c582e1c91526))
        +* update dependency com.google.auth:google-auth-library-bom to v0.26.0 ([#456](https://www.github.com/googleapis/java-core/issues/456)) ([97bb7a9](https://www.github.com/googleapis/java-core/commit/97bb7a9c2beb17169de17e2a2d0aa37c051933ee))
        +* update dependency com.google.code.gson:gson to v2.8.7 ([#461](https://www.github.com/googleapis/java-core/issues/461)) ([4381e02](https://www.github.com/googleapis/java-core/commit/4381e02d9147440822b2639e59c4d5ca60b4b3c5))
        +* update dependency com.google.errorprone:error_prone_annotations to v2.7.1 ([#451](https://www.github.com/googleapis/java-core/issues/451)) ([8bf562f](https://www.github.com/googleapis/java-core/commit/8bf562f42fca37b8d0b14a498f47a2bf8c49277d))
        +* update dependency com.google.protobuf:protobuf-bom to v3.17.0 ([#445](https://www.github.com/googleapis/java-core/issues/445)) ([aa9d87c](https://www.github.com/googleapis/java-core/commit/aa9d87ca138714a47c2d4b3e0bca33037a861959))
        +* update dependency com.google.protobuf:protobuf-bom to v3.17.1 ([#460](https://www.github.com/googleapis/java-core/issues/460)) ([4edf784](https://www.github.com/googleapis/java-core/commit/4edf7849261c3b427719a434db2c5dc251facc26))
        +* update dependency com.google.protobuf:protobuf-bom to v3.17.2 ([#465](https://www.github.com/googleapis/java-core/issues/465)) ([f9b847a](https://www.github.com/googleapis/java-core/commit/f9b847af7d3660de79a2b68abee33842daabddf8))
        +* update dependency io.grpc:grpc-bom to v1.38.0 ([#450](https://www.github.com/googleapis/java-core/issues/450)) ([bde03c1](https://www.github.com/googleapis/java-core/commit/bde03c10c2921f8b2bdf47fdaa0a46c277af382a))
        +
        +### [1.94.8](https://www.github.com/googleapis/java-core/compare/v1.94.7...v1.94.8) (2021-04-23)
        +
        +
        +### Bug Fixes
        +
        +* release scripts from issuing overlapping phases ([#432](https://www.github.com/googleapis/java-core/issues/432)) ([289bcab](https://www.github.com/googleapis/java-core/commit/289bcab7d8eeffc1671c3cb4c3e8cc4843d90e1a))
        +* typo ([#429](https://www.github.com/googleapis/java-core/issues/429)) ([f1ea2f8](https://www.github.com/googleapis/java-core/commit/f1ea2f8568bc7c5ed9b1d495bdd88446aa3c4135))
        +
        +
        +### Dependencies
        +
        +* update dependency com.google.api:api-common to v1.10.3 ([#437](https://www.github.com/googleapis/java-core/issues/437)) ([e853d98](https://www.github.com/googleapis/java-core/commit/e853d98caca3d5f0312a0fb9bbab0ffe4a0ce6e2))
        +* update dependency com.google.auth:google-auth-library-bom to v0.25.4 ([#428](https://www.github.com/googleapis/java-core/issues/428)) ([7cc490d](https://www.github.com/googleapis/java-core/commit/7cc490df5e3d24986e7032f5a93a1f844aaa66d5))
        +* update dependency com.google.auth:google-auth-library-bom to v0.25.5 ([#435](https://www.github.com/googleapis/java-core/issues/435)) ([7f7f362](https://www.github.com/googleapis/java-core/commit/7f7f3624a3c436c61a366e5e172592838a4078e0))
        +* update dependency org.threeten:threetenbp to v1.5.1 ([#433](https://www.github.com/googleapis/java-core/issues/433)) ([af08225](https://www.github.com/googleapis/java-core/commit/af08225277fb436a53a1a65d60a7be80b786da4b))
        +
        +### [1.94.7](https://www.github.com/googleapis/java-core/compare/v1.94.6...v1.94.7) (2021-04-12)
        +
        +
        +### Dependencies
        +
        +* update dependency com.google.api-client:google-api-client-bom to v1.31.4 ([#424](https://www.github.com/googleapis/java-core/issues/424)) ([6773b81](https://www.github.com/googleapis/java-core/commit/6773b81893ce9f69ce457e3243bd89b49de6e553))
        +* update dependency com.google.api.grpc:proto-google-iam-v1 to v1.0.12 ([#425](https://www.github.com/googleapis/java-core/issues/425)) ([df2ba7a](https://www.github.com/googleapis/java-core/commit/df2ba7a6aa73d2755382d19a4dfd86bdd6fd927a))
        +
        +### [1.94.6](https://www.github.com/googleapis/java-core/compare/v1.94.5...v1.94.6) (2021-04-09)
        +
        +
        +### Dependencies
        +
        +* update dependency com.google.http-client:google-http-client-bom to v1.39.2 ([#420](https://www.github.com/googleapis/java-core/issues/420)) ([541355d](https://www.github.com/googleapis/java-core/commit/541355db1e1652bac87ed7ab4f57c3bf2ba5d469))
        +
        +### [1.94.5](https://www.github.com/googleapis/java-core/compare/v1.94.4...v1.94.5) (2021-04-08)
        +
        +
        +### Dependencies
        +
        +* update dependency com.google.api:gax-bom to v1.63.0 ([#415](https://www.github.com/googleapis/java-core/issues/415)) ([31d41f3](https://www.github.com/googleapis/java-core/commit/31d41f310db803c5f84e122256850cf3f6722481))
        +* update dependency com.google.auth:google-auth-library-bom to v0.25.2 ([#408](https://www.github.com/googleapis/java-core/issues/408)) ([bfb3cae](https://www.github.com/googleapis/java-core/commit/bfb3caee3d056b6fcbc54a83c1eca36cf58ef72a))
        +* update dependency com.google.errorprone:error_prone_annotations to v2.6.0 ([#412](https://www.github.com/googleapis/java-core/issues/412)) ([e78e5d9](https://www.github.com/googleapis/java-core/commit/e78e5d9676ebf8bc44af7f81a282c7436878730f))
        +* update dependency com.google.http-client:google-http-client-bom to v1.39.1 ([#407](https://www.github.com/googleapis/java-core/issues/407)) ([9ac757f](https://www.github.com/googleapis/java-core/commit/9ac757fa7e121b0db0f66577ed974d6dc24a803a))
        +* update dependency com.google.protobuf:protobuf-bom to v3.15.6 ([#405](https://www.github.com/googleapis/java-core/issues/405)) ([a20bce4](https://www.github.com/googleapis/java-core/commit/a20bce416bfa6556bb7c3518afeca5259fdf23f4))
        +* update dependency com.google.protobuf:protobuf-bom to v3.15.7 ([#413](https://www.github.com/googleapis/java-core/issues/413)) ([16d2bf5](https://www.github.com/googleapis/java-core/commit/16d2bf54340e78e8ba9765b531d9cd64089d723e))
        +* update dependency com.google.protobuf:protobuf-bom to v3.15.8 ([#418](https://www.github.com/googleapis/java-core/issues/418)) ([101910c](https://www.github.com/googleapis/java-core/commit/101910c3edf25ece32fff2408ee09074c2593d18))
        +* update dependency io.grpc:grpc-bom to v1.36.1 ([#410](https://www.github.com/googleapis/java-core/issues/410)) ([e31620a](https://www.github.com/googleapis/java-core/commit/e31620a2f7a15853a1acec8c09416953cc4dce09))
        +* update dependency io.grpc:grpc-bom to v1.37.0 ([#416](https://www.github.com/googleapis/java-core/issues/416)) ([690fe8f](https://www.github.com/googleapis/java-core/commit/690fe8fe44b99b6b81175cef4797174ee28b7dac))
        +* update guava ([#417](https://www.github.com/googleapis/java-core/issues/417)) ([acaa804](https://www.github.com/googleapis/java-core/commit/acaa804a740c1dbf95498db92e0627339f91dc6f))
        +
        +### [1.94.4](https://www.github.com/googleapis/java-core/compare/v1.94.3...v1.94.4) (2021-03-11)
        +
        +
        +### Dependencies
        +
        +* update dependency com.google.api.grpc:proto-google-iam-v1 to v1.0.11 ([#402](https://www.github.com/googleapis/java-core/issues/402)) ([73d893c](https://www.github.com/googleapis/java-core/commit/73d893c76ab1bef3b69bd55040d9f6c5942b36c5))
        +* update dependency com.google.protobuf:protobuf-bom to v3.15.5 ([#399](https://www.github.com/googleapis/java-core/issues/399)) ([a9c2e43](https://www.github.com/googleapis/java-core/commit/a9c2e43e06fcf2f15918359db765fb44d5e28a55))
        +
        +### [1.94.3](https://www.github.com/googleapis/java-core/compare/v1.94.2...v1.94.3) (2021-03-02)
        +
        +
        +### Dependencies
        +
        +* update dependency com.google.api-client:google-api-client-bom to v1.31.3 ([#394](https://www.github.com/googleapis/java-core/issues/394)) ([278cb03](https://www.github.com/googleapis/java-core/commit/278cb032dd201a9729ef6a6e6e3c177bf9b3cd7e))
        +* update dependency com.google.auth:google-auth-library-bom to v0.24.1 ([#390](https://www.github.com/googleapis/java-core/issues/390)) ([9948791](https://www.github.com/googleapis/java-core/commit/99487914834709cd97b283c59ac14fb7b945c9e7))
        +
        +### [1.94.2](https://www.github.com/googleapis/java-core/compare/v1.94.1...v1.94.2) (2021-03-01)
        +
        +
        +### Bug Fixes
        +
        +* fix gcloud SDK detection on Windows ([#384](https://www.github.com/googleapis/java-core/issues/384)) ([9545442](https://www.github.com/googleapis/java-core/commit/9545442906b21897c5227fecf8efd264d7c2d84c)), closes [#383](https://www.github.com/googleapis/java-core/issues/383)
        +
        +
        +### Dependencies
        +
        +* switch from Jackson to GSON ([#368](https://www.github.com/googleapis/java-core/issues/368)) ([220df17](https://www.github.com/googleapis/java-core/commit/220df176826fe154e36dadd19702c307cc232c16))
        +* update dependency com.google.api-client:google-api-client-bom to v1.31.2 ([#359](https://www.github.com/googleapis/java-core/issues/359)) ([107a32a](https://www.github.com/googleapis/java-core/commit/107a32aa170eca0f61e14183af1e795a61291d49))
        +* update dependency com.google.api:gax-bom to v1.62.0 ([2374ca7](https://www.github.com/googleapis/java-core/commit/2374ca77df96976c3920963e0e97e9fabd07b625))
        +* update dependency com.google.api.grpc:proto-google-common-protos to v2.1.0 ([#387](https://www.github.com/googleapis/java-core/issues/387)) ([c55f950](https://www.github.com/googleapis/java-core/commit/c55f95038865d262b58f5b5c9847df75160876d2))
        +* update dependency com.google.api.grpc:proto-google-iam-v1 to v1.0.10 ([#392](https://www.github.com/googleapis/java-core/issues/392)) ([45b5abf](https://www.github.com/googleapis/java-core/commit/45b5abf7692cc0d7f2c03170b7ec47a6408ccfad))
        +* update dependency com.google.api.grpc:proto-google-iam-v1 to v1.0.5 ([#345](https://www.github.com/googleapis/java-core/issues/345)) ([0a5596d](https://www.github.com/googleapis/java-core/commit/0a5596d8fb5a398b56c7dce07e13d534e3b6c208))
        +* update dependency com.google.api.grpc:proto-google-iam-v1 to v1.0.7 ([#357](https://www.github.com/googleapis/java-core/issues/357)) ([3c2b7b4](https://www.github.com/googleapis/java-core/commit/3c2b7b490c64625ecf9846b097aebcc577511696))
        +* update dependency com.google.api.grpc:proto-google-iam-v1 to v1.0.9 ([#372](https://www.github.com/googleapis/java-core/issues/372)) ([82840da](https://www.github.com/googleapis/java-core/commit/82840da9e99f49471c30f2a95f0d06ae17a76507))
        +* update dependency com.google.auth:google-auth-library-bom to v0.22.2 ([#343](https://www.github.com/googleapis/java-core/issues/343)) ([3b418f7](https://www.github.com/googleapis/java-core/commit/3b418f7ae6677e9e44546e7108d985dfbbedbfa4))
        +* update dependency com.google.auth:google-auth-library-bom to v0.23.0 ([#364](https://www.github.com/googleapis/java-core/issues/364)) ([7d52e06](https://www.github.com/googleapis/java-core/commit/7d52e06e2df4a0c69f018e3f7dadfc166a5754be))
        +* update dependency com.google.auth:google-auth-library-bom to v0.24.0 ([#382](https://www.github.com/googleapis/java-core/issues/382)) ([44d8d02](https://www.github.com/googleapis/java-core/commit/44d8d029e7f15efa3dfbf3df49f48f14a8375a6b))
        +* update dependency com.google.errorprone:error_prone_annotations to v2.5.1 ([#354](https://www.github.com/googleapis/java-core/issues/354)) ([e7a688c](https://www.github.com/googleapis/java-core/commit/e7a688c3a20f0c17806ab25c528d69bcafd287c8))
        +* update dependency com.google.guava:guava-bom to v30.1-android ([#348](https://www.github.com/googleapis/java-core/issues/348)) ([0f2eadd](https://www.github.com/googleapis/java-core/commit/0f2eadd32020b546e71332bf4009e4c9195ee72a))
        +* update dependency com.google.http-client:google-http-client-bom to v1.38.1 ([#358](https://www.github.com/googleapis/java-core/issues/358)) ([8fdc254](https://www.github.com/googleapis/java-core/commit/8fdc2549c9ed15e347e282077b9e36159bd32a2e))
        +* update dependency com.google.http-client:google-http-client-bom to v1.39.0 ([2374ca7](https://www.github.com/googleapis/java-core/commit/2374ca77df96976c3920963e0e97e9fabd07b625))
        +* update dependency com.google.protobuf:protobuf-bom to v3.15.0 ([#378](https://www.github.com/googleapis/java-core/issues/378)) ([4314da9](https://www.github.com/googleapis/java-core/commit/4314da9fc62eb6e57b0265a6ff4663c450e0ad9f))
        +* update dependency com.google.protobuf:protobuf-bom to v3.15.1 ([#381](https://www.github.com/googleapis/java-core/issues/381)) ([09fac9d](https://www.github.com/googleapis/java-core/commit/09fac9d078d8d00716500deabfdecfcecab891ea))
        +* update dependency com.google.protobuf:protobuf-bom to v3.15.2 ([#385](https://www.github.com/googleapis/java-core/issues/385)) ([8c2c179](https://www.github.com/googleapis/java-core/commit/8c2c1792df60b9e077534328fc5351c63a745b09))
        +* update dependency com.google.protobuf:protobuf-bom to v3.15.3 ([#391](https://www.github.com/googleapis/java-core/issues/391)) ([6e03ce5](https://www.github.com/googleapis/java-core/commit/6e03ce5b571464f8f62a4b4665f21efb527b112a))
        +* update dependency io.grpc:grpc-bom to v1.34.1 ([#342](https://www.github.com/googleapis/java-core/issues/342)) ([b80c3da](https://www.github.com/googleapis/java-core/commit/b80c3da61e5b158c78358566289800bea0f8997b))
        +* update dependency opencensus to v0.28.0 ([2374ca7](https://www.github.com/googleapis/java-core/commit/2374ca77df96976c3920963e0e97e9fabd07b625))
        +* update io.grpc:grpc-bom to v1.36.0 ([#389](https://www.github.com/googleapis/java-core/issues/389)) ([2374ca7](https://www.github.com/googleapis/java-core/commit/2374ca77df96976c3920963e0e97e9fabd07b625))
        +
        +### [1.94.1](https://www.github.com/googleapis/java-core/compare/v1.94.0...v1.94.1) (2020-12-11)
        +
        +
        +### Dependencies
        +
        +* update dependency com.google.api-client:google-api-client-bom to v1.31.1 ([#331](https://www.github.com/googleapis/java-core/issues/331)) ([e01ec17](https://www.github.com/googleapis/java-core/commit/e01ec179163dfc0069ae34680abaef30b00e05e1))
        +* update dependency com.google.api:gax-bom to v1.60.1 ([#340](https://www.github.com/googleapis/java-core/issues/340)) ([e3219b4](https://www.github.com/googleapis/java-core/commit/e3219b46a6a83a95795b77516426859959406d3a))
        +* update dependency com.google.protobuf:protobuf-bom to v3.14.0 ([#335](https://www.github.com/googleapis/java-core/issues/335)) ([0fc6971](https://www.github.com/googleapis/java-core/commit/0fc6971a23f720102156de3bbcfe38eeff15fd94))
        +
        +## [1.94.0](https://www.github.com/googleapis/java-core/compare/v1.93.10...v1.94.0) (2020-11-10)
        +
        +
        +### Features
        +
        +* **test:** add new MultipleAttemptRule, StdOutCaptureRule & StdErrCaptureRule JUnit 4 rules ([#327](https://www.github.com/googleapis/java-core/issues/327)) ([60f4a66](https://www.github.com/googleapis/java-core/commit/60f4a66ad907f4a838536e405326869487468f35))
        +
        +
        +### Dependencies
        +
        +* update dependency com.google.api.grpc:proto-google-common-protos to v2.0.1 ([#323](https://www.github.com/googleapis/java-core/issues/323)) ([4b989e8](https://www.github.com/googleapis/java-core/commit/4b989e802f773794babd2403253c81d528c6f661))
        +* update dependency com.google.api.grpc:proto-google-iam-v1 to v1.0.3 ([#324](https://www.github.com/googleapis/java-core/issues/324)) ([a40c71a](https://www.github.com/googleapis/java-core/commit/a40c71ab678c3ec267d43b5cb434b7cb302d1b7e))
        +* update dependency com.google.http-client:google-http-client-bom to v1.38.0 ([#325](https://www.github.com/googleapis/java-core/issues/325)) ([48f1da7](https://www.github.com/googleapis/java-core/commit/48f1da709dbfbcffd8faad1f2342c85475ec4e93))
        +* update dependency io.grpc:grpc-bom to v1.33.1 ([#319](https://www.github.com/googleapis/java-core/issues/319)) ([8a788a6](https://www.github.com/googleapis/java-core/commit/8a788a606c8a397121a4177e1004ddf582e112ae))
        +
        +### [1.93.10](https://www.github.com/googleapis/java-core/compare/v1.93.9...v1.93.10) (2020-10-30)
        +
        +
        +### Dependencies
        +
        +* update core dependencies ([#294](https://www.github.com/googleapis/java-core/issues/294)) ([dcb6a67](https://www.github.com/googleapis/java-core/commit/dcb6a6767d245ac134a1985c450c7ce5a2f2ee29))
        +* update core transport dependencies ([#295](https://www.github.com/googleapis/java-core/issues/295)) ([341c032](https://www.github.com/googleapis/java-core/commit/341c032e98c8aac1b6f82a2d026374eaa5cc4c3e))
        +* update dependency com.google.api:api-common to v1.10.1 ([#302](https://www.github.com/googleapis/java-core/issues/302)) ([34260c0](https://www.github.com/googleapis/java-core/commit/34260c0befd0ff858c075cfd58da022a3d083ea9))
        +* update dependency com.google.api.grpc:proto-google-iam-v1 to v1.0.2 ([#312](https://www.github.com/googleapis/java-core/issues/312)) ([16e375a](https://www.github.com/googleapis/java-core/commit/16e375abfb6d0bd41c42a785a3b7c19a2e71c483))
        +* update dependency com.google.guava:guava-bom to v30 ([#310](https://www.github.com/googleapis/java-core/issues/310)) ([17962f8](https://www.github.com/googleapis/java-core/commit/17962f84301f6d630bc6cc85dcb5ebeb24d94561))
        +* update dependency io.grpc:grpc-bom to v1.33.0 ([#309](https://www.github.com/googleapis/java-core/issues/309)) ([e9ac780](https://www.github.com/googleapis/java-core/commit/e9ac780d218928d78ba1fc225576dfe47d85bb8d))
        +* update dependency org.threeten:threetenbp to v1.4.5 ([#297](https://www.github.com/googleapis/java-core/issues/297)) ([a0b878f](https://www.github.com/googleapis/java-core/commit/a0b878f8eeebb7e06efb6f8fc8e887d3ddb3e467))
        +* update dependency org.threeten:threetenbp to v1.5.0 ([#314](https://www.github.com/googleapis/java-core/issues/314)) ([485b30f](https://www.github.com/googleapis/java-core/commit/485b30f47db8e18d153e6b27db9d39080aee285c))
        +
        +### [1.93.9](https://www.github.com/googleapis/java-core/compare/v1.93.8...v1.93.9) (2020-09-23)
        +
        +
        +### Dependencies
        +
        +* update dependency com.google.api.grpc:proto-google-iam-v1 to v1.0.1 ([#282](https://www.github.com/googleapis/java-core/issues/282)) ([933172c](https://www.github.com/googleapis/java-core/commit/933172c835593ad13c4ae85c0c467b2823ca44da))
        +* update dependency com.google.protobuf:protobuf-bom to v3.13.0 ([#273](https://www.github.com/googleapis/java-core/issues/273)) ([4476f33](https://www.github.com/googleapis/java-core/commit/4476f33cab440ff2dcc12597f968d9d719d46e5b))
        +* update dependency io.grpc:grpc-bom to v1.32.1 ([#270](https://www.github.com/googleapis/java-core/issues/270)) ([df518d3](https://www.github.com/googleapis/java-core/commit/df518d3445df07811d9be9770f120315af0100b1))
        +
        +### [1.93.8](https://www.github.com/googleapis/java-core/compare/v1.93.7...v1.93.8) (2020-08-12)
        +
        +
        +### Bug Fixes
        +
        +* docs of com.google.cloud.Timestamp.parseTimestamp ([#258](https://www.github.com/googleapis/java-core/issues/258)) ([964dd14](https://www.github.com/googleapis/java-core/commit/964dd142609ae8923a285e20746ce9ee8c302bd5))
        +
        +
        +### Dependencies
        +
        +* update core dependencies ([#263](https://www.github.com/googleapis/java-core/issues/263)) ([44023c3](https://www.github.com/googleapis/java-core/commit/44023c34d0b5d1990c5028f6e04479b8d7539e77))
        +* update dependency com.google.api-client:google-api-client-bom to v1.30.10 ([#253](https://www.github.com/googleapis/java-core/issues/253)) ([0fd53fe](https://www.github.com/googleapis/java-core/commit/0fd53fe522e35fdd09783bb618ff7dcf01d82a95))
        +* update dependency com.google.api:api-common to v1.10.0 ([#261](https://www.github.com/googleapis/java-core/issues/261)) ([1414e01](https://www.github.com/googleapis/java-core/commit/1414e01a8154533d53911933eb86fc785760af6c))
        +* update dependency com.google.api.grpc:proto-google-common-protos to v1.18.1 ([#268](https://www.github.com/googleapis/java-core/issues/268)) ([b59a83c](https://www.github.com/googleapis/java-core/commit/b59a83c212f862043de0f5f8fa6ae7bb5d2baba4))
        +* update dependency com.google.api.grpc:proto-google-iam-v1 to v1 ([#269](https://www.github.com/googleapis/java-core/issues/269)) ([fe3987e](https://www.github.com/googleapis/java-core/commit/fe3987e2dffb2fe7b7bdd0d48266eba7aad7929b))
        +* update dependency com.google.protobuf:protobuf-bom to v3.12.4 ([#262](https://www.github.com/googleapis/java-core/issues/262)) ([2ffca65](https://www.github.com/googleapis/java-core/commit/2ffca65399a716a0b929ae3f1ae388481b187ae2))
        +
        +### [1.93.7](https://www.github.com/googleapis/java-core/compare/v1.93.6...v1.93.7) (2020-07-08)
        +
        +
        +### Dependencies
        +
        +* update core dependencies ([#241](https://www.github.com/googleapis/java-core/issues/241)) ([60a4a05](https://www.github.com/googleapis/java-core/commit/60a4a054d54119807aa8d0342f76d2925c35f2a6))
        +* update dependency com.google.api:api-common to v1.9.3 ([#250](https://www.github.com/googleapis/java-core/issues/250)) ([792cb60](https://www.github.com/googleapis/java-core/commit/792cb6016cf3d509667e3b03b5f25847c0430af8))
        +* update dependency com.google.api:gax-bom to v1.57.1 ([#251](https://www.github.com/googleapis/java-core/issues/251)) ([dd1a8a9](https://www.github.com/googleapis/java-core/commit/dd1a8a9814f244b2516283d23938f8f49a92f190))
        +* update dependency com.google.auth:google-auth-library-bom to v0.21.1 ([#252](https://www.github.com/googleapis/java-core/issues/252)) ([4844b26](https://www.github.com/googleapis/java-core/commit/4844b268e81b69e409f887272f3bed30709ec33d))
        +* update dependency com.google.errorprone:error_prone_annotations to v2.4.0 ([#226](https://www.github.com/googleapis/java-core/issues/226)) ([b2fd33c](https://www.github.com/googleapis/java-core/commit/b2fd33c3a1dfa8269f67986211af5f93bacdfad9))
        +* update dependency com.google.http-client:google-http-client-bom to v1.36.0 ([#248](https://www.github.com/googleapis/java-core/issues/248)) ([34deaf9](https://www.github.com/googleapis/java-core/commit/34deaf94190cfa2aa9dee5edabbe6bf5dccb0a90))
        +
        +### [1.93.6](https://www.github.com/googleapis/java-core/compare/v1.93.5...v1.93.6) (2020-06-12)
        +
        +
        +### Dependencies
        +
        +* update dependency com.google.api:api-common to v1.9.1 ([#221](https://www.github.com/googleapis/java-core/issues/221)) ([4df33f0](https://www.github.com/googleapis/java-core/commit/4df33f0da02855161562e80a9d50e52dc21f4693))
        +* update dependency com.google.api:api-common to v1.9.2 ([#229](https://www.github.com/googleapis/java-core/issues/229)) ([e8c1aa2](https://www.github.com/googleapis/java-core/commit/e8c1aa2ff9c1eaa4030faa86b403a77fc6602bdb))
        +* update dependency com.google.api:gax-bom to v1.57.0 ([#236](https://www.github.com/googleapis/java-core/issues/236)) ([3d7d2a6](https://www.github.com/googleapis/java-core/commit/3d7d2a69ea95d7cd93f1175e0cc7f051fd591ad8))
        +* update dependency com.google.protobuf:protobuf-bom to v3.12.2 ([#220](https://www.github.com/googleapis/java-core/issues/220)) ([815569d](https://www.github.com/googleapis/java-core/commit/815569d7274cccd12110062e72dc8774f3b1d3de))
        +* update dependency io.grpc:grpc-bom to v1.30.0 ([#233](https://www.github.com/googleapis/java-core/issues/233)) ([b41c34f](https://www.github.com/googleapis/java-core/commit/b41c34f28a2cddddafbb872bbd0100a934972042))
        +
        +### [1.93.5](https://www.github.com/googleapis/java-core/compare/v1.93.4...v1.93.5) (2020-05-26)
        +
        +
        +### Dependencies
        +
        +* rely on shared-config for auto-value configuration ([#222](https://www.github.com/googleapis/java-core/issues/222)) ([22adbcf](https://www.github.com/googleapis/java-core/commit/22adbcf307cf5ef4819bad9afa91c4c83a9f31bb))
        +* update dependency com.google.api.grpc:proto-google-common-protos to v1.18.0 ([#215](https://www.github.com/googleapis/java-core/issues/215)) ([488a351](https://www.github.com/googleapis/java-core/commit/488a351ab41adafb1d969740bfbd3a6d2ddfd36d))
        +* update dependency com.google.guava:guava-bom to v29 ([#205](https://www.github.com/googleapis/java-core/issues/205)) ([48d3f97](https://www.github.com/googleapis/java-core/commit/48d3f970bd931ee5f04205ab939c318c69cbcf3f))
        +* update dependency com.google.http-client:google-http-client-bom to v1.35.0 ([#211](https://www.github.com/googleapis/java-core/issues/211)) ([e56b3ef](https://www.github.com/googleapis/java-core/commit/e56b3ef0e2ea5c96b36f8aae851fd26efe1337c1))
        +* update dependency com.google.protobuf:protobuf-bom to v3.12.0 ([#218](https://www.github.com/googleapis/java-core/issues/218)) ([b2c6f15](https://www.github.com/googleapis/java-core/commit/b2c6f15ae63302dbeea16ecb7d7b89404907516f))
        +* update dependency io.grpc:grpc-bom to v1.29.0 ([#209](https://www.github.com/googleapis/java-core/issues/209)) ([e63cb7c](https://www.github.com/googleapis/java-core/commit/e63cb7ca69e49afae50af1f2cf4fe3601984be49))
        +* update dependency org.threeten:threetenbp to v1.4.4 ([#210](https://www.github.com/googleapis/java-core/issues/210)) ([a837fa4](https://www.github.com/googleapis/java-core/commit/a837fa441fbbf83494709b1779e0ef35ef13b345))
        +
        +### [1.93.4](https://www.github.com/googleapis/java-core/compare/v1.93.3...v1.93.4) (2020-04-06)
        +
        +
        +### Dependencies
        +
        +* update core dependencies ([#198](https://www.github.com/googleapis/java-core/issues/198)) ([129b3f8](https://www.github.com/googleapis/java-core/commit/129b3f8b03e6809bcae9545a6c2484aa8acc2447))
        +* update dependency com.google.api:api-common to v1.9.0 ([#195](https://www.github.com/googleapis/java-core/issues/195)) ([ac19258](https://www.github.com/googleapis/java-core/commit/ac192586f086b91f479e85e4677ac2d10f10968a))
        +* update dependency com.google.api:gax-bom to v1.56.0 ([#201](https://www.github.com/googleapis/java-core/issues/201)) ([875c4ed](https://www.github.com/googleapis/java-core/commit/875c4ed001193dfe2c301ad7f163395a568bcb10))
        +* update dependency org.threeten:threetenbp to v1.4.3 ([#192](https://www.github.com/googleapis/java-core/issues/192)) ([ce6ec17](https://www.github.com/googleapis/java-core/commit/ce6ec179e4024264c0aee09f85f6f60218d46138))
        +
        +### [1.93.3](https://www.github.com/googleapis/java-core/compare/v1.93.2...v1.93.3) (2020-03-16)
        +
        +
        +### Bug Fixes
        +
        +* fix Timestamp.of(java.sql.Timestamp) pre-epoch on exact second ([#179](https://www.github.com/googleapis/java-core/issues/179)) ([9bfb54c](https://www.github.com/googleapis/java-core/commit/9bfb54c5a88c906bebcf90f81ed19aeece09befd))
        +* retry SSLException ([#183](https://www.github.com/googleapis/java-core/issues/183)) ([775a848](https://www.github.com/googleapis/java-core/commit/775a84877ef69d22ca7a4392edd0d3680df2256e))
        +
        +
        +### Dependencies
        +
        +* revert gRPC updates ([#181](https://www.github.com/googleapis/java-core/issues/181)) ([f5ba782](https://www.github.com/googleapis/java-core/commit/f5ba782fe7078bd2e02d27d8770ad20a459c73f3))
        +* update dependency io.grpc:grpc-bom to v1.28.0 ([#178](https://www.github.com/googleapis/java-core/issues/178)) ([6d5632c](https://www.github.com/googleapis/java-core/commit/6d5632c22507d1d3d36a90778291a6fa25b4788b))
        +
        +### [1.93.2](https://www.github.com/googleapis/java-core/compare/v1.93.1...v1.93.2) (2020-03-10)
        +
        +
        +### Bug Fixes
        +
        +* verify correctness of map -> list equality ([#174](https://www.github.com/googleapis/java-core/issues/174)) ([f45d913](https://www.github.com/googleapis/java-core/commit/f45d9131d5d2bbb2cc4cec67ebe82054fda58f55))
        +
        +### [1.93.1](https://www.github.com/googleapis/java-core/compare/v1.93.0...v1.93.1) (2020-02-28)
        +
        +
        +### Dependencies
        +
        +* update dependency com.google.api-client:google-api-client-bom to v1.30.9 ([#171](https://www.github.com/googleapis/java-core/issues/171)) ([1fdcd5e](https://www.github.com/googleapis/java-core/commit/1fdcd5e839049f650ba7ebb003dea62511c8667f))
        +
        +## [1.93.0](https://www.github.com/googleapis/java-core/compare/v1.92.6...v1.93.0) (2020-02-27)
        +
        +
        +### Features
        +
        +* support conditional policies ([#110](https://www.github.com/googleapis/java-core/issues/110)) ([61e2d19](https://www.github.com/googleapis/java-core/commit/61e2d19bb4400978681aa018a8dc200214203830))
        +
        +
        +### Bug Fixes
        +
        +* fix conversion for pre-epoch timestamps ([#160](https://www.github.com/googleapis/java-core/issues/160)) ([1f8b6b4](https://www.github.com/googleapis/java-core/commit/1f8b6b4835aaa702ec94bbbde89ed90f519c935a))
        +
        +
        +### Dependencies
        +
        +* update dependency com.google.api:gax-bom to v1.54.0 ([#168](https://www.github.com/googleapis/java-core/issues/168)) ([5b52f9e](https://www.github.com/googleapis/java-core/commit/5b52f9e8d8cdc82b56114d3d1e857d137ae7ca98))
        +* update dependency io.grpc:grpc-bom to v1.27.2 ([#166](https://www.github.com/googleapis/java-core/issues/166)) ([28c9859](https://www.github.com/googleapis/java-core/commit/28c98595c9ee96760a063085bd85024177bd6dd2))
        +
        +### [1.92.5](https://www.github.com/googleapis/java-core/compare/v1.92.4...v1.92.5) (2020-02-10)
        +
        +
        +### Dependencies
        +
        +* update dependency com.google.api-client:google-api-client-bom to v1.30.8 ([#146](https://www.github.com/googleapis/java-core/issues/146)) ([1d9c7db](https://www.github.com/googleapis/java-core/commit/1d9c7db40502eff9723f27c24be31ecc2fac9c5d))
        +* update dependency com.google.protobuf:protobuf-bom to v3.11.3 ([#148](https://www.github.com/googleapis/java-core/issues/148)) ([092c69b](https://www.github.com/googleapis/java-core/commit/092c69bef5b10cf27ef6770e90ae8e50ea205dcd))
        +
        +### [1.92.4](https://www.github.com/googleapis/java-core/compare/v1.92.3...v1.92.4) (2020-01-31)
        +
        +
        +### Dependencies
        +
        +* update core dependencies ([#143](https://www.github.com/googleapis/java-core/issues/143)) ([454ce1d](https://www.github.com/googleapis/java-core/commit/454ce1dc5a6a41f3333a2a5303315cd9eb66f442))
        +
        +### [1.92.3](https://www.github.com/googleapis/java-core/compare/v1.92.2...v1.92.3) (2020-01-28)
        +
        +
        +### Dependencies
        +
        +* update dependency com.google.api:gax-bom to v1.53.0 ([#126](https://www.github.com/googleapis/java-core/issues/126)) ([bdb1bce](https://www.github.com/googleapis/java-core/commit/bdb1bceb63502c828a37dd50fdb3e0e2204fc0aa))
        +* update dependency com.google.auth:google-auth-library-bom to v0.20.0 ([#135](https://www.github.com/googleapis/java-core/issues/135)) ([f40c636](https://www.github.com/googleapis/java-core/commit/f40c6365b1b19bc3360b0094599311bc3271f0e5))
        +* update dependency com.google.http-client:google-http-client-bom to v1.34.1 ([#137](https://www.github.com/googleapis/java-core/issues/137)) ([9216702](https://www.github.com/googleapis/java-core/commit/92167026d8e4178ebb952490a3322bd685441a60))
        +* update dependency org.threeten:threetenbp to v1.4.1 ([82cac64](https://www.github.com/googleapis/java-core/commit/82cac64486352e46ddc6044a72fff6141d9b10ce))
        +
        +### [1.92.2](https://www.github.com/googleapis/java-core/compare/v1.92.1...v1.92.2) (2020-01-09)
        +
        +
        +### Bug Fixes
        +
        +* cast to proper interface ([#124](https://www.github.com/googleapis/java-core/issues/124)) ([cd6eabf](https://www.github.com/googleapis/java-core/commit/cd6eabffcdeed485aba088336fa473a6b85c752d)), closes [#123](https://www.github.com/googleapis/java-core/issues/123)
        +
        +### [1.92.1](https://www.github.com/googleapis/java-core/compare/v1.92.0...v1.92.1) (2020-01-02)
        +
        +
        +### Dependencies
        +
        +* update dependency com.google.errorprone:error_prone_annotations to v2.3.4 ([#105](https://www.github.com/googleapis/java-core/issues/105)) ([52f47c5](https://www.github.com/googleapis/java-core/commit/52f47c5ed84742b4b41417c486bfbb3c817b4a23))
        +* update dependency com.google.guava:guava-bom to v28.2-android ([#113](https://www.github.com/googleapis/java-core/issues/113)) ([8b11b1a](https://www.github.com/googleapis/java-core/commit/8b11b1a8d452ab823f35509ae42263c4a69f2a5a))
        +* update dependency com.google.http-client:google-http-client-bom to v1.34.0 ([#98](https://www.github.com/googleapis/java-core/issues/98)) ([d8e946d](https://www.github.com/googleapis/java-core/commit/d8e946dfd3866380406b02ad908925c4250cc34a))
        +* update dependency com.google.protobuf:protobuf-bom to v3.11.1 ([#106](https://www.github.com/googleapis/java-core/issues/106)) ([6d36434](https://www.github.com/googleapis/java-core/commit/6d364341bc5552e98590f9344b0e2d8cf4e68f0c))
        +* update dependency io.grpc:grpc-bom to v1.26.0 ([#107](https://www.github.com/googleapis/java-core/issues/107)) ([fca41a7](https://www.github.com/googleapis/java-core/commit/fca41a73fb6ca42eb4014d3cec6b32cc8e97ded9))
        +
        +## [1.92.0](https://www.github.com/googleapis/java-core/compare/v1.91.3...v1.92.0) (2019-12-13)
        +
        +
        +### Features
        +
        +* increase DEFAULT_CHUNK_SIZE to reduce transfer overhead ([#87](https://www.github.com/googleapis/java-core/issues/87)) ([09b327d](https://www.github.com/googleapis/java-core/commit/09b327daf764403b7800180cab79ae3e38815075))
        +* support setting ServiceOption for quota project ([#92](https://www.github.com/googleapis/java-core/issues/92)) ([6aa4476](https://www.github.com/googleapis/java-core/commit/6aa4476441fd7636dd116516d3bf4b738cf8a8a9))
        +
        +
        +### Dependencies
        +
        +* update dependency com.google.api-client:google-api-client-bom to v1.30.5 ([#68](https://www.github.com/googleapis/java-core/issues/68)) ([e1a4047](https://www.github.com/googleapis/java-core/commit/e1a4047fb470ea4f80459ca0bb399f4ab2c7decf))
        +* update dependency com.google.api:gax-bom to v1.50.1 ([#73](https://www.github.com/googleapis/java-core/issues/73)) ([f493b5b](https://www.github.com/googleapis/java-core/commit/f493b5bbe5945202af6a94fe01407f795014b4a1))
        +* update dependency com.google.api:gax-bom to v1.51.0 ([#85](https://www.github.com/googleapis/java-core/issues/85)) ([71d0de7](https://www.github.com/googleapis/java-core/commit/71d0de782432814971facb7cbb67acdec5e45f00))
        +* update dependency com.google.auth:google-auth-library-bom to v0.19.0 ([#93](https://www.github.com/googleapis/java-core/issues/93)) ([b465630](https://www.github.com/googleapis/java-core/commit/b465630023dc87537a02a34fb957be340aeb6078))
        +* update dependency com.google.http-client:google-http-client-bom to v1.33.0 ([#71](https://www.github.com/googleapis/java-core/issues/71)) ([8f1e690](https://www.github.com/googleapis/java-core/commit/8f1e690611e98855d0eed26d7ef75120bccc862e))
        +* update dependency io.grpc:grpc-bom to v1.25.0 ([#72](https://www.github.com/googleapis/java-core/issues/72)) ([3a09fc7](https://www.github.com/googleapis/java-core/commit/3a09fc7c4ce73a3c4f144d0cd4da6d29a1664b75))
        +* update to threetenbp 1.4.0 ([#89](https://www.github.com/googleapis/java-core/issues/89)) ([5128bd4](https://www.github.com/googleapis/java-core/commit/5128bd45bae8cbb8540eccd683f5bba52783feef))
        +
        +### [1.91.3](https://www.github.com/googleapis/java-core/compare/v1.91.2...v1.91.3) (2019-10-23)
        +
        +
        +### Bug Fixes
        +
        +* try to keep autovalue out of the runtime time classpath ([#48](https://www.github.com/googleapis/java-core/issues/48)) ([0988c27](https://www.github.com/googleapis/java-core/commit/0988c27b01461a0b8c02ac0f9def5b409c56980c))
        +
        +
        +### Dependencies
        +
        +* update dependency com.google.api:gax-bom to v1.49.1 ([#65](https://www.github.com/googleapis/java-core/issues/65)) ([131a0fd](https://www.github.com/googleapis/java-core/commit/131a0fd52bebdd217bdcb288374127cef7889692))
        +* update dependency com.google.api.grpc:proto-google-common-protos to v1.17.0 ([#50](https://www.github.com/googleapis/java-core/issues/50)) ([3ba5512](https://www.github.com/googleapis/java-core/commit/3ba55124247b82061781c4ae0acb08cec239afe4))
        +* update dependency com.google.auth:google-auth-library-bom to v0.18.0 ([#56](https://www.github.com/googleapis/java-core/issues/56)) ([ab25f15](https://www.github.com/googleapis/java-core/commit/ab25f153021f73b5f0ce5cc2cf0b53d42a1871c7))
        +* update dependency io.grpc:grpc-bom to v1.24.1 ([07fefbb](https://www.github.com/googleapis/java-core/commit/07fefbb38de93c2b3b5095bc5432bc5161bb7094))
        +
        +### [1.91.2](https://www.github.com/googleapis/java-core/compare/v1.91.1...v1.91.2) (2019-09-30)
        +
        +
        +### Dependencies
        +
        +* update dependency com.google.api.grpc:proto-google-iam-v1 to v0.13.0 ([#40](https://www.github.com/googleapis/java-core/issues/40)) ([4f500cc](https://www.github.com/googleapis/java-core/commit/4f500cc))
        +* update dependency io.grpc:grpc-bom to v1.24.0 ([#39](https://www.github.com/googleapis/java-core/issues/39)) ([7f6f780](https://www.github.com/googleapis/java-core/commit/7f6f780))
        +* update errorprone to 2.3.3 ([#43](https://www.github.com/googleapis/java-core/issues/43)) ([232694c](https://www.github.com/googleapis/java-core/commit/232694c))
        +
        +### [1.91.1](https://www.github.com/googleapis/java-core/compare/v1.91.0...v1.91.1) (2019-09-25)
        +
        +
        +### Dependencies
        +
        +* update dependency com.google.api-client:google-api-client-bom to v1.30.4 ([#34](https://www.github.com/googleapis/java-core/issues/34)) ([886eda3](https://www.github.com/googleapis/java-core/commit/886eda3))
        +* update dependency com.google.auth:google-auth-library-bom to v0.17.2 ([#35](https://www.github.com/googleapis/java-core/issues/35)) ([ae44c72](https://www.github.com/googleapis/java-core/commit/ae44c72))
        +* update dependency com.google.http-client:google-http-client-bom to v1.32.1 ([#31](https://www.github.com/googleapis/java-core/issues/31)) ([4bdf09b](https://www.github.com/googleapis/java-core/commit/4bdf09b))
        +* update dependency com.google.protobuf:protobuf-bom to v3.10.0 ([#27](https://www.github.com/googleapis/java-core/issues/27)) ([23e4c26](https://www.github.com/googleapis/java-core/commit/23e4c26))
        +* update guava to 28.1-android ([#32](https://www.github.com/googleapis/java-core/issues/32)) ([0279479](https://www.github.com/googleapis/java-core/commit/0279479))
        +
        +## [1.91.0](https://www.github.com/googleapis/java-core/compare/v1.90.0...v1.91.0) (2019-09-18)
        +
        +
        +### Dependencies
        +
        +* update dependency com.google.api-client:google-api-client-bom to v1.30.3 ([#21](https://www.github.com/googleapis/java-core/issues/21)) ([fcd67f8](https://www.github.com/googleapis/java-core/commit/fcd67f8))
        +* update opencensus packages to v0.24.0 ([#22](https://www.github.com/googleapis/java-core/issues/22)) ([4b21afa](https://www.github.com/googleapis/java-core/commit/4b21afa))
        +
        +
        +### Documentation
        +
        +* fix Kokoro badge link ([19d79d6](https://www.github.com/googleapis/java-core/commit/19d79d6))
        +* fix README versions and CI Status table ([6e3ccf3](https://www.github.com/googleapis/java-core/commit/6e3ccf3))
        +* update README with a better project description ([#17](https://www.github.com/googleapis/java-core/issues/17)) ([018d4d5](https://www.github.com/googleapis/java-core/commit/018d4d5))
        +
        +
        +### Features
        +
        +* add google-cloud-core-bom artifact ([#13](https://www.github.com/googleapis/java-core/issues/13)) ([3cb19a0](https://www.github.com/googleapis/java-core/commit/3cb19a0))
        diff --git a/java-core/README.md b/java-core/README.md
        new file mode 100644
        index 0000000000..a11a4dccdf
        --- /dev/null
        +++ b/java-core/README.md
        @@ -0,0 +1,41 @@
        +# Google Cloud Java Client -- Core
        +
        +A set of classes and utilities used in Google Cloud Java libraries.
        +
        +*Note*: This library is only meant to be consumed by other Google Libraries.
        +
        +[![Maven](https://img.shields.io/maven-central/v/com.google.cloud/google-cloud-core.svg)](https://img.shields.io/maven-central/v/com.google.cloud/google-cloud-core.svg)
        +
        +- [API Documentation][api-docs]
        +
        +## Java Versions
        +
        +Java 7 or above is required for using this client.
        +
        +## Contributing
        +
        +Contributions to this library are always welcome and highly encouraged.
        +
        +See [CONTRIBUTING][contributing] documentation for more information on 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.
        +
        +## Versioning
        +
        +This library follows [Semantic Versioning][semver].
        +
        +It is currently in major version one (``1.y.z``), which means that the public API should be
        +considered stable.
        +
        +## License
        +
        +Apache 2.0 - See [LICENSE][license] for more information.
        +
        +[contributing]: https://github.com/googleapis/java-core/blob/main/CONTRIBUTING.md
        +[code-of-conduct]: https://github.com/googleapis/java-core/blob/main/CODE_OF_CONDUCT.md
        +[license]: https://github.com/googleapis/java-core/blob/main/LICENSE
        +[semver]: http://semver.org/
        +[cloud-platform]: https://cloud.google.com/
        +[api-docs]: https://googleapis.dev/java/google-cloud-core/latest
        diff --git a/java-core/google-cloud-core-bom/pom.xml b/java-core/google-cloud-core-bom/pom.xml
        new file mode 100644
        index 0000000000..d815c7a728
        --- /dev/null
        +++ b/java-core/google-cloud-core-bom/pom.xml
        @@ -0,0 +1,40 @@
        +
        +
        +  4.0.0
        +  com.google.cloud
        +  google-cloud-core-bom
        +  2.66.1-SNAPSHOT
        +  pom
        +
        +  
        +    com.google.api
        +    gapic-generator-java-pom-parent
        +    2.68.1-SNAPSHOT
        +    ../../gapic-generator-java-pom-parent
        +  
        +
        +  Google Cloud Core
        +  
        +    BOM for Google Cloud Core
        +  
        +
        +  
        +    
        +      
        +        com.google.cloud
        +        google-cloud-core
        +        2.66.1-SNAPSHOT
        +      
        +      
        +        com.google.cloud
        +        google-cloud-core-grpc
        +        2.66.1-SNAPSHOT
        +      
        +      
        +        com.google.cloud
        +        google-cloud-core-http
        +        2.66.1-SNAPSHOT
        +      
        +    
        +  
        +
        diff --git a/java-core/google-cloud-core-grpc/pom.xml b/java-core/google-cloud-core-grpc/pom.xml
        new file mode 100644
        index 0000000000..0c0a2ebc0c
        --- /dev/null
        +++ b/java-core/google-cloud-core-grpc/pom.xml
        @@ -0,0 +1,79 @@
        +
        +
        +  4.0.0
        +  com.google.cloud
        +  google-cloud-core-grpc
        +  2.66.1-SNAPSHOT
        +  jar
        +  Google Cloud Core gRPC
        +  
        +    Core gRPC module for the google-cloud.
        +  
        +  
        +    com.google.cloud
        +    google-cloud-core-parent
        +    2.66.1-SNAPSHOT
        +  
        +  
        +    google-cloud-core-grpc
        +  
        +  
        +    
        +      com.google.auth
        +      google-auth-library-credentials
        +    
        +    
        +      com.google.cloud
        +      google-cloud-core
        +    
        +    
        +      com.google.guava
        +      guava
        +    
        +    
        +      com.google.api
        +      gax
        +    
        +    
        +      com.google.api
        +      gax-grpc
        +    
        +    
        +      com.google.api
        +      api-common
        +    
        +    
        +      io.grpc
        +      grpc-api
        +    
        +    
        +      com.google.http-client
        +      google-http-client
        +    
        +    
        +      com.google.errorprone
        +      error_prone_annotations
        +    
        +
        +    
        +      org.junit.platform
        +      junit-platform-launcher
        +      test
        +    
        +    
        +      org.junit.jupiter
        +      junit-jupiter-engine
        +      test
        +    
        +    
        +      org.junit.vintage
        +      junit-vintage-engine
        +      test
        +    
        +    
        +      org.easymock
        +      easymock
        +      test
        +    
        +  
        +
        diff --git a/java-core/google-cloud-core-grpc/src/main/java/com/google/cloud/grpc/BaseGrpcServiceException.java b/java-core/google-cloud-core-grpc/src/main/java/com/google/cloud/grpc/BaseGrpcServiceException.java
        new file mode 100644
        index 0000000000..dffa4d37ee
        --- /dev/null
        +++ b/java-core/google-cloud-core-grpc/src/main/java/com/google/cloud/grpc/BaseGrpcServiceException.java
        @@ -0,0 +1,85 @@
        +/*
        + * Copyright 2017 Google LLC
        + *
        + * Licensed under the Apache License, Version 2.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.google.cloud.grpc;
        +
        +import com.google.api.client.http.HttpResponseException;
        +import com.google.api.core.BetaApi;
        +import com.google.api.core.InternalApi;
        +import com.google.api.gax.rpc.ApiException;
        +import com.google.cloud.BaseServiceException;
        +import com.google.common.base.MoreObjects;
        +import java.io.IOException;
        +import java.util.Collections;
        +
        +/** Base class for all exceptions from grpc-based services. */
        +public class BaseGrpcServiceException extends BaseServiceException {
        +
        +  private static final long serialVersionUID = -2685197215731335549L;
        +
        +  @InternalApi("This class should only be extended within google-cloud-java")
        +  protected BaseGrpcServiceException(String message, Throwable cause, int code, boolean retryable) {
        +    super(
        +        ExceptionData.newBuilder()
        +            .setMessage(message)
        +            .setCause(cause)
        +            .setCode(code)
        +            .setRetryable(retryable)
        +            .build());
        +  }
        +
        +  @InternalApi("This class should only be extended within google-cloud-java")
        +  protected BaseGrpcServiceException(IOException exception, boolean idempotent) {
        +    super(makeExceptionData(exception, idempotent));
        +  }
        +
        +  private static ExceptionData makeExceptionData(IOException exception, boolean idempotent) {
        +    int code = UNKNOWN_CODE;
        +    Boolean retryable = null;
        +    if (exception instanceof HttpResponseException) {
        +      // In cases where an exception is an instance of HttpResponseException,
        +      // check the status code to determine whether it's retryable
        +      code = ((HttpResponseException) exception).getStatusCode();
        +      retryable =
        +          BaseServiceException.isRetryable(code, null, idempotent, Collections.emptySet());
        +    }
        +    return ExceptionData.newBuilder()
        +        .setMessage(exception.getMessage())
        +        .setCause(exception)
        +        .setRetryable(
        +            MoreObjects.firstNonNull(
        +                retryable, BaseServiceException.isRetryable(idempotent, exception)))
        +        .setCode(code)
        +        .setReason(null)
        +        .setLocation(null)
        +        .setDebugInfo(null)
        +        .build();
        +  }
        +
        +  @BetaApi
        +  public BaseGrpcServiceException(ApiException apiException) {
        +    super(
        +        ExceptionData.newBuilder()
        +            .setMessage(apiException.getMessage())
        +            .setCause(apiException)
        +            .setRetryable(apiException.isRetryable())
        +            .setCode(apiException.getStatusCode().getCode().getHttpStatusCode())
        +            .setReason(apiException.getStatusCode().getCode().name())
        +            .setLocation(null)
        +            .setDebugInfo(null)
        +            .build());
        +  }
        +}
        diff --git a/java-core/google-cloud-core-grpc/src/main/java/com/google/cloud/grpc/GrpcTransportOptions.java b/java-core/google-cloud-core-grpc/src/main/java/com/google/cloud/grpc/GrpcTransportOptions.java
        new file mode 100644
        index 0000000000..4db83253a3
        --- /dev/null
        +++ b/java-core/google-cloud-core-grpc/src/main/java/com/google/cloud/grpc/GrpcTransportOptions.java
        @@ -0,0 +1,206 @@
        +/*
        + * Copyright 2016 Google LLC
        + *
        + * Licensed under the Apache License, Version 2.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.google.cloud.grpc;
        +
        +import static com.google.common.base.MoreObjects.firstNonNull;
        +
        +import com.google.api.core.BetaApi;
        +import com.google.api.core.InternalApi;
        +import com.google.api.gax.core.CredentialsProvider;
        +import com.google.api.gax.core.FixedCredentialsProvider;
        +import com.google.api.gax.core.NoCredentialsProvider;
        +import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider;
        +import com.google.api.gax.retrying.RetrySettings;
        +import com.google.api.gax.rpc.TransportChannelProvider;
        +import com.google.api.gax.rpc.UnaryCallSettings;
        +import com.google.auth.Credentials;
        +import com.google.cloud.NoCredentials;
        +import com.google.cloud.ServiceOptions;
        +import com.google.cloud.TransportOptions;
        +import com.google.common.util.concurrent.ThreadFactoryBuilder;
        +import java.io.IOException;
        +import java.io.ObjectInputStream;
        +import java.util.Objects;
        +import java.util.concurrent.ExecutorService;
        +import java.util.concurrent.ScheduledExecutorService;
        +import java.util.concurrent.ScheduledThreadPoolExecutor;
        +import java.util.concurrent.TimeUnit;
        +
        +/** Class representing service options for those services that use gRPC as the transport layer. */
        +public class GrpcTransportOptions implements TransportOptions {
        +
        +  private static final long serialVersionUID = -9049538465533951165L;
        +  private final String executorFactoryClassName;
        +
        +  private transient ExecutorFactory executorFactory;
        +
        +  /** Shared thread pool executor. */
        +  private static final SharedResourceHolder.Resource EXECUTOR =
        +      new SharedResourceHolder.Resource() {
        +        @Override
        +        public ScheduledExecutorService create() {
        +          ScheduledThreadPoolExecutor service =
        +              new ScheduledThreadPoolExecutor(
        +                  8,
        +                  new ThreadFactoryBuilder()
        +                      .setDaemon(true)
        +                      .setNameFormat("grpc-transport-%d")
        +                      .build());
        +          service.setKeepAliveTime(5, TimeUnit.SECONDS);
        +          service.allowCoreThreadTimeOut(true);
        +          service.setRemoveOnCancelPolicy(true);
        +          return service;
        +        }
        +
        +        @Override
        +        public void close(ScheduledExecutorService instance) {
        +          instance.shutdown();
        +        }
        +      };
        +
        +  /**
        +   * An interface for {@link ExecutorService} factories. Implementations of this interface can be
        +   * used to provide an user-defined executor to execute requests. Any implementation of this
        +   * interface must override the {@code get()} method to return the desired executor. The {@code
        +   * release(executor)} method should be overriden to free resources used by the executor (if
        +   * needed) according to application's logic.
        +   *
        +   * 

        Implementation must provide a public no-arg constructor. Loading of a factory implementation + * is done via {@link java.util.ServiceLoader}. + * + * @param the {@link ExecutorService} subclass created by this factory + */ + public interface ExecutorFactory { + + /** Gets an executor service instance. */ + T get(); + + /** Releases resources used by the executor and possibly shuts it down. */ + void release(T executor); + } + + @InternalApi + public static class DefaultExecutorFactory implements ExecutorFactory { + + private static final DefaultExecutorFactory INSTANCE = new DefaultExecutorFactory(); + + @Override + public ScheduledExecutorService get() { + return SharedResourceHolder.get(EXECUTOR); + } + + @Override + public synchronized void release(ScheduledExecutorService executor) { + SharedResourceHolder.release(EXECUTOR, executor); + } + } + + /** Builder for {@code GrpcTransportOptions}. */ + public static class Builder { + + private ExecutorFactory executorFactory; + + private Builder() {} + + private Builder(GrpcTransportOptions options) { + executorFactory = options.executorFactory; + } + + public GrpcTransportOptions build() { + return new GrpcTransportOptions(this); + } + + /** + * Sets the scheduled executor factory. This method can be used to provide an user-defined + * scheduled executor to execute requests. + * + * @return the builder + */ + public Builder setExecutorFactory(ExecutorFactory executorFactory) { + this.executorFactory = executorFactory; + return this; + } + } + + @SuppressWarnings("unchecked") + private GrpcTransportOptions(Builder builder) { + executorFactory = + firstNonNull( + builder.executorFactory, + ServiceOptions.getFromServiceLoader( + ExecutorFactory.class, DefaultExecutorFactory.INSTANCE)); + executorFactoryClassName = executorFactory.getClass().getName(); + } + + /** Returns a scheduled executor service provider. */ + public ExecutorFactory getExecutorFactory() { + return executorFactory; + } + + /** Returns a builder for API call settings. */ + @Deprecated + public UnaryCallSettings.Builder getApiCallSettings(RetrySettings retrySettings) { + return UnaryCallSettings.newUnaryCallSettingsBuilder().setRetrySettings(retrySettings); + } + + /** Returns a channel provider from the given default provider. */ + @BetaApi + public static TransportChannelProvider setUpChannelProvider( + InstantiatingGrpcChannelProvider.Builder providerBuilder, + ServiceOptions serviceOptions) { + providerBuilder.setEndpoint(serviceOptions.getHost()); + return providerBuilder.build(); + } + + public static CredentialsProvider setUpCredentialsProvider(ServiceOptions serviceOptions) { + Credentials scopedCredentials = serviceOptions.getScopedCredentials(); + if (scopedCredentials != null && scopedCredentials != NoCredentials.getInstance()) { + return FixedCredentialsProvider.create(scopedCredentials); + } + return NoCredentialsProvider.create(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + @Override + public int hashCode() { + return Objects.hash(executorFactoryClassName); + } + + @Override + public boolean equals(Object obj) { + if (obj == null) { + return false; + } + if (getClass() != obj.getClass()) { + return false; + } + GrpcTransportOptions other = (GrpcTransportOptions) obj; + return Objects.equals(executorFactoryClassName, other.executorFactoryClassName); + } + + private void readObject(ObjectInputStream input) throws IOException, ClassNotFoundException { + input.defaultReadObject(); + executorFactory = ServiceOptions.newInstance(executorFactoryClassName); + } + + public static Builder newBuilder() { + return new Builder(); + } +} diff --git a/java-core/google-cloud-core-grpc/src/main/java/com/google/cloud/grpc/LogExceptionRunnable.java b/java-core/google-cloud-core-grpc/src/main/java/com/google/cloud/grpc/LogExceptionRunnable.java new file mode 100644 index 0000000000..40fd6884c1 --- /dev/null +++ b/java-core/google-cloud-core-grpc/src/main/java/com/google/cloud/grpc/LogExceptionRunnable.java @@ -0,0 +1,58 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.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.google.cloud.grpc; + +import static com.google.common.base.Preconditions.checkNotNull; + +import com.google.common.base.Throwables; +import java.util.logging.Level; +import java.util.logging.Logger; + +/** + * This class was copied from grpc-core to prevent dependence on an unstable API that may be subject + * to changes + * (https://github.com/grpc/grpc-java/blob/d07ecbe037d2705a1c9f4b6345581f860e505b56/core/src/main/java/io/grpc/internal/LogExceptionRunnable.java) + * + *

        A simple wrapper for a {@link Runnable} that logs any exception thrown by it, before + * re-throwing it. + */ +final class LogExceptionRunnable implements Runnable { + + private static final Logger log = Logger.getLogger(LogExceptionRunnable.class.getName()); + + private final Runnable task; + + public LogExceptionRunnable(Runnable task) { + this.task = checkNotNull(task, "task"); + } + + @Override + public void run() { + try { + task.run(); + } catch (Throwable t) { + log.log(Level.SEVERE, "Exception while executing runnable " + task, t); + Throwables.throwIfUnchecked(t); + throw new AssertionError(t); + } + } + + @Override + public String toString() { + return "LogExceptionRunnable(" + task + ")"; + } +} diff --git a/java-core/google-cloud-core-grpc/src/main/java/com/google/cloud/grpc/SharedResourceHolder.java b/java-core/google-cloud-core-grpc/src/main/java/com/google/cloud/grpc/SharedResourceHolder.java new file mode 100644 index 0000000000..c8fc6a886b --- /dev/null +++ b/java-core/google-cloud-core-grpc/src/main/java/com/google/cloud/grpc/SharedResourceHolder.java @@ -0,0 +1,184 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.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.google.cloud.grpc; + +import com.google.common.base.Preconditions; +import com.google.common.util.concurrent.ThreadFactoryBuilder; +import java.util.IdentityHashMap; +import java.util.concurrent.*; + +/** + * This class was copied from grpc-core to prevent dependence on an unstable API that may be subject + * to changes + * (https://github.com/grpc/grpc-java/blob/d07ecbe037d2705a1c9f4b6345581f860e505b56/core/src/main/java/io/grpc/internal/SharedResourceHolder.java) + * + *

        A holder for shared resource singletons. + * + *

        Components like client channels and servers need certain resources, e.g. a thread pool, to + * run. If the user has not provided such resources, these components will use a default one, which + * is shared as a static resource. This class holds these default resources and manages their + * life-cycles. + * + *

        A resource is identified by the reference of a {@link Resource} object, which is typically a + * singleton, provided to the get() and release() methods. Each Resource object (not its class) maps + * to an object cached in the holder. + * + *

        Resources are ref-counted and shut down after a delay when the ref-count reaches zero. + */ +final class SharedResourceHolder { + static final long DESTROY_DELAY_SECONDS = 1; + + // The sole holder instance. + private static final SharedResourceHolder holder = + new SharedResourceHolder( + new ScheduledExecutorFactory() { + @Override + public ScheduledExecutorService createScheduledExecutor() { + return Executors.newSingleThreadScheduledExecutor( + getThreadFactory("grpc-shared-destroyer-%d", true)); + } + }); + + private final IdentityHashMap, Instance> instances = new IdentityHashMap<>(); + + private final ScheduledExecutorFactory destroyerFactory; + + private ScheduledExecutorService destroyer; + + // Visible to tests that would need to create instances of the holder. + SharedResourceHolder(ScheduledExecutorFactory destroyerFactory) { + this.destroyerFactory = destroyerFactory; + } + + private static ThreadFactory getThreadFactory(String nameFormat, boolean daemon) { + return new ThreadFactoryBuilder().setDaemon(daemon).setNameFormat(nameFormat).build(); + } + + /** + * Try to get an existing instance of the given resource. If an instance does not exist, create a + * new one with the given factory. + * + * @param resource the singleton object that identifies the requested static resource + */ + public static T get(Resource resource) { + return holder.getInternal(resource); + } + + /** + * Releases an instance of the given resource. + * + *

        The instance must have been obtained from {@link #get(Resource)}. Otherwise will throw + * IllegalArgumentException. + * + *

        Caller must not release a reference more than once. It's advisory that you clear the + * reference to the instance with the null returned by this method. + * + * @param resource the singleton Resource object that identifies the released static resource + * @param instance the released static resource + * @return a null which the caller can use to clear the reference to that instance. + */ + public static T release(final Resource resource, final T instance) { + return holder.releaseInternal(resource, instance); + } + + /** + * Visible to unit tests. + * + * @see #get(Resource) + */ + @SuppressWarnings("unchecked") + synchronized T getInternal(Resource resource) { + Instance instance = instances.get(resource); + if (instance == null) { + instance = new Instance(resource.create()); + instances.put(resource, instance); + } + if (instance.destroyTask != null) { + instance.destroyTask.cancel(false); + instance.destroyTask = null; + } + instance.refcount++; + return (T) instance.payload; + } + + /** Visible to unit tests. */ + synchronized T releaseInternal(final Resource resource, final T instance) { + final Instance cached = instances.get(resource); + if (cached == null) { + throw new IllegalArgumentException("No cached instance found for " + resource); + } + Preconditions.checkArgument(instance == cached.payload, "Releasing the wrong instance"); + Preconditions.checkState(cached.refcount > 0, "Refcount has already reached zero"); + cached.refcount--; + if (cached.refcount == 0) { + Preconditions.checkState(cached.destroyTask == null, "Destroy task already scheduled"); + // Schedule a delayed task to destroy the resource. + if (destroyer == null) { + destroyer = destroyerFactory.createScheduledExecutor(); + } + cached.destroyTask = + destroyer.schedule( + new LogExceptionRunnable( + new Runnable() { + @Override + public void run() { + synchronized (SharedResourceHolder.this) { + // Refcount may have gone up since the task was scheduled. Re-check it. + if (cached.refcount == 0) { + try { + resource.close(instance); + } finally { + instances.remove(resource); + if (instances.isEmpty()) { + destroyer.shutdown(); + destroyer = null; + } + } + } + } + } + }), + DESTROY_DELAY_SECONDS, + TimeUnit.SECONDS); + } + // Always returning null + return null; + } + + /** Defines a resource, and the way to create and destroy instances of it. */ + public interface Resource { + /** Create a new instance of the resource. */ + T create(); + + /** Destroy the given instance. */ + void close(T instance); + } + + interface ScheduledExecutorFactory { + ScheduledExecutorService createScheduledExecutor(); + } + + private static class Instance { + final Object payload; + int refcount; + ScheduledFuture destroyTask; + + Instance(Object payload) { + this.payload = payload; + } + } +} diff --git a/java-core/google-cloud-core-grpc/src/test/java/com/google/cloud/grpc/BaseGrpcServiceExceptionTest.java b/java-core/google-cloud-core-grpc/src/test/java/com/google/cloud/grpc/BaseGrpcServiceExceptionTest.java new file mode 100644 index 0000000000..9eb2a7fd49 --- /dev/null +++ b/java-core/google-cloud-core-grpc/src/test/java/com/google/cloud/grpc/BaseGrpcServiceExceptionTest.java @@ -0,0 +1,106 @@ +/* + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.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.google.cloud.grpc; + +import static org.easymock.EasyMock.createMock; +import static org.easymock.EasyMock.expect; +import static org.easymock.EasyMock.replay; +import static org.easymock.EasyMock.verify; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertNull; +import static org.junit.jupiter.api.Assertions.assertTrue; + +import com.google.api.gax.grpc.GrpcStatusCode; +import com.google.api.gax.rpc.InternalException; +import com.google.cloud.BaseServiceException; +import com.google.cloud.RetryHelper; +import io.grpc.Status.Code; +import java.io.IOException; +import java.net.SocketException; +import java.net.SocketTimeoutException; +import org.junit.jupiter.api.Test; + +class BaseGrpcServiceExceptionTest { + + private static final String MESSAGE = "some message"; + private static final boolean NOT_RETRYABLE = false; + private static final boolean IDEMPOTENT = true; + + @Test + void testBaseServiceException() { + BaseGrpcServiceException serviceException = null; + + IOException exception = new SocketTimeoutException(); + serviceException = new BaseGrpcServiceException(exception, IDEMPOTENT); + assertTrue(serviceException.isRetryable()); + assertNull(serviceException.getMessage()); + assertEquals(exception, serviceException.getCause()); + assertNull(serviceException.getReason()); + assertNull(serviceException.getLocation()); + assertNull(serviceException.getDebugInfo()); + + exception = new SocketException(); + serviceException = new BaseGrpcServiceException(exception, IDEMPOTENT); + assertTrue(serviceException.isRetryable()); + assertNull(serviceException.getMessage()); + assertEquals(exception, serviceException.getCause()); + assertNull(serviceException.getReason()); + assertNull(serviceException.getLocation()); + assertNull(serviceException.getDebugInfo()); + + exception = new IOException("insufficient data written"); + serviceException = new BaseGrpcServiceException(exception, IDEMPOTENT); + assertTrue(serviceException.isRetryable()); + assertEquals("insufficient data written", serviceException.getMessage()); + assertEquals(exception, serviceException.getCause()); + assertNull(serviceException.getReason()); + assertNull(serviceException.getLocation()); + assertNull(serviceException.getDebugInfo()); + + Exception cause = new IllegalArgumentException("bad arg"); + InternalException apiException = + new InternalException(MESSAGE, cause, GrpcStatusCode.of(Code.INTERNAL), NOT_RETRYABLE); + serviceException = new BaseGrpcServiceException(apiException); + assertFalse(serviceException.isRetryable()); + assertEquals(MESSAGE, serviceException.getMessage()); + assertEquals(apiException, serviceException.getCause()); + assertEquals(500, serviceException.getCode()); + assertEquals(Code.INTERNAL.name(), serviceException.getReason()); + assertNull(serviceException.getLocation()); + assertNull(serviceException.getDebugInfo()); + } + + @Test + void testTranslateAndThrow() throws Exception { + IOException exception = new SocketTimeoutException(); + BaseGrpcServiceException cause = new BaseGrpcServiceException(exception, IDEMPOTENT); + RetryHelper.RetryHelperException exceptionMock = + createMock(RetryHelper.RetryHelperException.class); + expect(exceptionMock.getCause()).andReturn(cause).times(2); + replay(exceptionMock); + try { + BaseServiceException.translate(exceptionMock); + } catch (BaseServiceException ex) { + assertEquals(0, ex.getCode()); + assertNull(ex.getMessage()); + assertTrue(ex.isRetryable()); + } finally { + verify(exceptionMock); + } + } +} diff --git a/java-core/google-cloud-core-grpc/src/test/java/com/google/cloud/grpc/GrpcTransportOptionsTest.java b/java-core/google-cloud-core-grpc/src/test/java/com/google/cloud/grpc/GrpcTransportOptionsTest.java new file mode 100644 index 0000000000..a112dd5e07 --- /dev/null +++ b/java-core/google-cloud-core-grpc/src/test/java/com/google/cloud/grpc/GrpcTransportOptionsTest.java @@ -0,0 +1,70 @@ +/* + * Copyright 2016 Google LLC + * + * Licensed under the Apache License, Version 2.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.google.cloud.grpc; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotEquals; +import static org.junit.jupiter.api.Assertions.assertSame; +import static org.junit.jupiter.api.Assertions.assertTrue; + +import com.google.cloud.grpc.GrpcTransportOptions.DefaultExecutorFactory; +import com.google.cloud.grpc.GrpcTransportOptions.ExecutorFactory; +import java.util.concurrent.ScheduledExecutorService; +import org.easymock.EasyMock; +import org.junit.jupiter.api.Test; + +class GrpcTransportOptionsTest { + + private static final ExecutorFactory MOCK_EXECUTOR_FACTORY = + EasyMock.createMock(ExecutorFactory.class); + private static final GrpcTransportOptions OPTIONS = + GrpcTransportOptions.newBuilder().setExecutorFactory(MOCK_EXECUTOR_FACTORY).build(); + private static final GrpcTransportOptions DEFAULT_OPTIONS = + GrpcTransportOptions.newBuilder().build(); + private static final GrpcTransportOptions OPTIONS_COPY = OPTIONS.toBuilder().build(); + + @Test + void testBuilder() { + assertSame(MOCK_EXECUTOR_FACTORY, OPTIONS.getExecutorFactory()); + assertTrue(DEFAULT_OPTIONS.getExecutorFactory() instanceof DefaultExecutorFactory); + } + + @Test + void testBaseEquals() { + assertEquals(OPTIONS, OPTIONS_COPY); + assertNotEquals(DEFAULT_OPTIONS, OPTIONS); + GrpcTransportOptions options = + OPTIONS.toBuilder().setExecutorFactory(new DefaultExecutorFactory()).build(); + assertNotEquals(OPTIONS, options); + } + + @Test + void testBaseHashCode() { + assertEquals(OPTIONS.hashCode(), OPTIONS_COPY.hashCode()); + assertNotEquals(DEFAULT_OPTIONS.hashCode(), OPTIONS.hashCode()); + GrpcTransportOptions options = + OPTIONS.toBuilder().setExecutorFactory(new DefaultExecutorFactory()).build(); + assertNotEquals(OPTIONS.hashCode(), options.hashCode()); + } + + @Test + void testDefaultExecutorFactory() { + ExecutorFactory executorFactory = new DefaultExecutorFactory(); + ScheduledExecutorService executorService = executorFactory.get(); + assertSame(executorService, executorFactory.get()); + } +} diff --git a/java-core/google-cloud-core-grpc/src/test/java/com/google/cloud/grpc/SharedResourceHolderTest.java b/java-core/google-cloud-core-grpc/src/test/java/com/google/cloud/grpc/SharedResourceHolderTest.java new file mode 100644 index 0000000000..3e1ceee9ef --- /dev/null +++ b/java-core/google-cloud-core-grpc/src/test/java/com/google/cloud/grpc/SharedResourceHolderTest.java @@ -0,0 +1,300 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.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.google.cloud.grpc; + +import static org.easymock.EasyMock.anyLong; +import static org.easymock.EasyMock.anyObject; +import static org.easymock.EasyMock.createNiceMock; +import static org.easymock.EasyMock.expect; +import static org.easymock.EasyMock.replay; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertNotSame; +import static org.junit.jupiter.api.Assertions.assertNull; +import static org.junit.jupiter.api.Assertions.assertSame; +import static org.junit.jupiter.api.Assertions.assertTrue; +import static org.junit.jupiter.api.Assertions.fail; + +import java.util.LinkedList; +import java.util.concurrent.Delayed; +import java.util.concurrent.ScheduledExecutorService; +import java.util.concurrent.ScheduledFuture; +import java.util.concurrent.TimeUnit; +import org.easymock.EasyMock; +import org.easymock.IAnswer; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; + +/** + * This class was copied from grpc-core to prevent dependence on an unstable API that may be subject + * to changes (SharedResourceHolderTest) + * + *

        Unit tests for {@link SharedResourceHolder}. + */ +class SharedResourceHolderTest { + + private final LinkedList> scheduledDestroyTasks = new LinkedList<>(); + + private SharedResourceHolder holder; + + private static class ResourceInstance { + volatile boolean closed; + } + + private static class ResourceFactory implements SharedResourceHolder.Resource { + @Override + public ResourceInstance create() { + return new ResourceInstance(); + } + + @Override + public void close(ResourceInstance instance) { + instance.closed = true; + } + } + + // Defines two kinds of resources + private static final SharedResourceHolder.Resource SHARED_FOO = + new ResourceFactory(); + private static final SharedResourceHolder.Resource SHARED_BAR = + new ResourceFactory(); + + @BeforeEach + void setUp() { + holder = new SharedResourceHolder(new MockExecutorFactory()); + } + + @Test + void destroyResourceWhenRefCountReachesZero() { + ResourceInstance foo1 = holder.getInternal(SHARED_FOO); + ResourceInstance sharedFoo = foo1; + ResourceInstance foo2 = holder.getInternal(SHARED_FOO); + assertSame(sharedFoo, foo2); + + ResourceInstance bar1 = holder.getInternal(SHARED_BAR); + ResourceInstance sharedBar = bar1; + + foo2 = holder.releaseInternal(SHARED_FOO, foo2); + // foo refcount not reached 0, thus shared foo is not closed + assertTrue(scheduledDestroyTasks.isEmpty()); + assertFalse(sharedFoo.closed); + assertNull(foo2); + + foo1 = holder.releaseInternal(SHARED_FOO, foo1); + assertNull(foo1); + + // foo refcount has reached 0, a destroying task is scheduled + assertEquals(1, scheduledDestroyTasks.size()); + MockScheduledFuture scheduledDestroyTask = scheduledDestroyTasks.poll(); + assertEquals( + SharedResourceHolder.DESTROY_DELAY_SECONDS, + scheduledDestroyTask.getDelay(TimeUnit.SECONDS)); + + // Simluate that the destroyer executes the foo destroying task + scheduledDestroyTask.runTask(); + assertTrue(sharedFoo.closed); + + // After the destroying, obtaining a foo will get a different instance + ResourceInstance foo3 = holder.getInternal(SHARED_FOO); + assertNotSame(sharedFoo, foo3); + + holder.releaseInternal(SHARED_BAR, bar1); + + // bar refcount has reached 0, a destroying task is scheduled + assertEquals(1, scheduledDestroyTasks.size()); + scheduledDestroyTask = scheduledDestroyTasks.poll(); + assertEquals( + SharedResourceHolder.DESTROY_DELAY_SECONDS, + scheduledDestroyTask.getDelay(TimeUnit.SECONDS)); + + // Simulate that the destroyer executes the bar destroying task + scheduledDestroyTask.runTask(); + assertTrue(sharedBar.closed); + } + + @Test + void cancelDestroyTask() { + ResourceInstance foo1 = holder.getInternal(SHARED_FOO); + ResourceInstance sharedFoo = foo1; + holder.releaseInternal(SHARED_FOO, foo1); + // A destroying task for foo is scheduled + MockScheduledFuture scheduledDestroyTask = scheduledDestroyTasks.poll(); + assertFalse(scheduledDestroyTask.cancelled); + + // obtaining a foo before the destroying task is executed will cancel the destroy + ResourceInstance foo2 = holder.getInternal(SHARED_FOO); + assertTrue(scheduledDestroyTask.cancelled); + assertTrue(scheduledDestroyTasks.isEmpty()); + assertFalse(sharedFoo.closed); + + // And it will be the same foo instance + assertSame(sharedFoo, foo2); + + // Release it and the destroying task is scheduled again + holder.releaseInternal(SHARED_FOO, foo2); + scheduledDestroyTask = scheduledDestroyTasks.poll(); + assertNotNull(scheduledDestroyTask); + assertFalse(scheduledDestroyTask.cancelled); + scheduledDestroyTask.runTask(); + assertTrue(sharedFoo.closed); + } + + @Test + void releaseWrongInstance() { + ResourceInstance uncached = new ResourceInstance(); + try { + holder.releaseInternal(SHARED_FOO, uncached); + fail("Should throw IllegalArgumentException"); + } catch (IllegalArgumentException e) { + // expected + } + ResourceInstance cached = holder.getInternal(SHARED_FOO); + try { + holder.releaseInternal(SHARED_FOO, uncached); + fail("Should throw IllegalArgumentException"); + } catch (IllegalArgumentException e) { + // expected + } + holder.releaseInternal(SHARED_FOO, cached); + } + + @Test + void overreleaseInstance() { + ResourceInstance foo1 = holder.getInternal(SHARED_FOO); + holder.releaseInternal(SHARED_FOO, foo1); + try { + holder.releaseInternal(SHARED_FOO, foo1); + fail("Should throw IllegalStateException"); + } catch (IllegalStateException e) { + // expected + } + } + + @Test + void handleInstanceCloseError() { + class ExceptionOnCloseResource implements SharedResourceHolder.Resource { + @Override + public ResourceInstance create() { + return new ResourceInstance(); + } + + @Override + public void close(ResourceInstance instance) { + throw new RuntimeException(); + } + } + + SharedResourceHolder.Resource resource = new ExceptionOnCloseResource(); + ResourceInstance instance = holder.getInternal(resource); + holder.releaseInternal(resource, instance); + MockScheduledFuture scheduledDestroyTask = scheduledDestroyTasks.poll(); + try { + scheduledDestroyTask.runTask(); + fail("Should throw RuntimeException"); + } catch (RuntimeException e) { + // expected + } + + // Future resource fetches should not get the partially-closed one. + assertNotSame(instance, holder.getInternal(resource)); + } + + private class MockExecutorFactory implements SharedResourceHolder.ScheduledExecutorFactory { + @Override + public ScheduledExecutorService createScheduledExecutor() { + ScheduledExecutorService mockExecutor = createNiceMock(ScheduledExecutorService.class); + expect(mockExecutor.schedule(anyObject(Runnable.class), anyLong(), anyObject(TimeUnit.class))) + .andAnswer( + new IAnswer() { + @Override + public ScheduledFuture answer() throws Throwable { + Object[] args = EasyMock.getCurrentArguments(); + Runnable command = (Runnable) args[0]; + long delay = (Long) args[1]; + TimeUnit unit = (TimeUnit) args[2]; + MockScheduledFuture future = + new MockScheduledFuture<>(command, delay, unit); + scheduledDestroyTasks.add(future); + return future; + } + }) + .anyTimes(); + replay(mockExecutor); + return mockExecutor; + } + } + + protected static class MockScheduledFuture implements java.util.concurrent.ScheduledFuture { + private boolean cancelled; + private boolean finished; + final Runnable command; + final long delay; + final TimeUnit unit; + + MockScheduledFuture(Runnable command, long delay, TimeUnit unit) { + this.command = command; + this.delay = delay; + this.unit = unit; + } + + void runTask() { + command.run(); + finished = true; + } + + @Override + public boolean cancel(boolean interrupt) { + if (cancelled || finished) { + return false; + } + cancelled = true; + return true; + } + + @Override + public boolean isCancelled() { + return cancelled; + } + + @Override + public long getDelay(TimeUnit targetUnit) { + return targetUnit.convert(this.delay, this.unit); + } + + @Override + public int compareTo(Delayed o) { + throw new UnsupportedOperationException(); + } + + @Override + public boolean isDone() { + return cancelled || finished; + } + + @Override + public V get() { + throw new UnsupportedOperationException(); + } + + @Override + public V get(long timeout, TimeUnit unit) { + throw new UnsupportedOperationException(); + } + } +} diff --git a/java-core/google-cloud-core-http/pom.xml b/java-core/google-cloud-core-http/pom.xml new file mode 100644 index 0000000000..cb72fb443b --- /dev/null +++ b/java-core/google-cloud-core-http/pom.xml @@ -0,0 +1,105 @@ + + + 4.0.0 + com.google.cloud + google-cloud-core-http + 2.66.1-SNAPSHOT + jar + Google Cloud Core HTTP + + Core http module for the google-cloud. + + + com.google.cloud + google-cloud-core-parent + 2.66.1-SNAPSHOT + + + google-cloud-core-http + + + + com.google.cloud + google-cloud-core + + + com.google.auth + google-auth-library-credentials + + + com.google.auth + google-auth-library-oauth2-http + + + com.google.http-client + google-http-client + + + com.google.guava + guava + + + com.google.api-client + google-api-client + + + com.google.http-client + google-http-client-appengine + + + com.google.api + gax + + + com.google.api + gax-httpjson + + + com.google.code.findbugs + jsr305 + + + io.opencensus + opencensus-api + + + io.opencensus + opencensus-contrib-http-util + + + com.google.api + api-common + + + com.google.errorprone + error_prone_annotations + + + + + org.junit.platform + junit-platform-launcher + test + + + org.junit.jupiter + junit-jupiter-engine + test + + + org.junit.vintage + junit-vintage-engine + test + + + org.easymock + easymock + test + + + com.google.truth + truth + test + + + diff --git a/java-core/google-cloud-core-http/src/main/java/com/google/cloud/http/BaseHttpServiceException.java b/java-core/google-cloud-core-http/src/main/java/com/google/cloud/http/BaseHttpServiceException.java new file mode 100644 index 0000000000..26f43b276f --- /dev/null +++ b/java-core/google-cloud-core-http/src/main/java/com/google/cloud/http/BaseHttpServiceException.java @@ -0,0 +1,166 @@ +/* + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.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.google.cloud.http; + +import com.google.api.client.googleapis.json.GoogleJsonError; +import com.google.api.client.googleapis.json.GoogleJsonResponseException; +import com.google.api.client.http.HttpResponseException; +import com.google.api.core.InternalApi; +import com.google.cloud.BaseServiceException; +import com.google.common.base.MoreObjects; +import java.io.IOException; +import java.util.Set; + +/** Base class for all exceptions from http-based services. */ +public class BaseHttpServiceException extends BaseServiceException { + + private static final long serialVersionUID = -5793034110344127954L; + public static final int UNKNOWN_CODE = 0; + + @InternalApi("This class should only be extended within google-cloud-java") + protected BaseHttpServiceException( + IOException exception, boolean idempotent, Set retryableErrors) { + super(makeExceptionData(exception, idempotent, retryableErrors)); + } + + private static ExceptionData makeExceptionData( + IOException exception, boolean idempotent, Set retryableErrors) { + int code = UNKNOWN_CODE; + String reason = null; + String location = null; + String debugInfo = null; + Boolean retryable = null; + if (exception instanceof HttpResponseException) { + if (exception instanceof GoogleJsonResponseException) { + GoogleJsonError jsonError = ((GoogleJsonResponseException) exception).getDetails(); + if (jsonError != null) { + BaseServiceException.Error error = + new BaseServiceException.Error(jsonError.getCode(), reason(jsonError)); + code = error.getCode(); + reason = error.getReason(); + retryable = error.isRetryable(idempotent, retryableErrors); + if (reason != null) { + GoogleJsonError.ErrorInfo errorInfo = jsonError.getErrors().get(0); + location = errorInfo.getLocation(); + debugInfo = (String) errorInfo.get("debugInfo"); + } + } else { + code = ((GoogleJsonResponseException) exception).getStatusCode(); + retryable = BaseServiceException.isRetryable(code, null, idempotent, retryableErrors); + } + } else { + // In cases where an exception is an instance of HttpResponseException but not + // an instance of GoogleJsonResponseException, check the status code to determine whether + // it's retryable + code = ((HttpResponseException) exception).getStatusCode(); + retryable = BaseServiceException.isRetryable(code, null, idempotent, retryableErrors); + } + } + return ExceptionData.newBuilder() + .setMessage(message(exception)) + .setCause(exception) + .setRetryable( + MoreObjects.firstNonNull( + retryable, BaseServiceException.isRetryable(idempotent, exception))) + .setCode(code) + .setReason(reason) + .setLocation(location) + .setDebugInfo(debugInfo) + .build(); + } + + @InternalApi("This class should only be extended within google-cloud-java") + protected BaseHttpServiceException( + GoogleJsonError googleJsonError, + boolean idempotent, + Set retryableErrors) { + super(makeExceptionData(googleJsonError, idempotent, retryableErrors)); + } + + private static ExceptionData makeExceptionData( + GoogleJsonError googleJsonError, + boolean idempotent, + Set retryableErrors) { + int code = googleJsonError.getCode(); + String reason = reason(googleJsonError); + + ExceptionData.Builder exceptionData = ExceptionData.newBuilder(); + exceptionData + .setMessage(googleJsonError.getMessage()) + .setCause(null) + .setRetryable(BaseServiceException.isRetryable(code, reason, idempotent, retryableErrors)) + .setCode(code) + .setReason(reason); + if (reason != null) { + GoogleJsonError.ErrorInfo errorInfo = googleJsonError.getErrors().get(0); + exceptionData.setLocation(errorInfo.getLocation()); + exceptionData.setDebugInfo((String) errorInfo.get("debugInfo")); + } else { + exceptionData.setLocation(null); + exceptionData.setDebugInfo(null); + } + return exceptionData.build(); + } + + @InternalApi("This class should only be extended within google-cloud-java") + protected BaseHttpServiceException( + int code, + String message, + String reason, + boolean idempotent, + Set retryableErrors) { + this(code, message, reason, idempotent, retryableErrors, null); + } + + @InternalApi("This class should only be extended within google-cloud-java") + protected BaseHttpServiceException( + int code, + String message, + String reason, + boolean idempotent, + Set retryableErrors, + Throwable cause) { + super( + ExceptionData.newBuilder() + .setMessage(message) + .setCause(cause) + .setRetryable( + BaseServiceException.isRetryable(code, reason, idempotent, retryableErrors)) + .setCode(code) + .setReason(reason) + .setLocation(null) + .setDebugInfo(null) + .build()); + } + + private static String reason(GoogleJsonError error) { + if (error.getErrors() != null && !error.getErrors().isEmpty()) { + return error.getErrors().get(0).getReason(); + } + return null; + } + + private static String message(IOException exception) { + if (exception instanceof GoogleJsonResponseException) { + GoogleJsonError details = ((GoogleJsonResponseException) exception).getDetails(); + if (details != null) { + return details.getMessage(); + } + } + return exception.getMessage(); + } +} diff --git a/java-core/google-cloud-core-http/src/main/java/com/google/cloud/http/CensusHttpModule.java b/java-core/google-cloud-core-http/src/main/java/com/google/cloud/http/CensusHttpModule.java new file mode 100644 index 0000000000..d141507cc0 --- /dev/null +++ b/java-core/google-cloud-core-http/src/main/java/com/google/cloud/http/CensusHttpModule.java @@ -0,0 +1,156 @@ +/* + * 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. + */ + +package com.google.cloud.http; + +import static com.google.common.base.Preconditions.checkNotNull; + +import com.google.api.client.http.HttpExecuteInterceptor; +import com.google.api.client.http.HttpHeaders; +import com.google.api.client.http.HttpRequest; +import com.google.api.client.http.HttpRequestInitializer; +import com.google.common.annotations.VisibleForTesting; +import io.opencensus.contrib.http.util.HttpPropagationUtil; +import io.opencensus.trace.SpanContext; +import io.opencensus.trace.Tracer; +import io.opencensus.trace.propagation.TextFormat; +import java.io.IOException; +import javax.annotation.Nullable; + +/** + * Provides utilities for Open Census to record http stats/trace information and propagate tracing + * context. + */ +public final class CensusHttpModule { + + /** + * OpenCensus tracing component. When no OpenCensus implementation is provided, it will return a + * no-op tracer. + */ + private final Tracer tracer; + + /** {@link TextFormat} used in tracing context propagation. */ + @Nullable private final TextFormat propagationTextFormat; + + /** {@link TextFormat.Setter} for {@link #propagationTextFormat}. */ + @Nullable private final TextFormat.Setter propagationTextFormatSetter; + + /** Whether spans are stored locally. */ + private final boolean isRecordEvents; + + /** Default HTTP propagation text formatter. */ + @VisibleForTesting + static final class DefaultPropagationTextFormatSetter extends TextFormat.Setter { + static final TextFormat.Setter INSTANCE = new DefaultPropagationTextFormatSetter(); + + @Override + public void put(HttpHeaders carrier, String key, String value) { + carrier.set(key, value); + } + } + + /** + * An {@link HttpExecuteInterceptor} implementation to inject HTTP request and add getContext + * information before it is executed. + */ + @VisibleForTesting + final class CensusHttpExecuteInterceptor implements HttpExecuteInterceptor { + @Nullable HttpExecuteInterceptor interceptor; + + CensusHttpExecuteInterceptor(HttpExecuteInterceptor interceptor) { + this.interceptor = interceptor; + } + + @Override + public void intercept(HttpRequest request) throws IOException { + checkNotNull(request); + if (this.interceptor != null) { + this.interceptor.intercept(request); + } + if (propagationTextFormat != null && propagationTextFormatSetter != null) { + SpanContext spanContext = tracer.getCurrentSpan().getContext(); + if (!SpanContext.INVALID.equals(spanContext)) { + propagationTextFormat.inject( + spanContext, request.getHeaders(), propagationTextFormatSetter); + } + } + } + } + + /** + * An {@link HttpRequestInitializer} implementation to set {@link CensusHttpExecuteInterceptor} as + * interceptor. + */ + @VisibleForTesting + final class CensusHttpRequestInitializer implements HttpRequestInitializer { + @Nullable HttpRequestInitializer initializer; + + CensusHttpRequestInitializer(HttpRequestInitializer initializer) { + this.initializer = initializer; + } + + @Override + public void initialize(HttpRequest request) throws IOException { + checkNotNull(request); + if (this.initializer != null) { + this.initializer.initialize(request); + } + request.setInterceptor(new CensusHttpExecuteInterceptor(request.getInterceptor())); + } + } + + /** + * Creates a {@link CensusHttpModule} with given parameters. + * + * @param tracer the OpenCensus {@code Tracer}. + * @param isRecordEvents whether spans are stored locally. + */ + public CensusHttpModule(Tracer tracer, boolean isRecordEvents) { + checkNotNull(tracer, "tracer"); + this.tracer = tracer; + this.isRecordEvents = isRecordEvents; + this.propagationTextFormat = HttpPropagationUtil.getCloudTraceFormat(); + this.propagationTextFormatSetter = DefaultPropagationTextFormatSetter.INSTANCE; + } + + /** + * Returns the tracing component of OpenCensus. + * + * @return the tracing component of OpenCensus. + */ + public Tracer getTracer() { + return tracer; + } + + /** + * Returns whether spans are stored locally. + * + * @return whether spans are stored locally. + */ + public boolean isRecordEvents() { + return isRecordEvents; + } + + /** + * Returns the {@link HttpExecuteInterceptor} used when initializing the {@link HttpRequest}. + * + * @param initializer the original initializer which will be executed before this initializer. + * @return the {@code HttpExecuteInterceptor}. + */ + public HttpRequestInitializer getHttpRequestInitializer(HttpRequestInitializer initializer) { + return new CensusHttpRequestInitializer(initializer); + } +} diff --git a/java-core/google-cloud-core-http/src/main/java/com/google/cloud/http/HttpTransportOptions.java b/java-core/google-cloud-core-http/src/main/java/com/google/cloud/http/HttpTransportOptions.java new file mode 100644 index 0000000000..f5ad54532f --- /dev/null +++ b/java-core/google-cloud-core-http/src/main/java/com/google/cloud/http/HttpTransportOptions.java @@ -0,0 +1,271 @@ +/* + * Copyright 2016 Google LLC + * + * Licensed under the Apache License, Version 2.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.google.cloud.http; + +import static com.google.common.base.MoreObjects.firstNonNull; + +import com.google.api.client.extensions.appengine.http.UrlFetchTransport; +import com.google.api.client.http.HttpRequest; +import com.google.api.client.http.HttpRequestInitializer; +import com.google.api.client.http.HttpTransport; +import com.google.api.client.http.javanet.NetHttpTransport; +import com.google.api.gax.core.GaxProperties; +import com.google.api.gax.httpjson.HttpHeadersUtils; +import com.google.api.gax.httpjson.HttpJsonStatusCode; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.EndpointContext; +import com.google.api.gax.rpc.HeaderProvider; +import com.google.api.gax.rpc.StatusCode; +import com.google.api.gax.rpc.UnauthenticatedException; +import com.google.auth.Credentials; +import com.google.auth.http.HttpCredentialsAdapter; +import com.google.auth.http.HttpTransportFactory; +import com.google.cloud.NoCredentials; +import com.google.cloud.PlatformInformation; +import com.google.cloud.ServiceOptions; +import com.google.cloud.TransportOptions; +import java.io.IOException; +import java.io.ObjectInputStream; +import java.util.Objects; + +/** Class representing service options for those services that use HTTP as the transport layer. */ +public class HttpTransportOptions implements TransportOptions { + + private static final long serialVersionUID = 7890117765045419810L; + private final int connectTimeout; + private final int readTimeout; + private final String httpTransportFactoryClassName; + + private transient HttpTransportFactory httpTransportFactory; + + public static class DefaultHttpTransportFactory implements HttpTransportFactory { + + private static final HttpTransportFactory INSTANCE = new DefaultHttpTransportFactory(); + + @Override + public HttpTransport create() { + // Consider App Engine Standard + if (PlatformInformation.isOnGAEStandard7()) { + try { + return new UrlFetchTransport(); + } catch (Exception ignore) { + // Maybe not on App Engine + } + } + return new NetHttpTransport(); + } + } + + /** Builder for {@code HttpTransportOptions}. */ + public static class Builder { + + private HttpTransportFactory httpTransportFactory; + private int connectTimeout = -1; + private int readTimeout = -1; + + private Builder() {} + + private Builder(HttpTransportOptions options) { + httpTransportFactory = options.httpTransportFactory; + connectTimeout = options.connectTimeout; + readTimeout = options.readTimeout; + } + + public HttpTransportOptions build() { + return new HttpTransportOptions(this); + } + + /** + * Sets the HTTP transport factory. + * + * @return the builder + */ + public Builder setHttpTransportFactory(HttpTransportFactory httpTransportFactory) { + this.httpTransportFactory = httpTransportFactory; + return this; + } + + /** + * Sets the timeout in milliseconds to establish a connection. + * + * @param connectTimeout connection timeout in milliseconds. 0 for an infinite timeout, a + * negative number for the default value (20000). + * @return the builder + */ + public Builder setConnectTimeout(int connectTimeout) { + this.connectTimeout = connectTimeout; + return this; + } + + /** + * Sets the timeout in milliseconds to read data from an established connection. + * + * @param readTimeout read timeout in milliseconds. 0 for an infinite timeout, a negative number + * for the default value (20000). + * @return the builder + */ + public Builder setReadTimeout(int readTimeout) { + this.readTimeout = readTimeout; + return this; + } + } + + public HttpTransportOptions(Builder builder) { + httpTransportFactory = + firstNonNull( + builder.httpTransportFactory, + ServiceOptions.getFromServiceLoader( + HttpTransportFactory.class, DefaultHttpTransportFactory.INSTANCE)); + httpTransportFactoryClassName = httpTransportFactory.getClass().getName(); + connectTimeout = builder.connectTimeout; + readTimeout = builder.readTimeout; + } + + /** Returns the HTTP transport factory. */ + public HttpTransportFactory getHttpTransportFactory() { + return httpTransportFactory; + } + + /** + * Returns a request initializer responsible for initializing requests according to service + * options. + */ + public HttpRequestInitializer getHttpRequestInitializer( + final ServiceOptions serviceOptions) { + Credentials scopedCredentials = serviceOptions.getScopedCredentials(); + final HttpRequestInitializer delegate = + scopedCredentials != null && scopedCredentials != NoCredentials.getInstance() + ? new HttpCredentialsAdapter(scopedCredentials) + : null; + HeaderProvider internalHeaderProvider = + getInternalHeaderProviderBuilder(serviceOptions).build(); + final HeaderProvider headerProvider = + serviceOptions.getMergedHeaderProvider(internalHeaderProvider); + + return new HttpRequestInitializer() { + + /** + * Helper method to resolve the Universe Domain. First checks the user configuration from + * ServiceOptions, then the Environment Variable. If both haven't been set, resolve the value + * to be the Google Default Universe. + */ + private String determineUniverseDomain() { + String universeDomain = serviceOptions.getUniverseDomain(); + if (universeDomain == null) { + universeDomain = System.getenv(EndpointContext.GOOGLE_CLOUD_UNIVERSE_DOMAIN); + } + return universeDomain == null ? Credentials.GOOGLE_DEFAULT_UNIVERSE : universeDomain; + } + + @Override + public void initialize(HttpRequest httpRequest) throws IOException { + String configuredUniverseDomain = determineUniverseDomain(); + // Default to the GDU. Override with value in the Credentials if needed + String credentialsUniverseDomain = Credentials.GOOGLE_DEFAULT_UNIVERSE; + + // delegate is always HttpCredentialsAdapter or null (NoCredentials) + if (delegate != null) { + HttpCredentialsAdapter httpCredentialsAdapter = (HttpCredentialsAdapter) delegate; + credentialsUniverseDomain = httpCredentialsAdapter.getCredentials().getUniverseDomain(); + } + + // Validate the universe domain before initializing the request + if (!configuredUniverseDomain.equals(credentialsUniverseDomain)) { + throw new UnauthenticatedException( + new Throwable( + String.format( + EndpointContext.INVALID_UNIVERSE_DOMAIN_ERROR_TEMPLATE, + configuredUniverseDomain, + credentialsUniverseDomain)), + HttpJsonStatusCode.of(StatusCode.Code.UNAUTHENTICATED), + false); + } + + if (delegate != null) { + delegate.initialize(httpRequest); + } + + if (connectTimeout >= 0) { + httpRequest.setConnectTimeout(connectTimeout); + } + if (readTimeout >= 0) { + httpRequest.setReadTimeout(readTimeout); + } + + HttpHeadersUtils.setHeaders(httpRequest.getHeaders(), headerProvider.getHeaders()); + } + }; + } + + ApiClientHeaderProvider.Builder getInternalHeaderProviderBuilder( + ServiceOptions serviceOptions) { + ApiClientHeaderProvider.Builder builder = ApiClientHeaderProvider.newBuilder(); + builder.setClientLibToken( + ServiceOptions.getGoogApiClientLibName(), + GaxProperties.getLibraryVersion(serviceOptions.getClass())); + builder.setQuotaProjectIdToken(serviceOptions.getQuotaProjectId()); + return builder; + } + + /** + * Returns the timeout in milliseconds to establish a connection. 0 is an infinite timeout, a + * negative number is the default value (20000). + */ + public int getConnectTimeout() { + return connectTimeout; + } + + /** + * Returns the timeout in milliseconds to read from an established connection. 0 is an infinite + * timeout, a negative number is the default value (20000). + */ + public int getReadTimeout() { + return readTimeout; + } + + public Builder toBuilder() { + return new Builder(this); + } + + @Override + public int hashCode() { + return Objects.hash(httpTransportFactoryClassName, connectTimeout, readTimeout); + } + + @Override + public boolean equals(Object obj) { + if (obj == null) { + return false; + } + if (getClass() != obj.getClass()) { + return false; + } + HttpTransportOptions other = (HttpTransportOptions) obj; + return Objects.equals(httpTransportFactoryClassName, other.httpTransportFactoryClassName) + && Objects.equals(connectTimeout, other.connectTimeout) + && Objects.equals(readTimeout, other.readTimeout); + } + + private void readObject(ObjectInputStream input) throws IOException, ClassNotFoundException { + input.defaultReadObject(); + httpTransportFactory = ServiceOptions.newInstance(httpTransportFactoryClassName); + } + + public static Builder newBuilder() { + return new Builder(); + } +} diff --git a/java-core/google-cloud-core-http/src/test/java/com/google/cloud/http/BaseHttpServiceExceptionTest.java b/java-core/google-cloud-core-http/src/test/java/com/google/cloud/http/BaseHttpServiceExceptionTest.java new file mode 100644 index 0000000000..885cb7511d --- /dev/null +++ b/java-core/google-cloud-core-http/src/test/java/com/google/cloud/http/BaseHttpServiceExceptionTest.java @@ -0,0 +1,165 @@ +/* + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.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.google.cloud.http; + +import static com.google.cloud.BaseServiceException.UNKNOWN_CODE; +import static org.easymock.EasyMock.createMock; +import static org.easymock.EasyMock.expect; +import static org.easymock.EasyMock.replay; +import static org.easymock.EasyMock.verify; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertNull; +import static org.junit.jupiter.api.Assertions.assertTrue; + +import com.google.api.client.googleapis.json.GoogleJsonError; +import com.google.cloud.BaseServiceException; +import com.google.cloud.RetryHelper; +import com.google.common.collect.ImmutableSet; +import java.io.IOException; +import java.net.SocketException; +import java.net.SocketTimeoutException; +import java.util.Collections; +import java.util.Set; +import org.junit.jupiter.api.Test; + +class BaseHttpServiceExceptionTest { + + private static final int CODE = 1; + private static final int CODE_NO_REASON = 2; + private static final String MESSAGE = "some message"; + private static final String REASON = "some reason"; + private static final boolean RETRYABLE = true; + private static final boolean IDEMPOTENT = true; + private static final boolean NOT_IDEMPOTENT = false; + private static final Set EMPTY_RETRYABLE_ERRORS = + Collections.emptySet(); + + private static class CustomServiceException extends BaseHttpServiceException { + + private static final long serialVersionUID = -195251309124875103L; + + CustomServiceException(int code, String message, String reason, boolean idempotent) { + super(code, message, reason, idempotent, RETRYABLE_ERRORS); + } + + private static final Set RETRYABLE_ERRORS = + ImmutableSet.of( + new Error(CODE, REASON), new Error(null, REASON), new Error(CODE_NO_REASON, null)); + } + + @Test + void testBaseServiceException() { + BaseServiceException serviceException = + new BaseHttpServiceException(CODE, MESSAGE, REASON, IDEMPOTENT, EMPTY_RETRYABLE_ERRORS); + assertEquals(CODE, serviceException.getCode()); + assertEquals(MESSAGE, serviceException.getMessage()); + assertEquals(REASON, serviceException.getReason()); + assertFalse(serviceException.isRetryable()); + assertNull(serviceException.getCause()); + + serviceException = + new BaseHttpServiceException(CODE, MESSAGE, REASON, IDEMPOTENT, EMPTY_RETRYABLE_ERRORS); + assertEquals(CODE, serviceException.getCode()); + assertEquals(MESSAGE, serviceException.getMessage()); + assertEquals(REASON, serviceException.getReason()); + assertFalse(serviceException.isRetryable()); + assertNull(serviceException.getCause()); + + Exception cause = new RuntimeException(); + serviceException = + new BaseHttpServiceException( + CODE, MESSAGE, REASON, IDEMPOTENT, EMPTY_RETRYABLE_ERRORS, cause); + assertEquals(CODE, serviceException.getCode()); + assertEquals(MESSAGE, serviceException.getMessage()); + assertEquals(REASON, serviceException.getReason()); + assertFalse(serviceException.isRetryable()); + assertEquals(cause, serviceException.getCause()); + + serviceException = + new BaseHttpServiceException( + CODE, MESSAGE, REASON, NOT_IDEMPOTENT, EMPTY_RETRYABLE_ERRORS, cause); + assertEquals(CODE, serviceException.getCode()); + assertEquals(MESSAGE, serviceException.getMessage()); + assertEquals(REASON, serviceException.getReason()); + assertFalse(serviceException.isRetryable()); + assertEquals(cause, serviceException.getCause()); + + IOException exception = new SocketTimeoutException(); + serviceException = new BaseHttpServiceException(exception, IDEMPOTENT, EMPTY_RETRYABLE_ERRORS); + assertTrue(serviceException.isRetryable()); + assertNull(serviceException.getMessage()); + assertEquals(exception, serviceException.getCause()); + + exception = new SocketException(); + serviceException = new BaseHttpServiceException(exception, IDEMPOTENT, EMPTY_RETRYABLE_ERRORS); + assertTrue(serviceException.isRetryable()); + assertNull(serviceException.getMessage()); + assertEquals(exception, serviceException.getCause()); + + exception = new IOException("insufficient data written"); + serviceException = new BaseHttpServiceException(exception, IDEMPOTENT, EMPTY_RETRYABLE_ERRORS); + assertTrue(serviceException.isRetryable()); + assertEquals("insufficient data written", serviceException.getMessage()); + assertEquals(exception, serviceException.getCause()); + + GoogleJsonError error = new GoogleJsonError(); + error.setCode(CODE); + error.setMessage(MESSAGE); + serviceException = new BaseHttpServiceException(error, IDEMPOTENT, EMPTY_RETRYABLE_ERRORS); + assertEquals(CODE, serviceException.getCode()); + assertEquals(MESSAGE, serviceException.getMessage()); + assertFalse(serviceException.isRetryable()); + + serviceException = new CustomServiceException(CODE, MESSAGE, REASON, IDEMPOTENT); + assertEquals(CODE, serviceException.getCode()); + assertEquals(MESSAGE, serviceException.getMessage()); + assertEquals(REASON, serviceException.getReason()); + assertEquals(RETRYABLE, serviceException.isRetryable()); + + serviceException = new CustomServiceException(CODE_NO_REASON, MESSAGE, null, IDEMPOTENT); + assertEquals(CODE_NO_REASON, serviceException.getCode()); + assertEquals(MESSAGE, serviceException.getMessage()); + assertNull(serviceException.getReason()); + assertEquals(RETRYABLE, serviceException.isRetryable()); + + serviceException = new CustomServiceException(UNKNOWN_CODE, MESSAGE, REASON, IDEMPOTENT); + assertEquals(UNKNOWN_CODE, serviceException.getCode()); + assertEquals(MESSAGE, serviceException.getMessage()); + assertEquals(REASON, serviceException.getReason()); + assertEquals(RETRYABLE, serviceException.isRetryable()); + } + + @Test + void testTranslateAndThrow() throws Exception { + BaseServiceException cause = + new BaseHttpServiceException(CODE, MESSAGE, REASON, IDEMPOTENT, EMPTY_RETRYABLE_ERRORS); + RetryHelper.RetryHelperException exceptionMock = + createMock(RetryHelper.RetryHelperException.class); + expect(exceptionMock.getCause()).andReturn(cause).times(2); + replay(exceptionMock); + try { + BaseServiceException.translate(exceptionMock); + } catch (BaseServiceException ex) { + assertEquals(CODE, ex.getCode()); + assertEquals(MESSAGE, ex.getMessage()); + assertFalse(ex.isRetryable()); + } finally { + verify(exceptionMock); + } + } +} diff --git a/java-core/google-cloud-core-http/src/test/java/com/google/cloud/http/CensusHttpModuleTest.java b/java-core/google-cloud-core-http/src/test/java/com/google/cloud/http/CensusHttpModuleTest.java new file mode 100644 index 0000000000..0ac860c820 --- /dev/null +++ b/java-core/google-cloud-core-http/src/test/java/com/google/cloud/http/CensusHttpModuleTest.java @@ -0,0 +1,153 @@ +/* + * 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. + */ + +package com.google.cloud.http; + +import static com.google.common.truth.Truth.assertThat; +import static org.easymock.EasyMock.createMock; +import static org.easymock.EasyMock.createMockBuilder; +import static org.easymock.EasyMock.replay; +import static org.easymock.EasyMock.verify; +import static org.junit.jupiter.api.Assertions.assertThrows; + +import com.google.api.client.http.GenericUrl; +import com.google.api.client.http.HttpExecuteInterceptor; +import com.google.api.client.http.HttpHeaders; +import com.google.api.client.http.HttpRequest; +import com.google.api.client.http.HttpRequestInitializer; +import com.google.api.client.http.javanet.NetHttpTransport; +import io.opencensus.common.Scope; +import io.opencensus.trace.Span; +import io.opencensus.trace.SpanContext; +import io.opencensus.trace.SpanId; +import io.opencensus.trace.TraceId; +import io.opencensus.trace.TraceOptions; +import io.opencensus.trace.Tracer; +import io.opencensus.trace.Tracestate; +import io.opencensus.trace.Tracing; +import io.opencensus.trace.propagation.TextFormat; +import java.io.IOException; +import java.util.EnumSet; +import java.util.Random; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; + +/** Tests for {@link CensusHttpModule}. */ +class CensusHttpModuleTest { + + private final Tracer tracer = Tracing.getTracer(); + private final CensusHttpModule censusHttpModule = new CensusHttpModule(tracer, false); + private HttpRequest httpRequest; + + @BeforeEach + void setUp() throws IOException { + httpRequest = + new NetHttpTransport() + .createRequestFactory() + .buildRequest("GET", new GenericUrl("https://www.google.com"), null); + } + + @Test + void tracerShouldNotBeNull() { + assertThat(censusHttpModule.getTracer()).isNotNull(); + } + + @Test + void isRecordEventsShouldBeSet() { + assertThat(censusHttpModule.isRecordEvents()).isEqualTo(false); + } + + @Test + void getHttpRequestInitializerShouldReturnCorrectClass() { + HttpRequestInitializer initializer = censusHttpModule.getHttpRequestInitializer(null); + assertThat(initializer).isInstanceOf(CensusHttpModule.CensusHttpRequestInitializer.class); + } + + @Test + void implementationOfDefaultTextFormatSetter() { + String testKey = "testKey"; + String testValue = "testValue"; + TextFormat.Setter setter = + CensusHttpModule.DefaultPropagationTextFormatSetter.INSTANCE; + setter.put(httpRequest.getHeaders(), testKey, testValue); + assertThat(httpRequest.getHeaders().get(testKey)).isEqualTo(testValue); + } + + @Test + void censusHttpExecuteInterceptorDisallowNullRequest() { + HttpExecuteInterceptor interceptor = censusHttpModule.new CensusHttpExecuteInterceptor(null); + assertThrows(NullPointerException.class, () -> interceptor.intercept(null)); + } + + @Test + void censusHttpExecuteInterceptorShouldExecuteOriginal() throws IOException { + HttpExecuteInterceptor mockInterceptor = createMock(HttpExecuteInterceptor.class); + HttpExecuteInterceptor censusInterceptor = + censusHttpModule.new CensusHttpExecuteInterceptor(mockInterceptor); + mockInterceptor.intercept(httpRequest); + replay(mockInterceptor); + censusInterceptor.intercept(httpRequest); + verify(mockInterceptor); + } + + @Test + void censusHttpExecuteInterceptorShouldInjectHeader() throws IOException { + Random random = new Random(); + SpanContext spanContext = + SpanContext.create( + TraceId.generateRandomId(random), + SpanId.generateRandomId(random), + TraceOptions.DEFAULT, + Tracestate.builder().build()); + Span mockSpan = + createMockBuilder(Span.class) + .withConstructor(SpanContext.class, EnumSet.class) + .withArgs(spanContext, null) + .createMock(); + Scope scope = tracer.withSpan(mockSpan); + try { + HttpExecuteInterceptor interceptor = censusHttpModule.new CensusHttpExecuteInterceptor(null); + interceptor.intercept(httpRequest); + assertThat(httpRequest.getHeaders().get("X-Cloud-Trace-Context")).isNotNull(); + } finally { + scope.close(); + } + } + + @Test + void censusHttpRequestInitializerDisallowNullRequest() { + HttpRequestInitializer initializer = censusHttpModule.getHttpRequestInitializer(null); + assertThrows(NullPointerException.class, () -> initializer.initialize(null)); + } + + @Test + void censusHttpRequestInitializerShouldExecuteOriginal() throws IOException { + HttpRequestInitializer mockOriginalInitializer = createMock(HttpRequestInitializer.class); + HttpRequestInitializer censusInitializer = + censusHttpModule.getHttpRequestInitializer(mockOriginalInitializer); + mockOriginalInitializer.initialize(httpRequest); + replay(mockOriginalInitializer); + censusInitializer.initialize(httpRequest); + verify(mockOriginalInitializer); + } + + @Test + void censusHttpRequestInitializerShouldSetInterceptor() throws IOException { + censusHttpModule.getHttpRequestInitializer(null).initialize(httpRequest); + assertThat(httpRequest.getInterceptor()) + .isInstanceOf(CensusHttpModule.CensusHttpExecuteInterceptor.class); + } +} diff --git a/java-core/google-cloud-core-http/src/test/java/com/google/cloud/http/HttpTransportOptionsTest.java b/java-core/google-cloud-core-http/src/test/java/com/google/cloud/http/HttpTransportOptionsTest.java new file mode 100644 index 0000000000..1697a0c43f --- /dev/null +++ b/java-core/google-cloud-core-http/src/test/java/com/google/cloud/http/HttpTransportOptionsTest.java @@ -0,0 +1,345 @@ +/* + * Copyright 2016 Google LLC + * + * Licensed under the Apache License, Version 2.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.google.cloud.http; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotEquals; +import static org.junit.jupiter.api.Assertions.assertSame; +import static org.junit.jupiter.api.Assertions.assertThrows; +import static org.junit.jupiter.api.Assertions.assertTrue; + +import com.google.api.client.http.HttpRequest; +import com.google.api.client.http.HttpRequestInitializer; +import com.google.api.client.http.HttpTransport; +import com.google.api.client.http.LowLevelHttpRequest; +import com.google.api.client.http.LowLevelHttpResponse; +import com.google.api.client.testing.http.HttpTesting; +import com.google.api.client.testing.http.MockHttpTransport; +import com.google.api.client.testing.http.MockLowLevelHttpRequest; +import com.google.api.client.testing.http.MockLowLevelHttpResponse; +import com.google.api.gax.rpc.HeaderProvider; +import com.google.api.gax.rpc.UnauthenticatedException; +import com.google.auth.Credentials; +import com.google.auth.http.HttpTransportFactory; +import com.google.cloud.BaseService; +import com.google.cloud.NoCredentials; +import com.google.cloud.Service; +import com.google.cloud.ServiceDefaults; +import com.google.cloud.ServiceFactory; +import com.google.cloud.ServiceOptions; +import com.google.cloud.ServiceRpc; +import com.google.cloud.TransportOptions; +import com.google.cloud.http.HttpTransportOptions.DefaultHttpTransportFactory; +import com.google.cloud.spi.ServiceRpcFactory; +import java.io.IOException; +import java.util.HashMap; +import java.util.Set; +import java.util.regex.Pattern; +import org.easymock.EasyMock; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; + +class HttpTransportOptionsTest { + private static final HttpTransport MOCK_HTTP_TRANSPORT = + new MockHttpTransport() { + @Override + public LowLevelHttpRequest buildRequest(String method, String url) { + return new MockLowLevelHttpRequest() { + @Override + public LowLevelHttpResponse execute() { + return new MockLowLevelHttpResponse(); + } + }; + } + }; + + private static final HttpTransportFactory MOCK_HTTP_TRANSPORT_FACTORY = + EasyMock.createMock(HttpTransportFactory.class); + private static final HttpTransportOptions OPTIONS = + HttpTransportOptions.newBuilder() + .setConnectTimeout(1234) + .setHttpTransportFactory(MOCK_HTTP_TRANSPORT_FACTORY) + .setReadTimeout(5678) + .build(); + private static final HttpTransportOptions DEFAULT_OPTIONS = + HttpTransportOptions.newBuilder().build(); + private static final HttpTransportOptions OPTIONS_COPY = OPTIONS.toBuilder().build(); + private static final String DEFAULT_PROJECT_ID = "testing"; + private static final String CUSTOM_UNIVERSE_DOMAIN = "random.com"; + + private HeaderProvider defaultHeaderProvider; + // Credentials' getUniverseDomain() returns GDU + private Credentials defaultCredentials; + // Credentials' getUniverseDomain() returns `random.com` + private Credentials customCredentials; + private HttpRequest defaultHttpRequest; + + @BeforeEach + void setup() throws IOException { + defaultHeaderProvider = EasyMock.createMock(HeaderProvider.class); + EasyMock.expect(defaultHeaderProvider.getHeaders()).andReturn(new HashMap<>()); + + defaultCredentials = EasyMock.createMock(Credentials.class); + EasyMock.expect(defaultCredentials.getUniverseDomain()) + .andReturn(Credentials.GOOGLE_DEFAULT_UNIVERSE); + EasyMock.expect(defaultCredentials.hasRequestMetadata()).andReturn(false); + + customCredentials = EasyMock.createMock(Credentials.class); + EasyMock.expect(customCredentials.getUniverseDomain()).andReturn(CUSTOM_UNIVERSE_DOMAIN); + EasyMock.expect(customCredentials.hasRequestMetadata()).andReturn(false); + + EasyMock.replay(defaultHeaderProvider, defaultCredentials, customCredentials); + + defaultHttpRequest = + MOCK_HTTP_TRANSPORT.createRequestFactory().buildGetRequest(HttpTesting.SIMPLE_GENERIC_URL); + } + + @Test + void testBuilder() { + assertEquals(1234, OPTIONS.getConnectTimeout()); + assertSame(MOCK_HTTP_TRANSPORT_FACTORY, OPTIONS.getHttpTransportFactory()); + assertEquals(5678, OPTIONS.getReadTimeout()); + assertEquals(-1, DEFAULT_OPTIONS.getConnectTimeout()); + assertTrue(DEFAULT_OPTIONS.getHttpTransportFactory() instanceof DefaultHttpTransportFactory); + assertEquals(-1, DEFAULT_OPTIONS.getReadTimeout()); + } + + @Test + void testBaseEquals() { + assertEquals(OPTIONS, OPTIONS_COPY); + assertNotEquals(DEFAULT_OPTIONS, OPTIONS); + } + + @Test + void testBaseHashCode() { + assertEquals(OPTIONS.hashCode(), OPTIONS_COPY.hashCode()); + assertNotEquals(DEFAULT_OPTIONS.hashCode(), OPTIONS.hashCode()); + } + + @Test + void testHeader() { + String expectedHeaderPattern = "^gl-java/.+ gccl/.* gax/.+"; + ServiceOptions serviceOptions = EasyMock.createMock(ServiceOptions.class); + HeaderProvider headerProvider = + OPTIONS.getInternalHeaderProviderBuilder(serviceOptions).build(); + + assertEquals(1, headerProvider.getHeaders().size()); + assertTrue( + Pattern.compile(expectedHeaderPattern) + .matcher(headerProvider.getHeaders().values().iterator().next()) + .find()); + } + + @Test + void testHttpRequestInitializer_defaultUniverseDomainSettings_defaultCredentials() + throws IOException { + TestServiceOptions testServiceOptions = + generateTestServiceOptions(Credentials.GOOGLE_DEFAULT_UNIVERSE, defaultCredentials); + HttpRequestInitializer httpRequestInitializer = + DEFAULT_OPTIONS.getHttpRequestInitializer(testServiceOptions); + // Does not throw a validation exception + httpRequestInitializer.initialize(defaultHttpRequest); + } + + @Test + void testHttpRequestInitializer_defaultUniverseDomainSettings_customCredentials() { + TestServiceOptions testServiceOptions = + generateTestServiceOptions(Credentials.GOOGLE_DEFAULT_UNIVERSE, customCredentials); + HttpRequestInitializer httpRequestInitializer = + DEFAULT_OPTIONS.getHttpRequestInitializer(testServiceOptions); + UnauthenticatedException exception = + assertThrows( + UnauthenticatedException.class, + () -> httpRequestInitializer.initialize(defaultHttpRequest)); + assertEquals( + "The configured universe domain (googleapis.com) does not match the universe domain found in the credentials (random.com). If you haven't configured the universe domain explicitly, `googleapis.com` is the default.", + exception.getCause().getMessage()); + } + + @Test + void testHttpRequestInitializer_customUniverseDomainSettings_defaultCredentials() { + TestServiceOptions testServiceOptions = + generateTestServiceOptions(CUSTOM_UNIVERSE_DOMAIN, defaultCredentials); + HttpRequestInitializer httpRequestInitializer = + DEFAULT_OPTIONS.getHttpRequestInitializer(testServiceOptions); + UnauthenticatedException exception = + assertThrows( + UnauthenticatedException.class, + () -> httpRequestInitializer.initialize(defaultHttpRequest)); + assertEquals( + "The configured universe domain (random.com) does not match the universe domain found in the credentials (googleapis.com). If you haven't configured the universe domain explicitly, `googleapis.com` is the default.", + exception.getCause().getMessage()); + } + + @Test + void testHttpRequestInitializer_customUniverseDomainSettings_customCredentials() + throws IOException { + TestServiceOptions testServiceOptions = + generateTestServiceOptions(CUSTOM_UNIVERSE_DOMAIN, customCredentials); + HttpRequestInitializer httpRequestInitializer = + DEFAULT_OPTIONS.getHttpRequestInitializer(testServiceOptions); + // Does not throw a validation exception + httpRequestInitializer.initialize(defaultHttpRequest); + } + + @Test + void testHttpRequestInitializer_defaultUniverseDomainSettings_noCredentials() throws IOException { + NoCredentials noCredentials = NoCredentials.getInstance(); + TestServiceOptions testServiceOptions = + generateTestServiceOptions(Credentials.GOOGLE_DEFAULT_UNIVERSE, noCredentials); + HttpRequestInitializer httpRequestInitializer = + DEFAULT_OPTIONS.getHttpRequestInitializer(testServiceOptions); + // Does not throw a validation exception + httpRequestInitializer.initialize(defaultHttpRequest); + } + + @Test + void testHttpRequestInitializer_customUniverseDomainSettings_noCredentials() { + NoCredentials noCredentials = NoCredentials.getInstance(); + TestServiceOptions testServiceOptions = + generateTestServiceOptions(CUSTOM_UNIVERSE_DOMAIN, noCredentials); + HttpRequestInitializer httpRequestInitializer = + DEFAULT_OPTIONS.getHttpRequestInitializer(testServiceOptions); + UnauthenticatedException exception = + assertThrows( + UnauthenticatedException.class, + () -> httpRequestInitializer.initialize(defaultHttpRequest)); + assertEquals( + "The configured universe domain (random.com) does not match the universe domain found in the credentials (googleapis.com). If you haven't configured the universe domain explicitly, `googleapis.com` is the default.", + exception.getCause().getMessage()); + } + + private TestServiceOptions generateTestServiceOptions( + String universeDomain, Credentials credentials) { + return TestServiceOptions.newBuilder() + .setCredentials(credentials) + .setHeaderProvider(defaultHeaderProvider) + .setQuotaProjectId(DEFAULT_PROJECT_ID) + .setProjectId(DEFAULT_PROJECT_ID) + .setUniverseDomain(universeDomain) + .build(); + } + + /** + * The following interfaces and classes are from ServiceOptionsTest. Copied over here as + * ServiceOptions resides inside google-cloud-core test folder and is not accessible from + * google-cloud-core-http. + */ + interface TestService extends Service {} + + private static class TestServiceImpl extends BaseService + implements TestService { + private TestServiceImpl(TestServiceOptions options) { + super(options); + } + } + + public interface TestServiceFactory extends ServiceFactory {} + + private static class DefaultTestServiceFactory implements TestServiceFactory { + private static final TestServiceFactory INSTANCE = new DefaultTestServiceFactory(); + + @Override + public TestService create(TestServiceOptions options) { + return new TestServiceImpl(options); + } + } + + public interface TestServiceRpcFactory extends ServiceRpcFactory {} + + private static class DefaultTestServiceRpcFactory implements TestServiceRpcFactory { + private static final TestServiceRpcFactory INSTANCE = new DefaultTestServiceRpcFactory(); + + @Override + public TestServiceRpc create(TestServiceOptions options) { + return new DefaultTestServiceRpc(options); + } + } + + private interface TestServiceRpc extends ServiceRpc {} + + private static class DefaultTestServiceRpc implements TestServiceRpc { + DefaultTestServiceRpc(TestServiceOptions options) {} + } + + static class TestServiceOptions extends ServiceOptions { + private static class Builder + extends ServiceOptions.Builder { + private Builder() {} + + private Builder(TestServiceOptions options) { + super(options); + } + + @Override + protected TestServiceOptions build() { + return new TestServiceOptions(this); + } + } + + private TestServiceOptions(Builder builder) { + super( + TestServiceFactory.class, + TestServiceRpcFactory.class, + builder, + new TestServiceDefaults()); + } + + private static class TestServiceDefaults + implements ServiceDefaults { + + @Override + public TestServiceFactory getDefaultServiceFactory() { + return DefaultTestServiceFactory.INSTANCE; + } + + @Override + public TestServiceRpcFactory getDefaultRpcFactory() { + return DefaultTestServiceRpcFactory.INSTANCE; + } + + @Override + public TransportOptions getDefaultTransportOptions() { + return new TransportOptions() {}; + } + } + + @Override + protected Set getScopes() { + return null; + } + + @Override + public Builder toBuilder() { + return new Builder(this); + } + + private static Builder newBuilder() { + return new Builder(); + } + + @Override + public boolean equals(Object obj) { + return obj instanceof TestServiceOptions && baseEquals((TestServiceOptions) obj); + } + + @Override + public int hashCode() { + return baseHashCode(); + } + } +} diff --git a/java-core/google-cloud-core/EnableAutoValue.txt b/java-core/google-cloud-core/EnableAutoValue.txt new file mode 100644 index 0000000000..e69de29bb2 diff --git a/java-core/google-cloud-core/clirr-ignored-differences.xml b/java-core/google-cloud-core/clirr-ignored-differences.xml new file mode 100644 index 0000000000..6792bcb968 --- /dev/null +++ b/java-core/google-cloud-core/clirr-ignored-differences.xml @@ -0,0 +1,21 @@ + + + + + + 7012 + com/google/cloud/ReadChannel + * limit(long) + + + 7012 + com/google/cloud/ReadChannel + long limit() + + + + 7012 + com/google/cloud/testing/BaseEmulatorHelper$EmulatorRunner + int waitForDuration(java.time.Duration) + + diff --git a/java-core/google-cloud-core/pom.xml b/java-core/google-cloud-core/pom.xml new file mode 100644 index 0000000000..25edbf4de2 --- /dev/null +++ b/java-core/google-cloud-core/pom.xml @@ -0,0 +1,113 @@ + + + 4.0.0 + com.google.cloud + google-cloud-core + 2.66.1-SNAPSHOT + jar + Google Cloud Core + + Core module for the google-cloud. + + + com.google.cloud + google-cloud-core-parent + 2.66.1-SNAPSHOT + + + google-cloud-core + + + + com.google.guava + guava + + + com.google.api + gax + + + com.google.auto.value + auto-value-annotations + + + com.google.protobuf + protobuf-java-util + + + com.google.api.grpc + proto-google-common-protos + + + com.google.api.grpc + proto-google-iam-v1 + + + org.threeten + threetenbp + + + com.google.api + api-common + + + com.google.auth + google-auth-library-credentials + + + com.google.auth + google-auth-library-oauth2-http + + + com.google.http-client + google-http-client + + + com.google.http-client + google-http-client-gson + + + com.google.protobuf + protobuf-java + + + com.google.errorprone + error_prone_annotations + + + + org.junit.platform + junit-platform-launcher + test + + + org.junit.jupiter + junit-jupiter-engine + test + + + org.junit.vintage + junit-vintage-engine + test + + + org.easymock + easymock + test + + + com.google.code.findbugs + jsr305 + + + com.google.truth + truth + test + + + com.google.guava + guava-testlib + test + + + diff --git a/java-core/google-cloud-core/src/main/java/com/google/cloud/AsyncPageImpl.java b/java-core/google-cloud-core/src/main/java/com/google/cloud/AsyncPageImpl.java new file mode 100644 index 0000000000..25cae6f7c8 --- /dev/null +++ b/java-core/google-cloud-core/src/main/java/com/google/cloud/AsyncPageImpl.java @@ -0,0 +1,87 @@ +/* + * Copyright 2016 Google LLC + * + * Licensed under the Apache License, Version 2.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.google.cloud; + +import com.google.api.core.ApiFuture; +import com.google.api.core.ApiFutures; +import com.google.api.core.InternalApi; +import com.google.api.gax.paging.AsyncPage; +import com.google.api.gax.paging.Page; +import com.google.common.base.Throwables; +import com.google.common.util.concurrent.Uninterruptibles; +import java.io.Serializable; +import java.util.concurrent.ExecutionException; + +/** + * Base implementation for asynchronously consuming Google Cloud paginated results. + * + * @param the value type that the page holds + */ +@InternalApi +public class AsyncPageImpl extends PageImpl implements AsyncPage { + + private static final long serialVersionUID = -6009473188630364906L; + + private final NextPageFetcher asyncPageFetcher; + + /** + * Interface for asynchronously fetching the next page of results from the service. + * + * @param the value type that the page holds + */ + public interface NextPageFetcher extends Serializable { + + ApiFuture> getNextPage(); + } + + private static class SyncNextPageFetcher implements PageImpl.NextPageFetcher { + + private static final long serialVersionUID = -4124568632363525351L; + + private final NextPageFetcher asyncPageFetcher; + + private SyncNextPageFetcher(NextPageFetcher asyncPageFetcher) { + this.asyncPageFetcher = asyncPageFetcher; + } + + @Override + public Page getNextPage() { + try { + return asyncPageFetcher != null + ? Uninterruptibles.getUninterruptibly(asyncPageFetcher.getNextPage()) + : null; + } catch (ExecutionException ex) { + Throwables.throwIfUnchecked(ex.getCause()); + throw new RuntimeException(ex); + } + } + } + + /** Creates an {@code AsyncPageImpl} object. */ + public AsyncPageImpl(NextPageFetcher asyncPageFetcher, String cursor, Iterable results) { + super(new SyncNextPageFetcher(asyncPageFetcher), cursor, results); + this.asyncPageFetcher = asyncPageFetcher; + } + + @Override + public ApiFuture> getNextPageAsync() { + if (getNextPageToken() == null || asyncPageFetcher == null) { + return ApiFutures.immediateFuture(null); + } + return asyncPageFetcher.getNextPage(); + } +} diff --git a/java-core/google-cloud-core/src/main/java/com/google/cloud/BaseService.java b/java-core/google-cloud-core/src/main/java/com/google/cloud/BaseService.java new file mode 100644 index 0000000000..781f29b421 --- /dev/null +++ b/java-core/google-cloud-core/src/main/java/com/google/cloud/BaseService.java @@ -0,0 +1,68 @@ +/* + * Copyright 2015 Google LLC + * + * Licensed under the Apache License, Version 2.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.google.cloud; + +import com.google.api.core.InternalApi; +import com.google.cloud.ExceptionHandler.Interceptor; + +/** + * Base class for service objects. + * + * @param the {@code ServiceOptions} subclass corresponding to the service + */ +public abstract class BaseService> + implements Service { + + public static final Interceptor EXCEPTION_HANDLER_INTERCEPTOR = + new Interceptor() { + + private static final long serialVersionUID = -8429573486870467828L; + + @Override + public RetryResult afterEval(Exception exception, RetryResult retryResult) { + return Interceptor.RetryResult.CONTINUE_EVALUATION; + } + + @Override + public RetryResult beforeEval(Exception exception) { + if (exception instanceof BaseServiceException) { + boolean retriable = ((BaseServiceException) exception).isRetryable(); + return retriable + ? Interceptor.RetryResult.RETRY + : Interceptor.RetryResult.CONTINUE_EVALUATION; + } + return Interceptor.RetryResult.CONTINUE_EVALUATION; + } + }; + public static final ExceptionHandler EXCEPTION_HANDLER = + ExceptionHandler.newBuilder() + .abortOn(RuntimeException.class) + .addInterceptors(EXCEPTION_HANDLER_INTERCEPTOR) + .build(); + + private final OptionsT options; + + @InternalApi("This class should only be extended within google-cloud-java") + protected BaseService(OptionsT options) { + this.options = options; + } + + @Override + public OptionsT getOptions() { + return options; + } +} diff --git a/java-core/google-cloud-core/src/main/java/com/google/cloud/BaseServiceException.java b/java-core/google-cloud-core/src/main/java/com/google/cloud/BaseServiceException.java new file mode 100644 index 0000000000..29396d6d58 --- /dev/null +++ b/java-core/google-cloud-core/src/main/java/com/google/cloud/BaseServiceException.java @@ -0,0 +1,343 @@ +/* + * Copyright 2015 Google LLC + * + * Licensed under the Apache License, Version 2.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.google.cloud; + +import com.google.api.core.InternalApi; +import com.google.common.base.MoreObjects; +import java.io.IOException; +import java.io.Serializable; +import java.net.SocketException; +import java.net.SocketTimeoutException; +import java.security.cert.CertificateException; +import java.util.Objects; +import java.util.Set; +import java.util.concurrent.ExecutionException; +import javax.net.ssl.SSLException; +import javax.net.ssl.SSLHandshakeException; + +/** Base class for all service exceptions. */ +public class BaseServiceException extends RuntimeException { + + private static final long serialVersionUID = 759921776378760835L; + public static final int UNKNOWN_CODE = 0; + + private final int code; + private final boolean retryable; + private final String reason; + private final String location; + private final String debugInfo; + + @InternalApi + public static final class ExceptionData implements Serializable { + private static final long serialVersionUID = 2222230861338426753L; + + private final String message; + private final Throwable cause; + private final int code; + private final boolean retryable; + private final String reason; + private final String location; + private final String debugInfo; + + private ExceptionData( + String message, + Throwable cause, + int code, + boolean retryable, + String reason, + String location, + String debugInfo) { + this.message = message; + this.cause = cause; + this.code = code; + this.retryable = retryable; + this.reason = reason; + this.location = location; + this.debugInfo = debugInfo; + } + + public String getMessage() { + return message; + } + + public Throwable getCause() { + return cause; + } + + public int getCode() { + return code; + } + + public boolean isRetryable() { + return retryable; + } + + public String getReason() { + return reason; + } + + public String getLocation() { + return location; + } + + public String getDebugInfo() { + return debugInfo; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public static ExceptionData from(int code, String message, String reason, boolean retryable) { + return from(code, message, reason, retryable, null); + } + + public static ExceptionData from( + int code, String message, String reason, boolean retryable, Throwable cause) { + return newBuilder() + .setCode(code) + .setMessage(message) + .setReason(reason) + .setRetryable(retryable) + .setCause(cause) + .build(); + } + + @InternalApi + public static final class Builder { + + private String message; + private Throwable cause; + private int code; + private boolean retryable; + private String reason; + private String location; + private String debugInfo; + + private Builder() {} + + public Builder setMessage(String message) { + this.message = message; + return this; + } + + public Builder setCause(Throwable cause) { + this.cause = cause; + return this; + } + + public Builder setCode(int code) { + this.code = code; + return this; + } + + public Builder setRetryable(boolean retryable) { + this.retryable = retryable; + return this; + } + + public Builder setReason(String reason) { + this.reason = reason; + return this; + } + + public Builder setLocation(String location) { + this.location = location; + return this; + } + + public Builder setDebugInfo(String debugInfo) { + this.debugInfo = debugInfo; + return this; + } + + public ExceptionData build() { + return new ExceptionData(message, cause, code, retryable, reason, location, debugInfo); + } + } + } + + @InternalApi + public static final class Error implements Serializable { + + private static final long serialVersionUID = -4019600198652965721L; + + private final Integer code; + private final String reason; + private final boolean rejected; + + public Error(Integer code, String reason) { + this(code, reason, false); + } + + public Error(Integer code, String reason, boolean rejected) { + this.code = code; + this.reason = reason; + this.rejected = rejected; + } + + /** Returns the code associated with this exception. */ + public Integer getCode() { + return code; + } + + /** + * Returns true if the error indicates that the API call was certainly not accepted by the + * server. For instance, if the server returns a rate limit exceeded error, it certainly did not + * process the request and this method will return {@code true}. + */ + public boolean isRejected() { + return rejected; + } + + /** Returns the reason that caused the exception. */ + public String getReason() { + return reason; + } + + @InternalApi + public boolean isRetryable(boolean idempotent, Set retryableErrors) { + return BaseServiceException.isRetryable(code, reason, idempotent, retryableErrors); + } + + @Override + public String toString() { + return MoreObjects.toStringHelper(this) + .add("code", code) + .add("reason", reason) + .add("rejected", rejected) + .toString(); + } + + @Override + public int hashCode() { + return Objects.hash(code, reason, rejected); + } + + @Override + public boolean equals(Object obj) { + if (!(obj instanceof Error)) { + return false; + } + Error o = (Error) obj; + return Objects.equals(code, o.code) + && Objects.equals(reason, o.reason) + && Objects.equals(rejected, o.rejected); + } + } + + @InternalApi + public static boolean isRetryable( + Integer code, String reason, boolean idempotent, Set retryableErrors) { + for (Error retryableError : retryableErrors) { + if ((retryableError.getCode() == null || retryableError.getCode().equals(code)) + && (retryableError.getReason() == null || retryableError.getReason().equals(reason))) { + return idempotent || retryableError.isRejected(); + } + } + return false; + } + + @InternalApi + public static boolean isRetryable(boolean idempotent, IOException exception) { + boolean exceptionIsRetryable = + exception instanceof SocketTimeoutException + || exception instanceof SocketException + || (exception instanceof SSLException + && exception.getMessage().contains("Connection has been shutdown: ")) + || (exception instanceof SSLHandshakeException + && !(exception.getCause() instanceof CertificateException)) + || "insufficient data written".equals(exception.getMessage()) + || "Error writing request body to server".equals(exception.getMessage()); + return idempotent && exceptionIsRetryable; + } + + @InternalApi + public static void translate(RetryHelper.RetryHelperException ex) { + if (ex.getCause() instanceof BaseServiceException) { + throw (BaseServiceException) ex.getCause(); + } + } + + @InternalApi + public static void translate(ExecutionException ex) { + if (ex.getCause() instanceof BaseServiceException) { + throw (BaseServiceException) ex.getCause(); + } + } + + @InternalApi("This class should only be extended within google-cloud-java") + protected BaseServiceException(ExceptionData exceptionData) { + super(exceptionData.getMessage(), exceptionData.getCause()); + this.code = exceptionData.getCode(); + this.reason = exceptionData.getReason(); + this.retryable = exceptionData.isRetryable(); + this.location = exceptionData.getLocation(); + this.debugInfo = exceptionData.getDebugInfo(); + } + + /** Returns the code associated with this exception. */ + public int getCode() { + return code; + } + + /** Returns the reason that caused the exception. */ + public String getReason() { + return reason; + } + + /** Returns {@code true} when it is safe to retry the operation that caused this exception. */ + public boolean isRetryable() { + return retryable; + } + + /** + * Returns the service location where the error causing the exception occurred. Returns {@code + * null} if not available. + */ + public String getLocation() { + return location; + } + + @InternalApi + public String getDebugInfo() { + return debugInfo; + } + + @Override + public boolean equals(Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof BaseServiceException)) { + return false; + } + BaseServiceException other = (BaseServiceException) obj; + return Objects.equals(getCause(), other.getCause()) + && Objects.equals(getMessage(), other.getMessage()) + && code == other.code + && retryable == other.retryable + && Objects.equals(reason, other.reason) + && Objects.equals(location, other.location) + && Objects.equals(debugInfo, other.debugInfo); + } + + @Override + public int hashCode() { + return Objects.hash(getCause(), getMessage(), code, retryable, reason, location, debugInfo); + } +} diff --git a/java-core/google-cloud-core/src/main/java/com/google/cloud/BaseWriteChannel.java b/java-core/google-cloud-core/src/main/java/com/google/cloud/BaseWriteChannel.java new file mode 100644 index 0000000000..e45a5aead1 --- /dev/null +++ b/java-core/google-cloud-core/src/main/java/com/google/cloud/BaseWriteChannel.java @@ -0,0 +1,332 @@ +/* + * Copyright 2015 Google LLC + * + * Licensed under the Apache License, Version 2.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.google.cloud; + +import com.google.api.core.InternalApi; +import java.io.IOException; +import java.io.Serializable; +import java.nio.ByteBuffer; +import java.nio.channels.ClosedChannelException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.util.Objects; + +/** + * Base implementation for a {@link WriteChannel}. + * + * @param the service options used by the channel to issue RPC requests + * @param the entity this channel writes data to. Possibly with additional configuration + */ +public abstract class BaseWriteChannel< + ServiceOptionsT extends ServiceOptions, EntityT extends Serializable> + implements WriteChannel { + + private static final int MIN_CHUNK_SIZE = 256 * 1024; // 256 KiB + private static final int DEFAULT_CHUNK_SIZE = 60 * MIN_CHUNK_SIZE; // 15MiB + + private final ServiceOptionsT options; + private final EntityT entity; + private final String uploadId; + private long position; + private byte[] buffer = new byte[0]; + private int limit; + private boolean isOpen = true; + private int chunkSize = getDefaultChunkSize(); + + protected int getMinChunkSize() { + return MIN_CHUNK_SIZE; + } + + protected int getDefaultChunkSize() { + return DEFAULT_CHUNK_SIZE; + } + + /** + * Writes {@code length} bytes of {@link #getBuffer()} to the {@link #getUploadId()} URL. + * + * @param length the number of bytes to write from {@link #getBuffer()} + * @param last if {@code true} the resumable session is closed + */ + protected abstract void flushBuffer(int length, boolean last); + + protected ServiceOptionsT getOptions() { + return options; + } + + protected EntityT getEntity() { + return entity; + } + + protected String getUploadId() { + return uploadId; + } + + protected long getPosition() { + return position; + } + + protected byte[] getBuffer() { + return buffer; + } + + protected int getLimit() { + return limit; + } + + protected int getChunkSize() { + return chunkSize; + } + + @Override + public final void setChunkSize(int chunkSize) { + int minSize = getMinChunkSize(); + + this.chunkSize = Math.max(minSize, (chunkSize + minSize - 1) / minSize * minSize); + } + + @InternalApi("This class should only be extended within google-cloud-java") + protected BaseWriteChannel(ServiceOptionsT options, EntityT entity, String uploadId) { + this.options = options; + this.entity = entity; + this.uploadId = uploadId; + } + + private void flush() { + if (limit >= chunkSize) { + final int length = limit - limit % getMinChunkSize(); + flushBuffer(length, false); + position += length; + limit -= length; + byte[] temp = new byte[chunkSize]; + System.arraycopy(buffer, length, temp, 0, limit); + buffer = temp; + } + } + + private void validateOpen() throws ClosedChannelException { + if (!isOpen) { + throw new ClosedChannelException(); + } + } + + @Override + public final int write(ByteBuffer byteBuffer) throws IOException { + validateOpen(); + int toWrite = byteBuffer.remaining(); + int spaceInBuffer = buffer.length - limit; + if (spaceInBuffer >= toWrite) { + byteBuffer.get(buffer, limit, toWrite); + } else { + buffer = Arrays.copyOf(buffer, Math.max(chunkSize, buffer.length + toWrite - spaceInBuffer)); + byteBuffer.get(buffer, limit, toWrite); + } + limit += toWrite; + flush(); + return toWrite; + } + + @Override + public boolean isOpen() { + return isOpen; + } + + @Override + public final void close() throws IOException { + if (isOpen) { + flushBuffer(limit, true); + position += buffer.length; + isOpen = false; + buffer = null; + } + } + + /** Creates a {@link BaseState.Builder} for the current write channel. */ + protected abstract BaseState.Builder stateBuilder(); + + @Override + public RestorableState capture() { + byte[] bufferToSave = null; + if (isOpen) { + bufferToSave = Arrays.copyOf(buffer, limit); + } + return stateBuilder() + .setPosition(position) + .setBuffer(bufferToSave) + .setIsOpen(isOpen) + .setChunkSize(chunkSize) + .build(); + } + + /** Restores the state of the current write channel given a {@link BaseState} object. */ + protected void restore(BaseState state) { + if (state.buffer != null) { + this.buffer = state.buffer.clone(); + this.limit = state.buffer.length; + } + this.position = state.position; + this.isOpen = state.isOpen; + this.chunkSize = state.chunkSize; + } + + protected abstract static class BaseState< + ServiceOptionsT extends ServiceOptions, EntityT extends Serializable> + implements RestorableState, Serializable { + + private static final long serialVersionUID = 8541062465055125619L; + + protected final ServiceOptionsT serviceOptions; + protected final EntityT entity; + protected final String uploadId; + protected final long position; + protected final byte[] buffer; + protected final boolean isOpen; + protected final int chunkSize; + + @InternalApi("This class should only be extended within google-cloud-java") + protected BaseState(Builder builder) { + this.serviceOptions = builder.serviceOptions; + this.entity = builder.entity; + this.uploadId = builder.uploadId; + this.position = builder.position; + this.buffer = builder.buffer; + this.isOpen = builder.isOpen; + this.chunkSize = builder.chunkSize; + } + + /** + * Base builder for a write channel's state. Users are not supposed to access this class + * directly. + * + * @param the service options used by the channel to issue RPC requests + * @param the entity this channel writes data to. Possibly with additional + * configuration + */ + public abstract static class Builder< + ServiceOptionsT extends ServiceOptions, EntityT extends Serializable> { + private final ServiceOptionsT serviceOptions; + private final EntityT entity; + private final String uploadId; + private long position; + private byte[] buffer; + private boolean isOpen; + private int chunkSize; + + @InternalApi("This class should only be extended within google-cloud-java") + protected Builder(ServiceOptionsT options, EntityT entity, String uploadId) { + this.serviceOptions = options; + this.entity = entity; + this.uploadId = uploadId; + } + + public Builder setPosition(long position) { + this.position = position; + return this; + } + + public Builder setBuffer(byte[] buffer) { + this.buffer = buffer; + return this; + } + + public Builder setIsOpen(boolean isOpen) { + this.isOpen = isOpen; + return this; + } + + public Builder setChunkSize(int chunkSize) { + this.chunkSize = chunkSize; + return this; + } + + public abstract RestorableState build(); + } + + @Override + public int hashCode() { + return Objects.hash( + serviceOptions, entity, uploadId, position, isOpen, chunkSize, Arrays.hashCode(buffer)); + } + + @Override + public boolean equals(Object obj) { + if (obj == null) { + return false; + } + if (!(obj instanceof BaseState)) { + return false; + } + final BaseState other = (BaseState) obj; + return Objects.equals(this.serviceOptions, other.serviceOptions) + && Objects.equals(this.entity, other.entity) + && Objects.equals(this.uploadId, other.uploadId) + && Objects.deepEquals(this.buffer, other.buffer) + && this.position == other.position + && this.isOpen == other.isOpen + && this.chunkSize == other.chunkSize; + } + + protected static final class ValueHolder { + final String name; + final Object value; + + private ValueHolder(String name, Object value) { + this.name = name; + this.value = value; + } + + public static ValueHolder create(String name, Object value) { + return new ValueHolder(name, value); + } + + @Override + public String toString() { + String result = name + "="; + if (value != null && value.getClass().isArray()) { + Object[] objectArray = new Object[] {value}; + String arrayString = Arrays.deepToString(objectArray); + result += arrayString.substring(1, arrayString.length() - 1); + } else { + result += value; + } + return result; + } + } + + protected List toStringHelper() { + List valueList = new ArrayList<>(); + valueList.add(ValueHolder.create("entity", entity)); + valueList.add(ValueHolder.create("uploadId", uploadId)); + valueList.add(ValueHolder.create("position", String.valueOf(position))); + valueList.add(ValueHolder.create("isOpen", String.valueOf(isOpen))); + return valueList; + } + + @Override + public String toString() { + StringBuilder builder = new StringBuilder(); + builder.append(getClass().getSimpleName()).append('{'); + String nextSeparator = ""; + for (ValueHolder valueHolder : toStringHelper()) { + builder.append(nextSeparator).append(valueHolder); + nextSeparator = ", "; + } + builder.append('}'); + return builder.toString(); + } + } +} diff --git a/java-core/google-cloud-core/src/main/java/com/google/cloud/BatchResult.java b/java-core/google-cloud-core/src/main/java/com/google/cloud/BatchResult.java new file mode 100644 index 0000000000..7281571f91 --- /dev/null +++ b/java-core/google-cloud-core/src/main/java/com/google/cloud/BatchResult.java @@ -0,0 +1,103 @@ +/* + * Copyright 2016 Google LLC + * + * Licensed under the Apache License, Version 2.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.google.cloud; + +import static com.google.common.base.Preconditions.checkNotNull; +import static com.google.common.base.Preconditions.checkState; + +import com.google.api.core.InternalApi; +import java.util.LinkedList; +import java.util.List; + +/** + * This class holds a single result of a batch call. The class is not thread-safe. + * + * @param the type of the result + * @param the type of the service-dependent exception thrown when a processing error occurs + */ +public abstract class BatchResult { + + private T result; + private boolean completed = false; + private E error; + private final List> toBeNotified = new LinkedList<>(); + + @InternalApi("This class should only be extended within google-cloud-java") + protected BatchResult() {} + + /** + * Returns {@code true} if the batch has been completed and the result is available; {@code false} + * otherwise. + */ + public boolean completed() { + return completed; + } + + /** + * Returns the result of this call. + * + * @throws IllegalStateException if the batch has not been completed yet + * @throws E if an error occurred when processing the batch request + */ + public T get() throws E { + checkState(completed(), "Batch has not been completed yet"); + if (error != null) { + throw error; + } + return result; + } + + /** + * Adds a callback for the batch operation. + * + * @throws IllegalStateException if the batch has been completed already + */ + public void notify(Callback callback) { + checkState( + !completed, + "The batch has been completed. All the calls to the notify()" + + " method should be done prior to submitting the batch."); + toBeNotified.add(callback); + } + + /** Sets an error and status as completed. Notifies all callbacks. */ + protected void error(E error) { + this.error = checkNotNull(error); + this.completed = true; + for (Callback callback : toBeNotified) { + callback.error(error); + } + } + + /** Sets a result and status as completed. Notifies all callbacks. */ + protected void success(T result) { + this.result = result; + this.completed = true; + for (Callback callback : toBeNotified) { + callback.success(result); + } + } + + /** An interface for the batch callbacks. */ + public interface Callback { + /** The method to be called when the batched operation succeeds. */ + void success(T result); + + /** The method to be called when the batched operation fails. */ + void error(E exception); + } +} diff --git a/java-core/google-cloud-core/src/main/java/com/google/cloud/Binding.java b/java-core/google-cloud-core/src/main/java/com/google/cloud/Binding.java new file mode 100644 index 0000000000..5bbb425ea0 --- /dev/null +++ b/java-core/google-cloud-core/src/main/java/com/google/cloud/Binding.java @@ -0,0 +1,109 @@ +/* + * 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. + */ + +package com.google.cloud; + +import com.google.api.core.BetaApi; +import com.google.auto.value.AutoValue; +import com.google.common.base.Predicate; +import com.google.common.collect.Collections2; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.Lists; +import java.util.Arrays; +import java.util.Collection; +import java.util.List; +import javax.annotation.Nullable; + +/** + * Class for Identity and Access Management (IAM) policies. IAM policies are used to specify access + * settings for Cloud Platform resources. A policy is a list of bindings. A binding assigns a set of + * identities to a role, where the identities can be user accounts, Google groups, Google domains, + * and service accounts. A role is a named list of permissions defined by IAM. + * + * @see Policy + */ +@BetaApi("This is a Beta API is not stable yet and may change in the future.") +@AutoValue +public abstract class Binding { + /** Get IAM Policy Binding Role */ + public abstract String getRole(); + + /** Get IAM Policy Binding Members */ + public abstract ImmutableList getMembers(); + + /** Get IAM Policy Binding Condition */ + @Nullable + public abstract Condition getCondition(); + + /** Create a Binding.Builder from an existing Binding */ + public abstract Builder toBuilder(); + + /** Create a new Binding.Builder */ + public static Builder newBuilder() { + List emptyMembers = ImmutableList.of(); + return new AutoValue_Binding.Builder().setMembers(emptyMembers); + } + + @AutoValue.Builder + public abstract static class Builder { + /** + * Set IAM Role for Policy Binding + * + * @throws NullPointerException if the role is null. + */ + public abstract Builder setRole(String role); + + /** + * Set IAM Members for Policy Binding + * + * @throws NullPointerException if a member is null. + */ + public abstract Builder setMembers(Iterable members); + + /** Set IAM Condition for Policy Binding */ + public abstract Builder setCondition(Condition condition); + + /** Internal use to getMembers() in addMembers() and removeMembers() */ + abstract ImmutableList getMembers(); + + /** + * Add members to Policy Binding. + * + * @throws NullPointerException if a member is null. + */ + public Builder addMembers(String member, String... moreMembers) { + ImmutableList.Builder membersBuilder = ImmutableList.builder(); + membersBuilder.addAll(getMembers()); + membersBuilder.addAll(Lists.asList(member, moreMembers)); + setMembers(membersBuilder.build()); + return this; + } + + /** + * Remove members to Policy Binding. + * + * @throws NullPointerException if a member is null. + */ + public Builder removeMembers(String... members) { + Predicate selectMembersNotInList = e -> !Arrays.asList(members).contains(e); + Collection filter = Collections2.filter(getMembers(), selectMembersNotInList); + setMembers(filter); + return this; + } + + public abstract Binding build(); + } +} diff --git a/java-core/google-cloud-core/src/main/java/com/google/cloud/ByteArray.java b/java-core/google-cloud-core/src/main/java/com/google/cloud/ByteArray.java new file mode 100644 index 0000000000..5841c541c4 --- /dev/null +++ b/java-core/google-cloud-core/src/main/java/com/google/cloud/ByteArray.java @@ -0,0 +1,153 @@ +/* + * Copyright 2016 Google LLC + * + * Licensed under the Apache License, Version 2.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.google.cloud; + +import com.google.api.core.BetaApi; +import com.google.common.base.MoreObjects; +import com.google.common.base.MoreObjects.ToStringHelper; +import com.google.common.io.BaseEncoding; +import com.google.protobuf.ByteString; +import java.io.IOException; +import java.io.InputStream; +import java.io.Serializable; +import java.nio.ByteBuffer; +import java.nio.charset.StandardCharsets; +import java.util.Iterator; + +/** An immutable byte array holder. */ +@BetaApi +public class ByteArray implements Iterable, Serializable { + + private static final long serialVersionUID = -1908809133893782840L; + private static final BaseEncoding encoder = BaseEncoding.base64(); + + private final ByteString byteString; + + ByteArray(ByteString byteString) { + this.byteString = byteString; + } + + @Override + public final Iterator iterator() { + return byteString.iterator(); + } + + @Override + public String toString() { + ToStringHelper toStringHelper = MoreObjects.toStringHelper(this); + StringBuilder stBuilder = new StringBuilder(); + for (int i = 0; i < Math.min(256, byteString.size()); i++) { + stBuilder.append(String.format("%02x", byteString.byteAt(i))); + } + if (byteString.size() > 256) { + stBuilder.append("..."); + } + return toStringHelper.add("bytes", stBuilder.toString()).toString(); + } + + @Override + public final int hashCode() { + return byteString.hashCode(); + } + + @Override + public final boolean equals(Object obj) { + return obj == this + || obj instanceof ByteArray && byteString.equals(((ByteArray) obj).byteString); + } + + /** Returns the number of bytes in this {@code ByteArray}. */ + public final int length() { + return byteString.size(); + } + + /** Returns a copy of this {@code ByteArray} as an array of bytes. */ + public final byte[] toByteArray() { + return byteString.toByteArray(); + } + + /** Returns a copy of this {@code ByteArray} as an {@code UTF-8} string. */ + public final String toStringUtf8() { + return byteString.toStringUtf8(); + } + + /** Converts this byte array to its base64 representation. */ + public final String toBase64() { + return encoder.encode(toByteArray()); + } + + /** Returns the content of this {@code ByteArray} as a read-only {@link ByteBuffer}. */ + public final ByteBuffer asReadOnlyByteBuffer() { + return byteString.asReadOnlyByteBuffer(); + } + + /** Returns an {@link InputStream} for this {@code ByteArray} content. */ + public final InputStream asInputStream() { + return byteString.newInput(); + } + + /** + * Copies the content of this {@code ByteArray} into an existing {@code ByteBuffer}. + * + * @throws java.nio.ReadOnlyBufferException if the target is read-only + * @throws java.nio.BufferOverflowException if the target's {@link ByteBuffer#remaining()} space + * is not large enough to hold the data + */ + public final void copyTo(ByteBuffer target) { + byteString.copyTo(target); + } + + /** + * Copies the content of this {@code ByteArray} into an array of bytes. + * + * @throws IndexOutOfBoundsException if the target is not large enough to hold the data + */ + public final void copyTo(byte[] target) { + byteString.copyTo(target, 0); + } + + /** Creates a {@code ByteArray} object given an array of bytes. The bytes are copied. */ + public static final ByteArray copyFrom(byte[] bytes) { + return new ByteArray(ByteString.copyFrom(bytes)); + } + + /** + * Creates a {@code ByteArray} object given a string. The string is encoded in {@code UTF-8}. The + * bytes are copied. + */ + public static final ByteArray copyFrom(String string) { + return new ByteArray(ByteString.copyFrom(string, StandardCharsets.UTF_8)); + } + + /** Creates a {@code ByteArray} object given a {@link ByteBuffer}. The bytes are copied. */ + public static final ByteArray copyFrom(ByteBuffer bytes) { + return new ByteArray(ByteString.copyFrom(bytes)); + } + + /** + * Creates a {@code ByteArray} object given an {@link InputStream}. The stream is read into the + * created object. + */ + public static final ByteArray copyFrom(InputStream input) throws IOException { + return new ByteArray(ByteString.readFrom(input)); + } + + /** Creates a {@code ByteArray} from a base64 representation. */ + public static ByteArray fromBase64(String data) { + return ByteArray.copyFrom(encoder.decode(data)); + } +} diff --git a/java-core/google-cloud-core/src/main/java/com/google/cloud/Condition.java b/java-core/google-cloud-core/src/main/java/com/google/cloud/Condition.java new file mode 100644 index 0000000000..c3c4c83fb9 --- /dev/null +++ b/java-core/google-cloud-core/src/main/java/com/google/cloud/Condition.java @@ -0,0 +1,68 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * 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.google.cloud; + +import com.google.api.core.BetaApi; +import com.google.auto.value.AutoValue; +import javax.annotation.Nullable; + +/** + * Class for Identity and Access Management (IAM) policies. IAM policies are used to specify access + * settings for Cloud Platform resources. A policy is a list of bindings. A binding assigns a set of + * identities to a role, where the identities can be user accounts, Google groups, Google domains, + * and service accounts. A role is a named list of permissions defined by IAM. + * + * @see Policy + * @see IAM Conditions + */ +@BetaApi("This is a Beta API is not stable yet and may change in the future.") +@AutoValue +public abstract class Condition { + /** Get IAM Policy Binding Condition Title */ + @Nullable + public abstract String getTitle(); + + /** Get IAM Policy Binding Condition Description */ + @Nullable + public abstract String getDescription(); + + /** Get IAM Policy Binding Condition Expression */ + public abstract String getExpression(); + + /** Create a new Condition.Builder from an existing Condition */ + public abstract Builder toBuilder(); + + /** Create a new Condition.Builder */ + public static Builder newBuilder() { + return new AutoValue_Condition.Builder(); + } + + @AutoValue.Builder + public abstract static class Builder { + /** Set IAM Policy Binding Condition Title */ + public abstract Builder setTitle(@Nullable String title); + + /** Set IAM Policy Binding Condition Description */ + public abstract Builder setDescription(@Nullable String description); + + /** Set IAM Policy Binding Condition Expression */ + public abstract Builder setExpression(String expression); + + /** Build Builder which creates a Condition instance */ + public abstract Condition build(); + } +} diff --git a/java-core/google-cloud-core/src/main/java/com/google/cloud/Date.java b/java-core/google-cloud-core/src/main/java/com/google/cloud/Date.java new file mode 100644 index 0000000000..b7b99b7905 --- /dev/null +++ b/java-core/google-cloud-core/src/main/java/com/google/cloud/Date.java @@ -0,0 +1,161 @@ +/* + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.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.google.cloud; + +import com.google.api.core.BetaApi; +import com.google.common.base.Preconditions; +import java.io.Serializable; +import java.util.Calendar; +import java.util.Objects; + +/** Represents a Date without time, such as 2017-03-17. Date is timezone independent. */ +@BetaApi("This is going to be replaced with LocalDate from threetenbp") +public final class Date implements Comparable, Serializable { + + // Date format "yyyy-mm-dd" + private static final long serialVersionUID = 8067099123096783929L; + private final int year; + private final int month; + private final int dayOfMonth; + + private Date(int year, int month, int dayOfMonth) { + Preconditions.checkArgument(year > 0, "Invalid year: " + year); + Preconditions.checkArgument(month > 0 && month <= 12, "Invalid month: " + month); + Preconditions.checkArgument(dayOfMonth > 0 && dayOfMonth <= 31, "Invalid day: " + dayOfMonth); + this.year = year; + this.month = month; + this.dayOfMonth = dayOfMonth; + } + + /** + * Constructs a new Date instance. + * + * @param year must be greater than 0 + * @param month must be between [1,12] + * @param dayOfMonth must be between [1,31] + */ + public static Date fromYearMonthDay(int year, int month, int dayOfMonth) { + return new Date(year, month, dayOfMonth); + } + + /** + * @param date Data in RFC 3339 date format (yyyy-mm-dd). + */ + public static Date parseDate(String date) { + Preconditions.checkNotNull(date); + final String invalidDate = "Invalid date: " + date; + Preconditions.checkArgument(date.length() == 10, invalidDate); + Preconditions.checkArgument(date.charAt(4) == '-', invalidDate); + Preconditions.checkArgument(date.charAt(7) == '-', invalidDate); + try { + int year = Integer.parseInt(date.substring(0, 4)); + int month = Integer.parseInt(date.substring(5, 7)); + int dayOfMonth = Integer.parseInt(date.substring(8, 10)); + return new Date(year, month, dayOfMonth); + } catch (NumberFormatException e) { + throw new IllegalArgumentException(invalidDate, e); + } + } + + /** + * Convert a Google Date to a Java Util Date. + * + * @param date the date of the Google Date. + * @return java.util.Date + */ + public static java.util.Date toJavaUtilDate(Date date) { + Calendar cal = Calendar.getInstance(); + cal.set(Calendar.HOUR_OF_DAY, 0); + cal.set(Calendar.MINUTE, 0); + cal.set(Calendar.SECOND, 0); + cal.set(Calendar.MILLISECOND, 0); + // Calender.MONTH starts from 0 while G C date starts from 1 + cal.set(date.year, date.month - 1, date.dayOfMonth); + return cal.getTime(); + } + + /** + * Convert a Java Util Date to a Google Date. + * + * @param date the date of the java.util.Date + * @return Google Java Date + */ + public static Date fromJavaUtilDate(java.util.Date date) { + Calendar cal = Calendar.getInstance(); + cal.setTime(date); + cal.set(Calendar.HOUR_OF_DAY, 0); + cal.set(Calendar.MINUTE, 0); + cal.set(Calendar.SECOND, 0); + cal.set(Calendar.MILLISECOND, 0); + // Calender.MONTH starts from 0 while G C date starts from 1 + return new Date( + cal.get(Calendar.YEAR), cal.get(Calendar.MONTH) + 1, cal.get(Calendar.DAY_OF_MONTH)); + } + + /** Returns the year. */ + public int getYear() { + return year; + } + + /** Returns the month between 1 and 12 inclusive. */ + public int getMonth() { + return month; + } + + /** Returns day of month between 1 and 31 inclusive. */ + public int getDayOfMonth() { + return dayOfMonth; + } + + @Override + public String toString() { + return String.format("%04d-%02d-%02d", year, month, dayOfMonth); + } + + StringBuilder toString(StringBuilder b) { + return b.append(toString()); + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Date that = (Date) o; + return year == that.year && month == that.month && dayOfMonth == that.dayOfMonth; + } + + @Override + public int hashCode() { + return Objects.hash(year, month, dayOfMonth); + } + + @Override + public int compareTo(Date other) { + int r = Integer.compare(year, other.year); + if (r == 0) { + r = Integer.compare(month, other.month); + if (r == 0) { + r = Integer.compare(dayOfMonth, other.dayOfMonth); + } + } + return r; + } +} diff --git a/java-core/google-cloud-core/src/main/java/com/google/cloud/ExceptionHandler.java b/java-core/google-cloud-core/src/main/java/com/google/cloud/ExceptionHandler.java new file mode 100644 index 0000000000..d243de1807 --- /dev/null +++ b/java-core/google-cloud-core/src/main/java/com/google/cloud/ExceptionHandler.java @@ -0,0 +1,296 @@ +/* + * Copyright 2015 Google LLC + * + * Licensed under the Apache License, Version 2.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.google.cloud; + +import static com.google.common.base.Preconditions.checkNotNull; + +import com.google.api.core.BetaApi; +import com.google.api.gax.retrying.ResultRetryAlgorithm; +import com.google.api.gax.retrying.TimedAttemptSettings; +import com.google.common.annotations.VisibleForTesting; +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableSet; +import com.google.common.collect.Sets; +import java.io.Serializable; +import java.lang.reflect.Method; +import java.util.Objects; +import java.util.Set; +import java.util.concurrent.Callable; + +/** Exception retry algorithm implementation used by {@link RetryHelper}. */ +@BetaApi +public final class ExceptionHandler implements ResultRetryAlgorithm, Serializable { + + private static final long serialVersionUID = -2460707015779532919L; + + private static final ExceptionHandler DEFAULT_INSTANCE = + newBuilder().retryOn(Exception.class).abortOn(RuntimeException.class).build(); + + private final ImmutableList interceptors; + private final ImmutableSet> retriableExceptions; + private final ImmutableSet> nonRetriableExceptions; + private final Set retryInfo = Sets.newHashSet(); + + public interface Interceptor extends Serializable { + + enum RetryResult { + NO_RETRY, + RETRY, + CONTINUE_EVALUATION; + } + + /** + * This method is called before exception evaluation and could short-circuit the process. + * + * @param exception the exception that is being evaluated + * @return {@link RetryResult} to indicate if the exception should be ignored ( {@link + * RetryResult#RETRY}), propagated ({@link RetryResult#NO_RETRY}), or evaluation should + * proceed ({@link RetryResult#CONTINUE_EVALUATION}). + */ + RetryResult beforeEval(Exception exception); + + /** + * This method is called after the evaluation and could alter its result. + * + * @param exception the exception that is being evaluated + * @param retryResult the result of the evaluation so far + * @return {@link RetryResult} to indicate if the exception should be ignored ( {@link + * RetryResult#RETRY}), propagated ({@link RetryResult#NO_RETRY}), or evaluation should + * proceed ({@link RetryResult#CONTINUE_EVALUATION}). + */ + RetryResult afterEval(Exception exception, RetryResult retryResult); + } + + /** ExceptionHandler builder. */ + public static class Builder { + + private final ImmutableList.Builder interceptors = ImmutableList.builder(); + private final ImmutableSet.Builder> retriableExceptions = + ImmutableSet.builder(); + private final ImmutableSet.Builder> nonRetriableExceptions = + ImmutableSet.builder(); + + private Builder() {} + + /** + * Adds the exception handler interceptors. Call order will be maintained. + * + * @param interceptors the interceptors for this exception handler + * @return the Builder for chaining + */ + public Builder addInterceptors(Interceptor... interceptors) { + for (Interceptor interceptor : interceptors) { + this.interceptors.add(interceptor); + } + return this; + } + + /** + * Add the exceptions to ignore/retry-on. + * + * @param exceptions retry should continue when such exceptions are thrown + * @return the Builder for chaining + */ + @SafeVarargs + public final Builder retryOn(Class... exceptions) { + for (Class exception : exceptions) { + retriableExceptions.add(checkNotNull(exception)); + } + return this; + } + + /** + * Adds the exceptions to abort on. + * + * @param exceptions retry should abort when such exceptions are thrown + * @return the Builder for chaining + */ + @SafeVarargs + public final Builder abortOn(Class... exceptions) { + for (Class exception : exceptions) { + nonRetriableExceptions.add(checkNotNull(exception)); + } + return this; + } + + /** Returns a new ExceptionHandler instance. */ + public ExceptionHandler build() { + return new ExceptionHandler(this); + } + } + + @VisibleForTesting + static final class RetryInfo implements Serializable { + + private static final long serialVersionUID = -4264634837841455974L; + private final Class exception; + private final Interceptor.RetryResult retry; + private final Set children = Sets.newHashSet(); + + RetryInfo(Class exception, Interceptor.RetryResult retry) { + this.exception = checkNotNull(exception); + this.retry = checkNotNull(retry); + } + + @Override + public int hashCode() { + return exception.hashCode(); + } + + @Override + public boolean equals(Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof RetryInfo)) { + return false; + } + // We only care about exception in equality as we allow only one instance per exception + return ((RetryInfo) obj).exception.equals(exception); + } + } + + private ExceptionHandler(Builder builder) { + interceptors = builder.interceptors.build(); + retriableExceptions = builder.retriableExceptions.build(); + nonRetriableExceptions = builder.nonRetriableExceptions.build(); + Preconditions.checkArgument( + Sets.intersection(retriableExceptions, nonRetriableExceptions).isEmpty(), + "Same exception was found in both retryable and non-retryable sets"); + for (Class exception : retriableExceptions) { + addRetryInfo(new RetryInfo(exception, Interceptor.RetryResult.RETRY), retryInfo); + } + for (Class exception : nonRetriableExceptions) { + addRetryInfo(new RetryInfo(exception, Interceptor.RetryResult.NO_RETRY), retryInfo); + } + } + + private static void addRetryInfo(RetryInfo retryInfo, Set dest) { + for (RetryInfo current : dest) { + if (current.exception.isAssignableFrom(retryInfo.exception)) { + addRetryInfo(retryInfo, current.children); + return; + } + if (retryInfo.exception.isAssignableFrom(current.exception)) { + retryInfo.children.add(current); + } + } + dest.removeAll(retryInfo.children); + dest.add(retryInfo); + } + + private static RetryInfo findMostSpecificRetryInfo( + Set retryInfo, Class exception) { + for (RetryInfo current : retryInfo) { + if (current.exception.isAssignableFrom(exception)) { + RetryInfo match = findMostSpecificRetryInfo(current.children, exception); + return match == null ? current : match; + } + } + return null; + } + + // called for Class, therefore a "call" method must be found. + private static Method getCallableMethod(Class clazz) { + try { + return clazz.getDeclaredMethod("call"); + } catch (NoSuchMethodException e) { + // check parent + return getCallableMethod(clazz.getSuperclass()); + } catch (SecurityException e) { + // This should never happen + throw new IllegalStateException("Unexpected exception", e); + } + } + + void verifyCaller(Callable callable) { + Method callMethod = getCallableMethod(callable.getClass()); + for (Class exceptionOrError : callMethod.getExceptionTypes()) { + Preconditions.checkArgument( + Exception.class.isAssignableFrom(exceptionOrError), + "Callable method exceptions must be derived from Exception"); + @SuppressWarnings("unchecked") + Class exception = (Class) exceptionOrError; + Preconditions.checkArgument( + findMostSpecificRetryInfo(retryInfo, exception) != null, + "Declared exception '" + exception + "' is not covered by exception handler"); + } + } + + @Override + public boolean shouldRetry(Throwable prevThrowable, Object prevResponse) { + if (!(prevThrowable instanceof Exception)) { + return false; + } + Exception ex = (Exception) prevThrowable; + for (Interceptor interceptor : interceptors) { + Interceptor.RetryResult retryResult = checkNotNull(interceptor.beforeEval(ex)); + if (retryResult != Interceptor.RetryResult.CONTINUE_EVALUATION) { + return retryResult == Interceptor.RetryResult.RETRY; + } + } + RetryInfo retryInfo = findMostSpecificRetryInfo(this.retryInfo, ex.getClass()); + Interceptor.RetryResult retryResult = + retryInfo == null ? Interceptor.RetryResult.NO_RETRY : retryInfo.retry; + for (Interceptor interceptor : interceptors) { + Interceptor.RetryResult interceptorRetry = + checkNotNull(interceptor.afterEval(ex, retryResult)); + if (interceptorRetry != Interceptor.RetryResult.CONTINUE_EVALUATION) { + retryResult = interceptorRetry; + } + } + return retryResult == Interceptor.RetryResult.RETRY; + } + + @Override + public TimedAttemptSettings createNextAttempt( + Throwable prevThrowable, Object prevResponse, TimedAttemptSettings prevSettings) { + // Return null to indicate that this implementation does not provide any specific attempt + // settings, so by default the TimedRetryAlgorithm options can be used instead. + return null; + } + + @Override + public int hashCode() { + return Objects.hash(interceptors, retriableExceptions, nonRetriableExceptions, retryInfo); + } + + @Override + public boolean equals(Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof ExceptionHandler)) { + return false; + } + ExceptionHandler other = (ExceptionHandler) obj; + return Objects.equals(interceptors, other.interceptors) + && Objects.equals(retriableExceptions, other.retriableExceptions) + && Objects.equals(nonRetriableExceptions, other.nonRetriableExceptions) + && Objects.equals(retryInfo, other.retryInfo); + } + + /** Returns an instance which retry any checked exception and abort on any runtime exception. */ + public static ExceptionHandler getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + public static Builder newBuilder() { + return new Builder(); + } +} diff --git a/java-core/google-cloud-core/src/main/java/com/google/cloud/FieldSelector.java b/java-core/google-cloud-core/src/main/java/com/google/cloud/FieldSelector.java new file mode 100644 index 0000000000..aad60f7a4d --- /dev/null +++ b/java-core/google-cloud-core/src/main/java/com/google/cloud/FieldSelector.java @@ -0,0 +1,127 @@ +/* + * Copyright 2016 Google LLC + * + * Licensed under the Apache License, Version 2.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.google.cloud; + +import com.google.api.core.InternalApi; +import com.google.common.base.Function; +import com.google.common.base.Joiner; +import com.google.common.collect.Lists; +import com.google.common.collect.Sets; +import java.util.Arrays; +import java.util.List; +import java.util.Set; + +/** + * Interface for Google Cloud resource's fields. Implementations of this interface can be used to + * select only desired fields from a returned Google Cloud resource. + */ +public interface FieldSelector { + + /** + * Returns a string selector. This selector is passed to a Google Cloud service (possibly with + * other field selectors) to specify which resource fields should be returned by an API call. + */ + String getSelector(); + + /** + * A helper class used to build composite selectors given a number of fields. This class is not + * supposed to be used directly by users. + */ + @InternalApi + class Helper { + + private static final String[] EMPTY_FIELDS = {}; + + private Helper() {} + + private static final Function FIELD_TO_STRING_FUNCTION = + new Function() { + @Override + public String apply(FieldSelector fieldSelector) { + return fieldSelector.getSelector(); + } + }; + + private static String selector( + List required, + FieldSelector[] others, + String... extraResourceFields) { + Set fieldStrings = Sets.newHashSetWithExpectedSize(required.size() + others.length); + fieldStrings.addAll(Lists.transform(required, FIELD_TO_STRING_FUNCTION)); + fieldStrings.addAll(Lists.transform(Arrays.asList(others), FIELD_TO_STRING_FUNCTION)); + fieldStrings.addAll(Arrays.asList(extraResourceFields)); + return Joiner.on(',').join(fieldStrings); + } + + /** + * Returns a composite selector given a number of resource fields. The string selector returned + * by this method can be used for field selection in API calls that return a single resource. + * This method is not supposed to be used directly by users. + */ + public static String selector(List required, FieldSelector... others) { + return selector(required, others, new String[] {}); + } + + /** + * Returns a composite selector given a number of resource fields and a container name. The + * string selector returned by this method can be used for field selection in API calls that + * return a list of resources. This method is not supposed to be used directly by users. + */ + public static String listSelector( + String containerName, List required, FieldSelector... others) { + return "nextPageToken," + containerName + '(' + selector(required, others) + ')'; + } + + /** + * Returns a composite selector given a number of resource fields and a container name. This + * method also takes an {@code extraResourceFields} parameter to specify some extra resource + * fields as strings. The string selector returned by this method can be used for field + * selection in API calls that return a list of resources. This method is not supposed to be + * used directly by users. + */ + public static String listSelector( + String containerName, + List required, + FieldSelector[] others, + String... extraResourceFields) { + return listSelector(EMPTY_FIELDS, containerName, required, others, extraResourceFields); + } + + /** + * Returns a composite selector given a number of top level fields as strings, a number of + * resource fields and a container name. This method also takes an {@code extraResourceFields} + * parameter to specify some extra resource fields as strings. The string selector returned by + * this method can be used for field selection in API calls that return a list of resources. + * This method is not supposed to be used directly by users. + */ + public static String listSelector( + String[] topLevelFields, + String containerName, + List required, + FieldSelector[] others, + String... extraResourceFields) { + Set topLevelStrings = Sets.newHashSetWithExpectedSize(topLevelFields.length + 1); + topLevelStrings.addAll(Lists.asList("nextPageToken", topLevelFields)); + return Joiner.on(',').join(topLevelStrings) + + "," + + containerName + + '(' + + selector(required, others, extraResourceFields) + + ')'; + } + } +} diff --git a/java-core/google-cloud-core/src/main/java/com/google/cloud/GcpLaunchStage.java b/java-core/google-cloud-core/src/main/java/com/google/cloud/GcpLaunchStage.java new file mode 100644 index 0000000000..e83f773c9d --- /dev/null +++ b/java-core/google-cloud-core/src/main/java/com/google/cloud/GcpLaunchStage.java @@ -0,0 +1,75 @@ +/* + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.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.google.cloud; + +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; + +/** + * A qualifier indicating what level of access and support can be expected of a particular Google + * Cloud Platform feature. The "GeneralAvailability" qualifier is not provided since the vast + * majority of features are in this category. Note that features may be in a later launch stage than + * the client library annotation indicates. + * + *

        See more at the Launch Stages + * Documentation. + */ +public class GcpLaunchStage { + + /** + * Early Access features are limited to a closed group of testers. To use these features, you must + * sign up in advance and sign a Trusted Tester agreement (which includes confidentiality + * provisions). These features may be unstable, changed in backward-incompatible ways, and are not + * guaranteed to be released. + */ + @Retention(RetentionPolicy.RUNTIME) + public @interface EarlyAccess {} + + /** + * Alpha is a limited availability test for releases before they are cleared for widespread use. + * By Alpha, all significant design issues are resolved and we are in the process of verifying + * functionality. Alpha customers need to apply for access, agree to applicable terms, and have + * their projects whitelisted. Alpha releases don’t have to be feature complete, no SLAs are + * provided, and there are no technical support obligations, but they will be far enough along + * that customers can actually use them in test environments or for limited-use tests -- just like + * they would in normal production cases. + */ + @Retention(RetentionPolicy.RUNTIME) + public @interface Alpha {} + + /** + * Beta is the point at which we are ready to open a release for any customer to use. There are no + * SLA or technical support obligations in a Beta release, and charges may be waived in some + * cases. Products will be complete from a feature perspective, but may have some open outstanding + * issues. Beta releases are suitable for limited production use cases. + */ + @Retention(RetentionPolicy.RUNTIME) + public @interface Beta {} + + /** + * Deprecated features are scheduled to be shut down and removed. For more information, see the + * “Deprecation Policy” section of our Terms of + * Service and the Google Cloud Platform + * Subject to the Deprecation Policy documentation. + */ + @Retention(RetentionPolicy.RUNTIME) + public @interface Deprecated {} + + private GcpLaunchStage() { + // Intentionally left blank. + } +} diff --git a/java-core/google-cloud-core/src/main/java/com/google/cloud/Identity.java b/java-core/google-cloud-core/src/main/java/com/google/cloud/Identity.java new file mode 100644 index 0000000000..a3aff1ade7 --- /dev/null +++ b/java-core/google-cloud-core/src/main/java/com/google/cloud/Identity.java @@ -0,0 +1,268 @@ +/* + * Copyright 2016 Google LLC + * + * Licensed under the Apache License, Version 2.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.google.cloud; + +import static com.google.common.base.Preconditions.checkNotNull; + +import com.google.api.core.ApiFunction; +import com.google.common.base.CaseFormat; +import java.io.Serializable; +import java.util.Objects; + +/** + * An identity in a {@link Policy}. The following types of identities are permitted in IAM policies: + * + *

          + *
        • Google account + *
        • Service account + *
        • Google group + *
        • Google Apps domain + *
        + * + *

        There are also two special identities that represent all users and all Google-authenticated + * accounts. + * + * @see Concepts + * related to identity + */ +public final class Identity implements Serializable { + + private static final long serialVersionUID = -8181841964597657446L; + + private final Type type; + private final String value; + + /** The types of IAM identities. */ + public static final class Type extends StringEnumValue { + private static final long serialVersionUID = 3809891273596003916L; + + private Type(String constant) { + super(constant); + } + + private static final ApiFunction CONSTRUCTOR = + new ApiFunction() { + @Override + public Type apply(String constant) { + return new Type(constant); + } + }; + + private static final StringEnumType type = new StringEnumType(Type.class, CONSTRUCTOR); + + /** Represents anyone who is on the internet; with or without a Google account. */ + public static final Type ALL_USERS = type.createAndRegister("ALL_USERS"); + + /** Represents anyone who is authenticated with a Google account or a service account. */ + public static final Type ALL_AUTHENTICATED_USERS = + type.createAndRegister("ALL_AUTHENTICATED_USERS"); + + /** Represents a specific Google account. */ + public static final Type USER = type.createAndRegister("USER"); + + /** Represents a service account. */ + public static final Type SERVICE_ACCOUNT = type.createAndRegister("SERVICE_ACCOUNT"); + + /** Represents a Google group. */ + public static final Type GROUP = type.createAndRegister("GROUP"); + + /** Represents all the users of a Google Apps domain name. */ + public static final Type DOMAIN = type.createAndRegister("DOMAIN"); + + /** Represents owners of a Google Cloud Platform project. */ + public static final Type PROJECT_OWNER = type.createAndRegister("PROJECT_OWNER"); + + /** Represents editors of a Google Cloud Platform project. */ + public static final Type PROJECT_EDITOR = type.createAndRegister("PROJECT_EDITOR"); + + /** Represents viewers of a Google Cloud Platform project. */ + public static final Type PROJECT_VIEWER = type.createAndRegister("PROJECT_VIEWER"); + + /** + * Get the Type for the given String constant, and throw an exception if the constant is not + * recognized. + */ + public static Type valueOfStrict(String constant) { + return type.valueOfStrict(constant); + } + + /** Get the Type for the given String constant, and allow unrecognized values. */ + public static Type valueOf(String constant) { + return type.valueOf(constant); + } + + /** Return the known values for Type. */ + public static Type[] values() { + return type.values(); + } + } + + private Identity(Type type, String value) { + this.type = type; + this.value = value; + } + + public Type getType() { + return type; + } + + /** + * Returns the string identifier for this identity. The value corresponds to: + * + *

          + *
        • email address (for identities of type {@code USER}, {@code SERVICE_ACCOUNT}, and {@code + * GROUP}) + *
        • domain (for identities of type {@code DOMAIN}) + *
        • {@code null} (for identities of type {@code ALL_USERS} and {@code + * ALL_AUTHENTICATED_USERS}) + *
        + */ + public String getValue() { + return value; + } + + /** + * Returns a new identity representing anyone who is on the internet; with or without a Google + * account. + */ + public static Identity allUsers() { + return new Identity(Type.ALL_USERS, null); + } + + /** + * Returns a new identity representing anyone who is authenticated with a Google account or a + * service account. + */ + public static Identity allAuthenticatedUsers() { + return new Identity(Type.ALL_AUTHENTICATED_USERS, null); + } + + /** + * Returns a new user identity. + * + * @param email An email address that represents a specific Google account. For example, + * alice@gmail.com or joe@example.com. + */ + public static Identity user(String email) { + return new Identity(Type.USER, checkNotNull(email)); + } + + /** + * Returns a new service account identity. + * + * @param email An email address that represents a service account. For example, + * my-other-app@appspot.gserviceaccount.com. + */ + public static Identity serviceAccount(String email) { + return new Identity(Type.SERVICE_ACCOUNT, checkNotNull(email)); + } + + /** + * Returns a new group identity. + * + * @param email An email address that represents a Google group. For example, + * admins@example.com. + */ + public static Identity group(String email) { + return new Identity(Type.GROUP, checkNotNull(email)); + } + + /** + * Returns a new domain identity. + * + * @param domain A Google Apps domain name that represents all the users of that domain. For + * example, google.com or example.com. + */ + public static Identity domain(String domain) { + return new Identity(Type.DOMAIN, checkNotNull(domain)); + } + + /** + * Returns a new project owner identity. + * + * @param projectId A Google Cloud Platform project ID. For example, my-sample-project. + */ + public static Identity projectOwner(String projectId) { + return new Identity(Type.PROJECT_OWNER, checkNotNull(projectId)); + } + + /** + * Returns a new project editor identity. + * + * @param projectId A Google Cloud Platform project ID. For example, my-sample-project. + */ + public static Identity projectEditor(String projectId) { + return new Identity(Type.PROJECT_EDITOR, checkNotNull(projectId)); + } + + /** + * Returns a new project viewer identity. + * + * @param projectId A Google Cloud Platform project ID. For example, my-sample-project. + */ + public static Identity projectViewer(String projectId) { + return new Identity(Type.PROJECT_VIEWER, checkNotNull(projectId)); + } + + @Override + public String toString() { + return strValue(); + } + + @Override + public int hashCode() { + return Objects.hash(value, type); + } + + @Override + public boolean equals(Object obj) { + if (!(obj instanceof Identity)) { + return false; + } + Identity other = (Identity) obj; + return Objects.equals(value, other.getValue()) && Objects.equals(type, other.getType()); + } + + /** + * Returns the string value associated with the identity. Used primarily for converting from + * {@code Identity} objects to strings for protobuf-generated policies. + */ + public String strValue() { + String protobufString = CaseFormat.UPPER_UNDERSCORE.to(CaseFormat.LOWER_CAMEL, type.toString()); + if (value == null) { + return protobufString; + } else { + return protobufString + ":" + value; + } + } + + /** + * Converts a string to an {@code Identity}. Used primarily for converting protobuf-generated + * policy identities to {@code Identity} objects. + */ + public static Identity valueOf(String identityStr) { + String[] info = identityStr.split(":", 2); + Type type = Type.valueOf(CaseFormat.LOWER_CAMEL.to(CaseFormat.UPPER_UNDERSCORE, info[0])); + if (info.length == 1) { + return new Identity(type, null); + } else if (info.length == 2) { + return new Identity(type, info[1]); + } else { + throw new IllegalArgumentException("Illegal identity string: \"" + identityStr + "\""); + } + } +} diff --git a/java-core/google-cloud-core/src/main/java/com/google/cloud/MetadataConfig.java b/java-core/google-cloud-core/src/main/java/com/google/cloud/MetadataConfig.java new file mode 100644 index 0000000000..8f1bac04ca --- /dev/null +++ b/java-core/google-cloud-core/src/main/java/com/google/cloud/MetadataConfig.java @@ -0,0 +1,88 @@ +/* + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.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.google.cloud; + +import static java.nio.charset.StandardCharsets.UTF_8; + +import java.io.BufferedReader; +import java.io.IOException; +import java.io.InputStream; +import java.io.InputStreamReader; +import java.net.HttpURLConnection; +import java.net.URL; + +/** + * Retrieves Google Cloud project-id and a limited set of instance attributes from Metadata server. + * + * @see + * https://cloud.google.com/compute/docs/storing-retrieving-metadata + */ +public class MetadataConfig { + + private static final String METADATA_URL = "http://metadata.google.internal/computeMetadata/v1/"; + private static final int TIMEOUT_MS = 5000; + + private MetadataConfig() {} + + public static String getProjectId() { + return getAttribute("project/project-id"); + } + + public static String getZone() { + String zoneId = getAttribute("instance/zone"); + if (zoneId != null && zoneId.contains("/")) { + return zoneId.substring(zoneId.lastIndexOf('/') + 1); + } + return zoneId; + } + + public static String getInstanceId() { + return getAttribute("instance/id"); + } + + public static String getClusterName() { + return getAttribute("instance/attributes/cluster-name"); + } + + public static String getContainerName() { + return getAttribute("instance/attributes/container-name"); + } + + public static String getNamespaceId() { + return getAttribute("instance/attributes/namespace-id"); + } + + public static String getAttribute(String attributeName) { + try { + URL url = new URL(METADATA_URL + attributeName); + HttpURLConnection connection = (HttpURLConnection) url.openConnection(); + connection.setConnectTimeout(TIMEOUT_MS); + connection.setReadTimeout(TIMEOUT_MS); + connection.setRequestProperty("Metadata-Flavor", "Google"); + try (InputStream input = connection.getInputStream()) { + if (connection.getResponseCode() == 200) { + try (BufferedReader reader = new BufferedReader(new InputStreamReader(input, UTF_8))) { + return reader.readLine(); + } + } + } + } catch (IOException ignore) { + // ignore + } + return null; + } +} diff --git a/java-core/google-cloud-core/src/main/java/com/google/cloud/MonitoredResource.java b/java-core/google-cloud-core/src/main/java/com/google/cloud/MonitoredResource.java new file mode 100644 index 0000000000..a1fbe44b92 --- /dev/null +++ b/java-core/google-cloud-core/src/main/java/com/google/cloud/MonitoredResource.java @@ -0,0 +1,165 @@ +/* + * Copyright 2016 Google LLC + * + * Licensed under the Apache License, Version 2.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.google.cloud; + +import static com.google.common.base.Preconditions.checkNotNull; + +import com.google.common.base.MoreObjects; +import com.google.common.collect.ImmutableMap; +import java.io.Serializable; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** + * Objects of this class represent a resource that can be used for monitoring, logging, billing, or + * other purposes. Examples include virtual machine instances, databases, and storage devices such + * as disks. The type field identifies a {@link MonitoredResourceDescriptor} object that describes + * the resource's schema. Information in the labels field identifies the actual resource and its + * attributes according to the schema. + * + *

        For example, the monitored resource for Google Compute Engine VM instances has {@code + * gce_instance} type and specifies values for the labels {@code instance_id} and {@code zone} to + * identify particular VM instances. + */ +public final class MonitoredResource implements Serializable { + + private static final long serialVersionUID = -4393604148752640581L; + + private final String type; + private final Map labels; + + /** A builder for {@code MonitoredResource} objects. */ + public static class Builder { + + private String type; + private Map labels = new HashMap<>(); + + Builder(String type) { + this.type = type; + } + + Builder(MonitoredResource monitoredResource) { + this.type = monitoredResource.type; + this.labels = new HashMap<>(monitoredResource.labels); + } + + /** + * Sets the monitored resource type. This value must match the one of {@link + * MonitoredResourceDescriptor#getType()} of a {@code MonitoredResourceDescriptor} object. For + * example, the type {@code cloudsql_database} represent databases in Google Cloud SQL. + */ + public Builder setType(String type) { + this.type = type; + return this; + } + + /** + * Sets the values for all the labels required by the corresponding monitored resource + * descriptor (see {@link MonitoredResourceDescriptor#getLabels()}. For example, Google Compute + * Engine VM instances use the labels {@code instance_id} and {@code zone}. + */ + public Builder setLabels(Map labels) { + this.labels = new HashMap<>(checkNotNull(labels)); + return this; + } + + /** Adds a label to the labels of the monitored resource. */ + public Builder addLabel(String key, String value) { + this.labels.put(key, value); + return this; + } + + /** Clears all the labels of the monitored resource. */ + public Builder clearLabels() { + this.labels.clear(); + return this; + } + + public MonitoredResource build() { + return new MonitoredResource(this); + } + } + + MonitoredResource(Builder builder) { + this.type = checkNotNull(builder.type); + this.labels = ImmutableMap.copyOf(builder.labels); + } + + /** + * Returns the monitored resource type. This value must match the one of {@link + * MonitoredResourceDescriptor#getType()} of a {@code MonitoredResourceDescriptor} object. For + * example, the type {@code cloudsql_database} represent databases in Google Cloud SQL. + */ + public String getType() { + return type; + } + + /** + * Returns the values for all the labels required by the corresponding monitored resource + * descriptor (see {@link MonitoredResourceDescriptor#getLabels()}. For example, Google Compute + * Engine VM instances use the labels {@code instance_id} and {@code zone}. + */ + public Map getLabels() { + return labels; + } + + @Override + public int hashCode() { + return Objects.hash(type, labels); + } + + @Override + public boolean equals(Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof MonitoredResource)) { + return false; + } + MonitoredResource other = (MonitoredResource) obj; + return Objects.equals(type, other.type) && Objects.equals(labels, other.labels); + } + + @Override + public String toString() { + return MoreObjects.toStringHelper(this).add("type", type).add("labels", labels).toString(); + } + + public com.google.api.MonitoredResource toPb() { + return com.google.api.MonitoredResource.newBuilder().setType(type).putAllLabels(labels).build(); + } + + /** Returns a builder for this {@code MonitoredResource} object. */ + public Builder toBuilder() { + return new Builder(this); + } + + /** Returns a builder for {@code MonitoredResource} objects given the resource's type. */ + public static Builder newBuilder(String type) { + return new Builder(type); + } + + /** Creates a {@code MonitoredResource} object given the resource's type and labels. */ + public static MonitoredResource of(String type, Map labels) { + return newBuilder(type).setLabels(labels).build(); + } + + public static MonitoredResource fromPb(com.google.api.MonitoredResource descriptorPb) { + return new Builder(descriptorPb.getType()).setLabels(descriptorPb.getLabelsMap()).build(); + } +} diff --git a/java-core/google-cloud-core/src/main/java/com/google/cloud/MonitoredResourceDescriptor.java b/java-core/google-cloud-core/src/main/java/com/google/cloud/MonitoredResourceDescriptor.java new file mode 100644 index 0000000000..cfc24590d4 --- /dev/null +++ b/java-core/google-cloud-core/src/main/java/com/google/cloud/MonitoredResourceDescriptor.java @@ -0,0 +1,342 @@ +/* + * Copyright 2016 Google LLC + * + * Licensed under the Apache License, Version 2.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.google.cloud; + +import static com.google.common.base.Preconditions.checkNotNull; + +import com.google.api.core.ApiFunction; +import com.google.common.base.Function; +import com.google.common.base.MoreObjects; +import com.google.common.collect.Iterables; +import com.google.common.collect.Lists; +import java.io.Serializable; +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; + +/** + * This class describes the schema of Cloud monitored resources. Monitored resource descriptors + * contain a type name and a set of labels. For example, the monitored resource descriptor for + * Google Compute Engine VM instances has a type of {@code gce_instance} and specifies the use of + * the labels {@code instance_id} and {@code zone} to identify particular VM instances. + */ +public class MonitoredResourceDescriptor implements Serializable { + + private static final long serialVersionUID = -3702077512777687441L; + public static final ApiFunction< + com.google.api.MonitoredResourceDescriptor, MonitoredResourceDescriptor> + FROM_PB_FUNCTION = + new ApiFunction< + com.google.api.MonitoredResourceDescriptor, MonitoredResourceDescriptor>() { + @Override + public MonitoredResourceDescriptor apply( + com.google.api.MonitoredResourceDescriptor pb) { + return fromPb(pb); + } + }; + + private final String type; + private final String name; + private final String displayName; + private final String description; + private final List labels; + + /** + * This class describes a label for a monitored resource. Label descriptors contain the key for + * the label, the type of data that the label can hold and an optional description. + */ + public static class LabelDescriptor implements Serializable { + + private static final long serialVersionUID = -2811608103754481777L; + private static final Function + FROM_PB_FUNCTION = + new Function() { + @Override + public LabelDescriptor apply(com.google.api.LabelDescriptor descriptorPb) { + return fromPb(descriptorPb); + } + }; + private static final Function TO_PB_FUNCTION = + new Function() { + @Override + public com.google.api.LabelDescriptor apply(LabelDescriptor descriptor) { + return descriptor.toPb(); + } + }; + + private final String key; + private final ValueType valueType; + private final String description; + + /** Value types that can be used as label values. */ + public enum ValueType { + STRING(com.google.api.LabelDescriptor.ValueType.STRING), + BOOL(com.google.api.LabelDescriptor.ValueType.BOOL), + INT64(com.google.api.LabelDescriptor.ValueType.INT64); + + private com.google.api.LabelDescriptor.ValueType typePb; + + ValueType(com.google.api.LabelDescriptor.ValueType typePb) { + this.typePb = typePb; + } + + com.google.api.LabelDescriptor.ValueType toPb() { + return typePb; + } + + static ValueType fromPb(com.google.api.LabelDescriptor.ValueType typePb) { + switch (typePb) { + case STRING: + return ValueType.STRING; + case BOOL: + return ValueType.BOOL; + case INT64: + return ValueType.INT64; + default: + throw new IllegalArgumentException("Unrecognized label type"); + } + } + } + + LabelDescriptor(String key, ValueType valueType, String description) { + this.key = checkNotNull(key); + this.valueType = checkNotNull(valueType); + this.description = description; + } + + /** Returns the key associated to this label. */ + public String getKey() { + return key; + } + + /** Returns the type of data that can be assigned to this label. */ + public ValueType getValueType() { + return valueType; + } + + /** + * Returns the optional human-readable description for this label. If not set, this method + * returns {@code null}. + */ + public String getDescription() { + return description; + } + + @Override + public final int hashCode() { + return Objects.hash(key, valueType, description); + } + + @Override + public final boolean equals(Object obj) { + if (obj == this) { + return true; + } + if (obj == null || !obj.getClass().equals(LabelDescriptor.class)) { + return false; + } + LabelDescriptor other = (LabelDescriptor) obj; + return Objects.equals(key, other.key) + && Objects.equals(valueType, other.valueType) + && Objects.equals(description, other.description); + } + + @Override + public String toString() { + return MoreObjects.toStringHelper(this) + .add("key", key) + .add("valueType", valueType) + .add("description", description) + .toString(); + } + + com.google.api.LabelDescriptor toPb() { + com.google.api.LabelDescriptor.Builder builder = + com.google.api.LabelDescriptor.newBuilder().setKey(key).setValueType(valueType.toPb()); + if (description != null) { + builder.setDescription(description); + } + return builder.build(); + } + + static LabelDescriptor fromPb(com.google.api.LabelDescriptor descriptorPb) { + String description = null; + if (descriptorPb.getDescription() != null && !descriptorPb.getDescription().equals("")) { + description = descriptorPb.getDescription(); + } + return new LabelDescriptor( + descriptorPb.getKey(), ValueType.fromPb(descriptorPb.getValueType()), description); + } + } + + static class Builder { + + private final String type; + private String name; + private String displayName; + private String description; + private List labels = new ArrayList<>(); + + Builder(String type) { + this.type = type; + } + + Builder setName(String name) { + this.name = name; + return this; + } + + Builder setDisplayName(String displayName) { + this.displayName = displayName; + return this; + } + + Builder setDescription(String description) { + this.description = description; + return this; + } + + Builder setLabels(List labels) { + this.labels = labels; + return this; + } + + MonitoredResourceDescriptor build() { + return new MonitoredResourceDescriptor(this); + } + } + + MonitoredResourceDescriptor(Builder builder) { + this.type = checkNotNull(builder.type); + this.name = builder.name; + this.displayName = builder.displayName; + this.description = builder.description; + this.labels = checkNotNull(builder.labels); + } + + /** + * Returns the monitored resource type. For example, the type {@code cloudsql_database} represents + * databases in Google Cloud SQL. + */ + public String getType() { + return type; + } + + /** + * Returns an optional name for the monitored resource descriptor. If not set, this method returns + * {@code null}. + */ + public String getName() { + return name; + } + + /** + * Returns an optional concise name for the monitored resource type. This value might be displayed + * in user interfaces. For example, {@code Google Cloud SQL Database}. If not set, this method + * returns {@code null}. + */ + public String getDisplayName() { + return displayName; + } + + /** + * Returns an optional detailed description of the monitored resource type. This value might be + * used in documentation. If not set, this method returns {@code null}. + */ + public String getDescription() { + return description; + } + + /** + * Returns a list of labels used to describe instances of this monitored resource type. For + * example, an individual Google Cloud SQL database is identified by values for the labels {@code + * database_id} and {@code region}. + */ + public List getLabels() { + return labels; + } + + @Override + public final int hashCode() { + return Objects.hash(type, name, displayName, description, labels); + } + + @Override + public final boolean equals(Object obj) { + if (obj == this) { + return true; + } + if (obj == null || !obj.getClass().equals(MonitoredResourceDescriptor.class)) { + return false; + } + MonitoredResourceDescriptor other = (MonitoredResourceDescriptor) obj; + return Objects.equals(type, other.type) + && Objects.equals(name, other.name) + && Objects.equals(displayName, other.displayName) + && Objects.equals(description, other.description) + && Objects.equals(labels, other.labels); + } + + @Override + public String toString() { + return MoreObjects.toStringHelper(this) + .add("type", type) + .add("name", name) + .add("displayName", displayName) + .add("description", description) + .add("labels", labels) + .toString(); + } + + public com.google.api.MonitoredResourceDescriptor toPb() { + com.google.api.MonitoredResourceDescriptor.Builder builder = + com.google.api.MonitoredResourceDescriptor.newBuilder() + .setType(type) + .addAllLabels(Iterables.transform(labels, LabelDescriptor.TO_PB_FUNCTION)); + if (name != null) { + builder.setName(name); + } + if (displayName != null) { + builder.setDisplayName(displayName); + } + if (description != null) { + builder.setDescription(description); + } + return builder.build(); + } + + static Builder newBuilder(String type) { + return new Builder(type); + } + + public static MonitoredResourceDescriptor fromPb( + com.google.api.MonitoredResourceDescriptor descriptorPb) { + Builder builder = newBuilder(descriptorPb.getType()); + if (descriptorPb.getName() != null && !descriptorPb.getName().equals("")) { + builder.setName(descriptorPb.getName()); + } + if (descriptorPb.getDisplayName() != null && !descriptorPb.getDisplayName().equals("")) { + builder.setDisplayName(descriptorPb.getDisplayName()); + } + if (descriptorPb.getDescription() != null && !descriptorPb.getDescription().equals("")) { + builder.setDescription(descriptorPb.getDescription()); + } + builder.setLabels( + Lists.transform(descriptorPb.getLabelsList(), LabelDescriptor.FROM_PB_FUNCTION)); + return builder.build(); + } +} diff --git a/java-core/google-cloud-core/src/main/java/com/google/cloud/NoCredentials.java b/java-core/google-cloud-core/src/main/java/com/google/cloud/NoCredentials.java new file mode 100644 index 0000000000..4726c4d0c6 --- /dev/null +++ b/java-core/google-cloud-core/src/main/java/com/google/cloud/NoCredentials.java @@ -0,0 +1,50 @@ +/* + * Copyright 2016 Google LLC + * + * Licensed under the Apache License, Version 2.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.google.cloud; + +import com.google.auth.oauth2.OAuth2Credentials; +import java.io.ObjectStreamException; + +/** + * A placeholder for credentials to signify that requests sent to the server should not be + * authenticated. This is typically useful when using local service emulators. + */ +public class NoCredentials extends OAuth2Credentials { + + private static final long serialVersionUID = -6263971603971044288L; + private static final NoCredentials INSTANCE = new NoCredentials(); + + private NoCredentials() {} + + private Object readResolve() throws ObjectStreamException { + return INSTANCE; + } + + public static NoCredentials getInstance() { + return INSTANCE; + } + + @Override + public boolean equals(Object obj) { + return this == obj; + } + + @Override + public int hashCode() { + return System.identityHashCode(this); + } +} diff --git a/java-core/google-cloud-core/src/main/java/com/google/cloud/PageImpl.java b/java-core/google-cloud-core/src/main/java/com/google/cloud/PageImpl.java new file mode 100644 index 0000000000..72e0e858b4 --- /dev/null +++ b/java-core/google-cloud-core/src/main/java/com/google/cloud/PageImpl.java @@ -0,0 +1,156 @@ +/* + * Copyright 2015 Google LLC + * + * Licensed under the Apache License, Version 2.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.google.cloud; + +import com.google.api.core.InternalApi; +import com.google.api.gax.paging.Page; +import com.google.common.collect.AbstractIterator; +import com.google.common.collect.ImmutableMap; +import java.io.Serializable; +import java.util.Collections; +import java.util.Iterator; +import java.util.Map; +import java.util.Objects; + +/** + * Base implementation for Google Cloud paginated results. + * + * @param the value type that the page holds + */ +@InternalApi +public class PageImpl implements Page, Serializable { + + private static final long serialVersionUID = 3914827379823557934L; + + private final String cursor; + private final Iterable results; + private final NextPageFetcher pageFetcher; + + /** + * Interface for fetching the next page of results from the service. + * + * @param the value type that the page holds + */ + public interface NextPageFetcher extends Serializable { + + Page getNextPage(); + } + + static class PageIterator extends AbstractIterator { + + private Iterator currentPageIterator; + private Page currentPage; + + PageIterator(Page currentPage) { + this.currentPageIterator = currentPage.getValues().iterator(); + this.currentPage = currentPage; + } + + @Override + protected T computeNext() { + while (!currentPageIterator.hasNext()) { + currentPage = currentPage.getNextPage(); + if (currentPage == null) { + return endOfData(); + } + currentPageIterator = currentPage.getValues().iterator(); + } + return currentPageIterator.next(); + } + } + + /** + * Creates a {@code PageImpl} object. In order for the object to be serializable the {@code + * results} parameter must be serializable. + */ + public PageImpl(NextPageFetcher pageFetcher, String cursor, Iterable results) { + this.pageFetcher = pageFetcher; + this.cursor = cursor; + this.results = results; + } + + @Override + public Iterable getValues() { + return results == null ? Collections.emptyList() : results; + } + + @Override + public Iterable iterateAll() { + return new Iterable() { + @Override + public Iterator iterator() { + return new PageIterator<>(PageImpl.this); + } + }; + } + + @Override + public boolean hasNextPage() { + return getNextPageToken() != null && !getNextPageToken().equals(""); + } + + @Override + public String getNextPageToken() { + return cursor; + } + + @Override + public Page getNextPage() { + if (cursor == null || pageFetcher == null) { + return null; + } + return pageFetcher.getNextPage(); + } + + @Override + public int hashCode() { + return Objects.hash(cursor, results); + } + + @Override + public boolean equals(Object obj) { + if (!(obj instanceof PageImpl)) { + return false; + } + PageImpl other = (PageImpl) obj; + return Objects.equals(cursor, other.cursor) && Objects.equals(results, other.results); + } + + /** + * Utility method to construct the options map for the next page request. + * + * @param the value type that the page holds. Instances of {@code T} should be {@code + * Serializable} + * @param pageTokenOption the key for the next page cursor option in the options map + * @param cursor the cursor for the next page + * @param optionMap the previous options map + * @return the options map for the next page request + */ + public static Map nextRequestOptions( + T pageTokenOption, String cursor, Map optionMap) { + ImmutableMap.Builder builder = ImmutableMap.builder(); + if (cursor != null) { + builder.put(pageTokenOption, cursor); + } + for (Map.Entry option : optionMap.entrySet()) { + if (!Objects.equals(option.getKey(), pageTokenOption)) { + builder.put(option.getKey(), option.getValue()); + } + } + return builder.build(); + } +} diff --git a/java-core/google-cloud-core/src/main/java/com/google/cloud/PlatformInformation.java b/java-core/google-cloud-core/src/main/java/com/google/cloud/PlatformInformation.java new file mode 100644 index 0000000000..8c77bb9e91 --- /dev/null +++ b/java-core/google-cloud-core/src/main/java/com/google/cloud/PlatformInformation.java @@ -0,0 +1,34 @@ +/* + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.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.google.cloud; + +import com.google.api.core.InternalApi; + +@InternalApi("This class should only be used within google-cloud-java") +public final class PlatformInformation { + public static final String GAE_RUNTIME = System.getenv("GAE_RUNTIME"); + + private PlatformInformation() {} + + public static boolean isOnGAEStandard7() { + return "java7".equals(GAE_RUNTIME); + } + + public static boolean isOnGAEStandard8() { + return "java8".equals(GAE_RUNTIME); + } +} diff --git a/java-core/google-cloud-core/src/main/java/com/google/cloud/Policy.java b/java-core/google-cloud-core/src/main/java/com/google/cloud/Policy.java new file mode 100644 index 0000000000..1c5b78c9ea --- /dev/null +++ b/java-core/google-cloud-core/src/main/java/com/google/cloud/Policy.java @@ -0,0 +1,455 @@ +/* + * Copyright 2016 Google LLC + * + * Licensed under the Apache License, Version 2.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.google.cloud; + +import static com.google.common.base.Preconditions.checkArgument; +import static com.google.common.base.Preconditions.checkNotNull; + +import com.google.api.core.ApiFunction; +import com.google.api.core.InternalApi; +import com.google.common.base.MoreObjects; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.ImmutableSet; +import com.google.common.io.BaseEncoding; +import com.google.protobuf.ByteString; +import com.google.type.Expr; +import java.io.Serializable; +import java.util.ArrayList; +import java.util.Iterator; +import java.util.LinkedList; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; + +/** + * Class for Identity and Access Management (IAM) policies. IAM policies are used to specify access + * settings for Cloud Platform resources. A policy is a list of bindings. A binding assigns a set of + * identities to a role, where the identities can be user accounts, Google groups, Google domains, + * and service accounts. A role is a named list of permissions defined by IAM. + * + * @see Policy + */ +public final class Policy implements Serializable { + + private static final long serialVersionUID = -3348914530232544290L; + private final ImmutableList bindingsList; + private final String etag; + private final int version; + + /* + * Return true if Policy is version 3 OR bindings has a conditional binding. + * Return false if Policy is version 1 AND bindings does not have a conditional binding. + */ + private static boolean isConditional(int version, List bindingsList) { + for (Binding binding : bindingsList) { + if (binding.getCondition() != null) { + return true; + } + } + if (version == 3) { + return true; + } + return false; + } + + public abstract static class Marshaller { + + @InternalApi("This class should only be extended within google-cloud-java") + protected Marshaller() {} + + protected static final ApiFunction IDENTITY_VALUE_OF_FUNCTION = + new ApiFunction() { + @Override + public Identity apply(String identityPb) { + return Identity.valueOf(identityPb); + } + }; + protected static final ApiFunction IDENTITY_STR_VALUE_FUNCTION = + new ApiFunction() { + @Override + public String apply(Identity identity) { + return identity.strValue(); + } + }; + + protected abstract Policy fromPb(T policyPb); + + protected abstract T toPb(Policy policy); + } + + public static class DefaultMarshaller extends Marshaller { + + @Override + protected Policy fromPb(com.google.iam.v1.Policy policyPb) { + ImmutableList.Builder bindingsListBuilder = ImmutableList.builder(); + for (com.google.iam.v1.Binding bindingPb : policyPb.getBindingsList()) { + Binding.Builder convertedBinding = + Binding.newBuilder() + .setRole(bindingPb.getRole()) + .setMembers(bindingPb.getMembersList()); + if (bindingPb.hasCondition()) { + Expr expr = bindingPb.getCondition(); + convertedBinding.setCondition( + Condition.newBuilder() + .setTitle(expr.getTitle()) + .setDescription(expr.getDescription()) + .setExpression(expr.getExpression()) + .build()); + } + bindingsListBuilder.add(convertedBinding.build()); + } + return newBuilder() + .setBindings(bindingsListBuilder.build()) + .setEtag( + policyPb.getEtag().isEmpty() + ? null + : BaseEncoding.base64().encode(policyPb.getEtag().toByteArray())) + .setVersion(policyPb.getVersion()) + .build(); + } + + @Override + protected com.google.iam.v1.Policy toPb(Policy policy) { + com.google.iam.v1.Policy.Builder policyBuilder = com.google.iam.v1.Policy.newBuilder(); + List bindingPbList = new LinkedList<>(); + for (Binding binding : policy.getBindingsList()) { + com.google.iam.v1.Binding.Builder bindingBuilder = com.google.iam.v1.Binding.newBuilder(); + bindingBuilder.setRole(binding.getRole()); + bindingBuilder.addAllMembers(binding.getMembers()); + if (binding.getCondition() != null) { + Condition condition = binding.getCondition(); + bindingBuilder.setCondition( + Expr.newBuilder() + .setTitle(condition.getTitle()) + .setDescription(condition.getDescription()) + .setExpression(condition.getExpression()) + .build()); + } + bindingPbList.add(bindingBuilder.build()); + } + policyBuilder.addAllBindings(bindingPbList); + if (policy.etag != null) { + policyBuilder.setEtag(ByteString.copyFrom(BaseEncoding.base64().decode(policy.etag))); + } + policyBuilder.setVersion(policy.version); + return policyBuilder.build(); + } + } + + /** A builder for {@code Policy} objects. */ + public static class Builder { + private final List bindingsList = new ArrayList(); + private String etag; + private int version; + + @InternalApi("This class should only be extended within google-cloud-java") + protected Builder() {} + + @InternalApi("This class should only be extended within google-cloud-java") + protected Builder(Policy policy) { + bindingsList.addAll(policy.bindingsList); + setEtag(policy.etag); + setVersion(policy.version); + } + + /** + * Replaces the builder's map of bindings with the given map of bindings. + * + * @throws NullPointerException if the given map is null or contains any null keys or values + * @throws IllegalArgumentException if any identities in the given map are null or if policy + * version is equal to 3 or has conditional bindings because conditional policies are not + * supported + */ + public final Builder setBindings(Map> bindings) { + checkNotNull(bindings, "The provided map of bindings cannot be null."); + checkArgument( + !isConditional(this.version, this.bindingsList), + "setBindings() is only supported with version 1 policies and non-conditional policies"); + for (Map.Entry> binding : bindings.entrySet()) { + checkNotNull(binding.getKey(), "The role cannot be null."); + Set identities = binding.getValue(); + checkNotNull(identities, "A role cannot be assigned to a null set of identities."); + checkArgument(!identities.contains(null), "Null identities are not permitted."); + } + // convert into List format + this.bindingsList.clear(); + for (Map.Entry> binding : bindings.entrySet()) { + Binding.Builder bindingBuilder = Binding.newBuilder(); + bindingBuilder.setRole(binding.getKey().getValue()); + ImmutableList.Builder membersBuilder = ImmutableList.builder(); + for (Identity identity : binding.getValue()) { + membersBuilder.add(identity.strValue()); + } + bindingBuilder.setMembers(membersBuilder.build()); + this.bindingsList.add(bindingBuilder.build()); + } + return this; + } + + /** + * Replaces the builder's List of bindings with the given List of Bindings. + * + * @throws NullPointerException if the given list is null, role is null, or contains any null + * members in bindings + */ + public final Builder setBindings(List bindings) { + this.bindingsList.clear(); + for (Binding binding : bindings) { + Binding.Builder bindingBuilder = Binding.newBuilder(); + bindingBuilder.setMembers(ImmutableList.copyOf(binding.getMembers())); + bindingBuilder.setRole(binding.getRole()); + bindingBuilder.setCondition(binding.getCondition()); + this.bindingsList.add(bindingBuilder.build()); + } + return this; + } + + /** + * Removes the role (and all identities associated with that role) from the policy. + * + * @throws IllegalArgumentException if policy version is equal to 3 or has conditional bindings + * because conditional policies are not supported + */ + public final Builder removeRole(Role role) { + checkArgument( + !isConditional(this.version, this.bindingsList), + "removeRole() is only supported with version 1 policies and non-conditional policies"); + Iterator iterator = bindingsList.iterator(); + + while (iterator.hasNext()) { + Binding binding = (Binding) iterator.next(); + if (binding.getRole().equals(role.getValue())) { + iterator.remove(); + return this; + } + } + return this; + } + + /** + * Adds one or more identities to the policy under the role specified. + * + * @throws NullPointerException if the role or any of the identities is null. + * @throws IllegalArgumentException if policy version is equal to 3 or has conditional bindings. + */ + public final Builder addIdentity(Role role, Identity first, Identity... others) { + checkArgument( + !isConditional(this.version, this.bindingsList), + "addIdentity() is only supported with version 1 policies and non-conditional policies"); + String nullIdentityMessage = "Null identities are not permitted."; + checkNotNull(first, nullIdentityMessage); + checkNotNull(others, nullIdentityMessage); + checkNotNull(role, "The role cannot be null."); + for (int i = 0; i < bindingsList.size(); i++) { + Binding binding = bindingsList.get(i); + if (binding.getRole().equals(role.getValue())) { + Binding.Builder bindingBuilder = binding.toBuilder(); + ImmutableSet.Builder membersBuilder = ImmutableSet.builder(); + membersBuilder.addAll(binding.getMembers()); + membersBuilder.add(first.strValue()); + for (Identity identity : others) { + membersBuilder.add(identity.strValue()); + } + bindingBuilder.setMembers(membersBuilder.build()); + bindingsList.set(i, bindingBuilder.build()); + return this; + } + } + // Binding does not yet exist. + Binding.Builder bindingBuilder = Binding.newBuilder().setRole(role.getValue()); + ImmutableSet.Builder membersBuilder = ImmutableSet.builder(); + membersBuilder.add(first.strValue()); + for (Identity identity : others) { + membersBuilder.add(identity.strValue()); + } + bindingBuilder.setMembers(membersBuilder.build()); + bindingsList.add(bindingBuilder.build()); + return this; + } + + /** + * Removes one or more identities from an existing binding. Does nothing if the binding + * associated with the provided role doesn't exist. + * + * @throws IllegalArgumentException if policy version is equal to 3 or has conditional bindings + */ + public final Builder removeIdentity(Role role, Identity first, Identity... others) { + checkArgument( + !isConditional(this.version, this.bindingsList), + "removeIdentity() is only supported with version 1 policies and non-conditional policies"); + String nullIdentityMessage = "Null identities are not permitted."; + checkNotNull(first, nullIdentityMessage); + checkNotNull(others, nullIdentityMessage); + checkNotNull(role, "The role cannot be null."); + for (int i = 0; i < bindingsList.size(); i++) { + Binding binding = bindingsList.get(i); + if (binding.getRole().equals(role.getValue())) { + Binding.Builder bindingBuilder = binding.toBuilder().removeMembers(first.strValue()); + for (Identity identity : others) { + bindingBuilder.removeMembers(identity.strValue()); + } + Binding updatedBindings = bindingBuilder.build(); + bindingsList.set(i, updatedBindings); + break; + } + } + + Iterator iterator = bindingsList.iterator(); + while (iterator.hasNext()) { + Binding binding = (Binding) iterator.next(); + if (binding.getRole().equals(role.getValue()) && binding.getMembers().size() == 0) { + iterator.remove(); + break; + } + } + + return this; + } + + /** + * Sets the policy's etag. + * + *

        Etags are used for optimistic concurrency control as a way to help prevent simultaneous + * updates of a policy from overwriting each other. It is strongly suggested that systems make + * use of the etag in the read-modify-write cycle to perform policy updates in order to avoid + * race conditions. An etag is returned in the response to getIamPolicy, and systems are + * expected to put that etag in the request to setIamPolicy to ensure that their change will be + * applied to the same version of the policy. If no etag is provided in the call to + * setIamPolicy, then the existing policy is overwritten blindly. + */ + public final Builder setEtag(String etag) { + this.etag = etag; + return this; + } + + /** Sets the version of the policy. */ + public final Builder setVersion(int version) { + this.version = version; + return this; + } + + /** Creates a {@code Policy} object. */ + public final Policy build() { + return new Policy(this); + } + } + + private Policy(Builder builder) { + this.bindingsList = ImmutableList.copyOf(builder.bindingsList); + this.etag = builder.etag; + this.version = builder.version; + } + + /** Returns a builder containing the properties of this IAM Policy. */ + public Builder toBuilder() { + return new Builder(this); + } + + /** + * Returns the map of bindings that comprises the policy. + * + * @throws IllegalArgumentException if policy version is equal to 3 or has conditional bindings + */ + public Map> getBindings() { + checkArgument( + !isConditional(this.version, this.bindingsList), + "getBindings() is only supported with version 1 policies and non-conditional policies"); + ImmutableMap.Builder> bindingsV1Builder = ImmutableMap.builder(); + for (Binding binding : bindingsList) { + ImmutableSet.Builder identities = ImmutableSet.builder(); + for (String member : binding.getMembers()) { + identities.add(Identity.valueOf(member)); + } + bindingsV1Builder.put(Role.of(binding.getRole()), identities.build()); + } + return bindingsV1Builder.build(); + } + + /** Returns the list of bindings that comprises the policy for version 3. */ + public ImmutableList getBindingsList() { + return bindingsList; + } + + /** + * Returns the policy's etag. + * + *

        Etags are used for optimistic concurrency control as a way to help prevent simultaneous + * updates of a policy from overwriting each other. It is strongly suggested that systems make use + * of the etag in the read-modify-write cycle to perform policy updates in order to avoid race + * conditions. An etag is returned in the response to getIamPolicy, and systems are expected to + * put that etag in the request to setIamPolicy to ensure that their change will be applied to the + * same version of the policy. If no etag is provided in the call to setIamPolicy, then the + * existing policy is overwritten blindly. + */ + public String getEtag() { + return etag; + } + + /** + * Returns the version of the policy. The default version is 0, meaning only the "owner", + * "editor", and "viewer" roles are permitted. If the version is 1, you may also use other roles. + */ + public int getVersion() { + return version; + } + + @Override + public String toString() { + return MoreObjects.toStringHelper(this) + .add("bindings", bindingsList) + .add("etag", etag) + .add("version", version) + .toString(); + } + + @Override + public int hashCode() { + return Objects.hash(getClass(), bindingsList, etag, version); + } + + @Override + public boolean equals(Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof Policy)) { + return false; + } + Policy other = (Policy) obj; + if (bindingsList == null && other.getBindingsList() == null) { + return true; + } + if ((bindingsList == null && other.getBindingsList() != null) + || bindingsList != null && other.getBindingsList() == null + || bindingsList.size() != other.getBindingsList().size()) { + return false; + } + for (Binding binding : bindingsList) { + if (!other.getBindingsList().contains(binding)) { + return false; + } + } + return Objects.equals(etag, other.getEtag()) && version == other.getVersion(); + } + + /** Returns a builder for {@code Policy} objects. */ + public static Builder newBuilder() { + return new Builder(); + } +} diff --git a/java-core/google-cloud-core/src/main/java/com/google/cloud/ReadChannel.java b/java-core/google-cloud-core/src/main/java/com/google/cloud/ReadChannel.java new file mode 100644 index 0000000000..effc33ee8e --- /dev/null +++ b/java-core/google-cloud-core/src/main/java/com/google/cloud/ReadChannel.java @@ -0,0 +1,108 @@ +/* + * Copyright 2015 Google LLC + * + * Licensed under the Apache License, Version 2.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.google.cloud; + +import java.io.Closeable; +import java.io.IOException; +import java.nio.channels.ReadableByteChannel; + +/** + * A channel for reading data from a Google Cloud object. + * + *

        Implementations of this class may buffer data internally to reduce remote calls. This + * interface implements {@link Restorable} to allow saving the reader's state to continue reading + * afterwards. + */ +public interface ReadChannel extends ReadableByteChannel, Closeable, Restorable { + + /** + * Overridden to remove IOException. + * + * @see java.nio.channels.Channel#close() + */ + @Override + void close(); + + /** Set the offset to read from. */ + void seek(long position) throws IOException; + + /** + * Sets the minimum size that will be read by a single RPC. Read data will be locally buffered + * until consumed. + */ + void setChunkSize(int chunkSize); + + /** + * Captures the read channel state so that it can be saved and restored afterwards. + * + * @return a {@link RestorableState} object that contains the read channel state and can restore + * it afterwards. + */ + @Override + RestorableState capture(); + + /** + * Limit the maximum number of bytes to be read from the objects content, counting from the + * beginning of the object, which will be available to read from this channel. If the limit is + * larger than the actual size of the content this will have no material impact. + * + *

        If used in conjunction with {@link #seek(long)} the total number of returned bytes from this + * channel will be reduced by the number of bytes specified to seek. + * + *

        The value provided as {@code limit} will define a left-closed, + * right-open interval along with either {@code 0} or any value provided to {@link + * #seek(long)}, i.e. {@code [}{@link #seek(long)}{@code , }{@link #limit(long)}{@code )}. + * + *

        An example to help illustrate the relationship

        + * + * Imagine some data {@code [A, B, C, D, E, F, G, H, I, J]}, 10 bytes total. + * + *
          + *
        1. {@code limit(5)} would produce {@code [A, B, C, D, E]} + *
        2. {@code seek(8)} would produce {@code [I, J]} + *
        3. {@code seek(2)} {@code limit(5)} would produce {@code [C, D, E]} + *
        4. {@code seek(3)} {@code limit(3)} would produce {@code []} + *
        + * + *

        NOTE:Implementers are not required to return a new instance from this method, however + * they are allowed to. Users of this method should always use the instance returned from this + * method. + * + *

        Default Implementation:By default, this method will simply return {@code this}. + * + * @param limit the maximum number of bytes to limit this channel to + * @return The instance of channel which will respect the limit. + * @throws UnsupportedOperationException If the {@code this} instances does not support limiting + * @since 2.4.0 + */ + default ReadChannel limit(long limit) { + return this; + } + + /** + * The currently defined limit for this channel. Initial value is {@link Long#MAX_VALUE} + * + * @return the current limit for this channel + * @throws UnsupportedOperationException If the {@code this} instances does not support limiting + * @since 2.4.0 + */ + default long limit() { + return Long.MAX_VALUE; + } +} diff --git a/java-core/google-cloud-core/src/main/java/com/google/cloud/Restorable.java b/java-core/google-cloud-core/src/main/java/com/google/cloud/Restorable.java new file mode 100644 index 0000000000..7feedf0c6e --- /dev/null +++ b/java-core/google-cloud-core/src/main/java/com/google/cloud/Restorable.java @@ -0,0 +1,49 @@ +/* + * Copyright 2015 Google LLC + * + * Licensed under the Apache License, Version 2.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.google.cloud; + +/** + * Implementation of this interface can persist their state and restore from it. + * + *

        A typical capture usage: + * + *

        {@code
        + * X restorableObj; // X instanceof Restorable
        + * RestorableState state = restorableObj.capture();
        + * .. persist state
        + * }
        + * + *

        A typical restore usage: + * + *

        {@code
        + * RestorableState state = ... // read from persistence
        + * X restorableObj = state.restore();
        + * ...
        + * }
        + * + * @param the restorable object's type + */ +public interface Restorable> { + + /** + * Captures the state of this object. + * + * @return a {@link RestorableState} instance that contains the state for this object and can + * restore it afterwards. + */ + RestorableState capture(); +} diff --git a/java-core/google-cloud-core/src/main/java/com/google/cloud/RestorableState.java b/java-core/google-cloud-core/src/main/java/com/google/cloud/RestorableState.java new file mode 100644 index 0000000000..53a6458f1f --- /dev/null +++ b/java-core/google-cloud-core/src/main/java/com/google/cloud/RestorableState.java @@ -0,0 +1,32 @@ +/* + * Copyright 2015 Google LLC + * + * Licensed under the Apache License, Version 2.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.google.cloud; + +/** + * A common interface for restorable states. Implementations of {@code RestorableState} are capable + * of saving the state of an object to restore it for later use. + * + *

        Implementations of this class must implement {@link java.io.Serializable} to ensure that the + * state of a the object can be correctly serialized. + * + * @param the restored object's type + */ +public interface RestorableState> { + + /** Returns an object whose internal state reflects the one saved in the invocation object. */ + T restore(); +} diff --git a/java-core/google-cloud-core/src/main/java/com/google/cloud/RetryHelper.java b/java-core/google-cloud-core/src/main/java/com/google/cloud/RetryHelper.java new file mode 100644 index 0000000000..986fd35587 --- /dev/null +++ b/java-core/google-cloud-core/src/main/java/com/google/cloud/RetryHelper.java @@ -0,0 +1,88 @@ +/* + * Copyright 2015 Google LLC + * + * Licensed under the Apache License, Version 2.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.google.cloud; + +import com.google.api.core.ApiClock; +import com.google.api.core.BetaApi; +import com.google.api.gax.retrying.DirectRetryingExecutor; +import com.google.api.gax.retrying.ExponentialPollAlgorithm; +import com.google.api.gax.retrying.ExponentialRetryAlgorithm; +import com.google.api.gax.retrying.ResultRetryAlgorithm; +import com.google.api.gax.retrying.RetryAlgorithm; +import com.google.api.gax.retrying.RetrySettings; +import com.google.api.gax.retrying.RetryingExecutor; +import com.google.api.gax.retrying.RetryingFuture; +import com.google.api.gax.retrying.TimedRetryAlgorithm; +import java.util.concurrent.Callable; +import java.util.concurrent.ExecutionException; + +/** + * Utility class for retrying operations. For more details about the parameters, see {@link + * RetrySettings}. In case if retrying is unsuccessful, {@link RetryHelperException} will be thrown. + */ +@BetaApi +public class RetryHelper { + public static V runWithRetries( + Callable callable, + RetrySettings retrySettings, + ResultRetryAlgorithm resultRetryAlgorithm, + ApiClock clock) + throws RetryHelperException { + try { + // Suppressing should be ok as a workaraund. Current and only ResultRetryAlgorithm + // implementation does not use response at all, so ignoring its type is ok. + @SuppressWarnings("unchecked") + ResultRetryAlgorithm algorithm = (ResultRetryAlgorithm) resultRetryAlgorithm; + return run(callable, new ExponentialRetryAlgorithm(retrySettings, clock), algorithm); + } catch (Exception e) { + // TODO: remove RetryHelperException, throw InterruptedException or + // ExecutionException#getCause() explicitly + throw new RetryHelperException(e.getCause()); + } + } + + public static V poll( + Callable callable, + RetrySettings pollSettings, + ResultRetryAlgorithm resultPollAlgorithm, + ApiClock clock) + throws ExecutionException, InterruptedException { + return run(callable, new ExponentialPollAlgorithm(pollSettings, clock), resultPollAlgorithm); + } + + private static V run( + Callable callable, + TimedRetryAlgorithm timedAlgorithm, + ResultRetryAlgorithm resultAlgorithm) + throws ExecutionException, InterruptedException { + RetryAlgorithm retryAlgorithm = new RetryAlgorithm<>(resultAlgorithm, timedAlgorithm); + RetryingExecutor executor = new DirectRetryingExecutor<>(retryAlgorithm); + + RetryingFuture retryingFuture = executor.createFuture(callable); + executor.submit(retryingFuture); + return retryingFuture.get(); + } + + public static class RetryHelperException extends RuntimeException { + + private static final long serialVersionUID = -8519852520090965314L; + + RetryHelperException(Throwable cause) { + super(cause); + } + } +} diff --git a/java-core/google-cloud-core/src/main/java/com/google/cloud/RetryOption.java b/java-core/google-cloud-core/src/main/java/com/google/cloud/RetryOption.java new file mode 100644 index 0000000000..f69b0d1c76 --- /dev/null +++ b/java-core/google-cloud-core/src/main/java/com/google/cloud/RetryOption.java @@ -0,0 +1,169 @@ +/* + * Copyright 2016 Google LLC + * + * Licensed under the Apache License, Version 2.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.google.cloud; + +import static com.google.api.gax.util.TimeConversionUtils.toJavaTimeDuration; +import static com.google.common.base.Preconditions.checkNotNull; + +import com.google.api.core.BetaApi; +import com.google.api.core.ObsoleteApi; +import com.google.api.gax.retrying.RetrySettings; +import java.io.Serializable; + +/** + * This class represents an options wrapper around the {@link RetrySettings} class and is an + * alternative way of initializing it. The retry options are usually provided in a form of varargs + * for methods that wait for changes in the status of a resource, do poll operations or retry on + * failures. + */ +@BetaApi +public class RetryOption implements Serializable { + + private static final long serialVersionUID = 3622837212525370224L; + + private enum OptionType { + TOTAL_TIMEOUT, + INITIAL_RETRY_DELAY, + RETRY_DELAY_MULTIPLIER, + MAX_RETRY_DELAY, + MAX_ATTEMPTS, + JITTERED + } + + private final OptionType type; + private final Object value; + + private RetryOption(OptionType type, Object value) { + this.type = checkNotNull(type); + this.value = checkNotNull(value); + } + + /** This method is obsolete. Use {@link #totalTimeoutDuration(java.time.Duration)} instead */ + @ObsoleteApi("Use totalTimeouDuration() instead") + public static RetryOption totalTimeout(org.threeten.bp.Duration totalTimeout) { + return totalTimeoutDuration(toJavaTimeDuration(totalTimeout)); + } + + /** See {@link RetrySettings#getTotalTimeoutDuration()}. */ + public static RetryOption totalTimeoutDuration(java.time.Duration totalTimeout) { + return new RetryOption(OptionType.TOTAL_TIMEOUT, totalTimeout); + } + + /** This method is obsolete. Use {@link #initialRetryDelayDuration(java.time.Duration)} instead */ + @ObsoleteApi("Use initialRetryDelayDuration() instead") + public static RetryOption initialRetryDelay(org.threeten.bp.Duration initialRetryDelay) { + return initialRetryDelayDuration(toJavaTimeDuration(initialRetryDelay)); + } + + /** See {@link RetrySettings#getInitialRetryDelayDuration()}. */ + public static RetryOption initialRetryDelayDuration(java.time.Duration initialRetryDelay) { + return new RetryOption(OptionType.INITIAL_RETRY_DELAY, initialRetryDelay); + } + + /** See {@link RetrySettings#getRetryDelayMultiplier()}. */ + public static RetryOption retryDelayMultiplier(double retryDelayMultiplier) { + return new RetryOption(OptionType.RETRY_DELAY_MULTIPLIER, retryDelayMultiplier); + } + + /** This method is obsolete. Use {@link #maxRetryDelayDuration(java.time.Duration)} instead */ + @ObsoleteApi("Use maxRetryDelayDuration() instead") + public static RetryOption maxRetryDelay(org.threeten.bp.Duration maxRetryDelay) { + return maxRetryDelayDuration(toJavaTimeDuration(maxRetryDelay)); + } + + /** See {@link RetrySettings#getMaxRetryDelayDuration()}. */ + public static RetryOption maxRetryDelayDuration(java.time.Duration maxRetryDelay) { + return new RetryOption(OptionType.MAX_RETRY_DELAY, maxRetryDelay); + } + + /** See {@link RetrySettings#getMaxAttempts()}. */ + public static RetryOption maxAttempts(int maxAttempts) { + return new RetryOption(OptionType.MAX_ATTEMPTS, maxAttempts); + } + + /** See {@link RetrySettings#isJittered()} ()}. */ + public static RetryOption jittered(boolean jittered) { + return new RetryOption(OptionType.JITTERED, jittered); + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + + RetryOption that = (RetryOption) o; + + if (type != that.type) { + return false; + } + return value.equals(that.value); + } + + @Override + public int hashCode() { + int result = type.hashCode(); + result = 31 * result + value.hashCode(); + return result; + } + + /** + * Creates a new {@code RetrySettings} instance, merging provided settings and multiple {@code + * RetryOptions}, each of which represents a single property in {@code RetrySettings}. It is an + * alternative way of initializing {@link RetrySettings} instances. + * + * @param settings retry settings + * @param options zero or more Retry + * @return new {@code RetrySettings} instance, which is a result of merging {@code options} into + * {@code settings}, i.e. each element in {@code options}, if present, overrides corresponding + * property in {@code settings} + */ + public static RetrySettings mergeToSettings(RetrySettings settings, RetryOption... options) { + if (options.length <= 0) { + return settings; + } + RetrySettings.Builder builder = settings.toBuilder(); + for (RetryOption option : options) { + switch (option.type) { + case TOTAL_TIMEOUT: + builder.setTotalTimeoutDuration((java.time.Duration) option.value); + break; + case INITIAL_RETRY_DELAY: + builder.setInitialRetryDelayDuration((java.time.Duration) option.value); + break; + case RETRY_DELAY_MULTIPLIER: + builder.setRetryDelayMultiplier((Double) option.value); + break; + case MAX_RETRY_DELAY: + builder.setMaxRetryDelayDuration((java.time.Duration) option.value); + break; + case MAX_ATTEMPTS: + builder.setMaxAttempts((Integer) option.value); + break; + case JITTERED: + builder.setJittered((Boolean) option.value); + break; + default: + throw new IllegalArgumentException("Unknown option type: " + option.type); + } + } + return builder.build(); + } +} diff --git a/java-core/google-cloud-core/src/main/java/com/google/cloud/Role.java b/java-core/google-cloud-core/src/main/java/com/google/cloud/Role.java new file mode 100644 index 0000000000..e75dd5f8f2 --- /dev/null +++ b/java-core/google-cloud-core/src/main/java/com/google/cloud/Role.java @@ -0,0 +1,116 @@ +/* + * Copyright 2016 Google LLC + * + * Licensed under the Apache License, Version 2.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.google.cloud; + +import static com.google.common.base.Preconditions.checkNotNull; + +import java.io.Serializable; +import java.util.Objects; + +/** + * A role in a IAM {@link Policy}. Project owners can grant access to team members to access + * project's resources and APIs by granting IAM roles to team members. + * + * @see Viewing the Grantable + * Roles on Resources + * @see Understanding Roles + */ +public final class Role implements Serializable { + + private static final long serialVersionUID = -7779252712160972508L; + private static final String ROLE_PREFIX = "roles/"; + + private final String value; + + private Role(String value) { + this.value = value; + } + + /** + * Returns the string identifier for this role. For example, {@code "roles/viewer"}, {@code + * "roles/editor"}, or {@code "roles/owner"}. + */ + public String getValue() { + return value; + } + + /** + * Returns the viewer role. Encapsulates the permission for read-only actions that preserve state + * of a resource. + * + * @see Understanding Roles + */ + public static Role viewer() { + return of("viewer"); + } + + /** + * Returns the editor role. Encapsulates all viewer's permissions and permissions for actions that + * modify the state of a resource. + * + * @see Understanding Roles + */ + public static Role editor() { + return of("editor"); + } + + /** + * Returns the owner role. Encapsulates all editor's permissions and permissions to manage access + * control for a resource or manage the billing options for a project. + * + * @see Understanding Roles + */ + public static Role owner() { + return of("owner"); + } + + /** + * Returns a new role given its string value. + * + *

        If the value contains no slash character ({@code '/'}), the prefix {@code "roles/""} is + * prepended. This slightly simplifies usage for predefined roles. For custom roles, call this + * method with the fully-qualified name, eg {@code "projects/XXX/roles/YYY"}. + * + * @param value the string value for the role + * @see Viewing the Grantable + * Roles on Resources + */ + public static Role of(String value) { + checkNotNull(value); + if (!value.contains("/")) { + value = ROLE_PREFIX + value; + } + return new Role(value); + } + + @Override + public int hashCode() { + return Objects.hash(value); + } + + @Override + public String toString() { + return value; + } + + @Override + public boolean equals(Object obj) { + return obj instanceof Role && Objects.equals(value, ((Role) obj).getValue()); + } +} diff --git a/java-core/google-cloud-core/src/main/java/com/google/cloud/Service.java b/java-core/google-cloud-core/src/main/java/com/google/cloud/Service.java new file mode 100644 index 0000000000..bfacabdf7f --- /dev/null +++ b/java-core/google-cloud-core/src/main/java/com/google/cloud/Service.java @@ -0,0 +1,27 @@ +/* + * Copyright 2015 Google LLC + * + * Licensed under the Apache License, Version 2.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.google.cloud; + +/** + * Interface for service objects. + * + * @param the {@code ServiceOptions} subclass corresponding to the service + */ +public interface Service> { + + OptionsT getOptions(); +} diff --git a/java-core/google-cloud-core/src/main/java/com/google/cloud/ServiceDefaults.java b/java-core/google-cloud-core/src/main/java/com/google/cloud/ServiceDefaults.java new file mode 100644 index 0000000000..7151740d99 --- /dev/null +++ b/java-core/google-cloud-core/src/main/java/com/google/cloud/ServiceDefaults.java @@ -0,0 +1,30 @@ +/* + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.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.google.cloud; + +import com.google.cloud.spi.ServiceRpcFactory; +import java.io.Serializable; + +public interface ServiceDefaults< + ServiceT extends Service, OptionsT extends ServiceOptions> + extends Serializable { + ServiceFactory getDefaultServiceFactory(); + + ServiceRpcFactory getDefaultRpcFactory(); + + TransportOptions getDefaultTransportOptions(); +} diff --git a/java-core/google-cloud-core/src/main/java/com/google/cloud/ServiceFactory.java b/java-core/google-cloud-core/src/main/java/com/google/cloud/ServiceFactory.java new file mode 100644 index 0000000000..3b8fefe52d --- /dev/null +++ b/java-core/google-cloud-core/src/main/java/com/google/cloud/ServiceFactory.java @@ -0,0 +1,32 @@ +/* + * Copyright 2015 Google LLC + * + * Licensed under the Apache License, Version 2.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.google.cloud; + +/** + * A base interface for all service factories. + * + *

        Implementation must provide a public no-arg constructor. Loading of a factory implementation + * is done via {@link java.util.ServiceLoader}. + * + * @param the service subclass + * @param the {@code ServiceOptions} subclass corresponding to the service + */ +@SuppressWarnings("rawtypes") +public interface ServiceFactory { + + ServiceT create(ServiceOptionsT serviceOptions); +} diff --git a/java-core/google-cloud-core/src/main/java/com/google/cloud/ServiceOptions.java b/java-core/google-cloud-core/src/main/java/com/google/cloud/ServiceOptions.java new file mode 100644 index 0000000000..92aaa9d6a9 --- /dev/null +++ b/java-core/google-cloud-core/src/main/java/com/google/cloud/ServiceOptions.java @@ -0,0 +1,890 @@ +/* + * Copyright 2015 Google LLC + * + * Licensed under the Apache License, Version 2.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.google.cloud; + +import static com.google.common.base.MoreObjects.firstNonNull; +import static com.google.common.base.Preconditions.checkArgument; +import static com.google.common.base.Preconditions.checkNotNull; + +import com.google.api.client.http.GenericUrl; +import com.google.api.client.http.HttpHeaders; +import com.google.api.client.http.HttpRequest; +import com.google.api.client.http.HttpRequestFactory; +import com.google.api.client.http.HttpResponse; +import com.google.api.client.http.HttpTransport; +import com.google.api.client.http.javanet.NetHttpTransport; +import com.google.api.client.json.GenericJson; +import com.google.api.client.json.JsonFactory; +import com.google.api.client.json.JsonObjectParser; +import com.google.api.client.json.gson.GsonFactory; +import com.google.api.core.ApiClock; +import com.google.api.core.BetaApi; +import com.google.api.core.CurrentMillisClock; +import com.google.api.core.InternalApi; +import com.google.api.gax.core.GaxProperties; +import com.google.api.gax.retrying.RetrySettings; +import com.google.api.gax.rpc.FixedHeaderProvider; +import com.google.api.gax.rpc.HeaderProvider; +import com.google.api.gax.rpc.NoHeaderProvider; +import com.google.api.gax.tracing.ApiTracer; +import com.google.api.gax.tracing.ApiTracerFactory; +import com.google.auth.Credentials; +import com.google.auth.oauth2.GoogleCredentials; +import com.google.auth.oauth2.QuotaProjectIdProvider; +import com.google.auth.oauth2.ServiceAccountCredentials; +import com.google.cloud.spi.ServiceRpcFactory; +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.ImmutableSet; +import com.google.common.collect.Iterables; +import com.google.common.io.Files; +import java.io.BufferedReader; +import java.io.File; +import java.io.FileInputStream; +import java.io.FileNotFoundException; +import java.io.FileReader; +import java.io.IOException; +import java.io.InputStream; +import java.io.ObjectInputStream; +import java.io.Serializable; +import java.nio.charset.Charset; +import java.nio.charset.StandardCharsets; +import java.time.Duration; +import java.util.Locale; +import java.util.Map; +import java.util.Objects; +import java.util.ServiceLoader; +import java.util.Set; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +/** + * Abstract class representing service options. + * + * @param the service subclass + * @param the {@code ServiceOptions} subclass corresponding to the service + */ +public abstract class ServiceOptions< + ServiceT extends Service, OptionsT extends ServiceOptions> + implements Serializable { + + public static final String CREDENTIAL_ENV_NAME = "GOOGLE_APPLICATION_CREDENTIALS"; + private static final String DEFAULT_HOST = "https://www.googleapis.com"; + private static final String LEGACY_PROJECT_ENV_NAME = "GCLOUD_PROJECT"; + private static final String PROJECT_ENV_NAME = "GOOGLE_CLOUD_PROJECT"; + + private static final RetrySettings DEFAULT_RETRY_SETTINGS = + getDefaultRetrySettingsBuilder().build(); + private static final RetrySettings NO_RETRY_SETTINGS = + getDefaultRetrySettingsBuilder().setMaxAttempts(1).build(); + + private static final long serialVersionUID = 9198896031667942014L; + protected final String clientLibToken; + + private final String projectId; + private final String universeDomain; + private final String host; + private final RetrySettings retrySettings; + private final String serviceRpcFactoryClassName; + private final String serviceFactoryClassName; + private final ApiClock clock; + protected Credentials credentials; + private final TransportOptions transportOptions; + private final HeaderProvider headerProvider; + private final String quotaProjectId; + + private transient ServiceRpcFactory serviceRpcFactory; + private transient ServiceFactory serviceFactory; + private transient ServiceT service; + private transient ServiceRpc rpc; + + private final ApiTracerFactory apiTracerFactory; + + /** + * Builder for {@code ServiceOptions}. + * + * @param the service subclass + * @param the {@code ServiceOptions} subclass corresponding to the service + * @param the {@code ServiceOptions} builder + */ + public abstract static class Builder< + ServiceT extends Service, + OptionsT extends ServiceOptions, + B extends Builder> { + + private final ImmutableSet allowedClientLibTokens = + ImmutableSet.of(ServiceOptions.getGoogApiClientLibName()); + private String projectId; + private String universeDomain; + private String host; + protected Credentials credentials; + private RetrySettings retrySettings; + private ServiceFactory serviceFactory; + private ServiceRpcFactory serviceRpcFactory; + private ApiClock clock; + private TransportOptions transportOptions; + private HeaderProvider headerProvider; + private String clientLibToken = ServiceOptions.getGoogApiClientLibName(); + private String quotaProjectId; + + private ApiTracerFactory apiTracerFactory; + + @InternalApi("This class should only be extended within google-cloud-java") + protected Builder() {} + + @InternalApi("This class should only be extended within google-cloud-java") + protected Builder(ServiceOptions options) { + projectId = options.projectId; + universeDomain = options.universeDomain; + host = options.host; + credentials = options.credentials; + retrySettings = options.retrySettings; + serviceFactory = options.serviceFactory; + serviceRpcFactory = options.serviceRpcFactory; + clock = options.clock; + transportOptions = options.transportOptions; + clientLibToken = options.clientLibToken; + quotaProjectId = options.quotaProjectId; + apiTracerFactory = options.apiTracerFactory; + } + + protected abstract ServiceOptions build(); + + @SuppressWarnings("unchecked") + protected B self() { + return (B) this; + } + + /** Sets the service factory. */ + public B setServiceFactory(ServiceFactory serviceFactory) { + this.serviceFactory = serviceFactory; + return self(); + } + + /** + * Sets the service's clock. The clock is mainly used for testing purpose. {@link ApiClock} will + * be replaced by Java8's {@code java.time.Clock}. + * + * @param clock the clock to set + * @return the builder + */ + public B setClock(ApiClock clock) { + this.clock = clock; + return self(); + } + + /** + * Sets the project ID. If no project ID is set, {@link #getDefaultProjectId()} will be used to + * attempt getting the project ID from the environment. + * + * @return the builder + */ + public B setProjectId(String projectId) { + this.projectId = projectId; + return self(); + } + + /** + * Sets service host. + * + * @return the builder + */ + public B setHost(String host) { + this.host = host; + return self(); + } + + /** + * Universe Domain is the domain for Google Cloud Services. A Google Cloud endpoint follows the + * format of `{ServiceName}.{UniverseDomain}`. For example, speech.googleapis.com would have a + * Universe Domain value of `googleapis.com` and cloudasset.test.com would have a Universe + * Domain of `test.com`. + * + *

        If this value is not set, the resolved UniverseDomain will default to `googleapis.com`. + * + * @throws NullPointerException if {@code universeDomain} is {@code null}. The resolved + * universeDomain will be `googleapis.com` if this value is not set. + */ + public B setUniverseDomain(String universeDomain) { + this.universeDomain = checkNotNull(universeDomain); + return self(); + } + + /** + * Sets the service authentication credentials. If no credentials are set, {@link + * GoogleCredentials#getApplicationDefault()} will be used to attempt getting credentials from + * the environment. Use {@link NoCredentials#getInstance()} to skip authentication, this is + * typically useful when using local service emulators. + * + * @param credentials authentication credentials, should not be {@code null} + * @return the builder + * @throws NullPointerException if {@code credentials} is {@code null}. To disable + * authentication use {@link NoCredentials#getInstance()} + */ + public B setCredentials(Credentials credentials) { + this.credentials = checkNotNull(credentials); + // set project id if available + if (this.projectId == null && credentials instanceof ServiceAccountCredentials) { + this.projectId = ((ServiceAccountCredentials) credentials).getProjectId(); + } + + if (this.quotaProjectId == null && credentials instanceof QuotaProjectIdProvider) { + this.quotaProjectId = ((QuotaProjectIdProvider) credentials).getQuotaProjectId(); + } + return self(); + } + + /** + * Sets configuration parameters for request retries. + * + * @return the builder + */ + public B setRetrySettings(RetrySettings retrySettings) { + this.retrySettings = retrySettings; + return self(); + } + + /** + * Sets the factory for rpc services. + * + * @return the builder + */ + public B setServiceRpcFactory(ServiceRpcFactory serviceRpcFactory) { + this.serviceRpcFactory = serviceRpcFactory; + return self(); + } + + /** + * Sets the transport options. + * + * @return the builder + */ + public B setTransportOptions(TransportOptions transportOptions) { + this.transportOptions = transportOptions; + return self(); + } + + /** + * Sets the static header provider. The header provider will be called during client + * construction only once. The headers returned by the provider will be cached and supplied as + * is for each request issued by the constructed client. Some reserved headers can be overridden + * (e.g. Content-Type) or merged with the default value (e.g. User-Agent) by the underlying + * transport layer. + * + * @param headerProvider the header provider + * @return the builder + */ + @BetaApi + public B setHeaderProvider(HeaderProvider headerProvider) { + this.headerProvider = headerProvider; + return self(); + } + + @InternalApi + public B setClientLibToken(String clientLibToken) { + Preconditions.checkArgument( + getAllowedClientLibTokens().contains(clientLibToken), "Illegal client lib token"); + this.clientLibToken = clientLibToken; + return self(); + } + + /** + * Sets the quotaProjectId that specifies the project used for quota and billing purposes. + * + * @see See system parameter + * $userProject + */ + public B setQuotaProjectId(String quotaProjectId) { + this.quotaProjectId = quotaProjectId; + return self(); + } + + /** + * Sets the {@link ApiTracerFactory}. It will be used to create an {@link ApiTracer} that is + * annotated throughout the lifecycle of an RPC operation. + */ + @BetaApi + @InternalApi + public B setApiTracerFactory(ApiTracerFactory apiTracerFactory) { + this.apiTracerFactory = apiTracerFactory; + return self(); + } + + protected Set getAllowedClientLibTokens() { + return allowedClientLibTokens; + } + } + + @InternalApi("This class should only be extended within google-cloud-java") + protected ServiceOptions( + Class> serviceFactoryClass, + Class> rpcFactoryClass, + Builder builder, + ServiceDefaults serviceDefaults) { + projectId = builder.projectId != null ? builder.projectId : getDefaultProject(); + if (projectIdRequired()) { + checkArgument( + projectId != null, + "A project ID is required for this service but could not be determined from the builder " + + "or the environment. Please set a project ID using the builder."); + } + universeDomain = builder.universeDomain; + host = firstNonNull(builder.host, getDefaultHost()); + credentials = builder.credentials != null ? builder.credentials : defaultCredentials(); + retrySettings = firstNonNull(builder.retrySettings, getDefaultRetrySettings()); + serviceFactory = + firstNonNull( + builder.serviceFactory, + getFromServiceLoader(serviceFactoryClass, serviceDefaults.getDefaultServiceFactory())); + serviceFactoryClassName = serviceFactory.getClass().getName(); + serviceRpcFactory = + firstNonNull( + builder.serviceRpcFactory, + getFromServiceLoader(rpcFactoryClass, serviceDefaults.getDefaultRpcFactory())); + serviceRpcFactoryClassName = serviceRpcFactory.getClass().getName(); + clock = firstNonNull(builder.clock, CurrentMillisClock.getDefaultClock()); + transportOptions = + firstNonNull(builder.transportOptions, serviceDefaults.getDefaultTransportOptions()); + headerProvider = firstNonNull(builder.headerProvider, new NoHeaderProvider()); + clientLibToken = builder.clientLibToken; + quotaProjectId = + builder.quotaProjectId != null + ? builder.quotaProjectId + : getValueFromCredentialsFile(getCredentialsPath(), "quota_project_id"); + apiTracerFactory = builder.apiTracerFactory; + } + + private static String getCredentialsPath() { + return System.getProperty(CREDENTIAL_ENV_NAME, System.getenv(CREDENTIAL_ENV_NAME)); + } + + /** + * Returns whether a service requires a project ID. This method may be overridden in + * service-specific Options objects. + * + * @return true if a project ID is required to use the service, false if not + */ + protected boolean projectIdRequired() { + return true; + } + + private static GoogleCredentials defaultCredentials() { + try { + return GoogleCredentials.getApplicationDefault(); + } catch (Exception ex) { + return null; + } + } + + protected String getDefaultHost() { + return DEFAULT_HOST; + } + + protected String getDefaultProject() { + return getDefaultProjectId(); + } + + /** + * Returns the default project ID, or {@code null} if no default project ID could be found. This + * method returns the first available project ID among the following sources: + * + *

          + *
        1. The project ID specified by the GOOGLE_CLOUD_PROJECT environment variable + *
        2. The App Engine project ID + *
        3. The project ID specified in the JSON credentials file pointed by the {@code + * GOOGLE_APPLICATION_CREDENTIALS} environment variable + *
        4. The Google Cloud SDK project ID + *
        5. The Compute Engine project ID + *
        + */ + public static String getDefaultProjectId() { + String projectId = System.getProperty(PROJECT_ENV_NAME, System.getenv(PROJECT_ENV_NAME)); + if (projectId == null) { + projectId = + System.getProperty(LEGACY_PROJECT_ENV_NAME, System.getenv(LEGACY_PROJECT_ENV_NAME)); + } + if (projectId == null) { + projectId = getAppEngineProjectId(); + } + if (projectId == null) { + projectId = getServiceAccountProjectId(); + } + return projectId != null ? projectId : getGoogleCloudProjectId(); + } + + public static String getAppEngineAppId() { + return System.getProperty("com.google.appengine.application.id"); + } + + private static String getActiveGoogleCloudConfig(File configDir) { + String activeGoogleCloudConfig = null; + try { + activeGoogleCloudConfig = + Files.asCharSource(new File(configDir, "active_config"), Charset.defaultCharset()) + .readFirstLine(); + } catch (IOException ex) { + // ignore + } + // if reading active_config failed or the file is empty we try default + return firstNonNull(activeGoogleCloudConfig, "default"); + } + + protected static String getGoogleCloudProjectId() { + File configDir; + if (System.getenv().containsKey("CLOUDSDK_CONFIG")) { + configDir = new File(System.getenv("CLOUDSDK_CONFIG")); + } else if (isWindows() && System.getenv().containsKey("APPDATA")) { + configDir = new File(System.getenv("APPDATA"), "gcloud"); + } else { + configDir = new File(System.getProperty("user.home"), ".config/gcloud"); + } + String activeConfig = getActiveGoogleCloudConfig(configDir); + FileReader fileReader = null; + try { + fileReader = new FileReader(new File(configDir, "configurations/config_" + activeConfig)); + } catch (FileNotFoundException newConfigFileNotFoundEx) { + try { + fileReader = new FileReader(new File(configDir, "properties")); + } catch (FileNotFoundException oldConfigFileNotFoundEx) { + // ignore + } + } + if (fileReader != null) { + try (BufferedReader reader = new BufferedReader(fileReader)) { + String line; + String section = null; + Pattern projectPattern = Pattern.compile("^project\\s*=\\s*(.*)$"); + Pattern sectionPattern = Pattern.compile("^\\[(.*)\\]$"); + while ((line = reader.readLine()) != null) { + if (line.isEmpty() || line.startsWith(";")) { + continue; + } + line = line.trim(); + Matcher matcher = sectionPattern.matcher(line); + if (matcher.matches()) { + section = matcher.group(1); + } else if (section == null || section.equals("core")) { + matcher = projectPattern.matcher(line); + if (matcher.matches()) { + return matcher.group(1); + } + } + } + } catch (IOException ex) { + // ignore + } + } + // return project id from metadata config + return MetadataConfig.getProjectId(); + } + + private static boolean isWindows() { + return System.getProperty("os.name").toLowerCase(Locale.ENGLISH).contains("windows"); + } + + protected static String getAppEngineProjectId() { + String projectId = null; + if (PlatformInformation.isOnGAEStandard7()) { + projectId = getAppEngineProjectIdFromAppId(); + } else { + // for GAE flex and standard Java 8 environment + projectId = System.getenv("GOOGLE_CLOUD_PROJECT"); + if (projectId == null) { + projectId = System.getenv("GCLOUD_PROJECT"); + } + if (projectId == null) { + projectId = getAppEngineProjectIdFromAppId(); + } + if (projectId == null) { + try { + projectId = getAppEngineProjectIdFromMetadataServer(); + } catch (IOException ignore) { + projectId = null; + } + } + } + return projectId; + } + + protected static String getAppEngineProjectIdFromAppId() { + String projectId = getAppEngineAppId(); + if (projectId != null && projectId.contains(":")) { + int colonIndex = projectId.indexOf(":"); + projectId = projectId.substring(colonIndex + 1); + } + return projectId; + } + + private static String getAppEngineProjectIdFromMetadataServer() throws IOException { + String metadata = "http://metadata.google.internal"; + String projectIdURL = "/computeMetadata/v1/project/project-id"; + GenericUrl url = new GenericUrl(metadata + projectIdURL); + + HttpTransport netHttpTransport = new NetHttpTransport(); + HttpRequestFactory requestFactory = netHttpTransport.createRequestFactory(); + HttpRequest request = + requestFactory + .buildGetRequest(url) + .setConnectTimeout(500) + .setReadTimeout(500) + .setHeaders(new HttpHeaders().set("Metadata-Flavor", "Google")); + HttpResponse response = request.execute(); + return headerContainsMetadataFlavor(response) ? response.parseAsString() : null; + } + + @InternalApi("Visible for testing") + static boolean headerContainsMetadataFlavor(HttpResponse response) { + String metadataFlavorValue = response.getHeaders().getFirstHeaderStringValue("Metadata-Flavor"); + return "Google".equals(metadataFlavorValue); + } + + protected static String getServiceAccountProjectId() { + return getValueFromCredentialsFile(getCredentialsPath(), "project_id"); + } + + @InternalApi("Visible for testing") + static String getValueFromCredentialsFile(String credentialsPath, String key) { + if (credentialsPath != null) { + try (InputStream credentialsStream = new FileInputStream(credentialsPath)) { + JsonFactory jsonFactory = GsonFactory.getDefaultInstance(); + JsonObjectParser parser = new JsonObjectParser(jsonFactory); + GenericJson fileContents = + parser.parseAndClose(credentialsStream, StandardCharsets.UTF_8, GenericJson.class); + return (String) fileContents.get(key); + } catch (IOException | IllegalArgumentException ex) { + return null; + } + } + return null; + } + + /** + * Returns a Service object for the current service. For instance, when using Google Cloud + * Storage, it returns a Storage object. + */ + @SuppressWarnings("unchecked") + public ServiceT getService() { + if (shouldRefreshService(service)) { + service = serviceFactory.create((OptionsT) this); + } + return service; + } + + /** + * @param cachedService The currently cached service object + * @return true if the currently cached service object should be refreshed. + */ + protected boolean shouldRefreshService(ServiceT cachedService) { + return cachedService == null; + } + + /** + * Returns a Service RPC object for the current service. For instance, when using Google Cloud + * Storage, it returns a StorageRpc object. + */ + @SuppressWarnings("unchecked") + public ServiceRpc getRpc() { + if (shouldRefreshRpc(rpc)) { + rpc = serviceRpcFactory.create((OptionsT) this); + } + return rpc; + } + + /** + * @param cachedRpc The currently cached service object + * @return true if the currently cached service object should be refreshed. + */ + protected boolean shouldRefreshRpc(ServiceRpc cachedRpc) { + return cachedRpc == null; + } + + /** + * Returns the project ID. Return value can be null (for services that don't require a project + * ID). + */ + public String getProjectId() { + return projectId; + } + + /** + * Universe Domain is the domain for Google Cloud Services. A Google Cloud endpoint follows the + * format of `{ServiceName}.{UniverseDomain}`. For example, speech.googleapis.com would have a + * Universe Domain value of `googleapis.com` and cloudasset.test.com would have a Universe Domain + * of `test.com`. + * + * @return The universe domain value set in the Builder's setter. This is not the resolved + * Universe Domain + */ + public String getUniverseDomain() { + return universeDomain; + } + + /** Returns the service host. */ + public String getHost() { + return host; + } + + /** Returns the authentication credentials. */ + public Credentials getCredentials() { + return credentials; + } + + /** Returns the authentication credentials. If required, credentials are scoped. */ + public Credentials getScopedCredentials() { + Credentials credentialsToReturn = credentials; + if (credentials instanceof GoogleCredentials + && ((GoogleCredentials) credentials).createScopedRequired()) { + credentialsToReturn = ((GoogleCredentials) credentials).createScoped(getScopes()); + } + return credentialsToReturn; + } + + /** Returns configuration parameters for request retries. */ + public RetrySettings getRetrySettings() { + return retrySettings; + } + + /** + * Returns the service's clock. Default time source uses {@link System#currentTimeMillis()} to get + * current time. + */ + public ApiClock getClock() { + return clock; + } + + /** Returns the transport-specific options for this service. */ + public TransportOptions getTransportOptions() { + return transportOptions; + } + + /** + * Returns the application's name as a string in the format {@code gcloud-java/[version]}, + * optionally prepended with externally supplied User-Agent header value (via setting custom + * header provider). + */ + public String getApplicationName() { + String libraryVersion = getLibraryVersion(); + + // We have to do the following since underlying layers often do not appreciate User-Agent + // provided as a normal header and override it or treat setting "application name" as the only + // way to append something to User-Agent header. + StringBuilder sb = new StringBuilder(); + String customUserAgentValue = getUserAgent(); + if (customUserAgentValue != null) { + sb.append(customUserAgentValue).append(' '); + } + if (libraryVersion == null) { + sb.append(getLibraryName()); + } else { + sb.append(getLibraryName()).append('/').append(libraryVersion); + } + + return sb.toString(); + } + + /** Returns the library's name, {@code gcloud-java}, as a string. */ + public static String getLibraryName() { + return "gcloud-java"; + } + + /** Returns the library's name used by x-goog-api-client header as a string. */ + public static String getGoogApiClientLibName() { + return "gccl"; + } + + /** Returns the library's version as a string. */ + public String getLibraryVersion() { + return GaxProperties.getLibraryVersion(this.getClass()); + } + + public ApiTracerFactory getApiTracerFactory() { + return apiTracerFactory; + } + + @InternalApi + public final HeaderProvider getMergedHeaderProvider(HeaderProvider internalHeaderProvider) { + Map mergedHeaders = + ImmutableMap.builder() + .putAll(internalHeaderProvider.getHeaders()) + .putAll(headerProvider.getHeaders()) + .build(); + return FixedHeaderProvider.create(mergedHeaders); + } + + @InternalApi + public final String getUserAgent() { + if (headerProvider != null) { + for (Map.Entry entry : headerProvider.getHeaders().entrySet()) { + if ("user-agent".equals(entry.getKey().toLowerCase())) { + return entry.getValue(); + } + } + } + return null; + } + + protected int baseHashCode() { + return Objects.hash( + projectId, + host, + credentials, + retrySettings, + serviceFactoryClassName, + serviceRpcFactoryClassName, + clock, + quotaProjectId); + } + + protected boolean baseEquals(ServiceOptions other) { + return Objects.equals(projectId, other.projectId) + && Objects.equals(host, other.host) + && Objects.equals(credentials, other.credentials) + && Objects.equals(retrySettings, other.retrySettings) + && Objects.equals(serviceFactoryClassName, other.serviceFactoryClassName) + && Objects.equals(serviceRpcFactoryClassName, other.serviceRpcFactoryClassName) + && Objects.equals(clock, other.clock) + && Objects.equals(quotaProjectId, other.quotaProjectId); + } + + private void readObject(ObjectInputStream input) throws IOException, ClassNotFoundException { + input.defaultReadObject(); + serviceFactory = newInstance(serviceFactoryClassName); + serviceRpcFactory = newInstance(serviceRpcFactoryClassName); + } + + @SuppressWarnings("unchecked") + @InternalApi + public static T newInstance(String className) throws IOException, ClassNotFoundException { + try { + return (T) Class.forName(className).newInstance(); + } catch (InstantiationException | IllegalAccessException e) { + throw new IOException(e); + } + } + + public static RetrySettings getDefaultRetrySettings() { + return DEFAULT_RETRY_SETTINGS; + } + + public static RetrySettings getNoRetrySettings() { + return NO_RETRY_SETTINGS; + } + + private static RetrySettings.Builder getDefaultRetrySettingsBuilder() { + return RetrySettings.newBuilder() + .setMaxAttempts(6) + .setInitialRetryDelayDuration(Duration.ofMillis(1000L)) + .setMaxRetryDelayDuration(Duration.ofMillis(32_000L)) + .setRetryDelayMultiplier(2.0) + .setTotalTimeoutDuration(Duration.ofMillis(50_000L)) + .setInitialRpcTimeoutDuration(Duration.ofMillis(50_000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeoutDuration(Duration.ofMillis(50_000L)); + } + + protected abstract Set getScopes(); + + public abstract > B toBuilder(); + + /** + * Some services may have different backoff requirements listed in their SLAs. Be sure to override + * this method in options subclasses when the service's backoff requirement differs from the + * default parameters listed in {@link RetrySettings}. + */ + protected RetrySettings defaultRetrySettings() { + return getDefaultRetrySettings(); + } + + @InternalApi + public static T getFromServiceLoader(Class clazz, T defaultInstance) { + return Iterables.getFirst(ServiceLoader.load(clazz), defaultInstance); + } + + public String getClientLibToken() { + return clientLibToken; + } + + /** Returns the quotaProjectId that specifies the project used for quota and billing purposes. */ + public String getQuotaProjectId() { + return quotaProjectId; + } + + /** + * Returns the resolved host for the Service to connect to Google Cloud + * + *

        The resolved host will be in `https://{serviceName}.{resolvedUniverseDomain}` format. The + * resolvedUniverseDomain will be set to `googleapis.com` if universeDomain is null. The format is + * similar to the DEFAULT_HOST value in java-core. + * + * @see DEFAULT_HOST + */ + @InternalApi + public String getResolvedHost(String serviceName) { + if (universeDomain != null && universeDomain.isEmpty()) { + throw new IllegalArgumentException("The universe domain cannot be empty"); + } + String resolvedUniverseDomain = + universeDomain != null ? universeDomain : Credentials.GOOGLE_DEFAULT_UNIVERSE; + // The host value set to DEFAULT_HOST if the user didn't configure a host. If the + // user set a host the library uses that value, otherwise, construct the host for the user. + // The DEFAULT_HOST value is not a valid host for handwritten libraries and should be + // overriden to include the serviceName. + if (!DEFAULT_HOST.equals(host)) { + return host; + } + return "https://" + serviceName + "." + resolvedUniverseDomain; + } + + /** + * Returns a host value to be used for BigQuery and Storage Apiary Wrapped Libraries. To be + * removed in the future when Apiary clients can resolve their endpoints. Returns the host to be + * used as the rootUrl. + * + *

        The resolved host will be in `https://{serviceName}.{resolvedUniverseDomain}/` format. The + * resolvedUniverseDomain will be set to `googleapis.com` if universeDomain is null. + * + *

        The host value is set to DEFAULT_HOST if the user didn't configure a host. Returns the host + * value the user set, otherwise constructs the host for the user. + * + * @see rootUrl + */ + @InternalApi + public String getResolvedApiaryHost(String serviceName) { + if (!DEFAULT_HOST.equals(host)) { + return host; + } + String resolvedUniverseDomain = + universeDomain != null ? universeDomain : Credentials.GOOGLE_DEFAULT_UNIVERSE; + return "https://" + serviceName + "." + resolvedUniverseDomain + "/"; + } + + /** + * Validates that Credentials' Universe Domain matches the resolved Universe Domain. Currently, + * this is only intended for BigQuery and Storage Apiary Wrapped Libraries. + * + *

        This validation call should be made prior to any RPC invocation. This call is used to gate + * the RPC invocation if there is no valid universe domain. + */ + @InternalApi + public boolean hasValidUniverseDomain() throws IOException { + String resolvedUniverseDomain = + universeDomain != null ? universeDomain : Credentials.GOOGLE_DEFAULT_UNIVERSE; + return resolvedUniverseDomain.equals(getCredentials().getUniverseDomain()); + } +} diff --git a/java-core/google-cloud-core/src/main/java/com/google/cloud/ServiceRpc.java b/java-core/google-cloud-core/src/main/java/com/google/cloud/ServiceRpc.java new file mode 100644 index 0000000000..ce4bd18a6a --- /dev/null +++ b/java-core/google-cloud-core/src/main/java/com/google/cloud/ServiceRpc.java @@ -0,0 +1,19 @@ +/* + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.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.google.cloud; + +public interface ServiceRpc {} diff --git a/java-core/google-cloud-core/src/main/java/com/google/cloud/StringEnumType.java b/java-core/google-cloud-core/src/main/java/com/google/cloud/StringEnumType.java new file mode 100644 index 0000000000..647e53f8e3 --- /dev/null +++ b/java-core/google-cloud-core/src/main/java/com/google/cloud/StringEnumType.java @@ -0,0 +1,90 @@ +/* + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.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.google.cloud; + +import com.google.api.core.ApiFunction; +import com.google.api.core.InternalApi; +import com.google.common.base.Preconditions; +import java.lang.reflect.Array; +import java.util.Collection; +import java.util.LinkedHashMap; +import java.util.Map; + +/** + * This represents a concept having a known set of acceptable String values, which can expand later + * due to new API features. + */ +@InternalApi +public class StringEnumType { + + private final Class clazz; + private final ApiFunction constructor; + private final Map knownValues = new LinkedHashMap<>(); + + public StringEnumType(Class clazz, ApiFunction constructor) { + this.clazz = Preconditions.checkNotNull(clazz); + this.constructor = Preconditions.checkNotNull(constructor); + } + + /** Create a new constant and register it in the known values. */ + public EnumT createAndRegister(String constant) { + EnumT instance = constructor.apply(constant); + knownValues.put(constant, instance); + return instance; + } + + /** + * Get the enum object for the given String constant, and throw an exception if the constant is + * not recognized. + */ + public EnumT valueOfStrict(String constant) { + EnumT value = knownValues.get(constant); + if (value != null) { + return value; + } else { + throw new IllegalArgumentException( + "Constant \"" + constant + "\" not found for enum \"" + clazz.getName() + "\""); + } + } + + /** Get the enum object for the given String constant, and allow unrecognized values. */ + public EnumT valueOf(String constant) { + if (constant == null || constant.isEmpty()) { + throw new IllegalArgumentException("Empty enum constants not allowed."); + } + EnumT value = knownValues.get(constant); + if (value != null) { + return value; + } else { + return constructor.apply(constant); + } + } + + /** Return the known values of this enum type. */ + public EnumT[] values() { + Collection valueCollection = knownValues.values(); + + @SuppressWarnings("unchecked") + final EnumT[] valueArray = (EnumT[]) Array.newInstance(clazz, valueCollection.size()); + int i = 0; + for (EnumT enumV : valueCollection) { + valueArray[i] = enumV; + i++; + } + + return valueArray; + } +} diff --git a/java-core/google-cloud-core/src/main/java/com/google/cloud/StringEnumValue.java b/java-core/google-cloud-core/src/main/java/com/google/cloud/StringEnumValue.java new file mode 100644 index 0000000000..2f1ae94218 --- /dev/null +++ b/java-core/google-cloud-core/src/main/java/com/google/cloud/StringEnumValue.java @@ -0,0 +1,65 @@ +/* + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.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.google.cloud; + +import com.google.api.core.InternalApi; +import com.google.common.base.Preconditions; +import java.io.Serializable; + +/** + * This represents a specific instance of a concept having a known set of acceptable String values, + * which can expand later due to new API features. Standard Java enums can't be used in such a + * context. + */ +public abstract class StringEnumValue implements Serializable { + private static final long serialVersionUID = 1501809419544297884L; + private final String constant; + + /** Don't create subclasses outside of google-cloud-java. */ + @InternalApi("This class should only be extended within google-cloud-java") + protected StringEnumValue(String constant) { + this.constant = Preconditions.checkNotNull(constant); + } + + public String name() { + return constant; + } + + @Override + public String toString() { + return constant; + } + + @Override + public boolean equals(Object that) { + if (that == null) { + return false; + } + if (this == that) { + return true; + } + if (!(getClass().equals(that.getClass()))) { + return false; + } + StringEnumValue thatEnumValue = (StringEnumValue) that; + return this.constant.equals(thatEnumValue.constant); + } + + @Override + public int hashCode() { + return constant.hashCode(); + } +} diff --git a/java-core/google-cloud-core/src/main/java/com/google/cloud/Structs.java b/java-core/google-cloud-core/src/main/java/com/google/cloud/Structs.java new file mode 100644 index 0000000000..889bb3364a --- /dev/null +++ b/java-core/google-cloud-core/src/main/java/com/google/cloud/Structs.java @@ -0,0 +1,151 @@ +/* + * Copyright 2016 Google LLC + * + * Licensed under the Apache License, Version 2.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.google.cloud; + +import static com.google.common.base.Preconditions.checkNotNull; + +import com.google.api.client.util.Types; +import com.google.api.core.InternalApi; +import com.google.common.collect.Iterables; +import com.google.common.collect.Iterators; +import com.google.common.collect.Lists; +import com.google.common.collect.Maps; +import com.google.protobuf.ListValue; +import com.google.protobuf.NullValue; +import com.google.protobuf.Struct; +import com.google.protobuf.Value; +import java.util.AbstractMap; +import java.util.AbstractSet; +import java.util.Iterator; +import java.util.Map; +import java.util.Set; + +/** + * This class contains static utility methods that operate on or return protobuf's {@code Struct} + * objects. This is considered an internal class and implementation detail. + */ +@InternalApi +public final class Structs { + + private Structs() {} + + /** + * This class wraps a protobuf's {@code Struct} object and offers a map interface to it, hiding + * protobuf types. + */ + private static final class StructMap extends AbstractMap { + + private final Set> entrySet; + + private StructMap(Struct struct) { + this.entrySet = new StructSet(struct); + } + + private static final class StructSet extends AbstractSet> { + + private static Entry valueToObject(Entry entry) { + return new AbstractMap.SimpleEntry<>( + entry.getKey(), Structs.valueToObject(entry.getValue())); + } + + private final Struct struct; + + private StructSet(Struct struct) { + this.struct = struct; + } + + @Override + public Iterator> iterator() { + return Iterators.transform( + struct.getFieldsMap().entrySet().iterator(), StructSet::valueToObject); + } + + @Override + public int size() { + return struct.getFieldsMap().size(); + } + } + + @Override + public Set> entrySet() { + return entrySet; + } + } + + /** Returns an unmodifiable map view of the {@link Struct} parameter. */ + public static Map asMap(Struct struct) { + return new StructMap(checkNotNull(struct)); + } + + /** + * Creates a new {@link Struct} object given the content of the provided {@code map} parameter. + * + *

        Notice that all numbers (int, long, float and double) are serialized as double values. Enums + * are serialized as strings. + */ + public static Struct newStruct(Map map) { + Map valueMap = Maps.transformValues(checkNotNull(map), Structs::objectToValue); + return Struct.newBuilder().putAllFields(valueMap).build(); + } + + private static Object valueToObject(Value value) { + switch (value.getKindCase()) { + case NULL_VALUE: + return null; + case NUMBER_VALUE: + return value.getNumberValue(); + case STRING_VALUE: + return value.getStringValue(); + case BOOL_VALUE: + return value.getBoolValue(); + case STRUCT_VALUE: + return new StructMap(value.getStructValue()); + case LIST_VALUE: + return Lists.transform(value.getListValue().getValuesList(), Structs::valueToObject); + default: + throw new IllegalArgumentException(String.format("Unsupported protobuf value %s", value)); + } + } + + @SuppressWarnings("unchecked") + private static Value objectToValue(final Object obj) { + Value.Builder builder = Value.newBuilder(); + if (obj == null) { + builder.setNullValue(NullValue.NULL_VALUE); + return builder.build(); + } + Class objClass = obj.getClass(); + if (obj instanceof String) { + builder.setStringValue((String) obj); + } else if (obj instanceof Number) { + builder.setNumberValue(((Number) obj).doubleValue()); + } else if (obj instanceof Boolean) { + builder.setBoolValue((Boolean) obj); + } else if (obj instanceof Iterable || objClass.isArray()) { + builder.setListValue( + ListValue.newBuilder() + .addAllValues(Iterables.transform(Types.iterableOf(obj), Structs::objectToValue))); + } else if (objClass.isEnum()) { + builder.setStringValue(((Enum) obj).name()); + } else if (obj instanceof Map) { + Map map = (Map) obj; + builder.setStructValue(newStruct(map)); + } else { + throw new IllegalArgumentException(String.format("Unsupported protobuf value %s", obj)); + } + return builder.build(); + } +} diff --git a/java-core/google-cloud-core/src/main/java/com/google/cloud/Timestamp.java b/java-core/google-cloud-core/src/main/java/com/google/cloud/Timestamp.java new file mode 100644 index 0000000000..d24cb2a37e --- /dev/null +++ b/java-core/google-cloud-core/src/main/java/com/google/cloud/Timestamp.java @@ -0,0 +1,251 @@ +/* + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.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.google.cloud; + +import static com.google.common.base.Preconditions.checkArgument; + +import com.google.api.core.ObsoleteApi; +import com.google.protobuf.util.Timestamps; +import java.io.Serializable; +import java.time.Instant; +import java.time.LocalDateTime; +import java.time.ZoneOffset; +import java.time.format.DateTimeFormatter; +import java.time.format.DateTimeFormatterBuilder; +import java.time.format.DateTimeParseException; +import java.time.temporal.TemporalAccessor; +import java.util.Date; +import java.util.Objects; +import java.util.concurrent.TimeUnit; + +/** + * Represents a timestamp with nanosecond precision. Timestamps cover the range [0001-01-01, + * 9999-12-31]. + * + *

        {@code Timestamp} instances are immutable. + */ +public final class Timestamp implements Comparable, Serializable { + + private static final long serialVersionUID = 5152143600571559844L; + + /** The smallest legal timestamp ("0001-01-01T00:00:00Z"). */ + public static final Timestamp MIN_VALUE = new Timestamp(-62135596800L, 0); + + /** The largest legal timestamp ("9999-12-31T23:59:59Z"). */ + public static final Timestamp MAX_VALUE = + new Timestamp(253402300799L, (int) TimeUnit.SECONDS.toNanos(1) - 1); + + private static final DateTimeFormatter format = DateTimeFormatter.ISO_LOCAL_DATE_TIME; + + private static final DateTimeFormatter timestampParser = + new DateTimeFormatterBuilder() + .appendOptional(DateTimeFormatter.ISO_LOCAL_DATE_TIME) + .optionalStart() + .appendZoneOrOffsetId() + .optionalEnd() + .toFormatter() + .withZone(ZoneOffset.UTC); + + private final long seconds; + private final int nanos; + + private Timestamp(long seconds, int nanos) { + this.seconds = seconds; + this.nanos = nanos; + } + + /** + * Creates an instance representing the value of {@code seconds} and {@code nanos} since January + * 1, 1970, 00:00:00 UTC. + * + * @param seconds seconds since January 1, 1970, 00:00:00 UTC. A negative value is the number of + * seconds before January 1, 1970, 00:00:00 UTC. + * @param nanos the fractional seconds component, in the range 0..999999999. + * @throws IllegalArgumentException if the timestamp is outside the representable range + */ + public static Timestamp ofTimeSecondsAndNanos(long seconds, int nanos) { + checkArgument( + Timestamps.isValid(seconds, nanos), "timestamp out of range: %s, %s", seconds, nanos); + return new Timestamp(seconds, nanos); + } + + /** + * Creates an instance representing the value of {@code microseconds}. + * + * @throws IllegalArgumentException if the timestamp is outside the representable range + */ + public static Timestamp ofTimeMicroseconds(long microseconds) { + long seconds = microseconds / 1_000_000; + int nanos = (int) (microseconds % 1_000_000 * 1000); + if (nanos < 0) { + seconds--; + nanos += 1_000_000_000; + } + checkArgument( + Timestamps.isValid(seconds, nanos), "timestamp out of range: %s, %s", seconds, nanos); + return new Timestamp(seconds, nanos); + } + + /** + * Creates an instance representing the value of {@code Date}. + * + * @throws IllegalArgumentException if the timestamp is outside the representable range + */ + public static Timestamp of(Date date) { + return ofTimeMicroseconds(TimeUnit.MILLISECONDS.toMicros(date.getTime())); + } + + /** Creates an instance with current time. */ + public static Timestamp now() { + java.sql.Timestamp date = new java.sql.Timestamp(System.currentTimeMillis()); + return of(date); + } + + /** + * Creates an instance representing the value of {@code timestamp}. + * + * @throws IllegalArgumentException if the timestamp is outside the representable range + */ + public static Timestamp of(java.sql.Timestamp timestamp) { + int nanos = timestamp.getNanos(); + + // A pre-epoch timestamp can be off by one second because of the way that integer division + // works. For example, -1001 / 1000 == -1. In this case, we want this result to be -2. This + // causes any pre-epoch timestamp to be off by 1 second - fix this by subtracting 1 from the + // seconds value if the seconds value is less than zero and is not divisible by 1000. + // TODO: replace with Math.floorDiv when we drop Java 7 support + long seconds = timestamp.getTime() / 1000; + if (seconds < 0 && timestamp.getTime() % 1000 != 0) { + --seconds; + } + + return Timestamp.ofTimeSecondsAndNanos(seconds, nanos); + } + + /** + * Returns the number of seconds since January 1, 1970, 00:00:00 UTC. A negative value is the + * number of seconds before January 1, 1970, 00:00:00 UTC. + */ + public long getSeconds() { + return seconds; + } + + /** Returns the fractional seconds component, in nanoseconds. */ + public int getNanos() { + return nanos; + } + + /** Returns a JDBC timestamp initialized to the same point in time as {@code this}. */ + public java.sql.Timestamp toSqlTimestamp() { + java.sql.Timestamp ts = new java.sql.Timestamp(seconds * 1000); + ts.setNanos(nanos); + return ts; + } + + /** + * Returns a new {@code java.util.Date} corresponding to this {@code timestamp}. Any + * sub-millisecond precision will be stripped. + * + * @return An approximate {@code java.util.Date} representation of this {@code timestamp}. + */ + public Date toDate() { + long secondsInMilliseconds = TimeUnit.SECONDS.toMillis(this.seconds); + long nanosInMilliseconds = TimeUnit.NANOSECONDS.toMillis(this.nanos); + return new Date(secondsInMilliseconds + nanosInMilliseconds); + } + + @Override + public int compareTo(Timestamp other) { + int r = Long.compare(seconds, other.seconds); + if (r == 0) { + r = Integer.compare(nanos, other.nanos); + } + return r; + } + + /** Creates an instance of Timestamp from {@code com.google.protobuf.Timestamp}. */ + public static Timestamp fromProto(com.google.protobuf.Timestamp proto) { + return new Timestamp(proto.getSeconds(), proto.getNanos()); + } + + /** + * Returns a {@code com.google.protobuf.Timestamp} initialized to the same point in time as {@code + * this}. + */ + public com.google.protobuf.Timestamp toProto() { + return com.google.protobuf.Timestamp.newBuilder().setSeconds(seconds).setNanos(nanos).build(); + } + + /** This method is obsolete. Use {@link #parseTimestampDuration(String)} instead */ + @ObsoleteApi("Use parseTimestampDuration(String) instead") + public static Timestamp parseTimestamp(String timestamp) { + try { + return parseTimestampDuration(timestamp); + } catch (DateTimeParseException ex) { + throw new org.threeten.bp.format.DateTimeParseException( + ex.getMessage(), ex.getParsedString(), ex.getErrorIndex()); + } + } + + /** + * Creates a Timestamp instance from the given string. Input string should be in the RFC 3339 + * format, like '2020-12-01T10:15:30.000Z' or with the timezone offset, such as + * '2020-12-01T10:15:30+01:00'. + * + * @param timestamp string in the RFC 3339 format + * @return created Timestamp + * @throws DateTimeParseException if unable to parse + */ + public static Timestamp parseTimestampDuration(String timestamp) { + TemporalAccessor temporalAccessor = timestampParser.parse(timestamp); + Instant instant = Instant.from(temporalAccessor); + return ofTimeSecondsAndNanos(instant.getEpochSecond(), instant.getNano()); + } + + private StringBuilder toString(StringBuilder b) { + format.formatTo(LocalDateTime.ofEpochSecond(seconds, 0, ZoneOffset.UTC), b); + if (nanos != 0) { + b.append(String.format(".%09d", nanos)); + } + b.append('Z'); + return b; + } + + @Override + public String toString() { + return toString(new StringBuilder()).toString(); + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Timestamp that = (Timestamp) o; + return seconds == that.seconds && nanos == that.nanos; + } + + @Override + public int hashCode() { + return Objects.hash(seconds, nanos); + } + + // TODO(user): Consider adding math operations. +} diff --git a/java-core/google-cloud-core/src/main/java/com/google/cloud/TransportOptions.java b/java-core/google-cloud-core/src/main/java/com/google/cloud/TransportOptions.java new file mode 100644 index 0000000000..e62fdddefc --- /dev/null +++ b/java-core/google-cloud-core/src/main/java/com/google/cloud/TransportOptions.java @@ -0,0 +1,21 @@ +/* + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.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.google.cloud; + +import java.io.Serializable; + +/** An abstraction for transport-specific options, e.g. for http1.1 vs grpc. */ +public interface TransportOptions extends Serializable {} diff --git a/java-core/google-cloud-core/src/main/java/com/google/cloud/Tuple.java b/java-core/google-cloud-core/src/main/java/com/google/cloud/Tuple.java new file mode 100644 index 0000000000..c9d2b9bc25 --- /dev/null +++ b/java-core/google-cloud-core/src/main/java/com/google/cloud/Tuple.java @@ -0,0 +1,40 @@ +/* + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.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.google.cloud; + +public class Tuple { + + private final X x; + private final Y y; + + private Tuple(X x, Y y) { + this.x = x; + this.y = y; + } + + public static Tuple of(X x, Y y) { + return new Tuple<>(x, y); + } + + public X x() { + return x; + } + + public Y y() { + return y; + } +} diff --git a/java-core/google-cloud-core/src/main/java/com/google/cloud/WriteChannel.java b/java-core/google-cloud-core/src/main/java/com/google/cloud/WriteChannel.java new file mode 100644 index 0000000000..947909bb66 --- /dev/null +++ b/java-core/google-cloud-core/src/main/java/com/google/cloud/WriteChannel.java @@ -0,0 +1,47 @@ +/* + * Copyright 2015 Google LLC + * + * Licensed under the Apache License, Version 2.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.google.cloud; + +import java.io.Closeable; +import java.nio.channels.WritableByteChannel; + +/** + * A channel for writing data to Google Cloud services. + * + *

        Implementations of this class may further buffer data internally to reduce remote calls. + * Written data might not be visible until calling {@link #close()}. This interface implements + * {@link Restorable} to allow saving the writer's state to continue writing afterwards. + */ +public interface WriteChannel extends WritableByteChannel, Closeable, Restorable { + + /** + * Sets the minimum size that will be written by a single RPC. Written data will be buffered and + * only flushed upon reaching this size or closing the channel. + */ + void setChunkSize(int chunkSize); + + /** + * Captures the write channel state so that it can be saved and restored afterwards. The original + * {@code WriteChannel} and the restored one should not both be used. Closing one channel causes + * the other channel to close; subsequent writes will fail. + * + * @return a {@link RestorableState} object that contains the write channel state and can restore + * it afterwards. + */ + @Override + RestorableState capture(); +} diff --git a/java-core/google-cloud-core/src/main/java/com/google/cloud/package-info.java b/java-core/google-cloud-core/src/main/java/com/google/cloud/package-info.java new file mode 100644 index 0000000000..56d9be78d6 --- /dev/null +++ b/java-core/google-cloud-core/src/main/java/com/google/cloud/package-info.java @@ -0,0 +1,18 @@ +/* + * Copyright 2016 Google LLC + * + * Licensed under the Apache License, Version 2.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. + */ + +/** Core classes for the {@code google-cloud} library. */ +package com.google.cloud; diff --git a/java-core/google-cloud-core/src/main/java/com/google/cloud/spi/ServiceRpcFactory.java b/java-core/google-cloud-core/src/main/java/com/google/cloud/spi/ServiceRpcFactory.java new file mode 100644 index 0000000000..bd27986e1d --- /dev/null +++ b/java-core/google-cloud-core/src/main/java/com/google/cloud/spi/ServiceRpcFactory.java @@ -0,0 +1,30 @@ +/* + * Copyright 2015 Google LLC + * + * Licensed under the Apache License, Version 2.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.google.cloud.spi; + +import com.google.cloud.ServiceOptions; +import com.google.cloud.ServiceRpc; + +/** + * A base interface for all service RPC factories. Implementation must provide a public no-arg + * constructor. Loading of a factory implementation is done via {@link java.util.ServiceLoader}. + */ +@SuppressWarnings("rawtypes") +public interface ServiceRpcFactory { + + ServiceRpc create(OptionsT options); +} diff --git a/java-core/google-cloud-core/src/main/java/com/google/cloud/testing/BaseEmulatorHelper.java b/java-core/google-cloud-core/src/main/java/com/google/cloud/testing/BaseEmulatorHelper.java new file mode 100644 index 0000000000..4bbf909da4 --- /dev/null +++ b/java-core/google-cloud-core/src/main/java/com/google/cloud/testing/BaseEmulatorHelper.java @@ -0,0 +1,514 @@ +/* + * Copyright 2016 Google LLC + * + * Licensed under the Apache License, Version 2.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.google.cloud.testing; + +import static com.google.api.gax.util.TimeConversionUtils.toJavaTimeDuration; +import static com.google.api.gax.util.TimeConversionUtils.toThreetenDuration; + +import com.google.api.core.CurrentMillisClock; +import com.google.api.core.InternalApi; +import com.google.api.core.ObsoleteApi; +import com.google.cloud.ExceptionHandler; +import com.google.cloud.RetryHelper; +import com.google.cloud.ServiceOptions; +import com.google.common.io.CharStreams; +import com.google.common.util.concurrent.SettableFuture; +import com.google.common.util.concurrent.UncheckedExecutionException; +import java.io.BufferedInputStream; +import java.io.BufferedOutputStream; +import java.io.BufferedReader; +import java.io.File; +import java.io.FileInputStream; +import java.io.FileOutputStream; +import java.io.IOException; +import java.io.InputStream; +import java.io.InputStreamReader; +import java.io.OutputStream; +import java.math.BigInteger; +import java.net.HttpURLConnection; +import java.net.ServerSocket; +import java.net.URL; +import java.net.URLConnection; +import java.nio.channels.Channels; +import java.nio.channels.ReadableByteChannel; +import java.nio.file.Files; +import java.nio.file.Path; +import java.security.MessageDigest; +import java.security.NoSuchAlgorithmException; +import java.util.Arrays; +import java.util.List; +import java.util.Locale; +import java.util.concurrent.Callable; +import java.util.concurrent.ExecutionException; +import java.util.concurrent.TimeUnit; +import java.util.concurrent.TimeoutException; +import java.util.logging.Level; +import java.util.logging.Logger; +import java.util.zip.ZipEntry; +import java.util.zip.ZipInputStream; + +/** Utility class to start and stop a local service which is used by unit testing. */ +@InternalApi +public abstract class BaseEmulatorHelper { + + private final String emulator; + private final int port; + private final String projectId; + private EmulatorRunner activeRunner; + private BlockingProcessStreamReader blockingProcessReader; + + protected static final String PROJECT_ID_PREFIX = "test-project-"; + protected static final String DEFAULT_HOST = "localhost"; + protected static final int DEFAULT_PORT = 8080; + + @InternalApi("This class should only be extended within google-cloud-java") + protected BaseEmulatorHelper(String emulator, int port, String projectId) { + this.emulator = emulator; + this.port = port > 0 ? port : DEFAULT_PORT; + this.projectId = projectId; + } + + /** + * Returns the emulator runners supported by this emulator. Runners are evaluated in order, the + * first available runner is selected and executed + */ + protected abstract List getEmulatorRunners(); + + /** Returns a logger. */ + protected abstract Logger getLogger(); + + /** + * Starts the local service as a subprocess. Blocks the execution until {@code blockUntilOutput} + * is found on stdout. + */ + protected final void startProcess(String blockUntilOutput) + throws IOException, InterruptedException { + for (EmulatorRunner runner : getEmulatorRunners()) { + // Iterate through all emulator runners until find first available runner. + if (runner.isAvailable()) { + activeRunner = runner; + runner.start(); + break; + } + } + if (activeRunner != null) { + blockingProcessReader = + BlockingProcessStreamReader.start( + emulator, activeRunner.getProcess().getInputStream(), blockUntilOutput, getLogger()); + } else { + // No available runner found. + throw new IOException("No available emulator runner is found."); + } + } + + /** This method is obsolete. Use {@link #waitForProcessDuration(java.time.Duration)} instead */ + @ObsoleteApi("Use waitForProcessDuration(java.time.Duration) instead") + protected final int waitForProcess(org.threeten.bp.Duration timeout) + throws IOException, InterruptedException, TimeoutException { + return waitForProcessDuration(toJavaTimeDuration(timeout)); + } + + /** + * Waits for the local service's subprocess to terminate, and stop any possible thread listening + * for its output. + */ + protected final int waitForProcessDuration(java.time.Duration timeout) + throws IOException, InterruptedException, TimeoutException { + if (activeRunner != null) { + int exitCode = activeRunner.waitForDuration(timeout); + activeRunner = null; + return exitCode; + } + if (blockingProcessReader != null) { + blockingProcessReader.join(); + blockingProcessReader = null; + } + return 0; + } + + private static int waitForProcess(final Process process, java.time.Duration timeout) + throws InterruptedException, TimeoutException { + if (process == null) { + return 0; + } + + final SettableFuture exitValue = SettableFuture.create(); + + Thread waiter = + new Thread( + new Runnable() { + @Override + public void run() { + try { + exitValue.set(process.waitFor()); + } catch (InterruptedException e) { + exitValue.setException(e); + } + } + }); + waiter.start(); + + try { + return exitValue.get(timeout.toMillis(), TimeUnit.MILLISECONDS); + } catch (ExecutionException e) { + if (e.getCause() instanceof InterruptedException) { + throw (InterruptedException) e.getCause(); + } + throw new UncheckedExecutionException(e); + } finally { + waiter.interrupt(); + } + } + + /** Returns the port to which the local emulator is listening. */ + public int getPort() { + return port; + } + + /** Returns the project ID associated with the local emulator. */ + public String getProjectId() { + return projectId; + } + + /** Returns service options to access the local emulator. */ + public abstract T getOptions(); + + /** Starts the local emulator. */ + public abstract void start() throws IOException, InterruptedException; + + /** This method is obsolete. Use {@link #stopDuration(java.time.Duration)} instead */ + @ObsoleteApi("Use stopDuration() instead") + public abstract void stop(org.threeten.bp.Duration timeout) + throws IOException, InterruptedException, TimeoutException; + + /** Stops the local emulator. */ + public void stopDuration(java.time.Duration timeout) + throws IOException, InterruptedException, TimeoutException { + stop(toThreetenDuration(timeout)); + } + + /** Resets the internal state of the emulator. */ + public abstract void reset() throws IOException; + + protected final String sendPostRequest(String request) throws IOException { + URL url = new URL("http", DEFAULT_HOST, this.port, request); + HttpURLConnection con = (HttpURLConnection) url.openConnection(); + con.setRequestMethod("POST"); + con.setDoOutput(true); + OutputStream out = con.getOutputStream(); + out.write("".getBytes()); + out.flush(); + + InputStream in = con.getInputStream(); + String response = CharStreams.toString(new InputStreamReader(con.getInputStream())); + in.close(); + return response; + } + + protected static int findAvailablePort(int defaultPort) { + try (ServerSocket tempSocket = new ServerSocket(0)) { + return tempSocket.getLocalPort(); + } catch (IOException e) { + return defaultPort; + } + } + + protected static boolean isWindows() { + return System.getProperty("os.name").toLowerCase(Locale.ENGLISH).contains("windows"); + } + + /** Utility interface to start and run an emulator. */ + protected interface EmulatorRunner { + + /** + * Returns {@code true} if the emulator associated to this runner is available and can be + * started. + */ + boolean isAvailable(); + + /** Starts the emulator associated to this runner. */ + void start() throws IOException; + + /** This method is obsolete. Use {@link #waitForDuration(java.time.Duration)} instead */ + @ObsoleteApi("Use waitForDuration() instead") + int waitFor(org.threeten.bp.Duration timeout) throws InterruptedException, TimeoutException; + + /** Wait for the emulator associated to this runner to terminate, returning the exit status. */ + default int waitForDuration(java.time.Duration timeout) + throws InterruptedException, TimeoutException { + return waitFor(toThreetenDuration(timeout)); + } + + /** Returns the process associated to the emulator, if any. */ + Process getProcess(); + } + + /** Utility class to start and run an emulator from the Google Cloud SDK. */ + protected static class GcloudEmulatorRunner implements EmulatorRunner { + + private final List commandText; + private final String versionPrefix; + private final Version minVersion; + private Process process; + private static final Logger log = Logger.getLogger(GcloudEmulatorRunner.class.getName()); + + public GcloudEmulatorRunner(List commandText, String versionPrefix, String minVersion) { + this.commandText = commandText; + this.versionPrefix = versionPrefix; + this.minVersion = Version.fromString(minVersion); + } + + @Override + public boolean isAvailable() { + try { + return isGcloudInstalled() && isEmulatorUpToDate() && !commandText.isEmpty(); + } catch (IOException | InterruptedException e) { + e.printStackTrace(System.err); + } + return false; + } + + @Override + public void start() throws IOException { + log.fine("Starting emulator via Google Cloud SDK"); + process = CommandWrapper.create().setCommand(commandText).setRedirectErrorStream().start(); + } + + /** This method is obsolete. Use {@link #waitForDuration(java.time.Duration)} instead */ + @ObsoleteApi("Use waitForDuration() instead") + @Override + public int waitFor(org.threeten.bp.Duration timeout) + throws InterruptedException, TimeoutException { + return waitForDuration(toJavaTimeDuration(timeout)); + } + + @Override + public int waitForDuration(java.time.Duration timeout) + throws InterruptedException, TimeoutException { + return waitForProcess(process, timeout); + } + + @Override + public Process getProcess() { + return process; + } + + private boolean isGcloudInstalled() { + String path = System.getenv("PATH"); + return path != null && path.contains("google-cloud-sdk"); + } + + private boolean isEmulatorUpToDate() throws IOException, InterruptedException { + Version currentVersion = getInstalledEmulatorVersion(versionPrefix); + return currentVersion != null && currentVersion.compareTo(minVersion) >= 0; + } + + private Version getInstalledEmulatorVersion(String versionPrefix) + throws IOException, InterruptedException { + Process process = + CommandWrapper.create() + .setCommand(Arrays.asList("gcloud", "version")) + // gcloud redirects all output to stderr while emulators' executables use either + // stdout or stderr with no apparent convention. To be able to properly intercept and + // block waiting for emulators to be ready we redirect everything to stdout + .setRedirectErrorStream() + .start(); + process.waitFor(); + try (BufferedReader reader = + new BufferedReader(new InputStreamReader(process.getInputStream()))) { + for (String line = reader.readLine(); line != null; line = reader.readLine()) { + if (line.startsWith(versionPrefix)) { + String[] lineComponents = line.split(" "); + if (lineComponents.length > 1) { + return Version.fromString(lineComponents[1]); + } + } + } + return null; + } + } + } + + /** Utility class to start and run an emulator from a download URL. */ + protected static class DownloadableEmulatorRunner implements EmulatorRunner { + + private final List commandText; + private final String md5CheckSum; + private final URL downloadUrl; + private final String fileName; + private String accessToken; + private Process process; + private static final Logger log = Logger.getLogger(DownloadableEmulatorRunner.class.getName()); + + public DownloadableEmulatorRunner( + List commandText, URL downloadUrl, String md5CheckSum) { + this.commandText = commandText; + this.md5CheckSum = md5CheckSum; + this.downloadUrl = downloadUrl; + String[] splitUrl = downloadUrl.toString().split("/"); + this.fileName = splitUrl[splitUrl.length - 1]; + } + + public DownloadableEmulatorRunner( + List commandText, URL downloadUrl, String md5CheckSum, String accessToken) { + this(commandText, downloadUrl, md5CheckSum); + this.accessToken = accessToken; + } + + @Override + public boolean isAvailable() { + try { + downloadZipFile(); + return true; + } catch (IOException e) { + return false; + } + } + + @Override + public void start() throws IOException { + ExceptionHandler retryOnAnythingExceptionHandler = + ExceptionHandler.newBuilder().retryOn(Exception.class).build(); + + Path emulatorPath = + RetryHelper.runWithRetries( + new Callable() { + @Override + public Path call() throws IOException { + return downloadEmulator(); + } + }, + ServiceOptions.getDefaultRetrySettings(), + retryOnAnythingExceptionHandler, + CurrentMillisClock.getDefaultClock()); + process = + CommandWrapper.create() + .setCommand(commandText) + .setDirectory(emulatorPath) + // gcloud redirects all output to stderr while emulators' executables use either + // stdout + // or stderr with no apparent convention. To be able to properly intercept and block + // waiting for emulators to be ready we redirect everything to stdout + .setRedirectErrorStream() + .start(); + } + + /** This method is obsolete. Use {@link #waitForDuration(java.time.Duration)} instead */ + @ObsoleteApi("Use waitForDuration() instead") + @Override + public int waitFor(org.threeten.bp.Duration timeout) + throws InterruptedException, TimeoutException { + return waitForDuration(toJavaTimeDuration(timeout)); + } + + public int waitForDuration(java.time.Duration timeout) + throws InterruptedException, TimeoutException { + return waitForProcess(process, timeout); + } + + @Override + public Process getProcess() { + return process; + } + + private Path downloadEmulator() throws IOException { + // Retrieve the file name from the download link + String[] splittedUrl = downloadUrl.toString().split("/"); + String fileName = splittedUrl[splittedUrl.length - 1]; + + // Each run is associated with its own folder that is deleted once test completes. + Path emulatorPath = Files.createTempDirectory(fileName.split("\\.")[0]); + File emulatorFolder = emulatorPath.toFile(); + emulatorFolder.deleteOnExit(); + + File zipFile = downloadZipFile(); + // Unzip the emulator + try (ZipInputStream zipIn = new ZipInputStream(new FileInputStream(zipFile))) { + if (log.isLoggable(Level.FINE)) { + log.fine("Unzipping emulator"); + } + ZipEntry entry = zipIn.getNextEntry(); + while (entry != null) { + File filePath = new File(emulatorFolder, entry.getName()); + String canonicalEmulatorFolderPath = emulatorFolder.getCanonicalPath(); + String canonicalFilePath = filePath.getCanonicalPath(); + if (!canonicalFilePath.startsWith(canonicalEmulatorFolderPath + File.separator)) { + throw new IllegalStateException( + "Entry is outside of the target dir: " + entry.getName()); + } + if (!entry.isDirectory()) { + extractFile(zipIn, filePath); + } else { + filePath.mkdir(); + } + zipIn.closeEntry(); + entry = zipIn.getNextEntry(); + } + } + return emulatorPath; + } + + private File downloadZipFile() throws IOException { + // Check if we already have a local copy of the emulator and download it if not. + File zipFile = new File(System.getProperty("java.io.tmpdir"), fileName); + if (!zipFile.exists() || (md5CheckSum != null && !md5CheckSum.equals(md5(zipFile)))) { + if (log.isLoggable(Level.FINE)) { + log.fine("Fetching emulator"); + } + URLConnection urlConnection = downloadUrl.openConnection(); + if (accessToken != null) { + urlConnection.setRequestProperty("Authorization", "Bearer " + accessToken); + } + ReadableByteChannel rbc = Channels.newChannel(urlConnection.getInputStream()); + try (FileOutputStream fos = new FileOutputStream(zipFile)) { + fos.getChannel().transferFrom(rbc, 0, Long.MAX_VALUE); + } + } else { + if (log.isLoggable(Level.FINE)) { + log.fine("Using cached emulator"); + } + } + return zipFile; + } + + private void extractFile(ZipInputStream zipIn, File filePath) throws IOException { + try (BufferedOutputStream bos = new BufferedOutputStream(new FileOutputStream(filePath))) { + byte[] bytesIn = new byte[1024]; + int read; + while ((read = zipIn.read(bytesIn)) != -1) { + bos.write(bytesIn, 0, read); + } + } + } + + private static String md5(File zipFile) throws IOException { + try { + MessageDigest md5 = MessageDigest.getInstance("MD5"); + try (InputStream is = new BufferedInputStream(new FileInputStream(zipFile))) { + byte[] bytes = new byte[4 * 1024 * 1024]; + int len; + while ((len = is.read(bytes)) >= 0) { + md5.update(bytes, 0, len); + } + } + return String.format("%032x", new BigInteger(1, md5.digest())); + } catch (NoSuchAlgorithmException e) { + throw new IOException(e); + } + } + } +} diff --git a/java-core/google-cloud-core/src/main/java/com/google/cloud/testing/BlockingProcessStreamReader.java b/java-core/google-cloud-core/src/main/java/com/google/cloud/testing/BlockingProcessStreamReader.java new file mode 100644 index 0000000000..baa747a744 --- /dev/null +++ b/java-core/google-cloud-core/src/main/java/com/google/cloud/testing/BlockingProcessStreamReader.java @@ -0,0 +1,151 @@ +/* + * Copyright 2016 Google LLC + * + * Licensed under the Apache License, Version 2.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.google.cloud.testing; + +import static com.google.common.base.MoreObjects.firstNonNull; + +import com.google.common.base.Strings; +import java.io.BufferedReader; +import java.io.IOException; +import java.io.InputStream; +import java.io.InputStreamReader; +import java.util.logging.Level; +import java.util.logging.Logger; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +/** + * This class allows to read a process output stream, block until a provided string appears on the + * stream and redirect pertinent error logs to a provided logger. + */ +class BlockingProcessStreamReader extends Thread { + + private static final int LOG_LENGTH_LIMIT = 50000; + + private final BufferedReader errorReader; + private final Logger logger; + private StringBuilder currentLog; + private Level currentLogLevel; + private boolean collectionMode; + private final String emulatorTag; + private final Pattern logLinePattern; + + private BlockingProcessStreamReader( + String emulator, InputStream stream, String blockUntil, Logger logger) throws IOException { + super("blocking-process-stream-reader"); + setDaemon(true); + errorReader = new BufferedReader(new InputStreamReader(stream)); + this.logger = logger; + this.emulatorTag = "[" + emulator + "]"; + this.logLinePattern = Pattern.compile("(\\[" + emulator + "\\]\\s)?(\\w+):.*"); + LogRecorder logRecorder = new LogRecorder(logger); + if (!Strings.isNullOrEmpty(blockUntil)) { + String line; + do { + line = errorReader.readLine(); + if (line != null) { + logRecorder.record(line); // recording the logs as these might be the error logs. + } + } while (line != null && !line.contains(blockUntil)); + } + + /* If the stream is closed here, that means subprocess has been failed to start. In that case, we + should flush the recorded startup logs to help the user in debugging */ + boolean streamClosed = errorReader.read() == -1; + if (streamClosed) { + logRecorder.flush(); + } + } + + @Override + public void run() { + String previousLine = ""; + String nextLine = ""; + try { + for (; ; ) { + previousLine = nextLine; + nextLine = errorReader.readLine(); + if (nextLine == null) { + break; + } + processLogLine(previousLine, nextLine); + } + } catch (IOException e) { + e.printStackTrace(System.err); + } + processLogLine(previousLine, firstNonNull(nextLine, "")); + writeLog(); + } + + private void processLogLine(String previousLine, String nextLine) { + // Each log is two lines with the following format: + // [Emulator]? [Date] [Time] [LoggingClass] [method] + // [Emulator]? [LEVEL]: error message + // [Emulator]? more data + // Exceptions and stack traces are included in error stream, separated by a newline + Level nextLogLevel = getLevel(nextLine); + if (nextLogLevel != null) { + writeLog(); + currentLog = new StringBuilder(); + currentLogLevel = nextLogLevel; + collectionMode = true; + } else if (collectionMode) { + if (currentLog.length() > LOG_LENGTH_LIMIT) { + collectionMode = false; + } else if (currentLog.length() == 0) { + // strip level out of the line + currentLog.append(emulatorTag); + currentLog.append(previousLine.split(":", 2)[1]); + currentLog.append(System.getProperty("line.separator")); + } else { + if (!previousLine.startsWith(emulatorTag)) { + currentLog.append(emulatorTag); + currentLog.append(' '); + } + currentLog.append(previousLine); + currentLog.append(System.getProperty("line.separator")); + } + } + } + + private void writeLog() { + if (currentLogLevel != null && currentLog != null && currentLog.length() != 0) { + logger.log(currentLogLevel, currentLog.toString().trim()); + } + } + + private Level getLevel(String line) { + try { + Matcher matcher = logLinePattern.matcher(line); + if (matcher.matches()) { + return Level.parse(matcher.group(2)); + } else { + return null; + } + } catch (IllegalArgumentException e) { + return null; // level wasn't supplied in this log line + } + } + + static BlockingProcessStreamReader start( + String emulator, InputStream stream, String blockUntil, Logger logger) throws IOException { + BlockingProcessStreamReader thread = + new BlockingProcessStreamReader(emulator, stream, blockUntil, logger); + thread.start(); + return thread; + } +} diff --git a/java-core/google-cloud-core/src/main/java/com/google/cloud/testing/CommandWrapper.java b/java-core/google-cloud-core/src/main/java/com/google/cloud/testing/CommandWrapper.java new file mode 100644 index 0000000000..79f70150a5 --- /dev/null +++ b/java-core/google-cloud-core/src/main/java/com/google/cloud/testing/CommandWrapper.java @@ -0,0 +1,99 @@ +/* + * Copyright 2016 Google LLC + * + * Licensed under the Apache License, Version 2.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.google.cloud.testing; + +import java.io.File; +import java.io.IOException; +import java.nio.file.Path; +import java.util.ArrayList; +import java.util.List; + +/** Utility class that executes system commands on both Windows and Unix. */ +class CommandWrapper { + + private final List prefix; + private List command; + private String nullFilename; + private boolean redirectOutputToNull; + private boolean redirectErrorStream; + private boolean redirectErrorInherit; + private Path directory; + + private CommandWrapper() { + this.prefix = new ArrayList<>(); + if (BaseEmulatorHelper.isWindows()) { + this.prefix.add("cmd"); + this.prefix.add("/C"); + this.nullFilename = "NUL:"; + } else { + this.prefix.add("bash"); + this.nullFilename = "/dev/null"; + } + } + + CommandWrapper setCommand(List command) { + this.command = new ArrayList<>(command.size() + this.prefix.size()); + this.command.addAll(prefix); + this.command.addAll(command); + return this; + } + + CommandWrapper setRedirectOutputToNull() { + this.redirectOutputToNull = true; + return this; + } + + CommandWrapper setRedirectErrorStream() { + this.redirectErrorStream = true; + return this; + } + + CommandWrapper setRedirectErrorInherit() { + this.redirectErrorInherit = true; + return this; + } + + CommandWrapper setDirectory(Path directory) { + this.directory = directory; + return this; + } + + ProcessBuilder getBuilder() { + ProcessBuilder builder = new ProcessBuilder(command); + if (redirectOutputToNull) { + builder.redirectOutput(new File(nullFilename)); + } + if (directory != null) { + builder.directory(directory.toFile()); + } + if (redirectErrorStream) { + builder.redirectErrorStream(true); + } + if (redirectErrorInherit) { + builder.redirectError(ProcessBuilder.Redirect.INHERIT); + } + return builder; + } + + public Process start() throws IOException { + return getBuilder().start(); + } + + static CommandWrapper create() { + return new CommandWrapper(); + } +} diff --git a/java-core/google-cloud-core/src/main/java/com/google/cloud/testing/LogRecorder.java b/java-core/google-cloud-core/src/main/java/com/google/cloud/testing/LogRecorder.java new file mode 100644 index 0000000000..7fd463defd --- /dev/null +++ b/java-core/google-cloud-core/src/main/java/com/google/cloud/testing/LogRecorder.java @@ -0,0 +1,83 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.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.google.cloud.testing; + +import java.util.logging.Level; +import java.util.logging.Logger; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +/** + * This class records the logs in memory and flush them onto the {@link java.util.logging.Logger} + * when {@link #flush()} method is called. + * + *

        This component is useful to hold logs for some time and flush them if needed. For example, we + * would want to ignore the trivial startup logs of a sub-process if it is started successfully, but + * in case any error occurs, these logs should be propagated to the user for the debugging + * purpose. + */ +class LogRecorder { + + private final Pattern logLinePattern = Pattern.compile("([A-Z]+):.*"); + private final Logger logger; + private StringBuilder logs; + + public LogRecorder(Logger logger) { + this.logger = logger; + this.logs = new StringBuilder(); + } + + /** + * Records a log line. + * + * @param logLine the log to record. + */ + public void record(String logLine) { + if (hasLevel(logLine)) { + String stripLevel = logLine.split(":")[1].trim(); + this.logs.append(stripLevel); + } else { + this.logs.append(logLine); + } + this.logs.append(System.getProperty("line.separator")); + } + + /** Flushes all the logs to the underlying {@link java.util.logging.Logger}. */ + public void flush() { + if (this.logs.length() > 0) { + logger.log(Level.INFO, this.logs.toString()); + this.logs = new StringBuilder(); + } + } + + private boolean hasLevel(String line) { + return getLevel(line) != null; + } + + private Level getLevel(String line) { + try { + Matcher matcher = logLinePattern.matcher(line); + if (matcher.matches()) { + return Level.parse(matcher.group(1)); + } else { + return null; + } + } catch (IllegalArgumentException e) { + return null; + } + } +} diff --git a/java-core/google-cloud-core/src/main/java/com/google/cloud/testing/Version.java b/java-core/google-cloud-core/src/main/java/com/google/cloud/testing/Version.java new file mode 100644 index 0000000000..dfdc076fdf --- /dev/null +++ b/java-core/google-cloud-core/src/main/java/com/google/cloud/testing/Version.java @@ -0,0 +1,89 @@ +/* + * Copyright 2016 Google LLC + * + * Licensed under the Apache License, Version 2.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.google.cloud.testing; + +import static com.google.common.base.Preconditions.checkNotNull; + +import java.util.Objects; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +/** Simplified wrapper for emulator's versions. */ +class Version implements Comparable { + + private static final Pattern VERSION_PATTERN = Pattern.compile("^(\\d+)\\.(\\d+)\\.(\\d+)$"); + + private final int major; + private final int minor; + private final int patch; + + private Version(int major, int minor, int patch) { + this.major = major; + this.minor = minor; + this.patch = patch; + } + + @Override + public int compareTo(Version version) { + int result = major - version.major; + if (result == 0) { + result = minor - version.minor; + if (result == 0) { + result = patch - version.patch; + } + } + return result; + } + + @Override + public String toString() { + return String.format("%d.%d.%d", major, minor, patch); + } + + @Override + public boolean equals(Object other) { + return this == other || other instanceof Version && compareTo((Version) other) == 0; + } + + @Override + public int hashCode() { + return Objects.hash(major, minor, patch); + } + + int getMajor() { + return major; + } + + int getMinor() { + return minor; + } + + int getPatch() { + return patch; + } + + static Version fromString(String version) { + Matcher matcher = VERSION_PATTERN.matcher(checkNotNull(version)); + if (matcher.matches()) { + return new Version( + Integer.valueOf(matcher.group(1)), + Integer.valueOf(matcher.group(2)), + Integer.valueOf(matcher.group(3))); + } + throw new IllegalArgumentException("Invalid version format"); + } +} diff --git a/java-core/google-cloud-core/src/test/java/com/google/cloud/AsyncPageImplTest.java b/java-core/google-cloud-core/src/test/java/com/google/cloud/AsyncPageImplTest.java new file mode 100644 index 0000000000..92327a0b1c --- /dev/null +++ b/java-core/google-cloud-core/src/test/java/com/google/cloud/AsyncPageImplTest.java @@ -0,0 +1,95 @@ +/* + * Copyright 2016 Google LLC + * + * Licensed under the Apache License, Version 2.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.google.cloud; + +import static org.junit.jupiter.api.Assertions.assertEquals; + +import com.google.api.core.ApiFuture; +import com.google.api.core.ApiFutures; +import com.google.api.gax.paging.AsyncPage; +import com.google.common.collect.ImmutableList; +import java.util.concurrent.ExecutionException; +import org.junit.jupiter.api.Test; + +class AsyncPageImplTest { + + private static final ImmutableList VALUES1 = ImmutableList.of("1", "2"); + private static final ImmutableList VALUES2 = ImmutableList.of("3", "4"); + private static final ImmutableList VALUES3 = ImmutableList.of("5", "6"); + private static final ImmutableList ALL_VALUES = + ImmutableList.builder().addAll(VALUES1).addAll(VALUES2).addAll(VALUES3).build(); + private static final ImmutableList SOME_VALUES = + ImmutableList.builder().addAll(VALUES2).addAll(VALUES3).build(); + + private static class TestPageFetcher implements AsyncPageImpl.NextPageFetcher { + private static final long serialVersionUID = 4703765400378593176L; + + private final AsyncPageImpl nextResult; + + TestPageFetcher(AsyncPageImpl nextResult) { + this.nextResult = nextResult; + } + + @Override + public ApiFuture> getNextPage() { + return ApiFutures.>immediateFuture(nextResult); + } + } + + @Test + void testPage() { + final AsyncPageImpl nextResult = new AsyncPageImpl<>(null, "c", VALUES2); + AsyncPageImpl.NextPageFetcher fetcher = new TestPageFetcher(nextResult); + AsyncPageImpl result = new AsyncPageImpl<>(fetcher, "c", VALUES1); + assertEquals(nextResult, result.getNextPage()); + assertEquals("c", result.getNextPageToken()); + assertEquals(VALUES1, result.getValues()); + } + + @Test + void testPageAsync() throws ExecutionException, InterruptedException { + final AsyncPageImpl nextResult = new AsyncPageImpl<>(null, "c", VALUES2); + AsyncPageImpl.NextPageFetcher fetcher = new TestPageFetcher(nextResult); + AsyncPageImpl result = new AsyncPageImpl<>(fetcher, "c", VALUES1); + assertEquals(nextResult, result.getNextPageAsync().get()); + assertEquals("c", result.getNextPageToken()); + assertEquals(VALUES1, result.getValues()); + } + + @Test + void testIterateAll() { + final AsyncPageImpl nextResult2 = new AsyncPageImpl<>(null, "c3", VALUES3); + AsyncPageImpl.NextPageFetcher fetcher2 = new TestPageFetcher(nextResult2); + final AsyncPageImpl nextResult1 = new AsyncPageImpl<>(fetcher2, "c2", VALUES2); + AsyncPageImpl.NextPageFetcher fetcher1 = new TestPageFetcher(nextResult1); + AsyncPageImpl result = new AsyncPageImpl<>(fetcher1, "c1", VALUES1); + assertEquals(ALL_VALUES, ImmutableList.copyOf(result.iterateAll())); + } + + @Test + void testAsyncPageAndIterateAll() throws ExecutionException, InterruptedException { + final AsyncPageImpl nextResult2 = new AsyncPageImpl<>(null, "c3", VALUES3); + AsyncPageImpl.NextPageFetcher fetcher2 = new TestPageFetcher(nextResult2); + final AsyncPageImpl nextResult1 = new AsyncPageImpl<>(fetcher2, "c2", VALUES2); + AsyncPageImpl.NextPageFetcher fetcher1 = new TestPageFetcher(nextResult1); + AsyncPageImpl result = new AsyncPageImpl<>(fetcher1, "c1", VALUES1); + assertEquals(nextResult1, result.getNextPageAsync().get()); + assertEquals("c1", result.getNextPageToken()); + assertEquals(VALUES1, result.getValues()); + assertEquals(SOME_VALUES, ImmutableList.copyOf(result.getNextPageAsync().get().iterateAll())); + } +} diff --git a/java-core/google-cloud-core/src/test/java/com/google/cloud/BaseSerializationTest.java b/java-core/google-cloud-core/src/test/java/com/google/cloud/BaseSerializationTest.java new file mode 100644 index 0000000000..bbc13770ae --- /dev/null +++ b/java-core/google-cloud-core/src/test/java/com/google/cloud/BaseSerializationTest.java @@ -0,0 +1,85 @@ +/* + * Copyright 2016 Google LLC + * + * Licensed under the Apache License, Version 2.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.google.cloud; + +import static com.google.common.base.MoreObjects.firstNonNull; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotSame; + +import java.io.ByteArrayInputStream; +import java.io.ByteArrayOutputStream; +import java.io.IOException; +import java.io.ObjectInputStream; +import java.io.ObjectOutputStream; +import java.io.Serializable; +import org.junit.Test; + +/** + * Base class for serialization tests. To use this class in your tests override the {@code + * serializableObjects()} method to return all objects that must be serializable. Also override + * {@code restorableObjects()} method to return all restorable objects whose state must be tested + * for proper serialization. Both methods can return {@code null} if no such object needs to be + * tested. + * + *

        This class has not migrated to Junit 5 because downstream libraries, e.g., java-logging, are + * extending this class and these libraries still use Junit 4. Migrating this class to Junit 5 will + * cause test failures in downstream libraries. + */ +public abstract class BaseSerializationTest { + + /** Returns all objects for which correct serialization must be tested. */ + protected abstract Serializable[] serializableObjects(); + + /** Returns all restorable objects whose state must be tested for proper serialization. */ + protected abstract Restorable[] restorableObjects(); + + @Test + public void testSerializableObjects() throws Exception { + for (Serializable obj : firstNonNull(serializableObjects(), new Serializable[0])) { + Object copy = serializeAndDeserialize(obj); + assertEquals(obj, obj); + assertEquals(obj, copy); + assertEquals(obj.hashCode(), copy.hashCode()); + assertEquals(obj.toString(), copy.toString()); + assertNotSame(obj, copy); + assertEquals(copy, copy); + } + } + + @Test + public void testRestorableObjects() throws Exception { + for (Restorable restorable : firstNonNull(restorableObjects(), new Restorable[0])) { + RestorableState state = restorable.capture(); + RestorableState deserializedState = serializeAndDeserialize(state); + assertEquals(state, deserializedState); + assertEquals(state.hashCode(), deserializedState.hashCode()); + assertEquals(state.toString(), deserializedState.toString()); + } + } + + @SuppressWarnings("unchecked") + public T serializeAndDeserialize(T obj) throws IOException, ClassNotFoundException { + ByteArrayOutputStream bytes = new ByteArrayOutputStream(); + try (ObjectOutputStream output = new ObjectOutputStream(bytes)) { + output.writeObject(obj); + } + try (ObjectInputStream input = + new ObjectInputStream(new ByteArrayInputStream(bytes.toByteArray()))) { + return (T) input.readObject(); + } + } +} diff --git a/java-core/google-cloud-core/src/test/java/com/google/cloud/BaseServiceExceptionTest.java b/java-core/google-cloud-core/src/test/java/com/google/cloud/BaseServiceExceptionTest.java new file mode 100644 index 0000000000..cfa06a6586 --- /dev/null +++ b/java-core/google-cloud-core/src/test/java/com/google/cloud/BaseServiceExceptionTest.java @@ -0,0 +1,157 @@ +/* + * Copyright 2015 Google LLC + * + * Licensed under the Apache License, Version 2.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.google.cloud; + +import static com.google.cloud.BaseServiceException.UNKNOWN_CODE; +import static com.google.common.truth.Truth.assertThat; +import static org.easymock.EasyMock.createMock; +import static org.easymock.EasyMock.expect; +import static org.easymock.EasyMock.replay; +import static org.easymock.EasyMock.verify; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertNull; +import static org.junit.jupiter.api.Assertions.assertTrue; + +import com.google.cloud.BaseServiceException.ExceptionData; +import com.google.common.collect.ImmutableSet; +import java.util.Set; +import org.junit.jupiter.api.Test; + +/** Tests for {@link BaseServiceException}. */ +class BaseServiceExceptionTest { + + private static final int CODE = 1; + private static final int CODE_NO_REASON = 2; + private static final String MESSAGE = "some message"; + private static final String REASON = "some reason"; + private static final boolean NOT_RETRYABLE = false; + private static final boolean RETRYABLE = true; + private static final boolean IDEMPOTENT = true; + private static final String DEBUG_INFO = "debugInfo"; + private static final String LOCATION = "location"; + + private static class CustomServiceException extends BaseServiceException { + + private static final long serialVersionUID = -195251309124875103L; + + public CustomServiceException(int code, String message, String reason, boolean idempotent) { + super( + ExceptionData.from( + code, + message, + reason, + BaseServiceException.isRetryable(code, reason, idempotent, RETRYABLE_ERRORS))); + } + + private static final Set RETRYABLE_ERRORS = + ImmutableSet.of( + new Error(CODE, REASON), new Error(null, REASON), new Error(CODE_NO_REASON, null)); + } + + @Test + void testBaseServiceException() { + BaseServiceException serviceException = + new BaseServiceException(ExceptionData.from(CODE, MESSAGE, REASON, NOT_RETRYABLE)); + assertEquals(CODE, serviceException.getCode()); + assertEquals(MESSAGE, serviceException.getMessage()); + assertEquals(REASON, serviceException.getReason()); + assertFalse(serviceException.isRetryable()); + assertNull(serviceException.getCause()); + + Exception cause = new RuntimeException(); + serviceException = + new BaseServiceException(ExceptionData.from(CODE, MESSAGE, REASON, NOT_RETRYABLE, cause)); + assertEquals(CODE, serviceException.getCode()); + assertEquals(MESSAGE, serviceException.getMessage()); + assertEquals(REASON, serviceException.getReason()); + assertFalse(serviceException.isRetryable()); + assertEquals(cause, serviceException.getCause()); + + serviceException = + new BaseServiceException( + ExceptionData.newBuilder() + .setMessage(MESSAGE) + .setCause(cause) + .setCode(CODE) + .setReason(REASON) + .setRetryable(RETRYABLE) + .setDebugInfo(DEBUG_INFO) + .setLocation(LOCATION) + .build()); + assertEquals(CODE, serviceException.getCode()); + assertEquals(MESSAGE, serviceException.getMessage()); + assertEquals(REASON, serviceException.getReason()); + assertTrue(serviceException.isRetryable()); + assertEquals(cause, serviceException.getCause()); + assertEquals(DEBUG_INFO, serviceException.getDebugInfo()); + assertEquals(LOCATION, serviceException.getLocation()); + + serviceException = new CustomServiceException(CODE, MESSAGE, REASON, IDEMPOTENT); + assertEquals(CODE, serviceException.getCode()); + assertEquals(MESSAGE, serviceException.getMessage()); + assertEquals(REASON, serviceException.getReason()); + assertTrue(serviceException.isRetryable()); + + serviceException = new CustomServiceException(CODE_NO_REASON, MESSAGE, null, IDEMPOTENT); + assertEquals(CODE_NO_REASON, serviceException.getCode()); + assertEquals(MESSAGE, serviceException.getMessage()); + assertNull(serviceException.getReason()); + assertTrue(serviceException.isRetryable()); + + serviceException = new CustomServiceException(UNKNOWN_CODE, MESSAGE, REASON, IDEMPOTENT); + assertEquals(UNKNOWN_CODE, serviceException.getCode()); + assertEquals(MESSAGE, serviceException.getMessage()); + assertEquals(REASON, serviceException.getReason()); + assertTrue(serviceException.isRetryable()); + } + + @Test + void testTranslateAndThrow() throws Exception { + BaseServiceException cause = + new BaseServiceException(ExceptionData.from(CODE, MESSAGE, REASON, NOT_RETRYABLE)); + RetryHelper.RetryHelperException exceptionMock = + createMock(RetryHelper.RetryHelperException.class); + expect(exceptionMock.getCause()).andReturn(cause).times(2); + replay(exceptionMock); + try { + BaseServiceException.translate(exceptionMock); + } catch (BaseServiceException ex) { + assertEquals(CODE, ex.getCode()); + assertEquals(MESSAGE, ex.getMessage()); + assertFalse(ex.isRetryable()); + } finally { + verify(exceptionMock); + } + } + + @Test + @SuppressWarnings("TruthSelfEquals") + void testError_Equal() { + BaseServiceException.Error error = new BaseServiceException.Error(0, "reason", true); + assertThat(error).isEqualTo(error); + assertThat(error.hashCode()).isEqualTo(error.hashCode()); + + BaseServiceException.Error sameError = new BaseServiceException.Error(0, "reason", true); + assertThat(error).isEqualTo(sameError); + assertThat(error.hashCode()).isEqualTo(sameError.hashCode()); + + BaseServiceException.Error error2 = new BaseServiceException.Error(1, "other reason", false); + assertThat(error).isNotEqualTo(error2); + assertThat(error.hashCode()).isNotEqualTo(error2.hashCode()); + } +} diff --git a/java-core/google-cloud-core/src/test/java/com/google/cloud/BaseWriteChannelTest.java b/java-core/google-cloud-core/src/test/java/com/google/cloud/BaseWriteChannelTest.java new file mode 100644 index 0000000000..847531f715 --- /dev/null +++ b/java-core/google-cloud-core/src/test/java/com/google/cloud/BaseWriteChannelTest.java @@ -0,0 +1,145 @@ +/* + * Copyright 2015 Google LLC + * + * Licensed under the Apache License, Version 2.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.google.cloud; + +import static com.google.common.truth.Truth.assertThat; +import static org.junit.jupiter.api.Assertions.assertArrayEquals; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertNull; +import static org.junit.jupiter.api.Assertions.assertThrows; +import static org.junit.jupiter.api.Assertions.assertTrue; + +import com.google.cloud.spi.ServiceRpcFactory; +import java.io.IOException; +import java.io.Serializable; +import java.nio.ByteBuffer; +import java.nio.channels.ClosedChannelException; +import java.util.Arrays; +import java.util.Random; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; + +class BaseWriteChannelTest { + + private abstract static class CustomService implements Service {} + + private abstract static class CustomServiceOptions + extends ServiceOptions { + + private static final long serialVersionUID = 3302358029307467197L; + + protected CustomServiceOptions( + Class> serviceFactoryClass, + Class> rpcFactoryClass, + Builder builder) { + super(serviceFactoryClass, rpcFactoryClass, builder, null); + } + } + + private static final Serializable ENTITY = 42L; + private static final String UPLOAD_ID = "uploadId"; + private static final byte[] CONTENT = {0xD, 0xE, 0xA, 0xD}; + private static final int MIN_CHUNK_SIZE = 256 * 1024; // 256 KiB + private static final int DEFAULT_CHUNK_SIZE = 60 * MIN_CHUNK_SIZE; // 15MiB + private static final Random RANDOM = new Random(); + private static BaseWriteChannel channel; + + @BeforeEach + void setUp() { + channel = + new BaseWriteChannel(null, ENTITY, UPLOAD_ID) { + @Override + public RestorableState capture() { + return null; + } + + @Override + protected void flushBuffer(int length, boolean last) {} + + @Override + protected BaseState.Builder stateBuilder() { + return null; + } + }; + } + + @Test + void testConstructor() { + assertNull(channel.getOptions()); + assertEquals(ENTITY, channel.getEntity()); + assertEquals(0, channel.getPosition()); + assertEquals(UPLOAD_ID, channel.getUploadId()); + assertEquals(0, channel.getLimit()); + assertTrue(channel.isOpen()); + assertArrayEquals(new byte[0], channel.getBuffer()); + assertEquals(DEFAULT_CHUNK_SIZE, channel.getChunkSize()); + } + + @Test + void testClose() throws IOException { + channel.close(); + assertFalse(channel.isOpen()); + assertNull(channel.getBuffer()); + } + + @Test + public void testValidateOpen() throws IOException { + channel.close(); + assertThrows(ClosedChannelException.class, () -> channel.write(ByteBuffer.allocate(42))); + } + + @Test + void testChunkSize() { + channel.setChunkSize(42); + assertThat(channel.getChunkSize() >= MIN_CHUNK_SIZE).isTrue(); + assertThat(channel.getChunkSize() % MIN_CHUNK_SIZE).isEqualTo(0); + + channel.setChunkSize(2 * MIN_CHUNK_SIZE); + assertThat(channel.getChunkSize() >= MIN_CHUNK_SIZE).isTrue(); + assertThat(channel.getChunkSize() % MIN_CHUNK_SIZE).isEqualTo(0); + + channel.setChunkSize(2 * MIN_CHUNK_SIZE + 1); + assertThat(channel.getChunkSize() >= MIN_CHUNK_SIZE).isTrue(); + assertThat(channel.getChunkSize() % MIN_CHUNK_SIZE).isEqualTo(0); + } + + @Test + void testWrite() throws IOException { + channel.write(ByteBuffer.wrap(CONTENT)); + assertEquals(CONTENT.length, channel.getLimit()); + assertEquals(DEFAULT_CHUNK_SIZE, channel.getBuffer().length); + assertArrayEquals(Arrays.copyOf(CONTENT, DEFAULT_CHUNK_SIZE), channel.getBuffer()); + } + + @Test + void testWriteAndFlush() throws IOException { + ByteBuffer content = randomBuffer(DEFAULT_CHUNK_SIZE + 1); + channel.write(content); + assertEquals(DEFAULT_CHUNK_SIZE, channel.getPosition()); + assertEquals(1, channel.getLimit()); + byte[] newContent = new byte[DEFAULT_CHUNK_SIZE]; + newContent[0] = content.get(DEFAULT_CHUNK_SIZE); + assertArrayEquals(newContent, channel.getBuffer()); + } + + private static ByteBuffer randomBuffer(int size) { + byte[] byteArray = new byte[size]; + RANDOM.nextBytes(byteArray); + return ByteBuffer.wrap(byteArray); + } +} diff --git a/java-core/google-cloud-core/src/test/java/com/google/cloud/BatchResultTest.java b/java-core/google-cloud-core/src/test/java/com/google/cloud/BatchResultTest.java new file mode 100644 index 0000000000..e8f6ae2da5 --- /dev/null +++ b/java-core/google-cloud-core/src/test/java/com/google/cloud/BatchResultTest.java @@ -0,0 +1,116 @@ +/* + * Copyright 2016 Google LLC + * + * Licensed under the Apache License, Version 2.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.google.cloud; + +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertSame; +import static org.junit.jupiter.api.Assertions.assertTrue; +import static org.junit.jupiter.api.Assertions.fail; + +import com.google.cloud.BaseServiceException.ExceptionData; +import org.easymock.EasyMock; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; + +class BatchResultTest { + + private BatchResult result; + + @BeforeEach + public void setUp() { + result = new BatchResult() {}; + } + + @Test + void testSuccess() { + assertFalse(result.completed()); + try { + result.get(); + fail("This was not completed yet."); + } catch (IllegalStateException ex) { + // expected + } + result.success(true); + assertTrue(result.get()); + // test that null is allowed + result.success(null); + } + + @Test + void testError() { + assertFalse(result.completed()); + try { + result.get(); + fail("This was not completed yet."); + } catch (IllegalStateException ex) { + // expected + } + try { + result.error(null); + fail(); + } catch (NullPointerException exc) { + // expected + } + BaseServiceException ex = + new BaseServiceException(ExceptionData.from(0, "message", "reason", false)); + result.error(ex); + try { + result.get(); + fail("This is a failed operation and should have thrown a DnsException."); + } catch (BaseServiceException real) { + assertSame(ex, real); + } + } + + @Test + void testNotifyError() { + final BaseServiceException ex = + new BaseServiceException(ExceptionData.from(0, "message", "reason", false)); + assertFalse(result.completed()); + BatchResult.Callback callback = + EasyMock.createStrictMock(BatchResult.Callback.class); + callback.error(ex); + EasyMock.replay(callback); + result.notify(callback); + result.error(ex); + try { + result.notify(callback); + fail("The batch has been completed."); + } catch (IllegalStateException exception) { + // expected + } + EasyMock.verify(callback); + } + + @Test + void testNotifySuccess() { + assertFalse(result.completed()); + BatchResult.Callback callback = + EasyMock.createStrictMock(BatchResult.Callback.class); + callback.success(true); + EasyMock.replay(callback); + result.notify(callback); + result.success(true); + try { + result.notify(callback); + fail("The batch has been completed."); + } catch (IllegalStateException exception) { + // expected + } + EasyMock.verify(callback); + } +} diff --git a/java-core/google-cloud-core/src/test/java/com/google/cloud/ByteArrayTest.java b/java-core/google-cloud-core/src/test/java/com/google/cloud/ByteArrayTest.java new file mode 100644 index 0000000000..67237b5371 --- /dev/null +++ b/java-core/google-cloud-core/src/test/java/com/google/cloud/ByteArrayTest.java @@ -0,0 +1,114 @@ +/* + * Copyright 2016 Google LLC + * + * Licensed under the Apache License, Version 2.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.google.cloud; + +import static org.junit.jupiter.api.Assertions.assertArrayEquals; +import static org.junit.jupiter.api.Assertions.assertEquals; + +import com.google.common.io.ByteStreams; +import com.google.protobuf.ByteString; +import java.io.ByteArrayInputStream; +import java.io.IOException; +import java.io.InputStream; +import java.nio.ByteBuffer; +import java.nio.charset.StandardCharsets; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Test; + +class ByteArrayTest { + + private static final String STRING_CONTENT = "Hello, ByteArray!"; + private static final byte[] BYTES_CONTENT = STRING_CONTENT.getBytes(StandardCharsets.UTF_8); + private static final ByteBuffer BYTE_BUFFER_CONTENT = ByteBuffer.wrap(BYTES_CONTENT); + private static final InputStream STREAM_CONTENT = new ByteArrayInputStream(BYTES_CONTENT); + private static final ByteArray STRING_ARRAY = ByteArray.copyFrom(STRING_CONTENT); + private static final ByteArray BYTES_ARRAY = ByteArray.copyFrom(BYTES_CONTENT); + private static final ByteArray BYTE_BUFFER_ARRAY = ByteArray.copyFrom(BYTE_BUFFER_CONTENT); + private static final ByteArray ARRAY = new ByteArray(ByteString.copyFrom(BYTES_CONTENT)); + + private static ByteArray streamArray; + + @BeforeAll + static void beforeClass() throws IOException { + streamArray = ByteArray.copyFrom(STREAM_CONTENT); + BYTE_BUFFER_CONTENT.flip(); + } + + @Test + void testCopyFromString() throws IOException { + assertEquals(STRING_CONTENT, STRING_ARRAY.toStringUtf8()); + assertArrayEquals(BYTES_CONTENT, STRING_ARRAY.toByteArray()); + assertEquals(BYTE_BUFFER_CONTENT.asReadOnlyBuffer(), STRING_ARRAY.asReadOnlyByteBuffer()); + assertArrayEquals(BYTES_CONTENT, ByteStreams.toByteArray(STRING_ARRAY.asInputStream())); + } + + @Test + void testCopyFromByteArray() throws IOException { + assertEquals(STRING_CONTENT, BYTES_ARRAY.toStringUtf8()); + assertArrayEquals(BYTES_CONTENT, BYTES_ARRAY.toByteArray()); + assertEquals(BYTE_BUFFER_CONTENT.asReadOnlyBuffer(), BYTES_ARRAY.asReadOnlyByteBuffer()); + assertArrayEquals(BYTES_CONTENT, ByteStreams.toByteArray(BYTES_ARRAY.asInputStream())); + } + + @Test + void testCopyFromByteBuffer() throws IOException { + assertEquals(STRING_CONTENT, BYTE_BUFFER_ARRAY.toStringUtf8()); + assertArrayEquals(BYTES_CONTENT, BYTE_BUFFER_ARRAY.toByteArray()); + assertEquals(BYTE_BUFFER_CONTENT.asReadOnlyBuffer(), BYTE_BUFFER_ARRAY.asReadOnlyByteBuffer()); + assertArrayEquals(BYTES_CONTENT, ByteStreams.toByteArray(BYTE_BUFFER_ARRAY.asInputStream())); + } + + @Test + void testCopyFromStream() throws IOException { + assertEquals(STRING_CONTENT, streamArray.toStringUtf8()); + assertArrayEquals(BYTES_CONTENT, streamArray.toByteArray()); + assertEquals(BYTE_BUFFER_CONTENT.asReadOnlyBuffer(), streamArray.asReadOnlyByteBuffer()); + assertArrayEquals(BYTES_CONTENT, ByteStreams.toByteArray(streamArray.asInputStream())); + } + + @Test + void testLength() { + assertEquals(BYTES_CONTENT.length, ARRAY.length()); + } + + @Test + void testToStringUtf8() { + assertEquals(STRING_CONTENT, ARRAY.toStringUtf8()); + } + + @Test + void testToByteArray() { + assertArrayEquals(BYTES_CONTENT, ARRAY.toByteArray()); + } + + @Test + void testAsReadOnlyByteBuffer() { + assertEquals(BYTE_BUFFER_CONTENT.asReadOnlyBuffer(), ARRAY.asReadOnlyByteBuffer()); + } + + @Test + void testAsInputStream() throws IOException { + assertArrayEquals(BYTES_CONTENT, ByteStreams.toByteArray(ARRAY.asInputStream())); + } + + @Test + void testHashCode() { + assertEquals(STRING_ARRAY.hashCode(), BYTES_ARRAY.hashCode()); + assertEquals(BYTES_ARRAY.hashCode(), BYTE_BUFFER_ARRAY.hashCode()); + assertEquals(BYTE_BUFFER_ARRAY.hashCode(), streamArray.hashCode()); + } +} diff --git a/java-core/google-cloud-core/src/test/java/com/google/cloud/ConditionTest.java b/java-core/google-cloud-core/src/test/java/com/google/cloud/ConditionTest.java new file mode 100644 index 0000000000..19abe3eba3 --- /dev/null +++ b/java-core/google-cloud-core/src/test/java/com/google/cloud/ConditionTest.java @@ -0,0 +1,40 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.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.google.cloud; + +import static com.google.common.truth.Truth.assertThat; + +import org.junit.jupiter.api.Test; + +final class ConditionTest { + + @Test + void title_nullable() { + Condition condition = + Condition.newBuilder().setTitle(null).setDescription("desc").setExpression("expr").build(); + + assertThat(condition.getTitle()).isNull(); + } + + @Test + void description_nullable() { + Condition condition = + Condition.newBuilder().setTitle("title").setDescription(null).setExpression("expr").build(); + + assertThat(condition.getDescription()).isNull(); + } +} diff --git a/java-core/google-cloud-core/src/test/java/com/google/cloud/DateTest.java b/java-core/google-cloud-core/src/test/java/com/google/cloud/DateTest.java new file mode 100644 index 0000000000..6b2a6e4df5 --- /dev/null +++ b/java-core/google-cloud-core/src/test/java/com/google/cloud/DateTest.java @@ -0,0 +1,169 @@ +/* + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.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.google.cloud; + +import static com.google.common.testing.SerializableTester.reserializeAndAssert; +import static com.google.common.truth.Truth.assertThat; +import static org.junit.jupiter.api.Assertions.fail; + +import com.google.common.testing.EqualsTester; +import java.text.ParseException; +import java.text.SimpleDateFormat; +import org.junit.jupiter.api.Test; + +/** Unit tests for {@link Date}. */ +class DateTest { + + private static final SimpleDateFormat SIMPLE_DATE_FORMAT = new SimpleDateFormat("yyyy-MM-dd"); + + @Test + void parseDate() { + verifyDate("2016-09-18", 2016, 9, 18); + verifyDate("2000-01-01", 2000, 1, 1); + verifyDate("9999-12-31", 9999, 12, 31); + verifyDate("0001-01-01", 1, 1, 1); + verifyDate("2000-02-29", 2000, 2, 29); // This is a valid leap year. + verifyDate("1900-02-29", 1900, 2, 29); // This is NOT a valid leap year. + verifyDate("2001-02-29", 2001, 2, 29); // Also not a valid leap year. + verifyDate("2000-04-31", 2000, 4, 31); // Not a valid date. + } + + private void verifyDate(String input, int year, int month, int day) { + Date date = Date.parseDate(input); + assertThat(date.getYear()).isEqualTo(year); + assertThat(date.getMonth()).isEqualTo(month); + assertThat(date.getDayOfMonth()).isEqualTo(day); + } + + @Test + void parseInvalidDates() { + parseInvalidDate("2016/09/18"); + parseInvalidDate("2016 09 18"); + parseInvalidDate("2016-9-18"); + parseInvalidDate("2016-09-18T10:00"); + parseInvalidDate(""); + parseInvalidDate("test"); + parseInvalidDate("aaaa-bb-cc"); + parseInvalidDate("aaaa-01-01"); + parseInvalidDate("2019-bb-01"); + parseInvalidDate("2019-01-cc"); + parseInvalidMonth("2000-13-01"); + parseInvalidMonth("2000-00-01"); + parseInvalidDay("2000-12-32"); + parseInvalidDay("2000-12-00"); + parseInvalidDate("10000-01-01"); + parseInvalidYear("0000-01-01"); + parseInvalidYear("-001-01-01"); + parseInvalidMonth("0001--1-01"); + parseInvalidDay("0001-01--1"); + } + + private void parseInvalidDate(String input) { + try { + Date.parseDate(input); + fail("Expected exception"); + } catch (IllegalArgumentException e) { + assertThat(e.getMessage()).contains("Invalid date"); + } + } + + private void parseInvalidYear(String input) { + try { + Date.parseDate(input); + fail("Expected exception"); + } catch (IllegalArgumentException e) { + assertThat(e.getMessage()).contains("Invalid year"); + } + } + + private void parseInvalidMonth(String input) { + try { + Date.parseDate(input); + fail("Expected exception"); + } catch (IllegalArgumentException e) { + assertThat(e.getMessage()).contains("Invalid month"); + } + } + + private void parseInvalidDay(String input) { + try { + Date.parseDate(input); + fail("Expected exception"); + } catch (IllegalArgumentException e) { + assertThat(e.getMessage()).contains("Invalid day"); + } + } + + @Test + void testToString() { + Date date = Date.fromYearMonthDay(10, 9, 5); + assertThat(date.toString()).isEqualTo("0010-09-05"); + date = Date.fromYearMonthDay(2016, 12, 31); + assertThat(date.toString()).isEqualTo("2016-12-31"); + date = Date.fromYearMonthDay(1, 1, 1); + assertThat(date.toString()).isEqualTo("0001-01-01"); + } + + @Test + void equalAndHashCode() { + Date d1 = Date.fromYearMonthDay(2016, 9, 18); + Date d2 = Date.fromYearMonthDay(2016, 9, 18); + Date d3 = Date.fromYearMonthDay(2016, 9, 19); + new EqualsTester().addEqualityGroup(d1, d2).addEqualityGroup(d3).testEquals(); + } + + @Test + void validOrdering() { + Date d1 = Date.fromYearMonthDay(2016, 9, 18); + Date d2 = Date.fromYearMonthDay(2016, 9, 19); + Date d3 = Date.fromYearMonthDay(2016, 9, 20); + Date d4 = Date.fromYearMonthDay(2016, 10, 1); + Date d5 = Date.fromYearMonthDay(2017, 1, 1); + assertDescending(d5, d4, d3, d2, d1); + } + + @Test + void serialization() { + reserializeAndAssert(Date.fromYearMonthDay(2017, 4, 20)); + } + + @Test + void testToJavaUtilDate() throws ParseException { + Date gcDate = Date.parseDate("2016-09-18"); + java.util.Date juDate1 = SIMPLE_DATE_FORMAT.parse("2016-09-18"); + java.util.Date juDate2 = Date.toJavaUtilDate(gcDate); + assertThat(juDate1).isEqualTo(juDate2); + } + + @Test + void testFromJavaUtilDate() throws ParseException { + java.util.Date juDate = SIMPLE_DATE_FORMAT.parse("2016-09-18"); + Date gcDate = Date.fromJavaUtilDate(juDate); + assertThat(gcDate.getYear()).isEqualTo(2016); + assertThat(gcDate.getMonth()).isEqualTo(9); + assertThat(gcDate.getDayOfMonth()).isEqualTo(18); + } + + private void assertDescending(Date... dates) { + for (int i = 0; i < dates.length - 1; i++) { + assertThat(dates[i]).isEquivalentAccordingToCompareTo(dates[i]); + for (int j = i + 1; j < dates.length; j++) { + assertThat(dates[i]).isGreaterThan(dates[j]); + } + } + } +} diff --git a/java-core/google-cloud-core/src/test/java/com/google/cloud/ExceptionHandlerTest.java b/java-core/google-cloud-core/src/test/java/com/google/cloud/ExceptionHandlerTest.java new file mode 100644 index 0000000000..f5efcdd3d1 --- /dev/null +++ b/java-core/google-cloud-core/src/test/java/com/google/cloud/ExceptionHandlerTest.java @@ -0,0 +1,211 @@ +/* + * Copyright 2015 Google LLC + * + * Licensed under the Apache License, Version 2.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.google.cloud; + +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertThrows; +import static org.junit.jupiter.api.Assertions.assertTrue; +import static org.junit.jupiter.api.Assertions.fail; + +import com.google.cloud.ExceptionHandler.Interceptor; +import com.google.cloud.ExceptionHandler.Interceptor.RetryResult; +import java.io.FileNotFoundException; +import java.io.IOException; +import java.nio.channels.ClosedByInterruptException; +import java.util.concurrent.Callable; +import java.util.concurrent.atomic.AtomicReference; +import org.junit.jupiter.api.Test; + +/** Tests for {@link ExceptionHandler}. */ +class ExceptionHandlerTest { + + @Test + void testVerifyCaller() { + class A implements Callable { + @Override + public Object call() throws IOException, InterruptedException { + return null; + } + } + + class B extends A {} + + class C extends A { + @Override + public Object call() throws FileNotFoundException { + return "c"; + } + } + + class D extends C { + @Override + public Object call() throws IllegalArgumentException { + return "d"; + } + } + + class E extends A { + @Override + public String call() throws NullPointerException { + return "e"; + } + } + + class F extends A { + @Override + public Object call() throws Error { + return "f"; + } + } + + // using default exception handler (retry upon any non-runtime exceptions) + ExceptionHandler handler = ExceptionHandler.getDefaultInstance(); + assertValidCallable(new A(), handler); + assertValidCallable(new B(), handler); + assertValidCallable(new C(), handler); + assertValidCallable(new D(), handler); + assertValidCallable(new E(), handler); + assertInvalidCallable(new F(), handler); + + handler = + ExceptionHandler.newBuilder() + .retryOn(FileNotFoundException.class, NullPointerException.class) + .build(); + assertInvalidCallable(new A(), handler); + assertInvalidCallable(new B(), handler); + assertValidCallable(new C(), handler); + assertInvalidCallable(new D(), handler); + assertValidCallable(new E(), handler); + assertInvalidCallable(new F(), handler); + } + + private static void assertValidCallable(Callable callable, ExceptionHandler handler) { + handler.verifyCaller(callable); + } + + private static void assertInvalidCallable(Callable callable, ExceptionHandler handler) { + try { + handler.verifyCaller(callable); + fail("Expected RetryHelper constructor to fail"); + } catch (IllegalArgumentException ex) { + // expected + } + } + + @Test + void testShouldTry() { + ExceptionHandler handler = ExceptionHandler.newBuilder().retryOn(IOException.class).build(); + assertTrue(handler.shouldRetry(new IOException(), null)); + assertTrue(handler.shouldRetry(new ClosedByInterruptException(), null)); + assertFalse(handler.shouldRetry(new RuntimeException(), null)); + + ExceptionHandler.Builder builder = + ExceptionHandler.newBuilder() + .retryOn(IOException.class, NullPointerException.class) + .abortOn( + RuntimeException.class, + ClosedByInterruptException.class, + InterruptedException.class); + + handler = builder.build(); + assertTrue(handler.shouldRetry(new IOException(), null)); + assertFalse(handler.shouldRetry(new ClosedByInterruptException(), null)); + assertFalse(handler.shouldRetry(new InterruptedException(), null)); + assertFalse(handler.shouldRetry(new RuntimeException(), null)); + assertTrue(handler.shouldRetry(new NullPointerException(), null)); + + final AtomicReference before = new AtomicReference<>(RetryResult.NO_RETRY); + @SuppressWarnings("serial") + Interceptor interceptor = + new Interceptor() { + + @Override + public RetryResult afterEval(Exception exception, RetryResult retryResult) { + return retryResult == RetryResult.NO_RETRY ? RetryResult.RETRY : RetryResult.NO_RETRY; + } + + @Override + public RetryResult beforeEval(Exception exception) { + return before.get(); + } + }; + + builder.addInterceptors(interceptor); + handler = builder.build(); + assertFalse(handler.shouldRetry(new IOException(), null)); + assertFalse(handler.shouldRetry(new ClosedByInterruptException(), null)); + assertFalse(handler.shouldRetry(new InterruptedException(), null)); + assertFalse(handler.shouldRetry(new RuntimeException(), null)); + assertFalse(handler.shouldRetry(new NullPointerException(), null)); + + before.set(RetryResult.RETRY); + assertTrue(handler.shouldRetry(new IOException(), null)); + assertTrue(handler.shouldRetry(new ClosedByInterruptException(), null)); + assertTrue(handler.shouldRetry(new InterruptedException(), null)); + assertTrue(handler.shouldRetry(new RuntimeException(), null)); + assertTrue(handler.shouldRetry(new NullPointerException(), null)); + + before.set(RetryResult.CONTINUE_EVALUATION); + assertFalse(handler.shouldRetry(new IOException(), null)); + assertTrue(handler.shouldRetry(new ClosedByInterruptException(), null)); + assertTrue(handler.shouldRetry(new InterruptedException(), null)); + assertTrue(handler.shouldRetry(new RuntimeException(), null)); + assertFalse(handler.shouldRetry(new NullPointerException(), null)); + } + + @Test + void testNullRetryResultFromBeforeEval() { + @SuppressWarnings("serial") + Interceptor interceptor = + new Interceptor() { + + @Override + public RetryResult beforeEval(Exception exception) { + return null; + } + + @Override + public RetryResult afterEval(Exception exception, RetryResult retryResult) { + return RetryResult.CONTINUE_EVALUATION; + } + }; + + ExceptionHandler handler = ExceptionHandler.newBuilder().addInterceptors(interceptor).build(); + assertThrows(NullPointerException.class, () -> handler.shouldRetry(new Exception(), null)); + } + + @Test + void testNullRetryResultFromAfterEval() { + @SuppressWarnings("serial") + Interceptor interceptor = + new Interceptor() { + + @Override + public RetryResult beforeEval(Exception exception) { + return RetryResult.CONTINUE_EVALUATION; + } + + @Override + public RetryResult afterEval(Exception exception, RetryResult retryResult) { + return null; + } + }; + + ExceptionHandler handler = ExceptionHandler.newBuilder().addInterceptors(interceptor).build(); + assertThrows(NullPointerException.class, () -> handler.shouldRetry(new Exception(), null)); + } +} diff --git a/java-core/google-cloud-core/src/test/java/com/google/cloud/FieldSelectorHelperTest.java b/java-core/google-cloud-core/src/test/java/com/google/cloud/FieldSelectorHelperTest.java new file mode 100644 index 0000000000..1a617e9290 --- /dev/null +++ b/java-core/google-cloud-core/src/test/java/com/google/cloud/FieldSelectorHelperTest.java @@ -0,0 +1,103 @@ +/* + * Copyright 2016 Google LLC + * + * Licensed under the Apache License, Version 2.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.google.cloud; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertTrue; + +import com.google.cloud.FieldSelector.Helper; +import com.google.common.collect.ImmutableList; +import java.util.List; +import org.junit.jupiter.api.Test; + +class FieldSelectorHelperTest { + + private static final FieldSelector FIELD1 = + new FieldSelector() { + @Override + public String getSelector() { + return "field1"; + } + }; + private static final FieldSelector FIELD2 = + new FieldSelector() { + @Override + public String getSelector() { + return "field2"; + } + }; + private static final FieldSelector FIELD3 = + new FieldSelector() { + @Override + public String getSelector() { + return "field3"; + } + }; + private static final String[] FIRST_LEVEL_FIELDS = {"firstLevel1", "firstLevel2"}; + private static final List REQUIRED_FIELDS = ImmutableList.of(FIELD1, FIELD2); + private static final String CONTAINER = "container"; + + @Test + void testSelector() { + String selector = Helper.selector(REQUIRED_FIELDS, FIELD3); + assertTrue(selector.contains("field1")); + assertTrue(selector.contains("field2")); + assertTrue(selector.contains("field3")); + assertEquals(20, selector.length()); + } + + @Test + void testListSelector() { + String selector = Helper.listSelector(CONTAINER, REQUIRED_FIELDS, FIELD3); + assertTrue(selector.startsWith("nextPageToken,container(")); + assertTrue(selector.contains("field1")); + assertTrue(selector.contains("field2")); + assertTrue(selector.contains("field3")); + assertTrue(selector.endsWith(")")); + assertEquals(45, selector.length()); + } + + @Test + void testListSelectorWithExtraFields() { + String selector = + Helper.listSelector(CONTAINER, REQUIRED_FIELDS, new FieldSelector[] {FIELD3}, "field4"); + assertTrue(selector.startsWith("nextPageToken,container(")); + assertTrue(selector.contains("field1")); + assertTrue(selector.contains("field2")); + assertTrue(selector.contains("field3")); + assertTrue(selector.contains("field4")); + assertTrue(selector.endsWith(")")); + assertEquals(52, selector.length()); + } + + @Test + void testListSelectorWithFirstLevelFields() { + String selector = + Helper.listSelector( + FIRST_LEVEL_FIELDS, CONTAINER, REQUIRED_FIELDS, new FieldSelector[] {FIELD3}, "field4"); + assertTrue(selector.contains("firstLevel1")); + assertTrue(selector.contains("firstLevel2")); + assertTrue(selector.contains("nextPageToken")); + assertTrue(selector.contains("container(")); + assertTrue(selector.contains("field1")); + assertTrue(selector.contains("field2")); + assertTrue(selector.contains("field3")); + assertTrue(selector.contains("field4")); + assertTrue(selector.endsWith(")")); + assertEquals(76, selector.length()); + } +} diff --git a/java-core/google-cloud-core/src/test/java/com/google/cloud/IdentityTest.java b/java-core/google-cloud-core/src/test/java/com/google/cloud/IdentityTest.java new file mode 100644 index 0000000000..5f4de7fef3 --- /dev/null +++ b/java-core/google-cloud-core/src/test/java/com/google/cloud/IdentityTest.java @@ -0,0 +1,162 @@ +/* + * Copyright 2016 Google LLC + * + * Licensed under the Apache License, Version 2.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.google.cloud; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNull; +import static org.junit.jupiter.api.Assertions.assertThrows; + +import org.junit.jupiter.api.Test; + +class IdentityTest { + + private static final Identity ALL_USERS = Identity.allUsers(); + private static final Identity ALL_AUTH_USERS = Identity.allAuthenticatedUsers(); + private static final Identity USER = Identity.user("abc@gmail.com"); + private static final Identity SERVICE_ACCOUNT = + Identity.serviceAccount("service-account@gmail.com"); + private static final Identity GROUP = Identity.group("group@gmail.com"); + private static final Identity DOMAIN = Identity.domain("google.com"); + private static final Identity PROJECT_OWNER = Identity.projectOwner("my-sample-project"); + private static final Identity PROJECT_EDITOR = Identity.projectEditor("my-sample-project"); + private static final Identity PROJECT_VIEWER = Identity.projectViewer("my-sample-project"); + + @Test + void testAllUsers() { + assertEquals(Identity.Type.ALL_USERS, ALL_USERS.getType()); + assertNull(ALL_USERS.getValue()); + } + + @Test + void testAllAuthenticatedUsers() { + assertEquals(Identity.Type.ALL_AUTHENTICATED_USERS, ALL_AUTH_USERS.getType()); + assertNull(ALL_AUTH_USERS.getValue()); + } + + @Test + void testUser() { + assertEquals(Identity.Type.USER, USER.getType()); + assertEquals("abc@gmail.com", USER.getValue()); + } + + @Test + void testUserNullEmail() { + assertThrows(NullPointerException.class, () -> Identity.user(null)); + } + + @Test + void testServiceAccount() { + assertEquals(Identity.Type.SERVICE_ACCOUNT, SERVICE_ACCOUNT.getType()); + assertEquals("service-account@gmail.com", SERVICE_ACCOUNT.getValue()); + } + + @Test + void testServiceAccountNullEmail() { + assertThrows(NullPointerException.class, () -> Identity.serviceAccount(null)); + } + + @Test + void testGroup() { + assertEquals(Identity.Type.GROUP, GROUP.getType()); + assertEquals("group@gmail.com", GROUP.getValue()); + } + + @Test + void testGroupNullEmail() { + assertThrows(NullPointerException.class, () -> Identity.group(null)); + } + + @Test + void testDomain() { + assertEquals(Identity.Type.DOMAIN, DOMAIN.getType()); + assertEquals("google.com", DOMAIN.getValue()); + } + + @Test + void testDomainNullId() { + assertThrows(NullPointerException.class, () -> Identity.domain(null)); + } + + @Test + void testProjectOwner() { + assertEquals(Identity.Type.PROJECT_OWNER, PROJECT_OWNER.getType()); + assertEquals("my-sample-project", PROJECT_OWNER.getValue()); + } + + @Test + void testProjectOwnerNullId() { + assertThrows(NullPointerException.class, () -> Identity.projectOwner(null)); + } + + @Test + void testProjectEditor() { + assertEquals(Identity.Type.PROJECT_EDITOR, PROJECT_EDITOR.getType()); + assertEquals("my-sample-project", PROJECT_EDITOR.getValue()); + } + + @Test + void testProjectEditorNullId() { + assertThrows(NullPointerException.class, () -> Identity.projectEditor(null)); + } + + @Test + void testProjectViewer() { + assertEquals(Identity.Type.PROJECT_VIEWER, PROJECT_VIEWER.getType()); + assertEquals("my-sample-project", PROJECT_VIEWER.getValue()); + } + + @Test + void testProjectViewerNullId() { + assertThrows(NullPointerException.class, () -> Identity.projectViewer(null)); + } + + @Test + void testIdentityToAndFromPb() { + compareIdentities(ALL_USERS, Identity.valueOf(ALL_USERS.strValue())); + compareIdentities(ALL_AUTH_USERS, Identity.valueOf(ALL_AUTH_USERS.strValue())); + compareIdentities(USER, Identity.valueOf(USER.strValue())); + compareIdentities(SERVICE_ACCOUNT, Identity.valueOf(SERVICE_ACCOUNT.strValue())); + compareIdentities(GROUP, Identity.valueOf(GROUP.strValue())); + compareIdentities(DOMAIN, Identity.valueOf(DOMAIN.strValue())); + compareIdentities(PROJECT_OWNER, Identity.valueOf(PROJECT_OWNER.strValue())); + compareIdentities(PROJECT_EDITOR, Identity.valueOf(PROJECT_EDITOR.strValue())); + compareIdentities(PROJECT_VIEWER, Identity.valueOf(PROJECT_VIEWER.strValue())); + } + + @Test + void testValueOfEmpty() { + assertThrows(IllegalArgumentException.class, () -> Identity.valueOf("")); + } + + @Test + void testUnrecognizedToString() { + assertEquals("a:b", Identity.valueOf("a:b").strValue()); + } + + @Test + void testValueOfThreePart() { + Identity identity = Identity.valueOf("a:b:c"); + assertEquals("A", identity.getType().name()); + assertEquals("b:c", identity.getValue()); + } + + private void compareIdentities(Identity expected, Identity actual) { + assertEquals(expected, actual); + assertEquals(expected.getType(), actual.getType()); + assertEquals(expected.getValue(), actual.getValue()); + } +} diff --git a/java-core/google-cloud-core/src/test/java/com/google/cloud/MonitoredResourceDescriptorTest.java b/java-core/google-cloud-core/src/test/java/com/google/cloud/MonitoredResourceDescriptorTest.java new file mode 100644 index 0000000000..042ba30feb --- /dev/null +++ b/java-core/google-cloud-core/src/test/java/com/google/cloud/MonitoredResourceDescriptorTest.java @@ -0,0 +1,123 @@ +/* + * Copyright 2016 Google LLC + * + * Licensed under the Apache License, Version 2.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.google.cloud; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNull; + +import com.google.cloud.MonitoredResourceDescriptor.LabelDescriptor; +import com.google.cloud.MonitoredResourceDescriptor.LabelDescriptor.ValueType; +import com.google.common.collect.ImmutableList; +import java.util.List; +import org.junit.jupiter.api.Test; + +class MonitoredResourceDescriptorTest { + + private static final LabelDescriptor BOOLEAN_LABEL = + new LabelDescriptor("booleanKey", ValueType.BOOL, "Boolean label"); + private static final LabelDescriptor STRING_LABEL = + new LabelDescriptor("stringKey", ValueType.STRING, "String label"); + private static final LabelDescriptor INT_LABEL = + new LabelDescriptor("intKey", ValueType.INT64, "Int label"); + private static final LabelDescriptor INT_LABEL_NO_DESCRIPTION = + new LabelDescriptor("intKey", ValueType.INT64, null); + private static final String TYPE = "resource_type"; + private static final String NAME = "resourceName"; + private static final String DISPLAY_NAME = "Display Name"; + private static final String DESCRIPTION = "Resource Descriptor"; + private static final List LABELS = + ImmutableList.of(BOOLEAN_LABEL, STRING_LABEL, INT_LABEL); + private static final MonitoredResourceDescriptor RESOURCE_DESCRIPTOR = + MonitoredResourceDescriptor.newBuilder(TYPE) + .setName(NAME) + .setDisplayName(DISPLAY_NAME) + .setDescription(DESCRIPTION) + .setLabels(LABELS) + .build(); + + @Test + void testLabelDescriptor() { + assertEquals("booleanKey", BOOLEAN_LABEL.getKey()); + assertEquals(ValueType.BOOL, BOOLEAN_LABEL.getValueType()); + assertEquals("Boolean label", BOOLEAN_LABEL.getDescription()); + assertEquals("stringKey", STRING_LABEL.getKey()); + assertEquals(ValueType.STRING, STRING_LABEL.getValueType()); + assertEquals("String label", STRING_LABEL.getDescription()); + assertEquals("intKey", INT_LABEL.getKey()); + assertEquals(ValueType.INT64, INT_LABEL.getValueType()); + assertEquals("Int label", INT_LABEL.getDescription()); + assertEquals("intKey", INT_LABEL_NO_DESCRIPTION.getKey()); + assertEquals(ValueType.INT64, INT_LABEL_NO_DESCRIPTION.getValueType()); + assertNull(INT_LABEL_NO_DESCRIPTION.getDescription()); + } + + @Test + void testBuilder() { + assertEquals(TYPE, RESOURCE_DESCRIPTOR.getType()); + assertEquals(NAME, RESOURCE_DESCRIPTOR.getName()); + assertEquals(DISPLAY_NAME, RESOURCE_DESCRIPTOR.getDisplayName()); + assertEquals(DESCRIPTION, RESOURCE_DESCRIPTOR.getDescription()); + assertEquals(LABELS, RESOURCE_DESCRIPTOR.getLabels()); + MonitoredResourceDescriptor resourceDescriptor = + MonitoredResourceDescriptor.newBuilder(TYPE).build(); + assertEquals(TYPE, resourceDescriptor.getType()); + assertNull(resourceDescriptor.getName()); + assertNull(resourceDescriptor.getDisplayName()); + assertNull(resourceDescriptor.getDescription()); + assertEquals(ImmutableList.of(), resourceDescriptor.getLabels()); + } + + @Test + void testToAndFromPbLabelDescriptor() { + compareLabelDescriptor(BOOLEAN_LABEL, LabelDescriptor.fromPb(BOOLEAN_LABEL.toPb())); + compareLabelDescriptor(STRING_LABEL, LabelDescriptor.fromPb(STRING_LABEL.toPb())); + compareLabelDescriptor(INT_LABEL, LabelDescriptor.fromPb(INT_LABEL.toPb())); + compareLabelDescriptor( + INT_LABEL_NO_DESCRIPTION, LabelDescriptor.fromPb(INT_LABEL_NO_DESCRIPTION.toPb())); + } + + @Test + void testToAndFromPb() { + compareResourceDescriptor( + RESOURCE_DESCRIPTOR, MonitoredResourceDescriptor.fromPb(RESOURCE_DESCRIPTOR.toPb())); + MonitoredResourceDescriptor resourceDescriptor = + MonitoredResourceDescriptor.newBuilder(TYPE).build(); + compareResourceDescriptor( + resourceDescriptor, MonitoredResourceDescriptor.fromPb(resourceDescriptor.toPb())); + } + + private void compareLabelDescriptor(LabelDescriptor expected, LabelDescriptor value) { + assertEquals(expected, value); + assertEquals(expected.getKey(), value.getKey()); + assertEquals(expected.getValueType(), value.getValueType()); + assertEquals(expected.getDescription(), value.getDescription()); + assertEquals(expected.hashCode(), value.hashCode()); + assertEquals(expected.toString(), value.toString()); + } + + private void compareResourceDescriptor( + MonitoredResourceDescriptor expected, MonitoredResourceDescriptor value) { + assertEquals(expected, value); + assertEquals(expected.getType(), value.getType()); + assertEquals(expected.getName(), value.getName()); + assertEquals(expected.getDisplayName(), value.getDisplayName()); + assertEquals(expected.getDescription(), value.getDescription()); + assertEquals(expected.getLabels(), value.getLabels()); + assertEquals(expected.hashCode(), value.hashCode()); + assertEquals(expected.toString(), value.toString()); + } +} diff --git a/java-core/google-cloud-core/src/test/java/com/google/cloud/MonitoredResourceTest.java b/java-core/google-cloud-core/src/test/java/com/google/cloud/MonitoredResourceTest.java new file mode 100644 index 0000000000..9c69bf7b0b --- /dev/null +++ b/java-core/google-cloud-core/src/test/java/com/google/cloud/MonitoredResourceTest.java @@ -0,0 +1,95 @@ +/* + * Copyright 2016 Google LLC + * + * Licensed under the Apache License, Version 2.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.google.cloud; + +import static org.junit.jupiter.api.Assertions.assertEquals; + +import com.google.common.collect.ImmutableMap; +import java.util.Map; +import org.junit.jupiter.api.Test; + +class MonitoredResourceTest { + + private static final String TYPE = "cloudsql_database"; + private static final Map LABELS = + ImmutableMap.of("dataset-id", "myDataset", "zone", "myZone"); + private static final MonitoredResource MONITORED_RESOURCE = + MonitoredResource.newBuilder(TYPE).setLabels(LABELS).build(); + + @Test + void testBuilder() { + assertEquals(TYPE, MONITORED_RESOURCE.getType()); + assertEquals(LABELS, MONITORED_RESOURCE.getLabels()); + MonitoredResource monitoredResource = + MonitoredResource.newBuilder(TYPE) + .addLabel("dataset-id", "myDataset") + .addLabel("zone", "myZone") + .build(); + assertEquals(TYPE, monitoredResource.getType()); + assertEquals(LABELS, monitoredResource.getLabels()); + compareMonitoredResource(MONITORED_RESOURCE, monitoredResource); + monitoredResource = + MonitoredResource.newBuilder(TYPE) + .setType("global") + .addLabel("dataset-id", "myDataset") + .addLabel("zone", "myZone") + .clearLabels() + .build(); + assertEquals("global", monitoredResource.getType()); + assertEquals(ImmutableMap.of(), monitoredResource.getLabels()); + } + + @Test + void testToBuilder() { + compareMonitoredResource(MONITORED_RESOURCE, MONITORED_RESOURCE.toBuilder().build()); + MonitoredResource monitoredResource = + MONITORED_RESOURCE.toBuilder().setType("global").clearLabels().build(); + assertEquals("global", monitoredResource.getType()); + assertEquals(ImmutableMap.of(), monitoredResource.getLabels()); + monitoredResource = + monitoredResource.toBuilder() + .setType(TYPE) + .setLabels(ImmutableMap.of("dataset-id", "myDataset")) + .addLabel("zone", "myZone") + .build(); + compareMonitoredResource(MONITORED_RESOURCE, monitoredResource); + } + + @Test + void testOf() { + MonitoredResource monitoredResource = MonitoredResource.of(TYPE, LABELS); + assertEquals(TYPE, monitoredResource.getType()); + assertEquals(LABELS, monitoredResource.getLabels()); + compareMonitoredResource(MONITORED_RESOURCE, monitoredResource); + } + + @Test + void testToAndFromPb() { + compareMonitoredResource( + MONITORED_RESOURCE, MonitoredResource.fromPb(MONITORED_RESOURCE.toPb())); + MonitoredResource monitoredResource = + MonitoredResource.of(TYPE, ImmutableMap.of()); + compareMonitoredResource(monitoredResource, MonitoredResource.fromPb(monitoredResource.toPb())); + } + + private void compareMonitoredResource(MonitoredResource expected, MonitoredResource value) { + assertEquals(expected, value); + assertEquals(expected.getType(), value.getType()); + assertEquals(expected.getLabels(), value.getLabels()); + assertEquals(expected.hashCode(), value.hashCode()); + } +} diff --git a/java-core/google-cloud-core/src/test/java/com/google/cloud/PageImplTest.java b/java-core/google-cloud-core/src/test/java/com/google/cloud/PageImplTest.java new file mode 100644 index 0000000000..db11d66951 --- /dev/null +++ b/java-core/google-cloud-core/src/test/java/com/google/cloud/PageImplTest.java @@ -0,0 +1,64 @@ +/* + * Copyright 2015 Google LLC + * + * Licensed under the Apache License, Version 2.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.google.cloud; + +import static org.junit.jupiter.api.Assertions.assertEquals; + +import com.google.api.gax.paging.Page; +import com.google.common.collect.ImmutableList; +import org.junit.jupiter.api.Test; + +class PageImplTest { + + private static final ImmutableList VALUES = ImmutableList.of("1", "2"); + private static final ImmutableList NEXT_VALUES = ImmutableList.of("3", "4"); + private static final ImmutableList ALL_VALUES = + ImmutableList.builder().addAll(VALUES).addAll(NEXT_VALUES).build(); + + private static class TestPageFetcher implements PageImpl.NextPageFetcher { + private static final long serialVersionUID = -8316752901403429976L; + + private final PageImpl nextResult; + + TestPageFetcher(PageImpl nextResult) { + this.nextResult = nextResult; + } + + @Override + public Page getNextPage() { + return nextResult; + } + } + + @Test + void testPage() { + final PageImpl nextResult = new PageImpl<>(null, "c", NEXT_VALUES); + PageImpl.NextPageFetcher fetcher = new TestPageFetcher(nextResult); + PageImpl result = new PageImpl<>(fetcher, "c", VALUES); + assertEquals(nextResult, result.getNextPage()); + assertEquals("c", result.getNextPageToken()); + assertEquals(VALUES, result.getValues()); + } + + @Test + void testIterateAll() { + final PageImpl nextResult = new PageImpl<>(null, "c", NEXT_VALUES); + PageImpl.NextPageFetcher fetcher = new TestPageFetcher(nextResult); + PageImpl result = new PageImpl<>(fetcher, "c", VALUES); + assertEquals(ALL_VALUES, ImmutableList.copyOf(result.iterateAll())); + } +} diff --git a/java-core/google-cloud-core/src/test/java/com/google/cloud/PolicyTest.java b/java-core/google-cloud-core/src/test/java/com/google/cloud/PolicyTest.java new file mode 100644 index 0000000000..e71be34388 --- /dev/null +++ b/java-core/google-cloud-core/src/test/java/com/google/cloud/PolicyTest.java @@ -0,0 +1,227 @@ +/* + * Copyright 2016 Google LLC + * + * Licensed under the Apache License, Version 2.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.google.cloud; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotEquals; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertNull; +import static org.junit.jupiter.api.Assertions.assertTrue; +import static org.junit.jupiter.api.Assertions.fail; + +import com.google.cloud.Policy.DefaultMarshaller; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.ImmutableSet; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Set; +import org.junit.jupiter.api.Test; + +class PolicyTest { + + private static final Identity ALL_USERS = Identity.allUsers(); + private static final Identity ALL_AUTH_USERS = Identity.allAuthenticatedUsers(); + private static final Identity USER = Identity.user("abc@gmail.com"); + private static final Identity SERVICE_ACCOUNT = + Identity.serviceAccount("service-account@gmail.com"); + private static final Identity GROUP = Identity.group("group@gmail.com"); + private static final Identity DOMAIN = Identity.domain("google.com"); + private static final Role VIEWER = Role.viewer(); + private static final Role EDITOR = Role.editor(); + private static final Role OWNER = Role.owner(); + private static final Map> BINDINGS = + ImmutableMap.of( + VIEWER, + ImmutableSet.of(USER, SERVICE_ACCOUNT, ALL_USERS), + EDITOR, + ImmutableSet.of(ALL_AUTH_USERS, GROUP, DOMAIN)); + private static final Policy SIMPLE_POLICY = + Policy.newBuilder() + .addIdentity(VIEWER, USER, SERVICE_ACCOUNT, ALL_USERS) + .addIdentity(EDITOR, ALL_AUTH_USERS, GROUP, DOMAIN) + .build(); + private static final Policy FULL_POLICY = + Policy.newBuilder() + .setBindings(SIMPLE_POLICY.getBindings()) + .setEtag("etag") + .setVersion(1) + .build(); + + @Test + void testBuilder() { + assertEquals(BINDINGS, SIMPLE_POLICY.getBindings()); + assertNull(SIMPLE_POLICY.getEtag()); + assertEquals(0, SIMPLE_POLICY.getVersion()); + assertEquals(BINDINGS, FULL_POLICY.getBindings()); + assertEquals("etag", FULL_POLICY.getEtag()); + assertEquals(1, FULL_POLICY.getVersion()); + Map> editorBinding = + ImmutableMap.>builder().put(EDITOR, BINDINGS.get(EDITOR)).build(); + Policy policy = FULL_POLICY.toBuilder().setBindings(editorBinding).build(); + assertEquals(editorBinding, policy.getBindings()); + assertEquals("etag", policy.getEtag()); + assertEquals(1, policy.getVersion()); + policy = SIMPLE_POLICY.toBuilder().removeRole(EDITOR).build(); + assertEquals(ImmutableMap.of(VIEWER, BINDINGS.get(VIEWER)), policy.getBindings()); + assertNull(policy.getEtag()); + assertEquals(0, policy.getVersion()); + policy = + policy.toBuilder() + .removeIdentity(VIEWER, USER, ALL_USERS) + .addIdentity(VIEWER, DOMAIN, GROUP) + .build(); + assertEquals( + ImmutableMap.of(VIEWER, ImmutableSet.of(SERVICE_ACCOUNT, DOMAIN, GROUP)), + policy.getBindings()); + assertNull(policy.getEtag()); + assertEquals(0, policy.getVersion()); + policy = + Policy.newBuilder() + .removeIdentity(VIEWER, USER) + .addIdentity(OWNER, USER, SERVICE_ACCOUNT) + .addIdentity(EDITOR, GROUP) + .removeIdentity(EDITOR, GROUP) + .build(); + assertEquals( + ImmutableMap.of(OWNER, ImmutableSet.of(USER, SERVICE_ACCOUNT)), policy.getBindings()); + assertNull(policy.getEtag()); + assertEquals(0, policy.getVersion()); + } + + @Test + void testPolicyOrderShouldNotMatter() { + Role role1 = Role.of("role1"); + Identity identity1 = Identity.user("user1@example.com"); + Role role2 = Role.of("role2"); + Identity identity2 = Identity.user("user2@example.com"); + Policy policy1 = + Policy.newBuilder().addIdentity(role1, identity1).addIdentity(role2, identity2).build(); + Policy policy2 = + Policy.newBuilder().addIdentity(role2, identity2).addIdentity(role1, identity1).build(); + assertEquals(policy1, policy2); + } + + @Test + void testPolicyMultipleAddIdentitiesShouldNotMatter() { + Role role1 = Role.of("role1"); + Identity identity1 = Identity.user("user1@example.com"); + Role role2 = Role.of("role2"); + Identity identity2 = Identity.user("user2@example.com"); + Policy policy1 = + Policy.newBuilder() + .addIdentity(role1, identity1) + .addIdentity(role2, identity2) + .addIdentity(role2, identity2) + .build(); + Policy policy2 = + Policy.newBuilder().addIdentity(role2, identity2).addIdentity(role1, identity1).build(); + assertEquals(policy1, policy2); + } + + @Test + void testIllegalPolicies() { + try { + Policy.newBuilder().addIdentity(null, USER); + fail("Null role should cause exception."); + } catch (NullPointerException ex) { + assertEquals("The role cannot be null.", ex.getMessage()); + } + try { + Policy.newBuilder().addIdentity(VIEWER, null, USER); + fail("Null identity should cause exception."); + } catch (NullPointerException ex) { + assertEquals("Null identities are not permitted.", ex.getMessage()); + } + try { + Policy.newBuilder().addIdentity(VIEWER, USER, (Identity[]) null); + fail("Null identity should cause exception."); + } catch (NullPointerException ex) { + assertEquals("Null identities are not permitted.", ex.getMessage()); + } + try { + Policy.newBuilder().setBindings((Map>) null); + fail("Null bindings map should cause exception."); + } catch (NullPointerException ex) { + assertEquals("The provided map of bindings cannot be null.", ex.getMessage()); + } + try { + Map> bindings = new HashMap<>(); + bindings.put(VIEWER, null); + Policy.newBuilder().setBindings(bindings); + fail("Null set of identities should cause exception."); + } catch (NullPointerException ex) { + assertEquals("A role cannot be assigned to a null set of identities.", ex.getMessage()); + } + try { + Map> bindings = new HashMap<>(); + Set identities = new HashSet<>(); + identities.add(null); + bindings.put(VIEWER, identities); + Policy.newBuilder().setBindings(bindings); + fail("Null identity should cause exception."); + } catch (IllegalArgumentException ex) { + assertEquals("Null identities are not permitted.", ex.getMessage()); + } + } + + @Test + void testEqualsHashCode() { + assertNotNull(FULL_POLICY); + Policy emptyPolicy = Policy.newBuilder().build(); + Policy anotherPolicy = Policy.newBuilder().build(); + assertEquals(emptyPolicy, anotherPolicy); + assertEquals(emptyPolicy.hashCode(), anotherPolicy.hashCode()); + assertNotEquals(FULL_POLICY, SIMPLE_POLICY); + assertNotEquals(FULL_POLICY.hashCode(), SIMPLE_POLICY.hashCode()); + Policy copy = SIMPLE_POLICY.toBuilder().build(); + assertEquals(SIMPLE_POLICY, copy); + assertEquals(SIMPLE_POLICY.hashCode(), copy.hashCode()); + } + + @Test + void testBindings() { + assertTrue(Policy.newBuilder().build().getBindings().isEmpty()); + assertEquals(BINDINGS, SIMPLE_POLICY.getBindings()); + } + + @Test + void testEtag() { + assertNull(SIMPLE_POLICY.getEtag()); + assertEquals("etag", FULL_POLICY.getEtag()); + } + + @Test + void testVersion() { + assertEquals(0, SIMPLE_POLICY.getVersion()); + assertEquals(1, FULL_POLICY.getVersion()); + } + + @Test + void testDefaultMarshaller() { + DefaultMarshaller marshaller = new DefaultMarshaller(); + Policy emptyPolicy = Policy.newBuilder().build(); + assertEquals(emptyPolicy, marshaller.fromPb(marshaller.toPb(emptyPolicy))); + assertEquals(SIMPLE_POLICY, marshaller.fromPb(marshaller.toPb(SIMPLE_POLICY))); + assertEquals(FULL_POLICY, marshaller.fromPb(marshaller.toPb(FULL_POLICY))); + com.google.iam.v1.Policy policyPb = com.google.iam.v1.Policy.getDefaultInstance(); + Policy policy = marshaller.fromPb(policyPb); + assertTrue(policy.getBindings().isEmpty()); + assertNull(policy.getEtag()); + assertEquals(0, policy.getVersion()); + } +} diff --git a/java-core/google-cloud-core/src/test/java/com/google/cloud/PolicyV3Test.java b/java-core/google-cloud-core/src/test/java/com/google/cloud/PolicyV3Test.java new file mode 100644 index 0000000000..50a6366ac6 --- /dev/null +++ b/java-core/google-cloud-core/src/test/java/com/google/cloud/PolicyV3Test.java @@ -0,0 +1,279 @@ +/* + * 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. + */ + +package com.google.cloud; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotEquals; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertNull; +import static org.junit.jupiter.api.Assertions.assertTrue; +import static org.junit.jupiter.api.Assertions.fail; + +import com.google.cloud.Policy.DefaultMarshaller; +import com.google.common.collect.ImmutableList; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Iterator; +import java.util.List; +import org.junit.jupiter.api.Test; + +class PolicyV3Test { + + private static final String ALL_USERS = "allUsers"; + private static final String ALL_AUTH_USERS = "allAuthenticatedUsers"; + private static final String USER = "user:abc@gmail.com"; + private static final String SERVICE_ACCOUNT = "serviceAccount:service-account@gmail.com"; + private static final String GROUP = "group:group@gmail.com"; + private static final String DOMAIN = "domain:google.com"; + private static final String VIEWER = "roles/viewer"; + private static final String EDITOR = "roles/editor"; + private static final String OWNER = "roles/owner"; + private static final ImmutableList MEMBERS_LIST_1 = + ImmutableList.of(USER, SERVICE_ACCOUNT, ALL_USERS); + private static final ImmutableList MEMBERS_LIST_2 = + ImmutableList.of(ALL_AUTH_USERS, GROUP, DOMAIN); + + private static final Binding VIEWER_BINDING = + Binding.newBuilder().setRole(VIEWER).setMembers(MEMBERS_LIST_1).build(); + private static final Binding EDITOR_BINDING = + Binding.newBuilder().setRole(EDITOR).setMembers(MEMBERS_LIST_2).build(); + private static final ImmutableList BINDINGS_NO_CONDITIONS = + ImmutableList.of(VIEWER_BINDING, EDITOR_BINDING); + private static final Condition CONDITION = + Condition.newBuilder() + .setTitle("Condition") + .setDescription("Condition") + .setExpression("Expr") + .build(); + private static final ImmutableList BINDINGS_WITH_CONDITIONS = + ImmutableList.of(VIEWER_BINDING.toBuilder().setCondition(CONDITION).build(), EDITOR_BINDING); + private static final Policy FULL_POLICY_V1 = + Policy.newBuilder().setBindings(BINDINGS_NO_CONDITIONS).setEtag("etag").setVersion(1).build(); + + private static final Policy FULL_POLICY_V3 = + Policy.newBuilder() + .setBindings(BINDINGS_WITH_CONDITIONS) + .setEtag("etag") + .setVersion(3) + .build(); + + private static final Policy FULL_POLICY_V3_WITH_VERSION_1 = + Policy.newBuilder() + .setBindings(BINDINGS_WITH_CONDITIONS) + .setEtag("etag") + .setVersion(1) + .build(); + + @Test + void testBuilderV1() { + assertEquals(BINDINGS_NO_CONDITIONS, FULL_POLICY_V1.getBindingsList()); + assertEquals(1, FULL_POLICY_V1.getVersion()); + assertEquals("etag", FULL_POLICY_V1.getEtag()); + Policy policy = FULL_POLICY_V1.toBuilder().setBindings(BINDINGS_NO_CONDITIONS).build(); + assertEquals(BINDINGS_NO_CONDITIONS, policy.getBindingsList()); + assertEquals("etag", policy.getEtag()); + assertEquals(1, policy.getVersion()); + } + + @Test + void testBuilderV3WithConditions() { + assertEquals(BINDINGS_WITH_CONDITIONS, FULL_POLICY_V3.getBindingsList()); + assertEquals(3, FULL_POLICY_V3.getVersion()); + assertEquals("etag", FULL_POLICY_V3.getEtag()); + Policy policy = FULL_POLICY_V3.toBuilder().setBindings(BINDINGS_WITH_CONDITIONS).build(); + assertEquals(BINDINGS_WITH_CONDITIONS, policy.getBindingsList()); + assertEquals("etag", policy.getEtag()); + assertEquals(3, policy.getVersion()); + } + + @Test + void testBuilderV1ToV3Compatability() { + assertEquals(BINDINGS_WITH_CONDITIONS, FULL_POLICY_V3_WITH_VERSION_1.getBindingsList()); + assertEquals(1, FULL_POLICY_V3_WITH_VERSION_1.getVersion()); + assertEquals("etag", FULL_POLICY_V3_WITH_VERSION_1.getEtag()); + Policy policy = + FULL_POLICY_V3_WITH_VERSION_1.toBuilder() + .setBindings(BINDINGS_WITH_CONDITIONS) + .setVersion(3) + .build(); + assertEquals(BINDINGS_WITH_CONDITIONS, policy.getBindingsList()); + assertEquals("etag", policy.getEtag()); + assertEquals(3, policy.getVersion()); + } + + @Test + void removeMemberFromPolicy() { + assertEquals(3, FULL_POLICY_V3.getBindingsList().get(0).getMembers().size()); + List bindings = new ArrayList<>(FULL_POLICY_V3.getBindingsList()); + + for (int i = 0; i < bindings.size(); i++) { + Binding binding = bindings.get(i); + if (binding.getRole().equals(VIEWER)) { + bindings.set(i, binding.toBuilder().removeMembers(ALL_USERS).build()); + break; + } + } + + Policy updatedPolicy = FULL_POLICY_V3.toBuilder().setBindings(bindings).build(); + assertEquals(2, updatedPolicy.getBindingsList().get(0).getMembers().size()); + } + + @Test + void addMemberFromPolicy() { + assertEquals(3, FULL_POLICY_V3.getBindingsList().get(0).getMembers().size()); + List bindings = new ArrayList<>(FULL_POLICY_V3.getBindingsList()); + + for (int i = 0; i < bindings.size(); i++) { + Binding binding = bindings.get(i); + if (binding.getRole().equals(VIEWER)) { + bindings.set(i, binding.toBuilder().addMembers("user:example@example.com").build()); + } + } + + Policy updatedPolicy = FULL_POLICY_V3.toBuilder().setBindings(bindings).build(); + assertEquals(4, updatedPolicy.getBindingsList().get(0).getMembers().size()); + } + + @Test + void removeBindingFromPolicy() { + assertEquals(2, FULL_POLICY_V3.getBindingsList().size()); + List bindings = new ArrayList<>(FULL_POLICY_V3.getBindingsList()); + + Iterator iterator = bindings.iterator(); + while (iterator.hasNext()) { + Binding binding = (Binding) iterator.next(); + if (binding.getRole().equals(EDITOR) && binding.getCondition() == null) { + iterator.remove(); + break; + } + } + + Policy updatedPolicy = FULL_POLICY_V3.toBuilder().setBindings(bindings).build(); + assertEquals(1, updatedPolicy.getBindingsList().size()); + } + + @Test + void addBindingToPolicy() { + assertEquals(2, FULL_POLICY_V3.getBindingsList().size()); + List bindings = new ArrayList<>(FULL_POLICY_V3.getBindingsList()); + bindings.add(Binding.newBuilder().setRole(OWNER).setMembers(ImmutableList.of(USER)).build()); + Policy updatedPolicy = FULL_POLICY_V3.toBuilder().setBindings(bindings).build(); + assertEquals(3, updatedPolicy.getBindingsList().size()); + } + + @Test + void testIllegalPolicies() { + try { + Binding.newBuilder().setRole(null).build(); + fail("Null role should cause exception."); + } catch (NullPointerException ex) { + assertEquals("Null role", ex.getMessage()); + } + try { + FULL_POLICY_V3.toBuilder() + .setBindings( + Arrays.asList( + Binding.newBuilder() + .setRole("test") + .setMembers(Arrays.asList(null, "user")) + .build())) + .build(); + fail("Null member should cause exception."); + } catch (NullPointerException ex) { + assertEquals("at index 0", ex.getMessage()); + } + try { + FULL_POLICY_V3.getBindings(); + fail("getBindings() should cause exception with Policy V3."); + } catch (IllegalArgumentException ex) { + assertEquals( + "getBindings() is only supported with version 1 policies and non-conditional policies", + ex.getMessage()); + } + try { + FULL_POLICY_V3.toBuilder().addIdentity(Role.editor(), Identity.allUsers()); + fail("getBindings() should cause exception with Policy V3."); + } catch (IllegalArgumentException ex) { + assertEquals( + "addIdentity() is only supported with version 1 policies and non-conditional policies", + ex.getMessage()); + } + try { + FULL_POLICY_V3.toBuilder().removeIdentity(Role.editor(), Identity.allUsers()); + fail("getBindings() should cause exception with Policy V3."); + } catch (IllegalArgumentException ex) { + assertEquals( + "removeIdentity() is only supported with version 1 policies and non-conditional policies", + ex.getMessage()); + } + try { + FULL_POLICY_V3.toBuilder().setBindings(FULL_POLICY_V1.getBindings()); + fail("getBindings() should cause exception with Policy V3."); + } catch (IllegalArgumentException ex) { + assertEquals( + "setBindings() is only supported with version 1 policies and non-conditional policies", + ex.getMessage()); + } + } + + @Test + void testEqualsHashCode() { + assertNotNull(FULL_POLICY_V3); + Policy emptyPolicy = Policy.newBuilder().build(); + Policy anotherPolicy = Policy.newBuilder().build(); + assertEquals(emptyPolicy, anotherPolicy); + assertEquals(emptyPolicy.hashCode(), anotherPolicy.hashCode()); + assertNotEquals(FULL_POLICY_V3, FULL_POLICY_V1); + assertNotEquals(FULL_POLICY_V3.hashCode(), FULL_POLICY_V1.hashCode()); + Policy copy = FULL_POLICY_V1.toBuilder().build(); + assertEquals(FULL_POLICY_V1, copy); + assertEquals(FULL_POLICY_V1.hashCode(), copy.hashCode()); + } + + @Test + void testBindings() { + assertTrue(Policy.newBuilder().build().getBindingsList().isEmpty()); + assertEquals(BINDINGS_WITH_CONDITIONS, FULL_POLICY_V3.getBindingsList()); + } + + @Test + void testEtag() { + assertNotNull(FULL_POLICY_V3.getEtag()); + assertEquals("etag", FULL_POLICY_V3.getEtag()); + } + + @Test + void testVersion() { + assertEquals(1, FULL_POLICY_V1.getVersion()); + assertEquals(3, FULL_POLICY_V3.getVersion()); + assertEquals(1, FULL_POLICY_V3_WITH_VERSION_1.getVersion()); + } + + @Test + void testDefaultMarshaller() { + DefaultMarshaller marshaller = new DefaultMarshaller(); + Policy emptyPolicy = Policy.newBuilder().build(); + assertEquals(emptyPolicy, marshaller.fromPb(marshaller.toPb(emptyPolicy))); + assertEquals(FULL_POLICY_V3, marshaller.fromPb(marshaller.toPb(FULL_POLICY_V3))); + assertEquals(FULL_POLICY_V1, marshaller.fromPb(marshaller.toPb(FULL_POLICY_V1))); + com.google.iam.v1.Policy policyPb = com.google.iam.v1.Policy.getDefaultInstance(); + Policy policy = marshaller.fromPb(policyPb); + assertTrue(policy.getBindingsList().isEmpty()); + assertNull(policy.getEtag()); + assertEquals(0, policy.getVersion()); + } +} diff --git a/java-core/google-cloud-core/src/test/java/com/google/cloud/RetryOptionTest.java b/java-core/google-cloud-core/src/test/java/com/google/cloud/RetryOptionTest.java new file mode 100644 index 0000000000..192cc21f5f --- /dev/null +++ b/java-core/google-cloud-core/src/test/java/com/google/cloud/RetryOptionTest.java @@ -0,0 +1,149 @@ +/* + * Copyright 2016 Google LLC + * + * Licensed under the Apache License, Version 2.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.google.cloud; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotEquals; + +import com.google.api.gax.retrying.RetrySettings; +import java.time.Duration; +import org.junit.jupiter.api.Test; + +class RetryOptionTest { + private static final long TOTAL_TIMEOUT_MILLIS = 420l; + private static final long INITIAL_RETRY_DELAY_MILLIS = 42l; + private static final long MAX_RETRY_DELAY_MILLIS = 100l; + + private static final RetryOption TOTAL_TIMEOUT = + RetryOption.totalTimeoutDuration(Duration.ofMillis(TOTAL_TIMEOUT_MILLIS)); + private static final RetryOption INITIAL_RETRY_DELAY = + RetryOption.initialRetryDelayDuration(Duration.ofMillis(INITIAL_RETRY_DELAY_MILLIS)); + private static final RetryOption RETRY_DELAY_MULTIPLIER = RetryOption.retryDelayMultiplier(1.5); + private static final RetryOption MAX_RETRY_DELAY = + RetryOption.maxRetryDelayDuration(Duration.ofMillis(MAX_RETRY_DELAY_MILLIS)); + private static final RetryOption MAX_ATTEMPTS = RetryOption.maxAttempts(100); + private static final RetryOption JITTERED = RetryOption.jittered(false); + + private static final RetrySettings retrySettings = + RetrySettings.newBuilder() + .setTotalTimeoutDuration(Duration.ofMillis(420L)) + .setInitialRetryDelayDuration(Duration.ofMillis(42L)) + .setRetryDelayMultiplier(1.5) + .setMaxRetryDelayDuration(Duration.ofMillis(100)) + .setMaxAttempts(100) + .setJittered(false) + .build(); + + @Test + void testEqualsAndHashCode() { + assertEquals(TOTAL_TIMEOUT, TOTAL_TIMEOUT); + assertEquals(INITIAL_RETRY_DELAY, INITIAL_RETRY_DELAY); + assertEquals(RETRY_DELAY_MULTIPLIER, RETRY_DELAY_MULTIPLIER); + assertEquals(MAX_RETRY_DELAY, MAX_RETRY_DELAY); + assertEquals(MAX_ATTEMPTS, MAX_ATTEMPTS); + assertEquals(JITTERED, JITTERED); + + assertNotEquals(TOTAL_TIMEOUT, JITTERED); + assertNotEquals(INITIAL_RETRY_DELAY, TOTAL_TIMEOUT); + assertNotEquals(RETRY_DELAY_MULTIPLIER, INITIAL_RETRY_DELAY); + assertNotEquals(MAX_RETRY_DELAY, RETRY_DELAY_MULTIPLIER); + assertNotEquals(MAX_ATTEMPTS, MAX_RETRY_DELAY); + assertNotEquals(JITTERED, MAX_ATTEMPTS); + + RetryOption totalTimeout = RetryOption.totalTimeoutDuration(Duration.ofMillis(420L)); + RetryOption initialRetryDelay = RetryOption.initialRetryDelayDuration(Duration.ofMillis(42L)); + RetryOption retryDelayMultiplier = RetryOption.retryDelayMultiplier(1.5); + RetryOption maxRetryDelay = RetryOption.maxRetryDelayDuration(Duration.ofMillis(100)); + RetryOption maxAttempts = RetryOption.maxAttempts(100); + RetryOption jittered = RetryOption.jittered(false); + + assertEquals(TOTAL_TIMEOUT, totalTimeout); + assertEquals(INITIAL_RETRY_DELAY, initialRetryDelay); + assertEquals(RETRY_DELAY_MULTIPLIER, retryDelayMultiplier); + assertEquals(MAX_RETRY_DELAY, maxRetryDelay); + assertEquals(MAX_ATTEMPTS, maxAttempts); + assertEquals(JITTERED, jittered); + + assertEquals(TOTAL_TIMEOUT.hashCode(), totalTimeout.hashCode()); + assertEquals(INITIAL_RETRY_DELAY.hashCode(), initialRetryDelay.hashCode()); + assertEquals(RETRY_DELAY_MULTIPLIER.hashCode(), retryDelayMultiplier.hashCode()); + assertEquals(MAX_RETRY_DELAY.hashCode(), maxRetryDelay.hashCode()); + assertEquals(MAX_ATTEMPTS.hashCode(), maxAttempts.hashCode()); + assertEquals(JITTERED.hashCode(), jittered.hashCode()); + } + + @Test + void testMergeToSettings() { + RetrySettings defRetrySettings = RetrySettings.newBuilder().build(); + + assertEquals(defRetrySettings, RetryOption.mergeToSettings(defRetrySettings)); + + RetrySettings mergedRetrySettings = + RetryOption.mergeToSettings( + defRetrySettings, + TOTAL_TIMEOUT, + INITIAL_RETRY_DELAY, + RETRY_DELAY_MULTIPLIER, + MAX_RETRY_DELAY, + MAX_ATTEMPTS, + JITTERED); + assertEquals(retrySettings, mergedRetrySettings); + + defRetrySettings = + defRetrySettings.toBuilder().setTotalTimeoutDuration(Duration.ofMillis(420L)).build(); + mergedRetrySettings = RetryOption.mergeToSettings(defRetrySettings, TOTAL_TIMEOUT); + assertEquals(defRetrySettings, mergedRetrySettings); + + defRetrySettings = + defRetrySettings.toBuilder().setMaxRetryDelayDuration(Duration.ofMillis(100)).build(); + mergedRetrySettings = RetryOption.mergeToSettings(defRetrySettings, MAX_RETRY_DELAY); + assertEquals(defRetrySettings, mergedRetrySettings); + + defRetrySettings = + defRetrySettings.toBuilder().setInitialRetryDelayDuration(Duration.ofMillis(42L)).build(); + mergedRetrySettings = RetryOption.mergeToSettings(defRetrySettings, INITIAL_RETRY_DELAY); + assertEquals(defRetrySettings, mergedRetrySettings); + + defRetrySettings = defRetrySettings.toBuilder().setRetryDelayMultiplier(1.5).build(); + mergedRetrySettings = RetryOption.mergeToSettings(defRetrySettings, RETRY_DELAY_MULTIPLIER); + assertEquals(defRetrySettings, mergedRetrySettings); + + defRetrySettings = defRetrySettings.toBuilder().setMaxAttempts(100).build(); + mergedRetrySettings = RetryOption.mergeToSettings(defRetrySettings, MAX_ATTEMPTS); + assertEquals(defRetrySettings, mergedRetrySettings); + + defRetrySettings = defRetrySettings.toBuilder().setJittered(false).build(); + mergedRetrySettings = RetryOption.mergeToSettings(defRetrySettings, JITTERED); + assertEquals(defRetrySettings, mergedRetrySettings); + } + + @Test + public void threetenMethods_producesEquivalentJavaTimeRetryOptions() { + + final RetryOption totalTimeoutThreeten = + RetryOption.totalTimeout(org.threeten.bp.Duration.ofMillis(TOTAL_TIMEOUT_MILLIS)); + final RetryOption initialRetryDelayThreeten = + RetryOption.initialRetryDelay( + org.threeten.bp.Duration.ofMillis(INITIAL_RETRY_DELAY_MILLIS)); + final RetryOption maxRetryDelayThreeten = + RetryOption.maxRetryDelay(org.threeten.bp.Duration.ofMillis(MAX_RETRY_DELAY_MILLIS)); + + assertEquals(TOTAL_TIMEOUT, totalTimeoutThreeten); + assertEquals(INITIAL_RETRY_DELAY, initialRetryDelayThreeten); + assertEquals(MAX_RETRY_DELAY, maxRetryDelayThreeten); + } +} diff --git a/java-core/google-cloud-core/src/test/java/com/google/cloud/RoleTest.java b/java-core/google-cloud-core/src/test/java/com/google/cloud/RoleTest.java new file mode 100644 index 0000000000..694d507911 --- /dev/null +++ b/java-core/google-cloud-core/src/test/java/com/google/cloud/RoleTest.java @@ -0,0 +1,69 @@ +/* + * Copyright 2016 Google LLC + * + * Licensed under the Apache License, Version 2.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.google.cloud; + +import static com.google.common.truth.Truth.assertThat; +import static org.junit.jupiter.api.Assertions.assertThrows; + +import org.junit.jupiter.api.Test; + +class RoleTest { + + private static final Role VIEWER = Role.of("viewer"); + private static final Role EDITOR = Role.of("editor"); + private static final Role OWNER = Role.of("owner"); + + @Test + void testOf() { + assertThat(VIEWER.getValue()).isEqualTo("roles/viewer"); + assertThat(EDITOR.getValue()).isEqualTo("roles/editor"); + assertThat(OWNER.getValue()).isEqualTo("roles/owner"); + compareRoles(VIEWER, Role.of("roles/viewer")); + compareRoles(EDITOR, Role.of("roles/editor")); + compareRoles(OWNER, Role.of("roles/owner")); + + String customRole = "projects/foo/roles/bar"; + assertThat(Role.of(customRole).getValue()).isEqualTo(customRole); + } + + @Test + void testViewer() { + assertThat(Role.viewer().getValue()).isEqualTo("roles/viewer"); + } + + @Test + void testEditor() { + assertThat(Role.editor().getValue()).isEqualTo("roles/editor"); + } + + @Test + void testOwner() { + assertThat(Role.owner().getValue()).isEqualTo("roles/owner"); + } + + @Test + void testOfNullValue() { + assertThrows(NullPointerException.class, () -> Role.of(null)); + } + + private void compareRoles(Role expected, Role actual) { + assertThat(actual).isEqualTo(expected); + assertThat(actual.getValue()).isEqualTo(expected.getValue()); + assertThat(actual.hashCode()).isEqualTo(expected.hashCode()); + assertThat(actual.toString()).isEqualTo(expected.toString()); + } +} diff --git a/java-core/google-cloud-core/src/test/java/com/google/cloud/SerializationTest.java b/java-core/google-cloud-core/src/test/java/com/google/cloud/SerializationTest.java new file mode 100644 index 0000000000..f591578f11 --- /dev/null +++ b/java-core/google-cloud-core/src/test/java/com/google/cloud/SerializationTest.java @@ -0,0 +1,100 @@ +/* + * Copyright 2016 Google LLC + * + * Licensed under the Apache License, Version 2.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.google.cloud; + +import com.google.api.gax.retrying.RetrySettings; +import com.google.cloud.BaseServiceException.ExceptionData; +import com.google.cloud.MonitoredResourceDescriptor.LabelDescriptor; +import com.google.cloud.MonitoredResourceDescriptor.LabelDescriptor.ValueType; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.io.Serializable; +import java.time.Duration; + +public class SerializationTest extends BaseSerializationTest { + + private static final BaseServiceException BASE_SERVICE_EXCEPTION = + new BaseServiceException(ExceptionData.from(42, "message", "reason", false)); + private static final ExceptionHandler EXCEPTION_HANDLER = ExceptionHandler.getDefaultInstance(); + private static final Identity IDENTITY = Identity.allAuthenticatedUsers(); + private static final PageImpl PAGE = + new PageImpl<>(null, "cursor", ImmutableList.of("string1", "string2")); + private static final RetrySettings RETRY_SETTINGS = ServiceOptions.getDefaultRetrySettings(); + private static final Role SOME_ROLE = Role.viewer(); + private static final Policy SOME_IAM_POLICY = Policy.newBuilder().build(); + private static final RetryOption CHECKING_PERIOD = + RetryOption.initialRetryDelayDuration(Duration.ofSeconds(42)); + private static final LabelDescriptor LABEL_DESCRIPTOR = + new LabelDescriptor("project_id", ValueType.STRING, "The project id"); + private static final MonitoredResourceDescriptor MONITORED_RESOURCE_DESCRIPTOR = + MonitoredResourceDescriptor.newBuilder("global") + .setLabels(ImmutableList.of(LABEL_DESCRIPTOR)) + .build(); + private static final MonitoredResource MONITORED_RESOURCE = + MonitoredResource.newBuilder("global") + .setLabels(ImmutableMap.of("project_id", "project")) + .build(); + private static final String JSON_KEY = + "{\n" + + " \"private_key_id\": \"somekeyid\",\n" + + " \"private_key\": \"-----BEGIN PRIVATE KEY-----\\nMIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggS" + + "kAgEAAoIBAQC+K2hSuFpAdrJI\\nnCgcDz2M7t7bjdlsadsasad+fvRSW6TjNQZ3p5LLQY1kSZRqBqylRkzteMOyHg" + + "aR\\n0Pmxh3ILCND5men43j3h4eDbrhQBuxfEMalkG92sL+PNQSETY2tnvXryOvmBRwa/\\nQP/9dJfIkIDJ9Fw9N4" + + "Bhhhp6mCcRpdQjV38H7JsyJ7lih/oNjECgYAt\\nknddadwkwewcVxHFhcZJO+XWf6ofLUXpRwiTZakGMn8EE1uVa2" + + "LgczOjwWHGi99MFjxSer5m9\\n1tCa3/KEGKiS/YL71JvjwX3mb+cewlkcmweBKZHM2JPTk0ZednFSpVZMtycjkbLa" + + "\\ndYOS8V85AgMBewECggEBAKksaldajfDZDV6nGqbFjMiizAKJolr/M3OQw16K6o3/\\n0S31xIe3sSlgW0+UbYlF" + + "4U8KifhManD1apVSC3csafaspP4RZUHFhtBywLO9pR5c\\nr6S5aLp+gPWFyIp1pfXbWGvc5VY/v9x7ya1VEa6rXvL" + + "sKupSeWAW4tMj3eo/64ge\\nsdaceaLYw52KeBYiT6+vpsnYrEkAHO1fF/LavbLLOFJmFTMxmsNaG0tuiJHgjshB\\" + + "n82DpMCbXG9YcCgI/DbzuIjsdj2JC1cascSP//3PmefWysucBQe7Jryb6NQtASmnv\\nCdDw/0jmZTEjpe4S1lxfHp" + + "lAhHFtdgYTvyYtaLZiVVkCgYEA8eVpof2rceecw/I6\\n5ng1q3Hl2usdWV/4mZMvR0fOemacLLfocX6IYxT1zA1FF" + + "JlbXSRsJMf/Qq39mOR2\\nSpW+hr4jCoHeRVYLgsbggtrevGmILAlNoqCMpGZ6vDmJpq6ECV9olliDvpPgWOP+\\nm" + + "YPDreFBGxWvQrADNbRt2dmGsrsCgYEAyUHqB2wvJHFqdmeBsaacewzV8x9WgmeX\\ngUIi9REwXlGDW0Mz50dxpxcK" + + "CAYn65+7TCnY5O/jmL0VRxU1J2mSWyWTo1C+17L0\\n3fUqjxL1pkefwecxwecvC+gFFYdJ4CQ/MHHXU81Lwl1iWdF" + + "Cd2UoGddYaOF+KNeM\\nHC7cmqra+JsCgYEAlUNywzq8nUg7282E+uICfCB0LfwejuymR93CtsFgb7cRd6ak\\nECR" + + "8FGfCpH8ruWJINllbQfcHVCX47ndLZwqv3oVFKh6pAS/vVI4dpOepP8++7y1u\\ncoOvtreXCX6XqfrWDtKIvv0vjl" + + "HBhhhp6mCcRpdQjV38H7JsyJ7lih/oNjECgYAt\\nkndj5uNl5SiuVxHFhcZJO+XWf6ofLUregtevZakGMn8EE1uVa" + + "2AY7eafmoU/nZPT\\n00YB0TBATdCbn/nBSuKDESkhSg9s2GEKQZG5hBmL5uCMfo09z3SfxZIhJdlerreP\\nJ7gSi" + + "dI12N+EZxYd4xIJh/HFDgp7RRO87f+WJkofMQKBgGTnClK1VMaCRbJZPriw\\nEfeFCoOX75MxKwXs6xgrw4W//AYG" + + "GUjDt83lD6AZP6tws7gJ2IwY/qP7+lyhjEqN\\nHtfPZRGFkGZsdaksdlaksd323423d+15/UvrlRSFPNj1tWQmNKk" + + "XyRDW4IG1Oa2p\\nrALStNBx5Y9t0/LQnFI4w3aG\\n-----END PRIVATE KEY-----\\n\",\n" + + " \"client_email\": \"someclientid@developer.gserviceaccount.com\",\n" + + " \"client_id\": \"someclientid.apps.googleusercontent.com\",\n" + + " \"type\": \"service_account\"\n" + + "}"; + + @Override + protected Serializable[] serializableObjects() { + return new Serializable[] { + BASE_SERVICE_EXCEPTION, + EXCEPTION_HANDLER, + IDENTITY, + PAGE, + RETRY_SETTINGS, + SOME_ROLE, + SOME_IAM_POLICY, + CHECKING_PERIOD, + LABEL_DESCRIPTOR, + MONITORED_RESOURCE_DESCRIPTOR, + MONITORED_RESOURCE + }; + } + + @Override + protected Restorable[] restorableObjects() { + return null; + } +} diff --git a/java-core/google-cloud-core/src/test/java/com/google/cloud/ServiceOptionsTest.java b/java-core/google-cloud-core/src/test/java/com/google/cloud/ServiceOptionsTest.java new file mode 100644 index 0000000000..eb8eab37b2 --- /dev/null +++ b/java-core/google-cloud-core/src/test/java/com/google/cloud/ServiceOptionsTest.java @@ -0,0 +1,655 @@ +/* + * Copyright 2015 Google LLC + * + * Licensed under the Apache License, Version 2.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.google.cloud; + +import static com.google.common.truth.Truth.assertThat; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotEquals; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertNull; +import static org.junit.jupiter.api.Assertions.assertSame; +import static org.junit.jupiter.api.Assertions.assertThrows; +import static org.junit.jupiter.api.Assertions.assertTrue; +import static org.junit.jupiter.api.Assertions.fail; + +import com.google.api.client.http.HttpRequest; +import com.google.api.client.http.HttpResponse; +import com.google.api.client.http.HttpTransport; +import com.google.api.client.http.LowLevelHttpRequest; +import com.google.api.client.http.LowLevelHttpResponse; +import com.google.api.client.testing.http.HttpTesting; +import com.google.api.client.testing.http.MockHttpTransport; +import com.google.api.client.testing.http.MockLowLevelHttpRequest; +import com.google.api.client.testing.http.MockLowLevelHttpResponse; +import com.google.api.core.ApiClock; +import com.google.api.core.CurrentMillisClock; +import com.google.auth.oauth2.GoogleCredentials; +import com.google.auth.oauth2.ServiceAccountCredentials; +import com.google.cloud.spi.ServiceRpcFactory; +import com.google.common.collect.ArrayListMultimap; +import com.google.common.collect.Multimap; +import com.google.common.io.Files; +import java.io.ByteArrayInputStream; +import java.io.File; +import java.io.IOException; +import java.io.InputStream; +import java.nio.charset.StandardCharsets; +import java.util.Map; +import java.util.Set; +import java.util.regex.Pattern; +import org.junit.jupiter.api.Test; + +class ServiceOptionsTest { + private static GoogleCredentials credentials; + private static GoogleCredentials credentialsWithProjectId; + private static GoogleCredentials credentialsWithQuotaProject; + private static GoogleCredentials credentialsNotInGDU; + + private static final String SA_JSON_KEY = + "{\n" + + " \"private_key_id\": \"somekeyid\",\n" + + " \"private_key\": \"-----BEGIN PRIVATE KEY-----\\nMIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggS" + + "kAgEAAoIBAQC+K2hSuFpAdrJI\\nnCgcDz2M7t7bjdlsadsasad+fvRSW6TjNQZ3p5LLQY1kSZRqBqylRkzteMOyHg" + + "aR\\n0Pmxh3ILCND5men43j3h4eDbrhQBuxfEMalkG92sL+PNQSETY2tnvXryOvmBRwa/\\nQP/9dJfIkIDJ9Fw9N4" + + "Bhhhp6mCcRpdQjV38H7JsyJ7lih/oNjECgYAt\\nknddadwkwewcVxHFhcZJO+XWf6ofLUXpRwiTZakGMn8EE1uVa2" + + "LgczOjwWHGi99MFjxSer5m9\\n1tCa3/KEGKiS/YL71JvjwX3mb+cewlkcmweBKZHM2JPTk0ZednFSpVZMtycjkbLa" + + "\\ndYOS8V85AgMBewECggEBAKksaldajfDZDV6nGqbFjMiizAKJolr/M3OQw16K6o3/\\n0S31xIe3sSlgW0+UbYlF" + + "4U8KifhManD1apVSC3csafaspP4RZUHFhtBywLO9pR5c\\nr6S5aLp+gPWFyIp1pfXbWGvc5VY/v9x7ya1VEa6rXvL" + + "sKupSeWAW4tMj3eo/64ge\\nsdaceaLYw52KeBYiT6+vpsnYrEkAHO1fF/LavbLLOFJmFTMxmsNaG0tuiJHgjshB\\" + + "n82DpMCbXG9YcCgI/DbzuIjsdj2JC1cascSP//3PmefWysucBQe7Jryb6NQtASmnv\\nCdDw/0jmZTEjpe4S1lxfHp" + + "lAhHFtdgYTvyYtaLZiVVkCgYEA8eVpof2rceecw/I6\\n5ng1q3Hl2usdWV/4mZMvR0fOemacLLfocX6IYxT1zA1FF" + + "JlbXSRsJMf/Qq39mOR2\\nSpW+hr4jCoHeRVYLgsbggtrevGmILAlNoqCMpGZ6vDmJpq6ECV9olliDvpPgWOP+\\nm" + + "YPDreFBGxWvQrADNbRt2dmGsrsCgYEAyUHqB2wvJHFqdmeBsaacewzV8x9WgmeX\\ngUIi9REwXlGDW0Mz50dxpxcK" + + "CAYn65+7TCnY5O/jmL0VRxU1J2mSWyWTo1C+17L0\\n3fUqjxL1pkefwecxwecvC+gFFYdJ4CQ/MHHXU81Lwl1iWdF" + + "Cd2UoGddYaOF+KNeM\\nHC7cmqra+JsCgYEAlUNywzq8nUg7282E+uICfCB0LfwejuymR93CtsFgb7cRd6ak\\nECR" + + "8FGfCpH8ruWJINllbQfcHVCX47ndLZwqv3oVFKh6pAS/vVI4dpOepP8++7y1u\\ncoOvtreXCX6XqfrWDtKIvv0vjl" + + "HBhhhp6mCcRpdQjV38H7JsyJ7lih/oNjECgYAt\\nkndj5uNl5SiuVxHFhcZJO+XWf6ofLUregtevZakGMn8EE1uVa" + + "2AY7eafmoU/nZPT\\n00YB0TBATdCbn/nBSuKDESkhSg9s2GEKQZG5hBmL5uCMfo09z3SfxZIhJdlerreP\\nJ7gSi" + + "dI12N+EZxYd4xIJh/HFDgp7RRO87f+WJkofMQKBgGTnClK1VMaCRbJZPriw\\nEfeFCoOX75MxKwXs6xgrw4W//AYG" + + "GUjDt83lD6AZP6tws7gJ2IwY/qP7+lyhjEqN\\nHtfPZRGFkGZsdaksdlaksd323423d+15/UvrlRSFPNj1tWQmNKk" + + "XyRDW4IG1Oa2p\\nrALStNBx5Y9t0/LQnFI4w3aG\\n-----END PRIVATE KEY-----\\n\",\n" + + " \"client_email\": \"someclientid@developer.gserviceaccount.com\",\n" + + " \"client_id\": \"someclientid.apps.googleusercontent.com\",\n" + + " \"type\": \"service_account\",\n" + + " \"universe_domain\": \"googleapis.com\"\n" + + "}"; + + private static final String SA_JSON_KEY_PROJECT_ID = + "{\n" + + " \"private_key_id\": \"somekeyid\",\n" + + " \"private_key\": \"-----BEGIN PRIVATE KEY-----\\nMIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggS" + + "kAgEAAoIBAQC+K2hSuFpAdrJI\\nnCgcDz2M7t7bjdlsadsasad+fvRSW6TjNQZ3p5LLQY1kSZRqBqylRkzteMOyHg" + + "aR\\n0Pmxh3ILCND5men43j3h4eDbrhQBuxfEMalkG92sL+PNQSETY2tnvXryOvmBRwa/\\nQP/9dJfIkIDJ9Fw9N4" + + "Bhhhp6mCcRpdQjV38H7JsyJ7lih/oNjECgYAt\\nknddadwkwewcVxHFhcZJO+XWf6ofLUXpRwiTZakGMn8EE1uVa2" + + "LgczOjwWHGi99MFjxSer5m9\\n1tCa3/KEGKiS/YL71JvjwX3mb+cewlkcmweBKZHM2JPTk0ZednFSpVZMtycjkbLa" + + "\\ndYOS8V85AgMBewECggEBAKksaldajfDZDV6nGqbFjMiizAKJolr/M3OQw16K6o3/\\n0S31xIe3sSlgW0+UbYlF" + + "4U8KifhManD1apVSC3csafaspP4RZUHFhtBywLO9pR5c\\nr6S5aLp+gPWFyIp1pfXbWGvc5VY/v9x7ya1VEa6rXvL" + + "sKupSeWAW4tMj3eo/64ge\\nsdaceaLYw52KeBYiT6+vpsnYrEkAHO1fF/LavbLLOFJmFTMxmsNaG0tuiJHgjshB\\" + + "n82DpMCbXG9YcCgI/DbzuIjsdj2JC1cascSP//3PmefWysucBQe7Jryb6NQtASmnv\\nCdDw/0jmZTEjpe4S1lxfHp" + + "lAhHFtdgYTvyYtaLZiVVkCgYEA8eVpof2rceecw/I6\\n5ng1q3Hl2usdWV/4mZMvR0fOemacLLfocX6IYxT1zA1FF" + + "JlbXSRsJMf/Qq39mOR2\\nSpW+hr4jCoHeRVYLgsbggtrevGmILAlNoqCMpGZ6vDmJpq6ECV9olliDvpPgWOP+\\nm" + + "YPDreFBGxWvQrADNbRt2dmGsrsCgYEAyUHqB2wvJHFqdmeBsaacewzV8x9WgmeX\\ngUIi9REwXlGDW0Mz50dxpxcK" + + "CAYn65+7TCnY5O/jmL0VRxU1J2mSWyWTo1C+17L0\\n3fUqjxL1pkefwecxwecvC+gFFYdJ4CQ/MHHXU81Lwl1iWdF" + + "Cd2UoGddYaOF+KNeM\\nHC7cmqra+JsCgYEAlUNywzq8nUg7282E+uICfCB0LfwejuymR93CtsFgb7cRd6ak\\nECR" + + "8FGfCpH8ruWJINllbQfcHVCX47ndLZwqv3oVFKh6pAS/vVI4dpOepP8++7y1u\\ncoOvtreXCX6XqfrWDtKIvv0vjl" + + "HBhhhp6mCcRpdQjV38H7JsyJ7lih/oNjECgYAt\\nkndj5uNl5SiuVxHFhcZJO+XWf6ofLUregtevZakGMn8EE1uVa" + + "2AY7eafmoU/nZPT\\n00YB0TBATdCbn/nBSuKDESkhSg9s2GEKQZG5hBmL5uCMfo09z3SfxZIhJdlerreP\\nJ7gSi" + + "dI12N+EZxYd4xIJh/HFDgp7RRO87f+WJkofMQKBgGTnClK1VMaCRbJZPriw\\nEfeFCoOX75MxKwXs6xgrw4W//AYG" + + "GUjDt83lD6AZP6tws7gJ2IwY/qP7+lyhjEqN\\nHtfPZRGFkGZsdaksdlaksd323423d+15/UvrlRSFPNj1tWQmNKk" + + "XyRDW4IG1Oa2p\\nrALStNBx5Y9t0/LQnFI4w3aG\\n-----END PRIVATE KEY-----\\n\",\n" + + " \"project_id\": \"someprojectid\",\n" + + " \"client_email\": \"someclientid@developer.gserviceaccount.com\",\n" + + " \"client_id\": \"someclientid.apps.googleusercontent.com\",\n" + + " \"type\": \"service_account\",\n" + + " \"universe_domain\": \"googleapis.com\"\n" + + "}"; + + private static final String SA_JSON_KEY_QUOTA_PROJECT_ID = + "{\n" + + " \"private_key_id\": \"somekeyid\",\n" + + " \"private_key\": \"-----BEGIN PRIVATE KEY-----\\nMIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggS" + + "kAgEAAoIBAQC+K2hSuFpAdrJI\\nnCgcDz2M7t7bjdlsadsasad+fvRSW6TjNQZ3p5LLQY1kSZRqBqylRkzteMOyHg" + + "aR\\n0Pmxh3ILCND5men43j3h4eDbrhQBuxfEMalkG92sL+PNQSETY2tnvXryOvmBRwa/\\nQP/9dJfIkIDJ9Fw9N4" + + "Bhhhp6mCcRpdQjV38H7JsyJ7lih/oNjECgYAt\\nknddadwkwewcVxHFhcZJO+XWf6ofLUXpRwiTZakGMn8EE1uVa2" + + "LgczOjwWHGi99MFjxSer5m9\\n1tCa3/KEGKiS/YL71JvjwX3mb+cewlkcmweBKZHM2JPTk0ZednFSpVZMtycjkbLa" + + "\\ndYOS8V85AgMBewECggEBAKksaldajfDZDV6nGqbFjMiizAKJolr/M3OQw16K6o3/\\n0S31xIe3sSlgW0+UbYlF" + + "4U8KifhManD1apVSC3csafaspP4RZUHFhtBywLO9pR5c\\nr6S5aLp+gPWFyIp1pfXbWGvc5VY/v9x7ya1VEa6rXvL" + + "sKupSeWAW4tMj3eo/64ge\\nsdaceaLYw52KeBYiT6+vpsnYrEkAHO1fF/LavbLLOFJmFTMxmsNaG0tuiJHgjshB\\" + + "n82DpMCbXG9YcCgI/DbzuIjsdj2JC1cascSP//3PmefWysucBQe7Jryb6NQtASmnv\\nCdDw/0jmZTEjpe4S1lxfHp" + + "lAhHFtdgYTvyYtaLZiVVkCgYEA8eVpof2rceecw/I6\\n5ng1q3Hl2usdWV/4mZMvR0fOemacLLfocX6IYxT1zA1FF" + + "JlbXSRsJMf/Qq39mOR2\\nSpW+hr4jCoHeRVYLgsbggtrevGmILAlNoqCMpGZ6vDmJpq6ECV9olliDvpPgWOP+\\nm" + + "YPDreFBGxWvQrADNbRt2dmGsrsCgYEAyUHqB2wvJHFqdmeBsaacewzV8x9WgmeX\\ngUIi9REwXlGDW0Mz50dxpxcK" + + "CAYn65+7TCnY5O/jmL0VRxU1J2mSWyWTo1C+17L0\\n3fUqjxL1pkefwecxwecvC+gFFYdJ4CQ/MHHXU81Lwl1iWdF" + + "Cd2UoGddYaOF+KNeM\\nHC7cmqra+JsCgYEAlUNywzq8nUg7282E+uICfCB0LfwejuymR93CtsFgb7cRd6ak\\nECR" + + "8FGfCpH8ruWJINllbQfcHVCX47ndLZwqv3oVFKh6pAS/vVI4dpOepP8++7y1u\\ncoOvtreXCX6XqfrWDtKIvv0vjl" + + "HBhhhp6mCcRpdQjV38H7JsyJ7lih/oNjECgYAt\\nkndj5uNl5SiuVxHFhcZJO+XWf6ofLUregtevZakGMn8EE1uVa" + + "2AY7eafmoU/nZPT\\n00YB0TBATdCbn/nBSuKDESkhSg9s2GEKQZG5hBmL5uCMfo09z3SfxZIhJdlerreP\\nJ7gSi" + + "dI12N+EZxYd4xIJh/HFDgp7RRO87f+WJkofMQKBgGTnClK1VMaCRbJZPriw\\nEfeFCoOX75MxKwXs6xgrw4W//AYG" + + "GUjDt83lD6AZP6tws7gJ2IwY/qP7+lyhjEqN\\nHtfPZRGFkGZsdaksdlaksd323423d+15/UvrlRSFPNj1tWQmNKk" + + "XyRDW4IG1Oa2p\\nrALStNBx5Y9t0/LQnFI4w3aG\\n-----END PRIVATE KEY-----\\n\",\n" + + " \"project_id\": \"someprojectid\",\n" + + " \"client_email\": \"someclientid@developer.gserviceaccount.com\",\n" + + " \"client_id\": \"someclientid.apps.googleusercontent.com\",\n" + + " \"type\": \"service_account\",\n" + + " \"quota_project_id\": \"some-quota-project-id\",\n" + + " \"universe_domain\": \"googleapis.com\"\n" + + "}"; + + // Key added by copying the keys above and adding in the universe domain field + private static final String SA_JSON_KEY_NON_GDU = + "{\n" + + " \"private_key_id\": \"somekeyid\",\n" + + " \"private_key\": \"-----BEGIN PRIVATE KEY-----\\nMIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggS" + + "kAgEAAoIBAQC+K2hSuFpAdrJI\\nnCgcDz2M7t7bjdlsadsasad+fvRSW6TjNQZ3p5LLQY1kSZRqBqylRkzteMOyHg" + + "aR\\n0Pmxh3ILCND5men43j3h4eDbrhQBuxfEMalkG92sL+PNQSETY2tnvXryOvmBRwa/\\nQP/9dJfIkIDJ9Fw9N4" + + "Bhhhp6mCcRpdQjV38H7JsyJ7lih/oNjECgYAt\\nknddadwkwewcVxHFhcZJO+XWf6ofLUXpRwiTZakGMn8EE1uVa2" + + "LgczOjwWHGi99MFjxSer5m9\\n1tCa3/KEGKiS/YL71JvjwX3mb+cewlkcmweBKZHM2JPTk0ZednFSpVZMtycjkbLa" + + "\\ndYOS8V85AgMBewECggEBAKksaldajfDZDV6nGqbFjMiizAKJolr/M3OQw16K6o3/\\n0S31xIe3sSlgW0+UbYlF" + + "4U8KifhManD1apVSC3csafaspP4RZUHFhtBywLO9pR5c\\nr6S5aLp+gPWFyIp1pfXbWGvc5VY/v9x7ya1VEa6rXvL" + + "sKupSeWAW4tMj3eo/64ge\\nsdaceaLYw52KeBYiT6+vpsnYrEkAHO1fF/LavbLLOFJmFTMxmsNaG0tuiJHgjshB\\" + + "n82DpMCbXG9YcCgI/DbzuIjsdj2JC1cascSP//3PmefWysucBQe7Jryb6NQtASmnv\\nCdDw/0jmZTEjpe4S1lxfHp" + + "lAhHFtdgYTvyYtaLZiVVkCgYEA8eVpof2rceecw/I6\\n5ng1q3Hl2usdWV/4mZMvR0fOemacLLfocX6IYxT1zA1FF" + + "JlbXSRsJMf/Qq39mOR2\\nSpW+hr4jCoHeRVYLgsbggtrevGmILAlNoqCMpGZ6vDmJpq6ECV9olliDvpPgWOP+\\nm" + + "YPDreFBGxWvQrADNbRt2dmGsrsCgYEAyUHqB2wvJHFqdmeBsaacewzV8x9WgmeX\\ngUIi9REwXlGDW0Mz50dxpxcK" + + "CAYn65+7TCnY5O/jmL0VRxU1J2mSWyWTo1C+17L0\\n3fUqjxL1pkefwecxwecvC+gFFYdJ4CQ/MHHXU81Lwl1iWdF" + + "Cd2UoGddYaOF+KNeM\\nHC7cmqra+JsCgYEAlUNywzq8nUg7282E+uICfCB0LfwejuymR93CtsFgb7cRd6ak\\nECR" + + "8FGfCpH8ruWJINllbQfcHVCX47ndLZwqv3oVFKh6pAS/vVI4dpOepP8++7y1u\\ncoOvtreXCX6XqfrWDtKIvv0vjl" + + "HBhhhp6mCcRpdQjV38H7JsyJ7lih/oNjECgYAt\\nkndj5uNl5SiuVxHFhcZJO+XWf6ofLUregtevZakGMn8EE1uVa" + + "2AY7eafmoU/nZPT\\n00YB0TBATdCbn/nBSuKDESkhSg9s2GEKQZG5hBmL5uCMfo09z3SfxZIhJdlerreP\\nJ7gSi" + + "dI12N+EZxYd4xIJh/HFDgp7RRO87f+WJkofMQKBgGTnClK1VMaCRbJZPriw\\nEfeFCoOX75MxKwXs6xgrw4W//AYG" + + "GUjDt83lD6AZP6tws7gJ2IwY/qP7+lyhjEqN\\nHtfPZRGFkGZsdaksdlaksd323423d+15/UvrlRSFPNj1tWQmNKk" + + "XyRDW4IG1Oa2p\\nrALStNBx5Y9t0/LQnFI4w3aG\\n-----END PRIVATE KEY-----\\n\",\n" + + " \"client_email\": \"someclientid@developer.gserviceaccount.com\",\n" + + " \"client_id\": \"someclientid.apps.googleusercontent.com\",\n" + + " \"type\": \"service_account\",\n" + + " \"universe_domain\": \"random.com\"\n" + + "}"; + + static { + credentials = loadServiceAccountCredentials(SA_JSON_KEY); + credentialsWithProjectId = loadServiceAccountCredentials(SA_JSON_KEY_PROJECT_ID); + credentialsWithQuotaProject = loadServiceAccountCredentials(SA_JSON_KEY_QUOTA_PROJECT_ID); + credentialsNotInGDU = loadServiceAccountCredentials(SA_JSON_KEY_NON_GDU); + } + + static GoogleCredentials loadServiceAccountCredentials(String credentialFile) { + try { + InputStream keyStream = new ByteArrayInputStream(credentialFile.getBytes()); + return ServiceAccountCredentials.fromStream(keyStream); + } catch (IOException e) { + fail("Couldn't create fake JSON credentials."); + } + return null; + } + + private static final ApiClock TEST_CLOCK = new TestClock(); + private static final TestServiceOptions OPTIONS = + TestServiceOptions.newBuilder() + .setCredentials(credentials) + .setClock(TEST_CLOCK) + .setHost("host") + .setProjectId("project-id") + .setRetrySettings(ServiceOptions.getNoRetrySettings()) + .setQuotaProjectId("quota-project-id") + .build(); + private static final TestServiceOptions OPTIONS_NO_CREDENTIALS = + TestServiceOptions.newBuilder() + .setCredentials(NoCredentials.getInstance()) + .setClock(TEST_CLOCK) + .setHost("host") + .setProjectId("project-id") + .setRetrySettings(ServiceOptions.getNoRetrySettings()) + .setQuotaProjectId("quota-project-id") + .build(); + private static final TestServiceOptions DEFAULT_OPTIONS = + TestServiceOptions.newBuilder().setProjectId("project-id").build(); + private static final TestServiceOptions OPTIONS_COPY = OPTIONS.toBuilder().build(); + private static final String LIBRARY_NAME = "gcloud-java"; + private static final Pattern APPLICATION_NAME_PATTERN = Pattern.compile(LIBRARY_NAME + "/.*"); + + private static class TestClock implements ApiClock { + @Override + public long nanoTime() { + return 123_456_789_000_000L; + } + + @Override + public long millisTime() { + return 123_456_789L; + } + } + + interface TestService extends Service {} + + private static class TestServiceImpl extends BaseService + implements TestService { + private TestServiceImpl(TestServiceOptions options) { + super(options); + } + } + + public interface TestServiceFactory extends ServiceFactory {} + + private static class DefaultTestServiceFactory implements TestServiceFactory { + private static final TestServiceFactory INSTANCE = new DefaultTestServiceFactory(); + + @Override + public TestService create(TestServiceOptions options) { + return new TestServiceImpl(options); + } + } + + public interface TestServiceRpcFactory extends ServiceRpcFactory {} + + private static class DefaultTestServiceRpcFactory implements TestServiceRpcFactory { + private static final TestServiceRpcFactory INSTANCE = new DefaultTestServiceRpcFactory(); + + @Override + public TestServiceRpc create(TestServiceOptions options) { + return new DefaultTestServiceRpc(options); + } + } + + private interface TestServiceRpc extends ServiceRpc {} + + private static class DefaultTestServiceRpc implements TestServiceRpc { + DefaultTestServiceRpc(TestServiceOptions options) {} + } + + static class TestServiceOptions extends ServiceOptions { + private static class Builder + extends ServiceOptions.Builder { + private Builder() {} + + private Builder(TestServiceOptions options) { + super(options); + } + + @Override + protected TestServiceOptions build() { + return new TestServiceOptions(this); + } + } + + private TestServiceOptions(Builder builder) { + super( + TestServiceFactory.class, + TestServiceRpcFactory.class, + builder, + new TestServiceDefaults()); + } + + private static class TestServiceDefaults + implements ServiceDefaults { + + @Override + public TestServiceFactory getDefaultServiceFactory() { + return DefaultTestServiceFactory.INSTANCE; + } + + @Override + public TestServiceRpcFactory getDefaultRpcFactory() { + return DefaultTestServiceRpcFactory.INSTANCE; + } + + @Override + public TransportOptions getDefaultTransportOptions() { + return new TransportOptions() {}; + } + } + + @Override + protected Set getScopes() { + return null; + } + + @Override + public Builder toBuilder() { + return new Builder(this); + } + + private static Builder newBuilder() { + return new Builder(); + } + + @Override + public boolean equals(Object obj) { + return obj instanceof TestServiceOptions && baseEquals((TestServiceOptions) obj); + } + + @Override + public int hashCode() { + return baseHashCode(); + } + } + + @Test + public void testBuilder() { + assertSame(credentials, OPTIONS.getCredentials()); + assertSame(TEST_CLOCK, OPTIONS.getClock()); + assertEquals("host", OPTIONS.getHost()); + assertEquals("project-id", OPTIONS.getProjectId()); + assertSame(ServiceOptions.getNoRetrySettings(), OPTIONS.getRetrySettings()); + assertSame(CurrentMillisClock.getDefaultClock(), DEFAULT_OPTIONS.getClock()); + assertEquals("https://www.googleapis.com", DEFAULT_OPTIONS.getHost()); + assertSame(ServiceOptions.getDefaultRetrySettings(), DEFAULT_OPTIONS.getRetrySettings()); + } + + @Test + public void testBuilder_quotaProjectServiceOptionTakesPrecedence() { + TestServiceOptions noCredsWithQuotaProject = + TestServiceOptions.newBuilder() + .setCredentials(NoCredentials.getInstance()) + .setProjectId("project-id") + .setQuotaProjectId("quota-project-id") + .build(); + TestServiceOptions quotaProjectCredsWithQuotaProject = + TestServiceOptions.newBuilder() + .setQuotaProjectId("quota-project-id") + .setCredentials(credentialsWithQuotaProject) + .build(); + TestServiceOptions quotaProjectCredsWithQuotaProject2 = + TestServiceOptions.newBuilder() + .setCredentials(credentialsWithQuotaProject) + .setQuotaProjectId("quota-project-id") + .build(); + TestServiceOptions quotaProjectCreds = + TestServiceOptions.newBuilder().setCredentials(credentialsWithQuotaProject).build(); + TestServiceOptions none = + TestServiceOptions.newBuilder() + .setCredentials(NoCredentials.getInstance()) + .setProjectId("project-id") + .build(); + + assertEquals("quota-project-id", noCredsWithQuotaProject.getQuotaProjectId()); + assertEquals("quota-project-id", quotaProjectCredsWithQuotaProject.getQuotaProjectId()); + assertEquals("quota-project-id", quotaProjectCredsWithQuotaProject2.getQuotaProjectId()); + assertEquals("some-quota-project-id", quotaProjectCreds.getQuotaProjectId()); + assertNull(none.getQuotaProjectId()); + } + + @Test + void testBuilderNoCredentials() { + assertEquals(NoCredentials.getInstance(), OPTIONS_NO_CREDENTIALS.getCredentials()); + assertEquals(NoCredentials.getInstance(), OPTIONS_NO_CREDENTIALS.getCredentials()); + assertNotEquals(NoCredentials.getInstance(), OPTIONS.getCredentials()); + assertNotNull(NoCredentials.getInstance()); + assertSame(TEST_CLOCK, OPTIONS_NO_CREDENTIALS.getClock()); + assertEquals("host", OPTIONS_NO_CREDENTIALS.getHost()); + assertEquals("project-id", OPTIONS_NO_CREDENTIALS.getProjectId()); + assertSame(ServiceOptions.getNoRetrySettings(), OPTIONS_NO_CREDENTIALS.getRetrySettings()); + assertEquals("quota-project-id", OPTIONS.getQuotaProjectId()); + } + + @Test + void testBuilderNullCredentials() { + assertThrows( + NullPointerException.class, + () -> TestServiceOptions.newBuilder().setCredentials(null).build()); + } + + @Test + void testBuilderServiceAccount_setsProjectId() { + TestServiceOptions options = + TestServiceOptions.newBuilder().setCredentials(credentialsWithProjectId).build(); + assertEquals("someprojectid", options.getProjectId()); + } + + @Test + void testBuilderServiceAccount_explicitSetProjectIdBefore() { + TestServiceOptions options = + TestServiceOptions.newBuilder() + .setProjectId("override-project-id") + .setCredentials(credentialsWithProjectId) + .build(); + assertEquals("override-project-id", options.getProjectId()); + } + + @Test + void testBuilderServiceAccount_explicitSetProjectIdAfter() { + TestServiceOptions options = + TestServiceOptions.newBuilder() + .setCredentials(credentialsWithProjectId) + .setProjectId("override-project-id") + .build(); + assertEquals("override-project-id", options.getProjectId()); + } + + @Test + void testGetProjectIdRequired() { + assertTrue(OPTIONS.projectIdRequired()); + } + + @Test + void testService() { + assertTrue(OPTIONS.getService() instanceof TestServiceImpl); + } + + @Test + void testRpc() { + assertTrue(OPTIONS.getRpc() instanceof DefaultTestServiceRpc); + } + + @Test + void testBaseEquals() { + assertEquals(OPTIONS, OPTIONS_COPY); + assertNotEquals(DEFAULT_OPTIONS, OPTIONS); + } + + @Test + void testLibraryName() { + assertEquals(LIBRARY_NAME, ServiceOptions.getLibraryName()); + } + + @Test + void testApplicationName() { + assertTrue(APPLICATION_NAME_PATTERN.matcher(OPTIONS.getApplicationName()).matches()); + } + + @Test + void testBaseHashCode() { + assertEquals(OPTIONS.hashCode(), OPTIONS_COPY.hashCode()); + assertNotEquals(DEFAULT_OPTIONS.hashCode(), OPTIONS.hashCode()); + } + + @Test + void testGetServiceAccountProjectId() throws Exception { + File credentialsFile = File.createTempFile("credentials", ".json"); + credentialsFile.deleteOnExit(); + Files.write("{\"project_id\":\"my-project-id\"}".getBytes(), credentialsFile); + + assertEquals( + "my-project-id", + ServiceOptions.getValueFromCredentialsFile(credentialsFile.getPath(), "project_id")); + } + + @Test + void testGetServiceAccountProjectId_badJson() throws Exception { + File credentialsFile = File.createTempFile("credentials", ".json"); + credentialsFile.deleteOnExit(); + Files.write("asdfghj".getBytes(StandardCharsets.UTF_8), credentialsFile); + + String valueFromCredentialsFile = + ServiceOptions.getValueFromCredentialsFile(credentialsFile.getPath(), "project_id"); + assertNull(valueFromCredentialsFile); + } + + @Test + void testGetServiceAccountProjectId_nonExistentFile() throws Exception { + File credentialsFile = new File("/doesnotexist"); + + assertNull(ServiceOptions.getValueFromCredentialsFile(credentialsFile.getPath(), "project_id")); + } + + @Test + void testResponseHeaderContainsMetaDataFlavor() throws Exception { + Multimap headers = ArrayListMultimap.create(); + headers.put("Metadata-Flavor", "Google"); + HttpResponse httpResponse = createHttpResponseWithHeader(headers); + assertThat(ServiceOptions.headerContainsMetadataFlavor(httpResponse)).isTrue(); + } + + @Test + void testResponseHeaderDoesNotContainMetaDataFlavor() throws Exception { + Multimap headers = ArrayListMultimap.create(); + HttpResponse httpResponse = createHttpResponseWithHeader(headers); + assertThat(ServiceOptions.headerContainsMetadataFlavor(httpResponse)).isFalse(); + } + + @Test + void testGetResolvedEndpoint_noUniverseDomain() { + TestServiceOptions options = TestServiceOptions.newBuilder().setProjectId("project-id").build(); + assertThat(options.getResolvedHost("service")).isEqualTo("https://service.googleapis.com"); + } + + @Test + void testGetResolvedEndpoint_emptyUniverseDomain() { + TestServiceOptions options = + TestServiceOptions.newBuilder().setUniverseDomain("").setProjectId("project-id").build(); + IllegalArgumentException exception = + assertThrows(IllegalArgumentException.class, () -> options.getResolvedHost("service")); + assertThat(exception.getMessage()).isEqualTo("The universe domain cannot be empty"); + } + + @Test + void testGetResolvedEndpoint_customUniverseDomain() { + TestServiceOptions options = + TestServiceOptions.newBuilder() + .setUniverseDomain("test.com") + .setProjectId("project-id") + .build(); + assertThat(options.getResolvedHost("service")).isEqualTo("https://service.test.com"); + } + + @Test + void testGetResolvedEndpoint_customUniverseDomain_customHost() { + TestServiceOptions options = + TestServiceOptions.newBuilder() + .setUniverseDomain("test.com") + .setHost("https://service.random.com/") + .setProjectId("project-id") + .build(); + assertThat(options.getResolvedHost("service")).isEqualTo("https://service.random.com/"); + } + + @Test + void testGetResolvedApiaryHost_noUniverseDomain() { + TestServiceOptions options = TestServiceOptions.newBuilder().setProjectId("project-id").build(); + assertThat(options.getResolvedApiaryHost("service")) + .isEqualTo("https://service.googleapis.com/"); + } + + @Test + void testGetResolvedApiaryHost_customUniverseDomain_noHost() { + TestServiceOptions options = + TestServiceOptions.newBuilder() + .setUniverseDomain("test.com") + .setHost(null) + .setProjectId("project-id") + .build(); + assertThat(options.getResolvedApiaryHost("service")).isEqualTo("https://service.test.com/"); + } + + @Test + void testGetResolvedApiaryHost_customUniverseDomain_customHost() { + TestServiceOptions options = + TestServiceOptions.newBuilder() + .setUniverseDomain("test.com") + .setHost("https://service.random.com/") + .setProjectId("project-id") + .build(); + assertThat(options.getResolvedApiaryHost("service")).isEqualTo("https://service.random.com/"); + } + + // No User Configuration = GDU, Default Credentials = GDU + @Test + void testIsValidUniverseDomain_noUserUniverseDomainConfig_defaultCredentials() + throws IOException { + TestServiceOptions options = + TestServiceOptions.newBuilder() + .setProjectId("project-id") + .setHost("https://test.random.com") + .setCredentials(credentials) + .build(); + assertThat(options.hasValidUniverseDomain()).isTrue(); + } + + // No User Configuration = GDU, non Default Credentials = random.com + // non-GDU Credentials could be any domain, the tests use random.com + @Test + void testIsValidUniverseDomain_noUserUniverseDomainConfig_nonGDUCredentials() throws IOException { + TestServiceOptions options = + TestServiceOptions.newBuilder() + .setProjectId("project-id") + .setHost("https://test.random.com") + .setCredentials(credentialsNotInGDU) + .build(); + assertThat(options.hasValidUniverseDomain()).isFalse(); + } + + // User Configuration = random.com, Default Credentials = GDU + // User Credentials could be set to any domain, the tests use random.com + @Test + void testIsValidUniverseDomain_userUniverseDomainConfig_defaultCredentials() throws IOException { + TestServiceOptions options = + TestServiceOptions.newBuilder() + .setProjectId("project-id") + .setHost("https://test.random.com") + .setUniverseDomain("random.com") + .setCredentials(credentials) + .build(); + assertThat(options.hasValidUniverseDomain()).isFalse(); + } + + // User Configuration = random.com, non Default Credentials = random.com + // User Credentials and non GDU Credentials could be set to any domain, + // the tests use random.com + @Test + void testIsValidUniverseDomain_userUniverseDomainConfig_nonGDUCredentials() throws IOException { + TestServiceOptions options = + TestServiceOptions.newBuilder() + .setProjectId("project-id") + .setHost("https://test.random.com") + .setUniverseDomain("random.com") + .setCredentials(credentialsNotInGDU) + .build(); + assertThat(options.hasValidUniverseDomain()).isTrue(); + } + + private HttpResponse createHttpResponseWithHeader(final Multimap headers) + throws Exception { + HttpTransport mockHttpTransport = + new MockHttpTransport() { + @Override + public LowLevelHttpRequest buildRequest(String method, String url) throws IOException { + return new MockLowLevelHttpRequest() { + @Override + public LowLevelHttpResponse execute() throws IOException { + MockLowLevelHttpResponse response = new MockLowLevelHttpResponse(); + for (Map.Entry entry : headers.entries()) { + response.addHeader(entry.getKey(), entry.getValue()); + } + return response; + } + }; + } + }; + HttpRequest request = + mockHttpTransport.createRequestFactory().buildGetRequest(HttpTesting.SIMPLE_GENERIC_URL); + return request.execute(); + } +} diff --git a/java-core/google-cloud-core/src/test/java/com/google/cloud/StringEnumTest.java b/java-core/google-cloud-core/src/test/java/com/google/cloud/StringEnumTest.java new file mode 100644 index 0000000000..3a74f6c5d2 --- /dev/null +++ b/java-core/google-cloud-core/src/test/java/com/google/cloud/StringEnumTest.java @@ -0,0 +1,130 @@ +/* + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.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.google.cloud; + +import static com.google.common.truth.Truth.assertThat; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertNull; +import static org.junit.jupiter.api.Assertions.assertThrows; + +import com.google.api.core.ApiFunction; +import com.google.common.testing.EqualsTester; +import java.util.Arrays; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; + +class StringEnumTest { + + static class Letter extends StringEnumValue { + private static final long serialVersionUID = -1717976087182628526L; + + private Letter(String constant) { + super(constant); + } + + private static final ApiFunction CONSTRUCTOR = + new ApiFunction() { + @Override + public Letter apply(String constant) { + return new Letter(constant); + } + }; + + private static final StringEnumType type = + new StringEnumType(Letter.class, CONSTRUCTOR); + + public static final Letter A = type.createAndRegister("A"); + public static final Letter B = type.createAndRegister("B"); + public static final Letter C = type.createAndRegister("C"); + + public static Letter valueOfStrict(String constant) { + return type.valueOfStrict(constant); + } + + /** Get the StorageClass for the given String constant, and allow unrecognized values. */ + public static Letter valueOf(String constant) { + return type.valueOf(constant); + } + + /** Return the known values for StorageClass. */ + public static Letter[] values() { + return type.values(); + } + } + + @Test + void testNullClass() { + assertThrows( + NullPointerException.class, () -> new StringEnumType(null, Letter.CONSTRUCTOR)); + } + + @Test + void testNullConstructor() { + try { + new StringEnumType(Letter.class, null); + Assertions.fail(); + } catch (NullPointerException ex) { + assertNull(ex.getMessage()); + } + } + + @Test + void testEnumInstances() { + assertThat(Letter.A.toString()).isEqualTo("A"); + } + + @Test + void testValueOf() { + assertThat(Letter.valueOf("A")).isSameInstanceAs(Letter.A); + assertThat(Letter.valueOf("B")).isSameInstanceAs(Letter.B); + assertThat(Letter.valueOf("C")).isSameInstanceAs(Letter.C); + assertThat(Letter.valueOf("NonExistentLetter").toString()).isEqualTo("NonExistentLetter"); + } + + @Test + void testValueOfStrict() { + assertThat(Letter.valueOfStrict("A")).isSameInstanceAs(Letter.A); + assertThat(Letter.valueOfStrict("B")).isSameInstanceAs(Letter.B); + assertThat(Letter.valueOfStrict("C")).isSameInstanceAs(Letter.C); + } + + @Test + void testEquals() { + new EqualsTester() + .addEqualityGroup(Letter.A, Letter.valueOf("A"), Letter.valueOfStrict("A")) + .addEqualityGroup(Letter.B, Letter.valueOf("B"), Letter.valueOfStrict("B")) + .addEqualityGroup(Letter.C, Letter.valueOf("C"), Letter.valueOfStrict("C")) + .addEqualityGroup(Letter.valueOf("NonExistentLetter"), Letter.valueOf("NonExistentLetter")) + .testEquals(); + } + + @Test + void testValueOfStrict_invalid() { + try { + Letter.valueOfStrict("NonExistentLetter"); + Assertions.fail(); + } catch (IllegalArgumentException ex) { + assertNotNull(ex.getMessage()); + } + } + + @Test + void testValues() { + assertThat( + Arrays.asList(Letter.values()).containsAll(Arrays.asList(Letter.A, Letter.B, Letter.C))) + .isTrue(); + } +} diff --git a/java-core/google-cloud-core/src/test/java/com/google/cloud/StructsTest.java b/java-core/google-cloud-core/src/test/java/com/google/cloud/StructsTest.java new file mode 100644 index 0000000000..abc86633cb --- /dev/null +++ b/java-core/google-cloud-core/src/test/java/com/google/cloud/StructsTest.java @@ -0,0 +1,206 @@ +/* + * Copyright 2016 Google LLC + * + * Licensed under the Apache License, Version 2.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.google.cloud; + +import static com.google.common.truth.Truth.assertThat; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.fail; + +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import com.google.protobuf.ListValue; +import com.google.protobuf.NullValue; +import com.google.protobuf.Struct; +import com.google.protobuf.Value; +import java.util.HashMap; +import java.util.Map; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Test; + +public class StructsTest { + + private static final Double NUMBER = 42.0; + private static final String STRING = "string"; + private static final Boolean BOOLEAN = true; + private static final ImmutableList LIST = + ImmutableList.of(NUMBER, STRING, BOOLEAN); + private static final Map INNER_MAP = new HashMap<>(); + private static final Map MAP = new HashMap<>(); + private static final Value NULL_VALUE = + Value.newBuilder().setNullValue(NullValue.NULL_VALUE).build(); + private static final Value NUMBER_VALUE = Value.newBuilder().setNumberValue(NUMBER).build(); + private static final Value STRING_VALUE = Value.newBuilder().setStringValue(STRING).build(); + private static final Value BOOLEAN_VALUE = Value.newBuilder().setBoolValue(BOOLEAN).build(); + private static final ListValue PROTO_LIST = + ListValue.newBuilder() + .addAllValues(ImmutableList.of(NUMBER_VALUE, STRING_VALUE, BOOLEAN_VALUE)) + .build(); + private static final Value LIST_VALUE = Value.newBuilder().setListValue(PROTO_LIST).build(); + private static final Struct INNER_STRUCT = + Struct.newBuilder() + .putAllFields( + ImmutableMap.of( + "null", NULL_VALUE, + "number", NUMBER_VALUE, + "string", STRING_VALUE, + "boolean", BOOLEAN_VALUE, + "list", LIST_VALUE)) + .build(); + private static final Value STRUCT_VALUE = Value.newBuilder().setStructValue(INNER_STRUCT).build(); + private static final ImmutableMap VALUE_MAP = + ImmutableMap.builder() + .put("null", NULL_VALUE) + .put("number", NUMBER_VALUE) + .put("string", STRING_VALUE) + .put("boolean", BOOLEAN_VALUE) + .put("list", LIST_VALUE) + .put("struct", STRUCT_VALUE) + .buildOrThrow(); + private static final Struct STRUCT = Struct.newBuilder().putAllFields(VALUE_MAP).build(); + private static final ImmutableMap EMPTY_MAP = ImmutableMap.of(); + + @BeforeAll + static void beforeClass() { + INNER_MAP.put("null", null); + INNER_MAP.put("number", NUMBER); + INNER_MAP.put("string", STRING); + INNER_MAP.put("boolean", BOOLEAN); + INNER_MAP.put("list", LIST); + MAP.put("null", null); + MAP.put("number", NUMBER); + MAP.put("string", STRING); + MAP.put("boolean", BOOLEAN); + MAP.put("list", LIST); + MAP.put("struct", INNER_MAP); + } + + private void checkMapField(Map map, String key, T expected) { + assertThat(map).containsKey(key); + assertThat(map).containsEntry(key, expected); + } + + private void checkStructField(Struct struct, String key, Value expected) { + Map map = struct.getFieldsMap(); + checkMapField(map, key, expected); + } + + @Test + void testAsMap() { + Map map = Structs.asMap(STRUCT); + checkMapField(map, "null", null); + checkMapField(map, "number", NUMBER); + checkMapField(map, "string", STRING); + checkMapField(map, "boolean", BOOLEAN); + checkMapField(map, "list", LIST); + checkMapField(map, "struct", INNER_MAP); + assertEquals(MAP, map); + } + + @Test + void testAsMapPut() { + Map map = Structs.asMap(STRUCT); + try { + map.put("key", "value"); + fail(); + } catch (UnsupportedOperationException expected) { + + } + } + + @Test + void testAsMapRemove() { + Map map = Structs.asMap(STRUCT); + try { + map.remove("null"); + fail(); + } catch (UnsupportedOperationException expected) { + + } + } + + @Test + void testAsMapEmpty() { + Map map = Structs.asMap(Struct.getDefaultInstance()); + assertThat(map).isEmpty(); + assertEquals(EMPTY_MAP, map); + } + + @Test + void testAsMapNull() { + try { + Structs.asMap(null); + fail(); + } catch (NullPointerException expected) { + } + } + + @Test + void testNewStruct() { + Struct struct = Structs.newStruct(MAP); + checkStructField(struct, "null", NULL_VALUE); + checkStructField(struct, "number", NUMBER_VALUE); + checkStructField(struct, "string", STRING_VALUE); + checkStructField(struct, "boolean", BOOLEAN_VALUE); + checkStructField(struct, "list", LIST_VALUE); + checkStructField(struct, "struct", STRUCT_VALUE); + assertEquals(STRUCT, struct); + } + + @Test + void testNewStructEmpty() { + Struct struct = Structs.newStruct(EMPTY_MAP); + assertThat(struct.getFieldsMap()).isEmpty(); + } + + @Test + void testNewStructNull() { + try { + Structs.newStruct(null); + fail(); + } catch (NullPointerException expected) { + } + } + + @Test + void testNumbers() { + int intNumber = Integer.MIN_VALUE; + long longNumber = Long.MAX_VALUE; + float floatNumber = Float.MIN_VALUE; + double doubleNumber = Double.MAX_VALUE; + ImmutableMap map = + ImmutableMap.of( + "int", intNumber, "long", longNumber, "float", floatNumber, "double", doubleNumber); + Struct struct = Structs.newStruct(map); + checkStructField(struct, "int", Value.newBuilder().setNumberValue(intNumber).build()); + checkStructField( + struct, "long", Value.newBuilder().setNumberValue((double) longNumber).build()); + checkStructField(struct, "float", Value.newBuilder().setNumberValue(floatNumber).build()); + checkStructField(struct, "double", Value.newBuilder().setNumberValue(doubleNumber).build()); + Map convertedMap = Structs.asMap(struct); + assertThat(convertedMap.get("int")).isInstanceOf(Double.class); + assertThat(convertedMap.get("long")).isInstanceOf(Double.class); + assertThat(convertedMap.get("float")).isInstanceOf(Double.class); + assertThat(convertedMap.get("double")).isInstanceOf(Double.class); + int convertedInteger = ((Double) convertedMap.get("int")).intValue(); + long convertedLong = ((Double) convertedMap.get("long")).longValue(); + float convertedFloat = ((Double) convertedMap.get("float")).floatValue(); + double convertedDouble = (Double) convertedMap.get("double"); + assertEquals(intNumber, convertedInteger); + assertEquals(longNumber, convertedLong); + assertEquals(floatNumber, convertedFloat, 0); + assertEquals(doubleNumber, convertedDouble, 0); + } +} diff --git a/java-core/google-cloud-core/src/test/java/com/google/cloud/TimestampTest.java b/java-core/google-cloud-core/src/test/java/com/google/cloud/TimestampTest.java new file mode 100644 index 0000000000..6d6340b417 --- /dev/null +++ b/java-core/google-cloud-core/src/test/java/com/google/cloud/TimestampTest.java @@ -0,0 +1,348 @@ +/* + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.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.google.cloud; + +import static com.google.common.testing.SerializableTester.reserializeAndAssert; +import static com.google.common.truth.Truth.assertThat; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertThrows; + +import com.google.common.testing.EqualsTester; +import java.time.format.DateTimeParseException; +import java.util.Calendar; +import java.util.Date; +import java.util.GregorianCalendar; +import java.util.TimeZone; +import java.util.concurrent.TimeUnit; +import org.junit.jupiter.api.Test; + +/** Unit tests for {@link com.google.cloud.Timestamp}. */ +class TimestampTest { + private static final String TEST_TIME_ISO = "2015-10-12T15:14:54Z"; + private static final long TEST_TIME_SECONDS = 1444662894L; + private static final long TEST_TIME_MICROSECONDS = 10000100L; + private static final long TEST_TIME_MILLISECONDS = + TimeUnit.SECONDS.toMillis(1444662894L) + TimeUnit.MICROSECONDS.toMillis(1234); + private static final long TEST_TIME_MILLISECONDS_NEGATIVE = -1000L; + private static final Date TEST_DATE = new Date(TEST_TIME_MILLISECONDS); + private static final Date TEST_DATE_PRE_EPOCH = new Date(TEST_TIME_MILLISECONDS_NEGATIVE); + + @Test + void minValue() { + // MIN_VALUE is before the start of the Gregorian calendar... use magic value. + assertThat(Timestamp.MIN_VALUE.getSeconds()).isEqualTo(-62135596800L); + assertThat(Timestamp.MIN_VALUE.getNanos()).isEqualTo(0); + } + + @Test + void maxValue() { + TimeZone tz = TimeZone.getTimeZone("UTC"); + GregorianCalendar calendar = new GregorianCalendar(tz); + calendar.set(9999, Calendar.DECEMBER, 31, 23, 59, 59); + java.sql.Timestamp expectedMin = new java.sql.Timestamp(calendar.getTimeInMillis()); + expectedMin.setNanos(999999999); + + assertThat(Timestamp.MAX_VALUE.getSeconds()).isEqualTo(calendar.getTimeInMillis() / 1000L); + assertThat(Timestamp.MAX_VALUE.getNanos()).isEqualTo(999999999); + } + + @Test + void ofMicroseconds() { + Timestamp timestamp = Timestamp.ofTimeMicroseconds(TEST_TIME_MICROSECONDS); + assertThat(timestamp.getSeconds()).isEqualTo(TEST_TIME_MICROSECONDS / 1000000L); + assertThat(timestamp.getNanos()).isEqualTo(TEST_TIME_MICROSECONDS % 1000000L * 1000); + } + + @Test + void ofDate() { + Timestamp timestamp = Timestamp.of(TEST_DATE); + Long expectedSeconds = TimeUnit.MILLISECONDS.toSeconds(TEST_TIME_MILLISECONDS); + Long expectedNanos = + TimeUnit.MILLISECONDS.toNanos(TEST_TIME_MILLISECONDS) + - TimeUnit.SECONDS.toNanos(expectedSeconds); + assertThat(timestamp.getSeconds()).isEqualTo(expectedSeconds); + assertThat(timestamp.getNanos()).isEqualTo(expectedNanos); + } + + @Test + void testOf() { + String expectedTimestampString = "1970-01-01T00:00:12.345000000Z"; + java.sql.Timestamp input = new java.sql.Timestamp(12345); + Timestamp timestamp = Timestamp.of(input); + assertEquals(timestamp.toString(), expectedTimestampString); + } + + @Test + void testOf_exactSecond() { + String expectedTimestampString = "1970-01-01T00:00:12Z"; + java.sql.Timestamp input = new java.sql.Timestamp(12000); + Timestamp timestamp = Timestamp.of(input); + assertEquals(timestamp.toString(), expectedTimestampString); + } + + @Test + void testOf_preEpoch() { + String expectedTimestampString = "1969-12-31T23:59:47.655000000Z"; + java.sql.Timestamp input = new java.sql.Timestamp(-12345); + Timestamp timestamp = Timestamp.of(input); + assertEquals(timestamp.toString(), expectedTimestampString); + } + + @Test + void testOf_onEpoch() { + String expectedTimestampString = "1970-01-01T00:00:00Z"; + java.sql.Timestamp input = new java.sql.Timestamp(0); + Timestamp timestamp = Timestamp.of(input); + assertEquals(timestamp.toString(), expectedTimestampString); + } + + @Test + void testOf_preEpochExactSecond() { + String expectedTimestampString = "1969-12-31T23:59:59Z"; + java.sql.Timestamp input = new java.sql.Timestamp(-1000); + Timestamp timestamp = Timestamp.of(input); + assertEquals(timestamp.toString(), expectedTimestampString); + } + + @Test + void ofDatePreEpoch() { + Timestamp timestamp = Timestamp.of(TEST_DATE_PRE_EPOCH); + long expectedSeconds = TEST_TIME_MILLISECONDS_NEGATIVE / 1_000; + int expectedNanos = (int) (TEST_TIME_MILLISECONDS_NEGATIVE % 1_000 * 1000_000); + if (expectedNanos < 0) { + expectedSeconds--; + expectedNanos += 1_000_000_000; + } + assertThat(timestamp.getSeconds()).isEqualTo(expectedSeconds); + assertThat(timestamp.getNanos()).isEqualTo(expectedNanos); + } + + @Test + void toDate() { + Timestamp timestamp = Timestamp.ofTimeSecondsAndNanos(TEST_TIME_SECONDS, 1234 * 1000); + Date date = timestamp.toDate(); + assertThat(TEST_TIME_MILLISECONDS).isEqualTo(date.getTime()); + } + + @Test + void toFromSqlTimestamp() { + long seconds = TEST_TIME_SECONDS; + int nanos = 500000000; + + java.sql.Timestamp sqlTs = new java.sql.Timestamp(seconds * 1000); + sqlTs.setNanos(nanos); + + Timestamp ts = Timestamp.of(sqlTs); + assertThat(ts.getSeconds()).isEqualTo(seconds); + assertThat(ts.getNanos()).isEqualTo(nanos); + + assertThat(ts.toSqlTimestamp()).isEqualTo(sqlTs); + } + + @Test + void boundsSecondsMin() { + assertThrows( + IllegalArgumentException.class, + () -> Timestamp.ofTimeSecondsAndNanos(Timestamp.MIN_VALUE.getSeconds() - 1, 999999999)); + } + + @Test + void boundsSecondsMax() { + assertThrows( + IllegalArgumentException.class, + () -> Timestamp.ofTimeSecondsAndNanos(Timestamp.MAX_VALUE.getSeconds() + 1, 0)); + } + + @Test + void boundsNanosMin() { + assertThrows( + IllegalArgumentException.class, + () -> Timestamp.ofTimeSecondsAndNanos(TEST_TIME_SECONDS, -1)); + } + + @Test + void boundsNanosMax() { + assertThrows( + IllegalArgumentException.class, + () -> Timestamp.ofTimeSecondsAndNanos(TEST_TIME_SECONDS, 1000000000)); + } + + @Test + void boundsSqlTimestampMin() { + assertThrows( + IllegalArgumentException.class, + () -> Timestamp.of(new java.sql.Timestamp((Timestamp.MIN_VALUE.getSeconds() - 1) * 1000))); + } + + @Test + void boundsSqlTimestampMax() { + assertThrows( + IllegalArgumentException.class, + () -> Timestamp.of(new java.sql.Timestamp((Timestamp.MAX_VALUE.getSeconds() + 1) * 1000))); + } + + @Test + void equalsAndHashCode() { + EqualsTester tester = new EqualsTester(); + tester.addEqualityGroup( + Timestamp.ofTimeSecondsAndNanos(TEST_TIME_SECONDS, 0), + Timestamp.ofTimeSecondsAndNanos(TEST_TIME_SECONDS, 0), + Timestamp.of(new java.sql.Timestamp(TEST_TIME_SECONDS * 1000))); + tester.addEqualityGroup(Timestamp.ofTimeSecondsAndNanos(TEST_TIME_SECONDS + 1, 0)); + tester.addEqualityGroup(Timestamp.ofTimeSecondsAndNanos(TEST_TIME_SECONDS, 1)); + tester.testEquals(); + } + + @Test + void testToString() { + assertThat(Timestamp.MIN_VALUE.toString()).isEqualTo("0001-01-01T00:00:00Z"); + assertThat(Timestamp.MAX_VALUE.toString()).isEqualTo("9999-12-31T23:59:59.999999999Z"); + assertThat(Timestamp.ofTimeSecondsAndNanos(0, 0).toString()).isEqualTo("1970-01-01T00:00:00Z"); + assertThat(Timestamp.ofTimeSecondsAndNanos(0, 100).toString()) + .isEqualTo("1970-01-01T00:00:00.000000100Z"); + assertThat(Timestamp.ofTimeSecondsAndNanos(TEST_TIME_SECONDS, 0).toString()) + .isEqualTo(TEST_TIME_ISO); + } + + @Test + void parseTimestamp() { + assertThat(Timestamp.parseTimestamp("0001-01-01T00:00:00Z")).isEqualTo(Timestamp.MIN_VALUE); + assertThat(Timestamp.parseTimestamp("9999-12-31T23:59:59.999999999Z")) + .isEqualTo(Timestamp.MAX_VALUE); + assertThat(Timestamp.parseTimestamp(TEST_TIME_ISO)) + .isEqualTo(Timestamp.ofTimeSecondsAndNanos(TEST_TIME_SECONDS, 0)); + } + + @Test + void parseTimestampWithoutTimeZoneOffset() { + assertThat(Timestamp.parseTimestamp("0001-01-01T00:00:00")).isEqualTo(Timestamp.MIN_VALUE); + assertThat(Timestamp.parseTimestamp("9999-12-31T23:59:59.999999999")) + .isEqualTo(Timestamp.MAX_VALUE); + assertThat(Timestamp.parseTimestamp("2015-10-12T15:14:54")) + .isEqualTo(Timestamp.ofTimeSecondsAndNanos(TEST_TIME_SECONDS, 0)); + } + + @Test + void parseTimestampWithTimeZoneOffset() { + // Max values + assertThat(Timestamp.parseTimestampDuration("0001-01-01T00:00:00-00:00")) + .isEqualTo(Timestamp.MIN_VALUE); + assertThat(Timestamp.parseTimestampDuration("9999-12-31T23:59:59.999999999-00:00")) + .isEqualTo(Timestamp.MAX_VALUE); + // Extreme values (close to min/max) + assertThat(Timestamp.parseTimestampDuration("0001-01-01T00:00:00.000000001Z")) + .isEqualTo(Timestamp.ofTimeSecondsAndNanos(Timestamp.MIN_VALUE.getSeconds(), 1)); + assertThat(Timestamp.parseTimestampDuration("9999-12-31T23:59:59.999999998Z")) + .isEqualTo(Timestamp.ofTimeSecondsAndNanos(Timestamp.MAX_VALUE.getSeconds(), 999999998)); + // Common use cases + assertThat(Timestamp.parseTimestampDuration("2020-07-10T14:03:00.123-07:00")) + .isEqualTo(Timestamp.ofTimeSecondsAndNanos(1594414980, 123000000)); + assertThat(Timestamp.parseTimestampDuration("2020-12-06T19:21:12.123+05:30")) + .isEqualTo(Timestamp.ofTimeSecondsAndNanos(1607262672, 123000000)); + // We also confirm that parsing a timestamp with nano precision will behave the same as the + // threeten counterpart + assertThat(Timestamp.parseTimestampDuration("2020-12-06T19:21:12.123+05:30")) + .isEqualTo(Timestamp.parseTimestamp("2020-12-06T19:21:12.123+05:30")); + // Timestamps with fractional seconds at nanosecond level + assertThat(Timestamp.parseTimestampDuration("2020-12-06T19:21:12.123456789+05:30")) + .isEqualTo(Timestamp.ofTimeSecondsAndNanos(1607262672, 123456789)); + // Fractional seconds beyond nanos should throw an exception + assertThrows( + DateTimeParseException.class, + () -> Timestamp.parseTimestampDuration("2020-12-06T19:21:12.123456789321+05:30")); + // Missing components (should throw exceptions) + assertThrows( + DateTimeParseException.class, () -> Timestamp.parseTimestampDuration("2020-12-06")); + // Whitespace should not be supported + assertThrows( + DateTimeParseException.class, + () -> Timestamp.parseTimestampDuration(" 2020-12-06T19:21:12.123+05:30 ")); + // It should be case-insensitive + assertThat(Timestamp.parseTimestampDuration("2020-07-10t14:03:00-07:00")) + .isEqualTo(Timestamp.ofTimeSecondsAndNanos(1594414980, 0)); + // Invalid time zone offsets + assertThrows( + DateTimeParseException.class, + () -> Timestamp.parseTimestampDuration("2020-12-06T19:21:12.123+25:00")); + assertThrows( + DateTimeParseException.class, + () -> Timestamp.parseTimestampDuration("2020-12-06T19:21:12.123-25:00")); + // Int values for SecondOfMinute should be between 0 and 59 + assertThrows( + DateTimeParseException.class, + () -> Timestamp.parseTimestampDuration("2016-12-31T23:59:60Z")); + } + + @Test + void parseTimestampWithZoneString() { + // Valid RFC 3339 timestamps with time zone names + assertThat(Timestamp.parseTimestampDuration("2020-12-06T08:51:12.123America/Toronto")) + .isEqualTo(Timestamp.ofTimeSecondsAndNanos(1607262672, 123000000)); + assertThat(Timestamp.parseTimestampDuration("2023-04-10T22:42:10.123456789Europe/London")) + .isEqualTo(Timestamp.ofTimeSecondsAndNanos(1681162930, 123456789)); + + // Invalid time zone names + assertThrows( + DateTimeParseException.class, + () -> Timestamp.parseTimestampDuration("2020-12-06T19:21:12.123Invalid/TimeZone")); + } + + @Test + void fromProto() { + com.google.protobuf.Timestamp proto = + com.google.protobuf.Timestamp.newBuilder().setSeconds(1234).setNanos(567).build(); + Timestamp timestamp = Timestamp.fromProto(proto); + assertThat(timestamp.getSeconds()).isEqualTo(1234); + assertThat(timestamp.getNanos()).isEqualTo(567); + } + + @Test + void comparable() { + assertThat(Timestamp.MIN_VALUE).isLessThan(Timestamp.MAX_VALUE); + assertThat(Timestamp.MAX_VALUE).isGreaterThan(Timestamp.MIN_VALUE); + + assertThat(Timestamp.ofTimeSecondsAndNanos(100, 0)) + .isAtLeast(Timestamp.ofTimeSecondsAndNanos(100, 0)); + assertThat(Timestamp.ofTimeSecondsAndNanos(100, 0)) + .isAtMost(Timestamp.ofTimeSecondsAndNanos(100, 0)); + + assertThat(Timestamp.ofTimeSecondsAndNanos(100, 1000)) + .isLessThan(Timestamp.ofTimeSecondsAndNanos(101, 0)); + assertThat(Timestamp.ofTimeSecondsAndNanos(100, 1000)) + .isAtMost(Timestamp.ofTimeSecondsAndNanos(101, 0)); + + assertThat(Timestamp.ofTimeSecondsAndNanos(101, 0)) + .isGreaterThan(Timestamp.ofTimeSecondsAndNanos(100, 1000)); + assertThat(Timestamp.ofTimeSecondsAndNanos(101, 0)) + .isAtLeast(Timestamp.ofTimeSecondsAndNanos(100, 1000)); + } + + @Test + void serialization() { + reserializeAndAssert(Timestamp.parseTimestamp("9999-12-31T23:59:59.999999999Z")); + } + + @Test + void parseInvalidTimestampThreetenThrowsThreetenException() { + assertThrows( + org.threeten.bp.format.DateTimeParseException.class, + () -> Timestamp.parseTimestamp("00x1-01-01T00:00:00")); + assertThrows( + java.time.format.DateTimeParseException.class, + () -> Timestamp.parseTimestampDuration("00x1-01-01T00:00:00")); + } +} diff --git a/java-core/google-cloud-core/src/test/java/com/google/cloud/testing/BaseEmulatorHelperTest.java b/java-core/google-cloud-core/src/test/java/com/google/cloud/testing/BaseEmulatorHelperTest.java new file mode 100644 index 0000000000..bfc2666216 --- /dev/null +++ b/java-core/google-cloud-core/src/test/java/com/google/cloud/testing/BaseEmulatorHelperTest.java @@ -0,0 +1,213 @@ +/* + * Copyright 2016 Google LLC + * + * Licensed under the Apache License, Version 2.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.google.cloud.testing; + +import com.google.api.client.util.Charsets; +import com.google.cloud.ServiceOptions; +import com.google.cloud.testing.BaseEmulatorHelper.EmulatorRunner; +import com.google.common.collect.ImmutableList; +import java.io.ByteArrayInputStream; +import java.io.EOFException; +import java.io.File; +import java.io.IOException; +import java.io.InputStream; +import java.net.URL; +import java.net.URLConnection; +import java.net.URLStreamHandler; +import java.time.Duration; +import java.util.List; +import java.util.concurrent.TimeoutException; +import java.util.logging.Logger; +import org.easymock.EasyMock; +import org.junit.jupiter.api.Test; + +class BaseEmulatorHelperTest { + + private static final String BLOCK_UNTIL = "Block until"; + + private static class TestEmulatorHelper extends BaseEmulatorHelper { + + private final List runners; + private final String blockUntil; + + private TestEmulatorHelper(List runners, String blockUntil) { + super("emulator", 1, "project"); + this.runners = runners; + this.blockUntil = blockUntil; + } + + @Override + protected List getEmulatorRunners() { + return runners; + } + + @Override + protected Logger getLogger() { + return Logger.getLogger(TestEmulatorHelper.class.getName()); + } + + @Override + public ServiceOptions getOptions() { + return null; + } + + @Override + public void start() throws IOException, InterruptedException { + startProcess(blockUntil); + } + + @Override + public void stop(org.threeten.bp.Duration timeout) + throws IOException, InterruptedException, TimeoutException { + // we call the threeten method directly to confirm behavior + waitForProcess(timeout); + } + + @Override + public void stopDuration(Duration timeout) + throws IOException, InterruptedException, TimeoutException { + super.stopDuration(timeout); + } + + @Override + public void reset() throws IOException { + // do nothing + } + } + + @Test + void testEmulatorHelper() throws IOException, InterruptedException, TimeoutException { + Process process = EasyMock.createStrictMock(Process.class); + InputStream stream = new ByteArrayInputStream(BLOCK_UNTIL.getBytes(Charsets.UTF_8)); + EmulatorRunner emulatorRunner = EasyMock.createStrictMock(EmulatorRunner.class); + EasyMock.expect(process.getInputStream()).andReturn(stream); + EasyMock.expect(emulatorRunner.isAvailable()).andReturn(true); + emulatorRunner.start(); + EasyMock.expectLastCall(); + EasyMock.expect(emulatorRunner.getProcess()).andReturn(process); + emulatorRunner.waitForDuration(Duration.ofMinutes(1)); + EasyMock.expectLastCall().andReturn(0); + EasyMock.replay(process, emulatorRunner); + TestEmulatorHelper helper = + new TestEmulatorHelper(ImmutableList.of(emulatorRunner), BLOCK_UNTIL); + helper.start(); + helper.stopDuration(Duration.ofMinutes(1)); + EasyMock.verify(); + } + + @Test + void testEmulatorHelperThreeten() throws IOException, InterruptedException, TimeoutException { + Process process = EasyMock.createStrictMock(Process.class); + InputStream stream = new ByteArrayInputStream(BLOCK_UNTIL.getBytes(Charsets.UTF_8)); + EmulatorRunner emulatorRunner = EasyMock.createStrictMock(EmulatorRunner.class); + EasyMock.expect(process.getInputStream()).andReturn(stream); + EasyMock.expect(emulatorRunner.isAvailable()).andReturn(true); + emulatorRunner.start(); + EasyMock.expectLastCall(); + EasyMock.expect(emulatorRunner.getProcess()).andReturn(process); + emulatorRunner.waitForDuration(java.time.Duration.ofMinutes(1)); + EasyMock.expectLastCall().andReturn(0); + EasyMock.replay(process, emulatorRunner); + TestEmulatorHelper helper = + new TestEmulatorHelper(ImmutableList.of(emulatorRunner), BLOCK_UNTIL); + helper.start(); + helper.stop(org.threeten.bp.Duration.ofMinutes(1)); + EasyMock.verify(); + } + + @Test + void testEmulatorHelperDownloadWithRetries() + throws IOException, InterruptedException, TimeoutException { + String mockExternalForm = "mockExternalForm"; + String mockInputStream = "mockInputStream"; + String mockProtocol = "mockProtocol"; + String mockFile = "mockFile"; + String mockAccessToken = "mockAccessToken"; + String mockCommandText = "mockCommandText"; + + MockURLStreamHandler mockURLStreamHandler = EasyMock.createMock(MockURLStreamHandler.class); + URLConnection mockURLConnection = EasyMock.mock(URLConnection.class); + + EasyMock.expect(mockURLStreamHandler.toExternalForm(EasyMock.anyObject(URL.class))) + .andReturn(mockExternalForm) + .anyTimes(); + EasyMock.expect(mockURLConnection.getInputStream()) + .andReturn(new ByteArrayInputStream(mockInputStream.getBytes())) + .anyTimes(); + mockURLConnection.setRequestProperty("Authorization", "Bearer " + mockAccessToken); + EasyMock.expect(mockURLStreamHandler.openConnection(EasyMock.anyObject(URL.class))) + .andThrow(new EOFException()) + .times(1); + EasyMock.expect(mockURLStreamHandler.openConnection(EasyMock.anyObject(URL.class))) + .andReturn(mockURLConnection) + .times(1); + EasyMock.replay(mockURLStreamHandler, mockURLConnection); + + URL url = new URL(mockProtocol, null, 0, mockFile, mockURLStreamHandler); + BaseEmulatorHelper.DownloadableEmulatorRunner runner = + new BaseEmulatorHelper.DownloadableEmulatorRunner( + ImmutableList.of(mockCommandText), url, null, mockAccessToken); + + File cachedFile = new File(System.getProperty("java.io.tmpdir"), mockExternalForm); + cachedFile.delete(); // Clear the cached version so we're always testing the download + + runner.start(); + + EasyMock.verify(); + + cachedFile.delete(); // Cleanup + } + + @Test + void testEmulatorHelperMultipleRunners() + throws IOException, InterruptedException, TimeoutException { + Process process = EasyMock.createStrictMock(Process.class); + InputStream stream = new ByteArrayInputStream(BLOCK_UNTIL.getBytes(Charsets.UTF_8)); + EmulatorRunner firstRunner = EasyMock.createStrictMock(EmulatorRunner.class); + EmulatorRunner secondRunner = EasyMock.createStrictMock(EmulatorRunner.class); + EasyMock.expect(process.getInputStream()).andReturn(stream); + EasyMock.expect(firstRunner.isAvailable()).andReturn(false); + EasyMock.expect(secondRunner.isAvailable()).andReturn(true); + secondRunner.start(); + EasyMock.expectLastCall(); + EasyMock.expect(secondRunner.getProcess()).andReturn(process); + secondRunner.waitForDuration(Duration.ofMinutes(1)); + EasyMock.expectLastCall().andReturn(0); + EasyMock.replay(process, secondRunner); + TestEmulatorHelper helper = + new TestEmulatorHelper(ImmutableList.of(firstRunner, secondRunner), BLOCK_UNTIL); + helper.start(); + helper.stopDuration(Duration.ofMinutes(1)); + EasyMock.verify(); + } + + /** + * URLStreamHandler has a protected method which needs to be mocked, so we need our own + * implementation in this package + */ + private class MockURLStreamHandler extends URLStreamHandler { + @Override + protected URLConnection openConnection(URL u) throws IOException { + return null; + } + + @Override + protected String toExternalForm(URL u) { + return null; + } + } +} diff --git a/java-core/google-cloud-core/src/test/java/com/google/cloud/testing/BlockingProcessStreamReaderTest.java b/java-core/google-cloud-core/src/test/java/com/google/cloud/testing/BlockingProcessStreamReaderTest.java new file mode 100644 index 0000000000..9b9d94d0bb --- /dev/null +++ b/java-core/google-cloud-core/src/test/java/com/google/cloud/testing/BlockingProcessStreamReaderTest.java @@ -0,0 +1,119 @@ +/* + * Copyright 2016 Google LLC + * + * Licensed under the Apache License, Version 2.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.google.cloud.testing; + +import static com.google.common.truth.Truth.assertThat; +import static org.junit.Assert.assertEquals; + +import com.google.api.client.util.Charsets; +import com.google.common.collect.LinkedHashMultimap; +import com.google.common.collect.Multimap; +import java.io.ByteArrayInputStream; +import java.io.IOException; +import java.io.InputStream; +import java.util.logging.Level; +import java.util.logging.Logger; +import org.junit.Rule; +import org.junit.Test; +import org.junit.rules.Timeout; + +public class BlockingProcessStreamReaderTest { + + private static final String BLOCK_UNTIL = "Dev App Server is now running"; + private static final String OUTPUT = "First Line\n" + "Second Line\n" + BLOCK_UNTIL; + private static final String OUTPUT_WITH_LOGS = + "First Line\n" + + BLOCK_UNTIL + + "\n" + + "Nov 08, 2016 2:05:44 PM io.netty.buffer.PooledByteBufAllocator \n" + + "INFO: log line 1\n" + + "log line 2\n" + + "Nov 08, 2016 2:05:44 PM io.netty.buffer.PooledByteBufAllocator \n" + + "FINE: log line 3\n"; + private static final String TAGGED_OUTPUT_WITH_LOGS = + "[emulator] First Line\n" + + "[emulator]" + + BLOCK_UNTIL + + "\n" + + "[emulator] Nov 08, 2016 2:05:44 PM io.netty.buffer.PooledByteBufAllocator \n" + + "[emulator] INFO: log line 1\n" + + "[emulator] log line 2\n" + + "[emulator] Nov 08, 2016 2:05:44 PM io.netty.buffer.PooledByteBufAllocator \n" + + "[emulator] FINE: log line 3\n"; + private static final String LOG_LINES_WITHOUT_BLOCK_UNTIL_TEXT = + "INFO: log line 1\n" + "log line 2\n" + "FINE: log line 3\n"; + + @Rule public Timeout globalTimeout = Timeout.seconds(10); + + private static final class TestLogger extends Logger { + + private final Multimap logs = LinkedHashMultimap.create(); + + private TestLogger() { + super("text-logger", null); + } + + public void log(Level level, String msg) { + logs.put(level, msg); + } + + Multimap getLogs() { + return logs; + } + } + + @Test + public void testForwardLogEntry() throws IOException, InterruptedException { + TestLogger logger = new TestLogger(); + InputStream stream = new ByteArrayInputStream(OUTPUT_WITH_LOGS.getBytes(Charsets.UTF_8)); + BlockingProcessStreamReader.start("emulator", stream, BLOCK_UNTIL, logger).join(); + assertEquals( + "[emulator] log line 1" + System.lineSeparator() + "[emulator] log line 2", + logger.getLogs().get(Level.INFO).iterator().next()); + assertEquals("[emulator] log line 3", logger.getLogs().get(Level.FINE).iterator().next()); + stream.close(); + } + + @Test + public void testForwardAlreadyTaggedLogs() throws IOException, InterruptedException { + TestLogger logger = new TestLogger(); + InputStream stream = new ByteArrayInputStream(TAGGED_OUTPUT_WITH_LOGS.getBytes(Charsets.UTF_8)); + BlockingProcessStreamReader.start("emulator", stream, BLOCK_UNTIL, logger).join(); + assertEquals( + "[emulator] log line 1" + System.lineSeparator() + "[emulator] log line 2", + logger.getLogs().get(Level.INFO).iterator().next()); + assertEquals("[emulator] log line 3", logger.getLogs().get(Level.FINE).iterator().next()); + stream.close(); + } + + @Test + public void testStartUpLogs() throws IOException, InterruptedException { + TestLogger logger = new TestLogger(); + InputStream stream = + new ByteArrayInputStream(LOG_LINES_WITHOUT_BLOCK_UNTIL_TEXT.getBytes(Charsets.UTF_8)); + BlockingProcessStreamReader.start("emulator", stream, BLOCK_UNTIL, logger).join(); + assertThat(logger.logs.get(Level.INFO).iterator().next()) + .isEqualTo( + "log line 1" + + System.lineSeparator() + + "log line 2" + + System.lineSeparator() + + "log line 3" + + System.lineSeparator()); + stream.close(); + } +} diff --git a/java-core/google-cloud-core/src/test/java/com/google/cloud/testing/CommandWrapperTest.java b/java-core/google-cloud-core/src/test/java/com/google/cloud/testing/CommandWrapperTest.java new file mode 100644 index 0000000000..bc9cdc4a8c --- /dev/null +++ b/java-core/google-cloud-core/src/test/java/com/google/cloud/testing/CommandWrapperTest.java @@ -0,0 +1,120 @@ +/* + * Copyright 2016 Google LLC + * + * Licensed under the Apache License, Version 2.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.google.cloud.testing; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertNull; +import static org.junit.jupiter.api.Assertions.assertTrue; + +import com.google.common.collect.ImmutableList; +import java.io.File; +import java.nio.file.Path; +import java.nio.file.Paths; +import java.util.List; +import org.junit.jupiter.api.Test; + +class CommandWrapperTest { + + private static final List COMMAND = ImmutableList.of("my", "command"); + private static final List WIN_COMMAND = ImmutableList.of("cmd", "/C", "my", "command"); + private static final List UNIX_COMMAND = ImmutableList.of("bash", "my", "command"); + private static final Path DIRECTORY = Paths.get("my-path"); + private static final File WIN_NULL_FILE = new File("NUL:"); + private static final File UNIX_NULL_FILE = new File("/dev/null"); + + @Test + void testCommandWrapperCommand() { + CommandWrapper commandWrapper = CommandWrapper.create(); + commandWrapper.setCommand(COMMAND); + ProcessBuilder processBuilder = commandWrapper.getBuilder(); + if (BaseEmulatorHelper.isWindows()) { + assertEquals(WIN_COMMAND, processBuilder.command()); + } else { + assertEquals(UNIX_COMMAND, processBuilder.command()); + } + assertNull(processBuilder.directory()); + assertFalse(processBuilder.redirectErrorStream()); + assertEquals(ProcessBuilder.Redirect.PIPE, processBuilder.redirectError()); + } + + @Test + void testCommandWrapperRedirectErrorStream() { + CommandWrapper commandWrapper = CommandWrapper.create(); + commandWrapper.setCommand(COMMAND); + commandWrapper.setRedirectErrorStream(); + ProcessBuilder processBuilder = commandWrapper.getBuilder(); + if (BaseEmulatorHelper.isWindows()) { + assertEquals(WIN_COMMAND, processBuilder.command()); + } else { + assertEquals(UNIX_COMMAND, processBuilder.command()); + } + assertNull(processBuilder.directory()); + assertTrue(processBuilder.redirectErrorStream()); + assertEquals(ProcessBuilder.Redirect.PIPE, processBuilder.redirectError()); + } + + @Test + void testCommandWrapperRedirectErrorInherit() { + CommandWrapper commandWrapper = CommandWrapper.create(); + commandWrapper.setCommand(COMMAND); + commandWrapper.setRedirectErrorInherit(); + ProcessBuilder processBuilder = commandWrapper.getBuilder(); + if (BaseEmulatorHelper.isWindows()) { + assertEquals(WIN_COMMAND, processBuilder.command()); + } else { + assertEquals(UNIX_COMMAND, processBuilder.command()); + } + assertNull(processBuilder.directory()); + assertFalse(processBuilder.redirectErrorStream()); + assertEquals(ProcessBuilder.Redirect.INHERIT, processBuilder.redirectError()); + } + + @Test + void testCommandWrapperDirectory() { + CommandWrapper commandWrapper = CommandWrapper.create(); + commandWrapper.setCommand(COMMAND); + commandWrapper.setDirectory(DIRECTORY); + ProcessBuilder processBuilder = commandWrapper.getBuilder(); + if (BaseEmulatorHelper.isWindows()) { + assertEquals(WIN_COMMAND, processBuilder.command()); + } else { + assertEquals(UNIX_COMMAND, processBuilder.command()); + } + assertEquals(DIRECTORY, processBuilder.directory().toPath()); + assertFalse(processBuilder.redirectErrorStream()); + assertEquals(ProcessBuilder.Redirect.PIPE, processBuilder.redirectError()); + } + + @Test + void testCommandWrapperRedirectOutputToNull() { + CommandWrapper commandWrapper = CommandWrapper.create(); + commandWrapper.setCommand(COMMAND); + commandWrapper.setRedirectOutputToNull(); + ProcessBuilder processBuilder = commandWrapper.getBuilder(); + if (BaseEmulatorHelper.isWindows()) { + assertEquals(WIN_COMMAND, processBuilder.command()); + assertEquals(ProcessBuilder.Redirect.to(WIN_NULL_FILE), processBuilder.redirectOutput()); + } else { + assertEquals(UNIX_COMMAND, processBuilder.command()); + assertEquals(ProcessBuilder.Redirect.to(UNIX_NULL_FILE), processBuilder.redirectOutput()); + } + assertNull(processBuilder.directory()); + assertFalse(processBuilder.redirectErrorStream()); + assertEquals(ProcessBuilder.Redirect.PIPE, processBuilder.redirectError()); + } +} diff --git a/java-core/google-cloud-core/src/test/java/com/google/cloud/testing/LogRecorderTest.java b/java-core/google-cloud-core/src/test/java/com/google/cloud/testing/LogRecorderTest.java new file mode 100644 index 0000000000..5a3616f170 --- /dev/null +++ b/java-core/google-cloud-core/src/test/java/com/google/cloud/testing/LogRecorderTest.java @@ -0,0 +1,94 @@ +/* + * 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. + */ + +package com.google.cloud.testing; + +import static com.google.common.truth.Truth.assertThat; + +import com.google.common.collect.LinkedHashMultimap; +import com.google.common.collect.Multimap; +import com.google.common.truth.Truth; +import java.util.logging.Level; +import java.util.logging.Logger; +import org.junit.jupiter.api.Test; + +class LogRecorderTest { + + private static final String LOG_LINES = + "INFO: log line 1\n" + "log line 2\n" + "FINE: log line 3\n"; + private final TestLogger testLogger = new TestLogger(); + private final LogRecorder logRecorder = new LogRecorder(testLogger); + + @Test + void shouldAggregateLogs() { + for (String logLine : LOG_LINES.split("\n")) { + logRecorder.record(logLine); + } + logRecorder.flush(); + + assertThat(testLogger.logs.get(Level.INFO).iterator().next()) + .isEqualTo( + "log line 1" + + System.lineSeparator() + + "log line 2" + + System.lineSeparator() + + "log line 3" + + System.lineSeparator()); + } + + @Test + void shouldBeEmptyAfterFlushCall() { + for (String logLine : LOG_LINES.split("\n")) { + logRecorder.record(logLine); + } + // first flush and assertion + logRecorder.flush(); + assertThat(testLogger.logs.get(Level.INFO).iterator().next()) + .isEqualTo( + "log line 1" + + System.lineSeparator() + + "log line 2" + + System.lineSeparator() + + "log line 3" + + System.lineSeparator()); + + // second flush and assertion + testLogger.reset(); + logRecorder.flush(); + Truth.assertThat(testLogger.logs.get(Level.INFO)).isEmpty(); + } + + private static final class TestLogger extends Logger { + + private Multimap logs = LinkedHashMultimap.create(); + + private TestLogger() { + super("text-logger", null); + } + + public void log(Level level, String msg) { + logs.put(level, msg); + } + + public void reset() { + this.logs = LinkedHashMultimap.create(); + } + + Multimap getLogs() { + return logs; + } + } +} diff --git a/java-core/google-cloud-core/src/test/java/com/google/cloud/testing/VersionTest.java b/java-core/google-cloud-core/src/test/java/com/google/cloud/testing/VersionTest.java new file mode 100644 index 0000000000..2b5405c9bf --- /dev/null +++ b/java-core/google-cloud-core/src/test/java/com/google/cloud/testing/VersionTest.java @@ -0,0 +1,76 @@ +/* + * Copyright 2016 Google LLC + * + * Licensed under the Apache License, Version 2.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.google.cloud.testing; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertThrows; +import static org.junit.jupiter.api.Assertions.assertTrue; + +import org.junit.jupiter.api.Test; + +class VersionTest { + + @Test + void testFromString() { + Version version = Version.fromString("2016.01.13"); + assertEquals(2016, version.getMajor()); + assertEquals(1, version.getMinor()); + assertEquals(13, version.getPatch()); + version = Version.fromString("1.2.0"); + assertEquals(1, version.getMajor()); + assertEquals(2, version.getMinor()); + assertEquals(0, version.getPatch()); + } + + @Test + void testFromStringWithAlphas() { + assertThrows(IllegalArgumentException.class, () -> Version.fromString("2016.01.hello")); + } + + @Test + void testFromStringMissingPatch() { + assertThrows(IllegalArgumentException.class, () -> Version.fromString("2016.01")); + } + + @Test + void testFromStringMissingMinor() { + assertThrows(IllegalArgumentException.class, () -> Version.fromString("2016")); + } + + @Test + void testFromStringEmpty() { + assertThrows(IllegalArgumentException.class, () -> Version.fromString("")); + } + + @Test + void testFromStringNull() { + assertThrows(NullPointerException.class, () -> Version.fromString(null)); + } + + @Test + void testCompare() { + Version version = Version.fromString("2016.01.13"); + Version sameVersion = Version.fromString("2016.01.13"); + Version olderVersion = Version.fromString("2015.12.01"); + Version newerVersion = Version.fromString("2016.08.12"); + assertEquals(0, version.compareTo(sameVersion)); + assertTrue(version.compareTo(olderVersion) > 0); + assertTrue(version.compareTo(newerVersion) < 0); + Version otherVersion = Version.fromString("1.2.0"); + assertTrue(version.compareTo(otherVersion) > 0); + } +} diff --git a/java-core/google-cloud-core/src/test/java/com/google/cloud/testing/junit4/MultipleAttemptsRule.java b/java-core/google-cloud-core/src/test/java/com/google/cloud/testing/junit4/MultipleAttemptsRule.java new file mode 100644 index 0000000000..86fd82c7b9 --- /dev/null +++ b/java-core/google-cloud-core/src/test/java/com/google/cloud/testing/junit4/MultipleAttemptsRule.java @@ -0,0 +1,107 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * 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.google.cloud.testing.junit4; + +import static com.google.common.base.Preconditions.checkArgument; + +import java.util.ArrayList; +import java.util.List; +import org.junit.rules.TestRule; +import org.junit.runner.Description; +import org.junit.runners.model.MultipleFailureException; +import org.junit.runners.model.Statement; + +/** + * A JUnit rule that allows multiple attempts of a test execution before ultimately reporting + * failure for the test. Attempts will be attempted with an exponential backoff which defaults to a + * starting duration of 1 second. + * + *

        If after the maximum number of attempts the test has still not succeeded, all failures will be + * propagated as the result of the test allowing all errors to be visible (regardless if they are + * the same failure or different ones). + * + *

        To use this rule add the field declaration to your JUnit 4 Test class: + * + *

        Note: It is important that the field is public + * + *

        {@code
        + * @Rule
        + * public MultipleAttemptsRule multipleAttemptsRule = new MultipleAttemptsRule(3);
        + * }
        + * + * @see org.junit.Rule + */ +public final class MultipleAttemptsRule implements TestRule { + private final long initialBackoffMillis; + private final int maxAttemptCount; + + /** + * Construct a {@link MultipleAttemptsRule} which will attempt a test up to {@code attemptCount} + * times before ultimately reporting failure of the test. + * + *

        The initialBackoffMillis will be set to 1000L. + * + * @param maxAttemptCount max number of attempts before reporting failure, must be greater than 0 + * @see #MultipleAttemptsRule(int, long) + */ + public MultipleAttemptsRule(int maxAttemptCount) { + this(maxAttemptCount, 1000L); + } + + /** + * Construct a {@link MultipleAttemptsRule} which will attempt a test up to {@code attemptCount} + * times before ultimately reporting failure of the test. + * + *

        The {@code initialBackoffMillis} will be used as the first pause duration before + * reattempting the test. + * + * @param maxAttemptCount max number of attempts before reporting failure, must be greater than 0 + * @param initialBackoffMillis initial duration in millis to wait between attempts, must be + * greater than or equal to 0 + */ + public MultipleAttemptsRule(int maxAttemptCount, long initialBackoffMillis) { + checkArgument(maxAttemptCount > 0, "attemptCount must be > 0"); + checkArgument(initialBackoffMillis >= 0, "initialBackoffMillis must be >= 0"); + this.initialBackoffMillis = initialBackoffMillis; + this.maxAttemptCount = maxAttemptCount; + } + + @Override + public Statement apply(final Statement base, Description description) { + return new Statement() { + @Override + public void evaluate() throws Throwable { + List failures = new ArrayList<>(); + + long retryIntervalMillis = initialBackoffMillis; + + for (int i = 1; i <= maxAttemptCount; i++) { + try { + base.evaluate(); + return; + } catch (Throwable t) { + failures.add(t); + Thread.sleep(retryIntervalMillis); + retryIntervalMillis *= 1.5f; + } + } + + MultipleFailureException.assertEmpty(failures); + } + }; + } +} diff --git a/java-core/google-cloud-core/src/test/java/com/google/cloud/testing/junit4/StdErrCaptureRule.java b/java-core/google-cloud-core/src/test/java/com/google/cloud/testing/junit4/StdErrCaptureRule.java new file mode 100644 index 0000000000..1640d950e3 --- /dev/null +++ b/java-core/google-cloud-core/src/test/java/com/google/cloud/testing/junit4/StdErrCaptureRule.java @@ -0,0 +1,56 @@ +/* + * 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. + */ + +package com.google.cloud.testing.junit4; + +import java.io.PrintStream; +import org.junit.Rule; + +/** + * A JUnit rule that allows the capturing stderr (i.e. {@link System#err} during the scope of a + * test. + * + *

        Note: If some part of the system holds a reference System.err before this rule is loaded + * into the test lifecycle there is no way for this rule to capture the output. Ensure this rule is + * declared as high in your test file as possible, and ordered using {@link Rule#order()} before + * other Rules if necessary. + * + *

        To use this rule add the field declaration to your JUnit 4 Test class: + * + *

        Note: It is important that the field is public + * + *

        {@code
        + * @Rule
        + * public StdErrCaptureRule stdErrCaptureRule = new StdErrCaptureRule();
        + * }
        + * + * @see org.junit.Rule + * @see Rule#order() + */ +public final class StdErrCaptureRule extends StdXCaptureRule { + + public StdErrCaptureRule() {} + + @Override + protected PrintStream getOriginal() { + return System.err; + } + + @Override + protected void set(PrintStream ps) { + System.setErr(ps); + } +} diff --git a/java-core/google-cloud-core/src/test/java/com/google/cloud/testing/junit4/StdOutCaptureRule.java b/java-core/google-cloud-core/src/test/java/com/google/cloud/testing/junit4/StdOutCaptureRule.java new file mode 100644 index 0000000000..0a33997cde --- /dev/null +++ b/java-core/google-cloud-core/src/test/java/com/google/cloud/testing/junit4/StdOutCaptureRule.java @@ -0,0 +1,56 @@ +/* + * 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. + */ + +package com.google.cloud.testing.junit4; + +import java.io.PrintStream; +import org.junit.Rule; + +/** + * A JUnit rule that allows the capturing stdout (i.e. {@link System#out} during the scope of a + * test. + * + *

        Note: If some part of the system holds a reference System.out before this rule is loaded + * into the test lifecycle there is no way for this rule to capture the output. Ensure this rule is + * declared as high in your test file as possible, and ordered using {@link Rule#order()} before + * other Rules if necessary. + * + *

        To use this rule add the field declaration to your JUnit 4 Test class: + * + *

        Note: It is important that the field is public + * + *

        {@code
        + * @Rule
        + * public StdOutCaptureRule stdOutCaptureRule = new StdOutCaptureRule();
        + * }
        + * + * @see org.junit.Rule + * @see Rule#order() + */ +public final class StdOutCaptureRule extends StdXCaptureRule { + + public StdOutCaptureRule() {} + + @Override + protected PrintStream getOriginal() { + return System.out; + } + + @Override + protected void set(PrintStream ps) { + System.setOut(ps); + } +} diff --git a/java-core/google-cloud-core/src/test/java/com/google/cloud/testing/junit4/StdXCaptureRule.java b/java-core/google-cloud-core/src/test/java/com/google/cloud/testing/junit4/StdXCaptureRule.java new file mode 100644 index 0000000000..ba17e3e324 --- /dev/null +++ b/java-core/google-cloud-core/src/test/java/com/google/cloud/testing/junit4/StdXCaptureRule.java @@ -0,0 +1,188 @@ +/* + * 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. + */ + +package com.google.cloud.testing.junit4; + +import com.google.common.base.Charsets; +import java.io.ByteArrayOutputStream; +import java.io.IOException; +import java.io.OutputStream; +import java.io.PrintStream; +import java.io.UnsupportedEncodingException; +import org.junit.rules.TestRule; +import org.junit.runner.Description; +import org.junit.runners.model.Statement; + +abstract class StdXCaptureRule implements TestRule { + + private final ByteArrayOutputStream byteArrayOutputStream; + + public StdXCaptureRule() { + byteArrayOutputStream = new ByteArrayOutputStream(); + } + + protected abstract PrintStream getOriginal(); + + protected abstract void set(PrintStream ps); + + /** + * Get a handle to the raw bytes written during the running test so far. + * + * @return A read-only {@link ByteArrayOutputStream} representing the raw bytes written so far. + *

        Note the following behavior of the return value: + *

          + *
        1. Calling any "write" method call will result in an {@link IllegalStateException} + *
        2. Calls to {@link ByteArrayOutputStream#toByteArray()} will result in a new copy of the + * underlying array up to that point + *
        3. Calls to {@link ByteArrayOutputStream#flush()} will be silently ignored + *
        4. Calls to {@link ByteArrayOutputStream#close()} will be silently ignored + *
        + */ + public ByteArrayOutputStream getCapturedOutput() { + return new ReadOnlyByteArrayOutputStream(byteArrayOutputStream); + } + + /** + * Return a UTF-8 {@link String} of all bytes written during the running test so far. + * + * @return UTF-8 {@link String} of all bytes written + */ + public String getCapturedOutputAsUtf8String() { + return new String(byteArrayOutputStream.toByteArray(), Charsets.UTF_8); + } + + @Override + public Statement apply(final Statement base, Description description) { + return new Statement() { + @Override + public void evaluate() throws Throwable { + PrintStream originalOut = getOriginal(); + TeeOutputStream tee = new TeeOutputStream(System.out, byteArrayOutputStream); + boolean outReplaced = false; + try { + set(new PrintStream(tee)); + outReplaced = true; + base.evaluate(); + } finally { + if (outReplaced) { + set(originalOut); + } + } + } + }; + } + + private static final class TeeOutputStream extends OutputStream { + private final OutputStream left; + private final OutputStream right; + + public TeeOutputStream(OutputStream left, OutputStream right) { + this.left = left; + this.right = right; + } + + @Override + public void write(int b) throws IOException { + try { + left.write(b); + } finally { + right.write(b); + } + } + + @Override + public void flush() throws IOException { + try { + left.flush(); + } finally { + right.flush(); + } + } + } + + private static final class ReadOnlyByteArrayOutputStream extends ByteArrayOutputStream { + private final ByteArrayOutputStream delegate; + + public ReadOnlyByteArrayOutputStream(ByteArrayOutputStream delegate) { + this.delegate = delegate; + } + + @Override + public synchronized void write(int b) { + throw getIllegalStateException("write(b)"); + } + + @Override + public synchronized void write(byte[] b, int off, int len) { + throw getIllegalStateException("write(byte[], off, len)"); + } + + @Override + public synchronized void writeTo(OutputStream out) { + throw getIllegalStateException("writeOt(out)"); + } + + @Override + public synchronized void reset() { + throw getIllegalStateException("reset()"); + } + + @Override + public synchronized byte[] toByteArray() { + return delegate.toByteArray(); + } + + @Override + public void close() { + // ignore + } + + @Override + public synchronized int size() { + return delegate.size(); + } + + @Override + public synchronized String toString() { + return delegate.toString(); + } + + @Override + public synchronized String toString(String charsetName) throws UnsupportedEncodingException { + return delegate.toString(charsetName); + } + + @SuppressWarnings("deprecation") + @Override + public synchronized String toString(int hibyte) { + return delegate.toString(hibyte); + } + + @Override + public void flush() { + // ignore + } + + @Override + public void write(byte[] b) { + throw getIllegalStateException("write(byte[])"); + } + + private IllegalStateException getIllegalStateException(String desc) { + return new IllegalStateException(desc + " is forbidden"); + } + } +} diff --git a/java-core/google-cloud-core/src/test/java/com/google/cloud/testing/junit4/StdXCaptureRuleTest.java b/java-core/google-cloud-core/src/test/java/com/google/cloud/testing/junit4/StdXCaptureRuleTest.java new file mode 100644 index 0000000000..17d167e1af --- /dev/null +++ b/java-core/google-cloud-core/src/test/java/com/google/cloud/testing/junit4/StdXCaptureRuleTest.java @@ -0,0 +1,76 @@ +/* + * 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. + */ + +package com.google.cloud.testing.junit4; + +import static org.junit.Assert.*; + +import java.io.IOException; +import java.io.PrintStream; +import org.junit.Test; + +public final class StdXCaptureRuleTest { + + @Test(expected = IllegalStateException.class) + public void returnedByteArrayOutputStreamIsReadOnly_writeByte() { + getStdXCaptureRule().getCapturedOutput().write(0); + } + + @Test(expected = IllegalStateException.class) + public void returnedByteArrayOutputStreamIsReadOnly_writeByteArray() throws IOException { + getStdXCaptureRule().getCapturedOutput().write(new byte[] {0}); + } + + @Test(expected = IllegalStateException.class) + public void returnedByteArrayOutputStreamIsReadOnly_writeByteArrayRange() { + getStdXCaptureRule().getCapturedOutput().write(new byte[] {0}, 0, 1); + } + + @Test(expected = IllegalStateException.class) + public void returnedByteArrayOutputStreamIsReadOnly_writeTo() throws IOException { + getStdXCaptureRule().getCapturedOutput().writeTo(System.out); + } + + @Test(expected = IllegalStateException.class) + public void returnedByteArrayOutputStreamIsReadOnly_reset() { + getStdXCaptureRule().getCapturedOutput().reset(); + } + + @Test + public void returnedByteArrayOutputStreamIsReadOnly_close() throws IOException { + getStdXCaptureRule().getCapturedOutput().close(); + } + + @Test + public void returnedByteArrayOutputStreamIsReadOnly_flush() throws IOException { + getStdXCaptureRule().getCapturedOutput().flush(); + } + + private static StdXCaptureRule getStdXCaptureRule() { + return new StdXCaptureRule() { + @Override + protected PrintStream getOriginal() { + fail("unexpected call"); + return null; + } + + @Override + protected void set(PrintStream ps) { + fail("unexpected call"); + } + }; + } +} diff --git a/java-core/google-cloud-core/src/test/java/com/google/cloud/testing/junit4/tests/MultipleAttemptsRuleTest.java b/java-core/google-cloud-core/src/test/java/com/google/cloud/testing/junit4/tests/MultipleAttemptsRuleTest.java new file mode 100644 index 0000000000..e1c98b1953 --- /dev/null +++ b/java-core/google-cloud-core/src/test/java/com/google/cloud/testing/junit4/tests/MultipleAttemptsRuleTest.java @@ -0,0 +1,87 @@ +/* + * 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. + */ + +package com.google.cloud.testing.junit4.tests; + +import static com.google.common.truth.Truth.assertThat; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.fail; + +import com.google.cloud.testing.junit4.MultipleAttemptsRule; +import org.junit.Rule; +import org.junit.Test; +import org.junit.runners.model.MultipleFailureException; +import org.junit.runners.model.Statement; + +public final class MultipleAttemptsRuleTest { + + private static final int NUMBER_OF_ATTEMPTS = 5; + + @Rule public MultipleAttemptsRule rr = new MultipleAttemptsRule(NUMBER_OF_ATTEMPTS, 0); + + private int numberAttempted = 0; + + @Test + public void wontPassUntil5() { + numberAttempted += 1; + assertEquals(NUMBER_OF_ATTEMPTS, numberAttempted); + } + + @Test(expected = IllegalArgumentException.class) + public void errorConstructing_attemptLessThan1() { + new MultipleAttemptsRule(0); + } + + @Test + public void errorConstructing_attemptEquals1() { + new MultipleAttemptsRule(1); + } + + @Test(expected = IllegalArgumentException.class) + public void errorConstructing_attemptGreaterThanOrEqualTo1AndBackoffLessThan0() { + new MultipleAttemptsRule(1, -1); + } + + @Test + public void errorConstructing_attemptGreaterThanOrEqualTo1AndBackoffEqualTo0() { + new MultipleAttemptsRule(1, 0); + } + + @Test + public void allErrorPropagated() { + MultipleAttemptsRule rule = new MultipleAttemptsRule(3, 0); + Statement statement = + rule.apply( + new Statement() { + private int counter = 1; + + @Override + public void evaluate() { + fail("attempt " + counter++); + } + }, + null); + + try { + statement.evaluate(); + } catch (MultipleFailureException mfe) { + // pass + assertThat(mfe.getFailures()).hasSize(3); + } catch (Throwable throwable) { + fail("unexpected error: " + throwable.getMessage()); + } + } +} diff --git a/java-core/google-cloud-core/src/test/java/com/google/cloud/testing/junit4/tests/StdErrCaptureRuleTest.java b/java-core/google-cloud-core/src/test/java/com/google/cloud/testing/junit4/tests/StdErrCaptureRuleTest.java new file mode 100644 index 0000000000..565bb08f12 --- /dev/null +++ b/java-core/google-cloud-core/src/test/java/com/google/cloud/testing/junit4/tests/StdErrCaptureRuleTest.java @@ -0,0 +1,36 @@ +/* + * 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. + */ + +package com.google.cloud.testing.junit4.tests; + +import static org.junit.Assert.assertEquals; + +import com.google.cloud.testing.junit4.StdErrCaptureRule; +import org.junit.Rule; +import org.junit.Test; + +public class StdErrCaptureRuleTest { + + @Rule public StdErrCaptureRule stdOutCap = new StdErrCaptureRule(); + + @Test + public void captureSuccessful() { + System.err.println("err world"); + String expected = "err world" + System.lineSeparator(); + String actual = stdOutCap.getCapturedOutputAsUtf8String(); + assertEquals(expected, actual); + } +} diff --git a/java-core/google-cloud-core/src/test/java/com/google/cloud/testing/junit4/tests/StdOutCaptureRuleTest.java b/java-core/google-cloud-core/src/test/java/com/google/cloud/testing/junit4/tests/StdOutCaptureRuleTest.java new file mode 100644 index 0000000000..8230debded --- /dev/null +++ b/java-core/google-cloud-core/src/test/java/com/google/cloud/testing/junit4/tests/StdOutCaptureRuleTest.java @@ -0,0 +1,36 @@ +/* + * 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. + */ + +package com.google.cloud.testing.junit4.tests; + +import static org.junit.Assert.assertEquals; + +import com.google.cloud.testing.junit4.StdOutCaptureRule; +import org.junit.Rule; +import org.junit.Test; + +public class StdOutCaptureRuleTest { + + @Rule public StdOutCaptureRule stdOutCap = new StdOutCaptureRule(); + + @Test + public void captureSuccessful() { + System.out.println("hello world"); + String expected = "hello world" + System.lineSeparator(); + String actual = stdOutCap.getCapturedOutputAsUtf8String(); + assertEquals(expected, actual); + } +} diff --git a/java-core/pom.xml b/java-core/pom.xml new file mode 100644 index 0000000000..e9e1fca2e5 --- /dev/null +++ b/java-core/pom.xml @@ -0,0 +1,79 @@ + + + 4.0.0 + com.google.cloud + google-cloud-core-parent + pom + 2.66.1-SNAPSHOT + Google Cloud Core Parent + + Java idiomatic client for Google Cloud Platform services. + + + + com.google.api + gapic-generator-java-pom-parent + 2.68.1-SNAPSHOT + ../gapic-generator-java-pom-parent + + + + UTF-8 + UTF-8 + github + google-cloud-core-parent + + true + + + + + + com.google.cloud + google-cloud-shared-dependencies + 3.58.1-SNAPSHOT + pom + import + + + + com.google.truth + truth + 1.4.4 + test + + + org.checkerframework + checker-qual + + + + + org.easymock + easymock + 5.6.0 + test + + + org.mockito + mockito-all + 1.10.19 + test + + + com.google.errorprone + error_prone_annotations + ${errorprone.version} + + + + + + google-cloud-core + google-cloud-core-http + google-cloud-core-grpc + google-cloud-core-bom + + diff --git a/java-iam/.OwlBot-hermetic.yaml b/java-iam/.OwlBot-hermetic.yaml new file mode 100644 index 0000000000..0ea858eb78 --- /dev/null +++ b/java-iam/.OwlBot-hermetic.yaml @@ -0,0 +1,26 @@ +# 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. + + +deep-remove-regex: + - "/java-iam/grpc-google-.*/src" + - "/java-iam/proto-google-.*/src" + +deep-copy-regex: + - source: "/google/iam/(v.*)/.*-java/grpc-google-.*/src" + dest: "/owl-bot-staging/java-iam/$1/grpc-google-iam-$1/src" + - source: "/google/iam/(v.*)/.*-java/proto-google-.*/src" + dest: "/owl-bot-staging/java-iam/$1/proto-google-iam-$1/src" + +api-name: iam diff --git a/java-iam/.OwlBot.yaml b/java-iam/.OwlBot.yaml deleted file mode 100644 index d79161a495..0000000000 --- a/java-iam/.OwlBot.yaml +++ /dev/null @@ -1,38 +0,0 @@ -# Copyright 2021 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - - -deep-remove-regex: - - "/java-iam/grpc-google-.*/src" - - "/java-iam/proto-google-.*/src" - -deep-preserve-regex: - - "/java-iam/proto-google-iam-v1/src/main/java/com/google/iam/v1/logging" - - "/java-iam/proto-google-iam-v1/src/main/proto/google/iam/v1" - -deep-copy-regex: - - source: "/google/iam/v1/google-iam-v1-java/grpc-google-iam-v1-java/src" - dest: "/owl-bot-staging/java-iam/v1/grpc-google-iam-v1/src" - - source: "/google/iam/v1/google-iam-v1-java/proto-google-iam-v1-java/src" - dest: "/owl-bot-staging/java-iam/v1/proto-google-iam-v1/src" - - source: "/google/iam/v2beta/google-cloud-iam-v2beta-java/grpc-google-cloud-iam-v2beta-java/src" - dest: "/owl-bot-staging/java-iam/v2beta/grpc-google-iam-v2beta/src" - - source: "/google/iam/v2beta/google-cloud-iam-v2beta-java/proto-google-cloud-iam-v2beta-java/src" - dest: "/owl-bot-staging/java-iam/v2beta/proto-google-iam-v2beta/src" - - source: "/google/iam/v2/google-cloud-iam-v2-java/grpc-google-cloud-iam-v2-java/src" - dest: "/owl-bot-staging/java-iam/v2/grpc-google-iam-v2/src" - - source: "/google/iam/v2/google-cloud-iam-v2-java/proto-google-cloud-iam-v2-java/src" - dest: "/owl-bot-staging/java-iam/v2/proto-google-iam-v2/src" - -api-name: iam diff --git a/java-iam/.github/CODEOWNERS b/java-iam/.github/CODEOWNERS deleted file mode 100644 index db2d8ad174..0000000000 --- a/java-iam/.github/CODEOWNERS +++ /dev/null @@ -1,13 +0,0 @@ -# Code owners file. -# This file controls who is tagged for review for any given pull request. - -# For syntax help see: -# https://help.github.com/en/github/creating-cloning-and-archiving-repositories/about-code-owners#codeowners-syntax - -* @googleapis/yoshi-java - -# The java-samples-reviewers team is the default owner for samples changes -samples/**/*.java @googleapis/java-samples-reviewers - -# Generated snippets should not be owned by samples reviewers -samples/snippets/generated/ @googleapis/yoshi-java diff --git a/java-iam/.github/ISSUE_TEMPLATE/bug_report.md b/java-iam/.github/ISSUE_TEMPLATE/bug_report.md deleted file mode 100644 index fad37bbdd8..0000000000 --- a/java-iam/.github/ISSUE_TEMPLATE/bug_report.md +++ /dev/null @@ -1,51 +0,0 @@ ---- -name: Bug report -about: Create a report to help us improve - ---- - -Thanks for stopping by to let us know something could be better! - -**PLEASE READ**: If you have a support contract with Google, please create an issue in the [support console](https://cloud.google.com/support/) instead of filing on GitHub. This will ensure a timely response. - -Please run down the following list and make sure you've tried the usual "quick fixes": - - - Search the issues already opened: https://github.com/googleapis/java-iam/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-iam/.github/ISSUE_TEMPLATE/feature_request.md b/java-iam/.github/ISSUE_TEMPLATE/feature_request.md deleted file mode 100644 index 754e30c68a..0000000000 --- a/java-iam/.github/ISSUE_TEMPLATE/feature_request.md +++ /dev/null @@ -1,21 +0,0 @@ ---- -name: Feature request -about: Suggest an idea for this library - ---- - -Thanks for stopping by to let us know something could be better! - -**PLEASE READ**: If you have a support contract with Google, please create an issue in the [support console](https://cloud.google.com/support/) instead of filing on GitHub. This will ensure a timely response. - -**Is your feature request related to a problem? Please describe.** -What the problem is. Example: I'm always frustrated when [...] - -**Describe the solution you'd like** -What you want to happen. - -**Describe alternatives you've considered** -Any alternative solutions or features you've considered. - -**Additional context** -Any other context or screenshots about the feature request. diff --git a/java-iam/.github/ISSUE_TEMPLATE/support_request.md b/java-iam/.github/ISSUE_TEMPLATE/support_request.md deleted file mode 100644 index 9958690321..0000000000 --- a/java-iam/.github/ISSUE_TEMPLATE/support_request.md +++ /dev/null @@ -1,7 +0,0 @@ ---- -name: Support request -about: If you have a support contract with Google, please create an issue in the Google Cloud Support console. - ---- - -**PLEASE READ**: If you have a support contract with Google, please create an issue in the [support console](https://cloud.google.com/support/) instead of filing on GitHub. This will ensure a timely response. diff --git a/java-iam/.github/PULL_REQUEST_TEMPLATE.md b/java-iam/.github/PULL_REQUEST_TEMPLATE.md deleted file mode 100644 index c9e354de0d..0000000000 --- a/java-iam/.github/PULL_REQUEST_TEMPLATE.md +++ /dev/null @@ -1,10 +0,0 @@ -Thank you for opening a Pull Request! Before submitting your PR, there are a few things you can do to make sure it goes smoothly: -- [ ] Make sure to open an issue as a [bug/issue](https://github.com/googleapis/java-iam/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-iam/.github/blunderbuss.yml b/java-iam/.github/blunderbuss.yml deleted file mode 100644 index 2176b05432..0000000000 --- a/java-iam/.github/blunderbuss.yml +++ /dev/null @@ -1,7 +0,0 @@ -# Configuration for the Blunderbuss GitHub app. For more info see -# https://github.com/googleapis/repo-automation-bots/tree/main/packages/blunderbuss -assign_prs_by: -- labels: - - samples - to: - - googleapis/java-samples-reviewers \ No newline at end of file diff --git a/java-iam/.github/generated-files-bot.yml b/java-iam/.github/generated-files-bot.yml deleted file mode 100644 index c644a24e11..0000000000 --- a/java-iam/.github/generated-files-bot.yml +++ /dev/null @@ -1,12 +0,0 @@ -externalManifests: -- type: json - file: 'synth.metadata' - jsonpath: '$.generatedFiles[*]' -- type: json - file: '.github/readme/synth.metadata/synth.metadata' - jsonpath: '$.generatedFiles[*]' -ignoreAuthors: -- 'renovate-bot' -- 'yoshi-automation' -- 'release-please[bot]' -- 'gcf-owl-bot[bot]' diff --git a/java-iam/.github/release-please.yml b/java-iam/.github/release-please.yml deleted file mode 100644 index 7bf5807658..0000000000 --- a/java-iam/.github/release-please.yml +++ /dev/null @@ -1,8 +0,0 @@ -bumpMinorPreMajor: true -handleGHRelease: true -releaseType: java-yoshi -branches: - - bumpMinorPreMajor: true - handleGHRelease: true - releaseType: java-yoshi - branch: java7 diff --git a/java-iam/.github/release-trigger.yml b/java-iam/.github/release-trigger.yml deleted file mode 100644 index d4ca94189e..0000000000 --- a/java-iam/.github/release-trigger.yml +++ /dev/null @@ -1 +0,0 @@ -enabled: true diff --git a/java-iam/.github/sync-repo-settings.yaml b/java-iam/.github/sync-repo-settings.yaml deleted file mode 100644 index dd5626f32d..0000000000 --- a/java-iam/.github/sync-repo-settings.yaml +++ /dev/null @@ -1,40 +0,0 @@ -rebaseMergeAllowed: false -squashMergeAllowed: true -mergeCommitAllowed: false -branchProtectionRules: - - pattern: main - isAdminEnforced: true - requiredApprovingReviewCount: 1 - requiresCodeOwnerReviews: true - requiresStrictStatusChecks: false - requiredStatusCheckContexts: - - dependencies (8) - - dependencies (11) - - lint - - units (8) - - units (11) - - 'Kokoro - Test: Integration' - - cla/google - - OwlBot Post Processor - - pattern: java7 - isAdminEnforced: true - requiredApprovingReviewCount: 1 - requiresCodeOwnerReviews: true - requiresStrictStatusChecks: false - requiredStatusCheckContexts: - - dependencies (8) - - dependencies (11) - - lint - - units (7) - - units (8) - - units (11) - - 'Kokoro - Test: Integration' - - cla/google - - OwlBot Post Processor -permissionRules: - - team: yoshi-admins - permission: admin - - team: yoshi-java-admins - permission: admin - - team: yoshi-java - permission: push diff --git a/java-iam/.github/trusted-contribution.yml b/java-iam/.github/trusted-contribution.yml deleted file mode 100644 index a0ba1f7d90..0000000000 --- a/java-iam/.github/trusted-contribution.yml +++ /dev/null @@ -1,3 +0,0 @@ -trustedContributors: -- renovate-bot -- gcf-owl-bot[bot] diff --git a/java-iam/.github/workflows/approve-readme.yaml b/java-iam/.github/workflows/approve-readme.yaml deleted file mode 100644 index f5fc7d5169..0000000000 --- a/java-iam/.github/workflows/approve-readme.yaml +++ /dev/null @@ -1,69 +0,0 @@ -# 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@v6 - 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-iam/.github/workflows/auto-release.yaml b/java-iam/.github/workflows/auto-release.yaml deleted file mode 100644 index 7a106d007e..0000000000 --- a/java-iam/.github/workflows/auto-release.yaml +++ /dev/null @@ -1,103 +0,0 @@ -# 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-release -jobs: - approve: - runs-on: ubuntu-latest - if: contains(github.head_ref, 'release-please') - steps: - - uses: actions/github-script@v6 - with: - github-token: ${{secrets.YOSHI_APPROVER_TOKEN}} - debug: true - script: | - // only approve PRs from release-please[bot] - if (context.payload.pull_request.user.login !== "release-please[bot]") { - return; - } - - // only approve PRs like "chore(main): release " - if ( !context.payload.pull_request.title.startsWith("chore(main): release") ) { - return; - } - - // only approve PRs with pom.xml and versions.txt changes - const filesPromise = github.rest.pulls.listFiles.endpoint({ - owner: context.repo.owner, - repo: context.repo.repo, - pull_number: context.payload.pull_request.number, - }); - const changed_files = await github.paginate(filesPromise) - - if ( changed_files.length < 1 ) { - console.log( "Not proceeding since PR is empty!" ) - return; - } - - if ( !changed_files.some(v => v.filename.includes("pom")) || !changed_files.some(v => v.filename.includes("versions.txt")) ) { - console.log( "PR file changes do not have pom.xml or versions.txt -- something is wrong. PTAL!" ) - return; - } - - // trigger auto-release when - // 1) it is a SNAPSHOT release (auto-generated post regular release) - // 2) there are dependency updates only - // 3) there are no open dependency update PRs in this repo (to avoid multiple releases) - if ( - context.payload.pull_request.body.includes("Fix") || - context.payload.pull_request.body.includes("Build") || - context.payload.pull_request.body.includes("Documentation") || - context.payload.pull_request.body.includes("BREAKING CHANGES") || - context.payload.pull_request.body.includes("Features") - ) { - console.log( "Not auto-releasing since it is not a dependency-update-only release." ); - return; - } - - const promise = github.rest.pulls.list.endpoint({ - owner: context.repo.owner, - repo: context.repo.repo, - state: 'open' - }); - const open_pulls = await github.paginate(promise) - - if ( open_pulls.length > 1 && !context.payload.pull_request.title.includes("SNAPSHOT") ) { - for ( const pull of open_pulls ) { - if ( pull.title.startsWith("deps: update dependency") ) { - console.log( "Not auto-releasing yet since there are dependency update PRs open in this repo." ); - return; - } - } - } - - // approve release PR - await github.rest.pulls.createReview({ - owner: context.repo.owner, - repo: context.repo.repo, - body: 'Rubber stamped release!', - pull_number: context.payload.pull_request.number, - event: 'APPROVE' - }); - - // attach kokoro:force-run and automerge labels - await github.rest.issues.addLabels({ - owner: context.repo.owner, - repo: context.repo.repo, - issue_number: context.payload.pull_request.number, - labels: ['kokoro:force-run', 'automerge'] - }); diff --git a/java-iam/.github/workflows/ci.yaml b/java-iam/.github/workflows/ci.yaml deleted file mode 100644 index e3bb26e377..0000000000 --- a/java-iam/.github/workflows/ci.yaml +++ /dev/null @@ -1,89 +0,0 @@ -# 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: [8, 11, 17] - steps: - - uses: actions/checkout@v3 - - uses: actions/setup-java@v3 - with: - distribution: zulu - java-version: ${{matrix.java}} - - run: java -version - - 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@v3 - - uses: actions/setup-java@v3 - with: - distribution: zulu - java-version: 8 - - run: java -version - - run: .kokoro/build.bat - env: - JOB_TYPE: test - dependencies: - runs-on: ubuntu-latest - strategy: - matrix: - java: [8, 11, 17] - steps: - - uses: actions/checkout@v3 - - uses: actions/setup-java@v3 - with: - distribution: zulu - java-version: ${{matrix.java}} - - run: java -version - - run: .kokoro/dependencies.sh - lint: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - uses: actions/setup-java@v3 - with: - distribution: zulu - java-version: 11 - - run: java -version - - run: .kokoro/build.sh - env: - JOB_TYPE: lint - clirr: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - uses: actions/setup-java@v3 - with: - distribution: zulu - java-version: 8 - - run: java -version - - run: .kokoro/build.sh - env: - JOB_TYPE: clirr diff --git a/java-iam/.gitignore b/java-iam/.gitignore deleted file mode 100644 index 069d08fc73..0000000000 --- a/java-iam/.gitignore +++ /dev/null @@ -1,17 +0,0 @@ -# Maven -target/ - -# Eclipse -.classpath -.project -.settings - -# Intellij -*.iml -.idea/ - -# python utilities -*.pyc -__pycache__ - -.flattened-pom.xml diff --git a/java-iam/.kokoro/build.bat b/java-iam/.kokoro/build.bat deleted file mode 100644 index 067cf4a4c4..0000000000 --- a/java-iam/.kokoro/build.bat +++ /dev/null @@ -1,18 +0,0 @@ -:: 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-iam/.kokoro/build.sh b/java-iam/.kokoro/build.sh deleted file mode 100755 index 80348f95ca..0000000000 --- a/java-iam/.kokoro/build.sh +++ /dev/null @@ -1,134 +0,0 @@ -#!/bin/bash -# Copyright 2019 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -set -eo pipefail - -## Get the directory of the build script -scriptDir=$(realpath $(dirname "${BASH_SOURCE[0]}")) -## cd to the parent directory, i.e. the root of the git repo -cd ${scriptDir}/.. - -# include common functions -source ${scriptDir}/common.sh - -# Print out Maven & Java version -mvn -version -echo ${JOB_TYPE} - -# attempt to install 3 times with exponential backoff (starting with 10 seconds) -retry_with_backoff 3 10 \ - mvn install -B -V -ntp \ - -DskipTests=true \ - -Dclirr.skip=true \ - -Denforcer.skip=true \ - -Dmaven.javadoc.skip=true \ - -Dgcloud.download.skip=true \ - -T 1C - -# if GOOGLE_APPLICATION_CREDENTIALS is specified as a relative path, prepend Kokoro root directory onto it -if [[ ! -z "${GOOGLE_APPLICATION_CREDENTIALS}" && "${GOOGLE_APPLICATION_CREDENTIALS}" != /* ]]; then - export GOOGLE_APPLICATION_CREDENTIALS=$(realpath ${KOKORO_GFILE_DIR}/${GOOGLE_APPLICATION_CREDENTIALS}) -fi - -RETURN_CODE=0 -set +e - -case ${JOB_TYPE} in -test) - mvn test -B -ntp -Dclirr.skip=true -Denforcer.skip=true - RETURN_CODE=$? - ;; -lint) - mvn com.coveo:fmt-maven-plugin:check -B -ntp - RETURN_CODE=$? - ;; -javadoc) - mvn javadoc:javadoc javadoc:test-javadoc -B -ntp - RETURN_CODE=$? - ;; -integration) - mvn -B ${INTEGRATION_TEST_ARGS} \ - -ntp \ - -Penable-integration-tests \ - -DtrimStackTrace=false \ - -Dclirr.skip=true \ - -Denforcer.skip=true \ - -fae \ - verify - RETURN_CODE=$? - ;; -graalvm) - # Run Unit and Integration Tests with Native Image - mvn -B ${INTEGRATION_TEST_ARGS} -ntp -Pnative -Penable-integration-tests test - RETURN_CODE=$? - ;; -graalvm17) - # Run Unit and Integration Tests with Native Image - mvn -B ${INTEGRATION_TEST_ARGS} -ntp -Pnative -Penable-integration-tests test - 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 \ - -fae \ - verify - RETURN_CODE=$? - popd - else - echo "no sample pom.xml found - skipping sample tests" - fi - ;; -clirr) - mvn -B -ntp -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-iam -fi - -echo "exiting with ${RETURN_CODE}" -exit ${RETURN_CODE} diff --git a/java-iam/.kokoro/coerce_logs.sh b/java-iam/.kokoro/coerce_logs.sh deleted file mode 100755 index 46edbf7f2f..0000000000 --- a/java-iam/.kokoro/coerce_logs.sh +++ /dev/null @@ -1,37 +0,0 @@ -#!/bin/bash -# Copyright 2019 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# This script finds and moves sponge logs so that they can be found by placer -# and are not flagged as flaky by sponge. - -set -eo pipefail - -## Get the directory of the build script -scriptDir=$(realpath $(dirname "${BASH_SOURCE[0]}")) -## cd to the parent directory, i.e. the root of the git repo -cd ${scriptDir}/.. - -job=$(basename ${KOKORO_JOB_NAME}) - -echo "coercing sponge logs..." -for xml in `find . -name *-sponge_log.xml` -do - class=$(basename ${xml} | cut -d- -f2) - dir=$(dirname ${xml})/${job}/${class} - text=$(dirname ${xml})/${class}-sponge_log.txt - mkdir -p ${dir} - mv ${xml} ${dir}/sponge_log.xml - mv ${text} ${dir}/sponge_log.txt -done diff --git a/java-iam/.kokoro/common.cfg b/java-iam/.kokoro/common.cfg deleted file mode 100644 index 349dd92a78..0000000000 --- a/java-iam/.kokoro/common.cfg +++ /dev/null @@ -1,13 +0,0 @@ -# Format: //devtools/kokoro/config/proto/build.proto - -# Download trampoline resources. These will be in ${KOKORO_GFILE_DIR} -gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/trampoline" - -# All builds use the trampoline script to run in docker. -build_file: "java-iam/.kokoro/trampoline.sh" - -# Tell the trampoline which build file to use. -env_vars: { - key: "TRAMPOLINE_BUILD_FILE" - value: "github/java-iam/.kokoro/build.sh" -} diff --git a/java-iam/.kokoro/common.sh b/java-iam/.kokoro/common.sh deleted file mode 100644 index f8f957af11..0000000000 --- a/java-iam/.kokoro/common.sh +++ /dev/null @@ -1,60 +0,0 @@ -#!/bin/bash -# Copyright 2020 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -function retry_with_backoff { - attempts_left=$1 - sleep_seconds=$2 - shift 2 - command=$@ - - - # store current flag state - flags=$- - - # allow a failures to continue - set +e - ${command} - exit_code=$? - - # restore "e" flag - if [[ ${flags} =~ e ]] - then set -e - else set +e - fi - - if [[ $exit_code == 0 ]] - then - return 0 - fi - - # failure - if [[ ${attempts_left} > 0 ]] - then - echo "failure (${exit_code}), sleeping ${sleep_seconds}..." - sleep ${sleep_seconds} - new_attempts=$((${attempts_left} - 1)) - new_sleep=$((${sleep_seconds} * 2)) - retry_with_backoff ${new_attempts} ${new_sleep} ${command} - fi - - return $exit_code -} - -## Helper functionss -function now() { date +"%Y-%m-%d %H:%M:%S" | tr -d '\n'; } -function msg() { println "$*" >&2; } -function println() { printf '%s\n' "$(now) $*"; } - -## Helper comment to trigger updated repo dependency release \ No newline at end of file diff --git a/java-iam/.kokoro/continuous/common.cfg b/java-iam/.kokoro/continuous/common.cfg deleted file mode 100644 index 90c639ac13..0000000000 --- a/java-iam/.kokoro/continuous/common.cfg +++ /dev/null @@ -1,25 +0,0 @@ -# Format: //devtools/kokoro/config/proto/build.proto - -# Build logs will be here -action { - define_artifacts { - regex: "**/*sponge_log.xml" - regex: "**/*sponge_log.txt" - } -} - -# Download trampoline resources. -gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/trampoline" - -# Use the trampoline script to run in docker. -build_file: "java-iam/.kokoro/trampoline.sh" - -env_vars: { - key: "TRAMPOLINE_BUILD_FILE" - value: "github/java-iam/.kokoro/build.sh" -} - -env_vars: { - key: "JOB_TYPE" - value: "test" -} diff --git a/java-iam/.kokoro/continuous/dependencies.cfg b/java-iam/.kokoro/continuous/dependencies.cfg deleted file mode 100644 index fda7101a64..0000000000 --- a/java-iam/.kokoro/continuous/dependencies.cfg +++ /dev/null @@ -1,12 +0,0 @@ -# Format: //devtools/kokoro/config/proto/build.proto - -# Configure the docker image for kokoro-trampoline. -env_vars: { - key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-kokoro-resources/java8" -} - -env_vars: { - key: "TRAMPOLINE_BUILD_FILE" - value: "github/java-iam/.kokoro/dependencies.sh" -} diff --git a/java-iam/.kokoro/continuous/integration.cfg b/java-iam/.kokoro/continuous/integration.cfg deleted file mode 100644 index 3b017fc80f..0000000000 --- a/java-iam/.kokoro/continuous/integration.cfg +++ /dev/null @@ -1,7 +0,0 @@ -# Format: //devtools/kokoro/config/proto/build.proto - -# Configure the docker image for kokoro-trampoline. -env_vars: { - key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-kokoro-resources/java8" -} diff --git a/java-iam/.kokoro/continuous/java11.cfg b/java-iam/.kokoro/continuous/java11.cfg deleted file mode 100644 index 709f2b4c73..0000000000 --- a/java-iam/.kokoro/continuous/java11.cfg +++ /dev/null @@ -1,7 +0,0 @@ -# Format: //devtools/kokoro/config/proto/build.proto - -# Configure the docker image for kokoro-trampoline. -env_vars: { - key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-kokoro-resources/java11" -} diff --git a/java-iam/.kokoro/continuous/java7.cfg b/java-iam/.kokoro/continuous/java7.cfg deleted file mode 100644 index cb24f44eea..0000000000 --- a/java-iam/.kokoro/continuous/java7.cfg +++ /dev/null @@ -1,7 +0,0 @@ -# Format: //devtools/kokoro/config/proto/build.proto - -# Configure the docker image for kokoro-trampoline. -env_vars: { - key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-kokoro-resources/java7" -} diff --git a/java-iam/.kokoro/continuous/java8-osx.cfg b/java-iam/.kokoro/continuous/java8-osx.cfg deleted file mode 100644 index 1affbbe4ad..0000000000 --- a/java-iam/.kokoro/continuous/java8-osx.cfg +++ /dev/null @@ -1,3 +0,0 @@ -# Format: //devtools/kokoro/config/proto/build.proto - -build_file: "java-iam/.kokoro/build.sh" diff --git a/java-iam/.kokoro/continuous/java8-win.cfg b/java-iam/.kokoro/continuous/java8-win.cfg deleted file mode 100644 index 4c8e051ae0..0000000000 --- a/java-iam/.kokoro/continuous/java8-win.cfg +++ /dev/null @@ -1,3 +0,0 @@ -# Format: //devtools/kokoro/config/proto/build.proto - -build_file: "java-iam/.kokoro/build.bat" diff --git a/java-iam/.kokoro/continuous/java8.cfg b/java-iam/.kokoro/continuous/java8.cfg deleted file mode 100644 index 495cc7bacd..0000000000 --- a/java-iam/.kokoro/continuous/java8.cfg +++ /dev/null @@ -1,12 +0,0 @@ -# Format: //devtools/kokoro/config/proto/build.proto - -# Configure the docker image for kokoro-trampoline. -env_vars: { - key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-kokoro-resources/java8" -} - -env_vars: { - key: "REPORT_COVERAGE" - value: "true" -} diff --git a/java-iam/.kokoro/continuous/lint.cfg b/java-iam/.kokoro/continuous/lint.cfg deleted file mode 100644 index 6d323c8ae7..0000000000 --- a/java-iam/.kokoro/continuous/lint.cfg +++ /dev/null @@ -1,13 +0,0 @@ -# Format: //devtools/kokoro/config/proto/build.proto - -# Configure the docker image for kokoro-trampoline. - -env_vars: { - key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-kokoro-resources/java8" -} - -env_vars: { - key: "JOB_TYPE" - value: "lint" -} \ No newline at end of file diff --git a/java-iam/.kokoro/continuous/propose_release.cfg b/java-iam/.kokoro/continuous/propose_release.cfg deleted file mode 100644 index 4df19cc2f9..0000000000 --- a/java-iam/.kokoro/continuous/propose_release.cfg +++ /dev/null @@ -1,53 +0,0 @@ -# Format: //devtools/kokoro/config/proto/build.proto - -# Build logs will be here -action { - define_artifacts { - regex: "**/*sponge_log.xml" - } -} - -# Download trampoline resources. -gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/trampoline" - -# Use the trampoline script to run in docker. -build_file: "java-iam/.kokoro/trampoline.sh" - -# Configure the docker image for kokoro-trampoline. -env_vars: { - key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-kokoro-resources/node:10-user" -} - -env_vars: { - key: "TRAMPOLINE_BUILD_FILE" - value: "github/java-iam/.kokoro/continuous/propose_release.sh" -} - -# tokens used by release-please to keep an up-to-date release PR. -before_action { - fetch_keystore { - keystore_resource { - keystore_config_id: 73713 - keyname: "github-magic-proxy-key-release-please" - } - } -} - -before_action { - fetch_keystore { - keystore_resource { - keystore_config_id: 73713 - keyname: "github-magic-proxy-token-release-please" - } - } -} - -before_action { - fetch_keystore { - keystore_resource { - keystore_config_id: 73713 - keyname: "github-magic-proxy-url-release-please" - } - } -} diff --git a/java-iam/.kokoro/continuous/samples.cfg b/java-iam/.kokoro/continuous/samples.cfg deleted file mode 100644 index fa7b493d0b..0000000000 --- a/java-iam/.kokoro/continuous/samples.cfg +++ /dev/null @@ -1,31 +0,0 @@ -# Format: //devtools/kokoro/config/proto/build.proto - -# Configure the docker image for kokoro-trampoline. -env_vars: { - key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-kokoro-resources/java8" -} - -env_vars: { - key: "JOB_TYPE" - value: "samples" -} - -env_vars: { - key: "GCLOUD_PROJECT" - value: "gcloud-devel" -} - -env_vars: { - key: "GOOGLE_APPLICATION_CREDENTIALS" - value: "keystore/73713_java_it_service_account" -} - -before_action { - fetch_keystore { - keystore_resource { - keystore_config_id: 73713 - keyname: "java_it_service_account" - } - } -} diff --git a/java-iam/.kokoro/dependencies.sh b/java-iam/.kokoro/dependencies.sh deleted file mode 100755 index bd8960246f..0000000000 --- a/java-iam/.kokoro/dependencies.sh +++ /dev/null @@ -1,59 +0,0 @@ -#!/bin/bash -# Copyright 2019 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -set -eo pipefail -shopt -s nullglob - -## Get the directory of the build script -scriptDir=$(realpath $(dirname "${BASH_SOURCE[0]}")) -## cd to the parent directory, i.e. the root of the git repo -cd ${scriptDir}/.. - -# include common functions -source ${scriptDir}/common.sh - -# Print out Java -java -version -echo $JOB_TYPE - -function determineMavenOpts() { - local javaVersion=$( - # filter down to the version line, then pull out the version between quotes, - # then trim the version number down to its minimal number (removing any - # update or suffix number). - java -version 2>&1 | grep "version" \ - | sed -E 's/^.*"(.*?)".*$/\1/g' \ - | sed -E 's/^(1\.[0-9]\.0).*$/\1/g' - ) - - 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-iam/.kokoro/nightly/common.cfg b/java-iam/.kokoro/nightly/common.cfg deleted file mode 100644 index 90c639ac13..0000000000 --- a/java-iam/.kokoro/nightly/common.cfg +++ /dev/null @@ -1,25 +0,0 @@ -# Format: //devtools/kokoro/config/proto/build.proto - -# Build logs will be here -action { - define_artifacts { - regex: "**/*sponge_log.xml" - regex: "**/*sponge_log.txt" - } -} - -# Download trampoline resources. -gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/trampoline" - -# Use the trampoline script to run in docker. -build_file: "java-iam/.kokoro/trampoline.sh" - -env_vars: { - key: "TRAMPOLINE_BUILD_FILE" - value: "github/java-iam/.kokoro/build.sh" -} - -env_vars: { - key: "JOB_TYPE" - value: "test" -} diff --git a/java-iam/.kokoro/nightly/dependencies.cfg b/java-iam/.kokoro/nightly/dependencies.cfg deleted file mode 100644 index fda7101a64..0000000000 --- a/java-iam/.kokoro/nightly/dependencies.cfg +++ /dev/null @@ -1,12 +0,0 @@ -# Format: //devtools/kokoro/config/proto/build.proto - -# Configure the docker image for kokoro-trampoline. -env_vars: { - key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-kokoro-resources/java8" -} - -env_vars: { - key: "TRAMPOLINE_BUILD_FILE" - value: "github/java-iam/.kokoro/dependencies.sh" -} diff --git a/java-iam/.kokoro/nightly/integration.cfg b/java-iam/.kokoro/nightly/integration.cfg deleted file mode 100644 index a2907a257b..0000000000 --- a/java-iam/.kokoro/nightly/integration.cfg +++ /dev/null @@ -1,37 +0,0 @@ -# Format: //devtools/kokoro/config/proto/build.proto - -# Configure the docker image for kokoro-trampoline. -env_vars: { - key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-kokoro-resources/java8" -} - -env_vars: { - key: "JOB_TYPE" - value: "integration" -} -# TODO: remove this after we've migrated all tests and scripts -env_vars: { - key: "GCLOUD_PROJECT" - value: "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-iam/.kokoro/nightly/java11-integration.cfg b/java-iam/.kokoro/nightly/java11-integration.cfg deleted file mode 100644 index 58049cc38f..0000000000 --- a/java-iam/.kokoro/nightly/java11-integration.cfg +++ /dev/null @@ -1,37 +0,0 @@ -# Format: //devtools/kokoro/config/proto/build.proto - -# Configure the docker image for kokoro-trampoline. -env_vars: { - key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-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-iam/.kokoro/nightly/java11.cfg b/java-iam/.kokoro/nightly/java11.cfg deleted file mode 100644 index 709f2b4c73..0000000000 --- a/java-iam/.kokoro/nightly/java11.cfg +++ /dev/null @@ -1,7 +0,0 @@ -# Format: //devtools/kokoro/config/proto/build.proto - -# Configure the docker image for kokoro-trampoline. -env_vars: { - key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-kokoro-resources/java11" -} diff --git a/java-iam/.kokoro/nightly/java7.cfg b/java-iam/.kokoro/nightly/java7.cfg deleted file mode 100644 index cb24f44eea..0000000000 --- a/java-iam/.kokoro/nightly/java7.cfg +++ /dev/null @@ -1,7 +0,0 @@ -# Format: //devtools/kokoro/config/proto/build.proto - -# Configure the docker image for kokoro-trampoline. -env_vars: { - key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-kokoro-resources/java7" -} diff --git a/java-iam/.kokoro/nightly/java8-osx.cfg b/java-iam/.kokoro/nightly/java8-osx.cfg deleted file mode 100644 index 1affbbe4ad..0000000000 --- a/java-iam/.kokoro/nightly/java8-osx.cfg +++ /dev/null @@ -1,3 +0,0 @@ -# Format: //devtools/kokoro/config/proto/build.proto - -build_file: "java-iam/.kokoro/build.sh" diff --git a/java-iam/.kokoro/nightly/java8-win.cfg b/java-iam/.kokoro/nightly/java8-win.cfg deleted file mode 100644 index 4c8e051ae0..0000000000 --- a/java-iam/.kokoro/nightly/java8-win.cfg +++ /dev/null @@ -1,3 +0,0 @@ -# Format: //devtools/kokoro/config/proto/build.proto - -build_file: "java-iam/.kokoro/build.bat" diff --git a/java-iam/.kokoro/nightly/java8.cfg b/java-iam/.kokoro/nightly/java8.cfg deleted file mode 100644 index 495cc7bacd..0000000000 --- a/java-iam/.kokoro/nightly/java8.cfg +++ /dev/null @@ -1,12 +0,0 @@ -# Format: //devtools/kokoro/config/proto/build.proto - -# Configure the docker image for kokoro-trampoline. -env_vars: { - key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-kokoro-resources/java8" -} - -env_vars: { - key: "REPORT_COVERAGE" - value: "true" -} diff --git a/java-iam/.kokoro/nightly/lint.cfg b/java-iam/.kokoro/nightly/lint.cfg deleted file mode 100644 index 6d323c8ae7..0000000000 --- a/java-iam/.kokoro/nightly/lint.cfg +++ /dev/null @@ -1,13 +0,0 @@ -# Format: //devtools/kokoro/config/proto/build.proto - -# Configure the docker image for kokoro-trampoline. - -env_vars: { - key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-kokoro-resources/java8" -} - -env_vars: { - key: "JOB_TYPE" - value: "lint" -} \ No newline at end of file diff --git a/java-iam/.kokoro/nightly/samples.cfg b/java-iam/.kokoro/nightly/samples.cfg deleted file mode 100644 index 9761fd8648..0000000000 --- a/java-iam/.kokoro/nightly/samples.cfg +++ /dev/null @@ -1,38 +0,0 @@ -# Format: //devtools/kokoro/config/proto/build.proto - -# Configure the docker image for kokoro-trampoline. -env_vars: { - key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-kokoro-resources/java8" -} - -env_vars: { - key: "JOB_TYPE" - value: "samples" -} - -# TODO: remove this after we've migrated all tests and scripts -env_vars: { - key: "GCLOUD_PROJECT" - value: "java-docs-samples-testing" -} - -env_vars: { - key: "GOOGLE_CLOUD_PROJECT" - value: "java-docs-samples-testing" -} - -env_vars: { - key: "GOOGLE_APPLICATION_CREDENTIALS" - value: "secret_manager/java-docs-samples-service-account" -} - -env_vars: { - key: "SECRET_MANAGER_KEYS" - value: "java-docs-samples-service-account" -} - -env_vars: { - key: "ENABLE_FLAKYBOT" - value: "true" -} diff --git a/java-iam/.kokoro/populate-secrets.sh b/java-iam/.kokoro/populate-secrets.sh deleted file mode 100755 index f52514257e..0000000000 --- a/java-iam/.kokoro/populate-secrets.sh +++ /dev/null @@ -1,43 +0,0 @@ -#!/bin/bash -# Copyright 2020 Google LLC. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -set -eo pipefail - -function now { date +"%Y-%m-%d %H:%M:%S" | tr -d '\n' ;} -function msg { println "$*" >&2 ;} -function println { printf '%s\n' "$(now) $*" ;} - - -# Populates requested secrets set in SECRET_MANAGER_KEYS from service account: -# kokoro-trampoline@cloud-devrel-kokoro-resources.iam.gserviceaccount.com -SECRET_LOCATION="${KOKORO_GFILE_DIR}/secret_manager" -msg "Creating folder on disk for secrets: ${SECRET_LOCATION}" -mkdir -p ${SECRET_LOCATION} -for key in $(echo ${SECRET_MANAGER_KEYS} | sed "s/,/ /g") -do - msg "Retrieving secret ${key}" - docker run --entrypoint=gcloud \ - --volume=${KOKORO_GFILE_DIR}:${KOKORO_GFILE_DIR} \ - gcr.io/google.com/cloudsdktool/cloud-sdk \ - secrets versions access latest \ - --project cloud-devrel-kokoro-resources \ - --secret ${key} > \ - "${SECRET_LOCATION}/${key}" - if [[ $? == 0 ]]; then - msg "Secret written to ${SECRET_LOCATION}/${key}" - else - msg "Error retrieving secret ${key}" - fi -done diff --git a/java-iam/.kokoro/presubmit/clirr.cfg b/java-iam/.kokoro/presubmit/clirr.cfg deleted file mode 100644 index ec572442e2..0000000000 --- a/java-iam/.kokoro/presubmit/clirr.cfg +++ /dev/null @@ -1,13 +0,0 @@ -# Format: //devtools/kokoro/config/proto/build.proto - -# Configure the docker image for kokoro-trampoline. - -env_vars: { - key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-kokoro-resources/java8" -} - -env_vars: { - key: "JOB_TYPE" - value: "clirr" -} \ No newline at end of file diff --git a/java-iam/.kokoro/presubmit/common.cfg b/java-iam/.kokoro/presubmit/common.cfg deleted file mode 100644 index 5bce0b64cb..0000000000 --- a/java-iam/.kokoro/presubmit/common.cfg +++ /dev/null @@ -1,34 +0,0 @@ -# Format: //devtools/kokoro/config/proto/build.proto - -# Build logs will be here -action { - define_artifacts { - regex: "**/*sponge_log.xml" - regex: "**/*sponge_log.txt" - } -} - -# Download trampoline resources. -gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/trampoline" - -# Use the trampoline script to run in docker. -build_file: "java-iam/.kokoro/trampoline.sh" - -env_vars: { - key: "TRAMPOLINE_BUILD_FILE" - value: "github/java-iam/.kokoro/build.sh" -} - -env_vars: { - key: "JOB_TYPE" - value: "test" -} - -before_action { - fetch_keystore { - keystore_resource { - keystore_config_id: 73713 - keyname: "dpebot_codecov_token" - } - } -} diff --git a/java-iam/.kokoro/presubmit/dependencies.cfg b/java-iam/.kokoro/presubmit/dependencies.cfg deleted file mode 100644 index fda7101a64..0000000000 --- a/java-iam/.kokoro/presubmit/dependencies.cfg +++ /dev/null @@ -1,12 +0,0 @@ -# Format: //devtools/kokoro/config/proto/build.proto - -# Configure the docker image for kokoro-trampoline. -env_vars: { - key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-kokoro-resources/java8" -} - -env_vars: { - key: "TRAMPOLINE_BUILD_FILE" - value: "github/java-iam/.kokoro/dependencies.sh" -} diff --git a/java-iam/.kokoro/presubmit/graalvm-native-17.cfg b/java-iam/.kokoro/presubmit/graalvm-native-17.cfg deleted file mode 100644 index a3f7fb9d49..0000000000 --- a/java-iam/.kokoro/presubmit/graalvm-native-17.cfg +++ /dev/null @@ -1,33 +0,0 @@ -# Format: //devtools/kokoro/config/proto/build.proto - -# Configure the docker image for kokoro-trampoline. -env_vars: { - key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-kokoro-resources/graalvm17" -} - -env_vars: { - key: "JOB_TYPE" - value: "graalvm17" -} - -# 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" -} \ No newline at end of file diff --git a/java-iam/.kokoro/presubmit/graalvm-native.cfg b/java-iam/.kokoro/presubmit/graalvm-native.cfg deleted file mode 100644 index 4c7225ec92..0000000000 --- a/java-iam/.kokoro/presubmit/graalvm-native.cfg +++ /dev/null @@ -1,33 +0,0 @@ -# Format: //devtools/kokoro/config/proto/build.proto - -# Configure the docker image for kokoro-trampoline. -env_vars: { - key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-kokoro-resources/graalvm" -} - -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" -} diff --git a/java-iam/.kokoro/presubmit/integration.cfg b/java-iam/.kokoro/presubmit/integration.cfg deleted file mode 100644 index dded67a9d5..0000000000 --- a/java-iam/.kokoro/presubmit/integration.cfg +++ /dev/null @@ -1,33 +0,0 @@ -# Format: //devtools/kokoro/config/proto/build.proto - -# Configure the docker image for kokoro-trampoline. -env_vars: { - key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-kokoro-resources/java8" -} - -env_vars: { - key: "JOB_TYPE" - value: "integration" -} - -# TODO: remove this after we've migrated all tests and scripts -env_vars: { - key: "GCLOUD_PROJECT" - value: "gcloud-devel" -} - -env_vars: { - key: "GOOGLE_CLOUD_PROJECT" - value: "gcloud-devel" -} - -env_vars: { - key: "GOOGLE_APPLICATION_CREDENTIALS" - value: "secret_manager/java-it-service-account" -} - -env_vars: { - key: "SECRET_MANAGER_KEYS" - value: "java-it-service-account" -} diff --git a/java-iam/.kokoro/presubmit/java11.cfg b/java-iam/.kokoro/presubmit/java11.cfg deleted file mode 100644 index 709f2b4c73..0000000000 --- a/java-iam/.kokoro/presubmit/java11.cfg +++ /dev/null @@ -1,7 +0,0 @@ -# Format: //devtools/kokoro/config/proto/build.proto - -# Configure the docker image for kokoro-trampoline. -env_vars: { - key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-kokoro-resources/java11" -} diff --git a/java-iam/.kokoro/presubmit/java7.cfg b/java-iam/.kokoro/presubmit/java7.cfg deleted file mode 100644 index cb24f44eea..0000000000 --- a/java-iam/.kokoro/presubmit/java7.cfg +++ /dev/null @@ -1,7 +0,0 @@ -# Format: //devtools/kokoro/config/proto/build.proto - -# Configure the docker image for kokoro-trampoline. -env_vars: { - key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-kokoro-resources/java7" -} diff --git a/java-iam/.kokoro/presubmit/java8-osx.cfg b/java-iam/.kokoro/presubmit/java8-osx.cfg deleted file mode 100644 index 1affbbe4ad..0000000000 --- a/java-iam/.kokoro/presubmit/java8-osx.cfg +++ /dev/null @@ -1,3 +0,0 @@ -# Format: //devtools/kokoro/config/proto/build.proto - -build_file: "java-iam/.kokoro/build.sh" diff --git a/java-iam/.kokoro/presubmit/java8-win.cfg b/java-iam/.kokoro/presubmit/java8-win.cfg deleted file mode 100644 index 4c8e051ae0..0000000000 --- a/java-iam/.kokoro/presubmit/java8-win.cfg +++ /dev/null @@ -1,3 +0,0 @@ -# Format: //devtools/kokoro/config/proto/build.proto - -build_file: "java-iam/.kokoro/build.bat" diff --git a/java-iam/.kokoro/presubmit/java8.cfg b/java-iam/.kokoro/presubmit/java8.cfg deleted file mode 100644 index 495cc7bacd..0000000000 --- a/java-iam/.kokoro/presubmit/java8.cfg +++ /dev/null @@ -1,12 +0,0 @@ -# Format: //devtools/kokoro/config/proto/build.proto - -# Configure the docker image for kokoro-trampoline. -env_vars: { - key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-kokoro-resources/java8" -} - -env_vars: { - key: "REPORT_COVERAGE" - value: "true" -} diff --git a/java-iam/.kokoro/presubmit/linkage-monitor.cfg b/java-iam/.kokoro/presubmit/linkage-monitor.cfg deleted file mode 100644 index 7af8810aaf..0000000000 --- a/java-iam/.kokoro/presubmit/linkage-monitor.cfg +++ /dev/null @@ -1,12 +0,0 @@ -# Format: //devtools/kokoro/config/proto/build.proto - -# Configure the docker image for kokoro-trampoline. -env_vars: { - key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-kokoro-resources/java8" -} - -env_vars: { - key: "TRAMPOLINE_BUILD_FILE" - value: "github/java-iam/.kokoro/linkage-monitor.sh" -} \ No newline at end of file diff --git a/java-iam/.kokoro/presubmit/lint.cfg b/java-iam/.kokoro/presubmit/lint.cfg deleted file mode 100644 index 6d323c8ae7..0000000000 --- a/java-iam/.kokoro/presubmit/lint.cfg +++ /dev/null @@ -1,13 +0,0 @@ -# Format: //devtools/kokoro/config/proto/build.proto - -# Configure the docker image for kokoro-trampoline. - -env_vars: { - key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-kokoro-resources/java8" -} - -env_vars: { - key: "JOB_TYPE" - value: "lint" -} \ No newline at end of file diff --git a/java-iam/.kokoro/presubmit/samples.cfg b/java-iam/.kokoro/presubmit/samples.cfg deleted file mode 100644 index 01e0960047..0000000000 --- a/java-iam/.kokoro/presubmit/samples.cfg +++ /dev/null @@ -1,33 +0,0 @@ -# Format: //devtools/kokoro/config/proto/build.proto - -# Configure the docker image for kokoro-trampoline. -env_vars: { - key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-kokoro-resources/java8" -} - -env_vars: { - key: "JOB_TYPE" - value: "samples" -} - -# TODO: remove this after we've migrated all tests and scripts -env_vars: { - key: "GCLOUD_PROJECT" - value: "java-docs-samples-testing" -} - -env_vars: { - key: "GOOGLE_CLOUD_PROJECT" - value: "java-docs-samples-testing" -} - -env_vars: { - key: "GOOGLE_APPLICATION_CREDENTIALS" - value: "secret_manager/java-docs-samples-service-account" -} - -env_vars: { - key: "SECRET_MANAGER_KEYS" - value: "java-docs-samples-service-account" -} \ No newline at end of file diff --git a/java-iam/.kokoro/readme.sh b/java-iam/.kokoro/readme.sh deleted file mode 100755 index 5081ac809f..0000000000 --- a/java-iam/.kokoro/readme.sh +++ /dev/null @@ -1,45 +0,0 @@ -#!/bin/bash -# Copyright 2020 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -set -eo pipefail - -cd ${KOKORO_ARTIFACTS_DIR}/github/java-iam - -# 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-iam \ - --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-iam/.kokoro/release/bump_snapshot.cfg b/java-iam/.kokoro/release/bump_snapshot.cfg deleted file mode 100644 index 1e28b5ed71..0000000000 --- a/java-iam/.kokoro/release/bump_snapshot.cfg +++ /dev/null @@ -1,53 +0,0 @@ -# Format: //devtools/kokoro/config/proto/build.proto - -# Build logs will be here -action { - define_artifacts { - regex: "**/*sponge_log.xml" - } -} - -# Download trampoline resources. -gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/trampoline" - -# Use the trampoline script to run in docker. -build_file: "java-iam/.kokoro/trampoline.sh" - -# Configure the docker image for kokoro-trampoline. -env_vars: { - key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-kokoro-resources/node:10-user" -} - -env_vars: { - key: "TRAMPOLINE_BUILD_FILE" - value: "github/java-iam/.kokoro/release/bump_snapshot.sh" -} - -# tokens used by release-please to keep an up-to-date release PR. -before_action { - fetch_keystore { - keystore_resource { - keystore_config_id: 73713 - keyname: "github-magic-proxy-key-release-please" - } - } -} - -before_action { - fetch_keystore { - keystore_resource { - keystore_config_id: 73713 - keyname: "github-magic-proxy-token-release-please" - } - } -} - -before_action { - fetch_keystore { - keystore_resource { - keystore_config_id: 73713 - keyname: "github-magic-proxy-url-release-please" - } - } -} diff --git a/java-iam/.kokoro/release/common.cfg b/java-iam/.kokoro/release/common.cfg deleted file mode 100644 index 9428634ae6..0000000000 --- a/java-iam/.kokoro/release/common.cfg +++ /dev/null @@ -1,49 +0,0 @@ -# Format: //devtools/kokoro/config/proto/build.proto - -# Download trampoline resources. -gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/trampoline" - -# Use the trampoline script to run in docker. -build_file: "java-iam/.kokoro/trampoline.sh" - -# Configure the docker image for kokoro-trampoline. -env_vars: { - key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-kokoro-resources/java8" -} - -before_action { - fetch_keystore { - keystore_resource { - keystore_config_id: 70247 - keyname: "maven-gpg-keyring" - } - } -} - -before_action { - fetch_keystore { - keystore_resource { - keystore_config_id: 70247 - keyname: "maven-gpg-passphrase" - } - } -} - -before_action { - fetch_keystore { - keystore_resource { - keystore_config_id: 70247 - keyname: "maven-gpg-pubkeyring" - } - } -} - -before_action { - fetch_keystore { - keystore_resource { - keystore_config_id: 70247 - keyname: "sonatype-credentials" - } - } -} diff --git a/java-iam/.kokoro/release/common.sh b/java-iam/.kokoro/release/common.sh deleted file mode 100755 index 7f78ee414f..0000000000 --- a/java-iam/.kokoro/release/common.sh +++ /dev/null @@ -1,50 +0,0 @@ -#!/bin/bash -# Copyright 2018 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -set -eo pipefail - -# Get secrets from keystore and set and environment variables -setup_environment_secrets() { - export GPG_PASSPHRASE=$(cat ${KOKORO_KEYSTORE_DIR}/70247_maven-gpg-passphrase) - export GPG_TTY=$(tty) - export GPG_HOMEDIR=/gpg - mkdir $GPG_HOMEDIR - mv ${KOKORO_KEYSTORE_DIR}/70247_maven-gpg-pubkeyring $GPG_HOMEDIR/pubring.gpg - mv ${KOKORO_KEYSTORE_DIR}/70247_maven-gpg-keyring $GPG_HOMEDIR/secring.gpg - export SONATYPE_USERNAME=$(cat ${KOKORO_KEYSTORE_DIR}/70247_sonatype-credentials | cut -f1 -d'|') - export SONATYPE_PASSWORD=$(cat ${KOKORO_KEYSTORE_DIR}/70247_sonatype-credentials | cut -f2 -d'|') -} - -create_settings_xml_file() { - echo " - - - ossrh - ${SONATYPE_USERNAME} - ${SONATYPE_PASSWORD} - - - sonatype-nexus-staging - ${SONATYPE_USERNAME} - ${SONATYPE_PASSWORD} - - - sonatype-nexus-snapshots - ${SONATYPE_USERNAME} - ${SONATYPE_PASSWORD} - - -" > $1 -} \ No newline at end of file diff --git a/java-iam/.kokoro/release/drop.cfg b/java-iam/.kokoro/release/drop.cfg deleted file mode 100644 index 85fcca33f3..0000000000 --- a/java-iam/.kokoro/release/drop.cfg +++ /dev/null @@ -1,6 +0,0 @@ -# Format: //devtools/kokoro/config/proto/build.proto - -env_vars: { - key: "TRAMPOLINE_BUILD_FILE" - value: "github/java-iam/.kokoro/release/drop.sh" -} diff --git a/java-iam/.kokoro/release/drop.sh b/java-iam/.kokoro/release/drop.sh deleted file mode 100755 index 742ec1a886..0000000000 --- a/java-iam/.kokoro/release/drop.sh +++ /dev/null @@ -1,32 +0,0 @@ -#!/bin/bash -# Copyright 2018 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -set -eo pipefail - -# STAGING_REPOSITORY_ID must be set -if [ -z "${STAGING_REPOSITORY_ID}" ]; then - echo "Missing STAGING_REPOSITORY_ID environment variable" - exit 1 -fi - -source $(dirname "$0")/common.sh -pushd $(dirname "$0")/../../ - -setup_environment_secrets -create_settings_xml_file "settings.xml" - -mvn nexus-staging:drop -B \ - --settings=settings.xml \ - -DstagingRepositoryId=${STAGING_REPOSITORY_ID} diff --git a/java-iam/.kokoro/release/promote.cfg b/java-iam/.kokoro/release/promote.cfg deleted file mode 100644 index de997603d2..0000000000 --- a/java-iam/.kokoro/release/promote.cfg +++ /dev/null @@ -1,6 +0,0 @@ -# Format: //devtools/kokoro/config/proto/build.proto - -env_vars: { - key: "TRAMPOLINE_BUILD_FILE" - value: "github/java-iam/.kokoro/release/promote.sh" -} diff --git a/java-iam/.kokoro/release/promote.sh b/java-iam/.kokoro/release/promote.sh deleted file mode 100755 index 3cac3d8a97..0000000000 --- a/java-iam/.kokoro/release/promote.sh +++ /dev/null @@ -1,34 +0,0 @@ -#!/bin/bash -# Copyright 2018 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -set -eo pipefail - -# STAGING_REPOSITORY_ID must be set -if [ -z "${STAGING_REPOSITORY_ID}" ]; then - echo "Missing STAGING_REPOSITORY_ID environment variable" - exit 1 -fi - -source $(dirname "$0")/common.sh - -pushd $(dirname "$0")/../../ - -setup_environment_secrets -create_settings_xml_file "settings.xml" - -mvn nexus-staging:release -B \ - -DperformRelease=true \ - --settings=settings.xml \ - -DstagingRepositoryId=${STAGING_REPOSITORY_ID} diff --git a/java-iam/.kokoro/release/publish_javadoc.cfg b/java-iam/.kokoro/release/publish_javadoc.cfg deleted file mode 100644 index e6f651d11e..0000000000 --- a/java-iam/.kokoro/release/publish_javadoc.cfg +++ /dev/null @@ -1,23 +0,0 @@ -# Format: //devtools/kokoro/config/proto/build.proto - -gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/doc-templates/" - -env_vars: { - key: "STAGING_BUCKET" - value: "docs-staging" -} - -env_vars: { - key: "TRAMPOLINE_BUILD_FILE" - value: "github/java-iam/.kokoro/release/publish_javadoc.sh" -} - - -before_action { - fetch_keystore { - keystore_resource { - keystore_config_id: 73713 - keyname: "docuploader_service_account" - } - } -} diff --git a/java-iam/.kokoro/release/publish_javadoc.sh b/java-iam/.kokoro/release/publish_javadoc.sh deleted file mode 100755 index 0196aca2c1..0000000000 --- a/java-iam/.kokoro/release/publish_javadoc.sh +++ /dev/null @@ -1,53 +0,0 @@ -#!/bin/bash -# Copyright 2019 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -set -eo pipefail - -if [[ -z "${CREDENTIALS}" ]]; then - CREDENTIALS=${KOKORO_KEYSTORE_DIR}/73713_docuploader_service_account -fi - -if [[ -z "${STAGING_BUCKET}" ]]; then - echo "Need to set STAGING_BUCKET environment variable" - exit 1 -fi - -# work from the git root directory -pushd $(dirname "$0")/../../ - -# install docuploader package -python3 -m pip install --require-hashes -r .kokoro/requirements.txt - -# compile all packages -mvn clean install -B -q -DskipTests=true - -export NAME=proto-google-iam-v1 -export VERSION=$(grep ${NAME}: versions.txt | cut -d: -f3) - -# build the docs -mvn site -B -q - -pushd target/site/apidocs - -# create metadata -python3 -m docuploader create-metadata \ - --name ${NAME} \ - --version ${VERSION} \ - --language java - -# upload docs -python3 -m docuploader upload . \ - --credentials ${CREDENTIALS} \ - --staging-bucket ${STAGING_BUCKET} diff --git a/java-iam/.kokoro/release/publish_javadoc11.cfg b/java-iam/.kokoro/release/publish_javadoc11.cfg deleted file mode 100644 index c84570efd6..0000000000 --- a/java-iam/.kokoro/release/publish_javadoc11.cfg +++ /dev/null @@ -1,30 +0,0 @@ -# Format: //devtools/kokoro/config/proto/build.proto - -# cloud-rad production -env_vars: { - key: "STAGING_BUCKET_V2" - value: "docs-staging-v2" -} - -# Configure the docker image for kokoro-trampoline -env_vars: { - key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-kokoro-resources/java11" -} - -env_vars: { - key: "TRAMPOLINE_BUILD_FILE" - value: "github/java-iam/.kokoro/release/publish_javadoc11.sh" -} - -before_action { - fetch_keystore { - keystore_resource { - keystore_config_id: 73713 - keyname: "docuploader_service_account" - } - } -} - -# Downloads docfx doclet resource. This will be in ${KOKORO_GFILE_DIR}/ -gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/docfx" diff --git a/java-iam/.kokoro/release/publish_javadoc11.sh b/java-iam/.kokoro/release/publish_javadoc11.sh deleted file mode 100755 index 8040a363d8..0000000000 --- a/java-iam/.kokoro/release/publish_javadoc11.sh +++ /dev/null @@ -1,63 +0,0 @@ -#!/bin/bash -# Copyright 2021 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -set -eo pipefail - -if [[ -z "${CREDENTIALS}" ]]; then - CREDENTIALS=${KOKORO_KEYSTORE_DIR}/73713_docuploader_service_account -fi - -if [[ -z "${STAGING_BUCKET_V2}" ]]; then - echo "Need to set STAGING_BUCKET_V2 environment variable" - exit 1 -fi - -# work from the git root directory -pushd $(dirname "$0")/../../ - -# install docuploader package -python3 -m pip install --require-hashes -r .kokoro/requirements.txt - -# compile all packages -mvn clean install -B -q -DskipTests=true - -export NAME=proto-google-iam-v1 -export VERSION=$(grep ${NAME}: versions.txt | cut -d: -f3) - -# cloud RAD generation -mvn clean javadoc:aggregate -B -q -P docFX -# include CHANGELOG -cp CHANGELOG.md target/docfx-yml/history.md - -pushd target/docfx-yml - -# create metadata -python3 -m docuploader create-metadata \ - --name ${NAME} \ - --version ${VERSION} \ - --xrefs devsite://java/gax \ - --xrefs devsite://java/google-cloud-core \ - --xrefs devsite://java/api-common \ - --xrefs devsite://java/proto-google-common-protos \ - --xrefs devsite://java/google-api-client \ - --xrefs devsite://java/google-http-client \ - --xrefs devsite://java/protobuf \ - --language java - -# upload yml to production bucket -python3 -m docuploader upload . \ - --credentials ${CREDENTIALS} \ - --staging-bucket ${STAGING_BUCKET_V2} \ - --destination-prefix docfx diff --git a/java-iam/.kokoro/release/snapshot.cfg b/java-iam/.kokoro/release/snapshot.cfg deleted file mode 100644 index 2a39f44fd9..0000000000 --- a/java-iam/.kokoro/release/snapshot.cfg +++ /dev/null @@ -1,6 +0,0 @@ -# Format: //devtools/kokoro/config/proto/build.proto - -env_vars: { - key: "TRAMPOLINE_BUILD_FILE" - value: "github/java-iam/.kokoro/release/snapshot.sh" -} \ No newline at end of file diff --git a/java-iam/.kokoro/release/snapshot.sh b/java-iam/.kokoro/release/snapshot.sh deleted file mode 100755 index 1f55b77024..0000000000 --- a/java-iam/.kokoro/release/snapshot.sh +++ /dev/null @@ -1,33 +0,0 @@ -#!/bin/bash -# Copyright 2019 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -set -eo pipefail - -source $(dirname "$0")/common.sh -MAVEN_SETTINGS_FILE=$(realpath $(dirname "$0")/../../)/settings.xml -pushd $(dirname "$0")/../../ - -# ensure we're trying to push a snapshot (no-result returns non-zero exit code) -grep SNAPSHOT versions.txt - -setup_environment_secrets -create_settings_xml_file "settings.xml" - -mvn clean deploy -B \ - --settings ${MAVEN_SETTINGS_FILE} \ - -DperformRelease=true \ - -Dgpg.executable=gpg \ - -Dgpg.passphrase=${GPG_PASSPHRASE} \ - -Dgpg.homedir=${GPG_HOMEDIR} diff --git a/java-iam/.kokoro/release/stage.cfg b/java-iam/.kokoro/release/stage.cfg deleted file mode 100644 index 1ef9b0acd7..0000000000 --- a/java-iam/.kokoro/release/stage.cfg +++ /dev/null @@ -1,19 +0,0 @@ -# Format: //devtools/kokoro/config/proto/build.proto - -env_vars: { - key: "TRAMPOLINE_BUILD_FILE" - value: "github/java-iam/.kokoro/release/stage.sh" -} - -# Need to save the properties file -action { - define_artifacts { - regex: "github/java-iam/target/nexus-staging/staging/*.properties" - strip_prefix: "github/java-iam" - } -} - -env_vars: { - key: "SECRET_MANAGER_KEYS" - value: "releasetool-publish-reporter-app,releasetool-publish-reporter-googleapis-installation,releasetool-publish-reporter-pem" -} diff --git a/java-iam/.kokoro/release/stage.sh b/java-iam/.kokoro/release/stage.sh deleted file mode 100755 index 61e714d6ba..0000000000 --- a/java-iam/.kokoro/release/stage.sh +++ /dev/null @@ -1,47 +0,0 @@ -#!/bin/bash -# Copyright 2018 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -set -eo pipefail - -# Start the releasetool reporter -requirementsFile=$(realpath $(dirname "${BASH_SOURCE[0]}")/../requirements.txt) -python3 -m pip install --require-hashes -r $requirementsFile -python3 -m releasetool publish-reporter-script > /tmp/publisher-script; source /tmp/publisher-script - -source $(dirname "$0")/common.sh -source $(dirname "$0")/../common.sh -MAVEN_SETTINGS_FILE=$(realpath $(dirname "$0")/../../)/settings.xml -pushd $(dirname "$0")/../../ - -setup_environment_secrets -create_settings_xml_file "settings.xml" - -# attempt to stage 3 times with exponential backoff (starting with 10 seconds) -retry_with_backoff 3 10 \ - mvn clean deploy -B \ - --settings ${MAVEN_SETTINGS_FILE} \ - -DskipTests=true \ - -Dclirr.skip=true \ - -DperformRelease=true \ - -Dgpg.executable=gpg \ - -Dgpg.passphrase=${GPG_PASSPHRASE} \ - -Dgpg.homedir=${GPG_HOMEDIR} - -if [[ -n "${AUTORELEASE_PR}" ]] -then - mvn nexus-staging:release -B \ - -DperformRelease=true \ - --settings=settings.xml -fi diff --git a/java-iam/.kokoro/requirements.in b/java-iam/.kokoro/requirements.in deleted file mode 100644 index 924f94ae6f..0000000000 --- a/java-iam/.kokoro/requirements.in +++ /dev/null @@ -1,34 +0,0 @@ -gcp-docuploader==0.6.3 -google-crc32c==1.3.0 -googleapis-common-protos==1.56.3 -gcp-releasetool==1.9.1 -cryptography==38.0.3 -cachetools==4.2.4 -cffi==1.15.1 -jeepney==0.7.1 -jinja2==3.0.3 -markupsafe==2.0.1 -keyring==23.4.1 -packaging==21.3 -protobuf==3.19.5 -pyjwt==2.4.0 -pyparsing==3.0.9 -pycparser==2.21 -pyperclip==1.8.2 -python-dateutil==2.8.2 -requests==2.27.1 -certifi==2022.9.24 -importlib-metadata==4.8.3 -zipp==3.6.0 -google_api_core==2.8.2 -google-cloud-storage==2.0.0 -google-resumable-media==2.3.3 -google-cloud-core==2.3.1 -typing-extensions==4.1.1 -urllib3==1.26.12 -zipp==3.6.0 -rsa==4.9 -six==1.16.0 -attrs==22.1.0 -google-auth==2.14.1 -idna==3.4 \ No newline at end of file diff --git a/java-iam/.kokoro/requirements.txt b/java-iam/.kokoro/requirements.txt deleted file mode 100644 index 71fcafc703..0000000000 --- a/java-iam/.kokoro/requirements.txt +++ /dev/null @@ -1,456 +0,0 @@ -# -# This file is autogenerated by pip-compile with python 3.10 -# To update, run: -# -# pip-compile --generate-hashes requirements.in -# -attrs==22.1.0 \ - --hash=sha256:29adc2665447e5191d0e7c568fde78b21f9672d344281d0c6e1ab085429b22b6 \ - --hash=sha256:86efa402f67bf2df34f51a335487cf46b1ec130d02b8d39fd248abfd30da551c - # via - # -r requirements.in - # gcp-releasetool -cachetools==4.2.4 \ - --hash=sha256:89ea6f1b638d5a73a4f9226be57ac5e4f399d22770b92355f92dcb0f7f001693 \ - --hash=sha256:92971d3cb7d2a97efff7c7bb1657f21a8f5fb309a37530537c71b1774189f2d1 - # via - # -r requirements.in - # google-auth -certifi==2022.9.24 \ - --hash=sha256:0d9c601124e5a6ba9712dbc60d9c53c21e34f5f641fe83002317394311bdce14 \ - --hash=sha256:90c1a32f1d68f940488354e36370f6cca89f0f106db09518524c88d6ed83f382 - # via - # -r requirements.in - # requests -cffi==1.15.1 \ - --hash=sha256:00a9ed42e88df81ffae7a8ab6d9356b371399b91dbdf0c3cb1e84c03a13aceb5 \ - --hash=sha256:03425bdae262c76aad70202debd780501fabeaca237cdfddc008987c0e0f59ef \ - --hash=sha256:04ed324bda3cda42b9b695d51bb7d54b680b9719cfab04227cdd1e04e5de3104 \ - --hash=sha256:0e2642fe3142e4cc4af0799748233ad6da94c62a8bec3a6648bf8ee68b1c7426 \ - --hash=sha256:173379135477dc8cac4bc58f45db08ab45d228b3363adb7af79436135d028405 \ - --hash=sha256:198caafb44239b60e252492445da556afafc7d1e3ab7a1fb3f0584ef6d742375 \ - --hash=sha256:1e74c6b51a9ed6589199c787bf5f9875612ca4a8a0785fb2d4a84429badaf22a \ - --hash=sha256:2012c72d854c2d03e45d06ae57f40d78e5770d252f195b93f581acf3ba44496e \ - --hash=sha256:21157295583fe8943475029ed5abdcf71eb3911894724e360acff1d61c1d54bc \ - --hash=sha256:2470043b93ff09bf8fb1d46d1cb756ce6132c54826661a32d4e4d132e1977adf \ - --hash=sha256:285d29981935eb726a4399badae8f0ffdff4f5050eaa6d0cfc3f64b857b77185 \ - --hash=sha256:30d78fbc8ebf9c92c9b7823ee18eb92f2e6ef79b45ac84db507f52fbe3ec4497 \ - --hash=sha256:320dab6e7cb2eacdf0e658569d2575c4dad258c0fcc794f46215e1e39f90f2c3 \ - --hash=sha256:33ab79603146aace82c2427da5ca6e58f2b3f2fb5da893ceac0c42218a40be35 \ - --hash=sha256:3548db281cd7d2561c9ad9984681c95f7b0e38881201e157833a2342c30d5e8c \ - --hash=sha256:3799aecf2e17cf585d977b780ce79ff0dc9b78d799fc694221ce814c2c19db83 \ - --hash=sha256:39d39875251ca8f612b6f33e6b1195af86d1b3e60086068be9cc053aa4376e21 \ - --hash=sha256:3b926aa83d1edb5aa5b427b4053dc420ec295a08e40911296b9eb1b6170f6cca \ - --hash=sha256:3bcde07039e586f91b45c88f8583ea7cf7a0770df3a1649627bf598332cb6984 \ - --hash=sha256:3d08afd128ddaa624a48cf2b859afef385b720bb4b43df214f85616922e6a5ac \ - --hash=sha256:3eb6971dcff08619f8d91607cfc726518b6fa2a9eba42856be181c6d0d9515fd \ - --hash=sha256:40f4774f5a9d4f5e344f31a32b5096977b5d48560c5592e2f3d2c4374bd543ee \ - --hash=sha256:4289fc34b2f5316fbb762d75362931e351941fa95fa18789191b33fc4cf9504a \ - --hash=sha256:470c103ae716238bbe698d67ad020e1db9d9dba34fa5a899b5e21577e6d52ed2 \ - --hash=sha256:4f2c9f67e9821cad2e5f480bc8d83b8742896f1242dba247911072d4fa94c192 \ - --hash=sha256:50a74364d85fd319352182ef59c5c790484a336f6db772c1a9231f1c3ed0cbd7 \ - --hash=sha256:54a2db7b78338edd780e7ef7f9f6c442500fb0d41a5a4ea24fff1c929d5af585 \ - --hash=sha256:5635bd9cb9731e6d4a1132a498dd34f764034a8ce60cef4f5319c0541159392f \ - --hash=sha256:59c0b02d0a6c384d453fece7566d1c7e6b7bae4fc5874ef2ef46d56776d61c9e \ - --hash=sha256:5d598b938678ebf3c67377cdd45e09d431369c3b1a5b331058c338e201f12b27 \ - --hash=sha256:5df2768244d19ab7f60546d0c7c63ce1581f7af8b5de3eb3004b9b6fc8a9f84b \ - --hash=sha256:5ef34d190326c3b1f822a5b7a45f6c4535e2f47ed06fec77d3d799c450b2651e \ - --hash=sha256:6975a3fac6bc83c4a65c9f9fcab9e47019a11d3d2cf7f3c0d03431bf145a941e \ - --hash=sha256:6c9a799e985904922a4d207a94eae35c78ebae90e128f0c4e521ce339396be9d \ - --hash=sha256:70df4e3b545a17496c9b3f41f5115e69a4f2e77e94e1d2a8e1070bc0c38c8a3c \ - --hash=sha256:7473e861101c9e72452f9bf8acb984947aa1661a7704553a9f6e4baa5ba64415 \ - --hash=sha256:8102eaf27e1e448db915d08afa8b41d6c7ca7a04b7d73af6514df10a3e74bd82 \ - --hash=sha256:87c450779d0914f2861b8526e035c5e6da0a3199d8f1add1a665e1cbc6fc6d02 \ - --hash=sha256:8b7ee99e510d7b66cdb6c593f21c043c248537a32e0bedf02e01e9553a172314 \ - --hash=sha256:91fc98adde3d7881af9b59ed0294046f3806221863722ba7d8d120c575314325 \ - --hash=sha256:94411f22c3985acaec6f83c6df553f2dbe17b698cc7f8ae751ff2237d96b9e3c \ - --hash=sha256:98d85c6a2bef81588d9227dde12db8a7f47f639f4a17c9ae08e773aa9c697bf3 \ - --hash=sha256:9ad5db27f9cabae298d151c85cf2bad1d359a1b9c686a275df03385758e2f914 \ - --hash=sha256:a0b71b1b8fbf2b96e41c4d990244165e2c9be83d54962a9a1d118fd8657d2045 \ - --hash=sha256:a0f100c8912c114ff53e1202d0078b425bee3649ae34d7b070e9697f93c5d52d \ - --hash=sha256:a591fe9e525846e4d154205572a029f653ada1a78b93697f3b5a8f1f2bc055b9 \ - --hash=sha256:a5c84c68147988265e60416b57fc83425a78058853509c1b0629c180094904a5 \ - --hash=sha256:a66d3508133af6e8548451b25058d5812812ec3798c886bf38ed24a98216fab2 \ - --hash=sha256:a8c4917bd7ad33e8eb21e9a5bbba979b49d9a97acb3a803092cbc1133e20343c \ - --hash=sha256:b3bbeb01c2b273cca1e1e0c5df57f12dce9a4dd331b4fa1635b8bec26350bde3 \ - --hash=sha256:cba9d6b9a7d64d4bd46167096fc9d2f835e25d7e4c121fb2ddfc6528fb0413b2 \ - --hash=sha256:cc4d65aeeaa04136a12677d3dd0b1c0c94dc43abac5860ab33cceb42b801c1e8 \ - --hash=sha256:ce4bcc037df4fc5e3d184794f27bdaab018943698f4ca31630bc7f84a7b69c6d \ - --hash=sha256:cec7d9412a9102bdc577382c3929b337320c4c4c4849f2c5cdd14d7368c5562d \ - --hash=sha256:d400bfb9a37b1351253cb402671cea7e89bdecc294e8016a707f6d1d8ac934f9 \ - --hash=sha256:d61f4695e6c866a23a21acab0509af1cdfd2c013cf256bbf5b6b5e2695827162 \ - --hash=sha256:db0fbb9c62743ce59a9ff687eb5f4afbe77e5e8403d6697f7446e5f609976f76 \ - --hash=sha256:dd86c085fae2efd48ac91dd7ccffcfc0571387fe1193d33b6394db7ef31fe2a4 \ - --hash=sha256:e00b098126fd45523dd056d2efba6c5a63b71ffe9f2bbe1a4fe1716e1d0c331e \ - --hash=sha256:e229a521186c75c8ad9490854fd8bbdd9a0c9aa3a524326b55be83b54d4e0ad9 \ - --hash=sha256:e263d77ee3dd201c3a142934a086a4450861778baaeeb45db4591ef65550b0a6 \ - --hash=sha256:ed9cb427ba5504c1dc15ede7d516b84757c3e3d7868ccc85121d9310d27eed0b \ - --hash=sha256:fa6693661a4c91757f4412306191b6dc88c1703f780c8234035eac011922bc01 \ - --hash=sha256:fcd131dd944808b5bdb38e6f5b53013c5aa4f334c5cad0c72742f6eba4b73db0 - # via - # -r requirements.in - # cryptography -charset-normalizer==2.0.12 \ - --hash=sha256:2857e29ff0d34db842cd7ca3230549d1a697f96ee6d3fb071cfa6c7393832597 \ - --hash=sha256:6881edbebdb17b39b4eaaa821b438bf6eddffb4468cf344f09f89def34a8b1df - # via requests -click==8.0.4 \ - --hash=sha256:6a7a62563bbfabfda3a38f3023a1db4a35978c0abd76f6c9605ecd6554d6d9b1 \ - --hash=sha256:8458d7b1287c5fb128c90e23381cf99dcde74beaf6c7ff6384ce84d6fe090adb - # via - # gcp-docuploader - # gcp-releasetool -colorlog==6.7.0 \ - --hash=sha256:0d33ca236784a1ba3ff9c532d4964126d8a2c44f1f0cb1d2b0728196f512f662 \ - --hash=sha256:bd94bd21c1e13fac7bd3153f4bc3a7dc0eb0974b8bc2fdf1a989e474f6e582e5 - # via gcp-docuploader -cryptography==38.0.3 \ - --hash=sha256:068147f32fa662c81aebab95c74679b401b12b57494872886eb5c1139250ec5d \ - --hash=sha256:06fc3cc7b6f6cca87bd56ec80a580c88f1da5306f505876a71c8cfa7050257dd \ - --hash=sha256:25c1d1f19729fb09d42e06b4bf9895212292cb27bb50229f5aa64d039ab29146 \ - --hash=sha256:402852a0aea73833d982cabb6d0c3bb582c15483d29fb7085ef2c42bfa7e38d7 \ - --hash=sha256:4e269dcd9b102c5a3d72be3c45d8ce20377b8076a43cbed6f660a1afe365e436 \ - --hash=sha256:5419a127426084933076132d317911e3c6eb77568a1ce23c3ac1e12d111e61e0 \ - --hash=sha256:554bec92ee7d1e9d10ded2f7e92a5d70c1f74ba9524947c0ba0c850c7b011828 \ - --hash=sha256:5e89468fbd2fcd733b5899333bc54d0d06c80e04cd23d8c6f3e0542358c6060b \ - --hash=sha256:65535bc550b70bd6271984d9863a37741352b4aad6fb1b3344a54e6950249b55 \ - --hash=sha256:6ab9516b85bebe7aa83f309bacc5f44a61eeb90d0b4ec125d2d003ce41932d36 \ - --hash=sha256:6addc3b6d593cd980989261dc1cce38263c76954d758c3c94de51f1e010c9a50 \ - --hash=sha256:728f2694fa743a996d7784a6194da430f197d5c58e2f4e278612b359f455e4a2 \ - --hash=sha256:785e4056b5a8b28f05a533fab69febf5004458e20dad7e2e13a3120d8ecec75a \ - --hash=sha256:78cf5eefac2b52c10398a42765bfa981ce2372cbc0457e6bf9658f41ec3c41d8 \ - --hash=sha256:7f836217000342d448e1c9a342e9163149e45d5b5eca76a30e84503a5a96cab0 \ - --hash=sha256:8d41a46251bf0634e21fac50ffd643216ccecfaf3701a063257fe0b2be1b6548 \ - --hash=sha256:984fe150f350a3c91e84de405fe49e688aa6092b3525f407a18b9646f6612320 \ - --hash=sha256:9b24bcff7853ed18a63cfb0c2b008936a9554af24af2fb146e16d8e1aed75748 \ - --hash=sha256:b1b35d9d3a65542ed2e9d90115dfd16bbc027b3f07ee3304fc83580f26e43249 \ - --hash=sha256:b1b52c9e5f8aa2b802d48bd693190341fae201ea51c7a167d69fc48b60e8a959 \ - --hash=sha256:bbf203f1a814007ce24bd4d51362991d5cb90ba0c177a9c08825f2cc304d871f \ - --hash=sha256:be243c7e2bfcf6cc4cb350c0d5cdf15ca6383bbcb2a8ef51d3c9411a9d4386f0 \ - --hash=sha256:bfbe6ee19615b07a98b1d2287d6a6073f734735b49ee45b11324d85efc4d5cbd \ - --hash=sha256:c46837ea467ed1efea562bbeb543994c2d1f6e800785bd5a2c98bc096f5cb220 \ - --hash=sha256:dfb4f4dd568de1b6af9f4cda334adf7d72cf5bc052516e1b2608b683375dd95c \ - --hash=sha256:ed7b00096790213e09eb11c97cc6e2b757f15f3d2f85833cd2d3ec3fe37c1722 - # via - # -r requirements.in - # gcp-releasetool - # secretstorage -gcp-docuploader==0.6.3 \ - --hash=sha256:ba8c9d76b3bbac54b0311c503a373b00edc2dc02d6d54ea9507045adb8e870f7 \ - --hash=sha256:c0f5aaa82ce1854a386197e4e359b120ad6d4e57ae2c812fce42219a3288026b - # via -r requirements.in -gcp-releasetool==1.9.1 \ - --hash=sha256:952f4055d5d986b070ae2a71c4410b250000f9cc5a1e26398fcd55a5bbc5a15f \ - --hash=sha256:d0d3c814a97c1a237517e837d8cfa668ced8df4b882452578ecef4a4e79c583b - # via -r requirements.in -google-api-core==2.8.2 \ - --hash=sha256:06f7244c640322b508b125903bb5701bebabce8832f85aba9335ec00b3d02edc \ - --hash=sha256:93c6a91ccac79079ac6bbf8b74ee75db970cc899278b97d53bc012f35908cf50 - # via - # -r requirements.in - # google-cloud-core - # google-cloud-storage -google-auth==2.14.1 \ - --hash=sha256:f5d8701633bebc12e0deea4df8abd8aff31c28b355360597f7f2ee60f2e4d016 - # via - # -r requirements.in - # gcp-releasetool - # google-api-core - # google-cloud-core - # google-cloud-storage -google-cloud-core==2.3.1 \ - --hash=sha256:113ba4f492467d5bd442c8d724c1a25ad7384045c3178369038840ecdd19346c \ - --hash=sha256:34334359cb04187bdc80ddcf613e462dfd7a3aabbc3fe4d118517ab4b9303d53 - # via - # -r requirements.in - # google-cloud-storage -google-cloud-storage==2.0.0 \ - --hash=sha256:a57a15aead0f9dfbd4381f1bfdbe8bf89818a4bd75bab846cafcefb2db846c47 \ - --hash=sha256:ec4be60bb223a3a960f0d01697d849b86d91cad815a84915a32ed3635e93a5e7 - # via - # -r requirements.in - # gcp-docuploader -google-crc32c==1.3.0 \ - --hash=sha256:04e7c220798a72fd0f08242bc8d7a05986b2a08a0573396187fd32c1dcdd58b3 \ - --hash=sha256:05340b60bf05b574159e9bd940152a47d38af3fb43803ffe71f11d704b7696a6 \ - --hash=sha256:12674a4c3b56b706153a358eaa1018c4137a5a04635b92b4652440d3d7386206 \ - --hash=sha256:127f9cc3ac41b6a859bd9dc4321097b1a4f6aa7fdf71b4f9227b9e3ebffb4422 \ - --hash=sha256:13af315c3a0eec8bb8b8d80b8b128cb3fcd17d7e4edafc39647846345a3f003a \ - --hash=sha256:1926fd8de0acb9d15ee757175ce7242e235482a783cd4ec711cc999fc103c24e \ - --hash=sha256:226f2f9b8e128a6ca6a9af9b9e8384f7b53a801907425c9a292553a3a7218ce0 \ - --hash=sha256:276de6273eb074a35bc598f8efbc00c7869c5cf2e29c90748fccc8c898c244df \ - --hash=sha256:318f73f5484b5671f0c7f5f63741ab020a599504ed81d209b5c7129ee4667407 \ - --hash=sha256:3bbce1be3687bbfebe29abdb7631b83e6b25da3f4e1856a1611eb21854b689ea \ - --hash=sha256:42ae4781333e331a1743445931b08ebdad73e188fd554259e772556fc4937c48 \ - --hash=sha256:58be56ae0529c664cc04a9c76e68bb92b091e0194d6e3c50bea7e0f266f73713 \ - --hash=sha256:5da2c81575cc3ccf05d9830f9e8d3c70954819ca9a63828210498c0774fda1a3 \ - --hash=sha256:6311853aa2bba4064d0c28ca54e7b50c4d48e3de04f6770f6c60ebda1e975267 \ - --hash=sha256:650e2917660e696041ab3dcd7abac160b4121cd9a484c08406f24c5964099829 \ - --hash=sha256:6a4db36f9721fdf391646685ecffa404eb986cbe007a3289499020daf72e88a2 \ - --hash=sha256:779cbf1ce375b96111db98fca913c1f5ec11b1d870e529b1dc7354b2681a8c3a \ - --hash=sha256:7f6fe42536d9dcd3e2ffb9d3053f5d05221ae3bbcefbe472bdf2c71c793e3183 \ - --hash=sha256:891f712ce54e0d631370e1f4997b3f182f3368179198efc30d477c75d1f44942 \ - --hash=sha256:95c68a4b9b7828ba0428f8f7e3109c5d476ca44996ed9a5f8aac6269296e2d59 \ - --hash=sha256:96a8918a78d5d64e07c8ea4ed2bc44354e3f93f46a4866a40e8db934e4c0d74b \ - --hash=sha256:9c3cf890c3c0ecfe1510a452a165431b5831e24160c5fcf2071f0f85ca5a47cd \ - --hash=sha256:9f58099ad7affc0754ae42e6d87443299f15d739b0ce03c76f515153a5cda06c \ - --hash=sha256:a0b9e622c3b2b8d0ce32f77eba617ab0d6768b82836391e4f8f9e2074582bf02 \ - --hash=sha256:a7f9cbea4245ee36190f85fe1814e2d7b1e5f2186381b082f5d59f99b7f11328 \ - --hash=sha256:bab4aebd525218bab4ee615786c4581952eadc16b1ff031813a2fd51f0cc7b08 \ - --hash=sha256:c124b8c8779bf2d35d9b721e52d4adb41c9bfbde45e6a3f25f0820caa9aba73f \ - --hash=sha256:c9da0a39b53d2fab3e5467329ed50e951eb91386e9d0d5b12daf593973c3b168 \ - --hash=sha256:ca60076c388728d3b6ac3846842474f4250c91efbfe5afa872d3ffd69dd4b318 \ - --hash=sha256:cb6994fff247987c66a8a4e550ef374671c2b82e3c0d2115e689d21e511a652d \ - --hash=sha256:d1c1d6236feab51200272d79b3d3e0f12cf2cbb12b208c835b175a21efdb0a73 \ - --hash=sha256:dd7760a88a8d3d705ff562aa93f8445ead54f58fd482e4f9e2bafb7e177375d4 \ - --hash=sha256:dda4d8a3bb0b50f540f6ff4b6033f3a74e8bf0bd5320b70fab2c03e512a62812 \ - --hash=sha256:e0f1ff55dde0ebcfbef027edc21f71c205845585fffe30d4ec4979416613e9b3 \ - --hash=sha256:e7a539b9be7b9c00f11ef16b55486141bc2cdb0c54762f84e3c6fc091917436d \ - --hash=sha256:eb0b14523758e37802f27b7f8cd973f5f3d33be7613952c0df904b68c4842f0e \ - --hash=sha256:ed447680ff21c14aaceb6a9f99a5f639f583ccfe4ce1a5e1d48eb41c3d6b3217 \ - --hash=sha256:f52a4ad2568314ee713715b1e2d79ab55fab11e8b304fd1462ff5cccf4264b3e \ - --hash=sha256:fbd60c6aaa07c31d7754edbc2334aef50601b7f1ada67a96eb1eb57c7c72378f \ - --hash=sha256:fc28e0db232c62ca0c3600884933178f0825c99be4474cdd645e378a10588125 \ - --hash=sha256:fe31de3002e7b08eb20823b3735b97c86c5926dd0581c7710a680b418a8709d4 \ - --hash=sha256:fec221a051150eeddfdfcff162e6db92c65ecf46cb0f7bb1bf812a1520ec026b \ - --hash=sha256:ff71073ebf0e42258a42a0b34f2c09ec384977e7f6808999102eedd5b49920e3 - # via - # -r requirements.in - # google-resumable-media -google-resumable-media==2.3.3 \ - --hash=sha256:27c52620bd364d1c8116eaac4ea2afcbfb81ae9139fb3199652fcac1724bfb6c \ - --hash=sha256:5b52774ea7a829a8cdaa8bd2d4c3d4bc660c91b30857ab2668d0eb830f4ea8c5 - # via - # -r requirements.in - # google-cloud-storage -googleapis-common-protos==1.56.3 \ - --hash=sha256:6f1369b58ed6cf3a4b7054a44ebe8d03b29c309257583a2bbdc064cd1e4a1442 \ - --hash=sha256:87955d7b3a73e6e803f2572a33179de23989ebba725e05ea42f24838b792e461 - # via - # -r requirements.in - # google-api-core -idna==3.4 \ - --hash=sha256:814f528e8dead7d329833b91c5faa87d60bf71824cd12a7530b5526063d02cb4 \ - --hash=sha256:90b77e79eaa3eba6de819a0c442c0b4ceefc341a7a2ab77d7562bf49f425c5c2 - # via - # -r requirements.in - # requests -importlib-metadata==4.8.3 \ - --hash=sha256:65a9576a5b2d58ca44d133c42a241905cc45e34d2c06fd5ba2bafa221e5d7b5e \ - --hash=sha256:766abffff765960fcc18003801f7044eb6755ffae4521c8e8ce8e83b9c9b0668 - # via - # -r requirements.in - # keyring -jeepney==0.7.1 \ - --hash=sha256:1b5a0ea5c0e7b166b2f5895b91a08c14de8915afda4407fb5022a195224958ac \ - --hash=sha256:fa9e232dfa0c498bd0b8a3a73b8d8a31978304dcef0515adc859d4e096f96f4f - # via - # -r requirements.in - # keyring - # secretstorage -jinja2==3.0.3 \ - --hash=sha256:077ce6014f7b40d03b47d1f1ca4b0fc8328a692bd284016f806ed0eaca390ad8 \ - --hash=sha256:611bb273cd68f3b993fabdc4064fc858c5b47a973cb5aa7999ec1ba405c87cd7 - # via - # -r requirements.in - # gcp-releasetool -keyring==23.4.1 \ - --hash=sha256:17e49fb0d6883c2b4445359434dba95aad84aabb29bbff044ad0ed7100232eca \ - --hash=sha256:89cbd74d4683ed164c8082fb38619341097741323b3786905c6dac04d6915a55 - # via - # -r requirements.in - # gcp-releasetool -markupsafe==2.0.1 \ - --hash=sha256:01a9b8ea66f1658938f65b93a85ebe8bc016e6769611be228d797c9d998dd298 \ - --hash=sha256:023cb26ec21ece8dc3907c0e8320058b2e0cb3c55cf9564da612bc325bed5e64 \ - --hash=sha256:0446679737af14f45767963a1a9ef7620189912317d095f2d9ffa183a4d25d2b \ - --hash=sha256:04635854b943835a6ea959e948d19dcd311762c5c0c6e1f0e16ee57022669194 \ - --hash=sha256:0717a7390a68be14b8c793ba258e075c6f4ca819f15edfc2a3a027c823718567 \ - --hash=sha256:0955295dd5eec6cb6cc2fe1698f4c6d84af2e92de33fbcac4111913cd100a6ff \ - --hash=sha256:0d4b31cc67ab36e3392bbf3862cfbadac3db12bdd8b02a2731f509ed5b829724 \ - --hash=sha256:10f82115e21dc0dfec9ab5c0223652f7197feb168c940f3ef61563fc2d6beb74 \ - --hash=sha256:168cd0a3642de83558a5153c8bd34f175a9a6e7f6dc6384b9655d2697312a646 \ - --hash=sha256:1d609f577dc6e1aa17d746f8bd3c31aa4d258f4070d61b2aa5c4166c1539de35 \ - --hash=sha256:1f2ade76b9903f39aa442b4aadd2177decb66525062db244b35d71d0ee8599b6 \ - --hash=sha256:20dca64a3ef2d6e4d5d615a3fd418ad3bde77a47ec8a23d984a12b5b4c74491a \ - --hash=sha256:2a7d351cbd8cfeb19ca00de495e224dea7e7d919659c2841bbb7f420ad03e2d6 \ - --hash=sha256:2d7d807855b419fc2ed3e631034685db6079889a1f01d5d9dac950f764da3dad \ - --hash=sha256:2ef54abee730b502252bcdf31b10dacb0a416229b72c18b19e24a4509f273d26 \ - --hash=sha256:36bc903cbb393720fad60fc28c10de6acf10dc6cc883f3e24ee4012371399a38 \ - --hash=sha256:37205cac2a79194e3750b0af2a5720d95f786a55ce7df90c3af697bfa100eaac \ - --hash=sha256:3c112550557578c26af18a1ccc9e090bfe03832ae994343cfdacd287db6a6ae7 \ - --hash=sha256:3dd007d54ee88b46be476e293f48c85048603f5f516008bee124ddd891398ed6 \ - --hash=sha256:4296f2b1ce8c86a6aea78613c34bb1a672ea0e3de9c6ba08a960efe0b0a09047 \ - --hash=sha256:47ab1e7b91c098ab893b828deafa1203de86d0bc6ab587b160f78fe6c4011f75 \ - --hash=sha256:49e3ceeabbfb9d66c3aef5af3a60cc43b85c33df25ce03d0031a608b0a8b2e3f \ - --hash=sha256:4dc8f9fb58f7364b63fd9f85013b780ef83c11857ae79f2feda41e270468dd9b \ - --hash=sha256:4efca8f86c54b22348a5467704e3fec767b2db12fc39c6d963168ab1d3fc9135 \ - --hash=sha256:53edb4da6925ad13c07b6d26c2a852bd81e364f95301c66e930ab2aef5b5ddd8 \ - --hash=sha256:5855f8438a7d1d458206a2466bf82b0f104a3724bf96a1c781ab731e4201731a \ - --hash=sha256:594c67807fb16238b30c44bdf74f36c02cdf22d1c8cda91ef8a0ed8dabf5620a \ - --hash=sha256:5b6d930f030f8ed98e3e6c98ffa0652bdb82601e7a016ec2ab5d7ff23baa78d1 \ - --hash=sha256:5bb28c636d87e840583ee3adeb78172efc47c8b26127267f54a9c0ec251d41a9 \ - --hash=sha256:60bf42e36abfaf9aff1f50f52644b336d4f0a3fd6d8a60ca0d054ac9f713a864 \ - --hash=sha256:611d1ad9a4288cf3e3c16014564df047fe08410e628f89805e475368bd304914 \ - --hash=sha256:6300b8454aa6930a24b9618fbb54b5a68135092bc666f7b06901f897fa5c2fee \ - --hash=sha256:63f3268ba69ace99cab4e3e3b5840b03340efed0948ab8f78d2fd87ee5442a4f \ - --hash=sha256:6557b31b5e2c9ddf0de32a691f2312a32f77cd7681d8af66c2692efdbef84c18 \ - --hash=sha256:693ce3f9e70a6cf7d2fb9e6c9d8b204b6b39897a2c4a1aa65728d5ac97dcc1d8 \ - --hash=sha256:6a7fae0dd14cf60ad5ff42baa2e95727c3d81ded453457771d02b7d2b3f9c0c2 \ - --hash=sha256:6c4ca60fa24e85fe25b912b01e62cb969d69a23a5d5867682dd3e80b5b02581d \ - --hash=sha256:6fcf051089389abe060c9cd7caa212c707e58153afa2c649f00346ce6d260f1b \ - --hash=sha256:7d91275b0245b1da4d4cfa07e0faedd5b0812efc15b702576d103293e252af1b \ - --hash=sha256:89c687013cb1cd489a0f0ac24febe8c7a666e6e221b783e53ac50ebf68e45d86 \ - --hash=sha256:8d206346619592c6200148b01a2142798c989edcb9c896f9ac9722a99d4e77e6 \ - --hash=sha256:905fec760bd2fa1388bb5b489ee8ee5f7291d692638ea5f67982d968366bef9f \ - --hash=sha256:97383d78eb34da7e1fa37dd273c20ad4320929af65d156e35a5e2d89566d9dfb \ - --hash=sha256:984d76483eb32f1bcb536dc27e4ad56bba4baa70be32fa87152832cdd9db0833 \ - --hash=sha256:99df47edb6bda1249d3e80fdabb1dab8c08ef3975f69aed437cb69d0a5de1e28 \ - --hash=sha256:9f02365d4e99430a12647f09b6cc8bab61a6564363f313126f775eb4f6ef798e \ - --hash=sha256:a30e67a65b53ea0a5e62fe23682cfe22712e01f453b95233b25502f7c61cb415 \ - --hash=sha256:ab3ef638ace319fa26553db0624c4699e31a28bb2a835c5faca8f8acf6a5a902 \ - --hash=sha256:aca6377c0cb8a8253e493c6b451565ac77e98c2951c45f913e0b52facdcff83f \ - --hash=sha256:add36cb2dbb8b736611303cd3bfcee00afd96471b09cda130da3581cbdc56a6d \ - --hash=sha256:b2f4bf27480f5e5e8ce285a8c8fd176c0b03e93dcc6646477d4630e83440c6a9 \ - --hash=sha256:b7f2d075102dc8c794cbde1947378051c4e5180d52d276987b8d28a3bd58c17d \ - --hash=sha256:baa1a4e8f868845af802979fcdbf0bb11f94f1cb7ced4c4b8a351bb60d108145 \ - --hash=sha256:be98f628055368795d818ebf93da628541e10b75b41c559fdf36d104c5787066 \ - --hash=sha256:bf5d821ffabf0ef3533c39c518f3357b171a1651c1ff6827325e4489b0e46c3c \ - --hash=sha256:c47adbc92fc1bb2b3274c4b3a43ae0e4573d9fbff4f54cd484555edbf030baf1 \ - --hash=sha256:cdfba22ea2f0029c9261a4bd07e830a8da012291fbe44dc794e488b6c9bb353a \ - --hash=sha256:d6c7ebd4e944c85e2c3421e612a7057a2f48d478d79e61800d81468a8d842207 \ - --hash=sha256:d7f9850398e85aba693bb640262d3611788b1f29a79f0c93c565694658f4071f \ - --hash=sha256:d8446c54dc28c01e5a2dbac5a25f071f6653e6e40f3a8818e8b45d790fe6ef53 \ - --hash=sha256:deb993cacb280823246a026e3b2d81c493c53de6acfd5e6bfe31ab3402bb37dd \ - --hash=sha256:e0f138900af21926a02425cf736db95be9f4af72ba1bb21453432a07f6082134 \ - --hash=sha256:e9936f0b261d4df76ad22f8fee3ae83b60d7c3e871292cd42f40b81b70afae85 \ - --hash=sha256:f0567c4dc99f264f49fe27da5f735f414c4e7e7dd850cfd8e69f0862d7c74ea9 \ - --hash=sha256:f5653a225f31e113b152e56f154ccbe59eeb1c7487b39b9d9f9cdb58e6c79dc5 \ - --hash=sha256:f826e31d18b516f653fe296d967d700fddad5901ae07c622bb3705955e1faa94 \ - --hash=sha256:f8ba0e8349a38d3001fae7eadded3f6606f0da5d748ee53cc1dab1d6527b9509 \ - --hash=sha256:f9081981fe268bd86831e5c75f7de206ef275defcb82bc70740ae6dc507aee51 \ - --hash=sha256:fa130dd50c57d53368c9d59395cb5526eda596d3ffe36666cd81a44d56e48872 - # via - # -r requirements.in - # jinja2 -packaging==21.3 \ - --hash=sha256:dd47c42927d89ab911e606518907cc2d3a1f38bbd026385970643f9c5b8ecfeb \ - --hash=sha256:ef103e05f519cdc783ae24ea4e2e0f508a9c99b2d4969652eed6a2e1ea5bd522 - # via - # -r requirements.in - # gcp-releasetool -protobuf==3.19.5 \ - --hash=sha256:1867f93b06a183f87696871bb8d1e99ee71dbb69d468ce1f0cc8bf3d30f982f3 \ - --hash=sha256:3c4160b601220627f7e91154e572baf5e161a9c3f445a8242d536ee3d0b7b17c \ - --hash=sha256:4ee2af7051d3b10c8a4fe6fd1a2c69f201fea36aeee7086cf202a692e1b99ee1 \ - --hash=sha256:5266c36cc0af3bb3dbf44f199d225b33da66a9a5c3bdc2b14865ad10eddf0e37 \ - --hash=sha256:5470f892961af464ae6eaf0f3099e2c1190ae8c7f36f174b89491281341f79ca \ - --hash=sha256:66d14b5b90090353efe75c9fb1bf65ef7267383034688d255b500822e37d5c2f \ - --hash=sha256:67efb5d20618020aa9596e17bfc37ca068c28ec0c1507d9507f73c93d46c9855 \ - --hash=sha256:696e6cfab94cc15a14946f2bf72719dced087d437adbd994fff34f38986628bc \ - --hash=sha256:6a02172b9650f819d01fb8e224fc69b0706458fc1ab4f1c669281243c71c1a5e \ - --hash=sha256:6eca9ae238ba615d702387a2ddea635d535d769994a9968c09a4ca920c487ab9 \ - --hash=sha256:950abd6c00e7b51f87ae8b18a0ce4d69fea217f62f171426e77de5061f6d9850 \ - --hash=sha256:9e1d74032f56ff25f417cfe84c8147047732e5059137ca42efad20cbbd25f5e0 \ - --hash=sha256:9e42b1cf2ecd8a1bd161239e693f22035ba99905ae6d7efeac8a0546c7ec1a27 \ - --hash=sha256:9f957ef53e872d58a0afd3bf6d80d48535d28c99b40e75e6634cbc33ea42fd54 \ - --hash=sha256:a89aa0c042e61e11ade320b802d6db4ee5391d8d973e46d3a48172c1597789f8 \ - --hash=sha256:c0f80876a8ff0ae7064084ed094eb86497bd5a3812e6fc96a05318b92301674e \ - --hash=sha256:c44e3282cff74ad18c7e8a0375f407f69ee50c2116364b44492a196293e08b21 \ - --hash=sha256:d249519ba5ecf5dd6b18150c9b6bcde510b273714b696f3923ff8308fc11ae49 \ - --hash=sha256:d3973a2d58aefc7d1230725c2447ce7f86a71cbc094b86a77c6ee1505ac7cdb1 \ - --hash=sha256:dca2284378a5f2a86ffed35c6ac147d14c48b525eefcd1083e5a9ce28dfa8657 \ - --hash=sha256:e63b0b3c42e51c94add62b010366cd4979cb6d5f06158bcae8faac4c294f91e1 \ - --hash=sha256:f2b599a21c9a32e171ec29a2ac54e03297736c578698e11b099d031f79da114b \ - --hash=sha256:f2bde37667b18c2b5280df83bc799204394a5d2d774e4deaf9de0eb741df6833 \ - --hash=sha256:f4f909f4dde413dec435a44b0894956d55bb928ded7d6e3c726556ca4c796e84 \ - --hash=sha256:f976234e20ab2785f54224bcdafa027674e23663b132fa3ca0caa291a6cfbde7 \ - --hash=sha256:f9cebda093c2f6bfed88f1c17cdade09d4d96096421b344026feee236532d4de - # via - # -r requirements.in - # gcp-docuploader - # gcp-releasetool - # google-api-core - # google-cloud-storage - # googleapis-common-protos -pyasn1==0.4.8 \ - --hash=sha256:39c7e2ec30515947ff4e87fb6f456dfc6e84857d34be479c9d4a4ba4bf46aa5d \ - --hash=sha256:aef77c9fb94a3ac588e87841208bdec464471d9871bd5050a287cc9a475cd0ba - # via - # pyasn1-modules - # rsa -pyasn1-modules==0.2.8 \ - --hash=sha256:905f84c712230b2c592c19470d3ca8d552de726050d1d1716282a1f6146be65e \ - --hash=sha256:a50b808ffeb97cb3601dd25981f6b016cbb3d31fbf57a8b8a87428e6158d0c74 - # via google-auth -pycparser==2.21 \ - --hash=sha256:8ee45429555515e1f6b185e78100aea234072576aa43ab53aefcae078162fca9 \ - --hash=sha256:e644fdec12f7872f86c58ff790da456218b10f863970249516d60a5eaca77206 - # via - # -r requirements.in - # cffi -pyjwt==2.4.0 \ - --hash=sha256:72d1d253f32dbd4f5c88eaf1fdc62f3a19f676ccbadb9dbc5d07e951b2b26daf \ - --hash=sha256:d42908208c699b3b973cbeb01a969ba6a96c821eefb1c5bfe4c390c01d67abba - # via - # -r requirements.in - # gcp-releasetool -pyparsing==3.0.9 \ - --hash=sha256:2b020ecf7d21b687f219b71ecad3631f644a47f01403fa1d1036b0c6416d70fb \ - --hash=sha256:5026bae9a10eeaefb61dab2f09052b9f4307d44aee4eda64b309723d8d206bbc - # via - # -r requirements.in - # packaging -pyperclip==1.8.2 \ - --hash=sha256:105254a8b04934f0bc84e9c24eb360a591aaf6535c9def5f29d92af107a9bf57 - # via - # -r requirements.in - # gcp-releasetool -python-dateutil==2.8.2 \ - --hash=sha256:0123cacc1627ae19ddf3c27a5de5bd67ee4586fbdd6440d9748f8abb483d3e86 \ - --hash=sha256:961d03dc3453ebbc59dbdea9e4e11c5651520a876d0f4db161e8674aae935da9 - # via - # -r requirements.in - # gcp-releasetool -requests==2.27.1 \ - --hash=sha256:68d7c56fd5a8999887728ef304a6d12edc7be74f1cfa47714fc8b414525c9a61 \ - --hash=sha256:f22fa1e554c9ddfd16e6e41ac79759e17be9e492b3587efa038054674760e72d - # via - # -r requirements.in - # gcp-releasetool - # google-api-core - # google-cloud-storage -rsa==4.9 \ - --hash=sha256:90260d9058e514786967344d0ef75fa8727eed8a7d2e43ce9f4bcf1b536174f7 \ - --hash=sha256:e38464a49c6c85d7f1351b0126661487a7e0a14a50f1675ec50eb34d4f20ef21 - # via - # -r requirements.in - # google-auth -secretstorage==3.3.3 \ - --hash=sha256:2403533ef369eca6d2ba81718576c5e0f564d5cca1b58f73a8b23e7d4eeebd77 \ - --hash=sha256:f356e6628222568e3af06f2eba8df495efa13b3b63081dafd4f7d9a7b7bc9f99 - # via keyring -six==1.16.0 \ - --hash=sha256:1e61c37477a1626458e36f7b1d82aa5c9b094fa4802892072e49de9c60c4c926 \ - --hash=sha256:8abb2f1d86890a2dfb989f9a77cfcfd3e47c2a354b01111771326f8aa26e0254 - # via - # -r requirements.in - # gcp-docuploader - # google-auth - # python-dateutil -typing-extensions==4.1.1 \ - --hash=sha256:1a9462dcc3347a79b1f1c0271fbe79e844580bb598bafa1ed208b94da3cdcd42 \ - --hash=sha256:21c85e0fe4b9a155d0799430b0ad741cdce7e359660ccbd8b530613e8df88ce2 - # via -r requirements.in -urllib3==1.26.12 \ - --hash=sha256:3fa96cf423e6987997fc326ae8df396db2a8b7c667747d47ddd8ecba91f4a74e \ - --hash=sha256:b930dd878d5a8afb066a637fbb35144fe7901e3b209d1cd4f524bd0e9deee997 - # via - # -r requirements.in - # requests -zipp==3.6.0 \ - --hash=sha256:71c644c5369f4a6e07636f0aa966270449561fcea2e3d6747b8d23efaa9d7832 \ - --hash=sha256:9fe5ea21568a0a70e50f273397638d39b03353731e6cbbb3fd8502a33fec40bc - # via - # -r requirements.in - # importlib-metadata diff --git a/java-iam/.kokoro/trampoline.sh b/java-iam/.kokoro/trampoline.sh deleted file mode 100644 index 8b69b793c9..0000000000 --- a/java-iam/.kokoro/trampoline.sh +++ /dev/null @@ -1,26 +0,0 @@ -#!/bin/bash -# Copyright 2018 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -set -eo pipefail -# Always run the cleanup script, regardless of the success of bouncing into -# the container. -function cleanup() { - chmod +x ${KOKORO_GFILE_DIR}/trampoline_cleanup.sh - ${KOKORO_GFILE_DIR}/trampoline_cleanup.sh - echo "cleanup"; -} -trap cleanup EXIT - -$(dirname $0)/populate-secrets.sh # Secret Manager secrets. -python3 "${KOKORO_GFILE_DIR}/trampoline_v1.py" diff --git a/java-iam/.repo-metadata.json b/java-iam/.repo-metadata.json index c8064171f0..1758363ab3 100644 --- a/java-iam/.repo-metadata.json +++ b/java-iam/.repo-metadata.json @@ -1,17 +1,17 @@ { "api_shortname": "iam", "name_pretty": "IAM", - "product_documentation": "n/a", - "api_description": "n/a", - "client_documentation": "https://cloud.google.com/java/docs/reference/proto-google-iam-v1/latest/history", + "product_documentation": "https://cloud.google.com/iam", + "api_description": "Manages access control for Google Cloud Platform resources", + "client_documentation": "https://cloud.google.com/java/docs/reference/proto-google-iam-v1/latest/overview", "release_level": "stable", - "transport": "grpc", - "requires_billing": true, + "transport": "both", "language": "java", - "repo": "googleapis/java-iam", + "repo": "googleapis/sdk-platform-java", "repo_short": "java-iam", - "library_type": "OTHER", "distribution_name": "com.google.api.grpc:proto-google-iam-v1", - "excluded_poms": "proto-google-iam-v1-bom,google-iam-policy,proto-google-iam-v1", - "excluded_dependencies": "grpc-google-iam-v1" -} + "library_type": "OTHER", + "requires_billing": true, + "excluded_dependencies": "grpc-google-iam-v1", + "excluded_poms": "proto-google-iam-v1-bom,google-iam-policy,proto-google-iam-v1" +} \ No newline at end of file diff --git a/java-iam/CODE_OF_CONDUCT.md b/java-iam/CODE_OF_CONDUCT.md deleted file mode 100644 index 2add2547a8..0000000000 --- a/java-iam/CODE_OF_CONDUCT.md +++ /dev/null @@ -1,94 +0,0 @@ - -# 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-iam/CONTRIBUTING.md b/java-iam/CONTRIBUTING.md deleted file mode 100644 index b65dd279c9..0000000000 --- a/java-iam/CONTRIBUTING.md +++ /dev/null @@ -1,92 +0,0 @@ -# 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 - -All code samples must be in compliance with the [java sample formatting guide][3]. -Code Samples must be bundled in separate Maven modules. - -The samples must be separate from the primary project for a few reasons: -1. Primary projects have a minimum Java version of Java 8 whereas samples can have - Java version of Java 11. Due to this we need the ability to - selectively exclude samples from a build run. -2. Many code samples depend on external GCP services and need - credentials to access the service. -3. Code samples are not released as Maven artifacts and must be excluded from - release builds. - -### Building - -```bash -mvn clean verify -``` - -Some samples require access to GCP services and require a service account: - -```bash -export GOOGLE_APPLICATION_CREDENTIALS=/path/to/service/account.json -mvn clean verify -``` - -### 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 -``` - -[1]: https://cloud.google.com/docs/authentication/getting-started#creating_a_service_account -[2]: https://maven.apache.org/settings.html#Active_Profiles -[3]: https://github.com/GoogleCloudPlatform/java-docs-samples/blob/main/SAMPLE_FORMAT.md \ No newline at end of file diff --git a/java-iam/LICENSE b/java-iam/LICENSE deleted file mode 100644 index 261eeb9e9f..0000000000 --- a/java-iam/LICENSE +++ /dev/null @@ -1,201 +0,0 @@ - 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-iam/README.md b/java-iam/README.md index 61f37598b7..e7ccafd98b 100644 --- a/java-iam/README.md +++ b/java-iam/README.md @@ -18,41 +18,11 @@ This library follows [Semantic Versioning](http://semver.org/). It is currently in major version zero (`0.y.z`), which means that anything may change at any time and the public API should not be considered stable. -## Contributing - -Contributions to this library are always welcome and highly encouraged. - -See [CONTRIBUTING][contributing] for more information how to get started. - -Please note that this project is released with a Contributor Code of Conduct. By participating in -this project you agree to abide by its terms. See [Code of Conduct][code-of-conduct] for more -information. - ## License Apache 2.0 - See [LICENSE][license] for more information. -## CI Status - -| Java Version | Status | -| -------------- | --------------------------------------------------------- | -| Java 7 | [![Kokoro CI][kokoro-badge-image-1]][kokoro-badge-link-1] | -| Java 8 | [![Kokoro CI][kokoro-badge-image-2]][kokoro-badge-link-2] | -| Java 8 OSX | [![Kokoro CI][kokoro-badge-image-3]][kokoro-badge-link-3] | -| Java 8 Windows | [![Kokoro CI][kokoro-badge-image-4]][kokoro-badge-link-4] | -| Java 11 | [![Kokoro CI][kokoro-badge-image-5]][kokoro-badge-link-5] | - [javadocs]: https://googleapis.dev/java/google-iam/latest/index.html -[kokoro-badge-image-1]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-iam/java7.svg -[kokoro-badge-link-1]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-iam/java7.html -[kokoro-badge-image-2]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-iam/java8.svg -[kokoro-badge-link-2]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-iam/java8.html -[kokoro-badge-image-3]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-iam/java8-osx.svg -[kokoro-badge-link-3]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-iam/java8-osx.html -[kokoro-badge-image-4]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-iam/java8-win.svg -[kokoro-badge-link-4]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-iam/java8-win.html -[kokoro-badge-image-5]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-iam/java11.svg -[kokoro-badge-link-5]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-iam/java11.html [stability-image]: https://img.shields.io/badge/stability-ga-green [maven-version-image]: https://img.shields.io/maven-central/v/com.google.api.grpc/proto-google-iam-v1.svg [maven-version-link]: https://search.maven.org/search?q=g:com.google.api.grpc%20AND%20a:proto-google-iam-v1&core=gav diff --git a/java-iam/SECURITY.md b/java-iam/SECURITY.md deleted file mode 100644 index 8b58ae9c01..0000000000 --- a/java-iam/SECURITY.md +++ /dev/null @@ -1,7 +0,0 @@ -# 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-iam/codecov.yaml b/java-iam/codecov.yaml deleted file mode 100644 index 5724ea9478..0000000000 --- a/java-iam/codecov.yaml +++ /dev/null @@ -1,4 +0,0 @@ ---- -codecov: - ci: - - source.cloud.google.com diff --git a/java-iam/grpc-google-iam-v1/build.gradle b/java-iam/grpc-google-iam-v1/build.gradle deleted file mode 100644 index a346388de6..0000000000 --- a/java-iam/grpc-google-iam-v1/build.gradle +++ /dev/null @@ -1,49 +0,0 @@ -buildscript { - repositories { - mavenCentral() - } -} - -apply plugin: 'java' - -description = 'GRPC library for grpc-google-iam-v1' -group = 'com.google.api.grpc' -version = "0.13.0" -sourceCompatibility = 1.7 -targetCompatibility = 1.7 - -repositories { - mavenCentral() - mavenLocal() -} - -dependencies { - compile 'io.grpc:grpc-stub:1.51.1' - compile 'io.grpc:grpc-protobuf:1.51.1' - compile project(':proto-google-iam-v1') -} - -sourceSets { - main { - java { - srcDir 'src/main/java' - } - } -} - -task javadocJar(type: Jar) { - classifier = 'javadoc' - from javadoc -} - -task sourcesJar(type: Jar) { - classifier = 'sources' - from sourceSets.main.allSource -} - -artifacts { - archives javadocJar, sourcesJar -} - -compileJava.options.encoding = 'UTF-8' -javadoc.options.encoding = 'UTF-8' \ No newline at end of file diff --git a/java-iam/grpc-google-iam-v1/pom.xml b/java-iam/grpc-google-iam-v1/pom.xml index 4677803dd2..5319a907c4 100644 --- a/java-iam/grpc-google-iam-v1/pom.xml +++ b/java-iam/grpc-google-iam-v1/pom.xml @@ -4,13 +4,13 @@ 4.0.0 com.google.api.grpc grpc-google-iam-v1 - 1.6.23-SNAPSHOT + 1.62.1-SNAPSHOT grpc-google-iam-v1 GRPC library for grpc-google-iam-v1 com.google.cloud google-iam-parent - 1.6.23-SNAPSHOT + 1.62.1-SNAPSHOT diff --git a/java-iam/grpc-google-iam-v1/src/main/java/com/google/iam/v1/IAMPolicyGrpc.java b/java-iam/grpc-google-iam-v1/src/main/java/com/google/iam/v1/IAMPolicyGrpc.java index dc9f5653e5..919d8b73ee 100644 --- a/java-iam/grpc-google-iam-v1/src/main/java/com/google/iam/v1/IAMPolicyGrpc.java +++ b/java-iam/grpc-google-iam-v1/src/main/java/com/google/iam/v1/IAMPolicyGrpc.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -41,15 +41,12 @@ * attached. * */ -@javax.annotation.Generated( - value = "by gRPC proto compiler", - comments = "Source: google/iam/v1/iam_policy.proto") @io.grpc.stub.annotations.GrpcGenerated public final class IAMPolicyGrpc { private IAMPolicyGrpc() {} - public static final String SERVICE_NAME = "google.iam.v1.IAMPolicy"; + public static final java.lang.String SERVICE_NAME = "google.iam.v1.IAMPolicy"; // Static method descriptors that strictly reflect the proto. private static volatile io.grpc.MethodDescriptor< @@ -183,6 +180,19 @@ public IAMPolicyStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOp return IAMPolicyStub.newStub(factory, channel); } + /** Creates a new blocking-style stub that supports all types of calls on the service */ + public static IAMPolicyBlockingV2Stub newBlockingV2Stub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public IAMPolicyBlockingV2Stub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new IAMPolicyBlockingV2Stub(channel, callOptions); + } + }; + return IAMPolicyBlockingV2Stub.newStub(factory, channel); + } + /** * Creates a new blocking-style stub that supports unary and streaming output calls on the service */ @@ -235,7 +245,7 @@ public IAMPolicyFutureStub newStub( * attached. * */ - public abstract static class IAMPolicyImplBase implements io.grpc.BindableService { + public interface AsyncService { /** * @@ -246,7 +256,7 @@ public abstract static class IAMPolicyImplBase implements io.grpc.BindableServic * Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED` errors. * */ - public void setIamPolicy( + default void setIamPolicy( com.google.iam.v1.SetIamPolicyRequest request, io.grpc.stub.StreamObserver responseObserver) { io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( @@ -262,7 +272,7 @@ public void setIamPolicy( * set. * */ - public void getIamPolicy( + default void getIamPolicy( com.google.iam.v1.GetIamPolicyRequest request, io.grpc.stub.StreamObserver responseObserver) { io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( @@ -281,42 +291,49 @@ public void getIamPolicy( * may "fail open" without warning. * */ - public void testIamPermissions( + default void testIamPermissions( com.google.iam.v1.TestIamPermissionsRequest request, io.grpc.stub.StreamObserver responseObserver) { io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( getTestIamPermissionsMethod(), responseObserver); } + } + + /** + * Base class for the server implementation of the service IAMPolicy. + * + *
        +   * API Overview
        +   * Manages Identity and Access Management (IAM) policies.
        +   * Any implementation of an API that offers access control features
        +   * implements the google.iam.v1.IAMPolicy interface.
        +   * ## Data model
        +   * Access control is applied when a principal (user or service account), takes
        +   * some action on a resource exposed by a service. Resources, identified by
        +   * URI-like names, are the unit of access control specification. Service
        +   * implementations can choose the granularity of access control and the
        +   * supported permissions for their resources.
        +   * For example one database service may allow access control to be
        +   * specified only at the Table level, whereas another might allow access control
        +   * to also be specified at the Column level.
        +   * ## Policy Structure
        +   * See google.iam.v1.Policy
        +   * This is intentionally not a CRUD style API because access control policies
        +   * are created and deleted implicitly with the resources to which they are
        +   * attached.
        +   * 
        + */ + public abstract static class IAMPolicyImplBase implements io.grpc.BindableService, AsyncService { @java.lang.Override public final io.grpc.ServerServiceDefinition bindService() { - return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) - .addMethod( - getSetIamPolicyMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - com.google.iam.v1.SetIamPolicyRequest, com.google.iam.v1.Policy>( - this, METHODID_SET_IAM_POLICY))) - .addMethod( - getGetIamPolicyMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - com.google.iam.v1.GetIamPolicyRequest, com.google.iam.v1.Policy>( - this, METHODID_GET_IAM_POLICY))) - .addMethod( - getTestIamPermissionsMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - com.google.iam.v1.TestIamPermissionsRequest, - com.google.iam.v1.TestIamPermissionsResponse>( - this, METHODID_TEST_IAM_PERMISSIONS))) - .build(); + return IAMPolicyGrpc.bindService(this); } } /** - * + * A stub to allow clients to do asynchronous rpc calls to service IAMPolicy. * *
            * API Overview
        @@ -409,7 +426,92 @@ public void testIamPermissions(
           }
         
           /**
        +   * A stub to allow clients to do synchronous rpc calls to service IAMPolicy.
            *
        +   * 
        +   * API Overview
        +   * Manages Identity and Access Management (IAM) policies.
        +   * Any implementation of an API that offers access control features
        +   * implements the google.iam.v1.IAMPolicy interface.
        +   * ## Data model
        +   * Access control is applied when a principal (user or service account), takes
        +   * some action on a resource exposed by a service. Resources, identified by
        +   * URI-like names, are the unit of access control specification. Service
        +   * implementations can choose the granularity of access control and the
        +   * supported permissions for their resources.
        +   * For example one database service may allow access control to be
        +   * specified only at the Table level, whereas another might allow access control
        +   * to also be specified at the Column level.
        +   * ## Policy Structure
        +   * See google.iam.v1.Policy
        +   * This is intentionally not a CRUD style API because access control policies
        +   * are created and deleted implicitly with the resources to which they are
        +   * attached.
        +   * 
        + */ + public static final class IAMPolicyBlockingV2Stub + extends io.grpc.stub.AbstractBlockingStub { + private IAMPolicyBlockingV2Stub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected IAMPolicyBlockingV2Stub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new IAMPolicyBlockingV2Stub(channel, callOptions); + } + + /** + * + * + *
        +     * Sets the access control policy on the specified resource. Replaces any
        +     * existing policy.
        +     * Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED` errors.
        +     * 
        + */ + public com.google.iam.v1.Policy setIamPolicy(com.google.iam.v1.SetIamPolicyRequest request) + throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getSetIamPolicyMethod(), getCallOptions(), request); + } + + /** + * + * + *
        +     * Gets the access control policy for a resource.
        +     * Returns an empty policy if the resource exists and does not have a policy
        +     * set.
        +     * 
        + */ + public com.google.iam.v1.Policy getIamPolicy(com.google.iam.v1.GetIamPolicyRequest request) + throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getGetIamPolicyMethod(), getCallOptions(), request); + } + + /** + * + * + *
        +     * Returns permissions that a caller has on the specified resource.
        +     * If the resource does not exist, this will return an empty set of
        +     * permissions, not a `NOT_FOUND` error.
        +     * Note: This operation is designed to be used for building permission-aware
        +     * UIs and command-line tools, not for authorization checking. This operation
        +     * may "fail open" without warning.
        +     * 
        + */ + public com.google.iam.v1.TestIamPermissionsResponse testIamPermissions( + com.google.iam.v1.TestIamPermissionsRequest request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getTestIamPermissionsMethod(), getCallOptions(), request); + } + } + + /** + * A stub to allow clients to do limited synchronous rpc calls to service IAMPolicy. * *
            * API Overview
        @@ -492,7 +594,7 @@ public com.google.iam.v1.TestIamPermissionsResponse testIamPermissions(
           }
         
           /**
        -   *
        +   * A stub to allow clients to do ListenableFuture-style rpc calls to service IAMPolicy.
            *
            * 
            * API Overview
        @@ -585,10 +687,10 @@ private static final class MethodHandlers
                   io.grpc.stub.ServerCalls.ServerStreamingMethod,
                   io.grpc.stub.ServerCalls.ClientStreamingMethod,
                   io.grpc.stub.ServerCalls.BidiStreamingMethod {
        -    private final IAMPolicyImplBase serviceImpl;
        +    private final AsyncService serviceImpl;
             private final int methodId;
         
        -    MethodHandlers(IAMPolicyImplBase serviceImpl, int methodId) {
        +    MethodHandlers(AsyncService serviceImpl, int methodId) {
               this.serviceImpl = serviceImpl;
               this.methodId = methodId;
             }
        @@ -629,6 +731,28 @@ public io.grpc.stub.StreamObserver invoke(
             }
           }
         
        +  public static final io.grpc.ServerServiceDefinition bindService(AsyncService service) {
        +    return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor())
        +        .addMethod(
        +            getSetIamPolicyMethod(),
        +            io.grpc.stub.ServerCalls.asyncUnaryCall(
        +                new MethodHandlers(
        +                    service, METHODID_SET_IAM_POLICY)))
        +        .addMethod(
        +            getGetIamPolicyMethod(),
        +            io.grpc.stub.ServerCalls.asyncUnaryCall(
        +                new MethodHandlers(
        +                    service, METHODID_GET_IAM_POLICY)))
        +        .addMethod(
        +            getTestIamPermissionsMethod(),
        +            io.grpc.stub.ServerCalls.asyncUnaryCall(
        +                new MethodHandlers<
        +                    com.google.iam.v1.TestIamPermissionsRequest,
        +                    com.google.iam.v1.TestIamPermissionsResponse>(
        +                    service, METHODID_TEST_IAM_PERMISSIONS)))
        +        .build();
        +  }
        +
           private abstract static class IAMPolicyBaseDescriptorSupplier
               implements io.grpc.protobuf.ProtoFileDescriptorSupplier,
                   io.grpc.protobuf.ProtoServiceDescriptorSupplier {
        @@ -653,9 +777,9 @@ private static final class IAMPolicyFileDescriptorSupplier
           private static final class IAMPolicyMethodDescriptorSupplier
               extends IAMPolicyBaseDescriptorSupplier
               implements io.grpc.protobuf.ProtoMethodDescriptorSupplier {
        -    private final String methodName;
        +    private final java.lang.String methodName;
         
        -    IAMPolicyMethodDescriptorSupplier(String methodName) {
        +    IAMPolicyMethodDescriptorSupplier(java.lang.String methodName) {
               this.methodName = methodName;
             }
         
        diff --git a/java-iam/grpc-google-iam-v2/pom.xml b/java-iam/grpc-google-iam-v2/pom.xml
        index dfcf90638b..067248b3c4 100644
        --- a/java-iam/grpc-google-iam-v2/pom.xml
        +++ b/java-iam/grpc-google-iam-v2/pom.xml
        @@ -4,13 +4,13 @@
           4.0.0
           com.google.api.grpc
           grpc-google-iam-v2
        -  1.6.23-SNAPSHOT
        +  1.62.1-SNAPSHOT
           grpc-google-iam-v2
           GRPC library for proto-google-iam-v2
           
             com.google.cloud
             google-iam-parent
        -    1.6.23-SNAPSHOT
        +    1.62.1-SNAPSHOT
           
           
             
        diff --git a/java-iam/grpc-google-iam-v2/src/main/java/com/google/iam/v2/PoliciesGrpc.java b/java-iam/grpc-google-iam-v2/src/main/java/com/google/iam/v2/PoliciesGrpc.java
        index bfd3857e07..66dd2a2ca9 100644
        --- a/java-iam/grpc-google-iam-v2/src/main/java/com/google/iam/v2/PoliciesGrpc.java
        +++ b/java-iam/grpc-google-iam-v2/src/main/java/com/google/iam/v2/PoliciesGrpc.java
        @@ -1,5 +1,5 @@
         /*
        - * Copyright 2020 Google LLC
        + * Copyright 2026 Google LLC
          *
          * Licensed under the Apache License, Version 2.0 (the "License");
          * you may not use this file except in compliance with the License.
        @@ -24,15 +24,12 @@
          * An interface for managing Identity and Access Management (IAM) policies.
          * 
        */ -@javax.annotation.Generated( - value = "by gRPC proto compiler", - comments = "Source: google/iam/v2/policy.proto") @io.grpc.stub.annotations.GrpcGenerated public final class PoliciesGrpc { private PoliciesGrpc() {} - public static final String SERVICE_NAME = "google.iam.v2.Policies"; + public static final java.lang.String SERVICE_NAME = "google.iam.v2.Policies"; // Static method descriptors that strictly reflect the proto. private static volatile io.grpc.MethodDescriptor< @@ -246,6 +243,19 @@ public PoliciesStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOpt return PoliciesStub.newStub(factory, channel); } + /** Creates a new blocking-style stub that supports all types of calls on the service */ + public static PoliciesBlockingV2Stub newBlockingV2Stub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public PoliciesBlockingV2Stub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new PoliciesBlockingV2Stub(channel, callOptions); + } + }; + return PoliciesBlockingV2Stub.newStub(factory, channel); + } + /** * Creates a new blocking-style stub that supports unary and streaming output calls on the service */ @@ -281,7 +291,7 @@ public PoliciesFutureStub newStub( * An interface for managing Identity and Access Management (IAM) policies. *
        */ - public abstract static class PoliciesImplBase implements io.grpc.BindableService { + public interface AsyncService { /** * @@ -293,7 +303,7 @@ public abstract static class PoliciesImplBase implements io.grpc.BindableService * omitted. *
        */ - public void listPolicies( + default void listPolicies( com.google.iam.v2.ListPoliciesRequest request, io.grpc.stub.StreamObserver responseObserver) { io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( @@ -307,7 +317,7 @@ public void listPolicies( * Gets a policy. * */ - public void getPolicy( + default void getPolicy( com.google.iam.v2.GetPolicyRequest request, io.grpc.stub.StreamObserver responseObserver) { io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getGetPolicyMethod(), responseObserver); @@ -320,7 +330,7 @@ public void getPolicy( * Creates a policy. * */ - public void createPolicy( + default void createPolicy( com.google.iam.v2.CreatePolicyRequest request, io.grpc.stub.StreamObserver responseObserver) { io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( @@ -340,7 +350,7 @@ public void createPolicy( * This pattern helps prevent conflicts between concurrent updates. * */ - public void updatePolicy( + default void updatePolicy( com.google.iam.v2.UpdatePolicyRequest request, io.grpc.stub.StreamObserver responseObserver) { io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( @@ -354,51 +364,31 @@ public void updatePolicy( * Deletes a policy. This action is permanent. * */ - public void deletePolicy( + default void deletePolicy( com.google.iam.v2.DeletePolicyRequest request, io.grpc.stub.StreamObserver responseObserver) { io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( getDeletePolicyMethod(), responseObserver); } + } + + /** + * Base class for the server implementation of the service Policies. + * + *
        +   * An interface for managing Identity and Access Management (IAM) policies.
        +   * 
        + */ + public abstract static class PoliciesImplBase implements io.grpc.BindableService, AsyncService { @java.lang.Override public final io.grpc.ServerServiceDefinition bindService() { - return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) - .addMethod( - getListPoliciesMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - com.google.iam.v2.ListPoliciesRequest, - com.google.iam.v2.ListPoliciesResponse>(this, METHODID_LIST_POLICIES))) - .addMethod( - getGetPolicyMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers( - this, METHODID_GET_POLICY))) - .addMethod( - getCreatePolicyMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - com.google.iam.v2.CreatePolicyRequest, com.google.longrunning.Operation>( - this, METHODID_CREATE_POLICY))) - .addMethod( - getUpdatePolicyMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - com.google.iam.v2.UpdatePolicyRequest, com.google.longrunning.Operation>( - this, METHODID_UPDATE_POLICY))) - .addMethod( - getDeletePolicyMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - com.google.iam.v2.DeletePolicyRequest, com.google.longrunning.Operation>( - this, METHODID_DELETE_POLICY))) - .build(); + return PoliciesGrpc.bindService(this); } } /** - * + * A stub to allow clients to do asynchronous rpc calls to service Policies. * *
            * An interface for managing Identity and Access Management (IAM) policies.
        @@ -503,7 +493,101 @@ public void deletePolicy(
           }
         
           /**
        +   * A stub to allow clients to do synchronous rpc calls to service Policies.
            *
        +   * 
        +   * An interface for managing Identity and Access Management (IAM) policies.
        +   * 
        + */ + public static final class PoliciesBlockingV2Stub + extends io.grpc.stub.AbstractBlockingStub { + private PoliciesBlockingV2Stub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected PoliciesBlockingV2Stub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new PoliciesBlockingV2Stub(channel, callOptions); + } + + /** + * + * + *
        +     * Retrieves the policies of the specified kind that are attached to a
        +     * resource.
        +     * The response lists only policy metadata. In particular, policy rules are
        +     * omitted.
        +     * 
        + */ + public com.google.iam.v2.ListPoliciesResponse listPolicies( + com.google.iam.v2.ListPoliciesRequest request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getListPoliciesMethod(), getCallOptions(), request); + } + + /** + * + * + *
        +     * Gets a policy.
        +     * 
        + */ + public com.google.iam.v2.Policy getPolicy(com.google.iam.v2.GetPolicyRequest request) + throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getGetPolicyMethod(), getCallOptions(), request); + } + + /** + * + * + *
        +     * Creates a policy.
        +     * 
        + */ + public com.google.longrunning.Operation createPolicy( + com.google.iam.v2.CreatePolicyRequest request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getCreatePolicyMethod(), getCallOptions(), request); + } + + /** + * + * + *
        +     * Updates the specified policy.
        +     * You can update only the rules and the display name for the policy.
        +     * To update a policy, you should use a read-modify-write loop:
        +     * 1. Use [GetPolicy][google.iam.v2.Policies.GetPolicy] to read the current version of the policy.
        +     * 2. Modify the policy as needed.
        +     * 3. Use `UpdatePolicy` to write the updated policy.
        +     * This pattern helps prevent conflicts between concurrent updates.
        +     * 
        + */ + public com.google.longrunning.Operation updatePolicy( + com.google.iam.v2.UpdatePolicyRequest request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getUpdatePolicyMethod(), getCallOptions(), request); + } + + /** + * + * + *
        +     * Deletes a policy. This action is permanent.
        +     * 
        + */ + public com.google.longrunning.Operation deletePolicy( + com.google.iam.v2.DeletePolicyRequest request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getDeletePolicyMethod(), getCallOptions(), request); + } + } + + /** + * A stub to allow clients to do limited synchronous rpc calls to service Policies. * *
            * An interface for managing Identity and Access Management (IAM) policies.
        @@ -595,7 +679,7 @@ public com.google.longrunning.Operation deletePolicy(
           }
         
           /**
        -   *
        +   * A stub to allow clients to do ListenableFuture-style rpc calls to service Policies.
            *
            * 
            * An interface for managing Identity and Access Management (IAM) policies.
        @@ -699,10 +783,10 @@ private static final class MethodHandlers
                   io.grpc.stub.ServerCalls.ServerStreamingMethod,
                   io.grpc.stub.ServerCalls.ClientStreamingMethod,
                   io.grpc.stub.ServerCalls.BidiStreamingMethod {
        -    private final PoliciesImplBase serviceImpl;
        +    private final AsyncService serviceImpl;
             private final int methodId;
         
        -    MethodHandlers(PoliciesImplBase serviceImpl, int methodId) {
        +    MethodHandlers(AsyncService serviceImpl, int methodId) {
               this.serviceImpl = serviceImpl;
               this.methodId = methodId;
             }
        @@ -753,6 +837,40 @@ public io.grpc.stub.StreamObserver invoke(
             }
           }
         
        +  public static final io.grpc.ServerServiceDefinition bindService(AsyncService service) {
        +    return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor())
        +        .addMethod(
        +            getListPoliciesMethod(),
        +            io.grpc.stub.ServerCalls.asyncUnaryCall(
        +                new MethodHandlers<
        +                    com.google.iam.v2.ListPoliciesRequest, com.google.iam.v2.ListPoliciesResponse>(
        +                    service, METHODID_LIST_POLICIES)))
        +        .addMethod(
        +            getGetPolicyMethod(),
        +            io.grpc.stub.ServerCalls.asyncUnaryCall(
        +                new MethodHandlers(
        +                    service, METHODID_GET_POLICY)))
        +        .addMethod(
        +            getCreatePolicyMethod(),
        +            io.grpc.stub.ServerCalls.asyncUnaryCall(
        +                new MethodHandlers<
        +                    com.google.iam.v2.CreatePolicyRequest, com.google.longrunning.Operation>(
        +                    service, METHODID_CREATE_POLICY)))
        +        .addMethod(
        +            getUpdatePolicyMethod(),
        +            io.grpc.stub.ServerCalls.asyncUnaryCall(
        +                new MethodHandlers<
        +                    com.google.iam.v2.UpdatePolicyRequest, com.google.longrunning.Operation>(
        +                    service, METHODID_UPDATE_POLICY)))
        +        .addMethod(
        +            getDeletePolicyMethod(),
        +            io.grpc.stub.ServerCalls.asyncUnaryCall(
        +                new MethodHandlers<
        +                    com.google.iam.v2.DeletePolicyRequest, com.google.longrunning.Operation>(
        +                    service, METHODID_DELETE_POLICY)))
        +        .build();
        +  }
        +
           private abstract static class PoliciesBaseDescriptorSupplier
               implements io.grpc.protobuf.ProtoFileDescriptorSupplier,
                   io.grpc.protobuf.ProtoServiceDescriptorSupplier {
        @@ -775,9 +893,9 @@ private static final class PoliciesFileDescriptorSupplier extends PoliciesBaseDe
         
           private static final class PoliciesMethodDescriptorSupplier extends PoliciesBaseDescriptorSupplier
               implements io.grpc.protobuf.ProtoMethodDescriptorSupplier {
        -    private final String methodName;
        +    private final java.lang.String methodName;
         
        -    PoliciesMethodDescriptorSupplier(String methodName) {
        +    PoliciesMethodDescriptorSupplier(java.lang.String methodName) {
               this.methodName = methodName;
             }
         
        diff --git a/java-iam/grpc-google-iam-v2beta/pom.xml b/java-iam/grpc-google-iam-v2beta/pom.xml
        index a00a6326e1..1301e82a57 100644
        --- a/java-iam/grpc-google-iam-v2beta/pom.xml
        +++ b/java-iam/grpc-google-iam-v2beta/pom.xml
        @@ -4,13 +4,13 @@
           4.0.0
           com.google.api.grpc
           grpc-google-iam-v2beta
        -  1.6.23-SNAPSHOT
        +  1.62.1-SNAPSHOT
           grpc-google-iam-v2beta
           GRPC library for proto-google-iam-v1
           
             com.google.cloud
             google-iam-parent
        -    1.6.23-SNAPSHOT
        +    1.62.1-SNAPSHOT
           
           
             
        diff --git a/java-iam/grpc-google-iam-v2beta/src/main/java/com/google/iam/v2beta/PoliciesGrpc.java b/java-iam/grpc-google-iam-v2beta/src/main/java/com/google/iam/v2beta/PoliciesGrpc.java
        index 57458d9ec7..0f80061851 100644
        --- a/java-iam/grpc-google-iam-v2beta/src/main/java/com/google/iam/v2beta/PoliciesGrpc.java
        +++ b/java-iam/grpc-google-iam-v2beta/src/main/java/com/google/iam/v2beta/PoliciesGrpc.java
        @@ -1,5 +1,5 @@
         /*
        - * Copyright 2020 Google LLC
        + * Copyright 2026 Google LLC
          *
          * Licensed under the Apache License, Version 2.0 (the "License");
          * you may not use this file except in compliance with the License.
        @@ -24,15 +24,12 @@
          * An interface for managing Identity and Access Management (IAM) policies.
          * 
        */ -@javax.annotation.Generated( - value = "by gRPC proto compiler", - comments = "Source: google/iam/v2beta/policy.proto") @io.grpc.stub.annotations.GrpcGenerated public final class PoliciesGrpc { private PoliciesGrpc() {} - public static final String SERVICE_NAME = "google.iam.v2beta.Policies"; + public static final java.lang.String SERVICE_NAME = "google.iam.v2beta.Policies"; // Static method descriptors that strictly reflect the proto. private static volatile io.grpc.MethodDescriptor< @@ -247,6 +244,19 @@ public PoliciesStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOpt return PoliciesStub.newStub(factory, channel); } + /** Creates a new blocking-style stub that supports all types of calls on the service */ + public static PoliciesBlockingV2Stub newBlockingV2Stub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public PoliciesBlockingV2Stub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new PoliciesBlockingV2Stub(channel, callOptions); + } + }; + return PoliciesBlockingV2Stub.newStub(factory, channel); + } + /** * Creates a new blocking-style stub that supports unary and streaming output calls on the service */ @@ -282,7 +292,7 @@ public PoliciesFutureStub newStub( * An interface for managing Identity and Access Management (IAM) policies. *
        */ - public abstract static class PoliciesImplBase implements io.grpc.BindableService { + public interface AsyncService { /** * @@ -294,7 +304,7 @@ public abstract static class PoliciesImplBase implements io.grpc.BindableService * omitted. *
        */ - public void listPolicies( + default void listPolicies( com.google.iam.v2beta.ListPoliciesRequest request, io.grpc.stub.StreamObserver responseObserver) { io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( @@ -308,7 +318,7 @@ public void listPolicies( * Gets a policy. * */ - public void getPolicy( + default void getPolicy( com.google.iam.v2beta.GetPolicyRequest request, io.grpc.stub.StreamObserver responseObserver) { io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getGetPolicyMethod(), responseObserver); @@ -321,7 +331,7 @@ public void getPolicy( * Creates a policy. * */ - public void createPolicy( + default void createPolicy( com.google.iam.v2beta.CreatePolicyRequest request, io.grpc.stub.StreamObserver responseObserver) { io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( @@ -341,7 +351,7 @@ public void createPolicy( * This pattern helps prevent conflicts between concurrent updates. * */ - public void updatePolicy( + default void updatePolicy( com.google.iam.v2beta.UpdatePolicyRequest request, io.grpc.stub.StreamObserver responseObserver) { io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( @@ -355,52 +365,31 @@ public void updatePolicy( * Deletes a policy. This action is permanent. * */ - public void deletePolicy( + default void deletePolicy( com.google.iam.v2beta.DeletePolicyRequest request, io.grpc.stub.StreamObserver responseObserver) { io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( getDeletePolicyMethod(), responseObserver); } + } + + /** + * Base class for the server implementation of the service Policies. + * + *
        +   * An interface for managing Identity and Access Management (IAM) policies.
        +   * 
        + */ + public abstract static class PoliciesImplBase implements io.grpc.BindableService, AsyncService { @java.lang.Override public final io.grpc.ServerServiceDefinition bindService() { - return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) - .addMethod( - getListPoliciesMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - com.google.iam.v2beta.ListPoliciesRequest, - com.google.iam.v2beta.ListPoliciesResponse>(this, METHODID_LIST_POLICIES))) - .addMethod( - getGetPolicyMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - com.google.iam.v2beta.GetPolicyRequest, com.google.iam.v2beta.Policy>( - this, METHODID_GET_POLICY))) - .addMethod( - getCreatePolicyMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - com.google.iam.v2beta.CreatePolicyRequest, com.google.longrunning.Operation>( - this, METHODID_CREATE_POLICY))) - .addMethod( - getUpdatePolicyMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - com.google.iam.v2beta.UpdatePolicyRequest, com.google.longrunning.Operation>( - this, METHODID_UPDATE_POLICY))) - .addMethod( - getDeletePolicyMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - com.google.iam.v2beta.DeletePolicyRequest, com.google.longrunning.Operation>( - this, METHODID_DELETE_POLICY))) - .build(); + return PoliciesGrpc.bindService(this); } } /** - * + * A stub to allow clients to do asynchronous rpc calls to service Policies. * *
            * An interface for managing Identity and Access Management (IAM) policies.
        @@ -505,7 +494,101 @@ public void deletePolicy(
           }
         
           /**
        +   * A stub to allow clients to do synchronous rpc calls to service Policies.
            *
        +   * 
        +   * An interface for managing Identity and Access Management (IAM) policies.
        +   * 
        + */ + public static final class PoliciesBlockingV2Stub + extends io.grpc.stub.AbstractBlockingStub { + private PoliciesBlockingV2Stub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected PoliciesBlockingV2Stub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new PoliciesBlockingV2Stub(channel, callOptions); + } + + /** + * + * + *
        +     * Retrieves the policies of the specified kind that are attached to a
        +     * resource.
        +     * The response lists only policy metadata. In particular, policy rules are
        +     * omitted.
        +     * 
        + */ + public com.google.iam.v2beta.ListPoliciesResponse listPolicies( + com.google.iam.v2beta.ListPoliciesRequest request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getListPoliciesMethod(), getCallOptions(), request); + } + + /** + * + * + *
        +     * Gets a policy.
        +     * 
        + */ + public com.google.iam.v2beta.Policy getPolicy(com.google.iam.v2beta.GetPolicyRequest request) + throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getGetPolicyMethod(), getCallOptions(), request); + } + + /** + * + * + *
        +     * Creates a policy.
        +     * 
        + */ + public com.google.longrunning.Operation createPolicy( + com.google.iam.v2beta.CreatePolicyRequest request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getCreatePolicyMethod(), getCallOptions(), request); + } + + /** + * + * + *
        +     * Updates the specified policy.
        +     * You can update only the rules and the display name for the policy.
        +     * To update a policy, you should use a read-modify-write loop:
        +     * 1. Use [GetPolicy][google.iam.v2beta.Policies.GetPolicy] to read the current version of the policy.
        +     * 2. Modify the policy as needed.
        +     * 3. Use `UpdatePolicy` to write the updated policy.
        +     * This pattern helps prevent conflicts between concurrent updates.
        +     * 
        + */ + public com.google.longrunning.Operation updatePolicy( + com.google.iam.v2beta.UpdatePolicyRequest request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getUpdatePolicyMethod(), getCallOptions(), request); + } + + /** + * + * + *
        +     * Deletes a policy. This action is permanent.
        +     * 
        + */ + public com.google.longrunning.Operation deletePolicy( + com.google.iam.v2beta.DeletePolicyRequest request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getDeletePolicyMethod(), getCallOptions(), request); + } + } + + /** + * A stub to allow clients to do limited synchronous rpc calls to service Policies. * *
            * An interface for managing Identity and Access Management (IAM) policies.
        @@ -597,7 +680,7 @@ public com.google.longrunning.Operation deletePolicy(
           }
         
           /**
        -   *
        +   * A stub to allow clients to do ListenableFuture-style rpc calls to service Policies.
            *
            * 
            * An interface for managing Identity and Access Management (IAM) policies.
        @@ -701,10 +784,10 @@ private static final class MethodHandlers
                   io.grpc.stub.ServerCalls.ServerStreamingMethod,
                   io.grpc.stub.ServerCalls.ClientStreamingMethod,
                   io.grpc.stub.ServerCalls.BidiStreamingMethod {
        -    private final PoliciesImplBase serviceImpl;
        +    private final AsyncService serviceImpl;
             private final int methodId;
         
        -    MethodHandlers(PoliciesImplBase serviceImpl, int methodId) {
        +    MethodHandlers(AsyncService serviceImpl, int methodId) {
               this.serviceImpl = serviceImpl;
               this.methodId = methodId;
             }
        @@ -755,6 +838,41 @@ public io.grpc.stub.StreamObserver invoke(
             }
           }
         
        +  public static final io.grpc.ServerServiceDefinition bindService(AsyncService service) {
        +    return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor())
        +        .addMethod(
        +            getListPoliciesMethod(),
        +            io.grpc.stub.ServerCalls.asyncUnaryCall(
        +                new MethodHandlers<
        +                    com.google.iam.v2beta.ListPoliciesRequest,
        +                    com.google.iam.v2beta.ListPoliciesResponse>(service, METHODID_LIST_POLICIES)))
        +        .addMethod(
        +            getGetPolicyMethod(),
        +            io.grpc.stub.ServerCalls.asyncUnaryCall(
        +                new MethodHandlers<
        +                    com.google.iam.v2beta.GetPolicyRequest, com.google.iam.v2beta.Policy>(
        +                    service, METHODID_GET_POLICY)))
        +        .addMethod(
        +            getCreatePolicyMethod(),
        +            io.grpc.stub.ServerCalls.asyncUnaryCall(
        +                new MethodHandlers<
        +                    com.google.iam.v2beta.CreatePolicyRequest, com.google.longrunning.Operation>(
        +                    service, METHODID_CREATE_POLICY)))
        +        .addMethod(
        +            getUpdatePolicyMethod(),
        +            io.grpc.stub.ServerCalls.asyncUnaryCall(
        +                new MethodHandlers<
        +                    com.google.iam.v2beta.UpdatePolicyRequest, com.google.longrunning.Operation>(
        +                    service, METHODID_UPDATE_POLICY)))
        +        .addMethod(
        +            getDeletePolicyMethod(),
        +            io.grpc.stub.ServerCalls.asyncUnaryCall(
        +                new MethodHandlers<
        +                    com.google.iam.v2beta.DeletePolicyRequest, com.google.longrunning.Operation>(
        +                    service, METHODID_DELETE_POLICY)))
        +        .build();
        +  }
        +
           private abstract static class PoliciesBaseDescriptorSupplier
               implements io.grpc.protobuf.ProtoFileDescriptorSupplier,
                   io.grpc.protobuf.ProtoServiceDescriptorSupplier {
        @@ -777,9 +895,9 @@ private static final class PoliciesFileDescriptorSupplier extends PoliciesBaseDe
         
           private static final class PoliciesMethodDescriptorSupplier extends PoliciesBaseDescriptorSupplier
               implements io.grpc.protobuf.ProtoMethodDescriptorSupplier {
        -    private final String methodName;
        +    private final java.lang.String methodName;
         
        -    PoliciesMethodDescriptorSupplier(String methodName) {
        +    PoliciesMethodDescriptorSupplier(java.lang.String methodName) {
               this.methodName = methodName;
             }
         
        diff --git a/java-iam/grpc-google-iam-v3/pom.xml b/java-iam/grpc-google-iam-v3/pom.xml
        new file mode 100644
        index 0000000000..c0c540605f
        --- /dev/null
        +++ b/java-iam/grpc-google-iam-v3/pom.xml
        @@ -0,0 +1,69 @@
        +
        +  4.0.0
        +  com.google.api.grpc
        +  grpc-google-iam-v3
        +  1.62.1-SNAPSHOT
        +  grpc-google-iam-v3
        +  GRPC library for proto-google-iam-v3
        +  
        +    com.google.cloud
        +    google-iam-parent
        +    1.62.1-SNAPSHOT
        +  
        +  
        +    
        +      io.grpc
        +      grpc-api
        +    
        +    
        +      io.grpc
        +      grpc-stub
        +    
        +    
        +      io.grpc
        +      grpc-protobuf
        +    
        +    
        +      com.google.protobuf
        +      protobuf-java
        +    
        +    
        +      com.google.api.grpc
        +      proto-google-common-protos
        +    
        +    
        +      com.google.api.grpc
        +      proto-google-iam-v3
        +    
        +    
        +      com.google.guava
        +      guava
        +    
        +  
        +
        +  
        +    
        +      java9
        +      
        +        [9,)
        +      
        +      
        +        
        +          javax.annotation
        +          javax.annotation-api
        +        
        +      
        +    
        +  
        +
        +  
        +    
        +      
        +        org.codehaus.mojo
        +        flatten-maven-plugin
        +      
        +    
        +  
        +
        diff --git a/java-iam/grpc-google-iam-v3/src/main/java/com/google/iam/v3/PolicyBindingsGrpc.java b/java-iam/grpc-google-iam-v3/src/main/java/com/google/iam/v3/PolicyBindingsGrpc.java
        new file mode 100644
        index 0000000000..0fa2f555a5
        --- /dev/null
        +++ b/java-iam/grpc-google-iam-v3/src/main/java/com/google/iam/v3/PolicyBindingsGrpc.java
        @@ -0,0 +1,1111 @@
        +/*
        + * Copyright 2026 Google LLC
        + *
        + * Licensed under the Apache License, Version 2.0 (the "License");
        + * you may not use this file except in compliance with the License.
        + * You may obtain a copy of the License at
        + *
        + *     https://www.apache.org/licenses/LICENSE-2.0
        + *
        + * Unless required by applicable law or agreed to in writing, software
        + * distributed under the License is distributed on an "AS IS" BASIS,
        + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
        + * See the License for the specific language governing permissions and
        + * limitations under the License.
        + */
        +package com.google.iam.v3;
        +
        +import static io.grpc.MethodDescriptor.generateFullMethodName;
        +
        +/**
        + *
        + *
        + * 
        + * An interface for managing Identity and Access Management (IAM) policy
        + * bindings.
        + * 
        + */ +@io.grpc.stub.annotations.GrpcGenerated +public final class PolicyBindingsGrpc { + + private PolicyBindingsGrpc() {} + + public static final java.lang.String SERVICE_NAME = "google.iam.v3.PolicyBindings"; + + // Static method descriptors that strictly reflect the proto. + private static volatile io.grpc.MethodDescriptor< + com.google.iam.v3.CreatePolicyBindingRequest, com.google.longrunning.Operation> + getCreatePolicyBindingMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "CreatePolicyBinding", + requestType = com.google.iam.v3.CreatePolicyBindingRequest.class, + responseType = com.google.longrunning.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.iam.v3.CreatePolicyBindingRequest, com.google.longrunning.Operation> + getCreatePolicyBindingMethod() { + io.grpc.MethodDescriptor< + com.google.iam.v3.CreatePolicyBindingRequest, com.google.longrunning.Operation> + getCreatePolicyBindingMethod; + if ((getCreatePolicyBindingMethod = PolicyBindingsGrpc.getCreatePolicyBindingMethod) == null) { + synchronized (PolicyBindingsGrpc.class) { + if ((getCreatePolicyBindingMethod = PolicyBindingsGrpc.getCreatePolicyBindingMethod) + == null) { + PolicyBindingsGrpc.getCreatePolicyBindingMethod = + getCreatePolicyBindingMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName(SERVICE_NAME, "CreatePolicyBinding")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.iam.v3.CreatePolicyBindingRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor( + new PolicyBindingsMethodDescriptorSupplier("CreatePolicyBinding")) + .build(); + } + } + } + return getCreatePolicyBindingMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.iam.v3.GetPolicyBindingRequest, com.google.iam.v3.PolicyBinding> + getGetPolicyBindingMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "GetPolicyBinding", + requestType = com.google.iam.v3.GetPolicyBindingRequest.class, + responseType = com.google.iam.v3.PolicyBinding.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.iam.v3.GetPolicyBindingRequest, com.google.iam.v3.PolicyBinding> + getGetPolicyBindingMethod() { + io.grpc.MethodDescriptor< + com.google.iam.v3.GetPolicyBindingRequest, com.google.iam.v3.PolicyBinding> + getGetPolicyBindingMethod; + if ((getGetPolicyBindingMethod = PolicyBindingsGrpc.getGetPolicyBindingMethod) == null) { + synchronized (PolicyBindingsGrpc.class) { + if ((getGetPolicyBindingMethod = PolicyBindingsGrpc.getGetPolicyBindingMethod) == null) { + PolicyBindingsGrpc.getGetPolicyBindingMethod = + getGetPolicyBindingMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetPolicyBinding")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.iam.v3.GetPolicyBindingRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.iam.v3.PolicyBinding.getDefaultInstance())) + .setSchemaDescriptor( + new PolicyBindingsMethodDescriptorSupplier("GetPolicyBinding")) + .build(); + } + } + } + return getGetPolicyBindingMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.iam.v3.UpdatePolicyBindingRequest, com.google.longrunning.Operation> + getUpdatePolicyBindingMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "UpdatePolicyBinding", + requestType = com.google.iam.v3.UpdatePolicyBindingRequest.class, + responseType = com.google.longrunning.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.iam.v3.UpdatePolicyBindingRequest, com.google.longrunning.Operation> + getUpdatePolicyBindingMethod() { + io.grpc.MethodDescriptor< + com.google.iam.v3.UpdatePolicyBindingRequest, com.google.longrunning.Operation> + getUpdatePolicyBindingMethod; + if ((getUpdatePolicyBindingMethod = PolicyBindingsGrpc.getUpdatePolicyBindingMethod) == null) { + synchronized (PolicyBindingsGrpc.class) { + if ((getUpdatePolicyBindingMethod = PolicyBindingsGrpc.getUpdatePolicyBindingMethod) + == null) { + PolicyBindingsGrpc.getUpdatePolicyBindingMethod = + getUpdatePolicyBindingMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName(SERVICE_NAME, "UpdatePolicyBinding")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.iam.v3.UpdatePolicyBindingRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor( + new PolicyBindingsMethodDescriptorSupplier("UpdatePolicyBinding")) + .build(); + } + } + } + return getUpdatePolicyBindingMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.iam.v3.DeletePolicyBindingRequest, com.google.longrunning.Operation> + getDeletePolicyBindingMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "DeletePolicyBinding", + requestType = com.google.iam.v3.DeletePolicyBindingRequest.class, + responseType = com.google.longrunning.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.iam.v3.DeletePolicyBindingRequest, com.google.longrunning.Operation> + getDeletePolicyBindingMethod() { + io.grpc.MethodDescriptor< + com.google.iam.v3.DeletePolicyBindingRequest, com.google.longrunning.Operation> + getDeletePolicyBindingMethod; + if ((getDeletePolicyBindingMethod = PolicyBindingsGrpc.getDeletePolicyBindingMethod) == null) { + synchronized (PolicyBindingsGrpc.class) { + if ((getDeletePolicyBindingMethod = PolicyBindingsGrpc.getDeletePolicyBindingMethod) + == null) { + PolicyBindingsGrpc.getDeletePolicyBindingMethod = + getDeletePolicyBindingMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName(SERVICE_NAME, "DeletePolicyBinding")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.iam.v3.DeletePolicyBindingRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor( + new PolicyBindingsMethodDescriptorSupplier("DeletePolicyBinding")) + .build(); + } + } + } + return getDeletePolicyBindingMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.iam.v3.ListPolicyBindingsRequest, com.google.iam.v3.ListPolicyBindingsResponse> + getListPolicyBindingsMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "ListPolicyBindings", + requestType = com.google.iam.v3.ListPolicyBindingsRequest.class, + responseType = com.google.iam.v3.ListPolicyBindingsResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.iam.v3.ListPolicyBindingsRequest, com.google.iam.v3.ListPolicyBindingsResponse> + getListPolicyBindingsMethod() { + io.grpc.MethodDescriptor< + com.google.iam.v3.ListPolicyBindingsRequest, + com.google.iam.v3.ListPolicyBindingsResponse> + getListPolicyBindingsMethod; + if ((getListPolicyBindingsMethod = PolicyBindingsGrpc.getListPolicyBindingsMethod) == null) { + synchronized (PolicyBindingsGrpc.class) { + if ((getListPolicyBindingsMethod = PolicyBindingsGrpc.getListPolicyBindingsMethod) + == null) { + PolicyBindingsGrpc.getListPolicyBindingsMethod = + getListPolicyBindingsMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "ListPolicyBindings")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.iam.v3.ListPolicyBindingsRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.iam.v3.ListPolicyBindingsResponse.getDefaultInstance())) + .setSchemaDescriptor( + new PolicyBindingsMethodDescriptorSupplier("ListPolicyBindings")) + .build(); + } + } + } + return getListPolicyBindingsMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.iam.v3.SearchTargetPolicyBindingsRequest, + com.google.iam.v3.SearchTargetPolicyBindingsResponse> + getSearchTargetPolicyBindingsMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "SearchTargetPolicyBindings", + requestType = com.google.iam.v3.SearchTargetPolicyBindingsRequest.class, + responseType = com.google.iam.v3.SearchTargetPolicyBindingsResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.iam.v3.SearchTargetPolicyBindingsRequest, + com.google.iam.v3.SearchTargetPolicyBindingsResponse> + getSearchTargetPolicyBindingsMethod() { + io.grpc.MethodDescriptor< + com.google.iam.v3.SearchTargetPolicyBindingsRequest, + com.google.iam.v3.SearchTargetPolicyBindingsResponse> + getSearchTargetPolicyBindingsMethod; + if ((getSearchTargetPolicyBindingsMethod = + PolicyBindingsGrpc.getSearchTargetPolicyBindingsMethod) + == null) { + synchronized (PolicyBindingsGrpc.class) { + if ((getSearchTargetPolicyBindingsMethod = + PolicyBindingsGrpc.getSearchTargetPolicyBindingsMethod) + == null) { + PolicyBindingsGrpc.getSearchTargetPolicyBindingsMethod = + getSearchTargetPolicyBindingsMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName(SERVICE_NAME, "SearchTargetPolicyBindings")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.iam.v3.SearchTargetPolicyBindingsRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.iam.v3.SearchTargetPolicyBindingsResponse + .getDefaultInstance())) + .setSchemaDescriptor( + new PolicyBindingsMethodDescriptorSupplier("SearchTargetPolicyBindings")) + .build(); + } + } + } + return getSearchTargetPolicyBindingsMethod; + } + + /** Creates a new async stub that supports all call types for the service */ + public static PolicyBindingsStub newStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public PolicyBindingsStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new PolicyBindingsStub(channel, callOptions); + } + }; + return PolicyBindingsStub.newStub(factory, channel); + } + + /** Creates a new blocking-style stub that supports all types of calls on the service */ + public static PolicyBindingsBlockingV2Stub newBlockingV2Stub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public PolicyBindingsBlockingV2Stub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new PolicyBindingsBlockingV2Stub(channel, callOptions); + } + }; + return PolicyBindingsBlockingV2Stub.newStub(factory, channel); + } + + /** + * Creates a new blocking-style stub that supports unary and streaming output calls on the service + */ + public static PolicyBindingsBlockingStub newBlockingStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public PolicyBindingsBlockingStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new PolicyBindingsBlockingStub(channel, callOptions); + } + }; + return PolicyBindingsBlockingStub.newStub(factory, channel); + } + + /** Creates a new ListenableFuture-style stub that supports unary calls on the service */ + public static PolicyBindingsFutureStub newFutureStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public PolicyBindingsFutureStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new PolicyBindingsFutureStub(channel, callOptions); + } + }; + return PolicyBindingsFutureStub.newStub(factory, channel); + } + + /** + * + * + *
        +   * An interface for managing Identity and Access Management (IAM) policy
        +   * bindings.
        +   * 
        + */ + public interface AsyncService { + + /** + * + * + *
        +     * Creates a policy binding and returns a long-running operation.
        +     * Callers will need the IAM permissions on both the policy and target.
        +     * Once the binding is created, the policy is applied to the target.
        +     * 
        + */ + default void createPolicyBinding( + com.google.iam.v3.CreatePolicyBindingRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getCreatePolicyBindingMethod(), responseObserver); + } + + /** + * + * + *
        +     * Gets a policy binding.
        +     * 
        + */ + default void getPolicyBinding( + com.google.iam.v3.GetPolicyBindingRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getGetPolicyBindingMethod(), responseObserver); + } + + /** + * + * + *
        +     * Updates a policy binding and returns a long-running operation.
        +     * Callers will need the IAM permissions on the policy and target in the
        +     * binding to update, and the IAM permission to remove the existing policy
        +     * from the binding. Target is immutable and cannot be updated. Once the
        +     * binding is updated, the new policy is applied to the target.
        +     * 
        + */ + default void updatePolicyBinding( + com.google.iam.v3.UpdatePolicyBindingRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getUpdatePolicyBindingMethod(), responseObserver); + } + + /** + * + * + *
        +     * Deletes a policy binding and returns a long-running operation.
        +     * Callers will need the IAM permissions on both the policy and target.
        +     * Once the binding is deleted, the policy no longer applies to the target.
        +     * 
        + */ + default void deletePolicyBinding( + com.google.iam.v3.DeletePolicyBindingRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getDeletePolicyBindingMethod(), responseObserver); + } + + /** + * + * + *
        +     * Lists policy bindings.
        +     * 
        + */ + default void listPolicyBindings( + com.google.iam.v3.ListPolicyBindingsRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getListPolicyBindingsMethod(), responseObserver); + } + + /** + * + * + *
        +     * Search policy bindings by target. Returns all policy binding objects bound
        +     * directly to target.
        +     * 
        + */ + default void searchTargetPolicyBindings( + com.google.iam.v3.SearchTargetPolicyBindingsRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getSearchTargetPolicyBindingsMethod(), responseObserver); + } + } + + /** + * Base class for the server implementation of the service PolicyBindings. + * + *
        +   * An interface for managing Identity and Access Management (IAM) policy
        +   * bindings.
        +   * 
        + */ + public abstract static class PolicyBindingsImplBase + implements io.grpc.BindableService, AsyncService { + + @java.lang.Override + public final io.grpc.ServerServiceDefinition bindService() { + return PolicyBindingsGrpc.bindService(this); + } + } + + /** + * A stub to allow clients to do asynchronous rpc calls to service PolicyBindings. + * + *
        +   * An interface for managing Identity and Access Management (IAM) policy
        +   * bindings.
        +   * 
        + */ + public static final class PolicyBindingsStub + extends io.grpc.stub.AbstractAsyncStub { + private PolicyBindingsStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected PolicyBindingsStub build(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new PolicyBindingsStub(channel, callOptions); + } + + /** + * + * + *
        +     * Creates a policy binding and returns a long-running operation.
        +     * Callers will need the IAM permissions on both the policy and target.
        +     * Once the binding is created, the policy is applied to the target.
        +     * 
        + */ + public void createPolicyBinding( + com.google.iam.v3.CreatePolicyBindingRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getCreatePolicyBindingMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
        +     * Gets a policy binding.
        +     * 
        + */ + public void getPolicyBinding( + com.google.iam.v3.GetPolicyBindingRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getGetPolicyBindingMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
        +     * Updates a policy binding and returns a long-running operation.
        +     * Callers will need the IAM permissions on the policy and target in the
        +     * binding to update, and the IAM permission to remove the existing policy
        +     * from the binding. Target is immutable and cannot be updated. Once the
        +     * binding is updated, the new policy is applied to the target.
        +     * 
        + */ + public void updatePolicyBinding( + com.google.iam.v3.UpdatePolicyBindingRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getUpdatePolicyBindingMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
        +     * Deletes a policy binding and returns a long-running operation.
        +     * Callers will need the IAM permissions on both the policy and target.
        +     * Once the binding is deleted, the policy no longer applies to the target.
        +     * 
        + */ + public void deletePolicyBinding( + com.google.iam.v3.DeletePolicyBindingRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getDeletePolicyBindingMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
        +     * Lists policy bindings.
        +     * 
        + */ + public void listPolicyBindings( + com.google.iam.v3.ListPolicyBindingsRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getListPolicyBindingsMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
        +     * Search policy bindings by target. Returns all policy binding objects bound
        +     * directly to target.
        +     * 
        + */ + public void searchTargetPolicyBindings( + com.google.iam.v3.SearchTargetPolicyBindingsRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getSearchTargetPolicyBindingsMethod(), getCallOptions()), + request, + responseObserver); + } + } + + /** + * A stub to allow clients to do synchronous rpc calls to service PolicyBindings. + * + *
        +   * An interface for managing Identity and Access Management (IAM) policy
        +   * bindings.
        +   * 
        + */ + public static final class PolicyBindingsBlockingV2Stub + extends io.grpc.stub.AbstractBlockingStub { + private PolicyBindingsBlockingV2Stub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected PolicyBindingsBlockingV2Stub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new PolicyBindingsBlockingV2Stub(channel, callOptions); + } + + /** + * + * + *
        +     * Creates a policy binding and returns a long-running operation.
        +     * Callers will need the IAM permissions on both the policy and target.
        +     * Once the binding is created, the policy is applied to the target.
        +     * 
        + */ + public com.google.longrunning.Operation createPolicyBinding( + com.google.iam.v3.CreatePolicyBindingRequest request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getCreatePolicyBindingMethod(), getCallOptions(), request); + } + + /** + * + * + *
        +     * Gets a policy binding.
        +     * 
        + */ + public com.google.iam.v3.PolicyBinding getPolicyBinding( + com.google.iam.v3.GetPolicyBindingRequest request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getGetPolicyBindingMethod(), getCallOptions(), request); + } + + /** + * + * + *
        +     * Updates a policy binding and returns a long-running operation.
        +     * Callers will need the IAM permissions on the policy and target in the
        +     * binding to update, and the IAM permission to remove the existing policy
        +     * from the binding. Target is immutable and cannot be updated. Once the
        +     * binding is updated, the new policy is applied to the target.
        +     * 
        + */ + public com.google.longrunning.Operation updatePolicyBinding( + com.google.iam.v3.UpdatePolicyBindingRequest request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getUpdatePolicyBindingMethod(), getCallOptions(), request); + } + + /** + * + * + *
        +     * Deletes a policy binding and returns a long-running operation.
        +     * Callers will need the IAM permissions on both the policy and target.
        +     * Once the binding is deleted, the policy no longer applies to the target.
        +     * 
        + */ + public com.google.longrunning.Operation deletePolicyBinding( + com.google.iam.v3.DeletePolicyBindingRequest request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getDeletePolicyBindingMethod(), getCallOptions(), request); + } + + /** + * + * + *
        +     * Lists policy bindings.
        +     * 
        + */ + public com.google.iam.v3.ListPolicyBindingsResponse listPolicyBindings( + com.google.iam.v3.ListPolicyBindingsRequest request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getListPolicyBindingsMethod(), getCallOptions(), request); + } + + /** + * + * + *
        +     * Search policy bindings by target. Returns all policy binding objects bound
        +     * directly to target.
        +     * 
        + */ + public com.google.iam.v3.SearchTargetPolicyBindingsResponse searchTargetPolicyBindings( + com.google.iam.v3.SearchTargetPolicyBindingsRequest request) + throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getSearchTargetPolicyBindingsMethod(), getCallOptions(), request); + } + } + + /** + * A stub to allow clients to do limited synchronous rpc calls to service PolicyBindings. + * + *
        +   * An interface for managing Identity and Access Management (IAM) policy
        +   * bindings.
        +   * 
        + */ + public static final class PolicyBindingsBlockingStub + extends io.grpc.stub.AbstractBlockingStub { + private PolicyBindingsBlockingStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected PolicyBindingsBlockingStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new PolicyBindingsBlockingStub(channel, callOptions); + } + + /** + * + * + *
        +     * Creates a policy binding and returns a long-running operation.
        +     * Callers will need the IAM permissions on both the policy and target.
        +     * Once the binding is created, the policy is applied to the target.
        +     * 
        + */ + public com.google.longrunning.Operation createPolicyBinding( + com.google.iam.v3.CreatePolicyBindingRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getCreatePolicyBindingMethod(), getCallOptions(), request); + } + + /** + * + * + *
        +     * Gets a policy binding.
        +     * 
        + */ + public com.google.iam.v3.PolicyBinding getPolicyBinding( + com.google.iam.v3.GetPolicyBindingRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getGetPolicyBindingMethod(), getCallOptions(), request); + } + + /** + * + * + *
        +     * Updates a policy binding and returns a long-running operation.
        +     * Callers will need the IAM permissions on the policy and target in the
        +     * binding to update, and the IAM permission to remove the existing policy
        +     * from the binding. Target is immutable and cannot be updated. Once the
        +     * binding is updated, the new policy is applied to the target.
        +     * 
        + */ + public com.google.longrunning.Operation updatePolicyBinding( + com.google.iam.v3.UpdatePolicyBindingRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getUpdatePolicyBindingMethod(), getCallOptions(), request); + } + + /** + * + * + *
        +     * Deletes a policy binding and returns a long-running operation.
        +     * Callers will need the IAM permissions on both the policy and target.
        +     * Once the binding is deleted, the policy no longer applies to the target.
        +     * 
        + */ + public com.google.longrunning.Operation deletePolicyBinding( + com.google.iam.v3.DeletePolicyBindingRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getDeletePolicyBindingMethod(), getCallOptions(), request); + } + + /** + * + * + *
        +     * Lists policy bindings.
        +     * 
        + */ + public com.google.iam.v3.ListPolicyBindingsResponse listPolicyBindings( + com.google.iam.v3.ListPolicyBindingsRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getListPolicyBindingsMethod(), getCallOptions(), request); + } + + /** + * + * + *
        +     * Search policy bindings by target. Returns all policy binding objects bound
        +     * directly to target.
        +     * 
        + */ + public com.google.iam.v3.SearchTargetPolicyBindingsResponse searchTargetPolicyBindings( + com.google.iam.v3.SearchTargetPolicyBindingsRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getSearchTargetPolicyBindingsMethod(), getCallOptions(), request); + } + } + + /** + * A stub to allow clients to do ListenableFuture-style rpc calls to service PolicyBindings. + * + *
        +   * An interface for managing Identity and Access Management (IAM) policy
        +   * bindings.
        +   * 
        + */ + public static final class PolicyBindingsFutureStub + extends io.grpc.stub.AbstractFutureStub { + private PolicyBindingsFutureStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected PolicyBindingsFutureStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new PolicyBindingsFutureStub(channel, callOptions); + } + + /** + * + * + *
        +     * Creates a policy binding and returns a long-running operation.
        +     * Callers will need the IAM permissions on both the policy and target.
        +     * Once the binding is created, the policy is applied to the target.
        +     * 
        + */ + public com.google.common.util.concurrent.ListenableFuture + createPolicyBinding(com.google.iam.v3.CreatePolicyBindingRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getCreatePolicyBindingMethod(), getCallOptions()), request); + } + + /** + * + * + *
        +     * Gets a policy binding.
        +     * 
        + */ + public com.google.common.util.concurrent.ListenableFuture + getPolicyBinding(com.google.iam.v3.GetPolicyBindingRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getGetPolicyBindingMethod(), getCallOptions()), request); + } + + /** + * + * + *
        +     * Updates a policy binding and returns a long-running operation.
        +     * Callers will need the IAM permissions on the policy and target in the
        +     * binding to update, and the IAM permission to remove the existing policy
        +     * from the binding. Target is immutable and cannot be updated. Once the
        +     * binding is updated, the new policy is applied to the target.
        +     * 
        + */ + public com.google.common.util.concurrent.ListenableFuture + updatePolicyBinding(com.google.iam.v3.UpdatePolicyBindingRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getUpdatePolicyBindingMethod(), getCallOptions()), request); + } + + /** + * + * + *
        +     * Deletes a policy binding and returns a long-running operation.
        +     * Callers will need the IAM permissions on both the policy and target.
        +     * Once the binding is deleted, the policy no longer applies to the target.
        +     * 
        + */ + public com.google.common.util.concurrent.ListenableFuture + deletePolicyBinding(com.google.iam.v3.DeletePolicyBindingRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getDeletePolicyBindingMethod(), getCallOptions()), request); + } + + /** + * + * + *
        +     * Lists policy bindings.
        +     * 
        + */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.iam.v3.ListPolicyBindingsResponse> + listPolicyBindings(com.google.iam.v3.ListPolicyBindingsRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getListPolicyBindingsMethod(), getCallOptions()), request); + } + + /** + * + * + *
        +     * Search policy bindings by target. Returns all policy binding objects bound
        +     * directly to target.
        +     * 
        + */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.iam.v3.SearchTargetPolicyBindingsResponse> + searchTargetPolicyBindings(com.google.iam.v3.SearchTargetPolicyBindingsRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getSearchTargetPolicyBindingsMethod(), getCallOptions()), request); + } + } + + private static final int METHODID_CREATE_POLICY_BINDING = 0; + private static final int METHODID_GET_POLICY_BINDING = 1; + private static final int METHODID_UPDATE_POLICY_BINDING = 2; + private static final int METHODID_DELETE_POLICY_BINDING = 3; + private static final int METHODID_LIST_POLICY_BINDINGS = 4; + private static final int METHODID_SEARCH_TARGET_POLICY_BINDINGS = 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_CREATE_POLICY_BINDING: + serviceImpl.createPolicyBinding( + (com.google.iam.v3.CreatePolicyBindingRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_GET_POLICY_BINDING: + serviceImpl.getPolicyBinding( + (com.google.iam.v3.GetPolicyBindingRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_UPDATE_POLICY_BINDING: + serviceImpl.updatePolicyBinding( + (com.google.iam.v3.UpdatePolicyBindingRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_DELETE_POLICY_BINDING: + serviceImpl.deletePolicyBinding( + (com.google.iam.v3.DeletePolicyBindingRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_LIST_POLICY_BINDINGS: + serviceImpl.listPolicyBindings( + (com.google.iam.v3.ListPolicyBindingsRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_SEARCH_TARGET_POLICY_BINDINGS: + serviceImpl.searchTargetPolicyBindings( + (com.google.iam.v3.SearchTargetPolicyBindingsRequest) 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( + getCreatePolicyBindingMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.iam.v3.CreatePolicyBindingRequest, com.google.longrunning.Operation>( + service, METHODID_CREATE_POLICY_BINDING))) + .addMethod( + getGetPolicyBindingMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.iam.v3.GetPolicyBindingRequest, com.google.iam.v3.PolicyBinding>( + service, METHODID_GET_POLICY_BINDING))) + .addMethod( + getUpdatePolicyBindingMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.iam.v3.UpdatePolicyBindingRequest, com.google.longrunning.Operation>( + service, METHODID_UPDATE_POLICY_BINDING))) + .addMethod( + getDeletePolicyBindingMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.iam.v3.DeletePolicyBindingRequest, com.google.longrunning.Operation>( + service, METHODID_DELETE_POLICY_BINDING))) + .addMethod( + getListPolicyBindingsMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.iam.v3.ListPolicyBindingsRequest, + com.google.iam.v3.ListPolicyBindingsResponse>( + service, METHODID_LIST_POLICY_BINDINGS))) + .addMethod( + getSearchTargetPolicyBindingsMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.iam.v3.SearchTargetPolicyBindingsRequest, + com.google.iam.v3.SearchTargetPolicyBindingsResponse>( + service, METHODID_SEARCH_TARGET_POLICY_BINDINGS))) + .build(); + } + + private abstract static class PolicyBindingsBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoFileDescriptorSupplier, + io.grpc.protobuf.ProtoServiceDescriptorSupplier { + PolicyBindingsBaseDescriptorSupplier() {} + + @java.lang.Override + public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() { + return com.google.iam.v3.PolicyBindingsServiceProto.getDescriptor(); + } + + @java.lang.Override + public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() { + return getFileDescriptor().findServiceByName("PolicyBindings"); + } + } + + private static final class PolicyBindingsFileDescriptorSupplier + extends PolicyBindingsBaseDescriptorSupplier { + PolicyBindingsFileDescriptorSupplier() {} + } + + private static final class PolicyBindingsMethodDescriptorSupplier + extends PolicyBindingsBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoMethodDescriptorSupplier { + private final java.lang.String methodName; + + PolicyBindingsMethodDescriptorSupplier(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 (PolicyBindingsGrpc.class) { + result = serviceDescriptor; + if (result == null) { + serviceDescriptor = + result = + io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME) + .setSchemaDescriptor(new PolicyBindingsFileDescriptorSupplier()) + .addMethod(getCreatePolicyBindingMethod()) + .addMethod(getGetPolicyBindingMethod()) + .addMethod(getUpdatePolicyBindingMethod()) + .addMethod(getDeletePolicyBindingMethod()) + .addMethod(getListPolicyBindingsMethod()) + .addMethod(getSearchTargetPolicyBindingsMethod()) + .build(); + } + } + } + return result; + } +} diff --git a/java-iam/grpc-google-iam-v3/src/main/java/com/google/iam/v3/PrincipalAccessBoundaryPoliciesGrpc.java b/java-iam/grpc-google-iam-v3/src/main/java/com/google/iam/v3/PrincipalAccessBoundaryPoliciesGrpc.java new file mode 100644 index 0000000000..9aa2dceec2 --- /dev/null +++ b/java-iam/grpc-google-iam-v3/src/main/java/com/google/iam/v3/PrincipalAccessBoundaryPoliciesGrpc.java @@ -0,0 +1,1181 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.iam.v3; + +import static io.grpc.MethodDescriptor.generateFullMethodName; + +/** + * + * + *
        + * Manages Identity and Access Management (IAM) principal access boundary
        + * policies.
        + * 
        + */ +@io.grpc.stub.annotations.GrpcGenerated +public final class PrincipalAccessBoundaryPoliciesGrpc { + + private PrincipalAccessBoundaryPoliciesGrpc() {} + + public static final java.lang.String SERVICE_NAME = + "google.iam.v3.PrincipalAccessBoundaryPolicies"; + + // Static method descriptors that strictly reflect the proto. + private static volatile io.grpc.MethodDescriptor< + com.google.iam.v3.CreatePrincipalAccessBoundaryPolicyRequest, + com.google.longrunning.Operation> + getCreatePrincipalAccessBoundaryPolicyMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "CreatePrincipalAccessBoundaryPolicy", + requestType = com.google.iam.v3.CreatePrincipalAccessBoundaryPolicyRequest.class, + responseType = com.google.longrunning.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.iam.v3.CreatePrincipalAccessBoundaryPolicyRequest, + com.google.longrunning.Operation> + getCreatePrincipalAccessBoundaryPolicyMethod() { + io.grpc.MethodDescriptor< + com.google.iam.v3.CreatePrincipalAccessBoundaryPolicyRequest, + com.google.longrunning.Operation> + getCreatePrincipalAccessBoundaryPolicyMethod; + if ((getCreatePrincipalAccessBoundaryPolicyMethod = + PrincipalAccessBoundaryPoliciesGrpc.getCreatePrincipalAccessBoundaryPolicyMethod) + == null) { + synchronized (PrincipalAccessBoundaryPoliciesGrpc.class) { + if ((getCreatePrincipalAccessBoundaryPolicyMethod = + PrincipalAccessBoundaryPoliciesGrpc.getCreatePrincipalAccessBoundaryPolicyMethod) + == null) { + PrincipalAccessBoundaryPoliciesGrpc.getCreatePrincipalAccessBoundaryPolicyMethod = + getCreatePrincipalAccessBoundaryPolicyMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName( + SERVICE_NAME, "CreatePrincipalAccessBoundaryPolicy")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.iam.v3.CreatePrincipalAccessBoundaryPolicyRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor( + new PrincipalAccessBoundaryPoliciesMethodDescriptorSupplier( + "CreatePrincipalAccessBoundaryPolicy")) + .build(); + } + } + } + return getCreatePrincipalAccessBoundaryPolicyMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.iam.v3.GetPrincipalAccessBoundaryPolicyRequest, + com.google.iam.v3.PrincipalAccessBoundaryPolicy> + getGetPrincipalAccessBoundaryPolicyMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "GetPrincipalAccessBoundaryPolicy", + requestType = com.google.iam.v3.GetPrincipalAccessBoundaryPolicyRequest.class, + responseType = com.google.iam.v3.PrincipalAccessBoundaryPolicy.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.iam.v3.GetPrincipalAccessBoundaryPolicyRequest, + com.google.iam.v3.PrincipalAccessBoundaryPolicy> + getGetPrincipalAccessBoundaryPolicyMethod() { + io.grpc.MethodDescriptor< + com.google.iam.v3.GetPrincipalAccessBoundaryPolicyRequest, + com.google.iam.v3.PrincipalAccessBoundaryPolicy> + getGetPrincipalAccessBoundaryPolicyMethod; + if ((getGetPrincipalAccessBoundaryPolicyMethod = + PrincipalAccessBoundaryPoliciesGrpc.getGetPrincipalAccessBoundaryPolicyMethod) + == null) { + synchronized (PrincipalAccessBoundaryPoliciesGrpc.class) { + if ((getGetPrincipalAccessBoundaryPolicyMethod = + PrincipalAccessBoundaryPoliciesGrpc.getGetPrincipalAccessBoundaryPolicyMethod) + == null) { + PrincipalAccessBoundaryPoliciesGrpc.getGetPrincipalAccessBoundaryPolicyMethod = + getGetPrincipalAccessBoundaryPolicyMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName(SERVICE_NAME, "GetPrincipalAccessBoundaryPolicy")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.iam.v3.GetPrincipalAccessBoundaryPolicyRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.iam.v3.PrincipalAccessBoundaryPolicy.getDefaultInstance())) + .setSchemaDescriptor( + new PrincipalAccessBoundaryPoliciesMethodDescriptorSupplier( + "GetPrincipalAccessBoundaryPolicy")) + .build(); + } + } + } + return getGetPrincipalAccessBoundaryPolicyMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.iam.v3.UpdatePrincipalAccessBoundaryPolicyRequest, + com.google.longrunning.Operation> + getUpdatePrincipalAccessBoundaryPolicyMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "UpdatePrincipalAccessBoundaryPolicy", + requestType = com.google.iam.v3.UpdatePrincipalAccessBoundaryPolicyRequest.class, + responseType = com.google.longrunning.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.iam.v3.UpdatePrincipalAccessBoundaryPolicyRequest, + com.google.longrunning.Operation> + getUpdatePrincipalAccessBoundaryPolicyMethod() { + io.grpc.MethodDescriptor< + com.google.iam.v3.UpdatePrincipalAccessBoundaryPolicyRequest, + com.google.longrunning.Operation> + getUpdatePrincipalAccessBoundaryPolicyMethod; + if ((getUpdatePrincipalAccessBoundaryPolicyMethod = + PrincipalAccessBoundaryPoliciesGrpc.getUpdatePrincipalAccessBoundaryPolicyMethod) + == null) { + synchronized (PrincipalAccessBoundaryPoliciesGrpc.class) { + if ((getUpdatePrincipalAccessBoundaryPolicyMethod = + PrincipalAccessBoundaryPoliciesGrpc.getUpdatePrincipalAccessBoundaryPolicyMethod) + == null) { + PrincipalAccessBoundaryPoliciesGrpc.getUpdatePrincipalAccessBoundaryPolicyMethod = + getUpdatePrincipalAccessBoundaryPolicyMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName( + SERVICE_NAME, "UpdatePrincipalAccessBoundaryPolicy")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.iam.v3.UpdatePrincipalAccessBoundaryPolicyRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor( + new PrincipalAccessBoundaryPoliciesMethodDescriptorSupplier( + "UpdatePrincipalAccessBoundaryPolicy")) + .build(); + } + } + } + return getUpdatePrincipalAccessBoundaryPolicyMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.iam.v3.DeletePrincipalAccessBoundaryPolicyRequest, + com.google.longrunning.Operation> + getDeletePrincipalAccessBoundaryPolicyMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "DeletePrincipalAccessBoundaryPolicy", + requestType = com.google.iam.v3.DeletePrincipalAccessBoundaryPolicyRequest.class, + responseType = com.google.longrunning.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.iam.v3.DeletePrincipalAccessBoundaryPolicyRequest, + com.google.longrunning.Operation> + getDeletePrincipalAccessBoundaryPolicyMethod() { + io.grpc.MethodDescriptor< + com.google.iam.v3.DeletePrincipalAccessBoundaryPolicyRequest, + com.google.longrunning.Operation> + getDeletePrincipalAccessBoundaryPolicyMethod; + if ((getDeletePrincipalAccessBoundaryPolicyMethod = + PrincipalAccessBoundaryPoliciesGrpc.getDeletePrincipalAccessBoundaryPolicyMethod) + == null) { + synchronized (PrincipalAccessBoundaryPoliciesGrpc.class) { + if ((getDeletePrincipalAccessBoundaryPolicyMethod = + PrincipalAccessBoundaryPoliciesGrpc.getDeletePrincipalAccessBoundaryPolicyMethod) + == null) { + PrincipalAccessBoundaryPoliciesGrpc.getDeletePrincipalAccessBoundaryPolicyMethod = + getDeletePrincipalAccessBoundaryPolicyMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName( + SERVICE_NAME, "DeletePrincipalAccessBoundaryPolicy")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.iam.v3.DeletePrincipalAccessBoundaryPolicyRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor( + new PrincipalAccessBoundaryPoliciesMethodDescriptorSupplier( + "DeletePrincipalAccessBoundaryPolicy")) + .build(); + } + } + } + return getDeletePrincipalAccessBoundaryPolicyMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.iam.v3.ListPrincipalAccessBoundaryPoliciesRequest, + com.google.iam.v3.ListPrincipalAccessBoundaryPoliciesResponse> + getListPrincipalAccessBoundaryPoliciesMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "ListPrincipalAccessBoundaryPolicies", + requestType = com.google.iam.v3.ListPrincipalAccessBoundaryPoliciesRequest.class, + responseType = com.google.iam.v3.ListPrincipalAccessBoundaryPoliciesResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.iam.v3.ListPrincipalAccessBoundaryPoliciesRequest, + com.google.iam.v3.ListPrincipalAccessBoundaryPoliciesResponse> + getListPrincipalAccessBoundaryPoliciesMethod() { + io.grpc.MethodDescriptor< + com.google.iam.v3.ListPrincipalAccessBoundaryPoliciesRequest, + com.google.iam.v3.ListPrincipalAccessBoundaryPoliciesResponse> + getListPrincipalAccessBoundaryPoliciesMethod; + if ((getListPrincipalAccessBoundaryPoliciesMethod = + PrincipalAccessBoundaryPoliciesGrpc.getListPrincipalAccessBoundaryPoliciesMethod) + == null) { + synchronized (PrincipalAccessBoundaryPoliciesGrpc.class) { + if ((getListPrincipalAccessBoundaryPoliciesMethod = + PrincipalAccessBoundaryPoliciesGrpc.getListPrincipalAccessBoundaryPoliciesMethod) + == null) { + PrincipalAccessBoundaryPoliciesGrpc.getListPrincipalAccessBoundaryPoliciesMethod = + getListPrincipalAccessBoundaryPoliciesMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName( + SERVICE_NAME, "ListPrincipalAccessBoundaryPolicies")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.iam.v3.ListPrincipalAccessBoundaryPoliciesRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.iam.v3.ListPrincipalAccessBoundaryPoliciesResponse + .getDefaultInstance())) + .setSchemaDescriptor( + new PrincipalAccessBoundaryPoliciesMethodDescriptorSupplier( + "ListPrincipalAccessBoundaryPolicies")) + .build(); + } + } + } + return getListPrincipalAccessBoundaryPoliciesMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.iam.v3.SearchPrincipalAccessBoundaryPolicyBindingsRequest, + com.google.iam.v3.SearchPrincipalAccessBoundaryPolicyBindingsResponse> + getSearchPrincipalAccessBoundaryPolicyBindingsMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "SearchPrincipalAccessBoundaryPolicyBindings", + requestType = com.google.iam.v3.SearchPrincipalAccessBoundaryPolicyBindingsRequest.class, + responseType = com.google.iam.v3.SearchPrincipalAccessBoundaryPolicyBindingsResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.iam.v3.SearchPrincipalAccessBoundaryPolicyBindingsRequest, + com.google.iam.v3.SearchPrincipalAccessBoundaryPolicyBindingsResponse> + getSearchPrincipalAccessBoundaryPolicyBindingsMethod() { + io.grpc.MethodDescriptor< + com.google.iam.v3.SearchPrincipalAccessBoundaryPolicyBindingsRequest, + com.google.iam.v3.SearchPrincipalAccessBoundaryPolicyBindingsResponse> + getSearchPrincipalAccessBoundaryPolicyBindingsMethod; + if ((getSearchPrincipalAccessBoundaryPolicyBindingsMethod = + PrincipalAccessBoundaryPoliciesGrpc + .getSearchPrincipalAccessBoundaryPolicyBindingsMethod) + == null) { + synchronized (PrincipalAccessBoundaryPoliciesGrpc.class) { + if ((getSearchPrincipalAccessBoundaryPolicyBindingsMethod = + PrincipalAccessBoundaryPoliciesGrpc + .getSearchPrincipalAccessBoundaryPolicyBindingsMethod) + == null) { + PrincipalAccessBoundaryPoliciesGrpc.getSearchPrincipalAccessBoundaryPolicyBindingsMethod = + getSearchPrincipalAccessBoundaryPolicyBindingsMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName( + SERVICE_NAME, "SearchPrincipalAccessBoundaryPolicyBindings")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.iam.v3.SearchPrincipalAccessBoundaryPolicyBindingsRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.iam.v3.SearchPrincipalAccessBoundaryPolicyBindingsResponse + .getDefaultInstance())) + .setSchemaDescriptor( + new PrincipalAccessBoundaryPoliciesMethodDescriptorSupplier( + "SearchPrincipalAccessBoundaryPolicyBindings")) + .build(); + } + } + } + return getSearchPrincipalAccessBoundaryPolicyBindingsMethod; + } + + /** Creates a new async stub that supports all call types for the service */ + public static PrincipalAccessBoundaryPoliciesStub newStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public PrincipalAccessBoundaryPoliciesStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new PrincipalAccessBoundaryPoliciesStub(channel, callOptions); + } + }; + return PrincipalAccessBoundaryPoliciesStub.newStub(factory, channel); + } + + /** Creates a new blocking-style stub that supports all types of calls on the service */ + public static PrincipalAccessBoundaryPoliciesBlockingV2Stub newBlockingV2Stub( + io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public PrincipalAccessBoundaryPoliciesBlockingV2Stub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new PrincipalAccessBoundaryPoliciesBlockingV2Stub(channel, callOptions); + } + }; + return PrincipalAccessBoundaryPoliciesBlockingV2Stub.newStub(factory, channel); + } + + /** + * Creates a new blocking-style stub that supports unary and streaming output calls on the service + */ + public static PrincipalAccessBoundaryPoliciesBlockingStub newBlockingStub( + io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public PrincipalAccessBoundaryPoliciesBlockingStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new PrincipalAccessBoundaryPoliciesBlockingStub(channel, callOptions); + } + }; + return PrincipalAccessBoundaryPoliciesBlockingStub.newStub(factory, channel); + } + + /** Creates a new ListenableFuture-style stub that supports unary calls on the service */ + public static PrincipalAccessBoundaryPoliciesFutureStub newFutureStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public PrincipalAccessBoundaryPoliciesFutureStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new PrincipalAccessBoundaryPoliciesFutureStub(channel, callOptions); + } + }; + return PrincipalAccessBoundaryPoliciesFutureStub.newStub(factory, channel); + } + + /** + * + * + *
        +   * Manages Identity and Access Management (IAM) principal access boundary
        +   * policies.
        +   * 
        + */ + public interface AsyncService { + + /** + * + * + *
        +     * Creates a principal access boundary policy, and returns a long running
        +     * operation.
        +     * 
        + */ + default void createPrincipalAccessBoundaryPolicy( + com.google.iam.v3.CreatePrincipalAccessBoundaryPolicyRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getCreatePrincipalAccessBoundaryPolicyMethod(), responseObserver); + } + + /** + * + * + *
        +     * Gets a principal access boundary policy.
        +     * 
        + */ + default void getPrincipalAccessBoundaryPolicy( + com.google.iam.v3.GetPrincipalAccessBoundaryPolicyRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getGetPrincipalAccessBoundaryPolicyMethod(), responseObserver); + } + + /** + * + * + *
        +     * Updates a principal access boundary policy.
        +     * 
        + */ + default void updatePrincipalAccessBoundaryPolicy( + com.google.iam.v3.UpdatePrincipalAccessBoundaryPolicyRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getUpdatePrincipalAccessBoundaryPolicyMethod(), responseObserver); + } + + /** + * + * + *
        +     * Deletes a principal access boundary policy.
        +     * 
        + */ + default void deletePrincipalAccessBoundaryPolicy( + com.google.iam.v3.DeletePrincipalAccessBoundaryPolicyRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getDeletePrincipalAccessBoundaryPolicyMethod(), responseObserver); + } + + /** + * + * + *
        +     * Lists principal access boundary policies.
        +     * 
        + */ + default void listPrincipalAccessBoundaryPolicies( + com.google.iam.v3.ListPrincipalAccessBoundaryPoliciesRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getListPrincipalAccessBoundaryPoliciesMethod(), responseObserver); + } + + /** + * + * + *
        +     * Returns all policy bindings that bind a specific policy if a user has
        +     * searchPolicyBindings permission on that policy.
        +     * 
        + */ + default void searchPrincipalAccessBoundaryPolicyBindings( + com.google.iam.v3.SearchPrincipalAccessBoundaryPolicyBindingsRequest request, + io.grpc.stub.StreamObserver< + com.google.iam.v3.SearchPrincipalAccessBoundaryPolicyBindingsResponse> + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getSearchPrincipalAccessBoundaryPolicyBindingsMethod(), responseObserver); + } + } + + /** + * Base class for the server implementation of the service PrincipalAccessBoundaryPolicies. + * + *
        +   * Manages Identity and Access Management (IAM) principal access boundary
        +   * policies.
        +   * 
        + */ + public abstract static class PrincipalAccessBoundaryPoliciesImplBase + implements io.grpc.BindableService, AsyncService { + + @java.lang.Override + public final io.grpc.ServerServiceDefinition bindService() { + return PrincipalAccessBoundaryPoliciesGrpc.bindService(this); + } + } + + /** + * A stub to allow clients to do asynchronous rpc calls to service + * PrincipalAccessBoundaryPolicies. + * + *
        +   * Manages Identity and Access Management (IAM) principal access boundary
        +   * policies.
        +   * 
        + */ + public static final class PrincipalAccessBoundaryPoliciesStub + extends io.grpc.stub.AbstractAsyncStub { + private PrincipalAccessBoundaryPoliciesStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected PrincipalAccessBoundaryPoliciesStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new PrincipalAccessBoundaryPoliciesStub(channel, callOptions); + } + + /** + * + * + *
        +     * Creates a principal access boundary policy, and returns a long running
        +     * operation.
        +     * 
        + */ + public void createPrincipalAccessBoundaryPolicy( + com.google.iam.v3.CreatePrincipalAccessBoundaryPolicyRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getCreatePrincipalAccessBoundaryPolicyMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
        +     * Gets a principal access boundary policy.
        +     * 
        + */ + public void getPrincipalAccessBoundaryPolicy( + com.google.iam.v3.GetPrincipalAccessBoundaryPolicyRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getGetPrincipalAccessBoundaryPolicyMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
        +     * Updates a principal access boundary policy.
        +     * 
        + */ + public void updatePrincipalAccessBoundaryPolicy( + com.google.iam.v3.UpdatePrincipalAccessBoundaryPolicyRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getUpdatePrincipalAccessBoundaryPolicyMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
        +     * Deletes a principal access boundary policy.
        +     * 
        + */ + public void deletePrincipalAccessBoundaryPolicy( + com.google.iam.v3.DeletePrincipalAccessBoundaryPolicyRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getDeletePrincipalAccessBoundaryPolicyMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
        +     * Lists principal access boundary policies.
        +     * 
        + */ + public void listPrincipalAccessBoundaryPolicies( + com.google.iam.v3.ListPrincipalAccessBoundaryPoliciesRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getListPrincipalAccessBoundaryPoliciesMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
        +     * Returns all policy bindings that bind a specific policy if a user has
        +     * searchPolicyBindings permission on that policy.
        +     * 
        + */ + public void searchPrincipalAccessBoundaryPolicyBindings( + com.google.iam.v3.SearchPrincipalAccessBoundaryPolicyBindingsRequest request, + io.grpc.stub.StreamObserver< + com.google.iam.v3.SearchPrincipalAccessBoundaryPolicyBindingsResponse> + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel() + .newCall(getSearchPrincipalAccessBoundaryPolicyBindingsMethod(), getCallOptions()), + request, + responseObserver); + } + } + + /** + * A stub to allow clients to do synchronous rpc calls to service PrincipalAccessBoundaryPolicies. + * + *
        +   * Manages Identity and Access Management (IAM) principal access boundary
        +   * policies.
        +   * 
        + */ + public static final class PrincipalAccessBoundaryPoliciesBlockingV2Stub + extends io.grpc.stub.AbstractBlockingStub { + private PrincipalAccessBoundaryPoliciesBlockingV2Stub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected PrincipalAccessBoundaryPoliciesBlockingV2Stub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new PrincipalAccessBoundaryPoliciesBlockingV2Stub(channel, callOptions); + } + + /** + * + * + *
        +     * Creates a principal access boundary policy, and returns a long running
        +     * operation.
        +     * 
        + */ + public com.google.longrunning.Operation createPrincipalAccessBoundaryPolicy( + com.google.iam.v3.CreatePrincipalAccessBoundaryPolicyRequest request) + throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getCreatePrincipalAccessBoundaryPolicyMethod(), getCallOptions(), request); + } + + /** + * + * + *
        +     * Gets a principal access boundary policy.
        +     * 
        + */ + public com.google.iam.v3.PrincipalAccessBoundaryPolicy getPrincipalAccessBoundaryPolicy( + com.google.iam.v3.GetPrincipalAccessBoundaryPolicyRequest request) + throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getGetPrincipalAccessBoundaryPolicyMethod(), getCallOptions(), request); + } + + /** + * + * + *
        +     * Updates a principal access boundary policy.
        +     * 
        + */ + public com.google.longrunning.Operation updatePrincipalAccessBoundaryPolicy( + com.google.iam.v3.UpdatePrincipalAccessBoundaryPolicyRequest request) + throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getUpdatePrincipalAccessBoundaryPolicyMethod(), getCallOptions(), request); + } + + /** + * + * + *
        +     * Deletes a principal access boundary policy.
        +     * 
        + */ + public com.google.longrunning.Operation deletePrincipalAccessBoundaryPolicy( + com.google.iam.v3.DeletePrincipalAccessBoundaryPolicyRequest request) + throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getDeletePrincipalAccessBoundaryPolicyMethod(), getCallOptions(), request); + } + + /** + * + * + *
        +     * Lists principal access boundary policies.
        +     * 
        + */ + public com.google.iam.v3.ListPrincipalAccessBoundaryPoliciesResponse + listPrincipalAccessBoundaryPolicies( + com.google.iam.v3.ListPrincipalAccessBoundaryPoliciesRequest request) + throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getListPrincipalAccessBoundaryPoliciesMethod(), getCallOptions(), request); + } + + /** + * + * + *
        +     * Returns all policy bindings that bind a specific policy if a user has
        +     * searchPolicyBindings permission on that policy.
        +     * 
        + */ + public com.google.iam.v3.SearchPrincipalAccessBoundaryPolicyBindingsResponse + searchPrincipalAccessBoundaryPolicyBindings( + com.google.iam.v3.SearchPrincipalAccessBoundaryPolicyBindingsRequest request) + throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), + getSearchPrincipalAccessBoundaryPolicyBindingsMethod(), + getCallOptions(), + request); + } + } + + /** + * A stub to allow clients to do limited synchronous rpc calls to service + * PrincipalAccessBoundaryPolicies. + * + *
        +   * Manages Identity and Access Management (IAM) principal access boundary
        +   * policies.
        +   * 
        + */ + public static final class PrincipalAccessBoundaryPoliciesBlockingStub + extends io.grpc.stub.AbstractBlockingStub { + private PrincipalAccessBoundaryPoliciesBlockingStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected PrincipalAccessBoundaryPoliciesBlockingStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new PrincipalAccessBoundaryPoliciesBlockingStub(channel, callOptions); + } + + /** + * + * + *
        +     * Creates a principal access boundary policy, and returns a long running
        +     * operation.
        +     * 
        + */ + public com.google.longrunning.Operation createPrincipalAccessBoundaryPolicy( + com.google.iam.v3.CreatePrincipalAccessBoundaryPolicyRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getCreatePrincipalAccessBoundaryPolicyMethod(), getCallOptions(), request); + } + + /** + * + * + *
        +     * Gets a principal access boundary policy.
        +     * 
        + */ + public com.google.iam.v3.PrincipalAccessBoundaryPolicy getPrincipalAccessBoundaryPolicy( + com.google.iam.v3.GetPrincipalAccessBoundaryPolicyRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getGetPrincipalAccessBoundaryPolicyMethod(), getCallOptions(), request); + } + + /** + * + * + *
        +     * Updates a principal access boundary policy.
        +     * 
        + */ + public com.google.longrunning.Operation updatePrincipalAccessBoundaryPolicy( + com.google.iam.v3.UpdatePrincipalAccessBoundaryPolicyRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getUpdatePrincipalAccessBoundaryPolicyMethod(), getCallOptions(), request); + } + + /** + * + * + *
        +     * Deletes a principal access boundary policy.
        +     * 
        + */ + public com.google.longrunning.Operation deletePrincipalAccessBoundaryPolicy( + com.google.iam.v3.DeletePrincipalAccessBoundaryPolicyRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getDeletePrincipalAccessBoundaryPolicyMethod(), getCallOptions(), request); + } + + /** + * + * + *
        +     * Lists principal access boundary policies.
        +     * 
        + */ + public com.google.iam.v3.ListPrincipalAccessBoundaryPoliciesResponse + listPrincipalAccessBoundaryPolicies( + com.google.iam.v3.ListPrincipalAccessBoundaryPoliciesRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getListPrincipalAccessBoundaryPoliciesMethod(), getCallOptions(), request); + } + + /** + * + * + *
        +     * Returns all policy bindings that bind a specific policy if a user has
        +     * searchPolicyBindings permission on that policy.
        +     * 
        + */ + public com.google.iam.v3.SearchPrincipalAccessBoundaryPolicyBindingsResponse + searchPrincipalAccessBoundaryPolicyBindings( + com.google.iam.v3.SearchPrincipalAccessBoundaryPolicyBindingsRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), + getSearchPrincipalAccessBoundaryPolicyBindingsMethod(), + getCallOptions(), + request); + } + } + + /** + * A stub to allow clients to do ListenableFuture-style rpc calls to service + * PrincipalAccessBoundaryPolicies. + * + *
        +   * Manages Identity and Access Management (IAM) principal access boundary
        +   * policies.
        +   * 
        + */ + public static final class PrincipalAccessBoundaryPoliciesFutureStub + extends io.grpc.stub.AbstractFutureStub { + private PrincipalAccessBoundaryPoliciesFutureStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected PrincipalAccessBoundaryPoliciesFutureStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new PrincipalAccessBoundaryPoliciesFutureStub(channel, callOptions); + } + + /** + * + * + *
        +     * Creates a principal access boundary policy, and returns a long running
        +     * operation.
        +     * 
        + */ + public com.google.common.util.concurrent.ListenableFuture + createPrincipalAccessBoundaryPolicy( + com.google.iam.v3.CreatePrincipalAccessBoundaryPolicyRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getCreatePrincipalAccessBoundaryPolicyMethod(), getCallOptions()), + request); + } + + /** + * + * + *
        +     * Gets a principal access boundary policy.
        +     * 
        + */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.iam.v3.PrincipalAccessBoundaryPolicy> + getPrincipalAccessBoundaryPolicy( + com.google.iam.v3.GetPrincipalAccessBoundaryPolicyRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getGetPrincipalAccessBoundaryPolicyMethod(), getCallOptions()), + request); + } + + /** + * + * + *
        +     * Updates a principal access boundary policy.
        +     * 
        + */ + public com.google.common.util.concurrent.ListenableFuture + updatePrincipalAccessBoundaryPolicy( + com.google.iam.v3.UpdatePrincipalAccessBoundaryPolicyRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getUpdatePrincipalAccessBoundaryPolicyMethod(), getCallOptions()), + request); + } + + /** + * + * + *
        +     * Deletes a principal access boundary policy.
        +     * 
        + */ + public com.google.common.util.concurrent.ListenableFuture + deletePrincipalAccessBoundaryPolicy( + com.google.iam.v3.DeletePrincipalAccessBoundaryPolicyRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getDeletePrincipalAccessBoundaryPolicyMethod(), getCallOptions()), + request); + } + + /** + * + * + *
        +     * Lists principal access boundary policies.
        +     * 
        + */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.iam.v3.ListPrincipalAccessBoundaryPoliciesResponse> + listPrincipalAccessBoundaryPolicies( + com.google.iam.v3.ListPrincipalAccessBoundaryPoliciesRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getListPrincipalAccessBoundaryPoliciesMethod(), getCallOptions()), + request); + } + + /** + * + * + *
        +     * Returns all policy bindings that bind a specific policy if a user has
        +     * searchPolicyBindings permission on that policy.
        +     * 
        + */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.iam.v3.SearchPrincipalAccessBoundaryPolicyBindingsResponse> + searchPrincipalAccessBoundaryPolicyBindings( + com.google.iam.v3.SearchPrincipalAccessBoundaryPolicyBindingsRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel() + .newCall(getSearchPrincipalAccessBoundaryPolicyBindingsMethod(), getCallOptions()), + request); + } + } + + private static final int METHODID_CREATE_PRINCIPAL_ACCESS_BOUNDARY_POLICY = 0; + private static final int METHODID_GET_PRINCIPAL_ACCESS_BOUNDARY_POLICY = 1; + private static final int METHODID_UPDATE_PRINCIPAL_ACCESS_BOUNDARY_POLICY = 2; + private static final int METHODID_DELETE_PRINCIPAL_ACCESS_BOUNDARY_POLICY = 3; + private static final int METHODID_LIST_PRINCIPAL_ACCESS_BOUNDARY_POLICIES = 4; + private static final int METHODID_SEARCH_PRINCIPAL_ACCESS_BOUNDARY_POLICY_BINDINGS = 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_CREATE_PRINCIPAL_ACCESS_BOUNDARY_POLICY: + serviceImpl.createPrincipalAccessBoundaryPolicy( + (com.google.iam.v3.CreatePrincipalAccessBoundaryPolicyRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_GET_PRINCIPAL_ACCESS_BOUNDARY_POLICY: + serviceImpl.getPrincipalAccessBoundaryPolicy( + (com.google.iam.v3.GetPrincipalAccessBoundaryPolicyRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_UPDATE_PRINCIPAL_ACCESS_BOUNDARY_POLICY: + serviceImpl.updatePrincipalAccessBoundaryPolicy( + (com.google.iam.v3.UpdatePrincipalAccessBoundaryPolicyRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_DELETE_PRINCIPAL_ACCESS_BOUNDARY_POLICY: + serviceImpl.deletePrincipalAccessBoundaryPolicy( + (com.google.iam.v3.DeletePrincipalAccessBoundaryPolicyRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_LIST_PRINCIPAL_ACCESS_BOUNDARY_POLICIES: + serviceImpl.listPrincipalAccessBoundaryPolicies( + (com.google.iam.v3.ListPrincipalAccessBoundaryPoliciesRequest) request, + (io.grpc.stub.StreamObserver< + com.google.iam.v3.ListPrincipalAccessBoundaryPoliciesResponse>) + responseObserver); + break; + case METHODID_SEARCH_PRINCIPAL_ACCESS_BOUNDARY_POLICY_BINDINGS: + serviceImpl.searchPrincipalAccessBoundaryPolicyBindings( + (com.google.iam.v3.SearchPrincipalAccessBoundaryPolicyBindingsRequest) request, + (io.grpc.stub.StreamObserver< + com.google.iam.v3.SearchPrincipalAccessBoundaryPolicyBindingsResponse>) + 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( + getCreatePrincipalAccessBoundaryPolicyMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.iam.v3.CreatePrincipalAccessBoundaryPolicyRequest, + com.google.longrunning.Operation>( + service, METHODID_CREATE_PRINCIPAL_ACCESS_BOUNDARY_POLICY))) + .addMethod( + getGetPrincipalAccessBoundaryPolicyMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.iam.v3.GetPrincipalAccessBoundaryPolicyRequest, + com.google.iam.v3.PrincipalAccessBoundaryPolicy>( + service, METHODID_GET_PRINCIPAL_ACCESS_BOUNDARY_POLICY))) + .addMethod( + getUpdatePrincipalAccessBoundaryPolicyMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.iam.v3.UpdatePrincipalAccessBoundaryPolicyRequest, + com.google.longrunning.Operation>( + service, METHODID_UPDATE_PRINCIPAL_ACCESS_BOUNDARY_POLICY))) + .addMethod( + getDeletePrincipalAccessBoundaryPolicyMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.iam.v3.DeletePrincipalAccessBoundaryPolicyRequest, + com.google.longrunning.Operation>( + service, METHODID_DELETE_PRINCIPAL_ACCESS_BOUNDARY_POLICY))) + .addMethod( + getListPrincipalAccessBoundaryPoliciesMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.iam.v3.ListPrincipalAccessBoundaryPoliciesRequest, + com.google.iam.v3.ListPrincipalAccessBoundaryPoliciesResponse>( + service, METHODID_LIST_PRINCIPAL_ACCESS_BOUNDARY_POLICIES))) + .addMethod( + getSearchPrincipalAccessBoundaryPolicyBindingsMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.iam.v3.SearchPrincipalAccessBoundaryPolicyBindingsRequest, + com.google.iam.v3.SearchPrincipalAccessBoundaryPolicyBindingsResponse>( + service, METHODID_SEARCH_PRINCIPAL_ACCESS_BOUNDARY_POLICY_BINDINGS))) + .build(); + } + + private abstract static class PrincipalAccessBoundaryPoliciesBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoFileDescriptorSupplier, + io.grpc.protobuf.ProtoServiceDescriptorSupplier { + PrincipalAccessBoundaryPoliciesBaseDescriptorSupplier() {} + + @java.lang.Override + public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() { + return com.google.iam.v3.PrincipalAccessBoundaryPoliciesServiceProto.getDescriptor(); + } + + @java.lang.Override + public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() { + return getFileDescriptor().findServiceByName("PrincipalAccessBoundaryPolicies"); + } + } + + private static final class PrincipalAccessBoundaryPoliciesFileDescriptorSupplier + extends PrincipalAccessBoundaryPoliciesBaseDescriptorSupplier { + PrincipalAccessBoundaryPoliciesFileDescriptorSupplier() {} + } + + private static final class PrincipalAccessBoundaryPoliciesMethodDescriptorSupplier + extends PrincipalAccessBoundaryPoliciesBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoMethodDescriptorSupplier { + private final java.lang.String methodName; + + PrincipalAccessBoundaryPoliciesMethodDescriptorSupplier(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 (PrincipalAccessBoundaryPoliciesGrpc.class) { + result = serviceDescriptor; + if (result == null) { + serviceDescriptor = + result = + io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME) + .setSchemaDescriptor( + new PrincipalAccessBoundaryPoliciesFileDescriptorSupplier()) + .addMethod(getCreatePrincipalAccessBoundaryPolicyMethod()) + .addMethod(getGetPrincipalAccessBoundaryPolicyMethod()) + .addMethod(getUpdatePrincipalAccessBoundaryPolicyMethod()) + .addMethod(getDeletePrincipalAccessBoundaryPolicyMethod()) + .addMethod(getListPrincipalAccessBoundaryPoliciesMethod()) + .addMethod(getSearchPrincipalAccessBoundaryPolicyBindingsMethod()) + .build(); + } + } + } + return result; + } +} diff --git a/java-iam/grpc-google-iam-v3beta/pom.xml b/java-iam/grpc-google-iam-v3beta/pom.xml new file mode 100644 index 0000000000..06b00775b0 --- /dev/null +++ b/java-iam/grpc-google-iam-v3beta/pom.xml @@ -0,0 +1,45 @@ + + 4.0.0 + com.google.api.grpc + grpc-google-iam-v3beta + 1.62.1-SNAPSHOT + grpc-google-iam-v3beta + GRPC library for proto-google-iam-v3beta + + com.google.cloud + google-iam-parent + 1.62.1-SNAPSHOT + + + + io.grpc + grpc-api + + + io.grpc + grpc-stub + + + io.grpc + grpc-protobuf + + + com.google.protobuf + protobuf-java + + + com.google.api.grpc + proto-google-common-protos + + + com.google.api.grpc + proto-google-iam-v3beta + + + com.google.guava + guava + + + diff --git a/java-iam/grpc-google-iam-v3beta/src/main/java/com/google/iam/v3beta/PolicyBindingsGrpc.java b/java-iam/grpc-google-iam-v3beta/src/main/java/com/google/iam/v3beta/PolicyBindingsGrpc.java new file mode 100644 index 0000000000..9fde0cbfe7 --- /dev/null +++ b/java-iam/grpc-google-iam-v3beta/src/main/java/com/google/iam/v3beta/PolicyBindingsGrpc.java @@ -0,0 +1,1120 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.iam.v3beta; + +import static io.grpc.MethodDescriptor.generateFullMethodName; + +/** + * + * + *
        + * An interface for managing Identity and Access Management (IAM) policy
        + * bindings.
        + * 
        + */ +@io.grpc.stub.annotations.GrpcGenerated +public final class PolicyBindingsGrpc { + + private PolicyBindingsGrpc() {} + + public static final java.lang.String SERVICE_NAME = "google.iam.v3beta.PolicyBindings"; + + // Static method descriptors that strictly reflect the proto. + private static volatile io.grpc.MethodDescriptor< + com.google.iam.v3beta.CreatePolicyBindingRequest, com.google.longrunning.Operation> + getCreatePolicyBindingMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "CreatePolicyBinding", + requestType = com.google.iam.v3beta.CreatePolicyBindingRequest.class, + responseType = com.google.longrunning.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.iam.v3beta.CreatePolicyBindingRequest, com.google.longrunning.Operation> + getCreatePolicyBindingMethod() { + io.grpc.MethodDescriptor< + com.google.iam.v3beta.CreatePolicyBindingRequest, com.google.longrunning.Operation> + getCreatePolicyBindingMethod; + if ((getCreatePolicyBindingMethod = PolicyBindingsGrpc.getCreatePolicyBindingMethod) == null) { + synchronized (PolicyBindingsGrpc.class) { + if ((getCreatePolicyBindingMethod = PolicyBindingsGrpc.getCreatePolicyBindingMethod) + == null) { + PolicyBindingsGrpc.getCreatePolicyBindingMethod = + getCreatePolicyBindingMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName(SERVICE_NAME, "CreatePolicyBinding")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.iam.v3beta.CreatePolicyBindingRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor( + new PolicyBindingsMethodDescriptorSupplier("CreatePolicyBinding")) + .build(); + } + } + } + return getCreatePolicyBindingMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.iam.v3beta.GetPolicyBindingRequest, com.google.iam.v3beta.PolicyBinding> + getGetPolicyBindingMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "GetPolicyBinding", + requestType = com.google.iam.v3beta.GetPolicyBindingRequest.class, + responseType = com.google.iam.v3beta.PolicyBinding.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.iam.v3beta.GetPolicyBindingRequest, com.google.iam.v3beta.PolicyBinding> + getGetPolicyBindingMethod() { + io.grpc.MethodDescriptor< + com.google.iam.v3beta.GetPolicyBindingRequest, com.google.iam.v3beta.PolicyBinding> + getGetPolicyBindingMethod; + if ((getGetPolicyBindingMethod = PolicyBindingsGrpc.getGetPolicyBindingMethod) == null) { + synchronized (PolicyBindingsGrpc.class) { + if ((getGetPolicyBindingMethod = PolicyBindingsGrpc.getGetPolicyBindingMethod) == null) { + PolicyBindingsGrpc.getGetPolicyBindingMethod = + getGetPolicyBindingMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetPolicyBinding")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.iam.v3beta.GetPolicyBindingRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.iam.v3beta.PolicyBinding.getDefaultInstance())) + .setSchemaDescriptor( + new PolicyBindingsMethodDescriptorSupplier("GetPolicyBinding")) + .build(); + } + } + } + return getGetPolicyBindingMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.iam.v3beta.UpdatePolicyBindingRequest, com.google.longrunning.Operation> + getUpdatePolicyBindingMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "UpdatePolicyBinding", + requestType = com.google.iam.v3beta.UpdatePolicyBindingRequest.class, + responseType = com.google.longrunning.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.iam.v3beta.UpdatePolicyBindingRequest, com.google.longrunning.Operation> + getUpdatePolicyBindingMethod() { + io.grpc.MethodDescriptor< + com.google.iam.v3beta.UpdatePolicyBindingRequest, com.google.longrunning.Operation> + getUpdatePolicyBindingMethod; + if ((getUpdatePolicyBindingMethod = PolicyBindingsGrpc.getUpdatePolicyBindingMethod) == null) { + synchronized (PolicyBindingsGrpc.class) { + if ((getUpdatePolicyBindingMethod = PolicyBindingsGrpc.getUpdatePolicyBindingMethod) + == null) { + PolicyBindingsGrpc.getUpdatePolicyBindingMethod = + getUpdatePolicyBindingMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName(SERVICE_NAME, "UpdatePolicyBinding")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.iam.v3beta.UpdatePolicyBindingRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor( + new PolicyBindingsMethodDescriptorSupplier("UpdatePolicyBinding")) + .build(); + } + } + } + return getUpdatePolicyBindingMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.iam.v3beta.DeletePolicyBindingRequest, com.google.longrunning.Operation> + getDeletePolicyBindingMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "DeletePolicyBinding", + requestType = com.google.iam.v3beta.DeletePolicyBindingRequest.class, + responseType = com.google.longrunning.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.iam.v3beta.DeletePolicyBindingRequest, com.google.longrunning.Operation> + getDeletePolicyBindingMethod() { + io.grpc.MethodDescriptor< + com.google.iam.v3beta.DeletePolicyBindingRequest, com.google.longrunning.Operation> + getDeletePolicyBindingMethod; + if ((getDeletePolicyBindingMethod = PolicyBindingsGrpc.getDeletePolicyBindingMethod) == null) { + synchronized (PolicyBindingsGrpc.class) { + if ((getDeletePolicyBindingMethod = PolicyBindingsGrpc.getDeletePolicyBindingMethod) + == null) { + PolicyBindingsGrpc.getDeletePolicyBindingMethod = + getDeletePolicyBindingMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName(SERVICE_NAME, "DeletePolicyBinding")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.iam.v3beta.DeletePolicyBindingRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor( + new PolicyBindingsMethodDescriptorSupplier("DeletePolicyBinding")) + .build(); + } + } + } + return getDeletePolicyBindingMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.iam.v3beta.ListPolicyBindingsRequest, + com.google.iam.v3beta.ListPolicyBindingsResponse> + getListPolicyBindingsMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "ListPolicyBindings", + requestType = com.google.iam.v3beta.ListPolicyBindingsRequest.class, + responseType = com.google.iam.v3beta.ListPolicyBindingsResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.iam.v3beta.ListPolicyBindingsRequest, + com.google.iam.v3beta.ListPolicyBindingsResponse> + getListPolicyBindingsMethod() { + io.grpc.MethodDescriptor< + com.google.iam.v3beta.ListPolicyBindingsRequest, + com.google.iam.v3beta.ListPolicyBindingsResponse> + getListPolicyBindingsMethod; + if ((getListPolicyBindingsMethod = PolicyBindingsGrpc.getListPolicyBindingsMethod) == null) { + synchronized (PolicyBindingsGrpc.class) { + if ((getListPolicyBindingsMethod = PolicyBindingsGrpc.getListPolicyBindingsMethod) + == null) { + PolicyBindingsGrpc.getListPolicyBindingsMethod = + getListPolicyBindingsMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "ListPolicyBindings")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.iam.v3beta.ListPolicyBindingsRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.iam.v3beta.ListPolicyBindingsResponse + .getDefaultInstance())) + .setSchemaDescriptor( + new PolicyBindingsMethodDescriptorSupplier("ListPolicyBindings")) + .build(); + } + } + } + return getListPolicyBindingsMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.iam.v3beta.SearchTargetPolicyBindingsRequest, + com.google.iam.v3beta.SearchTargetPolicyBindingsResponse> + getSearchTargetPolicyBindingsMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "SearchTargetPolicyBindings", + requestType = com.google.iam.v3beta.SearchTargetPolicyBindingsRequest.class, + responseType = com.google.iam.v3beta.SearchTargetPolicyBindingsResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.iam.v3beta.SearchTargetPolicyBindingsRequest, + com.google.iam.v3beta.SearchTargetPolicyBindingsResponse> + getSearchTargetPolicyBindingsMethod() { + io.grpc.MethodDescriptor< + com.google.iam.v3beta.SearchTargetPolicyBindingsRequest, + com.google.iam.v3beta.SearchTargetPolicyBindingsResponse> + getSearchTargetPolicyBindingsMethod; + if ((getSearchTargetPolicyBindingsMethod = + PolicyBindingsGrpc.getSearchTargetPolicyBindingsMethod) + == null) { + synchronized (PolicyBindingsGrpc.class) { + if ((getSearchTargetPolicyBindingsMethod = + PolicyBindingsGrpc.getSearchTargetPolicyBindingsMethod) + == null) { + PolicyBindingsGrpc.getSearchTargetPolicyBindingsMethod = + getSearchTargetPolicyBindingsMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName(SERVICE_NAME, "SearchTargetPolicyBindings")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.iam.v3beta.SearchTargetPolicyBindingsRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.iam.v3beta.SearchTargetPolicyBindingsResponse + .getDefaultInstance())) + .setSchemaDescriptor( + new PolicyBindingsMethodDescriptorSupplier("SearchTargetPolicyBindings")) + .build(); + } + } + } + return getSearchTargetPolicyBindingsMethod; + } + + /** Creates a new async stub that supports all call types for the service */ + public static PolicyBindingsStub newStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public PolicyBindingsStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new PolicyBindingsStub(channel, callOptions); + } + }; + return PolicyBindingsStub.newStub(factory, channel); + } + + /** Creates a new blocking-style stub that supports all types of calls on the service */ + public static PolicyBindingsBlockingV2Stub newBlockingV2Stub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public PolicyBindingsBlockingV2Stub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new PolicyBindingsBlockingV2Stub(channel, callOptions); + } + }; + return PolicyBindingsBlockingV2Stub.newStub(factory, channel); + } + + /** + * Creates a new blocking-style stub that supports unary and streaming output calls on the service + */ + public static PolicyBindingsBlockingStub newBlockingStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public PolicyBindingsBlockingStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new PolicyBindingsBlockingStub(channel, callOptions); + } + }; + return PolicyBindingsBlockingStub.newStub(factory, channel); + } + + /** Creates a new ListenableFuture-style stub that supports unary calls on the service */ + public static PolicyBindingsFutureStub newFutureStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public PolicyBindingsFutureStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new PolicyBindingsFutureStub(channel, callOptions); + } + }; + return PolicyBindingsFutureStub.newStub(factory, channel); + } + + /** + * + * + *
        +   * An interface for managing Identity and Access Management (IAM) policy
        +   * bindings.
        +   * 
        + */ + public interface AsyncService { + + /** + * + * + *
        +     * Creates a policy binding and returns a long-running operation.
        +     * Callers will need the IAM permissions on both the policy and target.
        +     * Once the binding is created, the policy is applied to the target.
        +     * 
        + */ + default void createPolicyBinding( + com.google.iam.v3beta.CreatePolicyBindingRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getCreatePolicyBindingMethod(), responseObserver); + } + + /** + * + * + *
        +     * Gets a policy binding.
        +     * 
        + */ + default void getPolicyBinding( + com.google.iam.v3beta.GetPolicyBindingRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getGetPolicyBindingMethod(), responseObserver); + } + + /** + * + * + *
        +     * Updates a policy binding and returns a long-running operation.
        +     * Callers will need the IAM permissions on the policy and target in the
        +     * binding to update, and the IAM permission to remove the existing policy
        +     * from the binding. Target is immutable and cannot be updated. Once the
        +     * binding is updated, the new policy is applied to the target.
        +     * 
        + */ + default void updatePolicyBinding( + com.google.iam.v3beta.UpdatePolicyBindingRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getUpdatePolicyBindingMethod(), responseObserver); + } + + /** + * + * + *
        +     * Deletes a policy binding and returns a long-running operation.
        +     * Callers will need the IAM permissions on both the policy and target.
        +     * Once the binding is deleted, the policy no longer applies to the target.
        +     * 
        + */ + default void deletePolicyBinding( + com.google.iam.v3beta.DeletePolicyBindingRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getDeletePolicyBindingMethod(), responseObserver); + } + + /** + * + * + *
        +     * Lists policy bindings.
        +     * 
        + */ + default void listPolicyBindings( + com.google.iam.v3beta.ListPolicyBindingsRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getListPolicyBindingsMethod(), responseObserver); + } + + /** + * + * + *
        +     * Search policy bindings by target. Returns all policy binding objects bound
        +     * directly to target.
        +     * 
        + */ + default void searchTargetPolicyBindings( + com.google.iam.v3beta.SearchTargetPolicyBindingsRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getSearchTargetPolicyBindingsMethod(), responseObserver); + } + } + + /** + * Base class for the server implementation of the service PolicyBindings. + * + *
        +   * An interface for managing Identity and Access Management (IAM) policy
        +   * bindings.
        +   * 
        + */ + public abstract static class PolicyBindingsImplBase + implements io.grpc.BindableService, AsyncService { + + @java.lang.Override + public final io.grpc.ServerServiceDefinition bindService() { + return PolicyBindingsGrpc.bindService(this); + } + } + + /** + * A stub to allow clients to do asynchronous rpc calls to service PolicyBindings. + * + *
        +   * An interface for managing Identity and Access Management (IAM) policy
        +   * bindings.
        +   * 
        + */ + public static final class PolicyBindingsStub + extends io.grpc.stub.AbstractAsyncStub { + private PolicyBindingsStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected PolicyBindingsStub build(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new PolicyBindingsStub(channel, callOptions); + } + + /** + * + * + *
        +     * Creates a policy binding and returns a long-running operation.
        +     * Callers will need the IAM permissions on both the policy and target.
        +     * Once the binding is created, the policy is applied to the target.
        +     * 
        + */ + public void createPolicyBinding( + com.google.iam.v3beta.CreatePolicyBindingRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getCreatePolicyBindingMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
        +     * Gets a policy binding.
        +     * 
        + */ + public void getPolicyBinding( + com.google.iam.v3beta.GetPolicyBindingRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getGetPolicyBindingMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
        +     * Updates a policy binding and returns a long-running operation.
        +     * Callers will need the IAM permissions on the policy and target in the
        +     * binding to update, and the IAM permission to remove the existing policy
        +     * from the binding. Target is immutable and cannot be updated. Once the
        +     * binding is updated, the new policy is applied to the target.
        +     * 
        + */ + public void updatePolicyBinding( + com.google.iam.v3beta.UpdatePolicyBindingRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getUpdatePolicyBindingMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
        +     * Deletes a policy binding and returns a long-running operation.
        +     * Callers will need the IAM permissions on both the policy and target.
        +     * Once the binding is deleted, the policy no longer applies to the target.
        +     * 
        + */ + public void deletePolicyBinding( + com.google.iam.v3beta.DeletePolicyBindingRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getDeletePolicyBindingMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
        +     * Lists policy bindings.
        +     * 
        + */ + public void listPolicyBindings( + com.google.iam.v3beta.ListPolicyBindingsRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getListPolicyBindingsMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
        +     * Search policy bindings by target. Returns all policy binding objects bound
        +     * directly to target.
        +     * 
        + */ + public void searchTargetPolicyBindings( + com.google.iam.v3beta.SearchTargetPolicyBindingsRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getSearchTargetPolicyBindingsMethod(), getCallOptions()), + request, + responseObserver); + } + } + + /** + * A stub to allow clients to do synchronous rpc calls to service PolicyBindings. + * + *
        +   * An interface for managing Identity and Access Management (IAM) policy
        +   * bindings.
        +   * 
        + */ + public static final class PolicyBindingsBlockingV2Stub + extends io.grpc.stub.AbstractBlockingStub { + private PolicyBindingsBlockingV2Stub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected PolicyBindingsBlockingV2Stub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new PolicyBindingsBlockingV2Stub(channel, callOptions); + } + + /** + * + * + *
        +     * Creates a policy binding and returns a long-running operation.
        +     * Callers will need the IAM permissions on both the policy and target.
        +     * Once the binding is created, the policy is applied to the target.
        +     * 
        + */ + public com.google.longrunning.Operation createPolicyBinding( + com.google.iam.v3beta.CreatePolicyBindingRequest request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getCreatePolicyBindingMethod(), getCallOptions(), request); + } + + /** + * + * + *
        +     * Gets a policy binding.
        +     * 
        + */ + public com.google.iam.v3beta.PolicyBinding getPolicyBinding( + com.google.iam.v3beta.GetPolicyBindingRequest request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getGetPolicyBindingMethod(), getCallOptions(), request); + } + + /** + * + * + *
        +     * Updates a policy binding and returns a long-running operation.
        +     * Callers will need the IAM permissions on the policy and target in the
        +     * binding to update, and the IAM permission to remove the existing policy
        +     * from the binding. Target is immutable and cannot be updated. Once the
        +     * binding is updated, the new policy is applied to the target.
        +     * 
        + */ + public com.google.longrunning.Operation updatePolicyBinding( + com.google.iam.v3beta.UpdatePolicyBindingRequest request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getUpdatePolicyBindingMethod(), getCallOptions(), request); + } + + /** + * + * + *
        +     * Deletes a policy binding and returns a long-running operation.
        +     * Callers will need the IAM permissions on both the policy and target.
        +     * Once the binding is deleted, the policy no longer applies to the target.
        +     * 
        + */ + public com.google.longrunning.Operation deletePolicyBinding( + com.google.iam.v3beta.DeletePolicyBindingRequest request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getDeletePolicyBindingMethod(), getCallOptions(), request); + } + + /** + * + * + *
        +     * Lists policy bindings.
        +     * 
        + */ + public com.google.iam.v3beta.ListPolicyBindingsResponse listPolicyBindings( + com.google.iam.v3beta.ListPolicyBindingsRequest request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getListPolicyBindingsMethod(), getCallOptions(), request); + } + + /** + * + * + *
        +     * Search policy bindings by target. Returns all policy binding objects bound
        +     * directly to target.
        +     * 
        + */ + public com.google.iam.v3beta.SearchTargetPolicyBindingsResponse searchTargetPolicyBindings( + com.google.iam.v3beta.SearchTargetPolicyBindingsRequest request) + throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getSearchTargetPolicyBindingsMethod(), getCallOptions(), request); + } + } + + /** + * A stub to allow clients to do limited synchronous rpc calls to service PolicyBindings. + * + *
        +   * An interface for managing Identity and Access Management (IAM) policy
        +   * bindings.
        +   * 
        + */ + public static final class PolicyBindingsBlockingStub + extends io.grpc.stub.AbstractBlockingStub { + private PolicyBindingsBlockingStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected PolicyBindingsBlockingStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new PolicyBindingsBlockingStub(channel, callOptions); + } + + /** + * + * + *
        +     * Creates a policy binding and returns a long-running operation.
        +     * Callers will need the IAM permissions on both the policy and target.
        +     * Once the binding is created, the policy is applied to the target.
        +     * 
        + */ + public com.google.longrunning.Operation createPolicyBinding( + com.google.iam.v3beta.CreatePolicyBindingRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getCreatePolicyBindingMethod(), getCallOptions(), request); + } + + /** + * + * + *
        +     * Gets a policy binding.
        +     * 
        + */ + public com.google.iam.v3beta.PolicyBinding getPolicyBinding( + com.google.iam.v3beta.GetPolicyBindingRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getGetPolicyBindingMethod(), getCallOptions(), request); + } + + /** + * + * + *
        +     * Updates a policy binding and returns a long-running operation.
        +     * Callers will need the IAM permissions on the policy and target in the
        +     * binding to update, and the IAM permission to remove the existing policy
        +     * from the binding. Target is immutable and cannot be updated. Once the
        +     * binding is updated, the new policy is applied to the target.
        +     * 
        + */ + public com.google.longrunning.Operation updatePolicyBinding( + com.google.iam.v3beta.UpdatePolicyBindingRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getUpdatePolicyBindingMethod(), getCallOptions(), request); + } + + /** + * + * + *
        +     * Deletes a policy binding and returns a long-running operation.
        +     * Callers will need the IAM permissions on both the policy and target.
        +     * Once the binding is deleted, the policy no longer applies to the target.
        +     * 
        + */ + public com.google.longrunning.Operation deletePolicyBinding( + com.google.iam.v3beta.DeletePolicyBindingRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getDeletePolicyBindingMethod(), getCallOptions(), request); + } + + /** + * + * + *
        +     * Lists policy bindings.
        +     * 
        + */ + public com.google.iam.v3beta.ListPolicyBindingsResponse listPolicyBindings( + com.google.iam.v3beta.ListPolicyBindingsRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getListPolicyBindingsMethod(), getCallOptions(), request); + } + + /** + * + * + *
        +     * Search policy bindings by target. Returns all policy binding objects bound
        +     * directly to target.
        +     * 
        + */ + public com.google.iam.v3beta.SearchTargetPolicyBindingsResponse searchTargetPolicyBindings( + com.google.iam.v3beta.SearchTargetPolicyBindingsRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getSearchTargetPolicyBindingsMethod(), getCallOptions(), request); + } + } + + /** + * A stub to allow clients to do ListenableFuture-style rpc calls to service PolicyBindings. + * + *
        +   * An interface for managing Identity and Access Management (IAM) policy
        +   * bindings.
        +   * 
        + */ + public static final class PolicyBindingsFutureStub + extends io.grpc.stub.AbstractFutureStub { + private PolicyBindingsFutureStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected PolicyBindingsFutureStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new PolicyBindingsFutureStub(channel, callOptions); + } + + /** + * + * + *
        +     * Creates a policy binding and returns a long-running operation.
        +     * Callers will need the IAM permissions on both the policy and target.
        +     * Once the binding is created, the policy is applied to the target.
        +     * 
        + */ + public com.google.common.util.concurrent.ListenableFuture + createPolicyBinding(com.google.iam.v3beta.CreatePolicyBindingRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getCreatePolicyBindingMethod(), getCallOptions()), request); + } + + /** + * + * + *
        +     * Gets a policy binding.
        +     * 
        + */ + public com.google.common.util.concurrent.ListenableFuture + getPolicyBinding(com.google.iam.v3beta.GetPolicyBindingRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getGetPolicyBindingMethod(), getCallOptions()), request); + } + + /** + * + * + *
        +     * Updates a policy binding and returns a long-running operation.
        +     * Callers will need the IAM permissions on the policy and target in the
        +     * binding to update, and the IAM permission to remove the existing policy
        +     * from the binding. Target is immutable and cannot be updated. Once the
        +     * binding is updated, the new policy is applied to the target.
        +     * 
        + */ + public com.google.common.util.concurrent.ListenableFuture + updatePolicyBinding(com.google.iam.v3beta.UpdatePolicyBindingRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getUpdatePolicyBindingMethod(), getCallOptions()), request); + } + + /** + * + * + *
        +     * Deletes a policy binding and returns a long-running operation.
        +     * Callers will need the IAM permissions on both the policy and target.
        +     * Once the binding is deleted, the policy no longer applies to the target.
        +     * 
        + */ + public com.google.common.util.concurrent.ListenableFuture + deletePolicyBinding(com.google.iam.v3beta.DeletePolicyBindingRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getDeletePolicyBindingMethod(), getCallOptions()), request); + } + + /** + * + * + *
        +     * Lists policy bindings.
        +     * 
        + */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.iam.v3beta.ListPolicyBindingsResponse> + listPolicyBindings(com.google.iam.v3beta.ListPolicyBindingsRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getListPolicyBindingsMethod(), getCallOptions()), request); + } + + /** + * + * + *
        +     * Search policy bindings by target. Returns all policy binding objects bound
        +     * directly to target.
        +     * 
        + */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.iam.v3beta.SearchTargetPolicyBindingsResponse> + searchTargetPolicyBindings( + com.google.iam.v3beta.SearchTargetPolicyBindingsRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getSearchTargetPolicyBindingsMethod(), getCallOptions()), request); + } + } + + private static final int METHODID_CREATE_POLICY_BINDING = 0; + private static final int METHODID_GET_POLICY_BINDING = 1; + private static final int METHODID_UPDATE_POLICY_BINDING = 2; + private static final int METHODID_DELETE_POLICY_BINDING = 3; + private static final int METHODID_LIST_POLICY_BINDINGS = 4; + private static final int METHODID_SEARCH_TARGET_POLICY_BINDINGS = 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_CREATE_POLICY_BINDING: + serviceImpl.createPolicyBinding( + (com.google.iam.v3beta.CreatePolicyBindingRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_GET_POLICY_BINDING: + serviceImpl.getPolicyBinding( + (com.google.iam.v3beta.GetPolicyBindingRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_UPDATE_POLICY_BINDING: + serviceImpl.updatePolicyBinding( + (com.google.iam.v3beta.UpdatePolicyBindingRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_DELETE_POLICY_BINDING: + serviceImpl.deletePolicyBinding( + (com.google.iam.v3beta.DeletePolicyBindingRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_LIST_POLICY_BINDINGS: + serviceImpl.listPolicyBindings( + (com.google.iam.v3beta.ListPolicyBindingsRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_SEARCH_TARGET_POLICY_BINDINGS: + serviceImpl.searchTargetPolicyBindings( + (com.google.iam.v3beta.SearchTargetPolicyBindingsRequest) request, + (io.grpc.stub.StreamObserver< + com.google.iam.v3beta.SearchTargetPolicyBindingsResponse>) + 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( + getCreatePolicyBindingMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.iam.v3beta.CreatePolicyBindingRequest, + com.google.longrunning.Operation>(service, METHODID_CREATE_POLICY_BINDING))) + .addMethod( + getGetPolicyBindingMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.iam.v3beta.GetPolicyBindingRequest, + com.google.iam.v3beta.PolicyBinding>(service, METHODID_GET_POLICY_BINDING))) + .addMethod( + getUpdatePolicyBindingMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.iam.v3beta.UpdatePolicyBindingRequest, + com.google.longrunning.Operation>(service, METHODID_UPDATE_POLICY_BINDING))) + .addMethod( + getDeletePolicyBindingMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.iam.v3beta.DeletePolicyBindingRequest, + com.google.longrunning.Operation>(service, METHODID_DELETE_POLICY_BINDING))) + .addMethod( + getListPolicyBindingsMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.iam.v3beta.ListPolicyBindingsRequest, + com.google.iam.v3beta.ListPolicyBindingsResponse>( + service, METHODID_LIST_POLICY_BINDINGS))) + .addMethod( + getSearchTargetPolicyBindingsMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.iam.v3beta.SearchTargetPolicyBindingsRequest, + com.google.iam.v3beta.SearchTargetPolicyBindingsResponse>( + service, METHODID_SEARCH_TARGET_POLICY_BINDINGS))) + .build(); + } + + private abstract static class PolicyBindingsBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoFileDescriptorSupplier, + io.grpc.protobuf.ProtoServiceDescriptorSupplier { + PolicyBindingsBaseDescriptorSupplier() {} + + @java.lang.Override + public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() { + return com.google.iam.v3beta.PolicyBindingsServiceProto.getDescriptor(); + } + + @java.lang.Override + public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() { + return getFileDescriptor().findServiceByName("PolicyBindings"); + } + } + + private static final class PolicyBindingsFileDescriptorSupplier + extends PolicyBindingsBaseDescriptorSupplier { + PolicyBindingsFileDescriptorSupplier() {} + } + + private static final class PolicyBindingsMethodDescriptorSupplier + extends PolicyBindingsBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoMethodDescriptorSupplier { + private final java.lang.String methodName; + + PolicyBindingsMethodDescriptorSupplier(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 (PolicyBindingsGrpc.class) { + result = serviceDescriptor; + if (result == null) { + serviceDescriptor = + result = + io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME) + .setSchemaDescriptor(new PolicyBindingsFileDescriptorSupplier()) + .addMethod(getCreatePolicyBindingMethod()) + .addMethod(getGetPolicyBindingMethod()) + .addMethod(getUpdatePolicyBindingMethod()) + .addMethod(getDeletePolicyBindingMethod()) + .addMethod(getListPolicyBindingsMethod()) + .addMethod(getSearchTargetPolicyBindingsMethod()) + .build(); + } + } + } + return result; + } +} diff --git a/java-iam/grpc-google-iam-v3beta/src/main/java/com/google/iam/v3beta/PrincipalAccessBoundaryPoliciesGrpc.java b/java-iam/grpc-google-iam-v3beta/src/main/java/com/google/iam/v3beta/PrincipalAccessBoundaryPoliciesGrpc.java new file mode 100644 index 0000000000..0337ba81a7 --- /dev/null +++ b/java-iam/grpc-google-iam-v3beta/src/main/java/com/google/iam/v3beta/PrincipalAccessBoundaryPoliciesGrpc.java @@ -0,0 +1,1187 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.iam.v3beta; + +import static io.grpc.MethodDescriptor.generateFullMethodName; + +/** + * + * + *
        + * Manages Identity and Access Management (IAM) principal access boundary
        + * policies.
        + * 
        + */ +@io.grpc.stub.annotations.GrpcGenerated +public final class PrincipalAccessBoundaryPoliciesGrpc { + + private PrincipalAccessBoundaryPoliciesGrpc() {} + + public static final java.lang.String SERVICE_NAME = + "google.iam.v3beta.PrincipalAccessBoundaryPolicies"; + + // Static method descriptors that strictly reflect the proto. + private static volatile io.grpc.MethodDescriptor< + com.google.iam.v3beta.CreatePrincipalAccessBoundaryPolicyRequest, + com.google.longrunning.Operation> + getCreatePrincipalAccessBoundaryPolicyMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "CreatePrincipalAccessBoundaryPolicy", + requestType = com.google.iam.v3beta.CreatePrincipalAccessBoundaryPolicyRequest.class, + responseType = com.google.longrunning.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.iam.v3beta.CreatePrincipalAccessBoundaryPolicyRequest, + com.google.longrunning.Operation> + getCreatePrincipalAccessBoundaryPolicyMethod() { + io.grpc.MethodDescriptor< + com.google.iam.v3beta.CreatePrincipalAccessBoundaryPolicyRequest, + com.google.longrunning.Operation> + getCreatePrincipalAccessBoundaryPolicyMethod; + if ((getCreatePrincipalAccessBoundaryPolicyMethod = + PrincipalAccessBoundaryPoliciesGrpc.getCreatePrincipalAccessBoundaryPolicyMethod) + == null) { + synchronized (PrincipalAccessBoundaryPoliciesGrpc.class) { + if ((getCreatePrincipalAccessBoundaryPolicyMethod = + PrincipalAccessBoundaryPoliciesGrpc.getCreatePrincipalAccessBoundaryPolicyMethod) + == null) { + PrincipalAccessBoundaryPoliciesGrpc.getCreatePrincipalAccessBoundaryPolicyMethod = + getCreatePrincipalAccessBoundaryPolicyMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName( + SERVICE_NAME, "CreatePrincipalAccessBoundaryPolicy")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.iam.v3beta.CreatePrincipalAccessBoundaryPolicyRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor( + new PrincipalAccessBoundaryPoliciesMethodDescriptorSupplier( + "CreatePrincipalAccessBoundaryPolicy")) + .build(); + } + } + } + return getCreatePrincipalAccessBoundaryPolicyMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.iam.v3beta.GetPrincipalAccessBoundaryPolicyRequest, + com.google.iam.v3beta.PrincipalAccessBoundaryPolicy> + getGetPrincipalAccessBoundaryPolicyMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "GetPrincipalAccessBoundaryPolicy", + requestType = com.google.iam.v3beta.GetPrincipalAccessBoundaryPolicyRequest.class, + responseType = com.google.iam.v3beta.PrincipalAccessBoundaryPolicy.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.iam.v3beta.GetPrincipalAccessBoundaryPolicyRequest, + com.google.iam.v3beta.PrincipalAccessBoundaryPolicy> + getGetPrincipalAccessBoundaryPolicyMethod() { + io.grpc.MethodDescriptor< + com.google.iam.v3beta.GetPrincipalAccessBoundaryPolicyRequest, + com.google.iam.v3beta.PrincipalAccessBoundaryPolicy> + getGetPrincipalAccessBoundaryPolicyMethod; + if ((getGetPrincipalAccessBoundaryPolicyMethod = + PrincipalAccessBoundaryPoliciesGrpc.getGetPrincipalAccessBoundaryPolicyMethod) + == null) { + synchronized (PrincipalAccessBoundaryPoliciesGrpc.class) { + if ((getGetPrincipalAccessBoundaryPolicyMethod = + PrincipalAccessBoundaryPoliciesGrpc.getGetPrincipalAccessBoundaryPolicyMethod) + == null) { + PrincipalAccessBoundaryPoliciesGrpc.getGetPrincipalAccessBoundaryPolicyMethod = + getGetPrincipalAccessBoundaryPolicyMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName(SERVICE_NAME, "GetPrincipalAccessBoundaryPolicy")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.iam.v3beta.GetPrincipalAccessBoundaryPolicyRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.iam.v3beta.PrincipalAccessBoundaryPolicy + .getDefaultInstance())) + .setSchemaDescriptor( + new PrincipalAccessBoundaryPoliciesMethodDescriptorSupplier( + "GetPrincipalAccessBoundaryPolicy")) + .build(); + } + } + } + return getGetPrincipalAccessBoundaryPolicyMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.iam.v3beta.UpdatePrincipalAccessBoundaryPolicyRequest, + com.google.longrunning.Operation> + getUpdatePrincipalAccessBoundaryPolicyMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "UpdatePrincipalAccessBoundaryPolicy", + requestType = com.google.iam.v3beta.UpdatePrincipalAccessBoundaryPolicyRequest.class, + responseType = com.google.longrunning.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.iam.v3beta.UpdatePrincipalAccessBoundaryPolicyRequest, + com.google.longrunning.Operation> + getUpdatePrincipalAccessBoundaryPolicyMethod() { + io.grpc.MethodDescriptor< + com.google.iam.v3beta.UpdatePrincipalAccessBoundaryPolicyRequest, + com.google.longrunning.Operation> + getUpdatePrincipalAccessBoundaryPolicyMethod; + if ((getUpdatePrincipalAccessBoundaryPolicyMethod = + PrincipalAccessBoundaryPoliciesGrpc.getUpdatePrincipalAccessBoundaryPolicyMethod) + == null) { + synchronized (PrincipalAccessBoundaryPoliciesGrpc.class) { + if ((getUpdatePrincipalAccessBoundaryPolicyMethod = + PrincipalAccessBoundaryPoliciesGrpc.getUpdatePrincipalAccessBoundaryPolicyMethod) + == null) { + PrincipalAccessBoundaryPoliciesGrpc.getUpdatePrincipalAccessBoundaryPolicyMethod = + getUpdatePrincipalAccessBoundaryPolicyMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName( + SERVICE_NAME, "UpdatePrincipalAccessBoundaryPolicy")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.iam.v3beta.UpdatePrincipalAccessBoundaryPolicyRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor( + new PrincipalAccessBoundaryPoliciesMethodDescriptorSupplier( + "UpdatePrincipalAccessBoundaryPolicy")) + .build(); + } + } + } + return getUpdatePrincipalAccessBoundaryPolicyMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.iam.v3beta.DeletePrincipalAccessBoundaryPolicyRequest, + com.google.longrunning.Operation> + getDeletePrincipalAccessBoundaryPolicyMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "DeletePrincipalAccessBoundaryPolicy", + requestType = com.google.iam.v3beta.DeletePrincipalAccessBoundaryPolicyRequest.class, + responseType = com.google.longrunning.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.iam.v3beta.DeletePrincipalAccessBoundaryPolicyRequest, + com.google.longrunning.Operation> + getDeletePrincipalAccessBoundaryPolicyMethod() { + io.grpc.MethodDescriptor< + com.google.iam.v3beta.DeletePrincipalAccessBoundaryPolicyRequest, + com.google.longrunning.Operation> + getDeletePrincipalAccessBoundaryPolicyMethod; + if ((getDeletePrincipalAccessBoundaryPolicyMethod = + PrincipalAccessBoundaryPoliciesGrpc.getDeletePrincipalAccessBoundaryPolicyMethod) + == null) { + synchronized (PrincipalAccessBoundaryPoliciesGrpc.class) { + if ((getDeletePrincipalAccessBoundaryPolicyMethod = + PrincipalAccessBoundaryPoliciesGrpc.getDeletePrincipalAccessBoundaryPolicyMethod) + == null) { + PrincipalAccessBoundaryPoliciesGrpc.getDeletePrincipalAccessBoundaryPolicyMethod = + getDeletePrincipalAccessBoundaryPolicyMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName( + SERVICE_NAME, "DeletePrincipalAccessBoundaryPolicy")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.iam.v3beta.DeletePrincipalAccessBoundaryPolicyRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor( + new PrincipalAccessBoundaryPoliciesMethodDescriptorSupplier( + "DeletePrincipalAccessBoundaryPolicy")) + .build(); + } + } + } + return getDeletePrincipalAccessBoundaryPolicyMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.iam.v3beta.ListPrincipalAccessBoundaryPoliciesRequest, + com.google.iam.v3beta.ListPrincipalAccessBoundaryPoliciesResponse> + getListPrincipalAccessBoundaryPoliciesMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "ListPrincipalAccessBoundaryPolicies", + requestType = com.google.iam.v3beta.ListPrincipalAccessBoundaryPoliciesRequest.class, + responseType = com.google.iam.v3beta.ListPrincipalAccessBoundaryPoliciesResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.iam.v3beta.ListPrincipalAccessBoundaryPoliciesRequest, + com.google.iam.v3beta.ListPrincipalAccessBoundaryPoliciesResponse> + getListPrincipalAccessBoundaryPoliciesMethod() { + io.grpc.MethodDescriptor< + com.google.iam.v3beta.ListPrincipalAccessBoundaryPoliciesRequest, + com.google.iam.v3beta.ListPrincipalAccessBoundaryPoliciesResponse> + getListPrincipalAccessBoundaryPoliciesMethod; + if ((getListPrincipalAccessBoundaryPoliciesMethod = + PrincipalAccessBoundaryPoliciesGrpc.getListPrincipalAccessBoundaryPoliciesMethod) + == null) { + synchronized (PrincipalAccessBoundaryPoliciesGrpc.class) { + if ((getListPrincipalAccessBoundaryPoliciesMethod = + PrincipalAccessBoundaryPoliciesGrpc.getListPrincipalAccessBoundaryPoliciesMethod) + == null) { + PrincipalAccessBoundaryPoliciesGrpc.getListPrincipalAccessBoundaryPoliciesMethod = + getListPrincipalAccessBoundaryPoliciesMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName( + SERVICE_NAME, "ListPrincipalAccessBoundaryPolicies")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.iam.v3beta.ListPrincipalAccessBoundaryPoliciesRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.iam.v3beta.ListPrincipalAccessBoundaryPoliciesResponse + .getDefaultInstance())) + .setSchemaDescriptor( + new PrincipalAccessBoundaryPoliciesMethodDescriptorSupplier( + "ListPrincipalAccessBoundaryPolicies")) + .build(); + } + } + } + return getListPrincipalAccessBoundaryPoliciesMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.iam.v3beta.SearchPrincipalAccessBoundaryPolicyBindingsRequest, + com.google.iam.v3beta.SearchPrincipalAccessBoundaryPolicyBindingsResponse> + getSearchPrincipalAccessBoundaryPolicyBindingsMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "SearchPrincipalAccessBoundaryPolicyBindings", + requestType = com.google.iam.v3beta.SearchPrincipalAccessBoundaryPolicyBindingsRequest.class, + responseType = + com.google.iam.v3beta.SearchPrincipalAccessBoundaryPolicyBindingsResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.iam.v3beta.SearchPrincipalAccessBoundaryPolicyBindingsRequest, + com.google.iam.v3beta.SearchPrincipalAccessBoundaryPolicyBindingsResponse> + getSearchPrincipalAccessBoundaryPolicyBindingsMethod() { + io.grpc.MethodDescriptor< + com.google.iam.v3beta.SearchPrincipalAccessBoundaryPolicyBindingsRequest, + com.google.iam.v3beta.SearchPrincipalAccessBoundaryPolicyBindingsResponse> + getSearchPrincipalAccessBoundaryPolicyBindingsMethod; + if ((getSearchPrincipalAccessBoundaryPolicyBindingsMethod = + PrincipalAccessBoundaryPoliciesGrpc + .getSearchPrincipalAccessBoundaryPolicyBindingsMethod) + == null) { + synchronized (PrincipalAccessBoundaryPoliciesGrpc.class) { + if ((getSearchPrincipalAccessBoundaryPolicyBindingsMethod = + PrincipalAccessBoundaryPoliciesGrpc + .getSearchPrincipalAccessBoundaryPolicyBindingsMethod) + == null) { + PrincipalAccessBoundaryPoliciesGrpc.getSearchPrincipalAccessBoundaryPolicyBindingsMethod = + getSearchPrincipalAccessBoundaryPolicyBindingsMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName( + SERVICE_NAME, "SearchPrincipalAccessBoundaryPolicyBindings")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.iam.v3beta + .SearchPrincipalAccessBoundaryPolicyBindingsRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.iam.v3beta + .SearchPrincipalAccessBoundaryPolicyBindingsResponse + .getDefaultInstance())) + .setSchemaDescriptor( + new PrincipalAccessBoundaryPoliciesMethodDescriptorSupplier( + "SearchPrincipalAccessBoundaryPolicyBindings")) + .build(); + } + } + } + return getSearchPrincipalAccessBoundaryPolicyBindingsMethod; + } + + /** Creates a new async stub that supports all call types for the service */ + public static PrincipalAccessBoundaryPoliciesStub newStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public PrincipalAccessBoundaryPoliciesStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new PrincipalAccessBoundaryPoliciesStub(channel, callOptions); + } + }; + return PrincipalAccessBoundaryPoliciesStub.newStub(factory, channel); + } + + /** Creates a new blocking-style stub that supports all types of calls on the service */ + public static PrincipalAccessBoundaryPoliciesBlockingV2Stub newBlockingV2Stub( + io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public PrincipalAccessBoundaryPoliciesBlockingV2Stub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new PrincipalAccessBoundaryPoliciesBlockingV2Stub(channel, callOptions); + } + }; + return PrincipalAccessBoundaryPoliciesBlockingV2Stub.newStub(factory, channel); + } + + /** + * Creates a new blocking-style stub that supports unary and streaming output calls on the service + */ + public static PrincipalAccessBoundaryPoliciesBlockingStub newBlockingStub( + io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public PrincipalAccessBoundaryPoliciesBlockingStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new PrincipalAccessBoundaryPoliciesBlockingStub(channel, callOptions); + } + }; + return PrincipalAccessBoundaryPoliciesBlockingStub.newStub(factory, channel); + } + + /** Creates a new ListenableFuture-style stub that supports unary calls on the service */ + public static PrincipalAccessBoundaryPoliciesFutureStub newFutureStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public PrincipalAccessBoundaryPoliciesFutureStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new PrincipalAccessBoundaryPoliciesFutureStub(channel, callOptions); + } + }; + return PrincipalAccessBoundaryPoliciesFutureStub.newStub(factory, channel); + } + + /** + * + * + *
        +   * Manages Identity and Access Management (IAM) principal access boundary
        +   * policies.
        +   * 
        + */ + public interface AsyncService { + + /** + * + * + *
        +     * Creates a principal access boundary policy, and returns a long running
        +     * operation.
        +     * 
        + */ + default void createPrincipalAccessBoundaryPolicy( + com.google.iam.v3beta.CreatePrincipalAccessBoundaryPolicyRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getCreatePrincipalAccessBoundaryPolicyMethod(), responseObserver); + } + + /** + * + * + *
        +     * Gets a principal access boundary policy.
        +     * 
        + */ + default void getPrincipalAccessBoundaryPolicy( + com.google.iam.v3beta.GetPrincipalAccessBoundaryPolicyRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getGetPrincipalAccessBoundaryPolicyMethod(), responseObserver); + } + + /** + * + * + *
        +     * Updates a principal access boundary policy.
        +     * 
        + */ + default void updatePrincipalAccessBoundaryPolicy( + com.google.iam.v3beta.UpdatePrincipalAccessBoundaryPolicyRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getUpdatePrincipalAccessBoundaryPolicyMethod(), responseObserver); + } + + /** + * + * + *
        +     * Deletes a principal access boundary policy.
        +     * 
        + */ + default void deletePrincipalAccessBoundaryPolicy( + com.google.iam.v3beta.DeletePrincipalAccessBoundaryPolicyRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getDeletePrincipalAccessBoundaryPolicyMethod(), responseObserver); + } + + /** + * + * + *
        +     * Lists principal access boundary policies.
        +     * 
        + */ + default void listPrincipalAccessBoundaryPolicies( + com.google.iam.v3beta.ListPrincipalAccessBoundaryPoliciesRequest request, + io.grpc.stub.StreamObserver< + com.google.iam.v3beta.ListPrincipalAccessBoundaryPoliciesResponse> + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getListPrincipalAccessBoundaryPoliciesMethod(), responseObserver); + } + + /** + * + * + *
        +     * Returns all policy bindings that bind a specific policy if a user has
        +     * searchPolicyBindings permission on that policy.
        +     * 
        + */ + default void searchPrincipalAccessBoundaryPolicyBindings( + com.google.iam.v3beta.SearchPrincipalAccessBoundaryPolicyBindingsRequest request, + io.grpc.stub.StreamObserver< + com.google.iam.v3beta.SearchPrincipalAccessBoundaryPolicyBindingsResponse> + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getSearchPrincipalAccessBoundaryPolicyBindingsMethod(), responseObserver); + } + } + + /** + * Base class for the server implementation of the service PrincipalAccessBoundaryPolicies. + * + *
        +   * Manages Identity and Access Management (IAM) principal access boundary
        +   * policies.
        +   * 
        + */ + public abstract static class PrincipalAccessBoundaryPoliciesImplBase + implements io.grpc.BindableService, AsyncService { + + @java.lang.Override + public final io.grpc.ServerServiceDefinition bindService() { + return PrincipalAccessBoundaryPoliciesGrpc.bindService(this); + } + } + + /** + * A stub to allow clients to do asynchronous rpc calls to service + * PrincipalAccessBoundaryPolicies. + * + *
        +   * Manages Identity and Access Management (IAM) principal access boundary
        +   * policies.
        +   * 
        + */ + public static final class PrincipalAccessBoundaryPoliciesStub + extends io.grpc.stub.AbstractAsyncStub { + private PrincipalAccessBoundaryPoliciesStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected PrincipalAccessBoundaryPoliciesStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new PrincipalAccessBoundaryPoliciesStub(channel, callOptions); + } + + /** + * + * + *
        +     * Creates a principal access boundary policy, and returns a long running
        +     * operation.
        +     * 
        + */ + public void createPrincipalAccessBoundaryPolicy( + com.google.iam.v3beta.CreatePrincipalAccessBoundaryPolicyRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getCreatePrincipalAccessBoundaryPolicyMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
        +     * Gets a principal access boundary policy.
        +     * 
        + */ + public void getPrincipalAccessBoundaryPolicy( + com.google.iam.v3beta.GetPrincipalAccessBoundaryPolicyRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getGetPrincipalAccessBoundaryPolicyMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
        +     * Updates a principal access boundary policy.
        +     * 
        + */ + public void updatePrincipalAccessBoundaryPolicy( + com.google.iam.v3beta.UpdatePrincipalAccessBoundaryPolicyRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getUpdatePrincipalAccessBoundaryPolicyMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
        +     * Deletes a principal access boundary policy.
        +     * 
        + */ + public void deletePrincipalAccessBoundaryPolicy( + com.google.iam.v3beta.DeletePrincipalAccessBoundaryPolicyRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getDeletePrincipalAccessBoundaryPolicyMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
        +     * Lists principal access boundary policies.
        +     * 
        + */ + public void listPrincipalAccessBoundaryPolicies( + com.google.iam.v3beta.ListPrincipalAccessBoundaryPoliciesRequest request, + io.grpc.stub.StreamObserver< + com.google.iam.v3beta.ListPrincipalAccessBoundaryPoliciesResponse> + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getListPrincipalAccessBoundaryPoliciesMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
        +     * Returns all policy bindings that bind a specific policy if a user has
        +     * searchPolicyBindings permission on that policy.
        +     * 
        + */ + public void searchPrincipalAccessBoundaryPolicyBindings( + com.google.iam.v3beta.SearchPrincipalAccessBoundaryPolicyBindingsRequest request, + io.grpc.stub.StreamObserver< + com.google.iam.v3beta.SearchPrincipalAccessBoundaryPolicyBindingsResponse> + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel() + .newCall(getSearchPrincipalAccessBoundaryPolicyBindingsMethod(), getCallOptions()), + request, + responseObserver); + } + } + + /** + * A stub to allow clients to do synchronous rpc calls to service PrincipalAccessBoundaryPolicies. + * + *
        +   * Manages Identity and Access Management (IAM) principal access boundary
        +   * policies.
        +   * 
        + */ + public static final class PrincipalAccessBoundaryPoliciesBlockingV2Stub + extends io.grpc.stub.AbstractBlockingStub { + private PrincipalAccessBoundaryPoliciesBlockingV2Stub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected PrincipalAccessBoundaryPoliciesBlockingV2Stub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new PrincipalAccessBoundaryPoliciesBlockingV2Stub(channel, callOptions); + } + + /** + * + * + *
        +     * Creates a principal access boundary policy, and returns a long running
        +     * operation.
        +     * 
        + */ + public com.google.longrunning.Operation createPrincipalAccessBoundaryPolicy( + com.google.iam.v3beta.CreatePrincipalAccessBoundaryPolicyRequest request) + throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getCreatePrincipalAccessBoundaryPolicyMethod(), getCallOptions(), request); + } + + /** + * + * + *
        +     * Gets a principal access boundary policy.
        +     * 
        + */ + public com.google.iam.v3beta.PrincipalAccessBoundaryPolicy getPrincipalAccessBoundaryPolicy( + com.google.iam.v3beta.GetPrincipalAccessBoundaryPolicyRequest request) + throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getGetPrincipalAccessBoundaryPolicyMethod(), getCallOptions(), request); + } + + /** + * + * + *
        +     * Updates a principal access boundary policy.
        +     * 
        + */ + public com.google.longrunning.Operation updatePrincipalAccessBoundaryPolicy( + com.google.iam.v3beta.UpdatePrincipalAccessBoundaryPolicyRequest request) + throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getUpdatePrincipalAccessBoundaryPolicyMethod(), getCallOptions(), request); + } + + /** + * + * + *
        +     * Deletes a principal access boundary policy.
        +     * 
        + */ + public com.google.longrunning.Operation deletePrincipalAccessBoundaryPolicy( + com.google.iam.v3beta.DeletePrincipalAccessBoundaryPolicyRequest request) + throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getDeletePrincipalAccessBoundaryPolicyMethod(), getCallOptions(), request); + } + + /** + * + * + *
        +     * Lists principal access boundary policies.
        +     * 
        + */ + public com.google.iam.v3beta.ListPrincipalAccessBoundaryPoliciesResponse + listPrincipalAccessBoundaryPolicies( + com.google.iam.v3beta.ListPrincipalAccessBoundaryPoliciesRequest request) + throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getListPrincipalAccessBoundaryPoliciesMethod(), getCallOptions(), request); + } + + /** + * + * + *
        +     * Returns all policy bindings that bind a specific policy if a user has
        +     * searchPolicyBindings permission on that policy.
        +     * 
        + */ + public com.google.iam.v3beta.SearchPrincipalAccessBoundaryPolicyBindingsResponse + searchPrincipalAccessBoundaryPolicyBindings( + com.google.iam.v3beta.SearchPrincipalAccessBoundaryPolicyBindingsRequest request) + throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), + getSearchPrincipalAccessBoundaryPolicyBindingsMethod(), + getCallOptions(), + request); + } + } + + /** + * A stub to allow clients to do limited synchronous rpc calls to service + * PrincipalAccessBoundaryPolicies. + * + *
        +   * Manages Identity and Access Management (IAM) principal access boundary
        +   * policies.
        +   * 
        + */ + public static final class PrincipalAccessBoundaryPoliciesBlockingStub + extends io.grpc.stub.AbstractBlockingStub { + private PrincipalAccessBoundaryPoliciesBlockingStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected PrincipalAccessBoundaryPoliciesBlockingStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new PrincipalAccessBoundaryPoliciesBlockingStub(channel, callOptions); + } + + /** + * + * + *
        +     * Creates a principal access boundary policy, and returns a long running
        +     * operation.
        +     * 
        + */ + public com.google.longrunning.Operation createPrincipalAccessBoundaryPolicy( + com.google.iam.v3beta.CreatePrincipalAccessBoundaryPolicyRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getCreatePrincipalAccessBoundaryPolicyMethod(), getCallOptions(), request); + } + + /** + * + * + *
        +     * Gets a principal access boundary policy.
        +     * 
        + */ + public com.google.iam.v3beta.PrincipalAccessBoundaryPolicy getPrincipalAccessBoundaryPolicy( + com.google.iam.v3beta.GetPrincipalAccessBoundaryPolicyRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getGetPrincipalAccessBoundaryPolicyMethod(), getCallOptions(), request); + } + + /** + * + * + *
        +     * Updates a principal access boundary policy.
        +     * 
        + */ + public com.google.longrunning.Operation updatePrincipalAccessBoundaryPolicy( + com.google.iam.v3beta.UpdatePrincipalAccessBoundaryPolicyRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getUpdatePrincipalAccessBoundaryPolicyMethod(), getCallOptions(), request); + } + + /** + * + * + *
        +     * Deletes a principal access boundary policy.
        +     * 
        + */ + public com.google.longrunning.Operation deletePrincipalAccessBoundaryPolicy( + com.google.iam.v3beta.DeletePrincipalAccessBoundaryPolicyRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getDeletePrincipalAccessBoundaryPolicyMethod(), getCallOptions(), request); + } + + /** + * + * + *
        +     * Lists principal access boundary policies.
        +     * 
        + */ + public com.google.iam.v3beta.ListPrincipalAccessBoundaryPoliciesResponse + listPrincipalAccessBoundaryPolicies( + com.google.iam.v3beta.ListPrincipalAccessBoundaryPoliciesRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getListPrincipalAccessBoundaryPoliciesMethod(), getCallOptions(), request); + } + + /** + * + * + *
        +     * Returns all policy bindings that bind a specific policy if a user has
        +     * searchPolicyBindings permission on that policy.
        +     * 
        + */ + public com.google.iam.v3beta.SearchPrincipalAccessBoundaryPolicyBindingsResponse + searchPrincipalAccessBoundaryPolicyBindings( + com.google.iam.v3beta.SearchPrincipalAccessBoundaryPolicyBindingsRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), + getSearchPrincipalAccessBoundaryPolicyBindingsMethod(), + getCallOptions(), + request); + } + } + + /** + * A stub to allow clients to do ListenableFuture-style rpc calls to service + * PrincipalAccessBoundaryPolicies. + * + *
        +   * Manages Identity and Access Management (IAM) principal access boundary
        +   * policies.
        +   * 
        + */ + public static final class PrincipalAccessBoundaryPoliciesFutureStub + extends io.grpc.stub.AbstractFutureStub { + private PrincipalAccessBoundaryPoliciesFutureStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected PrincipalAccessBoundaryPoliciesFutureStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new PrincipalAccessBoundaryPoliciesFutureStub(channel, callOptions); + } + + /** + * + * + *
        +     * Creates a principal access boundary policy, and returns a long running
        +     * operation.
        +     * 
        + */ + public com.google.common.util.concurrent.ListenableFuture + createPrincipalAccessBoundaryPolicy( + com.google.iam.v3beta.CreatePrincipalAccessBoundaryPolicyRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getCreatePrincipalAccessBoundaryPolicyMethod(), getCallOptions()), + request); + } + + /** + * + * + *
        +     * Gets a principal access boundary policy.
        +     * 
        + */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.iam.v3beta.PrincipalAccessBoundaryPolicy> + getPrincipalAccessBoundaryPolicy( + com.google.iam.v3beta.GetPrincipalAccessBoundaryPolicyRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getGetPrincipalAccessBoundaryPolicyMethod(), getCallOptions()), + request); + } + + /** + * + * + *
        +     * Updates a principal access boundary policy.
        +     * 
        + */ + public com.google.common.util.concurrent.ListenableFuture + updatePrincipalAccessBoundaryPolicy( + com.google.iam.v3beta.UpdatePrincipalAccessBoundaryPolicyRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getUpdatePrincipalAccessBoundaryPolicyMethod(), getCallOptions()), + request); + } + + /** + * + * + *
        +     * Deletes a principal access boundary policy.
        +     * 
        + */ + public com.google.common.util.concurrent.ListenableFuture + deletePrincipalAccessBoundaryPolicy( + com.google.iam.v3beta.DeletePrincipalAccessBoundaryPolicyRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getDeletePrincipalAccessBoundaryPolicyMethod(), getCallOptions()), + request); + } + + /** + * + * + *
        +     * Lists principal access boundary policies.
        +     * 
        + */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.iam.v3beta.ListPrincipalAccessBoundaryPoliciesResponse> + listPrincipalAccessBoundaryPolicies( + com.google.iam.v3beta.ListPrincipalAccessBoundaryPoliciesRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getListPrincipalAccessBoundaryPoliciesMethod(), getCallOptions()), + request); + } + + /** + * + * + *
        +     * Returns all policy bindings that bind a specific policy if a user has
        +     * searchPolicyBindings permission on that policy.
        +     * 
        + */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.iam.v3beta.SearchPrincipalAccessBoundaryPolicyBindingsResponse> + searchPrincipalAccessBoundaryPolicyBindings( + com.google.iam.v3beta.SearchPrincipalAccessBoundaryPolicyBindingsRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel() + .newCall(getSearchPrincipalAccessBoundaryPolicyBindingsMethod(), getCallOptions()), + request); + } + } + + private static final int METHODID_CREATE_PRINCIPAL_ACCESS_BOUNDARY_POLICY = 0; + private static final int METHODID_GET_PRINCIPAL_ACCESS_BOUNDARY_POLICY = 1; + private static final int METHODID_UPDATE_PRINCIPAL_ACCESS_BOUNDARY_POLICY = 2; + private static final int METHODID_DELETE_PRINCIPAL_ACCESS_BOUNDARY_POLICY = 3; + private static final int METHODID_LIST_PRINCIPAL_ACCESS_BOUNDARY_POLICIES = 4; + private static final int METHODID_SEARCH_PRINCIPAL_ACCESS_BOUNDARY_POLICY_BINDINGS = 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_CREATE_PRINCIPAL_ACCESS_BOUNDARY_POLICY: + serviceImpl.createPrincipalAccessBoundaryPolicy( + (com.google.iam.v3beta.CreatePrincipalAccessBoundaryPolicyRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_GET_PRINCIPAL_ACCESS_BOUNDARY_POLICY: + serviceImpl.getPrincipalAccessBoundaryPolicy( + (com.google.iam.v3beta.GetPrincipalAccessBoundaryPolicyRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_UPDATE_PRINCIPAL_ACCESS_BOUNDARY_POLICY: + serviceImpl.updatePrincipalAccessBoundaryPolicy( + (com.google.iam.v3beta.UpdatePrincipalAccessBoundaryPolicyRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_DELETE_PRINCIPAL_ACCESS_BOUNDARY_POLICY: + serviceImpl.deletePrincipalAccessBoundaryPolicy( + (com.google.iam.v3beta.DeletePrincipalAccessBoundaryPolicyRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_LIST_PRINCIPAL_ACCESS_BOUNDARY_POLICIES: + serviceImpl.listPrincipalAccessBoundaryPolicies( + (com.google.iam.v3beta.ListPrincipalAccessBoundaryPoliciesRequest) request, + (io.grpc.stub.StreamObserver< + com.google.iam.v3beta.ListPrincipalAccessBoundaryPoliciesResponse>) + responseObserver); + break; + case METHODID_SEARCH_PRINCIPAL_ACCESS_BOUNDARY_POLICY_BINDINGS: + serviceImpl.searchPrincipalAccessBoundaryPolicyBindings( + (com.google.iam.v3beta.SearchPrincipalAccessBoundaryPolicyBindingsRequest) request, + (io.grpc.stub.StreamObserver< + com.google.iam.v3beta.SearchPrincipalAccessBoundaryPolicyBindingsResponse>) + 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( + getCreatePrincipalAccessBoundaryPolicyMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.iam.v3beta.CreatePrincipalAccessBoundaryPolicyRequest, + com.google.longrunning.Operation>( + service, METHODID_CREATE_PRINCIPAL_ACCESS_BOUNDARY_POLICY))) + .addMethod( + getGetPrincipalAccessBoundaryPolicyMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.iam.v3beta.GetPrincipalAccessBoundaryPolicyRequest, + com.google.iam.v3beta.PrincipalAccessBoundaryPolicy>( + service, METHODID_GET_PRINCIPAL_ACCESS_BOUNDARY_POLICY))) + .addMethod( + getUpdatePrincipalAccessBoundaryPolicyMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.iam.v3beta.UpdatePrincipalAccessBoundaryPolicyRequest, + com.google.longrunning.Operation>( + service, METHODID_UPDATE_PRINCIPAL_ACCESS_BOUNDARY_POLICY))) + .addMethod( + getDeletePrincipalAccessBoundaryPolicyMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.iam.v3beta.DeletePrincipalAccessBoundaryPolicyRequest, + com.google.longrunning.Operation>( + service, METHODID_DELETE_PRINCIPAL_ACCESS_BOUNDARY_POLICY))) + .addMethod( + getListPrincipalAccessBoundaryPoliciesMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.iam.v3beta.ListPrincipalAccessBoundaryPoliciesRequest, + com.google.iam.v3beta.ListPrincipalAccessBoundaryPoliciesResponse>( + service, METHODID_LIST_PRINCIPAL_ACCESS_BOUNDARY_POLICIES))) + .addMethod( + getSearchPrincipalAccessBoundaryPolicyBindingsMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.iam.v3beta.SearchPrincipalAccessBoundaryPolicyBindingsRequest, + com.google.iam.v3beta.SearchPrincipalAccessBoundaryPolicyBindingsResponse>( + service, METHODID_SEARCH_PRINCIPAL_ACCESS_BOUNDARY_POLICY_BINDINGS))) + .build(); + } + + private abstract static class PrincipalAccessBoundaryPoliciesBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoFileDescriptorSupplier, + io.grpc.protobuf.ProtoServiceDescriptorSupplier { + PrincipalAccessBoundaryPoliciesBaseDescriptorSupplier() {} + + @java.lang.Override + public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() { + return com.google.iam.v3beta.PrincipalAccessBoundaryPoliciesServiceProto.getDescriptor(); + } + + @java.lang.Override + public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() { + return getFileDescriptor().findServiceByName("PrincipalAccessBoundaryPolicies"); + } + } + + private static final class PrincipalAccessBoundaryPoliciesFileDescriptorSupplier + extends PrincipalAccessBoundaryPoliciesBaseDescriptorSupplier { + PrincipalAccessBoundaryPoliciesFileDescriptorSupplier() {} + } + + private static final class PrincipalAccessBoundaryPoliciesMethodDescriptorSupplier + extends PrincipalAccessBoundaryPoliciesBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoMethodDescriptorSupplier { + private final java.lang.String methodName; + + PrincipalAccessBoundaryPoliciesMethodDescriptorSupplier(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 (PrincipalAccessBoundaryPoliciesGrpc.class) { + result = serviceDescriptor; + if (result == null) { + serviceDescriptor = + result = + io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME) + .setSchemaDescriptor( + new PrincipalAccessBoundaryPoliciesFileDescriptorSupplier()) + .addMethod(getCreatePrincipalAccessBoundaryPolicyMethod()) + .addMethod(getGetPrincipalAccessBoundaryPolicyMethod()) + .addMethod(getUpdatePrincipalAccessBoundaryPolicyMethod()) + .addMethod(getDeletePrincipalAccessBoundaryPolicyMethod()) + .addMethod(getListPrincipalAccessBoundaryPoliciesMethod()) + .addMethod(getSearchPrincipalAccessBoundaryPolicyBindingsMethod()) + .build(); + } + } + } + return result; + } +} diff --git a/java-iam/owlbot.py b/java-iam/owlbot.py index a53d819dd3..dc410938cd 100644 --- a/java-iam/owlbot.py +++ b/java-iam/owlbot.py @@ -22,8 +22,17 @@ s.move(library) s.remove_staging_dirs() -java.common_templates(excludes=[ - 'README.md', - 'samples/*', - '.github/workflows/samples.yaml', +java.common_templates(monorepo=True,excludes=[ + ".github/*", + ".kokoro/*", + "CODE_OF_CONDUCT.md", + "CONTRIBUTING.md", + "LICENSE", + "SECURITY.md", + "java.header", + "license-checks.xml", + "README.md", + "samples/*", + "renovate.json", + ".gitignore" ]) diff --git a/java-iam/pom.xml b/java-iam/pom.xml index 4d12b4e449..70e5e958e6 100644 --- a/java-iam/pom.xml +++ b/java-iam/pom.xml @@ -4,17 +4,16 @@ com.google.cloud google-iam-parent pom - 1.6.23-SNAPSHOT + 1.62.1-SNAPSHOT Google IAM Parent - https://github.com/googleapis/java-iam Java idiomatic client for Google Cloud Platform services. - com.google.cloud + com.google.api gapic-generator-java-pom-parent - 2.12.1-SNAPSHOT + 2.68.1-SNAPSHOT ../gapic-generator-java-pom-parent @@ -32,26 +31,6 @@ Google LLC - - scm:git:git@github.com:googleapis/java-iam.git - scm:git:git@github.com:googleapis/java-iam.git - https://github.com/googleapis/java-iam - HEAD - - - https://github.com/googleapis/java-iam/issues - GitHub Issues - - - - sonatype-nexus-snapshots - https://oss.sonatype.org/content/repositories/snapshots - - - sonatype-nexus-staging - https://oss.sonatype.org/service/local/staging/deploy/maven2/ - - Apache-2.0 @@ -68,6 +47,23 @@ + + com.google.cloud + third-party-dependencies + 3.58.1-SNAPSHOT + pom + import + + + com.google.api.grpc + proto-google-iam-v3beta + 1.62.1-SNAPSHOT + + + com.google.api.grpc + grpc-google-iam-v3beta + 1.62.1-SNAPSHOT + com.google.guava guava-bom @@ -92,49 +88,59 @@ com.google.api gax-bom - 2.20.2-SNAPSHOT + 2.76.1-SNAPSHOT pom import + + com.google.api + api-common + 2.59.1-SNAPSHOT + com.google.api.grpc proto-google-iam-v2 - 1.6.23-SNAPSHOT + 1.62.1-SNAPSHOT com.google.api.grpc grpc-google-iam-v2 - 1.6.23-SNAPSHOT - - - com.google.cloud - google-iam-policy - 1.6.23-SNAPSHOT + 1.62.1-SNAPSHOT com.google.api.grpc proto-google-common-protos - 2.11.1-SNAPSHOT + 2.67.1-SNAPSHOT com.google.api.grpc proto-google-iam-v2beta - 1.6.23-SNAPSHOT + 1.62.1-SNAPSHOT com.google.api.grpc grpc-google-iam-v1 - 1.6.23-SNAPSHOT + 1.62.1-SNAPSHOT com.google.api.grpc grpc-google-iam-v2beta - 1.6.23-SNAPSHOT + 1.62.1-SNAPSHOT com.google.api.grpc proto-google-iam-v1 - 1.6.23-SNAPSHOT + 1.62.1-SNAPSHOT + + + com.google.api.grpc + proto-google-iam-v3 + 1.62.1-SNAPSHOT + + + com.google.api.grpc + grpc-google-iam-v3 + 1.62.1-SNAPSHOT javax.annotation @@ -155,8 +161,12 @@ proto-google-iam-v1 grpc-google-iam-v2beta grpc-google-iam-v2 + grpc-google-iam-v3 + grpc-google-iam-v3beta proto-google-iam-v2beta proto-google-iam-v2 + proto-google-iam-v3 + proto-google-iam-v3beta grpc-google-iam-v1 @@ -165,7 +175,7 @@ org.apache.maven.plugins maven-project-info-reports-plugin - 3.4.1 + 3.8.0 @@ -192,7 +202,6 @@ org.apache.maven.plugins maven-javadoc-plugin - 3.4.1 html @@ -229,4 +238,19 @@ + + + + + showcase-sonar-analysis + + + enableShowcaseTestCoverage + + + + true + + + diff --git a/java-iam/proto-google-iam-v1/build.gradle b/java-iam/proto-google-iam-v1/build.gradle deleted file mode 100644 index b4d8f360fc..0000000000 --- a/java-iam/proto-google-iam-v1/build.gradle +++ /dev/null @@ -1,52 +0,0 @@ -buildscript { - repositories { - mavenCentral() - } -} - -apply plugin: 'java' - -description = 'PROTO library for proto-google-iam-v1' -group = 'com.google.api.grpc' -version = "0.13.0" -sourceCompatibility = 1.7 -targetCompatibility = 1.7 - -repositories { - mavenCentral() - mavenLocal() -} - -dependencies { - compile 'com.google.protobuf:protobuf-java:3.21.12' - compile 'com.google.api:api-common:2.2.2' - compile project(':proto-google-common-protos') -} - -sourceSets { - main { - resources { - srcDir 'src/main/proto' - } - java { - srcDir 'src/main/java' - } - } -} - -task javadocJar(type: Jar) { - classifier = 'javadoc' - from javadoc -} - -task sourcesJar(type: Jar) { - classifier = 'sources' - from sourceSets.main.allSource -} - -artifacts { - archives javadocJar, sourcesJar -} - -compileJava.options.encoding = 'UTF-8' -javadoc.options.encoding = 'UTF-8' \ No newline at end of file diff --git a/java-iam/proto-google-iam-v1/clirr-ignored-differences.xml b/java-iam/proto-google-iam-v1/clirr-ignored-differences.xml index ca6f8c1981..4b3ee79e76 100644 --- a/java-iam/proto-google-iam-v1/clirr-ignored-differences.xml +++ b/java-iam/proto-google-iam-v1/clirr-ignored-differences.xml @@ -30,4 +30,66 @@ com/google/iam/v1/logging/*OrBuilder boolean has*(*) + + + + 7006 + com/google/iam/v1/** + * getDefaultInstanceForType() + ** + + + 7006 + com/google/iam/v1/** + * addRepeatedField(*) + ** + + + 7006 + com/google/iam/v1/** + * clear() + ** + + + 7006 + com/google/iam/v1/** + * clearField(*) + ** + + + 7006 + com/google/iam/v1/** + * clearOneof(*) + ** + + + 7006 + com/google/iam/v1/** + * clone() + ** + + + 7006 + com/google/iam/v1/** + * mergeUnknownFields(*) + ** + + + 7006 + com/google/iam/v1/** + * setField(*) + ** + + + 7006 + com/google/iam/v1/** + * setRepeatedField(*) + ** + + + 7006 + com/google/iam/v1/** + * setUnknownFields(*) + ** + diff --git a/java-iam/proto-google-iam-v1/pom.xml b/java-iam/proto-google-iam-v1/pom.xml index 1a472df606..e892c556f8 100644 --- a/java-iam/proto-google-iam-v1/pom.xml +++ b/java-iam/proto-google-iam-v1/pom.xml @@ -3,13 +3,13 @@ 4.0.0 com.google.api.grpc proto-google-iam-v1 - 1.6.23-SNAPSHOT + 1.62.1-SNAPSHOT proto-google-iam-v1 PROTO library for proto-google-iam-v1 com.google.cloud google-iam-parent - 1.6.23-SNAPSHOT + 1.62.1-SNAPSHOT diff --git a/java-iam/proto-google-iam-v1/src/main/java/com/google/iam/v1/AuditConfig.java b/java-iam/proto-google-iam-v1/src/main/java/com/google/iam/v1/AuditConfig.java index 7d07f32436..c718ffc2b1 100644 --- a/java-iam/proto-google-iam-v1/src/main/java/com/google/iam/v1/AuditConfig.java +++ b/java-iam/proto-google-iam-v1/src/main/java/com/google/iam/v1/AuditConfig.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,9 @@ * limitations under the License. */ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: google/iam/v1/policy.proto +// Protobuf Java Version: 4.33.2 package com.google.iam.v1; @@ -26,60 +28,76 @@ * The configuration determines which permission types are logged, and what * identities, if any, are exempted from logging. * An AuditConfig must have one or more AuditLogConfigs. + * * If there are AuditConfigs for both `allServices` and a specific service, * the union of the two AuditConfigs is used for that service: the log_types * specified in each AuditConfig are enabled, and the exempted_members in each * AuditLogConfig are exempted. + * * Example Policy with multiple AuditConfigs: - * { - * "audit_configs": [ - * { - * "service": "allServices", - * "audit_log_configs": [ - * { - * "log_type": "DATA_READ", - * "exempted_members": [ - * "user:jose@example.com" - * ] - * }, - * { - * "log_type": "DATA_WRITE" - * }, - * { - * "log_type": "ADMIN_READ" - * } - * ] - * }, - * { - * "service": "sampleservice.googleapis.com", - * "audit_log_configs": [ - * { - * "log_type": "DATA_READ" - * }, - * { - * "log_type": "DATA_WRITE", - * "exempted_members": [ - * "user:aliya@example.com" - * ] - * } - * ] - * } - * ] - * } + * + * { + * "audit_configs": [ + * { + * "service": "allServices", + * "audit_log_configs": [ + * { + * "log_type": "DATA_READ", + * "exempted_members": [ + * "user:jose@example.com" + * ] + * }, + * { + * "log_type": "DATA_WRITE" + * }, + * { + * "log_type": "ADMIN_READ" + * } + * ] + * }, + * { + * "service": "sampleservice.googleapis.com", + * "audit_log_configs": [ + * { + * "log_type": "DATA_READ" + * }, + * { + * "log_type": "DATA_WRITE", + * "exempted_members": [ + * "user:aliya@example.com" + * ] + * } + * ] + * } + * ] + * } + * * For sampleservice, this policy enables DATA_READ, DATA_WRITE and ADMIN_READ - * logging. It also exempts jose@example.com from DATA_READ logging, and - * aliya@example.com from DATA_WRITE logging. + * logging. It also exempts `jose@example.com` from DATA_READ logging, and + * `aliya@example.com` from DATA_WRITE logging. *
        * * Protobuf type {@code google.iam.v1.AuditConfig} */ -public final class AuditConfig extends com.google.protobuf.GeneratedMessageV3 +@com.google.protobuf.Generated +public final class AuditConfig extends com.google.protobuf.GeneratedMessage implements // @@protoc_insertion_point(message_implements:google.iam.v1.AuditConfig) AuditConfigOrBuilder { private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "AuditConfig"); + } + // Use AuditConfig.newBuilder() to construct. - private AuditConfig(com.google.protobuf.GeneratedMessageV3.Builder builder) { + private AuditConfig(com.google.protobuf.GeneratedMessage.Builder builder) { super(builder); } @@ -88,23 +106,12 @@ private AuditConfig() { auditLogConfigs_ = java.util.Collections.emptyList(); } - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new AuditConfig(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.iam.v1.PolicyProto.internal_static_google_iam_v1_AuditConfig_descriptor; } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.iam.v1.PolicyProto .internal_static_google_iam_v1_AuditConfig_fieldAccessorTable @@ -113,7 +120,10 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } public static final int SERVICE_FIELD_NUMBER = 1; - private volatile java.lang.Object service_; + + @SuppressWarnings("serial") + private volatile java.lang.Object service_ = ""; + /** * * @@ -139,6 +149,7 @@ public java.lang.String getService() { return s; } } + /** * * @@ -166,7 +177,10 @@ public com.google.protobuf.ByteString getServiceBytes() { } public static final int AUDIT_LOG_CONFIGS_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") private java.util.List auditLogConfigs_; + /** * * @@ -180,6 +194,7 @@ public com.google.protobuf.ByteString getServiceBytes() { public java.util.List getAuditLogConfigsList() { return auditLogConfigs_; } + /** * * @@ -194,6 +209,7 @@ public java.util.List getAuditLogConfigsList() getAuditLogConfigsOrBuilderList() { return auditLogConfigs_; } + /** * * @@ -207,6 +223,7 @@ public java.util.List getAuditLogConfigsList() public int getAuditLogConfigsCount() { return auditLogConfigs_.size(); } + /** * * @@ -220,6 +237,7 @@ public int getAuditLogConfigsCount() { public com.google.iam.v1.AuditLogConfig getAuditLogConfigs(int index) { return auditLogConfigs_.get(index); } + /** * * @@ -248,8 +266,8 @@ public final boolean isInitialized() { @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(service_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, service_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(service_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, service_); } for (int i = 0; i < auditLogConfigs_.size(); i++) { output.writeMessage(3, auditLogConfigs_.get(i)); @@ -263,8 +281,8 @@ public int getSerializedSize() { if (size != -1) return size; size = 0; - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(service_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, service_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(service_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, service_); } for (int i = 0; i < auditLogConfigs_.size(); i++) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, auditLogConfigs_.get(i)); @@ -344,38 +362,38 @@ public static com.google.iam.v1.AuditConfig parseFrom( public static com.google.iam.v1.AuditConfig parseFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); } public static com.google.iam.v1.AuditConfig parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } public static com.google.iam.v1.AuditConfig parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); } public static com.google.iam.v1.AuditConfig parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( PARSER, input, extensionRegistry); } public static com.google.iam.v1.AuditConfig parseFrom(com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); } public static com.google.iam.v1.AuditConfig parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } @@ -398,10 +416,11 @@ public Builder toBuilder() { } @java.lang.Override - protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { Builder builder = new Builder(parent); return builder; } + /** * * @@ -410,54 +429,58 @@ protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.Build * The configuration determines which permission types are logged, and what * identities, if any, are exempted from logging. * An AuditConfig must have one or more AuditLogConfigs. + * * If there are AuditConfigs for both `allServices` and a specific service, * the union of the two AuditConfigs is used for that service: the log_types * specified in each AuditConfig are enabled, and the exempted_members in each * AuditLogConfig are exempted. + * * Example Policy with multiple AuditConfigs: - * { - * "audit_configs": [ - * { - * "service": "allServices", - * "audit_log_configs": [ - * { - * "log_type": "DATA_READ", - * "exempted_members": [ - * "user:jose@example.com" - * ] - * }, - * { - * "log_type": "DATA_WRITE" - * }, - * { - * "log_type": "ADMIN_READ" - * } - * ] - * }, - * { - * "service": "sampleservice.googleapis.com", - * "audit_log_configs": [ - * { - * "log_type": "DATA_READ" - * }, - * { - * "log_type": "DATA_WRITE", - * "exempted_members": [ - * "user:aliya@example.com" - * ] - * } - * ] - * } - * ] - * } + * + * { + * "audit_configs": [ + * { + * "service": "allServices", + * "audit_log_configs": [ + * { + * "log_type": "DATA_READ", + * "exempted_members": [ + * "user:jose@example.com" + * ] + * }, + * { + * "log_type": "DATA_WRITE" + * }, + * { + * "log_type": "ADMIN_READ" + * } + * ] + * }, + * { + * "service": "sampleservice.googleapis.com", + * "audit_log_configs": [ + * { + * "log_type": "DATA_READ" + * }, + * { + * "log_type": "DATA_WRITE", + * "exempted_members": [ + * "user:aliya@example.com" + * ] + * } + * ] + * } + * ] + * } + * * For sampleservice, this policy enables DATA_READ, DATA_WRITE and ADMIN_READ - * logging. It also exempts jose@example.com from DATA_READ logging, and - * aliya@example.com from DATA_WRITE logging. + * logging. It also exempts `jose@example.com` from DATA_READ logging, and + * `aliya@example.com` from DATA_WRITE logging. *
        * * Protobuf type {@code google.iam.v1.AuditConfig} */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder implements // @@protoc_insertion_point(builder_implements:google.iam.v1.AuditConfig) com.google.iam.v1.AuditConfigOrBuilder { @@ -466,7 +489,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.iam.v1.PolicyProto .internal_static_google_iam_v1_AuditConfig_fieldAccessorTable @@ -477,22 +500,22 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { // Construct using com.google.iam.v1.AuditConfig.newBuilder() private Builder() {} - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { super(parent); } @java.lang.Override public Builder clear() { super.clear(); + bitField0_ = 0; service_ = ""; - if (auditLogConfigsBuilder_ == null) { auditLogConfigs_ = java.util.Collections.emptyList(); } else { auditLogConfigs_ = null; auditLogConfigsBuilder_.clear(); } - bitField0_ = (bitField0_ & ~0x00000001); + bitField0_ = (bitField0_ & ~0x00000002); return this; } @@ -518,52 +541,31 @@ public com.google.iam.v1.AuditConfig build() { @java.lang.Override public com.google.iam.v1.AuditConfig buildPartial() { com.google.iam.v1.AuditConfig result = new com.google.iam.v1.AuditConfig(this); - int from_bitField0_ = bitField0_; - result.service_ = service_; + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields(com.google.iam.v1.AuditConfig result) { if (auditLogConfigsBuilder_ == null) { - if (((bitField0_ & 0x00000001) != 0)) { + if (((bitField0_ & 0x00000002) != 0)) { auditLogConfigs_ = java.util.Collections.unmodifiableList(auditLogConfigs_); - bitField0_ = (bitField0_ & ~0x00000001); + bitField0_ = (bitField0_ & ~0x00000002); } result.auditLogConfigs_ = auditLogConfigs_; } else { result.auditLogConfigs_ = auditLogConfigsBuilder_.build(); } - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); } - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.setField(field, value); - } - - @java.lang.Override - public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - - @java.lang.Override - public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.addRepeatedField(field, value); + private void buildPartial0(com.google.iam.v1.AuditConfig result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.service_ = service_; + } } @java.lang.Override @@ -580,13 +582,14 @@ public Builder mergeFrom(com.google.iam.v1.AuditConfig other) { if (other == com.google.iam.v1.AuditConfig.getDefaultInstance()) return this; if (!other.getService().isEmpty()) { service_ = other.service_; + bitField0_ |= 0x00000001; onChanged(); } if (auditLogConfigsBuilder_ == null) { if (!other.auditLogConfigs_.isEmpty()) { if (auditLogConfigs_.isEmpty()) { auditLogConfigs_ = other.auditLogConfigs_; - bitField0_ = (bitField0_ & ~0x00000001); + bitField0_ = (bitField0_ & ~0x00000002); } else { ensureAuditLogConfigsIsMutable(); auditLogConfigs_.addAll(other.auditLogConfigs_); @@ -599,10 +602,10 @@ public Builder mergeFrom(com.google.iam.v1.AuditConfig other) { auditLogConfigsBuilder_.dispose(); auditLogConfigsBuilder_ = null; auditLogConfigs_ = other.auditLogConfigs_; - bitField0_ = (bitField0_ & ~0x00000001); + bitField0_ = (bitField0_ & ~0x00000002); auditLogConfigsBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders - ? getAuditLogConfigsFieldBuilder() + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders + ? internalGetAuditLogConfigsFieldBuilder() : null; } else { auditLogConfigsBuilder_.addAllMessages(other.auditLogConfigs_); @@ -638,7 +641,7 @@ public Builder mergeFrom( case 10: { service_ = input.readStringRequireUtf8(); - + bitField0_ |= 0x00000001; break; } // case 10 case 26: @@ -673,6 +676,7 @@ public Builder mergeFrom( private int bitField0_; private java.lang.Object service_ = ""; + /** * * @@ -697,6 +701,7 @@ public java.lang.String getService() { return (java.lang.String) ref; } } + /** * * @@ -721,6 +726,7 @@ public com.google.protobuf.ByteString getServiceBytes() { return (com.google.protobuf.ByteString) ref; } } + /** * * @@ -739,11 +745,12 @@ public Builder setService(java.lang.String value) { if (value == null) { throw new NullPointerException(); } - service_ = value; + bitField0_ |= 0x00000001; onChanged(); return this; } + /** * * @@ -758,11 +765,12 @@ public Builder setService(java.lang.String value) { * @return This builder for chaining. */ public Builder clearService() { - service_ = getDefaultInstance().getService(); + bitField0_ = (bitField0_ & ~0x00000001); onChanged(); return this; } + /** * * @@ -782,8 +790,8 @@ public Builder setServiceBytes(com.google.protobuf.ByteString value) { throw new NullPointerException(); } checkByteStringIsUtf8(value); - service_ = value; + bitField0_ |= 0x00000001; onChanged(); return this; } @@ -792,14 +800,14 @@ public Builder setServiceBytes(com.google.protobuf.ByteString value) { java.util.Collections.emptyList(); private void ensureAuditLogConfigsIsMutable() { - if (!((bitField0_ & 0x00000001) != 0)) { + if (!((bitField0_ & 0x00000002) != 0)) { auditLogConfigs_ = new java.util.ArrayList(auditLogConfigs_); - bitField0_ |= 0x00000001; + bitField0_ |= 0x00000002; } } - private com.google.protobuf.RepeatedFieldBuilderV3< + private com.google.protobuf.RepeatedFieldBuilder< com.google.iam.v1.AuditLogConfig, com.google.iam.v1.AuditLogConfig.Builder, com.google.iam.v1.AuditLogConfigOrBuilder> @@ -821,6 +829,7 @@ public java.util.List getAuditLogConfigsList() return auditLogConfigsBuilder_.getMessageList(); } } + /** * * @@ -837,6 +846,7 @@ public int getAuditLogConfigsCount() { return auditLogConfigsBuilder_.getCount(); } } + /** * * @@ -853,6 +863,7 @@ public com.google.iam.v1.AuditLogConfig getAuditLogConfigs(int index) { return auditLogConfigsBuilder_.getMessage(index); } } + /** * * @@ -875,6 +886,7 @@ public Builder setAuditLogConfigs(int index, com.google.iam.v1.AuditLogConfig va } return this; } + /** * * @@ -895,6 +907,7 @@ public Builder setAuditLogConfigs( } return this; } + /** * * @@ -917,6 +930,7 @@ public Builder addAuditLogConfigs(com.google.iam.v1.AuditLogConfig value) { } return this; } + /** * * @@ -939,6 +953,7 @@ public Builder addAuditLogConfigs(int index, com.google.iam.v1.AuditLogConfig va } return this; } + /** * * @@ -958,6 +973,7 @@ public Builder addAuditLogConfigs(com.google.iam.v1.AuditLogConfig.Builder build } return this; } + /** * * @@ -978,6 +994,7 @@ public Builder addAuditLogConfigs( } return this; } + /** * * @@ -998,6 +1015,7 @@ public Builder addAllAuditLogConfigs( } return this; } + /** * * @@ -1010,13 +1028,14 @@ public Builder addAllAuditLogConfigs( public Builder clearAuditLogConfigs() { if (auditLogConfigsBuilder_ == null) { auditLogConfigs_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); + bitField0_ = (bitField0_ & ~0x00000002); onChanged(); } else { auditLogConfigsBuilder_.clear(); } return this; } + /** * * @@ -1036,6 +1055,7 @@ public Builder removeAuditLogConfigs(int index) { } return this; } + /** * * @@ -1046,8 +1066,9 @@ public Builder removeAuditLogConfigs(int index) { * repeated .google.iam.v1.AuditLogConfig audit_log_configs = 3; */ public com.google.iam.v1.AuditLogConfig.Builder getAuditLogConfigsBuilder(int index) { - return getAuditLogConfigsFieldBuilder().getBuilder(index); + return internalGetAuditLogConfigsFieldBuilder().getBuilder(index); } + /** * * @@ -1064,6 +1085,7 @@ public com.google.iam.v1.AuditLogConfigOrBuilder getAuditLogConfigsOrBuilder(int return auditLogConfigsBuilder_.getMessageOrBuilder(index); } } + /** * * @@ -1081,6 +1103,7 @@ public com.google.iam.v1.AuditLogConfigOrBuilder getAuditLogConfigsOrBuilder(int return java.util.Collections.unmodifiableList(auditLogConfigs_); } } + /** * * @@ -1091,9 +1114,10 @@ public com.google.iam.v1.AuditLogConfigOrBuilder getAuditLogConfigsOrBuilder(int * repeated .google.iam.v1.AuditLogConfig audit_log_configs = 3; */ public com.google.iam.v1.AuditLogConfig.Builder addAuditLogConfigsBuilder() { - return getAuditLogConfigsFieldBuilder() + return internalGetAuditLogConfigsFieldBuilder() .addBuilder(com.google.iam.v1.AuditLogConfig.getDefaultInstance()); } + /** * * @@ -1104,9 +1128,10 @@ public com.google.iam.v1.AuditLogConfig.Builder addAuditLogConfigsBuilder() { * repeated .google.iam.v1.AuditLogConfig audit_log_configs = 3; */ public com.google.iam.v1.AuditLogConfig.Builder addAuditLogConfigsBuilder(int index) { - return getAuditLogConfigsFieldBuilder() + return internalGetAuditLogConfigsFieldBuilder() .addBuilder(index, com.google.iam.v1.AuditLogConfig.getDefaultInstance()); } + /** * * @@ -1118,22 +1143,22 @@ public com.google.iam.v1.AuditLogConfig.Builder addAuditLogConfigsBuilder(int in */ public java.util.List getAuditLogConfigsBuilderList() { - return getAuditLogConfigsFieldBuilder().getBuilderList(); + return internalGetAuditLogConfigsFieldBuilder().getBuilderList(); } - private com.google.protobuf.RepeatedFieldBuilderV3< + private com.google.protobuf.RepeatedFieldBuilder< com.google.iam.v1.AuditLogConfig, com.google.iam.v1.AuditLogConfig.Builder, com.google.iam.v1.AuditLogConfigOrBuilder> - getAuditLogConfigsFieldBuilder() { + internalGetAuditLogConfigsFieldBuilder() { if (auditLogConfigsBuilder_ == null) { auditLogConfigsBuilder_ = - new com.google.protobuf.RepeatedFieldBuilderV3< + new com.google.protobuf.RepeatedFieldBuilder< com.google.iam.v1.AuditLogConfig, com.google.iam.v1.AuditLogConfig.Builder, com.google.iam.v1.AuditLogConfigOrBuilder>( auditLogConfigs_, - ((bitField0_ & 0x00000001) != 0), + ((bitField0_ & 0x00000002) != 0), getParentForChildren(), isClean()); auditLogConfigs_ = null; @@ -1141,17 +1166,6 @@ public com.google.iam.v1.AuditLogConfig.Builder addAuditLogConfigsBuilder(int in return auditLogConfigsBuilder_; } - @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.iam.v1.AuditConfig) } diff --git a/java-iam/proto-google-iam-v1/src/main/java/com/google/iam/v1/AuditConfigDelta.java b/java-iam/proto-google-iam-v1/src/main/java/com/google/iam/v1/AuditConfigDelta.java index 622b64143c..abe124b93f 100644 --- a/java-iam/proto-google-iam-v1/src/main/java/com/google/iam/v1/AuditConfigDelta.java +++ b/java-iam/proto-google-iam-v1/src/main/java/com/google/iam/v1/AuditConfigDelta.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,9 @@ * limitations under the License. */ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: google/iam/v1/policy.proto +// Protobuf Java Version: 4.33.2 package com.google.iam.v1; @@ -28,13 +30,25 @@ * * Protobuf type {@code google.iam.v1.AuditConfigDelta} */ -public final class AuditConfigDelta extends com.google.protobuf.GeneratedMessageV3 +@com.google.protobuf.Generated +public final class AuditConfigDelta extends com.google.protobuf.GeneratedMessage implements // @@protoc_insertion_point(message_implements:google.iam.v1.AuditConfigDelta) AuditConfigDeltaOrBuilder { private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "AuditConfigDelta"); + } + // Use AuditConfigDelta.newBuilder() to construct. - private AuditConfigDelta(com.google.protobuf.GeneratedMessageV3.Builder builder) { + private AuditConfigDelta(com.google.protobuf.GeneratedMessage.Builder builder) { super(builder); } @@ -45,23 +59,12 @@ private AuditConfigDelta() { logType_ = ""; } - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new AuditConfigDelta(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.iam.v1.PolicyProto.internal_static_google_iam_v1_AuditConfigDelta_descriptor; } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.iam.v1.PolicyProto .internal_static_google_iam_v1_AuditConfigDelta_fieldAccessorTable @@ -113,6 +116,16 @@ public enum Action implements com.google.protobuf.ProtocolMessageEnum { UNRECOGNIZED(-1), ; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "Action"); + } + /** * * @@ -123,6 +136,7 @@ public enum Action implements com.google.protobuf.ProtocolMessageEnum { * ACTION_UNSPECIFIED = 0; */ public static final int ACTION_UNSPECIFIED_VALUE = 0; + /** * * @@ -133,6 +147,7 @@ public enum Action implements com.google.protobuf.ProtocolMessageEnum { * ADD = 1; */ public static final int ADD_VALUE = 1; + /** * * @@ -202,7 +217,7 @@ public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType return getDescriptor(); } - public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + public static com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { return com.google.iam.v1.AuditConfigDelta.getDescriptor().getEnumTypes().get(0); } @@ -228,7 +243,8 @@ private Action(int value) { } public static final int ACTION_FIELD_NUMBER = 1; - private int action_; + private int action_ = 0; + /** * * @@ -245,6 +261,7 @@ private Action(int value) { public int getActionValue() { return action_; } + /** * * @@ -259,14 +276,16 @@ public int getActionValue() { */ @java.lang.Override public com.google.iam.v1.AuditConfigDelta.Action getAction() { - @SuppressWarnings("deprecation") com.google.iam.v1.AuditConfigDelta.Action result = - com.google.iam.v1.AuditConfigDelta.Action.valueOf(action_); + com.google.iam.v1.AuditConfigDelta.Action.forNumber(action_); return result == null ? com.google.iam.v1.AuditConfigDelta.Action.UNRECOGNIZED : result; } public static final int SERVICE_FIELD_NUMBER = 2; - private volatile java.lang.Object service_; + + @SuppressWarnings("serial") + private volatile java.lang.Object service_ = ""; + /** * * @@ -293,6 +312,7 @@ public java.lang.String getService() { return s; } } + /** * * @@ -321,7 +341,10 @@ public com.google.protobuf.ByteString getServiceBytes() { } public static final int EXEMPTED_MEMBER_FIELD_NUMBER = 3; - private volatile java.lang.Object exemptedMember_; + + @SuppressWarnings("serial") + private volatile java.lang.Object exemptedMember_ = ""; + /** * * @@ -347,6 +370,7 @@ public java.lang.String getExemptedMember() { return s; } } + /** * * @@ -374,7 +398,10 @@ public com.google.protobuf.ByteString getExemptedMemberBytes() { } public static final int LOG_TYPE_FIELD_NUMBER = 4; - private volatile java.lang.Object logType_; + + @SuppressWarnings("serial") + private volatile java.lang.Object logType_ = ""; + /** * * @@ -400,6 +427,7 @@ public java.lang.String getLogType() { return s; } } + /** * * @@ -443,14 +471,14 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (action_ != com.google.iam.v1.AuditConfigDelta.Action.ACTION_UNSPECIFIED.getNumber()) { output.writeEnum(1, action_); } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(service_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 2, service_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(service_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, service_); } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(exemptedMember_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 3, exemptedMember_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(exemptedMember_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 3, exemptedMember_); } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(logType_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 4, logType_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(logType_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 4, logType_); } getUnknownFields().writeTo(output); } @@ -464,14 +492,14 @@ public int getSerializedSize() { if (action_ != com.google.iam.v1.AuditConfigDelta.Action.ACTION_UNSPECIFIED.getNumber()) { size += com.google.protobuf.CodedOutputStream.computeEnumSize(1, action_); } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(service_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, service_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(service_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, service_); } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(exemptedMember_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, exemptedMember_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(exemptedMember_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(3, exemptedMember_); } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(logType_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, logType_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(logType_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(4, logType_); } size += getUnknownFields().getSerializedSize(); memoizedSize = size; @@ -552,38 +580,38 @@ public static com.google.iam.v1.AuditConfigDelta parseFrom( public static com.google.iam.v1.AuditConfigDelta parseFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); } public static com.google.iam.v1.AuditConfigDelta parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } public static com.google.iam.v1.AuditConfigDelta parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); } public static com.google.iam.v1.AuditConfigDelta parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( PARSER, input, extensionRegistry); } public static com.google.iam.v1.AuditConfigDelta parseFrom( com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); } public static com.google.iam.v1.AuditConfigDelta parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } @@ -606,10 +634,11 @@ public Builder toBuilder() { } @java.lang.Override - protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { Builder builder = new Builder(parent); return builder; } + /** * * @@ -620,7 +649,7 @@ protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.Build * * Protobuf type {@code google.iam.v1.AuditConfigDelta} */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder implements // @@protoc_insertion_point(builder_implements:google.iam.v1.AuditConfigDelta) com.google.iam.v1.AuditConfigDeltaOrBuilder { @@ -630,7 +659,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.iam.v1.PolicyProto .internal_static_google_iam_v1_AuditConfigDelta_fieldAccessorTable @@ -642,21 +671,18 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { // Construct using com.google.iam.v1.AuditConfigDelta.newBuilder() private Builder() {} - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { super(parent); } @java.lang.Override public Builder clear() { super.clear(); + bitField0_ = 0; action_ = 0; - service_ = ""; - exemptedMember_ = ""; - logType_ = ""; - return this; } @@ -683,45 +709,27 @@ public com.google.iam.v1.AuditConfigDelta build() { @java.lang.Override public com.google.iam.v1.AuditConfigDelta buildPartial() { com.google.iam.v1.AuditConfigDelta result = new com.google.iam.v1.AuditConfigDelta(this); - result.action_ = action_; - result.service_ = service_; - result.exemptedMember_ = exemptedMember_; - result.logType_ = logType_; + if (bitField0_ != 0) { + buildPartial0(result); + } 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); + private void buildPartial0(com.google.iam.v1.AuditConfigDelta result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.action_ = action_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.service_ = service_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.exemptedMember_ = exemptedMember_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.logType_ = logType_; + } } @java.lang.Override @@ -741,14 +749,17 @@ public Builder mergeFrom(com.google.iam.v1.AuditConfigDelta other) { } if (!other.getService().isEmpty()) { service_ = other.service_; + bitField0_ |= 0x00000002; onChanged(); } if (!other.getExemptedMember().isEmpty()) { exemptedMember_ = other.exemptedMember_; + bitField0_ |= 0x00000004; onChanged(); } if (!other.getLogType().isEmpty()) { logType_ = other.logType_; + bitField0_ |= 0x00000008; onChanged(); } this.mergeUnknownFields(other.getUnknownFields()); @@ -780,25 +791,25 @@ public Builder mergeFrom( case 8: { action_ = input.readEnum(); - + bitField0_ |= 0x00000001; break; } // case 8 case 18: { service_ = input.readStringRequireUtf8(); - + bitField0_ |= 0x00000002; break; } // case 18 case 26: { exemptedMember_ = input.readStringRequireUtf8(); - + bitField0_ |= 0x00000004; break; } // case 26 case 34: { logType_ = input.readStringRequireUtf8(); - + bitField0_ |= 0x00000008; break; } // case 34 default: @@ -818,7 +829,10 @@ public Builder mergeFrom( return this; } + private int bitField0_; + private int action_ = 0; + /** * * @@ -835,6 +849,7 @@ public Builder mergeFrom( public int getActionValue() { return action_; } + /** * * @@ -849,11 +864,12 @@ public int getActionValue() { * @return This builder for chaining. */ public Builder setActionValue(int value) { - action_ = value; + bitField0_ |= 0x00000001; onChanged(); return this; } + /** * * @@ -868,11 +884,11 @@ public Builder setActionValue(int value) { */ @java.lang.Override public com.google.iam.v1.AuditConfigDelta.Action getAction() { - @SuppressWarnings("deprecation") com.google.iam.v1.AuditConfigDelta.Action result = - com.google.iam.v1.AuditConfigDelta.Action.valueOf(action_); + com.google.iam.v1.AuditConfigDelta.Action.forNumber(action_); return result == null ? com.google.iam.v1.AuditConfigDelta.Action.UNRECOGNIZED : result; } + /** * * @@ -890,11 +906,12 @@ public Builder setAction(com.google.iam.v1.AuditConfigDelta.Action value) { if (value == null) { throw new NullPointerException(); } - + bitField0_ |= 0x00000001; action_ = value.getNumber(); onChanged(); return this; } + /** * * @@ -908,13 +925,14 @@ public Builder setAction(com.google.iam.v1.AuditConfigDelta.Action value) { * @return This builder for chaining. */ public Builder clearAction() { - + bitField0_ = (bitField0_ & ~0x00000001); action_ = 0; onChanged(); return this; } private java.lang.Object service_ = ""; + /** * * @@ -940,6 +958,7 @@ public java.lang.String getService() { return (java.lang.String) ref; } } + /** * * @@ -965,6 +984,7 @@ public com.google.protobuf.ByteString getServiceBytes() { return (com.google.protobuf.ByteString) ref; } } + /** * * @@ -984,11 +1004,12 @@ public Builder setService(java.lang.String value) { if (value == null) { throw new NullPointerException(); } - service_ = value; + bitField0_ |= 0x00000002; onChanged(); return this; } + /** * * @@ -1004,11 +1025,12 @@ public Builder setService(java.lang.String value) { * @return This builder for chaining. */ public Builder clearService() { - service_ = getDefaultInstance().getService(); + bitField0_ = (bitField0_ & ~0x00000002); onChanged(); return this; } + /** * * @@ -1029,13 +1051,14 @@ public Builder setServiceBytes(com.google.protobuf.ByteString value) { throw new NullPointerException(); } checkByteStringIsUtf8(value); - service_ = value; + bitField0_ |= 0x00000002; onChanged(); return this; } private java.lang.Object exemptedMember_ = ""; + /** * * @@ -1060,6 +1083,7 @@ public java.lang.String getExemptedMember() { return (java.lang.String) ref; } } + /** * * @@ -1084,6 +1108,7 @@ public com.google.protobuf.ByteString getExemptedMemberBytes() { return (com.google.protobuf.ByteString) ref; } } + /** * * @@ -1102,11 +1127,12 @@ public Builder setExemptedMember(java.lang.String value) { if (value == null) { throw new NullPointerException(); } - exemptedMember_ = value; + bitField0_ |= 0x00000004; onChanged(); return this; } + /** * * @@ -1121,11 +1147,12 @@ public Builder setExemptedMember(java.lang.String value) { * @return This builder for chaining. */ public Builder clearExemptedMember() { - exemptedMember_ = getDefaultInstance().getExemptedMember(); + bitField0_ = (bitField0_ & ~0x00000004); onChanged(); return this; } + /** * * @@ -1145,13 +1172,14 @@ public Builder setExemptedMemberBytes(com.google.protobuf.ByteString value) { throw new NullPointerException(); } checkByteStringIsUtf8(value); - exemptedMember_ = value; + bitField0_ |= 0x00000004; onChanged(); return this; } private java.lang.Object logType_ = ""; + /** * * @@ -1176,6 +1204,7 @@ public java.lang.String getLogType() { return (java.lang.String) ref; } } + /** * * @@ -1200,6 +1229,7 @@ public com.google.protobuf.ByteString getLogTypeBytes() { return (com.google.protobuf.ByteString) ref; } } + /** * * @@ -1218,11 +1248,12 @@ public Builder setLogType(java.lang.String value) { if (value == null) { throw new NullPointerException(); } - logType_ = value; + bitField0_ |= 0x00000008; onChanged(); return this; } + /** * * @@ -1237,11 +1268,12 @@ public Builder setLogType(java.lang.String value) { * @return This builder for chaining. */ public Builder clearLogType() { - logType_ = getDefaultInstance().getLogType(); + bitField0_ = (bitField0_ & ~0x00000008); onChanged(); return this; } + /** * * @@ -1261,23 +1293,12 @@ public Builder setLogTypeBytes(com.google.protobuf.ByteString value) { throw new NullPointerException(); } checkByteStringIsUtf8(value); - logType_ = 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.iam.v1.AuditConfigDelta) } diff --git a/java-iam/proto-google-iam-v1/src/main/java/com/google/iam/v1/AuditConfigDeltaOrBuilder.java b/java-iam/proto-google-iam-v1/src/main/java/com/google/iam/v1/AuditConfigDeltaOrBuilder.java index e1bea6c244..5f6cb03c5c 100644 --- a/java-iam/proto-google-iam-v1/src/main/java/com/google/iam/v1/AuditConfigDeltaOrBuilder.java +++ b/java-iam/proto-google-iam-v1/src/main/java/com/google/iam/v1/AuditConfigDeltaOrBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,10 +14,13 @@ * limitations under the License. */ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: google/iam/v1/policy.proto +// Protobuf Java Version: 4.33.2 package com.google.iam.v1; +@com.google.protobuf.Generated public interface AuditConfigDeltaOrBuilder extends // @@protoc_insertion_point(interface_extends:google.iam.v1.AuditConfigDelta) @@ -36,6 +39,7 @@ public interface AuditConfigDeltaOrBuilder * @return The enum numeric value on the wire for action. */ int getActionValue(); + /** * * @@ -65,6 +69,7 @@ public interface AuditConfigDeltaOrBuilder * @return The service. */ java.lang.String getService(); + /** * * @@ -95,6 +100,7 @@ public interface AuditConfigDeltaOrBuilder * @return The exemptedMember. */ java.lang.String getExemptedMember(); + /** * * @@ -124,6 +130,7 @@ public interface AuditConfigDeltaOrBuilder * @return The logType. */ java.lang.String getLogType(); + /** * * diff --git a/java-iam/proto-google-iam-v1/src/main/java/com/google/iam/v1/AuditConfigOrBuilder.java b/java-iam/proto-google-iam-v1/src/main/java/com/google/iam/v1/AuditConfigOrBuilder.java index 06911aaf2b..57e9bc6de2 100644 --- a/java-iam/proto-google-iam-v1/src/main/java/com/google/iam/v1/AuditConfigOrBuilder.java +++ b/java-iam/proto-google-iam-v1/src/main/java/com/google/iam/v1/AuditConfigOrBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,10 +14,13 @@ * limitations under the License. */ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: google/iam/v1/policy.proto +// Protobuf Java Version: 4.33.2 package com.google.iam.v1; +@com.google.protobuf.Generated public interface AuditConfigOrBuilder extends // @@protoc_insertion_point(interface_extends:google.iam.v1.AuditConfig) @@ -37,6 +40,7 @@ public interface AuditConfigOrBuilder * @return The service. */ java.lang.String getService(); + /** * * @@ -62,6 +66,7 @@ public interface AuditConfigOrBuilder * repeated .google.iam.v1.AuditLogConfig audit_log_configs = 3; */ java.util.List getAuditLogConfigsList(); + /** * * @@ -72,6 +77,7 @@ public interface AuditConfigOrBuilder * repeated .google.iam.v1.AuditLogConfig audit_log_configs = 3; */ com.google.iam.v1.AuditLogConfig getAuditLogConfigs(int index); + /** * * @@ -82,6 +88,7 @@ public interface AuditConfigOrBuilder * repeated .google.iam.v1.AuditLogConfig audit_log_configs = 3; */ int getAuditLogConfigsCount(); + /** * * @@ -93,6 +100,7 @@ public interface AuditConfigOrBuilder */ java.util.List getAuditLogConfigsOrBuilderList(); + /** * * diff --git a/java-iam/proto-google-iam-v1/src/main/java/com/google/iam/v1/AuditLogConfig.java b/java-iam/proto-google-iam-v1/src/main/java/com/google/iam/v1/AuditLogConfig.java index 645f2c04db..223226418f 100644 --- a/java-iam/proto-google-iam-v1/src/main/java/com/google/iam/v1/AuditLogConfig.java +++ b/java-iam/proto-google-iam-v1/src/main/java/com/google/iam/v1/AuditLogConfig.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,9 @@ * limitations under the License. */ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: google/iam/v1/policy.proto +// Protobuf Java Version: 4.33.2 package com.google.iam.v1; @@ -24,49 +26,52 @@ *
          * Provides the configuration for logging a type of permissions.
          * Example:
        - *     {
        - *       "audit_log_configs": [
        - *         {
        - *           "log_type": "DATA_READ",
        - *           "exempted_members": [
        - *             "user:jose@example.com"
        - *           ]
        - *         },
        - *         {
        - *           "log_type": "DATA_WRITE"
        - *         }
        - *       ]
        - *     }
        + *
        + * {
        + * "audit_log_configs": [
        + * {
        + * "log_type": "DATA_READ",
        + * "exempted_members": [
        + * "user:jose@example.com"
        + * ]
        + * },
        + * {
        + * "log_type": "DATA_WRITE"
        + * }
        + * ]
        + * }
        + *
          * This enables 'DATA_READ' and 'DATA_WRITE' logging, while exempting
          * jose@example.com from DATA_READ logging.
          * 
        * * Protobuf type {@code google.iam.v1.AuditLogConfig} */ -public final class AuditLogConfig extends com.google.protobuf.GeneratedMessageV3 +@com.google.protobuf.Generated +public final class AuditLogConfig extends com.google.protobuf.GeneratedMessage implements // @@protoc_insertion_point(message_implements:google.iam.v1.AuditLogConfig) AuditLogConfigOrBuilder { private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "AuditLogConfig"); + } + // Use AuditLogConfig.newBuilder() to construct. - private AuditLogConfig(com.google.protobuf.GeneratedMessageV3.Builder builder) { + private AuditLogConfig(com.google.protobuf.GeneratedMessage.Builder builder) { super(builder); } private AuditLogConfig() { logType_ = 0; - exemptedMembers_ = com.google.protobuf.LazyStringArrayList.EMPTY; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new AuditLogConfig(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; + exemptedMembers_ = com.google.protobuf.LazyStringArrayList.emptyList(); } public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { @@ -74,7 +79,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.iam.v1.PolicyProto .internal_static_google_iam_v1_AuditLogConfig_fieldAccessorTable @@ -136,6 +141,16 @@ public enum LogType implements com.google.protobuf.ProtocolMessageEnum { UNRECOGNIZED(-1), ; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "LogType"); + } + /** * * @@ -146,6 +161,7 @@ public enum LogType implements com.google.protobuf.ProtocolMessageEnum { * LOG_TYPE_UNSPECIFIED = 0; */ public static final int LOG_TYPE_UNSPECIFIED_VALUE = 0; + /** * * @@ -156,6 +172,7 @@ public enum LogType implements com.google.protobuf.ProtocolMessageEnum { * ADMIN_READ = 1; */ public static final int ADMIN_READ_VALUE = 1; + /** * * @@ -166,6 +183,7 @@ public enum LogType implements com.google.protobuf.ProtocolMessageEnum { * DATA_WRITE = 2; */ public static final int DATA_WRITE_VALUE = 2; + /** * * @@ -237,7 +255,7 @@ public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType return getDescriptor(); } - public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + public static com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { return com.google.iam.v1.AuditLogConfig.getDescriptor().getEnumTypes().get(0); } @@ -263,7 +281,8 @@ private LogType(int value) { } public static final int LOG_TYPE_FIELD_NUMBER = 1; - private int logType_; + private int logType_ = 0; + /** * * @@ -279,6 +298,7 @@ private LogType(int value) { public int getLogTypeValue() { return logType_; } + /** * * @@ -292,21 +312,25 @@ public int getLogTypeValue() { */ @java.lang.Override public com.google.iam.v1.AuditLogConfig.LogType getLogType() { - @SuppressWarnings("deprecation") com.google.iam.v1.AuditLogConfig.LogType result = - com.google.iam.v1.AuditLogConfig.LogType.valueOf(logType_); + com.google.iam.v1.AuditLogConfig.LogType.forNumber(logType_); return result == null ? com.google.iam.v1.AuditLogConfig.LogType.UNRECOGNIZED : result; } public static final int EXEMPTED_MEMBERS_FIELD_NUMBER = 2; - private com.google.protobuf.LazyStringList exemptedMembers_; + + @SuppressWarnings("serial") + private com.google.protobuf.LazyStringArrayList exemptedMembers_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + /** * * *
            * Specifies the identities that do not cause logging for this type of
            * permission.
        -   * Follows the same format of [Binding.members][google.iam.v1.Binding.members].
        +   * Follows the same format of
        +   * [Binding.members][google.iam.v1.Binding.members].
            * 
        * * repeated string exempted_members = 2; @@ -316,13 +340,15 @@ public com.google.iam.v1.AuditLogConfig.LogType getLogType() { public com.google.protobuf.ProtocolStringList getExemptedMembersList() { return exemptedMembers_; } + /** * * *
            * Specifies the identities that do not cause logging for this type of
            * permission.
        -   * Follows the same format of [Binding.members][google.iam.v1.Binding.members].
        +   * Follows the same format of
        +   * [Binding.members][google.iam.v1.Binding.members].
            * 
        * * repeated string exempted_members = 2; @@ -332,13 +358,15 @@ public com.google.protobuf.ProtocolStringList getExemptedMembersList() { public int getExemptedMembersCount() { return exemptedMembers_.size(); } + /** * * *
            * Specifies the identities that do not cause logging for this type of
            * permission.
        -   * Follows the same format of [Binding.members][google.iam.v1.Binding.members].
        +   * Follows the same format of
        +   * [Binding.members][google.iam.v1.Binding.members].
            * 
        * * repeated string exempted_members = 2; @@ -349,13 +377,15 @@ public int getExemptedMembersCount() { public java.lang.String getExemptedMembers(int index) { return exemptedMembers_.get(index); } + /** * * *
            * Specifies the identities that do not cause logging for this type of
            * permission.
        -   * Follows the same format of [Binding.members][google.iam.v1.Binding.members].
        +   * Follows the same format of
        +   * [Binding.members][google.iam.v1.Binding.members].
            * 
        * * repeated string exempted_members = 2; @@ -385,7 +415,7 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io output.writeEnum(1, logType_); } for (int i = 0; i < exemptedMembers_.size(); i++) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 2, exemptedMembers_.getRaw(i)); + com.google.protobuf.GeneratedMessage.writeString(output, 2, exemptedMembers_.getRaw(i)); } getUnknownFields().writeTo(output); } @@ -482,38 +512,38 @@ public static com.google.iam.v1.AuditLogConfig parseFrom( public static com.google.iam.v1.AuditLogConfig parseFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); } public static com.google.iam.v1.AuditLogConfig parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } public static com.google.iam.v1.AuditLogConfig parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); } public static com.google.iam.v1.AuditLogConfig parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( PARSER, input, extensionRegistry); } public static com.google.iam.v1.AuditLogConfig parseFrom( com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); } public static com.google.iam.v1.AuditLogConfig parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } @@ -536,36 +566,39 @@ public Builder toBuilder() { } @java.lang.Override - protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { Builder builder = new Builder(parent); return builder; } + /** * * *
            * Provides the configuration for logging a type of permissions.
            * Example:
        -   *     {
        -   *       "audit_log_configs": [
        -   *         {
        -   *           "log_type": "DATA_READ",
        -   *           "exempted_members": [
        -   *             "user:jose@example.com"
        -   *           ]
        -   *         },
        -   *         {
        -   *           "log_type": "DATA_WRITE"
        -   *         }
        -   *       ]
        -   *     }
        +   *
        +   * {
        +   * "audit_log_configs": [
        +   * {
        +   * "log_type": "DATA_READ",
        +   * "exempted_members": [
        +   * "user:jose@example.com"
        +   * ]
        +   * },
        +   * {
        +   * "log_type": "DATA_WRITE"
        +   * }
        +   * ]
        +   * }
        +   *
            * This enables 'DATA_READ' and 'DATA_WRITE' logging, while exempting
            * jose@example.com from DATA_READ logging.
            * 
        * * Protobuf type {@code google.iam.v1.AuditLogConfig} */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder implements // @@protoc_insertion_point(builder_implements:google.iam.v1.AuditLogConfig) com.google.iam.v1.AuditLogConfigOrBuilder { @@ -574,7 +607,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.iam.v1.PolicyProto .internal_static_google_iam_v1_AuditLogConfig_fieldAccessorTable @@ -586,17 +619,16 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { // Construct using com.google.iam.v1.AuditLogConfig.newBuilder() private Builder() {} - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { super(parent); } @java.lang.Override public Builder clear() { super.clear(); + bitField0_ = 0; logType_ = 0; - - exemptedMembers_ = com.google.protobuf.LazyStringArrayList.EMPTY; - bitField0_ = (bitField0_ & ~0x00000001); + exemptedMembers_ = com.google.protobuf.LazyStringArrayList.emptyList(); return this; } @@ -622,48 +654,22 @@ public com.google.iam.v1.AuditLogConfig build() { @java.lang.Override public com.google.iam.v1.AuditLogConfig buildPartial() { com.google.iam.v1.AuditLogConfig result = new com.google.iam.v1.AuditLogConfig(this); - int from_bitField0_ = bitField0_; - result.logType_ = logType_; - if (((bitField0_ & 0x00000001) != 0)) { - exemptedMembers_ = exemptedMembers_.getUnmodifiableView(); - bitField0_ = (bitField0_ & ~0x00000001); + if (bitField0_ != 0) { + buildPartial0(result); } - result.exemptedMembers_ = exemptedMembers_; 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); + private void buildPartial0(com.google.iam.v1.AuditLogConfig result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.logType_ = logType_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + exemptedMembers_.makeImmutable(); + result.exemptedMembers_ = exemptedMembers_; + } } @java.lang.Override @@ -684,7 +690,7 @@ public Builder mergeFrom(com.google.iam.v1.AuditLogConfig other) { if (!other.exemptedMembers_.isEmpty()) { if (exemptedMembers_.isEmpty()) { exemptedMembers_ = other.exemptedMembers_; - bitField0_ = (bitField0_ & ~0x00000001); + bitField0_ |= 0x00000002; } else { ensureExemptedMembersIsMutable(); exemptedMembers_.addAll(other.exemptedMembers_); @@ -720,7 +726,7 @@ public Builder mergeFrom( case 8: { logType_ = input.readEnum(); - + bitField0_ |= 0x00000001; break; } // case 8 case 18: @@ -750,6 +756,7 @@ public Builder mergeFrom( private int bitField0_; private int logType_ = 0; + /** * * @@ -765,6 +772,7 @@ public Builder mergeFrom( public int getLogTypeValue() { return logType_; } + /** * * @@ -778,11 +786,12 @@ public int getLogTypeValue() { * @return This builder for chaining. */ public Builder setLogTypeValue(int value) { - logType_ = value; + bitField0_ |= 0x00000001; onChanged(); return this; } + /** * * @@ -796,11 +805,11 @@ public Builder setLogTypeValue(int value) { */ @java.lang.Override public com.google.iam.v1.AuditLogConfig.LogType getLogType() { - @SuppressWarnings("deprecation") com.google.iam.v1.AuditLogConfig.LogType result = - com.google.iam.v1.AuditLogConfig.LogType.valueOf(logType_); + com.google.iam.v1.AuditLogConfig.LogType.forNumber(logType_); return result == null ? com.google.iam.v1.AuditLogConfig.LogType.UNRECOGNIZED : result; } + /** * * @@ -817,11 +826,12 @@ public Builder setLogType(com.google.iam.v1.AuditLogConfig.LogType value) { if (value == null) { throw new NullPointerException(); } - + bitField0_ |= 0x00000001; logType_ = value.getNumber(); onChanged(); return this; } + /** * * @@ -834,28 +844,30 @@ public Builder setLogType(com.google.iam.v1.AuditLogConfig.LogType value) { * @return This builder for chaining. */ public Builder clearLogType() { - + bitField0_ = (bitField0_ & ~0x00000001); logType_ = 0; onChanged(); return this; } - private com.google.protobuf.LazyStringList exemptedMembers_ = - com.google.protobuf.LazyStringArrayList.EMPTY; + private com.google.protobuf.LazyStringArrayList exemptedMembers_ = + com.google.protobuf.LazyStringArrayList.emptyList(); private void ensureExemptedMembersIsMutable() { - if (!((bitField0_ & 0x00000001) != 0)) { + if (!exemptedMembers_.isModifiable()) { exemptedMembers_ = new com.google.protobuf.LazyStringArrayList(exemptedMembers_); - bitField0_ |= 0x00000001; } + bitField0_ |= 0x00000002; } + /** * * *
              * Specifies the identities that do not cause logging for this type of
              * permission.
        -     * Follows the same format of [Binding.members][google.iam.v1.Binding.members].
        +     * Follows the same format of
        +     * [Binding.members][google.iam.v1.Binding.members].
              * 
        * * repeated string exempted_members = 2; @@ -863,15 +875,18 @@ private void ensureExemptedMembersIsMutable() { * @return A list containing the exemptedMembers. */ public com.google.protobuf.ProtocolStringList getExemptedMembersList() { - return exemptedMembers_.getUnmodifiableView(); + exemptedMembers_.makeImmutable(); + return exemptedMembers_; } + /** * * *
              * Specifies the identities that do not cause logging for this type of
              * permission.
        -     * Follows the same format of [Binding.members][google.iam.v1.Binding.members].
        +     * Follows the same format of
        +     * [Binding.members][google.iam.v1.Binding.members].
              * 
        * * repeated string exempted_members = 2; @@ -881,13 +896,15 @@ public com.google.protobuf.ProtocolStringList getExemptedMembersList() { public int getExemptedMembersCount() { return exemptedMembers_.size(); } + /** * * *
              * Specifies the identities that do not cause logging for this type of
              * permission.
        -     * Follows the same format of [Binding.members][google.iam.v1.Binding.members].
        +     * Follows the same format of
        +     * [Binding.members][google.iam.v1.Binding.members].
              * 
        * * repeated string exempted_members = 2; @@ -898,13 +915,15 @@ public int getExemptedMembersCount() { public java.lang.String getExemptedMembers(int index) { return exemptedMembers_.get(index); } + /** * * *
              * Specifies the identities that do not cause logging for this type of
              * permission.
        -     * Follows the same format of [Binding.members][google.iam.v1.Binding.members].
        +     * Follows the same format of
        +     * [Binding.members][google.iam.v1.Binding.members].
              * 
        * * repeated string exempted_members = 2; @@ -915,13 +934,15 @@ public java.lang.String getExemptedMembers(int index) { public com.google.protobuf.ByteString getExemptedMembersBytes(int index) { return exemptedMembers_.getByteString(index); } + /** * * *
              * Specifies the identities that do not cause logging for this type of
              * permission.
        -     * Follows the same format of [Binding.members][google.iam.v1.Binding.members].
        +     * Follows the same format of
        +     * [Binding.members][google.iam.v1.Binding.members].
              * 
        * * repeated string exempted_members = 2; @@ -936,16 +957,19 @@ public Builder setExemptedMembers(int index, java.lang.String value) { } ensureExemptedMembersIsMutable(); exemptedMembers_.set(index, value); + bitField0_ |= 0x00000002; onChanged(); return this; } + /** * * *
              * Specifies the identities that do not cause logging for this type of
              * permission.
        -     * Follows the same format of [Binding.members][google.iam.v1.Binding.members].
        +     * Follows the same format of
        +     * [Binding.members][google.iam.v1.Binding.members].
              * 
        * * repeated string exempted_members = 2; @@ -959,16 +983,19 @@ public Builder addExemptedMembers(java.lang.String value) { } ensureExemptedMembersIsMutable(); exemptedMembers_.add(value); + bitField0_ |= 0x00000002; onChanged(); return this; } + /** * * *
              * Specifies the identities that do not cause logging for this type of
              * permission.
        -     * Follows the same format of [Binding.members][google.iam.v1.Binding.members].
        +     * Follows the same format of
        +     * [Binding.members][google.iam.v1.Binding.members].
              * 
        * * repeated string exempted_members = 2; @@ -979,16 +1006,19 @@ public Builder addExemptedMembers(java.lang.String value) { public Builder addAllExemptedMembers(java.lang.Iterable values) { ensureExemptedMembersIsMutable(); com.google.protobuf.AbstractMessageLite.Builder.addAll(values, exemptedMembers_); + bitField0_ |= 0x00000002; onChanged(); return this; } + /** * * *
              * Specifies the identities that do not cause logging for this type of
              * permission.
        -     * Follows the same format of [Binding.members][google.iam.v1.Binding.members].
        +     * Follows the same format of
        +     * [Binding.members][google.iam.v1.Binding.members].
              * 
        * * repeated string exempted_members = 2; @@ -996,18 +1026,21 @@ public Builder addAllExemptedMembers(java.lang.Iterable values * @return This builder for chaining. */ public Builder clearExemptedMembers() { - exemptedMembers_ = com.google.protobuf.LazyStringArrayList.EMPTY; - bitField0_ = (bitField0_ & ~0x00000001); + exemptedMembers_ = com.google.protobuf.LazyStringArrayList.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + ; onChanged(); return this; } + /** * * *
              * Specifies the identities that do not cause logging for this type of
              * permission.
        -     * Follows the same format of [Binding.members][google.iam.v1.Binding.members].
        +     * Follows the same format of
        +     * [Binding.members][google.iam.v1.Binding.members].
              * 
        * * repeated string exempted_members = 2; @@ -1022,21 +1055,11 @@ public Builder addExemptedMembersBytes(com.google.protobuf.ByteString value) { checkByteStringIsUtf8(value); ensureExemptedMembersIsMutable(); exemptedMembers_.add(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.iam.v1.AuditLogConfig) } diff --git a/java-iam/proto-google-iam-v1/src/main/java/com/google/iam/v1/AuditLogConfigOrBuilder.java b/java-iam/proto-google-iam-v1/src/main/java/com/google/iam/v1/AuditLogConfigOrBuilder.java index c6371c5c0a..d5d4600b5f 100644 --- a/java-iam/proto-google-iam-v1/src/main/java/com/google/iam/v1/AuditLogConfigOrBuilder.java +++ b/java-iam/proto-google-iam-v1/src/main/java/com/google/iam/v1/AuditLogConfigOrBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,10 +14,13 @@ * limitations under the License. */ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: google/iam/v1/policy.proto +// Protobuf Java Version: 4.33.2 package com.google.iam.v1; +@com.google.protobuf.Generated public interface AuditLogConfigOrBuilder extends // @@protoc_insertion_point(interface_extends:google.iam.v1.AuditLogConfig) @@ -35,6 +38,7 @@ public interface AuditLogConfigOrBuilder * @return The enum numeric value on the wire for logType. */ int getLogTypeValue(); + /** * * @@ -54,7 +58,8 @@ public interface AuditLogConfigOrBuilder *
            * Specifies the identities that do not cause logging for this type of
            * permission.
        -   * Follows the same format of [Binding.members][google.iam.v1.Binding.members].
        +   * Follows the same format of
        +   * [Binding.members][google.iam.v1.Binding.members].
            * 
        * * repeated string exempted_members = 2; @@ -62,13 +67,15 @@ public interface AuditLogConfigOrBuilder * @return A list containing the exemptedMembers. */ java.util.List getExemptedMembersList(); + /** * * *
            * Specifies the identities that do not cause logging for this type of
            * permission.
        -   * Follows the same format of [Binding.members][google.iam.v1.Binding.members].
        +   * Follows the same format of
        +   * [Binding.members][google.iam.v1.Binding.members].
            * 
        * * repeated string exempted_members = 2; @@ -76,13 +83,15 @@ public interface AuditLogConfigOrBuilder * @return The count of exemptedMembers. */ int getExemptedMembersCount(); + /** * * *
            * Specifies the identities that do not cause logging for this type of
            * permission.
        -   * Follows the same format of [Binding.members][google.iam.v1.Binding.members].
        +   * Follows the same format of
        +   * [Binding.members][google.iam.v1.Binding.members].
            * 
        * * repeated string exempted_members = 2; @@ -91,13 +100,15 @@ public interface AuditLogConfigOrBuilder * @return The exemptedMembers at the given index. */ java.lang.String getExemptedMembers(int index); + /** * * *
            * Specifies the identities that do not cause logging for this type of
            * permission.
        -   * Follows the same format of [Binding.members][google.iam.v1.Binding.members].
        +   * Follows the same format of
        +   * [Binding.members][google.iam.v1.Binding.members].
            * 
        * * repeated string exempted_members = 2; diff --git a/java-iam/proto-google-iam-v1/src/main/java/com/google/iam/v1/Binding.java b/java-iam/proto-google-iam-v1/src/main/java/com/google/iam/v1/Binding.java index d4cb1d80f7..ff2b728224 100644 --- a/java-iam/proto-google-iam-v1/src/main/java/com/google/iam/v1/Binding.java +++ b/java-iam/proto-google-iam-v1/src/main/java/com/google/iam/v1/Binding.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,9 @@ * limitations under the License. */ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: google/iam/v1/policy.proto +// Protobuf Java Version: 4.33.2 package com.google.iam.v1; @@ -27,30 +29,31 @@ * * Protobuf type {@code google.iam.v1.Binding} */ -public final class Binding extends com.google.protobuf.GeneratedMessageV3 +@com.google.protobuf.Generated +public final class Binding extends com.google.protobuf.GeneratedMessage implements // @@protoc_insertion_point(message_implements:google.iam.v1.Binding) BindingOrBuilder { private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "Binding"); + } + // Use Binding.newBuilder() to construct. - private Binding(com.google.protobuf.GeneratedMessageV3.Builder builder) { + private Binding(com.google.protobuf.GeneratedMessage.Builder builder) { super(builder); } private Binding() { role_ = ""; - members_ = com.google.protobuf.LazyStringArrayList.EMPTY; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new Binding(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; + members_ = com.google.protobuf.LazyStringArrayList.emptyList(); } public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { @@ -58,15 +61,19 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.iam.v1.PolicyProto.internal_static_google_iam_v1_Binding_fieldAccessorTable .ensureFieldAccessorsInitialized( com.google.iam.v1.Binding.class, com.google.iam.v1.Binding.Builder.class); } + private int bitField0_; public static final int ROLE_FIELD_NUMBER = 1; - private volatile java.lang.Object role_; + + @SuppressWarnings("serial") + private volatile java.lang.Object role_ = ""; + /** * * @@ -91,6 +98,7 @@ public java.lang.String getRole() { return s; } } + /** * * @@ -117,42 +125,57 @@ public com.google.protobuf.ByteString getRoleBytes() { } public static final int MEMBERS_FIELD_NUMBER = 2; - private com.google.protobuf.LazyStringList members_; + + @SuppressWarnings("serial") + private com.google.protobuf.LazyStringArrayList members_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + /** * * *
        -   * Specifies the principals requesting access for a Cloud Platform resource.
        +   * Specifies the principals requesting access for a Google Cloud resource.
            * `members` can have the following values:
        +   *
            * * `allUsers`: A special identifier that represents anyone who is
        -   *    on the internet; with or without a Google account.
        +   * on the internet; with or without a Google account.
        +   *
            * * `allAuthenticatedUsers`: A special identifier that represents anyone
        -   *    who is authenticated with a Google account or a service account.
        +   * who is authenticated with a Google account or a service account.
        +   *
            * * `user:{emailid}`: An email address that represents a specific Google
        -   *    account. For example, `alice@example.com` .
        +   * account. For example, `alice@example.com` .
        +   *
        +   *
            * * `serviceAccount:{emailid}`: An email address that represents a service
        -   *    account. For example, `my-other-app@appspot.gserviceaccount.com`.
        +   * account. For example, `my-other-app@appspot.gserviceaccount.com`.
        +   *
            * * `group:{emailid}`: An email address that represents a Google group.
        -   *    For example, `admins@example.com`.
        +   * For example, `admins@example.com`.
        +   *
            * * `deleted:user:{emailid}?uid={uniqueid}`: An email address (plus unique
        -   *    identifier) representing a user that has been recently deleted. For
        -   *    example, `alice@example.com?uid=123456789012345678901`. If the user is
        -   *    recovered, this value reverts to `user:{emailid}` and the recovered user
        -   *    retains the role in the binding.
        +   * identifier) representing a user that has been recently deleted. For
        +   * example, `alice@example.com?uid=123456789012345678901`. If the user is
        +   * recovered, this value reverts to `user:{emailid}` and the recovered user
        +   * retains the role in the binding.
        +   *
            * * `deleted:serviceAccount:{emailid}?uid={uniqueid}`: An email address (plus
        -   *    unique identifier) representing a service account that has been recently
        -   *    deleted. For example,
        -   *    `my-other-app@appspot.gserviceaccount.com?uid=123456789012345678901`.
        -   *    If the service account is undeleted, this value reverts to
        -   *    `serviceAccount:{emailid}` and the undeleted service account retains the
        -   *    role in the binding.
        +   * unique identifier) representing a service account that has been recently
        +   * deleted. For example,
        +   * `my-other-app@appspot.gserviceaccount.com?uid=123456789012345678901`.
        +   * If the service account is undeleted, this value reverts to
        +   * `serviceAccount:{emailid}` and the undeleted service account retains the
        +   * role in the binding.
        +   *
            * * `deleted:group:{emailid}?uid={uniqueid}`: An email address (plus unique
        -   *    identifier) representing a Google group that has been recently
        -   *    deleted. For example, `admins@example.com?uid=123456789012345678901`. If
        -   *    the group is recovered, this value reverts to `group:{emailid}` and the
        -   *    recovered group retains the role in the binding.
        +   * identifier) representing a Google group that has been recently
        +   * deleted. For example, `admins@example.com?uid=123456789012345678901`. If
        +   * the group is recovered, this value reverts to `group:{emailid}` and the
        +   * recovered group retains the role in the binding.
        +   *
        +   *
            * * `domain:{domain}`: The G Suite domain (primary) that represents all the
        -   *    users of that domain. For example, `google.com` or `example.com`.
        +   * users of that domain. For example, `google.com` or `example.com`.
            * 
        * * repeated string members = 2; @@ -162,41 +185,53 @@ public com.google.protobuf.ByteString getRoleBytes() { public com.google.protobuf.ProtocolStringList getMembersList() { return members_; } + /** * * *
        -   * Specifies the principals requesting access for a Cloud Platform resource.
        +   * Specifies the principals requesting access for a Google Cloud resource.
            * `members` can have the following values:
        +   *
            * * `allUsers`: A special identifier that represents anyone who is
        -   *    on the internet; with or without a Google account.
        +   * on the internet; with or without a Google account.
        +   *
            * * `allAuthenticatedUsers`: A special identifier that represents anyone
        -   *    who is authenticated with a Google account or a service account.
        +   * who is authenticated with a Google account or a service account.
        +   *
            * * `user:{emailid}`: An email address that represents a specific Google
        -   *    account. For example, `alice@example.com` .
        +   * account. For example, `alice@example.com` .
        +   *
        +   *
            * * `serviceAccount:{emailid}`: An email address that represents a service
        -   *    account. For example, `my-other-app@appspot.gserviceaccount.com`.
        +   * account. For example, `my-other-app@appspot.gserviceaccount.com`.
        +   *
            * * `group:{emailid}`: An email address that represents a Google group.
        -   *    For example, `admins@example.com`.
        +   * For example, `admins@example.com`.
        +   *
            * * `deleted:user:{emailid}?uid={uniqueid}`: An email address (plus unique
        -   *    identifier) representing a user that has been recently deleted. For
        -   *    example, `alice@example.com?uid=123456789012345678901`. If the user is
        -   *    recovered, this value reverts to `user:{emailid}` and the recovered user
        -   *    retains the role in the binding.
        +   * identifier) representing a user that has been recently deleted. For
        +   * example, `alice@example.com?uid=123456789012345678901`. If the user is
        +   * recovered, this value reverts to `user:{emailid}` and the recovered user
        +   * retains the role in the binding.
        +   *
            * * `deleted:serviceAccount:{emailid}?uid={uniqueid}`: An email address (plus
        -   *    unique identifier) representing a service account that has been recently
        -   *    deleted. For example,
        -   *    `my-other-app@appspot.gserviceaccount.com?uid=123456789012345678901`.
        -   *    If the service account is undeleted, this value reverts to
        -   *    `serviceAccount:{emailid}` and the undeleted service account retains the
        -   *    role in the binding.
        +   * unique identifier) representing a service account that has been recently
        +   * deleted. For example,
        +   * `my-other-app@appspot.gserviceaccount.com?uid=123456789012345678901`.
        +   * If the service account is undeleted, this value reverts to
        +   * `serviceAccount:{emailid}` and the undeleted service account retains the
        +   * role in the binding.
        +   *
            * * `deleted:group:{emailid}?uid={uniqueid}`: An email address (plus unique
        -   *    identifier) representing a Google group that has been recently
        -   *    deleted. For example, `admins@example.com?uid=123456789012345678901`. If
        -   *    the group is recovered, this value reverts to `group:{emailid}` and the
        -   *    recovered group retains the role in the binding.
        +   * identifier) representing a Google group that has been recently
        +   * deleted. For example, `admins@example.com?uid=123456789012345678901`. If
        +   * the group is recovered, this value reverts to `group:{emailid}` and the
        +   * recovered group retains the role in the binding.
        +   *
        +   *
            * * `domain:{domain}`: The G Suite domain (primary) that represents all the
        -   *    users of that domain. For example, `google.com` or `example.com`.
        +   * users of that domain. For example, `google.com` or `example.com`.
            * 
        * * repeated string members = 2; @@ -206,41 +241,53 @@ public com.google.protobuf.ProtocolStringList getMembersList() { public int getMembersCount() { return members_.size(); } + /** * * *
        -   * Specifies the principals requesting access for a Cloud Platform resource.
        +   * Specifies the principals requesting access for a Google Cloud resource.
            * `members` can have the following values:
        +   *
            * * `allUsers`: A special identifier that represents anyone who is
        -   *    on the internet; with or without a Google account.
        +   * on the internet; with or without a Google account.
        +   *
            * * `allAuthenticatedUsers`: A special identifier that represents anyone
        -   *    who is authenticated with a Google account or a service account.
        +   * who is authenticated with a Google account or a service account.
        +   *
            * * `user:{emailid}`: An email address that represents a specific Google
        -   *    account. For example, `alice@example.com` .
        +   * account. For example, `alice@example.com` .
        +   *
        +   *
            * * `serviceAccount:{emailid}`: An email address that represents a service
        -   *    account. For example, `my-other-app@appspot.gserviceaccount.com`.
        +   * account. For example, `my-other-app@appspot.gserviceaccount.com`.
        +   *
            * * `group:{emailid}`: An email address that represents a Google group.
        -   *    For example, `admins@example.com`.
        +   * For example, `admins@example.com`.
        +   *
            * * `deleted:user:{emailid}?uid={uniqueid}`: An email address (plus unique
        -   *    identifier) representing a user that has been recently deleted. For
        -   *    example, `alice@example.com?uid=123456789012345678901`. If the user is
        -   *    recovered, this value reverts to `user:{emailid}` and the recovered user
        -   *    retains the role in the binding.
        +   * identifier) representing a user that has been recently deleted. For
        +   * example, `alice@example.com?uid=123456789012345678901`. If the user is
        +   * recovered, this value reverts to `user:{emailid}` and the recovered user
        +   * retains the role in the binding.
        +   *
            * * `deleted:serviceAccount:{emailid}?uid={uniqueid}`: An email address (plus
        -   *    unique identifier) representing a service account that has been recently
        -   *    deleted. For example,
        -   *    `my-other-app@appspot.gserviceaccount.com?uid=123456789012345678901`.
        -   *    If the service account is undeleted, this value reverts to
        -   *    `serviceAccount:{emailid}` and the undeleted service account retains the
        -   *    role in the binding.
        +   * unique identifier) representing a service account that has been recently
        +   * deleted. For example,
        +   * `my-other-app@appspot.gserviceaccount.com?uid=123456789012345678901`.
        +   * If the service account is undeleted, this value reverts to
        +   * `serviceAccount:{emailid}` and the undeleted service account retains the
        +   * role in the binding.
        +   *
            * * `deleted:group:{emailid}?uid={uniqueid}`: An email address (plus unique
        -   *    identifier) representing a Google group that has been recently
        -   *    deleted. For example, `admins@example.com?uid=123456789012345678901`. If
        -   *    the group is recovered, this value reverts to `group:{emailid}` and the
        -   *    recovered group retains the role in the binding.
        +   * identifier) representing a Google group that has been recently
        +   * deleted. For example, `admins@example.com?uid=123456789012345678901`. If
        +   * the group is recovered, this value reverts to `group:{emailid}` and the
        +   * recovered group retains the role in the binding.
        +   *
        +   *
            * * `domain:{domain}`: The G Suite domain (primary) that represents all the
        -   *    users of that domain. For example, `google.com` or `example.com`.
        +   * users of that domain. For example, `google.com` or `example.com`.
            * 
        * * repeated string members = 2; @@ -251,41 +298,53 @@ public int getMembersCount() { public java.lang.String getMembers(int index) { return members_.get(index); } + /** * * *
        -   * Specifies the principals requesting access for a Cloud Platform resource.
        +   * Specifies the principals requesting access for a Google Cloud resource.
            * `members` can have the following values:
        +   *
            * * `allUsers`: A special identifier that represents anyone who is
        -   *    on the internet; with or without a Google account.
        +   * on the internet; with or without a Google account.
        +   *
            * * `allAuthenticatedUsers`: A special identifier that represents anyone
        -   *    who is authenticated with a Google account or a service account.
        +   * who is authenticated with a Google account or a service account.
        +   *
            * * `user:{emailid}`: An email address that represents a specific Google
        -   *    account. For example, `alice@example.com` .
        +   * account. For example, `alice@example.com` .
        +   *
        +   *
            * * `serviceAccount:{emailid}`: An email address that represents a service
        -   *    account. For example, `my-other-app@appspot.gserviceaccount.com`.
        +   * account. For example, `my-other-app@appspot.gserviceaccount.com`.
        +   *
            * * `group:{emailid}`: An email address that represents a Google group.
        -   *    For example, `admins@example.com`.
        +   * For example, `admins@example.com`.
        +   *
            * * `deleted:user:{emailid}?uid={uniqueid}`: An email address (plus unique
        -   *    identifier) representing a user that has been recently deleted. For
        -   *    example, `alice@example.com?uid=123456789012345678901`. If the user is
        -   *    recovered, this value reverts to `user:{emailid}` and the recovered user
        -   *    retains the role in the binding.
        +   * identifier) representing a user that has been recently deleted. For
        +   * example, `alice@example.com?uid=123456789012345678901`. If the user is
        +   * recovered, this value reverts to `user:{emailid}` and the recovered user
        +   * retains the role in the binding.
        +   *
            * * `deleted:serviceAccount:{emailid}?uid={uniqueid}`: An email address (plus
        -   *    unique identifier) representing a service account that has been recently
        -   *    deleted. For example,
        -   *    `my-other-app@appspot.gserviceaccount.com?uid=123456789012345678901`.
        -   *    If the service account is undeleted, this value reverts to
        -   *    `serviceAccount:{emailid}` and the undeleted service account retains the
        -   *    role in the binding.
        +   * unique identifier) representing a service account that has been recently
        +   * deleted. For example,
        +   * `my-other-app@appspot.gserviceaccount.com?uid=123456789012345678901`.
        +   * If the service account is undeleted, this value reverts to
        +   * `serviceAccount:{emailid}` and the undeleted service account retains the
        +   * role in the binding.
        +   *
            * * `deleted:group:{emailid}?uid={uniqueid}`: An email address (plus unique
        -   *    identifier) representing a Google group that has been recently
        -   *    deleted. For example, `admins@example.com?uid=123456789012345678901`. If
        -   *    the group is recovered, this value reverts to `group:{emailid}` and the
        -   *    recovered group retains the role in the binding.
        +   * identifier) representing a Google group that has been recently
        +   * deleted. For example, `admins@example.com?uid=123456789012345678901`. If
        +   * the group is recovered, this value reverts to `group:{emailid}` and the
        +   * recovered group retains the role in the binding.
        +   *
        +   *
            * * `domain:{domain}`: The G Suite domain (primary) that represents all the
        -   *    users of that domain. For example, `google.com` or `example.com`.
        +   * users of that domain. For example, `google.com` or `example.com`.
            * 
        * * repeated string members = 2; @@ -299,16 +358,20 @@ public com.google.protobuf.ByteString getMembersBytes(int index) { public static final int CONDITION_FIELD_NUMBER = 3; private com.google.type.Expr condition_; + /** * * *
            * The condition that is associated with this binding.
        +   *
            * If the condition evaluates to `true`, then this binding applies to the
            * current request.
        +   *
            * If the condition evaluates to `false`, then this binding does not apply to
            * the current request. However, a different role binding might grant the same
            * role to one or more of the principals in this binding.
        +   *
            * To learn which resources support conditions in their IAM policies, see the
            * [IAM
            * documentation](https://cloud.google.com/iam/help/conditions/resource-policies).
        @@ -320,18 +383,22 @@ public com.google.protobuf.ByteString getMembersBytes(int index) {
            */
           @java.lang.Override
           public boolean hasCondition() {
        -    return condition_ != null;
        +    return ((bitField0_ & 0x00000001) != 0);
           }
        +
           /**
            *
            *
            * 
            * The condition that is associated with this binding.
        +   *
            * If the condition evaluates to `true`, then this binding applies to the
            * current request.
        +   *
            * If the condition evaluates to `false`, then this binding does not apply to
            * the current request. However, a different role binding might grant the same
            * role to one or more of the principals in this binding.
        +   *
            * To learn which resources support conditions in their IAM policies, see the
            * [IAM
            * documentation](https://cloud.google.com/iam/help/conditions/resource-policies).
        @@ -345,16 +412,20 @@ public boolean hasCondition() {
           public com.google.type.Expr getCondition() {
             return condition_ == null ? com.google.type.Expr.getDefaultInstance() : condition_;
           }
        +
           /**
            *
            *
            * 
            * The condition that is associated with this binding.
        +   *
            * If the condition evaluates to `true`, then this binding applies to the
            * current request.
        +   *
            * If the condition evaluates to `false`, then this binding does not apply to
            * the current request. However, a different role binding might grant the same
            * role to one or more of the principals in this binding.
        +   *
            * To learn which resources support conditions in their IAM policies, see the
            * [IAM
            * documentation](https://cloud.google.com/iam/help/conditions/resource-policies).
        @@ -364,7 +435,7 @@ public com.google.type.Expr getCondition() {
            */
           @java.lang.Override
           public com.google.type.ExprOrBuilder getConditionOrBuilder() {
        -    return getCondition();
        +    return condition_ == null ? com.google.type.Expr.getDefaultInstance() : condition_;
           }
         
           private byte memoizedIsInitialized = -1;
        @@ -381,13 +452,13 @@ public final boolean isInitialized() {
         
           @java.lang.Override
           public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException {
        -    if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(role_)) {
        -      com.google.protobuf.GeneratedMessageV3.writeString(output, 1, role_);
        +    if (!com.google.protobuf.GeneratedMessage.isStringEmpty(role_)) {
        +      com.google.protobuf.GeneratedMessage.writeString(output, 1, role_);
             }
             for (int i = 0; i < members_.size(); i++) {
        -      com.google.protobuf.GeneratedMessageV3.writeString(output, 2, members_.getRaw(i));
        +      com.google.protobuf.GeneratedMessage.writeString(output, 2, members_.getRaw(i));
             }
        -    if (condition_ != null) {
        +    if (((bitField0_ & 0x00000001) != 0)) {
               output.writeMessage(3, getCondition());
             }
             getUnknownFields().writeTo(output);
        @@ -399,8 +470,8 @@ public int getSerializedSize() {
             if (size != -1) return size;
         
             size = 0;
        -    if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(role_)) {
        -      size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, role_);
        +    if (!com.google.protobuf.GeneratedMessage.isStringEmpty(role_)) {
        +      size += com.google.protobuf.GeneratedMessage.computeStringSize(1, role_);
             }
             {
               int dataSize = 0;
        @@ -410,7 +481,7 @@ public int getSerializedSize() {
               size += dataSize;
               size += 1 * getMembersList().size();
             }
        -    if (condition_ != null) {
        +    if (((bitField0_ & 0x00000001) != 0)) {
               size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getCondition());
             }
             size += getUnknownFields().getSerializedSize();
        @@ -496,38 +567,38 @@ public static com.google.iam.v1.Binding parseFrom(
         
           public static com.google.iam.v1.Binding parseFrom(java.io.InputStream input)
               throws java.io.IOException {
        -    return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
        +    return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input);
           }
         
           public static com.google.iam.v1.Binding parseFrom(
               java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
               throws java.io.IOException {
        -    return com.google.protobuf.GeneratedMessageV3.parseWithIOException(
        +    return com.google.protobuf.GeneratedMessage.parseWithIOException(
                 PARSER, input, extensionRegistry);
           }
         
           public static com.google.iam.v1.Binding parseDelimitedFrom(java.io.InputStream input)
               throws java.io.IOException {
        -    return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input);
        +    return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input);
           }
         
           public static com.google.iam.v1.Binding parseDelimitedFrom(
               java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
               throws java.io.IOException {
        -    return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(
        +    return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(
                 PARSER, input, extensionRegistry);
           }
         
           public static com.google.iam.v1.Binding parseFrom(com.google.protobuf.CodedInputStream input)
               throws java.io.IOException {
        -    return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
        +    return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input);
           }
         
           public static com.google.iam.v1.Binding parseFrom(
               com.google.protobuf.CodedInputStream input,
               com.google.protobuf.ExtensionRegistryLite extensionRegistry)
               throws java.io.IOException {
        -    return com.google.protobuf.GeneratedMessageV3.parseWithIOException(
        +    return com.google.protobuf.GeneratedMessage.parseWithIOException(
                 PARSER, input, extensionRegistry);
           }
         
        @@ -550,10 +621,11 @@ public Builder toBuilder() {
           }
         
           @java.lang.Override
        -  protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
        +  protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) {
             Builder builder = new Builder(parent);
             return builder;
           }
        +
           /**
            *
            *
        @@ -563,7 +635,7 @@ protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.Build
            *
            * Protobuf type {@code google.iam.v1.Binding}
            */
        -  public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder
        +  public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder
               implements
               // @@protoc_insertion_point(builder_implements:google.iam.v1.Binding)
               com.google.iam.v1.BindingOrBuilder {
        @@ -572,7 +644,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
             }
         
             @java.lang.Override
        -    protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
        +    protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
                 internalGetFieldAccessorTable() {
               return com.google.iam.v1.PolicyProto.internal_static_google_iam_v1_Binding_fieldAccessorTable
                   .ensureFieldAccessorsInitialized(
        @@ -580,23 +652,30 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
             }
         
             // Construct using com.google.iam.v1.Binding.newBuilder()
        -    private Builder() {}
        +    private Builder() {
        +      maybeForceBuilderInitialization();
        +    }
         
        -    private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
        +    private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) {
               super(parent);
        +      maybeForceBuilderInitialization();
        +    }
        +
        +    private void maybeForceBuilderInitialization() {
        +      if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) {
        +        internalGetConditionFieldBuilder();
        +      }
             }
         
             @java.lang.Override
             public Builder clear() {
               super.clear();
        +      bitField0_ = 0;
               role_ = "";
        -
        -      members_ = com.google.protobuf.LazyStringArrayList.EMPTY;
        -      bitField0_ = (bitField0_ & ~0x00000001);
        -      if (conditionBuilder_ == null) {
        -        condition_ = null;
        -      } else {
        -        condition_ = null;
        +      members_ = com.google.protobuf.LazyStringArrayList.emptyList();
        +      condition_ = null;
        +      if (conditionBuilder_ != null) {
        +        conditionBuilder_.dispose();
                 conditionBuilder_ = null;
               }
               return this;
        @@ -624,53 +703,28 @@ public com.google.iam.v1.Binding build() {
             @java.lang.Override
             public com.google.iam.v1.Binding buildPartial() {
               com.google.iam.v1.Binding result = new com.google.iam.v1.Binding(this);
        -      int from_bitField0_ = bitField0_;
        -      result.role_ = role_;
        -      if (((bitField0_ & 0x00000001) != 0)) {
        -        members_ = members_.getUnmodifiableView();
        -        bitField0_ = (bitField0_ & ~0x00000001);
        -      }
        -      result.members_ = members_;
        -      if (conditionBuilder_ == null) {
        -        result.condition_ = condition_;
        -      } else {
        -        result.condition_ = conditionBuilder_.build();
        +      if (bitField0_ != 0) {
        +        buildPartial0(result);
               }
               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);
        +    private void buildPartial0(com.google.iam.v1.Binding result) {
        +      int from_bitField0_ = bitField0_;
        +      if (((from_bitField0_ & 0x00000001) != 0)) {
        +        result.role_ = role_;
        +      }
        +      if (((from_bitField0_ & 0x00000002) != 0)) {
        +        members_.makeImmutable();
        +        result.members_ = members_;
        +      }
        +      int to_bitField0_ = 0;
        +      if (((from_bitField0_ & 0x00000004) != 0)) {
        +        result.condition_ = conditionBuilder_ == null ? condition_ : conditionBuilder_.build();
        +        to_bitField0_ |= 0x00000001;
        +      }
        +      result.bitField0_ |= to_bitField0_;
             }
         
             @java.lang.Override
        @@ -687,12 +741,13 @@ public Builder mergeFrom(com.google.iam.v1.Binding other) {
               if (other == com.google.iam.v1.Binding.getDefaultInstance()) return this;
               if (!other.getRole().isEmpty()) {
                 role_ = other.role_;
        +        bitField0_ |= 0x00000001;
                 onChanged();
               }
               if (!other.members_.isEmpty()) {
                 if (members_.isEmpty()) {
                   members_ = other.members_;
        -          bitField0_ = (bitField0_ & ~0x00000001);
        +          bitField0_ |= 0x00000002;
                 } else {
                   ensureMembersIsMutable();
                   members_.addAll(other.members_);
        @@ -731,7 +786,7 @@ public Builder mergeFrom(
                     case 10:
                       {
                         role_ = input.readStringRequireUtf8();
        -
        +                bitField0_ |= 0x00000001;
                         break;
                       } // case 10
                     case 18:
        @@ -743,8 +798,9 @@ public Builder mergeFrom(
                       } // case 18
                     case 26:
                       {
        -                input.readMessage(getConditionFieldBuilder().getBuilder(), extensionRegistry);
        -
        +                input.readMessage(
        +                    internalGetConditionFieldBuilder().getBuilder(), extensionRegistry);
        +                bitField0_ |= 0x00000004;
                         break;
                       } // case 26
                     default:
        @@ -767,6 +823,7 @@ public Builder mergeFrom(
             private int bitField0_;
         
             private java.lang.Object role_ = "";
        +
             /**
              *
              *
        @@ -790,6 +847,7 @@ public java.lang.String getRole() {
                 return (java.lang.String) ref;
               }
             }
        +
             /**
              *
              *
        @@ -813,6 +871,7 @@ public com.google.protobuf.ByteString getRoleBytes() {
                 return (com.google.protobuf.ByteString) ref;
               }
             }
        +
             /**
              *
              *
        @@ -830,11 +889,12 @@ public Builder setRole(java.lang.String value) {
               if (value == null) {
                 throw new NullPointerException();
               }
        -
               role_ = value;
        +      bitField0_ |= 0x00000001;
               onChanged();
               return this;
             }
        +
             /**
              *
              *
        @@ -848,11 +908,12 @@ public Builder setRole(java.lang.String value) {
              * @return This builder for chaining.
              */
             public Builder clearRole() {
        -
               role_ = getDefaultInstance().getRole();
        +      bitField0_ = (bitField0_ & ~0x00000001);
               onChanged();
               return this;
             }
        +
             /**
              *
              *
        @@ -871,56 +932,68 @@ public Builder setRoleBytes(com.google.protobuf.ByteString value) {
                 throw new NullPointerException();
               }
               checkByteStringIsUtf8(value);
        -
               role_ = value;
        +      bitField0_ |= 0x00000001;
               onChanged();
               return this;
             }
         
        -    private com.google.protobuf.LazyStringList members_ =
        -        com.google.protobuf.LazyStringArrayList.EMPTY;
        +    private com.google.protobuf.LazyStringArrayList members_ =
        +        com.google.protobuf.LazyStringArrayList.emptyList();
         
             private void ensureMembersIsMutable() {
        -      if (!((bitField0_ & 0x00000001) != 0)) {
        +      if (!members_.isModifiable()) {
                 members_ = new com.google.protobuf.LazyStringArrayList(members_);
        -        bitField0_ |= 0x00000001;
               }
        +      bitField0_ |= 0x00000002;
             }
        +
             /**
              *
              *
              * 
        -     * Specifies the principals requesting access for a Cloud Platform resource.
        +     * Specifies the principals requesting access for a Google Cloud resource.
              * `members` can have the following values:
        +     *
              * * `allUsers`: A special identifier that represents anyone who is
        -     *    on the internet; with or without a Google account.
        +     * on the internet; with or without a Google account.
        +     *
              * * `allAuthenticatedUsers`: A special identifier that represents anyone
        -     *    who is authenticated with a Google account or a service account.
        +     * who is authenticated with a Google account or a service account.
        +     *
              * * `user:{emailid}`: An email address that represents a specific Google
        -     *    account. For example, `alice@example.com` .
        +     * account. For example, `alice@example.com` .
        +     *
        +     *
              * * `serviceAccount:{emailid}`: An email address that represents a service
        -     *    account. For example, `my-other-app@appspot.gserviceaccount.com`.
        +     * account. For example, `my-other-app@appspot.gserviceaccount.com`.
        +     *
              * * `group:{emailid}`: An email address that represents a Google group.
        -     *    For example, `admins@example.com`.
        +     * For example, `admins@example.com`.
        +     *
              * * `deleted:user:{emailid}?uid={uniqueid}`: An email address (plus unique
        -     *    identifier) representing a user that has been recently deleted. For
        -     *    example, `alice@example.com?uid=123456789012345678901`. If the user is
        -     *    recovered, this value reverts to `user:{emailid}` and the recovered user
        -     *    retains the role in the binding.
        +     * identifier) representing a user that has been recently deleted. For
        +     * example, `alice@example.com?uid=123456789012345678901`. If the user is
        +     * recovered, this value reverts to `user:{emailid}` and the recovered user
        +     * retains the role in the binding.
        +     *
              * * `deleted:serviceAccount:{emailid}?uid={uniqueid}`: An email address (plus
        -     *    unique identifier) representing a service account that has been recently
        -     *    deleted. For example,
        -     *    `my-other-app@appspot.gserviceaccount.com?uid=123456789012345678901`.
        -     *    If the service account is undeleted, this value reverts to
        -     *    `serviceAccount:{emailid}` and the undeleted service account retains the
        -     *    role in the binding.
        +     * unique identifier) representing a service account that has been recently
        +     * deleted. For example,
        +     * `my-other-app@appspot.gserviceaccount.com?uid=123456789012345678901`.
        +     * If the service account is undeleted, this value reverts to
        +     * `serviceAccount:{emailid}` and the undeleted service account retains the
        +     * role in the binding.
        +     *
              * * `deleted:group:{emailid}?uid={uniqueid}`: An email address (plus unique
        -     *    identifier) representing a Google group that has been recently
        -     *    deleted. For example, `admins@example.com?uid=123456789012345678901`. If
        -     *    the group is recovered, this value reverts to `group:{emailid}` and the
        -     *    recovered group retains the role in the binding.
        +     * identifier) representing a Google group that has been recently
        +     * deleted. For example, `admins@example.com?uid=123456789012345678901`. If
        +     * the group is recovered, this value reverts to `group:{emailid}` and the
        +     * recovered group retains the role in the binding.
        +     *
        +     *
              * * `domain:{domain}`: The G Suite domain (primary) that represents all the
        -     *    users of that domain. For example, `google.com` or `example.com`.
        +     * users of that domain. For example, `google.com` or `example.com`.
              * 
        * * repeated string members = 2; @@ -928,43 +1001,56 @@ private void ensureMembersIsMutable() { * @return A list containing the members. */ public com.google.protobuf.ProtocolStringList getMembersList() { - return members_.getUnmodifiableView(); + members_.makeImmutable(); + return members_; } + /** * * *
        -     * Specifies the principals requesting access for a Cloud Platform resource.
        +     * Specifies the principals requesting access for a Google Cloud resource.
              * `members` can have the following values:
        +     *
              * * `allUsers`: A special identifier that represents anyone who is
        -     *    on the internet; with or without a Google account.
        +     * on the internet; with or without a Google account.
        +     *
              * * `allAuthenticatedUsers`: A special identifier that represents anyone
        -     *    who is authenticated with a Google account or a service account.
        +     * who is authenticated with a Google account or a service account.
        +     *
              * * `user:{emailid}`: An email address that represents a specific Google
        -     *    account. For example, `alice@example.com` .
        +     * account. For example, `alice@example.com` .
        +     *
        +     *
              * * `serviceAccount:{emailid}`: An email address that represents a service
        -     *    account. For example, `my-other-app@appspot.gserviceaccount.com`.
        +     * account. For example, `my-other-app@appspot.gserviceaccount.com`.
        +     *
              * * `group:{emailid}`: An email address that represents a Google group.
        -     *    For example, `admins@example.com`.
        +     * For example, `admins@example.com`.
        +     *
              * * `deleted:user:{emailid}?uid={uniqueid}`: An email address (plus unique
        -     *    identifier) representing a user that has been recently deleted. For
        -     *    example, `alice@example.com?uid=123456789012345678901`. If the user is
        -     *    recovered, this value reverts to `user:{emailid}` and the recovered user
        -     *    retains the role in the binding.
        +     * identifier) representing a user that has been recently deleted. For
        +     * example, `alice@example.com?uid=123456789012345678901`. If the user is
        +     * recovered, this value reverts to `user:{emailid}` and the recovered user
        +     * retains the role in the binding.
        +     *
              * * `deleted:serviceAccount:{emailid}?uid={uniqueid}`: An email address (plus
        -     *    unique identifier) representing a service account that has been recently
        -     *    deleted. For example,
        -     *    `my-other-app@appspot.gserviceaccount.com?uid=123456789012345678901`.
        -     *    If the service account is undeleted, this value reverts to
        -     *    `serviceAccount:{emailid}` and the undeleted service account retains the
        -     *    role in the binding.
        +     * unique identifier) representing a service account that has been recently
        +     * deleted. For example,
        +     * `my-other-app@appspot.gserviceaccount.com?uid=123456789012345678901`.
        +     * If the service account is undeleted, this value reverts to
        +     * `serviceAccount:{emailid}` and the undeleted service account retains the
        +     * role in the binding.
        +     *
              * * `deleted:group:{emailid}?uid={uniqueid}`: An email address (plus unique
        -     *    identifier) representing a Google group that has been recently
        -     *    deleted. For example, `admins@example.com?uid=123456789012345678901`. If
        -     *    the group is recovered, this value reverts to `group:{emailid}` and the
        -     *    recovered group retains the role in the binding.
        +     * identifier) representing a Google group that has been recently
        +     * deleted. For example, `admins@example.com?uid=123456789012345678901`. If
        +     * the group is recovered, this value reverts to `group:{emailid}` and the
        +     * recovered group retains the role in the binding.
        +     *
        +     *
              * * `domain:{domain}`: The G Suite domain (primary) that represents all the
        -     *    users of that domain. For example, `google.com` or `example.com`.
        +     * users of that domain. For example, `google.com` or `example.com`.
              * 
        * * repeated string members = 2; @@ -974,41 +1060,53 @@ public com.google.protobuf.ProtocolStringList getMembersList() { public int getMembersCount() { return members_.size(); } + /** * * *
        -     * Specifies the principals requesting access for a Cloud Platform resource.
        +     * Specifies the principals requesting access for a Google Cloud resource.
              * `members` can have the following values:
        +     *
              * * `allUsers`: A special identifier that represents anyone who is
        -     *    on the internet; with or without a Google account.
        +     * on the internet; with or without a Google account.
        +     *
              * * `allAuthenticatedUsers`: A special identifier that represents anyone
        -     *    who is authenticated with a Google account or a service account.
        +     * who is authenticated with a Google account or a service account.
        +     *
              * * `user:{emailid}`: An email address that represents a specific Google
        -     *    account. For example, `alice@example.com` .
        +     * account. For example, `alice@example.com` .
        +     *
        +     *
              * * `serviceAccount:{emailid}`: An email address that represents a service
        -     *    account. For example, `my-other-app@appspot.gserviceaccount.com`.
        +     * account. For example, `my-other-app@appspot.gserviceaccount.com`.
        +     *
              * * `group:{emailid}`: An email address that represents a Google group.
        -     *    For example, `admins@example.com`.
        +     * For example, `admins@example.com`.
        +     *
              * * `deleted:user:{emailid}?uid={uniqueid}`: An email address (plus unique
        -     *    identifier) representing a user that has been recently deleted. For
        -     *    example, `alice@example.com?uid=123456789012345678901`. If the user is
        -     *    recovered, this value reverts to `user:{emailid}` and the recovered user
        -     *    retains the role in the binding.
        +     * identifier) representing a user that has been recently deleted. For
        +     * example, `alice@example.com?uid=123456789012345678901`. If the user is
        +     * recovered, this value reverts to `user:{emailid}` and the recovered user
        +     * retains the role in the binding.
        +     *
              * * `deleted:serviceAccount:{emailid}?uid={uniqueid}`: An email address (plus
        -     *    unique identifier) representing a service account that has been recently
        -     *    deleted. For example,
        -     *    `my-other-app@appspot.gserviceaccount.com?uid=123456789012345678901`.
        -     *    If the service account is undeleted, this value reverts to
        -     *    `serviceAccount:{emailid}` and the undeleted service account retains the
        -     *    role in the binding.
        +     * unique identifier) representing a service account that has been recently
        +     * deleted. For example,
        +     * `my-other-app@appspot.gserviceaccount.com?uid=123456789012345678901`.
        +     * If the service account is undeleted, this value reverts to
        +     * `serviceAccount:{emailid}` and the undeleted service account retains the
        +     * role in the binding.
        +     *
              * * `deleted:group:{emailid}?uid={uniqueid}`: An email address (plus unique
        -     *    identifier) representing a Google group that has been recently
        -     *    deleted. For example, `admins@example.com?uid=123456789012345678901`. If
        -     *    the group is recovered, this value reverts to `group:{emailid}` and the
        -     *    recovered group retains the role in the binding.
        +     * identifier) representing a Google group that has been recently
        +     * deleted. For example, `admins@example.com?uid=123456789012345678901`. If
        +     * the group is recovered, this value reverts to `group:{emailid}` and the
        +     * recovered group retains the role in the binding.
        +     *
        +     *
              * * `domain:{domain}`: The G Suite domain (primary) that represents all the
        -     *    users of that domain. For example, `google.com` or `example.com`.
        +     * users of that domain. For example, `google.com` or `example.com`.
              * 
        * * repeated string members = 2; @@ -1019,41 +1117,53 @@ public int getMembersCount() { public java.lang.String getMembers(int index) { return members_.get(index); } + /** * * *
        -     * Specifies the principals requesting access for a Cloud Platform resource.
        +     * Specifies the principals requesting access for a Google Cloud resource.
              * `members` can have the following values:
        +     *
              * * `allUsers`: A special identifier that represents anyone who is
        -     *    on the internet; with or without a Google account.
        +     * on the internet; with or without a Google account.
        +     *
              * * `allAuthenticatedUsers`: A special identifier that represents anyone
        -     *    who is authenticated with a Google account or a service account.
        +     * who is authenticated with a Google account or a service account.
        +     *
              * * `user:{emailid}`: An email address that represents a specific Google
        -     *    account. For example, `alice@example.com` .
        +     * account. For example, `alice@example.com` .
        +     *
        +     *
              * * `serviceAccount:{emailid}`: An email address that represents a service
        -     *    account. For example, `my-other-app@appspot.gserviceaccount.com`.
        +     * account. For example, `my-other-app@appspot.gserviceaccount.com`.
        +     *
              * * `group:{emailid}`: An email address that represents a Google group.
        -     *    For example, `admins@example.com`.
        +     * For example, `admins@example.com`.
        +     *
              * * `deleted:user:{emailid}?uid={uniqueid}`: An email address (plus unique
        -     *    identifier) representing a user that has been recently deleted. For
        -     *    example, `alice@example.com?uid=123456789012345678901`. If the user is
        -     *    recovered, this value reverts to `user:{emailid}` and the recovered user
        -     *    retains the role in the binding.
        +     * identifier) representing a user that has been recently deleted. For
        +     * example, `alice@example.com?uid=123456789012345678901`. If the user is
        +     * recovered, this value reverts to `user:{emailid}` and the recovered user
        +     * retains the role in the binding.
        +     *
              * * `deleted:serviceAccount:{emailid}?uid={uniqueid}`: An email address (plus
        -     *    unique identifier) representing a service account that has been recently
        -     *    deleted. For example,
        -     *    `my-other-app@appspot.gserviceaccount.com?uid=123456789012345678901`.
        -     *    If the service account is undeleted, this value reverts to
        -     *    `serviceAccount:{emailid}` and the undeleted service account retains the
        -     *    role in the binding.
        +     * unique identifier) representing a service account that has been recently
        +     * deleted. For example,
        +     * `my-other-app@appspot.gserviceaccount.com?uid=123456789012345678901`.
        +     * If the service account is undeleted, this value reverts to
        +     * `serviceAccount:{emailid}` and the undeleted service account retains the
        +     * role in the binding.
        +     *
              * * `deleted:group:{emailid}?uid={uniqueid}`: An email address (plus unique
        -     *    identifier) representing a Google group that has been recently
        -     *    deleted. For example, `admins@example.com?uid=123456789012345678901`. If
        -     *    the group is recovered, this value reverts to `group:{emailid}` and the
        -     *    recovered group retains the role in the binding.
        +     * identifier) representing a Google group that has been recently
        +     * deleted. For example, `admins@example.com?uid=123456789012345678901`. If
        +     * the group is recovered, this value reverts to `group:{emailid}` and the
        +     * recovered group retains the role in the binding.
        +     *
        +     *
              * * `domain:{domain}`: The G Suite domain (primary) that represents all the
        -     *    users of that domain. For example, `google.com` or `example.com`.
        +     * users of that domain. For example, `google.com` or `example.com`.
              * 
        * * repeated string members = 2; @@ -1064,41 +1174,53 @@ public java.lang.String getMembers(int index) { public com.google.protobuf.ByteString getMembersBytes(int index) { return members_.getByteString(index); } + /** * * *
        -     * Specifies the principals requesting access for a Cloud Platform resource.
        +     * Specifies the principals requesting access for a Google Cloud resource.
              * `members` can have the following values:
        +     *
              * * `allUsers`: A special identifier that represents anyone who is
        -     *    on the internet; with or without a Google account.
        +     * on the internet; with or without a Google account.
        +     *
              * * `allAuthenticatedUsers`: A special identifier that represents anyone
        -     *    who is authenticated with a Google account or a service account.
        +     * who is authenticated with a Google account or a service account.
        +     *
              * * `user:{emailid}`: An email address that represents a specific Google
        -     *    account. For example, `alice@example.com` .
        +     * account. For example, `alice@example.com` .
        +     *
        +     *
              * * `serviceAccount:{emailid}`: An email address that represents a service
        -     *    account. For example, `my-other-app@appspot.gserviceaccount.com`.
        +     * account. For example, `my-other-app@appspot.gserviceaccount.com`.
        +     *
              * * `group:{emailid}`: An email address that represents a Google group.
        -     *    For example, `admins@example.com`.
        +     * For example, `admins@example.com`.
        +     *
              * * `deleted:user:{emailid}?uid={uniqueid}`: An email address (plus unique
        -     *    identifier) representing a user that has been recently deleted. For
        -     *    example, `alice@example.com?uid=123456789012345678901`. If the user is
        -     *    recovered, this value reverts to `user:{emailid}` and the recovered user
        -     *    retains the role in the binding.
        +     * identifier) representing a user that has been recently deleted. For
        +     * example, `alice@example.com?uid=123456789012345678901`. If the user is
        +     * recovered, this value reverts to `user:{emailid}` and the recovered user
        +     * retains the role in the binding.
        +     *
              * * `deleted:serviceAccount:{emailid}?uid={uniqueid}`: An email address (plus
        -     *    unique identifier) representing a service account that has been recently
        -     *    deleted. For example,
        -     *    `my-other-app@appspot.gserviceaccount.com?uid=123456789012345678901`.
        -     *    If the service account is undeleted, this value reverts to
        -     *    `serviceAccount:{emailid}` and the undeleted service account retains the
        -     *    role in the binding.
        +     * unique identifier) representing a service account that has been recently
        +     * deleted. For example,
        +     * `my-other-app@appspot.gserviceaccount.com?uid=123456789012345678901`.
        +     * If the service account is undeleted, this value reverts to
        +     * `serviceAccount:{emailid}` and the undeleted service account retains the
        +     * role in the binding.
        +     *
              * * `deleted:group:{emailid}?uid={uniqueid}`: An email address (plus unique
        -     *    identifier) representing a Google group that has been recently
        -     *    deleted. For example, `admins@example.com?uid=123456789012345678901`. If
        -     *    the group is recovered, this value reverts to `group:{emailid}` and the
        -     *    recovered group retains the role in the binding.
        +     * identifier) representing a Google group that has been recently
        +     * deleted. For example, `admins@example.com?uid=123456789012345678901`. If
        +     * the group is recovered, this value reverts to `group:{emailid}` and the
        +     * recovered group retains the role in the binding.
        +     *
        +     *
              * * `domain:{domain}`: The G Suite domain (primary) that represents all the
        -     *    users of that domain. For example, `google.com` or `example.com`.
        +     * users of that domain. For example, `google.com` or `example.com`.
              * 
        * * repeated string members = 2; @@ -1113,44 +1235,57 @@ public Builder setMembers(int index, java.lang.String value) { } ensureMembersIsMutable(); members_.set(index, value); + bitField0_ |= 0x00000002; onChanged(); return this; } + /** * * *
        -     * Specifies the principals requesting access for a Cloud Platform resource.
        +     * Specifies the principals requesting access for a Google Cloud resource.
              * `members` can have the following values:
        +     *
              * * `allUsers`: A special identifier that represents anyone who is
        -     *    on the internet; with or without a Google account.
        +     * on the internet; with or without a Google account.
        +     *
              * * `allAuthenticatedUsers`: A special identifier that represents anyone
        -     *    who is authenticated with a Google account or a service account.
        +     * who is authenticated with a Google account or a service account.
        +     *
              * * `user:{emailid}`: An email address that represents a specific Google
        -     *    account. For example, `alice@example.com` .
        +     * account. For example, `alice@example.com` .
        +     *
        +     *
              * * `serviceAccount:{emailid}`: An email address that represents a service
        -     *    account. For example, `my-other-app@appspot.gserviceaccount.com`.
        +     * account. For example, `my-other-app@appspot.gserviceaccount.com`.
        +     *
              * * `group:{emailid}`: An email address that represents a Google group.
        -     *    For example, `admins@example.com`.
        +     * For example, `admins@example.com`.
        +     *
              * * `deleted:user:{emailid}?uid={uniqueid}`: An email address (plus unique
        -     *    identifier) representing a user that has been recently deleted. For
        -     *    example, `alice@example.com?uid=123456789012345678901`. If the user is
        -     *    recovered, this value reverts to `user:{emailid}` and the recovered user
        -     *    retains the role in the binding.
        +     * identifier) representing a user that has been recently deleted. For
        +     * example, `alice@example.com?uid=123456789012345678901`. If the user is
        +     * recovered, this value reverts to `user:{emailid}` and the recovered user
        +     * retains the role in the binding.
        +     *
              * * `deleted:serviceAccount:{emailid}?uid={uniqueid}`: An email address (plus
        -     *    unique identifier) representing a service account that has been recently
        -     *    deleted. For example,
        -     *    `my-other-app@appspot.gserviceaccount.com?uid=123456789012345678901`.
        -     *    If the service account is undeleted, this value reverts to
        -     *    `serviceAccount:{emailid}` and the undeleted service account retains the
        -     *    role in the binding.
        +     * unique identifier) representing a service account that has been recently
        +     * deleted. For example,
        +     * `my-other-app@appspot.gserviceaccount.com?uid=123456789012345678901`.
        +     * If the service account is undeleted, this value reverts to
        +     * `serviceAccount:{emailid}` and the undeleted service account retains the
        +     * role in the binding.
        +     *
              * * `deleted:group:{emailid}?uid={uniqueid}`: An email address (plus unique
        -     *    identifier) representing a Google group that has been recently
        -     *    deleted. For example, `admins@example.com?uid=123456789012345678901`. If
        -     *    the group is recovered, this value reverts to `group:{emailid}` and the
        -     *    recovered group retains the role in the binding.
        +     * identifier) representing a Google group that has been recently
        +     * deleted. For example, `admins@example.com?uid=123456789012345678901`. If
        +     * the group is recovered, this value reverts to `group:{emailid}` and the
        +     * recovered group retains the role in the binding.
        +     *
        +     *
              * * `domain:{domain}`: The G Suite domain (primary) that represents all the
        -     *    users of that domain. For example, `google.com` or `example.com`.
        +     * users of that domain. For example, `google.com` or `example.com`.
              * 
        * * repeated string members = 2; @@ -1164,44 +1299,57 @@ public Builder addMembers(java.lang.String value) { } ensureMembersIsMutable(); members_.add(value); + bitField0_ |= 0x00000002; onChanged(); return this; } + /** * * *
        -     * Specifies the principals requesting access for a Cloud Platform resource.
        +     * Specifies the principals requesting access for a Google Cloud resource.
              * `members` can have the following values:
        +     *
              * * `allUsers`: A special identifier that represents anyone who is
        -     *    on the internet; with or without a Google account.
        +     * on the internet; with or without a Google account.
        +     *
              * * `allAuthenticatedUsers`: A special identifier that represents anyone
        -     *    who is authenticated with a Google account or a service account.
        +     * who is authenticated with a Google account or a service account.
        +     *
              * * `user:{emailid}`: An email address that represents a specific Google
        -     *    account. For example, `alice@example.com` .
        +     * account. For example, `alice@example.com` .
        +     *
        +     *
              * * `serviceAccount:{emailid}`: An email address that represents a service
        -     *    account. For example, `my-other-app@appspot.gserviceaccount.com`.
        +     * account. For example, `my-other-app@appspot.gserviceaccount.com`.
        +     *
              * * `group:{emailid}`: An email address that represents a Google group.
        -     *    For example, `admins@example.com`.
        +     * For example, `admins@example.com`.
        +     *
              * * `deleted:user:{emailid}?uid={uniqueid}`: An email address (plus unique
        -     *    identifier) representing a user that has been recently deleted. For
        -     *    example, `alice@example.com?uid=123456789012345678901`. If the user is
        -     *    recovered, this value reverts to `user:{emailid}` and the recovered user
        -     *    retains the role in the binding.
        +     * identifier) representing a user that has been recently deleted. For
        +     * example, `alice@example.com?uid=123456789012345678901`. If the user is
        +     * recovered, this value reverts to `user:{emailid}` and the recovered user
        +     * retains the role in the binding.
        +     *
              * * `deleted:serviceAccount:{emailid}?uid={uniqueid}`: An email address (plus
        -     *    unique identifier) representing a service account that has been recently
        -     *    deleted. For example,
        -     *    `my-other-app@appspot.gserviceaccount.com?uid=123456789012345678901`.
        -     *    If the service account is undeleted, this value reverts to
        -     *    `serviceAccount:{emailid}` and the undeleted service account retains the
        -     *    role in the binding.
        +     * unique identifier) representing a service account that has been recently
        +     * deleted. For example,
        +     * `my-other-app@appspot.gserviceaccount.com?uid=123456789012345678901`.
        +     * If the service account is undeleted, this value reverts to
        +     * `serviceAccount:{emailid}` and the undeleted service account retains the
        +     * role in the binding.
        +     *
              * * `deleted:group:{emailid}?uid={uniqueid}`: An email address (plus unique
        -     *    identifier) representing a Google group that has been recently
        -     *    deleted. For example, `admins@example.com?uid=123456789012345678901`. If
        -     *    the group is recovered, this value reverts to `group:{emailid}` and the
        -     *    recovered group retains the role in the binding.
        +     * identifier) representing a Google group that has been recently
        +     * deleted. For example, `admins@example.com?uid=123456789012345678901`. If
        +     * the group is recovered, this value reverts to `group:{emailid}` and the
        +     * recovered group retains the role in the binding.
        +     *
        +     *
              * * `domain:{domain}`: The G Suite domain (primary) that represents all the
        -     *    users of that domain. For example, `google.com` or `example.com`.
        +     * users of that domain. For example, `google.com` or `example.com`.
              * 
        * * repeated string members = 2; @@ -1212,44 +1360,57 @@ public Builder addMembers(java.lang.String value) { public Builder addAllMembers(java.lang.Iterable values) { ensureMembersIsMutable(); com.google.protobuf.AbstractMessageLite.Builder.addAll(values, members_); + bitField0_ |= 0x00000002; onChanged(); return this; } + /** * * *
        -     * Specifies the principals requesting access for a Cloud Platform resource.
        +     * Specifies the principals requesting access for a Google Cloud resource.
              * `members` can have the following values:
        +     *
              * * `allUsers`: A special identifier that represents anyone who is
        -     *    on the internet; with or without a Google account.
        +     * on the internet; with or without a Google account.
        +     *
              * * `allAuthenticatedUsers`: A special identifier that represents anyone
        -     *    who is authenticated with a Google account or a service account.
        +     * who is authenticated with a Google account or a service account.
        +     *
              * * `user:{emailid}`: An email address that represents a specific Google
        -     *    account. For example, `alice@example.com` .
        +     * account. For example, `alice@example.com` .
        +     *
        +     *
              * * `serviceAccount:{emailid}`: An email address that represents a service
        -     *    account. For example, `my-other-app@appspot.gserviceaccount.com`.
        +     * account. For example, `my-other-app@appspot.gserviceaccount.com`.
        +     *
              * * `group:{emailid}`: An email address that represents a Google group.
        -     *    For example, `admins@example.com`.
        +     * For example, `admins@example.com`.
        +     *
              * * `deleted:user:{emailid}?uid={uniqueid}`: An email address (plus unique
        -     *    identifier) representing a user that has been recently deleted. For
        -     *    example, `alice@example.com?uid=123456789012345678901`. If the user is
        -     *    recovered, this value reverts to `user:{emailid}` and the recovered user
        -     *    retains the role in the binding.
        +     * identifier) representing a user that has been recently deleted. For
        +     * example, `alice@example.com?uid=123456789012345678901`. If the user is
        +     * recovered, this value reverts to `user:{emailid}` and the recovered user
        +     * retains the role in the binding.
        +     *
              * * `deleted:serviceAccount:{emailid}?uid={uniqueid}`: An email address (plus
        -     *    unique identifier) representing a service account that has been recently
        -     *    deleted. For example,
        -     *    `my-other-app@appspot.gserviceaccount.com?uid=123456789012345678901`.
        -     *    If the service account is undeleted, this value reverts to
        -     *    `serviceAccount:{emailid}` and the undeleted service account retains the
        -     *    role in the binding.
        +     * unique identifier) representing a service account that has been recently
        +     * deleted. For example,
        +     * `my-other-app@appspot.gserviceaccount.com?uid=123456789012345678901`.
        +     * If the service account is undeleted, this value reverts to
        +     * `serviceAccount:{emailid}` and the undeleted service account retains the
        +     * role in the binding.
        +     *
              * * `deleted:group:{emailid}?uid={uniqueid}`: An email address (plus unique
        -     *    identifier) representing a Google group that has been recently
        -     *    deleted. For example, `admins@example.com?uid=123456789012345678901`. If
        -     *    the group is recovered, this value reverts to `group:{emailid}` and the
        -     *    recovered group retains the role in the binding.
        +     * identifier) representing a Google group that has been recently
        +     * deleted. For example, `admins@example.com?uid=123456789012345678901`. If
        +     * the group is recovered, this value reverts to `group:{emailid}` and the
        +     * recovered group retains the role in the binding.
        +     *
        +     *
              * * `domain:{domain}`: The G Suite domain (primary) that represents all the
        -     *    users of that domain. For example, `google.com` or `example.com`.
        +     * users of that domain. For example, `google.com` or `example.com`.
              * 
        * * repeated string members = 2; @@ -1257,46 +1418,59 @@ public Builder addAllMembers(java.lang.Iterable values) { * @return This builder for chaining. */ public Builder clearMembers() { - members_ = com.google.protobuf.LazyStringArrayList.EMPTY; - bitField0_ = (bitField0_ & ~0x00000001); + members_ = com.google.protobuf.LazyStringArrayList.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + ; onChanged(); return this; } + /** * * *
        -     * Specifies the principals requesting access for a Cloud Platform resource.
        +     * Specifies the principals requesting access for a Google Cloud resource.
              * `members` can have the following values:
        +     *
              * * `allUsers`: A special identifier that represents anyone who is
        -     *    on the internet; with or without a Google account.
        +     * on the internet; with or without a Google account.
        +     *
              * * `allAuthenticatedUsers`: A special identifier that represents anyone
        -     *    who is authenticated with a Google account or a service account.
        +     * who is authenticated with a Google account or a service account.
        +     *
              * * `user:{emailid}`: An email address that represents a specific Google
        -     *    account. For example, `alice@example.com` .
        +     * account. For example, `alice@example.com` .
        +     *
        +     *
              * * `serviceAccount:{emailid}`: An email address that represents a service
        -     *    account. For example, `my-other-app@appspot.gserviceaccount.com`.
        +     * account. For example, `my-other-app@appspot.gserviceaccount.com`.
        +     *
              * * `group:{emailid}`: An email address that represents a Google group.
        -     *    For example, `admins@example.com`.
        +     * For example, `admins@example.com`.
        +     *
              * * `deleted:user:{emailid}?uid={uniqueid}`: An email address (plus unique
        -     *    identifier) representing a user that has been recently deleted. For
        -     *    example, `alice@example.com?uid=123456789012345678901`. If the user is
        -     *    recovered, this value reverts to `user:{emailid}` and the recovered user
        -     *    retains the role in the binding.
        +     * identifier) representing a user that has been recently deleted. For
        +     * example, `alice@example.com?uid=123456789012345678901`. If the user is
        +     * recovered, this value reverts to `user:{emailid}` and the recovered user
        +     * retains the role in the binding.
        +     *
              * * `deleted:serviceAccount:{emailid}?uid={uniqueid}`: An email address (plus
        -     *    unique identifier) representing a service account that has been recently
        -     *    deleted. For example,
        -     *    `my-other-app@appspot.gserviceaccount.com?uid=123456789012345678901`.
        -     *    If the service account is undeleted, this value reverts to
        -     *    `serviceAccount:{emailid}` and the undeleted service account retains the
        -     *    role in the binding.
        +     * unique identifier) representing a service account that has been recently
        +     * deleted. For example,
        +     * `my-other-app@appspot.gserviceaccount.com?uid=123456789012345678901`.
        +     * If the service account is undeleted, this value reverts to
        +     * `serviceAccount:{emailid}` and the undeleted service account retains the
        +     * role in the binding.
        +     *
              * * `deleted:group:{emailid}?uid={uniqueid}`: An email address (plus unique
        -     *    identifier) representing a Google group that has been recently
        -     *    deleted. For example, `admins@example.com?uid=123456789012345678901`. If
        -     *    the group is recovered, this value reverts to `group:{emailid}` and the
        -     *    recovered group retains the role in the binding.
        +     * identifier) representing a Google group that has been recently
        +     * deleted. For example, `admins@example.com?uid=123456789012345678901`. If
        +     * the group is recovered, this value reverts to `group:{emailid}` and the
        +     * recovered group retains the role in the binding.
        +     *
        +     *
              * * `domain:{domain}`: The G Suite domain (primary) that represents all the
        -     *    users of that domain. For example, `google.com` or `example.com`.
        +     * users of that domain. For example, `google.com` or `example.com`.
              * 
        * * repeated string members = 2; @@ -1311,24 +1485,29 @@ public Builder addMembersBytes(com.google.protobuf.ByteString value) { checkByteStringIsUtf8(value); ensureMembersIsMutable(); members_.add(value); + bitField0_ |= 0x00000002; onChanged(); return this; } private com.google.type.Expr condition_; - private com.google.protobuf.SingleFieldBuilderV3< + private com.google.protobuf.SingleFieldBuilder< com.google.type.Expr, com.google.type.Expr.Builder, com.google.type.ExprOrBuilder> conditionBuilder_; + /** * * *
              * The condition that is associated with this binding.
        +     *
              * If the condition evaluates to `true`, then this binding applies to the
              * current request.
        +     *
              * If the condition evaluates to `false`, then this binding does not apply to
              * the current request. However, a different role binding might grant the same
              * role to one or more of the principals in this binding.
        +     *
              * To learn which resources support conditions in their IAM policies, see the
              * [IAM
              * documentation](https://cloud.google.com/iam/help/conditions/resource-policies).
        @@ -1339,18 +1518,22 @@ public Builder addMembersBytes(com.google.protobuf.ByteString value) {
              * @return Whether the condition field is set.
              */
             public boolean hasCondition() {
        -      return conditionBuilder_ != null || condition_ != null;
        +      return ((bitField0_ & 0x00000004) != 0);
             }
        +
             /**
              *
              *
              * 
              * The condition that is associated with this binding.
        +     *
              * If the condition evaluates to `true`, then this binding applies to the
              * current request.
        +     *
              * If the condition evaluates to `false`, then this binding does not apply to
              * the current request. However, a different role binding might grant the same
              * role to one or more of the principals in this binding.
        +     *
              * To learn which resources support conditions in their IAM policies, see the
              * [IAM
              * documentation](https://cloud.google.com/iam/help/conditions/resource-policies).
        @@ -1367,16 +1550,20 @@ public com.google.type.Expr getCondition() {
                 return conditionBuilder_.getMessage();
               }
             }
        +
             /**
              *
              *
              * 
              * The condition that is associated with this binding.
        +     *
              * If the condition evaluates to `true`, then this binding applies to the
              * current request.
        +     *
              * If the condition evaluates to `false`, then this binding does not apply to
              * the current request. However, a different role binding might grant the same
              * role to one or more of the principals in this binding.
        +     *
              * To learn which resources support conditions in their IAM policies, see the
              * [IAM
              * documentation](https://cloud.google.com/iam/help/conditions/resource-policies).
        @@ -1390,23 +1577,27 @@ public Builder setCondition(com.google.type.Expr value) {
                   throw new NullPointerException();
                 }
                 condition_ = value;
        -        onChanged();
               } else {
                 conditionBuilder_.setMessage(value);
               }
        -
        +      bitField0_ |= 0x00000004;
        +      onChanged();
               return this;
             }
        +
             /**
              *
              *
              * 
              * The condition that is associated with this binding.
        +     *
              * If the condition evaluates to `true`, then this binding applies to the
              * current request.
        +     *
              * If the condition evaluates to `false`, then this binding does not apply to
              * the current request. However, a different role binding might grant the same
              * role to one or more of the principals in this binding.
        +     *
              * To learn which resources support conditions in their IAM policies, see the
              * [IAM
              * documentation](https://cloud.google.com/iam/help/conditions/resource-policies).
        @@ -1417,23 +1608,27 @@ public Builder setCondition(com.google.type.Expr value) {
             public Builder setCondition(com.google.type.Expr.Builder builderForValue) {
               if (conditionBuilder_ == null) {
                 condition_ = builderForValue.build();
        -        onChanged();
               } else {
                 conditionBuilder_.setMessage(builderForValue.build());
               }
        -
        +      bitField0_ |= 0x00000004;
        +      onChanged();
               return this;
             }
        +
             /**
              *
              *
              * 
              * The condition that is associated with this binding.
        +     *
              * If the condition evaluates to `true`, then this binding applies to the
              * current request.
        +     *
              * If the condition evaluates to `false`, then this binding does not apply to
              * the current request. However, a different role binding might grant the same
              * role to one or more of the principals in this binding.
        +     *
              * To learn which resources support conditions in their IAM policies, see the
              * [IAM
              * documentation](https://cloud.google.com/iam/help/conditions/resource-policies).
        @@ -1443,28 +1638,36 @@ public Builder setCondition(com.google.type.Expr.Builder builderForValue) {
              */
             public Builder mergeCondition(com.google.type.Expr value) {
               if (conditionBuilder_ == null) {
        -        if (condition_ != null) {
        -          condition_ = com.google.type.Expr.newBuilder(condition_).mergeFrom(value).buildPartial();
        +        if (((bitField0_ & 0x00000004) != 0)
        +            && condition_ != null
        +            && condition_ != com.google.type.Expr.getDefaultInstance()) {
        +          getConditionBuilder().mergeFrom(value);
                 } else {
                   condition_ = value;
                 }
        -        onChanged();
               } else {
                 conditionBuilder_.mergeFrom(value);
               }
        -
        +      if (condition_ != null) {
        +        bitField0_ |= 0x00000004;
        +        onChanged();
        +      }
               return this;
             }
        +
             /**
              *
              *
              * 
              * The condition that is associated with this binding.
        +     *
              * If the condition evaluates to `true`, then this binding applies to the
              * current request.
        +     *
              * If the condition evaluates to `false`, then this binding does not apply to
              * the current request. However, a different role binding might grant the same
              * role to one or more of the principals in this binding.
        +     *
              * To learn which resources support conditions in their IAM policies, see the
              * [IAM
              * documentation](https://cloud.google.com/iam/help/conditions/resource-policies).
        @@ -1473,26 +1676,29 @@ public Builder mergeCondition(com.google.type.Expr value) {
              * .google.type.Expr condition = 3;
              */
             public Builder clearCondition() {
        -      if (conditionBuilder_ == null) {
        -        condition_ = null;
        -        onChanged();
        -      } else {
        -        condition_ = null;
        +      bitField0_ = (bitField0_ & ~0x00000004);
        +      condition_ = null;
        +      if (conditionBuilder_ != null) {
        +        conditionBuilder_.dispose();
                 conditionBuilder_ = null;
               }
        -
        +      onChanged();
               return this;
             }
        +
             /**
              *
              *
              * 
              * The condition that is associated with this binding.
        +     *
              * If the condition evaluates to `true`, then this binding applies to the
              * current request.
        +     *
              * If the condition evaluates to `false`, then this binding does not apply to
              * the current request. However, a different role binding might grant the same
              * role to one or more of the principals in this binding.
        +     *
              * To learn which resources support conditions in their IAM policies, see the
              * [IAM
              * documentation](https://cloud.google.com/iam/help/conditions/resource-policies).
        @@ -1501,20 +1707,24 @@ public Builder clearCondition() {
              * .google.type.Expr condition = 3;
              */
             public com.google.type.Expr.Builder getConditionBuilder() {
        -
        +      bitField0_ |= 0x00000004;
               onChanged();
        -      return getConditionFieldBuilder().getBuilder();
        +      return internalGetConditionFieldBuilder().getBuilder();
             }
        +
             /**
              *
              *
              * 
              * The condition that is associated with this binding.
        +     *
              * If the condition evaluates to `true`, then this binding applies to the
              * current request.
        +     *
              * If the condition evaluates to `false`, then this binding does not apply to
              * the current request. However, a different role binding might grant the same
              * role to one or more of the principals in this binding.
        +     *
              * To learn which resources support conditions in their IAM policies, see the
              * [IAM
              * documentation](https://cloud.google.com/iam/help/conditions/resource-policies).
        @@ -1529,16 +1739,20 @@ public com.google.type.ExprOrBuilder getConditionOrBuilder() {
                 return condition_ == null ? com.google.type.Expr.getDefaultInstance() : condition_;
               }
             }
        +
             /**
              *
              *
              * 
              * The condition that is associated with this binding.
        +     *
              * If the condition evaluates to `true`, then this binding applies to the
              * current request.
        +     *
              * If the condition evaluates to `false`, then this binding does not apply to
              * the current request. However, a different role binding might grant the same
              * role to one or more of the principals in this binding.
        +     *
              * To learn which resources support conditions in their IAM policies, see the
              * [IAM
              * documentation](https://cloud.google.com/iam/help/conditions/resource-policies).
        @@ -1546,12 +1760,12 @@ public com.google.type.ExprOrBuilder getConditionOrBuilder() {
              *
              * .google.type.Expr condition = 3;
              */
        -    private com.google.protobuf.SingleFieldBuilderV3<
        +    private com.google.protobuf.SingleFieldBuilder<
                     com.google.type.Expr, com.google.type.Expr.Builder, com.google.type.ExprOrBuilder>
        -        getConditionFieldBuilder() {
        +        internalGetConditionFieldBuilder() {
               if (conditionBuilder_ == null) {
                 conditionBuilder_ =
        -            new com.google.protobuf.SingleFieldBuilderV3<
        +            new com.google.protobuf.SingleFieldBuilder<
                         com.google.type.Expr, com.google.type.Expr.Builder, com.google.type.ExprOrBuilder>(
                         getCondition(), getParentForChildren(), isClean());
                 condition_ = null;
        @@ -1559,17 +1773,6 @@ public com.google.type.ExprOrBuilder getConditionOrBuilder() {
               return conditionBuilder_;
             }
         
        -    @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.iam.v1.Binding)
           }
         
        diff --git a/java-iam/proto-google-iam-v1/src/main/java/com/google/iam/v1/BindingDelta.java b/java-iam/proto-google-iam-v1/src/main/java/com/google/iam/v1/BindingDelta.java
        index f6d46a10be..bebfd498a7 100644
        --- a/java-iam/proto-google-iam-v1/src/main/java/com/google/iam/v1/BindingDelta.java
        +++ b/java-iam/proto-google-iam-v1/src/main/java/com/google/iam/v1/BindingDelta.java
        @@ -1,5 +1,5 @@
         /*
        - * Copyright 2020 Google LLC
        + * Copyright 2026 Google LLC
          *
          * Licensed under the Apache License, Version 2.0 (the "License");
          * you may not use this file except in compliance with the License.
        @@ -14,7 +14,9 @@
          * limitations under the License.
          */
         // Generated by the protocol buffer compiler.  DO NOT EDIT!
        +// NO CHECKED-IN PROTOBUF GENCODE
         // source: google/iam/v1/policy.proto
        +// Protobuf Java Version: 4.33.2
         
         package com.google.iam.v1;
         
        @@ -28,13 +30,25 @@
          *
          * Protobuf type {@code google.iam.v1.BindingDelta}
          */
        -public final class BindingDelta extends com.google.protobuf.GeneratedMessageV3
        +@com.google.protobuf.Generated
        +public final class BindingDelta extends com.google.protobuf.GeneratedMessage
             implements
             // @@protoc_insertion_point(message_implements:google.iam.v1.BindingDelta)
             BindingDeltaOrBuilder {
           private static final long serialVersionUID = 0L;
        +
        +  static {
        +    com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion(
        +        com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC,
        +        /* major= */ 4,
        +        /* minor= */ 33,
        +        /* patch= */ 2,
        +        /* suffix= */ "",
        +        "BindingDelta");
        +  }
        +
           // Use BindingDelta.newBuilder() to construct.
        -  private BindingDelta(com.google.protobuf.GeneratedMessageV3.Builder builder) {
        +  private BindingDelta(com.google.protobuf.GeneratedMessage.Builder builder) {
             super(builder);
           }
         
        @@ -44,23 +58,12 @@ private BindingDelta() {
             member_ = "";
           }
         
        -  @java.lang.Override
        -  @SuppressWarnings({"unused"})
        -  protected java.lang.Object newInstance(UnusedPrivateParameter unused) {
        -    return new BindingDelta();
        -  }
        -
        -  @java.lang.Override
        -  public final com.google.protobuf.UnknownFieldSet getUnknownFields() {
        -    return this.unknownFields;
        -  }
        -
           public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
             return com.google.iam.v1.PolicyProto.internal_static_google_iam_v1_BindingDelta_descriptor;
           }
         
           @java.lang.Override
        -  protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
        +  protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
               internalGetFieldAccessorTable() {
             return com.google.iam.v1.PolicyProto
                 .internal_static_google_iam_v1_BindingDelta_fieldAccessorTable
        @@ -111,6 +114,16 @@ public enum Action implements com.google.protobuf.ProtocolMessageEnum {
             UNRECOGNIZED(-1),
             ;
         
        +    static {
        +      com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion(
        +          com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC,
        +          /* major= */ 4,
        +          /* minor= */ 33,
        +          /* patch= */ 2,
        +          /* suffix= */ "",
        +          "Action");
        +    }
        +
             /**
              *
              *
        @@ -121,6 +134,7 @@ public enum Action implements com.google.protobuf.ProtocolMessageEnum {
              * ACTION_UNSPECIFIED = 0;
              */
             public static final int ACTION_UNSPECIFIED_VALUE = 0;
        +
             /**
              *
              *
        @@ -131,6 +145,7 @@ public enum Action implements com.google.protobuf.ProtocolMessageEnum {
              * ADD = 1;
              */
             public static final int ADD_VALUE = 1;
        +
             /**
              *
              *
        @@ -200,7 +215,7 @@ public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType
               return getDescriptor();
             }
         
        -    public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() {
        +    public static com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() {
               return com.google.iam.v1.BindingDelta.getDescriptor().getEnumTypes().get(0);
             }
         
        @@ -225,8 +240,10 @@ private Action(int value) {
             // @@protoc_insertion_point(enum_scope:google.iam.v1.BindingDelta.Action)
           }
         
        +  private int bitField0_;
           public static final int ACTION_FIELD_NUMBER = 1;
        -  private int action_;
        +  private int action_ = 0;
        +
           /**
            *
            *
        @@ -243,6 +260,7 @@ private Action(int value) {
           public int getActionValue() {
             return action_;
           }
        +
           /**
            *
            *
        @@ -257,14 +275,16 @@ public int getActionValue() {
            */
           @java.lang.Override
           public com.google.iam.v1.BindingDelta.Action getAction() {
        -    @SuppressWarnings("deprecation")
             com.google.iam.v1.BindingDelta.Action result =
        -        com.google.iam.v1.BindingDelta.Action.valueOf(action_);
        +        com.google.iam.v1.BindingDelta.Action.forNumber(action_);
             return result == null ? com.google.iam.v1.BindingDelta.Action.UNRECOGNIZED : result;
           }
         
           public static final int ROLE_FIELD_NUMBER = 2;
        -  private volatile java.lang.Object role_;
        +
        +  @SuppressWarnings("serial")
        +  private volatile java.lang.Object role_ = "";
        +
           /**
            *
            *
        @@ -290,6 +310,7 @@ public java.lang.String getRole() {
               return s;
             }
           }
        +
           /**
            *
            *
        @@ -317,12 +338,15 @@ public com.google.protobuf.ByteString getRoleBytes() {
           }
         
           public static final int MEMBER_FIELD_NUMBER = 3;
        -  private volatile java.lang.Object member_;
        +
        +  @SuppressWarnings("serial")
        +  private volatile java.lang.Object member_ = "";
        +
           /**
            *
            *
            * 
        -   * A single identity requesting access for a Cloud Platform resource.
        +   * A single identity requesting access for a Google Cloud resource.
            * Follows the same format of Binding.members.
            * Required
            * 
        @@ -343,11 +367,12 @@ public java.lang.String getMember() { return s; } } + /** * * *
        -   * A single identity requesting access for a Cloud Platform resource.
        +   * A single identity requesting access for a Google Cloud resource.
            * Follows the same format of Binding.members.
            * Required
            * 
        @@ -371,6 +396,7 @@ public com.google.protobuf.ByteString getMemberBytes() { public static final int CONDITION_FIELD_NUMBER = 4; private com.google.type.Expr condition_; + /** * * @@ -384,8 +410,9 @@ public com.google.protobuf.ByteString getMemberBytes() { */ @java.lang.Override public boolean hasCondition() { - return condition_ != null; + return ((bitField0_ & 0x00000001) != 0); } + /** * * @@ -401,6 +428,7 @@ public boolean hasCondition() { public com.google.type.Expr getCondition() { return condition_ == null ? com.google.type.Expr.getDefaultInstance() : condition_; } + /** * * @@ -412,7 +440,7 @@ public com.google.type.Expr getCondition() { */ @java.lang.Override public com.google.type.ExprOrBuilder getConditionOrBuilder() { - return getCondition(); + return condition_ == null ? com.google.type.Expr.getDefaultInstance() : condition_; } private byte memoizedIsInitialized = -1; @@ -432,13 +460,13 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (action_ != com.google.iam.v1.BindingDelta.Action.ACTION_UNSPECIFIED.getNumber()) { output.writeEnum(1, action_); } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(role_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 2, role_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(role_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, role_); } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(member_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 3, member_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(member_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 3, member_); } - if (condition_ != null) { + if (((bitField0_ & 0x00000001) != 0)) { output.writeMessage(4, getCondition()); } getUnknownFields().writeTo(output); @@ -453,13 +481,13 @@ public int getSerializedSize() { if (action_ != com.google.iam.v1.BindingDelta.Action.ACTION_UNSPECIFIED.getNumber()) { size += com.google.protobuf.CodedOutputStream.computeEnumSize(1, action_); } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(role_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, role_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(role_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, role_); } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(member_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, member_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(member_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(3, member_); } - if (condition_ != null) { + if (((bitField0_ & 0x00000001) != 0)) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, getCondition()); } size += getUnknownFields().getSerializedSize(); @@ -546,38 +574,38 @@ public static com.google.iam.v1.BindingDelta parseFrom( public static com.google.iam.v1.BindingDelta parseFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); } public static com.google.iam.v1.BindingDelta parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } public static com.google.iam.v1.BindingDelta parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); } public static com.google.iam.v1.BindingDelta parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( PARSER, input, extensionRegistry); } public static com.google.iam.v1.BindingDelta parseFrom(com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); } public static com.google.iam.v1.BindingDelta parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } @@ -600,10 +628,11 @@ public Builder toBuilder() { } @java.lang.Override - protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { Builder builder = new Builder(parent); return builder; } + /** * * @@ -614,7 +643,7 @@ protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.Build * * Protobuf type {@code google.iam.v1.BindingDelta} */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder implements // @@protoc_insertion_point(builder_implements:google.iam.v1.BindingDelta) com.google.iam.v1.BindingDeltaOrBuilder { @@ -623,7 +652,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.iam.v1.PolicyProto .internal_static_google_iam_v1_BindingDelta_fieldAccessorTable @@ -632,25 +661,31 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } // Construct using com.google.iam.v1.BindingDelta.newBuilder() - private Builder() {} + private Builder() { + maybeForceBuilderInitialization(); + } - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetConditionFieldBuilder(); + } } @java.lang.Override public Builder clear() { super.clear(); + bitField0_ = 0; action_ = 0; - role_ = ""; - member_ = ""; - - if (conditionBuilder_ == null) { - condition_ = null; - } else { - condition_ = null; + condition_ = null; + if (conditionBuilder_ != null) { + conditionBuilder_.dispose(); conditionBuilder_ = null; } return this; @@ -678,49 +713,30 @@ public com.google.iam.v1.BindingDelta build() { @java.lang.Override public com.google.iam.v1.BindingDelta buildPartial() { com.google.iam.v1.BindingDelta result = new com.google.iam.v1.BindingDelta(this); - result.action_ = action_; - result.role_ = role_; - result.member_ = member_; - if (conditionBuilder_ == null) { - result.condition_ = condition_; - } else { - result.condition_ = conditionBuilder_.build(); + if (bitField0_ != 0) { + buildPartial0(result); } 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); + private void buildPartial0(com.google.iam.v1.BindingDelta result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.action_ = action_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.role_ = role_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.member_ = member_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000008) != 0)) { + result.condition_ = conditionBuilder_ == null ? condition_ : conditionBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + result.bitField0_ |= to_bitField0_; } @java.lang.Override @@ -740,10 +756,12 @@ public Builder mergeFrom(com.google.iam.v1.BindingDelta other) { } if (!other.getRole().isEmpty()) { role_ = other.role_; + bitField0_ |= 0x00000002; onChanged(); } if (!other.getMember().isEmpty()) { member_ = other.member_; + bitField0_ |= 0x00000004; onChanged(); } if (other.hasCondition()) { @@ -778,25 +796,26 @@ public Builder mergeFrom( case 8: { action_ = input.readEnum(); - + bitField0_ |= 0x00000001; break; } // case 8 case 18: { role_ = input.readStringRequireUtf8(); - + bitField0_ |= 0x00000002; break; } // case 18 case 26: { member_ = input.readStringRequireUtf8(); - + bitField0_ |= 0x00000004; break; } // case 26 case 34: { - input.readMessage(getConditionFieldBuilder().getBuilder(), extensionRegistry); - + input.readMessage( + internalGetConditionFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000008; break; } // case 34 default: @@ -816,7 +835,10 @@ public Builder mergeFrom( return this; } + private int bitField0_; + private int action_ = 0; + /** * * @@ -833,6 +855,7 @@ public Builder mergeFrom( public int getActionValue() { return action_; } + /** * * @@ -847,11 +870,12 @@ public int getActionValue() { * @return This builder for chaining. */ public Builder setActionValue(int value) { - action_ = value; + bitField0_ |= 0x00000001; onChanged(); return this; } + /** * * @@ -866,11 +890,11 @@ public Builder setActionValue(int value) { */ @java.lang.Override public com.google.iam.v1.BindingDelta.Action getAction() { - @SuppressWarnings("deprecation") com.google.iam.v1.BindingDelta.Action result = - com.google.iam.v1.BindingDelta.Action.valueOf(action_); + com.google.iam.v1.BindingDelta.Action.forNumber(action_); return result == null ? com.google.iam.v1.BindingDelta.Action.UNRECOGNIZED : result; } + /** * * @@ -888,11 +912,12 @@ public Builder setAction(com.google.iam.v1.BindingDelta.Action value) { if (value == null) { throw new NullPointerException(); } - + bitField0_ |= 0x00000001; action_ = value.getNumber(); onChanged(); return this; } + /** * * @@ -906,13 +931,14 @@ public Builder setAction(com.google.iam.v1.BindingDelta.Action value) { * @return This builder for chaining. */ public Builder clearAction() { - + bitField0_ = (bitField0_ & ~0x00000001); action_ = 0; onChanged(); return this; } private java.lang.Object role_ = ""; + /** * * @@ -937,6 +963,7 @@ public java.lang.String getRole() { return (java.lang.String) ref; } } + /** * * @@ -961,6 +988,7 @@ public com.google.protobuf.ByteString getRoleBytes() { return (com.google.protobuf.ByteString) ref; } } + /** * * @@ -979,11 +1007,12 @@ public Builder setRole(java.lang.String value) { if (value == null) { throw new NullPointerException(); } - role_ = value; + bitField0_ |= 0x00000002; onChanged(); return this; } + /** * * @@ -998,11 +1027,12 @@ public Builder setRole(java.lang.String value) { * @return This builder for chaining. */ public Builder clearRole() { - role_ = getDefaultInstance().getRole(); + bitField0_ = (bitField0_ & ~0x00000002); onChanged(); return this; } + /** * * @@ -1022,18 +1052,19 @@ public Builder setRoleBytes(com.google.protobuf.ByteString value) { throw new NullPointerException(); } checkByteStringIsUtf8(value); - role_ = value; + bitField0_ |= 0x00000002; onChanged(); return this; } private java.lang.Object member_ = ""; + /** * * *
        -     * A single identity requesting access for a Cloud Platform resource.
        +     * A single identity requesting access for a Google Cloud resource.
              * Follows the same format of Binding.members.
              * Required
              * 
        @@ -1053,11 +1084,12 @@ public java.lang.String getMember() { return (java.lang.String) ref; } } + /** * * *
        -     * A single identity requesting access for a Cloud Platform resource.
        +     * A single identity requesting access for a Google Cloud resource.
              * Follows the same format of Binding.members.
              * Required
              * 
        @@ -1077,11 +1109,12 @@ public com.google.protobuf.ByteString getMemberBytes() { return (com.google.protobuf.ByteString) ref; } } + /** * * *
        -     * A single identity requesting access for a Cloud Platform resource.
        +     * A single identity requesting access for a Google Cloud resource.
              * Follows the same format of Binding.members.
              * Required
              * 
        @@ -1095,16 +1128,17 @@ public Builder setMember(java.lang.String value) { if (value == null) { throw new NullPointerException(); } - member_ = value; + bitField0_ |= 0x00000004; onChanged(); return this; } + /** * * *
        -     * A single identity requesting access for a Cloud Platform resource.
        +     * A single identity requesting access for a Google Cloud resource.
              * Follows the same format of Binding.members.
              * Required
              * 
        @@ -1114,16 +1148,17 @@ public Builder setMember(java.lang.String value) { * @return This builder for chaining. */ public Builder clearMember() { - member_ = getDefaultInstance().getMember(); + bitField0_ = (bitField0_ & ~0x00000004); onChanged(); return this; } + /** * * *
        -     * A single identity requesting access for a Cloud Platform resource.
        +     * A single identity requesting access for a Google Cloud resource.
              * Follows the same format of Binding.members.
              * Required
              * 
        @@ -1138,16 +1173,17 @@ public Builder setMemberBytes(com.google.protobuf.ByteString value) { throw new NullPointerException(); } checkByteStringIsUtf8(value); - member_ = value; + bitField0_ |= 0x00000004; onChanged(); return this; } private com.google.type.Expr condition_; - private com.google.protobuf.SingleFieldBuilderV3< + private com.google.protobuf.SingleFieldBuilder< com.google.type.Expr, com.google.type.Expr.Builder, com.google.type.ExprOrBuilder> conditionBuilder_; + /** * * @@ -1160,8 +1196,9 @@ public Builder setMemberBytes(com.google.protobuf.ByteString value) { * @return Whether the condition field is set. */ public boolean hasCondition() { - return conditionBuilder_ != null || condition_ != null; + return ((bitField0_ & 0x00000008) != 0); } + /** * * @@ -1180,6 +1217,7 @@ public com.google.type.Expr getCondition() { return conditionBuilder_.getMessage(); } } + /** * * @@ -1195,13 +1233,14 @@ public Builder setCondition(com.google.type.Expr value) { throw new NullPointerException(); } condition_ = value; - onChanged(); } else { conditionBuilder_.setMessage(value); } - + bitField0_ |= 0x00000008; + onChanged(); return this; } + /** * * @@ -1214,13 +1253,14 @@ public Builder setCondition(com.google.type.Expr value) { public Builder setCondition(com.google.type.Expr.Builder builderForValue) { if (conditionBuilder_ == null) { condition_ = builderForValue.build(); - onChanged(); } else { conditionBuilder_.setMessage(builderForValue.build()); } - + bitField0_ |= 0x00000008; + onChanged(); return this; } + /** * * @@ -1232,18 +1272,23 @@ public Builder setCondition(com.google.type.Expr.Builder builderForValue) { */ public Builder mergeCondition(com.google.type.Expr value) { if (conditionBuilder_ == null) { - if (condition_ != null) { - condition_ = com.google.type.Expr.newBuilder(condition_).mergeFrom(value).buildPartial(); + if (((bitField0_ & 0x00000008) != 0) + && condition_ != null + && condition_ != com.google.type.Expr.getDefaultInstance()) { + getConditionBuilder().mergeFrom(value); } else { condition_ = value; } - onChanged(); } else { conditionBuilder_.mergeFrom(value); } - + if (condition_ != null) { + bitField0_ |= 0x00000008; + onChanged(); + } return this; } + /** * * @@ -1254,16 +1299,16 @@ public Builder mergeCondition(com.google.type.Expr value) { * .google.type.Expr condition = 4; */ public Builder clearCondition() { - if (conditionBuilder_ == null) { - condition_ = null; - onChanged(); - } else { - condition_ = null; + bitField0_ = (bitField0_ & ~0x00000008); + condition_ = null; + if (conditionBuilder_ != null) { + conditionBuilder_.dispose(); conditionBuilder_ = null; } - + onChanged(); return this; } + /** * * @@ -1274,10 +1319,11 @@ public Builder clearCondition() { * .google.type.Expr condition = 4; */ public com.google.type.Expr.Builder getConditionBuilder() { - + bitField0_ |= 0x00000008; onChanged(); - return getConditionFieldBuilder().getBuilder(); + return internalGetConditionFieldBuilder().getBuilder(); } + /** * * @@ -1294,6 +1340,7 @@ public com.google.type.ExprOrBuilder getConditionOrBuilder() { return condition_ == null ? com.google.type.Expr.getDefaultInstance() : condition_; } } + /** * * @@ -1303,12 +1350,12 @@ public com.google.type.ExprOrBuilder getConditionOrBuilder() { * * .google.type.Expr condition = 4; */ - private com.google.protobuf.SingleFieldBuilderV3< + private com.google.protobuf.SingleFieldBuilder< com.google.type.Expr, com.google.type.Expr.Builder, com.google.type.ExprOrBuilder> - getConditionFieldBuilder() { + internalGetConditionFieldBuilder() { if (conditionBuilder_ == null) { conditionBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< + new com.google.protobuf.SingleFieldBuilder< com.google.type.Expr, com.google.type.Expr.Builder, com.google.type.ExprOrBuilder>( getCondition(), getParentForChildren(), isClean()); condition_ = null; @@ -1316,17 +1363,6 @@ public com.google.type.ExprOrBuilder getConditionOrBuilder() { return conditionBuilder_; } - @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.iam.v1.BindingDelta) } diff --git a/java-iam/proto-google-iam-v1/src/main/java/com/google/iam/v1/BindingDeltaOrBuilder.java b/java-iam/proto-google-iam-v1/src/main/java/com/google/iam/v1/BindingDeltaOrBuilder.java index a2959294d9..efcf8cb6ef 100644 --- a/java-iam/proto-google-iam-v1/src/main/java/com/google/iam/v1/BindingDeltaOrBuilder.java +++ b/java-iam/proto-google-iam-v1/src/main/java/com/google/iam/v1/BindingDeltaOrBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,10 +14,13 @@ * limitations under the License. */ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: google/iam/v1/policy.proto +// Protobuf Java Version: 4.33.2 package com.google.iam.v1; +@com.google.protobuf.Generated public interface BindingDeltaOrBuilder extends // @@protoc_insertion_point(interface_extends:google.iam.v1.BindingDelta) @@ -36,6 +39,7 @@ public interface BindingDeltaOrBuilder * @return The enum numeric value on the wire for action. */ int getActionValue(); + /** * * @@ -64,6 +68,7 @@ public interface BindingDeltaOrBuilder * @return The role. */ java.lang.String getRole(); + /** * * @@ -83,7 +88,7 @@ public interface BindingDeltaOrBuilder * * *
        -   * A single identity requesting access for a Cloud Platform resource.
        +   * A single identity requesting access for a Google Cloud resource.
            * Follows the same format of Binding.members.
            * Required
            * 
        @@ -93,11 +98,12 @@ public interface BindingDeltaOrBuilder * @return The member. */ java.lang.String getMember(); + /** * * *
        -   * A single identity requesting access for a Cloud Platform resource.
        +   * A single identity requesting access for a Google Cloud resource.
            * Follows the same format of Binding.members.
            * Required
            * 
        @@ -120,6 +126,7 @@ public interface BindingDeltaOrBuilder * @return Whether the condition field is set. */ boolean hasCondition(); + /** * * @@ -132,6 +139,7 @@ public interface BindingDeltaOrBuilder * @return The condition. */ com.google.type.Expr getCondition(); + /** * * diff --git a/java-iam/proto-google-iam-v1/src/main/java/com/google/iam/v1/BindingOrBuilder.java b/java-iam/proto-google-iam-v1/src/main/java/com/google/iam/v1/BindingOrBuilder.java index b5e660fa3a..d4440a91b3 100644 --- a/java-iam/proto-google-iam-v1/src/main/java/com/google/iam/v1/BindingOrBuilder.java +++ b/java-iam/proto-google-iam-v1/src/main/java/com/google/iam/v1/BindingOrBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,10 +14,13 @@ * limitations under the License. */ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: google/iam/v1/policy.proto +// Protobuf Java Version: 4.33.2 package com.google.iam.v1; +@com.google.protobuf.Generated public interface BindingOrBuilder extends // @@protoc_insertion_point(interface_extends:google.iam.v1.Binding) @@ -36,6 +39,7 @@ public interface BindingOrBuilder * @return The role. */ java.lang.String getRole(); + /** * * @@ -54,37 +58,48 @@ public interface BindingOrBuilder * * *
        -   * Specifies the principals requesting access for a Cloud Platform resource.
        +   * Specifies the principals requesting access for a Google Cloud resource.
            * `members` can have the following values:
        +   *
            * * `allUsers`: A special identifier that represents anyone who is
        -   *    on the internet; with or without a Google account.
        +   * on the internet; with or without a Google account.
        +   *
            * * `allAuthenticatedUsers`: A special identifier that represents anyone
        -   *    who is authenticated with a Google account or a service account.
        +   * who is authenticated with a Google account or a service account.
        +   *
            * * `user:{emailid}`: An email address that represents a specific Google
        -   *    account. For example, `alice@example.com` .
        +   * account. For example, `alice@example.com` .
        +   *
        +   *
            * * `serviceAccount:{emailid}`: An email address that represents a service
        -   *    account. For example, `my-other-app@appspot.gserviceaccount.com`.
        +   * account. For example, `my-other-app@appspot.gserviceaccount.com`.
        +   *
            * * `group:{emailid}`: An email address that represents a Google group.
        -   *    For example, `admins@example.com`.
        +   * For example, `admins@example.com`.
        +   *
            * * `deleted:user:{emailid}?uid={uniqueid}`: An email address (plus unique
        -   *    identifier) representing a user that has been recently deleted. For
        -   *    example, `alice@example.com?uid=123456789012345678901`. If the user is
        -   *    recovered, this value reverts to `user:{emailid}` and the recovered user
        -   *    retains the role in the binding.
        +   * identifier) representing a user that has been recently deleted. For
        +   * example, `alice@example.com?uid=123456789012345678901`. If the user is
        +   * recovered, this value reverts to `user:{emailid}` and the recovered user
        +   * retains the role in the binding.
        +   *
            * * `deleted:serviceAccount:{emailid}?uid={uniqueid}`: An email address (plus
        -   *    unique identifier) representing a service account that has been recently
        -   *    deleted. For example,
        -   *    `my-other-app@appspot.gserviceaccount.com?uid=123456789012345678901`.
        -   *    If the service account is undeleted, this value reverts to
        -   *    `serviceAccount:{emailid}` and the undeleted service account retains the
        -   *    role in the binding.
        +   * unique identifier) representing a service account that has been recently
        +   * deleted. For example,
        +   * `my-other-app@appspot.gserviceaccount.com?uid=123456789012345678901`.
        +   * If the service account is undeleted, this value reverts to
        +   * `serviceAccount:{emailid}` and the undeleted service account retains the
        +   * role in the binding.
        +   *
            * * `deleted:group:{emailid}?uid={uniqueid}`: An email address (plus unique
        -   *    identifier) representing a Google group that has been recently
        -   *    deleted. For example, `admins@example.com?uid=123456789012345678901`. If
        -   *    the group is recovered, this value reverts to `group:{emailid}` and the
        -   *    recovered group retains the role in the binding.
        +   * identifier) representing a Google group that has been recently
        +   * deleted. For example, `admins@example.com?uid=123456789012345678901`. If
        +   * the group is recovered, this value reverts to `group:{emailid}` and the
        +   * recovered group retains the role in the binding.
        +   *
        +   *
            * * `domain:{domain}`: The G Suite domain (primary) that represents all the
        -   *    users of that domain. For example, `google.com` or `example.com`.
        +   * users of that domain. For example, `google.com` or `example.com`.
            * 
        * * repeated string members = 2; @@ -92,41 +107,53 @@ public interface BindingOrBuilder * @return A list containing the members. */ java.util.List getMembersList(); + /** * * *
        -   * Specifies the principals requesting access for a Cloud Platform resource.
        +   * Specifies the principals requesting access for a Google Cloud resource.
            * `members` can have the following values:
        +   *
            * * `allUsers`: A special identifier that represents anyone who is
        -   *    on the internet; with or without a Google account.
        +   * on the internet; with or without a Google account.
        +   *
            * * `allAuthenticatedUsers`: A special identifier that represents anyone
        -   *    who is authenticated with a Google account or a service account.
        +   * who is authenticated with a Google account or a service account.
        +   *
            * * `user:{emailid}`: An email address that represents a specific Google
        -   *    account. For example, `alice@example.com` .
        +   * account. For example, `alice@example.com` .
        +   *
        +   *
            * * `serviceAccount:{emailid}`: An email address that represents a service
        -   *    account. For example, `my-other-app@appspot.gserviceaccount.com`.
        +   * account. For example, `my-other-app@appspot.gserviceaccount.com`.
        +   *
            * * `group:{emailid}`: An email address that represents a Google group.
        -   *    For example, `admins@example.com`.
        +   * For example, `admins@example.com`.
        +   *
            * * `deleted:user:{emailid}?uid={uniqueid}`: An email address (plus unique
        -   *    identifier) representing a user that has been recently deleted. For
        -   *    example, `alice@example.com?uid=123456789012345678901`. If the user is
        -   *    recovered, this value reverts to `user:{emailid}` and the recovered user
        -   *    retains the role in the binding.
        +   * identifier) representing a user that has been recently deleted. For
        +   * example, `alice@example.com?uid=123456789012345678901`. If the user is
        +   * recovered, this value reverts to `user:{emailid}` and the recovered user
        +   * retains the role in the binding.
        +   *
            * * `deleted:serviceAccount:{emailid}?uid={uniqueid}`: An email address (plus
        -   *    unique identifier) representing a service account that has been recently
        -   *    deleted. For example,
        -   *    `my-other-app@appspot.gserviceaccount.com?uid=123456789012345678901`.
        -   *    If the service account is undeleted, this value reverts to
        -   *    `serviceAccount:{emailid}` and the undeleted service account retains the
        -   *    role in the binding.
        +   * unique identifier) representing a service account that has been recently
        +   * deleted. For example,
        +   * `my-other-app@appspot.gserviceaccount.com?uid=123456789012345678901`.
        +   * If the service account is undeleted, this value reverts to
        +   * `serviceAccount:{emailid}` and the undeleted service account retains the
        +   * role in the binding.
        +   *
            * * `deleted:group:{emailid}?uid={uniqueid}`: An email address (plus unique
        -   *    identifier) representing a Google group that has been recently
        -   *    deleted. For example, `admins@example.com?uid=123456789012345678901`. If
        -   *    the group is recovered, this value reverts to `group:{emailid}` and the
        -   *    recovered group retains the role in the binding.
        +   * identifier) representing a Google group that has been recently
        +   * deleted. For example, `admins@example.com?uid=123456789012345678901`. If
        +   * the group is recovered, this value reverts to `group:{emailid}` and the
        +   * recovered group retains the role in the binding.
        +   *
        +   *
            * * `domain:{domain}`: The G Suite domain (primary) that represents all the
        -   *    users of that domain. For example, `google.com` or `example.com`.
        +   * users of that domain. For example, `google.com` or `example.com`.
            * 
        * * repeated string members = 2; @@ -134,41 +161,53 @@ public interface BindingOrBuilder * @return The count of members. */ int getMembersCount(); + /** * * *
        -   * Specifies the principals requesting access for a Cloud Platform resource.
        +   * Specifies the principals requesting access for a Google Cloud resource.
            * `members` can have the following values:
        +   *
            * * `allUsers`: A special identifier that represents anyone who is
        -   *    on the internet; with or without a Google account.
        +   * on the internet; with or without a Google account.
        +   *
            * * `allAuthenticatedUsers`: A special identifier that represents anyone
        -   *    who is authenticated with a Google account or a service account.
        +   * who is authenticated with a Google account or a service account.
        +   *
            * * `user:{emailid}`: An email address that represents a specific Google
        -   *    account. For example, `alice@example.com` .
        +   * account. For example, `alice@example.com` .
        +   *
        +   *
            * * `serviceAccount:{emailid}`: An email address that represents a service
        -   *    account. For example, `my-other-app@appspot.gserviceaccount.com`.
        +   * account. For example, `my-other-app@appspot.gserviceaccount.com`.
        +   *
            * * `group:{emailid}`: An email address that represents a Google group.
        -   *    For example, `admins@example.com`.
        +   * For example, `admins@example.com`.
        +   *
            * * `deleted:user:{emailid}?uid={uniqueid}`: An email address (plus unique
        -   *    identifier) representing a user that has been recently deleted. For
        -   *    example, `alice@example.com?uid=123456789012345678901`. If the user is
        -   *    recovered, this value reverts to `user:{emailid}` and the recovered user
        -   *    retains the role in the binding.
        +   * identifier) representing a user that has been recently deleted. For
        +   * example, `alice@example.com?uid=123456789012345678901`. If the user is
        +   * recovered, this value reverts to `user:{emailid}` and the recovered user
        +   * retains the role in the binding.
        +   *
            * * `deleted:serviceAccount:{emailid}?uid={uniqueid}`: An email address (plus
        -   *    unique identifier) representing a service account that has been recently
        -   *    deleted. For example,
        -   *    `my-other-app@appspot.gserviceaccount.com?uid=123456789012345678901`.
        -   *    If the service account is undeleted, this value reverts to
        -   *    `serviceAccount:{emailid}` and the undeleted service account retains the
        -   *    role in the binding.
        +   * unique identifier) representing a service account that has been recently
        +   * deleted. For example,
        +   * `my-other-app@appspot.gserviceaccount.com?uid=123456789012345678901`.
        +   * If the service account is undeleted, this value reverts to
        +   * `serviceAccount:{emailid}` and the undeleted service account retains the
        +   * role in the binding.
        +   *
            * * `deleted:group:{emailid}?uid={uniqueid}`: An email address (plus unique
        -   *    identifier) representing a Google group that has been recently
        -   *    deleted. For example, `admins@example.com?uid=123456789012345678901`. If
        -   *    the group is recovered, this value reverts to `group:{emailid}` and the
        -   *    recovered group retains the role in the binding.
        +   * identifier) representing a Google group that has been recently
        +   * deleted. For example, `admins@example.com?uid=123456789012345678901`. If
        +   * the group is recovered, this value reverts to `group:{emailid}` and the
        +   * recovered group retains the role in the binding.
        +   *
        +   *
            * * `domain:{domain}`: The G Suite domain (primary) that represents all the
        -   *    users of that domain. For example, `google.com` or `example.com`.
        +   * users of that domain. For example, `google.com` or `example.com`.
            * 
        * * repeated string members = 2; @@ -177,41 +216,53 @@ public interface BindingOrBuilder * @return The members at the given index. */ java.lang.String getMembers(int index); + /** * * *
        -   * Specifies the principals requesting access for a Cloud Platform resource.
        +   * Specifies the principals requesting access for a Google Cloud resource.
            * `members` can have the following values:
        +   *
            * * `allUsers`: A special identifier that represents anyone who is
        -   *    on the internet; with or without a Google account.
        +   * on the internet; with or without a Google account.
        +   *
            * * `allAuthenticatedUsers`: A special identifier that represents anyone
        -   *    who is authenticated with a Google account or a service account.
        +   * who is authenticated with a Google account or a service account.
        +   *
            * * `user:{emailid}`: An email address that represents a specific Google
        -   *    account. For example, `alice@example.com` .
        +   * account. For example, `alice@example.com` .
        +   *
        +   *
            * * `serviceAccount:{emailid}`: An email address that represents a service
        -   *    account. For example, `my-other-app@appspot.gserviceaccount.com`.
        +   * account. For example, `my-other-app@appspot.gserviceaccount.com`.
        +   *
            * * `group:{emailid}`: An email address that represents a Google group.
        -   *    For example, `admins@example.com`.
        +   * For example, `admins@example.com`.
        +   *
            * * `deleted:user:{emailid}?uid={uniqueid}`: An email address (plus unique
        -   *    identifier) representing a user that has been recently deleted. For
        -   *    example, `alice@example.com?uid=123456789012345678901`. If the user is
        -   *    recovered, this value reverts to `user:{emailid}` and the recovered user
        -   *    retains the role in the binding.
        +   * identifier) representing a user that has been recently deleted. For
        +   * example, `alice@example.com?uid=123456789012345678901`. If the user is
        +   * recovered, this value reverts to `user:{emailid}` and the recovered user
        +   * retains the role in the binding.
        +   *
            * * `deleted:serviceAccount:{emailid}?uid={uniqueid}`: An email address (plus
        -   *    unique identifier) representing a service account that has been recently
        -   *    deleted. For example,
        -   *    `my-other-app@appspot.gserviceaccount.com?uid=123456789012345678901`.
        -   *    If the service account is undeleted, this value reverts to
        -   *    `serviceAccount:{emailid}` and the undeleted service account retains the
        -   *    role in the binding.
        +   * unique identifier) representing a service account that has been recently
        +   * deleted. For example,
        +   * `my-other-app@appspot.gserviceaccount.com?uid=123456789012345678901`.
        +   * If the service account is undeleted, this value reverts to
        +   * `serviceAccount:{emailid}` and the undeleted service account retains the
        +   * role in the binding.
        +   *
            * * `deleted:group:{emailid}?uid={uniqueid}`: An email address (plus unique
        -   *    identifier) representing a Google group that has been recently
        -   *    deleted. For example, `admins@example.com?uid=123456789012345678901`. If
        -   *    the group is recovered, this value reverts to `group:{emailid}` and the
        -   *    recovered group retains the role in the binding.
        +   * identifier) representing a Google group that has been recently
        +   * deleted. For example, `admins@example.com?uid=123456789012345678901`. If
        +   * the group is recovered, this value reverts to `group:{emailid}` and the
        +   * recovered group retains the role in the binding.
        +   *
        +   *
            * * `domain:{domain}`: The G Suite domain (primary) that represents all the
        -   *    users of that domain. For example, `google.com` or `example.com`.
        +   * users of that domain. For example, `google.com` or `example.com`.
            * 
        * * repeated string members = 2; @@ -226,11 +277,14 @@ public interface BindingOrBuilder * *
            * The condition that is associated with this binding.
        +   *
            * If the condition evaluates to `true`, then this binding applies to the
            * current request.
        +   *
            * If the condition evaluates to `false`, then this binding does not apply to
            * the current request. However, a different role binding might grant the same
            * role to one or more of the principals in this binding.
        +   *
            * To learn which resources support conditions in their IAM policies, see the
            * [IAM
            * documentation](https://cloud.google.com/iam/help/conditions/resource-policies).
        @@ -241,16 +295,20 @@ public interface BindingOrBuilder
            * @return Whether the condition field is set.
            */
           boolean hasCondition();
        +
           /**
            *
            *
            * 
            * The condition that is associated with this binding.
        +   *
            * If the condition evaluates to `true`, then this binding applies to the
            * current request.
        +   *
            * If the condition evaluates to `false`, then this binding does not apply to
            * the current request. However, a different role binding might grant the same
            * role to one or more of the principals in this binding.
        +   *
            * To learn which resources support conditions in their IAM policies, see the
            * [IAM
            * documentation](https://cloud.google.com/iam/help/conditions/resource-policies).
        @@ -261,16 +319,20 @@ public interface BindingOrBuilder
            * @return The condition.
            */
           com.google.type.Expr getCondition();
        +
           /**
            *
            *
            * 
            * The condition that is associated with this binding.
        +   *
            * If the condition evaluates to `true`, then this binding applies to the
            * current request.
        +   *
            * If the condition evaluates to `false`, then this binding does not apply to
            * the current request. However, a different role binding might grant the same
            * role to one or more of the principals in this binding.
        +   *
            * To learn which resources support conditions in their IAM policies, see the
            * [IAM
            * documentation](https://cloud.google.com/iam/help/conditions/resource-policies).
        diff --git a/java-iam/proto-google-iam-v1/src/main/java/com/google/iam/v1/GetIamPolicyRequest.java b/java-iam/proto-google-iam-v1/src/main/java/com/google/iam/v1/GetIamPolicyRequest.java
        index 883feeaae9..28f3641225 100644
        --- a/java-iam/proto-google-iam-v1/src/main/java/com/google/iam/v1/GetIamPolicyRequest.java
        +++ b/java-iam/proto-google-iam-v1/src/main/java/com/google/iam/v1/GetIamPolicyRequest.java
        @@ -1,5 +1,5 @@
         /*
        - * Copyright 2020 Google LLC
        + * Copyright 2026 Google LLC
          *
          * Licensed under the Apache License, Version 2.0 (the "License");
          * you may not use this file except in compliance with the License.
        @@ -14,7 +14,9 @@
          * limitations under the License.
          */
         // Generated by the protocol buffer compiler.  DO NOT EDIT!
        +// NO CHECKED-IN PROTOBUF GENCODE
         // source: google/iam/v1/iam_policy.proto
        +// Protobuf Java Version: 4.33.2
         
         package com.google.iam.v1;
         
        @@ -27,13 +29,25 @@
          *
          * Protobuf type {@code google.iam.v1.GetIamPolicyRequest}
          */
        -public final class GetIamPolicyRequest extends com.google.protobuf.GeneratedMessageV3
        +@com.google.protobuf.Generated
        +public final class GetIamPolicyRequest extends com.google.protobuf.GeneratedMessage
             implements
             // @@protoc_insertion_point(message_implements:google.iam.v1.GetIamPolicyRequest)
             GetIamPolicyRequestOrBuilder {
           private static final long serialVersionUID = 0L;
        +
        +  static {
        +    com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion(
        +        com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC,
        +        /* major= */ 4,
        +        /* minor= */ 33,
        +        /* patch= */ 2,
        +        /* suffix= */ "",
        +        "GetIamPolicyRequest");
        +  }
        +
           // Use GetIamPolicyRequest.newBuilder() to construct.
        -  private GetIamPolicyRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) {
        +  private GetIamPolicyRequest(com.google.protobuf.GeneratedMessage.Builder builder) {
             super(builder);
           }
         
        @@ -41,24 +55,13 @@ private GetIamPolicyRequest() {
             resource_ = "";
           }
         
        -  @java.lang.Override
        -  @SuppressWarnings({"unused"})
        -  protected java.lang.Object newInstance(UnusedPrivateParameter unused) {
        -    return new GetIamPolicyRequest();
        -  }
        -
        -  @java.lang.Override
        -  public final com.google.protobuf.UnknownFieldSet getUnknownFields() {
        -    return this.unknownFields;
        -  }
        -
           public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
             return com.google.iam.v1.IamPolicyProto
                 .internal_static_google_iam_v1_GetIamPolicyRequest_descriptor;
           }
         
           @java.lang.Override
        -  protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
        +  protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
               internalGetFieldAccessorTable() {
             return com.google.iam.v1.IamPolicyProto
                 .internal_static_google_iam_v1_GetIamPolicyRequest_fieldAccessorTable
        @@ -67,8 +70,12 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
                     com.google.iam.v1.GetIamPolicyRequest.Builder.class);
           }
         
        +  private int bitField0_;
           public static final int RESOURCE_FIELD_NUMBER = 1;
        -  private volatile java.lang.Object resource_;
        +
        +  @SuppressWarnings("serial")
        +  private volatile java.lang.Object resource_ = "";
        +
           /**
            *
            *
        @@ -95,6 +102,7 @@ public java.lang.String getResource() {
               return s;
             }
           }
        +
           /**
            *
            *
        @@ -124,6 +132,7 @@ public com.google.protobuf.ByteString getResourceBytes() {
         
           public static final int OPTIONS_FIELD_NUMBER = 2;
           private com.google.iam.v1.GetPolicyOptions options_;
        +
           /**
            *
            *
        @@ -138,8 +147,9 @@ public com.google.protobuf.ByteString getResourceBytes() {
            */
           @java.lang.Override
           public boolean hasOptions() {
        -    return options_ != null;
        +    return ((bitField0_ & 0x00000001) != 0);
           }
        +
           /**
            *
            *
        @@ -156,6 +166,7 @@ public boolean hasOptions() {
           public com.google.iam.v1.GetPolicyOptions getOptions() {
             return options_ == null ? com.google.iam.v1.GetPolicyOptions.getDefaultInstance() : options_;
           }
        +
           /**
            *
            *
        @@ -168,7 +179,7 @@ public com.google.iam.v1.GetPolicyOptions getOptions() {
            */
           @java.lang.Override
           public com.google.iam.v1.GetPolicyOptionsOrBuilder getOptionsOrBuilder() {
        -    return getOptions();
        +    return options_ == null ? com.google.iam.v1.GetPolicyOptions.getDefaultInstance() : options_;
           }
         
           private byte memoizedIsInitialized = -1;
        @@ -185,10 +196,10 @@ public final boolean isInitialized() {
         
           @java.lang.Override
           public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException {
        -    if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(resource_)) {
        -      com.google.protobuf.GeneratedMessageV3.writeString(output, 1, resource_);
        +    if (!com.google.protobuf.GeneratedMessage.isStringEmpty(resource_)) {
        +      com.google.protobuf.GeneratedMessage.writeString(output, 1, resource_);
             }
        -    if (options_ != null) {
        +    if (((bitField0_ & 0x00000001) != 0)) {
               output.writeMessage(2, getOptions());
             }
             getUnknownFields().writeTo(output);
        @@ -200,10 +211,10 @@ public int getSerializedSize() {
             if (size != -1) return size;
         
             size = 0;
        -    if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(resource_)) {
        -      size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, resource_);
        +    if (!com.google.protobuf.GeneratedMessage.isStringEmpty(resource_)) {
        +      size += com.google.protobuf.GeneratedMessage.computeStringSize(1, resource_);
             }
        -    if (options_ != null) {
        +    if (((bitField0_ & 0x00000001) != 0)) {
               size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getOptions());
             }
             size += getUnknownFields().getSerializedSize();
        @@ -284,38 +295,38 @@ public static com.google.iam.v1.GetIamPolicyRequest parseFrom(
         
           public static com.google.iam.v1.GetIamPolicyRequest parseFrom(java.io.InputStream input)
               throws java.io.IOException {
        -    return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
        +    return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input);
           }
         
           public static com.google.iam.v1.GetIamPolicyRequest parseFrom(
               java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
               throws java.io.IOException {
        -    return com.google.protobuf.GeneratedMessageV3.parseWithIOException(
        +    return com.google.protobuf.GeneratedMessage.parseWithIOException(
                 PARSER, input, extensionRegistry);
           }
         
           public static com.google.iam.v1.GetIamPolicyRequest parseDelimitedFrom(java.io.InputStream input)
               throws java.io.IOException {
        -    return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input);
        +    return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input);
           }
         
           public static com.google.iam.v1.GetIamPolicyRequest parseDelimitedFrom(
               java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
               throws java.io.IOException {
        -    return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(
        +    return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(
                 PARSER, input, extensionRegistry);
           }
         
           public static com.google.iam.v1.GetIamPolicyRequest parseFrom(
               com.google.protobuf.CodedInputStream input) throws java.io.IOException {
        -    return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
        +    return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input);
           }
         
           public static com.google.iam.v1.GetIamPolicyRequest parseFrom(
               com.google.protobuf.CodedInputStream input,
               com.google.protobuf.ExtensionRegistryLite extensionRegistry)
               throws java.io.IOException {
        -    return com.google.protobuf.GeneratedMessageV3.parseWithIOException(
        +    return com.google.protobuf.GeneratedMessage.parseWithIOException(
                 PARSER, input, extensionRegistry);
           }
         
        @@ -338,10 +349,11 @@ public Builder toBuilder() {
           }
         
           @java.lang.Override
        -  protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
        +  protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) {
             Builder builder = new Builder(parent);
             return builder;
           }
        +
           /**
            *
            *
        @@ -351,7 +363,7 @@ protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.Build
            *
            * Protobuf type {@code google.iam.v1.GetIamPolicyRequest}
            */
        -  public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder
        +  public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder
               implements
               // @@protoc_insertion_point(builder_implements:google.iam.v1.GetIamPolicyRequest)
               com.google.iam.v1.GetIamPolicyRequestOrBuilder {
        @@ -361,7 +373,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
             }
         
             @java.lang.Override
        -    protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
        +    protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
                 internalGetFieldAccessorTable() {
               return com.google.iam.v1.IamPolicyProto
                   .internal_static_google_iam_v1_GetIamPolicyRequest_fieldAccessorTable
        @@ -371,21 +383,29 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
             }
         
             // Construct using com.google.iam.v1.GetIamPolicyRequest.newBuilder()
        -    private Builder() {}
        +    private Builder() {
        +      maybeForceBuilderInitialization();
        +    }
         
        -    private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
        +    private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) {
               super(parent);
        +      maybeForceBuilderInitialization();
        +    }
        +
        +    private void maybeForceBuilderInitialization() {
        +      if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) {
        +        internalGetOptionsFieldBuilder();
        +      }
             }
         
             @java.lang.Override
             public Builder clear() {
               super.clear();
        +      bitField0_ = 0;
               resource_ = "";
        -
        -      if (optionsBuilder_ == null) {
        -        options_ = null;
        -      } else {
        -        options_ = null;
        +      options_ = null;
        +      if (optionsBuilder_ != null) {
        +        optionsBuilder_.dispose();
                 optionsBuilder_ = null;
               }
               return this;
        @@ -415,47 +435,24 @@ public com.google.iam.v1.GetIamPolicyRequest build() {
             public com.google.iam.v1.GetIamPolicyRequest buildPartial() {
               com.google.iam.v1.GetIamPolicyRequest result =
                   new com.google.iam.v1.GetIamPolicyRequest(this);
        -      result.resource_ = resource_;
        -      if (optionsBuilder_ == null) {
        -        result.options_ = options_;
        -      } else {
        -        result.options_ = optionsBuilder_.build();
        +      if (bitField0_ != 0) {
        +        buildPartial0(result);
               }
               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);
        +    private void buildPartial0(com.google.iam.v1.GetIamPolicyRequest result) {
        +      int from_bitField0_ = bitField0_;
        +      if (((from_bitField0_ & 0x00000001) != 0)) {
        +        result.resource_ = resource_;
        +      }
        +      int to_bitField0_ = 0;
        +      if (((from_bitField0_ & 0x00000002) != 0)) {
        +        result.options_ = optionsBuilder_ == null ? options_ : optionsBuilder_.build();
        +        to_bitField0_ |= 0x00000001;
        +      }
        +      result.bitField0_ |= to_bitField0_;
             }
         
             @java.lang.Override
        @@ -472,6 +469,7 @@ public Builder mergeFrom(com.google.iam.v1.GetIamPolicyRequest other) {
               if (other == com.google.iam.v1.GetIamPolicyRequest.getDefaultInstance()) return this;
               if (!other.getResource().isEmpty()) {
                 resource_ = other.resource_;
        +        bitField0_ |= 0x00000001;
                 onChanged();
               }
               if (other.hasOptions()) {
        @@ -506,13 +504,13 @@ public Builder mergeFrom(
                     case 10:
                       {
                         resource_ = input.readStringRequireUtf8();
        -
        +                bitField0_ |= 0x00000001;
                         break;
                       } // case 10
                     case 18:
                       {
        -                input.readMessage(getOptionsFieldBuilder().getBuilder(), extensionRegistry);
        -
        +                input.readMessage(internalGetOptionsFieldBuilder().getBuilder(), extensionRegistry);
        +                bitField0_ |= 0x00000002;
                         break;
                       } // case 18
                     default:
        @@ -532,7 +530,10 @@ public Builder mergeFrom(
               return this;
             }
         
        +    private int bitField0_;
        +
             private java.lang.Object resource_ = "";
        +
             /**
              *
              *
        @@ -558,6 +559,7 @@ public java.lang.String getResource() {
                 return (java.lang.String) ref;
               }
             }
        +
             /**
              *
              *
        @@ -583,6 +585,7 @@ public com.google.protobuf.ByteString getResourceBytes() {
                 return (com.google.protobuf.ByteString) ref;
               }
             }
        +
             /**
              *
              *
        @@ -602,11 +605,12 @@ public Builder setResource(java.lang.String value) {
               if (value == null) {
                 throw new NullPointerException();
               }
        -
               resource_ = value;
        +      bitField0_ |= 0x00000001;
               onChanged();
               return this;
             }
        +
             /**
              *
              *
        @@ -622,11 +626,12 @@ public Builder setResource(java.lang.String value) {
              * @return This builder for chaining.
              */
             public Builder clearResource() {
        -
               resource_ = getDefaultInstance().getResource();
        +      bitField0_ = (bitField0_ & ~0x00000001);
               onChanged();
               return this;
             }
        +
             /**
              *
              *
        @@ -647,18 +652,19 @@ public Builder setResourceBytes(com.google.protobuf.ByteString value) {
                 throw new NullPointerException();
               }
               checkByteStringIsUtf8(value);
        -
               resource_ = value;
        +      bitField0_ |= 0x00000001;
               onChanged();
               return this;
             }
         
             private com.google.iam.v1.GetPolicyOptions options_;
        -    private com.google.protobuf.SingleFieldBuilderV3<
        +    private com.google.protobuf.SingleFieldBuilder<
                     com.google.iam.v1.GetPolicyOptions,
                     com.google.iam.v1.GetPolicyOptions.Builder,
                     com.google.iam.v1.GetPolicyOptionsOrBuilder>
                 optionsBuilder_;
        +
             /**
              *
              *
        @@ -672,8 +678,9 @@ public Builder setResourceBytes(com.google.protobuf.ByteString value) {
              * @return Whether the options field is set.
              */
             public boolean hasOptions() {
        -      return optionsBuilder_ != null || options_ != null;
        +      return ((bitField0_ & 0x00000002) != 0);
             }
        +
             /**
              *
              *
        @@ -695,6 +702,7 @@ public com.google.iam.v1.GetPolicyOptions getOptions() {
                 return optionsBuilder_.getMessage();
               }
             }
        +
             /**
              *
              *
        @@ -711,13 +719,14 @@ public Builder setOptions(com.google.iam.v1.GetPolicyOptions value) {
                   throw new NullPointerException();
                 }
                 options_ = value;
        -        onChanged();
               } else {
                 optionsBuilder_.setMessage(value);
               }
        -
        +      bitField0_ |= 0x00000002;
        +      onChanged();
               return this;
             }
        +
             /**
              *
              *
        @@ -731,13 +740,14 @@ public Builder setOptions(com.google.iam.v1.GetPolicyOptions value) {
             public Builder setOptions(com.google.iam.v1.GetPolicyOptions.Builder builderForValue) {
               if (optionsBuilder_ == null) {
                 options_ = builderForValue.build();
        -        onChanged();
               } else {
                 optionsBuilder_.setMessage(builderForValue.build());
               }
        -
        +      bitField0_ |= 0x00000002;
        +      onChanged();
               return this;
             }
        +
             /**
              *
              *
        @@ -750,21 +760,23 @@ public Builder setOptions(com.google.iam.v1.GetPolicyOptions.Builder builderForV
              */
             public Builder mergeOptions(com.google.iam.v1.GetPolicyOptions value) {
               if (optionsBuilder_ == null) {
        -        if (options_ != null) {
        -          options_ =
        -              com.google.iam.v1.GetPolicyOptions.newBuilder(options_)
        -                  .mergeFrom(value)
        -                  .buildPartial();
        +        if (((bitField0_ & 0x00000002) != 0)
        +            && options_ != null
        +            && options_ != com.google.iam.v1.GetPolicyOptions.getDefaultInstance()) {
        +          getOptionsBuilder().mergeFrom(value);
                 } else {
                   options_ = value;
                 }
        -        onChanged();
               } else {
                 optionsBuilder_.mergeFrom(value);
               }
        -
        +      if (options_ != null) {
        +        bitField0_ |= 0x00000002;
        +        onChanged();
        +      }
               return this;
             }
        +
             /**
              *
              *
        @@ -776,16 +788,16 @@ public Builder mergeOptions(com.google.iam.v1.GetPolicyOptions value) {
              * .google.iam.v1.GetPolicyOptions options = 2;
              */
             public Builder clearOptions() {
        -      if (optionsBuilder_ == null) {
        -        options_ = null;
        -        onChanged();
        -      } else {
        -        options_ = null;
        +      bitField0_ = (bitField0_ & ~0x00000002);
        +      options_ = null;
        +      if (optionsBuilder_ != null) {
        +        optionsBuilder_.dispose();
                 optionsBuilder_ = null;
               }
        -
        +      onChanged();
               return this;
             }
        +
             /**
              *
              *
        @@ -797,10 +809,11 @@ public Builder clearOptions() {
              * .google.iam.v1.GetPolicyOptions options = 2;
              */
             public com.google.iam.v1.GetPolicyOptions.Builder getOptionsBuilder() {
        -
        +      bitField0_ |= 0x00000002;
               onChanged();
        -      return getOptionsFieldBuilder().getBuilder();
        +      return internalGetOptionsFieldBuilder().getBuilder();
             }
        +
             /**
              *
              *
        @@ -820,6 +833,7 @@ public com.google.iam.v1.GetPolicyOptionsOrBuilder getOptionsOrBuilder() {
                     : options_;
               }
             }
        +
             /**
              *
              *
        @@ -830,14 +844,14 @@ public com.google.iam.v1.GetPolicyOptionsOrBuilder getOptionsOrBuilder() {
              *
              * .google.iam.v1.GetPolicyOptions options = 2;
              */
        -    private com.google.protobuf.SingleFieldBuilderV3<
        +    private com.google.protobuf.SingleFieldBuilder<
                     com.google.iam.v1.GetPolicyOptions,
                     com.google.iam.v1.GetPolicyOptions.Builder,
                     com.google.iam.v1.GetPolicyOptionsOrBuilder>
        -        getOptionsFieldBuilder() {
        +        internalGetOptionsFieldBuilder() {
               if (optionsBuilder_ == null) {
                 optionsBuilder_ =
        -            new com.google.protobuf.SingleFieldBuilderV3<
        +            new com.google.protobuf.SingleFieldBuilder<
                         com.google.iam.v1.GetPolicyOptions,
                         com.google.iam.v1.GetPolicyOptions.Builder,
                         com.google.iam.v1.GetPolicyOptionsOrBuilder>(
        @@ -847,17 +861,6 @@ public com.google.iam.v1.GetPolicyOptionsOrBuilder getOptionsOrBuilder() {
               return optionsBuilder_;
             }
         
        -    @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.iam.v1.GetIamPolicyRequest)
           }
         
        diff --git a/java-iam/proto-google-iam-v1/src/main/java/com/google/iam/v1/GetIamPolicyRequestOrBuilder.java b/java-iam/proto-google-iam-v1/src/main/java/com/google/iam/v1/GetIamPolicyRequestOrBuilder.java
        index 5f90592d42..750f5413b9 100644
        --- a/java-iam/proto-google-iam-v1/src/main/java/com/google/iam/v1/GetIamPolicyRequestOrBuilder.java
        +++ b/java-iam/proto-google-iam-v1/src/main/java/com/google/iam/v1/GetIamPolicyRequestOrBuilder.java
        @@ -1,5 +1,5 @@
         /*
        - * Copyright 2020 Google LLC
        + * Copyright 2026 Google LLC
          *
          * Licensed under the Apache License, Version 2.0 (the "License");
          * you may not use this file except in compliance with the License.
        @@ -14,10 +14,13 @@
          * limitations under the License.
          */
         // Generated by the protocol buffer compiler.  DO NOT EDIT!
        +// NO CHECKED-IN PROTOBUF GENCODE
         // source: google/iam/v1/iam_policy.proto
        +// Protobuf Java Version: 4.33.2
         
         package com.google.iam.v1;
         
        +@com.google.protobuf.Generated
         public interface GetIamPolicyRequestOrBuilder
             extends
             // @@protoc_insertion_point(interface_extends:google.iam.v1.GetIamPolicyRequest)
        @@ -38,6 +41,7 @@ public interface GetIamPolicyRequestOrBuilder
            * @return The resource.
            */
           java.lang.String getResource();
        +
           /**
            *
            *
        @@ -67,6 +71,7 @@ public interface GetIamPolicyRequestOrBuilder
            * @return Whether the options field is set.
            */
           boolean hasOptions();
        +
           /**
            *
            *
        @@ -80,6 +85,7 @@ public interface GetIamPolicyRequestOrBuilder
            * @return The options.
            */
           com.google.iam.v1.GetPolicyOptions getOptions();
        +
           /**
            *
            *
        diff --git a/java-iam/proto-google-iam-v1/src/main/java/com/google/iam/v1/GetPolicyOptions.java b/java-iam/proto-google-iam-v1/src/main/java/com/google/iam/v1/GetPolicyOptions.java
        index 1c427ecb8d..2160f09064 100644
        --- a/java-iam/proto-google-iam-v1/src/main/java/com/google/iam/v1/GetPolicyOptions.java
        +++ b/java-iam/proto-google-iam-v1/src/main/java/com/google/iam/v1/GetPolicyOptions.java
        @@ -1,5 +1,5 @@
         /*
        - * Copyright 2020 Google LLC
        + * Copyright 2026 Google LLC
          *
          * Licensed under the Apache License, Version 2.0 (the "License");
          * you may not use this file except in compliance with the License.
        @@ -14,7 +14,9 @@
          * limitations under the License.
          */
         // Generated by the protocol buffer compiler.  DO NOT EDIT!
        +// NO CHECKED-IN PROTOBUF GENCODE
         // source: google/iam/v1/options.proto
        +// Protobuf Java Version: 4.33.2
         
         package com.google.iam.v1;
         
        @@ -27,35 +29,36 @@
          *
          * Protobuf type {@code google.iam.v1.GetPolicyOptions}
          */
        -public final class GetPolicyOptions extends com.google.protobuf.GeneratedMessageV3
        +@com.google.protobuf.Generated
        +public final class GetPolicyOptions extends com.google.protobuf.GeneratedMessage
             implements
             // @@protoc_insertion_point(message_implements:google.iam.v1.GetPolicyOptions)
             GetPolicyOptionsOrBuilder {
           private static final long serialVersionUID = 0L;
        +
        +  static {
        +    com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion(
        +        com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC,
        +        /* major= */ 4,
        +        /* minor= */ 33,
        +        /* patch= */ 2,
        +        /* suffix= */ "",
        +        "GetPolicyOptions");
        +  }
        +
           // Use GetPolicyOptions.newBuilder() to construct.
        -  private GetPolicyOptions(com.google.protobuf.GeneratedMessageV3.Builder builder) {
        +  private GetPolicyOptions(com.google.protobuf.GeneratedMessage.Builder builder) {
             super(builder);
           }
         
           private GetPolicyOptions() {}
         
        -  @java.lang.Override
        -  @SuppressWarnings({"unused"})
        -  protected java.lang.Object newInstance(UnusedPrivateParameter unused) {
        -    return new GetPolicyOptions();
        -  }
        -
        -  @java.lang.Override
        -  public final com.google.protobuf.UnknownFieldSet getUnknownFields() {
        -    return this.unknownFields;
        -  }
        -
           public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
             return com.google.iam.v1.OptionsProto.internal_static_google_iam_v1_GetPolicyOptions_descriptor;
           }
         
           @java.lang.Override
        -  protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
        +  protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
               internalGetFieldAccessorTable() {
             return com.google.iam.v1.OptionsProto
                 .internal_static_google_iam_v1_GetPolicyOptions_fieldAccessorTable
        @@ -65,22 +68,27 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
           }
         
           public static final int REQUESTED_POLICY_VERSION_FIELD_NUMBER = 1;
        -  private int requestedPolicyVersion_;
        +  private int requestedPolicyVersion_ = 0;
        +
           /**
            *
            *
            * 
            * Optional. The maximum policy version that will be used to format the
            * policy.
        +   *
            * Valid values are 0, 1, and 3. Requests specifying an invalid value will be
            * rejected.
        +   *
            * Requests for policies with any conditional role bindings must specify
            * version 3. Policies with no conditional role bindings may specify any valid
            * value or leave the field unset.
        +   *
            * The policy in the response might use the policy version that you specified,
            * or it might use a lower policy version. For example, if you specify version
            * 3, but the policy has no conditional role bindings, the response uses
            * version 1.
        +   *
            * To learn which resources support conditions in their IAM policies, see the
            * [IAM
            * documentation](https://cloud.google.com/iam/help/conditions/resource-policies).
        @@ -194,38 +202,38 @@ public static com.google.iam.v1.GetPolicyOptions parseFrom(
         
           public static com.google.iam.v1.GetPolicyOptions parseFrom(java.io.InputStream input)
               throws java.io.IOException {
        -    return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
        +    return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input);
           }
         
           public static com.google.iam.v1.GetPolicyOptions parseFrom(
               java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
               throws java.io.IOException {
        -    return com.google.protobuf.GeneratedMessageV3.parseWithIOException(
        +    return com.google.protobuf.GeneratedMessage.parseWithIOException(
                 PARSER, input, extensionRegistry);
           }
         
           public static com.google.iam.v1.GetPolicyOptions parseDelimitedFrom(java.io.InputStream input)
               throws java.io.IOException {
        -    return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input);
        +    return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input);
           }
         
           public static com.google.iam.v1.GetPolicyOptions parseDelimitedFrom(
               java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
               throws java.io.IOException {
        -    return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(
        +    return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(
                 PARSER, input, extensionRegistry);
           }
         
           public static com.google.iam.v1.GetPolicyOptions parseFrom(
               com.google.protobuf.CodedInputStream input) throws java.io.IOException {
        -    return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
        +    return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input);
           }
         
           public static com.google.iam.v1.GetPolicyOptions parseFrom(
               com.google.protobuf.CodedInputStream input,
               com.google.protobuf.ExtensionRegistryLite extensionRegistry)
               throws java.io.IOException {
        -    return com.google.protobuf.GeneratedMessageV3.parseWithIOException(
        +    return com.google.protobuf.GeneratedMessage.parseWithIOException(
                 PARSER, input, extensionRegistry);
           }
         
        @@ -248,10 +256,11 @@ public Builder toBuilder() {
           }
         
           @java.lang.Override
        -  protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
        +  protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) {
             Builder builder = new Builder(parent);
             return builder;
           }
        +
           /**
            *
            *
        @@ -261,7 +270,7 @@ protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.Build
            *
            * Protobuf type {@code google.iam.v1.GetPolicyOptions}
            */
        -  public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder
        +  public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder
               implements
               // @@protoc_insertion_point(builder_implements:google.iam.v1.GetPolicyOptions)
               com.google.iam.v1.GetPolicyOptionsOrBuilder {
        @@ -271,7 +280,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
             }
         
             @java.lang.Override
        -    protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
        +    protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
                 internalGetFieldAccessorTable() {
               return com.google.iam.v1.OptionsProto
                   .internal_static_google_iam_v1_GetPolicyOptions_fieldAccessorTable
        @@ -283,15 +292,15 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
             // Construct using com.google.iam.v1.GetPolicyOptions.newBuilder()
             private Builder() {}
         
        -    private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
        +    private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) {
               super(parent);
             }
         
             @java.lang.Override
             public Builder clear() {
               super.clear();
        +      bitField0_ = 0;
               requestedPolicyVersion_ = 0;
        -
               return this;
             }
         
        @@ -318,42 +327,18 @@ public com.google.iam.v1.GetPolicyOptions build() {
             @java.lang.Override
             public com.google.iam.v1.GetPolicyOptions buildPartial() {
               com.google.iam.v1.GetPolicyOptions result = new com.google.iam.v1.GetPolicyOptions(this);
        -      result.requestedPolicyVersion_ = requestedPolicyVersion_;
        +      if (bitField0_ != 0) {
        +        buildPartial0(result);
        +      }
               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);
        +    private void buildPartial0(com.google.iam.v1.GetPolicyOptions result) {
        +      int from_bitField0_ = bitField0_;
        +      if (((from_bitField0_ & 0x00000001) != 0)) {
        +        result.requestedPolicyVersion_ = requestedPolicyVersion_;
        +      }
             }
         
             @java.lang.Override
        @@ -400,7 +385,7 @@ public Builder mergeFrom(
                     case 8:
                       {
                         requestedPolicyVersion_ = input.readInt32();
        -
        +                bitField0_ |= 0x00000001;
                         break;
                       } // case 8
                     default:
        @@ -420,22 +405,29 @@ public Builder mergeFrom(
               return this;
             }
         
        +    private int bitField0_;
        +
             private int requestedPolicyVersion_;
        +
             /**
              *
              *
              * 
              * Optional. The maximum policy version that will be used to format the
              * policy.
        +     *
              * Valid values are 0, 1, and 3. Requests specifying an invalid value will be
              * rejected.
        +     *
              * Requests for policies with any conditional role bindings must specify
              * version 3. Policies with no conditional role bindings may specify any valid
              * value or leave the field unset.
        +     *
              * The policy in the response might use the policy version that you specified,
              * or it might use a lower policy version. For example, if you specify version
              * 3, but the policy has no conditional role bindings, the response uses
              * version 1.
        +     *
              * To learn which resources support conditions in their IAM policies, see the
              * [IAM
              * documentation](https://cloud.google.com/iam/help/conditions/resource-policies).
        @@ -449,21 +441,26 @@ public Builder mergeFrom(
             public int getRequestedPolicyVersion() {
               return requestedPolicyVersion_;
             }
        +
             /**
              *
              *
              * 
              * Optional. The maximum policy version that will be used to format the
              * policy.
        +     *
              * Valid values are 0, 1, and 3. Requests specifying an invalid value will be
              * rejected.
        +     *
              * Requests for policies with any conditional role bindings must specify
              * version 3. Policies with no conditional role bindings may specify any valid
              * value or leave the field unset.
        +     *
              * The policy in the response might use the policy version that you specified,
              * or it might use a lower policy version. For example, if you specify version
              * 3, but the policy has no conditional role bindings, the response uses
              * version 1.
        +     *
              * To learn which resources support conditions in their IAM policies, see the
              * [IAM
              * documentation](https://cloud.google.com/iam/help/conditions/resource-policies).
        @@ -477,24 +474,30 @@ public int getRequestedPolicyVersion() {
             public Builder setRequestedPolicyVersion(int value) {
         
               requestedPolicyVersion_ = value;
        +      bitField0_ |= 0x00000001;
               onChanged();
               return this;
             }
        +
             /**
              *
              *
              * 
              * Optional. The maximum policy version that will be used to format the
              * policy.
        +     *
              * Valid values are 0, 1, and 3. Requests specifying an invalid value will be
              * rejected.
        +     *
              * Requests for policies with any conditional role bindings must specify
              * version 3. Policies with no conditional role bindings may specify any valid
              * value or leave the field unset.
        +     *
              * The policy in the response might use the policy version that you specified,
              * or it might use a lower policy version. For example, if you specify version
              * 3, but the policy has no conditional role bindings, the response uses
              * version 1.
        +     *
              * To learn which resources support conditions in their IAM policies, see the
              * [IAM
              * documentation](https://cloud.google.com/iam/help/conditions/resource-policies).
        @@ -505,23 +508,12 @@ public Builder setRequestedPolicyVersion(int value) {
              * @return This builder for chaining.
              */
             public Builder clearRequestedPolicyVersion() {
        -
        +      bitField0_ = (bitField0_ & ~0x00000001);
               requestedPolicyVersion_ = 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.iam.v1.GetPolicyOptions)
           }
         
        diff --git a/java-iam/proto-google-iam-v1/src/main/java/com/google/iam/v1/GetPolicyOptionsOrBuilder.java b/java-iam/proto-google-iam-v1/src/main/java/com/google/iam/v1/GetPolicyOptionsOrBuilder.java
        index 1cd51a9971..de8c4f0158 100644
        --- a/java-iam/proto-google-iam-v1/src/main/java/com/google/iam/v1/GetPolicyOptionsOrBuilder.java
        +++ b/java-iam/proto-google-iam-v1/src/main/java/com/google/iam/v1/GetPolicyOptionsOrBuilder.java
        @@ -1,5 +1,5 @@
         /*
        - * Copyright 2020 Google LLC
        + * Copyright 2026 Google LLC
          *
          * Licensed under the Apache License, Version 2.0 (the "License");
          * you may not use this file except in compliance with the License.
        @@ -14,10 +14,13 @@
          * limitations under the License.
          */
         // Generated by the protocol buffer compiler.  DO NOT EDIT!
        +// NO CHECKED-IN PROTOBUF GENCODE
         // source: google/iam/v1/options.proto
        +// Protobuf Java Version: 4.33.2
         
         package com.google.iam.v1;
         
        +@com.google.protobuf.Generated
         public interface GetPolicyOptionsOrBuilder
             extends
             // @@protoc_insertion_point(interface_extends:google.iam.v1.GetPolicyOptions)
        @@ -29,15 +32,19 @@ public interface GetPolicyOptionsOrBuilder
            * 
            * Optional. The maximum policy version that will be used to format the
            * policy.
        +   *
            * Valid values are 0, 1, and 3. Requests specifying an invalid value will be
            * rejected.
        +   *
            * Requests for policies with any conditional role bindings must specify
            * version 3. Policies with no conditional role bindings may specify any valid
            * value or leave the field unset.
        +   *
            * The policy in the response might use the policy version that you specified,
            * or it might use a lower policy version. For example, if you specify version
            * 3, but the policy has no conditional role bindings, the response uses
            * version 1.
        +   *
            * To learn which resources support conditions in their IAM policies, see the
            * [IAM
            * documentation](https://cloud.google.com/iam/help/conditions/resource-policies).
        diff --git a/java-iam/proto-google-iam-v1/src/main/java/com/google/iam/v1/IamPolicyProto.java b/java-iam/proto-google-iam-v1/src/main/java/com/google/iam/v1/IamPolicyProto.java
        index 57652c10d9..2488f07ee3 100644
        --- a/java-iam/proto-google-iam-v1/src/main/java/com/google/iam/v1/IamPolicyProto.java
        +++ b/java-iam/proto-google-iam-v1/src/main/java/com/google/iam/v1/IamPolicyProto.java
        @@ -1,5 +1,5 @@
         /*
        - * Copyright 2020 Google LLC
        + * Copyright 2026 Google LLC
          *
          * Licensed under the Apache License, Version 2.0 (the "License");
          * you may not use this file except in compliance with the License.
        @@ -14,13 +14,26 @@
          * limitations under the License.
          */
         // Generated by the protocol buffer compiler.  DO NOT EDIT!
        +// NO CHECKED-IN PROTOBUF GENCODE
         // source: google/iam/v1/iam_policy.proto
        +// Protobuf Java Version: 4.33.2
         
         package com.google.iam.v1;
         
        -public final class IamPolicyProto {
        +@com.google.protobuf.Generated
        +public final class IamPolicyProto extends com.google.protobuf.GeneratedFile {
           private IamPolicyProto() {}
         
        +  static {
        +    com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion(
        +        com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC,
        +        /* major= */ 4,
        +        /* minor= */ 33,
        +        /* patch= */ 2,
        +        /* suffix= */ "",
        +        "IamPolicyProto");
        +  }
        +
           public static void registerAllExtensions(com.google.protobuf.ExtensionRegistryLite registry) {}
         
           public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry registry) {
        @@ -29,19 +42,19 @@ public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry r
         
           static final com.google.protobuf.Descriptors.Descriptor
               internal_static_google_iam_v1_SetIamPolicyRequest_descriptor;
        -  static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
        +  static final com.google.protobuf.GeneratedMessage.FieldAccessorTable
               internal_static_google_iam_v1_SetIamPolicyRequest_fieldAccessorTable;
           static final com.google.protobuf.Descriptors.Descriptor
               internal_static_google_iam_v1_GetIamPolicyRequest_descriptor;
        -  static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
        +  static final com.google.protobuf.GeneratedMessage.FieldAccessorTable
               internal_static_google_iam_v1_GetIamPolicyRequest_fieldAccessorTable;
           static final com.google.protobuf.Descriptors.Descriptor
               internal_static_google_iam_v1_TestIamPermissionsRequest_descriptor;
        -  static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
        +  static final com.google.protobuf.GeneratedMessage.FieldAccessorTable
               internal_static_google_iam_v1_TestIamPermissionsRequest_fieldAccessorTable;
           static final com.google.protobuf.Descriptors.Descriptor
               internal_static_google_iam_v1_TestIamPermissionsResponse_descriptor;
        -  static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
        +  static final com.google.protobuf.GeneratedMessage.FieldAccessorTable
               internal_static_google_iam_v1_TestIamPermissionsResponse_fieldAccessorTable;
         
           public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() {
        @@ -78,11 +91,11 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() {
                   + "am.v1.TestIamPermissionsRequest\032).google"
                   + ".iam.v1.TestIamPermissionsResponse\"/\202\323\344\223"
                   + "\002)\"$/v1/{resource=**}:testIamPermissions"
        -          + ":\001*\032\036\312A\033iam-meta-api.googleapis.comB\206\001\n\021"
        -          + "com.google.iam.v1B\016IamPolicyProtoP\001Z0goo"
        -          + "gle.golang.org/genproto/googleapis/iam/v"
        -          + "1;iam\370\001\001\252\002\023Google.Cloud.Iam.V1\312\002\023Google\\"
        -          + "Cloud\\Iam\\V1b\006proto3"
        +          + ":\001*\032\036\312A\033iam-meta-api.googleapis.comB|\n\021c"
        +          + "om.google.iam.v1B\016IamPolicyProtoP\001Z)clou"
        +          + "d.google.com/go/iam/apiv1/iampb;iampb\252\002\023"
        +          + "Google.Cloud.Iam.V1\312\002\023Google\\Cloud\\Iam\\V"
        +          + "1b\006proto3"
             };
             descriptor =
                 com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom(
        @@ -97,37 +110,45 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() {
                       com.google.protobuf.FieldMaskProto.getDescriptor(),
                     });
             internal_static_google_iam_v1_SetIamPolicyRequest_descriptor =
        -        getDescriptor().getMessageTypes().get(0);
        +        getDescriptor().getMessageType(0);
             internal_static_google_iam_v1_SetIamPolicyRequest_fieldAccessorTable =
        -        new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
        +        new com.google.protobuf.GeneratedMessage.FieldAccessorTable(
                     internal_static_google_iam_v1_SetIamPolicyRequest_descriptor,
                     new java.lang.String[] {
                       "Resource", "Policy", "UpdateMask",
                     });
             internal_static_google_iam_v1_GetIamPolicyRequest_descriptor =
        -        getDescriptor().getMessageTypes().get(1);
        +        getDescriptor().getMessageType(1);
             internal_static_google_iam_v1_GetIamPolicyRequest_fieldAccessorTable =
        -        new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
        +        new com.google.protobuf.GeneratedMessage.FieldAccessorTable(
                     internal_static_google_iam_v1_GetIamPolicyRequest_descriptor,
                     new java.lang.String[] {
                       "Resource", "Options",
                     });
             internal_static_google_iam_v1_TestIamPermissionsRequest_descriptor =
        -        getDescriptor().getMessageTypes().get(2);
        +        getDescriptor().getMessageType(2);
             internal_static_google_iam_v1_TestIamPermissionsRequest_fieldAccessorTable =
        -        new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
        +        new com.google.protobuf.GeneratedMessage.FieldAccessorTable(
                     internal_static_google_iam_v1_TestIamPermissionsRequest_descriptor,
                     new java.lang.String[] {
                       "Resource", "Permissions",
                     });
             internal_static_google_iam_v1_TestIamPermissionsResponse_descriptor =
        -        getDescriptor().getMessageTypes().get(3);
        +        getDescriptor().getMessageType(3);
             internal_static_google_iam_v1_TestIamPermissionsResponse_fieldAccessorTable =
        -        new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
        +        new com.google.protobuf.GeneratedMessage.FieldAccessorTable(
                     internal_static_google_iam_v1_TestIamPermissionsResponse_descriptor,
                     new java.lang.String[] {
                       "Permissions",
                     });
        +    descriptor.resolveAllFeaturesImmutable();
        +    com.google.api.AnnotationsProto.getDescriptor();
        +    com.google.api.ClientProto.getDescriptor();
        +    com.google.api.FieldBehaviorProto.getDescriptor();
        +    com.google.api.ResourceProto.getDescriptor();
        +    com.google.iam.v1.OptionsProto.getDescriptor();
        +    com.google.iam.v1.PolicyProto.getDescriptor();
        +    com.google.protobuf.FieldMaskProto.getDescriptor();
             com.google.protobuf.ExtensionRegistry registry =
                 com.google.protobuf.ExtensionRegistry.newInstance();
             registry.add(com.google.api.ClientProto.defaultHost);
        @@ -136,13 +157,6 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() {
             registry.add(com.google.api.ResourceProto.resourceReference);
             com.google.protobuf.Descriptors.FileDescriptor.internalUpdateFileDescriptor(
                 descriptor, registry);
        -    com.google.api.AnnotationsProto.getDescriptor();
        -    com.google.api.ClientProto.getDescriptor();
        -    com.google.api.FieldBehaviorProto.getDescriptor();
        -    com.google.api.ResourceProto.getDescriptor();
        -    com.google.iam.v1.OptionsProto.getDescriptor();
        -    com.google.iam.v1.PolicyProto.getDescriptor();
        -    com.google.protobuf.FieldMaskProto.getDescriptor();
           }
         
           // @@protoc_insertion_point(outer_class_scope)
        diff --git a/java-iam/proto-google-iam-v1/src/main/java/com/google/iam/v1/OptionsProto.java b/java-iam/proto-google-iam-v1/src/main/java/com/google/iam/v1/OptionsProto.java
        index 9c13280b2b..59e313ca88 100644
        --- a/java-iam/proto-google-iam-v1/src/main/java/com/google/iam/v1/OptionsProto.java
        +++ b/java-iam/proto-google-iam-v1/src/main/java/com/google/iam/v1/OptionsProto.java
        @@ -1,5 +1,5 @@
         /*
        - * Copyright 2020 Google LLC
        + * Copyright 2026 Google LLC
          *
          * Licensed under the Apache License, Version 2.0 (the "License");
          * you may not use this file except in compliance with the License.
        @@ -14,13 +14,26 @@
          * limitations under the License.
          */
         // Generated by the protocol buffer compiler.  DO NOT EDIT!
        +// NO CHECKED-IN PROTOBUF GENCODE
         // source: google/iam/v1/options.proto
        +// Protobuf Java Version: 4.33.2
         
         package com.google.iam.v1;
         
        -public final class OptionsProto {
        +@com.google.protobuf.Generated
        +public final class OptionsProto extends com.google.protobuf.GeneratedFile {
           private OptionsProto() {}
         
        +  static {
        +    com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion(
        +        com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC,
        +        /* major= */ 4,
        +        /* minor= */ 33,
        +        /* patch= */ 2,
        +        /* suffix= */ "",
        +        "OptionsProto");
        +  }
        +
           public static void registerAllExtensions(com.google.protobuf.ExtensionRegistryLite registry) {}
         
           public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry registry) {
        @@ -29,7 +42,7 @@ public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry r
         
           static final com.google.protobuf.Descriptors.Descriptor
               internal_static_google_iam_v1_GetPolicyOptions_descriptor;
        -  static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
        +  static final com.google.protobuf.GeneratedMessage.FieldAccessorTable
               internal_static_google_iam_v1_GetPolicyOptions_fieldAccessorTable;
         
           public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() {
        @@ -42,23 +55,22 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() {
             java.lang.String[] descriptorData = {
               "\n\033google/iam/v1/options.proto\022\rgoogle.ia"
                   + "m.v1\"4\n\020GetPolicyOptions\022 \n\030requested_po"
        -          + "licy_version\030\001 \001(\005B\204\001\n\021com.google.iam.v1"
        -          + "B\014OptionsProtoP\001Z0google.golang.org/genp"
        -          + "roto/googleapis/iam/v1;iam\370\001\001\252\002\023Google.C"
        -          + "loud.Iam.V1\312\002\023Google\\Cloud\\Iam\\V1b\006proto"
        -          + "3"
        +          + "licy_version\030\001 \001(\005B}\n\021com.google.iam.v1B"
        +          + "\014OptionsProtoP\001Z)cloud.google.com/go/iam"
        +          + "/apiv1/iampb;iampb\370\001\001\252\002\023Google.Cloud.Iam"
        +          + ".V1\312\002\023Google\\Cloud\\Iam\\V1b\006proto3"
             };
             descriptor =
                 com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom(
                     descriptorData, new com.google.protobuf.Descriptors.FileDescriptor[] {});
        -    internal_static_google_iam_v1_GetPolicyOptions_descriptor =
        -        getDescriptor().getMessageTypes().get(0);
        +    internal_static_google_iam_v1_GetPolicyOptions_descriptor = getDescriptor().getMessageType(0);
             internal_static_google_iam_v1_GetPolicyOptions_fieldAccessorTable =
        -        new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
        +        new com.google.protobuf.GeneratedMessage.FieldAccessorTable(
                     internal_static_google_iam_v1_GetPolicyOptions_descriptor,
                     new java.lang.String[] {
                       "RequestedPolicyVersion",
                     });
        +    descriptor.resolveAllFeaturesImmutable();
           }
         
           // @@protoc_insertion_point(outer_class_scope)
        diff --git a/java-iam/proto-google-iam-v1/src/main/java/com/google/iam/v1/Policy.java b/java-iam/proto-google-iam-v1/src/main/java/com/google/iam/v1/Policy.java
        index b03aa80d06..ee80fb64dd 100644
        --- a/java-iam/proto-google-iam-v1/src/main/java/com/google/iam/v1/Policy.java
        +++ b/java-iam/proto-google-iam-v1/src/main/java/com/google/iam/v1/Policy.java
        @@ -1,5 +1,5 @@
         /*
        - * Copyright 2020 Google LLC
        + * Copyright 2026 Google LLC
          *
          * Licensed under the Apache License, Version 2.0 (the "License");
          * you may not use this file except in compliance with the License.
        @@ -14,7 +14,9 @@
          * limitations under the License.
          */
         // Generated by the protocol buffer compiler.  DO NOT EDIT!
        +// NO CHECKED-IN PROTOBUF GENCODE
         // source: google/iam/v1/policy.proto
        +// Protobuf Java Version: 4.33.2
         
         package com.google.iam.v1;
         
        @@ -24,74 +26,100 @@
          * 
          * An Identity and Access Management (IAM) policy, which specifies access
          * controls for Google Cloud resources.
        + *
        + *
          * A `Policy` is a collection of `bindings`. A `binding` binds one or more
          * `members`, or principals, to a single `role`. Principals can be user
          * accounts, service accounts, Google groups, and domains (such as G Suite). A
          * `role` is a named list of permissions; each `role` can be an IAM predefined
          * role or a user-created custom role.
        + *
          * For some types of Google Cloud resources, a `binding` can also specify a
          * `condition`, which is a logical expression that allows access to a resource
          * only if the expression evaluates to `true`. A condition can add constraints
          * based on attributes of the request, the resource, or both. To learn which
          * resources support conditions in their IAM policies, see the
        - * [IAM documentation](https://cloud.google.com/iam/help/conditions/resource-policies).
        + * [IAM
        + * documentation](https://cloud.google.com/iam/help/conditions/resource-policies).
        + *
          * **JSON example:**
        - *     {
        - *       "bindings": [
        - *         {
        - *           "role": "roles/resourcemanager.organizationAdmin",
        - *           "members": [
        - *             "user:mike@example.com",
        - *             "group:admins@example.com",
        - *             "domain:google.com",
        - *             "serviceAccount:my-project-id@appspot.gserviceaccount.com"
        - *           ]
        - *         },
        - *         {
        - *           "role": "roles/resourcemanager.organizationViewer",
        - *           "members": [
        - *             "user:eve@example.com"
        - *           ],
        - *           "condition": {
        - *             "title": "expirable access",
        - *             "description": "Does not grant access after Sep 2020",
        - *             "expression": "request.time < timestamp('2020-10-01T00:00:00.000Z')",
        - *           }
        - *         }
        - *       ],
        - *       "etag": "BwWWja0YfJA=",
        - *       "version": 3
        - *     }
        + *
        + * ```
        + * {
        + * "bindings": [
        + * {
        + * "role": "roles/resourcemanager.organizationAdmin",
        + * "members": [
        + * "user:mike@example.com",
        + * "group:admins@example.com",
        + * "domain:google.com",
        + * "serviceAccount:my-project-id@appspot.gserviceaccount.com"
        + * ]
        + * },
        + * {
        + * "role": "roles/resourcemanager.organizationViewer",
        + * "members": [
        + * "user:eve@example.com"
        + * ],
        + * "condition": {
        + * "title": "expirable access",
        + * "description": "Does not grant access after Sep 2020",
        + * "expression": "request.time <
        + * timestamp('2020-10-01T00:00:00.000Z')",
        + * }
        + * }
        + * ],
        + * "etag": "BwWWja0YfJA=",
        + * "version": 3
        + * }
        + * ```
        + *
          * **YAML example:**
        - *     bindings:
        - *     - members:
        - *       - user:mike@example.com
        - *       - group:admins@example.com
        - *       - domain:google.com
        - *       - serviceAccount:my-project-id@appspot.gserviceaccount.com
        - *       role: roles/resourcemanager.organizationAdmin
        - *     - members:
        - *       - user:eve@example.com
        - *       role: roles/resourcemanager.organizationViewer
        - *       condition:
        - *         title: expirable access
        - *         description: Does not grant access after Sep 2020
        - *         expression: request.time < timestamp('2020-10-01T00:00:00.000Z')
        - *     etag: BwWWja0YfJA=
        - *     version: 3
        + *
        + * ```
        + * bindings:
        + * - members:
        + * - user:mike@example.com
        + * - group:admins@example.com
        + * - domain:google.com
        + * - serviceAccount:my-project-id@appspot.gserviceaccount.com
        + * role: roles/resourcemanager.organizationAdmin
        + * - members:
        + * - user:eve@example.com
        + * role: roles/resourcemanager.organizationViewer
        + * condition:
        + * title: expirable access
        + * description: Does not grant access after Sep 2020
        + * expression: request.time < timestamp('2020-10-01T00:00:00.000Z')
        + * etag: BwWWja0YfJA=
        + * version: 3
        + * ```
        + *
          * For a description of IAM and its features, see the
          * [IAM documentation](https://cloud.google.com/iam/docs/).
          * 
        * * Protobuf type {@code google.iam.v1.Policy} */ -public final class Policy extends com.google.protobuf.GeneratedMessageV3 +@com.google.protobuf.Generated +public final class Policy extends com.google.protobuf.GeneratedMessage implements // @@protoc_insertion_point(message_implements:google.iam.v1.Policy) PolicyOrBuilder { private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "Policy"); + } + // Use Policy.newBuilder() to construct. - private Policy(com.google.protobuf.GeneratedMessageV3.Builder builder) { + private Policy(com.google.protobuf.GeneratedMessage.Builder builder) { super(builder); } @@ -101,23 +129,12 @@ private Policy() { etag_ = com.google.protobuf.ByteString.EMPTY; } - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new Policy(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.iam.v1.PolicyProto.internal_static_google_iam_v1_Policy_descriptor; } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.iam.v1.PolicyProto.internal_static_google_iam_v1_Policy_fieldAccessorTable .ensureFieldAccessorsInitialized( @@ -125,29 +142,37 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } public static final int VERSION_FIELD_NUMBER = 1; - private int version_; + private int version_ = 0; + /** * * *
            * Specifies the format of the policy.
        +   *
            * Valid values are `0`, `1`, and `3`. Requests that specify an invalid value
            * are rejected.
        +   *
            * Any operation that affects conditional role bindings must specify version
            * `3`. This requirement applies to the following operations:
        +   *
            * * Getting a policy that includes a conditional role binding
            * * Adding a conditional role binding to a policy
            * * Changing a conditional role binding in a policy
            * * Removing any role binding, with or without a condition, from a policy
        -   *   that includes conditions
        +   * that includes conditions
        +   *
            * **Important:** If you use IAM Conditions, you must include the `etag` field
            * whenever you call `setIamPolicy`. If you omit this field, then IAM allows
            * you to overwrite a version `3` policy with a version `1` policy, and all of
            * the conditions in the version `3` policy are lost.
        +   *
            * If a policy does not include any conditions, operations on that policy may
            * specify any valid version or leave the field unset.
        +   *
            * To learn which resources support conditions in their IAM policies, see the
        -   * [IAM documentation](https://cloud.google.com/iam/help/conditions/resource-policies).
        +   * [IAM
        +   * documentation](https://cloud.google.com/iam/help/conditions/resource-policies).
            * 
        * * int32 version = 1; @@ -160,7 +185,10 @@ public int getVersion() { } public static final int BINDINGS_FIELD_NUMBER = 4; + + @SuppressWarnings("serial") private java.util.List bindings_; + /** * * @@ -168,6 +196,7 @@ public int getVersion() { * Associates a list of `members`, or principals, with a `role`. Optionally, * may specify a `condition` that determines how and when the `bindings` are * applied. Each of the `bindings` must contain at least one principal. + * * The `bindings` in a `Policy` can refer to up to 1,500 principals; up to 250 * of these principals can be Google groups. Each occurrence of a principal * counts towards these limits. For example, if the `bindings` grant 50 @@ -182,6 +211,7 @@ public int getVersion() { public java.util.List getBindingsList() { return bindings_; } + /** * * @@ -189,6 +219,7 @@ public java.util.List getBindingsList() { * Associates a list of `members`, or principals, with a `role`. Optionally, * may specify a `condition` that determines how and when the `bindings` are * applied. Each of the `bindings` must contain at least one principal. + * * The `bindings` in a `Policy` can refer to up to 1,500 principals; up to 250 * of these principals can be Google groups. Each occurrence of a principal * counts towards these limits. For example, if the `bindings` grant 50 @@ -203,6 +234,7 @@ public java.util.List getBindingsList() { public java.util.List getBindingsOrBuilderList() { return bindings_; } + /** * * @@ -210,6 +242,7 @@ public java.util.List getBindingsO * Associates a list of `members`, or principals, with a `role`. Optionally, * may specify a `condition` that determines how and when the `bindings` are * applied. Each of the `bindings` must contain at least one principal. + * * The `bindings` in a `Policy` can refer to up to 1,500 principals; up to 250 * of these principals can be Google groups. Each occurrence of a principal * counts towards these limits. For example, if the `bindings` grant 50 @@ -224,6 +257,7 @@ public java.util.List getBindingsO public int getBindingsCount() { return bindings_.size(); } + /** * * @@ -231,6 +265,7 @@ public int getBindingsCount() { * Associates a list of `members`, or principals, with a `role`. Optionally, * may specify a `condition` that determines how and when the `bindings` are * applied. Each of the `bindings` must contain at least one principal. + * * The `bindings` in a `Policy` can refer to up to 1,500 principals; up to 250 * of these principals can be Google groups. Each occurrence of a principal * counts towards these limits. For example, if the `bindings` grant 50 @@ -245,6 +280,7 @@ public int getBindingsCount() { public com.google.iam.v1.Binding getBindings(int index) { return bindings_.get(index); } + /** * * @@ -252,6 +288,7 @@ public com.google.iam.v1.Binding getBindings(int index) { * Associates a list of `members`, or principals, with a `role`. Optionally, * may specify a `condition` that determines how and when the `bindings` are * applied. Each of the `bindings` must contain at least one principal. + * * The `bindings` in a `Policy` can refer to up to 1,500 principals; up to 250 * of these principals can be Google groups. Each occurrence of a principal * counts towards these limits. For example, if the `bindings` grant 50 @@ -268,7 +305,10 @@ public com.google.iam.v1.BindingOrBuilder getBindingsOrBuilder(int index) { } public static final int AUDIT_CONFIGS_FIELD_NUMBER = 6; + + @SuppressWarnings("serial") private java.util.List auditConfigs_; + /** * * @@ -282,6 +322,7 @@ public com.google.iam.v1.BindingOrBuilder getBindingsOrBuilder(int index) { public java.util.List getAuditConfigsList() { return auditConfigs_; } + /** * * @@ -296,6 +337,7 @@ public java.util.List getAuditConfigsList() { getAuditConfigsOrBuilderList() { return auditConfigs_; } + /** * * @@ -309,6 +351,7 @@ public java.util.List getAuditConfigsList() { public int getAuditConfigsCount() { return auditConfigs_.size(); } + /** * * @@ -322,6 +365,7 @@ public int getAuditConfigsCount() { public com.google.iam.v1.AuditConfig getAuditConfigs(int index) { return auditConfigs_.get(index); } + /** * * @@ -337,7 +381,8 @@ public com.google.iam.v1.AuditConfigOrBuilder getAuditConfigsOrBuilder(int index } public static final int ETAG_FIELD_NUMBER = 3; - private com.google.protobuf.ByteString etag_; + private com.google.protobuf.ByteString etag_ = com.google.protobuf.ByteString.EMPTY; + /** * * @@ -349,6 +394,7 @@ public com.google.iam.v1.AuditConfigOrBuilder getAuditConfigsOrBuilder(int index * conditions: An `etag` is returned in the response to `getIamPolicy`, and * systems are expected to put that etag in the request to `setIamPolicy` to * ensure that their change will be applied to the same version of the policy. + * * **Important:** If you use IAM Conditions, you must include the `etag` field * whenever you call `setIamPolicy`. If you omit this field, then IAM allows * you to overwrite a version `3` policy with a version `1` policy, and all of @@ -494,38 +540,38 @@ public static com.google.iam.v1.Policy parseFrom( public static com.google.iam.v1.Policy parseFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); } public static com.google.iam.v1.Policy parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } public static com.google.iam.v1.Policy parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); } public static com.google.iam.v1.Policy parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( PARSER, input, extensionRegistry); } public static com.google.iam.v1.Policy parseFrom(com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); } public static com.google.iam.v1.Policy parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } @@ -548,78 +594,93 @@ public Builder toBuilder() { } @java.lang.Override - protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { Builder builder = new Builder(parent); return builder; } + /** * * *
            * An Identity and Access Management (IAM) policy, which specifies access
            * controls for Google Cloud resources.
        +   *
        +   *
            * A `Policy` is a collection of `bindings`. A `binding` binds one or more
            * `members`, or principals, to a single `role`. Principals can be user
            * accounts, service accounts, Google groups, and domains (such as G Suite). A
            * `role` is a named list of permissions; each `role` can be an IAM predefined
            * role or a user-created custom role.
        +   *
            * For some types of Google Cloud resources, a `binding` can also specify a
            * `condition`, which is a logical expression that allows access to a resource
            * only if the expression evaluates to `true`. A condition can add constraints
            * based on attributes of the request, the resource, or both. To learn which
            * resources support conditions in their IAM policies, see the
        -   * [IAM documentation](https://cloud.google.com/iam/help/conditions/resource-policies).
        +   * [IAM
        +   * documentation](https://cloud.google.com/iam/help/conditions/resource-policies).
        +   *
            * **JSON example:**
        -   *     {
        -   *       "bindings": [
        -   *         {
        -   *           "role": "roles/resourcemanager.organizationAdmin",
        -   *           "members": [
        -   *             "user:mike@example.com",
        -   *             "group:admins@example.com",
        -   *             "domain:google.com",
        -   *             "serviceAccount:my-project-id@appspot.gserviceaccount.com"
        -   *           ]
        -   *         },
        -   *         {
        -   *           "role": "roles/resourcemanager.organizationViewer",
        -   *           "members": [
        -   *             "user:eve@example.com"
        -   *           ],
        -   *           "condition": {
        -   *             "title": "expirable access",
        -   *             "description": "Does not grant access after Sep 2020",
        -   *             "expression": "request.time < timestamp('2020-10-01T00:00:00.000Z')",
        -   *           }
        -   *         }
        -   *       ],
        -   *       "etag": "BwWWja0YfJA=",
        -   *       "version": 3
        -   *     }
        +   *
        +   * ```
        +   * {
        +   * "bindings": [
        +   * {
        +   * "role": "roles/resourcemanager.organizationAdmin",
        +   * "members": [
        +   * "user:mike@example.com",
        +   * "group:admins@example.com",
        +   * "domain:google.com",
        +   * "serviceAccount:my-project-id@appspot.gserviceaccount.com"
        +   * ]
        +   * },
        +   * {
        +   * "role": "roles/resourcemanager.organizationViewer",
        +   * "members": [
        +   * "user:eve@example.com"
        +   * ],
        +   * "condition": {
        +   * "title": "expirable access",
        +   * "description": "Does not grant access after Sep 2020",
        +   * "expression": "request.time <
        +   * timestamp('2020-10-01T00:00:00.000Z')",
        +   * }
        +   * }
        +   * ],
        +   * "etag": "BwWWja0YfJA=",
        +   * "version": 3
        +   * }
        +   * ```
        +   *
            * **YAML example:**
        -   *     bindings:
        -   *     - members:
        -   *       - user:mike@example.com
        -   *       - group:admins@example.com
        -   *       - domain:google.com
        -   *       - serviceAccount:my-project-id@appspot.gserviceaccount.com
        -   *       role: roles/resourcemanager.organizationAdmin
        -   *     - members:
        -   *       - user:eve@example.com
        -   *       role: roles/resourcemanager.organizationViewer
        -   *       condition:
        -   *         title: expirable access
        -   *         description: Does not grant access after Sep 2020
        -   *         expression: request.time < timestamp('2020-10-01T00:00:00.000Z')
        -   *     etag: BwWWja0YfJA=
        -   *     version: 3
        +   *
        +   * ```
        +   * bindings:
        +   * - members:
        +   * - user:mike@example.com
        +   * - group:admins@example.com
        +   * - domain:google.com
        +   * - serviceAccount:my-project-id@appspot.gserviceaccount.com
        +   * role: roles/resourcemanager.organizationAdmin
        +   * - members:
        +   * - user:eve@example.com
        +   * role: roles/resourcemanager.organizationViewer
        +   * condition:
        +   * title: expirable access
        +   * description: Does not grant access after Sep 2020
        +   * expression: request.time < timestamp('2020-10-01T00:00:00.000Z')
        +   * etag: BwWWja0YfJA=
        +   * version: 3
        +   * ```
        +   *
            * For a description of IAM and its features, see the
            * [IAM documentation](https://cloud.google.com/iam/docs/).
            * 
        * * Protobuf type {@code google.iam.v1.Policy} */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder implements // @@protoc_insertion_point(builder_implements:google.iam.v1.Policy) com.google.iam.v1.PolicyOrBuilder { @@ -628,7 +689,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.iam.v1.PolicyProto.internal_static_google_iam_v1_Policy_fieldAccessorTable .ensureFieldAccessorsInitialized( @@ -638,31 +699,30 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { // Construct using com.google.iam.v1.Policy.newBuilder() private Builder() {} - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { super(parent); } @java.lang.Override public Builder clear() { super.clear(); + bitField0_ = 0; version_ = 0; - if (bindingsBuilder_ == null) { bindings_ = java.util.Collections.emptyList(); } else { bindings_ = null; bindingsBuilder_.clear(); } - bitField0_ = (bitField0_ & ~0x00000001); + bitField0_ = (bitField0_ & ~0x00000002); if (auditConfigsBuilder_ == null) { auditConfigs_ = java.util.Collections.emptyList(); } else { auditConfigs_ = null; auditConfigsBuilder_.clear(); } - bitField0_ = (bitField0_ & ~0x00000002); + bitField0_ = (bitField0_ & ~0x00000004); etag_ = com.google.protobuf.ByteString.EMPTY; - return this; } @@ -688,62 +748,43 @@ public com.google.iam.v1.Policy build() { @java.lang.Override public com.google.iam.v1.Policy buildPartial() { com.google.iam.v1.Policy result = new com.google.iam.v1.Policy(this); - int from_bitField0_ = bitField0_; - result.version_ = version_; + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields(com.google.iam.v1.Policy result) { if (bindingsBuilder_ == null) { - if (((bitField0_ & 0x00000001) != 0)) { + if (((bitField0_ & 0x00000002) != 0)) { bindings_ = java.util.Collections.unmodifiableList(bindings_); - bitField0_ = (bitField0_ & ~0x00000001); + bitField0_ = (bitField0_ & ~0x00000002); } result.bindings_ = bindings_; } else { result.bindings_ = bindingsBuilder_.build(); } if (auditConfigsBuilder_ == null) { - if (((bitField0_ & 0x00000002) != 0)) { + if (((bitField0_ & 0x00000004) != 0)) { auditConfigs_ = java.util.Collections.unmodifiableList(auditConfigs_); - bitField0_ = (bitField0_ & ~0x00000002); + bitField0_ = (bitField0_ & ~0x00000004); } result.auditConfigs_ = auditConfigs_; } else { result.auditConfigs_ = auditConfigsBuilder_.build(); } - result.etag_ = etag_; - onBuilt(); - return result; } - @java.lang.Override - public Builder clone() { - return super.clone(); - } - - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.setField(field, value); - } - - @java.lang.Override - public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - - @java.lang.Override - public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.addRepeatedField(field, value); + private void buildPartial0(com.google.iam.v1.Policy result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.version_ = version_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.etag_ = etag_; + } } @java.lang.Override @@ -765,7 +806,7 @@ public Builder mergeFrom(com.google.iam.v1.Policy other) { if (!other.bindings_.isEmpty()) { if (bindings_.isEmpty()) { bindings_ = other.bindings_; - bitField0_ = (bitField0_ & ~0x00000001); + bitField0_ = (bitField0_ & ~0x00000002); } else { ensureBindingsIsMutable(); bindings_.addAll(other.bindings_); @@ -778,10 +819,10 @@ public Builder mergeFrom(com.google.iam.v1.Policy other) { bindingsBuilder_.dispose(); bindingsBuilder_ = null; bindings_ = other.bindings_; - bitField0_ = (bitField0_ & ~0x00000001); + bitField0_ = (bitField0_ & ~0x00000002); bindingsBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders - ? getBindingsFieldBuilder() + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders + ? internalGetBindingsFieldBuilder() : null; } else { bindingsBuilder_.addAllMessages(other.bindings_); @@ -792,7 +833,7 @@ public Builder mergeFrom(com.google.iam.v1.Policy other) { if (!other.auditConfigs_.isEmpty()) { if (auditConfigs_.isEmpty()) { auditConfigs_ = other.auditConfigs_; - bitField0_ = (bitField0_ & ~0x00000002); + bitField0_ = (bitField0_ & ~0x00000004); } else { ensureAuditConfigsIsMutable(); auditConfigs_.addAll(other.auditConfigs_); @@ -805,17 +846,17 @@ public Builder mergeFrom(com.google.iam.v1.Policy other) { auditConfigsBuilder_.dispose(); auditConfigsBuilder_ = null; auditConfigs_ = other.auditConfigs_; - bitField0_ = (bitField0_ & ~0x00000002); + bitField0_ = (bitField0_ & ~0x00000004); auditConfigsBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders - ? getAuditConfigsFieldBuilder() + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders + ? internalGetAuditConfigsFieldBuilder() : null; } else { auditConfigsBuilder_.addAllMessages(other.auditConfigs_); } } } - if (other.getEtag() != com.google.protobuf.ByteString.EMPTY) { + if (!other.getEtag().isEmpty()) { setEtag(other.getEtag()); } this.mergeUnknownFields(other.getUnknownFields()); @@ -847,13 +888,13 @@ public Builder mergeFrom( case 8: { version_ = input.readInt32(); - + bitField0_ |= 0x00000001; break; } // case 8 case 26: { etag_ = input.readBytes(); - + bitField0_ |= 0x00000008; break; } // case 26 case 34: @@ -900,28 +941,36 @@ public Builder mergeFrom( private int bitField0_; private int version_; + /** * * *
              * Specifies the format of the policy.
        +     *
              * Valid values are `0`, `1`, and `3`. Requests that specify an invalid value
              * are rejected.
        +     *
              * Any operation that affects conditional role bindings must specify version
              * `3`. This requirement applies to the following operations:
        +     *
              * * Getting a policy that includes a conditional role binding
              * * Adding a conditional role binding to a policy
              * * Changing a conditional role binding in a policy
              * * Removing any role binding, with or without a condition, from a policy
        -     *   that includes conditions
        +     * that includes conditions
        +     *
              * **Important:** If you use IAM Conditions, you must include the `etag` field
              * whenever you call `setIamPolicy`. If you omit this field, then IAM allows
              * you to overwrite a version `3` policy with a version `1` policy, and all of
              * the conditions in the version `3` policy are lost.
        +     *
              * If a policy does not include any conditions, operations on that policy may
              * specify any valid version or leave the field unset.
        +     *
              * To learn which resources support conditions in their IAM policies, see the
        -     * [IAM documentation](https://cloud.google.com/iam/help/conditions/resource-policies).
        +     * [IAM
        +     * documentation](https://cloud.google.com/iam/help/conditions/resource-policies).
              * 
        * * int32 version = 1; @@ -932,28 +981,36 @@ public Builder mergeFrom( public int getVersion() { return version_; } + /** * * *
              * Specifies the format of the policy.
        +     *
              * Valid values are `0`, `1`, and `3`. Requests that specify an invalid value
              * are rejected.
        +     *
              * Any operation that affects conditional role bindings must specify version
              * `3`. This requirement applies to the following operations:
        +     *
              * * Getting a policy that includes a conditional role binding
              * * Adding a conditional role binding to a policy
              * * Changing a conditional role binding in a policy
              * * Removing any role binding, with or without a condition, from a policy
        -     *   that includes conditions
        +     * that includes conditions
        +     *
              * **Important:** If you use IAM Conditions, you must include the `etag` field
              * whenever you call `setIamPolicy`. If you omit this field, then IAM allows
              * you to overwrite a version `3` policy with a version `1` policy, and all of
              * the conditions in the version `3` policy are lost.
        +     *
              * If a policy does not include any conditions, operations on that policy may
              * specify any valid version or leave the field unset.
        +     *
              * To learn which resources support conditions in their IAM policies, see the
        -     * [IAM documentation](https://cloud.google.com/iam/help/conditions/resource-policies).
        +     * [IAM
        +     * documentation](https://cloud.google.com/iam/help/conditions/resource-policies).
              * 
        * * int32 version = 1; @@ -964,31 +1021,40 @@ public int getVersion() { public Builder setVersion(int value) { version_ = value; + bitField0_ |= 0x00000001; onChanged(); return this; } + /** * * *
              * Specifies the format of the policy.
        +     *
              * Valid values are `0`, `1`, and `3`. Requests that specify an invalid value
              * are rejected.
        +     *
              * Any operation that affects conditional role bindings must specify version
              * `3`. This requirement applies to the following operations:
        +     *
              * * Getting a policy that includes a conditional role binding
              * * Adding a conditional role binding to a policy
              * * Changing a conditional role binding in a policy
              * * Removing any role binding, with or without a condition, from a policy
        -     *   that includes conditions
        +     * that includes conditions
        +     *
              * **Important:** If you use IAM Conditions, you must include the `etag` field
              * whenever you call `setIamPolicy`. If you omit this field, then IAM allows
              * you to overwrite a version `3` policy with a version `1` policy, and all of
              * the conditions in the version `3` policy are lost.
        +     *
              * If a policy does not include any conditions, operations on that policy may
              * specify any valid version or leave the field unset.
        +     *
              * To learn which resources support conditions in their IAM policies, see the
        -     * [IAM documentation](https://cloud.google.com/iam/help/conditions/resource-policies).
        +     * [IAM
        +     * documentation](https://cloud.google.com/iam/help/conditions/resource-policies).
              * 
        * * int32 version = 1; @@ -996,7 +1062,7 @@ public Builder setVersion(int value) { * @return This builder for chaining. */ public Builder clearVersion() { - + bitField0_ = (bitField0_ & ~0x00000001); version_ = 0; onChanged(); return this; @@ -1005,13 +1071,13 @@ public Builder clearVersion() { private java.util.List bindings_ = java.util.Collections.emptyList(); private void ensureBindingsIsMutable() { - if (!((bitField0_ & 0x00000001) != 0)) { + if (!((bitField0_ & 0x00000002) != 0)) { bindings_ = new java.util.ArrayList(bindings_); - bitField0_ |= 0x00000001; + bitField0_ |= 0x00000002; } } - private com.google.protobuf.RepeatedFieldBuilderV3< + private com.google.protobuf.RepeatedFieldBuilder< com.google.iam.v1.Binding, com.google.iam.v1.Binding.Builder, com.google.iam.v1.BindingOrBuilder> @@ -1024,6 +1090,7 @@ private void ensureBindingsIsMutable() { * Associates a list of `members`, or principals, with a `role`. Optionally, * may specify a `condition` that determines how and when the `bindings` are * applied. Each of the `bindings` must contain at least one principal. + * * The `bindings` in a `Policy` can refer to up to 1,500 principals; up to 250 * of these principals can be Google groups. Each occurrence of a principal * counts towards these limits. For example, if the `bindings` grant 50 @@ -1041,6 +1108,7 @@ public java.util.List getBindingsList() { return bindingsBuilder_.getMessageList(); } } + /** * * @@ -1048,6 +1116,7 @@ public java.util.List getBindingsList() { * Associates a list of `members`, or principals, with a `role`. Optionally, * may specify a `condition` that determines how and when the `bindings` are * applied. Each of the `bindings` must contain at least one principal. + * * The `bindings` in a `Policy` can refer to up to 1,500 principals; up to 250 * of these principals can be Google groups. Each occurrence of a principal * counts towards these limits. For example, if the `bindings` grant 50 @@ -1065,6 +1134,7 @@ public int getBindingsCount() { return bindingsBuilder_.getCount(); } } + /** * * @@ -1072,6 +1142,7 @@ public int getBindingsCount() { * Associates a list of `members`, or principals, with a `role`. Optionally, * may specify a `condition` that determines how and when the `bindings` are * applied. Each of the `bindings` must contain at least one principal. + * * The `bindings` in a `Policy` can refer to up to 1,500 principals; up to 250 * of these principals can be Google groups. Each occurrence of a principal * counts towards these limits. For example, if the `bindings` grant 50 @@ -1089,6 +1160,7 @@ public com.google.iam.v1.Binding getBindings(int index) { return bindingsBuilder_.getMessage(index); } } + /** * * @@ -1096,6 +1168,7 @@ public com.google.iam.v1.Binding getBindings(int index) { * Associates a list of `members`, or principals, with a `role`. Optionally, * may specify a `condition` that determines how and when the `bindings` are * applied. Each of the `bindings` must contain at least one principal. + * * The `bindings` in a `Policy` can refer to up to 1,500 principals; up to 250 * of these principals can be Google groups. Each occurrence of a principal * counts towards these limits. For example, if the `bindings` grant 50 @@ -1119,6 +1192,7 @@ public Builder setBindings(int index, com.google.iam.v1.Binding value) { } return this; } + /** * * @@ -1126,6 +1200,7 @@ public Builder setBindings(int index, com.google.iam.v1.Binding value) { * Associates a list of `members`, or principals, with a `role`. Optionally, * may specify a `condition` that determines how and when the `bindings` are * applied. Each of the `bindings` must contain at least one principal. + * * The `bindings` in a `Policy` can refer to up to 1,500 principals; up to 250 * of these principals can be Google groups. Each occurrence of a principal * counts towards these limits. For example, if the `bindings` grant 50 @@ -1146,6 +1221,7 @@ public Builder setBindings(int index, com.google.iam.v1.Binding.Builder builderF } return this; } + /** * * @@ -1153,6 +1229,7 @@ public Builder setBindings(int index, com.google.iam.v1.Binding.Builder builderF * Associates a list of `members`, or principals, with a `role`. Optionally, * may specify a `condition` that determines how and when the `bindings` are * applied. Each of the `bindings` must contain at least one principal. + * * The `bindings` in a `Policy` can refer to up to 1,500 principals; up to 250 * of these principals can be Google groups. Each occurrence of a principal * counts towards these limits. For example, if the `bindings` grant 50 @@ -1176,6 +1253,7 @@ public Builder addBindings(com.google.iam.v1.Binding value) { } return this; } + /** * * @@ -1183,6 +1261,7 @@ public Builder addBindings(com.google.iam.v1.Binding value) { * Associates a list of `members`, or principals, with a `role`. Optionally, * may specify a `condition` that determines how and when the `bindings` are * applied. Each of the `bindings` must contain at least one principal. + * * The `bindings` in a `Policy` can refer to up to 1,500 principals; up to 250 * of these principals can be Google groups. Each occurrence of a principal * counts towards these limits. For example, if the `bindings` grant 50 @@ -1206,6 +1285,7 @@ public Builder addBindings(int index, com.google.iam.v1.Binding value) { } return this; } + /** * * @@ -1213,6 +1293,7 @@ public Builder addBindings(int index, com.google.iam.v1.Binding value) { * Associates a list of `members`, or principals, with a `role`. Optionally, * may specify a `condition` that determines how and when the `bindings` are * applied. Each of the `bindings` must contain at least one principal. + * * The `bindings` in a `Policy` can refer to up to 1,500 principals; up to 250 * of these principals can be Google groups. Each occurrence of a principal * counts towards these limits. For example, if the `bindings` grant 50 @@ -1233,6 +1314,7 @@ public Builder addBindings(com.google.iam.v1.Binding.Builder builderForValue) { } return this; } + /** * * @@ -1240,6 +1322,7 @@ public Builder addBindings(com.google.iam.v1.Binding.Builder builderForValue) { * Associates a list of `members`, or principals, with a `role`. Optionally, * may specify a `condition` that determines how and when the `bindings` are * applied. Each of the `bindings` must contain at least one principal. + * * The `bindings` in a `Policy` can refer to up to 1,500 principals; up to 250 * of these principals can be Google groups. Each occurrence of a principal * counts towards these limits. For example, if the `bindings` grant 50 @@ -1260,6 +1343,7 @@ public Builder addBindings(int index, com.google.iam.v1.Binding.Builder builderF } return this; } + /** * * @@ -1267,6 +1351,7 @@ public Builder addBindings(int index, com.google.iam.v1.Binding.Builder builderF * Associates a list of `members`, or principals, with a `role`. Optionally, * may specify a `condition` that determines how and when the `bindings` are * applied. Each of the `bindings` must contain at least one principal. + * * The `bindings` in a `Policy` can refer to up to 1,500 principals; up to 250 * of these principals can be Google groups. Each occurrence of a principal * counts towards these limits. For example, if the `bindings` grant 50 @@ -1287,6 +1372,7 @@ public Builder addAllBindings(java.lang.Iterablerepeated .google.iam.v1.Binding bindings = 4; */ public com.google.iam.v1.Binding.Builder getBindingsBuilder(int index) { - return getBindingsFieldBuilder().getBuilder(index); + return internalGetBindingsFieldBuilder().getBuilder(index); } + /** * * @@ -1368,6 +1460,7 @@ public com.google.iam.v1.Binding.Builder getBindingsBuilder(int index) { * Associates a list of `members`, or principals, with a `role`. Optionally, * may specify a `condition` that determines how and when the `bindings` are * applied. Each of the `bindings` must contain at least one principal. + * * The `bindings` in a `Policy` can refer to up to 1,500 principals; up to 250 * of these principals can be Google groups. Each occurrence of a principal * counts towards these limits. For example, if the `bindings` grant 50 @@ -1385,6 +1478,7 @@ public com.google.iam.v1.BindingOrBuilder getBindingsOrBuilder(int index) { return bindingsBuilder_.getMessageOrBuilder(index); } } + /** * * @@ -1392,6 +1486,7 @@ public com.google.iam.v1.BindingOrBuilder getBindingsOrBuilder(int index) { * Associates a list of `members`, or principals, with a `role`. Optionally, * may specify a `condition` that determines how and when the `bindings` are * applied. Each of the `bindings` must contain at least one principal. + * * The `bindings` in a `Policy` can refer to up to 1,500 principals; up to 250 * of these principals can be Google groups. Each occurrence of a principal * counts towards these limits. For example, if the `bindings` grant 50 @@ -1409,6 +1504,7 @@ public java.util.List getBindingsO return java.util.Collections.unmodifiableList(bindings_); } } + /** * * @@ -1416,6 +1512,7 @@ public java.util.List getBindingsO * Associates a list of `members`, or principals, with a `role`. Optionally, * may specify a `condition` that determines how and when the `bindings` are * applied. Each of the `bindings` must contain at least one principal. + * * The `bindings` in a `Policy` can refer to up to 1,500 principals; up to 250 * of these principals can be Google groups. Each occurrence of a principal * counts towards these limits. For example, if the `bindings` grant 50 @@ -1427,8 +1524,10 @@ public java.util.List getBindingsO * repeated .google.iam.v1.Binding bindings = 4; */ public com.google.iam.v1.Binding.Builder addBindingsBuilder() { - return getBindingsFieldBuilder().addBuilder(com.google.iam.v1.Binding.getDefaultInstance()); + return internalGetBindingsFieldBuilder() + .addBuilder(com.google.iam.v1.Binding.getDefaultInstance()); } + /** * * @@ -1436,6 +1535,7 @@ public com.google.iam.v1.Binding.Builder addBindingsBuilder() { * Associates a list of `members`, or principals, with a `role`. Optionally, * may specify a `condition` that determines how and when the `bindings` are * applied. Each of the `bindings` must contain at least one principal. + * * The `bindings` in a `Policy` can refer to up to 1,500 principals; up to 250 * of these principals can be Google groups. Each occurrence of a principal * counts towards these limits. For example, if the `bindings` grant 50 @@ -1447,9 +1547,10 @@ public com.google.iam.v1.Binding.Builder addBindingsBuilder() { * repeated .google.iam.v1.Binding bindings = 4; */ public com.google.iam.v1.Binding.Builder addBindingsBuilder(int index) { - return getBindingsFieldBuilder() + return internalGetBindingsFieldBuilder() .addBuilder(index, com.google.iam.v1.Binding.getDefaultInstance()); } + /** * * @@ -1457,6 +1558,7 @@ public com.google.iam.v1.Binding.Builder addBindingsBuilder(int index) { * Associates a list of `members`, or principals, with a `role`. Optionally, * may specify a `condition` that determines how and when the `bindings` are * applied. Each of the `bindings` must contain at least one principal. + * * The `bindings` in a `Policy` can refer to up to 1,500 principals; up to 250 * of these principals can be Google groups. Each occurrence of a principal * counts towards these limits. For example, if the `bindings` grant 50 @@ -1468,21 +1570,21 @@ public com.google.iam.v1.Binding.Builder addBindingsBuilder(int index) { * repeated .google.iam.v1.Binding bindings = 4; */ public java.util.List getBindingsBuilderList() { - return getBindingsFieldBuilder().getBuilderList(); + return internalGetBindingsFieldBuilder().getBuilderList(); } - private com.google.protobuf.RepeatedFieldBuilderV3< + private com.google.protobuf.RepeatedFieldBuilder< com.google.iam.v1.Binding, com.google.iam.v1.Binding.Builder, com.google.iam.v1.BindingOrBuilder> - getBindingsFieldBuilder() { + internalGetBindingsFieldBuilder() { if (bindingsBuilder_ == null) { bindingsBuilder_ = - new com.google.protobuf.RepeatedFieldBuilderV3< + new com.google.protobuf.RepeatedFieldBuilder< com.google.iam.v1.Binding, com.google.iam.v1.Binding.Builder, com.google.iam.v1.BindingOrBuilder>( - bindings_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + bindings_, ((bitField0_ & 0x00000002) != 0), getParentForChildren(), isClean()); bindings_ = null; } return bindingsBuilder_; @@ -1492,13 +1594,13 @@ public java.util.List getBindingsBuilderList( java.util.Collections.emptyList(); private void ensureAuditConfigsIsMutable() { - if (!((bitField0_ & 0x00000002) != 0)) { + if (!((bitField0_ & 0x00000004) != 0)) { auditConfigs_ = new java.util.ArrayList(auditConfigs_); - bitField0_ |= 0x00000002; + bitField0_ |= 0x00000004; } } - private com.google.protobuf.RepeatedFieldBuilderV3< + private com.google.protobuf.RepeatedFieldBuilder< com.google.iam.v1.AuditConfig, com.google.iam.v1.AuditConfig.Builder, com.google.iam.v1.AuditConfigOrBuilder> @@ -1520,6 +1622,7 @@ public java.util.List getAuditConfigsList() { return auditConfigsBuilder_.getMessageList(); } } + /** * * @@ -1536,6 +1639,7 @@ public int getAuditConfigsCount() { return auditConfigsBuilder_.getCount(); } } + /** * * @@ -1552,6 +1656,7 @@ public com.google.iam.v1.AuditConfig getAuditConfigs(int index) { return auditConfigsBuilder_.getMessage(index); } } + /** * * @@ -1574,6 +1679,7 @@ public Builder setAuditConfigs(int index, com.google.iam.v1.AuditConfig value) { } return this; } + /** * * @@ -1594,6 +1700,7 @@ public Builder setAuditConfigs( } return this; } + /** * * @@ -1616,6 +1723,7 @@ public Builder addAuditConfigs(com.google.iam.v1.AuditConfig value) { } return this; } + /** * * @@ -1638,6 +1746,7 @@ public Builder addAuditConfigs(int index, com.google.iam.v1.AuditConfig value) { } return this; } + /** * * @@ -1657,6 +1766,7 @@ public Builder addAuditConfigs(com.google.iam.v1.AuditConfig.Builder builderForV } return this; } + /** * * @@ -1677,6 +1787,7 @@ public Builder addAuditConfigs( } return this; } + /** * * @@ -1697,6 +1808,7 @@ public Builder addAllAuditConfigs( } return this; } + /** * * @@ -1709,13 +1821,14 @@ public Builder addAllAuditConfigs( public Builder clearAuditConfigs() { if (auditConfigsBuilder_ == null) { auditConfigs_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000002); + bitField0_ = (bitField0_ & ~0x00000004); onChanged(); } else { auditConfigsBuilder_.clear(); } return this; } + /** * * @@ -1735,6 +1848,7 @@ public Builder removeAuditConfigs(int index) { } return this; } + /** * * @@ -1745,8 +1859,9 @@ public Builder removeAuditConfigs(int index) { * repeated .google.iam.v1.AuditConfig audit_configs = 6; */ public com.google.iam.v1.AuditConfig.Builder getAuditConfigsBuilder(int index) { - return getAuditConfigsFieldBuilder().getBuilder(index); + return internalGetAuditConfigsFieldBuilder().getBuilder(index); } + /** * * @@ -1763,6 +1878,7 @@ public com.google.iam.v1.AuditConfigOrBuilder getAuditConfigsOrBuilder(int index return auditConfigsBuilder_.getMessageOrBuilder(index); } } + /** * * @@ -1780,6 +1896,7 @@ public com.google.iam.v1.AuditConfigOrBuilder getAuditConfigsOrBuilder(int index return java.util.Collections.unmodifiableList(auditConfigs_); } } + /** * * @@ -1790,9 +1907,10 @@ public com.google.iam.v1.AuditConfigOrBuilder getAuditConfigsOrBuilder(int index * repeated .google.iam.v1.AuditConfig audit_configs = 6; */ public com.google.iam.v1.AuditConfig.Builder addAuditConfigsBuilder() { - return getAuditConfigsFieldBuilder() + return internalGetAuditConfigsFieldBuilder() .addBuilder(com.google.iam.v1.AuditConfig.getDefaultInstance()); } + /** * * @@ -1803,9 +1921,10 @@ public com.google.iam.v1.AuditConfig.Builder addAuditConfigsBuilder() { * repeated .google.iam.v1.AuditConfig audit_configs = 6; */ public com.google.iam.v1.AuditConfig.Builder addAuditConfigsBuilder(int index) { - return getAuditConfigsFieldBuilder() + return internalGetAuditConfigsFieldBuilder() .addBuilder(index, com.google.iam.v1.AuditConfig.getDefaultInstance()); } + /** * * @@ -1816,27 +1935,28 @@ public com.google.iam.v1.AuditConfig.Builder addAuditConfigsBuilder(int index) { * repeated .google.iam.v1.AuditConfig audit_configs = 6; */ public java.util.List getAuditConfigsBuilderList() { - return getAuditConfigsFieldBuilder().getBuilderList(); + return internalGetAuditConfigsFieldBuilder().getBuilderList(); } - private com.google.protobuf.RepeatedFieldBuilderV3< + private com.google.protobuf.RepeatedFieldBuilder< com.google.iam.v1.AuditConfig, com.google.iam.v1.AuditConfig.Builder, com.google.iam.v1.AuditConfigOrBuilder> - getAuditConfigsFieldBuilder() { + internalGetAuditConfigsFieldBuilder() { if (auditConfigsBuilder_ == null) { auditConfigsBuilder_ = - new com.google.protobuf.RepeatedFieldBuilderV3< + new com.google.protobuf.RepeatedFieldBuilder< com.google.iam.v1.AuditConfig, com.google.iam.v1.AuditConfig.Builder, com.google.iam.v1.AuditConfigOrBuilder>( - auditConfigs_, ((bitField0_ & 0x00000002) != 0), getParentForChildren(), isClean()); + auditConfigs_, ((bitField0_ & 0x00000004) != 0), getParentForChildren(), isClean()); auditConfigs_ = null; } return auditConfigsBuilder_; } private com.google.protobuf.ByteString etag_ = com.google.protobuf.ByteString.EMPTY; + /** * * @@ -1848,6 +1968,7 @@ public java.util.List getAuditConfigsBuil * conditions: An `etag` is returned in the response to `getIamPolicy`, and * systems are expected to put that etag in the request to `setIamPolicy` to * ensure that their change will be applied to the same version of the policy. + * * **Important:** If you use IAM Conditions, you must include the `etag` field * whenever you call `setIamPolicy`. If you omit this field, then IAM allows * you to overwrite a version `3` policy with a version `1` policy, and all of @@ -1862,6 +1983,7 @@ public java.util.List getAuditConfigsBuil public com.google.protobuf.ByteString getEtag() { return etag_; } + /** * * @@ -1873,6 +1995,7 @@ public com.google.protobuf.ByteString getEtag() { * conditions: An `etag` is returned in the response to `getIamPolicy`, and * systems are expected to put that etag in the request to `setIamPolicy` to * ensure that their change will be applied to the same version of the policy. + * * **Important:** If you use IAM Conditions, you must include the `etag` field * whenever you call `setIamPolicy`. If you omit this field, then IAM allows * you to overwrite a version `3` policy with a version `1` policy, and all of @@ -1888,11 +2011,12 @@ public Builder setEtag(com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); } - etag_ = value; + bitField0_ |= 0x00000008; onChanged(); return this; } + /** * * @@ -1904,6 +2028,7 @@ public Builder setEtag(com.google.protobuf.ByteString value) { * conditions: An `etag` is returned in the response to `getIamPolicy`, and * systems are expected to put that etag in the request to `setIamPolicy` to * ensure that their change will be applied to the same version of the policy. + * * **Important:** If you use IAM Conditions, you must include the `etag` field * whenever you call `setIamPolicy`. If you omit this field, then IAM allows * you to overwrite a version `3` policy with a version `1` policy, and all of @@ -1915,23 +2040,12 @@ public Builder setEtag(com.google.protobuf.ByteString value) { * @return This builder for chaining. */ public Builder clearEtag() { - + bitField0_ = (bitField0_ & ~0x00000008); etag_ = getDefaultInstance().getEtag(); 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.iam.v1.Policy) } diff --git a/java-iam/proto-google-iam-v1/src/main/java/com/google/iam/v1/PolicyDelta.java b/java-iam/proto-google-iam-v1/src/main/java/com/google/iam/v1/PolicyDelta.java index 536ede1a7c..67891e9dc1 100644 --- a/java-iam/proto-google-iam-v1/src/main/java/com/google/iam/v1/PolicyDelta.java +++ b/java-iam/proto-google-iam-v1/src/main/java/com/google/iam/v1/PolicyDelta.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,9 @@ * limitations under the License. */ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: google/iam/v1/policy.proto +// Protobuf Java Version: 4.33.2 package com.google.iam.v1; @@ -27,13 +29,25 @@ * * Protobuf type {@code google.iam.v1.PolicyDelta} */ -public final class PolicyDelta extends com.google.protobuf.GeneratedMessageV3 +@com.google.protobuf.Generated +public final class PolicyDelta extends com.google.protobuf.GeneratedMessage implements // @@protoc_insertion_point(message_implements:google.iam.v1.PolicyDelta) PolicyDeltaOrBuilder { private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "PolicyDelta"); + } + // Use PolicyDelta.newBuilder() to construct. - private PolicyDelta(com.google.protobuf.GeneratedMessageV3.Builder builder) { + private PolicyDelta(com.google.protobuf.GeneratedMessage.Builder builder) { super(builder); } @@ -42,23 +56,12 @@ private PolicyDelta() { auditConfigDeltas_ = java.util.Collections.emptyList(); } - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new PolicyDelta(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.iam.v1.PolicyProto.internal_static_google_iam_v1_PolicyDelta_descriptor; } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.iam.v1.PolicyProto .internal_static_google_iam_v1_PolicyDelta_fieldAccessorTable @@ -67,7 +70,10 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } public static final int BINDING_DELTAS_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") private java.util.List bindingDeltas_; + /** * * @@ -81,6 +87,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { public java.util.List getBindingDeltasList() { return bindingDeltas_; } + /** * * @@ -95,6 +102,7 @@ public java.util.List getBindingDeltasList() { getBindingDeltasOrBuilderList() { return bindingDeltas_; } + /** * * @@ -108,6 +116,7 @@ public java.util.List getBindingDeltasList() { public int getBindingDeltasCount() { return bindingDeltas_.size(); } + /** * * @@ -121,6 +130,7 @@ public int getBindingDeltasCount() { public com.google.iam.v1.BindingDelta getBindingDeltas(int index) { return bindingDeltas_.get(index); } + /** * * @@ -136,7 +146,10 @@ public com.google.iam.v1.BindingDeltaOrBuilder getBindingDeltasOrBuilder(int ind } public static final int AUDIT_CONFIG_DELTAS_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") private java.util.List auditConfigDeltas_; + /** * * @@ -150,6 +163,7 @@ public com.google.iam.v1.BindingDeltaOrBuilder getBindingDeltasOrBuilder(int ind public java.util.List getAuditConfigDeltasList() { return auditConfigDeltas_; } + /** * * @@ -164,6 +178,7 @@ public java.util.List getAuditConfigDeltasLi getAuditConfigDeltasOrBuilderList() { return auditConfigDeltas_; } + /** * * @@ -177,6 +192,7 @@ public java.util.List getAuditConfigDeltasLi public int getAuditConfigDeltasCount() { return auditConfigDeltas_.size(); } + /** * * @@ -190,6 +206,7 @@ public int getAuditConfigDeltasCount() { public com.google.iam.v1.AuditConfigDelta getAuditConfigDeltas(int index) { return auditConfigDeltas_.get(index); } + /** * * @@ -317,38 +334,38 @@ public static com.google.iam.v1.PolicyDelta parseFrom( public static com.google.iam.v1.PolicyDelta parseFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); } public static com.google.iam.v1.PolicyDelta parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } public static com.google.iam.v1.PolicyDelta parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); } public static com.google.iam.v1.PolicyDelta parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( PARSER, input, extensionRegistry); } public static com.google.iam.v1.PolicyDelta parseFrom(com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); } public static com.google.iam.v1.PolicyDelta parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } @@ -371,10 +388,11 @@ public Builder toBuilder() { } @java.lang.Override - protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { Builder builder = new Builder(parent); return builder; } + /** * * @@ -384,7 +402,7 @@ protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.Build * * Protobuf type {@code google.iam.v1.PolicyDelta} */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder implements // @@protoc_insertion_point(builder_implements:google.iam.v1.PolicyDelta) com.google.iam.v1.PolicyDeltaOrBuilder { @@ -393,7 +411,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.iam.v1.PolicyProto .internal_static_google_iam_v1_PolicyDelta_fieldAccessorTable @@ -404,13 +422,14 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { // Construct using com.google.iam.v1.PolicyDelta.newBuilder() private Builder() {} - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { super(parent); } @java.lang.Override public Builder clear() { super.clear(); + bitField0_ = 0; if (bindingDeltasBuilder_ == null) { bindingDeltas_ = java.util.Collections.emptyList(); } else { @@ -450,7 +469,15 @@ public com.google.iam.v1.PolicyDelta build() { @java.lang.Override public com.google.iam.v1.PolicyDelta buildPartial() { com.google.iam.v1.PolicyDelta result = new com.google.iam.v1.PolicyDelta(this); - int from_bitField0_ = bitField0_; + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields(com.google.iam.v1.PolicyDelta result) { if (bindingDeltasBuilder_ == null) { if (((bitField0_ & 0x00000001) != 0)) { bindingDeltas_ = java.util.Collections.unmodifiableList(bindingDeltas_); @@ -469,41 +496,10 @@ public com.google.iam.v1.PolicyDelta buildPartial() { } else { result.auditConfigDeltas_ = auditConfigDeltasBuilder_.build(); } - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.setField(field, value); - } - - @java.lang.Override - public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - - @java.lang.Override - public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); } - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.addRepeatedField(field, value); + private void buildPartial0(com.google.iam.v1.PolicyDelta result) { + int from_bitField0_ = bitField0_; } @java.lang.Override @@ -537,8 +533,8 @@ public Builder mergeFrom(com.google.iam.v1.PolicyDelta other) { bindingDeltas_ = other.bindingDeltas_; bitField0_ = (bitField0_ & ~0x00000001); bindingDeltasBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders - ? getBindingDeltasFieldBuilder() + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders + ? internalGetBindingDeltasFieldBuilder() : null; } else { bindingDeltasBuilder_.addAllMessages(other.bindingDeltas_); @@ -564,8 +560,8 @@ public Builder mergeFrom(com.google.iam.v1.PolicyDelta other) { auditConfigDeltas_ = other.auditConfigDeltas_; bitField0_ = (bitField0_ & ~0x00000002); auditConfigDeltasBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders - ? getAuditConfigDeltasFieldBuilder() + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders + ? internalGetAuditConfigDeltasFieldBuilder() : null; } else { auditConfigDeltasBuilder_.addAllMessages(other.auditConfigDeltas_); @@ -652,7 +648,7 @@ private void ensureBindingDeltasIsMutable() { } } - private com.google.protobuf.RepeatedFieldBuilderV3< + private com.google.protobuf.RepeatedFieldBuilder< com.google.iam.v1.BindingDelta, com.google.iam.v1.BindingDelta.Builder, com.google.iam.v1.BindingDeltaOrBuilder> @@ -674,6 +670,7 @@ public java.util.List getBindingDeltasList() { return bindingDeltasBuilder_.getMessageList(); } } + /** * * @@ -690,6 +687,7 @@ public int getBindingDeltasCount() { return bindingDeltasBuilder_.getCount(); } } + /** * * @@ -706,6 +704,7 @@ public com.google.iam.v1.BindingDelta getBindingDeltas(int index) { return bindingDeltasBuilder_.getMessage(index); } } + /** * * @@ -728,6 +727,7 @@ public Builder setBindingDeltas(int index, com.google.iam.v1.BindingDelta value) } return this; } + /** * * @@ -748,6 +748,7 @@ public Builder setBindingDeltas( } return this; } + /** * * @@ -770,6 +771,7 @@ public Builder addBindingDeltas(com.google.iam.v1.BindingDelta value) { } return this; } + /** * * @@ -792,6 +794,7 @@ public Builder addBindingDeltas(int index, com.google.iam.v1.BindingDelta value) } return this; } + /** * * @@ -811,6 +814,7 @@ public Builder addBindingDeltas(com.google.iam.v1.BindingDelta.Builder builderFo } return this; } + /** * * @@ -831,6 +835,7 @@ public Builder addBindingDeltas( } return this; } + /** * * @@ -851,6 +856,7 @@ public Builder addAllBindingDeltas( } return this; } + /** * * @@ -870,6 +876,7 @@ public Builder clearBindingDeltas() { } return this; } + /** * * @@ -889,6 +896,7 @@ public Builder removeBindingDeltas(int index) { } return this; } + /** * * @@ -899,8 +907,9 @@ public Builder removeBindingDeltas(int index) { * repeated .google.iam.v1.BindingDelta binding_deltas = 1; */ public com.google.iam.v1.BindingDelta.Builder getBindingDeltasBuilder(int index) { - return getBindingDeltasFieldBuilder().getBuilder(index); + return internalGetBindingDeltasFieldBuilder().getBuilder(index); } + /** * * @@ -917,6 +926,7 @@ public com.google.iam.v1.BindingDeltaOrBuilder getBindingDeltasOrBuilder(int ind return bindingDeltasBuilder_.getMessageOrBuilder(index); } } + /** * * @@ -934,6 +944,7 @@ public com.google.iam.v1.BindingDeltaOrBuilder getBindingDeltasOrBuilder(int ind return java.util.Collections.unmodifiableList(bindingDeltas_); } } + /** * * @@ -944,9 +955,10 @@ public com.google.iam.v1.BindingDeltaOrBuilder getBindingDeltasOrBuilder(int ind * repeated .google.iam.v1.BindingDelta binding_deltas = 1; */ public com.google.iam.v1.BindingDelta.Builder addBindingDeltasBuilder() { - return getBindingDeltasFieldBuilder() + return internalGetBindingDeltasFieldBuilder() .addBuilder(com.google.iam.v1.BindingDelta.getDefaultInstance()); } + /** * * @@ -957,9 +969,10 @@ public com.google.iam.v1.BindingDelta.Builder addBindingDeltasBuilder() { * repeated .google.iam.v1.BindingDelta binding_deltas = 1; */ public com.google.iam.v1.BindingDelta.Builder addBindingDeltasBuilder(int index) { - return getBindingDeltasFieldBuilder() + return internalGetBindingDeltasFieldBuilder() .addBuilder(index, com.google.iam.v1.BindingDelta.getDefaultInstance()); } + /** * * @@ -970,17 +983,17 @@ public com.google.iam.v1.BindingDelta.Builder addBindingDeltasBuilder(int index) * repeated .google.iam.v1.BindingDelta binding_deltas = 1; */ public java.util.List getBindingDeltasBuilderList() { - return getBindingDeltasFieldBuilder().getBuilderList(); + return internalGetBindingDeltasFieldBuilder().getBuilderList(); } - private com.google.protobuf.RepeatedFieldBuilderV3< + private com.google.protobuf.RepeatedFieldBuilder< com.google.iam.v1.BindingDelta, com.google.iam.v1.BindingDelta.Builder, com.google.iam.v1.BindingDeltaOrBuilder> - getBindingDeltasFieldBuilder() { + internalGetBindingDeltasFieldBuilder() { if (bindingDeltasBuilder_ == null) { bindingDeltasBuilder_ = - new com.google.protobuf.RepeatedFieldBuilderV3< + new com.google.protobuf.RepeatedFieldBuilder< com.google.iam.v1.BindingDelta, com.google.iam.v1.BindingDelta.Builder, com.google.iam.v1.BindingDeltaOrBuilder>( @@ -1004,7 +1017,7 @@ private void ensureAuditConfigDeltasIsMutable() { } } - private com.google.protobuf.RepeatedFieldBuilderV3< + private com.google.protobuf.RepeatedFieldBuilder< com.google.iam.v1.AuditConfigDelta, com.google.iam.v1.AuditConfigDelta.Builder, com.google.iam.v1.AuditConfigDeltaOrBuilder> @@ -1026,6 +1039,7 @@ public java.util.List getAuditConfigDeltasLi return auditConfigDeltasBuilder_.getMessageList(); } } + /** * * @@ -1042,6 +1056,7 @@ public int getAuditConfigDeltasCount() { return auditConfigDeltasBuilder_.getCount(); } } + /** * * @@ -1058,6 +1073,7 @@ public com.google.iam.v1.AuditConfigDelta getAuditConfigDeltas(int index) { return auditConfigDeltasBuilder_.getMessage(index); } } + /** * * @@ -1080,6 +1096,7 @@ public Builder setAuditConfigDeltas(int index, com.google.iam.v1.AuditConfigDelt } return this; } + /** * * @@ -1100,6 +1117,7 @@ public Builder setAuditConfigDeltas( } return this; } + /** * * @@ -1122,6 +1140,7 @@ public Builder addAuditConfigDeltas(com.google.iam.v1.AuditConfigDelta value) { } return this; } + /** * * @@ -1144,6 +1163,7 @@ public Builder addAuditConfigDeltas(int index, com.google.iam.v1.AuditConfigDelt } return this; } + /** * * @@ -1164,6 +1184,7 @@ public Builder addAuditConfigDeltas( } return this; } + /** * * @@ -1184,6 +1205,7 @@ public Builder addAuditConfigDeltas( } return this; } + /** * * @@ -1204,6 +1226,7 @@ public Builder addAllAuditConfigDeltas( } return this; } + /** * * @@ -1223,6 +1246,7 @@ public Builder clearAuditConfigDeltas() { } return this; } + /** * * @@ -1242,6 +1266,7 @@ public Builder removeAuditConfigDeltas(int index) { } return this; } + /** * * @@ -1252,8 +1277,9 @@ public Builder removeAuditConfigDeltas(int index) { * repeated .google.iam.v1.AuditConfigDelta audit_config_deltas = 2; */ public com.google.iam.v1.AuditConfigDelta.Builder getAuditConfigDeltasBuilder(int index) { - return getAuditConfigDeltasFieldBuilder().getBuilder(index); + return internalGetAuditConfigDeltasFieldBuilder().getBuilder(index); } + /** * * @@ -1270,6 +1296,7 @@ public com.google.iam.v1.AuditConfigDeltaOrBuilder getAuditConfigDeltasOrBuilder return auditConfigDeltasBuilder_.getMessageOrBuilder(index); } } + /** * * @@ -1287,6 +1314,7 @@ public com.google.iam.v1.AuditConfigDeltaOrBuilder getAuditConfigDeltasOrBuilder return java.util.Collections.unmodifiableList(auditConfigDeltas_); } } + /** * * @@ -1297,9 +1325,10 @@ public com.google.iam.v1.AuditConfigDeltaOrBuilder getAuditConfigDeltasOrBuilder * repeated .google.iam.v1.AuditConfigDelta audit_config_deltas = 2; */ public com.google.iam.v1.AuditConfigDelta.Builder addAuditConfigDeltasBuilder() { - return getAuditConfigDeltasFieldBuilder() + return internalGetAuditConfigDeltasFieldBuilder() .addBuilder(com.google.iam.v1.AuditConfigDelta.getDefaultInstance()); } + /** * * @@ -1310,9 +1339,10 @@ public com.google.iam.v1.AuditConfigDelta.Builder addAuditConfigDeltasBuilder() * repeated .google.iam.v1.AuditConfigDelta audit_config_deltas = 2; */ public com.google.iam.v1.AuditConfigDelta.Builder addAuditConfigDeltasBuilder(int index) { - return getAuditConfigDeltasFieldBuilder() + return internalGetAuditConfigDeltasFieldBuilder() .addBuilder(index, com.google.iam.v1.AuditConfigDelta.getDefaultInstance()); } + /** * * @@ -1324,17 +1354,17 @@ public com.google.iam.v1.AuditConfigDelta.Builder addAuditConfigDeltasBuilder(in */ public java.util.List getAuditConfigDeltasBuilderList() { - return getAuditConfigDeltasFieldBuilder().getBuilderList(); + return internalGetAuditConfigDeltasFieldBuilder().getBuilderList(); } - private com.google.protobuf.RepeatedFieldBuilderV3< + private com.google.protobuf.RepeatedFieldBuilder< com.google.iam.v1.AuditConfigDelta, com.google.iam.v1.AuditConfigDelta.Builder, com.google.iam.v1.AuditConfigDeltaOrBuilder> - getAuditConfigDeltasFieldBuilder() { + internalGetAuditConfigDeltasFieldBuilder() { if (auditConfigDeltasBuilder_ == null) { auditConfigDeltasBuilder_ = - new com.google.protobuf.RepeatedFieldBuilderV3< + new com.google.protobuf.RepeatedFieldBuilder< com.google.iam.v1.AuditConfigDelta, com.google.iam.v1.AuditConfigDelta.Builder, com.google.iam.v1.AuditConfigDeltaOrBuilder>( @@ -1347,17 +1377,6 @@ public com.google.iam.v1.AuditConfigDelta.Builder addAuditConfigDeltasBuilder(in return auditConfigDeltasBuilder_; } - @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.iam.v1.PolicyDelta) } diff --git a/java-iam/proto-google-iam-v1/src/main/java/com/google/iam/v1/PolicyDeltaOrBuilder.java b/java-iam/proto-google-iam-v1/src/main/java/com/google/iam/v1/PolicyDeltaOrBuilder.java index fd3e1c0ddc..56c23e694f 100644 --- a/java-iam/proto-google-iam-v1/src/main/java/com/google/iam/v1/PolicyDeltaOrBuilder.java +++ b/java-iam/proto-google-iam-v1/src/main/java/com/google/iam/v1/PolicyDeltaOrBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,10 +14,13 @@ * limitations under the License. */ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: google/iam/v1/policy.proto +// Protobuf Java Version: 4.33.2 package com.google.iam.v1; +@com.google.protobuf.Generated public interface PolicyDeltaOrBuilder extends // @@protoc_insertion_point(interface_extends:google.iam.v1.PolicyDelta) @@ -33,6 +36,7 @@ public interface PolicyDeltaOrBuilder * repeated .google.iam.v1.BindingDelta binding_deltas = 1; */ java.util.List getBindingDeltasList(); + /** * * @@ -43,6 +47,7 @@ public interface PolicyDeltaOrBuilder * repeated .google.iam.v1.BindingDelta binding_deltas = 1; */ com.google.iam.v1.BindingDelta getBindingDeltas(int index); + /** * * @@ -53,6 +58,7 @@ public interface PolicyDeltaOrBuilder * repeated .google.iam.v1.BindingDelta binding_deltas = 1; */ int getBindingDeltasCount(); + /** * * @@ -63,6 +69,7 @@ public interface PolicyDeltaOrBuilder * repeated .google.iam.v1.BindingDelta binding_deltas = 1; */ java.util.List getBindingDeltasOrBuilderList(); + /** * * @@ -84,6 +91,7 @@ public interface PolicyDeltaOrBuilder * repeated .google.iam.v1.AuditConfigDelta audit_config_deltas = 2; */ java.util.List getAuditConfigDeltasList(); + /** * * @@ -94,6 +102,7 @@ public interface PolicyDeltaOrBuilder * repeated .google.iam.v1.AuditConfigDelta audit_config_deltas = 2; */ com.google.iam.v1.AuditConfigDelta getAuditConfigDeltas(int index); + /** * * @@ -104,6 +113,7 @@ public interface PolicyDeltaOrBuilder * repeated .google.iam.v1.AuditConfigDelta audit_config_deltas = 2; */ int getAuditConfigDeltasCount(); + /** * * @@ -115,6 +125,7 @@ public interface PolicyDeltaOrBuilder */ java.util.List getAuditConfigDeltasOrBuilderList(); + /** * * diff --git a/java-iam/proto-google-iam-v1/src/main/java/com/google/iam/v1/PolicyOrBuilder.java b/java-iam/proto-google-iam-v1/src/main/java/com/google/iam/v1/PolicyOrBuilder.java index 571dcb8057..1cc516de8d 100644 --- a/java-iam/proto-google-iam-v1/src/main/java/com/google/iam/v1/PolicyOrBuilder.java +++ b/java-iam/proto-google-iam-v1/src/main/java/com/google/iam/v1/PolicyOrBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,10 +14,13 @@ * limitations under the License. */ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: google/iam/v1/policy.proto +// Protobuf Java Version: 4.33.2 package com.google.iam.v1; +@com.google.protobuf.Generated public interface PolicyOrBuilder extends // @@protoc_insertion_point(interface_extends:google.iam.v1.Policy) @@ -28,23 +31,30 @@ public interface PolicyOrBuilder * *
            * Specifies the format of the policy.
        +   *
            * Valid values are `0`, `1`, and `3`. Requests that specify an invalid value
            * are rejected.
        +   *
            * Any operation that affects conditional role bindings must specify version
            * `3`. This requirement applies to the following operations:
        +   *
            * * Getting a policy that includes a conditional role binding
            * * Adding a conditional role binding to a policy
            * * Changing a conditional role binding in a policy
            * * Removing any role binding, with or without a condition, from a policy
        -   *   that includes conditions
        +   * that includes conditions
        +   *
            * **Important:** If you use IAM Conditions, you must include the `etag` field
            * whenever you call `setIamPolicy`. If you omit this field, then IAM allows
            * you to overwrite a version `3` policy with a version `1` policy, and all of
            * the conditions in the version `3` policy are lost.
        +   *
            * If a policy does not include any conditions, operations on that policy may
            * specify any valid version or leave the field unset.
        +   *
            * To learn which resources support conditions in their IAM policies, see the
        -   * [IAM documentation](https://cloud.google.com/iam/help/conditions/resource-policies).
        +   * [IAM
        +   * documentation](https://cloud.google.com/iam/help/conditions/resource-policies).
            * 
        * * int32 version = 1; @@ -60,6 +70,7 @@ public interface PolicyOrBuilder * Associates a list of `members`, or principals, with a `role`. Optionally, * may specify a `condition` that determines how and when the `bindings` are * applied. Each of the `bindings` must contain at least one principal. + * * The `bindings` in a `Policy` can refer to up to 1,500 principals; up to 250 * of these principals can be Google groups. Each occurrence of a principal * counts towards these limits. For example, if the `bindings` grant 50 @@ -71,6 +82,7 @@ public interface PolicyOrBuilder * repeated .google.iam.v1.Binding bindings = 4; */ java.util.List getBindingsList(); + /** * * @@ -78,6 +90,7 @@ public interface PolicyOrBuilder * Associates a list of `members`, or principals, with a `role`. Optionally, * may specify a `condition` that determines how and when the `bindings` are * applied. Each of the `bindings` must contain at least one principal. + * * The `bindings` in a `Policy` can refer to up to 1,500 principals; up to 250 * of these principals can be Google groups. Each occurrence of a principal * counts towards these limits. For example, if the `bindings` grant 50 @@ -89,6 +102,7 @@ public interface PolicyOrBuilder * repeated .google.iam.v1.Binding bindings = 4; */ com.google.iam.v1.Binding getBindings(int index); + /** * * @@ -96,6 +110,7 @@ public interface PolicyOrBuilder * Associates a list of `members`, or principals, with a `role`. Optionally, * may specify a `condition` that determines how and when the `bindings` are * applied. Each of the `bindings` must contain at least one principal. + * * The `bindings` in a `Policy` can refer to up to 1,500 principals; up to 250 * of these principals can be Google groups. Each occurrence of a principal * counts towards these limits. For example, if the `bindings` grant 50 @@ -107,6 +122,7 @@ public interface PolicyOrBuilder * repeated .google.iam.v1.Binding bindings = 4; */ int getBindingsCount(); + /** * * @@ -114,6 +130,7 @@ public interface PolicyOrBuilder * Associates a list of `members`, or principals, with a `role`. Optionally, * may specify a `condition` that determines how and when the `bindings` are * applied. Each of the `bindings` must contain at least one principal. + * * The `bindings` in a `Policy` can refer to up to 1,500 principals; up to 250 * of these principals can be Google groups. Each occurrence of a principal * counts towards these limits. For example, if the `bindings` grant 50 @@ -125,6 +142,7 @@ public interface PolicyOrBuilder * repeated .google.iam.v1.Binding bindings = 4; */ java.util.List getBindingsOrBuilderList(); + /** * * @@ -132,6 +150,7 @@ public interface PolicyOrBuilder * Associates a list of `members`, or principals, with a `role`. Optionally, * may specify a `condition` that determines how and when the `bindings` are * applied. Each of the `bindings` must contain at least one principal. + * * The `bindings` in a `Policy` can refer to up to 1,500 principals; up to 250 * of these principals can be Google groups. Each occurrence of a principal * counts towards these limits. For example, if the `bindings` grant 50 @@ -154,6 +173,7 @@ public interface PolicyOrBuilder * repeated .google.iam.v1.AuditConfig audit_configs = 6; */ java.util.List getAuditConfigsList(); + /** * * @@ -164,6 +184,7 @@ public interface PolicyOrBuilder * repeated .google.iam.v1.AuditConfig audit_configs = 6; */ com.google.iam.v1.AuditConfig getAuditConfigs(int index); + /** * * @@ -174,6 +195,7 @@ public interface PolicyOrBuilder * repeated .google.iam.v1.AuditConfig audit_configs = 6; */ int getAuditConfigsCount(); + /** * * @@ -184,6 +206,7 @@ public interface PolicyOrBuilder * repeated .google.iam.v1.AuditConfig audit_configs = 6; */ java.util.List getAuditConfigsOrBuilderList(); + /** * * @@ -206,6 +229,7 @@ public interface PolicyOrBuilder * conditions: An `etag` is returned in the response to `getIamPolicy`, and * systems are expected to put that etag in the request to `setIamPolicy` to * ensure that their change will be applied to the same version of the policy. + * * **Important:** If you use IAM Conditions, you must include the `etag` field * whenever you call `setIamPolicy`. If you omit this field, then IAM allows * you to overwrite a version `3` policy with a version `1` policy, and all of diff --git a/java-iam/proto-google-iam-v1/src/main/java/com/google/iam/v1/PolicyProto.java b/java-iam/proto-google-iam-v1/src/main/java/com/google/iam/v1/PolicyProto.java index 8ba3e50af0..14c6b44760 100644 --- a/java-iam/proto-google-iam-v1/src/main/java/com/google/iam/v1/PolicyProto.java +++ b/java-iam/proto-google-iam-v1/src/main/java/com/google/iam/v1/PolicyProto.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,13 +14,26 @@ * limitations under the License. */ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: google/iam/v1/policy.proto +// Protobuf Java Version: 4.33.2 package com.google.iam.v1; -public final class PolicyProto { +@com.google.protobuf.Generated +public final class PolicyProto extends com.google.protobuf.GeneratedFile { private PolicyProto() {} + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "PolicyProto"); + } + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistryLite registry) {} public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry registry) { @@ -29,31 +42,31 @@ public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry r static final com.google.protobuf.Descriptors.Descriptor internal_static_google_iam_v1_Policy_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable internal_static_google_iam_v1_Policy_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_google_iam_v1_Binding_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable internal_static_google_iam_v1_Binding_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_google_iam_v1_AuditConfig_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable internal_static_google_iam_v1_AuditConfig_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_google_iam_v1_AuditLogConfig_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable internal_static_google_iam_v1_AuditLogConfig_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_google_iam_v1_PolicyDelta_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable internal_static_google_iam_v1_PolicyDelta_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_google_iam_v1_BindingDelta_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable internal_static_google_iam_v1_BindingDelta_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_google_iam_v1_AuditConfigDelta_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable internal_static_google_iam_v1_AuditConfigDelta_fieldAccessorTable; public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { @@ -90,11 +103,11 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + ".google.iam.v1.AuditConfigDelta.Action\022\017" + "\n\007service\030\002 \001(\t\022\027\n\017exempted_member\030\003 \001(\t" + "\022\020\n\010log_type\030\004 \001(\t\"5\n\006Action\022\026\n\022ACTION_U" - + "NSPECIFIED\020\000\022\007\n\003ADD\020\001\022\n\n\006REMOVE\020\002B\203\001\n\021co" - + "m.google.iam.v1B\013PolicyProtoP\001Z0google.g" - + "olang.org/genproto/googleapis/iam/v1;iam" - + "\370\001\001\252\002\023Google.Cloud.Iam.V1\312\002\023Google\\Cloud" - + "\\Iam\\V1b\006proto3" + + "NSPECIFIED\020\000\022\007\n\003ADD\020\001\022\n\n\006REMOVE\020\002B|\n\021com" + + ".google.iam.v1B\013PolicyProtoP\001Z)cloud.goo" + + "gle.com/go/iam/apiv1/iampb;iampb\370\001\001\252\002\023Go" + + "ogle.Cloud.Iam.V1\312\002\023Google\\Cloud\\Iam\\V1b" + + "\006proto3" }; descriptor = com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( @@ -102,58 +115,56 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { new com.google.protobuf.Descriptors.FileDescriptor[] { com.google.type.ExprProto.getDescriptor(), }); - internal_static_google_iam_v1_Policy_descriptor = getDescriptor().getMessageTypes().get(0); + internal_static_google_iam_v1_Policy_descriptor = getDescriptor().getMessageType(0); internal_static_google_iam_v1_Policy_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_google_iam_v1_Policy_descriptor, new java.lang.String[] { "Version", "Bindings", "AuditConfigs", "Etag", }); - internal_static_google_iam_v1_Binding_descriptor = getDescriptor().getMessageTypes().get(1); + internal_static_google_iam_v1_Binding_descriptor = getDescriptor().getMessageType(1); internal_static_google_iam_v1_Binding_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_google_iam_v1_Binding_descriptor, new java.lang.String[] { "Role", "Members", "Condition", }); - internal_static_google_iam_v1_AuditConfig_descriptor = getDescriptor().getMessageTypes().get(2); + internal_static_google_iam_v1_AuditConfig_descriptor = getDescriptor().getMessageType(2); internal_static_google_iam_v1_AuditConfig_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_google_iam_v1_AuditConfig_descriptor, new java.lang.String[] { "Service", "AuditLogConfigs", }); - internal_static_google_iam_v1_AuditLogConfig_descriptor = - getDescriptor().getMessageTypes().get(3); + internal_static_google_iam_v1_AuditLogConfig_descriptor = getDescriptor().getMessageType(3); internal_static_google_iam_v1_AuditLogConfig_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_google_iam_v1_AuditLogConfig_descriptor, new java.lang.String[] { "LogType", "ExemptedMembers", }); - internal_static_google_iam_v1_PolicyDelta_descriptor = getDescriptor().getMessageTypes().get(4); + internal_static_google_iam_v1_PolicyDelta_descriptor = getDescriptor().getMessageType(4); internal_static_google_iam_v1_PolicyDelta_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_google_iam_v1_PolicyDelta_descriptor, new java.lang.String[] { "BindingDeltas", "AuditConfigDeltas", }); - internal_static_google_iam_v1_BindingDelta_descriptor = - getDescriptor().getMessageTypes().get(5); + internal_static_google_iam_v1_BindingDelta_descriptor = getDescriptor().getMessageType(5); internal_static_google_iam_v1_BindingDelta_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_google_iam_v1_BindingDelta_descriptor, new java.lang.String[] { "Action", "Role", "Member", "Condition", }); - internal_static_google_iam_v1_AuditConfigDelta_descriptor = - getDescriptor().getMessageTypes().get(6); + internal_static_google_iam_v1_AuditConfigDelta_descriptor = getDescriptor().getMessageType(6); internal_static_google_iam_v1_AuditConfigDelta_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_google_iam_v1_AuditConfigDelta_descriptor, new java.lang.String[] { "Action", "Service", "ExemptedMember", "LogType", }); + descriptor.resolveAllFeaturesImmutable(); com.google.type.ExprProto.getDescriptor(); } diff --git a/java-iam/proto-google-iam-v1/src/main/java/com/google/iam/v1/ResourcePolicyMember.java b/java-iam/proto-google-iam-v1/src/main/java/com/google/iam/v1/ResourcePolicyMember.java new file mode 100644 index 0000000000..c967b0a647 --- /dev/null +++ b/java-iam/proto-google-iam-v1/src/main/java/com/google/iam/v1/ResourcePolicyMember.java @@ -0,0 +1,879 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/iam/v1/resource_policy_member.proto +// Protobuf Java Version: 4.33.2 + +package com.google.iam.v1; + +/** + * + * + *
        + * Output-only policy member strings of a Google Cloud resource's built-in
        + * identity.
        + * 
        + * + * Protobuf type {@code google.iam.v1.ResourcePolicyMember} + */ +@com.google.protobuf.Generated +public final class ResourcePolicyMember extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.iam.v1.ResourcePolicyMember) + ResourcePolicyMemberOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "ResourcePolicyMember"); + } + + // Use ResourcePolicyMember.newBuilder() to construct. + private ResourcePolicyMember(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private ResourcePolicyMember() { + iamPolicyNamePrincipal_ = ""; + iamPolicyUidPrincipal_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.iam.v1.ResourcePolicyMemberProto + .internal_static_google_iam_v1_ResourcePolicyMember_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.iam.v1.ResourcePolicyMemberProto + .internal_static_google_iam_v1_ResourcePolicyMember_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.iam.v1.ResourcePolicyMember.class, + com.google.iam.v1.ResourcePolicyMember.Builder.class); + } + + public static final int IAM_POLICY_NAME_PRINCIPAL_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object iamPolicyNamePrincipal_ = ""; + + /** + * + * + *
        +   * IAM policy binding member referring to a Google Cloud resource by
        +   * user-assigned name (https://google.aip.dev/122). If a resource is deleted
        +   * and recreated with the same name, the binding will be applicable to the new
        +   * resource.
        +   *
        +   * Example:
        +   * `principal://parametermanager.googleapis.com/projects/12345/name/locations/us-central1-a/parameters/my-parameter`
        +   * 
        + * + * string iam_policy_name_principal = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The iamPolicyNamePrincipal. + */ + @java.lang.Override + public java.lang.String getIamPolicyNamePrincipal() { + java.lang.Object ref = iamPolicyNamePrincipal_; + 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(); + iamPolicyNamePrincipal_ = s; + return s; + } + } + + /** + * + * + *
        +   * IAM policy binding member referring to a Google Cloud resource by
        +   * user-assigned name (https://google.aip.dev/122). If a resource is deleted
        +   * and recreated with the same name, the binding will be applicable to the new
        +   * resource.
        +   *
        +   * Example:
        +   * `principal://parametermanager.googleapis.com/projects/12345/name/locations/us-central1-a/parameters/my-parameter`
        +   * 
        + * + * string iam_policy_name_principal = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for iamPolicyNamePrincipal. + */ + @java.lang.Override + public com.google.protobuf.ByteString getIamPolicyNamePrincipalBytes() { + java.lang.Object ref = iamPolicyNamePrincipal_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + iamPolicyNamePrincipal_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int IAM_POLICY_UID_PRINCIPAL_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object iamPolicyUidPrincipal_ = ""; + + /** + * + * + *
        +   * IAM policy binding member referring to a Google Cloud resource by
        +   * system-assigned unique identifier (https://google.aip.dev/148#uid). If a
        +   * resource is deleted and recreated with the same name, the binding will not
        +   * be applicable to the new resource
        +   *
        +   * Example:
        +   * `principal://parametermanager.googleapis.com/projects/12345/uid/locations/us-central1-a/parameters/a918fed5`
        +   * 
        + * + * string iam_policy_uid_principal = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The iamPolicyUidPrincipal. + */ + @java.lang.Override + public java.lang.String getIamPolicyUidPrincipal() { + java.lang.Object ref = iamPolicyUidPrincipal_; + 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(); + iamPolicyUidPrincipal_ = s; + return s; + } + } + + /** + * + * + *
        +   * IAM policy binding member referring to a Google Cloud resource by
        +   * system-assigned unique identifier (https://google.aip.dev/148#uid). If a
        +   * resource is deleted and recreated with the same name, the binding will not
        +   * be applicable to the new resource
        +   *
        +   * Example:
        +   * `principal://parametermanager.googleapis.com/projects/12345/uid/locations/us-central1-a/parameters/a918fed5`
        +   * 
        + * + * string iam_policy_uid_principal = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for iamPolicyUidPrincipal. + */ + @java.lang.Override + public com.google.protobuf.ByteString getIamPolicyUidPrincipalBytes() { + java.lang.Object ref = iamPolicyUidPrincipal_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + iamPolicyUidPrincipal_ = 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.GeneratedMessage.isStringEmpty(iamPolicyNamePrincipal_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, iamPolicyNamePrincipal_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(iamPolicyUidPrincipal_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, iamPolicyUidPrincipal_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(iamPolicyNamePrincipal_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, iamPolicyNamePrincipal_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(iamPolicyUidPrincipal_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, iamPolicyUidPrincipal_); + } + 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.iam.v1.ResourcePolicyMember)) { + return super.equals(obj); + } + com.google.iam.v1.ResourcePolicyMember other = (com.google.iam.v1.ResourcePolicyMember) obj; + + if (!getIamPolicyNamePrincipal().equals(other.getIamPolicyNamePrincipal())) return false; + if (!getIamPolicyUidPrincipal().equals(other.getIamPolicyUidPrincipal())) 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) + IAM_POLICY_NAME_PRINCIPAL_FIELD_NUMBER; + hash = (53 * hash) + getIamPolicyNamePrincipal().hashCode(); + hash = (37 * hash) + IAM_POLICY_UID_PRINCIPAL_FIELD_NUMBER; + hash = (53 * hash) + getIamPolicyUidPrincipal().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.iam.v1.ResourcePolicyMember parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.iam.v1.ResourcePolicyMember parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.iam.v1.ResourcePolicyMember parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.iam.v1.ResourcePolicyMember 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.iam.v1.ResourcePolicyMember parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.iam.v1.ResourcePolicyMember parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.iam.v1.ResourcePolicyMember parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.iam.v1.ResourcePolicyMember parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.iam.v1.ResourcePolicyMember parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.iam.v1.ResourcePolicyMember parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.iam.v1.ResourcePolicyMember parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.iam.v1.ResourcePolicyMember parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.iam.v1.ResourcePolicyMember 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
        +   * Output-only policy member strings of a Google Cloud resource's built-in
        +   * identity.
        +   * 
        + * + * Protobuf type {@code google.iam.v1.ResourcePolicyMember} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.iam.v1.ResourcePolicyMember) + com.google.iam.v1.ResourcePolicyMemberOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.iam.v1.ResourcePolicyMemberProto + .internal_static_google_iam_v1_ResourcePolicyMember_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.iam.v1.ResourcePolicyMemberProto + .internal_static_google_iam_v1_ResourcePolicyMember_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.iam.v1.ResourcePolicyMember.class, + com.google.iam.v1.ResourcePolicyMember.Builder.class); + } + + // Construct using com.google.iam.v1.ResourcePolicyMember.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + iamPolicyNamePrincipal_ = ""; + iamPolicyUidPrincipal_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.iam.v1.ResourcePolicyMemberProto + .internal_static_google_iam_v1_ResourcePolicyMember_descriptor; + } + + @java.lang.Override + public com.google.iam.v1.ResourcePolicyMember getDefaultInstanceForType() { + return com.google.iam.v1.ResourcePolicyMember.getDefaultInstance(); + } + + @java.lang.Override + public com.google.iam.v1.ResourcePolicyMember build() { + com.google.iam.v1.ResourcePolicyMember result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.iam.v1.ResourcePolicyMember buildPartial() { + com.google.iam.v1.ResourcePolicyMember result = + new com.google.iam.v1.ResourcePolicyMember(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.iam.v1.ResourcePolicyMember result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.iamPolicyNamePrincipal_ = iamPolicyNamePrincipal_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.iamPolicyUidPrincipal_ = iamPolicyUidPrincipal_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.iam.v1.ResourcePolicyMember) { + return mergeFrom((com.google.iam.v1.ResourcePolicyMember) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.iam.v1.ResourcePolicyMember other) { + if (other == com.google.iam.v1.ResourcePolicyMember.getDefaultInstance()) return this; + if (!other.getIamPolicyNamePrincipal().isEmpty()) { + iamPolicyNamePrincipal_ = other.iamPolicyNamePrincipal_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getIamPolicyUidPrincipal().isEmpty()) { + iamPolicyUidPrincipal_ = other.iamPolicyUidPrincipal_; + 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: + { + iamPolicyNamePrincipal_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + iamPolicyUidPrincipal_ = 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.lang.Object iamPolicyNamePrincipal_ = ""; + + /** + * + * + *
        +     * IAM policy binding member referring to a Google Cloud resource by
        +     * user-assigned name (https://google.aip.dev/122). If a resource is deleted
        +     * and recreated with the same name, the binding will be applicable to the new
        +     * resource.
        +     *
        +     * Example:
        +     * `principal://parametermanager.googleapis.com/projects/12345/name/locations/us-central1-a/parameters/my-parameter`
        +     * 
        + * + * string iam_policy_name_principal = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The iamPolicyNamePrincipal. + */ + public java.lang.String getIamPolicyNamePrincipal() { + java.lang.Object ref = iamPolicyNamePrincipal_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + iamPolicyNamePrincipal_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
        +     * IAM policy binding member referring to a Google Cloud resource by
        +     * user-assigned name (https://google.aip.dev/122). If a resource is deleted
        +     * and recreated with the same name, the binding will be applicable to the new
        +     * resource.
        +     *
        +     * Example:
        +     * `principal://parametermanager.googleapis.com/projects/12345/name/locations/us-central1-a/parameters/my-parameter`
        +     * 
        + * + * string iam_policy_name_principal = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The bytes for iamPolicyNamePrincipal. + */ + public com.google.protobuf.ByteString getIamPolicyNamePrincipalBytes() { + java.lang.Object ref = iamPolicyNamePrincipal_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + iamPolicyNamePrincipal_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
        +     * IAM policy binding member referring to a Google Cloud resource by
        +     * user-assigned name (https://google.aip.dev/122). If a resource is deleted
        +     * and recreated with the same name, the binding will be applicable to the new
        +     * resource.
        +     *
        +     * Example:
        +     * `principal://parametermanager.googleapis.com/projects/12345/name/locations/us-central1-a/parameters/my-parameter`
        +     * 
        + * + * string iam_policy_name_principal = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The iamPolicyNamePrincipal to set. + * @return This builder for chaining. + */ + public Builder setIamPolicyNamePrincipal(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + iamPolicyNamePrincipal_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
        +     * IAM policy binding member referring to a Google Cloud resource by
        +     * user-assigned name (https://google.aip.dev/122). If a resource is deleted
        +     * and recreated with the same name, the binding will be applicable to the new
        +     * resource.
        +     *
        +     * Example:
        +     * `principal://parametermanager.googleapis.com/projects/12345/name/locations/us-central1-a/parameters/my-parameter`
        +     * 
        + * + * string iam_policy_name_principal = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return This builder for chaining. + */ + public Builder clearIamPolicyNamePrincipal() { + iamPolicyNamePrincipal_ = getDefaultInstance().getIamPolicyNamePrincipal(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
        +     * IAM policy binding member referring to a Google Cloud resource by
        +     * user-assigned name (https://google.aip.dev/122). If a resource is deleted
        +     * and recreated with the same name, the binding will be applicable to the new
        +     * resource.
        +     *
        +     * Example:
        +     * `principal://parametermanager.googleapis.com/projects/12345/name/locations/us-central1-a/parameters/my-parameter`
        +     * 
        + * + * string iam_policy_name_principal = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The bytes for iamPolicyNamePrincipal to set. + * @return This builder for chaining. + */ + public Builder setIamPolicyNamePrincipalBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + iamPolicyNamePrincipal_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object iamPolicyUidPrincipal_ = ""; + + /** + * + * + *
        +     * IAM policy binding member referring to a Google Cloud resource by
        +     * system-assigned unique identifier (https://google.aip.dev/148#uid). If a
        +     * resource is deleted and recreated with the same name, the binding will not
        +     * be applicable to the new resource
        +     *
        +     * Example:
        +     * `principal://parametermanager.googleapis.com/projects/12345/uid/locations/us-central1-a/parameters/a918fed5`
        +     * 
        + * + * string iam_policy_uid_principal = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The iamPolicyUidPrincipal. + */ + public java.lang.String getIamPolicyUidPrincipal() { + java.lang.Object ref = iamPolicyUidPrincipal_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + iamPolicyUidPrincipal_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
        +     * IAM policy binding member referring to a Google Cloud resource by
        +     * system-assigned unique identifier (https://google.aip.dev/148#uid). If a
        +     * resource is deleted and recreated with the same name, the binding will not
        +     * be applicable to the new resource
        +     *
        +     * Example:
        +     * `principal://parametermanager.googleapis.com/projects/12345/uid/locations/us-central1-a/parameters/a918fed5`
        +     * 
        + * + * string iam_policy_uid_principal = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The bytes for iamPolicyUidPrincipal. + */ + public com.google.protobuf.ByteString getIamPolicyUidPrincipalBytes() { + java.lang.Object ref = iamPolicyUidPrincipal_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + iamPolicyUidPrincipal_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
        +     * IAM policy binding member referring to a Google Cloud resource by
        +     * system-assigned unique identifier (https://google.aip.dev/148#uid). If a
        +     * resource is deleted and recreated with the same name, the binding will not
        +     * be applicable to the new resource
        +     *
        +     * Example:
        +     * `principal://parametermanager.googleapis.com/projects/12345/uid/locations/us-central1-a/parameters/a918fed5`
        +     * 
        + * + * string iam_policy_uid_principal = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The iamPolicyUidPrincipal to set. + * @return This builder for chaining. + */ + public Builder setIamPolicyUidPrincipal(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + iamPolicyUidPrincipal_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
        +     * IAM policy binding member referring to a Google Cloud resource by
        +     * system-assigned unique identifier (https://google.aip.dev/148#uid). If a
        +     * resource is deleted and recreated with the same name, the binding will not
        +     * be applicable to the new resource
        +     *
        +     * Example:
        +     * `principal://parametermanager.googleapis.com/projects/12345/uid/locations/us-central1-a/parameters/a918fed5`
        +     * 
        + * + * string iam_policy_uid_principal = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return This builder for chaining. + */ + public Builder clearIamPolicyUidPrincipal() { + iamPolicyUidPrincipal_ = getDefaultInstance().getIamPolicyUidPrincipal(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
        +     * IAM policy binding member referring to a Google Cloud resource by
        +     * system-assigned unique identifier (https://google.aip.dev/148#uid). If a
        +     * resource is deleted and recreated with the same name, the binding will not
        +     * be applicable to the new resource
        +     *
        +     * Example:
        +     * `principal://parametermanager.googleapis.com/projects/12345/uid/locations/us-central1-a/parameters/a918fed5`
        +     * 
        + * + * string iam_policy_uid_principal = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The bytes for iamPolicyUidPrincipal to set. + * @return This builder for chaining. + */ + public Builder setIamPolicyUidPrincipalBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + iamPolicyUidPrincipal_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.iam.v1.ResourcePolicyMember) + } + + // @@protoc_insertion_point(class_scope:google.iam.v1.ResourcePolicyMember) + private static final com.google.iam.v1.ResourcePolicyMember DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.iam.v1.ResourcePolicyMember(); + } + + public static com.google.iam.v1.ResourcePolicyMember getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ResourcePolicyMember 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.iam.v1.ResourcePolicyMember getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-iam/proto-google-iam-v1/src/main/java/com/google/iam/v1/ResourcePolicyMemberOrBuilder.java b/java-iam/proto-google-iam-v1/src/main/java/com/google/iam/v1/ResourcePolicyMemberOrBuilder.java new file mode 100644 index 0000000000..960af49e7c --- /dev/null +++ b/java-iam/proto-google-iam-v1/src/main/java/com/google/iam/v1/ResourcePolicyMemberOrBuilder.java @@ -0,0 +1,104 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/iam/v1/resource_policy_member.proto +// Protobuf Java Version: 4.33.2 + +package com.google.iam.v1; + +@com.google.protobuf.Generated +public interface ResourcePolicyMemberOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.iam.v1.ResourcePolicyMember) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
        +   * IAM policy binding member referring to a Google Cloud resource by
        +   * user-assigned name (https://google.aip.dev/122). If a resource is deleted
        +   * and recreated with the same name, the binding will be applicable to the new
        +   * resource.
        +   *
        +   * Example:
        +   * `principal://parametermanager.googleapis.com/projects/12345/name/locations/us-central1-a/parameters/my-parameter`
        +   * 
        + * + * string iam_policy_name_principal = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The iamPolicyNamePrincipal. + */ + java.lang.String getIamPolicyNamePrincipal(); + + /** + * + * + *
        +   * IAM policy binding member referring to a Google Cloud resource by
        +   * user-assigned name (https://google.aip.dev/122). If a resource is deleted
        +   * and recreated with the same name, the binding will be applicable to the new
        +   * resource.
        +   *
        +   * Example:
        +   * `principal://parametermanager.googleapis.com/projects/12345/name/locations/us-central1-a/parameters/my-parameter`
        +   * 
        + * + * string iam_policy_name_principal = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for iamPolicyNamePrincipal. + */ + com.google.protobuf.ByteString getIamPolicyNamePrincipalBytes(); + + /** + * + * + *
        +   * IAM policy binding member referring to a Google Cloud resource by
        +   * system-assigned unique identifier (https://google.aip.dev/148#uid). If a
        +   * resource is deleted and recreated with the same name, the binding will not
        +   * be applicable to the new resource
        +   *
        +   * Example:
        +   * `principal://parametermanager.googleapis.com/projects/12345/uid/locations/us-central1-a/parameters/a918fed5`
        +   * 
        + * + * string iam_policy_uid_principal = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The iamPolicyUidPrincipal. + */ + java.lang.String getIamPolicyUidPrincipal(); + + /** + * + * + *
        +   * IAM policy binding member referring to a Google Cloud resource by
        +   * system-assigned unique identifier (https://google.aip.dev/148#uid). If a
        +   * resource is deleted and recreated with the same name, the binding will not
        +   * be applicable to the new resource
        +   *
        +   * Example:
        +   * `principal://parametermanager.googleapis.com/projects/12345/uid/locations/us-central1-a/parameters/a918fed5`
        +   * 
        + * + * string iam_policy_uid_principal = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for iamPolicyUidPrincipal. + */ + com.google.protobuf.ByteString getIamPolicyUidPrincipalBytes(); +} diff --git a/java-iam/proto-google-iam-v1/src/main/java/com/google/iam/v1/ResourcePolicyMemberProto.java b/java-iam/proto-google-iam-v1/src/main/java/com/google/iam/v1/ResourcePolicyMemberProto.java new file mode 100644 index 0000000000..59989125d2 --- /dev/null +++ b/java-iam/proto-google-iam-v1/src/main/java/com/google/iam/v1/ResourcePolicyMemberProto.java @@ -0,0 +1,90 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/iam/v1/resource_policy_member.proto +// Protobuf Java Version: 4.33.2 + +package com.google.iam.v1; + +@com.google.protobuf.Generated +public final class ResourcePolicyMemberProto extends com.google.protobuf.GeneratedFile { + private ResourcePolicyMemberProto() {} + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "ResourcePolicyMemberProto"); + } + + 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_iam_v1_ResourcePolicyMember_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_iam_v1_ResourcePolicyMember_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/iam/v1/resource_policy_member.p" + + "roto\022\rgoogle.iam.v1\032\037google/api/field_be" + + "havior.proto\"e\n\024ResourcePolicyMember\022&\n\031" + + "iam_policy_name_principal\030\001 \001(\tB\003\340A\003\022%\n\030" + + "iam_policy_uid_principal\030\002 \001(\tB\003\340A\003B\207\001\n\021" + + "com.google.iam.v1B\031ResourcePolicyMemberP" + + "rotoP\001Z)cloud.google.com/go/iam/apiv1/ia" + + "mpb;iampb\252\002\023Google.Cloud.Iam.V1\312\002\023Google" + + "\\Cloud\\Iam\\V1b\006proto3" + }; + descriptor = + com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( + descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + com.google.api.FieldBehaviorProto.getDescriptor(), + }); + internal_static_google_iam_v1_ResourcePolicyMember_descriptor = + getDescriptor().getMessageType(0); + internal_static_google_iam_v1_ResourcePolicyMember_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_iam_v1_ResourcePolicyMember_descriptor, + new java.lang.String[] { + "IamPolicyNamePrincipal", "IamPolicyUidPrincipal", + }); + descriptor.resolveAllFeaturesImmutable(); + com.google.api.FieldBehaviorProto.getDescriptor(); + com.google.protobuf.ExtensionRegistry registry = + com.google.protobuf.ExtensionRegistry.newInstance(); + registry.add(com.google.api.FieldBehaviorProto.fieldBehavior); + com.google.protobuf.Descriptors.FileDescriptor.internalUpdateFileDescriptor( + descriptor, registry); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/java-iam/proto-google-iam-v1/src/main/java/com/google/iam/v1/SetIamPolicyRequest.java b/java-iam/proto-google-iam-v1/src/main/java/com/google/iam/v1/SetIamPolicyRequest.java index 78d0c7aa01..9264c879c6 100644 --- a/java-iam/proto-google-iam-v1/src/main/java/com/google/iam/v1/SetIamPolicyRequest.java +++ b/java-iam/proto-google-iam-v1/src/main/java/com/google/iam/v1/SetIamPolicyRequest.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,9 @@ * limitations under the License. */ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: google/iam/v1/iam_policy.proto +// Protobuf Java Version: 4.33.2 package com.google.iam.v1; @@ -27,13 +29,25 @@ * * Protobuf type {@code google.iam.v1.SetIamPolicyRequest} */ -public final class SetIamPolicyRequest extends com.google.protobuf.GeneratedMessageV3 +@com.google.protobuf.Generated +public final class SetIamPolicyRequest extends com.google.protobuf.GeneratedMessage implements // @@protoc_insertion_point(message_implements:google.iam.v1.SetIamPolicyRequest) SetIamPolicyRequestOrBuilder { private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "SetIamPolicyRequest"); + } + // Use SetIamPolicyRequest.newBuilder() to construct. - private SetIamPolicyRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + private SetIamPolicyRequest(com.google.protobuf.GeneratedMessage.Builder builder) { super(builder); } @@ -41,24 +55,13 @@ private SetIamPolicyRequest() { resource_ = ""; } - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new SetIamPolicyRequest(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.iam.v1.IamPolicyProto .internal_static_google_iam_v1_SetIamPolicyRequest_descriptor; } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.iam.v1.IamPolicyProto .internal_static_google_iam_v1_SetIamPolicyRequest_fieldAccessorTable @@ -67,8 +70,12 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { com.google.iam.v1.SetIamPolicyRequest.Builder.class); } + private int bitField0_; public static final int RESOURCE_FIELD_NUMBER = 1; - private volatile java.lang.Object resource_; + + @SuppressWarnings("serial") + private volatile java.lang.Object resource_ = ""; + /** * * @@ -95,6 +102,7 @@ public java.lang.String getResource() { return s; } } + /** * * @@ -124,6 +132,7 @@ public com.google.protobuf.ByteString getResourceBytes() { public static final int POLICY_FIELD_NUMBER = 2; private com.google.iam.v1.Policy policy_; + /** * * @@ -140,8 +149,9 @@ public com.google.protobuf.ByteString getResourceBytes() { */ @java.lang.Override public boolean hasPolicy() { - return policy_ != null; + return ((bitField0_ & 0x00000001) != 0); } + /** * * @@ -160,6 +170,7 @@ public boolean hasPolicy() { public com.google.iam.v1.Policy getPolicy() { return policy_ == null ? com.google.iam.v1.Policy.getDefaultInstance() : policy_; } + /** * * @@ -174,11 +185,12 @@ public com.google.iam.v1.Policy getPolicy() { */ @java.lang.Override public com.google.iam.v1.PolicyOrBuilder getPolicyOrBuilder() { - return getPolicy(); + return policy_ == null ? com.google.iam.v1.Policy.getDefaultInstance() : policy_; } public static final int UPDATE_MASK_FIELD_NUMBER = 3; private com.google.protobuf.FieldMask updateMask_; + /** * * @@ -186,6 +198,7 @@ public com.google.iam.v1.PolicyOrBuilder getPolicyOrBuilder() { * OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only * the fields in the mask will be modified. If no mask is provided, the * following default mask is used: + * * `paths: "bindings, etag"` *
        * @@ -195,8 +208,9 @@ public com.google.iam.v1.PolicyOrBuilder getPolicyOrBuilder() { */ @java.lang.Override public boolean hasUpdateMask() { - return updateMask_ != null; + return ((bitField0_ & 0x00000002) != 0); } + /** * * @@ -204,6 +218,7 @@ public boolean hasUpdateMask() { * OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only * the fields in the mask will be modified. If no mask is provided, the * following default mask is used: + * * `paths: "bindings, etag"` *
        * @@ -215,6 +230,7 @@ public boolean hasUpdateMask() { public com.google.protobuf.FieldMask getUpdateMask() { return updateMask_ == null ? com.google.protobuf.FieldMask.getDefaultInstance() : updateMask_; } + /** * * @@ -222,6 +238,7 @@ public com.google.protobuf.FieldMask getUpdateMask() { * OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only * the fields in the mask will be modified. If no mask is provided, the * following default mask is used: + * * `paths: "bindings, etag"` *
        * @@ -229,7 +246,7 @@ public com.google.protobuf.FieldMask getUpdateMask() { */ @java.lang.Override public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { - return getUpdateMask(); + return updateMask_ == null ? com.google.protobuf.FieldMask.getDefaultInstance() : updateMask_; } private byte memoizedIsInitialized = -1; @@ -246,13 +263,13 @@ public final boolean isInitialized() { @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(resource_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, resource_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(resource_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, resource_); } - if (policy_ != null) { + if (((bitField0_ & 0x00000001) != 0)) { output.writeMessage(2, getPolicy()); } - if (updateMask_ != null) { + if (((bitField0_ & 0x00000002) != 0)) { output.writeMessage(3, getUpdateMask()); } getUnknownFields().writeTo(output); @@ -264,13 +281,13 @@ public int getSerializedSize() { if (size != -1) return size; size = 0; - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(resource_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, resource_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(resource_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, resource_); } - if (policy_ != null) { + if (((bitField0_ & 0x00000001) != 0)) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getPolicy()); } - if (updateMask_ != null) { + if (((bitField0_ & 0x00000002) != 0)) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getUpdateMask()); } size += getUnknownFields().getSerializedSize(); @@ -359,38 +376,38 @@ public static com.google.iam.v1.SetIamPolicyRequest parseFrom( public static com.google.iam.v1.SetIamPolicyRequest parseFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); } public static com.google.iam.v1.SetIamPolicyRequest parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } public static com.google.iam.v1.SetIamPolicyRequest parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); } public static com.google.iam.v1.SetIamPolicyRequest parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( PARSER, input, extensionRegistry); } public static com.google.iam.v1.SetIamPolicyRequest parseFrom( com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); } public static com.google.iam.v1.SetIamPolicyRequest parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } @@ -413,10 +430,11 @@ public Builder toBuilder() { } @java.lang.Override - protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { Builder builder = new Builder(parent); return builder; } + /** * * @@ -426,7 +444,7 @@ protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.Build * * Protobuf type {@code google.iam.v1.SetIamPolicyRequest} */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder implements // @@protoc_insertion_point(builder_implements:google.iam.v1.SetIamPolicyRequest) com.google.iam.v1.SetIamPolicyRequestOrBuilder { @@ -436,7 +454,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.iam.v1.IamPolicyProto .internal_static_google_iam_v1_SetIamPolicyRequest_fieldAccessorTable @@ -446,27 +464,35 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } // Construct using com.google.iam.v1.SetIamPolicyRequest.newBuilder() - private Builder() {} + private Builder() { + maybeForceBuilderInitialization(); + } - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetPolicyFieldBuilder(); + internalGetUpdateMaskFieldBuilder(); + } } @java.lang.Override public Builder clear() { super.clear(); + bitField0_ = 0; resource_ = ""; - - if (policyBuilder_ == null) { - policy_ = null; - } else { - policy_ = null; + policy_ = null; + if (policyBuilder_ != null) { + policyBuilder_.dispose(); policyBuilder_ = null; } - if (updateMaskBuilder_ == null) { - updateMask_ = null; - } else { - updateMask_ = null; + updateMask_ = null; + if (updateMaskBuilder_ != null) { + updateMaskBuilder_.dispose(); updateMaskBuilder_ = null; } return this; @@ -496,52 +522,28 @@ public com.google.iam.v1.SetIamPolicyRequest build() { public com.google.iam.v1.SetIamPolicyRequest buildPartial() { com.google.iam.v1.SetIamPolicyRequest result = new com.google.iam.v1.SetIamPolicyRequest(this); - result.resource_ = resource_; - if (policyBuilder_ == null) { - result.policy_ = policy_; - } else { - result.policy_ = policyBuilder_.build(); - } - if (updateMaskBuilder_ == null) { - result.updateMask_ = updateMask_; - } else { - result.updateMask_ = updateMaskBuilder_.build(); + if (bitField0_ != 0) { + buildPartial0(result); } 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); + private void buildPartial0(com.google.iam.v1.SetIamPolicyRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.resource_ = resource_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.policy_ = policyBuilder_ == null ? policy_ : policyBuilder_.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 @@ -558,6 +560,7 @@ public Builder mergeFrom(com.google.iam.v1.SetIamPolicyRequest other) { if (other == com.google.iam.v1.SetIamPolicyRequest.getDefaultInstance()) return this; if (!other.getResource().isEmpty()) { resource_ = other.resource_; + bitField0_ |= 0x00000001; onChanged(); } if (other.hasPolicy()) { @@ -595,19 +598,20 @@ public Builder mergeFrom( case 10: { resource_ = input.readStringRequireUtf8(); - + bitField0_ |= 0x00000001; break; } // case 10 case 18: { - input.readMessage(getPolicyFieldBuilder().getBuilder(), extensionRegistry); - + input.readMessage(internalGetPolicyFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; break; } // case 18 case 26: { - input.readMessage(getUpdateMaskFieldBuilder().getBuilder(), extensionRegistry); - + input.readMessage( + internalGetUpdateMaskFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000004; break; } // case 26 default: @@ -627,7 +631,10 @@ public Builder mergeFrom( return this; } + private int bitField0_; + private java.lang.Object resource_ = ""; + /** * * @@ -653,6 +660,7 @@ public java.lang.String getResource() { return (java.lang.String) ref; } } + /** * * @@ -678,6 +686,7 @@ public com.google.protobuf.ByteString getResourceBytes() { return (com.google.protobuf.ByteString) ref; } } + /** * * @@ -697,11 +706,12 @@ public Builder setResource(java.lang.String value) { if (value == null) { throw new NullPointerException(); } - resource_ = value; + bitField0_ |= 0x00000001; onChanged(); return this; } + /** * * @@ -717,11 +727,12 @@ public Builder setResource(java.lang.String value) { * @return This builder for chaining. */ public Builder clearResource() { - resource_ = getDefaultInstance().getResource(); + bitField0_ = (bitField0_ & ~0x00000001); onChanged(); return this; } + /** * * @@ -742,18 +753,19 @@ public Builder setResourceBytes(com.google.protobuf.ByteString value) { throw new NullPointerException(); } checkByteStringIsUtf8(value); - resource_ = value; + bitField0_ |= 0x00000001; onChanged(); return this; } private com.google.iam.v1.Policy policy_; - private com.google.protobuf.SingleFieldBuilderV3< + private com.google.protobuf.SingleFieldBuilder< com.google.iam.v1.Policy, com.google.iam.v1.Policy.Builder, com.google.iam.v1.PolicyOrBuilder> policyBuilder_; + /** * * @@ -769,8 +781,9 @@ public Builder setResourceBytes(com.google.protobuf.ByteString value) { * @return Whether the policy field is set. */ public boolean hasPolicy() { - return policyBuilder_ != null || policy_ != null; + return ((bitField0_ & 0x00000002) != 0); } + /** * * @@ -792,6 +805,7 @@ public com.google.iam.v1.Policy getPolicy() { return policyBuilder_.getMessage(); } } + /** * * @@ -810,13 +824,14 @@ public Builder setPolicy(com.google.iam.v1.Policy value) { throw new NullPointerException(); } policy_ = value; - onChanged(); } else { policyBuilder_.setMessage(value); } - + bitField0_ |= 0x00000002; + onChanged(); return this; } + /** * * @@ -832,13 +847,14 @@ public Builder setPolicy(com.google.iam.v1.Policy value) { public Builder setPolicy(com.google.iam.v1.Policy.Builder builderForValue) { if (policyBuilder_ == null) { policy_ = builderForValue.build(); - onChanged(); } else { policyBuilder_.setMessage(builderForValue.build()); } - + bitField0_ |= 0x00000002; + onChanged(); return this; } + /** * * @@ -853,18 +869,23 @@ public Builder setPolicy(com.google.iam.v1.Policy.Builder builderForValue) { */ public Builder mergePolicy(com.google.iam.v1.Policy value) { if (policyBuilder_ == null) { - if (policy_ != null) { - policy_ = com.google.iam.v1.Policy.newBuilder(policy_).mergeFrom(value).buildPartial(); + if (((bitField0_ & 0x00000002) != 0) + && policy_ != null + && policy_ != com.google.iam.v1.Policy.getDefaultInstance()) { + getPolicyBuilder().mergeFrom(value); } else { policy_ = value; } - onChanged(); } else { policyBuilder_.mergeFrom(value); } - + if (policy_ != null) { + bitField0_ |= 0x00000002; + onChanged(); + } return this; } + /** * * @@ -878,16 +899,16 @@ public Builder mergePolicy(com.google.iam.v1.Policy value) { * .google.iam.v1.Policy policy = 2 [(.google.api.field_behavior) = REQUIRED]; */ public Builder clearPolicy() { - if (policyBuilder_ == null) { - policy_ = null; - onChanged(); - } else { - policy_ = null; + bitField0_ = (bitField0_ & ~0x00000002); + policy_ = null; + if (policyBuilder_ != null) { + policyBuilder_.dispose(); policyBuilder_ = null; } - + onChanged(); return this; } + /** * * @@ -901,10 +922,11 @@ public Builder clearPolicy() { * .google.iam.v1.Policy policy = 2 [(.google.api.field_behavior) = REQUIRED]; */ public com.google.iam.v1.Policy.Builder getPolicyBuilder() { - + bitField0_ |= 0x00000002; onChanged(); - return getPolicyFieldBuilder().getBuilder(); + return internalGetPolicyFieldBuilder().getBuilder(); } + /** * * @@ -924,6 +946,7 @@ public com.google.iam.v1.PolicyOrBuilder getPolicyOrBuilder() { return policy_ == null ? com.google.iam.v1.Policy.getDefaultInstance() : policy_; } } + /** * * @@ -936,14 +959,14 @@ public com.google.iam.v1.PolicyOrBuilder getPolicyOrBuilder() { * * .google.iam.v1.Policy policy = 2 [(.google.api.field_behavior) = REQUIRED]; */ - private com.google.protobuf.SingleFieldBuilderV3< + private com.google.protobuf.SingleFieldBuilder< com.google.iam.v1.Policy, com.google.iam.v1.Policy.Builder, com.google.iam.v1.PolicyOrBuilder> - getPolicyFieldBuilder() { + internalGetPolicyFieldBuilder() { if (policyBuilder_ == null) { policyBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< + new com.google.protobuf.SingleFieldBuilder< com.google.iam.v1.Policy, com.google.iam.v1.Policy.Builder, com.google.iam.v1.PolicyOrBuilder>(getPolicy(), getParentForChildren(), isClean()); @@ -953,11 +976,12 @@ public com.google.iam.v1.PolicyOrBuilder getPolicyOrBuilder() { } private com.google.protobuf.FieldMask updateMask_; - private com.google.protobuf.SingleFieldBuilderV3< + private com.google.protobuf.SingleFieldBuilder< com.google.protobuf.FieldMask, com.google.protobuf.FieldMask.Builder, com.google.protobuf.FieldMaskOrBuilder> updateMaskBuilder_; + /** * * @@ -965,6 +989,7 @@ public com.google.iam.v1.PolicyOrBuilder getPolicyOrBuilder() { * OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only * the fields in the mask will be modified. If no mask is provided, the * following default mask is used: + * * `paths: "bindings, etag"` *
        * @@ -973,8 +998,9 @@ public com.google.iam.v1.PolicyOrBuilder getPolicyOrBuilder() { * @return Whether the updateMask field is set. */ public boolean hasUpdateMask() { - return updateMaskBuilder_ != null || updateMask_ != null; + return ((bitField0_ & 0x00000004) != 0); } + /** * * @@ -982,6 +1008,7 @@ public boolean hasUpdateMask() { * OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only * the fields in the mask will be modified. If no mask is provided, the * following default mask is used: + * * `paths: "bindings, etag"` *
        * @@ -998,6 +1025,7 @@ public com.google.protobuf.FieldMask getUpdateMask() { return updateMaskBuilder_.getMessage(); } } + /** * * @@ -1005,6 +1033,7 @@ public com.google.protobuf.FieldMask getUpdateMask() { * OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only * the fields in the mask will be modified. If no mask is provided, the * following default mask is used: + * * `paths: "bindings, etag"` *
        * @@ -1016,13 +1045,14 @@ public Builder setUpdateMask(com.google.protobuf.FieldMask value) { throw new NullPointerException(); } updateMask_ = value; - onChanged(); } else { updateMaskBuilder_.setMessage(value); } - + bitField0_ |= 0x00000004; + onChanged(); return this; } + /** * * @@ -1030,6 +1060,7 @@ public Builder setUpdateMask(com.google.protobuf.FieldMask value) { * OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only * the fields in the mask will be modified. If no mask is provided, the * following default mask is used: + * * `paths: "bindings, etag"` *
        * @@ -1038,13 +1069,14 @@ public Builder setUpdateMask(com.google.protobuf.FieldMask value) { public Builder setUpdateMask(com.google.protobuf.FieldMask.Builder builderForValue) { if (updateMaskBuilder_ == null) { updateMask_ = builderForValue.build(); - onChanged(); } else { updateMaskBuilder_.setMessage(builderForValue.build()); } - + bitField0_ |= 0x00000004; + onChanged(); return this; } + /** * * @@ -1052,6 +1084,7 @@ public Builder setUpdateMask(com.google.protobuf.FieldMask.Builder builderForVal * OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only * the fields in the mask will be modified. If no mask is provided, the * following default mask is used: + * * `paths: "bindings, etag"` *
        * @@ -1059,19 +1092,23 @@ public Builder setUpdateMask(com.google.protobuf.FieldMask.Builder builderForVal */ public Builder mergeUpdateMask(com.google.protobuf.FieldMask value) { if (updateMaskBuilder_ == null) { - if (updateMask_ != null) { - updateMask_ = - com.google.protobuf.FieldMask.newBuilder(updateMask_).mergeFrom(value).buildPartial(); + if (((bitField0_ & 0x00000004) != 0) + && updateMask_ != null + && updateMask_ != com.google.protobuf.FieldMask.getDefaultInstance()) { + getUpdateMaskBuilder().mergeFrom(value); } else { updateMask_ = value; } - onChanged(); } else { updateMaskBuilder_.mergeFrom(value); } - + if (updateMask_ != null) { + bitField0_ |= 0x00000004; + onChanged(); + } return this; } + /** * * @@ -1079,22 +1116,23 @@ public Builder mergeUpdateMask(com.google.protobuf.FieldMask value) { * OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only * the fields in the mask will be modified. If no mask is provided, the * following default mask is used: + * * `paths: "bindings, etag"` *
        * * .google.protobuf.FieldMask update_mask = 3; */ public Builder clearUpdateMask() { - if (updateMaskBuilder_ == null) { - updateMask_ = null; - onChanged(); - } else { - updateMask_ = null; + bitField0_ = (bitField0_ & ~0x00000004); + updateMask_ = null; + if (updateMaskBuilder_ != null) { + updateMaskBuilder_.dispose(); updateMaskBuilder_ = null; } - + onChanged(); return this; } + /** * * @@ -1102,16 +1140,18 @@ public Builder clearUpdateMask() { * OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only * the fields in the mask will be modified. If no mask is provided, the * following default mask is used: + * * `paths: "bindings, etag"` *
        * * .google.protobuf.FieldMask update_mask = 3; */ public com.google.protobuf.FieldMask.Builder getUpdateMaskBuilder() { - + bitField0_ |= 0x00000004; onChanged(); - return getUpdateMaskFieldBuilder().getBuilder(); + return internalGetUpdateMaskFieldBuilder().getBuilder(); } + /** * * @@ -1119,6 +1159,7 @@ public com.google.protobuf.FieldMask.Builder getUpdateMaskBuilder() { * OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only * the fields in the mask will be modified. If no mask is provided, the * following default mask is used: + * * `paths: "bindings, etag"` *
        * @@ -1133,6 +1174,7 @@ public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { : updateMask_; } } + /** * * @@ -1140,19 +1182,20 @@ public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { * OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only * the fields in the mask will be modified. If no mask is provided, the * following default mask is used: + * * `paths: "bindings, etag"` *
        * * .google.protobuf.FieldMask update_mask = 3; */ - private com.google.protobuf.SingleFieldBuilderV3< + private com.google.protobuf.SingleFieldBuilder< com.google.protobuf.FieldMask, com.google.protobuf.FieldMask.Builder, com.google.protobuf.FieldMaskOrBuilder> - getUpdateMaskFieldBuilder() { + internalGetUpdateMaskFieldBuilder() { if (updateMaskBuilder_ == null) { updateMaskBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< + new com.google.protobuf.SingleFieldBuilder< com.google.protobuf.FieldMask, com.google.protobuf.FieldMask.Builder, com.google.protobuf.FieldMaskOrBuilder>( @@ -1162,17 +1205,6 @@ public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { 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.iam.v1.SetIamPolicyRequest) } diff --git a/java-iam/proto-google-iam-v1/src/main/java/com/google/iam/v1/SetIamPolicyRequestOrBuilder.java b/java-iam/proto-google-iam-v1/src/main/java/com/google/iam/v1/SetIamPolicyRequestOrBuilder.java index 48ab0dff5d..76f2b51296 100644 --- a/java-iam/proto-google-iam-v1/src/main/java/com/google/iam/v1/SetIamPolicyRequestOrBuilder.java +++ b/java-iam/proto-google-iam-v1/src/main/java/com/google/iam/v1/SetIamPolicyRequestOrBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,10 +14,13 @@ * limitations under the License. */ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: google/iam/v1/iam_policy.proto +// Protobuf Java Version: 4.33.2 package com.google.iam.v1; +@com.google.protobuf.Generated public interface SetIamPolicyRequestOrBuilder extends // @@protoc_insertion_point(interface_extends:google.iam.v1.SetIamPolicyRequest) @@ -38,6 +41,7 @@ public interface SetIamPolicyRequestOrBuilder * @return The resource. */ java.lang.String getResource(); + /** * * @@ -69,6 +73,7 @@ public interface SetIamPolicyRequestOrBuilder * @return Whether the policy field is set. */ boolean hasPolicy(); + /** * * @@ -84,6 +89,7 @@ public interface SetIamPolicyRequestOrBuilder * @return The policy. */ com.google.iam.v1.Policy getPolicy(); + /** * * @@ -105,6 +111,7 @@ public interface SetIamPolicyRequestOrBuilder * OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only * the fields in the mask will be modified. If no mask is provided, the * following default mask is used: + * * `paths: "bindings, etag"` *
        * @@ -113,6 +120,7 @@ public interface SetIamPolicyRequestOrBuilder * @return Whether the updateMask field is set. */ boolean hasUpdateMask(); + /** * * @@ -120,6 +128,7 @@ public interface SetIamPolicyRequestOrBuilder * OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only * the fields in the mask will be modified. If no mask is provided, the * following default mask is used: + * * `paths: "bindings, etag"` *
        * @@ -128,6 +137,7 @@ public interface SetIamPolicyRequestOrBuilder * @return The updateMask. */ com.google.protobuf.FieldMask getUpdateMask(); + /** * * @@ -135,6 +145,7 @@ public interface SetIamPolicyRequestOrBuilder * OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only * the fields in the mask will be modified. If no mask is provided, the * following default mask is used: + * * `paths: "bindings, etag"` *
        * diff --git a/java-iam/proto-google-iam-v1/src/main/java/com/google/iam/v1/TestIamPermissionsRequest.java b/java-iam/proto-google-iam-v1/src/main/java/com/google/iam/v1/TestIamPermissionsRequest.java index cb5dab7d8f..db888e16cf 100644 --- a/java-iam/proto-google-iam-v1/src/main/java/com/google/iam/v1/TestIamPermissionsRequest.java +++ b/java-iam/proto-google-iam-v1/src/main/java/com/google/iam/v1/TestIamPermissionsRequest.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,9 @@ * limitations under the License. */ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: google/iam/v1/iam_policy.proto +// Protobuf Java Version: 4.33.2 package com.google.iam.v1; @@ -27,30 +29,31 @@ * * Protobuf type {@code google.iam.v1.TestIamPermissionsRequest} */ -public final class TestIamPermissionsRequest extends com.google.protobuf.GeneratedMessageV3 +@com.google.protobuf.Generated +public final class TestIamPermissionsRequest extends com.google.protobuf.GeneratedMessage implements // @@protoc_insertion_point(message_implements:google.iam.v1.TestIamPermissionsRequest) TestIamPermissionsRequestOrBuilder { private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "TestIamPermissionsRequest"); + } + // Use TestIamPermissionsRequest.newBuilder() to construct. - private TestIamPermissionsRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + private TestIamPermissionsRequest(com.google.protobuf.GeneratedMessage.Builder builder) { super(builder); } private TestIamPermissionsRequest() { resource_ = ""; - permissions_ = com.google.protobuf.LazyStringArrayList.EMPTY; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new TestIamPermissionsRequest(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; + permissions_ = com.google.protobuf.LazyStringArrayList.emptyList(); } public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { @@ -59,7 +62,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.iam.v1.IamPolicyProto .internal_static_google_iam_v1_TestIamPermissionsRequest_fieldAccessorTable @@ -69,7 +72,10 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } public static final int RESOURCE_FIELD_NUMBER = 1; - private volatile java.lang.Object resource_; + + @SuppressWarnings("serial") + private volatile java.lang.Object resource_ = ""; + /** * * @@ -96,6 +102,7 @@ public java.lang.String getResource() { return s; } } + /** * * @@ -124,7 +131,11 @@ public com.google.protobuf.ByteString getResourceBytes() { } public static final int PERMISSIONS_FIELD_NUMBER = 2; - private com.google.protobuf.LazyStringList permissions_; + + @SuppressWarnings("serial") + private com.google.protobuf.LazyStringArrayList permissions_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + /** * * @@ -142,6 +153,7 @@ public com.google.protobuf.ByteString getResourceBytes() { public com.google.protobuf.ProtocolStringList getPermissionsList() { return permissions_; } + /** * * @@ -159,6 +171,7 @@ public com.google.protobuf.ProtocolStringList getPermissionsList() { public int getPermissionsCount() { return permissions_.size(); } + /** * * @@ -177,6 +190,7 @@ public int getPermissionsCount() { public java.lang.String getPermissions(int index) { return permissions_.get(index); } + /** * * @@ -210,11 +224,11 @@ public final boolean isInitialized() { @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(resource_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, resource_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(resource_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, resource_); } for (int i = 0; i < permissions_.size(); i++) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 2, permissions_.getRaw(i)); + com.google.protobuf.GeneratedMessage.writeString(output, 2, permissions_.getRaw(i)); } getUnknownFields().writeTo(output); } @@ -225,8 +239,8 @@ public int getSerializedSize() { if (size != -1) return size; size = 0; - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(resource_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, resource_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(resource_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, resource_); } { int dataSize = 0; @@ -313,38 +327,38 @@ public static com.google.iam.v1.TestIamPermissionsRequest parseFrom( public static com.google.iam.v1.TestIamPermissionsRequest parseFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); } public static com.google.iam.v1.TestIamPermissionsRequest parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } public static com.google.iam.v1.TestIamPermissionsRequest parseDelimitedFrom( java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); } public static com.google.iam.v1.TestIamPermissionsRequest parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( PARSER, input, extensionRegistry); } public static com.google.iam.v1.TestIamPermissionsRequest parseFrom( com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); } public static com.google.iam.v1.TestIamPermissionsRequest parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } @@ -367,10 +381,11 @@ public Builder toBuilder() { } @java.lang.Override - protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { Builder builder = new Builder(parent); return builder; } + /** * * @@ -380,7 +395,7 @@ protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.Build * * Protobuf type {@code google.iam.v1.TestIamPermissionsRequest} */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder implements // @@protoc_insertion_point(builder_implements:google.iam.v1.TestIamPermissionsRequest) com.google.iam.v1.TestIamPermissionsRequestOrBuilder { @@ -390,7 +405,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.iam.v1.IamPolicyProto .internal_static_google_iam_v1_TestIamPermissionsRequest_fieldAccessorTable @@ -402,17 +417,16 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { // Construct using com.google.iam.v1.TestIamPermissionsRequest.newBuilder() private Builder() {} - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { super(parent); } @java.lang.Override public Builder clear() { super.clear(); + bitField0_ = 0; resource_ = ""; - - permissions_ = com.google.protobuf.LazyStringArrayList.EMPTY; - bitField0_ = (bitField0_ & ~0x00000001); + permissions_ = com.google.protobuf.LazyStringArrayList.emptyList(); return this; } @@ -440,48 +454,22 @@ public com.google.iam.v1.TestIamPermissionsRequest build() { public com.google.iam.v1.TestIamPermissionsRequest buildPartial() { com.google.iam.v1.TestIamPermissionsRequest result = new com.google.iam.v1.TestIamPermissionsRequest(this); - int from_bitField0_ = bitField0_; - result.resource_ = resource_; - if (((bitField0_ & 0x00000001) != 0)) { - permissions_ = permissions_.getUnmodifiableView(); - bitField0_ = (bitField0_ & ~0x00000001); + if (bitField0_ != 0) { + buildPartial0(result); } - result.permissions_ = permissions_; 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); + private void buildPartial0(com.google.iam.v1.TestIamPermissionsRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.resource_ = resource_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + permissions_.makeImmutable(); + result.permissions_ = permissions_; + } } @java.lang.Override @@ -498,12 +486,13 @@ public Builder mergeFrom(com.google.iam.v1.TestIamPermissionsRequest other) { if (other == com.google.iam.v1.TestIamPermissionsRequest.getDefaultInstance()) return this; if (!other.getResource().isEmpty()) { resource_ = other.resource_; + bitField0_ |= 0x00000001; onChanged(); } if (!other.permissions_.isEmpty()) { if (permissions_.isEmpty()) { permissions_ = other.permissions_; - bitField0_ = (bitField0_ & ~0x00000001); + bitField0_ |= 0x00000002; } else { ensurePermissionsIsMutable(); permissions_.addAll(other.permissions_); @@ -539,7 +528,7 @@ public Builder mergeFrom( case 10: { resource_ = input.readStringRequireUtf8(); - + bitField0_ |= 0x00000001; break; } // case 10 case 18: @@ -569,6 +558,7 @@ public Builder mergeFrom( private int bitField0_; private java.lang.Object resource_ = ""; + /** * * @@ -594,6 +584,7 @@ public java.lang.String getResource() { return (java.lang.String) ref; } } + /** * * @@ -619,6 +610,7 @@ public com.google.protobuf.ByteString getResourceBytes() { return (com.google.protobuf.ByteString) ref; } } + /** * * @@ -638,11 +630,12 @@ public Builder setResource(java.lang.String value) { if (value == null) { throw new NullPointerException(); } - resource_ = value; + bitField0_ |= 0x00000001; onChanged(); return this; } + /** * * @@ -658,11 +651,12 @@ public Builder setResource(java.lang.String value) { * @return This builder for chaining. */ public Builder clearResource() { - resource_ = getDefaultInstance().getResource(); + bitField0_ = (bitField0_ & ~0x00000001); onChanged(); return this; } + /** * * @@ -683,21 +677,22 @@ public Builder setResourceBytes(com.google.protobuf.ByteString value) { throw new NullPointerException(); } checkByteStringIsUtf8(value); - resource_ = value; + bitField0_ |= 0x00000001; onChanged(); return this; } - private com.google.protobuf.LazyStringList permissions_ = - com.google.protobuf.LazyStringArrayList.EMPTY; + private com.google.protobuf.LazyStringArrayList permissions_ = + com.google.protobuf.LazyStringArrayList.emptyList(); private void ensurePermissionsIsMutable() { - if (!((bitField0_ & 0x00000001) != 0)) { + if (!permissions_.isModifiable()) { permissions_ = new com.google.protobuf.LazyStringArrayList(permissions_); - bitField0_ |= 0x00000001; } + bitField0_ |= 0x00000002; } + /** * * @@ -713,8 +708,10 @@ private void ensurePermissionsIsMutable() { * @return A list containing the permissions. */ public com.google.protobuf.ProtocolStringList getPermissionsList() { - return permissions_.getUnmodifiableView(); + permissions_.makeImmutable(); + return permissions_; } + /** * * @@ -732,6 +729,7 @@ public com.google.protobuf.ProtocolStringList getPermissionsList() { public int getPermissionsCount() { return permissions_.size(); } + /** * * @@ -750,6 +748,7 @@ public int getPermissionsCount() { public java.lang.String getPermissions(int index) { return permissions_.get(index); } + /** * * @@ -768,6 +767,7 @@ public java.lang.String getPermissions(int index) { public com.google.protobuf.ByteString getPermissionsBytes(int index) { return permissions_.getByteString(index); } + /** * * @@ -790,9 +790,11 @@ public Builder setPermissions(int index, java.lang.String value) { } ensurePermissionsIsMutable(); permissions_.set(index, value); + bitField0_ |= 0x00000002; onChanged(); return this; } + /** * * @@ -814,9 +816,11 @@ public Builder addPermissions(java.lang.String value) { } ensurePermissionsIsMutable(); permissions_.add(value); + bitField0_ |= 0x00000002; onChanged(); return this; } + /** * * @@ -835,9 +839,11 @@ public Builder addPermissions(java.lang.String value) { public Builder addAllPermissions(java.lang.Iterable values) { ensurePermissionsIsMutable(); com.google.protobuf.AbstractMessageLite.Builder.addAll(values, permissions_); + bitField0_ |= 0x00000002; onChanged(); return this; } + /** * * @@ -853,11 +859,13 @@ public Builder addAllPermissions(java.lang.Iterable values) { * @return This builder for chaining. */ public Builder clearPermissions() { - permissions_ = com.google.protobuf.LazyStringArrayList.EMPTY; - bitField0_ = (bitField0_ & ~0x00000001); + permissions_ = com.google.protobuf.LazyStringArrayList.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + ; onChanged(); return this; } + /** * * @@ -880,21 +888,11 @@ public Builder addPermissionsBytes(com.google.protobuf.ByteString value) { checkByteStringIsUtf8(value); ensurePermissionsIsMutable(); permissions_.add(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.iam.v1.TestIamPermissionsRequest) } diff --git a/java-iam/proto-google-iam-v1/src/main/java/com/google/iam/v1/TestIamPermissionsRequestOrBuilder.java b/java-iam/proto-google-iam-v1/src/main/java/com/google/iam/v1/TestIamPermissionsRequestOrBuilder.java index 53b56f2781..c4a7d34fdb 100644 --- a/java-iam/proto-google-iam-v1/src/main/java/com/google/iam/v1/TestIamPermissionsRequestOrBuilder.java +++ b/java-iam/proto-google-iam-v1/src/main/java/com/google/iam/v1/TestIamPermissionsRequestOrBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,10 +14,13 @@ * limitations under the License. */ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: google/iam/v1/iam_policy.proto +// Protobuf Java Version: 4.33.2 package com.google.iam.v1; +@com.google.protobuf.Generated public interface TestIamPermissionsRequestOrBuilder extends // @@protoc_insertion_point(interface_extends:google.iam.v1.TestIamPermissionsRequest) @@ -38,6 +41,7 @@ public interface TestIamPermissionsRequestOrBuilder * @return The resource. */ java.lang.String getResource(); + /** * * @@ -69,6 +73,7 @@ public interface TestIamPermissionsRequestOrBuilder * @return A list containing the permissions. */ java.util.List getPermissionsList(); + /** * * @@ -84,6 +89,7 @@ public interface TestIamPermissionsRequestOrBuilder * @return The count of permissions. */ int getPermissionsCount(); + /** * * @@ -100,6 +106,7 @@ public interface TestIamPermissionsRequestOrBuilder * @return The permissions at the given index. */ java.lang.String getPermissions(int index); + /** * * diff --git a/java-iam/proto-google-iam-v1/src/main/java/com/google/iam/v1/TestIamPermissionsResponse.java b/java-iam/proto-google-iam-v1/src/main/java/com/google/iam/v1/TestIamPermissionsResponse.java index fbe4f1a3e7..afced79f37 100644 --- a/java-iam/proto-google-iam-v1/src/main/java/com/google/iam/v1/TestIamPermissionsResponse.java +++ b/java-iam/proto-google-iam-v1/src/main/java/com/google/iam/v1/TestIamPermissionsResponse.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,9 @@ * limitations under the License. */ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: google/iam/v1/iam_policy.proto +// Protobuf Java Version: 4.33.2 package com.google.iam.v1; @@ -27,29 +29,30 @@ * * Protobuf type {@code google.iam.v1.TestIamPermissionsResponse} */ -public final class TestIamPermissionsResponse extends com.google.protobuf.GeneratedMessageV3 +@com.google.protobuf.Generated +public final class TestIamPermissionsResponse extends com.google.protobuf.GeneratedMessage implements // @@protoc_insertion_point(message_implements:google.iam.v1.TestIamPermissionsResponse) TestIamPermissionsResponseOrBuilder { private static final long serialVersionUID = 0L; - // Use TestIamPermissionsResponse.newBuilder() to construct. - private TestIamPermissionsResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private TestIamPermissionsResponse() { - permissions_ = com.google.protobuf.LazyStringArrayList.EMPTY; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "TestIamPermissionsResponse"); } - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new TestIamPermissionsResponse(); + // Use TestIamPermissionsResponse.newBuilder() to construct. + private TestIamPermissionsResponse(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); } - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; + private TestIamPermissionsResponse() { + permissions_ = com.google.protobuf.LazyStringArrayList.emptyList(); } public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { @@ -58,7 +61,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.iam.v1.IamPolicyProto .internal_static_google_iam_v1_TestIamPermissionsResponse_fieldAccessorTable @@ -68,7 +71,11 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } public static final int PERMISSIONS_FIELD_NUMBER = 1; - private com.google.protobuf.LazyStringList permissions_; + + @SuppressWarnings("serial") + private com.google.protobuf.LazyStringArrayList permissions_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + /** * * @@ -84,6 +91,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { public com.google.protobuf.ProtocolStringList getPermissionsList() { return permissions_; } + /** * * @@ -99,6 +107,7 @@ public com.google.protobuf.ProtocolStringList getPermissionsList() { public int getPermissionsCount() { return permissions_.size(); } + /** * * @@ -115,6 +124,7 @@ public int getPermissionsCount() { public java.lang.String getPermissions(int index) { return permissions_.get(index); } + /** * * @@ -147,7 +157,7 @@ public final boolean isInitialized() { @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { for (int i = 0; i < permissions_.size(); i++) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, permissions_.getRaw(i)); + com.google.protobuf.GeneratedMessage.writeString(output, 1, permissions_.getRaw(i)); } getUnknownFields().writeTo(output); } @@ -240,38 +250,38 @@ public static com.google.iam.v1.TestIamPermissionsResponse parseFrom( public static com.google.iam.v1.TestIamPermissionsResponse parseFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); } public static com.google.iam.v1.TestIamPermissionsResponse parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } public static com.google.iam.v1.TestIamPermissionsResponse parseDelimitedFrom( java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); } public static com.google.iam.v1.TestIamPermissionsResponse parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( PARSER, input, extensionRegistry); } public static com.google.iam.v1.TestIamPermissionsResponse parseFrom( com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); } public static com.google.iam.v1.TestIamPermissionsResponse parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } @@ -294,10 +304,11 @@ public Builder toBuilder() { } @java.lang.Override - protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { Builder builder = new Builder(parent); return builder; } + /** * * @@ -307,7 +318,7 @@ protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.Build * * Protobuf type {@code google.iam.v1.TestIamPermissionsResponse} */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder implements // @@protoc_insertion_point(builder_implements:google.iam.v1.TestIamPermissionsResponse) com.google.iam.v1.TestIamPermissionsResponseOrBuilder { @@ -317,7 +328,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.iam.v1.IamPolicyProto .internal_static_google_iam_v1_TestIamPermissionsResponse_fieldAccessorTable @@ -329,15 +340,15 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { // Construct using com.google.iam.v1.TestIamPermissionsResponse.newBuilder() private Builder() {} - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { super(parent); } @java.lang.Override public Builder clear() { super.clear(); - permissions_ = com.google.protobuf.LazyStringArrayList.EMPTY; - bitField0_ = (bitField0_ & ~0x00000001); + bitField0_ = 0; + permissions_ = com.google.protobuf.LazyStringArrayList.emptyList(); return this; } @@ -365,47 +376,19 @@ public com.google.iam.v1.TestIamPermissionsResponse build() { public com.google.iam.v1.TestIamPermissionsResponse buildPartial() { com.google.iam.v1.TestIamPermissionsResponse result = new com.google.iam.v1.TestIamPermissionsResponse(this); - int from_bitField0_ = bitField0_; - if (((bitField0_ & 0x00000001) != 0)) { - permissions_ = permissions_.getUnmodifiableView(); - bitField0_ = (bitField0_ & ~0x00000001); + if (bitField0_ != 0) { + buildPartial0(result); } - result.permissions_ = permissions_; 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); + private void buildPartial0(com.google.iam.v1.TestIamPermissionsResponse result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + permissions_.makeImmutable(); + result.permissions_ = permissions_; + } } @java.lang.Override @@ -423,7 +406,7 @@ public Builder mergeFrom(com.google.iam.v1.TestIamPermissionsResponse other) { if (!other.permissions_.isEmpty()) { if (permissions_.isEmpty()) { permissions_ = other.permissions_; - bitField0_ = (bitField0_ & ~0x00000001); + bitField0_ |= 0x00000001; } else { ensurePermissionsIsMutable(); permissions_.addAll(other.permissions_); @@ -482,15 +465,16 @@ public Builder mergeFrom( private int bitField0_; - private com.google.protobuf.LazyStringList permissions_ = - com.google.protobuf.LazyStringArrayList.EMPTY; + private com.google.protobuf.LazyStringArrayList permissions_ = + com.google.protobuf.LazyStringArrayList.emptyList(); private void ensurePermissionsIsMutable() { - if (!((bitField0_ & 0x00000001) != 0)) { + if (!permissions_.isModifiable()) { permissions_ = new com.google.protobuf.LazyStringArrayList(permissions_); - bitField0_ |= 0x00000001; } + bitField0_ |= 0x00000001; } + /** * * @@ -504,8 +488,10 @@ private void ensurePermissionsIsMutable() { * @return A list containing the permissions. */ public com.google.protobuf.ProtocolStringList getPermissionsList() { - return permissions_.getUnmodifiableView(); + permissions_.makeImmutable(); + return permissions_; } + /** * * @@ -521,6 +507,7 @@ public com.google.protobuf.ProtocolStringList getPermissionsList() { public int getPermissionsCount() { return permissions_.size(); } + /** * * @@ -537,6 +524,7 @@ public int getPermissionsCount() { public java.lang.String getPermissions(int index) { return permissions_.get(index); } + /** * * @@ -553,6 +541,7 @@ public java.lang.String getPermissions(int index) { public com.google.protobuf.ByteString getPermissionsBytes(int index) { return permissions_.getByteString(index); } + /** * * @@ -573,9 +562,11 @@ public Builder setPermissions(int index, java.lang.String value) { } ensurePermissionsIsMutable(); permissions_.set(index, value); + bitField0_ |= 0x00000001; onChanged(); return this; } + /** * * @@ -595,9 +586,11 @@ public Builder addPermissions(java.lang.String value) { } ensurePermissionsIsMutable(); permissions_.add(value); + bitField0_ |= 0x00000001; onChanged(); return this; } + /** * * @@ -614,9 +607,11 @@ public Builder addPermissions(java.lang.String value) { public Builder addAllPermissions(java.lang.Iterable values) { ensurePermissionsIsMutable(); com.google.protobuf.AbstractMessageLite.Builder.addAll(values, permissions_); + bitField0_ |= 0x00000001; onChanged(); return this; } + /** * * @@ -630,11 +625,13 @@ public Builder addAllPermissions(java.lang.Iterable values) { * @return This builder for chaining. */ public Builder clearPermissions() { - permissions_ = com.google.protobuf.LazyStringArrayList.EMPTY; + permissions_ = com.google.protobuf.LazyStringArrayList.emptyList(); bitField0_ = (bitField0_ & ~0x00000001); + ; onChanged(); return this; } + /** * * @@ -655,21 +652,11 @@ public Builder addPermissionsBytes(com.google.protobuf.ByteString value) { checkByteStringIsUtf8(value); ensurePermissionsIsMutable(); permissions_.add(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.iam.v1.TestIamPermissionsResponse) } diff --git a/java-iam/proto-google-iam-v1/src/main/java/com/google/iam/v1/TestIamPermissionsResponseOrBuilder.java b/java-iam/proto-google-iam-v1/src/main/java/com/google/iam/v1/TestIamPermissionsResponseOrBuilder.java index da677cbe54..0d734608b4 100644 --- a/java-iam/proto-google-iam-v1/src/main/java/com/google/iam/v1/TestIamPermissionsResponseOrBuilder.java +++ b/java-iam/proto-google-iam-v1/src/main/java/com/google/iam/v1/TestIamPermissionsResponseOrBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,10 +14,13 @@ * limitations under the License. */ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: google/iam/v1/iam_policy.proto +// Protobuf Java Version: 4.33.2 package com.google.iam.v1; +@com.google.protobuf.Generated public interface TestIamPermissionsResponseOrBuilder extends // @@protoc_insertion_point(interface_extends:google.iam.v1.TestIamPermissionsResponse) @@ -36,6 +39,7 @@ public interface TestIamPermissionsResponseOrBuilder * @return A list containing the permissions. */ java.util.List getPermissionsList(); + /** * * @@ -49,6 +53,7 @@ public interface TestIamPermissionsResponseOrBuilder * @return The count of permissions. */ int getPermissionsCount(); + /** * * @@ -63,6 +68,7 @@ public interface TestIamPermissionsResponseOrBuilder * @return The permissions at the given index. */ java.lang.String getPermissions(int index); + /** * * diff --git a/java-iam/proto-google-iam-v1/src/main/java/com/google/iam/v1/logging/AuditData.java b/java-iam/proto-google-iam-v1/src/main/java/com/google/iam/v1/logging/AuditData.java index 268cbc4d2b..7648971de2 100644 --- a/java-iam/proto-google-iam-v1/src/main/java/com/google/iam/v1/logging/AuditData.java +++ b/java-iam/proto-google-iam-v1/src/main/java/com/google/iam/v1/logging/AuditData.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,9 @@ * limitations under the License. */ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: google/iam/v1/logging/audit_data.proto +// Protobuf Java Version: 4.33.2 package com.google.iam.v1.logging; @@ -29,80 +31,29 @@ * * Protobuf type {@code google.iam.v1.logging.AuditData} */ -public final class AuditData extends com.google.protobuf.GeneratedMessageV3 +@com.google.protobuf.Generated +public final class AuditData extends com.google.protobuf.GeneratedMessage implements // @@protoc_insertion_point(message_implements:google.iam.v1.logging.AuditData) AuditDataOrBuilder { private static final long serialVersionUID = 0L; - // Use AuditData.newBuilder() to construct. - private AuditData(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private AuditData() {} - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new AuditData(); + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "AuditData"); } - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; + // Use AuditData.newBuilder() to construct. + private AuditData(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); } - private AuditData( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 18: - { - com.google.iam.v1.PolicyDelta.Builder subBuilder = null; - if (policyDelta_ != null) { - subBuilder = policyDelta_.toBuilder(); - } - policyDelta_ = - input.readMessage(com.google.iam.v1.PolicyDelta.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(policyDelta_); - policyDelta_ = subBuilder.buildPartial(); - } - - break; - } - default: - { - if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } + private AuditData() {} public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.iam.v1.logging.AuditDataProto @@ -110,7 +61,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.iam.v1.logging.AuditDataProto .internal_static_google_iam_v1_logging_AuditData_fieldAccessorTable @@ -119,8 +70,10 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { com.google.iam.v1.logging.AuditData.Builder.class); } + private int bitField0_; public static final int POLICY_DELTA_FIELD_NUMBER = 2; private com.google.iam.v1.PolicyDelta policyDelta_; + /** * * @@ -134,8 +87,9 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { */ @java.lang.Override public boolean hasPolicyDelta() { - return policyDelta_ != null; + return ((bitField0_ & 0x00000001) != 0); } + /** * * @@ -151,6 +105,7 @@ public boolean hasPolicyDelta() { public com.google.iam.v1.PolicyDelta getPolicyDelta() { return policyDelta_ == null ? com.google.iam.v1.PolicyDelta.getDefaultInstance() : policyDelta_; } + /** * * @@ -162,7 +117,7 @@ public com.google.iam.v1.PolicyDelta getPolicyDelta() { */ @java.lang.Override public com.google.iam.v1.PolicyDeltaOrBuilder getPolicyDeltaOrBuilder() { - return getPolicyDelta(); + return policyDelta_ == null ? com.google.iam.v1.PolicyDelta.getDefaultInstance() : policyDelta_; } private byte memoizedIsInitialized = -1; @@ -179,10 +134,10 @@ public final boolean isInitialized() { @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (policyDelta_ != null) { + if (((bitField0_ & 0x00000001) != 0)) { output.writeMessage(2, getPolicyDelta()); } - unknownFields.writeTo(output); + getUnknownFields().writeTo(output); } @java.lang.Override @@ -191,10 +146,10 @@ public int getSerializedSize() { if (size != -1) return size; size = 0; - if (policyDelta_ != null) { + if (((bitField0_ & 0x00000001) != 0)) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getPolicyDelta()); } - size += unknownFields.getSerializedSize(); + size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; } @@ -213,7 +168,7 @@ public boolean equals(final java.lang.Object obj) { if (hasPolicyDelta()) { if (!getPolicyDelta().equals(other.getPolicyDelta())) return false; } - if (!unknownFields.equals(other.unknownFields)) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -228,7 +183,7 @@ public int hashCode() { hash = (37 * hash) + POLICY_DELTA_FIELD_NUMBER; hash = (53 * hash) + getPolicyDelta().hashCode(); } - hash = (29 * hash) + unknownFields.hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; } @@ -269,38 +224,38 @@ public static com.google.iam.v1.logging.AuditData parseFrom( public static com.google.iam.v1.logging.AuditData parseFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); } public static com.google.iam.v1.logging.AuditData parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } public static com.google.iam.v1.logging.AuditData parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); } public static com.google.iam.v1.logging.AuditData parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( PARSER, input, extensionRegistry); } public static com.google.iam.v1.logging.AuditData parseFrom( com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); } public static com.google.iam.v1.logging.AuditData parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } @@ -323,10 +278,11 @@ public Builder toBuilder() { } @java.lang.Override - protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { Builder builder = new Builder(parent); return builder; } + /** * * @@ -338,7 +294,7 @@ protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.Build * * Protobuf type {@code google.iam.v1.logging.AuditData} */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder implements // @@protoc_insertion_point(builder_implements:google.iam.v1.logging.AuditData) com.google.iam.v1.logging.AuditDataOrBuilder { @@ -348,7 +304,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.iam.v1.logging.AuditDataProto .internal_static_google_iam_v1_logging_AuditData_fieldAccessorTable @@ -362,22 +318,24 @@ private Builder() { maybeForceBuilderInitialization(); } - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { super(parent); maybeForceBuilderInitialization(); } private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetPolicyDeltaFieldBuilder(); + } } @java.lang.Override public Builder clear() { super.clear(); - if (policyDeltaBuilder_ == null) { - policyDelta_ = null; - } else { - policyDelta_ = null; + bitField0_ = 0; + policyDelta_ = null; + if (policyDeltaBuilder_ != null) { + policyDeltaBuilder_.dispose(); policyDeltaBuilder_ = null; } return this; @@ -406,46 +364,22 @@ public com.google.iam.v1.logging.AuditData build() { @java.lang.Override public com.google.iam.v1.logging.AuditData buildPartial() { com.google.iam.v1.logging.AuditData result = new com.google.iam.v1.logging.AuditData(this); - if (policyDeltaBuilder_ == null) { - result.policyDelta_ = policyDelta_; - } else { - result.policyDelta_ = policyDeltaBuilder_.build(); + if (bitField0_ != 0) { + buildPartial0(result); } 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); + private void buildPartial0(com.google.iam.v1.logging.AuditData result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.policyDelta_ = + policyDeltaBuilder_ == null ? policyDelta_ : policyDeltaBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + result.bitField0_ |= to_bitField0_; } @java.lang.Override @@ -463,7 +397,7 @@ public Builder mergeFrom(com.google.iam.v1.logging.AuditData other) { if (other.hasPolicyDelta()) { mergePolicyDelta(other.getPolicyDelta()); } - this.mergeUnknownFields(other.unknownFields); + this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; } @@ -478,26 +412,50 @@ public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - com.google.iam.v1.logging.AuditData parsedMessage = null; + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 18: + { + input.readMessage( + internalGetPolicyDeltaFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000001; + 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) { - parsedMessage = (com.google.iam.v1.logging.AuditData) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } + onChanged(); + } // finally return this; } + private int bitField0_; + private com.google.iam.v1.PolicyDelta policyDelta_; - private com.google.protobuf.SingleFieldBuilderV3< + private com.google.protobuf.SingleFieldBuilder< com.google.iam.v1.PolicyDelta, com.google.iam.v1.PolicyDelta.Builder, com.google.iam.v1.PolicyDeltaOrBuilder> policyDeltaBuilder_; + /** * * @@ -510,8 +468,9 @@ public Builder mergeFrom( * @return Whether the policyDelta field is set. */ public boolean hasPolicyDelta() { - return policyDeltaBuilder_ != null || policyDelta_ != null; + return ((bitField0_ & 0x00000001) != 0); } + /** * * @@ -532,6 +491,7 @@ public com.google.iam.v1.PolicyDelta getPolicyDelta() { return policyDeltaBuilder_.getMessage(); } } + /** * * @@ -547,13 +507,14 @@ public Builder setPolicyDelta(com.google.iam.v1.PolicyDelta value) { throw new NullPointerException(); } policyDelta_ = value; - onChanged(); } else { policyDeltaBuilder_.setMessage(value); } - + bitField0_ |= 0x00000001; + onChanged(); return this; } + /** * * @@ -566,13 +527,14 @@ public Builder setPolicyDelta(com.google.iam.v1.PolicyDelta value) { public Builder setPolicyDelta(com.google.iam.v1.PolicyDelta.Builder builderForValue) { if (policyDeltaBuilder_ == null) { policyDelta_ = builderForValue.build(); - onChanged(); } else { policyDeltaBuilder_.setMessage(builderForValue.build()); } - + bitField0_ |= 0x00000001; + onChanged(); return this; } + /** * * @@ -584,21 +546,23 @@ public Builder setPolicyDelta(com.google.iam.v1.PolicyDelta.Builder builderForVa */ public Builder mergePolicyDelta(com.google.iam.v1.PolicyDelta value) { if (policyDeltaBuilder_ == null) { - if (policyDelta_ != null) { - policyDelta_ = - com.google.iam.v1.PolicyDelta.newBuilder(policyDelta_) - .mergeFrom(value) - .buildPartial(); + if (((bitField0_ & 0x00000001) != 0) + && policyDelta_ != null + && policyDelta_ != com.google.iam.v1.PolicyDelta.getDefaultInstance()) { + getPolicyDeltaBuilder().mergeFrom(value); } else { policyDelta_ = value; } - onChanged(); } else { policyDeltaBuilder_.mergeFrom(value); } - + if (policyDelta_ != null) { + bitField0_ |= 0x00000001; + onChanged(); + } return this; } + /** * * @@ -609,16 +573,16 @@ public Builder mergePolicyDelta(com.google.iam.v1.PolicyDelta value) { * .google.iam.v1.PolicyDelta policy_delta = 2; */ public Builder clearPolicyDelta() { - if (policyDeltaBuilder_ == null) { - policyDelta_ = null; - onChanged(); - } else { - policyDelta_ = null; + bitField0_ = (bitField0_ & ~0x00000001); + policyDelta_ = null; + if (policyDeltaBuilder_ != null) { + policyDeltaBuilder_.dispose(); policyDeltaBuilder_ = null; } - + onChanged(); return this; } + /** * * @@ -629,10 +593,11 @@ public Builder clearPolicyDelta() { * .google.iam.v1.PolicyDelta policy_delta = 2; */ public com.google.iam.v1.PolicyDelta.Builder getPolicyDeltaBuilder() { - + bitField0_ |= 0x00000001; onChanged(); - return getPolicyDeltaFieldBuilder().getBuilder(); + return internalGetPolicyDeltaFieldBuilder().getBuilder(); } + /** * * @@ -651,6 +616,7 @@ public com.google.iam.v1.PolicyDeltaOrBuilder getPolicyDeltaOrBuilder() { : policyDelta_; } } + /** * * @@ -660,14 +626,14 @@ public com.google.iam.v1.PolicyDeltaOrBuilder getPolicyDeltaOrBuilder() { * * .google.iam.v1.PolicyDelta policy_delta = 2; */ - private com.google.protobuf.SingleFieldBuilderV3< + private com.google.protobuf.SingleFieldBuilder< com.google.iam.v1.PolicyDelta, com.google.iam.v1.PolicyDelta.Builder, com.google.iam.v1.PolicyDeltaOrBuilder> - getPolicyDeltaFieldBuilder() { + internalGetPolicyDeltaFieldBuilder() { if (policyDeltaBuilder_ == null) { policyDeltaBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< + new com.google.protobuf.SingleFieldBuilder< com.google.iam.v1.PolicyDelta, com.google.iam.v1.PolicyDelta.Builder, com.google.iam.v1.PolicyDeltaOrBuilder>( @@ -677,17 +643,6 @@ public com.google.iam.v1.PolicyDeltaOrBuilder getPolicyDeltaOrBuilder() { return policyDeltaBuilder_; } - @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.iam.v1.logging.AuditData) } @@ -709,7 +664,18 @@ public AuditData parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return new AuditData(input, extensionRegistry); + 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(); } }; diff --git a/java-iam/proto-google-iam-v1/src/main/java/com/google/iam/v1/logging/AuditDataOrBuilder.java b/java-iam/proto-google-iam-v1/src/main/java/com/google/iam/v1/logging/AuditDataOrBuilder.java index 8076902f48..8ee1e05805 100644 --- a/java-iam/proto-google-iam-v1/src/main/java/com/google/iam/v1/logging/AuditDataOrBuilder.java +++ b/java-iam/proto-google-iam-v1/src/main/java/com/google/iam/v1/logging/AuditDataOrBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,10 +14,13 @@ * limitations under the License. */ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: google/iam/v1/logging/audit_data.proto +// Protobuf Java Version: 4.33.2 package com.google.iam.v1.logging; +@com.google.protobuf.Generated public interface AuditDataOrBuilder extends // @@protoc_insertion_point(interface_extends:google.iam.v1.logging.AuditData) @@ -35,6 +38,7 @@ public interface AuditDataOrBuilder * @return Whether the policyDelta field is set. */ boolean hasPolicyDelta(); + /** * * @@ -47,6 +51,7 @@ public interface AuditDataOrBuilder * @return The policyDelta. */ com.google.iam.v1.PolicyDelta getPolicyDelta(); + /** * * diff --git a/java-iam/proto-google-iam-v1/src/main/java/com/google/iam/v1/logging/AuditDataProto.java b/java-iam/proto-google-iam-v1/src/main/java/com/google/iam/v1/logging/AuditDataProto.java index 7a5309a6ca..d7c930b55c 100644 --- a/java-iam/proto-google-iam-v1/src/main/java/com/google/iam/v1/logging/AuditDataProto.java +++ b/java-iam/proto-google-iam-v1/src/main/java/com/google/iam/v1/logging/AuditDataProto.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,13 +14,26 @@ * limitations under the License. */ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: google/iam/v1/logging/audit_data.proto +// Protobuf Java Version: 4.33.2 package com.google.iam.v1.logging; -public final class AuditDataProto { +@com.google.protobuf.Generated +public final class AuditDataProto extends com.google.protobuf.GeneratedFile { private AuditDataProto() {} + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "AuditDataProto"); + } + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistryLite registry) {} public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry registry) { @@ -29,7 +42,7 @@ public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry r static final com.google.protobuf.Descriptors.Descriptor internal_static_google_iam_v1_logging_AuditData_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable internal_static_google_iam_v1_logging_AuditData_fieldAccessorTable; public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { @@ -41,31 +54,28 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { static { java.lang.String[] descriptorData = { "\n&google/iam/v1/logging/audit_data.proto" - + "\022\025google.iam.v1.logging\032\034google/api/anno" - + "tations.proto\032\032google/iam/v1/policy.prot" - + "o\"=\n\tAuditData\0220\n\014policy_delta\030\002 \001(\0132\032.g" - + "oogle.iam.v1.PolicyDeltaB\211\001\n\031com.google." - + "iam.v1.loggingB\016AuditDataProtoP\001Zcom/google/iam/v2/*OrBuilder boolean has*(*) + + + + 7006 + com/google/iam/v2/** + * getDefaultInstanceForType() + ** + + + 7006 + com/google/iam/v2/** + * addRepeatedField(*) + ** + + + 7006 + com/google/iam/v2/** + * clear() + ** + + + 7006 + com/google/iam/v2/** + * clearField(*) + ** + + + 7006 + com/google/iam/v2/** + * clearOneof(*) + ** + + + 7006 + com/google/iam/v2/** + * clone() + ** + + + 7006 + com/google/iam/v2/** + * mergeUnknownFields(*) + ** + + + 7006 + com/google/iam/v2/** + * setField(*) + ** + + + 7006 + com/google/iam/v2/** + * setRepeatedField(*) + ** + + + 7006 + com/google/iam/v2/** + * setUnknownFields(*) + ** + diff --git a/java-iam/proto-google-iam-v2/pom.xml b/java-iam/proto-google-iam-v2/pom.xml index 6518950d01..087c125472 100644 --- a/java-iam/proto-google-iam-v2/pom.xml +++ b/java-iam/proto-google-iam-v2/pom.xml @@ -4,13 +4,13 @@ 4.0.0 com.google.api.grpc proto-google-iam-v2 - 1.6.23-SNAPSHOT + 1.62.1-SNAPSHOT proto-google-iam-v2 Proto library for proto-google-iam-v1 com.google.cloud google-iam-parent - 1.6.23-SNAPSHOT + 1.62.1-SNAPSHOT diff --git a/java-iam/proto-google-iam-v2/src/main/java/com/google/iam/v2/CreatePolicyRequest.java b/java-iam/proto-google-iam-v2/src/main/java/com/google/iam/v2/CreatePolicyRequest.java index 3566ce1abd..55f171f685 100644 --- a/java-iam/proto-google-iam-v2/src/main/java/com/google/iam/v2/CreatePolicyRequest.java +++ b/java-iam/proto-google-iam-v2/src/main/java/com/google/iam/v2/CreatePolicyRequest.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,9 @@ * limitations under the License. */ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: google/iam/v2/policy.proto +// Protobuf Java Version: 4.33.2 package com.google.iam.v2; @@ -27,13 +29,25 @@ * * Protobuf type {@code google.iam.v2.CreatePolicyRequest} */ -public final class CreatePolicyRequest extends com.google.protobuf.GeneratedMessageV3 +@com.google.protobuf.Generated +public final class CreatePolicyRequest extends com.google.protobuf.GeneratedMessage implements // @@protoc_insertion_point(message_implements:google.iam.v2.CreatePolicyRequest) CreatePolicyRequestOrBuilder { private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "CreatePolicyRequest"); + } + // Use CreatePolicyRequest.newBuilder() to construct. - private CreatePolicyRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + private CreatePolicyRequest(com.google.protobuf.GeneratedMessage.Builder builder) { super(builder); } @@ -42,24 +56,13 @@ private CreatePolicyRequest() { policyId_ = ""; } - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new CreatePolicyRequest(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.iam.v2.PolicyProto .internal_static_google_iam_v2_CreatePolicyRequest_descriptor; } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.iam.v2.PolicyProto .internal_static_google_iam_v2_CreatePolicyRequest_fieldAccessorTable @@ -68,18 +71,25 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { com.google.iam.v2.CreatePolicyRequest.Builder.class); } + private int bitField0_; public static final int PARENT_FIELD_NUMBER = 1; - private volatile java.lang.Object parent_; + + @SuppressWarnings("serial") + private volatile java.lang.Object parent_ = ""; + /** * * *
            * Required. The resource that the policy is attached to, along with the kind of policy
            * to create. Format: `policies/{attachment_point}/denypolicies`
        +   *
        +   *
            * The attachment point is identified by its URL-encoded full resource name,
            * which means that the forward-slash character, `/`, must be written as
            * `%2F`. For example,
            * `policies/cloudresourcemanager.googleapis.com%2Fprojects%2Fmy-project/denypolicies`.
        +   *
            * For organizations and folders, use the numeric ID in the full resource
            * name. For projects, you can use the alphanumeric or the numeric ID.
            * 
        @@ -100,16 +110,20 @@ public java.lang.String getParent() { return s; } } + /** * * *
            * Required. The resource that the policy is attached to, along with the kind of policy
            * to create. Format: `policies/{attachment_point}/denypolicies`
        +   *
        +   *
            * The attachment point is identified by its URL-encoded full resource name,
            * which means that the forward-slash character, `/`, must be written as
            * `%2F`. For example,
            * `policies/cloudresourcemanager.googleapis.com%2Fprojects%2Fmy-project/denypolicies`.
        +   *
            * For organizations and folders, use the numeric ID in the full resource
            * name. For projects, you can use the alphanumeric or the numeric ID.
            * 
        @@ -133,6 +147,7 @@ public com.google.protobuf.ByteString getParentBytes() { public static final int POLICY_FIELD_NUMBER = 2; private com.google.iam.v2.Policy policy_; + /** * * @@ -146,8 +161,9 @@ public com.google.protobuf.ByteString getParentBytes() { */ @java.lang.Override public boolean hasPolicy() { - return policy_ != null; + return ((bitField0_ & 0x00000001) != 0); } + /** * * @@ -163,6 +179,7 @@ public boolean hasPolicy() { public com.google.iam.v2.Policy getPolicy() { return policy_ == null ? com.google.iam.v2.Policy.getDefaultInstance() : policy_; } + /** * * @@ -174,11 +191,14 @@ public com.google.iam.v2.Policy getPolicy() { */ @java.lang.Override public com.google.iam.v2.PolicyOrBuilder getPolicyOrBuilder() { - return getPolicy(); + return policy_ == null ? com.google.iam.v2.Policy.getDefaultInstance() : policy_; } public static final int POLICY_ID_FIELD_NUMBER = 3; - private volatile java.lang.Object policyId_; + + @SuppressWarnings("serial") + private volatile java.lang.Object policyId_ = ""; + /** * * @@ -205,6 +225,7 @@ public java.lang.String getPolicyId() { return s; } } + /** * * @@ -246,14 +267,14 @@ public final boolean isInitialized() { @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.GeneratedMessage.isStringEmpty(parent_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, parent_); } - if (policy_ != null) { + if (((bitField0_ & 0x00000001) != 0)) { output.writeMessage(2, getPolicy()); } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(policyId_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 3, policyId_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(policyId_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 3, policyId_); } getUnknownFields().writeTo(output); } @@ -264,14 +285,14 @@ public int getSerializedSize() { 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.GeneratedMessage.isStringEmpty(parent_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, parent_); } - if (policy_ != null) { + if (((bitField0_ & 0x00000001) != 0)) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getPolicy()); } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(policyId_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, policyId_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(policyId_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(3, policyId_); } size += getUnknownFields().getSerializedSize(); memoizedSize = size; @@ -354,38 +375,38 @@ public static com.google.iam.v2.CreatePolicyRequest parseFrom( public static com.google.iam.v2.CreatePolicyRequest parseFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); } public static com.google.iam.v2.CreatePolicyRequest parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } public static com.google.iam.v2.CreatePolicyRequest parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); } public static com.google.iam.v2.CreatePolicyRequest parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( PARSER, input, extensionRegistry); } public static com.google.iam.v2.CreatePolicyRequest parseFrom( com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); } public static com.google.iam.v2.CreatePolicyRequest parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } @@ -408,10 +429,11 @@ public Builder toBuilder() { } @java.lang.Override - protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { Builder builder = new Builder(parent); return builder; } + /** * * @@ -421,7 +443,7 @@ protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.Build * * Protobuf type {@code google.iam.v2.CreatePolicyRequest} */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder implements // @@protoc_insertion_point(builder_implements:google.iam.v2.CreatePolicyRequest) com.google.iam.v2.CreatePolicyRequestOrBuilder { @@ -431,7 +453,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.iam.v2.PolicyProto .internal_static_google_iam_v2_CreatePolicyRequest_fieldAccessorTable @@ -441,25 +463,32 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } // Construct using com.google.iam.v2.CreatePolicyRequest.newBuilder() - private Builder() {} + private Builder() { + maybeForceBuilderInitialization(); + } - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetPolicyFieldBuilder(); + } } @java.lang.Override public Builder clear() { super.clear(); + bitField0_ = 0; parent_ = ""; - - if (policyBuilder_ == null) { - policy_ = null; - } else { - policy_ = null; + policy_ = null; + if (policyBuilder_ != null) { + policyBuilder_.dispose(); policyBuilder_ = null; } policyId_ = ""; - return this; } @@ -487,48 +516,27 @@ public com.google.iam.v2.CreatePolicyRequest build() { public com.google.iam.v2.CreatePolicyRequest buildPartial() { com.google.iam.v2.CreatePolicyRequest result = new com.google.iam.v2.CreatePolicyRequest(this); - result.parent_ = parent_; - if (policyBuilder_ == null) { - result.policy_ = policy_; - } else { - result.policy_ = policyBuilder_.build(); + if (bitField0_ != 0) { + buildPartial0(result); } - result.policyId_ = policyId_; 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); + private void buildPartial0(com.google.iam.v2.CreatePolicyRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.parent_ = parent_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.policy_ = policyBuilder_ == null ? policy_ : policyBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.policyId_ = policyId_; + } + result.bitField0_ |= to_bitField0_; } @java.lang.Override @@ -545,6 +553,7 @@ public Builder mergeFrom(com.google.iam.v2.CreatePolicyRequest other) { if (other == com.google.iam.v2.CreatePolicyRequest.getDefaultInstance()) return this; if (!other.getParent().isEmpty()) { parent_ = other.parent_; + bitField0_ |= 0x00000001; onChanged(); } if (other.hasPolicy()) { @@ -552,6 +561,7 @@ public Builder mergeFrom(com.google.iam.v2.CreatePolicyRequest other) { } if (!other.getPolicyId().isEmpty()) { policyId_ = other.policyId_; + bitField0_ |= 0x00000004; onChanged(); } this.mergeUnknownFields(other.getUnknownFields()); @@ -583,19 +593,19 @@ public Builder mergeFrom( case 10: { parent_ = input.readStringRequireUtf8(); - + bitField0_ |= 0x00000001; break; } // case 10 case 18: { - input.readMessage(getPolicyFieldBuilder().getBuilder(), extensionRegistry); - + input.readMessage(internalGetPolicyFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; break; } // case 18 case 26: { policyId_ = input.readStringRequireUtf8(); - + bitField0_ |= 0x00000004; break; } // case 26 default: @@ -615,17 +625,23 @@ public Builder mergeFrom( return this; } + private int bitField0_; + private java.lang.Object parent_ = ""; + /** * * *
              * Required. The resource that the policy is attached to, along with the kind of policy
              * to create. Format: `policies/{attachment_point}/denypolicies`
        +     *
        +     *
              * The attachment point is identified by its URL-encoded full resource name,
              * which means that the forward-slash character, `/`, must be written as
              * `%2F`. For example,
              * `policies/cloudresourcemanager.googleapis.com%2Fprojects%2Fmy-project/denypolicies`.
        +     *
              * For organizations and folders, use the numeric ID in the full resource
              * name. For projects, you can use the alphanumeric or the numeric ID.
              * 
        @@ -645,16 +661,20 @@ public java.lang.String getParent() { return (java.lang.String) ref; } } + /** * * *
              * Required. The resource that the policy is attached to, along with the kind of policy
              * to create. Format: `policies/{attachment_point}/denypolicies`
        +     *
        +     *
              * The attachment point is identified by its URL-encoded full resource name,
              * which means that the forward-slash character, `/`, must be written as
              * `%2F`. For example,
              * `policies/cloudresourcemanager.googleapis.com%2Fprojects%2Fmy-project/denypolicies`.
        +     *
              * For organizations and folders, use the numeric ID in the full resource
              * name. For projects, you can use the alphanumeric or the numeric ID.
              * 
        @@ -674,16 +694,20 @@ public com.google.protobuf.ByteString getParentBytes() { return (com.google.protobuf.ByteString) ref; } } + /** * * *
              * Required. The resource that the policy is attached to, along with the kind of policy
              * to create. Format: `policies/{attachment_point}/denypolicies`
        +     *
        +     *
              * The attachment point is identified by its URL-encoded full resource name,
              * which means that the forward-slash character, `/`, must be written as
              * `%2F`. For example,
              * `policies/cloudresourcemanager.googleapis.com%2Fprojects%2Fmy-project/denypolicies`.
        +     *
              * For organizations and folders, use the numeric ID in the full resource
              * name. For projects, you can use the alphanumeric or the numeric ID.
              * 
        @@ -697,21 +721,25 @@ public Builder setParent(java.lang.String value) { if (value == null) { throw new NullPointerException(); } - parent_ = value; + bitField0_ |= 0x00000001; onChanged(); return this; } + /** * * *
              * Required. The resource that the policy is attached to, along with the kind of policy
              * to create. Format: `policies/{attachment_point}/denypolicies`
        +     *
        +     *
              * The attachment point is identified by its URL-encoded full resource name,
              * which means that the forward-slash character, `/`, must be written as
              * `%2F`. For example,
              * `policies/cloudresourcemanager.googleapis.com%2Fprojects%2Fmy-project/denypolicies`.
        +     *
              * For organizations and folders, use the numeric ID in the full resource
              * name. For projects, you can use the alphanumeric or the numeric ID.
              * 
        @@ -721,21 +749,25 @@ public Builder setParent(java.lang.String value) { * @return This builder for chaining. */ public Builder clearParent() { - parent_ = getDefaultInstance().getParent(); + bitField0_ = (bitField0_ & ~0x00000001); onChanged(); return this; } + /** * * *
              * Required. The resource that the policy is attached to, along with the kind of policy
              * to create. Format: `policies/{attachment_point}/denypolicies`
        +     *
        +     *
              * The attachment point is identified by its URL-encoded full resource name,
              * which means that the forward-slash character, `/`, must be written as
              * `%2F`. For example,
              * `policies/cloudresourcemanager.googleapis.com%2Fprojects%2Fmy-project/denypolicies`.
        +     *
              * For organizations and folders, use the numeric ID in the full resource
              * name. For projects, you can use the alphanumeric or the numeric ID.
              * 
        @@ -750,18 +782,19 @@ public Builder setParentBytes(com.google.protobuf.ByteString value) { throw new NullPointerException(); } checkByteStringIsUtf8(value); - parent_ = value; + bitField0_ |= 0x00000001; onChanged(); return this; } private com.google.iam.v2.Policy policy_; - private com.google.protobuf.SingleFieldBuilderV3< + private com.google.protobuf.SingleFieldBuilder< com.google.iam.v2.Policy, com.google.iam.v2.Policy.Builder, com.google.iam.v2.PolicyOrBuilder> policyBuilder_; + /** * * @@ -774,8 +807,9 @@ public Builder setParentBytes(com.google.protobuf.ByteString value) { * @return Whether the policy field is set. */ public boolean hasPolicy() { - return policyBuilder_ != null || policy_ != null; + return ((bitField0_ & 0x00000002) != 0); } + /** * * @@ -794,6 +828,7 @@ public com.google.iam.v2.Policy getPolicy() { return policyBuilder_.getMessage(); } } + /** * * @@ -809,13 +844,14 @@ public Builder setPolicy(com.google.iam.v2.Policy value) { throw new NullPointerException(); } policy_ = value; - onChanged(); } else { policyBuilder_.setMessage(value); } - + bitField0_ |= 0x00000002; + onChanged(); return this; } + /** * * @@ -828,13 +864,14 @@ public Builder setPolicy(com.google.iam.v2.Policy value) { public Builder setPolicy(com.google.iam.v2.Policy.Builder builderForValue) { if (policyBuilder_ == null) { policy_ = builderForValue.build(); - onChanged(); } else { policyBuilder_.setMessage(builderForValue.build()); } - + bitField0_ |= 0x00000002; + onChanged(); return this; } + /** * * @@ -846,18 +883,23 @@ public Builder setPolicy(com.google.iam.v2.Policy.Builder builderForValue) { */ public Builder mergePolicy(com.google.iam.v2.Policy value) { if (policyBuilder_ == null) { - if (policy_ != null) { - policy_ = com.google.iam.v2.Policy.newBuilder(policy_).mergeFrom(value).buildPartial(); + if (((bitField0_ & 0x00000002) != 0) + && policy_ != null + && policy_ != com.google.iam.v2.Policy.getDefaultInstance()) { + getPolicyBuilder().mergeFrom(value); } else { policy_ = value; } - onChanged(); } else { policyBuilder_.mergeFrom(value); } - + if (policy_ != null) { + bitField0_ |= 0x00000002; + onChanged(); + } return this; } + /** * * @@ -868,16 +910,16 @@ public Builder mergePolicy(com.google.iam.v2.Policy value) { * .google.iam.v2.Policy policy = 2 [(.google.api.field_behavior) = REQUIRED]; */ public Builder clearPolicy() { - if (policyBuilder_ == null) { - policy_ = null; - onChanged(); - } else { - policy_ = null; + bitField0_ = (bitField0_ & ~0x00000002); + policy_ = null; + if (policyBuilder_ != null) { + policyBuilder_.dispose(); policyBuilder_ = null; } - + onChanged(); return this; } + /** * * @@ -888,10 +930,11 @@ public Builder clearPolicy() { * .google.iam.v2.Policy policy = 2 [(.google.api.field_behavior) = REQUIRED]; */ public com.google.iam.v2.Policy.Builder getPolicyBuilder() { - + bitField0_ |= 0x00000002; onChanged(); - return getPolicyFieldBuilder().getBuilder(); + return internalGetPolicyFieldBuilder().getBuilder(); } + /** * * @@ -908,6 +951,7 @@ public com.google.iam.v2.PolicyOrBuilder getPolicyOrBuilder() { return policy_ == null ? com.google.iam.v2.Policy.getDefaultInstance() : policy_; } } + /** * * @@ -917,14 +961,14 @@ public com.google.iam.v2.PolicyOrBuilder getPolicyOrBuilder() { * * .google.iam.v2.Policy policy = 2 [(.google.api.field_behavior) = REQUIRED]; */ - private com.google.protobuf.SingleFieldBuilderV3< + private com.google.protobuf.SingleFieldBuilder< com.google.iam.v2.Policy, com.google.iam.v2.Policy.Builder, com.google.iam.v2.PolicyOrBuilder> - getPolicyFieldBuilder() { + internalGetPolicyFieldBuilder() { if (policyBuilder_ == null) { policyBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< + new com.google.protobuf.SingleFieldBuilder< com.google.iam.v2.Policy, com.google.iam.v2.Policy.Builder, com.google.iam.v2.PolicyOrBuilder>(getPolicy(), getParentForChildren(), isClean()); @@ -934,6 +978,7 @@ public com.google.iam.v2.PolicyOrBuilder getPolicyOrBuilder() { } private java.lang.Object policyId_ = ""; + /** * * @@ -959,6 +1004,7 @@ public java.lang.String getPolicyId() { return (java.lang.String) ref; } } + /** * * @@ -984,6 +1030,7 @@ public com.google.protobuf.ByteString getPolicyIdBytes() { return (com.google.protobuf.ByteString) ref; } } + /** * * @@ -1003,11 +1050,12 @@ public Builder setPolicyId(java.lang.String value) { if (value == null) { throw new NullPointerException(); } - policyId_ = value; + bitField0_ |= 0x00000004; onChanged(); return this; } + /** * * @@ -1023,11 +1071,12 @@ public Builder setPolicyId(java.lang.String value) { * @return This builder for chaining. */ public Builder clearPolicyId() { - policyId_ = getDefaultInstance().getPolicyId(); + bitField0_ = (bitField0_ & ~0x00000004); onChanged(); return this; } + /** * * @@ -1048,23 +1097,12 @@ public Builder setPolicyIdBytes(com.google.protobuf.ByteString value) { throw new NullPointerException(); } checkByteStringIsUtf8(value); - policyId_ = 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.iam.v2.CreatePolicyRequest) } diff --git a/java-iam/proto-google-iam-v2/src/main/java/com/google/iam/v2/CreatePolicyRequestOrBuilder.java b/java-iam/proto-google-iam-v2/src/main/java/com/google/iam/v2/CreatePolicyRequestOrBuilder.java index 3825ae18ff..ddb052459e 100644 --- a/java-iam/proto-google-iam-v2/src/main/java/com/google/iam/v2/CreatePolicyRequestOrBuilder.java +++ b/java-iam/proto-google-iam-v2/src/main/java/com/google/iam/v2/CreatePolicyRequestOrBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,10 +14,13 @@ * limitations under the License. */ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: google/iam/v2/policy.proto +// Protobuf Java Version: 4.33.2 package com.google.iam.v2; +@com.google.protobuf.Generated public interface CreatePolicyRequestOrBuilder extends // @@protoc_insertion_point(interface_extends:google.iam.v2.CreatePolicyRequest) @@ -29,10 +32,13 @@ public interface CreatePolicyRequestOrBuilder *
            * Required. The resource that the policy is attached to, along with the kind of policy
            * to create. Format: `policies/{attachment_point}/denypolicies`
        +   *
        +   *
            * The attachment point is identified by its URL-encoded full resource name,
            * which means that the forward-slash character, `/`, must be written as
            * `%2F`. For example,
            * `policies/cloudresourcemanager.googleapis.com%2Fprojects%2Fmy-project/denypolicies`.
        +   *
            * For organizations and folders, use the numeric ID in the full resource
            * name. For projects, you can use the alphanumeric or the numeric ID.
            * 
        @@ -42,16 +48,20 @@ public interface CreatePolicyRequestOrBuilder * @return The parent. */ java.lang.String getParent(); + /** * * *
            * Required. The resource that the policy is attached to, along with the kind of policy
            * to create. Format: `policies/{attachment_point}/denypolicies`
        +   *
        +   *
            * The attachment point is identified by its URL-encoded full resource name,
            * which means that the forward-slash character, `/`, must be written as
            * `%2F`. For example,
            * `policies/cloudresourcemanager.googleapis.com%2Fprojects%2Fmy-project/denypolicies`.
        +   *
            * For organizations and folders, use the numeric ID in the full resource
            * name. For projects, you can use the alphanumeric or the numeric ID.
            * 
        @@ -74,6 +84,7 @@ public interface CreatePolicyRequestOrBuilder * @return Whether the policy field is set. */ boolean hasPolicy(); + /** * * @@ -86,6 +97,7 @@ public interface CreatePolicyRequestOrBuilder * @return The policy. */ com.google.iam.v2.Policy getPolicy(); + /** * * @@ -112,6 +124,7 @@ public interface CreatePolicyRequestOrBuilder * @return The policyId. */ java.lang.String getPolicyId(); + /** * * diff --git a/java-iam/proto-google-iam-v2/src/main/java/com/google/iam/v2/DeletePolicyRequest.java b/java-iam/proto-google-iam-v2/src/main/java/com/google/iam/v2/DeletePolicyRequest.java index 3900d3dc95..8facb44ff7 100644 --- a/java-iam/proto-google-iam-v2/src/main/java/com/google/iam/v2/DeletePolicyRequest.java +++ b/java-iam/proto-google-iam-v2/src/main/java/com/google/iam/v2/DeletePolicyRequest.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,9 @@ * limitations under the License. */ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: google/iam/v2/policy.proto +// Protobuf Java Version: 4.33.2 package com.google.iam.v2; @@ -27,13 +29,25 @@ * * Protobuf type {@code google.iam.v2.DeletePolicyRequest} */ -public final class DeletePolicyRequest extends com.google.protobuf.GeneratedMessageV3 +@com.google.protobuf.Generated +public final class DeletePolicyRequest extends com.google.protobuf.GeneratedMessage implements // @@protoc_insertion_point(message_implements:google.iam.v2.DeletePolicyRequest) DeletePolicyRequestOrBuilder { private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "DeletePolicyRequest"); + } + // Use DeletePolicyRequest.newBuilder() to construct. - private DeletePolicyRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + private DeletePolicyRequest(com.google.protobuf.GeneratedMessage.Builder builder) { super(builder); } @@ -42,24 +56,13 @@ private DeletePolicyRequest() { etag_ = ""; } - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new DeletePolicyRequest(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.iam.v2.PolicyProto .internal_static_google_iam_v2_DeletePolicyRequest_descriptor; } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.iam.v2.PolicyProto .internal_static_google_iam_v2_DeletePolicyRequest_fieldAccessorTable @@ -69,16 +72,22 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } public static final int NAME_FIELD_NUMBER = 1; - private volatile java.lang.Object name_; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** * * *
            * Required. The resource name of the policy to delete. Format:
            * `policies/{attachment_point}/denypolicies/{policy_id}`
        +   *
        +   *
            * Use the URL-encoded full resource name, which means that the forward-slash
            * character, `/`, must be written as `%2F`. For example,
            * `policies/cloudresourcemanager.googleapis.com%2Fprojects%2Fmy-project/denypolicies/my-policy`.
        +   *
            * For organizations and folders, use the numeric ID in the full resource
            * name. For projects, you can use the alphanumeric or the numeric ID.
            * 
        @@ -99,15 +108,19 @@ public java.lang.String getName() { return s; } } + /** * * *
            * Required. The resource name of the policy to delete. Format:
            * `policies/{attachment_point}/denypolicies/{policy_id}`
        +   *
        +   *
            * Use the URL-encoded full resource name, which means that the forward-slash
            * character, `/`, must be written as `%2F`. For example,
            * `policies/cloudresourcemanager.googleapis.com%2Fprojects%2Fmy-project/denypolicies/my-policy`.
        +   *
            * For organizations and folders, use the numeric ID in the full resource
            * name. For projects, you can use the alphanumeric or the numeric ID.
            * 
        @@ -130,7 +143,10 @@ public com.google.protobuf.ByteString getNameBytes() { } public static final int ETAG_FIELD_NUMBER = 2; - private volatile java.lang.Object etag_; + + @SuppressWarnings("serial") + private volatile java.lang.Object etag_ = ""; + /** * * @@ -138,6 +154,7 @@ public com.google.protobuf.ByteString getNameBytes() { * Optional. The expected `etag` of the policy to delete. If the value does not match * the value that is stored in IAM, the request fails with a `409` error code * and `ABORTED` status. + * * If you omit this field, the policy is deleted regardless of its current * `etag`. *
        @@ -158,6 +175,7 @@ public java.lang.String getEtag() { return s; } } + /** * * @@ -165,6 +183,7 @@ public java.lang.String getEtag() { * Optional. The expected `etag` of the policy to delete. If the value does not match * the value that is stored in IAM, the request fails with a `409` error code * and `ABORTED` status. + * * If you omit this field, the policy is deleted regardless of its current * `etag`. *
        @@ -200,11 +219,11 @@ public final boolean isInitialized() { @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.GeneratedMessage.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, name_); } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(etag_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 2, etag_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(etag_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, etag_); } getUnknownFields().writeTo(output); } @@ -215,11 +234,11 @@ public int getSerializedSize() { 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.GeneratedMessage.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, name_); } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(etag_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, etag_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(etag_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, etag_); } size += getUnknownFields().getSerializedSize(); memoizedSize = size; @@ -294,38 +313,38 @@ public static com.google.iam.v2.DeletePolicyRequest parseFrom( public static com.google.iam.v2.DeletePolicyRequest parseFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); } public static com.google.iam.v2.DeletePolicyRequest parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } public static com.google.iam.v2.DeletePolicyRequest parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); } public static com.google.iam.v2.DeletePolicyRequest parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( PARSER, input, extensionRegistry); } public static com.google.iam.v2.DeletePolicyRequest parseFrom( com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); } public static com.google.iam.v2.DeletePolicyRequest parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } @@ -348,10 +367,11 @@ public Builder toBuilder() { } @java.lang.Override - protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { Builder builder = new Builder(parent); return builder; } + /** * * @@ -361,7 +381,7 @@ protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.Build * * Protobuf type {@code google.iam.v2.DeletePolicyRequest} */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder implements // @@protoc_insertion_point(builder_implements:google.iam.v2.DeletePolicyRequest) com.google.iam.v2.DeletePolicyRequestOrBuilder { @@ -371,7 +391,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.iam.v2.PolicyProto .internal_static_google_iam_v2_DeletePolicyRequest_fieldAccessorTable @@ -383,17 +403,16 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { // Construct using com.google.iam.v2.DeletePolicyRequest.newBuilder() private Builder() {} - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { super(parent); } @java.lang.Override public Builder clear() { super.clear(); + bitField0_ = 0; name_ = ""; - etag_ = ""; - return this; } @@ -421,43 +440,21 @@ public com.google.iam.v2.DeletePolicyRequest build() { public com.google.iam.v2.DeletePolicyRequest buildPartial() { com.google.iam.v2.DeletePolicyRequest result = new com.google.iam.v2.DeletePolicyRequest(this); - result.name_ = name_; - result.etag_ = etag_; + if (bitField0_ != 0) { + buildPartial0(result); + } 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); + private void buildPartial0(com.google.iam.v2.DeletePolicyRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.etag_ = etag_; + } } @java.lang.Override @@ -474,10 +471,12 @@ public Builder mergeFrom(com.google.iam.v2.DeletePolicyRequest other) { if (other == com.google.iam.v2.DeletePolicyRequest.getDefaultInstance()) return this; if (!other.getName().isEmpty()) { name_ = other.name_; + bitField0_ |= 0x00000001; onChanged(); } if (!other.getEtag().isEmpty()) { etag_ = other.etag_; + bitField0_ |= 0x00000002; onChanged(); } this.mergeUnknownFields(other.getUnknownFields()); @@ -509,13 +508,13 @@ public Builder mergeFrom( case 10: { name_ = input.readStringRequireUtf8(); - + bitField0_ |= 0x00000001; break; } // case 10 case 18: { etag_ = input.readStringRequireUtf8(); - + bitField0_ |= 0x00000002; break; } // case 18 default: @@ -535,16 +534,22 @@ public Builder mergeFrom( return this; } + private int bitField0_; + private java.lang.Object name_ = ""; + /** * * *
              * Required. The resource name of the policy to delete. Format:
              * `policies/{attachment_point}/denypolicies/{policy_id}`
        +     *
        +     *
              * Use the URL-encoded full resource name, which means that the forward-slash
              * character, `/`, must be written as `%2F`. For example,
              * `policies/cloudresourcemanager.googleapis.com%2Fprojects%2Fmy-project/denypolicies/my-policy`.
        +     *
              * For organizations and folders, use the numeric ID in the full resource
              * name. For projects, you can use the alphanumeric or the numeric ID.
              * 
        @@ -564,15 +569,19 @@ public java.lang.String getName() { return (java.lang.String) ref; } } + /** * * *
              * Required. The resource name of the policy to delete. Format:
              * `policies/{attachment_point}/denypolicies/{policy_id}`
        +     *
        +     *
              * Use the URL-encoded full resource name, which means that the forward-slash
              * character, `/`, must be written as `%2F`. For example,
              * `policies/cloudresourcemanager.googleapis.com%2Fprojects%2Fmy-project/denypolicies/my-policy`.
        +     *
              * For organizations and folders, use the numeric ID in the full resource
              * name. For projects, you can use the alphanumeric or the numeric ID.
              * 
        @@ -592,15 +601,19 @@ public com.google.protobuf.ByteString getNameBytes() { return (com.google.protobuf.ByteString) ref; } } + /** * * *
              * Required. The resource name of the policy to delete. Format:
              * `policies/{attachment_point}/denypolicies/{policy_id}`
        +     *
        +     *
              * Use the URL-encoded full resource name, which means that the forward-slash
              * character, `/`, must be written as `%2F`. For example,
              * `policies/cloudresourcemanager.googleapis.com%2Fprojects%2Fmy-project/denypolicies/my-policy`.
        +     *
              * For organizations and folders, use the numeric ID in the full resource
              * name. For projects, you can use the alphanumeric or the numeric ID.
              * 
        @@ -614,20 +627,24 @@ 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 to delete. Format:
              * `policies/{attachment_point}/denypolicies/{policy_id}`
        +     *
        +     *
              * Use the URL-encoded full resource name, which means that the forward-slash
              * character, `/`, must be written as `%2F`. For example,
              * `policies/cloudresourcemanager.googleapis.com%2Fprojects%2Fmy-project/denypolicies/my-policy`.
        +     *
              * For organizations and folders, use the numeric ID in the full resource
              * name. For projects, you can use the alphanumeric or the numeric ID.
              * 
        @@ -637,20 +654,24 @@ public Builder setName(java.lang.String value) { * @return This builder for chaining. */ public Builder clearName() { - name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); onChanged(); return this; } + /** * * *
              * Required. The resource name of the policy to delete. Format:
              * `policies/{attachment_point}/denypolicies/{policy_id}`
        +     *
        +     *
              * Use the URL-encoded full resource name, which means that the forward-slash
              * character, `/`, must be written as `%2F`. For example,
              * `policies/cloudresourcemanager.googleapis.com%2Fprojects%2Fmy-project/denypolicies/my-policy`.
        +     *
              * For organizations and folders, use the numeric ID in the full resource
              * name. For projects, you can use the alphanumeric or the numeric ID.
              * 
        @@ -665,13 +686,14 @@ public Builder setNameBytes(com.google.protobuf.ByteString value) { throw new NullPointerException(); } checkByteStringIsUtf8(value); - name_ = value; + bitField0_ |= 0x00000001; onChanged(); return this; } private java.lang.Object etag_ = ""; + /** * * @@ -679,6 +701,7 @@ public Builder setNameBytes(com.google.protobuf.ByteString value) { * Optional. The expected `etag` of the policy to delete. If the value does not match * the value that is stored in IAM, the request fails with a `409` error code * and `ABORTED` status. + * * If you omit this field, the policy is deleted regardless of its current * `etag`. *
        @@ -698,6 +721,7 @@ public java.lang.String getEtag() { return (java.lang.String) ref; } } + /** * * @@ -705,6 +729,7 @@ public java.lang.String getEtag() { * Optional. The expected `etag` of the policy to delete. If the value does not match * the value that is stored in IAM, the request fails with a `409` error code * and `ABORTED` status. + * * If you omit this field, the policy is deleted regardless of its current * `etag`. *
        @@ -724,6 +749,7 @@ public com.google.protobuf.ByteString getEtagBytes() { return (com.google.protobuf.ByteString) ref; } } + /** * * @@ -731,6 +757,7 @@ public com.google.protobuf.ByteString getEtagBytes() { * Optional. The expected `etag` of the policy to delete. If the value does not match * the value that is stored in IAM, the request fails with a `409` error code * and `ABORTED` status. + * * If you omit this field, the policy is deleted regardless of its current * `etag`. *
        @@ -744,11 +771,12 @@ public Builder setEtag(java.lang.String value) { if (value == null) { throw new NullPointerException(); } - etag_ = value; + bitField0_ |= 0x00000002; onChanged(); return this; } + /** * * @@ -756,6 +784,7 @@ public Builder setEtag(java.lang.String value) { * Optional. The expected `etag` of the policy to delete. If the value does not match * the value that is stored in IAM, the request fails with a `409` error code * and `ABORTED` status. + * * If you omit this field, the policy is deleted regardless of its current * `etag`. *
        @@ -765,11 +794,12 @@ public Builder setEtag(java.lang.String value) { * @return This builder for chaining. */ public Builder clearEtag() { - etag_ = getDefaultInstance().getEtag(); + bitField0_ = (bitField0_ & ~0x00000002); onChanged(); return this; } + /** * * @@ -777,6 +807,7 @@ public Builder clearEtag() { * Optional. The expected `etag` of the policy to delete. If the value does not match * the value that is stored in IAM, the request fails with a `409` error code * and `ABORTED` status. + * * If you omit this field, the policy is deleted regardless of its current * `etag`. * @@ -791,23 +822,12 @@ public Builder setEtagBytes(com.google.protobuf.ByteString value) { throw new NullPointerException(); } checkByteStringIsUtf8(value); - etag_ = 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.iam.v2.DeletePolicyRequest) } diff --git a/java-iam/proto-google-iam-v2/src/main/java/com/google/iam/v2/DeletePolicyRequestOrBuilder.java b/java-iam/proto-google-iam-v2/src/main/java/com/google/iam/v2/DeletePolicyRequestOrBuilder.java index 9bdd7fc3d3..1e845fe6d0 100644 --- a/java-iam/proto-google-iam-v2/src/main/java/com/google/iam/v2/DeletePolicyRequestOrBuilder.java +++ b/java-iam/proto-google-iam-v2/src/main/java/com/google/iam/v2/DeletePolicyRequestOrBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,10 +14,13 @@ * limitations under the License. */ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: google/iam/v2/policy.proto +// Protobuf Java Version: 4.33.2 package com.google.iam.v2; +@com.google.protobuf.Generated public interface DeletePolicyRequestOrBuilder extends // @@protoc_insertion_point(interface_extends:google.iam.v2.DeletePolicyRequest) @@ -29,9 +32,12 @@ public interface DeletePolicyRequestOrBuilder *
            * Required. The resource name of the policy to delete. Format:
            * `policies/{attachment_point}/denypolicies/{policy_id}`
        +   *
        +   *
            * Use the URL-encoded full resource name, which means that the forward-slash
            * character, `/`, must be written as `%2F`. For example,
            * `policies/cloudresourcemanager.googleapis.com%2Fprojects%2Fmy-project/denypolicies/my-policy`.
        +   *
            * For organizations and folders, use the numeric ID in the full resource
            * name. For projects, you can use the alphanumeric or the numeric ID.
            * 
        @@ -41,15 +47,19 @@ public interface DeletePolicyRequestOrBuilder * @return The name. */ java.lang.String getName(); + /** * * *
            * Required. The resource name of the policy to delete. Format:
            * `policies/{attachment_point}/denypolicies/{policy_id}`
        +   *
        +   *
            * Use the URL-encoded full resource name, which means that the forward-slash
            * character, `/`, must be written as `%2F`. For example,
            * `policies/cloudresourcemanager.googleapis.com%2Fprojects%2Fmy-project/denypolicies/my-policy`.
        +   *
            * For organizations and folders, use the numeric ID in the full resource
            * name. For projects, you can use the alphanumeric or the numeric ID.
            * 
        @@ -67,6 +77,7 @@ public interface DeletePolicyRequestOrBuilder * Optional. The expected `etag` of the policy to delete. If the value does not match * the value that is stored in IAM, the request fails with a `409` error code * and `ABORTED` status. + * * If you omit this field, the policy is deleted regardless of its current * `etag`. * @@ -76,6 +87,7 @@ public interface DeletePolicyRequestOrBuilder * @return The etag. */ java.lang.String getEtag(); + /** * * @@ -83,6 +95,7 @@ public interface DeletePolicyRequestOrBuilder * Optional. The expected `etag` of the policy to delete. If the value does not match * the value that is stored in IAM, the request fails with a `409` error code * and `ABORTED` status. + * * If you omit this field, the policy is deleted regardless of its current * `etag`. * diff --git a/java-iam/proto-google-iam-v2/src/main/java/com/google/iam/v2/DenyRule.java b/java-iam/proto-google-iam-v2/src/main/java/com/google/iam/v2/DenyRule.java index f3bc03f599..329617f312 100644 --- a/java-iam/proto-google-iam-v2/src/main/java/com/google/iam/v2/DenyRule.java +++ b/java-iam/proto-google-iam-v2/src/main/java/com/google/iam/v2/DenyRule.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,9 @@ * limitations under the License. */ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: google/iam/v2/deny.proto +// Protobuf Java Version: 4.33.2 package com.google.iam.v2; @@ -27,32 +29,33 @@ * * Protobuf type {@code google.iam.v2.DenyRule} */ -public final class DenyRule extends com.google.protobuf.GeneratedMessageV3 +@com.google.protobuf.Generated +public final class DenyRule extends com.google.protobuf.GeneratedMessage implements // @@protoc_insertion_point(message_implements:google.iam.v2.DenyRule) DenyRuleOrBuilder { private static final long serialVersionUID = 0L; - // Use DenyRule.newBuilder() to construct. - private DenyRule(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private DenyRule() { - deniedPrincipals_ = com.google.protobuf.LazyStringArrayList.EMPTY; - exceptionPrincipals_ = com.google.protobuf.LazyStringArrayList.EMPTY; - deniedPermissions_ = com.google.protobuf.LazyStringArrayList.EMPTY; - exceptionPermissions_ = com.google.protobuf.LazyStringArrayList.EMPTY; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "DenyRule"); } - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new DenyRule(); + // Use DenyRule.newBuilder() to construct. + private DenyRule(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); } - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; + private DenyRule() { + deniedPrincipals_ = com.google.protobuf.LazyStringArrayList.emptyList(); + exceptionPrincipals_ = com.google.protobuf.LazyStringArrayList.emptyList(); + deniedPermissions_ = com.google.protobuf.LazyStringArrayList.emptyList(); + exceptionPermissions_ = com.google.protobuf.LazyStringArrayList.emptyList(); } public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { @@ -60,51 +63,64 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.iam.v2.DenyRuleProto.internal_static_google_iam_v2_DenyRule_fieldAccessorTable .ensureFieldAccessorsInitialized( com.google.iam.v2.DenyRule.class, com.google.iam.v2.DenyRule.Builder.class); } + private int bitField0_; public static final int DENIED_PRINCIPALS_FIELD_NUMBER = 1; - private com.google.protobuf.LazyStringList deniedPrincipals_; + + @SuppressWarnings("serial") + private com.google.protobuf.LazyStringArrayList deniedPrincipals_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + /** * * *
            * The identities that are prevented from using one or more permissions on
            * Google Cloud resources. This field can contain the following values:
        +   *
            * * `principalSet://goog/public:all`: A special identifier that represents
        -   *   any principal that is on the internet, even if they do not have a Google
        -   *   Account or are not logged in.
        +   * any principal that is on the internet, even if they do not have a Google
        +   * Account or are not logged in.
        +   *
            * * `principal://goog/subject/{email_id}`: A specific Google Account.
        -   *   Includes Gmail, Cloud Identity, and Google Workspace user accounts. For
        -   *   example, `principal://goog/subject/alice@example.com`.
        +   * Includes Gmail, Cloud Identity, and Google Workspace user accounts. For
        +   * example, `principal://goog/subject/alice@example.com`.
        +   *
            * * `deleted:principal://goog/subject/{email_id}?uid={uid}`: A specific
        -   *   Google Account that was deleted recently. For example,
        -   *   `deleted:principal://goog/subject/alice@example.com?uid=1234567890`. If
        -   *   the Google Account is recovered, this identifier reverts to the standard
        -   *   identifier for a Google Account.
        +   * Google Account that was deleted recently. For example,
        +   * `deleted:principal://goog/subject/alice@example.com?uid=1234567890`. If
        +   * the Google Account is recovered, this identifier reverts to the standard
        +   * identifier for a Google Account.
        +   *
            * * `principalSet://goog/group/{group_id}`: A Google group. For example,
        -   *   `principalSet://goog/group/admins@example.com`.
        +   * `principalSet://goog/group/admins@example.com`.
        +   *
            * * `deleted:principalSet://goog/group/{group_id}?uid={uid}`: A Google group
        -   *   that was deleted recently. For example,
        -   *   `deleted:principalSet://goog/group/admins@example.com?uid=1234567890`. If
        -   *   the Google group is restored, this identifier reverts to the standard
        -   *   identifier for a Google group.
        +   * that was deleted recently. For example,
        +   * `deleted:principalSet://goog/group/admins@example.com?uid=1234567890`. If
        +   * the Google group is restored, this identifier reverts to the standard
        +   * identifier for a Google group.
        +   *
            * * `principal://iam.googleapis.com/projects/-/serviceAccounts/{service_account_id}`:
        -   *   A Google Cloud service account. For example,
        -   *   `principal://iam.googleapis.com/projects/-/serviceAccounts/my-service-account@iam.gserviceaccount.com`.
        +   * A Google Cloud service account. For example,
        +   * `principal://iam.googleapis.com/projects/-/serviceAccounts/my-service-account@iam.gserviceaccount.com`.
        +   *
            * * `deleted:principal://iam.googleapis.com/projects/-/serviceAccounts/{service_account_id}?uid={uid}`:
        -   *   A Google Cloud service account that was deleted recently. For example,
        -   *   `deleted:principal://iam.googleapis.com/projects/-/serviceAccounts/my-service-account@iam.gserviceaccount.com?uid=1234567890`.
        -   *   If the service account is undeleted, this identifier reverts to the
        -   *   standard identifier for a service account.
        +   * A Google Cloud service account that was deleted recently. For example,
        +   * `deleted:principal://iam.googleapis.com/projects/-/serviceAccounts/my-service-account@iam.gserviceaccount.com?uid=1234567890`.
        +   * If the service account is undeleted, this identifier reverts to the
        +   * standard identifier for a service account.
        +   *
            * * `principalSet://goog/cloudIdentityCustomerId/{customer_id}`: All of the
        -   *   principals associated with the specified Google Workspace or Cloud
        -   *   Identity customer ID. For example,
        -   *   `principalSet://goog/cloudIdentityCustomerId/C01Abc35`.
        +   * principals associated with the specified Google Workspace or Cloud
        +   * Identity customer ID. For example,
        +   * `principalSet://goog/cloudIdentityCustomerId/C01Abc35`.
            * 
        * * repeated string denied_principals = 1; @@ -114,42 +130,51 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { public com.google.protobuf.ProtocolStringList getDeniedPrincipalsList() { return deniedPrincipals_; } + /** * * *
            * The identities that are prevented from using one or more permissions on
            * Google Cloud resources. This field can contain the following values:
        +   *
            * * `principalSet://goog/public:all`: A special identifier that represents
        -   *   any principal that is on the internet, even if they do not have a Google
        -   *   Account or are not logged in.
        +   * any principal that is on the internet, even if they do not have a Google
        +   * Account or are not logged in.
        +   *
            * * `principal://goog/subject/{email_id}`: A specific Google Account.
        -   *   Includes Gmail, Cloud Identity, and Google Workspace user accounts. For
        -   *   example, `principal://goog/subject/alice@example.com`.
        +   * Includes Gmail, Cloud Identity, and Google Workspace user accounts. For
        +   * example, `principal://goog/subject/alice@example.com`.
        +   *
            * * `deleted:principal://goog/subject/{email_id}?uid={uid}`: A specific
        -   *   Google Account that was deleted recently. For example,
        -   *   `deleted:principal://goog/subject/alice@example.com?uid=1234567890`. If
        -   *   the Google Account is recovered, this identifier reverts to the standard
        -   *   identifier for a Google Account.
        +   * Google Account that was deleted recently. For example,
        +   * `deleted:principal://goog/subject/alice@example.com?uid=1234567890`. If
        +   * the Google Account is recovered, this identifier reverts to the standard
        +   * identifier for a Google Account.
        +   *
            * * `principalSet://goog/group/{group_id}`: A Google group. For example,
        -   *   `principalSet://goog/group/admins@example.com`.
        +   * `principalSet://goog/group/admins@example.com`.
        +   *
            * * `deleted:principalSet://goog/group/{group_id}?uid={uid}`: A Google group
        -   *   that was deleted recently. For example,
        -   *   `deleted:principalSet://goog/group/admins@example.com?uid=1234567890`. If
        -   *   the Google group is restored, this identifier reverts to the standard
        -   *   identifier for a Google group.
        +   * that was deleted recently. For example,
        +   * `deleted:principalSet://goog/group/admins@example.com?uid=1234567890`. If
        +   * the Google group is restored, this identifier reverts to the standard
        +   * identifier for a Google group.
        +   *
            * * `principal://iam.googleapis.com/projects/-/serviceAccounts/{service_account_id}`:
        -   *   A Google Cloud service account. For example,
        -   *   `principal://iam.googleapis.com/projects/-/serviceAccounts/my-service-account@iam.gserviceaccount.com`.
        +   * A Google Cloud service account. For example,
        +   * `principal://iam.googleapis.com/projects/-/serviceAccounts/my-service-account@iam.gserviceaccount.com`.
        +   *
            * * `deleted:principal://iam.googleapis.com/projects/-/serviceAccounts/{service_account_id}?uid={uid}`:
        -   *   A Google Cloud service account that was deleted recently. For example,
        -   *   `deleted:principal://iam.googleapis.com/projects/-/serviceAccounts/my-service-account@iam.gserviceaccount.com?uid=1234567890`.
        -   *   If the service account is undeleted, this identifier reverts to the
        -   *   standard identifier for a service account.
        +   * A Google Cloud service account that was deleted recently. For example,
        +   * `deleted:principal://iam.googleapis.com/projects/-/serviceAccounts/my-service-account@iam.gserviceaccount.com?uid=1234567890`.
        +   * If the service account is undeleted, this identifier reverts to the
        +   * standard identifier for a service account.
        +   *
            * * `principalSet://goog/cloudIdentityCustomerId/{customer_id}`: All of the
        -   *   principals associated with the specified Google Workspace or Cloud
        -   *   Identity customer ID. For example,
        -   *   `principalSet://goog/cloudIdentityCustomerId/C01Abc35`.
        +   * principals associated with the specified Google Workspace or Cloud
        +   * Identity customer ID. For example,
        +   * `principalSet://goog/cloudIdentityCustomerId/C01Abc35`.
            * 
        * * repeated string denied_principals = 1; @@ -159,42 +184,51 @@ public com.google.protobuf.ProtocolStringList getDeniedPrincipalsList() { public int getDeniedPrincipalsCount() { return deniedPrincipals_.size(); } + /** * * *
            * The identities that are prevented from using one or more permissions on
            * Google Cloud resources. This field can contain the following values:
        +   *
            * * `principalSet://goog/public:all`: A special identifier that represents
        -   *   any principal that is on the internet, even if they do not have a Google
        -   *   Account or are not logged in.
        +   * any principal that is on the internet, even if they do not have a Google
        +   * Account or are not logged in.
        +   *
            * * `principal://goog/subject/{email_id}`: A specific Google Account.
        -   *   Includes Gmail, Cloud Identity, and Google Workspace user accounts. For
        -   *   example, `principal://goog/subject/alice@example.com`.
        +   * Includes Gmail, Cloud Identity, and Google Workspace user accounts. For
        +   * example, `principal://goog/subject/alice@example.com`.
        +   *
            * * `deleted:principal://goog/subject/{email_id}?uid={uid}`: A specific
        -   *   Google Account that was deleted recently. For example,
        -   *   `deleted:principal://goog/subject/alice@example.com?uid=1234567890`. If
        -   *   the Google Account is recovered, this identifier reverts to the standard
        -   *   identifier for a Google Account.
        +   * Google Account that was deleted recently. For example,
        +   * `deleted:principal://goog/subject/alice@example.com?uid=1234567890`. If
        +   * the Google Account is recovered, this identifier reverts to the standard
        +   * identifier for a Google Account.
        +   *
            * * `principalSet://goog/group/{group_id}`: A Google group. For example,
        -   *   `principalSet://goog/group/admins@example.com`.
        +   * `principalSet://goog/group/admins@example.com`.
        +   *
            * * `deleted:principalSet://goog/group/{group_id}?uid={uid}`: A Google group
        -   *   that was deleted recently. For example,
        -   *   `deleted:principalSet://goog/group/admins@example.com?uid=1234567890`. If
        -   *   the Google group is restored, this identifier reverts to the standard
        -   *   identifier for a Google group.
        +   * that was deleted recently. For example,
        +   * `deleted:principalSet://goog/group/admins@example.com?uid=1234567890`. If
        +   * the Google group is restored, this identifier reverts to the standard
        +   * identifier for a Google group.
        +   *
            * * `principal://iam.googleapis.com/projects/-/serviceAccounts/{service_account_id}`:
        -   *   A Google Cloud service account. For example,
        -   *   `principal://iam.googleapis.com/projects/-/serviceAccounts/my-service-account@iam.gserviceaccount.com`.
        +   * A Google Cloud service account. For example,
        +   * `principal://iam.googleapis.com/projects/-/serviceAccounts/my-service-account@iam.gserviceaccount.com`.
        +   *
            * * `deleted:principal://iam.googleapis.com/projects/-/serviceAccounts/{service_account_id}?uid={uid}`:
        -   *   A Google Cloud service account that was deleted recently. For example,
        -   *   `deleted:principal://iam.googleapis.com/projects/-/serviceAccounts/my-service-account@iam.gserviceaccount.com?uid=1234567890`.
        -   *   If the service account is undeleted, this identifier reverts to the
        -   *   standard identifier for a service account.
        +   * A Google Cloud service account that was deleted recently. For example,
        +   * `deleted:principal://iam.googleapis.com/projects/-/serviceAccounts/my-service-account@iam.gserviceaccount.com?uid=1234567890`.
        +   * If the service account is undeleted, this identifier reverts to the
        +   * standard identifier for a service account.
        +   *
            * * `principalSet://goog/cloudIdentityCustomerId/{customer_id}`: All of the
        -   *   principals associated with the specified Google Workspace or Cloud
        -   *   Identity customer ID. For example,
        -   *   `principalSet://goog/cloudIdentityCustomerId/C01Abc35`.
        +   * principals associated with the specified Google Workspace or Cloud
        +   * Identity customer ID. For example,
        +   * `principalSet://goog/cloudIdentityCustomerId/C01Abc35`.
            * 
        * * repeated string denied_principals = 1; @@ -205,42 +239,51 @@ public int getDeniedPrincipalsCount() { public java.lang.String getDeniedPrincipals(int index) { return deniedPrincipals_.get(index); } + /** * * *
            * The identities that are prevented from using one or more permissions on
            * Google Cloud resources. This field can contain the following values:
        +   *
            * * `principalSet://goog/public:all`: A special identifier that represents
        -   *   any principal that is on the internet, even if they do not have a Google
        -   *   Account or are not logged in.
        +   * any principal that is on the internet, even if they do not have a Google
        +   * Account or are not logged in.
        +   *
            * * `principal://goog/subject/{email_id}`: A specific Google Account.
        -   *   Includes Gmail, Cloud Identity, and Google Workspace user accounts. For
        -   *   example, `principal://goog/subject/alice@example.com`.
        +   * Includes Gmail, Cloud Identity, and Google Workspace user accounts. For
        +   * example, `principal://goog/subject/alice@example.com`.
        +   *
            * * `deleted:principal://goog/subject/{email_id}?uid={uid}`: A specific
        -   *   Google Account that was deleted recently. For example,
        -   *   `deleted:principal://goog/subject/alice@example.com?uid=1234567890`. If
        -   *   the Google Account is recovered, this identifier reverts to the standard
        -   *   identifier for a Google Account.
        +   * Google Account that was deleted recently. For example,
        +   * `deleted:principal://goog/subject/alice@example.com?uid=1234567890`. If
        +   * the Google Account is recovered, this identifier reverts to the standard
        +   * identifier for a Google Account.
        +   *
            * * `principalSet://goog/group/{group_id}`: A Google group. For example,
        -   *   `principalSet://goog/group/admins@example.com`.
        +   * `principalSet://goog/group/admins@example.com`.
        +   *
            * * `deleted:principalSet://goog/group/{group_id}?uid={uid}`: A Google group
        -   *   that was deleted recently. For example,
        -   *   `deleted:principalSet://goog/group/admins@example.com?uid=1234567890`. If
        -   *   the Google group is restored, this identifier reverts to the standard
        -   *   identifier for a Google group.
        +   * that was deleted recently. For example,
        +   * `deleted:principalSet://goog/group/admins@example.com?uid=1234567890`. If
        +   * the Google group is restored, this identifier reverts to the standard
        +   * identifier for a Google group.
        +   *
            * * `principal://iam.googleapis.com/projects/-/serviceAccounts/{service_account_id}`:
        -   *   A Google Cloud service account. For example,
        -   *   `principal://iam.googleapis.com/projects/-/serviceAccounts/my-service-account@iam.gserviceaccount.com`.
        +   * A Google Cloud service account. For example,
        +   * `principal://iam.googleapis.com/projects/-/serviceAccounts/my-service-account@iam.gserviceaccount.com`.
        +   *
            * * `deleted:principal://iam.googleapis.com/projects/-/serviceAccounts/{service_account_id}?uid={uid}`:
        -   *   A Google Cloud service account that was deleted recently. For example,
        -   *   `deleted:principal://iam.googleapis.com/projects/-/serviceAccounts/my-service-account@iam.gserviceaccount.com?uid=1234567890`.
        -   *   If the service account is undeleted, this identifier reverts to the
        -   *   standard identifier for a service account.
        +   * A Google Cloud service account that was deleted recently. For example,
        +   * `deleted:principal://iam.googleapis.com/projects/-/serviceAccounts/my-service-account@iam.gserviceaccount.com?uid=1234567890`.
        +   * If the service account is undeleted, this identifier reverts to the
        +   * standard identifier for a service account.
        +   *
            * * `principalSet://goog/cloudIdentityCustomerId/{customer_id}`: All of the
        -   *   principals associated with the specified Google Workspace or Cloud
        -   *   Identity customer ID. For example,
        -   *   `principalSet://goog/cloudIdentityCustomerId/C01Abc35`.
        +   * principals associated with the specified Google Workspace or Cloud
        +   * Identity customer ID. For example,
        +   * `principalSet://goog/cloudIdentityCustomerId/C01Abc35`.
            * 
        * * repeated string denied_principals = 1; @@ -253,7 +296,11 @@ public com.google.protobuf.ByteString getDeniedPrincipalsBytes(int index) { } public static final int EXCEPTION_PRINCIPALS_FIELD_NUMBER = 2; - private com.google.protobuf.LazyStringList exceptionPrincipals_; + + @SuppressWarnings("serial") + private com.google.protobuf.LazyStringArrayList exceptionPrincipals_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + /** * * @@ -262,6 +309,7 @@ public com.google.protobuf.ByteString getDeniedPrincipalsBytes(int index) { * listed in the `denied_principals`. For example, you could add a Google * group to the `denied_principals`, then exclude specific users who belong to * that group. + * * This field can contain the same values as the `denied_principals` field, * excluding `principalSet://goog/public:all`, which represents all users on * the internet. @@ -274,6 +322,7 @@ public com.google.protobuf.ByteString getDeniedPrincipalsBytes(int index) { public com.google.protobuf.ProtocolStringList getExceptionPrincipalsList() { return exceptionPrincipals_; } + /** * * @@ -282,6 +331,7 @@ public com.google.protobuf.ProtocolStringList getExceptionPrincipalsList() { * listed in the `denied_principals`. For example, you could add a Google * group to the `denied_principals`, then exclude specific users who belong to * that group. + * * This field can contain the same values as the `denied_principals` field, * excluding `principalSet://goog/public:all`, which represents all users on * the internet. @@ -294,6 +344,7 @@ public com.google.protobuf.ProtocolStringList getExceptionPrincipalsList() { public int getExceptionPrincipalsCount() { return exceptionPrincipals_.size(); } + /** * * @@ -302,6 +353,7 @@ public int getExceptionPrincipalsCount() { * listed in the `denied_principals`. For example, you could add a Google * group to the `denied_principals`, then exclude specific users who belong to * that group. + * * This field can contain the same values as the `denied_principals` field, * excluding `principalSet://goog/public:all`, which represents all users on * the internet. @@ -315,6 +367,7 @@ public int getExceptionPrincipalsCount() { public java.lang.String getExceptionPrincipals(int index) { return exceptionPrincipals_.get(index); } + /** * * @@ -323,6 +376,7 @@ public java.lang.String getExceptionPrincipals(int index) { * listed in the `denied_principals`. For example, you could add a Google * group to the `denied_principals`, then exclude specific users who belong to * that group. + * * This field can contain the same values as the `denied_principals` field, * excluding `principalSet://goog/public:all`, which represents all users on * the internet. @@ -338,7 +392,11 @@ public com.google.protobuf.ByteString getExceptionPrincipalsBytes(int index) { } public static final int DENIED_PERMISSIONS_FIELD_NUMBER = 3; - private com.google.protobuf.LazyStringList deniedPermissions_; + + @SuppressWarnings("serial") + private com.google.protobuf.LazyStringArrayList deniedPermissions_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + /** * * @@ -356,6 +414,7 @@ public com.google.protobuf.ByteString getExceptionPrincipalsBytes(int index) { public com.google.protobuf.ProtocolStringList getDeniedPermissionsList() { return deniedPermissions_; } + /** * * @@ -373,6 +432,7 @@ public com.google.protobuf.ProtocolStringList getDeniedPermissionsList() { public int getDeniedPermissionsCount() { return deniedPermissions_.size(); } + /** * * @@ -391,6 +451,7 @@ public int getDeniedPermissionsCount() { public java.lang.String getDeniedPermissions(int index) { return deniedPermissions_.get(index); } + /** * * @@ -411,7 +472,11 @@ public com.google.protobuf.ByteString getDeniedPermissionsBytes(int index) { } public static final int EXCEPTION_PERMISSIONS_FIELD_NUMBER = 4; - private com.google.protobuf.LazyStringList exceptionPermissions_; + + @SuppressWarnings("serial") + private com.google.protobuf.LazyStringArrayList exceptionPermissions_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + /** * * @@ -420,6 +485,7 @@ public com.google.protobuf.ByteString getDeniedPermissionsBytes(int index) { * permissions given by `denied_permissions`. If a permission appears in * `denied_permissions` _and_ in `exception_permissions` then it will _not_ be * denied. + * * The excluded permissions can be specified using the same syntax as * `denied_permissions`. * @@ -431,6 +497,7 @@ public com.google.protobuf.ByteString getDeniedPermissionsBytes(int index) { public com.google.protobuf.ProtocolStringList getExceptionPermissionsList() { return exceptionPermissions_; } + /** * * @@ -439,6 +506,7 @@ public com.google.protobuf.ProtocolStringList getExceptionPermissionsList() { * permissions given by `denied_permissions`. If a permission appears in * `denied_permissions` _and_ in `exception_permissions` then it will _not_ be * denied. + * * The excluded permissions can be specified using the same syntax as * `denied_permissions`. * @@ -450,6 +518,7 @@ public com.google.protobuf.ProtocolStringList getExceptionPermissionsList() { public int getExceptionPermissionsCount() { return exceptionPermissions_.size(); } + /** * * @@ -458,6 +527,7 @@ public int getExceptionPermissionsCount() { * permissions given by `denied_permissions`. If a permission appears in * `denied_permissions` _and_ in `exception_permissions` then it will _not_ be * denied. + * * The excluded permissions can be specified using the same syntax as * `denied_permissions`. * @@ -470,6 +540,7 @@ public int getExceptionPermissionsCount() { public java.lang.String getExceptionPermissions(int index) { return exceptionPermissions_.get(index); } + /** * * @@ -478,6 +549,7 @@ public java.lang.String getExceptionPermissions(int index) { * permissions given by `denied_permissions`. If a permission appears in * `denied_permissions` _and_ in `exception_permissions` then it will _not_ be * denied. + * * The excluded permissions can be specified using the same syntax as * `denied_permissions`. * @@ -493,6 +565,7 @@ public com.google.protobuf.ByteString getExceptionPermissionsBytes(int index) { public static final int DENIAL_CONDITION_FIELD_NUMBER = 5; private com.google.type.Expr denialCondition_; + /** * * @@ -500,8 +573,10 @@ public com.google.protobuf.ByteString getExceptionPermissionsBytes(int index) { * The condition that determines whether this deny rule applies to a request. * If the condition expression evaluates to `true`, then the deny rule is * applied; otherwise, the deny rule is not applied. + * * Each deny rule is evaluated independently. If this deny rule does not apply * to a request, other deny rules might still apply. + * * The condition can use CEL functions that evaluate * [resource * tags](https://cloud.google.com/iam/help/conditions/resource-tags). Other @@ -514,8 +589,9 @@ public com.google.protobuf.ByteString getExceptionPermissionsBytes(int index) { */ @java.lang.Override public boolean hasDenialCondition() { - return denialCondition_ != null; + return ((bitField0_ & 0x00000001) != 0); } + /** * * @@ -523,8 +599,10 @@ public boolean hasDenialCondition() { * The condition that determines whether this deny rule applies to a request. * If the condition expression evaluates to `true`, then the deny rule is * applied; otherwise, the deny rule is not applied. + * * Each deny rule is evaluated independently. If this deny rule does not apply * to a request, other deny rules might still apply. + * * The condition can use CEL functions that evaluate * [resource * tags](https://cloud.google.com/iam/help/conditions/resource-tags). Other @@ -539,6 +617,7 @@ public boolean hasDenialCondition() { public com.google.type.Expr getDenialCondition() { return denialCondition_ == null ? com.google.type.Expr.getDefaultInstance() : denialCondition_; } + /** * * @@ -546,8 +625,10 @@ public com.google.type.Expr getDenialCondition() { * The condition that determines whether this deny rule applies to a request. * If the condition expression evaluates to `true`, then the deny rule is * applied; otherwise, the deny rule is not applied. + * * Each deny rule is evaluated independently. If this deny rule does not apply * to a request, other deny rules might still apply. + * * The condition can use CEL functions that evaluate * [resource * tags](https://cloud.google.com/iam/help/conditions/resource-tags). Other @@ -558,7 +639,7 @@ public com.google.type.Expr getDenialCondition() { */ @java.lang.Override public com.google.type.ExprOrBuilder getDenialConditionOrBuilder() { - return getDenialCondition(); + return denialCondition_ == null ? com.google.type.Expr.getDefaultInstance() : denialCondition_; } private byte memoizedIsInitialized = -1; @@ -576,19 +657,18 @@ public final boolean isInitialized() { @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { for (int i = 0; i < deniedPrincipals_.size(); i++) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, deniedPrincipals_.getRaw(i)); + com.google.protobuf.GeneratedMessage.writeString(output, 1, deniedPrincipals_.getRaw(i)); } for (int i = 0; i < exceptionPrincipals_.size(); i++) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 2, exceptionPrincipals_.getRaw(i)); + com.google.protobuf.GeneratedMessage.writeString(output, 2, exceptionPrincipals_.getRaw(i)); } for (int i = 0; i < deniedPermissions_.size(); i++) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 3, deniedPermissions_.getRaw(i)); + com.google.protobuf.GeneratedMessage.writeString(output, 3, deniedPermissions_.getRaw(i)); } for (int i = 0; i < exceptionPermissions_.size(); i++) { - com.google.protobuf.GeneratedMessageV3.writeString( - output, 4, exceptionPermissions_.getRaw(i)); + com.google.protobuf.GeneratedMessage.writeString(output, 4, exceptionPermissions_.getRaw(i)); } - if (denialCondition_ != null) { + if (((bitField0_ & 0x00000001) != 0)) { output.writeMessage(5, getDenialCondition()); } getUnknownFields().writeTo(output); @@ -632,7 +712,7 @@ public int getSerializedSize() { size += dataSize; size += 1 * getExceptionPermissionsList().size(); } - if (denialCondition_ != null) { + if (((bitField0_ & 0x00000001) != 0)) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(5, getDenialCondition()); } size += getUnknownFields().getSerializedSize(); @@ -730,38 +810,38 @@ public static com.google.iam.v2.DenyRule parseFrom( public static com.google.iam.v2.DenyRule parseFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); } public static com.google.iam.v2.DenyRule parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } public static com.google.iam.v2.DenyRule parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); } public static com.google.iam.v2.DenyRule parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( PARSER, input, extensionRegistry); } public static com.google.iam.v2.DenyRule parseFrom(com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); } public static com.google.iam.v2.DenyRule parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } @@ -784,10 +864,11 @@ public Builder toBuilder() { } @java.lang.Override - protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { Builder builder = new Builder(parent); return builder; } + /** * * @@ -797,7 +878,7 @@ protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.Build * * Protobuf type {@code google.iam.v2.DenyRule} */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder implements // @@protoc_insertion_point(builder_implements:google.iam.v2.DenyRule) com.google.iam.v2.DenyRuleOrBuilder { @@ -806,7 +887,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.iam.v2.DenyRuleProto .internal_static_google_iam_v2_DenyRule_fieldAccessorTable @@ -815,27 +896,32 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } // Construct using com.google.iam.v2.DenyRule.newBuilder() - private Builder() {} + private Builder() { + maybeForceBuilderInitialization(); + } - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetDenialConditionFieldBuilder(); + } } @java.lang.Override public Builder clear() { super.clear(); - deniedPrincipals_ = com.google.protobuf.LazyStringArrayList.EMPTY; - bitField0_ = (bitField0_ & ~0x00000001); - exceptionPrincipals_ = com.google.protobuf.LazyStringArrayList.EMPTY; - bitField0_ = (bitField0_ & ~0x00000002); - deniedPermissions_ = com.google.protobuf.LazyStringArrayList.EMPTY; - bitField0_ = (bitField0_ & ~0x00000004); - exceptionPermissions_ = com.google.protobuf.LazyStringArrayList.EMPTY; - bitField0_ = (bitField0_ & ~0x00000008); - if (denialConditionBuilder_ == null) { - denialCondition_ = null; - } else { - denialCondition_ = null; + bitField0_ = 0; + deniedPrincipals_ = com.google.protobuf.LazyStringArrayList.emptyList(); + exceptionPrincipals_ = com.google.protobuf.LazyStringArrayList.emptyList(); + deniedPermissions_ = com.google.protobuf.LazyStringArrayList.emptyList(); + exceptionPermissions_ = com.google.protobuf.LazyStringArrayList.emptyList(); + denialCondition_ = null; + if (denialConditionBuilder_ != null) { + denialConditionBuilder_.dispose(); denialConditionBuilder_ = null; } return this; @@ -863,67 +949,38 @@ public com.google.iam.v2.DenyRule build() { @java.lang.Override public com.google.iam.v2.DenyRule buildPartial() { com.google.iam.v2.DenyRule result = new com.google.iam.v2.DenyRule(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.iam.v2.DenyRule result) { int from_bitField0_ = bitField0_; - if (((bitField0_ & 0x00000001) != 0)) { - deniedPrincipals_ = deniedPrincipals_.getUnmodifiableView(); - bitField0_ = (bitField0_ & ~0x00000001); + if (((from_bitField0_ & 0x00000001) != 0)) { + deniedPrincipals_.makeImmutable(); + result.deniedPrincipals_ = deniedPrincipals_; } - result.deniedPrincipals_ = deniedPrincipals_; - if (((bitField0_ & 0x00000002) != 0)) { - exceptionPrincipals_ = exceptionPrincipals_.getUnmodifiableView(); - bitField0_ = (bitField0_ & ~0x00000002); + if (((from_bitField0_ & 0x00000002) != 0)) { + exceptionPrincipals_.makeImmutable(); + result.exceptionPrincipals_ = exceptionPrincipals_; } - result.exceptionPrincipals_ = exceptionPrincipals_; - if (((bitField0_ & 0x00000004) != 0)) { - deniedPermissions_ = deniedPermissions_.getUnmodifiableView(); - bitField0_ = (bitField0_ & ~0x00000004); + if (((from_bitField0_ & 0x00000004) != 0)) { + deniedPermissions_.makeImmutable(); + result.deniedPermissions_ = deniedPermissions_; } - result.deniedPermissions_ = deniedPermissions_; - if (((bitField0_ & 0x00000008) != 0)) { - exceptionPermissions_ = exceptionPermissions_.getUnmodifiableView(); - bitField0_ = (bitField0_ & ~0x00000008); + if (((from_bitField0_ & 0x00000008) != 0)) { + exceptionPermissions_.makeImmutable(); + result.exceptionPermissions_ = exceptionPermissions_; } - result.exceptionPermissions_ = exceptionPermissions_; - if (denialConditionBuilder_ == null) { - result.denialCondition_ = denialCondition_; - } else { - result.denialCondition_ = denialConditionBuilder_.build(); + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000010) != 0)) { + result.denialCondition_ = + denialConditionBuilder_ == null ? denialCondition_ : denialConditionBuilder_.build(); + to_bitField0_ |= 0x00000001; } - 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); + result.bitField0_ |= to_bitField0_; } @java.lang.Override @@ -941,7 +998,7 @@ public Builder mergeFrom(com.google.iam.v2.DenyRule other) { if (!other.deniedPrincipals_.isEmpty()) { if (deniedPrincipals_.isEmpty()) { deniedPrincipals_ = other.deniedPrincipals_; - bitField0_ = (bitField0_ & ~0x00000001); + bitField0_ |= 0x00000001; } else { ensureDeniedPrincipalsIsMutable(); deniedPrincipals_.addAll(other.deniedPrincipals_); @@ -951,7 +1008,7 @@ public Builder mergeFrom(com.google.iam.v2.DenyRule other) { if (!other.exceptionPrincipals_.isEmpty()) { if (exceptionPrincipals_.isEmpty()) { exceptionPrincipals_ = other.exceptionPrincipals_; - bitField0_ = (bitField0_ & ~0x00000002); + bitField0_ |= 0x00000002; } else { ensureExceptionPrincipalsIsMutable(); exceptionPrincipals_.addAll(other.exceptionPrincipals_); @@ -961,7 +1018,7 @@ public Builder mergeFrom(com.google.iam.v2.DenyRule other) { if (!other.deniedPermissions_.isEmpty()) { if (deniedPermissions_.isEmpty()) { deniedPermissions_ = other.deniedPermissions_; - bitField0_ = (bitField0_ & ~0x00000004); + bitField0_ |= 0x00000004; } else { ensureDeniedPermissionsIsMutable(); deniedPermissions_.addAll(other.deniedPermissions_); @@ -971,7 +1028,7 @@ public Builder mergeFrom(com.google.iam.v2.DenyRule other) { if (!other.exceptionPermissions_.isEmpty()) { if (exceptionPermissions_.isEmpty()) { exceptionPermissions_ = other.exceptionPermissions_; - bitField0_ = (bitField0_ & ~0x00000008); + bitField0_ |= 0x00000008; } else { ensureExceptionPermissionsIsMutable(); exceptionPermissions_.addAll(other.exceptionPermissions_); @@ -1037,8 +1094,9 @@ public Builder mergeFrom( } // case 34 case 42: { - input.readMessage(getDenialConditionFieldBuilder().getBuilder(), extensionRegistry); - + input.readMessage( + internalGetDenialConditionFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000010; break; } // case 42 default: @@ -1060,51 +1118,60 @@ public Builder mergeFrom( private int bitField0_; - private com.google.protobuf.LazyStringList deniedPrincipals_ = - com.google.protobuf.LazyStringArrayList.EMPTY; + private com.google.protobuf.LazyStringArrayList deniedPrincipals_ = + com.google.protobuf.LazyStringArrayList.emptyList(); private void ensureDeniedPrincipalsIsMutable() { - if (!((bitField0_ & 0x00000001) != 0)) { + if (!deniedPrincipals_.isModifiable()) { deniedPrincipals_ = new com.google.protobuf.LazyStringArrayList(deniedPrincipals_); - bitField0_ |= 0x00000001; } + bitField0_ |= 0x00000001; } + /** * * *
              * The identities that are prevented from using one or more permissions on
              * Google Cloud resources. This field can contain the following values:
        +     *
              * * `principalSet://goog/public:all`: A special identifier that represents
        -     *   any principal that is on the internet, even if they do not have a Google
        -     *   Account or are not logged in.
        +     * any principal that is on the internet, even if they do not have a Google
        +     * Account or are not logged in.
        +     *
              * * `principal://goog/subject/{email_id}`: A specific Google Account.
        -     *   Includes Gmail, Cloud Identity, and Google Workspace user accounts. For
        -     *   example, `principal://goog/subject/alice@example.com`.
        +     * Includes Gmail, Cloud Identity, and Google Workspace user accounts. For
        +     * example, `principal://goog/subject/alice@example.com`.
        +     *
              * * `deleted:principal://goog/subject/{email_id}?uid={uid}`: A specific
        -     *   Google Account that was deleted recently. For example,
        -     *   `deleted:principal://goog/subject/alice@example.com?uid=1234567890`. If
        -     *   the Google Account is recovered, this identifier reverts to the standard
        -     *   identifier for a Google Account.
        +     * Google Account that was deleted recently. For example,
        +     * `deleted:principal://goog/subject/alice@example.com?uid=1234567890`. If
        +     * the Google Account is recovered, this identifier reverts to the standard
        +     * identifier for a Google Account.
        +     *
              * * `principalSet://goog/group/{group_id}`: A Google group. For example,
        -     *   `principalSet://goog/group/admins@example.com`.
        +     * `principalSet://goog/group/admins@example.com`.
        +     *
              * * `deleted:principalSet://goog/group/{group_id}?uid={uid}`: A Google group
        -     *   that was deleted recently. For example,
        -     *   `deleted:principalSet://goog/group/admins@example.com?uid=1234567890`. If
        -     *   the Google group is restored, this identifier reverts to the standard
        -     *   identifier for a Google group.
        +     * that was deleted recently. For example,
        +     * `deleted:principalSet://goog/group/admins@example.com?uid=1234567890`. If
        +     * the Google group is restored, this identifier reverts to the standard
        +     * identifier for a Google group.
        +     *
              * * `principal://iam.googleapis.com/projects/-/serviceAccounts/{service_account_id}`:
        -     *   A Google Cloud service account. For example,
        -     *   `principal://iam.googleapis.com/projects/-/serviceAccounts/my-service-account@iam.gserviceaccount.com`.
        +     * A Google Cloud service account. For example,
        +     * `principal://iam.googleapis.com/projects/-/serviceAccounts/my-service-account@iam.gserviceaccount.com`.
        +     *
              * * `deleted:principal://iam.googleapis.com/projects/-/serviceAccounts/{service_account_id}?uid={uid}`:
        -     *   A Google Cloud service account that was deleted recently. For example,
        -     *   `deleted:principal://iam.googleapis.com/projects/-/serviceAccounts/my-service-account@iam.gserviceaccount.com?uid=1234567890`.
        -     *   If the service account is undeleted, this identifier reverts to the
        -     *   standard identifier for a service account.
        +     * A Google Cloud service account that was deleted recently. For example,
        +     * `deleted:principal://iam.googleapis.com/projects/-/serviceAccounts/my-service-account@iam.gserviceaccount.com?uid=1234567890`.
        +     * If the service account is undeleted, this identifier reverts to the
        +     * standard identifier for a service account.
        +     *
              * * `principalSet://goog/cloudIdentityCustomerId/{customer_id}`: All of the
        -     *   principals associated with the specified Google Workspace or Cloud
        -     *   Identity customer ID. For example,
        -     *   `principalSet://goog/cloudIdentityCustomerId/C01Abc35`.
        +     * principals associated with the specified Google Workspace or Cloud
        +     * Identity customer ID. For example,
        +     * `principalSet://goog/cloudIdentityCustomerId/C01Abc35`.
              * 
        * * repeated string denied_principals = 1; @@ -1112,44 +1179,54 @@ private void ensureDeniedPrincipalsIsMutable() { * @return A list containing the deniedPrincipals. */ public com.google.protobuf.ProtocolStringList getDeniedPrincipalsList() { - return deniedPrincipals_.getUnmodifiableView(); + deniedPrincipals_.makeImmutable(); + return deniedPrincipals_; } + /** * * *
              * The identities that are prevented from using one or more permissions on
              * Google Cloud resources. This field can contain the following values:
        +     *
              * * `principalSet://goog/public:all`: A special identifier that represents
        -     *   any principal that is on the internet, even if they do not have a Google
        -     *   Account or are not logged in.
        +     * any principal that is on the internet, even if they do not have a Google
        +     * Account or are not logged in.
        +     *
              * * `principal://goog/subject/{email_id}`: A specific Google Account.
        -     *   Includes Gmail, Cloud Identity, and Google Workspace user accounts. For
        -     *   example, `principal://goog/subject/alice@example.com`.
        +     * Includes Gmail, Cloud Identity, and Google Workspace user accounts. For
        +     * example, `principal://goog/subject/alice@example.com`.
        +     *
              * * `deleted:principal://goog/subject/{email_id}?uid={uid}`: A specific
        -     *   Google Account that was deleted recently. For example,
        -     *   `deleted:principal://goog/subject/alice@example.com?uid=1234567890`. If
        -     *   the Google Account is recovered, this identifier reverts to the standard
        -     *   identifier for a Google Account.
        +     * Google Account that was deleted recently. For example,
        +     * `deleted:principal://goog/subject/alice@example.com?uid=1234567890`. If
        +     * the Google Account is recovered, this identifier reverts to the standard
        +     * identifier for a Google Account.
        +     *
              * * `principalSet://goog/group/{group_id}`: A Google group. For example,
        -     *   `principalSet://goog/group/admins@example.com`.
        +     * `principalSet://goog/group/admins@example.com`.
        +     *
              * * `deleted:principalSet://goog/group/{group_id}?uid={uid}`: A Google group
        -     *   that was deleted recently. For example,
        -     *   `deleted:principalSet://goog/group/admins@example.com?uid=1234567890`. If
        -     *   the Google group is restored, this identifier reverts to the standard
        -     *   identifier for a Google group.
        +     * that was deleted recently. For example,
        +     * `deleted:principalSet://goog/group/admins@example.com?uid=1234567890`. If
        +     * the Google group is restored, this identifier reverts to the standard
        +     * identifier for a Google group.
        +     *
              * * `principal://iam.googleapis.com/projects/-/serviceAccounts/{service_account_id}`:
        -     *   A Google Cloud service account. For example,
        -     *   `principal://iam.googleapis.com/projects/-/serviceAccounts/my-service-account@iam.gserviceaccount.com`.
        +     * A Google Cloud service account. For example,
        +     * `principal://iam.googleapis.com/projects/-/serviceAccounts/my-service-account@iam.gserviceaccount.com`.
        +     *
              * * `deleted:principal://iam.googleapis.com/projects/-/serviceAccounts/{service_account_id}?uid={uid}`:
        -     *   A Google Cloud service account that was deleted recently. For example,
        -     *   `deleted:principal://iam.googleapis.com/projects/-/serviceAccounts/my-service-account@iam.gserviceaccount.com?uid=1234567890`.
        -     *   If the service account is undeleted, this identifier reverts to the
        -     *   standard identifier for a service account.
        +     * A Google Cloud service account that was deleted recently. For example,
        +     * `deleted:principal://iam.googleapis.com/projects/-/serviceAccounts/my-service-account@iam.gserviceaccount.com?uid=1234567890`.
        +     * If the service account is undeleted, this identifier reverts to the
        +     * standard identifier for a service account.
        +     *
              * * `principalSet://goog/cloudIdentityCustomerId/{customer_id}`: All of the
        -     *   principals associated with the specified Google Workspace or Cloud
        -     *   Identity customer ID. For example,
        -     *   `principalSet://goog/cloudIdentityCustomerId/C01Abc35`.
        +     * principals associated with the specified Google Workspace or Cloud
        +     * Identity customer ID. For example,
        +     * `principalSet://goog/cloudIdentityCustomerId/C01Abc35`.
              * 
        * * repeated string denied_principals = 1; @@ -1159,42 +1236,51 @@ public com.google.protobuf.ProtocolStringList getDeniedPrincipalsList() { public int getDeniedPrincipalsCount() { return deniedPrincipals_.size(); } + /** * * *
              * The identities that are prevented from using one or more permissions on
              * Google Cloud resources. This field can contain the following values:
        +     *
              * * `principalSet://goog/public:all`: A special identifier that represents
        -     *   any principal that is on the internet, even if they do not have a Google
        -     *   Account or are not logged in.
        +     * any principal that is on the internet, even if they do not have a Google
        +     * Account or are not logged in.
        +     *
              * * `principal://goog/subject/{email_id}`: A specific Google Account.
        -     *   Includes Gmail, Cloud Identity, and Google Workspace user accounts. For
        -     *   example, `principal://goog/subject/alice@example.com`.
        +     * Includes Gmail, Cloud Identity, and Google Workspace user accounts. For
        +     * example, `principal://goog/subject/alice@example.com`.
        +     *
              * * `deleted:principal://goog/subject/{email_id}?uid={uid}`: A specific
        -     *   Google Account that was deleted recently. For example,
        -     *   `deleted:principal://goog/subject/alice@example.com?uid=1234567890`. If
        -     *   the Google Account is recovered, this identifier reverts to the standard
        -     *   identifier for a Google Account.
        +     * Google Account that was deleted recently. For example,
        +     * `deleted:principal://goog/subject/alice@example.com?uid=1234567890`. If
        +     * the Google Account is recovered, this identifier reverts to the standard
        +     * identifier for a Google Account.
        +     *
              * * `principalSet://goog/group/{group_id}`: A Google group. For example,
        -     *   `principalSet://goog/group/admins@example.com`.
        +     * `principalSet://goog/group/admins@example.com`.
        +     *
              * * `deleted:principalSet://goog/group/{group_id}?uid={uid}`: A Google group
        -     *   that was deleted recently. For example,
        -     *   `deleted:principalSet://goog/group/admins@example.com?uid=1234567890`. If
        -     *   the Google group is restored, this identifier reverts to the standard
        -     *   identifier for a Google group.
        +     * that was deleted recently. For example,
        +     * `deleted:principalSet://goog/group/admins@example.com?uid=1234567890`. If
        +     * the Google group is restored, this identifier reverts to the standard
        +     * identifier for a Google group.
        +     *
              * * `principal://iam.googleapis.com/projects/-/serviceAccounts/{service_account_id}`:
        -     *   A Google Cloud service account. For example,
        -     *   `principal://iam.googleapis.com/projects/-/serviceAccounts/my-service-account@iam.gserviceaccount.com`.
        +     * A Google Cloud service account. For example,
        +     * `principal://iam.googleapis.com/projects/-/serviceAccounts/my-service-account@iam.gserviceaccount.com`.
        +     *
              * * `deleted:principal://iam.googleapis.com/projects/-/serviceAccounts/{service_account_id}?uid={uid}`:
        -     *   A Google Cloud service account that was deleted recently. For example,
        -     *   `deleted:principal://iam.googleapis.com/projects/-/serviceAccounts/my-service-account@iam.gserviceaccount.com?uid=1234567890`.
        -     *   If the service account is undeleted, this identifier reverts to the
        -     *   standard identifier for a service account.
        +     * A Google Cloud service account that was deleted recently. For example,
        +     * `deleted:principal://iam.googleapis.com/projects/-/serviceAccounts/my-service-account@iam.gserviceaccount.com?uid=1234567890`.
        +     * If the service account is undeleted, this identifier reverts to the
        +     * standard identifier for a service account.
        +     *
              * * `principalSet://goog/cloudIdentityCustomerId/{customer_id}`: All of the
        -     *   principals associated with the specified Google Workspace or Cloud
        -     *   Identity customer ID. For example,
        -     *   `principalSet://goog/cloudIdentityCustomerId/C01Abc35`.
        +     * principals associated with the specified Google Workspace or Cloud
        +     * Identity customer ID. For example,
        +     * `principalSet://goog/cloudIdentityCustomerId/C01Abc35`.
              * 
        * * repeated string denied_principals = 1; @@ -1205,42 +1291,51 @@ public int getDeniedPrincipalsCount() { public java.lang.String getDeniedPrincipals(int index) { return deniedPrincipals_.get(index); } + /** * * *
              * The identities that are prevented from using one or more permissions on
              * Google Cloud resources. This field can contain the following values:
        +     *
              * * `principalSet://goog/public:all`: A special identifier that represents
        -     *   any principal that is on the internet, even if they do not have a Google
        -     *   Account or are not logged in.
        +     * any principal that is on the internet, even if they do not have a Google
        +     * Account or are not logged in.
        +     *
              * * `principal://goog/subject/{email_id}`: A specific Google Account.
        -     *   Includes Gmail, Cloud Identity, and Google Workspace user accounts. For
        -     *   example, `principal://goog/subject/alice@example.com`.
        +     * Includes Gmail, Cloud Identity, and Google Workspace user accounts. For
        +     * example, `principal://goog/subject/alice@example.com`.
        +     *
              * * `deleted:principal://goog/subject/{email_id}?uid={uid}`: A specific
        -     *   Google Account that was deleted recently. For example,
        -     *   `deleted:principal://goog/subject/alice@example.com?uid=1234567890`. If
        -     *   the Google Account is recovered, this identifier reverts to the standard
        -     *   identifier for a Google Account.
        +     * Google Account that was deleted recently. For example,
        +     * `deleted:principal://goog/subject/alice@example.com?uid=1234567890`. If
        +     * the Google Account is recovered, this identifier reverts to the standard
        +     * identifier for a Google Account.
        +     *
              * * `principalSet://goog/group/{group_id}`: A Google group. For example,
        -     *   `principalSet://goog/group/admins@example.com`.
        +     * `principalSet://goog/group/admins@example.com`.
        +     *
              * * `deleted:principalSet://goog/group/{group_id}?uid={uid}`: A Google group
        -     *   that was deleted recently. For example,
        -     *   `deleted:principalSet://goog/group/admins@example.com?uid=1234567890`. If
        -     *   the Google group is restored, this identifier reverts to the standard
        -     *   identifier for a Google group.
        +     * that was deleted recently. For example,
        +     * `deleted:principalSet://goog/group/admins@example.com?uid=1234567890`. If
        +     * the Google group is restored, this identifier reverts to the standard
        +     * identifier for a Google group.
        +     *
              * * `principal://iam.googleapis.com/projects/-/serviceAccounts/{service_account_id}`:
        -     *   A Google Cloud service account. For example,
        -     *   `principal://iam.googleapis.com/projects/-/serviceAccounts/my-service-account@iam.gserviceaccount.com`.
        +     * A Google Cloud service account. For example,
        +     * `principal://iam.googleapis.com/projects/-/serviceAccounts/my-service-account@iam.gserviceaccount.com`.
        +     *
              * * `deleted:principal://iam.googleapis.com/projects/-/serviceAccounts/{service_account_id}?uid={uid}`:
        -     *   A Google Cloud service account that was deleted recently. For example,
        -     *   `deleted:principal://iam.googleapis.com/projects/-/serviceAccounts/my-service-account@iam.gserviceaccount.com?uid=1234567890`.
        -     *   If the service account is undeleted, this identifier reverts to the
        -     *   standard identifier for a service account.
        +     * A Google Cloud service account that was deleted recently. For example,
        +     * `deleted:principal://iam.googleapis.com/projects/-/serviceAccounts/my-service-account@iam.gserviceaccount.com?uid=1234567890`.
        +     * If the service account is undeleted, this identifier reverts to the
        +     * standard identifier for a service account.
        +     *
              * * `principalSet://goog/cloudIdentityCustomerId/{customer_id}`: All of the
        -     *   principals associated with the specified Google Workspace or Cloud
        -     *   Identity customer ID. For example,
        -     *   `principalSet://goog/cloudIdentityCustomerId/C01Abc35`.
        +     * principals associated with the specified Google Workspace or Cloud
        +     * Identity customer ID. For example,
        +     * `principalSet://goog/cloudIdentityCustomerId/C01Abc35`.
              * 
        * * repeated string denied_principals = 1; @@ -1251,42 +1346,51 @@ public java.lang.String getDeniedPrincipals(int index) { public com.google.protobuf.ByteString getDeniedPrincipalsBytes(int index) { return deniedPrincipals_.getByteString(index); } + /** * * *
              * The identities that are prevented from using one or more permissions on
              * Google Cloud resources. This field can contain the following values:
        +     *
              * * `principalSet://goog/public:all`: A special identifier that represents
        -     *   any principal that is on the internet, even if they do not have a Google
        -     *   Account or are not logged in.
        +     * any principal that is on the internet, even if they do not have a Google
        +     * Account or are not logged in.
        +     *
              * * `principal://goog/subject/{email_id}`: A specific Google Account.
        -     *   Includes Gmail, Cloud Identity, and Google Workspace user accounts. For
        -     *   example, `principal://goog/subject/alice@example.com`.
        +     * Includes Gmail, Cloud Identity, and Google Workspace user accounts. For
        +     * example, `principal://goog/subject/alice@example.com`.
        +     *
              * * `deleted:principal://goog/subject/{email_id}?uid={uid}`: A specific
        -     *   Google Account that was deleted recently. For example,
        -     *   `deleted:principal://goog/subject/alice@example.com?uid=1234567890`. If
        -     *   the Google Account is recovered, this identifier reverts to the standard
        -     *   identifier for a Google Account.
        +     * Google Account that was deleted recently. For example,
        +     * `deleted:principal://goog/subject/alice@example.com?uid=1234567890`. If
        +     * the Google Account is recovered, this identifier reverts to the standard
        +     * identifier for a Google Account.
        +     *
              * * `principalSet://goog/group/{group_id}`: A Google group. For example,
        -     *   `principalSet://goog/group/admins@example.com`.
        +     * `principalSet://goog/group/admins@example.com`.
        +     *
              * * `deleted:principalSet://goog/group/{group_id}?uid={uid}`: A Google group
        -     *   that was deleted recently. For example,
        -     *   `deleted:principalSet://goog/group/admins@example.com?uid=1234567890`. If
        -     *   the Google group is restored, this identifier reverts to the standard
        -     *   identifier for a Google group.
        +     * that was deleted recently. For example,
        +     * `deleted:principalSet://goog/group/admins@example.com?uid=1234567890`. If
        +     * the Google group is restored, this identifier reverts to the standard
        +     * identifier for a Google group.
        +     *
              * * `principal://iam.googleapis.com/projects/-/serviceAccounts/{service_account_id}`:
        -     *   A Google Cloud service account. For example,
        -     *   `principal://iam.googleapis.com/projects/-/serviceAccounts/my-service-account@iam.gserviceaccount.com`.
        +     * A Google Cloud service account. For example,
        +     * `principal://iam.googleapis.com/projects/-/serviceAccounts/my-service-account@iam.gserviceaccount.com`.
        +     *
              * * `deleted:principal://iam.googleapis.com/projects/-/serviceAccounts/{service_account_id}?uid={uid}`:
        -     *   A Google Cloud service account that was deleted recently. For example,
        -     *   `deleted:principal://iam.googleapis.com/projects/-/serviceAccounts/my-service-account@iam.gserviceaccount.com?uid=1234567890`.
        -     *   If the service account is undeleted, this identifier reverts to the
        -     *   standard identifier for a service account.
        +     * A Google Cloud service account that was deleted recently. For example,
        +     * `deleted:principal://iam.googleapis.com/projects/-/serviceAccounts/my-service-account@iam.gserviceaccount.com?uid=1234567890`.
        +     * If the service account is undeleted, this identifier reverts to the
        +     * standard identifier for a service account.
        +     *
              * * `principalSet://goog/cloudIdentityCustomerId/{customer_id}`: All of the
        -     *   principals associated with the specified Google Workspace or Cloud
        -     *   Identity customer ID. For example,
        -     *   `principalSet://goog/cloudIdentityCustomerId/C01Abc35`.
        +     * principals associated with the specified Google Workspace or Cloud
        +     * Identity customer ID. For example,
        +     * `principalSet://goog/cloudIdentityCustomerId/C01Abc35`.
              * 
        * * repeated string denied_principals = 1; @@ -1301,45 +1405,55 @@ public Builder setDeniedPrincipals(int index, java.lang.String value) { } ensureDeniedPrincipalsIsMutable(); deniedPrincipals_.set(index, value); + bitField0_ |= 0x00000001; onChanged(); return this; } + /** * * *
              * The identities that are prevented from using one or more permissions on
              * Google Cloud resources. This field can contain the following values:
        +     *
              * * `principalSet://goog/public:all`: A special identifier that represents
        -     *   any principal that is on the internet, even if they do not have a Google
        -     *   Account or are not logged in.
        +     * any principal that is on the internet, even if they do not have a Google
        +     * Account or are not logged in.
        +     *
              * * `principal://goog/subject/{email_id}`: A specific Google Account.
        -     *   Includes Gmail, Cloud Identity, and Google Workspace user accounts. For
        -     *   example, `principal://goog/subject/alice@example.com`.
        +     * Includes Gmail, Cloud Identity, and Google Workspace user accounts. For
        +     * example, `principal://goog/subject/alice@example.com`.
        +     *
              * * `deleted:principal://goog/subject/{email_id}?uid={uid}`: A specific
        -     *   Google Account that was deleted recently. For example,
        -     *   `deleted:principal://goog/subject/alice@example.com?uid=1234567890`. If
        -     *   the Google Account is recovered, this identifier reverts to the standard
        -     *   identifier for a Google Account.
        +     * Google Account that was deleted recently. For example,
        +     * `deleted:principal://goog/subject/alice@example.com?uid=1234567890`. If
        +     * the Google Account is recovered, this identifier reverts to the standard
        +     * identifier for a Google Account.
        +     *
              * * `principalSet://goog/group/{group_id}`: A Google group. For example,
        -     *   `principalSet://goog/group/admins@example.com`.
        +     * `principalSet://goog/group/admins@example.com`.
        +     *
              * * `deleted:principalSet://goog/group/{group_id}?uid={uid}`: A Google group
        -     *   that was deleted recently. For example,
        -     *   `deleted:principalSet://goog/group/admins@example.com?uid=1234567890`. If
        -     *   the Google group is restored, this identifier reverts to the standard
        -     *   identifier for a Google group.
        +     * that was deleted recently. For example,
        +     * `deleted:principalSet://goog/group/admins@example.com?uid=1234567890`. If
        +     * the Google group is restored, this identifier reverts to the standard
        +     * identifier for a Google group.
        +     *
              * * `principal://iam.googleapis.com/projects/-/serviceAccounts/{service_account_id}`:
        -     *   A Google Cloud service account. For example,
        -     *   `principal://iam.googleapis.com/projects/-/serviceAccounts/my-service-account@iam.gserviceaccount.com`.
        +     * A Google Cloud service account. For example,
        +     * `principal://iam.googleapis.com/projects/-/serviceAccounts/my-service-account@iam.gserviceaccount.com`.
        +     *
              * * `deleted:principal://iam.googleapis.com/projects/-/serviceAccounts/{service_account_id}?uid={uid}`:
        -     *   A Google Cloud service account that was deleted recently. For example,
        -     *   `deleted:principal://iam.googleapis.com/projects/-/serviceAccounts/my-service-account@iam.gserviceaccount.com?uid=1234567890`.
        -     *   If the service account is undeleted, this identifier reverts to the
        -     *   standard identifier for a service account.
        +     * A Google Cloud service account that was deleted recently. For example,
        +     * `deleted:principal://iam.googleapis.com/projects/-/serviceAccounts/my-service-account@iam.gserviceaccount.com?uid=1234567890`.
        +     * If the service account is undeleted, this identifier reverts to the
        +     * standard identifier for a service account.
        +     *
              * * `principalSet://goog/cloudIdentityCustomerId/{customer_id}`: All of the
        -     *   principals associated with the specified Google Workspace or Cloud
        -     *   Identity customer ID. For example,
        -     *   `principalSet://goog/cloudIdentityCustomerId/C01Abc35`.
        +     * principals associated with the specified Google Workspace or Cloud
        +     * Identity customer ID. For example,
        +     * `principalSet://goog/cloudIdentityCustomerId/C01Abc35`.
              * 
        * * repeated string denied_principals = 1; @@ -1353,45 +1467,55 @@ public Builder addDeniedPrincipals(java.lang.String value) { } ensureDeniedPrincipalsIsMutable(); deniedPrincipals_.add(value); + bitField0_ |= 0x00000001; onChanged(); return this; } + /** * * *
              * The identities that are prevented from using one or more permissions on
              * Google Cloud resources. This field can contain the following values:
        +     *
              * * `principalSet://goog/public:all`: A special identifier that represents
        -     *   any principal that is on the internet, even if they do not have a Google
        -     *   Account or are not logged in.
        +     * any principal that is on the internet, even if they do not have a Google
        +     * Account or are not logged in.
        +     *
              * * `principal://goog/subject/{email_id}`: A specific Google Account.
        -     *   Includes Gmail, Cloud Identity, and Google Workspace user accounts. For
        -     *   example, `principal://goog/subject/alice@example.com`.
        +     * Includes Gmail, Cloud Identity, and Google Workspace user accounts. For
        +     * example, `principal://goog/subject/alice@example.com`.
        +     *
              * * `deleted:principal://goog/subject/{email_id}?uid={uid}`: A specific
        -     *   Google Account that was deleted recently. For example,
        -     *   `deleted:principal://goog/subject/alice@example.com?uid=1234567890`. If
        -     *   the Google Account is recovered, this identifier reverts to the standard
        -     *   identifier for a Google Account.
        +     * Google Account that was deleted recently. For example,
        +     * `deleted:principal://goog/subject/alice@example.com?uid=1234567890`. If
        +     * the Google Account is recovered, this identifier reverts to the standard
        +     * identifier for a Google Account.
        +     *
              * * `principalSet://goog/group/{group_id}`: A Google group. For example,
        -     *   `principalSet://goog/group/admins@example.com`.
        +     * `principalSet://goog/group/admins@example.com`.
        +     *
              * * `deleted:principalSet://goog/group/{group_id}?uid={uid}`: A Google group
        -     *   that was deleted recently. For example,
        -     *   `deleted:principalSet://goog/group/admins@example.com?uid=1234567890`. If
        -     *   the Google group is restored, this identifier reverts to the standard
        -     *   identifier for a Google group.
        +     * that was deleted recently. For example,
        +     * `deleted:principalSet://goog/group/admins@example.com?uid=1234567890`. If
        +     * the Google group is restored, this identifier reverts to the standard
        +     * identifier for a Google group.
        +     *
              * * `principal://iam.googleapis.com/projects/-/serviceAccounts/{service_account_id}`:
        -     *   A Google Cloud service account. For example,
        -     *   `principal://iam.googleapis.com/projects/-/serviceAccounts/my-service-account@iam.gserviceaccount.com`.
        +     * A Google Cloud service account. For example,
        +     * `principal://iam.googleapis.com/projects/-/serviceAccounts/my-service-account@iam.gserviceaccount.com`.
        +     *
              * * `deleted:principal://iam.googleapis.com/projects/-/serviceAccounts/{service_account_id}?uid={uid}`:
        -     *   A Google Cloud service account that was deleted recently. For example,
        -     *   `deleted:principal://iam.googleapis.com/projects/-/serviceAccounts/my-service-account@iam.gserviceaccount.com?uid=1234567890`.
        -     *   If the service account is undeleted, this identifier reverts to the
        -     *   standard identifier for a service account.
        +     * A Google Cloud service account that was deleted recently. For example,
        +     * `deleted:principal://iam.googleapis.com/projects/-/serviceAccounts/my-service-account@iam.gserviceaccount.com?uid=1234567890`.
        +     * If the service account is undeleted, this identifier reverts to the
        +     * standard identifier for a service account.
        +     *
              * * `principalSet://goog/cloudIdentityCustomerId/{customer_id}`: All of the
        -     *   principals associated with the specified Google Workspace or Cloud
        -     *   Identity customer ID. For example,
        -     *   `principalSet://goog/cloudIdentityCustomerId/C01Abc35`.
        +     * principals associated with the specified Google Workspace or Cloud
        +     * Identity customer ID. For example,
        +     * `principalSet://goog/cloudIdentityCustomerId/C01Abc35`.
              * 
        * * repeated string denied_principals = 1; @@ -1402,45 +1526,55 @@ public Builder addDeniedPrincipals(java.lang.String value) { public Builder addAllDeniedPrincipals(java.lang.Iterable values) { ensureDeniedPrincipalsIsMutable(); com.google.protobuf.AbstractMessageLite.Builder.addAll(values, deniedPrincipals_); + bitField0_ |= 0x00000001; onChanged(); return this; } + /** * * *
              * The identities that are prevented from using one or more permissions on
              * Google Cloud resources. This field can contain the following values:
        +     *
              * * `principalSet://goog/public:all`: A special identifier that represents
        -     *   any principal that is on the internet, even if they do not have a Google
        -     *   Account or are not logged in.
        +     * any principal that is on the internet, even if they do not have a Google
        +     * Account or are not logged in.
        +     *
              * * `principal://goog/subject/{email_id}`: A specific Google Account.
        -     *   Includes Gmail, Cloud Identity, and Google Workspace user accounts. For
        -     *   example, `principal://goog/subject/alice@example.com`.
        +     * Includes Gmail, Cloud Identity, and Google Workspace user accounts. For
        +     * example, `principal://goog/subject/alice@example.com`.
        +     *
              * * `deleted:principal://goog/subject/{email_id}?uid={uid}`: A specific
        -     *   Google Account that was deleted recently. For example,
        -     *   `deleted:principal://goog/subject/alice@example.com?uid=1234567890`. If
        -     *   the Google Account is recovered, this identifier reverts to the standard
        -     *   identifier for a Google Account.
        +     * Google Account that was deleted recently. For example,
        +     * `deleted:principal://goog/subject/alice@example.com?uid=1234567890`. If
        +     * the Google Account is recovered, this identifier reverts to the standard
        +     * identifier for a Google Account.
        +     *
              * * `principalSet://goog/group/{group_id}`: A Google group. For example,
        -     *   `principalSet://goog/group/admins@example.com`.
        +     * `principalSet://goog/group/admins@example.com`.
        +     *
              * * `deleted:principalSet://goog/group/{group_id}?uid={uid}`: A Google group
        -     *   that was deleted recently. For example,
        -     *   `deleted:principalSet://goog/group/admins@example.com?uid=1234567890`. If
        -     *   the Google group is restored, this identifier reverts to the standard
        -     *   identifier for a Google group.
        +     * that was deleted recently. For example,
        +     * `deleted:principalSet://goog/group/admins@example.com?uid=1234567890`. If
        +     * the Google group is restored, this identifier reverts to the standard
        +     * identifier for a Google group.
        +     *
              * * `principal://iam.googleapis.com/projects/-/serviceAccounts/{service_account_id}`:
        -     *   A Google Cloud service account. For example,
        -     *   `principal://iam.googleapis.com/projects/-/serviceAccounts/my-service-account@iam.gserviceaccount.com`.
        +     * A Google Cloud service account. For example,
        +     * `principal://iam.googleapis.com/projects/-/serviceAccounts/my-service-account@iam.gserviceaccount.com`.
        +     *
              * * `deleted:principal://iam.googleapis.com/projects/-/serviceAccounts/{service_account_id}?uid={uid}`:
        -     *   A Google Cloud service account that was deleted recently. For example,
        -     *   `deleted:principal://iam.googleapis.com/projects/-/serviceAccounts/my-service-account@iam.gserviceaccount.com?uid=1234567890`.
        -     *   If the service account is undeleted, this identifier reverts to the
        -     *   standard identifier for a service account.
        +     * A Google Cloud service account that was deleted recently. For example,
        +     * `deleted:principal://iam.googleapis.com/projects/-/serviceAccounts/my-service-account@iam.gserviceaccount.com?uid=1234567890`.
        +     * If the service account is undeleted, this identifier reverts to the
        +     * standard identifier for a service account.
        +     *
              * * `principalSet://goog/cloudIdentityCustomerId/{customer_id}`: All of the
        -     *   principals associated with the specified Google Workspace or Cloud
        -     *   Identity customer ID. For example,
        -     *   `principalSet://goog/cloudIdentityCustomerId/C01Abc35`.
        +     * principals associated with the specified Google Workspace or Cloud
        +     * Identity customer ID. For example,
        +     * `principalSet://goog/cloudIdentityCustomerId/C01Abc35`.
              * 
        * * repeated string denied_principals = 1; @@ -1448,47 +1582,57 @@ public Builder addAllDeniedPrincipals(java.lang.Iterable value * @return This builder for chaining. */ public Builder clearDeniedPrincipals() { - deniedPrincipals_ = com.google.protobuf.LazyStringArrayList.EMPTY; + deniedPrincipals_ = com.google.protobuf.LazyStringArrayList.emptyList(); bitField0_ = (bitField0_ & ~0x00000001); + ; onChanged(); return this; } + /** * * *
              * The identities that are prevented from using one or more permissions on
              * Google Cloud resources. This field can contain the following values:
        +     *
              * * `principalSet://goog/public:all`: A special identifier that represents
        -     *   any principal that is on the internet, even if they do not have a Google
        -     *   Account or are not logged in.
        +     * any principal that is on the internet, even if they do not have a Google
        +     * Account or are not logged in.
        +     *
              * * `principal://goog/subject/{email_id}`: A specific Google Account.
        -     *   Includes Gmail, Cloud Identity, and Google Workspace user accounts. For
        -     *   example, `principal://goog/subject/alice@example.com`.
        +     * Includes Gmail, Cloud Identity, and Google Workspace user accounts. For
        +     * example, `principal://goog/subject/alice@example.com`.
        +     *
              * * `deleted:principal://goog/subject/{email_id}?uid={uid}`: A specific
        -     *   Google Account that was deleted recently. For example,
        -     *   `deleted:principal://goog/subject/alice@example.com?uid=1234567890`. If
        -     *   the Google Account is recovered, this identifier reverts to the standard
        -     *   identifier for a Google Account.
        +     * Google Account that was deleted recently. For example,
        +     * `deleted:principal://goog/subject/alice@example.com?uid=1234567890`. If
        +     * the Google Account is recovered, this identifier reverts to the standard
        +     * identifier for a Google Account.
        +     *
              * * `principalSet://goog/group/{group_id}`: A Google group. For example,
        -     *   `principalSet://goog/group/admins@example.com`.
        +     * `principalSet://goog/group/admins@example.com`.
        +     *
              * * `deleted:principalSet://goog/group/{group_id}?uid={uid}`: A Google group
        -     *   that was deleted recently. For example,
        -     *   `deleted:principalSet://goog/group/admins@example.com?uid=1234567890`. If
        -     *   the Google group is restored, this identifier reverts to the standard
        -     *   identifier for a Google group.
        +     * that was deleted recently. For example,
        +     * `deleted:principalSet://goog/group/admins@example.com?uid=1234567890`. If
        +     * the Google group is restored, this identifier reverts to the standard
        +     * identifier for a Google group.
        +     *
              * * `principal://iam.googleapis.com/projects/-/serviceAccounts/{service_account_id}`:
        -     *   A Google Cloud service account. For example,
        -     *   `principal://iam.googleapis.com/projects/-/serviceAccounts/my-service-account@iam.gserviceaccount.com`.
        +     * A Google Cloud service account. For example,
        +     * `principal://iam.googleapis.com/projects/-/serviceAccounts/my-service-account@iam.gserviceaccount.com`.
        +     *
              * * `deleted:principal://iam.googleapis.com/projects/-/serviceAccounts/{service_account_id}?uid={uid}`:
        -     *   A Google Cloud service account that was deleted recently. For example,
        -     *   `deleted:principal://iam.googleapis.com/projects/-/serviceAccounts/my-service-account@iam.gserviceaccount.com?uid=1234567890`.
        -     *   If the service account is undeleted, this identifier reverts to the
        -     *   standard identifier for a service account.
        +     * A Google Cloud service account that was deleted recently. For example,
        +     * `deleted:principal://iam.googleapis.com/projects/-/serviceAccounts/my-service-account@iam.gserviceaccount.com?uid=1234567890`.
        +     * If the service account is undeleted, this identifier reverts to the
        +     * standard identifier for a service account.
        +     *
              * * `principalSet://goog/cloudIdentityCustomerId/{customer_id}`: All of the
        -     *   principals associated with the specified Google Workspace or Cloud
        -     *   Identity customer ID. For example,
        -     *   `principalSet://goog/cloudIdentityCustomerId/C01Abc35`.
        +     * principals associated with the specified Google Workspace or Cloud
        +     * Identity customer ID. For example,
        +     * `principalSet://goog/cloudIdentityCustomerId/C01Abc35`.
              * 
        * * repeated string denied_principals = 1; @@ -1503,19 +1647,21 @@ public Builder addDeniedPrincipalsBytes(com.google.protobuf.ByteString value) { checkByteStringIsUtf8(value); ensureDeniedPrincipalsIsMutable(); deniedPrincipals_.add(value); + bitField0_ |= 0x00000001; onChanged(); return this; } - private com.google.protobuf.LazyStringList exceptionPrincipals_ = - com.google.protobuf.LazyStringArrayList.EMPTY; + private com.google.protobuf.LazyStringArrayList exceptionPrincipals_ = + com.google.protobuf.LazyStringArrayList.emptyList(); private void ensureExceptionPrincipalsIsMutable() { - if (!((bitField0_ & 0x00000002) != 0)) { + if (!exceptionPrincipals_.isModifiable()) { exceptionPrincipals_ = new com.google.protobuf.LazyStringArrayList(exceptionPrincipals_); - bitField0_ |= 0x00000002; } + bitField0_ |= 0x00000002; } + /** * * @@ -1524,6 +1670,7 @@ private void ensureExceptionPrincipalsIsMutable() { * listed in the `denied_principals`. For example, you could add a Google * group to the `denied_principals`, then exclude specific users who belong to * that group. + * * This field can contain the same values as the `denied_principals` field, * excluding `principalSet://goog/public:all`, which represents all users on * the internet. @@ -1534,8 +1681,10 @@ private void ensureExceptionPrincipalsIsMutable() { * @return A list containing the exceptionPrincipals. */ public com.google.protobuf.ProtocolStringList getExceptionPrincipalsList() { - return exceptionPrincipals_.getUnmodifiableView(); + exceptionPrincipals_.makeImmutable(); + return exceptionPrincipals_; } + /** * * @@ -1544,6 +1693,7 @@ public com.google.protobuf.ProtocolStringList getExceptionPrincipalsList() { * listed in the `denied_principals`. For example, you could add a Google * group to the `denied_principals`, then exclude specific users who belong to * that group. + * * This field can contain the same values as the `denied_principals` field, * excluding `principalSet://goog/public:all`, which represents all users on * the internet. @@ -1556,6 +1706,7 @@ public com.google.protobuf.ProtocolStringList getExceptionPrincipalsList() { public int getExceptionPrincipalsCount() { return exceptionPrincipals_.size(); } + /** * * @@ -1564,6 +1715,7 @@ public int getExceptionPrincipalsCount() { * listed in the `denied_principals`. For example, you could add a Google * group to the `denied_principals`, then exclude specific users who belong to * that group. + * * This field can contain the same values as the `denied_principals` field, * excluding `principalSet://goog/public:all`, which represents all users on * the internet. @@ -1577,6 +1729,7 @@ public int getExceptionPrincipalsCount() { public java.lang.String getExceptionPrincipals(int index) { return exceptionPrincipals_.get(index); } + /** * * @@ -1585,6 +1738,7 @@ public java.lang.String getExceptionPrincipals(int index) { * listed in the `denied_principals`. For example, you could add a Google * group to the `denied_principals`, then exclude specific users who belong to * that group. + * * This field can contain the same values as the `denied_principals` field, * excluding `principalSet://goog/public:all`, which represents all users on * the internet. @@ -1598,6 +1752,7 @@ public java.lang.String getExceptionPrincipals(int index) { public com.google.protobuf.ByteString getExceptionPrincipalsBytes(int index) { return exceptionPrincipals_.getByteString(index); } + /** * * @@ -1606,6 +1761,7 @@ public com.google.protobuf.ByteString getExceptionPrincipalsBytes(int index) { * listed in the `denied_principals`. For example, you could add a Google * group to the `denied_principals`, then exclude specific users who belong to * that group. + * * This field can contain the same values as the `denied_principals` field, * excluding `principalSet://goog/public:all`, which represents all users on * the internet. @@ -1623,9 +1779,11 @@ public Builder setExceptionPrincipals(int index, java.lang.String value) { } ensureExceptionPrincipalsIsMutable(); exceptionPrincipals_.set(index, value); + bitField0_ |= 0x00000002; onChanged(); return this; } + /** * * @@ -1634,6 +1792,7 @@ public Builder setExceptionPrincipals(int index, java.lang.String value) { * listed in the `denied_principals`. For example, you could add a Google * group to the `denied_principals`, then exclude specific users who belong to * that group. + * * This field can contain the same values as the `denied_principals` field, * excluding `principalSet://goog/public:all`, which represents all users on * the internet. @@ -1650,9 +1809,11 @@ public Builder addExceptionPrincipals(java.lang.String value) { } ensureExceptionPrincipalsIsMutable(); exceptionPrincipals_.add(value); + bitField0_ |= 0x00000002; onChanged(); return this; } + /** * * @@ -1661,6 +1822,7 @@ public Builder addExceptionPrincipals(java.lang.String value) { * listed in the `denied_principals`. For example, you could add a Google * group to the `denied_principals`, then exclude specific users who belong to * that group. + * * This field can contain the same values as the `denied_principals` field, * excluding `principalSet://goog/public:all`, which represents all users on * the internet. @@ -1674,9 +1836,11 @@ public Builder addExceptionPrincipals(java.lang.String value) { public Builder addAllExceptionPrincipals(java.lang.Iterable values) { ensureExceptionPrincipalsIsMutable(); com.google.protobuf.AbstractMessageLite.Builder.addAll(values, exceptionPrincipals_); + bitField0_ |= 0x00000002; onChanged(); return this; } + /** * * @@ -1685,6 +1849,7 @@ public Builder addAllExceptionPrincipals(java.lang.Iterable va * listed in the `denied_principals`. For example, you could add a Google * group to the `denied_principals`, then exclude specific users who belong to * that group. + * * This field can contain the same values as the `denied_principals` field, * excluding `principalSet://goog/public:all`, which represents all users on * the internet. @@ -1695,11 +1860,13 @@ public Builder addAllExceptionPrincipals(java.lang.Iterable va * @return This builder for chaining. */ public Builder clearExceptionPrincipals() { - exceptionPrincipals_ = com.google.protobuf.LazyStringArrayList.EMPTY; + exceptionPrincipals_ = com.google.protobuf.LazyStringArrayList.emptyList(); bitField0_ = (bitField0_ & ~0x00000002); + ; onChanged(); return this; } + /** * * @@ -1708,6 +1875,7 @@ public Builder clearExceptionPrincipals() { * listed in the `denied_principals`. For example, you could add a Google * group to the `denied_principals`, then exclude specific users who belong to * that group. + * * This field can contain the same values as the `denied_principals` field, * excluding `principalSet://goog/public:all`, which represents all users on * the internet. @@ -1725,19 +1893,21 @@ public Builder addExceptionPrincipalsBytes(com.google.protobuf.ByteString value) checkByteStringIsUtf8(value); ensureExceptionPrincipalsIsMutable(); exceptionPrincipals_.add(value); + bitField0_ |= 0x00000002; onChanged(); return this; } - private com.google.protobuf.LazyStringList deniedPermissions_ = - com.google.protobuf.LazyStringArrayList.EMPTY; + private com.google.protobuf.LazyStringArrayList deniedPermissions_ = + com.google.protobuf.LazyStringArrayList.emptyList(); private void ensureDeniedPermissionsIsMutable() { - if (!((bitField0_ & 0x00000004) != 0)) { + if (!deniedPermissions_.isModifiable()) { deniedPermissions_ = new com.google.protobuf.LazyStringArrayList(deniedPermissions_); - bitField0_ |= 0x00000004; } + bitField0_ |= 0x00000004; } + /** * * @@ -1753,8 +1923,10 @@ private void ensureDeniedPermissionsIsMutable() { * @return A list containing the deniedPermissions. */ public com.google.protobuf.ProtocolStringList getDeniedPermissionsList() { - return deniedPermissions_.getUnmodifiableView(); + deniedPermissions_.makeImmutable(); + return deniedPermissions_; } + /** * * @@ -1772,6 +1944,7 @@ public com.google.protobuf.ProtocolStringList getDeniedPermissionsList() { public int getDeniedPermissionsCount() { return deniedPermissions_.size(); } + /** * * @@ -1790,6 +1963,7 @@ public int getDeniedPermissionsCount() { public java.lang.String getDeniedPermissions(int index) { return deniedPermissions_.get(index); } + /** * * @@ -1808,6 +1982,7 @@ public java.lang.String getDeniedPermissions(int index) { public com.google.protobuf.ByteString getDeniedPermissionsBytes(int index) { return deniedPermissions_.getByteString(index); } + /** * * @@ -1830,9 +2005,11 @@ public Builder setDeniedPermissions(int index, java.lang.String value) { } ensureDeniedPermissionsIsMutable(); deniedPermissions_.set(index, value); + bitField0_ |= 0x00000004; onChanged(); return this; } + /** * * @@ -1854,9 +2031,11 @@ public Builder addDeniedPermissions(java.lang.String value) { } ensureDeniedPermissionsIsMutable(); deniedPermissions_.add(value); + bitField0_ |= 0x00000004; onChanged(); return this; } + /** * * @@ -1875,9 +2054,11 @@ public Builder addDeniedPermissions(java.lang.String value) { public Builder addAllDeniedPermissions(java.lang.Iterable values) { ensureDeniedPermissionsIsMutable(); com.google.protobuf.AbstractMessageLite.Builder.addAll(values, deniedPermissions_); + bitField0_ |= 0x00000004; onChanged(); return this; } + /** * * @@ -1893,11 +2074,13 @@ public Builder addAllDeniedPermissions(java.lang.Iterable valu * @return This builder for chaining. */ public Builder clearDeniedPermissions() { - deniedPermissions_ = com.google.protobuf.LazyStringArrayList.EMPTY; + deniedPermissions_ = com.google.protobuf.LazyStringArrayList.emptyList(); bitField0_ = (bitField0_ & ~0x00000004); + ; onChanged(); return this; } + /** * * @@ -1920,19 +2103,21 @@ public Builder addDeniedPermissionsBytes(com.google.protobuf.ByteString value) { checkByteStringIsUtf8(value); ensureDeniedPermissionsIsMutable(); deniedPermissions_.add(value); + bitField0_ |= 0x00000004; onChanged(); return this; } - private com.google.protobuf.LazyStringList exceptionPermissions_ = - com.google.protobuf.LazyStringArrayList.EMPTY; + private com.google.protobuf.LazyStringArrayList exceptionPermissions_ = + com.google.protobuf.LazyStringArrayList.emptyList(); private void ensureExceptionPermissionsIsMutable() { - if (!((bitField0_ & 0x00000008) != 0)) { + if (!exceptionPermissions_.isModifiable()) { exceptionPermissions_ = new com.google.protobuf.LazyStringArrayList(exceptionPermissions_); - bitField0_ |= 0x00000008; } + bitField0_ |= 0x00000008; } + /** * * @@ -1941,6 +2126,7 @@ private void ensureExceptionPermissionsIsMutable() { * permissions given by `denied_permissions`. If a permission appears in * `denied_permissions` _and_ in `exception_permissions` then it will _not_ be * denied. + * * The excluded permissions can be specified using the same syntax as * `denied_permissions`. * @@ -1950,8 +2136,10 @@ private void ensureExceptionPermissionsIsMutable() { * @return A list containing the exceptionPermissions. */ public com.google.protobuf.ProtocolStringList getExceptionPermissionsList() { - return exceptionPermissions_.getUnmodifiableView(); + exceptionPermissions_.makeImmutable(); + return exceptionPermissions_; } + /** * * @@ -1960,6 +2148,7 @@ public com.google.protobuf.ProtocolStringList getExceptionPermissionsList() { * permissions given by `denied_permissions`. If a permission appears in * `denied_permissions` _and_ in `exception_permissions` then it will _not_ be * denied. + * * The excluded permissions can be specified using the same syntax as * `denied_permissions`. * @@ -1971,6 +2160,7 @@ public com.google.protobuf.ProtocolStringList getExceptionPermissionsList() { public int getExceptionPermissionsCount() { return exceptionPermissions_.size(); } + /** * * @@ -1979,6 +2169,7 @@ public int getExceptionPermissionsCount() { * permissions given by `denied_permissions`. If a permission appears in * `denied_permissions` _and_ in `exception_permissions` then it will _not_ be * denied. + * * The excluded permissions can be specified using the same syntax as * `denied_permissions`. * @@ -1991,6 +2182,7 @@ public int getExceptionPermissionsCount() { public java.lang.String getExceptionPermissions(int index) { return exceptionPermissions_.get(index); } + /** * * @@ -1999,6 +2191,7 @@ public java.lang.String getExceptionPermissions(int index) { * permissions given by `denied_permissions`. If a permission appears in * `denied_permissions` _and_ in `exception_permissions` then it will _not_ be * denied. + * * The excluded permissions can be specified using the same syntax as * `denied_permissions`. * @@ -2011,6 +2204,7 @@ public java.lang.String getExceptionPermissions(int index) { public com.google.protobuf.ByteString getExceptionPermissionsBytes(int index) { return exceptionPermissions_.getByteString(index); } + /** * * @@ -2019,6 +2213,7 @@ public com.google.protobuf.ByteString getExceptionPermissionsBytes(int index) { * permissions given by `denied_permissions`. If a permission appears in * `denied_permissions` _and_ in `exception_permissions` then it will _not_ be * denied. + * * The excluded permissions can be specified using the same syntax as * `denied_permissions`. * @@ -2035,9 +2230,11 @@ public Builder setExceptionPermissions(int index, java.lang.String value) { } ensureExceptionPermissionsIsMutable(); exceptionPermissions_.set(index, value); + bitField0_ |= 0x00000008; onChanged(); return this; } + /** * * @@ -2046,6 +2243,7 @@ public Builder setExceptionPermissions(int index, java.lang.String value) { * permissions given by `denied_permissions`. If a permission appears in * `denied_permissions` _and_ in `exception_permissions` then it will _not_ be * denied. + * * The excluded permissions can be specified using the same syntax as * `denied_permissions`. * @@ -2061,9 +2259,11 @@ public Builder addExceptionPermissions(java.lang.String value) { } ensureExceptionPermissionsIsMutable(); exceptionPermissions_.add(value); + bitField0_ |= 0x00000008; onChanged(); return this; } + /** * * @@ -2072,6 +2272,7 @@ public Builder addExceptionPermissions(java.lang.String value) { * permissions given by `denied_permissions`. If a permission appears in * `denied_permissions` _and_ in `exception_permissions` then it will _not_ be * denied. + * * The excluded permissions can be specified using the same syntax as * `denied_permissions`. * @@ -2084,9 +2285,11 @@ public Builder addExceptionPermissions(java.lang.String value) { public Builder addAllExceptionPermissions(java.lang.Iterable values) { ensureExceptionPermissionsIsMutable(); com.google.protobuf.AbstractMessageLite.Builder.addAll(values, exceptionPermissions_); + bitField0_ |= 0x00000008; onChanged(); return this; } + /** * * @@ -2095,6 +2298,7 @@ public Builder addAllExceptionPermissions(java.lang.Iterable v * permissions given by `denied_permissions`. If a permission appears in * `denied_permissions` _and_ in `exception_permissions` then it will _not_ be * denied. + * * The excluded permissions can be specified using the same syntax as * `denied_permissions`. * @@ -2104,11 +2308,13 @@ public Builder addAllExceptionPermissions(java.lang.Iterable v * @return This builder for chaining. */ public Builder clearExceptionPermissions() { - exceptionPermissions_ = com.google.protobuf.LazyStringArrayList.EMPTY; + exceptionPermissions_ = com.google.protobuf.LazyStringArrayList.emptyList(); bitField0_ = (bitField0_ & ~0x00000008); + ; onChanged(); return this; } + /** * * @@ -2117,6 +2323,7 @@ public Builder clearExceptionPermissions() { * permissions given by `denied_permissions`. If a permission appears in * `denied_permissions` _and_ in `exception_permissions` then it will _not_ be * denied. + * * The excluded permissions can be specified using the same syntax as * `denied_permissions`. * @@ -2133,14 +2340,16 @@ public Builder addExceptionPermissionsBytes(com.google.protobuf.ByteString value checkByteStringIsUtf8(value); ensureExceptionPermissionsIsMutable(); exceptionPermissions_.add(value); + bitField0_ |= 0x00000008; onChanged(); return this; } private com.google.type.Expr denialCondition_; - private com.google.protobuf.SingleFieldBuilderV3< + private com.google.protobuf.SingleFieldBuilder< com.google.type.Expr, com.google.type.Expr.Builder, com.google.type.ExprOrBuilder> denialConditionBuilder_; + /** * * @@ -2148,8 +2357,10 @@ public Builder addExceptionPermissionsBytes(com.google.protobuf.ByteString value * The condition that determines whether this deny rule applies to a request. * If the condition expression evaluates to `true`, then the deny rule is * applied; otherwise, the deny rule is not applied. + * * Each deny rule is evaluated independently. If this deny rule does not apply * to a request, other deny rules might still apply. + * * The condition can use CEL functions that evaluate * [resource * tags](https://cloud.google.com/iam/help/conditions/resource-tags). Other @@ -2161,8 +2372,9 @@ public Builder addExceptionPermissionsBytes(com.google.protobuf.ByteString value * @return Whether the denialCondition field is set. */ public boolean hasDenialCondition() { - return denialConditionBuilder_ != null || denialCondition_ != null; + return ((bitField0_ & 0x00000010) != 0); } + /** * * @@ -2170,8 +2382,10 @@ public boolean hasDenialCondition() { * The condition that determines whether this deny rule applies to a request. * If the condition expression evaluates to `true`, then the deny rule is * applied; otherwise, the deny rule is not applied. + * * Each deny rule is evaluated independently. If this deny rule does not apply * to a request, other deny rules might still apply. + * * The condition can use CEL functions that evaluate * [resource * tags](https://cloud.google.com/iam/help/conditions/resource-tags). Other @@ -2191,6 +2405,7 @@ public com.google.type.Expr getDenialCondition() { return denialConditionBuilder_.getMessage(); } } + /** * * @@ -2198,8 +2413,10 @@ public com.google.type.Expr getDenialCondition() { * The condition that determines whether this deny rule applies to a request. * If the condition expression evaluates to `true`, then the deny rule is * applied; otherwise, the deny rule is not applied. + * * Each deny rule is evaluated independently. If this deny rule does not apply * to a request, other deny rules might still apply. + * * The condition can use CEL functions that evaluate * [resource * tags](https://cloud.google.com/iam/help/conditions/resource-tags). Other @@ -2214,13 +2431,14 @@ public Builder setDenialCondition(com.google.type.Expr value) { throw new NullPointerException(); } denialCondition_ = value; - onChanged(); } else { denialConditionBuilder_.setMessage(value); } - + bitField0_ |= 0x00000010; + onChanged(); return this; } + /** * * @@ -2228,8 +2446,10 @@ public Builder setDenialCondition(com.google.type.Expr value) { * The condition that determines whether this deny rule applies to a request. * If the condition expression evaluates to `true`, then the deny rule is * applied; otherwise, the deny rule is not applied. + * * Each deny rule is evaluated independently. If this deny rule does not apply * to a request, other deny rules might still apply. + * * The condition can use CEL functions that evaluate * [resource * tags](https://cloud.google.com/iam/help/conditions/resource-tags). Other @@ -2241,13 +2461,14 @@ public Builder setDenialCondition(com.google.type.Expr value) { public Builder setDenialCondition(com.google.type.Expr.Builder builderForValue) { if (denialConditionBuilder_ == null) { denialCondition_ = builderForValue.build(); - onChanged(); } else { denialConditionBuilder_.setMessage(builderForValue.build()); } - + bitField0_ |= 0x00000010; + onChanged(); return this; } + /** * * @@ -2255,8 +2476,10 @@ public Builder setDenialCondition(com.google.type.Expr.Builder builderForValue) * The condition that determines whether this deny rule applies to a request. * If the condition expression evaluates to `true`, then the deny rule is * applied; otherwise, the deny rule is not applied. + * * Each deny rule is evaluated independently. If this deny rule does not apply * to a request, other deny rules might still apply. + * * The condition can use CEL functions that evaluate * [resource * tags](https://cloud.google.com/iam/help/conditions/resource-tags). Other @@ -2267,19 +2490,23 @@ public Builder setDenialCondition(com.google.type.Expr.Builder builderForValue) */ public Builder mergeDenialCondition(com.google.type.Expr value) { if (denialConditionBuilder_ == null) { - if (denialCondition_ != null) { - denialCondition_ = - com.google.type.Expr.newBuilder(denialCondition_).mergeFrom(value).buildPartial(); + if (((bitField0_ & 0x00000010) != 0) + && denialCondition_ != null + && denialCondition_ != com.google.type.Expr.getDefaultInstance()) { + getDenialConditionBuilder().mergeFrom(value); } else { denialCondition_ = value; } - onChanged(); } else { denialConditionBuilder_.mergeFrom(value); } - + if (denialCondition_ != null) { + bitField0_ |= 0x00000010; + onChanged(); + } return this; } + /** * * @@ -2287,8 +2514,10 @@ public Builder mergeDenialCondition(com.google.type.Expr value) { * The condition that determines whether this deny rule applies to a request. * If the condition expression evaluates to `true`, then the deny rule is * applied; otherwise, the deny rule is not applied. + * * Each deny rule is evaluated independently. If this deny rule does not apply * to a request, other deny rules might still apply. + * * The condition can use CEL functions that evaluate * [resource * tags](https://cloud.google.com/iam/help/conditions/resource-tags). Other @@ -2298,16 +2527,16 @@ public Builder mergeDenialCondition(com.google.type.Expr value) { * .google.type.Expr denial_condition = 5; */ public Builder clearDenialCondition() { - if (denialConditionBuilder_ == null) { - denialCondition_ = null; - onChanged(); - } else { - denialCondition_ = null; + bitField0_ = (bitField0_ & ~0x00000010); + denialCondition_ = null; + if (denialConditionBuilder_ != null) { + denialConditionBuilder_.dispose(); denialConditionBuilder_ = null; } - + onChanged(); return this; } + /** * * @@ -2315,8 +2544,10 @@ public Builder clearDenialCondition() { * The condition that determines whether this deny rule applies to a request. * If the condition expression evaluates to `true`, then the deny rule is * applied; otherwise, the deny rule is not applied. + * * Each deny rule is evaluated independently. If this deny rule does not apply * to a request, other deny rules might still apply. + * * The condition can use CEL functions that evaluate * [resource * tags](https://cloud.google.com/iam/help/conditions/resource-tags). Other @@ -2326,10 +2557,11 @@ public Builder clearDenialCondition() { * .google.type.Expr denial_condition = 5; */ public com.google.type.Expr.Builder getDenialConditionBuilder() { - + bitField0_ |= 0x00000010; onChanged(); - return getDenialConditionFieldBuilder().getBuilder(); + return internalGetDenialConditionFieldBuilder().getBuilder(); } + /** * * @@ -2337,8 +2569,10 @@ public com.google.type.Expr.Builder getDenialConditionBuilder() { * The condition that determines whether this deny rule applies to a request. * If the condition expression evaluates to `true`, then the deny rule is * applied; otherwise, the deny rule is not applied. + * * Each deny rule is evaluated independently. If this deny rule does not apply * to a request, other deny rules might still apply. + * * The condition can use CEL functions that evaluate * [resource * tags](https://cloud.google.com/iam/help/conditions/resource-tags). Other @@ -2356,6 +2590,7 @@ public com.google.type.ExprOrBuilder getDenialConditionOrBuilder() { : denialCondition_; } } + /** * * @@ -2363,8 +2598,10 @@ public com.google.type.ExprOrBuilder getDenialConditionOrBuilder() { * The condition that determines whether this deny rule applies to a request. * If the condition expression evaluates to `true`, then the deny rule is * applied; otherwise, the deny rule is not applied. + * * Each deny rule is evaluated independently. If this deny rule does not apply * to a request, other deny rules might still apply. + * * The condition can use CEL functions that evaluate * [resource * tags](https://cloud.google.com/iam/help/conditions/resource-tags). Other @@ -2373,12 +2610,12 @@ public com.google.type.ExprOrBuilder getDenialConditionOrBuilder() { * * .google.type.Expr denial_condition = 5; */ - private com.google.protobuf.SingleFieldBuilderV3< + private com.google.protobuf.SingleFieldBuilder< com.google.type.Expr, com.google.type.Expr.Builder, com.google.type.ExprOrBuilder> - getDenialConditionFieldBuilder() { + internalGetDenialConditionFieldBuilder() { if (denialConditionBuilder_ == null) { denialConditionBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< + new com.google.protobuf.SingleFieldBuilder< com.google.type.Expr, com.google.type.Expr.Builder, com.google.type.ExprOrBuilder>( getDenialCondition(), getParentForChildren(), isClean()); denialCondition_ = null; @@ -2386,17 +2623,6 @@ public com.google.type.ExprOrBuilder getDenialConditionOrBuilder() { return denialConditionBuilder_; } - @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.iam.v2.DenyRule) } diff --git a/java-iam/proto-google-iam-v2/src/main/java/com/google/iam/v2/DenyRuleOrBuilder.java b/java-iam/proto-google-iam-v2/src/main/java/com/google/iam/v2/DenyRuleOrBuilder.java index 1d35367fb8..1f14f99ffd 100644 --- a/java-iam/proto-google-iam-v2/src/main/java/com/google/iam/v2/DenyRuleOrBuilder.java +++ b/java-iam/proto-google-iam-v2/src/main/java/com/google/iam/v2/DenyRuleOrBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,10 +14,13 @@ * limitations under the License. */ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: google/iam/v2/deny.proto +// Protobuf Java Version: 4.33.2 package com.google.iam.v2; +@com.google.protobuf.Generated public interface DenyRuleOrBuilder extends // @@protoc_insertion_point(interface_extends:google.iam.v2.DenyRule) @@ -29,36 +32,44 @@ public interface DenyRuleOrBuilder *
            * The identities that are prevented from using one or more permissions on
            * Google Cloud resources. This field can contain the following values:
        +   *
            * * `principalSet://goog/public:all`: A special identifier that represents
        -   *   any principal that is on the internet, even if they do not have a Google
        -   *   Account or are not logged in.
        +   * any principal that is on the internet, even if they do not have a Google
        +   * Account or are not logged in.
        +   *
            * * `principal://goog/subject/{email_id}`: A specific Google Account.
        -   *   Includes Gmail, Cloud Identity, and Google Workspace user accounts. For
        -   *   example, `principal://goog/subject/alice@example.com`.
        +   * Includes Gmail, Cloud Identity, and Google Workspace user accounts. For
        +   * example, `principal://goog/subject/alice@example.com`.
        +   *
            * * `deleted:principal://goog/subject/{email_id}?uid={uid}`: A specific
        -   *   Google Account that was deleted recently. For example,
        -   *   `deleted:principal://goog/subject/alice@example.com?uid=1234567890`. If
        -   *   the Google Account is recovered, this identifier reverts to the standard
        -   *   identifier for a Google Account.
        +   * Google Account that was deleted recently. For example,
        +   * `deleted:principal://goog/subject/alice@example.com?uid=1234567890`. If
        +   * the Google Account is recovered, this identifier reverts to the standard
        +   * identifier for a Google Account.
        +   *
            * * `principalSet://goog/group/{group_id}`: A Google group. For example,
        -   *   `principalSet://goog/group/admins@example.com`.
        +   * `principalSet://goog/group/admins@example.com`.
        +   *
            * * `deleted:principalSet://goog/group/{group_id}?uid={uid}`: A Google group
        -   *   that was deleted recently. For example,
        -   *   `deleted:principalSet://goog/group/admins@example.com?uid=1234567890`. If
        -   *   the Google group is restored, this identifier reverts to the standard
        -   *   identifier for a Google group.
        +   * that was deleted recently. For example,
        +   * `deleted:principalSet://goog/group/admins@example.com?uid=1234567890`. If
        +   * the Google group is restored, this identifier reverts to the standard
        +   * identifier for a Google group.
        +   *
            * * `principal://iam.googleapis.com/projects/-/serviceAccounts/{service_account_id}`:
        -   *   A Google Cloud service account. For example,
        -   *   `principal://iam.googleapis.com/projects/-/serviceAccounts/my-service-account@iam.gserviceaccount.com`.
        +   * A Google Cloud service account. For example,
        +   * `principal://iam.googleapis.com/projects/-/serviceAccounts/my-service-account@iam.gserviceaccount.com`.
        +   *
            * * `deleted:principal://iam.googleapis.com/projects/-/serviceAccounts/{service_account_id}?uid={uid}`:
        -   *   A Google Cloud service account that was deleted recently. For example,
        -   *   `deleted:principal://iam.googleapis.com/projects/-/serviceAccounts/my-service-account@iam.gserviceaccount.com?uid=1234567890`.
        -   *   If the service account is undeleted, this identifier reverts to the
        -   *   standard identifier for a service account.
        +   * A Google Cloud service account that was deleted recently. For example,
        +   * `deleted:principal://iam.googleapis.com/projects/-/serviceAccounts/my-service-account@iam.gserviceaccount.com?uid=1234567890`.
        +   * If the service account is undeleted, this identifier reverts to the
        +   * standard identifier for a service account.
        +   *
            * * `principalSet://goog/cloudIdentityCustomerId/{customer_id}`: All of the
        -   *   principals associated with the specified Google Workspace or Cloud
        -   *   Identity customer ID. For example,
        -   *   `principalSet://goog/cloudIdentityCustomerId/C01Abc35`.
        +   * principals associated with the specified Google Workspace or Cloud
        +   * Identity customer ID. For example,
        +   * `principalSet://goog/cloudIdentityCustomerId/C01Abc35`.
            * 
        * * repeated string denied_principals = 1; @@ -66,42 +77,51 @@ public interface DenyRuleOrBuilder * @return A list containing the deniedPrincipals. */ java.util.List getDeniedPrincipalsList(); + /** * * *
            * The identities that are prevented from using one or more permissions on
            * Google Cloud resources. This field can contain the following values:
        +   *
            * * `principalSet://goog/public:all`: A special identifier that represents
        -   *   any principal that is on the internet, even if they do not have a Google
        -   *   Account or are not logged in.
        +   * any principal that is on the internet, even if they do not have a Google
        +   * Account or are not logged in.
        +   *
            * * `principal://goog/subject/{email_id}`: A specific Google Account.
        -   *   Includes Gmail, Cloud Identity, and Google Workspace user accounts. For
        -   *   example, `principal://goog/subject/alice@example.com`.
        +   * Includes Gmail, Cloud Identity, and Google Workspace user accounts. For
        +   * example, `principal://goog/subject/alice@example.com`.
        +   *
            * * `deleted:principal://goog/subject/{email_id}?uid={uid}`: A specific
        -   *   Google Account that was deleted recently. For example,
        -   *   `deleted:principal://goog/subject/alice@example.com?uid=1234567890`. If
        -   *   the Google Account is recovered, this identifier reverts to the standard
        -   *   identifier for a Google Account.
        +   * Google Account that was deleted recently. For example,
        +   * `deleted:principal://goog/subject/alice@example.com?uid=1234567890`. If
        +   * the Google Account is recovered, this identifier reverts to the standard
        +   * identifier for a Google Account.
        +   *
            * * `principalSet://goog/group/{group_id}`: A Google group. For example,
        -   *   `principalSet://goog/group/admins@example.com`.
        +   * `principalSet://goog/group/admins@example.com`.
        +   *
            * * `deleted:principalSet://goog/group/{group_id}?uid={uid}`: A Google group
        -   *   that was deleted recently. For example,
        -   *   `deleted:principalSet://goog/group/admins@example.com?uid=1234567890`. If
        -   *   the Google group is restored, this identifier reverts to the standard
        -   *   identifier for a Google group.
        +   * that was deleted recently. For example,
        +   * `deleted:principalSet://goog/group/admins@example.com?uid=1234567890`. If
        +   * the Google group is restored, this identifier reverts to the standard
        +   * identifier for a Google group.
        +   *
            * * `principal://iam.googleapis.com/projects/-/serviceAccounts/{service_account_id}`:
        -   *   A Google Cloud service account. For example,
        -   *   `principal://iam.googleapis.com/projects/-/serviceAccounts/my-service-account@iam.gserviceaccount.com`.
        +   * A Google Cloud service account. For example,
        +   * `principal://iam.googleapis.com/projects/-/serviceAccounts/my-service-account@iam.gserviceaccount.com`.
        +   *
            * * `deleted:principal://iam.googleapis.com/projects/-/serviceAccounts/{service_account_id}?uid={uid}`:
        -   *   A Google Cloud service account that was deleted recently. For example,
        -   *   `deleted:principal://iam.googleapis.com/projects/-/serviceAccounts/my-service-account@iam.gserviceaccount.com?uid=1234567890`.
        -   *   If the service account is undeleted, this identifier reverts to the
        -   *   standard identifier for a service account.
        +   * A Google Cloud service account that was deleted recently. For example,
        +   * `deleted:principal://iam.googleapis.com/projects/-/serviceAccounts/my-service-account@iam.gserviceaccount.com?uid=1234567890`.
        +   * If the service account is undeleted, this identifier reverts to the
        +   * standard identifier for a service account.
        +   *
            * * `principalSet://goog/cloudIdentityCustomerId/{customer_id}`: All of the
        -   *   principals associated with the specified Google Workspace or Cloud
        -   *   Identity customer ID. For example,
        -   *   `principalSet://goog/cloudIdentityCustomerId/C01Abc35`.
        +   * principals associated with the specified Google Workspace or Cloud
        +   * Identity customer ID. For example,
        +   * `principalSet://goog/cloudIdentityCustomerId/C01Abc35`.
            * 
        * * repeated string denied_principals = 1; @@ -109,42 +129,51 @@ public interface DenyRuleOrBuilder * @return The count of deniedPrincipals. */ int getDeniedPrincipalsCount(); + /** * * *
            * The identities that are prevented from using one or more permissions on
            * Google Cloud resources. This field can contain the following values:
        +   *
            * * `principalSet://goog/public:all`: A special identifier that represents
        -   *   any principal that is on the internet, even if they do not have a Google
        -   *   Account or are not logged in.
        +   * any principal that is on the internet, even if they do not have a Google
        +   * Account or are not logged in.
        +   *
            * * `principal://goog/subject/{email_id}`: A specific Google Account.
        -   *   Includes Gmail, Cloud Identity, and Google Workspace user accounts. For
        -   *   example, `principal://goog/subject/alice@example.com`.
        +   * Includes Gmail, Cloud Identity, and Google Workspace user accounts. For
        +   * example, `principal://goog/subject/alice@example.com`.
        +   *
            * * `deleted:principal://goog/subject/{email_id}?uid={uid}`: A specific
        -   *   Google Account that was deleted recently. For example,
        -   *   `deleted:principal://goog/subject/alice@example.com?uid=1234567890`. If
        -   *   the Google Account is recovered, this identifier reverts to the standard
        -   *   identifier for a Google Account.
        +   * Google Account that was deleted recently. For example,
        +   * `deleted:principal://goog/subject/alice@example.com?uid=1234567890`. If
        +   * the Google Account is recovered, this identifier reverts to the standard
        +   * identifier for a Google Account.
        +   *
            * * `principalSet://goog/group/{group_id}`: A Google group. For example,
        -   *   `principalSet://goog/group/admins@example.com`.
        +   * `principalSet://goog/group/admins@example.com`.
        +   *
            * * `deleted:principalSet://goog/group/{group_id}?uid={uid}`: A Google group
        -   *   that was deleted recently. For example,
        -   *   `deleted:principalSet://goog/group/admins@example.com?uid=1234567890`. If
        -   *   the Google group is restored, this identifier reverts to the standard
        -   *   identifier for a Google group.
        +   * that was deleted recently. For example,
        +   * `deleted:principalSet://goog/group/admins@example.com?uid=1234567890`. If
        +   * the Google group is restored, this identifier reverts to the standard
        +   * identifier for a Google group.
        +   *
            * * `principal://iam.googleapis.com/projects/-/serviceAccounts/{service_account_id}`:
        -   *   A Google Cloud service account. For example,
        -   *   `principal://iam.googleapis.com/projects/-/serviceAccounts/my-service-account@iam.gserviceaccount.com`.
        +   * A Google Cloud service account. For example,
        +   * `principal://iam.googleapis.com/projects/-/serviceAccounts/my-service-account@iam.gserviceaccount.com`.
        +   *
            * * `deleted:principal://iam.googleapis.com/projects/-/serviceAccounts/{service_account_id}?uid={uid}`:
        -   *   A Google Cloud service account that was deleted recently. For example,
        -   *   `deleted:principal://iam.googleapis.com/projects/-/serviceAccounts/my-service-account@iam.gserviceaccount.com?uid=1234567890`.
        -   *   If the service account is undeleted, this identifier reverts to the
        -   *   standard identifier for a service account.
        +   * A Google Cloud service account that was deleted recently. For example,
        +   * `deleted:principal://iam.googleapis.com/projects/-/serviceAccounts/my-service-account@iam.gserviceaccount.com?uid=1234567890`.
        +   * If the service account is undeleted, this identifier reverts to the
        +   * standard identifier for a service account.
        +   *
            * * `principalSet://goog/cloudIdentityCustomerId/{customer_id}`: All of the
        -   *   principals associated with the specified Google Workspace or Cloud
        -   *   Identity customer ID. For example,
        -   *   `principalSet://goog/cloudIdentityCustomerId/C01Abc35`.
        +   * principals associated with the specified Google Workspace or Cloud
        +   * Identity customer ID. For example,
        +   * `principalSet://goog/cloudIdentityCustomerId/C01Abc35`.
            * 
        * * repeated string denied_principals = 1; @@ -153,42 +182,51 @@ public interface DenyRuleOrBuilder * @return The deniedPrincipals at the given index. */ java.lang.String getDeniedPrincipals(int index); + /** * * *
            * The identities that are prevented from using one or more permissions on
            * Google Cloud resources. This field can contain the following values:
        +   *
            * * `principalSet://goog/public:all`: A special identifier that represents
        -   *   any principal that is on the internet, even if they do not have a Google
        -   *   Account or are not logged in.
        +   * any principal that is on the internet, even if they do not have a Google
        +   * Account or are not logged in.
        +   *
            * * `principal://goog/subject/{email_id}`: A specific Google Account.
        -   *   Includes Gmail, Cloud Identity, and Google Workspace user accounts. For
        -   *   example, `principal://goog/subject/alice@example.com`.
        +   * Includes Gmail, Cloud Identity, and Google Workspace user accounts. For
        +   * example, `principal://goog/subject/alice@example.com`.
        +   *
            * * `deleted:principal://goog/subject/{email_id}?uid={uid}`: A specific
        -   *   Google Account that was deleted recently. For example,
        -   *   `deleted:principal://goog/subject/alice@example.com?uid=1234567890`. If
        -   *   the Google Account is recovered, this identifier reverts to the standard
        -   *   identifier for a Google Account.
        +   * Google Account that was deleted recently. For example,
        +   * `deleted:principal://goog/subject/alice@example.com?uid=1234567890`. If
        +   * the Google Account is recovered, this identifier reverts to the standard
        +   * identifier for a Google Account.
        +   *
            * * `principalSet://goog/group/{group_id}`: A Google group. For example,
        -   *   `principalSet://goog/group/admins@example.com`.
        +   * `principalSet://goog/group/admins@example.com`.
        +   *
            * * `deleted:principalSet://goog/group/{group_id}?uid={uid}`: A Google group
        -   *   that was deleted recently. For example,
        -   *   `deleted:principalSet://goog/group/admins@example.com?uid=1234567890`. If
        -   *   the Google group is restored, this identifier reverts to the standard
        -   *   identifier for a Google group.
        +   * that was deleted recently. For example,
        +   * `deleted:principalSet://goog/group/admins@example.com?uid=1234567890`. If
        +   * the Google group is restored, this identifier reverts to the standard
        +   * identifier for a Google group.
        +   *
            * * `principal://iam.googleapis.com/projects/-/serviceAccounts/{service_account_id}`:
        -   *   A Google Cloud service account. For example,
        -   *   `principal://iam.googleapis.com/projects/-/serviceAccounts/my-service-account@iam.gserviceaccount.com`.
        +   * A Google Cloud service account. For example,
        +   * `principal://iam.googleapis.com/projects/-/serviceAccounts/my-service-account@iam.gserviceaccount.com`.
        +   *
            * * `deleted:principal://iam.googleapis.com/projects/-/serviceAccounts/{service_account_id}?uid={uid}`:
        -   *   A Google Cloud service account that was deleted recently. For example,
        -   *   `deleted:principal://iam.googleapis.com/projects/-/serviceAccounts/my-service-account@iam.gserviceaccount.com?uid=1234567890`.
        -   *   If the service account is undeleted, this identifier reverts to the
        -   *   standard identifier for a service account.
        +   * A Google Cloud service account that was deleted recently. For example,
        +   * `deleted:principal://iam.googleapis.com/projects/-/serviceAccounts/my-service-account@iam.gserviceaccount.com?uid=1234567890`.
        +   * If the service account is undeleted, this identifier reverts to the
        +   * standard identifier for a service account.
        +   *
            * * `principalSet://goog/cloudIdentityCustomerId/{customer_id}`: All of the
        -   *   principals associated with the specified Google Workspace or Cloud
        -   *   Identity customer ID. For example,
        -   *   `principalSet://goog/cloudIdentityCustomerId/C01Abc35`.
        +   * principals associated with the specified Google Workspace or Cloud
        +   * Identity customer ID. For example,
        +   * `principalSet://goog/cloudIdentityCustomerId/C01Abc35`.
            * 
        * * repeated string denied_principals = 1; @@ -206,6 +244,7 @@ public interface DenyRuleOrBuilder * listed in the `denied_principals`. For example, you could add a Google * group to the `denied_principals`, then exclude specific users who belong to * that group. + * * This field can contain the same values as the `denied_principals` field, * excluding `principalSet://goog/public:all`, which represents all users on * the internet. @@ -216,6 +255,7 @@ public interface DenyRuleOrBuilder * @return A list containing the exceptionPrincipals. */ java.util.List getExceptionPrincipalsList(); + /** * * @@ -224,6 +264,7 @@ public interface DenyRuleOrBuilder * listed in the `denied_principals`. For example, you could add a Google * group to the `denied_principals`, then exclude specific users who belong to * that group. + * * This field can contain the same values as the `denied_principals` field, * excluding `principalSet://goog/public:all`, which represents all users on * the internet. @@ -234,6 +275,7 @@ public interface DenyRuleOrBuilder * @return The count of exceptionPrincipals. */ int getExceptionPrincipalsCount(); + /** * * @@ -242,6 +284,7 @@ public interface DenyRuleOrBuilder * listed in the `denied_principals`. For example, you could add a Google * group to the `denied_principals`, then exclude specific users who belong to * that group. + * * This field can contain the same values as the `denied_principals` field, * excluding `principalSet://goog/public:all`, which represents all users on * the internet. @@ -253,6 +296,7 @@ public interface DenyRuleOrBuilder * @return The exceptionPrincipals at the given index. */ java.lang.String getExceptionPrincipals(int index); + /** * * @@ -261,6 +305,7 @@ public interface DenyRuleOrBuilder * listed in the `denied_principals`. For example, you could add a Google * group to the `denied_principals`, then exclude specific users who belong to * that group. + * * This field can contain the same values as the `denied_principals` field, * excluding `principalSet://goog/public:all`, which represents all users on * the internet. @@ -288,6 +333,7 @@ public interface DenyRuleOrBuilder * @return A list containing the deniedPermissions. */ java.util.List getDeniedPermissionsList(); + /** * * @@ -303,6 +349,7 @@ public interface DenyRuleOrBuilder * @return The count of deniedPermissions. */ int getDeniedPermissionsCount(); + /** * * @@ -319,6 +366,7 @@ public interface DenyRuleOrBuilder * @return The deniedPermissions at the given index. */ java.lang.String getDeniedPermissions(int index); + /** * * @@ -344,6 +392,7 @@ public interface DenyRuleOrBuilder * permissions given by `denied_permissions`. If a permission appears in * `denied_permissions` _and_ in `exception_permissions` then it will _not_ be * denied. + * * The excluded permissions can be specified using the same syntax as * `denied_permissions`. * @@ -353,6 +402,7 @@ public interface DenyRuleOrBuilder * @return A list containing the exceptionPermissions. */ java.util.List getExceptionPermissionsList(); + /** * * @@ -361,6 +411,7 @@ public interface DenyRuleOrBuilder * permissions given by `denied_permissions`. If a permission appears in * `denied_permissions` _and_ in `exception_permissions` then it will _not_ be * denied. + * * The excluded permissions can be specified using the same syntax as * `denied_permissions`. * @@ -370,6 +421,7 @@ public interface DenyRuleOrBuilder * @return The count of exceptionPermissions. */ int getExceptionPermissionsCount(); + /** * * @@ -378,6 +430,7 @@ public interface DenyRuleOrBuilder * permissions given by `denied_permissions`. If a permission appears in * `denied_permissions` _and_ in `exception_permissions` then it will _not_ be * denied. + * * The excluded permissions can be specified using the same syntax as * `denied_permissions`. * @@ -388,6 +441,7 @@ public interface DenyRuleOrBuilder * @return The exceptionPermissions at the given index. */ java.lang.String getExceptionPermissions(int index); + /** * * @@ -396,6 +450,7 @@ public interface DenyRuleOrBuilder * permissions given by `denied_permissions`. If a permission appears in * `denied_permissions` _and_ in `exception_permissions` then it will _not_ be * denied. + * * The excluded permissions can be specified using the same syntax as * `denied_permissions`. * @@ -414,8 +469,10 @@ public interface DenyRuleOrBuilder * The condition that determines whether this deny rule applies to a request. * If the condition expression evaluates to `true`, then the deny rule is * applied; otherwise, the deny rule is not applied. + * * Each deny rule is evaluated independently. If this deny rule does not apply * to a request, other deny rules might still apply. + * * The condition can use CEL functions that evaluate * [resource * tags](https://cloud.google.com/iam/help/conditions/resource-tags). Other @@ -427,6 +484,7 @@ public interface DenyRuleOrBuilder * @return Whether the denialCondition field is set. */ boolean hasDenialCondition(); + /** * * @@ -434,8 +492,10 @@ public interface DenyRuleOrBuilder * The condition that determines whether this deny rule applies to a request. * If the condition expression evaluates to `true`, then the deny rule is * applied; otherwise, the deny rule is not applied. + * * Each deny rule is evaluated independently. If this deny rule does not apply * to a request, other deny rules might still apply. + * * The condition can use CEL functions that evaluate * [resource * tags](https://cloud.google.com/iam/help/conditions/resource-tags). Other @@ -447,6 +507,7 @@ public interface DenyRuleOrBuilder * @return The denialCondition. */ com.google.type.Expr getDenialCondition(); + /** * * @@ -454,8 +515,10 @@ public interface DenyRuleOrBuilder * The condition that determines whether this deny rule applies to a request. * If the condition expression evaluates to `true`, then the deny rule is * applied; otherwise, the deny rule is not applied. + * * Each deny rule is evaluated independently. If this deny rule does not apply * to a request, other deny rules might still apply. + * * The condition can use CEL functions that evaluate * [resource * tags](https://cloud.google.com/iam/help/conditions/resource-tags). Other diff --git a/java-iam/proto-google-iam-v2/src/main/java/com/google/iam/v2/DenyRuleProto.java b/java-iam/proto-google-iam-v2/src/main/java/com/google/iam/v2/DenyRuleProto.java index 55a5ff758b..bccd683a8d 100644 --- a/java-iam/proto-google-iam-v2/src/main/java/com/google/iam/v2/DenyRuleProto.java +++ b/java-iam/proto-google-iam-v2/src/main/java/com/google/iam/v2/DenyRuleProto.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,13 +14,26 @@ * limitations under the License. */ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: google/iam/v2/deny.proto +// Protobuf Java Version: 4.33.2 package com.google.iam.v2; -public final class DenyRuleProto { +@com.google.protobuf.Generated +public final class DenyRuleProto extends com.google.protobuf.GeneratedFile { private DenyRuleProto() {} + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "DenyRuleProto"); + } + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistryLite registry) {} public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry registry) { @@ -29,7 +42,7 @@ public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry r static final com.google.protobuf.Descriptors.Descriptor internal_static_google_iam_v2_DenyRule_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable internal_static_google_iam_v2_DenyRule_fieldAccessorTable; public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { @@ -46,10 +59,10 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + "rincipals\030\002 \003(\t\022\032\n\022denied_permissions\030\003 " + "\003(\t\022\035\n\025exception_permissions\030\004 \003(\t\022+\n\020de" + "nial_condition\030\005 \001(\0132\021.google.type.ExprB" - + "\202\001\n\021com.google.iam.v2B\rDenyRuleProtoP\001Z0" - + "google.golang.org/genproto/googleapis/ia" - + "m/v2;iam\252\002\023Google.Cloud.Iam.V2\312\002\023Google\\" - + "Cloud\\Iam\\V2b\006proto3" + + "{\n\021com.google.iam.v2B\rDenyRuleProtoP\001Z)c" + + "loud.google.com/go/iam/apiv2/iampb;iampb" + + "\252\002\023Google.Cloud.Iam.V2\312\002\023Google\\Cloud\\Ia" + + "m\\V2b\006proto3" }; descriptor = com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( @@ -57,9 +70,9 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { new com.google.protobuf.Descriptors.FileDescriptor[] { com.google.type.ExprProto.getDescriptor(), }); - internal_static_google_iam_v2_DenyRule_descriptor = getDescriptor().getMessageTypes().get(0); + internal_static_google_iam_v2_DenyRule_descriptor = getDescriptor().getMessageType(0); internal_static_google_iam_v2_DenyRule_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_google_iam_v2_DenyRule_descriptor, new java.lang.String[] { "DeniedPrincipals", @@ -68,6 +81,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "ExceptionPermissions", "DenialCondition", }); + descriptor.resolveAllFeaturesImmutable(); com.google.type.ExprProto.getDescriptor(); } diff --git a/java-iam/proto-google-iam-v2/src/main/java/com/google/iam/v2/GetPolicyRequest.java b/java-iam/proto-google-iam-v2/src/main/java/com/google/iam/v2/GetPolicyRequest.java index e3888a12fd..77e35ede9a 100644 --- a/java-iam/proto-google-iam-v2/src/main/java/com/google/iam/v2/GetPolicyRequest.java +++ b/java-iam/proto-google-iam-v2/src/main/java/com/google/iam/v2/GetPolicyRequest.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,9 @@ * limitations under the License. */ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: google/iam/v2/policy.proto +// Protobuf Java Version: 4.33.2 package com.google.iam.v2; @@ -27,13 +29,25 @@ * * Protobuf type {@code google.iam.v2.GetPolicyRequest} */ -public final class GetPolicyRequest extends com.google.protobuf.GeneratedMessageV3 +@com.google.protobuf.Generated +public final class GetPolicyRequest extends com.google.protobuf.GeneratedMessage implements // @@protoc_insertion_point(message_implements:google.iam.v2.GetPolicyRequest) GetPolicyRequestOrBuilder { private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "GetPolicyRequest"); + } + // Use GetPolicyRequest.newBuilder() to construct. - private GetPolicyRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + private GetPolicyRequest(com.google.protobuf.GeneratedMessage.Builder builder) { super(builder); } @@ -41,23 +55,12 @@ private GetPolicyRequest() { name_ = ""; } - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new GetPolicyRequest(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.iam.v2.PolicyProto.internal_static_google_iam_v2_GetPolicyRequest_descriptor; } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.iam.v2.PolicyProto .internal_static_google_iam_v2_GetPolicyRequest_fieldAccessorTable @@ -67,16 +70,22 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } public static final int NAME_FIELD_NUMBER = 1; - private volatile java.lang.Object name_; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** * * *
            * Required. The resource name of the policy to retrieve. Format:
            * `policies/{attachment_point}/denypolicies/{policy_id}`
        +   *
        +   *
            * Use the URL-encoded full resource name, which means that the forward-slash
            * character, `/`, must be written as `%2F`. For example,
            * `policies/cloudresourcemanager.googleapis.com%2Fprojects%2Fmy-project/denypolicies/my-policy`.
        +   *
            * For organizations and folders, use the numeric ID in the full resource
            * name. For projects, you can use the alphanumeric or the numeric ID.
            * 
        @@ -97,15 +106,19 @@ public java.lang.String getName() { return s; } } + /** * * *
            * Required. The resource name of the policy to retrieve. Format:
            * `policies/{attachment_point}/denypolicies/{policy_id}`
        +   *
        +   *
            * Use the URL-encoded full resource name, which means that the forward-slash
            * character, `/`, must be written as `%2F`. For example,
            * `policies/cloudresourcemanager.googleapis.com%2Fprojects%2Fmy-project/denypolicies/my-policy`.
        +   *
            * For organizations and folders, use the numeric ID in the full resource
            * name. For projects, you can use the alphanumeric or the numeric ID.
            * 
        @@ -141,8 +154,8 @@ public final boolean isInitialized() { @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.GeneratedMessage.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, name_); } getUnknownFields().writeTo(output); } @@ -153,8 +166,8 @@ public int getSerializedSize() { 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.GeneratedMessage.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, name_); } size += getUnknownFields().getSerializedSize(); memoizedSize = size; @@ -226,38 +239,38 @@ public static com.google.iam.v2.GetPolicyRequest parseFrom( public static com.google.iam.v2.GetPolicyRequest parseFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); } public static com.google.iam.v2.GetPolicyRequest parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } public static com.google.iam.v2.GetPolicyRequest parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); } public static com.google.iam.v2.GetPolicyRequest parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( PARSER, input, extensionRegistry); } public static com.google.iam.v2.GetPolicyRequest parseFrom( com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); } public static com.google.iam.v2.GetPolicyRequest parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } @@ -280,10 +293,11 @@ public Builder toBuilder() { } @java.lang.Override - protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { Builder builder = new Builder(parent); return builder; } + /** * * @@ -293,7 +307,7 @@ protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.Build * * Protobuf type {@code google.iam.v2.GetPolicyRequest} */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder implements // @@protoc_insertion_point(builder_implements:google.iam.v2.GetPolicyRequest) com.google.iam.v2.GetPolicyRequestOrBuilder { @@ -303,7 +317,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.iam.v2.PolicyProto .internal_static_google_iam_v2_GetPolicyRequest_fieldAccessorTable @@ -315,15 +329,15 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { // Construct using com.google.iam.v2.GetPolicyRequest.newBuilder() private Builder() {} - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { super(parent); } @java.lang.Override public Builder clear() { super.clear(); + bitField0_ = 0; name_ = ""; - return this; } @@ -350,42 +364,18 @@ public com.google.iam.v2.GetPolicyRequest build() { @java.lang.Override public com.google.iam.v2.GetPolicyRequest buildPartial() { com.google.iam.v2.GetPolicyRequest result = new com.google.iam.v2.GetPolicyRequest(this); - result.name_ = name_; + if (bitField0_ != 0) { + buildPartial0(result); + } 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); + private void buildPartial0(com.google.iam.v2.GetPolicyRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } } @java.lang.Override @@ -402,6 +392,7 @@ public Builder mergeFrom(com.google.iam.v2.GetPolicyRequest other) { if (other == com.google.iam.v2.GetPolicyRequest.getDefaultInstance()) return this; if (!other.getName().isEmpty()) { name_ = other.name_; + bitField0_ |= 0x00000001; onChanged(); } this.mergeUnknownFields(other.getUnknownFields()); @@ -433,7 +424,7 @@ public Builder mergeFrom( case 10: { name_ = input.readStringRequireUtf8(); - + bitField0_ |= 0x00000001; break; } // case 10 default: @@ -453,16 +444,22 @@ public Builder mergeFrom( return this; } + private int bitField0_; + private java.lang.Object name_ = ""; + /** * * *
              * Required. The resource name of the policy to retrieve. Format:
              * `policies/{attachment_point}/denypolicies/{policy_id}`
        +     *
        +     *
              * Use the URL-encoded full resource name, which means that the forward-slash
              * character, `/`, must be written as `%2F`. For example,
              * `policies/cloudresourcemanager.googleapis.com%2Fprojects%2Fmy-project/denypolicies/my-policy`.
        +     *
              * For organizations and folders, use the numeric ID in the full resource
              * name. For projects, you can use the alphanumeric or the numeric ID.
              * 
        @@ -482,15 +479,19 @@ public java.lang.String getName() { return (java.lang.String) ref; } } + /** * * *
              * Required. The resource name of the policy to retrieve. Format:
              * `policies/{attachment_point}/denypolicies/{policy_id}`
        +     *
        +     *
              * Use the URL-encoded full resource name, which means that the forward-slash
              * character, `/`, must be written as `%2F`. For example,
              * `policies/cloudresourcemanager.googleapis.com%2Fprojects%2Fmy-project/denypolicies/my-policy`.
        +     *
              * For organizations and folders, use the numeric ID in the full resource
              * name. For projects, you can use the alphanumeric or the numeric ID.
              * 
        @@ -510,15 +511,19 @@ public com.google.protobuf.ByteString getNameBytes() { return (com.google.protobuf.ByteString) ref; } } + /** * * *
              * Required. The resource name of the policy to retrieve. Format:
              * `policies/{attachment_point}/denypolicies/{policy_id}`
        +     *
        +     *
              * Use the URL-encoded full resource name, which means that the forward-slash
              * character, `/`, must be written as `%2F`. For example,
              * `policies/cloudresourcemanager.googleapis.com%2Fprojects%2Fmy-project/denypolicies/my-policy`.
        +     *
              * For organizations and folders, use the numeric ID in the full resource
              * name. For projects, you can use the alphanumeric or the numeric ID.
              * 
        @@ -532,20 +537,24 @@ 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 to retrieve. Format:
              * `policies/{attachment_point}/denypolicies/{policy_id}`
        +     *
        +     *
              * Use the URL-encoded full resource name, which means that the forward-slash
              * character, `/`, must be written as `%2F`. For example,
              * `policies/cloudresourcemanager.googleapis.com%2Fprojects%2Fmy-project/denypolicies/my-policy`.
        +     *
              * For organizations and folders, use the numeric ID in the full resource
              * name. For projects, you can use the alphanumeric or the numeric ID.
              * 
        @@ -555,20 +564,24 @@ public Builder setName(java.lang.String value) { * @return This builder for chaining. */ public Builder clearName() { - name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); onChanged(); return this; } + /** * * *
              * Required. The resource name of the policy to retrieve. Format:
              * `policies/{attachment_point}/denypolicies/{policy_id}`
        +     *
        +     *
              * Use the URL-encoded full resource name, which means that the forward-slash
              * character, `/`, must be written as `%2F`. For example,
              * `policies/cloudresourcemanager.googleapis.com%2Fprojects%2Fmy-project/denypolicies/my-policy`.
        +     *
              * For organizations and folders, use the numeric ID in the full resource
              * name. For projects, you can use the alphanumeric or the numeric ID.
              * 
        @@ -583,23 +596,12 @@ public Builder setNameBytes(com.google.protobuf.ByteString value) { 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.iam.v2.GetPolicyRequest) } diff --git a/java-iam/proto-google-iam-v2/src/main/java/com/google/iam/v2/GetPolicyRequestOrBuilder.java b/java-iam/proto-google-iam-v2/src/main/java/com/google/iam/v2/GetPolicyRequestOrBuilder.java index 6f293a3267..2722c95830 100644 --- a/java-iam/proto-google-iam-v2/src/main/java/com/google/iam/v2/GetPolicyRequestOrBuilder.java +++ b/java-iam/proto-google-iam-v2/src/main/java/com/google/iam/v2/GetPolicyRequestOrBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,10 +14,13 @@ * limitations under the License. */ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: google/iam/v2/policy.proto +// Protobuf Java Version: 4.33.2 package com.google.iam.v2; +@com.google.protobuf.Generated public interface GetPolicyRequestOrBuilder extends // @@protoc_insertion_point(interface_extends:google.iam.v2.GetPolicyRequest) @@ -29,9 +32,12 @@ public interface GetPolicyRequestOrBuilder *
            * Required. The resource name of the policy to retrieve. Format:
            * `policies/{attachment_point}/denypolicies/{policy_id}`
        +   *
        +   *
            * Use the URL-encoded full resource name, which means that the forward-slash
            * character, `/`, must be written as `%2F`. For example,
            * `policies/cloudresourcemanager.googleapis.com%2Fprojects%2Fmy-project/denypolicies/my-policy`.
        +   *
            * For organizations and folders, use the numeric ID in the full resource
            * name. For projects, you can use the alphanumeric or the numeric ID.
            * 
        @@ -41,15 +47,19 @@ public interface GetPolicyRequestOrBuilder * @return The name. */ java.lang.String getName(); + /** * * *
            * Required. The resource name of the policy to retrieve. Format:
            * `policies/{attachment_point}/denypolicies/{policy_id}`
        +   *
        +   *
            * Use the URL-encoded full resource name, which means that the forward-slash
            * character, `/`, must be written as `%2F`. For example,
            * `policies/cloudresourcemanager.googleapis.com%2Fprojects%2Fmy-project/denypolicies/my-policy`.
        +   *
            * For organizations and folders, use the numeric ID in the full resource
            * name. For projects, you can use the alphanumeric or the numeric ID.
            * 
        diff --git a/java-iam/proto-google-iam-v2/src/main/java/com/google/iam/v2/ListPoliciesRequest.java b/java-iam/proto-google-iam-v2/src/main/java/com/google/iam/v2/ListPoliciesRequest.java index 124798c38a..021f6200f4 100644 --- a/java-iam/proto-google-iam-v2/src/main/java/com/google/iam/v2/ListPoliciesRequest.java +++ b/java-iam/proto-google-iam-v2/src/main/java/com/google/iam/v2/ListPoliciesRequest.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,9 @@ * limitations under the License. */ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: google/iam/v2/policy.proto +// Protobuf Java Version: 4.33.2 package com.google.iam.v2; @@ -27,13 +29,25 @@ * * Protobuf type {@code google.iam.v2.ListPoliciesRequest} */ -public final class ListPoliciesRequest extends com.google.protobuf.GeneratedMessageV3 +@com.google.protobuf.Generated +public final class ListPoliciesRequest extends com.google.protobuf.GeneratedMessage implements // @@protoc_insertion_point(message_implements:google.iam.v2.ListPoliciesRequest) ListPoliciesRequestOrBuilder { private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "ListPoliciesRequest"); + } + // Use ListPoliciesRequest.newBuilder() to construct. - private ListPoliciesRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + private ListPoliciesRequest(com.google.protobuf.GeneratedMessage.Builder builder) { super(builder); } @@ -42,24 +56,13 @@ private ListPoliciesRequest() { pageToken_ = ""; } - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new ListPoliciesRequest(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.iam.v2.PolicyProto .internal_static_google_iam_v2_ListPoliciesRequest_descriptor; } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.iam.v2.PolicyProto .internal_static_google_iam_v2_ListPoliciesRequest_fieldAccessorTable @@ -69,7 +72,10 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } public static final int PARENT_FIELD_NUMBER = 1; - private volatile java.lang.Object parent_; + + @SuppressWarnings("serial") + private volatile java.lang.Object parent_ = ""; + /** * * @@ -77,10 +83,13 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { * Required. The resource that the policy is attached to, along with the kind of policy * to list. Format: * `policies/{attachment_point}/denypolicies` + * + * * The attachment point is identified by its URL-encoded full resource name, * which means that the forward-slash character, `/`, must be written as * `%2F`. For example, * `policies/cloudresourcemanager.googleapis.com%2Fprojects%2Fmy-project/denypolicies`. + * * For organizations and folders, use the numeric ID in the full resource * name. For projects, you can use the alphanumeric or the numeric ID. * @@ -101,6 +110,7 @@ public java.lang.String getParent() { return s; } } + /** * * @@ -108,10 +118,13 @@ public java.lang.String getParent() { * Required. The resource that the policy is attached to, along with the kind of policy * to list. Format: * `policies/{attachment_point}/denypolicies` + * + * * The attachment point is identified by its URL-encoded full resource name, * which means that the forward-slash character, `/`, must be written as * `%2F`. For example, * `policies/cloudresourcemanager.googleapis.com%2Fprojects%2Fmy-project/denypolicies`. + * * For organizations and folders, use the numeric ID in the full resource * name. For projects, you can use the alphanumeric or the numeric ID. * @@ -134,7 +147,8 @@ public com.google.protobuf.ByteString getParentBytes() { } public static final int PAGE_SIZE_FIELD_NUMBER = 2; - private int pageSize_; + private int pageSize_ = 0; + /** * * @@ -153,7 +167,10 @@ public int getPageSize() { } public static final int PAGE_TOKEN_FIELD_NUMBER = 3; - private volatile java.lang.Object pageToken_; + + @SuppressWarnings("serial") + private volatile java.lang.Object pageToken_ = ""; + /** * * @@ -178,6 +195,7 @@ public java.lang.String getPageToken() { return s; } } + /** * * @@ -217,14 +235,14 @@ public final boolean isInitialized() { @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.GeneratedMessage.isStringEmpty(parent_)) { + com.google.protobuf.GeneratedMessage.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_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(pageToken_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 3, pageToken_); } getUnknownFields().writeTo(output); } @@ -235,14 +253,14 @@ public int getSerializedSize() { 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.GeneratedMessage.isStringEmpty(parent_)) { + size += com.google.protobuf.GeneratedMessage.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_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(pageToken_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(3, pageToken_); } size += getUnknownFields().getSerializedSize(); memoizedSize = size; @@ -320,38 +338,38 @@ public static com.google.iam.v2.ListPoliciesRequest parseFrom( public static com.google.iam.v2.ListPoliciesRequest parseFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); } public static com.google.iam.v2.ListPoliciesRequest parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } public static com.google.iam.v2.ListPoliciesRequest parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); } public static com.google.iam.v2.ListPoliciesRequest parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( PARSER, input, extensionRegistry); } public static com.google.iam.v2.ListPoliciesRequest parseFrom( com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); } public static com.google.iam.v2.ListPoliciesRequest parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } @@ -374,10 +392,11 @@ public Builder toBuilder() { } @java.lang.Override - protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { Builder builder = new Builder(parent); return builder; } + /** * * @@ -387,7 +406,7 @@ protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.Build * * Protobuf type {@code google.iam.v2.ListPoliciesRequest} */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder implements // @@protoc_insertion_point(builder_implements:google.iam.v2.ListPoliciesRequest) com.google.iam.v2.ListPoliciesRequestOrBuilder { @@ -397,7 +416,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.iam.v2.PolicyProto .internal_static_google_iam_v2_ListPoliciesRequest_fieldAccessorTable @@ -409,19 +428,17 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { // Construct using com.google.iam.v2.ListPoliciesRequest.newBuilder() private Builder() {} - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { super(parent); } @java.lang.Override public Builder clear() { super.clear(); + bitField0_ = 0; parent_ = ""; - pageSize_ = 0; - pageToken_ = ""; - return this; } @@ -449,44 +466,24 @@ public com.google.iam.v2.ListPoliciesRequest build() { public com.google.iam.v2.ListPoliciesRequest buildPartial() { com.google.iam.v2.ListPoliciesRequest result = new com.google.iam.v2.ListPoliciesRequest(this); - result.parent_ = parent_; - result.pageSize_ = pageSize_; - result.pageToken_ = pageToken_; + if (bitField0_ != 0) { + buildPartial0(result); + } 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); + private void buildPartial0(com.google.iam.v2.ListPoliciesRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.parent_ = parent_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.pageSize_ = pageSize_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.pageToken_ = pageToken_; + } } @java.lang.Override @@ -503,6 +500,7 @@ public Builder mergeFrom(com.google.iam.v2.ListPoliciesRequest other) { if (other == com.google.iam.v2.ListPoliciesRequest.getDefaultInstance()) return this; if (!other.getParent().isEmpty()) { parent_ = other.parent_; + bitField0_ |= 0x00000001; onChanged(); } if (other.getPageSize() != 0) { @@ -510,6 +508,7 @@ public Builder mergeFrom(com.google.iam.v2.ListPoliciesRequest other) { } if (!other.getPageToken().isEmpty()) { pageToken_ = other.pageToken_; + bitField0_ |= 0x00000004; onChanged(); } this.mergeUnknownFields(other.getUnknownFields()); @@ -541,19 +540,19 @@ public Builder mergeFrom( case 10: { parent_ = input.readStringRequireUtf8(); - + bitField0_ |= 0x00000001; break; } // case 10 case 16: { pageSize_ = input.readInt32(); - + bitField0_ |= 0x00000002; break; } // case 16 case 26: { pageToken_ = input.readStringRequireUtf8(); - + bitField0_ |= 0x00000004; break; } // case 26 default: @@ -573,7 +572,10 @@ public Builder mergeFrom( return this; } + private int bitField0_; + private java.lang.Object parent_ = ""; + /** * * @@ -581,10 +583,13 @@ public Builder mergeFrom( * Required. The resource that the policy is attached to, along with the kind of policy * to list. Format: * `policies/{attachment_point}/denypolicies` + * + * * The attachment point is identified by its URL-encoded full resource name, * which means that the forward-slash character, `/`, must be written as * `%2F`. For example, * `policies/cloudresourcemanager.googleapis.com%2Fprojects%2Fmy-project/denypolicies`. + * * For organizations and folders, use the numeric ID in the full resource * name. For projects, you can use the alphanumeric or the numeric ID. * @@ -604,6 +609,7 @@ public java.lang.String getParent() { return (java.lang.String) ref; } } + /** * * @@ -611,10 +617,13 @@ public java.lang.String getParent() { * Required. The resource that the policy is attached to, along with the kind of policy * to list. Format: * `policies/{attachment_point}/denypolicies` + * + * * The attachment point is identified by its URL-encoded full resource name, * which means that the forward-slash character, `/`, must be written as * `%2F`. For example, * `policies/cloudresourcemanager.googleapis.com%2Fprojects%2Fmy-project/denypolicies`. + * * For organizations and folders, use the numeric ID in the full resource * name. For projects, you can use the alphanumeric or the numeric ID. * @@ -634,6 +643,7 @@ public com.google.protobuf.ByteString getParentBytes() { return (com.google.protobuf.ByteString) ref; } } + /** * * @@ -641,10 +651,13 @@ public com.google.protobuf.ByteString getParentBytes() { * Required. The resource that the policy is attached to, along with the kind of policy * to list. Format: * `policies/{attachment_point}/denypolicies` + * + * * The attachment point is identified by its URL-encoded full resource name, * which means that the forward-slash character, `/`, must be written as * `%2F`. For example, * `policies/cloudresourcemanager.googleapis.com%2Fprojects%2Fmy-project/denypolicies`. + * * For organizations and folders, use the numeric ID in the full resource * name. For projects, you can use the alphanumeric or the numeric ID. * @@ -658,11 +671,12 @@ public Builder setParent(java.lang.String value) { if (value == null) { throw new NullPointerException(); } - parent_ = value; + bitField0_ |= 0x00000001; onChanged(); return this; } + /** * * @@ -670,10 +684,13 @@ public Builder setParent(java.lang.String value) { * Required. The resource that the policy is attached to, along with the kind of policy * to list. Format: * `policies/{attachment_point}/denypolicies` + * + * * The attachment point is identified by its URL-encoded full resource name, * which means that the forward-slash character, `/`, must be written as * `%2F`. For example, * `policies/cloudresourcemanager.googleapis.com%2Fprojects%2Fmy-project/denypolicies`. + * * For organizations and folders, use the numeric ID in the full resource * name. For projects, you can use the alphanumeric or the numeric ID. * @@ -683,11 +700,12 @@ public Builder setParent(java.lang.String value) { * @return This builder for chaining. */ public Builder clearParent() { - parent_ = getDefaultInstance().getParent(); + bitField0_ = (bitField0_ & ~0x00000001); onChanged(); return this; } + /** * * @@ -695,10 +713,13 @@ public Builder clearParent() { * Required. The resource that the policy is attached to, along with the kind of policy * to list. Format: * `policies/{attachment_point}/denypolicies` + * + * * The attachment point is identified by its URL-encoded full resource name, * which means that the forward-slash character, `/`, must be written as * `%2F`. For example, * `policies/cloudresourcemanager.googleapis.com%2Fprojects%2Fmy-project/denypolicies`. + * * For organizations and folders, use the numeric ID in the full resource * name. For projects, you can use the alphanumeric or the numeric ID. * @@ -713,13 +734,14 @@ public Builder setParentBytes(com.google.protobuf.ByteString value) { throw new NullPointerException(); } checkByteStringIsUtf8(value); - parent_ = value; + bitField0_ |= 0x00000001; onChanged(); return this; } private int pageSize_; + /** * * @@ -736,6 +758,7 @@ public Builder setParentBytes(com.google.protobuf.ByteString value) { public int getPageSize() { return pageSize_; } + /** * * @@ -752,9 +775,11 @@ public int getPageSize() { public Builder setPageSize(int value) { pageSize_ = value; + bitField0_ |= 0x00000002; onChanged(); return this; } + /** * * @@ -768,13 +793,14 @@ public Builder setPageSize(int value) { * @return This builder for chaining. */ public Builder clearPageSize() { - + bitField0_ = (bitField0_ & ~0x00000002); pageSize_ = 0; onChanged(); return this; } private java.lang.Object pageToken_ = ""; + /** * * @@ -798,6 +824,7 @@ public java.lang.String getPageToken() { return (java.lang.String) ref; } } + /** * * @@ -821,6 +848,7 @@ public com.google.protobuf.ByteString getPageTokenBytes() { return (com.google.protobuf.ByteString) ref; } } + /** * * @@ -838,11 +866,12 @@ public Builder setPageToken(java.lang.String value) { if (value == null) { throw new NullPointerException(); } - pageToken_ = value; + bitField0_ |= 0x00000004; onChanged(); return this; } + /** * * @@ -856,11 +885,12 @@ public Builder setPageToken(java.lang.String value) { * @return This builder for chaining. */ public Builder clearPageToken() { - pageToken_ = getDefaultInstance().getPageToken(); + bitField0_ = (bitField0_ & ~0x00000004); onChanged(); return this; } + /** * * @@ -879,23 +909,12 @@ public Builder setPageTokenBytes(com.google.protobuf.ByteString value) { throw new NullPointerException(); } checkByteStringIsUtf8(value); - pageToken_ = 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.iam.v2.ListPoliciesRequest) } diff --git a/java-iam/proto-google-iam-v2/src/main/java/com/google/iam/v2/ListPoliciesRequestOrBuilder.java b/java-iam/proto-google-iam-v2/src/main/java/com/google/iam/v2/ListPoliciesRequestOrBuilder.java index bfea871b46..7b70a5b646 100644 --- a/java-iam/proto-google-iam-v2/src/main/java/com/google/iam/v2/ListPoliciesRequestOrBuilder.java +++ b/java-iam/proto-google-iam-v2/src/main/java/com/google/iam/v2/ListPoliciesRequestOrBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,10 +14,13 @@ * limitations under the License. */ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: google/iam/v2/policy.proto +// Protobuf Java Version: 4.33.2 package com.google.iam.v2; +@com.google.protobuf.Generated public interface ListPoliciesRequestOrBuilder extends // @@protoc_insertion_point(interface_extends:google.iam.v2.ListPoliciesRequest) @@ -30,10 +33,13 @@ public interface ListPoliciesRequestOrBuilder * Required. The resource that the policy is attached to, along with the kind of policy * to list. Format: * `policies/{attachment_point}/denypolicies` + * + * * The attachment point is identified by its URL-encoded full resource name, * which means that the forward-slash character, `/`, must be written as * `%2F`. For example, * `policies/cloudresourcemanager.googleapis.com%2Fprojects%2Fmy-project/denypolicies`. + * * For organizations and folders, use the numeric ID in the full resource * name. For projects, you can use the alphanumeric or the numeric ID. * @@ -43,6 +49,7 @@ public interface ListPoliciesRequestOrBuilder * @return The parent. */ java.lang.String getParent(); + /** * * @@ -50,10 +57,13 @@ public interface ListPoliciesRequestOrBuilder * Required. The resource that the policy is attached to, along with the kind of policy * to list. Format: * `policies/{attachment_point}/denypolicies` + * + * * The attachment point is identified by its URL-encoded full resource name, * which means that the forward-slash character, `/`, must be written as * `%2F`. For example, * `policies/cloudresourcemanager.googleapis.com%2Fprojects%2Fmy-project/denypolicies`. + * * For organizations and folders, use the numeric ID in the full resource * name. For projects, you can use the alphanumeric or the numeric ID. * @@ -91,6 +101,7 @@ public interface ListPoliciesRequestOrBuilder * @return The pageToken. */ java.lang.String getPageToken(); + /** * * diff --git a/java-iam/proto-google-iam-v2/src/main/java/com/google/iam/v2/ListPoliciesResponse.java b/java-iam/proto-google-iam-v2/src/main/java/com/google/iam/v2/ListPoliciesResponse.java index 62cdb5ecac..1363c6b6b7 100644 --- a/java-iam/proto-google-iam-v2/src/main/java/com/google/iam/v2/ListPoliciesResponse.java +++ b/java-iam/proto-google-iam-v2/src/main/java/com/google/iam/v2/ListPoliciesResponse.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,9 @@ * limitations under the License. */ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: google/iam/v2/policy.proto +// Protobuf Java Version: 4.33.2 package com.google.iam.v2; @@ -27,13 +29,25 @@ * * Protobuf type {@code google.iam.v2.ListPoliciesResponse} */ -public final class ListPoliciesResponse extends com.google.protobuf.GeneratedMessageV3 +@com.google.protobuf.Generated +public final class ListPoliciesResponse extends com.google.protobuf.GeneratedMessage implements // @@protoc_insertion_point(message_implements:google.iam.v2.ListPoliciesResponse) ListPoliciesResponseOrBuilder { private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "ListPoliciesResponse"); + } + // Use ListPoliciesResponse.newBuilder() to construct. - private ListPoliciesResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + private ListPoliciesResponse(com.google.protobuf.GeneratedMessage.Builder builder) { super(builder); } @@ -42,24 +56,13 @@ private ListPoliciesResponse() { nextPageToken_ = ""; } - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new ListPoliciesResponse(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.iam.v2.PolicyProto .internal_static_google_iam_v2_ListPoliciesResponse_descriptor; } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.iam.v2.PolicyProto .internal_static_google_iam_v2_ListPoliciesResponse_fieldAccessorTable @@ -69,7 +72,10 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } public static final int POLICIES_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") private java.util.List policies_; + /** * * @@ -83,6 +89,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { public java.util.List getPoliciesList() { return policies_; } + /** * * @@ -96,6 +103,7 @@ public java.util.List getPoliciesList() { public java.util.List getPoliciesOrBuilderList() { return policies_; } + /** * * @@ -109,6 +117,7 @@ public java.util.List getPoliciesOr public int getPoliciesCount() { return policies_.size(); } + /** * * @@ -122,6 +131,7 @@ public int getPoliciesCount() { public com.google.iam.v2.Policy getPolicies(int index) { return policies_.get(index); } + /** * * @@ -137,7 +147,10 @@ public com.google.iam.v2.PolicyOrBuilder getPoliciesOrBuilder(int index) { } public static final int NEXT_PAGE_TOKEN_FIELD_NUMBER = 2; - private volatile java.lang.Object nextPageToken_; + + @SuppressWarnings("serial") + private volatile java.lang.Object nextPageToken_ = ""; + /** * * @@ -162,6 +175,7 @@ public java.lang.String getNextPageToken() { return s; } } + /** * * @@ -204,8 +218,8 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io for (int i = 0; i < policies_.size(); i++) { output.writeMessage(1, policies_.get(i)); } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nextPageToken_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 2, nextPageToken_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(nextPageToken_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, nextPageToken_); } getUnknownFields().writeTo(output); } @@ -219,8 +233,8 @@ public int getSerializedSize() { for (int i = 0; i < policies_.size(); i++) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, policies_.get(i)); } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nextPageToken_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, nextPageToken_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(nextPageToken_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, nextPageToken_); } size += getUnknownFields().getSerializedSize(); memoizedSize = size; @@ -298,38 +312,38 @@ public static com.google.iam.v2.ListPoliciesResponse parseFrom( public static com.google.iam.v2.ListPoliciesResponse parseFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); } public static com.google.iam.v2.ListPoliciesResponse parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } public static com.google.iam.v2.ListPoliciesResponse parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); } public static com.google.iam.v2.ListPoliciesResponse parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( PARSER, input, extensionRegistry); } public static com.google.iam.v2.ListPoliciesResponse parseFrom( com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); } public static com.google.iam.v2.ListPoliciesResponse parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } @@ -352,10 +366,11 @@ public Builder toBuilder() { } @java.lang.Override - protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { Builder builder = new Builder(parent); return builder; } + /** * * @@ -365,7 +380,7 @@ protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.Build * * Protobuf type {@code google.iam.v2.ListPoliciesResponse} */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder implements // @@protoc_insertion_point(builder_implements:google.iam.v2.ListPoliciesResponse) com.google.iam.v2.ListPoliciesResponseOrBuilder { @@ -375,7 +390,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.iam.v2.PolicyProto .internal_static_google_iam_v2_ListPoliciesResponse_fieldAccessorTable @@ -387,13 +402,14 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { // Construct using com.google.iam.v2.ListPoliciesResponse.newBuilder() private Builder() {} - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { super(parent); } @java.lang.Override public Builder clear() { super.clear(); + bitField0_ = 0; if (policiesBuilder_ == null) { policies_ = java.util.Collections.emptyList(); } else { @@ -402,7 +418,6 @@ public Builder clear() { } bitField0_ = (bitField0_ & ~0x00000001); nextPageToken_ = ""; - return this; } @@ -430,7 +445,15 @@ public com.google.iam.v2.ListPoliciesResponse build() { public com.google.iam.v2.ListPoliciesResponse buildPartial() { com.google.iam.v2.ListPoliciesResponse result = new com.google.iam.v2.ListPoliciesResponse(this); - int from_bitField0_ = bitField0_; + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields(com.google.iam.v2.ListPoliciesResponse result) { if (policiesBuilder_ == null) { if (((bitField0_ & 0x00000001) != 0)) { policies_ = java.util.Collections.unmodifiableList(policies_); @@ -440,42 +463,13 @@ public com.google.iam.v2.ListPoliciesResponse buildPartial() { } else { result.policies_ = policiesBuilder_.build(); } - result.nextPageToken_ = nextPageToken_; - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.setField(field, value); } - @java.lang.Override - public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - - @java.lang.Override - public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.addRepeatedField(field, value); + private void buildPartial0(com.google.iam.v2.ListPoliciesResponse result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.nextPageToken_ = nextPageToken_; + } } @java.lang.Override @@ -509,8 +503,8 @@ public Builder mergeFrom(com.google.iam.v2.ListPoliciesResponse other) { policies_ = other.policies_; bitField0_ = (bitField0_ & ~0x00000001); policiesBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders - ? getPoliciesFieldBuilder() + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders + ? internalGetPoliciesFieldBuilder() : null; } else { policiesBuilder_.addAllMessages(other.policies_); @@ -519,6 +513,7 @@ public Builder mergeFrom(com.google.iam.v2.ListPoliciesResponse other) { } if (!other.getNextPageToken().isEmpty()) { nextPageToken_ = other.nextPageToken_; + bitField0_ |= 0x00000002; onChanged(); } this.mergeUnknownFields(other.getUnknownFields()); @@ -562,7 +557,7 @@ public Builder mergeFrom( case 18: { nextPageToken_ = input.readStringRequireUtf8(); - + bitField0_ |= 0x00000002; break; } // case 18 default: @@ -593,7 +588,7 @@ private void ensurePoliciesIsMutable() { } } - private com.google.protobuf.RepeatedFieldBuilderV3< + private com.google.protobuf.RepeatedFieldBuilder< com.google.iam.v2.Policy, com.google.iam.v2.Policy.Builder, com.google.iam.v2.PolicyOrBuilder> @@ -615,6 +610,7 @@ public java.util.List getPoliciesList() { return policiesBuilder_.getMessageList(); } } + /** * * @@ -631,6 +627,7 @@ public int getPoliciesCount() { return policiesBuilder_.getCount(); } } + /** * * @@ -647,6 +644,7 @@ public com.google.iam.v2.Policy getPolicies(int index) { return policiesBuilder_.getMessage(index); } } + /** * * @@ -669,6 +667,7 @@ public Builder setPolicies(int index, com.google.iam.v2.Policy value) { } return this; } + /** * * @@ -688,6 +687,7 @@ public Builder setPolicies(int index, com.google.iam.v2.Policy.Builder builderFo } return this; } + /** * * @@ -710,6 +710,7 @@ public Builder addPolicies(com.google.iam.v2.Policy value) { } return this; } + /** * * @@ -732,6 +733,7 @@ public Builder addPolicies(int index, com.google.iam.v2.Policy value) { } return this; } + /** * * @@ -751,6 +753,7 @@ public Builder addPolicies(com.google.iam.v2.Policy.Builder builderForValue) { } return this; } + /** * * @@ -770,6 +773,7 @@ public Builder addPolicies(int index, com.google.iam.v2.Policy.Builder builderFo } return this; } + /** * * @@ -789,6 +793,7 @@ public Builder addAllPolicies(java.lang.Iterablerepeated .google.iam.v2.Policy policies = 1; */ public com.google.iam.v2.Policy.Builder getPoliciesBuilder(int index) { - return getPoliciesFieldBuilder().getBuilder(index); + return internalGetPoliciesFieldBuilder().getBuilder(index); } + /** * * @@ -855,6 +863,7 @@ public com.google.iam.v2.PolicyOrBuilder getPoliciesOrBuilder(int index) { return policiesBuilder_.getMessageOrBuilder(index); } } + /** * * @@ -871,6 +880,7 @@ public java.util.List getPoliciesOr return java.util.Collections.unmodifiableList(policies_); } } + /** * * @@ -881,8 +891,10 @@ public java.util.List getPoliciesOr * repeated .google.iam.v2.Policy policies = 1; */ public com.google.iam.v2.Policy.Builder addPoliciesBuilder() { - return getPoliciesFieldBuilder().addBuilder(com.google.iam.v2.Policy.getDefaultInstance()); + return internalGetPoliciesFieldBuilder() + .addBuilder(com.google.iam.v2.Policy.getDefaultInstance()); } + /** * * @@ -893,9 +905,10 @@ public com.google.iam.v2.Policy.Builder addPoliciesBuilder() { * repeated .google.iam.v2.Policy policies = 1; */ public com.google.iam.v2.Policy.Builder addPoliciesBuilder(int index) { - return getPoliciesFieldBuilder() + return internalGetPoliciesFieldBuilder() .addBuilder(index, com.google.iam.v2.Policy.getDefaultInstance()); } + /** * * @@ -906,17 +919,17 @@ public com.google.iam.v2.Policy.Builder addPoliciesBuilder(int index) { * repeated .google.iam.v2.Policy policies = 1; */ public java.util.List getPoliciesBuilderList() { - return getPoliciesFieldBuilder().getBuilderList(); + return internalGetPoliciesFieldBuilder().getBuilderList(); } - private com.google.protobuf.RepeatedFieldBuilderV3< + private com.google.protobuf.RepeatedFieldBuilder< com.google.iam.v2.Policy, com.google.iam.v2.Policy.Builder, com.google.iam.v2.PolicyOrBuilder> - getPoliciesFieldBuilder() { + internalGetPoliciesFieldBuilder() { if (policiesBuilder_ == null) { policiesBuilder_ = - new com.google.protobuf.RepeatedFieldBuilderV3< + new com.google.protobuf.RepeatedFieldBuilder< com.google.iam.v2.Policy, com.google.iam.v2.Policy.Builder, com.google.iam.v2.PolicyOrBuilder>( @@ -927,6 +940,7 @@ public java.util.List getPoliciesBuilderList() } private java.lang.Object nextPageToken_ = ""; + /** * * @@ -950,6 +964,7 @@ public java.lang.String getNextPageToken() { return (java.lang.String) ref; } } + /** * * @@ -973,6 +988,7 @@ public com.google.protobuf.ByteString getNextPageTokenBytes() { return (com.google.protobuf.ByteString) ref; } } + /** * * @@ -990,11 +1006,12 @@ public Builder setNextPageToken(java.lang.String value) { if (value == null) { throw new NullPointerException(); } - nextPageToken_ = value; + bitField0_ |= 0x00000002; onChanged(); return this; } + /** * * @@ -1008,11 +1025,12 @@ public Builder setNextPageToken(java.lang.String value) { * @return This builder for chaining. */ public Builder clearNextPageToken() { - nextPageToken_ = getDefaultInstance().getNextPageToken(); + bitField0_ = (bitField0_ & ~0x00000002); onChanged(); return this; } + /** * * @@ -1031,23 +1049,12 @@ public Builder setNextPageTokenBytes(com.google.protobuf.ByteString value) { 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.iam.v2.ListPoliciesResponse) } diff --git a/java-iam/proto-google-iam-v2/src/main/java/com/google/iam/v2/ListPoliciesResponseOrBuilder.java b/java-iam/proto-google-iam-v2/src/main/java/com/google/iam/v2/ListPoliciesResponseOrBuilder.java index 1faeb31cfb..18c09d49f1 100644 --- a/java-iam/proto-google-iam-v2/src/main/java/com/google/iam/v2/ListPoliciesResponseOrBuilder.java +++ b/java-iam/proto-google-iam-v2/src/main/java/com/google/iam/v2/ListPoliciesResponseOrBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,10 +14,13 @@ * limitations under the License. */ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: google/iam/v2/policy.proto +// Protobuf Java Version: 4.33.2 package com.google.iam.v2; +@com.google.protobuf.Generated public interface ListPoliciesResponseOrBuilder extends // @@protoc_insertion_point(interface_extends:google.iam.v2.ListPoliciesResponse) @@ -33,6 +36,7 @@ public interface ListPoliciesResponseOrBuilder * repeated .google.iam.v2.Policy policies = 1; */ java.util.List getPoliciesList(); + /** * * @@ -43,6 +47,7 @@ public interface ListPoliciesResponseOrBuilder * repeated .google.iam.v2.Policy policies = 1; */ com.google.iam.v2.Policy getPolicies(int index); + /** * * @@ -53,6 +58,7 @@ public interface ListPoliciesResponseOrBuilder * repeated .google.iam.v2.Policy policies = 1; */ int getPoliciesCount(); + /** * * @@ -63,6 +69,7 @@ public interface ListPoliciesResponseOrBuilder * repeated .google.iam.v2.Policy policies = 1; */ java.util.List getPoliciesOrBuilderList(); + /** * * @@ -87,6 +94,7 @@ public interface ListPoliciesResponseOrBuilder * @return The nextPageToken. */ java.lang.String getNextPageToken(); + /** * * diff --git a/java-iam/proto-google-iam-v2/src/main/java/com/google/iam/v2/Policy.java b/java-iam/proto-google-iam-v2/src/main/java/com/google/iam/v2/Policy.java index 82a241e71d..6e70a6d855 100644 --- a/java-iam/proto-google-iam-v2/src/main/java/com/google/iam/v2/Policy.java +++ b/java-iam/proto-google-iam-v2/src/main/java/com/google/iam/v2/Policy.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,9 @@ * limitations under the License. */ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: google/iam/v2/policy.proto +// Protobuf Java Version: 4.33.2 package com.google.iam.v2; @@ -27,13 +29,25 @@ * * Protobuf type {@code google.iam.v2.Policy} */ -public final class Policy extends com.google.protobuf.GeneratedMessageV3 +@com.google.protobuf.Generated +public final class Policy extends com.google.protobuf.GeneratedMessage implements // @@protoc_insertion_point(message_implements:google.iam.v2.Policy) PolicyOrBuilder { private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "Policy"); + } + // Use Policy.newBuilder() to construct. - private Policy(com.google.protobuf.GeneratedMessageV3.Builder builder) { + private Policy(com.google.protobuf.GeneratedMessage.Builder builder) { super(builder); } @@ -47,24 +61,14 @@ private Policy() { managingAuthority_ = ""; } - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new Policy(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.iam.v2.PolicyProto.internal_static_google_iam_v2_Policy_descriptor; } @SuppressWarnings({"rawtypes"}) @java.lang.Override - protected com.google.protobuf.MapField internalGetMapField(int number) { + protected com.google.protobuf.MapFieldReflectionAccessor internalGetMapFieldReflection( + int number) { switch (number) { case 5: return internalGetAnnotations(); @@ -74,25 +78,32 @@ protected com.google.protobuf.MapField internalGetMapField(int number) { } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.iam.v2.PolicyProto.internal_static_google_iam_v2_Policy_fieldAccessorTable .ensureFieldAccessorsInitialized( com.google.iam.v2.Policy.class, com.google.iam.v2.Policy.Builder.class); } + private int bitField0_; public static final int NAME_FIELD_NUMBER = 1; - private volatile java.lang.Object name_; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** * * *
            * Immutable. The resource name of the `Policy`, which must be unique. Format:
            * `policies/{attachment_point}/denypolicies/{policy_id}`
        +   *
        +   *
            * The attachment point is identified by its URL-encoded full resource name,
            * which means that the forward-slash character, `/`, must be written as
            * `%2F`. For example,
            * `policies/cloudresourcemanager.googleapis.com%2Fprojects%2Fmy-project/denypolicies/my-deny-policy`.
        +   *
            * For organizations and folders, use the numeric ID in the full resource
            * name. For projects, requests can use the alphanumeric or the numeric ID.
            * Responses always contain the numeric ID.
        @@ -114,16 +125,20 @@ public java.lang.String getName() {
               return s;
             }
           }
        +
           /**
            *
            *
            * 
            * Immutable. The resource name of the `Policy`, which must be unique. Format:
            * `policies/{attachment_point}/denypolicies/{policy_id}`
        +   *
        +   *
            * The attachment point is identified by its URL-encoded full resource name,
            * which means that the forward-slash character, `/`, must be written as
            * `%2F`. For example,
            * `policies/cloudresourcemanager.googleapis.com%2Fprojects%2Fmy-project/denypolicies/my-deny-policy`.
        +   *
            * For organizations and folders, use the numeric ID in the full resource
            * name. For projects, requests can use the alphanumeric or the numeric ID.
            * Responses always contain the numeric ID.
        @@ -147,7 +162,10 @@ public com.google.protobuf.ByteString getNameBytes() {
           }
         
           public static final int UID_FIELD_NUMBER = 2;
        -  private volatile java.lang.Object uid_;
        +
        +  @SuppressWarnings("serial")
        +  private volatile java.lang.Object uid_ = "";
        +
           /**
            *
            *
        @@ -172,6 +190,7 @@ public java.lang.String getUid() {
               return s;
             }
           }
        +
           /**
            *
            *
        @@ -198,7 +217,10 @@ public com.google.protobuf.ByteString getUidBytes() {
           }
         
           public static final int KIND_FIELD_NUMBER = 3;
        -  private volatile java.lang.Object kind_;
        +
        +  @SuppressWarnings("serial")
        +  private volatile java.lang.Object kind_ = "";
        +
           /**
            *
            *
        @@ -222,6 +244,7 @@ public java.lang.String getKind() {
               return s;
             }
           }
        +
           /**
            *
            *
        @@ -247,7 +270,10 @@ public com.google.protobuf.ByteString getKindBytes() {
           }
         
           public static final int DISPLAY_NAME_FIELD_NUMBER = 4;
        -  private volatile java.lang.Object displayName_;
        +
        +  @SuppressWarnings("serial")
        +  private volatile java.lang.Object displayName_ = "";
        +
           /**
            *
            *
        @@ -272,6 +298,7 @@ public java.lang.String getDisplayName() {
               return s;
             }
           }
        +
           /**
            *
            *
        @@ -310,6 +337,7 @@ private static final class AnnotationsDefaultEntryHolder {
                     "");
           }
         
        +  @SuppressWarnings("serial")
           private com.google.protobuf.MapField annotations_;
         
           private com.google.protobuf.MapField
        @@ -323,6 +351,7 @@ private static final class AnnotationsDefaultEntryHolder {
           public int getAnnotationsCount() {
             return internalGetAnnotations().getMap().size();
           }
        +
           /**
            *
            *
        @@ -340,12 +369,14 @@ public boolean containsAnnotations(java.lang.String key) {
             }
             return internalGetAnnotations().getMap().containsKey(key);
           }
        +
           /** Use {@link #getAnnotationsMap()} instead. */
           @java.lang.Override
           @java.lang.Deprecated
           public java.util.Map getAnnotations() {
             return getAnnotationsMap();
           }
        +
           /**
            *
            *
        @@ -360,6 +391,7 @@ public java.util.Map getAnnotations() {
           public java.util.Map getAnnotationsMap() {
             return internalGetAnnotations().getMap();
           }
        +
           /**
            *
            *
        @@ -371,14 +403,17 @@ public java.util.Map getAnnotationsMap() {
            * map<string, string> annotations = 5;
            */
           @java.lang.Override
        -  public java.lang.String getAnnotationsOrDefault(
        -      java.lang.String key, java.lang.String defaultValue) {
        +  public /* nullable */ java.lang.String getAnnotationsOrDefault(
        +      java.lang.String key,
        +      /* nullable */
        +      java.lang.String defaultValue) {
             if (key == null) {
               throw new NullPointerException("map key");
             }
             java.util.Map map = internalGetAnnotations().getMap();
             return map.containsKey(key) ? map.get(key) : defaultValue;
           }
        +
           /**
            *
            *
        @@ -402,7 +437,10 @@ public java.lang.String getAnnotationsOrThrow(java.lang.String key) {
           }
         
           public static final int ETAG_FIELD_NUMBER = 6;
        -  private volatile java.lang.Object etag_;
        +
        +  @SuppressWarnings("serial")
        +  private volatile java.lang.Object etag_ = "";
        +
           /**
            *
            *
        @@ -410,6 +448,7 @@ public java.lang.String getAnnotationsOrThrow(java.lang.String key) {
            * An opaque tag that identifies the current version of the `Policy`. IAM uses
            * this value to help manage concurrent updates, so they do not cause one
            * update to be overwritten by another.
        +   *
            * If this field is present in a [CreatePolicy][] request, the value is
            * ignored.
            * 
        @@ -430,6 +469,7 @@ public java.lang.String getEtag() { return s; } } + /** * * @@ -437,6 +477,7 @@ public java.lang.String getEtag() { * An opaque tag that identifies the current version of the `Policy`. IAM uses * this value to help manage concurrent updates, so they do not cause one * update to be overwritten by another. + * * If this field is present in a [CreatePolicy][] request, the value is * ignored. *
        @@ -460,6 +501,7 @@ public com.google.protobuf.ByteString getEtagBytes() { public static final int CREATE_TIME_FIELD_NUMBER = 7; private com.google.protobuf.Timestamp createTime_; + /** * * @@ -474,8 +516,9 @@ public com.google.protobuf.ByteString getEtagBytes() { */ @java.lang.Override public boolean hasCreateTime() { - return createTime_ != null; + return ((bitField0_ & 0x00000001) != 0); } + /** * * @@ -492,6 +535,7 @@ public boolean hasCreateTime() { public com.google.protobuf.Timestamp getCreateTime() { return createTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : createTime_; } + /** * * @@ -504,11 +548,12 @@ public com.google.protobuf.Timestamp getCreateTime() { */ @java.lang.Override public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { - return getCreateTime(); + return createTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : createTime_; } public static final int UPDATE_TIME_FIELD_NUMBER = 8; private com.google.protobuf.Timestamp updateTime_; + /** * * @@ -523,8 +568,9 @@ public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { */ @java.lang.Override public boolean hasUpdateTime() { - return updateTime_ != null; + return ((bitField0_ & 0x00000002) != 0); } + /** * * @@ -541,6 +587,7 @@ public boolean hasUpdateTime() { public com.google.protobuf.Timestamp getUpdateTime() { return updateTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : updateTime_; } + /** * * @@ -553,11 +600,12 @@ public com.google.protobuf.Timestamp getUpdateTime() { */ @java.lang.Override public com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder() { - return getUpdateTime(); + return updateTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : updateTime_; } public static final int DELETE_TIME_FIELD_NUMBER = 9; private com.google.protobuf.Timestamp deleteTime_; + /** * * @@ -572,8 +620,9 @@ public com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder() { */ @java.lang.Override public boolean hasDeleteTime() { - return deleteTime_ != null; + return ((bitField0_ & 0x00000004) != 0); } + /** * * @@ -590,6 +639,7 @@ public boolean hasDeleteTime() { public com.google.protobuf.Timestamp getDeleteTime() { return deleteTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : deleteTime_; } + /** * * @@ -602,11 +652,14 @@ public com.google.protobuf.Timestamp getDeleteTime() { */ @java.lang.Override public com.google.protobuf.TimestampOrBuilder getDeleteTimeOrBuilder() { - return getDeleteTime(); + return deleteTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : deleteTime_; } public static final int RULES_FIELD_NUMBER = 10; + + @SuppressWarnings("serial") private java.util.List rules_; + /** * * @@ -621,6 +674,7 @@ public com.google.protobuf.TimestampOrBuilder getDeleteTimeOrBuilder() { public java.util.List getRulesList() { return rules_; } + /** * * @@ -635,6 +689,7 @@ public java.util.List getRulesList() { public java.util.List getRulesOrBuilderList() { return rules_; } + /** * * @@ -649,6 +704,7 @@ public java.util.List getRulesO public int getRulesCount() { return rules_.size(); } + /** * * @@ -663,6 +719,7 @@ public int getRulesCount() { public com.google.iam.v2.PolicyRule getRules(int index) { return rules_.get(index); } + /** * * @@ -679,7 +736,10 @@ public com.google.iam.v2.PolicyRuleOrBuilder getRulesOrBuilder(int index) { } public static final int MANAGING_AUTHORITY_FIELD_NUMBER = 11; - private volatile java.lang.Object managingAuthority_; + + @SuppressWarnings("serial") + private volatile java.lang.Object managingAuthority_ = ""; + /** * * @@ -704,6 +764,7 @@ public java.lang.String getManagingAuthority() { return s; } } + /** * * @@ -743,37 +804,37 @@ public final boolean isInitialized() { @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.GeneratedMessage.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, name_); } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(uid_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 2, uid_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(uid_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, uid_); } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(kind_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 3, kind_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(kind_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 3, kind_); } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(displayName_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 4, displayName_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(displayName_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 4, displayName_); } - com.google.protobuf.GeneratedMessageV3.serializeStringMapTo( + com.google.protobuf.GeneratedMessage.serializeStringMapTo( output, internalGetAnnotations(), AnnotationsDefaultEntryHolder.defaultEntry, 5); - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(etag_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 6, etag_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(etag_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 6, etag_); } - if (createTime_ != null) { + if (((bitField0_ & 0x00000001) != 0)) { output.writeMessage(7, getCreateTime()); } - if (updateTime_ != null) { + if (((bitField0_ & 0x00000002) != 0)) { output.writeMessage(8, getUpdateTime()); } - if (deleteTime_ != null) { + if (((bitField0_ & 0x00000004) != 0)) { output.writeMessage(9, getDeleteTime()); } for (int i = 0; i < rules_.size(); i++) { output.writeMessage(10, rules_.get(i)); } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(managingAuthority_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 11, managingAuthority_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(managingAuthority_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 11, managingAuthority_); } getUnknownFields().writeTo(output); } @@ -784,17 +845,17 @@ public int getSerializedSize() { 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.GeneratedMessage.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, name_); } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(uid_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, uid_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(uid_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, uid_); } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(kind_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, kind_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(kind_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(3, kind_); } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(displayName_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, displayName_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(displayName_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(4, displayName_); } for (java.util.Map.Entry entry : internalGetAnnotations().getMap().entrySet()) { @@ -806,23 +867,23 @@ public int getSerializedSize() { .build(); size += com.google.protobuf.CodedOutputStream.computeMessageSize(5, annotations__); } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(etag_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(6, etag_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(etag_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(6, etag_); } - if (createTime_ != null) { + if (((bitField0_ & 0x00000001) != 0)) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(7, getCreateTime()); } - if (updateTime_ != null) { + if (((bitField0_ & 0x00000002) != 0)) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(8, getUpdateTime()); } - if (deleteTime_ != null) { + if (((bitField0_ & 0x00000004) != 0)) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(9, getDeleteTime()); } for (int i = 0; i < rules_.size(); i++) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(10, rules_.get(i)); } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(managingAuthority_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(11, managingAuthority_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(managingAuthority_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(11, managingAuthority_); } size += getUnknownFields().getSerializedSize(); memoizedSize = size; @@ -943,38 +1004,38 @@ public static com.google.iam.v2.Policy parseFrom( public static com.google.iam.v2.Policy parseFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); } public static com.google.iam.v2.Policy parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } public static com.google.iam.v2.Policy parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); } public static com.google.iam.v2.Policy parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( PARSER, input, extensionRegistry); } public static com.google.iam.v2.Policy parseFrom(com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); } public static com.google.iam.v2.Policy parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } @@ -997,10 +1058,11 @@ public Builder toBuilder() { } @java.lang.Override - protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { Builder builder = new Builder(parent); return builder; } + /** * * @@ -1010,7 +1072,7 @@ protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.Build * * Protobuf type {@code google.iam.v2.Policy} */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder implements // @@protoc_insertion_point(builder_implements:google.iam.v2.Policy) com.google.iam.v2.PolicyOrBuilder { @@ -1019,7 +1081,8 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } @SuppressWarnings({"rawtypes"}) - protected com.google.protobuf.MapField internalGetMapField(int number) { + protected com.google.protobuf.MapFieldReflectionAccessor internalGetMapFieldReflection( + int number) { switch (number) { case 5: return internalGetAnnotations(); @@ -1029,7 +1092,8 @@ protected com.google.protobuf.MapField internalGetMapField(int number) { } @SuppressWarnings({"rawtypes"}) - protected com.google.protobuf.MapField internalGetMutableMapField(int number) { + protected com.google.protobuf.MapFieldReflectionAccessor internalGetMutableMapFieldReflection( + int number) { switch (number) { case 5: return internalGetMutableAnnotations(); @@ -1039,7 +1103,7 @@ protected com.google.protobuf.MapField internalGetMutableMapField(int number) { } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.iam.v2.PolicyProto.internal_static_google_iam_v2_Policy_fieldAccessorTable .ensureFieldAccessorsInitialized( @@ -1047,42 +1111,47 @@ protected com.google.protobuf.MapField internalGetMutableMapField(int number) { } // Construct using com.google.iam.v2.Policy.newBuilder() - private Builder() {} + private Builder() { + maybeForceBuilderInitialization(); + } - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetCreateTimeFieldBuilder(); + internalGetUpdateTimeFieldBuilder(); + internalGetDeleteTimeFieldBuilder(); + internalGetRulesFieldBuilder(); + } } @java.lang.Override public Builder clear() { super.clear(); + bitField0_ = 0; name_ = ""; - uid_ = ""; - kind_ = ""; - displayName_ = ""; - internalGetMutableAnnotations().clear(); etag_ = ""; - - if (createTimeBuilder_ == null) { - createTime_ = null; - } else { - createTime_ = null; + createTime_ = null; + if (createTimeBuilder_ != null) { + createTimeBuilder_.dispose(); createTimeBuilder_ = null; } - if (updateTimeBuilder_ == null) { - updateTime_ = null; - } else { - updateTime_ = null; + updateTime_ = null; + if (updateTimeBuilder_ != null) { + updateTimeBuilder_.dispose(); updateTimeBuilder_ = null; } - if (deleteTimeBuilder_ == null) { - deleteTime_ = null; - } else { - deleteTime_ = null; + deleteTime_ = null; + if (deleteTimeBuilder_ != null) { + deleteTimeBuilder_.dispose(); deleteTimeBuilder_ = null; } if (rulesBuilder_ == null) { @@ -1091,9 +1160,8 @@ public Builder clear() { rules_ = null; rulesBuilder_.clear(); } - bitField0_ = (bitField0_ & ~0x00000002); + bitField0_ = (bitField0_ & ~0x00000200); managingAuthority_ = ""; - return this; } @@ -1119,74 +1187,64 @@ public com.google.iam.v2.Policy build() { @java.lang.Override public com.google.iam.v2.Policy buildPartial() { com.google.iam.v2.Policy result = new com.google.iam.v2.Policy(this); - int from_bitField0_ = bitField0_; - result.name_ = name_; - result.uid_ = uid_; - result.kind_ = kind_; - result.displayName_ = displayName_; - result.annotations_ = internalGetAnnotations(); - result.annotations_.makeImmutable(); - result.etag_ = etag_; - if (createTimeBuilder_ == null) { - result.createTime_ = createTime_; - } else { - result.createTime_ = createTimeBuilder_.build(); - } - if (updateTimeBuilder_ == null) { - result.updateTime_ = updateTime_; - } else { - result.updateTime_ = updateTimeBuilder_.build(); - } - if (deleteTimeBuilder_ == null) { - result.deleteTime_ = deleteTime_; - } else { - result.deleteTime_ = deleteTimeBuilder_.build(); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields(com.google.iam.v2.Policy result) { if (rulesBuilder_ == null) { - if (((bitField0_ & 0x00000002) != 0)) { + if (((bitField0_ & 0x00000200) != 0)) { rules_ = java.util.Collections.unmodifiableList(rules_); - bitField0_ = (bitField0_ & ~0x00000002); + bitField0_ = (bitField0_ & ~0x00000200); } result.rules_ = rules_; } else { result.rules_ = rulesBuilder_.build(); } - result.managingAuthority_ = managingAuthority_; - 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); + private void buildPartial0(com.google.iam.v2.Policy result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.uid_ = uid_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.kind_ = kind_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.displayName_ = displayName_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.annotations_ = internalGetAnnotations(); + result.annotations_.makeImmutable(); + } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.etag_ = etag_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000040) != 0)) { + result.createTime_ = createTimeBuilder_ == null ? createTime_ : createTimeBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000080) != 0)) { + result.updateTime_ = updateTimeBuilder_ == null ? updateTime_ : updateTimeBuilder_.build(); + to_bitField0_ |= 0x00000002; + } + if (((from_bitField0_ & 0x00000100) != 0)) { + result.deleteTime_ = deleteTimeBuilder_ == null ? deleteTime_ : deleteTimeBuilder_.build(); + to_bitField0_ |= 0x00000004; + } + if (((from_bitField0_ & 0x00000400) != 0)) { + result.managingAuthority_ = managingAuthority_; + } + result.bitField0_ |= to_bitField0_; } @java.lang.Override @@ -1203,23 +1261,29 @@ public Builder mergeFrom(com.google.iam.v2.Policy other) { if (other == com.google.iam.v2.Policy.getDefaultInstance()) return this; if (!other.getName().isEmpty()) { name_ = other.name_; + bitField0_ |= 0x00000001; onChanged(); } if (!other.getUid().isEmpty()) { uid_ = other.uid_; + bitField0_ |= 0x00000002; onChanged(); } if (!other.getKind().isEmpty()) { kind_ = other.kind_; + bitField0_ |= 0x00000004; onChanged(); } if (!other.getDisplayName().isEmpty()) { displayName_ = other.displayName_; + bitField0_ |= 0x00000008; onChanged(); } internalGetMutableAnnotations().mergeFrom(other.internalGetAnnotations()); + bitField0_ |= 0x00000010; if (!other.getEtag().isEmpty()) { etag_ = other.etag_; + bitField0_ |= 0x00000020; onChanged(); } if (other.hasCreateTime()) { @@ -1235,7 +1299,7 @@ public Builder mergeFrom(com.google.iam.v2.Policy other) { if (!other.rules_.isEmpty()) { if (rules_.isEmpty()) { rules_ = other.rules_; - bitField0_ = (bitField0_ & ~0x00000002); + bitField0_ = (bitField0_ & ~0x00000200); } else { ensureRulesIsMutable(); rules_.addAll(other.rules_); @@ -1248,10 +1312,10 @@ public Builder mergeFrom(com.google.iam.v2.Policy other) { rulesBuilder_.dispose(); rulesBuilder_ = null; rules_ = other.rules_; - bitField0_ = (bitField0_ & ~0x00000002); + bitField0_ = (bitField0_ & ~0x00000200); rulesBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders - ? getRulesFieldBuilder() + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders + ? internalGetRulesFieldBuilder() : null; } else { rulesBuilder_.addAllMessages(other.rules_); @@ -1260,6 +1324,7 @@ public Builder mergeFrom(com.google.iam.v2.Policy other) { } if (!other.getManagingAuthority().isEmpty()) { managingAuthority_ = other.managingAuthority_; + bitField0_ |= 0x00000400; onChanged(); } this.mergeUnknownFields(other.getUnknownFields()); @@ -1291,25 +1356,25 @@ public Builder mergeFrom( case 10: { name_ = input.readStringRequireUtf8(); - + bitField0_ |= 0x00000001; break; } // case 10 case 18: { uid_ = input.readStringRequireUtf8(); - + bitField0_ |= 0x00000002; break; } // case 18 case 26: { kind_ = input.readStringRequireUtf8(); - + bitField0_ |= 0x00000004; break; } // case 26 case 34: { displayName_ = input.readStringRequireUtf8(); - + bitField0_ |= 0x00000008; break; } // case 34 case 42: @@ -1321,30 +1386,34 @@ public Builder mergeFrom( internalGetMutableAnnotations() .getMutableMap() .put(annotations__.getKey(), annotations__.getValue()); + bitField0_ |= 0x00000010; break; } // case 42 case 50: { etag_ = input.readStringRequireUtf8(); - + bitField0_ |= 0x00000020; break; } // case 50 case 58: { - input.readMessage(getCreateTimeFieldBuilder().getBuilder(), extensionRegistry); - + input.readMessage( + internalGetCreateTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000040; break; } // case 58 case 66: { - input.readMessage(getUpdateTimeFieldBuilder().getBuilder(), extensionRegistry); - + input.readMessage( + internalGetUpdateTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000080; break; } // case 66 case 74: { - input.readMessage(getDeleteTimeFieldBuilder().getBuilder(), extensionRegistry); - + input.readMessage( + internalGetDeleteTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000100; break; } // case 74 case 82: @@ -1362,7 +1431,7 @@ public Builder mergeFrom( case 90: { managingAuthority_ = input.readStringRequireUtf8(); - + bitField0_ |= 0x00000400; break; } // case 90 default: @@ -1385,16 +1454,20 @@ public Builder mergeFrom( private int bitField0_; private java.lang.Object name_ = ""; + /** * * *
              * Immutable. The resource name of the `Policy`, which must be unique. Format:
              * `policies/{attachment_point}/denypolicies/{policy_id}`
        +     *
        +     *
              * The attachment point is identified by its URL-encoded full resource name,
              * which means that the forward-slash character, `/`, must be written as
              * `%2F`. For example,
              * `policies/cloudresourcemanager.googleapis.com%2Fprojects%2Fmy-project/denypolicies/my-deny-policy`.
        +     *
              * For organizations and folders, use the numeric ID in the full resource
              * name. For projects, requests can use the alphanumeric or the numeric ID.
              * Responses always contain the numeric ID.
        @@ -1415,16 +1488,20 @@ public java.lang.String getName() {
                 return (java.lang.String) ref;
               }
             }
        +
             /**
              *
              *
              * 
              * Immutable. The resource name of the `Policy`, which must be unique. Format:
              * `policies/{attachment_point}/denypolicies/{policy_id}`
        +     *
        +     *
              * The attachment point is identified by its URL-encoded full resource name,
              * which means that the forward-slash character, `/`, must be written as
              * `%2F`. For example,
              * `policies/cloudresourcemanager.googleapis.com%2Fprojects%2Fmy-project/denypolicies/my-deny-policy`.
        +     *
              * For organizations and folders, use the numeric ID in the full resource
              * name. For projects, requests can use the alphanumeric or the numeric ID.
              * Responses always contain the numeric ID.
        @@ -1445,16 +1522,20 @@ public com.google.protobuf.ByteString getNameBytes() {
                 return (com.google.protobuf.ByteString) ref;
               }
             }
        +
             /**
              *
              *
              * 
              * Immutable. The resource name of the `Policy`, which must be unique. Format:
              * `policies/{attachment_point}/denypolicies/{policy_id}`
        +     *
        +     *
              * The attachment point is identified by its URL-encoded full resource name,
              * which means that the forward-slash character, `/`, must be written as
              * `%2F`. For example,
              * `policies/cloudresourcemanager.googleapis.com%2Fprojects%2Fmy-project/denypolicies/my-deny-policy`.
        +     *
              * For organizations and folders, use the numeric ID in the full resource
              * name. For projects, requests can use the alphanumeric or the numeric ID.
              * Responses always contain the numeric ID.
        @@ -1469,21 +1550,25 @@ public Builder setName(java.lang.String value) {
               if (value == null) {
                 throw new NullPointerException();
               }
        -
               name_ = value;
        +      bitField0_ |= 0x00000001;
               onChanged();
               return this;
             }
        +
             /**
              *
              *
              * 
              * Immutable. The resource name of the `Policy`, which must be unique. Format:
              * `policies/{attachment_point}/denypolicies/{policy_id}`
        +     *
        +     *
              * The attachment point is identified by its URL-encoded full resource name,
              * which means that the forward-slash character, `/`, must be written as
              * `%2F`. For example,
              * `policies/cloudresourcemanager.googleapis.com%2Fprojects%2Fmy-project/denypolicies/my-deny-policy`.
        +     *
              * For organizations and folders, use the numeric ID in the full resource
              * name. For projects, requests can use the alphanumeric or the numeric ID.
              * Responses always contain the numeric ID.
        @@ -1494,21 +1579,25 @@ public Builder setName(java.lang.String value) {
              * @return This builder for chaining.
              */
             public Builder clearName() {
        -
               name_ = getDefaultInstance().getName();
        +      bitField0_ = (bitField0_ & ~0x00000001);
               onChanged();
               return this;
             }
        +
             /**
              *
              *
              * 
              * Immutable. The resource name of the `Policy`, which must be unique. Format:
              * `policies/{attachment_point}/denypolicies/{policy_id}`
        +     *
        +     *
              * The attachment point is identified by its URL-encoded full resource name,
              * which means that the forward-slash character, `/`, must be written as
              * `%2F`. For example,
              * `policies/cloudresourcemanager.googleapis.com%2Fprojects%2Fmy-project/denypolicies/my-deny-policy`.
        +     *
              * For organizations and folders, use the numeric ID in the full resource
              * name. For projects, requests can use the alphanumeric or the numeric ID.
              * Responses always contain the numeric ID.
        @@ -1524,13 +1613,14 @@ public Builder setNameBytes(com.google.protobuf.ByteString value) {
                 throw new NullPointerException();
               }
               checkByteStringIsUtf8(value);
        -
               name_ = value;
        +      bitField0_ |= 0x00000001;
               onChanged();
               return this;
             }
         
             private java.lang.Object uid_ = "";
        +
             /**
              *
              *
        @@ -1554,6 +1644,7 @@ public java.lang.String getUid() {
                 return (java.lang.String) ref;
               }
             }
        +
             /**
              *
              *
        @@ -1577,6 +1668,7 @@ public com.google.protobuf.ByteString getUidBytes() {
                 return (com.google.protobuf.ByteString) ref;
               }
             }
        +
             /**
              *
              *
        @@ -1594,11 +1686,12 @@ public Builder setUid(java.lang.String value) {
               if (value == null) {
                 throw new NullPointerException();
               }
        -
               uid_ = value;
        +      bitField0_ |= 0x00000002;
               onChanged();
               return this;
             }
        +
             /**
              *
              *
        @@ -1612,11 +1705,12 @@ public Builder setUid(java.lang.String value) {
              * @return This builder for chaining.
              */
             public Builder clearUid() {
        -
               uid_ = getDefaultInstance().getUid();
        +      bitField0_ = (bitField0_ & ~0x00000002);
               onChanged();
               return this;
             }
        +
             /**
              *
              *
        @@ -1635,13 +1729,14 @@ public Builder setUidBytes(com.google.protobuf.ByteString value) {
                 throw new NullPointerException();
               }
               checkByteStringIsUtf8(value);
        -
               uid_ = value;
        +      bitField0_ |= 0x00000002;
               onChanged();
               return this;
             }
         
             private java.lang.Object kind_ = "";
        +
             /**
              *
              *
        @@ -1664,6 +1759,7 @@ public java.lang.String getKind() {
                 return (java.lang.String) ref;
               }
             }
        +
             /**
              *
              *
        @@ -1686,6 +1782,7 @@ public com.google.protobuf.ByteString getKindBytes() {
                 return (com.google.protobuf.ByteString) ref;
               }
             }
        +
             /**
              *
              *
        @@ -1702,11 +1799,12 @@ public Builder setKind(java.lang.String value) {
               if (value == null) {
                 throw new NullPointerException();
               }
        -
               kind_ = value;
        +      bitField0_ |= 0x00000004;
               onChanged();
               return this;
             }
        +
             /**
              *
              *
        @@ -1719,11 +1817,12 @@ public Builder setKind(java.lang.String value) {
              * @return This builder for chaining.
              */
             public Builder clearKind() {
        -
               kind_ = getDefaultInstance().getKind();
        +      bitField0_ = (bitField0_ & ~0x00000004);
               onChanged();
               return this;
             }
        +
             /**
              *
              *
        @@ -1741,13 +1840,14 @@ public Builder setKindBytes(com.google.protobuf.ByteString value) {
                 throw new NullPointerException();
               }
               checkByteStringIsUtf8(value);
        -
               kind_ = value;
        +      bitField0_ |= 0x00000004;
               onChanged();
               return this;
             }
         
             private java.lang.Object displayName_ = "";
        +
             /**
              *
              *
        @@ -1771,6 +1871,7 @@ public java.lang.String getDisplayName() {
                 return (java.lang.String) ref;
               }
             }
        +
             /**
              *
              *
        @@ -1794,6 +1895,7 @@ public com.google.protobuf.ByteString getDisplayNameBytes() {
                 return (com.google.protobuf.ByteString) ref;
               }
             }
        +
             /**
              *
              *
        @@ -1811,11 +1913,12 @@ public Builder setDisplayName(java.lang.String value) {
               if (value == null) {
                 throw new NullPointerException();
               }
        -
               displayName_ = value;
        +      bitField0_ |= 0x00000008;
               onChanged();
               return this;
             }
        +
             /**
              *
              *
        @@ -1829,11 +1932,12 @@ public Builder setDisplayName(java.lang.String value) {
              * @return This builder for chaining.
              */
             public Builder clearDisplayName() {
        -
               displayName_ = getDefaultInstance().getDisplayName();
        +      bitField0_ = (bitField0_ & ~0x00000008);
               onChanged();
               return this;
             }
        +
             /**
              *
              *
        @@ -1852,8 +1956,8 @@ public Builder setDisplayNameBytes(com.google.protobuf.ByteString value) {
                 throw new NullPointerException();
               }
               checkByteStringIsUtf8(value);
        -
               displayName_ = value;
        +      bitField0_ |= 0x00000008;
               onChanged();
               return this;
             }
        @@ -1871,8 +1975,6 @@ public Builder setDisplayNameBytes(com.google.protobuf.ByteString value) {
         
             private com.google.protobuf.MapField
                 internalGetMutableAnnotations() {
        -      onChanged();
        -      ;
               if (annotations_ == null) {
                 annotations_ =
                     com.google.protobuf.MapField.newMapField(AnnotationsDefaultEntryHolder.defaultEntry);
        @@ -1880,12 +1982,15 @@ public Builder setDisplayNameBytes(com.google.protobuf.ByteString value) {
               if (!annotations_.isMutable()) {
                 annotations_ = annotations_.copy();
               }
        +      bitField0_ |= 0x00000010;
        +      onChanged();
               return annotations_;
             }
         
             public int getAnnotationsCount() {
               return internalGetAnnotations().getMap().size();
             }
        +
             /**
              *
              *
        @@ -1903,12 +2008,14 @@ public boolean containsAnnotations(java.lang.String key) {
               }
               return internalGetAnnotations().getMap().containsKey(key);
             }
        +
             /** Use {@link #getAnnotationsMap()} instead. */
             @java.lang.Override
             @java.lang.Deprecated
             public java.util.Map getAnnotations() {
               return getAnnotationsMap();
             }
        +
             /**
              *
              *
        @@ -1923,6 +2030,7 @@ public java.util.Map getAnnotations() {
             public java.util.Map getAnnotationsMap() {
               return internalGetAnnotations().getMap();
             }
        +
             /**
              *
              *
        @@ -1934,14 +2042,17 @@ public java.util.Map getAnnotationsMap() {
              * map<string, string> annotations = 5;
              */
             @java.lang.Override
        -    public java.lang.String getAnnotationsOrDefault(
        -        java.lang.String key, java.lang.String defaultValue) {
        +    public /* nullable */ java.lang.String getAnnotationsOrDefault(
        +        java.lang.String key,
        +        /* nullable */
        +        java.lang.String defaultValue) {
               if (key == null) {
                 throw new NullPointerException("map key");
               }
               java.util.Map map = internalGetAnnotations().getMap();
               return map.containsKey(key) ? map.get(key) : defaultValue;
             }
        +
             /**
              *
              *
        @@ -1965,9 +2076,11 @@ public java.lang.String getAnnotationsOrThrow(java.lang.String key) {
             }
         
             public Builder clearAnnotations() {
        +      bitField0_ = (bitField0_ & ~0x00000010);
               internalGetMutableAnnotations().getMutableMap().clear();
               return this;
             }
        +
             /**
              *
              *
        @@ -1985,11 +2098,14 @@ public Builder removeAnnotations(java.lang.String key) {
               internalGetMutableAnnotations().getMutableMap().remove(key);
               return this;
             }
        +
             /** Use alternate mutation accessors instead. */
             @java.lang.Deprecated
             public java.util.Map getMutableAnnotations() {
        +      bitField0_ |= 0x00000010;
               return internalGetMutableAnnotations().getMutableMap();
             }
        +
             /**
              *
              *
        @@ -2007,10 +2123,11 @@ public Builder putAnnotations(java.lang.String key, java.lang.String value) {
               if (value == null) {
                 throw new NullPointerException("map value");
               }
        -
               internalGetMutableAnnotations().getMutableMap().put(key, value);
        +      bitField0_ |= 0x00000010;
               return this;
             }
        +
             /**
              *
              *
        @@ -2023,10 +2140,12 @@ public Builder putAnnotations(java.lang.String key, java.lang.String value) {
              */
             public Builder putAllAnnotations(java.util.Map values) {
               internalGetMutableAnnotations().getMutableMap().putAll(values);
        +      bitField0_ |= 0x00000010;
               return this;
             }
         
             private java.lang.Object etag_ = "";
        +
             /**
              *
              *
        @@ -2034,6 +2153,7 @@ public Builder putAllAnnotations(java.util.Map
        @@ -2053,6 +2173,7 @@ public java.lang.String getEtag() {
                 return (java.lang.String) ref;
               }
             }
        +
             /**
              *
              *
        @@ -2060,6 +2181,7 @@ public java.lang.String getEtag() {
              * An opaque tag that identifies the current version of the `Policy`. IAM uses
              * this value to help manage concurrent updates, so they do not cause one
              * update to be overwritten by another.
        +     *
              * If this field is present in a [CreatePolicy][] request, the value is
              * ignored.
              * 
        @@ -2079,6 +2201,7 @@ public com.google.protobuf.ByteString getEtagBytes() { return (com.google.protobuf.ByteString) ref; } } + /** * * @@ -2086,6 +2209,7 @@ public com.google.protobuf.ByteString getEtagBytes() { * An opaque tag that identifies the current version of the `Policy`. IAM uses * this value to help manage concurrent updates, so they do not cause one * update to be overwritten by another. + * * If this field is present in a [CreatePolicy][] request, the value is * ignored. *
        @@ -2099,11 +2223,12 @@ public Builder setEtag(java.lang.String value) { if (value == null) { throw new NullPointerException(); } - etag_ = value; + bitField0_ |= 0x00000020; onChanged(); return this; } + /** * * @@ -2111,6 +2236,7 @@ public Builder setEtag(java.lang.String value) { * An opaque tag that identifies the current version of the `Policy`. IAM uses * this value to help manage concurrent updates, so they do not cause one * update to be overwritten by another. + * * If this field is present in a [CreatePolicy][] request, the value is * ignored. *
        @@ -2120,11 +2246,12 @@ public Builder setEtag(java.lang.String value) { * @return This builder for chaining. */ public Builder clearEtag() { - etag_ = getDefaultInstance().getEtag(); + bitField0_ = (bitField0_ & ~0x00000020); onChanged(); return this; } + /** * * @@ -2132,6 +2259,7 @@ public Builder clearEtag() { * An opaque tag that identifies the current version of the `Policy`. IAM uses * this value to help manage concurrent updates, so they do not cause one * update to be overwritten by another. + * * If this field is present in a [CreatePolicy][] request, the value is * ignored. *
        @@ -2146,18 +2274,19 @@ public Builder setEtagBytes(com.google.protobuf.ByteString value) { throw new NullPointerException(); } checkByteStringIsUtf8(value); - etag_ = value; + bitField0_ |= 0x00000020; onChanged(); return this; } private com.google.protobuf.Timestamp createTime_; - private com.google.protobuf.SingleFieldBuilderV3< + private com.google.protobuf.SingleFieldBuilder< com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder> createTimeBuilder_; + /** * * @@ -2172,8 +2301,9 @@ public Builder setEtagBytes(com.google.protobuf.ByteString value) { * @return Whether the createTime field is set. */ public boolean hasCreateTime() { - return createTimeBuilder_ != null || createTime_ != null; + return ((bitField0_ & 0x00000040) != 0); } + /** * * @@ -2196,6 +2326,7 @@ public com.google.protobuf.Timestamp getCreateTime() { return createTimeBuilder_.getMessage(); } } + /** * * @@ -2213,13 +2344,14 @@ public Builder setCreateTime(com.google.protobuf.Timestamp value) { throw new NullPointerException(); } createTime_ = value; - onChanged(); } else { createTimeBuilder_.setMessage(value); } - + bitField0_ |= 0x00000040; + onChanged(); return this; } + /** * * @@ -2234,13 +2366,14 @@ public Builder setCreateTime(com.google.protobuf.Timestamp value) { public Builder setCreateTime(com.google.protobuf.Timestamp.Builder builderForValue) { if (createTimeBuilder_ == null) { createTime_ = builderForValue.build(); - onChanged(); } else { createTimeBuilder_.setMessage(builderForValue.build()); } - + bitField0_ |= 0x00000040; + onChanged(); return this; } + /** * * @@ -2254,19 +2387,23 @@ public Builder setCreateTime(com.google.protobuf.Timestamp.Builder builderForVal */ public Builder mergeCreateTime(com.google.protobuf.Timestamp value) { if (createTimeBuilder_ == null) { - if (createTime_ != null) { - createTime_ = - com.google.protobuf.Timestamp.newBuilder(createTime_).mergeFrom(value).buildPartial(); + if (((bitField0_ & 0x00000040) != 0) + && createTime_ != null + && createTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getCreateTimeBuilder().mergeFrom(value); } else { createTime_ = value; } - onChanged(); } else { createTimeBuilder_.mergeFrom(value); } - + if (createTime_ != null) { + bitField0_ |= 0x00000040; + onChanged(); + } return this; } + /** * * @@ -2279,16 +2416,16 @@ public Builder mergeCreateTime(com.google.protobuf.Timestamp value) { * */ public Builder clearCreateTime() { - if (createTimeBuilder_ == null) { - createTime_ = null; - onChanged(); - } else { - createTime_ = null; + bitField0_ = (bitField0_ & ~0x00000040); + createTime_ = null; + if (createTimeBuilder_ != null) { + createTimeBuilder_.dispose(); createTimeBuilder_ = null; } - + onChanged(); return this; } + /** * * @@ -2301,10 +2438,11 @@ public Builder clearCreateTime() { * */ public com.google.protobuf.Timestamp.Builder getCreateTimeBuilder() { - + bitField0_ |= 0x00000040; onChanged(); - return getCreateTimeFieldBuilder().getBuilder(); + return internalGetCreateTimeFieldBuilder().getBuilder(); } + /** * * @@ -2325,6 +2463,7 @@ public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { : createTime_; } } + /** * * @@ -2336,14 +2475,14 @@ public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { * .google.protobuf.Timestamp create_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; * */ - private com.google.protobuf.SingleFieldBuilderV3< + private com.google.protobuf.SingleFieldBuilder< com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder> - getCreateTimeFieldBuilder() { + internalGetCreateTimeFieldBuilder() { if (createTimeBuilder_ == null) { createTimeBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< + new com.google.protobuf.SingleFieldBuilder< com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder>( @@ -2354,11 +2493,12 @@ public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { } private com.google.protobuf.Timestamp updateTime_; - private com.google.protobuf.SingleFieldBuilderV3< + private com.google.protobuf.SingleFieldBuilder< com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder> updateTimeBuilder_; + /** * * @@ -2373,8 +2513,9 @@ public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { * @return Whether the updateTime field is set. */ public boolean hasUpdateTime() { - return updateTimeBuilder_ != null || updateTime_ != null; + return ((bitField0_ & 0x00000080) != 0); } + /** * * @@ -2397,6 +2538,7 @@ public com.google.protobuf.Timestamp getUpdateTime() { return updateTimeBuilder_.getMessage(); } } + /** * * @@ -2414,13 +2556,14 @@ public Builder setUpdateTime(com.google.protobuf.Timestamp value) { throw new NullPointerException(); } updateTime_ = value; - onChanged(); } else { updateTimeBuilder_.setMessage(value); } - + bitField0_ |= 0x00000080; + onChanged(); return this; } + /** * * @@ -2435,13 +2578,14 @@ public Builder setUpdateTime(com.google.protobuf.Timestamp value) { public Builder setUpdateTime(com.google.protobuf.Timestamp.Builder builderForValue) { if (updateTimeBuilder_ == null) { updateTime_ = builderForValue.build(); - onChanged(); } else { updateTimeBuilder_.setMessage(builderForValue.build()); } - + bitField0_ |= 0x00000080; + onChanged(); return this; } + /** * * @@ -2455,19 +2599,23 @@ public Builder setUpdateTime(com.google.protobuf.Timestamp.Builder builderForVal */ public Builder mergeUpdateTime(com.google.protobuf.Timestamp value) { if (updateTimeBuilder_ == null) { - if (updateTime_ != null) { - updateTime_ = - com.google.protobuf.Timestamp.newBuilder(updateTime_).mergeFrom(value).buildPartial(); + if (((bitField0_ & 0x00000080) != 0) + && updateTime_ != null + && updateTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getUpdateTimeBuilder().mergeFrom(value); } else { updateTime_ = value; } - onChanged(); } else { updateTimeBuilder_.mergeFrom(value); } - + if (updateTime_ != null) { + bitField0_ |= 0x00000080; + onChanged(); + } return this; } + /** * * @@ -2480,16 +2628,16 @@ public Builder mergeUpdateTime(com.google.protobuf.Timestamp value) { * */ public Builder clearUpdateTime() { - if (updateTimeBuilder_ == null) { - updateTime_ = null; - onChanged(); - } else { - updateTime_ = null; + bitField0_ = (bitField0_ & ~0x00000080); + updateTime_ = null; + if (updateTimeBuilder_ != null) { + updateTimeBuilder_.dispose(); updateTimeBuilder_ = null; } - + onChanged(); return this; } + /** * * @@ -2502,10 +2650,11 @@ public Builder clearUpdateTime() { * */ public com.google.protobuf.Timestamp.Builder getUpdateTimeBuilder() { - + bitField0_ |= 0x00000080; onChanged(); - return getUpdateTimeFieldBuilder().getBuilder(); + return internalGetUpdateTimeFieldBuilder().getBuilder(); } + /** * * @@ -2526,6 +2675,7 @@ public com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder() { : updateTime_; } } + /** * * @@ -2537,14 +2687,14 @@ public com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder() { * .google.protobuf.Timestamp update_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; * */ - private com.google.protobuf.SingleFieldBuilderV3< + private com.google.protobuf.SingleFieldBuilder< com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder> - getUpdateTimeFieldBuilder() { + internalGetUpdateTimeFieldBuilder() { if (updateTimeBuilder_ == null) { updateTimeBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< + new com.google.protobuf.SingleFieldBuilder< com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder>( @@ -2555,11 +2705,12 @@ public com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder() { } private com.google.protobuf.Timestamp deleteTime_; - private com.google.protobuf.SingleFieldBuilderV3< + private com.google.protobuf.SingleFieldBuilder< com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder> deleteTimeBuilder_; + /** * * @@ -2574,8 +2725,9 @@ public com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder() { * @return Whether the deleteTime field is set. */ public boolean hasDeleteTime() { - return deleteTimeBuilder_ != null || deleteTime_ != null; + return ((bitField0_ & 0x00000100) != 0); } + /** * * @@ -2598,6 +2750,7 @@ public com.google.protobuf.Timestamp getDeleteTime() { return deleteTimeBuilder_.getMessage(); } } + /** * * @@ -2615,13 +2768,14 @@ public Builder setDeleteTime(com.google.protobuf.Timestamp value) { throw new NullPointerException(); } deleteTime_ = value; - onChanged(); } else { deleteTimeBuilder_.setMessage(value); } - + bitField0_ |= 0x00000100; + onChanged(); return this; } + /** * * @@ -2636,13 +2790,14 @@ public Builder setDeleteTime(com.google.protobuf.Timestamp value) { public Builder setDeleteTime(com.google.protobuf.Timestamp.Builder builderForValue) { if (deleteTimeBuilder_ == null) { deleteTime_ = builderForValue.build(); - onChanged(); } else { deleteTimeBuilder_.setMessage(builderForValue.build()); } - + bitField0_ |= 0x00000100; + onChanged(); return this; } + /** * * @@ -2656,19 +2811,23 @@ public Builder setDeleteTime(com.google.protobuf.Timestamp.Builder builderForVal */ public Builder mergeDeleteTime(com.google.protobuf.Timestamp value) { if (deleteTimeBuilder_ == null) { - if (deleteTime_ != null) { - deleteTime_ = - com.google.protobuf.Timestamp.newBuilder(deleteTime_).mergeFrom(value).buildPartial(); + if (((bitField0_ & 0x00000100) != 0) + && deleteTime_ != null + && deleteTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getDeleteTimeBuilder().mergeFrom(value); } else { deleteTime_ = value; } - onChanged(); } else { deleteTimeBuilder_.mergeFrom(value); } - + if (deleteTime_ != null) { + bitField0_ |= 0x00000100; + onChanged(); + } return this; } + /** * * @@ -2681,16 +2840,16 @@ public Builder mergeDeleteTime(com.google.protobuf.Timestamp value) { * */ public Builder clearDeleteTime() { - if (deleteTimeBuilder_ == null) { - deleteTime_ = null; - onChanged(); - } else { - deleteTime_ = null; + bitField0_ = (bitField0_ & ~0x00000100); + deleteTime_ = null; + if (deleteTimeBuilder_ != null) { + deleteTimeBuilder_.dispose(); deleteTimeBuilder_ = null; } - + onChanged(); return this; } + /** * * @@ -2703,10 +2862,11 @@ public Builder clearDeleteTime() { * */ public com.google.protobuf.Timestamp.Builder getDeleteTimeBuilder() { - + bitField0_ |= 0x00000100; onChanged(); - return getDeleteTimeFieldBuilder().getBuilder(); + return internalGetDeleteTimeFieldBuilder().getBuilder(); } + /** * * @@ -2727,6 +2887,7 @@ public com.google.protobuf.TimestampOrBuilder getDeleteTimeOrBuilder() { : deleteTime_; } } + /** * * @@ -2738,14 +2899,14 @@ public com.google.protobuf.TimestampOrBuilder getDeleteTimeOrBuilder() { * .google.protobuf.Timestamp delete_time = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; * */ - private com.google.protobuf.SingleFieldBuilderV3< + private com.google.protobuf.SingleFieldBuilder< com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder> - getDeleteTimeFieldBuilder() { + internalGetDeleteTimeFieldBuilder() { if (deleteTimeBuilder_ == null) { deleteTimeBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< + new com.google.protobuf.SingleFieldBuilder< com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder>( @@ -2758,13 +2919,13 @@ public com.google.protobuf.TimestampOrBuilder getDeleteTimeOrBuilder() { private java.util.List rules_ = java.util.Collections.emptyList(); private void ensureRulesIsMutable() { - if (!((bitField0_ & 0x00000002) != 0)) { + if (!((bitField0_ & 0x00000200) != 0)) { rules_ = new java.util.ArrayList(rules_); - bitField0_ |= 0x00000002; + bitField0_ |= 0x00000200; } } - private com.google.protobuf.RepeatedFieldBuilderV3< + private com.google.protobuf.RepeatedFieldBuilder< com.google.iam.v2.PolicyRule, com.google.iam.v2.PolicyRule.Builder, com.google.iam.v2.PolicyRuleOrBuilder> @@ -2787,6 +2948,7 @@ public java.util.List getRulesList() { return rulesBuilder_.getMessageList(); } } + /** * * @@ -2804,6 +2966,7 @@ public int getRulesCount() { return rulesBuilder_.getCount(); } } + /** * * @@ -2821,6 +2984,7 @@ public com.google.iam.v2.PolicyRule getRules(int index) { return rulesBuilder_.getMessage(index); } } + /** * * @@ -2844,6 +3008,7 @@ public Builder setRules(int index, com.google.iam.v2.PolicyRule value) { } return this; } + /** * * @@ -2864,6 +3029,7 @@ public Builder setRules(int index, com.google.iam.v2.PolicyRule.Builder builderF } return this; } + /** * * @@ -2887,6 +3053,7 @@ public Builder addRules(com.google.iam.v2.PolicyRule value) { } return this; } + /** * * @@ -2910,6 +3077,7 @@ public Builder addRules(int index, com.google.iam.v2.PolicyRule value) { } return this; } + /** * * @@ -2930,6 +3098,7 @@ public Builder addRules(com.google.iam.v2.PolicyRule.Builder builderForValue) { } return this; } + /** * * @@ -2950,6 +3119,7 @@ public Builder addRules(int index, com.google.iam.v2.PolicyRule.Builder builderF } return this; } + /** * * @@ -2970,6 +3140,7 @@ public Builder addAllRules(java.lang.Iterablerepeated .google.iam.v2.PolicyRule rules = 10; */ public com.google.iam.v2.PolicyRule.Builder getRulesBuilder(int index) { - return getRulesFieldBuilder().getBuilder(index); + return internalGetRulesFieldBuilder().getBuilder(index); } + /** * * @@ -3040,6 +3214,7 @@ public com.google.iam.v2.PolicyRuleOrBuilder getRulesOrBuilder(int index) { return rulesBuilder_.getMessageOrBuilder(index); } } + /** * * @@ -3057,6 +3232,7 @@ public java.util.List getRulesO return java.util.Collections.unmodifiableList(rules_); } } + /** * * @@ -3068,8 +3244,10 @@ public java.util.List getRulesO * repeated .google.iam.v2.PolicyRule rules = 10; */ public com.google.iam.v2.PolicyRule.Builder addRulesBuilder() { - return getRulesFieldBuilder().addBuilder(com.google.iam.v2.PolicyRule.getDefaultInstance()); + return internalGetRulesFieldBuilder() + .addBuilder(com.google.iam.v2.PolicyRule.getDefaultInstance()); } + /** * * @@ -3081,9 +3259,10 @@ public com.google.iam.v2.PolicyRule.Builder addRulesBuilder() { * repeated .google.iam.v2.PolicyRule rules = 10; */ public com.google.iam.v2.PolicyRule.Builder addRulesBuilder(int index) { - return getRulesFieldBuilder() + return internalGetRulesFieldBuilder() .addBuilder(index, com.google.iam.v2.PolicyRule.getDefaultInstance()); } + /** * * @@ -3095,27 +3274,28 @@ public com.google.iam.v2.PolicyRule.Builder addRulesBuilder(int index) { * repeated .google.iam.v2.PolicyRule rules = 10; */ public java.util.List getRulesBuilderList() { - return getRulesFieldBuilder().getBuilderList(); + return internalGetRulesFieldBuilder().getBuilderList(); } - private com.google.protobuf.RepeatedFieldBuilderV3< + private com.google.protobuf.RepeatedFieldBuilder< com.google.iam.v2.PolicyRule, com.google.iam.v2.PolicyRule.Builder, com.google.iam.v2.PolicyRuleOrBuilder> - getRulesFieldBuilder() { + internalGetRulesFieldBuilder() { if (rulesBuilder_ == null) { rulesBuilder_ = - new com.google.protobuf.RepeatedFieldBuilderV3< + new com.google.protobuf.RepeatedFieldBuilder< com.google.iam.v2.PolicyRule, com.google.iam.v2.PolicyRule.Builder, com.google.iam.v2.PolicyRuleOrBuilder>( - rules_, ((bitField0_ & 0x00000002) != 0), getParentForChildren(), isClean()); + rules_, ((bitField0_ & 0x00000200) != 0), getParentForChildren(), isClean()); rules_ = null; } return rulesBuilder_; } private java.lang.Object managingAuthority_ = ""; + /** * * @@ -3139,6 +3319,7 @@ public java.lang.String getManagingAuthority() { return (java.lang.String) ref; } } + /** * * @@ -3162,6 +3343,7 @@ public com.google.protobuf.ByteString getManagingAuthorityBytes() { return (com.google.protobuf.ByteString) ref; } } + /** * * @@ -3179,11 +3361,12 @@ public Builder setManagingAuthority(java.lang.String value) { if (value == null) { throw new NullPointerException(); } - managingAuthority_ = value; + bitField0_ |= 0x00000400; onChanged(); return this; } + /** * * @@ -3197,11 +3380,12 @@ public Builder setManagingAuthority(java.lang.String value) { * @return This builder for chaining. */ public Builder clearManagingAuthority() { - managingAuthority_ = getDefaultInstance().getManagingAuthority(); + bitField0_ = (bitField0_ & ~0x00000400); onChanged(); return this; } + /** * * @@ -3220,23 +3404,12 @@ public Builder setManagingAuthorityBytes(com.google.protobuf.ByteString value) { throw new NullPointerException(); } checkByteStringIsUtf8(value); - managingAuthority_ = value; + bitField0_ |= 0x00000400; 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.iam.v2.Policy) } diff --git a/java-iam/proto-google-iam-v2/src/main/java/com/google/iam/v2/PolicyOperationMetadata.java b/java-iam/proto-google-iam-v2/src/main/java/com/google/iam/v2/PolicyOperationMetadata.java index b8aae54471..a203917fff 100644 --- a/java-iam/proto-google-iam-v2/src/main/java/com/google/iam/v2/PolicyOperationMetadata.java +++ b/java-iam/proto-google-iam-v2/src/main/java/com/google/iam/v2/PolicyOperationMetadata.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,9 @@ * limitations under the License. */ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: google/iam/v2/policy.proto +// Protobuf Java Version: 4.33.2 package com.google.iam.v2; @@ -27,36 +29,37 @@ * * Protobuf type {@code google.iam.v2.PolicyOperationMetadata} */ -public final class PolicyOperationMetadata extends com.google.protobuf.GeneratedMessageV3 +@com.google.protobuf.Generated +public final class PolicyOperationMetadata extends com.google.protobuf.GeneratedMessage implements // @@protoc_insertion_point(message_implements:google.iam.v2.PolicyOperationMetadata) PolicyOperationMetadataOrBuilder { private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "PolicyOperationMetadata"); + } + // Use PolicyOperationMetadata.newBuilder() to construct. - private PolicyOperationMetadata(com.google.protobuf.GeneratedMessageV3.Builder builder) { + private PolicyOperationMetadata(com.google.protobuf.GeneratedMessage.Builder builder) { super(builder); } private PolicyOperationMetadata() {} - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new PolicyOperationMetadata(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.iam.v2.PolicyProto .internal_static_google_iam_v2_PolicyOperationMetadata_descriptor; } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.iam.v2.PolicyProto .internal_static_google_iam_v2_PolicyOperationMetadata_fieldAccessorTable @@ -65,8 +68,10 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { com.google.iam.v2.PolicyOperationMetadata.Builder.class); } + private int bitField0_; public static final int CREATE_TIME_FIELD_NUMBER = 1; private com.google.protobuf.Timestamp createTime_; + /** * * @@ -80,8 +85,9 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { */ @java.lang.Override public boolean hasCreateTime() { - return createTime_ != null; + return ((bitField0_ & 0x00000001) != 0); } + /** * * @@ -97,6 +103,7 @@ public boolean hasCreateTime() { public com.google.protobuf.Timestamp getCreateTime() { return createTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : createTime_; } + /** * * @@ -108,7 +115,7 @@ public com.google.protobuf.Timestamp getCreateTime() { */ @java.lang.Override public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { - return getCreateTime(); + return createTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : createTime_; } private byte memoizedIsInitialized = -1; @@ -125,7 +132,7 @@ public final boolean isInitialized() { @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (createTime_ != null) { + if (((bitField0_ & 0x00000001) != 0)) { output.writeMessage(1, getCreateTime()); } getUnknownFields().writeTo(output); @@ -137,7 +144,7 @@ public int getSerializedSize() { if (size != -1) return size; size = 0; - if (createTime_ != null) { + if (((bitField0_ & 0x00000001) != 0)) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getCreateTime()); } size += getUnknownFields().getSerializedSize(); @@ -217,38 +224,38 @@ public static com.google.iam.v2.PolicyOperationMetadata parseFrom( public static com.google.iam.v2.PolicyOperationMetadata parseFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); } public static com.google.iam.v2.PolicyOperationMetadata parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } public static com.google.iam.v2.PolicyOperationMetadata parseDelimitedFrom( java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); } public static com.google.iam.v2.PolicyOperationMetadata parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( PARSER, input, extensionRegistry); } public static com.google.iam.v2.PolicyOperationMetadata parseFrom( com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); } public static com.google.iam.v2.PolicyOperationMetadata parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } @@ -271,10 +278,11 @@ public Builder toBuilder() { } @java.lang.Override - protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { Builder builder = new Builder(parent); return builder; } + /** * * @@ -284,7 +292,7 @@ protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.Build * * Protobuf type {@code google.iam.v2.PolicyOperationMetadata} */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder implements // @@protoc_insertion_point(builder_implements:google.iam.v2.PolicyOperationMetadata) com.google.iam.v2.PolicyOperationMetadataOrBuilder { @@ -294,7 +302,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.iam.v2.PolicyProto .internal_static_google_iam_v2_PolicyOperationMetadata_fieldAccessorTable @@ -304,19 +312,28 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } // Construct using com.google.iam.v2.PolicyOperationMetadata.newBuilder() - private Builder() {} + private Builder() { + maybeForceBuilderInitialization(); + } - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetCreateTimeFieldBuilder(); + } } @java.lang.Override public Builder clear() { super.clear(); - if (createTimeBuilder_ == null) { - createTime_ = null; - } else { - createTime_ = null; + bitField0_ = 0; + createTime_ = null; + if (createTimeBuilder_ != null) { + createTimeBuilder_.dispose(); createTimeBuilder_ = null; } return this; @@ -346,46 +363,21 @@ public com.google.iam.v2.PolicyOperationMetadata build() { public com.google.iam.v2.PolicyOperationMetadata buildPartial() { com.google.iam.v2.PolicyOperationMetadata result = new com.google.iam.v2.PolicyOperationMetadata(this); - if (createTimeBuilder_ == null) { - result.createTime_ = createTime_; - } else { - result.createTime_ = createTimeBuilder_.build(); + if (bitField0_ != 0) { + buildPartial0(result); } 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); + private void buildPartial0(com.google.iam.v2.PolicyOperationMetadata result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.createTime_ = createTimeBuilder_ == null ? createTime_ : createTimeBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + result.bitField0_ |= to_bitField0_; } @java.lang.Override @@ -431,8 +423,9 @@ public Builder mergeFrom( break; case 10: { - input.readMessage(getCreateTimeFieldBuilder().getBuilder(), extensionRegistry); - + input.readMessage( + internalGetCreateTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000001; break; } // case 10 default: @@ -452,12 +445,15 @@ public Builder mergeFrom( return this; } + private int bitField0_; + private com.google.protobuf.Timestamp createTime_; - private com.google.protobuf.SingleFieldBuilderV3< + private com.google.protobuf.SingleFieldBuilder< com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder> createTimeBuilder_; + /** * * @@ -470,8 +466,9 @@ public Builder mergeFrom( * @return Whether the createTime field is set. */ public boolean hasCreateTime() { - return createTimeBuilder_ != null || createTime_ != null; + return ((bitField0_ & 0x00000001) != 0); } + /** * * @@ -492,6 +489,7 @@ public com.google.protobuf.Timestamp getCreateTime() { return createTimeBuilder_.getMessage(); } } + /** * * @@ -507,13 +505,14 @@ public Builder setCreateTime(com.google.protobuf.Timestamp value) { throw new NullPointerException(); } createTime_ = value; - onChanged(); } else { createTimeBuilder_.setMessage(value); } - + bitField0_ |= 0x00000001; + onChanged(); return this; } + /** * * @@ -526,13 +525,14 @@ public Builder setCreateTime(com.google.protobuf.Timestamp value) { public Builder setCreateTime(com.google.protobuf.Timestamp.Builder builderForValue) { if (createTimeBuilder_ == null) { createTime_ = builderForValue.build(); - onChanged(); } else { createTimeBuilder_.setMessage(builderForValue.build()); } - + bitField0_ |= 0x00000001; + onChanged(); return this; } + /** * * @@ -544,19 +544,23 @@ public Builder setCreateTime(com.google.protobuf.Timestamp.Builder builderForVal */ public Builder mergeCreateTime(com.google.protobuf.Timestamp value) { if (createTimeBuilder_ == null) { - if (createTime_ != null) { - createTime_ = - com.google.protobuf.Timestamp.newBuilder(createTime_).mergeFrom(value).buildPartial(); + if (((bitField0_ & 0x00000001) != 0) + && createTime_ != null + && createTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getCreateTimeBuilder().mergeFrom(value); } else { createTime_ = value; } - onChanged(); } else { createTimeBuilder_.mergeFrom(value); } - + if (createTime_ != null) { + bitField0_ |= 0x00000001; + onChanged(); + } return this; } + /** * * @@ -567,16 +571,16 @@ public Builder mergeCreateTime(com.google.protobuf.Timestamp value) { * .google.protobuf.Timestamp create_time = 1; */ public Builder clearCreateTime() { - if (createTimeBuilder_ == null) { - createTime_ = null; - onChanged(); - } else { - createTime_ = null; + bitField0_ = (bitField0_ & ~0x00000001); + createTime_ = null; + if (createTimeBuilder_ != null) { + createTimeBuilder_.dispose(); createTimeBuilder_ = null; } - + onChanged(); return this; } + /** * * @@ -587,10 +591,11 @@ public Builder clearCreateTime() { * .google.protobuf.Timestamp create_time = 1; */ public com.google.protobuf.Timestamp.Builder getCreateTimeBuilder() { - + bitField0_ |= 0x00000001; onChanged(); - return getCreateTimeFieldBuilder().getBuilder(); + return internalGetCreateTimeFieldBuilder().getBuilder(); } + /** * * @@ -609,6 +614,7 @@ public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { : createTime_; } } + /** * * @@ -618,14 +624,14 @@ public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { * * .google.protobuf.Timestamp create_time = 1; */ - private com.google.protobuf.SingleFieldBuilderV3< + private com.google.protobuf.SingleFieldBuilder< com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder> - getCreateTimeFieldBuilder() { + internalGetCreateTimeFieldBuilder() { if (createTimeBuilder_ == null) { createTimeBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< + new com.google.protobuf.SingleFieldBuilder< com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder>( @@ -635,17 +641,6 @@ public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { 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.iam.v2.PolicyOperationMetadata) } diff --git a/java-iam/proto-google-iam-v2/src/main/java/com/google/iam/v2/PolicyOperationMetadataOrBuilder.java b/java-iam/proto-google-iam-v2/src/main/java/com/google/iam/v2/PolicyOperationMetadataOrBuilder.java index 902e8200cd..fcfe2c7ab2 100644 --- a/java-iam/proto-google-iam-v2/src/main/java/com/google/iam/v2/PolicyOperationMetadataOrBuilder.java +++ b/java-iam/proto-google-iam-v2/src/main/java/com/google/iam/v2/PolicyOperationMetadataOrBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,10 +14,13 @@ * limitations under the License. */ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: google/iam/v2/policy.proto +// Protobuf Java Version: 4.33.2 package com.google.iam.v2; +@com.google.protobuf.Generated public interface PolicyOperationMetadataOrBuilder extends // @@protoc_insertion_point(interface_extends:google.iam.v2.PolicyOperationMetadata) @@ -35,6 +38,7 @@ public interface PolicyOperationMetadataOrBuilder * @return Whether the createTime field is set. */ boolean hasCreateTime(); + /** * * @@ -47,6 +51,7 @@ public interface PolicyOperationMetadataOrBuilder * @return The createTime. */ com.google.protobuf.Timestamp getCreateTime(); + /** * * diff --git a/java-iam/proto-google-iam-v2/src/main/java/com/google/iam/v2/PolicyOrBuilder.java b/java-iam/proto-google-iam-v2/src/main/java/com/google/iam/v2/PolicyOrBuilder.java index 84433497c5..c9b204a7ac 100644 --- a/java-iam/proto-google-iam-v2/src/main/java/com/google/iam/v2/PolicyOrBuilder.java +++ b/java-iam/proto-google-iam-v2/src/main/java/com/google/iam/v2/PolicyOrBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,10 +14,13 @@ * limitations under the License. */ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: google/iam/v2/policy.proto +// Protobuf Java Version: 4.33.2 package com.google.iam.v2; +@com.google.protobuf.Generated public interface PolicyOrBuilder extends // @@protoc_insertion_point(interface_extends:google.iam.v2.Policy) @@ -29,10 +32,13 @@ public interface PolicyOrBuilder *
            * Immutable. The resource name of the `Policy`, which must be unique. Format:
            * `policies/{attachment_point}/denypolicies/{policy_id}`
        +   *
        +   *
            * The attachment point is identified by its URL-encoded full resource name,
            * which means that the forward-slash character, `/`, must be written as
            * `%2F`. For example,
            * `policies/cloudresourcemanager.googleapis.com%2Fprojects%2Fmy-project/denypolicies/my-deny-policy`.
        +   *
            * For organizations and folders, use the numeric ID in the full resource
            * name. For projects, requests can use the alphanumeric or the numeric ID.
            * Responses always contain the numeric ID.
        @@ -43,16 +49,20 @@ public interface PolicyOrBuilder
            * @return The name.
            */
           java.lang.String getName();
        +
           /**
            *
            *
            * 
            * Immutable. The resource name of the `Policy`, which must be unique. Format:
            * `policies/{attachment_point}/denypolicies/{policy_id}`
        +   *
        +   *
            * The attachment point is identified by its URL-encoded full resource name,
            * which means that the forward-slash character, `/`, must be written as
            * `%2F`. For example,
            * `policies/cloudresourcemanager.googleapis.com%2Fprojects%2Fmy-project/denypolicies/my-deny-policy`.
        +   *
            * For organizations and folders, use the numeric ID in the full resource
            * name. For projects, requests can use the alphanumeric or the numeric ID.
            * Responses always contain the numeric ID.
        @@ -77,6 +87,7 @@ public interface PolicyOrBuilder
            * @return The uid.
            */
           java.lang.String getUid();
        +
           /**
            *
            *
        @@ -103,6 +114,7 @@ public interface PolicyOrBuilder
            * @return The kind.
            */
           java.lang.String getKind();
        +
           /**
            *
            *
        @@ -129,6 +141,7 @@ public interface PolicyOrBuilder
            * @return The displayName.
            */
           java.lang.String getDisplayName();
        +
           /**
            *
            *
        @@ -154,6 +167,7 @@ public interface PolicyOrBuilder
            * map<string, string> annotations = 5;
            */
           int getAnnotationsCount();
        +
           /**
            *
            *
        @@ -165,9 +179,11 @@ public interface PolicyOrBuilder
            * map<string, string> annotations = 5;
            */
           boolean containsAnnotations(java.lang.String key);
        +
           /** Use {@link #getAnnotationsMap()} instead. */
           @java.lang.Deprecated
           java.util.Map getAnnotations();
        +
           /**
            *
            *
        @@ -179,6 +195,7 @@ public interface PolicyOrBuilder
            * map<string, string> annotations = 5;
            */
           java.util.Map getAnnotationsMap();
        +
           /**
            *
            *
        @@ -189,12 +206,12 @@ public interface PolicyOrBuilder
            *
            * map<string, string> annotations = 5;
            */
        -
           /* nullable */
           java.lang.String getAnnotationsOrDefault(
               java.lang.String key,
               /* nullable */
               java.lang.String defaultValue);
        +
           /**
            *
            *
        @@ -214,6 +231,7 @@ java.lang.String getAnnotationsOrDefault(
            * An opaque tag that identifies the current version of the `Policy`. IAM uses
            * this value to help manage concurrent updates, so they do not cause one
            * update to be overwritten by another.
        +   *
            * If this field is present in a [CreatePolicy][] request, the value is
            * ignored.
            * 
        @@ -223,6 +241,7 @@ java.lang.String getAnnotationsOrDefault( * @return The etag. */ java.lang.String getEtag(); + /** * * @@ -230,6 +249,7 @@ java.lang.String getAnnotationsOrDefault( * An opaque tag that identifies the current version of the `Policy`. IAM uses * this value to help manage concurrent updates, so they do not cause one * update to be overwritten by another. + * * If this field is present in a [CreatePolicy][] request, the value is * ignored. *
        @@ -253,6 +273,7 @@ java.lang.String getAnnotationsOrDefault( * @return Whether the createTime field is set. */ boolean hasCreateTime(); + /** * * @@ -266,6 +287,7 @@ java.lang.String getAnnotationsOrDefault( * @return The createTime. */ com.google.protobuf.Timestamp getCreateTime(); + /** * * @@ -291,6 +313,7 @@ java.lang.String getAnnotationsOrDefault( * @return Whether the updateTime field is set. */ boolean hasUpdateTime(); + /** * * @@ -304,6 +327,7 @@ java.lang.String getAnnotationsOrDefault( * @return The updateTime. */ com.google.protobuf.Timestamp getUpdateTime(); + /** * * @@ -329,6 +353,7 @@ java.lang.String getAnnotationsOrDefault( * @return Whether the deleteTime field is set. */ boolean hasDeleteTime(); + /** * * @@ -342,6 +367,7 @@ java.lang.String getAnnotationsOrDefault( * @return The deleteTime. */ com.google.protobuf.Timestamp getDeleteTime(); + /** * * @@ -365,6 +391,7 @@ java.lang.String getAnnotationsOrDefault( * repeated .google.iam.v2.PolicyRule rules = 10; */ java.util.List getRulesList(); + /** * * @@ -376,6 +403,7 @@ java.lang.String getAnnotationsOrDefault( * repeated .google.iam.v2.PolicyRule rules = 10; */ com.google.iam.v2.PolicyRule getRules(int index); + /** * * @@ -387,6 +415,7 @@ java.lang.String getAnnotationsOrDefault( * repeated .google.iam.v2.PolicyRule rules = 10; */ int getRulesCount(); + /** * * @@ -398,6 +427,7 @@ java.lang.String getAnnotationsOrDefault( * repeated .google.iam.v2.PolicyRule rules = 10; */ java.util.List getRulesOrBuilderList(); + /** * * @@ -423,6 +453,7 @@ java.lang.String getAnnotationsOrDefault( * @return The managingAuthority. */ java.lang.String getManagingAuthority(); + /** * * diff --git a/java-iam/proto-google-iam-v2/src/main/java/com/google/iam/v2/PolicyProto.java b/java-iam/proto-google-iam-v2/src/main/java/com/google/iam/v2/PolicyProto.java index 9cbab03385..6f81bd4a56 100644 --- a/java-iam/proto-google-iam-v2/src/main/java/com/google/iam/v2/PolicyProto.java +++ b/java-iam/proto-google-iam-v2/src/main/java/com/google/iam/v2/PolicyProto.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,13 +14,26 @@ * limitations under the License. */ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: google/iam/v2/policy.proto +// Protobuf Java Version: 4.33.2 package com.google.iam.v2; -public final class PolicyProto { +@com.google.protobuf.Generated +public final class PolicyProto extends com.google.protobuf.GeneratedFile { private PolicyProto() {} + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "PolicyProto"); + } + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistryLite registry) {} public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry registry) { @@ -29,43 +42,43 @@ public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry r static final com.google.protobuf.Descriptors.Descriptor internal_static_google_iam_v2_Policy_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable internal_static_google_iam_v2_Policy_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_google_iam_v2_Policy_AnnotationsEntry_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable internal_static_google_iam_v2_Policy_AnnotationsEntry_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_google_iam_v2_PolicyRule_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable internal_static_google_iam_v2_PolicyRule_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_google_iam_v2_ListPoliciesRequest_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable internal_static_google_iam_v2_ListPoliciesRequest_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_google_iam_v2_ListPoliciesResponse_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable internal_static_google_iam_v2_ListPoliciesResponse_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_google_iam_v2_GetPolicyRequest_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable internal_static_google_iam_v2_GetPolicyRequest_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_google_iam_v2_CreatePolicyRequest_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable internal_static_google_iam_v2_CreatePolicyRequest_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_google_iam_v2_UpdatePolicyRequest_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable internal_static_google_iam_v2_UpdatePolicyRequest_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_google_iam_v2_DeletePolicyRequest_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable internal_static_google_iam_v2_DeletePolicyRequest_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_google_iam_v2_PolicyOperationMetadata_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable internal_static_google_iam_v2_PolicyOperationMetadata_fieldAccessorTable; public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { @@ -76,64 +89,74 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { static { java.lang.String[] descriptorData = { - "\n\032google/iam/v2/policy.proto\022\rgoogle.iam" - + ".v2\032\034google/api/annotations.proto\032\027googl" + "\n" + + "\032google/iam/v2/policy.proto\022\r" + + "google.iam.v2\032\034google/api/annotations.proto\032\027googl" + "e/api/client.proto\032\037google/api/field_beh" + "avior.proto\032\030google/iam/v2/deny.proto\032#g" - + "oogle/longrunning/operations.proto\032\037goog" - + "le/protobuf/timestamp.proto\"\302\003\n\006Policy\022\021" - + "\n\004name\030\001 \001(\tB\003\340A\005\022\020\n\003uid\030\002 \001(\tB\003\340A\005\022\021\n\004k" - + "ind\030\003 \001(\tB\003\340A\003\022\024\n\014display_name\030\004 \001(\t\022;\n\013" - + "annotations\030\005 \003(\0132&.google.iam.v2.Policy" - + ".AnnotationsEntry\022\014\n\004etag\030\006 \001(\t\0224\n\013creat" - + "e_time\030\007 \001(\0132\032.google.protobuf.Timestamp" - + "B\003\340A\003\0224\n\013update_time\030\010 \001(\0132\032.google.prot" - + "obuf.TimestampB\003\340A\003\0224\n\013delete_time\030\t \001(\013" - + "2\032.google.protobuf.TimestampB\003\340A\003\022(\n\005rul" - + "es\030\n \003(\0132\031.google.iam.v2.PolicyRule\022\037\n\022m" - + "anaging_authority\030\013 \001(\tB\003\340A\005\0322\n\020Annotati" - + "onsEntry\022\013\n\003key\030\001 \001(\t\022\r\n\005value\030\002 \001(\t:\0028\001" - + "\"W\n\nPolicyRule\022,\n\tdeny_rule\030\002 \001(\0132\027.goog" - + "le.iam.v2.DenyRuleH\000\022\023\n\013description\030\001 \001(" - + "\tB\006\n\004kind\"Q\n\023ListPoliciesRequest\022\023\n\006pare" - + "nt\030\001 \001(\tB\003\340A\002\022\021\n\tpage_size\030\002 \001(\005\022\022\n\npage" - + "_token\030\003 \001(\t\"X\n\024ListPoliciesResponse\022\'\n\010" - + "policies\030\001 \003(\0132\025.google.iam.v2.Policy\022\027\n" - + "\017next_page_token\030\002 \001(\t\"%\n\020GetPolicyReque" - + "st\022\021\n\004name\030\001 \001(\tB\003\340A\002\"i\n\023CreatePolicyReq" - + "uest\022\023\n\006parent\030\001 \001(\tB\003\340A\002\022*\n\006policy\030\002 \001(" - + "\0132\025.google.iam.v2.PolicyB\003\340A\002\022\021\n\tpolicy_" - + "id\030\003 \001(\t\"A\n\023UpdatePolicyRequest\022*\n\006polic" - + "y\030\001 \001(\0132\025.google.iam.v2.PolicyB\003\340A\002\";\n\023D" - + "eletePolicyRequest\022\021\n\004name\030\001 \001(\tB\003\340A\002\022\021\n" - + "\004etag\030\002 \001(\tB\003\340A\001\"J\n\027PolicyOperationMetad" - + "ata\022/\n\013create_time\030\001 \001(\0132\032.google.protob" - + "uf.Timestamp2\320\006\n\010Policies\022\203\001\n\014ListPolici" - + "es\022\".google.iam.v2.ListPoliciesRequest\032#" - + ".google.iam.v2.ListPoliciesResponse\"*\202\323\344" - + "\223\002\033\022\031/v2/{parent=policies/*/*}\332A\006parent\022" - + "m\n\tGetPolicy\022\037.google.iam.v2.GetPolicyRe" - + "quest\032\025.google.iam.v2.Policy\"(\202\323\344\223\002\033\022\031/v" - + "2/{name=policies/*/*/*}\332A\004name\022\272\001\n\014Creat" - + "ePolicy\022\".google.iam.v2.CreatePolicyRequ" - + "est\032\035.google.longrunning.Operation\"g\202\323\344\223" - + "\002#\"\031/v2/{parent=policies/*/*}:\006policy\332A\027" - + "parent,policy,policy_id\312A!\n\006Policy\022\027Poli" - + "cyOperationMetadata\022\247\001\n\014UpdatePolicy\022\".g" - + "oogle.iam.v2.UpdatePolicyRequest\032\035.googl" - + "e.longrunning.Operation\"T\202\323\344\223\002*\032 /v2/{po" - + "licy.name=policies/*/*/*}:\006policy\312A!\n\006Po" - + "licy\022\027PolicyOperationMetadata\022\237\001\n\014Delete" - + "Policy\022\".google.iam.v2.DeletePolicyReque" - + "st\032\035.google.longrunning.Operation\"L\202\323\344\223\002" - + "\033*\031/v2/{name=policies/*/*/*}\332A\004name\312A!\n\006" - + "Policy\022\027PolicyOperationMetadata\032F\312A\022iam." - + "googleapis.com\322A.https://www.googleapis." - + "com/auth/cloud-platformB\200\001\n\021com.google.i" - + "am.v2B\013PolicyProtoP\001Z0google.golang.org/" - + "genproto/googleapis/iam/v2;iam\252\002\023Google." - + "Cloud.Iam.V2\312\002\023Google\\Cloud\\Iam\\V2b\006prot" - + "o3" + + "oogle/longrunning/operations.proto\032\037google/protobuf/timestamp.proto\"\302\003\n" + + "\006Policy\022\021\n" + + "\004name\030\001 \001(\tB\003\340A\005\022\020\n" + + "\003uid\030\002 \001(\tB\003\340A\005\022\021\n" + + "\004kind\030\003 \001(\tB\003\340A\003\022\024\n" + + "\014display_name\030\004 \001(\t\022;\n" + + "\013annotations\030\005 \003(\0132&.google.iam.v2.Policy.AnnotationsEntry\022\014\n" + + "\004etag\030\006 \001(\t\0224\n" + + "\013create_time\030\007 \001(\0132\032.google.protobuf.TimestampB\003\340A\003\0224\n" + + "\013update_time\030\010 \001(\0132\032.google.protobuf.TimestampB\003\340A\003\0224\n" + + "\013delete_time\030\t \001(\0132\032.google.protobuf.TimestampB\003\340A\003\022(\n" + + "\005rules\030\n" + + " \003(\0132\031.google.iam.v2.PolicyRule\022\037\n" + + "\022managing_authority\030\013 \001(\tB\003\340A\005\0322\n" + + "\020AnnotationsEntry\022\013\n" + + "\003key\030\001 \001(\t\022\r\n" + + "\005value\030\002 \001(\t:\0028\001\"W\n\n" + + "PolicyRule\022,\n" + + "\tdeny_rule\030\002 \001(\0132\027.google.iam.v2.DenyRuleH\000\022\023\n" + + "\013description\030\001 \001(\tB\006\n" + + "\004kind\"Q\n" + + "\023ListPoliciesRequest\022\023\n" + + "\006parent\030\001 \001(\tB\003\340A\002\022\021\n" + + "\tpage_size\030\002 \001(\005\022\022\n\n" + + "page_token\030\003 \001(\t\"X\n" + + "\024ListPoliciesResponse\022\'\n" + + "\010policies\030\001 \003(\0132\025.google.iam.v2.Policy\022\027\n" + + "\017next_page_token\030\002 \001(\t\"%\n" + + "\020GetPolicyRequest\022\021\n" + + "\004name\030\001 \001(\tB\003\340A\002\"i\n" + + "\023CreatePolicyRequest\022\023\n" + + "\006parent\030\001 \001(\tB\003\340A\002\022*\n" + + "\006policy\030\002 \001(\0132\025.google.iam.v2.PolicyB\003\340A\002\022\021\n" + + "\tpolicy_id\030\003 \001(\t\"A\n" + + "\023UpdatePolicyRequest\022*\n" + + "\006policy\030\001 \001(\0132\025.google.iam.v2.PolicyB\003\340A\002\";\n" + + "\023DeletePolicyRequest\022\021\n" + + "\004name\030\001 \001(\tB\003\340A\002\022\021\n" + + "\004etag\030\002 \001(\tB\003\340A\001\"J\n" + + "\027PolicyOperationMetadata\022/\n" + + "\013create_time\030\001 \001(\0132\032.google.protobuf.Timestamp2\320\006\n" + + "\010Policies\022\203\001\n" + + "\014ListPolicies\022\".google.iam.v2.ListPoliciesRequest\032#" + + ".google.iam.v2.ListPoliciesResponse\"*\332A\006" + + "parent\202\323\344\223\002\033\022\031/v2/{parent=policies/*/*}\022m\n" + + "\tGetPolicy\022\037.google.iam.v2.GetPolicyRe" + + "quest\032\025.google.iam.v2.Policy\"(\332A\004name\202\323\344\223\002\033\022\031/v2/{name=policies/*/*/*}\022\272\001\n" + + "\014Creat" + + "ePolicy\022\".google.iam.v2.CreatePolicyRequest\032\035.google.longrunning.Operation\"g\312A!\n" + + "\006Policy\022\027PolicyOperationMetadata\332A\027paren" + + "t,policy,policy_id\202\323\344\223\002#\"\031/v2/{parent=policies/*/*}:\006policy\022\247\001\n" + + "\014UpdatePolicy\022\".g" + + "oogle.iam.v2.UpdatePolicyRequest\032\035.google.longrunning.Operation\"T\312A!\n" + + "\006Policy\022\027PolicyOperationMetadata\202\323\344\223\002*\032" + + " /v2/{policy.name=policies/*/*/*}:\006policy\022\237\001\n" + + "\014Delete" + + "Policy\022\".google.iam.v2.DeletePolicyRequest\032\035.google.longrunning.Operation\"L\312A!\n" + + "\006Policy\022\027PolicyOperationMetadata\332A\004name\202\323" + + "\344\223\002\033*\031/v2/{name=policies/*/*/*}\032F\312A\022iam." + + "googleapis.com\322A.https://www.googleapis.com/auth/cloud-platformBy\n" + + "\021com.google.iam.v2B\013PolicyProtoP\001Z)cloud.google.com/go" + + "/iam/apiv2/iampb;iampb\252\002\023Google.Cloud.Ia" + + "m.V2\312\002\023Google\\Cloud\\Iam\\V2b\006proto3" }; descriptor = com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( @@ -146,9 +169,9 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { com.google.longrunning.OperationsProto.getDescriptor(), com.google.protobuf.TimestampProto.getDescriptor(), }); - internal_static_google_iam_v2_Policy_descriptor = getDescriptor().getMessageTypes().get(0); + internal_static_google_iam_v2_Policy_descriptor = getDescriptor().getMessageType(0); internal_static_google_iam_v2_Policy_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_google_iam_v2_Policy_descriptor, new java.lang.String[] { "Name", @@ -164,76 +187,82 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "ManagingAuthority", }); internal_static_google_iam_v2_Policy_AnnotationsEntry_descriptor = - internal_static_google_iam_v2_Policy_descriptor.getNestedTypes().get(0); + internal_static_google_iam_v2_Policy_descriptor.getNestedType(0); internal_static_google_iam_v2_Policy_AnnotationsEntry_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_google_iam_v2_Policy_AnnotationsEntry_descriptor, new java.lang.String[] { "Key", "Value", }); - internal_static_google_iam_v2_PolicyRule_descriptor = getDescriptor().getMessageTypes().get(1); + internal_static_google_iam_v2_PolicyRule_descriptor = getDescriptor().getMessageType(1); internal_static_google_iam_v2_PolicyRule_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_google_iam_v2_PolicyRule_descriptor, new java.lang.String[] { "DenyRule", "Description", "Kind", }); internal_static_google_iam_v2_ListPoliciesRequest_descriptor = - getDescriptor().getMessageTypes().get(2); + getDescriptor().getMessageType(2); internal_static_google_iam_v2_ListPoliciesRequest_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_google_iam_v2_ListPoliciesRequest_descriptor, new java.lang.String[] { "Parent", "PageSize", "PageToken", }); internal_static_google_iam_v2_ListPoliciesResponse_descriptor = - getDescriptor().getMessageTypes().get(3); + getDescriptor().getMessageType(3); internal_static_google_iam_v2_ListPoliciesResponse_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_google_iam_v2_ListPoliciesResponse_descriptor, new java.lang.String[] { "Policies", "NextPageToken", }); - internal_static_google_iam_v2_GetPolicyRequest_descriptor = - getDescriptor().getMessageTypes().get(4); + internal_static_google_iam_v2_GetPolicyRequest_descriptor = getDescriptor().getMessageType(4); internal_static_google_iam_v2_GetPolicyRequest_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_google_iam_v2_GetPolicyRequest_descriptor, new java.lang.String[] { "Name", }); internal_static_google_iam_v2_CreatePolicyRequest_descriptor = - getDescriptor().getMessageTypes().get(5); + getDescriptor().getMessageType(5); internal_static_google_iam_v2_CreatePolicyRequest_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_google_iam_v2_CreatePolicyRequest_descriptor, new java.lang.String[] { "Parent", "Policy", "PolicyId", }); internal_static_google_iam_v2_UpdatePolicyRequest_descriptor = - getDescriptor().getMessageTypes().get(6); + getDescriptor().getMessageType(6); internal_static_google_iam_v2_UpdatePolicyRequest_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_google_iam_v2_UpdatePolicyRequest_descriptor, new java.lang.String[] { "Policy", }); internal_static_google_iam_v2_DeletePolicyRequest_descriptor = - getDescriptor().getMessageTypes().get(7); + getDescriptor().getMessageType(7); internal_static_google_iam_v2_DeletePolicyRequest_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_google_iam_v2_DeletePolicyRequest_descriptor, new java.lang.String[] { "Name", "Etag", }); internal_static_google_iam_v2_PolicyOperationMetadata_descriptor = - getDescriptor().getMessageTypes().get(8); + getDescriptor().getMessageType(8); internal_static_google_iam_v2_PolicyOperationMetadata_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_google_iam_v2_PolicyOperationMetadata_descriptor, new java.lang.String[] { "CreateTime", }); + descriptor.resolveAllFeaturesImmutable(); + com.google.api.AnnotationsProto.getDescriptor(); + com.google.api.ClientProto.getDescriptor(); + com.google.api.FieldBehaviorProto.getDescriptor(); + com.google.iam.v2.DenyRuleProto.getDescriptor(); + com.google.longrunning.OperationsProto.getDescriptor(); + com.google.protobuf.TimestampProto.getDescriptor(); com.google.protobuf.ExtensionRegistry registry = com.google.protobuf.ExtensionRegistry.newInstance(); registry.add(com.google.api.ClientProto.defaultHost); @@ -244,12 +273,6 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { 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.iam.v2.DenyRuleProto.getDescriptor(); - com.google.longrunning.OperationsProto.getDescriptor(); - com.google.protobuf.TimestampProto.getDescriptor(); } // @@protoc_insertion_point(outer_class_scope) diff --git a/java-iam/proto-google-iam-v2/src/main/java/com/google/iam/v2/PolicyRule.java b/java-iam/proto-google-iam-v2/src/main/java/com/google/iam/v2/PolicyRule.java index 032fa2bba2..60af1dfc05 100644 --- a/java-iam/proto-google-iam-v2/src/main/java/com/google/iam/v2/PolicyRule.java +++ b/java-iam/proto-google-iam-v2/src/main/java/com/google/iam/v2/PolicyRule.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,9 @@ * limitations under the License. */ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: google/iam/v2/policy.proto +// Protobuf Java Version: 4.33.2 package com.google.iam.v2; @@ -27,13 +29,25 @@ * * Protobuf type {@code google.iam.v2.PolicyRule} */ -public final class PolicyRule extends com.google.protobuf.GeneratedMessageV3 +@com.google.protobuf.Generated +public final class PolicyRule extends com.google.protobuf.GeneratedMessage implements // @@protoc_insertion_point(message_implements:google.iam.v2.PolicyRule) PolicyRuleOrBuilder { private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "PolicyRule"); + } + // Use PolicyRule.newBuilder() to construct. - private PolicyRule(com.google.protobuf.GeneratedMessageV3.Builder builder) { + private PolicyRule(com.google.protobuf.GeneratedMessage.Builder builder) { super(builder); } @@ -41,23 +55,12 @@ private PolicyRule() { description_ = ""; } - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new PolicyRule(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.iam.v2.PolicyProto.internal_static_google_iam_v2_PolicyRule_descriptor; } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.iam.v2.PolicyProto.internal_static_google_iam_v2_PolicyRule_fieldAccessorTable .ensureFieldAccessorsInitialized( @@ -65,6 +68,8 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } private int kindCase_ = 0; + + @SuppressWarnings("serial") private java.lang.Object kind_; public enum KindCase @@ -78,6 +83,7 @@ public enum KindCase private KindCase(int value) { this.value = value; } + /** * @param value The number of the enum to look for. * @return The enum associated with the given number. @@ -109,6 +115,7 @@ public KindCase getKindCase() { } public static final int DENY_RULE_FIELD_NUMBER = 2; + /** * * @@ -124,6 +131,7 @@ public KindCase getKindCase() { public boolean hasDenyRule() { return kindCase_ == 2; } + /** * * @@ -142,6 +150,7 @@ public com.google.iam.v2.DenyRule getDenyRule() { } return com.google.iam.v2.DenyRule.getDefaultInstance(); } + /** * * @@ -160,7 +169,10 @@ public com.google.iam.v2.DenyRuleOrBuilder getDenyRuleOrBuilder() { } public static final int DESCRIPTION_FIELD_NUMBER = 1; - private volatile java.lang.Object description_; + + @SuppressWarnings("serial") + private volatile java.lang.Object description_ = ""; + /** * * @@ -185,6 +197,7 @@ public java.lang.String getDescription() { return s; } } + /** * * @@ -224,8 +237,8 @@ public final boolean isInitialized() { @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(description_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, description_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(description_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, description_); } if (kindCase_ == 2) { output.writeMessage(2, (com.google.iam.v2.DenyRule) kind_); @@ -239,8 +252,8 @@ public int getSerializedSize() { if (size != -1) return size; size = 0; - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(description_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, description_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(description_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, description_); } if (kindCase_ == 2) { size += @@ -333,38 +346,38 @@ public static com.google.iam.v2.PolicyRule parseFrom( public static com.google.iam.v2.PolicyRule parseFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); } public static com.google.iam.v2.PolicyRule parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } public static com.google.iam.v2.PolicyRule parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); } public static com.google.iam.v2.PolicyRule parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( PARSER, input, extensionRegistry); } public static com.google.iam.v2.PolicyRule parseFrom(com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); } public static com.google.iam.v2.PolicyRule parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } @@ -387,10 +400,11 @@ public Builder toBuilder() { } @java.lang.Override - protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { Builder builder = new Builder(parent); return builder; } + /** * * @@ -400,7 +414,7 @@ protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.Build * * Protobuf type {@code google.iam.v2.PolicyRule} */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder implements // @@protoc_insertion_point(builder_implements:google.iam.v2.PolicyRule) com.google.iam.v2.PolicyRuleOrBuilder { @@ -409,7 +423,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.iam.v2.PolicyProto .internal_static_google_iam_v2_PolicyRule_fieldAccessorTable @@ -420,18 +434,18 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { // Construct using com.google.iam.v2.PolicyRule.newBuilder() private Builder() {} - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { super(parent); } @java.lang.Override public Builder clear() { super.clear(); + bitField0_ = 0; if (denyRuleBuilder_ != null) { denyRuleBuilder_.clear(); } description_ = ""; - kindCase_ = 0; kind_ = null; return this; @@ -459,50 +473,27 @@ public com.google.iam.v2.PolicyRule build() { @java.lang.Override public com.google.iam.v2.PolicyRule buildPartial() { com.google.iam.v2.PolicyRule result = new com.google.iam.v2.PolicyRule(this); - if (kindCase_ == 2) { - if (denyRuleBuilder_ == null) { - result.kind_ = kind_; - } else { - result.kind_ = denyRuleBuilder_.build(); - } + if (bitField0_ != 0) { + buildPartial0(result); } - result.description_ = description_; - result.kindCase_ = kindCase_; + buildPartialOneofs(result); 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); + private void buildPartial0(com.google.iam.v2.PolicyRule result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.description_ = description_; + } } - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.addRepeatedField(field, value); + private void buildPartialOneofs(com.google.iam.v2.PolicyRule result) { + result.kindCase_ = kindCase_; + result.kind_ = this.kind_; + if (kindCase_ == 2 && denyRuleBuilder_ != null) { + result.kind_ = denyRuleBuilder_.build(); + } } @java.lang.Override @@ -519,6 +510,7 @@ public Builder mergeFrom(com.google.iam.v2.PolicyRule other) { if (other == com.google.iam.v2.PolicyRule.getDefaultInstance()) return this; if (!other.getDescription().isEmpty()) { description_ = other.description_; + bitField0_ |= 0x00000002; onChanged(); } switch (other.getKindCase()) { @@ -561,12 +553,13 @@ public Builder mergeFrom( case 10: { description_ = input.readStringRequireUtf8(); - + bitField0_ |= 0x00000002; break; } // case 10 case 18: { - input.readMessage(getDenyRuleFieldBuilder().getBuilder(), extensionRegistry); + input.readMessage( + internalGetDenyRuleFieldBuilder().getBuilder(), extensionRegistry); kindCase_ = 2; break; } // case 18 @@ -601,11 +594,14 @@ public Builder clearKind() { return this; } - private com.google.protobuf.SingleFieldBuilderV3< + private int bitField0_; + + private com.google.protobuf.SingleFieldBuilder< com.google.iam.v2.DenyRule, com.google.iam.v2.DenyRule.Builder, com.google.iam.v2.DenyRuleOrBuilder> denyRuleBuilder_; + /** * * @@ -621,6 +617,7 @@ public Builder clearKind() { public boolean hasDenyRule() { return kindCase_ == 2; } + /** * * @@ -646,6 +643,7 @@ public com.google.iam.v2.DenyRule getDenyRule() { return com.google.iam.v2.DenyRule.getDefaultInstance(); } } + /** * * @@ -668,6 +666,7 @@ public Builder setDenyRule(com.google.iam.v2.DenyRule value) { kindCase_ = 2; return this; } + /** * * @@ -687,6 +686,7 @@ public Builder setDenyRule(com.google.iam.v2.DenyRule.Builder builderForValue) { kindCase_ = 2; return this; } + /** * * @@ -717,6 +717,7 @@ public Builder mergeDenyRule(com.google.iam.v2.DenyRule value) { kindCase_ = 2; return this; } + /** * * @@ -742,6 +743,7 @@ public Builder clearDenyRule() { } return this; } + /** * * @@ -752,8 +754,9 @@ public Builder clearDenyRule() { * .google.iam.v2.DenyRule deny_rule = 2; */ public com.google.iam.v2.DenyRule.Builder getDenyRuleBuilder() { - return getDenyRuleFieldBuilder().getBuilder(); + return internalGetDenyRuleFieldBuilder().getBuilder(); } + /** * * @@ -774,6 +777,7 @@ public com.google.iam.v2.DenyRuleOrBuilder getDenyRuleOrBuilder() { return com.google.iam.v2.DenyRule.getDefaultInstance(); } } + /** * * @@ -783,17 +787,17 @@ public com.google.iam.v2.DenyRuleOrBuilder getDenyRuleOrBuilder() { * * .google.iam.v2.DenyRule deny_rule = 2; */ - private com.google.protobuf.SingleFieldBuilderV3< + private com.google.protobuf.SingleFieldBuilder< com.google.iam.v2.DenyRule, com.google.iam.v2.DenyRule.Builder, com.google.iam.v2.DenyRuleOrBuilder> - getDenyRuleFieldBuilder() { + internalGetDenyRuleFieldBuilder() { if (denyRuleBuilder_ == null) { if (!(kindCase_ == 2)) { kind_ = com.google.iam.v2.DenyRule.getDefaultInstance(); } denyRuleBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< + new com.google.protobuf.SingleFieldBuilder< com.google.iam.v2.DenyRule, com.google.iam.v2.DenyRule.Builder, com.google.iam.v2.DenyRuleOrBuilder>( @@ -802,11 +806,11 @@ public com.google.iam.v2.DenyRuleOrBuilder getDenyRuleOrBuilder() { } kindCase_ = 2; onChanged(); - ; return denyRuleBuilder_; } private java.lang.Object description_ = ""; + /** * * @@ -830,6 +834,7 @@ public java.lang.String getDescription() { return (java.lang.String) ref; } } + /** * * @@ -853,6 +858,7 @@ public com.google.protobuf.ByteString getDescriptionBytes() { return (com.google.protobuf.ByteString) ref; } } + /** * * @@ -870,11 +876,12 @@ public Builder setDescription(java.lang.String value) { if (value == null) { throw new NullPointerException(); } - description_ = value; + bitField0_ |= 0x00000002; onChanged(); return this; } + /** * * @@ -888,11 +895,12 @@ public Builder setDescription(java.lang.String value) { * @return This builder for chaining. */ public Builder clearDescription() { - description_ = getDefaultInstance().getDescription(); + bitField0_ = (bitField0_ & ~0x00000002); onChanged(); return this; } + /** * * @@ -911,23 +919,12 @@ public Builder setDescriptionBytes(com.google.protobuf.ByteString value) { throw new NullPointerException(); } checkByteStringIsUtf8(value); - description_ = 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.iam.v2.PolicyRule) } diff --git a/java-iam/proto-google-iam-v2/src/main/java/com/google/iam/v2/PolicyRuleOrBuilder.java b/java-iam/proto-google-iam-v2/src/main/java/com/google/iam/v2/PolicyRuleOrBuilder.java index 712ec0723f..5929b1438b 100644 --- a/java-iam/proto-google-iam-v2/src/main/java/com/google/iam/v2/PolicyRuleOrBuilder.java +++ b/java-iam/proto-google-iam-v2/src/main/java/com/google/iam/v2/PolicyRuleOrBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,10 +14,13 @@ * limitations under the License. */ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: google/iam/v2/policy.proto +// Protobuf Java Version: 4.33.2 package com.google.iam.v2; +@com.google.protobuf.Generated public interface PolicyRuleOrBuilder extends // @@protoc_insertion_point(interface_extends:google.iam.v2.PolicyRule) @@ -35,6 +38,7 @@ public interface PolicyRuleOrBuilder * @return Whether the denyRule field is set. */ boolean hasDenyRule(); + /** * * @@ -47,6 +51,7 @@ public interface PolicyRuleOrBuilder * @return The denyRule. */ com.google.iam.v2.DenyRule getDenyRule(); + /** * * @@ -71,6 +76,7 @@ public interface PolicyRuleOrBuilder * @return The description. */ java.lang.String getDescription(); + /** * * @@ -85,5 +91,5 @@ public interface PolicyRuleOrBuilder */ com.google.protobuf.ByteString getDescriptionBytes(); - public com.google.iam.v2.PolicyRule.KindCase getKindCase(); + com.google.iam.v2.PolicyRule.KindCase getKindCase(); } diff --git a/java-iam/proto-google-iam-v2/src/main/java/com/google/iam/v2/UpdatePolicyRequest.java b/java-iam/proto-google-iam-v2/src/main/java/com/google/iam/v2/UpdatePolicyRequest.java index d7810fed39..5789cebf95 100644 --- a/java-iam/proto-google-iam-v2/src/main/java/com/google/iam/v2/UpdatePolicyRequest.java +++ b/java-iam/proto-google-iam-v2/src/main/java/com/google/iam/v2/UpdatePolicyRequest.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,9 @@ * limitations under the License. */ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: google/iam/v2/policy.proto +// Protobuf Java Version: 4.33.2 package com.google.iam.v2; @@ -27,36 +29,37 @@ * * Protobuf type {@code google.iam.v2.UpdatePolicyRequest} */ -public final class UpdatePolicyRequest extends com.google.protobuf.GeneratedMessageV3 +@com.google.protobuf.Generated +public final class UpdatePolicyRequest extends com.google.protobuf.GeneratedMessage implements // @@protoc_insertion_point(message_implements:google.iam.v2.UpdatePolicyRequest) UpdatePolicyRequestOrBuilder { private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "UpdatePolicyRequest"); + } + // Use UpdatePolicyRequest.newBuilder() to construct. - private UpdatePolicyRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + private UpdatePolicyRequest(com.google.protobuf.GeneratedMessage.Builder builder) { super(builder); } private UpdatePolicyRequest() {} - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new UpdatePolicyRequest(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.iam.v2.PolicyProto .internal_static_google_iam_v2_UpdatePolicyRequest_descriptor; } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.iam.v2.PolicyProto .internal_static_google_iam_v2_UpdatePolicyRequest_fieldAccessorTable @@ -65,13 +68,16 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { com.google.iam.v2.UpdatePolicyRequest.Builder.class); } + private int bitField0_; public static final int POLICY_FIELD_NUMBER = 1; private com.google.iam.v2.Policy policy_; + /** * * *
            * Required. The policy to update.
        +   *
            * To prevent conflicting updates, the `etag` value must match the value that
            * is stored in IAM. If the `etag` values do not match, the request fails with
            * a `409` error code and `ABORTED` status.
        @@ -83,13 +89,15 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
            */
           @java.lang.Override
           public boolean hasPolicy() {
        -    return policy_ != null;
        +    return ((bitField0_ & 0x00000001) != 0);
           }
        +
           /**
            *
            *
            * 
            * Required. The policy to update.
        +   *
            * To prevent conflicting updates, the `etag` value must match the value that
            * is stored in IAM. If the `etag` values do not match, the request fails with
            * a `409` error code and `ABORTED` status.
        @@ -103,11 +111,13 @@ public boolean hasPolicy() {
           public com.google.iam.v2.Policy getPolicy() {
             return policy_ == null ? com.google.iam.v2.Policy.getDefaultInstance() : policy_;
           }
        +
           /**
            *
            *
            * 
            * Required. The policy to update.
        +   *
            * To prevent conflicting updates, the `etag` value must match the value that
            * is stored in IAM. If the `etag` values do not match, the request fails with
            * a `409` error code and `ABORTED` status.
        @@ -117,7 +127,7 @@ public com.google.iam.v2.Policy getPolicy() {
            */
           @java.lang.Override
           public com.google.iam.v2.PolicyOrBuilder getPolicyOrBuilder() {
        -    return getPolicy();
        +    return policy_ == null ? com.google.iam.v2.Policy.getDefaultInstance() : policy_;
           }
         
           private byte memoizedIsInitialized = -1;
        @@ -134,7 +144,7 @@ public final boolean isInitialized() {
         
           @java.lang.Override
           public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException {
        -    if (policy_ != null) {
        +    if (((bitField0_ & 0x00000001) != 0)) {
               output.writeMessage(1, getPolicy());
             }
             getUnknownFields().writeTo(output);
        @@ -146,7 +156,7 @@ public int getSerializedSize() {
             if (size != -1) return size;
         
             size = 0;
        -    if (policy_ != null) {
        +    if (((bitField0_ & 0x00000001) != 0)) {
               size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getPolicy());
             }
             size += getUnknownFields().getSerializedSize();
        @@ -224,38 +234,38 @@ public static com.google.iam.v2.UpdatePolicyRequest parseFrom(
         
           public static com.google.iam.v2.UpdatePolicyRequest parseFrom(java.io.InputStream input)
               throws java.io.IOException {
        -    return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
        +    return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input);
           }
         
           public static com.google.iam.v2.UpdatePolicyRequest parseFrom(
               java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
               throws java.io.IOException {
        -    return com.google.protobuf.GeneratedMessageV3.parseWithIOException(
        +    return com.google.protobuf.GeneratedMessage.parseWithIOException(
                 PARSER, input, extensionRegistry);
           }
         
           public static com.google.iam.v2.UpdatePolicyRequest parseDelimitedFrom(java.io.InputStream input)
               throws java.io.IOException {
        -    return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input);
        +    return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input);
           }
         
           public static com.google.iam.v2.UpdatePolicyRequest parseDelimitedFrom(
               java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
               throws java.io.IOException {
        -    return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(
        +    return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(
                 PARSER, input, extensionRegistry);
           }
         
           public static com.google.iam.v2.UpdatePolicyRequest parseFrom(
               com.google.protobuf.CodedInputStream input) throws java.io.IOException {
        -    return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
        +    return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input);
           }
         
           public static com.google.iam.v2.UpdatePolicyRequest parseFrom(
               com.google.protobuf.CodedInputStream input,
               com.google.protobuf.ExtensionRegistryLite extensionRegistry)
               throws java.io.IOException {
        -    return com.google.protobuf.GeneratedMessageV3.parseWithIOException(
        +    return com.google.protobuf.GeneratedMessage.parseWithIOException(
                 PARSER, input, extensionRegistry);
           }
         
        @@ -278,10 +288,11 @@ public Builder toBuilder() {
           }
         
           @java.lang.Override
        -  protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
        +  protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) {
             Builder builder = new Builder(parent);
             return builder;
           }
        +
           /**
            *
            *
        @@ -291,7 +302,7 @@ protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.Build
            *
            * Protobuf type {@code google.iam.v2.UpdatePolicyRequest}
            */
        -  public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder
        +  public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder
               implements
               // @@protoc_insertion_point(builder_implements:google.iam.v2.UpdatePolicyRequest)
               com.google.iam.v2.UpdatePolicyRequestOrBuilder {
        @@ -301,7 +312,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
             }
         
             @java.lang.Override
        -    protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
        +    protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
                 internalGetFieldAccessorTable() {
               return com.google.iam.v2.PolicyProto
                   .internal_static_google_iam_v2_UpdatePolicyRequest_fieldAccessorTable
        @@ -311,19 +322,28 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
             }
         
             // Construct using com.google.iam.v2.UpdatePolicyRequest.newBuilder()
        -    private Builder() {}
        +    private Builder() {
        +      maybeForceBuilderInitialization();
        +    }
         
        -    private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
        +    private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) {
               super(parent);
        +      maybeForceBuilderInitialization();
        +    }
        +
        +    private void maybeForceBuilderInitialization() {
        +      if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) {
        +        internalGetPolicyFieldBuilder();
        +      }
             }
         
             @java.lang.Override
             public Builder clear() {
               super.clear();
        -      if (policyBuilder_ == null) {
        -        policy_ = null;
        -      } else {
        -        policy_ = null;
        +      bitField0_ = 0;
        +      policy_ = null;
        +      if (policyBuilder_ != null) {
        +        policyBuilder_.dispose();
                 policyBuilder_ = null;
               }
               return this;
        @@ -353,46 +373,21 @@ public com.google.iam.v2.UpdatePolicyRequest build() {
             public com.google.iam.v2.UpdatePolicyRequest buildPartial() {
               com.google.iam.v2.UpdatePolicyRequest result =
                   new com.google.iam.v2.UpdatePolicyRequest(this);
        -      if (policyBuilder_ == null) {
        -        result.policy_ = policy_;
        -      } else {
        -        result.policy_ = policyBuilder_.build();
        +      if (bitField0_ != 0) {
        +        buildPartial0(result);
               }
               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);
        +    private void buildPartial0(com.google.iam.v2.UpdatePolicyRequest result) {
        +      int from_bitField0_ = bitField0_;
        +      int to_bitField0_ = 0;
        +      if (((from_bitField0_ & 0x00000001) != 0)) {
        +        result.policy_ = policyBuilder_ == null ? policy_ : policyBuilder_.build();
        +        to_bitField0_ |= 0x00000001;
        +      }
        +      result.bitField0_ |= to_bitField0_;
             }
         
             @java.lang.Override
        @@ -438,8 +433,8 @@ public Builder mergeFrom(
                       break;
                     case 10:
                       {
        -                input.readMessage(getPolicyFieldBuilder().getBuilder(), extensionRegistry);
        -
        +                input.readMessage(internalGetPolicyFieldBuilder().getBuilder(), extensionRegistry);
        +                bitField0_ |= 0x00000001;
                         break;
                       } // case 10
                     default:
        @@ -459,17 +454,21 @@ public Builder mergeFrom(
               return this;
             }
         
        +    private int bitField0_;
        +
             private com.google.iam.v2.Policy policy_;
        -    private com.google.protobuf.SingleFieldBuilderV3<
        +    private com.google.protobuf.SingleFieldBuilder<
                     com.google.iam.v2.Policy,
                     com.google.iam.v2.Policy.Builder,
                     com.google.iam.v2.PolicyOrBuilder>
                 policyBuilder_;
        +
             /**
              *
              *
              * 
              * Required. The policy to update.
        +     *
              * To prevent conflicting updates, the `etag` value must match the value that
              * is stored in IAM. If the `etag` values do not match, the request fails with
              * a `409` error code and `ABORTED` status.
        @@ -480,13 +479,15 @@ public Builder mergeFrom(
              * @return Whether the policy field is set.
              */
             public boolean hasPolicy() {
        -      return policyBuilder_ != null || policy_ != null;
        +      return ((bitField0_ & 0x00000001) != 0);
             }
        +
             /**
              *
              *
              * 
              * Required. The policy to update.
        +     *
              * To prevent conflicting updates, the `etag` value must match the value that
              * is stored in IAM. If the `etag` values do not match, the request fails with
              * a `409` error code and `ABORTED` status.
        @@ -503,11 +504,13 @@ public com.google.iam.v2.Policy getPolicy() {
                 return policyBuilder_.getMessage();
               }
             }
        +
             /**
              *
              *
              * 
              * Required. The policy to update.
        +     *
              * To prevent conflicting updates, the `etag` value must match the value that
              * is stored in IAM. If the `etag` values do not match, the request fails with
              * a `409` error code and `ABORTED` status.
        @@ -521,18 +524,20 @@ public Builder setPolicy(com.google.iam.v2.Policy value) {
                   throw new NullPointerException();
                 }
                 policy_ = value;
        -        onChanged();
               } else {
                 policyBuilder_.setMessage(value);
               }
        -
        +      bitField0_ |= 0x00000001;
        +      onChanged();
               return this;
             }
        +
             /**
              *
              *
              * 
              * Required. The policy to update.
        +     *
              * To prevent conflicting updates, the `etag` value must match the value that
              * is stored in IAM. If the `etag` values do not match, the request fails with
              * a `409` error code and `ABORTED` status.
        @@ -543,18 +548,20 @@ public Builder setPolicy(com.google.iam.v2.Policy value) {
             public Builder setPolicy(com.google.iam.v2.Policy.Builder builderForValue) {
               if (policyBuilder_ == null) {
                 policy_ = builderForValue.build();
        -        onChanged();
               } else {
                 policyBuilder_.setMessage(builderForValue.build());
               }
        -
        +      bitField0_ |= 0x00000001;
        +      onChanged();
               return this;
             }
        +
             /**
              *
              *
              * 
              * Required. The policy to update.
        +     *
              * To prevent conflicting updates, the `etag` value must match the value that
              * is stored in IAM. If the `etag` values do not match, the request fails with
              * a `409` error code and `ABORTED` status.
        @@ -564,23 +571,29 @@ public Builder setPolicy(com.google.iam.v2.Policy.Builder builderForValue) {
              */
             public Builder mergePolicy(com.google.iam.v2.Policy value) {
               if (policyBuilder_ == null) {
        -        if (policy_ != null) {
        -          policy_ = com.google.iam.v2.Policy.newBuilder(policy_).mergeFrom(value).buildPartial();
        +        if (((bitField0_ & 0x00000001) != 0)
        +            && policy_ != null
        +            && policy_ != com.google.iam.v2.Policy.getDefaultInstance()) {
        +          getPolicyBuilder().mergeFrom(value);
                 } else {
                   policy_ = value;
                 }
        -        onChanged();
               } else {
                 policyBuilder_.mergeFrom(value);
               }
        -
        +      if (policy_ != null) {
        +        bitField0_ |= 0x00000001;
        +        onChanged();
        +      }
               return this;
             }
        +
             /**
              *
              *
              * 
              * Required. The policy to update.
        +     *
              * To prevent conflicting updates, the `etag` value must match the value that
              * is stored in IAM. If the `etag` values do not match, the request fails with
              * a `409` error code and `ABORTED` status.
        @@ -589,21 +602,22 @@ public Builder mergePolicy(com.google.iam.v2.Policy value) {
              * .google.iam.v2.Policy policy = 1 [(.google.api.field_behavior) = REQUIRED];
              */
             public Builder clearPolicy() {
        -      if (policyBuilder_ == null) {
        -        policy_ = null;
        -        onChanged();
        -      } else {
        -        policy_ = null;
        +      bitField0_ = (bitField0_ & ~0x00000001);
        +      policy_ = null;
        +      if (policyBuilder_ != null) {
        +        policyBuilder_.dispose();
                 policyBuilder_ = null;
               }
        -
        +      onChanged();
               return this;
             }
        +
             /**
              *
              *
              * 
              * Required. The policy to update.
        +     *
              * To prevent conflicting updates, the `etag` value must match the value that
              * is stored in IAM. If the `etag` values do not match, the request fails with
              * a `409` error code and `ABORTED` status.
        @@ -612,15 +626,17 @@ public Builder clearPolicy() {
              * .google.iam.v2.Policy policy = 1 [(.google.api.field_behavior) = REQUIRED];
              */
             public com.google.iam.v2.Policy.Builder getPolicyBuilder() {
        -
        +      bitField0_ |= 0x00000001;
               onChanged();
        -      return getPolicyFieldBuilder().getBuilder();
        +      return internalGetPolicyFieldBuilder().getBuilder();
             }
        +
             /**
              *
              *
              * 
              * Required. The policy to update.
        +     *
              * To prevent conflicting updates, the `etag` value must match the value that
              * is stored in IAM. If the `etag` values do not match, the request fails with
              * a `409` error code and `ABORTED` status.
        @@ -635,11 +651,13 @@ public com.google.iam.v2.PolicyOrBuilder getPolicyOrBuilder() {
                 return policy_ == null ? com.google.iam.v2.Policy.getDefaultInstance() : policy_;
               }
             }
        +
             /**
              *
              *
              * 
              * Required. The policy to update.
        +     *
              * To prevent conflicting updates, the `etag` value must match the value that
              * is stored in IAM. If the `etag` values do not match, the request fails with
              * a `409` error code and `ABORTED` status.
        @@ -647,14 +665,14 @@ public com.google.iam.v2.PolicyOrBuilder getPolicyOrBuilder() {
              *
              * .google.iam.v2.Policy policy = 1 [(.google.api.field_behavior) = REQUIRED];
              */
        -    private com.google.protobuf.SingleFieldBuilderV3<
        +    private com.google.protobuf.SingleFieldBuilder<
                     com.google.iam.v2.Policy,
                     com.google.iam.v2.Policy.Builder,
                     com.google.iam.v2.PolicyOrBuilder>
        -        getPolicyFieldBuilder() {
        +        internalGetPolicyFieldBuilder() {
               if (policyBuilder_ == null) {
                 policyBuilder_ =
        -            new com.google.protobuf.SingleFieldBuilderV3<
        +            new com.google.protobuf.SingleFieldBuilder<
                         com.google.iam.v2.Policy,
                         com.google.iam.v2.Policy.Builder,
                         com.google.iam.v2.PolicyOrBuilder>(getPolicy(), getParentForChildren(), isClean());
        @@ -663,17 +681,6 @@ public com.google.iam.v2.PolicyOrBuilder getPolicyOrBuilder() {
               return policyBuilder_;
             }
         
        -    @java.lang.Override
        -    public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) {
        -      return super.setUnknownFields(unknownFields);
        -    }
        -
        -    @java.lang.Override
        -    public final Builder mergeUnknownFields(
        -        final com.google.protobuf.UnknownFieldSet unknownFields) {
        -      return super.mergeUnknownFields(unknownFields);
        -    }
        -
             // @@protoc_insertion_point(builder_scope:google.iam.v2.UpdatePolicyRequest)
           }
         
        diff --git a/java-iam/proto-google-iam-v2/src/main/java/com/google/iam/v2/UpdatePolicyRequestOrBuilder.java b/java-iam/proto-google-iam-v2/src/main/java/com/google/iam/v2/UpdatePolicyRequestOrBuilder.java
        index fa20ec03d5..b40b80f78e 100644
        --- a/java-iam/proto-google-iam-v2/src/main/java/com/google/iam/v2/UpdatePolicyRequestOrBuilder.java
        +++ b/java-iam/proto-google-iam-v2/src/main/java/com/google/iam/v2/UpdatePolicyRequestOrBuilder.java
        @@ -1,5 +1,5 @@
         /*
        - * Copyright 2020 Google LLC
        + * Copyright 2026 Google LLC
          *
          * Licensed under the Apache License, Version 2.0 (the "License");
          * you may not use this file except in compliance with the License.
        @@ -14,10 +14,13 @@
          * limitations under the License.
          */
         // Generated by the protocol buffer compiler.  DO NOT EDIT!
        +// NO CHECKED-IN PROTOBUF GENCODE
         // source: google/iam/v2/policy.proto
        +// Protobuf Java Version: 4.33.2
         
         package com.google.iam.v2;
         
        +@com.google.protobuf.Generated
         public interface UpdatePolicyRequestOrBuilder
             extends
             // @@protoc_insertion_point(interface_extends:google.iam.v2.UpdatePolicyRequest)
        @@ -28,6 +31,7 @@ public interface UpdatePolicyRequestOrBuilder
            *
            * 
            * Required. The policy to update.
        +   *
            * To prevent conflicting updates, the `etag` value must match the value that
            * is stored in IAM. If the `etag` values do not match, the request fails with
            * a `409` error code and `ABORTED` status.
        @@ -38,11 +42,13 @@ public interface UpdatePolicyRequestOrBuilder
            * @return Whether the policy field is set.
            */
           boolean hasPolicy();
        +
           /**
            *
            *
            * 
            * Required. The policy to update.
        +   *
            * To prevent conflicting updates, the `etag` value must match the value that
            * is stored in IAM. If the `etag` values do not match, the request fails with
            * a `409` error code and `ABORTED` status.
        @@ -53,11 +59,13 @@ public interface UpdatePolicyRequestOrBuilder
            * @return The policy.
            */
           com.google.iam.v2.Policy getPolicy();
        +
           /**
            *
            *
            * 
            * Required. The policy to update.
        +   *
            * To prevent conflicting updates, the `etag` value must match the value that
            * is stored in IAM. If the `etag` values do not match, the request fails with
            * a `409` error code and `ABORTED` status.
        diff --git a/java-iam/proto-google-iam-v2/src/main/proto/google/iam/v2/deny.proto b/java-iam/proto-google-iam-v2/src/main/proto/google/iam/v2/deny.proto
        index db9f15f895..9d4dc4b5e2 100644
        --- a/java-iam/proto-google-iam-v2/src/main/proto/google/iam/v2/deny.proto
        +++ b/java-iam/proto-google-iam-v2/src/main/proto/google/iam/v2/deny.proto
        @@ -1,4 +1,4 @@
        -// Copyright 2022 Google LLC
        +// Copyright 2025 Google LLC
         //
         // Licensed under the Apache License, Version 2.0 (the "License");
         // you may not use this file except in compliance with the License.
        @@ -19,7 +19,7 @@ package google.iam.v2;
         import "google/type/expr.proto";
         
         option csharp_namespace = "Google.Cloud.Iam.V2";
        -option go_package = "google.golang.org/genproto/googleapis/iam/v2;iam";
        +option go_package = "cloud.google.com/go/iam/apiv2/iampb;iampb";
         option java_multiple_files = true;
         option java_outer_classname = "DenyRuleProto";
         option java_package = "com.google.iam.v2";
        diff --git a/java-iam/proto-google-iam-v2/src/main/proto/google/iam/v2/policy.proto b/java-iam/proto-google-iam-v2/src/main/proto/google/iam/v2/policy.proto
        index d8923d3b83..7b34d8259b 100644
        --- a/java-iam/proto-google-iam-v2/src/main/proto/google/iam/v2/policy.proto
        +++ b/java-iam/proto-google-iam-v2/src/main/proto/google/iam/v2/policy.proto
        @@ -1,4 +1,4 @@
        -// Copyright 2022 Google LLC
        +// Copyright 2025 Google LLC
         //
         // Licensed under the Apache License, Version 2.0 (the "License");
         // you may not use this file except in compliance with the License.
        @@ -24,7 +24,7 @@ import "google/longrunning/operations.proto";
         import "google/protobuf/timestamp.proto";
         
         option csharp_namespace = "Google.Cloud.Iam.V2";
        -option go_package = "google.golang.org/genproto/googleapis/iam/v2;iam";
        +option go_package = "cloud.google.com/go/iam/apiv2/iampb;iampb";
         option java_multiple_files = true;
         option java_outer_classname = "PolicyProto";
         option java_package = "com.google.iam.v2";
        diff --git a/java-iam/proto-google-iam-v2beta/clirr-ignored-differences.xml b/java-iam/proto-google-iam-v2beta/clirr-ignored-differences.xml
        index 136c027be8..6163ac2424 100644
        --- a/java-iam/proto-google-iam-v2beta/clirr-ignored-differences.xml
        +++ b/java-iam/proto-google-iam-v2beta/clirr-ignored-differences.xml
        @@ -16,4 +16,66 @@
             com/google/iam/v2beta/*OrBuilder
             boolean has*(*)
           
        +
        +  
        +  
        +    7006
        +    com/google/iam/v2beta/**
        +    * getDefaultInstanceForType()
        +    **
        +  
        +  
        +    7006
        +    com/google/iam/v2beta/**
        +    * addRepeatedField(*)
        +    **
        +  
        +  
        +    7006
        +    com/google/iam/v2beta/**
        +    * clear()
        +    **
        +  
        +  
        +    7006
        +    com/google/iam/v2beta/**
        +    * clearField(*)
        +    **
        +  
        +  
        +    7006
        +    com/google/iam/v2beta/**
        +    * clearOneof(*)
        +    **
        +  
        +  
        +    7006
        +    com/google/iam/v2beta/**
        +    * clone()
        +    **
        +  
        +  
        +    7006
        +    com/google/iam/v2beta/**
        +    * mergeUnknownFields(*)
        +    **
        +  
        +  
        +    7006
        +    com/google/iam/v2beta/**
        +    * setField(*)
        +    **
        +  
        +  
        +    7006
        +    com/google/iam/v2beta/**
        +    * setRepeatedField(*)
        +    **
        +  
        +  
        +    7006
        +    com/google/iam/v2beta/**
        +    * setUnknownFields(*)
        +    **
        +  
         
        diff --git a/java-iam/proto-google-iam-v2beta/pom.xml b/java-iam/proto-google-iam-v2beta/pom.xml
        index d45a3ed392..54c9c01f7b 100644
        --- a/java-iam/proto-google-iam-v2beta/pom.xml
        +++ b/java-iam/proto-google-iam-v2beta/pom.xml
        @@ -4,13 +4,13 @@
           4.0.0
           com.google.api.grpc
           proto-google-iam-v2beta
        -  1.6.23-SNAPSHOT
        +  1.62.1-SNAPSHOT
           proto-google-iam-v2beta
           Proto library for proto-google-iam-v1
           
             com.google.cloud
             google-iam-parent
        -    1.6.23-SNAPSHOT
        +    1.62.1-SNAPSHOT
           
           
             
        diff --git a/java-iam/proto-google-iam-v2beta/src/main/java/com/google/iam/v2beta/CreatePolicyRequest.java b/java-iam/proto-google-iam-v2beta/src/main/java/com/google/iam/v2beta/CreatePolicyRequest.java
        index 4c91193e2d..c38d3686c5 100644
        --- a/java-iam/proto-google-iam-v2beta/src/main/java/com/google/iam/v2beta/CreatePolicyRequest.java
        +++ b/java-iam/proto-google-iam-v2beta/src/main/java/com/google/iam/v2beta/CreatePolicyRequest.java
        @@ -1,5 +1,5 @@
         /*
        - * Copyright 2020 Google LLC
        + * Copyright 2026 Google LLC
          *
          * Licensed under the Apache License, Version 2.0 (the "License");
          * you may not use this file except in compliance with the License.
        @@ -14,7 +14,9 @@
          * limitations under the License.
          */
         // Generated by the protocol buffer compiler.  DO NOT EDIT!
        +// NO CHECKED-IN PROTOBUF GENCODE
         // source: google/iam/v2beta/policy.proto
        +// Protobuf Java Version: 4.33.2
         
         package com.google.iam.v2beta;
         
        @@ -27,13 +29,25 @@
          *
          * Protobuf type {@code google.iam.v2beta.CreatePolicyRequest}
          */
        -public final class CreatePolicyRequest extends com.google.protobuf.GeneratedMessageV3
        +@com.google.protobuf.Generated
        +public final class CreatePolicyRequest extends com.google.protobuf.GeneratedMessage
             implements
             // @@protoc_insertion_point(message_implements:google.iam.v2beta.CreatePolicyRequest)
             CreatePolicyRequestOrBuilder {
           private static final long serialVersionUID = 0L;
        +
        +  static {
        +    com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion(
        +        com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC,
        +        /* major= */ 4,
        +        /* minor= */ 33,
        +        /* patch= */ 2,
        +        /* suffix= */ "",
        +        "CreatePolicyRequest");
        +  }
        +
           // Use CreatePolicyRequest.newBuilder() to construct.
        -  private CreatePolicyRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) {
        +  private CreatePolicyRequest(com.google.protobuf.GeneratedMessage.Builder builder) {
             super(builder);
           }
         
        @@ -42,24 +56,13 @@ private CreatePolicyRequest() {
             policyId_ = "";
           }
         
        -  @java.lang.Override
        -  @SuppressWarnings({"unused"})
        -  protected java.lang.Object newInstance(UnusedPrivateParameter unused) {
        -    return new CreatePolicyRequest();
        -  }
        -
        -  @java.lang.Override
        -  public final com.google.protobuf.UnknownFieldSet getUnknownFields() {
        -    return this.unknownFields;
        -  }
        -
           public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
             return com.google.iam.v2beta.PolicyProto
                 .internal_static_google_iam_v2beta_CreatePolicyRequest_descriptor;
           }
         
           @java.lang.Override
        -  protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
        +  protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
               internalGetFieldAccessorTable() {
             return com.google.iam.v2beta.PolicyProto
                 .internal_static_google_iam_v2beta_CreatePolicyRequest_fieldAccessorTable
        @@ -68,18 +71,25 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
                     com.google.iam.v2beta.CreatePolicyRequest.Builder.class);
           }
         
        +  private int bitField0_;
           public static final int PARENT_FIELD_NUMBER = 1;
        -  private volatile java.lang.Object parent_;
        +
        +  @SuppressWarnings("serial")
        +  private volatile java.lang.Object parent_ = "";
        +
           /**
            *
            *
            * 
            * Required. The resource that the policy is attached to, along with the kind of policy
            * to create. Format: `policies/{attachment_point}/denypolicies`
        +   *
        +   *
            * The attachment point is identified by its URL-encoded full resource name,
            * which means that the forward-slash character, `/`, must be written as
            * `%2F`. For example,
            * `policies/cloudresourcemanager.googleapis.com%2Fprojects%2Fmy-project/denypolicies`.
        +   *
            * For organizations and folders, use the numeric ID in the full resource
            * name. For projects, you can use the alphanumeric or the numeric ID.
            * 
        @@ -100,16 +110,20 @@ public java.lang.String getParent() { return s; } } + /** * * *
            * Required. The resource that the policy is attached to, along with the kind of policy
            * to create. Format: `policies/{attachment_point}/denypolicies`
        +   *
        +   *
            * The attachment point is identified by its URL-encoded full resource name,
            * which means that the forward-slash character, `/`, must be written as
            * `%2F`. For example,
            * `policies/cloudresourcemanager.googleapis.com%2Fprojects%2Fmy-project/denypolicies`.
        +   *
            * For organizations and folders, use the numeric ID in the full resource
            * name. For projects, you can use the alphanumeric or the numeric ID.
            * 
        @@ -133,6 +147,7 @@ public com.google.protobuf.ByteString getParentBytes() { public static final int POLICY_FIELD_NUMBER = 2; private com.google.iam.v2beta.Policy policy_; + /** * * @@ -146,8 +161,9 @@ public com.google.protobuf.ByteString getParentBytes() { */ @java.lang.Override public boolean hasPolicy() { - return policy_ != null; + return ((bitField0_ & 0x00000001) != 0); } + /** * * @@ -163,6 +179,7 @@ public boolean hasPolicy() { public com.google.iam.v2beta.Policy getPolicy() { return policy_ == null ? com.google.iam.v2beta.Policy.getDefaultInstance() : policy_; } + /** * * @@ -174,11 +191,14 @@ public com.google.iam.v2beta.Policy getPolicy() { */ @java.lang.Override public com.google.iam.v2beta.PolicyOrBuilder getPolicyOrBuilder() { - return getPolicy(); + return policy_ == null ? com.google.iam.v2beta.Policy.getDefaultInstance() : policy_; } public static final int POLICY_ID_FIELD_NUMBER = 3; - private volatile java.lang.Object policyId_; + + @SuppressWarnings("serial") + private volatile java.lang.Object policyId_ = ""; + /** * * @@ -205,6 +225,7 @@ public java.lang.String getPolicyId() { return s; } } + /** * * @@ -246,14 +267,14 @@ public final boolean isInitialized() { @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.GeneratedMessage.isStringEmpty(parent_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, parent_); } - if (policy_ != null) { + if (((bitField0_ & 0x00000001) != 0)) { output.writeMessage(2, getPolicy()); } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(policyId_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 3, policyId_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(policyId_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 3, policyId_); } getUnknownFields().writeTo(output); } @@ -264,14 +285,14 @@ public int getSerializedSize() { 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.GeneratedMessage.isStringEmpty(parent_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, parent_); } - if (policy_ != null) { + if (((bitField0_ & 0x00000001) != 0)) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getPolicy()); } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(policyId_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, policyId_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(policyId_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(3, policyId_); } size += getUnknownFields().getSerializedSize(); memoizedSize = size; @@ -356,38 +377,38 @@ public static com.google.iam.v2beta.CreatePolicyRequest parseFrom( public static com.google.iam.v2beta.CreatePolicyRequest parseFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); } public static com.google.iam.v2beta.CreatePolicyRequest parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } public static com.google.iam.v2beta.CreatePolicyRequest parseDelimitedFrom( java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); } public static com.google.iam.v2beta.CreatePolicyRequest parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( PARSER, input, extensionRegistry); } public static com.google.iam.v2beta.CreatePolicyRequest parseFrom( com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); } public static com.google.iam.v2beta.CreatePolicyRequest parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } @@ -410,10 +431,11 @@ public Builder toBuilder() { } @java.lang.Override - protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { Builder builder = new Builder(parent); return builder; } + /** * * @@ -423,7 +445,7 @@ protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.Build * * Protobuf type {@code google.iam.v2beta.CreatePolicyRequest} */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder implements // @@protoc_insertion_point(builder_implements:google.iam.v2beta.CreatePolicyRequest) com.google.iam.v2beta.CreatePolicyRequestOrBuilder { @@ -433,7 +455,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.iam.v2beta.PolicyProto .internal_static_google_iam_v2beta_CreatePolicyRequest_fieldAccessorTable @@ -443,25 +465,32 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } // Construct using com.google.iam.v2beta.CreatePolicyRequest.newBuilder() - private Builder() {} + private Builder() { + maybeForceBuilderInitialization(); + } - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetPolicyFieldBuilder(); + } } @java.lang.Override public Builder clear() { super.clear(); + bitField0_ = 0; parent_ = ""; - - if (policyBuilder_ == null) { - policy_ = null; - } else { - policy_ = null; + policy_ = null; + if (policyBuilder_ != null) { + policyBuilder_.dispose(); policyBuilder_ = null; } policyId_ = ""; - return this; } @@ -489,48 +518,27 @@ public com.google.iam.v2beta.CreatePolicyRequest build() { public com.google.iam.v2beta.CreatePolicyRequest buildPartial() { com.google.iam.v2beta.CreatePolicyRequest result = new com.google.iam.v2beta.CreatePolicyRequest(this); - result.parent_ = parent_; - if (policyBuilder_ == null) { - result.policy_ = policy_; - } else { - result.policy_ = policyBuilder_.build(); + if (bitField0_ != 0) { + buildPartial0(result); } - result.policyId_ = policyId_; 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); + private void buildPartial0(com.google.iam.v2beta.CreatePolicyRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.parent_ = parent_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.policy_ = policyBuilder_ == null ? policy_ : policyBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.policyId_ = policyId_; + } + result.bitField0_ |= to_bitField0_; } @java.lang.Override @@ -547,6 +555,7 @@ public Builder mergeFrom(com.google.iam.v2beta.CreatePolicyRequest other) { if (other == com.google.iam.v2beta.CreatePolicyRequest.getDefaultInstance()) return this; if (!other.getParent().isEmpty()) { parent_ = other.parent_; + bitField0_ |= 0x00000001; onChanged(); } if (other.hasPolicy()) { @@ -554,6 +563,7 @@ public Builder mergeFrom(com.google.iam.v2beta.CreatePolicyRequest other) { } if (!other.getPolicyId().isEmpty()) { policyId_ = other.policyId_; + bitField0_ |= 0x00000004; onChanged(); } this.mergeUnknownFields(other.getUnknownFields()); @@ -585,19 +595,19 @@ public Builder mergeFrom( case 10: { parent_ = input.readStringRequireUtf8(); - + bitField0_ |= 0x00000001; break; } // case 10 case 18: { - input.readMessage(getPolicyFieldBuilder().getBuilder(), extensionRegistry); - + input.readMessage(internalGetPolicyFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; break; } // case 18 case 26: { policyId_ = input.readStringRequireUtf8(); - + bitField0_ |= 0x00000004; break; } // case 26 default: @@ -617,17 +627,23 @@ public Builder mergeFrom( return this; } + private int bitField0_; + private java.lang.Object parent_ = ""; + /** * * *
              * Required. The resource that the policy is attached to, along with the kind of policy
              * to create. Format: `policies/{attachment_point}/denypolicies`
        +     *
        +     *
              * The attachment point is identified by its URL-encoded full resource name,
              * which means that the forward-slash character, `/`, must be written as
              * `%2F`. For example,
              * `policies/cloudresourcemanager.googleapis.com%2Fprojects%2Fmy-project/denypolicies`.
        +     *
              * For organizations and folders, use the numeric ID in the full resource
              * name. For projects, you can use the alphanumeric or the numeric ID.
              * 
        @@ -647,16 +663,20 @@ public java.lang.String getParent() { return (java.lang.String) ref; } } + /** * * *
              * Required. The resource that the policy is attached to, along with the kind of policy
              * to create. Format: `policies/{attachment_point}/denypolicies`
        +     *
        +     *
              * The attachment point is identified by its URL-encoded full resource name,
              * which means that the forward-slash character, `/`, must be written as
              * `%2F`. For example,
              * `policies/cloudresourcemanager.googleapis.com%2Fprojects%2Fmy-project/denypolicies`.
        +     *
              * For organizations and folders, use the numeric ID in the full resource
              * name. For projects, you can use the alphanumeric or the numeric ID.
              * 
        @@ -676,16 +696,20 @@ public com.google.protobuf.ByteString getParentBytes() { return (com.google.protobuf.ByteString) ref; } } + /** * * *
              * Required. The resource that the policy is attached to, along with the kind of policy
              * to create. Format: `policies/{attachment_point}/denypolicies`
        +     *
        +     *
              * The attachment point is identified by its URL-encoded full resource name,
              * which means that the forward-slash character, `/`, must be written as
              * `%2F`. For example,
              * `policies/cloudresourcemanager.googleapis.com%2Fprojects%2Fmy-project/denypolicies`.
        +     *
              * For organizations and folders, use the numeric ID in the full resource
              * name. For projects, you can use the alphanumeric or the numeric ID.
              * 
        @@ -699,21 +723,25 @@ public Builder setParent(java.lang.String value) { if (value == null) { throw new NullPointerException(); } - parent_ = value; + bitField0_ |= 0x00000001; onChanged(); return this; } + /** * * *
              * Required. The resource that the policy is attached to, along with the kind of policy
              * to create. Format: `policies/{attachment_point}/denypolicies`
        +     *
        +     *
              * The attachment point is identified by its URL-encoded full resource name,
              * which means that the forward-slash character, `/`, must be written as
              * `%2F`. For example,
              * `policies/cloudresourcemanager.googleapis.com%2Fprojects%2Fmy-project/denypolicies`.
        +     *
              * For organizations and folders, use the numeric ID in the full resource
              * name. For projects, you can use the alphanumeric or the numeric ID.
              * 
        @@ -723,21 +751,25 @@ public Builder setParent(java.lang.String value) { * @return This builder for chaining. */ public Builder clearParent() { - parent_ = getDefaultInstance().getParent(); + bitField0_ = (bitField0_ & ~0x00000001); onChanged(); return this; } + /** * * *
              * Required. The resource that the policy is attached to, along with the kind of policy
              * to create. Format: `policies/{attachment_point}/denypolicies`
        +     *
        +     *
              * The attachment point is identified by its URL-encoded full resource name,
              * which means that the forward-slash character, `/`, must be written as
              * `%2F`. For example,
              * `policies/cloudresourcemanager.googleapis.com%2Fprojects%2Fmy-project/denypolicies`.
        +     *
              * For organizations and folders, use the numeric ID in the full resource
              * name. For projects, you can use the alphanumeric or the numeric ID.
              * 
        @@ -752,18 +784,19 @@ public Builder setParentBytes(com.google.protobuf.ByteString value) { throw new NullPointerException(); } checkByteStringIsUtf8(value); - parent_ = value; + bitField0_ |= 0x00000001; onChanged(); return this; } private com.google.iam.v2beta.Policy policy_; - private com.google.protobuf.SingleFieldBuilderV3< + private com.google.protobuf.SingleFieldBuilder< com.google.iam.v2beta.Policy, com.google.iam.v2beta.Policy.Builder, com.google.iam.v2beta.PolicyOrBuilder> policyBuilder_; + /** * * @@ -776,8 +809,9 @@ public Builder setParentBytes(com.google.protobuf.ByteString value) { * @return Whether the policy field is set. */ public boolean hasPolicy() { - return policyBuilder_ != null || policy_ != null; + return ((bitField0_ & 0x00000002) != 0); } + /** * * @@ -796,6 +830,7 @@ public com.google.iam.v2beta.Policy getPolicy() { return policyBuilder_.getMessage(); } } + /** * * @@ -811,13 +846,14 @@ public Builder setPolicy(com.google.iam.v2beta.Policy value) { throw new NullPointerException(); } policy_ = value; - onChanged(); } else { policyBuilder_.setMessage(value); } - + bitField0_ |= 0x00000002; + onChanged(); return this; } + /** * * @@ -830,13 +866,14 @@ public Builder setPolicy(com.google.iam.v2beta.Policy value) { public Builder setPolicy(com.google.iam.v2beta.Policy.Builder builderForValue) { if (policyBuilder_ == null) { policy_ = builderForValue.build(); - onChanged(); } else { policyBuilder_.setMessage(builderForValue.build()); } - + bitField0_ |= 0x00000002; + onChanged(); return this; } + /** * * @@ -848,19 +885,23 @@ public Builder setPolicy(com.google.iam.v2beta.Policy.Builder builderForValue) { */ public Builder mergePolicy(com.google.iam.v2beta.Policy value) { if (policyBuilder_ == null) { - if (policy_ != null) { - policy_ = - com.google.iam.v2beta.Policy.newBuilder(policy_).mergeFrom(value).buildPartial(); + if (((bitField0_ & 0x00000002) != 0) + && policy_ != null + && policy_ != com.google.iam.v2beta.Policy.getDefaultInstance()) { + getPolicyBuilder().mergeFrom(value); } else { policy_ = value; } - onChanged(); } else { policyBuilder_.mergeFrom(value); } - + if (policy_ != null) { + bitField0_ |= 0x00000002; + onChanged(); + } return this; } + /** * * @@ -871,16 +912,16 @@ public Builder mergePolicy(com.google.iam.v2beta.Policy value) { * .google.iam.v2beta.Policy policy = 2 [(.google.api.field_behavior) = REQUIRED]; */ public Builder clearPolicy() { - if (policyBuilder_ == null) { - policy_ = null; - onChanged(); - } else { - policy_ = null; + bitField0_ = (bitField0_ & ~0x00000002); + policy_ = null; + if (policyBuilder_ != null) { + policyBuilder_.dispose(); policyBuilder_ = null; } - + onChanged(); return this; } + /** * * @@ -891,10 +932,11 @@ public Builder clearPolicy() { * .google.iam.v2beta.Policy policy = 2 [(.google.api.field_behavior) = REQUIRED]; */ public com.google.iam.v2beta.Policy.Builder getPolicyBuilder() { - + bitField0_ |= 0x00000002; onChanged(); - return getPolicyFieldBuilder().getBuilder(); + return internalGetPolicyFieldBuilder().getBuilder(); } + /** * * @@ -911,6 +953,7 @@ public com.google.iam.v2beta.PolicyOrBuilder getPolicyOrBuilder() { return policy_ == null ? com.google.iam.v2beta.Policy.getDefaultInstance() : policy_; } } + /** * * @@ -920,14 +963,14 @@ public com.google.iam.v2beta.PolicyOrBuilder getPolicyOrBuilder() { * * .google.iam.v2beta.Policy policy = 2 [(.google.api.field_behavior) = REQUIRED]; */ - private com.google.protobuf.SingleFieldBuilderV3< + private com.google.protobuf.SingleFieldBuilder< com.google.iam.v2beta.Policy, com.google.iam.v2beta.Policy.Builder, com.google.iam.v2beta.PolicyOrBuilder> - getPolicyFieldBuilder() { + internalGetPolicyFieldBuilder() { if (policyBuilder_ == null) { policyBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< + new com.google.protobuf.SingleFieldBuilder< com.google.iam.v2beta.Policy, com.google.iam.v2beta.Policy.Builder, com.google.iam.v2beta.PolicyOrBuilder>( @@ -938,6 +981,7 @@ public com.google.iam.v2beta.PolicyOrBuilder getPolicyOrBuilder() { } private java.lang.Object policyId_ = ""; + /** * * @@ -963,6 +1007,7 @@ public java.lang.String getPolicyId() { return (java.lang.String) ref; } } + /** * * @@ -988,6 +1033,7 @@ public com.google.protobuf.ByteString getPolicyIdBytes() { return (com.google.protobuf.ByteString) ref; } } + /** * * @@ -1007,11 +1053,12 @@ public Builder setPolicyId(java.lang.String value) { if (value == null) { throw new NullPointerException(); } - policyId_ = value; + bitField0_ |= 0x00000004; onChanged(); return this; } + /** * * @@ -1027,11 +1074,12 @@ public Builder setPolicyId(java.lang.String value) { * @return This builder for chaining. */ public Builder clearPolicyId() { - policyId_ = getDefaultInstance().getPolicyId(); + bitField0_ = (bitField0_ & ~0x00000004); onChanged(); return this; } + /** * * @@ -1052,23 +1100,12 @@ public Builder setPolicyIdBytes(com.google.protobuf.ByteString value) { throw new NullPointerException(); } checkByteStringIsUtf8(value); - policyId_ = 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.iam.v2beta.CreatePolicyRequest) } diff --git a/java-iam/proto-google-iam-v2beta/src/main/java/com/google/iam/v2beta/CreatePolicyRequestOrBuilder.java b/java-iam/proto-google-iam-v2beta/src/main/java/com/google/iam/v2beta/CreatePolicyRequestOrBuilder.java index 24c4fc2fb6..b639e27bd4 100644 --- a/java-iam/proto-google-iam-v2beta/src/main/java/com/google/iam/v2beta/CreatePolicyRequestOrBuilder.java +++ b/java-iam/proto-google-iam-v2beta/src/main/java/com/google/iam/v2beta/CreatePolicyRequestOrBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,10 +14,13 @@ * limitations under the License. */ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: google/iam/v2beta/policy.proto +// Protobuf Java Version: 4.33.2 package com.google.iam.v2beta; +@com.google.protobuf.Generated public interface CreatePolicyRequestOrBuilder extends // @@protoc_insertion_point(interface_extends:google.iam.v2beta.CreatePolicyRequest) @@ -29,10 +32,13 @@ public interface CreatePolicyRequestOrBuilder *
            * Required. The resource that the policy is attached to, along with the kind of policy
            * to create. Format: `policies/{attachment_point}/denypolicies`
        +   *
        +   *
            * The attachment point is identified by its URL-encoded full resource name,
            * which means that the forward-slash character, `/`, must be written as
            * `%2F`. For example,
            * `policies/cloudresourcemanager.googleapis.com%2Fprojects%2Fmy-project/denypolicies`.
        +   *
            * For organizations and folders, use the numeric ID in the full resource
            * name. For projects, you can use the alphanumeric or the numeric ID.
            * 
        @@ -42,16 +48,20 @@ public interface CreatePolicyRequestOrBuilder * @return The parent. */ java.lang.String getParent(); + /** * * *
            * Required. The resource that the policy is attached to, along with the kind of policy
            * to create. Format: `policies/{attachment_point}/denypolicies`
        +   *
        +   *
            * The attachment point is identified by its URL-encoded full resource name,
            * which means that the forward-slash character, `/`, must be written as
            * `%2F`. For example,
            * `policies/cloudresourcemanager.googleapis.com%2Fprojects%2Fmy-project/denypolicies`.
        +   *
            * For organizations and folders, use the numeric ID in the full resource
            * name. For projects, you can use the alphanumeric or the numeric ID.
            * 
        @@ -74,6 +84,7 @@ public interface CreatePolicyRequestOrBuilder * @return Whether the policy field is set. */ boolean hasPolicy(); + /** * * @@ -86,6 +97,7 @@ public interface CreatePolicyRequestOrBuilder * @return The policy. */ com.google.iam.v2beta.Policy getPolicy(); + /** * * @@ -112,6 +124,7 @@ public interface CreatePolicyRequestOrBuilder * @return The policyId. */ java.lang.String getPolicyId(); + /** * * diff --git a/java-iam/proto-google-iam-v2beta/src/main/java/com/google/iam/v2beta/DeletePolicyRequest.java b/java-iam/proto-google-iam-v2beta/src/main/java/com/google/iam/v2beta/DeletePolicyRequest.java index 255a71ece4..fa5b45baf9 100644 --- a/java-iam/proto-google-iam-v2beta/src/main/java/com/google/iam/v2beta/DeletePolicyRequest.java +++ b/java-iam/proto-google-iam-v2beta/src/main/java/com/google/iam/v2beta/DeletePolicyRequest.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,9 @@ * limitations under the License. */ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: google/iam/v2beta/policy.proto +// Protobuf Java Version: 4.33.2 package com.google.iam.v2beta; @@ -27,13 +29,25 @@ * * Protobuf type {@code google.iam.v2beta.DeletePolicyRequest} */ -public final class DeletePolicyRequest extends com.google.protobuf.GeneratedMessageV3 +@com.google.protobuf.Generated +public final class DeletePolicyRequest extends com.google.protobuf.GeneratedMessage implements // @@protoc_insertion_point(message_implements:google.iam.v2beta.DeletePolicyRequest) DeletePolicyRequestOrBuilder { private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "DeletePolicyRequest"); + } + // Use DeletePolicyRequest.newBuilder() to construct. - private DeletePolicyRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + private DeletePolicyRequest(com.google.protobuf.GeneratedMessage.Builder builder) { super(builder); } @@ -42,24 +56,13 @@ private DeletePolicyRequest() { etag_ = ""; } - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new DeletePolicyRequest(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.iam.v2beta.PolicyProto .internal_static_google_iam_v2beta_DeletePolicyRequest_descriptor; } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.iam.v2beta.PolicyProto .internal_static_google_iam_v2beta_DeletePolicyRequest_fieldAccessorTable @@ -69,16 +72,22 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } public static final int NAME_FIELD_NUMBER = 1; - private volatile java.lang.Object name_; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** * * *
            * Required. The resource name of the policy to delete. Format:
            * `policies/{attachment_point}/denypolicies/{policy_id}`
        +   *
        +   *
            * Use the URL-encoded full resource name, which means that the forward-slash
            * character, `/`, must be written as `%2F`. For example,
            * `policies/cloudresourcemanager.googleapis.com%2Fprojects%2Fmy-project/denypolicies/my-policy`.
        +   *
            * For organizations and folders, use the numeric ID in the full resource
            * name. For projects, you can use the alphanumeric or the numeric ID.
            * 
        @@ -99,15 +108,19 @@ public java.lang.String getName() { return s; } } + /** * * *
            * Required. The resource name of the policy to delete. Format:
            * `policies/{attachment_point}/denypolicies/{policy_id}`
        +   *
        +   *
            * Use the URL-encoded full resource name, which means that the forward-slash
            * character, `/`, must be written as `%2F`. For example,
            * `policies/cloudresourcemanager.googleapis.com%2Fprojects%2Fmy-project/denypolicies/my-policy`.
        +   *
            * For organizations and folders, use the numeric ID in the full resource
            * name. For projects, you can use the alphanumeric or the numeric ID.
            * 
        @@ -130,7 +143,10 @@ public com.google.protobuf.ByteString getNameBytes() { } public static final int ETAG_FIELD_NUMBER = 2; - private volatile java.lang.Object etag_; + + @SuppressWarnings("serial") + private volatile java.lang.Object etag_ = ""; + /** * * @@ -138,6 +154,7 @@ public com.google.protobuf.ByteString getNameBytes() { * Optional. The expected `etag` of the policy to delete. If the value does not match * the value that is stored in IAM, the request fails with a `409` error code * and `ABORTED` status. + * * If you omit this field, the policy is deleted regardless of its current * `etag`. *
        @@ -158,6 +175,7 @@ public java.lang.String getEtag() { return s; } } + /** * * @@ -165,6 +183,7 @@ public java.lang.String getEtag() { * Optional. The expected `etag` of the policy to delete. If the value does not match * the value that is stored in IAM, the request fails with a `409` error code * and `ABORTED` status. + * * If you omit this field, the policy is deleted regardless of its current * `etag`. *
        @@ -200,11 +219,11 @@ public final boolean isInitialized() { @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.GeneratedMessage.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, name_); } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(etag_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 2, etag_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(etag_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, etag_); } getUnknownFields().writeTo(output); } @@ -215,11 +234,11 @@ public int getSerializedSize() { 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.GeneratedMessage.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, name_); } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(etag_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, etag_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(etag_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, etag_); } size += getUnknownFields().getSerializedSize(); memoizedSize = size; @@ -296,38 +315,38 @@ public static com.google.iam.v2beta.DeletePolicyRequest parseFrom( public static com.google.iam.v2beta.DeletePolicyRequest parseFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); } public static com.google.iam.v2beta.DeletePolicyRequest parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } public static com.google.iam.v2beta.DeletePolicyRequest parseDelimitedFrom( java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); } public static com.google.iam.v2beta.DeletePolicyRequest parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( PARSER, input, extensionRegistry); } public static com.google.iam.v2beta.DeletePolicyRequest parseFrom( com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); } public static com.google.iam.v2beta.DeletePolicyRequest parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } @@ -350,10 +369,11 @@ public Builder toBuilder() { } @java.lang.Override - protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { Builder builder = new Builder(parent); return builder; } + /** * * @@ -363,7 +383,7 @@ protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.Build * * Protobuf type {@code google.iam.v2beta.DeletePolicyRequest} */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder implements // @@protoc_insertion_point(builder_implements:google.iam.v2beta.DeletePolicyRequest) com.google.iam.v2beta.DeletePolicyRequestOrBuilder { @@ -373,7 +393,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.iam.v2beta.PolicyProto .internal_static_google_iam_v2beta_DeletePolicyRequest_fieldAccessorTable @@ -385,17 +405,16 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { // Construct using com.google.iam.v2beta.DeletePolicyRequest.newBuilder() private Builder() {} - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { super(parent); } @java.lang.Override public Builder clear() { super.clear(); + bitField0_ = 0; name_ = ""; - etag_ = ""; - return this; } @@ -423,43 +442,21 @@ public com.google.iam.v2beta.DeletePolicyRequest build() { public com.google.iam.v2beta.DeletePolicyRequest buildPartial() { com.google.iam.v2beta.DeletePolicyRequest result = new com.google.iam.v2beta.DeletePolicyRequest(this); - result.name_ = name_; - result.etag_ = etag_; + if (bitField0_ != 0) { + buildPartial0(result); + } 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); + private void buildPartial0(com.google.iam.v2beta.DeletePolicyRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.etag_ = etag_; + } } @java.lang.Override @@ -476,10 +473,12 @@ public Builder mergeFrom(com.google.iam.v2beta.DeletePolicyRequest other) { if (other == com.google.iam.v2beta.DeletePolicyRequest.getDefaultInstance()) return this; if (!other.getName().isEmpty()) { name_ = other.name_; + bitField0_ |= 0x00000001; onChanged(); } if (!other.getEtag().isEmpty()) { etag_ = other.etag_; + bitField0_ |= 0x00000002; onChanged(); } this.mergeUnknownFields(other.getUnknownFields()); @@ -511,13 +510,13 @@ public Builder mergeFrom( case 10: { name_ = input.readStringRequireUtf8(); - + bitField0_ |= 0x00000001; break; } // case 10 case 18: { etag_ = input.readStringRequireUtf8(); - + bitField0_ |= 0x00000002; break; } // case 18 default: @@ -537,16 +536,22 @@ public Builder mergeFrom( return this; } + private int bitField0_; + private java.lang.Object name_ = ""; + /** * * *
              * Required. The resource name of the policy to delete. Format:
              * `policies/{attachment_point}/denypolicies/{policy_id}`
        +     *
        +     *
              * Use the URL-encoded full resource name, which means that the forward-slash
              * character, `/`, must be written as `%2F`. For example,
              * `policies/cloudresourcemanager.googleapis.com%2Fprojects%2Fmy-project/denypolicies/my-policy`.
        +     *
              * For organizations and folders, use the numeric ID in the full resource
              * name. For projects, you can use the alphanumeric or the numeric ID.
              * 
        @@ -566,15 +571,19 @@ public java.lang.String getName() { return (java.lang.String) ref; } } + /** * * *
              * Required. The resource name of the policy to delete. Format:
              * `policies/{attachment_point}/denypolicies/{policy_id}`
        +     *
        +     *
              * Use the URL-encoded full resource name, which means that the forward-slash
              * character, `/`, must be written as `%2F`. For example,
              * `policies/cloudresourcemanager.googleapis.com%2Fprojects%2Fmy-project/denypolicies/my-policy`.
        +     *
              * For organizations and folders, use the numeric ID in the full resource
              * name. For projects, you can use the alphanumeric or the numeric ID.
              * 
        @@ -594,15 +603,19 @@ public com.google.protobuf.ByteString getNameBytes() { return (com.google.protobuf.ByteString) ref; } } + /** * * *
              * Required. The resource name of the policy to delete. Format:
              * `policies/{attachment_point}/denypolicies/{policy_id}`
        +     *
        +     *
              * Use the URL-encoded full resource name, which means that the forward-slash
              * character, `/`, must be written as `%2F`. For example,
              * `policies/cloudresourcemanager.googleapis.com%2Fprojects%2Fmy-project/denypolicies/my-policy`.
        +     *
              * For organizations and folders, use the numeric ID in the full resource
              * name. For projects, you can use the alphanumeric or the numeric ID.
              * 
        @@ -616,20 +629,24 @@ 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 to delete. Format:
              * `policies/{attachment_point}/denypolicies/{policy_id}`
        +     *
        +     *
              * Use the URL-encoded full resource name, which means that the forward-slash
              * character, `/`, must be written as `%2F`. For example,
              * `policies/cloudresourcemanager.googleapis.com%2Fprojects%2Fmy-project/denypolicies/my-policy`.
        +     *
              * For organizations and folders, use the numeric ID in the full resource
              * name. For projects, you can use the alphanumeric or the numeric ID.
              * 
        @@ -639,20 +656,24 @@ public Builder setName(java.lang.String value) { * @return This builder for chaining. */ public Builder clearName() { - name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); onChanged(); return this; } + /** * * *
              * Required. The resource name of the policy to delete. Format:
              * `policies/{attachment_point}/denypolicies/{policy_id}`
        +     *
        +     *
              * Use the URL-encoded full resource name, which means that the forward-slash
              * character, `/`, must be written as `%2F`. For example,
              * `policies/cloudresourcemanager.googleapis.com%2Fprojects%2Fmy-project/denypolicies/my-policy`.
        +     *
              * For organizations and folders, use the numeric ID in the full resource
              * name. For projects, you can use the alphanumeric or the numeric ID.
              * 
        @@ -667,13 +688,14 @@ public Builder setNameBytes(com.google.protobuf.ByteString value) { throw new NullPointerException(); } checkByteStringIsUtf8(value); - name_ = value; + bitField0_ |= 0x00000001; onChanged(); return this; } private java.lang.Object etag_ = ""; + /** * * @@ -681,6 +703,7 @@ public Builder setNameBytes(com.google.protobuf.ByteString value) { * Optional. The expected `etag` of the policy to delete. If the value does not match * the value that is stored in IAM, the request fails with a `409` error code * and `ABORTED` status. + * * If you omit this field, the policy is deleted regardless of its current * `etag`. *
        @@ -700,6 +723,7 @@ public java.lang.String getEtag() { return (java.lang.String) ref; } } + /** * * @@ -707,6 +731,7 @@ public java.lang.String getEtag() { * Optional. The expected `etag` of the policy to delete. If the value does not match * the value that is stored in IAM, the request fails with a `409` error code * and `ABORTED` status. + * * If you omit this field, the policy is deleted regardless of its current * `etag`. *
        @@ -726,6 +751,7 @@ public com.google.protobuf.ByteString getEtagBytes() { return (com.google.protobuf.ByteString) ref; } } + /** * * @@ -733,6 +759,7 @@ public com.google.protobuf.ByteString getEtagBytes() { * Optional. The expected `etag` of the policy to delete. If the value does not match * the value that is stored in IAM, the request fails with a `409` error code * and `ABORTED` status. + * * If you omit this field, the policy is deleted regardless of its current * `etag`. *
        @@ -746,11 +773,12 @@ public Builder setEtag(java.lang.String value) { if (value == null) { throw new NullPointerException(); } - etag_ = value; + bitField0_ |= 0x00000002; onChanged(); return this; } + /** * * @@ -758,6 +786,7 @@ public Builder setEtag(java.lang.String value) { * Optional. The expected `etag` of the policy to delete. If the value does not match * the value that is stored in IAM, the request fails with a `409` error code * and `ABORTED` status. + * * If you omit this field, the policy is deleted regardless of its current * `etag`. *
        @@ -767,11 +796,12 @@ public Builder setEtag(java.lang.String value) { * @return This builder for chaining. */ public Builder clearEtag() { - etag_ = getDefaultInstance().getEtag(); + bitField0_ = (bitField0_ & ~0x00000002); onChanged(); return this; } + /** * * @@ -779,6 +809,7 @@ public Builder clearEtag() { * Optional. The expected `etag` of the policy to delete. If the value does not match * the value that is stored in IAM, the request fails with a `409` error code * and `ABORTED` status. + * * If you omit this field, the policy is deleted regardless of its current * `etag`. *
        @@ -793,23 +824,12 @@ public Builder setEtagBytes(com.google.protobuf.ByteString value) { throw new NullPointerException(); } checkByteStringIsUtf8(value); - etag_ = 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.iam.v2beta.DeletePolicyRequest) } diff --git a/java-iam/proto-google-iam-v2beta/src/main/java/com/google/iam/v2beta/DeletePolicyRequestOrBuilder.java b/java-iam/proto-google-iam-v2beta/src/main/java/com/google/iam/v2beta/DeletePolicyRequestOrBuilder.java index 1b19529885..f472edaaf7 100644 --- a/java-iam/proto-google-iam-v2beta/src/main/java/com/google/iam/v2beta/DeletePolicyRequestOrBuilder.java +++ b/java-iam/proto-google-iam-v2beta/src/main/java/com/google/iam/v2beta/DeletePolicyRequestOrBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,10 +14,13 @@ * limitations under the License. */ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: google/iam/v2beta/policy.proto +// Protobuf Java Version: 4.33.2 package com.google.iam.v2beta; +@com.google.protobuf.Generated public interface DeletePolicyRequestOrBuilder extends // @@protoc_insertion_point(interface_extends:google.iam.v2beta.DeletePolicyRequest) @@ -29,9 +32,12 @@ public interface DeletePolicyRequestOrBuilder *
            * Required. The resource name of the policy to delete. Format:
            * `policies/{attachment_point}/denypolicies/{policy_id}`
        +   *
        +   *
            * Use the URL-encoded full resource name, which means that the forward-slash
            * character, `/`, must be written as `%2F`. For example,
            * `policies/cloudresourcemanager.googleapis.com%2Fprojects%2Fmy-project/denypolicies/my-policy`.
        +   *
            * For organizations and folders, use the numeric ID in the full resource
            * name. For projects, you can use the alphanumeric or the numeric ID.
            * 
        @@ -41,15 +47,19 @@ public interface DeletePolicyRequestOrBuilder * @return The name. */ java.lang.String getName(); + /** * * *
            * Required. The resource name of the policy to delete. Format:
            * `policies/{attachment_point}/denypolicies/{policy_id}`
        +   *
        +   *
            * Use the URL-encoded full resource name, which means that the forward-slash
            * character, `/`, must be written as `%2F`. For example,
            * `policies/cloudresourcemanager.googleapis.com%2Fprojects%2Fmy-project/denypolicies/my-policy`.
        +   *
            * For organizations and folders, use the numeric ID in the full resource
            * name. For projects, you can use the alphanumeric or the numeric ID.
            * 
        @@ -67,6 +77,7 @@ public interface DeletePolicyRequestOrBuilder * Optional. The expected `etag` of the policy to delete. If the value does not match * the value that is stored in IAM, the request fails with a `409` error code * and `ABORTED` status. + * * If you omit this field, the policy is deleted regardless of its current * `etag`. *
        @@ -76,6 +87,7 @@ public interface DeletePolicyRequestOrBuilder * @return The etag. */ java.lang.String getEtag(); + /** * * @@ -83,6 +95,7 @@ public interface DeletePolicyRequestOrBuilder * Optional. The expected `etag` of the policy to delete. If the value does not match * the value that is stored in IAM, the request fails with a `409` error code * and `ABORTED` status. + * * If you omit this field, the policy is deleted regardless of its current * `etag`. *
        diff --git a/java-iam/proto-google-iam-v2beta/src/main/java/com/google/iam/v2beta/DenyRule.java b/java-iam/proto-google-iam-v2beta/src/main/java/com/google/iam/v2beta/DenyRule.java index b776f7b169..96f53586c2 100644 --- a/java-iam/proto-google-iam-v2beta/src/main/java/com/google/iam/v2beta/DenyRule.java +++ b/java-iam/proto-google-iam-v2beta/src/main/java/com/google/iam/v2beta/DenyRule.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,9 @@ * limitations under the License. */ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: google/iam/v2beta/deny.proto +// Protobuf Java Version: 4.33.2 package com.google.iam.v2beta; @@ -27,32 +29,33 @@ * * Protobuf type {@code google.iam.v2beta.DenyRule} */ -public final class DenyRule extends com.google.protobuf.GeneratedMessageV3 +@com.google.protobuf.Generated +public final class DenyRule extends com.google.protobuf.GeneratedMessage implements // @@protoc_insertion_point(message_implements:google.iam.v2beta.DenyRule) DenyRuleOrBuilder { private static final long serialVersionUID = 0L; - // Use DenyRule.newBuilder() to construct. - private DenyRule(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private DenyRule() { - deniedPrincipals_ = com.google.protobuf.LazyStringArrayList.EMPTY; - exceptionPrincipals_ = com.google.protobuf.LazyStringArrayList.EMPTY; - deniedPermissions_ = com.google.protobuf.LazyStringArrayList.EMPTY; - exceptionPermissions_ = com.google.protobuf.LazyStringArrayList.EMPTY; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "DenyRule"); } - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new DenyRule(); + // Use DenyRule.newBuilder() to construct. + private DenyRule(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); } - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; + private DenyRule() { + deniedPrincipals_ = com.google.protobuf.LazyStringArrayList.emptyList(); + exceptionPrincipals_ = com.google.protobuf.LazyStringArrayList.emptyList(); + deniedPermissions_ = com.google.protobuf.LazyStringArrayList.emptyList(); + exceptionPermissions_ = com.google.protobuf.LazyStringArrayList.emptyList(); } public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { @@ -61,7 +64,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.iam.v2beta.DenyRuleProto .internal_static_google_iam_v2beta_DenyRule_fieldAccessorTable @@ -69,44 +72,57 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { com.google.iam.v2beta.DenyRule.class, com.google.iam.v2beta.DenyRule.Builder.class); } + private int bitField0_; public static final int DENIED_PRINCIPALS_FIELD_NUMBER = 1; - private com.google.protobuf.LazyStringList deniedPrincipals_; + + @SuppressWarnings("serial") + private com.google.protobuf.LazyStringArrayList deniedPrincipals_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + /** * * *
            * The identities that are prevented from using one or more permissions on
            * Google Cloud resources. This field can contain the following values:
        +   *
            * * `principalSet://goog/public:all`: A special identifier that represents
        -   *   any principal that is on the internet, even if they do not have a Google
        -   *   Account or are not logged in.
        +   * any principal that is on the internet, even if they do not have a Google
        +   * Account or are not logged in.
        +   *
            * * `principal://goog/subject/{email_id}`: A specific Google Account.
        -   *   Includes Gmail, Cloud Identity, and Google Workspace user accounts. For
        -   *   example, `principal://goog/subject/alice@example.com`.
        +   * Includes Gmail, Cloud Identity, and Google Workspace user accounts. For
        +   * example, `principal://goog/subject/alice@example.com`.
        +   *
            * * `deleted:principal://goog/subject/{email_id}?uid={uid}`: A specific
        -   *   Google Account that was deleted recently. For example,
        -   *   `deleted:principal://goog/subject/alice@example.com?uid=1234567890`. If
        -   *   the Google Account is recovered, this identifier reverts to the standard
        -   *   identifier for a Google Account.
        +   * Google Account that was deleted recently. For example,
        +   * `deleted:principal://goog/subject/alice@example.com?uid=1234567890`. If
        +   * the Google Account is recovered, this identifier reverts to the standard
        +   * identifier for a Google Account.
        +   *
            * * `principalSet://goog/group/{group_id}`: A Google group. For example,
        -   *   `principalSet://goog/group/admins@example.com`.
        +   * `principalSet://goog/group/admins@example.com`.
        +   *
            * * `deleted:principalSet://goog/group/{group_id}?uid={uid}`: A Google group
        -   *   that was deleted recently. For example,
        -   *   `deleted:principalSet://goog/group/admins@example.com?uid=1234567890`. If
        -   *   the Google group is restored, this identifier reverts to the standard
        -   *   identifier for a Google group.
        +   * that was deleted recently. For example,
        +   * `deleted:principalSet://goog/group/admins@example.com?uid=1234567890`. If
        +   * the Google group is restored, this identifier reverts to the standard
        +   * identifier for a Google group.
        +   *
            * * `principal://iam.googleapis.com/projects/-/serviceAccounts/{service_account_id}`:
        -   *   A Google Cloud service account. For example,
        -   *   `principal://iam.googleapis.com/projects/-/serviceAccounts/my-service-account@iam.gserviceaccount.com`.
        +   * A Google Cloud service account. For example,
        +   * `principal://iam.googleapis.com/projects/-/serviceAccounts/my-service-account@iam.gserviceaccount.com`.
        +   *
            * * `deleted:principal://iam.googleapis.com/projects/-/serviceAccounts/{service_account_id}?uid={uid}`:
        -   *   A Google Cloud service account that was deleted recently. For example,
        -   *   `deleted:principal://iam.googleapis.com/projects/-/serviceAccounts/my-service-account@iam.gserviceaccount.com?uid=1234567890`.
        -   *   If the service account is undeleted, this identifier reverts to the
        -   *   standard identifier for a service account.
        +   * A Google Cloud service account that was deleted recently. For example,
        +   * `deleted:principal://iam.googleapis.com/projects/-/serviceAccounts/my-service-account@iam.gserviceaccount.com?uid=1234567890`.
        +   * If the service account is undeleted, this identifier reverts to the
        +   * standard identifier for a service account.
        +   *
            * * `principalSet://goog/cloudIdentityCustomerId/{customer_id}`: All of the
        -   *   principals associated with the specified Google Workspace or Cloud
        -   *   Identity customer ID. For example,
        -   *   `principalSet://goog/cloudIdentityCustomerId/C01Abc35`.
        +   * principals associated with the specified Google Workspace or Cloud
        +   * Identity customer ID. For example,
        +   * `principalSet://goog/cloudIdentityCustomerId/C01Abc35`.
            * 
        * * repeated string denied_principals = 1; @@ -116,42 +132,51 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { public com.google.protobuf.ProtocolStringList getDeniedPrincipalsList() { return deniedPrincipals_; } + /** * * *
            * The identities that are prevented from using one or more permissions on
            * Google Cloud resources. This field can contain the following values:
        +   *
            * * `principalSet://goog/public:all`: A special identifier that represents
        -   *   any principal that is on the internet, even if they do not have a Google
        -   *   Account or are not logged in.
        +   * any principal that is on the internet, even if they do not have a Google
        +   * Account or are not logged in.
        +   *
            * * `principal://goog/subject/{email_id}`: A specific Google Account.
        -   *   Includes Gmail, Cloud Identity, and Google Workspace user accounts. For
        -   *   example, `principal://goog/subject/alice@example.com`.
        +   * Includes Gmail, Cloud Identity, and Google Workspace user accounts. For
        +   * example, `principal://goog/subject/alice@example.com`.
        +   *
            * * `deleted:principal://goog/subject/{email_id}?uid={uid}`: A specific
        -   *   Google Account that was deleted recently. For example,
        -   *   `deleted:principal://goog/subject/alice@example.com?uid=1234567890`. If
        -   *   the Google Account is recovered, this identifier reverts to the standard
        -   *   identifier for a Google Account.
        +   * Google Account that was deleted recently. For example,
        +   * `deleted:principal://goog/subject/alice@example.com?uid=1234567890`. If
        +   * the Google Account is recovered, this identifier reverts to the standard
        +   * identifier for a Google Account.
        +   *
            * * `principalSet://goog/group/{group_id}`: A Google group. For example,
        -   *   `principalSet://goog/group/admins@example.com`.
        +   * `principalSet://goog/group/admins@example.com`.
        +   *
            * * `deleted:principalSet://goog/group/{group_id}?uid={uid}`: A Google group
        -   *   that was deleted recently. For example,
        -   *   `deleted:principalSet://goog/group/admins@example.com?uid=1234567890`. If
        -   *   the Google group is restored, this identifier reverts to the standard
        -   *   identifier for a Google group.
        +   * that was deleted recently. For example,
        +   * `deleted:principalSet://goog/group/admins@example.com?uid=1234567890`. If
        +   * the Google group is restored, this identifier reverts to the standard
        +   * identifier for a Google group.
        +   *
            * * `principal://iam.googleapis.com/projects/-/serviceAccounts/{service_account_id}`:
        -   *   A Google Cloud service account. For example,
        -   *   `principal://iam.googleapis.com/projects/-/serviceAccounts/my-service-account@iam.gserviceaccount.com`.
        +   * A Google Cloud service account. For example,
        +   * `principal://iam.googleapis.com/projects/-/serviceAccounts/my-service-account@iam.gserviceaccount.com`.
        +   *
            * * `deleted:principal://iam.googleapis.com/projects/-/serviceAccounts/{service_account_id}?uid={uid}`:
        -   *   A Google Cloud service account that was deleted recently. For example,
        -   *   `deleted:principal://iam.googleapis.com/projects/-/serviceAccounts/my-service-account@iam.gserviceaccount.com?uid=1234567890`.
        -   *   If the service account is undeleted, this identifier reverts to the
        -   *   standard identifier for a service account.
        +   * A Google Cloud service account that was deleted recently. For example,
        +   * `deleted:principal://iam.googleapis.com/projects/-/serviceAccounts/my-service-account@iam.gserviceaccount.com?uid=1234567890`.
        +   * If the service account is undeleted, this identifier reverts to the
        +   * standard identifier for a service account.
        +   *
            * * `principalSet://goog/cloudIdentityCustomerId/{customer_id}`: All of the
        -   *   principals associated with the specified Google Workspace or Cloud
        -   *   Identity customer ID. For example,
        -   *   `principalSet://goog/cloudIdentityCustomerId/C01Abc35`.
        +   * principals associated with the specified Google Workspace or Cloud
        +   * Identity customer ID. For example,
        +   * `principalSet://goog/cloudIdentityCustomerId/C01Abc35`.
            * 
        * * repeated string denied_principals = 1; @@ -161,42 +186,51 @@ public com.google.protobuf.ProtocolStringList getDeniedPrincipalsList() { public int getDeniedPrincipalsCount() { return deniedPrincipals_.size(); } + /** * * *
            * The identities that are prevented from using one or more permissions on
            * Google Cloud resources. This field can contain the following values:
        +   *
            * * `principalSet://goog/public:all`: A special identifier that represents
        -   *   any principal that is on the internet, even if they do not have a Google
        -   *   Account or are not logged in.
        +   * any principal that is on the internet, even if they do not have a Google
        +   * Account or are not logged in.
        +   *
            * * `principal://goog/subject/{email_id}`: A specific Google Account.
        -   *   Includes Gmail, Cloud Identity, and Google Workspace user accounts. For
        -   *   example, `principal://goog/subject/alice@example.com`.
        +   * Includes Gmail, Cloud Identity, and Google Workspace user accounts. For
        +   * example, `principal://goog/subject/alice@example.com`.
        +   *
            * * `deleted:principal://goog/subject/{email_id}?uid={uid}`: A specific
        -   *   Google Account that was deleted recently. For example,
        -   *   `deleted:principal://goog/subject/alice@example.com?uid=1234567890`. If
        -   *   the Google Account is recovered, this identifier reverts to the standard
        -   *   identifier for a Google Account.
        +   * Google Account that was deleted recently. For example,
        +   * `deleted:principal://goog/subject/alice@example.com?uid=1234567890`. If
        +   * the Google Account is recovered, this identifier reverts to the standard
        +   * identifier for a Google Account.
        +   *
            * * `principalSet://goog/group/{group_id}`: A Google group. For example,
        -   *   `principalSet://goog/group/admins@example.com`.
        +   * `principalSet://goog/group/admins@example.com`.
        +   *
            * * `deleted:principalSet://goog/group/{group_id}?uid={uid}`: A Google group
        -   *   that was deleted recently. For example,
        -   *   `deleted:principalSet://goog/group/admins@example.com?uid=1234567890`. If
        -   *   the Google group is restored, this identifier reverts to the standard
        -   *   identifier for a Google group.
        +   * that was deleted recently. For example,
        +   * `deleted:principalSet://goog/group/admins@example.com?uid=1234567890`. If
        +   * the Google group is restored, this identifier reverts to the standard
        +   * identifier for a Google group.
        +   *
            * * `principal://iam.googleapis.com/projects/-/serviceAccounts/{service_account_id}`:
        -   *   A Google Cloud service account. For example,
        -   *   `principal://iam.googleapis.com/projects/-/serviceAccounts/my-service-account@iam.gserviceaccount.com`.
        +   * A Google Cloud service account. For example,
        +   * `principal://iam.googleapis.com/projects/-/serviceAccounts/my-service-account@iam.gserviceaccount.com`.
        +   *
            * * `deleted:principal://iam.googleapis.com/projects/-/serviceAccounts/{service_account_id}?uid={uid}`:
        -   *   A Google Cloud service account that was deleted recently. For example,
        -   *   `deleted:principal://iam.googleapis.com/projects/-/serviceAccounts/my-service-account@iam.gserviceaccount.com?uid=1234567890`.
        -   *   If the service account is undeleted, this identifier reverts to the
        -   *   standard identifier for a service account.
        +   * A Google Cloud service account that was deleted recently. For example,
        +   * `deleted:principal://iam.googleapis.com/projects/-/serviceAccounts/my-service-account@iam.gserviceaccount.com?uid=1234567890`.
        +   * If the service account is undeleted, this identifier reverts to the
        +   * standard identifier for a service account.
        +   *
            * * `principalSet://goog/cloudIdentityCustomerId/{customer_id}`: All of the
        -   *   principals associated with the specified Google Workspace or Cloud
        -   *   Identity customer ID. For example,
        -   *   `principalSet://goog/cloudIdentityCustomerId/C01Abc35`.
        +   * principals associated with the specified Google Workspace or Cloud
        +   * Identity customer ID. For example,
        +   * `principalSet://goog/cloudIdentityCustomerId/C01Abc35`.
            * 
        * * repeated string denied_principals = 1; @@ -207,42 +241,51 @@ public int getDeniedPrincipalsCount() { public java.lang.String getDeniedPrincipals(int index) { return deniedPrincipals_.get(index); } + /** * * *
            * The identities that are prevented from using one or more permissions on
            * Google Cloud resources. This field can contain the following values:
        +   *
            * * `principalSet://goog/public:all`: A special identifier that represents
        -   *   any principal that is on the internet, even if they do not have a Google
        -   *   Account or are not logged in.
        +   * any principal that is on the internet, even if they do not have a Google
        +   * Account or are not logged in.
        +   *
            * * `principal://goog/subject/{email_id}`: A specific Google Account.
        -   *   Includes Gmail, Cloud Identity, and Google Workspace user accounts. For
        -   *   example, `principal://goog/subject/alice@example.com`.
        +   * Includes Gmail, Cloud Identity, and Google Workspace user accounts. For
        +   * example, `principal://goog/subject/alice@example.com`.
        +   *
            * * `deleted:principal://goog/subject/{email_id}?uid={uid}`: A specific
        -   *   Google Account that was deleted recently. For example,
        -   *   `deleted:principal://goog/subject/alice@example.com?uid=1234567890`. If
        -   *   the Google Account is recovered, this identifier reverts to the standard
        -   *   identifier for a Google Account.
        +   * Google Account that was deleted recently. For example,
        +   * `deleted:principal://goog/subject/alice@example.com?uid=1234567890`. If
        +   * the Google Account is recovered, this identifier reverts to the standard
        +   * identifier for a Google Account.
        +   *
            * * `principalSet://goog/group/{group_id}`: A Google group. For example,
        -   *   `principalSet://goog/group/admins@example.com`.
        +   * `principalSet://goog/group/admins@example.com`.
        +   *
            * * `deleted:principalSet://goog/group/{group_id}?uid={uid}`: A Google group
        -   *   that was deleted recently. For example,
        -   *   `deleted:principalSet://goog/group/admins@example.com?uid=1234567890`. If
        -   *   the Google group is restored, this identifier reverts to the standard
        -   *   identifier for a Google group.
        +   * that was deleted recently. For example,
        +   * `deleted:principalSet://goog/group/admins@example.com?uid=1234567890`. If
        +   * the Google group is restored, this identifier reverts to the standard
        +   * identifier for a Google group.
        +   *
            * * `principal://iam.googleapis.com/projects/-/serviceAccounts/{service_account_id}`:
        -   *   A Google Cloud service account. For example,
        -   *   `principal://iam.googleapis.com/projects/-/serviceAccounts/my-service-account@iam.gserviceaccount.com`.
        +   * A Google Cloud service account. For example,
        +   * `principal://iam.googleapis.com/projects/-/serviceAccounts/my-service-account@iam.gserviceaccount.com`.
        +   *
            * * `deleted:principal://iam.googleapis.com/projects/-/serviceAccounts/{service_account_id}?uid={uid}`:
        -   *   A Google Cloud service account that was deleted recently. For example,
        -   *   `deleted:principal://iam.googleapis.com/projects/-/serviceAccounts/my-service-account@iam.gserviceaccount.com?uid=1234567890`.
        -   *   If the service account is undeleted, this identifier reverts to the
        -   *   standard identifier for a service account.
        +   * A Google Cloud service account that was deleted recently. For example,
        +   * `deleted:principal://iam.googleapis.com/projects/-/serviceAccounts/my-service-account@iam.gserviceaccount.com?uid=1234567890`.
        +   * If the service account is undeleted, this identifier reverts to the
        +   * standard identifier for a service account.
        +   *
            * * `principalSet://goog/cloudIdentityCustomerId/{customer_id}`: All of the
        -   *   principals associated with the specified Google Workspace or Cloud
        -   *   Identity customer ID. For example,
        -   *   `principalSet://goog/cloudIdentityCustomerId/C01Abc35`.
        +   * principals associated with the specified Google Workspace or Cloud
        +   * Identity customer ID. For example,
        +   * `principalSet://goog/cloudIdentityCustomerId/C01Abc35`.
            * 
        * * repeated string denied_principals = 1; @@ -255,7 +298,11 @@ public com.google.protobuf.ByteString getDeniedPrincipalsBytes(int index) { } public static final int EXCEPTION_PRINCIPALS_FIELD_NUMBER = 2; - private com.google.protobuf.LazyStringList exceptionPrincipals_; + + @SuppressWarnings("serial") + private com.google.protobuf.LazyStringArrayList exceptionPrincipals_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + /** * * @@ -264,6 +311,7 @@ public com.google.protobuf.ByteString getDeniedPrincipalsBytes(int index) { * listed in the `denied_principals`. For example, you could add a Google * group to the `denied_principals`, then exclude specific users who belong to * that group. + * * This field can contain the same values as the `denied_principals` field, * excluding `principalSet://goog/public:all`, which represents all users on * the internet. @@ -276,6 +324,7 @@ public com.google.protobuf.ByteString getDeniedPrincipalsBytes(int index) { public com.google.protobuf.ProtocolStringList getExceptionPrincipalsList() { return exceptionPrincipals_; } + /** * * @@ -284,6 +333,7 @@ public com.google.protobuf.ProtocolStringList getExceptionPrincipalsList() { * listed in the `denied_principals`. For example, you could add a Google * group to the `denied_principals`, then exclude specific users who belong to * that group. + * * This field can contain the same values as the `denied_principals` field, * excluding `principalSet://goog/public:all`, which represents all users on * the internet. @@ -296,6 +346,7 @@ public com.google.protobuf.ProtocolStringList getExceptionPrincipalsList() { public int getExceptionPrincipalsCount() { return exceptionPrincipals_.size(); } + /** * * @@ -304,6 +355,7 @@ public int getExceptionPrincipalsCount() { * listed in the `denied_principals`. For example, you could add a Google * group to the `denied_principals`, then exclude specific users who belong to * that group. + * * This field can contain the same values as the `denied_principals` field, * excluding `principalSet://goog/public:all`, which represents all users on * the internet. @@ -317,6 +369,7 @@ public int getExceptionPrincipalsCount() { public java.lang.String getExceptionPrincipals(int index) { return exceptionPrincipals_.get(index); } + /** * * @@ -325,6 +378,7 @@ public java.lang.String getExceptionPrincipals(int index) { * listed in the `denied_principals`. For example, you could add a Google * group to the `denied_principals`, then exclude specific users who belong to * that group. + * * This field can contain the same values as the `denied_principals` field, * excluding `principalSet://goog/public:all`, which represents all users on * the internet. @@ -340,7 +394,11 @@ public com.google.protobuf.ByteString getExceptionPrincipalsBytes(int index) { } public static final int DENIED_PERMISSIONS_FIELD_NUMBER = 3; - private com.google.protobuf.LazyStringList deniedPermissions_; + + @SuppressWarnings("serial") + private com.google.protobuf.LazyStringArrayList deniedPermissions_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + /** * * @@ -358,6 +416,7 @@ public com.google.protobuf.ByteString getExceptionPrincipalsBytes(int index) { public com.google.protobuf.ProtocolStringList getDeniedPermissionsList() { return deniedPermissions_; } + /** * * @@ -375,6 +434,7 @@ public com.google.protobuf.ProtocolStringList getDeniedPermissionsList() { public int getDeniedPermissionsCount() { return deniedPermissions_.size(); } + /** * * @@ -393,6 +453,7 @@ public int getDeniedPermissionsCount() { public java.lang.String getDeniedPermissions(int index) { return deniedPermissions_.get(index); } + /** * * @@ -413,7 +474,11 @@ public com.google.protobuf.ByteString getDeniedPermissionsBytes(int index) { } public static final int EXCEPTION_PERMISSIONS_FIELD_NUMBER = 4; - private com.google.protobuf.LazyStringList exceptionPermissions_; + + @SuppressWarnings("serial") + private com.google.protobuf.LazyStringArrayList exceptionPermissions_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + /** * * @@ -422,6 +487,7 @@ public com.google.protobuf.ByteString getDeniedPermissionsBytes(int index) { * permissions given by `denied_permissions`. If a permission appears in * `denied_permissions` _and_ in `exception_permissions` then it will _not_ be * denied. + * * The excluded permissions can be specified using the same syntax as * `denied_permissions`. *
        @@ -433,6 +499,7 @@ public com.google.protobuf.ByteString getDeniedPermissionsBytes(int index) { public com.google.protobuf.ProtocolStringList getExceptionPermissionsList() { return exceptionPermissions_; } + /** * * @@ -441,6 +508,7 @@ public com.google.protobuf.ProtocolStringList getExceptionPermissionsList() { * permissions given by `denied_permissions`. If a permission appears in * `denied_permissions` _and_ in `exception_permissions` then it will _not_ be * denied. + * * The excluded permissions can be specified using the same syntax as * `denied_permissions`. *
        @@ -452,6 +520,7 @@ public com.google.protobuf.ProtocolStringList getExceptionPermissionsList() { public int getExceptionPermissionsCount() { return exceptionPermissions_.size(); } + /** * * @@ -460,6 +529,7 @@ public int getExceptionPermissionsCount() { * permissions given by `denied_permissions`. If a permission appears in * `denied_permissions` _and_ in `exception_permissions` then it will _not_ be * denied. + * * The excluded permissions can be specified using the same syntax as * `denied_permissions`. *
        @@ -472,6 +542,7 @@ public int getExceptionPermissionsCount() { public java.lang.String getExceptionPermissions(int index) { return exceptionPermissions_.get(index); } + /** * * @@ -480,6 +551,7 @@ public java.lang.String getExceptionPermissions(int index) { * permissions given by `denied_permissions`. If a permission appears in * `denied_permissions` _and_ in `exception_permissions` then it will _not_ be * denied. + * * The excluded permissions can be specified using the same syntax as * `denied_permissions`. *
        @@ -495,6 +567,7 @@ public com.google.protobuf.ByteString getExceptionPermissionsBytes(int index) { public static final int DENIAL_CONDITION_FIELD_NUMBER = 5; private com.google.type.Expr denialCondition_; + /** * * @@ -502,8 +575,10 @@ public com.google.protobuf.ByteString getExceptionPermissionsBytes(int index) { * The condition that determines whether this deny rule applies to a request. * If the condition expression evaluates to `true`, then the deny rule is * applied; otherwise, the deny rule is not applied. + * * Each deny rule is evaluated independently. If this deny rule does not apply * to a request, other deny rules might still apply. + * * The condition can use CEL functions that evaluate * [resource * tags](https://cloud.google.com/iam/help/conditions/resource-tags). Other @@ -516,8 +591,9 @@ public com.google.protobuf.ByteString getExceptionPermissionsBytes(int index) { */ @java.lang.Override public boolean hasDenialCondition() { - return denialCondition_ != null; + return ((bitField0_ & 0x00000001) != 0); } + /** * * @@ -525,8 +601,10 @@ public boolean hasDenialCondition() { * The condition that determines whether this deny rule applies to a request. * If the condition expression evaluates to `true`, then the deny rule is * applied; otherwise, the deny rule is not applied. + * * Each deny rule is evaluated independently. If this deny rule does not apply * to a request, other deny rules might still apply. + * * The condition can use CEL functions that evaluate * [resource * tags](https://cloud.google.com/iam/help/conditions/resource-tags). Other @@ -541,6 +619,7 @@ public boolean hasDenialCondition() { public com.google.type.Expr getDenialCondition() { return denialCondition_ == null ? com.google.type.Expr.getDefaultInstance() : denialCondition_; } + /** * * @@ -548,8 +627,10 @@ public com.google.type.Expr getDenialCondition() { * The condition that determines whether this deny rule applies to a request. * If the condition expression evaluates to `true`, then the deny rule is * applied; otherwise, the deny rule is not applied. + * * Each deny rule is evaluated independently. If this deny rule does not apply * to a request, other deny rules might still apply. + * * The condition can use CEL functions that evaluate * [resource * tags](https://cloud.google.com/iam/help/conditions/resource-tags). Other @@ -560,7 +641,7 @@ public com.google.type.Expr getDenialCondition() { */ @java.lang.Override public com.google.type.ExprOrBuilder getDenialConditionOrBuilder() { - return getDenialCondition(); + return denialCondition_ == null ? com.google.type.Expr.getDefaultInstance() : denialCondition_; } private byte memoizedIsInitialized = -1; @@ -578,19 +659,18 @@ public final boolean isInitialized() { @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { for (int i = 0; i < deniedPrincipals_.size(); i++) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, deniedPrincipals_.getRaw(i)); + com.google.protobuf.GeneratedMessage.writeString(output, 1, deniedPrincipals_.getRaw(i)); } for (int i = 0; i < exceptionPrincipals_.size(); i++) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 2, exceptionPrincipals_.getRaw(i)); + com.google.protobuf.GeneratedMessage.writeString(output, 2, exceptionPrincipals_.getRaw(i)); } for (int i = 0; i < deniedPermissions_.size(); i++) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 3, deniedPermissions_.getRaw(i)); + com.google.protobuf.GeneratedMessage.writeString(output, 3, deniedPermissions_.getRaw(i)); } for (int i = 0; i < exceptionPermissions_.size(); i++) { - com.google.protobuf.GeneratedMessageV3.writeString( - output, 4, exceptionPermissions_.getRaw(i)); + com.google.protobuf.GeneratedMessage.writeString(output, 4, exceptionPermissions_.getRaw(i)); } - if (denialCondition_ != null) { + if (((bitField0_ & 0x00000001) != 0)) { output.writeMessage(5, getDenialCondition()); } getUnknownFields().writeTo(output); @@ -634,7 +714,7 @@ public int getSerializedSize() { size += dataSize; size += 1 * getExceptionPermissionsList().size(); } - if (denialCondition_ != null) { + if (((bitField0_ & 0x00000001) != 0)) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(5, getDenialCondition()); } size += getUnknownFields().getSerializedSize(); @@ -732,38 +812,38 @@ public static com.google.iam.v2beta.DenyRule parseFrom( public static com.google.iam.v2beta.DenyRule parseFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); } public static com.google.iam.v2beta.DenyRule parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } public static com.google.iam.v2beta.DenyRule parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); } public static com.google.iam.v2beta.DenyRule parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( PARSER, input, extensionRegistry); } public static com.google.iam.v2beta.DenyRule parseFrom(com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); } public static com.google.iam.v2beta.DenyRule parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } @@ -786,10 +866,11 @@ public Builder toBuilder() { } @java.lang.Override - protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { Builder builder = new Builder(parent); return builder; } + /** * * @@ -799,7 +880,7 @@ protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.Build * * Protobuf type {@code google.iam.v2beta.DenyRule} */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder implements // @@protoc_insertion_point(builder_implements:google.iam.v2beta.DenyRule) com.google.iam.v2beta.DenyRuleOrBuilder { @@ -809,7 +890,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.iam.v2beta.DenyRuleProto .internal_static_google_iam_v2beta_DenyRule_fieldAccessorTable @@ -818,27 +899,32 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } // Construct using com.google.iam.v2beta.DenyRule.newBuilder() - private Builder() {} + private Builder() { + maybeForceBuilderInitialization(); + } - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetDenialConditionFieldBuilder(); + } } @java.lang.Override public Builder clear() { super.clear(); - deniedPrincipals_ = com.google.protobuf.LazyStringArrayList.EMPTY; - bitField0_ = (bitField0_ & ~0x00000001); - exceptionPrincipals_ = com.google.protobuf.LazyStringArrayList.EMPTY; - bitField0_ = (bitField0_ & ~0x00000002); - deniedPermissions_ = com.google.protobuf.LazyStringArrayList.EMPTY; - bitField0_ = (bitField0_ & ~0x00000004); - exceptionPermissions_ = com.google.protobuf.LazyStringArrayList.EMPTY; - bitField0_ = (bitField0_ & ~0x00000008); - if (denialConditionBuilder_ == null) { - denialCondition_ = null; - } else { - denialCondition_ = null; + bitField0_ = 0; + deniedPrincipals_ = com.google.protobuf.LazyStringArrayList.emptyList(); + exceptionPrincipals_ = com.google.protobuf.LazyStringArrayList.emptyList(); + deniedPermissions_ = com.google.protobuf.LazyStringArrayList.emptyList(); + exceptionPermissions_ = com.google.protobuf.LazyStringArrayList.emptyList(); + denialCondition_ = null; + if (denialConditionBuilder_ != null) { + denialConditionBuilder_.dispose(); denialConditionBuilder_ = null; } return this; @@ -867,67 +953,38 @@ public com.google.iam.v2beta.DenyRule build() { @java.lang.Override public com.google.iam.v2beta.DenyRule buildPartial() { com.google.iam.v2beta.DenyRule result = new com.google.iam.v2beta.DenyRule(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.iam.v2beta.DenyRule result) { int from_bitField0_ = bitField0_; - if (((bitField0_ & 0x00000001) != 0)) { - deniedPrincipals_ = deniedPrincipals_.getUnmodifiableView(); - bitField0_ = (bitField0_ & ~0x00000001); + if (((from_bitField0_ & 0x00000001) != 0)) { + deniedPrincipals_.makeImmutable(); + result.deniedPrincipals_ = deniedPrincipals_; } - result.deniedPrincipals_ = deniedPrincipals_; - if (((bitField0_ & 0x00000002) != 0)) { - exceptionPrincipals_ = exceptionPrincipals_.getUnmodifiableView(); - bitField0_ = (bitField0_ & ~0x00000002); + if (((from_bitField0_ & 0x00000002) != 0)) { + exceptionPrincipals_.makeImmutable(); + result.exceptionPrincipals_ = exceptionPrincipals_; } - result.exceptionPrincipals_ = exceptionPrincipals_; - if (((bitField0_ & 0x00000004) != 0)) { - deniedPermissions_ = deniedPermissions_.getUnmodifiableView(); - bitField0_ = (bitField0_ & ~0x00000004); + if (((from_bitField0_ & 0x00000004) != 0)) { + deniedPermissions_.makeImmutable(); + result.deniedPermissions_ = deniedPermissions_; } - result.deniedPermissions_ = deniedPermissions_; - if (((bitField0_ & 0x00000008) != 0)) { - exceptionPermissions_ = exceptionPermissions_.getUnmodifiableView(); - bitField0_ = (bitField0_ & ~0x00000008); + if (((from_bitField0_ & 0x00000008) != 0)) { + exceptionPermissions_.makeImmutable(); + result.exceptionPermissions_ = exceptionPermissions_; } - result.exceptionPermissions_ = exceptionPermissions_; - if (denialConditionBuilder_ == null) { - result.denialCondition_ = denialCondition_; - } else { - result.denialCondition_ = denialConditionBuilder_.build(); + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000010) != 0)) { + result.denialCondition_ = + denialConditionBuilder_ == null ? denialCondition_ : denialConditionBuilder_.build(); + to_bitField0_ |= 0x00000001; } - 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); + result.bitField0_ |= to_bitField0_; } @java.lang.Override @@ -945,7 +1002,7 @@ public Builder mergeFrom(com.google.iam.v2beta.DenyRule other) { if (!other.deniedPrincipals_.isEmpty()) { if (deniedPrincipals_.isEmpty()) { deniedPrincipals_ = other.deniedPrincipals_; - bitField0_ = (bitField0_ & ~0x00000001); + bitField0_ |= 0x00000001; } else { ensureDeniedPrincipalsIsMutable(); deniedPrincipals_.addAll(other.deniedPrincipals_); @@ -955,7 +1012,7 @@ public Builder mergeFrom(com.google.iam.v2beta.DenyRule other) { if (!other.exceptionPrincipals_.isEmpty()) { if (exceptionPrincipals_.isEmpty()) { exceptionPrincipals_ = other.exceptionPrincipals_; - bitField0_ = (bitField0_ & ~0x00000002); + bitField0_ |= 0x00000002; } else { ensureExceptionPrincipalsIsMutable(); exceptionPrincipals_.addAll(other.exceptionPrincipals_); @@ -965,7 +1022,7 @@ public Builder mergeFrom(com.google.iam.v2beta.DenyRule other) { if (!other.deniedPermissions_.isEmpty()) { if (deniedPermissions_.isEmpty()) { deniedPermissions_ = other.deniedPermissions_; - bitField0_ = (bitField0_ & ~0x00000004); + bitField0_ |= 0x00000004; } else { ensureDeniedPermissionsIsMutable(); deniedPermissions_.addAll(other.deniedPermissions_); @@ -975,7 +1032,7 @@ public Builder mergeFrom(com.google.iam.v2beta.DenyRule other) { if (!other.exceptionPermissions_.isEmpty()) { if (exceptionPermissions_.isEmpty()) { exceptionPermissions_ = other.exceptionPermissions_; - bitField0_ = (bitField0_ & ~0x00000008); + bitField0_ |= 0x00000008; } else { ensureExceptionPermissionsIsMutable(); exceptionPermissions_.addAll(other.exceptionPermissions_); @@ -1041,8 +1098,9 @@ public Builder mergeFrom( } // case 34 case 42: { - input.readMessage(getDenialConditionFieldBuilder().getBuilder(), extensionRegistry); - + input.readMessage( + internalGetDenialConditionFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000010; break; } // case 42 default: @@ -1064,51 +1122,60 @@ public Builder mergeFrom( private int bitField0_; - private com.google.protobuf.LazyStringList deniedPrincipals_ = - com.google.protobuf.LazyStringArrayList.EMPTY; + private com.google.protobuf.LazyStringArrayList deniedPrincipals_ = + com.google.protobuf.LazyStringArrayList.emptyList(); private void ensureDeniedPrincipalsIsMutable() { - if (!((bitField0_ & 0x00000001) != 0)) { + if (!deniedPrincipals_.isModifiable()) { deniedPrincipals_ = new com.google.protobuf.LazyStringArrayList(deniedPrincipals_); - bitField0_ |= 0x00000001; } + bitField0_ |= 0x00000001; } + /** * * *
              * The identities that are prevented from using one or more permissions on
              * Google Cloud resources. This field can contain the following values:
        +     *
              * * `principalSet://goog/public:all`: A special identifier that represents
        -     *   any principal that is on the internet, even if they do not have a Google
        -     *   Account or are not logged in.
        +     * any principal that is on the internet, even if they do not have a Google
        +     * Account or are not logged in.
        +     *
              * * `principal://goog/subject/{email_id}`: A specific Google Account.
        -     *   Includes Gmail, Cloud Identity, and Google Workspace user accounts. For
        -     *   example, `principal://goog/subject/alice@example.com`.
        +     * Includes Gmail, Cloud Identity, and Google Workspace user accounts. For
        +     * example, `principal://goog/subject/alice@example.com`.
        +     *
              * * `deleted:principal://goog/subject/{email_id}?uid={uid}`: A specific
        -     *   Google Account that was deleted recently. For example,
        -     *   `deleted:principal://goog/subject/alice@example.com?uid=1234567890`. If
        -     *   the Google Account is recovered, this identifier reverts to the standard
        -     *   identifier for a Google Account.
        +     * Google Account that was deleted recently. For example,
        +     * `deleted:principal://goog/subject/alice@example.com?uid=1234567890`. If
        +     * the Google Account is recovered, this identifier reverts to the standard
        +     * identifier for a Google Account.
        +     *
              * * `principalSet://goog/group/{group_id}`: A Google group. For example,
        -     *   `principalSet://goog/group/admins@example.com`.
        +     * `principalSet://goog/group/admins@example.com`.
        +     *
              * * `deleted:principalSet://goog/group/{group_id}?uid={uid}`: A Google group
        -     *   that was deleted recently. For example,
        -     *   `deleted:principalSet://goog/group/admins@example.com?uid=1234567890`. If
        -     *   the Google group is restored, this identifier reverts to the standard
        -     *   identifier for a Google group.
        +     * that was deleted recently. For example,
        +     * `deleted:principalSet://goog/group/admins@example.com?uid=1234567890`. If
        +     * the Google group is restored, this identifier reverts to the standard
        +     * identifier for a Google group.
        +     *
              * * `principal://iam.googleapis.com/projects/-/serviceAccounts/{service_account_id}`:
        -     *   A Google Cloud service account. For example,
        -     *   `principal://iam.googleapis.com/projects/-/serviceAccounts/my-service-account@iam.gserviceaccount.com`.
        +     * A Google Cloud service account. For example,
        +     * `principal://iam.googleapis.com/projects/-/serviceAccounts/my-service-account@iam.gserviceaccount.com`.
        +     *
              * * `deleted:principal://iam.googleapis.com/projects/-/serviceAccounts/{service_account_id}?uid={uid}`:
        -     *   A Google Cloud service account that was deleted recently. For example,
        -     *   `deleted:principal://iam.googleapis.com/projects/-/serviceAccounts/my-service-account@iam.gserviceaccount.com?uid=1234567890`.
        -     *   If the service account is undeleted, this identifier reverts to the
        -     *   standard identifier for a service account.
        +     * A Google Cloud service account that was deleted recently. For example,
        +     * `deleted:principal://iam.googleapis.com/projects/-/serviceAccounts/my-service-account@iam.gserviceaccount.com?uid=1234567890`.
        +     * If the service account is undeleted, this identifier reverts to the
        +     * standard identifier for a service account.
        +     *
              * * `principalSet://goog/cloudIdentityCustomerId/{customer_id}`: All of the
        -     *   principals associated with the specified Google Workspace or Cloud
        -     *   Identity customer ID. For example,
        -     *   `principalSet://goog/cloudIdentityCustomerId/C01Abc35`.
        +     * principals associated with the specified Google Workspace or Cloud
        +     * Identity customer ID. For example,
        +     * `principalSet://goog/cloudIdentityCustomerId/C01Abc35`.
              * 
        * * repeated string denied_principals = 1; @@ -1116,44 +1183,54 @@ private void ensureDeniedPrincipalsIsMutable() { * @return A list containing the deniedPrincipals. */ public com.google.protobuf.ProtocolStringList getDeniedPrincipalsList() { - return deniedPrincipals_.getUnmodifiableView(); + deniedPrincipals_.makeImmutable(); + return deniedPrincipals_; } + /** * * *
              * The identities that are prevented from using one or more permissions on
              * Google Cloud resources. This field can contain the following values:
        +     *
              * * `principalSet://goog/public:all`: A special identifier that represents
        -     *   any principal that is on the internet, even if they do not have a Google
        -     *   Account or are not logged in.
        +     * any principal that is on the internet, even if they do not have a Google
        +     * Account or are not logged in.
        +     *
              * * `principal://goog/subject/{email_id}`: A specific Google Account.
        -     *   Includes Gmail, Cloud Identity, and Google Workspace user accounts. For
        -     *   example, `principal://goog/subject/alice@example.com`.
        +     * Includes Gmail, Cloud Identity, and Google Workspace user accounts. For
        +     * example, `principal://goog/subject/alice@example.com`.
        +     *
              * * `deleted:principal://goog/subject/{email_id}?uid={uid}`: A specific
        -     *   Google Account that was deleted recently. For example,
        -     *   `deleted:principal://goog/subject/alice@example.com?uid=1234567890`. If
        -     *   the Google Account is recovered, this identifier reverts to the standard
        -     *   identifier for a Google Account.
        +     * Google Account that was deleted recently. For example,
        +     * `deleted:principal://goog/subject/alice@example.com?uid=1234567890`. If
        +     * the Google Account is recovered, this identifier reverts to the standard
        +     * identifier for a Google Account.
        +     *
              * * `principalSet://goog/group/{group_id}`: A Google group. For example,
        -     *   `principalSet://goog/group/admins@example.com`.
        +     * `principalSet://goog/group/admins@example.com`.
        +     *
              * * `deleted:principalSet://goog/group/{group_id}?uid={uid}`: A Google group
        -     *   that was deleted recently. For example,
        -     *   `deleted:principalSet://goog/group/admins@example.com?uid=1234567890`. If
        -     *   the Google group is restored, this identifier reverts to the standard
        -     *   identifier for a Google group.
        +     * that was deleted recently. For example,
        +     * `deleted:principalSet://goog/group/admins@example.com?uid=1234567890`. If
        +     * the Google group is restored, this identifier reverts to the standard
        +     * identifier for a Google group.
        +     *
              * * `principal://iam.googleapis.com/projects/-/serviceAccounts/{service_account_id}`:
        -     *   A Google Cloud service account. For example,
        -     *   `principal://iam.googleapis.com/projects/-/serviceAccounts/my-service-account@iam.gserviceaccount.com`.
        +     * A Google Cloud service account. For example,
        +     * `principal://iam.googleapis.com/projects/-/serviceAccounts/my-service-account@iam.gserviceaccount.com`.
        +     *
              * * `deleted:principal://iam.googleapis.com/projects/-/serviceAccounts/{service_account_id}?uid={uid}`:
        -     *   A Google Cloud service account that was deleted recently. For example,
        -     *   `deleted:principal://iam.googleapis.com/projects/-/serviceAccounts/my-service-account@iam.gserviceaccount.com?uid=1234567890`.
        -     *   If the service account is undeleted, this identifier reverts to the
        -     *   standard identifier for a service account.
        +     * A Google Cloud service account that was deleted recently. For example,
        +     * `deleted:principal://iam.googleapis.com/projects/-/serviceAccounts/my-service-account@iam.gserviceaccount.com?uid=1234567890`.
        +     * If the service account is undeleted, this identifier reverts to the
        +     * standard identifier for a service account.
        +     *
              * * `principalSet://goog/cloudIdentityCustomerId/{customer_id}`: All of the
        -     *   principals associated with the specified Google Workspace or Cloud
        -     *   Identity customer ID. For example,
        -     *   `principalSet://goog/cloudIdentityCustomerId/C01Abc35`.
        +     * principals associated with the specified Google Workspace or Cloud
        +     * Identity customer ID. For example,
        +     * `principalSet://goog/cloudIdentityCustomerId/C01Abc35`.
              * 
        * * repeated string denied_principals = 1; @@ -1163,42 +1240,51 @@ public com.google.protobuf.ProtocolStringList getDeniedPrincipalsList() { public int getDeniedPrincipalsCount() { return deniedPrincipals_.size(); } + /** * * *
              * The identities that are prevented from using one or more permissions on
              * Google Cloud resources. This field can contain the following values:
        +     *
              * * `principalSet://goog/public:all`: A special identifier that represents
        -     *   any principal that is on the internet, even if they do not have a Google
        -     *   Account or are not logged in.
        +     * any principal that is on the internet, even if they do not have a Google
        +     * Account or are not logged in.
        +     *
              * * `principal://goog/subject/{email_id}`: A specific Google Account.
        -     *   Includes Gmail, Cloud Identity, and Google Workspace user accounts. For
        -     *   example, `principal://goog/subject/alice@example.com`.
        +     * Includes Gmail, Cloud Identity, and Google Workspace user accounts. For
        +     * example, `principal://goog/subject/alice@example.com`.
        +     *
              * * `deleted:principal://goog/subject/{email_id}?uid={uid}`: A specific
        -     *   Google Account that was deleted recently. For example,
        -     *   `deleted:principal://goog/subject/alice@example.com?uid=1234567890`. If
        -     *   the Google Account is recovered, this identifier reverts to the standard
        -     *   identifier for a Google Account.
        +     * Google Account that was deleted recently. For example,
        +     * `deleted:principal://goog/subject/alice@example.com?uid=1234567890`. If
        +     * the Google Account is recovered, this identifier reverts to the standard
        +     * identifier for a Google Account.
        +     *
              * * `principalSet://goog/group/{group_id}`: A Google group. For example,
        -     *   `principalSet://goog/group/admins@example.com`.
        +     * `principalSet://goog/group/admins@example.com`.
        +     *
              * * `deleted:principalSet://goog/group/{group_id}?uid={uid}`: A Google group
        -     *   that was deleted recently. For example,
        -     *   `deleted:principalSet://goog/group/admins@example.com?uid=1234567890`. If
        -     *   the Google group is restored, this identifier reverts to the standard
        -     *   identifier for a Google group.
        +     * that was deleted recently. For example,
        +     * `deleted:principalSet://goog/group/admins@example.com?uid=1234567890`. If
        +     * the Google group is restored, this identifier reverts to the standard
        +     * identifier for a Google group.
        +     *
              * * `principal://iam.googleapis.com/projects/-/serviceAccounts/{service_account_id}`:
        -     *   A Google Cloud service account. For example,
        -     *   `principal://iam.googleapis.com/projects/-/serviceAccounts/my-service-account@iam.gserviceaccount.com`.
        +     * A Google Cloud service account. For example,
        +     * `principal://iam.googleapis.com/projects/-/serviceAccounts/my-service-account@iam.gserviceaccount.com`.
        +     *
              * * `deleted:principal://iam.googleapis.com/projects/-/serviceAccounts/{service_account_id}?uid={uid}`:
        -     *   A Google Cloud service account that was deleted recently. For example,
        -     *   `deleted:principal://iam.googleapis.com/projects/-/serviceAccounts/my-service-account@iam.gserviceaccount.com?uid=1234567890`.
        -     *   If the service account is undeleted, this identifier reverts to the
        -     *   standard identifier for a service account.
        +     * A Google Cloud service account that was deleted recently. For example,
        +     * `deleted:principal://iam.googleapis.com/projects/-/serviceAccounts/my-service-account@iam.gserviceaccount.com?uid=1234567890`.
        +     * If the service account is undeleted, this identifier reverts to the
        +     * standard identifier for a service account.
        +     *
              * * `principalSet://goog/cloudIdentityCustomerId/{customer_id}`: All of the
        -     *   principals associated with the specified Google Workspace or Cloud
        -     *   Identity customer ID. For example,
        -     *   `principalSet://goog/cloudIdentityCustomerId/C01Abc35`.
        +     * principals associated with the specified Google Workspace or Cloud
        +     * Identity customer ID. For example,
        +     * `principalSet://goog/cloudIdentityCustomerId/C01Abc35`.
              * 
        * * repeated string denied_principals = 1; @@ -1209,42 +1295,51 @@ public int getDeniedPrincipalsCount() { public java.lang.String getDeniedPrincipals(int index) { return deniedPrincipals_.get(index); } + /** * * *
              * The identities that are prevented from using one or more permissions on
              * Google Cloud resources. This field can contain the following values:
        +     *
              * * `principalSet://goog/public:all`: A special identifier that represents
        -     *   any principal that is on the internet, even if they do not have a Google
        -     *   Account or are not logged in.
        +     * any principal that is on the internet, even if they do not have a Google
        +     * Account or are not logged in.
        +     *
              * * `principal://goog/subject/{email_id}`: A specific Google Account.
        -     *   Includes Gmail, Cloud Identity, and Google Workspace user accounts. For
        -     *   example, `principal://goog/subject/alice@example.com`.
        +     * Includes Gmail, Cloud Identity, and Google Workspace user accounts. For
        +     * example, `principal://goog/subject/alice@example.com`.
        +     *
              * * `deleted:principal://goog/subject/{email_id}?uid={uid}`: A specific
        -     *   Google Account that was deleted recently. For example,
        -     *   `deleted:principal://goog/subject/alice@example.com?uid=1234567890`. If
        -     *   the Google Account is recovered, this identifier reverts to the standard
        -     *   identifier for a Google Account.
        +     * Google Account that was deleted recently. For example,
        +     * `deleted:principal://goog/subject/alice@example.com?uid=1234567890`. If
        +     * the Google Account is recovered, this identifier reverts to the standard
        +     * identifier for a Google Account.
        +     *
              * * `principalSet://goog/group/{group_id}`: A Google group. For example,
        -     *   `principalSet://goog/group/admins@example.com`.
        +     * `principalSet://goog/group/admins@example.com`.
        +     *
              * * `deleted:principalSet://goog/group/{group_id}?uid={uid}`: A Google group
        -     *   that was deleted recently. For example,
        -     *   `deleted:principalSet://goog/group/admins@example.com?uid=1234567890`. If
        -     *   the Google group is restored, this identifier reverts to the standard
        -     *   identifier for a Google group.
        +     * that was deleted recently. For example,
        +     * `deleted:principalSet://goog/group/admins@example.com?uid=1234567890`. If
        +     * the Google group is restored, this identifier reverts to the standard
        +     * identifier for a Google group.
        +     *
              * * `principal://iam.googleapis.com/projects/-/serviceAccounts/{service_account_id}`:
        -     *   A Google Cloud service account. For example,
        -     *   `principal://iam.googleapis.com/projects/-/serviceAccounts/my-service-account@iam.gserviceaccount.com`.
        +     * A Google Cloud service account. For example,
        +     * `principal://iam.googleapis.com/projects/-/serviceAccounts/my-service-account@iam.gserviceaccount.com`.
        +     *
              * * `deleted:principal://iam.googleapis.com/projects/-/serviceAccounts/{service_account_id}?uid={uid}`:
        -     *   A Google Cloud service account that was deleted recently. For example,
        -     *   `deleted:principal://iam.googleapis.com/projects/-/serviceAccounts/my-service-account@iam.gserviceaccount.com?uid=1234567890`.
        -     *   If the service account is undeleted, this identifier reverts to the
        -     *   standard identifier for a service account.
        +     * A Google Cloud service account that was deleted recently. For example,
        +     * `deleted:principal://iam.googleapis.com/projects/-/serviceAccounts/my-service-account@iam.gserviceaccount.com?uid=1234567890`.
        +     * If the service account is undeleted, this identifier reverts to the
        +     * standard identifier for a service account.
        +     *
              * * `principalSet://goog/cloudIdentityCustomerId/{customer_id}`: All of the
        -     *   principals associated with the specified Google Workspace or Cloud
        -     *   Identity customer ID. For example,
        -     *   `principalSet://goog/cloudIdentityCustomerId/C01Abc35`.
        +     * principals associated with the specified Google Workspace or Cloud
        +     * Identity customer ID. For example,
        +     * `principalSet://goog/cloudIdentityCustomerId/C01Abc35`.
              * 
        * * repeated string denied_principals = 1; @@ -1255,42 +1350,51 @@ public java.lang.String getDeniedPrincipals(int index) { public com.google.protobuf.ByteString getDeniedPrincipalsBytes(int index) { return deniedPrincipals_.getByteString(index); } + /** * * *
              * The identities that are prevented from using one or more permissions on
              * Google Cloud resources. This field can contain the following values:
        +     *
              * * `principalSet://goog/public:all`: A special identifier that represents
        -     *   any principal that is on the internet, even if they do not have a Google
        -     *   Account or are not logged in.
        +     * any principal that is on the internet, even if they do not have a Google
        +     * Account or are not logged in.
        +     *
              * * `principal://goog/subject/{email_id}`: A specific Google Account.
        -     *   Includes Gmail, Cloud Identity, and Google Workspace user accounts. For
        -     *   example, `principal://goog/subject/alice@example.com`.
        +     * Includes Gmail, Cloud Identity, and Google Workspace user accounts. For
        +     * example, `principal://goog/subject/alice@example.com`.
        +     *
              * * `deleted:principal://goog/subject/{email_id}?uid={uid}`: A specific
        -     *   Google Account that was deleted recently. For example,
        -     *   `deleted:principal://goog/subject/alice@example.com?uid=1234567890`. If
        -     *   the Google Account is recovered, this identifier reverts to the standard
        -     *   identifier for a Google Account.
        +     * Google Account that was deleted recently. For example,
        +     * `deleted:principal://goog/subject/alice@example.com?uid=1234567890`. If
        +     * the Google Account is recovered, this identifier reverts to the standard
        +     * identifier for a Google Account.
        +     *
              * * `principalSet://goog/group/{group_id}`: A Google group. For example,
        -     *   `principalSet://goog/group/admins@example.com`.
        +     * `principalSet://goog/group/admins@example.com`.
        +     *
              * * `deleted:principalSet://goog/group/{group_id}?uid={uid}`: A Google group
        -     *   that was deleted recently. For example,
        -     *   `deleted:principalSet://goog/group/admins@example.com?uid=1234567890`. If
        -     *   the Google group is restored, this identifier reverts to the standard
        -     *   identifier for a Google group.
        +     * that was deleted recently. For example,
        +     * `deleted:principalSet://goog/group/admins@example.com?uid=1234567890`. If
        +     * the Google group is restored, this identifier reverts to the standard
        +     * identifier for a Google group.
        +     *
              * * `principal://iam.googleapis.com/projects/-/serviceAccounts/{service_account_id}`:
        -     *   A Google Cloud service account. For example,
        -     *   `principal://iam.googleapis.com/projects/-/serviceAccounts/my-service-account@iam.gserviceaccount.com`.
        +     * A Google Cloud service account. For example,
        +     * `principal://iam.googleapis.com/projects/-/serviceAccounts/my-service-account@iam.gserviceaccount.com`.
        +     *
              * * `deleted:principal://iam.googleapis.com/projects/-/serviceAccounts/{service_account_id}?uid={uid}`:
        -     *   A Google Cloud service account that was deleted recently. For example,
        -     *   `deleted:principal://iam.googleapis.com/projects/-/serviceAccounts/my-service-account@iam.gserviceaccount.com?uid=1234567890`.
        -     *   If the service account is undeleted, this identifier reverts to the
        -     *   standard identifier for a service account.
        +     * A Google Cloud service account that was deleted recently. For example,
        +     * `deleted:principal://iam.googleapis.com/projects/-/serviceAccounts/my-service-account@iam.gserviceaccount.com?uid=1234567890`.
        +     * If the service account is undeleted, this identifier reverts to the
        +     * standard identifier for a service account.
        +     *
              * * `principalSet://goog/cloudIdentityCustomerId/{customer_id}`: All of the
        -     *   principals associated with the specified Google Workspace or Cloud
        -     *   Identity customer ID. For example,
        -     *   `principalSet://goog/cloudIdentityCustomerId/C01Abc35`.
        +     * principals associated with the specified Google Workspace or Cloud
        +     * Identity customer ID. For example,
        +     * `principalSet://goog/cloudIdentityCustomerId/C01Abc35`.
              * 
        * * repeated string denied_principals = 1; @@ -1305,45 +1409,55 @@ public Builder setDeniedPrincipals(int index, java.lang.String value) { } ensureDeniedPrincipalsIsMutable(); deniedPrincipals_.set(index, value); + bitField0_ |= 0x00000001; onChanged(); return this; } + /** * * *
              * The identities that are prevented from using one or more permissions on
              * Google Cloud resources. This field can contain the following values:
        +     *
              * * `principalSet://goog/public:all`: A special identifier that represents
        -     *   any principal that is on the internet, even if they do not have a Google
        -     *   Account or are not logged in.
        +     * any principal that is on the internet, even if they do not have a Google
        +     * Account or are not logged in.
        +     *
              * * `principal://goog/subject/{email_id}`: A specific Google Account.
        -     *   Includes Gmail, Cloud Identity, and Google Workspace user accounts. For
        -     *   example, `principal://goog/subject/alice@example.com`.
        +     * Includes Gmail, Cloud Identity, and Google Workspace user accounts. For
        +     * example, `principal://goog/subject/alice@example.com`.
        +     *
              * * `deleted:principal://goog/subject/{email_id}?uid={uid}`: A specific
        -     *   Google Account that was deleted recently. For example,
        -     *   `deleted:principal://goog/subject/alice@example.com?uid=1234567890`. If
        -     *   the Google Account is recovered, this identifier reverts to the standard
        -     *   identifier for a Google Account.
        +     * Google Account that was deleted recently. For example,
        +     * `deleted:principal://goog/subject/alice@example.com?uid=1234567890`. If
        +     * the Google Account is recovered, this identifier reverts to the standard
        +     * identifier for a Google Account.
        +     *
              * * `principalSet://goog/group/{group_id}`: A Google group. For example,
        -     *   `principalSet://goog/group/admins@example.com`.
        +     * `principalSet://goog/group/admins@example.com`.
        +     *
              * * `deleted:principalSet://goog/group/{group_id}?uid={uid}`: A Google group
        -     *   that was deleted recently. For example,
        -     *   `deleted:principalSet://goog/group/admins@example.com?uid=1234567890`. If
        -     *   the Google group is restored, this identifier reverts to the standard
        -     *   identifier for a Google group.
        +     * that was deleted recently. For example,
        +     * `deleted:principalSet://goog/group/admins@example.com?uid=1234567890`. If
        +     * the Google group is restored, this identifier reverts to the standard
        +     * identifier for a Google group.
        +     *
              * * `principal://iam.googleapis.com/projects/-/serviceAccounts/{service_account_id}`:
        -     *   A Google Cloud service account. For example,
        -     *   `principal://iam.googleapis.com/projects/-/serviceAccounts/my-service-account@iam.gserviceaccount.com`.
        +     * A Google Cloud service account. For example,
        +     * `principal://iam.googleapis.com/projects/-/serviceAccounts/my-service-account@iam.gserviceaccount.com`.
        +     *
              * * `deleted:principal://iam.googleapis.com/projects/-/serviceAccounts/{service_account_id}?uid={uid}`:
        -     *   A Google Cloud service account that was deleted recently. For example,
        -     *   `deleted:principal://iam.googleapis.com/projects/-/serviceAccounts/my-service-account@iam.gserviceaccount.com?uid=1234567890`.
        -     *   If the service account is undeleted, this identifier reverts to the
        -     *   standard identifier for a service account.
        +     * A Google Cloud service account that was deleted recently. For example,
        +     * `deleted:principal://iam.googleapis.com/projects/-/serviceAccounts/my-service-account@iam.gserviceaccount.com?uid=1234567890`.
        +     * If the service account is undeleted, this identifier reverts to the
        +     * standard identifier for a service account.
        +     *
              * * `principalSet://goog/cloudIdentityCustomerId/{customer_id}`: All of the
        -     *   principals associated with the specified Google Workspace or Cloud
        -     *   Identity customer ID. For example,
        -     *   `principalSet://goog/cloudIdentityCustomerId/C01Abc35`.
        +     * principals associated with the specified Google Workspace or Cloud
        +     * Identity customer ID. For example,
        +     * `principalSet://goog/cloudIdentityCustomerId/C01Abc35`.
              * 
        * * repeated string denied_principals = 1; @@ -1357,45 +1471,55 @@ public Builder addDeniedPrincipals(java.lang.String value) { } ensureDeniedPrincipalsIsMutable(); deniedPrincipals_.add(value); + bitField0_ |= 0x00000001; onChanged(); return this; } + /** * * *
              * The identities that are prevented from using one or more permissions on
              * Google Cloud resources. This field can contain the following values:
        +     *
              * * `principalSet://goog/public:all`: A special identifier that represents
        -     *   any principal that is on the internet, even if they do not have a Google
        -     *   Account or are not logged in.
        +     * any principal that is on the internet, even if they do not have a Google
        +     * Account or are not logged in.
        +     *
              * * `principal://goog/subject/{email_id}`: A specific Google Account.
        -     *   Includes Gmail, Cloud Identity, and Google Workspace user accounts. For
        -     *   example, `principal://goog/subject/alice@example.com`.
        +     * Includes Gmail, Cloud Identity, and Google Workspace user accounts. For
        +     * example, `principal://goog/subject/alice@example.com`.
        +     *
              * * `deleted:principal://goog/subject/{email_id}?uid={uid}`: A specific
        -     *   Google Account that was deleted recently. For example,
        -     *   `deleted:principal://goog/subject/alice@example.com?uid=1234567890`. If
        -     *   the Google Account is recovered, this identifier reverts to the standard
        -     *   identifier for a Google Account.
        +     * Google Account that was deleted recently. For example,
        +     * `deleted:principal://goog/subject/alice@example.com?uid=1234567890`. If
        +     * the Google Account is recovered, this identifier reverts to the standard
        +     * identifier for a Google Account.
        +     *
              * * `principalSet://goog/group/{group_id}`: A Google group. For example,
        -     *   `principalSet://goog/group/admins@example.com`.
        +     * `principalSet://goog/group/admins@example.com`.
        +     *
              * * `deleted:principalSet://goog/group/{group_id}?uid={uid}`: A Google group
        -     *   that was deleted recently. For example,
        -     *   `deleted:principalSet://goog/group/admins@example.com?uid=1234567890`. If
        -     *   the Google group is restored, this identifier reverts to the standard
        -     *   identifier for a Google group.
        +     * that was deleted recently. For example,
        +     * `deleted:principalSet://goog/group/admins@example.com?uid=1234567890`. If
        +     * the Google group is restored, this identifier reverts to the standard
        +     * identifier for a Google group.
        +     *
              * * `principal://iam.googleapis.com/projects/-/serviceAccounts/{service_account_id}`:
        -     *   A Google Cloud service account. For example,
        -     *   `principal://iam.googleapis.com/projects/-/serviceAccounts/my-service-account@iam.gserviceaccount.com`.
        +     * A Google Cloud service account. For example,
        +     * `principal://iam.googleapis.com/projects/-/serviceAccounts/my-service-account@iam.gserviceaccount.com`.
        +     *
              * * `deleted:principal://iam.googleapis.com/projects/-/serviceAccounts/{service_account_id}?uid={uid}`:
        -     *   A Google Cloud service account that was deleted recently. For example,
        -     *   `deleted:principal://iam.googleapis.com/projects/-/serviceAccounts/my-service-account@iam.gserviceaccount.com?uid=1234567890`.
        -     *   If the service account is undeleted, this identifier reverts to the
        -     *   standard identifier for a service account.
        +     * A Google Cloud service account that was deleted recently. For example,
        +     * `deleted:principal://iam.googleapis.com/projects/-/serviceAccounts/my-service-account@iam.gserviceaccount.com?uid=1234567890`.
        +     * If the service account is undeleted, this identifier reverts to the
        +     * standard identifier for a service account.
        +     *
              * * `principalSet://goog/cloudIdentityCustomerId/{customer_id}`: All of the
        -     *   principals associated with the specified Google Workspace or Cloud
        -     *   Identity customer ID. For example,
        -     *   `principalSet://goog/cloudIdentityCustomerId/C01Abc35`.
        +     * principals associated with the specified Google Workspace or Cloud
        +     * Identity customer ID. For example,
        +     * `principalSet://goog/cloudIdentityCustomerId/C01Abc35`.
              * 
        * * repeated string denied_principals = 1; @@ -1406,45 +1530,55 @@ public Builder addDeniedPrincipals(java.lang.String value) { public Builder addAllDeniedPrincipals(java.lang.Iterable values) { ensureDeniedPrincipalsIsMutable(); com.google.protobuf.AbstractMessageLite.Builder.addAll(values, deniedPrincipals_); + bitField0_ |= 0x00000001; onChanged(); return this; } + /** * * *
              * The identities that are prevented from using one or more permissions on
              * Google Cloud resources. This field can contain the following values:
        +     *
              * * `principalSet://goog/public:all`: A special identifier that represents
        -     *   any principal that is on the internet, even if they do not have a Google
        -     *   Account or are not logged in.
        +     * any principal that is on the internet, even if they do not have a Google
        +     * Account or are not logged in.
        +     *
              * * `principal://goog/subject/{email_id}`: A specific Google Account.
        -     *   Includes Gmail, Cloud Identity, and Google Workspace user accounts. For
        -     *   example, `principal://goog/subject/alice@example.com`.
        +     * Includes Gmail, Cloud Identity, and Google Workspace user accounts. For
        +     * example, `principal://goog/subject/alice@example.com`.
        +     *
              * * `deleted:principal://goog/subject/{email_id}?uid={uid}`: A specific
        -     *   Google Account that was deleted recently. For example,
        -     *   `deleted:principal://goog/subject/alice@example.com?uid=1234567890`. If
        -     *   the Google Account is recovered, this identifier reverts to the standard
        -     *   identifier for a Google Account.
        +     * Google Account that was deleted recently. For example,
        +     * `deleted:principal://goog/subject/alice@example.com?uid=1234567890`. If
        +     * the Google Account is recovered, this identifier reverts to the standard
        +     * identifier for a Google Account.
        +     *
              * * `principalSet://goog/group/{group_id}`: A Google group. For example,
        -     *   `principalSet://goog/group/admins@example.com`.
        +     * `principalSet://goog/group/admins@example.com`.
        +     *
              * * `deleted:principalSet://goog/group/{group_id}?uid={uid}`: A Google group
        -     *   that was deleted recently. For example,
        -     *   `deleted:principalSet://goog/group/admins@example.com?uid=1234567890`. If
        -     *   the Google group is restored, this identifier reverts to the standard
        -     *   identifier for a Google group.
        +     * that was deleted recently. For example,
        +     * `deleted:principalSet://goog/group/admins@example.com?uid=1234567890`. If
        +     * the Google group is restored, this identifier reverts to the standard
        +     * identifier for a Google group.
        +     *
              * * `principal://iam.googleapis.com/projects/-/serviceAccounts/{service_account_id}`:
        -     *   A Google Cloud service account. For example,
        -     *   `principal://iam.googleapis.com/projects/-/serviceAccounts/my-service-account@iam.gserviceaccount.com`.
        +     * A Google Cloud service account. For example,
        +     * `principal://iam.googleapis.com/projects/-/serviceAccounts/my-service-account@iam.gserviceaccount.com`.
        +     *
              * * `deleted:principal://iam.googleapis.com/projects/-/serviceAccounts/{service_account_id}?uid={uid}`:
        -     *   A Google Cloud service account that was deleted recently. For example,
        -     *   `deleted:principal://iam.googleapis.com/projects/-/serviceAccounts/my-service-account@iam.gserviceaccount.com?uid=1234567890`.
        -     *   If the service account is undeleted, this identifier reverts to the
        -     *   standard identifier for a service account.
        +     * A Google Cloud service account that was deleted recently. For example,
        +     * `deleted:principal://iam.googleapis.com/projects/-/serviceAccounts/my-service-account@iam.gserviceaccount.com?uid=1234567890`.
        +     * If the service account is undeleted, this identifier reverts to the
        +     * standard identifier for a service account.
        +     *
              * * `principalSet://goog/cloudIdentityCustomerId/{customer_id}`: All of the
        -     *   principals associated with the specified Google Workspace or Cloud
        -     *   Identity customer ID. For example,
        -     *   `principalSet://goog/cloudIdentityCustomerId/C01Abc35`.
        +     * principals associated with the specified Google Workspace or Cloud
        +     * Identity customer ID. For example,
        +     * `principalSet://goog/cloudIdentityCustomerId/C01Abc35`.
              * 
        * * repeated string denied_principals = 1; @@ -1452,47 +1586,57 @@ public Builder addAllDeniedPrincipals(java.lang.Iterable value * @return This builder for chaining. */ public Builder clearDeniedPrincipals() { - deniedPrincipals_ = com.google.protobuf.LazyStringArrayList.EMPTY; + deniedPrincipals_ = com.google.protobuf.LazyStringArrayList.emptyList(); bitField0_ = (bitField0_ & ~0x00000001); + ; onChanged(); return this; } + /** * * *
              * The identities that are prevented from using one or more permissions on
              * Google Cloud resources. This field can contain the following values:
        +     *
              * * `principalSet://goog/public:all`: A special identifier that represents
        -     *   any principal that is on the internet, even if they do not have a Google
        -     *   Account or are not logged in.
        +     * any principal that is on the internet, even if they do not have a Google
        +     * Account or are not logged in.
        +     *
              * * `principal://goog/subject/{email_id}`: A specific Google Account.
        -     *   Includes Gmail, Cloud Identity, and Google Workspace user accounts. For
        -     *   example, `principal://goog/subject/alice@example.com`.
        +     * Includes Gmail, Cloud Identity, and Google Workspace user accounts. For
        +     * example, `principal://goog/subject/alice@example.com`.
        +     *
              * * `deleted:principal://goog/subject/{email_id}?uid={uid}`: A specific
        -     *   Google Account that was deleted recently. For example,
        -     *   `deleted:principal://goog/subject/alice@example.com?uid=1234567890`. If
        -     *   the Google Account is recovered, this identifier reverts to the standard
        -     *   identifier for a Google Account.
        +     * Google Account that was deleted recently. For example,
        +     * `deleted:principal://goog/subject/alice@example.com?uid=1234567890`. If
        +     * the Google Account is recovered, this identifier reverts to the standard
        +     * identifier for a Google Account.
        +     *
              * * `principalSet://goog/group/{group_id}`: A Google group. For example,
        -     *   `principalSet://goog/group/admins@example.com`.
        +     * `principalSet://goog/group/admins@example.com`.
        +     *
              * * `deleted:principalSet://goog/group/{group_id}?uid={uid}`: A Google group
        -     *   that was deleted recently. For example,
        -     *   `deleted:principalSet://goog/group/admins@example.com?uid=1234567890`. If
        -     *   the Google group is restored, this identifier reverts to the standard
        -     *   identifier for a Google group.
        +     * that was deleted recently. For example,
        +     * `deleted:principalSet://goog/group/admins@example.com?uid=1234567890`. If
        +     * the Google group is restored, this identifier reverts to the standard
        +     * identifier for a Google group.
        +     *
              * * `principal://iam.googleapis.com/projects/-/serviceAccounts/{service_account_id}`:
        -     *   A Google Cloud service account. For example,
        -     *   `principal://iam.googleapis.com/projects/-/serviceAccounts/my-service-account@iam.gserviceaccount.com`.
        +     * A Google Cloud service account. For example,
        +     * `principal://iam.googleapis.com/projects/-/serviceAccounts/my-service-account@iam.gserviceaccount.com`.
        +     *
              * * `deleted:principal://iam.googleapis.com/projects/-/serviceAccounts/{service_account_id}?uid={uid}`:
        -     *   A Google Cloud service account that was deleted recently. For example,
        -     *   `deleted:principal://iam.googleapis.com/projects/-/serviceAccounts/my-service-account@iam.gserviceaccount.com?uid=1234567890`.
        -     *   If the service account is undeleted, this identifier reverts to the
        -     *   standard identifier for a service account.
        +     * A Google Cloud service account that was deleted recently. For example,
        +     * `deleted:principal://iam.googleapis.com/projects/-/serviceAccounts/my-service-account@iam.gserviceaccount.com?uid=1234567890`.
        +     * If the service account is undeleted, this identifier reverts to the
        +     * standard identifier for a service account.
        +     *
              * * `principalSet://goog/cloudIdentityCustomerId/{customer_id}`: All of the
        -     *   principals associated with the specified Google Workspace or Cloud
        -     *   Identity customer ID. For example,
        -     *   `principalSet://goog/cloudIdentityCustomerId/C01Abc35`.
        +     * principals associated with the specified Google Workspace or Cloud
        +     * Identity customer ID. For example,
        +     * `principalSet://goog/cloudIdentityCustomerId/C01Abc35`.
              * 
        * * repeated string denied_principals = 1; @@ -1507,19 +1651,21 @@ public Builder addDeniedPrincipalsBytes(com.google.protobuf.ByteString value) { checkByteStringIsUtf8(value); ensureDeniedPrincipalsIsMutable(); deniedPrincipals_.add(value); + bitField0_ |= 0x00000001; onChanged(); return this; } - private com.google.protobuf.LazyStringList exceptionPrincipals_ = - com.google.protobuf.LazyStringArrayList.EMPTY; + private com.google.protobuf.LazyStringArrayList exceptionPrincipals_ = + com.google.protobuf.LazyStringArrayList.emptyList(); private void ensureExceptionPrincipalsIsMutable() { - if (!((bitField0_ & 0x00000002) != 0)) { + if (!exceptionPrincipals_.isModifiable()) { exceptionPrincipals_ = new com.google.protobuf.LazyStringArrayList(exceptionPrincipals_); - bitField0_ |= 0x00000002; } + bitField0_ |= 0x00000002; } + /** * * @@ -1528,6 +1674,7 @@ private void ensureExceptionPrincipalsIsMutable() { * listed in the `denied_principals`. For example, you could add a Google * group to the `denied_principals`, then exclude specific users who belong to * that group. + * * This field can contain the same values as the `denied_principals` field, * excluding `principalSet://goog/public:all`, which represents all users on * the internet. @@ -1538,8 +1685,10 @@ private void ensureExceptionPrincipalsIsMutable() { * @return A list containing the exceptionPrincipals. */ public com.google.protobuf.ProtocolStringList getExceptionPrincipalsList() { - return exceptionPrincipals_.getUnmodifiableView(); + exceptionPrincipals_.makeImmutable(); + return exceptionPrincipals_; } + /** * * @@ -1548,6 +1697,7 @@ public com.google.protobuf.ProtocolStringList getExceptionPrincipalsList() { * listed in the `denied_principals`. For example, you could add a Google * group to the `denied_principals`, then exclude specific users who belong to * that group. + * * This field can contain the same values as the `denied_principals` field, * excluding `principalSet://goog/public:all`, which represents all users on * the internet. @@ -1560,6 +1710,7 @@ public com.google.protobuf.ProtocolStringList getExceptionPrincipalsList() { public int getExceptionPrincipalsCount() { return exceptionPrincipals_.size(); } + /** * * @@ -1568,6 +1719,7 @@ public int getExceptionPrincipalsCount() { * listed in the `denied_principals`. For example, you could add a Google * group to the `denied_principals`, then exclude specific users who belong to * that group. + * * This field can contain the same values as the `denied_principals` field, * excluding `principalSet://goog/public:all`, which represents all users on * the internet. @@ -1581,6 +1733,7 @@ public int getExceptionPrincipalsCount() { public java.lang.String getExceptionPrincipals(int index) { return exceptionPrincipals_.get(index); } + /** * * @@ -1589,6 +1742,7 @@ public java.lang.String getExceptionPrincipals(int index) { * listed in the `denied_principals`. For example, you could add a Google * group to the `denied_principals`, then exclude specific users who belong to * that group. + * * This field can contain the same values as the `denied_principals` field, * excluding `principalSet://goog/public:all`, which represents all users on * the internet. @@ -1602,6 +1756,7 @@ public java.lang.String getExceptionPrincipals(int index) { public com.google.protobuf.ByteString getExceptionPrincipalsBytes(int index) { return exceptionPrincipals_.getByteString(index); } + /** * * @@ -1610,6 +1765,7 @@ public com.google.protobuf.ByteString getExceptionPrincipalsBytes(int index) { * listed in the `denied_principals`. For example, you could add a Google * group to the `denied_principals`, then exclude specific users who belong to * that group. + * * This field can contain the same values as the `denied_principals` field, * excluding `principalSet://goog/public:all`, which represents all users on * the internet. @@ -1627,9 +1783,11 @@ public Builder setExceptionPrincipals(int index, java.lang.String value) { } ensureExceptionPrincipalsIsMutable(); exceptionPrincipals_.set(index, value); + bitField0_ |= 0x00000002; onChanged(); return this; } + /** * * @@ -1638,6 +1796,7 @@ public Builder setExceptionPrincipals(int index, java.lang.String value) { * listed in the `denied_principals`. For example, you could add a Google * group to the `denied_principals`, then exclude specific users who belong to * that group. + * * This field can contain the same values as the `denied_principals` field, * excluding `principalSet://goog/public:all`, which represents all users on * the internet. @@ -1654,9 +1813,11 @@ public Builder addExceptionPrincipals(java.lang.String value) { } ensureExceptionPrincipalsIsMutable(); exceptionPrincipals_.add(value); + bitField0_ |= 0x00000002; onChanged(); return this; } + /** * * @@ -1665,6 +1826,7 @@ public Builder addExceptionPrincipals(java.lang.String value) { * listed in the `denied_principals`. For example, you could add a Google * group to the `denied_principals`, then exclude specific users who belong to * that group. + * * This field can contain the same values as the `denied_principals` field, * excluding `principalSet://goog/public:all`, which represents all users on * the internet. @@ -1678,9 +1840,11 @@ public Builder addExceptionPrincipals(java.lang.String value) { public Builder addAllExceptionPrincipals(java.lang.Iterable values) { ensureExceptionPrincipalsIsMutable(); com.google.protobuf.AbstractMessageLite.Builder.addAll(values, exceptionPrincipals_); + bitField0_ |= 0x00000002; onChanged(); return this; } + /** * * @@ -1689,6 +1853,7 @@ public Builder addAllExceptionPrincipals(java.lang.Iterable va * listed in the `denied_principals`. For example, you could add a Google * group to the `denied_principals`, then exclude specific users who belong to * that group. + * * This field can contain the same values as the `denied_principals` field, * excluding `principalSet://goog/public:all`, which represents all users on * the internet. @@ -1699,11 +1864,13 @@ public Builder addAllExceptionPrincipals(java.lang.Iterable va * @return This builder for chaining. */ public Builder clearExceptionPrincipals() { - exceptionPrincipals_ = com.google.protobuf.LazyStringArrayList.EMPTY; + exceptionPrincipals_ = com.google.protobuf.LazyStringArrayList.emptyList(); bitField0_ = (bitField0_ & ~0x00000002); + ; onChanged(); return this; } + /** * * @@ -1712,6 +1879,7 @@ public Builder clearExceptionPrincipals() { * listed in the `denied_principals`. For example, you could add a Google * group to the `denied_principals`, then exclude specific users who belong to * that group. + * * This field can contain the same values as the `denied_principals` field, * excluding `principalSet://goog/public:all`, which represents all users on * the internet. @@ -1729,19 +1897,21 @@ public Builder addExceptionPrincipalsBytes(com.google.protobuf.ByteString value) checkByteStringIsUtf8(value); ensureExceptionPrincipalsIsMutable(); exceptionPrincipals_.add(value); + bitField0_ |= 0x00000002; onChanged(); return this; } - private com.google.protobuf.LazyStringList deniedPermissions_ = - com.google.protobuf.LazyStringArrayList.EMPTY; + private com.google.protobuf.LazyStringArrayList deniedPermissions_ = + com.google.protobuf.LazyStringArrayList.emptyList(); private void ensureDeniedPermissionsIsMutable() { - if (!((bitField0_ & 0x00000004) != 0)) { + if (!deniedPermissions_.isModifiable()) { deniedPermissions_ = new com.google.protobuf.LazyStringArrayList(deniedPermissions_); - bitField0_ |= 0x00000004; } + bitField0_ |= 0x00000004; } + /** * * @@ -1757,8 +1927,10 @@ private void ensureDeniedPermissionsIsMutable() { * @return A list containing the deniedPermissions. */ public com.google.protobuf.ProtocolStringList getDeniedPermissionsList() { - return deniedPermissions_.getUnmodifiableView(); + deniedPermissions_.makeImmutable(); + return deniedPermissions_; } + /** * * @@ -1776,6 +1948,7 @@ public com.google.protobuf.ProtocolStringList getDeniedPermissionsList() { public int getDeniedPermissionsCount() { return deniedPermissions_.size(); } + /** * * @@ -1794,6 +1967,7 @@ public int getDeniedPermissionsCount() { public java.lang.String getDeniedPermissions(int index) { return deniedPermissions_.get(index); } + /** * * @@ -1812,6 +1986,7 @@ public java.lang.String getDeniedPermissions(int index) { public com.google.protobuf.ByteString getDeniedPermissionsBytes(int index) { return deniedPermissions_.getByteString(index); } + /** * * @@ -1834,9 +2009,11 @@ public Builder setDeniedPermissions(int index, java.lang.String value) { } ensureDeniedPermissionsIsMutable(); deniedPermissions_.set(index, value); + bitField0_ |= 0x00000004; onChanged(); return this; } + /** * * @@ -1858,9 +2035,11 @@ public Builder addDeniedPermissions(java.lang.String value) { } ensureDeniedPermissionsIsMutable(); deniedPermissions_.add(value); + bitField0_ |= 0x00000004; onChanged(); return this; } + /** * * @@ -1879,9 +2058,11 @@ public Builder addDeniedPermissions(java.lang.String value) { public Builder addAllDeniedPermissions(java.lang.Iterable values) { ensureDeniedPermissionsIsMutable(); com.google.protobuf.AbstractMessageLite.Builder.addAll(values, deniedPermissions_); + bitField0_ |= 0x00000004; onChanged(); return this; } + /** * * @@ -1897,11 +2078,13 @@ public Builder addAllDeniedPermissions(java.lang.Iterable valu * @return This builder for chaining. */ public Builder clearDeniedPermissions() { - deniedPermissions_ = com.google.protobuf.LazyStringArrayList.EMPTY; + deniedPermissions_ = com.google.protobuf.LazyStringArrayList.emptyList(); bitField0_ = (bitField0_ & ~0x00000004); + ; onChanged(); return this; } + /** * * @@ -1924,19 +2107,21 @@ public Builder addDeniedPermissionsBytes(com.google.protobuf.ByteString value) { checkByteStringIsUtf8(value); ensureDeniedPermissionsIsMutable(); deniedPermissions_.add(value); + bitField0_ |= 0x00000004; onChanged(); return this; } - private com.google.protobuf.LazyStringList exceptionPermissions_ = - com.google.protobuf.LazyStringArrayList.EMPTY; + private com.google.protobuf.LazyStringArrayList exceptionPermissions_ = + com.google.protobuf.LazyStringArrayList.emptyList(); private void ensureExceptionPermissionsIsMutable() { - if (!((bitField0_ & 0x00000008) != 0)) { + if (!exceptionPermissions_.isModifiable()) { exceptionPermissions_ = new com.google.protobuf.LazyStringArrayList(exceptionPermissions_); - bitField0_ |= 0x00000008; } + bitField0_ |= 0x00000008; } + /** * * @@ -1945,6 +2130,7 @@ private void ensureExceptionPermissionsIsMutable() { * permissions given by `denied_permissions`. If a permission appears in * `denied_permissions` _and_ in `exception_permissions` then it will _not_ be * denied. + * * The excluded permissions can be specified using the same syntax as * `denied_permissions`. *
        @@ -1954,8 +2140,10 @@ private void ensureExceptionPermissionsIsMutable() { * @return A list containing the exceptionPermissions. */ public com.google.protobuf.ProtocolStringList getExceptionPermissionsList() { - return exceptionPermissions_.getUnmodifiableView(); + exceptionPermissions_.makeImmutable(); + return exceptionPermissions_; } + /** * * @@ -1964,6 +2152,7 @@ public com.google.protobuf.ProtocolStringList getExceptionPermissionsList() { * permissions given by `denied_permissions`. If a permission appears in * `denied_permissions` _and_ in `exception_permissions` then it will _not_ be * denied. + * * The excluded permissions can be specified using the same syntax as * `denied_permissions`. *
        @@ -1975,6 +2164,7 @@ public com.google.protobuf.ProtocolStringList getExceptionPermissionsList() { public int getExceptionPermissionsCount() { return exceptionPermissions_.size(); } + /** * * @@ -1983,6 +2173,7 @@ public int getExceptionPermissionsCount() { * permissions given by `denied_permissions`. If a permission appears in * `denied_permissions` _and_ in `exception_permissions` then it will _not_ be * denied. + * * The excluded permissions can be specified using the same syntax as * `denied_permissions`. *
        @@ -1995,6 +2186,7 @@ public int getExceptionPermissionsCount() { public java.lang.String getExceptionPermissions(int index) { return exceptionPermissions_.get(index); } + /** * * @@ -2003,6 +2195,7 @@ public java.lang.String getExceptionPermissions(int index) { * permissions given by `denied_permissions`. If a permission appears in * `denied_permissions` _and_ in `exception_permissions` then it will _not_ be * denied. + * * The excluded permissions can be specified using the same syntax as * `denied_permissions`. * @@ -2015,6 +2208,7 @@ public java.lang.String getExceptionPermissions(int index) { public com.google.protobuf.ByteString getExceptionPermissionsBytes(int index) { return exceptionPermissions_.getByteString(index); } + /** * * @@ -2023,6 +2217,7 @@ public com.google.protobuf.ByteString getExceptionPermissionsBytes(int index) { * permissions given by `denied_permissions`. If a permission appears in * `denied_permissions` _and_ in `exception_permissions` then it will _not_ be * denied. + * * The excluded permissions can be specified using the same syntax as * `denied_permissions`. * @@ -2039,9 +2234,11 @@ public Builder setExceptionPermissions(int index, java.lang.String value) { } ensureExceptionPermissionsIsMutable(); exceptionPermissions_.set(index, value); + bitField0_ |= 0x00000008; onChanged(); return this; } + /** * * @@ -2050,6 +2247,7 @@ public Builder setExceptionPermissions(int index, java.lang.String value) { * permissions given by `denied_permissions`. If a permission appears in * `denied_permissions` _and_ in `exception_permissions` then it will _not_ be * denied. + * * The excluded permissions can be specified using the same syntax as * `denied_permissions`. * @@ -2065,9 +2263,11 @@ public Builder addExceptionPermissions(java.lang.String value) { } ensureExceptionPermissionsIsMutable(); exceptionPermissions_.add(value); + bitField0_ |= 0x00000008; onChanged(); return this; } + /** * * @@ -2076,6 +2276,7 @@ public Builder addExceptionPermissions(java.lang.String value) { * permissions given by `denied_permissions`. If a permission appears in * `denied_permissions` _and_ in `exception_permissions` then it will _not_ be * denied. + * * The excluded permissions can be specified using the same syntax as * `denied_permissions`. * @@ -2088,9 +2289,11 @@ public Builder addExceptionPermissions(java.lang.String value) { public Builder addAllExceptionPermissions(java.lang.Iterable values) { ensureExceptionPermissionsIsMutable(); com.google.protobuf.AbstractMessageLite.Builder.addAll(values, exceptionPermissions_); + bitField0_ |= 0x00000008; onChanged(); return this; } + /** * * @@ -2099,6 +2302,7 @@ public Builder addAllExceptionPermissions(java.lang.Iterable v * permissions given by `denied_permissions`. If a permission appears in * `denied_permissions` _and_ in `exception_permissions` then it will _not_ be * denied. + * * The excluded permissions can be specified using the same syntax as * `denied_permissions`. * @@ -2108,11 +2312,13 @@ public Builder addAllExceptionPermissions(java.lang.Iterable v * @return This builder for chaining. */ public Builder clearExceptionPermissions() { - exceptionPermissions_ = com.google.protobuf.LazyStringArrayList.EMPTY; + exceptionPermissions_ = com.google.protobuf.LazyStringArrayList.emptyList(); bitField0_ = (bitField0_ & ~0x00000008); + ; onChanged(); return this; } + /** * * @@ -2121,6 +2327,7 @@ public Builder clearExceptionPermissions() { * permissions given by `denied_permissions`. If a permission appears in * `denied_permissions` _and_ in `exception_permissions` then it will _not_ be * denied. + * * The excluded permissions can be specified using the same syntax as * `denied_permissions`. * @@ -2137,14 +2344,16 @@ public Builder addExceptionPermissionsBytes(com.google.protobuf.ByteString value checkByteStringIsUtf8(value); ensureExceptionPermissionsIsMutable(); exceptionPermissions_.add(value); + bitField0_ |= 0x00000008; onChanged(); return this; } private com.google.type.Expr denialCondition_; - private com.google.protobuf.SingleFieldBuilderV3< + private com.google.protobuf.SingleFieldBuilder< com.google.type.Expr, com.google.type.Expr.Builder, com.google.type.ExprOrBuilder> denialConditionBuilder_; + /** * * @@ -2152,8 +2361,10 @@ public Builder addExceptionPermissionsBytes(com.google.protobuf.ByteString value * The condition that determines whether this deny rule applies to a request. * If the condition expression evaluates to `true`, then the deny rule is * applied; otherwise, the deny rule is not applied. + * * Each deny rule is evaluated independently. If this deny rule does not apply * to a request, other deny rules might still apply. + * * The condition can use CEL functions that evaluate * [resource * tags](https://cloud.google.com/iam/help/conditions/resource-tags). Other @@ -2165,8 +2376,9 @@ public Builder addExceptionPermissionsBytes(com.google.protobuf.ByteString value * @return Whether the denialCondition field is set. */ public boolean hasDenialCondition() { - return denialConditionBuilder_ != null || denialCondition_ != null; + return ((bitField0_ & 0x00000010) != 0); } + /** * * @@ -2174,8 +2386,10 @@ public boolean hasDenialCondition() { * The condition that determines whether this deny rule applies to a request. * If the condition expression evaluates to `true`, then the deny rule is * applied; otherwise, the deny rule is not applied. + * * Each deny rule is evaluated independently. If this deny rule does not apply * to a request, other deny rules might still apply. + * * The condition can use CEL functions that evaluate * [resource * tags](https://cloud.google.com/iam/help/conditions/resource-tags). Other @@ -2195,6 +2409,7 @@ public com.google.type.Expr getDenialCondition() { return denialConditionBuilder_.getMessage(); } } + /** * * @@ -2202,8 +2417,10 @@ public com.google.type.Expr getDenialCondition() { * The condition that determines whether this deny rule applies to a request. * If the condition expression evaluates to `true`, then the deny rule is * applied; otherwise, the deny rule is not applied. + * * Each deny rule is evaluated independently. If this deny rule does not apply * to a request, other deny rules might still apply. + * * The condition can use CEL functions that evaluate * [resource * tags](https://cloud.google.com/iam/help/conditions/resource-tags). Other @@ -2218,13 +2435,14 @@ public Builder setDenialCondition(com.google.type.Expr value) { throw new NullPointerException(); } denialCondition_ = value; - onChanged(); } else { denialConditionBuilder_.setMessage(value); } - + bitField0_ |= 0x00000010; + onChanged(); return this; } + /** * * @@ -2232,8 +2450,10 @@ public Builder setDenialCondition(com.google.type.Expr value) { * The condition that determines whether this deny rule applies to a request. * If the condition expression evaluates to `true`, then the deny rule is * applied; otherwise, the deny rule is not applied. + * * Each deny rule is evaluated independently. If this deny rule does not apply * to a request, other deny rules might still apply. + * * The condition can use CEL functions that evaluate * [resource * tags](https://cloud.google.com/iam/help/conditions/resource-tags). Other @@ -2245,13 +2465,14 @@ public Builder setDenialCondition(com.google.type.Expr value) { public Builder setDenialCondition(com.google.type.Expr.Builder builderForValue) { if (denialConditionBuilder_ == null) { denialCondition_ = builderForValue.build(); - onChanged(); } else { denialConditionBuilder_.setMessage(builderForValue.build()); } - + bitField0_ |= 0x00000010; + onChanged(); return this; } + /** * * @@ -2259,8 +2480,10 @@ public Builder setDenialCondition(com.google.type.Expr.Builder builderForValue) * The condition that determines whether this deny rule applies to a request. * If the condition expression evaluates to `true`, then the deny rule is * applied; otherwise, the deny rule is not applied. + * * Each deny rule is evaluated independently. If this deny rule does not apply * to a request, other deny rules might still apply. + * * The condition can use CEL functions that evaluate * [resource * tags](https://cloud.google.com/iam/help/conditions/resource-tags). Other @@ -2271,19 +2494,23 @@ public Builder setDenialCondition(com.google.type.Expr.Builder builderForValue) */ public Builder mergeDenialCondition(com.google.type.Expr value) { if (denialConditionBuilder_ == null) { - if (denialCondition_ != null) { - denialCondition_ = - com.google.type.Expr.newBuilder(denialCondition_).mergeFrom(value).buildPartial(); + if (((bitField0_ & 0x00000010) != 0) + && denialCondition_ != null + && denialCondition_ != com.google.type.Expr.getDefaultInstance()) { + getDenialConditionBuilder().mergeFrom(value); } else { denialCondition_ = value; } - onChanged(); } else { denialConditionBuilder_.mergeFrom(value); } - + if (denialCondition_ != null) { + bitField0_ |= 0x00000010; + onChanged(); + } return this; } + /** * * @@ -2291,8 +2518,10 @@ public Builder mergeDenialCondition(com.google.type.Expr value) { * The condition that determines whether this deny rule applies to a request. * If the condition expression evaluates to `true`, then the deny rule is * applied; otherwise, the deny rule is not applied. + * * Each deny rule is evaluated independently. If this deny rule does not apply * to a request, other deny rules might still apply. + * * The condition can use CEL functions that evaluate * [resource * tags](https://cloud.google.com/iam/help/conditions/resource-tags). Other @@ -2302,16 +2531,16 @@ public Builder mergeDenialCondition(com.google.type.Expr value) { * .google.type.Expr denial_condition = 5; */ public Builder clearDenialCondition() { - if (denialConditionBuilder_ == null) { - denialCondition_ = null; - onChanged(); - } else { - denialCondition_ = null; + bitField0_ = (bitField0_ & ~0x00000010); + denialCondition_ = null; + if (denialConditionBuilder_ != null) { + denialConditionBuilder_.dispose(); denialConditionBuilder_ = null; } - + onChanged(); return this; } + /** * * @@ -2319,8 +2548,10 @@ public Builder clearDenialCondition() { * The condition that determines whether this deny rule applies to a request. * If the condition expression evaluates to `true`, then the deny rule is * applied; otherwise, the deny rule is not applied. + * * Each deny rule is evaluated independently. If this deny rule does not apply * to a request, other deny rules might still apply. + * * The condition can use CEL functions that evaluate * [resource * tags](https://cloud.google.com/iam/help/conditions/resource-tags). Other @@ -2330,10 +2561,11 @@ public Builder clearDenialCondition() { * .google.type.Expr denial_condition = 5; */ public com.google.type.Expr.Builder getDenialConditionBuilder() { - + bitField0_ |= 0x00000010; onChanged(); - return getDenialConditionFieldBuilder().getBuilder(); + return internalGetDenialConditionFieldBuilder().getBuilder(); } + /** * * @@ -2341,8 +2573,10 @@ public com.google.type.Expr.Builder getDenialConditionBuilder() { * The condition that determines whether this deny rule applies to a request. * If the condition expression evaluates to `true`, then the deny rule is * applied; otherwise, the deny rule is not applied. + * * Each deny rule is evaluated independently. If this deny rule does not apply * to a request, other deny rules might still apply. + * * The condition can use CEL functions that evaluate * [resource * tags](https://cloud.google.com/iam/help/conditions/resource-tags). Other @@ -2360,6 +2594,7 @@ public com.google.type.ExprOrBuilder getDenialConditionOrBuilder() { : denialCondition_; } } + /** * * @@ -2367,8 +2602,10 @@ public com.google.type.ExprOrBuilder getDenialConditionOrBuilder() { * The condition that determines whether this deny rule applies to a request. * If the condition expression evaluates to `true`, then the deny rule is * applied; otherwise, the deny rule is not applied. + * * Each deny rule is evaluated independently. If this deny rule does not apply * to a request, other deny rules might still apply. + * * The condition can use CEL functions that evaluate * [resource * tags](https://cloud.google.com/iam/help/conditions/resource-tags). Other @@ -2377,12 +2614,12 @@ public com.google.type.ExprOrBuilder getDenialConditionOrBuilder() { * * .google.type.Expr denial_condition = 5; */ - private com.google.protobuf.SingleFieldBuilderV3< + private com.google.protobuf.SingleFieldBuilder< com.google.type.Expr, com.google.type.Expr.Builder, com.google.type.ExprOrBuilder> - getDenialConditionFieldBuilder() { + internalGetDenialConditionFieldBuilder() { if (denialConditionBuilder_ == null) { denialConditionBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< + new com.google.protobuf.SingleFieldBuilder< com.google.type.Expr, com.google.type.Expr.Builder, com.google.type.ExprOrBuilder>( getDenialCondition(), getParentForChildren(), isClean()); denialCondition_ = null; @@ -2390,17 +2627,6 @@ public com.google.type.ExprOrBuilder getDenialConditionOrBuilder() { return denialConditionBuilder_; } - @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.iam.v2beta.DenyRule) } diff --git a/java-iam/proto-google-iam-v2beta/src/main/java/com/google/iam/v2beta/DenyRuleOrBuilder.java b/java-iam/proto-google-iam-v2beta/src/main/java/com/google/iam/v2beta/DenyRuleOrBuilder.java index 30258206ce..2b366f2b21 100644 --- a/java-iam/proto-google-iam-v2beta/src/main/java/com/google/iam/v2beta/DenyRuleOrBuilder.java +++ b/java-iam/proto-google-iam-v2beta/src/main/java/com/google/iam/v2beta/DenyRuleOrBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,10 +14,13 @@ * limitations under the License. */ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: google/iam/v2beta/deny.proto +// Protobuf Java Version: 4.33.2 package com.google.iam.v2beta; +@com.google.protobuf.Generated public interface DenyRuleOrBuilder extends // @@protoc_insertion_point(interface_extends:google.iam.v2beta.DenyRule) @@ -29,36 +32,44 @@ public interface DenyRuleOrBuilder *
            * The identities that are prevented from using one or more permissions on
            * Google Cloud resources. This field can contain the following values:
        +   *
            * * `principalSet://goog/public:all`: A special identifier that represents
        -   *   any principal that is on the internet, even if they do not have a Google
        -   *   Account or are not logged in.
        +   * any principal that is on the internet, even if they do not have a Google
        +   * Account or are not logged in.
        +   *
            * * `principal://goog/subject/{email_id}`: A specific Google Account.
        -   *   Includes Gmail, Cloud Identity, and Google Workspace user accounts. For
        -   *   example, `principal://goog/subject/alice@example.com`.
        +   * Includes Gmail, Cloud Identity, and Google Workspace user accounts. For
        +   * example, `principal://goog/subject/alice@example.com`.
        +   *
            * * `deleted:principal://goog/subject/{email_id}?uid={uid}`: A specific
        -   *   Google Account that was deleted recently. For example,
        -   *   `deleted:principal://goog/subject/alice@example.com?uid=1234567890`. If
        -   *   the Google Account is recovered, this identifier reverts to the standard
        -   *   identifier for a Google Account.
        +   * Google Account that was deleted recently. For example,
        +   * `deleted:principal://goog/subject/alice@example.com?uid=1234567890`. If
        +   * the Google Account is recovered, this identifier reverts to the standard
        +   * identifier for a Google Account.
        +   *
            * * `principalSet://goog/group/{group_id}`: A Google group. For example,
        -   *   `principalSet://goog/group/admins@example.com`.
        +   * `principalSet://goog/group/admins@example.com`.
        +   *
            * * `deleted:principalSet://goog/group/{group_id}?uid={uid}`: A Google group
        -   *   that was deleted recently. For example,
        -   *   `deleted:principalSet://goog/group/admins@example.com?uid=1234567890`. If
        -   *   the Google group is restored, this identifier reverts to the standard
        -   *   identifier for a Google group.
        +   * that was deleted recently. For example,
        +   * `deleted:principalSet://goog/group/admins@example.com?uid=1234567890`. If
        +   * the Google group is restored, this identifier reverts to the standard
        +   * identifier for a Google group.
        +   *
            * * `principal://iam.googleapis.com/projects/-/serviceAccounts/{service_account_id}`:
        -   *   A Google Cloud service account. For example,
        -   *   `principal://iam.googleapis.com/projects/-/serviceAccounts/my-service-account@iam.gserviceaccount.com`.
        +   * A Google Cloud service account. For example,
        +   * `principal://iam.googleapis.com/projects/-/serviceAccounts/my-service-account@iam.gserviceaccount.com`.
        +   *
            * * `deleted:principal://iam.googleapis.com/projects/-/serviceAccounts/{service_account_id}?uid={uid}`:
        -   *   A Google Cloud service account that was deleted recently. For example,
        -   *   `deleted:principal://iam.googleapis.com/projects/-/serviceAccounts/my-service-account@iam.gserviceaccount.com?uid=1234567890`.
        -   *   If the service account is undeleted, this identifier reverts to the
        -   *   standard identifier for a service account.
        +   * A Google Cloud service account that was deleted recently. For example,
        +   * `deleted:principal://iam.googleapis.com/projects/-/serviceAccounts/my-service-account@iam.gserviceaccount.com?uid=1234567890`.
        +   * If the service account is undeleted, this identifier reverts to the
        +   * standard identifier for a service account.
        +   *
            * * `principalSet://goog/cloudIdentityCustomerId/{customer_id}`: All of the
        -   *   principals associated with the specified Google Workspace or Cloud
        -   *   Identity customer ID. For example,
        -   *   `principalSet://goog/cloudIdentityCustomerId/C01Abc35`.
        +   * principals associated with the specified Google Workspace or Cloud
        +   * Identity customer ID. For example,
        +   * `principalSet://goog/cloudIdentityCustomerId/C01Abc35`.
            * 
        * * repeated string denied_principals = 1; @@ -66,42 +77,51 @@ public interface DenyRuleOrBuilder * @return A list containing the deniedPrincipals. */ java.util.List getDeniedPrincipalsList(); + /** * * *
            * The identities that are prevented from using one or more permissions on
            * Google Cloud resources. This field can contain the following values:
        +   *
            * * `principalSet://goog/public:all`: A special identifier that represents
        -   *   any principal that is on the internet, even if they do not have a Google
        -   *   Account or are not logged in.
        +   * any principal that is on the internet, even if they do not have a Google
        +   * Account or are not logged in.
        +   *
            * * `principal://goog/subject/{email_id}`: A specific Google Account.
        -   *   Includes Gmail, Cloud Identity, and Google Workspace user accounts. For
        -   *   example, `principal://goog/subject/alice@example.com`.
        +   * Includes Gmail, Cloud Identity, and Google Workspace user accounts. For
        +   * example, `principal://goog/subject/alice@example.com`.
        +   *
            * * `deleted:principal://goog/subject/{email_id}?uid={uid}`: A specific
        -   *   Google Account that was deleted recently. For example,
        -   *   `deleted:principal://goog/subject/alice@example.com?uid=1234567890`. If
        -   *   the Google Account is recovered, this identifier reverts to the standard
        -   *   identifier for a Google Account.
        +   * Google Account that was deleted recently. For example,
        +   * `deleted:principal://goog/subject/alice@example.com?uid=1234567890`. If
        +   * the Google Account is recovered, this identifier reverts to the standard
        +   * identifier for a Google Account.
        +   *
            * * `principalSet://goog/group/{group_id}`: A Google group. For example,
        -   *   `principalSet://goog/group/admins@example.com`.
        +   * `principalSet://goog/group/admins@example.com`.
        +   *
            * * `deleted:principalSet://goog/group/{group_id}?uid={uid}`: A Google group
        -   *   that was deleted recently. For example,
        -   *   `deleted:principalSet://goog/group/admins@example.com?uid=1234567890`. If
        -   *   the Google group is restored, this identifier reverts to the standard
        -   *   identifier for a Google group.
        +   * that was deleted recently. For example,
        +   * `deleted:principalSet://goog/group/admins@example.com?uid=1234567890`. If
        +   * the Google group is restored, this identifier reverts to the standard
        +   * identifier for a Google group.
        +   *
            * * `principal://iam.googleapis.com/projects/-/serviceAccounts/{service_account_id}`:
        -   *   A Google Cloud service account. For example,
        -   *   `principal://iam.googleapis.com/projects/-/serviceAccounts/my-service-account@iam.gserviceaccount.com`.
        +   * A Google Cloud service account. For example,
        +   * `principal://iam.googleapis.com/projects/-/serviceAccounts/my-service-account@iam.gserviceaccount.com`.
        +   *
            * * `deleted:principal://iam.googleapis.com/projects/-/serviceAccounts/{service_account_id}?uid={uid}`:
        -   *   A Google Cloud service account that was deleted recently. For example,
        -   *   `deleted:principal://iam.googleapis.com/projects/-/serviceAccounts/my-service-account@iam.gserviceaccount.com?uid=1234567890`.
        -   *   If the service account is undeleted, this identifier reverts to the
        -   *   standard identifier for a service account.
        +   * A Google Cloud service account that was deleted recently. For example,
        +   * `deleted:principal://iam.googleapis.com/projects/-/serviceAccounts/my-service-account@iam.gserviceaccount.com?uid=1234567890`.
        +   * If the service account is undeleted, this identifier reverts to the
        +   * standard identifier for a service account.
        +   *
            * * `principalSet://goog/cloudIdentityCustomerId/{customer_id}`: All of the
        -   *   principals associated with the specified Google Workspace or Cloud
        -   *   Identity customer ID. For example,
        -   *   `principalSet://goog/cloudIdentityCustomerId/C01Abc35`.
        +   * principals associated with the specified Google Workspace or Cloud
        +   * Identity customer ID. For example,
        +   * `principalSet://goog/cloudIdentityCustomerId/C01Abc35`.
            * 
        * * repeated string denied_principals = 1; @@ -109,42 +129,51 @@ public interface DenyRuleOrBuilder * @return The count of deniedPrincipals. */ int getDeniedPrincipalsCount(); + /** * * *
            * The identities that are prevented from using one or more permissions on
            * Google Cloud resources. This field can contain the following values:
        +   *
            * * `principalSet://goog/public:all`: A special identifier that represents
        -   *   any principal that is on the internet, even if they do not have a Google
        -   *   Account or are not logged in.
        +   * any principal that is on the internet, even if they do not have a Google
        +   * Account or are not logged in.
        +   *
            * * `principal://goog/subject/{email_id}`: A specific Google Account.
        -   *   Includes Gmail, Cloud Identity, and Google Workspace user accounts. For
        -   *   example, `principal://goog/subject/alice@example.com`.
        +   * Includes Gmail, Cloud Identity, and Google Workspace user accounts. For
        +   * example, `principal://goog/subject/alice@example.com`.
        +   *
            * * `deleted:principal://goog/subject/{email_id}?uid={uid}`: A specific
        -   *   Google Account that was deleted recently. For example,
        -   *   `deleted:principal://goog/subject/alice@example.com?uid=1234567890`. If
        -   *   the Google Account is recovered, this identifier reverts to the standard
        -   *   identifier for a Google Account.
        +   * Google Account that was deleted recently. For example,
        +   * `deleted:principal://goog/subject/alice@example.com?uid=1234567890`. If
        +   * the Google Account is recovered, this identifier reverts to the standard
        +   * identifier for a Google Account.
        +   *
            * * `principalSet://goog/group/{group_id}`: A Google group. For example,
        -   *   `principalSet://goog/group/admins@example.com`.
        +   * `principalSet://goog/group/admins@example.com`.
        +   *
            * * `deleted:principalSet://goog/group/{group_id}?uid={uid}`: A Google group
        -   *   that was deleted recently. For example,
        -   *   `deleted:principalSet://goog/group/admins@example.com?uid=1234567890`. If
        -   *   the Google group is restored, this identifier reverts to the standard
        -   *   identifier for a Google group.
        +   * that was deleted recently. For example,
        +   * `deleted:principalSet://goog/group/admins@example.com?uid=1234567890`. If
        +   * the Google group is restored, this identifier reverts to the standard
        +   * identifier for a Google group.
        +   *
            * * `principal://iam.googleapis.com/projects/-/serviceAccounts/{service_account_id}`:
        -   *   A Google Cloud service account. For example,
        -   *   `principal://iam.googleapis.com/projects/-/serviceAccounts/my-service-account@iam.gserviceaccount.com`.
        +   * A Google Cloud service account. For example,
        +   * `principal://iam.googleapis.com/projects/-/serviceAccounts/my-service-account@iam.gserviceaccount.com`.
        +   *
            * * `deleted:principal://iam.googleapis.com/projects/-/serviceAccounts/{service_account_id}?uid={uid}`:
        -   *   A Google Cloud service account that was deleted recently. For example,
        -   *   `deleted:principal://iam.googleapis.com/projects/-/serviceAccounts/my-service-account@iam.gserviceaccount.com?uid=1234567890`.
        -   *   If the service account is undeleted, this identifier reverts to the
        -   *   standard identifier for a service account.
        +   * A Google Cloud service account that was deleted recently. For example,
        +   * `deleted:principal://iam.googleapis.com/projects/-/serviceAccounts/my-service-account@iam.gserviceaccount.com?uid=1234567890`.
        +   * If the service account is undeleted, this identifier reverts to the
        +   * standard identifier for a service account.
        +   *
            * * `principalSet://goog/cloudIdentityCustomerId/{customer_id}`: All of the
        -   *   principals associated with the specified Google Workspace or Cloud
        -   *   Identity customer ID. For example,
        -   *   `principalSet://goog/cloudIdentityCustomerId/C01Abc35`.
        +   * principals associated with the specified Google Workspace or Cloud
        +   * Identity customer ID. For example,
        +   * `principalSet://goog/cloudIdentityCustomerId/C01Abc35`.
            * 
        * * repeated string denied_principals = 1; @@ -153,42 +182,51 @@ public interface DenyRuleOrBuilder * @return The deniedPrincipals at the given index. */ java.lang.String getDeniedPrincipals(int index); + /** * * *
            * The identities that are prevented from using one or more permissions on
            * Google Cloud resources. This field can contain the following values:
        +   *
            * * `principalSet://goog/public:all`: A special identifier that represents
        -   *   any principal that is on the internet, even if they do not have a Google
        -   *   Account or are not logged in.
        +   * any principal that is on the internet, even if they do not have a Google
        +   * Account or are not logged in.
        +   *
            * * `principal://goog/subject/{email_id}`: A specific Google Account.
        -   *   Includes Gmail, Cloud Identity, and Google Workspace user accounts. For
        -   *   example, `principal://goog/subject/alice@example.com`.
        +   * Includes Gmail, Cloud Identity, and Google Workspace user accounts. For
        +   * example, `principal://goog/subject/alice@example.com`.
        +   *
            * * `deleted:principal://goog/subject/{email_id}?uid={uid}`: A specific
        -   *   Google Account that was deleted recently. For example,
        -   *   `deleted:principal://goog/subject/alice@example.com?uid=1234567890`. If
        -   *   the Google Account is recovered, this identifier reverts to the standard
        -   *   identifier for a Google Account.
        +   * Google Account that was deleted recently. For example,
        +   * `deleted:principal://goog/subject/alice@example.com?uid=1234567890`. If
        +   * the Google Account is recovered, this identifier reverts to the standard
        +   * identifier for a Google Account.
        +   *
            * * `principalSet://goog/group/{group_id}`: A Google group. For example,
        -   *   `principalSet://goog/group/admins@example.com`.
        +   * `principalSet://goog/group/admins@example.com`.
        +   *
            * * `deleted:principalSet://goog/group/{group_id}?uid={uid}`: A Google group
        -   *   that was deleted recently. For example,
        -   *   `deleted:principalSet://goog/group/admins@example.com?uid=1234567890`. If
        -   *   the Google group is restored, this identifier reverts to the standard
        -   *   identifier for a Google group.
        +   * that was deleted recently. For example,
        +   * `deleted:principalSet://goog/group/admins@example.com?uid=1234567890`. If
        +   * the Google group is restored, this identifier reverts to the standard
        +   * identifier for a Google group.
        +   *
            * * `principal://iam.googleapis.com/projects/-/serviceAccounts/{service_account_id}`:
        -   *   A Google Cloud service account. For example,
        -   *   `principal://iam.googleapis.com/projects/-/serviceAccounts/my-service-account@iam.gserviceaccount.com`.
        +   * A Google Cloud service account. For example,
        +   * `principal://iam.googleapis.com/projects/-/serviceAccounts/my-service-account@iam.gserviceaccount.com`.
        +   *
            * * `deleted:principal://iam.googleapis.com/projects/-/serviceAccounts/{service_account_id}?uid={uid}`:
        -   *   A Google Cloud service account that was deleted recently. For example,
        -   *   `deleted:principal://iam.googleapis.com/projects/-/serviceAccounts/my-service-account@iam.gserviceaccount.com?uid=1234567890`.
        -   *   If the service account is undeleted, this identifier reverts to the
        -   *   standard identifier for a service account.
        +   * A Google Cloud service account that was deleted recently. For example,
        +   * `deleted:principal://iam.googleapis.com/projects/-/serviceAccounts/my-service-account@iam.gserviceaccount.com?uid=1234567890`.
        +   * If the service account is undeleted, this identifier reverts to the
        +   * standard identifier for a service account.
        +   *
            * * `principalSet://goog/cloudIdentityCustomerId/{customer_id}`: All of the
        -   *   principals associated with the specified Google Workspace or Cloud
        -   *   Identity customer ID. For example,
        -   *   `principalSet://goog/cloudIdentityCustomerId/C01Abc35`.
        +   * principals associated with the specified Google Workspace or Cloud
        +   * Identity customer ID. For example,
        +   * `principalSet://goog/cloudIdentityCustomerId/C01Abc35`.
            * 
        * * repeated string denied_principals = 1; @@ -206,6 +244,7 @@ public interface DenyRuleOrBuilder * listed in the `denied_principals`. For example, you could add a Google * group to the `denied_principals`, then exclude specific users who belong to * that group. + * * This field can contain the same values as the `denied_principals` field, * excluding `principalSet://goog/public:all`, which represents all users on * the internet. @@ -216,6 +255,7 @@ public interface DenyRuleOrBuilder * @return A list containing the exceptionPrincipals. */ java.util.List getExceptionPrincipalsList(); + /** * * @@ -224,6 +264,7 @@ public interface DenyRuleOrBuilder * listed in the `denied_principals`. For example, you could add a Google * group to the `denied_principals`, then exclude specific users who belong to * that group. + * * This field can contain the same values as the `denied_principals` field, * excluding `principalSet://goog/public:all`, which represents all users on * the internet. @@ -234,6 +275,7 @@ public interface DenyRuleOrBuilder * @return The count of exceptionPrincipals. */ int getExceptionPrincipalsCount(); + /** * * @@ -242,6 +284,7 @@ public interface DenyRuleOrBuilder * listed in the `denied_principals`. For example, you could add a Google * group to the `denied_principals`, then exclude specific users who belong to * that group. + * * This field can contain the same values as the `denied_principals` field, * excluding `principalSet://goog/public:all`, which represents all users on * the internet. @@ -253,6 +296,7 @@ public interface DenyRuleOrBuilder * @return The exceptionPrincipals at the given index. */ java.lang.String getExceptionPrincipals(int index); + /** * * @@ -261,6 +305,7 @@ public interface DenyRuleOrBuilder * listed in the `denied_principals`. For example, you could add a Google * group to the `denied_principals`, then exclude specific users who belong to * that group. + * * This field can contain the same values as the `denied_principals` field, * excluding `principalSet://goog/public:all`, which represents all users on * the internet. @@ -288,6 +333,7 @@ public interface DenyRuleOrBuilder * @return A list containing the deniedPermissions. */ java.util.List getDeniedPermissionsList(); + /** * * @@ -303,6 +349,7 @@ public interface DenyRuleOrBuilder * @return The count of deniedPermissions. */ int getDeniedPermissionsCount(); + /** * * @@ -319,6 +366,7 @@ public interface DenyRuleOrBuilder * @return The deniedPermissions at the given index. */ java.lang.String getDeniedPermissions(int index); + /** * * @@ -344,6 +392,7 @@ public interface DenyRuleOrBuilder * permissions given by `denied_permissions`. If a permission appears in * `denied_permissions` _and_ in `exception_permissions` then it will _not_ be * denied. + * * The excluded permissions can be specified using the same syntax as * `denied_permissions`. * @@ -353,6 +402,7 @@ public interface DenyRuleOrBuilder * @return A list containing the exceptionPermissions. */ java.util.List getExceptionPermissionsList(); + /** * * @@ -361,6 +411,7 @@ public interface DenyRuleOrBuilder * permissions given by `denied_permissions`. If a permission appears in * `denied_permissions` _and_ in `exception_permissions` then it will _not_ be * denied. + * * The excluded permissions can be specified using the same syntax as * `denied_permissions`. * @@ -370,6 +421,7 @@ public interface DenyRuleOrBuilder * @return The count of exceptionPermissions. */ int getExceptionPermissionsCount(); + /** * * @@ -378,6 +430,7 @@ public interface DenyRuleOrBuilder * permissions given by `denied_permissions`. If a permission appears in * `denied_permissions` _and_ in `exception_permissions` then it will _not_ be * denied. + * * The excluded permissions can be specified using the same syntax as * `denied_permissions`. * @@ -388,6 +441,7 @@ public interface DenyRuleOrBuilder * @return The exceptionPermissions at the given index. */ java.lang.String getExceptionPermissions(int index); + /** * * @@ -396,6 +450,7 @@ public interface DenyRuleOrBuilder * permissions given by `denied_permissions`. If a permission appears in * `denied_permissions` _and_ in `exception_permissions` then it will _not_ be * denied. + * * The excluded permissions can be specified using the same syntax as * `denied_permissions`. * @@ -414,8 +469,10 @@ public interface DenyRuleOrBuilder * The condition that determines whether this deny rule applies to a request. * If the condition expression evaluates to `true`, then the deny rule is * applied; otherwise, the deny rule is not applied. + * * Each deny rule is evaluated independently. If this deny rule does not apply * to a request, other deny rules might still apply. + * * The condition can use CEL functions that evaluate * [resource * tags](https://cloud.google.com/iam/help/conditions/resource-tags). Other @@ -427,6 +484,7 @@ public interface DenyRuleOrBuilder * @return Whether the denialCondition field is set. */ boolean hasDenialCondition(); + /** * * @@ -434,8 +492,10 @@ public interface DenyRuleOrBuilder * The condition that determines whether this deny rule applies to a request. * If the condition expression evaluates to `true`, then the deny rule is * applied; otherwise, the deny rule is not applied. + * * Each deny rule is evaluated independently. If this deny rule does not apply * to a request, other deny rules might still apply. + * * The condition can use CEL functions that evaluate * [resource * tags](https://cloud.google.com/iam/help/conditions/resource-tags). Other @@ -447,6 +507,7 @@ public interface DenyRuleOrBuilder * @return The denialCondition. */ com.google.type.Expr getDenialCondition(); + /** * * @@ -454,8 +515,10 @@ public interface DenyRuleOrBuilder * The condition that determines whether this deny rule applies to a request. * If the condition expression evaluates to `true`, then the deny rule is * applied; otherwise, the deny rule is not applied. + * * Each deny rule is evaluated independently. If this deny rule does not apply * to a request, other deny rules might still apply. + * * The condition can use CEL functions that evaluate * [resource * tags](https://cloud.google.com/iam/help/conditions/resource-tags). Other diff --git a/java-iam/proto-google-iam-v2beta/src/main/java/com/google/iam/v2beta/DenyRuleProto.java b/java-iam/proto-google-iam-v2beta/src/main/java/com/google/iam/v2beta/DenyRuleProto.java index ef77af915a..28ff314dbf 100644 --- a/java-iam/proto-google-iam-v2beta/src/main/java/com/google/iam/v2beta/DenyRuleProto.java +++ b/java-iam/proto-google-iam-v2beta/src/main/java/com/google/iam/v2beta/DenyRuleProto.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,13 +14,26 @@ * limitations under the License. */ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: google/iam/v2beta/deny.proto +// Protobuf Java Version: 4.33.2 package com.google.iam.v2beta; -public final class DenyRuleProto { +@com.google.protobuf.Generated +public final class DenyRuleProto extends com.google.protobuf.GeneratedFile { private DenyRuleProto() {} + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "DenyRuleProto"); + } + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistryLite registry) {} public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry registry) { @@ -29,7 +42,7 @@ public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry r static final com.google.protobuf.Descriptors.Descriptor internal_static_google_iam_v2beta_DenyRule_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable internal_static_google_iam_v2beta_DenyRule_fieldAccessorTable; public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { @@ -46,11 +59,10 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + "eption_principals\030\002 \003(\t\022\032\n\022denied_permis" + "sions\030\003 \003(\t\022\035\n\025exception_permissions\030\004 \003" + "(\t\022+\n\020denial_condition\030\005 \001(\0132\021.google.ty" - + "pe.ExprB\222\001\n\025com.google.iam.v2betaB\rDenyR" - + "uleProtoP\001Z4google.golang.org/genproto/g" - + "oogleapis/iam/v2beta;iam\252\002\027Google.Cloud." - + "Iam.V2Beta\312\002\027Google\\Cloud\\Iam\\V2betab\006pr" - + "oto3" + + "pe.ExprB\213\001\n\025com.google.iam.v2betaB\rDenyR" + + "uleProtoP\001Z-cloud.google.com/go/iam/apiv" + + "2beta/iampb;iampb\252\002\027Google.Cloud.Iam.V2B" + + "eta\312\002\027Google\\Cloud\\Iam\\V2betab\006proto3" }; descriptor = com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( @@ -58,10 +70,9 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { new com.google.protobuf.Descriptors.FileDescriptor[] { com.google.type.ExprProto.getDescriptor(), }); - internal_static_google_iam_v2beta_DenyRule_descriptor = - getDescriptor().getMessageTypes().get(0); + internal_static_google_iam_v2beta_DenyRule_descriptor = getDescriptor().getMessageType(0); internal_static_google_iam_v2beta_DenyRule_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_google_iam_v2beta_DenyRule_descriptor, new java.lang.String[] { "DeniedPrincipals", @@ -70,6 +81,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "ExceptionPermissions", "DenialCondition", }); + descriptor.resolveAllFeaturesImmutable(); com.google.type.ExprProto.getDescriptor(); } diff --git a/java-iam/proto-google-iam-v2beta/src/main/java/com/google/iam/v2beta/GetPolicyRequest.java b/java-iam/proto-google-iam-v2beta/src/main/java/com/google/iam/v2beta/GetPolicyRequest.java index b579600e91..bf6df7a089 100644 --- a/java-iam/proto-google-iam-v2beta/src/main/java/com/google/iam/v2beta/GetPolicyRequest.java +++ b/java-iam/proto-google-iam-v2beta/src/main/java/com/google/iam/v2beta/GetPolicyRequest.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,9 @@ * limitations under the License. */ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: google/iam/v2beta/policy.proto +// Protobuf Java Version: 4.33.2 package com.google.iam.v2beta; @@ -27,13 +29,25 @@ * * Protobuf type {@code google.iam.v2beta.GetPolicyRequest} */ -public final class GetPolicyRequest extends com.google.protobuf.GeneratedMessageV3 +@com.google.protobuf.Generated +public final class GetPolicyRequest extends com.google.protobuf.GeneratedMessage implements // @@protoc_insertion_point(message_implements:google.iam.v2beta.GetPolicyRequest) GetPolicyRequestOrBuilder { private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "GetPolicyRequest"); + } + // Use GetPolicyRequest.newBuilder() to construct. - private GetPolicyRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + private GetPolicyRequest(com.google.protobuf.GeneratedMessage.Builder builder) { super(builder); } @@ -41,24 +55,13 @@ private GetPolicyRequest() { name_ = ""; } - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new GetPolicyRequest(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.iam.v2beta.PolicyProto .internal_static_google_iam_v2beta_GetPolicyRequest_descriptor; } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.iam.v2beta.PolicyProto .internal_static_google_iam_v2beta_GetPolicyRequest_fieldAccessorTable @@ -68,16 +71,22 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } public static final int NAME_FIELD_NUMBER = 1; - private volatile java.lang.Object name_; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** * * *
            * Required. The resource name of the policy to retrieve. Format:
            * `policies/{attachment_point}/denypolicies/{policy_id}`
        +   *
        +   *
            * Use the URL-encoded full resource name, which means that the forward-slash
            * character, `/`, must be written as `%2F`. For example,
            * `policies/cloudresourcemanager.googleapis.com%2Fprojects%2Fmy-project/denypolicies/my-policy`.
        +   *
            * For organizations and folders, use the numeric ID in the full resource
            * name. For projects, you can use the alphanumeric or the numeric ID.
            * 
        @@ -98,15 +107,19 @@ public java.lang.String getName() { return s; } } + /** * * *
            * Required. The resource name of the policy to retrieve. Format:
            * `policies/{attachment_point}/denypolicies/{policy_id}`
        +   *
        +   *
            * Use the URL-encoded full resource name, which means that the forward-slash
            * character, `/`, must be written as `%2F`. For example,
            * `policies/cloudresourcemanager.googleapis.com%2Fprojects%2Fmy-project/denypolicies/my-policy`.
        +   *
            * For organizations and folders, use the numeric ID in the full resource
            * name. For projects, you can use the alphanumeric or the numeric ID.
            * 
        @@ -142,8 +155,8 @@ public final boolean isInitialized() { @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.GeneratedMessage.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, name_); } getUnknownFields().writeTo(output); } @@ -154,8 +167,8 @@ public int getSerializedSize() { 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.GeneratedMessage.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, name_); } size += getUnknownFields().getSerializedSize(); memoizedSize = size; @@ -228,38 +241,38 @@ public static com.google.iam.v2beta.GetPolicyRequest parseFrom( public static com.google.iam.v2beta.GetPolicyRequest parseFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); } public static com.google.iam.v2beta.GetPolicyRequest parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } public static com.google.iam.v2beta.GetPolicyRequest parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); } public static com.google.iam.v2beta.GetPolicyRequest parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( PARSER, input, extensionRegistry); } public static com.google.iam.v2beta.GetPolicyRequest parseFrom( com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); } public static com.google.iam.v2beta.GetPolicyRequest parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } @@ -282,10 +295,11 @@ public Builder toBuilder() { } @java.lang.Override - protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { Builder builder = new Builder(parent); return builder; } + /** * * @@ -295,7 +309,7 @@ protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.Build * * Protobuf type {@code google.iam.v2beta.GetPolicyRequest} */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder implements // @@protoc_insertion_point(builder_implements:google.iam.v2beta.GetPolicyRequest) com.google.iam.v2beta.GetPolicyRequestOrBuilder { @@ -305,7 +319,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.iam.v2beta.PolicyProto .internal_static_google_iam_v2beta_GetPolicyRequest_fieldAccessorTable @@ -317,15 +331,15 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { // Construct using com.google.iam.v2beta.GetPolicyRequest.newBuilder() private Builder() {} - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { super(parent); } @java.lang.Override public Builder clear() { super.clear(); + bitField0_ = 0; name_ = ""; - return this; } @@ -353,42 +367,18 @@ public com.google.iam.v2beta.GetPolicyRequest build() { public com.google.iam.v2beta.GetPolicyRequest buildPartial() { com.google.iam.v2beta.GetPolicyRequest result = new com.google.iam.v2beta.GetPolicyRequest(this); - result.name_ = name_; + if (bitField0_ != 0) { + buildPartial0(result); + } 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); + private void buildPartial0(com.google.iam.v2beta.GetPolicyRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } } @java.lang.Override @@ -405,6 +395,7 @@ public Builder mergeFrom(com.google.iam.v2beta.GetPolicyRequest other) { if (other == com.google.iam.v2beta.GetPolicyRequest.getDefaultInstance()) return this; if (!other.getName().isEmpty()) { name_ = other.name_; + bitField0_ |= 0x00000001; onChanged(); } this.mergeUnknownFields(other.getUnknownFields()); @@ -436,7 +427,7 @@ public Builder mergeFrom( case 10: { name_ = input.readStringRequireUtf8(); - + bitField0_ |= 0x00000001; break; } // case 10 default: @@ -456,16 +447,22 @@ public Builder mergeFrom( return this; } + private int bitField0_; + private java.lang.Object name_ = ""; + /** * * *
              * Required. The resource name of the policy to retrieve. Format:
              * `policies/{attachment_point}/denypolicies/{policy_id}`
        +     *
        +     *
              * Use the URL-encoded full resource name, which means that the forward-slash
              * character, `/`, must be written as `%2F`. For example,
              * `policies/cloudresourcemanager.googleapis.com%2Fprojects%2Fmy-project/denypolicies/my-policy`.
        +     *
              * For organizations and folders, use the numeric ID in the full resource
              * name. For projects, you can use the alphanumeric or the numeric ID.
              * 
        @@ -485,15 +482,19 @@ public java.lang.String getName() { return (java.lang.String) ref; } } + /** * * *
              * Required. The resource name of the policy to retrieve. Format:
              * `policies/{attachment_point}/denypolicies/{policy_id}`
        +     *
        +     *
              * Use the URL-encoded full resource name, which means that the forward-slash
              * character, `/`, must be written as `%2F`. For example,
              * `policies/cloudresourcemanager.googleapis.com%2Fprojects%2Fmy-project/denypolicies/my-policy`.
        +     *
              * For organizations and folders, use the numeric ID in the full resource
              * name. For projects, you can use the alphanumeric or the numeric ID.
              * 
        @@ -513,15 +514,19 @@ public com.google.protobuf.ByteString getNameBytes() { return (com.google.protobuf.ByteString) ref; } } + /** * * *
              * Required. The resource name of the policy to retrieve. Format:
              * `policies/{attachment_point}/denypolicies/{policy_id}`
        +     *
        +     *
              * Use the URL-encoded full resource name, which means that the forward-slash
              * character, `/`, must be written as `%2F`. For example,
              * `policies/cloudresourcemanager.googleapis.com%2Fprojects%2Fmy-project/denypolicies/my-policy`.
        +     *
              * For organizations and folders, use the numeric ID in the full resource
              * name. For projects, you can use the alphanumeric or the numeric ID.
              * 
        @@ -535,20 +540,24 @@ 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 to retrieve. Format:
              * `policies/{attachment_point}/denypolicies/{policy_id}`
        +     *
        +     *
              * Use the URL-encoded full resource name, which means that the forward-slash
              * character, `/`, must be written as `%2F`. For example,
              * `policies/cloudresourcemanager.googleapis.com%2Fprojects%2Fmy-project/denypolicies/my-policy`.
        +     *
              * For organizations and folders, use the numeric ID in the full resource
              * name. For projects, you can use the alphanumeric or the numeric ID.
              * 
        @@ -558,20 +567,24 @@ public Builder setName(java.lang.String value) { * @return This builder for chaining. */ public Builder clearName() { - name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); onChanged(); return this; } + /** * * *
              * Required. The resource name of the policy to retrieve. Format:
              * `policies/{attachment_point}/denypolicies/{policy_id}`
        +     *
        +     *
              * Use the URL-encoded full resource name, which means that the forward-slash
              * character, `/`, must be written as `%2F`. For example,
              * `policies/cloudresourcemanager.googleapis.com%2Fprojects%2Fmy-project/denypolicies/my-policy`.
        +     *
              * For organizations and folders, use the numeric ID in the full resource
              * name. For projects, you can use the alphanumeric or the numeric ID.
              * 
        @@ -586,23 +599,12 @@ public Builder setNameBytes(com.google.protobuf.ByteString value) { 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.iam.v2beta.GetPolicyRequest) } diff --git a/java-iam/proto-google-iam-v2beta/src/main/java/com/google/iam/v2beta/GetPolicyRequestOrBuilder.java b/java-iam/proto-google-iam-v2beta/src/main/java/com/google/iam/v2beta/GetPolicyRequestOrBuilder.java index def786214b..d0ae9bb6c0 100644 --- a/java-iam/proto-google-iam-v2beta/src/main/java/com/google/iam/v2beta/GetPolicyRequestOrBuilder.java +++ b/java-iam/proto-google-iam-v2beta/src/main/java/com/google/iam/v2beta/GetPolicyRequestOrBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,10 +14,13 @@ * limitations under the License. */ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: google/iam/v2beta/policy.proto +// Protobuf Java Version: 4.33.2 package com.google.iam.v2beta; +@com.google.protobuf.Generated public interface GetPolicyRequestOrBuilder extends // @@protoc_insertion_point(interface_extends:google.iam.v2beta.GetPolicyRequest) @@ -29,9 +32,12 @@ public interface GetPolicyRequestOrBuilder *
            * Required. The resource name of the policy to retrieve. Format:
            * `policies/{attachment_point}/denypolicies/{policy_id}`
        +   *
        +   *
            * Use the URL-encoded full resource name, which means that the forward-slash
            * character, `/`, must be written as `%2F`. For example,
            * `policies/cloudresourcemanager.googleapis.com%2Fprojects%2Fmy-project/denypolicies/my-policy`.
        +   *
            * For organizations and folders, use the numeric ID in the full resource
            * name. For projects, you can use the alphanumeric or the numeric ID.
            * 
        @@ -41,15 +47,19 @@ public interface GetPolicyRequestOrBuilder * @return The name. */ java.lang.String getName(); + /** * * *
            * Required. The resource name of the policy to retrieve. Format:
            * `policies/{attachment_point}/denypolicies/{policy_id}`
        +   *
        +   *
            * Use the URL-encoded full resource name, which means that the forward-slash
            * character, `/`, must be written as `%2F`. For example,
            * `policies/cloudresourcemanager.googleapis.com%2Fprojects%2Fmy-project/denypolicies/my-policy`.
        +   *
            * For organizations and folders, use the numeric ID in the full resource
            * name. For projects, you can use the alphanumeric or the numeric ID.
            * 
        diff --git a/java-iam/proto-google-iam-v2beta/src/main/java/com/google/iam/v2beta/ListPoliciesRequest.java b/java-iam/proto-google-iam-v2beta/src/main/java/com/google/iam/v2beta/ListPoliciesRequest.java index c66f7d36cd..ccb7a8ba60 100644 --- a/java-iam/proto-google-iam-v2beta/src/main/java/com/google/iam/v2beta/ListPoliciesRequest.java +++ b/java-iam/proto-google-iam-v2beta/src/main/java/com/google/iam/v2beta/ListPoliciesRequest.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,9 @@ * limitations under the License. */ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: google/iam/v2beta/policy.proto +// Protobuf Java Version: 4.33.2 package com.google.iam.v2beta; @@ -27,13 +29,25 @@ * * Protobuf type {@code google.iam.v2beta.ListPoliciesRequest} */ -public final class ListPoliciesRequest extends com.google.protobuf.GeneratedMessageV3 +@com.google.protobuf.Generated +public final class ListPoliciesRequest extends com.google.protobuf.GeneratedMessage implements // @@protoc_insertion_point(message_implements:google.iam.v2beta.ListPoliciesRequest) ListPoliciesRequestOrBuilder { private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "ListPoliciesRequest"); + } + // Use ListPoliciesRequest.newBuilder() to construct. - private ListPoliciesRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + private ListPoliciesRequest(com.google.protobuf.GeneratedMessage.Builder builder) { super(builder); } @@ -42,24 +56,13 @@ private ListPoliciesRequest() { pageToken_ = ""; } - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new ListPoliciesRequest(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.iam.v2beta.PolicyProto .internal_static_google_iam_v2beta_ListPoliciesRequest_descriptor; } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.iam.v2beta.PolicyProto .internal_static_google_iam_v2beta_ListPoliciesRequest_fieldAccessorTable @@ -69,7 +72,10 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } public static final int PARENT_FIELD_NUMBER = 1; - private volatile java.lang.Object parent_; + + @SuppressWarnings("serial") + private volatile java.lang.Object parent_ = ""; + /** * * @@ -77,10 +83,13 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { * Required. The resource that the policy is attached to, along with the kind of policy * to list. Format: * `policies/{attachment_point}/denypolicies` + * + * * The attachment point is identified by its URL-encoded full resource name, * which means that the forward-slash character, `/`, must be written as * `%2F`. For example, * `policies/cloudresourcemanager.googleapis.com%2Fprojects%2Fmy-project/denypolicies`. + * * For organizations and folders, use the numeric ID in the full resource * name. For projects, you can use the alphanumeric or the numeric ID. * @@ -101,6 +110,7 @@ public java.lang.String getParent() { return s; } } + /** * * @@ -108,10 +118,13 @@ public java.lang.String getParent() { * Required. The resource that the policy is attached to, along with the kind of policy * to list. Format: * `policies/{attachment_point}/denypolicies` + * + * * The attachment point is identified by its URL-encoded full resource name, * which means that the forward-slash character, `/`, must be written as * `%2F`. For example, * `policies/cloudresourcemanager.googleapis.com%2Fprojects%2Fmy-project/denypolicies`. + * * For organizations and folders, use the numeric ID in the full resource * name. For projects, you can use the alphanumeric or the numeric ID. * @@ -134,7 +147,8 @@ public com.google.protobuf.ByteString getParentBytes() { } public static final int PAGE_SIZE_FIELD_NUMBER = 2; - private int pageSize_; + private int pageSize_ = 0; + /** * * @@ -153,7 +167,10 @@ public int getPageSize() { } public static final int PAGE_TOKEN_FIELD_NUMBER = 3; - private volatile java.lang.Object pageToken_; + + @SuppressWarnings("serial") + private volatile java.lang.Object pageToken_ = ""; + /** * * @@ -178,6 +195,7 @@ public java.lang.String getPageToken() { return s; } } + /** * * @@ -217,14 +235,14 @@ public final boolean isInitialized() { @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.GeneratedMessage.isStringEmpty(parent_)) { + com.google.protobuf.GeneratedMessage.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_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(pageToken_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 3, pageToken_); } getUnknownFields().writeTo(output); } @@ -235,14 +253,14 @@ public int getSerializedSize() { 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.GeneratedMessage.isStringEmpty(parent_)) { + size += com.google.protobuf.GeneratedMessage.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_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(pageToken_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(3, pageToken_); } size += getUnknownFields().getSerializedSize(); memoizedSize = size; @@ -322,38 +340,38 @@ public static com.google.iam.v2beta.ListPoliciesRequest parseFrom( public static com.google.iam.v2beta.ListPoliciesRequest parseFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); } public static com.google.iam.v2beta.ListPoliciesRequest parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } public static com.google.iam.v2beta.ListPoliciesRequest parseDelimitedFrom( java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); } public static com.google.iam.v2beta.ListPoliciesRequest parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( PARSER, input, extensionRegistry); } public static com.google.iam.v2beta.ListPoliciesRequest parseFrom( com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); } public static com.google.iam.v2beta.ListPoliciesRequest parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } @@ -376,10 +394,11 @@ public Builder toBuilder() { } @java.lang.Override - protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { Builder builder = new Builder(parent); return builder; } + /** * * @@ -389,7 +408,7 @@ protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.Build * * Protobuf type {@code google.iam.v2beta.ListPoliciesRequest} */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder implements // @@protoc_insertion_point(builder_implements:google.iam.v2beta.ListPoliciesRequest) com.google.iam.v2beta.ListPoliciesRequestOrBuilder { @@ -399,7 +418,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.iam.v2beta.PolicyProto .internal_static_google_iam_v2beta_ListPoliciesRequest_fieldAccessorTable @@ -411,19 +430,17 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { // Construct using com.google.iam.v2beta.ListPoliciesRequest.newBuilder() private Builder() {} - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { super(parent); } @java.lang.Override public Builder clear() { super.clear(); + bitField0_ = 0; parent_ = ""; - pageSize_ = 0; - pageToken_ = ""; - return this; } @@ -451,44 +468,24 @@ public com.google.iam.v2beta.ListPoliciesRequest build() { public com.google.iam.v2beta.ListPoliciesRequest buildPartial() { com.google.iam.v2beta.ListPoliciesRequest result = new com.google.iam.v2beta.ListPoliciesRequest(this); - result.parent_ = parent_; - result.pageSize_ = pageSize_; - result.pageToken_ = pageToken_; + if (bitField0_ != 0) { + buildPartial0(result); + } 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); + private void buildPartial0(com.google.iam.v2beta.ListPoliciesRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.parent_ = parent_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.pageSize_ = pageSize_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.pageToken_ = pageToken_; + } } @java.lang.Override @@ -505,6 +502,7 @@ public Builder mergeFrom(com.google.iam.v2beta.ListPoliciesRequest other) { if (other == com.google.iam.v2beta.ListPoliciesRequest.getDefaultInstance()) return this; if (!other.getParent().isEmpty()) { parent_ = other.parent_; + bitField0_ |= 0x00000001; onChanged(); } if (other.getPageSize() != 0) { @@ -512,6 +510,7 @@ public Builder mergeFrom(com.google.iam.v2beta.ListPoliciesRequest other) { } if (!other.getPageToken().isEmpty()) { pageToken_ = other.pageToken_; + bitField0_ |= 0x00000004; onChanged(); } this.mergeUnknownFields(other.getUnknownFields()); @@ -543,19 +542,19 @@ public Builder mergeFrom( case 10: { parent_ = input.readStringRequireUtf8(); - + bitField0_ |= 0x00000001; break; } // case 10 case 16: { pageSize_ = input.readInt32(); - + bitField0_ |= 0x00000002; break; } // case 16 case 26: { pageToken_ = input.readStringRequireUtf8(); - + bitField0_ |= 0x00000004; break; } // case 26 default: @@ -575,7 +574,10 @@ public Builder mergeFrom( return this; } + private int bitField0_; + private java.lang.Object parent_ = ""; + /** * * @@ -583,10 +585,13 @@ public Builder mergeFrom( * Required. The resource that the policy is attached to, along with the kind of policy * to list. Format: * `policies/{attachment_point}/denypolicies` + * + * * The attachment point is identified by its URL-encoded full resource name, * which means that the forward-slash character, `/`, must be written as * `%2F`. For example, * `policies/cloudresourcemanager.googleapis.com%2Fprojects%2Fmy-project/denypolicies`. + * * For organizations and folders, use the numeric ID in the full resource * name. For projects, you can use the alphanumeric or the numeric ID. * @@ -606,6 +611,7 @@ public java.lang.String getParent() { return (java.lang.String) ref; } } + /** * * @@ -613,10 +619,13 @@ public java.lang.String getParent() { * Required. The resource that the policy is attached to, along with the kind of policy * to list. Format: * `policies/{attachment_point}/denypolicies` + * + * * The attachment point is identified by its URL-encoded full resource name, * which means that the forward-slash character, `/`, must be written as * `%2F`. For example, * `policies/cloudresourcemanager.googleapis.com%2Fprojects%2Fmy-project/denypolicies`. + * * For organizations and folders, use the numeric ID in the full resource * name. For projects, you can use the alphanumeric or the numeric ID. * @@ -636,6 +645,7 @@ public com.google.protobuf.ByteString getParentBytes() { return (com.google.protobuf.ByteString) ref; } } + /** * * @@ -643,10 +653,13 @@ public com.google.protobuf.ByteString getParentBytes() { * Required. The resource that the policy is attached to, along with the kind of policy * to list. Format: * `policies/{attachment_point}/denypolicies` + * + * * The attachment point is identified by its URL-encoded full resource name, * which means that the forward-slash character, `/`, must be written as * `%2F`. For example, * `policies/cloudresourcemanager.googleapis.com%2Fprojects%2Fmy-project/denypolicies`. + * * For organizations and folders, use the numeric ID in the full resource * name. For projects, you can use the alphanumeric or the numeric ID. * @@ -660,11 +673,12 @@ public Builder setParent(java.lang.String value) { if (value == null) { throw new NullPointerException(); } - parent_ = value; + bitField0_ |= 0x00000001; onChanged(); return this; } + /** * * @@ -672,10 +686,13 @@ public Builder setParent(java.lang.String value) { * Required. The resource that the policy is attached to, along with the kind of policy * to list. Format: * `policies/{attachment_point}/denypolicies` + * + * * The attachment point is identified by its URL-encoded full resource name, * which means that the forward-slash character, `/`, must be written as * `%2F`. For example, * `policies/cloudresourcemanager.googleapis.com%2Fprojects%2Fmy-project/denypolicies`. + * * For organizations and folders, use the numeric ID in the full resource * name. For projects, you can use the alphanumeric or the numeric ID. * @@ -685,11 +702,12 @@ public Builder setParent(java.lang.String value) { * @return This builder for chaining. */ public Builder clearParent() { - parent_ = getDefaultInstance().getParent(); + bitField0_ = (bitField0_ & ~0x00000001); onChanged(); return this; } + /** * * @@ -697,10 +715,13 @@ public Builder clearParent() { * Required. The resource that the policy is attached to, along with the kind of policy * to list. Format: * `policies/{attachment_point}/denypolicies` + * + * * The attachment point is identified by its URL-encoded full resource name, * which means that the forward-slash character, `/`, must be written as * `%2F`. For example, * `policies/cloudresourcemanager.googleapis.com%2Fprojects%2Fmy-project/denypolicies`. + * * For organizations and folders, use the numeric ID in the full resource * name. For projects, you can use the alphanumeric or the numeric ID. * @@ -715,13 +736,14 @@ public Builder setParentBytes(com.google.protobuf.ByteString value) { throw new NullPointerException(); } checkByteStringIsUtf8(value); - parent_ = value; + bitField0_ |= 0x00000001; onChanged(); return this; } private int pageSize_; + /** * * @@ -738,6 +760,7 @@ public Builder setParentBytes(com.google.protobuf.ByteString value) { public int getPageSize() { return pageSize_; } + /** * * @@ -754,9 +777,11 @@ public int getPageSize() { public Builder setPageSize(int value) { pageSize_ = value; + bitField0_ |= 0x00000002; onChanged(); return this; } + /** * * @@ -770,13 +795,14 @@ public Builder setPageSize(int value) { * @return This builder for chaining. */ public Builder clearPageSize() { - + bitField0_ = (bitField0_ & ~0x00000002); pageSize_ = 0; onChanged(); return this; } private java.lang.Object pageToken_ = ""; + /** * * @@ -800,6 +826,7 @@ public java.lang.String getPageToken() { return (java.lang.String) ref; } } + /** * * @@ -823,6 +850,7 @@ public com.google.protobuf.ByteString getPageTokenBytes() { return (com.google.protobuf.ByteString) ref; } } + /** * * @@ -840,11 +868,12 @@ public Builder setPageToken(java.lang.String value) { if (value == null) { throw new NullPointerException(); } - pageToken_ = value; + bitField0_ |= 0x00000004; onChanged(); return this; } + /** * * @@ -858,11 +887,12 @@ public Builder setPageToken(java.lang.String value) { * @return This builder for chaining. */ public Builder clearPageToken() { - pageToken_ = getDefaultInstance().getPageToken(); + bitField0_ = (bitField0_ & ~0x00000004); onChanged(); return this; } + /** * * @@ -881,23 +911,12 @@ public Builder setPageTokenBytes(com.google.protobuf.ByteString value) { throw new NullPointerException(); } checkByteStringIsUtf8(value); - pageToken_ = 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.iam.v2beta.ListPoliciesRequest) } diff --git a/java-iam/proto-google-iam-v2beta/src/main/java/com/google/iam/v2beta/ListPoliciesRequestOrBuilder.java b/java-iam/proto-google-iam-v2beta/src/main/java/com/google/iam/v2beta/ListPoliciesRequestOrBuilder.java index 3090b50243..97904c46e9 100644 --- a/java-iam/proto-google-iam-v2beta/src/main/java/com/google/iam/v2beta/ListPoliciesRequestOrBuilder.java +++ b/java-iam/proto-google-iam-v2beta/src/main/java/com/google/iam/v2beta/ListPoliciesRequestOrBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,10 +14,13 @@ * limitations under the License. */ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: google/iam/v2beta/policy.proto +// Protobuf Java Version: 4.33.2 package com.google.iam.v2beta; +@com.google.protobuf.Generated public interface ListPoliciesRequestOrBuilder extends // @@protoc_insertion_point(interface_extends:google.iam.v2beta.ListPoliciesRequest) @@ -30,10 +33,13 @@ public interface ListPoliciesRequestOrBuilder * Required. The resource that the policy is attached to, along with the kind of policy * to list. Format: * `policies/{attachment_point}/denypolicies` + * + * * The attachment point is identified by its URL-encoded full resource name, * which means that the forward-slash character, `/`, must be written as * `%2F`. For example, * `policies/cloudresourcemanager.googleapis.com%2Fprojects%2Fmy-project/denypolicies`. + * * For organizations and folders, use the numeric ID in the full resource * name. For projects, you can use the alphanumeric or the numeric ID. * @@ -43,6 +49,7 @@ public interface ListPoliciesRequestOrBuilder * @return The parent. */ java.lang.String getParent(); + /** * * @@ -50,10 +57,13 @@ public interface ListPoliciesRequestOrBuilder * Required. The resource that the policy is attached to, along with the kind of policy * to list. Format: * `policies/{attachment_point}/denypolicies` + * + * * The attachment point is identified by its URL-encoded full resource name, * which means that the forward-slash character, `/`, must be written as * `%2F`. For example, * `policies/cloudresourcemanager.googleapis.com%2Fprojects%2Fmy-project/denypolicies`. + * * For organizations and folders, use the numeric ID in the full resource * name. For projects, you can use the alphanumeric or the numeric ID. * @@ -91,6 +101,7 @@ public interface ListPoliciesRequestOrBuilder * @return The pageToken. */ java.lang.String getPageToken(); + /** * * diff --git a/java-iam/proto-google-iam-v2beta/src/main/java/com/google/iam/v2beta/ListPoliciesResponse.java b/java-iam/proto-google-iam-v2beta/src/main/java/com/google/iam/v2beta/ListPoliciesResponse.java index b7559c5045..0e3d45f31c 100644 --- a/java-iam/proto-google-iam-v2beta/src/main/java/com/google/iam/v2beta/ListPoliciesResponse.java +++ b/java-iam/proto-google-iam-v2beta/src/main/java/com/google/iam/v2beta/ListPoliciesResponse.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,9 @@ * limitations under the License. */ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: google/iam/v2beta/policy.proto +// Protobuf Java Version: 4.33.2 package com.google.iam.v2beta; @@ -27,13 +29,25 @@ * * Protobuf type {@code google.iam.v2beta.ListPoliciesResponse} */ -public final class ListPoliciesResponse extends com.google.protobuf.GeneratedMessageV3 +@com.google.protobuf.Generated +public final class ListPoliciesResponse extends com.google.protobuf.GeneratedMessage implements // @@protoc_insertion_point(message_implements:google.iam.v2beta.ListPoliciesResponse) ListPoliciesResponseOrBuilder { private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "ListPoliciesResponse"); + } + // Use ListPoliciesResponse.newBuilder() to construct. - private ListPoliciesResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + private ListPoliciesResponse(com.google.protobuf.GeneratedMessage.Builder builder) { super(builder); } @@ -42,24 +56,13 @@ private ListPoliciesResponse() { nextPageToken_ = ""; } - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new ListPoliciesResponse(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.iam.v2beta.PolicyProto .internal_static_google_iam_v2beta_ListPoliciesResponse_descriptor; } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.iam.v2beta.PolicyProto .internal_static_google_iam_v2beta_ListPoliciesResponse_fieldAccessorTable @@ -69,7 +72,10 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } public static final int POLICIES_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") private java.util.List policies_; + /** * * @@ -83,6 +89,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { public java.util.List getPoliciesList() { return policies_; } + /** * * @@ -97,6 +104,7 @@ public java.util.List getPoliciesList() { getPoliciesOrBuilderList() { return policies_; } + /** * * @@ -110,6 +118,7 @@ public java.util.List getPoliciesList() { public int getPoliciesCount() { return policies_.size(); } + /** * * @@ -123,6 +132,7 @@ public int getPoliciesCount() { public com.google.iam.v2beta.Policy getPolicies(int index) { return policies_.get(index); } + /** * * @@ -138,7 +148,10 @@ public com.google.iam.v2beta.PolicyOrBuilder getPoliciesOrBuilder(int index) { } public static final int NEXT_PAGE_TOKEN_FIELD_NUMBER = 2; - private volatile java.lang.Object nextPageToken_; + + @SuppressWarnings("serial") + private volatile java.lang.Object nextPageToken_ = ""; + /** * * @@ -163,6 +176,7 @@ public java.lang.String getNextPageToken() { return s; } } + /** * * @@ -205,8 +219,8 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io for (int i = 0; i < policies_.size(); i++) { output.writeMessage(1, policies_.get(i)); } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nextPageToken_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 2, nextPageToken_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(nextPageToken_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, nextPageToken_); } getUnknownFields().writeTo(output); } @@ -220,8 +234,8 @@ public int getSerializedSize() { for (int i = 0; i < policies_.size(); i++) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, policies_.get(i)); } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nextPageToken_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, nextPageToken_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(nextPageToken_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, nextPageToken_); } size += getUnknownFields().getSerializedSize(); memoizedSize = size; @@ -300,38 +314,38 @@ public static com.google.iam.v2beta.ListPoliciesResponse parseFrom( public static com.google.iam.v2beta.ListPoliciesResponse parseFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); } public static com.google.iam.v2beta.ListPoliciesResponse parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } public static com.google.iam.v2beta.ListPoliciesResponse parseDelimitedFrom( java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); } public static com.google.iam.v2beta.ListPoliciesResponse parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( PARSER, input, extensionRegistry); } public static com.google.iam.v2beta.ListPoliciesResponse parseFrom( com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); } public static com.google.iam.v2beta.ListPoliciesResponse parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } @@ -354,10 +368,11 @@ public Builder toBuilder() { } @java.lang.Override - protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { Builder builder = new Builder(parent); return builder; } + /** * * @@ -367,7 +382,7 @@ protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.Build * * Protobuf type {@code google.iam.v2beta.ListPoliciesResponse} */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder implements // @@protoc_insertion_point(builder_implements:google.iam.v2beta.ListPoliciesResponse) com.google.iam.v2beta.ListPoliciesResponseOrBuilder { @@ -377,7 +392,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.iam.v2beta.PolicyProto .internal_static_google_iam_v2beta_ListPoliciesResponse_fieldAccessorTable @@ -389,13 +404,14 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { // Construct using com.google.iam.v2beta.ListPoliciesResponse.newBuilder() private Builder() {} - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { super(parent); } @java.lang.Override public Builder clear() { super.clear(); + bitField0_ = 0; if (policiesBuilder_ == null) { policies_ = java.util.Collections.emptyList(); } else { @@ -404,7 +420,6 @@ public Builder clear() { } bitField0_ = (bitField0_ & ~0x00000001); nextPageToken_ = ""; - return this; } @@ -432,7 +447,15 @@ public com.google.iam.v2beta.ListPoliciesResponse build() { public com.google.iam.v2beta.ListPoliciesResponse buildPartial() { com.google.iam.v2beta.ListPoliciesResponse result = new com.google.iam.v2beta.ListPoliciesResponse(this); - int from_bitField0_ = bitField0_; + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields(com.google.iam.v2beta.ListPoliciesResponse result) { if (policiesBuilder_ == null) { if (((bitField0_ & 0x00000001) != 0)) { policies_ = java.util.Collections.unmodifiableList(policies_); @@ -442,42 +465,13 @@ public com.google.iam.v2beta.ListPoliciesResponse buildPartial() { } else { result.policies_ = policiesBuilder_.build(); } - result.nextPageToken_ = nextPageToken_; - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.setField(field, value); } - @java.lang.Override - public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - - @java.lang.Override - public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.addRepeatedField(field, value); + private void buildPartial0(com.google.iam.v2beta.ListPoliciesResponse result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.nextPageToken_ = nextPageToken_; + } } @java.lang.Override @@ -511,8 +505,8 @@ public Builder mergeFrom(com.google.iam.v2beta.ListPoliciesResponse other) { policies_ = other.policies_; bitField0_ = (bitField0_ & ~0x00000001); policiesBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders - ? getPoliciesFieldBuilder() + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders + ? internalGetPoliciesFieldBuilder() : null; } else { policiesBuilder_.addAllMessages(other.policies_); @@ -521,6 +515,7 @@ public Builder mergeFrom(com.google.iam.v2beta.ListPoliciesResponse other) { } if (!other.getNextPageToken().isEmpty()) { nextPageToken_ = other.nextPageToken_; + bitField0_ |= 0x00000002; onChanged(); } this.mergeUnknownFields(other.getUnknownFields()); @@ -564,7 +559,7 @@ public Builder mergeFrom( case 18: { nextPageToken_ = input.readStringRequireUtf8(); - + bitField0_ |= 0x00000002; break; } // case 18 default: @@ -596,7 +591,7 @@ private void ensurePoliciesIsMutable() { } } - private com.google.protobuf.RepeatedFieldBuilderV3< + private com.google.protobuf.RepeatedFieldBuilder< com.google.iam.v2beta.Policy, com.google.iam.v2beta.Policy.Builder, com.google.iam.v2beta.PolicyOrBuilder> @@ -618,6 +613,7 @@ public java.util.List getPoliciesList() { return policiesBuilder_.getMessageList(); } } + /** * * @@ -634,6 +630,7 @@ public int getPoliciesCount() { return policiesBuilder_.getCount(); } } + /** * * @@ -650,6 +647,7 @@ public com.google.iam.v2beta.Policy getPolicies(int index) { return policiesBuilder_.getMessage(index); } } + /** * * @@ -672,6 +670,7 @@ public Builder setPolicies(int index, com.google.iam.v2beta.Policy value) { } return this; } + /** * * @@ -691,6 +690,7 @@ public Builder setPolicies(int index, com.google.iam.v2beta.Policy.Builder build } return this; } + /** * * @@ -713,6 +713,7 @@ public Builder addPolicies(com.google.iam.v2beta.Policy value) { } return this; } + /** * * @@ -735,6 +736,7 @@ public Builder addPolicies(int index, com.google.iam.v2beta.Policy value) { } return this; } + /** * * @@ -754,6 +756,7 @@ public Builder addPolicies(com.google.iam.v2beta.Policy.Builder builderForValue) } return this; } + /** * * @@ -773,6 +776,7 @@ public Builder addPolicies(int index, com.google.iam.v2beta.Policy.Builder build } return this; } + /** * * @@ -793,6 +797,7 @@ public Builder addAllPolicies( } return this; } + /** * * @@ -812,6 +817,7 @@ public Builder clearPolicies() { } return this; } + /** * * @@ -831,6 +837,7 @@ public Builder removePolicies(int index) { } return this; } + /** * * @@ -841,8 +848,9 @@ public Builder removePolicies(int index) { * repeated .google.iam.v2beta.Policy policies = 1; */ public com.google.iam.v2beta.Policy.Builder getPoliciesBuilder(int index) { - return getPoliciesFieldBuilder().getBuilder(index); + return internalGetPoliciesFieldBuilder().getBuilder(index); } + /** * * @@ -859,6 +867,7 @@ public com.google.iam.v2beta.PolicyOrBuilder getPoliciesOrBuilder(int index) { return policiesBuilder_.getMessageOrBuilder(index); } } + /** * * @@ -876,6 +885,7 @@ public com.google.iam.v2beta.PolicyOrBuilder getPoliciesOrBuilder(int index) { return java.util.Collections.unmodifiableList(policies_); } } + /** * * @@ -886,9 +896,10 @@ public com.google.iam.v2beta.PolicyOrBuilder getPoliciesOrBuilder(int index) { * repeated .google.iam.v2beta.Policy policies = 1; */ public com.google.iam.v2beta.Policy.Builder addPoliciesBuilder() { - return getPoliciesFieldBuilder() + return internalGetPoliciesFieldBuilder() .addBuilder(com.google.iam.v2beta.Policy.getDefaultInstance()); } + /** * * @@ -899,9 +910,10 @@ public com.google.iam.v2beta.Policy.Builder addPoliciesBuilder() { * repeated .google.iam.v2beta.Policy policies = 1; */ public com.google.iam.v2beta.Policy.Builder addPoliciesBuilder(int index) { - return getPoliciesFieldBuilder() + return internalGetPoliciesFieldBuilder() .addBuilder(index, com.google.iam.v2beta.Policy.getDefaultInstance()); } + /** * * @@ -912,17 +924,17 @@ public com.google.iam.v2beta.Policy.Builder addPoliciesBuilder(int index) { * repeated .google.iam.v2beta.Policy policies = 1; */ public java.util.List getPoliciesBuilderList() { - return getPoliciesFieldBuilder().getBuilderList(); + return internalGetPoliciesFieldBuilder().getBuilderList(); } - private com.google.protobuf.RepeatedFieldBuilderV3< + private com.google.protobuf.RepeatedFieldBuilder< com.google.iam.v2beta.Policy, com.google.iam.v2beta.Policy.Builder, com.google.iam.v2beta.PolicyOrBuilder> - getPoliciesFieldBuilder() { + internalGetPoliciesFieldBuilder() { if (policiesBuilder_ == null) { policiesBuilder_ = - new com.google.protobuf.RepeatedFieldBuilderV3< + new com.google.protobuf.RepeatedFieldBuilder< com.google.iam.v2beta.Policy, com.google.iam.v2beta.Policy.Builder, com.google.iam.v2beta.PolicyOrBuilder>( @@ -933,6 +945,7 @@ public java.util.List getPoliciesBuilderLi } private java.lang.Object nextPageToken_ = ""; + /** * * @@ -956,6 +969,7 @@ public java.lang.String getNextPageToken() { return (java.lang.String) ref; } } + /** * * @@ -979,6 +993,7 @@ public com.google.protobuf.ByteString getNextPageTokenBytes() { return (com.google.protobuf.ByteString) ref; } } + /** * * @@ -996,11 +1011,12 @@ public Builder setNextPageToken(java.lang.String value) { if (value == null) { throw new NullPointerException(); } - nextPageToken_ = value; + bitField0_ |= 0x00000002; onChanged(); return this; } + /** * * @@ -1014,11 +1030,12 @@ public Builder setNextPageToken(java.lang.String value) { * @return This builder for chaining. */ public Builder clearNextPageToken() { - nextPageToken_ = getDefaultInstance().getNextPageToken(); + bitField0_ = (bitField0_ & ~0x00000002); onChanged(); return this; } + /** * * @@ -1037,23 +1054,12 @@ public Builder setNextPageTokenBytes(com.google.protobuf.ByteString value) { 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.iam.v2beta.ListPoliciesResponse) } diff --git a/java-iam/proto-google-iam-v2beta/src/main/java/com/google/iam/v2beta/ListPoliciesResponseOrBuilder.java b/java-iam/proto-google-iam-v2beta/src/main/java/com/google/iam/v2beta/ListPoliciesResponseOrBuilder.java index 51d88d35e0..0f9b0f82d8 100644 --- a/java-iam/proto-google-iam-v2beta/src/main/java/com/google/iam/v2beta/ListPoliciesResponseOrBuilder.java +++ b/java-iam/proto-google-iam-v2beta/src/main/java/com/google/iam/v2beta/ListPoliciesResponseOrBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,10 +14,13 @@ * limitations under the License. */ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: google/iam/v2beta/policy.proto +// Protobuf Java Version: 4.33.2 package com.google.iam.v2beta; +@com.google.protobuf.Generated public interface ListPoliciesResponseOrBuilder extends // @@protoc_insertion_point(interface_extends:google.iam.v2beta.ListPoliciesResponse) @@ -33,6 +36,7 @@ public interface ListPoliciesResponseOrBuilder * repeated .google.iam.v2beta.Policy policies = 1; */ java.util.List getPoliciesList(); + /** * * @@ -43,6 +47,7 @@ public interface ListPoliciesResponseOrBuilder * repeated .google.iam.v2beta.Policy policies = 1; */ com.google.iam.v2beta.Policy getPolicies(int index); + /** * * @@ -53,6 +58,7 @@ public interface ListPoliciesResponseOrBuilder * repeated .google.iam.v2beta.Policy policies = 1; */ int getPoliciesCount(); + /** * * @@ -63,6 +69,7 @@ public interface ListPoliciesResponseOrBuilder * repeated .google.iam.v2beta.Policy policies = 1; */ java.util.List getPoliciesOrBuilderList(); + /** * * @@ -87,6 +94,7 @@ public interface ListPoliciesResponseOrBuilder * @return The nextPageToken. */ java.lang.String getNextPageToken(); + /** * * diff --git a/java-iam/proto-google-iam-v2beta/src/main/java/com/google/iam/v2beta/Policy.java b/java-iam/proto-google-iam-v2beta/src/main/java/com/google/iam/v2beta/Policy.java index a2e1a8b7dc..ab8270f3ec 100644 --- a/java-iam/proto-google-iam-v2beta/src/main/java/com/google/iam/v2beta/Policy.java +++ b/java-iam/proto-google-iam-v2beta/src/main/java/com/google/iam/v2beta/Policy.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,9 @@ * limitations under the License. */ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: google/iam/v2beta/policy.proto +// Protobuf Java Version: 4.33.2 package com.google.iam.v2beta; @@ -27,13 +29,25 @@ * * Protobuf type {@code google.iam.v2beta.Policy} */ -public final class Policy extends com.google.protobuf.GeneratedMessageV3 +@com.google.protobuf.Generated +public final class Policy extends com.google.protobuf.GeneratedMessage implements // @@protoc_insertion_point(message_implements:google.iam.v2beta.Policy) PolicyOrBuilder { private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "Policy"); + } + // Use Policy.newBuilder() to construct. - private Policy(com.google.protobuf.GeneratedMessageV3.Builder builder) { + private Policy(com.google.protobuf.GeneratedMessage.Builder builder) { super(builder); } @@ -46,24 +60,14 @@ private Policy() { rules_ = java.util.Collections.emptyList(); } - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new Policy(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.iam.v2beta.PolicyProto.internal_static_google_iam_v2beta_Policy_descriptor; } @SuppressWarnings({"rawtypes"}) @java.lang.Override - protected com.google.protobuf.MapField internalGetMapField(int number) { + protected com.google.protobuf.MapFieldReflectionAccessor internalGetMapFieldReflection( + int number) { switch (number) { case 5: return internalGetAnnotations(); @@ -73,7 +77,7 @@ protected com.google.protobuf.MapField internalGetMapField(int number) { } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.iam.v2beta.PolicyProto .internal_static_google_iam_v2beta_Policy_fieldAccessorTable @@ -81,18 +85,25 @@ protected com.google.protobuf.MapField internalGetMapField(int number) { com.google.iam.v2beta.Policy.class, com.google.iam.v2beta.Policy.Builder.class); } + private int bitField0_; public static final int NAME_FIELD_NUMBER = 1; - private volatile java.lang.Object name_; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** * * *
            * Immutable. The resource name of the `Policy`, which must be unique. Format:
            * `policies/{attachment_point}/denypolicies/{policy_id}`
        +   *
        +   *
            * The attachment point is identified by its URL-encoded full resource name,
            * which means that the forward-slash character, `/`, must be written as
            * `%2F`. For example,
            * `policies/cloudresourcemanager.googleapis.com%2Fprojects%2Fmy-project/denypolicies/my-deny-policy`.
        +   *
            * For organizations and folders, use the numeric ID in the full resource
            * name. For projects, requests can use the alphanumeric or the numeric ID.
            * Responses always contain the numeric ID.
        @@ -114,16 +125,20 @@ public java.lang.String getName() {
               return s;
             }
           }
        +
           /**
            *
            *
            * 
            * Immutable. The resource name of the `Policy`, which must be unique. Format:
            * `policies/{attachment_point}/denypolicies/{policy_id}`
        +   *
        +   *
            * The attachment point is identified by its URL-encoded full resource name,
            * which means that the forward-slash character, `/`, must be written as
            * `%2F`. For example,
            * `policies/cloudresourcemanager.googleapis.com%2Fprojects%2Fmy-project/denypolicies/my-deny-policy`.
        +   *
            * For organizations and folders, use the numeric ID in the full resource
            * name. For projects, requests can use the alphanumeric or the numeric ID.
            * Responses always contain the numeric ID.
        @@ -147,7 +162,10 @@ public com.google.protobuf.ByteString getNameBytes() {
           }
         
           public static final int UID_FIELD_NUMBER = 2;
        -  private volatile java.lang.Object uid_;
        +
        +  @SuppressWarnings("serial")
        +  private volatile java.lang.Object uid_ = "";
        +
           /**
            *
            *
        @@ -172,6 +190,7 @@ public java.lang.String getUid() {
               return s;
             }
           }
        +
           /**
            *
            *
        @@ -198,7 +217,10 @@ public com.google.protobuf.ByteString getUidBytes() {
           }
         
           public static final int KIND_FIELD_NUMBER = 3;
        -  private volatile java.lang.Object kind_;
        +
        +  @SuppressWarnings("serial")
        +  private volatile java.lang.Object kind_ = "";
        +
           /**
            *
            *
        @@ -222,6 +244,7 @@ public java.lang.String getKind() {
               return s;
             }
           }
        +
           /**
            *
            *
        @@ -247,7 +270,10 @@ public com.google.protobuf.ByteString getKindBytes() {
           }
         
           public static final int DISPLAY_NAME_FIELD_NUMBER = 4;
        -  private volatile java.lang.Object displayName_;
        +
        +  @SuppressWarnings("serial")
        +  private volatile java.lang.Object displayName_ = "";
        +
           /**
            *
            *
        @@ -272,6 +298,7 @@ public java.lang.String getDisplayName() {
               return s;
             }
           }
        +
           /**
            *
            *
        @@ -310,6 +337,7 @@ private static final class AnnotationsDefaultEntryHolder {
                     "");
           }
         
        +  @SuppressWarnings("serial")
           private com.google.protobuf.MapField annotations_;
         
           private com.google.protobuf.MapField
        @@ -323,6 +351,7 @@ private static final class AnnotationsDefaultEntryHolder {
           public int getAnnotationsCount() {
             return internalGetAnnotations().getMap().size();
           }
        +
           /**
            *
            *
        @@ -340,12 +369,14 @@ public boolean containsAnnotations(java.lang.String key) {
             }
             return internalGetAnnotations().getMap().containsKey(key);
           }
        +
           /** Use {@link #getAnnotationsMap()} instead. */
           @java.lang.Override
           @java.lang.Deprecated
           public java.util.Map getAnnotations() {
             return getAnnotationsMap();
           }
        +
           /**
            *
            *
        @@ -360,6 +391,7 @@ public java.util.Map getAnnotations() {
           public java.util.Map getAnnotationsMap() {
             return internalGetAnnotations().getMap();
           }
        +
           /**
            *
            *
        @@ -371,14 +403,17 @@ public java.util.Map getAnnotationsMap() {
            * map<string, string> annotations = 5;
            */
           @java.lang.Override
        -  public java.lang.String getAnnotationsOrDefault(
        -      java.lang.String key, java.lang.String defaultValue) {
        +  public /* nullable */ java.lang.String getAnnotationsOrDefault(
        +      java.lang.String key,
        +      /* nullable */
        +      java.lang.String defaultValue) {
             if (key == null) {
               throw new NullPointerException("map key");
             }
             java.util.Map map = internalGetAnnotations().getMap();
             return map.containsKey(key) ? map.get(key) : defaultValue;
           }
        +
           /**
            *
            *
        @@ -402,7 +437,10 @@ public java.lang.String getAnnotationsOrThrow(java.lang.String key) {
           }
         
           public static final int ETAG_FIELD_NUMBER = 6;
        -  private volatile java.lang.Object etag_;
        +
        +  @SuppressWarnings("serial")
        +  private volatile java.lang.Object etag_ = "";
        +
           /**
            *
            *
        @@ -410,6 +448,7 @@ public java.lang.String getAnnotationsOrThrow(java.lang.String key) {
            * An opaque tag that identifies the current version of the `Policy`. IAM uses
            * this value to help manage concurrent updates, so they do not cause one
            * update to be overwritten by another.
        +   *
            * If this field is present in a [CreatePolicy][] request, the value is
            * ignored.
            * 
        @@ -430,6 +469,7 @@ public java.lang.String getEtag() { return s; } } + /** * * @@ -437,6 +477,7 @@ public java.lang.String getEtag() { * An opaque tag that identifies the current version of the `Policy`. IAM uses * this value to help manage concurrent updates, so they do not cause one * update to be overwritten by another. + * * If this field is present in a [CreatePolicy][] request, the value is * ignored. *
        @@ -460,6 +501,7 @@ public com.google.protobuf.ByteString getEtagBytes() { public static final int CREATE_TIME_FIELD_NUMBER = 7; private com.google.protobuf.Timestamp createTime_; + /** * * @@ -474,8 +516,9 @@ public com.google.protobuf.ByteString getEtagBytes() { */ @java.lang.Override public boolean hasCreateTime() { - return createTime_ != null; + return ((bitField0_ & 0x00000001) != 0); } + /** * * @@ -492,6 +535,7 @@ public boolean hasCreateTime() { public com.google.protobuf.Timestamp getCreateTime() { return createTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : createTime_; } + /** * * @@ -504,11 +548,12 @@ public com.google.protobuf.Timestamp getCreateTime() { */ @java.lang.Override public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { - return getCreateTime(); + return createTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : createTime_; } public static final int UPDATE_TIME_FIELD_NUMBER = 8; private com.google.protobuf.Timestamp updateTime_; + /** * * @@ -523,8 +568,9 @@ public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { */ @java.lang.Override public boolean hasUpdateTime() { - return updateTime_ != null; + return ((bitField0_ & 0x00000002) != 0); } + /** * * @@ -541,6 +587,7 @@ public boolean hasUpdateTime() { public com.google.protobuf.Timestamp getUpdateTime() { return updateTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : updateTime_; } + /** * * @@ -553,11 +600,12 @@ public com.google.protobuf.Timestamp getUpdateTime() { */ @java.lang.Override public com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder() { - return getUpdateTime(); + return updateTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : updateTime_; } public static final int DELETE_TIME_FIELD_NUMBER = 9; private com.google.protobuf.Timestamp deleteTime_; + /** * * @@ -572,8 +620,9 @@ public com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder() { */ @java.lang.Override public boolean hasDeleteTime() { - return deleteTime_ != null; + return ((bitField0_ & 0x00000004) != 0); } + /** * * @@ -590,6 +639,7 @@ public boolean hasDeleteTime() { public com.google.protobuf.Timestamp getDeleteTime() { return deleteTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : deleteTime_; } + /** * * @@ -602,11 +652,14 @@ public com.google.protobuf.Timestamp getDeleteTime() { */ @java.lang.Override public com.google.protobuf.TimestampOrBuilder getDeleteTimeOrBuilder() { - return getDeleteTime(); + return deleteTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : deleteTime_; } public static final int RULES_FIELD_NUMBER = 10; + + @SuppressWarnings("serial") private java.util.List rules_; + /** * * @@ -621,6 +674,7 @@ public com.google.protobuf.TimestampOrBuilder getDeleteTimeOrBuilder() { public java.util.List getRulesList() { return rules_; } + /** * * @@ -636,6 +690,7 @@ public java.util.List getRulesList() { getRulesOrBuilderList() { return rules_; } + /** * * @@ -650,6 +705,7 @@ public java.util.List getRulesList() { public int getRulesCount() { return rules_.size(); } + /** * * @@ -664,6 +720,7 @@ public int getRulesCount() { public com.google.iam.v2beta.PolicyRule getRules(int index) { return rules_.get(index); } + /** * * @@ -693,30 +750,30 @@ public final boolean isInitialized() { @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.GeneratedMessage.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, name_); } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(uid_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 2, uid_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(uid_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, uid_); } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(kind_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 3, kind_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(kind_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 3, kind_); } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(displayName_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 4, displayName_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(displayName_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 4, displayName_); } - com.google.protobuf.GeneratedMessageV3.serializeStringMapTo( + com.google.protobuf.GeneratedMessage.serializeStringMapTo( output, internalGetAnnotations(), AnnotationsDefaultEntryHolder.defaultEntry, 5); - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(etag_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 6, etag_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(etag_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 6, etag_); } - if (createTime_ != null) { + if (((bitField0_ & 0x00000001) != 0)) { output.writeMessage(7, getCreateTime()); } - if (updateTime_ != null) { + if (((bitField0_ & 0x00000002) != 0)) { output.writeMessage(8, getUpdateTime()); } - if (deleteTime_ != null) { + if (((bitField0_ & 0x00000004) != 0)) { output.writeMessage(9, getDeleteTime()); } for (int i = 0; i < rules_.size(); i++) { @@ -731,17 +788,17 @@ public int getSerializedSize() { 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.GeneratedMessage.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, name_); } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(uid_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, uid_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(uid_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, uid_); } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(kind_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, kind_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(kind_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(3, kind_); } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(displayName_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, displayName_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(displayName_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(4, displayName_); } for (java.util.Map.Entry entry : internalGetAnnotations().getMap().entrySet()) { @@ -753,16 +810,16 @@ public int getSerializedSize() { .build(); size += com.google.protobuf.CodedOutputStream.computeMessageSize(5, annotations__); } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(etag_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(6, etag_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(etag_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(6, etag_); } - if (createTime_ != null) { + if (((bitField0_ & 0x00000001) != 0)) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(7, getCreateTime()); } - if (updateTime_ != null) { + if (((bitField0_ & 0x00000002) != 0)) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(8, getUpdateTime()); } - if (deleteTime_ != null) { + if (((bitField0_ & 0x00000004) != 0)) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(9, getDeleteTime()); } for (int i = 0; i < rules_.size(); i++) { @@ -884,38 +941,38 @@ public static com.google.iam.v2beta.Policy parseFrom( public static com.google.iam.v2beta.Policy parseFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); } public static com.google.iam.v2beta.Policy parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } public static com.google.iam.v2beta.Policy parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); } public static com.google.iam.v2beta.Policy parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( PARSER, input, extensionRegistry); } public static com.google.iam.v2beta.Policy parseFrom(com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); } public static com.google.iam.v2beta.Policy parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } @@ -938,10 +995,11 @@ public Builder toBuilder() { } @java.lang.Override - protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { Builder builder = new Builder(parent); return builder; } + /** * * @@ -951,7 +1009,7 @@ protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.Build * * Protobuf type {@code google.iam.v2beta.Policy} */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder implements // @@protoc_insertion_point(builder_implements:google.iam.v2beta.Policy) com.google.iam.v2beta.PolicyOrBuilder { @@ -960,7 +1018,8 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } @SuppressWarnings({"rawtypes"}) - protected com.google.protobuf.MapField internalGetMapField(int number) { + protected com.google.protobuf.MapFieldReflectionAccessor internalGetMapFieldReflection( + int number) { switch (number) { case 5: return internalGetAnnotations(); @@ -970,7 +1029,8 @@ protected com.google.protobuf.MapField internalGetMapField(int number) { } @SuppressWarnings({"rawtypes"}) - protected com.google.protobuf.MapField internalGetMutableMapField(int number) { + protected com.google.protobuf.MapFieldReflectionAccessor internalGetMutableMapFieldReflection( + int number) { switch (number) { case 5: return internalGetMutableAnnotations(); @@ -980,7 +1040,7 @@ protected com.google.protobuf.MapField internalGetMutableMapField(int number) { } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.iam.v2beta.PolicyProto .internal_static_google_iam_v2beta_Policy_fieldAccessorTable @@ -989,42 +1049,47 @@ protected com.google.protobuf.MapField internalGetMutableMapField(int number) { } // Construct using com.google.iam.v2beta.Policy.newBuilder() - private Builder() {} + private Builder() { + maybeForceBuilderInitialization(); + } - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetCreateTimeFieldBuilder(); + internalGetUpdateTimeFieldBuilder(); + internalGetDeleteTimeFieldBuilder(); + internalGetRulesFieldBuilder(); + } } @java.lang.Override public Builder clear() { super.clear(); + bitField0_ = 0; name_ = ""; - uid_ = ""; - kind_ = ""; - displayName_ = ""; - internalGetMutableAnnotations().clear(); etag_ = ""; - - if (createTimeBuilder_ == null) { - createTime_ = null; - } else { - createTime_ = null; + createTime_ = null; + if (createTimeBuilder_ != null) { + createTimeBuilder_.dispose(); createTimeBuilder_ = null; } - if (updateTimeBuilder_ == null) { - updateTime_ = null; - } else { - updateTime_ = null; + updateTime_ = null; + if (updateTimeBuilder_ != null) { + updateTimeBuilder_.dispose(); updateTimeBuilder_ = null; } - if (deleteTimeBuilder_ == null) { - deleteTime_ = null; - } else { - deleteTime_ = null; + deleteTime_ = null; + if (deleteTimeBuilder_ != null) { + deleteTimeBuilder_.dispose(); deleteTimeBuilder_ = null; } if (rulesBuilder_ == null) { @@ -1033,7 +1098,7 @@ public Builder clear() { rules_ = null; rulesBuilder_.clear(); } - bitField0_ = (bitField0_ & ~0x00000002); + bitField0_ = (bitField0_ & ~0x00000200); return this; } @@ -1059,73 +1124,61 @@ public com.google.iam.v2beta.Policy build() { @java.lang.Override public com.google.iam.v2beta.Policy buildPartial() { com.google.iam.v2beta.Policy result = new com.google.iam.v2beta.Policy(this); - int from_bitField0_ = bitField0_; - result.name_ = name_; - result.uid_ = uid_; - result.kind_ = kind_; - result.displayName_ = displayName_; - result.annotations_ = internalGetAnnotations(); - result.annotations_.makeImmutable(); - result.etag_ = etag_; - if (createTimeBuilder_ == null) { - result.createTime_ = createTime_; - } else { - result.createTime_ = createTimeBuilder_.build(); - } - if (updateTimeBuilder_ == null) { - result.updateTime_ = updateTime_; - } else { - result.updateTime_ = updateTimeBuilder_.build(); - } - if (deleteTimeBuilder_ == null) { - result.deleteTime_ = deleteTime_; - } else { - result.deleteTime_ = deleteTimeBuilder_.build(); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields(com.google.iam.v2beta.Policy result) { if (rulesBuilder_ == null) { - if (((bitField0_ & 0x00000002) != 0)) { + if (((bitField0_ & 0x00000200) != 0)) { rules_ = java.util.Collections.unmodifiableList(rules_); - bitField0_ = (bitField0_ & ~0x00000002); + bitField0_ = (bitField0_ & ~0x00000200); } result.rules_ = rules_; } else { result.rules_ = rulesBuilder_.build(); } - onBuilt(); - return result; } - @java.lang.Override - public Builder clone() { - return super.clone(); - } - - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.setField(field, value); - } - - @java.lang.Override - public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - - @java.lang.Override - public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.addRepeatedField(field, value); + private void buildPartial0(com.google.iam.v2beta.Policy result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.uid_ = uid_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.kind_ = kind_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.displayName_ = displayName_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.annotations_ = internalGetAnnotations(); + result.annotations_.makeImmutable(); + } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.etag_ = etag_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000040) != 0)) { + result.createTime_ = createTimeBuilder_ == null ? createTime_ : createTimeBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000080) != 0)) { + result.updateTime_ = updateTimeBuilder_ == null ? updateTime_ : updateTimeBuilder_.build(); + to_bitField0_ |= 0x00000002; + } + if (((from_bitField0_ & 0x00000100) != 0)) { + result.deleteTime_ = deleteTimeBuilder_ == null ? deleteTime_ : deleteTimeBuilder_.build(); + to_bitField0_ |= 0x00000004; + } + result.bitField0_ |= to_bitField0_; } @java.lang.Override @@ -1142,23 +1195,29 @@ public Builder mergeFrom(com.google.iam.v2beta.Policy other) { if (other == com.google.iam.v2beta.Policy.getDefaultInstance()) return this; if (!other.getName().isEmpty()) { name_ = other.name_; + bitField0_ |= 0x00000001; onChanged(); } if (!other.getUid().isEmpty()) { uid_ = other.uid_; + bitField0_ |= 0x00000002; onChanged(); } if (!other.getKind().isEmpty()) { kind_ = other.kind_; + bitField0_ |= 0x00000004; onChanged(); } if (!other.getDisplayName().isEmpty()) { displayName_ = other.displayName_; + bitField0_ |= 0x00000008; onChanged(); } internalGetMutableAnnotations().mergeFrom(other.internalGetAnnotations()); + bitField0_ |= 0x00000010; if (!other.getEtag().isEmpty()) { etag_ = other.etag_; + bitField0_ |= 0x00000020; onChanged(); } if (other.hasCreateTime()) { @@ -1174,7 +1233,7 @@ public Builder mergeFrom(com.google.iam.v2beta.Policy other) { if (!other.rules_.isEmpty()) { if (rules_.isEmpty()) { rules_ = other.rules_; - bitField0_ = (bitField0_ & ~0x00000002); + bitField0_ = (bitField0_ & ~0x00000200); } else { ensureRulesIsMutable(); rules_.addAll(other.rules_); @@ -1187,10 +1246,10 @@ public Builder mergeFrom(com.google.iam.v2beta.Policy other) { rulesBuilder_.dispose(); rulesBuilder_ = null; rules_ = other.rules_; - bitField0_ = (bitField0_ & ~0x00000002); + bitField0_ = (bitField0_ & ~0x00000200); rulesBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders - ? getRulesFieldBuilder() + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders + ? internalGetRulesFieldBuilder() : null; } else { rulesBuilder_.addAllMessages(other.rules_); @@ -1226,25 +1285,25 @@ public Builder mergeFrom( case 10: { name_ = input.readStringRequireUtf8(); - + bitField0_ |= 0x00000001; break; } // case 10 case 18: { uid_ = input.readStringRequireUtf8(); - + bitField0_ |= 0x00000002; break; } // case 18 case 26: { kind_ = input.readStringRequireUtf8(); - + bitField0_ |= 0x00000004; break; } // case 26 case 34: { displayName_ = input.readStringRequireUtf8(); - + bitField0_ |= 0x00000008; break; } // case 34 case 42: @@ -1256,30 +1315,34 @@ public Builder mergeFrom( internalGetMutableAnnotations() .getMutableMap() .put(annotations__.getKey(), annotations__.getValue()); + bitField0_ |= 0x00000010; break; } // case 42 case 50: { etag_ = input.readStringRequireUtf8(); - + bitField0_ |= 0x00000020; break; } // case 50 case 58: { - input.readMessage(getCreateTimeFieldBuilder().getBuilder(), extensionRegistry); - + input.readMessage( + internalGetCreateTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000040; break; } // case 58 case 66: { - input.readMessage(getUpdateTimeFieldBuilder().getBuilder(), extensionRegistry); - + input.readMessage( + internalGetUpdateTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000080; break; } // case 66 case 74: { - input.readMessage(getDeleteTimeFieldBuilder().getBuilder(), extensionRegistry); - + input.readMessage( + internalGetDeleteTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000100; break; } // case 74 case 82: @@ -1314,16 +1377,20 @@ public Builder mergeFrom( private int bitField0_; private java.lang.Object name_ = ""; + /** * * *
              * Immutable. The resource name of the `Policy`, which must be unique. Format:
              * `policies/{attachment_point}/denypolicies/{policy_id}`
        +     *
        +     *
              * The attachment point is identified by its URL-encoded full resource name,
              * which means that the forward-slash character, `/`, must be written as
              * `%2F`. For example,
              * `policies/cloudresourcemanager.googleapis.com%2Fprojects%2Fmy-project/denypolicies/my-deny-policy`.
        +     *
              * For organizations and folders, use the numeric ID in the full resource
              * name. For projects, requests can use the alphanumeric or the numeric ID.
              * Responses always contain the numeric ID.
        @@ -1344,16 +1411,20 @@ public java.lang.String getName() {
                 return (java.lang.String) ref;
               }
             }
        +
             /**
              *
              *
              * 
              * Immutable. The resource name of the `Policy`, which must be unique. Format:
              * `policies/{attachment_point}/denypolicies/{policy_id}`
        +     *
        +     *
              * The attachment point is identified by its URL-encoded full resource name,
              * which means that the forward-slash character, `/`, must be written as
              * `%2F`. For example,
              * `policies/cloudresourcemanager.googleapis.com%2Fprojects%2Fmy-project/denypolicies/my-deny-policy`.
        +     *
              * For organizations and folders, use the numeric ID in the full resource
              * name. For projects, requests can use the alphanumeric or the numeric ID.
              * Responses always contain the numeric ID.
        @@ -1374,16 +1445,20 @@ public com.google.protobuf.ByteString getNameBytes() {
                 return (com.google.protobuf.ByteString) ref;
               }
             }
        +
             /**
              *
              *
              * 
              * Immutable. The resource name of the `Policy`, which must be unique. Format:
              * `policies/{attachment_point}/denypolicies/{policy_id}`
        +     *
        +     *
              * The attachment point is identified by its URL-encoded full resource name,
              * which means that the forward-slash character, `/`, must be written as
              * `%2F`. For example,
              * `policies/cloudresourcemanager.googleapis.com%2Fprojects%2Fmy-project/denypolicies/my-deny-policy`.
        +     *
              * For organizations and folders, use the numeric ID in the full resource
              * name. For projects, requests can use the alphanumeric or the numeric ID.
              * Responses always contain the numeric ID.
        @@ -1398,21 +1473,25 @@ public Builder setName(java.lang.String value) {
               if (value == null) {
                 throw new NullPointerException();
               }
        -
               name_ = value;
        +      bitField0_ |= 0x00000001;
               onChanged();
               return this;
             }
        +
             /**
              *
              *
              * 
              * Immutable. The resource name of the `Policy`, which must be unique. Format:
              * `policies/{attachment_point}/denypolicies/{policy_id}`
        +     *
        +     *
              * The attachment point is identified by its URL-encoded full resource name,
              * which means that the forward-slash character, `/`, must be written as
              * `%2F`. For example,
              * `policies/cloudresourcemanager.googleapis.com%2Fprojects%2Fmy-project/denypolicies/my-deny-policy`.
        +     *
              * For organizations and folders, use the numeric ID in the full resource
              * name. For projects, requests can use the alphanumeric or the numeric ID.
              * Responses always contain the numeric ID.
        @@ -1423,21 +1502,25 @@ public Builder setName(java.lang.String value) {
              * @return This builder for chaining.
              */
             public Builder clearName() {
        -
               name_ = getDefaultInstance().getName();
        +      bitField0_ = (bitField0_ & ~0x00000001);
               onChanged();
               return this;
             }
        +
             /**
              *
              *
              * 
              * Immutable. The resource name of the `Policy`, which must be unique. Format:
              * `policies/{attachment_point}/denypolicies/{policy_id}`
        +     *
        +     *
              * The attachment point is identified by its URL-encoded full resource name,
              * which means that the forward-slash character, `/`, must be written as
              * `%2F`. For example,
              * `policies/cloudresourcemanager.googleapis.com%2Fprojects%2Fmy-project/denypolicies/my-deny-policy`.
        +     *
              * For organizations and folders, use the numeric ID in the full resource
              * name. For projects, requests can use the alphanumeric or the numeric ID.
              * Responses always contain the numeric ID.
        @@ -1453,13 +1536,14 @@ public Builder setNameBytes(com.google.protobuf.ByteString value) {
                 throw new NullPointerException();
               }
               checkByteStringIsUtf8(value);
        -
               name_ = value;
        +      bitField0_ |= 0x00000001;
               onChanged();
               return this;
             }
         
             private java.lang.Object uid_ = "";
        +
             /**
              *
              *
        @@ -1483,6 +1567,7 @@ public java.lang.String getUid() {
                 return (java.lang.String) ref;
               }
             }
        +
             /**
              *
              *
        @@ -1506,6 +1591,7 @@ public com.google.protobuf.ByteString getUidBytes() {
                 return (com.google.protobuf.ByteString) ref;
               }
             }
        +
             /**
              *
              *
        @@ -1523,11 +1609,12 @@ public Builder setUid(java.lang.String value) {
               if (value == null) {
                 throw new NullPointerException();
               }
        -
               uid_ = value;
        +      bitField0_ |= 0x00000002;
               onChanged();
               return this;
             }
        +
             /**
              *
              *
        @@ -1541,11 +1628,12 @@ public Builder setUid(java.lang.String value) {
              * @return This builder for chaining.
              */
             public Builder clearUid() {
        -
               uid_ = getDefaultInstance().getUid();
        +      bitField0_ = (bitField0_ & ~0x00000002);
               onChanged();
               return this;
             }
        +
             /**
              *
              *
        @@ -1564,13 +1652,14 @@ public Builder setUidBytes(com.google.protobuf.ByteString value) {
                 throw new NullPointerException();
               }
               checkByteStringIsUtf8(value);
        -
               uid_ = value;
        +      bitField0_ |= 0x00000002;
               onChanged();
               return this;
             }
         
             private java.lang.Object kind_ = "";
        +
             /**
              *
              *
        @@ -1593,6 +1682,7 @@ public java.lang.String getKind() {
                 return (java.lang.String) ref;
               }
             }
        +
             /**
              *
              *
        @@ -1615,6 +1705,7 @@ public com.google.protobuf.ByteString getKindBytes() {
                 return (com.google.protobuf.ByteString) ref;
               }
             }
        +
             /**
              *
              *
        @@ -1631,11 +1722,12 @@ public Builder setKind(java.lang.String value) {
               if (value == null) {
                 throw new NullPointerException();
               }
        -
               kind_ = value;
        +      bitField0_ |= 0x00000004;
               onChanged();
               return this;
             }
        +
             /**
              *
              *
        @@ -1648,11 +1740,12 @@ public Builder setKind(java.lang.String value) {
              * @return This builder for chaining.
              */
             public Builder clearKind() {
        -
               kind_ = getDefaultInstance().getKind();
        +      bitField0_ = (bitField0_ & ~0x00000004);
               onChanged();
               return this;
             }
        +
             /**
              *
              *
        @@ -1670,13 +1763,14 @@ public Builder setKindBytes(com.google.protobuf.ByteString value) {
                 throw new NullPointerException();
               }
               checkByteStringIsUtf8(value);
        -
               kind_ = value;
        +      bitField0_ |= 0x00000004;
               onChanged();
               return this;
             }
         
             private java.lang.Object displayName_ = "";
        +
             /**
              *
              *
        @@ -1700,6 +1794,7 @@ public java.lang.String getDisplayName() {
                 return (java.lang.String) ref;
               }
             }
        +
             /**
              *
              *
        @@ -1723,6 +1818,7 @@ public com.google.protobuf.ByteString getDisplayNameBytes() {
                 return (com.google.protobuf.ByteString) ref;
               }
             }
        +
             /**
              *
              *
        @@ -1740,11 +1836,12 @@ public Builder setDisplayName(java.lang.String value) {
               if (value == null) {
                 throw new NullPointerException();
               }
        -
               displayName_ = value;
        +      bitField0_ |= 0x00000008;
               onChanged();
               return this;
             }
        +
             /**
              *
              *
        @@ -1758,11 +1855,12 @@ public Builder setDisplayName(java.lang.String value) {
              * @return This builder for chaining.
              */
             public Builder clearDisplayName() {
        -
               displayName_ = getDefaultInstance().getDisplayName();
        +      bitField0_ = (bitField0_ & ~0x00000008);
               onChanged();
               return this;
             }
        +
             /**
              *
              *
        @@ -1781,8 +1879,8 @@ public Builder setDisplayNameBytes(com.google.protobuf.ByteString value) {
                 throw new NullPointerException();
               }
               checkByteStringIsUtf8(value);
        -
               displayName_ = value;
        +      bitField0_ |= 0x00000008;
               onChanged();
               return this;
             }
        @@ -1800,8 +1898,6 @@ public Builder setDisplayNameBytes(com.google.protobuf.ByteString value) {
         
             private com.google.protobuf.MapField
                 internalGetMutableAnnotations() {
        -      onChanged();
        -      ;
               if (annotations_ == null) {
                 annotations_ =
                     com.google.protobuf.MapField.newMapField(AnnotationsDefaultEntryHolder.defaultEntry);
        @@ -1809,12 +1905,15 @@ public Builder setDisplayNameBytes(com.google.protobuf.ByteString value) {
               if (!annotations_.isMutable()) {
                 annotations_ = annotations_.copy();
               }
        +      bitField0_ |= 0x00000010;
        +      onChanged();
               return annotations_;
             }
         
             public int getAnnotationsCount() {
               return internalGetAnnotations().getMap().size();
             }
        +
             /**
              *
              *
        @@ -1832,12 +1931,14 @@ public boolean containsAnnotations(java.lang.String key) {
               }
               return internalGetAnnotations().getMap().containsKey(key);
             }
        +
             /** Use {@link #getAnnotationsMap()} instead. */
             @java.lang.Override
             @java.lang.Deprecated
             public java.util.Map getAnnotations() {
               return getAnnotationsMap();
             }
        +
             /**
              *
              *
        @@ -1852,6 +1953,7 @@ public java.util.Map getAnnotations() {
             public java.util.Map getAnnotationsMap() {
               return internalGetAnnotations().getMap();
             }
        +
             /**
              *
              *
        @@ -1863,14 +1965,17 @@ public java.util.Map getAnnotationsMap() {
              * map<string, string> annotations = 5;
              */
             @java.lang.Override
        -    public java.lang.String getAnnotationsOrDefault(
        -        java.lang.String key, java.lang.String defaultValue) {
        +    public /* nullable */ java.lang.String getAnnotationsOrDefault(
        +        java.lang.String key,
        +        /* nullable */
        +        java.lang.String defaultValue) {
               if (key == null) {
                 throw new NullPointerException("map key");
               }
               java.util.Map map = internalGetAnnotations().getMap();
               return map.containsKey(key) ? map.get(key) : defaultValue;
             }
        +
             /**
              *
              *
        @@ -1894,9 +1999,11 @@ public java.lang.String getAnnotationsOrThrow(java.lang.String key) {
             }
         
             public Builder clearAnnotations() {
        +      bitField0_ = (bitField0_ & ~0x00000010);
               internalGetMutableAnnotations().getMutableMap().clear();
               return this;
             }
        +
             /**
              *
              *
        @@ -1914,11 +2021,14 @@ public Builder removeAnnotations(java.lang.String key) {
               internalGetMutableAnnotations().getMutableMap().remove(key);
               return this;
             }
        +
             /** Use alternate mutation accessors instead. */
             @java.lang.Deprecated
             public java.util.Map getMutableAnnotations() {
        +      bitField0_ |= 0x00000010;
               return internalGetMutableAnnotations().getMutableMap();
             }
        +
             /**
              *
              *
        @@ -1936,10 +2046,11 @@ public Builder putAnnotations(java.lang.String key, java.lang.String value) {
               if (value == null) {
                 throw new NullPointerException("map value");
               }
        -
               internalGetMutableAnnotations().getMutableMap().put(key, value);
        +      bitField0_ |= 0x00000010;
               return this;
             }
        +
             /**
              *
              *
        @@ -1952,10 +2063,12 @@ public Builder putAnnotations(java.lang.String key, java.lang.String value) {
              */
             public Builder putAllAnnotations(java.util.Map values) {
               internalGetMutableAnnotations().getMutableMap().putAll(values);
        +      bitField0_ |= 0x00000010;
               return this;
             }
         
             private java.lang.Object etag_ = "";
        +
             /**
              *
              *
        @@ -1963,6 +2076,7 @@ public Builder putAllAnnotations(java.util.Map
        @@ -1982,6 +2096,7 @@ public java.lang.String getEtag() {
                 return (java.lang.String) ref;
               }
             }
        +
             /**
              *
              *
        @@ -1989,6 +2104,7 @@ public java.lang.String getEtag() {
              * An opaque tag that identifies the current version of the `Policy`. IAM uses
              * this value to help manage concurrent updates, so they do not cause one
              * update to be overwritten by another.
        +     *
              * If this field is present in a [CreatePolicy][] request, the value is
              * ignored.
              * 
        @@ -2008,6 +2124,7 @@ public com.google.protobuf.ByteString getEtagBytes() { return (com.google.protobuf.ByteString) ref; } } + /** * * @@ -2015,6 +2132,7 @@ public com.google.protobuf.ByteString getEtagBytes() { * An opaque tag that identifies the current version of the `Policy`. IAM uses * this value to help manage concurrent updates, so they do not cause one * update to be overwritten by another. + * * If this field is present in a [CreatePolicy][] request, the value is * ignored. *
        @@ -2028,11 +2146,12 @@ public Builder setEtag(java.lang.String value) { if (value == null) { throw new NullPointerException(); } - etag_ = value; + bitField0_ |= 0x00000020; onChanged(); return this; } + /** * * @@ -2040,6 +2159,7 @@ public Builder setEtag(java.lang.String value) { * An opaque tag that identifies the current version of the `Policy`. IAM uses * this value to help manage concurrent updates, so they do not cause one * update to be overwritten by another. + * * If this field is present in a [CreatePolicy][] request, the value is * ignored. *
        @@ -2049,11 +2169,12 @@ public Builder setEtag(java.lang.String value) { * @return This builder for chaining. */ public Builder clearEtag() { - etag_ = getDefaultInstance().getEtag(); + bitField0_ = (bitField0_ & ~0x00000020); onChanged(); return this; } + /** * * @@ -2061,6 +2182,7 @@ public Builder clearEtag() { * An opaque tag that identifies the current version of the `Policy`. IAM uses * this value to help manage concurrent updates, so they do not cause one * update to be overwritten by another. + * * If this field is present in a [CreatePolicy][] request, the value is * ignored. *
        @@ -2075,18 +2197,19 @@ public Builder setEtagBytes(com.google.protobuf.ByteString value) { throw new NullPointerException(); } checkByteStringIsUtf8(value); - etag_ = value; + bitField0_ |= 0x00000020; onChanged(); return this; } private com.google.protobuf.Timestamp createTime_; - private com.google.protobuf.SingleFieldBuilderV3< + private com.google.protobuf.SingleFieldBuilder< com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder> createTimeBuilder_; + /** * * @@ -2101,8 +2224,9 @@ public Builder setEtagBytes(com.google.protobuf.ByteString value) { * @return Whether the createTime field is set. */ public boolean hasCreateTime() { - return createTimeBuilder_ != null || createTime_ != null; + return ((bitField0_ & 0x00000040) != 0); } + /** * * @@ -2125,6 +2249,7 @@ public com.google.protobuf.Timestamp getCreateTime() { return createTimeBuilder_.getMessage(); } } + /** * * @@ -2142,13 +2267,14 @@ public Builder setCreateTime(com.google.protobuf.Timestamp value) { throw new NullPointerException(); } createTime_ = value; - onChanged(); } else { createTimeBuilder_.setMessage(value); } - + bitField0_ |= 0x00000040; + onChanged(); return this; } + /** * * @@ -2163,13 +2289,14 @@ public Builder setCreateTime(com.google.protobuf.Timestamp value) { public Builder setCreateTime(com.google.protobuf.Timestamp.Builder builderForValue) { if (createTimeBuilder_ == null) { createTime_ = builderForValue.build(); - onChanged(); } else { createTimeBuilder_.setMessage(builderForValue.build()); } - + bitField0_ |= 0x00000040; + onChanged(); return this; } + /** * * @@ -2183,19 +2310,23 @@ public Builder setCreateTime(com.google.protobuf.Timestamp.Builder builderForVal */ public Builder mergeCreateTime(com.google.protobuf.Timestamp value) { if (createTimeBuilder_ == null) { - if (createTime_ != null) { - createTime_ = - com.google.protobuf.Timestamp.newBuilder(createTime_).mergeFrom(value).buildPartial(); + if (((bitField0_ & 0x00000040) != 0) + && createTime_ != null + && createTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getCreateTimeBuilder().mergeFrom(value); } else { createTime_ = value; } - onChanged(); } else { createTimeBuilder_.mergeFrom(value); } - + if (createTime_ != null) { + bitField0_ |= 0x00000040; + onChanged(); + } return this; } + /** * * @@ -2208,16 +2339,16 @@ public Builder mergeCreateTime(com.google.protobuf.Timestamp value) { * */ public Builder clearCreateTime() { - if (createTimeBuilder_ == null) { - createTime_ = null; - onChanged(); - } else { - createTime_ = null; + bitField0_ = (bitField0_ & ~0x00000040); + createTime_ = null; + if (createTimeBuilder_ != null) { + createTimeBuilder_.dispose(); createTimeBuilder_ = null; } - + onChanged(); return this; } + /** * * @@ -2230,10 +2361,11 @@ public Builder clearCreateTime() { * */ public com.google.protobuf.Timestamp.Builder getCreateTimeBuilder() { - + bitField0_ |= 0x00000040; onChanged(); - return getCreateTimeFieldBuilder().getBuilder(); + return internalGetCreateTimeFieldBuilder().getBuilder(); } + /** * * @@ -2254,6 +2386,7 @@ public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { : createTime_; } } + /** * * @@ -2265,14 +2398,14 @@ public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { * .google.protobuf.Timestamp create_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; * */ - private com.google.protobuf.SingleFieldBuilderV3< + private com.google.protobuf.SingleFieldBuilder< com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder> - getCreateTimeFieldBuilder() { + internalGetCreateTimeFieldBuilder() { if (createTimeBuilder_ == null) { createTimeBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< + new com.google.protobuf.SingleFieldBuilder< com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder>( @@ -2283,11 +2416,12 @@ public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { } private com.google.protobuf.Timestamp updateTime_; - private com.google.protobuf.SingleFieldBuilderV3< + private com.google.protobuf.SingleFieldBuilder< com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder> updateTimeBuilder_; + /** * * @@ -2302,8 +2436,9 @@ public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { * @return Whether the updateTime field is set. */ public boolean hasUpdateTime() { - return updateTimeBuilder_ != null || updateTime_ != null; + return ((bitField0_ & 0x00000080) != 0); } + /** * * @@ -2326,6 +2461,7 @@ public com.google.protobuf.Timestamp getUpdateTime() { return updateTimeBuilder_.getMessage(); } } + /** * * @@ -2343,13 +2479,14 @@ public Builder setUpdateTime(com.google.protobuf.Timestamp value) { throw new NullPointerException(); } updateTime_ = value; - onChanged(); } else { updateTimeBuilder_.setMessage(value); } - + bitField0_ |= 0x00000080; + onChanged(); return this; } + /** * * @@ -2364,13 +2501,14 @@ public Builder setUpdateTime(com.google.protobuf.Timestamp value) { public Builder setUpdateTime(com.google.protobuf.Timestamp.Builder builderForValue) { if (updateTimeBuilder_ == null) { updateTime_ = builderForValue.build(); - onChanged(); } else { updateTimeBuilder_.setMessage(builderForValue.build()); } - + bitField0_ |= 0x00000080; + onChanged(); return this; } + /** * * @@ -2384,19 +2522,23 @@ public Builder setUpdateTime(com.google.protobuf.Timestamp.Builder builderForVal */ public Builder mergeUpdateTime(com.google.protobuf.Timestamp value) { if (updateTimeBuilder_ == null) { - if (updateTime_ != null) { - updateTime_ = - com.google.protobuf.Timestamp.newBuilder(updateTime_).mergeFrom(value).buildPartial(); + if (((bitField0_ & 0x00000080) != 0) + && updateTime_ != null + && updateTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getUpdateTimeBuilder().mergeFrom(value); } else { updateTime_ = value; } - onChanged(); } else { updateTimeBuilder_.mergeFrom(value); } - + if (updateTime_ != null) { + bitField0_ |= 0x00000080; + onChanged(); + } return this; } + /** * * @@ -2409,16 +2551,16 @@ public Builder mergeUpdateTime(com.google.protobuf.Timestamp value) { * */ public Builder clearUpdateTime() { - if (updateTimeBuilder_ == null) { - updateTime_ = null; - onChanged(); - } else { - updateTime_ = null; + bitField0_ = (bitField0_ & ~0x00000080); + updateTime_ = null; + if (updateTimeBuilder_ != null) { + updateTimeBuilder_.dispose(); updateTimeBuilder_ = null; } - + onChanged(); return this; } + /** * * @@ -2431,10 +2573,11 @@ public Builder clearUpdateTime() { * */ public com.google.protobuf.Timestamp.Builder getUpdateTimeBuilder() { - + bitField0_ |= 0x00000080; onChanged(); - return getUpdateTimeFieldBuilder().getBuilder(); + return internalGetUpdateTimeFieldBuilder().getBuilder(); } + /** * * @@ -2455,6 +2598,7 @@ public com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder() { : updateTime_; } } + /** * * @@ -2466,14 +2610,14 @@ public com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder() { * .google.protobuf.Timestamp update_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; * */ - private com.google.protobuf.SingleFieldBuilderV3< + private com.google.protobuf.SingleFieldBuilder< com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder> - getUpdateTimeFieldBuilder() { + internalGetUpdateTimeFieldBuilder() { if (updateTimeBuilder_ == null) { updateTimeBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< + new com.google.protobuf.SingleFieldBuilder< com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder>( @@ -2484,11 +2628,12 @@ public com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder() { } private com.google.protobuf.Timestamp deleteTime_; - private com.google.protobuf.SingleFieldBuilderV3< + private com.google.protobuf.SingleFieldBuilder< com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder> deleteTimeBuilder_; + /** * * @@ -2503,8 +2648,9 @@ public com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder() { * @return Whether the deleteTime field is set. */ public boolean hasDeleteTime() { - return deleteTimeBuilder_ != null || deleteTime_ != null; + return ((bitField0_ & 0x00000100) != 0); } + /** * * @@ -2527,6 +2673,7 @@ public com.google.protobuf.Timestamp getDeleteTime() { return deleteTimeBuilder_.getMessage(); } } + /** * * @@ -2544,13 +2691,14 @@ public Builder setDeleteTime(com.google.protobuf.Timestamp value) { throw new NullPointerException(); } deleteTime_ = value; - onChanged(); } else { deleteTimeBuilder_.setMessage(value); } - + bitField0_ |= 0x00000100; + onChanged(); return this; } + /** * * @@ -2565,13 +2713,14 @@ public Builder setDeleteTime(com.google.protobuf.Timestamp value) { public Builder setDeleteTime(com.google.protobuf.Timestamp.Builder builderForValue) { if (deleteTimeBuilder_ == null) { deleteTime_ = builderForValue.build(); - onChanged(); } else { deleteTimeBuilder_.setMessage(builderForValue.build()); } - + bitField0_ |= 0x00000100; + onChanged(); return this; } + /** * * @@ -2585,19 +2734,23 @@ public Builder setDeleteTime(com.google.protobuf.Timestamp.Builder builderForVal */ public Builder mergeDeleteTime(com.google.protobuf.Timestamp value) { if (deleteTimeBuilder_ == null) { - if (deleteTime_ != null) { - deleteTime_ = - com.google.protobuf.Timestamp.newBuilder(deleteTime_).mergeFrom(value).buildPartial(); + if (((bitField0_ & 0x00000100) != 0) + && deleteTime_ != null + && deleteTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getDeleteTimeBuilder().mergeFrom(value); } else { deleteTime_ = value; } - onChanged(); } else { deleteTimeBuilder_.mergeFrom(value); } - + if (deleteTime_ != null) { + bitField0_ |= 0x00000100; + onChanged(); + } return this; } + /** * * @@ -2610,16 +2763,16 @@ public Builder mergeDeleteTime(com.google.protobuf.Timestamp value) { * */ public Builder clearDeleteTime() { - if (deleteTimeBuilder_ == null) { - deleteTime_ = null; - onChanged(); - } else { - deleteTime_ = null; + bitField0_ = (bitField0_ & ~0x00000100); + deleteTime_ = null; + if (deleteTimeBuilder_ != null) { + deleteTimeBuilder_.dispose(); deleteTimeBuilder_ = null; } - + onChanged(); return this; } + /** * * @@ -2632,10 +2785,11 @@ public Builder clearDeleteTime() { * */ public com.google.protobuf.Timestamp.Builder getDeleteTimeBuilder() { - + bitField0_ |= 0x00000100; onChanged(); - return getDeleteTimeFieldBuilder().getBuilder(); + return internalGetDeleteTimeFieldBuilder().getBuilder(); } + /** * * @@ -2656,6 +2810,7 @@ public com.google.protobuf.TimestampOrBuilder getDeleteTimeOrBuilder() { : deleteTime_; } } + /** * * @@ -2667,14 +2822,14 @@ public com.google.protobuf.TimestampOrBuilder getDeleteTimeOrBuilder() { * .google.protobuf.Timestamp delete_time = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; * */ - private com.google.protobuf.SingleFieldBuilderV3< + private com.google.protobuf.SingleFieldBuilder< com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder> - getDeleteTimeFieldBuilder() { + internalGetDeleteTimeFieldBuilder() { if (deleteTimeBuilder_ == null) { deleteTimeBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< + new com.google.protobuf.SingleFieldBuilder< com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder>( @@ -2688,13 +2843,13 @@ public com.google.protobuf.TimestampOrBuilder getDeleteTimeOrBuilder() { java.util.Collections.emptyList(); private void ensureRulesIsMutable() { - if (!((bitField0_ & 0x00000002) != 0)) { + if (!((bitField0_ & 0x00000200) != 0)) { rules_ = new java.util.ArrayList(rules_); - bitField0_ |= 0x00000002; + bitField0_ |= 0x00000200; } } - private com.google.protobuf.RepeatedFieldBuilderV3< + private com.google.protobuf.RepeatedFieldBuilder< com.google.iam.v2beta.PolicyRule, com.google.iam.v2beta.PolicyRule.Builder, com.google.iam.v2beta.PolicyRuleOrBuilder> @@ -2717,6 +2872,7 @@ public java.util.List getRulesList() { return rulesBuilder_.getMessageList(); } } + /** * * @@ -2734,6 +2890,7 @@ public int getRulesCount() { return rulesBuilder_.getCount(); } } + /** * * @@ -2751,6 +2908,7 @@ public com.google.iam.v2beta.PolicyRule getRules(int index) { return rulesBuilder_.getMessage(index); } } + /** * * @@ -2774,6 +2932,7 @@ public Builder setRules(int index, com.google.iam.v2beta.PolicyRule value) { } return this; } + /** * * @@ -2794,6 +2953,7 @@ public Builder setRules(int index, com.google.iam.v2beta.PolicyRule.Builder buil } return this; } + /** * * @@ -2817,6 +2977,7 @@ public Builder addRules(com.google.iam.v2beta.PolicyRule value) { } return this; } + /** * * @@ -2840,6 +3001,7 @@ public Builder addRules(int index, com.google.iam.v2beta.PolicyRule value) { } return this; } + /** * * @@ -2860,6 +3022,7 @@ public Builder addRules(com.google.iam.v2beta.PolicyRule.Builder builderForValue } return this; } + /** * * @@ -2880,6 +3043,7 @@ public Builder addRules(int index, com.google.iam.v2beta.PolicyRule.Builder buil } return this; } + /** * * @@ -2901,6 +3065,7 @@ public Builder addAllRules( } return this; } + /** * * @@ -2914,13 +3079,14 @@ public Builder addAllRules( public Builder clearRules() { if (rulesBuilder_ == null) { rules_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000002); + bitField0_ = (bitField0_ & ~0x00000200); onChanged(); } else { rulesBuilder_.clear(); } return this; } + /** * * @@ -2941,6 +3107,7 @@ public Builder removeRules(int index) { } return this; } + /** * * @@ -2952,8 +3119,9 @@ public Builder removeRules(int index) { * repeated .google.iam.v2beta.PolicyRule rules = 10; */ public com.google.iam.v2beta.PolicyRule.Builder getRulesBuilder(int index) { - return getRulesFieldBuilder().getBuilder(index); + return internalGetRulesFieldBuilder().getBuilder(index); } + /** * * @@ -2971,6 +3139,7 @@ public com.google.iam.v2beta.PolicyRuleOrBuilder getRulesOrBuilder(int index) { return rulesBuilder_.getMessageOrBuilder(index); } } + /** * * @@ -2989,6 +3158,7 @@ public com.google.iam.v2beta.PolicyRuleOrBuilder getRulesOrBuilder(int index) { return java.util.Collections.unmodifiableList(rules_); } } + /** * * @@ -3000,9 +3170,10 @@ public com.google.iam.v2beta.PolicyRuleOrBuilder getRulesOrBuilder(int index) { * repeated .google.iam.v2beta.PolicyRule rules = 10; */ public com.google.iam.v2beta.PolicyRule.Builder addRulesBuilder() { - return getRulesFieldBuilder() + return internalGetRulesFieldBuilder() .addBuilder(com.google.iam.v2beta.PolicyRule.getDefaultInstance()); } + /** * * @@ -3014,9 +3185,10 @@ public com.google.iam.v2beta.PolicyRule.Builder addRulesBuilder() { * repeated .google.iam.v2beta.PolicyRule rules = 10; */ public com.google.iam.v2beta.PolicyRule.Builder addRulesBuilder(int index) { - return getRulesFieldBuilder() + return internalGetRulesFieldBuilder() .addBuilder(index, com.google.iam.v2beta.PolicyRule.getDefaultInstance()); } + /** * * @@ -3028,37 +3200,26 @@ public com.google.iam.v2beta.PolicyRule.Builder addRulesBuilder(int index) { * repeated .google.iam.v2beta.PolicyRule rules = 10; */ public java.util.List getRulesBuilderList() { - return getRulesFieldBuilder().getBuilderList(); + return internalGetRulesFieldBuilder().getBuilderList(); } - private com.google.protobuf.RepeatedFieldBuilderV3< + private com.google.protobuf.RepeatedFieldBuilder< com.google.iam.v2beta.PolicyRule, com.google.iam.v2beta.PolicyRule.Builder, com.google.iam.v2beta.PolicyRuleOrBuilder> - getRulesFieldBuilder() { + internalGetRulesFieldBuilder() { if (rulesBuilder_ == null) { rulesBuilder_ = - new com.google.protobuf.RepeatedFieldBuilderV3< + new com.google.protobuf.RepeatedFieldBuilder< com.google.iam.v2beta.PolicyRule, com.google.iam.v2beta.PolicyRule.Builder, com.google.iam.v2beta.PolicyRuleOrBuilder>( - rules_, ((bitField0_ & 0x00000002) != 0), getParentForChildren(), isClean()); + rules_, ((bitField0_ & 0x00000200) != 0), getParentForChildren(), isClean()); rules_ = null; } return rulesBuilder_; } - @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.iam.v2beta.Policy) } diff --git a/java-iam/proto-google-iam-v2beta/src/main/java/com/google/iam/v2beta/PolicyOperationMetadata.java b/java-iam/proto-google-iam-v2beta/src/main/java/com/google/iam/v2beta/PolicyOperationMetadata.java index 766a87f7cb..41b561e459 100644 --- a/java-iam/proto-google-iam-v2beta/src/main/java/com/google/iam/v2beta/PolicyOperationMetadata.java +++ b/java-iam/proto-google-iam-v2beta/src/main/java/com/google/iam/v2beta/PolicyOperationMetadata.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,9 @@ * limitations under the License. */ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: google/iam/v2beta/policy.proto +// Protobuf Java Version: 4.33.2 package com.google.iam.v2beta; @@ -27,36 +29,37 @@ * * Protobuf type {@code google.iam.v2beta.PolicyOperationMetadata} */ -public final class PolicyOperationMetadata extends com.google.protobuf.GeneratedMessageV3 +@com.google.protobuf.Generated +public final class PolicyOperationMetadata extends com.google.protobuf.GeneratedMessage implements // @@protoc_insertion_point(message_implements:google.iam.v2beta.PolicyOperationMetadata) PolicyOperationMetadataOrBuilder { private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "PolicyOperationMetadata"); + } + // Use PolicyOperationMetadata.newBuilder() to construct. - private PolicyOperationMetadata(com.google.protobuf.GeneratedMessageV3.Builder builder) { + private PolicyOperationMetadata(com.google.protobuf.GeneratedMessage.Builder builder) { super(builder); } private PolicyOperationMetadata() {} - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new PolicyOperationMetadata(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.iam.v2beta.PolicyProto .internal_static_google_iam_v2beta_PolicyOperationMetadata_descriptor; } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.iam.v2beta.PolicyProto .internal_static_google_iam_v2beta_PolicyOperationMetadata_fieldAccessorTable @@ -65,8 +68,10 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { com.google.iam.v2beta.PolicyOperationMetadata.Builder.class); } + private int bitField0_; public static final int CREATE_TIME_FIELD_NUMBER = 1; private com.google.protobuf.Timestamp createTime_; + /** * * @@ -80,8 +85,9 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { */ @java.lang.Override public boolean hasCreateTime() { - return createTime_ != null; + return ((bitField0_ & 0x00000001) != 0); } + /** * * @@ -97,6 +103,7 @@ public boolean hasCreateTime() { public com.google.protobuf.Timestamp getCreateTime() { return createTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : createTime_; } + /** * * @@ -108,7 +115,7 @@ public com.google.protobuf.Timestamp getCreateTime() { */ @java.lang.Override public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { - return getCreateTime(); + return createTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : createTime_; } private byte memoizedIsInitialized = -1; @@ -125,7 +132,7 @@ public final boolean isInitialized() { @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (createTime_ != null) { + if (((bitField0_ & 0x00000001) != 0)) { output.writeMessage(1, getCreateTime()); } getUnknownFields().writeTo(output); @@ -137,7 +144,7 @@ public int getSerializedSize() { if (size != -1) return size; size = 0; - if (createTime_ != null) { + if (((bitField0_ & 0x00000001) != 0)) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getCreateTime()); } size += getUnknownFields().getSerializedSize(); @@ -217,38 +224,38 @@ public static com.google.iam.v2beta.PolicyOperationMetadata parseFrom( public static com.google.iam.v2beta.PolicyOperationMetadata parseFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); } public static com.google.iam.v2beta.PolicyOperationMetadata parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } public static com.google.iam.v2beta.PolicyOperationMetadata parseDelimitedFrom( java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); } public static com.google.iam.v2beta.PolicyOperationMetadata parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( PARSER, input, extensionRegistry); } public static com.google.iam.v2beta.PolicyOperationMetadata parseFrom( com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); } public static com.google.iam.v2beta.PolicyOperationMetadata parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } @@ -271,10 +278,11 @@ public Builder toBuilder() { } @java.lang.Override - protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { Builder builder = new Builder(parent); return builder; } + /** * * @@ -284,7 +292,7 @@ protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.Build * * Protobuf type {@code google.iam.v2beta.PolicyOperationMetadata} */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder implements // @@protoc_insertion_point(builder_implements:google.iam.v2beta.PolicyOperationMetadata) com.google.iam.v2beta.PolicyOperationMetadataOrBuilder { @@ -294,7 +302,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.iam.v2beta.PolicyProto .internal_static_google_iam_v2beta_PolicyOperationMetadata_fieldAccessorTable @@ -304,19 +312,28 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } // Construct using com.google.iam.v2beta.PolicyOperationMetadata.newBuilder() - private Builder() {} + private Builder() { + maybeForceBuilderInitialization(); + } - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetCreateTimeFieldBuilder(); + } } @java.lang.Override public Builder clear() { super.clear(); - if (createTimeBuilder_ == null) { - createTime_ = null; - } else { - createTime_ = null; + bitField0_ = 0; + createTime_ = null; + if (createTimeBuilder_ != null) { + createTimeBuilder_.dispose(); createTimeBuilder_ = null; } return this; @@ -346,46 +363,21 @@ public com.google.iam.v2beta.PolicyOperationMetadata build() { public com.google.iam.v2beta.PolicyOperationMetadata buildPartial() { com.google.iam.v2beta.PolicyOperationMetadata result = new com.google.iam.v2beta.PolicyOperationMetadata(this); - if (createTimeBuilder_ == null) { - result.createTime_ = createTime_; - } else { - result.createTime_ = createTimeBuilder_.build(); + if (bitField0_ != 0) { + buildPartial0(result); } 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); + private void buildPartial0(com.google.iam.v2beta.PolicyOperationMetadata result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.createTime_ = createTimeBuilder_ == null ? createTime_ : createTimeBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + result.bitField0_ |= to_bitField0_; } @java.lang.Override @@ -431,8 +423,9 @@ public Builder mergeFrom( break; case 10: { - input.readMessage(getCreateTimeFieldBuilder().getBuilder(), extensionRegistry); - + input.readMessage( + internalGetCreateTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000001; break; } // case 10 default: @@ -452,12 +445,15 @@ public Builder mergeFrom( return this; } + private int bitField0_; + private com.google.protobuf.Timestamp createTime_; - private com.google.protobuf.SingleFieldBuilderV3< + private com.google.protobuf.SingleFieldBuilder< com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder> createTimeBuilder_; + /** * * @@ -470,8 +466,9 @@ public Builder mergeFrom( * @return Whether the createTime field is set. */ public boolean hasCreateTime() { - return createTimeBuilder_ != null || createTime_ != null; + return ((bitField0_ & 0x00000001) != 0); } + /** * * @@ -492,6 +489,7 @@ public com.google.protobuf.Timestamp getCreateTime() { return createTimeBuilder_.getMessage(); } } + /** * * @@ -507,13 +505,14 @@ public Builder setCreateTime(com.google.protobuf.Timestamp value) { throw new NullPointerException(); } createTime_ = value; - onChanged(); } else { createTimeBuilder_.setMessage(value); } - + bitField0_ |= 0x00000001; + onChanged(); return this; } + /** * * @@ -526,13 +525,14 @@ public Builder setCreateTime(com.google.protobuf.Timestamp value) { public Builder setCreateTime(com.google.protobuf.Timestamp.Builder builderForValue) { if (createTimeBuilder_ == null) { createTime_ = builderForValue.build(); - onChanged(); } else { createTimeBuilder_.setMessage(builderForValue.build()); } - + bitField0_ |= 0x00000001; + onChanged(); return this; } + /** * * @@ -544,19 +544,23 @@ public Builder setCreateTime(com.google.protobuf.Timestamp.Builder builderForVal */ public Builder mergeCreateTime(com.google.protobuf.Timestamp value) { if (createTimeBuilder_ == null) { - if (createTime_ != null) { - createTime_ = - com.google.protobuf.Timestamp.newBuilder(createTime_).mergeFrom(value).buildPartial(); + if (((bitField0_ & 0x00000001) != 0) + && createTime_ != null + && createTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getCreateTimeBuilder().mergeFrom(value); } else { createTime_ = value; } - onChanged(); } else { createTimeBuilder_.mergeFrom(value); } - + if (createTime_ != null) { + bitField0_ |= 0x00000001; + onChanged(); + } return this; } + /** * * @@ -567,16 +571,16 @@ public Builder mergeCreateTime(com.google.protobuf.Timestamp value) { * .google.protobuf.Timestamp create_time = 1; */ public Builder clearCreateTime() { - if (createTimeBuilder_ == null) { - createTime_ = null; - onChanged(); - } else { - createTime_ = null; + bitField0_ = (bitField0_ & ~0x00000001); + createTime_ = null; + if (createTimeBuilder_ != null) { + createTimeBuilder_.dispose(); createTimeBuilder_ = null; } - + onChanged(); return this; } + /** * * @@ -587,10 +591,11 @@ public Builder clearCreateTime() { * .google.protobuf.Timestamp create_time = 1; */ public com.google.protobuf.Timestamp.Builder getCreateTimeBuilder() { - + bitField0_ |= 0x00000001; onChanged(); - return getCreateTimeFieldBuilder().getBuilder(); + return internalGetCreateTimeFieldBuilder().getBuilder(); } + /** * * @@ -609,6 +614,7 @@ public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { : createTime_; } } + /** * * @@ -618,14 +624,14 @@ public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { * * .google.protobuf.Timestamp create_time = 1; */ - private com.google.protobuf.SingleFieldBuilderV3< + private com.google.protobuf.SingleFieldBuilder< com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder> - getCreateTimeFieldBuilder() { + internalGetCreateTimeFieldBuilder() { if (createTimeBuilder_ == null) { createTimeBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< + new com.google.protobuf.SingleFieldBuilder< com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder>( @@ -635,17 +641,6 @@ public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { 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.iam.v2beta.PolicyOperationMetadata) } diff --git a/java-iam/proto-google-iam-v2beta/src/main/java/com/google/iam/v2beta/PolicyOperationMetadataOrBuilder.java b/java-iam/proto-google-iam-v2beta/src/main/java/com/google/iam/v2beta/PolicyOperationMetadataOrBuilder.java index 11fc1dca82..7815428cf7 100644 --- a/java-iam/proto-google-iam-v2beta/src/main/java/com/google/iam/v2beta/PolicyOperationMetadataOrBuilder.java +++ b/java-iam/proto-google-iam-v2beta/src/main/java/com/google/iam/v2beta/PolicyOperationMetadataOrBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,10 +14,13 @@ * limitations under the License. */ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: google/iam/v2beta/policy.proto +// Protobuf Java Version: 4.33.2 package com.google.iam.v2beta; +@com.google.protobuf.Generated public interface PolicyOperationMetadataOrBuilder extends // @@protoc_insertion_point(interface_extends:google.iam.v2beta.PolicyOperationMetadata) @@ -35,6 +38,7 @@ public interface PolicyOperationMetadataOrBuilder * @return Whether the createTime field is set. */ boolean hasCreateTime(); + /** * * @@ -47,6 +51,7 @@ public interface PolicyOperationMetadataOrBuilder * @return The createTime. */ com.google.protobuf.Timestamp getCreateTime(); + /** * * diff --git a/java-iam/proto-google-iam-v2beta/src/main/java/com/google/iam/v2beta/PolicyOrBuilder.java b/java-iam/proto-google-iam-v2beta/src/main/java/com/google/iam/v2beta/PolicyOrBuilder.java index fdfbab3396..2801496c58 100644 --- a/java-iam/proto-google-iam-v2beta/src/main/java/com/google/iam/v2beta/PolicyOrBuilder.java +++ b/java-iam/proto-google-iam-v2beta/src/main/java/com/google/iam/v2beta/PolicyOrBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,10 +14,13 @@ * limitations under the License. */ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: google/iam/v2beta/policy.proto +// Protobuf Java Version: 4.33.2 package com.google.iam.v2beta; +@com.google.protobuf.Generated public interface PolicyOrBuilder extends // @@protoc_insertion_point(interface_extends:google.iam.v2beta.Policy) @@ -29,10 +32,13 @@ public interface PolicyOrBuilder *
            * Immutable. The resource name of the `Policy`, which must be unique. Format:
            * `policies/{attachment_point}/denypolicies/{policy_id}`
        +   *
        +   *
            * The attachment point is identified by its URL-encoded full resource name,
            * which means that the forward-slash character, `/`, must be written as
            * `%2F`. For example,
            * `policies/cloudresourcemanager.googleapis.com%2Fprojects%2Fmy-project/denypolicies/my-deny-policy`.
        +   *
            * For organizations and folders, use the numeric ID in the full resource
            * name. For projects, requests can use the alphanumeric or the numeric ID.
            * Responses always contain the numeric ID.
        @@ -43,16 +49,20 @@ public interface PolicyOrBuilder
            * @return The name.
            */
           java.lang.String getName();
        +
           /**
            *
            *
            * 
            * Immutable. The resource name of the `Policy`, which must be unique. Format:
            * `policies/{attachment_point}/denypolicies/{policy_id}`
        +   *
        +   *
            * The attachment point is identified by its URL-encoded full resource name,
            * which means that the forward-slash character, `/`, must be written as
            * `%2F`. For example,
            * `policies/cloudresourcemanager.googleapis.com%2Fprojects%2Fmy-project/denypolicies/my-deny-policy`.
        +   *
            * For organizations and folders, use the numeric ID in the full resource
            * name. For projects, requests can use the alphanumeric or the numeric ID.
            * Responses always contain the numeric ID.
        @@ -77,6 +87,7 @@ public interface PolicyOrBuilder
            * @return The uid.
            */
           java.lang.String getUid();
        +
           /**
            *
            *
        @@ -103,6 +114,7 @@ public interface PolicyOrBuilder
            * @return The kind.
            */
           java.lang.String getKind();
        +
           /**
            *
            *
        @@ -129,6 +141,7 @@ public interface PolicyOrBuilder
            * @return The displayName.
            */
           java.lang.String getDisplayName();
        +
           /**
            *
            *
        @@ -154,6 +167,7 @@ public interface PolicyOrBuilder
            * map<string, string> annotations = 5;
            */
           int getAnnotationsCount();
        +
           /**
            *
            *
        @@ -165,9 +179,11 @@ public interface PolicyOrBuilder
            * map<string, string> annotations = 5;
            */
           boolean containsAnnotations(java.lang.String key);
        +
           /** Use {@link #getAnnotationsMap()} instead. */
           @java.lang.Deprecated
           java.util.Map getAnnotations();
        +
           /**
            *
            *
        @@ -179,6 +195,7 @@ public interface PolicyOrBuilder
            * map<string, string> annotations = 5;
            */
           java.util.Map getAnnotationsMap();
        +
           /**
            *
            *
        @@ -189,12 +206,12 @@ public interface PolicyOrBuilder
            *
            * map<string, string> annotations = 5;
            */
        -
           /* nullable */
           java.lang.String getAnnotationsOrDefault(
               java.lang.String key,
               /* nullable */
               java.lang.String defaultValue);
        +
           /**
            *
            *
        @@ -214,6 +231,7 @@ java.lang.String getAnnotationsOrDefault(
            * An opaque tag that identifies the current version of the `Policy`. IAM uses
            * this value to help manage concurrent updates, so they do not cause one
            * update to be overwritten by another.
        +   *
            * If this field is present in a [CreatePolicy][] request, the value is
            * ignored.
            * 
        @@ -223,6 +241,7 @@ java.lang.String getAnnotationsOrDefault( * @return The etag. */ java.lang.String getEtag(); + /** * * @@ -230,6 +249,7 @@ java.lang.String getAnnotationsOrDefault( * An opaque tag that identifies the current version of the `Policy`. IAM uses * this value to help manage concurrent updates, so they do not cause one * update to be overwritten by another. + * * If this field is present in a [CreatePolicy][] request, the value is * ignored. *
        @@ -253,6 +273,7 @@ java.lang.String getAnnotationsOrDefault( * @return Whether the createTime field is set. */ boolean hasCreateTime(); + /** * * @@ -266,6 +287,7 @@ java.lang.String getAnnotationsOrDefault( * @return The createTime. */ com.google.protobuf.Timestamp getCreateTime(); + /** * * @@ -291,6 +313,7 @@ java.lang.String getAnnotationsOrDefault( * @return Whether the updateTime field is set. */ boolean hasUpdateTime(); + /** * * @@ -304,6 +327,7 @@ java.lang.String getAnnotationsOrDefault( * @return The updateTime. */ com.google.protobuf.Timestamp getUpdateTime(); + /** * * @@ -329,6 +353,7 @@ java.lang.String getAnnotationsOrDefault( * @return Whether the deleteTime field is set. */ boolean hasDeleteTime(); + /** * * @@ -342,6 +367,7 @@ java.lang.String getAnnotationsOrDefault( * @return The deleteTime. */ com.google.protobuf.Timestamp getDeleteTime(); + /** * * @@ -365,6 +391,7 @@ java.lang.String getAnnotationsOrDefault( * repeated .google.iam.v2beta.PolicyRule rules = 10; */ java.util.List getRulesList(); + /** * * @@ -376,6 +403,7 @@ java.lang.String getAnnotationsOrDefault( * repeated .google.iam.v2beta.PolicyRule rules = 10; */ com.google.iam.v2beta.PolicyRule getRules(int index); + /** * * @@ -387,6 +415,7 @@ java.lang.String getAnnotationsOrDefault( * repeated .google.iam.v2beta.PolicyRule rules = 10; */ int getRulesCount(); + /** * * @@ -398,6 +427,7 @@ java.lang.String getAnnotationsOrDefault( * repeated .google.iam.v2beta.PolicyRule rules = 10; */ java.util.List getRulesOrBuilderList(); + /** * * diff --git a/java-iam/proto-google-iam-v2beta/src/main/java/com/google/iam/v2beta/PolicyProto.java b/java-iam/proto-google-iam-v2beta/src/main/java/com/google/iam/v2beta/PolicyProto.java index fd7363e931..ff54ed6776 100644 --- a/java-iam/proto-google-iam-v2beta/src/main/java/com/google/iam/v2beta/PolicyProto.java +++ b/java-iam/proto-google-iam-v2beta/src/main/java/com/google/iam/v2beta/PolicyProto.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,13 +14,26 @@ * limitations under the License. */ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: google/iam/v2beta/policy.proto +// Protobuf Java Version: 4.33.2 package com.google.iam.v2beta; -public final class PolicyProto { +@com.google.protobuf.Generated +public final class PolicyProto extends com.google.protobuf.GeneratedFile { private PolicyProto() {} + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "PolicyProto"); + } + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistryLite registry) {} public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry registry) { @@ -29,43 +42,43 @@ public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry r static final com.google.protobuf.Descriptors.Descriptor internal_static_google_iam_v2beta_Policy_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable internal_static_google_iam_v2beta_Policy_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_google_iam_v2beta_Policy_AnnotationsEntry_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable internal_static_google_iam_v2beta_Policy_AnnotationsEntry_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_google_iam_v2beta_PolicyRule_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable internal_static_google_iam_v2beta_PolicyRule_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_google_iam_v2beta_ListPoliciesRequest_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable internal_static_google_iam_v2beta_ListPoliciesRequest_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_google_iam_v2beta_ListPoliciesResponse_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable internal_static_google_iam_v2beta_ListPoliciesResponse_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_google_iam_v2beta_GetPolicyRequest_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable internal_static_google_iam_v2beta_GetPolicyRequest_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_google_iam_v2beta_CreatePolicyRequest_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable internal_static_google_iam_v2beta_CreatePolicyRequest_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_google_iam_v2beta_UpdatePolicyRequest_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable internal_static_google_iam_v2beta_UpdatePolicyRequest_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_google_iam_v2beta_DeletePolicyRequest_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable internal_static_google_iam_v2beta_DeletePolicyRequest_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_google_iam_v2beta_PolicyOperationMetadata_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable internal_static_google_iam_v2beta_PolicyOperationMetadata_fieldAccessorTable; public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { @@ -76,65 +89,75 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { static { java.lang.String[] descriptorData = { - "\n\036google/iam/v2beta/policy.proto\022\021google" + "\n" + + "\036google/iam/v2beta/policy.proto\022\021google" + ".iam.v2beta\032\034google/api/annotations.prot" + "o\032\027google/api/client.proto\032\037google/api/f" + "ield_behavior.proto\032\034google/iam/v2beta/d" + "eny.proto\032#google/longrunning/operations" - + ".proto\032\037google/protobuf/timestamp.proto\"" - + "\251\003\n\006Policy\022\021\n\004name\030\001 \001(\tB\003\340A\005\022\020\n\003uid\030\002 \001" - + "(\tB\003\340A\005\022\021\n\004kind\030\003 \001(\tB\003\340A\003\022\024\n\014display_na" - + "me\030\004 \001(\t\022?\n\013annotations\030\005 \003(\0132*.google.i" - + "am.v2beta.Policy.AnnotationsEntry\022\014\n\004eta" - + "g\030\006 \001(\t\0224\n\013create_time\030\007 \001(\0132\032.google.pr" - + "otobuf.TimestampB\003\340A\003\0224\n\013update_time\030\010 \001" - + "(\0132\032.google.protobuf.TimestampB\003\340A\003\0224\n\013d" - + "elete_time\030\t \001(\0132\032.google.protobuf.Times" - + "tampB\003\340A\003\022,\n\005rules\030\n \003(\0132\035.google.iam.v2" - + "beta.PolicyRule\0322\n\020AnnotationsEntry\022\013\n\003k" - + "ey\030\001 \001(\t\022\r\n\005value\030\002 \001(\t:\0028\001\"[\n\nPolicyRul" - + "e\0220\n\tdeny_rule\030\002 \001(\0132\033.google.iam.v2beta" - + ".DenyRuleH\000\022\023\n\013description\030\001 \001(\tB\006\n\004kind" - + "\"Q\n\023ListPoliciesRequest\022\023\n\006parent\030\001 \001(\tB" - + "\003\340A\002\022\021\n\tpage_size\030\002 \001(\005\022\022\n\npage_token\030\003 " - + "\001(\t\"\\\n\024ListPoliciesResponse\022+\n\010policies\030" - + "\001 \003(\0132\031.google.iam.v2beta.Policy\022\027\n\017next" - + "_page_token\030\002 \001(\t\"%\n\020GetPolicyRequest\022\021\n" - + "\004name\030\001 \001(\tB\003\340A\002\"m\n\023CreatePolicyRequest\022" - + "\023\n\006parent\030\001 \001(\tB\003\340A\002\022.\n\006policy\030\002 \001(\0132\031.g" - + "oogle.iam.v2beta.PolicyB\003\340A\002\022\021\n\tpolicy_i" - + "d\030\003 \001(\t\"E\n\023UpdatePolicyRequest\022.\n\006policy" - + "\030\001 \001(\0132\031.google.iam.v2beta.PolicyB\003\340A\002\";" - + "\n\023DeletePolicyRequest\022\021\n\004name\030\001 \001(\tB\003\340A\002" - + "\022\021\n\004etag\030\002 \001(\tB\003\340A\001\"J\n\027PolicyOperationMe" - + "tadata\022/\n\013create_time\030\001 \001(\0132\032.google.pro" - + "tobuf.Timestamp2\200\007\n\010Policies\022\217\001\n\014ListPol" - + "icies\022&.google.iam.v2beta.ListPoliciesRe" + + ".proto\032\037google/protobuf/timestamp.proto\"\251\003\n" + + "\006Policy\022\021\n" + + "\004name\030\001 \001(\tB\003\340A\005\022\020\n" + + "\003uid\030\002 \001(\tB\003\340A\005\022\021\n" + + "\004kind\030\003 \001(\tB\003\340A\003\022\024\n" + + "\014display_name\030\004 \001(\t\022?\n" + + "\013annotations\030\005" + + " \003(\0132*.google.iam.v2beta.Policy.AnnotationsEntry\022\014\n" + + "\004etag\030\006 \001(\t\0224\n" + + "\013create_time\030\007 \001(\0132\032.google.protobuf.TimestampB\003\340A\003\0224\n" + + "\013update_time\030\010 \001(\0132\032.google.protobuf.TimestampB\003\340A\003\0224\n" + + "\013delete_time\030\t \001(\0132\032.google.protobuf.TimestampB\003\340A\003\022,\n" + + "\005rules\030\n" + + " \003(\0132\035.google.iam.v2beta.PolicyRule\0322\n" + + "\020AnnotationsEntry\022\013\n" + + "\003key\030\001 \001(\t\022\r\n" + + "\005value\030\002 \001(\t:\0028\001\"[\n\n" + + "PolicyRule\0220\n" + + "\tdeny_rule\030\002 \001(\0132\033.google.iam.v2beta.DenyRuleH\000\022\023\n" + + "\013description\030\001 \001(\tB\006\n" + + "\004kind\"Q\n" + + "\023ListPoliciesRequest\022\023\n" + + "\006parent\030\001 \001(\tB\003\340A\002\022\021\n" + + "\tpage_size\030\002 \001(\005\022\022\n\n" + + "page_token\030\003 \001(\t\"\\\n" + + "\024ListPoliciesResponse\022+\n" + + "\010policies\030\001 \003(\0132\031.google.iam.v2beta.Policy\022\027\n" + + "\017next_page_token\030\002 \001(\t\"%\n" + + "\020GetPolicyRequest\022\021\n" + + "\004name\030\001 \001(\tB\003\340A\002\"m\n" + + "\023CreatePolicyRequest\022\023\n" + + "\006parent\030\001 \001(\tB\003\340A\002\022.\n" + + "\006policy\030\002 \001(\0132\031.google.iam.v2beta.PolicyB\003\340A\002\022\021\n" + + "\tpolicy_id\030\003 \001(\t\"E\n" + + "\023UpdatePolicyRequest\022.\n" + + "\006policy\030\001 \001(\0132\031.google.iam.v2beta.PolicyB\003\340A\002\";\n" + + "\023DeletePolicyRequest\022\021\n" + + "\004name\030\001 \001(\tB\003\340A\002\022\021\n" + + "\004etag\030\002 \001(\tB\003\340A\001\"J\n" + + "\027PolicyOperationMetadata\022/\n" + + "\013create_time\030\001 \001(\0132\032.google.protobuf.Timestamp2\200\007\n" + + "\010Policies\022\217\001\n" + + "\014ListPolicies\022&.google.iam.v2beta.ListPoliciesRe" + "quest\032\'.google.iam.v2beta.ListPoliciesRe" - + "sponse\".\202\323\344\223\002\037\022\035/v2beta/{parent=policies" - + "/*/*}\332A\006parent\022y\n\tGetPolicy\022#.google.iam" - + ".v2beta.GetPolicyRequest\032\031.google.iam.v2" - + "beta.Policy\",\202\323\344\223\002\037\022\035/v2beta/{name=polic" - + "ies/*/*/*}\332A\004name\022\302\001\n\014CreatePolicy\022&.goo" - + "gle.iam.v2beta.CreatePolicyRequest\032\035.goo" - + "gle.longrunning.Operation\"k\202\323\344\223\002\'\"\035/v2be" - + "ta/{parent=policies/*/*}:\006policy\332A\027paren" - + "t,policy,policy_id\312A!\n\006Policy\022\027PolicyOpe" - + "rationMetadata\022\257\001\n\014UpdatePolicy\022&.google" - + ".iam.v2beta.UpdatePolicyRequest\032\035.google" - + ".longrunning.Operation\"X\202\323\344\223\002.\032$/v2beta/" - + "{policy.name=policies/*/*/*}:\006policy\312A!\n" - + "\006Policy\022\027PolicyOperationMetadata\022\247\001\n\014Del" - + "etePolicy\022&.google.iam.v2beta.DeletePoli" - + "cyRequest\032\035.google.longrunning.Operation" - + "\"P\202\323\344\223\002\037*\035/v2beta/{name=policies/*/*/*}\332" - + "A\004name\312A!\n\006Policy\022\027PolicyOperationMetada" - + "ta\032F\312A\022iam.googleapis.com\322A.https://www." - + "googleapis.com/auth/cloud-platformB\220\001\n\025c" - + "om.google.iam.v2betaB\013PolicyProtoP\001Z4goo" - + "gle.golang.org/genproto/googleapis/iam/v" - + "2beta;iam\252\002\027Google.Cloud.Iam.V2Beta\312\002\027Go" - + "ogle\\Cloud\\Iam\\V2betab\006proto3" + + "sponse\".\332A\006parent\202\323\344\223\002\037\022\035/v2beta/{parent=policies/*/*}\022y\n" + + "\tGetPolicy\022#.google.iam.v2beta.GetPolicyRequest\032\031.google.iam.v2" + + "beta.Policy\",\332A\004name\202\323\344\223\002\037\022\035/v2beta/{name=policies/*/*/*}\022\302\001\n" + + "\014CreatePolicy\022&.goo" + + "gle.iam.v2beta.CreatePolicyRequest\032\035.google.longrunning.Operation\"k\312A!\n" + + "\006Policy\022\027PolicyOperationMetadata\332A\027parent,policy," + + "policy_id\202\323\344\223\002\'\"\035/v2beta/{parent=policies/*/*}:\006policy\022\257\001\n" + + "\014UpdatePolicy\022&.google" + + ".iam.v2beta.UpdatePolicyRequest\032\035.google.longrunning.Operation\"X\312A!\n" + + "\006Policy\022\027Pol" + + "icyOperationMetadata\202\323\344\223\002.\032$/v2beta/{policy.name=policies/*/*/*}:\006policy\022\247\001\n" + + "\014DeletePolicy\022&.google.iam.v2beta.DeletePoli" + + "cyRequest\032\035.google.longrunning.Operation\"P\312A!\n" + + "\006Policy\022\027PolicyOperationMetadata\332A" + + "\004name\202\323\344\223\002\037*\035/v2beta/{name=policies/*/*/" + + "*}\032F\312A\022iam.googleapis.com\322A.https://www.googleapis.com/auth/cloud-platformB\211\001\n" + + "\025com.google.iam.v2betaB\013PolicyProtoP\001Z-clo" + + "ud.google.com/go/iam/apiv2beta/iampb;iam" + + "pb\252\002\027Google.Cloud.Iam.V2Beta\312\002\027Google\\Cloud\\Iam\\V2betab\006proto3" }; descriptor = com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( @@ -147,9 +170,9 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { com.google.longrunning.OperationsProto.getDescriptor(), com.google.protobuf.TimestampProto.getDescriptor(), }); - internal_static_google_iam_v2beta_Policy_descriptor = getDescriptor().getMessageTypes().get(0); + internal_static_google_iam_v2beta_Policy_descriptor = getDescriptor().getMessageType(0); internal_static_google_iam_v2beta_Policy_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_google_iam_v2beta_Policy_descriptor, new java.lang.String[] { "Name", @@ -164,77 +187,83 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "Rules", }); internal_static_google_iam_v2beta_Policy_AnnotationsEntry_descriptor = - internal_static_google_iam_v2beta_Policy_descriptor.getNestedTypes().get(0); + internal_static_google_iam_v2beta_Policy_descriptor.getNestedType(0); internal_static_google_iam_v2beta_Policy_AnnotationsEntry_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_google_iam_v2beta_Policy_AnnotationsEntry_descriptor, new java.lang.String[] { "Key", "Value", }); - internal_static_google_iam_v2beta_PolicyRule_descriptor = - getDescriptor().getMessageTypes().get(1); + internal_static_google_iam_v2beta_PolicyRule_descriptor = getDescriptor().getMessageType(1); internal_static_google_iam_v2beta_PolicyRule_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_google_iam_v2beta_PolicyRule_descriptor, new java.lang.String[] { "DenyRule", "Description", "Kind", }); internal_static_google_iam_v2beta_ListPoliciesRequest_descriptor = - getDescriptor().getMessageTypes().get(2); + getDescriptor().getMessageType(2); internal_static_google_iam_v2beta_ListPoliciesRequest_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_google_iam_v2beta_ListPoliciesRequest_descriptor, new java.lang.String[] { "Parent", "PageSize", "PageToken", }); internal_static_google_iam_v2beta_ListPoliciesResponse_descriptor = - getDescriptor().getMessageTypes().get(3); + getDescriptor().getMessageType(3); internal_static_google_iam_v2beta_ListPoliciesResponse_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_google_iam_v2beta_ListPoliciesResponse_descriptor, new java.lang.String[] { "Policies", "NextPageToken", }); internal_static_google_iam_v2beta_GetPolicyRequest_descriptor = - getDescriptor().getMessageTypes().get(4); + getDescriptor().getMessageType(4); internal_static_google_iam_v2beta_GetPolicyRequest_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_google_iam_v2beta_GetPolicyRequest_descriptor, new java.lang.String[] { "Name", }); internal_static_google_iam_v2beta_CreatePolicyRequest_descriptor = - getDescriptor().getMessageTypes().get(5); + getDescriptor().getMessageType(5); internal_static_google_iam_v2beta_CreatePolicyRequest_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_google_iam_v2beta_CreatePolicyRequest_descriptor, new java.lang.String[] { "Parent", "Policy", "PolicyId", }); internal_static_google_iam_v2beta_UpdatePolicyRequest_descriptor = - getDescriptor().getMessageTypes().get(6); + getDescriptor().getMessageType(6); internal_static_google_iam_v2beta_UpdatePolicyRequest_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_google_iam_v2beta_UpdatePolicyRequest_descriptor, new java.lang.String[] { "Policy", }); internal_static_google_iam_v2beta_DeletePolicyRequest_descriptor = - getDescriptor().getMessageTypes().get(7); + getDescriptor().getMessageType(7); internal_static_google_iam_v2beta_DeletePolicyRequest_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_google_iam_v2beta_DeletePolicyRequest_descriptor, new java.lang.String[] { "Name", "Etag", }); internal_static_google_iam_v2beta_PolicyOperationMetadata_descriptor = - getDescriptor().getMessageTypes().get(8); + getDescriptor().getMessageType(8); internal_static_google_iam_v2beta_PolicyOperationMetadata_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_google_iam_v2beta_PolicyOperationMetadata_descriptor, new java.lang.String[] { "CreateTime", }); + descriptor.resolveAllFeaturesImmutable(); + com.google.api.AnnotationsProto.getDescriptor(); + com.google.api.ClientProto.getDescriptor(); + com.google.api.FieldBehaviorProto.getDescriptor(); + com.google.iam.v2beta.DenyRuleProto.getDescriptor(); + com.google.longrunning.OperationsProto.getDescriptor(); + com.google.protobuf.TimestampProto.getDescriptor(); com.google.protobuf.ExtensionRegistry registry = com.google.protobuf.ExtensionRegistry.newInstance(); registry.add(com.google.api.ClientProto.defaultHost); @@ -245,12 +274,6 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { 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.iam.v2beta.DenyRuleProto.getDescriptor(); - com.google.longrunning.OperationsProto.getDescriptor(); - com.google.protobuf.TimestampProto.getDescriptor(); } // @@protoc_insertion_point(outer_class_scope) diff --git a/java-iam/proto-google-iam-v2beta/src/main/java/com/google/iam/v2beta/PolicyRule.java b/java-iam/proto-google-iam-v2beta/src/main/java/com/google/iam/v2beta/PolicyRule.java index 27084c7ca3..a16dfe1952 100644 --- a/java-iam/proto-google-iam-v2beta/src/main/java/com/google/iam/v2beta/PolicyRule.java +++ b/java-iam/proto-google-iam-v2beta/src/main/java/com/google/iam/v2beta/PolicyRule.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,9 @@ * limitations under the License. */ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: google/iam/v2beta/policy.proto +// Protobuf Java Version: 4.33.2 package com.google.iam.v2beta; @@ -27,13 +29,25 @@ * * Protobuf type {@code google.iam.v2beta.PolicyRule} */ -public final class PolicyRule extends com.google.protobuf.GeneratedMessageV3 +@com.google.protobuf.Generated +public final class PolicyRule extends com.google.protobuf.GeneratedMessage implements // @@protoc_insertion_point(message_implements:google.iam.v2beta.PolicyRule) PolicyRuleOrBuilder { private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "PolicyRule"); + } + // Use PolicyRule.newBuilder() to construct. - private PolicyRule(com.google.protobuf.GeneratedMessageV3.Builder builder) { + private PolicyRule(com.google.protobuf.GeneratedMessage.Builder builder) { super(builder); } @@ -41,24 +55,13 @@ private PolicyRule() { description_ = ""; } - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new PolicyRule(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.iam.v2beta.PolicyProto .internal_static_google_iam_v2beta_PolicyRule_descriptor; } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.iam.v2beta.PolicyProto .internal_static_google_iam_v2beta_PolicyRule_fieldAccessorTable @@ -67,6 +70,8 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } private int kindCase_ = 0; + + @SuppressWarnings("serial") private java.lang.Object kind_; public enum KindCase @@ -80,6 +85,7 @@ public enum KindCase private KindCase(int value) { this.value = value; } + /** * @param value The number of the enum to look for. * @return The enum associated with the given number. @@ -111,6 +117,7 @@ public KindCase getKindCase() { } public static final int DENY_RULE_FIELD_NUMBER = 2; + /** * * @@ -126,6 +133,7 @@ public KindCase getKindCase() { public boolean hasDenyRule() { return kindCase_ == 2; } + /** * * @@ -144,6 +152,7 @@ public com.google.iam.v2beta.DenyRule getDenyRule() { } return com.google.iam.v2beta.DenyRule.getDefaultInstance(); } + /** * * @@ -162,7 +171,10 @@ public com.google.iam.v2beta.DenyRuleOrBuilder getDenyRuleOrBuilder() { } public static final int DESCRIPTION_FIELD_NUMBER = 1; - private volatile java.lang.Object description_; + + @SuppressWarnings("serial") + private volatile java.lang.Object description_ = ""; + /** * * @@ -187,6 +199,7 @@ public java.lang.String getDescription() { return s; } } + /** * * @@ -226,8 +239,8 @@ public final boolean isInitialized() { @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(description_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, description_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(description_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, description_); } if (kindCase_ == 2) { output.writeMessage(2, (com.google.iam.v2beta.DenyRule) kind_); @@ -241,8 +254,8 @@ public int getSerializedSize() { if (size != -1) return size; size = 0; - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(description_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, description_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(description_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, description_); } if (kindCase_ == 2) { size += @@ -335,38 +348,38 @@ public static com.google.iam.v2beta.PolicyRule parseFrom( public static com.google.iam.v2beta.PolicyRule parseFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); } public static com.google.iam.v2beta.PolicyRule parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } public static com.google.iam.v2beta.PolicyRule parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); } public static com.google.iam.v2beta.PolicyRule parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( PARSER, input, extensionRegistry); } public static com.google.iam.v2beta.PolicyRule parseFrom( com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); } public static com.google.iam.v2beta.PolicyRule parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } @@ -389,10 +402,11 @@ public Builder toBuilder() { } @java.lang.Override - protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { Builder builder = new Builder(parent); return builder; } + /** * * @@ -402,7 +416,7 @@ protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.Build * * Protobuf type {@code google.iam.v2beta.PolicyRule} */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder implements // @@protoc_insertion_point(builder_implements:google.iam.v2beta.PolicyRule) com.google.iam.v2beta.PolicyRuleOrBuilder { @@ -412,7 +426,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.iam.v2beta.PolicyProto .internal_static_google_iam_v2beta_PolicyRule_fieldAccessorTable @@ -424,18 +438,18 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { // Construct using com.google.iam.v2beta.PolicyRule.newBuilder() private Builder() {} - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { super(parent); } @java.lang.Override public Builder clear() { super.clear(); + bitField0_ = 0; if (denyRuleBuilder_ != null) { denyRuleBuilder_.clear(); } description_ = ""; - kindCase_ = 0; kind_ = null; return this; @@ -464,50 +478,27 @@ public com.google.iam.v2beta.PolicyRule build() { @java.lang.Override public com.google.iam.v2beta.PolicyRule buildPartial() { com.google.iam.v2beta.PolicyRule result = new com.google.iam.v2beta.PolicyRule(this); - if (kindCase_ == 2) { - if (denyRuleBuilder_ == null) { - result.kind_ = kind_; - } else { - result.kind_ = denyRuleBuilder_.build(); - } + if (bitField0_ != 0) { + buildPartial0(result); } - result.description_ = description_; - result.kindCase_ = kindCase_; + buildPartialOneofs(result); 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); + private void buildPartial0(com.google.iam.v2beta.PolicyRule result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.description_ = description_; + } } - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.addRepeatedField(field, value); + private void buildPartialOneofs(com.google.iam.v2beta.PolicyRule result) { + result.kindCase_ = kindCase_; + result.kind_ = this.kind_; + if (kindCase_ == 2 && denyRuleBuilder_ != null) { + result.kind_ = denyRuleBuilder_.build(); + } } @java.lang.Override @@ -524,6 +515,7 @@ public Builder mergeFrom(com.google.iam.v2beta.PolicyRule other) { if (other == com.google.iam.v2beta.PolicyRule.getDefaultInstance()) return this; if (!other.getDescription().isEmpty()) { description_ = other.description_; + bitField0_ |= 0x00000002; onChanged(); } switch (other.getKindCase()) { @@ -566,12 +558,13 @@ public Builder mergeFrom( case 10: { description_ = input.readStringRequireUtf8(); - + bitField0_ |= 0x00000002; break; } // case 10 case 18: { - input.readMessage(getDenyRuleFieldBuilder().getBuilder(), extensionRegistry); + input.readMessage( + internalGetDenyRuleFieldBuilder().getBuilder(), extensionRegistry); kindCase_ = 2; break; } // case 18 @@ -606,11 +599,14 @@ public Builder clearKind() { return this; } - private com.google.protobuf.SingleFieldBuilderV3< + private int bitField0_; + + private com.google.protobuf.SingleFieldBuilder< com.google.iam.v2beta.DenyRule, com.google.iam.v2beta.DenyRule.Builder, com.google.iam.v2beta.DenyRuleOrBuilder> denyRuleBuilder_; + /** * * @@ -626,6 +622,7 @@ public Builder clearKind() { public boolean hasDenyRule() { return kindCase_ == 2; } + /** * * @@ -651,6 +648,7 @@ public com.google.iam.v2beta.DenyRule getDenyRule() { return com.google.iam.v2beta.DenyRule.getDefaultInstance(); } } + /** * * @@ -673,6 +671,7 @@ public Builder setDenyRule(com.google.iam.v2beta.DenyRule value) { kindCase_ = 2; return this; } + /** * * @@ -692,6 +691,7 @@ public Builder setDenyRule(com.google.iam.v2beta.DenyRule.Builder builderForValu kindCase_ = 2; return this; } + /** * * @@ -722,6 +722,7 @@ public Builder mergeDenyRule(com.google.iam.v2beta.DenyRule value) { kindCase_ = 2; return this; } + /** * * @@ -747,6 +748,7 @@ public Builder clearDenyRule() { } return this; } + /** * * @@ -757,8 +759,9 @@ public Builder clearDenyRule() { * .google.iam.v2beta.DenyRule deny_rule = 2; */ public com.google.iam.v2beta.DenyRule.Builder getDenyRuleBuilder() { - return getDenyRuleFieldBuilder().getBuilder(); + return internalGetDenyRuleFieldBuilder().getBuilder(); } + /** * * @@ -779,6 +782,7 @@ public com.google.iam.v2beta.DenyRuleOrBuilder getDenyRuleOrBuilder() { return com.google.iam.v2beta.DenyRule.getDefaultInstance(); } } + /** * * @@ -788,17 +792,17 @@ public com.google.iam.v2beta.DenyRuleOrBuilder getDenyRuleOrBuilder() { * * .google.iam.v2beta.DenyRule deny_rule = 2; */ - private com.google.protobuf.SingleFieldBuilderV3< + private com.google.protobuf.SingleFieldBuilder< com.google.iam.v2beta.DenyRule, com.google.iam.v2beta.DenyRule.Builder, com.google.iam.v2beta.DenyRuleOrBuilder> - getDenyRuleFieldBuilder() { + internalGetDenyRuleFieldBuilder() { if (denyRuleBuilder_ == null) { if (!(kindCase_ == 2)) { kind_ = com.google.iam.v2beta.DenyRule.getDefaultInstance(); } denyRuleBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< + new com.google.protobuf.SingleFieldBuilder< com.google.iam.v2beta.DenyRule, com.google.iam.v2beta.DenyRule.Builder, com.google.iam.v2beta.DenyRuleOrBuilder>( @@ -807,11 +811,11 @@ public com.google.iam.v2beta.DenyRuleOrBuilder getDenyRuleOrBuilder() { } kindCase_ = 2; onChanged(); - ; return denyRuleBuilder_; } private java.lang.Object description_ = ""; + /** * * @@ -835,6 +839,7 @@ public java.lang.String getDescription() { return (java.lang.String) ref; } } + /** * * @@ -858,6 +863,7 @@ public com.google.protobuf.ByteString getDescriptionBytes() { return (com.google.protobuf.ByteString) ref; } } + /** * * @@ -875,11 +881,12 @@ public Builder setDescription(java.lang.String value) { if (value == null) { throw new NullPointerException(); } - description_ = value; + bitField0_ |= 0x00000002; onChanged(); return this; } + /** * * @@ -893,11 +900,12 @@ public Builder setDescription(java.lang.String value) { * @return This builder for chaining. */ public Builder clearDescription() { - description_ = getDefaultInstance().getDescription(); + bitField0_ = (bitField0_ & ~0x00000002); onChanged(); return this; } + /** * * @@ -916,23 +924,12 @@ public Builder setDescriptionBytes(com.google.protobuf.ByteString value) { throw new NullPointerException(); } checkByteStringIsUtf8(value); - description_ = 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.iam.v2beta.PolicyRule) } diff --git a/java-iam/proto-google-iam-v2beta/src/main/java/com/google/iam/v2beta/PolicyRuleOrBuilder.java b/java-iam/proto-google-iam-v2beta/src/main/java/com/google/iam/v2beta/PolicyRuleOrBuilder.java index 1c71f86bff..8430d0eb15 100644 --- a/java-iam/proto-google-iam-v2beta/src/main/java/com/google/iam/v2beta/PolicyRuleOrBuilder.java +++ b/java-iam/proto-google-iam-v2beta/src/main/java/com/google/iam/v2beta/PolicyRuleOrBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,10 +14,13 @@ * limitations under the License. */ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: google/iam/v2beta/policy.proto +// Protobuf Java Version: 4.33.2 package com.google.iam.v2beta; +@com.google.protobuf.Generated public interface PolicyRuleOrBuilder extends // @@protoc_insertion_point(interface_extends:google.iam.v2beta.PolicyRule) @@ -35,6 +38,7 @@ public interface PolicyRuleOrBuilder * @return Whether the denyRule field is set. */ boolean hasDenyRule(); + /** * * @@ -47,6 +51,7 @@ public interface PolicyRuleOrBuilder * @return The denyRule. */ com.google.iam.v2beta.DenyRule getDenyRule(); + /** * * @@ -71,6 +76,7 @@ public interface PolicyRuleOrBuilder * @return The description. */ java.lang.String getDescription(); + /** * * @@ -85,5 +91,5 @@ public interface PolicyRuleOrBuilder */ com.google.protobuf.ByteString getDescriptionBytes(); - public com.google.iam.v2beta.PolicyRule.KindCase getKindCase(); + com.google.iam.v2beta.PolicyRule.KindCase getKindCase(); } diff --git a/java-iam/proto-google-iam-v2beta/src/main/java/com/google/iam/v2beta/UpdatePolicyRequest.java b/java-iam/proto-google-iam-v2beta/src/main/java/com/google/iam/v2beta/UpdatePolicyRequest.java index 95eabcdd8b..8883e00fd7 100644 --- a/java-iam/proto-google-iam-v2beta/src/main/java/com/google/iam/v2beta/UpdatePolicyRequest.java +++ b/java-iam/proto-google-iam-v2beta/src/main/java/com/google/iam/v2beta/UpdatePolicyRequest.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,9 @@ * limitations under the License. */ // Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE // source: google/iam/v2beta/policy.proto +// Protobuf Java Version: 4.33.2 package com.google.iam.v2beta; @@ -27,36 +29,37 @@ * * Protobuf type {@code google.iam.v2beta.UpdatePolicyRequest} */ -public final class UpdatePolicyRequest extends com.google.protobuf.GeneratedMessageV3 +@com.google.protobuf.Generated +public final class UpdatePolicyRequest extends com.google.protobuf.GeneratedMessage implements // @@protoc_insertion_point(message_implements:google.iam.v2beta.UpdatePolicyRequest) UpdatePolicyRequestOrBuilder { private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "UpdatePolicyRequest"); + } + // Use UpdatePolicyRequest.newBuilder() to construct. - private UpdatePolicyRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + private UpdatePolicyRequest(com.google.protobuf.GeneratedMessage.Builder builder) { super(builder); } private UpdatePolicyRequest() {} - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new UpdatePolicyRequest(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.iam.v2beta.PolicyProto .internal_static_google_iam_v2beta_UpdatePolicyRequest_descriptor; } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.iam.v2beta.PolicyProto .internal_static_google_iam_v2beta_UpdatePolicyRequest_fieldAccessorTable @@ -65,13 +68,16 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { com.google.iam.v2beta.UpdatePolicyRequest.Builder.class); } + private int bitField0_; public static final int POLICY_FIELD_NUMBER = 1; private com.google.iam.v2beta.Policy policy_; + /** * * *
            * Required. The policy to update.
        +   *
            * To prevent conflicting updates, the `etag` value must match the value that
            * is stored in IAM. If the `etag` values do not match, the request fails with
            * a `409` error code and `ABORTED` status.
        @@ -83,13 +89,15 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
            */
           @java.lang.Override
           public boolean hasPolicy() {
        -    return policy_ != null;
        +    return ((bitField0_ & 0x00000001) != 0);
           }
        +
           /**
            *
            *
            * 
            * Required. The policy to update.
        +   *
            * To prevent conflicting updates, the `etag` value must match the value that
            * is stored in IAM. If the `etag` values do not match, the request fails with
            * a `409` error code and `ABORTED` status.
        @@ -103,11 +111,13 @@ public boolean hasPolicy() {
           public com.google.iam.v2beta.Policy getPolicy() {
             return policy_ == null ? com.google.iam.v2beta.Policy.getDefaultInstance() : policy_;
           }
        +
           /**
            *
            *
            * 
            * Required. The policy to update.
        +   *
            * To prevent conflicting updates, the `etag` value must match the value that
            * is stored in IAM. If the `etag` values do not match, the request fails with
            * a `409` error code and `ABORTED` status.
        @@ -117,7 +127,7 @@ public com.google.iam.v2beta.Policy getPolicy() {
            */
           @java.lang.Override
           public com.google.iam.v2beta.PolicyOrBuilder getPolicyOrBuilder() {
        -    return getPolicy();
        +    return policy_ == null ? com.google.iam.v2beta.Policy.getDefaultInstance() : policy_;
           }
         
           private byte memoizedIsInitialized = -1;
        @@ -134,7 +144,7 @@ public final boolean isInitialized() {
         
           @java.lang.Override
           public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException {
        -    if (policy_ != null) {
        +    if (((bitField0_ & 0x00000001) != 0)) {
               output.writeMessage(1, getPolicy());
             }
             getUnknownFields().writeTo(output);
        @@ -146,7 +156,7 @@ public int getSerializedSize() {
             if (size != -1) return size;
         
             size = 0;
        -    if (policy_ != null) {
        +    if (((bitField0_ & 0x00000001) != 0)) {
               size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getPolicy());
             }
             size += getUnknownFields().getSerializedSize();
        @@ -226,38 +236,38 @@ public static com.google.iam.v2beta.UpdatePolicyRequest parseFrom(
         
           public static com.google.iam.v2beta.UpdatePolicyRequest parseFrom(java.io.InputStream input)
               throws java.io.IOException {
        -    return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
        +    return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input);
           }
         
           public static com.google.iam.v2beta.UpdatePolicyRequest parseFrom(
               java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
               throws java.io.IOException {
        -    return com.google.protobuf.GeneratedMessageV3.parseWithIOException(
        +    return com.google.protobuf.GeneratedMessage.parseWithIOException(
                 PARSER, input, extensionRegistry);
           }
         
           public static com.google.iam.v2beta.UpdatePolicyRequest parseDelimitedFrom(
               java.io.InputStream input) throws java.io.IOException {
        -    return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input);
        +    return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input);
           }
         
           public static com.google.iam.v2beta.UpdatePolicyRequest parseDelimitedFrom(
               java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
               throws java.io.IOException {
        -    return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(
        +    return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(
                 PARSER, input, extensionRegistry);
           }
         
           public static com.google.iam.v2beta.UpdatePolicyRequest parseFrom(
               com.google.protobuf.CodedInputStream input) throws java.io.IOException {
        -    return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
        +    return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input);
           }
         
           public static com.google.iam.v2beta.UpdatePolicyRequest parseFrom(
               com.google.protobuf.CodedInputStream input,
               com.google.protobuf.ExtensionRegistryLite extensionRegistry)
               throws java.io.IOException {
        -    return com.google.protobuf.GeneratedMessageV3.parseWithIOException(
        +    return com.google.protobuf.GeneratedMessage.parseWithIOException(
                 PARSER, input, extensionRegistry);
           }
         
        @@ -280,10 +290,11 @@ public Builder toBuilder() {
           }
         
           @java.lang.Override
        -  protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
        +  protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) {
             Builder builder = new Builder(parent);
             return builder;
           }
        +
           /**
            *
            *
        @@ -293,7 +304,7 @@ protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.Build
            *
            * Protobuf type {@code google.iam.v2beta.UpdatePolicyRequest}
            */
        -  public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder
        +  public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder
               implements
               // @@protoc_insertion_point(builder_implements:google.iam.v2beta.UpdatePolicyRequest)
               com.google.iam.v2beta.UpdatePolicyRequestOrBuilder {
        @@ -303,7 +314,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
             }
         
             @java.lang.Override
        -    protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
        +    protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
                 internalGetFieldAccessorTable() {
               return com.google.iam.v2beta.PolicyProto
                   .internal_static_google_iam_v2beta_UpdatePolicyRequest_fieldAccessorTable
        @@ -313,19 +324,28 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
             }
         
             // Construct using com.google.iam.v2beta.UpdatePolicyRequest.newBuilder()
        -    private Builder() {}
        +    private Builder() {
        +      maybeForceBuilderInitialization();
        +    }
         
        -    private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
        +    private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) {
               super(parent);
        +      maybeForceBuilderInitialization();
        +    }
        +
        +    private void maybeForceBuilderInitialization() {
        +      if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) {
        +        internalGetPolicyFieldBuilder();
        +      }
             }
         
             @java.lang.Override
             public Builder clear() {
               super.clear();
        -      if (policyBuilder_ == null) {
        -        policy_ = null;
        -      } else {
        -        policy_ = null;
        +      bitField0_ = 0;
        +      policy_ = null;
        +      if (policyBuilder_ != null) {
        +        policyBuilder_.dispose();
                 policyBuilder_ = null;
               }
               return this;
        @@ -355,46 +375,21 @@ public com.google.iam.v2beta.UpdatePolicyRequest build() {
             public com.google.iam.v2beta.UpdatePolicyRequest buildPartial() {
               com.google.iam.v2beta.UpdatePolicyRequest result =
                   new com.google.iam.v2beta.UpdatePolicyRequest(this);
        -      if (policyBuilder_ == null) {
        -        result.policy_ = policy_;
        -      } else {
        -        result.policy_ = policyBuilder_.build();
        +      if (bitField0_ != 0) {
        +        buildPartial0(result);
               }
               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);
        +    private void buildPartial0(com.google.iam.v2beta.UpdatePolicyRequest result) {
        +      int from_bitField0_ = bitField0_;
        +      int to_bitField0_ = 0;
        +      if (((from_bitField0_ & 0x00000001) != 0)) {
        +        result.policy_ = policyBuilder_ == null ? policy_ : policyBuilder_.build();
        +        to_bitField0_ |= 0x00000001;
        +      }
        +      result.bitField0_ |= to_bitField0_;
             }
         
             @java.lang.Override
        @@ -440,8 +435,8 @@ public Builder mergeFrom(
                       break;
                     case 10:
                       {
        -                input.readMessage(getPolicyFieldBuilder().getBuilder(), extensionRegistry);
        -
        +                input.readMessage(internalGetPolicyFieldBuilder().getBuilder(), extensionRegistry);
        +                bitField0_ |= 0x00000001;
                         break;
                       } // case 10
                     default:
        @@ -461,17 +456,21 @@ public Builder mergeFrom(
               return this;
             }
         
        +    private int bitField0_;
        +
             private com.google.iam.v2beta.Policy policy_;
        -    private com.google.protobuf.SingleFieldBuilderV3<
        +    private com.google.protobuf.SingleFieldBuilder<
                     com.google.iam.v2beta.Policy,
                     com.google.iam.v2beta.Policy.Builder,
                     com.google.iam.v2beta.PolicyOrBuilder>
                 policyBuilder_;
        +
             /**
              *
              *
              * 
              * Required. The policy to update.
        +     *
              * To prevent conflicting updates, the `etag` value must match the value that
              * is stored in IAM. If the `etag` values do not match, the request fails with
              * a `409` error code and `ABORTED` status.
        @@ -482,13 +481,15 @@ public Builder mergeFrom(
              * @return Whether the policy field is set.
              */
             public boolean hasPolicy() {
        -      return policyBuilder_ != null || policy_ != null;
        +      return ((bitField0_ & 0x00000001) != 0);
             }
        +
             /**
              *
              *
              * 
              * Required. The policy to update.
        +     *
              * To prevent conflicting updates, the `etag` value must match the value that
              * is stored in IAM. If the `etag` values do not match, the request fails with
              * a `409` error code and `ABORTED` status.
        @@ -505,11 +506,13 @@ public com.google.iam.v2beta.Policy getPolicy() {
                 return policyBuilder_.getMessage();
               }
             }
        +
             /**
              *
              *
              * 
              * Required. The policy to update.
        +     *
              * To prevent conflicting updates, the `etag` value must match the value that
              * is stored in IAM. If the `etag` values do not match, the request fails with
              * a `409` error code and `ABORTED` status.
        @@ -523,18 +526,20 @@ public Builder setPolicy(com.google.iam.v2beta.Policy value) {
                   throw new NullPointerException();
                 }
                 policy_ = value;
        -        onChanged();
               } else {
                 policyBuilder_.setMessage(value);
               }
        -
        +      bitField0_ |= 0x00000001;
        +      onChanged();
               return this;
             }
        +
             /**
              *
              *
              * 
              * Required. The policy to update.
        +     *
              * To prevent conflicting updates, the `etag` value must match the value that
              * is stored in IAM. If the `etag` values do not match, the request fails with
              * a `409` error code and `ABORTED` status.
        @@ -545,18 +550,20 @@ public Builder setPolicy(com.google.iam.v2beta.Policy value) {
             public Builder setPolicy(com.google.iam.v2beta.Policy.Builder builderForValue) {
               if (policyBuilder_ == null) {
                 policy_ = builderForValue.build();
        -        onChanged();
               } else {
                 policyBuilder_.setMessage(builderForValue.build());
               }
        -
        +      bitField0_ |= 0x00000001;
        +      onChanged();
               return this;
             }
        +
             /**
              *
              *
              * 
              * Required. The policy to update.
        +     *
              * To prevent conflicting updates, the `etag` value must match the value that
              * is stored in IAM. If the `etag` values do not match, the request fails with
              * a `409` error code and `ABORTED` status.
        @@ -566,24 +573,29 @@ public Builder setPolicy(com.google.iam.v2beta.Policy.Builder builderForValue) {
              */
             public Builder mergePolicy(com.google.iam.v2beta.Policy value) {
               if (policyBuilder_ == null) {
        -        if (policy_ != null) {
        -          policy_ =
        -              com.google.iam.v2beta.Policy.newBuilder(policy_).mergeFrom(value).buildPartial();
        +        if (((bitField0_ & 0x00000001) != 0)
        +            && policy_ != null
        +            && policy_ != com.google.iam.v2beta.Policy.getDefaultInstance()) {
        +          getPolicyBuilder().mergeFrom(value);
                 } else {
                   policy_ = value;
                 }
        -        onChanged();
               } else {
                 policyBuilder_.mergeFrom(value);
               }
        -
        +      if (policy_ != null) {
        +        bitField0_ |= 0x00000001;
        +        onChanged();
        +      }
               return this;
             }
        +
             /**
              *
              *
              * 
              * Required. The policy to update.
        +     *
              * To prevent conflicting updates, the `etag` value must match the value that
              * is stored in IAM. If the `etag` values do not match, the request fails with
              * a `409` error code and `ABORTED` status.
        @@ -592,21 +604,22 @@ public Builder mergePolicy(com.google.iam.v2beta.Policy value) {
              * .google.iam.v2beta.Policy policy = 1 [(.google.api.field_behavior) = REQUIRED];
              */
             public Builder clearPolicy() {
        -      if (policyBuilder_ == null) {
        -        policy_ = null;
        -        onChanged();
        -      } else {
        -        policy_ = null;
        +      bitField0_ = (bitField0_ & ~0x00000001);
        +      policy_ = null;
        +      if (policyBuilder_ != null) {
        +        policyBuilder_.dispose();
                 policyBuilder_ = null;
               }
        -
        +      onChanged();
               return this;
             }
        +
             /**
              *
              *
              * 
              * Required. The policy to update.
        +     *
              * To prevent conflicting updates, the `etag` value must match the value that
              * is stored in IAM. If the `etag` values do not match, the request fails with
              * a `409` error code and `ABORTED` status.
        @@ -615,15 +628,17 @@ public Builder clearPolicy() {
              * .google.iam.v2beta.Policy policy = 1 [(.google.api.field_behavior) = REQUIRED];
              */
             public com.google.iam.v2beta.Policy.Builder getPolicyBuilder() {
        -
        +      bitField0_ |= 0x00000001;
               onChanged();
        -      return getPolicyFieldBuilder().getBuilder();
        +      return internalGetPolicyFieldBuilder().getBuilder();
             }
        +
             /**
              *
              *
              * 
              * Required. The policy to update.
        +     *
              * To prevent conflicting updates, the `etag` value must match the value that
              * is stored in IAM. If the `etag` values do not match, the request fails with
              * a `409` error code and `ABORTED` status.
        @@ -638,11 +653,13 @@ public com.google.iam.v2beta.PolicyOrBuilder getPolicyOrBuilder() {
                 return policy_ == null ? com.google.iam.v2beta.Policy.getDefaultInstance() : policy_;
               }
             }
        +
             /**
              *
              *
              * 
              * Required. The policy to update.
        +     *
              * To prevent conflicting updates, the `etag` value must match the value that
              * is stored in IAM. If the `etag` values do not match, the request fails with
              * a `409` error code and `ABORTED` status.
        @@ -650,14 +667,14 @@ public com.google.iam.v2beta.PolicyOrBuilder getPolicyOrBuilder() {
              *
              * .google.iam.v2beta.Policy policy = 1 [(.google.api.field_behavior) = REQUIRED];
              */
        -    private com.google.protobuf.SingleFieldBuilderV3<
        +    private com.google.protobuf.SingleFieldBuilder<
                     com.google.iam.v2beta.Policy,
                     com.google.iam.v2beta.Policy.Builder,
                     com.google.iam.v2beta.PolicyOrBuilder>
        -        getPolicyFieldBuilder() {
        +        internalGetPolicyFieldBuilder() {
               if (policyBuilder_ == null) {
                 policyBuilder_ =
        -            new com.google.protobuf.SingleFieldBuilderV3<
        +            new com.google.protobuf.SingleFieldBuilder<
                         com.google.iam.v2beta.Policy,
                         com.google.iam.v2beta.Policy.Builder,
                         com.google.iam.v2beta.PolicyOrBuilder>(
        @@ -667,17 +684,6 @@ public com.google.iam.v2beta.PolicyOrBuilder getPolicyOrBuilder() {
               return policyBuilder_;
             }
         
        -    @java.lang.Override
        -    public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) {
        -      return super.setUnknownFields(unknownFields);
        -    }
        -
        -    @java.lang.Override
        -    public final Builder mergeUnknownFields(
        -        final com.google.protobuf.UnknownFieldSet unknownFields) {
        -      return super.mergeUnknownFields(unknownFields);
        -    }
        -
             // @@protoc_insertion_point(builder_scope:google.iam.v2beta.UpdatePolicyRequest)
           }
         
        diff --git a/java-iam/proto-google-iam-v2beta/src/main/java/com/google/iam/v2beta/UpdatePolicyRequestOrBuilder.java b/java-iam/proto-google-iam-v2beta/src/main/java/com/google/iam/v2beta/UpdatePolicyRequestOrBuilder.java
        index ffbd2892e1..df4e96945f 100644
        --- a/java-iam/proto-google-iam-v2beta/src/main/java/com/google/iam/v2beta/UpdatePolicyRequestOrBuilder.java
        +++ b/java-iam/proto-google-iam-v2beta/src/main/java/com/google/iam/v2beta/UpdatePolicyRequestOrBuilder.java
        @@ -1,5 +1,5 @@
         /*
        - * Copyright 2020 Google LLC
        + * Copyright 2026 Google LLC
          *
          * Licensed under the Apache License, Version 2.0 (the "License");
          * you may not use this file except in compliance with the License.
        @@ -14,10 +14,13 @@
          * limitations under the License.
          */
         // Generated by the protocol buffer compiler.  DO NOT EDIT!
        +// NO CHECKED-IN PROTOBUF GENCODE
         // source: google/iam/v2beta/policy.proto
        +// Protobuf Java Version: 4.33.2
         
         package com.google.iam.v2beta;
         
        +@com.google.protobuf.Generated
         public interface UpdatePolicyRequestOrBuilder
             extends
             // @@protoc_insertion_point(interface_extends:google.iam.v2beta.UpdatePolicyRequest)
        @@ -28,6 +31,7 @@ public interface UpdatePolicyRequestOrBuilder
            *
            * 
            * Required. The policy to update.
        +   *
            * To prevent conflicting updates, the `etag` value must match the value that
            * is stored in IAM. If the `etag` values do not match, the request fails with
            * a `409` error code and `ABORTED` status.
        @@ -38,11 +42,13 @@ public interface UpdatePolicyRequestOrBuilder
            * @return Whether the policy field is set.
            */
           boolean hasPolicy();
        +
           /**
            *
            *
            * 
            * Required. The policy to update.
        +   *
            * To prevent conflicting updates, the `etag` value must match the value that
            * is stored in IAM. If the `etag` values do not match, the request fails with
            * a `409` error code and `ABORTED` status.
        @@ -53,11 +59,13 @@ public interface UpdatePolicyRequestOrBuilder
            * @return The policy.
            */
           com.google.iam.v2beta.Policy getPolicy();
        +
           /**
            *
            *
            * 
            * Required. The policy to update.
        +   *
            * To prevent conflicting updates, the `etag` value must match the value that
            * is stored in IAM. If the `etag` values do not match, the request fails with
            * a `409` error code and `ABORTED` status.
        diff --git a/java-iam/proto-google-iam-v2beta/src/main/proto/google/iam/v2beta/deny.proto b/java-iam/proto-google-iam-v2beta/src/main/proto/google/iam/v2beta/deny.proto
        index 73ae7bbdf7..2ff6b74467 100644
        --- a/java-iam/proto-google-iam-v2beta/src/main/proto/google/iam/v2beta/deny.proto
        +++ b/java-iam/proto-google-iam-v2beta/src/main/proto/google/iam/v2beta/deny.proto
        @@ -1,4 +1,4 @@
        -// Copyright 2022 Google LLC
        +// Copyright 2025 Google LLC
         //
         // Licensed under the Apache License, Version 2.0 (the "License");
         // you may not use this file except in compliance with the License.
        @@ -19,7 +19,7 @@ package google.iam.v2beta;
         import "google/type/expr.proto";
         
         option csharp_namespace = "Google.Cloud.Iam.V2Beta";
        -option go_package = "google.golang.org/genproto/googleapis/iam/v2beta;iam";
        +option go_package = "cloud.google.com/go/iam/apiv2beta/iampb;iampb";
         option java_multiple_files = true;
         option java_outer_classname = "DenyRuleProto";
         option java_package = "com.google.iam.v2beta";
        diff --git a/java-iam/proto-google-iam-v2beta/src/main/proto/google/iam/v2beta/policy.proto b/java-iam/proto-google-iam-v2beta/src/main/proto/google/iam/v2beta/policy.proto
        index 99df3db0aa..7c3fa35f66 100644
        --- a/java-iam/proto-google-iam-v2beta/src/main/proto/google/iam/v2beta/policy.proto
        +++ b/java-iam/proto-google-iam-v2beta/src/main/proto/google/iam/v2beta/policy.proto
        @@ -1,4 +1,4 @@
        -// Copyright 2022 Google LLC
        +// Copyright 2025 Google LLC
         //
         // Licensed under the Apache License, Version 2.0 (the "License");
         // you may not use this file except in compliance with the License.
        @@ -24,7 +24,7 @@ import "google/longrunning/operations.proto";
         import "google/protobuf/timestamp.proto";
         
         option csharp_namespace = "Google.Cloud.Iam.V2Beta";
        -option go_package = "google.golang.org/genproto/googleapis/iam/v2beta;iam";
        +option go_package = "cloud.google.com/go/iam/apiv2beta/iampb;iampb";
         option java_multiple_files = true;
         option java_outer_classname = "PolicyProto";
         option java_package = "com.google.iam.v2beta";
        diff --git a/java-iam/proto-google-iam-v3/clirr-ignored-differences.xml b/java-iam/proto-google-iam-v3/clirr-ignored-differences.xml
        new file mode 100644
        index 0000000000..70e35c1538
        --- /dev/null
        +++ b/java-iam/proto-google-iam-v3/clirr-ignored-differences.xml
        @@ -0,0 +1,5 @@
        +
        +
        +
        +
        +
        diff --git a/java-iam/proto-google-iam-v3/pom.xml b/java-iam/proto-google-iam-v3/pom.xml
        new file mode 100644
        index 0000000000..30bb865907
        --- /dev/null
        +++ b/java-iam/proto-google-iam-v3/pom.xml
        @@ -0,0 +1,33 @@
        +
        +  4.0.0
        +  com.google.api.grpc
        +  proto-google-iam-v3
        +  1.62.1-SNAPSHOT
        +  proto-google-iam-v3
        +  Proto library for proto-google-iam-v3
        +  
        +    com.google.cloud
        +    google-iam-parent
        +    1.62.1-SNAPSHOT
        +  
        +  
        +    
        +      com.google.protobuf
        +      protobuf-java
        +    
        +    
        +      com.google.api.grpc
        +      proto-google-common-protos
        +    
        +    
        +      com.google.api
        +      api-common
        +    
        +    
        +      com.google.guava
        +      guava
        +    
        +  
        +
        diff --git a/java-iam/proto-google-iam-v3/src/main/java/com/google/iam/v3/CreatePolicyBindingRequest.java b/java-iam/proto-google-iam-v3/src/main/java/com/google/iam/v3/CreatePolicyBindingRequest.java
        new file mode 100644
        index 0000000000..6c9c4177be
        --- /dev/null
        +++ b/java-iam/proto-google-iam-v3/src/main/java/com/google/iam/v3/CreatePolicyBindingRequest.java
        @@ -0,0 +1,1314 @@
        +/*
        + * Copyright 2026 Google LLC
        + *
        + * Licensed under the Apache License, Version 2.0 (the "License");
        + * you may not use this file except in compliance with the License.
        + * You may obtain a copy of the License at
        + *
        + *     https://www.apache.org/licenses/LICENSE-2.0
        + *
        + * Unless required by applicable law or agreed to in writing, software
        + * distributed under the License is distributed on an "AS IS" BASIS,
        + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
        + * See the License for the specific language governing permissions and
        + * limitations under the License.
        + */
        +// Generated by the protocol buffer compiler.  DO NOT EDIT!
        +// NO CHECKED-IN PROTOBUF GENCODE
        +// source: google/iam/v3/policy_bindings_service.proto
        +// Protobuf Java Version: 4.33.2
        +
        +package com.google.iam.v3;
        +
        +/**
        + *
        + *
        + * 
        + * Request message for CreatePolicyBinding method.
        + * 
        + * + * Protobuf type {@code google.iam.v3.CreatePolicyBindingRequest} + */ +@com.google.protobuf.Generated +public final class CreatePolicyBindingRequest extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.iam.v3.CreatePolicyBindingRequest) + CreatePolicyBindingRequestOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "CreatePolicyBindingRequest"); + } + + // Use CreatePolicyBindingRequest.newBuilder() to construct. + private CreatePolicyBindingRequest(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private CreatePolicyBindingRequest() { + parent_ = ""; + policyBindingId_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.iam.v3.PolicyBindingsServiceProto + .internal_static_google_iam_v3_CreatePolicyBindingRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.iam.v3.PolicyBindingsServiceProto + .internal_static_google_iam_v3_CreatePolicyBindingRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.iam.v3.CreatePolicyBindingRequest.class, + com.google.iam.v3.CreatePolicyBindingRequest.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 where this policy binding will be created.
        +   * The binding parent is the closest Resource Manager resource (project,
        +   * folder or organization) to the binding target.
        +   *
        +   * Format:
        +   *
        +   * * `projects/{project_id}/locations/{location}`
        +   * * `projects/{project_number}/locations/{location}`
        +   * * `folders/{folder_id}/locations/{location}`
        +   * * `organizations/{organization_id}/locations/{location}`
        +   * 
        + * + * + * 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 where this policy binding will be created.
        +   * The binding parent is the closest Resource Manager resource (project,
        +   * folder or organization) to the binding target.
        +   *
        +   * Format:
        +   *
        +   * * `projects/{project_id}/locations/{location}`
        +   * * `projects/{project_number}/locations/{location}`
        +   * * `folders/{folder_id}/locations/{location}`
        +   * * `organizations/{organization_id}/locations/{location}`
        +   * 
        + * + * + * 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 POLICY_BINDING_ID_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object policyBindingId_ = ""; + + /** + * + * + *
        +   * Required. The ID to use for the policy binding, which will become the final
        +   * component of the policy binding's resource name.
        +   *
        +   * This value must start with a lowercase letter followed by up to 62
        +   * lowercase letters, numbers, hyphens, or dots. Pattern,
        +   * /[a-z][a-z0-9-\.]{2,62}/.
        +   * 
        + * + * string policy_binding_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The policyBindingId. + */ + @java.lang.Override + public java.lang.String getPolicyBindingId() { + java.lang.Object ref = policyBindingId_; + 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(); + policyBindingId_ = s; + return s; + } + } + + /** + * + * + *
        +   * Required. The ID to use for the policy binding, which will become the final
        +   * component of the policy binding's resource name.
        +   *
        +   * This value must start with a lowercase letter followed by up to 62
        +   * lowercase letters, numbers, hyphens, or dots. Pattern,
        +   * /[a-z][a-z0-9-\.]{2,62}/.
        +   * 
        + * + * string policy_binding_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for policyBindingId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getPolicyBindingIdBytes() { + java.lang.Object ref = policyBindingId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + policyBindingId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int POLICY_BINDING_FIELD_NUMBER = 3; + private com.google.iam.v3.PolicyBinding policyBinding_; + + /** + * + * + *
        +   * Required. The policy binding to create.
        +   * 
        + * + * + * .google.iam.v3.PolicyBinding policy_binding = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the policyBinding field is set. + */ + @java.lang.Override + public boolean hasPolicyBinding() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
        +   * Required. The policy binding to create.
        +   * 
        + * + * + * .google.iam.v3.PolicyBinding policy_binding = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The policyBinding. + */ + @java.lang.Override + public com.google.iam.v3.PolicyBinding getPolicyBinding() { + return policyBinding_ == null + ? com.google.iam.v3.PolicyBinding.getDefaultInstance() + : policyBinding_; + } + + /** + * + * + *
        +   * Required. The policy binding to create.
        +   * 
        + * + * + * .google.iam.v3.PolicyBinding policy_binding = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.iam.v3.PolicyBindingOrBuilder getPolicyBindingOrBuilder() { + return policyBinding_ == null + ? com.google.iam.v3.PolicyBinding.getDefaultInstance() + : policyBinding_; + } + + public static final int VALIDATE_ONLY_FIELD_NUMBER = 4; + private boolean validateOnly_ = false; + + /** + * + * + *
        +   * Optional. If set, validate the request and preview the creation, but do not
        +   * actually post it.
        +   * 
        + * + * bool validate_only = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The validateOnly. + */ + @java.lang.Override + public boolean getValidateOnly() { + return validateOnly_; + } + + 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.GeneratedMessage.isStringEmpty(parent_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, parent_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(policyBindingId_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, policyBindingId_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(3, getPolicyBinding()); + } + if (validateOnly_ != false) { + output.writeBool(4, validateOnly_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(parent_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, parent_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(policyBindingId_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, policyBindingId_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getPolicyBinding()); + } + if (validateOnly_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(4, validateOnly_); + } + 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.iam.v3.CreatePolicyBindingRequest)) { + return super.equals(obj); + } + com.google.iam.v3.CreatePolicyBindingRequest other = + (com.google.iam.v3.CreatePolicyBindingRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (!getPolicyBindingId().equals(other.getPolicyBindingId())) return false; + if (hasPolicyBinding() != other.hasPolicyBinding()) return false; + if (hasPolicyBinding()) { + if (!getPolicyBinding().equals(other.getPolicyBinding())) return false; + } + if (getValidateOnly() != other.getValidateOnly()) 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) + POLICY_BINDING_ID_FIELD_NUMBER; + hash = (53 * hash) + getPolicyBindingId().hashCode(); + if (hasPolicyBinding()) { + hash = (37 * hash) + POLICY_BINDING_FIELD_NUMBER; + hash = (53 * hash) + getPolicyBinding().hashCode(); + } + hash = (37 * hash) + VALIDATE_ONLY_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getValidateOnly()); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.iam.v3.CreatePolicyBindingRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.iam.v3.CreatePolicyBindingRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.iam.v3.CreatePolicyBindingRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.iam.v3.CreatePolicyBindingRequest 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.iam.v3.CreatePolicyBindingRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.iam.v3.CreatePolicyBindingRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.iam.v3.CreatePolicyBindingRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.iam.v3.CreatePolicyBindingRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.iam.v3.CreatePolicyBindingRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.iam.v3.CreatePolicyBindingRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.iam.v3.CreatePolicyBindingRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.iam.v3.CreatePolicyBindingRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.iam.v3.CreatePolicyBindingRequest 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
        +   * Request message for CreatePolicyBinding method.
        +   * 
        + * + * Protobuf type {@code google.iam.v3.CreatePolicyBindingRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.iam.v3.CreatePolicyBindingRequest) + com.google.iam.v3.CreatePolicyBindingRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.iam.v3.PolicyBindingsServiceProto + .internal_static_google_iam_v3_CreatePolicyBindingRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.iam.v3.PolicyBindingsServiceProto + .internal_static_google_iam_v3_CreatePolicyBindingRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.iam.v3.CreatePolicyBindingRequest.class, + com.google.iam.v3.CreatePolicyBindingRequest.Builder.class); + } + + // Construct using com.google.iam.v3.CreatePolicyBindingRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetPolicyBindingFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + parent_ = ""; + policyBindingId_ = ""; + policyBinding_ = null; + if (policyBindingBuilder_ != null) { + policyBindingBuilder_.dispose(); + policyBindingBuilder_ = null; + } + validateOnly_ = false; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.iam.v3.PolicyBindingsServiceProto + .internal_static_google_iam_v3_CreatePolicyBindingRequest_descriptor; + } + + @java.lang.Override + public com.google.iam.v3.CreatePolicyBindingRequest getDefaultInstanceForType() { + return com.google.iam.v3.CreatePolicyBindingRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.iam.v3.CreatePolicyBindingRequest build() { + com.google.iam.v3.CreatePolicyBindingRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.iam.v3.CreatePolicyBindingRequest buildPartial() { + com.google.iam.v3.CreatePolicyBindingRequest result = + new com.google.iam.v3.CreatePolicyBindingRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.iam.v3.CreatePolicyBindingRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.parent_ = parent_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.policyBindingId_ = policyBindingId_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000004) != 0)) { + result.policyBinding_ = + policyBindingBuilder_ == null ? policyBinding_ : policyBindingBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.validateOnly_ = validateOnly_; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.iam.v3.CreatePolicyBindingRequest) { + return mergeFrom((com.google.iam.v3.CreatePolicyBindingRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.iam.v3.CreatePolicyBindingRequest other) { + if (other == com.google.iam.v3.CreatePolicyBindingRequest.getDefaultInstance()) return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getPolicyBindingId().isEmpty()) { + policyBindingId_ = other.policyBindingId_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (other.hasPolicyBinding()) { + mergePolicyBinding(other.getPolicyBinding()); + } + if (other.getValidateOnly() != false) { + setValidateOnly(other.getValidateOnly()); + } + 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: + { + policyBindingId_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + input.readMessage( + internalGetPolicyBindingFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 32: + { + validateOnly_ = 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 parent_ = ""; + + /** + * + * + *
        +     * Required. The parent resource where this policy binding will be created.
        +     * The binding parent is the closest Resource Manager resource (project,
        +     * folder or organization) to the binding target.
        +     *
        +     * Format:
        +     *
        +     * * `projects/{project_id}/locations/{location}`
        +     * * `projects/{project_number}/locations/{location}`
        +     * * `folders/{folder_id}/locations/{location}`
        +     * * `organizations/{organization_id}/locations/{location}`
        +     * 
        + * + * + * 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 where this policy binding will be created.
        +     * The binding parent is the closest Resource Manager resource (project,
        +     * folder or organization) to the binding target.
        +     *
        +     * Format:
        +     *
        +     * * `projects/{project_id}/locations/{location}`
        +     * * `projects/{project_number}/locations/{location}`
        +     * * `folders/{folder_id}/locations/{location}`
        +     * * `organizations/{organization_id}/locations/{location}`
        +     * 
        + * + * + * 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 where this policy binding will be created.
        +     * The binding parent is the closest Resource Manager resource (project,
        +     * folder or organization) to the binding target.
        +     *
        +     * Format:
        +     *
        +     * * `projects/{project_id}/locations/{location}`
        +     * * `projects/{project_number}/locations/{location}`
        +     * * `folders/{folder_id}/locations/{location}`
        +     * * `organizations/{organization_id}/locations/{location}`
        +     * 
        + * + * + * 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 where this policy binding will be created.
        +     * The binding parent is the closest Resource Manager resource (project,
        +     * folder or organization) to the binding target.
        +     *
        +     * Format:
        +     *
        +     * * `projects/{project_id}/locations/{location}`
        +     * * `projects/{project_number}/locations/{location}`
        +     * * `folders/{folder_id}/locations/{location}`
        +     * * `organizations/{organization_id}/locations/{location}`
        +     * 
        + * + * + * 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 where this policy binding will be created.
        +     * The binding parent is the closest Resource Manager resource (project,
        +     * folder or organization) to the binding target.
        +     *
        +     * Format:
        +     *
        +     * * `projects/{project_id}/locations/{location}`
        +     * * `projects/{project_number}/locations/{location}`
        +     * * `folders/{folder_id}/locations/{location}`
        +     * * `organizations/{organization_id}/locations/{location}`
        +     * 
        + * + * + * 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 policyBindingId_ = ""; + + /** + * + * + *
        +     * Required. The ID to use for the policy binding, which will become the final
        +     * component of the policy binding's resource name.
        +     *
        +     * This value must start with a lowercase letter followed by up to 62
        +     * lowercase letters, numbers, hyphens, or dots. Pattern,
        +     * /[a-z][a-z0-9-\.]{2,62}/.
        +     * 
        + * + * string policy_binding_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The policyBindingId. + */ + public java.lang.String getPolicyBindingId() { + java.lang.Object ref = policyBindingId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + policyBindingId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
        +     * Required. The ID to use for the policy binding, which will become the final
        +     * component of the policy binding's resource name.
        +     *
        +     * This value must start with a lowercase letter followed by up to 62
        +     * lowercase letters, numbers, hyphens, or dots. Pattern,
        +     * /[a-z][a-z0-9-\.]{2,62}/.
        +     * 
        + * + * string policy_binding_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for policyBindingId. + */ + public com.google.protobuf.ByteString getPolicyBindingIdBytes() { + java.lang.Object ref = policyBindingId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + policyBindingId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
        +     * Required. The ID to use for the policy binding, which will become the final
        +     * component of the policy binding's resource name.
        +     *
        +     * This value must start with a lowercase letter followed by up to 62
        +     * lowercase letters, numbers, hyphens, or dots. Pattern,
        +     * /[a-z][a-z0-9-\.]{2,62}/.
        +     * 
        + * + * string policy_binding_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The policyBindingId to set. + * @return This builder for chaining. + */ + public Builder setPolicyBindingId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + policyBindingId_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
        +     * Required. The ID to use for the policy binding, which will become the final
        +     * component of the policy binding's resource name.
        +     *
        +     * This value must start with a lowercase letter followed by up to 62
        +     * lowercase letters, numbers, hyphens, or dots. Pattern,
        +     * /[a-z][a-z0-9-\.]{2,62}/.
        +     * 
        + * + * string policy_binding_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearPolicyBindingId() { + policyBindingId_ = getDefaultInstance().getPolicyBindingId(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
        +     * Required. The ID to use for the policy binding, which will become the final
        +     * component of the policy binding's resource name.
        +     *
        +     * This value must start with a lowercase letter followed by up to 62
        +     * lowercase letters, numbers, hyphens, or dots. Pattern,
        +     * /[a-z][a-z0-9-\.]{2,62}/.
        +     * 
        + * + * string policy_binding_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for policyBindingId to set. + * @return This builder for chaining. + */ + public Builder setPolicyBindingIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + policyBindingId_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private com.google.iam.v3.PolicyBinding policyBinding_; + private com.google.protobuf.SingleFieldBuilder< + com.google.iam.v3.PolicyBinding, + com.google.iam.v3.PolicyBinding.Builder, + com.google.iam.v3.PolicyBindingOrBuilder> + policyBindingBuilder_; + + /** + * + * + *
        +     * Required. The policy binding to create.
        +     * 
        + * + * + * .google.iam.v3.PolicyBinding policy_binding = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the policyBinding field is set. + */ + public boolean hasPolicyBinding() { + return ((bitField0_ & 0x00000004) != 0); + } + + /** + * + * + *
        +     * Required. The policy binding to create.
        +     * 
        + * + * + * .google.iam.v3.PolicyBinding policy_binding = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The policyBinding. + */ + public com.google.iam.v3.PolicyBinding getPolicyBinding() { + if (policyBindingBuilder_ == null) { + return policyBinding_ == null + ? com.google.iam.v3.PolicyBinding.getDefaultInstance() + : policyBinding_; + } else { + return policyBindingBuilder_.getMessage(); + } + } + + /** + * + * + *
        +     * Required. The policy binding to create.
        +     * 
        + * + * + * .google.iam.v3.PolicyBinding policy_binding = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setPolicyBinding(com.google.iam.v3.PolicyBinding value) { + if (policyBindingBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + policyBinding_ = value; + } else { + policyBindingBuilder_.setMessage(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
        +     * Required. The policy binding to create.
        +     * 
        + * + * + * .google.iam.v3.PolicyBinding policy_binding = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setPolicyBinding(com.google.iam.v3.PolicyBinding.Builder builderForValue) { + if (policyBindingBuilder_ == null) { + policyBinding_ = builderForValue.build(); + } else { + policyBindingBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
        +     * Required. The policy binding to create.
        +     * 
        + * + * + * .google.iam.v3.PolicyBinding policy_binding = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergePolicyBinding(com.google.iam.v3.PolicyBinding value) { + if (policyBindingBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0) + && policyBinding_ != null + && policyBinding_ != com.google.iam.v3.PolicyBinding.getDefaultInstance()) { + getPolicyBindingBuilder().mergeFrom(value); + } else { + policyBinding_ = value; + } + } else { + policyBindingBuilder_.mergeFrom(value); + } + if (policyBinding_ != null) { + bitField0_ |= 0x00000004; + onChanged(); + } + return this; + } + + /** + * + * + *
        +     * Required. The policy binding to create.
        +     * 
        + * + * + * .google.iam.v3.PolicyBinding policy_binding = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearPolicyBinding() { + bitField0_ = (bitField0_ & ~0x00000004); + policyBinding_ = null; + if (policyBindingBuilder_ != null) { + policyBindingBuilder_.dispose(); + policyBindingBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
        +     * Required. The policy binding to create.
        +     * 
        + * + * + * .google.iam.v3.PolicyBinding policy_binding = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.iam.v3.PolicyBinding.Builder getPolicyBindingBuilder() { + bitField0_ |= 0x00000004; + onChanged(); + return internalGetPolicyBindingFieldBuilder().getBuilder(); + } + + /** + * + * + *
        +     * Required. The policy binding to create.
        +     * 
        + * + * + * .google.iam.v3.PolicyBinding policy_binding = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.iam.v3.PolicyBindingOrBuilder getPolicyBindingOrBuilder() { + if (policyBindingBuilder_ != null) { + return policyBindingBuilder_.getMessageOrBuilder(); + } else { + return policyBinding_ == null + ? com.google.iam.v3.PolicyBinding.getDefaultInstance() + : policyBinding_; + } + } + + /** + * + * + *
        +     * Required. The policy binding to create.
        +     * 
        + * + * + * .google.iam.v3.PolicyBinding policy_binding = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.iam.v3.PolicyBinding, + com.google.iam.v3.PolicyBinding.Builder, + com.google.iam.v3.PolicyBindingOrBuilder> + internalGetPolicyBindingFieldBuilder() { + if (policyBindingBuilder_ == null) { + policyBindingBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.iam.v3.PolicyBinding, + com.google.iam.v3.PolicyBinding.Builder, + com.google.iam.v3.PolicyBindingOrBuilder>( + getPolicyBinding(), getParentForChildren(), isClean()); + policyBinding_ = null; + } + return policyBindingBuilder_; + } + + private boolean validateOnly_; + + /** + * + * + *
        +     * Optional. If set, validate the request and preview the creation, but do not
        +     * actually post it.
        +     * 
        + * + * bool validate_only = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The validateOnly. + */ + @java.lang.Override + public boolean getValidateOnly() { + return validateOnly_; + } + + /** + * + * + *
        +     * Optional. If set, validate the request and preview the creation, but do not
        +     * actually post it.
        +     * 
        + * + * bool validate_only = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The validateOnly to set. + * @return This builder for chaining. + */ + public Builder setValidateOnly(boolean value) { + + validateOnly_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + /** + * + * + *
        +     * Optional. If set, validate the request and preview the creation, but do not
        +     * actually post it.
        +     * 
        + * + * bool validate_only = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearValidateOnly() { + bitField0_ = (bitField0_ & ~0x00000008); + validateOnly_ = false; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.iam.v3.CreatePolicyBindingRequest) + } + + // @@protoc_insertion_point(class_scope:google.iam.v3.CreatePolicyBindingRequest) + private static final com.google.iam.v3.CreatePolicyBindingRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.iam.v3.CreatePolicyBindingRequest(); + } + + public static com.google.iam.v3.CreatePolicyBindingRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CreatePolicyBindingRequest 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.iam.v3.CreatePolicyBindingRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-iam/proto-google-iam-v3/src/main/java/com/google/iam/v3/CreatePolicyBindingRequestOrBuilder.java b/java-iam/proto-google-iam-v3/src/main/java/com/google/iam/v3/CreatePolicyBindingRequestOrBuilder.java new file mode 100644 index 0000000000..2308f6f568 --- /dev/null +++ b/java-iam/proto-google-iam-v3/src/main/java/com/google/iam/v3/CreatePolicyBindingRequestOrBuilder.java @@ -0,0 +1,169 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/iam/v3/policy_bindings_service.proto +// Protobuf Java Version: 4.33.2 + +package com.google.iam.v3; + +@com.google.protobuf.Generated +public interface CreatePolicyBindingRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.iam.v3.CreatePolicyBindingRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
        +   * Required. The parent resource where this policy binding will be created.
        +   * The binding parent is the closest Resource Manager resource (project,
        +   * folder or organization) to the binding target.
        +   *
        +   * Format:
        +   *
        +   * * `projects/{project_id}/locations/{location}`
        +   * * `projects/{project_number}/locations/{location}`
        +   * * `folders/{folder_id}/locations/{location}`
        +   * * `organizations/{organization_id}/locations/{location}`
        +   * 
        + * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + + /** + * + * + *
        +   * Required. The parent resource where this policy binding will be created.
        +   * The binding parent is the closest Resource Manager resource (project,
        +   * folder or organization) to the binding target.
        +   *
        +   * Format:
        +   *
        +   * * `projects/{project_id}/locations/{location}`
        +   * * `projects/{project_number}/locations/{location}`
        +   * * `folders/{folder_id}/locations/{location}`
        +   * * `organizations/{organization_id}/locations/{location}`
        +   * 
        + * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
        +   * Required. The ID to use for the policy binding, which will become the final
        +   * component of the policy binding's resource name.
        +   *
        +   * This value must start with a lowercase letter followed by up to 62
        +   * lowercase letters, numbers, hyphens, or dots. Pattern,
        +   * /[a-z][a-z0-9-\.]{2,62}/.
        +   * 
        + * + * string policy_binding_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The policyBindingId. + */ + java.lang.String getPolicyBindingId(); + + /** + * + * + *
        +   * Required. The ID to use for the policy binding, which will become the final
        +   * component of the policy binding's resource name.
        +   *
        +   * This value must start with a lowercase letter followed by up to 62
        +   * lowercase letters, numbers, hyphens, or dots. Pattern,
        +   * /[a-z][a-z0-9-\.]{2,62}/.
        +   * 
        + * + * string policy_binding_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for policyBindingId. + */ + com.google.protobuf.ByteString getPolicyBindingIdBytes(); + + /** + * + * + *
        +   * Required. The policy binding to create.
        +   * 
        + * + * + * .google.iam.v3.PolicyBinding policy_binding = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the policyBinding field is set. + */ + boolean hasPolicyBinding(); + + /** + * + * + *
        +   * Required. The policy binding to create.
        +   * 
        + * + * + * .google.iam.v3.PolicyBinding policy_binding = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The policyBinding. + */ + com.google.iam.v3.PolicyBinding getPolicyBinding(); + + /** + * + * + *
        +   * Required. The policy binding to create.
        +   * 
        + * + * + * .google.iam.v3.PolicyBinding policy_binding = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.iam.v3.PolicyBindingOrBuilder getPolicyBindingOrBuilder(); + + /** + * + * + *
        +   * Optional. If set, validate the request and preview the creation, but do not
        +   * actually post it.
        +   * 
        + * + * bool validate_only = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The validateOnly. + */ + boolean getValidateOnly(); +} diff --git a/java-iam/proto-google-iam-v3/src/main/java/com/google/iam/v3/CreatePrincipalAccessBoundaryPolicyRequest.java b/java-iam/proto-google-iam-v3/src/main/java/com/google/iam/v3/CreatePrincipalAccessBoundaryPolicyRequest.java new file mode 100644 index 0000000000..c9339b0fc4 --- /dev/null +++ b/java-iam/proto-google-iam-v3/src/main/java/com/google/iam/v3/CreatePrincipalAccessBoundaryPolicyRequest.java @@ -0,0 +1,1325 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/iam/v3/principal_access_boundary_policies_service.proto +// Protobuf Java Version: 4.33.2 + +package com.google.iam.v3; + +/** + * + * + *
        + * Request message for CreatePrincipalAccessBoundaryPolicyRequest method.
        + * 
        + * + * Protobuf type {@code google.iam.v3.CreatePrincipalAccessBoundaryPolicyRequest} + */ +@com.google.protobuf.Generated +public final class CreatePrincipalAccessBoundaryPolicyRequest + extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.iam.v3.CreatePrincipalAccessBoundaryPolicyRequest) + CreatePrincipalAccessBoundaryPolicyRequestOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "CreatePrincipalAccessBoundaryPolicyRequest"); + } + + // Use CreatePrincipalAccessBoundaryPolicyRequest.newBuilder() to construct. + private CreatePrincipalAccessBoundaryPolicyRequest( + com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private CreatePrincipalAccessBoundaryPolicyRequest() { + parent_ = ""; + principalAccessBoundaryPolicyId_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.iam.v3.PrincipalAccessBoundaryPoliciesServiceProto + .internal_static_google_iam_v3_CreatePrincipalAccessBoundaryPolicyRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.iam.v3.PrincipalAccessBoundaryPoliciesServiceProto + .internal_static_google_iam_v3_CreatePrincipalAccessBoundaryPolicyRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.iam.v3.CreatePrincipalAccessBoundaryPolicyRequest.class, + com.google.iam.v3.CreatePrincipalAccessBoundaryPolicyRequest.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 where this principal access boundary policy
        +   * will be created. Only organizations are supported.
        +   *
        +   * Format:
        +   * `organizations/{organization_id}/locations/{location}`
        +   * 
        + * + * + * 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 where this principal access boundary policy
        +   * will be created. Only organizations are supported.
        +   *
        +   * Format:
        +   * `organizations/{organization_id}/locations/{location}`
        +   * 
        + * + * + * 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 PRINCIPAL_ACCESS_BOUNDARY_POLICY_ID_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object principalAccessBoundaryPolicyId_ = ""; + + /** + * + * + *
        +   * Required. The ID to use for the principal access boundary policy, which
        +   * will become the final component of the principal access boundary policy's
        +   * resource name.
        +   *
        +   * This value must start with a lowercase letter followed by up to 62
        +   * lowercase letters, numbers, hyphens, or dots. Pattern,
        +   * /[a-z][a-z0-9-\.]{2,62}/.
        +   * 
        + * + * string principal_access_boundary_policy_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The principalAccessBoundaryPolicyId. + */ + @java.lang.Override + public java.lang.String getPrincipalAccessBoundaryPolicyId() { + java.lang.Object ref = principalAccessBoundaryPolicyId_; + 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(); + principalAccessBoundaryPolicyId_ = s; + return s; + } + } + + /** + * + * + *
        +   * Required. The ID to use for the principal access boundary policy, which
        +   * will become the final component of the principal access boundary policy's
        +   * resource name.
        +   *
        +   * This value must start with a lowercase letter followed by up to 62
        +   * lowercase letters, numbers, hyphens, or dots. Pattern,
        +   * /[a-z][a-z0-9-\.]{2,62}/.
        +   * 
        + * + * string principal_access_boundary_policy_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The bytes for principalAccessBoundaryPolicyId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getPrincipalAccessBoundaryPolicyIdBytes() { + java.lang.Object ref = principalAccessBoundaryPolicyId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + principalAccessBoundaryPolicyId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PRINCIPAL_ACCESS_BOUNDARY_POLICY_FIELD_NUMBER = 3; + private com.google.iam.v3.PrincipalAccessBoundaryPolicy principalAccessBoundaryPolicy_; + + /** + * + * + *
        +   * Required. The principal access boundary policy to create.
        +   * 
        + * + * + * .google.iam.v3.PrincipalAccessBoundaryPolicy principal_access_boundary_policy = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the principalAccessBoundaryPolicy field is set. + */ + @java.lang.Override + public boolean hasPrincipalAccessBoundaryPolicy() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
        +   * Required. The principal access boundary policy to create.
        +   * 
        + * + * + * .google.iam.v3.PrincipalAccessBoundaryPolicy principal_access_boundary_policy = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The principalAccessBoundaryPolicy. + */ + @java.lang.Override + public com.google.iam.v3.PrincipalAccessBoundaryPolicy getPrincipalAccessBoundaryPolicy() { + return principalAccessBoundaryPolicy_ == null + ? com.google.iam.v3.PrincipalAccessBoundaryPolicy.getDefaultInstance() + : principalAccessBoundaryPolicy_; + } + + /** + * + * + *
        +   * Required. The principal access boundary policy to create.
        +   * 
        + * + * + * .google.iam.v3.PrincipalAccessBoundaryPolicy principal_access_boundary_policy = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.iam.v3.PrincipalAccessBoundaryPolicyOrBuilder + getPrincipalAccessBoundaryPolicyOrBuilder() { + return principalAccessBoundaryPolicy_ == null + ? com.google.iam.v3.PrincipalAccessBoundaryPolicy.getDefaultInstance() + : principalAccessBoundaryPolicy_; + } + + public static final int VALIDATE_ONLY_FIELD_NUMBER = 4; + private boolean validateOnly_ = false; + + /** + * + * + *
        +   * Optional. If set, validate the request and preview the creation, but do not
        +   * actually post it.
        +   * 
        + * + * bool validate_only = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The validateOnly. + */ + @java.lang.Override + public boolean getValidateOnly() { + return validateOnly_; + } + + 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.GeneratedMessage.isStringEmpty(parent_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, parent_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(principalAccessBoundaryPolicyId_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, principalAccessBoundaryPolicyId_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(3, getPrincipalAccessBoundaryPolicy()); + } + if (validateOnly_ != false) { + output.writeBool(4, validateOnly_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(parent_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, parent_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(principalAccessBoundaryPolicyId_)) { + size += + com.google.protobuf.GeneratedMessage.computeStringSize( + 2, principalAccessBoundaryPolicyId_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 3, getPrincipalAccessBoundaryPolicy()); + } + if (validateOnly_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(4, validateOnly_); + } + 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.iam.v3.CreatePrincipalAccessBoundaryPolicyRequest)) { + return super.equals(obj); + } + com.google.iam.v3.CreatePrincipalAccessBoundaryPolicyRequest other = + (com.google.iam.v3.CreatePrincipalAccessBoundaryPolicyRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (!getPrincipalAccessBoundaryPolicyId().equals(other.getPrincipalAccessBoundaryPolicyId())) + return false; + if (hasPrincipalAccessBoundaryPolicy() != other.hasPrincipalAccessBoundaryPolicy()) + return false; + if (hasPrincipalAccessBoundaryPolicy()) { + if (!getPrincipalAccessBoundaryPolicy().equals(other.getPrincipalAccessBoundaryPolicy())) + return false; + } + if (getValidateOnly() != other.getValidateOnly()) 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) + PRINCIPAL_ACCESS_BOUNDARY_POLICY_ID_FIELD_NUMBER; + hash = (53 * hash) + getPrincipalAccessBoundaryPolicyId().hashCode(); + if (hasPrincipalAccessBoundaryPolicy()) { + hash = (37 * hash) + PRINCIPAL_ACCESS_BOUNDARY_POLICY_FIELD_NUMBER; + hash = (53 * hash) + getPrincipalAccessBoundaryPolicy().hashCode(); + } + hash = (37 * hash) + VALIDATE_ONLY_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getValidateOnly()); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.iam.v3.CreatePrincipalAccessBoundaryPolicyRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.iam.v3.CreatePrincipalAccessBoundaryPolicyRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.iam.v3.CreatePrincipalAccessBoundaryPolicyRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.iam.v3.CreatePrincipalAccessBoundaryPolicyRequest 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.iam.v3.CreatePrincipalAccessBoundaryPolicyRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.iam.v3.CreatePrincipalAccessBoundaryPolicyRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.iam.v3.CreatePrincipalAccessBoundaryPolicyRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.iam.v3.CreatePrincipalAccessBoundaryPolicyRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.iam.v3.CreatePrincipalAccessBoundaryPolicyRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.iam.v3.CreatePrincipalAccessBoundaryPolicyRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.iam.v3.CreatePrincipalAccessBoundaryPolicyRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.iam.v3.CreatePrincipalAccessBoundaryPolicyRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.iam.v3.CreatePrincipalAccessBoundaryPolicyRequest 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
        +   * Request message for CreatePrincipalAccessBoundaryPolicyRequest method.
        +   * 
        + * + * Protobuf type {@code google.iam.v3.CreatePrincipalAccessBoundaryPolicyRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.iam.v3.CreatePrincipalAccessBoundaryPolicyRequest) + com.google.iam.v3.CreatePrincipalAccessBoundaryPolicyRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.iam.v3.PrincipalAccessBoundaryPoliciesServiceProto + .internal_static_google_iam_v3_CreatePrincipalAccessBoundaryPolicyRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.iam.v3.PrincipalAccessBoundaryPoliciesServiceProto + .internal_static_google_iam_v3_CreatePrincipalAccessBoundaryPolicyRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.iam.v3.CreatePrincipalAccessBoundaryPolicyRequest.class, + com.google.iam.v3.CreatePrincipalAccessBoundaryPolicyRequest.Builder.class); + } + + // Construct using com.google.iam.v3.CreatePrincipalAccessBoundaryPolicyRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetPrincipalAccessBoundaryPolicyFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + parent_ = ""; + principalAccessBoundaryPolicyId_ = ""; + principalAccessBoundaryPolicy_ = null; + if (principalAccessBoundaryPolicyBuilder_ != null) { + principalAccessBoundaryPolicyBuilder_.dispose(); + principalAccessBoundaryPolicyBuilder_ = null; + } + validateOnly_ = false; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.iam.v3.PrincipalAccessBoundaryPoliciesServiceProto + .internal_static_google_iam_v3_CreatePrincipalAccessBoundaryPolicyRequest_descriptor; + } + + @java.lang.Override + public com.google.iam.v3.CreatePrincipalAccessBoundaryPolicyRequest + getDefaultInstanceForType() { + return com.google.iam.v3.CreatePrincipalAccessBoundaryPolicyRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.iam.v3.CreatePrincipalAccessBoundaryPolicyRequest build() { + com.google.iam.v3.CreatePrincipalAccessBoundaryPolicyRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.iam.v3.CreatePrincipalAccessBoundaryPolicyRequest buildPartial() { + com.google.iam.v3.CreatePrincipalAccessBoundaryPolicyRequest result = + new com.google.iam.v3.CreatePrincipalAccessBoundaryPolicyRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.iam.v3.CreatePrincipalAccessBoundaryPolicyRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.parent_ = parent_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.principalAccessBoundaryPolicyId_ = principalAccessBoundaryPolicyId_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000004) != 0)) { + result.principalAccessBoundaryPolicy_ = + principalAccessBoundaryPolicyBuilder_ == null + ? principalAccessBoundaryPolicy_ + : principalAccessBoundaryPolicyBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.validateOnly_ = validateOnly_; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.iam.v3.CreatePrincipalAccessBoundaryPolicyRequest) { + return mergeFrom((com.google.iam.v3.CreatePrincipalAccessBoundaryPolicyRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.iam.v3.CreatePrincipalAccessBoundaryPolicyRequest other) { + if (other + == com.google.iam.v3.CreatePrincipalAccessBoundaryPolicyRequest.getDefaultInstance()) + return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getPrincipalAccessBoundaryPolicyId().isEmpty()) { + principalAccessBoundaryPolicyId_ = other.principalAccessBoundaryPolicyId_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (other.hasPrincipalAccessBoundaryPolicy()) { + mergePrincipalAccessBoundaryPolicy(other.getPrincipalAccessBoundaryPolicy()); + } + if (other.getValidateOnly() != false) { + setValidateOnly(other.getValidateOnly()); + } + 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: + { + principalAccessBoundaryPolicyId_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + input.readMessage( + internalGetPrincipalAccessBoundaryPolicyFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 32: + { + validateOnly_ = 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 parent_ = ""; + + /** + * + * + *
        +     * Required. The parent resource where this principal access boundary policy
        +     * will be created. Only organizations are supported.
        +     *
        +     * Format:
        +     * `organizations/{organization_id}/locations/{location}`
        +     * 
        + * + * + * 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 where this principal access boundary policy
        +     * will be created. Only organizations are supported.
        +     *
        +     * Format:
        +     * `organizations/{organization_id}/locations/{location}`
        +     * 
        + * + * + * 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 where this principal access boundary policy
        +     * will be created. Only organizations are supported.
        +     *
        +     * Format:
        +     * `organizations/{organization_id}/locations/{location}`
        +     * 
        + * + * + * 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 where this principal access boundary policy
        +     * will be created. Only organizations are supported.
        +     *
        +     * Format:
        +     * `organizations/{organization_id}/locations/{location}`
        +     * 
        + * + * + * 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 where this principal access boundary policy
        +     * will be created. Only organizations are supported.
        +     *
        +     * Format:
        +     * `organizations/{organization_id}/locations/{location}`
        +     * 
        + * + * + * 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 principalAccessBoundaryPolicyId_ = ""; + + /** + * + * + *
        +     * Required. The ID to use for the principal access boundary policy, which
        +     * will become the final component of the principal access boundary policy's
        +     * resource name.
        +     *
        +     * This value must start with a lowercase letter followed by up to 62
        +     * lowercase letters, numbers, hyphens, or dots. Pattern,
        +     * /[a-z][a-z0-9-\.]{2,62}/.
        +     * 
        + * + * + * string principal_access_boundary_policy_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The principalAccessBoundaryPolicyId. + */ + public java.lang.String getPrincipalAccessBoundaryPolicyId() { + java.lang.Object ref = principalAccessBoundaryPolicyId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + principalAccessBoundaryPolicyId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
        +     * Required. The ID to use for the principal access boundary policy, which
        +     * will become the final component of the principal access boundary policy's
        +     * resource name.
        +     *
        +     * This value must start with a lowercase letter followed by up to 62
        +     * lowercase letters, numbers, hyphens, or dots. Pattern,
        +     * /[a-z][a-z0-9-\.]{2,62}/.
        +     * 
        + * + * + * string principal_access_boundary_policy_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The bytes for principalAccessBoundaryPolicyId. + */ + public com.google.protobuf.ByteString getPrincipalAccessBoundaryPolicyIdBytes() { + java.lang.Object ref = principalAccessBoundaryPolicyId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + principalAccessBoundaryPolicyId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
        +     * Required. The ID to use for the principal access boundary policy, which
        +     * will become the final component of the principal access boundary policy's
        +     * resource name.
        +     *
        +     * This value must start with a lowercase letter followed by up to 62
        +     * lowercase letters, numbers, hyphens, or dots. Pattern,
        +     * /[a-z][a-z0-9-\.]{2,62}/.
        +     * 
        + * + * + * string principal_access_boundary_policy_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @param value The principalAccessBoundaryPolicyId to set. + * @return This builder for chaining. + */ + public Builder setPrincipalAccessBoundaryPolicyId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + principalAccessBoundaryPolicyId_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
        +     * Required. The ID to use for the principal access boundary policy, which
        +     * will become the final component of the principal access boundary policy's
        +     * resource name.
        +     *
        +     * This value must start with a lowercase letter followed by up to 62
        +     * lowercase letters, numbers, hyphens, or dots. Pattern,
        +     * /[a-z][a-z0-9-\.]{2,62}/.
        +     * 
        + * + * + * string principal_access_boundary_policy_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return This builder for chaining. + */ + public Builder clearPrincipalAccessBoundaryPolicyId() { + principalAccessBoundaryPolicyId_ = getDefaultInstance().getPrincipalAccessBoundaryPolicyId(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
        +     * Required. The ID to use for the principal access boundary policy, which
        +     * will become the final component of the principal access boundary policy's
        +     * resource name.
        +     *
        +     * This value must start with a lowercase letter followed by up to 62
        +     * lowercase letters, numbers, hyphens, or dots. Pattern,
        +     * /[a-z][a-z0-9-\.]{2,62}/.
        +     * 
        + * + * + * string principal_access_boundary_policy_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @param value The bytes for principalAccessBoundaryPolicyId to set. + * @return This builder for chaining. + */ + public Builder setPrincipalAccessBoundaryPolicyIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + principalAccessBoundaryPolicyId_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private com.google.iam.v3.PrincipalAccessBoundaryPolicy principalAccessBoundaryPolicy_; + private com.google.protobuf.SingleFieldBuilder< + com.google.iam.v3.PrincipalAccessBoundaryPolicy, + com.google.iam.v3.PrincipalAccessBoundaryPolicy.Builder, + com.google.iam.v3.PrincipalAccessBoundaryPolicyOrBuilder> + principalAccessBoundaryPolicyBuilder_; + + /** + * + * + *
        +     * Required. The principal access boundary policy to create.
        +     * 
        + * + * + * .google.iam.v3.PrincipalAccessBoundaryPolicy principal_access_boundary_policy = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the principalAccessBoundaryPolicy field is set. + */ + public boolean hasPrincipalAccessBoundaryPolicy() { + return ((bitField0_ & 0x00000004) != 0); + } + + /** + * + * + *
        +     * Required. The principal access boundary policy to create.
        +     * 
        + * + * + * .google.iam.v3.PrincipalAccessBoundaryPolicy principal_access_boundary_policy = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The principalAccessBoundaryPolicy. + */ + public com.google.iam.v3.PrincipalAccessBoundaryPolicy getPrincipalAccessBoundaryPolicy() { + if (principalAccessBoundaryPolicyBuilder_ == null) { + return principalAccessBoundaryPolicy_ == null + ? com.google.iam.v3.PrincipalAccessBoundaryPolicy.getDefaultInstance() + : principalAccessBoundaryPolicy_; + } else { + return principalAccessBoundaryPolicyBuilder_.getMessage(); + } + } + + /** + * + * + *
        +     * Required. The principal access boundary policy to create.
        +     * 
        + * + * + * .google.iam.v3.PrincipalAccessBoundaryPolicy principal_access_boundary_policy = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setPrincipalAccessBoundaryPolicy( + com.google.iam.v3.PrincipalAccessBoundaryPolicy value) { + if (principalAccessBoundaryPolicyBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + principalAccessBoundaryPolicy_ = value; + } else { + principalAccessBoundaryPolicyBuilder_.setMessage(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
        +     * Required. The principal access boundary policy to create.
        +     * 
        + * + * + * .google.iam.v3.PrincipalAccessBoundaryPolicy principal_access_boundary_policy = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setPrincipalAccessBoundaryPolicy( + com.google.iam.v3.PrincipalAccessBoundaryPolicy.Builder builderForValue) { + if (principalAccessBoundaryPolicyBuilder_ == null) { + principalAccessBoundaryPolicy_ = builderForValue.build(); + } else { + principalAccessBoundaryPolicyBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
        +     * Required. The principal access boundary policy to create.
        +     * 
        + * + * + * .google.iam.v3.PrincipalAccessBoundaryPolicy principal_access_boundary_policy = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergePrincipalAccessBoundaryPolicy( + com.google.iam.v3.PrincipalAccessBoundaryPolicy value) { + if (principalAccessBoundaryPolicyBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0) + && principalAccessBoundaryPolicy_ != null + && principalAccessBoundaryPolicy_ + != com.google.iam.v3.PrincipalAccessBoundaryPolicy.getDefaultInstance()) { + getPrincipalAccessBoundaryPolicyBuilder().mergeFrom(value); + } else { + principalAccessBoundaryPolicy_ = value; + } + } else { + principalAccessBoundaryPolicyBuilder_.mergeFrom(value); + } + if (principalAccessBoundaryPolicy_ != null) { + bitField0_ |= 0x00000004; + onChanged(); + } + return this; + } + + /** + * + * + *
        +     * Required. The principal access boundary policy to create.
        +     * 
        + * + * + * .google.iam.v3.PrincipalAccessBoundaryPolicy principal_access_boundary_policy = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearPrincipalAccessBoundaryPolicy() { + bitField0_ = (bitField0_ & ~0x00000004); + principalAccessBoundaryPolicy_ = null; + if (principalAccessBoundaryPolicyBuilder_ != null) { + principalAccessBoundaryPolicyBuilder_.dispose(); + principalAccessBoundaryPolicyBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
        +     * Required. The principal access boundary policy to create.
        +     * 
        + * + * + * .google.iam.v3.PrincipalAccessBoundaryPolicy principal_access_boundary_policy = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.iam.v3.PrincipalAccessBoundaryPolicy.Builder + getPrincipalAccessBoundaryPolicyBuilder() { + bitField0_ |= 0x00000004; + onChanged(); + return internalGetPrincipalAccessBoundaryPolicyFieldBuilder().getBuilder(); + } + + /** + * + * + *
        +     * Required. The principal access boundary policy to create.
        +     * 
        + * + * + * .google.iam.v3.PrincipalAccessBoundaryPolicy principal_access_boundary_policy = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.iam.v3.PrincipalAccessBoundaryPolicyOrBuilder + getPrincipalAccessBoundaryPolicyOrBuilder() { + if (principalAccessBoundaryPolicyBuilder_ != null) { + return principalAccessBoundaryPolicyBuilder_.getMessageOrBuilder(); + } else { + return principalAccessBoundaryPolicy_ == null + ? com.google.iam.v3.PrincipalAccessBoundaryPolicy.getDefaultInstance() + : principalAccessBoundaryPolicy_; + } + } + + /** + * + * + *
        +     * Required. The principal access boundary policy to create.
        +     * 
        + * + * + * .google.iam.v3.PrincipalAccessBoundaryPolicy principal_access_boundary_policy = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.iam.v3.PrincipalAccessBoundaryPolicy, + com.google.iam.v3.PrincipalAccessBoundaryPolicy.Builder, + com.google.iam.v3.PrincipalAccessBoundaryPolicyOrBuilder> + internalGetPrincipalAccessBoundaryPolicyFieldBuilder() { + if (principalAccessBoundaryPolicyBuilder_ == null) { + principalAccessBoundaryPolicyBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.iam.v3.PrincipalAccessBoundaryPolicy, + com.google.iam.v3.PrincipalAccessBoundaryPolicy.Builder, + com.google.iam.v3.PrincipalAccessBoundaryPolicyOrBuilder>( + getPrincipalAccessBoundaryPolicy(), getParentForChildren(), isClean()); + principalAccessBoundaryPolicy_ = null; + } + return principalAccessBoundaryPolicyBuilder_; + } + + private boolean validateOnly_; + + /** + * + * + *
        +     * Optional. If set, validate the request and preview the creation, but do not
        +     * actually post it.
        +     * 
        + * + * bool validate_only = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The validateOnly. + */ + @java.lang.Override + public boolean getValidateOnly() { + return validateOnly_; + } + + /** + * + * + *
        +     * Optional. If set, validate the request and preview the creation, but do not
        +     * actually post it.
        +     * 
        + * + * bool validate_only = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The validateOnly to set. + * @return This builder for chaining. + */ + public Builder setValidateOnly(boolean value) { + + validateOnly_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + /** + * + * + *
        +     * Optional. If set, validate the request and preview the creation, but do not
        +     * actually post it.
        +     * 
        + * + * bool validate_only = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearValidateOnly() { + bitField0_ = (bitField0_ & ~0x00000008); + validateOnly_ = false; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.iam.v3.CreatePrincipalAccessBoundaryPolicyRequest) + } + + // @@protoc_insertion_point(class_scope:google.iam.v3.CreatePrincipalAccessBoundaryPolicyRequest) + private static final com.google.iam.v3.CreatePrincipalAccessBoundaryPolicyRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.iam.v3.CreatePrincipalAccessBoundaryPolicyRequest(); + } + + public static com.google.iam.v3.CreatePrincipalAccessBoundaryPolicyRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CreatePrincipalAccessBoundaryPolicyRequest 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.iam.v3.CreatePrincipalAccessBoundaryPolicyRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-iam/proto-google-iam-v3/src/main/java/com/google/iam/v3/CreatePrincipalAccessBoundaryPolicyRequestOrBuilder.java b/java-iam/proto-google-iam-v3/src/main/java/com/google/iam/v3/CreatePrincipalAccessBoundaryPolicyRequestOrBuilder.java new file mode 100644 index 0000000000..b6d0126f31 --- /dev/null +++ b/java-iam/proto-google-iam-v3/src/main/java/com/google/iam/v3/CreatePrincipalAccessBoundaryPolicyRequestOrBuilder.java @@ -0,0 +1,164 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/iam/v3/principal_access_boundary_policies_service.proto +// Protobuf Java Version: 4.33.2 + +package com.google.iam.v3; + +@com.google.protobuf.Generated +public interface CreatePrincipalAccessBoundaryPolicyRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.iam.v3.CreatePrincipalAccessBoundaryPolicyRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
        +   * Required. The parent resource where this principal access boundary policy
        +   * will be created. Only organizations are supported.
        +   *
        +   * Format:
        +   * `organizations/{organization_id}/locations/{location}`
        +   * 
        + * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + + /** + * + * + *
        +   * Required. The parent resource where this principal access boundary policy
        +   * will be created. Only organizations are supported.
        +   *
        +   * Format:
        +   * `organizations/{organization_id}/locations/{location}`
        +   * 
        + * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
        +   * Required. The ID to use for the principal access boundary policy, which
        +   * will become the final component of the principal access boundary policy's
        +   * resource name.
        +   *
        +   * This value must start with a lowercase letter followed by up to 62
        +   * lowercase letters, numbers, hyphens, or dots. Pattern,
        +   * /[a-z][a-z0-9-\.]{2,62}/.
        +   * 
        + * + * string principal_access_boundary_policy_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The principalAccessBoundaryPolicyId. + */ + java.lang.String getPrincipalAccessBoundaryPolicyId(); + + /** + * + * + *
        +   * Required. The ID to use for the principal access boundary policy, which
        +   * will become the final component of the principal access boundary policy's
        +   * resource name.
        +   *
        +   * This value must start with a lowercase letter followed by up to 62
        +   * lowercase letters, numbers, hyphens, or dots. Pattern,
        +   * /[a-z][a-z0-9-\.]{2,62}/.
        +   * 
        + * + * string principal_access_boundary_policy_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The bytes for principalAccessBoundaryPolicyId. + */ + com.google.protobuf.ByteString getPrincipalAccessBoundaryPolicyIdBytes(); + + /** + * + * + *
        +   * Required. The principal access boundary policy to create.
        +   * 
        + * + * + * .google.iam.v3.PrincipalAccessBoundaryPolicy principal_access_boundary_policy = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the principalAccessBoundaryPolicy field is set. + */ + boolean hasPrincipalAccessBoundaryPolicy(); + + /** + * + * + *
        +   * Required. The principal access boundary policy to create.
        +   * 
        + * + * + * .google.iam.v3.PrincipalAccessBoundaryPolicy principal_access_boundary_policy = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The principalAccessBoundaryPolicy. + */ + com.google.iam.v3.PrincipalAccessBoundaryPolicy getPrincipalAccessBoundaryPolicy(); + + /** + * + * + *
        +   * Required. The principal access boundary policy to create.
        +   * 
        + * + * + * .google.iam.v3.PrincipalAccessBoundaryPolicy principal_access_boundary_policy = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.iam.v3.PrincipalAccessBoundaryPolicyOrBuilder + getPrincipalAccessBoundaryPolicyOrBuilder(); + + /** + * + * + *
        +   * Optional. If set, validate the request and preview the creation, but do not
        +   * actually post it.
        +   * 
        + * + * bool validate_only = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The validateOnly. + */ + boolean getValidateOnly(); +} diff --git a/java-iam/proto-google-iam-v3/src/main/java/com/google/iam/v3/DeletePolicyBindingRequest.java b/java-iam/proto-google-iam-v3/src/main/java/com/google/iam/v3/DeletePolicyBindingRequest.java new file mode 100644 index 0000000000..0b9cd14a85 --- /dev/null +++ b/java-iam/proto-google-iam-v3/src/main/java/com/google/iam/v3/DeletePolicyBindingRequest.java @@ -0,0 +1,955 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/iam/v3/policy_bindings_service.proto +// Protobuf Java Version: 4.33.2 + +package com.google.iam.v3; + +/** + * + * + *
        + * Request message for DeletePolicyBinding method.
        + * 
        + * + * Protobuf type {@code google.iam.v3.DeletePolicyBindingRequest} + */ +@com.google.protobuf.Generated +public final class DeletePolicyBindingRequest extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.iam.v3.DeletePolicyBindingRequest) + DeletePolicyBindingRequestOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "DeletePolicyBindingRequest"); + } + + // Use DeletePolicyBindingRequest.newBuilder() to construct. + private DeletePolicyBindingRequest(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private DeletePolicyBindingRequest() { + name_ = ""; + etag_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.iam.v3.PolicyBindingsServiceProto + .internal_static_google_iam_v3_DeletePolicyBindingRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.iam.v3.PolicyBindingsServiceProto + .internal_static_google_iam_v3_DeletePolicyBindingRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.iam.v3.DeletePolicyBindingRequest.class, + com.google.iam.v3.DeletePolicyBindingRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + + /** + * + * + *
        +   * Required. The name of the policy binding to delete.
        +   *
        +   * Format:
        +   *
        +   * * `projects/{project_id}/locations/{location}/policyBindings/{policy_binding_id}`
        +   * * `projects/{project_number}/locations/{location}/policyBindings/{policy_binding_id}`
        +   * * `folders/{folder_id}/locations/{location}/policyBindings/{policy_binding_id}`
        +   * * `organizations/{organization_id}/locations/{location}/policyBindings/{policy_binding_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 name of the policy binding to delete.
        +   *
        +   * Format:
        +   *
        +   * * `projects/{project_id}/locations/{location}/policyBindings/{policy_binding_id}`
        +   * * `projects/{project_number}/locations/{location}/policyBindings/{policy_binding_id}`
        +   * * `folders/{folder_id}/locations/{location}/policyBindings/{policy_binding_id}`
        +   * * `organizations/{organization_id}/locations/{location}/policyBindings/{policy_binding_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; + } + } + + public static final int ETAG_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object etag_ = ""; + + /** + * + * + *
        +   * Optional. The etag of the policy binding.
        +   * If this is provided, it must match the server's etag.
        +   * 
        + * + * string etag = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The etag. + */ + @java.lang.Override + public java.lang.String getEtag() { + java.lang.Object ref = etag_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + etag_ = s; + return s; + } + } + + /** + * + * + *
        +   * Optional. The etag of the policy binding.
        +   * If this is provided, it must match the server's etag.
        +   * 
        + * + * string etag = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for etag. + */ + @java.lang.Override + public com.google.protobuf.ByteString getEtagBytes() { + java.lang.Object ref = etag_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + etag_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int VALIDATE_ONLY_FIELD_NUMBER = 3; + private boolean validateOnly_ = false; + + /** + * + * + *
        +   * Optional. If set, validate the request and preview the deletion, but do not
        +   * actually post it.
        +   * 
        + * + * bool validate_only = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The validateOnly. + */ + @java.lang.Override + public boolean getValidateOnly() { + return validateOnly_; + } + + 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.GeneratedMessage.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, name_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(etag_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, etag_); + } + if (validateOnly_ != false) { + output.writeBool(3, validateOnly_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, name_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(etag_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, etag_); + } + if (validateOnly_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(3, validateOnly_); + } + 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.iam.v3.DeletePolicyBindingRequest)) { + return super.equals(obj); + } + com.google.iam.v3.DeletePolicyBindingRequest other = + (com.google.iam.v3.DeletePolicyBindingRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (!getEtag().equals(other.getEtag())) return false; + if (getValidateOnly() != other.getValidateOnly()) 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) + ETAG_FIELD_NUMBER; + hash = (53 * hash) + getEtag().hashCode(); + hash = (37 * hash) + VALIDATE_ONLY_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getValidateOnly()); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.iam.v3.DeletePolicyBindingRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.iam.v3.DeletePolicyBindingRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.iam.v3.DeletePolicyBindingRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.iam.v3.DeletePolicyBindingRequest 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.iam.v3.DeletePolicyBindingRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.iam.v3.DeletePolicyBindingRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.iam.v3.DeletePolicyBindingRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.iam.v3.DeletePolicyBindingRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.iam.v3.DeletePolicyBindingRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.iam.v3.DeletePolicyBindingRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.iam.v3.DeletePolicyBindingRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.iam.v3.DeletePolicyBindingRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.iam.v3.DeletePolicyBindingRequest 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
        +   * Request message for DeletePolicyBinding method.
        +   * 
        + * + * Protobuf type {@code google.iam.v3.DeletePolicyBindingRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.iam.v3.DeletePolicyBindingRequest) + com.google.iam.v3.DeletePolicyBindingRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.iam.v3.PolicyBindingsServiceProto + .internal_static_google_iam_v3_DeletePolicyBindingRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.iam.v3.PolicyBindingsServiceProto + .internal_static_google_iam_v3_DeletePolicyBindingRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.iam.v3.DeletePolicyBindingRequest.class, + com.google.iam.v3.DeletePolicyBindingRequest.Builder.class); + } + + // Construct using com.google.iam.v3.DeletePolicyBindingRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + etag_ = ""; + validateOnly_ = false; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.iam.v3.PolicyBindingsServiceProto + .internal_static_google_iam_v3_DeletePolicyBindingRequest_descriptor; + } + + @java.lang.Override + public com.google.iam.v3.DeletePolicyBindingRequest getDefaultInstanceForType() { + return com.google.iam.v3.DeletePolicyBindingRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.iam.v3.DeletePolicyBindingRequest build() { + com.google.iam.v3.DeletePolicyBindingRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.iam.v3.DeletePolicyBindingRequest buildPartial() { + com.google.iam.v3.DeletePolicyBindingRequest result = + new com.google.iam.v3.DeletePolicyBindingRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.iam.v3.DeletePolicyBindingRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.etag_ = etag_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.validateOnly_ = validateOnly_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.iam.v3.DeletePolicyBindingRequest) { + return mergeFrom((com.google.iam.v3.DeletePolicyBindingRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.iam.v3.DeletePolicyBindingRequest other) { + if (other == com.google.iam.v3.DeletePolicyBindingRequest.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getEtag().isEmpty()) { + etag_ = other.etag_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (other.getValidateOnly() != false) { + setValidateOnly(other.getValidateOnly()); + } + 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: + { + etag_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 24: + { + validateOnly_ = 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 name_ = ""; + + /** + * + * + *
        +     * Required. The name of the policy binding to delete.
        +     *
        +     * Format:
        +     *
        +     * * `projects/{project_id}/locations/{location}/policyBindings/{policy_binding_id}`
        +     * * `projects/{project_number}/locations/{location}/policyBindings/{policy_binding_id}`
        +     * * `folders/{folder_id}/locations/{location}/policyBindings/{policy_binding_id}`
        +     * * `organizations/{organization_id}/locations/{location}/policyBindings/{policy_binding_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 name of the policy binding to delete.
        +     *
        +     * Format:
        +     *
        +     * * `projects/{project_id}/locations/{location}/policyBindings/{policy_binding_id}`
        +     * * `projects/{project_number}/locations/{location}/policyBindings/{policy_binding_id}`
        +     * * `folders/{folder_id}/locations/{location}/policyBindings/{policy_binding_id}`
        +     * * `organizations/{organization_id}/locations/{location}/policyBindings/{policy_binding_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 name of the policy binding to delete.
        +     *
        +     * Format:
        +     *
        +     * * `projects/{project_id}/locations/{location}/policyBindings/{policy_binding_id}`
        +     * * `projects/{project_number}/locations/{location}/policyBindings/{policy_binding_id}`
        +     * * `folders/{folder_id}/locations/{location}/policyBindings/{policy_binding_id}`
        +     * * `organizations/{organization_id}/locations/{location}/policyBindings/{policy_binding_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 name of the policy binding to delete.
        +     *
        +     * Format:
        +     *
        +     * * `projects/{project_id}/locations/{location}/policyBindings/{policy_binding_id}`
        +     * * `projects/{project_number}/locations/{location}/policyBindings/{policy_binding_id}`
        +     * * `folders/{folder_id}/locations/{location}/policyBindings/{policy_binding_id}`
        +     * * `organizations/{organization_id}/locations/{location}/policyBindings/{policy_binding_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 name of the policy binding to delete.
        +     *
        +     * Format:
        +     *
        +     * * `projects/{project_id}/locations/{location}/policyBindings/{policy_binding_id}`
        +     * * `projects/{project_number}/locations/{location}/policyBindings/{policy_binding_id}`
        +     * * `folders/{folder_id}/locations/{location}/policyBindings/{policy_binding_id}`
        +     * * `organizations/{organization_id}/locations/{location}/policyBindings/{policy_binding_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; + } + + private java.lang.Object etag_ = ""; + + /** + * + * + *
        +     * Optional. The etag of the policy binding.
        +     * If this is provided, it must match the server's etag.
        +     * 
        + * + * string etag = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The etag. + */ + public java.lang.String getEtag() { + java.lang.Object ref = etag_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + etag_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
        +     * Optional. The etag of the policy binding.
        +     * If this is provided, it must match the server's etag.
        +     * 
        + * + * string etag = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for etag. + */ + public com.google.protobuf.ByteString getEtagBytes() { + java.lang.Object ref = etag_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + etag_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
        +     * Optional. The etag of the policy binding.
        +     * If this is provided, it must match the server's etag.
        +     * 
        + * + * string etag = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The etag to set. + * @return This builder for chaining. + */ + public Builder setEtag(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + etag_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
        +     * Optional. The etag of the policy binding.
        +     * If this is provided, it must match the server's etag.
        +     * 
        + * + * string etag = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearEtag() { + etag_ = getDefaultInstance().getEtag(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
        +     * Optional. The etag of the policy binding.
        +     * If this is provided, it must match the server's etag.
        +     * 
        + * + * string etag = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for etag to set. + * @return This builder for chaining. + */ + public Builder setEtagBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + etag_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private boolean validateOnly_; + + /** + * + * + *
        +     * Optional. If set, validate the request and preview the deletion, but do not
        +     * actually post it.
        +     * 
        + * + * bool validate_only = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The validateOnly. + */ + @java.lang.Override + public boolean getValidateOnly() { + return validateOnly_; + } + + /** + * + * + *
        +     * Optional. If set, validate the request and preview the deletion, but do not
        +     * actually post it.
        +     * 
        + * + * bool validate_only = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The validateOnly to set. + * @return This builder for chaining. + */ + public Builder setValidateOnly(boolean value) { + + validateOnly_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
        +     * Optional. If set, validate the request and preview the deletion, but do not
        +     * actually post it.
        +     * 
        + * + * bool validate_only = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearValidateOnly() { + bitField0_ = (bitField0_ & ~0x00000004); + validateOnly_ = false; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.iam.v3.DeletePolicyBindingRequest) + } + + // @@protoc_insertion_point(class_scope:google.iam.v3.DeletePolicyBindingRequest) + private static final com.google.iam.v3.DeletePolicyBindingRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.iam.v3.DeletePolicyBindingRequest(); + } + + public static com.google.iam.v3.DeletePolicyBindingRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DeletePolicyBindingRequest 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.iam.v3.DeletePolicyBindingRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-iam/proto-google-iam-v3/src/main/java/com/google/iam/v3/DeletePolicyBindingRequestOrBuilder.java b/java-iam/proto-google-iam-v3/src/main/java/com/google/iam/v3/DeletePolicyBindingRequestOrBuilder.java new file mode 100644 index 0000000000..bb629d0996 --- /dev/null +++ b/java-iam/proto-google-iam-v3/src/main/java/com/google/iam/v3/DeletePolicyBindingRequestOrBuilder.java @@ -0,0 +1,114 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/iam/v3/policy_bindings_service.proto +// Protobuf Java Version: 4.33.2 + +package com.google.iam.v3; + +@com.google.protobuf.Generated +public interface DeletePolicyBindingRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.iam.v3.DeletePolicyBindingRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
        +   * Required. The name of the policy binding to delete.
        +   *
        +   * Format:
        +   *
        +   * * `projects/{project_id}/locations/{location}/policyBindings/{policy_binding_id}`
        +   * * `projects/{project_number}/locations/{location}/policyBindings/{policy_binding_id}`
        +   * * `folders/{folder_id}/locations/{location}/policyBindings/{policy_binding_id}`
        +   * * `organizations/{organization_id}/locations/{location}/policyBindings/{policy_binding_id}`
        +   * 
        + * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + + /** + * + * + *
        +   * Required. The name of the policy binding to delete.
        +   *
        +   * Format:
        +   *
        +   * * `projects/{project_id}/locations/{location}/policyBindings/{policy_binding_id}`
        +   * * `projects/{project_number}/locations/{location}/policyBindings/{policy_binding_id}`
        +   * * `folders/{folder_id}/locations/{location}/policyBindings/{policy_binding_id}`
        +   * * `organizations/{organization_id}/locations/{location}/policyBindings/{policy_binding_id}`
        +   * 
        + * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
        +   * Optional. The etag of the policy binding.
        +   * If this is provided, it must match the server's etag.
        +   * 
        + * + * string etag = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The etag. + */ + java.lang.String getEtag(); + + /** + * + * + *
        +   * Optional. The etag of the policy binding.
        +   * If this is provided, it must match the server's etag.
        +   * 
        + * + * string etag = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for etag. + */ + com.google.protobuf.ByteString getEtagBytes(); + + /** + * + * + *
        +   * Optional. If set, validate the request and preview the deletion, but do not
        +   * actually post it.
        +   * 
        + * + * bool validate_only = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The validateOnly. + */ + boolean getValidateOnly(); +} diff --git a/java-iam/proto-google-iam-v3/src/main/java/com/google/iam/v3/DeletePrincipalAccessBoundaryPolicyRequest.java b/java-iam/proto-google-iam-v3/src/main/java/com/google/iam/v3/DeletePrincipalAccessBoundaryPolicyRequest.java new file mode 100644 index 0000000000..3c7036a0ae --- /dev/null +++ b/java-iam/proto-google-iam-v3/src/main/java/com/google/iam/v3/DeletePrincipalAccessBoundaryPolicyRequest.java @@ -0,0 +1,1038 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/iam/v3/principal_access_boundary_policies_service.proto +// Protobuf Java Version: 4.33.2 + +package com.google.iam.v3; + +/** + * + * + *
        + * Request message for DeletePrincipalAccessBoundaryPolicy method.
        + * 
        + * + * Protobuf type {@code google.iam.v3.DeletePrincipalAccessBoundaryPolicyRequest} + */ +@com.google.protobuf.Generated +public final class DeletePrincipalAccessBoundaryPolicyRequest + extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.iam.v3.DeletePrincipalAccessBoundaryPolicyRequest) + DeletePrincipalAccessBoundaryPolicyRequestOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "DeletePrincipalAccessBoundaryPolicyRequest"); + } + + // Use DeletePrincipalAccessBoundaryPolicyRequest.newBuilder() to construct. + private DeletePrincipalAccessBoundaryPolicyRequest( + com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private DeletePrincipalAccessBoundaryPolicyRequest() { + name_ = ""; + etag_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.iam.v3.PrincipalAccessBoundaryPoliciesServiceProto + .internal_static_google_iam_v3_DeletePrincipalAccessBoundaryPolicyRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.iam.v3.PrincipalAccessBoundaryPoliciesServiceProto + .internal_static_google_iam_v3_DeletePrincipalAccessBoundaryPolicyRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.iam.v3.DeletePrincipalAccessBoundaryPolicyRequest.class, + com.google.iam.v3.DeletePrincipalAccessBoundaryPolicyRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + + /** + * + * + *
        +   * Required. The name of the principal access boundary policy to delete.
        +   *
        +   * Format:
        +   * `organizations/{organization_id}/locations/{location}/principalAccessBoundaryPolicies/{principal_access_boundary_policy_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 name of the principal access boundary policy to delete.
        +   *
        +   * Format:
        +   * `organizations/{organization_id}/locations/{location}/principalAccessBoundaryPolicies/{principal_access_boundary_policy_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; + } + } + + public static final int ETAG_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object etag_ = ""; + + /** + * + * + *
        +   * Optional. The etag of the principal access boundary policy.
        +   * If this is provided, it must match the server's etag.
        +   * 
        + * + * string etag = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The etag. + */ + @java.lang.Override + public java.lang.String getEtag() { + java.lang.Object ref = etag_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + etag_ = s; + return s; + } + } + + /** + * + * + *
        +   * Optional. The etag of the principal access boundary policy.
        +   * If this is provided, it must match the server's etag.
        +   * 
        + * + * string etag = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for etag. + */ + @java.lang.Override + public com.google.protobuf.ByteString getEtagBytes() { + java.lang.Object ref = etag_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + etag_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int VALIDATE_ONLY_FIELD_NUMBER = 3; + private boolean validateOnly_ = false; + + /** + * + * + *
        +   * Optional. If set, validate the request and preview the deletion, but do not
        +   * actually post it.
        +   * 
        + * + * bool validate_only = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The validateOnly. + */ + @java.lang.Override + public boolean getValidateOnly() { + return validateOnly_; + } + + public static final int FORCE_FIELD_NUMBER = 4; + private boolean force_ = false; + + /** + * + * + *
        +   * Optional. If set to true, the request will force the deletion of the policy
        +   * even if the policy is referenced in policy bindings.
        +   * 
        + * + * bool force = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The force. + */ + @java.lang.Override + public boolean getForce() { + return force_; + } + + 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.GeneratedMessage.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, name_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(etag_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, etag_); + } + if (validateOnly_ != false) { + output.writeBool(3, validateOnly_); + } + if (force_ != false) { + output.writeBool(4, force_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, name_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(etag_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, etag_); + } + if (validateOnly_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(3, validateOnly_); + } + if (force_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(4, force_); + } + 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.iam.v3.DeletePrincipalAccessBoundaryPolicyRequest)) { + return super.equals(obj); + } + com.google.iam.v3.DeletePrincipalAccessBoundaryPolicyRequest other = + (com.google.iam.v3.DeletePrincipalAccessBoundaryPolicyRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (!getEtag().equals(other.getEtag())) return false; + if (getValidateOnly() != other.getValidateOnly()) return false; + if (getForce() != other.getForce()) 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) + ETAG_FIELD_NUMBER; + hash = (53 * hash) + getEtag().hashCode(); + hash = (37 * hash) + VALIDATE_ONLY_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getValidateOnly()); + hash = (37 * hash) + FORCE_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getForce()); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.iam.v3.DeletePrincipalAccessBoundaryPolicyRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.iam.v3.DeletePrincipalAccessBoundaryPolicyRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.iam.v3.DeletePrincipalAccessBoundaryPolicyRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.iam.v3.DeletePrincipalAccessBoundaryPolicyRequest 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.iam.v3.DeletePrincipalAccessBoundaryPolicyRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.iam.v3.DeletePrincipalAccessBoundaryPolicyRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.iam.v3.DeletePrincipalAccessBoundaryPolicyRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.iam.v3.DeletePrincipalAccessBoundaryPolicyRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.iam.v3.DeletePrincipalAccessBoundaryPolicyRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.iam.v3.DeletePrincipalAccessBoundaryPolicyRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.iam.v3.DeletePrincipalAccessBoundaryPolicyRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.iam.v3.DeletePrincipalAccessBoundaryPolicyRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.iam.v3.DeletePrincipalAccessBoundaryPolicyRequest 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
        +   * Request message for DeletePrincipalAccessBoundaryPolicy method.
        +   * 
        + * + * Protobuf type {@code google.iam.v3.DeletePrincipalAccessBoundaryPolicyRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.iam.v3.DeletePrincipalAccessBoundaryPolicyRequest) + com.google.iam.v3.DeletePrincipalAccessBoundaryPolicyRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.iam.v3.PrincipalAccessBoundaryPoliciesServiceProto + .internal_static_google_iam_v3_DeletePrincipalAccessBoundaryPolicyRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.iam.v3.PrincipalAccessBoundaryPoliciesServiceProto + .internal_static_google_iam_v3_DeletePrincipalAccessBoundaryPolicyRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.iam.v3.DeletePrincipalAccessBoundaryPolicyRequest.class, + com.google.iam.v3.DeletePrincipalAccessBoundaryPolicyRequest.Builder.class); + } + + // Construct using com.google.iam.v3.DeletePrincipalAccessBoundaryPolicyRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + etag_ = ""; + validateOnly_ = false; + force_ = false; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.iam.v3.PrincipalAccessBoundaryPoliciesServiceProto + .internal_static_google_iam_v3_DeletePrincipalAccessBoundaryPolicyRequest_descriptor; + } + + @java.lang.Override + public com.google.iam.v3.DeletePrincipalAccessBoundaryPolicyRequest + getDefaultInstanceForType() { + return com.google.iam.v3.DeletePrincipalAccessBoundaryPolicyRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.iam.v3.DeletePrincipalAccessBoundaryPolicyRequest build() { + com.google.iam.v3.DeletePrincipalAccessBoundaryPolicyRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.iam.v3.DeletePrincipalAccessBoundaryPolicyRequest buildPartial() { + com.google.iam.v3.DeletePrincipalAccessBoundaryPolicyRequest result = + new com.google.iam.v3.DeletePrincipalAccessBoundaryPolicyRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.iam.v3.DeletePrincipalAccessBoundaryPolicyRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.etag_ = etag_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.validateOnly_ = validateOnly_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.force_ = force_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.iam.v3.DeletePrincipalAccessBoundaryPolicyRequest) { + return mergeFrom((com.google.iam.v3.DeletePrincipalAccessBoundaryPolicyRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.iam.v3.DeletePrincipalAccessBoundaryPolicyRequest other) { + if (other + == com.google.iam.v3.DeletePrincipalAccessBoundaryPolicyRequest.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getEtag().isEmpty()) { + etag_ = other.etag_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (other.getValidateOnly() != false) { + setValidateOnly(other.getValidateOnly()); + } + if (other.getForce() != false) { + setForce(other.getForce()); + } + 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: + { + etag_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 24: + { + validateOnly_ = input.readBool(); + bitField0_ |= 0x00000004; + break; + } // case 24 + case 32: + { + force_ = 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 name_ = ""; + + /** + * + * + *
        +     * Required. The name of the principal access boundary policy to delete.
        +     *
        +     * Format:
        +     * `organizations/{organization_id}/locations/{location}/principalAccessBoundaryPolicies/{principal_access_boundary_policy_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 name of the principal access boundary policy to delete.
        +     *
        +     * Format:
        +     * `organizations/{organization_id}/locations/{location}/principalAccessBoundaryPolicies/{principal_access_boundary_policy_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 name of the principal access boundary policy to delete.
        +     *
        +     * Format:
        +     * `organizations/{organization_id}/locations/{location}/principalAccessBoundaryPolicies/{principal_access_boundary_policy_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 name of the principal access boundary policy to delete.
        +     *
        +     * Format:
        +     * `organizations/{organization_id}/locations/{location}/principalAccessBoundaryPolicies/{principal_access_boundary_policy_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 name of the principal access boundary policy to delete.
        +     *
        +     * Format:
        +     * `organizations/{organization_id}/locations/{location}/principalAccessBoundaryPolicies/{principal_access_boundary_policy_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; + } + + private java.lang.Object etag_ = ""; + + /** + * + * + *
        +     * Optional. The etag of the principal access boundary policy.
        +     * If this is provided, it must match the server's etag.
        +     * 
        + * + * string etag = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The etag. + */ + public java.lang.String getEtag() { + java.lang.Object ref = etag_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + etag_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
        +     * Optional. The etag of the principal access boundary policy.
        +     * If this is provided, it must match the server's etag.
        +     * 
        + * + * string etag = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for etag. + */ + public com.google.protobuf.ByteString getEtagBytes() { + java.lang.Object ref = etag_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + etag_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
        +     * Optional. The etag of the principal access boundary policy.
        +     * If this is provided, it must match the server's etag.
        +     * 
        + * + * string etag = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The etag to set. + * @return This builder for chaining. + */ + public Builder setEtag(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + etag_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
        +     * Optional. The etag of the principal access boundary policy.
        +     * If this is provided, it must match the server's etag.
        +     * 
        + * + * string etag = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearEtag() { + etag_ = getDefaultInstance().getEtag(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
        +     * Optional. The etag of the principal access boundary policy.
        +     * If this is provided, it must match the server's etag.
        +     * 
        + * + * string etag = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for etag to set. + * @return This builder for chaining. + */ + public Builder setEtagBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + etag_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private boolean validateOnly_; + + /** + * + * + *
        +     * Optional. If set, validate the request and preview the deletion, but do not
        +     * actually post it.
        +     * 
        + * + * bool validate_only = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The validateOnly. + */ + @java.lang.Override + public boolean getValidateOnly() { + return validateOnly_; + } + + /** + * + * + *
        +     * Optional. If set, validate the request and preview the deletion, but do not
        +     * actually post it.
        +     * 
        + * + * bool validate_only = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The validateOnly to set. + * @return This builder for chaining. + */ + public Builder setValidateOnly(boolean value) { + + validateOnly_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
        +     * Optional. If set, validate the request and preview the deletion, but do not
        +     * actually post it.
        +     * 
        + * + * bool validate_only = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearValidateOnly() { + bitField0_ = (bitField0_ & ~0x00000004); + validateOnly_ = false; + onChanged(); + return this; + } + + private boolean force_; + + /** + * + * + *
        +     * Optional. If set to true, the request will force the deletion of the policy
        +     * even if the policy is referenced in policy bindings.
        +     * 
        + * + * bool force = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The force. + */ + @java.lang.Override + public boolean getForce() { + return force_; + } + + /** + * + * + *
        +     * Optional. If set to true, the request will force the deletion of the policy
        +     * even if the policy is referenced in policy bindings.
        +     * 
        + * + * bool force = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The force to set. + * @return This builder for chaining. + */ + public Builder setForce(boolean value) { + + force_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + /** + * + * + *
        +     * Optional. If set to true, the request will force the deletion of the policy
        +     * even if the policy is referenced in policy bindings.
        +     * 
        + * + * bool force = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearForce() { + bitField0_ = (bitField0_ & ~0x00000008); + force_ = false; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.iam.v3.DeletePrincipalAccessBoundaryPolicyRequest) + } + + // @@protoc_insertion_point(class_scope:google.iam.v3.DeletePrincipalAccessBoundaryPolicyRequest) + private static final com.google.iam.v3.DeletePrincipalAccessBoundaryPolicyRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.iam.v3.DeletePrincipalAccessBoundaryPolicyRequest(); + } + + public static com.google.iam.v3.DeletePrincipalAccessBoundaryPolicyRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DeletePrincipalAccessBoundaryPolicyRequest 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.iam.v3.DeletePrincipalAccessBoundaryPolicyRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-iam/proto-google-iam-v3/src/main/java/com/google/iam/v3/DeletePrincipalAccessBoundaryPolicyRequestOrBuilder.java b/java-iam/proto-google-iam-v3/src/main/java/com/google/iam/v3/DeletePrincipalAccessBoundaryPolicyRequestOrBuilder.java new file mode 100644 index 0000000000..7f89d5b69f --- /dev/null +++ b/java-iam/proto-google-iam-v3/src/main/java/com/google/iam/v3/DeletePrincipalAccessBoundaryPolicyRequestOrBuilder.java @@ -0,0 +1,120 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/iam/v3/principal_access_boundary_policies_service.proto +// Protobuf Java Version: 4.33.2 + +package com.google.iam.v3; + +@com.google.protobuf.Generated +public interface DeletePrincipalAccessBoundaryPolicyRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.iam.v3.DeletePrincipalAccessBoundaryPolicyRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
        +   * Required. The name of the principal access boundary policy to delete.
        +   *
        +   * Format:
        +   * `organizations/{organization_id}/locations/{location}/principalAccessBoundaryPolicies/{principal_access_boundary_policy_id}`
        +   * 
        + * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + + /** + * + * + *
        +   * Required. The name of the principal access boundary policy to delete.
        +   *
        +   * Format:
        +   * `organizations/{organization_id}/locations/{location}/principalAccessBoundaryPolicies/{principal_access_boundary_policy_id}`
        +   * 
        + * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
        +   * Optional. The etag of the principal access boundary policy.
        +   * If this is provided, it must match the server's etag.
        +   * 
        + * + * string etag = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The etag. + */ + java.lang.String getEtag(); + + /** + * + * + *
        +   * Optional. The etag of the principal access boundary policy.
        +   * If this is provided, it must match the server's etag.
        +   * 
        + * + * string etag = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for etag. + */ + com.google.protobuf.ByteString getEtagBytes(); + + /** + * + * + *
        +   * Optional. If set, validate the request and preview the deletion, but do not
        +   * actually post it.
        +   * 
        + * + * bool validate_only = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The validateOnly. + */ + boolean getValidateOnly(); + + /** + * + * + *
        +   * Optional. If set to true, the request will force the deletion of the policy
        +   * even if the policy is referenced in policy bindings.
        +   * 
        + * + * bool force = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The force. + */ + boolean getForce(); +} diff --git a/java-iam/proto-google-iam-v3/src/main/java/com/google/iam/v3/FolderLocationName.java b/java-iam/proto-google-iam-v3/src/main/java/com/google/iam/v3/FolderLocationName.java new file mode 100644 index 0000000000..6d7ef2b639 --- /dev/null +++ b/java-iam/proto-google-iam-v3/src/main/java/com/google/iam/v3/FolderLocationName.java @@ -0,0 +1,192 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.iam.v3; + +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-iam/proto-google-iam-v3/src/main/java/com/google/iam/v3/GetPolicyBindingRequest.java b/java-iam/proto-google-iam-v3/src/main/java/com/google/iam/v3/GetPolicyBindingRequest.java new file mode 100644 index 0000000000..fb44f096ba --- /dev/null +++ b/java-iam/proto-google-iam-v3/src/main/java/com/google/iam/v3/GetPolicyBindingRequest.java @@ -0,0 +1,658 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/iam/v3/policy_bindings_service.proto +// Protobuf Java Version: 4.33.2 + +package com.google.iam.v3; + +/** + * + * + *
        + * Request message for GetPolicyBinding method.
        + * 
        + * + * Protobuf type {@code google.iam.v3.GetPolicyBindingRequest} + */ +@com.google.protobuf.Generated +public final class GetPolicyBindingRequest extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.iam.v3.GetPolicyBindingRequest) + GetPolicyBindingRequestOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "GetPolicyBindingRequest"); + } + + // Use GetPolicyBindingRequest.newBuilder() to construct. + private GetPolicyBindingRequest(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private GetPolicyBindingRequest() { + name_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.iam.v3.PolicyBindingsServiceProto + .internal_static_google_iam_v3_GetPolicyBindingRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.iam.v3.PolicyBindingsServiceProto + .internal_static_google_iam_v3_GetPolicyBindingRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.iam.v3.GetPolicyBindingRequest.class, + com.google.iam.v3.GetPolicyBindingRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + + /** + * + * + *
        +   * Required. The name of the policy binding to retrieve.
        +   *
        +   * Format:
        +   *
        +   * * `projects/{project_id}/locations/{location}/policyBindings/{policy_binding_id}`
        +   * * `projects/{project_number}/locations/{location}/policyBindings/{policy_binding_id}`
        +   * * `folders/{folder_id}/locations/{location}/policyBindings/{policy_binding_id}`
        +   * * `organizations/{organization_id}/locations/{location}/policyBindings/{policy_binding_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 name of the policy binding to retrieve.
        +   *
        +   * Format:
        +   *
        +   * * `projects/{project_id}/locations/{location}/policyBindings/{policy_binding_id}`
        +   * * `projects/{project_number}/locations/{location}/policyBindings/{policy_binding_id}`
        +   * * `folders/{folder_id}/locations/{location}/policyBindings/{policy_binding_id}`
        +   * * `organizations/{organization_id}/locations/{location}/policyBindings/{policy_binding_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.GeneratedMessage.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessage.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.GeneratedMessage.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessage.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.iam.v3.GetPolicyBindingRequest)) { + return super.equals(obj); + } + com.google.iam.v3.GetPolicyBindingRequest other = + (com.google.iam.v3.GetPolicyBindingRequest) 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.iam.v3.GetPolicyBindingRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.iam.v3.GetPolicyBindingRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.iam.v3.GetPolicyBindingRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.iam.v3.GetPolicyBindingRequest 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.iam.v3.GetPolicyBindingRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.iam.v3.GetPolicyBindingRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.iam.v3.GetPolicyBindingRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.iam.v3.GetPolicyBindingRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.iam.v3.GetPolicyBindingRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.iam.v3.GetPolicyBindingRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.iam.v3.GetPolicyBindingRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.iam.v3.GetPolicyBindingRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.iam.v3.GetPolicyBindingRequest 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
        +   * Request message for GetPolicyBinding method.
        +   * 
        + * + * Protobuf type {@code google.iam.v3.GetPolicyBindingRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.iam.v3.GetPolicyBindingRequest) + com.google.iam.v3.GetPolicyBindingRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.iam.v3.PolicyBindingsServiceProto + .internal_static_google_iam_v3_GetPolicyBindingRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.iam.v3.PolicyBindingsServiceProto + .internal_static_google_iam_v3_GetPolicyBindingRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.iam.v3.GetPolicyBindingRequest.class, + com.google.iam.v3.GetPolicyBindingRequest.Builder.class); + } + + // Construct using com.google.iam.v3.GetPolicyBindingRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.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.iam.v3.PolicyBindingsServiceProto + .internal_static_google_iam_v3_GetPolicyBindingRequest_descriptor; + } + + @java.lang.Override + public com.google.iam.v3.GetPolicyBindingRequest getDefaultInstanceForType() { + return com.google.iam.v3.GetPolicyBindingRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.iam.v3.GetPolicyBindingRequest build() { + com.google.iam.v3.GetPolicyBindingRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.iam.v3.GetPolicyBindingRequest buildPartial() { + com.google.iam.v3.GetPolicyBindingRequest result = + new com.google.iam.v3.GetPolicyBindingRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.iam.v3.GetPolicyBindingRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.iam.v3.GetPolicyBindingRequest) { + return mergeFrom((com.google.iam.v3.GetPolicyBindingRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.iam.v3.GetPolicyBindingRequest other) { + if (other == com.google.iam.v3.GetPolicyBindingRequest.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 name of the policy binding to retrieve.
        +     *
        +     * Format:
        +     *
        +     * * `projects/{project_id}/locations/{location}/policyBindings/{policy_binding_id}`
        +     * * `projects/{project_number}/locations/{location}/policyBindings/{policy_binding_id}`
        +     * * `folders/{folder_id}/locations/{location}/policyBindings/{policy_binding_id}`
        +     * * `organizations/{organization_id}/locations/{location}/policyBindings/{policy_binding_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 name of the policy binding to retrieve.
        +     *
        +     * Format:
        +     *
        +     * * `projects/{project_id}/locations/{location}/policyBindings/{policy_binding_id}`
        +     * * `projects/{project_number}/locations/{location}/policyBindings/{policy_binding_id}`
        +     * * `folders/{folder_id}/locations/{location}/policyBindings/{policy_binding_id}`
        +     * * `organizations/{organization_id}/locations/{location}/policyBindings/{policy_binding_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 name of the policy binding to retrieve.
        +     *
        +     * Format:
        +     *
        +     * * `projects/{project_id}/locations/{location}/policyBindings/{policy_binding_id}`
        +     * * `projects/{project_number}/locations/{location}/policyBindings/{policy_binding_id}`
        +     * * `folders/{folder_id}/locations/{location}/policyBindings/{policy_binding_id}`
        +     * * `organizations/{organization_id}/locations/{location}/policyBindings/{policy_binding_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 name of the policy binding to retrieve.
        +     *
        +     * Format:
        +     *
        +     * * `projects/{project_id}/locations/{location}/policyBindings/{policy_binding_id}`
        +     * * `projects/{project_number}/locations/{location}/policyBindings/{policy_binding_id}`
        +     * * `folders/{folder_id}/locations/{location}/policyBindings/{policy_binding_id}`
        +     * * `organizations/{organization_id}/locations/{location}/policyBindings/{policy_binding_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 name of the policy binding to retrieve.
        +     *
        +     * Format:
        +     *
        +     * * `projects/{project_id}/locations/{location}/policyBindings/{policy_binding_id}`
        +     * * `projects/{project_number}/locations/{location}/policyBindings/{policy_binding_id}`
        +     * * `folders/{folder_id}/locations/{location}/policyBindings/{policy_binding_id}`
        +     * * `organizations/{organization_id}/locations/{location}/policyBindings/{policy_binding_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; + } + + // @@protoc_insertion_point(builder_scope:google.iam.v3.GetPolicyBindingRequest) + } + + // @@protoc_insertion_point(class_scope:google.iam.v3.GetPolicyBindingRequest) + private static final com.google.iam.v3.GetPolicyBindingRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.iam.v3.GetPolicyBindingRequest(); + } + + public static com.google.iam.v3.GetPolicyBindingRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GetPolicyBindingRequest 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.iam.v3.GetPolicyBindingRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-iam/proto-google-iam-v3/src/main/java/com/google/iam/v3/GetPolicyBindingRequestOrBuilder.java b/java-iam/proto-google-iam-v3/src/main/java/com/google/iam/v3/GetPolicyBindingRequestOrBuilder.java new file mode 100644 index 0000000000..2b28872f9b --- /dev/null +++ b/java-iam/proto-google-iam-v3/src/main/java/com/google/iam/v3/GetPolicyBindingRequestOrBuilder.java @@ -0,0 +1,72 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/iam/v3/policy_bindings_service.proto +// Protobuf Java Version: 4.33.2 + +package com.google.iam.v3; + +@com.google.protobuf.Generated +public interface GetPolicyBindingRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.iam.v3.GetPolicyBindingRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
        +   * Required. The name of the policy binding to retrieve.
        +   *
        +   * Format:
        +   *
        +   * * `projects/{project_id}/locations/{location}/policyBindings/{policy_binding_id}`
        +   * * `projects/{project_number}/locations/{location}/policyBindings/{policy_binding_id}`
        +   * * `folders/{folder_id}/locations/{location}/policyBindings/{policy_binding_id}`
        +   * * `organizations/{organization_id}/locations/{location}/policyBindings/{policy_binding_id}`
        +   * 
        + * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + + /** + * + * + *
        +   * Required. The name of the policy binding to retrieve.
        +   *
        +   * Format:
        +   *
        +   * * `projects/{project_id}/locations/{location}/policyBindings/{policy_binding_id}`
        +   * * `projects/{project_number}/locations/{location}/policyBindings/{policy_binding_id}`
        +   * * `folders/{folder_id}/locations/{location}/policyBindings/{policy_binding_id}`
        +   * * `organizations/{organization_id}/locations/{location}/policyBindings/{policy_binding_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-iam/proto-google-iam-v3/src/main/java/com/google/iam/v3/GetPrincipalAccessBoundaryPolicyRequest.java b/java-iam/proto-google-iam-v3/src/main/java/com/google/iam/v3/GetPrincipalAccessBoundaryPolicyRequest.java new file mode 100644 index 0000000000..e124bbf441 --- /dev/null +++ b/java-iam/proto-google-iam-v3/src/main/java/com/google/iam/v3/GetPrincipalAccessBoundaryPolicyRequest.java @@ -0,0 +1,634 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/iam/v3/principal_access_boundary_policies_service.proto +// Protobuf Java Version: 4.33.2 + +package com.google.iam.v3; + +/** + * + * + *
        + * Request message for GetPrincipalAccessBoundaryPolicy method.
        + * 
        + * + * Protobuf type {@code google.iam.v3.GetPrincipalAccessBoundaryPolicyRequest} + */ +@com.google.protobuf.Generated +public final class GetPrincipalAccessBoundaryPolicyRequest + extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.iam.v3.GetPrincipalAccessBoundaryPolicyRequest) + GetPrincipalAccessBoundaryPolicyRequestOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "GetPrincipalAccessBoundaryPolicyRequest"); + } + + // Use GetPrincipalAccessBoundaryPolicyRequest.newBuilder() to construct. + private GetPrincipalAccessBoundaryPolicyRequest( + com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private GetPrincipalAccessBoundaryPolicyRequest() { + name_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.iam.v3.PrincipalAccessBoundaryPoliciesServiceProto + .internal_static_google_iam_v3_GetPrincipalAccessBoundaryPolicyRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.iam.v3.PrincipalAccessBoundaryPoliciesServiceProto + .internal_static_google_iam_v3_GetPrincipalAccessBoundaryPolicyRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.iam.v3.GetPrincipalAccessBoundaryPolicyRequest.class, + com.google.iam.v3.GetPrincipalAccessBoundaryPolicyRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + + /** + * + * + *
        +   * Required. The name of the principal access boundary policy to retrieve.
        +   *
        +   * Format:
        +   * `organizations/{organization_id}/locations/{location}/principalAccessBoundaryPolicies/{principal_access_boundary_policy_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 name of the principal access boundary policy to retrieve.
        +   *
        +   * Format:
        +   * `organizations/{organization_id}/locations/{location}/principalAccessBoundaryPolicies/{principal_access_boundary_policy_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.GeneratedMessage.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessage.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.GeneratedMessage.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessage.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.iam.v3.GetPrincipalAccessBoundaryPolicyRequest)) { + return super.equals(obj); + } + com.google.iam.v3.GetPrincipalAccessBoundaryPolicyRequest other = + (com.google.iam.v3.GetPrincipalAccessBoundaryPolicyRequest) 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.iam.v3.GetPrincipalAccessBoundaryPolicyRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.iam.v3.GetPrincipalAccessBoundaryPolicyRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.iam.v3.GetPrincipalAccessBoundaryPolicyRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.iam.v3.GetPrincipalAccessBoundaryPolicyRequest 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.iam.v3.GetPrincipalAccessBoundaryPolicyRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.iam.v3.GetPrincipalAccessBoundaryPolicyRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.iam.v3.GetPrincipalAccessBoundaryPolicyRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.iam.v3.GetPrincipalAccessBoundaryPolicyRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.iam.v3.GetPrincipalAccessBoundaryPolicyRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.iam.v3.GetPrincipalAccessBoundaryPolicyRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.iam.v3.GetPrincipalAccessBoundaryPolicyRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.iam.v3.GetPrincipalAccessBoundaryPolicyRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.iam.v3.GetPrincipalAccessBoundaryPolicyRequest 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
        +   * Request message for GetPrincipalAccessBoundaryPolicy method.
        +   * 
        + * + * Protobuf type {@code google.iam.v3.GetPrincipalAccessBoundaryPolicyRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.iam.v3.GetPrincipalAccessBoundaryPolicyRequest) + com.google.iam.v3.GetPrincipalAccessBoundaryPolicyRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.iam.v3.PrincipalAccessBoundaryPoliciesServiceProto + .internal_static_google_iam_v3_GetPrincipalAccessBoundaryPolicyRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.iam.v3.PrincipalAccessBoundaryPoliciesServiceProto + .internal_static_google_iam_v3_GetPrincipalAccessBoundaryPolicyRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.iam.v3.GetPrincipalAccessBoundaryPolicyRequest.class, + com.google.iam.v3.GetPrincipalAccessBoundaryPolicyRequest.Builder.class); + } + + // Construct using com.google.iam.v3.GetPrincipalAccessBoundaryPolicyRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.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.iam.v3.PrincipalAccessBoundaryPoliciesServiceProto + .internal_static_google_iam_v3_GetPrincipalAccessBoundaryPolicyRequest_descriptor; + } + + @java.lang.Override + public com.google.iam.v3.GetPrincipalAccessBoundaryPolicyRequest getDefaultInstanceForType() { + return com.google.iam.v3.GetPrincipalAccessBoundaryPolicyRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.iam.v3.GetPrincipalAccessBoundaryPolicyRequest build() { + com.google.iam.v3.GetPrincipalAccessBoundaryPolicyRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.iam.v3.GetPrincipalAccessBoundaryPolicyRequest buildPartial() { + com.google.iam.v3.GetPrincipalAccessBoundaryPolicyRequest result = + new com.google.iam.v3.GetPrincipalAccessBoundaryPolicyRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.iam.v3.GetPrincipalAccessBoundaryPolicyRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.iam.v3.GetPrincipalAccessBoundaryPolicyRequest) { + return mergeFrom((com.google.iam.v3.GetPrincipalAccessBoundaryPolicyRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.iam.v3.GetPrincipalAccessBoundaryPolicyRequest other) { + if (other == com.google.iam.v3.GetPrincipalAccessBoundaryPolicyRequest.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 name of the principal access boundary policy to retrieve.
        +     *
        +     * Format:
        +     * `organizations/{organization_id}/locations/{location}/principalAccessBoundaryPolicies/{principal_access_boundary_policy_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 name of the principal access boundary policy to retrieve.
        +     *
        +     * Format:
        +     * `organizations/{organization_id}/locations/{location}/principalAccessBoundaryPolicies/{principal_access_boundary_policy_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 name of the principal access boundary policy to retrieve.
        +     *
        +     * Format:
        +     * `organizations/{organization_id}/locations/{location}/principalAccessBoundaryPolicies/{principal_access_boundary_policy_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 name of the principal access boundary policy to retrieve.
        +     *
        +     * Format:
        +     * `organizations/{organization_id}/locations/{location}/principalAccessBoundaryPolicies/{principal_access_boundary_policy_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 name of the principal access boundary policy to retrieve.
        +     *
        +     * Format:
        +     * `organizations/{organization_id}/locations/{location}/principalAccessBoundaryPolicies/{principal_access_boundary_policy_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; + } + + // @@protoc_insertion_point(builder_scope:google.iam.v3.GetPrincipalAccessBoundaryPolicyRequest) + } + + // @@protoc_insertion_point(class_scope:google.iam.v3.GetPrincipalAccessBoundaryPolicyRequest) + private static final com.google.iam.v3.GetPrincipalAccessBoundaryPolicyRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.iam.v3.GetPrincipalAccessBoundaryPolicyRequest(); + } + + public static com.google.iam.v3.GetPrincipalAccessBoundaryPolicyRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GetPrincipalAccessBoundaryPolicyRequest 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.iam.v3.GetPrincipalAccessBoundaryPolicyRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-iam/proto-google-iam-v3/src/main/java/com/google/iam/v3/GetPrincipalAccessBoundaryPolicyRequestOrBuilder.java b/java-iam/proto-google-iam-v3/src/main/java/com/google/iam/v3/GetPrincipalAccessBoundaryPolicyRequestOrBuilder.java new file mode 100644 index 0000000000..2ecc1da78e --- /dev/null +++ b/java-iam/proto-google-iam-v3/src/main/java/com/google/iam/v3/GetPrincipalAccessBoundaryPolicyRequestOrBuilder.java @@ -0,0 +1,64 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/iam/v3/principal_access_boundary_policies_service.proto +// Protobuf Java Version: 4.33.2 + +package com.google.iam.v3; + +@com.google.protobuf.Generated +public interface GetPrincipalAccessBoundaryPolicyRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.iam.v3.GetPrincipalAccessBoundaryPolicyRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
        +   * Required. The name of the principal access boundary policy to retrieve.
        +   *
        +   * Format:
        +   * `organizations/{organization_id}/locations/{location}/principalAccessBoundaryPolicies/{principal_access_boundary_policy_id}`
        +   * 
        + * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + + /** + * + * + *
        +   * Required. The name of the principal access boundary policy to retrieve.
        +   *
        +   * Format:
        +   * `organizations/{organization_id}/locations/{location}/principalAccessBoundaryPolicies/{principal_access_boundary_policy_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-iam/proto-google-iam-v3/src/main/java/com/google/iam/v3/ListPolicyBindingsRequest.java b/java-iam/proto-google-iam-v3/src/main/java/com/google/iam/v3/ListPolicyBindingsRequest.java new file mode 100644 index 0000000000..86ed9efc8a --- /dev/null +++ b/java-iam/proto-google-iam-v3/src/main/java/com/google/iam/v3/ListPolicyBindingsRequest.java @@ -0,0 +1,1254 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/iam/v3/policy_bindings_service.proto +// Protobuf Java Version: 4.33.2 + +package com.google.iam.v3; + +/** + * + * + *
        + * Request message for ListPolicyBindings method.
        + * 
        + * + * Protobuf type {@code google.iam.v3.ListPolicyBindingsRequest} + */ +@com.google.protobuf.Generated +public final class ListPolicyBindingsRequest extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.iam.v3.ListPolicyBindingsRequest) + ListPolicyBindingsRequestOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "ListPolicyBindingsRequest"); + } + + // Use ListPolicyBindingsRequest.newBuilder() to construct. + private ListPolicyBindingsRequest(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private ListPolicyBindingsRequest() { + parent_ = ""; + pageToken_ = ""; + filter_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.iam.v3.PolicyBindingsServiceProto + .internal_static_google_iam_v3_ListPolicyBindingsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.iam.v3.PolicyBindingsServiceProto + .internal_static_google_iam_v3_ListPolicyBindingsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.iam.v3.ListPolicyBindingsRequest.class, + com.google.iam.v3.ListPolicyBindingsRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object parent_ = ""; + + /** + * + * + *
        +   * Required. The parent resource, which owns the collection of policy
        +   * bindings.
        +   *
        +   * Format:
        +   *
        +   * * `projects/{project_id}/locations/{location}`
        +   * * `projects/{project_number}/locations/{location}`
        +   * * `folders/{folder_id}/locations/{location}`
        +   * * `organizations/{organization_id}/locations/{location}`
        +   * 
        + * + * + * 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, which owns the collection of policy
        +   * bindings.
        +   *
        +   * Format:
        +   *
        +   * * `projects/{project_id}/locations/{location}`
        +   * * `projects/{project_number}/locations/{location}`
        +   * * `folders/{folder_id}/locations/{location}`
        +   * * `organizations/{organization_id}/locations/{location}`
        +   * 
        + * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + @java.lang.Override + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PAGE_SIZE_FIELD_NUMBER = 2; + private int pageSize_ = 0; + + /** + * + * + *
        +   * Optional. The maximum number of policy bindings to return. The service may
        +   * return fewer than this value.
        +   *
        +   * If unspecified, at most 50 policy bindings will be returned.
        +   * The maximum value is 1000; values above 1000 will be coerced to 1000.
        +   * 
        + * + * 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. A page token, received from a previous `ListPolicyBindings` call.
        +   * Provide this to retrieve the subsequent page.
        +   *
        +   * When paginating, all other parameters provided to `ListPolicyBindings` must
        +   * match the call that provided the page token.
        +   * 
        + * + * 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. A page token, received from a previous `ListPolicyBindings` call.
        +   * Provide this to retrieve the subsequent page.
        +   *
        +   * When paginating, all other parameters provided to `ListPolicyBindings` must
        +   * match the call that provided the page token.
        +   * 
        + * + * 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; + } + } + + public static final int FILTER_FIELD_NUMBER = 4; + + @SuppressWarnings("serial") + private volatile java.lang.Object filter_ = ""; + + /** + * + * + *
        +   * Optional. An expression for filtering the results of the request. Filter
        +   * rules are case insensitive. Some eligible fields for filtering are:
        +   *
        +   * + `target`
        +   * + `policy`
        +   *
        +   * Some examples of filter queries:
        +   *
        +   * * `target:ex*`: The binding target's name starts with "ex".
        +   * * `target:example`: The binding target's name is `example`.
        +   * * `policy:example`: The binding policy's name is `example`.
        +   * 
        + * + * string filter = 4 [(.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 expression for filtering the results of the request. Filter
        +   * rules are case insensitive. Some eligible fields for filtering are:
        +   *
        +   * + `target`
        +   * + `policy`
        +   *
        +   * Some examples of filter queries:
        +   *
        +   * * `target:ex*`: The binding target's name starts with "ex".
        +   * * `target:example`: The binding target's name is `example`.
        +   * * `policy:example`: The binding policy's name is `example`.
        +   * 
        + * + * string filter = 4 [(.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; + } + } + + 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.GeneratedMessage.isStringEmpty(parent_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, parent_); + } + if (pageSize_ != 0) { + output.writeInt32(2, pageSize_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(pageToken_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 3, pageToken_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(filter_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 4, filter_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(parent_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, parent_); + } + if (pageSize_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(2, pageSize_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(pageToken_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(3, pageToken_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(filter_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(4, 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.iam.v3.ListPolicyBindingsRequest)) { + return super.equals(obj); + } + com.google.iam.v3.ListPolicyBindingsRequest other = + (com.google.iam.v3.ListPolicyBindingsRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (getPageSize() != other.getPageSize()) return false; + if (!getPageToken().equals(other.getPageToken())) 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) + PARENT_FIELD_NUMBER; + hash = (53 * hash) + getParent().hashCode(); + hash = (37 * hash) + PAGE_SIZE_FIELD_NUMBER; + hash = (53 * hash) + getPageSize(); + hash = (37 * hash) + PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getPageToken().hashCode(); + hash = (37 * hash) + FILTER_FIELD_NUMBER; + hash = (53 * hash) + getFilter().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.iam.v3.ListPolicyBindingsRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.iam.v3.ListPolicyBindingsRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.iam.v3.ListPolicyBindingsRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.iam.v3.ListPolicyBindingsRequest 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.iam.v3.ListPolicyBindingsRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.iam.v3.ListPolicyBindingsRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.iam.v3.ListPolicyBindingsRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.iam.v3.ListPolicyBindingsRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.iam.v3.ListPolicyBindingsRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.iam.v3.ListPolicyBindingsRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.iam.v3.ListPolicyBindingsRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.iam.v3.ListPolicyBindingsRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.iam.v3.ListPolicyBindingsRequest 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
        +   * Request message for ListPolicyBindings method.
        +   * 
        + * + * Protobuf type {@code google.iam.v3.ListPolicyBindingsRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.iam.v3.ListPolicyBindingsRequest) + com.google.iam.v3.ListPolicyBindingsRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.iam.v3.PolicyBindingsServiceProto + .internal_static_google_iam_v3_ListPolicyBindingsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.iam.v3.PolicyBindingsServiceProto + .internal_static_google_iam_v3_ListPolicyBindingsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.iam.v3.ListPolicyBindingsRequest.class, + com.google.iam.v3.ListPolicyBindingsRequest.Builder.class); + } + + // Construct using com.google.iam.v3.ListPolicyBindingsRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + parent_ = ""; + pageSize_ = 0; + pageToken_ = ""; + filter_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.iam.v3.PolicyBindingsServiceProto + .internal_static_google_iam_v3_ListPolicyBindingsRequest_descriptor; + } + + @java.lang.Override + public com.google.iam.v3.ListPolicyBindingsRequest getDefaultInstanceForType() { + return com.google.iam.v3.ListPolicyBindingsRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.iam.v3.ListPolicyBindingsRequest build() { + com.google.iam.v3.ListPolicyBindingsRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.iam.v3.ListPolicyBindingsRequest buildPartial() { + com.google.iam.v3.ListPolicyBindingsRequest result = + new com.google.iam.v3.ListPolicyBindingsRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.iam.v3.ListPolicyBindingsRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.parent_ = parent_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.pageSize_ = pageSize_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.pageToken_ = pageToken_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.filter_ = filter_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.iam.v3.ListPolicyBindingsRequest) { + return mergeFrom((com.google.iam.v3.ListPolicyBindingsRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.iam.v3.ListPolicyBindingsRequest other) { + if (other == com.google.iam.v3.ListPolicyBindingsRequest.getDefaultInstance()) return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.getPageSize() != 0) { + setPageSize(other.getPageSize()); + } + if (!other.getPageToken().isEmpty()) { + pageToken_ = other.pageToken_; + bitField0_ |= 0x00000004; + onChanged(); + } + if (!other.getFilter().isEmpty()) { + filter_ = other.filter_; + 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_ |= 0x00000002; + break; + } // case 16 + case 26: + { + pageToken_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 34: + { + filter_ = input.readStringRequireUtf8(); + 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 parent_ = ""; + + /** + * + * + *
        +     * Required. The parent resource, which owns the collection of policy
        +     * bindings.
        +     *
        +     * Format:
        +     *
        +     * * `projects/{project_id}/locations/{location}`
        +     * * `projects/{project_number}/locations/{location}`
        +     * * `folders/{folder_id}/locations/{location}`
        +     * * `organizations/{organization_id}/locations/{location}`
        +     * 
        + * + * + * 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, which owns the collection of policy
        +     * bindings.
        +     *
        +     * Format:
        +     *
        +     * * `projects/{project_id}/locations/{location}`
        +     * * `projects/{project_number}/locations/{location}`
        +     * * `folders/{folder_id}/locations/{location}`
        +     * * `organizations/{organization_id}/locations/{location}`
        +     * 
        + * + * + * 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, which owns the collection of policy
        +     * bindings.
        +     *
        +     * Format:
        +     *
        +     * * `projects/{project_id}/locations/{location}`
        +     * * `projects/{project_number}/locations/{location}`
        +     * * `folders/{folder_id}/locations/{location}`
        +     * * `organizations/{organization_id}/locations/{location}`
        +     * 
        + * + * + * 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, which owns the collection of policy
        +     * bindings.
        +     *
        +     * Format:
        +     *
        +     * * `projects/{project_id}/locations/{location}`
        +     * * `projects/{project_number}/locations/{location}`
        +     * * `folders/{folder_id}/locations/{location}`
        +     * * `organizations/{organization_id}/locations/{location}`
        +     * 
        + * + * + * 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, which owns the collection of policy
        +     * bindings.
        +     *
        +     * Format:
        +     *
        +     * * `projects/{project_id}/locations/{location}`
        +     * * `projects/{project_number}/locations/{location}`
        +     * * `folders/{folder_id}/locations/{location}`
        +     * * `organizations/{organization_id}/locations/{location}`
        +     * 
        + * + * + * 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 int pageSize_; + + /** + * + * + *
        +     * Optional. The maximum number of policy bindings to return. The service may
        +     * return fewer than this value.
        +     *
        +     * If unspecified, at most 50 policy bindings will be returned.
        +     * The maximum value is 1000; values above 1000 will be coerced to 1000.
        +     * 
        + * + * 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 policy bindings to return. The service may
        +     * return fewer than this value.
        +     *
        +     * If unspecified, at most 50 policy bindings will be returned.
        +     * The maximum value is 1000; values above 1000 will be coerced to 1000.
        +     * 
        + * + * 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_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
        +     * Optional. The maximum number of policy bindings to return. The service may
        +     * return fewer than this value.
        +     *
        +     * If unspecified, at most 50 policy bindings will be returned.
        +     * The maximum value is 1000; values above 1000 will be coerced to 1000.
        +     * 
        + * + * int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearPageSize() { + bitField0_ = (bitField0_ & ~0x00000002); + pageSize_ = 0; + onChanged(); + return this; + } + + private java.lang.Object pageToken_ = ""; + + /** + * + * + *
        +     * Optional. A page token, received from a previous `ListPolicyBindings` call.
        +     * Provide this to retrieve the subsequent page.
        +     *
        +     * When paginating, all other parameters provided to `ListPolicyBindings` must
        +     * match the call that provided the page token.
        +     * 
        + * + * 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. A page token, received from a previous `ListPolicyBindings` call.
        +     * Provide this to retrieve the subsequent page.
        +     *
        +     * When paginating, all other parameters provided to `ListPolicyBindings` must
        +     * match the call that provided the page token.
        +     * 
        + * + * 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. A page token, received from a previous `ListPolicyBindings` call.
        +     * Provide this to retrieve the subsequent page.
        +     *
        +     * When paginating, all other parameters provided to `ListPolicyBindings` must
        +     * match the call that provided the page token.
        +     * 
        + * + * 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_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
        +     * Optional. A page token, received from a previous `ListPolicyBindings` call.
        +     * Provide this to retrieve the subsequent page.
        +     *
        +     * When paginating, all other parameters provided to `ListPolicyBindings` must
        +     * match the call that provided the page token.
        +     * 
        + * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearPageToken() { + pageToken_ = getDefaultInstance().getPageToken(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + + /** + * + * + *
        +     * Optional. A page token, received from a previous `ListPolicyBindings` call.
        +     * Provide this to retrieve the subsequent page.
        +     *
        +     * When paginating, all other parameters provided to `ListPolicyBindings` must
        +     * match the call that provided the page token.
        +     * 
        + * + * 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_ |= 0x00000004; + onChanged(); + return this; + } + + private java.lang.Object filter_ = ""; + + /** + * + * + *
        +     * Optional. An expression for filtering the results of the request. Filter
        +     * rules are case insensitive. Some eligible fields for filtering are:
        +     *
        +     * + `target`
        +     * + `policy`
        +     *
        +     * Some examples of filter queries:
        +     *
        +     * * `target:ex*`: The binding target's name starts with "ex".
        +     * * `target:example`: The binding target's name is `example`.
        +     * * `policy:example`: The binding policy's name is `example`.
        +     * 
        + * + * string filter = 4 [(.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 expression for filtering the results of the request. Filter
        +     * rules are case insensitive. Some eligible fields for filtering are:
        +     *
        +     * + `target`
        +     * + `policy`
        +     *
        +     * Some examples of filter queries:
        +     *
        +     * * `target:ex*`: The binding target's name starts with "ex".
        +     * * `target:example`: The binding target's name is `example`.
        +     * * `policy:example`: The binding policy's name is `example`.
        +     * 
        + * + * string filter = 4 [(.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 expression for filtering the results of the request. Filter
        +     * rules are case insensitive. Some eligible fields for filtering are:
        +     *
        +     * + `target`
        +     * + `policy`
        +     *
        +     * Some examples of filter queries:
        +     *
        +     * * `target:ex*`: The binding target's name starts with "ex".
        +     * * `target:example`: The binding target's name is `example`.
        +     * * `policy:example`: The binding policy's name is `example`.
        +     * 
        + * + * string filter = 4 [(.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_ |= 0x00000008; + onChanged(); + return this; + } + + /** + * + * + *
        +     * Optional. An expression for filtering the results of the request. Filter
        +     * rules are case insensitive. Some eligible fields for filtering are:
        +     *
        +     * + `target`
        +     * + `policy`
        +     *
        +     * Some examples of filter queries:
        +     *
        +     * * `target:ex*`: The binding target's name starts with "ex".
        +     * * `target:example`: The binding target's name is `example`.
        +     * * `policy:example`: The binding policy's name is `example`.
        +     * 
        + * + * string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearFilter() { + filter_ = getDefaultInstance().getFilter(); + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + return this; + } + + /** + * + * + *
        +     * Optional. An expression for filtering the results of the request. Filter
        +     * rules are case insensitive. Some eligible fields for filtering are:
        +     *
        +     * + `target`
        +     * + `policy`
        +     *
        +     * Some examples of filter queries:
        +     *
        +     * * `target:ex*`: The binding target's name starts with "ex".
        +     * * `target:example`: The binding target's name is `example`.
        +     * * `policy:example`: The binding policy's name is `example`.
        +     * 
        + * + * string filter = 4 [(.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_ |= 0x00000008; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.iam.v3.ListPolicyBindingsRequest) + } + + // @@protoc_insertion_point(class_scope:google.iam.v3.ListPolicyBindingsRequest) + private static final com.google.iam.v3.ListPolicyBindingsRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.iam.v3.ListPolicyBindingsRequest(); + } + + public static com.google.iam.v3.ListPolicyBindingsRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListPolicyBindingsRequest 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.iam.v3.ListPolicyBindingsRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-iam/proto-google-iam-v3/src/main/java/com/google/iam/v3/ListPolicyBindingsRequestOrBuilder.java b/java-iam/proto-google-iam-v3/src/main/java/com/google/iam/v3/ListPolicyBindingsRequestOrBuilder.java new file mode 100644 index 0000000000..975e3aa6b1 --- /dev/null +++ b/java-iam/proto-google-iam-v3/src/main/java/com/google/iam/v3/ListPolicyBindingsRequestOrBuilder.java @@ -0,0 +1,171 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/iam/v3/policy_bindings_service.proto +// Protobuf Java Version: 4.33.2 + +package com.google.iam.v3; + +@com.google.protobuf.Generated +public interface ListPolicyBindingsRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.iam.v3.ListPolicyBindingsRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
        +   * Required. The parent resource, which owns the collection of policy
        +   * bindings.
        +   *
        +   * Format:
        +   *
        +   * * `projects/{project_id}/locations/{location}`
        +   * * `projects/{project_number}/locations/{location}`
        +   * * `folders/{folder_id}/locations/{location}`
        +   * * `organizations/{organization_id}/locations/{location}`
        +   * 
        + * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + + /** + * + * + *
        +   * Required. The parent resource, which owns the collection of policy
        +   * bindings.
        +   *
        +   * Format:
        +   *
        +   * * `projects/{project_id}/locations/{location}`
        +   * * `projects/{project_number}/locations/{location}`
        +   * * `folders/{folder_id}/locations/{location}`
        +   * * `organizations/{organization_id}/locations/{location}`
        +   * 
        + * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
        +   * Optional. The maximum number of policy bindings to return. The service may
        +   * return fewer than this value.
        +   *
        +   * If unspecified, at most 50 policy bindings will be returned.
        +   * The maximum value is 1000; values above 1000 will be coerced to 1000.
        +   * 
        + * + * int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageSize. + */ + int getPageSize(); + + /** + * + * + *
        +   * Optional. A page token, received from a previous `ListPolicyBindings` call.
        +   * Provide this to retrieve the subsequent page.
        +   *
        +   * When paginating, all other parameters provided to `ListPolicyBindings` must
        +   * match the call that provided the page token.
        +   * 
        + * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageToken. + */ + java.lang.String getPageToken(); + + /** + * + * + *
        +   * Optional. A page token, received from a previous `ListPolicyBindings` call.
        +   * Provide this to retrieve the subsequent page.
        +   *
        +   * When paginating, all other parameters provided to `ListPolicyBindings` must
        +   * match the call that provided the page token.
        +   * 
        + * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for pageToken. + */ + com.google.protobuf.ByteString getPageTokenBytes(); + + /** + * + * + *
        +   * Optional. An expression for filtering the results of the request. Filter
        +   * rules are case insensitive. Some eligible fields for filtering are:
        +   *
        +   * + `target`
        +   * + `policy`
        +   *
        +   * Some examples of filter queries:
        +   *
        +   * * `target:ex*`: The binding target's name starts with "ex".
        +   * * `target:example`: The binding target's name is `example`.
        +   * * `policy:example`: The binding policy's name is `example`.
        +   * 
        + * + * string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The filter. + */ + java.lang.String getFilter(); + + /** + * + * + *
        +   * Optional. An expression for filtering the results of the request. Filter
        +   * rules are case insensitive. Some eligible fields for filtering are:
        +   *
        +   * + `target`
        +   * + `policy`
        +   *
        +   * Some examples of filter queries:
        +   *
        +   * * `target:ex*`: The binding target's name starts with "ex".
        +   * * `target:example`: The binding target's name is `example`.
        +   * * `policy:example`: The binding policy's name is `example`.
        +   * 
        + * + * string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for filter. + */ + com.google.protobuf.ByteString getFilterBytes(); +} diff --git a/java-iam/proto-google-iam-v3/src/main/java/com/google/iam/v3/ListPolicyBindingsResponse.java b/java-iam/proto-google-iam-v3/src/main/java/com/google/iam/v3/ListPolicyBindingsResponse.java new file mode 100644 index 0000000000..8d4e077d35 --- /dev/null +++ b/java-iam/proto-google-iam-v3/src/main/java/com/google/iam/v3/ListPolicyBindingsResponse.java @@ -0,0 +1,1117 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/iam/v3/policy_bindings_service.proto +// Protobuf Java Version: 4.33.2 + +package com.google.iam.v3; + +/** + * + * + *
        + * Response message for ListPolicyBindings method.
        + * 
        + * + * Protobuf type {@code google.iam.v3.ListPolicyBindingsResponse} + */ +@com.google.protobuf.Generated +public final class ListPolicyBindingsResponse extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.iam.v3.ListPolicyBindingsResponse) + ListPolicyBindingsResponseOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "ListPolicyBindingsResponse"); + } + + // Use ListPolicyBindingsResponse.newBuilder() to construct. + private ListPolicyBindingsResponse(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private ListPolicyBindingsResponse() { + policyBindings_ = java.util.Collections.emptyList(); + nextPageToken_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.iam.v3.PolicyBindingsServiceProto + .internal_static_google_iam_v3_ListPolicyBindingsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.iam.v3.PolicyBindingsServiceProto + .internal_static_google_iam_v3_ListPolicyBindingsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.iam.v3.ListPolicyBindingsResponse.class, + com.google.iam.v3.ListPolicyBindingsResponse.Builder.class); + } + + public static final int POLICY_BINDINGS_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private java.util.List policyBindings_; + + /** + * + * + *
        +   * The policy bindings from the specified parent.
        +   * 
        + * + * repeated .google.iam.v3.PolicyBinding policy_bindings = 1; + */ + @java.lang.Override + public java.util.List getPolicyBindingsList() { + return policyBindings_; + } + + /** + * + * + *
        +   * The policy bindings from the specified parent.
        +   * 
        + * + * repeated .google.iam.v3.PolicyBinding policy_bindings = 1; + */ + @java.lang.Override + public java.util.List + getPolicyBindingsOrBuilderList() { + return policyBindings_; + } + + /** + * + * + *
        +   * The policy bindings from the specified parent.
        +   * 
        + * + * repeated .google.iam.v3.PolicyBinding policy_bindings = 1; + */ + @java.lang.Override + public int getPolicyBindingsCount() { + return policyBindings_.size(); + } + + /** + * + * + *
        +   * The policy bindings from the specified parent.
        +   * 
        + * + * repeated .google.iam.v3.PolicyBinding policy_bindings = 1; + */ + @java.lang.Override + public com.google.iam.v3.PolicyBinding getPolicyBindings(int index) { + return policyBindings_.get(index); + } + + /** + * + * + *
        +   * The policy bindings from the specified parent.
        +   * 
        + * + * repeated .google.iam.v3.PolicyBinding policy_bindings = 1; + */ + @java.lang.Override + public com.google.iam.v3.PolicyBindingOrBuilder getPolicyBindingsOrBuilder(int index) { + return policyBindings_.get(index); + } + + public static final int NEXT_PAGE_TOKEN_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object nextPageToken_ = ""; + + /** + * + * + *
        +   * Optional. A token, which can be sent as `page_token` to retrieve the next
        +   * page. If this field is omitted, there are no subsequent pages.
        +   * 
        + * + * string next_page_token = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + } + } + + /** + * + * + *
        +   * Optional. A token, which can be sent as `page_token` to retrieve the next
        +   * page. If this field is omitted, there are no subsequent pages.
        +   * 
        + * + * string next_page_token = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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 < policyBindings_.size(); i++) { + output.writeMessage(1, policyBindings_.get(i)); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(nextPageToken_)) { + com.google.protobuf.GeneratedMessage.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 < policyBindings_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, policyBindings_.get(i)); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(nextPageToken_)) { + size += com.google.protobuf.GeneratedMessage.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.iam.v3.ListPolicyBindingsResponse)) { + return super.equals(obj); + } + com.google.iam.v3.ListPolicyBindingsResponse other = + (com.google.iam.v3.ListPolicyBindingsResponse) obj; + + if (!getPolicyBindingsList().equals(other.getPolicyBindingsList())) 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 (getPolicyBindingsCount() > 0) { + hash = (37 * hash) + POLICY_BINDINGS_FIELD_NUMBER; + hash = (53 * hash) + getPolicyBindingsList().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.iam.v3.ListPolicyBindingsResponse parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.iam.v3.ListPolicyBindingsResponse parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.iam.v3.ListPolicyBindingsResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.iam.v3.ListPolicyBindingsResponse 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.iam.v3.ListPolicyBindingsResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.iam.v3.ListPolicyBindingsResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.iam.v3.ListPolicyBindingsResponse parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.iam.v3.ListPolicyBindingsResponse parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.iam.v3.ListPolicyBindingsResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.iam.v3.ListPolicyBindingsResponse parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.iam.v3.ListPolicyBindingsResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.iam.v3.ListPolicyBindingsResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.iam.v3.ListPolicyBindingsResponse 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
        +   * Response message for ListPolicyBindings method.
        +   * 
        + * + * Protobuf type {@code google.iam.v3.ListPolicyBindingsResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.iam.v3.ListPolicyBindingsResponse) + com.google.iam.v3.ListPolicyBindingsResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.iam.v3.PolicyBindingsServiceProto + .internal_static_google_iam_v3_ListPolicyBindingsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.iam.v3.PolicyBindingsServiceProto + .internal_static_google_iam_v3_ListPolicyBindingsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.iam.v3.ListPolicyBindingsResponse.class, + com.google.iam.v3.ListPolicyBindingsResponse.Builder.class); + } + + // Construct using com.google.iam.v3.ListPolicyBindingsResponse.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (policyBindingsBuilder_ == null) { + policyBindings_ = java.util.Collections.emptyList(); + } else { + policyBindings_ = null; + policyBindingsBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + nextPageToken_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.iam.v3.PolicyBindingsServiceProto + .internal_static_google_iam_v3_ListPolicyBindingsResponse_descriptor; + } + + @java.lang.Override + public com.google.iam.v3.ListPolicyBindingsResponse getDefaultInstanceForType() { + return com.google.iam.v3.ListPolicyBindingsResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.iam.v3.ListPolicyBindingsResponse build() { + com.google.iam.v3.ListPolicyBindingsResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.iam.v3.ListPolicyBindingsResponse buildPartial() { + com.google.iam.v3.ListPolicyBindingsResponse result = + new com.google.iam.v3.ListPolicyBindingsResponse(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields(com.google.iam.v3.ListPolicyBindingsResponse result) { + if (policyBindingsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + policyBindings_ = java.util.Collections.unmodifiableList(policyBindings_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.policyBindings_ = policyBindings_; + } else { + result.policyBindings_ = policyBindingsBuilder_.build(); + } + } + + private void buildPartial0(com.google.iam.v3.ListPolicyBindingsResponse result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.nextPageToken_ = nextPageToken_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.iam.v3.ListPolicyBindingsResponse) { + return mergeFrom((com.google.iam.v3.ListPolicyBindingsResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.iam.v3.ListPolicyBindingsResponse other) { + if (other == com.google.iam.v3.ListPolicyBindingsResponse.getDefaultInstance()) return this; + if (policyBindingsBuilder_ == null) { + if (!other.policyBindings_.isEmpty()) { + if (policyBindings_.isEmpty()) { + policyBindings_ = other.policyBindings_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensurePolicyBindingsIsMutable(); + policyBindings_.addAll(other.policyBindings_); + } + onChanged(); + } + } else { + if (!other.policyBindings_.isEmpty()) { + if (policyBindingsBuilder_.isEmpty()) { + policyBindingsBuilder_.dispose(); + policyBindingsBuilder_ = null; + policyBindings_ = other.policyBindings_; + bitField0_ = (bitField0_ & ~0x00000001); + policyBindingsBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders + ? internalGetPolicyBindingsFieldBuilder() + : null; + } else { + policyBindingsBuilder_.addAllMessages(other.policyBindings_); + } + } + } + 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.iam.v3.PolicyBinding m = + input.readMessage(com.google.iam.v3.PolicyBinding.parser(), extensionRegistry); + if (policyBindingsBuilder_ == null) { + ensurePolicyBindingsIsMutable(); + policyBindings_.add(m); + } else { + policyBindingsBuilder_.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 policyBindings_ = + java.util.Collections.emptyList(); + + private void ensurePolicyBindingsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + policyBindings_ = new java.util.ArrayList(policyBindings_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.google.iam.v3.PolicyBinding, + com.google.iam.v3.PolicyBinding.Builder, + com.google.iam.v3.PolicyBindingOrBuilder> + policyBindingsBuilder_; + + /** + * + * + *
        +     * The policy bindings from the specified parent.
        +     * 
        + * + * repeated .google.iam.v3.PolicyBinding policy_bindings = 1; + */ + public java.util.List getPolicyBindingsList() { + if (policyBindingsBuilder_ == null) { + return java.util.Collections.unmodifiableList(policyBindings_); + } else { + return policyBindingsBuilder_.getMessageList(); + } + } + + /** + * + * + *
        +     * The policy bindings from the specified parent.
        +     * 
        + * + * repeated .google.iam.v3.PolicyBinding policy_bindings = 1; + */ + public int getPolicyBindingsCount() { + if (policyBindingsBuilder_ == null) { + return policyBindings_.size(); + } else { + return policyBindingsBuilder_.getCount(); + } + } + + /** + * + * + *
        +     * The policy bindings from the specified parent.
        +     * 
        + * + * repeated .google.iam.v3.PolicyBinding policy_bindings = 1; + */ + public com.google.iam.v3.PolicyBinding getPolicyBindings(int index) { + if (policyBindingsBuilder_ == null) { + return policyBindings_.get(index); + } else { + return policyBindingsBuilder_.getMessage(index); + } + } + + /** + * + * + *
        +     * The policy bindings from the specified parent.
        +     * 
        + * + * repeated .google.iam.v3.PolicyBinding policy_bindings = 1; + */ + public Builder setPolicyBindings(int index, com.google.iam.v3.PolicyBinding value) { + if (policyBindingsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensurePolicyBindingsIsMutable(); + policyBindings_.set(index, value); + onChanged(); + } else { + policyBindingsBuilder_.setMessage(index, value); + } + return this; + } + + /** + * + * + *
        +     * The policy bindings from the specified parent.
        +     * 
        + * + * repeated .google.iam.v3.PolicyBinding policy_bindings = 1; + */ + public Builder setPolicyBindings( + int index, com.google.iam.v3.PolicyBinding.Builder builderForValue) { + if (policyBindingsBuilder_ == null) { + ensurePolicyBindingsIsMutable(); + policyBindings_.set(index, builderForValue.build()); + onChanged(); + } else { + policyBindingsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
        +     * The policy bindings from the specified parent.
        +     * 
        + * + * repeated .google.iam.v3.PolicyBinding policy_bindings = 1; + */ + public Builder addPolicyBindings(com.google.iam.v3.PolicyBinding value) { + if (policyBindingsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensurePolicyBindingsIsMutable(); + policyBindings_.add(value); + onChanged(); + } else { + policyBindingsBuilder_.addMessage(value); + } + return this; + } + + /** + * + * + *
        +     * The policy bindings from the specified parent.
        +     * 
        + * + * repeated .google.iam.v3.PolicyBinding policy_bindings = 1; + */ + public Builder addPolicyBindings(int index, com.google.iam.v3.PolicyBinding value) { + if (policyBindingsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensurePolicyBindingsIsMutable(); + policyBindings_.add(index, value); + onChanged(); + } else { + policyBindingsBuilder_.addMessage(index, value); + } + return this; + } + + /** + * + * + *
        +     * The policy bindings from the specified parent.
        +     * 
        + * + * repeated .google.iam.v3.PolicyBinding policy_bindings = 1; + */ + public Builder addPolicyBindings(com.google.iam.v3.PolicyBinding.Builder builderForValue) { + if (policyBindingsBuilder_ == null) { + ensurePolicyBindingsIsMutable(); + policyBindings_.add(builderForValue.build()); + onChanged(); + } else { + policyBindingsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + + /** + * + * + *
        +     * The policy bindings from the specified parent.
        +     * 
        + * + * repeated .google.iam.v3.PolicyBinding policy_bindings = 1; + */ + public Builder addPolicyBindings( + int index, com.google.iam.v3.PolicyBinding.Builder builderForValue) { + if (policyBindingsBuilder_ == null) { + ensurePolicyBindingsIsMutable(); + policyBindings_.add(index, builderForValue.build()); + onChanged(); + } else { + policyBindingsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
        +     * The policy bindings from the specified parent.
        +     * 
        + * + * repeated .google.iam.v3.PolicyBinding policy_bindings = 1; + */ + public Builder addAllPolicyBindings( + java.lang.Iterable values) { + if (policyBindingsBuilder_ == null) { + ensurePolicyBindingsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, policyBindings_); + onChanged(); + } else { + policyBindingsBuilder_.addAllMessages(values); + } + return this; + } + + /** + * + * + *
        +     * The policy bindings from the specified parent.
        +     * 
        + * + * repeated .google.iam.v3.PolicyBinding policy_bindings = 1; + */ + public Builder clearPolicyBindings() { + if (policyBindingsBuilder_ == null) { + policyBindings_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + policyBindingsBuilder_.clear(); + } + return this; + } + + /** + * + * + *
        +     * The policy bindings from the specified parent.
        +     * 
        + * + * repeated .google.iam.v3.PolicyBinding policy_bindings = 1; + */ + public Builder removePolicyBindings(int index) { + if (policyBindingsBuilder_ == null) { + ensurePolicyBindingsIsMutable(); + policyBindings_.remove(index); + onChanged(); + } else { + policyBindingsBuilder_.remove(index); + } + return this; + } + + /** + * + * + *
        +     * The policy bindings from the specified parent.
        +     * 
        + * + * repeated .google.iam.v3.PolicyBinding policy_bindings = 1; + */ + public com.google.iam.v3.PolicyBinding.Builder getPolicyBindingsBuilder(int index) { + return internalGetPolicyBindingsFieldBuilder().getBuilder(index); + } + + /** + * + * + *
        +     * The policy bindings from the specified parent.
        +     * 
        + * + * repeated .google.iam.v3.PolicyBinding policy_bindings = 1; + */ + public com.google.iam.v3.PolicyBindingOrBuilder getPolicyBindingsOrBuilder(int index) { + if (policyBindingsBuilder_ == null) { + return policyBindings_.get(index); + } else { + return policyBindingsBuilder_.getMessageOrBuilder(index); + } + } + + /** + * + * + *
        +     * The policy bindings from the specified parent.
        +     * 
        + * + * repeated .google.iam.v3.PolicyBinding policy_bindings = 1; + */ + public java.util.List + getPolicyBindingsOrBuilderList() { + if (policyBindingsBuilder_ != null) { + return policyBindingsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(policyBindings_); + } + } + + /** + * + * + *
        +     * The policy bindings from the specified parent.
        +     * 
        + * + * repeated .google.iam.v3.PolicyBinding policy_bindings = 1; + */ + public com.google.iam.v3.PolicyBinding.Builder addPolicyBindingsBuilder() { + return internalGetPolicyBindingsFieldBuilder() + .addBuilder(com.google.iam.v3.PolicyBinding.getDefaultInstance()); + } + + /** + * + * + *
        +     * The policy bindings from the specified parent.
        +     * 
        + * + * repeated .google.iam.v3.PolicyBinding policy_bindings = 1; + */ + public com.google.iam.v3.PolicyBinding.Builder addPolicyBindingsBuilder(int index) { + return internalGetPolicyBindingsFieldBuilder() + .addBuilder(index, com.google.iam.v3.PolicyBinding.getDefaultInstance()); + } + + /** + * + * + *
        +     * The policy bindings from the specified parent.
        +     * 
        + * + * repeated .google.iam.v3.PolicyBinding policy_bindings = 1; + */ + public java.util.List getPolicyBindingsBuilderList() { + return internalGetPolicyBindingsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.google.iam.v3.PolicyBinding, + com.google.iam.v3.PolicyBinding.Builder, + com.google.iam.v3.PolicyBindingOrBuilder> + internalGetPolicyBindingsFieldBuilder() { + if (policyBindingsBuilder_ == null) { + policyBindingsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilder< + com.google.iam.v3.PolicyBinding, + com.google.iam.v3.PolicyBinding.Builder, + com.google.iam.v3.PolicyBindingOrBuilder>( + policyBindings_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + policyBindings_ = null; + } + return policyBindingsBuilder_; + } + + private java.lang.Object nextPageToken_ = ""; + + /** + * + * + *
        +     * Optional. A token, which can be sent as `page_token` to retrieve the next
        +     * page. If this field is omitted, there are no subsequent pages.
        +     * 
        + * + * string next_page_token = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + } + } + + /** + * + * + *
        +     * Optional. A token, which can be sent as `page_token` to retrieve the next
        +     * page. If this field is omitted, there are no subsequent pages.
        +     * 
        + * + * string next_page_token = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + } + } + + /** + * + * + *
        +     * Optional. A token, which can be sent as `page_token` to retrieve the next
        +     * page. If this field is omitted, there are no subsequent pages.
        +     * 
        + * + * string next_page_token = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + } + + /** + * + * + *
        +     * Optional. A token, which can be sent as `page_token` to retrieve the next
        +     * page. If this field is omitted, there are no subsequent pages.
        +     * 
        + * + * string next_page_token = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearNextPageToken() { + nextPageToken_ = getDefaultInstance().getNextPageToken(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
        +     * Optional. A token, which can be sent as `page_token` to retrieve the next
        +     * page. If this field is omitted, there are no subsequent pages.
        +     * 
        + * + * string next_page_token = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + } + + // @@protoc_insertion_point(builder_scope:google.iam.v3.ListPolicyBindingsResponse) + } + + // @@protoc_insertion_point(class_scope:google.iam.v3.ListPolicyBindingsResponse) + private static final com.google.iam.v3.ListPolicyBindingsResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.iam.v3.ListPolicyBindingsResponse(); + } + + public static com.google.iam.v3.ListPolicyBindingsResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListPolicyBindingsResponse 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.iam.v3.ListPolicyBindingsResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-iam/proto-google-iam-v3/src/main/java/com/google/iam/v3/ListPolicyBindingsResponseOrBuilder.java b/java-iam/proto-google-iam-v3/src/main/java/com/google/iam/v3/ListPolicyBindingsResponseOrBuilder.java new file mode 100644 index 0000000000..bcb12ca8cd --- /dev/null +++ b/java-iam/proto-google-iam-v3/src/main/java/com/google/iam/v3/ListPolicyBindingsResponseOrBuilder.java @@ -0,0 +1,112 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/iam/v3/policy_bindings_service.proto +// Protobuf Java Version: 4.33.2 + +package com.google.iam.v3; + +@com.google.protobuf.Generated +public interface ListPolicyBindingsResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.iam.v3.ListPolicyBindingsResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
        +   * The policy bindings from the specified parent.
        +   * 
        + * + * repeated .google.iam.v3.PolicyBinding policy_bindings = 1; + */ + java.util.List getPolicyBindingsList(); + + /** + * + * + *
        +   * The policy bindings from the specified parent.
        +   * 
        + * + * repeated .google.iam.v3.PolicyBinding policy_bindings = 1; + */ + com.google.iam.v3.PolicyBinding getPolicyBindings(int index); + + /** + * + * + *
        +   * The policy bindings from the specified parent.
        +   * 
        + * + * repeated .google.iam.v3.PolicyBinding policy_bindings = 1; + */ + int getPolicyBindingsCount(); + + /** + * + * + *
        +   * The policy bindings from the specified parent.
        +   * 
        + * + * repeated .google.iam.v3.PolicyBinding policy_bindings = 1; + */ + java.util.List + getPolicyBindingsOrBuilderList(); + + /** + * + * + *
        +   * The policy bindings from the specified parent.
        +   * 
        + * + * repeated .google.iam.v3.PolicyBinding policy_bindings = 1; + */ + com.google.iam.v3.PolicyBindingOrBuilder getPolicyBindingsOrBuilder(int index); + + /** + * + * + *
        +   * Optional. A token, which can be sent as `page_token` to retrieve the next
        +   * page. If this field is omitted, there are no subsequent pages.
        +   * 
        + * + * string next_page_token = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The nextPageToken. + */ + java.lang.String getNextPageToken(); + + /** + * + * + *
        +   * Optional. A token, which can be sent as `page_token` to retrieve the next
        +   * page. If this field is omitted, there are no subsequent pages.
        +   * 
        + * + * string next_page_token = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for nextPageToken. + */ + com.google.protobuf.ByteString getNextPageTokenBytes(); +} diff --git a/java-iam/proto-google-iam-v3/src/main/java/com/google/iam/v3/ListPrincipalAccessBoundaryPoliciesRequest.java b/java-iam/proto-google-iam-v3/src/main/java/com/google/iam/v3/ListPrincipalAccessBoundaryPoliciesRequest.java new file mode 100644 index 0000000000..817a2edc08 --- /dev/null +++ b/java-iam/proto-google-iam-v3/src/main/java/com/google/iam/v3/ListPrincipalAccessBoundaryPoliciesRequest.java @@ -0,0 +1,995 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/iam/v3/principal_access_boundary_policies_service.proto +// Protobuf Java Version: 4.33.2 + +package com.google.iam.v3; + +/** + * + * + *
        + * Request message for ListPrincipalAccessBoundaryPolicies method.
        + * 
        + * + * Protobuf type {@code google.iam.v3.ListPrincipalAccessBoundaryPoliciesRequest} + */ +@com.google.protobuf.Generated +public final class ListPrincipalAccessBoundaryPoliciesRequest + extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.iam.v3.ListPrincipalAccessBoundaryPoliciesRequest) + ListPrincipalAccessBoundaryPoliciesRequestOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "ListPrincipalAccessBoundaryPoliciesRequest"); + } + + // Use ListPrincipalAccessBoundaryPoliciesRequest.newBuilder() to construct. + private ListPrincipalAccessBoundaryPoliciesRequest( + com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private ListPrincipalAccessBoundaryPoliciesRequest() { + parent_ = ""; + pageToken_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.iam.v3.PrincipalAccessBoundaryPoliciesServiceProto + .internal_static_google_iam_v3_ListPrincipalAccessBoundaryPoliciesRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.iam.v3.PrincipalAccessBoundaryPoliciesServiceProto + .internal_static_google_iam_v3_ListPrincipalAccessBoundaryPoliciesRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.iam.v3.ListPrincipalAccessBoundaryPoliciesRequest.class, + com.google.iam.v3.ListPrincipalAccessBoundaryPoliciesRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object parent_ = ""; + + /** + * + * + *
        +   * Required. The parent resource, which owns the collection of principal
        +   * access boundary policies.
        +   *
        +   * Format:
        +   * `organizations/{organization_id}/locations/{location}`
        +   * 
        + * + * + * 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, which owns the collection of principal
        +   * access boundary policies.
        +   *
        +   * Format:
        +   * `organizations/{organization_id}/locations/{location}`
        +   * 
        + * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + @java.lang.Override + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PAGE_SIZE_FIELD_NUMBER = 2; + private int pageSize_ = 0; + + /** + * + * + *
        +   * Optional. The maximum number of principal access boundary policies to
        +   * return. The service may return fewer than this value.
        +   *
        +   * If unspecified, at most 50 principal access boundary policies will be
        +   * returned. The maximum value is 1000; values above 1000 will be coerced to
        +   * 1000.
        +   * 
        + * + * 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. A page token, received from a previous
        +   * `ListPrincipalAccessBoundaryPolicies` call. Provide this to retrieve the
        +   * subsequent page.
        +   *
        +   * When paginating, all other parameters provided to
        +   * `ListPrincipalAccessBoundaryPolicies` must match the call that provided the
        +   * page token.
        +   * 
        + * + * 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. A page token, received from a previous
        +   * `ListPrincipalAccessBoundaryPolicies` call. Provide this to retrieve the
        +   * subsequent page.
        +   *
        +   * When paginating, all other parameters provided to
        +   * `ListPrincipalAccessBoundaryPolicies` must match the call that provided the
        +   * page token.
        +   * 
        + * + * 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.GeneratedMessage.isStringEmpty(parent_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, parent_); + } + if (pageSize_ != 0) { + output.writeInt32(2, pageSize_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(pageToken_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 3, pageToken_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(parent_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, parent_); + } + if (pageSize_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(2, pageSize_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(pageToken_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(3, 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.iam.v3.ListPrincipalAccessBoundaryPoliciesRequest)) { + return super.equals(obj); + } + com.google.iam.v3.ListPrincipalAccessBoundaryPoliciesRequest other = + (com.google.iam.v3.ListPrincipalAccessBoundaryPoliciesRequest) obj; + + if (!getParent().equals(other.getParent())) 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(); + 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.iam.v3.ListPrincipalAccessBoundaryPoliciesRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.iam.v3.ListPrincipalAccessBoundaryPoliciesRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.iam.v3.ListPrincipalAccessBoundaryPoliciesRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.iam.v3.ListPrincipalAccessBoundaryPoliciesRequest 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.iam.v3.ListPrincipalAccessBoundaryPoliciesRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.iam.v3.ListPrincipalAccessBoundaryPoliciesRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.iam.v3.ListPrincipalAccessBoundaryPoliciesRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.iam.v3.ListPrincipalAccessBoundaryPoliciesRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.iam.v3.ListPrincipalAccessBoundaryPoliciesRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.iam.v3.ListPrincipalAccessBoundaryPoliciesRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.iam.v3.ListPrincipalAccessBoundaryPoliciesRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.iam.v3.ListPrincipalAccessBoundaryPoliciesRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.iam.v3.ListPrincipalAccessBoundaryPoliciesRequest 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
        +   * Request message for ListPrincipalAccessBoundaryPolicies method.
        +   * 
        + * + * Protobuf type {@code google.iam.v3.ListPrincipalAccessBoundaryPoliciesRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.iam.v3.ListPrincipalAccessBoundaryPoliciesRequest) + com.google.iam.v3.ListPrincipalAccessBoundaryPoliciesRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.iam.v3.PrincipalAccessBoundaryPoliciesServiceProto + .internal_static_google_iam_v3_ListPrincipalAccessBoundaryPoliciesRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.iam.v3.PrincipalAccessBoundaryPoliciesServiceProto + .internal_static_google_iam_v3_ListPrincipalAccessBoundaryPoliciesRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.iam.v3.ListPrincipalAccessBoundaryPoliciesRequest.class, + com.google.iam.v3.ListPrincipalAccessBoundaryPoliciesRequest.Builder.class); + } + + // Construct using com.google.iam.v3.ListPrincipalAccessBoundaryPoliciesRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + parent_ = ""; + pageSize_ = 0; + pageToken_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.iam.v3.PrincipalAccessBoundaryPoliciesServiceProto + .internal_static_google_iam_v3_ListPrincipalAccessBoundaryPoliciesRequest_descriptor; + } + + @java.lang.Override + public com.google.iam.v3.ListPrincipalAccessBoundaryPoliciesRequest + getDefaultInstanceForType() { + return com.google.iam.v3.ListPrincipalAccessBoundaryPoliciesRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.iam.v3.ListPrincipalAccessBoundaryPoliciesRequest build() { + com.google.iam.v3.ListPrincipalAccessBoundaryPoliciesRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.iam.v3.ListPrincipalAccessBoundaryPoliciesRequest buildPartial() { + com.google.iam.v3.ListPrincipalAccessBoundaryPoliciesRequest result = + new com.google.iam.v3.ListPrincipalAccessBoundaryPoliciesRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.iam.v3.ListPrincipalAccessBoundaryPoliciesRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.parent_ = parent_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.pageSize_ = pageSize_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.pageToken_ = pageToken_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.iam.v3.ListPrincipalAccessBoundaryPoliciesRequest) { + return mergeFrom((com.google.iam.v3.ListPrincipalAccessBoundaryPoliciesRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.iam.v3.ListPrincipalAccessBoundaryPoliciesRequest other) { + if (other + == com.google.iam.v3.ListPrincipalAccessBoundaryPoliciesRequest.getDefaultInstance()) + return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.getPageSize() != 0) { + setPageSize(other.getPageSize()); + } + if (!other.getPageToken().isEmpty()) { + pageToken_ = other.pageToken_; + 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 16: + { + pageSize_ = input.readInt32(); + bitField0_ |= 0x00000002; + break; + } // case 16 + case 26: + { + pageToken_ = 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 parent resource, which owns the collection of principal
        +     * access boundary policies.
        +     *
        +     * Format:
        +     * `organizations/{organization_id}/locations/{location}`
        +     * 
        + * + * + * 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, which owns the collection of principal
        +     * access boundary policies.
        +     *
        +     * Format:
        +     * `organizations/{organization_id}/locations/{location}`
        +     * 
        + * + * + * 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, which owns the collection of principal
        +     * access boundary policies.
        +     *
        +     * Format:
        +     * `organizations/{organization_id}/locations/{location}`
        +     * 
        + * + * + * 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, which owns the collection of principal
        +     * access boundary policies.
        +     *
        +     * Format:
        +     * `organizations/{organization_id}/locations/{location}`
        +     * 
        + * + * + * 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, which owns the collection of principal
        +     * access boundary policies.
        +     *
        +     * Format:
        +     * `organizations/{organization_id}/locations/{location}`
        +     * 
        + * + * + * 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 int pageSize_; + + /** + * + * + *
        +     * Optional. The maximum number of principal access boundary policies to
        +     * return. The service may return fewer than this value.
        +     *
        +     * If unspecified, at most 50 principal access boundary policies will be
        +     * returned. The maximum value is 1000; values above 1000 will be coerced to
        +     * 1000.
        +     * 
        + * + * 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 principal access boundary policies to
        +     * return. The service may return fewer than this value.
        +     *
        +     * If unspecified, at most 50 principal access boundary policies will be
        +     * returned. The maximum value is 1000; values above 1000 will be coerced to
        +     * 1000.
        +     * 
        + * + * 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_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
        +     * Optional. The maximum number of principal access boundary policies to
        +     * return. The service may return fewer than this value.
        +     *
        +     * If unspecified, at most 50 principal access boundary policies will be
        +     * returned. The maximum value is 1000; values above 1000 will be coerced to
        +     * 1000.
        +     * 
        + * + * int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearPageSize() { + bitField0_ = (bitField0_ & ~0x00000002); + pageSize_ = 0; + onChanged(); + return this; + } + + private java.lang.Object pageToken_ = ""; + + /** + * + * + *
        +     * Optional. A page token, received from a previous
        +     * `ListPrincipalAccessBoundaryPolicies` call. Provide this to retrieve the
        +     * subsequent page.
        +     *
        +     * When paginating, all other parameters provided to
        +     * `ListPrincipalAccessBoundaryPolicies` must match the call that provided the
        +     * page token.
        +     * 
        + * + * 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. A page token, received from a previous
        +     * `ListPrincipalAccessBoundaryPolicies` call. Provide this to retrieve the
        +     * subsequent page.
        +     *
        +     * When paginating, all other parameters provided to
        +     * `ListPrincipalAccessBoundaryPolicies` must match the call that provided the
        +     * page token.
        +     * 
        + * + * 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. A page token, received from a previous
        +     * `ListPrincipalAccessBoundaryPolicies` call. Provide this to retrieve the
        +     * subsequent page.
        +     *
        +     * When paginating, all other parameters provided to
        +     * `ListPrincipalAccessBoundaryPolicies` must match the call that provided the
        +     * page token.
        +     * 
        + * + * 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_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
        +     * Optional. A page token, received from a previous
        +     * `ListPrincipalAccessBoundaryPolicies` call. Provide this to retrieve the
        +     * subsequent page.
        +     *
        +     * When paginating, all other parameters provided to
        +     * `ListPrincipalAccessBoundaryPolicies` must match the call that provided the
        +     * page token.
        +     * 
        + * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearPageToken() { + pageToken_ = getDefaultInstance().getPageToken(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + + /** + * + * + *
        +     * Optional. A page token, received from a previous
        +     * `ListPrincipalAccessBoundaryPolicies` call. Provide this to retrieve the
        +     * subsequent page.
        +     *
        +     * When paginating, all other parameters provided to
        +     * `ListPrincipalAccessBoundaryPolicies` must match the call that provided the
        +     * page token.
        +     * 
        + * + * 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_ |= 0x00000004; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.iam.v3.ListPrincipalAccessBoundaryPoliciesRequest) + } + + // @@protoc_insertion_point(class_scope:google.iam.v3.ListPrincipalAccessBoundaryPoliciesRequest) + private static final com.google.iam.v3.ListPrincipalAccessBoundaryPoliciesRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.iam.v3.ListPrincipalAccessBoundaryPoliciesRequest(); + } + + public static com.google.iam.v3.ListPrincipalAccessBoundaryPoliciesRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListPrincipalAccessBoundaryPoliciesRequest 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.iam.v3.ListPrincipalAccessBoundaryPoliciesRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-iam/proto-google-iam-v3/src/main/java/com/google/iam/v3/ListPrincipalAccessBoundaryPoliciesRequestOrBuilder.java b/java-iam/proto-google-iam-v3/src/main/java/com/google/iam/v3/ListPrincipalAccessBoundaryPoliciesRequestOrBuilder.java new file mode 100644 index 0000000000..deb488e915 --- /dev/null +++ b/java-iam/proto-google-iam-v3/src/main/java/com/google/iam/v3/ListPrincipalAccessBoundaryPoliciesRequestOrBuilder.java @@ -0,0 +1,122 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/iam/v3/principal_access_boundary_policies_service.proto +// Protobuf Java Version: 4.33.2 + +package com.google.iam.v3; + +@com.google.protobuf.Generated +public interface ListPrincipalAccessBoundaryPoliciesRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.iam.v3.ListPrincipalAccessBoundaryPoliciesRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
        +   * Required. The parent resource, which owns the collection of principal
        +   * access boundary policies.
        +   *
        +   * Format:
        +   * `organizations/{organization_id}/locations/{location}`
        +   * 
        + * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + + /** + * + * + *
        +   * Required. The parent resource, which owns the collection of principal
        +   * access boundary policies.
        +   *
        +   * Format:
        +   * `organizations/{organization_id}/locations/{location}`
        +   * 
        + * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
        +   * Optional. The maximum number of principal access boundary policies to
        +   * return. The service may return fewer than this value.
        +   *
        +   * If unspecified, at most 50 principal access boundary policies will be
        +   * returned. The maximum value is 1000; values above 1000 will be coerced to
        +   * 1000.
        +   * 
        + * + * int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageSize. + */ + int getPageSize(); + + /** + * + * + *
        +   * Optional. A page token, received from a previous
        +   * `ListPrincipalAccessBoundaryPolicies` call. Provide this to retrieve the
        +   * subsequent page.
        +   *
        +   * When paginating, all other parameters provided to
        +   * `ListPrincipalAccessBoundaryPolicies` must match the call that provided the
        +   * page token.
        +   * 
        + * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageToken. + */ + java.lang.String getPageToken(); + + /** + * + * + *
        +   * Optional. A page token, received from a previous
        +   * `ListPrincipalAccessBoundaryPolicies` call. Provide this to retrieve the
        +   * subsequent page.
        +   *
        +   * When paginating, all other parameters provided to
        +   * `ListPrincipalAccessBoundaryPolicies` must match the call that provided the
        +   * page token.
        +   * 
        + * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for pageToken. + */ + com.google.protobuf.ByteString getPageTokenBytes(); +} diff --git a/java-iam/proto-google-iam-v3/src/main/java/com/google/iam/v3/ListPrincipalAccessBoundaryPoliciesResponse.java b/java-iam/proto-google-iam-v3/src/main/java/com/google/iam/v3/ListPrincipalAccessBoundaryPoliciesResponse.java new file mode 100644 index 0000000000..ab1d9b2af9 --- /dev/null +++ b/java-iam/proto-google-iam-v3/src/main/java/com/google/iam/v3/ListPrincipalAccessBoundaryPoliciesResponse.java @@ -0,0 +1,1200 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/iam/v3/principal_access_boundary_policies_service.proto +// Protobuf Java Version: 4.33.2 + +package com.google.iam.v3; + +/** + * + * + *
        + * Response message for ListPrincipalAccessBoundaryPolicies method.
        + * 
        + * + * Protobuf type {@code google.iam.v3.ListPrincipalAccessBoundaryPoliciesResponse} + */ +@com.google.protobuf.Generated +public final class ListPrincipalAccessBoundaryPoliciesResponse + extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.iam.v3.ListPrincipalAccessBoundaryPoliciesResponse) + ListPrincipalAccessBoundaryPoliciesResponseOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "ListPrincipalAccessBoundaryPoliciesResponse"); + } + + // Use ListPrincipalAccessBoundaryPoliciesResponse.newBuilder() to construct. + private ListPrincipalAccessBoundaryPoliciesResponse( + com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private ListPrincipalAccessBoundaryPoliciesResponse() { + principalAccessBoundaryPolicies_ = java.util.Collections.emptyList(); + nextPageToken_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.iam.v3.PrincipalAccessBoundaryPoliciesServiceProto + .internal_static_google_iam_v3_ListPrincipalAccessBoundaryPoliciesResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.iam.v3.PrincipalAccessBoundaryPoliciesServiceProto + .internal_static_google_iam_v3_ListPrincipalAccessBoundaryPoliciesResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.iam.v3.ListPrincipalAccessBoundaryPoliciesResponse.class, + com.google.iam.v3.ListPrincipalAccessBoundaryPoliciesResponse.Builder.class); + } + + public static final int PRINCIPAL_ACCESS_BOUNDARY_POLICIES_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private java.util.List + principalAccessBoundaryPolicies_; + + /** + * + * + *
        +   * The principal access boundary policies from the specified parent.
        +   * 
        + * + * + * repeated .google.iam.v3.PrincipalAccessBoundaryPolicy principal_access_boundary_policies = 1; + * + */ + @java.lang.Override + public java.util.List + getPrincipalAccessBoundaryPoliciesList() { + return principalAccessBoundaryPolicies_; + } + + /** + * + * + *
        +   * The principal access boundary policies from the specified parent.
        +   * 
        + * + * + * repeated .google.iam.v3.PrincipalAccessBoundaryPolicy principal_access_boundary_policies = 1; + * + */ + @java.lang.Override + public java.util.List + getPrincipalAccessBoundaryPoliciesOrBuilderList() { + return principalAccessBoundaryPolicies_; + } + + /** + * + * + *
        +   * The principal access boundary policies from the specified parent.
        +   * 
        + * + * + * repeated .google.iam.v3.PrincipalAccessBoundaryPolicy principal_access_boundary_policies = 1; + * + */ + @java.lang.Override + public int getPrincipalAccessBoundaryPoliciesCount() { + return principalAccessBoundaryPolicies_.size(); + } + + /** + * + * + *
        +   * The principal access boundary policies from the specified parent.
        +   * 
        + * + * + * repeated .google.iam.v3.PrincipalAccessBoundaryPolicy principal_access_boundary_policies = 1; + * + */ + @java.lang.Override + public com.google.iam.v3.PrincipalAccessBoundaryPolicy getPrincipalAccessBoundaryPolicies( + int index) { + return principalAccessBoundaryPolicies_.get(index); + } + + /** + * + * + *
        +   * The principal access boundary policies from the specified parent.
        +   * 
        + * + * + * repeated .google.iam.v3.PrincipalAccessBoundaryPolicy principal_access_boundary_policies = 1; + * + */ + @java.lang.Override + public com.google.iam.v3.PrincipalAccessBoundaryPolicyOrBuilder + getPrincipalAccessBoundaryPoliciesOrBuilder(int index) { + return principalAccessBoundaryPolicies_.get(index); + } + + public static final int NEXT_PAGE_TOKEN_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object nextPageToken_ = ""; + + /** + * + * + *
        +   * Optional. A token, which can be sent as `page_token` to retrieve the next
        +   * page. If this field is omitted, there are no subsequent pages.
        +   * 
        + * + * string next_page_token = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + } + } + + /** + * + * + *
        +   * Optional. A token, which can be sent as `page_token` to retrieve the next
        +   * page. If this field is omitted, there are no subsequent pages.
        +   * 
        + * + * string next_page_token = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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 < principalAccessBoundaryPolicies_.size(); i++) { + output.writeMessage(1, principalAccessBoundaryPolicies_.get(i)); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(nextPageToken_)) { + com.google.protobuf.GeneratedMessage.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 < principalAccessBoundaryPolicies_.size(); i++) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 1, principalAccessBoundaryPolicies_.get(i)); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(nextPageToken_)) { + size += com.google.protobuf.GeneratedMessage.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.iam.v3.ListPrincipalAccessBoundaryPoliciesResponse)) { + return super.equals(obj); + } + com.google.iam.v3.ListPrincipalAccessBoundaryPoliciesResponse other = + (com.google.iam.v3.ListPrincipalAccessBoundaryPoliciesResponse) obj; + + if (!getPrincipalAccessBoundaryPoliciesList() + .equals(other.getPrincipalAccessBoundaryPoliciesList())) 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 (getPrincipalAccessBoundaryPoliciesCount() > 0) { + hash = (37 * hash) + PRINCIPAL_ACCESS_BOUNDARY_POLICIES_FIELD_NUMBER; + hash = (53 * hash) + getPrincipalAccessBoundaryPoliciesList().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.iam.v3.ListPrincipalAccessBoundaryPoliciesResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.iam.v3.ListPrincipalAccessBoundaryPoliciesResponse parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.iam.v3.ListPrincipalAccessBoundaryPoliciesResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.iam.v3.ListPrincipalAccessBoundaryPoliciesResponse 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.iam.v3.ListPrincipalAccessBoundaryPoliciesResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.iam.v3.ListPrincipalAccessBoundaryPoliciesResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.iam.v3.ListPrincipalAccessBoundaryPoliciesResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.iam.v3.ListPrincipalAccessBoundaryPoliciesResponse parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.iam.v3.ListPrincipalAccessBoundaryPoliciesResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.iam.v3.ListPrincipalAccessBoundaryPoliciesResponse parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.iam.v3.ListPrincipalAccessBoundaryPoliciesResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.iam.v3.ListPrincipalAccessBoundaryPoliciesResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.iam.v3.ListPrincipalAccessBoundaryPoliciesResponse 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
        +   * Response message for ListPrincipalAccessBoundaryPolicies method.
        +   * 
        + * + * Protobuf type {@code google.iam.v3.ListPrincipalAccessBoundaryPoliciesResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.iam.v3.ListPrincipalAccessBoundaryPoliciesResponse) + com.google.iam.v3.ListPrincipalAccessBoundaryPoliciesResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.iam.v3.PrincipalAccessBoundaryPoliciesServiceProto + .internal_static_google_iam_v3_ListPrincipalAccessBoundaryPoliciesResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.iam.v3.PrincipalAccessBoundaryPoliciesServiceProto + .internal_static_google_iam_v3_ListPrincipalAccessBoundaryPoliciesResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.iam.v3.ListPrincipalAccessBoundaryPoliciesResponse.class, + com.google.iam.v3.ListPrincipalAccessBoundaryPoliciesResponse.Builder.class); + } + + // Construct using com.google.iam.v3.ListPrincipalAccessBoundaryPoliciesResponse.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (principalAccessBoundaryPoliciesBuilder_ == null) { + principalAccessBoundaryPolicies_ = java.util.Collections.emptyList(); + } else { + principalAccessBoundaryPolicies_ = null; + principalAccessBoundaryPoliciesBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + nextPageToken_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.iam.v3.PrincipalAccessBoundaryPoliciesServiceProto + .internal_static_google_iam_v3_ListPrincipalAccessBoundaryPoliciesResponse_descriptor; + } + + @java.lang.Override + public com.google.iam.v3.ListPrincipalAccessBoundaryPoliciesResponse + getDefaultInstanceForType() { + return com.google.iam.v3.ListPrincipalAccessBoundaryPoliciesResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.iam.v3.ListPrincipalAccessBoundaryPoliciesResponse build() { + com.google.iam.v3.ListPrincipalAccessBoundaryPoliciesResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.iam.v3.ListPrincipalAccessBoundaryPoliciesResponse buildPartial() { + com.google.iam.v3.ListPrincipalAccessBoundaryPoliciesResponse result = + new com.google.iam.v3.ListPrincipalAccessBoundaryPoliciesResponse(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields( + com.google.iam.v3.ListPrincipalAccessBoundaryPoliciesResponse result) { + if (principalAccessBoundaryPoliciesBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + principalAccessBoundaryPolicies_ = + java.util.Collections.unmodifiableList(principalAccessBoundaryPolicies_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.principalAccessBoundaryPolicies_ = principalAccessBoundaryPolicies_; + } else { + result.principalAccessBoundaryPolicies_ = principalAccessBoundaryPoliciesBuilder_.build(); + } + } + + private void buildPartial0( + com.google.iam.v3.ListPrincipalAccessBoundaryPoliciesResponse result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.nextPageToken_ = nextPageToken_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.iam.v3.ListPrincipalAccessBoundaryPoliciesResponse) { + return mergeFrom((com.google.iam.v3.ListPrincipalAccessBoundaryPoliciesResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.iam.v3.ListPrincipalAccessBoundaryPoliciesResponse other) { + if (other + == com.google.iam.v3.ListPrincipalAccessBoundaryPoliciesResponse.getDefaultInstance()) + return this; + if (principalAccessBoundaryPoliciesBuilder_ == null) { + if (!other.principalAccessBoundaryPolicies_.isEmpty()) { + if (principalAccessBoundaryPolicies_.isEmpty()) { + principalAccessBoundaryPolicies_ = other.principalAccessBoundaryPolicies_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensurePrincipalAccessBoundaryPoliciesIsMutable(); + principalAccessBoundaryPolicies_.addAll(other.principalAccessBoundaryPolicies_); + } + onChanged(); + } + } else { + if (!other.principalAccessBoundaryPolicies_.isEmpty()) { + if (principalAccessBoundaryPoliciesBuilder_.isEmpty()) { + principalAccessBoundaryPoliciesBuilder_.dispose(); + principalAccessBoundaryPoliciesBuilder_ = null; + principalAccessBoundaryPolicies_ = other.principalAccessBoundaryPolicies_; + bitField0_ = (bitField0_ & ~0x00000001); + principalAccessBoundaryPoliciesBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders + ? internalGetPrincipalAccessBoundaryPoliciesFieldBuilder() + : null; + } else { + principalAccessBoundaryPoliciesBuilder_.addAllMessages( + other.principalAccessBoundaryPolicies_); + } + } + } + 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.iam.v3.PrincipalAccessBoundaryPolicy m = + input.readMessage( + com.google.iam.v3.PrincipalAccessBoundaryPolicy.parser(), + extensionRegistry); + if (principalAccessBoundaryPoliciesBuilder_ == null) { + ensurePrincipalAccessBoundaryPoliciesIsMutable(); + principalAccessBoundaryPolicies_.add(m); + } else { + principalAccessBoundaryPoliciesBuilder_.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 + principalAccessBoundaryPolicies_ = java.util.Collections.emptyList(); + + private void ensurePrincipalAccessBoundaryPoliciesIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + principalAccessBoundaryPolicies_ = + new java.util.ArrayList( + principalAccessBoundaryPolicies_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.google.iam.v3.PrincipalAccessBoundaryPolicy, + com.google.iam.v3.PrincipalAccessBoundaryPolicy.Builder, + com.google.iam.v3.PrincipalAccessBoundaryPolicyOrBuilder> + principalAccessBoundaryPoliciesBuilder_; + + /** + * + * + *
        +     * The principal access boundary policies from the specified parent.
        +     * 
        + * + * + * repeated .google.iam.v3.PrincipalAccessBoundaryPolicy principal_access_boundary_policies = 1; + * + */ + public java.util.List + getPrincipalAccessBoundaryPoliciesList() { + if (principalAccessBoundaryPoliciesBuilder_ == null) { + return java.util.Collections.unmodifiableList(principalAccessBoundaryPolicies_); + } else { + return principalAccessBoundaryPoliciesBuilder_.getMessageList(); + } + } + + /** + * + * + *
        +     * The principal access boundary policies from the specified parent.
        +     * 
        + * + * + * repeated .google.iam.v3.PrincipalAccessBoundaryPolicy principal_access_boundary_policies = 1; + * + */ + public int getPrincipalAccessBoundaryPoliciesCount() { + if (principalAccessBoundaryPoliciesBuilder_ == null) { + return principalAccessBoundaryPolicies_.size(); + } else { + return principalAccessBoundaryPoliciesBuilder_.getCount(); + } + } + + /** + * + * + *
        +     * The principal access boundary policies from the specified parent.
        +     * 
        + * + * + * repeated .google.iam.v3.PrincipalAccessBoundaryPolicy principal_access_boundary_policies = 1; + * + */ + public com.google.iam.v3.PrincipalAccessBoundaryPolicy getPrincipalAccessBoundaryPolicies( + int index) { + if (principalAccessBoundaryPoliciesBuilder_ == null) { + return principalAccessBoundaryPolicies_.get(index); + } else { + return principalAccessBoundaryPoliciesBuilder_.getMessage(index); + } + } + + /** + * + * + *
        +     * The principal access boundary policies from the specified parent.
        +     * 
        + * + * + * repeated .google.iam.v3.PrincipalAccessBoundaryPolicy principal_access_boundary_policies = 1; + * + */ + public Builder setPrincipalAccessBoundaryPolicies( + int index, com.google.iam.v3.PrincipalAccessBoundaryPolicy value) { + if (principalAccessBoundaryPoliciesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensurePrincipalAccessBoundaryPoliciesIsMutable(); + principalAccessBoundaryPolicies_.set(index, value); + onChanged(); + } else { + principalAccessBoundaryPoliciesBuilder_.setMessage(index, value); + } + return this; + } + + /** + * + * + *
        +     * The principal access boundary policies from the specified parent.
        +     * 
        + * + * + * repeated .google.iam.v3.PrincipalAccessBoundaryPolicy principal_access_boundary_policies = 1; + * + */ + public Builder setPrincipalAccessBoundaryPolicies( + int index, com.google.iam.v3.PrincipalAccessBoundaryPolicy.Builder builderForValue) { + if (principalAccessBoundaryPoliciesBuilder_ == null) { + ensurePrincipalAccessBoundaryPoliciesIsMutable(); + principalAccessBoundaryPolicies_.set(index, builderForValue.build()); + onChanged(); + } else { + principalAccessBoundaryPoliciesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
        +     * The principal access boundary policies from the specified parent.
        +     * 
        + * + * + * repeated .google.iam.v3.PrincipalAccessBoundaryPolicy principal_access_boundary_policies = 1; + * + */ + public Builder addPrincipalAccessBoundaryPolicies( + com.google.iam.v3.PrincipalAccessBoundaryPolicy value) { + if (principalAccessBoundaryPoliciesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensurePrincipalAccessBoundaryPoliciesIsMutable(); + principalAccessBoundaryPolicies_.add(value); + onChanged(); + } else { + principalAccessBoundaryPoliciesBuilder_.addMessage(value); + } + return this; + } + + /** + * + * + *
        +     * The principal access boundary policies from the specified parent.
        +     * 
        + * + * + * repeated .google.iam.v3.PrincipalAccessBoundaryPolicy principal_access_boundary_policies = 1; + * + */ + public Builder addPrincipalAccessBoundaryPolicies( + int index, com.google.iam.v3.PrincipalAccessBoundaryPolicy value) { + if (principalAccessBoundaryPoliciesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensurePrincipalAccessBoundaryPoliciesIsMutable(); + principalAccessBoundaryPolicies_.add(index, value); + onChanged(); + } else { + principalAccessBoundaryPoliciesBuilder_.addMessage(index, value); + } + return this; + } + + /** + * + * + *
        +     * The principal access boundary policies from the specified parent.
        +     * 
        + * + * + * repeated .google.iam.v3.PrincipalAccessBoundaryPolicy principal_access_boundary_policies = 1; + * + */ + public Builder addPrincipalAccessBoundaryPolicies( + com.google.iam.v3.PrincipalAccessBoundaryPolicy.Builder builderForValue) { + if (principalAccessBoundaryPoliciesBuilder_ == null) { + ensurePrincipalAccessBoundaryPoliciesIsMutable(); + principalAccessBoundaryPolicies_.add(builderForValue.build()); + onChanged(); + } else { + principalAccessBoundaryPoliciesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + + /** + * + * + *
        +     * The principal access boundary policies from the specified parent.
        +     * 
        + * + * + * repeated .google.iam.v3.PrincipalAccessBoundaryPolicy principal_access_boundary_policies = 1; + * + */ + public Builder addPrincipalAccessBoundaryPolicies( + int index, com.google.iam.v3.PrincipalAccessBoundaryPolicy.Builder builderForValue) { + if (principalAccessBoundaryPoliciesBuilder_ == null) { + ensurePrincipalAccessBoundaryPoliciesIsMutable(); + principalAccessBoundaryPolicies_.add(index, builderForValue.build()); + onChanged(); + } else { + principalAccessBoundaryPoliciesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
        +     * The principal access boundary policies from the specified parent.
        +     * 
        + * + * + * repeated .google.iam.v3.PrincipalAccessBoundaryPolicy principal_access_boundary_policies = 1; + * + */ + public Builder addAllPrincipalAccessBoundaryPolicies( + java.lang.Iterable values) { + if (principalAccessBoundaryPoliciesBuilder_ == null) { + ensurePrincipalAccessBoundaryPoliciesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, principalAccessBoundaryPolicies_); + onChanged(); + } else { + principalAccessBoundaryPoliciesBuilder_.addAllMessages(values); + } + return this; + } + + /** + * + * + *
        +     * The principal access boundary policies from the specified parent.
        +     * 
        + * + * + * repeated .google.iam.v3.PrincipalAccessBoundaryPolicy principal_access_boundary_policies = 1; + * + */ + public Builder clearPrincipalAccessBoundaryPolicies() { + if (principalAccessBoundaryPoliciesBuilder_ == null) { + principalAccessBoundaryPolicies_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + principalAccessBoundaryPoliciesBuilder_.clear(); + } + return this; + } + + /** + * + * + *
        +     * The principal access boundary policies from the specified parent.
        +     * 
        + * + * + * repeated .google.iam.v3.PrincipalAccessBoundaryPolicy principal_access_boundary_policies = 1; + * + */ + public Builder removePrincipalAccessBoundaryPolicies(int index) { + if (principalAccessBoundaryPoliciesBuilder_ == null) { + ensurePrincipalAccessBoundaryPoliciesIsMutable(); + principalAccessBoundaryPolicies_.remove(index); + onChanged(); + } else { + principalAccessBoundaryPoliciesBuilder_.remove(index); + } + return this; + } + + /** + * + * + *
        +     * The principal access boundary policies from the specified parent.
        +     * 
        + * + * + * repeated .google.iam.v3.PrincipalAccessBoundaryPolicy principal_access_boundary_policies = 1; + * + */ + public com.google.iam.v3.PrincipalAccessBoundaryPolicy.Builder + getPrincipalAccessBoundaryPoliciesBuilder(int index) { + return internalGetPrincipalAccessBoundaryPoliciesFieldBuilder().getBuilder(index); + } + + /** + * + * + *
        +     * The principal access boundary policies from the specified parent.
        +     * 
        + * + * + * repeated .google.iam.v3.PrincipalAccessBoundaryPolicy principal_access_boundary_policies = 1; + * + */ + public com.google.iam.v3.PrincipalAccessBoundaryPolicyOrBuilder + getPrincipalAccessBoundaryPoliciesOrBuilder(int index) { + if (principalAccessBoundaryPoliciesBuilder_ == null) { + return principalAccessBoundaryPolicies_.get(index); + } else { + return principalAccessBoundaryPoliciesBuilder_.getMessageOrBuilder(index); + } + } + + /** + * + * + *
        +     * The principal access boundary policies from the specified parent.
        +     * 
        + * + * + * repeated .google.iam.v3.PrincipalAccessBoundaryPolicy principal_access_boundary_policies = 1; + * + */ + public java.util.List + getPrincipalAccessBoundaryPoliciesOrBuilderList() { + if (principalAccessBoundaryPoliciesBuilder_ != null) { + return principalAccessBoundaryPoliciesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(principalAccessBoundaryPolicies_); + } + } + + /** + * + * + *
        +     * The principal access boundary policies from the specified parent.
        +     * 
        + * + * + * repeated .google.iam.v3.PrincipalAccessBoundaryPolicy principal_access_boundary_policies = 1; + * + */ + public com.google.iam.v3.PrincipalAccessBoundaryPolicy.Builder + addPrincipalAccessBoundaryPoliciesBuilder() { + return internalGetPrincipalAccessBoundaryPoliciesFieldBuilder() + .addBuilder(com.google.iam.v3.PrincipalAccessBoundaryPolicy.getDefaultInstance()); + } + + /** + * + * + *
        +     * The principal access boundary policies from the specified parent.
        +     * 
        + * + * + * repeated .google.iam.v3.PrincipalAccessBoundaryPolicy principal_access_boundary_policies = 1; + * + */ + public com.google.iam.v3.PrincipalAccessBoundaryPolicy.Builder + addPrincipalAccessBoundaryPoliciesBuilder(int index) { + return internalGetPrincipalAccessBoundaryPoliciesFieldBuilder() + .addBuilder(index, com.google.iam.v3.PrincipalAccessBoundaryPolicy.getDefaultInstance()); + } + + /** + * + * + *
        +     * The principal access boundary policies from the specified parent.
        +     * 
        + * + * + * repeated .google.iam.v3.PrincipalAccessBoundaryPolicy principal_access_boundary_policies = 1; + * + */ + public java.util.List + getPrincipalAccessBoundaryPoliciesBuilderList() { + return internalGetPrincipalAccessBoundaryPoliciesFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.google.iam.v3.PrincipalAccessBoundaryPolicy, + com.google.iam.v3.PrincipalAccessBoundaryPolicy.Builder, + com.google.iam.v3.PrincipalAccessBoundaryPolicyOrBuilder> + internalGetPrincipalAccessBoundaryPoliciesFieldBuilder() { + if (principalAccessBoundaryPoliciesBuilder_ == null) { + principalAccessBoundaryPoliciesBuilder_ = + new com.google.protobuf.RepeatedFieldBuilder< + com.google.iam.v3.PrincipalAccessBoundaryPolicy, + com.google.iam.v3.PrincipalAccessBoundaryPolicy.Builder, + com.google.iam.v3.PrincipalAccessBoundaryPolicyOrBuilder>( + principalAccessBoundaryPolicies_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + principalAccessBoundaryPolicies_ = null; + } + return principalAccessBoundaryPoliciesBuilder_; + } + + private java.lang.Object nextPageToken_ = ""; + + /** + * + * + *
        +     * Optional. A token, which can be sent as `page_token` to retrieve the next
        +     * page. If this field is omitted, there are no subsequent pages.
        +     * 
        + * + * string next_page_token = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + } + } + + /** + * + * + *
        +     * Optional. A token, which can be sent as `page_token` to retrieve the next
        +     * page. If this field is omitted, there are no subsequent pages.
        +     * 
        + * + * string next_page_token = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + } + } + + /** + * + * + *
        +     * Optional. A token, which can be sent as `page_token` to retrieve the next
        +     * page. If this field is omitted, there are no subsequent pages.
        +     * 
        + * + * string next_page_token = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + } + + /** + * + * + *
        +     * Optional. A token, which can be sent as `page_token` to retrieve the next
        +     * page. If this field is omitted, there are no subsequent pages.
        +     * 
        + * + * string next_page_token = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearNextPageToken() { + nextPageToken_ = getDefaultInstance().getNextPageToken(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
        +     * Optional. A token, which can be sent as `page_token` to retrieve the next
        +     * page. If this field is omitted, there are no subsequent pages.
        +     * 
        + * + * string next_page_token = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + } + + // @@protoc_insertion_point(builder_scope:google.iam.v3.ListPrincipalAccessBoundaryPoliciesResponse) + } + + // @@protoc_insertion_point(class_scope:google.iam.v3.ListPrincipalAccessBoundaryPoliciesResponse) + private static final com.google.iam.v3.ListPrincipalAccessBoundaryPoliciesResponse + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.iam.v3.ListPrincipalAccessBoundaryPoliciesResponse(); + } + + public static com.google.iam.v3.ListPrincipalAccessBoundaryPoliciesResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListPrincipalAccessBoundaryPoliciesResponse 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.iam.v3.ListPrincipalAccessBoundaryPoliciesResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-iam/proto-google-iam-v3/src/main/java/com/google/iam/v3/ListPrincipalAccessBoundaryPoliciesResponseOrBuilder.java b/java-iam/proto-google-iam-v3/src/main/java/com/google/iam/v3/ListPrincipalAccessBoundaryPoliciesResponseOrBuilder.java new file mode 100644 index 0000000000..d3b7fc8625 --- /dev/null +++ b/java-iam/proto-google-iam-v3/src/main/java/com/google/iam/v3/ListPrincipalAccessBoundaryPoliciesResponseOrBuilder.java @@ -0,0 +1,124 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/iam/v3/principal_access_boundary_policies_service.proto +// Protobuf Java Version: 4.33.2 + +package com.google.iam.v3; + +@com.google.protobuf.Generated +public interface ListPrincipalAccessBoundaryPoliciesResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.iam.v3.ListPrincipalAccessBoundaryPoliciesResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
        +   * The principal access boundary policies from the specified parent.
        +   * 
        + * + * + * repeated .google.iam.v3.PrincipalAccessBoundaryPolicy principal_access_boundary_policies = 1; + * + */ + java.util.List + getPrincipalAccessBoundaryPoliciesList(); + + /** + * + * + *
        +   * The principal access boundary policies from the specified parent.
        +   * 
        + * + * + * repeated .google.iam.v3.PrincipalAccessBoundaryPolicy principal_access_boundary_policies = 1; + * + */ + com.google.iam.v3.PrincipalAccessBoundaryPolicy getPrincipalAccessBoundaryPolicies(int index); + + /** + * + * + *
        +   * The principal access boundary policies from the specified parent.
        +   * 
        + * + * + * repeated .google.iam.v3.PrincipalAccessBoundaryPolicy principal_access_boundary_policies = 1; + * + */ + int getPrincipalAccessBoundaryPoliciesCount(); + + /** + * + * + *
        +   * The principal access boundary policies from the specified parent.
        +   * 
        + * + * + * repeated .google.iam.v3.PrincipalAccessBoundaryPolicy principal_access_boundary_policies = 1; + * + */ + java.util.List + getPrincipalAccessBoundaryPoliciesOrBuilderList(); + + /** + * + * + *
        +   * The principal access boundary policies from the specified parent.
        +   * 
        + * + * + * repeated .google.iam.v3.PrincipalAccessBoundaryPolicy principal_access_boundary_policies = 1; + * + */ + com.google.iam.v3.PrincipalAccessBoundaryPolicyOrBuilder + getPrincipalAccessBoundaryPoliciesOrBuilder(int index); + + /** + * + * + *
        +   * Optional. A token, which can be sent as `page_token` to retrieve the next
        +   * page. If this field is omitted, there are no subsequent pages.
        +   * 
        + * + * string next_page_token = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The nextPageToken. + */ + java.lang.String getNextPageToken(); + + /** + * + * + *
        +   * Optional. A token, which can be sent as `page_token` to retrieve the next
        +   * page. If this field is omitted, there are no subsequent pages.
        +   * 
        + * + * string next_page_token = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for nextPageToken. + */ + com.google.protobuf.ByteString getNextPageTokenBytes(); +} diff --git a/java-iam/proto-google-iam-v3/src/main/java/com/google/iam/v3/LocationName.java b/java-iam/proto-google-iam-v3/src/main/java/com/google/iam/v3/LocationName.java new file mode 100644 index 0000000000..bdd37004f0 --- /dev/null +++ b/java-iam/proto-google-iam-v3/src/main/java/com/google/iam/v3/LocationName.java @@ -0,0 +1,192 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.iam.v3; + +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-iam/proto-google-iam-v3/src/main/java/com/google/iam/v3/OperationMetadata.java b/java-iam/proto-google-iam-v3/src/main/java/com/google/iam/v3/OperationMetadata.java new file mode 100644 index 0000000000..7b33d84c75 --- /dev/null +++ b/java-iam/proto-google-iam-v3/src/main/java/com/google/iam/v3/OperationMetadata.java @@ -0,0 +1,1865 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/iam/v3/operation_metadata.proto +// Protobuf Java Version: 4.33.2 + +package com.google.iam.v3; + +/** + * + * + *
        + * Represents the metadata of the long-running operation.
        + * 
        + * + * Protobuf type {@code google.iam.v3.OperationMetadata} + */ +@com.google.protobuf.Generated +public final class OperationMetadata extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.iam.v3.OperationMetadata) + OperationMetadataOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "OperationMetadata"); + } + + // Use OperationMetadata.newBuilder() to construct. + private OperationMetadata(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private OperationMetadata() { + target_ = ""; + verb_ = ""; + statusMessage_ = ""; + apiVersion_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.iam.v3.OperationMetadataProto + .internal_static_google_iam_v3_OperationMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.iam.v3.OperationMetadataProto + .internal_static_google_iam_v3_OperationMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.iam.v3.OperationMetadata.class, + com.google.iam.v3.OperationMetadata.Builder.class); + } + + private int bitField0_; + public static final int CREATE_TIME_FIELD_NUMBER = 1; + private com.google.protobuf.Timestamp createTime_; + + /** + * + * + *
        +   * Output only. The time the operation was created.
        +   * 
        + * + * .google.protobuf.Timestamp create_time = 1 [(.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 time the operation was created.
        +   * 
        + * + * .google.protobuf.Timestamp create_time = 1 [(.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 time the operation was created.
        +   * 
        + * + * .google.protobuf.Timestamp create_time = 1 [(.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 END_TIME_FIELD_NUMBER = 2; + private com.google.protobuf.Timestamp endTime_; + + /** + * + * + *
        +   * Output only. The time the operation finished running.
        +   * 
        + * + * .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the endTime field is set. + */ + @java.lang.Override + public boolean hasEndTime() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
        +   * Output only. The time the operation finished running.
        +   * 
        + * + * .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The endTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getEndTime() { + return endTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : endTime_; + } + + /** + * + * + *
        +   * Output only. The time the operation finished running.
        +   * 
        + * + * .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getEndTimeOrBuilder() { + return endTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : endTime_; + } + + public static final int TARGET_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object target_ = ""; + + /** + * + * + *
        +   * Output only. Server-defined resource path for the target of the
        +   * 
        + * + * string target = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The target. + */ + @java.lang.Override + public java.lang.String getTarget() { + java.lang.Object ref = target_; + 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(); + target_ = s; + return s; + } + } + + /** + * + * + *
        +   * Output only. Server-defined resource path for the target of the
        +   * 
        + * + * string target = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for target. + */ + @java.lang.Override + public com.google.protobuf.ByteString getTargetBytes() { + java.lang.Object ref = target_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + target_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int VERB_FIELD_NUMBER = 4; + + @SuppressWarnings("serial") + private volatile java.lang.Object verb_ = ""; + + /** + * + * + *
        +   * Output only. Name of the verb executed by the operation.
        +   * 
        + * + * string verb = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The verb. + */ + @java.lang.Override + public java.lang.String getVerb() { + java.lang.Object ref = verb_; + 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(); + verb_ = s; + return s; + } + } + + /** + * + * + *
        +   * Output only. Name of the verb executed by the operation.
        +   * 
        + * + * string verb = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for verb. + */ + @java.lang.Override + public com.google.protobuf.ByteString getVerbBytes() { + java.lang.Object ref = verb_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + verb_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int STATUS_MESSAGE_FIELD_NUMBER = 5; + + @SuppressWarnings("serial") + private volatile java.lang.Object statusMessage_ = ""; + + /** + * + * + *
        +   * Output only. Human-readable status of the operation, if any.
        +   * 
        + * + * string status_message = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The statusMessage. + */ + @java.lang.Override + public java.lang.String getStatusMessage() { + java.lang.Object ref = statusMessage_; + 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(); + statusMessage_ = s; + return s; + } + } + + /** + * + * + *
        +   * Output only. Human-readable status of the operation, if any.
        +   * 
        + * + * string status_message = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for statusMessage. + */ + @java.lang.Override + public com.google.protobuf.ByteString getStatusMessageBytes() { + java.lang.Object ref = statusMessage_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + statusMessage_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int REQUESTED_CANCELLATION_FIELD_NUMBER = 6; + private boolean requestedCancellation_ = false; + + /** + * + * + *
        +   * Output only. Identifies whether the user has requested cancellation
        +   * of the operation. Operations that have successfully been cancelled
        +   * have [Operation.error][] value with a
        +   * [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to
        +   * `Code.CANCELLED`.
        +   * 
        + * + * bool requested_cancellation = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The requestedCancellation. + */ + @java.lang.Override + public boolean getRequestedCancellation() { + return requestedCancellation_; + } + + public static final int API_VERSION_FIELD_NUMBER = 7; + + @SuppressWarnings("serial") + private volatile java.lang.Object apiVersion_ = ""; + + /** + * + * + *
        +   * Output only. API version used to start the operation.
        +   * 
        + * + * string api_version = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The apiVersion. + */ + @java.lang.Override + public java.lang.String getApiVersion() { + java.lang.Object ref = apiVersion_; + 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(); + apiVersion_ = s; + return s; + } + } + + /** + * + * + *
        +   * Output only. API version used to start the operation.
        +   * 
        + * + * string api_version = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for apiVersion. + */ + @java.lang.Override + public com.google.protobuf.ByteString getApiVersionBytes() { + java.lang.Object ref = apiVersion_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + apiVersion_ = 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, getCreateTime()); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeMessage(2, getEndTime()); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(target_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 3, target_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(verb_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 4, verb_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(statusMessage_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 5, statusMessage_); + } + if (requestedCancellation_ != false) { + output.writeBool(6, requestedCancellation_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(apiVersion_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 7, apiVersion_); + } + 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, getCreateTime()); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getEndTime()); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(target_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(3, target_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(verb_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(4, verb_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(statusMessage_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(5, statusMessage_); + } + if (requestedCancellation_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(6, requestedCancellation_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(apiVersion_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(7, apiVersion_); + } + 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.iam.v3.OperationMetadata)) { + return super.equals(obj); + } + com.google.iam.v3.OperationMetadata other = (com.google.iam.v3.OperationMetadata) obj; + + if (hasCreateTime() != other.hasCreateTime()) return false; + if (hasCreateTime()) { + if (!getCreateTime().equals(other.getCreateTime())) return false; + } + if (hasEndTime() != other.hasEndTime()) return false; + if (hasEndTime()) { + if (!getEndTime().equals(other.getEndTime())) return false; + } + if (!getTarget().equals(other.getTarget())) return false; + if (!getVerb().equals(other.getVerb())) return false; + if (!getStatusMessage().equals(other.getStatusMessage())) return false; + if (getRequestedCancellation() != other.getRequestedCancellation()) return false; + if (!getApiVersion().equals(other.getApiVersion())) 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 (hasCreateTime()) { + hash = (37 * hash) + CREATE_TIME_FIELD_NUMBER; + hash = (53 * hash) + getCreateTime().hashCode(); + } + if (hasEndTime()) { + hash = (37 * hash) + END_TIME_FIELD_NUMBER; + hash = (53 * hash) + getEndTime().hashCode(); + } + hash = (37 * hash) + TARGET_FIELD_NUMBER; + hash = (53 * hash) + getTarget().hashCode(); + hash = (37 * hash) + VERB_FIELD_NUMBER; + hash = (53 * hash) + getVerb().hashCode(); + hash = (37 * hash) + STATUS_MESSAGE_FIELD_NUMBER; + hash = (53 * hash) + getStatusMessage().hashCode(); + hash = (37 * hash) + REQUESTED_CANCELLATION_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getRequestedCancellation()); + hash = (37 * hash) + API_VERSION_FIELD_NUMBER; + hash = (53 * hash) + getApiVersion().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.iam.v3.OperationMetadata parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.iam.v3.OperationMetadata parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.iam.v3.OperationMetadata parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.iam.v3.OperationMetadata 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.iam.v3.OperationMetadata parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.iam.v3.OperationMetadata parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.iam.v3.OperationMetadata parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.iam.v3.OperationMetadata parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.iam.v3.OperationMetadata parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.iam.v3.OperationMetadata parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.iam.v3.OperationMetadata parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.iam.v3.OperationMetadata parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.iam.v3.OperationMetadata 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
        +   * Represents the metadata of the long-running operation.
        +   * 
        + * + * Protobuf type {@code google.iam.v3.OperationMetadata} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.iam.v3.OperationMetadata) + com.google.iam.v3.OperationMetadataOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.iam.v3.OperationMetadataProto + .internal_static_google_iam_v3_OperationMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.iam.v3.OperationMetadataProto + .internal_static_google_iam_v3_OperationMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.iam.v3.OperationMetadata.class, + com.google.iam.v3.OperationMetadata.Builder.class); + } + + // Construct using com.google.iam.v3.OperationMetadata.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetCreateTimeFieldBuilder(); + internalGetEndTimeFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + createTime_ = null; + if (createTimeBuilder_ != null) { + createTimeBuilder_.dispose(); + createTimeBuilder_ = null; + } + endTime_ = null; + if (endTimeBuilder_ != null) { + endTimeBuilder_.dispose(); + endTimeBuilder_ = null; + } + target_ = ""; + verb_ = ""; + statusMessage_ = ""; + requestedCancellation_ = false; + apiVersion_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.iam.v3.OperationMetadataProto + .internal_static_google_iam_v3_OperationMetadata_descriptor; + } + + @java.lang.Override + public com.google.iam.v3.OperationMetadata getDefaultInstanceForType() { + return com.google.iam.v3.OperationMetadata.getDefaultInstance(); + } + + @java.lang.Override + public com.google.iam.v3.OperationMetadata build() { + com.google.iam.v3.OperationMetadata result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.iam.v3.OperationMetadata buildPartial() { + com.google.iam.v3.OperationMetadata result = new com.google.iam.v3.OperationMetadata(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.iam.v3.OperationMetadata result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.createTime_ = createTimeBuilder_ == null ? createTime_ : createTimeBuilder_.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.target_ = target_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.verb_ = verb_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.statusMessage_ = statusMessage_; + } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.requestedCancellation_ = requestedCancellation_; + } + if (((from_bitField0_ & 0x00000040) != 0)) { + result.apiVersion_ = apiVersion_; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.iam.v3.OperationMetadata) { + return mergeFrom((com.google.iam.v3.OperationMetadata) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.iam.v3.OperationMetadata other) { + if (other == com.google.iam.v3.OperationMetadata.getDefaultInstance()) return this; + if (other.hasCreateTime()) { + mergeCreateTime(other.getCreateTime()); + } + if (other.hasEndTime()) { + mergeEndTime(other.getEndTime()); + } + if (!other.getTarget().isEmpty()) { + target_ = other.target_; + bitField0_ |= 0x00000004; + onChanged(); + } + if (!other.getVerb().isEmpty()) { + verb_ = other.verb_; + bitField0_ |= 0x00000008; + onChanged(); + } + if (!other.getStatusMessage().isEmpty()) { + statusMessage_ = other.statusMessage_; + bitField0_ |= 0x00000010; + onChanged(); + } + if (other.getRequestedCancellation() != false) { + setRequestedCancellation(other.getRequestedCancellation()); + } + if (!other.getApiVersion().isEmpty()) { + apiVersion_ = other.apiVersion_; + 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( + internalGetCreateTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + input.readMessage(internalGetEndTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + target_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 34: + { + verb_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000008; + break; + } // case 34 + case 42: + { + statusMessage_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000010; + break; + } // case 42 + case 48: + { + requestedCancellation_ = input.readBool(); + bitField0_ |= 0x00000020; + break; + } // case 48 + case 58: + { + apiVersion_ = 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 createTime_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + createTimeBuilder_; + + /** + * + * + *
        +     * Output only. The time the operation was created.
        +     * 
        + * + * + * .google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the createTime field is set. + */ + public boolean hasCreateTime() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
        +     * Output only. The time the operation was created.
        +     * 
        + * + * + * .google.protobuf.Timestamp create_time = 1 [(.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 time the operation was created.
        +     * 
        + * + * + * .google.protobuf.Timestamp create_time = 1 [(.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_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
        +     * Output only. The time the operation was created.
        +     * 
        + * + * + * .google.protobuf.Timestamp create_time = 1 [(.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_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
        +     * Output only. The time the operation was created.
        +     * 
        + * + * + * .google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeCreateTime(com.google.protobuf.Timestamp value) { + if (createTimeBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) + && createTime_ != null + && createTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getCreateTimeBuilder().mergeFrom(value); + } else { + createTime_ = value; + } + } else { + createTimeBuilder_.mergeFrom(value); + } + if (createTime_ != null) { + bitField0_ |= 0x00000001; + onChanged(); + } + return this; + } + + /** + * + * + *
        +     * Output only. The time the operation was created.
        +     * 
        + * + * + * .google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearCreateTime() { + bitField0_ = (bitField0_ & ~0x00000001); + createTime_ = null; + if (createTimeBuilder_ != null) { + createTimeBuilder_.dispose(); + createTimeBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
        +     * Output only. The time the operation was created.
        +     * 
        + * + * + * .google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.Timestamp.Builder getCreateTimeBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return internalGetCreateTimeFieldBuilder().getBuilder(); + } + + /** + * + * + *
        +     * Output only. The time the operation was created.
        +     * 
        + * + * + * .google.protobuf.Timestamp create_time = 1 [(.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 time the operation was created.
        +     * 
        + * + * + * .google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + internalGetCreateTimeFieldBuilder() { + if (createTimeBuilder_ == null) { + createTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + 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 endTime_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + endTimeBuilder_; + + /** + * + * + *
        +     * Output only. The time the operation finished running.
        +     * 
        + * + * .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the endTime field is set. + */ + public boolean hasEndTime() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
        +     * Output only. The time the operation finished running.
        +     * 
        + * + * .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @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(); + } + } + + /** + * + * + *
        +     * Output only. The time the operation finished running.
        +     * 
        + * + * .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + 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; + } + + /** + * + * + *
        +     * Output only. The time the operation finished running.
        +     * 
        + * + * .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + 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; + } + + /** + * + * + *
        +     * Output only. The time the operation finished running.
        +     * 
        + * + * .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + 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; + } + + /** + * + * + *
        +     * Output only. The time the operation finished running.
        +     * 
        + * + * .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearEndTime() { + bitField0_ = (bitField0_ & ~0x00000002); + endTime_ = null; + if (endTimeBuilder_ != null) { + endTimeBuilder_.dispose(); + endTimeBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
        +     * Output only. The time the operation finished running.
        +     * 
        + * + * .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.Timestamp.Builder getEndTimeBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return internalGetEndTimeFieldBuilder().getBuilder(); + } + + /** + * + * + *
        +     * Output only. The time the operation finished running.
        +     * 
        + * + * .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.TimestampOrBuilder getEndTimeOrBuilder() { + if (endTimeBuilder_ != null) { + return endTimeBuilder_.getMessageOrBuilder(); + } else { + return endTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : endTime_; + } + } + + /** + * + * + *
        +     * Output only. The time the operation finished running.
        +     * 
        + * + * .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + internalGetEndTimeFieldBuilder() { + if (endTimeBuilder_ == null) { + endTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getEndTime(), getParentForChildren(), isClean()); + endTime_ = null; + } + return endTimeBuilder_; + } + + private java.lang.Object target_ = ""; + + /** + * + * + *
        +     * Output only. Server-defined resource path for the target of the
        +     * 
        + * + * string target = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The target. + */ + public java.lang.String getTarget() { + java.lang.Object ref = target_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + target_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
        +     * Output only. Server-defined resource path for the target of the
        +     * 
        + * + * string target = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for target. + */ + public com.google.protobuf.ByteString getTargetBytes() { + java.lang.Object ref = target_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + target_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
        +     * Output only. Server-defined resource path for the target of the
        +     * 
        + * + * string target = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The target to set. + * @return This builder for chaining. + */ + public Builder setTarget(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + target_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
        +     * Output only. Server-defined resource path for the target of the
        +     * 
        + * + * string target = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearTarget() { + target_ = getDefaultInstance().getTarget(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + + /** + * + * + *
        +     * Output only. Server-defined resource path for the target of the
        +     * 
        + * + * string target = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The bytes for target to set. + * @return This builder for chaining. + */ + public Builder setTargetBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + target_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + private java.lang.Object verb_ = ""; + + /** + * + * + *
        +     * Output only. Name of the verb executed by the operation.
        +     * 
        + * + * string verb = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The verb. + */ + public java.lang.String getVerb() { + java.lang.Object ref = verb_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + verb_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
        +     * Output only. Name of the verb executed by the operation.
        +     * 
        + * + * string verb = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for verb. + */ + public com.google.protobuf.ByteString getVerbBytes() { + java.lang.Object ref = verb_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + verb_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
        +     * Output only. Name of the verb executed by the operation.
        +     * 
        + * + * string verb = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The verb to set. + * @return This builder for chaining. + */ + public Builder setVerb(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + verb_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + /** + * + * + *
        +     * Output only. Name of the verb executed by the operation.
        +     * 
        + * + * string verb = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearVerb() { + verb_ = getDefaultInstance().getVerb(); + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + return this; + } + + /** + * + * + *
        +     * Output only. Name of the verb executed by the operation.
        +     * 
        + * + * string verb = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The bytes for verb to set. + * @return This builder for chaining. + */ + public Builder setVerbBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + verb_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + private java.lang.Object statusMessage_ = ""; + + /** + * + * + *
        +     * Output only. Human-readable status of the operation, if any.
        +     * 
        + * + * string status_message = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The statusMessage. + */ + public java.lang.String getStatusMessage() { + java.lang.Object ref = statusMessage_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + statusMessage_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
        +     * Output only. Human-readable status of the operation, if any.
        +     * 
        + * + * string status_message = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for statusMessage. + */ + public com.google.protobuf.ByteString getStatusMessageBytes() { + java.lang.Object ref = statusMessage_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + statusMessage_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
        +     * Output only. Human-readable status of the operation, if any.
        +     * 
        + * + * string status_message = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The statusMessage to set. + * @return This builder for chaining. + */ + public Builder setStatusMessage(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + statusMessage_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + /** + * + * + *
        +     * Output only. Human-readable status of the operation, if any.
        +     * 
        + * + * string status_message = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearStatusMessage() { + statusMessage_ = getDefaultInstance().getStatusMessage(); + bitField0_ = (bitField0_ & ~0x00000010); + onChanged(); + return this; + } + + /** + * + * + *
        +     * Output only. Human-readable status of the operation, if any.
        +     * 
        + * + * string status_message = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The bytes for statusMessage to set. + * @return This builder for chaining. + */ + public Builder setStatusMessageBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + statusMessage_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + private boolean requestedCancellation_; + + /** + * + * + *
        +     * Output only. Identifies whether the user has requested cancellation
        +     * of the operation. Operations that have successfully been cancelled
        +     * have [Operation.error][] value with a
        +     * [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to
        +     * `Code.CANCELLED`.
        +     * 
        + * + * bool requested_cancellation = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The requestedCancellation. + */ + @java.lang.Override + public boolean getRequestedCancellation() { + return requestedCancellation_; + } + + /** + * + * + *
        +     * Output only. Identifies whether the user has requested cancellation
        +     * of the operation. Operations that have successfully been cancelled
        +     * have [Operation.error][] value with a
        +     * [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to
        +     * `Code.CANCELLED`.
        +     * 
        + * + * bool requested_cancellation = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The requestedCancellation to set. + * @return This builder for chaining. + */ + public Builder setRequestedCancellation(boolean value) { + + requestedCancellation_ = value; + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + + /** + * + * + *
        +     * Output only. Identifies whether the user has requested cancellation
        +     * of the operation. Operations that have successfully been cancelled
        +     * have [Operation.error][] value with a
        +     * [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to
        +     * `Code.CANCELLED`.
        +     * 
        + * + * bool requested_cancellation = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearRequestedCancellation() { + bitField0_ = (bitField0_ & ~0x00000020); + requestedCancellation_ = false; + onChanged(); + return this; + } + + private java.lang.Object apiVersion_ = ""; + + /** + * + * + *
        +     * Output only. API version used to start the operation.
        +     * 
        + * + * string api_version = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The apiVersion. + */ + public java.lang.String getApiVersion() { + java.lang.Object ref = apiVersion_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + apiVersion_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
        +     * Output only. API version used to start the operation.
        +     * 
        + * + * string api_version = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for apiVersion. + */ + public com.google.protobuf.ByteString getApiVersionBytes() { + java.lang.Object ref = apiVersion_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + apiVersion_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
        +     * Output only. API version used to start the operation.
        +     * 
        + * + * string api_version = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The apiVersion to set. + * @return This builder for chaining. + */ + public Builder setApiVersion(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + apiVersion_ = value; + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + + /** + * + * + *
        +     * Output only. API version used to start the operation.
        +     * 
        + * + * string api_version = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearApiVersion() { + apiVersion_ = getDefaultInstance().getApiVersion(); + bitField0_ = (bitField0_ & ~0x00000040); + onChanged(); + return this; + } + + /** + * + * + *
        +     * Output only. API version used to start the operation.
        +     * 
        + * + * string api_version = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The bytes for apiVersion to set. + * @return This builder for chaining. + */ + public Builder setApiVersionBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + apiVersion_ = value; + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.iam.v3.OperationMetadata) + } + + // @@protoc_insertion_point(class_scope:google.iam.v3.OperationMetadata) + private static final com.google.iam.v3.OperationMetadata DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.iam.v3.OperationMetadata(); + } + + public static com.google.iam.v3.OperationMetadata getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public OperationMetadata 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.iam.v3.OperationMetadata getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-iam/proto-google-iam-v3/src/main/java/com/google/iam/v3/OperationMetadataOrBuilder.java b/java-iam/proto-google-iam-v3/src/main/java/com/google/iam/v3/OperationMetadataOrBuilder.java new file mode 100644 index 0000000000..be674c40b5 --- /dev/null +++ b/java-iam/proto-google-iam-v3/src/main/java/com/google/iam/v3/OperationMetadataOrBuilder.java @@ -0,0 +1,229 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/iam/v3/operation_metadata.proto +// Protobuf Java Version: 4.33.2 + +package com.google.iam.v3; + +@com.google.protobuf.Generated +public interface OperationMetadataOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.iam.v3.OperationMetadata) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
        +   * Output only. The time the operation was created.
        +   * 
        + * + * .google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the createTime field is set. + */ + boolean hasCreateTime(); + + /** + * + * + *
        +   * Output only. The time the operation was created.
        +   * 
        + * + * .google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The createTime. + */ + com.google.protobuf.Timestamp getCreateTime(); + + /** + * + * + *
        +   * Output only. The time the operation was created.
        +   * 
        + * + * .google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder(); + + /** + * + * + *
        +   * Output only. The time the operation finished running.
        +   * 
        + * + * .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the endTime field is set. + */ + boolean hasEndTime(); + + /** + * + * + *
        +   * Output only. The time the operation finished running.
        +   * 
        + * + * .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The endTime. + */ + com.google.protobuf.Timestamp getEndTime(); + + /** + * + * + *
        +   * Output only. The time the operation finished running.
        +   * 
        + * + * .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.protobuf.TimestampOrBuilder getEndTimeOrBuilder(); + + /** + * + * + *
        +   * Output only. Server-defined resource path for the target of the
        +   * 
        + * + * string target = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The target. + */ + java.lang.String getTarget(); + + /** + * + * + *
        +   * Output only. Server-defined resource path for the target of the
        +   * 
        + * + * string target = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for target. + */ + com.google.protobuf.ByteString getTargetBytes(); + + /** + * + * + *
        +   * Output only. Name of the verb executed by the operation.
        +   * 
        + * + * string verb = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The verb. + */ + java.lang.String getVerb(); + + /** + * + * + *
        +   * Output only. Name of the verb executed by the operation.
        +   * 
        + * + * string verb = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for verb. + */ + com.google.protobuf.ByteString getVerbBytes(); + + /** + * + * + *
        +   * Output only. Human-readable status of the operation, if any.
        +   * 
        + * + * string status_message = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The statusMessage. + */ + java.lang.String getStatusMessage(); + + /** + * + * + *
        +   * Output only. Human-readable status of the operation, if any.
        +   * 
        + * + * string status_message = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for statusMessage. + */ + com.google.protobuf.ByteString getStatusMessageBytes(); + + /** + * + * + *
        +   * Output only. Identifies whether the user has requested cancellation
        +   * of the operation. Operations that have successfully been cancelled
        +   * have [Operation.error][] value with a
        +   * [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to
        +   * `Code.CANCELLED`.
        +   * 
        + * + * bool requested_cancellation = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The requestedCancellation. + */ + boolean getRequestedCancellation(); + + /** + * + * + *
        +   * Output only. API version used to start the operation.
        +   * 
        + * + * string api_version = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The apiVersion. + */ + java.lang.String getApiVersion(); + + /** + * + * + *
        +   * Output only. API version used to start the operation.
        +   * 
        + * + * string api_version = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for apiVersion. + */ + com.google.protobuf.ByteString getApiVersionBytes(); +} diff --git a/java-iam/proto-google-iam-v3/src/main/java/com/google/iam/v3/OperationMetadataProto.java b/java-iam/proto-google-iam-v3/src/main/java/com/google/iam/v3/OperationMetadataProto.java new file mode 100644 index 0000000000..c03fced513 --- /dev/null +++ b/java-iam/proto-google-iam-v3/src/main/java/com/google/iam/v3/OperationMetadataProto.java @@ -0,0 +1,103 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/iam/v3/operation_metadata.proto +// Protobuf Java Version: 4.33.2 + +package com.google.iam.v3; + +@com.google.protobuf.Generated +public final class OperationMetadataProto extends com.google.protobuf.GeneratedFile { + private OperationMetadataProto() {} + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "OperationMetadataProto"); + } + + 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_iam_v3_OperationMetadata_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_iam_v3_OperationMetadata_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/iam/v3/operation_metadata.proto\022\r" + + "google.iam.v3\032\037google/api/field_behavi" + + "or.proto\032\037google/protobuf/timestamp.proto\"\200\002\n" + + "\021OperationMetadata\0224\n" + + "\013create_time\030\001 \001(\0132\032.google.protobuf.TimestampB\003\340A\003\0221\n" + + "\010end_time\030\002 \001(\0132\032.google.protobuf.TimestampB\003\340A\003\022\023\n" + + "\006target\030\003 \001(\tB\003\340A\003\022\021\n" + + "\004verb\030\004 \001(\tB\003\340A\003\022\033\n" + + "\016status_message\030\005 \001(\tB\003\340A\003\022#\n" + + "\026requested_cancellation\030\006 \001(\010B\003\340A\003\022\030\n" + + "\013api_version\030\007 \001(\tB\003\340A\003B\204\001\n" + + "\021com.google.iam.v3B\026OperationMetadataProtoP\001Z)cloud.goog" + + "le.com/go/iam/apiv3/iampb;iampb\252\002\023Google" + + ".Cloud.Iam.V3\312\002\023Google\\Cloud\\Iam\\V3b\006proto3" + }; + descriptor = + com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( + descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + com.google.api.FieldBehaviorProto.getDescriptor(), + com.google.protobuf.TimestampProto.getDescriptor(), + }); + internal_static_google_iam_v3_OperationMetadata_descriptor = getDescriptor().getMessageType(0); + internal_static_google_iam_v3_OperationMetadata_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_iam_v3_OperationMetadata_descriptor, + new java.lang.String[] { + "CreateTime", + "EndTime", + "Target", + "Verb", + "StatusMessage", + "RequestedCancellation", + "ApiVersion", + }); + descriptor.resolveAllFeaturesImmutable(); + com.google.api.FieldBehaviorProto.getDescriptor(); + com.google.protobuf.TimestampProto.getDescriptor(); + com.google.protobuf.ExtensionRegistry registry = + com.google.protobuf.ExtensionRegistry.newInstance(); + registry.add(com.google.api.FieldBehaviorProto.fieldBehavior); + com.google.protobuf.Descriptors.FileDescriptor.internalUpdateFileDescriptor( + descriptor, registry); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/java-iam/proto-google-iam-v3/src/main/java/com/google/iam/v3/OrganizationLocationName.java b/java-iam/proto-google-iam-v3/src/main/java/com/google/iam/v3/OrganizationLocationName.java new file mode 100644 index 0000000000..a0cdbb6aa0 --- /dev/null +++ b/java-iam/proto-google-iam-v3/src/main/java/com/google/iam/v3/OrganizationLocationName.java @@ -0,0 +1,192 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.iam.v3; + +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-iam/proto-google-iam-v3/src/main/java/com/google/iam/v3/PolicyBinding.java b/java-iam/proto-google-iam-v3/src/main/java/com/google/iam/v3/PolicyBinding.java new file mode 100644 index 0000000000..b74105548e --- /dev/null +++ b/java-iam/proto-google-iam-v3/src/main/java/com/google/iam/v3/PolicyBinding.java @@ -0,0 +1,5005 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/iam/v3/policy_binding_resources.proto +// Protobuf Java Version: 4.33.2 + +package com.google.iam.v3; + +/** + * + * + *
        + * IAM policy binding resource.
        + * 
        + * + * Protobuf type {@code google.iam.v3.PolicyBinding} + */ +@com.google.protobuf.Generated +public final class PolicyBinding extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.iam.v3.PolicyBinding) + PolicyBindingOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "PolicyBinding"); + } + + // Use PolicyBinding.newBuilder() to construct. + private PolicyBinding(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private PolicyBinding() { + name_ = ""; + uid_ = ""; + etag_ = ""; + displayName_ = ""; + policyKind_ = 0; + policy_ = ""; + policyUid_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.iam.v3.PolicyBindingResourcesProto + .internal_static_google_iam_v3_PolicyBinding_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + @java.lang.Override + protected com.google.protobuf.MapFieldReflectionAccessor internalGetMapFieldReflection( + int number) { + switch (number) { + case 5: + return internalGetAnnotations(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.iam.v3.PolicyBindingResourcesProto + .internal_static_google_iam_v3_PolicyBinding_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.iam.v3.PolicyBinding.class, com.google.iam.v3.PolicyBinding.Builder.class); + } + + /** + * + * + *
        +   * Different policy kinds supported in this binding.
        +   * 
        + * + * Protobuf enum {@code google.iam.v3.PolicyBinding.PolicyKind} + */ + public enum PolicyKind implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
        +     * Unspecified policy kind; Not a valid state
        +     * 
        + * + * POLICY_KIND_UNSPECIFIED = 0; + */ + POLICY_KIND_UNSPECIFIED(0), + /** + * + * + *
        +     * Principal access boundary policy kind
        +     * 
        + * + * PRINCIPAL_ACCESS_BOUNDARY = 1; + */ + PRINCIPAL_ACCESS_BOUNDARY(1), + UNRECOGNIZED(-1), + ; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "PolicyKind"); + } + + /** + * + * + *
        +     * Unspecified policy kind; Not a valid state
        +     * 
        + * + * POLICY_KIND_UNSPECIFIED = 0; + */ + public static final int POLICY_KIND_UNSPECIFIED_VALUE = 0; + + /** + * + * + *
        +     * Principal access boundary policy kind
        +     * 
        + * + * PRINCIPAL_ACCESS_BOUNDARY = 1; + */ + public static final int PRINCIPAL_ACCESS_BOUNDARY_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 PolicyKind 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 PolicyKind forNumber(int value) { + switch (value) { + case 0: + return POLICY_KIND_UNSPECIFIED; + case 1: + return PRINCIPAL_ACCESS_BOUNDARY; + 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 PolicyKind findValueByNumber(int number) { + return PolicyKind.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 com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.iam.v3.PolicyBinding.getDescriptor().getEnumTypes().get(0); + } + + private static final PolicyKind[] VALUES = values(); + + public static PolicyKind 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 PolicyKind(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.iam.v3.PolicyBinding.PolicyKind) + } + + public interface TargetOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.iam.v3.PolicyBinding.Target) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
        +     * Immutable. Full Resource Name used for principal access boundary policy
        +     * bindings. The principal set must be directly parented by the policy
        +     * binding's parent or same as the parent if the target is a
        +     * project/folder/organization.
        +     *
        +     * Examples:
        +     * * For binding's parented by an organization:
        +     * * Organization:
        +     * `//cloudresourcemanager.googleapis.com/organizations/ORGANIZATION_ID`
        +     * * Workforce Identity:
        +     * `//iam.googleapis.com/locations/global/workforcePools/WORKFORCE_POOL_ID`
        +     * * Workspace Identity:
        +     * `//iam.googleapis.com/locations/global/workspace/WORKSPACE_ID`
        +     * * For binding's parented by a folder:
        +     * * Folder:
        +     * `//cloudresourcemanager.googleapis.com/folders/FOLDER_ID`
        +     * * For binding's parented by a project:
        +     * * Project:
        +     * * `//cloudresourcemanager.googleapis.com/projects/PROJECT_NUMBER`
        +     * * `//cloudresourcemanager.googleapis.com/projects/PROJECT_ID`
        +     * * Workload Identity Pool:
        +     * `//iam.googleapis.com/projects/PROJECT_NUMBER/locations/LOCATION/workloadIdentityPools/WORKLOAD_POOL_ID`
        +     * 
        + * + * string principal_set = 1 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @return Whether the principalSet field is set. + */ + boolean hasPrincipalSet(); + + /** + * + * + *
        +     * Immutable. Full Resource Name used for principal access boundary policy
        +     * bindings. The principal set must be directly parented by the policy
        +     * binding's parent or same as the parent if the target is a
        +     * project/folder/organization.
        +     *
        +     * Examples:
        +     * * For binding's parented by an organization:
        +     * * Organization:
        +     * `//cloudresourcemanager.googleapis.com/organizations/ORGANIZATION_ID`
        +     * * Workforce Identity:
        +     * `//iam.googleapis.com/locations/global/workforcePools/WORKFORCE_POOL_ID`
        +     * * Workspace Identity:
        +     * `//iam.googleapis.com/locations/global/workspace/WORKSPACE_ID`
        +     * * For binding's parented by a folder:
        +     * * Folder:
        +     * `//cloudresourcemanager.googleapis.com/folders/FOLDER_ID`
        +     * * For binding's parented by a project:
        +     * * Project:
        +     * * `//cloudresourcemanager.googleapis.com/projects/PROJECT_NUMBER`
        +     * * `//cloudresourcemanager.googleapis.com/projects/PROJECT_ID`
        +     * * Workload Identity Pool:
        +     * `//iam.googleapis.com/projects/PROJECT_NUMBER/locations/LOCATION/workloadIdentityPools/WORKLOAD_POOL_ID`
        +     * 
        + * + * string principal_set = 1 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @return The principalSet. + */ + java.lang.String getPrincipalSet(); + + /** + * + * + *
        +     * Immutable. Full Resource Name used for principal access boundary policy
        +     * bindings. The principal set must be directly parented by the policy
        +     * binding's parent or same as the parent if the target is a
        +     * project/folder/organization.
        +     *
        +     * Examples:
        +     * * For binding's parented by an organization:
        +     * * Organization:
        +     * `//cloudresourcemanager.googleapis.com/organizations/ORGANIZATION_ID`
        +     * * Workforce Identity:
        +     * `//iam.googleapis.com/locations/global/workforcePools/WORKFORCE_POOL_ID`
        +     * * Workspace Identity:
        +     * `//iam.googleapis.com/locations/global/workspace/WORKSPACE_ID`
        +     * * For binding's parented by a folder:
        +     * * Folder:
        +     * `//cloudresourcemanager.googleapis.com/folders/FOLDER_ID`
        +     * * For binding's parented by a project:
        +     * * Project:
        +     * * `//cloudresourcemanager.googleapis.com/projects/PROJECT_NUMBER`
        +     * * `//cloudresourcemanager.googleapis.com/projects/PROJECT_ID`
        +     * * Workload Identity Pool:
        +     * `//iam.googleapis.com/projects/PROJECT_NUMBER/locations/LOCATION/workloadIdentityPools/WORKLOAD_POOL_ID`
        +     * 
        + * + * string principal_set = 1 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @return The bytes for principalSet. + */ + com.google.protobuf.ByteString getPrincipalSetBytes(); + + com.google.iam.v3.PolicyBinding.Target.TargetCase getTargetCase(); + } + + /** + * + * + *
        +   * Target is the full resource name of the resource to which the policy will
        +   * be bound. Immutable once set.
        +   * 
        + * + * Protobuf type {@code google.iam.v3.PolicyBinding.Target} + */ + public static final class Target extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.iam.v3.PolicyBinding.Target) + TargetOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "Target"); + } + + // Use Target.newBuilder() to construct. + private Target(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private Target() {} + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.iam.v3.PolicyBindingResourcesProto + .internal_static_google_iam_v3_PolicyBinding_Target_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.iam.v3.PolicyBindingResourcesProto + .internal_static_google_iam_v3_PolicyBinding_Target_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.iam.v3.PolicyBinding.Target.class, + com.google.iam.v3.PolicyBinding.Target.Builder.class); + } + + private int targetCase_ = 0; + + @SuppressWarnings("serial") + private java.lang.Object target_; + + public enum TargetCase + implements + com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + PRINCIPAL_SET(1), + TARGET_NOT_SET(0); + private final int value; + + private TargetCase(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 TargetCase valueOf(int value) { + return forNumber(value); + } + + public static TargetCase forNumber(int value) { + switch (value) { + case 1: + return PRINCIPAL_SET; + case 0: + return TARGET_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public TargetCase getTargetCase() { + return TargetCase.forNumber(targetCase_); + } + + public static final int PRINCIPAL_SET_FIELD_NUMBER = 1; + + /** + * + * + *
        +     * Immutable. Full Resource Name used for principal access boundary policy
        +     * bindings. The principal set must be directly parented by the policy
        +     * binding's parent or same as the parent if the target is a
        +     * project/folder/organization.
        +     *
        +     * Examples:
        +     * * For binding's parented by an organization:
        +     * * Organization:
        +     * `//cloudresourcemanager.googleapis.com/organizations/ORGANIZATION_ID`
        +     * * Workforce Identity:
        +     * `//iam.googleapis.com/locations/global/workforcePools/WORKFORCE_POOL_ID`
        +     * * Workspace Identity:
        +     * `//iam.googleapis.com/locations/global/workspace/WORKSPACE_ID`
        +     * * For binding's parented by a folder:
        +     * * Folder:
        +     * `//cloudresourcemanager.googleapis.com/folders/FOLDER_ID`
        +     * * For binding's parented by a project:
        +     * * Project:
        +     * * `//cloudresourcemanager.googleapis.com/projects/PROJECT_NUMBER`
        +     * * `//cloudresourcemanager.googleapis.com/projects/PROJECT_ID`
        +     * * Workload Identity Pool:
        +     * `//iam.googleapis.com/projects/PROJECT_NUMBER/locations/LOCATION/workloadIdentityPools/WORKLOAD_POOL_ID`
        +     * 
        + * + * string principal_set = 1 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @return Whether the principalSet field is set. + */ + public boolean hasPrincipalSet() { + return targetCase_ == 1; + } + + /** + * + * + *
        +     * Immutable. Full Resource Name used for principal access boundary policy
        +     * bindings. The principal set must be directly parented by the policy
        +     * binding's parent or same as the parent if the target is a
        +     * project/folder/organization.
        +     *
        +     * Examples:
        +     * * For binding's parented by an organization:
        +     * * Organization:
        +     * `//cloudresourcemanager.googleapis.com/organizations/ORGANIZATION_ID`
        +     * * Workforce Identity:
        +     * `//iam.googleapis.com/locations/global/workforcePools/WORKFORCE_POOL_ID`
        +     * * Workspace Identity:
        +     * `//iam.googleapis.com/locations/global/workspace/WORKSPACE_ID`
        +     * * For binding's parented by a folder:
        +     * * Folder:
        +     * `//cloudresourcemanager.googleapis.com/folders/FOLDER_ID`
        +     * * For binding's parented by a project:
        +     * * Project:
        +     * * `//cloudresourcemanager.googleapis.com/projects/PROJECT_NUMBER`
        +     * * `//cloudresourcemanager.googleapis.com/projects/PROJECT_ID`
        +     * * Workload Identity Pool:
        +     * `//iam.googleapis.com/projects/PROJECT_NUMBER/locations/LOCATION/workloadIdentityPools/WORKLOAD_POOL_ID`
        +     * 
        + * + * string principal_set = 1 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @return The principalSet. + */ + public java.lang.String getPrincipalSet() { + java.lang.Object ref = ""; + if (targetCase_ == 1) { + ref = target_; + } + 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 (targetCase_ == 1) { + target_ = s; + } + return s; + } + } + + /** + * + * + *
        +     * Immutable. Full Resource Name used for principal access boundary policy
        +     * bindings. The principal set must be directly parented by the policy
        +     * binding's parent or same as the parent if the target is a
        +     * project/folder/organization.
        +     *
        +     * Examples:
        +     * * For binding's parented by an organization:
        +     * * Organization:
        +     * `//cloudresourcemanager.googleapis.com/organizations/ORGANIZATION_ID`
        +     * * Workforce Identity:
        +     * `//iam.googleapis.com/locations/global/workforcePools/WORKFORCE_POOL_ID`
        +     * * Workspace Identity:
        +     * `//iam.googleapis.com/locations/global/workspace/WORKSPACE_ID`
        +     * * For binding's parented by a folder:
        +     * * Folder:
        +     * `//cloudresourcemanager.googleapis.com/folders/FOLDER_ID`
        +     * * For binding's parented by a project:
        +     * * Project:
        +     * * `//cloudresourcemanager.googleapis.com/projects/PROJECT_NUMBER`
        +     * * `//cloudresourcemanager.googleapis.com/projects/PROJECT_ID`
        +     * * Workload Identity Pool:
        +     * `//iam.googleapis.com/projects/PROJECT_NUMBER/locations/LOCATION/workloadIdentityPools/WORKLOAD_POOL_ID`
        +     * 
        + * + * string principal_set = 1 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @return The bytes for principalSet. + */ + public com.google.protobuf.ByteString getPrincipalSetBytes() { + java.lang.Object ref = ""; + if (targetCase_ == 1) { + ref = target_; + } + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + if (targetCase_ == 1) { + target_ = 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 (targetCase_ == 1) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, target_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (targetCase_ == 1) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, target_); + } + 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.iam.v3.PolicyBinding.Target)) { + return super.equals(obj); + } + com.google.iam.v3.PolicyBinding.Target other = (com.google.iam.v3.PolicyBinding.Target) obj; + + if (!getTargetCase().equals(other.getTargetCase())) return false; + switch (targetCase_) { + case 1: + if (!getPrincipalSet().equals(other.getPrincipalSet())) 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(); + switch (targetCase_) { + case 1: + hash = (37 * hash) + PRINCIPAL_SET_FIELD_NUMBER; + hash = (53 * hash) + getPrincipalSet().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.iam.v3.PolicyBinding.Target parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.iam.v3.PolicyBinding.Target parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.iam.v3.PolicyBinding.Target parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.iam.v3.PolicyBinding.Target 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.iam.v3.PolicyBinding.Target parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.iam.v3.PolicyBinding.Target parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.iam.v3.PolicyBinding.Target parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.iam.v3.PolicyBinding.Target parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.iam.v3.PolicyBinding.Target parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.iam.v3.PolicyBinding.Target parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.iam.v3.PolicyBinding.Target parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.iam.v3.PolicyBinding.Target parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.iam.v3.PolicyBinding.Target 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
        +     * Target is the full resource name of the resource to which the policy will
        +     * be bound. Immutable once set.
        +     * 
        + * + * Protobuf type {@code google.iam.v3.PolicyBinding.Target} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.iam.v3.PolicyBinding.Target) + com.google.iam.v3.PolicyBinding.TargetOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.iam.v3.PolicyBindingResourcesProto + .internal_static_google_iam_v3_PolicyBinding_Target_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.iam.v3.PolicyBindingResourcesProto + .internal_static_google_iam_v3_PolicyBinding_Target_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.iam.v3.PolicyBinding.Target.class, + com.google.iam.v3.PolicyBinding.Target.Builder.class); + } + + // Construct using com.google.iam.v3.PolicyBinding.Target.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + targetCase_ = 0; + target_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.iam.v3.PolicyBindingResourcesProto + .internal_static_google_iam_v3_PolicyBinding_Target_descriptor; + } + + @java.lang.Override + public com.google.iam.v3.PolicyBinding.Target getDefaultInstanceForType() { + return com.google.iam.v3.PolicyBinding.Target.getDefaultInstance(); + } + + @java.lang.Override + public com.google.iam.v3.PolicyBinding.Target build() { + com.google.iam.v3.PolicyBinding.Target result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.iam.v3.PolicyBinding.Target buildPartial() { + com.google.iam.v3.PolicyBinding.Target result = + new com.google.iam.v3.PolicyBinding.Target(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + buildPartialOneofs(result); + onBuilt(); + return result; + } + + private void buildPartial0(com.google.iam.v3.PolicyBinding.Target result) { + int from_bitField0_ = bitField0_; + } + + private void buildPartialOneofs(com.google.iam.v3.PolicyBinding.Target result) { + result.targetCase_ = targetCase_; + result.target_ = this.target_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.iam.v3.PolicyBinding.Target) { + return mergeFrom((com.google.iam.v3.PolicyBinding.Target) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.iam.v3.PolicyBinding.Target other) { + if (other == com.google.iam.v3.PolicyBinding.Target.getDefaultInstance()) return this; + switch (other.getTargetCase()) { + case PRINCIPAL_SET: + { + targetCase_ = 1; + target_ = other.target_; + onChanged(); + break; + } + case TARGET_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: + { + java.lang.String s = input.readStringRequireUtf8(); + targetCase_ = 1; + target_ = s; + 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 targetCase_ = 0; + private java.lang.Object target_; + + public TargetCase getTargetCase() { + return TargetCase.forNumber(targetCase_); + } + + public Builder clearTarget() { + targetCase_ = 0; + target_ = null; + onChanged(); + return this; + } + + private int bitField0_; + + /** + * + * + *
        +       * Immutable. Full Resource Name used for principal access boundary policy
        +       * bindings. The principal set must be directly parented by the policy
        +       * binding's parent or same as the parent if the target is a
        +       * project/folder/organization.
        +       *
        +       * Examples:
        +       * * For binding's parented by an organization:
        +       * * Organization:
        +       * `//cloudresourcemanager.googleapis.com/organizations/ORGANIZATION_ID`
        +       * * Workforce Identity:
        +       * `//iam.googleapis.com/locations/global/workforcePools/WORKFORCE_POOL_ID`
        +       * * Workspace Identity:
        +       * `//iam.googleapis.com/locations/global/workspace/WORKSPACE_ID`
        +       * * For binding's parented by a folder:
        +       * * Folder:
        +       * `//cloudresourcemanager.googleapis.com/folders/FOLDER_ID`
        +       * * For binding's parented by a project:
        +       * * Project:
        +       * * `//cloudresourcemanager.googleapis.com/projects/PROJECT_NUMBER`
        +       * * `//cloudresourcemanager.googleapis.com/projects/PROJECT_ID`
        +       * * Workload Identity Pool:
        +       * `//iam.googleapis.com/projects/PROJECT_NUMBER/locations/LOCATION/workloadIdentityPools/WORKLOAD_POOL_ID`
        +       * 
        + * + * string principal_set = 1 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @return Whether the principalSet field is set. + */ + @java.lang.Override + public boolean hasPrincipalSet() { + return targetCase_ == 1; + } + + /** + * + * + *
        +       * Immutable. Full Resource Name used for principal access boundary policy
        +       * bindings. The principal set must be directly parented by the policy
        +       * binding's parent or same as the parent if the target is a
        +       * project/folder/organization.
        +       *
        +       * Examples:
        +       * * For binding's parented by an organization:
        +       * * Organization:
        +       * `//cloudresourcemanager.googleapis.com/organizations/ORGANIZATION_ID`
        +       * * Workforce Identity:
        +       * `//iam.googleapis.com/locations/global/workforcePools/WORKFORCE_POOL_ID`
        +       * * Workspace Identity:
        +       * `//iam.googleapis.com/locations/global/workspace/WORKSPACE_ID`
        +       * * For binding's parented by a folder:
        +       * * Folder:
        +       * `//cloudresourcemanager.googleapis.com/folders/FOLDER_ID`
        +       * * For binding's parented by a project:
        +       * * Project:
        +       * * `//cloudresourcemanager.googleapis.com/projects/PROJECT_NUMBER`
        +       * * `//cloudresourcemanager.googleapis.com/projects/PROJECT_ID`
        +       * * Workload Identity Pool:
        +       * `//iam.googleapis.com/projects/PROJECT_NUMBER/locations/LOCATION/workloadIdentityPools/WORKLOAD_POOL_ID`
        +       * 
        + * + * string principal_set = 1 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @return The principalSet. + */ + @java.lang.Override + public java.lang.String getPrincipalSet() { + java.lang.Object ref = ""; + if (targetCase_ == 1) { + ref = target_; + } + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (targetCase_ == 1) { + target_ = s; + } + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
        +       * Immutable. Full Resource Name used for principal access boundary policy
        +       * bindings. The principal set must be directly parented by the policy
        +       * binding's parent or same as the parent if the target is a
        +       * project/folder/organization.
        +       *
        +       * Examples:
        +       * * For binding's parented by an organization:
        +       * * Organization:
        +       * `//cloudresourcemanager.googleapis.com/organizations/ORGANIZATION_ID`
        +       * * Workforce Identity:
        +       * `//iam.googleapis.com/locations/global/workforcePools/WORKFORCE_POOL_ID`
        +       * * Workspace Identity:
        +       * `//iam.googleapis.com/locations/global/workspace/WORKSPACE_ID`
        +       * * For binding's parented by a folder:
        +       * * Folder:
        +       * `//cloudresourcemanager.googleapis.com/folders/FOLDER_ID`
        +       * * For binding's parented by a project:
        +       * * Project:
        +       * * `//cloudresourcemanager.googleapis.com/projects/PROJECT_NUMBER`
        +       * * `//cloudresourcemanager.googleapis.com/projects/PROJECT_ID`
        +       * * Workload Identity Pool:
        +       * `//iam.googleapis.com/projects/PROJECT_NUMBER/locations/LOCATION/workloadIdentityPools/WORKLOAD_POOL_ID`
        +       * 
        + * + * string principal_set = 1 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @return The bytes for principalSet. + */ + @java.lang.Override + public com.google.protobuf.ByteString getPrincipalSetBytes() { + java.lang.Object ref = ""; + if (targetCase_ == 1) { + ref = target_; + } + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + if (targetCase_ == 1) { + target_ = b; + } + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
        +       * Immutable. Full Resource Name used for principal access boundary policy
        +       * bindings. The principal set must be directly parented by the policy
        +       * binding's parent or same as the parent if the target is a
        +       * project/folder/organization.
        +       *
        +       * Examples:
        +       * * For binding's parented by an organization:
        +       * * Organization:
        +       * `//cloudresourcemanager.googleapis.com/organizations/ORGANIZATION_ID`
        +       * * Workforce Identity:
        +       * `//iam.googleapis.com/locations/global/workforcePools/WORKFORCE_POOL_ID`
        +       * * Workspace Identity:
        +       * `//iam.googleapis.com/locations/global/workspace/WORKSPACE_ID`
        +       * * For binding's parented by a folder:
        +       * * Folder:
        +       * `//cloudresourcemanager.googleapis.com/folders/FOLDER_ID`
        +       * * For binding's parented by a project:
        +       * * Project:
        +       * * `//cloudresourcemanager.googleapis.com/projects/PROJECT_NUMBER`
        +       * * `//cloudresourcemanager.googleapis.com/projects/PROJECT_ID`
        +       * * Workload Identity Pool:
        +       * `//iam.googleapis.com/projects/PROJECT_NUMBER/locations/LOCATION/workloadIdentityPools/WORKLOAD_POOL_ID`
        +       * 
        + * + * string principal_set = 1 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @param value The principalSet to set. + * @return This builder for chaining. + */ + public Builder setPrincipalSet(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + targetCase_ = 1; + target_ = value; + onChanged(); + return this; + } + + /** + * + * + *
        +       * Immutable. Full Resource Name used for principal access boundary policy
        +       * bindings. The principal set must be directly parented by the policy
        +       * binding's parent or same as the parent if the target is a
        +       * project/folder/organization.
        +       *
        +       * Examples:
        +       * * For binding's parented by an organization:
        +       * * Organization:
        +       * `//cloudresourcemanager.googleapis.com/organizations/ORGANIZATION_ID`
        +       * * Workforce Identity:
        +       * `//iam.googleapis.com/locations/global/workforcePools/WORKFORCE_POOL_ID`
        +       * * Workspace Identity:
        +       * `//iam.googleapis.com/locations/global/workspace/WORKSPACE_ID`
        +       * * For binding's parented by a folder:
        +       * * Folder:
        +       * `//cloudresourcemanager.googleapis.com/folders/FOLDER_ID`
        +       * * For binding's parented by a project:
        +       * * Project:
        +       * * `//cloudresourcemanager.googleapis.com/projects/PROJECT_NUMBER`
        +       * * `//cloudresourcemanager.googleapis.com/projects/PROJECT_ID`
        +       * * Workload Identity Pool:
        +       * `//iam.googleapis.com/projects/PROJECT_NUMBER/locations/LOCATION/workloadIdentityPools/WORKLOAD_POOL_ID`
        +       * 
        + * + * string principal_set = 1 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @return This builder for chaining. + */ + public Builder clearPrincipalSet() { + if (targetCase_ == 1) { + targetCase_ = 0; + target_ = null; + onChanged(); + } + return this; + } + + /** + * + * + *
        +       * Immutable. Full Resource Name used for principal access boundary policy
        +       * bindings. The principal set must be directly parented by the policy
        +       * binding's parent or same as the parent if the target is a
        +       * project/folder/organization.
        +       *
        +       * Examples:
        +       * * For binding's parented by an organization:
        +       * * Organization:
        +       * `//cloudresourcemanager.googleapis.com/organizations/ORGANIZATION_ID`
        +       * * Workforce Identity:
        +       * `//iam.googleapis.com/locations/global/workforcePools/WORKFORCE_POOL_ID`
        +       * * Workspace Identity:
        +       * `//iam.googleapis.com/locations/global/workspace/WORKSPACE_ID`
        +       * * For binding's parented by a folder:
        +       * * Folder:
        +       * `//cloudresourcemanager.googleapis.com/folders/FOLDER_ID`
        +       * * For binding's parented by a project:
        +       * * Project:
        +       * * `//cloudresourcemanager.googleapis.com/projects/PROJECT_NUMBER`
        +       * * `//cloudresourcemanager.googleapis.com/projects/PROJECT_ID`
        +       * * Workload Identity Pool:
        +       * `//iam.googleapis.com/projects/PROJECT_NUMBER/locations/LOCATION/workloadIdentityPools/WORKLOAD_POOL_ID`
        +       * 
        + * + * string principal_set = 1 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @param value The bytes for principalSet to set. + * @return This builder for chaining. + */ + public Builder setPrincipalSetBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + targetCase_ = 1; + target_ = value; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.iam.v3.PolicyBinding.Target) + } + + // @@protoc_insertion_point(class_scope:google.iam.v3.PolicyBinding.Target) + private static final com.google.iam.v3.PolicyBinding.Target DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.iam.v3.PolicyBinding.Target(); + } + + public static com.google.iam.v3.PolicyBinding.Target getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Target 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.iam.v3.PolicyBinding.Target getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + private int bitField0_; + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + + /** + * + * + *
        +   * Identifier. The name of the policy binding, in the format
        +   * `{binding_parent/locations/{location}/policyBindings/{policy_binding_id}`.
        +   * The binding parent is the closest Resource Manager resource (project,
        +   * folder, or organization) to the binding target.
        +   *
        +   * Format:
        +   *
        +   * * `projects/{project_id}/locations/{location}/policyBindings/{policy_binding_id}`
        +   * * `projects/{project_number}/locations/{location}/policyBindings/{policy_binding_id}`
        +   * * `folders/{folder_id}/locations/{location}/policyBindings/{policy_binding_id}`
        +   * * `organizations/{organization_id}/locations/{location}/policyBindings/{policy_binding_id}`
        +   * 
        + * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @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; + } + } + + /** + * + * + *
        +   * Identifier. The name of the policy binding, in the format
        +   * `{binding_parent/locations/{location}/policyBindings/{policy_binding_id}`.
        +   * The binding parent is the closest Resource Manager resource (project,
        +   * folder, or organization) to the binding target.
        +   *
        +   * Format:
        +   *
        +   * * `projects/{project_id}/locations/{location}/policyBindings/{policy_binding_id}`
        +   * * `projects/{project_number}/locations/{location}/policyBindings/{policy_binding_id}`
        +   * * `folders/{folder_id}/locations/{location}/policyBindings/{policy_binding_id}`
        +   * * `organizations/{organization_id}/locations/{location}/policyBindings/{policy_binding_id}`
        +   * 
        + * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @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 UID_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object uid_ = ""; + + /** + * + * + *
        +   * Output only. The globally unique ID of the policy binding. Assigned when
        +   * the policy binding is created.
        +   * 
        + * + * + * string uid = 2 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_info) = { ... } + * + * + * @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; + } + } + + /** + * + * + *
        +   * Output only. The globally unique ID of the policy binding. Assigned when
        +   * the policy binding is created.
        +   * 
        + * + * + * string uid = 2 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_info) = { ... } + * + * + * @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 ETAG_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object etag_ = ""; + + /** + * + * + *
        +   * Optional. The etag for the policy binding.
        +   * If this is provided on update, it must match the server's etag.
        +   * 
        + * + * string etag = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The etag. + */ + @java.lang.Override + public java.lang.String getEtag() { + java.lang.Object ref = etag_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + etag_ = s; + return s; + } + } + + /** + * + * + *
        +   * Optional. The etag for the policy binding.
        +   * If this is provided on update, it must match the server's etag.
        +   * 
        + * + * string etag = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for etag. + */ + @java.lang.Override + public com.google.protobuf.ByteString getEtagBytes() { + java.lang.Object ref = etag_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + etag_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int DISPLAY_NAME_FIELD_NUMBER = 4; + + @SuppressWarnings("serial") + private volatile java.lang.Object displayName_ = ""; + + /** + * + * + *
        +   * Optional. The description of the policy binding. Must be less than or equal
        +   * to 63 characters.
        +   * 
        + * + * string display_name = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The displayName. + */ + @java.lang.Override + public java.lang.String getDisplayName() { + java.lang.Object ref = displayName_; + 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(); + displayName_ = s; + return s; + } + } + + /** + * + * + *
        +   * Optional. The description of the policy binding. Must be less than or equal
        +   * to 63 characters.
        +   * 
        + * + * string display_name = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for displayName. + */ + @java.lang.Override + public com.google.protobuf.ByteString getDisplayNameBytes() { + java.lang.Object ref = displayName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + displayName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int ANNOTATIONS_FIELD_NUMBER = 5; + + private static final class AnnotationsDefaultEntryHolder { + static final com.google.protobuf.MapEntry defaultEntry = + com.google.protobuf.MapEntry.newDefaultInstance( + com.google.iam.v3.PolicyBindingResourcesProto + .internal_static_google_iam_v3_PolicyBinding_AnnotationsEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.STRING, + ""); + } + + @SuppressWarnings("serial") + private com.google.protobuf.MapField annotations_; + + private com.google.protobuf.MapField + internalGetAnnotations() { + if (annotations_ == null) { + return com.google.protobuf.MapField.emptyMapField(AnnotationsDefaultEntryHolder.defaultEntry); + } + return annotations_; + } + + public int getAnnotationsCount() { + return internalGetAnnotations().getMap().size(); + } + + /** + * + * + *
        +   * Optional. User-defined annotations. See
        +   * https://google.aip.dev/148#annotations for more details such as format and
        +   * size limitations
        +   * 
        + * + * map<string, string> annotations = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public boolean containsAnnotations(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + return internalGetAnnotations().getMap().containsKey(key); + } + + /** Use {@link #getAnnotationsMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getAnnotations() { + return getAnnotationsMap(); + } + + /** + * + * + *
        +   * Optional. User-defined annotations. See
        +   * https://google.aip.dev/148#annotations for more details such as format and
        +   * size limitations
        +   * 
        + * + * map<string, string> annotations = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public java.util.Map getAnnotationsMap() { + return internalGetAnnotations().getMap(); + } + + /** + * + * + *
        +   * Optional. User-defined annotations. See
        +   * https://google.aip.dev/148#annotations for more details such as format and
        +   * size limitations
        +   * 
        + * + * map<string, string> annotations = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public /* nullable */ java.lang.String getAnnotationsOrDefault( + java.lang.String key, + /* nullable */ + java.lang.String defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetAnnotations().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + + /** + * + * + *
        +   * Optional. User-defined annotations. See
        +   * https://google.aip.dev/148#annotations for more details such as format and
        +   * size limitations
        +   * 
        + * + * map<string, string> annotations = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public java.lang.String getAnnotationsOrThrow(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetAnnotations().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public static final int TARGET_FIELD_NUMBER = 6; + private com.google.iam.v3.PolicyBinding.Target target_; + + /** + * + * + *
        +   * Required. Immutable. Target is the full resource name of the resource to
        +   * which the policy will be bound. Immutable once set.
        +   * 
        + * + * + * .google.iam.v3.PolicyBinding.Target target = 6 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the target field is set. + */ + @java.lang.Override + public boolean hasTarget() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
        +   * Required. Immutable. Target is the full resource name of the resource to
        +   * which the policy will be bound. Immutable once set.
        +   * 
        + * + * + * .google.iam.v3.PolicyBinding.Target target = 6 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = REQUIRED]; + * + * + * @return The target. + */ + @java.lang.Override + public com.google.iam.v3.PolicyBinding.Target getTarget() { + return target_ == null ? com.google.iam.v3.PolicyBinding.Target.getDefaultInstance() : target_; + } + + /** + * + * + *
        +   * Required. Immutable. Target is the full resource name of the resource to
        +   * which the policy will be bound. Immutable once set.
        +   * 
        + * + * + * .google.iam.v3.PolicyBinding.Target target = 6 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.iam.v3.PolicyBinding.TargetOrBuilder getTargetOrBuilder() { + return target_ == null ? com.google.iam.v3.PolicyBinding.Target.getDefaultInstance() : target_; + } + + public static final int POLICY_KIND_FIELD_NUMBER = 11; + private int policyKind_ = 0; + + /** + * + * + *
        +   * Immutable. The kind of the policy to attach in this binding. This field
        +   * must be one of the following:
        +   *
        +   * - Left empty (will be automatically set to the policy kind)
        +   * - The input policy kind
        +   * 
        + * + * + * .google.iam.v3.PolicyBinding.PolicyKind policy_kind = 11 [(.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return The enum numeric value on the wire for policyKind. + */ + @java.lang.Override + public int getPolicyKindValue() { + return policyKind_; + } + + /** + * + * + *
        +   * Immutable. The kind of the policy to attach in this binding. This field
        +   * must be one of the following:
        +   *
        +   * - Left empty (will be automatically set to the policy kind)
        +   * - The input policy kind
        +   * 
        + * + * + * .google.iam.v3.PolicyBinding.PolicyKind policy_kind = 11 [(.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return The policyKind. + */ + @java.lang.Override + public com.google.iam.v3.PolicyBinding.PolicyKind getPolicyKind() { + com.google.iam.v3.PolicyBinding.PolicyKind result = + com.google.iam.v3.PolicyBinding.PolicyKind.forNumber(policyKind_); + return result == null ? com.google.iam.v3.PolicyBinding.PolicyKind.UNRECOGNIZED : result; + } + + public static final int POLICY_FIELD_NUMBER = 7; + + @SuppressWarnings("serial") + private volatile java.lang.Object policy_ = ""; + + /** + * + * + *
        +   * Required. Immutable. The resource name of the policy to be bound. The
        +   * binding parent and policy must belong to the same organization.
        +   * 
        + * + * + * string policy = 7 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = REQUIRED]; + * + * + * @return The policy. + */ + @java.lang.Override + public java.lang.String getPolicy() { + java.lang.Object ref = policy_; + 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(); + policy_ = s; + return s; + } + } + + /** + * + * + *
        +   * Required. Immutable. The resource name of the policy to be bound. The
        +   * binding parent and policy must belong to the same organization.
        +   * 
        + * + * + * string policy = 7 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = REQUIRED]; + * + * + * @return The bytes for policy. + */ + @java.lang.Override + public com.google.protobuf.ByteString getPolicyBytes() { + java.lang.Object ref = policy_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + policy_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int POLICY_UID_FIELD_NUMBER = 12; + + @SuppressWarnings("serial") + private volatile java.lang.Object policyUid_ = ""; + + /** + * + * + *
        +   * Output only. The globally unique ID of the policy to be bound.
        +   * 
        + * + * string policy_uid = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The policyUid. + */ + @java.lang.Override + public java.lang.String getPolicyUid() { + java.lang.Object ref = policyUid_; + 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(); + policyUid_ = s; + return s; + } + } + + /** + * + * + *
        +   * Output only. The globally unique ID of the policy to be bound.
        +   * 
        + * + * string policy_uid = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for policyUid. + */ + @java.lang.Override + public com.google.protobuf.ByteString getPolicyUidBytes() { + java.lang.Object ref = policyUid_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + policyUid_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int CONDITION_FIELD_NUMBER = 8; + private com.google.type.Expr condition_; + + /** + * + * + *
        +   * Optional. The condition to apply to the policy binding. When set, the
        +   * `expression` field in the `Expr` must include from 1 to 10 subexpressions,
        +   * joined by the
        +   * "||"(Logical OR), "&&"(Logical AND) or "!"(Logical NOT) operators and
        +   * cannot contain more than 250 characters.
        +   *
        +   * The condition is currently only supported when bound to policies of kind
        +   * principal access boundary.
        +   *
        +   * When the bound policy is a principal access boundary policy, the only
        +   * supported attributes in any subexpression are `principal.type` and
        +   * `principal.subject`. An example expression is: "principal.type ==
        +   * 'iam.googleapis.com/ServiceAccount'" or "principal.subject ==
        +   * 'bob@example.com'".
        +   *
        +   * Allowed operations for `principal.subject`:
        +   *
        +   * - `principal.subject == <principal subject string>`
        +   * - `principal.subject != <principal subject string>`
        +   * - `principal.subject in [<list of principal subjects>]`
        +   * - `principal.subject.startsWith(<string>)`
        +   * - `principal.subject.endsWith(<string>)`
        +   *
        +   * Allowed operations for `principal.type`:
        +   *
        +   * - `principal.type == <principal type string>`
        +   * - `principal.type != <principal type string>`
        +   * - `principal.type in [<list of principal types>]`
        +   *
        +   * Supported principal types are Workspace, Workforce Pool, Workload Pool and
        +   * Service Account. Allowed string must be one of:
        +   *
        +   * - iam.googleapis.com/WorkspaceIdentity
        +   * - iam.googleapis.com/WorkforcePoolIdentity
        +   * - iam.googleapis.com/WorkloadPoolIdentity
        +   * - iam.googleapis.com/ServiceAccount
        +   * 
        + * + * .google.type.Expr condition = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return Whether the condition field is set. + */ + @java.lang.Override + public boolean hasCondition() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
        +   * Optional. The condition to apply to the policy binding. When set, the
        +   * `expression` field in the `Expr` must include from 1 to 10 subexpressions,
        +   * joined by the
        +   * "||"(Logical OR), "&&"(Logical AND) or "!"(Logical NOT) operators and
        +   * cannot contain more than 250 characters.
        +   *
        +   * The condition is currently only supported when bound to policies of kind
        +   * principal access boundary.
        +   *
        +   * When the bound policy is a principal access boundary policy, the only
        +   * supported attributes in any subexpression are `principal.type` and
        +   * `principal.subject`. An example expression is: "principal.type ==
        +   * 'iam.googleapis.com/ServiceAccount'" or "principal.subject ==
        +   * 'bob@example.com'".
        +   *
        +   * Allowed operations for `principal.subject`:
        +   *
        +   * - `principal.subject == <principal subject string>`
        +   * - `principal.subject != <principal subject string>`
        +   * - `principal.subject in [<list of principal subjects>]`
        +   * - `principal.subject.startsWith(<string>)`
        +   * - `principal.subject.endsWith(<string>)`
        +   *
        +   * Allowed operations for `principal.type`:
        +   *
        +   * - `principal.type == <principal type string>`
        +   * - `principal.type != <principal type string>`
        +   * - `principal.type in [<list of principal types>]`
        +   *
        +   * Supported principal types are Workspace, Workforce Pool, Workload Pool and
        +   * Service Account. Allowed string must be one of:
        +   *
        +   * - iam.googleapis.com/WorkspaceIdentity
        +   * - iam.googleapis.com/WorkforcePoolIdentity
        +   * - iam.googleapis.com/WorkloadPoolIdentity
        +   * - iam.googleapis.com/ServiceAccount
        +   * 
        + * + * .google.type.Expr condition = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The condition. + */ + @java.lang.Override + public com.google.type.Expr getCondition() { + return condition_ == null ? com.google.type.Expr.getDefaultInstance() : condition_; + } + + /** + * + * + *
        +   * Optional. The condition to apply to the policy binding. When set, the
        +   * `expression` field in the `Expr` must include from 1 to 10 subexpressions,
        +   * joined by the
        +   * "||"(Logical OR), "&&"(Logical AND) or "!"(Logical NOT) operators and
        +   * cannot contain more than 250 characters.
        +   *
        +   * The condition is currently only supported when bound to policies of kind
        +   * principal access boundary.
        +   *
        +   * When the bound policy is a principal access boundary policy, the only
        +   * supported attributes in any subexpression are `principal.type` and
        +   * `principal.subject`. An example expression is: "principal.type ==
        +   * 'iam.googleapis.com/ServiceAccount'" or "principal.subject ==
        +   * 'bob@example.com'".
        +   *
        +   * Allowed operations for `principal.subject`:
        +   *
        +   * - `principal.subject == <principal subject string>`
        +   * - `principal.subject != <principal subject string>`
        +   * - `principal.subject in [<list of principal subjects>]`
        +   * - `principal.subject.startsWith(<string>)`
        +   * - `principal.subject.endsWith(<string>)`
        +   *
        +   * Allowed operations for `principal.type`:
        +   *
        +   * - `principal.type == <principal type string>`
        +   * - `principal.type != <principal type string>`
        +   * - `principal.type in [<list of principal types>]`
        +   *
        +   * Supported principal types are Workspace, Workforce Pool, Workload Pool and
        +   * Service Account. Allowed string must be one of:
        +   *
        +   * - iam.googleapis.com/WorkspaceIdentity
        +   * - iam.googleapis.com/WorkforcePoolIdentity
        +   * - iam.googleapis.com/WorkloadPoolIdentity
        +   * - iam.googleapis.com/ServiceAccount
        +   * 
        + * + * .google.type.Expr condition = 8 [(.google.api.field_behavior) = OPTIONAL]; + */ + @java.lang.Override + public com.google.type.ExprOrBuilder getConditionOrBuilder() { + return condition_ == null ? com.google.type.Expr.getDefaultInstance() : condition_; + } + + public static final int CREATE_TIME_FIELD_NUMBER = 9; + private com.google.protobuf.Timestamp createTime_; + + /** + * + * + *
        +   * Output only. The time when the policy binding was created.
        +   * 
        + * + * .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 time when the policy binding was created.
        +   * 
        + * + * .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 time when the policy binding was created.
        +   * 
        + * + * .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 time when the policy binding was most recently updated.
        +   * 
        + * + * .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 time when the policy binding was most recently updated.
        +   * 
        + * + * .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 time when the policy binding was most recently updated.
        +   * 
        + * + * .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_; + } + + 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.GeneratedMessage.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, name_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(uid_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, uid_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(etag_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 3, etag_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(displayName_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 4, displayName_); + } + com.google.protobuf.GeneratedMessage.serializeStringMapTo( + output, internalGetAnnotations(), AnnotationsDefaultEntryHolder.defaultEntry, 5); + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(6, getTarget()); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(policy_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 7, policy_); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeMessage(8, getCondition()); + } + if (((bitField0_ & 0x00000004) != 0)) { + output.writeMessage(9, getCreateTime()); + } + if (((bitField0_ & 0x00000008) != 0)) { + output.writeMessage(10, getUpdateTime()); + } + if (policyKind_ + != com.google.iam.v3.PolicyBinding.PolicyKind.POLICY_KIND_UNSPECIFIED.getNumber()) { + output.writeEnum(11, policyKind_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(policyUid_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 12, policyUid_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, name_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(uid_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, uid_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(etag_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(3, etag_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(displayName_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(4, displayName_); + } + for (java.util.Map.Entry entry : + internalGetAnnotations().getMap().entrySet()) { + com.google.protobuf.MapEntry annotations__ = + AnnotationsDefaultEntryHolder.defaultEntry + .newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream.computeMessageSize(5, annotations__); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(6, getTarget()); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(policy_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(7, policy_); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(8, getCondition()); + } + 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 (policyKind_ + != com.google.iam.v3.PolicyBinding.PolicyKind.POLICY_KIND_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(11, policyKind_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(policyUid_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(12, policyUid_); + } + 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.iam.v3.PolicyBinding)) { + return super.equals(obj); + } + com.google.iam.v3.PolicyBinding other = (com.google.iam.v3.PolicyBinding) obj; + + if (!getName().equals(other.getName())) return false; + if (!getUid().equals(other.getUid())) return false; + if (!getEtag().equals(other.getEtag())) return false; + if (!getDisplayName().equals(other.getDisplayName())) return false; + if (!internalGetAnnotations().equals(other.internalGetAnnotations())) return false; + if (hasTarget() != other.hasTarget()) return false; + if (hasTarget()) { + if (!getTarget().equals(other.getTarget())) return false; + } + if (policyKind_ != other.policyKind_) return false; + if (!getPolicy().equals(other.getPolicy())) return false; + if (!getPolicyUid().equals(other.getPolicyUid())) return false; + if (hasCondition() != other.hasCondition()) return false; + if (hasCondition()) { + if (!getCondition().equals(other.getCondition())) 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) + UID_FIELD_NUMBER; + hash = (53 * hash) + getUid().hashCode(); + hash = (37 * hash) + ETAG_FIELD_NUMBER; + hash = (53 * hash) + getEtag().hashCode(); + hash = (37 * hash) + DISPLAY_NAME_FIELD_NUMBER; + hash = (53 * hash) + getDisplayName().hashCode(); + if (!internalGetAnnotations().getMap().isEmpty()) { + hash = (37 * hash) + ANNOTATIONS_FIELD_NUMBER; + hash = (53 * hash) + internalGetAnnotations().hashCode(); + } + if (hasTarget()) { + hash = (37 * hash) + TARGET_FIELD_NUMBER; + hash = (53 * hash) + getTarget().hashCode(); + } + hash = (37 * hash) + POLICY_KIND_FIELD_NUMBER; + hash = (53 * hash) + policyKind_; + hash = (37 * hash) + POLICY_FIELD_NUMBER; + hash = (53 * hash) + getPolicy().hashCode(); + hash = (37 * hash) + POLICY_UID_FIELD_NUMBER; + hash = (53 * hash) + getPolicyUid().hashCode(); + if (hasCondition()) { + hash = (37 * hash) + CONDITION_FIELD_NUMBER; + hash = (53 * hash) + getCondition().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 = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.iam.v3.PolicyBinding parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.iam.v3.PolicyBinding parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.iam.v3.PolicyBinding parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.iam.v3.PolicyBinding 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.iam.v3.PolicyBinding parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.iam.v3.PolicyBinding parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.iam.v3.PolicyBinding parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.iam.v3.PolicyBinding parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.iam.v3.PolicyBinding parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.iam.v3.PolicyBinding parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.iam.v3.PolicyBinding parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.iam.v3.PolicyBinding parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.iam.v3.PolicyBinding 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
        +   * IAM policy binding resource.
        +   * 
        + * + * Protobuf type {@code google.iam.v3.PolicyBinding} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.iam.v3.PolicyBinding) + com.google.iam.v3.PolicyBindingOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.iam.v3.PolicyBindingResourcesProto + .internal_static_google_iam_v3_PolicyBinding_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapFieldReflectionAccessor internalGetMapFieldReflection( + int number) { + switch (number) { + case 5: + return internalGetAnnotations(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapFieldReflectionAccessor internalGetMutableMapFieldReflection( + int number) { + switch (number) { + case 5: + return internalGetMutableAnnotations(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.iam.v3.PolicyBindingResourcesProto + .internal_static_google_iam_v3_PolicyBinding_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.iam.v3.PolicyBinding.class, com.google.iam.v3.PolicyBinding.Builder.class); + } + + // Construct using com.google.iam.v3.PolicyBinding.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetTargetFieldBuilder(); + internalGetConditionFieldBuilder(); + internalGetCreateTimeFieldBuilder(); + internalGetUpdateTimeFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + uid_ = ""; + etag_ = ""; + displayName_ = ""; + internalGetMutableAnnotations().clear(); + target_ = null; + if (targetBuilder_ != null) { + targetBuilder_.dispose(); + targetBuilder_ = null; + } + policyKind_ = 0; + policy_ = ""; + policyUid_ = ""; + condition_ = null; + if (conditionBuilder_ != null) { + conditionBuilder_.dispose(); + conditionBuilder_ = null; + } + 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.iam.v3.PolicyBindingResourcesProto + .internal_static_google_iam_v3_PolicyBinding_descriptor; + } + + @java.lang.Override + public com.google.iam.v3.PolicyBinding getDefaultInstanceForType() { + return com.google.iam.v3.PolicyBinding.getDefaultInstance(); + } + + @java.lang.Override + public com.google.iam.v3.PolicyBinding build() { + com.google.iam.v3.PolicyBinding result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.iam.v3.PolicyBinding buildPartial() { + com.google.iam.v3.PolicyBinding result = new com.google.iam.v3.PolicyBinding(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.iam.v3.PolicyBinding result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.uid_ = uid_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.etag_ = etag_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.displayName_ = displayName_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.annotations_ = internalGetAnnotations(); + result.annotations_.makeImmutable(); + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000020) != 0)) { + result.target_ = targetBuilder_ == null ? target_ : targetBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000040) != 0)) { + result.policyKind_ = policyKind_; + } + if (((from_bitField0_ & 0x00000080) != 0)) { + result.policy_ = policy_; + } + if (((from_bitField0_ & 0x00000100) != 0)) { + result.policyUid_ = policyUid_; + } + if (((from_bitField0_ & 0x00000200) != 0)) { + result.condition_ = conditionBuilder_ == null ? condition_ : conditionBuilder_.build(); + to_bitField0_ |= 0x00000002; + } + if (((from_bitField0_ & 0x00000400) != 0)) { + result.createTime_ = createTimeBuilder_ == null ? createTime_ : createTimeBuilder_.build(); + to_bitField0_ |= 0x00000004; + } + if (((from_bitField0_ & 0x00000800) != 0)) { + result.updateTime_ = updateTimeBuilder_ == null ? updateTime_ : updateTimeBuilder_.build(); + to_bitField0_ |= 0x00000008; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.iam.v3.PolicyBinding) { + return mergeFrom((com.google.iam.v3.PolicyBinding) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.iam.v3.PolicyBinding other) { + if (other == com.google.iam.v3.PolicyBinding.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getUid().isEmpty()) { + uid_ = other.uid_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (!other.getEtag().isEmpty()) { + etag_ = other.etag_; + bitField0_ |= 0x00000004; + onChanged(); + } + if (!other.getDisplayName().isEmpty()) { + displayName_ = other.displayName_; + bitField0_ |= 0x00000008; + onChanged(); + } + internalGetMutableAnnotations().mergeFrom(other.internalGetAnnotations()); + bitField0_ |= 0x00000010; + if (other.hasTarget()) { + mergeTarget(other.getTarget()); + } + if (other.policyKind_ != 0) { + setPolicyKindValue(other.getPolicyKindValue()); + } + if (!other.getPolicy().isEmpty()) { + policy_ = other.policy_; + bitField0_ |= 0x00000080; + onChanged(); + } + if (!other.getPolicyUid().isEmpty()) { + policyUid_ = other.policyUid_; + bitField0_ |= 0x00000100; + onChanged(); + } + if (other.hasCondition()) { + mergeCondition(other.getCondition()); + } + 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: + { + uid_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + etag_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 34: + { + displayName_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000008; + break; + } // case 34 + case 42: + { + com.google.protobuf.MapEntry annotations__ = + input.readMessage( + AnnotationsDefaultEntryHolder.defaultEntry.getParserForType(), + extensionRegistry); + internalGetMutableAnnotations() + .getMutableMap() + .put(annotations__.getKey(), annotations__.getValue()); + bitField0_ |= 0x00000010; + break; + } // case 42 + case 50: + { + input.readMessage(internalGetTargetFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000020; + break; + } // case 50 + case 58: + { + policy_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000080; + break; + } // case 58 + case 66: + { + input.readMessage( + internalGetConditionFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000200; + break; + } // case 66 + case 74: + { + input.readMessage( + internalGetCreateTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000400; + break; + } // case 74 + case 82: + { + input.readMessage( + internalGetUpdateTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000800; + break; + } // case 82 + case 88: + { + policyKind_ = input.readEnum(); + bitField0_ |= 0x00000040; + break; + } // case 88 + case 98: + { + policyUid_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000100; + break; + } // case 98 + 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_ = ""; + + /** + * + * + *
        +     * Identifier. The name of the policy binding, in the format
        +     * `{binding_parent/locations/{location}/policyBindings/{policy_binding_id}`.
        +     * The binding parent is the closest Resource Manager resource (project,
        +     * folder, or organization) to the binding target.
        +     *
        +     * Format:
        +     *
        +     * * `projects/{project_id}/locations/{location}/policyBindings/{policy_binding_id}`
        +     * * `projects/{project_number}/locations/{location}/policyBindings/{policy_binding_id}`
        +     * * `folders/{folder_id}/locations/{location}/policyBindings/{policy_binding_id}`
        +     * * `organizations/{organization_id}/locations/{location}/policyBindings/{policy_binding_id}`
        +     * 
        + * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @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; + } + } + + /** + * + * + *
        +     * Identifier. The name of the policy binding, in the format
        +     * `{binding_parent/locations/{location}/policyBindings/{policy_binding_id}`.
        +     * The binding parent is the closest Resource Manager resource (project,
        +     * folder, or organization) to the binding target.
        +     *
        +     * Format:
        +     *
        +     * * `projects/{project_id}/locations/{location}/policyBindings/{policy_binding_id}`
        +     * * `projects/{project_number}/locations/{location}/policyBindings/{policy_binding_id}`
        +     * * `folders/{folder_id}/locations/{location}/policyBindings/{policy_binding_id}`
        +     * * `organizations/{organization_id}/locations/{location}/policyBindings/{policy_binding_id}`
        +     * 
        + * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @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; + } + } + + /** + * + * + *
        +     * Identifier. The name of the policy binding, in the format
        +     * `{binding_parent/locations/{location}/policyBindings/{policy_binding_id}`.
        +     * The binding parent is the closest Resource Manager resource (project,
        +     * folder, or organization) to the binding target.
        +     *
        +     * Format:
        +     *
        +     * * `projects/{project_id}/locations/{location}/policyBindings/{policy_binding_id}`
        +     * * `projects/{project_number}/locations/{location}/policyBindings/{policy_binding_id}`
        +     * * `folders/{folder_id}/locations/{location}/policyBindings/{policy_binding_id}`
        +     * * `organizations/{organization_id}/locations/{location}/policyBindings/{policy_binding_id}`
        +     * 
        + * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @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; + } + + /** + * + * + *
        +     * Identifier. The name of the policy binding, in the format
        +     * `{binding_parent/locations/{location}/policyBindings/{policy_binding_id}`.
        +     * The binding parent is the closest Resource Manager resource (project,
        +     * folder, or organization) to the binding target.
        +     *
        +     * Format:
        +     *
        +     * * `projects/{project_id}/locations/{location}/policyBindings/{policy_binding_id}`
        +     * * `projects/{project_number}/locations/{location}/policyBindings/{policy_binding_id}`
        +     * * `folders/{folder_id}/locations/{location}/policyBindings/{policy_binding_id}`
        +     * * `organizations/{organization_id}/locations/{location}/policyBindings/{policy_binding_id}`
        +     * 
        + * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
        +     * Identifier. The name of the policy binding, in the format
        +     * `{binding_parent/locations/{location}/policyBindings/{policy_binding_id}`.
        +     * The binding parent is the closest Resource Manager resource (project,
        +     * folder, or organization) to the binding target.
        +     *
        +     * Format:
        +     *
        +     * * `projects/{project_id}/locations/{location}/policyBindings/{policy_binding_id}`
        +     * * `projects/{project_number}/locations/{location}/policyBindings/{policy_binding_id}`
        +     * * `folders/{folder_id}/locations/{location}/policyBindings/{policy_binding_id}`
        +     * * `organizations/{organization_id}/locations/{location}/policyBindings/{policy_binding_id}`
        +     * 
        + * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @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 uid_ = ""; + + /** + * + * + *
        +     * Output only. The globally unique ID of the policy binding. Assigned when
        +     * the policy binding is created.
        +     * 
        + * + * + * string uid = 2 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_info) = { ... } + * + * + * @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; + } + } + + /** + * + * + *
        +     * Output only. The globally unique ID of the policy binding. Assigned when
        +     * the policy binding is created.
        +     * 
        + * + * + * string uid = 2 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_info) = { ... } + * + * + * @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; + } + } + + /** + * + * + *
        +     * Output only. The globally unique ID of the policy binding. Assigned when
        +     * the policy binding is created.
        +     * 
        + * + * + * string uid = 2 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_info) = { ... } + * + * + * @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_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
        +     * Output only. The globally unique ID of the policy binding. Assigned when
        +     * the policy binding is created.
        +     * 
        + * + * + * string uid = 2 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_info) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearUid() { + uid_ = getDefaultInstance().getUid(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
        +     * Output only. The globally unique ID of the policy binding. Assigned when
        +     * the policy binding is created.
        +     * 
        + * + * + * string uid = 2 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_info) = { ... } + * + * + * @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_ |= 0x00000002; + onChanged(); + return this; + } + + private java.lang.Object etag_ = ""; + + /** + * + * + *
        +     * Optional. The etag for the policy binding.
        +     * If this is provided on update, it must match the server's etag.
        +     * 
        + * + * string etag = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The etag. + */ + public java.lang.String getEtag() { + java.lang.Object ref = etag_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + etag_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
        +     * Optional. The etag for the policy binding.
        +     * If this is provided on update, it must match the server's etag.
        +     * 
        + * + * string etag = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for etag. + */ + public com.google.protobuf.ByteString getEtagBytes() { + java.lang.Object ref = etag_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + etag_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
        +     * Optional. The etag for the policy binding.
        +     * If this is provided on update, it must match the server's etag.
        +     * 
        + * + * string etag = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The etag to set. + * @return This builder for chaining. + */ + public Builder setEtag(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + etag_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
        +     * Optional. The etag for the policy binding.
        +     * If this is provided on update, it must match the server's etag.
        +     * 
        + * + * string etag = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearEtag() { + etag_ = getDefaultInstance().getEtag(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + + /** + * + * + *
        +     * Optional. The etag for the policy binding.
        +     * If this is provided on update, it must match the server's etag.
        +     * 
        + * + * string etag = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for etag to set. + * @return This builder for chaining. + */ + public Builder setEtagBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + etag_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + private java.lang.Object displayName_ = ""; + + /** + * + * + *
        +     * Optional. The description of the policy binding. Must be less than or equal
        +     * to 63 characters.
        +     * 
        + * + * string display_name = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The displayName. + */ + public java.lang.String getDisplayName() { + java.lang.Object ref = displayName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + displayName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
        +     * Optional. The description of the policy binding. Must be less than or equal
        +     * to 63 characters.
        +     * 
        + * + * string display_name = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for displayName. + */ + public com.google.protobuf.ByteString getDisplayNameBytes() { + java.lang.Object ref = displayName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + displayName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
        +     * Optional. The description of the policy binding. Must be less than or equal
        +     * to 63 characters.
        +     * 
        + * + * string display_name = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The displayName to set. + * @return This builder for chaining. + */ + public Builder setDisplayName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + displayName_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + /** + * + * + *
        +     * Optional. The description of the policy binding. Must be less than or equal
        +     * to 63 characters.
        +     * 
        + * + * string display_name = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearDisplayName() { + displayName_ = getDefaultInstance().getDisplayName(); + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + return this; + } + + /** + * + * + *
        +     * Optional. The description of the policy binding. Must be less than or equal
        +     * to 63 characters.
        +     * 
        + * + * string display_name = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for displayName to set. + * @return This builder for chaining. + */ + public Builder setDisplayNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + displayName_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + private com.google.protobuf.MapField annotations_; + + private com.google.protobuf.MapField + internalGetAnnotations() { + if (annotations_ == null) { + return com.google.protobuf.MapField.emptyMapField( + AnnotationsDefaultEntryHolder.defaultEntry); + } + return annotations_; + } + + private com.google.protobuf.MapField + internalGetMutableAnnotations() { + if (annotations_ == null) { + annotations_ = + com.google.protobuf.MapField.newMapField(AnnotationsDefaultEntryHolder.defaultEntry); + } + if (!annotations_.isMutable()) { + annotations_ = annotations_.copy(); + } + bitField0_ |= 0x00000010; + onChanged(); + return annotations_; + } + + public int getAnnotationsCount() { + return internalGetAnnotations().getMap().size(); + } + + /** + * + * + *
        +     * Optional. User-defined annotations. See
        +     * https://google.aip.dev/148#annotations for more details such as format and
        +     * size limitations
        +     * 
        + * + * map<string, string> annotations = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public boolean containsAnnotations(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + return internalGetAnnotations().getMap().containsKey(key); + } + + /** Use {@link #getAnnotationsMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getAnnotations() { + return getAnnotationsMap(); + } + + /** + * + * + *
        +     * Optional. User-defined annotations. See
        +     * https://google.aip.dev/148#annotations for more details such as format and
        +     * size limitations
        +     * 
        + * + * map<string, string> annotations = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public java.util.Map getAnnotationsMap() { + return internalGetAnnotations().getMap(); + } + + /** + * + * + *
        +     * Optional. User-defined annotations. See
        +     * https://google.aip.dev/148#annotations for more details such as format and
        +     * size limitations
        +     * 
        + * + * map<string, string> annotations = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public /* nullable */ java.lang.String getAnnotationsOrDefault( + java.lang.String key, + /* nullable */ + java.lang.String defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetAnnotations().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + + /** + * + * + *
        +     * Optional. User-defined annotations. See
        +     * https://google.aip.dev/148#annotations for more details such as format and
        +     * size limitations
        +     * 
        + * + * map<string, string> annotations = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public java.lang.String getAnnotationsOrThrow(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetAnnotations().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public Builder clearAnnotations() { + bitField0_ = (bitField0_ & ~0x00000010); + internalGetMutableAnnotations().getMutableMap().clear(); + return this; + } + + /** + * + * + *
        +     * Optional. User-defined annotations. See
        +     * https://google.aip.dev/148#annotations for more details such as format and
        +     * size limitations
        +     * 
        + * + * map<string, string> annotations = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder removeAnnotations(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + internalGetMutableAnnotations().getMutableMap().remove(key); + return this; + } + + /** Use alternate mutation accessors instead. */ + @java.lang.Deprecated + public java.util.Map getMutableAnnotations() { + bitField0_ |= 0x00000010; + return internalGetMutableAnnotations().getMutableMap(); + } + + /** + * + * + *
        +     * Optional. User-defined annotations. See
        +     * https://google.aip.dev/148#annotations for more details such as format and
        +     * size limitations
        +     * 
        + * + * map<string, string> annotations = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder putAnnotations(java.lang.String key, java.lang.String value) { + if (key == null) { + throw new NullPointerException("map key"); + } + if (value == null) { + throw new NullPointerException("map value"); + } + internalGetMutableAnnotations().getMutableMap().put(key, value); + bitField0_ |= 0x00000010; + return this; + } + + /** + * + * + *
        +     * Optional. User-defined annotations. See
        +     * https://google.aip.dev/148#annotations for more details such as format and
        +     * size limitations
        +     * 
        + * + * map<string, string> annotations = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder putAllAnnotations(java.util.Map values) { + internalGetMutableAnnotations().getMutableMap().putAll(values); + bitField0_ |= 0x00000010; + return this; + } + + private com.google.iam.v3.PolicyBinding.Target target_; + private com.google.protobuf.SingleFieldBuilder< + com.google.iam.v3.PolicyBinding.Target, + com.google.iam.v3.PolicyBinding.Target.Builder, + com.google.iam.v3.PolicyBinding.TargetOrBuilder> + targetBuilder_; + + /** + * + * + *
        +     * Required. Immutable. Target is the full resource name of the resource to
        +     * which the policy will be bound. Immutable once set.
        +     * 
        + * + * + * .google.iam.v3.PolicyBinding.Target target = 6 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the target field is set. + */ + public boolean hasTarget() { + return ((bitField0_ & 0x00000020) != 0); + } + + /** + * + * + *
        +     * Required. Immutable. Target is the full resource name of the resource to
        +     * which the policy will be bound. Immutable once set.
        +     * 
        + * + * + * .google.iam.v3.PolicyBinding.Target target = 6 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = REQUIRED]; + * + * + * @return The target. + */ + public com.google.iam.v3.PolicyBinding.Target getTarget() { + if (targetBuilder_ == null) { + return target_ == null + ? com.google.iam.v3.PolicyBinding.Target.getDefaultInstance() + : target_; + } else { + return targetBuilder_.getMessage(); + } + } + + /** + * + * + *
        +     * Required. Immutable. Target is the full resource name of the resource to
        +     * which the policy will be bound. Immutable once set.
        +     * 
        + * + * + * .google.iam.v3.PolicyBinding.Target target = 6 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setTarget(com.google.iam.v3.PolicyBinding.Target value) { + if (targetBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + target_ = value; + } else { + targetBuilder_.setMessage(value); + } + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + + /** + * + * + *
        +     * Required. Immutable. Target is the full resource name of the resource to
        +     * which the policy will be bound. Immutable once set.
        +     * 
        + * + * + * .google.iam.v3.PolicyBinding.Target target = 6 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setTarget(com.google.iam.v3.PolicyBinding.Target.Builder builderForValue) { + if (targetBuilder_ == null) { + target_ = builderForValue.build(); + } else { + targetBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + + /** + * + * + *
        +     * Required. Immutable. Target is the full resource name of the resource to
        +     * which the policy will be bound. Immutable once set.
        +     * 
        + * + * + * .google.iam.v3.PolicyBinding.Target target = 6 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeTarget(com.google.iam.v3.PolicyBinding.Target value) { + if (targetBuilder_ == null) { + if (((bitField0_ & 0x00000020) != 0) + && target_ != null + && target_ != com.google.iam.v3.PolicyBinding.Target.getDefaultInstance()) { + getTargetBuilder().mergeFrom(value); + } else { + target_ = value; + } + } else { + targetBuilder_.mergeFrom(value); + } + if (target_ != null) { + bitField0_ |= 0x00000020; + onChanged(); + } + return this; + } + + /** + * + * + *
        +     * Required. Immutable. Target is the full resource name of the resource to
        +     * which the policy will be bound. Immutable once set.
        +     * 
        + * + * + * .google.iam.v3.PolicyBinding.Target target = 6 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearTarget() { + bitField0_ = (bitField0_ & ~0x00000020); + target_ = null; + if (targetBuilder_ != null) { + targetBuilder_.dispose(); + targetBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
        +     * Required. Immutable. Target is the full resource name of the resource to
        +     * which the policy will be bound. Immutable once set.
        +     * 
        + * + * + * .google.iam.v3.PolicyBinding.Target target = 6 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.iam.v3.PolicyBinding.Target.Builder getTargetBuilder() { + bitField0_ |= 0x00000020; + onChanged(); + return internalGetTargetFieldBuilder().getBuilder(); + } + + /** + * + * + *
        +     * Required. Immutable. Target is the full resource name of the resource to
        +     * which the policy will be bound. Immutable once set.
        +     * 
        + * + * + * .google.iam.v3.PolicyBinding.Target target = 6 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.iam.v3.PolicyBinding.TargetOrBuilder getTargetOrBuilder() { + if (targetBuilder_ != null) { + return targetBuilder_.getMessageOrBuilder(); + } else { + return target_ == null + ? com.google.iam.v3.PolicyBinding.Target.getDefaultInstance() + : target_; + } + } + + /** + * + * + *
        +     * Required. Immutable. Target is the full resource name of the resource to
        +     * which the policy will be bound. Immutable once set.
        +     * 
        + * + * + * .google.iam.v3.PolicyBinding.Target target = 6 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.iam.v3.PolicyBinding.Target, + com.google.iam.v3.PolicyBinding.Target.Builder, + com.google.iam.v3.PolicyBinding.TargetOrBuilder> + internalGetTargetFieldBuilder() { + if (targetBuilder_ == null) { + targetBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.iam.v3.PolicyBinding.Target, + com.google.iam.v3.PolicyBinding.Target.Builder, + com.google.iam.v3.PolicyBinding.TargetOrBuilder>( + getTarget(), getParentForChildren(), isClean()); + target_ = null; + } + return targetBuilder_; + } + + private int policyKind_ = 0; + + /** + * + * + *
        +     * Immutable. The kind of the policy to attach in this binding. This field
        +     * must be one of the following:
        +     *
        +     * - Left empty (will be automatically set to the policy kind)
        +     * - The input policy kind
        +     * 
        + * + * + * .google.iam.v3.PolicyBinding.PolicyKind policy_kind = 11 [(.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return The enum numeric value on the wire for policyKind. + */ + @java.lang.Override + public int getPolicyKindValue() { + return policyKind_; + } + + /** + * + * + *
        +     * Immutable. The kind of the policy to attach in this binding. This field
        +     * must be one of the following:
        +     *
        +     * - Left empty (will be automatically set to the policy kind)
        +     * - The input policy kind
        +     * 
        + * + * + * .google.iam.v3.PolicyBinding.PolicyKind policy_kind = 11 [(.google.api.field_behavior) = IMMUTABLE]; + * + * + * @param value The enum numeric value on the wire for policyKind to set. + * @return This builder for chaining. + */ + public Builder setPolicyKindValue(int value) { + policyKind_ = value; + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + + /** + * + * + *
        +     * Immutable. The kind of the policy to attach in this binding. This field
        +     * must be one of the following:
        +     *
        +     * - Left empty (will be automatically set to the policy kind)
        +     * - The input policy kind
        +     * 
        + * + * + * .google.iam.v3.PolicyBinding.PolicyKind policy_kind = 11 [(.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return The policyKind. + */ + @java.lang.Override + public com.google.iam.v3.PolicyBinding.PolicyKind getPolicyKind() { + com.google.iam.v3.PolicyBinding.PolicyKind result = + com.google.iam.v3.PolicyBinding.PolicyKind.forNumber(policyKind_); + return result == null ? com.google.iam.v3.PolicyBinding.PolicyKind.UNRECOGNIZED : result; + } + + /** + * + * + *
        +     * Immutable. The kind of the policy to attach in this binding. This field
        +     * must be one of the following:
        +     *
        +     * - Left empty (will be automatically set to the policy kind)
        +     * - The input policy kind
        +     * 
        + * + * + * .google.iam.v3.PolicyBinding.PolicyKind policy_kind = 11 [(.google.api.field_behavior) = IMMUTABLE]; + * + * + * @param value The policyKind to set. + * @return This builder for chaining. + */ + public Builder setPolicyKind(com.google.iam.v3.PolicyBinding.PolicyKind value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000040; + policyKind_ = value.getNumber(); + onChanged(); + return this; + } + + /** + * + * + *
        +     * Immutable. The kind of the policy to attach in this binding. This field
        +     * must be one of the following:
        +     *
        +     * - Left empty (will be automatically set to the policy kind)
        +     * - The input policy kind
        +     * 
        + * + * + * .google.iam.v3.PolicyBinding.PolicyKind policy_kind = 11 [(.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return This builder for chaining. + */ + public Builder clearPolicyKind() { + bitField0_ = (bitField0_ & ~0x00000040); + policyKind_ = 0; + onChanged(); + return this; + } + + private java.lang.Object policy_ = ""; + + /** + * + * + *
        +     * Required. Immutable. The resource name of the policy to be bound. The
        +     * binding parent and policy must belong to the same organization.
        +     * 
        + * + * + * string policy = 7 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = REQUIRED]; + * + * + * @return The policy. + */ + public java.lang.String getPolicy() { + java.lang.Object ref = policy_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + policy_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
        +     * Required. Immutable. The resource name of the policy to be bound. The
        +     * binding parent and policy must belong to the same organization.
        +     * 
        + * + * + * string policy = 7 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = REQUIRED]; + * + * + * @return The bytes for policy. + */ + public com.google.protobuf.ByteString getPolicyBytes() { + java.lang.Object ref = policy_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + policy_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
        +     * Required. Immutable. The resource name of the policy to be bound. The
        +     * binding parent and policy must belong to the same organization.
        +     * 
        + * + * + * string policy = 7 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = REQUIRED]; + * + * + * @param value The policy to set. + * @return This builder for chaining. + */ + public Builder setPolicy(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + policy_ = value; + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + + /** + * + * + *
        +     * Required. Immutable. The resource name of the policy to be bound. The
        +     * binding parent and policy must belong to the same organization.
        +     * 
        + * + * + * string policy = 7 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = REQUIRED]; + * + * + * @return This builder for chaining. + */ + public Builder clearPolicy() { + policy_ = getDefaultInstance().getPolicy(); + bitField0_ = (bitField0_ & ~0x00000080); + onChanged(); + return this; + } + + /** + * + * + *
        +     * Required. Immutable. The resource name of the policy to be bound. The
        +     * binding parent and policy must belong to the same organization.
        +     * 
        + * + * + * string policy = 7 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = REQUIRED]; + * + * + * @param value The bytes for policy to set. + * @return This builder for chaining. + */ + public Builder setPolicyBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + policy_ = value; + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + + private java.lang.Object policyUid_ = ""; + + /** + * + * + *
        +     * Output only. The globally unique ID of the policy to be bound.
        +     * 
        + * + * string policy_uid = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The policyUid. + */ + public java.lang.String getPolicyUid() { + java.lang.Object ref = policyUid_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + policyUid_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
        +     * Output only. The globally unique ID of the policy to be bound.
        +     * 
        + * + * string policy_uid = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for policyUid. + */ + public com.google.protobuf.ByteString getPolicyUidBytes() { + java.lang.Object ref = policyUid_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + policyUid_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
        +     * Output only. The globally unique ID of the policy to be bound.
        +     * 
        + * + * string policy_uid = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The policyUid to set. + * @return This builder for chaining. + */ + public Builder setPolicyUid(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + policyUid_ = value; + bitField0_ |= 0x00000100; + onChanged(); + return this; + } + + /** + * + * + *
        +     * Output only. The globally unique ID of the policy to be bound.
        +     * 
        + * + * string policy_uid = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearPolicyUid() { + policyUid_ = getDefaultInstance().getPolicyUid(); + bitField0_ = (bitField0_ & ~0x00000100); + onChanged(); + return this; + } + + /** + * + * + *
        +     * Output only. The globally unique ID of the policy to be bound.
        +     * 
        + * + * string policy_uid = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The bytes for policyUid to set. + * @return This builder for chaining. + */ + public Builder setPolicyUidBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + policyUid_ = value; + bitField0_ |= 0x00000100; + onChanged(); + return this; + } + + private com.google.type.Expr condition_; + private com.google.protobuf.SingleFieldBuilder< + com.google.type.Expr, com.google.type.Expr.Builder, com.google.type.ExprOrBuilder> + conditionBuilder_; + + /** + * + * + *
        +     * Optional. The condition to apply to the policy binding. When set, the
        +     * `expression` field in the `Expr` must include from 1 to 10 subexpressions,
        +     * joined by the
        +     * "||"(Logical OR), "&&"(Logical AND) or "!"(Logical NOT) operators and
        +     * cannot contain more than 250 characters.
        +     *
        +     * The condition is currently only supported when bound to policies of kind
        +     * principal access boundary.
        +     *
        +     * When the bound policy is a principal access boundary policy, the only
        +     * supported attributes in any subexpression are `principal.type` and
        +     * `principal.subject`. An example expression is: "principal.type ==
        +     * 'iam.googleapis.com/ServiceAccount'" or "principal.subject ==
        +     * 'bob@example.com'".
        +     *
        +     * Allowed operations for `principal.subject`:
        +     *
        +     * - `principal.subject == <principal subject string>`
        +     * - `principal.subject != <principal subject string>`
        +     * - `principal.subject in [<list of principal subjects>]`
        +     * - `principal.subject.startsWith(<string>)`
        +     * - `principal.subject.endsWith(<string>)`
        +     *
        +     * Allowed operations for `principal.type`:
        +     *
        +     * - `principal.type == <principal type string>`
        +     * - `principal.type != <principal type string>`
        +     * - `principal.type in [<list of principal types>]`
        +     *
        +     * Supported principal types are Workspace, Workforce Pool, Workload Pool and
        +     * Service Account. Allowed string must be one of:
        +     *
        +     * - iam.googleapis.com/WorkspaceIdentity
        +     * - iam.googleapis.com/WorkforcePoolIdentity
        +     * - iam.googleapis.com/WorkloadPoolIdentity
        +     * - iam.googleapis.com/ServiceAccount
        +     * 
        + * + * .google.type.Expr condition = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return Whether the condition field is set. + */ + public boolean hasCondition() { + return ((bitField0_ & 0x00000200) != 0); + } + + /** + * + * + *
        +     * Optional. The condition to apply to the policy binding. When set, the
        +     * `expression` field in the `Expr` must include from 1 to 10 subexpressions,
        +     * joined by the
        +     * "||"(Logical OR), "&&"(Logical AND) or "!"(Logical NOT) operators and
        +     * cannot contain more than 250 characters.
        +     *
        +     * The condition is currently only supported when bound to policies of kind
        +     * principal access boundary.
        +     *
        +     * When the bound policy is a principal access boundary policy, the only
        +     * supported attributes in any subexpression are `principal.type` and
        +     * `principal.subject`. An example expression is: "principal.type ==
        +     * 'iam.googleapis.com/ServiceAccount'" or "principal.subject ==
        +     * 'bob@example.com'".
        +     *
        +     * Allowed operations for `principal.subject`:
        +     *
        +     * - `principal.subject == <principal subject string>`
        +     * - `principal.subject != <principal subject string>`
        +     * - `principal.subject in [<list of principal subjects>]`
        +     * - `principal.subject.startsWith(<string>)`
        +     * - `principal.subject.endsWith(<string>)`
        +     *
        +     * Allowed operations for `principal.type`:
        +     *
        +     * - `principal.type == <principal type string>`
        +     * - `principal.type != <principal type string>`
        +     * - `principal.type in [<list of principal types>]`
        +     *
        +     * Supported principal types are Workspace, Workforce Pool, Workload Pool and
        +     * Service Account. Allowed string must be one of:
        +     *
        +     * - iam.googleapis.com/WorkspaceIdentity
        +     * - iam.googleapis.com/WorkforcePoolIdentity
        +     * - iam.googleapis.com/WorkloadPoolIdentity
        +     * - iam.googleapis.com/ServiceAccount
        +     * 
        + * + * .google.type.Expr condition = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The condition. + */ + public com.google.type.Expr getCondition() { + if (conditionBuilder_ == null) { + return condition_ == null ? com.google.type.Expr.getDefaultInstance() : condition_; + } else { + return conditionBuilder_.getMessage(); + } + } + + /** + * + * + *
        +     * Optional. The condition to apply to the policy binding. When set, the
        +     * `expression` field in the `Expr` must include from 1 to 10 subexpressions,
        +     * joined by the
        +     * "||"(Logical OR), "&&"(Logical AND) or "!"(Logical NOT) operators and
        +     * cannot contain more than 250 characters.
        +     *
        +     * The condition is currently only supported when bound to policies of kind
        +     * principal access boundary.
        +     *
        +     * When the bound policy is a principal access boundary policy, the only
        +     * supported attributes in any subexpression are `principal.type` and
        +     * `principal.subject`. An example expression is: "principal.type ==
        +     * 'iam.googleapis.com/ServiceAccount'" or "principal.subject ==
        +     * 'bob@example.com'".
        +     *
        +     * Allowed operations for `principal.subject`:
        +     *
        +     * - `principal.subject == <principal subject string>`
        +     * - `principal.subject != <principal subject string>`
        +     * - `principal.subject in [<list of principal subjects>]`
        +     * - `principal.subject.startsWith(<string>)`
        +     * - `principal.subject.endsWith(<string>)`
        +     *
        +     * Allowed operations for `principal.type`:
        +     *
        +     * - `principal.type == <principal type string>`
        +     * - `principal.type != <principal type string>`
        +     * - `principal.type in [<list of principal types>]`
        +     *
        +     * Supported principal types are Workspace, Workforce Pool, Workload Pool and
        +     * Service Account. Allowed string must be one of:
        +     *
        +     * - iam.googleapis.com/WorkspaceIdentity
        +     * - iam.googleapis.com/WorkforcePoolIdentity
        +     * - iam.googleapis.com/WorkloadPoolIdentity
        +     * - iam.googleapis.com/ServiceAccount
        +     * 
        + * + * .google.type.Expr condition = 8 [(.google.api.field_behavior) = OPTIONAL]; + */ + public Builder setCondition(com.google.type.Expr value) { + if (conditionBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + condition_ = value; + } else { + conditionBuilder_.setMessage(value); + } + bitField0_ |= 0x00000200; + onChanged(); + return this; + } + + /** + * + * + *
        +     * Optional. The condition to apply to the policy binding. When set, the
        +     * `expression` field in the `Expr` must include from 1 to 10 subexpressions,
        +     * joined by the
        +     * "||"(Logical OR), "&&"(Logical AND) or "!"(Logical NOT) operators and
        +     * cannot contain more than 250 characters.
        +     *
        +     * The condition is currently only supported when bound to policies of kind
        +     * principal access boundary.
        +     *
        +     * When the bound policy is a principal access boundary policy, the only
        +     * supported attributes in any subexpression are `principal.type` and
        +     * `principal.subject`. An example expression is: "principal.type ==
        +     * 'iam.googleapis.com/ServiceAccount'" or "principal.subject ==
        +     * 'bob@example.com'".
        +     *
        +     * Allowed operations for `principal.subject`:
        +     *
        +     * - `principal.subject == <principal subject string>`
        +     * - `principal.subject != <principal subject string>`
        +     * - `principal.subject in [<list of principal subjects>]`
        +     * - `principal.subject.startsWith(<string>)`
        +     * - `principal.subject.endsWith(<string>)`
        +     *
        +     * Allowed operations for `principal.type`:
        +     *
        +     * - `principal.type == <principal type string>`
        +     * - `principal.type != <principal type string>`
        +     * - `principal.type in [<list of principal types>]`
        +     *
        +     * Supported principal types are Workspace, Workforce Pool, Workload Pool and
        +     * Service Account. Allowed string must be one of:
        +     *
        +     * - iam.googleapis.com/WorkspaceIdentity
        +     * - iam.googleapis.com/WorkforcePoolIdentity
        +     * - iam.googleapis.com/WorkloadPoolIdentity
        +     * - iam.googleapis.com/ServiceAccount
        +     * 
        + * + * .google.type.Expr condition = 8 [(.google.api.field_behavior) = OPTIONAL]; + */ + public Builder setCondition(com.google.type.Expr.Builder builderForValue) { + if (conditionBuilder_ == null) { + condition_ = builderForValue.build(); + } else { + conditionBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000200; + onChanged(); + return this; + } + + /** + * + * + *
        +     * Optional. The condition to apply to the policy binding. When set, the
        +     * `expression` field in the `Expr` must include from 1 to 10 subexpressions,
        +     * joined by the
        +     * "||"(Logical OR), "&&"(Logical AND) or "!"(Logical NOT) operators and
        +     * cannot contain more than 250 characters.
        +     *
        +     * The condition is currently only supported when bound to policies of kind
        +     * principal access boundary.
        +     *
        +     * When the bound policy is a principal access boundary policy, the only
        +     * supported attributes in any subexpression are `principal.type` and
        +     * `principal.subject`. An example expression is: "principal.type ==
        +     * 'iam.googleapis.com/ServiceAccount'" or "principal.subject ==
        +     * 'bob@example.com'".
        +     *
        +     * Allowed operations for `principal.subject`:
        +     *
        +     * - `principal.subject == <principal subject string>`
        +     * - `principal.subject != <principal subject string>`
        +     * - `principal.subject in [<list of principal subjects>]`
        +     * - `principal.subject.startsWith(<string>)`
        +     * - `principal.subject.endsWith(<string>)`
        +     *
        +     * Allowed operations for `principal.type`:
        +     *
        +     * - `principal.type == <principal type string>`
        +     * - `principal.type != <principal type string>`
        +     * - `principal.type in [<list of principal types>]`
        +     *
        +     * Supported principal types are Workspace, Workforce Pool, Workload Pool and
        +     * Service Account. Allowed string must be one of:
        +     *
        +     * - iam.googleapis.com/WorkspaceIdentity
        +     * - iam.googleapis.com/WorkforcePoolIdentity
        +     * - iam.googleapis.com/WorkloadPoolIdentity
        +     * - iam.googleapis.com/ServiceAccount
        +     * 
        + * + * .google.type.Expr condition = 8 [(.google.api.field_behavior) = OPTIONAL]; + */ + public Builder mergeCondition(com.google.type.Expr value) { + if (conditionBuilder_ == null) { + if (((bitField0_ & 0x00000200) != 0) + && condition_ != null + && condition_ != com.google.type.Expr.getDefaultInstance()) { + getConditionBuilder().mergeFrom(value); + } else { + condition_ = value; + } + } else { + conditionBuilder_.mergeFrom(value); + } + if (condition_ != null) { + bitField0_ |= 0x00000200; + onChanged(); + } + return this; + } + + /** + * + * + *
        +     * Optional. The condition to apply to the policy binding. When set, the
        +     * `expression` field in the `Expr` must include from 1 to 10 subexpressions,
        +     * joined by the
        +     * "||"(Logical OR), "&&"(Logical AND) or "!"(Logical NOT) operators and
        +     * cannot contain more than 250 characters.
        +     *
        +     * The condition is currently only supported when bound to policies of kind
        +     * principal access boundary.
        +     *
        +     * When the bound policy is a principal access boundary policy, the only
        +     * supported attributes in any subexpression are `principal.type` and
        +     * `principal.subject`. An example expression is: "principal.type ==
        +     * 'iam.googleapis.com/ServiceAccount'" or "principal.subject ==
        +     * 'bob@example.com'".
        +     *
        +     * Allowed operations for `principal.subject`:
        +     *
        +     * - `principal.subject == <principal subject string>`
        +     * - `principal.subject != <principal subject string>`
        +     * - `principal.subject in [<list of principal subjects>]`
        +     * - `principal.subject.startsWith(<string>)`
        +     * - `principal.subject.endsWith(<string>)`
        +     *
        +     * Allowed operations for `principal.type`:
        +     *
        +     * - `principal.type == <principal type string>`
        +     * - `principal.type != <principal type string>`
        +     * - `principal.type in [<list of principal types>]`
        +     *
        +     * Supported principal types are Workspace, Workforce Pool, Workload Pool and
        +     * Service Account. Allowed string must be one of:
        +     *
        +     * - iam.googleapis.com/WorkspaceIdentity
        +     * - iam.googleapis.com/WorkforcePoolIdentity
        +     * - iam.googleapis.com/WorkloadPoolIdentity
        +     * - iam.googleapis.com/ServiceAccount
        +     * 
        + * + * .google.type.Expr condition = 8 [(.google.api.field_behavior) = OPTIONAL]; + */ + public Builder clearCondition() { + bitField0_ = (bitField0_ & ~0x00000200); + condition_ = null; + if (conditionBuilder_ != null) { + conditionBuilder_.dispose(); + conditionBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
        +     * Optional. The condition to apply to the policy binding. When set, the
        +     * `expression` field in the `Expr` must include from 1 to 10 subexpressions,
        +     * joined by the
        +     * "||"(Logical OR), "&&"(Logical AND) or "!"(Logical NOT) operators and
        +     * cannot contain more than 250 characters.
        +     *
        +     * The condition is currently only supported when bound to policies of kind
        +     * principal access boundary.
        +     *
        +     * When the bound policy is a principal access boundary policy, the only
        +     * supported attributes in any subexpression are `principal.type` and
        +     * `principal.subject`. An example expression is: "principal.type ==
        +     * 'iam.googleapis.com/ServiceAccount'" or "principal.subject ==
        +     * 'bob@example.com'".
        +     *
        +     * Allowed operations for `principal.subject`:
        +     *
        +     * - `principal.subject == <principal subject string>`
        +     * - `principal.subject != <principal subject string>`
        +     * - `principal.subject in [<list of principal subjects>]`
        +     * - `principal.subject.startsWith(<string>)`
        +     * - `principal.subject.endsWith(<string>)`
        +     *
        +     * Allowed operations for `principal.type`:
        +     *
        +     * - `principal.type == <principal type string>`
        +     * - `principal.type != <principal type string>`
        +     * - `principal.type in [<list of principal types>]`
        +     *
        +     * Supported principal types are Workspace, Workforce Pool, Workload Pool and
        +     * Service Account. Allowed string must be one of:
        +     *
        +     * - iam.googleapis.com/WorkspaceIdentity
        +     * - iam.googleapis.com/WorkforcePoolIdentity
        +     * - iam.googleapis.com/WorkloadPoolIdentity
        +     * - iam.googleapis.com/ServiceAccount
        +     * 
        + * + * .google.type.Expr condition = 8 [(.google.api.field_behavior) = OPTIONAL]; + */ + public com.google.type.Expr.Builder getConditionBuilder() { + bitField0_ |= 0x00000200; + onChanged(); + return internalGetConditionFieldBuilder().getBuilder(); + } + + /** + * + * + *
        +     * Optional. The condition to apply to the policy binding. When set, the
        +     * `expression` field in the `Expr` must include from 1 to 10 subexpressions,
        +     * joined by the
        +     * "||"(Logical OR), "&&"(Logical AND) or "!"(Logical NOT) operators and
        +     * cannot contain more than 250 characters.
        +     *
        +     * The condition is currently only supported when bound to policies of kind
        +     * principal access boundary.
        +     *
        +     * When the bound policy is a principal access boundary policy, the only
        +     * supported attributes in any subexpression are `principal.type` and
        +     * `principal.subject`. An example expression is: "principal.type ==
        +     * 'iam.googleapis.com/ServiceAccount'" or "principal.subject ==
        +     * 'bob@example.com'".
        +     *
        +     * Allowed operations for `principal.subject`:
        +     *
        +     * - `principal.subject == <principal subject string>`
        +     * - `principal.subject != <principal subject string>`
        +     * - `principal.subject in [<list of principal subjects>]`
        +     * - `principal.subject.startsWith(<string>)`
        +     * - `principal.subject.endsWith(<string>)`
        +     *
        +     * Allowed operations for `principal.type`:
        +     *
        +     * - `principal.type == <principal type string>`
        +     * - `principal.type != <principal type string>`
        +     * - `principal.type in [<list of principal types>]`
        +     *
        +     * Supported principal types are Workspace, Workforce Pool, Workload Pool and
        +     * Service Account. Allowed string must be one of:
        +     *
        +     * - iam.googleapis.com/WorkspaceIdentity
        +     * - iam.googleapis.com/WorkforcePoolIdentity
        +     * - iam.googleapis.com/WorkloadPoolIdentity
        +     * - iam.googleapis.com/ServiceAccount
        +     * 
        + * + * .google.type.Expr condition = 8 [(.google.api.field_behavior) = OPTIONAL]; + */ + public com.google.type.ExprOrBuilder getConditionOrBuilder() { + if (conditionBuilder_ != null) { + return conditionBuilder_.getMessageOrBuilder(); + } else { + return condition_ == null ? com.google.type.Expr.getDefaultInstance() : condition_; + } + } + + /** + * + * + *
        +     * Optional. The condition to apply to the policy binding. When set, the
        +     * `expression` field in the `Expr` must include from 1 to 10 subexpressions,
        +     * joined by the
        +     * "||"(Logical OR), "&&"(Logical AND) or "!"(Logical NOT) operators and
        +     * cannot contain more than 250 characters.
        +     *
        +     * The condition is currently only supported when bound to policies of kind
        +     * principal access boundary.
        +     *
        +     * When the bound policy is a principal access boundary policy, the only
        +     * supported attributes in any subexpression are `principal.type` and
        +     * `principal.subject`. An example expression is: "principal.type ==
        +     * 'iam.googleapis.com/ServiceAccount'" or "principal.subject ==
        +     * 'bob@example.com'".
        +     *
        +     * Allowed operations for `principal.subject`:
        +     *
        +     * - `principal.subject == <principal subject string>`
        +     * - `principal.subject != <principal subject string>`
        +     * - `principal.subject in [<list of principal subjects>]`
        +     * - `principal.subject.startsWith(<string>)`
        +     * - `principal.subject.endsWith(<string>)`
        +     *
        +     * Allowed operations for `principal.type`:
        +     *
        +     * - `principal.type == <principal type string>`
        +     * - `principal.type != <principal type string>`
        +     * - `principal.type in [<list of principal types>]`
        +     *
        +     * Supported principal types are Workspace, Workforce Pool, Workload Pool and
        +     * Service Account. Allowed string must be one of:
        +     *
        +     * - iam.googleapis.com/WorkspaceIdentity
        +     * - iam.googleapis.com/WorkforcePoolIdentity
        +     * - iam.googleapis.com/WorkloadPoolIdentity
        +     * - iam.googleapis.com/ServiceAccount
        +     * 
        + * + * .google.type.Expr condition = 8 [(.google.api.field_behavior) = OPTIONAL]; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.type.Expr, com.google.type.Expr.Builder, com.google.type.ExprOrBuilder> + internalGetConditionFieldBuilder() { + if (conditionBuilder_ == null) { + conditionBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.type.Expr, com.google.type.Expr.Builder, com.google.type.ExprOrBuilder>( + getCondition(), getParentForChildren(), isClean()); + condition_ = null; + } + return conditionBuilder_; + } + + private com.google.protobuf.Timestamp createTime_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + createTimeBuilder_; + + /** + * + * + *
        +     * Output only. The time when the policy binding was created.
        +     * 
        + * + * + * .google.protobuf.Timestamp create_time = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the createTime field is set. + */ + public boolean hasCreateTime() { + return ((bitField0_ & 0x00000400) != 0); + } + + /** + * + * + *
        +     * Output only. The time when the policy binding was created.
        +     * 
        + * + * + * .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 time when the policy binding was created.
        +     * 
        + * + * + * .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_ |= 0x00000400; + onChanged(); + return this; + } + + /** + * + * + *
        +     * Output only. The time when the policy binding was created.
        +     * 
        + * + * + * .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_ |= 0x00000400; + onChanged(); + return this; + } + + /** + * + * + *
        +     * Output only. The time when the policy binding was created.
        +     * 
        + * + * + * .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_ & 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 time when the policy binding was created.
        +     * 
        + * + * + * .google.protobuf.Timestamp create_time = 9 [(.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 time when the policy binding was created.
        +     * 
        + * + * + * .google.protobuf.Timestamp create_time = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.Timestamp.Builder getCreateTimeBuilder() { + bitField0_ |= 0x00000400; + onChanged(); + return internalGetCreateTimeFieldBuilder().getBuilder(); + } + + /** + * + * + *
        +     * Output only. The time when the policy binding was created.
        +     * 
        + * + * + * .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 time when the policy binding was created.
        +     * 
        + * + * + * .google.protobuf.Timestamp create_time = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + internalGetCreateTimeFieldBuilder() { + if (createTimeBuilder_ == null) { + createTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + 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.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + updateTimeBuilder_; + + /** + * + * + *
        +     * Output only. The time when the policy binding was most recently updated.
        +     * 
        + * + * + * .google.protobuf.Timestamp update_time = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the updateTime field is set. + */ + public boolean hasUpdateTime() { + return ((bitField0_ & 0x00000800) != 0); + } + + /** + * + * + *
        +     * Output only. The time when the policy binding was most recently updated.
        +     * 
        + * + * + * .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 time when the policy binding was most recently updated.
        +     * 
        + * + * + * .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_ |= 0x00000800; + onChanged(); + return this; + } + + /** + * + * + *
        +     * Output only. The time when the policy binding was most recently updated.
        +     * 
        + * + * + * .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_ |= 0x00000800; + onChanged(); + return this; + } + + /** + * + * + *
        +     * Output only. The time when the policy binding was most recently updated.
        +     * 
        + * + * + * .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_ & 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 time when the policy binding was most recently updated.
        +     * 
        + * + * + * .google.protobuf.Timestamp update_time = 10 [(.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 time when the policy binding was most recently updated.
        +     * 
        + * + * + * .google.protobuf.Timestamp update_time = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.Timestamp.Builder getUpdateTimeBuilder() { + bitField0_ |= 0x00000800; + onChanged(); + return internalGetUpdateTimeFieldBuilder().getBuilder(); + } + + /** + * + * + *
        +     * Output only. The time when the policy binding was most recently updated.
        +     * 
        + * + * + * .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 time when the policy binding was most recently updated.
        +     * 
        + * + * + * .google.protobuf.Timestamp update_time = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + internalGetUpdateTimeFieldBuilder() { + if (updateTimeBuilder_ == null) { + updateTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getUpdateTime(), getParentForChildren(), isClean()); + updateTime_ = null; + } + return updateTimeBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.iam.v3.PolicyBinding) + } + + // @@protoc_insertion_point(class_scope:google.iam.v3.PolicyBinding) + private static final com.google.iam.v3.PolicyBinding DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.iam.v3.PolicyBinding(); + } + + public static com.google.iam.v3.PolicyBinding getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public PolicyBinding 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.iam.v3.PolicyBinding getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-iam/proto-google-iam-v3/src/main/java/com/google/iam/v3/PolicyBindingName.java b/java-iam/proto-google-iam-v3/src/main/java/com/google/iam/v3/PolicyBindingName.java new file mode 100644 index 0000000000..6bd5c89a0b --- /dev/null +++ b/java-iam/proto-google-iam-v3/src/main/java/com/google/iam/v3/PolicyBindingName.java @@ -0,0 +1,449 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.iam.v3; + +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 PolicyBindingName implements ResourceName { + private static final PathTemplate ORGANIZATION_LOCATION_POLICY_BINDING = + PathTemplate.createWithoutUrlEncoding( + "organizations/{organization}/locations/{location}/policyBindings/{policy_binding}"); + private static final PathTemplate FOLDER_LOCATION_POLICY_BINDING = + PathTemplate.createWithoutUrlEncoding( + "folders/{folder}/locations/{location}/policyBindings/{policy_binding}"); + private static final PathTemplate PROJECT_LOCATION_POLICY_BINDING = + PathTemplate.createWithoutUrlEncoding( + "projects/{project}/locations/{location}/policyBindings/{policy_binding}"); + private volatile Map fieldValuesMap; + private PathTemplate pathTemplate; + private String fixedValue; + private final String organization; + private final String location; + private final String policyBinding; + private final String folder; + private final String project; + + @Deprecated + protected PolicyBindingName() { + organization = null; + location = null; + policyBinding = null; + folder = null; + project = null; + } + + private PolicyBindingName(Builder builder) { + organization = Preconditions.checkNotNull(builder.getOrganization()); + location = Preconditions.checkNotNull(builder.getLocation()); + policyBinding = Preconditions.checkNotNull(builder.getPolicyBinding()); + folder = null; + project = null; + pathTemplate = ORGANIZATION_LOCATION_POLICY_BINDING; + } + + private PolicyBindingName(FolderLocationPolicyBindingBuilder builder) { + folder = Preconditions.checkNotNull(builder.getFolder()); + location = Preconditions.checkNotNull(builder.getLocation()); + policyBinding = Preconditions.checkNotNull(builder.getPolicyBinding()); + organization = null; + project = null; + pathTemplate = FOLDER_LOCATION_POLICY_BINDING; + } + + private PolicyBindingName(ProjectLocationPolicyBindingBuilder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + location = Preconditions.checkNotNull(builder.getLocation()); + policyBinding = Preconditions.checkNotNull(builder.getPolicyBinding()); + organization = null; + folder = null; + pathTemplate = PROJECT_LOCATION_POLICY_BINDING; + } + + public String getOrganization() { + return organization; + } + + public String getLocation() { + return location; + } + + public String getPolicyBinding() { + return policyBinding; + } + + public String getFolder() { + return folder; + } + + public String getProject() { + return project; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public static Builder newOrganizationLocationPolicyBindingBuilder() { + return new Builder(); + } + + public static FolderLocationPolicyBindingBuilder newFolderLocationPolicyBindingBuilder() { + return new FolderLocationPolicyBindingBuilder(); + } + + public static ProjectLocationPolicyBindingBuilder newProjectLocationPolicyBindingBuilder() { + return new ProjectLocationPolicyBindingBuilder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + public static PolicyBindingName of(String organization, String location, String policyBinding) { + return newBuilder() + .setOrganization(organization) + .setLocation(location) + .setPolicyBinding(policyBinding) + .build(); + } + + public static PolicyBindingName ofOrganizationLocationPolicyBindingName( + String organization, String location, String policyBinding) { + return newBuilder() + .setOrganization(organization) + .setLocation(location) + .setPolicyBinding(policyBinding) + .build(); + } + + public static PolicyBindingName ofFolderLocationPolicyBindingName( + String folder, String location, String policyBinding) { + return newFolderLocationPolicyBindingBuilder() + .setFolder(folder) + .setLocation(location) + .setPolicyBinding(policyBinding) + .build(); + } + + public static PolicyBindingName ofProjectLocationPolicyBindingName( + String project, String location, String policyBinding) { + return newProjectLocationPolicyBindingBuilder() + .setProject(project) + .setLocation(location) + .setPolicyBinding(policyBinding) + .build(); + } + + public static String format(String organization, String location, String policyBinding) { + return newBuilder() + .setOrganization(organization) + .setLocation(location) + .setPolicyBinding(policyBinding) + .build() + .toString(); + } + + public static String formatOrganizationLocationPolicyBindingName( + String organization, String location, String policyBinding) { + return newBuilder() + .setOrganization(organization) + .setLocation(location) + .setPolicyBinding(policyBinding) + .build() + .toString(); + } + + public static String formatFolderLocationPolicyBindingName( + String folder, String location, String policyBinding) { + return newFolderLocationPolicyBindingBuilder() + .setFolder(folder) + .setLocation(location) + .setPolicyBinding(policyBinding) + .build() + .toString(); + } + + public static String formatProjectLocationPolicyBindingName( + String project, String location, String policyBinding) { + return newProjectLocationPolicyBindingBuilder() + .setProject(project) + .setLocation(location) + .setPolicyBinding(policyBinding) + .build() + .toString(); + } + + public static PolicyBindingName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + if (ORGANIZATION_LOCATION_POLICY_BINDING.matches(formattedString)) { + Map matchMap = ORGANIZATION_LOCATION_POLICY_BINDING.match(formattedString); + return ofOrganizationLocationPolicyBindingName( + matchMap.get("organization"), matchMap.get("location"), matchMap.get("policy_binding")); + } else if (FOLDER_LOCATION_POLICY_BINDING.matches(formattedString)) { + Map matchMap = FOLDER_LOCATION_POLICY_BINDING.match(formattedString); + return ofFolderLocationPolicyBindingName( + matchMap.get("folder"), matchMap.get("location"), matchMap.get("policy_binding")); + } else if (PROJECT_LOCATION_POLICY_BINDING.matches(formattedString)) { + Map matchMap = PROJECT_LOCATION_POLICY_BINDING.match(formattedString); + return ofProjectLocationPolicyBindingName( + matchMap.get("project"), matchMap.get("location"), matchMap.get("policy_binding")); + } + throw new ValidationException("PolicyBindingName.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 (PolicyBindingName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return ORGANIZATION_LOCATION_POLICY_BINDING.matches(formattedString) + || FOLDER_LOCATION_POLICY_BINDING.matches(formattedString) + || PROJECT_LOCATION_POLICY_BINDING.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); + } + if (policyBinding != null) { + fieldMapBuilder.put("policy_binding", policyBinding); + } + if (folder != null) { + fieldMapBuilder.put("folder", folder); + } + 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 fixedValue != null ? fixedValue : pathTemplate.instantiate(getFieldValuesMap()); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o != null && getClass() == o.getClass()) { + PolicyBindingName that = ((PolicyBindingName) o); + return Objects.equals(this.organization, that.organization) + && Objects.equals(this.location, that.location) + && Objects.equals(this.policyBinding, that.policyBinding) + && Objects.equals(this.folder, that.folder) + && Objects.equals(this.project, that.project); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= Objects.hashCode(fixedValue); + h *= 1000003; + h ^= Objects.hashCode(organization); + h *= 1000003; + h ^= Objects.hashCode(location); + h *= 1000003; + h ^= Objects.hashCode(policyBinding); + h *= 1000003; + h ^= Objects.hashCode(folder); + h *= 1000003; + h ^= Objects.hashCode(project); + return h; + } + + /** + * Builder for organizations/{organization}/locations/{location}/policyBindings/{policy_binding}. + */ + public static class Builder { + private String organization; + private String location; + private String policyBinding; + + protected Builder() {} + + public String getOrganization() { + return organization; + } + + public String getLocation() { + return location; + } + + public String getPolicyBinding() { + return policyBinding; + } + + public Builder setOrganization(String organization) { + this.organization = organization; + return this; + } + + public Builder setLocation(String location) { + this.location = location; + return this; + } + + public Builder setPolicyBinding(String policyBinding) { + this.policyBinding = policyBinding; + return this; + } + + private Builder(PolicyBindingName policyBindingName) { + Preconditions.checkArgument( + Objects.equals(policyBindingName.pathTemplate, ORGANIZATION_LOCATION_POLICY_BINDING), + "toBuilder is only supported when PolicyBindingName has the pattern of" + + " organizations/{organization}/locations/{location}/policyBindings/{policy_binding}"); + this.organization = policyBindingName.organization; + this.location = policyBindingName.location; + this.policyBinding = policyBindingName.policyBinding; + } + + public PolicyBindingName build() { + return new PolicyBindingName(this); + } + } + + /** Builder for folders/{folder}/locations/{location}/policyBindings/{policy_binding}. */ + public static class FolderLocationPolicyBindingBuilder { + private String folder; + private String location; + private String policyBinding; + + protected FolderLocationPolicyBindingBuilder() {} + + public String getFolder() { + return folder; + } + + public String getLocation() { + return location; + } + + public String getPolicyBinding() { + return policyBinding; + } + + public FolderLocationPolicyBindingBuilder setFolder(String folder) { + this.folder = folder; + return this; + } + + public FolderLocationPolicyBindingBuilder setLocation(String location) { + this.location = location; + return this; + } + + public FolderLocationPolicyBindingBuilder setPolicyBinding(String policyBinding) { + this.policyBinding = policyBinding; + return this; + } + + public PolicyBindingName build() { + return new PolicyBindingName(this); + } + } + + /** Builder for projects/{project}/locations/{location}/policyBindings/{policy_binding}. */ + public static class ProjectLocationPolicyBindingBuilder { + private String project; + private String location; + private String policyBinding; + + protected ProjectLocationPolicyBindingBuilder() {} + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public String getPolicyBinding() { + return policyBinding; + } + + public ProjectLocationPolicyBindingBuilder setProject(String project) { + this.project = project; + return this; + } + + public ProjectLocationPolicyBindingBuilder setLocation(String location) { + this.location = location; + return this; + } + + public ProjectLocationPolicyBindingBuilder setPolicyBinding(String policyBinding) { + this.policyBinding = policyBinding; + return this; + } + + public PolicyBindingName build() { + return new PolicyBindingName(this); + } + } +} diff --git a/java-iam/proto-google-iam-v3/src/main/java/com/google/iam/v3/PolicyBindingOrBuilder.java b/java-iam/proto-google-iam-v3/src/main/java/com/google/iam/v3/PolicyBindingOrBuilder.java new file mode 100644 index 0000000000..46b6ce9d50 --- /dev/null +++ b/java-iam/proto-google-iam-v3/src/main/java/com/google/iam/v3/PolicyBindingOrBuilder.java @@ -0,0 +1,604 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/iam/v3/policy_binding_resources.proto +// Protobuf Java Version: 4.33.2 + +package com.google.iam.v3; + +@com.google.protobuf.Generated +public interface PolicyBindingOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.iam.v3.PolicyBinding) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
        +   * Identifier. The name of the policy binding, in the format
        +   * `{binding_parent/locations/{location}/policyBindings/{policy_binding_id}`.
        +   * The binding parent is the closest Resource Manager resource (project,
        +   * folder, or organization) to the binding target.
        +   *
        +   * Format:
        +   *
        +   * * `projects/{project_id}/locations/{location}/policyBindings/{policy_binding_id}`
        +   * * `projects/{project_number}/locations/{location}/policyBindings/{policy_binding_id}`
        +   * * `folders/{folder_id}/locations/{location}/policyBindings/{policy_binding_id}`
        +   * * `organizations/{organization_id}/locations/{location}/policyBindings/{policy_binding_id}`
        +   * 
        + * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @return The name. + */ + java.lang.String getName(); + + /** + * + * + *
        +   * Identifier. The name of the policy binding, in the format
        +   * `{binding_parent/locations/{location}/policyBindings/{policy_binding_id}`.
        +   * The binding parent is the closest Resource Manager resource (project,
        +   * folder, or organization) to the binding target.
        +   *
        +   * Format:
        +   *
        +   * * `projects/{project_id}/locations/{location}/policyBindings/{policy_binding_id}`
        +   * * `projects/{project_number}/locations/{location}/policyBindings/{policy_binding_id}`
        +   * * `folders/{folder_id}/locations/{location}/policyBindings/{policy_binding_id}`
        +   * * `organizations/{organization_id}/locations/{location}/policyBindings/{policy_binding_id}`
        +   * 
        + * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
        +   * Output only. The globally unique ID of the policy binding. Assigned when
        +   * the policy binding is created.
        +   * 
        + * + * + * string uid = 2 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_info) = { ... } + * + * + * @return The uid. + */ + java.lang.String getUid(); + + /** + * + * + *
        +   * Output only. The globally unique ID of the policy binding. Assigned when
        +   * the policy binding is created.
        +   * 
        + * + * + * string uid = 2 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_info) = { ... } + * + * + * @return The bytes for uid. + */ + com.google.protobuf.ByteString getUidBytes(); + + /** + * + * + *
        +   * Optional. The etag for the policy binding.
        +   * If this is provided on update, it must match the server's etag.
        +   * 
        + * + * string etag = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The etag. + */ + java.lang.String getEtag(); + + /** + * + * + *
        +   * Optional. The etag for the policy binding.
        +   * If this is provided on update, it must match the server's etag.
        +   * 
        + * + * string etag = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for etag. + */ + com.google.protobuf.ByteString getEtagBytes(); + + /** + * + * + *
        +   * Optional. The description of the policy binding. Must be less than or equal
        +   * to 63 characters.
        +   * 
        + * + * string display_name = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The displayName. + */ + java.lang.String getDisplayName(); + + /** + * + * + *
        +   * Optional. The description of the policy binding. Must be less than or equal
        +   * to 63 characters.
        +   * 
        + * + * string display_name = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for displayName. + */ + com.google.protobuf.ByteString getDisplayNameBytes(); + + /** + * + * + *
        +   * Optional. User-defined annotations. See
        +   * https://google.aip.dev/148#annotations for more details such as format and
        +   * size limitations
        +   * 
        + * + * map<string, string> annotations = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + int getAnnotationsCount(); + + /** + * + * + *
        +   * Optional. User-defined annotations. See
        +   * https://google.aip.dev/148#annotations for more details such as format and
        +   * size limitations
        +   * 
        + * + * map<string, string> annotations = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + boolean containsAnnotations(java.lang.String key); + + /** Use {@link #getAnnotationsMap()} instead. */ + @java.lang.Deprecated + java.util.Map getAnnotations(); + + /** + * + * + *
        +   * Optional. User-defined annotations. See
        +   * https://google.aip.dev/148#annotations for more details such as format and
        +   * size limitations
        +   * 
        + * + * map<string, string> annotations = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + java.util.Map getAnnotationsMap(); + + /** + * + * + *
        +   * Optional. User-defined annotations. See
        +   * https://google.aip.dev/148#annotations for more details such as format and
        +   * size limitations
        +   * 
        + * + * map<string, string> annotations = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + /* nullable */ + java.lang.String getAnnotationsOrDefault( + java.lang.String key, + /* nullable */ + java.lang.String defaultValue); + + /** + * + * + *
        +   * Optional. User-defined annotations. See
        +   * https://google.aip.dev/148#annotations for more details such as format and
        +   * size limitations
        +   * 
        + * + * map<string, string> annotations = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + java.lang.String getAnnotationsOrThrow(java.lang.String key); + + /** + * + * + *
        +   * Required. Immutable. Target is the full resource name of the resource to
        +   * which the policy will be bound. Immutable once set.
        +   * 
        + * + * + * .google.iam.v3.PolicyBinding.Target target = 6 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the target field is set. + */ + boolean hasTarget(); + + /** + * + * + *
        +   * Required. Immutable. Target is the full resource name of the resource to
        +   * which the policy will be bound. Immutable once set.
        +   * 
        + * + * + * .google.iam.v3.PolicyBinding.Target target = 6 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = REQUIRED]; + * + * + * @return The target. + */ + com.google.iam.v3.PolicyBinding.Target getTarget(); + + /** + * + * + *
        +   * Required. Immutable. Target is the full resource name of the resource to
        +   * which the policy will be bound. Immutable once set.
        +   * 
        + * + * + * .google.iam.v3.PolicyBinding.Target target = 6 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.iam.v3.PolicyBinding.TargetOrBuilder getTargetOrBuilder(); + + /** + * + * + *
        +   * Immutable. The kind of the policy to attach in this binding. This field
        +   * must be one of the following:
        +   *
        +   * - Left empty (will be automatically set to the policy kind)
        +   * - The input policy kind
        +   * 
        + * + * + * .google.iam.v3.PolicyBinding.PolicyKind policy_kind = 11 [(.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return The enum numeric value on the wire for policyKind. + */ + int getPolicyKindValue(); + + /** + * + * + *
        +   * Immutable. The kind of the policy to attach in this binding. This field
        +   * must be one of the following:
        +   *
        +   * - Left empty (will be automatically set to the policy kind)
        +   * - The input policy kind
        +   * 
        + * + * + * .google.iam.v3.PolicyBinding.PolicyKind policy_kind = 11 [(.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return The policyKind. + */ + com.google.iam.v3.PolicyBinding.PolicyKind getPolicyKind(); + + /** + * + * + *
        +   * Required. Immutable. The resource name of the policy to be bound. The
        +   * binding parent and policy must belong to the same organization.
        +   * 
        + * + * + * string policy = 7 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = REQUIRED]; + * + * + * @return The policy. + */ + java.lang.String getPolicy(); + + /** + * + * + *
        +   * Required. Immutable. The resource name of the policy to be bound. The
        +   * binding parent and policy must belong to the same organization.
        +   * 
        + * + * + * string policy = 7 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = REQUIRED]; + * + * + * @return The bytes for policy. + */ + com.google.protobuf.ByteString getPolicyBytes(); + + /** + * + * + *
        +   * Output only. The globally unique ID of the policy to be bound.
        +   * 
        + * + * string policy_uid = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The policyUid. + */ + java.lang.String getPolicyUid(); + + /** + * + * + *
        +   * Output only. The globally unique ID of the policy to be bound.
        +   * 
        + * + * string policy_uid = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for policyUid. + */ + com.google.protobuf.ByteString getPolicyUidBytes(); + + /** + * + * + *
        +   * Optional. The condition to apply to the policy binding. When set, the
        +   * `expression` field in the `Expr` must include from 1 to 10 subexpressions,
        +   * joined by the
        +   * "||"(Logical OR), "&&"(Logical AND) or "!"(Logical NOT) operators and
        +   * cannot contain more than 250 characters.
        +   *
        +   * The condition is currently only supported when bound to policies of kind
        +   * principal access boundary.
        +   *
        +   * When the bound policy is a principal access boundary policy, the only
        +   * supported attributes in any subexpression are `principal.type` and
        +   * `principal.subject`. An example expression is: "principal.type ==
        +   * 'iam.googleapis.com/ServiceAccount'" or "principal.subject ==
        +   * 'bob@example.com'".
        +   *
        +   * Allowed operations for `principal.subject`:
        +   *
        +   * - `principal.subject == <principal subject string>`
        +   * - `principal.subject != <principal subject string>`
        +   * - `principal.subject in [<list of principal subjects>]`
        +   * - `principal.subject.startsWith(<string>)`
        +   * - `principal.subject.endsWith(<string>)`
        +   *
        +   * Allowed operations for `principal.type`:
        +   *
        +   * - `principal.type == <principal type string>`
        +   * - `principal.type != <principal type string>`
        +   * - `principal.type in [<list of principal types>]`
        +   *
        +   * Supported principal types are Workspace, Workforce Pool, Workload Pool and
        +   * Service Account. Allowed string must be one of:
        +   *
        +   * - iam.googleapis.com/WorkspaceIdentity
        +   * - iam.googleapis.com/WorkforcePoolIdentity
        +   * - iam.googleapis.com/WorkloadPoolIdentity
        +   * - iam.googleapis.com/ServiceAccount
        +   * 
        + * + * .google.type.Expr condition = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return Whether the condition field is set. + */ + boolean hasCondition(); + + /** + * + * + *
        +   * Optional. The condition to apply to the policy binding. When set, the
        +   * `expression` field in the `Expr` must include from 1 to 10 subexpressions,
        +   * joined by the
        +   * "||"(Logical OR), "&&"(Logical AND) or "!"(Logical NOT) operators and
        +   * cannot contain more than 250 characters.
        +   *
        +   * The condition is currently only supported when bound to policies of kind
        +   * principal access boundary.
        +   *
        +   * When the bound policy is a principal access boundary policy, the only
        +   * supported attributes in any subexpression are `principal.type` and
        +   * `principal.subject`. An example expression is: "principal.type ==
        +   * 'iam.googleapis.com/ServiceAccount'" or "principal.subject ==
        +   * 'bob@example.com'".
        +   *
        +   * Allowed operations for `principal.subject`:
        +   *
        +   * - `principal.subject == <principal subject string>`
        +   * - `principal.subject != <principal subject string>`
        +   * - `principal.subject in [<list of principal subjects>]`
        +   * - `principal.subject.startsWith(<string>)`
        +   * - `principal.subject.endsWith(<string>)`
        +   *
        +   * Allowed operations for `principal.type`:
        +   *
        +   * - `principal.type == <principal type string>`
        +   * - `principal.type != <principal type string>`
        +   * - `principal.type in [<list of principal types>]`
        +   *
        +   * Supported principal types are Workspace, Workforce Pool, Workload Pool and
        +   * Service Account. Allowed string must be one of:
        +   *
        +   * - iam.googleapis.com/WorkspaceIdentity
        +   * - iam.googleapis.com/WorkforcePoolIdentity
        +   * - iam.googleapis.com/WorkloadPoolIdentity
        +   * - iam.googleapis.com/ServiceAccount
        +   * 
        + * + * .google.type.Expr condition = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The condition. + */ + com.google.type.Expr getCondition(); + + /** + * + * + *
        +   * Optional. The condition to apply to the policy binding. When set, the
        +   * `expression` field in the `Expr` must include from 1 to 10 subexpressions,
        +   * joined by the
        +   * "||"(Logical OR), "&&"(Logical AND) or "!"(Logical NOT) operators and
        +   * cannot contain more than 250 characters.
        +   *
        +   * The condition is currently only supported when bound to policies of kind
        +   * principal access boundary.
        +   *
        +   * When the bound policy is a principal access boundary policy, the only
        +   * supported attributes in any subexpression are `principal.type` and
        +   * `principal.subject`. An example expression is: "principal.type ==
        +   * 'iam.googleapis.com/ServiceAccount'" or "principal.subject ==
        +   * 'bob@example.com'".
        +   *
        +   * Allowed operations for `principal.subject`:
        +   *
        +   * - `principal.subject == <principal subject string>`
        +   * - `principal.subject != <principal subject string>`
        +   * - `principal.subject in [<list of principal subjects>]`
        +   * - `principal.subject.startsWith(<string>)`
        +   * - `principal.subject.endsWith(<string>)`
        +   *
        +   * Allowed operations for `principal.type`:
        +   *
        +   * - `principal.type == <principal type string>`
        +   * - `principal.type != <principal type string>`
        +   * - `principal.type in [<list of principal types>]`
        +   *
        +   * Supported principal types are Workspace, Workforce Pool, Workload Pool and
        +   * Service Account. Allowed string must be one of:
        +   *
        +   * - iam.googleapis.com/WorkspaceIdentity
        +   * - iam.googleapis.com/WorkforcePoolIdentity
        +   * - iam.googleapis.com/WorkloadPoolIdentity
        +   * - iam.googleapis.com/ServiceAccount
        +   * 
        + * + * .google.type.Expr condition = 8 [(.google.api.field_behavior) = OPTIONAL]; + */ + com.google.type.ExprOrBuilder getConditionOrBuilder(); + + /** + * + * + *
        +   * Output only. The time when the policy binding was created.
        +   * 
        + * + * .google.protobuf.Timestamp create_time = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the createTime field is set. + */ + boolean hasCreateTime(); + + /** + * + * + *
        +   * Output only. The time when the policy binding was created.
        +   * 
        + * + * .google.protobuf.Timestamp create_time = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The createTime. + */ + com.google.protobuf.Timestamp getCreateTime(); + + /** + * + * + *
        +   * Output only. The time when the policy binding was created.
        +   * 
        + * + * .google.protobuf.Timestamp create_time = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder(); + + /** + * + * + *
        +   * Output only. The time when the policy binding was most recently updated.
        +   * 
        + * + * .google.protobuf.Timestamp update_time = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the updateTime field is set. + */ + boolean hasUpdateTime(); + + /** + * + * + *
        +   * Output only. The time when the policy binding was most recently updated.
        +   * 
        + * + * .google.protobuf.Timestamp update_time = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The updateTime. + */ + com.google.protobuf.Timestamp getUpdateTime(); + + /** + * + * + *
        +   * Output only. The time when the policy binding was most recently updated.
        +   * 
        + * + * .google.protobuf.Timestamp update_time = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder(); +} diff --git a/java-iam/proto-google-iam-v3/src/main/java/com/google/iam/v3/PolicyBindingResourcesProto.java b/java-iam/proto-google-iam-v3/src/main/java/com/google/iam/v3/PolicyBindingResourcesProto.java new file mode 100644 index 0000000000..f49c7b5d1e --- /dev/null +++ b/java-iam/proto-google-iam-v3/src/main/java/com/google/iam/v3/PolicyBindingResourcesProto.java @@ -0,0 +1,164 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/iam/v3/policy_binding_resources.proto +// Protobuf Java Version: 4.33.2 + +package com.google.iam.v3; + +@com.google.protobuf.Generated +public final class PolicyBindingResourcesProto extends com.google.protobuf.GeneratedFile { + private PolicyBindingResourcesProto() {} + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "PolicyBindingResourcesProto"); + } + + 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_iam_v3_PolicyBinding_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_iam_v3_PolicyBinding_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_iam_v3_PolicyBinding_Target_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_iam_v3_PolicyBinding_Target_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_iam_v3_PolicyBinding_AnnotationsEntry_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_iam_v3_PolicyBinding_AnnotationsEntry_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/iam/v3/policy_binding_resources.proto\022\r" + + "google.iam.v3\032\037google/api/field_behavior.proto\032\033google/api/field_info.pr" + + "oto\032\031google/api/resource.proto\032\037google/p" + + "rotobuf/timestamp.proto\032\026google/type/expr.proto\"\326\007\n\r" + + "PolicyBinding\022\021\n" + + "\004name\030\001 \001(\tB\003\340A\010\022\030\n" + + "\003uid\030\002 \001(\tB\013\340A\003\342\214\317\327\010\002\010\001\022\021\n" + + "\004etag\030\003 \001(\tB\003\340A\001\022\031\n" + + "\014display_name\030\004 \001(\tB\003\340A\001\022G\n" + + "\013annotations\030\005" + + " \003(\0132-.google.iam.v3.PolicyBinding.AnnotationsEntryB\003\340A\001\022;\n" + + "\006target\030\006" + + " \001(\0132#.google.iam.v3.PolicyBinding.TargetB\006\340A\005\340A\002\022A\n" + + "\013policy_kind\030\013" + + " \001(\0162\'.google.iam.v3.PolicyBinding.PolicyKindB\003\340A\005\022\026\n" + + "\006policy\030\007 \001(\tB\006\340A\005\340A\002\022\027\n\n" + + "policy_uid\030\014 \001(\tB\003\340A\003\022)\n" + + "\tcondition\030\010 \001(\0132\021.google.type.ExprB\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\0320\n" + + "\006Target\022\034\n\r" + + "principal_set\030\001 \001(\tB\003\340A\005H\000B\010\n" + + "\006target\0322\n" + + "\020AnnotationsEntry\022\013\n" + + "\003key\030\001 \001(\t\022\r\n" + + "\005value\030\002 \001(\t:\0028\001\"H\n\n" + + "PolicyKind\022\033\n" + + "\027POLICY_KIND_UNSPECIFIED\020\000\022\035\n" + + "\031PRINCIPAL_ACCESS_BOUNDARY\020\001:\250\002\352A\244\002\n" + + " iam.googleapis.com/PolicyBinding\022Qorganizations/{organizat" + + "ion}/locations/{location}/policyBindings/{policy_binding}\022Efolders/{folder}/loca" + + "tions/{location}/policyBindings/{policy_binding}\022Gprojects/{project}/locations/{" + + "location}/policyBindings/{policy_binding}*\016policyBindings2\r" + + "policyBindingB\211\001\n" + + "\021com.google.iam.v3B\033PolicyBindingResourcesPr" + + "otoP\001Z)cloud.google.com/go/iam/apiv3/iam" + + "pb;iampb\252\002\023Google.Cloud.Iam.V3\312\002\023Google\\Cloud\\Iam\\V3b\006proto3" + }; + descriptor = + com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( + descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + com.google.api.FieldBehaviorProto.getDescriptor(), + com.google.api.FieldInfoProto.getDescriptor(), + com.google.api.ResourceProto.getDescriptor(), + com.google.protobuf.TimestampProto.getDescriptor(), + com.google.type.ExprProto.getDescriptor(), + }); + internal_static_google_iam_v3_PolicyBinding_descriptor = getDescriptor().getMessageType(0); + internal_static_google_iam_v3_PolicyBinding_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_iam_v3_PolicyBinding_descriptor, + new java.lang.String[] { + "Name", + "Uid", + "Etag", + "DisplayName", + "Annotations", + "Target", + "PolicyKind", + "Policy", + "PolicyUid", + "Condition", + "CreateTime", + "UpdateTime", + }); + internal_static_google_iam_v3_PolicyBinding_Target_descriptor = + internal_static_google_iam_v3_PolicyBinding_descriptor.getNestedType(0); + internal_static_google_iam_v3_PolicyBinding_Target_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_iam_v3_PolicyBinding_Target_descriptor, + new java.lang.String[] { + "PrincipalSet", "Target", + }); + internal_static_google_iam_v3_PolicyBinding_AnnotationsEntry_descriptor = + internal_static_google_iam_v3_PolicyBinding_descriptor.getNestedType(1); + internal_static_google_iam_v3_PolicyBinding_AnnotationsEntry_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_iam_v3_PolicyBinding_AnnotationsEntry_descriptor, + new java.lang.String[] { + "Key", "Value", + }); + descriptor.resolveAllFeaturesImmutable(); + com.google.api.FieldBehaviorProto.getDescriptor(); + com.google.api.FieldInfoProto.getDescriptor(); + com.google.api.ResourceProto.getDescriptor(); + com.google.protobuf.TimestampProto.getDescriptor(); + com.google.type.ExprProto.getDescriptor(); + com.google.protobuf.ExtensionRegistry registry = + com.google.protobuf.ExtensionRegistry.newInstance(); + registry.add(com.google.api.FieldBehaviorProto.fieldBehavior); + registry.add(com.google.api.FieldInfoProto.fieldInfo); + registry.add(com.google.api.ResourceProto.resource); + com.google.protobuf.Descriptors.FileDescriptor.internalUpdateFileDescriptor( + descriptor, registry); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/java-iam/proto-google-iam-v3/src/main/java/com/google/iam/v3/PolicyBindingsServiceProto.java b/java-iam/proto-google-iam-v3/src/main/java/com/google/iam/v3/PolicyBindingsServiceProto.java new file mode 100644 index 0000000000..49f48baf81 --- /dev/null +++ b/java-iam/proto-google-iam-v3/src/main/java/com/google/iam/v3/PolicyBindingsServiceProto.java @@ -0,0 +1,283 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/iam/v3/policy_bindings_service.proto +// Protobuf Java Version: 4.33.2 + +package com.google.iam.v3; + +@com.google.protobuf.Generated +public final class PolicyBindingsServiceProto extends com.google.protobuf.GeneratedFile { + private PolicyBindingsServiceProto() {} + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "PolicyBindingsServiceProto"); + } + + 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_iam_v3_CreatePolicyBindingRequest_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_iam_v3_CreatePolicyBindingRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_iam_v3_GetPolicyBindingRequest_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_iam_v3_GetPolicyBindingRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_iam_v3_UpdatePolicyBindingRequest_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_iam_v3_UpdatePolicyBindingRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_iam_v3_DeletePolicyBindingRequest_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_iam_v3_DeletePolicyBindingRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_iam_v3_ListPolicyBindingsRequest_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_iam_v3_ListPolicyBindingsRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_iam_v3_ListPolicyBindingsResponse_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_iam_v3_ListPolicyBindingsResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_iam_v3_SearchTargetPolicyBindingsRequest_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_iam_v3_SearchTargetPolicyBindingsRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_iam_v3_SearchTargetPolicyBindingsResponse_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_iam_v3_SearchTargetPolicyBindingsResponse_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/iam/v3/policy_bindings_service.proto\022\r" + + "google.iam.v3\032\034google/api/annotat" + + "ions.proto\032\027google/api/client.proto\032\037goo" + + "gle/api/field_behavior.proto\032\031google/api" + + "/resource.proto\032&google/iam/v3/operation_metadata.proto\032,google/iam/v3/policy_bi" + + "nding_resources.proto\032#google/longrunnin" + + "g/operations.proto\032\033google/protobuf/empty.proto\032" + + " google/protobuf/field_mask.proto\"\315\001\n" + + "\032CreatePolicyBindingRequest\0228\n" + + "\006parent\030\001 \001(\tB(\340A\002\372A\"\022" + + " iam.googleapis.com/PolicyBinding\022\036\n" + + "\021policy_binding_id\030\002 \001(\tB\003\340A\002\0229\n" + + "\016policy_binding\030\003" + + " \001(\0132\034.google.iam.v3.PolicyBindingB\003\340A\002\022\032\n\r" + + "validate_only\030\004 \001(\010B\003\340A\001\"Q\n" + + "\027GetPolicyBindingRequest\0226\n" + + "\004name\030\001 \001(\tB(\340A\002\372A\"\n" + + " iam.googleapis.com/PolicyBinding\"\251\001\n" + + "\032UpdatePolicyBindingRequest\0229\n" + + "\016policy_binding\030\001" + + " \001(\0132\034.google.iam.v3.PolicyBindingB\003\340A\002\022\032\n\r" + + "validate_only\030\002 \001(\010B\003\340A\001\0224\n" + + "\013update_mask\030\003" + + " \001(\0132\032.google.protobuf.FieldMaskB\003\340A\001\"\203\001\n" + + "\032DeletePolicyBindingRequest\0226\n" + + "\004name\030\001 \001(\tB(\340A\002\372A\"\n" + + " iam.googleapis.com/PolicyBinding\022\021\n" + + "\004etag\030\002 \001(\tB\003\340A\001\022\032\n\r" + + "validate_only\030\003 \001(\010B\003\340A\001\"\233\001\n" + + "\031ListPolicyBindingsRequest\0228\n" + + "\006parent\030\001 \001(\tB(\340A\002\372A\"\022" + + " iam.googleapis.com/PolicyBinding\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\022\023\n" + + "\006filter\030\004 \001(\tB\003\340A\001\"q\n" + + "\032ListPolicyBindingsResponse\0225\n" + + "\017policy_bindings\030\001 \003(\0132\034.google.iam.v3.PolicyBinding\022\034\n" + + "\017next_page_token\030\002 \001(\tB\003\340A\001\"\243\001\n" + + "!SearchTargetPolicyBindingsRequest\022\023\n" + + "\006target\030\001 \001(\tB\003\340A\002\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\0228\n" + + "\006parent\030\005 \001(\tB(\340A\002\372A\"\022 iam.googleapis.com/PolicyBinding\"y\n" + + "\"SearchTargetPolicyBindingsResponse\0225\n" + + "\017policy_bindings\030\001 \003(\0132\034.google.iam.v3.PolicyBinding\022\034\n" + + "\017next_page_token\030\002 \001(\tB\003\340A\0012\240\021\n" + + "\016PolicyBindings\022\214\003\n" + + "\023CreatePolicyBinding\022).google.iam.v3.CreatePolicyBindingR" + + "equest\032\035.google.longrunning.Operation\"\252\002\312A\"\n\r" + + "PolicyBinding\022\021OperationMetadata\332A\'" + + "parent,policy_binding,policy_binding_id\202" + + "\323\344\223\002\324\001\"2/v3/{parent=projects/*/locations" + + "/*}/policyBindings:\016policy_bindingZC\"1/v3/{parent=folders/*/locations/*}/policyB" + + "indings:\016policy_bindingZI\"7/v3/{parent=o" + + "rganizations/*/locations/*}/policyBindings:\016policy_binding\022\215\002\n" + + "\020GetPolicyBinding\022&.google.iam.v3.GetPolicyBindingRequest\032" + + "\034.google.iam.v3.PolicyBinding\"\262\001\332A\004name\202" + + "\323\344\223\002\244\001\0222/v3/{name=projects/*/locations/*" + + "/policyBindings/*}Z3\0221/v3/{name=folders/*/locations/*/policyBindings/*}Z9\0227/v3/{" + + "name=organizations/*/locations/*/policyBindings/*}\022\254\003\n" + + "\023UpdatePolicyBinding\022).goo" + + "gle.iam.v3.UpdatePolicyBindingRequest\032\035.google.longrunning.Operation\"\312\002\312A\"\n\r" + + "PolicyBinding\022\021OperationMetadata\332A\032policy_bi" + + "nding,update_mask\202\323\344\223\002\201\0022A/v3/{policy_bi" + + "nding.name=projects/*/locations/*/policyBindings/*}:\016policy_bindingZR2@/v3/{poli" + + "cy_binding.name=folders/*/locations/*/policyBindings/*}:\016policy_bindingZX2F/v3/{" + + "policy_binding.name=organizations/*/loca" + + "tions/*/policyBindings/*}:\016policy_binding\022\301\002\n" + + "\023DeletePolicyBinding\022).google.iam.v" + + "3.DeletePolicyBindingRequest\032\035.google.longrunning.Operation\"\337\001\312A*\n" + + "\025google.protob" + + "uf.Empty\022\021OperationMetadata\332A\004name\202\323\344\223\002\244" + + "\001*2/v3/{name=projects/*/locations/*/policyBindings/*}Z3*1/v3/{name=folders/*/loc" + + "ations/*/policyBindings/*}Z9*7/v3/{name=" + + "organizations/*/locations/*/policyBindings/*}\022\240\002\n" + + "\022ListPolicyBindings\022(.google.iam.v3.ListPolicyBindingsRequest\032).google." + + "iam.v3.ListPolicyBindingsResponse\"\264\001\332A\006p" + + "arent\202\323\344\223\002\244\001\0222/v3/{parent=projects/*/loc" + + "ations/*}/policyBindingsZ3\0221/v3/{parent=folders/*/locations/*}/policyBindingsZ9\022" + + "7/v3/{parent=organizations/*/locations/*}/policyBindings\022\220\003\n" + + "\032SearchTargetPolicyBindings\0220.google.iam.v3.SearchTargetPoli" + + "cyBindingsRequest\0321.google.iam.v3.SearchTargetPolicyBindingsResponse\"\214\002\332A\r" + + "parent,target\202\323\344\223\002\365\001\022M/v3/{parent=projects/*/l" + + "ocations/*}/policyBindings:searchTargetPolicyBindingsZN\022L/v3/{parent=folders/*/l" + + "ocations/*}/policyBindings:searchTargetPolicyBindingsZT\022R/v3/{parent=organizatio" + + "ns/*/locations/*}/policyBindings:searchT" + + "argetPolicyBindings\032F\312A\022iam.googleapis.c" + + "om\322A.https://www.googleapis.com/auth/cloud-platformB\264\002\n" + + "\021com.google.iam.v3B\032PolicyBindingsServiceProtoP\001Z)cloud.google.co" + + "m/go/iam/apiv3/iampb;iampb\252\002\023Google.Cloud.Iam.V3\312\002\023Google\\Cloud\\Iam\\V3\352A\\\n" + + "\'iam.googleapis.com/OrganizationLocation\0221orga" + + "nizations/{organization}/locations/{location}\352AJ\n" + + "!iam.googleapis.com/FolderLocation\022%folders/{folder}/locations/{locatio" + + "n}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.iam.v3.OperationMetadataProto.getDescriptor(), + com.google.iam.v3.PolicyBindingResourcesProto.getDescriptor(), + com.google.longrunning.OperationsProto.getDescriptor(), + com.google.protobuf.EmptyProto.getDescriptor(), + com.google.protobuf.FieldMaskProto.getDescriptor(), + }); + internal_static_google_iam_v3_CreatePolicyBindingRequest_descriptor = + getDescriptor().getMessageType(0); + internal_static_google_iam_v3_CreatePolicyBindingRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_iam_v3_CreatePolicyBindingRequest_descriptor, + new java.lang.String[] { + "Parent", "PolicyBindingId", "PolicyBinding", "ValidateOnly", + }); + internal_static_google_iam_v3_GetPolicyBindingRequest_descriptor = + getDescriptor().getMessageType(1); + internal_static_google_iam_v3_GetPolicyBindingRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_iam_v3_GetPolicyBindingRequest_descriptor, + new java.lang.String[] { + "Name", + }); + internal_static_google_iam_v3_UpdatePolicyBindingRequest_descriptor = + getDescriptor().getMessageType(2); + internal_static_google_iam_v3_UpdatePolicyBindingRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_iam_v3_UpdatePolicyBindingRequest_descriptor, + new java.lang.String[] { + "PolicyBinding", "ValidateOnly", "UpdateMask", + }); + internal_static_google_iam_v3_DeletePolicyBindingRequest_descriptor = + getDescriptor().getMessageType(3); + internal_static_google_iam_v3_DeletePolicyBindingRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_iam_v3_DeletePolicyBindingRequest_descriptor, + new java.lang.String[] { + "Name", "Etag", "ValidateOnly", + }); + internal_static_google_iam_v3_ListPolicyBindingsRequest_descriptor = + getDescriptor().getMessageType(4); + internal_static_google_iam_v3_ListPolicyBindingsRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_iam_v3_ListPolicyBindingsRequest_descriptor, + new java.lang.String[] { + "Parent", "PageSize", "PageToken", "Filter", + }); + internal_static_google_iam_v3_ListPolicyBindingsResponse_descriptor = + getDescriptor().getMessageType(5); + internal_static_google_iam_v3_ListPolicyBindingsResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_iam_v3_ListPolicyBindingsResponse_descriptor, + new java.lang.String[] { + "PolicyBindings", "NextPageToken", + }); + internal_static_google_iam_v3_SearchTargetPolicyBindingsRequest_descriptor = + getDescriptor().getMessageType(6); + internal_static_google_iam_v3_SearchTargetPolicyBindingsRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_iam_v3_SearchTargetPolicyBindingsRequest_descriptor, + new java.lang.String[] { + "Target", "PageSize", "PageToken", "Parent", + }); + internal_static_google_iam_v3_SearchTargetPolicyBindingsResponse_descriptor = + getDescriptor().getMessageType(7); + internal_static_google_iam_v3_SearchTargetPolicyBindingsResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_iam_v3_SearchTargetPolicyBindingsResponse_descriptor, + new java.lang.String[] { + "PolicyBindings", "NextPageToken", + }); + descriptor.resolveAllFeaturesImmutable(); + com.google.api.AnnotationsProto.getDescriptor(); + com.google.api.ClientProto.getDescriptor(); + com.google.api.FieldBehaviorProto.getDescriptor(); + com.google.api.ResourceProto.getDescriptor(); + com.google.iam.v3.OperationMetadataProto.getDescriptor(); + com.google.iam.v3.PolicyBindingResourcesProto.getDescriptor(); + com.google.longrunning.OperationsProto.getDescriptor(); + com.google.protobuf.EmptyProto.getDescriptor(); + com.google.protobuf.FieldMaskProto.getDescriptor(); + 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.resourceDefinition); + registry.add(com.google.api.ResourceProto.resourceReference); + registry.add(com.google.longrunning.OperationsProto.operationInfo); + com.google.protobuf.Descriptors.FileDescriptor.internalUpdateFileDescriptor( + descriptor, registry); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/java-iam/proto-google-iam-v3/src/main/java/com/google/iam/v3/PrincipalAccessBoundaryPoliciesServiceProto.java b/java-iam/proto-google-iam-v3/src/main/java/com/google/iam/v3/PrincipalAccessBoundaryPoliciesServiceProto.java new file mode 100644 index 0000000000..638211a9db --- /dev/null +++ b/java-iam/proto-google-iam-v3/src/main/java/com/google/iam/v3/PrincipalAccessBoundaryPoliciesServiceProto.java @@ -0,0 +1,280 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/iam/v3/principal_access_boundary_policies_service.proto +// Protobuf Java Version: 4.33.2 + +package com.google.iam.v3; + +@com.google.protobuf.Generated +public final class PrincipalAccessBoundaryPoliciesServiceProto + extends com.google.protobuf.GeneratedFile { + private PrincipalAccessBoundaryPoliciesServiceProto() {} + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "PrincipalAccessBoundaryPoliciesServiceProto"); + } + + 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_iam_v3_CreatePrincipalAccessBoundaryPolicyRequest_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_iam_v3_CreatePrincipalAccessBoundaryPolicyRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_iam_v3_GetPrincipalAccessBoundaryPolicyRequest_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_iam_v3_GetPrincipalAccessBoundaryPolicyRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_iam_v3_UpdatePrincipalAccessBoundaryPolicyRequest_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_iam_v3_UpdatePrincipalAccessBoundaryPolicyRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_iam_v3_DeletePrincipalAccessBoundaryPolicyRequest_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_iam_v3_DeletePrincipalAccessBoundaryPolicyRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_iam_v3_ListPrincipalAccessBoundaryPoliciesRequest_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_iam_v3_ListPrincipalAccessBoundaryPoliciesRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_iam_v3_ListPrincipalAccessBoundaryPoliciesResponse_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_iam_v3_ListPrincipalAccessBoundaryPoliciesResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_iam_v3_SearchPrincipalAccessBoundaryPolicyBindingsRequest_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_iam_v3_SearchPrincipalAccessBoundaryPolicyBindingsRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_iam_v3_SearchPrincipalAccessBoundaryPolicyBindingsResponse_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_iam_v3_SearchPrincipalAccessBoundaryPolicyBindingsResponse_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/iam/v3/principal_access_boundary_policies_service.proto\022\r" + + "google.iam.v3\032\034google/api/annotations.proto\032\027google/ap" + + "i/client.proto\032\037google/api/field_behavio" + + "r.proto\032\031google/api/resource.proto\032&goog" + + "le/iam/v3/operation_metadata.proto\032,google/iam/v3/policy_binding_resources.proto" + + "\032>google/iam/v3/principal_access_boundary_policy_resources.proto\032#google/longrun" + + "ning/operations.proto\032\033google/protobuf/empty.proto\032" + + " google/protobuf/field_mask.proto\"\241\002\n" + + "*CreatePrincipalAccessBoundaryPolicyRequest\022H\n" + + "\006parent\030\001 \001(\tB8\340A\002\372A2\0220iam" + + ".googleapis.com/PrincipalAccessBoundaryPolicy\0220\n" + + "#principal_access_boundary_policy_id\030\002 \001(\tB\003\340A\002\022[\n" + + " principal_access_boundary_policy\030\003" + + " \001(\0132,.google.iam.v3.PrincipalAccessBoundaryPolicyB\003\340A\002\022\032\n\r" + + "validate_only\030\004 \001(\010B\003\340A\001\"q\n" + + "\'GetPrincipalAccessBoundaryPolicyRequest\022F\n" + + "\004name\030\001 \001(\tB8\340A\002\372A2\n" + + "0iam.googleapis.com/PrincipalAccessBoundaryPolicy\"\333\001\n" + + "*UpdatePrincipalAccessBoundaryPolicyRequest\022[\n" + + " principal_access_boundary_policy\030\001" + + " \001(\0132,.google.iam.v3.PrincipalAccessBoundaryPolicyB\003\340A\002\022\032\n\r" + + "validate_only\030\002 \001(\010B\003\340A\001\0224\n" + + "\013update_mask\030\003" + + " \001(\0132\032.google.protobuf.FieldMaskB\003\340A\001\"\267\001\n" + + "*DeletePrincipalAccessBoundaryPolicyRequest\022F\n" + + "\004name\030\001 \001(\tB8\340A\002\372A2\n" + + "0iam.googleapis.com/PrincipalAccessBoundaryPolicy\022\021\n" + + "\004etag\030\002 \001(\tB\003\340A\001\022\032\n\r" + + "validate_only\030\003 \001(\010B\003\340A\001\022\022\n" + + "\005force\030\004 \001(\010B\003\340A\001\"\247\001\n" + + "*ListPrincipalAccessBoundaryPoliciesRequest\022H\n" + + "\006parent\030\001 \001(" + + "\tB8\340A\002\372A2\0220iam.googleapis.com/PrincipalAccessBoundaryPolicy\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\"\245\001\n" + + "+ListPrincipalAccessBoundaryPoliciesResponse\022X\n" + + "\"principal_access_boundary_policies\030\001 \003(" + + "\0132,.google.iam.v3.PrincipalAccessBoundaryPolicy\022\034\n" + + "\017next_page_token\030\002 \001(\tB\003\340A\001\"\255\001\n" + + "2SearchPrincipalAccessBoundaryPolicyBindingsRequest\022F\n" + + "\004name\030\001 \001(\tB8\340A\002\372A2\n" + + "0iam.googleapis.com/PrincipalAccessBoundaryPolicy\022\026\n" + + "\tpage_size\030\003 \001(\005B\003\340A\001\022\027\n\n" + + "page_token\030\004 \001(\tB\003\340A\001\"\212\001\n" + + "3SearchPrincipalAccessBoundaryPolicyBindingsResponse\0225\n" + + "\017policy_bindings\030\001 \003(\0132\034.google.iam.v3.PolicyBinding\022\034\n" + + "\017next_page_token\030\002 \001(\tB\003\340A\0012\354\016\n" + + "\037PrincipalAccessBoundaryPolicies\022\367\002\n" + + "#CreatePrincipalAccessBoundaryPolicy\0229.google." + + "iam.v3.CreatePrincipalAccessBoundaryPoli" + + "cyRequest\032\035.google.longrunning.Operation\"\365\001\312A2\n" + + "\035PrincipalAccessBoundaryPolicy\022\021OperationMetadata\332AKparent,principal_acce" + + "ss_boundary_policy,principal_access_boun" + + "dary_policy_id\202\323\344\223\002l\"H/v3/{parent=organi" + + "zations/*/locations/*}/principalAccessBoundaryPolicies:" + + " principal_access_boundary_policy\022\341\001\n" + + " GetPrincipalAccessBoundaryPolicy\0226.google.iam.v3.GetPrincipalAccess" + + "BoundaryPolicyRequest\032,.google.iam.v3.Pr" + + "incipalAccessBoundaryPolicy\"W\332A\004name\202\323\344\223" + + "\002J\022H/v3/{name=organizations/*/locations/*/principalAccessBoundaryPolicies/*}\022\372\002\n" + + "#UpdatePrincipalAccessBoundaryPolicy\0229.google.iam.v3.UpdatePrincipalAccessBounda" + + "ryPolicyRequest\032\035.google.longrunning.Operation\"\370\001\312A2\n" + + "\035PrincipalAccessBoundaryPolicy\022\021OperationMetadata\332A,principal_acces" + + "s_boundary_policy,update_mask\202\323\344\223\002\215\0012i/v" + + "3/{principal_access_boundary_policy.name" + + "=organizations/*/locations/*/principalAccessBoundaryPolicies/*}:" + + " principal_access_boundary_policy\022\206\002\n" + + "#DeletePrincipalAccessBoundaryPolicy\0229.google.iam.v3.Delete" + + "PrincipalAccessBoundaryPolicyRequest\032\035.google.longrunning.Operation\"\204\001\312A*\n" + + "\025google.protobuf.Empty\022\021OperationMetadata\332A\004na" + + "me\202\323\344\223\002J*H/v3/{name=organizations/*/loca" + + "tions/*/principalAccessBoundaryPolicies/*}\022\367\001\n" + + "#ListPrincipalAccessBoundaryPolicies\0229.google.iam.v3.ListPrincipalAccessBo" + + "undaryPoliciesRequest\032:.google.iam.v3.ListPrincipalAccessBoundaryPoliciesRespons" + + "e\"Y\332A\006parent\202\323\344\223\002J\022H/v3/{parent=organiza" + + "tions/*/locations/*}/principalAccessBoundaryPolicies\022\242\002\n" + + "+SearchPrincipalAccessBoundaryPolicyBindings\022A.google.iam.v3.Sea" + + "rchPrincipalAccessBoundaryPolicyBindingsRequest\032B.google.iam.v3.SearchPrincipalA" + + "ccessBoundaryPolicyBindingsResponse\"l\332A\004" + + "name\202\323\344\223\002_\022]/v3/{name=organizations/*/lo" + + "cations/*/principalAccessBoundaryPolicie" + + "s/*}:searchPolicyBindings\032F\312A\022iam.google" + + "apis.com\322A.https://www.googleapis.com/auth/cloud-platformB\231\001\n" + + "\021com.google.iam.v3B+PrincipalAccessBoundaryPoliciesServiceP" + + "rotoP\001Z)cloud.google.com/go/iam/apiv3/ia" + + "mpb;iampb\252\002\023Google.Cloud.Iam.V3\312\002\023Google\\Cloud\\Iam\\V3b\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.iam.v3.OperationMetadataProto.getDescriptor(), + com.google.iam.v3.PolicyBindingResourcesProto.getDescriptor(), + com.google.iam.v3.PrincipalAccessBoundaryPolicyResourcesProto.getDescriptor(), + com.google.longrunning.OperationsProto.getDescriptor(), + com.google.protobuf.EmptyProto.getDescriptor(), + com.google.protobuf.FieldMaskProto.getDescriptor(), + }); + internal_static_google_iam_v3_CreatePrincipalAccessBoundaryPolicyRequest_descriptor = + getDescriptor().getMessageType(0); + internal_static_google_iam_v3_CreatePrincipalAccessBoundaryPolicyRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_iam_v3_CreatePrincipalAccessBoundaryPolicyRequest_descriptor, + new java.lang.String[] { + "Parent", + "PrincipalAccessBoundaryPolicyId", + "PrincipalAccessBoundaryPolicy", + "ValidateOnly", + }); + internal_static_google_iam_v3_GetPrincipalAccessBoundaryPolicyRequest_descriptor = + getDescriptor().getMessageType(1); + internal_static_google_iam_v3_GetPrincipalAccessBoundaryPolicyRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_iam_v3_GetPrincipalAccessBoundaryPolicyRequest_descriptor, + new java.lang.String[] { + "Name", + }); + internal_static_google_iam_v3_UpdatePrincipalAccessBoundaryPolicyRequest_descriptor = + getDescriptor().getMessageType(2); + internal_static_google_iam_v3_UpdatePrincipalAccessBoundaryPolicyRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_iam_v3_UpdatePrincipalAccessBoundaryPolicyRequest_descriptor, + new java.lang.String[] { + "PrincipalAccessBoundaryPolicy", "ValidateOnly", "UpdateMask", + }); + internal_static_google_iam_v3_DeletePrincipalAccessBoundaryPolicyRequest_descriptor = + getDescriptor().getMessageType(3); + internal_static_google_iam_v3_DeletePrincipalAccessBoundaryPolicyRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_iam_v3_DeletePrincipalAccessBoundaryPolicyRequest_descriptor, + new java.lang.String[] { + "Name", "Etag", "ValidateOnly", "Force", + }); + internal_static_google_iam_v3_ListPrincipalAccessBoundaryPoliciesRequest_descriptor = + getDescriptor().getMessageType(4); + internal_static_google_iam_v3_ListPrincipalAccessBoundaryPoliciesRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_iam_v3_ListPrincipalAccessBoundaryPoliciesRequest_descriptor, + new java.lang.String[] { + "Parent", "PageSize", "PageToken", + }); + internal_static_google_iam_v3_ListPrincipalAccessBoundaryPoliciesResponse_descriptor = + getDescriptor().getMessageType(5); + internal_static_google_iam_v3_ListPrincipalAccessBoundaryPoliciesResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_iam_v3_ListPrincipalAccessBoundaryPoliciesResponse_descriptor, + new java.lang.String[] { + "PrincipalAccessBoundaryPolicies", "NextPageToken", + }); + internal_static_google_iam_v3_SearchPrincipalAccessBoundaryPolicyBindingsRequest_descriptor = + getDescriptor().getMessageType(6); + internal_static_google_iam_v3_SearchPrincipalAccessBoundaryPolicyBindingsRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_iam_v3_SearchPrincipalAccessBoundaryPolicyBindingsRequest_descriptor, + new java.lang.String[] { + "Name", "PageSize", "PageToken", + }); + internal_static_google_iam_v3_SearchPrincipalAccessBoundaryPolicyBindingsResponse_descriptor = + getDescriptor().getMessageType(7); + internal_static_google_iam_v3_SearchPrincipalAccessBoundaryPolicyBindingsResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_iam_v3_SearchPrincipalAccessBoundaryPolicyBindingsResponse_descriptor, + new java.lang.String[] { + "PolicyBindings", "NextPageToken", + }); + descriptor.resolveAllFeaturesImmutable(); + com.google.api.AnnotationsProto.getDescriptor(); + com.google.api.ClientProto.getDescriptor(); + com.google.api.FieldBehaviorProto.getDescriptor(); + com.google.api.ResourceProto.getDescriptor(); + com.google.iam.v3.OperationMetadataProto.getDescriptor(); + com.google.iam.v3.PolicyBindingResourcesProto.getDescriptor(); + com.google.iam.v3.PrincipalAccessBoundaryPolicyResourcesProto.getDescriptor(); + com.google.longrunning.OperationsProto.getDescriptor(); + com.google.protobuf.EmptyProto.getDescriptor(); + com.google.protobuf.FieldMaskProto.getDescriptor(); + 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); + registry.add(com.google.longrunning.OperationsProto.operationInfo); + com.google.protobuf.Descriptors.FileDescriptor.internalUpdateFileDescriptor( + descriptor, registry); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/java-iam/proto-google-iam-v3/src/main/java/com/google/iam/v3/PrincipalAccessBoundaryPolicy.java b/java-iam/proto-google-iam-v3/src/main/java/com/google/iam/v3/PrincipalAccessBoundaryPolicy.java new file mode 100644 index 0000000000..5a3d81ad31 --- /dev/null +++ b/java-iam/proto-google-iam-v3/src/main/java/com/google/iam/v3/PrincipalAccessBoundaryPolicy.java @@ -0,0 +1,2542 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/iam/v3/principal_access_boundary_policy_resources.proto +// Protobuf Java Version: 4.33.2 + +package com.google.iam.v3; + +/** + * + * + *
        + * An IAM principal access boundary policy resource.
        + * 
        + * + * Protobuf type {@code google.iam.v3.PrincipalAccessBoundaryPolicy} + */ +@com.google.protobuf.Generated +public final class PrincipalAccessBoundaryPolicy extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.iam.v3.PrincipalAccessBoundaryPolicy) + PrincipalAccessBoundaryPolicyOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "PrincipalAccessBoundaryPolicy"); + } + + // Use PrincipalAccessBoundaryPolicy.newBuilder() to construct. + private PrincipalAccessBoundaryPolicy(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private PrincipalAccessBoundaryPolicy() { + name_ = ""; + uid_ = ""; + etag_ = ""; + displayName_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.iam.v3.PrincipalAccessBoundaryPolicyResourcesProto + .internal_static_google_iam_v3_PrincipalAccessBoundaryPolicy_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + @java.lang.Override + protected com.google.protobuf.MapFieldReflectionAccessor internalGetMapFieldReflection( + int number) { + switch (number) { + case 5: + return internalGetAnnotations(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.iam.v3.PrincipalAccessBoundaryPolicyResourcesProto + .internal_static_google_iam_v3_PrincipalAccessBoundaryPolicy_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.iam.v3.PrincipalAccessBoundaryPolicy.class, + com.google.iam.v3.PrincipalAccessBoundaryPolicy.Builder.class); + } + + private int bitField0_; + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + + /** + * + * + *
        +   * Identifier. The resource name of the principal access boundary policy.
        +   *
        +   * The following format is supported:
        +   * `organizations/{organization_id}/locations/{location}/principalAccessBoundaryPolicies/{policy_id}`
        +   * 
        + * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @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; + } + } + + /** + * + * + *
        +   * Identifier. The resource name of the principal access boundary policy.
        +   *
        +   * The following format is supported:
        +   * `organizations/{organization_id}/locations/{location}/principalAccessBoundaryPolicies/{policy_id}`
        +   * 
        + * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @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 UID_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object uid_ = ""; + + /** + * + * + *
        +   * Output only. The globally unique ID of the principal access boundary
        +   * policy.
        +   * 
        + * + * + * string uid = 2 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_info) = { ... } + * + * + * @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; + } + } + + /** + * + * + *
        +   * Output only. The globally unique ID of the principal access boundary
        +   * policy.
        +   * 
        + * + * + * string uid = 2 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_info) = { ... } + * + * + * @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 ETAG_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object etag_ = ""; + + /** + * + * + *
        +   * Optional. The etag for the principal access boundary.
        +   * If this is provided on update, it must match the server's etag.
        +   * 
        + * + * string etag = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The etag. + */ + @java.lang.Override + public java.lang.String getEtag() { + java.lang.Object ref = etag_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + etag_ = s; + return s; + } + } + + /** + * + * + *
        +   * Optional. The etag for the principal access boundary.
        +   * If this is provided on update, it must match the server's etag.
        +   * 
        + * + * string etag = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for etag. + */ + @java.lang.Override + public com.google.protobuf.ByteString getEtagBytes() { + java.lang.Object ref = etag_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + etag_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int DISPLAY_NAME_FIELD_NUMBER = 4; + + @SuppressWarnings("serial") + private volatile java.lang.Object displayName_ = ""; + + /** + * + * + *
        +   * Optional. The description of the principal access boundary policy. Must be
        +   * less than or equal to 63 characters.
        +   * 
        + * + * string display_name = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The displayName. + */ + @java.lang.Override + public java.lang.String getDisplayName() { + java.lang.Object ref = displayName_; + 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(); + displayName_ = s; + return s; + } + } + + /** + * + * + *
        +   * Optional. The description of the principal access boundary policy. Must be
        +   * less than or equal to 63 characters.
        +   * 
        + * + * string display_name = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for displayName. + */ + @java.lang.Override + public com.google.protobuf.ByteString getDisplayNameBytes() { + java.lang.Object ref = displayName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + displayName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int ANNOTATIONS_FIELD_NUMBER = 5; + + private static final class AnnotationsDefaultEntryHolder { + static final com.google.protobuf.MapEntry defaultEntry = + com.google.protobuf.MapEntry.newDefaultInstance( + com.google.iam.v3.PrincipalAccessBoundaryPolicyResourcesProto + .internal_static_google_iam_v3_PrincipalAccessBoundaryPolicy_AnnotationsEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.STRING, + ""); + } + + @SuppressWarnings("serial") + private com.google.protobuf.MapField annotations_; + + private com.google.protobuf.MapField + internalGetAnnotations() { + if (annotations_ == null) { + return com.google.protobuf.MapField.emptyMapField(AnnotationsDefaultEntryHolder.defaultEntry); + } + return annotations_; + } + + public int getAnnotationsCount() { + return internalGetAnnotations().getMap().size(); + } + + /** + * + * + *
        +   * Optional. User defined annotations. See
        +   * https://google.aip.dev/148#annotations for more details such as format and
        +   * size limitations
        +   * 
        + * + * map<string, string> annotations = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public boolean containsAnnotations(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + return internalGetAnnotations().getMap().containsKey(key); + } + + /** Use {@link #getAnnotationsMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getAnnotations() { + return getAnnotationsMap(); + } + + /** + * + * + *
        +   * Optional. User defined annotations. See
        +   * https://google.aip.dev/148#annotations for more details such as format and
        +   * size limitations
        +   * 
        + * + * map<string, string> annotations = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public java.util.Map getAnnotationsMap() { + return internalGetAnnotations().getMap(); + } + + /** + * + * + *
        +   * Optional. User defined annotations. See
        +   * https://google.aip.dev/148#annotations for more details such as format and
        +   * size limitations
        +   * 
        + * + * map<string, string> annotations = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public /* nullable */ java.lang.String getAnnotationsOrDefault( + java.lang.String key, + /* nullable */ + java.lang.String defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetAnnotations().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + + /** + * + * + *
        +   * Optional. User defined annotations. See
        +   * https://google.aip.dev/148#annotations for more details such as format and
        +   * size limitations
        +   * 
        + * + * map<string, string> annotations = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public java.lang.String getAnnotationsOrThrow(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetAnnotations().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public static final int CREATE_TIME_FIELD_NUMBER = 6; + private com.google.protobuf.Timestamp createTime_; + + /** + * + * + *
        +   * Output only. The time when the principal access boundary policy was
        +   * created.
        +   * 
        + * + * .google.protobuf.Timestamp create_time = 6 [(.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 time when the principal access boundary policy was
        +   * created.
        +   * 
        + * + * .google.protobuf.Timestamp create_time = 6 [(.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 time when the principal access boundary policy was
        +   * created.
        +   * 
        + * + * .google.protobuf.Timestamp create_time = 6 [(.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 = 7; + private com.google.protobuf.Timestamp updateTime_; + + /** + * + * + *
        +   * Output only. The time when the principal access boundary policy was most
        +   * recently updated.
        +   * 
        + * + * .google.protobuf.Timestamp update_time = 7 [(.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 time when the principal access boundary policy was most
        +   * recently updated.
        +   * 
        + * + * .google.protobuf.Timestamp update_time = 7 [(.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 time when the principal access boundary policy was most
        +   * recently updated.
        +   * 
        + * + * .google.protobuf.Timestamp update_time = 7 [(.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 DETAILS_FIELD_NUMBER = 8; + private com.google.iam.v3.PrincipalAccessBoundaryPolicyDetails details_; + + /** + * + * + *
        +   * Optional. The details for the principal access boundary policy.
        +   * 
        + * + * + * .google.iam.v3.PrincipalAccessBoundaryPolicyDetails details = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the details field is set. + */ + @java.lang.Override + public boolean hasDetails() { + return ((bitField0_ & 0x00000004) != 0); + } + + /** + * + * + *
        +   * Optional. The details for the principal access boundary policy.
        +   * 
        + * + * + * .google.iam.v3.PrincipalAccessBoundaryPolicyDetails details = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The details. + */ + @java.lang.Override + public com.google.iam.v3.PrincipalAccessBoundaryPolicyDetails getDetails() { + return details_ == null + ? com.google.iam.v3.PrincipalAccessBoundaryPolicyDetails.getDefaultInstance() + : details_; + } + + /** + * + * + *
        +   * Optional. The details for the principal access boundary policy.
        +   * 
        + * + * + * .google.iam.v3.PrincipalAccessBoundaryPolicyDetails details = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.iam.v3.PrincipalAccessBoundaryPolicyDetailsOrBuilder getDetailsOrBuilder() { + return details_ == null + ? com.google.iam.v3.PrincipalAccessBoundaryPolicyDetails.getDefaultInstance() + : details_; + } + + 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.GeneratedMessage.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, name_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(uid_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, uid_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(etag_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 3, etag_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(displayName_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 4, displayName_); + } + com.google.protobuf.GeneratedMessage.serializeStringMapTo( + output, internalGetAnnotations(), AnnotationsDefaultEntryHolder.defaultEntry, 5); + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(6, getCreateTime()); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeMessage(7, getUpdateTime()); + } + if (((bitField0_ & 0x00000004) != 0)) { + output.writeMessage(8, getDetails()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, name_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(uid_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, uid_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(etag_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(3, etag_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(displayName_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(4, displayName_); + } + for (java.util.Map.Entry entry : + internalGetAnnotations().getMap().entrySet()) { + com.google.protobuf.MapEntry annotations__ = + AnnotationsDefaultEntryHolder.defaultEntry + .newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream.computeMessageSize(5, annotations__); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(6, getCreateTime()); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(7, getUpdateTime()); + } + if (((bitField0_ & 0x00000004) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(8, getDetails()); + } + 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.iam.v3.PrincipalAccessBoundaryPolicy)) { + return super.equals(obj); + } + com.google.iam.v3.PrincipalAccessBoundaryPolicy other = + (com.google.iam.v3.PrincipalAccessBoundaryPolicy) obj; + + if (!getName().equals(other.getName())) return false; + if (!getUid().equals(other.getUid())) return false; + if (!getEtag().equals(other.getEtag())) return false; + if (!getDisplayName().equals(other.getDisplayName())) return false; + if (!internalGetAnnotations().equals(other.internalGetAnnotations())) 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 (hasDetails() != other.hasDetails()) return false; + if (hasDetails()) { + if (!getDetails().equals(other.getDetails())) 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) + UID_FIELD_NUMBER; + hash = (53 * hash) + getUid().hashCode(); + hash = (37 * hash) + ETAG_FIELD_NUMBER; + hash = (53 * hash) + getEtag().hashCode(); + hash = (37 * hash) + DISPLAY_NAME_FIELD_NUMBER; + hash = (53 * hash) + getDisplayName().hashCode(); + if (!internalGetAnnotations().getMap().isEmpty()) { + hash = (37 * hash) + ANNOTATIONS_FIELD_NUMBER; + hash = (53 * hash) + internalGetAnnotations().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(); + } + if (hasDetails()) { + hash = (37 * hash) + DETAILS_FIELD_NUMBER; + hash = (53 * hash) + getDetails().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.iam.v3.PrincipalAccessBoundaryPolicy parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.iam.v3.PrincipalAccessBoundaryPolicy parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.iam.v3.PrincipalAccessBoundaryPolicy parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.iam.v3.PrincipalAccessBoundaryPolicy 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.iam.v3.PrincipalAccessBoundaryPolicy parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.iam.v3.PrincipalAccessBoundaryPolicy parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.iam.v3.PrincipalAccessBoundaryPolicy parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.iam.v3.PrincipalAccessBoundaryPolicy parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.iam.v3.PrincipalAccessBoundaryPolicy parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.iam.v3.PrincipalAccessBoundaryPolicy parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.iam.v3.PrincipalAccessBoundaryPolicy parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.iam.v3.PrincipalAccessBoundaryPolicy parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.iam.v3.PrincipalAccessBoundaryPolicy 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
        +   * An IAM principal access boundary policy resource.
        +   * 
        + * + * Protobuf type {@code google.iam.v3.PrincipalAccessBoundaryPolicy} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.iam.v3.PrincipalAccessBoundaryPolicy) + com.google.iam.v3.PrincipalAccessBoundaryPolicyOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.iam.v3.PrincipalAccessBoundaryPolicyResourcesProto + .internal_static_google_iam_v3_PrincipalAccessBoundaryPolicy_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapFieldReflectionAccessor internalGetMapFieldReflection( + int number) { + switch (number) { + case 5: + return internalGetAnnotations(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapFieldReflectionAccessor internalGetMutableMapFieldReflection( + int number) { + switch (number) { + case 5: + return internalGetMutableAnnotations(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.iam.v3.PrincipalAccessBoundaryPolicyResourcesProto + .internal_static_google_iam_v3_PrincipalAccessBoundaryPolicy_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.iam.v3.PrincipalAccessBoundaryPolicy.class, + com.google.iam.v3.PrincipalAccessBoundaryPolicy.Builder.class); + } + + // Construct using com.google.iam.v3.PrincipalAccessBoundaryPolicy.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetCreateTimeFieldBuilder(); + internalGetUpdateTimeFieldBuilder(); + internalGetDetailsFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + uid_ = ""; + etag_ = ""; + displayName_ = ""; + internalGetMutableAnnotations().clear(); + createTime_ = null; + if (createTimeBuilder_ != null) { + createTimeBuilder_.dispose(); + createTimeBuilder_ = null; + } + updateTime_ = null; + if (updateTimeBuilder_ != null) { + updateTimeBuilder_.dispose(); + updateTimeBuilder_ = null; + } + details_ = null; + if (detailsBuilder_ != null) { + detailsBuilder_.dispose(); + detailsBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.iam.v3.PrincipalAccessBoundaryPolicyResourcesProto + .internal_static_google_iam_v3_PrincipalAccessBoundaryPolicy_descriptor; + } + + @java.lang.Override + public com.google.iam.v3.PrincipalAccessBoundaryPolicy getDefaultInstanceForType() { + return com.google.iam.v3.PrincipalAccessBoundaryPolicy.getDefaultInstance(); + } + + @java.lang.Override + public com.google.iam.v3.PrincipalAccessBoundaryPolicy build() { + com.google.iam.v3.PrincipalAccessBoundaryPolicy result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.iam.v3.PrincipalAccessBoundaryPolicy buildPartial() { + com.google.iam.v3.PrincipalAccessBoundaryPolicy result = + new com.google.iam.v3.PrincipalAccessBoundaryPolicy(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.iam.v3.PrincipalAccessBoundaryPolicy result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.uid_ = uid_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.etag_ = etag_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.displayName_ = displayName_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.annotations_ = internalGetAnnotations(); + result.annotations_.makeImmutable(); + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000020) != 0)) { + result.createTime_ = createTimeBuilder_ == null ? createTime_ : createTimeBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000040) != 0)) { + result.updateTime_ = updateTimeBuilder_ == null ? updateTime_ : updateTimeBuilder_.build(); + to_bitField0_ |= 0x00000002; + } + if (((from_bitField0_ & 0x00000080) != 0)) { + result.details_ = detailsBuilder_ == null ? details_ : detailsBuilder_.build(); + to_bitField0_ |= 0x00000004; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.iam.v3.PrincipalAccessBoundaryPolicy) { + return mergeFrom((com.google.iam.v3.PrincipalAccessBoundaryPolicy) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.iam.v3.PrincipalAccessBoundaryPolicy other) { + if (other == com.google.iam.v3.PrincipalAccessBoundaryPolicy.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getUid().isEmpty()) { + uid_ = other.uid_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (!other.getEtag().isEmpty()) { + etag_ = other.etag_; + bitField0_ |= 0x00000004; + onChanged(); + } + if (!other.getDisplayName().isEmpty()) { + displayName_ = other.displayName_; + bitField0_ |= 0x00000008; + onChanged(); + } + internalGetMutableAnnotations().mergeFrom(other.internalGetAnnotations()); + bitField0_ |= 0x00000010; + if (other.hasCreateTime()) { + mergeCreateTime(other.getCreateTime()); + } + if (other.hasUpdateTime()) { + mergeUpdateTime(other.getUpdateTime()); + } + if (other.hasDetails()) { + mergeDetails(other.getDetails()); + } + 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: + { + uid_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + etag_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 34: + { + displayName_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000008; + break; + } // case 34 + case 42: + { + com.google.protobuf.MapEntry annotations__ = + input.readMessage( + AnnotationsDefaultEntryHolder.defaultEntry.getParserForType(), + extensionRegistry); + internalGetMutableAnnotations() + .getMutableMap() + .put(annotations__.getKey(), annotations__.getValue()); + bitField0_ |= 0x00000010; + break; + } // case 42 + case 50: + { + input.readMessage( + internalGetCreateTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000020; + break; + } // case 50 + case 58: + { + input.readMessage( + internalGetUpdateTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000040; + break; + } // case 58 + case 66: + { + input.readMessage(internalGetDetailsFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000080; + 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 name_ = ""; + + /** + * + * + *
        +     * Identifier. The resource name of the principal access boundary policy.
        +     *
        +     * The following format is supported:
        +     * `organizations/{organization_id}/locations/{location}/principalAccessBoundaryPolicies/{policy_id}`
        +     * 
        + * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @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; + } + } + + /** + * + * + *
        +     * Identifier. The resource name of the principal access boundary policy.
        +     *
        +     * The following format is supported:
        +     * `organizations/{organization_id}/locations/{location}/principalAccessBoundaryPolicies/{policy_id}`
        +     * 
        + * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @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; + } + } + + /** + * + * + *
        +     * Identifier. The resource name of the principal access boundary policy.
        +     *
        +     * The following format is supported:
        +     * `organizations/{organization_id}/locations/{location}/principalAccessBoundaryPolicies/{policy_id}`
        +     * 
        + * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @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; + } + + /** + * + * + *
        +     * Identifier. The resource name of the principal access boundary policy.
        +     *
        +     * The following format is supported:
        +     * `organizations/{organization_id}/locations/{location}/principalAccessBoundaryPolicies/{policy_id}`
        +     * 
        + * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
        +     * Identifier. The resource name of the principal access boundary policy.
        +     *
        +     * The following format is supported:
        +     * `organizations/{organization_id}/locations/{location}/principalAccessBoundaryPolicies/{policy_id}`
        +     * 
        + * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @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 uid_ = ""; + + /** + * + * + *
        +     * Output only. The globally unique ID of the principal access boundary
        +     * policy.
        +     * 
        + * + * + * string uid = 2 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_info) = { ... } + * + * + * @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; + } + } + + /** + * + * + *
        +     * Output only. The globally unique ID of the principal access boundary
        +     * policy.
        +     * 
        + * + * + * string uid = 2 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_info) = { ... } + * + * + * @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; + } + } + + /** + * + * + *
        +     * Output only. The globally unique ID of the principal access boundary
        +     * policy.
        +     * 
        + * + * + * string uid = 2 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_info) = { ... } + * + * + * @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_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
        +     * Output only. The globally unique ID of the principal access boundary
        +     * policy.
        +     * 
        + * + * + * string uid = 2 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_info) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearUid() { + uid_ = getDefaultInstance().getUid(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
        +     * Output only. The globally unique ID of the principal access boundary
        +     * policy.
        +     * 
        + * + * + * string uid = 2 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_info) = { ... } + * + * + * @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_ |= 0x00000002; + onChanged(); + return this; + } + + private java.lang.Object etag_ = ""; + + /** + * + * + *
        +     * Optional. The etag for the principal access boundary.
        +     * If this is provided on update, it must match the server's etag.
        +     * 
        + * + * string etag = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The etag. + */ + public java.lang.String getEtag() { + java.lang.Object ref = etag_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + etag_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
        +     * Optional. The etag for the principal access boundary.
        +     * If this is provided on update, it must match the server's etag.
        +     * 
        + * + * string etag = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for etag. + */ + public com.google.protobuf.ByteString getEtagBytes() { + java.lang.Object ref = etag_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + etag_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
        +     * Optional. The etag for the principal access boundary.
        +     * If this is provided on update, it must match the server's etag.
        +     * 
        + * + * string etag = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The etag to set. + * @return This builder for chaining. + */ + public Builder setEtag(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + etag_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
        +     * Optional. The etag for the principal access boundary.
        +     * If this is provided on update, it must match the server's etag.
        +     * 
        + * + * string etag = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearEtag() { + etag_ = getDefaultInstance().getEtag(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + + /** + * + * + *
        +     * Optional. The etag for the principal access boundary.
        +     * If this is provided on update, it must match the server's etag.
        +     * 
        + * + * string etag = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for etag to set. + * @return This builder for chaining. + */ + public Builder setEtagBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + etag_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + private java.lang.Object displayName_ = ""; + + /** + * + * + *
        +     * Optional. The description of the principal access boundary policy. Must be
        +     * less than or equal to 63 characters.
        +     * 
        + * + * string display_name = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The displayName. + */ + public java.lang.String getDisplayName() { + java.lang.Object ref = displayName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + displayName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
        +     * Optional. The description of the principal access boundary policy. Must be
        +     * less than or equal to 63 characters.
        +     * 
        + * + * string display_name = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for displayName. + */ + public com.google.protobuf.ByteString getDisplayNameBytes() { + java.lang.Object ref = displayName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + displayName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
        +     * Optional. The description of the principal access boundary policy. Must be
        +     * less than or equal to 63 characters.
        +     * 
        + * + * string display_name = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The displayName to set. + * @return This builder for chaining. + */ + public Builder setDisplayName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + displayName_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + /** + * + * + *
        +     * Optional. The description of the principal access boundary policy. Must be
        +     * less than or equal to 63 characters.
        +     * 
        + * + * string display_name = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearDisplayName() { + displayName_ = getDefaultInstance().getDisplayName(); + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + return this; + } + + /** + * + * + *
        +     * Optional. The description of the principal access boundary policy. Must be
        +     * less than or equal to 63 characters.
        +     * 
        + * + * string display_name = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for displayName to set. + * @return This builder for chaining. + */ + public Builder setDisplayNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + displayName_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + private com.google.protobuf.MapField annotations_; + + private com.google.protobuf.MapField + internalGetAnnotations() { + if (annotations_ == null) { + return com.google.protobuf.MapField.emptyMapField( + AnnotationsDefaultEntryHolder.defaultEntry); + } + return annotations_; + } + + private com.google.protobuf.MapField + internalGetMutableAnnotations() { + if (annotations_ == null) { + annotations_ = + com.google.protobuf.MapField.newMapField(AnnotationsDefaultEntryHolder.defaultEntry); + } + if (!annotations_.isMutable()) { + annotations_ = annotations_.copy(); + } + bitField0_ |= 0x00000010; + onChanged(); + return annotations_; + } + + public int getAnnotationsCount() { + return internalGetAnnotations().getMap().size(); + } + + /** + * + * + *
        +     * Optional. User defined annotations. See
        +     * https://google.aip.dev/148#annotations for more details such as format and
        +     * size limitations
        +     * 
        + * + * map<string, string> annotations = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public boolean containsAnnotations(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + return internalGetAnnotations().getMap().containsKey(key); + } + + /** Use {@link #getAnnotationsMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getAnnotations() { + return getAnnotationsMap(); + } + + /** + * + * + *
        +     * Optional. User defined annotations. See
        +     * https://google.aip.dev/148#annotations for more details such as format and
        +     * size limitations
        +     * 
        + * + * map<string, string> annotations = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public java.util.Map getAnnotationsMap() { + return internalGetAnnotations().getMap(); + } + + /** + * + * + *
        +     * Optional. User defined annotations. See
        +     * https://google.aip.dev/148#annotations for more details such as format and
        +     * size limitations
        +     * 
        + * + * map<string, string> annotations = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public /* nullable */ java.lang.String getAnnotationsOrDefault( + java.lang.String key, + /* nullable */ + java.lang.String defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetAnnotations().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + + /** + * + * + *
        +     * Optional. User defined annotations. See
        +     * https://google.aip.dev/148#annotations for more details such as format and
        +     * size limitations
        +     * 
        + * + * map<string, string> annotations = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public java.lang.String getAnnotationsOrThrow(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetAnnotations().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public Builder clearAnnotations() { + bitField0_ = (bitField0_ & ~0x00000010); + internalGetMutableAnnotations().getMutableMap().clear(); + return this; + } + + /** + * + * + *
        +     * Optional. User defined annotations. See
        +     * https://google.aip.dev/148#annotations for more details such as format and
        +     * size limitations
        +     * 
        + * + * map<string, string> annotations = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder removeAnnotations(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + internalGetMutableAnnotations().getMutableMap().remove(key); + return this; + } + + /** Use alternate mutation accessors instead. */ + @java.lang.Deprecated + public java.util.Map getMutableAnnotations() { + bitField0_ |= 0x00000010; + return internalGetMutableAnnotations().getMutableMap(); + } + + /** + * + * + *
        +     * Optional. User defined annotations. See
        +     * https://google.aip.dev/148#annotations for more details such as format and
        +     * size limitations
        +     * 
        + * + * map<string, string> annotations = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder putAnnotations(java.lang.String key, java.lang.String value) { + if (key == null) { + throw new NullPointerException("map key"); + } + if (value == null) { + throw new NullPointerException("map value"); + } + internalGetMutableAnnotations().getMutableMap().put(key, value); + bitField0_ |= 0x00000010; + return this; + } + + /** + * + * + *
        +     * Optional. User defined annotations. See
        +     * https://google.aip.dev/148#annotations for more details such as format and
        +     * size limitations
        +     * 
        + * + * map<string, string> annotations = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder putAllAnnotations(java.util.Map values) { + internalGetMutableAnnotations().getMutableMap().putAll(values); + bitField0_ |= 0x00000010; + return this; + } + + private com.google.protobuf.Timestamp createTime_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + createTimeBuilder_; + + /** + * + * + *
        +     * Output only. The time when the principal access boundary policy was
        +     * created.
        +     * 
        + * + * + * .google.protobuf.Timestamp create_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the createTime field is set. + */ + public boolean hasCreateTime() { + return ((bitField0_ & 0x00000020) != 0); + } + + /** + * + * + *
        +     * Output only. The time when the principal access boundary policy was
        +     * created.
        +     * 
        + * + * + * .google.protobuf.Timestamp create_time = 6 [(.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 time when the principal access boundary policy was
        +     * created.
        +     * 
        + * + * + * .google.protobuf.Timestamp create_time = 6 [(.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_ |= 0x00000020; + onChanged(); + return this; + } + + /** + * + * + *
        +     * Output only. The time when the principal access boundary policy was
        +     * created.
        +     * 
        + * + * + * .google.protobuf.Timestamp create_time = 6 [(.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_ |= 0x00000020; + onChanged(); + return this; + } + + /** + * + * + *
        +     * Output only. The time when the principal access boundary policy was
        +     * created.
        +     * 
        + * + * + * .google.protobuf.Timestamp create_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeCreateTime(com.google.protobuf.Timestamp value) { + if (createTimeBuilder_ == null) { + if (((bitField0_ & 0x00000020) != 0) + && createTime_ != null + && createTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getCreateTimeBuilder().mergeFrom(value); + } else { + createTime_ = value; + } + } else { + createTimeBuilder_.mergeFrom(value); + } + if (createTime_ != null) { + bitField0_ |= 0x00000020; + onChanged(); + } + return this; + } + + /** + * + * + *
        +     * Output only. The time when the principal access boundary policy was
        +     * created.
        +     * 
        + * + * + * .google.protobuf.Timestamp create_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearCreateTime() { + bitField0_ = (bitField0_ & ~0x00000020); + createTime_ = null; + if (createTimeBuilder_ != null) { + createTimeBuilder_.dispose(); + createTimeBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
        +     * Output only. The time when the principal access boundary policy was
        +     * created.
        +     * 
        + * + * + * .google.protobuf.Timestamp create_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.Timestamp.Builder getCreateTimeBuilder() { + bitField0_ |= 0x00000020; + onChanged(); + return internalGetCreateTimeFieldBuilder().getBuilder(); + } + + /** + * + * + *
        +     * Output only. The time when the principal access boundary policy was
        +     * created.
        +     * 
        + * + * + * .google.protobuf.Timestamp create_time = 6 [(.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 time when the principal access boundary policy was
        +     * created.
        +     * 
        + * + * + * .google.protobuf.Timestamp create_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + internalGetCreateTimeFieldBuilder() { + if (createTimeBuilder_ == null) { + createTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + 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.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + updateTimeBuilder_; + + /** + * + * + *
        +     * Output only. The time when the principal access boundary policy was most
        +     * recently updated.
        +     * 
        + * + * + * .google.protobuf.Timestamp update_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the updateTime field is set. + */ + public boolean hasUpdateTime() { + return ((bitField0_ & 0x00000040) != 0); + } + + /** + * + * + *
        +     * Output only. The time when the principal access boundary policy was most
        +     * recently updated.
        +     * 
        + * + * + * .google.protobuf.Timestamp update_time = 7 [(.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 time when the principal access boundary policy was most
        +     * recently updated.
        +     * 
        + * + * + * .google.protobuf.Timestamp update_time = 7 [(.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_ |= 0x00000040; + onChanged(); + return this; + } + + /** + * + * + *
        +     * Output only. The time when the principal access boundary policy was most
        +     * recently updated.
        +     * 
        + * + * + * .google.protobuf.Timestamp update_time = 7 [(.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_ |= 0x00000040; + onChanged(); + return this; + } + + /** + * + * + *
        +     * Output only. The time when the principal access boundary policy was most
        +     * recently updated.
        +     * 
        + * + * + * .google.protobuf.Timestamp update_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeUpdateTime(com.google.protobuf.Timestamp value) { + if (updateTimeBuilder_ == null) { + if (((bitField0_ & 0x00000040) != 0) + && updateTime_ != null + && updateTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getUpdateTimeBuilder().mergeFrom(value); + } else { + updateTime_ = value; + } + } else { + updateTimeBuilder_.mergeFrom(value); + } + if (updateTime_ != null) { + bitField0_ |= 0x00000040; + onChanged(); + } + return this; + } + + /** + * + * + *
        +     * Output only. The time when the principal access boundary policy was most
        +     * recently updated.
        +     * 
        + * + * + * .google.protobuf.Timestamp update_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearUpdateTime() { + bitField0_ = (bitField0_ & ~0x00000040); + updateTime_ = null; + if (updateTimeBuilder_ != null) { + updateTimeBuilder_.dispose(); + updateTimeBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
        +     * Output only. The time when the principal access boundary policy was most
        +     * recently updated.
        +     * 
        + * + * + * .google.protobuf.Timestamp update_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.Timestamp.Builder getUpdateTimeBuilder() { + bitField0_ |= 0x00000040; + onChanged(); + return internalGetUpdateTimeFieldBuilder().getBuilder(); + } + + /** + * + * + *
        +     * Output only. The time when the principal access boundary policy was most
        +     * recently updated.
        +     * 
        + * + * + * .google.protobuf.Timestamp update_time = 7 [(.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 time when the principal access boundary policy was most
        +     * recently updated.
        +     * 
        + * + * + * .google.protobuf.Timestamp update_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + internalGetUpdateTimeFieldBuilder() { + if (updateTimeBuilder_ == null) { + updateTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getUpdateTime(), getParentForChildren(), isClean()); + updateTime_ = null; + } + return updateTimeBuilder_; + } + + private com.google.iam.v3.PrincipalAccessBoundaryPolicyDetails details_; + private com.google.protobuf.SingleFieldBuilder< + com.google.iam.v3.PrincipalAccessBoundaryPolicyDetails, + com.google.iam.v3.PrincipalAccessBoundaryPolicyDetails.Builder, + com.google.iam.v3.PrincipalAccessBoundaryPolicyDetailsOrBuilder> + detailsBuilder_; + + /** + * + * + *
        +     * Optional. The details for the principal access boundary policy.
        +     * 
        + * + * + * .google.iam.v3.PrincipalAccessBoundaryPolicyDetails details = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the details field is set. + */ + public boolean hasDetails() { + return ((bitField0_ & 0x00000080) != 0); + } + + /** + * + * + *
        +     * Optional. The details for the principal access boundary policy.
        +     * 
        + * + * + * .google.iam.v3.PrincipalAccessBoundaryPolicyDetails details = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The details. + */ + public com.google.iam.v3.PrincipalAccessBoundaryPolicyDetails getDetails() { + if (detailsBuilder_ == null) { + return details_ == null + ? com.google.iam.v3.PrincipalAccessBoundaryPolicyDetails.getDefaultInstance() + : details_; + } else { + return detailsBuilder_.getMessage(); + } + } + + /** + * + * + *
        +     * Optional. The details for the principal access boundary policy.
        +     * 
        + * + * + * .google.iam.v3.PrincipalAccessBoundaryPolicyDetails details = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setDetails(com.google.iam.v3.PrincipalAccessBoundaryPolicyDetails value) { + if (detailsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + details_ = value; + } else { + detailsBuilder_.setMessage(value); + } + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + + /** + * + * + *
        +     * Optional. The details for the principal access boundary policy.
        +     * 
        + * + * + * .google.iam.v3.PrincipalAccessBoundaryPolicyDetails details = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setDetails( + com.google.iam.v3.PrincipalAccessBoundaryPolicyDetails.Builder builderForValue) { + if (detailsBuilder_ == null) { + details_ = builderForValue.build(); + } else { + detailsBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + + /** + * + * + *
        +     * Optional. The details for the principal access boundary policy.
        +     * 
        + * + * + * .google.iam.v3.PrincipalAccessBoundaryPolicyDetails details = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder mergeDetails(com.google.iam.v3.PrincipalAccessBoundaryPolicyDetails value) { + if (detailsBuilder_ == null) { + if (((bitField0_ & 0x00000080) != 0) + && details_ != null + && details_ + != com.google.iam.v3.PrincipalAccessBoundaryPolicyDetails.getDefaultInstance()) { + getDetailsBuilder().mergeFrom(value); + } else { + details_ = value; + } + } else { + detailsBuilder_.mergeFrom(value); + } + if (details_ != null) { + bitField0_ |= 0x00000080; + onChanged(); + } + return this; + } + + /** + * + * + *
        +     * Optional. The details for the principal access boundary policy.
        +     * 
        + * + * + * .google.iam.v3.PrincipalAccessBoundaryPolicyDetails details = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder clearDetails() { + bitField0_ = (bitField0_ & ~0x00000080); + details_ = null; + if (detailsBuilder_ != null) { + detailsBuilder_.dispose(); + detailsBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
        +     * Optional. The details for the principal access boundary policy.
        +     * 
        + * + * + * .google.iam.v3.PrincipalAccessBoundaryPolicyDetails details = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.iam.v3.PrincipalAccessBoundaryPolicyDetails.Builder getDetailsBuilder() { + bitField0_ |= 0x00000080; + onChanged(); + return internalGetDetailsFieldBuilder().getBuilder(); + } + + /** + * + * + *
        +     * Optional. The details for the principal access boundary policy.
        +     * 
        + * + * + * .google.iam.v3.PrincipalAccessBoundaryPolicyDetails details = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.iam.v3.PrincipalAccessBoundaryPolicyDetailsOrBuilder getDetailsOrBuilder() { + if (detailsBuilder_ != null) { + return detailsBuilder_.getMessageOrBuilder(); + } else { + return details_ == null + ? com.google.iam.v3.PrincipalAccessBoundaryPolicyDetails.getDefaultInstance() + : details_; + } + } + + /** + * + * + *
        +     * Optional. The details for the principal access boundary policy.
        +     * 
        + * + * + * .google.iam.v3.PrincipalAccessBoundaryPolicyDetails details = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.iam.v3.PrincipalAccessBoundaryPolicyDetails, + com.google.iam.v3.PrincipalAccessBoundaryPolicyDetails.Builder, + com.google.iam.v3.PrincipalAccessBoundaryPolicyDetailsOrBuilder> + internalGetDetailsFieldBuilder() { + if (detailsBuilder_ == null) { + detailsBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.iam.v3.PrincipalAccessBoundaryPolicyDetails, + com.google.iam.v3.PrincipalAccessBoundaryPolicyDetails.Builder, + com.google.iam.v3.PrincipalAccessBoundaryPolicyDetailsOrBuilder>( + getDetails(), getParentForChildren(), isClean()); + details_ = null; + } + return detailsBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.iam.v3.PrincipalAccessBoundaryPolicy) + } + + // @@protoc_insertion_point(class_scope:google.iam.v3.PrincipalAccessBoundaryPolicy) + private static final com.google.iam.v3.PrincipalAccessBoundaryPolicy DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.iam.v3.PrincipalAccessBoundaryPolicy(); + } + + public static com.google.iam.v3.PrincipalAccessBoundaryPolicy getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public PrincipalAccessBoundaryPolicy 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.iam.v3.PrincipalAccessBoundaryPolicy getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-iam/proto-google-iam-v3/src/main/java/com/google/iam/v3/PrincipalAccessBoundaryPolicyDetails.java b/java-iam/proto-google-iam-v3/src/main/java/com/google/iam/v3/PrincipalAccessBoundaryPolicyDetails.java new file mode 100644 index 0000000000..4ddf2a95bc --- /dev/null +++ b/java-iam/proto-google-iam-v3/src/main/java/com/google/iam/v3/PrincipalAccessBoundaryPolicyDetails.java @@ -0,0 +1,1215 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/iam/v3/principal_access_boundary_policy_resources.proto +// Protobuf Java Version: 4.33.2 + +package com.google.iam.v3; + +/** + * + * + *
        + * Principal access boundary policy details
        + * 
        + * + * Protobuf type {@code google.iam.v3.PrincipalAccessBoundaryPolicyDetails} + */ +@com.google.protobuf.Generated +public final class PrincipalAccessBoundaryPolicyDetails extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.iam.v3.PrincipalAccessBoundaryPolicyDetails) + PrincipalAccessBoundaryPolicyDetailsOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "PrincipalAccessBoundaryPolicyDetails"); + } + + // Use PrincipalAccessBoundaryPolicyDetails.newBuilder() to construct. + private PrincipalAccessBoundaryPolicyDetails( + com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private PrincipalAccessBoundaryPolicyDetails() { + rules_ = java.util.Collections.emptyList(); + enforcementVersion_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.iam.v3.PrincipalAccessBoundaryPolicyResourcesProto + .internal_static_google_iam_v3_PrincipalAccessBoundaryPolicyDetails_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.iam.v3.PrincipalAccessBoundaryPolicyResourcesProto + .internal_static_google_iam_v3_PrincipalAccessBoundaryPolicyDetails_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.iam.v3.PrincipalAccessBoundaryPolicyDetails.class, + com.google.iam.v3.PrincipalAccessBoundaryPolicyDetails.Builder.class); + } + + public static final int RULES_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private java.util.List rules_; + + /** + * + * + *
        +   * Required. A list of principal access boundary policy rules. The number of
        +   * rules in a policy is limited to 500.
        +   * 
        + * + * + * repeated .google.iam.v3.PrincipalAccessBoundaryPolicyRule rules = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public java.util.List getRulesList() { + return rules_; + } + + /** + * + * + *
        +   * Required. A list of principal access boundary policy rules. The number of
        +   * rules in a policy is limited to 500.
        +   * 
        + * + * + * repeated .google.iam.v3.PrincipalAccessBoundaryPolicyRule rules = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public java.util.List + getRulesOrBuilderList() { + return rules_; + } + + /** + * + * + *
        +   * Required. A list of principal access boundary policy rules. The number of
        +   * rules in a policy is limited to 500.
        +   * 
        + * + * + * repeated .google.iam.v3.PrincipalAccessBoundaryPolicyRule rules = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public int getRulesCount() { + return rules_.size(); + } + + /** + * + * + *
        +   * Required. A list of principal access boundary policy rules. The number of
        +   * rules in a policy is limited to 500.
        +   * 
        + * + * + * repeated .google.iam.v3.PrincipalAccessBoundaryPolicyRule rules = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.iam.v3.PrincipalAccessBoundaryPolicyRule getRules(int index) { + return rules_.get(index); + } + + /** + * + * + *
        +   * Required. A list of principal access boundary policy rules. The number of
        +   * rules in a policy is limited to 500.
        +   * 
        + * + * + * repeated .google.iam.v3.PrincipalAccessBoundaryPolicyRule rules = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.iam.v3.PrincipalAccessBoundaryPolicyRuleOrBuilder getRulesOrBuilder(int index) { + return rules_.get(index); + } + + public static final int ENFORCEMENT_VERSION_FIELD_NUMBER = 4; + + @SuppressWarnings("serial") + private volatile java.lang.Object enforcementVersion_ = ""; + + /** + * + * + *
        +   * Optional.
        +   * The version number (for example, `1` or `latest`) that indicates which
        +   * permissions are able to be blocked by the policy. If empty, the PAB policy
        +   * version will be set to the most recent version number at the time of the
        +   * policy's creation.
        +   * 
        + * + * string enforcement_version = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The enforcementVersion. + */ + @java.lang.Override + public java.lang.String getEnforcementVersion() { + java.lang.Object ref = enforcementVersion_; + 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(); + enforcementVersion_ = s; + return s; + } + } + + /** + * + * + *
        +   * Optional.
        +   * The version number (for example, `1` or `latest`) that indicates which
        +   * permissions are able to be blocked by the policy. If empty, the PAB policy
        +   * version will be set to the most recent version number at the time of the
        +   * policy's creation.
        +   * 
        + * + * string enforcement_version = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for enforcementVersion. + */ + @java.lang.Override + public com.google.protobuf.ByteString getEnforcementVersionBytes() { + java.lang.Object ref = enforcementVersion_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + enforcementVersion_ = 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 < rules_.size(); i++) { + output.writeMessage(1, rules_.get(i)); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(enforcementVersion_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 4, enforcementVersion_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < rules_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, rules_.get(i)); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(enforcementVersion_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(4, enforcementVersion_); + } + 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.iam.v3.PrincipalAccessBoundaryPolicyDetails)) { + return super.equals(obj); + } + com.google.iam.v3.PrincipalAccessBoundaryPolicyDetails other = + (com.google.iam.v3.PrincipalAccessBoundaryPolicyDetails) obj; + + if (!getRulesList().equals(other.getRulesList())) return false; + if (!getEnforcementVersion().equals(other.getEnforcementVersion())) 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 (getRulesCount() > 0) { + hash = (37 * hash) + RULES_FIELD_NUMBER; + hash = (53 * hash) + getRulesList().hashCode(); + } + hash = (37 * hash) + ENFORCEMENT_VERSION_FIELD_NUMBER; + hash = (53 * hash) + getEnforcementVersion().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.iam.v3.PrincipalAccessBoundaryPolicyDetails parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.iam.v3.PrincipalAccessBoundaryPolicyDetails parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.iam.v3.PrincipalAccessBoundaryPolicyDetails parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.iam.v3.PrincipalAccessBoundaryPolicyDetails 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.iam.v3.PrincipalAccessBoundaryPolicyDetails parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.iam.v3.PrincipalAccessBoundaryPolicyDetails parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.iam.v3.PrincipalAccessBoundaryPolicyDetails parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.iam.v3.PrincipalAccessBoundaryPolicyDetails parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.iam.v3.PrincipalAccessBoundaryPolicyDetails parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.iam.v3.PrincipalAccessBoundaryPolicyDetails parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.iam.v3.PrincipalAccessBoundaryPolicyDetails parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.iam.v3.PrincipalAccessBoundaryPolicyDetails parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.iam.v3.PrincipalAccessBoundaryPolicyDetails 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
        +   * Principal access boundary policy details
        +   * 
        + * + * Protobuf type {@code google.iam.v3.PrincipalAccessBoundaryPolicyDetails} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.iam.v3.PrincipalAccessBoundaryPolicyDetails) + com.google.iam.v3.PrincipalAccessBoundaryPolicyDetailsOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.iam.v3.PrincipalAccessBoundaryPolicyResourcesProto + .internal_static_google_iam_v3_PrincipalAccessBoundaryPolicyDetails_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.iam.v3.PrincipalAccessBoundaryPolicyResourcesProto + .internal_static_google_iam_v3_PrincipalAccessBoundaryPolicyDetails_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.iam.v3.PrincipalAccessBoundaryPolicyDetails.class, + com.google.iam.v3.PrincipalAccessBoundaryPolicyDetails.Builder.class); + } + + // Construct using com.google.iam.v3.PrincipalAccessBoundaryPolicyDetails.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (rulesBuilder_ == null) { + rules_ = java.util.Collections.emptyList(); + } else { + rules_ = null; + rulesBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + enforcementVersion_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.iam.v3.PrincipalAccessBoundaryPolicyResourcesProto + .internal_static_google_iam_v3_PrincipalAccessBoundaryPolicyDetails_descriptor; + } + + @java.lang.Override + public com.google.iam.v3.PrincipalAccessBoundaryPolicyDetails getDefaultInstanceForType() { + return com.google.iam.v3.PrincipalAccessBoundaryPolicyDetails.getDefaultInstance(); + } + + @java.lang.Override + public com.google.iam.v3.PrincipalAccessBoundaryPolicyDetails build() { + com.google.iam.v3.PrincipalAccessBoundaryPolicyDetails result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.iam.v3.PrincipalAccessBoundaryPolicyDetails buildPartial() { + com.google.iam.v3.PrincipalAccessBoundaryPolicyDetails result = + new com.google.iam.v3.PrincipalAccessBoundaryPolicyDetails(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields( + com.google.iam.v3.PrincipalAccessBoundaryPolicyDetails result) { + if (rulesBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + rules_ = java.util.Collections.unmodifiableList(rules_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.rules_ = rules_; + } else { + result.rules_ = rulesBuilder_.build(); + } + } + + private void buildPartial0(com.google.iam.v3.PrincipalAccessBoundaryPolicyDetails result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.enforcementVersion_ = enforcementVersion_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.iam.v3.PrincipalAccessBoundaryPolicyDetails) { + return mergeFrom((com.google.iam.v3.PrincipalAccessBoundaryPolicyDetails) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.iam.v3.PrincipalAccessBoundaryPolicyDetails other) { + if (other == com.google.iam.v3.PrincipalAccessBoundaryPolicyDetails.getDefaultInstance()) + return this; + if (rulesBuilder_ == null) { + if (!other.rules_.isEmpty()) { + if (rules_.isEmpty()) { + rules_ = other.rules_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureRulesIsMutable(); + rules_.addAll(other.rules_); + } + onChanged(); + } + } else { + if (!other.rules_.isEmpty()) { + if (rulesBuilder_.isEmpty()) { + rulesBuilder_.dispose(); + rulesBuilder_ = null; + rules_ = other.rules_; + bitField0_ = (bitField0_ & ~0x00000001); + rulesBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders + ? internalGetRulesFieldBuilder() + : null; + } else { + rulesBuilder_.addAllMessages(other.rules_); + } + } + } + if (!other.getEnforcementVersion().isEmpty()) { + enforcementVersion_ = other.enforcementVersion_; + 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.iam.v3.PrincipalAccessBoundaryPolicyRule m = + input.readMessage( + com.google.iam.v3.PrincipalAccessBoundaryPolicyRule.parser(), + extensionRegistry); + if (rulesBuilder_ == null) { + ensureRulesIsMutable(); + rules_.add(m); + } else { + rulesBuilder_.addMessage(m); + } + break; + } // case 10 + case 34: + { + enforcementVersion_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + 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.util.List rules_ = + java.util.Collections.emptyList(); + + private void ensureRulesIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + rules_ = + new java.util.ArrayList(rules_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.google.iam.v3.PrincipalAccessBoundaryPolicyRule, + com.google.iam.v3.PrincipalAccessBoundaryPolicyRule.Builder, + com.google.iam.v3.PrincipalAccessBoundaryPolicyRuleOrBuilder> + rulesBuilder_; + + /** + * + * + *
        +     * Required. A list of principal access boundary policy rules. The number of
        +     * rules in a policy is limited to 500.
        +     * 
        + * + * + * repeated .google.iam.v3.PrincipalAccessBoundaryPolicyRule rules = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public java.util.List getRulesList() { + if (rulesBuilder_ == null) { + return java.util.Collections.unmodifiableList(rules_); + } else { + return rulesBuilder_.getMessageList(); + } + } + + /** + * + * + *
        +     * Required. A list of principal access boundary policy rules. The number of
        +     * rules in a policy is limited to 500.
        +     * 
        + * + * + * repeated .google.iam.v3.PrincipalAccessBoundaryPolicyRule rules = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public int getRulesCount() { + if (rulesBuilder_ == null) { + return rules_.size(); + } else { + return rulesBuilder_.getCount(); + } + } + + /** + * + * + *
        +     * Required. A list of principal access boundary policy rules. The number of
        +     * rules in a policy is limited to 500.
        +     * 
        + * + * + * repeated .google.iam.v3.PrincipalAccessBoundaryPolicyRule rules = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.iam.v3.PrincipalAccessBoundaryPolicyRule getRules(int index) { + if (rulesBuilder_ == null) { + return rules_.get(index); + } else { + return rulesBuilder_.getMessage(index); + } + } + + /** + * + * + *
        +     * Required. A list of principal access boundary policy rules. The number of
        +     * rules in a policy is limited to 500.
        +     * 
        + * + * + * repeated .google.iam.v3.PrincipalAccessBoundaryPolicyRule rules = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setRules(int index, com.google.iam.v3.PrincipalAccessBoundaryPolicyRule value) { + if (rulesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureRulesIsMutable(); + rules_.set(index, value); + onChanged(); + } else { + rulesBuilder_.setMessage(index, value); + } + return this; + } + + /** + * + * + *
        +     * Required. A list of principal access boundary policy rules. The number of
        +     * rules in a policy is limited to 500.
        +     * 
        + * + * + * repeated .google.iam.v3.PrincipalAccessBoundaryPolicyRule rules = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setRules( + int index, com.google.iam.v3.PrincipalAccessBoundaryPolicyRule.Builder builderForValue) { + if (rulesBuilder_ == null) { + ensureRulesIsMutable(); + rules_.set(index, builderForValue.build()); + onChanged(); + } else { + rulesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
        +     * Required. A list of principal access boundary policy rules. The number of
        +     * rules in a policy is limited to 500.
        +     * 
        + * + * + * repeated .google.iam.v3.PrincipalAccessBoundaryPolicyRule rules = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder addRules(com.google.iam.v3.PrincipalAccessBoundaryPolicyRule value) { + if (rulesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureRulesIsMutable(); + rules_.add(value); + onChanged(); + } else { + rulesBuilder_.addMessage(value); + } + return this; + } + + /** + * + * + *
        +     * Required. A list of principal access boundary policy rules. The number of
        +     * rules in a policy is limited to 500.
        +     * 
        + * + * + * repeated .google.iam.v3.PrincipalAccessBoundaryPolicyRule rules = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder addRules(int index, com.google.iam.v3.PrincipalAccessBoundaryPolicyRule value) { + if (rulesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureRulesIsMutable(); + rules_.add(index, value); + onChanged(); + } else { + rulesBuilder_.addMessage(index, value); + } + return this; + } + + /** + * + * + *
        +     * Required. A list of principal access boundary policy rules. The number of
        +     * rules in a policy is limited to 500.
        +     * 
        + * + * + * repeated .google.iam.v3.PrincipalAccessBoundaryPolicyRule rules = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder addRules( + com.google.iam.v3.PrincipalAccessBoundaryPolicyRule.Builder builderForValue) { + if (rulesBuilder_ == null) { + ensureRulesIsMutable(); + rules_.add(builderForValue.build()); + onChanged(); + } else { + rulesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + + /** + * + * + *
        +     * Required. A list of principal access boundary policy rules. The number of
        +     * rules in a policy is limited to 500.
        +     * 
        + * + * + * repeated .google.iam.v3.PrincipalAccessBoundaryPolicyRule rules = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder addRules( + int index, com.google.iam.v3.PrincipalAccessBoundaryPolicyRule.Builder builderForValue) { + if (rulesBuilder_ == null) { + ensureRulesIsMutable(); + rules_.add(index, builderForValue.build()); + onChanged(); + } else { + rulesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
        +     * Required. A list of principal access boundary policy rules. The number of
        +     * rules in a policy is limited to 500.
        +     * 
        + * + * + * repeated .google.iam.v3.PrincipalAccessBoundaryPolicyRule rules = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder addAllRules( + java.lang.Iterable values) { + if (rulesBuilder_ == null) { + ensureRulesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, rules_); + onChanged(); + } else { + rulesBuilder_.addAllMessages(values); + } + return this; + } + + /** + * + * + *
        +     * Required. A list of principal access boundary policy rules. The number of
        +     * rules in a policy is limited to 500.
        +     * 
        + * + * + * repeated .google.iam.v3.PrincipalAccessBoundaryPolicyRule rules = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearRules() { + if (rulesBuilder_ == null) { + rules_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + rulesBuilder_.clear(); + } + return this; + } + + /** + * + * + *
        +     * Required. A list of principal access boundary policy rules. The number of
        +     * rules in a policy is limited to 500.
        +     * 
        + * + * + * repeated .google.iam.v3.PrincipalAccessBoundaryPolicyRule rules = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder removeRules(int index) { + if (rulesBuilder_ == null) { + ensureRulesIsMutable(); + rules_.remove(index); + onChanged(); + } else { + rulesBuilder_.remove(index); + } + return this; + } + + /** + * + * + *
        +     * Required. A list of principal access boundary policy rules. The number of
        +     * rules in a policy is limited to 500.
        +     * 
        + * + * + * repeated .google.iam.v3.PrincipalAccessBoundaryPolicyRule rules = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.iam.v3.PrincipalAccessBoundaryPolicyRule.Builder getRulesBuilder(int index) { + return internalGetRulesFieldBuilder().getBuilder(index); + } + + /** + * + * + *
        +     * Required. A list of principal access boundary policy rules. The number of
        +     * rules in a policy is limited to 500.
        +     * 
        + * + * + * repeated .google.iam.v3.PrincipalAccessBoundaryPolicyRule rules = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.iam.v3.PrincipalAccessBoundaryPolicyRuleOrBuilder getRulesOrBuilder( + int index) { + if (rulesBuilder_ == null) { + return rules_.get(index); + } else { + return rulesBuilder_.getMessageOrBuilder(index); + } + } + + /** + * + * + *
        +     * Required. A list of principal access boundary policy rules. The number of
        +     * rules in a policy is limited to 500.
        +     * 
        + * + * + * repeated .google.iam.v3.PrincipalAccessBoundaryPolicyRule rules = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public java.util.List + getRulesOrBuilderList() { + if (rulesBuilder_ != null) { + return rulesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(rules_); + } + } + + /** + * + * + *
        +     * Required. A list of principal access boundary policy rules. The number of
        +     * rules in a policy is limited to 500.
        +     * 
        + * + * + * repeated .google.iam.v3.PrincipalAccessBoundaryPolicyRule rules = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.iam.v3.PrincipalAccessBoundaryPolicyRule.Builder addRulesBuilder() { + return internalGetRulesFieldBuilder() + .addBuilder(com.google.iam.v3.PrincipalAccessBoundaryPolicyRule.getDefaultInstance()); + } + + /** + * + * + *
        +     * Required. A list of principal access boundary policy rules. The number of
        +     * rules in a policy is limited to 500.
        +     * 
        + * + * + * repeated .google.iam.v3.PrincipalAccessBoundaryPolicyRule rules = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.iam.v3.PrincipalAccessBoundaryPolicyRule.Builder addRulesBuilder(int index) { + return internalGetRulesFieldBuilder() + .addBuilder( + index, com.google.iam.v3.PrincipalAccessBoundaryPolicyRule.getDefaultInstance()); + } + + /** + * + * + *
        +     * Required. A list of principal access boundary policy rules. The number of
        +     * rules in a policy is limited to 500.
        +     * 
        + * + * + * repeated .google.iam.v3.PrincipalAccessBoundaryPolicyRule rules = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public java.util.List + getRulesBuilderList() { + return internalGetRulesFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.google.iam.v3.PrincipalAccessBoundaryPolicyRule, + com.google.iam.v3.PrincipalAccessBoundaryPolicyRule.Builder, + com.google.iam.v3.PrincipalAccessBoundaryPolicyRuleOrBuilder> + internalGetRulesFieldBuilder() { + if (rulesBuilder_ == null) { + rulesBuilder_ = + new com.google.protobuf.RepeatedFieldBuilder< + com.google.iam.v3.PrincipalAccessBoundaryPolicyRule, + com.google.iam.v3.PrincipalAccessBoundaryPolicyRule.Builder, + com.google.iam.v3.PrincipalAccessBoundaryPolicyRuleOrBuilder>( + rules_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + rules_ = null; + } + return rulesBuilder_; + } + + private java.lang.Object enforcementVersion_ = ""; + + /** + * + * + *
        +     * Optional.
        +     * The version number (for example, `1` or `latest`) that indicates which
        +     * permissions are able to be blocked by the policy. If empty, the PAB policy
        +     * version will be set to the most recent version number at the time of the
        +     * policy's creation.
        +     * 
        + * + * string enforcement_version = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The enforcementVersion. + */ + public java.lang.String getEnforcementVersion() { + java.lang.Object ref = enforcementVersion_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + enforcementVersion_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
        +     * Optional.
        +     * The version number (for example, `1` or `latest`) that indicates which
        +     * permissions are able to be blocked by the policy. If empty, the PAB policy
        +     * version will be set to the most recent version number at the time of the
        +     * policy's creation.
        +     * 
        + * + * string enforcement_version = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for enforcementVersion. + */ + public com.google.protobuf.ByteString getEnforcementVersionBytes() { + java.lang.Object ref = enforcementVersion_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + enforcementVersion_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
        +     * Optional.
        +     * The version number (for example, `1` or `latest`) that indicates which
        +     * permissions are able to be blocked by the policy. If empty, the PAB policy
        +     * version will be set to the most recent version number at the time of the
        +     * policy's creation.
        +     * 
        + * + * string enforcement_version = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The enforcementVersion to set. + * @return This builder for chaining. + */ + public Builder setEnforcementVersion(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + enforcementVersion_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
        +     * Optional.
        +     * The version number (for example, `1` or `latest`) that indicates which
        +     * permissions are able to be blocked by the policy. If empty, the PAB policy
        +     * version will be set to the most recent version number at the time of the
        +     * policy's creation.
        +     * 
        + * + * string enforcement_version = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearEnforcementVersion() { + enforcementVersion_ = getDefaultInstance().getEnforcementVersion(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
        +     * Optional.
        +     * The version number (for example, `1` or `latest`) that indicates which
        +     * permissions are able to be blocked by the policy. If empty, the PAB policy
        +     * version will be set to the most recent version number at the time of the
        +     * policy's creation.
        +     * 
        + * + * string enforcement_version = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for enforcementVersion to set. + * @return This builder for chaining. + */ + public Builder setEnforcementVersionBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + enforcementVersion_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.iam.v3.PrincipalAccessBoundaryPolicyDetails) + } + + // @@protoc_insertion_point(class_scope:google.iam.v3.PrincipalAccessBoundaryPolicyDetails) + private static final com.google.iam.v3.PrincipalAccessBoundaryPolicyDetails DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.iam.v3.PrincipalAccessBoundaryPolicyDetails(); + } + + public static com.google.iam.v3.PrincipalAccessBoundaryPolicyDetails getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public PrincipalAccessBoundaryPolicyDetails 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.iam.v3.PrincipalAccessBoundaryPolicyDetails getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-iam/proto-google-iam-v3/src/main/java/com/google/iam/v3/PrincipalAccessBoundaryPolicyDetailsOrBuilder.java b/java-iam/proto-google-iam-v3/src/main/java/com/google/iam/v3/PrincipalAccessBoundaryPolicyDetailsOrBuilder.java new file mode 100644 index 0000000000..0d4764715e --- /dev/null +++ b/java-iam/proto-google-iam-v3/src/main/java/com/google/iam/v3/PrincipalAccessBoundaryPolicyDetailsOrBuilder.java @@ -0,0 +1,133 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/iam/v3/principal_access_boundary_policy_resources.proto +// Protobuf Java Version: 4.33.2 + +package com.google.iam.v3; + +@com.google.protobuf.Generated +public interface PrincipalAccessBoundaryPolicyDetailsOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.iam.v3.PrincipalAccessBoundaryPolicyDetails) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
        +   * Required. A list of principal access boundary policy rules. The number of
        +   * rules in a policy is limited to 500.
        +   * 
        + * + * + * repeated .google.iam.v3.PrincipalAccessBoundaryPolicyRule rules = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + java.util.List getRulesList(); + + /** + * + * + *
        +   * Required. A list of principal access boundary policy rules. The number of
        +   * rules in a policy is limited to 500.
        +   * 
        + * + * + * repeated .google.iam.v3.PrincipalAccessBoundaryPolicyRule rules = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.iam.v3.PrincipalAccessBoundaryPolicyRule getRules(int index); + + /** + * + * + *
        +   * Required. A list of principal access boundary policy rules. The number of
        +   * rules in a policy is limited to 500.
        +   * 
        + * + * + * repeated .google.iam.v3.PrincipalAccessBoundaryPolicyRule rules = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + int getRulesCount(); + + /** + * + * + *
        +   * Required. A list of principal access boundary policy rules. The number of
        +   * rules in a policy is limited to 500.
        +   * 
        + * + * + * repeated .google.iam.v3.PrincipalAccessBoundaryPolicyRule rules = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + java.util.List + getRulesOrBuilderList(); + + /** + * + * + *
        +   * Required. A list of principal access boundary policy rules. The number of
        +   * rules in a policy is limited to 500.
        +   * 
        + * + * + * repeated .google.iam.v3.PrincipalAccessBoundaryPolicyRule rules = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.iam.v3.PrincipalAccessBoundaryPolicyRuleOrBuilder getRulesOrBuilder(int index); + + /** + * + * + *
        +   * Optional.
        +   * The version number (for example, `1` or `latest`) that indicates which
        +   * permissions are able to be blocked by the policy. If empty, the PAB policy
        +   * version will be set to the most recent version number at the time of the
        +   * policy's creation.
        +   * 
        + * + * string enforcement_version = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The enforcementVersion. + */ + java.lang.String getEnforcementVersion(); + + /** + * + * + *
        +   * Optional.
        +   * The version number (for example, `1` or `latest`) that indicates which
        +   * permissions are able to be blocked by the policy. If empty, the PAB policy
        +   * version will be set to the most recent version number at the time of the
        +   * policy's creation.
        +   * 
        + * + * string enforcement_version = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for enforcementVersion. + */ + com.google.protobuf.ByteString getEnforcementVersionBytes(); +} diff --git a/java-iam/proto-google-iam-v3/src/main/java/com/google/iam/v3/PrincipalAccessBoundaryPolicyName.java b/java-iam/proto-google-iam-v3/src/main/java/com/google/iam/v3/PrincipalAccessBoundaryPolicyName.java new file mode 100644 index 0000000000..ef07cb8b17 --- /dev/null +++ b/java-iam/proto-google-iam-v3/src/main/java/com/google/iam/v3/PrincipalAccessBoundaryPolicyName.java @@ -0,0 +1,243 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.iam.v3; + +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 PrincipalAccessBoundaryPolicyName implements ResourceName { + private static final PathTemplate ORGANIZATION_LOCATION_PRINCIPAL_ACCESS_BOUNDARY_POLICY = + PathTemplate.createWithoutUrlEncoding( + "organizations/{organization}/locations/{location}/principalAccessBoundaryPolicies/{principal_access_boundary_policy}"); + private volatile Map fieldValuesMap; + private final String organization; + private final String location; + private final String principalAccessBoundaryPolicy; + + @Deprecated + protected PrincipalAccessBoundaryPolicyName() { + organization = null; + location = null; + principalAccessBoundaryPolicy = null; + } + + private PrincipalAccessBoundaryPolicyName(Builder builder) { + organization = Preconditions.checkNotNull(builder.getOrganization()); + location = Preconditions.checkNotNull(builder.getLocation()); + principalAccessBoundaryPolicy = + Preconditions.checkNotNull(builder.getPrincipalAccessBoundaryPolicy()); + } + + public String getOrganization() { + return organization; + } + + public String getLocation() { + return location; + } + + public String getPrincipalAccessBoundaryPolicy() { + return principalAccessBoundaryPolicy; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + public static PrincipalAccessBoundaryPolicyName of( + String organization, String location, String principalAccessBoundaryPolicy) { + return newBuilder() + .setOrganization(organization) + .setLocation(location) + .setPrincipalAccessBoundaryPolicy(principalAccessBoundaryPolicy) + .build(); + } + + public static String format( + String organization, String location, String principalAccessBoundaryPolicy) { + return newBuilder() + .setOrganization(organization) + .setLocation(location) + .setPrincipalAccessBoundaryPolicy(principalAccessBoundaryPolicy) + .build() + .toString(); + } + + public static PrincipalAccessBoundaryPolicyName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + ORGANIZATION_LOCATION_PRINCIPAL_ACCESS_BOUNDARY_POLICY.validatedMatch( + formattedString, + "PrincipalAccessBoundaryPolicyName.parse: formattedString not in valid format"); + return of( + matchMap.get("organization"), + matchMap.get("location"), + matchMap.get("principal_access_boundary_policy")); + } + + 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 (PrincipalAccessBoundaryPolicyName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return ORGANIZATION_LOCATION_PRINCIPAL_ACCESS_BOUNDARY_POLICY.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); + } + if (principalAccessBoundaryPolicy != null) { + fieldMapBuilder.put("principal_access_boundary_policy", principalAccessBoundaryPolicy); + } + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return ORGANIZATION_LOCATION_PRINCIPAL_ACCESS_BOUNDARY_POLICY.instantiate( + "organization", + organization, + "location", + location, + "principal_access_boundary_policy", + principalAccessBoundaryPolicy); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o != null && getClass() == o.getClass()) { + PrincipalAccessBoundaryPolicyName that = ((PrincipalAccessBoundaryPolicyName) o); + return Objects.equals(this.organization, that.organization) + && Objects.equals(this.location, that.location) + && Objects.equals(this.principalAccessBoundaryPolicy, that.principalAccessBoundaryPolicy); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= Objects.hashCode(organization); + h *= 1000003; + h ^= Objects.hashCode(location); + h *= 1000003; + h ^= Objects.hashCode(principalAccessBoundaryPolicy); + return h; + } + + /** + * Builder for + * organizations/{organization}/locations/{location}/principalAccessBoundaryPolicies/{principal_access_boundary_policy}. + */ + public static class Builder { + private String organization; + private String location; + private String principalAccessBoundaryPolicy; + + protected Builder() {} + + public String getOrganization() { + return organization; + } + + public String getLocation() { + return location; + } + + public String getPrincipalAccessBoundaryPolicy() { + return principalAccessBoundaryPolicy; + } + + public Builder setOrganization(String organization) { + this.organization = organization; + return this; + } + + public Builder setLocation(String location) { + this.location = location; + return this; + } + + public Builder setPrincipalAccessBoundaryPolicy(String principalAccessBoundaryPolicy) { + this.principalAccessBoundaryPolicy = principalAccessBoundaryPolicy; + return this; + } + + private Builder(PrincipalAccessBoundaryPolicyName principalAccessBoundaryPolicyName) { + this.organization = principalAccessBoundaryPolicyName.organization; + this.location = principalAccessBoundaryPolicyName.location; + this.principalAccessBoundaryPolicy = + principalAccessBoundaryPolicyName.principalAccessBoundaryPolicy; + } + + public PrincipalAccessBoundaryPolicyName build() { + return new PrincipalAccessBoundaryPolicyName(this); + } + } +} diff --git a/java-iam/proto-google-iam-v3/src/main/java/com/google/iam/v3/PrincipalAccessBoundaryPolicyOrBuilder.java b/java-iam/proto-google-iam-v3/src/main/java/com/google/iam/v3/PrincipalAccessBoundaryPolicyOrBuilder.java new file mode 100644 index 0000000000..17d30a05ca --- /dev/null +++ b/java-iam/proto-google-iam-v3/src/main/java/com/google/iam/v3/PrincipalAccessBoundaryPolicyOrBuilder.java @@ -0,0 +1,355 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/iam/v3/principal_access_boundary_policy_resources.proto +// Protobuf Java Version: 4.33.2 + +package com.google.iam.v3; + +@com.google.protobuf.Generated +public interface PrincipalAccessBoundaryPolicyOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.iam.v3.PrincipalAccessBoundaryPolicy) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
        +   * Identifier. The resource name of the principal access boundary policy.
        +   *
        +   * The following format is supported:
        +   * `organizations/{organization_id}/locations/{location}/principalAccessBoundaryPolicies/{policy_id}`
        +   * 
        + * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @return The name. + */ + java.lang.String getName(); + + /** + * + * + *
        +   * Identifier. The resource name of the principal access boundary policy.
        +   *
        +   * The following format is supported:
        +   * `organizations/{organization_id}/locations/{location}/principalAccessBoundaryPolicies/{policy_id}`
        +   * 
        + * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
        +   * Output only. The globally unique ID of the principal access boundary
        +   * policy.
        +   * 
        + * + * + * string uid = 2 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_info) = { ... } + * + * + * @return The uid. + */ + java.lang.String getUid(); + + /** + * + * + *
        +   * Output only. The globally unique ID of the principal access boundary
        +   * policy.
        +   * 
        + * + * + * string uid = 2 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_info) = { ... } + * + * + * @return The bytes for uid. + */ + com.google.protobuf.ByteString getUidBytes(); + + /** + * + * + *
        +   * Optional. The etag for the principal access boundary.
        +   * If this is provided on update, it must match the server's etag.
        +   * 
        + * + * string etag = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The etag. + */ + java.lang.String getEtag(); + + /** + * + * + *
        +   * Optional. The etag for the principal access boundary.
        +   * If this is provided on update, it must match the server's etag.
        +   * 
        + * + * string etag = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for etag. + */ + com.google.protobuf.ByteString getEtagBytes(); + + /** + * + * + *
        +   * Optional. The description of the principal access boundary policy. Must be
        +   * less than or equal to 63 characters.
        +   * 
        + * + * string display_name = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The displayName. + */ + java.lang.String getDisplayName(); + + /** + * + * + *
        +   * Optional. The description of the principal access boundary policy. Must be
        +   * less than or equal to 63 characters.
        +   * 
        + * + * string display_name = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for displayName. + */ + com.google.protobuf.ByteString getDisplayNameBytes(); + + /** + * + * + *
        +   * Optional. User defined annotations. See
        +   * https://google.aip.dev/148#annotations for more details such as format and
        +   * size limitations
        +   * 
        + * + * map<string, string> annotations = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + int getAnnotationsCount(); + + /** + * + * + *
        +   * Optional. User defined annotations. See
        +   * https://google.aip.dev/148#annotations for more details such as format and
        +   * size limitations
        +   * 
        + * + * map<string, string> annotations = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + boolean containsAnnotations(java.lang.String key); + + /** Use {@link #getAnnotationsMap()} instead. */ + @java.lang.Deprecated + java.util.Map getAnnotations(); + + /** + * + * + *
        +   * Optional. User defined annotations. See
        +   * https://google.aip.dev/148#annotations for more details such as format and
        +   * size limitations
        +   * 
        + * + * map<string, string> annotations = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + java.util.Map getAnnotationsMap(); + + /** + * + * + *
        +   * Optional. User defined annotations. See
        +   * https://google.aip.dev/148#annotations for more details such as format and
        +   * size limitations
        +   * 
        + * + * map<string, string> annotations = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + /* nullable */ + java.lang.String getAnnotationsOrDefault( + java.lang.String key, + /* nullable */ + java.lang.String defaultValue); + + /** + * + * + *
        +   * Optional. User defined annotations. See
        +   * https://google.aip.dev/148#annotations for more details such as format and
        +   * size limitations
        +   * 
        + * + * map<string, string> annotations = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + java.lang.String getAnnotationsOrThrow(java.lang.String key); + + /** + * + * + *
        +   * Output only. The time when the principal access boundary policy was
        +   * created.
        +   * 
        + * + * .google.protobuf.Timestamp create_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the createTime field is set. + */ + boolean hasCreateTime(); + + /** + * + * + *
        +   * Output only. The time when the principal access boundary policy was
        +   * created.
        +   * 
        + * + * .google.protobuf.Timestamp create_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The createTime. + */ + com.google.protobuf.Timestamp getCreateTime(); + + /** + * + * + *
        +   * Output only. The time when the principal access boundary policy was
        +   * created.
        +   * 
        + * + * .google.protobuf.Timestamp create_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder(); + + /** + * + * + *
        +   * Output only. The time when the principal access boundary policy was most
        +   * recently updated.
        +   * 
        + * + * .google.protobuf.Timestamp update_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the updateTime field is set. + */ + boolean hasUpdateTime(); + + /** + * + * + *
        +   * Output only. The time when the principal access boundary policy was most
        +   * recently updated.
        +   * 
        + * + * .google.protobuf.Timestamp update_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The updateTime. + */ + com.google.protobuf.Timestamp getUpdateTime(); + + /** + * + * + *
        +   * Output only. The time when the principal access boundary policy was most
        +   * recently updated.
        +   * 
        + * + * .google.protobuf.Timestamp update_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder(); + + /** + * + * + *
        +   * Optional. The details for the principal access boundary policy.
        +   * 
        + * + * + * .google.iam.v3.PrincipalAccessBoundaryPolicyDetails details = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the details field is set. + */ + boolean hasDetails(); + + /** + * + * + *
        +   * Optional. The details for the principal access boundary policy.
        +   * 
        + * + * + * .google.iam.v3.PrincipalAccessBoundaryPolicyDetails details = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The details. + */ + com.google.iam.v3.PrincipalAccessBoundaryPolicyDetails getDetails(); + + /** + * + * + *
        +   * Optional. The details for the principal access boundary policy.
        +   * 
        + * + * + * .google.iam.v3.PrincipalAccessBoundaryPolicyDetails details = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.iam.v3.PrincipalAccessBoundaryPolicyDetailsOrBuilder getDetailsOrBuilder(); +} diff --git a/java-iam/proto-google-iam-v3/src/main/java/com/google/iam/v3/PrincipalAccessBoundaryPolicyResourcesProto.java b/java-iam/proto-google-iam-v3/src/main/java/com/google/iam/v3/PrincipalAccessBoundaryPolicyResourcesProto.java new file mode 100644 index 0000000000..df8f2b7723 --- /dev/null +++ b/java-iam/proto-google-iam-v3/src/main/java/com/google/iam/v3/PrincipalAccessBoundaryPolicyResourcesProto.java @@ -0,0 +1,171 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/iam/v3/principal_access_boundary_policy_resources.proto +// Protobuf Java Version: 4.33.2 + +package com.google.iam.v3; + +@com.google.protobuf.Generated +public final class PrincipalAccessBoundaryPolicyResourcesProto + extends com.google.protobuf.GeneratedFile { + private PrincipalAccessBoundaryPolicyResourcesProto() {} + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "PrincipalAccessBoundaryPolicyResourcesProto"); + } + + 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_iam_v3_PrincipalAccessBoundaryPolicy_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_iam_v3_PrincipalAccessBoundaryPolicy_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_iam_v3_PrincipalAccessBoundaryPolicy_AnnotationsEntry_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_iam_v3_PrincipalAccessBoundaryPolicy_AnnotationsEntry_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_iam_v3_PrincipalAccessBoundaryPolicyDetails_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_iam_v3_PrincipalAccessBoundaryPolicyDetails_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_iam_v3_PrincipalAccessBoundaryPolicyRule_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_iam_v3_PrincipalAccessBoundaryPolicyRule_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/iam/v3/principal_access_boundary_policy_resources.proto\022\r" + + "google.iam.v3\032\037google/api/field_behavior.proto\032\033google" + + "/api/field_info.proto\032\031google/api/resour" + + "ce.proto\032\037google/protobuf/timestamp.proto\"\255\005\n" + + "\035PrincipalAccessBoundaryPolicy\022\021\n" + + "\004name\030\001 \001(\tB\003\340A\010\022\030\n" + + "\003uid\030\002 \001(\tB\013\340A\003\342\214\317\327\010\002\010\001\022\021\n" + + "\004etag\030\003 \001(\tB\003\340A\001\022\031\n" + + "\014display_name\030\004 \001(\tB\003\340A\001\022W\n" + + "\013annotations\030\005 \003(\0132=.google.iam" + + ".v3.PrincipalAccessBoundaryPolicy.AnnotationsEntryB\003\340A\001\0224\n" + + "\013create_time\030\006 \001(\0132\032.google.protobuf.TimestampB\003\340A\003\0224\n" + + "\013update_time\030\007 \001(\0132\032.google.protobuf.TimestampB\003\340A\003\022I\n" + + "\007details\030\010 \001(\01323.google.iam.v3.Pri" + + "ncipalAccessBoundaryPolicyDetailsB\003\340A\001\0322\n" + + "\020AnnotationsEntry\022\013\n" + + "\003key\030\001 \001(\t\022\r\n" + + "\005value\030\002 \001(\t:\0028\001:\354\001\352A\350\001\n" + + "0iam.googleapis.com/PrincipalAccessBoundaryPolicy\022torganizatio" + + "ns/{organization}/locations/{location}/principalAccessBoundaryPolicies/{principa" + + "l_access_boundary_policy}*\037principalAcce" + + "ssBoundaryPolicies2\035principalAccessBoundaryPolicy\"\216\001\n" + + "$PrincipalAccessBoundaryPolicyDetails\022D\n" + + "\005rules\030\001 \003(\01320.google.iam.v" + + "3.PrincipalAccessBoundaryPolicyRuleB\003\340A\002\022 \n" + + "\023enforcement_version\030\004 \001(\tB\003\340A\001\"\320\001\n" + + "!PrincipalAccessBoundaryPolicyRule\022\030\n" + + "\013description\030\001 \001(\tB\003\340A\001\022\026\n" + + "\tresources\030\002 \003(\tB\003\340A\002\022L\n" + + "\006effect\030\003 \001(\01627.google.iam.v3.Princ" + + "ipalAccessBoundaryPolicyRule.EffectB\003\340A\002\"+\n" + + "\006Effect\022\026\n" + + "\022EFFECT_UNSPECIFIED\020\000\022\t\n" + + "\005ALLOW\020\001B\231\001\n" + + "\021com.google.iam.v3B+PrincipalAccessBoundaryPolicyResourcesProtoP\001Z)clou" + + "d.google.com/go/iam/apiv3/iampb;iampb\252\002\023" + + "Google.Cloud.Iam.V3\312\002\023Google\\Cloud\\Iam\\V3b\006proto3" + }; + descriptor = + com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( + descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + com.google.api.FieldBehaviorProto.getDescriptor(), + com.google.api.FieldInfoProto.getDescriptor(), + com.google.api.ResourceProto.getDescriptor(), + com.google.protobuf.TimestampProto.getDescriptor(), + }); + internal_static_google_iam_v3_PrincipalAccessBoundaryPolicy_descriptor = + getDescriptor().getMessageType(0); + internal_static_google_iam_v3_PrincipalAccessBoundaryPolicy_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_iam_v3_PrincipalAccessBoundaryPolicy_descriptor, + new java.lang.String[] { + "Name", + "Uid", + "Etag", + "DisplayName", + "Annotations", + "CreateTime", + "UpdateTime", + "Details", + }); + internal_static_google_iam_v3_PrincipalAccessBoundaryPolicy_AnnotationsEntry_descriptor = + internal_static_google_iam_v3_PrincipalAccessBoundaryPolicy_descriptor.getNestedType(0); + internal_static_google_iam_v3_PrincipalAccessBoundaryPolicy_AnnotationsEntry_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_iam_v3_PrincipalAccessBoundaryPolicy_AnnotationsEntry_descriptor, + new java.lang.String[] { + "Key", "Value", + }); + internal_static_google_iam_v3_PrincipalAccessBoundaryPolicyDetails_descriptor = + getDescriptor().getMessageType(1); + internal_static_google_iam_v3_PrincipalAccessBoundaryPolicyDetails_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_iam_v3_PrincipalAccessBoundaryPolicyDetails_descriptor, + new java.lang.String[] { + "Rules", "EnforcementVersion", + }); + internal_static_google_iam_v3_PrincipalAccessBoundaryPolicyRule_descriptor = + getDescriptor().getMessageType(2); + internal_static_google_iam_v3_PrincipalAccessBoundaryPolicyRule_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_iam_v3_PrincipalAccessBoundaryPolicyRule_descriptor, + new java.lang.String[] { + "Description", "Resources", "Effect", + }); + descriptor.resolveAllFeaturesImmutable(); + com.google.api.FieldBehaviorProto.getDescriptor(); + com.google.api.FieldInfoProto.getDescriptor(); + com.google.api.ResourceProto.getDescriptor(); + com.google.protobuf.TimestampProto.getDescriptor(); + com.google.protobuf.ExtensionRegistry registry = + com.google.protobuf.ExtensionRegistry.newInstance(); + registry.add(com.google.api.FieldBehaviorProto.fieldBehavior); + registry.add(com.google.api.FieldInfoProto.fieldInfo); + registry.add(com.google.api.ResourceProto.resource); + com.google.protobuf.Descriptors.FileDescriptor.internalUpdateFileDescriptor( + descriptor, registry); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/java-iam/proto-google-iam-v3/src/main/java/com/google/iam/v3/PrincipalAccessBoundaryPolicyRule.java b/java-iam/proto-google-iam-v3/src/main/java/com/google/iam/v3/PrincipalAccessBoundaryPolicyRule.java new file mode 100644 index 0000000000..412234c419 --- /dev/null +++ b/java-iam/proto-google-iam-v3/src/main/java/com/google/iam/v3/PrincipalAccessBoundaryPolicyRule.java @@ -0,0 +1,1369 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/iam/v3/principal_access_boundary_policy_resources.proto +// Protobuf Java Version: 4.33.2 + +package com.google.iam.v3; + +/** + * + * + *
        + * Principal access boundary policy rule that defines the resource boundary.
        + * 
        + * + * Protobuf type {@code google.iam.v3.PrincipalAccessBoundaryPolicyRule} + */ +@com.google.protobuf.Generated +public final class PrincipalAccessBoundaryPolicyRule extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.iam.v3.PrincipalAccessBoundaryPolicyRule) + PrincipalAccessBoundaryPolicyRuleOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "PrincipalAccessBoundaryPolicyRule"); + } + + // Use PrincipalAccessBoundaryPolicyRule.newBuilder() to construct. + private PrincipalAccessBoundaryPolicyRule( + com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private PrincipalAccessBoundaryPolicyRule() { + description_ = ""; + resources_ = com.google.protobuf.LazyStringArrayList.emptyList(); + effect_ = 0; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.iam.v3.PrincipalAccessBoundaryPolicyResourcesProto + .internal_static_google_iam_v3_PrincipalAccessBoundaryPolicyRule_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.iam.v3.PrincipalAccessBoundaryPolicyResourcesProto + .internal_static_google_iam_v3_PrincipalAccessBoundaryPolicyRule_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.iam.v3.PrincipalAccessBoundaryPolicyRule.class, + com.google.iam.v3.PrincipalAccessBoundaryPolicyRule.Builder.class); + } + + /** + * + * + *
        +   * An effect to describe the access relationship.
        +   * 
        + * + * Protobuf enum {@code google.iam.v3.PrincipalAccessBoundaryPolicyRule.Effect} + */ + public enum Effect implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
        +     * Effect unspecified.
        +     * 
        + * + * EFFECT_UNSPECIFIED = 0; + */ + EFFECT_UNSPECIFIED(0), + /** + * + * + *
        +     * Allows access to the resources in this rule.
        +     * 
        + * + * ALLOW = 1; + */ + ALLOW(1), + UNRECOGNIZED(-1), + ; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "Effect"); + } + + /** + * + * + *
        +     * Effect unspecified.
        +     * 
        + * + * EFFECT_UNSPECIFIED = 0; + */ + public static final int EFFECT_UNSPECIFIED_VALUE = 0; + + /** + * + * + *
        +     * Allows access to the resources in this rule.
        +     * 
        + * + * ALLOW = 1; + */ + public static final int ALLOW_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 Effect 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 Effect forNumber(int value) { + switch (value) { + case 0: + return EFFECT_UNSPECIFIED; + case 1: + return ALLOW; + 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 Effect findValueByNumber(int number) { + return Effect.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 com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.iam.v3.PrincipalAccessBoundaryPolicyRule.getDescriptor() + .getEnumTypes() + .get(0); + } + + private static final Effect[] VALUES = values(); + + public static Effect 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 Effect(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.iam.v3.PrincipalAccessBoundaryPolicyRule.Effect) + } + + public static final int DESCRIPTION_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object description_ = ""; + + /** + * + * + *
        +   * Optional. The description of the principal access boundary policy rule.
        +   * Must be less than or equal to 256 characters.
        +   * 
        + * + * string description = 1 [(.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. The description of the principal access boundary policy rule.
        +   * Must be less than or equal to 256 characters.
        +   * 
        + * + * string description = 1 [(.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 RESOURCES_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private com.google.protobuf.LazyStringArrayList resources_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + + /** + * + * + *
        +   * Required. A list of Resource Manager resources. If a resource is listed in
        +   * the rule, then the rule applies for that resource and its descendants. The
        +   * number of resources in a policy is limited to 500 across all rules in the
        +   * policy.
        +   *
        +   * The following resource types are supported:
        +   *
        +   * * Organizations, such as
        +   * `//cloudresourcemanager.googleapis.com/organizations/123`.
        +   * * Folders, such as `//cloudresourcemanager.googleapis.com/folders/123`.
        +   * * Projects, such as `//cloudresourcemanager.googleapis.com/projects/123`
        +   * or `//cloudresourcemanager.googleapis.com/projects/my-project-id`.
        +   * 
        + * + * repeated string resources = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return A list containing the resources. + */ + public com.google.protobuf.ProtocolStringList getResourcesList() { + return resources_; + } + + /** + * + * + *
        +   * Required. A list of Resource Manager resources. If a resource is listed in
        +   * the rule, then the rule applies for that resource and its descendants. The
        +   * number of resources in a policy is limited to 500 across all rules in the
        +   * policy.
        +   *
        +   * The following resource types are supported:
        +   *
        +   * * Organizations, such as
        +   * `//cloudresourcemanager.googleapis.com/organizations/123`.
        +   * * Folders, such as `//cloudresourcemanager.googleapis.com/folders/123`.
        +   * * Projects, such as `//cloudresourcemanager.googleapis.com/projects/123`
        +   * or `//cloudresourcemanager.googleapis.com/projects/my-project-id`.
        +   * 
        + * + * repeated string resources = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The count of resources. + */ + public int getResourcesCount() { + return resources_.size(); + } + + /** + * + * + *
        +   * Required. A list of Resource Manager resources. If a resource is listed in
        +   * the rule, then the rule applies for that resource and its descendants. The
        +   * number of resources in a policy is limited to 500 across all rules in the
        +   * policy.
        +   *
        +   * The following resource types are supported:
        +   *
        +   * * Organizations, such as
        +   * `//cloudresourcemanager.googleapis.com/organizations/123`.
        +   * * Folders, such as `//cloudresourcemanager.googleapis.com/folders/123`.
        +   * * Projects, such as `//cloudresourcemanager.googleapis.com/projects/123`
        +   * or `//cloudresourcemanager.googleapis.com/projects/my-project-id`.
        +   * 
        + * + * repeated string resources = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param index The index of the element to return. + * @return The resources at the given index. + */ + public java.lang.String getResources(int index) { + return resources_.get(index); + } + + /** + * + * + *
        +   * Required. A list of Resource Manager resources. If a resource is listed in
        +   * the rule, then the rule applies for that resource and its descendants. The
        +   * number of resources in a policy is limited to 500 across all rules in the
        +   * policy.
        +   *
        +   * The following resource types are supported:
        +   *
        +   * * Organizations, such as
        +   * `//cloudresourcemanager.googleapis.com/organizations/123`.
        +   * * Folders, such as `//cloudresourcemanager.googleapis.com/folders/123`.
        +   * * Projects, such as `//cloudresourcemanager.googleapis.com/projects/123`
        +   * or `//cloudresourcemanager.googleapis.com/projects/my-project-id`.
        +   * 
        + * + * repeated string resources = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param index The index of the value to return. + * @return The bytes of the resources at the given index. + */ + public com.google.protobuf.ByteString getResourcesBytes(int index) { + return resources_.getByteString(index); + } + + public static final int EFFECT_FIELD_NUMBER = 3; + private int effect_ = 0; + + /** + * + * + *
        +   * Required. The access relationship of principals to the resources in this
        +   * rule.
        +   * 
        + * + * + * .google.iam.v3.PrincipalAccessBoundaryPolicyRule.Effect effect = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The enum numeric value on the wire for effect. + */ + @java.lang.Override + public int getEffectValue() { + return effect_; + } + + /** + * + * + *
        +   * Required. The access relationship of principals to the resources in this
        +   * rule.
        +   * 
        + * + * + * .google.iam.v3.PrincipalAccessBoundaryPolicyRule.Effect effect = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The effect. + */ + @java.lang.Override + public com.google.iam.v3.PrincipalAccessBoundaryPolicyRule.Effect getEffect() { + com.google.iam.v3.PrincipalAccessBoundaryPolicyRule.Effect result = + com.google.iam.v3.PrincipalAccessBoundaryPolicyRule.Effect.forNumber(effect_); + return result == null + ? com.google.iam.v3.PrincipalAccessBoundaryPolicyRule.Effect.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.GeneratedMessage.isStringEmpty(description_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, description_); + } + for (int i = 0; i < resources_.size(); i++) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, resources_.getRaw(i)); + } + if (effect_ + != com.google.iam.v3.PrincipalAccessBoundaryPolicyRule.Effect.EFFECT_UNSPECIFIED + .getNumber()) { + output.writeEnum(3, effect_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(description_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, description_); + } + { + int dataSize = 0; + for (int i = 0; i < resources_.size(); i++) { + dataSize += computeStringSizeNoTag(resources_.getRaw(i)); + } + size += dataSize; + size += 1 * getResourcesList().size(); + } + if (effect_ + != com.google.iam.v3.PrincipalAccessBoundaryPolicyRule.Effect.EFFECT_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(3, effect_); + } + 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.iam.v3.PrincipalAccessBoundaryPolicyRule)) { + return super.equals(obj); + } + com.google.iam.v3.PrincipalAccessBoundaryPolicyRule other = + (com.google.iam.v3.PrincipalAccessBoundaryPolicyRule) obj; + + if (!getDescription().equals(other.getDescription())) return false; + if (!getResourcesList().equals(other.getResourcesList())) return false; + if (effect_ != other.effect_) 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) + DESCRIPTION_FIELD_NUMBER; + hash = (53 * hash) + getDescription().hashCode(); + if (getResourcesCount() > 0) { + hash = (37 * hash) + RESOURCES_FIELD_NUMBER; + hash = (53 * hash) + getResourcesList().hashCode(); + } + hash = (37 * hash) + EFFECT_FIELD_NUMBER; + hash = (53 * hash) + effect_; + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.iam.v3.PrincipalAccessBoundaryPolicyRule parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.iam.v3.PrincipalAccessBoundaryPolicyRule parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.iam.v3.PrincipalAccessBoundaryPolicyRule parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.iam.v3.PrincipalAccessBoundaryPolicyRule 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.iam.v3.PrincipalAccessBoundaryPolicyRule parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.iam.v3.PrincipalAccessBoundaryPolicyRule parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.iam.v3.PrincipalAccessBoundaryPolicyRule parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.iam.v3.PrincipalAccessBoundaryPolicyRule parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.iam.v3.PrincipalAccessBoundaryPolicyRule parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.iam.v3.PrincipalAccessBoundaryPolicyRule parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.iam.v3.PrincipalAccessBoundaryPolicyRule parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.iam.v3.PrincipalAccessBoundaryPolicyRule parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.iam.v3.PrincipalAccessBoundaryPolicyRule 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
        +   * Principal access boundary policy rule that defines the resource boundary.
        +   * 
        + * + * Protobuf type {@code google.iam.v3.PrincipalAccessBoundaryPolicyRule} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.iam.v3.PrincipalAccessBoundaryPolicyRule) + com.google.iam.v3.PrincipalAccessBoundaryPolicyRuleOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.iam.v3.PrincipalAccessBoundaryPolicyResourcesProto + .internal_static_google_iam_v3_PrincipalAccessBoundaryPolicyRule_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.iam.v3.PrincipalAccessBoundaryPolicyResourcesProto + .internal_static_google_iam_v3_PrincipalAccessBoundaryPolicyRule_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.iam.v3.PrincipalAccessBoundaryPolicyRule.class, + com.google.iam.v3.PrincipalAccessBoundaryPolicyRule.Builder.class); + } + + // Construct using com.google.iam.v3.PrincipalAccessBoundaryPolicyRule.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + description_ = ""; + resources_ = com.google.protobuf.LazyStringArrayList.emptyList(); + effect_ = 0; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.iam.v3.PrincipalAccessBoundaryPolicyResourcesProto + .internal_static_google_iam_v3_PrincipalAccessBoundaryPolicyRule_descriptor; + } + + @java.lang.Override + public com.google.iam.v3.PrincipalAccessBoundaryPolicyRule getDefaultInstanceForType() { + return com.google.iam.v3.PrincipalAccessBoundaryPolicyRule.getDefaultInstance(); + } + + @java.lang.Override + public com.google.iam.v3.PrincipalAccessBoundaryPolicyRule build() { + com.google.iam.v3.PrincipalAccessBoundaryPolicyRule result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.iam.v3.PrincipalAccessBoundaryPolicyRule buildPartial() { + com.google.iam.v3.PrincipalAccessBoundaryPolicyRule result = + new com.google.iam.v3.PrincipalAccessBoundaryPolicyRule(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.iam.v3.PrincipalAccessBoundaryPolicyRule result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.description_ = description_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + resources_.makeImmutable(); + result.resources_ = resources_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.effect_ = effect_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.iam.v3.PrincipalAccessBoundaryPolicyRule) { + return mergeFrom((com.google.iam.v3.PrincipalAccessBoundaryPolicyRule) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.iam.v3.PrincipalAccessBoundaryPolicyRule other) { + if (other == com.google.iam.v3.PrincipalAccessBoundaryPolicyRule.getDefaultInstance()) + return this; + if (!other.getDescription().isEmpty()) { + description_ = other.description_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.resources_.isEmpty()) { + if (resources_.isEmpty()) { + resources_ = other.resources_; + bitField0_ |= 0x00000002; + } else { + ensureResourcesIsMutable(); + resources_.addAll(other.resources_); + } + onChanged(); + } + if (other.effect_ != 0) { + setEffectValue(other.getEffectValue()); + } + 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: + { + description_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + ensureResourcesIsMutable(); + resources_.add(s); + break; + } // case 18 + case 24: + { + effect_ = input.readEnum(); + 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 description_ = ""; + + /** + * + * + *
        +     * Optional. The description of the principal access boundary policy rule.
        +     * Must be less than or equal to 256 characters.
        +     * 
        + * + * string description = 1 [(.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. The description of the principal access boundary policy rule.
        +     * Must be less than or equal to 256 characters.
        +     * 
        + * + * string description = 1 [(.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. The description of the principal access boundary policy rule.
        +     * Must be less than or equal to 256 characters.
        +     * 
        + * + * string description = 1 [(.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_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
        +     * Optional. The description of the principal access boundary policy rule.
        +     * Must be less than or equal to 256 characters.
        +     * 
        + * + * string description = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearDescription() { + description_ = getDefaultInstance().getDescription(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
        +     * Optional. The description of the principal access boundary policy rule.
        +     * Must be less than or equal to 256 characters.
        +     * 
        + * + * string description = 1 [(.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_ |= 0x00000001; + onChanged(); + return this; + } + + private com.google.protobuf.LazyStringArrayList resources_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + + private void ensureResourcesIsMutable() { + if (!resources_.isModifiable()) { + resources_ = new com.google.protobuf.LazyStringArrayList(resources_); + } + bitField0_ |= 0x00000002; + } + + /** + * + * + *
        +     * Required. A list of Resource Manager resources. If a resource is listed in
        +     * the rule, then the rule applies for that resource and its descendants. The
        +     * number of resources in a policy is limited to 500 across all rules in the
        +     * policy.
        +     *
        +     * The following resource types are supported:
        +     *
        +     * * Organizations, such as
        +     * `//cloudresourcemanager.googleapis.com/organizations/123`.
        +     * * Folders, such as `//cloudresourcemanager.googleapis.com/folders/123`.
        +     * * Projects, such as `//cloudresourcemanager.googleapis.com/projects/123`
        +     * or `//cloudresourcemanager.googleapis.com/projects/my-project-id`.
        +     * 
        + * + * repeated string resources = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return A list containing the resources. + */ + public com.google.protobuf.ProtocolStringList getResourcesList() { + resources_.makeImmutable(); + return resources_; + } + + /** + * + * + *
        +     * Required. A list of Resource Manager resources. If a resource is listed in
        +     * the rule, then the rule applies for that resource and its descendants. The
        +     * number of resources in a policy is limited to 500 across all rules in the
        +     * policy.
        +     *
        +     * The following resource types are supported:
        +     *
        +     * * Organizations, such as
        +     * `//cloudresourcemanager.googleapis.com/organizations/123`.
        +     * * Folders, such as `//cloudresourcemanager.googleapis.com/folders/123`.
        +     * * Projects, such as `//cloudresourcemanager.googleapis.com/projects/123`
        +     * or `//cloudresourcemanager.googleapis.com/projects/my-project-id`.
        +     * 
        + * + * repeated string resources = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The count of resources. + */ + public int getResourcesCount() { + return resources_.size(); + } + + /** + * + * + *
        +     * Required. A list of Resource Manager resources. If a resource is listed in
        +     * the rule, then the rule applies for that resource and its descendants. The
        +     * number of resources in a policy is limited to 500 across all rules in the
        +     * policy.
        +     *
        +     * The following resource types are supported:
        +     *
        +     * * Organizations, such as
        +     * `//cloudresourcemanager.googleapis.com/organizations/123`.
        +     * * Folders, such as `//cloudresourcemanager.googleapis.com/folders/123`.
        +     * * Projects, such as `//cloudresourcemanager.googleapis.com/projects/123`
        +     * or `//cloudresourcemanager.googleapis.com/projects/my-project-id`.
        +     * 
        + * + * repeated string resources = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param index The index of the element to return. + * @return The resources at the given index. + */ + public java.lang.String getResources(int index) { + return resources_.get(index); + } + + /** + * + * + *
        +     * Required. A list of Resource Manager resources. If a resource is listed in
        +     * the rule, then the rule applies for that resource and its descendants. The
        +     * number of resources in a policy is limited to 500 across all rules in the
        +     * policy.
        +     *
        +     * The following resource types are supported:
        +     *
        +     * * Organizations, such as
        +     * `//cloudresourcemanager.googleapis.com/organizations/123`.
        +     * * Folders, such as `//cloudresourcemanager.googleapis.com/folders/123`.
        +     * * Projects, such as `//cloudresourcemanager.googleapis.com/projects/123`
        +     * or `//cloudresourcemanager.googleapis.com/projects/my-project-id`.
        +     * 
        + * + * repeated string resources = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param index The index of the value to return. + * @return The bytes of the resources at the given index. + */ + public com.google.protobuf.ByteString getResourcesBytes(int index) { + return resources_.getByteString(index); + } + + /** + * + * + *
        +     * Required. A list of Resource Manager resources. If a resource is listed in
        +     * the rule, then the rule applies for that resource and its descendants. The
        +     * number of resources in a policy is limited to 500 across all rules in the
        +     * policy.
        +     *
        +     * The following resource types are supported:
        +     *
        +     * * Organizations, such as
        +     * `//cloudresourcemanager.googleapis.com/organizations/123`.
        +     * * Folders, such as `//cloudresourcemanager.googleapis.com/folders/123`.
        +     * * Projects, such as `//cloudresourcemanager.googleapis.com/projects/123`
        +     * or `//cloudresourcemanager.googleapis.com/projects/my-project-id`.
        +     * 
        + * + * repeated string resources = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param index The index to set the value at. + * @param value The resources to set. + * @return This builder for chaining. + */ + public Builder setResources(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureResourcesIsMutable(); + resources_.set(index, value); + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
        +     * Required. A list of Resource Manager resources. If a resource is listed in
        +     * the rule, then the rule applies for that resource and its descendants. The
        +     * number of resources in a policy is limited to 500 across all rules in the
        +     * policy.
        +     *
        +     * The following resource types are supported:
        +     *
        +     * * Organizations, such as
        +     * `//cloudresourcemanager.googleapis.com/organizations/123`.
        +     * * Folders, such as `//cloudresourcemanager.googleapis.com/folders/123`.
        +     * * Projects, such as `//cloudresourcemanager.googleapis.com/projects/123`
        +     * or `//cloudresourcemanager.googleapis.com/projects/my-project-id`.
        +     * 
        + * + * repeated string resources = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The resources to add. + * @return This builder for chaining. + */ + public Builder addResources(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureResourcesIsMutable(); + resources_.add(value); + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
        +     * Required. A list of Resource Manager resources. If a resource is listed in
        +     * the rule, then the rule applies for that resource and its descendants. The
        +     * number of resources in a policy is limited to 500 across all rules in the
        +     * policy.
        +     *
        +     * The following resource types are supported:
        +     *
        +     * * Organizations, such as
        +     * `//cloudresourcemanager.googleapis.com/organizations/123`.
        +     * * Folders, such as `//cloudresourcemanager.googleapis.com/folders/123`.
        +     * * Projects, such as `//cloudresourcemanager.googleapis.com/projects/123`
        +     * or `//cloudresourcemanager.googleapis.com/projects/my-project-id`.
        +     * 
        + * + * repeated string resources = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param values The resources to add. + * @return This builder for chaining. + */ + public Builder addAllResources(java.lang.Iterable values) { + ensureResourcesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, resources_); + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
        +     * Required. A list of Resource Manager resources. If a resource is listed in
        +     * the rule, then the rule applies for that resource and its descendants. The
        +     * number of resources in a policy is limited to 500 across all rules in the
        +     * policy.
        +     *
        +     * The following resource types are supported:
        +     *
        +     * * Organizations, such as
        +     * `//cloudresourcemanager.googleapis.com/organizations/123`.
        +     * * Folders, such as `//cloudresourcemanager.googleapis.com/folders/123`.
        +     * * Projects, such as `//cloudresourcemanager.googleapis.com/projects/123`
        +     * or `//cloudresourcemanager.googleapis.com/projects/my-project-id`.
        +     * 
        + * + * repeated string resources = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearResources() { + resources_ = com.google.protobuf.LazyStringArrayList.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + ; + onChanged(); + return this; + } + + /** + * + * + *
        +     * Required. A list of Resource Manager resources. If a resource is listed in
        +     * the rule, then the rule applies for that resource and its descendants. The
        +     * number of resources in a policy is limited to 500 across all rules in the
        +     * policy.
        +     *
        +     * The following resource types are supported:
        +     *
        +     * * Organizations, such as
        +     * `//cloudresourcemanager.googleapis.com/organizations/123`.
        +     * * Folders, such as `//cloudresourcemanager.googleapis.com/folders/123`.
        +     * * Projects, such as `//cloudresourcemanager.googleapis.com/projects/123`
        +     * or `//cloudresourcemanager.googleapis.com/projects/my-project-id`.
        +     * 
        + * + * repeated string resources = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes of the resources to add. + * @return This builder for chaining. + */ + public Builder addResourcesBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureResourcesIsMutable(); + resources_.add(value); + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private int effect_ = 0; + + /** + * + * + *
        +     * Required. The access relationship of principals to the resources in this
        +     * rule.
        +     * 
        + * + * + * .google.iam.v3.PrincipalAccessBoundaryPolicyRule.Effect effect = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The enum numeric value on the wire for effect. + */ + @java.lang.Override + public int getEffectValue() { + return effect_; + } + + /** + * + * + *
        +     * Required. The access relationship of principals to the resources in this
        +     * rule.
        +     * 
        + * + * + * .google.iam.v3.PrincipalAccessBoundaryPolicyRule.Effect effect = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @param value The enum numeric value on the wire for effect to set. + * @return This builder for chaining. + */ + public Builder setEffectValue(int value) { + effect_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
        +     * Required. The access relationship of principals to the resources in this
        +     * rule.
        +     * 
        + * + * + * .google.iam.v3.PrincipalAccessBoundaryPolicyRule.Effect effect = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The effect. + */ + @java.lang.Override + public com.google.iam.v3.PrincipalAccessBoundaryPolicyRule.Effect getEffect() { + com.google.iam.v3.PrincipalAccessBoundaryPolicyRule.Effect result = + com.google.iam.v3.PrincipalAccessBoundaryPolicyRule.Effect.forNumber(effect_); + return result == null + ? com.google.iam.v3.PrincipalAccessBoundaryPolicyRule.Effect.UNRECOGNIZED + : result; + } + + /** + * + * + *
        +     * Required. The access relationship of principals to the resources in this
        +     * rule.
        +     * 
        + * + * + * .google.iam.v3.PrincipalAccessBoundaryPolicyRule.Effect effect = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @param value The effect to set. + * @return This builder for chaining. + */ + public Builder setEffect(com.google.iam.v3.PrincipalAccessBoundaryPolicyRule.Effect value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000004; + effect_ = value.getNumber(); + onChanged(); + return this; + } + + /** + * + * + *
        +     * Required. The access relationship of principals to the resources in this
        +     * rule.
        +     * 
        + * + * + * .google.iam.v3.PrincipalAccessBoundaryPolicyRule.Effect effect = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return This builder for chaining. + */ + public Builder clearEffect() { + bitField0_ = (bitField0_ & ~0x00000004); + effect_ = 0; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.iam.v3.PrincipalAccessBoundaryPolicyRule) + } + + // @@protoc_insertion_point(class_scope:google.iam.v3.PrincipalAccessBoundaryPolicyRule) + private static final com.google.iam.v3.PrincipalAccessBoundaryPolicyRule DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.iam.v3.PrincipalAccessBoundaryPolicyRule(); + } + + public static com.google.iam.v3.PrincipalAccessBoundaryPolicyRule getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public PrincipalAccessBoundaryPolicyRule 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.iam.v3.PrincipalAccessBoundaryPolicyRule getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-iam/proto-google-iam-v3/src/main/java/com/google/iam/v3/PrincipalAccessBoundaryPolicyRuleOrBuilder.java b/java-iam/proto-google-iam-v3/src/main/java/com/google/iam/v3/PrincipalAccessBoundaryPolicyRuleOrBuilder.java new file mode 100644 index 0000000000..f58082e0df --- /dev/null +++ b/java-iam/proto-google-iam-v3/src/main/java/com/google/iam/v3/PrincipalAccessBoundaryPolicyRuleOrBuilder.java @@ -0,0 +1,186 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/iam/v3/principal_access_boundary_policy_resources.proto +// Protobuf Java Version: 4.33.2 + +package com.google.iam.v3; + +@com.google.protobuf.Generated +public interface PrincipalAccessBoundaryPolicyRuleOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.iam.v3.PrincipalAccessBoundaryPolicyRule) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
        +   * Optional. The description of the principal access boundary policy rule.
        +   * Must be less than or equal to 256 characters.
        +   * 
        + * + * string description = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The description. + */ + java.lang.String getDescription(); + + /** + * + * + *
        +   * Optional. The description of the principal access boundary policy rule.
        +   * Must be less than or equal to 256 characters.
        +   * 
        + * + * string description = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for description. + */ + com.google.protobuf.ByteString getDescriptionBytes(); + + /** + * + * + *
        +   * Required. A list of Resource Manager resources. If a resource is listed in
        +   * the rule, then the rule applies for that resource and its descendants. The
        +   * number of resources in a policy is limited to 500 across all rules in the
        +   * policy.
        +   *
        +   * The following resource types are supported:
        +   *
        +   * * Organizations, such as
        +   * `//cloudresourcemanager.googleapis.com/organizations/123`.
        +   * * Folders, such as `//cloudresourcemanager.googleapis.com/folders/123`.
        +   * * Projects, such as `//cloudresourcemanager.googleapis.com/projects/123`
        +   * or `//cloudresourcemanager.googleapis.com/projects/my-project-id`.
        +   * 
        + * + * repeated string resources = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return A list containing the resources. + */ + java.util.List getResourcesList(); + + /** + * + * + *
        +   * Required. A list of Resource Manager resources. If a resource is listed in
        +   * the rule, then the rule applies for that resource and its descendants. The
        +   * number of resources in a policy is limited to 500 across all rules in the
        +   * policy.
        +   *
        +   * The following resource types are supported:
        +   *
        +   * * Organizations, such as
        +   * `//cloudresourcemanager.googleapis.com/organizations/123`.
        +   * * Folders, such as `//cloudresourcemanager.googleapis.com/folders/123`.
        +   * * Projects, such as `//cloudresourcemanager.googleapis.com/projects/123`
        +   * or `//cloudresourcemanager.googleapis.com/projects/my-project-id`.
        +   * 
        + * + * repeated string resources = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The count of resources. + */ + int getResourcesCount(); + + /** + * + * + *
        +   * Required. A list of Resource Manager resources. If a resource is listed in
        +   * the rule, then the rule applies for that resource and its descendants. The
        +   * number of resources in a policy is limited to 500 across all rules in the
        +   * policy.
        +   *
        +   * The following resource types are supported:
        +   *
        +   * * Organizations, such as
        +   * `//cloudresourcemanager.googleapis.com/organizations/123`.
        +   * * Folders, such as `//cloudresourcemanager.googleapis.com/folders/123`.
        +   * * Projects, such as `//cloudresourcemanager.googleapis.com/projects/123`
        +   * or `//cloudresourcemanager.googleapis.com/projects/my-project-id`.
        +   * 
        + * + * repeated string resources = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param index The index of the element to return. + * @return The resources at the given index. + */ + java.lang.String getResources(int index); + + /** + * + * + *
        +   * Required. A list of Resource Manager resources. If a resource is listed in
        +   * the rule, then the rule applies for that resource and its descendants. The
        +   * number of resources in a policy is limited to 500 across all rules in the
        +   * policy.
        +   *
        +   * The following resource types are supported:
        +   *
        +   * * Organizations, such as
        +   * `//cloudresourcemanager.googleapis.com/organizations/123`.
        +   * * Folders, such as `//cloudresourcemanager.googleapis.com/folders/123`.
        +   * * Projects, such as `//cloudresourcemanager.googleapis.com/projects/123`
        +   * or `//cloudresourcemanager.googleapis.com/projects/my-project-id`.
        +   * 
        + * + * repeated string resources = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param index The index of the value to return. + * @return The bytes of the resources at the given index. + */ + com.google.protobuf.ByteString getResourcesBytes(int index); + + /** + * + * + *
        +   * Required. The access relationship of principals to the resources in this
        +   * rule.
        +   * 
        + * + * + * .google.iam.v3.PrincipalAccessBoundaryPolicyRule.Effect effect = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The enum numeric value on the wire for effect. + */ + int getEffectValue(); + + /** + * + * + *
        +   * Required. The access relationship of principals to the resources in this
        +   * rule.
        +   * 
        + * + * + * .google.iam.v3.PrincipalAccessBoundaryPolicyRule.Effect effect = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The effect. + */ + com.google.iam.v3.PrincipalAccessBoundaryPolicyRule.Effect getEffect(); +} diff --git a/java-iam/proto-google-iam-v3/src/main/java/com/google/iam/v3/SearchPrincipalAccessBoundaryPolicyBindingsRequest.java b/java-iam/proto-google-iam-v3/src/main/java/com/google/iam/v3/SearchPrincipalAccessBoundaryPolicyBindingsRequest.java new file mode 100644 index 0000000000..680e643f76 --- /dev/null +++ b/java-iam/proto-google-iam-v3/src/main/java/com/google/iam/v3/SearchPrincipalAccessBoundaryPolicyBindingsRequest.java @@ -0,0 +1,988 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/iam/v3/principal_access_boundary_policies_service.proto +// Protobuf Java Version: 4.33.2 + +package com.google.iam.v3; + +/** + * + * + *
        + * Request message for SearchPrincipalAccessBoundaryPolicyBindings rpc.
        + * 
        + * + * Protobuf type {@code google.iam.v3.SearchPrincipalAccessBoundaryPolicyBindingsRequest} + */ +@com.google.protobuf.Generated +public final class SearchPrincipalAccessBoundaryPolicyBindingsRequest + extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.iam.v3.SearchPrincipalAccessBoundaryPolicyBindingsRequest) + SearchPrincipalAccessBoundaryPolicyBindingsRequestOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "SearchPrincipalAccessBoundaryPolicyBindingsRequest"); + } + + // Use SearchPrincipalAccessBoundaryPolicyBindingsRequest.newBuilder() to construct. + private SearchPrincipalAccessBoundaryPolicyBindingsRequest( + com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private SearchPrincipalAccessBoundaryPolicyBindingsRequest() { + name_ = ""; + pageToken_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.iam.v3.PrincipalAccessBoundaryPoliciesServiceProto + .internal_static_google_iam_v3_SearchPrincipalAccessBoundaryPolicyBindingsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.iam.v3.PrincipalAccessBoundaryPoliciesServiceProto + .internal_static_google_iam_v3_SearchPrincipalAccessBoundaryPolicyBindingsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.iam.v3.SearchPrincipalAccessBoundaryPolicyBindingsRequest.class, + com.google.iam.v3.SearchPrincipalAccessBoundaryPolicyBindingsRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + + /** + * + * + *
        +   * Required. The name of the principal access boundary policy.
        +   * Format:
        +   * `organizations/{organization_id}/locations/{location}/principalAccessBoundaryPolicies/{principal_access_boundary_policy_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 name of the principal access boundary policy.
        +   * Format:
        +   * `organizations/{organization_id}/locations/{location}/principalAccessBoundaryPolicies/{principal_access_boundary_policy_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; + } + } + + public static final int PAGE_SIZE_FIELD_NUMBER = 3; + private int pageSize_ = 0; + + /** + * + * + *
        +   * Optional. The maximum number of policy bindings to return. The service may
        +   * return fewer than this value.
        +   *
        +   * If unspecified, at most 50 policy bindings will be returned.
        +   * The maximum value is 1000; values above 1000 will be coerced to 1000.
        +   * 
        + * + * int32 page_size = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + + public static final int PAGE_TOKEN_FIELD_NUMBER = 4; + + @SuppressWarnings("serial") + private volatile java.lang.Object pageToken_ = ""; + + /** + * + * + *
        +   * Optional. A page token, received from a previous
        +   * `SearchPrincipalAccessBoundaryPolicyBindingsRequest` call. Provide this to
        +   * retrieve the subsequent page.
        +   *
        +   * When paginating, all other parameters provided to
        +   * `SearchPrincipalAccessBoundaryPolicyBindingsRequest` must match the call
        +   * that provided the page token.
        +   * 
        + * + * string page_token = 4 [(.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. A page token, received from a previous
        +   * `SearchPrincipalAccessBoundaryPolicyBindingsRequest` call. Provide this to
        +   * retrieve the subsequent page.
        +   *
        +   * When paginating, all other parameters provided to
        +   * `SearchPrincipalAccessBoundaryPolicyBindingsRequest` must match the call
        +   * that provided the page token.
        +   * 
        + * + * string page_token = 4 [(.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.GeneratedMessage.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, name_); + } + if (pageSize_ != 0) { + output.writeInt32(3, pageSize_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(pageToken_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 4, pageToken_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, name_); + } + if (pageSize_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(3, pageSize_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(pageToken_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(4, 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.iam.v3.SearchPrincipalAccessBoundaryPolicyBindingsRequest)) { + return super.equals(obj); + } + com.google.iam.v3.SearchPrincipalAccessBoundaryPolicyBindingsRequest other = + (com.google.iam.v3.SearchPrincipalAccessBoundaryPolicyBindingsRequest) obj; + + if (!getName().equals(other.getName())) 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) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().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.iam.v3.SearchPrincipalAccessBoundaryPolicyBindingsRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.iam.v3.SearchPrincipalAccessBoundaryPolicyBindingsRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.iam.v3.SearchPrincipalAccessBoundaryPolicyBindingsRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.iam.v3.SearchPrincipalAccessBoundaryPolicyBindingsRequest 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.iam.v3.SearchPrincipalAccessBoundaryPolicyBindingsRequest parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.iam.v3.SearchPrincipalAccessBoundaryPolicyBindingsRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.iam.v3.SearchPrincipalAccessBoundaryPolicyBindingsRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.iam.v3.SearchPrincipalAccessBoundaryPolicyBindingsRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.iam.v3.SearchPrincipalAccessBoundaryPolicyBindingsRequest + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.iam.v3.SearchPrincipalAccessBoundaryPolicyBindingsRequest + parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.iam.v3.SearchPrincipalAccessBoundaryPolicyBindingsRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.iam.v3.SearchPrincipalAccessBoundaryPolicyBindingsRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.iam.v3.SearchPrincipalAccessBoundaryPolicyBindingsRequest 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
        +   * Request message for SearchPrincipalAccessBoundaryPolicyBindings rpc.
        +   * 
        + * + * Protobuf type {@code google.iam.v3.SearchPrincipalAccessBoundaryPolicyBindingsRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.iam.v3.SearchPrincipalAccessBoundaryPolicyBindingsRequest) + com.google.iam.v3.SearchPrincipalAccessBoundaryPolicyBindingsRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.iam.v3.PrincipalAccessBoundaryPoliciesServiceProto + .internal_static_google_iam_v3_SearchPrincipalAccessBoundaryPolicyBindingsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.iam.v3.PrincipalAccessBoundaryPoliciesServiceProto + .internal_static_google_iam_v3_SearchPrincipalAccessBoundaryPolicyBindingsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.iam.v3.SearchPrincipalAccessBoundaryPolicyBindingsRequest.class, + com.google.iam.v3.SearchPrincipalAccessBoundaryPolicyBindingsRequest.Builder.class); + } + + // Construct using + // com.google.iam.v3.SearchPrincipalAccessBoundaryPolicyBindingsRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + pageSize_ = 0; + pageToken_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.iam.v3.PrincipalAccessBoundaryPoliciesServiceProto + .internal_static_google_iam_v3_SearchPrincipalAccessBoundaryPolicyBindingsRequest_descriptor; + } + + @java.lang.Override + public com.google.iam.v3.SearchPrincipalAccessBoundaryPolicyBindingsRequest + getDefaultInstanceForType() { + return com.google.iam.v3.SearchPrincipalAccessBoundaryPolicyBindingsRequest + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.iam.v3.SearchPrincipalAccessBoundaryPolicyBindingsRequest build() { + com.google.iam.v3.SearchPrincipalAccessBoundaryPolicyBindingsRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.iam.v3.SearchPrincipalAccessBoundaryPolicyBindingsRequest buildPartial() { + com.google.iam.v3.SearchPrincipalAccessBoundaryPolicyBindingsRequest result = + new com.google.iam.v3.SearchPrincipalAccessBoundaryPolicyBindingsRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.iam.v3.SearchPrincipalAccessBoundaryPolicyBindingsRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.pageSize_ = pageSize_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.pageToken_ = pageToken_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.iam.v3.SearchPrincipalAccessBoundaryPolicyBindingsRequest) { + return mergeFrom( + (com.google.iam.v3.SearchPrincipalAccessBoundaryPolicyBindingsRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.iam.v3.SearchPrincipalAccessBoundaryPolicyBindingsRequest other) { + if (other + == com.google.iam.v3.SearchPrincipalAccessBoundaryPolicyBindingsRequest + .getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.getPageSize() != 0) { + setPageSize(other.getPageSize()); + } + if (!other.getPageToken().isEmpty()) { + pageToken_ = other.pageToken_; + 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 24: + { + pageSize_ = input.readInt32(); + bitField0_ |= 0x00000002; + break; + } // case 24 + case 34: + { + pageToken_ = 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. The name of the principal access boundary policy.
        +     * Format:
        +     * `organizations/{organization_id}/locations/{location}/principalAccessBoundaryPolicies/{principal_access_boundary_policy_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 name of the principal access boundary policy.
        +     * Format:
        +     * `organizations/{organization_id}/locations/{location}/principalAccessBoundaryPolicies/{principal_access_boundary_policy_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 name of the principal access boundary policy.
        +     * Format:
        +     * `organizations/{organization_id}/locations/{location}/principalAccessBoundaryPolicies/{principal_access_boundary_policy_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 name of the principal access boundary policy.
        +     * Format:
        +     * `organizations/{organization_id}/locations/{location}/principalAccessBoundaryPolicies/{principal_access_boundary_policy_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 name of the principal access boundary policy.
        +     * Format:
        +     * `organizations/{organization_id}/locations/{location}/principalAccessBoundaryPolicies/{principal_access_boundary_policy_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; + } + + private int pageSize_; + + /** + * + * + *
        +     * Optional. The maximum number of policy bindings to return. The service may
        +     * return fewer than this value.
        +     *
        +     * If unspecified, at most 50 policy bindings will be returned.
        +     * The maximum value is 1000; values above 1000 will be coerced to 1000.
        +     * 
        + * + * 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 policy bindings to return. The service may
        +     * return fewer than this value.
        +     *
        +     * If unspecified, at most 50 policy bindings will be returned.
        +     * The maximum value is 1000; values above 1000 will be coerced to 1000.
        +     * 
        + * + * 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_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
        +     * Optional. The maximum number of policy bindings to return. The service may
        +     * return fewer than this value.
        +     *
        +     * If unspecified, at most 50 policy bindings will be returned.
        +     * The maximum value is 1000; values above 1000 will be coerced to 1000.
        +     * 
        + * + * int32 page_size = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearPageSize() { + bitField0_ = (bitField0_ & ~0x00000002); + pageSize_ = 0; + onChanged(); + return this; + } + + private java.lang.Object pageToken_ = ""; + + /** + * + * + *
        +     * Optional. A page token, received from a previous
        +     * `SearchPrincipalAccessBoundaryPolicyBindingsRequest` call. Provide this to
        +     * retrieve the subsequent page.
        +     *
        +     * When paginating, all other parameters provided to
        +     * `SearchPrincipalAccessBoundaryPolicyBindingsRequest` must match the call
        +     * that provided the page token.
        +     * 
        + * + * string page_token = 4 [(.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. A page token, received from a previous
        +     * `SearchPrincipalAccessBoundaryPolicyBindingsRequest` call. Provide this to
        +     * retrieve the subsequent page.
        +     *
        +     * When paginating, all other parameters provided to
        +     * `SearchPrincipalAccessBoundaryPolicyBindingsRequest` must match the call
        +     * that provided the page token.
        +     * 
        + * + * string page_token = 4 [(.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. A page token, received from a previous
        +     * `SearchPrincipalAccessBoundaryPolicyBindingsRequest` call. Provide this to
        +     * retrieve the subsequent page.
        +     *
        +     * When paginating, all other parameters provided to
        +     * `SearchPrincipalAccessBoundaryPolicyBindingsRequest` must match the call
        +     * that provided the page token.
        +     * 
        + * + * string page_token = 4 [(.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_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
        +     * Optional. A page token, received from a previous
        +     * `SearchPrincipalAccessBoundaryPolicyBindingsRequest` call. Provide this to
        +     * retrieve the subsequent page.
        +     *
        +     * When paginating, all other parameters provided to
        +     * `SearchPrincipalAccessBoundaryPolicyBindingsRequest` must match the call
        +     * that provided the page token.
        +     * 
        + * + * string page_token = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearPageToken() { + pageToken_ = getDefaultInstance().getPageToken(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + + /** + * + * + *
        +     * Optional. A page token, received from a previous
        +     * `SearchPrincipalAccessBoundaryPolicyBindingsRequest` call. Provide this to
        +     * retrieve the subsequent page.
        +     *
        +     * When paginating, all other parameters provided to
        +     * `SearchPrincipalAccessBoundaryPolicyBindingsRequest` must match the call
        +     * that provided the page token.
        +     * 
        + * + * string page_token = 4 [(.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_ |= 0x00000004; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.iam.v3.SearchPrincipalAccessBoundaryPolicyBindingsRequest) + } + + // @@protoc_insertion_point(class_scope:google.iam.v3.SearchPrincipalAccessBoundaryPolicyBindingsRequest) + private static final com.google.iam.v3.SearchPrincipalAccessBoundaryPolicyBindingsRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.iam.v3.SearchPrincipalAccessBoundaryPolicyBindingsRequest(); + } + + public static com.google.iam.v3.SearchPrincipalAccessBoundaryPolicyBindingsRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser< + SearchPrincipalAccessBoundaryPolicyBindingsRequest> + PARSER = + new com.google.protobuf.AbstractParser< + SearchPrincipalAccessBoundaryPolicyBindingsRequest>() { + @java.lang.Override + public SearchPrincipalAccessBoundaryPolicyBindingsRequest 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.iam.v3.SearchPrincipalAccessBoundaryPolicyBindingsRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-iam/proto-google-iam-v3/src/main/java/com/google/iam/v3/SearchPrincipalAccessBoundaryPolicyBindingsRequestOrBuilder.java b/java-iam/proto-google-iam-v3/src/main/java/com/google/iam/v3/SearchPrincipalAccessBoundaryPolicyBindingsRequestOrBuilder.java new file mode 100644 index 0000000000..17c2334e22 --- /dev/null +++ b/java-iam/proto-google-iam-v3/src/main/java/com/google/iam/v3/SearchPrincipalAccessBoundaryPolicyBindingsRequestOrBuilder.java @@ -0,0 +1,117 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/iam/v3/principal_access_boundary_policies_service.proto +// Protobuf Java Version: 4.33.2 + +package com.google.iam.v3; + +@com.google.protobuf.Generated +public interface SearchPrincipalAccessBoundaryPolicyBindingsRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.iam.v3.SearchPrincipalAccessBoundaryPolicyBindingsRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
        +   * Required. The name of the principal access boundary policy.
        +   * Format:
        +   * `organizations/{organization_id}/locations/{location}/principalAccessBoundaryPolicies/{principal_access_boundary_policy_id}`
        +   * 
        + * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + + /** + * + * + *
        +   * Required. The name of the principal access boundary policy.
        +   * Format:
        +   * `organizations/{organization_id}/locations/{location}/principalAccessBoundaryPolicies/{principal_access_boundary_policy_id}`
        +   * 
        + * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
        +   * Optional. The maximum number of policy bindings to return. The service may
        +   * return fewer than this value.
        +   *
        +   * If unspecified, at most 50 policy bindings will be returned.
        +   * The maximum value is 1000; values above 1000 will be coerced to 1000.
        +   * 
        + * + * int32 page_size = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageSize. + */ + int getPageSize(); + + /** + * + * + *
        +   * Optional. A page token, received from a previous
        +   * `SearchPrincipalAccessBoundaryPolicyBindingsRequest` call. Provide this to
        +   * retrieve the subsequent page.
        +   *
        +   * When paginating, all other parameters provided to
        +   * `SearchPrincipalAccessBoundaryPolicyBindingsRequest` must match the call
        +   * that provided the page token.
        +   * 
        + * + * string page_token = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageToken. + */ + java.lang.String getPageToken(); + + /** + * + * + *
        +   * Optional. A page token, received from a previous
        +   * `SearchPrincipalAccessBoundaryPolicyBindingsRequest` call. Provide this to
        +   * retrieve the subsequent page.
        +   *
        +   * When paginating, all other parameters provided to
        +   * `SearchPrincipalAccessBoundaryPolicyBindingsRequest` must match the call
        +   * that provided the page token.
        +   * 
        + * + * string page_token = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for pageToken. + */ + com.google.protobuf.ByteString getPageTokenBytes(); +} diff --git a/java-iam/proto-google-iam-v3/src/main/java/com/google/iam/v3/SearchPrincipalAccessBoundaryPolicyBindingsResponse.java b/java-iam/proto-google-iam-v3/src/main/java/com/google/iam/v3/SearchPrincipalAccessBoundaryPolicyBindingsResponse.java new file mode 100644 index 0000000000..0d5c6c3878 --- /dev/null +++ b/java-iam/proto-google-iam-v3/src/main/java/com/google/iam/v3/SearchPrincipalAccessBoundaryPolicyBindingsResponse.java @@ -0,0 +1,1139 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/iam/v3/principal_access_boundary_policies_service.proto +// Protobuf Java Version: 4.33.2 + +package com.google.iam.v3; + +/** + * + * + *
        + * Response message for SearchPrincipalAccessBoundaryPolicyBindings rpc.
        + * 
        + * + * Protobuf type {@code google.iam.v3.SearchPrincipalAccessBoundaryPolicyBindingsResponse} + */ +@com.google.protobuf.Generated +public final class SearchPrincipalAccessBoundaryPolicyBindingsResponse + extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.iam.v3.SearchPrincipalAccessBoundaryPolicyBindingsResponse) + SearchPrincipalAccessBoundaryPolicyBindingsResponseOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "SearchPrincipalAccessBoundaryPolicyBindingsResponse"); + } + + // Use SearchPrincipalAccessBoundaryPolicyBindingsResponse.newBuilder() to construct. + private SearchPrincipalAccessBoundaryPolicyBindingsResponse( + com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private SearchPrincipalAccessBoundaryPolicyBindingsResponse() { + policyBindings_ = java.util.Collections.emptyList(); + nextPageToken_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.iam.v3.PrincipalAccessBoundaryPoliciesServiceProto + .internal_static_google_iam_v3_SearchPrincipalAccessBoundaryPolicyBindingsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.iam.v3.PrincipalAccessBoundaryPoliciesServiceProto + .internal_static_google_iam_v3_SearchPrincipalAccessBoundaryPolicyBindingsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.iam.v3.SearchPrincipalAccessBoundaryPolicyBindingsResponse.class, + com.google.iam.v3.SearchPrincipalAccessBoundaryPolicyBindingsResponse.Builder.class); + } + + public static final int POLICY_BINDINGS_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private java.util.List policyBindings_; + + /** + * + * + *
        +   * The policy bindings that reference the specified policy.
        +   * 
        + * + * repeated .google.iam.v3.PolicyBinding policy_bindings = 1; + */ + @java.lang.Override + public java.util.List getPolicyBindingsList() { + return policyBindings_; + } + + /** + * + * + *
        +   * The policy bindings that reference the specified policy.
        +   * 
        + * + * repeated .google.iam.v3.PolicyBinding policy_bindings = 1; + */ + @java.lang.Override + public java.util.List + getPolicyBindingsOrBuilderList() { + return policyBindings_; + } + + /** + * + * + *
        +   * The policy bindings that reference the specified policy.
        +   * 
        + * + * repeated .google.iam.v3.PolicyBinding policy_bindings = 1; + */ + @java.lang.Override + public int getPolicyBindingsCount() { + return policyBindings_.size(); + } + + /** + * + * + *
        +   * The policy bindings that reference the specified policy.
        +   * 
        + * + * repeated .google.iam.v3.PolicyBinding policy_bindings = 1; + */ + @java.lang.Override + public com.google.iam.v3.PolicyBinding getPolicyBindings(int index) { + return policyBindings_.get(index); + } + + /** + * + * + *
        +   * The policy bindings that reference the specified policy.
        +   * 
        + * + * repeated .google.iam.v3.PolicyBinding policy_bindings = 1; + */ + @java.lang.Override + public com.google.iam.v3.PolicyBindingOrBuilder getPolicyBindingsOrBuilder(int index) { + return policyBindings_.get(index); + } + + public static final int NEXT_PAGE_TOKEN_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object nextPageToken_ = ""; + + /** + * + * + *
        +   * Optional. A token, which can be sent as `page_token` to retrieve the next
        +   * page. If this field is omitted, there are no subsequent pages.
        +   * 
        + * + * string next_page_token = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + } + } + + /** + * + * + *
        +   * Optional. A token, which can be sent as `page_token` to retrieve the next
        +   * page. If this field is omitted, there are no subsequent pages.
        +   * 
        + * + * string next_page_token = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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 < policyBindings_.size(); i++) { + output.writeMessage(1, policyBindings_.get(i)); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(nextPageToken_)) { + com.google.protobuf.GeneratedMessage.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 < policyBindings_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, policyBindings_.get(i)); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(nextPageToken_)) { + size += com.google.protobuf.GeneratedMessage.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.iam.v3.SearchPrincipalAccessBoundaryPolicyBindingsResponse)) { + return super.equals(obj); + } + com.google.iam.v3.SearchPrincipalAccessBoundaryPolicyBindingsResponse other = + (com.google.iam.v3.SearchPrincipalAccessBoundaryPolicyBindingsResponse) obj; + + if (!getPolicyBindingsList().equals(other.getPolicyBindingsList())) 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 (getPolicyBindingsCount() > 0) { + hash = (37 * hash) + POLICY_BINDINGS_FIELD_NUMBER; + hash = (53 * hash) + getPolicyBindingsList().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.iam.v3.SearchPrincipalAccessBoundaryPolicyBindingsResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.iam.v3.SearchPrincipalAccessBoundaryPolicyBindingsResponse parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.iam.v3.SearchPrincipalAccessBoundaryPolicyBindingsResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.iam.v3.SearchPrincipalAccessBoundaryPolicyBindingsResponse 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.iam.v3.SearchPrincipalAccessBoundaryPolicyBindingsResponse parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.iam.v3.SearchPrincipalAccessBoundaryPolicyBindingsResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.iam.v3.SearchPrincipalAccessBoundaryPolicyBindingsResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.iam.v3.SearchPrincipalAccessBoundaryPolicyBindingsResponse parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.iam.v3.SearchPrincipalAccessBoundaryPolicyBindingsResponse + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.iam.v3.SearchPrincipalAccessBoundaryPolicyBindingsResponse + parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.iam.v3.SearchPrincipalAccessBoundaryPolicyBindingsResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.iam.v3.SearchPrincipalAccessBoundaryPolicyBindingsResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.iam.v3.SearchPrincipalAccessBoundaryPolicyBindingsResponse 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
        +   * Response message for SearchPrincipalAccessBoundaryPolicyBindings rpc.
        +   * 
        + * + * Protobuf type {@code google.iam.v3.SearchPrincipalAccessBoundaryPolicyBindingsResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.iam.v3.SearchPrincipalAccessBoundaryPolicyBindingsResponse) + com.google.iam.v3.SearchPrincipalAccessBoundaryPolicyBindingsResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.iam.v3.PrincipalAccessBoundaryPoliciesServiceProto + .internal_static_google_iam_v3_SearchPrincipalAccessBoundaryPolicyBindingsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.iam.v3.PrincipalAccessBoundaryPoliciesServiceProto + .internal_static_google_iam_v3_SearchPrincipalAccessBoundaryPolicyBindingsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.iam.v3.SearchPrincipalAccessBoundaryPolicyBindingsResponse.class, + com.google.iam.v3.SearchPrincipalAccessBoundaryPolicyBindingsResponse.Builder.class); + } + + // Construct using + // com.google.iam.v3.SearchPrincipalAccessBoundaryPolicyBindingsResponse.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (policyBindingsBuilder_ == null) { + policyBindings_ = java.util.Collections.emptyList(); + } else { + policyBindings_ = null; + policyBindingsBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + nextPageToken_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.iam.v3.PrincipalAccessBoundaryPoliciesServiceProto + .internal_static_google_iam_v3_SearchPrincipalAccessBoundaryPolicyBindingsResponse_descriptor; + } + + @java.lang.Override + public com.google.iam.v3.SearchPrincipalAccessBoundaryPolicyBindingsResponse + getDefaultInstanceForType() { + return com.google.iam.v3.SearchPrincipalAccessBoundaryPolicyBindingsResponse + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.iam.v3.SearchPrincipalAccessBoundaryPolicyBindingsResponse build() { + com.google.iam.v3.SearchPrincipalAccessBoundaryPolicyBindingsResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.iam.v3.SearchPrincipalAccessBoundaryPolicyBindingsResponse buildPartial() { + com.google.iam.v3.SearchPrincipalAccessBoundaryPolicyBindingsResponse result = + new com.google.iam.v3.SearchPrincipalAccessBoundaryPolicyBindingsResponse(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields( + com.google.iam.v3.SearchPrincipalAccessBoundaryPolicyBindingsResponse result) { + if (policyBindingsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + policyBindings_ = java.util.Collections.unmodifiableList(policyBindings_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.policyBindings_ = policyBindings_; + } else { + result.policyBindings_ = policyBindingsBuilder_.build(); + } + } + + private void buildPartial0( + com.google.iam.v3.SearchPrincipalAccessBoundaryPolicyBindingsResponse result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.nextPageToken_ = nextPageToken_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.iam.v3.SearchPrincipalAccessBoundaryPolicyBindingsResponse) { + return mergeFrom( + (com.google.iam.v3.SearchPrincipalAccessBoundaryPolicyBindingsResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.iam.v3.SearchPrincipalAccessBoundaryPolicyBindingsResponse other) { + if (other + == com.google.iam.v3.SearchPrincipalAccessBoundaryPolicyBindingsResponse + .getDefaultInstance()) return this; + if (policyBindingsBuilder_ == null) { + if (!other.policyBindings_.isEmpty()) { + if (policyBindings_.isEmpty()) { + policyBindings_ = other.policyBindings_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensurePolicyBindingsIsMutable(); + policyBindings_.addAll(other.policyBindings_); + } + onChanged(); + } + } else { + if (!other.policyBindings_.isEmpty()) { + if (policyBindingsBuilder_.isEmpty()) { + policyBindingsBuilder_.dispose(); + policyBindingsBuilder_ = null; + policyBindings_ = other.policyBindings_; + bitField0_ = (bitField0_ & ~0x00000001); + policyBindingsBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders + ? internalGetPolicyBindingsFieldBuilder() + : null; + } else { + policyBindingsBuilder_.addAllMessages(other.policyBindings_); + } + } + } + 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.iam.v3.PolicyBinding m = + input.readMessage(com.google.iam.v3.PolicyBinding.parser(), extensionRegistry); + if (policyBindingsBuilder_ == null) { + ensurePolicyBindingsIsMutable(); + policyBindings_.add(m); + } else { + policyBindingsBuilder_.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 policyBindings_ = + java.util.Collections.emptyList(); + + private void ensurePolicyBindingsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + policyBindings_ = new java.util.ArrayList(policyBindings_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.google.iam.v3.PolicyBinding, + com.google.iam.v3.PolicyBinding.Builder, + com.google.iam.v3.PolicyBindingOrBuilder> + policyBindingsBuilder_; + + /** + * + * + *
        +     * The policy bindings that reference the specified policy.
        +     * 
        + * + * repeated .google.iam.v3.PolicyBinding policy_bindings = 1; + */ + public java.util.List getPolicyBindingsList() { + if (policyBindingsBuilder_ == null) { + return java.util.Collections.unmodifiableList(policyBindings_); + } else { + return policyBindingsBuilder_.getMessageList(); + } + } + + /** + * + * + *
        +     * The policy bindings that reference the specified policy.
        +     * 
        + * + * repeated .google.iam.v3.PolicyBinding policy_bindings = 1; + */ + public int getPolicyBindingsCount() { + if (policyBindingsBuilder_ == null) { + return policyBindings_.size(); + } else { + return policyBindingsBuilder_.getCount(); + } + } + + /** + * + * + *
        +     * The policy bindings that reference the specified policy.
        +     * 
        + * + * repeated .google.iam.v3.PolicyBinding policy_bindings = 1; + */ + public com.google.iam.v3.PolicyBinding getPolicyBindings(int index) { + if (policyBindingsBuilder_ == null) { + return policyBindings_.get(index); + } else { + return policyBindingsBuilder_.getMessage(index); + } + } + + /** + * + * + *
        +     * The policy bindings that reference the specified policy.
        +     * 
        + * + * repeated .google.iam.v3.PolicyBinding policy_bindings = 1; + */ + public Builder setPolicyBindings(int index, com.google.iam.v3.PolicyBinding value) { + if (policyBindingsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensurePolicyBindingsIsMutable(); + policyBindings_.set(index, value); + onChanged(); + } else { + policyBindingsBuilder_.setMessage(index, value); + } + return this; + } + + /** + * + * + *
        +     * The policy bindings that reference the specified policy.
        +     * 
        + * + * repeated .google.iam.v3.PolicyBinding policy_bindings = 1; + */ + public Builder setPolicyBindings( + int index, com.google.iam.v3.PolicyBinding.Builder builderForValue) { + if (policyBindingsBuilder_ == null) { + ensurePolicyBindingsIsMutable(); + policyBindings_.set(index, builderForValue.build()); + onChanged(); + } else { + policyBindingsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
        +     * The policy bindings that reference the specified policy.
        +     * 
        + * + * repeated .google.iam.v3.PolicyBinding policy_bindings = 1; + */ + public Builder addPolicyBindings(com.google.iam.v3.PolicyBinding value) { + if (policyBindingsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensurePolicyBindingsIsMutable(); + policyBindings_.add(value); + onChanged(); + } else { + policyBindingsBuilder_.addMessage(value); + } + return this; + } + + /** + * + * + *
        +     * The policy bindings that reference the specified policy.
        +     * 
        + * + * repeated .google.iam.v3.PolicyBinding policy_bindings = 1; + */ + public Builder addPolicyBindings(int index, com.google.iam.v3.PolicyBinding value) { + if (policyBindingsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensurePolicyBindingsIsMutable(); + policyBindings_.add(index, value); + onChanged(); + } else { + policyBindingsBuilder_.addMessage(index, value); + } + return this; + } + + /** + * + * + *
        +     * The policy bindings that reference the specified policy.
        +     * 
        + * + * repeated .google.iam.v3.PolicyBinding policy_bindings = 1; + */ + public Builder addPolicyBindings(com.google.iam.v3.PolicyBinding.Builder builderForValue) { + if (policyBindingsBuilder_ == null) { + ensurePolicyBindingsIsMutable(); + policyBindings_.add(builderForValue.build()); + onChanged(); + } else { + policyBindingsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + + /** + * + * + *
        +     * The policy bindings that reference the specified policy.
        +     * 
        + * + * repeated .google.iam.v3.PolicyBinding policy_bindings = 1; + */ + public Builder addPolicyBindings( + int index, com.google.iam.v3.PolicyBinding.Builder builderForValue) { + if (policyBindingsBuilder_ == null) { + ensurePolicyBindingsIsMutable(); + policyBindings_.add(index, builderForValue.build()); + onChanged(); + } else { + policyBindingsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
        +     * The policy bindings that reference the specified policy.
        +     * 
        + * + * repeated .google.iam.v3.PolicyBinding policy_bindings = 1; + */ + public Builder addAllPolicyBindings( + java.lang.Iterable values) { + if (policyBindingsBuilder_ == null) { + ensurePolicyBindingsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, policyBindings_); + onChanged(); + } else { + policyBindingsBuilder_.addAllMessages(values); + } + return this; + } + + /** + * + * + *
        +     * The policy bindings that reference the specified policy.
        +     * 
        + * + * repeated .google.iam.v3.PolicyBinding policy_bindings = 1; + */ + public Builder clearPolicyBindings() { + if (policyBindingsBuilder_ == null) { + policyBindings_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + policyBindingsBuilder_.clear(); + } + return this; + } + + /** + * + * + *
        +     * The policy bindings that reference the specified policy.
        +     * 
        + * + * repeated .google.iam.v3.PolicyBinding policy_bindings = 1; + */ + public Builder removePolicyBindings(int index) { + if (policyBindingsBuilder_ == null) { + ensurePolicyBindingsIsMutable(); + policyBindings_.remove(index); + onChanged(); + } else { + policyBindingsBuilder_.remove(index); + } + return this; + } + + /** + * + * + *
        +     * The policy bindings that reference the specified policy.
        +     * 
        + * + * repeated .google.iam.v3.PolicyBinding policy_bindings = 1; + */ + public com.google.iam.v3.PolicyBinding.Builder getPolicyBindingsBuilder(int index) { + return internalGetPolicyBindingsFieldBuilder().getBuilder(index); + } + + /** + * + * + *
        +     * The policy bindings that reference the specified policy.
        +     * 
        + * + * repeated .google.iam.v3.PolicyBinding policy_bindings = 1; + */ + public com.google.iam.v3.PolicyBindingOrBuilder getPolicyBindingsOrBuilder(int index) { + if (policyBindingsBuilder_ == null) { + return policyBindings_.get(index); + } else { + return policyBindingsBuilder_.getMessageOrBuilder(index); + } + } + + /** + * + * + *
        +     * The policy bindings that reference the specified policy.
        +     * 
        + * + * repeated .google.iam.v3.PolicyBinding policy_bindings = 1; + */ + public java.util.List + getPolicyBindingsOrBuilderList() { + if (policyBindingsBuilder_ != null) { + return policyBindingsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(policyBindings_); + } + } + + /** + * + * + *
        +     * The policy bindings that reference the specified policy.
        +     * 
        + * + * repeated .google.iam.v3.PolicyBinding policy_bindings = 1; + */ + public com.google.iam.v3.PolicyBinding.Builder addPolicyBindingsBuilder() { + return internalGetPolicyBindingsFieldBuilder() + .addBuilder(com.google.iam.v3.PolicyBinding.getDefaultInstance()); + } + + /** + * + * + *
        +     * The policy bindings that reference the specified policy.
        +     * 
        + * + * repeated .google.iam.v3.PolicyBinding policy_bindings = 1; + */ + public com.google.iam.v3.PolicyBinding.Builder addPolicyBindingsBuilder(int index) { + return internalGetPolicyBindingsFieldBuilder() + .addBuilder(index, com.google.iam.v3.PolicyBinding.getDefaultInstance()); + } + + /** + * + * + *
        +     * The policy bindings that reference the specified policy.
        +     * 
        + * + * repeated .google.iam.v3.PolicyBinding policy_bindings = 1; + */ + public java.util.List getPolicyBindingsBuilderList() { + return internalGetPolicyBindingsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.google.iam.v3.PolicyBinding, + com.google.iam.v3.PolicyBinding.Builder, + com.google.iam.v3.PolicyBindingOrBuilder> + internalGetPolicyBindingsFieldBuilder() { + if (policyBindingsBuilder_ == null) { + policyBindingsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilder< + com.google.iam.v3.PolicyBinding, + com.google.iam.v3.PolicyBinding.Builder, + com.google.iam.v3.PolicyBindingOrBuilder>( + policyBindings_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + policyBindings_ = null; + } + return policyBindingsBuilder_; + } + + private java.lang.Object nextPageToken_ = ""; + + /** + * + * + *
        +     * Optional. A token, which can be sent as `page_token` to retrieve the next
        +     * page. If this field is omitted, there are no subsequent pages.
        +     * 
        + * + * string next_page_token = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + } + } + + /** + * + * + *
        +     * Optional. A token, which can be sent as `page_token` to retrieve the next
        +     * page. If this field is omitted, there are no subsequent pages.
        +     * 
        + * + * string next_page_token = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + } + } + + /** + * + * + *
        +     * Optional. A token, which can be sent as `page_token` to retrieve the next
        +     * page. If this field is omitted, there are no subsequent pages.
        +     * 
        + * + * string next_page_token = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + } + + /** + * + * + *
        +     * Optional. A token, which can be sent as `page_token` to retrieve the next
        +     * page. If this field is omitted, there are no subsequent pages.
        +     * 
        + * + * string next_page_token = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearNextPageToken() { + nextPageToken_ = getDefaultInstance().getNextPageToken(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
        +     * Optional. A token, which can be sent as `page_token` to retrieve the next
        +     * page. If this field is omitted, there are no subsequent pages.
        +     * 
        + * + * string next_page_token = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + } + + // @@protoc_insertion_point(builder_scope:google.iam.v3.SearchPrincipalAccessBoundaryPolicyBindingsResponse) + } + + // @@protoc_insertion_point(class_scope:google.iam.v3.SearchPrincipalAccessBoundaryPolicyBindingsResponse) + private static final com.google.iam.v3.SearchPrincipalAccessBoundaryPolicyBindingsResponse + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.iam.v3.SearchPrincipalAccessBoundaryPolicyBindingsResponse(); + } + + public static com.google.iam.v3.SearchPrincipalAccessBoundaryPolicyBindingsResponse + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser< + SearchPrincipalAccessBoundaryPolicyBindingsResponse> + PARSER = + new com.google.protobuf.AbstractParser< + SearchPrincipalAccessBoundaryPolicyBindingsResponse>() { + @java.lang.Override + public SearchPrincipalAccessBoundaryPolicyBindingsResponse 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.iam.v3.SearchPrincipalAccessBoundaryPolicyBindingsResponse + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-iam/proto-google-iam-v3/src/main/java/com/google/iam/v3/SearchPrincipalAccessBoundaryPolicyBindingsResponseOrBuilder.java b/java-iam/proto-google-iam-v3/src/main/java/com/google/iam/v3/SearchPrincipalAccessBoundaryPolicyBindingsResponseOrBuilder.java new file mode 100644 index 0000000000..d305023ad9 --- /dev/null +++ b/java-iam/proto-google-iam-v3/src/main/java/com/google/iam/v3/SearchPrincipalAccessBoundaryPolicyBindingsResponseOrBuilder.java @@ -0,0 +1,112 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/iam/v3/principal_access_boundary_policies_service.proto +// Protobuf Java Version: 4.33.2 + +package com.google.iam.v3; + +@com.google.protobuf.Generated +public interface SearchPrincipalAccessBoundaryPolicyBindingsResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.iam.v3.SearchPrincipalAccessBoundaryPolicyBindingsResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
        +   * The policy bindings that reference the specified policy.
        +   * 
        + * + * repeated .google.iam.v3.PolicyBinding policy_bindings = 1; + */ + java.util.List getPolicyBindingsList(); + + /** + * + * + *
        +   * The policy bindings that reference the specified policy.
        +   * 
        + * + * repeated .google.iam.v3.PolicyBinding policy_bindings = 1; + */ + com.google.iam.v3.PolicyBinding getPolicyBindings(int index); + + /** + * + * + *
        +   * The policy bindings that reference the specified policy.
        +   * 
        + * + * repeated .google.iam.v3.PolicyBinding policy_bindings = 1; + */ + int getPolicyBindingsCount(); + + /** + * + * + *
        +   * The policy bindings that reference the specified policy.
        +   * 
        + * + * repeated .google.iam.v3.PolicyBinding policy_bindings = 1; + */ + java.util.List + getPolicyBindingsOrBuilderList(); + + /** + * + * + *
        +   * The policy bindings that reference the specified policy.
        +   * 
        + * + * repeated .google.iam.v3.PolicyBinding policy_bindings = 1; + */ + com.google.iam.v3.PolicyBindingOrBuilder getPolicyBindingsOrBuilder(int index); + + /** + * + * + *
        +   * Optional. A token, which can be sent as `page_token` to retrieve the next
        +   * page. If this field is omitted, there are no subsequent pages.
        +   * 
        + * + * string next_page_token = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The nextPageToken. + */ + java.lang.String getNextPageToken(); + + /** + * + * + *
        +   * Optional. A token, which can be sent as `page_token` to retrieve the next
        +   * page. If this field is omitted, there are no subsequent pages.
        +   * 
        + * + * string next_page_token = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for nextPageToken. + */ + com.google.protobuf.ByteString getNextPageTokenBytes(); +} diff --git a/java-iam/proto-google-iam-v3/src/main/java/com/google/iam/v3/SearchTargetPolicyBindingsRequest.java b/java-iam/proto-google-iam-v3/src/main/java/com/google/iam/v3/SearchTargetPolicyBindingsRequest.java new file mode 100644 index 0000000000..5f91619929 --- /dev/null +++ b/java-iam/proto-google-iam-v3/src/main/java/com/google/iam/v3/SearchTargetPolicyBindingsRequest.java @@ -0,0 +1,1270 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/iam/v3/policy_bindings_service.proto +// Protobuf Java Version: 4.33.2 + +package com.google.iam.v3; + +/** + * + * + *
        + * Request message for SearchTargetPolicyBindings method.
        + * 
        + * + * Protobuf type {@code google.iam.v3.SearchTargetPolicyBindingsRequest} + */ +@com.google.protobuf.Generated +public final class SearchTargetPolicyBindingsRequest extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.iam.v3.SearchTargetPolicyBindingsRequest) + SearchTargetPolicyBindingsRequestOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "SearchTargetPolicyBindingsRequest"); + } + + // Use SearchTargetPolicyBindingsRequest.newBuilder() to construct. + private SearchTargetPolicyBindingsRequest( + com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private SearchTargetPolicyBindingsRequest() { + target_ = ""; + pageToken_ = ""; + parent_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.iam.v3.PolicyBindingsServiceProto + .internal_static_google_iam_v3_SearchTargetPolicyBindingsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.iam.v3.PolicyBindingsServiceProto + .internal_static_google_iam_v3_SearchTargetPolicyBindingsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.iam.v3.SearchTargetPolicyBindingsRequest.class, + com.google.iam.v3.SearchTargetPolicyBindingsRequest.Builder.class); + } + + public static final int TARGET_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object target_ = ""; + + /** + * + * + *
        +   * Required. The target resource, which is bound to the policy in the binding.
        +   *
        +   * Format:
        +   *
        +   * * `//iam.googleapis.com/locations/global/workforcePools/POOL_ID`
        +   * * `//iam.googleapis.com/projects/PROJECT_NUMBER/locations/global/workloadIdentityPools/POOL_ID`
        +   * * `//iam.googleapis.com/locations/global/workspace/WORKSPACE_ID`
        +   * * `//cloudresourcemanager.googleapis.com/projects/{project_number}`
        +   * * `//cloudresourcemanager.googleapis.com/folders/{folder_id}`
        +   * * `//cloudresourcemanager.googleapis.com/organizations/{organization_id}`
        +   * 
        + * + * string target = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The target. + */ + @java.lang.Override + public java.lang.String getTarget() { + java.lang.Object ref = target_; + 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(); + target_ = s; + return s; + } + } + + /** + * + * + *
        +   * Required. The target resource, which is bound to the policy in the binding.
        +   *
        +   * Format:
        +   *
        +   * * `//iam.googleapis.com/locations/global/workforcePools/POOL_ID`
        +   * * `//iam.googleapis.com/projects/PROJECT_NUMBER/locations/global/workloadIdentityPools/POOL_ID`
        +   * * `//iam.googleapis.com/locations/global/workspace/WORKSPACE_ID`
        +   * * `//cloudresourcemanager.googleapis.com/projects/{project_number}`
        +   * * `//cloudresourcemanager.googleapis.com/folders/{folder_id}`
        +   * * `//cloudresourcemanager.googleapis.com/organizations/{organization_id}`
        +   * 
        + * + * string target = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for target. + */ + @java.lang.Override + public com.google.protobuf.ByteString getTargetBytes() { + java.lang.Object ref = target_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + target_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PAGE_SIZE_FIELD_NUMBER = 2; + private int pageSize_ = 0; + + /** + * + * + *
        +   * Optional. The maximum number of policy bindings to return. The service may
        +   * return fewer than this value.
        +   *
        +   * If unspecified, at most 50 policy bindings will be returned.
        +   * The maximum value is 1000; values above 1000 will be coerced to 1000.
        +   * 
        + * + * 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. A page token, received from a previous
        +   * `SearchTargetPolicyBindingsRequest` call. Provide this to retrieve the
        +   * subsequent page.
        +   *
        +   * When paginating, all other parameters provided to
        +   * `SearchTargetPolicyBindingsRequest` must match the call that provided the
        +   * page token.
        +   * 
        + * + * 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. A page token, received from a previous
        +   * `SearchTargetPolicyBindingsRequest` call. Provide this to retrieve the
        +   * subsequent page.
        +   *
        +   * When paginating, all other parameters provided to
        +   * `SearchTargetPolicyBindingsRequest` must match the call that provided the
        +   * page token.
        +   * 
        + * + * 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; + } + } + + public static final int PARENT_FIELD_NUMBER = 5; + + @SuppressWarnings("serial") + private volatile java.lang.Object parent_ = ""; + + /** + * + * + *
        +   * Required. The parent resource where this search will be performed. This
        +   * should be the nearest Resource Manager resource (project, folder, or
        +   * organization) to the target.
        +   *
        +   * Format:
        +   *
        +   * * `projects/{project_id}/locations/{location}`
        +   * * `projects/{project_number}/locations/{location}`
        +   * * `folders/{folder_id}/locations/{location}`
        +   * * `organizations/{organization_id}/locations/{location}`
        +   * 
        + * + * + * string parent = 5 [(.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 where this search will be performed. This
        +   * should be the nearest Resource Manager resource (project, folder, or
        +   * organization) to the target.
        +   *
        +   * Format:
        +   *
        +   * * `projects/{project_id}/locations/{location}`
        +   * * `projects/{project_number}/locations/{location}`
        +   * * `folders/{folder_id}/locations/{location}`
        +   * * `organizations/{organization_id}/locations/{location}`
        +   * 
        + * + * + * string parent = 5 [(.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; + } + } + + 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.GeneratedMessage.isStringEmpty(target_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, target_); + } + if (pageSize_ != 0) { + output.writeInt32(2, pageSize_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(pageToken_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 3, pageToken_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(parent_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 5, parent_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(target_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, target_); + } + if (pageSize_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(2, pageSize_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(pageToken_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(3, pageToken_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(parent_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(5, parent_); + } + 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.iam.v3.SearchTargetPolicyBindingsRequest)) { + return super.equals(obj); + } + com.google.iam.v3.SearchTargetPolicyBindingsRequest other = + (com.google.iam.v3.SearchTargetPolicyBindingsRequest) obj; + + if (!getTarget().equals(other.getTarget())) return false; + if (getPageSize() != other.getPageSize()) return false; + if (!getPageToken().equals(other.getPageToken())) return false; + if (!getParent().equals(other.getParent())) 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) + TARGET_FIELD_NUMBER; + hash = (53 * hash) + getTarget().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 = (37 * hash) + PARENT_FIELD_NUMBER; + hash = (53 * hash) + getParent().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.iam.v3.SearchTargetPolicyBindingsRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.iam.v3.SearchTargetPolicyBindingsRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.iam.v3.SearchTargetPolicyBindingsRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.iam.v3.SearchTargetPolicyBindingsRequest 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.iam.v3.SearchTargetPolicyBindingsRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.iam.v3.SearchTargetPolicyBindingsRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.iam.v3.SearchTargetPolicyBindingsRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.iam.v3.SearchTargetPolicyBindingsRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.iam.v3.SearchTargetPolicyBindingsRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.iam.v3.SearchTargetPolicyBindingsRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.iam.v3.SearchTargetPolicyBindingsRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.iam.v3.SearchTargetPolicyBindingsRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.iam.v3.SearchTargetPolicyBindingsRequest 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
        +   * Request message for SearchTargetPolicyBindings method.
        +   * 
        + * + * Protobuf type {@code google.iam.v3.SearchTargetPolicyBindingsRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.iam.v3.SearchTargetPolicyBindingsRequest) + com.google.iam.v3.SearchTargetPolicyBindingsRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.iam.v3.PolicyBindingsServiceProto + .internal_static_google_iam_v3_SearchTargetPolicyBindingsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.iam.v3.PolicyBindingsServiceProto + .internal_static_google_iam_v3_SearchTargetPolicyBindingsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.iam.v3.SearchTargetPolicyBindingsRequest.class, + com.google.iam.v3.SearchTargetPolicyBindingsRequest.Builder.class); + } + + // Construct using com.google.iam.v3.SearchTargetPolicyBindingsRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + target_ = ""; + pageSize_ = 0; + pageToken_ = ""; + parent_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.iam.v3.PolicyBindingsServiceProto + .internal_static_google_iam_v3_SearchTargetPolicyBindingsRequest_descriptor; + } + + @java.lang.Override + public com.google.iam.v3.SearchTargetPolicyBindingsRequest getDefaultInstanceForType() { + return com.google.iam.v3.SearchTargetPolicyBindingsRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.iam.v3.SearchTargetPolicyBindingsRequest build() { + com.google.iam.v3.SearchTargetPolicyBindingsRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.iam.v3.SearchTargetPolicyBindingsRequest buildPartial() { + com.google.iam.v3.SearchTargetPolicyBindingsRequest result = + new com.google.iam.v3.SearchTargetPolicyBindingsRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.iam.v3.SearchTargetPolicyBindingsRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.target_ = target_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.pageSize_ = pageSize_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.pageToken_ = pageToken_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.parent_ = parent_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.iam.v3.SearchTargetPolicyBindingsRequest) { + return mergeFrom((com.google.iam.v3.SearchTargetPolicyBindingsRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.iam.v3.SearchTargetPolicyBindingsRequest other) { + if (other == com.google.iam.v3.SearchTargetPolicyBindingsRequest.getDefaultInstance()) + return this; + if (!other.getTarget().isEmpty()) { + target_ = other.target_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.getPageSize() != 0) { + setPageSize(other.getPageSize()); + } + if (!other.getPageToken().isEmpty()) { + pageToken_ = other.pageToken_; + bitField0_ |= 0x00000004; + onChanged(); + } + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + 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: + { + target_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 16: + { + pageSize_ = input.readInt32(); + bitField0_ |= 0x00000002; + break; + } // case 16 + case 26: + { + pageToken_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 42: + { + parent_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000008; + 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 target_ = ""; + + /** + * + * + *
        +     * Required. The target resource, which is bound to the policy in the binding.
        +     *
        +     * Format:
        +     *
        +     * * `//iam.googleapis.com/locations/global/workforcePools/POOL_ID`
        +     * * `//iam.googleapis.com/projects/PROJECT_NUMBER/locations/global/workloadIdentityPools/POOL_ID`
        +     * * `//iam.googleapis.com/locations/global/workspace/WORKSPACE_ID`
        +     * * `//cloudresourcemanager.googleapis.com/projects/{project_number}`
        +     * * `//cloudresourcemanager.googleapis.com/folders/{folder_id}`
        +     * * `//cloudresourcemanager.googleapis.com/organizations/{organization_id}`
        +     * 
        + * + * string target = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The target. + */ + public java.lang.String getTarget() { + java.lang.Object ref = target_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + target_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
        +     * Required. The target resource, which is bound to the policy in the binding.
        +     *
        +     * Format:
        +     *
        +     * * `//iam.googleapis.com/locations/global/workforcePools/POOL_ID`
        +     * * `//iam.googleapis.com/projects/PROJECT_NUMBER/locations/global/workloadIdentityPools/POOL_ID`
        +     * * `//iam.googleapis.com/locations/global/workspace/WORKSPACE_ID`
        +     * * `//cloudresourcemanager.googleapis.com/projects/{project_number}`
        +     * * `//cloudresourcemanager.googleapis.com/folders/{folder_id}`
        +     * * `//cloudresourcemanager.googleapis.com/organizations/{organization_id}`
        +     * 
        + * + * string target = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for target. + */ + public com.google.protobuf.ByteString getTargetBytes() { + java.lang.Object ref = target_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + target_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
        +     * Required. The target resource, which is bound to the policy in the binding.
        +     *
        +     * Format:
        +     *
        +     * * `//iam.googleapis.com/locations/global/workforcePools/POOL_ID`
        +     * * `//iam.googleapis.com/projects/PROJECT_NUMBER/locations/global/workloadIdentityPools/POOL_ID`
        +     * * `//iam.googleapis.com/locations/global/workspace/WORKSPACE_ID`
        +     * * `//cloudresourcemanager.googleapis.com/projects/{project_number}`
        +     * * `//cloudresourcemanager.googleapis.com/folders/{folder_id}`
        +     * * `//cloudresourcemanager.googleapis.com/organizations/{organization_id}`
        +     * 
        + * + * string target = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The target to set. + * @return This builder for chaining. + */ + public Builder setTarget(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + target_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
        +     * Required. The target resource, which is bound to the policy in the binding.
        +     *
        +     * Format:
        +     *
        +     * * `//iam.googleapis.com/locations/global/workforcePools/POOL_ID`
        +     * * `//iam.googleapis.com/projects/PROJECT_NUMBER/locations/global/workloadIdentityPools/POOL_ID`
        +     * * `//iam.googleapis.com/locations/global/workspace/WORKSPACE_ID`
        +     * * `//cloudresourcemanager.googleapis.com/projects/{project_number}`
        +     * * `//cloudresourcemanager.googleapis.com/folders/{folder_id}`
        +     * * `//cloudresourcemanager.googleapis.com/organizations/{organization_id}`
        +     * 
        + * + * string target = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearTarget() { + target_ = getDefaultInstance().getTarget(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
        +     * Required. The target resource, which is bound to the policy in the binding.
        +     *
        +     * Format:
        +     *
        +     * * `//iam.googleapis.com/locations/global/workforcePools/POOL_ID`
        +     * * `//iam.googleapis.com/projects/PROJECT_NUMBER/locations/global/workloadIdentityPools/POOL_ID`
        +     * * `//iam.googleapis.com/locations/global/workspace/WORKSPACE_ID`
        +     * * `//cloudresourcemanager.googleapis.com/projects/{project_number}`
        +     * * `//cloudresourcemanager.googleapis.com/folders/{folder_id}`
        +     * * `//cloudresourcemanager.googleapis.com/organizations/{organization_id}`
        +     * 
        + * + * string target = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for target to set. + * @return This builder for chaining. + */ + public Builder setTargetBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + target_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private int pageSize_; + + /** + * + * + *
        +     * Optional. The maximum number of policy bindings to return. The service may
        +     * return fewer than this value.
        +     *
        +     * If unspecified, at most 50 policy bindings will be returned.
        +     * The maximum value is 1000; values above 1000 will be coerced to 1000.
        +     * 
        + * + * 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 policy bindings to return. The service may
        +     * return fewer than this value.
        +     *
        +     * If unspecified, at most 50 policy bindings will be returned.
        +     * The maximum value is 1000; values above 1000 will be coerced to 1000.
        +     * 
        + * + * 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_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
        +     * Optional. The maximum number of policy bindings to return. The service may
        +     * return fewer than this value.
        +     *
        +     * If unspecified, at most 50 policy bindings will be returned.
        +     * The maximum value is 1000; values above 1000 will be coerced to 1000.
        +     * 
        + * + * int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearPageSize() { + bitField0_ = (bitField0_ & ~0x00000002); + pageSize_ = 0; + onChanged(); + return this; + } + + private java.lang.Object pageToken_ = ""; + + /** + * + * + *
        +     * Optional. A page token, received from a previous
        +     * `SearchTargetPolicyBindingsRequest` call. Provide this to retrieve the
        +     * subsequent page.
        +     *
        +     * When paginating, all other parameters provided to
        +     * `SearchTargetPolicyBindingsRequest` must match the call that provided the
        +     * page token.
        +     * 
        + * + * 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. A page token, received from a previous
        +     * `SearchTargetPolicyBindingsRequest` call. Provide this to retrieve the
        +     * subsequent page.
        +     *
        +     * When paginating, all other parameters provided to
        +     * `SearchTargetPolicyBindingsRequest` must match the call that provided the
        +     * page token.
        +     * 
        + * + * 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. A page token, received from a previous
        +     * `SearchTargetPolicyBindingsRequest` call. Provide this to retrieve the
        +     * subsequent page.
        +     *
        +     * When paginating, all other parameters provided to
        +     * `SearchTargetPolicyBindingsRequest` must match the call that provided the
        +     * page token.
        +     * 
        + * + * 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_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
        +     * Optional. A page token, received from a previous
        +     * `SearchTargetPolicyBindingsRequest` call. Provide this to retrieve the
        +     * subsequent page.
        +     *
        +     * When paginating, all other parameters provided to
        +     * `SearchTargetPolicyBindingsRequest` must match the call that provided the
        +     * page token.
        +     * 
        + * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearPageToken() { + pageToken_ = getDefaultInstance().getPageToken(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + + /** + * + * + *
        +     * Optional. A page token, received from a previous
        +     * `SearchTargetPolicyBindingsRequest` call. Provide this to retrieve the
        +     * subsequent page.
        +     *
        +     * When paginating, all other parameters provided to
        +     * `SearchTargetPolicyBindingsRequest` must match the call that provided the
        +     * page token.
        +     * 
        + * + * 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_ |= 0x00000004; + onChanged(); + return this; + } + + private java.lang.Object parent_ = ""; + + /** + * + * + *
        +     * Required. The parent resource where this search will be performed. This
        +     * should be the nearest Resource Manager resource (project, folder, or
        +     * organization) to the target.
        +     *
        +     * Format:
        +     *
        +     * * `projects/{project_id}/locations/{location}`
        +     * * `projects/{project_number}/locations/{location}`
        +     * * `folders/{folder_id}/locations/{location}`
        +     * * `organizations/{organization_id}/locations/{location}`
        +     * 
        + * + * + * string parent = 5 [(.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 where this search will be performed. This
        +     * should be the nearest Resource Manager resource (project, folder, or
        +     * organization) to the target.
        +     *
        +     * Format:
        +     *
        +     * * `projects/{project_id}/locations/{location}`
        +     * * `projects/{project_number}/locations/{location}`
        +     * * `folders/{folder_id}/locations/{location}`
        +     * * `organizations/{organization_id}/locations/{location}`
        +     * 
        + * + * + * string parent = 5 [(.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 where this search will be performed. This
        +     * should be the nearest Resource Manager resource (project, folder, or
        +     * organization) to the target.
        +     *
        +     * Format:
        +     *
        +     * * `projects/{project_id}/locations/{location}`
        +     * * `projects/{project_number}/locations/{location}`
        +     * * `folders/{folder_id}/locations/{location}`
        +     * * `organizations/{organization_id}/locations/{location}`
        +     * 
        + * + * + * string parent = 5 [(.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_ |= 0x00000008; + onChanged(); + return this; + } + + /** + * + * + *
        +     * Required. The parent resource where this search will be performed. This
        +     * should be the nearest Resource Manager resource (project, folder, or
        +     * organization) to the target.
        +     *
        +     * Format:
        +     *
        +     * * `projects/{project_id}/locations/{location}`
        +     * * `projects/{project_number}/locations/{location}`
        +     * * `folders/{folder_id}/locations/{location}`
        +     * * `organizations/{organization_id}/locations/{location}`
        +     * 
        + * + * + * string parent = 5 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearParent() { + parent_ = getDefaultInstance().getParent(); + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + return this; + } + + /** + * + * + *
        +     * Required. The parent resource where this search will be performed. This
        +     * should be the nearest Resource Manager resource (project, folder, or
        +     * organization) to the target.
        +     *
        +     * Format:
        +     *
        +     * * `projects/{project_id}/locations/{location}`
        +     * * `projects/{project_number}/locations/{location}`
        +     * * `folders/{folder_id}/locations/{location}`
        +     * * `organizations/{organization_id}/locations/{location}`
        +     * 
        + * + * + * string parent = 5 [(.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_ |= 0x00000008; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.iam.v3.SearchTargetPolicyBindingsRequest) + } + + // @@protoc_insertion_point(class_scope:google.iam.v3.SearchTargetPolicyBindingsRequest) + private static final com.google.iam.v3.SearchTargetPolicyBindingsRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.iam.v3.SearchTargetPolicyBindingsRequest(); + } + + public static com.google.iam.v3.SearchTargetPolicyBindingsRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SearchTargetPolicyBindingsRequest 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.iam.v3.SearchTargetPolicyBindingsRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-iam/proto-google-iam-v3/src/main/java/com/google/iam/v3/SearchTargetPolicyBindingsRequestOrBuilder.java b/java-iam/proto-google-iam-v3/src/main/java/com/google/iam/v3/SearchTargetPolicyBindingsRequestOrBuilder.java new file mode 100644 index 0000000000..41476438b1 --- /dev/null +++ b/java-iam/proto-google-iam-v3/src/main/java/com/google/iam/v3/SearchTargetPolicyBindingsRequestOrBuilder.java @@ -0,0 +1,175 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/iam/v3/policy_bindings_service.proto +// Protobuf Java Version: 4.33.2 + +package com.google.iam.v3; + +@com.google.protobuf.Generated +public interface SearchTargetPolicyBindingsRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.iam.v3.SearchTargetPolicyBindingsRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
        +   * Required. The target resource, which is bound to the policy in the binding.
        +   *
        +   * Format:
        +   *
        +   * * `//iam.googleapis.com/locations/global/workforcePools/POOL_ID`
        +   * * `//iam.googleapis.com/projects/PROJECT_NUMBER/locations/global/workloadIdentityPools/POOL_ID`
        +   * * `//iam.googleapis.com/locations/global/workspace/WORKSPACE_ID`
        +   * * `//cloudresourcemanager.googleapis.com/projects/{project_number}`
        +   * * `//cloudresourcemanager.googleapis.com/folders/{folder_id}`
        +   * * `//cloudresourcemanager.googleapis.com/organizations/{organization_id}`
        +   * 
        + * + * string target = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The target. + */ + java.lang.String getTarget(); + + /** + * + * + *
        +   * Required. The target resource, which is bound to the policy in the binding.
        +   *
        +   * Format:
        +   *
        +   * * `//iam.googleapis.com/locations/global/workforcePools/POOL_ID`
        +   * * `//iam.googleapis.com/projects/PROJECT_NUMBER/locations/global/workloadIdentityPools/POOL_ID`
        +   * * `//iam.googleapis.com/locations/global/workspace/WORKSPACE_ID`
        +   * * `//cloudresourcemanager.googleapis.com/projects/{project_number}`
        +   * * `//cloudresourcemanager.googleapis.com/folders/{folder_id}`
        +   * * `//cloudresourcemanager.googleapis.com/organizations/{organization_id}`
        +   * 
        + * + * string target = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for target. + */ + com.google.protobuf.ByteString getTargetBytes(); + + /** + * + * + *
        +   * Optional. The maximum number of policy bindings to return. The service may
        +   * return fewer than this value.
        +   *
        +   * If unspecified, at most 50 policy bindings will be returned.
        +   * The maximum value is 1000; values above 1000 will be coerced to 1000.
        +   * 
        + * + * int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageSize. + */ + int getPageSize(); + + /** + * + * + *
        +   * Optional. A page token, received from a previous
        +   * `SearchTargetPolicyBindingsRequest` call. Provide this to retrieve the
        +   * subsequent page.
        +   *
        +   * When paginating, all other parameters provided to
        +   * `SearchTargetPolicyBindingsRequest` must match the call that provided the
        +   * page token.
        +   * 
        + * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageToken. + */ + java.lang.String getPageToken(); + + /** + * + * + *
        +   * Optional. A page token, received from a previous
        +   * `SearchTargetPolicyBindingsRequest` call. Provide this to retrieve the
        +   * subsequent page.
        +   *
        +   * When paginating, all other parameters provided to
        +   * `SearchTargetPolicyBindingsRequest` must match the call that provided the
        +   * page token.
        +   * 
        + * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for pageToken. + */ + com.google.protobuf.ByteString getPageTokenBytes(); + + /** + * + * + *
        +   * Required. The parent resource where this search will be performed. This
        +   * should be the nearest Resource Manager resource (project, folder, or
        +   * organization) to the target.
        +   *
        +   * Format:
        +   *
        +   * * `projects/{project_id}/locations/{location}`
        +   * * `projects/{project_number}/locations/{location}`
        +   * * `folders/{folder_id}/locations/{location}`
        +   * * `organizations/{organization_id}/locations/{location}`
        +   * 
        + * + * + * string parent = 5 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + + /** + * + * + *
        +   * Required. The parent resource where this search will be performed. This
        +   * should be the nearest Resource Manager resource (project, folder, or
        +   * organization) to the target.
        +   *
        +   * Format:
        +   *
        +   * * `projects/{project_id}/locations/{location}`
        +   * * `projects/{project_number}/locations/{location}`
        +   * * `folders/{folder_id}/locations/{location}`
        +   * * `organizations/{organization_id}/locations/{location}`
        +   * 
        + * + * + * string parent = 5 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); +} diff --git a/java-iam/proto-google-iam-v3/src/main/java/com/google/iam/v3/SearchTargetPolicyBindingsResponse.java b/java-iam/proto-google-iam-v3/src/main/java/com/google/iam/v3/SearchTargetPolicyBindingsResponse.java new file mode 100644 index 0000000000..0aa1c3c42d --- /dev/null +++ b/java-iam/proto-google-iam-v3/src/main/java/com/google/iam/v3/SearchTargetPolicyBindingsResponse.java @@ -0,0 +1,1120 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/iam/v3/policy_bindings_service.proto +// Protobuf Java Version: 4.33.2 + +package com.google.iam.v3; + +/** + * + * + *
        + * Response message for SearchTargetPolicyBindings method.
        + * 
        + * + * Protobuf type {@code google.iam.v3.SearchTargetPolicyBindingsResponse} + */ +@com.google.protobuf.Generated +public final class SearchTargetPolicyBindingsResponse extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.iam.v3.SearchTargetPolicyBindingsResponse) + SearchTargetPolicyBindingsResponseOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "SearchTargetPolicyBindingsResponse"); + } + + // Use SearchTargetPolicyBindingsResponse.newBuilder() to construct. + private SearchTargetPolicyBindingsResponse( + com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private SearchTargetPolicyBindingsResponse() { + policyBindings_ = java.util.Collections.emptyList(); + nextPageToken_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.iam.v3.PolicyBindingsServiceProto + .internal_static_google_iam_v3_SearchTargetPolicyBindingsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.iam.v3.PolicyBindingsServiceProto + .internal_static_google_iam_v3_SearchTargetPolicyBindingsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.iam.v3.SearchTargetPolicyBindingsResponse.class, + com.google.iam.v3.SearchTargetPolicyBindingsResponse.Builder.class); + } + + public static final int POLICY_BINDINGS_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private java.util.List policyBindings_; + + /** + * + * + *
        +   * The policy bindings bound to the specified target.
        +   * 
        + * + * repeated .google.iam.v3.PolicyBinding policy_bindings = 1; + */ + @java.lang.Override + public java.util.List getPolicyBindingsList() { + return policyBindings_; + } + + /** + * + * + *
        +   * The policy bindings bound to the specified target.
        +   * 
        + * + * repeated .google.iam.v3.PolicyBinding policy_bindings = 1; + */ + @java.lang.Override + public java.util.List + getPolicyBindingsOrBuilderList() { + return policyBindings_; + } + + /** + * + * + *
        +   * The policy bindings bound to the specified target.
        +   * 
        + * + * repeated .google.iam.v3.PolicyBinding policy_bindings = 1; + */ + @java.lang.Override + public int getPolicyBindingsCount() { + return policyBindings_.size(); + } + + /** + * + * + *
        +   * The policy bindings bound to the specified target.
        +   * 
        + * + * repeated .google.iam.v3.PolicyBinding policy_bindings = 1; + */ + @java.lang.Override + public com.google.iam.v3.PolicyBinding getPolicyBindings(int index) { + return policyBindings_.get(index); + } + + /** + * + * + *
        +   * The policy bindings bound to the specified target.
        +   * 
        + * + * repeated .google.iam.v3.PolicyBinding policy_bindings = 1; + */ + @java.lang.Override + public com.google.iam.v3.PolicyBindingOrBuilder getPolicyBindingsOrBuilder(int index) { + return policyBindings_.get(index); + } + + public static final int NEXT_PAGE_TOKEN_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object nextPageToken_ = ""; + + /** + * + * + *
        +   * Optional. A token, which can be sent as `page_token` to retrieve the next
        +   * page. If this field is omitted, there are no subsequent pages.
        +   * 
        + * + * string next_page_token = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + } + } + + /** + * + * + *
        +   * Optional. A token, which can be sent as `page_token` to retrieve the next
        +   * page. If this field is omitted, there are no subsequent pages.
        +   * 
        + * + * string next_page_token = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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 < policyBindings_.size(); i++) { + output.writeMessage(1, policyBindings_.get(i)); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(nextPageToken_)) { + com.google.protobuf.GeneratedMessage.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 < policyBindings_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, policyBindings_.get(i)); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(nextPageToken_)) { + size += com.google.protobuf.GeneratedMessage.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.iam.v3.SearchTargetPolicyBindingsResponse)) { + return super.equals(obj); + } + com.google.iam.v3.SearchTargetPolicyBindingsResponse other = + (com.google.iam.v3.SearchTargetPolicyBindingsResponse) obj; + + if (!getPolicyBindingsList().equals(other.getPolicyBindingsList())) 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 (getPolicyBindingsCount() > 0) { + hash = (37 * hash) + POLICY_BINDINGS_FIELD_NUMBER; + hash = (53 * hash) + getPolicyBindingsList().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.iam.v3.SearchTargetPolicyBindingsResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.iam.v3.SearchTargetPolicyBindingsResponse parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.iam.v3.SearchTargetPolicyBindingsResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.iam.v3.SearchTargetPolicyBindingsResponse 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.iam.v3.SearchTargetPolicyBindingsResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.iam.v3.SearchTargetPolicyBindingsResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.iam.v3.SearchTargetPolicyBindingsResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.iam.v3.SearchTargetPolicyBindingsResponse parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.iam.v3.SearchTargetPolicyBindingsResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.iam.v3.SearchTargetPolicyBindingsResponse parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.iam.v3.SearchTargetPolicyBindingsResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.iam.v3.SearchTargetPolicyBindingsResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.iam.v3.SearchTargetPolicyBindingsResponse 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
        +   * Response message for SearchTargetPolicyBindings method.
        +   * 
        + * + * Protobuf type {@code google.iam.v3.SearchTargetPolicyBindingsResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.iam.v3.SearchTargetPolicyBindingsResponse) + com.google.iam.v3.SearchTargetPolicyBindingsResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.iam.v3.PolicyBindingsServiceProto + .internal_static_google_iam_v3_SearchTargetPolicyBindingsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.iam.v3.PolicyBindingsServiceProto + .internal_static_google_iam_v3_SearchTargetPolicyBindingsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.iam.v3.SearchTargetPolicyBindingsResponse.class, + com.google.iam.v3.SearchTargetPolicyBindingsResponse.Builder.class); + } + + // Construct using com.google.iam.v3.SearchTargetPolicyBindingsResponse.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (policyBindingsBuilder_ == null) { + policyBindings_ = java.util.Collections.emptyList(); + } else { + policyBindings_ = null; + policyBindingsBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + nextPageToken_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.iam.v3.PolicyBindingsServiceProto + .internal_static_google_iam_v3_SearchTargetPolicyBindingsResponse_descriptor; + } + + @java.lang.Override + public com.google.iam.v3.SearchTargetPolicyBindingsResponse getDefaultInstanceForType() { + return com.google.iam.v3.SearchTargetPolicyBindingsResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.iam.v3.SearchTargetPolicyBindingsResponse build() { + com.google.iam.v3.SearchTargetPolicyBindingsResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.iam.v3.SearchTargetPolicyBindingsResponse buildPartial() { + com.google.iam.v3.SearchTargetPolicyBindingsResponse result = + new com.google.iam.v3.SearchTargetPolicyBindingsResponse(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields( + com.google.iam.v3.SearchTargetPolicyBindingsResponse result) { + if (policyBindingsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + policyBindings_ = java.util.Collections.unmodifiableList(policyBindings_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.policyBindings_ = policyBindings_; + } else { + result.policyBindings_ = policyBindingsBuilder_.build(); + } + } + + private void buildPartial0(com.google.iam.v3.SearchTargetPolicyBindingsResponse result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.nextPageToken_ = nextPageToken_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.iam.v3.SearchTargetPolicyBindingsResponse) { + return mergeFrom((com.google.iam.v3.SearchTargetPolicyBindingsResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.iam.v3.SearchTargetPolicyBindingsResponse other) { + if (other == com.google.iam.v3.SearchTargetPolicyBindingsResponse.getDefaultInstance()) + return this; + if (policyBindingsBuilder_ == null) { + if (!other.policyBindings_.isEmpty()) { + if (policyBindings_.isEmpty()) { + policyBindings_ = other.policyBindings_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensurePolicyBindingsIsMutable(); + policyBindings_.addAll(other.policyBindings_); + } + onChanged(); + } + } else { + if (!other.policyBindings_.isEmpty()) { + if (policyBindingsBuilder_.isEmpty()) { + policyBindingsBuilder_.dispose(); + policyBindingsBuilder_ = null; + policyBindings_ = other.policyBindings_; + bitField0_ = (bitField0_ & ~0x00000001); + policyBindingsBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders + ? internalGetPolicyBindingsFieldBuilder() + : null; + } else { + policyBindingsBuilder_.addAllMessages(other.policyBindings_); + } + } + } + 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.iam.v3.PolicyBinding m = + input.readMessage(com.google.iam.v3.PolicyBinding.parser(), extensionRegistry); + if (policyBindingsBuilder_ == null) { + ensurePolicyBindingsIsMutable(); + policyBindings_.add(m); + } else { + policyBindingsBuilder_.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 policyBindings_ = + java.util.Collections.emptyList(); + + private void ensurePolicyBindingsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + policyBindings_ = new java.util.ArrayList(policyBindings_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.google.iam.v3.PolicyBinding, + com.google.iam.v3.PolicyBinding.Builder, + com.google.iam.v3.PolicyBindingOrBuilder> + policyBindingsBuilder_; + + /** + * + * + *
        +     * The policy bindings bound to the specified target.
        +     * 
        + * + * repeated .google.iam.v3.PolicyBinding policy_bindings = 1; + */ + public java.util.List getPolicyBindingsList() { + if (policyBindingsBuilder_ == null) { + return java.util.Collections.unmodifiableList(policyBindings_); + } else { + return policyBindingsBuilder_.getMessageList(); + } + } + + /** + * + * + *
        +     * The policy bindings bound to the specified target.
        +     * 
        + * + * repeated .google.iam.v3.PolicyBinding policy_bindings = 1; + */ + public int getPolicyBindingsCount() { + if (policyBindingsBuilder_ == null) { + return policyBindings_.size(); + } else { + return policyBindingsBuilder_.getCount(); + } + } + + /** + * + * + *
        +     * The policy bindings bound to the specified target.
        +     * 
        + * + * repeated .google.iam.v3.PolicyBinding policy_bindings = 1; + */ + public com.google.iam.v3.PolicyBinding getPolicyBindings(int index) { + if (policyBindingsBuilder_ == null) { + return policyBindings_.get(index); + } else { + return policyBindingsBuilder_.getMessage(index); + } + } + + /** + * + * + *
        +     * The policy bindings bound to the specified target.
        +     * 
        + * + * repeated .google.iam.v3.PolicyBinding policy_bindings = 1; + */ + public Builder setPolicyBindings(int index, com.google.iam.v3.PolicyBinding value) { + if (policyBindingsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensurePolicyBindingsIsMutable(); + policyBindings_.set(index, value); + onChanged(); + } else { + policyBindingsBuilder_.setMessage(index, value); + } + return this; + } + + /** + * + * + *
        +     * The policy bindings bound to the specified target.
        +     * 
        + * + * repeated .google.iam.v3.PolicyBinding policy_bindings = 1; + */ + public Builder setPolicyBindings( + int index, com.google.iam.v3.PolicyBinding.Builder builderForValue) { + if (policyBindingsBuilder_ == null) { + ensurePolicyBindingsIsMutable(); + policyBindings_.set(index, builderForValue.build()); + onChanged(); + } else { + policyBindingsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
        +     * The policy bindings bound to the specified target.
        +     * 
        + * + * repeated .google.iam.v3.PolicyBinding policy_bindings = 1; + */ + public Builder addPolicyBindings(com.google.iam.v3.PolicyBinding value) { + if (policyBindingsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensurePolicyBindingsIsMutable(); + policyBindings_.add(value); + onChanged(); + } else { + policyBindingsBuilder_.addMessage(value); + } + return this; + } + + /** + * + * + *
        +     * The policy bindings bound to the specified target.
        +     * 
        + * + * repeated .google.iam.v3.PolicyBinding policy_bindings = 1; + */ + public Builder addPolicyBindings(int index, com.google.iam.v3.PolicyBinding value) { + if (policyBindingsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensurePolicyBindingsIsMutable(); + policyBindings_.add(index, value); + onChanged(); + } else { + policyBindingsBuilder_.addMessage(index, value); + } + return this; + } + + /** + * + * + *
        +     * The policy bindings bound to the specified target.
        +     * 
        + * + * repeated .google.iam.v3.PolicyBinding policy_bindings = 1; + */ + public Builder addPolicyBindings(com.google.iam.v3.PolicyBinding.Builder builderForValue) { + if (policyBindingsBuilder_ == null) { + ensurePolicyBindingsIsMutable(); + policyBindings_.add(builderForValue.build()); + onChanged(); + } else { + policyBindingsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + + /** + * + * + *
        +     * The policy bindings bound to the specified target.
        +     * 
        + * + * repeated .google.iam.v3.PolicyBinding policy_bindings = 1; + */ + public Builder addPolicyBindings( + int index, com.google.iam.v3.PolicyBinding.Builder builderForValue) { + if (policyBindingsBuilder_ == null) { + ensurePolicyBindingsIsMutable(); + policyBindings_.add(index, builderForValue.build()); + onChanged(); + } else { + policyBindingsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
        +     * The policy bindings bound to the specified target.
        +     * 
        + * + * repeated .google.iam.v3.PolicyBinding policy_bindings = 1; + */ + public Builder addAllPolicyBindings( + java.lang.Iterable values) { + if (policyBindingsBuilder_ == null) { + ensurePolicyBindingsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, policyBindings_); + onChanged(); + } else { + policyBindingsBuilder_.addAllMessages(values); + } + return this; + } + + /** + * + * + *
        +     * The policy bindings bound to the specified target.
        +     * 
        + * + * repeated .google.iam.v3.PolicyBinding policy_bindings = 1; + */ + public Builder clearPolicyBindings() { + if (policyBindingsBuilder_ == null) { + policyBindings_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + policyBindingsBuilder_.clear(); + } + return this; + } + + /** + * + * + *
        +     * The policy bindings bound to the specified target.
        +     * 
        + * + * repeated .google.iam.v3.PolicyBinding policy_bindings = 1; + */ + public Builder removePolicyBindings(int index) { + if (policyBindingsBuilder_ == null) { + ensurePolicyBindingsIsMutable(); + policyBindings_.remove(index); + onChanged(); + } else { + policyBindingsBuilder_.remove(index); + } + return this; + } + + /** + * + * + *
        +     * The policy bindings bound to the specified target.
        +     * 
        + * + * repeated .google.iam.v3.PolicyBinding policy_bindings = 1; + */ + public com.google.iam.v3.PolicyBinding.Builder getPolicyBindingsBuilder(int index) { + return internalGetPolicyBindingsFieldBuilder().getBuilder(index); + } + + /** + * + * + *
        +     * The policy bindings bound to the specified target.
        +     * 
        + * + * repeated .google.iam.v3.PolicyBinding policy_bindings = 1; + */ + public com.google.iam.v3.PolicyBindingOrBuilder getPolicyBindingsOrBuilder(int index) { + if (policyBindingsBuilder_ == null) { + return policyBindings_.get(index); + } else { + return policyBindingsBuilder_.getMessageOrBuilder(index); + } + } + + /** + * + * + *
        +     * The policy bindings bound to the specified target.
        +     * 
        + * + * repeated .google.iam.v3.PolicyBinding policy_bindings = 1; + */ + public java.util.List + getPolicyBindingsOrBuilderList() { + if (policyBindingsBuilder_ != null) { + return policyBindingsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(policyBindings_); + } + } + + /** + * + * + *
        +     * The policy bindings bound to the specified target.
        +     * 
        + * + * repeated .google.iam.v3.PolicyBinding policy_bindings = 1; + */ + public com.google.iam.v3.PolicyBinding.Builder addPolicyBindingsBuilder() { + return internalGetPolicyBindingsFieldBuilder() + .addBuilder(com.google.iam.v3.PolicyBinding.getDefaultInstance()); + } + + /** + * + * + *
        +     * The policy bindings bound to the specified target.
        +     * 
        + * + * repeated .google.iam.v3.PolicyBinding policy_bindings = 1; + */ + public com.google.iam.v3.PolicyBinding.Builder addPolicyBindingsBuilder(int index) { + return internalGetPolicyBindingsFieldBuilder() + .addBuilder(index, com.google.iam.v3.PolicyBinding.getDefaultInstance()); + } + + /** + * + * + *
        +     * The policy bindings bound to the specified target.
        +     * 
        + * + * repeated .google.iam.v3.PolicyBinding policy_bindings = 1; + */ + public java.util.List getPolicyBindingsBuilderList() { + return internalGetPolicyBindingsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.google.iam.v3.PolicyBinding, + com.google.iam.v3.PolicyBinding.Builder, + com.google.iam.v3.PolicyBindingOrBuilder> + internalGetPolicyBindingsFieldBuilder() { + if (policyBindingsBuilder_ == null) { + policyBindingsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilder< + com.google.iam.v3.PolicyBinding, + com.google.iam.v3.PolicyBinding.Builder, + com.google.iam.v3.PolicyBindingOrBuilder>( + policyBindings_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + policyBindings_ = null; + } + return policyBindingsBuilder_; + } + + private java.lang.Object nextPageToken_ = ""; + + /** + * + * + *
        +     * Optional. A token, which can be sent as `page_token` to retrieve the next
        +     * page. If this field is omitted, there are no subsequent pages.
        +     * 
        + * + * string next_page_token = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + } + } + + /** + * + * + *
        +     * Optional. A token, which can be sent as `page_token` to retrieve the next
        +     * page. If this field is omitted, there are no subsequent pages.
        +     * 
        + * + * string next_page_token = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + } + } + + /** + * + * + *
        +     * Optional. A token, which can be sent as `page_token` to retrieve the next
        +     * page. If this field is omitted, there are no subsequent pages.
        +     * 
        + * + * string next_page_token = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + } + + /** + * + * + *
        +     * Optional. A token, which can be sent as `page_token` to retrieve the next
        +     * page. If this field is omitted, there are no subsequent pages.
        +     * 
        + * + * string next_page_token = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearNextPageToken() { + nextPageToken_ = getDefaultInstance().getNextPageToken(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
        +     * Optional. A token, which can be sent as `page_token` to retrieve the next
        +     * page. If this field is omitted, there are no subsequent pages.
        +     * 
        + * + * string next_page_token = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + } + + // @@protoc_insertion_point(builder_scope:google.iam.v3.SearchTargetPolicyBindingsResponse) + } + + // @@protoc_insertion_point(class_scope:google.iam.v3.SearchTargetPolicyBindingsResponse) + private static final com.google.iam.v3.SearchTargetPolicyBindingsResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.iam.v3.SearchTargetPolicyBindingsResponse(); + } + + public static com.google.iam.v3.SearchTargetPolicyBindingsResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SearchTargetPolicyBindingsResponse 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.iam.v3.SearchTargetPolicyBindingsResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-iam/proto-google-iam-v3/src/main/java/com/google/iam/v3/SearchTargetPolicyBindingsResponseOrBuilder.java b/java-iam/proto-google-iam-v3/src/main/java/com/google/iam/v3/SearchTargetPolicyBindingsResponseOrBuilder.java new file mode 100644 index 0000000000..f8c9bb1783 --- /dev/null +++ b/java-iam/proto-google-iam-v3/src/main/java/com/google/iam/v3/SearchTargetPolicyBindingsResponseOrBuilder.java @@ -0,0 +1,112 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/iam/v3/policy_bindings_service.proto +// Protobuf Java Version: 4.33.2 + +package com.google.iam.v3; + +@com.google.protobuf.Generated +public interface SearchTargetPolicyBindingsResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.iam.v3.SearchTargetPolicyBindingsResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
        +   * The policy bindings bound to the specified target.
        +   * 
        + * + * repeated .google.iam.v3.PolicyBinding policy_bindings = 1; + */ + java.util.List getPolicyBindingsList(); + + /** + * + * + *
        +   * The policy bindings bound to the specified target.
        +   * 
        + * + * repeated .google.iam.v3.PolicyBinding policy_bindings = 1; + */ + com.google.iam.v3.PolicyBinding getPolicyBindings(int index); + + /** + * + * + *
        +   * The policy bindings bound to the specified target.
        +   * 
        + * + * repeated .google.iam.v3.PolicyBinding policy_bindings = 1; + */ + int getPolicyBindingsCount(); + + /** + * + * + *
        +   * The policy bindings bound to the specified target.
        +   * 
        + * + * repeated .google.iam.v3.PolicyBinding policy_bindings = 1; + */ + java.util.List + getPolicyBindingsOrBuilderList(); + + /** + * + * + *
        +   * The policy bindings bound to the specified target.
        +   * 
        + * + * repeated .google.iam.v3.PolicyBinding policy_bindings = 1; + */ + com.google.iam.v3.PolicyBindingOrBuilder getPolicyBindingsOrBuilder(int index); + + /** + * + * + *
        +   * Optional. A token, which can be sent as `page_token` to retrieve the next
        +   * page. If this field is omitted, there are no subsequent pages.
        +   * 
        + * + * string next_page_token = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The nextPageToken. + */ + java.lang.String getNextPageToken(); + + /** + * + * + *
        +   * Optional. A token, which can be sent as `page_token` to retrieve the next
        +   * page. If this field is omitted, there are no subsequent pages.
        +   * 
        + * + * string next_page_token = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for nextPageToken. + */ + com.google.protobuf.ByteString getNextPageTokenBytes(); +} diff --git a/java-iam/proto-google-iam-v3/src/main/java/com/google/iam/v3/UpdatePolicyBindingRequest.java b/java-iam/proto-google-iam-v3/src/main/java/com/google/iam/v3/UpdatePolicyBindingRequest.java new file mode 100644 index 0000000000..f7e5bb8164 --- /dev/null +++ b/java-iam/proto-google-iam-v3/src/main/java/com/google/iam/v3/UpdatePolicyBindingRequest.java @@ -0,0 +1,1148 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/iam/v3/policy_bindings_service.proto +// Protobuf Java Version: 4.33.2 + +package com.google.iam.v3; + +/** + * + * + *
        + * Request message for UpdatePolicyBinding method.
        + * 
        + * + * Protobuf type {@code google.iam.v3.UpdatePolicyBindingRequest} + */ +@com.google.protobuf.Generated +public final class UpdatePolicyBindingRequest extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.iam.v3.UpdatePolicyBindingRequest) + UpdatePolicyBindingRequestOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "UpdatePolicyBindingRequest"); + } + + // Use UpdatePolicyBindingRequest.newBuilder() to construct. + private UpdatePolicyBindingRequest(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private UpdatePolicyBindingRequest() {} + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.iam.v3.PolicyBindingsServiceProto + .internal_static_google_iam_v3_UpdatePolicyBindingRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.iam.v3.PolicyBindingsServiceProto + .internal_static_google_iam_v3_UpdatePolicyBindingRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.iam.v3.UpdatePolicyBindingRequest.class, + com.google.iam.v3.UpdatePolicyBindingRequest.Builder.class); + } + + private int bitField0_; + public static final int POLICY_BINDING_FIELD_NUMBER = 1; + private com.google.iam.v3.PolicyBinding policyBinding_; + + /** + * + * + *
        +   * Required. The policy binding to update.
        +   *
        +   * The policy binding's `name` field is used to identify the policy binding to
        +   * update.
        +   * 
        + * + * + * .google.iam.v3.PolicyBinding policy_binding = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the policyBinding field is set. + */ + @java.lang.Override + public boolean hasPolicyBinding() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
        +   * Required. The policy binding to update.
        +   *
        +   * The policy binding's `name` field is used to identify the policy binding to
        +   * update.
        +   * 
        + * + * + * .google.iam.v3.PolicyBinding policy_binding = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The policyBinding. + */ + @java.lang.Override + public com.google.iam.v3.PolicyBinding getPolicyBinding() { + return policyBinding_ == null + ? com.google.iam.v3.PolicyBinding.getDefaultInstance() + : policyBinding_; + } + + /** + * + * + *
        +   * Required. The policy binding to update.
        +   *
        +   * The policy binding's `name` field is used to identify the policy binding to
        +   * update.
        +   * 
        + * + * + * .google.iam.v3.PolicyBinding policy_binding = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.iam.v3.PolicyBindingOrBuilder getPolicyBindingOrBuilder() { + return policyBinding_ == null + ? com.google.iam.v3.PolicyBinding.getDefaultInstance() + : policyBinding_; + } + + public static final int VALIDATE_ONLY_FIELD_NUMBER = 2; + private boolean validateOnly_ = false; + + /** + * + * + *
        +   * Optional. If set, validate the request and preview the update, but do not
        +   * actually post it.
        +   * 
        + * + * bool validate_only = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The validateOnly. + */ + @java.lang.Override + public boolean getValidateOnly() { + return validateOnly_; + } + + public static final int UPDATE_MASK_FIELD_NUMBER = 3; + private com.google.protobuf.FieldMask updateMask_; + + /** + * + * + *
        +   * Optional. The list of fields to update
        +   * 
        + * + * .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. The list of fields to update
        +   * 
        + * + * .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. The list of fields to update
        +   * 
        + * + * .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 (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(1, getPolicyBinding()); + } + if (validateOnly_ != false) { + output.writeBool(2, validateOnly_); + } + 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 (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getPolicyBinding()); + } + if (validateOnly_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(2, validateOnly_); + } + 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.iam.v3.UpdatePolicyBindingRequest)) { + return super.equals(obj); + } + com.google.iam.v3.UpdatePolicyBindingRequest other = + (com.google.iam.v3.UpdatePolicyBindingRequest) obj; + + if (hasPolicyBinding() != other.hasPolicyBinding()) return false; + if (hasPolicyBinding()) { + if (!getPolicyBinding().equals(other.getPolicyBinding())) return false; + } + if (getValidateOnly() != other.getValidateOnly()) 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(); + if (hasPolicyBinding()) { + hash = (37 * hash) + POLICY_BINDING_FIELD_NUMBER; + hash = (53 * hash) + getPolicyBinding().hashCode(); + } + hash = (37 * hash) + VALIDATE_ONLY_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getValidateOnly()); + 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.iam.v3.UpdatePolicyBindingRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.iam.v3.UpdatePolicyBindingRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.iam.v3.UpdatePolicyBindingRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.iam.v3.UpdatePolicyBindingRequest 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.iam.v3.UpdatePolicyBindingRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.iam.v3.UpdatePolicyBindingRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.iam.v3.UpdatePolicyBindingRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.iam.v3.UpdatePolicyBindingRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.iam.v3.UpdatePolicyBindingRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.iam.v3.UpdatePolicyBindingRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.iam.v3.UpdatePolicyBindingRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.iam.v3.UpdatePolicyBindingRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.iam.v3.UpdatePolicyBindingRequest 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
        +   * Request message for UpdatePolicyBinding method.
        +   * 
        + * + * Protobuf type {@code google.iam.v3.UpdatePolicyBindingRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.iam.v3.UpdatePolicyBindingRequest) + com.google.iam.v3.UpdatePolicyBindingRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.iam.v3.PolicyBindingsServiceProto + .internal_static_google_iam_v3_UpdatePolicyBindingRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.iam.v3.PolicyBindingsServiceProto + .internal_static_google_iam_v3_UpdatePolicyBindingRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.iam.v3.UpdatePolicyBindingRequest.class, + com.google.iam.v3.UpdatePolicyBindingRequest.Builder.class); + } + + // Construct using com.google.iam.v3.UpdatePolicyBindingRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetPolicyBindingFieldBuilder(); + internalGetUpdateMaskFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + policyBinding_ = null; + if (policyBindingBuilder_ != null) { + policyBindingBuilder_.dispose(); + policyBindingBuilder_ = null; + } + validateOnly_ = 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.iam.v3.PolicyBindingsServiceProto + .internal_static_google_iam_v3_UpdatePolicyBindingRequest_descriptor; + } + + @java.lang.Override + public com.google.iam.v3.UpdatePolicyBindingRequest getDefaultInstanceForType() { + return com.google.iam.v3.UpdatePolicyBindingRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.iam.v3.UpdatePolicyBindingRequest build() { + com.google.iam.v3.UpdatePolicyBindingRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.iam.v3.UpdatePolicyBindingRequest buildPartial() { + com.google.iam.v3.UpdatePolicyBindingRequest result = + new com.google.iam.v3.UpdatePolicyBindingRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.iam.v3.UpdatePolicyBindingRequest result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.policyBinding_ = + policyBindingBuilder_ == null ? policyBinding_ : policyBindingBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.validateOnly_ = validateOnly_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.updateMask_ = updateMaskBuilder_ == null ? updateMask_ : updateMaskBuilder_.build(); + to_bitField0_ |= 0x00000002; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.iam.v3.UpdatePolicyBindingRequest) { + return mergeFrom((com.google.iam.v3.UpdatePolicyBindingRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.iam.v3.UpdatePolicyBindingRequest other) { + if (other == com.google.iam.v3.UpdatePolicyBindingRequest.getDefaultInstance()) return this; + if (other.hasPolicyBinding()) { + mergePolicyBinding(other.getPolicyBinding()); + } + if (other.getValidateOnly() != false) { + setValidateOnly(other.getValidateOnly()); + } + 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: + { + input.readMessage( + internalGetPolicyBindingFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 16: + { + validateOnly_ = input.readBool(); + bitField0_ |= 0x00000002; + break; + } // case 16 + case 26: + { + input.readMessage( + internalGetUpdateMaskFieldBuilder().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.iam.v3.PolicyBinding policyBinding_; + private com.google.protobuf.SingleFieldBuilder< + com.google.iam.v3.PolicyBinding, + com.google.iam.v3.PolicyBinding.Builder, + com.google.iam.v3.PolicyBindingOrBuilder> + policyBindingBuilder_; + + /** + * + * + *
        +     * Required. The policy binding to update.
        +     *
        +     * The policy binding's `name` field is used to identify the policy binding to
        +     * update.
        +     * 
        + * + * + * .google.iam.v3.PolicyBinding policy_binding = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the policyBinding field is set. + */ + public boolean hasPolicyBinding() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
        +     * Required. The policy binding to update.
        +     *
        +     * The policy binding's `name` field is used to identify the policy binding to
        +     * update.
        +     * 
        + * + * + * .google.iam.v3.PolicyBinding policy_binding = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The policyBinding. + */ + public com.google.iam.v3.PolicyBinding getPolicyBinding() { + if (policyBindingBuilder_ == null) { + return policyBinding_ == null + ? com.google.iam.v3.PolicyBinding.getDefaultInstance() + : policyBinding_; + } else { + return policyBindingBuilder_.getMessage(); + } + } + + /** + * + * + *
        +     * Required. The policy binding to update.
        +     *
        +     * The policy binding's `name` field is used to identify the policy binding to
        +     * update.
        +     * 
        + * + * + * .google.iam.v3.PolicyBinding policy_binding = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setPolicyBinding(com.google.iam.v3.PolicyBinding value) { + if (policyBindingBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + policyBinding_ = value; + } else { + policyBindingBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
        +     * Required. The policy binding to update.
        +     *
        +     * The policy binding's `name` field is used to identify the policy binding to
        +     * update.
        +     * 
        + * + * + * .google.iam.v3.PolicyBinding policy_binding = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setPolicyBinding(com.google.iam.v3.PolicyBinding.Builder builderForValue) { + if (policyBindingBuilder_ == null) { + policyBinding_ = builderForValue.build(); + } else { + policyBindingBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
        +     * Required. The policy binding to update.
        +     *
        +     * The policy binding's `name` field is used to identify the policy binding to
        +     * update.
        +     * 
        + * + * + * .google.iam.v3.PolicyBinding policy_binding = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergePolicyBinding(com.google.iam.v3.PolicyBinding value) { + if (policyBindingBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) + && policyBinding_ != null + && policyBinding_ != com.google.iam.v3.PolicyBinding.getDefaultInstance()) { + getPolicyBindingBuilder().mergeFrom(value); + } else { + policyBinding_ = value; + } + } else { + policyBindingBuilder_.mergeFrom(value); + } + if (policyBinding_ != null) { + bitField0_ |= 0x00000001; + onChanged(); + } + return this; + } + + /** + * + * + *
        +     * Required. The policy binding to update.
        +     *
        +     * The policy binding's `name` field is used to identify the policy binding to
        +     * update.
        +     * 
        + * + * + * .google.iam.v3.PolicyBinding policy_binding = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearPolicyBinding() { + bitField0_ = (bitField0_ & ~0x00000001); + policyBinding_ = null; + if (policyBindingBuilder_ != null) { + policyBindingBuilder_.dispose(); + policyBindingBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
        +     * Required. The policy binding to update.
        +     *
        +     * The policy binding's `name` field is used to identify the policy binding to
        +     * update.
        +     * 
        + * + * + * .google.iam.v3.PolicyBinding policy_binding = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.iam.v3.PolicyBinding.Builder getPolicyBindingBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return internalGetPolicyBindingFieldBuilder().getBuilder(); + } + + /** + * + * + *
        +     * Required. The policy binding to update.
        +     *
        +     * The policy binding's `name` field is used to identify the policy binding to
        +     * update.
        +     * 
        + * + * + * .google.iam.v3.PolicyBinding policy_binding = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.iam.v3.PolicyBindingOrBuilder getPolicyBindingOrBuilder() { + if (policyBindingBuilder_ != null) { + return policyBindingBuilder_.getMessageOrBuilder(); + } else { + return policyBinding_ == null + ? com.google.iam.v3.PolicyBinding.getDefaultInstance() + : policyBinding_; + } + } + + /** + * + * + *
        +     * Required. The policy binding to update.
        +     *
        +     * The policy binding's `name` field is used to identify the policy binding to
        +     * update.
        +     * 
        + * + * + * .google.iam.v3.PolicyBinding policy_binding = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.iam.v3.PolicyBinding, + com.google.iam.v3.PolicyBinding.Builder, + com.google.iam.v3.PolicyBindingOrBuilder> + internalGetPolicyBindingFieldBuilder() { + if (policyBindingBuilder_ == null) { + policyBindingBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.iam.v3.PolicyBinding, + com.google.iam.v3.PolicyBinding.Builder, + com.google.iam.v3.PolicyBindingOrBuilder>( + getPolicyBinding(), getParentForChildren(), isClean()); + policyBinding_ = null; + } + return policyBindingBuilder_; + } + + private boolean validateOnly_; + + /** + * + * + *
        +     * Optional. If set, validate the request and preview the update, but do not
        +     * actually post it.
        +     * 
        + * + * bool validate_only = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The validateOnly. + */ + @java.lang.Override + public boolean getValidateOnly() { + return validateOnly_; + } + + /** + * + * + *
        +     * Optional. If set, validate the request and preview the update, but do not
        +     * actually post it.
        +     * 
        + * + * bool validate_only = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The validateOnly to set. + * @return This builder for chaining. + */ + public Builder setValidateOnly(boolean value) { + + validateOnly_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
        +     * Optional. If set, validate the request and preview the update, but do not
        +     * actually post it.
        +     * 
        + * + * bool validate_only = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearValidateOnly() { + bitField0_ = (bitField0_ & ~0x00000002); + validateOnly_ = false; + onChanged(); + return this; + } + + private com.google.protobuf.FieldMask updateMask_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder> + updateMaskBuilder_; + + /** + * + * + *
        +     * Optional. The list of fields to update
        +     * 
        + * + * .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. The list of fields to update
        +     * 
        + * + * .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. The list of fields to update
        +     * 
        + * + * .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. The list of fields to update
        +     * 
        + * + * .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. The list of fields to update
        +     * 
        + * + * .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. The list of fields to update
        +     * 
        + * + * .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. The list of fields to update
        +     * 
        + * + * .google.protobuf.FieldMask update_mask = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.protobuf.FieldMask.Builder getUpdateMaskBuilder() { + bitField0_ |= 0x00000004; + onChanged(); + return internalGetUpdateMaskFieldBuilder().getBuilder(); + } + + /** + * + * + *
        +     * Optional. The list of fields to update
        +     * 
        + * + * .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. The list of fields to update
        +     * 
        + * + * .google.protobuf.FieldMask update_mask = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder> + internalGetUpdateMaskFieldBuilder() { + if (updateMaskBuilder_ == null) { + updateMaskBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder>( + getUpdateMask(), getParentForChildren(), isClean()); + updateMask_ = null; + } + return updateMaskBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.iam.v3.UpdatePolicyBindingRequest) + } + + // @@protoc_insertion_point(class_scope:google.iam.v3.UpdatePolicyBindingRequest) + private static final com.google.iam.v3.UpdatePolicyBindingRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.iam.v3.UpdatePolicyBindingRequest(); + } + + public static com.google.iam.v3.UpdatePolicyBindingRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public UpdatePolicyBindingRequest 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.iam.v3.UpdatePolicyBindingRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-iam/proto-google-iam-v3/src/main/java/com/google/iam/v3/UpdatePolicyBindingRequestOrBuilder.java b/java-iam/proto-google-iam-v3/src/main/java/com/google/iam/v3/UpdatePolicyBindingRequestOrBuilder.java new file mode 100644 index 0000000000..895cc31d96 --- /dev/null +++ b/java-iam/proto-google-iam-v3/src/main/java/com/google/iam/v3/UpdatePolicyBindingRequestOrBuilder.java @@ -0,0 +1,134 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/iam/v3/policy_bindings_service.proto +// Protobuf Java Version: 4.33.2 + +package com.google.iam.v3; + +@com.google.protobuf.Generated +public interface UpdatePolicyBindingRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.iam.v3.UpdatePolicyBindingRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
        +   * Required. The policy binding to update.
        +   *
        +   * The policy binding's `name` field is used to identify the policy binding to
        +   * update.
        +   * 
        + * + * + * .google.iam.v3.PolicyBinding policy_binding = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the policyBinding field is set. + */ + boolean hasPolicyBinding(); + + /** + * + * + *
        +   * Required. The policy binding to update.
        +   *
        +   * The policy binding's `name` field is used to identify the policy binding to
        +   * update.
        +   * 
        + * + * + * .google.iam.v3.PolicyBinding policy_binding = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The policyBinding. + */ + com.google.iam.v3.PolicyBinding getPolicyBinding(); + + /** + * + * + *
        +   * Required. The policy binding to update.
        +   *
        +   * The policy binding's `name` field is used to identify the policy binding to
        +   * update.
        +   * 
        + * + * + * .google.iam.v3.PolicyBinding policy_binding = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.iam.v3.PolicyBindingOrBuilder getPolicyBindingOrBuilder(); + + /** + * + * + *
        +   * Optional. If set, validate the request and preview the update, but do not
        +   * actually post it.
        +   * 
        + * + * bool validate_only = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The validateOnly. + */ + boolean getValidateOnly(); + + /** + * + * + *
        +   * Optional. The list of fields to update
        +   * 
        + * + * .google.protobuf.FieldMask update_mask = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the updateMask field is set. + */ + boolean hasUpdateMask(); + + /** + * + * + *
        +   * Optional. The list of fields to update
        +   * 
        + * + * .google.protobuf.FieldMask update_mask = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The updateMask. + */ + com.google.protobuf.FieldMask getUpdateMask(); + + /** + * + * + *
        +   * Optional. The list of fields to update
        +   * 
        + * + * .google.protobuf.FieldMask update_mask = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder(); +} diff --git a/java-iam/proto-google-iam-v3/src/main/java/com/google/iam/v3/UpdatePrincipalAccessBoundaryPolicyRequest.java b/java-iam/proto-google-iam-v3/src/main/java/com/google/iam/v3/UpdatePrincipalAccessBoundaryPolicyRequest.java new file mode 100644 index 0000000000..e307514bc0 --- /dev/null +++ b/java-iam/proto-google-iam-v3/src/main/java/com/google/iam/v3/UpdatePrincipalAccessBoundaryPolicyRequest.java @@ -0,0 +1,1172 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/iam/v3/principal_access_boundary_policies_service.proto +// Protobuf Java Version: 4.33.2 + +package com.google.iam.v3; + +/** + * + * + *
        + * Request message for UpdatePrincipalAccessBoundaryPolicy method.
        + * 
        + * + * Protobuf type {@code google.iam.v3.UpdatePrincipalAccessBoundaryPolicyRequest} + */ +@com.google.protobuf.Generated +public final class UpdatePrincipalAccessBoundaryPolicyRequest + extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.iam.v3.UpdatePrincipalAccessBoundaryPolicyRequest) + UpdatePrincipalAccessBoundaryPolicyRequestOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "UpdatePrincipalAccessBoundaryPolicyRequest"); + } + + // Use UpdatePrincipalAccessBoundaryPolicyRequest.newBuilder() to construct. + private UpdatePrincipalAccessBoundaryPolicyRequest( + com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private UpdatePrincipalAccessBoundaryPolicyRequest() {} + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.iam.v3.PrincipalAccessBoundaryPoliciesServiceProto + .internal_static_google_iam_v3_UpdatePrincipalAccessBoundaryPolicyRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.iam.v3.PrincipalAccessBoundaryPoliciesServiceProto + .internal_static_google_iam_v3_UpdatePrincipalAccessBoundaryPolicyRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.iam.v3.UpdatePrincipalAccessBoundaryPolicyRequest.class, + com.google.iam.v3.UpdatePrincipalAccessBoundaryPolicyRequest.Builder.class); + } + + private int bitField0_; + public static final int PRINCIPAL_ACCESS_BOUNDARY_POLICY_FIELD_NUMBER = 1; + private com.google.iam.v3.PrincipalAccessBoundaryPolicy principalAccessBoundaryPolicy_; + + /** + * + * + *
        +   * Required. The principal access boundary policy to update.
        +   *
        +   * The principal access boundary policy's `name` field is used to identify the
        +   * policy to update.
        +   * 
        + * + * + * .google.iam.v3.PrincipalAccessBoundaryPolicy principal_access_boundary_policy = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the principalAccessBoundaryPolicy field is set. + */ + @java.lang.Override + public boolean hasPrincipalAccessBoundaryPolicy() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
        +   * Required. The principal access boundary policy to update.
        +   *
        +   * The principal access boundary policy's `name` field is used to identify the
        +   * policy to update.
        +   * 
        + * + * + * .google.iam.v3.PrincipalAccessBoundaryPolicy principal_access_boundary_policy = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The principalAccessBoundaryPolicy. + */ + @java.lang.Override + public com.google.iam.v3.PrincipalAccessBoundaryPolicy getPrincipalAccessBoundaryPolicy() { + return principalAccessBoundaryPolicy_ == null + ? com.google.iam.v3.PrincipalAccessBoundaryPolicy.getDefaultInstance() + : principalAccessBoundaryPolicy_; + } + + /** + * + * + *
        +   * Required. The principal access boundary policy to update.
        +   *
        +   * The principal access boundary policy's `name` field is used to identify the
        +   * policy to update.
        +   * 
        + * + * + * .google.iam.v3.PrincipalAccessBoundaryPolicy principal_access_boundary_policy = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.iam.v3.PrincipalAccessBoundaryPolicyOrBuilder + getPrincipalAccessBoundaryPolicyOrBuilder() { + return principalAccessBoundaryPolicy_ == null + ? com.google.iam.v3.PrincipalAccessBoundaryPolicy.getDefaultInstance() + : principalAccessBoundaryPolicy_; + } + + public static final int VALIDATE_ONLY_FIELD_NUMBER = 2; + private boolean validateOnly_ = false; + + /** + * + * + *
        +   * Optional. If set, validate the request and preview the update, but do not
        +   * actually post it.
        +   * 
        + * + * bool validate_only = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The validateOnly. + */ + @java.lang.Override + public boolean getValidateOnly() { + return validateOnly_; + } + + public static final int UPDATE_MASK_FIELD_NUMBER = 3; + private com.google.protobuf.FieldMask updateMask_; + + /** + * + * + *
        +   * Optional. The list of fields to update
        +   * 
        + * + * .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. The list of fields to update
        +   * 
        + * + * .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. The list of fields to update
        +   * 
        + * + * .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 (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(1, getPrincipalAccessBoundaryPolicy()); + } + if (validateOnly_ != false) { + output.writeBool(2, validateOnly_); + } + 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 (((bitField0_ & 0x00000001) != 0)) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 1, getPrincipalAccessBoundaryPolicy()); + } + if (validateOnly_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(2, validateOnly_); + } + 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.iam.v3.UpdatePrincipalAccessBoundaryPolicyRequest)) { + return super.equals(obj); + } + com.google.iam.v3.UpdatePrincipalAccessBoundaryPolicyRequest other = + (com.google.iam.v3.UpdatePrincipalAccessBoundaryPolicyRequest) obj; + + if (hasPrincipalAccessBoundaryPolicy() != other.hasPrincipalAccessBoundaryPolicy()) + return false; + if (hasPrincipalAccessBoundaryPolicy()) { + if (!getPrincipalAccessBoundaryPolicy().equals(other.getPrincipalAccessBoundaryPolicy())) + return false; + } + if (getValidateOnly() != other.getValidateOnly()) 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(); + if (hasPrincipalAccessBoundaryPolicy()) { + hash = (37 * hash) + PRINCIPAL_ACCESS_BOUNDARY_POLICY_FIELD_NUMBER; + hash = (53 * hash) + getPrincipalAccessBoundaryPolicy().hashCode(); + } + hash = (37 * hash) + VALIDATE_ONLY_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getValidateOnly()); + 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.iam.v3.UpdatePrincipalAccessBoundaryPolicyRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.iam.v3.UpdatePrincipalAccessBoundaryPolicyRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.iam.v3.UpdatePrincipalAccessBoundaryPolicyRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.iam.v3.UpdatePrincipalAccessBoundaryPolicyRequest 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.iam.v3.UpdatePrincipalAccessBoundaryPolicyRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.iam.v3.UpdatePrincipalAccessBoundaryPolicyRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.iam.v3.UpdatePrincipalAccessBoundaryPolicyRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.iam.v3.UpdatePrincipalAccessBoundaryPolicyRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.iam.v3.UpdatePrincipalAccessBoundaryPolicyRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.iam.v3.UpdatePrincipalAccessBoundaryPolicyRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.iam.v3.UpdatePrincipalAccessBoundaryPolicyRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.iam.v3.UpdatePrincipalAccessBoundaryPolicyRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.iam.v3.UpdatePrincipalAccessBoundaryPolicyRequest 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
        +   * Request message for UpdatePrincipalAccessBoundaryPolicy method.
        +   * 
        + * + * Protobuf type {@code google.iam.v3.UpdatePrincipalAccessBoundaryPolicyRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.iam.v3.UpdatePrincipalAccessBoundaryPolicyRequest) + com.google.iam.v3.UpdatePrincipalAccessBoundaryPolicyRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.iam.v3.PrincipalAccessBoundaryPoliciesServiceProto + .internal_static_google_iam_v3_UpdatePrincipalAccessBoundaryPolicyRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.iam.v3.PrincipalAccessBoundaryPoliciesServiceProto + .internal_static_google_iam_v3_UpdatePrincipalAccessBoundaryPolicyRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.iam.v3.UpdatePrincipalAccessBoundaryPolicyRequest.class, + com.google.iam.v3.UpdatePrincipalAccessBoundaryPolicyRequest.Builder.class); + } + + // Construct using com.google.iam.v3.UpdatePrincipalAccessBoundaryPolicyRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetPrincipalAccessBoundaryPolicyFieldBuilder(); + internalGetUpdateMaskFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + principalAccessBoundaryPolicy_ = null; + if (principalAccessBoundaryPolicyBuilder_ != null) { + principalAccessBoundaryPolicyBuilder_.dispose(); + principalAccessBoundaryPolicyBuilder_ = null; + } + validateOnly_ = 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.iam.v3.PrincipalAccessBoundaryPoliciesServiceProto + .internal_static_google_iam_v3_UpdatePrincipalAccessBoundaryPolicyRequest_descriptor; + } + + @java.lang.Override + public com.google.iam.v3.UpdatePrincipalAccessBoundaryPolicyRequest + getDefaultInstanceForType() { + return com.google.iam.v3.UpdatePrincipalAccessBoundaryPolicyRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.iam.v3.UpdatePrincipalAccessBoundaryPolicyRequest build() { + com.google.iam.v3.UpdatePrincipalAccessBoundaryPolicyRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.iam.v3.UpdatePrincipalAccessBoundaryPolicyRequest buildPartial() { + com.google.iam.v3.UpdatePrincipalAccessBoundaryPolicyRequest result = + new com.google.iam.v3.UpdatePrincipalAccessBoundaryPolicyRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.iam.v3.UpdatePrincipalAccessBoundaryPolicyRequest result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.principalAccessBoundaryPolicy_ = + principalAccessBoundaryPolicyBuilder_ == null + ? principalAccessBoundaryPolicy_ + : principalAccessBoundaryPolicyBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.validateOnly_ = validateOnly_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.updateMask_ = updateMaskBuilder_ == null ? updateMask_ : updateMaskBuilder_.build(); + to_bitField0_ |= 0x00000002; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.iam.v3.UpdatePrincipalAccessBoundaryPolicyRequest) { + return mergeFrom((com.google.iam.v3.UpdatePrincipalAccessBoundaryPolicyRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.iam.v3.UpdatePrincipalAccessBoundaryPolicyRequest other) { + if (other + == com.google.iam.v3.UpdatePrincipalAccessBoundaryPolicyRequest.getDefaultInstance()) + return this; + if (other.hasPrincipalAccessBoundaryPolicy()) { + mergePrincipalAccessBoundaryPolicy(other.getPrincipalAccessBoundaryPolicy()); + } + if (other.getValidateOnly() != false) { + setValidateOnly(other.getValidateOnly()); + } + 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: + { + input.readMessage( + internalGetPrincipalAccessBoundaryPolicyFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 16: + { + validateOnly_ = input.readBool(); + bitField0_ |= 0x00000002; + break; + } // case 16 + case 26: + { + input.readMessage( + internalGetUpdateMaskFieldBuilder().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.iam.v3.PrincipalAccessBoundaryPolicy principalAccessBoundaryPolicy_; + private com.google.protobuf.SingleFieldBuilder< + com.google.iam.v3.PrincipalAccessBoundaryPolicy, + com.google.iam.v3.PrincipalAccessBoundaryPolicy.Builder, + com.google.iam.v3.PrincipalAccessBoundaryPolicyOrBuilder> + principalAccessBoundaryPolicyBuilder_; + + /** + * + * + *
        +     * Required. The principal access boundary policy to update.
        +     *
        +     * The principal access boundary policy's `name` field is used to identify the
        +     * policy to update.
        +     * 
        + * + * + * .google.iam.v3.PrincipalAccessBoundaryPolicy principal_access_boundary_policy = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the principalAccessBoundaryPolicy field is set. + */ + public boolean hasPrincipalAccessBoundaryPolicy() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
        +     * Required. The principal access boundary policy to update.
        +     *
        +     * The principal access boundary policy's `name` field is used to identify the
        +     * policy to update.
        +     * 
        + * + * + * .google.iam.v3.PrincipalAccessBoundaryPolicy principal_access_boundary_policy = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The principalAccessBoundaryPolicy. + */ + public com.google.iam.v3.PrincipalAccessBoundaryPolicy getPrincipalAccessBoundaryPolicy() { + if (principalAccessBoundaryPolicyBuilder_ == null) { + return principalAccessBoundaryPolicy_ == null + ? com.google.iam.v3.PrincipalAccessBoundaryPolicy.getDefaultInstance() + : principalAccessBoundaryPolicy_; + } else { + return principalAccessBoundaryPolicyBuilder_.getMessage(); + } + } + + /** + * + * + *
        +     * Required. The principal access boundary policy to update.
        +     *
        +     * The principal access boundary policy's `name` field is used to identify the
        +     * policy to update.
        +     * 
        + * + * + * .google.iam.v3.PrincipalAccessBoundaryPolicy principal_access_boundary_policy = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setPrincipalAccessBoundaryPolicy( + com.google.iam.v3.PrincipalAccessBoundaryPolicy value) { + if (principalAccessBoundaryPolicyBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + principalAccessBoundaryPolicy_ = value; + } else { + principalAccessBoundaryPolicyBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
        +     * Required. The principal access boundary policy to update.
        +     *
        +     * The principal access boundary policy's `name` field is used to identify the
        +     * policy to update.
        +     * 
        + * + * + * .google.iam.v3.PrincipalAccessBoundaryPolicy principal_access_boundary_policy = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setPrincipalAccessBoundaryPolicy( + com.google.iam.v3.PrincipalAccessBoundaryPolicy.Builder builderForValue) { + if (principalAccessBoundaryPolicyBuilder_ == null) { + principalAccessBoundaryPolicy_ = builderForValue.build(); + } else { + principalAccessBoundaryPolicyBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
        +     * Required. The principal access boundary policy to update.
        +     *
        +     * The principal access boundary policy's `name` field is used to identify the
        +     * policy to update.
        +     * 
        + * + * + * .google.iam.v3.PrincipalAccessBoundaryPolicy principal_access_boundary_policy = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergePrincipalAccessBoundaryPolicy( + com.google.iam.v3.PrincipalAccessBoundaryPolicy value) { + if (principalAccessBoundaryPolicyBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) + && principalAccessBoundaryPolicy_ != null + && principalAccessBoundaryPolicy_ + != com.google.iam.v3.PrincipalAccessBoundaryPolicy.getDefaultInstance()) { + getPrincipalAccessBoundaryPolicyBuilder().mergeFrom(value); + } else { + principalAccessBoundaryPolicy_ = value; + } + } else { + principalAccessBoundaryPolicyBuilder_.mergeFrom(value); + } + if (principalAccessBoundaryPolicy_ != null) { + bitField0_ |= 0x00000001; + onChanged(); + } + return this; + } + + /** + * + * + *
        +     * Required. The principal access boundary policy to update.
        +     *
        +     * The principal access boundary policy's `name` field is used to identify the
        +     * policy to update.
        +     * 
        + * + * + * .google.iam.v3.PrincipalAccessBoundaryPolicy principal_access_boundary_policy = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearPrincipalAccessBoundaryPolicy() { + bitField0_ = (bitField0_ & ~0x00000001); + principalAccessBoundaryPolicy_ = null; + if (principalAccessBoundaryPolicyBuilder_ != null) { + principalAccessBoundaryPolicyBuilder_.dispose(); + principalAccessBoundaryPolicyBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
        +     * Required. The principal access boundary policy to update.
        +     *
        +     * The principal access boundary policy's `name` field is used to identify the
        +     * policy to update.
        +     * 
        + * + * + * .google.iam.v3.PrincipalAccessBoundaryPolicy principal_access_boundary_policy = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.iam.v3.PrincipalAccessBoundaryPolicy.Builder + getPrincipalAccessBoundaryPolicyBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return internalGetPrincipalAccessBoundaryPolicyFieldBuilder().getBuilder(); + } + + /** + * + * + *
        +     * Required. The principal access boundary policy to update.
        +     *
        +     * The principal access boundary policy's `name` field is used to identify the
        +     * policy to update.
        +     * 
        + * + * + * .google.iam.v3.PrincipalAccessBoundaryPolicy principal_access_boundary_policy = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.iam.v3.PrincipalAccessBoundaryPolicyOrBuilder + getPrincipalAccessBoundaryPolicyOrBuilder() { + if (principalAccessBoundaryPolicyBuilder_ != null) { + return principalAccessBoundaryPolicyBuilder_.getMessageOrBuilder(); + } else { + return principalAccessBoundaryPolicy_ == null + ? com.google.iam.v3.PrincipalAccessBoundaryPolicy.getDefaultInstance() + : principalAccessBoundaryPolicy_; + } + } + + /** + * + * + *
        +     * Required. The principal access boundary policy to update.
        +     *
        +     * The principal access boundary policy's `name` field is used to identify the
        +     * policy to update.
        +     * 
        + * + * + * .google.iam.v3.PrincipalAccessBoundaryPolicy principal_access_boundary_policy = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.iam.v3.PrincipalAccessBoundaryPolicy, + com.google.iam.v3.PrincipalAccessBoundaryPolicy.Builder, + com.google.iam.v3.PrincipalAccessBoundaryPolicyOrBuilder> + internalGetPrincipalAccessBoundaryPolicyFieldBuilder() { + if (principalAccessBoundaryPolicyBuilder_ == null) { + principalAccessBoundaryPolicyBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.iam.v3.PrincipalAccessBoundaryPolicy, + com.google.iam.v3.PrincipalAccessBoundaryPolicy.Builder, + com.google.iam.v3.PrincipalAccessBoundaryPolicyOrBuilder>( + getPrincipalAccessBoundaryPolicy(), getParentForChildren(), isClean()); + principalAccessBoundaryPolicy_ = null; + } + return principalAccessBoundaryPolicyBuilder_; + } + + private boolean validateOnly_; + + /** + * + * + *
        +     * Optional. If set, validate the request and preview the update, but do not
        +     * actually post it.
        +     * 
        + * + * bool validate_only = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The validateOnly. + */ + @java.lang.Override + public boolean getValidateOnly() { + return validateOnly_; + } + + /** + * + * + *
        +     * Optional. If set, validate the request and preview the update, but do not
        +     * actually post it.
        +     * 
        + * + * bool validate_only = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The validateOnly to set. + * @return This builder for chaining. + */ + public Builder setValidateOnly(boolean value) { + + validateOnly_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
        +     * Optional. If set, validate the request and preview the update, but do not
        +     * actually post it.
        +     * 
        + * + * bool validate_only = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearValidateOnly() { + bitField0_ = (bitField0_ & ~0x00000002); + validateOnly_ = false; + onChanged(); + return this; + } + + private com.google.protobuf.FieldMask updateMask_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder> + updateMaskBuilder_; + + /** + * + * + *
        +     * Optional. The list of fields to update
        +     * 
        + * + * .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. The list of fields to update
        +     * 
        + * + * .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. The list of fields to update
        +     * 
        + * + * .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. The list of fields to update
        +     * 
        + * + * .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. The list of fields to update
        +     * 
        + * + * .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. The list of fields to update
        +     * 
        + * + * .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. The list of fields to update
        +     * 
        + * + * .google.protobuf.FieldMask update_mask = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.protobuf.FieldMask.Builder getUpdateMaskBuilder() { + bitField0_ |= 0x00000004; + onChanged(); + return internalGetUpdateMaskFieldBuilder().getBuilder(); + } + + /** + * + * + *
        +     * Optional. The list of fields to update
        +     * 
        + * + * .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. The list of fields to update
        +     * 
        + * + * .google.protobuf.FieldMask update_mask = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder> + internalGetUpdateMaskFieldBuilder() { + if (updateMaskBuilder_ == null) { + updateMaskBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder>( + getUpdateMask(), getParentForChildren(), isClean()); + updateMask_ = null; + } + return updateMaskBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.iam.v3.UpdatePrincipalAccessBoundaryPolicyRequest) + } + + // @@protoc_insertion_point(class_scope:google.iam.v3.UpdatePrincipalAccessBoundaryPolicyRequest) + private static final com.google.iam.v3.UpdatePrincipalAccessBoundaryPolicyRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.iam.v3.UpdatePrincipalAccessBoundaryPolicyRequest(); + } + + public static com.google.iam.v3.UpdatePrincipalAccessBoundaryPolicyRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public UpdatePrincipalAccessBoundaryPolicyRequest 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.iam.v3.UpdatePrincipalAccessBoundaryPolicyRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-iam/proto-google-iam-v3/src/main/java/com/google/iam/v3/UpdatePrincipalAccessBoundaryPolicyRequestOrBuilder.java b/java-iam/proto-google-iam-v3/src/main/java/com/google/iam/v3/UpdatePrincipalAccessBoundaryPolicyRequestOrBuilder.java new file mode 100644 index 0000000000..24822fc663 --- /dev/null +++ b/java-iam/proto-google-iam-v3/src/main/java/com/google/iam/v3/UpdatePrincipalAccessBoundaryPolicyRequestOrBuilder.java @@ -0,0 +1,135 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/iam/v3/principal_access_boundary_policies_service.proto +// Protobuf Java Version: 4.33.2 + +package com.google.iam.v3; + +@com.google.protobuf.Generated +public interface UpdatePrincipalAccessBoundaryPolicyRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.iam.v3.UpdatePrincipalAccessBoundaryPolicyRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
        +   * Required. The principal access boundary policy to update.
        +   *
        +   * The principal access boundary policy's `name` field is used to identify the
        +   * policy to update.
        +   * 
        + * + * + * .google.iam.v3.PrincipalAccessBoundaryPolicy principal_access_boundary_policy = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the principalAccessBoundaryPolicy field is set. + */ + boolean hasPrincipalAccessBoundaryPolicy(); + + /** + * + * + *
        +   * Required. The principal access boundary policy to update.
        +   *
        +   * The principal access boundary policy's `name` field is used to identify the
        +   * policy to update.
        +   * 
        + * + * + * .google.iam.v3.PrincipalAccessBoundaryPolicy principal_access_boundary_policy = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The principalAccessBoundaryPolicy. + */ + com.google.iam.v3.PrincipalAccessBoundaryPolicy getPrincipalAccessBoundaryPolicy(); + + /** + * + * + *
        +   * Required. The principal access boundary policy to update.
        +   *
        +   * The principal access boundary policy's `name` field is used to identify the
        +   * policy to update.
        +   * 
        + * + * + * .google.iam.v3.PrincipalAccessBoundaryPolicy principal_access_boundary_policy = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.iam.v3.PrincipalAccessBoundaryPolicyOrBuilder + getPrincipalAccessBoundaryPolicyOrBuilder(); + + /** + * + * + *
        +   * Optional. If set, validate the request and preview the update, but do not
        +   * actually post it.
        +   * 
        + * + * bool validate_only = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The validateOnly. + */ + boolean getValidateOnly(); + + /** + * + * + *
        +   * Optional. The list of fields to update
        +   * 
        + * + * .google.protobuf.FieldMask update_mask = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the updateMask field is set. + */ + boolean hasUpdateMask(); + + /** + * + * + *
        +   * Optional. The list of fields to update
        +   * 
        + * + * .google.protobuf.FieldMask update_mask = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The updateMask. + */ + com.google.protobuf.FieldMask getUpdateMask(); + + /** + * + * + *
        +   * Optional. The list of fields to update
        +   * 
        + * + * .google.protobuf.FieldMask update_mask = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder(); +} diff --git a/java-iam/proto-google-iam-v3/src/main/proto/google/iam/v3/operation_metadata.proto b/java-iam/proto-google-iam-v3/src/main/proto/google/iam/v3/operation_metadata.proto new file mode 100644 index 0000000000..b386590289 --- /dev/null +++ b/java-iam/proto-google-iam-v3/src/main/proto/google/iam/v3/operation_metadata.proto @@ -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. + +syntax = "proto3"; + +package google.iam.v3; + +import "google/api/field_behavior.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.Iam.V3"; +option go_package = "cloud.google.com/go/iam/apiv3/iampb;iampb"; +option java_multiple_files = true; +option java_outer_classname = "OperationMetadataProto"; +option java_package = "com.google.iam.v3"; +option php_namespace = "Google\\Cloud\\Iam\\V3"; + +// Represents the metadata of the long-running operation. +message OperationMetadata { + // Output only. The time the operation was created. + google.protobuf.Timestamp create_time = 1 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The time the operation finished running. + google.protobuf.Timestamp end_time = 2 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Server-defined resource path for the target of the + string target = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Name of the verb executed by the operation. + string verb = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Human-readable status of the operation, if any. + string status_message = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Identifies whether the user has requested cancellation + // of the operation. Operations that have successfully been cancelled + // have [Operation.error][] value with a + // [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to + // `Code.CANCELLED`. + bool requested_cancellation = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. API version used to start the operation. + string api_version = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; +} diff --git a/java-iam/proto-google-iam-v3/src/main/proto/google/iam/v3/policy_binding_resources.proto b/java-iam/proto-google-iam-v3/src/main/proto/google/iam/v3/policy_binding_resources.proto new file mode 100644 index 0000000000..34bf1b7fa9 --- /dev/null +++ b/java-iam/proto-google-iam-v3/src/main/proto/google/iam/v3/policy_binding_resources.proto @@ -0,0 +1,185 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.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.iam.v3; + +import "google/api/field_behavior.proto"; +import "google/api/field_info.proto"; +import "google/api/resource.proto"; +import "google/protobuf/timestamp.proto"; +import "google/type/expr.proto"; + +option csharp_namespace = "Google.Cloud.Iam.V3"; +option go_package = "cloud.google.com/go/iam/apiv3/iampb;iampb"; +option java_multiple_files = true; +option java_outer_classname = "PolicyBindingResourcesProto"; +option java_package = "com.google.iam.v3"; +option php_namespace = "Google\\Cloud\\Iam\\V3"; + +// IAM policy binding resource. +message PolicyBinding { + option (google.api.resource) = { + type: "iam.googleapis.com/PolicyBinding" + pattern: "organizations/{organization}/locations/{location}/policyBindings/{policy_binding}" + pattern: "folders/{folder}/locations/{location}/policyBindings/{policy_binding}" + pattern: "projects/{project}/locations/{location}/policyBindings/{policy_binding}" + plural: "policyBindings" + singular: "policyBinding" + }; + + // Target is the full resource name of the resource to which the policy will + // be bound. Immutable once set. + message Target { + // The different types of targets that can be bound to a policy. + oneof target { + // Immutable. Full Resource Name used for principal access boundary policy + // bindings. The principal set must be directly parented by the policy + // binding's parent or same as the parent if the target is a + // project/folder/organization. + // + // Examples: + // * For binding's parented by an organization: + // * Organization: + // `//cloudresourcemanager.googleapis.com/organizations/ORGANIZATION_ID` + // * Workforce Identity: + // `//iam.googleapis.com/locations/global/workforcePools/WORKFORCE_POOL_ID` + // * Workspace Identity: + // `//iam.googleapis.com/locations/global/workspace/WORKSPACE_ID` + // * For binding's parented by a folder: + // * Folder: + // `//cloudresourcemanager.googleapis.com/folders/FOLDER_ID` + // * For binding's parented by a project: + // * Project: + // * `//cloudresourcemanager.googleapis.com/projects/PROJECT_NUMBER` + // * `//cloudresourcemanager.googleapis.com/projects/PROJECT_ID` + // * Workload Identity Pool: + // `//iam.googleapis.com/projects/PROJECT_NUMBER/locations/LOCATION/workloadIdentityPools/WORKLOAD_POOL_ID` + string principal_set = 1 [(google.api.field_behavior) = IMMUTABLE]; + } + } + + // Different policy kinds supported in this binding. + enum PolicyKind { + // Unspecified policy kind; Not a valid state + POLICY_KIND_UNSPECIFIED = 0; + + // Principal access boundary policy kind + PRINCIPAL_ACCESS_BOUNDARY = 1; + } + + // Identifier. The name of the policy binding, in the format + // `{binding_parent/locations/{location}/policyBindings/{policy_binding_id}`. + // The binding parent is the closest Resource Manager resource (project, + // folder, or organization) to the binding target. + // + // Format: + // + // * `projects/{project_id}/locations/{location}/policyBindings/{policy_binding_id}` + // * `projects/{project_number}/locations/{location}/policyBindings/{policy_binding_id}` + // * `folders/{folder_id}/locations/{location}/policyBindings/{policy_binding_id}` + // * `organizations/{organization_id}/locations/{location}/policyBindings/{policy_binding_id}` + string name = 1 [(google.api.field_behavior) = IDENTIFIER]; + + // Output only. The globally unique ID of the policy binding. Assigned when + // the policy binding is created. + string uid = 2 [ + (google.api.field_info).format = UUID4, + (google.api.field_behavior) = OUTPUT_ONLY + ]; + + // Optional. The etag for the policy binding. + // If this is provided on update, it must match the server's etag. + string etag = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The description of the policy binding. Must be less than or equal + // to 63 characters. + string display_name = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. User-defined annotations. See + // https://google.aip.dev/148#annotations for more details such as format and + // size limitations + map annotations = 5 [(google.api.field_behavior) = OPTIONAL]; + + // Required. Immutable. Target is the full resource name of the resource to + // which the policy will be bound. Immutable once set. + Target target = 6 [ + (google.api.field_behavior) = IMMUTABLE, + (google.api.field_behavior) = REQUIRED + ]; + + // Immutable. The kind of the policy to attach in this binding. This field + // must be one of the following: + // + // - Left empty (will be automatically set to the policy kind) + // - The input policy kind + PolicyKind policy_kind = 11 [(google.api.field_behavior) = IMMUTABLE]; + + // Required. Immutable. The resource name of the policy to be bound. The + // binding parent and policy must belong to the same organization. + string policy = 7 [ + (google.api.field_behavior) = IMMUTABLE, + (google.api.field_behavior) = REQUIRED + ]; + + // Output only. The globally unique ID of the policy to be bound. + string policy_uid = 12 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. The condition to apply to the policy binding. When set, the + // `expression` field in the `Expr` must include from 1 to 10 subexpressions, + // joined by the + // "||"(Logical OR), "&&"(Logical AND) or "!"(Logical NOT) operators and + // cannot contain more than 250 characters. + // + // The condition is currently only supported when bound to policies of kind + // principal access boundary. + // + // When the bound policy is a principal access boundary policy, the only + // supported attributes in any subexpression are `principal.type` and + // `principal.subject`. An example expression is: "principal.type == + // 'iam.googleapis.com/ServiceAccount'" or "principal.subject == + // 'bob@example.com'". + // + // Allowed operations for `principal.subject`: + // + // - `principal.subject == ` + // - `principal.subject != ` + // - `principal.subject in []` + // - `principal.subject.startsWith()` + // - `principal.subject.endsWith()` + // + // Allowed operations for `principal.type`: + // + // - `principal.type == ` + // - `principal.type != ` + // - `principal.type in []` + // + // Supported principal types are Workspace, Workforce Pool, Workload Pool and + // Service Account. Allowed string must be one of: + // + // - iam.googleapis.com/WorkspaceIdentity + // - iam.googleapis.com/WorkforcePoolIdentity + // - iam.googleapis.com/WorkloadPoolIdentity + // - iam.googleapis.com/ServiceAccount + google.type.Expr condition = 8 [(google.api.field_behavior) = OPTIONAL]; + + // Output only. The time when the policy binding was created. + google.protobuf.Timestamp create_time = 9 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The time when the policy binding was most recently updated. + google.protobuf.Timestamp update_time = 10 + [(google.api.field_behavior) = OUTPUT_ONLY]; +} diff --git a/java-iam/proto-google-iam-v3/src/main/proto/google/iam/v3/policy_bindings_service.proto b/java-iam/proto-google-iam-v3/src/main/proto/google/iam/v3/policy_bindings_service.proto new file mode 100644 index 0000000000..219209797a --- /dev/null +++ b/java-iam/proto-google-iam-v3/src/main/proto/google/iam/v3/policy_bindings_service.proto @@ -0,0 +1,377 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.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.iam.v3; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/iam/v3/operation_metadata.proto"; +import "google/iam/v3/policy_binding_resources.proto"; +import "google/longrunning/operations.proto"; +import "google/protobuf/empty.proto"; +import "google/protobuf/field_mask.proto"; + +option csharp_namespace = "Google.Cloud.Iam.V3"; +option go_package = "cloud.google.com/go/iam/apiv3/iampb;iampb"; +option java_multiple_files = true; +option java_outer_classname = "PolicyBindingsServiceProto"; +option java_package = "com.google.iam.v3"; +option php_namespace = "Google\\Cloud\\Iam\\V3"; +option (google.api.resource_definition) = { + type: "iam.googleapis.com/OrganizationLocation" + pattern: "organizations/{organization}/locations/{location}" +}; +option (google.api.resource_definition) = { + type: "iam.googleapis.com/FolderLocation" + pattern: "folders/{folder}/locations/{location}" +}; + +// An interface for managing Identity and Access Management (IAM) policy +// bindings. +service PolicyBindings { + option (google.api.default_host) = "iam.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform"; + + // Creates a policy binding and returns a long-running operation. + // Callers will need the IAM permissions on both the policy and target. + // Once the binding is created, the policy is applied to the target. + rpc CreatePolicyBinding(CreatePolicyBindingRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v3/{parent=projects/*/locations/*}/policyBindings" + body: "policy_binding" + additional_bindings { + post: "/v3/{parent=folders/*/locations/*}/policyBindings" + body: "policy_binding" + } + additional_bindings { + post: "/v3/{parent=organizations/*/locations/*}/policyBindings" + body: "policy_binding" + } + }; + option (google.api.method_signature) = + "parent,policy_binding,policy_binding_id"; + option (google.longrunning.operation_info) = { + response_type: "PolicyBinding" + metadata_type: "OperationMetadata" + }; + } + + // Gets a policy binding. + rpc GetPolicyBinding(GetPolicyBindingRequest) returns (PolicyBinding) { + option (google.api.http) = { + get: "/v3/{name=projects/*/locations/*/policyBindings/*}" + additional_bindings { + get: "/v3/{name=folders/*/locations/*/policyBindings/*}" + } + additional_bindings { + get: "/v3/{name=organizations/*/locations/*/policyBindings/*}" + } + }; + option (google.api.method_signature) = "name"; + } + + // Updates a policy binding and returns a long-running operation. + // Callers will need the IAM permissions on the policy and target in the + // binding to update, and the IAM permission to remove the existing policy + // from the binding. Target is immutable and cannot be updated. Once the + // binding is updated, the new policy is applied to the target. + rpc UpdatePolicyBinding(UpdatePolicyBindingRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + patch: "/v3/{policy_binding.name=projects/*/locations/*/policyBindings/*}" + body: "policy_binding" + additional_bindings { + patch: "/v3/{policy_binding.name=folders/*/locations/*/policyBindings/*}" + body: "policy_binding" + } + additional_bindings { + patch: "/v3/{policy_binding.name=organizations/*/locations/*/policyBindings/*}" + body: "policy_binding" + } + }; + option (google.api.method_signature) = "policy_binding,update_mask"; + option (google.longrunning.operation_info) = { + response_type: "PolicyBinding" + metadata_type: "OperationMetadata" + }; + } + + // Deletes a policy binding and returns a long-running operation. + // Callers will need the IAM permissions on both the policy and target. + // Once the binding is deleted, the policy no longer applies to the target. + rpc DeletePolicyBinding(DeletePolicyBindingRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + delete: "/v3/{name=projects/*/locations/*/policyBindings/*}" + additional_bindings { + delete: "/v3/{name=folders/*/locations/*/policyBindings/*}" + } + additional_bindings { + delete: "/v3/{name=organizations/*/locations/*/policyBindings/*}" + } + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "google.protobuf.Empty" + metadata_type: "OperationMetadata" + }; + } + + // Lists policy bindings. + rpc ListPolicyBindings(ListPolicyBindingsRequest) + returns (ListPolicyBindingsResponse) { + option (google.api.http) = { + get: "/v3/{parent=projects/*/locations/*}/policyBindings" + additional_bindings { + get: "/v3/{parent=folders/*/locations/*}/policyBindings" + } + additional_bindings { + get: "/v3/{parent=organizations/*/locations/*}/policyBindings" + } + }; + option (google.api.method_signature) = "parent"; + } + + // Search policy bindings by target. Returns all policy binding objects bound + // directly to target. + rpc SearchTargetPolicyBindings(SearchTargetPolicyBindingsRequest) + returns (SearchTargetPolicyBindingsResponse) { + option (google.api.http) = { + get: "/v3/{parent=projects/*/locations/*}/policyBindings:searchTargetPolicyBindings" + additional_bindings { + get: "/v3/{parent=folders/*/locations/*}/policyBindings:searchTargetPolicyBindings" + } + additional_bindings { + get: "/v3/{parent=organizations/*/locations/*}/policyBindings:searchTargetPolicyBindings" + } + }; + option (google.api.method_signature) = "parent,target"; + } +} + +// Request message for CreatePolicyBinding method. +message CreatePolicyBindingRequest { + // Required. The parent resource where this policy binding will be created. + // The binding parent is the closest Resource Manager resource (project, + // folder or organization) to the binding target. + // + // Format: + // + // * `projects/{project_id}/locations/{location}` + // * `projects/{project_number}/locations/{location}` + // * `folders/{folder_id}/locations/{location}` + // * `organizations/{organization_id}/locations/{location}` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "iam.googleapis.com/PolicyBinding" + } + ]; + + // Required. The ID to use for the policy binding, which will become the final + // component of the policy binding's resource name. + // + // This value must start with a lowercase letter followed by up to 62 + // lowercase letters, numbers, hyphens, or dots. Pattern, + // /[a-z][a-z0-9-\.]{2,62}/. + string policy_binding_id = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The policy binding to create. + PolicyBinding policy_binding = 3 [(google.api.field_behavior) = REQUIRED]; + + // Optional. If set, validate the request and preview the creation, but do not + // actually post it. + bool validate_only = 4 [(google.api.field_behavior) = OPTIONAL]; +} + +// Request message for GetPolicyBinding method. +message GetPolicyBindingRequest { + // Required. The name of the policy binding to retrieve. + // + // Format: + // + // * `projects/{project_id}/locations/{location}/policyBindings/{policy_binding_id}` + // * `projects/{project_number}/locations/{location}/policyBindings/{policy_binding_id}` + // * `folders/{folder_id}/locations/{location}/policyBindings/{policy_binding_id}` + // * `organizations/{organization_id}/locations/{location}/policyBindings/{policy_binding_id}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "iam.googleapis.com/PolicyBinding" + } + ]; +} + +// Request message for UpdatePolicyBinding method. +message UpdatePolicyBindingRequest { + // Required. The policy binding to update. + // + // The policy binding's `name` field is used to identify the policy binding to + // update. + PolicyBinding policy_binding = 1 [(google.api.field_behavior) = REQUIRED]; + + // Optional. If set, validate the request and preview the update, but do not + // actually post it. + bool validate_only = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The list of fields to update + google.protobuf.FieldMask update_mask = 3 + [(google.api.field_behavior) = OPTIONAL]; +} + +// Request message for DeletePolicyBinding method. +message DeletePolicyBindingRequest { + // Required. The name of the policy binding to delete. + // + // Format: + // + // * `projects/{project_id}/locations/{location}/policyBindings/{policy_binding_id}` + // * `projects/{project_number}/locations/{location}/policyBindings/{policy_binding_id}` + // * `folders/{folder_id}/locations/{location}/policyBindings/{policy_binding_id}` + // * `organizations/{organization_id}/locations/{location}/policyBindings/{policy_binding_id}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "iam.googleapis.com/PolicyBinding" + } + ]; + + // Optional. The etag of the policy binding. + // If this is provided, it must match the server's etag. + string etag = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If set, validate the request and preview the deletion, but do not + // actually post it. + bool validate_only = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +// Request message for ListPolicyBindings method. +message ListPolicyBindingsRequest { + // Required. The parent resource, which owns the collection of policy + // bindings. + // + // Format: + // + // * `projects/{project_id}/locations/{location}` + // * `projects/{project_number}/locations/{location}` + // * `folders/{folder_id}/locations/{location}` + // * `organizations/{organization_id}/locations/{location}` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "iam.googleapis.com/PolicyBinding" + } + ]; + + // Optional. The maximum number of policy bindings to return. The service may + // return fewer than this value. + // + // If unspecified, at most 50 policy bindings will be returned. + // The maximum value is 1000; values above 1000 will be coerced to 1000. + int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A page token, received from a previous `ListPolicyBindings` call. + // Provide this to retrieve the subsequent page. + // + // When paginating, all other parameters provided to `ListPolicyBindings` must + // match the call that provided the page token. + string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. An expression for filtering the results of the request. Filter + // rules are case insensitive. Some eligible fields for filtering are: + // + // + `target` + // + `policy` + // + // Some examples of filter queries: + // + // * `target:ex*`: The binding target's name starts with "ex". + // * `target:example`: The binding target's name is `example`. + // * `policy:example`: The binding policy's name is `example`. + string filter = 4 [(google.api.field_behavior) = OPTIONAL]; +} + +// Response message for ListPolicyBindings method. +message ListPolicyBindingsResponse { + // The policy bindings from the specified parent. + repeated PolicyBinding policy_bindings = 1; + + // Optional. A token, which can be sent as `page_token` to retrieve the next + // page. If this field is omitted, there are no subsequent pages. + string next_page_token = 2 [(google.api.field_behavior) = OPTIONAL]; +} + +// Request message for SearchTargetPolicyBindings method. +message SearchTargetPolicyBindingsRequest { + // Required. The target resource, which is bound to the policy in the binding. + // + // Format: + // + // * `//iam.googleapis.com/locations/global/workforcePools/POOL_ID` + // * `//iam.googleapis.com/projects/PROJECT_NUMBER/locations/global/workloadIdentityPools/POOL_ID` + // * `//iam.googleapis.com/locations/global/workspace/WORKSPACE_ID` + // * `//cloudresourcemanager.googleapis.com/projects/{project_number}` + // * `//cloudresourcemanager.googleapis.com/folders/{folder_id}` + // * `//cloudresourcemanager.googleapis.com/organizations/{organization_id}` + string target = 1 [(google.api.field_behavior) = REQUIRED]; + + // Optional. The maximum number of policy bindings to return. The service may + // return fewer than this value. + // + // If unspecified, at most 50 policy bindings will be returned. + // The maximum value is 1000; values above 1000 will be coerced to 1000. + int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A page token, received from a previous + // `SearchTargetPolicyBindingsRequest` call. Provide this to retrieve the + // subsequent page. + // + // When paginating, all other parameters provided to + // `SearchTargetPolicyBindingsRequest` must match the call that provided the + // page token. + string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Required. The parent resource where this search will be performed. This + // should be the nearest Resource Manager resource (project, folder, or + // organization) to the target. + // + // Format: + // + // * `projects/{project_id}/locations/{location}` + // * `projects/{project_number}/locations/{location}` + // * `folders/{folder_id}/locations/{location}` + // * `organizations/{organization_id}/locations/{location}` + string parent = 5 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "iam.googleapis.com/PolicyBinding" + } + ]; +} + +// Response message for SearchTargetPolicyBindings method. +message SearchTargetPolicyBindingsResponse { + // The policy bindings bound to the specified target. + repeated PolicyBinding policy_bindings = 1; + + // Optional. A token, which can be sent as `page_token` to retrieve the next + // page. If this field is omitted, there are no subsequent pages. + string next_page_token = 2 [(google.api.field_behavior) = OPTIONAL]; +} diff --git a/java-iam/proto-google-iam-v3/src/main/proto/google/iam/v3/principal_access_boundary_policies_service.proto b/java-iam/proto-google-iam-v3/src/main/proto/google/iam/v3/principal_access_boundary_policies_service.proto new file mode 100644 index 0000000000..8eb3898fa5 --- /dev/null +++ b/java-iam/proto-google-iam-v3/src/main/proto/google/iam/v3/principal_access_boundary_policies_service.proto @@ -0,0 +1,292 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.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.iam.v3; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/iam/v3/operation_metadata.proto"; +import "google/iam/v3/policy_binding_resources.proto"; +import "google/iam/v3/principal_access_boundary_policy_resources.proto"; +import "google/longrunning/operations.proto"; +import "google/protobuf/empty.proto"; +import "google/protobuf/field_mask.proto"; + +option csharp_namespace = "Google.Cloud.Iam.V3"; +option go_package = "cloud.google.com/go/iam/apiv3/iampb;iampb"; +option java_multiple_files = true; +option java_outer_classname = "PrincipalAccessBoundaryPoliciesServiceProto"; +option java_package = "com.google.iam.v3"; +option php_namespace = "Google\\Cloud\\Iam\\V3"; + +// Manages Identity and Access Management (IAM) principal access boundary +// policies. +service PrincipalAccessBoundaryPolicies { + option (google.api.default_host) = "iam.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform"; + + // Creates a principal access boundary policy, and returns a long running + // operation. + rpc CreatePrincipalAccessBoundaryPolicy( + CreatePrincipalAccessBoundaryPolicyRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v3/{parent=organizations/*/locations/*}/principalAccessBoundaryPolicies" + body: "principal_access_boundary_policy" + }; + option (google.api.method_signature) = + "parent,principal_access_boundary_policy,principal_access_boundary_policy_id"; + option (google.longrunning.operation_info) = { + response_type: "PrincipalAccessBoundaryPolicy" + metadata_type: "OperationMetadata" + }; + } + + // Gets a principal access boundary policy. + rpc GetPrincipalAccessBoundaryPolicy(GetPrincipalAccessBoundaryPolicyRequest) + returns (PrincipalAccessBoundaryPolicy) { + option (google.api.http) = { + get: "/v3/{name=organizations/*/locations/*/principalAccessBoundaryPolicies/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Updates a principal access boundary policy. + rpc UpdatePrincipalAccessBoundaryPolicy( + UpdatePrincipalAccessBoundaryPolicyRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + patch: "/v3/{principal_access_boundary_policy.name=organizations/*/locations/*/principalAccessBoundaryPolicies/*}" + body: "principal_access_boundary_policy" + }; + option (google.api.method_signature) = + "principal_access_boundary_policy,update_mask"; + option (google.longrunning.operation_info) = { + response_type: "PrincipalAccessBoundaryPolicy" + metadata_type: "OperationMetadata" + }; + } + + // Deletes a principal access boundary policy. + rpc DeletePrincipalAccessBoundaryPolicy( + DeletePrincipalAccessBoundaryPolicyRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + delete: "/v3/{name=organizations/*/locations/*/principalAccessBoundaryPolicies/*}" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "google.protobuf.Empty" + metadata_type: "OperationMetadata" + }; + } + + // Lists principal access boundary policies. + rpc ListPrincipalAccessBoundaryPolicies( + ListPrincipalAccessBoundaryPoliciesRequest) + returns (ListPrincipalAccessBoundaryPoliciesResponse) { + option (google.api.http) = { + get: "/v3/{parent=organizations/*/locations/*}/principalAccessBoundaryPolicies" + }; + option (google.api.method_signature) = "parent"; + } + + // Returns all policy bindings that bind a specific policy if a user has + // searchPolicyBindings permission on that policy. + rpc SearchPrincipalAccessBoundaryPolicyBindings( + SearchPrincipalAccessBoundaryPolicyBindingsRequest) + returns (SearchPrincipalAccessBoundaryPolicyBindingsResponse) { + option (google.api.http) = { + get: "/v3/{name=organizations/*/locations/*/principalAccessBoundaryPolicies/*}:searchPolicyBindings" + }; + option (google.api.method_signature) = "name"; + } +} + +// Request message for CreatePrincipalAccessBoundaryPolicyRequest method. +message CreatePrincipalAccessBoundaryPolicyRequest { + // Required. The parent resource where this principal access boundary policy + // will be created. Only organizations are supported. + // + // Format: + // `organizations/{organization_id}/locations/{location}` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "iam.googleapis.com/PrincipalAccessBoundaryPolicy" + } + ]; + + // Required. The ID to use for the principal access boundary policy, which + // will become the final component of the principal access boundary policy's + // resource name. + // + // This value must start with a lowercase letter followed by up to 62 + // lowercase letters, numbers, hyphens, or dots. Pattern, + // /[a-z][a-z0-9-\.]{2,62}/. + string principal_access_boundary_policy_id = 2 + [(google.api.field_behavior) = REQUIRED]; + + // Required. The principal access boundary policy to create. + PrincipalAccessBoundaryPolicy principal_access_boundary_policy = 3 + [(google.api.field_behavior) = REQUIRED]; + + // Optional. If set, validate the request and preview the creation, but do not + // actually post it. + bool validate_only = 4 [(google.api.field_behavior) = OPTIONAL]; +} + +// Request message for GetPrincipalAccessBoundaryPolicy method. +message GetPrincipalAccessBoundaryPolicyRequest { + // Required. The name of the principal access boundary policy to retrieve. + // + // Format: + // `organizations/{organization_id}/locations/{location}/principalAccessBoundaryPolicies/{principal_access_boundary_policy_id}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "iam.googleapis.com/PrincipalAccessBoundaryPolicy" + } + ]; +} + +// Request message for UpdatePrincipalAccessBoundaryPolicy method. +message UpdatePrincipalAccessBoundaryPolicyRequest { + // Required. The principal access boundary policy to update. + // + // The principal access boundary policy's `name` field is used to identify the + // policy to update. + PrincipalAccessBoundaryPolicy principal_access_boundary_policy = 1 + [(google.api.field_behavior) = REQUIRED]; + + // Optional. If set, validate the request and preview the update, but do not + // actually post it. + bool validate_only = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The list of fields to update + google.protobuf.FieldMask update_mask = 3 + [(google.api.field_behavior) = OPTIONAL]; +} + +// Request message for DeletePrincipalAccessBoundaryPolicy method. +message DeletePrincipalAccessBoundaryPolicyRequest { + // Required. The name of the principal access boundary policy to delete. + // + // Format: + // `organizations/{organization_id}/locations/{location}/principalAccessBoundaryPolicies/{principal_access_boundary_policy_id}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "iam.googleapis.com/PrincipalAccessBoundaryPolicy" + } + ]; + + // Optional. The etag of the principal access boundary policy. + // If this is provided, it must match the server's etag. + string etag = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If set, validate the request and preview the deletion, but do not + // actually post it. + bool validate_only = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If set to true, the request will force the deletion of the policy + // even if the policy is referenced in policy bindings. + bool force = 4 [(google.api.field_behavior) = OPTIONAL]; +} + +// Request message for ListPrincipalAccessBoundaryPolicies method. +message ListPrincipalAccessBoundaryPoliciesRequest { + // Required. The parent resource, which owns the collection of principal + // access boundary policies. + // + // Format: + // `organizations/{organization_id}/locations/{location}` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "iam.googleapis.com/PrincipalAccessBoundaryPolicy" + } + ]; + + // Optional. The maximum number of principal access boundary policies to + // return. The service may return fewer than this value. + // + // If unspecified, at most 50 principal access boundary policies will be + // returned. The maximum value is 1000; values above 1000 will be coerced to + // 1000. + int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A page token, received from a previous + // `ListPrincipalAccessBoundaryPolicies` call. Provide this to retrieve the + // subsequent page. + // + // When paginating, all other parameters provided to + // `ListPrincipalAccessBoundaryPolicies` must match the call that provided the + // page token. + string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +// Response message for ListPrincipalAccessBoundaryPolicies method. +message ListPrincipalAccessBoundaryPoliciesResponse { + // The principal access boundary policies from the specified parent. + repeated PrincipalAccessBoundaryPolicy principal_access_boundary_policies = 1; + + // Optional. A token, which can be sent as `page_token` to retrieve the next + // page. If this field is omitted, there are no subsequent pages. + string next_page_token = 2 [(google.api.field_behavior) = OPTIONAL]; +} + +// Request message for SearchPrincipalAccessBoundaryPolicyBindings rpc. +message SearchPrincipalAccessBoundaryPolicyBindingsRequest { + // Required. The name of the principal access boundary policy. + // Format: + // `organizations/{organization_id}/locations/{location}/principalAccessBoundaryPolicies/{principal_access_boundary_policy_id}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "iam.googleapis.com/PrincipalAccessBoundaryPolicy" + } + ]; + + // Optional. The maximum number of policy bindings to return. The service may + // return fewer than this value. + // + // If unspecified, at most 50 policy bindings will be returned. + // The maximum value is 1000; values above 1000 will be coerced to 1000. + int32 page_size = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A page token, received from a previous + // `SearchPrincipalAccessBoundaryPolicyBindingsRequest` call. Provide this to + // retrieve the subsequent page. + // + // When paginating, all other parameters provided to + // `SearchPrincipalAccessBoundaryPolicyBindingsRequest` must match the call + // that provided the page token. + string page_token = 4 [(google.api.field_behavior) = OPTIONAL]; +} + +// Response message for SearchPrincipalAccessBoundaryPolicyBindings rpc. +message SearchPrincipalAccessBoundaryPolicyBindingsResponse { + // The policy bindings that reference the specified policy. + repeated PolicyBinding policy_bindings = 1; + + // Optional. A token, which can be sent as `page_token` to retrieve the next + // page. If this field is omitted, there are no subsequent pages. + string next_page_token = 2 [(google.api.field_behavior) = OPTIONAL]; +} diff --git a/java-iam/proto-google-iam-v3/src/main/proto/google/iam/v3/principal_access_boundary_policy_resources.proto b/java-iam/proto-google-iam-v3/src/main/proto/google/iam/v3/principal_access_boundary_policy_resources.proto new file mode 100644 index 0000000000..d7e3b36a5d --- /dev/null +++ b/java-iam/proto-google-iam-v3/src/main/proto/google/iam/v3/principal_access_boundary_policy_resources.proto @@ -0,0 +1,128 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.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.iam.v3; + +import "google/api/field_behavior.proto"; +import "google/api/field_info.proto"; +import "google/api/resource.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.Iam.V3"; +option go_package = "cloud.google.com/go/iam/apiv3/iampb;iampb"; +option java_multiple_files = true; +option java_outer_classname = "PrincipalAccessBoundaryPolicyResourcesProto"; +option java_package = "com.google.iam.v3"; +option php_namespace = "Google\\Cloud\\Iam\\V3"; + +// An IAM principal access boundary policy resource. +message PrincipalAccessBoundaryPolicy { + option (google.api.resource) = { + type: "iam.googleapis.com/PrincipalAccessBoundaryPolicy" + pattern: "organizations/{organization}/locations/{location}/principalAccessBoundaryPolicies/{principal_access_boundary_policy}" + plural: "principalAccessBoundaryPolicies" + singular: "principalAccessBoundaryPolicy" + }; + + // Identifier. The resource name of the principal access boundary policy. + // + // The following format is supported: + // `organizations/{organization_id}/locations/{location}/principalAccessBoundaryPolicies/{policy_id}` + string name = 1 [(google.api.field_behavior) = IDENTIFIER]; + + // Output only. The globally unique ID of the principal access boundary + // policy. + string uid = 2 [ + (google.api.field_info).format = UUID4, + (google.api.field_behavior) = OUTPUT_ONLY + ]; + + // Optional. The etag for the principal access boundary. + // If this is provided on update, it must match the server's etag. + string etag = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The description of the principal access boundary policy. Must be + // less than or equal to 63 characters. + string display_name = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. User defined annotations. See + // https://google.aip.dev/148#annotations for more details such as format and + // size limitations + map annotations = 5 [(google.api.field_behavior) = OPTIONAL]; + + // Output only. The time when the principal access boundary policy was + // created. + google.protobuf.Timestamp create_time = 6 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The time when the principal access boundary policy was most + // recently updated. + google.protobuf.Timestamp update_time = 7 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. The details for the principal access boundary policy. + PrincipalAccessBoundaryPolicyDetails details = 8 + [(google.api.field_behavior) = OPTIONAL]; +} + +// Principal access boundary policy details +message PrincipalAccessBoundaryPolicyDetails { + // Required. A list of principal access boundary policy rules. The number of + // rules in a policy is limited to 500. + repeated PrincipalAccessBoundaryPolicyRule rules = 1 + [(google.api.field_behavior) = REQUIRED]; + + // Optional. + // The version number (for example, `1` or `latest`) that indicates which + // permissions are able to be blocked by the policy. If empty, the PAB policy + // version will be set to the most recent version number at the time of the + // policy's creation. + string enforcement_version = 4 [(google.api.field_behavior) = OPTIONAL]; +} + +// Principal access boundary policy rule that defines the resource boundary. +message PrincipalAccessBoundaryPolicyRule { + // An effect to describe the access relationship. + enum Effect { + // Effect unspecified. + EFFECT_UNSPECIFIED = 0; + + // Allows access to the resources in this rule. + ALLOW = 1; + } + + // Optional. The description of the principal access boundary policy rule. + // Must be less than or equal to 256 characters. + string description = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Required. A list of Resource Manager resources. If a resource is listed in + // the rule, then the rule applies for that resource and its descendants. The + // number of resources in a policy is limited to 500 across all rules in the + // policy. + // + // The following resource types are supported: + // + // * Organizations, such as + // `//cloudresourcemanager.googleapis.com/organizations/123`. + // * Folders, such as `//cloudresourcemanager.googleapis.com/folders/123`. + // * Projects, such as `//cloudresourcemanager.googleapis.com/projects/123` + // or `//cloudresourcemanager.googleapis.com/projects/my-project-id`. + repeated string resources = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The access relationship of principals to the resources in this + // rule. + Effect effect = 3 [(google.api.field_behavior) = REQUIRED]; +} diff --git a/java-iam/proto-google-iam-v3beta/clirr-ignored-differences.xml b/java-iam/proto-google-iam-v3beta/clirr-ignored-differences.xml new file mode 100644 index 0000000000..70e35c1538 --- /dev/null +++ b/java-iam/proto-google-iam-v3beta/clirr-ignored-differences.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/java-iam/proto-google-iam-v3beta/pom.xml b/java-iam/proto-google-iam-v3beta/pom.xml new file mode 100644 index 0000000000..f5d80a39e2 --- /dev/null +++ b/java-iam/proto-google-iam-v3beta/pom.xml @@ -0,0 +1,33 @@ + + 4.0.0 + com.google.api.grpc + proto-google-iam-v3beta + 1.62.1-SNAPSHOT + proto-google-iam-v3beta + Proto library for proto-google-iam-v3beta + + com.google.cloud + google-iam-parent + 1.62.1-SNAPSHOT + + + + com.google.protobuf + protobuf-java + + + com.google.api.grpc + proto-google-common-protos + + + com.google.api + api-common + + + com.google.guava + guava + + + diff --git a/java-iam/proto-google-iam-v3beta/src/main/java/com/google/iam/v3beta/CreatePolicyBindingRequest.java b/java-iam/proto-google-iam-v3beta/src/main/java/com/google/iam/v3beta/CreatePolicyBindingRequest.java new file mode 100644 index 0000000000..32d28241ec --- /dev/null +++ b/java-iam/proto-google-iam-v3beta/src/main/java/com/google/iam/v3beta/CreatePolicyBindingRequest.java @@ -0,0 +1,1315 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/iam/v3beta/policy_bindings_service.proto +// Protobuf Java Version: 4.33.2 + +package com.google.iam.v3beta; + +/** + * + * + *
        + * Request message for CreatePolicyBinding method.
        + * 
        + * + * Protobuf type {@code google.iam.v3beta.CreatePolicyBindingRequest} + */ +@com.google.protobuf.Generated +public final class CreatePolicyBindingRequest extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.iam.v3beta.CreatePolicyBindingRequest) + CreatePolicyBindingRequestOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "CreatePolicyBindingRequest"); + } + + // Use CreatePolicyBindingRequest.newBuilder() to construct. + private CreatePolicyBindingRequest(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private CreatePolicyBindingRequest() { + parent_ = ""; + policyBindingId_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.iam.v3beta.PolicyBindingsServiceProto + .internal_static_google_iam_v3beta_CreatePolicyBindingRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.iam.v3beta.PolicyBindingsServiceProto + .internal_static_google_iam_v3beta_CreatePolicyBindingRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.iam.v3beta.CreatePolicyBindingRequest.class, + com.google.iam.v3beta.CreatePolicyBindingRequest.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 where this policy binding will be created.
        +   * The binding parent is the closest Resource Manager resource (project,
        +   * folder or organization) to the binding target.
        +   *
        +   * Format:
        +   *
        +   * * `projects/{project_id}/locations/{location}`
        +   * * `projects/{project_number}/locations/{location}`
        +   * * `folders/{folder_id}/locations/{location}`
        +   * * `organizations/{organization_id}/locations/{location}`
        +   * 
        + * + * + * 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 where this policy binding will be created.
        +   * The binding parent is the closest Resource Manager resource (project,
        +   * folder or organization) to the binding target.
        +   *
        +   * Format:
        +   *
        +   * * `projects/{project_id}/locations/{location}`
        +   * * `projects/{project_number}/locations/{location}`
        +   * * `folders/{folder_id}/locations/{location}`
        +   * * `organizations/{organization_id}/locations/{location}`
        +   * 
        + * + * + * 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 POLICY_BINDING_ID_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object policyBindingId_ = ""; + + /** + * + * + *
        +   * Required. The ID to use for the policy binding, which will become the final
        +   * component of the policy binding's resource name.
        +   *
        +   * This value must start with a lowercase letter followed by up to 62
        +   * lowercase letters, numbers, hyphens, or dots. Pattern,
        +   * /[a-z][a-z0-9-\.]{2,62}/.
        +   * 
        + * + * string policy_binding_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The policyBindingId. + */ + @java.lang.Override + public java.lang.String getPolicyBindingId() { + java.lang.Object ref = policyBindingId_; + 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(); + policyBindingId_ = s; + return s; + } + } + + /** + * + * + *
        +   * Required. The ID to use for the policy binding, which will become the final
        +   * component of the policy binding's resource name.
        +   *
        +   * This value must start with a lowercase letter followed by up to 62
        +   * lowercase letters, numbers, hyphens, or dots. Pattern,
        +   * /[a-z][a-z0-9-\.]{2,62}/.
        +   * 
        + * + * string policy_binding_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for policyBindingId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getPolicyBindingIdBytes() { + java.lang.Object ref = policyBindingId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + policyBindingId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int POLICY_BINDING_FIELD_NUMBER = 3; + private com.google.iam.v3beta.PolicyBinding policyBinding_; + + /** + * + * + *
        +   * Required. The policy binding to create.
        +   * 
        + * + * + * .google.iam.v3beta.PolicyBinding policy_binding = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the policyBinding field is set. + */ + @java.lang.Override + public boolean hasPolicyBinding() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
        +   * Required. The policy binding to create.
        +   * 
        + * + * + * .google.iam.v3beta.PolicyBinding policy_binding = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The policyBinding. + */ + @java.lang.Override + public com.google.iam.v3beta.PolicyBinding getPolicyBinding() { + return policyBinding_ == null + ? com.google.iam.v3beta.PolicyBinding.getDefaultInstance() + : policyBinding_; + } + + /** + * + * + *
        +   * Required. The policy binding to create.
        +   * 
        + * + * + * .google.iam.v3beta.PolicyBinding policy_binding = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.iam.v3beta.PolicyBindingOrBuilder getPolicyBindingOrBuilder() { + return policyBinding_ == null + ? com.google.iam.v3beta.PolicyBinding.getDefaultInstance() + : policyBinding_; + } + + public static final int VALIDATE_ONLY_FIELD_NUMBER = 4; + private boolean validateOnly_ = false; + + /** + * + * + *
        +   * Optional. If set, validate the request and preview the creation, but do not
        +   * actually post it.
        +   * 
        + * + * bool validate_only = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The validateOnly. + */ + @java.lang.Override + public boolean getValidateOnly() { + return validateOnly_; + } + + 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.GeneratedMessage.isStringEmpty(parent_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, parent_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(policyBindingId_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, policyBindingId_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(3, getPolicyBinding()); + } + if (validateOnly_ != false) { + output.writeBool(4, validateOnly_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(parent_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, parent_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(policyBindingId_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, policyBindingId_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getPolicyBinding()); + } + if (validateOnly_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(4, validateOnly_); + } + 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.iam.v3beta.CreatePolicyBindingRequest)) { + return super.equals(obj); + } + com.google.iam.v3beta.CreatePolicyBindingRequest other = + (com.google.iam.v3beta.CreatePolicyBindingRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (!getPolicyBindingId().equals(other.getPolicyBindingId())) return false; + if (hasPolicyBinding() != other.hasPolicyBinding()) return false; + if (hasPolicyBinding()) { + if (!getPolicyBinding().equals(other.getPolicyBinding())) return false; + } + if (getValidateOnly() != other.getValidateOnly()) 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) + POLICY_BINDING_ID_FIELD_NUMBER; + hash = (53 * hash) + getPolicyBindingId().hashCode(); + if (hasPolicyBinding()) { + hash = (37 * hash) + POLICY_BINDING_FIELD_NUMBER; + hash = (53 * hash) + getPolicyBinding().hashCode(); + } + hash = (37 * hash) + VALIDATE_ONLY_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getValidateOnly()); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.iam.v3beta.CreatePolicyBindingRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.iam.v3beta.CreatePolicyBindingRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.iam.v3beta.CreatePolicyBindingRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.iam.v3beta.CreatePolicyBindingRequest 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.iam.v3beta.CreatePolicyBindingRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.iam.v3beta.CreatePolicyBindingRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.iam.v3beta.CreatePolicyBindingRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.iam.v3beta.CreatePolicyBindingRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.iam.v3beta.CreatePolicyBindingRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.iam.v3beta.CreatePolicyBindingRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.iam.v3beta.CreatePolicyBindingRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.iam.v3beta.CreatePolicyBindingRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.iam.v3beta.CreatePolicyBindingRequest 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
        +   * Request message for CreatePolicyBinding method.
        +   * 
        + * + * Protobuf type {@code google.iam.v3beta.CreatePolicyBindingRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.iam.v3beta.CreatePolicyBindingRequest) + com.google.iam.v3beta.CreatePolicyBindingRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.iam.v3beta.PolicyBindingsServiceProto + .internal_static_google_iam_v3beta_CreatePolicyBindingRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.iam.v3beta.PolicyBindingsServiceProto + .internal_static_google_iam_v3beta_CreatePolicyBindingRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.iam.v3beta.CreatePolicyBindingRequest.class, + com.google.iam.v3beta.CreatePolicyBindingRequest.Builder.class); + } + + // Construct using com.google.iam.v3beta.CreatePolicyBindingRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetPolicyBindingFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + parent_ = ""; + policyBindingId_ = ""; + policyBinding_ = null; + if (policyBindingBuilder_ != null) { + policyBindingBuilder_.dispose(); + policyBindingBuilder_ = null; + } + validateOnly_ = false; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.iam.v3beta.PolicyBindingsServiceProto + .internal_static_google_iam_v3beta_CreatePolicyBindingRequest_descriptor; + } + + @java.lang.Override + public com.google.iam.v3beta.CreatePolicyBindingRequest getDefaultInstanceForType() { + return com.google.iam.v3beta.CreatePolicyBindingRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.iam.v3beta.CreatePolicyBindingRequest build() { + com.google.iam.v3beta.CreatePolicyBindingRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.iam.v3beta.CreatePolicyBindingRequest buildPartial() { + com.google.iam.v3beta.CreatePolicyBindingRequest result = + new com.google.iam.v3beta.CreatePolicyBindingRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.iam.v3beta.CreatePolicyBindingRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.parent_ = parent_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.policyBindingId_ = policyBindingId_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000004) != 0)) { + result.policyBinding_ = + policyBindingBuilder_ == null ? policyBinding_ : policyBindingBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.validateOnly_ = validateOnly_; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.iam.v3beta.CreatePolicyBindingRequest) { + return mergeFrom((com.google.iam.v3beta.CreatePolicyBindingRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.iam.v3beta.CreatePolicyBindingRequest other) { + if (other == com.google.iam.v3beta.CreatePolicyBindingRequest.getDefaultInstance()) + return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getPolicyBindingId().isEmpty()) { + policyBindingId_ = other.policyBindingId_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (other.hasPolicyBinding()) { + mergePolicyBinding(other.getPolicyBinding()); + } + if (other.getValidateOnly() != false) { + setValidateOnly(other.getValidateOnly()); + } + 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: + { + policyBindingId_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + input.readMessage( + internalGetPolicyBindingFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 32: + { + validateOnly_ = 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 parent_ = ""; + + /** + * + * + *
        +     * Required. The parent resource where this policy binding will be created.
        +     * The binding parent is the closest Resource Manager resource (project,
        +     * folder or organization) to the binding target.
        +     *
        +     * Format:
        +     *
        +     * * `projects/{project_id}/locations/{location}`
        +     * * `projects/{project_number}/locations/{location}`
        +     * * `folders/{folder_id}/locations/{location}`
        +     * * `organizations/{organization_id}/locations/{location}`
        +     * 
        + * + * + * 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 where this policy binding will be created.
        +     * The binding parent is the closest Resource Manager resource (project,
        +     * folder or organization) to the binding target.
        +     *
        +     * Format:
        +     *
        +     * * `projects/{project_id}/locations/{location}`
        +     * * `projects/{project_number}/locations/{location}`
        +     * * `folders/{folder_id}/locations/{location}`
        +     * * `organizations/{organization_id}/locations/{location}`
        +     * 
        + * + * + * 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 where this policy binding will be created.
        +     * The binding parent is the closest Resource Manager resource (project,
        +     * folder or organization) to the binding target.
        +     *
        +     * Format:
        +     *
        +     * * `projects/{project_id}/locations/{location}`
        +     * * `projects/{project_number}/locations/{location}`
        +     * * `folders/{folder_id}/locations/{location}`
        +     * * `organizations/{organization_id}/locations/{location}`
        +     * 
        + * + * + * 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 where this policy binding will be created.
        +     * The binding parent is the closest Resource Manager resource (project,
        +     * folder or organization) to the binding target.
        +     *
        +     * Format:
        +     *
        +     * * `projects/{project_id}/locations/{location}`
        +     * * `projects/{project_number}/locations/{location}`
        +     * * `folders/{folder_id}/locations/{location}`
        +     * * `organizations/{organization_id}/locations/{location}`
        +     * 
        + * + * + * 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 where this policy binding will be created.
        +     * The binding parent is the closest Resource Manager resource (project,
        +     * folder or organization) to the binding target.
        +     *
        +     * Format:
        +     *
        +     * * `projects/{project_id}/locations/{location}`
        +     * * `projects/{project_number}/locations/{location}`
        +     * * `folders/{folder_id}/locations/{location}`
        +     * * `organizations/{organization_id}/locations/{location}`
        +     * 
        + * + * + * 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 policyBindingId_ = ""; + + /** + * + * + *
        +     * Required. The ID to use for the policy binding, which will become the final
        +     * component of the policy binding's resource name.
        +     *
        +     * This value must start with a lowercase letter followed by up to 62
        +     * lowercase letters, numbers, hyphens, or dots. Pattern,
        +     * /[a-z][a-z0-9-\.]{2,62}/.
        +     * 
        + * + * string policy_binding_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The policyBindingId. + */ + public java.lang.String getPolicyBindingId() { + java.lang.Object ref = policyBindingId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + policyBindingId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
        +     * Required. The ID to use for the policy binding, which will become the final
        +     * component of the policy binding's resource name.
        +     *
        +     * This value must start with a lowercase letter followed by up to 62
        +     * lowercase letters, numbers, hyphens, or dots. Pattern,
        +     * /[a-z][a-z0-9-\.]{2,62}/.
        +     * 
        + * + * string policy_binding_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for policyBindingId. + */ + public com.google.protobuf.ByteString getPolicyBindingIdBytes() { + java.lang.Object ref = policyBindingId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + policyBindingId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
        +     * Required. The ID to use for the policy binding, which will become the final
        +     * component of the policy binding's resource name.
        +     *
        +     * This value must start with a lowercase letter followed by up to 62
        +     * lowercase letters, numbers, hyphens, or dots. Pattern,
        +     * /[a-z][a-z0-9-\.]{2,62}/.
        +     * 
        + * + * string policy_binding_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The policyBindingId to set. + * @return This builder for chaining. + */ + public Builder setPolicyBindingId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + policyBindingId_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
        +     * Required. The ID to use for the policy binding, which will become the final
        +     * component of the policy binding's resource name.
        +     *
        +     * This value must start with a lowercase letter followed by up to 62
        +     * lowercase letters, numbers, hyphens, or dots. Pattern,
        +     * /[a-z][a-z0-9-\.]{2,62}/.
        +     * 
        + * + * string policy_binding_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearPolicyBindingId() { + policyBindingId_ = getDefaultInstance().getPolicyBindingId(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
        +     * Required. The ID to use for the policy binding, which will become the final
        +     * component of the policy binding's resource name.
        +     *
        +     * This value must start with a lowercase letter followed by up to 62
        +     * lowercase letters, numbers, hyphens, or dots. Pattern,
        +     * /[a-z][a-z0-9-\.]{2,62}/.
        +     * 
        + * + * string policy_binding_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for policyBindingId to set. + * @return This builder for chaining. + */ + public Builder setPolicyBindingIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + policyBindingId_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private com.google.iam.v3beta.PolicyBinding policyBinding_; + private com.google.protobuf.SingleFieldBuilder< + com.google.iam.v3beta.PolicyBinding, + com.google.iam.v3beta.PolicyBinding.Builder, + com.google.iam.v3beta.PolicyBindingOrBuilder> + policyBindingBuilder_; + + /** + * + * + *
        +     * Required. The policy binding to create.
        +     * 
        + * + * + * .google.iam.v3beta.PolicyBinding policy_binding = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the policyBinding field is set. + */ + public boolean hasPolicyBinding() { + return ((bitField0_ & 0x00000004) != 0); + } + + /** + * + * + *
        +     * Required. The policy binding to create.
        +     * 
        + * + * + * .google.iam.v3beta.PolicyBinding policy_binding = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The policyBinding. + */ + public com.google.iam.v3beta.PolicyBinding getPolicyBinding() { + if (policyBindingBuilder_ == null) { + return policyBinding_ == null + ? com.google.iam.v3beta.PolicyBinding.getDefaultInstance() + : policyBinding_; + } else { + return policyBindingBuilder_.getMessage(); + } + } + + /** + * + * + *
        +     * Required. The policy binding to create.
        +     * 
        + * + * + * .google.iam.v3beta.PolicyBinding policy_binding = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setPolicyBinding(com.google.iam.v3beta.PolicyBinding value) { + if (policyBindingBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + policyBinding_ = value; + } else { + policyBindingBuilder_.setMessage(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
        +     * Required. The policy binding to create.
        +     * 
        + * + * + * .google.iam.v3beta.PolicyBinding policy_binding = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setPolicyBinding(com.google.iam.v3beta.PolicyBinding.Builder builderForValue) { + if (policyBindingBuilder_ == null) { + policyBinding_ = builderForValue.build(); + } else { + policyBindingBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
        +     * Required. The policy binding to create.
        +     * 
        + * + * + * .google.iam.v3beta.PolicyBinding policy_binding = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergePolicyBinding(com.google.iam.v3beta.PolicyBinding value) { + if (policyBindingBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0) + && policyBinding_ != null + && policyBinding_ != com.google.iam.v3beta.PolicyBinding.getDefaultInstance()) { + getPolicyBindingBuilder().mergeFrom(value); + } else { + policyBinding_ = value; + } + } else { + policyBindingBuilder_.mergeFrom(value); + } + if (policyBinding_ != null) { + bitField0_ |= 0x00000004; + onChanged(); + } + return this; + } + + /** + * + * + *
        +     * Required. The policy binding to create.
        +     * 
        + * + * + * .google.iam.v3beta.PolicyBinding policy_binding = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearPolicyBinding() { + bitField0_ = (bitField0_ & ~0x00000004); + policyBinding_ = null; + if (policyBindingBuilder_ != null) { + policyBindingBuilder_.dispose(); + policyBindingBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
        +     * Required. The policy binding to create.
        +     * 
        + * + * + * .google.iam.v3beta.PolicyBinding policy_binding = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.iam.v3beta.PolicyBinding.Builder getPolicyBindingBuilder() { + bitField0_ |= 0x00000004; + onChanged(); + return internalGetPolicyBindingFieldBuilder().getBuilder(); + } + + /** + * + * + *
        +     * Required. The policy binding to create.
        +     * 
        + * + * + * .google.iam.v3beta.PolicyBinding policy_binding = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.iam.v3beta.PolicyBindingOrBuilder getPolicyBindingOrBuilder() { + if (policyBindingBuilder_ != null) { + return policyBindingBuilder_.getMessageOrBuilder(); + } else { + return policyBinding_ == null + ? com.google.iam.v3beta.PolicyBinding.getDefaultInstance() + : policyBinding_; + } + } + + /** + * + * + *
        +     * Required. The policy binding to create.
        +     * 
        + * + * + * .google.iam.v3beta.PolicyBinding policy_binding = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.iam.v3beta.PolicyBinding, + com.google.iam.v3beta.PolicyBinding.Builder, + com.google.iam.v3beta.PolicyBindingOrBuilder> + internalGetPolicyBindingFieldBuilder() { + if (policyBindingBuilder_ == null) { + policyBindingBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.iam.v3beta.PolicyBinding, + com.google.iam.v3beta.PolicyBinding.Builder, + com.google.iam.v3beta.PolicyBindingOrBuilder>( + getPolicyBinding(), getParentForChildren(), isClean()); + policyBinding_ = null; + } + return policyBindingBuilder_; + } + + private boolean validateOnly_; + + /** + * + * + *
        +     * Optional. If set, validate the request and preview the creation, but do not
        +     * actually post it.
        +     * 
        + * + * bool validate_only = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The validateOnly. + */ + @java.lang.Override + public boolean getValidateOnly() { + return validateOnly_; + } + + /** + * + * + *
        +     * Optional. If set, validate the request and preview the creation, but do not
        +     * actually post it.
        +     * 
        + * + * bool validate_only = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The validateOnly to set. + * @return This builder for chaining. + */ + public Builder setValidateOnly(boolean value) { + + validateOnly_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + /** + * + * + *
        +     * Optional. If set, validate the request and preview the creation, but do not
        +     * actually post it.
        +     * 
        + * + * bool validate_only = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearValidateOnly() { + bitField0_ = (bitField0_ & ~0x00000008); + validateOnly_ = false; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.iam.v3beta.CreatePolicyBindingRequest) + } + + // @@protoc_insertion_point(class_scope:google.iam.v3beta.CreatePolicyBindingRequest) + private static final com.google.iam.v3beta.CreatePolicyBindingRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.iam.v3beta.CreatePolicyBindingRequest(); + } + + public static com.google.iam.v3beta.CreatePolicyBindingRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CreatePolicyBindingRequest 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.iam.v3beta.CreatePolicyBindingRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-iam/proto-google-iam-v3beta/src/main/java/com/google/iam/v3beta/CreatePolicyBindingRequestOrBuilder.java b/java-iam/proto-google-iam-v3beta/src/main/java/com/google/iam/v3beta/CreatePolicyBindingRequestOrBuilder.java new file mode 100644 index 0000000000..f38c345e13 --- /dev/null +++ b/java-iam/proto-google-iam-v3beta/src/main/java/com/google/iam/v3beta/CreatePolicyBindingRequestOrBuilder.java @@ -0,0 +1,169 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/iam/v3beta/policy_bindings_service.proto +// Protobuf Java Version: 4.33.2 + +package com.google.iam.v3beta; + +@com.google.protobuf.Generated +public interface CreatePolicyBindingRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.iam.v3beta.CreatePolicyBindingRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
        +   * Required. The parent resource where this policy binding will be created.
        +   * The binding parent is the closest Resource Manager resource (project,
        +   * folder or organization) to the binding target.
        +   *
        +   * Format:
        +   *
        +   * * `projects/{project_id}/locations/{location}`
        +   * * `projects/{project_number}/locations/{location}`
        +   * * `folders/{folder_id}/locations/{location}`
        +   * * `organizations/{organization_id}/locations/{location}`
        +   * 
        + * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + + /** + * + * + *
        +   * Required. The parent resource where this policy binding will be created.
        +   * The binding parent is the closest Resource Manager resource (project,
        +   * folder or organization) to the binding target.
        +   *
        +   * Format:
        +   *
        +   * * `projects/{project_id}/locations/{location}`
        +   * * `projects/{project_number}/locations/{location}`
        +   * * `folders/{folder_id}/locations/{location}`
        +   * * `organizations/{organization_id}/locations/{location}`
        +   * 
        + * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
        +   * Required. The ID to use for the policy binding, which will become the final
        +   * component of the policy binding's resource name.
        +   *
        +   * This value must start with a lowercase letter followed by up to 62
        +   * lowercase letters, numbers, hyphens, or dots. Pattern,
        +   * /[a-z][a-z0-9-\.]{2,62}/.
        +   * 
        + * + * string policy_binding_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The policyBindingId. + */ + java.lang.String getPolicyBindingId(); + + /** + * + * + *
        +   * Required. The ID to use for the policy binding, which will become the final
        +   * component of the policy binding's resource name.
        +   *
        +   * This value must start with a lowercase letter followed by up to 62
        +   * lowercase letters, numbers, hyphens, or dots. Pattern,
        +   * /[a-z][a-z0-9-\.]{2,62}/.
        +   * 
        + * + * string policy_binding_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for policyBindingId. + */ + com.google.protobuf.ByteString getPolicyBindingIdBytes(); + + /** + * + * + *
        +   * Required. The policy binding to create.
        +   * 
        + * + * + * .google.iam.v3beta.PolicyBinding policy_binding = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the policyBinding field is set. + */ + boolean hasPolicyBinding(); + + /** + * + * + *
        +   * Required. The policy binding to create.
        +   * 
        + * + * + * .google.iam.v3beta.PolicyBinding policy_binding = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The policyBinding. + */ + com.google.iam.v3beta.PolicyBinding getPolicyBinding(); + + /** + * + * + *
        +   * Required. The policy binding to create.
        +   * 
        + * + * + * .google.iam.v3beta.PolicyBinding policy_binding = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.iam.v3beta.PolicyBindingOrBuilder getPolicyBindingOrBuilder(); + + /** + * + * + *
        +   * Optional. If set, validate the request and preview the creation, but do not
        +   * actually post it.
        +   * 
        + * + * bool validate_only = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The validateOnly. + */ + boolean getValidateOnly(); +} diff --git a/java-iam/proto-google-iam-v3beta/src/main/java/com/google/iam/v3beta/CreatePrincipalAccessBoundaryPolicyRequest.java b/java-iam/proto-google-iam-v3beta/src/main/java/com/google/iam/v3beta/CreatePrincipalAccessBoundaryPolicyRequest.java new file mode 100644 index 0000000000..08b7130ba3 --- /dev/null +++ b/java-iam/proto-google-iam-v3beta/src/main/java/com/google/iam/v3beta/CreatePrincipalAccessBoundaryPolicyRequest.java @@ -0,0 +1,1328 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/iam/v3beta/principal_access_boundary_policies_service.proto +// Protobuf Java Version: 4.33.2 + +package com.google.iam.v3beta; + +/** + * + * + *
        + * Request message for CreatePrincipalAccessBoundaryPolicyRequest method.
        + * 
        + * + * Protobuf type {@code google.iam.v3beta.CreatePrincipalAccessBoundaryPolicyRequest} + */ +@com.google.protobuf.Generated +public final class CreatePrincipalAccessBoundaryPolicyRequest + extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.iam.v3beta.CreatePrincipalAccessBoundaryPolicyRequest) + CreatePrincipalAccessBoundaryPolicyRequestOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "CreatePrincipalAccessBoundaryPolicyRequest"); + } + + // Use CreatePrincipalAccessBoundaryPolicyRequest.newBuilder() to construct. + private CreatePrincipalAccessBoundaryPolicyRequest( + com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private CreatePrincipalAccessBoundaryPolicyRequest() { + parent_ = ""; + principalAccessBoundaryPolicyId_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.iam.v3beta.PrincipalAccessBoundaryPoliciesServiceProto + .internal_static_google_iam_v3beta_CreatePrincipalAccessBoundaryPolicyRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.iam.v3beta.PrincipalAccessBoundaryPoliciesServiceProto + .internal_static_google_iam_v3beta_CreatePrincipalAccessBoundaryPolicyRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.iam.v3beta.CreatePrincipalAccessBoundaryPolicyRequest.class, + com.google.iam.v3beta.CreatePrincipalAccessBoundaryPolicyRequest.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 where this principal access boundary policy
        +   * will be created. Only organizations are supported.
        +   *
        +   * Format:
        +   * `organizations/{organization_id}/locations/{location}`
        +   * 
        + * + * + * 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 where this principal access boundary policy
        +   * will be created. Only organizations are supported.
        +   *
        +   * Format:
        +   * `organizations/{organization_id}/locations/{location}`
        +   * 
        + * + * + * 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 PRINCIPAL_ACCESS_BOUNDARY_POLICY_ID_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object principalAccessBoundaryPolicyId_ = ""; + + /** + * + * + *
        +   * Required. The ID to use for the principal access boundary policy, which
        +   * will become the final component of the principal access boundary policy's
        +   * resource name.
        +   *
        +   * This value must start with a lowercase letter followed by up to 62
        +   * lowercase letters, numbers, hyphens, or dots. Pattern,
        +   * /[a-z][a-z0-9-\.]{2,62}/.
        +   * 
        + * + * string principal_access_boundary_policy_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The principalAccessBoundaryPolicyId. + */ + @java.lang.Override + public java.lang.String getPrincipalAccessBoundaryPolicyId() { + java.lang.Object ref = principalAccessBoundaryPolicyId_; + 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(); + principalAccessBoundaryPolicyId_ = s; + return s; + } + } + + /** + * + * + *
        +   * Required. The ID to use for the principal access boundary policy, which
        +   * will become the final component of the principal access boundary policy's
        +   * resource name.
        +   *
        +   * This value must start with a lowercase letter followed by up to 62
        +   * lowercase letters, numbers, hyphens, or dots. Pattern,
        +   * /[a-z][a-z0-9-\.]{2,62}/.
        +   * 
        + * + * string principal_access_boundary_policy_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The bytes for principalAccessBoundaryPolicyId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getPrincipalAccessBoundaryPolicyIdBytes() { + java.lang.Object ref = principalAccessBoundaryPolicyId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + principalAccessBoundaryPolicyId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PRINCIPAL_ACCESS_BOUNDARY_POLICY_FIELD_NUMBER = 3; + private com.google.iam.v3beta.PrincipalAccessBoundaryPolicy principalAccessBoundaryPolicy_; + + /** + * + * + *
        +   * Required. The principal access boundary policy to create.
        +   * 
        + * + * + * .google.iam.v3beta.PrincipalAccessBoundaryPolicy principal_access_boundary_policy = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the principalAccessBoundaryPolicy field is set. + */ + @java.lang.Override + public boolean hasPrincipalAccessBoundaryPolicy() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
        +   * Required. The principal access boundary policy to create.
        +   * 
        + * + * + * .google.iam.v3beta.PrincipalAccessBoundaryPolicy principal_access_boundary_policy = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The principalAccessBoundaryPolicy. + */ + @java.lang.Override + public com.google.iam.v3beta.PrincipalAccessBoundaryPolicy getPrincipalAccessBoundaryPolicy() { + return principalAccessBoundaryPolicy_ == null + ? com.google.iam.v3beta.PrincipalAccessBoundaryPolicy.getDefaultInstance() + : principalAccessBoundaryPolicy_; + } + + /** + * + * + *
        +   * Required. The principal access boundary policy to create.
        +   * 
        + * + * + * .google.iam.v3beta.PrincipalAccessBoundaryPolicy principal_access_boundary_policy = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.iam.v3beta.PrincipalAccessBoundaryPolicyOrBuilder + getPrincipalAccessBoundaryPolicyOrBuilder() { + return principalAccessBoundaryPolicy_ == null + ? com.google.iam.v3beta.PrincipalAccessBoundaryPolicy.getDefaultInstance() + : principalAccessBoundaryPolicy_; + } + + public static final int VALIDATE_ONLY_FIELD_NUMBER = 4; + private boolean validateOnly_ = false; + + /** + * + * + *
        +   * Optional. If set, validate the request and preview the creation, but do not
        +   * actually post it.
        +   * 
        + * + * bool validate_only = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The validateOnly. + */ + @java.lang.Override + public boolean getValidateOnly() { + return validateOnly_; + } + + 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.GeneratedMessage.isStringEmpty(parent_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, parent_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(principalAccessBoundaryPolicyId_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, principalAccessBoundaryPolicyId_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(3, getPrincipalAccessBoundaryPolicy()); + } + if (validateOnly_ != false) { + output.writeBool(4, validateOnly_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(parent_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, parent_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(principalAccessBoundaryPolicyId_)) { + size += + com.google.protobuf.GeneratedMessage.computeStringSize( + 2, principalAccessBoundaryPolicyId_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 3, getPrincipalAccessBoundaryPolicy()); + } + if (validateOnly_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(4, validateOnly_); + } + 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.iam.v3beta.CreatePrincipalAccessBoundaryPolicyRequest)) { + return super.equals(obj); + } + com.google.iam.v3beta.CreatePrincipalAccessBoundaryPolicyRequest other = + (com.google.iam.v3beta.CreatePrincipalAccessBoundaryPolicyRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (!getPrincipalAccessBoundaryPolicyId().equals(other.getPrincipalAccessBoundaryPolicyId())) + return false; + if (hasPrincipalAccessBoundaryPolicy() != other.hasPrincipalAccessBoundaryPolicy()) + return false; + if (hasPrincipalAccessBoundaryPolicy()) { + if (!getPrincipalAccessBoundaryPolicy().equals(other.getPrincipalAccessBoundaryPolicy())) + return false; + } + if (getValidateOnly() != other.getValidateOnly()) 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) + PRINCIPAL_ACCESS_BOUNDARY_POLICY_ID_FIELD_NUMBER; + hash = (53 * hash) + getPrincipalAccessBoundaryPolicyId().hashCode(); + if (hasPrincipalAccessBoundaryPolicy()) { + hash = (37 * hash) + PRINCIPAL_ACCESS_BOUNDARY_POLICY_FIELD_NUMBER; + hash = (53 * hash) + getPrincipalAccessBoundaryPolicy().hashCode(); + } + hash = (37 * hash) + VALIDATE_ONLY_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getValidateOnly()); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.iam.v3beta.CreatePrincipalAccessBoundaryPolicyRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.iam.v3beta.CreatePrincipalAccessBoundaryPolicyRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.iam.v3beta.CreatePrincipalAccessBoundaryPolicyRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.iam.v3beta.CreatePrincipalAccessBoundaryPolicyRequest 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.iam.v3beta.CreatePrincipalAccessBoundaryPolicyRequest parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.iam.v3beta.CreatePrincipalAccessBoundaryPolicyRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.iam.v3beta.CreatePrincipalAccessBoundaryPolicyRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.iam.v3beta.CreatePrincipalAccessBoundaryPolicyRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.iam.v3beta.CreatePrincipalAccessBoundaryPolicyRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.iam.v3beta.CreatePrincipalAccessBoundaryPolicyRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.iam.v3beta.CreatePrincipalAccessBoundaryPolicyRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.iam.v3beta.CreatePrincipalAccessBoundaryPolicyRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.iam.v3beta.CreatePrincipalAccessBoundaryPolicyRequest 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
        +   * Request message for CreatePrincipalAccessBoundaryPolicyRequest method.
        +   * 
        + * + * Protobuf type {@code google.iam.v3beta.CreatePrincipalAccessBoundaryPolicyRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.iam.v3beta.CreatePrincipalAccessBoundaryPolicyRequest) + com.google.iam.v3beta.CreatePrincipalAccessBoundaryPolicyRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.iam.v3beta.PrincipalAccessBoundaryPoliciesServiceProto + .internal_static_google_iam_v3beta_CreatePrincipalAccessBoundaryPolicyRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.iam.v3beta.PrincipalAccessBoundaryPoliciesServiceProto + .internal_static_google_iam_v3beta_CreatePrincipalAccessBoundaryPolicyRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.iam.v3beta.CreatePrincipalAccessBoundaryPolicyRequest.class, + com.google.iam.v3beta.CreatePrincipalAccessBoundaryPolicyRequest.Builder.class); + } + + // Construct using com.google.iam.v3beta.CreatePrincipalAccessBoundaryPolicyRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetPrincipalAccessBoundaryPolicyFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + parent_ = ""; + principalAccessBoundaryPolicyId_ = ""; + principalAccessBoundaryPolicy_ = null; + if (principalAccessBoundaryPolicyBuilder_ != null) { + principalAccessBoundaryPolicyBuilder_.dispose(); + principalAccessBoundaryPolicyBuilder_ = null; + } + validateOnly_ = false; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.iam.v3beta.PrincipalAccessBoundaryPoliciesServiceProto + .internal_static_google_iam_v3beta_CreatePrincipalAccessBoundaryPolicyRequest_descriptor; + } + + @java.lang.Override + public com.google.iam.v3beta.CreatePrincipalAccessBoundaryPolicyRequest + getDefaultInstanceForType() { + return com.google.iam.v3beta.CreatePrincipalAccessBoundaryPolicyRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.iam.v3beta.CreatePrincipalAccessBoundaryPolicyRequest build() { + com.google.iam.v3beta.CreatePrincipalAccessBoundaryPolicyRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.iam.v3beta.CreatePrincipalAccessBoundaryPolicyRequest buildPartial() { + com.google.iam.v3beta.CreatePrincipalAccessBoundaryPolicyRequest result = + new com.google.iam.v3beta.CreatePrincipalAccessBoundaryPolicyRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.iam.v3beta.CreatePrincipalAccessBoundaryPolicyRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.parent_ = parent_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.principalAccessBoundaryPolicyId_ = principalAccessBoundaryPolicyId_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000004) != 0)) { + result.principalAccessBoundaryPolicy_ = + principalAccessBoundaryPolicyBuilder_ == null + ? principalAccessBoundaryPolicy_ + : principalAccessBoundaryPolicyBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.validateOnly_ = validateOnly_; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.iam.v3beta.CreatePrincipalAccessBoundaryPolicyRequest) { + return mergeFrom((com.google.iam.v3beta.CreatePrincipalAccessBoundaryPolicyRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.iam.v3beta.CreatePrincipalAccessBoundaryPolicyRequest other) { + if (other + == com.google.iam.v3beta.CreatePrincipalAccessBoundaryPolicyRequest.getDefaultInstance()) + return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getPrincipalAccessBoundaryPolicyId().isEmpty()) { + principalAccessBoundaryPolicyId_ = other.principalAccessBoundaryPolicyId_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (other.hasPrincipalAccessBoundaryPolicy()) { + mergePrincipalAccessBoundaryPolicy(other.getPrincipalAccessBoundaryPolicy()); + } + if (other.getValidateOnly() != false) { + setValidateOnly(other.getValidateOnly()); + } + 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: + { + principalAccessBoundaryPolicyId_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + input.readMessage( + internalGetPrincipalAccessBoundaryPolicyFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 32: + { + validateOnly_ = 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 parent_ = ""; + + /** + * + * + *
        +     * Required. The parent resource where this principal access boundary policy
        +     * will be created. Only organizations are supported.
        +     *
        +     * Format:
        +     * `organizations/{organization_id}/locations/{location}`
        +     * 
        + * + * + * 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 where this principal access boundary policy
        +     * will be created. Only organizations are supported.
        +     *
        +     * Format:
        +     * `organizations/{organization_id}/locations/{location}`
        +     * 
        + * + * + * 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 where this principal access boundary policy
        +     * will be created. Only organizations are supported.
        +     *
        +     * Format:
        +     * `organizations/{organization_id}/locations/{location}`
        +     * 
        + * + * + * 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 where this principal access boundary policy
        +     * will be created. Only organizations are supported.
        +     *
        +     * Format:
        +     * `organizations/{organization_id}/locations/{location}`
        +     * 
        + * + * + * 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 where this principal access boundary policy
        +     * will be created. Only organizations are supported.
        +     *
        +     * Format:
        +     * `organizations/{organization_id}/locations/{location}`
        +     * 
        + * + * + * 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 principalAccessBoundaryPolicyId_ = ""; + + /** + * + * + *
        +     * Required. The ID to use for the principal access boundary policy, which
        +     * will become the final component of the principal access boundary policy's
        +     * resource name.
        +     *
        +     * This value must start with a lowercase letter followed by up to 62
        +     * lowercase letters, numbers, hyphens, or dots. Pattern,
        +     * /[a-z][a-z0-9-\.]{2,62}/.
        +     * 
        + * + * + * string principal_access_boundary_policy_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The principalAccessBoundaryPolicyId. + */ + public java.lang.String getPrincipalAccessBoundaryPolicyId() { + java.lang.Object ref = principalAccessBoundaryPolicyId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + principalAccessBoundaryPolicyId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
        +     * Required. The ID to use for the principal access boundary policy, which
        +     * will become the final component of the principal access boundary policy's
        +     * resource name.
        +     *
        +     * This value must start with a lowercase letter followed by up to 62
        +     * lowercase letters, numbers, hyphens, or dots. Pattern,
        +     * /[a-z][a-z0-9-\.]{2,62}/.
        +     * 
        + * + * + * string principal_access_boundary_policy_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The bytes for principalAccessBoundaryPolicyId. + */ + public com.google.protobuf.ByteString getPrincipalAccessBoundaryPolicyIdBytes() { + java.lang.Object ref = principalAccessBoundaryPolicyId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + principalAccessBoundaryPolicyId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
        +     * Required. The ID to use for the principal access boundary policy, which
        +     * will become the final component of the principal access boundary policy's
        +     * resource name.
        +     *
        +     * This value must start with a lowercase letter followed by up to 62
        +     * lowercase letters, numbers, hyphens, or dots. Pattern,
        +     * /[a-z][a-z0-9-\.]{2,62}/.
        +     * 
        + * + * + * string principal_access_boundary_policy_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @param value The principalAccessBoundaryPolicyId to set. + * @return This builder for chaining. + */ + public Builder setPrincipalAccessBoundaryPolicyId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + principalAccessBoundaryPolicyId_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
        +     * Required. The ID to use for the principal access boundary policy, which
        +     * will become the final component of the principal access boundary policy's
        +     * resource name.
        +     *
        +     * This value must start with a lowercase letter followed by up to 62
        +     * lowercase letters, numbers, hyphens, or dots. Pattern,
        +     * /[a-z][a-z0-9-\.]{2,62}/.
        +     * 
        + * + * + * string principal_access_boundary_policy_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return This builder for chaining. + */ + public Builder clearPrincipalAccessBoundaryPolicyId() { + principalAccessBoundaryPolicyId_ = getDefaultInstance().getPrincipalAccessBoundaryPolicyId(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
        +     * Required. The ID to use for the principal access boundary policy, which
        +     * will become the final component of the principal access boundary policy's
        +     * resource name.
        +     *
        +     * This value must start with a lowercase letter followed by up to 62
        +     * lowercase letters, numbers, hyphens, or dots. Pattern,
        +     * /[a-z][a-z0-9-\.]{2,62}/.
        +     * 
        + * + * + * string principal_access_boundary_policy_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @param value The bytes for principalAccessBoundaryPolicyId to set. + * @return This builder for chaining. + */ + public Builder setPrincipalAccessBoundaryPolicyIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + principalAccessBoundaryPolicyId_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private com.google.iam.v3beta.PrincipalAccessBoundaryPolicy principalAccessBoundaryPolicy_; + private com.google.protobuf.SingleFieldBuilder< + com.google.iam.v3beta.PrincipalAccessBoundaryPolicy, + com.google.iam.v3beta.PrincipalAccessBoundaryPolicy.Builder, + com.google.iam.v3beta.PrincipalAccessBoundaryPolicyOrBuilder> + principalAccessBoundaryPolicyBuilder_; + + /** + * + * + *
        +     * Required. The principal access boundary policy to create.
        +     * 
        + * + * + * .google.iam.v3beta.PrincipalAccessBoundaryPolicy principal_access_boundary_policy = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the principalAccessBoundaryPolicy field is set. + */ + public boolean hasPrincipalAccessBoundaryPolicy() { + return ((bitField0_ & 0x00000004) != 0); + } + + /** + * + * + *
        +     * Required. The principal access boundary policy to create.
        +     * 
        + * + * + * .google.iam.v3beta.PrincipalAccessBoundaryPolicy principal_access_boundary_policy = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The principalAccessBoundaryPolicy. + */ + public com.google.iam.v3beta.PrincipalAccessBoundaryPolicy getPrincipalAccessBoundaryPolicy() { + if (principalAccessBoundaryPolicyBuilder_ == null) { + return principalAccessBoundaryPolicy_ == null + ? com.google.iam.v3beta.PrincipalAccessBoundaryPolicy.getDefaultInstance() + : principalAccessBoundaryPolicy_; + } else { + return principalAccessBoundaryPolicyBuilder_.getMessage(); + } + } + + /** + * + * + *
        +     * Required. The principal access boundary policy to create.
        +     * 
        + * + * + * .google.iam.v3beta.PrincipalAccessBoundaryPolicy principal_access_boundary_policy = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setPrincipalAccessBoundaryPolicy( + com.google.iam.v3beta.PrincipalAccessBoundaryPolicy value) { + if (principalAccessBoundaryPolicyBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + principalAccessBoundaryPolicy_ = value; + } else { + principalAccessBoundaryPolicyBuilder_.setMessage(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
        +     * Required. The principal access boundary policy to create.
        +     * 
        + * + * + * .google.iam.v3beta.PrincipalAccessBoundaryPolicy principal_access_boundary_policy = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setPrincipalAccessBoundaryPolicy( + com.google.iam.v3beta.PrincipalAccessBoundaryPolicy.Builder builderForValue) { + if (principalAccessBoundaryPolicyBuilder_ == null) { + principalAccessBoundaryPolicy_ = builderForValue.build(); + } else { + principalAccessBoundaryPolicyBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
        +     * Required. The principal access boundary policy to create.
        +     * 
        + * + * + * .google.iam.v3beta.PrincipalAccessBoundaryPolicy principal_access_boundary_policy = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergePrincipalAccessBoundaryPolicy( + com.google.iam.v3beta.PrincipalAccessBoundaryPolicy value) { + if (principalAccessBoundaryPolicyBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0) + && principalAccessBoundaryPolicy_ != null + && principalAccessBoundaryPolicy_ + != com.google.iam.v3beta.PrincipalAccessBoundaryPolicy.getDefaultInstance()) { + getPrincipalAccessBoundaryPolicyBuilder().mergeFrom(value); + } else { + principalAccessBoundaryPolicy_ = value; + } + } else { + principalAccessBoundaryPolicyBuilder_.mergeFrom(value); + } + if (principalAccessBoundaryPolicy_ != null) { + bitField0_ |= 0x00000004; + onChanged(); + } + return this; + } + + /** + * + * + *
        +     * Required. The principal access boundary policy to create.
        +     * 
        + * + * + * .google.iam.v3beta.PrincipalAccessBoundaryPolicy principal_access_boundary_policy = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearPrincipalAccessBoundaryPolicy() { + bitField0_ = (bitField0_ & ~0x00000004); + principalAccessBoundaryPolicy_ = null; + if (principalAccessBoundaryPolicyBuilder_ != null) { + principalAccessBoundaryPolicyBuilder_.dispose(); + principalAccessBoundaryPolicyBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
        +     * Required. The principal access boundary policy to create.
        +     * 
        + * + * + * .google.iam.v3beta.PrincipalAccessBoundaryPolicy principal_access_boundary_policy = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.iam.v3beta.PrincipalAccessBoundaryPolicy.Builder + getPrincipalAccessBoundaryPolicyBuilder() { + bitField0_ |= 0x00000004; + onChanged(); + return internalGetPrincipalAccessBoundaryPolicyFieldBuilder().getBuilder(); + } + + /** + * + * + *
        +     * Required. The principal access boundary policy to create.
        +     * 
        + * + * + * .google.iam.v3beta.PrincipalAccessBoundaryPolicy principal_access_boundary_policy = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.iam.v3beta.PrincipalAccessBoundaryPolicyOrBuilder + getPrincipalAccessBoundaryPolicyOrBuilder() { + if (principalAccessBoundaryPolicyBuilder_ != null) { + return principalAccessBoundaryPolicyBuilder_.getMessageOrBuilder(); + } else { + return principalAccessBoundaryPolicy_ == null + ? com.google.iam.v3beta.PrincipalAccessBoundaryPolicy.getDefaultInstance() + : principalAccessBoundaryPolicy_; + } + } + + /** + * + * + *
        +     * Required. The principal access boundary policy to create.
        +     * 
        + * + * + * .google.iam.v3beta.PrincipalAccessBoundaryPolicy principal_access_boundary_policy = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.iam.v3beta.PrincipalAccessBoundaryPolicy, + com.google.iam.v3beta.PrincipalAccessBoundaryPolicy.Builder, + com.google.iam.v3beta.PrincipalAccessBoundaryPolicyOrBuilder> + internalGetPrincipalAccessBoundaryPolicyFieldBuilder() { + if (principalAccessBoundaryPolicyBuilder_ == null) { + principalAccessBoundaryPolicyBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.iam.v3beta.PrincipalAccessBoundaryPolicy, + com.google.iam.v3beta.PrincipalAccessBoundaryPolicy.Builder, + com.google.iam.v3beta.PrincipalAccessBoundaryPolicyOrBuilder>( + getPrincipalAccessBoundaryPolicy(), getParentForChildren(), isClean()); + principalAccessBoundaryPolicy_ = null; + } + return principalAccessBoundaryPolicyBuilder_; + } + + private boolean validateOnly_; + + /** + * + * + *
        +     * Optional. If set, validate the request and preview the creation, but do not
        +     * actually post it.
        +     * 
        + * + * bool validate_only = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The validateOnly. + */ + @java.lang.Override + public boolean getValidateOnly() { + return validateOnly_; + } + + /** + * + * + *
        +     * Optional. If set, validate the request and preview the creation, but do not
        +     * actually post it.
        +     * 
        + * + * bool validate_only = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The validateOnly to set. + * @return This builder for chaining. + */ + public Builder setValidateOnly(boolean value) { + + validateOnly_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + /** + * + * + *
        +     * Optional. If set, validate the request and preview the creation, but do not
        +     * actually post it.
        +     * 
        + * + * bool validate_only = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearValidateOnly() { + bitField0_ = (bitField0_ & ~0x00000008); + validateOnly_ = false; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.iam.v3beta.CreatePrincipalAccessBoundaryPolicyRequest) + } + + // @@protoc_insertion_point(class_scope:google.iam.v3beta.CreatePrincipalAccessBoundaryPolicyRequest) + private static final com.google.iam.v3beta.CreatePrincipalAccessBoundaryPolicyRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.iam.v3beta.CreatePrincipalAccessBoundaryPolicyRequest(); + } + + public static com.google.iam.v3beta.CreatePrincipalAccessBoundaryPolicyRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CreatePrincipalAccessBoundaryPolicyRequest 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.iam.v3beta.CreatePrincipalAccessBoundaryPolicyRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-iam/proto-google-iam-v3beta/src/main/java/com/google/iam/v3beta/CreatePrincipalAccessBoundaryPolicyRequestOrBuilder.java b/java-iam/proto-google-iam-v3beta/src/main/java/com/google/iam/v3beta/CreatePrincipalAccessBoundaryPolicyRequestOrBuilder.java new file mode 100644 index 0000000000..d5e2f647d5 --- /dev/null +++ b/java-iam/proto-google-iam-v3beta/src/main/java/com/google/iam/v3beta/CreatePrincipalAccessBoundaryPolicyRequestOrBuilder.java @@ -0,0 +1,164 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/iam/v3beta/principal_access_boundary_policies_service.proto +// Protobuf Java Version: 4.33.2 + +package com.google.iam.v3beta; + +@com.google.protobuf.Generated +public interface CreatePrincipalAccessBoundaryPolicyRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.iam.v3beta.CreatePrincipalAccessBoundaryPolicyRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
        +   * Required. The parent resource where this principal access boundary policy
        +   * will be created. Only organizations are supported.
        +   *
        +   * Format:
        +   * `organizations/{organization_id}/locations/{location}`
        +   * 
        + * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + + /** + * + * + *
        +   * Required. The parent resource where this principal access boundary policy
        +   * will be created. Only organizations are supported.
        +   *
        +   * Format:
        +   * `organizations/{organization_id}/locations/{location}`
        +   * 
        + * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
        +   * Required. The ID to use for the principal access boundary policy, which
        +   * will become the final component of the principal access boundary policy's
        +   * resource name.
        +   *
        +   * This value must start with a lowercase letter followed by up to 62
        +   * lowercase letters, numbers, hyphens, or dots. Pattern,
        +   * /[a-z][a-z0-9-\.]{2,62}/.
        +   * 
        + * + * string principal_access_boundary_policy_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The principalAccessBoundaryPolicyId. + */ + java.lang.String getPrincipalAccessBoundaryPolicyId(); + + /** + * + * + *
        +   * Required. The ID to use for the principal access boundary policy, which
        +   * will become the final component of the principal access boundary policy's
        +   * resource name.
        +   *
        +   * This value must start with a lowercase letter followed by up to 62
        +   * lowercase letters, numbers, hyphens, or dots. Pattern,
        +   * /[a-z][a-z0-9-\.]{2,62}/.
        +   * 
        + * + * string principal_access_boundary_policy_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The bytes for principalAccessBoundaryPolicyId. + */ + com.google.protobuf.ByteString getPrincipalAccessBoundaryPolicyIdBytes(); + + /** + * + * + *
        +   * Required. The principal access boundary policy to create.
        +   * 
        + * + * + * .google.iam.v3beta.PrincipalAccessBoundaryPolicy principal_access_boundary_policy = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the principalAccessBoundaryPolicy field is set. + */ + boolean hasPrincipalAccessBoundaryPolicy(); + + /** + * + * + *
        +   * Required. The principal access boundary policy to create.
        +   * 
        + * + * + * .google.iam.v3beta.PrincipalAccessBoundaryPolicy principal_access_boundary_policy = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The principalAccessBoundaryPolicy. + */ + com.google.iam.v3beta.PrincipalAccessBoundaryPolicy getPrincipalAccessBoundaryPolicy(); + + /** + * + * + *
        +   * Required. The principal access boundary policy to create.
        +   * 
        + * + * + * .google.iam.v3beta.PrincipalAccessBoundaryPolicy principal_access_boundary_policy = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.iam.v3beta.PrincipalAccessBoundaryPolicyOrBuilder + getPrincipalAccessBoundaryPolicyOrBuilder(); + + /** + * + * + *
        +   * Optional. If set, validate the request and preview the creation, but do not
        +   * actually post it.
        +   * 
        + * + * bool validate_only = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The validateOnly. + */ + boolean getValidateOnly(); +} diff --git a/java-iam/proto-google-iam-v3beta/src/main/java/com/google/iam/v3beta/DeletePolicyBindingRequest.java b/java-iam/proto-google-iam-v3beta/src/main/java/com/google/iam/v3beta/DeletePolicyBindingRequest.java new file mode 100644 index 0000000000..52a310ce1f --- /dev/null +++ b/java-iam/proto-google-iam-v3beta/src/main/java/com/google/iam/v3beta/DeletePolicyBindingRequest.java @@ -0,0 +1,956 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/iam/v3beta/policy_bindings_service.proto +// Protobuf Java Version: 4.33.2 + +package com.google.iam.v3beta; + +/** + * + * + *
        + * Request message for DeletePolicyBinding method.
        + * 
        + * + * Protobuf type {@code google.iam.v3beta.DeletePolicyBindingRequest} + */ +@com.google.protobuf.Generated +public final class DeletePolicyBindingRequest extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.iam.v3beta.DeletePolicyBindingRequest) + DeletePolicyBindingRequestOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "DeletePolicyBindingRequest"); + } + + // Use DeletePolicyBindingRequest.newBuilder() to construct. + private DeletePolicyBindingRequest(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private DeletePolicyBindingRequest() { + name_ = ""; + etag_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.iam.v3beta.PolicyBindingsServiceProto + .internal_static_google_iam_v3beta_DeletePolicyBindingRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.iam.v3beta.PolicyBindingsServiceProto + .internal_static_google_iam_v3beta_DeletePolicyBindingRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.iam.v3beta.DeletePolicyBindingRequest.class, + com.google.iam.v3beta.DeletePolicyBindingRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + + /** + * + * + *
        +   * Required. The name of the policy binding to delete.
        +   *
        +   * Format:
        +   *
        +   * * `projects/{project_id}/locations/{location}/policyBindings/{policy_binding_id}`
        +   * * `projects/{project_number}/locations/{location}/policyBindings/{policy_binding_id}`
        +   * * `folders/{folder_id}/locations/{location}/policyBindings/{policy_binding_id}`
        +   * * `organizations/{organization_id}/locations/{location}/policyBindings/{policy_binding_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 name of the policy binding to delete.
        +   *
        +   * Format:
        +   *
        +   * * `projects/{project_id}/locations/{location}/policyBindings/{policy_binding_id}`
        +   * * `projects/{project_number}/locations/{location}/policyBindings/{policy_binding_id}`
        +   * * `folders/{folder_id}/locations/{location}/policyBindings/{policy_binding_id}`
        +   * * `organizations/{organization_id}/locations/{location}/policyBindings/{policy_binding_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; + } + } + + public static final int ETAG_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object etag_ = ""; + + /** + * + * + *
        +   * Optional. The etag of the policy binding.
        +   * If this is provided, it must match the server's etag.
        +   * 
        + * + * string etag = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The etag. + */ + @java.lang.Override + public java.lang.String getEtag() { + java.lang.Object ref = etag_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + etag_ = s; + return s; + } + } + + /** + * + * + *
        +   * Optional. The etag of the policy binding.
        +   * If this is provided, it must match the server's etag.
        +   * 
        + * + * string etag = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for etag. + */ + @java.lang.Override + public com.google.protobuf.ByteString getEtagBytes() { + java.lang.Object ref = etag_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + etag_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int VALIDATE_ONLY_FIELD_NUMBER = 3; + private boolean validateOnly_ = false; + + /** + * + * + *
        +   * Optional. If set, validate the request and preview the deletion, but do not
        +   * actually post it.
        +   * 
        + * + * bool validate_only = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The validateOnly. + */ + @java.lang.Override + public boolean getValidateOnly() { + return validateOnly_; + } + + 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.GeneratedMessage.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, name_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(etag_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, etag_); + } + if (validateOnly_ != false) { + output.writeBool(3, validateOnly_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, name_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(etag_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, etag_); + } + if (validateOnly_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(3, validateOnly_); + } + 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.iam.v3beta.DeletePolicyBindingRequest)) { + return super.equals(obj); + } + com.google.iam.v3beta.DeletePolicyBindingRequest other = + (com.google.iam.v3beta.DeletePolicyBindingRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (!getEtag().equals(other.getEtag())) return false; + if (getValidateOnly() != other.getValidateOnly()) 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) + ETAG_FIELD_NUMBER; + hash = (53 * hash) + getEtag().hashCode(); + hash = (37 * hash) + VALIDATE_ONLY_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getValidateOnly()); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.iam.v3beta.DeletePolicyBindingRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.iam.v3beta.DeletePolicyBindingRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.iam.v3beta.DeletePolicyBindingRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.iam.v3beta.DeletePolicyBindingRequest 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.iam.v3beta.DeletePolicyBindingRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.iam.v3beta.DeletePolicyBindingRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.iam.v3beta.DeletePolicyBindingRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.iam.v3beta.DeletePolicyBindingRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.iam.v3beta.DeletePolicyBindingRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.iam.v3beta.DeletePolicyBindingRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.iam.v3beta.DeletePolicyBindingRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.iam.v3beta.DeletePolicyBindingRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.iam.v3beta.DeletePolicyBindingRequest 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
        +   * Request message for DeletePolicyBinding method.
        +   * 
        + * + * Protobuf type {@code google.iam.v3beta.DeletePolicyBindingRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.iam.v3beta.DeletePolicyBindingRequest) + com.google.iam.v3beta.DeletePolicyBindingRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.iam.v3beta.PolicyBindingsServiceProto + .internal_static_google_iam_v3beta_DeletePolicyBindingRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.iam.v3beta.PolicyBindingsServiceProto + .internal_static_google_iam_v3beta_DeletePolicyBindingRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.iam.v3beta.DeletePolicyBindingRequest.class, + com.google.iam.v3beta.DeletePolicyBindingRequest.Builder.class); + } + + // Construct using com.google.iam.v3beta.DeletePolicyBindingRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + etag_ = ""; + validateOnly_ = false; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.iam.v3beta.PolicyBindingsServiceProto + .internal_static_google_iam_v3beta_DeletePolicyBindingRequest_descriptor; + } + + @java.lang.Override + public com.google.iam.v3beta.DeletePolicyBindingRequest getDefaultInstanceForType() { + return com.google.iam.v3beta.DeletePolicyBindingRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.iam.v3beta.DeletePolicyBindingRequest build() { + com.google.iam.v3beta.DeletePolicyBindingRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.iam.v3beta.DeletePolicyBindingRequest buildPartial() { + com.google.iam.v3beta.DeletePolicyBindingRequest result = + new com.google.iam.v3beta.DeletePolicyBindingRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.iam.v3beta.DeletePolicyBindingRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.etag_ = etag_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.validateOnly_ = validateOnly_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.iam.v3beta.DeletePolicyBindingRequest) { + return mergeFrom((com.google.iam.v3beta.DeletePolicyBindingRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.iam.v3beta.DeletePolicyBindingRequest other) { + if (other == com.google.iam.v3beta.DeletePolicyBindingRequest.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getEtag().isEmpty()) { + etag_ = other.etag_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (other.getValidateOnly() != false) { + setValidateOnly(other.getValidateOnly()); + } + 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: + { + etag_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 24: + { + validateOnly_ = 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 name_ = ""; + + /** + * + * + *
        +     * Required. The name of the policy binding to delete.
        +     *
        +     * Format:
        +     *
        +     * * `projects/{project_id}/locations/{location}/policyBindings/{policy_binding_id}`
        +     * * `projects/{project_number}/locations/{location}/policyBindings/{policy_binding_id}`
        +     * * `folders/{folder_id}/locations/{location}/policyBindings/{policy_binding_id}`
        +     * * `organizations/{organization_id}/locations/{location}/policyBindings/{policy_binding_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 name of the policy binding to delete.
        +     *
        +     * Format:
        +     *
        +     * * `projects/{project_id}/locations/{location}/policyBindings/{policy_binding_id}`
        +     * * `projects/{project_number}/locations/{location}/policyBindings/{policy_binding_id}`
        +     * * `folders/{folder_id}/locations/{location}/policyBindings/{policy_binding_id}`
        +     * * `organizations/{organization_id}/locations/{location}/policyBindings/{policy_binding_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 name of the policy binding to delete.
        +     *
        +     * Format:
        +     *
        +     * * `projects/{project_id}/locations/{location}/policyBindings/{policy_binding_id}`
        +     * * `projects/{project_number}/locations/{location}/policyBindings/{policy_binding_id}`
        +     * * `folders/{folder_id}/locations/{location}/policyBindings/{policy_binding_id}`
        +     * * `organizations/{organization_id}/locations/{location}/policyBindings/{policy_binding_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 name of the policy binding to delete.
        +     *
        +     * Format:
        +     *
        +     * * `projects/{project_id}/locations/{location}/policyBindings/{policy_binding_id}`
        +     * * `projects/{project_number}/locations/{location}/policyBindings/{policy_binding_id}`
        +     * * `folders/{folder_id}/locations/{location}/policyBindings/{policy_binding_id}`
        +     * * `organizations/{organization_id}/locations/{location}/policyBindings/{policy_binding_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 name of the policy binding to delete.
        +     *
        +     * Format:
        +     *
        +     * * `projects/{project_id}/locations/{location}/policyBindings/{policy_binding_id}`
        +     * * `projects/{project_number}/locations/{location}/policyBindings/{policy_binding_id}`
        +     * * `folders/{folder_id}/locations/{location}/policyBindings/{policy_binding_id}`
        +     * * `organizations/{organization_id}/locations/{location}/policyBindings/{policy_binding_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; + } + + private java.lang.Object etag_ = ""; + + /** + * + * + *
        +     * Optional. The etag of the policy binding.
        +     * If this is provided, it must match the server's etag.
        +     * 
        + * + * string etag = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The etag. + */ + public java.lang.String getEtag() { + java.lang.Object ref = etag_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + etag_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
        +     * Optional. The etag of the policy binding.
        +     * If this is provided, it must match the server's etag.
        +     * 
        + * + * string etag = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for etag. + */ + public com.google.protobuf.ByteString getEtagBytes() { + java.lang.Object ref = etag_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + etag_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
        +     * Optional. The etag of the policy binding.
        +     * If this is provided, it must match the server's etag.
        +     * 
        + * + * string etag = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The etag to set. + * @return This builder for chaining. + */ + public Builder setEtag(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + etag_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
        +     * Optional. The etag of the policy binding.
        +     * If this is provided, it must match the server's etag.
        +     * 
        + * + * string etag = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearEtag() { + etag_ = getDefaultInstance().getEtag(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
        +     * Optional. The etag of the policy binding.
        +     * If this is provided, it must match the server's etag.
        +     * 
        + * + * string etag = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for etag to set. + * @return This builder for chaining. + */ + public Builder setEtagBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + etag_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private boolean validateOnly_; + + /** + * + * + *
        +     * Optional. If set, validate the request and preview the deletion, but do not
        +     * actually post it.
        +     * 
        + * + * bool validate_only = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The validateOnly. + */ + @java.lang.Override + public boolean getValidateOnly() { + return validateOnly_; + } + + /** + * + * + *
        +     * Optional. If set, validate the request and preview the deletion, but do not
        +     * actually post it.
        +     * 
        + * + * bool validate_only = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The validateOnly to set. + * @return This builder for chaining. + */ + public Builder setValidateOnly(boolean value) { + + validateOnly_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
        +     * Optional. If set, validate the request and preview the deletion, but do not
        +     * actually post it.
        +     * 
        + * + * bool validate_only = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearValidateOnly() { + bitField0_ = (bitField0_ & ~0x00000004); + validateOnly_ = false; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.iam.v3beta.DeletePolicyBindingRequest) + } + + // @@protoc_insertion_point(class_scope:google.iam.v3beta.DeletePolicyBindingRequest) + private static final com.google.iam.v3beta.DeletePolicyBindingRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.iam.v3beta.DeletePolicyBindingRequest(); + } + + public static com.google.iam.v3beta.DeletePolicyBindingRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DeletePolicyBindingRequest 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.iam.v3beta.DeletePolicyBindingRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-iam/proto-google-iam-v3beta/src/main/java/com/google/iam/v3beta/DeletePolicyBindingRequestOrBuilder.java b/java-iam/proto-google-iam-v3beta/src/main/java/com/google/iam/v3beta/DeletePolicyBindingRequestOrBuilder.java new file mode 100644 index 0000000000..17a464473b --- /dev/null +++ b/java-iam/proto-google-iam-v3beta/src/main/java/com/google/iam/v3beta/DeletePolicyBindingRequestOrBuilder.java @@ -0,0 +1,114 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/iam/v3beta/policy_bindings_service.proto +// Protobuf Java Version: 4.33.2 + +package com.google.iam.v3beta; + +@com.google.protobuf.Generated +public interface DeletePolicyBindingRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.iam.v3beta.DeletePolicyBindingRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
        +   * Required. The name of the policy binding to delete.
        +   *
        +   * Format:
        +   *
        +   * * `projects/{project_id}/locations/{location}/policyBindings/{policy_binding_id}`
        +   * * `projects/{project_number}/locations/{location}/policyBindings/{policy_binding_id}`
        +   * * `folders/{folder_id}/locations/{location}/policyBindings/{policy_binding_id}`
        +   * * `organizations/{organization_id}/locations/{location}/policyBindings/{policy_binding_id}`
        +   * 
        + * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + + /** + * + * + *
        +   * Required. The name of the policy binding to delete.
        +   *
        +   * Format:
        +   *
        +   * * `projects/{project_id}/locations/{location}/policyBindings/{policy_binding_id}`
        +   * * `projects/{project_number}/locations/{location}/policyBindings/{policy_binding_id}`
        +   * * `folders/{folder_id}/locations/{location}/policyBindings/{policy_binding_id}`
        +   * * `organizations/{organization_id}/locations/{location}/policyBindings/{policy_binding_id}`
        +   * 
        + * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
        +   * Optional. The etag of the policy binding.
        +   * If this is provided, it must match the server's etag.
        +   * 
        + * + * string etag = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The etag. + */ + java.lang.String getEtag(); + + /** + * + * + *
        +   * Optional. The etag of the policy binding.
        +   * If this is provided, it must match the server's etag.
        +   * 
        + * + * string etag = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for etag. + */ + com.google.protobuf.ByteString getEtagBytes(); + + /** + * + * + *
        +   * Optional. If set, validate the request and preview the deletion, but do not
        +   * actually post it.
        +   * 
        + * + * bool validate_only = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The validateOnly. + */ + boolean getValidateOnly(); +} diff --git a/java-iam/proto-google-iam-v3beta/src/main/java/com/google/iam/v3beta/DeletePrincipalAccessBoundaryPolicyRequest.java b/java-iam/proto-google-iam-v3beta/src/main/java/com/google/iam/v3beta/DeletePrincipalAccessBoundaryPolicyRequest.java new file mode 100644 index 0000000000..e7bab0351f --- /dev/null +++ b/java-iam/proto-google-iam-v3beta/src/main/java/com/google/iam/v3beta/DeletePrincipalAccessBoundaryPolicyRequest.java @@ -0,0 +1,1041 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/iam/v3beta/principal_access_boundary_policies_service.proto +// Protobuf Java Version: 4.33.2 + +package com.google.iam.v3beta; + +/** + * + * + *
        + * Request message for DeletePrincipalAccessBoundaryPolicy method.
        + * 
        + * + * Protobuf type {@code google.iam.v3beta.DeletePrincipalAccessBoundaryPolicyRequest} + */ +@com.google.protobuf.Generated +public final class DeletePrincipalAccessBoundaryPolicyRequest + extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.iam.v3beta.DeletePrincipalAccessBoundaryPolicyRequest) + DeletePrincipalAccessBoundaryPolicyRequestOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "DeletePrincipalAccessBoundaryPolicyRequest"); + } + + // Use DeletePrincipalAccessBoundaryPolicyRequest.newBuilder() to construct. + private DeletePrincipalAccessBoundaryPolicyRequest( + com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private DeletePrincipalAccessBoundaryPolicyRequest() { + name_ = ""; + etag_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.iam.v3beta.PrincipalAccessBoundaryPoliciesServiceProto + .internal_static_google_iam_v3beta_DeletePrincipalAccessBoundaryPolicyRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.iam.v3beta.PrincipalAccessBoundaryPoliciesServiceProto + .internal_static_google_iam_v3beta_DeletePrincipalAccessBoundaryPolicyRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.iam.v3beta.DeletePrincipalAccessBoundaryPolicyRequest.class, + com.google.iam.v3beta.DeletePrincipalAccessBoundaryPolicyRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + + /** + * + * + *
        +   * Required. The name of the principal access boundary policy to delete.
        +   *
        +   * Format:
        +   * `organizations/{organization_id}/locations/{location}/principalAccessBoundaryPolicies/{principal_access_boundary_policy_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 name of the principal access boundary policy to delete.
        +   *
        +   * Format:
        +   * `organizations/{organization_id}/locations/{location}/principalAccessBoundaryPolicies/{principal_access_boundary_policy_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; + } + } + + public static final int ETAG_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object etag_ = ""; + + /** + * + * + *
        +   * Optional. The etag of the principal access boundary policy.
        +   * If this is provided, it must match the server's etag.
        +   * 
        + * + * string etag = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The etag. + */ + @java.lang.Override + public java.lang.String getEtag() { + java.lang.Object ref = etag_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + etag_ = s; + return s; + } + } + + /** + * + * + *
        +   * Optional. The etag of the principal access boundary policy.
        +   * If this is provided, it must match the server's etag.
        +   * 
        + * + * string etag = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for etag. + */ + @java.lang.Override + public com.google.protobuf.ByteString getEtagBytes() { + java.lang.Object ref = etag_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + etag_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int VALIDATE_ONLY_FIELD_NUMBER = 3; + private boolean validateOnly_ = false; + + /** + * + * + *
        +   * Optional. If set, validate the request and preview the deletion, but do not
        +   * actually post it.
        +   * 
        + * + * bool validate_only = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The validateOnly. + */ + @java.lang.Override + public boolean getValidateOnly() { + return validateOnly_; + } + + public static final int FORCE_FIELD_NUMBER = 4; + private boolean force_ = false; + + /** + * + * + *
        +   * Optional. If set to true, the request will force the deletion of the policy
        +   * even if the policy is referenced in policy bindings.
        +   * 
        + * + * bool force = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The force. + */ + @java.lang.Override + public boolean getForce() { + return force_; + } + + 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.GeneratedMessage.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, name_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(etag_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, etag_); + } + if (validateOnly_ != false) { + output.writeBool(3, validateOnly_); + } + if (force_ != false) { + output.writeBool(4, force_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, name_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(etag_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, etag_); + } + if (validateOnly_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(3, validateOnly_); + } + if (force_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(4, force_); + } + 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.iam.v3beta.DeletePrincipalAccessBoundaryPolicyRequest)) { + return super.equals(obj); + } + com.google.iam.v3beta.DeletePrincipalAccessBoundaryPolicyRequest other = + (com.google.iam.v3beta.DeletePrincipalAccessBoundaryPolicyRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (!getEtag().equals(other.getEtag())) return false; + if (getValidateOnly() != other.getValidateOnly()) return false; + if (getForce() != other.getForce()) 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) + ETAG_FIELD_NUMBER; + hash = (53 * hash) + getEtag().hashCode(); + hash = (37 * hash) + VALIDATE_ONLY_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getValidateOnly()); + hash = (37 * hash) + FORCE_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getForce()); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.iam.v3beta.DeletePrincipalAccessBoundaryPolicyRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.iam.v3beta.DeletePrincipalAccessBoundaryPolicyRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.iam.v3beta.DeletePrincipalAccessBoundaryPolicyRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.iam.v3beta.DeletePrincipalAccessBoundaryPolicyRequest 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.iam.v3beta.DeletePrincipalAccessBoundaryPolicyRequest parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.iam.v3beta.DeletePrincipalAccessBoundaryPolicyRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.iam.v3beta.DeletePrincipalAccessBoundaryPolicyRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.iam.v3beta.DeletePrincipalAccessBoundaryPolicyRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.iam.v3beta.DeletePrincipalAccessBoundaryPolicyRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.iam.v3beta.DeletePrincipalAccessBoundaryPolicyRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.iam.v3beta.DeletePrincipalAccessBoundaryPolicyRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.iam.v3beta.DeletePrincipalAccessBoundaryPolicyRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.iam.v3beta.DeletePrincipalAccessBoundaryPolicyRequest 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
        +   * Request message for DeletePrincipalAccessBoundaryPolicy method.
        +   * 
        + * + * Protobuf type {@code google.iam.v3beta.DeletePrincipalAccessBoundaryPolicyRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.iam.v3beta.DeletePrincipalAccessBoundaryPolicyRequest) + com.google.iam.v3beta.DeletePrincipalAccessBoundaryPolicyRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.iam.v3beta.PrincipalAccessBoundaryPoliciesServiceProto + .internal_static_google_iam_v3beta_DeletePrincipalAccessBoundaryPolicyRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.iam.v3beta.PrincipalAccessBoundaryPoliciesServiceProto + .internal_static_google_iam_v3beta_DeletePrincipalAccessBoundaryPolicyRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.iam.v3beta.DeletePrincipalAccessBoundaryPolicyRequest.class, + com.google.iam.v3beta.DeletePrincipalAccessBoundaryPolicyRequest.Builder.class); + } + + // Construct using com.google.iam.v3beta.DeletePrincipalAccessBoundaryPolicyRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + etag_ = ""; + validateOnly_ = false; + force_ = false; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.iam.v3beta.PrincipalAccessBoundaryPoliciesServiceProto + .internal_static_google_iam_v3beta_DeletePrincipalAccessBoundaryPolicyRequest_descriptor; + } + + @java.lang.Override + public com.google.iam.v3beta.DeletePrincipalAccessBoundaryPolicyRequest + getDefaultInstanceForType() { + return com.google.iam.v3beta.DeletePrincipalAccessBoundaryPolicyRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.iam.v3beta.DeletePrincipalAccessBoundaryPolicyRequest build() { + com.google.iam.v3beta.DeletePrincipalAccessBoundaryPolicyRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.iam.v3beta.DeletePrincipalAccessBoundaryPolicyRequest buildPartial() { + com.google.iam.v3beta.DeletePrincipalAccessBoundaryPolicyRequest result = + new com.google.iam.v3beta.DeletePrincipalAccessBoundaryPolicyRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.iam.v3beta.DeletePrincipalAccessBoundaryPolicyRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.etag_ = etag_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.validateOnly_ = validateOnly_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.force_ = force_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.iam.v3beta.DeletePrincipalAccessBoundaryPolicyRequest) { + return mergeFrom((com.google.iam.v3beta.DeletePrincipalAccessBoundaryPolicyRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.iam.v3beta.DeletePrincipalAccessBoundaryPolicyRequest other) { + if (other + == com.google.iam.v3beta.DeletePrincipalAccessBoundaryPolicyRequest.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getEtag().isEmpty()) { + etag_ = other.etag_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (other.getValidateOnly() != false) { + setValidateOnly(other.getValidateOnly()); + } + if (other.getForce() != false) { + setForce(other.getForce()); + } + 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: + { + etag_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 24: + { + validateOnly_ = input.readBool(); + bitField0_ |= 0x00000004; + break; + } // case 24 + case 32: + { + force_ = 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 name_ = ""; + + /** + * + * + *
        +     * Required. The name of the principal access boundary policy to delete.
        +     *
        +     * Format:
        +     * `organizations/{organization_id}/locations/{location}/principalAccessBoundaryPolicies/{principal_access_boundary_policy_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 name of the principal access boundary policy to delete.
        +     *
        +     * Format:
        +     * `organizations/{organization_id}/locations/{location}/principalAccessBoundaryPolicies/{principal_access_boundary_policy_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 name of the principal access boundary policy to delete.
        +     *
        +     * Format:
        +     * `organizations/{organization_id}/locations/{location}/principalAccessBoundaryPolicies/{principal_access_boundary_policy_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 name of the principal access boundary policy to delete.
        +     *
        +     * Format:
        +     * `organizations/{organization_id}/locations/{location}/principalAccessBoundaryPolicies/{principal_access_boundary_policy_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 name of the principal access boundary policy to delete.
        +     *
        +     * Format:
        +     * `organizations/{organization_id}/locations/{location}/principalAccessBoundaryPolicies/{principal_access_boundary_policy_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; + } + + private java.lang.Object etag_ = ""; + + /** + * + * + *
        +     * Optional. The etag of the principal access boundary policy.
        +     * If this is provided, it must match the server's etag.
        +     * 
        + * + * string etag = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The etag. + */ + public java.lang.String getEtag() { + java.lang.Object ref = etag_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + etag_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
        +     * Optional. The etag of the principal access boundary policy.
        +     * If this is provided, it must match the server's etag.
        +     * 
        + * + * string etag = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for etag. + */ + public com.google.protobuf.ByteString getEtagBytes() { + java.lang.Object ref = etag_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + etag_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
        +     * Optional. The etag of the principal access boundary policy.
        +     * If this is provided, it must match the server's etag.
        +     * 
        + * + * string etag = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The etag to set. + * @return This builder for chaining. + */ + public Builder setEtag(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + etag_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
        +     * Optional. The etag of the principal access boundary policy.
        +     * If this is provided, it must match the server's etag.
        +     * 
        + * + * string etag = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearEtag() { + etag_ = getDefaultInstance().getEtag(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
        +     * Optional. The etag of the principal access boundary policy.
        +     * If this is provided, it must match the server's etag.
        +     * 
        + * + * string etag = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for etag to set. + * @return This builder for chaining. + */ + public Builder setEtagBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + etag_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private boolean validateOnly_; + + /** + * + * + *
        +     * Optional. If set, validate the request and preview the deletion, but do not
        +     * actually post it.
        +     * 
        + * + * bool validate_only = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The validateOnly. + */ + @java.lang.Override + public boolean getValidateOnly() { + return validateOnly_; + } + + /** + * + * + *
        +     * Optional. If set, validate the request and preview the deletion, but do not
        +     * actually post it.
        +     * 
        + * + * bool validate_only = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The validateOnly to set. + * @return This builder for chaining. + */ + public Builder setValidateOnly(boolean value) { + + validateOnly_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
        +     * Optional. If set, validate the request and preview the deletion, but do not
        +     * actually post it.
        +     * 
        + * + * bool validate_only = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearValidateOnly() { + bitField0_ = (bitField0_ & ~0x00000004); + validateOnly_ = false; + onChanged(); + return this; + } + + private boolean force_; + + /** + * + * + *
        +     * Optional. If set to true, the request will force the deletion of the policy
        +     * even if the policy is referenced in policy bindings.
        +     * 
        + * + * bool force = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The force. + */ + @java.lang.Override + public boolean getForce() { + return force_; + } + + /** + * + * + *
        +     * Optional. If set to true, the request will force the deletion of the policy
        +     * even if the policy is referenced in policy bindings.
        +     * 
        + * + * bool force = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The force to set. + * @return This builder for chaining. + */ + public Builder setForce(boolean value) { + + force_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + /** + * + * + *
        +     * Optional. If set to true, the request will force the deletion of the policy
        +     * even if the policy is referenced in policy bindings.
        +     * 
        + * + * bool force = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearForce() { + bitField0_ = (bitField0_ & ~0x00000008); + force_ = false; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.iam.v3beta.DeletePrincipalAccessBoundaryPolicyRequest) + } + + // @@protoc_insertion_point(class_scope:google.iam.v3beta.DeletePrincipalAccessBoundaryPolicyRequest) + private static final com.google.iam.v3beta.DeletePrincipalAccessBoundaryPolicyRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.iam.v3beta.DeletePrincipalAccessBoundaryPolicyRequest(); + } + + public static com.google.iam.v3beta.DeletePrincipalAccessBoundaryPolicyRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DeletePrincipalAccessBoundaryPolicyRequest 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.iam.v3beta.DeletePrincipalAccessBoundaryPolicyRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-iam/proto-google-iam-v3beta/src/main/java/com/google/iam/v3beta/DeletePrincipalAccessBoundaryPolicyRequestOrBuilder.java b/java-iam/proto-google-iam-v3beta/src/main/java/com/google/iam/v3beta/DeletePrincipalAccessBoundaryPolicyRequestOrBuilder.java new file mode 100644 index 0000000000..e9b61bc2e1 --- /dev/null +++ b/java-iam/proto-google-iam-v3beta/src/main/java/com/google/iam/v3beta/DeletePrincipalAccessBoundaryPolicyRequestOrBuilder.java @@ -0,0 +1,120 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/iam/v3beta/principal_access_boundary_policies_service.proto +// Protobuf Java Version: 4.33.2 + +package com.google.iam.v3beta; + +@com.google.protobuf.Generated +public interface DeletePrincipalAccessBoundaryPolicyRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.iam.v3beta.DeletePrincipalAccessBoundaryPolicyRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
        +   * Required. The name of the principal access boundary policy to delete.
        +   *
        +   * Format:
        +   * `organizations/{organization_id}/locations/{location}/principalAccessBoundaryPolicies/{principal_access_boundary_policy_id}`
        +   * 
        + * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + + /** + * + * + *
        +   * Required. The name of the principal access boundary policy to delete.
        +   *
        +   * Format:
        +   * `organizations/{organization_id}/locations/{location}/principalAccessBoundaryPolicies/{principal_access_boundary_policy_id}`
        +   * 
        + * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
        +   * Optional. The etag of the principal access boundary policy.
        +   * If this is provided, it must match the server's etag.
        +   * 
        + * + * string etag = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The etag. + */ + java.lang.String getEtag(); + + /** + * + * + *
        +   * Optional. The etag of the principal access boundary policy.
        +   * If this is provided, it must match the server's etag.
        +   * 
        + * + * string etag = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for etag. + */ + com.google.protobuf.ByteString getEtagBytes(); + + /** + * + * + *
        +   * Optional. If set, validate the request and preview the deletion, but do not
        +   * actually post it.
        +   * 
        + * + * bool validate_only = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The validateOnly. + */ + boolean getValidateOnly(); + + /** + * + * + *
        +   * Optional. If set to true, the request will force the deletion of the policy
        +   * even if the policy is referenced in policy bindings.
        +   * 
        + * + * bool force = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The force. + */ + boolean getForce(); +} diff --git a/java-iam/proto-google-iam-v3beta/src/main/java/com/google/iam/v3beta/FolderLocationName.java b/java-iam/proto-google-iam-v3beta/src/main/java/com/google/iam/v3beta/FolderLocationName.java new file mode 100644 index 0000000000..052e3ef043 --- /dev/null +++ b/java-iam/proto-google-iam-v3beta/src/main/java/com/google/iam/v3beta/FolderLocationName.java @@ -0,0 +1,192 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.iam.v3beta; + +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-iam/proto-google-iam-v3beta/src/main/java/com/google/iam/v3beta/GetPolicyBindingRequest.java b/java-iam/proto-google-iam-v3beta/src/main/java/com/google/iam/v3beta/GetPolicyBindingRequest.java new file mode 100644 index 0000000000..78d0029e6e --- /dev/null +++ b/java-iam/proto-google-iam-v3beta/src/main/java/com/google/iam/v3beta/GetPolicyBindingRequest.java @@ -0,0 +1,658 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/iam/v3beta/policy_bindings_service.proto +// Protobuf Java Version: 4.33.2 + +package com.google.iam.v3beta; + +/** + * + * + *
        + * Request message for GetPolicyBinding method.
        + * 
        + * + * Protobuf type {@code google.iam.v3beta.GetPolicyBindingRequest} + */ +@com.google.protobuf.Generated +public final class GetPolicyBindingRequest extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.iam.v3beta.GetPolicyBindingRequest) + GetPolicyBindingRequestOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "GetPolicyBindingRequest"); + } + + // Use GetPolicyBindingRequest.newBuilder() to construct. + private GetPolicyBindingRequest(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private GetPolicyBindingRequest() { + name_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.iam.v3beta.PolicyBindingsServiceProto + .internal_static_google_iam_v3beta_GetPolicyBindingRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.iam.v3beta.PolicyBindingsServiceProto + .internal_static_google_iam_v3beta_GetPolicyBindingRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.iam.v3beta.GetPolicyBindingRequest.class, + com.google.iam.v3beta.GetPolicyBindingRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + + /** + * + * + *
        +   * Required. The name of the policy binding to retrieve.
        +   *
        +   * Format:
        +   *
        +   * * `projects/{project_id}/locations/{location}/policyBindings/{policy_binding_id}`
        +   * * `projects/{project_number}/locations/{location}/policyBindings/{policy_binding_id}`
        +   * * `folders/{folder_id}/locations/{location}/policyBindings/{policy_binding_id}`
        +   * * `organizations/{organization_id}/locations/{location}/policyBindings/{policy_binding_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 name of the policy binding to retrieve.
        +   *
        +   * Format:
        +   *
        +   * * `projects/{project_id}/locations/{location}/policyBindings/{policy_binding_id}`
        +   * * `projects/{project_number}/locations/{location}/policyBindings/{policy_binding_id}`
        +   * * `folders/{folder_id}/locations/{location}/policyBindings/{policy_binding_id}`
        +   * * `organizations/{organization_id}/locations/{location}/policyBindings/{policy_binding_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.GeneratedMessage.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessage.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.GeneratedMessage.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessage.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.iam.v3beta.GetPolicyBindingRequest)) { + return super.equals(obj); + } + com.google.iam.v3beta.GetPolicyBindingRequest other = + (com.google.iam.v3beta.GetPolicyBindingRequest) 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.iam.v3beta.GetPolicyBindingRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.iam.v3beta.GetPolicyBindingRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.iam.v3beta.GetPolicyBindingRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.iam.v3beta.GetPolicyBindingRequest 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.iam.v3beta.GetPolicyBindingRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.iam.v3beta.GetPolicyBindingRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.iam.v3beta.GetPolicyBindingRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.iam.v3beta.GetPolicyBindingRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.iam.v3beta.GetPolicyBindingRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.iam.v3beta.GetPolicyBindingRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.iam.v3beta.GetPolicyBindingRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.iam.v3beta.GetPolicyBindingRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.iam.v3beta.GetPolicyBindingRequest 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
        +   * Request message for GetPolicyBinding method.
        +   * 
        + * + * Protobuf type {@code google.iam.v3beta.GetPolicyBindingRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.iam.v3beta.GetPolicyBindingRequest) + com.google.iam.v3beta.GetPolicyBindingRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.iam.v3beta.PolicyBindingsServiceProto + .internal_static_google_iam_v3beta_GetPolicyBindingRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.iam.v3beta.PolicyBindingsServiceProto + .internal_static_google_iam_v3beta_GetPolicyBindingRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.iam.v3beta.GetPolicyBindingRequest.class, + com.google.iam.v3beta.GetPolicyBindingRequest.Builder.class); + } + + // Construct using com.google.iam.v3beta.GetPolicyBindingRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.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.iam.v3beta.PolicyBindingsServiceProto + .internal_static_google_iam_v3beta_GetPolicyBindingRequest_descriptor; + } + + @java.lang.Override + public com.google.iam.v3beta.GetPolicyBindingRequest getDefaultInstanceForType() { + return com.google.iam.v3beta.GetPolicyBindingRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.iam.v3beta.GetPolicyBindingRequest build() { + com.google.iam.v3beta.GetPolicyBindingRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.iam.v3beta.GetPolicyBindingRequest buildPartial() { + com.google.iam.v3beta.GetPolicyBindingRequest result = + new com.google.iam.v3beta.GetPolicyBindingRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.iam.v3beta.GetPolicyBindingRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.iam.v3beta.GetPolicyBindingRequest) { + return mergeFrom((com.google.iam.v3beta.GetPolicyBindingRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.iam.v3beta.GetPolicyBindingRequest other) { + if (other == com.google.iam.v3beta.GetPolicyBindingRequest.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 name of the policy binding to retrieve.
        +     *
        +     * Format:
        +     *
        +     * * `projects/{project_id}/locations/{location}/policyBindings/{policy_binding_id}`
        +     * * `projects/{project_number}/locations/{location}/policyBindings/{policy_binding_id}`
        +     * * `folders/{folder_id}/locations/{location}/policyBindings/{policy_binding_id}`
        +     * * `organizations/{organization_id}/locations/{location}/policyBindings/{policy_binding_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 name of the policy binding to retrieve.
        +     *
        +     * Format:
        +     *
        +     * * `projects/{project_id}/locations/{location}/policyBindings/{policy_binding_id}`
        +     * * `projects/{project_number}/locations/{location}/policyBindings/{policy_binding_id}`
        +     * * `folders/{folder_id}/locations/{location}/policyBindings/{policy_binding_id}`
        +     * * `organizations/{organization_id}/locations/{location}/policyBindings/{policy_binding_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 name of the policy binding to retrieve.
        +     *
        +     * Format:
        +     *
        +     * * `projects/{project_id}/locations/{location}/policyBindings/{policy_binding_id}`
        +     * * `projects/{project_number}/locations/{location}/policyBindings/{policy_binding_id}`
        +     * * `folders/{folder_id}/locations/{location}/policyBindings/{policy_binding_id}`
        +     * * `organizations/{organization_id}/locations/{location}/policyBindings/{policy_binding_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 name of the policy binding to retrieve.
        +     *
        +     * Format:
        +     *
        +     * * `projects/{project_id}/locations/{location}/policyBindings/{policy_binding_id}`
        +     * * `projects/{project_number}/locations/{location}/policyBindings/{policy_binding_id}`
        +     * * `folders/{folder_id}/locations/{location}/policyBindings/{policy_binding_id}`
        +     * * `organizations/{organization_id}/locations/{location}/policyBindings/{policy_binding_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 name of the policy binding to retrieve.
        +     *
        +     * Format:
        +     *
        +     * * `projects/{project_id}/locations/{location}/policyBindings/{policy_binding_id}`
        +     * * `projects/{project_number}/locations/{location}/policyBindings/{policy_binding_id}`
        +     * * `folders/{folder_id}/locations/{location}/policyBindings/{policy_binding_id}`
        +     * * `organizations/{organization_id}/locations/{location}/policyBindings/{policy_binding_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; + } + + // @@protoc_insertion_point(builder_scope:google.iam.v3beta.GetPolicyBindingRequest) + } + + // @@protoc_insertion_point(class_scope:google.iam.v3beta.GetPolicyBindingRequest) + private static final com.google.iam.v3beta.GetPolicyBindingRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.iam.v3beta.GetPolicyBindingRequest(); + } + + public static com.google.iam.v3beta.GetPolicyBindingRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GetPolicyBindingRequest 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.iam.v3beta.GetPolicyBindingRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-iam/proto-google-iam-v3beta/src/main/java/com/google/iam/v3beta/GetPolicyBindingRequestOrBuilder.java b/java-iam/proto-google-iam-v3beta/src/main/java/com/google/iam/v3beta/GetPolicyBindingRequestOrBuilder.java new file mode 100644 index 0000000000..1108e3dd30 --- /dev/null +++ b/java-iam/proto-google-iam-v3beta/src/main/java/com/google/iam/v3beta/GetPolicyBindingRequestOrBuilder.java @@ -0,0 +1,72 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/iam/v3beta/policy_bindings_service.proto +// Protobuf Java Version: 4.33.2 + +package com.google.iam.v3beta; + +@com.google.protobuf.Generated +public interface GetPolicyBindingRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.iam.v3beta.GetPolicyBindingRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
        +   * Required. The name of the policy binding to retrieve.
        +   *
        +   * Format:
        +   *
        +   * * `projects/{project_id}/locations/{location}/policyBindings/{policy_binding_id}`
        +   * * `projects/{project_number}/locations/{location}/policyBindings/{policy_binding_id}`
        +   * * `folders/{folder_id}/locations/{location}/policyBindings/{policy_binding_id}`
        +   * * `organizations/{organization_id}/locations/{location}/policyBindings/{policy_binding_id}`
        +   * 
        + * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + + /** + * + * + *
        +   * Required. The name of the policy binding to retrieve.
        +   *
        +   * Format:
        +   *
        +   * * `projects/{project_id}/locations/{location}/policyBindings/{policy_binding_id}`
        +   * * `projects/{project_number}/locations/{location}/policyBindings/{policy_binding_id}`
        +   * * `folders/{folder_id}/locations/{location}/policyBindings/{policy_binding_id}`
        +   * * `organizations/{organization_id}/locations/{location}/policyBindings/{policy_binding_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-iam/proto-google-iam-v3beta/src/main/java/com/google/iam/v3beta/GetPrincipalAccessBoundaryPolicyRequest.java b/java-iam/proto-google-iam-v3beta/src/main/java/com/google/iam/v3beta/GetPrincipalAccessBoundaryPolicyRequest.java new file mode 100644 index 0000000000..ad93b8c245 --- /dev/null +++ b/java-iam/proto-google-iam-v3beta/src/main/java/com/google/iam/v3beta/GetPrincipalAccessBoundaryPolicyRequest.java @@ -0,0 +1,638 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/iam/v3beta/principal_access_boundary_policies_service.proto +// Protobuf Java Version: 4.33.2 + +package com.google.iam.v3beta; + +/** + * + * + *
        + * Request message for GetPrincipalAccessBoundaryPolicy method.
        + * 
        + * + * Protobuf type {@code google.iam.v3beta.GetPrincipalAccessBoundaryPolicyRequest} + */ +@com.google.protobuf.Generated +public final class GetPrincipalAccessBoundaryPolicyRequest + extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.iam.v3beta.GetPrincipalAccessBoundaryPolicyRequest) + GetPrincipalAccessBoundaryPolicyRequestOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "GetPrincipalAccessBoundaryPolicyRequest"); + } + + // Use GetPrincipalAccessBoundaryPolicyRequest.newBuilder() to construct. + private GetPrincipalAccessBoundaryPolicyRequest( + com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private GetPrincipalAccessBoundaryPolicyRequest() { + name_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.iam.v3beta.PrincipalAccessBoundaryPoliciesServiceProto + .internal_static_google_iam_v3beta_GetPrincipalAccessBoundaryPolicyRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.iam.v3beta.PrincipalAccessBoundaryPoliciesServiceProto + .internal_static_google_iam_v3beta_GetPrincipalAccessBoundaryPolicyRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.iam.v3beta.GetPrincipalAccessBoundaryPolicyRequest.class, + com.google.iam.v3beta.GetPrincipalAccessBoundaryPolicyRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + + /** + * + * + *
        +   * Required. The name of the principal access boundary policy to retrieve.
        +   *
        +   * Format:
        +   * `organizations/{organization_id}/locations/{location}/principalAccessBoundaryPolicies/{principal_access_boundary_policy_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 name of the principal access boundary policy to retrieve.
        +   *
        +   * Format:
        +   * `organizations/{organization_id}/locations/{location}/principalAccessBoundaryPolicies/{principal_access_boundary_policy_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.GeneratedMessage.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessage.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.GeneratedMessage.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessage.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.iam.v3beta.GetPrincipalAccessBoundaryPolicyRequest)) { + return super.equals(obj); + } + com.google.iam.v3beta.GetPrincipalAccessBoundaryPolicyRequest other = + (com.google.iam.v3beta.GetPrincipalAccessBoundaryPolicyRequest) 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.iam.v3beta.GetPrincipalAccessBoundaryPolicyRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.iam.v3beta.GetPrincipalAccessBoundaryPolicyRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.iam.v3beta.GetPrincipalAccessBoundaryPolicyRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.iam.v3beta.GetPrincipalAccessBoundaryPolicyRequest 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.iam.v3beta.GetPrincipalAccessBoundaryPolicyRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.iam.v3beta.GetPrincipalAccessBoundaryPolicyRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.iam.v3beta.GetPrincipalAccessBoundaryPolicyRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.iam.v3beta.GetPrincipalAccessBoundaryPolicyRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.iam.v3beta.GetPrincipalAccessBoundaryPolicyRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.iam.v3beta.GetPrincipalAccessBoundaryPolicyRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.iam.v3beta.GetPrincipalAccessBoundaryPolicyRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.iam.v3beta.GetPrincipalAccessBoundaryPolicyRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.iam.v3beta.GetPrincipalAccessBoundaryPolicyRequest 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
        +   * Request message for GetPrincipalAccessBoundaryPolicy method.
        +   * 
        + * + * Protobuf type {@code google.iam.v3beta.GetPrincipalAccessBoundaryPolicyRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.iam.v3beta.GetPrincipalAccessBoundaryPolicyRequest) + com.google.iam.v3beta.GetPrincipalAccessBoundaryPolicyRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.iam.v3beta.PrincipalAccessBoundaryPoliciesServiceProto + .internal_static_google_iam_v3beta_GetPrincipalAccessBoundaryPolicyRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.iam.v3beta.PrincipalAccessBoundaryPoliciesServiceProto + .internal_static_google_iam_v3beta_GetPrincipalAccessBoundaryPolicyRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.iam.v3beta.GetPrincipalAccessBoundaryPolicyRequest.class, + com.google.iam.v3beta.GetPrincipalAccessBoundaryPolicyRequest.Builder.class); + } + + // Construct using com.google.iam.v3beta.GetPrincipalAccessBoundaryPolicyRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.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.iam.v3beta.PrincipalAccessBoundaryPoliciesServiceProto + .internal_static_google_iam_v3beta_GetPrincipalAccessBoundaryPolicyRequest_descriptor; + } + + @java.lang.Override + public com.google.iam.v3beta.GetPrincipalAccessBoundaryPolicyRequest + getDefaultInstanceForType() { + return com.google.iam.v3beta.GetPrincipalAccessBoundaryPolicyRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.iam.v3beta.GetPrincipalAccessBoundaryPolicyRequest build() { + com.google.iam.v3beta.GetPrincipalAccessBoundaryPolicyRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.iam.v3beta.GetPrincipalAccessBoundaryPolicyRequest buildPartial() { + com.google.iam.v3beta.GetPrincipalAccessBoundaryPolicyRequest result = + new com.google.iam.v3beta.GetPrincipalAccessBoundaryPolicyRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.iam.v3beta.GetPrincipalAccessBoundaryPolicyRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.iam.v3beta.GetPrincipalAccessBoundaryPolicyRequest) { + return mergeFrom((com.google.iam.v3beta.GetPrincipalAccessBoundaryPolicyRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.iam.v3beta.GetPrincipalAccessBoundaryPolicyRequest other) { + if (other + == com.google.iam.v3beta.GetPrincipalAccessBoundaryPolicyRequest.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 name of the principal access boundary policy to retrieve.
        +     *
        +     * Format:
        +     * `organizations/{organization_id}/locations/{location}/principalAccessBoundaryPolicies/{principal_access_boundary_policy_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 name of the principal access boundary policy to retrieve.
        +     *
        +     * Format:
        +     * `organizations/{organization_id}/locations/{location}/principalAccessBoundaryPolicies/{principal_access_boundary_policy_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 name of the principal access boundary policy to retrieve.
        +     *
        +     * Format:
        +     * `organizations/{organization_id}/locations/{location}/principalAccessBoundaryPolicies/{principal_access_boundary_policy_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 name of the principal access boundary policy to retrieve.
        +     *
        +     * Format:
        +     * `organizations/{organization_id}/locations/{location}/principalAccessBoundaryPolicies/{principal_access_boundary_policy_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 name of the principal access boundary policy to retrieve.
        +     *
        +     * Format:
        +     * `organizations/{organization_id}/locations/{location}/principalAccessBoundaryPolicies/{principal_access_boundary_policy_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; + } + + // @@protoc_insertion_point(builder_scope:google.iam.v3beta.GetPrincipalAccessBoundaryPolicyRequest) + } + + // @@protoc_insertion_point(class_scope:google.iam.v3beta.GetPrincipalAccessBoundaryPolicyRequest) + private static final com.google.iam.v3beta.GetPrincipalAccessBoundaryPolicyRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.iam.v3beta.GetPrincipalAccessBoundaryPolicyRequest(); + } + + public static com.google.iam.v3beta.GetPrincipalAccessBoundaryPolicyRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GetPrincipalAccessBoundaryPolicyRequest 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.iam.v3beta.GetPrincipalAccessBoundaryPolicyRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-iam/proto-google-iam-v3beta/src/main/java/com/google/iam/v3beta/GetPrincipalAccessBoundaryPolicyRequestOrBuilder.java b/java-iam/proto-google-iam-v3beta/src/main/java/com/google/iam/v3beta/GetPrincipalAccessBoundaryPolicyRequestOrBuilder.java new file mode 100644 index 0000000000..86950afa43 --- /dev/null +++ b/java-iam/proto-google-iam-v3beta/src/main/java/com/google/iam/v3beta/GetPrincipalAccessBoundaryPolicyRequestOrBuilder.java @@ -0,0 +1,64 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/iam/v3beta/principal_access_boundary_policies_service.proto +// Protobuf Java Version: 4.33.2 + +package com.google.iam.v3beta; + +@com.google.protobuf.Generated +public interface GetPrincipalAccessBoundaryPolicyRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.iam.v3beta.GetPrincipalAccessBoundaryPolicyRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
        +   * Required. The name of the principal access boundary policy to retrieve.
        +   *
        +   * Format:
        +   * `organizations/{organization_id}/locations/{location}/principalAccessBoundaryPolicies/{principal_access_boundary_policy_id}`
        +   * 
        + * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + + /** + * + * + *
        +   * Required. The name of the principal access boundary policy to retrieve.
        +   *
        +   * Format:
        +   * `organizations/{organization_id}/locations/{location}/principalAccessBoundaryPolicies/{principal_access_boundary_policy_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-iam/proto-google-iam-v3beta/src/main/java/com/google/iam/v3beta/ListPolicyBindingsRequest.java b/java-iam/proto-google-iam-v3beta/src/main/java/com/google/iam/v3beta/ListPolicyBindingsRequest.java new file mode 100644 index 0000000000..515549b225 --- /dev/null +++ b/java-iam/proto-google-iam-v3beta/src/main/java/com/google/iam/v3beta/ListPolicyBindingsRequest.java @@ -0,0 +1,1255 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/iam/v3beta/policy_bindings_service.proto +// Protobuf Java Version: 4.33.2 + +package com.google.iam.v3beta; + +/** + * + * + *
        + * Request message for ListPolicyBindings method.
        + * 
        + * + * Protobuf type {@code google.iam.v3beta.ListPolicyBindingsRequest} + */ +@com.google.protobuf.Generated +public final class ListPolicyBindingsRequest extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.iam.v3beta.ListPolicyBindingsRequest) + ListPolicyBindingsRequestOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "ListPolicyBindingsRequest"); + } + + // Use ListPolicyBindingsRequest.newBuilder() to construct. + private ListPolicyBindingsRequest(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private ListPolicyBindingsRequest() { + parent_ = ""; + pageToken_ = ""; + filter_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.iam.v3beta.PolicyBindingsServiceProto + .internal_static_google_iam_v3beta_ListPolicyBindingsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.iam.v3beta.PolicyBindingsServiceProto + .internal_static_google_iam_v3beta_ListPolicyBindingsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.iam.v3beta.ListPolicyBindingsRequest.class, + com.google.iam.v3beta.ListPolicyBindingsRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object parent_ = ""; + + /** + * + * + *
        +   * Required. The parent resource, which owns the collection of policy
        +   * bindings.
        +   *
        +   * Format:
        +   *
        +   * * `projects/{project_id}/locations/{location}`
        +   * * `projects/{project_number}/locations/{location}`
        +   * * `folders/{folder_id}/locations/{location}`
        +   * * `organizations/{organization_id}/locations/{location}`
        +   * 
        + * + * + * 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, which owns the collection of policy
        +   * bindings.
        +   *
        +   * Format:
        +   *
        +   * * `projects/{project_id}/locations/{location}`
        +   * * `projects/{project_number}/locations/{location}`
        +   * * `folders/{folder_id}/locations/{location}`
        +   * * `organizations/{organization_id}/locations/{location}`
        +   * 
        + * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + @java.lang.Override + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PAGE_SIZE_FIELD_NUMBER = 2; + private int pageSize_ = 0; + + /** + * + * + *
        +   * Optional. The maximum number of policy bindings to return. The service may
        +   * return fewer than this value.
        +   *
        +   * If unspecified, at most 50 policy bindings will be returned.
        +   * The maximum value is 1000; values above 1000 will be coerced to 1000.
        +   * 
        + * + * 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. A page token, received from a previous `ListPolicyBindings` call.
        +   * Provide this to retrieve the subsequent page.
        +   *
        +   * When paginating, all other parameters provided to `ListPolicyBindings` must
        +   * match the call that provided the page token.
        +   * 
        + * + * 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. A page token, received from a previous `ListPolicyBindings` call.
        +   * Provide this to retrieve the subsequent page.
        +   *
        +   * When paginating, all other parameters provided to `ListPolicyBindings` must
        +   * match the call that provided the page token.
        +   * 
        + * + * 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; + } + } + + public static final int FILTER_FIELD_NUMBER = 4; + + @SuppressWarnings("serial") + private volatile java.lang.Object filter_ = ""; + + /** + * + * + *
        +   * Optional. An expression for filtering the results of the request. Filter
        +   * rules are case insensitive. Some eligible fields for filtering are:
        +   *
        +   * + `target`
        +   * + `policy`
        +   *
        +   * Some examples of filter queries:
        +   *
        +   * * `target:ex*`: The binding target's name starts with "ex".
        +   * * `target:example`: The binding target's name is `example`.
        +   * * `policy:example`: The binding policy's name is `example`.
        +   * 
        + * + * string filter = 4 [(.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 expression for filtering the results of the request. Filter
        +   * rules are case insensitive. Some eligible fields for filtering are:
        +   *
        +   * + `target`
        +   * + `policy`
        +   *
        +   * Some examples of filter queries:
        +   *
        +   * * `target:ex*`: The binding target's name starts with "ex".
        +   * * `target:example`: The binding target's name is `example`.
        +   * * `policy:example`: The binding policy's name is `example`.
        +   * 
        + * + * string filter = 4 [(.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; + } + } + + 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.GeneratedMessage.isStringEmpty(parent_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, parent_); + } + if (pageSize_ != 0) { + output.writeInt32(2, pageSize_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(pageToken_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 3, pageToken_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(filter_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 4, filter_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(parent_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, parent_); + } + if (pageSize_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(2, pageSize_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(pageToken_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(3, pageToken_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(filter_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(4, 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.iam.v3beta.ListPolicyBindingsRequest)) { + return super.equals(obj); + } + com.google.iam.v3beta.ListPolicyBindingsRequest other = + (com.google.iam.v3beta.ListPolicyBindingsRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (getPageSize() != other.getPageSize()) return false; + if (!getPageToken().equals(other.getPageToken())) 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) + PARENT_FIELD_NUMBER; + hash = (53 * hash) + getParent().hashCode(); + hash = (37 * hash) + PAGE_SIZE_FIELD_NUMBER; + hash = (53 * hash) + getPageSize(); + hash = (37 * hash) + PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getPageToken().hashCode(); + hash = (37 * hash) + FILTER_FIELD_NUMBER; + hash = (53 * hash) + getFilter().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.iam.v3beta.ListPolicyBindingsRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.iam.v3beta.ListPolicyBindingsRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.iam.v3beta.ListPolicyBindingsRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.iam.v3beta.ListPolicyBindingsRequest 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.iam.v3beta.ListPolicyBindingsRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.iam.v3beta.ListPolicyBindingsRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.iam.v3beta.ListPolicyBindingsRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.iam.v3beta.ListPolicyBindingsRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.iam.v3beta.ListPolicyBindingsRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.iam.v3beta.ListPolicyBindingsRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.iam.v3beta.ListPolicyBindingsRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.iam.v3beta.ListPolicyBindingsRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.iam.v3beta.ListPolicyBindingsRequest 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
        +   * Request message for ListPolicyBindings method.
        +   * 
        + * + * Protobuf type {@code google.iam.v3beta.ListPolicyBindingsRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.iam.v3beta.ListPolicyBindingsRequest) + com.google.iam.v3beta.ListPolicyBindingsRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.iam.v3beta.PolicyBindingsServiceProto + .internal_static_google_iam_v3beta_ListPolicyBindingsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.iam.v3beta.PolicyBindingsServiceProto + .internal_static_google_iam_v3beta_ListPolicyBindingsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.iam.v3beta.ListPolicyBindingsRequest.class, + com.google.iam.v3beta.ListPolicyBindingsRequest.Builder.class); + } + + // Construct using com.google.iam.v3beta.ListPolicyBindingsRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + parent_ = ""; + pageSize_ = 0; + pageToken_ = ""; + filter_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.iam.v3beta.PolicyBindingsServiceProto + .internal_static_google_iam_v3beta_ListPolicyBindingsRequest_descriptor; + } + + @java.lang.Override + public com.google.iam.v3beta.ListPolicyBindingsRequest getDefaultInstanceForType() { + return com.google.iam.v3beta.ListPolicyBindingsRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.iam.v3beta.ListPolicyBindingsRequest build() { + com.google.iam.v3beta.ListPolicyBindingsRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.iam.v3beta.ListPolicyBindingsRequest buildPartial() { + com.google.iam.v3beta.ListPolicyBindingsRequest result = + new com.google.iam.v3beta.ListPolicyBindingsRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.iam.v3beta.ListPolicyBindingsRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.parent_ = parent_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.pageSize_ = pageSize_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.pageToken_ = pageToken_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.filter_ = filter_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.iam.v3beta.ListPolicyBindingsRequest) { + return mergeFrom((com.google.iam.v3beta.ListPolicyBindingsRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.iam.v3beta.ListPolicyBindingsRequest other) { + if (other == com.google.iam.v3beta.ListPolicyBindingsRequest.getDefaultInstance()) + return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.getPageSize() != 0) { + setPageSize(other.getPageSize()); + } + if (!other.getPageToken().isEmpty()) { + pageToken_ = other.pageToken_; + bitField0_ |= 0x00000004; + onChanged(); + } + if (!other.getFilter().isEmpty()) { + filter_ = other.filter_; + 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_ |= 0x00000002; + break; + } // case 16 + case 26: + { + pageToken_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 34: + { + filter_ = input.readStringRequireUtf8(); + 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 parent_ = ""; + + /** + * + * + *
        +     * Required. The parent resource, which owns the collection of policy
        +     * bindings.
        +     *
        +     * Format:
        +     *
        +     * * `projects/{project_id}/locations/{location}`
        +     * * `projects/{project_number}/locations/{location}`
        +     * * `folders/{folder_id}/locations/{location}`
        +     * * `organizations/{organization_id}/locations/{location}`
        +     * 
        + * + * + * 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, which owns the collection of policy
        +     * bindings.
        +     *
        +     * Format:
        +     *
        +     * * `projects/{project_id}/locations/{location}`
        +     * * `projects/{project_number}/locations/{location}`
        +     * * `folders/{folder_id}/locations/{location}`
        +     * * `organizations/{organization_id}/locations/{location}`
        +     * 
        + * + * + * 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, which owns the collection of policy
        +     * bindings.
        +     *
        +     * Format:
        +     *
        +     * * `projects/{project_id}/locations/{location}`
        +     * * `projects/{project_number}/locations/{location}`
        +     * * `folders/{folder_id}/locations/{location}`
        +     * * `organizations/{organization_id}/locations/{location}`
        +     * 
        + * + * + * 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, which owns the collection of policy
        +     * bindings.
        +     *
        +     * Format:
        +     *
        +     * * `projects/{project_id}/locations/{location}`
        +     * * `projects/{project_number}/locations/{location}`
        +     * * `folders/{folder_id}/locations/{location}`
        +     * * `organizations/{organization_id}/locations/{location}`
        +     * 
        + * + * + * 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, which owns the collection of policy
        +     * bindings.
        +     *
        +     * Format:
        +     *
        +     * * `projects/{project_id}/locations/{location}`
        +     * * `projects/{project_number}/locations/{location}`
        +     * * `folders/{folder_id}/locations/{location}`
        +     * * `organizations/{organization_id}/locations/{location}`
        +     * 
        + * + * + * 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 int pageSize_; + + /** + * + * + *
        +     * Optional. The maximum number of policy bindings to return. The service may
        +     * return fewer than this value.
        +     *
        +     * If unspecified, at most 50 policy bindings will be returned.
        +     * The maximum value is 1000; values above 1000 will be coerced to 1000.
        +     * 
        + * + * 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 policy bindings to return. The service may
        +     * return fewer than this value.
        +     *
        +     * If unspecified, at most 50 policy bindings will be returned.
        +     * The maximum value is 1000; values above 1000 will be coerced to 1000.
        +     * 
        + * + * 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_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
        +     * Optional. The maximum number of policy bindings to return. The service may
        +     * return fewer than this value.
        +     *
        +     * If unspecified, at most 50 policy bindings will be returned.
        +     * The maximum value is 1000; values above 1000 will be coerced to 1000.
        +     * 
        + * + * int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearPageSize() { + bitField0_ = (bitField0_ & ~0x00000002); + pageSize_ = 0; + onChanged(); + return this; + } + + private java.lang.Object pageToken_ = ""; + + /** + * + * + *
        +     * Optional. A page token, received from a previous `ListPolicyBindings` call.
        +     * Provide this to retrieve the subsequent page.
        +     *
        +     * When paginating, all other parameters provided to `ListPolicyBindings` must
        +     * match the call that provided the page token.
        +     * 
        + * + * 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. A page token, received from a previous `ListPolicyBindings` call.
        +     * Provide this to retrieve the subsequent page.
        +     *
        +     * When paginating, all other parameters provided to `ListPolicyBindings` must
        +     * match the call that provided the page token.
        +     * 
        + * + * 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. A page token, received from a previous `ListPolicyBindings` call.
        +     * Provide this to retrieve the subsequent page.
        +     *
        +     * When paginating, all other parameters provided to `ListPolicyBindings` must
        +     * match the call that provided the page token.
        +     * 
        + * + * 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_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
        +     * Optional. A page token, received from a previous `ListPolicyBindings` call.
        +     * Provide this to retrieve the subsequent page.
        +     *
        +     * When paginating, all other parameters provided to `ListPolicyBindings` must
        +     * match the call that provided the page token.
        +     * 
        + * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearPageToken() { + pageToken_ = getDefaultInstance().getPageToken(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + + /** + * + * + *
        +     * Optional. A page token, received from a previous `ListPolicyBindings` call.
        +     * Provide this to retrieve the subsequent page.
        +     *
        +     * When paginating, all other parameters provided to `ListPolicyBindings` must
        +     * match the call that provided the page token.
        +     * 
        + * + * 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_ |= 0x00000004; + onChanged(); + return this; + } + + private java.lang.Object filter_ = ""; + + /** + * + * + *
        +     * Optional. An expression for filtering the results of the request. Filter
        +     * rules are case insensitive. Some eligible fields for filtering are:
        +     *
        +     * + `target`
        +     * + `policy`
        +     *
        +     * Some examples of filter queries:
        +     *
        +     * * `target:ex*`: The binding target's name starts with "ex".
        +     * * `target:example`: The binding target's name is `example`.
        +     * * `policy:example`: The binding policy's name is `example`.
        +     * 
        + * + * string filter = 4 [(.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 expression for filtering the results of the request. Filter
        +     * rules are case insensitive. Some eligible fields for filtering are:
        +     *
        +     * + `target`
        +     * + `policy`
        +     *
        +     * Some examples of filter queries:
        +     *
        +     * * `target:ex*`: The binding target's name starts with "ex".
        +     * * `target:example`: The binding target's name is `example`.
        +     * * `policy:example`: The binding policy's name is `example`.
        +     * 
        + * + * string filter = 4 [(.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 expression for filtering the results of the request. Filter
        +     * rules are case insensitive. Some eligible fields for filtering are:
        +     *
        +     * + `target`
        +     * + `policy`
        +     *
        +     * Some examples of filter queries:
        +     *
        +     * * `target:ex*`: The binding target's name starts with "ex".
        +     * * `target:example`: The binding target's name is `example`.
        +     * * `policy:example`: The binding policy's name is `example`.
        +     * 
        + * + * string filter = 4 [(.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_ |= 0x00000008; + onChanged(); + return this; + } + + /** + * + * + *
        +     * Optional. An expression for filtering the results of the request. Filter
        +     * rules are case insensitive. Some eligible fields for filtering are:
        +     *
        +     * + `target`
        +     * + `policy`
        +     *
        +     * Some examples of filter queries:
        +     *
        +     * * `target:ex*`: The binding target's name starts with "ex".
        +     * * `target:example`: The binding target's name is `example`.
        +     * * `policy:example`: The binding policy's name is `example`.
        +     * 
        + * + * string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearFilter() { + filter_ = getDefaultInstance().getFilter(); + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + return this; + } + + /** + * + * + *
        +     * Optional. An expression for filtering the results of the request. Filter
        +     * rules are case insensitive. Some eligible fields for filtering are:
        +     *
        +     * + `target`
        +     * + `policy`
        +     *
        +     * Some examples of filter queries:
        +     *
        +     * * `target:ex*`: The binding target's name starts with "ex".
        +     * * `target:example`: The binding target's name is `example`.
        +     * * `policy:example`: The binding policy's name is `example`.
        +     * 
        + * + * string filter = 4 [(.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_ |= 0x00000008; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.iam.v3beta.ListPolicyBindingsRequest) + } + + // @@protoc_insertion_point(class_scope:google.iam.v3beta.ListPolicyBindingsRequest) + private static final com.google.iam.v3beta.ListPolicyBindingsRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.iam.v3beta.ListPolicyBindingsRequest(); + } + + public static com.google.iam.v3beta.ListPolicyBindingsRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListPolicyBindingsRequest 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.iam.v3beta.ListPolicyBindingsRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-iam/proto-google-iam-v3beta/src/main/java/com/google/iam/v3beta/ListPolicyBindingsRequestOrBuilder.java b/java-iam/proto-google-iam-v3beta/src/main/java/com/google/iam/v3beta/ListPolicyBindingsRequestOrBuilder.java new file mode 100644 index 0000000000..d2e42b7448 --- /dev/null +++ b/java-iam/proto-google-iam-v3beta/src/main/java/com/google/iam/v3beta/ListPolicyBindingsRequestOrBuilder.java @@ -0,0 +1,171 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/iam/v3beta/policy_bindings_service.proto +// Protobuf Java Version: 4.33.2 + +package com.google.iam.v3beta; + +@com.google.protobuf.Generated +public interface ListPolicyBindingsRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.iam.v3beta.ListPolicyBindingsRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
        +   * Required. The parent resource, which owns the collection of policy
        +   * bindings.
        +   *
        +   * Format:
        +   *
        +   * * `projects/{project_id}/locations/{location}`
        +   * * `projects/{project_number}/locations/{location}`
        +   * * `folders/{folder_id}/locations/{location}`
        +   * * `organizations/{organization_id}/locations/{location}`
        +   * 
        + * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + + /** + * + * + *
        +   * Required. The parent resource, which owns the collection of policy
        +   * bindings.
        +   *
        +   * Format:
        +   *
        +   * * `projects/{project_id}/locations/{location}`
        +   * * `projects/{project_number}/locations/{location}`
        +   * * `folders/{folder_id}/locations/{location}`
        +   * * `organizations/{organization_id}/locations/{location}`
        +   * 
        + * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
        +   * Optional. The maximum number of policy bindings to return. The service may
        +   * return fewer than this value.
        +   *
        +   * If unspecified, at most 50 policy bindings will be returned.
        +   * The maximum value is 1000; values above 1000 will be coerced to 1000.
        +   * 
        + * + * int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageSize. + */ + int getPageSize(); + + /** + * + * + *
        +   * Optional. A page token, received from a previous `ListPolicyBindings` call.
        +   * Provide this to retrieve the subsequent page.
        +   *
        +   * When paginating, all other parameters provided to `ListPolicyBindings` must
        +   * match the call that provided the page token.
        +   * 
        + * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageToken. + */ + java.lang.String getPageToken(); + + /** + * + * + *
        +   * Optional. A page token, received from a previous `ListPolicyBindings` call.
        +   * Provide this to retrieve the subsequent page.
        +   *
        +   * When paginating, all other parameters provided to `ListPolicyBindings` must
        +   * match the call that provided the page token.
        +   * 
        + * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for pageToken. + */ + com.google.protobuf.ByteString getPageTokenBytes(); + + /** + * + * + *
        +   * Optional. An expression for filtering the results of the request. Filter
        +   * rules are case insensitive. Some eligible fields for filtering are:
        +   *
        +   * + `target`
        +   * + `policy`
        +   *
        +   * Some examples of filter queries:
        +   *
        +   * * `target:ex*`: The binding target's name starts with "ex".
        +   * * `target:example`: The binding target's name is `example`.
        +   * * `policy:example`: The binding policy's name is `example`.
        +   * 
        + * + * string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The filter. + */ + java.lang.String getFilter(); + + /** + * + * + *
        +   * Optional. An expression for filtering the results of the request. Filter
        +   * rules are case insensitive. Some eligible fields for filtering are:
        +   *
        +   * + `target`
        +   * + `policy`
        +   *
        +   * Some examples of filter queries:
        +   *
        +   * * `target:ex*`: The binding target's name starts with "ex".
        +   * * `target:example`: The binding target's name is `example`.
        +   * * `policy:example`: The binding policy's name is `example`.
        +   * 
        + * + * string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for filter. + */ + com.google.protobuf.ByteString getFilterBytes(); +} diff --git a/java-iam/proto-google-iam-v3beta/src/main/java/com/google/iam/v3beta/ListPolicyBindingsResponse.java b/java-iam/proto-google-iam-v3beta/src/main/java/com/google/iam/v3beta/ListPolicyBindingsResponse.java new file mode 100644 index 0000000000..adb633941f --- /dev/null +++ b/java-iam/proto-google-iam-v3beta/src/main/java/com/google/iam/v3beta/ListPolicyBindingsResponse.java @@ -0,0 +1,1122 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/iam/v3beta/policy_bindings_service.proto +// Protobuf Java Version: 4.33.2 + +package com.google.iam.v3beta; + +/** + * + * + *
        + * Response message for ListPolicyBindings method.
        + * 
        + * + * Protobuf type {@code google.iam.v3beta.ListPolicyBindingsResponse} + */ +@com.google.protobuf.Generated +public final class ListPolicyBindingsResponse extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.iam.v3beta.ListPolicyBindingsResponse) + ListPolicyBindingsResponseOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "ListPolicyBindingsResponse"); + } + + // Use ListPolicyBindingsResponse.newBuilder() to construct. + private ListPolicyBindingsResponse(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private ListPolicyBindingsResponse() { + policyBindings_ = java.util.Collections.emptyList(); + nextPageToken_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.iam.v3beta.PolicyBindingsServiceProto + .internal_static_google_iam_v3beta_ListPolicyBindingsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.iam.v3beta.PolicyBindingsServiceProto + .internal_static_google_iam_v3beta_ListPolicyBindingsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.iam.v3beta.ListPolicyBindingsResponse.class, + com.google.iam.v3beta.ListPolicyBindingsResponse.Builder.class); + } + + public static final int POLICY_BINDINGS_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private java.util.List policyBindings_; + + /** + * + * + *
        +   * The policy bindings from the specified parent.
        +   * 
        + * + * repeated .google.iam.v3beta.PolicyBinding policy_bindings = 1; + */ + @java.lang.Override + public java.util.List getPolicyBindingsList() { + return policyBindings_; + } + + /** + * + * + *
        +   * The policy bindings from the specified parent.
        +   * 
        + * + * repeated .google.iam.v3beta.PolicyBinding policy_bindings = 1; + */ + @java.lang.Override + public java.util.List + getPolicyBindingsOrBuilderList() { + return policyBindings_; + } + + /** + * + * + *
        +   * The policy bindings from the specified parent.
        +   * 
        + * + * repeated .google.iam.v3beta.PolicyBinding policy_bindings = 1; + */ + @java.lang.Override + public int getPolicyBindingsCount() { + return policyBindings_.size(); + } + + /** + * + * + *
        +   * The policy bindings from the specified parent.
        +   * 
        + * + * repeated .google.iam.v3beta.PolicyBinding policy_bindings = 1; + */ + @java.lang.Override + public com.google.iam.v3beta.PolicyBinding getPolicyBindings(int index) { + return policyBindings_.get(index); + } + + /** + * + * + *
        +   * The policy bindings from the specified parent.
        +   * 
        + * + * repeated .google.iam.v3beta.PolicyBinding policy_bindings = 1; + */ + @java.lang.Override + public com.google.iam.v3beta.PolicyBindingOrBuilder getPolicyBindingsOrBuilder(int index) { + return policyBindings_.get(index); + } + + public static final int NEXT_PAGE_TOKEN_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object nextPageToken_ = ""; + + /** + * + * + *
        +   * Optional. A token, which can be sent as `page_token` to retrieve the next
        +   * page. If this field is omitted, there are no subsequent pages.
        +   * 
        + * + * string next_page_token = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + } + } + + /** + * + * + *
        +   * Optional. A token, which can be sent as `page_token` to retrieve the next
        +   * page. If this field is omitted, there are no subsequent pages.
        +   * 
        + * + * string next_page_token = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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 < policyBindings_.size(); i++) { + output.writeMessage(1, policyBindings_.get(i)); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(nextPageToken_)) { + com.google.protobuf.GeneratedMessage.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 < policyBindings_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, policyBindings_.get(i)); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(nextPageToken_)) { + size += com.google.protobuf.GeneratedMessage.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.iam.v3beta.ListPolicyBindingsResponse)) { + return super.equals(obj); + } + com.google.iam.v3beta.ListPolicyBindingsResponse other = + (com.google.iam.v3beta.ListPolicyBindingsResponse) obj; + + if (!getPolicyBindingsList().equals(other.getPolicyBindingsList())) 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 (getPolicyBindingsCount() > 0) { + hash = (37 * hash) + POLICY_BINDINGS_FIELD_NUMBER; + hash = (53 * hash) + getPolicyBindingsList().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.iam.v3beta.ListPolicyBindingsResponse parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.iam.v3beta.ListPolicyBindingsResponse parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.iam.v3beta.ListPolicyBindingsResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.iam.v3beta.ListPolicyBindingsResponse 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.iam.v3beta.ListPolicyBindingsResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.iam.v3beta.ListPolicyBindingsResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.iam.v3beta.ListPolicyBindingsResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.iam.v3beta.ListPolicyBindingsResponse parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.iam.v3beta.ListPolicyBindingsResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.iam.v3beta.ListPolicyBindingsResponse parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.iam.v3beta.ListPolicyBindingsResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.iam.v3beta.ListPolicyBindingsResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.iam.v3beta.ListPolicyBindingsResponse 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
        +   * Response message for ListPolicyBindings method.
        +   * 
        + * + * Protobuf type {@code google.iam.v3beta.ListPolicyBindingsResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.iam.v3beta.ListPolicyBindingsResponse) + com.google.iam.v3beta.ListPolicyBindingsResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.iam.v3beta.PolicyBindingsServiceProto + .internal_static_google_iam_v3beta_ListPolicyBindingsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.iam.v3beta.PolicyBindingsServiceProto + .internal_static_google_iam_v3beta_ListPolicyBindingsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.iam.v3beta.ListPolicyBindingsResponse.class, + com.google.iam.v3beta.ListPolicyBindingsResponse.Builder.class); + } + + // Construct using com.google.iam.v3beta.ListPolicyBindingsResponse.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (policyBindingsBuilder_ == null) { + policyBindings_ = java.util.Collections.emptyList(); + } else { + policyBindings_ = null; + policyBindingsBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + nextPageToken_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.iam.v3beta.PolicyBindingsServiceProto + .internal_static_google_iam_v3beta_ListPolicyBindingsResponse_descriptor; + } + + @java.lang.Override + public com.google.iam.v3beta.ListPolicyBindingsResponse getDefaultInstanceForType() { + return com.google.iam.v3beta.ListPolicyBindingsResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.iam.v3beta.ListPolicyBindingsResponse build() { + com.google.iam.v3beta.ListPolicyBindingsResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.iam.v3beta.ListPolicyBindingsResponse buildPartial() { + com.google.iam.v3beta.ListPolicyBindingsResponse result = + new com.google.iam.v3beta.ListPolicyBindingsResponse(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields( + com.google.iam.v3beta.ListPolicyBindingsResponse result) { + if (policyBindingsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + policyBindings_ = java.util.Collections.unmodifiableList(policyBindings_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.policyBindings_ = policyBindings_; + } else { + result.policyBindings_ = policyBindingsBuilder_.build(); + } + } + + private void buildPartial0(com.google.iam.v3beta.ListPolicyBindingsResponse result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.nextPageToken_ = nextPageToken_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.iam.v3beta.ListPolicyBindingsResponse) { + return mergeFrom((com.google.iam.v3beta.ListPolicyBindingsResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.iam.v3beta.ListPolicyBindingsResponse other) { + if (other == com.google.iam.v3beta.ListPolicyBindingsResponse.getDefaultInstance()) + return this; + if (policyBindingsBuilder_ == null) { + if (!other.policyBindings_.isEmpty()) { + if (policyBindings_.isEmpty()) { + policyBindings_ = other.policyBindings_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensurePolicyBindingsIsMutable(); + policyBindings_.addAll(other.policyBindings_); + } + onChanged(); + } + } else { + if (!other.policyBindings_.isEmpty()) { + if (policyBindingsBuilder_.isEmpty()) { + policyBindingsBuilder_.dispose(); + policyBindingsBuilder_ = null; + policyBindings_ = other.policyBindings_; + bitField0_ = (bitField0_ & ~0x00000001); + policyBindingsBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders + ? internalGetPolicyBindingsFieldBuilder() + : null; + } else { + policyBindingsBuilder_.addAllMessages(other.policyBindings_); + } + } + } + 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.iam.v3beta.PolicyBinding m = + input.readMessage( + com.google.iam.v3beta.PolicyBinding.parser(), extensionRegistry); + if (policyBindingsBuilder_ == null) { + ensurePolicyBindingsIsMutable(); + policyBindings_.add(m); + } else { + policyBindingsBuilder_.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 policyBindings_ = + java.util.Collections.emptyList(); + + private void ensurePolicyBindingsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + policyBindings_ = + new java.util.ArrayList(policyBindings_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.google.iam.v3beta.PolicyBinding, + com.google.iam.v3beta.PolicyBinding.Builder, + com.google.iam.v3beta.PolicyBindingOrBuilder> + policyBindingsBuilder_; + + /** + * + * + *
        +     * The policy bindings from the specified parent.
        +     * 
        + * + * repeated .google.iam.v3beta.PolicyBinding policy_bindings = 1; + */ + public java.util.List getPolicyBindingsList() { + if (policyBindingsBuilder_ == null) { + return java.util.Collections.unmodifiableList(policyBindings_); + } else { + return policyBindingsBuilder_.getMessageList(); + } + } + + /** + * + * + *
        +     * The policy bindings from the specified parent.
        +     * 
        + * + * repeated .google.iam.v3beta.PolicyBinding policy_bindings = 1; + */ + public int getPolicyBindingsCount() { + if (policyBindingsBuilder_ == null) { + return policyBindings_.size(); + } else { + return policyBindingsBuilder_.getCount(); + } + } + + /** + * + * + *
        +     * The policy bindings from the specified parent.
        +     * 
        + * + * repeated .google.iam.v3beta.PolicyBinding policy_bindings = 1; + */ + public com.google.iam.v3beta.PolicyBinding getPolicyBindings(int index) { + if (policyBindingsBuilder_ == null) { + return policyBindings_.get(index); + } else { + return policyBindingsBuilder_.getMessage(index); + } + } + + /** + * + * + *
        +     * The policy bindings from the specified parent.
        +     * 
        + * + * repeated .google.iam.v3beta.PolicyBinding policy_bindings = 1; + */ + public Builder setPolicyBindings(int index, com.google.iam.v3beta.PolicyBinding value) { + if (policyBindingsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensurePolicyBindingsIsMutable(); + policyBindings_.set(index, value); + onChanged(); + } else { + policyBindingsBuilder_.setMessage(index, value); + } + return this; + } + + /** + * + * + *
        +     * The policy bindings from the specified parent.
        +     * 
        + * + * repeated .google.iam.v3beta.PolicyBinding policy_bindings = 1; + */ + public Builder setPolicyBindings( + int index, com.google.iam.v3beta.PolicyBinding.Builder builderForValue) { + if (policyBindingsBuilder_ == null) { + ensurePolicyBindingsIsMutable(); + policyBindings_.set(index, builderForValue.build()); + onChanged(); + } else { + policyBindingsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
        +     * The policy bindings from the specified parent.
        +     * 
        + * + * repeated .google.iam.v3beta.PolicyBinding policy_bindings = 1; + */ + public Builder addPolicyBindings(com.google.iam.v3beta.PolicyBinding value) { + if (policyBindingsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensurePolicyBindingsIsMutable(); + policyBindings_.add(value); + onChanged(); + } else { + policyBindingsBuilder_.addMessage(value); + } + return this; + } + + /** + * + * + *
        +     * The policy bindings from the specified parent.
        +     * 
        + * + * repeated .google.iam.v3beta.PolicyBinding policy_bindings = 1; + */ + public Builder addPolicyBindings(int index, com.google.iam.v3beta.PolicyBinding value) { + if (policyBindingsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensurePolicyBindingsIsMutable(); + policyBindings_.add(index, value); + onChanged(); + } else { + policyBindingsBuilder_.addMessage(index, value); + } + return this; + } + + /** + * + * + *
        +     * The policy bindings from the specified parent.
        +     * 
        + * + * repeated .google.iam.v3beta.PolicyBinding policy_bindings = 1; + */ + public Builder addPolicyBindings(com.google.iam.v3beta.PolicyBinding.Builder builderForValue) { + if (policyBindingsBuilder_ == null) { + ensurePolicyBindingsIsMutable(); + policyBindings_.add(builderForValue.build()); + onChanged(); + } else { + policyBindingsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + + /** + * + * + *
        +     * The policy bindings from the specified parent.
        +     * 
        + * + * repeated .google.iam.v3beta.PolicyBinding policy_bindings = 1; + */ + public Builder addPolicyBindings( + int index, com.google.iam.v3beta.PolicyBinding.Builder builderForValue) { + if (policyBindingsBuilder_ == null) { + ensurePolicyBindingsIsMutable(); + policyBindings_.add(index, builderForValue.build()); + onChanged(); + } else { + policyBindingsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
        +     * The policy bindings from the specified parent.
        +     * 
        + * + * repeated .google.iam.v3beta.PolicyBinding policy_bindings = 1; + */ + public Builder addAllPolicyBindings( + java.lang.Iterable values) { + if (policyBindingsBuilder_ == null) { + ensurePolicyBindingsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, policyBindings_); + onChanged(); + } else { + policyBindingsBuilder_.addAllMessages(values); + } + return this; + } + + /** + * + * + *
        +     * The policy bindings from the specified parent.
        +     * 
        + * + * repeated .google.iam.v3beta.PolicyBinding policy_bindings = 1; + */ + public Builder clearPolicyBindings() { + if (policyBindingsBuilder_ == null) { + policyBindings_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + policyBindingsBuilder_.clear(); + } + return this; + } + + /** + * + * + *
        +     * The policy bindings from the specified parent.
        +     * 
        + * + * repeated .google.iam.v3beta.PolicyBinding policy_bindings = 1; + */ + public Builder removePolicyBindings(int index) { + if (policyBindingsBuilder_ == null) { + ensurePolicyBindingsIsMutable(); + policyBindings_.remove(index); + onChanged(); + } else { + policyBindingsBuilder_.remove(index); + } + return this; + } + + /** + * + * + *
        +     * The policy bindings from the specified parent.
        +     * 
        + * + * repeated .google.iam.v3beta.PolicyBinding policy_bindings = 1; + */ + public com.google.iam.v3beta.PolicyBinding.Builder getPolicyBindingsBuilder(int index) { + return internalGetPolicyBindingsFieldBuilder().getBuilder(index); + } + + /** + * + * + *
        +     * The policy bindings from the specified parent.
        +     * 
        + * + * repeated .google.iam.v3beta.PolicyBinding policy_bindings = 1; + */ + public com.google.iam.v3beta.PolicyBindingOrBuilder getPolicyBindingsOrBuilder(int index) { + if (policyBindingsBuilder_ == null) { + return policyBindings_.get(index); + } else { + return policyBindingsBuilder_.getMessageOrBuilder(index); + } + } + + /** + * + * + *
        +     * The policy bindings from the specified parent.
        +     * 
        + * + * repeated .google.iam.v3beta.PolicyBinding policy_bindings = 1; + */ + public java.util.List + getPolicyBindingsOrBuilderList() { + if (policyBindingsBuilder_ != null) { + return policyBindingsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(policyBindings_); + } + } + + /** + * + * + *
        +     * The policy bindings from the specified parent.
        +     * 
        + * + * repeated .google.iam.v3beta.PolicyBinding policy_bindings = 1; + */ + public com.google.iam.v3beta.PolicyBinding.Builder addPolicyBindingsBuilder() { + return internalGetPolicyBindingsFieldBuilder() + .addBuilder(com.google.iam.v3beta.PolicyBinding.getDefaultInstance()); + } + + /** + * + * + *
        +     * The policy bindings from the specified parent.
        +     * 
        + * + * repeated .google.iam.v3beta.PolicyBinding policy_bindings = 1; + */ + public com.google.iam.v3beta.PolicyBinding.Builder addPolicyBindingsBuilder(int index) { + return internalGetPolicyBindingsFieldBuilder() + .addBuilder(index, com.google.iam.v3beta.PolicyBinding.getDefaultInstance()); + } + + /** + * + * + *
        +     * The policy bindings from the specified parent.
        +     * 
        + * + * repeated .google.iam.v3beta.PolicyBinding policy_bindings = 1; + */ + public java.util.List + getPolicyBindingsBuilderList() { + return internalGetPolicyBindingsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.google.iam.v3beta.PolicyBinding, + com.google.iam.v3beta.PolicyBinding.Builder, + com.google.iam.v3beta.PolicyBindingOrBuilder> + internalGetPolicyBindingsFieldBuilder() { + if (policyBindingsBuilder_ == null) { + policyBindingsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilder< + com.google.iam.v3beta.PolicyBinding, + com.google.iam.v3beta.PolicyBinding.Builder, + com.google.iam.v3beta.PolicyBindingOrBuilder>( + policyBindings_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + policyBindings_ = null; + } + return policyBindingsBuilder_; + } + + private java.lang.Object nextPageToken_ = ""; + + /** + * + * + *
        +     * Optional. A token, which can be sent as `page_token` to retrieve the next
        +     * page. If this field is omitted, there are no subsequent pages.
        +     * 
        + * + * string next_page_token = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + } + } + + /** + * + * + *
        +     * Optional. A token, which can be sent as `page_token` to retrieve the next
        +     * page. If this field is omitted, there are no subsequent pages.
        +     * 
        + * + * string next_page_token = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + } + } + + /** + * + * + *
        +     * Optional. A token, which can be sent as `page_token` to retrieve the next
        +     * page. If this field is omitted, there are no subsequent pages.
        +     * 
        + * + * string next_page_token = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + } + + /** + * + * + *
        +     * Optional. A token, which can be sent as `page_token` to retrieve the next
        +     * page. If this field is omitted, there are no subsequent pages.
        +     * 
        + * + * string next_page_token = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearNextPageToken() { + nextPageToken_ = getDefaultInstance().getNextPageToken(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
        +     * Optional. A token, which can be sent as `page_token` to retrieve the next
        +     * page. If this field is omitted, there are no subsequent pages.
        +     * 
        + * + * string next_page_token = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + } + + // @@protoc_insertion_point(builder_scope:google.iam.v3beta.ListPolicyBindingsResponse) + } + + // @@protoc_insertion_point(class_scope:google.iam.v3beta.ListPolicyBindingsResponse) + private static final com.google.iam.v3beta.ListPolicyBindingsResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.iam.v3beta.ListPolicyBindingsResponse(); + } + + public static com.google.iam.v3beta.ListPolicyBindingsResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListPolicyBindingsResponse 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.iam.v3beta.ListPolicyBindingsResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-iam/proto-google-iam-v3beta/src/main/java/com/google/iam/v3beta/ListPolicyBindingsResponseOrBuilder.java b/java-iam/proto-google-iam-v3beta/src/main/java/com/google/iam/v3beta/ListPolicyBindingsResponseOrBuilder.java new file mode 100644 index 0000000000..abedd3fd93 --- /dev/null +++ b/java-iam/proto-google-iam-v3beta/src/main/java/com/google/iam/v3beta/ListPolicyBindingsResponseOrBuilder.java @@ -0,0 +1,112 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/iam/v3beta/policy_bindings_service.proto +// Protobuf Java Version: 4.33.2 + +package com.google.iam.v3beta; + +@com.google.protobuf.Generated +public interface ListPolicyBindingsResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.iam.v3beta.ListPolicyBindingsResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
        +   * The policy bindings from the specified parent.
        +   * 
        + * + * repeated .google.iam.v3beta.PolicyBinding policy_bindings = 1; + */ + java.util.List getPolicyBindingsList(); + + /** + * + * + *
        +   * The policy bindings from the specified parent.
        +   * 
        + * + * repeated .google.iam.v3beta.PolicyBinding policy_bindings = 1; + */ + com.google.iam.v3beta.PolicyBinding getPolicyBindings(int index); + + /** + * + * + *
        +   * The policy bindings from the specified parent.
        +   * 
        + * + * repeated .google.iam.v3beta.PolicyBinding policy_bindings = 1; + */ + int getPolicyBindingsCount(); + + /** + * + * + *
        +   * The policy bindings from the specified parent.
        +   * 
        + * + * repeated .google.iam.v3beta.PolicyBinding policy_bindings = 1; + */ + java.util.List + getPolicyBindingsOrBuilderList(); + + /** + * + * + *
        +   * The policy bindings from the specified parent.
        +   * 
        + * + * repeated .google.iam.v3beta.PolicyBinding policy_bindings = 1; + */ + com.google.iam.v3beta.PolicyBindingOrBuilder getPolicyBindingsOrBuilder(int index); + + /** + * + * + *
        +   * Optional. A token, which can be sent as `page_token` to retrieve the next
        +   * page. If this field is omitted, there are no subsequent pages.
        +   * 
        + * + * string next_page_token = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The nextPageToken. + */ + java.lang.String getNextPageToken(); + + /** + * + * + *
        +   * Optional. A token, which can be sent as `page_token` to retrieve the next
        +   * page. If this field is omitted, there are no subsequent pages.
        +   * 
        + * + * string next_page_token = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for nextPageToken. + */ + com.google.protobuf.ByteString getNextPageTokenBytes(); +} diff --git a/java-iam/proto-google-iam-v3beta/src/main/java/com/google/iam/v3beta/ListPrincipalAccessBoundaryPoliciesRequest.java b/java-iam/proto-google-iam-v3beta/src/main/java/com/google/iam/v3beta/ListPrincipalAccessBoundaryPoliciesRequest.java new file mode 100644 index 0000000000..0d3c0d5eea --- /dev/null +++ b/java-iam/proto-google-iam-v3beta/src/main/java/com/google/iam/v3beta/ListPrincipalAccessBoundaryPoliciesRequest.java @@ -0,0 +1,998 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/iam/v3beta/principal_access_boundary_policies_service.proto +// Protobuf Java Version: 4.33.2 + +package com.google.iam.v3beta; + +/** + * + * + *
        + * Request message for ListPrincipalAccessBoundaryPolicies method.
        + * 
        + * + * Protobuf type {@code google.iam.v3beta.ListPrincipalAccessBoundaryPoliciesRequest} + */ +@com.google.protobuf.Generated +public final class ListPrincipalAccessBoundaryPoliciesRequest + extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.iam.v3beta.ListPrincipalAccessBoundaryPoliciesRequest) + ListPrincipalAccessBoundaryPoliciesRequestOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "ListPrincipalAccessBoundaryPoliciesRequest"); + } + + // Use ListPrincipalAccessBoundaryPoliciesRequest.newBuilder() to construct. + private ListPrincipalAccessBoundaryPoliciesRequest( + com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private ListPrincipalAccessBoundaryPoliciesRequest() { + parent_ = ""; + pageToken_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.iam.v3beta.PrincipalAccessBoundaryPoliciesServiceProto + .internal_static_google_iam_v3beta_ListPrincipalAccessBoundaryPoliciesRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.iam.v3beta.PrincipalAccessBoundaryPoliciesServiceProto + .internal_static_google_iam_v3beta_ListPrincipalAccessBoundaryPoliciesRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.iam.v3beta.ListPrincipalAccessBoundaryPoliciesRequest.class, + com.google.iam.v3beta.ListPrincipalAccessBoundaryPoliciesRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object parent_ = ""; + + /** + * + * + *
        +   * Required. The parent resource, which owns the collection of principal
        +   * access boundary policies.
        +   *
        +   * Format:
        +   * `organizations/{organization_id}/locations/{location}`
        +   * 
        + * + * + * 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, which owns the collection of principal
        +   * access boundary policies.
        +   *
        +   * Format:
        +   * `organizations/{organization_id}/locations/{location}`
        +   * 
        + * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + @java.lang.Override + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PAGE_SIZE_FIELD_NUMBER = 2; + private int pageSize_ = 0; + + /** + * + * + *
        +   * Optional. The maximum number of principal access boundary policies to
        +   * return. The service may return fewer than this value.
        +   *
        +   * If unspecified, at most 50 principal access boundary policies will be
        +   * returned. The maximum value is 1000; values above 1000 will be coerced to
        +   * 1000.
        +   * 
        + * + * 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. A page token, received from a previous
        +   * `ListPrincipalAccessBoundaryPolicies` call. Provide this to retrieve the
        +   * subsequent page.
        +   *
        +   * When paginating, all other parameters provided to
        +   * `ListPrincipalAccessBoundaryPolicies` must match the call that provided the
        +   * page token.
        +   * 
        + * + * 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. A page token, received from a previous
        +   * `ListPrincipalAccessBoundaryPolicies` call. Provide this to retrieve the
        +   * subsequent page.
        +   *
        +   * When paginating, all other parameters provided to
        +   * `ListPrincipalAccessBoundaryPolicies` must match the call that provided the
        +   * page token.
        +   * 
        + * + * 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.GeneratedMessage.isStringEmpty(parent_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, parent_); + } + if (pageSize_ != 0) { + output.writeInt32(2, pageSize_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(pageToken_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 3, pageToken_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(parent_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, parent_); + } + if (pageSize_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(2, pageSize_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(pageToken_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(3, 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.iam.v3beta.ListPrincipalAccessBoundaryPoliciesRequest)) { + return super.equals(obj); + } + com.google.iam.v3beta.ListPrincipalAccessBoundaryPoliciesRequest other = + (com.google.iam.v3beta.ListPrincipalAccessBoundaryPoliciesRequest) obj; + + if (!getParent().equals(other.getParent())) 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(); + 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.iam.v3beta.ListPrincipalAccessBoundaryPoliciesRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.iam.v3beta.ListPrincipalAccessBoundaryPoliciesRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.iam.v3beta.ListPrincipalAccessBoundaryPoliciesRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.iam.v3beta.ListPrincipalAccessBoundaryPoliciesRequest 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.iam.v3beta.ListPrincipalAccessBoundaryPoliciesRequest parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.iam.v3beta.ListPrincipalAccessBoundaryPoliciesRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.iam.v3beta.ListPrincipalAccessBoundaryPoliciesRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.iam.v3beta.ListPrincipalAccessBoundaryPoliciesRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.iam.v3beta.ListPrincipalAccessBoundaryPoliciesRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.iam.v3beta.ListPrincipalAccessBoundaryPoliciesRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.iam.v3beta.ListPrincipalAccessBoundaryPoliciesRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.iam.v3beta.ListPrincipalAccessBoundaryPoliciesRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.iam.v3beta.ListPrincipalAccessBoundaryPoliciesRequest 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
        +   * Request message for ListPrincipalAccessBoundaryPolicies method.
        +   * 
        + * + * Protobuf type {@code google.iam.v3beta.ListPrincipalAccessBoundaryPoliciesRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.iam.v3beta.ListPrincipalAccessBoundaryPoliciesRequest) + com.google.iam.v3beta.ListPrincipalAccessBoundaryPoliciesRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.iam.v3beta.PrincipalAccessBoundaryPoliciesServiceProto + .internal_static_google_iam_v3beta_ListPrincipalAccessBoundaryPoliciesRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.iam.v3beta.PrincipalAccessBoundaryPoliciesServiceProto + .internal_static_google_iam_v3beta_ListPrincipalAccessBoundaryPoliciesRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.iam.v3beta.ListPrincipalAccessBoundaryPoliciesRequest.class, + com.google.iam.v3beta.ListPrincipalAccessBoundaryPoliciesRequest.Builder.class); + } + + // Construct using com.google.iam.v3beta.ListPrincipalAccessBoundaryPoliciesRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + parent_ = ""; + pageSize_ = 0; + pageToken_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.iam.v3beta.PrincipalAccessBoundaryPoliciesServiceProto + .internal_static_google_iam_v3beta_ListPrincipalAccessBoundaryPoliciesRequest_descriptor; + } + + @java.lang.Override + public com.google.iam.v3beta.ListPrincipalAccessBoundaryPoliciesRequest + getDefaultInstanceForType() { + return com.google.iam.v3beta.ListPrincipalAccessBoundaryPoliciesRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.iam.v3beta.ListPrincipalAccessBoundaryPoliciesRequest build() { + com.google.iam.v3beta.ListPrincipalAccessBoundaryPoliciesRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.iam.v3beta.ListPrincipalAccessBoundaryPoliciesRequest buildPartial() { + com.google.iam.v3beta.ListPrincipalAccessBoundaryPoliciesRequest result = + new com.google.iam.v3beta.ListPrincipalAccessBoundaryPoliciesRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.iam.v3beta.ListPrincipalAccessBoundaryPoliciesRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.parent_ = parent_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.pageSize_ = pageSize_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.pageToken_ = pageToken_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.iam.v3beta.ListPrincipalAccessBoundaryPoliciesRequest) { + return mergeFrom((com.google.iam.v3beta.ListPrincipalAccessBoundaryPoliciesRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.iam.v3beta.ListPrincipalAccessBoundaryPoliciesRequest other) { + if (other + == com.google.iam.v3beta.ListPrincipalAccessBoundaryPoliciesRequest.getDefaultInstance()) + return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.getPageSize() != 0) { + setPageSize(other.getPageSize()); + } + if (!other.getPageToken().isEmpty()) { + pageToken_ = other.pageToken_; + 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 16: + { + pageSize_ = input.readInt32(); + bitField0_ |= 0x00000002; + break; + } // case 16 + case 26: + { + pageToken_ = 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 parent resource, which owns the collection of principal
        +     * access boundary policies.
        +     *
        +     * Format:
        +     * `organizations/{organization_id}/locations/{location}`
        +     * 
        + * + * + * 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, which owns the collection of principal
        +     * access boundary policies.
        +     *
        +     * Format:
        +     * `organizations/{organization_id}/locations/{location}`
        +     * 
        + * + * + * 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, which owns the collection of principal
        +     * access boundary policies.
        +     *
        +     * Format:
        +     * `organizations/{organization_id}/locations/{location}`
        +     * 
        + * + * + * 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, which owns the collection of principal
        +     * access boundary policies.
        +     *
        +     * Format:
        +     * `organizations/{organization_id}/locations/{location}`
        +     * 
        + * + * + * 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, which owns the collection of principal
        +     * access boundary policies.
        +     *
        +     * Format:
        +     * `organizations/{organization_id}/locations/{location}`
        +     * 
        + * + * + * 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 int pageSize_; + + /** + * + * + *
        +     * Optional. The maximum number of principal access boundary policies to
        +     * return. The service may return fewer than this value.
        +     *
        +     * If unspecified, at most 50 principal access boundary policies will be
        +     * returned. The maximum value is 1000; values above 1000 will be coerced to
        +     * 1000.
        +     * 
        + * + * 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 principal access boundary policies to
        +     * return. The service may return fewer than this value.
        +     *
        +     * If unspecified, at most 50 principal access boundary policies will be
        +     * returned. The maximum value is 1000; values above 1000 will be coerced to
        +     * 1000.
        +     * 
        + * + * 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_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
        +     * Optional. The maximum number of principal access boundary policies to
        +     * return. The service may return fewer than this value.
        +     *
        +     * If unspecified, at most 50 principal access boundary policies will be
        +     * returned. The maximum value is 1000; values above 1000 will be coerced to
        +     * 1000.
        +     * 
        + * + * int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearPageSize() { + bitField0_ = (bitField0_ & ~0x00000002); + pageSize_ = 0; + onChanged(); + return this; + } + + private java.lang.Object pageToken_ = ""; + + /** + * + * + *
        +     * Optional. A page token, received from a previous
        +     * `ListPrincipalAccessBoundaryPolicies` call. Provide this to retrieve the
        +     * subsequent page.
        +     *
        +     * When paginating, all other parameters provided to
        +     * `ListPrincipalAccessBoundaryPolicies` must match the call that provided the
        +     * page token.
        +     * 
        + * + * 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. A page token, received from a previous
        +     * `ListPrincipalAccessBoundaryPolicies` call. Provide this to retrieve the
        +     * subsequent page.
        +     *
        +     * When paginating, all other parameters provided to
        +     * `ListPrincipalAccessBoundaryPolicies` must match the call that provided the
        +     * page token.
        +     * 
        + * + * 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. A page token, received from a previous
        +     * `ListPrincipalAccessBoundaryPolicies` call. Provide this to retrieve the
        +     * subsequent page.
        +     *
        +     * When paginating, all other parameters provided to
        +     * `ListPrincipalAccessBoundaryPolicies` must match the call that provided the
        +     * page token.
        +     * 
        + * + * 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_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
        +     * Optional. A page token, received from a previous
        +     * `ListPrincipalAccessBoundaryPolicies` call. Provide this to retrieve the
        +     * subsequent page.
        +     *
        +     * When paginating, all other parameters provided to
        +     * `ListPrincipalAccessBoundaryPolicies` must match the call that provided the
        +     * page token.
        +     * 
        + * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearPageToken() { + pageToken_ = getDefaultInstance().getPageToken(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + + /** + * + * + *
        +     * Optional. A page token, received from a previous
        +     * `ListPrincipalAccessBoundaryPolicies` call. Provide this to retrieve the
        +     * subsequent page.
        +     *
        +     * When paginating, all other parameters provided to
        +     * `ListPrincipalAccessBoundaryPolicies` must match the call that provided the
        +     * page token.
        +     * 
        + * + * 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_ |= 0x00000004; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.iam.v3beta.ListPrincipalAccessBoundaryPoliciesRequest) + } + + // @@protoc_insertion_point(class_scope:google.iam.v3beta.ListPrincipalAccessBoundaryPoliciesRequest) + private static final com.google.iam.v3beta.ListPrincipalAccessBoundaryPoliciesRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.iam.v3beta.ListPrincipalAccessBoundaryPoliciesRequest(); + } + + public static com.google.iam.v3beta.ListPrincipalAccessBoundaryPoliciesRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListPrincipalAccessBoundaryPoliciesRequest 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.iam.v3beta.ListPrincipalAccessBoundaryPoliciesRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-iam/proto-google-iam-v3beta/src/main/java/com/google/iam/v3beta/ListPrincipalAccessBoundaryPoliciesRequestOrBuilder.java b/java-iam/proto-google-iam-v3beta/src/main/java/com/google/iam/v3beta/ListPrincipalAccessBoundaryPoliciesRequestOrBuilder.java new file mode 100644 index 0000000000..a44089c838 --- /dev/null +++ b/java-iam/proto-google-iam-v3beta/src/main/java/com/google/iam/v3beta/ListPrincipalAccessBoundaryPoliciesRequestOrBuilder.java @@ -0,0 +1,122 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/iam/v3beta/principal_access_boundary_policies_service.proto +// Protobuf Java Version: 4.33.2 + +package com.google.iam.v3beta; + +@com.google.protobuf.Generated +public interface ListPrincipalAccessBoundaryPoliciesRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.iam.v3beta.ListPrincipalAccessBoundaryPoliciesRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
        +   * Required. The parent resource, which owns the collection of principal
        +   * access boundary policies.
        +   *
        +   * Format:
        +   * `organizations/{organization_id}/locations/{location}`
        +   * 
        + * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + + /** + * + * + *
        +   * Required. The parent resource, which owns the collection of principal
        +   * access boundary policies.
        +   *
        +   * Format:
        +   * `organizations/{organization_id}/locations/{location}`
        +   * 
        + * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
        +   * Optional. The maximum number of principal access boundary policies to
        +   * return. The service may return fewer than this value.
        +   *
        +   * If unspecified, at most 50 principal access boundary policies will be
        +   * returned. The maximum value is 1000; values above 1000 will be coerced to
        +   * 1000.
        +   * 
        + * + * int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageSize. + */ + int getPageSize(); + + /** + * + * + *
        +   * Optional. A page token, received from a previous
        +   * `ListPrincipalAccessBoundaryPolicies` call. Provide this to retrieve the
        +   * subsequent page.
        +   *
        +   * When paginating, all other parameters provided to
        +   * `ListPrincipalAccessBoundaryPolicies` must match the call that provided the
        +   * page token.
        +   * 
        + * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageToken. + */ + java.lang.String getPageToken(); + + /** + * + * + *
        +   * Optional. A page token, received from a previous
        +   * `ListPrincipalAccessBoundaryPolicies` call. Provide this to retrieve the
        +   * subsequent page.
        +   *
        +   * When paginating, all other parameters provided to
        +   * `ListPrincipalAccessBoundaryPolicies` must match the call that provided the
        +   * page token.
        +   * 
        + * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for pageToken. + */ + com.google.protobuf.ByteString getPageTokenBytes(); +} diff --git a/java-iam/proto-google-iam-v3beta/src/main/java/com/google/iam/v3beta/ListPrincipalAccessBoundaryPoliciesResponse.java b/java-iam/proto-google-iam-v3beta/src/main/java/com/google/iam/v3beta/ListPrincipalAccessBoundaryPoliciesResponse.java new file mode 100644 index 0000000000..6944ba49d0 --- /dev/null +++ b/java-iam/proto-google-iam-v3beta/src/main/java/com/google/iam/v3beta/ListPrincipalAccessBoundaryPoliciesResponse.java @@ -0,0 +1,1206 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/iam/v3beta/principal_access_boundary_policies_service.proto +// Protobuf Java Version: 4.33.2 + +package com.google.iam.v3beta; + +/** + * + * + *
        + * Response message for ListPrincipalAccessBoundaryPolicies method.
        + * 
        + * + * Protobuf type {@code google.iam.v3beta.ListPrincipalAccessBoundaryPoliciesResponse} + */ +@com.google.protobuf.Generated +public final class ListPrincipalAccessBoundaryPoliciesResponse + extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.iam.v3beta.ListPrincipalAccessBoundaryPoliciesResponse) + ListPrincipalAccessBoundaryPoliciesResponseOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "ListPrincipalAccessBoundaryPoliciesResponse"); + } + + // Use ListPrincipalAccessBoundaryPoliciesResponse.newBuilder() to construct. + private ListPrincipalAccessBoundaryPoliciesResponse( + com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private ListPrincipalAccessBoundaryPoliciesResponse() { + principalAccessBoundaryPolicies_ = java.util.Collections.emptyList(); + nextPageToken_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.iam.v3beta.PrincipalAccessBoundaryPoliciesServiceProto + .internal_static_google_iam_v3beta_ListPrincipalAccessBoundaryPoliciesResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.iam.v3beta.PrincipalAccessBoundaryPoliciesServiceProto + .internal_static_google_iam_v3beta_ListPrincipalAccessBoundaryPoliciesResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.iam.v3beta.ListPrincipalAccessBoundaryPoliciesResponse.class, + com.google.iam.v3beta.ListPrincipalAccessBoundaryPoliciesResponse.Builder.class); + } + + public static final int PRINCIPAL_ACCESS_BOUNDARY_POLICIES_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private java.util.List + principalAccessBoundaryPolicies_; + + /** + * + * + *
        +   * The principal access boundary policies from the specified parent.
        +   * 
        + * + * + * repeated .google.iam.v3beta.PrincipalAccessBoundaryPolicy principal_access_boundary_policies = 1; + * + */ + @java.lang.Override + public java.util.List + getPrincipalAccessBoundaryPoliciesList() { + return principalAccessBoundaryPolicies_; + } + + /** + * + * + *
        +   * The principal access boundary policies from the specified parent.
        +   * 
        + * + * + * repeated .google.iam.v3beta.PrincipalAccessBoundaryPolicy principal_access_boundary_policies = 1; + * + */ + @java.lang.Override + public java.util.List + getPrincipalAccessBoundaryPoliciesOrBuilderList() { + return principalAccessBoundaryPolicies_; + } + + /** + * + * + *
        +   * The principal access boundary policies from the specified parent.
        +   * 
        + * + * + * repeated .google.iam.v3beta.PrincipalAccessBoundaryPolicy principal_access_boundary_policies = 1; + * + */ + @java.lang.Override + public int getPrincipalAccessBoundaryPoliciesCount() { + return principalAccessBoundaryPolicies_.size(); + } + + /** + * + * + *
        +   * The principal access boundary policies from the specified parent.
        +   * 
        + * + * + * repeated .google.iam.v3beta.PrincipalAccessBoundaryPolicy principal_access_boundary_policies = 1; + * + */ + @java.lang.Override + public com.google.iam.v3beta.PrincipalAccessBoundaryPolicy getPrincipalAccessBoundaryPolicies( + int index) { + return principalAccessBoundaryPolicies_.get(index); + } + + /** + * + * + *
        +   * The principal access boundary policies from the specified parent.
        +   * 
        + * + * + * repeated .google.iam.v3beta.PrincipalAccessBoundaryPolicy principal_access_boundary_policies = 1; + * + */ + @java.lang.Override + public com.google.iam.v3beta.PrincipalAccessBoundaryPolicyOrBuilder + getPrincipalAccessBoundaryPoliciesOrBuilder(int index) { + return principalAccessBoundaryPolicies_.get(index); + } + + public static final int NEXT_PAGE_TOKEN_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object nextPageToken_ = ""; + + /** + * + * + *
        +   * Optional. A token, which can be sent as `page_token` to retrieve the next
        +   * page. If this field is omitted, there are no subsequent pages.
        +   * 
        + * + * string next_page_token = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + } + } + + /** + * + * + *
        +   * Optional. A token, which can be sent as `page_token` to retrieve the next
        +   * page. If this field is omitted, there are no subsequent pages.
        +   * 
        + * + * string next_page_token = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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 < principalAccessBoundaryPolicies_.size(); i++) { + output.writeMessage(1, principalAccessBoundaryPolicies_.get(i)); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(nextPageToken_)) { + com.google.protobuf.GeneratedMessage.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 < principalAccessBoundaryPolicies_.size(); i++) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 1, principalAccessBoundaryPolicies_.get(i)); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(nextPageToken_)) { + size += com.google.protobuf.GeneratedMessage.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.iam.v3beta.ListPrincipalAccessBoundaryPoliciesResponse)) { + return super.equals(obj); + } + com.google.iam.v3beta.ListPrincipalAccessBoundaryPoliciesResponse other = + (com.google.iam.v3beta.ListPrincipalAccessBoundaryPoliciesResponse) obj; + + if (!getPrincipalAccessBoundaryPoliciesList() + .equals(other.getPrincipalAccessBoundaryPoliciesList())) 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 (getPrincipalAccessBoundaryPoliciesCount() > 0) { + hash = (37 * hash) + PRINCIPAL_ACCESS_BOUNDARY_POLICIES_FIELD_NUMBER; + hash = (53 * hash) + getPrincipalAccessBoundaryPoliciesList().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.iam.v3beta.ListPrincipalAccessBoundaryPoliciesResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.iam.v3beta.ListPrincipalAccessBoundaryPoliciesResponse parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.iam.v3beta.ListPrincipalAccessBoundaryPoliciesResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.iam.v3beta.ListPrincipalAccessBoundaryPoliciesResponse 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.iam.v3beta.ListPrincipalAccessBoundaryPoliciesResponse parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.iam.v3beta.ListPrincipalAccessBoundaryPoliciesResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.iam.v3beta.ListPrincipalAccessBoundaryPoliciesResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.iam.v3beta.ListPrincipalAccessBoundaryPoliciesResponse parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.iam.v3beta.ListPrincipalAccessBoundaryPoliciesResponse + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.iam.v3beta.ListPrincipalAccessBoundaryPoliciesResponse + parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.iam.v3beta.ListPrincipalAccessBoundaryPoliciesResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.iam.v3beta.ListPrincipalAccessBoundaryPoliciesResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.iam.v3beta.ListPrincipalAccessBoundaryPoliciesResponse 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
        +   * Response message for ListPrincipalAccessBoundaryPolicies method.
        +   * 
        + * + * Protobuf type {@code google.iam.v3beta.ListPrincipalAccessBoundaryPoliciesResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.iam.v3beta.ListPrincipalAccessBoundaryPoliciesResponse) + com.google.iam.v3beta.ListPrincipalAccessBoundaryPoliciesResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.iam.v3beta.PrincipalAccessBoundaryPoliciesServiceProto + .internal_static_google_iam_v3beta_ListPrincipalAccessBoundaryPoliciesResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.iam.v3beta.PrincipalAccessBoundaryPoliciesServiceProto + .internal_static_google_iam_v3beta_ListPrincipalAccessBoundaryPoliciesResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.iam.v3beta.ListPrincipalAccessBoundaryPoliciesResponse.class, + com.google.iam.v3beta.ListPrincipalAccessBoundaryPoliciesResponse.Builder.class); + } + + // Construct using + // com.google.iam.v3beta.ListPrincipalAccessBoundaryPoliciesResponse.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (principalAccessBoundaryPoliciesBuilder_ == null) { + principalAccessBoundaryPolicies_ = java.util.Collections.emptyList(); + } else { + principalAccessBoundaryPolicies_ = null; + principalAccessBoundaryPoliciesBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + nextPageToken_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.iam.v3beta.PrincipalAccessBoundaryPoliciesServiceProto + .internal_static_google_iam_v3beta_ListPrincipalAccessBoundaryPoliciesResponse_descriptor; + } + + @java.lang.Override + public com.google.iam.v3beta.ListPrincipalAccessBoundaryPoliciesResponse + getDefaultInstanceForType() { + return com.google.iam.v3beta.ListPrincipalAccessBoundaryPoliciesResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.iam.v3beta.ListPrincipalAccessBoundaryPoliciesResponse build() { + com.google.iam.v3beta.ListPrincipalAccessBoundaryPoliciesResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.iam.v3beta.ListPrincipalAccessBoundaryPoliciesResponse buildPartial() { + com.google.iam.v3beta.ListPrincipalAccessBoundaryPoliciesResponse result = + new com.google.iam.v3beta.ListPrincipalAccessBoundaryPoliciesResponse(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields( + com.google.iam.v3beta.ListPrincipalAccessBoundaryPoliciesResponse result) { + if (principalAccessBoundaryPoliciesBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + principalAccessBoundaryPolicies_ = + java.util.Collections.unmodifiableList(principalAccessBoundaryPolicies_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.principalAccessBoundaryPolicies_ = principalAccessBoundaryPolicies_; + } else { + result.principalAccessBoundaryPolicies_ = principalAccessBoundaryPoliciesBuilder_.build(); + } + } + + private void buildPartial0( + com.google.iam.v3beta.ListPrincipalAccessBoundaryPoliciesResponse result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.nextPageToken_ = nextPageToken_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.iam.v3beta.ListPrincipalAccessBoundaryPoliciesResponse) { + return mergeFrom((com.google.iam.v3beta.ListPrincipalAccessBoundaryPoliciesResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.iam.v3beta.ListPrincipalAccessBoundaryPoliciesResponse other) { + if (other + == com.google.iam.v3beta.ListPrincipalAccessBoundaryPoliciesResponse.getDefaultInstance()) + return this; + if (principalAccessBoundaryPoliciesBuilder_ == null) { + if (!other.principalAccessBoundaryPolicies_.isEmpty()) { + if (principalAccessBoundaryPolicies_.isEmpty()) { + principalAccessBoundaryPolicies_ = other.principalAccessBoundaryPolicies_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensurePrincipalAccessBoundaryPoliciesIsMutable(); + principalAccessBoundaryPolicies_.addAll(other.principalAccessBoundaryPolicies_); + } + onChanged(); + } + } else { + if (!other.principalAccessBoundaryPolicies_.isEmpty()) { + if (principalAccessBoundaryPoliciesBuilder_.isEmpty()) { + principalAccessBoundaryPoliciesBuilder_.dispose(); + principalAccessBoundaryPoliciesBuilder_ = null; + principalAccessBoundaryPolicies_ = other.principalAccessBoundaryPolicies_; + bitField0_ = (bitField0_ & ~0x00000001); + principalAccessBoundaryPoliciesBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders + ? internalGetPrincipalAccessBoundaryPoliciesFieldBuilder() + : null; + } else { + principalAccessBoundaryPoliciesBuilder_.addAllMessages( + other.principalAccessBoundaryPolicies_); + } + } + } + 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.iam.v3beta.PrincipalAccessBoundaryPolicy m = + input.readMessage( + com.google.iam.v3beta.PrincipalAccessBoundaryPolicy.parser(), + extensionRegistry); + if (principalAccessBoundaryPoliciesBuilder_ == null) { + ensurePrincipalAccessBoundaryPoliciesIsMutable(); + principalAccessBoundaryPolicies_.add(m); + } else { + principalAccessBoundaryPoliciesBuilder_.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 + principalAccessBoundaryPolicies_ = java.util.Collections.emptyList(); + + private void ensurePrincipalAccessBoundaryPoliciesIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + principalAccessBoundaryPolicies_ = + new java.util.ArrayList( + principalAccessBoundaryPolicies_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.google.iam.v3beta.PrincipalAccessBoundaryPolicy, + com.google.iam.v3beta.PrincipalAccessBoundaryPolicy.Builder, + com.google.iam.v3beta.PrincipalAccessBoundaryPolicyOrBuilder> + principalAccessBoundaryPoliciesBuilder_; + + /** + * + * + *
        +     * The principal access boundary policies from the specified parent.
        +     * 
        + * + * + * repeated .google.iam.v3beta.PrincipalAccessBoundaryPolicy principal_access_boundary_policies = 1; + * + */ + public java.util.List + getPrincipalAccessBoundaryPoliciesList() { + if (principalAccessBoundaryPoliciesBuilder_ == null) { + return java.util.Collections.unmodifiableList(principalAccessBoundaryPolicies_); + } else { + return principalAccessBoundaryPoliciesBuilder_.getMessageList(); + } + } + + /** + * + * + *
        +     * The principal access boundary policies from the specified parent.
        +     * 
        + * + * + * repeated .google.iam.v3beta.PrincipalAccessBoundaryPolicy principal_access_boundary_policies = 1; + * + */ + public int getPrincipalAccessBoundaryPoliciesCount() { + if (principalAccessBoundaryPoliciesBuilder_ == null) { + return principalAccessBoundaryPolicies_.size(); + } else { + return principalAccessBoundaryPoliciesBuilder_.getCount(); + } + } + + /** + * + * + *
        +     * The principal access boundary policies from the specified parent.
        +     * 
        + * + * + * repeated .google.iam.v3beta.PrincipalAccessBoundaryPolicy principal_access_boundary_policies = 1; + * + */ + public com.google.iam.v3beta.PrincipalAccessBoundaryPolicy getPrincipalAccessBoundaryPolicies( + int index) { + if (principalAccessBoundaryPoliciesBuilder_ == null) { + return principalAccessBoundaryPolicies_.get(index); + } else { + return principalAccessBoundaryPoliciesBuilder_.getMessage(index); + } + } + + /** + * + * + *
        +     * The principal access boundary policies from the specified parent.
        +     * 
        + * + * + * repeated .google.iam.v3beta.PrincipalAccessBoundaryPolicy principal_access_boundary_policies = 1; + * + */ + public Builder setPrincipalAccessBoundaryPolicies( + int index, com.google.iam.v3beta.PrincipalAccessBoundaryPolicy value) { + if (principalAccessBoundaryPoliciesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensurePrincipalAccessBoundaryPoliciesIsMutable(); + principalAccessBoundaryPolicies_.set(index, value); + onChanged(); + } else { + principalAccessBoundaryPoliciesBuilder_.setMessage(index, value); + } + return this; + } + + /** + * + * + *
        +     * The principal access boundary policies from the specified parent.
        +     * 
        + * + * + * repeated .google.iam.v3beta.PrincipalAccessBoundaryPolicy principal_access_boundary_policies = 1; + * + */ + public Builder setPrincipalAccessBoundaryPolicies( + int index, com.google.iam.v3beta.PrincipalAccessBoundaryPolicy.Builder builderForValue) { + if (principalAccessBoundaryPoliciesBuilder_ == null) { + ensurePrincipalAccessBoundaryPoliciesIsMutable(); + principalAccessBoundaryPolicies_.set(index, builderForValue.build()); + onChanged(); + } else { + principalAccessBoundaryPoliciesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
        +     * The principal access boundary policies from the specified parent.
        +     * 
        + * + * + * repeated .google.iam.v3beta.PrincipalAccessBoundaryPolicy principal_access_boundary_policies = 1; + * + */ + public Builder addPrincipalAccessBoundaryPolicies( + com.google.iam.v3beta.PrincipalAccessBoundaryPolicy value) { + if (principalAccessBoundaryPoliciesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensurePrincipalAccessBoundaryPoliciesIsMutable(); + principalAccessBoundaryPolicies_.add(value); + onChanged(); + } else { + principalAccessBoundaryPoliciesBuilder_.addMessage(value); + } + return this; + } + + /** + * + * + *
        +     * The principal access boundary policies from the specified parent.
        +     * 
        + * + * + * repeated .google.iam.v3beta.PrincipalAccessBoundaryPolicy principal_access_boundary_policies = 1; + * + */ + public Builder addPrincipalAccessBoundaryPolicies( + int index, com.google.iam.v3beta.PrincipalAccessBoundaryPolicy value) { + if (principalAccessBoundaryPoliciesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensurePrincipalAccessBoundaryPoliciesIsMutable(); + principalAccessBoundaryPolicies_.add(index, value); + onChanged(); + } else { + principalAccessBoundaryPoliciesBuilder_.addMessage(index, value); + } + return this; + } + + /** + * + * + *
        +     * The principal access boundary policies from the specified parent.
        +     * 
        + * + * + * repeated .google.iam.v3beta.PrincipalAccessBoundaryPolicy principal_access_boundary_policies = 1; + * + */ + public Builder addPrincipalAccessBoundaryPolicies( + com.google.iam.v3beta.PrincipalAccessBoundaryPolicy.Builder builderForValue) { + if (principalAccessBoundaryPoliciesBuilder_ == null) { + ensurePrincipalAccessBoundaryPoliciesIsMutable(); + principalAccessBoundaryPolicies_.add(builderForValue.build()); + onChanged(); + } else { + principalAccessBoundaryPoliciesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + + /** + * + * + *
        +     * The principal access boundary policies from the specified parent.
        +     * 
        + * + * + * repeated .google.iam.v3beta.PrincipalAccessBoundaryPolicy principal_access_boundary_policies = 1; + * + */ + public Builder addPrincipalAccessBoundaryPolicies( + int index, com.google.iam.v3beta.PrincipalAccessBoundaryPolicy.Builder builderForValue) { + if (principalAccessBoundaryPoliciesBuilder_ == null) { + ensurePrincipalAccessBoundaryPoliciesIsMutable(); + principalAccessBoundaryPolicies_.add(index, builderForValue.build()); + onChanged(); + } else { + principalAccessBoundaryPoliciesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
        +     * The principal access boundary policies from the specified parent.
        +     * 
        + * + * + * repeated .google.iam.v3beta.PrincipalAccessBoundaryPolicy principal_access_boundary_policies = 1; + * + */ + public Builder addAllPrincipalAccessBoundaryPolicies( + java.lang.Iterable values) { + if (principalAccessBoundaryPoliciesBuilder_ == null) { + ensurePrincipalAccessBoundaryPoliciesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, principalAccessBoundaryPolicies_); + onChanged(); + } else { + principalAccessBoundaryPoliciesBuilder_.addAllMessages(values); + } + return this; + } + + /** + * + * + *
        +     * The principal access boundary policies from the specified parent.
        +     * 
        + * + * + * repeated .google.iam.v3beta.PrincipalAccessBoundaryPolicy principal_access_boundary_policies = 1; + * + */ + public Builder clearPrincipalAccessBoundaryPolicies() { + if (principalAccessBoundaryPoliciesBuilder_ == null) { + principalAccessBoundaryPolicies_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + principalAccessBoundaryPoliciesBuilder_.clear(); + } + return this; + } + + /** + * + * + *
        +     * The principal access boundary policies from the specified parent.
        +     * 
        + * + * + * repeated .google.iam.v3beta.PrincipalAccessBoundaryPolicy principal_access_boundary_policies = 1; + * + */ + public Builder removePrincipalAccessBoundaryPolicies(int index) { + if (principalAccessBoundaryPoliciesBuilder_ == null) { + ensurePrincipalAccessBoundaryPoliciesIsMutable(); + principalAccessBoundaryPolicies_.remove(index); + onChanged(); + } else { + principalAccessBoundaryPoliciesBuilder_.remove(index); + } + return this; + } + + /** + * + * + *
        +     * The principal access boundary policies from the specified parent.
        +     * 
        + * + * + * repeated .google.iam.v3beta.PrincipalAccessBoundaryPolicy principal_access_boundary_policies = 1; + * + */ + public com.google.iam.v3beta.PrincipalAccessBoundaryPolicy.Builder + getPrincipalAccessBoundaryPoliciesBuilder(int index) { + return internalGetPrincipalAccessBoundaryPoliciesFieldBuilder().getBuilder(index); + } + + /** + * + * + *
        +     * The principal access boundary policies from the specified parent.
        +     * 
        + * + * + * repeated .google.iam.v3beta.PrincipalAccessBoundaryPolicy principal_access_boundary_policies = 1; + * + */ + public com.google.iam.v3beta.PrincipalAccessBoundaryPolicyOrBuilder + getPrincipalAccessBoundaryPoliciesOrBuilder(int index) { + if (principalAccessBoundaryPoliciesBuilder_ == null) { + return principalAccessBoundaryPolicies_.get(index); + } else { + return principalAccessBoundaryPoliciesBuilder_.getMessageOrBuilder(index); + } + } + + /** + * + * + *
        +     * The principal access boundary policies from the specified parent.
        +     * 
        + * + * + * repeated .google.iam.v3beta.PrincipalAccessBoundaryPolicy principal_access_boundary_policies = 1; + * + */ + public java.util.List + getPrincipalAccessBoundaryPoliciesOrBuilderList() { + if (principalAccessBoundaryPoliciesBuilder_ != null) { + return principalAccessBoundaryPoliciesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(principalAccessBoundaryPolicies_); + } + } + + /** + * + * + *
        +     * The principal access boundary policies from the specified parent.
        +     * 
        + * + * + * repeated .google.iam.v3beta.PrincipalAccessBoundaryPolicy principal_access_boundary_policies = 1; + * + */ + public com.google.iam.v3beta.PrincipalAccessBoundaryPolicy.Builder + addPrincipalAccessBoundaryPoliciesBuilder() { + return internalGetPrincipalAccessBoundaryPoliciesFieldBuilder() + .addBuilder(com.google.iam.v3beta.PrincipalAccessBoundaryPolicy.getDefaultInstance()); + } + + /** + * + * + *
        +     * The principal access boundary policies from the specified parent.
        +     * 
        + * + * + * repeated .google.iam.v3beta.PrincipalAccessBoundaryPolicy principal_access_boundary_policies = 1; + * + */ + public com.google.iam.v3beta.PrincipalAccessBoundaryPolicy.Builder + addPrincipalAccessBoundaryPoliciesBuilder(int index) { + return internalGetPrincipalAccessBoundaryPoliciesFieldBuilder() + .addBuilder( + index, com.google.iam.v3beta.PrincipalAccessBoundaryPolicy.getDefaultInstance()); + } + + /** + * + * + *
        +     * The principal access boundary policies from the specified parent.
        +     * 
        + * + * + * repeated .google.iam.v3beta.PrincipalAccessBoundaryPolicy principal_access_boundary_policies = 1; + * + */ + public java.util.List + getPrincipalAccessBoundaryPoliciesBuilderList() { + return internalGetPrincipalAccessBoundaryPoliciesFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.google.iam.v3beta.PrincipalAccessBoundaryPolicy, + com.google.iam.v3beta.PrincipalAccessBoundaryPolicy.Builder, + com.google.iam.v3beta.PrincipalAccessBoundaryPolicyOrBuilder> + internalGetPrincipalAccessBoundaryPoliciesFieldBuilder() { + if (principalAccessBoundaryPoliciesBuilder_ == null) { + principalAccessBoundaryPoliciesBuilder_ = + new com.google.protobuf.RepeatedFieldBuilder< + com.google.iam.v3beta.PrincipalAccessBoundaryPolicy, + com.google.iam.v3beta.PrincipalAccessBoundaryPolicy.Builder, + com.google.iam.v3beta.PrincipalAccessBoundaryPolicyOrBuilder>( + principalAccessBoundaryPolicies_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + principalAccessBoundaryPolicies_ = null; + } + return principalAccessBoundaryPoliciesBuilder_; + } + + private java.lang.Object nextPageToken_ = ""; + + /** + * + * + *
        +     * Optional. A token, which can be sent as `page_token` to retrieve the next
        +     * page. If this field is omitted, there are no subsequent pages.
        +     * 
        + * + * string next_page_token = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + } + } + + /** + * + * + *
        +     * Optional. A token, which can be sent as `page_token` to retrieve the next
        +     * page. If this field is omitted, there are no subsequent pages.
        +     * 
        + * + * string next_page_token = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + } + } + + /** + * + * + *
        +     * Optional. A token, which can be sent as `page_token` to retrieve the next
        +     * page. If this field is omitted, there are no subsequent pages.
        +     * 
        + * + * string next_page_token = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + } + + /** + * + * + *
        +     * Optional. A token, which can be sent as `page_token` to retrieve the next
        +     * page. If this field is omitted, there are no subsequent pages.
        +     * 
        + * + * string next_page_token = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearNextPageToken() { + nextPageToken_ = getDefaultInstance().getNextPageToken(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
        +     * Optional. A token, which can be sent as `page_token` to retrieve the next
        +     * page. If this field is omitted, there are no subsequent pages.
        +     * 
        + * + * string next_page_token = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + } + + // @@protoc_insertion_point(builder_scope:google.iam.v3beta.ListPrincipalAccessBoundaryPoliciesResponse) + } + + // @@protoc_insertion_point(class_scope:google.iam.v3beta.ListPrincipalAccessBoundaryPoliciesResponse) + private static final com.google.iam.v3beta.ListPrincipalAccessBoundaryPoliciesResponse + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.iam.v3beta.ListPrincipalAccessBoundaryPoliciesResponse(); + } + + public static com.google.iam.v3beta.ListPrincipalAccessBoundaryPoliciesResponse + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListPrincipalAccessBoundaryPoliciesResponse 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.iam.v3beta.ListPrincipalAccessBoundaryPoliciesResponse + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-iam/proto-google-iam-v3beta/src/main/java/com/google/iam/v3beta/ListPrincipalAccessBoundaryPoliciesResponseOrBuilder.java b/java-iam/proto-google-iam-v3beta/src/main/java/com/google/iam/v3beta/ListPrincipalAccessBoundaryPoliciesResponseOrBuilder.java new file mode 100644 index 0000000000..2200acc135 --- /dev/null +++ b/java-iam/proto-google-iam-v3beta/src/main/java/com/google/iam/v3beta/ListPrincipalAccessBoundaryPoliciesResponseOrBuilder.java @@ -0,0 +1,124 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/iam/v3beta/principal_access_boundary_policies_service.proto +// Protobuf Java Version: 4.33.2 + +package com.google.iam.v3beta; + +@com.google.protobuf.Generated +public interface ListPrincipalAccessBoundaryPoliciesResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.iam.v3beta.ListPrincipalAccessBoundaryPoliciesResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
        +   * The principal access boundary policies from the specified parent.
        +   * 
        + * + * + * repeated .google.iam.v3beta.PrincipalAccessBoundaryPolicy principal_access_boundary_policies = 1; + * + */ + java.util.List + getPrincipalAccessBoundaryPoliciesList(); + + /** + * + * + *
        +   * The principal access boundary policies from the specified parent.
        +   * 
        + * + * + * repeated .google.iam.v3beta.PrincipalAccessBoundaryPolicy principal_access_boundary_policies = 1; + * + */ + com.google.iam.v3beta.PrincipalAccessBoundaryPolicy getPrincipalAccessBoundaryPolicies(int index); + + /** + * + * + *
        +   * The principal access boundary policies from the specified parent.
        +   * 
        + * + * + * repeated .google.iam.v3beta.PrincipalAccessBoundaryPolicy principal_access_boundary_policies = 1; + * + */ + int getPrincipalAccessBoundaryPoliciesCount(); + + /** + * + * + *
        +   * The principal access boundary policies from the specified parent.
        +   * 
        + * + * + * repeated .google.iam.v3beta.PrincipalAccessBoundaryPolicy principal_access_boundary_policies = 1; + * + */ + java.util.List + getPrincipalAccessBoundaryPoliciesOrBuilderList(); + + /** + * + * + *
        +   * The principal access boundary policies from the specified parent.
        +   * 
        + * + * + * repeated .google.iam.v3beta.PrincipalAccessBoundaryPolicy principal_access_boundary_policies = 1; + * + */ + com.google.iam.v3beta.PrincipalAccessBoundaryPolicyOrBuilder + getPrincipalAccessBoundaryPoliciesOrBuilder(int index); + + /** + * + * + *
        +   * Optional. A token, which can be sent as `page_token` to retrieve the next
        +   * page. If this field is omitted, there are no subsequent pages.
        +   * 
        + * + * string next_page_token = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The nextPageToken. + */ + java.lang.String getNextPageToken(); + + /** + * + * + *
        +   * Optional. A token, which can be sent as `page_token` to retrieve the next
        +   * page. If this field is omitted, there are no subsequent pages.
        +   * 
        + * + * string next_page_token = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for nextPageToken. + */ + com.google.protobuf.ByteString getNextPageTokenBytes(); +} diff --git a/java-iam/proto-google-iam-v3beta/src/main/java/com/google/iam/v3beta/LocationName.java b/java-iam/proto-google-iam-v3beta/src/main/java/com/google/iam/v3beta/LocationName.java new file mode 100644 index 0000000000..19a5b6f85a --- /dev/null +++ b/java-iam/proto-google-iam-v3beta/src/main/java/com/google/iam/v3beta/LocationName.java @@ -0,0 +1,192 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.iam.v3beta; + +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-iam/proto-google-iam-v3beta/src/main/java/com/google/iam/v3beta/OperationMetadata.java b/java-iam/proto-google-iam-v3beta/src/main/java/com/google/iam/v3beta/OperationMetadata.java new file mode 100644 index 0000000000..2754782e92 --- /dev/null +++ b/java-iam/proto-google-iam-v3beta/src/main/java/com/google/iam/v3beta/OperationMetadata.java @@ -0,0 +1,1867 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/iam/v3beta/operation_metadata.proto +// Protobuf Java Version: 4.33.2 + +package com.google.iam.v3beta; + +/** + * + * + *
        + * Represents the metadata of the long-running operation.
        + * 
        + * + * Protobuf type {@code google.iam.v3beta.OperationMetadata} + */ +@com.google.protobuf.Generated +public final class OperationMetadata extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.iam.v3beta.OperationMetadata) + OperationMetadataOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "OperationMetadata"); + } + + // Use OperationMetadata.newBuilder() to construct. + private OperationMetadata(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private OperationMetadata() { + target_ = ""; + verb_ = ""; + statusMessage_ = ""; + apiVersion_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.iam.v3beta.OperationMetadataProto + .internal_static_google_iam_v3beta_OperationMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.iam.v3beta.OperationMetadataProto + .internal_static_google_iam_v3beta_OperationMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.iam.v3beta.OperationMetadata.class, + com.google.iam.v3beta.OperationMetadata.Builder.class); + } + + private int bitField0_; + public static final int CREATE_TIME_FIELD_NUMBER = 1; + private com.google.protobuf.Timestamp createTime_; + + /** + * + * + *
        +   * Output only. The time the operation was created.
        +   * 
        + * + * .google.protobuf.Timestamp create_time = 1 [(.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 time the operation was created.
        +   * 
        + * + * .google.protobuf.Timestamp create_time = 1 [(.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 time the operation was created.
        +   * 
        + * + * .google.protobuf.Timestamp create_time = 1 [(.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 END_TIME_FIELD_NUMBER = 2; + private com.google.protobuf.Timestamp endTime_; + + /** + * + * + *
        +   * Output only. The time the operation finished running.
        +   * 
        + * + * .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the endTime field is set. + */ + @java.lang.Override + public boolean hasEndTime() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
        +   * Output only. The time the operation finished running.
        +   * 
        + * + * .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The endTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getEndTime() { + return endTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : endTime_; + } + + /** + * + * + *
        +   * Output only. The time the operation finished running.
        +   * 
        + * + * .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getEndTimeOrBuilder() { + return endTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : endTime_; + } + + public static final int TARGET_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object target_ = ""; + + /** + * + * + *
        +   * Output only. Server-defined resource path for the target of the
        +   * 
        + * + * string target = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The target. + */ + @java.lang.Override + public java.lang.String getTarget() { + java.lang.Object ref = target_; + 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(); + target_ = s; + return s; + } + } + + /** + * + * + *
        +   * Output only. Server-defined resource path for the target of the
        +   * 
        + * + * string target = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for target. + */ + @java.lang.Override + public com.google.protobuf.ByteString getTargetBytes() { + java.lang.Object ref = target_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + target_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int VERB_FIELD_NUMBER = 4; + + @SuppressWarnings("serial") + private volatile java.lang.Object verb_ = ""; + + /** + * + * + *
        +   * Output only. Name of the verb executed by the operation.
        +   * 
        + * + * string verb = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The verb. + */ + @java.lang.Override + public java.lang.String getVerb() { + java.lang.Object ref = verb_; + 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(); + verb_ = s; + return s; + } + } + + /** + * + * + *
        +   * Output only. Name of the verb executed by the operation.
        +   * 
        + * + * string verb = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for verb. + */ + @java.lang.Override + public com.google.protobuf.ByteString getVerbBytes() { + java.lang.Object ref = verb_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + verb_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int STATUS_MESSAGE_FIELD_NUMBER = 5; + + @SuppressWarnings("serial") + private volatile java.lang.Object statusMessage_ = ""; + + /** + * + * + *
        +   * Output only. Human-readable status of the operation, if any.
        +   * 
        + * + * string status_message = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The statusMessage. + */ + @java.lang.Override + public java.lang.String getStatusMessage() { + java.lang.Object ref = statusMessage_; + 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(); + statusMessage_ = s; + return s; + } + } + + /** + * + * + *
        +   * Output only. Human-readable status of the operation, if any.
        +   * 
        + * + * string status_message = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for statusMessage. + */ + @java.lang.Override + public com.google.protobuf.ByteString getStatusMessageBytes() { + java.lang.Object ref = statusMessage_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + statusMessage_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int REQUESTED_CANCELLATION_FIELD_NUMBER = 6; + private boolean requestedCancellation_ = false; + + /** + * + * + *
        +   * Output only. Identifies whether the user has requested cancellation
        +   * of the operation. Operations that have successfully been cancelled
        +   * have [Operation.error][] value with a
        +   * [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to
        +   * `Code.CANCELLED`.
        +   * 
        + * + * bool requested_cancellation = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The requestedCancellation. + */ + @java.lang.Override + public boolean getRequestedCancellation() { + return requestedCancellation_; + } + + public static final int API_VERSION_FIELD_NUMBER = 7; + + @SuppressWarnings("serial") + private volatile java.lang.Object apiVersion_ = ""; + + /** + * + * + *
        +   * Output only. API version used to start the operation.
        +   * 
        + * + * string api_version = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The apiVersion. + */ + @java.lang.Override + public java.lang.String getApiVersion() { + java.lang.Object ref = apiVersion_; + 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(); + apiVersion_ = s; + return s; + } + } + + /** + * + * + *
        +   * Output only. API version used to start the operation.
        +   * 
        + * + * string api_version = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for apiVersion. + */ + @java.lang.Override + public com.google.protobuf.ByteString getApiVersionBytes() { + java.lang.Object ref = apiVersion_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + apiVersion_ = 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, getCreateTime()); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeMessage(2, getEndTime()); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(target_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 3, target_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(verb_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 4, verb_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(statusMessage_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 5, statusMessage_); + } + if (requestedCancellation_ != false) { + output.writeBool(6, requestedCancellation_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(apiVersion_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 7, apiVersion_); + } + 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, getCreateTime()); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getEndTime()); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(target_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(3, target_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(verb_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(4, verb_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(statusMessage_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(5, statusMessage_); + } + if (requestedCancellation_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(6, requestedCancellation_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(apiVersion_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(7, apiVersion_); + } + 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.iam.v3beta.OperationMetadata)) { + return super.equals(obj); + } + com.google.iam.v3beta.OperationMetadata other = (com.google.iam.v3beta.OperationMetadata) obj; + + if (hasCreateTime() != other.hasCreateTime()) return false; + if (hasCreateTime()) { + if (!getCreateTime().equals(other.getCreateTime())) return false; + } + if (hasEndTime() != other.hasEndTime()) return false; + if (hasEndTime()) { + if (!getEndTime().equals(other.getEndTime())) return false; + } + if (!getTarget().equals(other.getTarget())) return false; + if (!getVerb().equals(other.getVerb())) return false; + if (!getStatusMessage().equals(other.getStatusMessage())) return false; + if (getRequestedCancellation() != other.getRequestedCancellation()) return false; + if (!getApiVersion().equals(other.getApiVersion())) 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 (hasCreateTime()) { + hash = (37 * hash) + CREATE_TIME_FIELD_NUMBER; + hash = (53 * hash) + getCreateTime().hashCode(); + } + if (hasEndTime()) { + hash = (37 * hash) + END_TIME_FIELD_NUMBER; + hash = (53 * hash) + getEndTime().hashCode(); + } + hash = (37 * hash) + TARGET_FIELD_NUMBER; + hash = (53 * hash) + getTarget().hashCode(); + hash = (37 * hash) + VERB_FIELD_NUMBER; + hash = (53 * hash) + getVerb().hashCode(); + hash = (37 * hash) + STATUS_MESSAGE_FIELD_NUMBER; + hash = (53 * hash) + getStatusMessage().hashCode(); + hash = (37 * hash) + REQUESTED_CANCELLATION_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getRequestedCancellation()); + hash = (37 * hash) + API_VERSION_FIELD_NUMBER; + hash = (53 * hash) + getApiVersion().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.iam.v3beta.OperationMetadata parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.iam.v3beta.OperationMetadata parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.iam.v3beta.OperationMetadata parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.iam.v3beta.OperationMetadata 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.iam.v3beta.OperationMetadata parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.iam.v3beta.OperationMetadata parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.iam.v3beta.OperationMetadata parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.iam.v3beta.OperationMetadata parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.iam.v3beta.OperationMetadata parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.iam.v3beta.OperationMetadata parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.iam.v3beta.OperationMetadata parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.iam.v3beta.OperationMetadata parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.iam.v3beta.OperationMetadata 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
        +   * Represents the metadata of the long-running operation.
        +   * 
        + * + * Protobuf type {@code google.iam.v3beta.OperationMetadata} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.iam.v3beta.OperationMetadata) + com.google.iam.v3beta.OperationMetadataOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.iam.v3beta.OperationMetadataProto + .internal_static_google_iam_v3beta_OperationMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.iam.v3beta.OperationMetadataProto + .internal_static_google_iam_v3beta_OperationMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.iam.v3beta.OperationMetadata.class, + com.google.iam.v3beta.OperationMetadata.Builder.class); + } + + // Construct using com.google.iam.v3beta.OperationMetadata.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetCreateTimeFieldBuilder(); + internalGetEndTimeFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + createTime_ = null; + if (createTimeBuilder_ != null) { + createTimeBuilder_.dispose(); + createTimeBuilder_ = null; + } + endTime_ = null; + if (endTimeBuilder_ != null) { + endTimeBuilder_.dispose(); + endTimeBuilder_ = null; + } + target_ = ""; + verb_ = ""; + statusMessage_ = ""; + requestedCancellation_ = false; + apiVersion_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.iam.v3beta.OperationMetadataProto + .internal_static_google_iam_v3beta_OperationMetadata_descriptor; + } + + @java.lang.Override + public com.google.iam.v3beta.OperationMetadata getDefaultInstanceForType() { + return com.google.iam.v3beta.OperationMetadata.getDefaultInstance(); + } + + @java.lang.Override + public com.google.iam.v3beta.OperationMetadata build() { + com.google.iam.v3beta.OperationMetadata result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.iam.v3beta.OperationMetadata buildPartial() { + com.google.iam.v3beta.OperationMetadata result = + new com.google.iam.v3beta.OperationMetadata(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.iam.v3beta.OperationMetadata result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.createTime_ = createTimeBuilder_ == null ? createTime_ : createTimeBuilder_.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.target_ = target_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.verb_ = verb_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.statusMessage_ = statusMessage_; + } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.requestedCancellation_ = requestedCancellation_; + } + if (((from_bitField0_ & 0x00000040) != 0)) { + result.apiVersion_ = apiVersion_; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.iam.v3beta.OperationMetadata) { + return mergeFrom((com.google.iam.v3beta.OperationMetadata) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.iam.v3beta.OperationMetadata other) { + if (other == com.google.iam.v3beta.OperationMetadata.getDefaultInstance()) return this; + if (other.hasCreateTime()) { + mergeCreateTime(other.getCreateTime()); + } + if (other.hasEndTime()) { + mergeEndTime(other.getEndTime()); + } + if (!other.getTarget().isEmpty()) { + target_ = other.target_; + bitField0_ |= 0x00000004; + onChanged(); + } + if (!other.getVerb().isEmpty()) { + verb_ = other.verb_; + bitField0_ |= 0x00000008; + onChanged(); + } + if (!other.getStatusMessage().isEmpty()) { + statusMessage_ = other.statusMessage_; + bitField0_ |= 0x00000010; + onChanged(); + } + if (other.getRequestedCancellation() != false) { + setRequestedCancellation(other.getRequestedCancellation()); + } + if (!other.getApiVersion().isEmpty()) { + apiVersion_ = other.apiVersion_; + 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( + internalGetCreateTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + input.readMessage(internalGetEndTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + target_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 34: + { + verb_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000008; + break; + } // case 34 + case 42: + { + statusMessage_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000010; + break; + } // case 42 + case 48: + { + requestedCancellation_ = input.readBool(); + bitField0_ |= 0x00000020; + break; + } // case 48 + case 58: + { + apiVersion_ = 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 createTime_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + createTimeBuilder_; + + /** + * + * + *
        +     * Output only. The time the operation was created.
        +     * 
        + * + * + * .google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the createTime field is set. + */ + public boolean hasCreateTime() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
        +     * Output only. The time the operation was created.
        +     * 
        + * + * + * .google.protobuf.Timestamp create_time = 1 [(.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 time the operation was created.
        +     * 
        + * + * + * .google.protobuf.Timestamp create_time = 1 [(.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_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
        +     * Output only. The time the operation was created.
        +     * 
        + * + * + * .google.protobuf.Timestamp create_time = 1 [(.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_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
        +     * Output only. The time the operation was created.
        +     * 
        + * + * + * .google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeCreateTime(com.google.protobuf.Timestamp value) { + if (createTimeBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) + && createTime_ != null + && createTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getCreateTimeBuilder().mergeFrom(value); + } else { + createTime_ = value; + } + } else { + createTimeBuilder_.mergeFrom(value); + } + if (createTime_ != null) { + bitField0_ |= 0x00000001; + onChanged(); + } + return this; + } + + /** + * + * + *
        +     * Output only. The time the operation was created.
        +     * 
        + * + * + * .google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearCreateTime() { + bitField0_ = (bitField0_ & ~0x00000001); + createTime_ = null; + if (createTimeBuilder_ != null) { + createTimeBuilder_.dispose(); + createTimeBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
        +     * Output only. The time the operation was created.
        +     * 
        + * + * + * .google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.Timestamp.Builder getCreateTimeBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return internalGetCreateTimeFieldBuilder().getBuilder(); + } + + /** + * + * + *
        +     * Output only. The time the operation was created.
        +     * 
        + * + * + * .google.protobuf.Timestamp create_time = 1 [(.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 time the operation was created.
        +     * 
        + * + * + * .google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + internalGetCreateTimeFieldBuilder() { + if (createTimeBuilder_ == null) { + createTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + 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 endTime_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + endTimeBuilder_; + + /** + * + * + *
        +     * Output only. The time the operation finished running.
        +     * 
        + * + * .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the endTime field is set. + */ + public boolean hasEndTime() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
        +     * Output only. The time the operation finished running.
        +     * 
        + * + * .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @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(); + } + } + + /** + * + * + *
        +     * Output only. The time the operation finished running.
        +     * 
        + * + * .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + 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; + } + + /** + * + * + *
        +     * Output only. The time the operation finished running.
        +     * 
        + * + * .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + 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; + } + + /** + * + * + *
        +     * Output only. The time the operation finished running.
        +     * 
        + * + * .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + 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; + } + + /** + * + * + *
        +     * Output only. The time the operation finished running.
        +     * 
        + * + * .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearEndTime() { + bitField0_ = (bitField0_ & ~0x00000002); + endTime_ = null; + if (endTimeBuilder_ != null) { + endTimeBuilder_.dispose(); + endTimeBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
        +     * Output only. The time the operation finished running.
        +     * 
        + * + * .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.Timestamp.Builder getEndTimeBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return internalGetEndTimeFieldBuilder().getBuilder(); + } + + /** + * + * + *
        +     * Output only. The time the operation finished running.
        +     * 
        + * + * .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.TimestampOrBuilder getEndTimeOrBuilder() { + if (endTimeBuilder_ != null) { + return endTimeBuilder_.getMessageOrBuilder(); + } else { + return endTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : endTime_; + } + } + + /** + * + * + *
        +     * Output only. The time the operation finished running.
        +     * 
        + * + * .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + internalGetEndTimeFieldBuilder() { + if (endTimeBuilder_ == null) { + endTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getEndTime(), getParentForChildren(), isClean()); + endTime_ = null; + } + return endTimeBuilder_; + } + + private java.lang.Object target_ = ""; + + /** + * + * + *
        +     * Output only. Server-defined resource path for the target of the
        +     * 
        + * + * string target = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The target. + */ + public java.lang.String getTarget() { + java.lang.Object ref = target_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + target_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
        +     * Output only. Server-defined resource path for the target of the
        +     * 
        + * + * string target = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for target. + */ + public com.google.protobuf.ByteString getTargetBytes() { + java.lang.Object ref = target_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + target_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
        +     * Output only. Server-defined resource path for the target of the
        +     * 
        + * + * string target = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The target to set. + * @return This builder for chaining. + */ + public Builder setTarget(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + target_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
        +     * Output only. Server-defined resource path for the target of the
        +     * 
        + * + * string target = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearTarget() { + target_ = getDefaultInstance().getTarget(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + + /** + * + * + *
        +     * Output only. Server-defined resource path for the target of the
        +     * 
        + * + * string target = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The bytes for target to set. + * @return This builder for chaining. + */ + public Builder setTargetBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + target_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + private java.lang.Object verb_ = ""; + + /** + * + * + *
        +     * Output only. Name of the verb executed by the operation.
        +     * 
        + * + * string verb = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The verb. + */ + public java.lang.String getVerb() { + java.lang.Object ref = verb_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + verb_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
        +     * Output only. Name of the verb executed by the operation.
        +     * 
        + * + * string verb = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for verb. + */ + public com.google.protobuf.ByteString getVerbBytes() { + java.lang.Object ref = verb_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + verb_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
        +     * Output only. Name of the verb executed by the operation.
        +     * 
        + * + * string verb = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The verb to set. + * @return This builder for chaining. + */ + public Builder setVerb(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + verb_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + /** + * + * + *
        +     * Output only. Name of the verb executed by the operation.
        +     * 
        + * + * string verb = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearVerb() { + verb_ = getDefaultInstance().getVerb(); + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + return this; + } + + /** + * + * + *
        +     * Output only. Name of the verb executed by the operation.
        +     * 
        + * + * string verb = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The bytes for verb to set. + * @return This builder for chaining. + */ + public Builder setVerbBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + verb_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + private java.lang.Object statusMessage_ = ""; + + /** + * + * + *
        +     * Output only. Human-readable status of the operation, if any.
        +     * 
        + * + * string status_message = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The statusMessage. + */ + public java.lang.String getStatusMessage() { + java.lang.Object ref = statusMessage_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + statusMessage_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
        +     * Output only. Human-readable status of the operation, if any.
        +     * 
        + * + * string status_message = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for statusMessage. + */ + public com.google.protobuf.ByteString getStatusMessageBytes() { + java.lang.Object ref = statusMessage_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + statusMessage_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
        +     * Output only. Human-readable status of the operation, if any.
        +     * 
        + * + * string status_message = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The statusMessage to set. + * @return This builder for chaining. + */ + public Builder setStatusMessage(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + statusMessage_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + /** + * + * + *
        +     * Output only. Human-readable status of the operation, if any.
        +     * 
        + * + * string status_message = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearStatusMessage() { + statusMessage_ = getDefaultInstance().getStatusMessage(); + bitField0_ = (bitField0_ & ~0x00000010); + onChanged(); + return this; + } + + /** + * + * + *
        +     * Output only. Human-readable status of the operation, if any.
        +     * 
        + * + * string status_message = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The bytes for statusMessage to set. + * @return This builder for chaining. + */ + public Builder setStatusMessageBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + statusMessage_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + private boolean requestedCancellation_; + + /** + * + * + *
        +     * Output only. Identifies whether the user has requested cancellation
        +     * of the operation. Operations that have successfully been cancelled
        +     * have [Operation.error][] value with a
        +     * [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to
        +     * `Code.CANCELLED`.
        +     * 
        + * + * bool requested_cancellation = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The requestedCancellation. + */ + @java.lang.Override + public boolean getRequestedCancellation() { + return requestedCancellation_; + } + + /** + * + * + *
        +     * Output only. Identifies whether the user has requested cancellation
        +     * of the operation. Operations that have successfully been cancelled
        +     * have [Operation.error][] value with a
        +     * [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to
        +     * `Code.CANCELLED`.
        +     * 
        + * + * bool requested_cancellation = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The requestedCancellation to set. + * @return This builder for chaining. + */ + public Builder setRequestedCancellation(boolean value) { + + requestedCancellation_ = value; + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + + /** + * + * + *
        +     * Output only. Identifies whether the user has requested cancellation
        +     * of the operation. Operations that have successfully been cancelled
        +     * have [Operation.error][] value with a
        +     * [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to
        +     * `Code.CANCELLED`.
        +     * 
        + * + * bool requested_cancellation = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearRequestedCancellation() { + bitField0_ = (bitField0_ & ~0x00000020); + requestedCancellation_ = false; + onChanged(); + return this; + } + + private java.lang.Object apiVersion_ = ""; + + /** + * + * + *
        +     * Output only. API version used to start the operation.
        +     * 
        + * + * string api_version = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The apiVersion. + */ + public java.lang.String getApiVersion() { + java.lang.Object ref = apiVersion_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + apiVersion_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
        +     * Output only. API version used to start the operation.
        +     * 
        + * + * string api_version = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for apiVersion. + */ + public com.google.protobuf.ByteString getApiVersionBytes() { + java.lang.Object ref = apiVersion_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + apiVersion_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
        +     * Output only. API version used to start the operation.
        +     * 
        + * + * string api_version = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The apiVersion to set. + * @return This builder for chaining. + */ + public Builder setApiVersion(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + apiVersion_ = value; + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + + /** + * + * + *
        +     * Output only. API version used to start the operation.
        +     * 
        + * + * string api_version = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearApiVersion() { + apiVersion_ = getDefaultInstance().getApiVersion(); + bitField0_ = (bitField0_ & ~0x00000040); + onChanged(); + return this; + } + + /** + * + * + *
        +     * Output only. API version used to start the operation.
        +     * 
        + * + * string api_version = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The bytes for apiVersion to set. + * @return This builder for chaining. + */ + public Builder setApiVersionBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + apiVersion_ = value; + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.iam.v3beta.OperationMetadata) + } + + // @@protoc_insertion_point(class_scope:google.iam.v3beta.OperationMetadata) + private static final com.google.iam.v3beta.OperationMetadata DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.iam.v3beta.OperationMetadata(); + } + + public static com.google.iam.v3beta.OperationMetadata getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public OperationMetadata 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.iam.v3beta.OperationMetadata getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-iam/proto-google-iam-v3beta/src/main/java/com/google/iam/v3beta/OperationMetadataOrBuilder.java b/java-iam/proto-google-iam-v3beta/src/main/java/com/google/iam/v3beta/OperationMetadataOrBuilder.java new file mode 100644 index 0000000000..548c27c8ab --- /dev/null +++ b/java-iam/proto-google-iam-v3beta/src/main/java/com/google/iam/v3beta/OperationMetadataOrBuilder.java @@ -0,0 +1,229 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/iam/v3beta/operation_metadata.proto +// Protobuf Java Version: 4.33.2 + +package com.google.iam.v3beta; + +@com.google.protobuf.Generated +public interface OperationMetadataOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.iam.v3beta.OperationMetadata) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
        +   * Output only. The time the operation was created.
        +   * 
        + * + * .google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the createTime field is set. + */ + boolean hasCreateTime(); + + /** + * + * + *
        +   * Output only. The time the operation was created.
        +   * 
        + * + * .google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The createTime. + */ + com.google.protobuf.Timestamp getCreateTime(); + + /** + * + * + *
        +   * Output only. The time the operation was created.
        +   * 
        + * + * .google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder(); + + /** + * + * + *
        +   * Output only. The time the operation finished running.
        +   * 
        + * + * .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the endTime field is set. + */ + boolean hasEndTime(); + + /** + * + * + *
        +   * Output only. The time the operation finished running.
        +   * 
        + * + * .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The endTime. + */ + com.google.protobuf.Timestamp getEndTime(); + + /** + * + * + *
        +   * Output only. The time the operation finished running.
        +   * 
        + * + * .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.protobuf.TimestampOrBuilder getEndTimeOrBuilder(); + + /** + * + * + *
        +   * Output only. Server-defined resource path for the target of the
        +   * 
        + * + * string target = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The target. + */ + java.lang.String getTarget(); + + /** + * + * + *
        +   * Output only. Server-defined resource path for the target of the
        +   * 
        + * + * string target = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for target. + */ + com.google.protobuf.ByteString getTargetBytes(); + + /** + * + * + *
        +   * Output only. Name of the verb executed by the operation.
        +   * 
        + * + * string verb = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The verb. + */ + java.lang.String getVerb(); + + /** + * + * + *
        +   * Output only. Name of the verb executed by the operation.
        +   * 
        + * + * string verb = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for verb. + */ + com.google.protobuf.ByteString getVerbBytes(); + + /** + * + * + *
        +   * Output only. Human-readable status of the operation, if any.
        +   * 
        + * + * string status_message = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The statusMessage. + */ + java.lang.String getStatusMessage(); + + /** + * + * + *
        +   * Output only. Human-readable status of the operation, if any.
        +   * 
        + * + * string status_message = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for statusMessage. + */ + com.google.protobuf.ByteString getStatusMessageBytes(); + + /** + * + * + *
        +   * Output only. Identifies whether the user has requested cancellation
        +   * of the operation. Operations that have successfully been cancelled
        +   * have [Operation.error][] value with a
        +   * [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to
        +   * `Code.CANCELLED`.
        +   * 
        + * + * bool requested_cancellation = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The requestedCancellation. + */ + boolean getRequestedCancellation(); + + /** + * + * + *
        +   * Output only. API version used to start the operation.
        +   * 
        + * + * string api_version = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The apiVersion. + */ + java.lang.String getApiVersion(); + + /** + * + * + *
        +   * Output only. API version used to start the operation.
        +   * 
        + * + * string api_version = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for apiVersion. + */ + com.google.protobuf.ByteString getApiVersionBytes(); +} diff --git a/java-iam/proto-google-iam-v3beta/src/main/java/com/google/iam/v3beta/OperationMetadataProto.java b/java-iam/proto-google-iam-v3beta/src/main/java/com/google/iam/v3beta/OperationMetadataProto.java new file mode 100644 index 0000000000..4009c1db4b --- /dev/null +++ b/java-iam/proto-google-iam-v3beta/src/main/java/com/google/iam/v3beta/OperationMetadataProto.java @@ -0,0 +1,103 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/iam/v3beta/operation_metadata.proto +// Protobuf Java Version: 4.33.2 + +package com.google.iam.v3beta; + +@com.google.protobuf.Generated +public final class OperationMetadataProto extends com.google.protobuf.GeneratedFile { + private OperationMetadataProto() {} + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "OperationMetadataProto"); + } + + 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_iam_v3beta_OperationMetadata_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_iam_v3beta_OperationMetadata_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/iam/v3beta/operation_metadata.p" + + "roto\022\021google.iam.v3beta\032\037google/api/fiel" + + "d_behavior.proto\032\037google/protobuf/timest" + + "amp.proto\"\200\002\n\021OperationMetadata\0224\n\013creat" + + "e_time\030\001 \001(\0132\032.google.protobuf.Timestamp" + + "B\003\340A\003\0221\n\010end_time\030\002 \001(\0132\032.google.protobu" + + "f.TimestampB\003\340A\003\022\023\n\006target\030\003 \001(\tB\003\340A\003\022\021\n" + + "\004verb\030\004 \001(\tB\003\340A\003\022\033\n\016status_message\030\005 \001(\t" + + "B\003\340A\003\022#\n\026requested_cancellation\030\006 \001(\010B\003\340" + + "A\003\022\030\n\013api_version\030\007 \001(\tB\003\340A\003B\224\001\n\025com.goo" + + "gle.iam.v3betaB\026OperationMetadataProtoP\001" + + "Z-cloud.google.com/go/iam/apiv3beta/iamp" + + "b;iampb\252\002\027Google.Cloud.Iam.V3Beta\312\002\027Goog" + + "le\\Cloud\\Iam\\V3betab\006proto3" + }; + descriptor = + com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( + descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + com.google.api.FieldBehaviorProto.getDescriptor(), + com.google.protobuf.TimestampProto.getDescriptor(), + }); + internal_static_google_iam_v3beta_OperationMetadata_descriptor = + getDescriptor().getMessageType(0); + internal_static_google_iam_v3beta_OperationMetadata_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_iam_v3beta_OperationMetadata_descriptor, + new java.lang.String[] { + "CreateTime", + "EndTime", + "Target", + "Verb", + "StatusMessage", + "RequestedCancellation", + "ApiVersion", + }); + descriptor.resolveAllFeaturesImmutable(); + com.google.api.FieldBehaviorProto.getDescriptor(); + com.google.protobuf.TimestampProto.getDescriptor(); + com.google.protobuf.ExtensionRegistry registry = + com.google.protobuf.ExtensionRegistry.newInstance(); + registry.add(com.google.api.FieldBehaviorProto.fieldBehavior); + com.google.protobuf.Descriptors.FileDescriptor.internalUpdateFileDescriptor( + descriptor, registry); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/java-iam/proto-google-iam-v3beta/src/main/java/com/google/iam/v3beta/OrganizationLocationName.java b/java-iam/proto-google-iam-v3beta/src/main/java/com/google/iam/v3beta/OrganizationLocationName.java new file mode 100644 index 0000000000..8a521b39bd --- /dev/null +++ b/java-iam/proto-google-iam-v3beta/src/main/java/com/google/iam/v3beta/OrganizationLocationName.java @@ -0,0 +1,192 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.iam.v3beta; + +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-iam/proto-google-iam-v3beta/src/main/java/com/google/iam/v3beta/PolicyBinding.java b/java-iam/proto-google-iam-v3beta/src/main/java/com/google/iam/v3beta/PolicyBinding.java new file mode 100644 index 0000000000..6ecbe5324e --- /dev/null +++ b/java-iam/proto-google-iam-v3beta/src/main/java/com/google/iam/v3beta/PolicyBinding.java @@ -0,0 +1,5012 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/iam/v3beta/policy_binding_resources.proto +// Protobuf Java Version: 4.33.2 + +package com.google.iam.v3beta; + +/** + * + * + *
        + * IAM policy binding resource.
        + * 
        + * + * Protobuf type {@code google.iam.v3beta.PolicyBinding} + */ +@com.google.protobuf.Generated +public final class PolicyBinding extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.iam.v3beta.PolicyBinding) + PolicyBindingOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "PolicyBinding"); + } + + // Use PolicyBinding.newBuilder() to construct. + private PolicyBinding(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private PolicyBinding() { + name_ = ""; + uid_ = ""; + etag_ = ""; + displayName_ = ""; + policyKind_ = 0; + policy_ = ""; + policyUid_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.iam.v3beta.PolicyBindingResourcesProto + .internal_static_google_iam_v3beta_PolicyBinding_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + @java.lang.Override + protected com.google.protobuf.MapFieldReflectionAccessor internalGetMapFieldReflection( + int number) { + switch (number) { + case 5: + return internalGetAnnotations(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.iam.v3beta.PolicyBindingResourcesProto + .internal_static_google_iam_v3beta_PolicyBinding_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.iam.v3beta.PolicyBinding.class, + com.google.iam.v3beta.PolicyBinding.Builder.class); + } + + /** + * + * + *
        +   * Different policy kinds supported in this binding.
        +   * 
        + * + * Protobuf enum {@code google.iam.v3beta.PolicyBinding.PolicyKind} + */ + public enum PolicyKind implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
        +     * Unspecified policy kind; Not a valid state
        +     * 
        + * + * POLICY_KIND_UNSPECIFIED = 0; + */ + POLICY_KIND_UNSPECIFIED(0), + /** + * + * + *
        +     * Principal access boundary policy kind
        +     * 
        + * + * PRINCIPAL_ACCESS_BOUNDARY = 1; + */ + PRINCIPAL_ACCESS_BOUNDARY(1), + UNRECOGNIZED(-1), + ; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "PolicyKind"); + } + + /** + * + * + *
        +     * Unspecified policy kind; Not a valid state
        +     * 
        + * + * POLICY_KIND_UNSPECIFIED = 0; + */ + public static final int POLICY_KIND_UNSPECIFIED_VALUE = 0; + + /** + * + * + *
        +     * Principal access boundary policy kind
        +     * 
        + * + * PRINCIPAL_ACCESS_BOUNDARY = 1; + */ + public static final int PRINCIPAL_ACCESS_BOUNDARY_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 PolicyKind 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 PolicyKind forNumber(int value) { + switch (value) { + case 0: + return POLICY_KIND_UNSPECIFIED; + case 1: + return PRINCIPAL_ACCESS_BOUNDARY; + 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 PolicyKind findValueByNumber(int number) { + return PolicyKind.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 com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.iam.v3beta.PolicyBinding.getDescriptor().getEnumTypes().get(0); + } + + private static final PolicyKind[] VALUES = values(); + + public static PolicyKind 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 PolicyKind(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.iam.v3beta.PolicyBinding.PolicyKind) + } + + public interface TargetOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.iam.v3beta.PolicyBinding.Target) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
        +     * Immutable. Full Resource Name used for principal access boundary policy
        +     * bindings. The principal set must be directly parented by the policy
        +     * binding's parent or same as the parent if the target is a
        +     * project/folder/organization.
        +     *
        +     * Examples:
        +     * * For binding's parented by an organization:
        +     * * Organization:
        +     * `//cloudresourcemanager.googleapis.com/organizations/ORGANIZATION_ID`
        +     * * Workforce Identity:
        +     * `//iam.googleapis.com/locations/global/workforcePools/WORKFORCE_POOL_ID`
        +     * * Workspace Identity:
        +     * `//iam.googleapis.com/locations/global/workspace/WORKSPACE_ID`
        +     * * For binding's parented by a folder:
        +     * * Folder:
        +     * `//cloudresourcemanager.googleapis.com/folders/FOLDER_ID`
        +     * * For binding's parented by a project:
        +     * * Project:
        +     * * `//cloudresourcemanager.googleapis.com/projects/PROJECT_NUMBER`
        +     * * `//cloudresourcemanager.googleapis.com/projects/PROJECT_ID`
        +     * * Workload Identity Pool:
        +     * `//iam.googleapis.com/projects/PROJECT_NUMBER/locations/LOCATION/workloadIdentityPools/WORKLOAD_POOL_ID`
        +     * 
        + * + * string principal_set = 1 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @return Whether the principalSet field is set. + */ + boolean hasPrincipalSet(); + + /** + * + * + *
        +     * Immutable. Full Resource Name used for principal access boundary policy
        +     * bindings. The principal set must be directly parented by the policy
        +     * binding's parent or same as the parent if the target is a
        +     * project/folder/organization.
        +     *
        +     * Examples:
        +     * * For binding's parented by an organization:
        +     * * Organization:
        +     * `//cloudresourcemanager.googleapis.com/organizations/ORGANIZATION_ID`
        +     * * Workforce Identity:
        +     * `//iam.googleapis.com/locations/global/workforcePools/WORKFORCE_POOL_ID`
        +     * * Workspace Identity:
        +     * `//iam.googleapis.com/locations/global/workspace/WORKSPACE_ID`
        +     * * For binding's parented by a folder:
        +     * * Folder:
        +     * `//cloudresourcemanager.googleapis.com/folders/FOLDER_ID`
        +     * * For binding's parented by a project:
        +     * * Project:
        +     * * `//cloudresourcemanager.googleapis.com/projects/PROJECT_NUMBER`
        +     * * `//cloudresourcemanager.googleapis.com/projects/PROJECT_ID`
        +     * * Workload Identity Pool:
        +     * `//iam.googleapis.com/projects/PROJECT_NUMBER/locations/LOCATION/workloadIdentityPools/WORKLOAD_POOL_ID`
        +     * 
        + * + * string principal_set = 1 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @return The principalSet. + */ + java.lang.String getPrincipalSet(); + + /** + * + * + *
        +     * Immutable. Full Resource Name used for principal access boundary policy
        +     * bindings. The principal set must be directly parented by the policy
        +     * binding's parent or same as the parent if the target is a
        +     * project/folder/organization.
        +     *
        +     * Examples:
        +     * * For binding's parented by an organization:
        +     * * Organization:
        +     * `//cloudresourcemanager.googleapis.com/organizations/ORGANIZATION_ID`
        +     * * Workforce Identity:
        +     * `//iam.googleapis.com/locations/global/workforcePools/WORKFORCE_POOL_ID`
        +     * * Workspace Identity:
        +     * `//iam.googleapis.com/locations/global/workspace/WORKSPACE_ID`
        +     * * For binding's parented by a folder:
        +     * * Folder:
        +     * `//cloudresourcemanager.googleapis.com/folders/FOLDER_ID`
        +     * * For binding's parented by a project:
        +     * * Project:
        +     * * `//cloudresourcemanager.googleapis.com/projects/PROJECT_NUMBER`
        +     * * `//cloudresourcemanager.googleapis.com/projects/PROJECT_ID`
        +     * * Workload Identity Pool:
        +     * `//iam.googleapis.com/projects/PROJECT_NUMBER/locations/LOCATION/workloadIdentityPools/WORKLOAD_POOL_ID`
        +     * 
        + * + * string principal_set = 1 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @return The bytes for principalSet. + */ + com.google.protobuf.ByteString getPrincipalSetBytes(); + + com.google.iam.v3beta.PolicyBinding.Target.TargetCase getTargetCase(); + } + + /** + * + * + *
        +   * Target is the full resource name of the resource to which the policy will
        +   * be bound. Immutable once set.
        +   * 
        + * + * Protobuf type {@code google.iam.v3beta.PolicyBinding.Target} + */ + public static final class Target extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.iam.v3beta.PolicyBinding.Target) + TargetOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "Target"); + } + + // Use Target.newBuilder() to construct. + private Target(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private Target() {} + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.iam.v3beta.PolicyBindingResourcesProto + .internal_static_google_iam_v3beta_PolicyBinding_Target_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.iam.v3beta.PolicyBindingResourcesProto + .internal_static_google_iam_v3beta_PolicyBinding_Target_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.iam.v3beta.PolicyBinding.Target.class, + com.google.iam.v3beta.PolicyBinding.Target.Builder.class); + } + + private int targetCase_ = 0; + + @SuppressWarnings("serial") + private java.lang.Object target_; + + public enum TargetCase + implements + com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + PRINCIPAL_SET(1), + TARGET_NOT_SET(0); + private final int value; + + private TargetCase(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 TargetCase valueOf(int value) { + return forNumber(value); + } + + public static TargetCase forNumber(int value) { + switch (value) { + case 1: + return PRINCIPAL_SET; + case 0: + return TARGET_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public TargetCase getTargetCase() { + return TargetCase.forNumber(targetCase_); + } + + public static final int PRINCIPAL_SET_FIELD_NUMBER = 1; + + /** + * + * + *
        +     * Immutable. Full Resource Name used for principal access boundary policy
        +     * bindings. The principal set must be directly parented by the policy
        +     * binding's parent or same as the parent if the target is a
        +     * project/folder/organization.
        +     *
        +     * Examples:
        +     * * For binding's parented by an organization:
        +     * * Organization:
        +     * `//cloudresourcemanager.googleapis.com/organizations/ORGANIZATION_ID`
        +     * * Workforce Identity:
        +     * `//iam.googleapis.com/locations/global/workforcePools/WORKFORCE_POOL_ID`
        +     * * Workspace Identity:
        +     * `//iam.googleapis.com/locations/global/workspace/WORKSPACE_ID`
        +     * * For binding's parented by a folder:
        +     * * Folder:
        +     * `//cloudresourcemanager.googleapis.com/folders/FOLDER_ID`
        +     * * For binding's parented by a project:
        +     * * Project:
        +     * * `//cloudresourcemanager.googleapis.com/projects/PROJECT_NUMBER`
        +     * * `//cloudresourcemanager.googleapis.com/projects/PROJECT_ID`
        +     * * Workload Identity Pool:
        +     * `//iam.googleapis.com/projects/PROJECT_NUMBER/locations/LOCATION/workloadIdentityPools/WORKLOAD_POOL_ID`
        +     * 
        + * + * string principal_set = 1 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @return Whether the principalSet field is set. + */ + public boolean hasPrincipalSet() { + return targetCase_ == 1; + } + + /** + * + * + *
        +     * Immutable. Full Resource Name used for principal access boundary policy
        +     * bindings. The principal set must be directly parented by the policy
        +     * binding's parent or same as the parent if the target is a
        +     * project/folder/organization.
        +     *
        +     * Examples:
        +     * * For binding's parented by an organization:
        +     * * Organization:
        +     * `//cloudresourcemanager.googleapis.com/organizations/ORGANIZATION_ID`
        +     * * Workforce Identity:
        +     * `//iam.googleapis.com/locations/global/workforcePools/WORKFORCE_POOL_ID`
        +     * * Workspace Identity:
        +     * `//iam.googleapis.com/locations/global/workspace/WORKSPACE_ID`
        +     * * For binding's parented by a folder:
        +     * * Folder:
        +     * `//cloudresourcemanager.googleapis.com/folders/FOLDER_ID`
        +     * * For binding's parented by a project:
        +     * * Project:
        +     * * `//cloudresourcemanager.googleapis.com/projects/PROJECT_NUMBER`
        +     * * `//cloudresourcemanager.googleapis.com/projects/PROJECT_ID`
        +     * * Workload Identity Pool:
        +     * `//iam.googleapis.com/projects/PROJECT_NUMBER/locations/LOCATION/workloadIdentityPools/WORKLOAD_POOL_ID`
        +     * 
        + * + * string principal_set = 1 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @return The principalSet. + */ + public java.lang.String getPrincipalSet() { + java.lang.Object ref = ""; + if (targetCase_ == 1) { + ref = target_; + } + 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 (targetCase_ == 1) { + target_ = s; + } + return s; + } + } + + /** + * + * + *
        +     * Immutable. Full Resource Name used for principal access boundary policy
        +     * bindings. The principal set must be directly parented by the policy
        +     * binding's parent or same as the parent if the target is a
        +     * project/folder/organization.
        +     *
        +     * Examples:
        +     * * For binding's parented by an organization:
        +     * * Organization:
        +     * `//cloudresourcemanager.googleapis.com/organizations/ORGANIZATION_ID`
        +     * * Workforce Identity:
        +     * `//iam.googleapis.com/locations/global/workforcePools/WORKFORCE_POOL_ID`
        +     * * Workspace Identity:
        +     * `//iam.googleapis.com/locations/global/workspace/WORKSPACE_ID`
        +     * * For binding's parented by a folder:
        +     * * Folder:
        +     * `//cloudresourcemanager.googleapis.com/folders/FOLDER_ID`
        +     * * For binding's parented by a project:
        +     * * Project:
        +     * * `//cloudresourcemanager.googleapis.com/projects/PROJECT_NUMBER`
        +     * * `//cloudresourcemanager.googleapis.com/projects/PROJECT_ID`
        +     * * Workload Identity Pool:
        +     * `//iam.googleapis.com/projects/PROJECT_NUMBER/locations/LOCATION/workloadIdentityPools/WORKLOAD_POOL_ID`
        +     * 
        + * + * string principal_set = 1 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @return The bytes for principalSet. + */ + public com.google.protobuf.ByteString getPrincipalSetBytes() { + java.lang.Object ref = ""; + if (targetCase_ == 1) { + ref = target_; + } + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + if (targetCase_ == 1) { + target_ = 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 (targetCase_ == 1) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, target_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (targetCase_ == 1) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, target_); + } + 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.iam.v3beta.PolicyBinding.Target)) { + return super.equals(obj); + } + com.google.iam.v3beta.PolicyBinding.Target other = + (com.google.iam.v3beta.PolicyBinding.Target) obj; + + if (!getTargetCase().equals(other.getTargetCase())) return false; + switch (targetCase_) { + case 1: + if (!getPrincipalSet().equals(other.getPrincipalSet())) 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(); + switch (targetCase_) { + case 1: + hash = (37 * hash) + PRINCIPAL_SET_FIELD_NUMBER; + hash = (53 * hash) + getPrincipalSet().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.iam.v3beta.PolicyBinding.Target parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.iam.v3beta.PolicyBinding.Target parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.iam.v3beta.PolicyBinding.Target parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.iam.v3beta.PolicyBinding.Target 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.iam.v3beta.PolicyBinding.Target parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.iam.v3beta.PolicyBinding.Target parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.iam.v3beta.PolicyBinding.Target parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.iam.v3beta.PolicyBinding.Target parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.iam.v3beta.PolicyBinding.Target parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.iam.v3beta.PolicyBinding.Target parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.iam.v3beta.PolicyBinding.Target parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.iam.v3beta.PolicyBinding.Target parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.iam.v3beta.PolicyBinding.Target 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
        +     * Target is the full resource name of the resource to which the policy will
        +     * be bound. Immutable once set.
        +     * 
        + * + * Protobuf type {@code google.iam.v3beta.PolicyBinding.Target} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.iam.v3beta.PolicyBinding.Target) + com.google.iam.v3beta.PolicyBinding.TargetOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.iam.v3beta.PolicyBindingResourcesProto + .internal_static_google_iam_v3beta_PolicyBinding_Target_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.iam.v3beta.PolicyBindingResourcesProto + .internal_static_google_iam_v3beta_PolicyBinding_Target_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.iam.v3beta.PolicyBinding.Target.class, + com.google.iam.v3beta.PolicyBinding.Target.Builder.class); + } + + // Construct using com.google.iam.v3beta.PolicyBinding.Target.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + targetCase_ = 0; + target_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.iam.v3beta.PolicyBindingResourcesProto + .internal_static_google_iam_v3beta_PolicyBinding_Target_descriptor; + } + + @java.lang.Override + public com.google.iam.v3beta.PolicyBinding.Target getDefaultInstanceForType() { + return com.google.iam.v3beta.PolicyBinding.Target.getDefaultInstance(); + } + + @java.lang.Override + public com.google.iam.v3beta.PolicyBinding.Target build() { + com.google.iam.v3beta.PolicyBinding.Target result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.iam.v3beta.PolicyBinding.Target buildPartial() { + com.google.iam.v3beta.PolicyBinding.Target result = + new com.google.iam.v3beta.PolicyBinding.Target(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + buildPartialOneofs(result); + onBuilt(); + return result; + } + + private void buildPartial0(com.google.iam.v3beta.PolicyBinding.Target result) { + int from_bitField0_ = bitField0_; + } + + private void buildPartialOneofs(com.google.iam.v3beta.PolicyBinding.Target result) { + result.targetCase_ = targetCase_; + result.target_ = this.target_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.iam.v3beta.PolicyBinding.Target) { + return mergeFrom((com.google.iam.v3beta.PolicyBinding.Target) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.iam.v3beta.PolicyBinding.Target other) { + if (other == com.google.iam.v3beta.PolicyBinding.Target.getDefaultInstance()) return this; + switch (other.getTargetCase()) { + case PRINCIPAL_SET: + { + targetCase_ = 1; + target_ = other.target_; + onChanged(); + break; + } + case TARGET_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: + { + java.lang.String s = input.readStringRequireUtf8(); + targetCase_ = 1; + target_ = s; + 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 targetCase_ = 0; + private java.lang.Object target_; + + public TargetCase getTargetCase() { + return TargetCase.forNumber(targetCase_); + } + + public Builder clearTarget() { + targetCase_ = 0; + target_ = null; + onChanged(); + return this; + } + + private int bitField0_; + + /** + * + * + *
        +       * Immutable. Full Resource Name used for principal access boundary policy
        +       * bindings. The principal set must be directly parented by the policy
        +       * binding's parent or same as the parent if the target is a
        +       * project/folder/organization.
        +       *
        +       * Examples:
        +       * * For binding's parented by an organization:
        +       * * Organization:
        +       * `//cloudresourcemanager.googleapis.com/organizations/ORGANIZATION_ID`
        +       * * Workforce Identity:
        +       * `//iam.googleapis.com/locations/global/workforcePools/WORKFORCE_POOL_ID`
        +       * * Workspace Identity:
        +       * `//iam.googleapis.com/locations/global/workspace/WORKSPACE_ID`
        +       * * For binding's parented by a folder:
        +       * * Folder:
        +       * `//cloudresourcemanager.googleapis.com/folders/FOLDER_ID`
        +       * * For binding's parented by a project:
        +       * * Project:
        +       * * `//cloudresourcemanager.googleapis.com/projects/PROJECT_NUMBER`
        +       * * `//cloudresourcemanager.googleapis.com/projects/PROJECT_ID`
        +       * * Workload Identity Pool:
        +       * `//iam.googleapis.com/projects/PROJECT_NUMBER/locations/LOCATION/workloadIdentityPools/WORKLOAD_POOL_ID`
        +       * 
        + * + * string principal_set = 1 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @return Whether the principalSet field is set. + */ + @java.lang.Override + public boolean hasPrincipalSet() { + return targetCase_ == 1; + } + + /** + * + * + *
        +       * Immutable. Full Resource Name used for principal access boundary policy
        +       * bindings. The principal set must be directly parented by the policy
        +       * binding's parent or same as the parent if the target is a
        +       * project/folder/organization.
        +       *
        +       * Examples:
        +       * * For binding's parented by an organization:
        +       * * Organization:
        +       * `//cloudresourcemanager.googleapis.com/organizations/ORGANIZATION_ID`
        +       * * Workforce Identity:
        +       * `//iam.googleapis.com/locations/global/workforcePools/WORKFORCE_POOL_ID`
        +       * * Workspace Identity:
        +       * `//iam.googleapis.com/locations/global/workspace/WORKSPACE_ID`
        +       * * For binding's parented by a folder:
        +       * * Folder:
        +       * `//cloudresourcemanager.googleapis.com/folders/FOLDER_ID`
        +       * * For binding's parented by a project:
        +       * * Project:
        +       * * `//cloudresourcemanager.googleapis.com/projects/PROJECT_NUMBER`
        +       * * `//cloudresourcemanager.googleapis.com/projects/PROJECT_ID`
        +       * * Workload Identity Pool:
        +       * `//iam.googleapis.com/projects/PROJECT_NUMBER/locations/LOCATION/workloadIdentityPools/WORKLOAD_POOL_ID`
        +       * 
        + * + * string principal_set = 1 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @return The principalSet. + */ + @java.lang.Override + public java.lang.String getPrincipalSet() { + java.lang.Object ref = ""; + if (targetCase_ == 1) { + ref = target_; + } + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (targetCase_ == 1) { + target_ = s; + } + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
        +       * Immutable. Full Resource Name used for principal access boundary policy
        +       * bindings. The principal set must be directly parented by the policy
        +       * binding's parent or same as the parent if the target is a
        +       * project/folder/organization.
        +       *
        +       * Examples:
        +       * * For binding's parented by an organization:
        +       * * Organization:
        +       * `//cloudresourcemanager.googleapis.com/organizations/ORGANIZATION_ID`
        +       * * Workforce Identity:
        +       * `//iam.googleapis.com/locations/global/workforcePools/WORKFORCE_POOL_ID`
        +       * * Workspace Identity:
        +       * `//iam.googleapis.com/locations/global/workspace/WORKSPACE_ID`
        +       * * For binding's parented by a folder:
        +       * * Folder:
        +       * `//cloudresourcemanager.googleapis.com/folders/FOLDER_ID`
        +       * * For binding's parented by a project:
        +       * * Project:
        +       * * `//cloudresourcemanager.googleapis.com/projects/PROJECT_NUMBER`
        +       * * `//cloudresourcemanager.googleapis.com/projects/PROJECT_ID`
        +       * * Workload Identity Pool:
        +       * `//iam.googleapis.com/projects/PROJECT_NUMBER/locations/LOCATION/workloadIdentityPools/WORKLOAD_POOL_ID`
        +       * 
        + * + * string principal_set = 1 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @return The bytes for principalSet. + */ + @java.lang.Override + public com.google.protobuf.ByteString getPrincipalSetBytes() { + java.lang.Object ref = ""; + if (targetCase_ == 1) { + ref = target_; + } + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + if (targetCase_ == 1) { + target_ = b; + } + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
        +       * Immutable. Full Resource Name used for principal access boundary policy
        +       * bindings. The principal set must be directly parented by the policy
        +       * binding's parent or same as the parent if the target is a
        +       * project/folder/organization.
        +       *
        +       * Examples:
        +       * * For binding's parented by an organization:
        +       * * Organization:
        +       * `//cloudresourcemanager.googleapis.com/organizations/ORGANIZATION_ID`
        +       * * Workforce Identity:
        +       * `//iam.googleapis.com/locations/global/workforcePools/WORKFORCE_POOL_ID`
        +       * * Workspace Identity:
        +       * `//iam.googleapis.com/locations/global/workspace/WORKSPACE_ID`
        +       * * For binding's parented by a folder:
        +       * * Folder:
        +       * `//cloudresourcemanager.googleapis.com/folders/FOLDER_ID`
        +       * * For binding's parented by a project:
        +       * * Project:
        +       * * `//cloudresourcemanager.googleapis.com/projects/PROJECT_NUMBER`
        +       * * `//cloudresourcemanager.googleapis.com/projects/PROJECT_ID`
        +       * * Workload Identity Pool:
        +       * `//iam.googleapis.com/projects/PROJECT_NUMBER/locations/LOCATION/workloadIdentityPools/WORKLOAD_POOL_ID`
        +       * 
        + * + * string principal_set = 1 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @param value The principalSet to set. + * @return This builder for chaining. + */ + public Builder setPrincipalSet(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + targetCase_ = 1; + target_ = value; + onChanged(); + return this; + } + + /** + * + * + *
        +       * Immutable. Full Resource Name used for principal access boundary policy
        +       * bindings. The principal set must be directly parented by the policy
        +       * binding's parent or same as the parent if the target is a
        +       * project/folder/organization.
        +       *
        +       * Examples:
        +       * * For binding's parented by an organization:
        +       * * Organization:
        +       * `//cloudresourcemanager.googleapis.com/organizations/ORGANIZATION_ID`
        +       * * Workforce Identity:
        +       * `//iam.googleapis.com/locations/global/workforcePools/WORKFORCE_POOL_ID`
        +       * * Workspace Identity:
        +       * `//iam.googleapis.com/locations/global/workspace/WORKSPACE_ID`
        +       * * For binding's parented by a folder:
        +       * * Folder:
        +       * `//cloudresourcemanager.googleapis.com/folders/FOLDER_ID`
        +       * * For binding's parented by a project:
        +       * * Project:
        +       * * `//cloudresourcemanager.googleapis.com/projects/PROJECT_NUMBER`
        +       * * `//cloudresourcemanager.googleapis.com/projects/PROJECT_ID`
        +       * * Workload Identity Pool:
        +       * `//iam.googleapis.com/projects/PROJECT_NUMBER/locations/LOCATION/workloadIdentityPools/WORKLOAD_POOL_ID`
        +       * 
        + * + * string principal_set = 1 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @return This builder for chaining. + */ + public Builder clearPrincipalSet() { + if (targetCase_ == 1) { + targetCase_ = 0; + target_ = null; + onChanged(); + } + return this; + } + + /** + * + * + *
        +       * Immutable. Full Resource Name used for principal access boundary policy
        +       * bindings. The principal set must be directly parented by the policy
        +       * binding's parent or same as the parent if the target is a
        +       * project/folder/organization.
        +       *
        +       * Examples:
        +       * * For binding's parented by an organization:
        +       * * Organization:
        +       * `//cloudresourcemanager.googleapis.com/organizations/ORGANIZATION_ID`
        +       * * Workforce Identity:
        +       * `//iam.googleapis.com/locations/global/workforcePools/WORKFORCE_POOL_ID`
        +       * * Workspace Identity:
        +       * `//iam.googleapis.com/locations/global/workspace/WORKSPACE_ID`
        +       * * For binding's parented by a folder:
        +       * * Folder:
        +       * `//cloudresourcemanager.googleapis.com/folders/FOLDER_ID`
        +       * * For binding's parented by a project:
        +       * * Project:
        +       * * `//cloudresourcemanager.googleapis.com/projects/PROJECT_NUMBER`
        +       * * `//cloudresourcemanager.googleapis.com/projects/PROJECT_ID`
        +       * * Workload Identity Pool:
        +       * `//iam.googleapis.com/projects/PROJECT_NUMBER/locations/LOCATION/workloadIdentityPools/WORKLOAD_POOL_ID`
        +       * 
        + * + * string principal_set = 1 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @param value The bytes for principalSet to set. + * @return This builder for chaining. + */ + public Builder setPrincipalSetBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + targetCase_ = 1; + target_ = value; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.iam.v3beta.PolicyBinding.Target) + } + + // @@protoc_insertion_point(class_scope:google.iam.v3beta.PolicyBinding.Target) + private static final com.google.iam.v3beta.PolicyBinding.Target DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.iam.v3beta.PolicyBinding.Target(); + } + + public static com.google.iam.v3beta.PolicyBinding.Target getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Target 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.iam.v3beta.PolicyBinding.Target getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + private int bitField0_; + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + + /** + * + * + *
        +   * Identifier. The name of the policy binding, in the format
        +   * `{binding_parent/locations/{location}/policyBindings/{policy_binding_id}`.
        +   * The binding parent is the closest Resource Manager resource (project,
        +   * folder, or organization) to the binding target.
        +   *
        +   * Format:
        +   *
        +   * * `projects/{project_id}/locations/{location}/policyBindings/{policy_binding_id}`
        +   * * `projects/{project_number}/locations/{location}/policyBindings/{policy_binding_id}`
        +   * * `folders/{folder_id}/locations/{location}/policyBindings/{policy_binding_id}`
        +   * * `organizations/{organization_id}/locations/{location}/policyBindings/{policy_binding_id}`
        +   * 
        + * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @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; + } + } + + /** + * + * + *
        +   * Identifier. The name of the policy binding, in the format
        +   * `{binding_parent/locations/{location}/policyBindings/{policy_binding_id}`.
        +   * The binding parent is the closest Resource Manager resource (project,
        +   * folder, or organization) to the binding target.
        +   *
        +   * Format:
        +   *
        +   * * `projects/{project_id}/locations/{location}/policyBindings/{policy_binding_id}`
        +   * * `projects/{project_number}/locations/{location}/policyBindings/{policy_binding_id}`
        +   * * `folders/{folder_id}/locations/{location}/policyBindings/{policy_binding_id}`
        +   * * `organizations/{organization_id}/locations/{location}/policyBindings/{policy_binding_id}`
        +   * 
        + * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @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 UID_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object uid_ = ""; + + /** + * + * + *
        +   * Output only. The globally unique ID of the policy binding. Assigned when
        +   * the policy binding is created.
        +   * 
        + * + * + * string uid = 2 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_info) = { ... } + * + * + * @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; + } + } + + /** + * + * + *
        +   * Output only. The globally unique ID of the policy binding. Assigned when
        +   * the policy binding is created.
        +   * 
        + * + * + * string uid = 2 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_info) = { ... } + * + * + * @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 ETAG_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object etag_ = ""; + + /** + * + * + *
        +   * Optional. The etag for the policy binding.
        +   * If this is provided on update, it must match the server's etag.
        +   * 
        + * + * string etag = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The etag. + */ + @java.lang.Override + public java.lang.String getEtag() { + java.lang.Object ref = etag_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + etag_ = s; + return s; + } + } + + /** + * + * + *
        +   * Optional. The etag for the policy binding.
        +   * If this is provided on update, it must match the server's etag.
        +   * 
        + * + * string etag = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for etag. + */ + @java.lang.Override + public com.google.protobuf.ByteString getEtagBytes() { + java.lang.Object ref = etag_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + etag_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int DISPLAY_NAME_FIELD_NUMBER = 4; + + @SuppressWarnings("serial") + private volatile java.lang.Object displayName_ = ""; + + /** + * + * + *
        +   * Optional. The description of the policy binding. Must be less than or equal
        +   * to 63 characters.
        +   * 
        + * + * string display_name = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The displayName. + */ + @java.lang.Override + public java.lang.String getDisplayName() { + java.lang.Object ref = displayName_; + 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(); + displayName_ = s; + return s; + } + } + + /** + * + * + *
        +   * Optional. The description of the policy binding. Must be less than or equal
        +   * to 63 characters.
        +   * 
        + * + * string display_name = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for displayName. + */ + @java.lang.Override + public com.google.protobuf.ByteString getDisplayNameBytes() { + java.lang.Object ref = displayName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + displayName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int ANNOTATIONS_FIELD_NUMBER = 5; + + private static final class AnnotationsDefaultEntryHolder { + static final com.google.protobuf.MapEntry defaultEntry = + com.google.protobuf.MapEntry.newDefaultInstance( + com.google.iam.v3beta.PolicyBindingResourcesProto + .internal_static_google_iam_v3beta_PolicyBinding_AnnotationsEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.STRING, + ""); + } + + @SuppressWarnings("serial") + private com.google.protobuf.MapField annotations_; + + private com.google.protobuf.MapField + internalGetAnnotations() { + if (annotations_ == null) { + return com.google.protobuf.MapField.emptyMapField(AnnotationsDefaultEntryHolder.defaultEntry); + } + return annotations_; + } + + public int getAnnotationsCount() { + return internalGetAnnotations().getMap().size(); + } + + /** + * + * + *
        +   * Optional. User-defined annotations. See
        +   * https://google.aip.dev/148#annotations for more details such as format and
        +   * size limitations
        +   * 
        + * + * map<string, string> annotations = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public boolean containsAnnotations(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + return internalGetAnnotations().getMap().containsKey(key); + } + + /** Use {@link #getAnnotationsMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getAnnotations() { + return getAnnotationsMap(); + } + + /** + * + * + *
        +   * Optional. User-defined annotations. See
        +   * https://google.aip.dev/148#annotations for more details such as format and
        +   * size limitations
        +   * 
        + * + * map<string, string> annotations = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public java.util.Map getAnnotationsMap() { + return internalGetAnnotations().getMap(); + } + + /** + * + * + *
        +   * Optional. User-defined annotations. See
        +   * https://google.aip.dev/148#annotations for more details such as format and
        +   * size limitations
        +   * 
        + * + * map<string, string> annotations = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public /* nullable */ java.lang.String getAnnotationsOrDefault( + java.lang.String key, + /* nullable */ + java.lang.String defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetAnnotations().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + + /** + * + * + *
        +   * Optional. User-defined annotations. See
        +   * https://google.aip.dev/148#annotations for more details such as format and
        +   * size limitations
        +   * 
        + * + * map<string, string> annotations = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public java.lang.String getAnnotationsOrThrow(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetAnnotations().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public static final int TARGET_FIELD_NUMBER = 6; + private com.google.iam.v3beta.PolicyBinding.Target target_; + + /** + * + * + *
        +   * Required. Immutable. Target is the full resource name of the resource to
        +   * which the policy will be bound. Immutable once set.
        +   * 
        + * + * + * .google.iam.v3beta.PolicyBinding.Target target = 6 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the target field is set. + */ + @java.lang.Override + public boolean hasTarget() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
        +   * Required. Immutable. Target is the full resource name of the resource to
        +   * which the policy will be bound. Immutable once set.
        +   * 
        + * + * + * .google.iam.v3beta.PolicyBinding.Target target = 6 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = REQUIRED]; + * + * + * @return The target. + */ + @java.lang.Override + public com.google.iam.v3beta.PolicyBinding.Target getTarget() { + return target_ == null + ? com.google.iam.v3beta.PolicyBinding.Target.getDefaultInstance() + : target_; + } + + /** + * + * + *
        +   * Required. Immutable. Target is the full resource name of the resource to
        +   * which the policy will be bound. Immutable once set.
        +   * 
        + * + * + * .google.iam.v3beta.PolicyBinding.Target target = 6 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.iam.v3beta.PolicyBinding.TargetOrBuilder getTargetOrBuilder() { + return target_ == null + ? com.google.iam.v3beta.PolicyBinding.Target.getDefaultInstance() + : target_; + } + + public static final int POLICY_KIND_FIELD_NUMBER = 11; + private int policyKind_ = 0; + + /** + * + * + *
        +   * Immutable. The kind of the policy to attach in this binding. This field
        +   * must be one of the following:
        +   *
        +   * - Left empty (will be automatically set to the policy kind)
        +   * - The input policy kind
        +   * 
        + * + * + * .google.iam.v3beta.PolicyBinding.PolicyKind policy_kind = 11 [(.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return The enum numeric value on the wire for policyKind. + */ + @java.lang.Override + public int getPolicyKindValue() { + return policyKind_; + } + + /** + * + * + *
        +   * Immutable. The kind of the policy to attach in this binding. This field
        +   * must be one of the following:
        +   *
        +   * - Left empty (will be automatically set to the policy kind)
        +   * - The input policy kind
        +   * 
        + * + * + * .google.iam.v3beta.PolicyBinding.PolicyKind policy_kind = 11 [(.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return The policyKind. + */ + @java.lang.Override + public com.google.iam.v3beta.PolicyBinding.PolicyKind getPolicyKind() { + com.google.iam.v3beta.PolicyBinding.PolicyKind result = + com.google.iam.v3beta.PolicyBinding.PolicyKind.forNumber(policyKind_); + return result == null ? com.google.iam.v3beta.PolicyBinding.PolicyKind.UNRECOGNIZED : result; + } + + public static final int POLICY_FIELD_NUMBER = 7; + + @SuppressWarnings("serial") + private volatile java.lang.Object policy_ = ""; + + /** + * + * + *
        +   * Required. Immutable. The resource name of the policy to be bound. The
        +   * binding parent and policy must belong to the same organization.
        +   * 
        + * + * + * string policy = 7 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = REQUIRED]; + * + * + * @return The policy. + */ + @java.lang.Override + public java.lang.String getPolicy() { + java.lang.Object ref = policy_; + 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(); + policy_ = s; + return s; + } + } + + /** + * + * + *
        +   * Required. Immutable. The resource name of the policy to be bound. The
        +   * binding parent and policy must belong to the same organization.
        +   * 
        + * + * + * string policy = 7 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = REQUIRED]; + * + * + * @return The bytes for policy. + */ + @java.lang.Override + public com.google.protobuf.ByteString getPolicyBytes() { + java.lang.Object ref = policy_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + policy_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int POLICY_UID_FIELD_NUMBER = 12; + + @SuppressWarnings("serial") + private volatile java.lang.Object policyUid_ = ""; + + /** + * + * + *
        +   * Output only. The globally unique ID of the policy to be bound.
        +   * 
        + * + * string policy_uid = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The policyUid. + */ + @java.lang.Override + public java.lang.String getPolicyUid() { + java.lang.Object ref = policyUid_; + 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(); + policyUid_ = s; + return s; + } + } + + /** + * + * + *
        +   * Output only. The globally unique ID of the policy to be bound.
        +   * 
        + * + * string policy_uid = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for policyUid. + */ + @java.lang.Override + public com.google.protobuf.ByteString getPolicyUidBytes() { + java.lang.Object ref = policyUid_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + policyUid_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int CONDITION_FIELD_NUMBER = 8; + private com.google.type.Expr condition_; + + /** + * + * + *
        +   * Optional. The condition to apply to the policy binding. When set, the
        +   * `expression` field in the `Expr` must include from 1 to 10 subexpressions,
        +   * joined by the
        +   * "||"(Logical OR), "&&"(Logical AND) or "!"(Logical NOT) operators and
        +   * cannot contain more than 250 characters.
        +   *
        +   * The condition is currently only supported when bound to policies of kind
        +   * principal access boundary.
        +   *
        +   * When the bound policy is a principal access boundary policy, the only
        +   * supported attributes in any subexpression are `principal.type` and
        +   * `principal.subject`. An example expression is: "principal.type ==
        +   * 'iam.googleapis.com/ServiceAccount'" or "principal.subject ==
        +   * 'bob@example.com'".
        +   *
        +   * Allowed operations for `principal.subject`:
        +   *
        +   * - `principal.subject == <principal subject string>`
        +   * - `principal.subject != <principal subject string>`
        +   * - `principal.subject in [<list of principal subjects>]`
        +   * - `principal.subject.startsWith(<string>)`
        +   * - `principal.subject.endsWith(<string>)`
        +   *
        +   * Allowed operations for `principal.type`:
        +   *
        +   * - `principal.type == <principal type string>`
        +   * - `principal.type != <principal type string>`
        +   * - `principal.type in [<list of principal types>]`
        +   *
        +   * Supported principal types are Workspace, Workforce Pool, Workload Pool and
        +   * Service Account. Allowed string must be one of:
        +   *
        +   * - iam.googleapis.com/WorkspaceIdentity
        +   * - iam.googleapis.com/WorkforcePoolIdentity
        +   * - iam.googleapis.com/WorkloadPoolIdentity
        +   * - iam.googleapis.com/ServiceAccount
        +   * 
        + * + * .google.type.Expr condition = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return Whether the condition field is set. + */ + @java.lang.Override + public boolean hasCondition() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
        +   * Optional. The condition to apply to the policy binding. When set, the
        +   * `expression` field in the `Expr` must include from 1 to 10 subexpressions,
        +   * joined by the
        +   * "||"(Logical OR), "&&"(Logical AND) or "!"(Logical NOT) operators and
        +   * cannot contain more than 250 characters.
        +   *
        +   * The condition is currently only supported when bound to policies of kind
        +   * principal access boundary.
        +   *
        +   * When the bound policy is a principal access boundary policy, the only
        +   * supported attributes in any subexpression are `principal.type` and
        +   * `principal.subject`. An example expression is: "principal.type ==
        +   * 'iam.googleapis.com/ServiceAccount'" or "principal.subject ==
        +   * 'bob@example.com'".
        +   *
        +   * Allowed operations for `principal.subject`:
        +   *
        +   * - `principal.subject == <principal subject string>`
        +   * - `principal.subject != <principal subject string>`
        +   * - `principal.subject in [<list of principal subjects>]`
        +   * - `principal.subject.startsWith(<string>)`
        +   * - `principal.subject.endsWith(<string>)`
        +   *
        +   * Allowed operations for `principal.type`:
        +   *
        +   * - `principal.type == <principal type string>`
        +   * - `principal.type != <principal type string>`
        +   * - `principal.type in [<list of principal types>]`
        +   *
        +   * Supported principal types are Workspace, Workforce Pool, Workload Pool and
        +   * Service Account. Allowed string must be one of:
        +   *
        +   * - iam.googleapis.com/WorkspaceIdentity
        +   * - iam.googleapis.com/WorkforcePoolIdentity
        +   * - iam.googleapis.com/WorkloadPoolIdentity
        +   * - iam.googleapis.com/ServiceAccount
        +   * 
        + * + * .google.type.Expr condition = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The condition. + */ + @java.lang.Override + public com.google.type.Expr getCondition() { + return condition_ == null ? com.google.type.Expr.getDefaultInstance() : condition_; + } + + /** + * + * + *
        +   * Optional. The condition to apply to the policy binding. When set, the
        +   * `expression` field in the `Expr` must include from 1 to 10 subexpressions,
        +   * joined by the
        +   * "||"(Logical OR), "&&"(Logical AND) or "!"(Logical NOT) operators and
        +   * cannot contain more than 250 characters.
        +   *
        +   * The condition is currently only supported when bound to policies of kind
        +   * principal access boundary.
        +   *
        +   * When the bound policy is a principal access boundary policy, the only
        +   * supported attributes in any subexpression are `principal.type` and
        +   * `principal.subject`. An example expression is: "principal.type ==
        +   * 'iam.googleapis.com/ServiceAccount'" or "principal.subject ==
        +   * 'bob@example.com'".
        +   *
        +   * Allowed operations for `principal.subject`:
        +   *
        +   * - `principal.subject == <principal subject string>`
        +   * - `principal.subject != <principal subject string>`
        +   * - `principal.subject in [<list of principal subjects>]`
        +   * - `principal.subject.startsWith(<string>)`
        +   * - `principal.subject.endsWith(<string>)`
        +   *
        +   * Allowed operations for `principal.type`:
        +   *
        +   * - `principal.type == <principal type string>`
        +   * - `principal.type != <principal type string>`
        +   * - `principal.type in [<list of principal types>]`
        +   *
        +   * Supported principal types are Workspace, Workforce Pool, Workload Pool and
        +   * Service Account. Allowed string must be one of:
        +   *
        +   * - iam.googleapis.com/WorkspaceIdentity
        +   * - iam.googleapis.com/WorkforcePoolIdentity
        +   * - iam.googleapis.com/WorkloadPoolIdentity
        +   * - iam.googleapis.com/ServiceAccount
        +   * 
        + * + * .google.type.Expr condition = 8 [(.google.api.field_behavior) = OPTIONAL]; + */ + @java.lang.Override + public com.google.type.ExprOrBuilder getConditionOrBuilder() { + return condition_ == null ? com.google.type.Expr.getDefaultInstance() : condition_; + } + + public static final int CREATE_TIME_FIELD_NUMBER = 9; + private com.google.protobuf.Timestamp createTime_; + + /** + * + * + *
        +   * Output only. The time when the policy binding was created.
        +   * 
        + * + * .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 time when the policy binding was created.
        +   * 
        + * + * .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 time when the policy binding was created.
        +   * 
        + * + * .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 time when the policy binding was most recently updated.
        +   * 
        + * + * .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 time when the policy binding was most recently updated.
        +   * 
        + * + * .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 time when the policy binding was most recently updated.
        +   * 
        + * + * .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_; + } + + 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.GeneratedMessage.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, name_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(uid_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, uid_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(etag_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 3, etag_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(displayName_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 4, displayName_); + } + com.google.protobuf.GeneratedMessage.serializeStringMapTo( + output, internalGetAnnotations(), AnnotationsDefaultEntryHolder.defaultEntry, 5); + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(6, getTarget()); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(policy_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 7, policy_); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeMessage(8, getCondition()); + } + if (((bitField0_ & 0x00000004) != 0)) { + output.writeMessage(9, getCreateTime()); + } + if (((bitField0_ & 0x00000008) != 0)) { + output.writeMessage(10, getUpdateTime()); + } + if (policyKind_ + != com.google.iam.v3beta.PolicyBinding.PolicyKind.POLICY_KIND_UNSPECIFIED.getNumber()) { + output.writeEnum(11, policyKind_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(policyUid_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 12, policyUid_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, name_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(uid_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, uid_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(etag_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(3, etag_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(displayName_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(4, displayName_); + } + for (java.util.Map.Entry entry : + internalGetAnnotations().getMap().entrySet()) { + com.google.protobuf.MapEntry annotations__ = + AnnotationsDefaultEntryHolder.defaultEntry + .newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream.computeMessageSize(5, annotations__); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(6, getTarget()); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(policy_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(7, policy_); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(8, getCondition()); + } + 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 (policyKind_ + != com.google.iam.v3beta.PolicyBinding.PolicyKind.POLICY_KIND_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(11, policyKind_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(policyUid_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(12, policyUid_); + } + 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.iam.v3beta.PolicyBinding)) { + return super.equals(obj); + } + com.google.iam.v3beta.PolicyBinding other = (com.google.iam.v3beta.PolicyBinding) obj; + + if (!getName().equals(other.getName())) return false; + if (!getUid().equals(other.getUid())) return false; + if (!getEtag().equals(other.getEtag())) return false; + if (!getDisplayName().equals(other.getDisplayName())) return false; + if (!internalGetAnnotations().equals(other.internalGetAnnotations())) return false; + if (hasTarget() != other.hasTarget()) return false; + if (hasTarget()) { + if (!getTarget().equals(other.getTarget())) return false; + } + if (policyKind_ != other.policyKind_) return false; + if (!getPolicy().equals(other.getPolicy())) return false; + if (!getPolicyUid().equals(other.getPolicyUid())) return false; + if (hasCondition() != other.hasCondition()) return false; + if (hasCondition()) { + if (!getCondition().equals(other.getCondition())) 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) + UID_FIELD_NUMBER; + hash = (53 * hash) + getUid().hashCode(); + hash = (37 * hash) + ETAG_FIELD_NUMBER; + hash = (53 * hash) + getEtag().hashCode(); + hash = (37 * hash) + DISPLAY_NAME_FIELD_NUMBER; + hash = (53 * hash) + getDisplayName().hashCode(); + if (!internalGetAnnotations().getMap().isEmpty()) { + hash = (37 * hash) + ANNOTATIONS_FIELD_NUMBER; + hash = (53 * hash) + internalGetAnnotations().hashCode(); + } + if (hasTarget()) { + hash = (37 * hash) + TARGET_FIELD_NUMBER; + hash = (53 * hash) + getTarget().hashCode(); + } + hash = (37 * hash) + POLICY_KIND_FIELD_NUMBER; + hash = (53 * hash) + policyKind_; + hash = (37 * hash) + POLICY_FIELD_NUMBER; + hash = (53 * hash) + getPolicy().hashCode(); + hash = (37 * hash) + POLICY_UID_FIELD_NUMBER; + hash = (53 * hash) + getPolicyUid().hashCode(); + if (hasCondition()) { + hash = (37 * hash) + CONDITION_FIELD_NUMBER; + hash = (53 * hash) + getCondition().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 = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.iam.v3beta.PolicyBinding parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.iam.v3beta.PolicyBinding parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.iam.v3beta.PolicyBinding parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.iam.v3beta.PolicyBinding 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.iam.v3beta.PolicyBinding parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.iam.v3beta.PolicyBinding parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.iam.v3beta.PolicyBinding parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.iam.v3beta.PolicyBinding parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.iam.v3beta.PolicyBinding parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.iam.v3beta.PolicyBinding parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.iam.v3beta.PolicyBinding parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.iam.v3beta.PolicyBinding parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.iam.v3beta.PolicyBinding 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
        +   * IAM policy binding resource.
        +   * 
        + * + * Protobuf type {@code google.iam.v3beta.PolicyBinding} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.iam.v3beta.PolicyBinding) + com.google.iam.v3beta.PolicyBindingOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.iam.v3beta.PolicyBindingResourcesProto + .internal_static_google_iam_v3beta_PolicyBinding_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapFieldReflectionAccessor internalGetMapFieldReflection( + int number) { + switch (number) { + case 5: + return internalGetAnnotations(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapFieldReflectionAccessor internalGetMutableMapFieldReflection( + int number) { + switch (number) { + case 5: + return internalGetMutableAnnotations(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.iam.v3beta.PolicyBindingResourcesProto + .internal_static_google_iam_v3beta_PolicyBinding_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.iam.v3beta.PolicyBinding.class, + com.google.iam.v3beta.PolicyBinding.Builder.class); + } + + // Construct using com.google.iam.v3beta.PolicyBinding.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetTargetFieldBuilder(); + internalGetConditionFieldBuilder(); + internalGetCreateTimeFieldBuilder(); + internalGetUpdateTimeFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + uid_ = ""; + etag_ = ""; + displayName_ = ""; + internalGetMutableAnnotations().clear(); + target_ = null; + if (targetBuilder_ != null) { + targetBuilder_.dispose(); + targetBuilder_ = null; + } + policyKind_ = 0; + policy_ = ""; + policyUid_ = ""; + condition_ = null; + if (conditionBuilder_ != null) { + conditionBuilder_.dispose(); + conditionBuilder_ = null; + } + 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.iam.v3beta.PolicyBindingResourcesProto + .internal_static_google_iam_v3beta_PolicyBinding_descriptor; + } + + @java.lang.Override + public com.google.iam.v3beta.PolicyBinding getDefaultInstanceForType() { + return com.google.iam.v3beta.PolicyBinding.getDefaultInstance(); + } + + @java.lang.Override + public com.google.iam.v3beta.PolicyBinding build() { + com.google.iam.v3beta.PolicyBinding result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.iam.v3beta.PolicyBinding buildPartial() { + com.google.iam.v3beta.PolicyBinding result = new com.google.iam.v3beta.PolicyBinding(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.iam.v3beta.PolicyBinding result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.uid_ = uid_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.etag_ = etag_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.displayName_ = displayName_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.annotations_ = internalGetAnnotations(); + result.annotations_.makeImmutable(); + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000020) != 0)) { + result.target_ = targetBuilder_ == null ? target_ : targetBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000040) != 0)) { + result.policyKind_ = policyKind_; + } + if (((from_bitField0_ & 0x00000080) != 0)) { + result.policy_ = policy_; + } + if (((from_bitField0_ & 0x00000100) != 0)) { + result.policyUid_ = policyUid_; + } + if (((from_bitField0_ & 0x00000200) != 0)) { + result.condition_ = conditionBuilder_ == null ? condition_ : conditionBuilder_.build(); + to_bitField0_ |= 0x00000002; + } + if (((from_bitField0_ & 0x00000400) != 0)) { + result.createTime_ = createTimeBuilder_ == null ? createTime_ : createTimeBuilder_.build(); + to_bitField0_ |= 0x00000004; + } + if (((from_bitField0_ & 0x00000800) != 0)) { + result.updateTime_ = updateTimeBuilder_ == null ? updateTime_ : updateTimeBuilder_.build(); + to_bitField0_ |= 0x00000008; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.iam.v3beta.PolicyBinding) { + return mergeFrom((com.google.iam.v3beta.PolicyBinding) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.iam.v3beta.PolicyBinding other) { + if (other == com.google.iam.v3beta.PolicyBinding.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getUid().isEmpty()) { + uid_ = other.uid_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (!other.getEtag().isEmpty()) { + etag_ = other.etag_; + bitField0_ |= 0x00000004; + onChanged(); + } + if (!other.getDisplayName().isEmpty()) { + displayName_ = other.displayName_; + bitField0_ |= 0x00000008; + onChanged(); + } + internalGetMutableAnnotations().mergeFrom(other.internalGetAnnotations()); + bitField0_ |= 0x00000010; + if (other.hasTarget()) { + mergeTarget(other.getTarget()); + } + if (other.policyKind_ != 0) { + setPolicyKindValue(other.getPolicyKindValue()); + } + if (!other.getPolicy().isEmpty()) { + policy_ = other.policy_; + bitField0_ |= 0x00000080; + onChanged(); + } + if (!other.getPolicyUid().isEmpty()) { + policyUid_ = other.policyUid_; + bitField0_ |= 0x00000100; + onChanged(); + } + if (other.hasCondition()) { + mergeCondition(other.getCondition()); + } + 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: + { + uid_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + etag_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 34: + { + displayName_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000008; + break; + } // case 34 + case 42: + { + com.google.protobuf.MapEntry annotations__ = + input.readMessage( + AnnotationsDefaultEntryHolder.defaultEntry.getParserForType(), + extensionRegistry); + internalGetMutableAnnotations() + .getMutableMap() + .put(annotations__.getKey(), annotations__.getValue()); + bitField0_ |= 0x00000010; + break; + } // case 42 + case 50: + { + input.readMessage(internalGetTargetFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000020; + break; + } // case 50 + case 58: + { + policy_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000080; + break; + } // case 58 + case 66: + { + input.readMessage( + internalGetConditionFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000200; + break; + } // case 66 + case 74: + { + input.readMessage( + internalGetCreateTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000400; + break; + } // case 74 + case 82: + { + input.readMessage( + internalGetUpdateTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000800; + break; + } // case 82 + case 88: + { + policyKind_ = input.readEnum(); + bitField0_ |= 0x00000040; + break; + } // case 88 + case 98: + { + policyUid_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000100; + break; + } // case 98 + 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_ = ""; + + /** + * + * + *
        +     * Identifier. The name of the policy binding, in the format
        +     * `{binding_parent/locations/{location}/policyBindings/{policy_binding_id}`.
        +     * The binding parent is the closest Resource Manager resource (project,
        +     * folder, or organization) to the binding target.
        +     *
        +     * Format:
        +     *
        +     * * `projects/{project_id}/locations/{location}/policyBindings/{policy_binding_id}`
        +     * * `projects/{project_number}/locations/{location}/policyBindings/{policy_binding_id}`
        +     * * `folders/{folder_id}/locations/{location}/policyBindings/{policy_binding_id}`
        +     * * `organizations/{organization_id}/locations/{location}/policyBindings/{policy_binding_id}`
        +     * 
        + * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @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; + } + } + + /** + * + * + *
        +     * Identifier. The name of the policy binding, in the format
        +     * `{binding_parent/locations/{location}/policyBindings/{policy_binding_id}`.
        +     * The binding parent is the closest Resource Manager resource (project,
        +     * folder, or organization) to the binding target.
        +     *
        +     * Format:
        +     *
        +     * * `projects/{project_id}/locations/{location}/policyBindings/{policy_binding_id}`
        +     * * `projects/{project_number}/locations/{location}/policyBindings/{policy_binding_id}`
        +     * * `folders/{folder_id}/locations/{location}/policyBindings/{policy_binding_id}`
        +     * * `organizations/{organization_id}/locations/{location}/policyBindings/{policy_binding_id}`
        +     * 
        + * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @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; + } + } + + /** + * + * + *
        +     * Identifier. The name of the policy binding, in the format
        +     * `{binding_parent/locations/{location}/policyBindings/{policy_binding_id}`.
        +     * The binding parent is the closest Resource Manager resource (project,
        +     * folder, or organization) to the binding target.
        +     *
        +     * Format:
        +     *
        +     * * `projects/{project_id}/locations/{location}/policyBindings/{policy_binding_id}`
        +     * * `projects/{project_number}/locations/{location}/policyBindings/{policy_binding_id}`
        +     * * `folders/{folder_id}/locations/{location}/policyBindings/{policy_binding_id}`
        +     * * `organizations/{organization_id}/locations/{location}/policyBindings/{policy_binding_id}`
        +     * 
        + * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @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; + } + + /** + * + * + *
        +     * Identifier. The name of the policy binding, in the format
        +     * `{binding_parent/locations/{location}/policyBindings/{policy_binding_id}`.
        +     * The binding parent is the closest Resource Manager resource (project,
        +     * folder, or organization) to the binding target.
        +     *
        +     * Format:
        +     *
        +     * * `projects/{project_id}/locations/{location}/policyBindings/{policy_binding_id}`
        +     * * `projects/{project_number}/locations/{location}/policyBindings/{policy_binding_id}`
        +     * * `folders/{folder_id}/locations/{location}/policyBindings/{policy_binding_id}`
        +     * * `organizations/{organization_id}/locations/{location}/policyBindings/{policy_binding_id}`
        +     * 
        + * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
        +     * Identifier. The name of the policy binding, in the format
        +     * `{binding_parent/locations/{location}/policyBindings/{policy_binding_id}`.
        +     * The binding parent is the closest Resource Manager resource (project,
        +     * folder, or organization) to the binding target.
        +     *
        +     * Format:
        +     *
        +     * * `projects/{project_id}/locations/{location}/policyBindings/{policy_binding_id}`
        +     * * `projects/{project_number}/locations/{location}/policyBindings/{policy_binding_id}`
        +     * * `folders/{folder_id}/locations/{location}/policyBindings/{policy_binding_id}`
        +     * * `organizations/{organization_id}/locations/{location}/policyBindings/{policy_binding_id}`
        +     * 
        + * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @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 uid_ = ""; + + /** + * + * + *
        +     * Output only. The globally unique ID of the policy binding. Assigned when
        +     * the policy binding is created.
        +     * 
        + * + * + * string uid = 2 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_info) = { ... } + * + * + * @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; + } + } + + /** + * + * + *
        +     * Output only. The globally unique ID of the policy binding. Assigned when
        +     * the policy binding is created.
        +     * 
        + * + * + * string uid = 2 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_info) = { ... } + * + * + * @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; + } + } + + /** + * + * + *
        +     * Output only. The globally unique ID of the policy binding. Assigned when
        +     * the policy binding is created.
        +     * 
        + * + * + * string uid = 2 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_info) = { ... } + * + * + * @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_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
        +     * Output only. The globally unique ID of the policy binding. Assigned when
        +     * the policy binding is created.
        +     * 
        + * + * + * string uid = 2 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_info) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearUid() { + uid_ = getDefaultInstance().getUid(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
        +     * Output only. The globally unique ID of the policy binding. Assigned when
        +     * the policy binding is created.
        +     * 
        + * + * + * string uid = 2 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_info) = { ... } + * + * + * @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_ |= 0x00000002; + onChanged(); + return this; + } + + private java.lang.Object etag_ = ""; + + /** + * + * + *
        +     * Optional. The etag for the policy binding.
        +     * If this is provided on update, it must match the server's etag.
        +     * 
        + * + * string etag = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The etag. + */ + public java.lang.String getEtag() { + java.lang.Object ref = etag_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + etag_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
        +     * Optional. The etag for the policy binding.
        +     * If this is provided on update, it must match the server's etag.
        +     * 
        + * + * string etag = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for etag. + */ + public com.google.protobuf.ByteString getEtagBytes() { + java.lang.Object ref = etag_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + etag_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
        +     * Optional. The etag for the policy binding.
        +     * If this is provided on update, it must match the server's etag.
        +     * 
        + * + * string etag = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The etag to set. + * @return This builder for chaining. + */ + public Builder setEtag(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + etag_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
        +     * Optional. The etag for the policy binding.
        +     * If this is provided on update, it must match the server's etag.
        +     * 
        + * + * string etag = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearEtag() { + etag_ = getDefaultInstance().getEtag(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + + /** + * + * + *
        +     * Optional. The etag for the policy binding.
        +     * If this is provided on update, it must match the server's etag.
        +     * 
        + * + * string etag = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for etag to set. + * @return This builder for chaining. + */ + public Builder setEtagBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + etag_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + private java.lang.Object displayName_ = ""; + + /** + * + * + *
        +     * Optional. The description of the policy binding. Must be less than or equal
        +     * to 63 characters.
        +     * 
        + * + * string display_name = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The displayName. + */ + public java.lang.String getDisplayName() { + java.lang.Object ref = displayName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + displayName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
        +     * Optional. The description of the policy binding. Must be less than or equal
        +     * to 63 characters.
        +     * 
        + * + * string display_name = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for displayName. + */ + public com.google.protobuf.ByteString getDisplayNameBytes() { + java.lang.Object ref = displayName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + displayName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
        +     * Optional. The description of the policy binding. Must be less than or equal
        +     * to 63 characters.
        +     * 
        + * + * string display_name = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The displayName to set. + * @return This builder for chaining. + */ + public Builder setDisplayName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + displayName_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + /** + * + * + *
        +     * Optional. The description of the policy binding. Must be less than or equal
        +     * to 63 characters.
        +     * 
        + * + * string display_name = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearDisplayName() { + displayName_ = getDefaultInstance().getDisplayName(); + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + return this; + } + + /** + * + * + *
        +     * Optional. The description of the policy binding. Must be less than or equal
        +     * to 63 characters.
        +     * 
        + * + * string display_name = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for displayName to set. + * @return This builder for chaining. + */ + public Builder setDisplayNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + displayName_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + private com.google.protobuf.MapField annotations_; + + private com.google.protobuf.MapField + internalGetAnnotations() { + if (annotations_ == null) { + return com.google.protobuf.MapField.emptyMapField( + AnnotationsDefaultEntryHolder.defaultEntry); + } + return annotations_; + } + + private com.google.protobuf.MapField + internalGetMutableAnnotations() { + if (annotations_ == null) { + annotations_ = + com.google.protobuf.MapField.newMapField(AnnotationsDefaultEntryHolder.defaultEntry); + } + if (!annotations_.isMutable()) { + annotations_ = annotations_.copy(); + } + bitField0_ |= 0x00000010; + onChanged(); + return annotations_; + } + + public int getAnnotationsCount() { + return internalGetAnnotations().getMap().size(); + } + + /** + * + * + *
        +     * Optional. User-defined annotations. See
        +     * https://google.aip.dev/148#annotations for more details such as format and
        +     * size limitations
        +     * 
        + * + * map<string, string> annotations = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public boolean containsAnnotations(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + return internalGetAnnotations().getMap().containsKey(key); + } + + /** Use {@link #getAnnotationsMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getAnnotations() { + return getAnnotationsMap(); + } + + /** + * + * + *
        +     * Optional. User-defined annotations. See
        +     * https://google.aip.dev/148#annotations for more details such as format and
        +     * size limitations
        +     * 
        + * + * map<string, string> annotations = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public java.util.Map getAnnotationsMap() { + return internalGetAnnotations().getMap(); + } + + /** + * + * + *
        +     * Optional. User-defined annotations. See
        +     * https://google.aip.dev/148#annotations for more details such as format and
        +     * size limitations
        +     * 
        + * + * map<string, string> annotations = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public /* nullable */ java.lang.String getAnnotationsOrDefault( + java.lang.String key, + /* nullable */ + java.lang.String defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetAnnotations().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + + /** + * + * + *
        +     * Optional. User-defined annotations. See
        +     * https://google.aip.dev/148#annotations for more details such as format and
        +     * size limitations
        +     * 
        + * + * map<string, string> annotations = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public java.lang.String getAnnotationsOrThrow(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetAnnotations().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public Builder clearAnnotations() { + bitField0_ = (bitField0_ & ~0x00000010); + internalGetMutableAnnotations().getMutableMap().clear(); + return this; + } + + /** + * + * + *
        +     * Optional. User-defined annotations. See
        +     * https://google.aip.dev/148#annotations for more details such as format and
        +     * size limitations
        +     * 
        + * + * map<string, string> annotations = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder removeAnnotations(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + internalGetMutableAnnotations().getMutableMap().remove(key); + return this; + } + + /** Use alternate mutation accessors instead. */ + @java.lang.Deprecated + public java.util.Map getMutableAnnotations() { + bitField0_ |= 0x00000010; + return internalGetMutableAnnotations().getMutableMap(); + } + + /** + * + * + *
        +     * Optional. User-defined annotations. See
        +     * https://google.aip.dev/148#annotations for more details such as format and
        +     * size limitations
        +     * 
        + * + * map<string, string> annotations = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder putAnnotations(java.lang.String key, java.lang.String value) { + if (key == null) { + throw new NullPointerException("map key"); + } + if (value == null) { + throw new NullPointerException("map value"); + } + internalGetMutableAnnotations().getMutableMap().put(key, value); + bitField0_ |= 0x00000010; + return this; + } + + /** + * + * + *
        +     * Optional. User-defined annotations. See
        +     * https://google.aip.dev/148#annotations for more details such as format and
        +     * size limitations
        +     * 
        + * + * map<string, string> annotations = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder putAllAnnotations(java.util.Map values) { + internalGetMutableAnnotations().getMutableMap().putAll(values); + bitField0_ |= 0x00000010; + return this; + } + + private com.google.iam.v3beta.PolicyBinding.Target target_; + private com.google.protobuf.SingleFieldBuilder< + com.google.iam.v3beta.PolicyBinding.Target, + com.google.iam.v3beta.PolicyBinding.Target.Builder, + com.google.iam.v3beta.PolicyBinding.TargetOrBuilder> + targetBuilder_; + + /** + * + * + *
        +     * Required. Immutable. Target is the full resource name of the resource to
        +     * which the policy will be bound. Immutable once set.
        +     * 
        + * + * + * .google.iam.v3beta.PolicyBinding.Target target = 6 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the target field is set. + */ + public boolean hasTarget() { + return ((bitField0_ & 0x00000020) != 0); + } + + /** + * + * + *
        +     * Required. Immutable. Target is the full resource name of the resource to
        +     * which the policy will be bound. Immutable once set.
        +     * 
        + * + * + * .google.iam.v3beta.PolicyBinding.Target target = 6 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = REQUIRED]; + * + * + * @return The target. + */ + public com.google.iam.v3beta.PolicyBinding.Target getTarget() { + if (targetBuilder_ == null) { + return target_ == null + ? com.google.iam.v3beta.PolicyBinding.Target.getDefaultInstance() + : target_; + } else { + return targetBuilder_.getMessage(); + } + } + + /** + * + * + *
        +     * Required. Immutable. Target is the full resource name of the resource to
        +     * which the policy will be bound. Immutable once set.
        +     * 
        + * + * + * .google.iam.v3beta.PolicyBinding.Target target = 6 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setTarget(com.google.iam.v3beta.PolicyBinding.Target value) { + if (targetBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + target_ = value; + } else { + targetBuilder_.setMessage(value); + } + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + + /** + * + * + *
        +     * Required. Immutable. Target is the full resource name of the resource to
        +     * which the policy will be bound. Immutable once set.
        +     * 
        + * + * + * .google.iam.v3beta.PolicyBinding.Target target = 6 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setTarget(com.google.iam.v3beta.PolicyBinding.Target.Builder builderForValue) { + if (targetBuilder_ == null) { + target_ = builderForValue.build(); + } else { + targetBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + + /** + * + * + *
        +     * Required. Immutable. Target is the full resource name of the resource to
        +     * which the policy will be bound. Immutable once set.
        +     * 
        + * + * + * .google.iam.v3beta.PolicyBinding.Target target = 6 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeTarget(com.google.iam.v3beta.PolicyBinding.Target value) { + if (targetBuilder_ == null) { + if (((bitField0_ & 0x00000020) != 0) + && target_ != null + && target_ != com.google.iam.v3beta.PolicyBinding.Target.getDefaultInstance()) { + getTargetBuilder().mergeFrom(value); + } else { + target_ = value; + } + } else { + targetBuilder_.mergeFrom(value); + } + if (target_ != null) { + bitField0_ |= 0x00000020; + onChanged(); + } + return this; + } + + /** + * + * + *
        +     * Required. Immutable. Target is the full resource name of the resource to
        +     * which the policy will be bound. Immutable once set.
        +     * 
        + * + * + * .google.iam.v3beta.PolicyBinding.Target target = 6 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearTarget() { + bitField0_ = (bitField0_ & ~0x00000020); + target_ = null; + if (targetBuilder_ != null) { + targetBuilder_.dispose(); + targetBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
        +     * Required. Immutable. Target is the full resource name of the resource to
        +     * which the policy will be bound. Immutable once set.
        +     * 
        + * + * + * .google.iam.v3beta.PolicyBinding.Target target = 6 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.iam.v3beta.PolicyBinding.Target.Builder getTargetBuilder() { + bitField0_ |= 0x00000020; + onChanged(); + return internalGetTargetFieldBuilder().getBuilder(); + } + + /** + * + * + *
        +     * Required. Immutable. Target is the full resource name of the resource to
        +     * which the policy will be bound. Immutable once set.
        +     * 
        + * + * + * .google.iam.v3beta.PolicyBinding.Target target = 6 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.iam.v3beta.PolicyBinding.TargetOrBuilder getTargetOrBuilder() { + if (targetBuilder_ != null) { + return targetBuilder_.getMessageOrBuilder(); + } else { + return target_ == null + ? com.google.iam.v3beta.PolicyBinding.Target.getDefaultInstance() + : target_; + } + } + + /** + * + * + *
        +     * Required. Immutable. Target is the full resource name of the resource to
        +     * which the policy will be bound. Immutable once set.
        +     * 
        + * + * + * .google.iam.v3beta.PolicyBinding.Target target = 6 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.iam.v3beta.PolicyBinding.Target, + com.google.iam.v3beta.PolicyBinding.Target.Builder, + com.google.iam.v3beta.PolicyBinding.TargetOrBuilder> + internalGetTargetFieldBuilder() { + if (targetBuilder_ == null) { + targetBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.iam.v3beta.PolicyBinding.Target, + com.google.iam.v3beta.PolicyBinding.Target.Builder, + com.google.iam.v3beta.PolicyBinding.TargetOrBuilder>( + getTarget(), getParentForChildren(), isClean()); + target_ = null; + } + return targetBuilder_; + } + + private int policyKind_ = 0; + + /** + * + * + *
        +     * Immutable. The kind of the policy to attach in this binding. This field
        +     * must be one of the following:
        +     *
        +     * - Left empty (will be automatically set to the policy kind)
        +     * - The input policy kind
        +     * 
        + * + * + * .google.iam.v3beta.PolicyBinding.PolicyKind policy_kind = 11 [(.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return The enum numeric value on the wire for policyKind. + */ + @java.lang.Override + public int getPolicyKindValue() { + return policyKind_; + } + + /** + * + * + *
        +     * Immutable. The kind of the policy to attach in this binding. This field
        +     * must be one of the following:
        +     *
        +     * - Left empty (will be automatically set to the policy kind)
        +     * - The input policy kind
        +     * 
        + * + * + * .google.iam.v3beta.PolicyBinding.PolicyKind policy_kind = 11 [(.google.api.field_behavior) = IMMUTABLE]; + * + * + * @param value The enum numeric value on the wire for policyKind to set. + * @return This builder for chaining. + */ + public Builder setPolicyKindValue(int value) { + policyKind_ = value; + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + + /** + * + * + *
        +     * Immutable. The kind of the policy to attach in this binding. This field
        +     * must be one of the following:
        +     *
        +     * - Left empty (will be automatically set to the policy kind)
        +     * - The input policy kind
        +     * 
        + * + * + * .google.iam.v3beta.PolicyBinding.PolicyKind policy_kind = 11 [(.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return The policyKind. + */ + @java.lang.Override + public com.google.iam.v3beta.PolicyBinding.PolicyKind getPolicyKind() { + com.google.iam.v3beta.PolicyBinding.PolicyKind result = + com.google.iam.v3beta.PolicyBinding.PolicyKind.forNumber(policyKind_); + return result == null ? com.google.iam.v3beta.PolicyBinding.PolicyKind.UNRECOGNIZED : result; + } + + /** + * + * + *
        +     * Immutable. The kind of the policy to attach in this binding. This field
        +     * must be one of the following:
        +     *
        +     * - Left empty (will be automatically set to the policy kind)
        +     * - The input policy kind
        +     * 
        + * + * + * .google.iam.v3beta.PolicyBinding.PolicyKind policy_kind = 11 [(.google.api.field_behavior) = IMMUTABLE]; + * + * + * @param value The policyKind to set. + * @return This builder for chaining. + */ + public Builder setPolicyKind(com.google.iam.v3beta.PolicyBinding.PolicyKind value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000040; + policyKind_ = value.getNumber(); + onChanged(); + return this; + } + + /** + * + * + *
        +     * Immutable. The kind of the policy to attach in this binding. This field
        +     * must be one of the following:
        +     *
        +     * - Left empty (will be automatically set to the policy kind)
        +     * - The input policy kind
        +     * 
        + * + * + * .google.iam.v3beta.PolicyBinding.PolicyKind policy_kind = 11 [(.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return This builder for chaining. + */ + public Builder clearPolicyKind() { + bitField0_ = (bitField0_ & ~0x00000040); + policyKind_ = 0; + onChanged(); + return this; + } + + private java.lang.Object policy_ = ""; + + /** + * + * + *
        +     * Required. Immutable. The resource name of the policy to be bound. The
        +     * binding parent and policy must belong to the same organization.
        +     * 
        + * + * + * string policy = 7 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = REQUIRED]; + * + * + * @return The policy. + */ + public java.lang.String getPolicy() { + java.lang.Object ref = policy_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + policy_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
        +     * Required. Immutable. The resource name of the policy to be bound. The
        +     * binding parent and policy must belong to the same organization.
        +     * 
        + * + * + * string policy = 7 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = REQUIRED]; + * + * + * @return The bytes for policy. + */ + public com.google.protobuf.ByteString getPolicyBytes() { + java.lang.Object ref = policy_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + policy_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
        +     * Required. Immutable. The resource name of the policy to be bound. The
        +     * binding parent and policy must belong to the same organization.
        +     * 
        + * + * + * string policy = 7 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = REQUIRED]; + * + * + * @param value The policy to set. + * @return This builder for chaining. + */ + public Builder setPolicy(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + policy_ = value; + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + + /** + * + * + *
        +     * Required. Immutable. The resource name of the policy to be bound. The
        +     * binding parent and policy must belong to the same organization.
        +     * 
        + * + * + * string policy = 7 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = REQUIRED]; + * + * + * @return This builder for chaining. + */ + public Builder clearPolicy() { + policy_ = getDefaultInstance().getPolicy(); + bitField0_ = (bitField0_ & ~0x00000080); + onChanged(); + return this; + } + + /** + * + * + *
        +     * Required. Immutable. The resource name of the policy to be bound. The
        +     * binding parent and policy must belong to the same organization.
        +     * 
        + * + * + * string policy = 7 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = REQUIRED]; + * + * + * @param value The bytes for policy to set. + * @return This builder for chaining. + */ + public Builder setPolicyBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + policy_ = value; + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + + private java.lang.Object policyUid_ = ""; + + /** + * + * + *
        +     * Output only. The globally unique ID of the policy to be bound.
        +     * 
        + * + * string policy_uid = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The policyUid. + */ + public java.lang.String getPolicyUid() { + java.lang.Object ref = policyUid_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + policyUid_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
        +     * Output only. The globally unique ID of the policy to be bound.
        +     * 
        + * + * string policy_uid = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for policyUid. + */ + public com.google.protobuf.ByteString getPolicyUidBytes() { + java.lang.Object ref = policyUid_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + policyUid_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
        +     * Output only. The globally unique ID of the policy to be bound.
        +     * 
        + * + * string policy_uid = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The policyUid to set. + * @return This builder for chaining. + */ + public Builder setPolicyUid(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + policyUid_ = value; + bitField0_ |= 0x00000100; + onChanged(); + return this; + } + + /** + * + * + *
        +     * Output only. The globally unique ID of the policy to be bound.
        +     * 
        + * + * string policy_uid = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearPolicyUid() { + policyUid_ = getDefaultInstance().getPolicyUid(); + bitField0_ = (bitField0_ & ~0x00000100); + onChanged(); + return this; + } + + /** + * + * + *
        +     * Output only. The globally unique ID of the policy to be bound.
        +     * 
        + * + * string policy_uid = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The bytes for policyUid to set. + * @return This builder for chaining. + */ + public Builder setPolicyUidBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + policyUid_ = value; + bitField0_ |= 0x00000100; + onChanged(); + return this; + } + + private com.google.type.Expr condition_; + private com.google.protobuf.SingleFieldBuilder< + com.google.type.Expr, com.google.type.Expr.Builder, com.google.type.ExprOrBuilder> + conditionBuilder_; + + /** + * + * + *
        +     * Optional. The condition to apply to the policy binding. When set, the
        +     * `expression` field in the `Expr` must include from 1 to 10 subexpressions,
        +     * joined by the
        +     * "||"(Logical OR), "&&"(Logical AND) or "!"(Logical NOT) operators and
        +     * cannot contain more than 250 characters.
        +     *
        +     * The condition is currently only supported when bound to policies of kind
        +     * principal access boundary.
        +     *
        +     * When the bound policy is a principal access boundary policy, the only
        +     * supported attributes in any subexpression are `principal.type` and
        +     * `principal.subject`. An example expression is: "principal.type ==
        +     * 'iam.googleapis.com/ServiceAccount'" or "principal.subject ==
        +     * 'bob@example.com'".
        +     *
        +     * Allowed operations for `principal.subject`:
        +     *
        +     * - `principal.subject == <principal subject string>`
        +     * - `principal.subject != <principal subject string>`
        +     * - `principal.subject in [<list of principal subjects>]`
        +     * - `principal.subject.startsWith(<string>)`
        +     * - `principal.subject.endsWith(<string>)`
        +     *
        +     * Allowed operations for `principal.type`:
        +     *
        +     * - `principal.type == <principal type string>`
        +     * - `principal.type != <principal type string>`
        +     * - `principal.type in [<list of principal types>]`
        +     *
        +     * Supported principal types are Workspace, Workforce Pool, Workload Pool and
        +     * Service Account. Allowed string must be one of:
        +     *
        +     * - iam.googleapis.com/WorkspaceIdentity
        +     * - iam.googleapis.com/WorkforcePoolIdentity
        +     * - iam.googleapis.com/WorkloadPoolIdentity
        +     * - iam.googleapis.com/ServiceAccount
        +     * 
        + * + * .google.type.Expr condition = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return Whether the condition field is set. + */ + public boolean hasCondition() { + return ((bitField0_ & 0x00000200) != 0); + } + + /** + * + * + *
        +     * Optional. The condition to apply to the policy binding. When set, the
        +     * `expression` field in the `Expr` must include from 1 to 10 subexpressions,
        +     * joined by the
        +     * "||"(Logical OR), "&&"(Logical AND) or "!"(Logical NOT) operators and
        +     * cannot contain more than 250 characters.
        +     *
        +     * The condition is currently only supported when bound to policies of kind
        +     * principal access boundary.
        +     *
        +     * When the bound policy is a principal access boundary policy, the only
        +     * supported attributes in any subexpression are `principal.type` and
        +     * `principal.subject`. An example expression is: "principal.type ==
        +     * 'iam.googleapis.com/ServiceAccount'" or "principal.subject ==
        +     * 'bob@example.com'".
        +     *
        +     * Allowed operations for `principal.subject`:
        +     *
        +     * - `principal.subject == <principal subject string>`
        +     * - `principal.subject != <principal subject string>`
        +     * - `principal.subject in [<list of principal subjects>]`
        +     * - `principal.subject.startsWith(<string>)`
        +     * - `principal.subject.endsWith(<string>)`
        +     *
        +     * Allowed operations for `principal.type`:
        +     *
        +     * - `principal.type == <principal type string>`
        +     * - `principal.type != <principal type string>`
        +     * - `principal.type in [<list of principal types>]`
        +     *
        +     * Supported principal types are Workspace, Workforce Pool, Workload Pool and
        +     * Service Account. Allowed string must be one of:
        +     *
        +     * - iam.googleapis.com/WorkspaceIdentity
        +     * - iam.googleapis.com/WorkforcePoolIdentity
        +     * - iam.googleapis.com/WorkloadPoolIdentity
        +     * - iam.googleapis.com/ServiceAccount
        +     * 
        + * + * .google.type.Expr condition = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The condition. + */ + public com.google.type.Expr getCondition() { + if (conditionBuilder_ == null) { + return condition_ == null ? com.google.type.Expr.getDefaultInstance() : condition_; + } else { + return conditionBuilder_.getMessage(); + } + } + + /** + * + * + *
        +     * Optional. The condition to apply to the policy binding. When set, the
        +     * `expression` field in the `Expr` must include from 1 to 10 subexpressions,
        +     * joined by the
        +     * "||"(Logical OR), "&&"(Logical AND) or "!"(Logical NOT) operators and
        +     * cannot contain more than 250 characters.
        +     *
        +     * The condition is currently only supported when bound to policies of kind
        +     * principal access boundary.
        +     *
        +     * When the bound policy is a principal access boundary policy, the only
        +     * supported attributes in any subexpression are `principal.type` and
        +     * `principal.subject`. An example expression is: "principal.type ==
        +     * 'iam.googleapis.com/ServiceAccount'" or "principal.subject ==
        +     * 'bob@example.com'".
        +     *
        +     * Allowed operations for `principal.subject`:
        +     *
        +     * - `principal.subject == <principal subject string>`
        +     * - `principal.subject != <principal subject string>`
        +     * - `principal.subject in [<list of principal subjects>]`
        +     * - `principal.subject.startsWith(<string>)`
        +     * - `principal.subject.endsWith(<string>)`
        +     *
        +     * Allowed operations for `principal.type`:
        +     *
        +     * - `principal.type == <principal type string>`
        +     * - `principal.type != <principal type string>`
        +     * - `principal.type in [<list of principal types>]`
        +     *
        +     * Supported principal types are Workspace, Workforce Pool, Workload Pool and
        +     * Service Account. Allowed string must be one of:
        +     *
        +     * - iam.googleapis.com/WorkspaceIdentity
        +     * - iam.googleapis.com/WorkforcePoolIdentity
        +     * - iam.googleapis.com/WorkloadPoolIdentity
        +     * - iam.googleapis.com/ServiceAccount
        +     * 
        + * + * .google.type.Expr condition = 8 [(.google.api.field_behavior) = OPTIONAL]; + */ + public Builder setCondition(com.google.type.Expr value) { + if (conditionBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + condition_ = value; + } else { + conditionBuilder_.setMessage(value); + } + bitField0_ |= 0x00000200; + onChanged(); + return this; + } + + /** + * + * + *
        +     * Optional. The condition to apply to the policy binding. When set, the
        +     * `expression` field in the `Expr` must include from 1 to 10 subexpressions,
        +     * joined by the
        +     * "||"(Logical OR), "&&"(Logical AND) or "!"(Logical NOT) operators and
        +     * cannot contain more than 250 characters.
        +     *
        +     * The condition is currently only supported when bound to policies of kind
        +     * principal access boundary.
        +     *
        +     * When the bound policy is a principal access boundary policy, the only
        +     * supported attributes in any subexpression are `principal.type` and
        +     * `principal.subject`. An example expression is: "principal.type ==
        +     * 'iam.googleapis.com/ServiceAccount'" or "principal.subject ==
        +     * 'bob@example.com'".
        +     *
        +     * Allowed operations for `principal.subject`:
        +     *
        +     * - `principal.subject == <principal subject string>`
        +     * - `principal.subject != <principal subject string>`
        +     * - `principal.subject in [<list of principal subjects>]`
        +     * - `principal.subject.startsWith(<string>)`
        +     * - `principal.subject.endsWith(<string>)`
        +     *
        +     * Allowed operations for `principal.type`:
        +     *
        +     * - `principal.type == <principal type string>`
        +     * - `principal.type != <principal type string>`
        +     * - `principal.type in [<list of principal types>]`
        +     *
        +     * Supported principal types are Workspace, Workforce Pool, Workload Pool and
        +     * Service Account. Allowed string must be one of:
        +     *
        +     * - iam.googleapis.com/WorkspaceIdentity
        +     * - iam.googleapis.com/WorkforcePoolIdentity
        +     * - iam.googleapis.com/WorkloadPoolIdentity
        +     * - iam.googleapis.com/ServiceAccount
        +     * 
        + * + * .google.type.Expr condition = 8 [(.google.api.field_behavior) = OPTIONAL]; + */ + public Builder setCondition(com.google.type.Expr.Builder builderForValue) { + if (conditionBuilder_ == null) { + condition_ = builderForValue.build(); + } else { + conditionBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000200; + onChanged(); + return this; + } + + /** + * + * + *
        +     * Optional. The condition to apply to the policy binding. When set, the
        +     * `expression` field in the `Expr` must include from 1 to 10 subexpressions,
        +     * joined by the
        +     * "||"(Logical OR), "&&"(Logical AND) or "!"(Logical NOT) operators and
        +     * cannot contain more than 250 characters.
        +     *
        +     * The condition is currently only supported when bound to policies of kind
        +     * principal access boundary.
        +     *
        +     * When the bound policy is a principal access boundary policy, the only
        +     * supported attributes in any subexpression are `principal.type` and
        +     * `principal.subject`. An example expression is: "principal.type ==
        +     * 'iam.googleapis.com/ServiceAccount'" or "principal.subject ==
        +     * 'bob@example.com'".
        +     *
        +     * Allowed operations for `principal.subject`:
        +     *
        +     * - `principal.subject == <principal subject string>`
        +     * - `principal.subject != <principal subject string>`
        +     * - `principal.subject in [<list of principal subjects>]`
        +     * - `principal.subject.startsWith(<string>)`
        +     * - `principal.subject.endsWith(<string>)`
        +     *
        +     * Allowed operations for `principal.type`:
        +     *
        +     * - `principal.type == <principal type string>`
        +     * - `principal.type != <principal type string>`
        +     * - `principal.type in [<list of principal types>]`
        +     *
        +     * Supported principal types are Workspace, Workforce Pool, Workload Pool and
        +     * Service Account. Allowed string must be one of:
        +     *
        +     * - iam.googleapis.com/WorkspaceIdentity
        +     * - iam.googleapis.com/WorkforcePoolIdentity
        +     * - iam.googleapis.com/WorkloadPoolIdentity
        +     * - iam.googleapis.com/ServiceAccount
        +     * 
        + * + * .google.type.Expr condition = 8 [(.google.api.field_behavior) = OPTIONAL]; + */ + public Builder mergeCondition(com.google.type.Expr value) { + if (conditionBuilder_ == null) { + if (((bitField0_ & 0x00000200) != 0) + && condition_ != null + && condition_ != com.google.type.Expr.getDefaultInstance()) { + getConditionBuilder().mergeFrom(value); + } else { + condition_ = value; + } + } else { + conditionBuilder_.mergeFrom(value); + } + if (condition_ != null) { + bitField0_ |= 0x00000200; + onChanged(); + } + return this; + } + + /** + * + * + *
        +     * Optional. The condition to apply to the policy binding. When set, the
        +     * `expression` field in the `Expr` must include from 1 to 10 subexpressions,
        +     * joined by the
        +     * "||"(Logical OR), "&&"(Logical AND) or "!"(Logical NOT) operators and
        +     * cannot contain more than 250 characters.
        +     *
        +     * The condition is currently only supported when bound to policies of kind
        +     * principal access boundary.
        +     *
        +     * When the bound policy is a principal access boundary policy, the only
        +     * supported attributes in any subexpression are `principal.type` and
        +     * `principal.subject`. An example expression is: "principal.type ==
        +     * 'iam.googleapis.com/ServiceAccount'" or "principal.subject ==
        +     * 'bob@example.com'".
        +     *
        +     * Allowed operations for `principal.subject`:
        +     *
        +     * - `principal.subject == <principal subject string>`
        +     * - `principal.subject != <principal subject string>`
        +     * - `principal.subject in [<list of principal subjects>]`
        +     * - `principal.subject.startsWith(<string>)`
        +     * - `principal.subject.endsWith(<string>)`
        +     *
        +     * Allowed operations for `principal.type`:
        +     *
        +     * - `principal.type == <principal type string>`
        +     * - `principal.type != <principal type string>`
        +     * - `principal.type in [<list of principal types>]`
        +     *
        +     * Supported principal types are Workspace, Workforce Pool, Workload Pool and
        +     * Service Account. Allowed string must be one of:
        +     *
        +     * - iam.googleapis.com/WorkspaceIdentity
        +     * - iam.googleapis.com/WorkforcePoolIdentity
        +     * - iam.googleapis.com/WorkloadPoolIdentity
        +     * - iam.googleapis.com/ServiceAccount
        +     * 
        + * + * .google.type.Expr condition = 8 [(.google.api.field_behavior) = OPTIONAL]; + */ + public Builder clearCondition() { + bitField0_ = (bitField0_ & ~0x00000200); + condition_ = null; + if (conditionBuilder_ != null) { + conditionBuilder_.dispose(); + conditionBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
        +     * Optional. The condition to apply to the policy binding. When set, the
        +     * `expression` field in the `Expr` must include from 1 to 10 subexpressions,
        +     * joined by the
        +     * "||"(Logical OR), "&&"(Logical AND) or "!"(Logical NOT) operators and
        +     * cannot contain more than 250 characters.
        +     *
        +     * The condition is currently only supported when bound to policies of kind
        +     * principal access boundary.
        +     *
        +     * When the bound policy is a principal access boundary policy, the only
        +     * supported attributes in any subexpression are `principal.type` and
        +     * `principal.subject`. An example expression is: "principal.type ==
        +     * 'iam.googleapis.com/ServiceAccount'" or "principal.subject ==
        +     * 'bob@example.com'".
        +     *
        +     * Allowed operations for `principal.subject`:
        +     *
        +     * - `principal.subject == <principal subject string>`
        +     * - `principal.subject != <principal subject string>`
        +     * - `principal.subject in [<list of principal subjects>]`
        +     * - `principal.subject.startsWith(<string>)`
        +     * - `principal.subject.endsWith(<string>)`
        +     *
        +     * Allowed operations for `principal.type`:
        +     *
        +     * - `principal.type == <principal type string>`
        +     * - `principal.type != <principal type string>`
        +     * - `principal.type in [<list of principal types>]`
        +     *
        +     * Supported principal types are Workspace, Workforce Pool, Workload Pool and
        +     * Service Account. Allowed string must be one of:
        +     *
        +     * - iam.googleapis.com/WorkspaceIdentity
        +     * - iam.googleapis.com/WorkforcePoolIdentity
        +     * - iam.googleapis.com/WorkloadPoolIdentity
        +     * - iam.googleapis.com/ServiceAccount
        +     * 
        + * + * .google.type.Expr condition = 8 [(.google.api.field_behavior) = OPTIONAL]; + */ + public com.google.type.Expr.Builder getConditionBuilder() { + bitField0_ |= 0x00000200; + onChanged(); + return internalGetConditionFieldBuilder().getBuilder(); + } + + /** + * + * + *
        +     * Optional. The condition to apply to the policy binding. When set, the
        +     * `expression` field in the `Expr` must include from 1 to 10 subexpressions,
        +     * joined by the
        +     * "||"(Logical OR), "&&"(Logical AND) or "!"(Logical NOT) operators and
        +     * cannot contain more than 250 characters.
        +     *
        +     * The condition is currently only supported when bound to policies of kind
        +     * principal access boundary.
        +     *
        +     * When the bound policy is a principal access boundary policy, the only
        +     * supported attributes in any subexpression are `principal.type` and
        +     * `principal.subject`. An example expression is: "principal.type ==
        +     * 'iam.googleapis.com/ServiceAccount'" or "principal.subject ==
        +     * 'bob@example.com'".
        +     *
        +     * Allowed operations for `principal.subject`:
        +     *
        +     * - `principal.subject == <principal subject string>`
        +     * - `principal.subject != <principal subject string>`
        +     * - `principal.subject in [<list of principal subjects>]`
        +     * - `principal.subject.startsWith(<string>)`
        +     * - `principal.subject.endsWith(<string>)`
        +     *
        +     * Allowed operations for `principal.type`:
        +     *
        +     * - `principal.type == <principal type string>`
        +     * - `principal.type != <principal type string>`
        +     * - `principal.type in [<list of principal types>]`
        +     *
        +     * Supported principal types are Workspace, Workforce Pool, Workload Pool and
        +     * Service Account. Allowed string must be one of:
        +     *
        +     * - iam.googleapis.com/WorkspaceIdentity
        +     * - iam.googleapis.com/WorkforcePoolIdentity
        +     * - iam.googleapis.com/WorkloadPoolIdentity
        +     * - iam.googleapis.com/ServiceAccount
        +     * 
        + * + * .google.type.Expr condition = 8 [(.google.api.field_behavior) = OPTIONAL]; + */ + public com.google.type.ExprOrBuilder getConditionOrBuilder() { + if (conditionBuilder_ != null) { + return conditionBuilder_.getMessageOrBuilder(); + } else { + return condition_ == null ? com.google.type.Expr.getDefaultInstance() : condition_; + } + } + + /** + * + * + *
        +     * Optional. The condition to apply to the policy binding. When set, the
        +     * `expression` field in the `Expr` must include from 1 to 10 subexpressions,
        +     * joined by the
        +     * "||"(Logical OR), "&&"(Logical AND) or "!"(Logical NOT) operators and
        +     * cannot contain more than 250 characters.
        +     *
        +     * The condition is currently only supported when bound to policies of kind
        +     * principal access boundary.
        +     *
        +     * When the bound policy is a principal access boundary policy, the only
        +     * supported attributes in any subexpression are `principal.type` and
        +     * `principal.subject`. An example expression is: "principal.type ==
        +     * 'iam.googleapis.com/ServiceAccount'" or "principal.subject ==
        +     * 'bob@example.com'".
        +     *
        +     * Allowed operations for `principal.subject`:
        +     *
        +     * - `principal.subject == <principal subject string>`
        +     * - `principal.subject != <principal subject string>`
        +     * - `principal.subject in [<list of principal subjects>]`
        +     * - `principal.subject.startsWith(<string>)`
        +     * - `principal.subject.endsWith(<string>)`
        +     *
        +     * Allowed operations for `principal.type`:
        +     *
        +     * - `principal.type == <principal type string>`
        +     * - `principal.type != <principal type string>`
        +     * - `principal.type in [<list of principal types>]`
        +     *
        +     * Supported principal types are Workspace, Workforce Pool, Workload Pool and
        +     * Service Account. Allowed string must be one of:
        +     *
        +     * - iam.googleapis.com/WorkspaceIdentity
        +     * - iam.googleapis.com/WorkforcePoolIdentity
        +     * - iam.googleapis.com/WorkloadPoolIdentity
        +     * - iam.googleapis.com/ServiceAccount
        +     * 
        + * + * .google.type.Expr condition = 8 [(.google.api.field_behavior) = OPTIONAL]; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.type.Expr, com.google.type.Expr.Builder, com.google.type.ExprOrBuilder> + internalGetConditionFieldBuilder() { + if (conditionBuilder_ == null) { + conditionBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.type.Expr, com.google.type.Expr.Builder, com.google.type.ExprOrBuilder>( + getCondition(), getParentForChildren(), isClean()); + condition_ = null; + } + return conditionBuilder_; + } + + private com.google.protobuf.Timestamp createTime_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + createTimeBuilder_; + + /** + * + * + *
        +     * Output only. The time when the policy binding was created.
        +     * 
        + * + * + * .google.protobuf.Timestamp create_time = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the createTime field is set. + */ + public boolean hasCreateTime() { + return ((bitField0_ & 0x00000400) != 0); + } + + /** + * + * + *
        +     * Output only. The time when the policy binding was created.
        +     * 
        + * + * + * .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 time when the policy binding was created.
        +     * 
        + * + * + * .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_ |= 0x00000400; + onChanged(); + return this; + } + + /** + * + * + *
        +     * Output only. The time when the policy binding was created.
        +     * 
        + * + * + * .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_ |= 0x00000400; + onChanged(); + return this; + } + + /** + * + * + *
        +     * Output only. The time when the policy binding was created.
        +     * 
        + * + * + * .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_ & 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 time when the policy binding was created.
        +     * 
        + * + * + * .google.protobuf.Timestamp create_time = 9 [(.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 time when the policy binding was created.
        +     * 
        + * + * + * .google.protobuf.Timestamp create_time = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.Timestamp.Builder getCreateTimeBuilder() { + bitField0_ |= 0x00000400; + onChanged(); + return internalGetCreateTimeFieldBuilder().getBuilder(); + } + + /** + * + * + *
        +     * Output only. The time when the policy binding was created.
        +     * 
        + * + * + * .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 time when the policy binding was created.
        +     * 
        + * + * + * .google.protobuf.Timestamp create_time = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + internalGetCreateTimeFieldBuilder() { + if (createTimeBuilder_ == null) { + createTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + 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.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + updateTimeBuilder_; + + /** + * + * + *
        +     * Output only. The time when the policy binding was most recently updated.
        +     * 
        + * + * + * .google.protobuf.Timestamp update_time = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the updateTime field is set. + */ + public boolean hasUpdateTime() { + return ((bitField0_ & 0x00000800) != 0); + } + + /** + * + * + *
        +     * Output only. The time when the policy binding was most recently updated.
        +     * 
        + * + * + * .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 time when the policy binding was most recently updated.
        +     * 
        + * + * + * .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_ |= 0x00000800; + onChanged(); + return this; + } + + /** + * + * + *
        +     * Output only. The time when the policy binding was most recently updated.
        +     * 
        + * + * + * .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_ |= 0x00000800; + onChanged(); + return this; + } + + /** + * + * + *
        +     * Output only. The time when the policy binding was most recently updated.
        +     * 
        + * + * + * .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_ & 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 time when the policy binding was most recently updated.
        +     * 
        + * + * + * .google.protobuf.Timestamp update_time = 10 [(.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 time when the policy binding was most recently updated.
        +     * 
        + * + * + * .google.protobuf.Timestamp update_time = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.Timestamp.Builder getUpdateTimeBuilder() { + bitField0_ |= 0x00000800; + onChanged(); + return internalGetUpdateTimeFieldBuilder().getBuilder(); + } + + /** + * + * + *
        +     * Output only. The time when the policy binding was most recently updated.
        +     * 
        + * + * + * .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 time when the policy binding was most recently updated.
        +     * 
        + * + * + * .google.protobuf.Timestamp update_time = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + internalGetUpdateTimeFieldBuilder() { + if (updateTimeBuilder_ == null) { + updateTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getUpdateTime(), getParentForChildren(), isClean()); + updateTime_ = null; + } + return updateTimeBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.iam.v3beta.PolicyBinding) + } + + // @@protoc_insertion_point(class_scope:google.iam.v3beta.PolicyBinding) + private static final com.google.iam.v3beta.PolicyBinding DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.iam.v3beta.PolicyBinding(); + } + + public static com.google.iam.v3beta.PolicyBinding getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public PolicyBinding 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.iam.v3beta.PolicyBinding getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-iam/proto-google-iam-v3beta/src/main/java/com/google/iam/v3beta/PolicyBindingName.java b/java-iam/proto-google-iam-v3beta/src/main/java/com/google/iam/v3beta/PolicyBindingName.java new file mode 100644 index 0000000000..e8e733b998 --- /dev/null +++ b/java-iam/proto-google-iam-v3beta/src/main/java/com/google/iam/v3beta/PolicyBindingName.java @@ -0,0 +1,449 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.iam.v3beta; + +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 PolicyBindingName implements ResourceName { + private static final PathTemplate ORGANIZATION_LOCATION_POLICY_BINDING = + PathTemplate.createWithoutUrlEncoding( + "organizations/{organization}/locations/{location}/policyBindings/{policy_binding}"); + private static final PathTemplate FOLDER_LOCATION_POLICY_BINDING = + PathTemplate.createWithoutUrlEncoding( + "folders/{folder}/locations/{location}/policyBindings/{policy_binding}"); + private static final PathTemplate PROJECT_LOCATION_POLICY_BINDING = + PathTemplate.createWithoutUrlEncoding( + "projects/{project}/locations/{location}/policyBindings/{policy_binding}"); + private volatile Map fieldValuesMap; + private PathTemplate pathTemplate; + private String fixedValue; + private final String organization; + private final String location; + private final String policyBinding; + private final String folder; + private final String project; + + @Deprecated + protected PolicyBindingName() { + organization = null; + location = null; + policyBinding = null; + folder = null; + project = null; + } + + private PolicyBindingName(Builder builder) { + organization = Preconditions.checkNotNull(builder.getOrganization()); + location = Preconditions.checkNotNull(builder.getLocation()); + policyBinding = Preconditions.checkNotNull(builder.getPolicyBinding()); + folder = null; + project = null; + pathTemplate = ORGANIZATION_LOCATION_POLICY_BINDING; + } + + private PolicyBindingName(FolderLocationPolicyBindingBuilder builder) { + folder = Preconditions.checkNotNull(builder.getFolder()); + location = Preconditions.checkNotNull(builder.getLocation()); + policyBinding = Preconditions.checkNotNull(builder.getPolicyBinding()); + organization = null; + project = null; + pathTemplate = FOLDER_LOCATION_POLICY_BINDING; + } + + private PolicyBindingName(ProjectLocationPolicyBindingBuilder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + location = Preconditions.checkNotNull(builder.getLocation()); + policyBinding = Preconditions.checkNotNull(builder.getPolicyBinding()); + organization = null; + folder = null; + pathTemplate = PROJECT_LOCATION_POLICY_BINDING; + } + + public String getOrganization() { + return organization; + } + + public String getLocation() { + return location; + } + + public String getPolicyBinding() { + return policyBinding; + } + + public String getFolder() { + return folder; + } + + public String getProject() { + return project; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public static Builder newOrganizationLocationPolicyBindingBuilder() { + return new Builder(); + } + + public static FolderLocationPolicyBindingBuilder newFolderLocationPolicyBindingBuilder() { + return new FolderLocationPolicyBindingBuilder(); + } + + public static ProjectLocationPolicyBindingBuilder newProjectLocationPolicyBindingBuilder() { + return new ProjectLocationPolicyBindingBuilder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + public static PolicyBindingName of(String organization, String location, String policyBinding) { + return newBuilder() + .setOrganization(organization) + .setLocation(location) + .setPolicyBinding(policyBinding) + .build(); + } + + public static PolicyBindingName ofOrganizationLocationPolicyBindingName( + String organization, String location, String policyBinding) { + return newBuilder() + .setOrganization(organization) + .setLocation(location) + .setPolicyBinding(policyBinding) + .build(); + } + + public static PolicyBindingName ofFolderLocationPolicyBindingName( + String folder, String location, String policyBinding) { + return newFolderLocationPolicyBindingBuilder() + .setFolder(folder) + .setLocation(location) + .setPolicyBinding(policyBinding) + .build(); + } + + public static PolicyBindingName ofProjectLocationPolicyBindingName( + String project, String location, String policyBinding) { + return newProjectLocationPolicyBindingBuilder() + .setProject(project) + .setLocation(location) + .setPolicyBinding(policyBinding) + .build(); + } + + public static String format(String organization, String location, String policyBinding) { + return newBuilder() + .setOrganization(organization) + .setLocation(location) + .setPolicyBinding(policyBinding) + .build() + .toString(); + } + + public static String formatOrganizationLocationPolicyBindingName( + String organization, String location, String policyBinding) { + return newBuilder() + .setOrganization(organization) + .setLocation(location) + .setPolicyBinding(policyBinding) + .build() + .toString(); + } + + public static String formatFolderLocationPolicyBindingName( + String folder, String location, String policyBinding) { + return newFolderLocationPolicyBindingBuilder() + .setFolder(folder) + .setLocation(location) + .setPolicyBinding(policyBinding) + .build() + .toString(); + } + + public static String formatProjectLocationPolicyBindingName( + String project, String location, String policyBinding) { + return newProjectLocationPolicyBindingBuilder() + .setProject(project) + .setLocation(location) + .setPolicyBinding(policyBinding) + .build() + .toString(); + } + + public static PolicyBindingName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + if (ORGANIZATION_LOCATION_POLICY_BINDING.matches(formattedString)) { + Map matchMap = ORGANIZATION_LOCATION_POLICY_BINDING.match(formattedString); + return ofOrganizationLocationPolicyBindingName( + matchMap.get("organization"), matchMap.get("location"), matchMap.get("policy_binding")); + } else if (FOLDER_LOCATION_POLICY_BINDING.matches(formattedString)) { + Map matchMap = FOLDER_LOCATION_POLICY_BINDING.match(formattedString); + return ofFolderLocationPolicyBindingName( + matchMap.get("folder"), matchMap.get("location"), matchMap.get("policy_binding")); + } else if (PROJECT_LOCATION_POLICY_BINDING.matches(formattedString)) { + Map matchMap = PROJECT_LOCATION_POLICY_BINDING.match(formattedString); + return ofProjectLocationPolicyBindingName( + matchMap.get("project"), matchMap.get("location"), matchMap.get("policy_binding")); + } + throw new ValidationException("PolicyBindingName.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 (PolicyBindingName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return ORGANIZATION_LOCATION_POLICY_BINDING.matches(formattedString) + || FOLDER_LOCATION_POLICY_BINDING.matches(formattedString) + || PROJECT_LOCATION_POLICY_BINDING.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); + } + if (policyBinding != null) { + fieldMapBuilder.put("policy_binding", policyBinding); + } + if (folder != null) { + fieldMapBuilder.put("folder", folder); + } + 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 fixedValue != null ? fixedValue : pathTemplate.instantiate(getFieldValuesMap()); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o != null && getClass() == o.getClass()) { + PolicyBindingName that = ((PolicyBindingName) o); + return Objects.equals(this.organization, that.organization) + && Objects.equals(this.location, that.location) + && Objects.equals(this.policyBinding, that.policyBinding) + && Objects.equals(this.folder, that.folder) + && Objects.equals(this.project, that.project); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= Objects.hashCode(fixedValue); + h *= 1000003; + h ^= Objects.hashCode(organization); + h *= 1000003; + h ^= Objects.hashCode(location); + h *= 1000003; + h ^= Objects.hashCode(policyBinding); + h *= 1000003; + h ^= Objects.hashCode(folder); + h *= 1000003; + h ^= Objects.hashCode(project); + return h; + } + + /** + * Builder for organizations/{organization}/locations/{location}/policyBindings/{policy_binding}. + */ + public static class Builder { + private String organization; + private String location; + private String policyBinding; + + protected Builder() {} + + public String getOrganization() { + return organization; + } + + public String getLocation() { + return location; + } + + public String getPolicyBinding() { + return policyBinding; + } + + public Builder setOrganization(String organization) { + this.organization = organization; + return this; + } + + public Builder setLocation(String location) { + this.location = location; + return this; + } + + public Builder setPolicyBinding(String policyBinding) { + this.policyBinding = policyBinding; + return this; + } + + private Builder(PolicyBindingName policyBindingName) { + Preconditions.checkArgument( + Objects.equals(policyBindingName.pathTemplate, ORGANIZATION_LOCATION_POLICY_BINDING), + "toBuilder is only supported when PolicyBindingName has the pattern of" + + " organizations/{organization}/locations/{location}/policyBindings/{policy_binding}"); + this.organization = policyBindingName.organization; + this.location = policyBindingName.location; + this.policyBinding = policyBindingName.policyBinding; + } + + public PolicyBindingName build() { + return new PolicyBindingName(this); + } + } + + /** Builder for folders/{folder}/locations/{location}/policyBindings/{policy_binding}. */ + public static class FolderLocationPolicyBindingBuilder { + private String folder; + private String location; + private String policyBinding; + + protected FolderLocationPolicyBindingBuilder() {} + + public String getFolder() { + return folder; + } + + public String getLocation() { + return location; + } + + public String getPolicyBinding() { + return policyBinding; + } + + public FolderLocationPolicyBindingBuilder setFolder(String folder) { + this.folder = folder; + return this; + } + + public FolderLocationPolicyBindingBuilder setLocation(String location) { + this.location = location; + return this; + } + + public FolderLocationPolicyBindingBuilder setPolicyBinding(String policyBinding) { + this.policyBinding = policyBinding; + return this; + } + + public PolicyBindingName build() { + return new PolicyBindingName(this); + } + } + + /** Builder for projects/{project}/locations/{location}/policyBindings/{policy_binding}. */ + public static class ProjectLocationPolicyBindingBuilder { + private String project; + private String location; + private String policyBinding; + + protected ProjectLocationPolicyBindingBuilder() {} + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public String getPolicyBinding() { + return policyBinding; + } + + public ProjectLocationPolicyBindingBuilder setProject(String project) { + this.project = project; + return this; + } + + public ProjectLocationPolicyBindingBuilder setLocation(String location) { + this.location = location; + return this; + } + + public ProjectLocationPolicyBindingBuilder setPolicyBinding(String policyBinding) { + this.policyBinding = policyBinding; + return this; + } + + public PolicyBindingName build() { + return new PolicyBindingName(this); + } + } +} diff --git a/java-iam/proto-google-iam-v3beta/src/main/java/com/google/iam/v3beta/PolicyBindingOrBuilder.java b/java-iam/proto-google-iam-v3beta/src/main/java/com/google/iam/v3beta/PolicyBindingOrBuilder.java new file mode 100644 index 0000000000..2030cb635c --- /dev/null +++ b/java-iam/proto-google-iam-v3beta/src/main/java/com/google/iam/v3beta/PolicyBindingOrBuilder.java @@ -0,0 +1,604 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/iam/v3beta/policy_binding_resources.proto +// Protobuf Java Version: 4.33.2 + +package com.google.iam.v3beta; + +@com.google.protobuf.Generated +public interface PolicyBindingOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.iam.v3beta.PolicyBinding) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
        +   * Identifier. The name of the policy binding, in the format
        +   * `{binding_parent/locations/{location}/policyBindings/{policy_binding_id}`.
        +   * The binding parent is the closest Resource Manager resource (project,
        +   * folder, or organization) to the binding target.
        +   *
        +   * Format:
        +   *
        +   * * `projects/{project_id}/locations/{location}/policyBindings/{policy_binding_id}`
        +   * * `projects/{project_number}/locations/{location}/policyBindings/{policy_binding_id}`
        +   * * `folders/{folder_id}/locations/{location}/policyBindings/{policy_binding_id}`
        +   * * `organizations/{organization_id}/locations/{location}/policyBindings/{policy_binding_id}`
        +   * 
        + * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @return The name. + */ + java.lang.String getName(); + + /** + * + * + *
        +   * Identifier. The name of the policy binding, in the format
        +   * `{binding_parent/locations/{location}/policyBindings/{policy_binding_id}`.
        +   * The binding parent is the closest Resource Manager resource (project,
        +   * folder, or organization) to the binding target.
        +   *
        +   * Format:
        +   *
        +   * * `projects/{project_id}/locations/{location}/policyBindings/{policy_binding_id}`
        +   * * `projects/{project_number}/locations/{location}/policyBindings/{policy_binding_id}`
        +   * * `folders/{folder_id}/locations/{location}/policyBindings/{policy_binding_id}`
        +   * * `organizations/{organization_id}/locations/{location}/policyBindings/{policy_binding_id}`
        +   * 
        + * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
        +   * Output only. The globally unique ID of the policy binding. Assigned when
        +   * the policy binding is created.
        +   * 
        + * + * + * string uid = 2 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_info) = { ... } + * + * + * @return The uid. + */ + java.lang.String getUid(); + + /** + * + * + *
        +   * Output only. The globally unique ID of the policy binding. Assigned when
        +   * the policy binding is created.
        +   * 
        + * + * + * string uid = 2 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_info) = { ... } + * + * + * @return The bytes for uid. + */ + com.google.protobuf.ByteString getUidBytes(); + + /** + * + * + *
        +   * Optional. The etag for the policy binding.
        +   * If this is provided on update, it must match the server's etag.
        +   * 
        + * + * string etag = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The etag. + */ + java.lang.String getEtag(); + + /** + * + * + *
        +   * Optional. The etag for the policy binding.
        +   * If this is provided on update, it must match the server's etag.
        +   * 
        + * + * string etag = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for etag. + */ + com.google.protobuf.ByteString getEtagBytes(); + + /** + * + * + *
        +   * Optional. The description of the policy binding. Must be less than or equal
        +   * to 63 characters.
        +   * 
        + * + * string display_name = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The displayName. + */ + java.lang.String getDisplayName(); + + /** + * + * + *
        +   * Optional. The description of the policy binding. Must be less than or equal
        +   * to 63 characters.
        +   * 
        + * + * string display_name = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for displayName. + */ + com.google.protobuf.ByteString getDisplayNameBytes(); + + /** + * + * + *
        +   * Optional. User-defined annotations. See
        +   * https://google.aip.dev/148#annotations for more details such as format and
        +   * size limitations
        +   * 
        + * + * map<string, string> annotations = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + int getAnnotationsCount(); + + /** + * + * + *
        +   * Optional. User-defined annotations. See
        +   * https://google.aip.dev/148#annotations for more details such as format and
        +   * size limitations
        +   * 
        + * + * map<string, string> annotations = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + boolean containsAnnotations(java.lang.String key); + + /** Use {@link #getAnnotationsMap()} instead. */ + @java.lang.Deprecated + java.util.Map getAnnotations(); + + /** + * + * + *
        +   * Optional. User-defined annotations. See
        +   * https://google.aip.dev/148#annotations for more details such as format and
        +   * size limitations
        +   * 
        + * + * map<string, string> annotations = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + java.util.Map getAnnotationsMap(); + + /** + * + * + *
        +   * Optional. User-defined annotations. See
        +   * https://google.aip.dev/148#annotations for more details such as format and
        +   * size limitations
        +   * 
        + * + * map<string, string> annotations = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + /* nullable */ + java.lang.String getAnnotationsOrDefault( + java.lang.String key, + /* nullable */ + java.lang.String defaultValue); + + /** + * + * + *
        +   * Optional. User-defined annotations. See
        +   * https://google.aip.dev/148#annotations for more details such as format and
        +   * size limitations
        +   * 
        + * + * map<string, string> annotations = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + java.lang.String getAnnotationsOrThrow(java.lang.String key); + + /** + * + * + *
        +   * Required. Immutable. Target is the full resource name of the resource to
        +   * which the policy will be bound. Immutable once set.
        +   * 
        + * + * + * .google.iam.v3beta.PolicyBinding.Target target = 6 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the target field is set. + */ + boolean hasTarget(); + + /** + * + * + *
        +   * Required. Immutable. Target is the full resource name of the resource to
        +   * which the policy will be bound. Immutable once set.
        +   * 
        + * + * + * .google.iam.v3beta.PolicyBinding.Target target = 6 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = REQUIRED]; + * + * + * @return The target. + */ + com.google.iam.v3beta.PolicyBinding.Target getTarget(); + + /** + * + * + *
        +   * Required. Immutable. Target is the full resource name of the resource to
        +   * which the policy will be bound. Immutable once set.
        +   * 
        + * + * + * .google.iam.v3beta.PolicyBinding.Target target = 6 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.iam.v3beta.PolicyBinding.TargetOrBuilder getTargetOrBuilder(); + + /** + * + * + *
        +   * Immutable. The kind of the policy to attach in this binding. This field
        +   * must be one of the following:
        +   *
        +   * - Left empty (will be automatically set to the policy kind)
        +   * - The input policy kind
        +   * 
        + * + * + * .google.iam.v3beta.PolicyBinding.PolicyKind policy_kind = 11 [(.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return The enum numeric value on the wire for policyKind. + */ + int getPolicyKindValue(); + + /** + * + * + *
        +   * Immutable. The kind of the policy to attach in this binding. This field
        +   * must be one of the following:
        +   *
        +   * - Left empty (will be automatically set to the policy kind)
        +   * - The input policy kind
        +   * 
        + * + * + * .google.iam.v3beta.PolicyBinding.PolicyKind policy_kind = 11 [(.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return The policyKind. + */ + com.google.iam.v3beta.PolicyBinding.PolicyKind getPolicyKind(); + + /** + * + * + *
        +   * Required. Immutable. The resource name of the policy to be bound. The
        +   * binding parent and policy must belong to the same organization.
        +   * 
        + * + * + * string policy = 7 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = REQUIRED]; + * + * + * @return The policy. + */ + java.lang.String getPolicy(); + + /** + * + * + *
        +   * Required. Immutable. The resource name of the policy to be bound. The
        +   * binding parent and policy must belong to the same organization.
        +   * 
        + * + * + * string policy = 7 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = REQUIRED]; + * + * + * @return The bytes for policy. + */ + com.google.protobuf.ByteString getPolicyBytes(); + + /** + * + * + *
        +   * Output only. The globally unique ID of the policy to be bound.
        +   * 
        + * + * string policy_uid = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The policyUid. + */ + java.lang.String getPolicyUid(); + + /** + * + * + *
        +   * Output only. The globally unique ID of the policy to be bound.
        +   * 
        + * + * string policy_uid = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for policyUid. + */ + com.google.protobuf.ByteString getPolicyUidBytes(); + + /** + * + * + *
        +   * Optional. The condition to apply to the policy binding. When set, the
        +   * `expression` field in the `Expr` must include from 1 to 10 subexpressions,
        +   * joined by the
        +   * "||"(Logical OR), "&&"(Logical AND) or "!"(Logical NOT) operators and
        +   * cannot contain more than 250 characters.
        +   *
        +   * The condition is currently only supported when bound to policies of kind
        +   * principal access boundary.
        +   *
        +   * When the bound policy is a principal access boundary policy, the only
        +   * supported attributes in any subexpression are `principal.type` and
        +   * `principal.subject`. An example expression is: "principal.type ==
        +   * 'iam.googleapis.com/ServiceAccount'" or "principal.subject ==
        +   * 'bob@example.com'".
        +   *
        +   * Allowed operations for `principal.subject`:
        +   *
        +   * - `principal.subject == <principal subject string>`
        +   * - `principal.subject != <principal subject string>`
        +   * - `principal.subject in [<list of principal subjects>]`
        +   * - `principal.subject.startsWith(<string>)`
        +   * - `principal.subject.endsWith(<string>)`
        +   *
        +   * Allowed operations for `principal.type`:
        +   *
        +   * - `principal.type == <principal type string>`
        +   * - `principal.type != <principal type string>`
        +   * - `principal.type in [<list of principal types>]`
        +   *
        +   * Supported principal types are Workspace, Workforce Pool, Workload Pool and
        +   * Service Account. Allowed string must be one of:
        +   *
        +   * - iam.googleapis.com/WorkspaceIdentity
        +   * - iam.googleapis.com/WorkforcePoolIdentity
        +   * - iam.googleapis.com/WorkloadPoolIdentity
        +   * - iam.googleapis.com/ServiceAccount
        +   * 
        + * + * .google.type.Expr condition = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return Whether the condition field is set. + */ + boolean hasCondition(); + + /** + * + * + *
        +   * Optional. The condition to apply to the policy binding. When set, the
        +   * `expression` field in the `Expr` must include from 1 to 10 subexpressions,
        +   * joined by the
        +   * "||"(Logical OR), "&&"(Logical AND) or "!"(Logical NOT) operators and
        +   * cannot contain more than 250 characters.
        +   *
        +   * The condition is currently only supported when bound to policies of kind
        +   * principal access boundary.
        +   *
        +   * When the bound policy is a principal access boundary policy, the only
        +   * supported attributes in any subexpression are `principal.type` and
        +   * `principal.subject`. An example expression is: "principal.type ==
        +   * 'iam.googleapis.com/ServiceAccount'" or "principal.subject ==
        +   * 'bob@example.com'".
        +   *
        +   * Allowed operations for `principal.subject`:
        +   *
        +   * - `principal.subject == <principal subject string>`
        +   * - `principal.subject != <principal subject string>`
        +   * - `principal.subject in [<list of principal subjects>]`
        +   * - `principal.subject.startsWith(<string>)`
        +   * - `principal.subject.endsWith(<string>)`
        +   *
        +   * Allowed operations for `principal.type`:
        +   *
        +   * - `principal.type == <principal type string>`
        +   * - `principal.type != <principal type string>`
        +   * - `principal.type in [<list of principal types>]`
        +   *
        +   * Supported principal types are Workspace, Workforce Pool, Workload Pool and
        +   * Service Account. Allowed string must be one of:
        +   *
        +   * - iam.googleapis.com/WorkspaceIdentity
        +   * - iam.googleapis.com/WorkforcePoolIdentity
        +   * - iam.googleapis.com/WorkloadPoolIdentity
        +   * - iam.googleapis.com/ServiceAccount
        +   * 
        + * + * .google.type.Expr condition = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The condition. + */ + com.google.type.Expr getCondition(); + + /** + * + * + *
        +   * Optional. The condition to apply to the policy binding. When set, the
        +   * `expression` field in the `Expr` must include from 1 to 10 subexpressions,
        +   * joined by the
        +   * "||"(Logical OR), "&&"(Logical AND) or "!"(Logical NOT) operators and
        +   * cannot contain more than 250 characters.
        +   *
        +   * The condition is currently only supported when bound to policies of kind
        +   * principal access boundary.
        +   *
        +   * When the bound policy is a principal access boundary policy, the only
        +   * supported attributes in any subexpression are `principal.type` and
        +   * `principal.subject`. An example expression is: "principal.type ==
        +   * 'iam.googleapis.com/ServiceAccount'" or "principal.subject ==
        +   * 'bob@example.com'".
        +   *
        +   * Allowed operations for `principal.subject`:
        +   *
        +   * - `principal.subject == <principal subject string>`
        +   * - `principal.subject != <principal subject string>`
        +   * - `principal.subject in [<list of principal subjects>]`
        +   * - `principal.subject.startsWith(<string>)`
        +   * - `principal.subject.endsWith(<string>)`
        +   *
        +   * Allowed operations for `principal.type`:
        +   *
        +   * - `principal.type == <principal type string>`
        +   * - `principal.type != <principal type string>`
        +   * - `principal.type in [<list of principal types>]`
        +   *
        +   * Supported principal types are Workspace, Workforce Pool, Workload Pool and
        +   * Service Account. Allowed string must be one of:
        +   *
        +   * - iam.googleapis.com/WorkspaceIdentity
        +   * - iam.googleapis.com/WorkforcePoolIdentity
        +   * - iam.googleapis.com/WorkloadPoolIdentity
        +   * - iam.googleapis.com/ServiceAccount
        +   * 
        + * + * .google.type.Expr condition = 8 [(.google.api.field_behavior) = OPTIONAL]; + */ + com.google.type.ExprOrBuilder getConditionOrBuilder(); + + /** + * + * + *
        +   * Output only. The time when the policy binding was created.
        +   * 
        + * + * .google.protobuf.Timestamp create_time = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the createTime field is set. + */ + boolean hasCreateTime(); + + /** + * + * + *
        +   * Output only. The time when the policy binding was created.
        +   * 
        + * + * .google.protobuf.Timestamp create_time = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The createTime. + */ + com.google.protobuf.Timestamp getCreateTime(); + + /** + * + * + *
        +   * Output only. The time when the policy binding was created.
        +   * 
        + * + * .google.protobuf.Timestamp create_time = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder(); + + /** + * + * + *
        +   * Output only. The time when the policy binding was most recently updated.
        +   * 
        + * + * .google.protobuf.Timestamp update_time = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the updateTime field is set. + */ + boolean hasUpdateTime(); + + /** + * + * + *
        +   * Output only. The time when the policy binding was most recently updated.
        +   * 
        + * + * .google.protobuf.Timestamp update_time = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The updateTime. + */ + com.google.protobuf.Timestamp getUpdateTime(); + + /** + * + * + *
        +   * Output only. The time when the policy binding was most recently updated.
        +   * 
        + * + * .google.protobuf.Timestamp update_time = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder(); +} diff --git a/java-iam/proto-google-iam-v3beta/src/main/java/com/google/iam/v3beta/PolicyBindingResourcesProto.java b/java-iam/proto-google-iam-v3beta/src/main/java/com/google/iam/v3beta/PolicyBindingResourcesProto.java new file mode 100644 index 0000000000..a103e75d10 --- /dev/null +++ b/java-iam/proto-google-iam-v3beta/src/main/java/com/google/iam/v3beta/PolicyBindingResourcesProto.java @@ -0,0 +1,165 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/iam/v3beta/policy_binding_resources.proto +// Protobuf Java Version: 4.33.2 + +package com.google.iam.v3beta; + +@com.google.protobuf.Generated +public final class PolicyBindingResourcesProto extends com.google.protobuf.GeneratedFile { + private PolicyBindingResourcesProto() {} + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "PolicyBindingResourcesProto"); + } + + 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_iam_v3beta_PolicyBinding_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_iam_v3beta_PolicyBinding_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_iam_v3beta_PolicyBinding_Target_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_iam_v3beta_PolicyBinding_Target_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_iam_v3beta_PolicyBinding_AnnotationsEntry_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_iam_v3beta_PolicyBinding_AnnotationsEntry_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" + + "0google/iam/v3beta/policy_binding_resou" + + "rces.proto\022\021google.iam.v3beta\032\037google/ap" + + "i/field_behavior.proto\032\033google/api/field" + + "_info.proto\032\031google/api/resource.proto\032\037" + + "google/protobuf/timestamp.proto\032\026google/type/expr.proto\"\342\007\n\r" + + "PolicyBinding\022\021\n" + + "\004name\030\001 \001(\tB\003\340A\010\022\030\n" + + "\003uid\030\002 \001(\tB\013\340A\003\342\214\317\327\010\002\010\001\022\021\n" + + "\004etag\030\003 \001(\tB\003\340A\001\022\031\n" + + "\014display_name\030\004 \001(\tB\003\340A\001\022K\n" + + "\013annotations\030\005 \003(\01321.google.iam.v" + + "3beta.PolicyBinding.AnnotationsEntryB\003\340A\001\022?\n" + + "\006target\030\006" + + " \001(\0132\'.google.iam.v3beta.PolicyBinding.TargetB\006\340A\005\340A\002\022E\n" + + "\013policy_kind\030\013" + + " \001(\0162+.google.iam.v3beta.PolicyBinding.PolicyKindB\003\340A\005\022\026\n" + + "\006policy\030\007 \001(\tB\006\340A\005\340A\002\022\027\n\n" + + "policy_uid\030\014 \001(\tB\003\340A\003\022)\n" + + "\tcondition\030\010 \001(\0132\021.google.type.ExprB\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\0320\n" + + "\006Target\022\034\n\r" + + "principal_set\030\001 \001(\tB\003\340A\005H\000B\010\n" + + "\006target\0322\n" + + "\020AnnotationsEntry\022\013\n" + + "\003key\030\001 \001(\t\022\r\n" + + "\005value\030\002 \001(\t:\0028\001\"H\n\n" + + "PolicyKind\022\033\n" + + "\027POLICY_KIND_UNSPECIFIED\020\000\022\035\n" + + "\031PRINCIPAL_ACCESS_BOUNDARY\020\001:\250\002\352A\244\002\n" + + " iam.googleapis.com/PolicyBinding\022Qorganizations/{organization}/locations/{loca" + + "tion}/policyBindings/{policy_binding}\022Efolders/{folder}/locations/{location}/pol" + + "icyBindings/{policy_binding}\022Gprojects/{" + + "project}/locations/{location}/policyBindings/{policy_binding}*\016policyBindings2\r" + + "policyBindingB\231\001\n" + + "\025com.google.iam.v3betaB\033PolicyBindingResourcesProtoP\001Z-cloud.goo" + + "gle.com/go/iam/apiv3beta/iampb;iampb\252\002\027G" + + "oogle.Cloud.Iam.V3Beta\312\002\027Google\\Cloud\\Iam\\V3betab\006proto3" + }; + descriptor = + com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( + descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + com.google.api.FieldBehaviorProto.getDescriptor(), + com.google.api.FieldInfoProto.getDescriptor(), + com.google.api.ResourceProto.getDescriptor(), + com.google.protobuf.TimestampProto.getDescriptor(), + com.google.type.ExprProto.getDescriptor(), + }); + internal_static_google_iam_v3beta_PolicyBinding_descriptor = getDescriptor().getMessageType(0); + internal_static_google_iam_v3beta_PolicyBinding_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_iam_v3beta_PolicyBinding_descriptor, + new java.lang.String[] { + "Name", + "Uid", + "Etag", + "DisplayName", + "Annotations", + "Target", + "PolicyKind", + "Policy", + "PolicyUid", + "Condition", + "CreateTime", + "UpdateTime", + }); + internal_static_google_iam_v3beta_PolicyBinding_Target_descriptor = + internal_static_google_iam_v3beta_PolicyBinding_descriptor.getNestedType(0); + internal_static_google_iam_v3beta_PolicyBinding_Target_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_iam_v3beta_PolicyBinding_Target_descriptor, + new java.lang.String[] { + "PrincipalSet", "Target", + }); + internal_static_google_iam_v3beta_PolicyBinding_AnnotationsEntry_descriptor = + internal_static_google_iam_v3beta_PolicyBinding_descriptor.getNestedType(1); + internal_static_google_iam_v3beta_PolicyBinding_AnnotationsEntry_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_iam_v3beta_PolicyBinding_AnnotationsEntry_descriptor, + new java.lang.String[] { + "Key", "Value", + }); + descriptor.resolveAllFeaturesImmutable(); + com.google.api.FieldBehaviorProto.getDescriptor(); + com.google.api.FieldInfoProto.getDescriptor(); + com.google.api.ResourceProto.getDescriptor(); + com.google.protobuf.TimestampProto.getDescriptor(); + com.google.type.ExprProto.getDescriptor(); + com.google.protobuf.ExtensionRegistry registry = + com.google.protobuf.ExtensionRegistry.newInstance(); + registry.add(com.google.api.FieldBehaviorProto.fieldBehavior); + registry.add(com.google.api.FieldInfoProto.fieldInfo); + registry.add(com.google.api.ResourceProto.resource); + com.google.protobuf.Descriptors.FileDescriptor.internalUpdateFileDescriptor( + descriptor, registry); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/java-iam/proto-google-iam-v3beta/src/main/java/com/google/iam/v3beta/PolicyBindingsServiceProto.java b/java-iam/proto-google-iam-v3beta/src/main/java/com/google/iam/v3beta/PolicyBindingsServiceProto.java new file mode 100644 index 0000000000..51de0ef394 --- /dev/null +++ b/java-iam/proto-google-iam-v3beta/src/main/java/com/google/iam/v3beta/PolicyBindingsServiceProto.java @@ -0,0 +1,286 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/iam/v3beta/policy_bindings_service.proto +// Protobuf Java Version: 4.33.2 + +package com.google.iam.v3beta; + +@com.google.protobuf.Generated +public final class PolicyBindingsServiceProto extends com.google.protobuf.GeneratedFile { + private PolicyBindingsServiceProto() {} + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "PolicyBindingsServiceProto"); + } + + 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_iam_v3beta_CreatePolicyBindingRequest_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_iam_v3beta_CreatePolicyBindingRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_iam_v3beta_GetPolicyBindingRequest_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_iam_v3beta_GetPolicyBindingRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_iam_v3beta_UpdatePolicyBindingRequest_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_iam_v3beta_UpdatePolicyBindingRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_iam_v3beta_DeletePolicyBindingRequest_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_iam_v3beta_DeletePolicyBindingRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_iam_v3beta_ListPolicyBindingsRequest_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_iam_v3beta_ListPolicyBindingsRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_iam_v3beta_ListPolicyBindingsResponse_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_iam_v3beta_ListPolicyBindingsResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_iam_v3beta_SearchTargetPolicyBindingsRequest_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_iam_v3beta_SearchTargetPolicyBindingsRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_iam_v3beta_SearchTargetPolicyBindingsResponse_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_iam_v3beta_SearchTargetPolicyBindingsResponse_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/iam/v3beta/policy_bindings_serv" + + "ice.proto\022\021google.iam.v3beta\032\034google/api" + + "/annotations.proto\032\027google/api/client.pr" + + "oto\032\037google/api/field_behavior.proto\032\031go" + + "ogle/api/resource.proto\032*google/iam/v3beta/operation_metadata.proto\0320google/iam/" + + "v3beta/policy_binding_resources.proto\032#g" + + "oogle/longrunning/operations.proto\032\033google/protobuf/empty.proto\032" + + " google/protobuf/field_mask.proto\"\321\001\n" + + "\032CreatePolicyBindingRequest\0228\n" + + "\006parent\030\001 \001(\tB(\340A\002\372A\"\022" + + " iam.googleapis.com/PolicyBinding\022\036\n" + + "\021policy_binding_id\030\002 \001(\tB\003\340A\002\022=\n" + + "\016policy_binding\030\003 \001(\0132" + + " .google.iam.v3beta.PolicyBindingB\003\340A\002\022\032\n\r" + + "validate_only\030\004 \001(\010B\003\340A\001\"Q\n" + + "\027GetPolicyBindingRequest\0226\n" + + "\004name\030\001 \001(\tB(\340A\002\372A\"\n" + + " iam.googleapis.com/PolicyBinding\"\255\001\n" + + "\032UpdatePolicyBindingRequest\022=\n" + + "\016policy_binding\030\001 \001(\0132" + + " .google.iam.v3beta.PolicyBindingB\003\340A\002\022\032\n\r" + + "validate_only\030\002 \001(\010B\003\340A\001\0224\n" + + "\013update_mask\030\003" + + " \001(\0132\032.google.protobuf.FieldMaskB\003\340A\001\"\203\001\n" + + "\032DeletePolicyBindingRequest\0226\n" + + "\004name\030\001 \001(\tB(\340A\002\372A\"\n" + + " iam.googleapis.com/PolicyBinding\022\021\n" + + "\004etag\030\002 \001(\tB\003\340A\001\022\032\n\r" + + "validate_only\030\003 \001(\010B\003\340A\001\"\233\001\n" + + "\031ListPolicyBindingsRequest\0228\n" + + "\006parent\030\001 \001(\tB(\340A\002\372A\"\022" + + " iam.googleapis.com/PolicyBinding\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\022\023\n" + + "\006filter\030\004 \001(\tB\003\340A\001\"u\n" + + "\032ListPolicyBindingsResponse\0229\n" + + "\017policy_bindings\030\001 \003(\0132 .google.iam.v3beta.PolicyBinding\022\034\n" + + "\017next_page_token\030\002 \001(\tB\003\340A\001\"\243\001\n" + + "!SearchTargetPolicyBindingsRequest\022\023\n" + + "\006target\030\001 \001(\tB\003\340A\002\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\0228\n" + + "\006parent\030\005 \001(\tB(\340A\002\372A\"\022 iam.googleapis.com/PolicyBinding\"}\n" + + "\"SearchTargetPolicyBindingsResponse\0229\n" + + "\017policy_bindings\030\001 \003(\0132 .google.iam.v3beta.PolicyBinding\022\034\n" + + "\017next_page_token\030\002 \001(\tB\003\340A\0012\214\022\n" + + "\016PolicyBindings\022\234\003\n" + + "\023CreatePolicyBinding\022-.go" + + "ogle.iam.v3beta.CreatePolicyBindingRequest\032\035.google.longrunning.Operation\"\266\002\312A\"\n" + + "\r" + + "PolicyBinding\022\021OperationMetadata\332A\'pare" + + "nt,policy_binding,policy_binding_id\202\323\344\223\002" + + "\340\001\"6/v3beta/{parent=projects/*/locations" + + "/*}/policyBindings:\016policy_bindingZG\"5/v3beta/{parent=folders/*/locations/*}/pol" + + "icyBindings:\016policy_bindingZM\";/v3beta/{" + + "parent=organizations/*/locations/*}/policyBindings:\016policy_binding\022\241\002\n" + + "\020GetPolicyBinding\022*.google.iam.v3beta.GetPolicyBindingRequest\032" + + " .google.iam.v3beta.PolicyBi" + + "nding\"\276\001\332A\004name\202\323\344\223\002\260\001\0226/v3beta/{name=pr" + + "ojects/*/locations/*/policyBindings/*}Z7\0225/v3beta/{name=folders/*/locations/*/po" + + "licyBindings/*}Z=\022;/v3beta/{name=organiz" + + "ations/*/locations/*/policyBindings/*}\022\274\003\n" + + "\023UpdatePolicyBinding\022-.google.iam.v3be" + + "ta.UpdatePolicyBindingRequest\032\035.google.longrunning.Operation\"\326\002\312A\"\n\r" + + "PolicyBinding\022\021OperationMetadata\332A\032policy_binding,up" + + "date_mask\202\323\344\223\002\215\0022E/v3beta/{policy_bindin" + + "g.name=projects/*/locations/*/policyBindings/*}:\016policy_bindingZV2D/v3beta/{poli" + + "cy_binding.name=folders/*/locations/*/policyBindings/*}:\016policy_bindingZ\\2J/v3be" + + "ta/{policy_binding.name=organizations/*/" + + "locations/*/policyBindings/*}:\016policy_binding\022\321\002\n" + + "\023DeletePolicyBinding\022-.google.i" + + "am.v3beta.DeletePolicyBindingRequest\032\035.google.longrunning.Operation\"\353\001\312A*\n" + + "\025google.protobuf.Empty\022\021OperationMetadata\332A\004na" + + "me\202\323\344\223\002\260\001*6/v3beta/{name=projects/*/loca" + + "tions/*/policyBindings/*}Z7*5/v3beta/{name=folders/*/locations/*/policyBindings/" + + "*}Z=*;/v3beta/{name=organizations/*/locations/*/policyBindings/*}\022\264\002\n" + + "\022ListPolicyBindings\022,.google.iam.v3beta.ListPolicyB" + + "indingsRequest\032-.google.iam.v3beta.ListP" + + "olicyBindingsResponse\"\300\001\332A\006parent\202\323\344\223\002\260\001" + + "\0226/v3beta/{parent=projects/*/locations/*}/policyBindingsZ7\0225/v3beta/{parent=fold" + + "ers/*/locations/*}/policyBindingsZ=\022;/v3" + + "beta/{parent=organizations/*/locations/*}/policyBindings\022\244\003\n" + + "\032SearchTargetPolicyBindings\0224.google.iam.v3beta.SearchTarget" + + "PolicyBindingsRequest\0325.google.iam.v3bet" + + "a.SearchTargetPolicyBindingsResponse\"\230\002\332A\r" + + "parent,target\202\323\344\223\002\201\002\022Q/v3beta/{parent=" + + "projects/*/locations/*}/policyBindings:searchTargetPolicyBindingsZR\022P/v3beta/{pa" + + "rent=folders/*/locations/*}/policyBindings:searchTargetPolicyBindingsZX\022V/v3beta" + + "/{parent=organizations/*/locations/*}/policyBindings:searchTargetPolicyBindings\032" + + "F\312A\022iam.googleapis.com\322A.https://www.googleapis.com/auth/cloud-platformB\304\002\n" + + "\025com.google.iam.v3betaB\032PolicyBindingsService" + + "ProtoP\001Z-cloud.google.com/go/iam/apiv3be" + + "ta/iampb;iampb\252\002\027Google.Cloud.Iam.V3Beta\312\002\027Google\\Cloud\\Iam\\V3beta\352A\\\n" + + "\'iam.googleapis.com/OrganizationLocation\0221organiza" + + "tions/{organization}/locations/{location}\352AJ\n" + + "!iam.googleapis.com/FolderLocation\022%folders/{folder}/locations/{location}b\006" + + "proto3" + }; + 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.iam.v3beta.OperationMetadataProto.getDescriptor(), + com.google.iam.v3beta.PolicyBindingResourcesProto.getDescriptor(), + com.google.longrunning.OperationsProto.getDescriptor(), + com.google.protobuf.EmptyProto.getDescriptor(), + com.google.protobuf.FieldMaskProto.getDescriptor(), + }); + internal_static_google_iam_v3beta_CreatePolicyBindingRequest_descriptor = + getDescriptor().getMessageType(0); + internal_static_google_iam_v3beta_CreatePolicyBindingRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_iam_v3beta_CreatePolicyBindingRequest_descriptor, + new java.lang.String[] { + "Parent", "PolicyBindingId", "PolicyBinding", "ValidateOnly", + }); + internal_static_google_iam_v3beta_GetPolicyBindingRequest_descriptor = + getDescriptor().getMessageType(1); + internal_static_google_iam_v3beta_GetPolicyBindingRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_iam_v3beta_GetPolicyBindingRequest_descriptor, + new java.lang.String[] { + "Name", + }); + internal_static_google_iam_v3beta_UpdatePolicyBindingRequest_descriptor = + getDescriptor().getMessageType(2); + internal_static_google_iam_v3beta_UpdatePolicyBindingRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_iam_v3beta_UpdatePolicyBindingRequest_descriptor, + new java.lang.String[] { + "PolicyBinding", "ValidateOnly", "UpdateMask", + }); + internal_static_google_iam_v3beta_DeletePolicyBindingRequest_descriptor = + getDescriptor().getMessageType(3); + internal_static_google_iam_v3beta_DeletePolicyBindingRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_iam_v3beta_DeletePolicyBindingRequest_descriptor, + new java.lang.String[] { + "Name", "Etag", "ValidateOnly", + }); + internal_static_google_iam_v3beta_ListPolicyBindingsRequest_descriptor = + getDescriptor().getMessageType(4); + internal_static_google_iam_v3beta_ListPolicyBindingsRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_iam_v3beta_ListPolicyBindingsRequest_descriptor, + new java.lang.String[] { + "Parent", "PageSize", "PageToken", "Filter", + }); + internal_static_google_iam_v3beta_ListPolicyBindingsResponse_descriptor = + getDescriptor().getMessageType(5); + internal_static_google_iam_v3beta_ListPolicyBindingsResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_iam_v3beta_ListPolicyBindingsResponse_descriptor, + new java.lang.String[] { + "PolicyBindings", "NextPageToken", + }); + internal_static_google_iam_v3beta_SearchTargetPolicyBindingsRequest_descriptor = + getDescriptor().getMessageType(6); + internal_static_google_iam_v3beta_SearchTargetPolicyBindingsRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_iam_v3beta_SearchTargetPolicyBindingsRequest_descriptor, + new java.lang.String[] { + "Target", "PageSize", "PageToken", "Parent", + }); + internal_static_google_iam_v3beta_SearchTargetPolicyBindingsResponse_descriptor = + getDescriptor().getMessageType(7); + internal_static_google_iam_v3beta_SearchTargetPolicyBindingsResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_iam_v3beta_SearchTargetPolicyBindingsResponse_descriptor, + new java.lang.String[] { + "PolicyBindings", "NextPageToken", + }); + descriptor.resolveAllFeaturesImmutable(); + com.google.api.AnnotationsProto.getDescriptor(); + com.google.api.ClientProto.getDescriptor(); + com.google.api.FieldBehaviorProto.getDescriptor(); + com.google.api.ResourceProto.getDescriptor(); + com.google.iam.v3beta.OperationMetadataProto.getDescriptor(); + com.google.iam.v3beta.PolicyBindingResourcesProto.getDescriptor(); + com.google.longrunning.OperationsProto.getDescriptor(); + com.google.protobuf.EmptyProto.getDescriptor(); + com.google.protobuf.FieldMaskProto.getDescriptor(); + 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.resourceDefinition); + registry.add(com.google.api.ResourceProto.resourceReference); + registry.add(com.google.longrunning.OperationsProto.operationInfo); + com.google.protobuf.Descriptors.FileDescriptor.internalUpdateFileDescriptor( + descriptor, registry); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/java-iam/proto-google-iam-v3beta/src/main/java/com/google/iam/v3beta/PrincipalAccessBoundaryPoliciesServiceProto.java b/java-iam/proto-google-iam-v3beta/src/main/java/com/google/iam/v3beta/PrincipalAccessBoundaryPoliciesServiceProto.java new file mode 100644 index 0000000000..a661d6c0a5 --- /dev/null +++ b/java-iam/proto-google-iam-v3beta/src/main/java/com/google/iam/v3beta/PrincipalAccessBoundaryPoliciesServiceProto.java @@ -0,0 +1,296 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/iam/v3beta/principal_access_boundary_policies_service.proto +// Protobuf Java Version: 4.33.2 + +package com.google.iam.v3beta; + +@com.google.protobuf.Generated +public final class PrincipalAccessBoundaryPoliciesServiceProto + extends com.google.protobuf.GeneratedFile { + private PrincipalAccessBoundaryPoliciesServiceProto() {} + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "PrincipalAccessBoundaryPoliciesServiceProto"); + } + + 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_iam_v3beta_CreatePrincipalAccessBoundaryPolicyRequest_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_iam_v3beta_CreatePrincipalAccessBoundaryPolicyRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_iam_v3beta_GetPrincipalAccessBoundaryPolicyRequest_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_iam_v3beta_GetPrincipalAccessBoundaryPolicyRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_iam_v3beta_UpdatePrincipalAccessBoundaryPolicyRequest_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_iam_v3beta_UpdatePrincipalAccessBoundaryPolicyRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_iam_v3beta_DeletePrincipalAccessBoundaryPolicyRequest_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_iam_v3beta_DeletePrincipalAccessBoundaryPolicyRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_iam_v3beta_ListPrincipalAccessBoundaryPoliciesRequest_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_iam_v3beta_ListPrincipalAccessBoundaryPoliciesRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_iam_v3beta_ListPrincipalAccessBoundaryPoliciesResponse_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_iam_v3beta_ListPrincipalAccessBoundaryPoliciesResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_iam_v3beta_SearchPrincipalAccessBoundaryPolicyBindingsRequest_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_iam_v3beta_SearchPrincipalAccessBoundaryPolicyBindingsRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_iam_v3beta_SearchPrincipalAccessBoundaryPolicyBindingsResponse_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_iam_v3beta_SearchPrincipalAccessBoundaryPolicyBindingsResponse_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + return descriptor; + } + + private static com.google.protobuf.Descriptors.FileDescriptor descriptor; + + static { + java.lang.String[] descriptorData = { + "\nBgoogle/iam/v3beta/principal_access_bou" + + "ndary_policies_service.proto\022\021google.iam" + + ".v3beta\032\034google/api/annotations.proto\032\027g" + + "oogle/api/client.proto\032\037google/api/field" + + "_behavior.proto\032\031google/api/resource.pro" + + "to\032*google/iam/v3beta/operation_metadata" + + ".proto\0320google/iam/v3beta/policy_binding" + + "_resources.proto\032Bgoogle/iam/v3beta/prin" + + "cipal_access_boundary_policy_resources.p" + + "roto\032#google/longrunning/operations.prot" + + "o\032\033google/protobuf/empty.proto\032 google/p" + + "rotobuf/field_mask.proto\"\245\002\n*CreatePrinc" + + "ipalAccessBoundaryPolicyRequest\022H\n\006paren" + + "t\030\001 \001(\tB8\340A\002\372A2\0220iam.googleapis.com/Prin" + + "cipalAccessBoundaryPolicy\0220\n#principal_a" + + "ccess_boundary_policy_id\030\002 \001(\tB\003\340A\002\022_\n p" + + "rincipal_access_boundary_policy\030\003 \001(\01320." + + "google.iam.v3beta.PrincipalAccessBoundar" + + "yPolicyB\003\340A\002\022\032\n\rvalidate_only\030\004 \001(\010B\003\340A\001" + + "\"q\n\'GetPrincipalAccessBoundaryPolicyRequ" + + "est\022F\n\004name\030\001 \001(\tB8\340A\002\372A2\n0iam.googleapi" + + "s.com/PrincipalAccessBoundaryPolicy\"\337\001\n*" + + "UpdatePrincipalAccessBoundaryPolicyReque" + + "st\022_\n principal_access_boundary_policy\030\001" + + " \001(\01320.google.iam.v3beta.PrincipalAccess" + + "BoundaryPolicyB\003\340A\002\022\032\n\rvalidate_only\030\002 \001" + + "(\010B\003\340A\001\0224\n\013update_mask\030\003 \001(\0132\032.google.pr" + + "otobuf.FieldMaskB\003\340A\001\"\267\001\n*DeletePrincipa" + + "lAccessBoundaryPolicyRequest\022F\n\004name\030\001 \001" + + "(\tB8\340A\002\372A2\n0iam.googleapis.com/Principal" + + "AccessBoundaryPolicy\022\021\n\004etag\030\002 \001(\tB\003\340A\001\022" + + "\032\n\rvalidate_only\030\003 \001(\010B\003\340A\001\022\022\n\005force\030\004 \001" + + "(\010B\003\340A\001\"\247\001\n*ListPrincipalAccessBoundaryP" + + "oliciesRequest\022H\n\006parent\030\001 \001(\tB8\340A\002\372A2\0220" + + "iam.googleapis.com/PrincipalAccessBounda" + + "ryPolicy\022\026\n\tpage_size\030\002 \001(\005B\003\340A\001\022\027\n\npage" + + "_token\030\003 \001(\tB\003\340A\001\"\251\001\n+ListPrincipalAcces" + + "sBoundaryPoliciesResponse\022\\\n\"principal_a" + + "ccess_boundary_policies\030\001 \003(\01320.google.i" + + "am.v3beta.PrincipalAccessBoundaryPolicy\022" + + "\034\n\017next_page_token\030\002 \001(\tB\003\340A\001\"\255\001\n2Search" + + "PrincipalAccessBoundaryPolicyBindingsReq" + + "uest\022F\n\004name\030\001 \001(\tB8\340A\002\372A2\n0iam.googleap" + + "is.com/PrincipalAccessBoundaryPolicy\022\026\n\t" + + "page_size\030\003 \001(\005B\003\340A\001\022\027\n\npage_token\030\004 \001(\t" + + "B\003\340A\001\"\216\001\n3SearchPrincipalAccessBoundaryP" + + "olicyBindingsResponse\0229\n\017policy_bindings" + + "\030\001 \003(\0132 .google.iam.v3beta.PolicyBinding" + + "\022\034\n\017next_page_token\030\002 \001(\tB\003\340A\0012\250\017\n\037Princ" + + "ipalAccessBoundaryPolicies\022\377\002\n#CreatePri" + + "ncipalAccessBoundaryPolicy\022=.google.iam." + + "v3beta.CreatePrincipalAccessBoundaryPoli" + + "cyRequest\032\035.google.longrunning.Operation" + + "\"\371\001\312A2\n\035PrincipalAccessBoundaryPolicy\022\021O" + + "perationMetadata\332AKparent,principal_acce" + + "ss_boundary_policy,principal_access_boun" + + "dary_policy_id\202\323\344\223\002p\"L/v3beta/{parent=or" + + "ganizations/*/locations/*}/principalAcce" + + "ssBoundaryPolicies: principal_access_bou" + + "ndary_policy\022\355\001\n GetPrincipalAccessBound" + + "aryPolicy\022:.google.iam.v3beta.GetPrincip" + + "alAccessBoundaryPolicyRequest\0320.google.i" + + "am.v3beta.PrincipalAccessBoundaryPolicy\"" + + "[\332A\004name\202\323\344\223\002N\022L/v3beta/{name=organizati" + + "ons/*/locations/*/principalAccessBoundar" + + "yPolicies/*}\022\202\003\n#UpdatePrincipalAccessBo" + + "undaryPolicy\022=.google.iam.v3beta.UpdateP" + + "rincipalAccessBoundaryPolicyRequest\032\035.go" + + "ogle.longrunning.Operation\"\374\001\312A2\n\035Princi" + + "palAccessBoundaryPolicy\022\021OperationMetada" + + "ta\332A,principal_access_boundary_policy,up" + + "date_mask\202\323\344\223\002\221\0012m/v3beta/{principal_acc" + + "ess_boundary_policy.name=organizations/*" + + "/locations/*/principalAccessBoundaryPoli" + + "cies/*}: principal_access_boundary_polic" + + "y\022\216\002\n#DeletePrincipalAccessBoundaryPolic" + + "y\022=.google.iam.v3beta.DeletePrincipalAcc" + + "essBoundaryPolicyRequest\032\035.google.longru" + + "nning.Operation\"\210\001\312A*\n\025google.protobuf.E" + + "mpty\022\021OperationMetadata\332A\004name\202\323\344\223\002N*L/v" + + "3beta/{name=organizations/*/locations/*/" + + "principalAccessBoundaryPolicies/*}\022\203\002\n#L" + + "istPrincipalAccessBoundaryPolicies\022=.goo" + + "gle.iam.v3beta.ListPrincipalAccessBounda" + + "ryPoliciesRequest\032>.google.iam.v3beta.Li" + + "stPrincipalAccessBoundaryPoliciesRespons" + + "e\"]\332A\006parent\202\323\344\223\002N\022L/v3beta/{parent=orga" + + "nizations/*/locations/*}/principalAccess" + + "BoundaryPolicies\022\256\002\n+SearchPrincipalAcce" + + "ssBoundaryPolicyBindings\022E.google.iam.v3" + + "beta.SearchPrincipalAccessBoundaryPolicy" + + "BindingsRequest\032F.google.iam.v3beta.Sear" + + "chPrincipalAccessBoundaryPolicyBindingsR" + + "esponse\"p\332A\004name\202\323\344\223\002c\022a/v3beta/{name=or" + + "ganizations/*/locations/*/principalAcces" + + "sBoundaryPolicies/*}:searchPolicyBinding" + + "s\032F\312A\022iam.googleapis.com\322A.https://www.g" + + "oogleapis.com/auth/cloud-platformB\251\001\n\025co" + + "m.google.iam.v3betaB+PrincipalAccessBoun" + + "daryPoliciesServiceProtoP\001Z-cloud.google" + + ".com/go/iam/apiv3beta/iampb;iampb\252\002\027Goog" + + "le.Cloud.Iam.V3Beta\312\002\027Google\\Cloud\\Iam\\V" + + "3betab\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.iam.v3beta.OperationMetadataProto.getDescriptor(), + com.google.iam.v3beta.PolicyBindingResourcesProto.getDescriptor(), + com.google.iam.v3beta.PrincipalAccessBoundaryPolicyResourcesProto.getDescriptor(), + com.google.longrunning.OperationsProto.getDescriptor(), + com.google.protobuf.EmptyProto.getDescriptor(), + com.google.protobuf.FieldMaskProto.getDescriptor(), + }); + internal_static_google_iam_v3beta_CreatePrincipalAccessBoundaryPolicyRequest_descriptor = + getDescriptor().getMessageType(0); + internal_static_google_iam_v3beta_CreatePrincipalAccessBoundaryPolicyRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_iam_v3beta_CreatePrincipalAccessBoundaryPolicyRequest_descriptor, + new java.lang.String[] { + "Parent", + "PrincipalAccessBoundaryPolicyId", + "PrincipalAccessBoundaryPolicy", + "ValidateOnly", + }); + internal_static_google_iam_v3beta_GetPrincipalAccessBoundaryPolicyRequest_descriptor = + getDescriptor().getMessageType(1); + internal_static_google_iam_v3beta_GetPrincipalAccessBoundaryPolicyRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_iam_v3beta_GetPrincipalAccessBoundaryPolicyRequest_descriptor, + new java.lang.String[] { + "Name", + }); + internal_static_google_iam_v3beta_UpdatePrincipalAccessBoundaryPolicyRequest_descriptor = + getDescriptor().getMessageType(2); + internal_static_google_iam_v3beta_UpdatePrincipalAccessBoundaryPolicyRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_iam_v3beta_UpdatePrincipalAccessBoundaryPolicyRequest_descriptor, + new java.lang.String[] { + "PrincipalAccessBoundaryPolicy", "ValidateOnly", "UpdateMask", + }); + internal_static_google_iam_v3beta_DeletePrincipalAccessBoundaryPolicyRequest_descriptor = + getDescriptor().getMessageType(3); + internal_static_google_iam_v3beta_DeletePrincipalAccessBoundaryPolicyRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_iam_v3beta_DeletePrincipalAccessBoundaryPolicyRequest_descriptor, + new java.lang.String[] { + "Name", "Etag", "ValidateOnly", "Force", + }); + internal_static_google_iam_v3beta_ListPrincipalAccessBoundaryPoliciesRequest_descriptor = + getDescriptor().getMessageType(4); + internal_static_google_iam_v3beta_ListPrincipalAccessBoundaryPoliciesRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_iam_v3beta_ListPrincipalAccessBoundaryPoliciesRequest_descriptor, + new java.lang.String[] { + "Parent", "PageSize", "PageToken", + }); + internal_static_google_iam_v3beta_ListPrincipalAccessBoundaryPoliciesResponse_descriptor = + getDescriptor().getMessageType(5); + internal_static_google_iam_v3beta_ListPrincipalAccessBoundaryPoliciesResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_iam_v3beta_ListPrincipalAccessBoundaryPoliciesResponse_descriptor, + new java.lang.String[] { + "PrincipalAccessBoundaryPolicies", "NextPageToken", + }); + internal_static_google_iam_v3beta_SearchPrincipalAccessBoundaryPolicyBindingsRequest_descriptor = + getDescriptor().getMessageType(6); + internal_static_google_iam_v3beta_SearchPrincipalAccessBoundaryPolicyBindingsRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_iam_v3beta_SearchPrincipalAccessBoundaryPolicyBindingsRequest_descriptor, + new java.lang.String[] { + "Name", "PageSize", "PageToken", + }); + internal_static_google_iam_v3beta_SearchPrincipalAccessBoundaryPolicyBindingsResponse_descriptor = + getDescriptor().getMessageType(7); + internal_static_google_iam_v3beta_SearchPrincipalAccessBoundaryPolicyBindingsResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_iam_v3beta_SearchPrincipalAccessBoundaryPolicyBindingsResponse_descriptor, + new java.lang.String[] { + "PolicyBindings", "NextPageToken", + }); + descriptor.resolveAllFeaturesImmutable(); + com.google.api.AnnotationsProto.getDescriptor(); + com.google.api.ClientProto.getDescriptor(); + com.google.api.FieldBehaviorProto.getDescriptor(); + com.google.api.ResourceProto.getDescriptor(); + com.google.iam.v3beta.OperationMetadataProto.getDescriptor(); + com.google.iam.v3beta.PolicyBindingResourcesProto.getDescriptor(); + com.google.iam.v3beta.PrincipalAccessBoundaryPolicyResourcesProto.getDescriptor(); + com.google.longrunning.OperationsProto.getDescriptor(); + com.google.protobuf.EmptyProto.getDescriptor(); + com.google.protobuf.FieldMaskProto.getDescriptor(); + 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); + registry.add(com.google.longrunning.OperationsProto.operationInfo); + com.google.protobuf.Descriptors.FileDescriptor.internalUpdateFileDescriptor( + descriptor, registry); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/java-iam/proto-google-iam-v3beta/src/main/java/com/google/iam/v3beta/PrincipalAccessBoundaryPolicy.java b/java-iam/proto-google-iam-v3beta/src/main/java/com/google/iam/v3beta/PrincipalAccessBoundaryPolicy.java new file mode 100644 index 0000000000..5ce805dc04 --- /dev/null +++ b/java-iam/proto-google-iam-v3beta/src/main/java/com/google/iam/v3beta/PrincipalAccessBoundaryPolicy.java @@ -0,0 +1,2544 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/iam/v3beta/principal_access_boundary_policy_resources.proto +// Protobuf Java Version: 4.33.2 + +package com.google.iam.v3beta; + +/** + * + * + *
        + * An IAM principal access boundary policy resource.
        + * 
        + * + * Protobuf type {@code google.iam.v3beta.PrincipalAccessBoundaryPolicy} + */ +@com.google.protobuf.Generated +public final class PrincipalAccessBoundaryPolicy extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.iam.v3beta.PrincipalAccessBoundaryPolicy) + PrincipalAccessBoundaryPolicyOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "PrincipalAccessBoundaryPolicy"); + } + + // Use PrincipalAccessBoundaryPolicy.newBuilder() to construct. + private PrincipalAccessBoundaryPolicy(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private PrincipalAccessBoundaryPolicy() { + name_ = ""; + uid_ = ""; + etag_ = ""; + displayName_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.iam.v3beta.PrincipalAccessBoundaryPolicyResourcesProto + .internal_static_google_iam_v3beta_PrincipalAccessBoundaryPolicy_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + @java.lang.Override + protected com.google.protobuf.MapFieldReflectionAccessor internalGetMapFieldReflection( + int number) { + switch (number) { + case 5: + return internalGetAnnotations(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.iam.v3beta.PrincipalAccessBoundaryPolicyResourcesProto + .internal_static_google_iam_v3beta_PrincipalAccessBoundaryPolicy_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.iam.v3beta.PrincipalAccessBoundaryPolicy.class, + com.google.iam.v3beta.PrincipalAccessBoundaryPolicy.Builder.class); + } + + private int bitField0_; + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + + /** + * + * + *
        +   * Identifier. The resource name of the principal access boundary policy.
        +   *
        +   * The following format is supported:
        +   * `organizations/{organization_id}/locations/{location}/principalAccessBoundaryPolicies/{policy_id}`
        +   * 
        + * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @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; + } + } + + /** + * + * + *
        +   * Identifier. The resource name of the principal access boundary policy.
        +   *
        +   * The following format is supported:
        +   * `organizations/{organization_id}/locations/{location}/principalAccessBoundaryPolicies/{policy_id}`
        +   * 
        + * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @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 UID_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object uid_ = ""; + + /** + * + * + *
        +   * Output only. The globally unique ID of the principal access boundary
        +   * policy.
        +   * 
        + * + * + * string uid = 2 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_info) = { ... } + * + * + * @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; + } + } + + /** + * + * + *
        +   * Output only. The globally unique ID of the principal access boundary
        +   * policy.
        +   * 
        + * + * + * string uid = 2 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_info) = { ... } + * + * + * @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 ETAG_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object etag_ = ""; + + /** + * + * + *
        +   * Optional. The etag for the principal access boundary.
        +   * If this is provided on update, it must match the server's etag.
        +   * 
        + * + * string etag = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The etag. + */ + @java.lang.Override + public java.lang.String getEtag() { + java.lang.Object ref = etag_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + etag_ = s; + return s; + } + } + + /** + * + * + *
        +   * Optional. The etag for the principal access boundary.
        +   * If this is provided on update, it must match the server's etag.
        +   * 
        + * + * string etag = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for etag. + */ + @java.lang.Override + public com.google.protobuf.ByteString getEtagBytes() { + java.lang.Object ref = etag_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + etag_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int DISPLAY_NAME_FIELD_NUMBER = 4; + + @SuppressWarnings("serial") + private volatile java.lang.Object displayName_ = ""; + + /** + * + * + *
        +   * Optional. The description of the principal access boundary policy. Must be
        +   * less than or equal to 63 characters.
        +   * 
        + * + * string display_name = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The displayName. + */ + @java.lang.Override + public java.lang.String getDisplayName() { + java.lang.Object ref = displayName_; + 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(); + displayName_ = s; + return s; + } + } + + /** + * + * + *
        +   * Optional. The description of the principal access boundary policy. Must be
        +   * less than or equal to 63 characters.
        +   * 
        + * + * string display_name = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for displayName. + */ + @java.lang.Override + public com.google.protobuf.ByteString getDisplayNameBytes() { + java.lang.Object ref = displayName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + displayName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int ANNOTATIONS_FIELD_NUMBER = 5; + + private static final class AnnotationsDefaultEntryHolder { + static final com.google.protobuf.MapEntry defaultEntry = + com.google.protobuf.MapEntry.newDefaultInstance( + com.google.iam.v3beta.PrincipalAccessBoundaryPolicyResourcesProto + .internal_static_google_iam_v3beta_PrincipalAccessBoundaryPolicy_AnnotationsEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.STRING, + ""); + } + + @SuppressWarnings("serial") + private com.google.protobuf.MapField annotations_; + + private com.google.protobuf.MapField + internalGetAnnotations() { + if (annotations_ == null) { + return com.google.protobuf.MapField.emptyMapField(AnnotationsDefaultEntryHolder.defaultEntry); + } + return annotations_; + } + + public int getAnnotationsCount() { + return internalGetAnnotations().getMap().size(); + } + + /** + * + * + *
        +   * Optional. User defined annotations. See
        +   * https://google.aip.dev/148#annotations for more details such as format and
        +   * size limitations
        +   * 
        + * + * map<string, string> annotations = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public boolean containsAnnotations(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + return internalGetAnnotations().getMap().containsKey(key); + } + + /** Use {@link #getAnnotationsMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getAnnotations() { + return getAnnotationsMap(); + } + + /** + * + * + *
        +   * Optional. User defined annotations. See
        +   * https://google.aip.dev/148#annotations for more details such as format and
        +   * size limitations
        +   * 
        + * + * map<string, string> annotations = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public java.util.Map getAnnotationsMap() { + return internalGetAnnotations().getMap(); + } + + /** + * + * + *
        +   * Optional. User defined annotations. See
        +   * https://google.aip.dev/148#annotations for more details such as format and
        +   * size limitations
        +   * 
        + * + * map<string, string> annotations = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public /* nullable */ java.lang.String getAnnotationsOrDefault( + java.lang.String key, + /* nullable */ + java.lang.String defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetAnnotations().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + + /** + * + * + *
        +   * Optional. User defined annotations. See
        +   * https://google.aip.dev/148#annotations for more details such as format and
        +   * size limitations
        +   * 
        + * + * map<string, string> annotations = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public java.lang.String getAnnotationsOrThrow(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetAnnotations().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public static final int CREATE_TIME_FIELD_NUMBER = 6; + private com.google.protobuf.Timestamp createTime_; + + /** + * + * + *
        +   * Output only. The time when the principal access boundary policy was
        +   * created.
        +   * 
        + * + * .google.protobuf.Timestamp create_time = 6 [(.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 time when the principal access boundary policy was
        +   * created.
        +   * 
        + * + * .google.protobuf.Timestamp create_time = 6 [(.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 time when the principal access boundary policy was
        +   * created.
        +   * 
        + * + * .google.protobuf.Timestamp create_time = 6 [(.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 = 7; + private com.google.protobuf.Timestamp updateTime_; + + /** + * + * + *
        +   * Output only. The time when the principal access boundary policy was most
        +   * recently updated.
        +   * 
        + * + * .google.protobuf.Timestamp update_time = 7 [(.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 time when the principal access boundary policy was most
        +   * recently updated.
        +   * 
        + * + * .google.protobuf.Timestamp update_time = 7 [(.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 time when the principal access boundary policy was most
        +   * recently updated.
        +   * 
        + * + * .google.protobuf.Timestamp update_time = 7 [(.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 DETAILS_FIELD_NUMBER = 8; + private com.google.iam.v3beta.PrincipalAccessBoundaryPolicyDetails details_; + + /** + * + * + *
        +   * Optional. The details for the principal access boundary policy.
        +   * 
        + * + * + * .google.iam.v3beta.PrincipalAccessBoundaryPolicyDetails details = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the details field is set. + */ + @java.lang.Override + public boolean hasDetails() { + return ((bitField0_ & 0x00000004) != 0); + } + + /** + * + * + *
        +   * Optional. The details for the principal access boundary policy.
        +   * 
        + * + * + * .google.iam.v3beta.PrincipalAccessBoundaryPolicyDetails details = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The details. + */ + @java.lang.Override + public com.google.iam.v3beta.PrincipalAccessBoundaryPolicyDetails getDetails() { + return details_ == null + ? com.google.iam.v3beta.PrincipalAccessBoundaryPolicyDetails.getDefaultInstance() + : details_; + } + + /** + * + * + *
        +   * Optional. The details for the principal access boundary policy.
        +   * 
        + * + * + * .google.iam.v3beta.PrincipalAccessBoundaryPolicyDetails details = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.iam.v3beta.PrincipalAccessBoundaryPolicyDetailsOrBuilder getDetailsOrBuilder() { + return details_ == null + ? com.google.iam.v3beta.PrincipalAccessBoundaryPolicyDetails.getDefaultInstance() + : details_; + } + + 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.GeneratedMessage.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, name_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(uid_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, uid_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(etag_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 3, etag_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(displayName_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 4, displayName_); + } + com.google.protobuf.GeneratedMessage.serializeStringMapTo( + output, internalGetAnnotations(), AnnotationsDefaultEntryHolder.defaultEntry, 5); + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(6, getCreateTime()); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeMessage(7, getUpdateTime()); + } + if (((bitField0_ & 0x00000004) != 0)) { + output.writeMessage(8, getDetails()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, name_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(uid_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, uid_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(etag_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(3, etag_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(displayName_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(4, displayName_); + } + for (java.util.Map.Entry entry : + internalGetAnnotations().getMap().entrySet()) { + com.google.protobuf.MapEntry annotations__ = + AnnotationsDefaultEntryHolder.defaultEntry + .newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream.computeMessageSize(5, annotations__); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(6, getCreateTime()); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(7, getUpdateTime()); + } + if (((bitField0_ & 0x00000004) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(8, getDetails()); + } + 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.iam.v3beta.PrincipalAccessBoundaryPolicy)) { + return super.equals(obj); + } + com.google.iam.v3beta.PrincipalAccessBoundaryPolicy other = + (com.google.iam.v3beta.PrincipalAccessBoundaryPolicy) obj; + + if (!getName().equals(other.getName())) return false; + if (!getUid().equals(other.getUid())) return false; + if (!getEtag().equals(other.getEtag())) return false; + if (!getDisplayName().equals(other.getDisplayName())) return false; + if (!internalGetAnnotations().equals(other.internalGetAnnotations())) 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 (hasDetails() != other.hasDetails()) return false; + if (hasDetails()) { + if (!getDetails().equals(other.getDetails())) 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) + UID_FIELD_NUMBER; + hash = (53 * hash) + getUid().hashCode(); + hash = (37 * hash) + ETAG_FIELD_NUMBER; + hash = (53 * hash) + getEtag().hashCode(); + hash = (37 * hash) + DISPLAY_NAME_FIELD_NUMBER; + hash = (53 * hash) + getDisplayName().hashCode(); + if (!internalGetAnnotations().getMap().isEmpty()) { + hash = (37 * hash) + ANNOTATIONS_FIELD_NUMBER; + hash = (53 * hash) + internalGetAnnotations().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(); + } + if (hasDetails()) { + hash = (37 * hash) + DETAILS_FIELD_NUMBER; + hash = (53 * hash) + getDetails().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.iam.v3beta.PrincipalAccessBoundaryPolicy parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.iam.v3beta.PrincipalAccessBoundaryPolicy parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.iam.v3beta.PrincipalAccessBoundaryPolicy parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.iam.v3beta.PrincipalAccessBoundaryPolicy 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.iam.v3beta.PrincipalAccessBoundaryPolicy parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.iam.v3beta.PrincipalAccessBoundaryPolicy parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.iam.v3beta.PrincipalAccessBoundaryPolicy parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.iam.v3beta.PrincipalAccessBoundaryPolicy parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.iam.v3beta.PrincipalAccessBoundaryPolicy parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.iam.v3beta.PrincipalAccessBoundaryPolicy parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.iam.v3beta.PrincipalAccessBoundaryPolicy parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.iam.v3beta.PrincipalAccessBoundaryPolicy parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.iam.v3beta.PrincipalAccessBoundaryPolicy 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
        +   * An IAM principal access boundary policy resource.
        +   * 
        + * + * Protobuf type {@code google.iam.v3beta.PrincipalAccessBoundaryPolicy} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.iam.v3beta.PrincipalAccessBoundaryPolicy) + com.google.iam.v3beta.PrincipalAccessBoundaryPolicyOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.iam.v3beta.PrincipalAccessBoundaryPolicyResourcesProto + .internal_static_google_iam_v3beta_PrincipalAccessBoundaryPolicy_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapFieldReflectionAccessor internalGetMapFieldReflection( + int number) { + switch (number) { + case 5: + return internalGetAnnotations(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapFieldReflectionAccessor internalGetMutableMapFieldReflection( + int number) { + switch (number) { + case 5: + return internalGetMutableAnnotations(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.iam.v3beta.PrincipalAccessBoundaryPolicyResourcesProto + .internal_static_google_iam_v3beta_PrincipalAccessBoundaryPolicy_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.iam.v3beta.PrincipalAccessBoundaryPolicy.class, + com.google.iam.v3beta.PrincipalAccessBoundaryPolicy.Builder.class); + } + + // Construct using com.google.iam.v3beta.PrincipalAccessBoundaryPolicy.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetCreateTimeFieldBuilder(); + internalGetUpdateTimeFieldBuilder(); + internalGetDetailsFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + uid_ = ""; + etag_ = ""; + displayName_ = ""; + internalGetMutableAnnotations().clear(); + createTime_ = null; + if (createTimeBuilder_ != null) { + createTimeBuilder_.dispose(); + createTimeBuilder_ = null; + } + updateTime_ = null; + if (updateTimeBuilder_ != null) { + updateTimeBuilder_.dispose(); + updateTimeBuilder_ = null; + } + details_ = null; + if (detailsBuilder_ != null) { + detailsBuilder_.dispose(); + detailsBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.iam.v3beta.PrincipalAccessBoundaryPolicyResourcesProto + .internal_static_google_iam_v3beta_PrincipalAccessBoundaryPolicy_descriptor; + } + + @java.lang.Override + public com.google.iam.v3beta.PrincipalAccessBoundaryPolicy getDefaultInstanceForType() { + return com.google.iam.v3beta.PrincipalAccessBoundaryPolicy.getDefaultInstance(); + } + + @java.lang.Override + public com.google.iam.v3beta.PrincipalAccessBoundaryPolicy build() { + com.google.iam.v3beta.PrincipalAccessBoundaryPolicy result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.iam.v3beta.PrincipalAccessBoundaryPolicy buildPartial() { + com.google.iam.v3beta.PrincipalAccessBoundaryPolicy result = + new com.google.iam.v3beta.PrincipalAccessBoundaryPolicy(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.iam.v3beta.PrincipalAccessBoundaryPolicy result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.uid_ = uid_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.etag_ = etag_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.displayName_ = displayName_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.annotations_ = internalGetAnnotations(); + result.annotations_.makeImmutable(); + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000020) != 0)) { + result.createTime_ = createTimeBuilder_ == null ? createTime_ : createTimeBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000040) != 0)) { + result.updateTime_ = updateTimeBuilder_ == null ? updateTime_ : updateTimeBuilder_.build(); + to_bitField0_ |= 0x00000002; + } + if (((from_bitField0_ & 0x00000080) != 0)) { + result.details_ = detailsBuilder_ == null ? details_ : detailsBuilder_.build(); + to_bitField0_ |= 0x00000004; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.iam.v3beta.PrincipalAccessBoundaryPolicy) { + return mergeFrom((com.google.iam.v3beta.PrincipalAccessBoundaryPolicy) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.iam.v3beta.PrincipalAccessBoundaryPolicy other) { + if (other == com.google.iam.v3beta.PrincipalAccessBoundaryPolicy.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getUid().isEmpty()) { + uid_ = other.uid_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (!other.getEtag().isEmpty()) { + etag_ = other.etag_; + bitField0_ |= 0x00000004; + onChanged(); + } + if (!other.getDisplayName().isEmpty()) { + displayName_ = other.displayName_; + bitField0_ |= 0x00000008; + onChanged(); + } + internalGetMutableAnnotations().mergeFrom(other.internalGetAnnotations()); + bitField0_ |= 0x00000010; + if (other.hasCreateTime()) { + mergeCreateTime(other.getCreateTime()); + } + if (other.hasUpdateTime()) { + mergeUpdateTime(other.getUpdateTime()); + } + if (other.hasDetails()) { + mergeDetails(other.getDetails()); + } + 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: + { + uid_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + etag_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 34: + { + displayName_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000008; + break; + } // case 34 + case 42: + { + com.google.protobuf.MapEntry annotations__ = + input.readMessage( + AnnotationsDefaultEntryHolder.defaultEntry.getParserForType(), + extensionRegistry); + internalGetMutableAnnotations() + .getMutableMap() + .put(annotations__.getKey(), annotations__.getValue()); + bitField0_ |= 0x00000010; + break; + } // case 42 + case 50: + { + input.readMessage( + internalGetCreateTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000020; + break; + } // case 50 + case 58: + { + input.readMessage( + internalGetUpdateTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000040; + break; + } // case 58 + case 66: + { + input.readMessage(internalGetDetailsFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000080; + 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 name_ = ""; + + /** + * + * + *
        +     * Identifier. The resource name of the principal access boundary policy.
        +     *
        +     * The following format is supported:
        +     * `organizations/{organization_id}/locations/{location}/principalAccessBoundaryPolicies/{policy_id}`
        +     * 
        + * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @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; + } + } + + /** + * + * + *
        +     * Identifier. The resource name of the principal access boundary policy.
        +     *
        +     * The following format is supported:
        +     * `organizations/{organization_id}/locations/{location}/principalAccessBoundaryPolicies/{policy_id}`
        +     * 
        + * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @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; + } + } + + /** + * + * + *
        +     * Identifier. The resource name of the principal access boundary policy.
        +     *
        +     * The following format is supported:
        +     * `organizations/{organization_id}/locations/{location}/principalAccessBoundaryPolicies/{policy_id}`
        +     * 
        + * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @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; + } + + /** + * + * + *
        +     * Identifier. The resource name of the principal access boundary policy.
        +     *
        +     * The following format is supported:
        +     * `organizations/{organization_id}/locations/{location}/principalAccessBoundaryPolicies/{policy_id}`
        +     * 
        + * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
        +     * Identifier. The resource name of the principal access boundary policy.
        +     *
        +     * The following format is supported:
        +     * `organizations/{organization_id}/locations/{location}/principalAccessBoundaryPolicies/{policy_id}`
        +     * 
        + * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @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 uid_ = ""; + + /** + * + * + *
        +     * Output only. The globally unique ID of the principal access boundary
        +     * policy.
        +     * 
        + * + * + * string uid = 2 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_info) = { ... } + * + * + * @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; + } + } + + /** + * + * + *
        +     * Output only. The globally unique ID of the principal access boundary
        +     * policy.
        +     * 
        + * + * + * string uid = 2 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_info) = { ... } + * + * + * @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; + } + } + + /** + * + * + *
        +     * Output only. The globally unique ID of the principal access boundary
        +     * policy.
        +     * 
        + * + * + * string uid = 2 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_info) = { ... } + * + * + * @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_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
        +     * Output only. The globally unique ID of the principal access boundary
        +     * policy.
        +     * 
        + * + * + * string uid = 2 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_info) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearUid() { + uid_ = getDefaultInstance().getUid(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
        +     * Output only. The globally unique ID of the principal access boundary
        +     * policy.
        +     * 
        + * + * + * string uid = 2 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_info) = { ... } + * + * + * @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_ |= 0x00000002; + onChanged(); + return this; + } + + private java.lang.Object etag_ = ""; + + /** + * + * + *
        +     * Optional. The etag for the principal access boundary.
        +     * If this is provided on update, it must match the server's etag.
        +     * 
        + * + * string etag = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The etag. + */ + public java.lang.String getEtag() { + java.lang.Object ref = etag_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + etag_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
        +     * Optional. The etag for the principal access boundary.
        +     * If this is provided on update, it must match the server's etag.
        +     * 
        + * + * string etag = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for etag. + */ + public com.google.protobuf.ByteString getEtagBytes() { + java.lang.Object ref = etag_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + etag_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
        +     * Optional. The etag for the principal access boundary.
        +     * If this is provided on update, it must match the server's etag.
        +     * 
        + * + * string etag = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The etag to set. + * @return This builder for chaining. + */ + public Builder setEtag(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + etag_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
        +     * Optional. The etag for the principal access boundary.
        +     * If this is provided on update, it must match the server's etag.
        +     * 
        + * + * string etag = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearEtag() { + etag_ = getDefaultInstance().getEtag(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + + /** + * + * + *
        +     * Optional. The etag for the principal access boundary.
        +     * If this is provided on update, it must match the server's etag.
        +     * 
        + * + * string etag = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for etag to set. + * @return This builder for chaining. + */ + public Builder setEtagBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + etag_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + private java.lang.Object displayName_ = ""; + + /** + * + * + *
        +     * Optional. The description of the principal access boundary policy. Must be
        +     * less than or equal to 63 characters.
        +     * 
        + * + * string display_name = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The displayName. + */ + public java.lang.String getDisplayName() { + java.lang.Object ref = displayName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + displayName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
        +     * Optional. The description of the principal access boundary policy. Must be
        +     * less than or equal to 63 characters.
        +     * 
        + * + * string display_name = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for displayName. + */ + public com.google.protobuf.ByteString getDisplayNameBytes() { + java.lang.Object ref = displayName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + displayName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
        +     * Optional. The description of the principal access boundary policy. Must be
        +     * less than or equal to 63 characters.
        +     * 
        + * + * string display_name = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The displayName to set. + * @return This builder for chaining. + */ + public Builder setDisplayName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + displayName_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + /** + * + * + *
        +     * Optional. The description of the principal access boundary policy. Must be
        +     * less than or equal to 63 characters.
        +     * 
        + * + * string display_name = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearDisplayName() { + displayName_ = getDefaultInstance().getDisplayName(); + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + return this; + } + + /** + * + * + *
        +     * Optional. The description of the principal access boundary policy. Must be
        +     * less than or equal to 63 characters.
        +     * 
        + * + * string display_name = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for displayName to set. + * @return This builder for chaining. + */ + public Builder setDisplayNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + displayName_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + private com.google.protobuf.MapField annotations_; + + private com.google.protobuf.MapField + internalGetAnnotations() { + if (annotations_ == null) { + return com.google.protobuf.MapField.emptyMapField( + AnnotationsDefaultEntryHolder.defaultEntry); + } + return annotations_; + } + + private com.google.protobuf.MapField + internalGetMutableAnnotations() { + if (annotations_ == null) { + annotations_ = + com.google.protobuf.MapField.newMapField(AnnotationsDefaultEntryHolder.defaultEntry); + } + if (!annotations_.isMutable()) { + annotations_ = annotations_.copy(); + } + bitField0_ |= 0x00000010; + onChanged(); + return annotations_; + } + + public int getAnnotationsCount() { + return internalGetAnnotations().getMap().size(); + } + + /** + * + * + *
        +     * Optional. User defined annotations. See
        +     * https://google.aip.dev/148#annotations for more details such as format and
        +     * size limitations
        +     * 
        + * + * map<string, string> annotations = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public boolean containsAnnotations(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + return internalGetAnnotations().getMap().containsKey(key); + } + + /** Use {@link #getAnnotationsMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getAnnotations() { + return getAnnotationsMap(); + } + + /** + * + * + *
        +     * Optional. User defined annotations. See
        +     * https://google.aip.dev/148#annotations for more details such as format and
        +     * size limitations
        +     * 
        + * + * map<string, string> annotations = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public java.util.Map getAnnotationsMap() { + return internalGetAnnotations().getMap(); + } + + /** + * + * + *
        +     * Optional. User defined annotations. See
        +     * https://google.aip.dev/148#annotations for more details such as format and
        +     * size limitations
        +     * 
        + * + * map<string, string> annotations = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public /* nullable */ java.lang.String getAnnotationsOrDefault( + java.lang.String key, + /* nullable */ + java.lang.String defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetAnnotations().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + + /** + * + * + *
        +     * Optional. User defined annotations. See
        +     * https://google.aip.dev/148#annotations for more details such as format and
        +     * size limitations
        +     * 
        + * + * map<string, string> annotations = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public java.lang.String getAnnotationsOrThrow(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetAnnotations().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public Builder clearAnnotations() { + bitField0_ = (bitField0_ & ~0x00000010); + internalGetMutableAnnotations().getMutableMap().clear(); + return this; + } + + /** + * + * + *
        +     * Optional. User defined annotations. See
        +     * https://google.aip.dev/148#annotations for more details such as format and
        +     * size limitations
        +     * 
        + * + * map<string, string> annotations = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder removeAnnotations(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + internalGetMutableAnnotations().getMutableMap().remove(key); + return this; + } + + /** Use alternate mutation accessors instead. */ + @java.lang.Deprecated + public java.util.Map getMutableAnnotations() { + bitField0_ |= 0x00000010; + return internalGetMutableAnnotations().getMutableMap(); + } + + /** + * + * + *
        +     * Optional. User defined annotations. See
        +     * https://google.aip.dev/148#annotations for more details such as format and
        +     * size limitations
        +     * 
        + * + * map<string, string> annotations = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder putAnnotations(java.lang.String key, java.lang.String value) { + if (key == null) { + throw new NullPointerException("map key"); + } + if (value == null) { + throw new NullPointerException("map value"); + } + internalGetMutableAnnotations().getMutableMap().put(key, value); + bitField0_ |= 0x00000010; + return this; + } + + /** + * + * + *
        +     * Optional. User defined annotations. See
        +     * https://google.aip.dev/148#annotations for more details such as format and
        +     * size limitations
        +     * 
        + * + * map<string, string> annotations = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder putAllAnnotations(java.util.Map values) { + internalGetMutableAnnotations().getMutableMap().putAll(values); + bitField0_ |= 0x00000010; + return this; + } + + private com.google.protobuf.Timestamp createTime_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + createTimeBuilder_; + + /** + * + * + *
        +     * Output only. The time when the principal access boundary policy was
        +     * created.
        +     * 
        + * + * + * .google.protobuf.Timestamp create_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the createTime field is set. + */ + public boolean hasCreateTime() { + return ((bitField0_ & 0x00000020) != 0); + } + + /** + * + * + *
        +     * Output only. The time when the principal access boundary policy was
        +     * created.
        +     * 
        + * + * + * .google.protobuf.Timestamp create_time = 6 [(.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 time when the principal access boundary policy was
        +     * created.
        +     * 
        + * + * + * .google.protobuf.Timestamp create_time = 6 [(.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_ |= 0x00000020; + onChanged(); + return this; + } + + /** + * + * + *
        +     * Output only. The time when the principal access boundary policy was
        +     * created.
        +     * 
        + * + * + * .google.protobuf.Timestamp create_time = 6 [(.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_ |= 0x00000020; + onChanged(); + return this; + } + + /** + * + * + *
        +     * Output only. The time when the principal access boundary policy was
        +     * created.
        +     * 
        + * + * + * .google.protobuf.Timestamp create_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeCreateTime(com.google.protobuf.Timestamp value) { + if (createTimeBuilder_ == null) { + if (((bitField0_ & 0x00000020) != 0) + && createTime_ != null + && createTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getCreateTimeBuilder().mergeFrom(value); + } else { + createTime_ = value; + } + } else { + createTimeBuilder_.mergeFrom(value); + } + if (createTime_ != null) { + bitField0_ |= 0x00000020; + onChanged(); + } + return this; + } + + /** + * + * + *
        +     * Output only. The time when the principal access boundary policy was
        +     * created.
        +     * 
        + * + * + * .google.protobuf.Timestamp create_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearCreateTime() { + bitField0_ = (bitField0_ & ~0x00000020); + createTime_ = null; + if (createTimeBuilder_ != null) { + createTimeBuilder_.dispose(); + createTimeBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
        +     * Output only. The time when the principal access boundary policy was
        +     * created.
        +     * 
        + * + * + * .google.protobuf.Timestamp create_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.Timestamp.Builder getCreateTimeBuilder() { + bitField0_ |= 0x00000020; + onChanged(); + return internalGetCreateTimeFieldBuilder().getBuilder(); + } + + /** + * + * + *
        +     * Output only. The time when the principal access boundary policy was
        +     * created.
        +     * 
        + * + * + * .google.protobuf.Timestamp create_time = 6 [(.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 time when the principal access boundary policy was
        +     * created.
        +     * 
        + * + * + * .google.protobuf.Timestamp create_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + internalGetCreateTimeFieldBuilder() { + if (createTimeBuilder_ == null) { + createTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + 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.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + updateTimeBuilder_; + + /** + * + * + *
        +     * Output only. The time when the principal access boundary policy was most
        +     * recently updated.
        +     * 
        + * + * + * .google.protobuf.Timestamp update_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the updateTime field is set. + */ + public boolean hasUpdateTime() { + return ((bitField0_ & 0x00000040) != 0); + } + + /** + * + * + *
        +     * Output only. The time when the principal access boundary policy was most
        +     * recently updated.
        +     * 
        + * + * + * .google.protobuf.Timestamp update_time = 7 [(.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 time when the principal access boundary policy was most
        +     * recently updated.
        +     * 
        + * + * + * .google.protobuf.Timestamp update_time = 7 [(.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_ |= 0x00000040; + onChanged(); + return this; + } + + /** + * + * + *
        +     * Output only. The time when the principal access boundary policy was most
        +     * recently updated.
        +     * 
        + * + * + * .google.protobuf.Timestamp update_time = 7 [(.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_ |= 0x00000040; + onChanged(); + return this; + } + + /** + * + * + *
        +     * Output only. The time when the principal access boundary policy was most
        +     * recently updated.
        +     * 
        + * + * + * .google.protobuf.Timestamp update_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeUpdateTime(com.google.protobuf.Timestamp value) { + if (updateTimeBuilder_ == null) { + if (((bitField0_ & 0x00000040) != 0) + && updateTime_ != null + && updateTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getUpdateTimeBuilder().mergeFrom(value); + } else { + updateTime_ = value; + } + } else { + updateTimeBuilder_.mergeFrom(value); + } + if (updateTime_ != null) { + bitField0_ |= 0x00000040; + onChanged(); + } + return this; + } + + /** + * + * + *
        +     * Output only. The time when the principal access boundary policy was most
        +     * recently updated.
        +     * 
        + * + * + * .google.protobuf.Timestamp update_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearUpdateTime() { + bitField0_ = (bitField0_ & ~0x00000040); + updateTime_ = null; + if (updateTimeBuilder_ != null) { + updateTimeBuilder_.dispose(); + updateTimeBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
        +     * Output only. The time when the principal access boundary policy was most
        +     * recently updated.
        +     * 
        + * + * + * .google.protobuf.Timestamp update_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.Timestamp.Builder getUpdateTimeBuilder() { + bitField0_ |= 0x00000040; + onChanged(); + return internalGetUpdateTimeFieldBuilder().getBuilder(); + } + + /** + * + * + *
        +     * Output only. The time when the principal access boundary policy was most
        +     * recently updated.
        +     * 
        + * + * + * .google.protobuf.Timestamp update_time = 7 [(.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 time when the principal access boundary policy was most
        +     * recently updated.
        +     * 
        + * + * + * .google.protobuf.Timestamp update_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + internalGetUpdateTimeFieldBuilder() { + if (updateTimeBuilder_ == null) { + updateTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getUpdateTime(), getParentForChildren(), isClean()); + updateTime_ = null; + } + return updateTimeBuilder_; + } + + private com.google.iam.v3beta.PrincipalAccessBoundaryPolicyDetails details_; + private com.google.protobuf.SingleFieldBuilder< + com.google.iam.v3beta.PrincipalAccessBoundaryPolicyDetails, + com.google.iam.v3beta.PrincipalAccessBoundaryPolicyDetails.Builder, + com.google.iam.v3beta.PrincipalAccessBoundaryPolicyDetailsOrBuilder> + detailsBuilder_; + + /** + * + * + *
        +     * Optional. The details for the principal access boundary policy.
        +     * 
        + * + * + * .google.iam.v3beta.PrincipalAccessBoundaryPolicyDetails details = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the details field is set. + */ + public boolean hasDetails() { + return ((bitField0_ & 0x00000080) != 0); + } + + /** + * + * + *
        +     * Optional. The details for the principal access boundary policy.
        +     * 
        + * + * + * .google.iam.v3beta.PrincipalAccessBoundaryPolicyDetails details = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The details. + */ + public com.google.iam.v3beta.PrincipalAccessBoundaryPolicyDetails getDetails() { + if (detailsBuilder_ == null) { + return details_ == null + ? com.google.iam.v3beta.PrincipalAccessBoundaryPolicyDetails.getDefaultInstance() + : details_; + } else { + return detailsBuilder_.getMessage(); + } + } + + /** + * + * + *
        +     * Optional. The details for the principal access boundary policy.
        +     * 
        + * + * + * .google.iam.v3beta.PrincipalAccessBoundaryPolicyDetails details = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setDetails(com.google.iam.v3beta.PrincipalAccessBoundaryPolicyDetails value) { + if (detailsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + details_ = value; + } else { + detailsBuilder_.setMessage(value); + } + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + + /** + * + * + *
        +     * Optional. The details for the principal access boundary policy.
        +     * 
        + * + * + * .google.iam.v3beta.PrincipalAccessBoundaryPolicyDetails details = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setDetails( + com.google.iam.v3beta.PrincipalAccessBoundaryPolicyDetails.Builder builderForValue) { + if (detailsBuilder_ == null) { + details_ = builderForValue.build(); + } else { + detailsBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + + /** + * + * + *
        +     * Optional. The details for the principal access boundary policy.
        +     * 
        + * + * + * .google.iam.v3beta.PrincipalAccessBoundaryPolicyDetails details = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder mergeDetails(com.google.iam.v3beta.PrincipalAccessBoundaryPolicyDetails value) { + if (detailsBuilder_ == null) { + if (((bitField0_ & 0x00000080) != 0) + && details_ != null + && details_ + != com.google.iam.v3beta.PrincipalAccessBoundaryPolicyDetails + .getDefaultInstance()) { + getDetailsBuilder().mergeFrom(value); + } else { + details_ = value; + } + } else { + detailsBuilder_.mergeFrom(value); + } + if (details_ != null) { + bitField0_ |= 0x00000080; + onChanged(); + } + return this; + } + + /** + * + * + *
        +     * Optional. The details for the principal access boundary policy.
        +     * 
        + * + * + * .google.iam.v3beta.PrincipalAccessBoundaryPolicyDetails details = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder clearDetails() { + bitField0_ = (bitField0_ & ~0x00000080); + details_ = null; + if (detailsBuilder_ != null) { + detailsBuilder_.dispose(); + detailsBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
        +     * Optional. The details for the principal access boundary policy.
        +     * 
        + * + * + * .google.iam.v3beta.PrincipalAccessBoundaryPolicyDetails details = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.iam.v3beta.PrincipalAccessBoundaryPolicyDetails.Builder getDetailsBuilder() { + bitField0_ |= 0x00000080; + onChanged(); + return internalGetDetailsFieldBuilder().getBuilder(); + } + + /** + * + * + *
        +     * Optional. The details for the principal access boundary policy.
        +     * 
        + * + * + * .google.iam.v3beta.PrincipalAccessBoundaryPolicyDetails details = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.iam.v3beta.PrincipalAccessBoundaryPolicyDetailsOrBuilder + getDetailsOrBuilder() { + if (detailsBuilder_ != null) { + return detailsBuilder_.getMessageOrBuilder(); + } else { + return details_ == null + ? com.google.iam.v3beta.PrincipalAccessBoundaryPolicyDetails.getDefaultInstance() + : details_; + } + } + + /** + * + * + *
        +     * Optional. The details for the principal access boundary policy.
        +     * 
        + * + * + * .google.iam.v3beta.PrincipalAccessBoundaryPolicyDetails details = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.iam.v3beta.PrincipalAccessBoundaryPolicyDetails, + com.google.iam.v3beta.PrincipalAccessBoundaryPolicyDetails.Builder, + com.google.iam.v3beta.PrincipalAccessBoundaryPolicyDetailsOrBuilder> + internalGetDetailsFieldBuilder() { + if (detailsBuilder_ == null) { + detailsBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.iam.v3beta.PrincipalAccessBoundaryPolicyDetails, + com.google.iam.v3beta.PrincipalAccessBoundaryPolicyDetails.Builder, + com.google.iam.v3beta.PrincipalAccessBoundaryPolicyDetailsOrBuilder>( + getDetails(), getParentForChildren(), isClean()); + details_ = null; + } + return detailsBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.iam.v3beta.PrincipalAccessBoundaryPolicy) + } + + // @@protoc_insertion_point(class_scope:google.iam.v3beta.PrincipalAccessBoundaryPolicy) + private static final com.google.iam.v3beta.PrincipalAccessBoundaryPolicy DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.iam.v3beta.PrincipalAccessBoundaryPolicy(); + } + + public static com.google.iam.v3beta.PrincipalAccessBoundaryPolicy getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public PrincipalAccessBoundaryPolicy 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.iam.v3beta.PrincipalAccessBoundaryPolicy getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-iam/proto-google-iam-v3beta/src/main/java/com/google/iam/v3beta/PrincipalAccessBoundaryPolicyDetails.java b/java-iam/proto-google-iam-v3beta/src/main/java/com/google/iam/v3beta/PrincipalAccessBoundaryPolicyDetails.java new file mode 100644 index 0000000000..36b99f2670 --- /dev/null +++ b/java-iam/proto-google-iam-v3beta/src/main/java/com/google/iam/v3beta/PrincipalAccessBoundaryPolicyDetails.java @@ -0,0 +1,1225 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/iam/v3beta/principal_access_boundary_policy_resources.proto +// Protobuf Java Version: 4.33.2 + +package com.google.iam.v3beta; + +/** + * + * + *
        + * Principal access boundary policy details
        + * 
        + * + * Protobuf type {@code google.iam.v3beta.PrincipalAccessBoundaryPolicyDetails} + */ +@com.google.protobuf.Generated +public final class PrincipalAccessBoundaryPolicyDetails extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.iam.v3beta.PrincipalAccessBoundaryPolicyDetails) + PrincipalAccessBoundaryPolicyDetailsOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "PrincipalAccessBoundaryPolicyDetails"); + } + + // Use PrincipalAccessBoundaryPolicyDetails.newBuilder() to construct. + private PrincipalAccessBoundaryPolicyDetails( + com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private PrincipalAccessBoundaryPolicyDetails() { + rules_ = java.util.Collections.emptyList(); + enforcementVersion_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.iam.v3beta.PrincipalAccessBoundaryPolicyResourcesProto + .internal_static_google_iam_v3beta_PrincipalAccessBoundaryPolicyDetails_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.iam.v3beta.PrincipalAccessBoundaryPolicyResourcesProto + .internal_static_google_iam_v3beta_PrincipalAccessBoundaryPolicyDetails_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.iam.v3beta.PrincipalAccessBoundaryPolicyDetails.class, + com.google.iam.v3beta.PrincipalAccessBoundaryPolicyDetails.Builder.class); + } + + public static final int RULES_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private java.util.List rules_; + + /** + * + * + *
        +   * Required. A list of principal access boundary policy rules. The number of
        +   * rules in a policy is limited to 500.
        +   * 
        + * + * + * repeated .google.iam.v3beta.PrincipalAccessBoundaryPolicyRule rules = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public java.util.List getRulesList() { + return rules_; + } + + /** + * + * + *
        +   * Required. A list of principal access boundary policy rules. The number of
        +   * rules in a policy is limited to 500.
        +   * 
        + * + * + * repeated .google.iam.v3beta.PrincipalAccessBoundaryPolicyRule rules = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public java.util.List + getRulesOrBuilderList() { + return rules_; + } + + /** + * + * + *
        +   * Required. A list of principal access boundary policy rules. The number of
        +   * rules in a policy is limited to 500.
        +   * 
        + * + * + * repeated .google.iam.v3beta.PrincipalAccessBoundaryPolicyRule rules = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public int getRulesCount() { + return rules_.size(); + } + + /** + * + * + *
        +   * Required. A list of principal access boundary policy rules. The number of
        +   * rules in a policy is limited to 500.
        +   * 
        + * + * + * repeated .google.iam.v3beta.PrincipalAccessBoundaryPolicyRule rules = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.iam.v3beta.PrincipalAccessBoundaryPolicyRule getRules(int index) { + return rules_.get(index); + } + + /** + * + * + *
        +   * Required. A list of principal access boundary policy rules. The number of
        +   * rules in a policy is limited to 500.
        +   * 
        + * + * + * repeated .google.iam.v3beta.PrincipalAccessBoundaryPolicyRule rules = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.iam.v3beta.PrincipalAccessBoundaryPolicyRuleOrBuilder getRulesOrBuilder( + int index) { + return rules_.get(index); + } + + public static final int ENFORCEMENT_VERSION_FIELD_NUMBER = 4; + + @SuppressWarnings("serial") + private volatile java.lang.Object enforcementVersion_ = ""; + + /** + * + * + *
        +   * Optional.
        +   * The version number (for example, `1` or `latest`) that indicates which
        +   * permissions are able to be blocked by the policy. If empty, the PAB policy
        +   * version will be set to the most recent version number at the time of the
        +   * policy's creation.
        +   * 
        + * + * string enforcement_version = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The enforcementVersion. + */ + @java.lang.Override + public java.lang.String getEnforcementVersion() { + java.lang.Object ref = enforcementVersion_; + 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(); + enforcementVersion_ = s; + return s; + } + } + + /** + * + * + *
        +   * Optional.
        +   * The version number (for example, `1` or `latest`) that indicates which
        +   * permissions are able to be blocked by the policy. If empty, the PAB policy
        +   * version will be set to the most recent version number at the time of the
        +   * policy's creation.
        +   * 
        + * + * string enforcement_version = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for enforcementVersion. + */ + @java.lang.Override + public com.google.protobuf.ByteString getEnforcementVersionBytes() { + java.lang.Object ref = enforcementVersion_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + enforcementVersion_ = 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 < rules_.size(); i++) { + output.writeMessage(1, rules_.get(i)); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(enforcementVersion_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 4, enforcementVersion_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < rules_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, rules_.get(i)); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(enforcementVersion_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(4, enforcementVersion_); + } + 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.iam.v3beta.PrincipalAccessBoundaryPolicyDetails)) { + return super.equals(obj); + } + com.google.iam.v3beta.PrincipalAccessBoundaryPolicyDetails other = + (com.google.iam.v3beta.PrincipalAccessBoundaryPolicyDetails) obj; + + if (!getRulesList().equals(other.getRulesList())) return false; + if (!getEnforcementVersion().equals(other.getEnforcementVersion())) 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 (getRulesCount() > 0) { + hash = (37 * hash) + RULES_FIELD_NUMBER; + hash = (53 * hash) + getRulesList().hashCode(); + } + hash = (37 * hash) + ENFORCEMENT_VERSION_FIELD_NUMBER; + hash = (53 * hash) + getEnforcementVersion().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.iam.v3beta.PrincipalAccessBoundaryPolicyDetails parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.iam.v3beta.PrincipalAccessBoundaryPolicyDetails parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.iam.v3beta.PrincipalAccessBoundaryPolicyDetails parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.iam.v3beta.PrincipalAccessBoundaryPolicyDetails 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.iam.v3beta.PrincipalAccessBoundaryPolicyDetails parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.iam.v3beta.PrincipalAccessBoundaryPolicyDetails parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.iam.v3beta.PrincipalAccessBoundaryPolicyDetails parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.iam.v3beta.PrincipalAccessBoundaryPolicyDetails parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.iam.v3beta.PrincipalAccessBoundaryPolicyDetails parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.iam.v3beta.PrincipalAccessBoundaryPolicyDetails parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.iam.v3beta.PrincipalAccessBoundaryPolicyDetails parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.iam.v3beta.PrincipalAccessBoundaryPolicyDetails parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.iam.v3beta.PrincipalAccessBoundaryPolicyDetails 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
        +   * Principal access boundary policy details
        +   * 
        + * + * Protobuf type {@code google.iam.v3beta.PrincipalAccessBoundaryPolicyDetails} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.iam.v3beta.PrincipalAccessBoundaryPolicyDetails) + com.google.iam.v3beta.PrincipalAccessBoundaryPolicyDetailsOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.iam.v3beta.PrincipalAccessBoundaryPolicyResourcesProto + .internal_static_google_iam_v3beta_PrincipalAccessBoundaryPolicyDetails_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.iam.v3beta.PrincipalAccessBoundaryPolicyResourcesProto + .internal_static_google_iam_v3beta_PrincipalAccessBoundaryPolicyDetails_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.iam.v3beta.PrincipalAccessBoundaryPolicyDetails.class, + com.google.iam.v3beta.PrincipalAccessBoundaryPolicyDetails.Builder.class); + } + + // Construct using com.google.iam.v3beta.PrincipalAccessBoundaryPolicyDetails.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (rulesBuilder_ == null) { + rules_ = java.util.Collections.emptyList(); + } else { + rules_ = null; + rulesBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + enforcementVersion_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.iam.v3beta.PrincipalAccessBoundaryPolicyResourcesProto + .internal_static_google_iam_v3beta_PrincipalAccessBoundaryPolicyDetails_descriptor; + } + + @java.lang.Override + public com.google.iam.v3beta.PrincipalAccessBoundaryPolicyDetails getDefaultInstanceForType() { + return com.google.iam.v3beta.PrincipalAccessBoundaryPolicyDetails.getDefaultInstance(); + } + + @java.lang.Override + public com.google.iam.v3beta.PrincipalAccessBoundaryPolicyDetails build() { + com.google.iam.v3beta.PrincipalAccessBoundaryPolicyDetails result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.iam.v3beta.PrincipalAccessBoundaryPolicyDetails buildPartial() { + com.google.iam.v3beta.PrincipalAccessBoundaryPolicyDetails result = + new com.google.iam.v3beta.PrincipalAccessBoundaryPolicyDetails(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields( + com.google.iam.v3beta.PrincipalAccessBoundaryPolicyDetails result) { + if (rulesBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + rules_ = java.util.Collections.unmodifiableList(rules_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.rules_ = rules_; + } else { + result.rules_ = rulesBuilder_.build(); + } + } + + private void buildPartial0(com.google.iam.v3beta.PrincipalAccessBoundaryPolicyDetails result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.enforcementVersion_ = enforcementVersion_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.iam.v3beta.PrincipalAccessBoundaryPolicyDetails) { + return mergeFrom((com.google.iam.v3beta.PrincipalAccessBoundaryPolicyDetails) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.iam.v3beta.PrincipalAccessBoundaryPolicyDetails other) { + if (other == com.google.iam.v3beta.PrincipalAccessBoundaryPolicyDetails.getDefaultInstance()) + return this; + if (rulesBuilder_ == null) { + if (!other.rules_.isEmpty()) { + if (rules_.isEmpty()) { + rules_ = other.rules_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureRulesIsMutable(); + rules_.addAll(other.rules_); + } + onChanged(); + } + } else { + if (!other.rules_.isEmpty()) { + if (rulesBuilder_.isEmpty()) { + rulesBuilder_.dispose(); + rulesBuilder_ = null; + rules_ = other.rules_; + bitField0_ = (bitField0_ & ~0x00000001); + rulesBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders + ? internalGetRulesFieldBuilder() + : null; + } else { + rulesBuilder_.addAllMessages(other.rules_); + } + } + } + if (!other.getEnforcementVersion().isEmpty()) { + enforcementVersion_ = other.enforcementVersion_; + 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.iam.v3beta.PrincipalAccessBoundaryPolicyRule m = + input.readMessage( + com.google.iam.v3beta.PrincipalAccessBoundaryPolicyRule.parser(), + extensionRegistry); + if (rulesBuilder_ == null) { + ensureRulesIsMutable(); + rules_.add(m); + } else { + rulesBuilder_.addMessage(m); + } + break; + } // case 10 + case 34: + { + enforcementVersion_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + 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.util.List rules_ = + java.util.Collections.emptyList(); + + private void ensureRulesIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + rules_ = + new java.util.ArrayList( + rules_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.google.iam.v3beta.PrincipalAccessBoundaryPolicyRule, + com.google.iam.v3beta.PrincipalAccessBoundaryPolicyRule.Builder, + com.google.iam.v3beta.PrincipalAccessBoundaryPolicyRuleOrBuilder> + rulesBuilder_; + + /** + * + * + *
        +     * Required. A list of principal access boundary policy rules. The number of
        +     * rules in a policy is limited to 500.
        +     * 
        + * + * + * repeated .google.iam.v3beta.PrincipalAccessBoundaryPolicyRule rules = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public java.util.List getRulesList() { + if (rulesBuilder_ == null) { + return java.util.Collections.unmodifiableList(rules_); + } else { + return rulesBuilder_.getMessageList(); + } + } + + /** + * + * + *
        +     * Required. A list of principal access boundary policy rules. The number of
        +     * rules in a policy is limited to 500.
        +     * 
        + * + * + * repeated .google.iam.v3beta.PrincipalAccessBoundaryPolicyRule rules = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public int getRulesCount() { + if (rulesBuilder_ == null) { + return rules_.size(); + } else { + return rulesBuilder_.getCount(); + } + } + + /** + * + * + *
        +     * Required. A list of principal access boundary policy rules. The number of
        +     * rules in a policy is limited to 500.
        +     * 
        + * + * + * repeated .google.iam.v3beta.PrincipalAccessBoundaryPolicyRule rules = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.iam.v3beta.PrincipalAccessBoundaryPolicyRule getRules(int index) { + if (rulesBuilder_ == null) { + return rules_.get(index); + } else { + return rulesBuilder_.getMessage(index); + } + } + + /** + * + * + *
        +     * Required. A list of principal access boundary policy rules. The number of
        +     * rules in a policy is limited to 500.
        +     * 
        + * + * + * repeated .google.iam.v3beta.PrincipalAccessBoundaryPolicyRule rules = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setRules( + int index, com.google.iam.v3beta.PrincipalAccessBoundaryPolicyRule value) { + if (rulesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureRulesIsMutable(); + rules_.set(index, value); + onChanged(); + } else { + rulesBuilder_.setMessage(index, value); + } + return this; + } + + /** + * + * + *
        +     * Required. A list of principal access boundary policy rules. The number of
        +     * rules in a policy is limited to 500.
        +     * 
        + * + * + * repeated .google.iam.v3beta.PrincipalAccessBoundaryPolicyRule rules = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setRules( + int index, + com.google.iam.v3beta.PrincipalAccessBoundaryPolicyRule.Builder builderForValue) { + if (rulesBuilder_ == null) { + ensureRulesIsMutable(); + rules_.set(index, builderForValue.build()); + onChanged(); + } else { + rulesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
        +     * Required. A list of principal access boundary policy rules. The number of
        +     * rules in a policy is limited to 500.
        +     * 
        + * + * + * repeated .google.iam.v3beta.PrincipalAccessBoundaryPolicyRule rules = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder addRules(com.google.iam.v3beta.PrincipalAccessBoundaryPolicyRule value) { + if (rulesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureRulesIsMutable(); + rules_.add(value); + onChanged(); + } else { + rulesBuilder_.addMessage(value); + } + return this; + } + + /** + * + * + *
        +     * Required. A list of principal access boundary policy rules. The number of
        +     * rules in a policy is limited to 500.
        +     * 
        + * + * + * repeated .google.iam.v3beta.PrincipalAccessBoundaryPolicyRule rules = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder addRules( + int index, com.google.iam.v3beta.PrincipalAccessBoundaryPolicyRule value) { + if (rulesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureRulesIsMutable(); + rules_.add(index, value); + onChanged(); + } else { + rulesBuilder_.addMessage(index, value); + } + return this; + } + + /** + * + * + *
        +     * Required. A list of principal access boundary policy rules. The number of
        +     * rules in a policy is limited to 500.
        +     * 
        + * + * + * repeated .google.iam.v3beta.PrincipalAccessBoundaryPolicyRule rules = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder addRules( + com.google.iam.v3beta.PrincipalAccessBoundaryPolicyRule.Builder builderForValue) { + if (rulesBuilder_ == null) { + ensureRulesIsMutable(); + rules_.add(builderForValue.build()); + onChanged(); + } else { + rulesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + + /** + * + * + *
        +     * Required. A list of principal access boundary policy rules. The number of
        +     * rules in a policy is limited to 500.
        +     * 
        + * + * + * repeated .google.iam.v3beta.PrincipalAccessBoundaryPolicyRule rules = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder addRules( + int index, + com.google.iam.v3beta.PrincipalAccessBoundaryPolicyRule.Builder builderForValue) { + if (rulesBuilder_ == null) { + ensureRulesIsMutable(); + rules_.add(index, builderForValue.build()); + onChanged(); + } else { + rulesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
        +     * Required. A list of principal access boundary policy rules. The number of
        +     * rules in a policy is limited to 500.
        +     * 
        + * + * + * repeated .google.iam.v3beta.PrincipalAccessBoundaryPolicyRule rules = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder addAllRules( + java.lang.Iterable + values) { + if (rulesBuilder_ == null) { + ensureRulesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, rules_); + onChanged(); + } else { + rulesBuilder_.addAllMessages(values); + } + return this; + } + + /** + * + * + *
        +     * Required. A list of principal access boundary policy rules. The number of
        +     * rules in a policy is limited to 500.
        +     * 
        + * + * + * repeated .google.iam.v3beta.PrincipalAccessBoundaryPolicyRule rules = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearRules() { + if (rulesBuilder_ == null) { + rules_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + rulesBuilder_.clear(); + } + return this; + } + + /** + * + * + *
        +     * Required. A list of principal access boundary policy rules. The number of
        +     * rules in a policy is limited to 500.
        +     * 
        + * + * + * repeated .google.iam.v3beta.PrincipalAccessBoundaryPolicyRule rules = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder removeRules(int index) { + if (rulesBuilder_ == null) { + ensureRulesIsMutable(); + rules_.remove(index); + onChanged(); + } else { + rulesBuilder_.remove(index); + } + return this; + } + + /** + * + * + *
        +     * Required. A list of principal access boundary policy rules. The number of
        +     * rules in a policy is limited to 500.
        +     * 
        + * + * + * repeated .google.iam.v3beta.PrincipalAccessBoundaryPolicyRule rules = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.iam.v3beta.PrincipalAccessBoundaryPolicyRule.Builder getRulesBuilder( + int index) { + return internalGetRulesFieldBuilder().getBuilder(index); + } + + /** + * + * + *
        +     * Required. A list of principal access boundary policy rules. The number of
        +     * rules in a policy is limited to 500.
        +     * 
        + * + * + * repeated .google.iam.v3beta.PrincipalAccessBoundaryPolicyRule rules = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.iam.v3beta.PrincipalAccessBoundaryPolicyRuleOrBuilder getRulesOrBuilder( + int index) { + if (rulesBuilder_ == null) { + return rules_.get(index); + } else { + return rulesBuilder_.getMessageOrBuilder(index); + } + } + + /** + * + * + *
        +     * Required. A list of principal access boundary policy rules. The number of
        +     * rules in a policy is limited to 500.
        +     * 
        + * + * + * repeated .google.iam.v3beta.PrincipalAccessBoundaryPolicyRule rules = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public java.util.List< + ? extends com.google.iam.v3beta.PrincipalAccessBoundaryPolicyRuleOrBuilder> + getRulesOrBuilderList() { + if (rulesBuilder_ != null) { + return rulesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(rules_); + } + } + + /** + * + * + *
        +     * Required. A list of principal access boundary policy rules. The number of
        +     * rules in a policy is limited to 500.
        +     * 
        + * + * + * repeated .google.iam.v3beta.PrincipalAccessBoundaryPolicyRule rules = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.iam.v3beta.PrincipalAccessBoundaryPolicyRule.Builder addRulesBuilder() { + return internalGetRulesFieldBuilder() + .addBuilder(com.google.iam.v3beta.PrincipalAccessBoundaryPolicyRule.getDefaultInstance()); + } + + /** + * + * + *
        +     * Required. A list of principal access boundary policy rules. The number of
        +     * rules in a policy is limited to 500.
        +     * 
        + * + * + * repeated .google.iam.v3beta.PrincipalAccessBoundaryPolicyRule rules = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.iam.v3beta.PrincipalAccessBoundaryPolicyRule.Builder addRulesBuilder( + int index) { + return internalGetRulesFieldBuilder() + .addBuilder( + index, com.google.iam.v3beta.PrincipalAccessBoundaryPolicyRule.getDefaultInstance()); + } + + /** + * + * + *
        +     * Required. A list of principal access boundary policy rules. The number of
        +     * rules in a policy is limited to 500.
        +     * 
        + * + * + * repeated .google.iam.v3beta.PrincipalAccessBoundaryPolicyRule rules = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public java.util.List + getRulesBuilderList() { + return internalGetRulesFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.google.iam.v3beta.PrincipalAccessBoundaryPolicyRule, + com.google.iam.v3beta.PrincipalAccessBoundaryPolicyRule.Builder, + com.google.iam.v3beta.PrincipalAccessBoundaryPolicyRuleOrBuilder> + internalGetRulesFieldBuilder() { + if (rulesBuilder_ == null) { + rulesBuilder_ = + new com.google.protobuf.RepeatedFieldBuilder< + com.google.iam.v3beta.PrincipalAccessBoundaryPolicyRule, + com.google.iam.v3beta.PrincipalAccessBoundaryPolicyRule.Builder, + com.google.iam.v3beta.PrincipalAccessBoundaryPolicyRuleOrBuilder>( + rules_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + rules_ = null; + } + return rulesBuilder_; + } + + private java.lang.Object enforcementVersion_ = ""; + + /** + * + * + *
        +     * Optional.
        +     * The version number (for example, `1` or `latest`) that indicates which
        +     * permissions are able to be blocked by the policy. If empty, the PAB policy
        +     * version will be set to the most recent version number at the time of the
        +     * policy's creation.
        +     * 
        + * + * string enforcement_version = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The enforcementVersion. + */ + public java.lang.String getEnforcementVersion() { + java.lang.Object ref = enforcementVersion_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + enforcementVersion_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
        +     * Optional.
        +     * The version number (for example, `1` or `latest`) that indicates which
        +     * permissions are able to be blocked by the policy. If empty, the PAB policy
        +     * version will be set to the most recent version number at the time of the
        +     * policy's creation.
        +     * 
        + * + * string enforcement_version = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for enforcementVersion. + */ + public com.google.protobuf.ByteString getEnforcementVersionBytes() { + java.lang.Object ref = enforcementVersion_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + enforcementVersion_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
        +     * Optional.
        +     * The version number (for example, `1` or `latest`) that indicates which
        +     * permissions are able to be blocked by the policy. If empty, the PAB policy
        +     * version will be set to the most recent version number at the time of the
        +     * policy's creation.
        +     * 
        + * + * string enforcement_version = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The enforcementVersion to set. + * @return This builder for chaining. + */ + public Builder setEnforcementVersion(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + enforcementVersion_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
        +     * Optional.
        +     * The version number (for example, `1` or `latest`) that indicates which
        +     * permissions are able to be blocked by the policy. If empty, the PAB policy
        +     * version will be set to the most recent version number at the time of the
        +     * policy's creation.
        +     * 
        + * + * string enforcement_version = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearEnforcementVersion() { + enforcementVersion_ = getDefaultInstance().getEnforcementVersion(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
        +     * Optional.
        +     * The version number (for example, `1` or `latest`) that indicates which
        +     * permissions are able to be blocked by the policy. If empty, the PAB policy
        +     * version will be set to the most recent version number at the time of the
        +     * policy's creation.
        +     * 
        + * + * string enforcement_version = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for enforcementVersion to set. + * @return This builder for chaining. + */ + public Builder setEnforcementVersionBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + enforcementVersion_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.iam.v3beta.PrincipalAccessBoundaryPolicyDetails) + } + + // @@protoc_insertion_point(class_scope:google.iam.v3beta.PrincipalAccessBoundaryPolicyDetails) + private static final com.google.iam.v3beta.PrincipalAccessBoundaryPolicyDetails DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.iam.v3beta.PrincipalAccessBoundaryPolicyDetails(); + } + + public static com.google.iam.v3beta.PrincipalAccessBoundaryPolicyDetails getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public PrincipalAccessBoundaryPolicyDetails 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.iam.v3beta.PrincipalAccessBoundaryPolicyDetails getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-iam/proto-google-iam-v3beta/src/main/java/com/google/iam/v3beta/PrincipalAccessBoundaryPolicyDetailsOrBuilder.java b/java-iam/proto-google-iam-v3beta/src/main/java/com/google/iam/v3beta/PrincipalAccessBoundaryPolicyDetailsOrBuilder.java new file mode 100644 index 0000000000..4cc78485f3 --- /dev/null +++ b/java-iam/proto-google-iam-v3beta/src/main/java/com/google/iam/v3beta/PrincipalAccessBoundaryPolicyDetailsOrBuilder.java @@ -0,0 +1,133 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/iam/v3beta/principal_access_boundary_policy_resources.proto +// Protobuf Java Version: 4.33.2 + +package com.google.iam.v3beta; + +@com.google.protobuf.Generated +public interface PrincipalAccessBoundaryPolicyDetailsOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.iam.v3beta.PrincipalAccessBoundaryPolicyDetails) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
        +   * Required. A list of principal access boundary policy rules. The number of
        +   * rules in a policy is limited to 500.
        +   * 
        + * + * + * repeated .google.iam.v3beta.PrincipalAccessBoundaryPolicyRule rules = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + java.util.List getRulesList(); + + /** + * + * + *
        +   * Required. A list of principal access boundary policy rules. The number of
        +   * rules in a policy is limited to 500.
        +   * 
        + * + * + * repeated .google.iam.v3beta.PrincipalAccessBoundaryPolicyRule rules = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.iam.v3beta.PrincipalAccessBoundaryPolicyRule getRules(int index); + + /** + * + * + *
        +   * Required. A list of principal access boundary policy rules. The number of
        +   * rules in a policy is limited to 500.
        +   * 
        + * + * + * repeated .google.iam.v3beta.PrincipalAccessBoundaryPolicyRule rules = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + int getRulesCount(); + + /** + * + * + *
        +   * Required. A list of principal access boundary policy rules. The number of
        +   * rules in a policy is limited to 500.
        +   * 
        + * + * + * repeated .google.iam.v3beta.PrincipalAccessBoundaryPolicyRule rules = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + java.util.List + getRulesOrBuilderList(); + + /** + * + * + *
        +   * Required. A list of principal access boundary policy rules. The number of
        +   * rules in a policy is limited to 500.
        +   * 
        + * + * + * repeated .google.iam.v3beta.PrincipalAccessBoundaryPolicyRule rules = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.iam.v3beta.PrincipalAccessBoundaryPolicyRuleOrBuilder getRulesOrBuilder(int index); + + /** + * + * + *
        +   * Optional.
        +   * The version number (for example, `1` or `latest`) that indicates which
        +   * permissions are able to be blocked by the policy. If empty, the PAB policy
        +   * version will be set to the most recent version number at the time of the
        +   * policy's creation.
        +   * 
        + * + * string enforcement_version = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The enforcementVersion. + */ + java.lang.String getEnforcementVersion(); + + /** + * + * + *
        +   * Optional.
        +   * The version number (for example, `1` or `latest`) that indicates which
        +   * permissions are able to be blocked by the policy. If empty, the PAB policy
        +   * version will be set to the most recent version number at the time of the
        +   * policy's creation.
        +   * 
        + * + * string enforcement_version = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for enforcementVersion. + */ + com.google.protobuf.ByteString getEnforcementVersionBytes(); +} diff --git a/java-iam/proto-google-iam-v3beta/src/main/java/com/google/iam/v3beta/PrincipalAccessBoundaryPolicyName.java b/java-iam/proto-google-iam-v3beta/src/main/java/com/google/iam/v3beta/PrincipalAccessBoundaryPolicyName.java new file mode 100644 index 0000000000..313e6422fa --- /dev/null +++ b/java-iam/proto-google-iam-v3beta/src/main/java/com/google/iam/v3beta/PrincipalAccessBoundaryPolicyName.java @@ -0,0 +1,243 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.iam.v3beta; + +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 PrincipalAccessBoundaryPolicyName implements ResourceName { + private static final PathTemplate ORGANIZATION_LOCATION_PRINCIPAL_ACCESS_BOUNDARY_POLICY = + PathTemplate.createWithoutUrlEncoding( + "organizations/{organization}/locations/{location}/principalAccessBoundaryPolicies/{principal_access_boundary_policy}"); + private volatile Map fieldValuesMap; + private final String organization; + private final String location; + private final String principalAccessBoundaryPolicy; + + @Deprecated + protected PrincipalAccessBoundaryPolicyName() { + organization = null; + location = null; + principalAccessBoundaryPolicy = null; + } + + private PrincipalAccessBoundaryPolicyName(Builder builder) { + organization = Preconditions.checkNotNull(builder.getOrganization()); + location = Preconditions.checkNotNull(builder.getLocation()); + principalAccessBoundaryPolicy = + Preconditions.checkNotNull(builder.getPrincipalAccessBoundaryPolicy()); + } + + public String getOrganization() { + return organization; + } + + public String getLocation() { + return location; + } + + public String getPrincipalAccessBoundaryPolicy() { + return principalAccessBoundaryPolicy; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + public static PrincipalAccessBoundaryPolicyName of( + String organization, String location, String principalAccessBoundaryPolicy) { + return newBuilder() + .setOrganization(organization) + .setLocation(location) + .setPrincipalAccessBoundaryPolicy(principalAccessBoundaryPolicy) + .build(); + } + + public static String format( + String organization, String location, String principalAccessBoundaryPolicy) { + return newBuilder() + .setOrganization(organization) + .setLocation(location) + .setPrincipalAccessBoundaryPolicy(principalAccessBoundaryPolicy) + .build() + .toString(); + } + + public static PrincipalAccessBoundaryPolicyName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + ORGANIZATION_LOCATION_PRINCIPAL_ACCESS_BOUNDARY_POLICY.validatedMatch( + formattedString, + "PrincipalAccessBoundaryPolicyName.parse: formattedString not in valid format"); + return of( + matchMap.get("organization"), + matchMap.get("location"), + matchMap.get("principal_access_boundary_policy")); + } + + 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 (PrincipalAccessBoundaryPolicyName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return ORGANIZATION_LOCATION_PRINCIPAL_ACCESS_BOUNDARY_POLICY.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); + } + if (principalAccessBoundaryPolicy != null) { + fieldMapBuilder.put("principal_access_boundary_policy", principalAccessBoundaryPolicy); + } + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return ORGANIZATION_LOCATION_PRINCIPAL_ACCESS_BOUNDARY_POLICY.instantiate( + "organization", + organization, + "location", + location, + "principal_access_boundary_policy", + principalAccessBoundaryPolicy); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o != null && getClass() == o.getClass()) { + PrincipalAccessBoundaryPolicyName that = ((PrincipalAccessBoundaryPolicyName) o); + return Objects.equals(this.organization, that.organization) + && Objects.equals(this.location, that.location) + && Objects.equals(this.principalAccessBoundaryPolicy, that.principalAccessBoundaryPolicy); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= Objects.hashCode(organization); + h *= 1000003; + h ^= Objects.hashCode(location); + h *= 1000003; + h ^= Objects.hashCode(principalAccessBoundaryPolicy); + return h; + } + + /** + * Builder for + * organizations/{organization}/locations/{location}/principalAccessBoundaryPolicies/{principal_access_boundary_policy}. + */ + public static class Builder { + private String organization; + private String location; + private String principalAccessBoundaryPolicy; + + protected Builder() {} + + public String getOrganization() { + return organization; + } + + public String getLocation() { + return location; + } + + public String getPrincipalAccessBoundaryPolicy() { + return principalAccessBoundaryPolicy; + } + + public Builder setOrganization(String organization) { + this.organization = organization; + return this; + } + + public Builder setLocation(String location) { + this.location = location; + return this; + } + + public Builder setPrincipalAccessBoundaryPolicy(String principalAccessBoundaryPolicy) { + this.principalAccessBoundaryPolicy = principalAccessBoundaryPolicy; + return this; + } + + private Builder(PrincipalAccessBoundaryPolicyName principalAccessBoundaryPolicyName) { + this.organization = principalAccessBoundaryPolicyName.organization; + this.location = principalAccessBoundaryPolicyName.location; + this.principalAccessBoundaryPolicy = + principalAccessBoundaryPolicyName.principalAccessBoundaryPolicy; + } + + public PrincipalAccessBoundaryPolicyName build() { + return new PrincipalAccessBoundaryPolicyName(this); + } + } +} diff --git a/java-iam/proto-google-iam-v3beta/src/main/java/com/google/iam/v3beta/PrincipalAccessBoundaryPolicyOrBuilder.java b/java-iam/proto-google-iam-v3beta/src/main/java/com/google/iam/v3beta/PrincipalAccessBoundaryPolicyOrBuilder.java new file mode 100644 index 0000000000..b8a5c9beed --- /dev/null +++ b/java-iam/proto-google-iam-v3beta/src/main/java/com/google/iam/v3beta/PrincipalAccessBoundaryPolicyOrBuilder.java @@ -0,0 +1,355 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/iam/v3beta/principal_access_boundary_policy_resources.proto +// Protobuf Java Version: 4.33.2 + +package com.google.iam.v3beta; + +@com.google.protobuf.Generated +public interface PrincipalAccessBoundaryPolicyOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.iam.v3beta.PrincipalAccessBoundaryPolicy) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
        +   * Identifier. The resource name of the principal access boundary policy.
        +   *
        +   * The following format is supported:
        +   * `organizations/{organization_id}/locations/{location}/principalAccessBoundaryPolicies/{policy_id}`
        +   * 
        + * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @return The name. + */ + java.lang.String getName(); + + /** + * + * + *
        +   * Identifier. The resource name of the principal access boundary policy.
        +   *
        +   * The following format is supported:
        +   * `organizations/{organization_id}/locations/{location}/principalAccessBoundaryPolicies/{policy_id}`
        +   * 
        + * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
        +   * Output only. The globally unique ID of the principal access boundary
        +   * policy.
        +   * 
        + * + * + * string uid = 2 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_info) = { ... } + * + * + * @return The uid. + */ + java.lang.String getUid(); + + /** + * + * + *
        +   * Output only. The globally unique ID of the principal access boundary
        +   * policy.
        +   * 
        + * + * + * string uid = 2 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_info) = { ... } + * + * + * @return The bytes for uid. + */ + com.google.protobuf.ByteString getUidBytes(); + + /** + * + * + *
        +   * Optional. The etag for the principal access boundary.
        +   * If this is provided on update, it must match the server's etag.
        +   * 
        + * + * string etag = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The etag. + */ + java.lang.String getEtag(); + + /** + * + * + *
        +   * Optional. The etag for the principal access boundary.
        +   * If this is provided on update, it must match the server's etag.
        +   * 
        + * + * string etag = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for etag. + */ + com.google.protobuf.ByteString getEtagBytes(); + + /** + * + * + *
        +   * Optional. The description of the principal access boundary policy. Must be
        +   * less than or equal to 63 characters.
        +   * 
        + * + * string display_name = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The displayName. + */ + java.lang.String getDisplayName(); + + /** + * + * + *
        +   * Optional. The description of the principal access boundary policy. Must be
        +   * less than or equal to 63 characters.
        +   * 
        + * + * string display_name = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for displayName. + */ + com.google.protobuf.ByteString getDisplayNameBytes(); + + /** + * + * + *
        +   * Optional. User defined annotations. See
        +   * https://google.aip.dev/148#annotations for more details such as format and
        +   * size limitations
        +   * 
        + * + * map<string, string> annotations = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + int getAnnotationsCount(); + + /** + * + * + *
        +   * Optional. User defined annotations. See
        +   * https://google.aip.dev/148#annotations for more details such as format and
        +   * size limitations
        +   * 
        + * + * map<string, string> annotations = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + boolean containsAnnotations(java.lang.String key); + + /** Use {@link #getAnnotationsMap()} instead. */ + @java.lang.Deprecated + java.util.Map getAnnotations(); + + /** + * + * + *
        +   * Optional. User defined annotations. See
        +   * https://google.aip.dev/148#annotations for more details such as format and
        +   * size limitations
        +   * 
        + * + * map<string, string> annotations = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + java.util.Map getAnnotationsMap(); + + /** + * + * + *
        +   * Optional. User defined annotations. See
        +   * https://google.aip.dev/148#annotations for more details such as format and
        +   * size limitations
        +   * 
        + * + * map<string, string> annotations = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + /* nullable */ + java.lang.String getAnnotationsOrDefault( + java.lang.String key, + /* nullable */ + java.lang.String defaultValue); + + /** + * + * + *
        +   * Optional. User defined annotations. See
        +   * https://google.aip.dev/148#annotations for more details such as format and
        +   * size limitations
        +   * 
        + * + * map<string, string> annotations = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + java.lang.String getAnnotationsOrThrow(java.lang.String key); + + /** + * + * + *
        +   * Output only. The time when the principal access boundary policy was
        +   * created.
        +   * 
        + * + * .google.protobuf.Timestamp create_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the createTime field is set. + */ + boolean hasCreateTime(); + + /** + * + * + *
        +   * Output only. The time when the principal access boundary policy was
        +   * created.
        +   * 
        + * + * .google.protobuf.Timestamp create_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The createTime. + */ + com.google.protobuf.Timestamp getCreateTime(); + + /** + * + * + *
        +   * Output only. The time when the principal access boundary policy was
        +   * created.
        +   * 
        + * + * .google.protobuf.Timestamp create_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder(); + + /** + * + * + *
        +   * Output only. The time when the principal access boundary policy was most
        +   * recently updated.
        +   * 
        + * + * .google.protobuf.Timestamp update_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the updateTime field is set. + */ + boolean hasUpdateTime(); + + /** + * + * + *
        +   * Output only. The time when the principal access boundary policy was most
        +   * recently updated.
        +   * 
        + * + * .google.protobuf.Timestamp update_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The updateTime. + */ + com.google.protobuf.Timestamp getUpdateTime(); + + /** + * + * + *
        +   * Output only. The time when the principal access boundary policy was most
        +   * recently updated.
        +   * 
        + * + * .google.protobuf.Timestamp update_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder(); + + /** + * + * + *
        +   * Optional. The details for the principal access boundary policy.
        +   * 
        + * + * + * .google.iam.v3beta.PrincipalAccessBoundaryPolicyDetails details = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the details field is set. + */ + boolean hasDetails(); + + /** + * + * + *
        +   * Optional. The details for the principal access boundary policy.
        +   * 
        + * + * + * .google.iam.v3beta.PrincipalAccessBoundaryPolicyDetails details = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The details. + */ + com.google.iam.v3beta.PrincipalAccessBoundaryPolicyDetails getDetails(); + + /** + * + * + *
        +   * Optional. The details for the principal access boundary policy.
        +   * 
        + * + * + * .google.iam.v3beta.PrincipalAccessBoundaryPolicyDetails details = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.iam.v3beta.PrincipalAccessBoundaryPolicyDetailsOrBuilder getDetailsOrBuilder(); +} diff --git a/java-iam/proto-google-iam-v3beta/src/main/java/com/google/iam/v3beta/PrincipalAccessBoundaryPolicyResourcesProto.java b/java-iam/proto-google-iam-v3beta/src/main/java/com/google/iam/v3beta/PrincipalAccessBoundaryPolicyResourcesProto.java new file mode 100644 index 0000000000..991084259d --- /dev/null +++ b/java-iam/proto-google-iam-v3beta/src/main/java/com/google/iam/v3beta/PrincipalAccessBoundaryPolicyResourcesProto.java @@ -0,0 +1,172 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/iam/v3beta/principal_access_boundary_policy_resources.proto +// Protobuf Java Version: 4.33.2 + +package com.google.iam.v3beta; + +@com.google.protobuf.Generated +public final class PrincipalAccessBoundaryPolicyResourcesProto + extends com.google.protobuf.GeneratedFile { + private PrincipalAccessBoundaryPolicyResourcesProto() {} + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "PrincipalAccessBoundaryPolicyResourcesProto"); + } + + 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_iam_v3beta_PrincipalAccessBoundaryPolicy_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_iam_v3beta_PrincipalAccessBoundaryPolicy_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_iam_v3beta_PrincipalAccessBoundaryPolicy_AnnotationsEntry_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_iam_v3beta_PrincipalAccessBoundaryPolicy_AnnotationsEntry_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_iam_v3beta_PrincipalAccessBoundaryPolicyDetails_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_iam_v3beta_PrincipalAccessBoundaryPolicyDetails_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_iam_v3beta_PrincipalAccessBoundaryPolicyRule_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_iam_v3beta_PrincipalAccessBoundaryPolicyRule_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" + + "Bgoogle/iam/v3beta/principal_access_boundary_policy_resources.proto\022\021google.iam" + + ".v3beta\032\037google/api/field_behavior.proto" + + "\032\033google/api/field_info.proto\032\031google/ap" + + "i/resource.proto\032\037google/protobuf/timestamp.proto\"\265\005\n" + + "\035PrincipalAccessBoundaryPolicy\022\021\n" + + "\004name\030\001 \001(\tB\003\340A\010\022\030\n" + + "\003uid\030\002 \001(\tB\013\340A\003\342\214\317\327\010\002\010\001\022\021\n" + + "\004etag\030\003 \001(\tB\003\340A\001\022\031\n" + + "\014display_name\030\004 \001(\tB\003\340A\001\022[\n" + + "\013annotations\030\005 \003(\0132A.go" + + "ogle.iam.v3beta.PrincipalAccessBoundaryPolicy.AnnotationsEntryB\003\340A\001\0224\n" + + "\013create_time\030\006 \001(\0132\032.google.protobuf.TimestampB\003\340A\003\0224\n" + + "\013update_time\030\007 \001(\0132\032.google.protobuf.TimestampB\003\340A\003\022M\n" + + "\007details\030\010 \001(\01327.googl" + + "e.iam.v3beta.PrincipalAccessBoundaryPolicyDetailsB\003\340A\001\0322\n" + + "\020AnnotationsEntry\022\013\n" + + "\003key\030\001 \001(\t\022\r\n" + + "\005value\030\002 \001(\t:\0028\001:\354\001\352A\350\001\n" + + "0iam.googleapis.com/PrincipalAccessBoundaryPol" + + "icy\022torganizations/{organization}/locations/{location}/principalAccessBoundaryPo" + + "licies/{principal_access_boundary_policy" + + "}*\037principalAccessBoundaryPolicies2\035principalAccessBoundaryPolicy\"\222\001\n" + + "$PrincipalAccessBoundaryPolicyDetails\022H\n" + + "\005rules\030\001 \003(" + + "\01324.google.iam.v3beta.PrincipalAccessBoundaryPolicyRuleB\003\340A\002\022 \n" + + "\023enforcement_version\030\004 \001(\tB\003\340A\001\"\324\001\n" + + "!PrincipalAccessBoundaryPolicyRule\022\030\n" + + "\013description\030\001 \001(\tB\003\340A\001\022\026\n" + + "\tresources\030\002 \003(\tB\003\340A\002\022P\n" + + "\006effect\030\003 \001(\0162;" + + ".google.iam.v3beta.PrincipalAccessBoundaryPolicyRule.EffectB\003\340A\002\"+\n" + + "\006Effect\022\026\n" + + "\022EFFECT_UNSPECIFIED\020\000\022\t\n" + + "\005ALLOW\020\001B\251\001\n" + + "\025com.google.iam.v3betaB+PrincipalAccessBoundary" + + "PolicyResourcesProtoP\001Z-cloud.google.com" + + "/go/iam/apiv3beta/iampb;iampb\252\002\027Google.C" + + "loud.Iam.V3Beta\312\002\027Google\\Cloud\\Iam\\V3betab\006proto3" + }; + descriptor = + com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( + descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + com.google.api.FieldBehaviorProto.getDescriptor(), + com.google.api.FieldInfoProto.getDescriptor(), + com.google.api.ResourceProto.getDescriptor(), + com.google.protobuf.TimestampProto.getDescriptor(), + }); + internal_static_google_iam_v3beta_PrincipalAccessBoundaryPolicy_descriptor = + getDescriptor().getMessageType(0); + internal_static_google_iam_v3beta_PrincipalAccessBoundaryPolicy_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_iam_v3beta_PrincipalAccessBoundaryPolicy_descriptor, + new java.lang.String[] { + "Name", + "Uid", + "Etag", + "DisplayName", + "Annotations", + "CreateTime", + "UpdateTime", + "Details", + }); + internal_static_google_iam_v3beta_PrincipalAccessBoundaryPolicy_AnnotationsEntry_descriptor = + internal_static_google_iam_v3beta_PrincipalAccessBoundaryPolicy_descriptor.getNestedType(0); + internal_static_google_iam_v3beta_PrincipalAccessBoundaryPolicy_AnnotationsEntry_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_iam_v3beta_PrincipalAccessBoundaryPolicy_AnnotationsEntry_descriptor, + new java.lang.String[] { + "Key", "Value", + }); + internal_static_google_iam_v3beta_PrincipalAccessBoundaryPolicyDetails_descriptor = + getDescriptor().getMessageType(1); + internal_static_google_iam_v3beta_PrincipalAccessBoundaryPolicyDetails_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_iam_v3beta_PrincipalAccessBoundaryPolicyDetails_descriptor, + new java.lang.String[] { + "Rules", "EnforcementVersion", + }); + internal_static_google_iam_v3beta_PrincipalAccessBoundaryPolicyRule_descriptor = + getDescriptor().getMessageType(2); + internal_static_google_iam_v3beta_PrincipalAccessBoundaryPolicyRule_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_iam_v3beta_PrincipalAccessBoundaryPolicyRule_descriptor, + new java.lang.String[] { + "Description", "Resources", "Effect", + }); + descriptor.resolveAllFeaturesImmutable(); + com.google.api.FieldBehaviorProto.getDescriptor(); + com.google.api.FieldInfoProto.getDescriptor(); + com.google.api.ResourceProto.getDescriptor(); + com.google.protobuf.TimestampProto.getDescriptor(); + com.google.protobuf.ExtensionRegistry registry = + com.google.protobuf.ExtensionRegistry.newInstance(); + registry.add(com.google.api.FieldBehaviorProto.fieldBehavior); + registry.add(com.google.api.FieldInfoProto.fieldInfo); + registry.add(com.google.api.ResourceProto.resource); + com.google.protobuf.Descriptors.FileDescriptor.internalUpdateFileDescriptor( + descriptor, registry); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/java-iam/proto-google-iam-v3beta/src/main/java/com/google/iam/v3beta/PrincipalAccessBoundaryPolicyRule.java b/java-iam/proto-google-iam-v3beta/src/main/java/com/google/iam/v3beta/PrincipalAccessBoundaryPolicyRule.java new file mode 100644 index 0000000000..7c39a4386f --- /dev/null +++ b/java-iam/proto-google-iam-v3beta/src/main/java/com/google/iam/v3beta/PrincipalAccessBoundaryPolicyRule.java @@ -0,0 +1,1370 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/iam/v3beta/principal_access_boundary_policy_resources.proto +// Protobuf Java Version: 4.33.2 + +package com.google.iam.v3beta; + +/** + * + * + *
        + * Principal access boundary policy rule that defines the resource boundary.
        + * 
        + * + * Protobuf type {@code google.iam.v3beta.PrincipalAccessBoundaryPolicyRule} + */ +@com.google.protobuf.Generated +public final class PrincipalAccessBoundaryPolicyRule extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.iam.v3beta.PrincipalAccessBoundaryPolicyRule) + PrincipalAccessBoundaryPolicyRuleOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "PrincipalAccessBoundaryPolicyRule"); + } + + // Use PrincipalAccessBoundaryPolicyRule.newBuilder() to construct. + private PrincipalAccessBoundaryPolicyRule( + com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private PrincipalAccessBoundaryPolicyRule() { + description_ = ""; + resources_ = com.google.protobuf.LazyStringArrayList.emptyList(); + effect_ = 0; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.iam.v3beta.PrincipalAccessBoundaryPolicyResourcesProto + .internal_static_google_iam_v3beta_PrincipalAccessBoundaryPolicyRule_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.iam.v3beta.PrincipalAccessBoundaryPolicyResourcesProto + .internal_static_google_iam_v3beta_PrincipalAccessBoundaryPolicyRule_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.iam.v3beta.PrincipalAccessBoundaryPolicyRule.class, + com.google.iam.v3beta.PrincipalAccessBoundaryPolicyRule.Builder.class); + } + + /** + * + * + *
        +   * An effect to describe the access relationship.
        +   * 
        + * + * Protobuf enum {@code google.iam.v3beta.PrincipalAccessBoundaryPolicyRule.Effect} + */ + public enum Effect implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
        +     * Effect unspecified.
        +     * 
        + * + * EFFECT_UNSPECIFIED = 0; + */ + EFFECT_UNSPECIFIED(0), + /** + * + * + *
        +     * Allows access to the resources in this rule.
        +     * 
        + * + * ALLOW = 1; + */ + ALLOW(1), + UNRECOGNIZED(-1), + ; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "Effect"); + } + + /** + * + * + *
        +     * Effect unspecified.
        +     * 
        + * + * EFFECT_UNSPECIFIED = 0; + */ + public static final int EFFECT_UNSPECIFIED_VALUE = 0; + + /** + * + * + *
        +     * Allows access to the resources in this rule.
        +     * 
        + * + * ALLOW = 1; + */ + public static final int ALLOW_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 Effect 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 Effect forNumber(int value) { + switch (value) { + case 0: + return EFFECT_UNSPECIFIED; + case 1: + return ALLOW; + 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 Effect findValueByNumber(int number) { + return Effect.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 com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.iam.v3beta.PrincipalAccessBoundaryPolicyRule.getDescriptor() + .getEnumTypes() + .get(0); + } + + private static final Effect[] VALUES = values(); + + public static Effect 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 Effect(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.iam.v3beta.PrincipalAccessBoundaryPolicyRule.Effect) + } + + public static final int DESCRIPTION_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object description_ = ""; + + /** + * + * + *
        +   * Optional. The description of the principal access boundary policy rule.
        +   * Must be less than or equal to 256 characters.
        +   * 
        + * + * string description = 1 [(.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. The description of the principal access boundary policy rule.
        +   * Must be less than or equal to 256 characters.
        +   * 
        + * + * string description = 1 [(.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 RESOURCES_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private com.google.protobuf.LazyStringArrayList resources_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + + /** + * + * + *
        +   * Required. A list of Resource Manager resources. If a resource is listed in
        +   * the rule, then the rule applies for that resource and its descendants. The
        +   * number of resources in a policy is limited to 500 across all rules in the
        +   * policy.
        +   *
        +   * The following resource types are supported:
        +   *
        +   * * Organizations, such as
        +   * `//cloudresourcemanager.googleapis.com/organizations/123`.
        +   * * Folders, such as `//cloudresourcemanager.googleapis.com/folders/123`.
        +   * * Projects, such as `//cloudresourcemanager.googleapis.com/projects/123`
        +   * or `//cloudresourcemanager.googleapis.com/projects/my-project-id`.
        +   * 
        + * + * repeated string resources = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return A list containing the resources. + */ + public com.google.protobuf.ProtocolStringList getResourcesList() { + return resources_; + } + + /** + * + * + *
        +   * Required. A list of Resource Manager resources. If a resource is listed in
        +   * the rule, then the rule applies for that resource and its descendants. The
        +   * number of resources in a policy is limited to 500 across all rules in the
        +   * policy.
        +   *
        +   * The following resource types are supported:
        +   *
        +   * * Organizations, such as
        +   * `//cloudresourcemanager.googleapis.com/organizations/123`.
        +   * * Folders, such as `//cloudresourcemanager.googleapis.com/folders/123`.
        +   * * Projects, such as `//cloudresourcemanager.googleapis.com/projects/123`
        +   * or `//cloudresourcemanager.googleapis.com/projects/my-project-id`.
        +   * 
        + * + * repeated string resources = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The count of resources. + */ + public int getResourcesCount() { + return resources_.size(); + } + + /** + * + * + *
        +   * Required. A list of Resource Manager resources. If a resource is listed in
        +   * the rule, then the rule applies for that resource and its descendants. The
        +   * number of resources in a policy is limited to 500 across all rules in the
        +   * policy.
        +   *
        +   * The following resource types are supported:
        +   *
        +   * * Organizations, such as
        +   * `//cloudresourcemanager.googleapis.com/organizations/123`.
        +   * * Folders, such as `//cloudresourcemanager.googleapis.com/folders/123`.
        +   * * Projects, such as `//cloudresourcemanager.googleapis.com/projects/123`
        +   * or `//cloudresourcemanager.googleapis.com/projects/my-project-id`.
        +   * 
        + * + * repeated string resources = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param index The index of the element to return. + * @return The resources at the given index. + */ + public java.lang.String getResources(int index) { + return resources_.get(index); + } + + /** + * + * + *
        +   * Required. A list of Resource Manager resources. If a resource is listed in
        +   * the rule, then the rule applies for that resource and its descendants. The
        +   * number of resources in a policy is limited to 500 across all rules in the
        +   * policy.
        +   *
        +   * The following resource types are supported:
        +   *
        +   * * Organizations, such as
        +   * `//cloudresourcemanager.googleapis.com/organizations/123`.
        +   * * Folders, such as `//cloudresourcemanager.googleapis.com/folders/123`.
        +   * * Projects, such as `//cloudresourcemanager.googleapis.com/projects/123`
        +   * or `//cloudresourcemanager.googleapis.com/projects/my-project-id`.
        +   * 
        + * + * repeated string resources = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param index The index of the value to return. + * @return The bytes of the resources at the given index. + */ + public com.google.protobuf.ByteString getResourcesBytes(int index) { + return resources_.getByteString(index); + } + + public static final int EFFECT_FIELD_NUMBER = 3; + private int effect_ = 0; + + /** + * + * + *
        +   * Required. The access relationship of principals to the resources in this
        +   * rule.
        +   * 
        + * + * + * .google.iam.v3beta.PrincipalAccessBoundaryPolicyRule.Effect effect = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The enum numeric value on the wire for effect. + */ + @java.lang.Override + public int getEffectValue() { + return effect_; + } + + /** + * + * + *
        +   * Required. The access relationship of principals to the resources in this
        +   * rule.
        +   * 
        + * + * + * .google.iam.v3beta.PrincipalAccessBoundaryPolicyRule.Effect effect = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The effect. + */ + @java.lang.Override + public com.google.iam.v3beta.PrincipalAccessBoundaryPolicyRule.Effect getEffect() { + com.google.iam.v3beta.PrincipalAccessBoundaryPolicyRule.Effect result = + com.google.iam.v3beta.PrincipalAccessBoundaryPolicyRule.Effect.forNumber(effect_); + return result == null + ? com.google.iam.v3beta.PrincipalAccessBoundaryPolicyRule.Effect.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.GeneratedMessage.isStringEmpty(description_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, description_); + } + for (int i = 0; i < resources_.size(); i++) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, resources_.getRaw(i)); + } + if (effect_ + != com.google.iam.v3beta.PrincipalAccessBoundaryPolicyRule.Effect.EFFECT_UNSPECIFIED + .getNumber()) { + output.writeEnum(3, effect_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(description_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, description_); + } + { + int dataSize = 0; + for (int i = 0; i < resources_.size(); i++) { + dataSize += computeStringSizeNoTag(resources_.getRaw(i)); + } + size += dataSize; + size += 1 * getResourcesList().size(); + } + if (effect_ + != com.google.iam.v3beta.PrincipalAccessBoundaryPolicyRule.Effect.EFFECT_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(3, effect_); + } + 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.iam.v3beta.PrincipalAccessBoundaryPolicyRule)) { + return super.equals(obj); + } + com.google.iam.v3beta.PrincipalAccessBoundaryPolicyRule other = + (com.google.iam.v3beta.PrincipalAccessBoundaryPolicyRule) obj; + + if (!getDescription().equals(other.getDescription())) return false; + if (!getResourcesList().equals(other.getResourcesList())) return false; + if (effect_ != other.effect_) 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) + DESCRIPTION_FIELD_NUMBER; + hash = (53 * hash) + getDescription().hashCode(); + if (getResourcesCount() > 0) { + hash = (37 * hash) + RESOURCES_FIELD_NUMBER; + hash = (53 * hash) + getResourcesList().hashCode(); + } + hash = (37 * hash) + EFFECT_FIELD_NUMBER; + hash = (53 * hash) + effect_; + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.iam.v3beta.PrincipalAccessBoundaryPolicyRule parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.iam.v3beta.PrincipalAccessBoundaryPolicyRule parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.iam.v3beta.PrincipalAccessBoundaryPolicyRule parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.iam.v3beta.PrincipalAccessBoundaryPolicyRule 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.iam.v3beta.PrincipalAccessBoundaryPolicyRule parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.iam.v3beta.PrincipalAccessBoundaryPolicyRule parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.iam.v3beta.PrincipalAccessBoundaryPolicyRule parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.iam.v3beta.PrincipalAccessBoundaryPolicyRule parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.iam.v3beta.PrincipalAccessBoundaryPolicyRule parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.iam.v3beta.PrincipalAccessBoundaryPolicyRule parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.iam.v3beta.PrincipalAccessBoundaryPolicyRule parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.iam.v3beta.PrincipalAccessBoundaryPolicyRule parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.iam.v3beta.PrincipalAccessBoundaryPolicyRule 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
        +   * Principal access boundary policy rule that defines the resource boundary.
        +   * 
        + * + * Protobuf type {@code google.iam.v3beta.PrincipalAccessBoundaryPolicyRule} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.iam.v3beta.PrincipalAccessBoundaryPolicyRule) + com.google.iam.v3beta.PrincipalAccessBoundaryPolicyRuleOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.iam.v3beta.PrincipalAccessBoundaryPolicyResourcesProto + .internal_static_google_iam_v3beta_PrincipalAccessBoundaryPolicyRule_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.iam.v3beta.PrincipalAccessBoundaryPolicyResourcesProto + .internal_static_google_iam_v3beta_PrincipalAccessBoundaryPolicyRule_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.iam.v3beta.PrincipalAccessBoundaryPolicyRule.class, + com.google.iam.v3beta.PrincipalAccessBoundaryPolicyRule.Builder.class); + } + + // Construct using com.google.iam.v3beta.PrincipalAccessBoundaryPolicyRule.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + description_ = ""; + resources_ = com.google.protobuf.LazyStringArrayList.emptyList(); + effect_ = 0; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.iam.v3beta.PrincipalAccessBoundaryPolicyResourcesProto + .internal_static_google_iam_v3beta_PrincipalAccessBoundaryPolicyRule_descriptor; + } + + @java.lang.Override + public com.google.iam.v3beta.PrincipalAccessBoundaryPolicyRule getDefaultInstanceForType() { + return com.google.iam.v3beta.PrincipalAccessBoundaryPolicyRule.getDefaultInstance(); + } + + @java.lang.Override + public com.google.iam.v3beta.PrincipalAccessBoundaryPolicyRule build() { + com.google.iam.v3beta.PrincipalAccessBoundaryPolicyRule result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.iam.v3beta.PrincipalAccessBoundaryPolicyRule buildPartial() { + com.google.iam.v3beta.PrincipalAccessBoundaryPolicyRule result = + new com.google.iam.v3beta.PrincipalAccessBoundaryPolicyRule(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.iam.v3beta.PrincipalAccessBoundaryPolicyRule result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.description_ = description_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + resources_.makeImmutable(); + result.resources_ = resources_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.effect_ = effect_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.iam.v3beta.PrincipalAccessBoundaryPolicyRule) { + return mergeFrom((com.google.iam.v3beta.PrincipalAccessBoundaryPolicyRule) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.iam.v3beta.PrincipalAccessBoundaryPolicyRule other) { + if (other == com.google.iam.v3beta.PrincipalAccessBoundaryPolicyRule.getDefaultInstance()) + return this; + if (!other.getDescription().isEmpty()) { + description_ = other.description_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.resources_.isEmpty()) { + if (resources_.isEmpty()) { + resources_ = other.resources_; + bitField0_ |= 0x00000002; + } else { + ensureResourcesIsMutable(); + resources_.addAll(other.resources_); + } + onChanged(); + } + if (other.effect_ != 0) { + setEffectValue(other.getEffectValue()); + } + 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: + { + description_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + ensureResourcesIsMutable(); + resources_.add(s); + break; + } // case 18 + case 24: + { + effect_ = input.readEnum(); + 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 description_ = ""; + + /** + * + * + *
        +     * Optional. The description of the principal access boundary policy rule.
        +     * Must be less than or equal to 256 characters.
        +     * 
        + * + * string description = 1 [(.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. The description of the principal access boundary policy rule.
        +     * Must be less than or equal to 256 characters.
        +     * 
        + * + * string description = 1 [(.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. The description of the principal access boundary policy rule.
        +     * Must be less than or equal to 256 characters.
        +     * 
        + * + * string description = 1 [(.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_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
        +     * Optional. The description of the principal access boundary policy rule.
        +     * Must be less than or equal to 256 characters.
        +     * 
        + * + * string description = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearDescription() { + description_ = getDefaultInstance().getDescription(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
        +     * Optional. The description of the principal access boundary policy rule.
        +     * Must be less than or equal to 256 characters.
        +     * 
        + * + * string description = 1 [(.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_ |= 0x00000001; + onChanged(); + return this; + } + + private com.google.protobuf.LazyStringArrayList resources_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + + private void ensureResourcesIsMutable() { + if (!resources_.isModifiable()) { + resources_ = new com.google.protobuf.LazyStringArrayList(resources_); + } + bitField0_ |= 0x00000002; + } + + /** + * + * + *
        +     * Required. A list of Resource Manager resources. If a resource is listed in
        +     * the rule, then the rule applies for that resource and its descendants. The
        +     * number of resources in a policy is limited to 500 across all rules in the
        +     * policy.
        +     *
        +     * The following resource types are supported:
        +     *
        +     * * Organizations, such as
        +     * `//cloudresourcemanager.googleapis.com/organizations/123`.
        +     * * Folders, such as `//cloudresourcemanager.googleapis.com/folders/123`.
        +     * * Projects, such as `//cloudresourcemanager.googleapis.com/projects/123`
        +     * or `//cloudresourcemanager.googleapis.com/projects/my-project-id`.
        +     * 
        + * + * repeated string resources = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return A list containing the resources. + */ + public com.google.protobuf.ProtocolStringList getResourcesList() { + resources_.makeImmutable(); + return resources_; + } + + /** + * + * + *
        +     * Required. A list of Resource Manager resources. If a resource is listed in
        +     * the rule, then the rule applies for that resource and its descendants. The
        +     * number of resources in a policy is limited to 500 across all rules in the
        +     * policy.
        +     *
        +     * The following resource types are supported:
        +     *
        +     * * Organizations, such as
        +     * `//cloudresourcemanager.googleapis.com/organizations/123`.
        +     * * Folders, such as `//cloudresourcemanager.googleapis.com/folders/123`.
        +     * * Projects, such as `//cloudresourcemanager.googleapis.com/projects/123`
        +     * or `//cloudresourcemanager.googleapis.com/projects/my-project-id`.
        +     * 
        + * + * repeated string resources = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The count of resources. + */ + public int getResourcesCount() { + return resources_.size(); + } + + /** + * + * + *
        +     * Required. A list of Resource Manager resources. If a resource is listed in
        +     * the rule, then the rule applies for that resource and its descendants. The
        +     * number of resources in a policy is limited to 500 across all rules in the
        +     * policy.
        +     *
        +     * The following resource types are supported:
        +     *
        +     * * Organizations, such as
        +     * `//cloudresourcemanager.googleapis.com/organizations/123`.
        +     * * Folders, such as `//cloudresourcemanager.googleapis.com/folders/123`.
        +     * * Projects, such as `//cloudresourcemanager.googleapis.com/projects/123`
        +     * or `//cloudresourcemanager.googleapis.com/projects/my-project-id`.
        +     * 
        + * + * repeated string resources = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param index The index of the element to return. + * @return The resources at the given index. + */ + public java.lang.String getResources(int index) { + return resources_.get(index); + } + + /** + * + * + *
        +     * Required. A list of Resource Manager resources. If a resource is listed in
        +     * the rule, then the rule applies for that resource and its descendants. The
        +     * number of resources in a policy is limited to 500 across all rules in the
        +     * policy.
        +     *
        +     * The following resource types are supported:
        +     *
        +     * * Organizations, such as
        +     * `//cloudresourcemanager.googleapis.com/organizations/123`.
        +     * * Folders, such as `//cloudresourcemanager.googleapis.com/folders/123`.
        +     * * Projects, such as `//cloudresourcemanager.googleapis.com/projects/123`
        +     * or `//cloudresourcemanager.googleapis.com/projects/my-project-id`.
        +     * 
        + * + * repeated string resources = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param index The index of the value to return. + * @return The bytes of the resources at the given index. + */ + public com.google.protobuf.ByteString getResourcesBytes(int index) { + return resources_.getByteString(index); + } + + /** + * + * + *
        +     * Required. A list of Resource Manager resources. If a resource is listed in
        +     * the rule, then the rule applies for that resource and its descendants. The
        +     * number of resources in a policy is limited to 500 across all rules in the
        +     * policy.
        +     *
        +     * The following resource types are supported:
        +     *
        +     * * Organizations, such as
        +     * `//cloudresourcemanager.googleapis.com/organizations/123`.
        +     * * Folders, such as `//cloudresourcemanager.googleapis.com/folders/123`.
        +     * * Projects, such as `//cloudresourcemanager.googleapis.com/projects/123`
        +     * or `//cloudresourcemanager.googleapis.com/projects/my-project-id`.
        +     * 
        + * + * repeated string resources = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param index The index to set the value at. + * @param value The resources to set. + * @return This builder for chaining. + */ + public Builder setResources(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureResourcesIsMutable(); + resources_.set(index, value); + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
        +     * Required. A list of Resource Manager resources. If a resource is listed in
        +     * the rule, then the rule applies for that resource and its descendants. The
        +     * number of resources in a policy is limited to 500 across all rules in the
        +     * policy.
        +     *
        +     * The following resource types are supported:
        +     *
        +     * * Organizations, such as
        +     * `//cloudresourcemanager.googleapis.com/organizations/123`.
        +     * * Folders, such as `//cloudresourcemanager.googleapis.com/folders/123`.
        +     * * Projects, such as `//cloudresourcemanager.googleapis.com/projects/123`
        +     * or `//cloudresourcemanager.googleapis.com/projects/my-project-id`.
        +     * 
        + * + * repeated string resources = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The resources to add. + * @return This builder for chaining. + */ + public Builder addResources(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureResourcesIsMutable(); + resources_.add(value); + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
        +     * Required. A list of Resource Manager resources. If a resource is listed in
        +     * the rule, then the rule applies for that resource and its descendants. The
        +     * number of resources in a policy is limited to 500 across all rules in the
        +     * policy.
        +     *
        +     * The following resource types are supported:
        +     *
        +     * * Organizations, such as
        +     * `//cloudresourcemanager.googleapis.com/organizations/123`.
        +     * * Folders, such as `//cloudresourcemanager.googleapis.com/folders/123`.
        +     * * Projects, such as `//cloudresourcemanager.googleapis.com/projects/123`
        +     * or `//cloudresourcemanager.googleapis.com/projects/my-project-id`.
        +     * 
        + * + * repeated string resources = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param values The resources to add. + * @return This builder for chaining. + */ + public Builder addAllResources(java.lang.Iterable values) { + ensureResourcesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, resources_); + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
        +     * Required. A list of Resource Manager resources. If a resource is listed in
        +     * the rule, then the rule applies for that resource and its descendants. The
        +     * number of resources in a policy is limited to 500 across all rules in the
        +     * policy.
        +     *
        +     * The following resource types are supported:
        +     *
        +     * * Organizations, such as
        +     * `//cloudresourcemanager.googleapis.com/organizations/123`.
        +     * * Folders, such as `//cloudresourcemanager.googleapis.com/folders/123`.
        +     * * Projects, such as `//cloudresourcemanager.googleapis.com/projects/123`
        +     * or `//cloudresourcemanager.googleapis.com/projects/my-project-id`.
        +     * 
        + * + * repeated string resources = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearResources() { + resources_ = com.google.protobuf.LazyStringArrayList.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + ; + onChanged(); + return this; + } + + /** + * + * + *
        +     * Required. A list of Resource Manager resources. If a resource is listed in
        +     * the rule, then the rule applies for that resource and its descendants. The
        +     * number of resources in a policy is limited to 500 across all rules in the
        +     * policy.
        +     *
        +     * The following resource types are supported:
        +     *
        +     * * Organizations, such as
        +     * `//cloudresourcemanager.googleapis.com/organizations/123`.
        +     * * Folders, such as `//cloudresourcemanager.googleapis.com/folders/123`.
        +     * * Projects, such as `//cloudresourcemanager.googleapis.com/projects/123`
        +     * or `//cloudresourcemanager.googleapis.com/projects/my-project-id`.
        +     * 
        + * + * repeated string resources = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes of the resources to add. + * @return This builder for chaining. + */ + public Builder addResourcesBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureResourcesIsMutable(); + resources_.add(value); + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private int effect_ = 0; + + /** + * + * + *
        +     * Required. The access relationship of principals to the resources in this
        +     * rule.
        +     * 
        + * + * + * .google.iam.v3beta.PrincipalAccessBoundaryPolicyRule.Effect effect = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The enum numeric value on the wire for effect. + */ + @java.lang.Override + public int getEffectValue() { + return effect_; + } + + /** + * + * + *
        +     * Required. The access relationship of principals to the resources in this
        +     * rule.
        +     * 
        + * + * + * .google.iam.v3beta.PrincipalAccessBoundaryPolicyRule.Effect effect = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @param value The enum numeric value on the wire for effect to set. + * @return This builder for chaining. + */ + public Builder setEffectValue(int value) { + effect_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
        +     * Required. The access relationship of principals to the resources in this
        +     * rule.
        +     * 
        + * + * + * .google.iam.v3beta.PrincipalAccessBoundaryPolicyRule.Effect effect = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The effect. + */ + @java.lang.Override + public com.google.iam.v3beta.PrincipalAccessBoundaryPolicyRule.Effect getEffect() { + com.google.iam.v3beta.PrincipalAccessBoundaryPolicyRule.Effect result = + com.google.iam.v3beta.PrincipalAccessBoundaryPolicyRule.Effect.forNumber(effect_); + return result == null + ? com.google.iam.v3beta.PrincipalAccessBoundaryPolicyRule.Effect.UNRECOGNIZED + : result; + } + + /** + * + * + *
        +     * Required. The access relationship of principals to the resources in this
        +     * rule.
        +     * 
        + * + * + * .google.iam.v3beta.PrincipalAccessBoundaryPolicyRule.Effect effect = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @param value The effect to set. + * @return This builder for chaining. + */ + public Builder setEffect(com.google.iam.v3beta.PrincipalAccessBoundaryPolicyRule.Effect value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000004; + effect_ = value.getNumber(); + onChanged(); + return this; + } + + /** + * + * + *
        +     * Required. The access relationship of principals to the resources in this
        +     * rule.
        +     * 
        + * + * + * .google.iam.v3beta.PrincipalAccessBoundaryPolicyRule.Effect effect = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return This builder for chaining. + */ + public Builder clearEffect() { + bitField0_ = (bitField0_ & ~0x00000004); + effect_ = 0; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.iam.v3beta.PrincipalAccessBoundaryPolicyRule) + } + + // @@protoc_insertion_point(class_scope:google.iam.v3beta.PrincipalAccessBoundaryPolicyRule) + private static final com.google.iam.v3beta.PrincipalAccessBoundaryPolicyRule DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.iam.v3beta.PrincipalAccessBoundaryPolicyRule(); + } + + public static com.google.iam.v3beta.PrincipalAccessBoundaryPolicyRule getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public PrincipalAccessBoundaryPolicyRule 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.iam.v3beta.PrincipalAccessBoundaryPolicyRule getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-iam/proto-google-iam-v3beta/src/main/java/com/google/iam/v3beta/PrincipalAccessBoundaryPolicyRuleOrBuilder.java b/java-iam/proto-google-iam-v3beta/src/main/java/com/google/iam/v3beta/PrincipalAccessBoundaryPolicyRuleOrBuilder.java new file mode 100644 index 0000000000..5de0aa3fcb --- /dev/null +++ b/java-iam/proto-google-iam-v3beta/src/main/java/com/google/iam/v3beta/PrincipalAccessBoundaryPolicyRuleOrBuilder.java @@ -0,0 +1,186 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/iam/v3beta/principal_access_boundary_policy_resources.proto +// Protobuf Java Version: 4.33.2 + +package com.google.iam.v3beta; + +@com.google.protobuf.Generated +public interface PrincipalAccessBoundaryPolicyRuleOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.iam.v3beta.PrincipalAccessBoundaryPolicyRule) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
        +   * Optional. The description of the principal access boundary policy rule.
        +   * Must be less than or equal to 256 characters.
        +   * 
        + * + * string description = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The description. + */ + java.lang.String getDescription(); + + /** + * + * + *
        +   * Optional. The description of the principal access boundary policy rule.
        +   * Must be less than or equal to 256 characters.
        +   * 
        + * + * string description = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for description. + */ + com.google.protobuf.ByteString getDescriptionBytes(); + + /** + * + * + *
        +   * Required. A list of Resource Manager resources. If a resource is listed in
        +   * the rule, then the rule applies for that resource and its descendants. The
        +   * number of resources in a policy is limited to 500 across all rules in the
        +   * policy.
        +   *
        +   * The following resource types are supported:
        +   *
        +   * * Organizations, such as
        +   * `//cloudresourcemanager.googleapis.com/organizations/123`.
        +   * * Folders, such as `//cloudresourcemanager.googleapis.com/folders/123`.
        +   * * Projects, such as `//cloudresourcemanager.googleapis.com/projects/123`
        +   * or `//cloudresourcemanager.googleapis.com/projects/my-project-id`.
        +   * 
        + * + * repeated string resources = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return A list containing the resources. + */ + java.util.List getResourcesList(); + + /** + * + * + *
        +   * Required. A list of Resource Manager resources. If a resource is listed in
        +   * the rule, then the rule applies for that resource and its descendants. The
        +   * number of resources in a policy is limited to 500 across all rules in the
        +   * policy.
        +   *
        +   * The following resource types are supported:
        +   *
        +   * * Organizations, such as
        +   * `//cloudresourcemanager.googleapis.com/organizations/123`.
        +   * * Folders, such as `//cloudresourcemanager.googleapis.com/folders/123`.
        +   * * Projects, such as `//cloudresourcemanager.googleapis.com/projects/123`
        +   * or `//cloudresourcemanager.googleapis.com/projects/my-project-id`.
        +   * 
        + * + * repeated string resources = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The count of resources. + */ + int getResourcesCount(); + + /** + * + * + *
        +   * Required. A list of Resource Manager resources. If a resource is listed in
        +   * the rule, then the rule applies for that resource and its descendants. The
        +   * number of resources in a policy is limited to 500 across all rules in the
        +   * policy.
        +   *
        +   * The following resource types are supported:
        +   *
        +   * * Organizations, such as
        +   * `//cloudresourcemanager.googleapis.com/organizations/123`.
        +   * * Folders, such as `//cloudresourcemanager.googleapis.com/folders/123`.
        +   * * Projects, such as `//cloudresourcemanager.googleapis.com/projects/123`
        +   * or `//cloudresourcemanager.googleapis.com/projects/my-project-id`.
        +   * 
        + * + * repeated string resources = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param index The index of the element to return. + * @return The resources at the given index. + */ + java.lang.String getResources(int index); + + /** + * + * + *
        +   * Required. A list of Resource Manager resources. If a resource is listed in
        +   * the rule, then the rule applies for that resource and its descendants. The
        +   * number of resources in a policy is limited to 500 across all rules in the
        +   * policy.
        +   *
        +   * The following resource types are supported:
        +   *
        +   * * Organizations, such as
        +   * `//cloudresourcemanager.googleapis.com/organizations/123`.
        +   * * Folders, such as `//cloudresourcemanager.googleapis.com/folders/123`.
        +   * * Projects, such as `//cloudresourcemanager.googleapis.com/projects/123`
        +   * or `//cloudresourcemanager.googleapis.com/projects/my-project-id`.
        +   * 
        + * + * repeated string resources = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param index The index of the value to return. + * @return The bytes of the resources at the given index. + */ + com.google.protobuf.ByteString getResourcesBytes(int index); + + /** + * + * + *
        +   * Required. The access relationship of principals to the resources in this
        +   * rule.
        +   * 
        + * + * + * .google.iam.v3beta.PrincipalAccessBoundaryPolicyRule.Effect effect = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The enum numeric value on the wire for effect. + */ + int getEffectValue(); + + /** + * + * + *
        +   * Required. The access relationship of principals to the resources in this
        +   * rule.
        +   * 
        + * + * + * .google.iam.v3beta.PrincipalAccessBoundaryPolicyRule.Effect effect = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The effect. + */ + com.google.iam.v3beta.PrincipalAccessBoundaryPolicyRule.Effect getEffect(); +} diff --git a/java-iam/proto-google-iam-v3beta/src/main/java/com/google/iam/v3beta/SearchPrincipalAccessBoundaryPolicyBindingsRequest.java b/java-iam/proto-google-iam-v3beta/src/main/java/com/google/iam/v3beta/SearchPrincipalAccessBoundaryPolicyBindingsRequest.java new file mode 100644 index 0000000000..5fe43e1949 --- /dev/null +++ b/java-iam/proto-google-iam-v3beta/src/main/java/com/google/iam/v3beta/SearchPrincipalAccessBoundaryPolicyBindingsRequest.java @@ -0,0 +1,993 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/iam/v3beta/principal_access_boundary_policies_service.proto +// Protobuf Java Version: 4.33.2 + +package com.google.iam.v3beta; + +/** + * + * + *
        + * Request message for SearchPrincipalAccessBoundaryPolicyBindings rpc.
        + * 
        + * + * Protobuf type {@code google.iam.v3beta.SearchPrincipalAccessBoundaryPolicyBindingsRequest} + */ +@com.google.protobuf.Generated +public final class SearchPrincipalAccessBoundaryPolicyBindingsRequest + extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.iam.v3beta.SearchPrincipalAccessBoundaryPolicyBindingsRequest) + SearchPrincipalAccessBoundaryPolicyBindingsRequestOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "SearchPrincipalAccessBoundaryPolicyBindingsRequest"); + } + + // Use SearchPrincipalAccessBoundaryPolicyBindingsRequest.newBuilder() to construct. + private SearchPrincipalAccessBoundaryPolicyBindingsRequest( + com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private SearchPrincipalAccessBoundaryPolicyBindingsRequest() { + name_ = ""; + pageToken_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.iam.v3beta.PrincipalAccessBoundaryPoliciesServiceProto + .internal_static_google_iam_v3beta_SearchPrincipalAccessBoundaryPolicyBindingsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.iam.v3beta.PrincipalAccessBoundaryPoliciesServiceProto + .internal_static_google_iam_v3beta_SearchPrincipalAccessBoundaryPolicyBindingsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.iam.v3beta.SearchPrincipalAccessBoundaryPolicyBindingsRequest.class, + com.google.iam.v3beta.SearchPrincipalAccessBoundaryPolicyBindingsRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + + /** + * + * + *
        +   * Required. The name of the principal access boundary policy.
        +   * Format:
        +   * `organizations/{organization_id}/locations/{location}/principalAccessBoundaryPolicies/{principal_access_boundary_policy_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 name of the principal access boundary policy.
        +   * Format:
        +   * `organizations/{organization_id}/locations/{location}/principalAccessBoundaryPolicies/{principal_access_boundary_policy_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; + } + } + + public static final int PAGE_SIZE_FIELD_NUMBER = 3; + private int pageSize_ = 0; + + /** + * + * + *
        +   * Optional. The maximum number of policy bindings to return. The service may
        +   * return fewer than this value.
        +   *
        +   * If unspecified, at most 50 policy bindings will be returned.
        +   * The maximum value is 1000; values above 1000 will be coerced to 1000.
        +   * 
        + * + * int32 page_size = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + + public static final int PAGE_TOKEN_FIELD_NUMBER = 4; + + @SuppressWarnings("serial") + private volatile java.lang.Object pageToken_ = ""; + + /** + * + * + *
        +   * Optional. A page token, received from a previous
        +   * `SearchPrincipalAccessBoundaryPolicyBindingsRequest` call. Provide this to
        +   * retrieve the subsequent page.
        +   *
        +   * When paginating, all other parameters provided to
        +   * `SearchPrincipalAccessBoundaryPolicyBindingsRequest` must match the call
        +   * that provided the page token.
        +   * 
        + * + * string page_token = 4 [(.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. A page token, received from a previous
        +   * `SearchPrincipalAccessBoundaryPolicyBindingsRequest` call. Provide this to
        +   * retrieve the subsequent page.
        +   *
        +   * When paginating, all other parameters provided to
        +   * `SearchPrincipalAccessBoundaryPolicyBindingsRequest` must match the call
        +   * that provided the page token.
        +   * 
        + * + * string page_token = 4 [(.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.GeneratedMessage.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, name_); + } + if (pageSize_ != 0) { + output.writeInt32(3, pageSize_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(pageToken_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 4, pageToken_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, name_); + } + if (pageSize_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(3, pageSize_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(pageToken_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(4, 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.iam.v3beta.SearchPrincipalAccessBoundaryPolicyBindingsRequest)) { + return super.equals(obj); + } + com.google.iam.v3beta.SearchPrincipalAccessBoundaryPolicyBindingsRequest other = + (com.google.iam.v3beta.SearchPrincipalAccessBoundaryPolicyBindingsRequest) obj; + + if (!getName().equals(other.getName())) 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) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().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.iam.v3beta.SearchPrincipalAccessBoundaryPolicyBindingsRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.iam.v3beta.SearchPrincipalAccessBoundaryPolicyBindingsRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.iam.v3beta.SearchPrincipalAccessBoundaryPolicyBindingsRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.iam.v3beta.SearchPrincipalAccessBoundaryPolicyBindingsRequest 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.iam.v3beta.SearchPrincipalAccessBoundaryPolicyBindingsRequest parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.iam.v3beta.SearchPrincipalAccessBoundaryPolicyBindingsRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.iam.v3beta.SearchPrincipalAccessBoundaryPolicyBindingsRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.iam.v3beta.SearchPrincipalAccessBoundaryPolicyBindingsRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.iam.v3beta.SearchPrincipalAccessBoundaryPolicyBindingsRequest + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.iam.v3beta.SearchPrincipalAccessBoundaryPolicyBindingsRequest + parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.iam.v3beta.SearchPrincipalAccessBoundaryPolicyBindingsRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.iam.v3beta.SearchPrincipalAccessBoundaryPolicyBindingsRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.iam.v3beta.SearchPrincipalAccessBoundaryPolicyBindingsRequest 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
        +   * Request message for SearchPrincipalAccessBoundaryPolicyBindings rpc.
        +   * 
        + * + * Protobuf type {@code google.iam.v3beta.SearchPrincipalAccessBoundaryPolicyBindingsRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.iam.v3beta.SearchPrincipalAccessBoundaryPolicyBindingsRequest) + com.google.iam.v3beta.SearchPrincipalAccessBoundaryPolicyBindingsRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.iam.v3beta.PrincipalAccessBoundaryPoliciesServiceProto + .internal_static_google_iam_v3beta_SearchPrincipalAccessBoundaryPolicyBindingsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.iam.v3beta.PrincipalAccessBoundaryPoliciesServiceProto + .internal_static_google_iam_v3beta_SearchPrincipalAccessBoundaryPolicyBindingsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.iam.v3beta.SearchPrincipalAccessBoundaryPolicyBindingsRequest.class, + com.google.iam.v3beta.SearchPrincipalAccessBoundaryPolicyBindingsRequest.Builder + .class); + } + + // Construct using + // com.google.iam.v3beta.SearchPrincipalAccessBoundaryPolicyBindingsRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + pageSize_ = 0; + pageToken_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.iam.v3beta.PrincipalAccessBoundaryPoliciesServiceProto + .internal_static_google_iam_v3beta_SearchPrincipalAccessBoundaryPolicyBindingsRequest_descriptor; + } + + @java.lang.Override + public com.google.iam.v3beta.SearchPrincipalAccessBoundaryPolicyBindingsRequest + getDefaultInstanceForType() { + return com.google.iam.v3beta.SearchPrincipalAccessBoundaryPolicyBindingsRequest + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.iam.v3beta.SearchPrincipalAccessBoundaryPolicyBindingsRequest build() { + com.google.iam.v3beta.SearchPrincipalAccessBoundaryPolicyBindingsRequest result = + buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.iam.v3beta.SearchPrincipalAccessBoundaryPolicyBindingsRequest buildPartial() { + com.google.iam.v3beta.SearchPrincipalAccessBoundaryPolicyBindingsRequest result = + new com.google.iam.v3beta.SearchPrincipalAccessBoundaryPolicyBindingsRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.iam.v3beta.SearchPrincipalAccessBoundaryPolicyBindingsRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.pageSize_ = pageSize_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.pageToken_ = pageToken_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other + instanceof com.google.iam.v3beta.SearchPrincipalAccessBoundaryPolicyBindingsRequest) { + return mergeFrom( + (com.google.iam.v3beta.SearchPrincipalAccessBoundaryPolicyBindingsRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.iam.v3beta.SearchPrincipalAccessBoundaryPolicyBindingsRequest other) { + if (other + == com.google.iam.v3beta.SearchPrincipalAccessBoundaryPolicyBindingsRequest + .getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.getPageSize() != 0) { + setPageSize(other.getPageSize()); + } + if (!other.getPageToken().isEmpty()) { + pageToken_ = other.pageToken_; + 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 24: + { + pageSize_ = input.readInt32(); + bitField0_ |= 0x00000002; + break; + } // case 24 + case 34: + { + pageToken_ = 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. The name of the principal access boundary policy.
        +     * Format:
        +     * `organizations/{organization_id}/locations/{location}/principalAccessBoundaryPolicies/{principal_access_boundary_policy_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 name of the principal access boundary policy.
        +     * Format:
        +     * `organizations/{organization_id}/locations/{location}/principalAccessBoundaryPolicies/{principal_access_boundary_policy_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 name of the principal access boundary policy.
        +     * Format:
        +     * `organizations/{organization_id}/locations/{location}/principalAccessBoundaryPolicies/{principal_access_boundary_policy_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 name of the principal access boundary policy.
        +     * Format:
        +     * `organizations/{organization_id}/locations/{location}/principalAccessBoundaryPolicies/{principal_access_boundary_policy_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 name of the principal access boundary policy.
        +     * Format:
        +     * `organizations/{organization_id}/locations/{location}/principalAccessBoundaryPolicies/{principal_access_boundary_policy_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; + } + + private int pageSize_; + + /** + * + * + *
        +     * Optional. The maximum number of policy bindings to return. The service may
        +     * return fewer than this value.
        +     *
        +     * If unspecified, at most 50 policy bindings will be returned.
        +     * The maximum value is 1000; values above 1000 will be coerced to 1000.
        +     * 
        + * + * 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 policy bindings to return. The service may
        +     * return fewer than this value.
        +     *
        +     * If unspecified, at most 50 policy bindings will be returned.
        +     * The maximum value is 1000; values above 1000 will be coerced to 1000.
        +     * 
        + * + * 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_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
        +     * Optional. The maximum number of policy bindings to return. The service may
        +     * return fewer than this value.
        +     *
        +     * If unspecified, at most 50 policy bindings will be returned.
        +     * The maximum value is 1000; values above 1000 will be coerced to 1000.
        +     * 
        + * + * int32 page_size = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearPageSize() { + bitField0_ = (bitField0_ & ~0x00000002); + pageSize_ = 0; + onChanged(); + return this; + } + + private java.lang.Object pageToken_ = ""; + + /** + * + * + *
        +     * Optional. A page token, received from a previous
        +     * `SearchPrincipalAccessBoundaryPolicyBindingsRequest` call. Provide this to
        +     * retrieve the subsequent page.
        +     *
        +     * When paginating, all other parameters provided to
        +     * `SearchPrincipalAccessBoundaryPolicyBindingsRequest` must match the call
        +     * that provided the page token.
        +     * 
        + * + * string page_token = 4 [(.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. A page token, received from a previous
        +     * `SearchPrincipalAccessBoundaryPolicyBindingsRequest` call. Provide this to
        +     * retrieve the subsequent page.
        +     *
        +     * When paginating, all other parameters provided to
        +     * `SearchPrincipalAccessBoundaryPolicyBindingsRequest` must match the call
        +     * that provided the page token.
        +     * 
        + * + * string page_token = 4 [(.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. A page token, received from a previous
        +     * `SearchPrincipalAccessBoundaryPolicyBindingsRequest` call. Provide this to
        +     * retrieve the subsequent page.
        +     *
        +     * When paginating, all other parameters provided to
        +     * `SearchPrincipalAccessBoundaryPolicyBindingsRequest` must match the call
        +     * that provided the page token.
        +     * 
        + * + * string page_token = 4 [(.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_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
        +     * Optional. A page token, received from a previous
        +     * `SearchPrincipalAccessBoundaryPolicyBindingsRequest` call. Provide this to
        +     * retrieve the subsequent page.
        +     *
        +     * When paginating, all other parameters provided to
        +     * `SearchPrincipalAccessBoundaryPolicyBindingsRequest` must match the call
        +     * that provided the page token.
        +     * 
        + * + * string page_token = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearPageToken() { + pageToken_ = getDefaultInstance().getPageToken(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + + /** + * + * + *
        +     * Optional. A page token, received from a previous
        +     * `SearchPrincipalAccessBoundaryPolicyBindingsRequest` call. Provide this to
        +     * retrieve the subsequent page.
        +     *
        +     * When paginating, all other parameters provided to
        +     * `SearchPrincipalAccessBoundaryPolicyBindingsRequest` must match the call
        +     * that provided the page token.
        +     * 
        + * + * string page_token = 4 [(.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_ |= 0x00000004; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.iam.v3beta.SearchPrincipalAccessBoundaryPolicyBindingsRequest) + } + + // @@protoc_insertion_point(class_scope:google.iam.v3beta.SearchPrincipalAccessBoundaryPolicyBindingsRequest) + private static final com.google.iam.v3beta.SearchPrincipalAccessBoundaryPolicyBindingsRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = + new com.google.iam.v3beta.SearchPrincipalAccessBoundaryPolicyBindingsRequest(); + } + + public static com.google.iam.v3beta.SearchPrincipalAccessBoundaryPolicyBindingsRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser< + SearchPrincipalAccessBoundaryPolicyBindingsRequest> + PARSER = + new com.google.protobuf.AbstractParser< + SearchPrincipalAccessBoundaryPolicyBindingsRequest>() { + @java.lang.Override + public SearchPrincipalAccessBoundaryPolicyBindingsRequest 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.iam.v3beta.SearchPrincipalAccessBoundaryPolicyBindingsRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-iam/proto-google-iam-v3beta/src/main/java/com/google/iam/v3beta/SearchPrincipalAccessBoundaryPolicyBindingsRequestOrBuilder.java b/java-iam/proto-google-iam-v3beta/src/main/java/com/google/iam/v3beta/SearchPrincipalAccessBoundaryPolicyBindingsRequestOrBuilder.java new file mode 100644 index 0000000000..3caf78ba81 --- /dev/null +++ b/java-iam/proto-google-iam-v3beta/src/main/java/com/google/iam/v3beta/SearchPrincipalAccessBoundaryPolicyBindingsRequestOrBuilder.java @@ -0,0 +1,117 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/iam/v3beta/principal_access_boundary_policies_service.proto +// Protobuf Java Version: 4.33.2 + +package com.google.iam.v3beta; + +@com.google.protobuf.Generated +public interface SearchPrincipalAccessBoundaryPolicyBindingsRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.iam.v3beta.SearchPrincipalAccessBoundaryPolicyBindingsRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
        +   * Required. The name of the principal access boundary policy.
        +   * Format:
        +   * `organizations/{organization_id}/locations/{location}/principalAccessBoundaryPolicies/{principal_access_boundary_policy_id}`
        +   * 
        + * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + + /** + * + * + *
        +   * Required. The name of the principal access boundary policy.
        +   * Format:
        +   * `organizations/{organization_id}/locations/{location}/principalAccessBoundaryPolicies/{principal_access_boundary_policy_id}`
        +   * 
        + * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
        +   * Optional. The maximum number of policy bindings to return. The service may
        +   * return fewer than this value.
        +   *
        +   * If unspecified, at most 50 policy bindings will be returned.
        +   * The maximum value is 1000; values above 1000 will be coerced to 1000.
        +   * 
        + * + * int32 page_size = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageSize. + */ + int getPageSize(); + + /** + * + * + *
        +   * Optional. A page token, received from a previous
        +   * `SearchPrincipalAccessBoundaryPolicyBindingsRequest` call. Provide this to
        +   * retrieve the subsequent page.
        +   *
        +   * When paginating, all other parameters provided to
        +   * `SearchPrincipalAccessBoundaryPolicyBindingsRequest` must match the call
        +   * that provided the page token.
        +   * 
        + * + * string page_token = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageToken. + */ + java.lang.String getPageToken(); + + /** + * + * + *
        +   * Optional. A page token, received from a previous
        +   * `SearchPrincipalAccessBoundaryPolicyBindingsRequest` call. Provide this to
        +   * retrieve the subsequent page.
        +   *
        +   * When paginating, all other parameters provided to
        +   * `SearchPrincipalAccessBoundaryPolicyBindingsRequest` must match the call
        +   * that provided the page token.
        +   * 
        + * + * string page_token = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for pageToken. + */ + com.google.protobuf.ByteString getPageTokenBytes(); +} diff --git a/java-iam/proto-google-iam-v3beta/src/main/java/com/google/iam/v3beta/SearchPrincipalAccessBoundaryPolicyBindingsResponse.java b/java-iam/proto-google-iam-v3beta/src/main/java/com/google/iam/v3beta/SearchPrincipalAccessBoundaryPolicyBindingsResponse.java new file mode 100644 index 0000000000..b9a787d7ab --- /dev/null +++ b/java-iam/proto-google-iam-v3beta/src/main/java/com/google/iam/v3beta/SearchPrincipalAccessBoundaryPolicyBindingsResponse.java @@ -0,0 +1,1149 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/iam/v3beta/principal_access_boundary_policies_service.proto +// Protobuf Java Version: 4.33.2 + +package com.google.iam.v3beta; + +/** + * + * + *
        + * Response message for SearchPrincipalAccessBoundaryPolicyBindings rpc.
        + * 
        + * + * Protobuf type {@code google.iam.v3beta.SearchPrincipalAccessBoundaryPolicyBindingsResponse} + */ +@com.google.protobuf.Generated +public final class SearchPrincipalAccessBoundaryPolicyBindingsResponse + extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.iam.v3beta.SearchPrincipalAccessBoundaryPolicyBindingsResponse) + SearchPrincipalAccessBoundaryPolicyBindingsResponseOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "SearchPrincipalAccessBoundaryPolicyBindingsResponse"); + } + + // Use SearchPrincipalAccessBoundaryPolicyBindingsResponse.newBuilder() to construct. + private SearchPrincipalAccessBoundaryPolicyBindingsResponse( + com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private SearchPrincipalAccessBoundaryPolicyBindingsResponse() { + policyBindings_ = java.util.Collections.emptyList(); + nextPageToken_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.iam.v3beta.PrincipalAccessBoundaryPoliciesServiceProto + .internal_static_google_iam_v3beta_SearchPrincipalAccessBoundaryPolicyBindingsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.iam.v3beta.PrincipalAccessBoundaryPoliciesServiceProto + .internal_static_google_iam_v3beta_SearchPrincipalAccessBoundaryPolicyBindingsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.iam.v3beta.SearchPrincipalAccessBoundaryPolicyBindingsResponse.class, + com.google.iam.v3beta.SearchPrincipalAccessBoundaryPolicyBindingsResponse.Builder + .class); + } + + public static final int POLICY_BINDINGS_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private java.util.List policyBindings_; + + /** + * + * + *
        +   * The policy bindings that reference the specified policy.
        +   * 
        + * + * repeated .google.iam.v3beta.PolicyBinding policy_bindings = 1; + */ + @java.lang.Override + public java.util.List getPolicyBindingsList() { + return policyBindings_; + } + + /** + * + * + *
        +   * The policy bindings that reference the specified policy.
        +   * 
        + * + * repeated .google.iam.v3beta.PolicyBinding policy_bindings = 1; + */ + @java.lang.Override + public java.util.List + getPolicyBindingsOrBuilderList() { + return policyBindings_; + } + + /** + * + * + *
        +   * The policy bindings that reference the specified policy.
        +   * 
        + * + * repeated .google.iam.v3beta.PolicyBinding policy_bindings = 1; + */ + @java.lang.Override + public int getPolicyBindingsCount() { + return policyBindings_.size(); + } + + /** + * + * + *
        +   * The policy bindings that reference the specified policy.
        +   * 
        + * + * repeated .google.iam.v3beta.PolicyBinding policy_bindings = 1; + */ + @java.lang.Override + public com.google.iam.v3beta.PolicyBinding getPolicyBindings(int index) { + return policyBindings_.get(index); + } + + /** + * + * + *
        +   * The policy bindings that reference the specified policy.
        +   * 
        + * + * repeated .google.iam.v3beta.PolicyBinding policy_bindings = 1; + */ + @java.lang.Override + public com.google.iam.v3beta.PolicyBindingOrBuilder getPolicyBindingsOrBuilder(int index) { + return policyBindings_.get(index); + } + + public static final int NEXT_PAGE_TOKEN_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object nextPageToken_ = ""; + + /** + * + * + *
        +   * Optional. A token, which can be sent as `page_token` to retrieve the next
        +   * page. If this field is omitted, there are no subsequent pages.
        +   * 
        + * + * string next_page_token = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + } + } + + /** + * + * + *
        +   * Optional. A token, which can be sent as `page_token` to retrieve the next
        +   * page. If this field is omitted, there are no subsequent pages.
        +   * 
        + * + * string next_page_token = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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 < policyBindings_.size(); i++) { + output.writeMessage(1, policyBindings_.get(i)); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(nextPageToken_)) { + com.google.protobuf.GeneratedMessage.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 < policyBindings_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, policyBindings_.get(i)); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(nextPageToken_)) { + size += com.google.protobuf.GeneratedMessage.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.iam.v3beta.SearchPrincipalAccessBoundaryPolicyBindingsResponse)) { + return super.equals(obj); + } + com.google.iam.v3beta.SearchPrincipalAccessBoundaryPolicyBindingsResponse other = + (com.google.iam.v3beta.SearchPrincipalAccessBoundaryPolicyBindingsResponse) obj; + + if (!getPolicyBindingsList().equals(other.getPolicyBindingsList())) 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 (getPolicyBindingsCount() > 0) { + hash = (37 * hash) + POLICY_BINDINGS_FIELD_NUMBER; + hash = (53 * hash) + getPolicyBindingsList().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.iam.v3beta.SearchPrincipalAccessBoundaryPolicyBindingsResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.iam.v3beta.SearchPrincipalAccessBoundaryPolicyBindingsResponse parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.iam.v3beta.SearchPrincipalAccessBoundaryPolicyBindingsResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.iam.v3beta.SearchPrincipalAccessBoundaryPolicyBindingsResponse 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.iam.v3beta.SearchPrincipalAccessBoundaryPolicyBindingsResponse parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.iam.v3beta.SearchPrincipalAccessBoundaryPolicyBindingsResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.iam.v3beta.SearchPrincipalAccessBoundaryPolicyBindingsResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.iam.v3beta.SearchPrincipalAccessBoundaryPolicyBindingsResponse parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.iam.v3beta.SearchPrincipalAccessBoundaryPolicyBindingsResponse + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.iam.v3beta.SearchPrincipalAccessBoundaryPolicyBindingsResponse + parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.iam.v3beta.SearchPrincipalAccessBoundaryPolicyBindingsResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.iam.v3beta.SearchPrincipalAccessBoundaryPolicyBindingsResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.iam.v3beta.SearchPrincipalAccessBoundaryPolicyBindingsResponse 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
        +   * Response message for SearchPrincipalAccessBoundaryPolicyBindings rpc.
        +   * 
        + * + * Protobuf type {@code google.iam.v3beta.SearchPrincipalAccessBoundaryPolicyBindingsResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.iam.v3beta.SearchPrincipalAccessBoundaryPolicyBindingsResponse) + com.google.iam.v3beta.SearchPrincipalAccessBoundaryPolicyBindingsResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.iam.v3beta.PrincipalAccessBoundaryPoliciesServiceProto + .internal_static_google_iam_v3beta_SearchPrincipalAccessBoundaryPolicyBindingsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.iam.v3beta.PrincipalAccessBoundaryPoliciesServiceProto + .internal_static_google_iam_v3beta_SearchPrincipalAccessBoundaryPolicyBindingsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.iam.v3beta.SearchPrincipalAccessBoundaryPolicyBindingsResponse.class, + com.google.iam.v3beta.SearchPrincipalAccessBoundaryPolicyBindingsResponse.Builder + .class); + } + + // Construct using + // com.google.iam.v3beta.SearchPrincipalAccessBoundaryPolicyBindingsResponse.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (policyBindingsBuilder_ == null) { + policyBindings_ = java.util.Collections.emptyList(); + } else { + policyBindings_ = null; + policyBindingsBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + nextPageToken_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.iam.v3beta.PrincipalAccessBoundaryPoliciesServiceProto + .internal_static_google_iam_v3beta_SearchPrincipalAccessBoundaryPolicyBindingsResponse_descriptor; + } + + @java.lang.Override + public com.google.iam.v3beta.SearchPrincipalAccessBoundaryPolicyBindingsResponse + getDefaultInstanceForType() { + return com.google.iam.v3beta.SearchPrincipalAccessBoundaryPolicyBindingsResponse + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.iam.v3beta.SearchPrincipalAccessBoundaryPolicyBindingsResponse build() { + com.google.iam.v3beta.SearchPrincipalAccessBoundaryPolicyBindingsResponse result = + buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.iam.v3beta.SearchPrincipalAccessBoundaryPolicyBindingsResponse + buildPartial() { + com.google.iam.v3beta.SearchPrincipalAccessBoundaryPolicyBindingsResponse result = + new com.google.iam.v3beta.SearchPrincipalAccessBoundaryPolicyBindingsResponse(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields( + com.google.iam.v3beta.SearchPrincipalAccessBoundaryPolicyBindingsResponse result) { + if (policyBindingsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + policyBindings_ = java.util.Collections.unmodifiableList(policyBindings_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.policyBindings_ = policyBindings_; + } else { + result.policyBindings_ = policyBindingsBuilder_.build(); + } + } + + private void buildPartial0( + com.google.iam.v3beta.SearchPrincipalAccessBoundaryPolicyBindingsResponse result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.nextPageToken_ = nextPageToken_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other + instanceof com.google.iam.v3beta.SearchPrincipalAccessBoundaryPolicyBindingsResponse) { + return mergeFrom( + (com.google.iam.v3beta.SearchPrincipalAccessBoundaryPolicyBindingsResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.iam.v3beta.SearchPrincipalAccessBoundaryPolicyBindingsResponse other) { + if (other + == com.google.iam.v3beta.SearchPrincipalAccessBoundaryPolicyBindingsResponse + .getDefaultInstance()) return this; + if (policyBindingsBuilder_ == null) { + if (!other.policyBindings_.isEmpty()) { + if (policyBindings_.isEmpty()) { + policyBindings_ = other.policyBindings_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensurePolicyBindingsIsMutable(); + policyBindings_.addAll(other.policyBindings_); + } + onChanged(); + } + } else { + if (!other.policyBindings_.isEmpty()) { + if (policyBindingsBuilder_.isEmpty()) { + policyBindingsBuilder_.dispose(); + policyBindingsBuilder_ = null; + policyBindings_ = other.policyBindings_; + bitField0_ = (bitField0_ & ~0x00000001); + policyBindingsBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders + ? internalGetPolicyBindingsFieldBuilder() + : null; + } else { + policyBindingsBuilder_.addAllMessages(other.policyBindings_); + } + } + } + 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.iam.v3beta.PolicyBinding m = + input.readMessage( + com.google.iam.v3beta.PolicyBinding.parser(), extensionRegistry); + if (policyBindingsBuilder_ == null) { + ensurePolicyBindingsIsMutable(); + policyBindings_.add(m); + } else { + policyBindingsBuilder_.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 policyBindings_ = + java.util.Collections.emptyList(); + + private void ensurePolicyBindingsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + policyBindings_ = + new java.util.ArrayList(policyBindings_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.google.iam.v3beta.PolicyBinding, + com.google.iam.v3beta.PolicyBinding.Builder, + com.google.iam.v3beta.PolicyBindingOrBuilder> + policyBindingsBuilder_; + + /** + * + * + *
        +     * The policy bindings that reference the specified policy.
        +     * 
        + * + * repeated .google.iam.v3beta.PolicyBinding policy_bindings = 1; + */ + public java.util.List getPolicyBindingsList() { + if (policyBindingsBuilder_ == null) { + return java.util.Collections.unmodifiableList(policyBindings_); + } else { + return policyBindingsBuilder_.getMessageList(); + } + } + + /** + * + * + *
        +     * The policy bindings that reference the specified policy.
        +     * 
        + * + * repeated .google.iam.v3beta.PolicyBinding policy_bindings = 1; + */ + public int getPolicyBindingsCount() { + if (policyBindingsBuilder_ == null) { + return policyBindings_.size(); + } else { + return policyBindingsBuilder_.getCount(); + } + } + + /** + * + * + *
        +     * The policy bindings that reference the specified policy.
        +     * 
        + * + * repeated .google.iam.v3beta.PolicyBinding policy_bindings = 1; + */ + public com.google.iam.v3beta.PolicyBinding getPolicyBindings(int index) { + if (policyBindingsBuilder_ == null) { + return policyBindings_.get(index); + } else { + return policyBindingsBuilder_.getMessage(index); + } + } + + /** + * + * + *
        +     * The policy bindings that reference the specified policy.
        +     * 
        + * + * repeated .google.iam.v3beta.PolicyBinding policy_bindings = 1; + */ + public Builder setPolicyBindings(int index, com.google.iam.v3beta.PolicyBinding value) { + if (policyBindingsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensurePolicyBindingsIsMutable(); + policyBindings_.set(index, value); + onChanged(); + } else { + policyBindingsBuilder_.setMessage(index, value); + } + return this; + } + + /** + * + * + *
        +     * The policy bindings that reference the specified policy.
        +     * 
        + * + * repeated .google.iam.v3beta.PolicyBinding policy_bindings = 1; + */ + public Builder setPolicyBindings( + int index, com.google.iam.v3beta.PolicyBinding.Builder builderForValue) { + if (policyBindingsBuilder_ == null) { + ensurePolicyBindingsIsMutable(); + policyBindings_.set(index, builderForValue.build()); + onChanged(); + } else { + policyBindingsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
        +     * The policy bindings that reference the specified policy.
        +     * 
        + * + * repeated .google.iam.v3beta.PolicyBinding policy_bindings = 1; + */ + public Builder addPolicyBindings(com.google.iam.v3beta.PolicyBinding value) { + if (policyBindingsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensurePolicyBindingsIsMutable(); + policyBindings_.add(value); + onChanged(); + } else { + policyBindingsBuilder_.addMessage(value); + } + return this; + } + + /** + * + * + *
        +     * The policy bindings that reference the specified policy.
        +     * 
        + * + * repeated .google.iam.v3beta.PolicyBinding policy_bindings = 1; + */ + public Builder addPolicyBindings(int index, com.google.iam.v3beta.PolicyBinding value) { + if (policyBindingsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensurePolicyBindingsIsMutable(); + policyBindings_.add(index, value); + onChanged(); + } else { + policyBindingsBuilder_.addMessage(index, value); + } + return this; + } + + /** + * + * + *
        +     * The policy bindings that reference the specified policy.
        +     * 
        + * + * repeated .google.iam.v3beta.PolicyBinding policy_bindings = 1; + */ + public Builder addPolicyBindings(com.google.iam.v3beta.PolicyBinding.Builder builderForValue) { + if (policyBindingsBuilder_ == null) { + ensurePolicyBindingsIsMutable(); + policyBindings_.add(builderForValue.build()); + onChanged(); + } else { + policyBindingsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + + /** + * + * + *
        +     * The policy bindings that reference the specified policy.
        +     * 
        + * + * repeated .google.iam.v3beta.PolicyBinding policy_bindings = 1; + */ + public Builder addPolicyBindings( + int index, com.google.iam.v3beta.PolicyBinding.Builder builderForValue) { + if (policyBindingsBuilder_ == null) { + ensurePolicyBindingsIsMutable(); + policyBindings_.add(index, builderForValue.build()); + onChanged(); + } else { + policyBindingsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
        +     * The policy bindings that reference the specified policy.
        +     * 
        + * + * repeated .google.iam.v3beta.PolicyBinding policy_bindings = 1; + */ + public Builder addAllPolicyBindings( + java.lang.Iterable values) { + if (policyBindingsBuilder_ == null) { + ensurePolicyBindingsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, policyBindings_); + onChanged(); + } else { + policyBindingsBuilder_.addAllMessages(values); + } + return this; + } + + /** + * + * + *
        +     * The policy bindings that reference the specified policy.
        +     * 
        + * + * repeated .google.iam.v3beta.PolicyBinding policy_bindings = 1; + */ + public Builder clearPolicyBindings() { + if (policyBindingsBuilder_ == null) { + policyBindings_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + policyBindingsBuilder_.clear(); + } + return this; + } + + /** + * + * + *
        +     * The policy bindings that reference the specified policy.
        +     * 
        + * + * repeated .google.iam.v3beta.PolicyBinding policy_bindings = 1; + */ + public Builder removePolicyBindings(int index) { + if (policyBindingsBuilder_ == null) { + ensurePolicyBindingsIsMutable(); + policyBindings_.remove(index); + onChanged(); + } else { + policyBindingsBuilder_.remove(index); + } + return this; + } + + /** + * + * + *
        +     * The policy bindings that reference the specified policy.
        +     * 
        + * + * repeated .google.iam.v3beta.PolicyBinding policy_bindings = 1; + */ + public com.google.iam.v3beta.PolicyBinding.Builder getPolicyBindingsBuilder(int index) { + return internalGetPolicyBindingsFieldBuilder().getBuilder(index); + } + + /** + * + * + *
        +     * The policy bindings that reference the specified policy.
        +     * 
        + * + * repeated .google.iam.v3beta.PolicyBinding policy_bindings = 1; + */ + public com.google.iam.v3beta.PolicyBindingOrBuilder getPolicyBindingsOrBuilder(int index) { + if (policyBindingsBuilder_ == null) { + return policyBindings_.get(index); + } else { + return policyBindingsBuilder_.getMessageOrBuilder(index); + } + } + + /** + * + * + *
        +     * The policy bindings that reference the specified policy.
        +     * 
        + * + * repeated .google.iam.v3beta.PolicyBinding policy_bindings = 1; + */ + public java.util.List + getPolicyBindingsOrBuilderList() { + if (policyBindingsBuilder_ != null) { + return policyBindingsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(policyBindings_); + } + } + + /** + * + * + *
        +     * The policy bindings that reference the specified policy.
        +     * 
        + * + * repeated .google.iam.v3beta.PolicyBinding policy_bindings = 1; + */ + public com.google.iam.v3beta.PolicyBinding.Builder addPolicyBindingsBuilder() { + return internalGetPolicyBindingsFieldBuilder() + .addBuilder(com.google.iam.v3beta.PolicyBinding.getDefaultInstance()); + } + + /** + * + * + *
        +     * The policy bindings that reference the specified policy.
        +     * 
        + * + * repeated .google.iam.v3beta.PolicyBinding policy_bindings = 1; + */ + public com.google.iam.v3beta.PolicyBinding.Builder addPolicyBindingsBuilder(int index) { + return internalGetPolicyBindingsFieldBuilder() + .addBuilder(index, com.google.iam.v3beta.PolicyBinding.getDefaultInstance()); + } + + /** + * + * + *
        +     * The policy bindings that reference the specified policy.
        +     * 
        + * + * repeated .google.iam.v3beta.PolicyBinding policy_bindings = 1; + */ + public java.util.List + getPolicyBindingsBuilderList() { + return internalGetPolicyBindingsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.google.iam.v3beta.PolicyBinding, + com.google.iam.v3beta.PolicyBinding.Builder, + com.google.iam.v3beta.PolicyBindingOrBuilder> + internalGetPolicyBindingsFieldBuilder() { + if (policyBindingsBuilder_ == null) { + policyBindingsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilder< + com.google.iam.v3beta.PolicyBinding, + com.google.iam.v3beta.PolicyBinding.Builder, + com.google.iam.v3beta.PolicyBindingOrBuilder>( + policyBindings_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + policyBindings_ = null; + } + return policyBindingsBuilder_; + } + + private java.lang.Object nextPageToken_ = ""; + + /** + * + * + *
        +     * Optional. A token, which can be sent as `page_token` to retrieve the next
        +     * page. If this field is omitted, there are no subsequent pages.
        +     * 
        + * + * string next_page_token = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + } + } + + /** + * + * + *
        +     * Optional. A token, which can be sent as `page_token` to retrieve the next
        +     * page. If this field is omitted, there are no subsequent pages.
        +     * 
        + * + * string next_page_token = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + } + } + + /** + * + * + *
        +     * Optional. A token, which can be sent as `page_token` to retrieve the next
        +     * page. If this field is omitted, there are no subsequent pages.
        +     * 
        + * + * string next_page_token = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + } + + /** + * + * + *
        +     * Optional. A token, which can be sent as `page_token` to retrieve the next
        +     * page. If this field is omitted, there are no subsequent pages.
        +     * 
        + * + * string next_page_token = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearNextPageToken() { + nextPageToken_ = getDefaultInstance().getNextPageToken(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
        +     * Optional. A token, which can be sent as `page_token` to retrieve the next
        +     * page. If this field is omitted, there are no subsequent pages.
        +     * 
        + * + * string next_page_token = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + } + + // @@protoc_insertion_point(builder_scope:google.iam.v3beta.SearchPrincipalAccessBoundaryPolicyBindingsResponse) + } + + // @@protoc_insertion_point(class_scope:google.iam.v3beta.SearchPrincipalAccessBoundaryPolicyBindingsResponse) + private static final com.google.iam.v3beta.SearchPrincipalAccessBoundaryPolicyBindingsResponse + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = + new com.google.iam.v3beta.SearchPrincipalAccessBoundaryPolicyBindingsResponse(); + } + + public static com.google.iam.v3beta.SearchPrincipalAccessBoundaryPolicyBindingsResponse + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser< + SearchPrincipalAccessBoundaryPolicyBindingsResponse> + PARSER = + new com.google.protobuf.AbstractParser< + SearchPrincipalAccessBoundaryPolicyBindingsResponse>() { + @java.lang.Override + public SearchPrincipalAccessBoundaryPolicyBindingsResponse 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.iam.v3beta.SearchPrincipalAccessBoundaryPolicyBindingsResponse + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-iam/proto-google-iam-v3beta/src/main/java/com/google/iam/v3beta/SearchPrincipalAccessBoundaryPolicyBindingsResponseOrBuilder.java b/java-iam/proto-google-iam-v3beta/src/main/java/com/google/iam/v3beta/SearchPrincipalAccessBoundaryPolicyBindingsResponseOrBuilder.java new file mode 100644 index 0000000000..e466539c76 --- /dev/null +++ b/java-iam/proto-google-iam-v3beta/src/main/java/com/google/iam/v3beta/SearchPrincipalAccessBoundaryPolicyBindingsResponseOrBuilder.java @@ -0,0 +1,112 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/iam/v3beta/principal_access_boundary_policies_service.proto +// Protobuf Java Version: 4.33.2 + +package com.google.iam.v3beta; + +@com.google.protobuf.Generated +public interface SearchPrincipalAccessBoundaryPolicyBindingsResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.iam.v3beta.SearchPrincipalAccessBoundaryPolicyBindingsResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
        +   * The policy bindings that reference the specified policy.
        +   * 
        + * + * repeated .google.iam.v3beta.PolicyBinding policy_bindings = 1; + */ + java.util.List getPolicyBindingsList(); + + /** + * + * + *
        +   * The policy bindings that reference the specified policy.
        +   * 
        + * + * repeated .google.iam.v3beta.PolicyBinding policy_bindings = 1; + */ + com.google.iam.v3beta.PolicyBinding getPolicyBindings(int index); + + /** + * + * + *
        +   * The policy bindings that reference the specified policy.
        +   * 
        + * + * repeated .google.iam.v3beta.PolicyBinding policy_bindings = 1; + */ + int getPolicyBindingsCount(); + + /** + * + * + *
        +   * The policy bindings that reference the specified policy.
        +   * 
        + * + * repeated .google.iam.v3beta.PolicyBinding policy_bindings = 1; + */ + java.util.List + getPolicyBindingsOrBuilderList(); + + /** + * + * + *
        +   * The policy bindings that reference the specified policy.
        +   * 
        + * + * repeated .google.iam.v3beta.PolicyBinding policy_bindings = 1; + */ + com.google.iam.v3beta.PolicyBindingOrBuilder getPolicyBindingsOrBuilder(int index); + + /** + * + * + *
        +   * Optional. A token, which can be sent as `page_token` to retrieve the next
        +   * page. If this field is omitted, there are no subsequent pages.
        +   * 
        + * + * string next_page_token = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The nextPageToken. + */ + java.lang.String getNextPageToken(); + + /** + * + * + *
        +   * Optional. A token, which can be sent as `page_token` to retrieve the next
        +   * page. If this field is omitted, there are no subsequent pages.
        +   * 
        + * + * string next_page_token = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for nextPageToken. + */ + com.google.protobuf.ByteString getNextPageTokenBytes(); +} diff --git a/java-iam/proto-google-iam-v3beta/src/main/java/com/google/iam/v3beta/SearchTargetPolicyBindingsRequest.java b/java-iam/proto-google-iam-v3beta/src/main/java/com/google/iam/v3beta/SearchTargetPolicyBindingsRequest.java new file mode 100644 index 0000000000..c520c8c5e9 --- /dev/null +++ b/java-iam/proto-google-iam-v3beta/src/main/java/com/google/iam/v3beta/SearchTargetPolicyBindingsRequest.java @@ -0,0 +1,1271 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/iam/v3beta/policy_bindings_service.proto +// Protobuf Java Version: 4.33.2 + +package com.google.iam.v3beta; + +/** + * + * + *
        + * Request message for SearchTargetPolicyBindings method.
        + * 
        + * + * Protobuf type {@code google.iam.v3beta.SearchTargetPolicyBindingsRequest} + */ +@com.google.protobuf.Generated +public final class SearchTargetPolicyBindingsRequest extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.iam.v3beta.SearchTargetPolicyBindingsRequest) + SearchTargetPolicyBindingsRequestOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "SearchTargetPolicyBindingsRequest"); + } + + // Use SearchTargetPolicyBindingsRequest.newBuilder() to construct. + private SearchTargetPolicyBindingsRequest( + com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private SearchTargetPolicyBindingsRequest() { + target_ = ""; + pageToken_ = ""; + parent_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.iam.v3beta.PolicyBindingsServiceProto + .internal_static_google_iam_v3beta_SearchTargetPolicyBindingsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.iam.v3beta.PolicyBindingsServiceProto + .internal_static_google_iam_v3beta_SearchTargetPolicyBindingsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.iam.v3beta.SearchTargetPolicyBindingsRequest.class, + com.google.iam.v3beta.SearchTargetPolicyBindingsRequest.Builder.class); + } + + public static final int TARGET_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object target_ = ""; + + /** + * + * + *
        +   * Required. The target resource, which is bound to the policy in the binding.
        +   *
        +   * Format:
        +   *
        +   * * `//iam.googleapis.com/locations/global/workforcePools/POOL_ID`
        +   * * `//iam.googleapis.com/projects/PROJECT_NUMBER/locations/global/workloadIdentityPools/POOL_ID`
        +   * * `//iam.googleapis.com/locations/global/workspace/WORKSPACE_ID`
        +   * * `//cloudresourcemanager.googleapis.com/projects/{project_number}`
        +   * * `//cloudresourcemanager.googleapis.com/folders/{folder_id}`
        +   * * `//cloudresourcemanager.googleapis.com/organizations/{organization_id}`
        +   * 
        + * + * string target = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The target. + */ + @java.lang.Override + public java.lang.String getTarget() { + java.lang.Object ref = target_; + 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(); + target_ = s; + return s; + } + } + + /** + * + * + *
        +   * Required. The target resource, which is bound to the policy in the binding.
        +   *
        +   * Format:
        +   *
        +   * * `//iam.googleapis.com/locations/global/workforcePools/POOL_ID`
        +   * * `//iam.googleapis.com/projects/PROJECT_NUMBER/locations/global/workloadIdentityPools/POOL_ID`
        +   * * `//iam.googleapis.com/locations/global/workspace/WORKSPACE_ID`
        +   * * `//cloudresourcemanager.googleapis.com/projects/{project_number}`
        +   * * `//cloudresourcemanager.googleapis.com/folders/{folder_id}`
        +   * * `//cloudresourcemanager.googleapis.com/organizations/{organization_id}`
        +   * 
        + * + * string target = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for target. + */ + @java.lang.Override + public com.google.protobuf.ByteString getTargetBytes() { + java.lang.Object ref = target_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + target_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PAGE_SIZE_FIELD_NUMBER = 2; + private int pageSize_ = 0; + + /** + * + * + *
        +   * Optional. The maximum number of policy bindings to return. The service may
        +   * return fewer than this value.
        +   *
        +   * If unspecified, at most 50 policy bindings will be returned.
        +   * The maximum value is 1000; values above 1000 will be coerced to 1000.
        +   * 
        + * + * 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. A page token, received from a previous
        +   * `SearchTargetPolicyBindingsRequest` call. Provide this to retrieve the
        +   * subsequent page.
        +   *
        +   * When paginating, all other parameters provided to
        +   * `SearchTargetPolicyBindingsRequest` must match the call that provided the
        +   * page token.
        +   * 
        + * + * 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. A page token, received from a previous
        +   * `SearchTargetPolicyBindingsRequest` call. Provide this to retrieve the
        +   * subsequent page.
        +   *
        +   * When paginating, all other parameters provided to
        +   * `SearchTargetPolicyBindingsRequest` must match the call that provided the
        +   * page token.
        +   * 
        + * + * 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; + } + } + + public static final int PARENT_FIELD_NUMBER = 5; + + @SuppressWarnings("serial") + private volatile java.lang.Object parent_ = ""; + + /** + * + * + *
        +   * Required. The parent resource where this search will be performed. This
        +   * should be the nearest Resource Manager resource (project, folder, or
        +   * organization) to the target.
        +   *
        +   * Format:
        +   *
        +   * * `projects/{project_id}/locations/{location}`
        +   * * `projects/{project_number}/locations/{location}`
        +   * * `folders/{folder_id}/locations/{location}`
        +   * * `organizations/{organization_id}/locations/{location}`
        +   * 
        + * + * + * string parent = 5 [(.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 where this search will be performed. This
        +   * should be the nearest Resource Manager resource (project, folder, or
        +   * organization) to the target.
        +   *
        +   * Format:
        +   *
        +   * * `projects/{project_id}/locations/{location}`
        +   * * `projects/{project_number}/locations/{location}`
        +   * * `folders/{folder_id}/locations/{location}`
        +   * * `organizations/{organization_id}/locations/{location}`
        +   * 
        + * + * + * string parent = 5 [(.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; + } + } + + 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.GeneratedMessage.isStringEmpty(target_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, target_); + } + if (pageSize_ != 0) { + output.writeInt32(2, pageSize_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(pageToken_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 3, pageToken_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(parent_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 5, parent_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(target_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, target_); + } + if (pageSize_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(2, pageSize_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(pageToken_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(3, pageToken_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(parent_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(5, parent_); + } + 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.iam.v3beta.SearchTargetPolicyBindingsRequest)) { + return super.equals(obj); + } + com.google.iam.v3beta.SearchTargetPolicyBindingsRequest other = + (com.google.iam.v3beta.SearchTargetPolicyBindingsRequest) obj; + + if (!getTarget().equals(other.getTarget())) return false; + if (getPageSize() != other.getPageSize()) return false; + if (!getPageToken().equals(other.getPageToken())) return false; + if (!getParent().equals(other.getParent())) 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) + TARGET_FIELD_NUMBER; + hash = (53 * hash) + getTarget().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 = (37 * hash) + PARENT_FIELD_NUMBER; + hash = (53 * hash) + getParent().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.iam.v3beta.SearchTargetPolicyBindingsRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.iam.v3beta.SearchTargetPolicyBindingsRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.iam.v3beta.SearchTargetPolicyBindingsRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.iam.v3beta.SearchTargetPolicyBindingsRequest 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.iam.v3beta.SearchTargetPolicyBindingsRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.iam.v3beta.SearchTargetPolicyBindingsRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.iam.v3beta.SearchTargetPolicyBindingsRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.iam.v3beta.SearchTargetPolicyBindingsRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.iam.v3beta.SearchTargetPolicyBindingsRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.iam.v3beta.SearchTargetPolicyBindingsRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.iam.v3beta.SearchTargetPolicyBindingsRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.iam.v3beta.SearchTargetPolicyBindingsRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.iam.v3beta.SearchTargetPolicyBindingsRequest 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
        +   * Request message for SearchTargetPolicyBindings method.
        +   * 
        + * + * Protobuf type {@code google.iam.v3beta.SearchTargetPolicyBindingsRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.iam.v3beta.SearchTargetPolicyBindingsRequest) + com.google.iam.v3beta.SearchTargetPolicyBindingsRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.iam.v3beta.PolicyBindingsServiceProto + .internal_static_google_iam_v3beta_SearchTargetPolicyBindingsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.iam.v3beta.PolicyBindingsServiceProto + .internal_static_google_iam_v3beta_SearchTargetPolicyBindingsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.iam.v3beta.SearchTargetPolicyBindingsRequest.class, + com.google.iam.v3beta.SearchTargetPolicyBindingsRequest.Builder.class); + } + + // Construct using com.google.iam.v3beta.SearchTargetPolicyBindingsRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + target_ = ""; + pageSize_ = 0; + pageToken_ = ""; + parent_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.iam.v3beta.PolicyBindingsServiceProto + .internal_static_google_iam_v3beta_SearchTargetPolicyBindingsRequest_descriptor; + } + + @java.lang.Override + public com.google.iam.v3beta.SearchTargetPolicyBindingsRequest getDefaultInstanceForType() { + return com.google.iam.v3beta.SearchTargetPolicyBindingsRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.iam.v3beta.SearchTargetPolicyBindingsRequest build() { + com.google.iam.v3beta.SearchTargetPolicyBindingsRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.iam.v3beta.SearchTargetPolicyBindingsRequest buildPartial() { + com.google.iam.v3beta.SearchTargetPolicyBindingsRequest result = + new com.google.iam.v3beta.SearchTargetPolicyBindingsRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.iam.v3beta.SearchTargetPolicyBindingsRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.target_ = target_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.pageSize_ = pageSize_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.pageToken_ = pageToken_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.parent_ = parent_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.iam.v3beta.SearchTargetPolicyBindingsRequest) { + return mergeFrom((com.google.iam.v3beta.SearchTargetPolicyBindingsRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.iam.v3beta.SearchTargetPolicyBindingsRequest other) { + if (other == com.google.iam.v3beta.SearchTargetPolicyBindingsRequest.getDefaultInstance()) + return this; + if (!other.getTarget().isEmpty()) { + target_ = other.target_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.getPageSize() != 0) { + setPageSize(other.getPageSize()); + } + if (!other.getPageToken().isEmpty()) { + pageToken_ = other.pageToken_; + bitField0_ |= 0x00000004; + onChanged(); + } + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + 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: + { + target_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 16: + { + pageSize_ = input.readInt32(); + bitField0_ |= 0x00000002; + break; + } // case 16 + case 26: + { + pageToken_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 42: + { + parent_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000008; + 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 target_ = ""; + + /** + * + * + *
        +     * Required. The target resource, which is bound to the policy in the binding.
        +     *
        +     * Format:
        +     *
        +     * * `//iam.googleapis.com/locations/global/workforcePools/POOL_ID`
        +     * * `//iam.googleapis.com/projects/PROJECT_NUMBER/locations/global/workloadIdentityPools/POOL_ID`
        +     * * `//iam.googleapis.com/locations/global/workspace/WORKSPACE_ID`
        +     * * `//cloudresourcemanager.googleapis.com/projects/{project_number}`
        +     * * `//cloudresourcemanager.googleapis.com/folders/{folder_id}`
        +     * * `//cloudresourcemanager.googleapis.com/organizations/{organization_id}`
        +     * 
        + * + * string target = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The target. + */ + public java.lang.String getTarget() { + java.lang.Object ref = target_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + target_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
        +     * Required. The target resource, which is bound to the policy in the binding.
        +     *
        +     * Format:
        +     *
        +     * * `//iam.googleapis.com/locations/global/workforcePools/POOL_ID`
        +     * * `//iam.googleapis.com/projects/PROJECT_NUMBER/locations/global/workloadIdentityPools/POOL_ID`
        +     * * `//iam.googleapis.com/locations/global/workspace/WORKSPACE_ID`
        +     * * `//cloudresourcemanager.googleapis.com/projects/{project_number}`
        +     * * `//cloudresourcemanager.googleapis.com/folders/{folder_id}`
        +     * * `//cloudresourcemanager.googleapis.com/organizations/{organization_id}`
        +     * 
        + * + * string target = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for target. + */ + public com.google.protobuf.ByteString getTargetBytes() { + java.lang.Object ref = target_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + target_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
        +     * Required. The target resource, which is bound to the policy in the binding.
        +     *
        +     * Format:
        +     *
        +     * * `//iam.googleapis.com/locations/global/workforcePools/POOL_ID`
        +     * * `//iam.googleapis.com/projects/PROJECT_NUMBER/locations/global/workloadIdentityPools/POOL_ID`
        +     * * `//iam.googleapis.com/locations/global/workspace/WORKSPACE_ID`
        +     * * `//cloudresourcemanager.googleapis.com/projects/{project_number}`
        +     * * `//cloudresourcemanager.googleapis.com/folders/{folder_id}`
        +     * * `//cloudresourcemanager.googleapis.com/organizations/{organization_id}`
        +     * 
        + * + * string target = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The target to set. + * @return This builder for chaining. + */ + public Builder setTarget(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + target_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
        +     * Required. The target resource, which is bound to the policy in the binding.
        +     *
        +     * Format:
        +     *
        +     * * `//iam.googleapis.com/locations/global/workforcePools/POOL_ID`
        +     * * `//iam.googleapis.com/projects/PROJECT_NUMBER/locations/global/workloadIdentityPools/POOL_ID`
        +     * * `//iam.googleapis.com/locations/global/workspace/WORKSPACE_ID`
        +     * * `//cloudresourcemanager.googleapis.com/projects/{project_number}`
        +     * * `//cloudresourcemanager.googleapis.com/folders/{folder_id}`
        +     * * `//cloudresourcemanager.googleapis.com/organizations/{organization_id}`
        +     * 
        + * + * string target = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearTarget() { + target_ = getDefaultInstance().getTarget(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
        +     * Required. The target resource, which is bound to the policy in the binding.
        +     *
        +     * Format:
        +     *
        +     * * `//iam.googleapis.com/locations/global/workforcePools/POOL_ID`
        +     * * `//iam.googleapis.com/projects/PROJECT_NUMBER/locations/global/workloadIdentityPools/POOL_ID`
        +     * * `//iam.googleapis.com/locations/global/workspace/WORKSPACE_ID`
        +     * * `//cloudresourcemanager.googleapis.com/projects/{project_number}`
        +     * * `//cloudresourcemanager.googleapis.com/folders/{folder_id}`
        +     * * `//cloudresourcemanager.googleapis.com/organizations/{organization_id}`
        +     * 
        + * + * string target = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for target to set. + * @return This builder for chaining. + */ + public Builder setTargetBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + target_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private int pageSize_; + + /** + * + * + *
        +     * Optional. The maximum number of policy bindings to return. The service may
        +     * return fewer than this value.
        +     *
        +     * If unspecified, at most 50 policy bindings will be returned.
        +     * The maximum value is 1000; values above 1000 will be coerced to 1000.
        +     * 
        + * + * 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 policy bindings to return. The service may
        +     * return fewer than this value.
        +     *
        +     * If unspecified, at most 50 policy bindings will be returned.
        +     * The maximum value is 1000; values above 1000 will be coerced to 1000.
        +     * 
        + * + * 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_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
        +     * Optional. The maximum number of policy bindings to return. The service may
        +     * return fewer than this value.
        +     *
        +     * If unspecified, at most 50 policy bindings will be returned.
        +     * The maximum value is 1000; values above 1000 will be coerced to 1000.
        +     * 
        + * + * int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearPageSize() { + bitField0_ = (bitField0_ & ~0x00000002); + pageSize_ = 0; + onChanged(); + return this; + } + + private java.lang.Object pageToken_ = ""; + + /** + * + * + *
        +     * Optional. A page token, received from a previous
        +     * `SearchTargetPolicyBindingsRequest` call. Provide this to retrieve the
        +     * subsequent page.
        +     *
        +     * When paginating, all other parameters provided to
        +     * `SearchTargetPolicyBindingsRequest` must match the call that provided the
        +     * page token.
        +     * 
        + * + * 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. A page token, received from a previous
        +     * `SearchTargetPolicyBindingsRequest` call. Provide this to retrieve the
        +     * subsequent page.
        +     *
        +     * When paginating, all other parameters provided to
        +     * `SearchTargetPolicyBindingsRequest` must match the call that provided the
        +     * page token.
        +     * 
        + * + * 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. A page token, received from a previous
        +     * `SearchTargetPolicyBindingsRequest` call. Provide this to retrieve the
        +     * subsequent page.
        +     *
        +     * When paginating, all other parameters provided to
        +     * `SearchTargetPolicyBindingsRequest` must match the call that provided the
        +     * page token.
        +     * 
        + * + * 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_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
        +     * Optional. A page token, received from a previous
        +     * `SearchTargetPolicyBindingsRequest` call. Provide this to retrieve the
        +     * subsequent page.
        +     *
        +     * When paginating, all other parameters provided to
        +     * `SearchTargetPolicyBindingsRequest` must match the call that provided the
        +     * page token.
        +     * 
        + * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearPageToken() { + pageToken_ = getDefaultInstance().getPageToken(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + + /** + * + * + *
        +     * Optional. A page token, received from a previous
        +     * `SearchTargetPolicyBindingsRequest` call. Provide this to retrieve the
        +     * subsequent page.
        +     *
        +     * When paginating, all other parameters provided to
        +     * `SearchTargetPolicyBindingsRequest` must match the call that provided the
        +     * page token.
        +     * 
        + * + * 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_ |= 0x00000004; + onChanged(); + return this; + } + + private java.lang.Object parent_ = ""; + + /** + * + * + *
        +     * Required. The parent resource where this search will be performed. This
        +     * should be the nearest Resource Manager resource (project, folder, or
        +     * organization) to the target.
        +     *
        +     * Format:
        +     *
        +     * * `projects/{project_id}/locations/{location}`
        +     * * `projects/{project_number}/locations/{location}`
        +     * * `folders/{folder_id}/locations/{location}`
        +     * * `organizations/{organization_id}/locations/{location}`
        +     * 
        + * + * + * string parent = 5 [(.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 where this search will be performed. This
        +     * should be the nearest Resource Manager resource (project, folder, or
        +     * organization) to the target.
        +     *
        +     * Format:
        +     *
        +     * * `projects/{project_id}/locations/{location}`
        +     * * `projects/{project_number}/locations/{location}`
        +     * * `folders/{folder_id}/locations/{location}`
        +     * * `organizations/{organization_id}/locations/{location}`
        +     * 
        + * + * + * string parent = 5 [(.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 where this search will be performed. This
        +     * should be the nearest Resource Manager resource (project, folder, or
        +     * organization) to the target.
        +     *
        +     * Format:
        +     *
        +     * * `projects/{project_id}/locations/{location}`
        +     * * `projects/{project_number}/locations/{location}`
        +     * * `folders/{folder_id}/locations/{location}`
        +     * * `organizations/{organization_id}/locations/{location}`
        +     * 
        + * + * + * string parent = 5 [(.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_ |= 0x00000008; + onChanged(); + return this; + } + + /** + * + * + *
        +     * Required. The parent resource where this search will be performed. This
        +     * should be the nearest Resource Manager resource (project, folder, or
        +     * organization) to the target.
        +     *
        +     * Format:
        +     *
        +     * * `projects/{project_id}/locations/{location}`
        +     * * `projects/{project_number}/locations/{location}`
        +     * * `folders/{folder_id}/locations/{location}`
        +     * * `organizations/{organization_id}/locations/{location}`
        +     * 
        + * + * + * string parent = 5 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearParent() { + parent_ = getDefaultInstance().getParent(); + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + return this; + } + + /** + * + * + *
        +     * Required. The parent resource where this search will be performed. This
        +     * should be the nearest Resource Manager resource (project, folder, or
        +     * organization) to the target.
        +     *
        +     * Format:
        +     *
        +     * * `projects/{project_id}/locations/{location}`
        +     * * `projects/{project_number}/locations/{location}`
        +     * * `folders/{folder_id}/locations/{location}`
        +     * * `organizations/{organization_id}/locations/{location}`
        +     * 
        + * + * + * string parent = 5 [(.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_ |= 0x00000008; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.iam.v3beta.SearchTargetPolicyBindingsRequest) + } + + // @@protoc_insertion_point(class_scope:google.iam.v3beta.SearchTargetPolicyBindingsRequest) + private static final com.google.iam.v3beta.SearchTargetPolicyBindingsRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.iam.v3beta.SearchTargetPolicyBindingsRequest(); + } + + public static com.google.iam.v3beta.SearchTargetPolicyBindingsRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SearchTargetPolicyBindingsRequest 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.iam.v3beta.SearchTargetPolicyBindingsRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-iam/proto-google-iam-v3beta/src/main/java/com/google/iam/v3beta/SearchTargetPolicyBindingsRequestOrBuilder.java b/java-iam/proto-google-iam-v3beta/src/main/java/com/google/iam/v3beta/SearchTargetPolicyBindingsRequestOrBuilder.java new file mode 100644 index 0000000000..94b017218e --- /dev/null +++ b/java-iam/proto-google-iam-v3beta/src/main/java/com/google/iam/v3beta/SearchTargetPolicyBindingsRequestOrBuilder.java @@ -0,0 +1,175 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/iam/v3beta/policy_bindings_service.proto +// Protobuf Java Version: 4.33.2 + +package com.google.iam.v3beta; + +@com.google.protobuf.Generated +public interface SearchTargetPolicyBindingsRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.iam.v3beta.SearchTargetPolicyBindingsRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
        +   * Required. The target resource, which is bound to the policy in the binding.
        +   *
        +   * Format:
        +   *
        +   * * `//iam.googleapis.com/locations/global/workforcePools/POOL_ID`
        +   * * `//iam.googleapis.com/projects/PROJECT_NUMBER/locations/global/workloadIdentityPools/POOL_ID`
        +   * * `//iam.googleapis.com/locations/global/workspace/WORKSPACE_ID`
        +   * * `//cloudresourcemanager.googleapis.com/projects/{project_number}`
        +   * * `//cloudresourcemanager.googleapis.com/folders/{folder_id}`
        +   * * `//cloudresourcemanager.googleapis.com/organizations/{organization_id}`
        +   * 
        + * + * string target = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The target. + */ + java.lang.String getTarget(); + + /** + * + * + *
        +   * Required. The target resource, which is bound to the policy in the binding.
        +   *
        +   * Format:
        +   *
        +   * * `//iam.googleapis.com/locations/global/workforcePools/POOL_ID`
        +   * * `//iam.googleapis.com/projects/PROJECT_NUMBER/locations/global/workloadIdentityPools/POOL_ID`
        +   * * `//iam.googleapis.com/locations/global/workspace/WORKSPACE_ID`
        +   * * `//cloudresourcemanager.googleapis.com/projects/{project_number}`
        +   * * `//cloudresourcemanager.googleapis.com/folders/{folder_id}`
        +   * * `//cloudresourcemanager.googleapis.com/organizations/{organization_id}`
        +   * 
        + * + * string target = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for target. + */ + com.google.protobuf.ByteString getTargetBytes(); + + /** + * + * + *
        +   * Optional. The maximum number of policy bindings to return. The service may
        +   * return fewer than this value.
        +   *
        +   * If unspecified, at most 50 policy bindings will be returned.
        +   * The maximum value is 1000; values above 1000 will be coerced to 1000.
        +   * 
        + * + * int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageSize. + */ + int getPageSize(); + + /** + * + * + *
        +   * Optional. A page token, received from a previous
        +   * `SearchTargetPolicyBindingsRequest` call. Provide this to retrieve the
        +   * subsequent page.
        +   *
        +   * When paginating, all other parameters provided to
        +   * `SearchTargetPolicyBindingsRequest` must match the call that provided the
        +   * page token.
        +   * 
        + * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageToken. + */ + java.lang.String getPageToken(); + + /** + * + * + *
        +   * Optional. A page token, received from a previous
        +   * `SearchTargetPolicyBindingsRequest` call. Provide this to retrieve the
        +   * subsequent page.
        +   *
        +   * When paginating, all other parameters provided to
        +   * `SearchTargetPolicyBindingsRequest` must match the call that provided the
        +   * page token.
        +   * 
        + * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for pageToken. + */ + com.google.protobuf.ByteString getPageTokenBytes(); + + /** + * + * + *
        +   * Required. The parent resource where this search will be performed. This
        +   * should be the nearest Resource Manager resource (project, folder, or
        +   * organization) to the target.
        +   *
        +   * Format:
        +   *
        +   * * `projects/{project_id}/locations/{location}`
        +   * * `projects/{project_number}/locations/{location}`
        +   * * `folders/{folder_id}/locations/{location}`
        +   * * `organizations/{organization_id}/locations/{location}`
        +   * 
        + * + * + * string parent = 5 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + + /** + * + * + *
        +   * Required. The parent resource where this search will be performed. This
        +   * should be the nearest Resource Manager resource (project, folder, or
        +   * organization) to the target.
        +   *
        +   * Format:
        +   *
        +   * * `projects/{project_id}/locations/{location}`
        +   * * `projects/{project_number}/locations/{location}`
        +   * * `folders/{folder_id}/locations/{location}`
        +   * * `organizations/{organization_id}/locations/{location}`
        +   * 
        + * + * + * string parent = 5 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); +} diff --git a/java-iam/proto-google-iam-v3beta/src/main/java/com/google/iam/v3beta/SearchTargetPolicyBindingsResponse.java b/java-iam/proto-google-iam-v3beta/src/main/java/com/google/iam/v3beta/SearchTargetPolicyBindingsResponse.java new file mode 100644 index 0000000000..0383e40f9e --- /dev/null +++ b/java-iam/proto-google-iam-v3beta/src/main/java/com/google/iam/v3beta/SearchTargetPolicyBindingsResponse.java @@ -0,0 +1,1124 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/iam/v3beta/policy_bindings_service.proto +// Protobuf Java Version: 4.33.2 + +package com.google.iam.v3beta; + +/** + * + * + *
        + * Response message for SearchTargetPolicyBindings method.
        + * 
        + * + * Protobuf type {@code google.iam.v3beta.SearchTargetPolicyBindingsResponse} + */ +@com.google.protobuf.Generated +public final class SearchTargetPolicyBindingsResponse extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.iam.v3beta.SearchTargetPolicyBindingsResponse) + SearchTargetPolicyBindingsResponseOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "SearchTargetPolicyBindingsResponse"); + } + + // Use SearchTargetPolicyBindingsResponse.newBuilder() to construct. + private SearchTargetPolicyBindingsResponse( + com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private SearchTargetPolicyBindingsResponse() { + policyBindings_ = java.util.Collections.emptyList(); + nextPageToken_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.iam.v3beta.PolicyBindingsServiceProto + .internal_static_google_iam_v3beta_SearchTargetPolicyBindingsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.iam.v3beta.PolicyBindingsServiceProto + .internal_static_google_iam_v3beta_SearchTargetPolicyBindingsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.iam.v3beta.SearchTargetPolicyBindingsResponse.class, + com.google.iam.v3beta.SearchTargetPolicyBindingsResponse.Builder.class); + } + + public static final int POLICY_BINDINGS_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private java.util.List policyBindings_; + + /** + * + * + *
        +   * The policy bindings bound to the specified target.
        +   * 
        + * + * repeated .google.iam.v3beta.PolicyBinding policy_bindings = 1; + */ + @java.lang.Override + public java.util.List getPolicyBindingsList() { + return policyBindings_; + } + + /** + * + * + *
        +   * The policy bindings bound to the specified target.
        +   * 
        + * + * repeated .google.iam.v3beta.PolicyBinding policy_bindings = 1; + */ + @java.lang.Override + public java.util.List + getPolicyBindingsOrBuilderList() { + return policyBindings_; + } + + /** + * + * + *
        +   * The policy bindings bound to the specified target.
        +   * 
        + * + * repeated .google.iam.v3beta.PolicyBinding policy_bindings = 1; + */ + @java.lang.Override + public int getPolicyBindingsCount() { + return policyBindings_.size(); + } + + /** + * + * + *
        +   * The policy bindings bound to the specified target.
        +   * 
        + * + * repeated .google.iam.v3beta.PolicyBinding policy_bindings = 1; + */ + @java.lang.Override + public com.google.iam.v3beta.PolicyBinding getPolicyBindings(int index) { + return policyBindings_.get(index); + } + + /** + * + * + *
        +   * The policy bindings bound to the specified target.
        +   * 
        + * + * repeated .google.iam.v3beta.PolicyBinding policy_bindings = 1; + */ + @java.lang.Override + public com.google.iam.v3beta.PolicyBindingOrBuilder getPolicyBindingsOrBuilder(int index) { + return policyBindings_.get(index); + } + + public static final int NEXT_PAGE_TOKEN_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object nextPageToken_ = ""; + + /** + * + * + *
        +   * Optional. A token, which can be sent as `page_token` to retrieve the next
        +   * page. If this field is omitted, there are no subsequent pages.
        +   * 
        + * + * string next_page_token = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + } + } + + /** + * + * + *
        +   * Optional. A token, which can be sent as `page_token` to retrieve the next
        +   * page. If this field is omitted, there are no subsequent pages.
        +   * 
        + * + * string next_page_token = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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 < policyBindings_.size(); i++) { + output.writeMessage(1, policyBindings_.get(i)); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(nextPageToken_)) { + com.google.protobuf.GeneratedMessage.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 < policyBindings_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, policyBindings_.get(i)); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(nextPageToken_)) { + size += com.google.protobuf.GeneratedMessage.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.iam.v3beta.SearchTargetPolicyBindingsResponse)) { + return super.equals(obj); + } + com.google.iam.v3beta.SearchTargetPolicyBindingsResponse other = + (com.google.iam.v3beta.SearchTargetPolicyBindingsResponse) obj; + + if (!getPolicyBindingsList().equals(other.getPolicyBindingsList())) 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 (getPolicyBindingsCount() > 0) { + hash = (37 * hash) + POLICY_BINDINGS_FIELD_NUMBER; + hash = (53 * hash) + getPolicyBindingsList().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.iam.v3beta.SearchTargetPolicyBindingsResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.iam.v3beta.SearchTargetPolicyBindingsResponse parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.iam.v3beta.SearchTargetPolicyBindingsResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.iam.v3beta.SearchTargetPolicyBindingsResponse 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.iam.v3beta.SearchTargetPolicyBindingsResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.iam.v3beta.SearchTargetPolicyBindingsResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.iam.v3beta.SearchTargetPolicyBindingsResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.iam.v3beta.SearchTargetPolicyBindingsResponse parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.iam.v3beta.SearchTargetPolicyBindingsResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.iam.v3beta.SearchTargetPolicyBindingsResponse parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.iam.v3beta.SearchTargetPolicyBindingsResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.iam.v3beta.SearchTargetPolicyBindingsResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.iam.v3beta.SearchTargetPolicyBindingsResponse 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
        +   * Response message for SearchTargetPolicyBindings method.
        +   * 
        + * + * Protobuf type {@code google.iam.v3beta.SearchTargetPolicyBindingsResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.iam.v3beta.SearchTargetPolicyBindingsResponse) + com.google.iam.v3beta.SearchTargetPolicyBindingsResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.iam.v3beta.PolicyBindingsServiceProto + .internal_static_google_iam_v3beta_SearchTargetPolicyBindingsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.iam.v3beta.PolicyBindingsServiceProto + .internal_static_google_iam_v3beta_SearchTargetPolicyBindingsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.iam.v3beta.SearchTargetPolicyBindingsResponse.class, + com.google.iam.v3beta.SearchTargetPolicyBindingsResponse.Builder.class); + } + + // Construct using com.google.iam.v3beta.SearchTargetPolicyBindingsResponse.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (policyBindingsBuilder_ == null) { + policyBindings_ = java.util.Collections.emptyList(); + } else { + policyBindings_ = null; + policyBindingsBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + nextPageToken_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.iam.v3beta.PolicyBindingsServiceProto + .internal_static_google_iam_v3beta_SearchTargetPolicyBindingsResponse_descriptor; + } + + @java.lang.Override + public com.google.iam.v3beta.SearchTargetPolicyBindingsResponse getDefaultInstanceForType() { + return com.google.iam.v3beta.SearchTargetPolicyBindingsResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.iam.v3beta.SearchTargetPolicyBindingsResponse build() { + com.google.iam.v3beta.SearchTargetPolicyBindingsResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.iam.v3beta.SearchTargetPolicyBindingsResponse buildPartial() { + com.google.iam.v3beta.SearchTargetPolicyBindingsResponse result = + new com.google.iam.v3beta.SearchTargetPolicyBindingsResponse(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields( + com.google.iam.v3beta.SearchTargetPolicyBindingsResponse result) { + if (policyBindingsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + policyBindings_ = java.util.Collections.unmodifiableList(policyBindings_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.policyBindings_ = policyBindings_; + } else { + result.policyBindings_ = policyBindingsBuilder_.build(); + } + } + + private void buildPartial0(com.google.iam.v3beta.SearchTargetPolicyBindingsResponse result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.nextPageToken_ = nextPageToken_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.iam.v3beta.SearchTargetPolicyBindingsResponse) { + return mergeFrom((com.google.iam.v3beta.SearchTargetPolicyBindingsResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.iam.v3beta.SearchTargetPolicyBindingsResponse other) { + if (other == com.google.iam.v3beta.SearchTargetPolicyBindingsResponse.getDefaultInstance()) + return this; + if (policyBindingsBuilder_ == null) { + if (!other.policyBindings_.isEmpty()) { + if (policyBindings_.isEmpty()) { + policyBindings_ = other.policyBindings_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensurePolicyBindingsIsMutable(); + policyBindings_.addAll(other.policyBindings_); + } + onChanged(); + } + } else { + if (!other.policyBindings_.isEmpty()) { + if (policyBindingsBuilder_.isEmpty()) { + policyBindingsBuilder_.dispose(); + policyBindingsBuilder_ = null; + policyBindings_ = other.policyBindings_; + bitField0_ = (bitField0_ & ~0x00000001); + policyBindingsBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders + ? internalGetPolicyBindingsFieldBuilder() + : null; + } else { + policyBindingsBuilder_.addAllMessages(other.policyBindings_); + } + } + } + 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.iam.v3beta.PolicyBinding m = + input.readMessage( + com.google.iam.v3beta.PolicyBinding.parser(), extensionRegistry); + if (policyBindingsBuilder_ == null) { + ensurePolicyBindingsIsMutable(); + policyBindings_.add(m); + } else { + policyBindingsBuilder_.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 policyBindings_ = + java.util.Collections.emptyList(); + + private void ensurePolicyBindingsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + policyBindings_ = + new java.util.ArrayList(policyBindings_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.google.iam.v3beta.PolicyBinding, + com.google.iam.v3beta.PolicyBinding.Builder, + com.google.iam.v3beta.PolicyBindingOrBuilder> + policyBindingsBuilder_; + + /** + * + * + *
        +     * The policy bindings bound to the specified target.
        +     * 
        + * + * repeated .google.iam.v3beta.PolicyBinding policy_bindings = 1; + */ + public java.util.List getPolicyBindingsList() { + if (policyBindingsBuilder_ == null) { + return java.util.Collections.unmodifiableList(policyBindings_); + } else { + return policyBindingsBuilder_.getMessageList(); + } + } + + /** + * + * + *
        +     * The policy bindings bound to the specified target.
        +     * 
        + * + * repeated .google.iam.v3beta.PolicyBinding policy_bindings = 1; + */ + public int getPolicyBindingsCount() { + if (policyBindingsBuilder_ == null) { + return policyBindings_.size(); + } else { + return policyBindingsBuilder_.getCount(); + } + } + + /** + * + * + *
        +     * The policy bindings bound to the specified target.
        +     * 
        + * + * repeated .google.iam.v3beta.PolicyBinding policy_bindings = 1; + */ + public com.google.iam.v3beta.PolicyBinding getPolicyBindings(int index) { + if (policyBindingsBuilder_ == null) { + return policyBindings_.get(index); + } else { + return policyBindingsBuilder_.getMessage(index); + } + } + + /** + * + * + *
        +     * The policy bindings bound to the specified target.
        +     * 
        + * + * repeated .google.iam.v3beta.PolicyBinding policy_bindings = 1; + */ + public Builder setPolicyBindings(int index, com.google.iam.v3beta.PolicyBinding value) { + if (policyBindingsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensurePolicyBindingsIsMutable(); + policyBindings_.set(index, value); + onChanged(); + } else { + policyBindingsBuilder_.setMessage(index, value); + } + return this; + } + + /** + * + * + *
        +     * The policy bindings bound to the specified target.
        +     * 
        + * + * repeated .google.iam.v3beta.PolicyBinding policy_bindings = 1; + */ + public Builder setPolicyBindings( + int index, com.google.iam.v3beta.PolicyBinding.Builder builderForValue) { + if (policyBindingsBuilder_ == null) { + ensurePolicyBindingsIsMutable(); + policyBindings_.set(index, builderForValue.build()); + onChanged(); + } else { + policyBindingsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
        +     * The policy bindings bound to the specified target.
        +     * 
        + * + * repeated .google.iam.v3beta.PolicyBinding policy_bindings = 1; + */ + public Builder addPolicyBindings(com.google.iam.v3beta.PolicyBinding value) { + if (policyBindingsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensurePolicyBindingsIsMutable(); + policyBindings_.add(value); + onChanged(); + } else { + policyBindingsBuilder_.addMessage(value); + } + return this; + } + + /** + * + * + *
        +     * The policy bindings bound to the specified target.
        +     * 
        + * + * repeated .google.iam.v3beta.PolicyBinding policy_bindings = 1; + */ + public Builder addPolicyBindings(int index, com.google.iam.v3beta.PolicyBinding value) { + if (policyBindingsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensurePolicyBindingsIsMutable(); + policyBindings_.add(index, value); + onChanged(); + } else { + policyBindingsBuilder_.addMessage(index, value); + } + return this; + } + + /** + * + * + *
        +     * The policy bindings bound to the specified target.
        +     * 
        + * + * repeated .google.iam.v3beta.PolicyBinding policy_bindings = 1; + */ + public Builder addPolicyBindings(com.google.iam.v3beta.PolicyBinding.Builder builderForValue) { + if (policyBindingsBuilder_ == null) { + ensurePolicyBindingsIsMutable(); + policyBindings_.add(builderForValue.build()); + onChanged(); + } else { + policyBindingsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + + /** + * + * + *
        +     * The policy bindings bound to the specified target.
        +     * 
        + * + * repeated .google.iam.v3beta.PolicyBinding policy_bindings = 1; + */ + public Builder addPolicyBindings( + int index, com.google.iam.v3beta.PolicyBinding.Builder builderForValue) { + if (policyBindingsBuilder_ == null) { + ensurePolicyBindingsIsMutable(); + policyBindings_.add(index, builderForValue.build()); + onChanged(); + } else { + policyBindingsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
        +     * The policy bindings bound to the specified target.
        +     * 
        + * + * repeated .google.iam.v3beta.PolicyBinding policy_bindings = 1; + */ + public Builder addAllPolicyBindings( + java.lang.Iterable values) { + if (policyBindingsBuilder_ == null) { + ensurePolicyBindingsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, policyBindings_); + onChanged(); + } else { + policyBindingsBuilder_.addAllMessages(values); + } + return this; + } + + /** + * + * + *
        +     * The policy bindings bound to the specified target.
        +     * 
        + * + * repeated .google.iam.v3beta.PolicyBinding policy_bindings = 1; + */ + public Builder clearPolicyBindings() { + if (policyBindingsBuilder_ == null) { + policyBindings_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + policyBindingsBuilder_.clear(); + } + return this; + } + + /** + * + * + *
        +     * The policy bindings bound to the specified target.
        +     * 
        + * + * repeated .google.iam.v3beta.PolicyBinding policy_bindings = 1; + */ + public Builder removePolicyBindings(int index) { + if (policyBindingsBuilder_ == null) { + ensurePolicyBindingsIsMutable(); + policyBindings_.remove(index); + onChanged(); + } else { + policyBindingsBuilder_.remove(index); + } + return this; + } + + /** + * + * + *
        +     * The policy bindings bound to the specified target.
        +     * 
        + * + * repeated .google.iam.v3beta.PolicyBinding policy_bindings = 1; + */ + public com.google.iam.v3beta.PolicyBinding.Builder getPolicyBindingsBuilder(int index) { + return internalGetPolicyBindingsFieldBuilder().getBuilder(index); + } + + /** + * + * + *
        +     * The policy bindings bound to the specified target.
        +     * 
        + * + * repeated .google.iam.v3beta.PolicyBinding policy_bindings = 1; + */ + public com.google.iam.v3beta.PolicyBindingOrBuilder getPolicyBindingsOrBuilder(int index) { + if (policyBindingsBuilder_ == null) { + return policyBindings_.get(index); + } else { + return policyBindingsBuilder_.getMessageOrBuilder(index); + } + } + + /** + * + * + *
        +     * The policy bindings bound to the specified target.
        +     * 
        + * + * repeated .google.iam.v3beta.PolicyBinding policy_bindings = 1; + */ + public java.util.List + getPolicyBindingsOrBuilderList() { + if (policyBindingsBuilder_ != null) { + return policyBindingsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(policyBindings_); + } + } + + /** + * + * + *
        +     * The policy bindings bound to the specified target.
        +     * 
        + * + * repeated .google.iam.v3beta.PolicyBinding policy_bindings = 1; + */ + public com.google.iam.v3beta.PolicyBinding.Builder addPolicyBindingsBuilder() { + return internalGetPolicyBindingsFieldBuilder() + .addBuilder(com.google.iam.v3beta.PolicyBinding.getDefaultInstance()); + } + + /** + * + * + *
        +     * The policy bindings bound to the specified target.
        +     * 
        + * + * repeated .google.iam.v3beta.PolicyBinding policy_bindings = 1; + */ + public com.google.iam.v3beta.PolicyBinding.Builder addPolicyBindingsBuilder(int index) { + return internalGetPolicyBindingsFieldBuilder() + .addBuilder(index, com.google.iam.v3beta.PolicyBinding.getDefaultInstance()); + } + + /** + * + * + *
        +     * The policy bindings bound to the specified target.
        +     * 
        + * + * repeated .google.iam.v3beta.PolicyBinding policy_bindings = 1; + */ + public java.util.List + getPolicyBindingsBuilderList() { + return internalGetPolicyBindingsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.google.iam.v3beta.PolicyBinding, + com.google.iam.v3beta.PolicyBinding.Builder, + com.google.iam.v3beta.PolicyBindingOrBuilder> + internalGetPolicyBindingsFieldBuilder() { + if (policyBindingsBuilder_ == null) { + policyBindingsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilder< + com.google.iam.v3beta.PolicyBinding, + com.google.iam.v3beta.PolicyBinding.Builder, + com.google.iam.v3beta.PolicyBindingOrBuilder>( + policyBindings_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + policyBindings_ = null; + } + return policyBindingsBuilder_; + } + + private java.lang.Object nextPageToken_ = ""; + + /** + * + * + *
        +     * Optional. A token, which can be sent as `page_token` to retrieve the next
        +     * page. If this field is omitted, there are no subsequent pages.
        +     * 
        + * + * string next_page_token = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + } + } + + /** + * + * + *
        +     * Optional. A token, which can be sent as `page_token` to retrieve the next
        +     * page. If this field is omitted, there are no subsequent pages.
        +     * 
        + * + * string next_page_token = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + } + } + + /** + * + * + *
        +     * Optional. A token, which can be sent as `page_token` to retrieve the next
        +     * page. If this field is omitted, there are no subsequent pages.
        +     * 
        + * + * string next_page_token = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + } + + /** + * + * + *
        +     * Optional. A token, which can be sent as `page_token` to retrieve the next
        +     * page. If this field is omitted, there are no subsequent pages.
        +     * 
        + * + * string next_page_token = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearNextPageToken() { + nextPageToken_ = getDefaultInstance().getNextPageToken(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
        +     * Optional. A token, which can be sent as `page_token` to retrieve the next
        +     * page. If this field is omitted, there are no subsequent pages.
        +     * 
        + * + * string next_page_token = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + } + + // @@protoc_insertion_point(builder_scope:google.iam.v3beta.SearchTargetPolicyBindingsResponse) + } + + // @@protoc_insertion_point(class_scope:google.iam.v3beta.SearchTargetPolicyBindingsResponse) + private static final com.google.iam.v3beta.SearchTargetPolicyBindingsResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.iam.v3beta.SearchTargetPolicyBindingsResponse(); + } + + public static com.google.iam.v3beta.SearchTargetPolicyBindingsResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SearchTargetPolicyBindingsResponse 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.iam.v3beta.SearchTargetPolicyBindingsResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-iam/proto-google-iam-v3beta/src/main/java/com/google/iam/v3beta/SearchTargetPolicyBindingsResponseOrBuilder.java b/java-iam/proto-google-iam-v3beta/src/main/java/com/google/iam/v3beta/SearchTargetPolicyBindingsResponseOrBuilder.java new file mode 100644 index 0000000000..3649729907 --- /dev/null +++ b/java-iam/proto-google-iam-v3beta/src/main/java/com/google/iam/v3beta/SearchTargetPolicyBindingsResponseOrBuilder.java @@ -0,0 +1,112 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/iam/v3beta/policy_bindings_service.proto +// Protobuf Java Version: 4.33.2 + +package com.google.iam.v3beta; + +@com.google.protobuf.Generated +public interface SearchTargetPolicyBindingsResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.iam.v3beta.SearchTargetPolicyBindingsResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
        +   * The policy bindings bound to the specified target.
        +   * 
        + * + * repeated .google.iam.v3beta.PolicyBinding policy_bindings = 1; + */ + java.util.List getPolicyBindingsList(); + + /** + * + * + *
        +   * The policy bindings bound to the specified target.
        +   * 
        + * + * repeated .google.iam.v3beta.PolicyBinding policy_bindings = 1; + */ + com.google.iam.v3beta.PolicyBinding getPolicyBindings(int index); + + /** + * + * + *
        +   * The policy bindings bound to the specified target.
        +   * 
        + * + * repeated .google.iam.v3beta.PolicyBinding policy_bindings = 1; + */ + int getPolicyBindingsCount(); + + /** + * + * + *
        +   * The policy bindings bound to the specified target.
        +   * 
        + * + * repeated .google.iam.v3beta.PolicyBinding policy_bindings = 1; + */ + java.util.List + getPolicyBindingsOrBuilderList(); + + /** + * + * + *
        +   * The policy bindings bound to the specified target.
        +   * 
        + * + * repeated .google.iam.v3beta.PolicyBinding policy_bindings = 1; + */ + com.google.iam.v3beta.PolicyBindingOrBuilder getPolicyBindingsOrBuilder(int index); + + /** + * + * + *
        +   * Optional. A token, which can be sent as `page_token` to retrieve the next
        +   * page. If this field is omitted, there are no subsequent pages.
        +   * 
        + * + * string next_page_token = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The nextPageToken. + */ + java.lang.String getNextPageToken(); + + /** + * + * + *
        +   * Optional. A token, which can be sent as `page_token` to retrieve the next
        +   * page. If this field is omitted, there are no subsequent pages.
        +   * 
        + * + * string next_page_token = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for nextPageToken. + */ + com.google.protobuf.ByteString getNextPageTokenBytes(); +} diff --git a/java-iam/proto-google-iam-v3beta/src/main/java/com/google/iam/v3beta/UpdatePolicyBindingRequest.java b/java-iam/proto-google-iam-v3beta/src/main/java/com/google/iam/v3beta/UpdatePolicyBindingRequest.java new file mode 100644 index 0000000000..a106dd0fab --- /dev/null +++ b/java-iam/proto-google-iam-v3beta/src/main/java/com/google/iam/v3beta/UpdatePolicyBindingRequest.java @@ -0,0 +1,1149 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/iam/v3beta/policy_bindings_service.proto +// Protobuf Java Version: 4.33.2 + +package com.google.iam.v3beta; + +/** + * + * + *
        + * Request message for UpdatePolicyBinding method.
        + * 
        + * + * Protobuf type {@code google.iam.v3beta.UpdatePolicyBindingRequest} + */ +@com.google.protobuf.Generated +public final class UpdatePolicyBindingRequest extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.iam.v3beta.UpdatePolicyBindingRequest) + UpdatePolicyBindingRequestOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "UpdatePolicyBindingRequest"); + } + + // Use UpdatePolicyBindingRequest.newBuilder() to construct. + private UpdatePolicyBindingRequest(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private UpdatePolicyBindingRequest() {} + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.iam.v3beta.PolicyBindingsServiceProto + .internal_static_google_iam_v3beta_UpdatePolicyBindingRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.iam.v3beta.PolicyBindingsServiceProto + .internal_static_google_iam_v3beta_UpdatePolicyBindingRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.iam.v3beta.UpdatePolicyBindingRequest.class, + com.google.iam.v3beta.UpdatePolicyBindingRequest.Builder.class); + } + + private int bitField0_; + public static final int POLICY_BINDING_FIELD_NUMBER = 1; + private com.google.iam.v3beta.PolicyBinding policyBinding_; + + /** + * + * + *
        +   * Required. The policy binding to update.
        +   *
        +   * The policy binding's `name` field is used to identify the policy binding to
        +   * update.
        +   * 
        + * + * + * .google.iam.v3beta.PolicyBinding policy_binding = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the policyBinding field is set. + */ + @java.lang.Override + public boolean hasPolicyBinding() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
        +   * Required. The policy binding to update.
        +   *
        +   * The policy binding's `name` field is used to identify the policy binding to
        +   * update.
        +   * 
        + * + * + * .google.iam.v3beta.PolicyBinding policy_binding = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The policyBinding. + */ + @java.lang.Override + public com.google.iam.v3beta.PolicyBinding getPolicyBinding() { + return policyBinding_ == null + ? com.google.iam.v3beta.PolicyBinding.getDefaultInstance() + : policyBinding_; + } + + /** + * + * + *
        +   * Required. The policy binding to update.
        +   *
        +   * The policy binding's `name` field is used to identify the policy binding to
        +   * update.
        +   * 
        + * + * + * .google.iam.v3beta.PolicyBinding policy_binding = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.iam.v3beta.PolicyBindingOrBuilder getPolicyBindingOrBuilder() { + return policyBinding_ == null + ? com.google.iam.v3beta.PolicyBinding.getDefaultInstance() + : policyBinding_; + } + + public static final int VALIDATE_ONLY_FIELD_NUMBER = 2; + private boolean validateOnly_ = false; + + /** + * + * + *
        +   * Optional. If set, validate the request and preview the update, but do not
        +   * actually post it.
        +   * 
        + * + * bool validate_only = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The validateOnly. + */ + @java.lang.Override + public boolean getValidateOnly() { + return validateOnly_; + } + + public static final int UPDATE_MASK_FIELD_NUMBER = 3; + private com.google.protobuf.FieldMask updateMask_; + + /** + * + * + *
        +   * Optional. The list of fields to update
        +   * 
        + * + * .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. The list of fields to update
        +   * 
        + * + * .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. The list of fields to update
        +   * 
        + * + * .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 (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(1, getPolicyBinding()); + } + if (validateOnly_ != false) { + output.writeBool(2, validateOnly_); + } + 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 (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getPolicyBinding()); + } + if (validateOnly_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(2, validateOnly_); + } + 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.iam.v3beta.UpdatePolicyBindingRequest)) { + return super.equals(obj); + } + com.google.iam.v3beta.UpdatePolicyBindingRequest other = + (com.google.iam.v3beta.UpdatePolicyBindingRequest) obj; + + if (hasPolicyBinding() != other.hasPolicyBinding()) return false; + if (hasPolicyBinding()) { + if (!getPolicyBinding().equals(other.getPolicyBinding())) return false; + } + if (getValidateOnly() != other.getValidateOnly()) 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(); + if (hasPolicyBinding()) { + hash = (37 * hash) + POLICY_BINDING_FIELD_NUMBER; + hash = (53 * hash) + getPolicyBinding().hashCode(); + } + hash = (37 * hash) + VALIDATE_ONLY_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getValidateOnly()); + 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.iam.v3beta.UpdatePolicyBindingRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.iam.v3beta.UpdatePolicyBindingRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.iam.v3beta.UpdatePolicyBindingRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.iam.v3beta.UpdatePolicyBindingRequest 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.iam.v3beta.UpdatePolicyBindingRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.iam.v3beta.UpdatePolicyBindingRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.iam.v3beta.UpdatePolicyBindingRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.iam.v3beta.UpdatePolicyBindingRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.iam.v3beta.UpdatePolicyBindingRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.iam.v3beta.UpdatePolicyBindingRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.iam.v3beta.UpdatePolicyBindingRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.iam.v3beta.UpdatePolicyBindingRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.iam.v3beta.UpdatePolicyBindingRequest 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
        +   * Request message for UpdatePolicyBinding method.
        +   * 
        + * + * Protobuf type {@code google.iam.v3beta.UpdatePolicyBindingRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.iam.v3beta.UpdatePolicyBindingRequest) + com.google.iam.v3beta.UpdatePolicyBindingRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.iam.v3beta.PolicyBindingsServiceProto + .internal_static_google_iam_v3beta_UpdatePolicyBindingRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.iam.v3beta.PolicyBindingsServiceProto + .internal_static_google_iam_v3beta_UpdatePolicyBindingRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.iam.v3beta.UpdatePolicyBindingRequest.class, + com.google.iam.v3beta.UpdatePolicyBindingRequest.Builder.class); + } + + // Construct using com.google.iam.v3beta.UpdatePolicyBindingRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetPolicyBindingFieldBuilder(); + internalGetUpdateMaskFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + policyBinding_ = null; + if (policyBindingBuilder_ != null) { + policyBindingBuilder_.dispose(); + policyBindingBuilder_ = null; + } + validateOnly_ = 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.iam.v3beta.PolicyBindingsServiceProto + .internal_static_google_iam_v3beta_UpdatePolicyBindingRequest_descriptor; + } + + @java.lang.Override + public com.google.iam.v3beta.UpdatePolicyBindingRequest getDefaultInstanceForType() { + return com.google.iam.v3beta.UpdatePolicyBindingRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.iam.v3beta.UpdatePolicyBindingRequest build() { + com.google.iam.v3beta.UpdatePolicyBindingRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.iam.v3beta.UpdatePolicyBindingRequest buildPartial() { + com.google.iam.v3beta.UpdatePolicyBindingRequest result = + new com.google.iam.v3beta.UpdatePolicyBindingRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.iam.v3beta.UpdatePolicyBindingRequest result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.policyBinding_ = + policyBindingBuilder_ == null ? policyBinding_ : policyBindingBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.validateOnly_ = validateOnly_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.updateMask_ = updateMaskBuilder_ == null ? updateMask_ : updateMaskBuilder_.build(); + to_bitField0_ |= 0x00000002; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.iam.v3beta.UpdatePolicyBindingRequest) { + return mergeFrom((com.google.iam.v3beta.UpdatePolicyBindingRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.iam.v3beta.UpdatePolicyBindingRequest other) { + if (other == com.google.iam.v3beta.UpdatePolicyBindingRequest.getDefaultInstance()) + return this; + if (other.hasPolicyBinding()) { + mergePolicyBinding(other.getPolicyBinding()); + } + if (other.getValidateOnly() != false) { + setValidateOnly(other.getValidateOnly()); + } + 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: + { + input.readMessage( + internalGetPolicyBindingFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 16: + { + validateOnly_ = input.readBool(); + bitField0_ |= 0x00000002; + break; + } // case 16 + case 26: + { + input.readMessage( + internalGetUpdateMaskFieldBuilder().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.iam.v3beta.PolicyBinding policyBinding_; + private com.google.protobuf.SingleFieldBuilder< + com.google.iam.v3beta.PolicyBinding, + com.google.iam.v3beta.PolicyBinding.Builder, + com.google.iam.v3beta.PolicyBindingOrBuilder> + policyBindingBuilder_; + + /** + * + * + *
        +     * Required. The policy binding to update.
        +     *
        +     * The policy binding's `name` field is used to identify the policy binding to
        +     * update.
        +     * 
        + * + * + * .google.iam.v3beta.PolicyBinding policy_binding = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the policyBinding field is set. + */ + public boolean hasPolicyBinding() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
        +     * Required. The policy binding to update.
        +     *
        +     * The policy binding's `name` field is used to identify the policy binding to
        +     * update.
        +     * 
        + * + * + * .google.iam.v3beta.PolicyBinding policy_binding = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The policyBinding. + */ + public com.google.iam.v3beta.PolicyBinding getPolicyBinding() { + if (policyBindingBuilder_ == null) { + return policyBinding_ == null + ? com.google.iam.v3beta.PolicyBinding.getDefaultInstance() + : policyBinding_; + } else { + return policyBindingBuilder_.getMessage(); + } + } + + /** + * + * + *
        +     * Required. The policy binding to update.
        +     *
        +     * The policy binding's `name` field is used to identify the policy binding to
        +     * update.
        +     * 
        + * + * + * .google.iam.v3beta.PolicyBinding policy_binding = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setPolicyBinding(com.google.iam.v3beta.PolicyBinding value) { + if (policyBindingBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + policyBinding_ = value; + } else { + policyBindingBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
        +     * Required. The policy binding to update.
        +     *
        +     * The policy binding's `name` field is used to identify the policy binding to
        +     * update.
        +     * 
        + * + * + * .google.iam.v3beta.PolicyBinding policy_binding = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setPolicyBinding(com.google.iam.v3beta.PolicyBinding.Builder builderForValue) { + if (policyBindingBuilder_ == null) { + policyBinding_ = builderForValue.build(); + } else { + policyBindingBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
        +     * Required. The policy binding to update.
        +     *
        +     * The policy binding's `name` field is used to identify the policy binding to
        +     * update.
        +     * 
        + * + * + * .google.iam.v3beta.PolicyBinding policy_binding = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergePolicyBinding(com.google.iam.v3beta.PolicyBinding value) { + if (policyBindingBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) + && policyBinding_ != null + && policyBinding_ != com.google.iam.v3beta.PolicyBinding.getDefaultInstance()) { + getPolicyBindingBuilder().mergeFrom(value); + } else { + policyBinding_ = value; + } + } else { + policyBindingBuilder_.mergeFrom(value); + } + if (policyBinding_ != null) { + bitField0_ |= 0x00000001; + onChanged(); + } + return this; + } + + /** + * + * + *
        +     * Required. The policy binding to update.
        +     *
        +     * The policy binding's `name` field is used to identify the policy binding to
        +     * update.
        +     * 
        + * + * + * .google.iam.v3beta.PolicyBinding policy_binding = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearPolicyBinding() { + bitField0_ = (bitField0_ & ~0x00000001); + policyBinding_ = null; + if (policyBindingBuilder_ != null) { + policyBindingBuilder_.dispose(); + policyBindingBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
        +     * Required. The policy binding to update.
        +     *
        +     * The policy binding's `name` field is used to identify the policy binding to
        +     * update.
        +     * 
        + * + * + * .google.iam.v3beta.PolicyBinding policy_binding = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.iam.v3beta.PolicyBinding.Builder getPolicyBindingBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return internalGetPolicyBindingFieldBuilder().getBuilder(); + } + + /** + * + * + *
        +     * Required. The policy binding to update.
        +     *
        +     * The policy binding's `name` field is used to identify the policy binding to
        +     * update.
        +     * 
        + * + * + * .google.iam.v3beta.PolicyBinding policy_binding = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.iam.v3beta.PolicyBindingOrBuilder getPolicyBindingOrBuilder() { + if (policyBindingBuilder_ != null) { + return policyBindingBuilder_.getMessageOrBuilder(); + } else { + return policyBinding_ == null + ? com.google.iam.v3beta.PolicyBinding.getDefaultInstance() + : policyBinding_; + } + } + + /** + * + * + *
        +     * Required. The policy binding to update.
        +     *
        +     * The policy binding's `name` field is used to identify the policy binding to
        +     * update.
        +     * 
        + * + * + * .google.iam.v3beta.PolicyBinding policy_binding = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.iam.v3beta.PolicyBinding, + com.google.iam.v3beta.PolicyBinding.Builder, + com.google.iam.v3beta.PolicyBindingOrBuilder> + internalGetPolicyBindingFieldBuilder() { + if (policyBindingBuilder_ == null) { + policyBindingBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.iam.v3beta.PolicyBinding, + com.google.iam.v3beta.PolicyBinding.Builder, + com.google.iam.v3beta.PolicyBindingOrBuilder>( + getPolicyBinding(), getParentForChildren(), isClean()); + policyBinding_ = null; + } + return policyBindingBuilder_; + } + + private boolean validateOnly_; + + /** + * + * + *
        +     * Optional. If set, validate the request and preview the update, but do not
        +     * actually post it.
        +     * 
        + * + * bool validate_only = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The validateOnly. + */ + @java.lang.Override + public boolean getValidateOnly() { + return validateOnly_; + } + + /** + * + * + *
        +     * Optional. If set, validate the request and preview the update, but do not
        +     * actually post it.
        +     * 
        + * + * bool validate_only = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The validateOnly to set. + * @return This builder for chaining. + */ + public Builder setValidateOnly(boolean value) { + + validateOnly_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
        +     * Optional. If set, validate the request and preview the update, but do not
        +     * actually post it.
        +     * 
        + * + * bool validate_only = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearValidateOnly() { + bitField0_ = (bitField0_ & ~0x00000002); + validateOnly_ = false; + onChanged(); + return this; + } + + private com.google.protobuf.FieldMask updateMask_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder> + updateMaskBuilder_; + + /** + * + * + *
        +     * Optional. The list of fields to update
        +     * 
        + * + * .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. The list of fields to update
        +     * 
        + * + * .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. The list of fields to update
        +     * 
        + * + * .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. The list of fields to update
        +     * 
        + * + * .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. The list of fields to update
        +     * 
        + * + * .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. The list of fields to update
        +     * 
        + * + * .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. The list of fields to update
        +     * 
        + * + * .google.protobuf.FieldMask update_mask = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.protobuf.FieldMask.Builder getUpdateMaskBuilder() { + bitField0_ |= 0x00000004; + onChanged(); + return internalGetUpdateMaskFieldBuilder().getBuilder(); + } + + /** + * + * + *
        +     * Optional. The list of fields to update
        +     * 
        + * + * .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. The list of fields to update
        +     * 
        + * + * .google.protobuf.FieldMask update_mask = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder> + internalGetUpdateMaskFieldBuilder() { + if (updateMaskBuilder_ == null) { + updateMaskBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder>( + getUpdateMask(), getParentForChildren(), isClean()); + updateMask_ = null; + } + return updateMaskBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.iam.v3beta.UpdatePolicyBindingRequest) + } + + // @@protoc_insertion_point(class_scope:google.iam.v3beta.UpdatePolicyBindingRequest) + private static final com.google.iam.v3beta.UpdatePolicyBindingRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.iam.v3beta.UpdatePolicyBindingRequest(); + } + + public static com.google.iam.v3beta.UpdatePolicyBindingRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public UpdatePolicyBindingRequest 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.iam.v3beta.UpdatePolicyBindingRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-iam/proto-google-iam-v3beta/src/main/java/com/google/iam/v3beta/UpdatePolicyBindingRequestOrBuilder.java b/java-iam/proto-google-iam-v3beta/src/main/java/com/google/iam/v3beta/UpdatePolicyBindingRequestOrBuilder.java new file mode 100644 index 0000000000..6c567d1609 --- /dev/null +++ b/java-iam/proto-google-iam-v3beta/src/main/java/com/google/iam/v3beta/UpdatePolicyBindingRequestOrBuilder.java @@ -0,0 +1,134 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/iam/v3beta/policy_bindings_service.proto +// Protobuf Java Version: 4.33.2 + +package com.google.iam.v3beta; + +@com.google.protobuf.Generated +public interface UpdatePolicyBindingRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.iam.v3beta.UpdatePolicyBindingRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
        +   * Required. The policy binding to update.
        +   *
        +   * The policy binding's `name` field is used to identify the policy binding to
        +   * update.
        +   * 
        + * + * + * .google.iam.v3beta.PolicyBinding policy_binding = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the policyBinding field is set. + */ + boolean hasPolicyBinding(); + + /** + * + * + *
        +   * Required. The policy binding to update.
        +   *
        +   * The policy binding's `name` field is used to identify the policy binding to
        +   * update.
        +   * 
        + * + * + * .google.iam.v3beta.PolicyBinding policy_binding = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The policyBinding. + */ + com.google.iam.v3beta.PolicyBinding getPolicyBinding(); + + /** + * + * + *
        +   * Required. The policy binding to update.
        +   *
        +   * The policy binding's `name` field is used to identify the policy binding to
        +   * update.
        +   * 
        + * + * + * .google.iam.v3beta.PolicyBinding policy_binding = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.iam.v3beta.PolicyBindingOrBuilder getPolicyBindingOrBuilder(); + + /** + * + * + *
        +   * Optional. If set, validate the request and preview the update, but do not
        +   * actually post it.
        +   * 
        + * + * bool validate_only = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The validateOnly. + */ + boolean getValidateOnly(); + + /** + * + * + *
        +   * Optional. The list of fields to update
        +   * 
        + * + * .google.protobuf.FieldMask update_mask = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the updateMask field is set. + */ + boolean hasUpdateMask(); + + /** + * + * + *
        +   * Optional. The list of fields to update
        +   * 
        + * + * .google.protobuf.FieldMask update_mask = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The updateMask. + */ + com.google.protobuf.FieldMask getUpdateMask(); + + /** + * + * + *
        +   * Optional. The list of fields to update
        +   * 
        + * + * .google.protobuf.FieldMask update_mask = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder(); +} diff --git a/java-iam/proto-google-iam-v3beta/src/main/java/com/google/iam/v3beta/UpdatePrincipalAccessBoundaryPolicyRequest.java b/java-iam/proto-google-iam-v3beta/src/main/java/com/google/iam/v3beta/UpdatePrincipalAccessBoundaryPolicyRequest.java new file mode 100644 index 0000000000..0d1e19d43e --- /dev/null +++ b/java-iam/proto-google-iam-v3beta/src/main/java/com/google/iam/v3beta/UpdatePrincipalAccessBoundaryPolicyRequest.java @@ -0,0 +1,1175 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/iam/v3beta/principal_access_boundary_policies_service.proto +// Protobuf Java Version: 4.33.2 + +package com.google.iam.v3beta; + +/** + * + * + *
        + * Request message for UpdatePrincipalAccessBoundaryPolicy method.
        + * 
        + * + * Protobuf type {@code google.iam.v3beta.UpdatePrincipalAccessBoundaryPolicyRequest} + */ +@com.google.protobuf.Generated +public final class UpdatePrincipalAccessBoundaryPolicyRequest + extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.iam.v3beta.UpdatePrincipalAccessBoundaryPolicyRequest) + UpdatePrincipalAccessBoundaryPolicyRequestOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "UpdatePrincipalAccessBoundaryPolicyRequest"); + } + + // Use UpdatePrincipalAccessBoundaryPolicyRequest.newBuilder() to construct. + private UpdatePrincipalAccessBoundaryPolicyRequest( + com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private UpdatePrincipalAccessBoundaryPolicyRequest() {} + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.iam.v3beta.PrincipalAccessBoundaryPoliciesServiceProto + .internal_static_google_iam_v3beta_UpdatePrincipalAccessBoundaryPolicyRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.iam.v3beta.PrincipalAccessBoundaryPoliciesServiceProto + .internal_static_google_iam_v3beta_UpdatePrincipalAccessBoundaryPolicyRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.iam.v3beta.UpdatePrincipalAccessBoundaryPolicyRequest.class, + com.google.iam.v3beta.UpdatePrincipalAccessBoundaryPolicyRequest.Builder.class); + } + + private int bitField0_; + public static final int PRINCIPAL_ACCESS_BOUNDARY_POLICY_FIELD_NUMBER = 1; + private com.google.iam.v3beta.PrincipalAccessBoundaryPolicy principalAccessBoundaryPolicy_; + + /** + * + * + *
        +   * Required. The principal access boundary policy to update.
        +   *
        +   * The principal access boundary policy's `name` field is used to identify the
        +   * policy to update.
        +   * 
        + * + * + * .google.iam.v3beta.PrincipalAccessBoundaryPolicy principal_access_boundary_policy = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the principalAccessBoundaryPolicy field is set. + */ + @java.lang.Override + public boolean hasPrincipalAccessBoundaryPolicy() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
        +   * Required. The principal access boundary policy to update.
        +   *
        +   * The principal access boundary policy's `name` field is used to identify the
        +   * policy to update.
        +   * 
        + * + * + * .google.iam.v3beta.PrincipalAccessBoundaryPolicy principal_access_boundary_policy = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The principalAccessBoundaryPolicy. + */ + @java.lang.Override + public com.google.iam.v3beta.PrincipalAccessBoundaryPolicy getPrincipalAccessBoundaryPolicy() { + return principalAccessBoundaryPolicy_ == null + ? com.google.iam.v3beta.PrincipalAccessBoundaryPolicy.getDefaultInstance() + : principalAccessBoundaryPolicy_; + } + + /** + * + * + *
        +   * Required. The principal access boundary policy to update.
        +   *
        +   * The principal access boundary policy's `name` field is used to identify the
        +   * policy to update.
        +   * 
        + * + * + * .google.iam.v3beta.PrincipalAccessBoundaryPolicy principal_access_boundary_policy = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.iam.v3beta.PrincipalAccessBoundaryPolicyOrBuilder + getPrincipalAccessBoundaryPolicyOrBuilder() { + return principalAccessBoundaryPolicy_ == null + ? com.google.iam.v3beta.PrincipalAccessBoundaryPolicy.getDefaultInstance() + : principalAccessBoundaryPolicy_; + } + + public static final int VALIDATE_ONLY_FIELD_NUMBER = 2; + private boolean validateOnly_ = false; + + /** + * + * + *
        +   * Optional. If set, validate the request and preview the update, but do not
        +   * actually post it.
        +   * 
        + * + * bool validate_only = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The validateOnly. + */ + @java.lang.Override + public boolean getValidateOnly() { + return validateOnly_; + } + + public static final int UPDATE_MASK_FIELD_NUMBER = 3; + private com.google.protobuf.FieldMask updateMask_; + + /** + * + * + *
        +   * Optional. The list of fields to update
        +   * 
        + * + * .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. The list of fields to update
        +   * 
        + * + * .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. The list of fields to update
        +   * 
        + * + * .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 (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(1, getPrincipalAccessBoundaryPolicy()); + } + if (validateOnly_ != false) { + output.writeBool(2, validateOnly_); + } + 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 (((bitField0_ & 0x00000001) != 0)) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 1, getPrincipalAccessBoundaryPolicy()); + } + if (validateOnly_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(2, validateOnly_); + } + 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.iam.v3beta.UpdatePrincipalAccessBoundaryPolicyRequest)) { + return super.equals(obj); + } + com.google.iam.v3beta.UpdatePrincipalAccessBoundaryPolicyRequest other = + (com.google.iam.v3beta.UpdatePrincipalAccessBoundaryPolicyRequest) obj; + + if (hasPrincipalAccessBoundaryPolicy() != other.hasPrincipalAccessBoundaryPolicy()) + return false; + if (hasPrincipalAccessBoundaryPolicy()) { + if (!getPrincipalAccessBoundaryPolicy().equals(other.getPrincipalAccessBoundaryPolicy())) + return false; + } + if (getValidateOnly() != other.getValidateOnly()) 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(); + if (hasPrincipalAccessBoundaryPolicy()) { + hash = (37 * hash) + PRINCIPAL_ACCESS_BOUNDARY_POLICY_FIELD_NUMBER; + hash = (53 * hash) + getPrincipalAccessBoundaryPolicy().hashCode(); + } + hash = (37 * hash) + VALIDATE_ONLY_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getValidateOnly()); + 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.iam.v3beta.UpdatePrincipalAccessBoundaryPolicyRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.iam.v3beta.UpdatePrincipalAccessBoundaryPolicyRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.iam.v3beta.UpdatePrincipalAccessBoundaryPolicyRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.iam.v3beta.UpdatePrincipalAccessBoundaryPolicyRequest 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.iam.v3beta.UpdatePrincipalAccessBoundaryPolicyRequest parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.iam.v3beta.UpdatePrincipalAccessBoundaryPolicyRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.iam.v3beta.UpdatePrincipalAccessBoundaryPolicyRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.iam.v3beta.UpdatePrincipalAccessBoundaryPolicyRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.iam.v3beta.UpdatePrincipalAccessBoundaryPolicyRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.iam.v3beta.UpdatePrincipalAccessBoundaryPolicyRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.iam.v3beta.UpdatePrincipalAccessBoundaryPolicyRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.iam.v3beta.UpdatePrincipalAccessBoundaryPolicyRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.iam.v3beta.UpdatePrincipalAccessBoundaryPolicyRequest 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
        +   * Request message for UpdatePrincipalAccessBoundaryPolicy method.
        +   * 
        + * + * Protobuf type {@code google.iam.v3beta.UpdatePrincipalAccessBoundaryPolicyRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.iam.v3beta.UpdatePrincipalAccessBoundaryPolicyRequest) + com.google.iam.v3beta.UpdatePrincipalAccessBoundaryPolicyRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.iam.v3beta.PrincipalAccessBoundaryPoliciesServiceProto + .internal_static_google_iam_v3beta_UpdatePrincipalAccessBoundaryPolicyRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.iam.v3beta.PrincipalAccessBoundaryPoliciesServiceProto + .internal_static_google_iam_v3beta_UpdatePrincipalAccessBoundaryPolicyRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.iam.v3beta.UpdatePrincipalAccessBoundaryPolicyRequest.class, + com.google.iam.v3beta.UpdatePrincipalAccessBoundaryPolicyRequest.Builder.class); + } + + // Construct using com.google.iam.v3beta.UpdatePrincipalAccessBoundaryPolicyRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetPrincipalAccessBoundaryPolicyFieldBuilder(); + internalGetUpdateMaskFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + principalAccessBoundaryPolicy_ = null; + if (principalAccessBoundaryPolicyBuilder_ != null) { + principalAccessBoundaryPolicyBuilder_.dispose(); + principalAccessBoundaryPolicyBuilder_ = null; + } + validateOnly_ = 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.iam.v3beta.PrincipalAccessBoundaryPoliciesServiceProto + .internal_static_google_iam_v3beta_UpdatePrincipalAccessBoundaryPolicyRequest_descriptor; + } + + @java.lang.Override + public com.google.iam.v3beta.UpdatePrincipalAccessBoundaryPolicyRequest + getDefaultInstanceForType() { + return com.google.iam.v3beta.UpdatePrincipalAccessBoundaryPolicyRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.iam.v3beta.UpdatePrincipalAccessBoundaryPolicyRequest build() { + com.google.iam.v3beta.UpdatePrincipalAccessBoundaryPolicyRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.iam.v3beta.UpdatePrincipalAccessBoundaryPolicyRequest buildPartial() { + com.google.iam.v3beta.UpdatePrincipalAccessBoundaryPolicyRequest result = + new com.google.iam.v3beta.UpdatePrincipalAccessBoundaryPolicyRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.iam.v3beta.UpdatePrincipalAccessBoundaryPolicyRequest result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.principalAccessBoundaryPolicy_ = + principalAccessBoundaryPolicyBuilder_ == null + ? principalAccessBoundaryPolicy_ + : principalAccessBoundaryPolicyBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.validateOnly_ = validateOnly_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.updateMask_ = updateMaskBuilder_ == null ? updateMask_ : updateMaskBuilder_.build(); + to_bitField0_ |= 0x00000002; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.iam.v3beta.UpdatePrincipalAccessBoundaryPolicyRequest) { + return mergeFrom((com.google.iam.v3beta.UpdatePrincipalAccessBoundaryPolicyRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.iam.v3beta.UpdatePrincipalAccessBoundaryPolicyRequest other) { + if (other + == com.google.iam.v3beta.UpdatePrincipalAccessBoundaryPolicyRequest.getDefaultInstance()) + return this; + if (other.hasPrincipalAccessBoundaryPolicy()) { + mergePrincipalAccessBoundaryPolicy(other.getPrincipalAccessBoundaryPolicy()); + } + if (other.getValidateOnly() != false) { + setValidateOnly(other.getValidateOnly()); + } + 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: + { + input.readMessage( + internalGetPrincipalAccessBoundaryPolicyFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 16: + { + validateOnly_ = input.readBool(); + bitField0_ |= 0x00000002; + break; + } // case 16 + case 26: + { + input.readMessage( + internalGetUpdateMaskFieldBuilder().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.iam.v3beta.PrincipalAccessBoundaryPolicy principalAccessBoundaryPolicy_; + private com.google.protobuf.SingleFieldBuilder< + com.google.iam.v3beta.PrincipalAccessBoundaryPolicy, + com.google.iam.v3beta.PrincipalAccessBoundaryPolicy.Builder, + com.google.iam.v3beta.PrincipalAccessBoundaryPolicyOrBuilder> + principalAccessBoundaryPolicyBuilder_; + + /** + * + * + *
        +     * Required. The principal access boundary policy to update.
        +     *
        +     * The principal access boundary policy's `name` field is used to identify the
        +     * policy to update.
        +     * 
        + * + * + * .google.iam.v3beta.PrincipalAccessBoundaryPolicy principal_access_boundary_policy = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the principalAccessBoundaryPolicy field is set. + */ + public boolean hasPrincipalAccessBoundaryPolicy() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
        +     * Required. The principal access boundary policy to update.
        +     *
        +     * The principal access boundary policy's `name` field is used to identify the
        +     * policy to update.
        +     * 
        + * + * + * .google.iam.v3beta.PrincipalAccessBoundaryPolicy principal_access_boundary_policy = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The principalAccessBoundaryPolicy. + */ + public com.google.iam.v3beta.PrincipalAccessBoundaryPolicy getPrincipalAccessBoundaryPolicy() { + if (principalAccessBoundaryPolicyBuilder_ == null) { + return principalAccessBoundaryPolicy_ == null + ? com.google.iam.v3beta.PrincipalAccessBoundaryPolicy.getDefaultInstance() + : principalAccessBoundaryPolicy_; + } else { + return principalAccessBoundaryPolicyBuilder_.getMessage(); + } + } + + /** + * + * + *
        +     * Required. The principal access boundary policy to update.
        +     *
        +     * The principal access boundary policy's `name` field is used to identify the
        +     * policy to update.
        +     * 
        + * + * + * .google.iam.v3beta.PrincipalAccessBoundaryPolicy principal_access_boundary_policy = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setPrincipalAccessBoundaryPolicy( + com.google.iam.v3beta.PrincipalAccessBoundaryPolicy value) { + if (principalAccessBoundaryPolicyBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + principalAccessBoundaryPolicy_ = value; + } else { + principalAccessBoundaryPolicyBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
        +     * Required. The principal access boundary policy to update.
        +     *
        +     * The principal access boundary policy's `name` field is used to identify the
        +     * policy to update.
        +     * 
        + * + * + * .google.iam.v3beta.PrincipalAccessBoundaryPolicy principal_access_boundary_policy = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setPrincipalAccessBoundaryPolicy( + com.google.iam.v3beta.PrincipalAccessBoundaryPolicy.Builder builderForValue) { + if (principalAccessBoundaryPolicyBuilder_ == null) { + principalAccessBoundaryPolicy_ = builderForValue.build(); + } else { + principalAccessBoundaryPolicyBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
        +     * Required. The principal access boundary policy to update.
        +     *
        +     * The principal access boundary policy's `name` field is used to identify the
        +     * policy to update.
        +     * 
        + * + * + * .google.iam.v3beta.PrincipalAccessBoundaryPolicy principal_access_boundary_policy = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergePrincipalAccessBoundaryPolicy( + com.google.iam.v3beta.PrincipalAccessBoundaryPolicy value) { + if (principalAccessBoundaryPolicyBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) + && principalAccessBoundaryPolicy_ != null + && principalAccessBoundaryPolicy_ + != com.google.iam.v3beta.PrincipalAccessBoundaryPolicy.getDefaultInstance()) { + getPrincipalAccessBoundaryPolicyBuilder().mergeFrom(value); + } else { + principalAccessBoundaryPolicy_ = value; + } + } else { + principalAccessBoundaryPolicyBuilder_.mergeFrom(value); + } + if (principalAccessBoundaryPolicy_ != null) { + bitField0_ |= 0x00000001; + onChanged(); + } + return this; + } + + /** + * + * + *
        +     * Required. The principal access boundary policy to update.
        +     *
        +     * The principal access boundary policy's `name` field is used to identify the
        +     * policy to update.
        +     * 
        + * + * + * .google.iam.v3beta.PrincipalAccessBoundaryPolicy principal_access_boundary_policy = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearPrincipalAccessBoundaryPolicy() { + bitField0_ = (bitField0_ & ~0x00000001); + principalAccessBoundaryPolicy_ = null; + if (principalAccessBoundaryPolicyBuilder_ != null) { + principalAccessBoundaryPolicyBuilder_.dispose(); + principalAccessBoundaryPolicyBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
        +     * Required. The principal access boundary policy to update.
        +     *
        +     * The principal access boundary policy's `name` field is used to identify the
        +     * policy to update.
        +     * 
        + * + * + * .google.iam.v3beta.PrincipalAccessBoundaryPolicy principal_access_boundary_policy = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.iam.v3beta.PrincipalAccessBoundaryPolicy.Builder + getPrincipalAccessBoundaryPolicyBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return internalGetPrincipalAccessBoundaryPolicyFieldBuilder().getBuilder(); + } + + /** + * + * + *
        +     * Required. The principal access boundary policy to update.
        +     *
        +     * The principal access boundary policy's `name` field is used to identify the
        +     * policy to update.
        +     * 
        + * + * + * .google.iam.v3beta.PrincipalAccessBoundaryPolicy principal_access_boundary_policy = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.iam.v3beta.PrincipalAccessBoundaryPolicyOrBuilder + getPrincipalAccessBoundaryPolicyOrBuilder() { + if (principalAccessBoundaryPolicyBuilder_ != null) { + return principalAccessBoundaryPolicyBuilder_.getMessageOrBuilder(); + } else { + return principalAccessBoundaryPolicy_ == null + ? com.google.iam.v3beta.PrincipalAccessBoundaryPolicy.getDefaultInstance() + : principalAccessBoundaryPolicy_; + } + } + + /** + * + * + *
        +     * Required. The principal access boundary policy to update.
        +     *
        +     * The principal access boundary policy's `name` field is used to identify the
        +     * policy to update.
        +     * 
        + * + * + * .google.iam.v3beta.PrincipalAccessBoundaryPolicy principal_access_boundary_policy = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.iam.v3beta.PrincipalAccessBoundaryPolicy, + com.google.iam.v3beta.PrincipalAccessBoundaryPolicy.Builder, + com.google.iam.v3beta.PrincipalAccessBoundaryPolicyOrBuilder> + internalGetPrincipalAccessBoundaryPolicyFieldBuilder() { + if (principalAccessBoundaryPolicyBuilder_ == null) { + principalAccessBoundaryPolicyBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.iam.v3beta.PrincipalAccessBoundaryPolicy, + com.google.iam.v3beta.PrincipalAccessBoundaryPolicy.Builder, + com.google.iam.v3beta.PrincipalAccessBoundaryPolicyOrBuilder>( + getPrincipalAccessBoundaryPolicy(), getParentForChildren(), isClean()); + principalAccessBoundaryPolicy_ = null; + } + return principalAccessBoundaryPolicyBuilder_; + } + + private boolean validateOnly_; + + /** + * + * + *
        +     * Optional. If set, validate the request and preview the update, but do not
        +     * actually post it.
        +     * 
        + * + * bool validate_only = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The validateOnly. + */ + @java.lang.Override + public boolean getValidateOnly() { + return validateOnly_; + } + + /** + * + * + *
        +     * Optional. If set, validate the request and preview the update, but do not
        +     * actually post it.
        +     * 
        + * + * bool validate_only = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The validateOnly to set. + * @return This builder for chaining. + */ + public Builder setValidateOnly(boolean value) { + + validateOnly_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
        +     * Optional. If set, validate the request and preview the update, but do not
        +     * actually post it.
        +     * 
        + * + * bool validate_only = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearValidateOnly() { + bitField0_ = (bitField0_ & ~0x00000002); + validateOnly_ = false; + onChanged(); + return this; + } + + private com.google.protobuf.FieldMask updateMask_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder> + updateMaskBuilder_; + + /** + * + * + *
        +     * Optional. The list of fields to update
        +     * 
        + * + * .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. The list of fields to update
        +     * 
        + * + * .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. The list of fields to update
        +     * 
        + * + * .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. The list of fields to update
        +     * 
        + * + * .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. The list of fields to update
        +     * 
        + * + * .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. The list of fields to update
        +     * 
        + * + * .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. The list of fields to update
        +     * 
        + * + * .google.protobuf.FieldMask update_mask = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.protobuf.FieldMask.Builder getUpdateMaskBuilder() { + bitField0_ |= 0x00000004; + onChanged(); + return internalGetUpdateMaskFieldBuilder().getBuilder(); + } + + /** + * + * + *
        +     * Optional. The list of fields to update
        +     * 
        + * + * .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. The list of fields to update
        +     * 
        + * + * .google.protobuf.FieldMask update_mask = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder> + internalGetUpdateMaskFieldBuilder() { + if (updateMaskBuilder_ == null) { + updateMaskBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder>( + getUpdateMask(), getParentForChildren(), isClean()); + updateMask_ = null; + } + return updateMaskBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.iam.v3beta.UpdatePrincipalAccessBoundaryPolicyRequest) + } + + // @@protoc_insertion_point(class_scope:google.iam.v3beta.UpdatePrincipalAccessBoundaryPolicyRequest) + private static final com.google.iam.v3beta.UpdatePrincipalAccessBoundaryPolicyRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.iam.v3beta.UpdatePrincipalAccessBoundaryPolicyRequest(); + } + + public static com.google.iam.v3beta.UpdatePrincipalAccessBoundaryPolicyRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public UpdatePrincipalAccessBoundaryPolicyRequest 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.iam.v3beta.UpdatePrincipalAccessBoundaryPolicyRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-iam/proto-google-iam-v3beta/src/main/java/com/google/iam/v3beta/UpdatePrincipalAccessBoundaryPolicyRequestOrBuilder.java b/java-iam/proto-google-iam-v3beta/src/main/java/com/google/iam/v3beta/UpdatePrincipalAccessBoundaryPolicyRequestOrBuilder.java new file mode 100644 index 0000000000..a22cfca2be --- /dev/null +++ b/java-iam/proto-google-iam-v3beta/src/main/java/com/google/iam/v3beta/UpdatePrincipalAccessBoundaryPolicyRequestOrBuilder.java @@ -0,0 +1,135 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/iam/v3beta/principal_access_boundary_policies_service.proto +// Protobuf Java Version: 4.33.2 + +package com.google.iam.v3beta; + +@com.google.protobuf.Generated +public interface UpdatePrincipalAccessBoundaryPolicyRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.iam.v3beta.UpdatePrincipalAccessBoundaryPolicyRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
        +   * Required. The principal access boundary policy to update.
        +   *
        +   * The principal access boundary policy's `name` field is used to identify the
        +   * policy to update.
        +   * 
        + * + * + * .google.iam.v3beta.PrincipalAccessBoundaryPolicy principal_access_boundary_policy = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the principalAccessBoundaryPolicy field is set. + */ + boolean hasPrincipalAccessBoundaryPolicy(); + + /** + * + * + *
        +   * Required. The principal access boundary policy to update.
        +   *
        +   * The principal access boundary policy's `name` field is used to identify the
        +   * policy to update.
        +   * 
        + * + * + * .google.iam.v3beta.PrincipalAccessBoundaryPolicy principal_access_boundary_policy = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The principalAccessBoundaryPolicy. + */ + com.google.iam.v3beta.PrincipalAccessBoundaryPolicy getPrincipalAccessBoundaryPolicy(); + + /** + * + * + *
        +   * Required. The principal access boundary policy to update.
        +   *
        +   * The principal access boundary policy's `name` field is used to identify the
        +   * policy to update.
        +   * 
        + * + * + * .google.iam.v3beta.PrincipalAccessBoundaryPolicy principal_access_boundary_policy = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.iam.v3beta.PrincipalAccessBoundaryPolicyOrBuilder + getPrincipalAccessBoundaryPolicyOrBuilder(); + + /** + * + * + *
        +   * Optional. If set, validate the request and preview the update, but do not
        +   * actually post it.
        +   * 
        + * + * bool validate_only = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The validateOnly. + */ + boolean getValidateOnly(); + + /** + * + * + *
        +   * Optional. The list of fields to update
        +   * 
        + * + * .google.protobuf.FieldMask update_mask = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the updateMask field is set. + */ + boolean hasUpdateMask(); + + /** + * + * + *
        +   * Optional. The list of fields to update
        +   * 
        + * + * .google.protobuf.FieldMask update_mask = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The updateMask. + */ + com.google.protobuf.FieldMask getUpdateMask(); + + /** + * + * + *
        +   * Optional. The list of fields to update
        +   * 
        + * + * .google.protobuf.FieldMask update_mask = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder(); +} diff --git a/java-iam/proto-google-iam-v3beta/src/main/proto/google/iam/v3beta/operation_metadata.proto b/java-iam/proto-google-iam-v3beta/src/main/proto/google/iam/v3beta/operation_metadata.proto new file mode 100644 index 0000000000..6c62252093 --- /dev/null +++ b/java-iam/proto-google-iam-v3beta/src/main/proto/google/iam/v3beta/operation_metadata.proto @@ -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. + +syntax = "proto3"; + +package google.iam.v3beta; + +import "google/api/field_behavior.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.Iam.V3Beta"; +option go_package = "cloud.google.com/go/iam/apiv3beta/iampb;iampb"; +option java_multiple_files = true; +option java_outer_classname = "OperationMetadataProto"; +option java_package = "com.google.iam.v3beta"; +option php_namespace = "Google\\Cloud\\Iam\\V3beta"; + +// Represents the metadata of the long-running operation. +message OperationMetadata { + // Output only. The time the operation was created. + google.protobuf.Timestamp create_time = 1 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The time the operation finished running. + google.protobuf.Timestamp end_time = 2 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Server-defined resource path for the target of the + string target = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Name of the verb executed by the operation. + string verb = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Human-readable status of the operation, if any. + string status_message = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Identifies whether the user has requested cancellation + // of the operation. Operations that have successfully been cancelled + // have [Operation.error][] value with a + // [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to + // `Code.CANCELLED`. + bool requested_cancellation = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. API version used to start the operation. + string api_version = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; +} diff --git a/java-iam/proto-google-iam-v3beta/src/main/proto/google/iam/v3beta/policy_binding_resources.proto b/java-iam/proto-google-iam-v3beta/src/main/proto/google/iam/v3beta/policy_binding_resources.proto new file mode 100644 index 0000000000..1fed6cfcef --- /dev/null +++ b/java-iam/proto-google-iam-v3beta/src/main/proto/google/iam/v3beta/policy_binding_resources.proto @@ -0,0 +1,185 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.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.iam.v3beta; + +import "google/api/field_behavior.proto"; +import "google/api/field_info.proto"; +import "google/api/resource.proto"; +import "google/protobuf/timestamp.proto"; +import "google/type/expr.proto"; + +option csharp_namespace = "Google.Cloud.Iam.V3Beta"; +option go_package = "cloud.google.com/go/iam/apiv3beta/iampb;iampb"; +option java_multiple_files = true; +option java_outer_classname = "PolicyBindingResourcesProto"; +option java_package = "com.google.iam.v3beta"; +option php_namespace = "Google\\Cloud\\Iam\\V3beta"; + +// IAM policy binding resource. +message PolicyBinding { + option (google.api.resource) = { + type: "iam.googleapis.com/PolicyBinding" + pattern: "organizations/{organization}/locations/{location}/policyBindings/{policy_binding}" + pattern: "folders/{folder}/locations/{location}/policyBindings/{policy_binding}" + pattern: "projects/{project}/locations/{location}/policyBindings/{policy_binding}" + plural: "policyBindings" + singular: "policyBinding" + }; + + // Target is the full resource name of the resource to which the policy will + // be bound. Immutable once set. + message Target { + // The different types of targets that can be bound to a policy. + oneof target { + // Immutable. Full Resource Name used for principal access boundary policy + // bindings. The principal set must be directly parented by the policy + // binding's parent or same as the parent if the target is a + // project/folder/organization. + // + // Examples: + // * For binding's parented by an organization: + // * Organization: + // `//cloudresourcemanager.googleapis.com/organizations/ORGANIZATION_ID` + // * Workforce Identity: + // `//iam.googleapis.com/locations/global/workforcePools/WORKFORCE_POOL_ID` + // * Workspace Identity: + // `//iam.googleapis.com/locations/global/workspace/WORKSPACE_ID` + // * For binding's parented by a folder: + // * Folder: + // `//cloudresourcemanager.googleapis.com/folders/FOLDER_ID` + // * For binding's parented by a project: + // * Project: + // * `//cloudresourcemanager.googleapis.com/projects/PROJECT_NUMBER` + // * `//cloudresourcemanager.googleapis.com/projects/PROJECT_ID` + // * Workload Identity Pool: + // `//iam.googleapis.com/projects/PROJECT_NUMBER/locations/LOCATION/workloadIdentityPools/WORKLOAD_POOL_ID` + string principal_set = 1 [(google.api.field_behavior) = IMMUTABLE]; + } + } + + // Different policy kinds supported in this binding. + enum PolicyKind { + // Unspecified policy kind; Not a valid state + POLICY_KIND_UNSPECIFIED = 0; + + // Principal access boundary policy kind + PRINCIPAL_ACCESS_BOUNDARY = 1; + } + + // Identifier. The name of the policy binding, in the format + // `{binding_parent/locations/{location}/policyBindings/{policy_binding_id}`. + // The binding parent is the closest Resource Manager resource (project, + // folder, or organization) to the binding target. + // + // Format: + // + // * `projects/{project_id}/locations/{location}/policyBindings/{policy_binding_id}` + // * `projects/{project_number}/locations/{location}/policyBindings/{policy_binding_id}` + // * `folders/{folder_id}/locations/{location}/policyBindings/{policy_binding_id}` + // * `organizations/{organization_id}/locations/{location}/policyBindings/{policy_binding_id}` + string name = 1 [(google.api.field_behavior) = IDENTIFIER]; + + // Output only. The globally unique ID of the policy binding. Assigned when + // the policy binding is created. + string uid = 2 [ + (google.api.field_info).format = UUID4, + (google.api.field_behavior) = OUTPUT_ONLY + ]; + + // Optional. The etag for the policy binding. + // If this is provided on update, it must match the server's etag. + string etag = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The description of the policy binding. Must be less than or equal + // to 63 characters. + string display_name = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. User-defined annotations. See + // https://google.aip.dev/148#annotations for more details such as format and + // size limitations + map annotations = 5 [(google.api.field_behavior) = OPTIONAL]; + + // Required. Immutable. Target is the full resource name of the resource to + // which the policy will be bound. Immutable once set. + Target target = 6 [ + (google.api.field_behavior) = IMMUTABLE, + (google.api.field_behavior) = REQUIRED + ]; + + // Immutable. The kind of the policy to attach in this binding. This field + // must be one of the following: + // + // - Left empty (will be automatically set to the policy kind) + // - The input policy kind + PolicyKind policy_kind = 11 [(google.api.field_behavior) = IMMUTABLE]; + + // Required. Immutable. The resource name of the policy to be bound. The + // binding parent and policy must belong to the same organization. + string policy = 7 [ + (google.api.field_behavior) = IMMUTABLE, + (google.api.field_behavior) = REQUIRED + ]; + + // Output only. The globally unique ID of the policy to be bound. + string policy_uid = 12 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. The condition to apply to the policy binding. When set, the + // `expression` field in the `Expr` must include from 1 to 10 subexpressions, + // joined by the + // "||"(Logical OR), "&&"(Logical AND) or "!"(Logical NOT) operators and + // cannot contain more than 250 characters. + // + // The condition is currently only supported when bound to policies of kind + // principal access boundary. + // + // When the bound policy is a principal access boundary policy, the only + // supported attributes in any subexpression are `principal.type` and + // `principal.subject`. An example expression is: "principal.type == + // 'iam.googleapis.com/ServiceAccount'" or "principal.subject == + // 'bob@example.com'". + // + // Allowed operations for `principal.subject`: + // + // - `principal.subject == ` + // - `principal.subject != ` + // - `principal.subject in []` + // - `principal.subject.startsWith()` + // - `principal.subject.endsWith()` + // + // Allowed operations for `principal.type`: + // + // - `principal.type == ` + // - `principal.type != ` + // - `principal.type in []` + // + // Supported principal types are Workspace, Workforce Pool, Workload Pool and + // Service Account. Allowed string must be one of: + // + // - iam.googleapis.com/WorkspaceIdentity + // - iam.googleapis.com/WorkforcePoolIdentity + // - iam.googleapis.com/WorkloadPoolIdentity + // - iam.googleapis.com/ServiceAccount + google.type.Expr condition = 8 [(google.api.field_behavior) = OPTIONAL]; + + // Output only. The time when the policy binding was created. + google.protobuf.Timestamp create_time = 9 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The time when the policy binding was most recently updated. + google.protobuf.Timestamp update_time = 10 + [(google.api.field_behavior) = OUTPUT_ONLY]; +} diff --git a/java-iam/proto-google-iam-v3beta/src/main/proto/google/iam/v3beta/policy_bindings_service.proto b/java-iam/proto-google-iam-v3beta/src/main/proto/google/iam/v3beta/policy_bindings_service.proto new file mode 100644 index 0000000000..e4f7c85447 --- /dev/null +++ b/java-iam/proto-google-iam-v3beta/src/main/proto/google/iam/v3beta/policy_bindings_service.proto @@ -0,0 +1,377 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.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.iam.v3beta; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/iam/v3beta/operation_metadata.proto"; +import "google/iam/v3beta/policy_binding_resources.proto"; +import "google/longrunning/operations.proto"; +import "google/protobuf/empty.proto"; +import "google/protobuf/field_mask.proto"; + +option csharp_namespace = "Google.Cloud.Iam.V3Beta"; +option go_package = "cloud.google.com/go/iam/apiv3beta/iampb;iampb"; +option java_multiple_files = true; +option java_outer_classname = "PolicyBindingsServiceProto"; +option java_package = "com.google.iam.v3beta"; +option php_namespace = "Google\\Cloud\\Iam\\V3beta"; +option (google.api.resource_definition) = { + type: "iam.googleapis.com/OrganizationLocation" + pattern: "organizations/{organization}/locations/{location}" +}; +option (google.api.resource_definition) = { + type: "iam.googleapis.com/FolderLocation" + pattern: "folders/{folder}/locations/{location}" +}; + +// An interface for managing Identity and Access Management (IAM) policy +// bindings. +service PolicyBindings { + option (google.api.default_host) = "iam.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform"; + + // Creates a policy binding and returns a long-running operation. + // Callers will need the IAM permissions on both the policy and target. + // Once the binding is created, the policy is applied to the target. + rpc CreatePolicyBinding(CreatePolicyBindingRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v3beta/{parent=projects/*/locations/*}/policyBindings" + body: "policy_binding" + additional_bindings { + post: "/v3beta/{parent=folders/*/locations/*}/policyBindings" + body: "policy_binding" + } + additional_bindings { + post: "/v3beta/{parent=organizations/*/locations/*}/policyBindings" + body: "policy_binding" + } + }; + option (google.api.method_signature) = + "parent,policy_binding,policy_binding_id"; + option (google.longrunning.operation_info) = { + response_type: "PolicyBinding" + metadata_type: "OperationMetadata" + }; + } + + // Gets a policy binding. + rpc GetPolicyBinding(GetPolicyBindingRequest) returns (PolicyBinding) { + option (google.api.http) = { + get: "/v3beta/{name=projects/*/locations/*/policyBindings/*}" + additional_bindings { + get: "/v3beta/{name=folders/*/locations/*/policyBindings/*}" + } + additional_bindings { + get: "/v3beta/{name=organizations/*/locations/*/policyBindings/*}" + } + }; + option (google.api.method_signature) = "name"; + } + + // Updates a policy binding and returns a long-running operation. + // Callers will need the IAM permissions on the policy and target in the + // binding to update, and the IAM permission to remove the existing policy + // from the binding. Target is immutable and cannot be updated. Once the + // binding is updated, the new policy is applied to the target. + rpc UpdatePolicyBinding(UpdatePolicyBindingRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + patch: "/v3beta/{policy_binding.name=projects/*/locations/*/policyBindings/*}" + body: "policy_binding" + additional_bindings { + patch: "/v3beta/{policy_binding.name=folders/*/locations/*/policyBindings/*}" + body: "policy_binding" + } + additional_bindings { + patch: "/v3beta/{policy_binding.name=organizations/*/locations/*/policyBindings/*}" + body: "policy_binding" + } + }; + option (google.api.method_signature) = "policy_binding,update_mask"; + option (google.longrunning.operation_info) = { + response_type: "PolicyBinding" + metadata_type: "OperationMetadata" + }; + } + + // Deletes a policy binding and returns a long-running operation. + // Callers will need the IAM permissions on both the policy and target. + // Once the binding is deleted, the policy no longer applies to the target. + rpc DeletePolicyBinding(DeletePolicyBindingRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + delete: "/v3beta/{name=projects/*/locations/*/policyBindings/*}" + additional_bindings { + delete: "/v3beta/{name=folders/*/locations/*/policyBindings/*}" + } + additional_bindings { + delete: "/v3beta/{name=organizations/*/locations/*/policyBindings/*}" + } + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "google.protobuf.Empty" + metadata_type: "OperationMetadata" + }; + } + + // Lists policy bindings. + rpc ListPolicyBindings(ListPolicyBindingsRequest) + returns (ListPolicyBindingsResponse) { + option (google.api.http) = { + get: "/v3beta/{parent=projects/*/locations/*}/policyBindings" + additional_bindings { + get: "/v3beta/{parent=folders/*/locations/*}/policyBindings" + } + additional_bindings { + get: "/v3beta/{parent=organizations/*/locations/*}/policyBindings" + } + }; + option (google.api.method_signature) = "parent"; + } + + // Search policy bindings by target. Returns all policy binding objects bound + // directly to target. + rpc SearchTargetPolicyBindings(SearchTargetPolicyBindingsRequest) + returns (SearchTargetPolicyBindingsResponse) { + option (google.api.http) = { + get: "/v3beta/{parent=projects/*/locations/*}/policyBindings:searchTargetPolicyBindings" + additional_bindings { + get: "/v3beta/{parent=folders/*/locations/*}/policyBindings:searchTargetPolicyBindings" + } + additional_bindings { + get: "/v3beta/{parent=organizations/*/locations/*}/policyBindings:searchTargetPolicyBindings" + } + }; + option (google.api.method_signature) = "parent,target"; + } +} + +// Request message for CreatePolicyBinding method. +message CreatePolicyBindingRequest { + // Required. The parent resource where this policy binding will be created. + // The binding parent is the closest Resource Manager resource (project, + // folder or organization) to the binding target. + // + // Format: + // + // * `projects/{project_id}/locations/{location}` + // * `projects/{project_number}/locations/{location}` + // * `folders/{folder_id}/locations/{location}` + // * `organizations/{organization_id}/locations/{location}` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "iam.googleapis.com/PolicyBinding" + } + ]; + + // Required. The ID to use for the policy binding, which will become the final + // component of the policy binding's resource name. + // + // This value must start with a lowercase letter followed by up to 62 + // lowercase letters, numbers, hyphens, or dots. Pattern, + // /[a-z][a-z0-9-\.]{2,62}/. + string policy_binding_id = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The policy binding to create. + PolicyBinding policy_binding = 3 [(google.api.field_behavior) = REQUIRED]; + + // Optional. If set, validate the request and preview the creation, but do not + // actually post it. + bool validate_only = 4 [(google.api.field_behavior) = OPTIONAL]; +} + +// Request message for GetPolicyBinding method. +message GetPolicyBindingRequest { + // Required. The name of the policy binding to retrieve. + // + // Format: + // + // * `projects/{project_id}/locations/{location}/policyBindings/{policy_binding_id}` + // * `projects/{project_number}/locations/{location}/policyBindings/{policy_binding_id}` + // * `folders/{folder_id}/locations/{location}/policyBindings/{policy_binding_id}` + // * `organizations/{organization_id}/locations/{location}/policyBindings/{policy_binding_id}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "iam.googleapis.com/PolicyBinding" + } + ]; +} + +// Request message for UpdatePolicyBinding method. +message UpdatePolicyBindingRequest { + // Required. The policy binding to update. + // + // The policy binding's `name` field is used to identify the policy binding to + // update. + PolicyBinding policy_binding = 1 [(google.api.field_behavior) = REQUIRED]; + + // Optional. If set, validate the request and preview the update, but do not + // actually post it. + bool validate_only = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The list of fields to update + google.protobuf.FieldMask update_mask = 3 + [(google.api.field_behavior) = OPTIONAL]; +} + +// Request message for DeletePolicyBinding method. +message DeletePolicyBindingRequest { + // Required. The name of the policy binding to delete. + // + // Format: + // + // * `projects/{project_id}/locations/{location}/policyBindings/{policy_binding_id}` + // * `projects/{project_number}/locations/{location}/policyBindings/{policy_binding_id}` + // * `folders/{folder_id}/locations/{location}/policyBindings/{policy_binding_id}` + // * `organizations/{organization_id}/locations/{location}/policyBindings/{policy_binding_id}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "iam.googleapis.com/PolicyBinding" + } + ]; + + // Optional. The etag of the policy binding. + // If this is provided, it must match the server's etag. + string etag = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If set, validate the request and preview the deletion, but do not + // actually post it. + bool validate_only = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +// Request message for ListPolicyBindings method. +message ListPolicyBindingsRequest { + // Required. The parent resource, which owns the collection of policy + // bindings. + // + // Format: + // + // * `projects/{project_id}/locations/{location}` + // * `projects/{project_number}/locations/{location}` + // * `folders/{folder_id}/locations/{location}` + // * `organizations/{organization_id}/locations/{location}` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "iam.googleapis.com/PolicyBinding" + } + ]; + + // Optional. The maximum number of policy bindings to return. The service may + // return fewer than this value. + // + // If unspecified, at most 50 policy bindings will be returned. + // The maximum value is 1000; values above 1000 will be coerced to 1000. + int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A page token, received from a previous `ListPolicyBindings` call. + // Provide this to retrieve the subsequent page. + // + // When paginating, all other parameters provided to `ListPolicyBindings` must + // match the call that provided the page token. + string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. An expression for filtering the results of the request. Filter + // rules are case insensitive. Some eligible fields for filtering are: + // + // + `target` + // + `policy` + // + // Some examples of filter queries: + // + // * `target:ex*`: The binding target's name starts with "ex". + // * `target:example`: The binding target's name is `example`. + // * `policy:example`: The binding policy's name is `example`. + string filter = 4 [(google.api.field_behavior) = OPTIONAL]; +} + +// Response message for ListPolicyBindings method. +message ListPolicyBindingsResponse { + // The policy bindings from the specified parent. + repeated PolicyBinding policy_bindings = 1; + + // Optional. A token, which can be sent as `page_token` to retrieve the next + // page. If this field is omitted, there are no subsequent pages. + string next_page_token = 2 [(google.api.field_behavior) = OPTIONAL]; +} + +// Request message for SearchTargetPolicyBindings method. +message SearchTargetPolicyBindingsRequest { + // Required. The target resource, which is bound to the policy in the binding. + // + // Format: + // + // * `//iam.googleapis.com/locations/global/workforcePools/POOL_ID` + // * `//iam.googleapis.com/projects/PROJECT_NUMBER/locations/global/workloadIdentityPools/POOL_ID` + // * `//iam.googleapis.com/locations/global/workspace/WORKSPACE_ID` + // * `//cloudresourcemanager.googleapis.com/projects/{project_number}` + // * `//cloudresourcemanager.googleapis.com/folders/{folder_id}` + // * `//cloudresourcemanager.googleapis.com/organizations/{organization_id}` + string target = 1 [(google.api.field_behavior) = REQUIRED]; + + // Optional. The maximum number of policy bindings to return. The service may + // return fewer than this value. + // + // If unspecified, at most 50 policy bindings will be returned. + // The maximum value is 1000; values above 1000 will be coerced to 1000. + int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A page token, received from a previous + // `SearchTargetPolicyBindingsRequest` call. Provide this to retrieve the + // subsequent page. + // + // When paginating, all other parameters provided to + // `SearchTargetPolicyBindingsRequest` must match the call that provided the + // page token. + string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Required. The parent resource where this search will be performed. This + // should be the nearest Resource Manager resource (project, folder, or + // organization) to the target. + // + // Format: + // + // * `projects/{project_id}/locations/{location}` + // * `projects/{project_number}/locations/{location}` + // * `folders/{folder_id}/locations/{location}` + // * `organizations/{organization_id}/locations/{location}` + string parent = 5 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "iam.googleapis.com/PolicyBinding" + } + ]; +} + +// Response message for SearchTargetPolicyBindings method. +message SearchTargetPolicyBindingsResponse { + // The policy bindings bound to the specified target. + repeated PolicyBinding policy_bindings = 1; + + // Optional. A token, which can be sent as `page_token` to retrieve the next + // page. If this field is omitted, there are no subsequent pages. + string next_page_token = 2 [(google.api.field_behavior) = OPTIONAL]; +} diff --git a/java-iam/proto-google-iam-v3beta/src/main/proto/google/iam/v3beta/principal_access_boundary_policies_service.proto b/java-iam/proto-google-iam-v3beta/src/main/proto/google/iam/v3beta/principal_access_boundary_policies_service.proto new file mode 100644 index 0000000000..fd3817c338 --- /dev/null +++ b/java-iam/proto-google-iam-v3beta/src/main/proto/google/iam/v3beta/principal_access_boundary_policies_service.proto @@ -0,0 +1,292 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.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.iam.v3beta; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/iam/v3beta/operation_metadata.proto"; +import "google/iam/v3beta/policy_binding_resources.proto"; +import "google/iam/v3beta/principal_access_boundary_policy_resources.proto"; +import "google/longrunning/operations.proto"; +import "google/protobuf/empty.proto"; +import "google/protobuf/field_mask.proto"; + +option csharp_namespace = "Google.Cloud.Iam.V3Beta"; +option go_package = "cloud.google.com/go/iam/apiv3beta/iampb;iampb"; +option java_multiple_files = true; +option java_outer_classname = "PrincipalAccessBoundaryPoliciesServiceProto"; +option java_package = "com.google.iam.v3beta"; +option php_namespace = "Google\\Cloud\\Iam\\V3beta"; + +// Manages Identity and Access Management (IAM) principal access boundary +// policies. +service PrincipalAccessBoundaryPolicies { + option (google.api.default_host) = "iam.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform"; + + // Creates a principal access boundary policy, and returns a long running + // operation. + rpc CreatePrincipalAccessBoundaryPolicy( + CreatePrincipalAccessBoundaryPolicyRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v3beta/{parent=organizations/*/locations/*}/principalAccessBoundaryPolicies" + body: "principal_access_boundary_policy" + }; + option (google.api.method_signature) = + "parent,principal_access_boundary_policy,principal_access_boundary_policy_id"; + option (google.longrunning.operation_info) = { + response_type: "PrincipalAccessBoundaryPolicy" + metadata_type: "OperationMetadata" + }; + } + + // Gets a principal access boundary policy. + rpc GetPrincipalAccessBoundaryPolicy(GetPrincipalAccessBoundaryPolicyRequest) + returns (PrincipalAccessBoundaryPolicy) { + option (google.api.http) = { + get: "/v3beta/{name=organizations/*/locations/*/principalAccessBoundaryPolicies/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Updates a principal access boundary policy. + rpc UpdatePrincipalAccessBoundaryPolicy( + UpdatePrincipalAccessBoundaryPolicyRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + patch: "/v3beta/{principal_access_boundary_policy.name=organizations/*/locations/*/principalAccessBoundaryPolicies/*}" + body: "principal_access_boundary_policy" + }; + option (google.api.method_signature) = + "principal_access_boundary_policy,update_mask"; + option (google.longrunning.operation_info) = { + response_type: "PrincipalAccessBoundaryPolicy" + metadata_type: "OperationMetadata" + }; + } + + // Deletes a principal access boundary policy. + rpc DeletePrincipalAccessBoundaryPolicy( + DeletePrincipalAccessBoundaryPolicyRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + delete: "/v3beta/{name=organizations/*/locations/*/principalAccessBoundaryPolicies/*}" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "google.protobuf.Empty" + metadata_type: "OperationMetadata" + }; + } + + // Lists principal access boundary policies. + rpc ListPrincipalAccessBoundaryPolicies( + ListPrincipalAccessBoundaryPoliciesRequest) + returns (ListPrincipalAccessBoundaryPoliciesResponse) { + option (google.api.http) = { + get: "/v3beta/{parent=organizations/*/locations/*}/principalAccessBoundaryPolicies" + }; + option (google.api.method_signature) = "parent"; + } + + // Returns all policy bindings that bind a specific policy if a user has + // searchPolicyBindings permission on that policy. + rpc SearchPrincipalAccessBoundaryPolicyBindings( + SearchPrincipalAccessBoundaryPolicyBindingsRequest) + returns (SearchPrincipalAccessBoundaryPolicyBindingsResponse) { + option (google.api.http) = { + get: "/v3beta/{name=organizations/*/locations/*/principalAccessBoundaryPolicies/*}:searchPolicyBindings" + }; + option (google.api.method_signature) = "name"; + } +} + +// Request message for CreatePrincipalAccessBoundaryPolicyRequest method. +message CreatePrincipalAccessBoundaryPolicyRequest { + // Required. The parent resource where this principal access boundary policy + // will be created. Only organizations are supported. + // + // Format: + // `organizations/{organization_id}/locations/{location}` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "iam.googleapis.com/PrincipalAccessBoundaryPolicy" + } + ]; + + // Required. The ID to use for the principal access boundary policy, which + // will become the final component of the principal access boundary policy's + // resource name. + // + // This value must start with a lowercase letter followed by up to 62 + // lowercase letters, numbers, hyphens, or dots. Pattern, + // /[a-z][a-z0-9-\.]{2,62}/. + string principal_access_boundary_policy_id = 2 + [(google.api.field_behavior) = REQUIRED]; + + // Required. The principal access boundary policy to create. + PrincipalAccessBoundaryPolicy principal_access_boundary_policy = 3 + [(google.api.field_behavior) = REQUIRED]; + + // Optional. If set, validate the request and preview the creation, but do not + // actually post it. + bool validate_only = 4 [(google.api.field_behavior) = OPTIONAL]; +} + +// Request message for GetPrincipalAccessBoundaryPolicy method. +message GetPrincipalAccessBoundaryPolicyRequest { + // Required. The name of the principal access boundary policy to retrieve. + // + // Format: + // `organizations/{organization_id}/locations/{location}/principalAccessBoundaryPolicies/{principal_access_boundary_policy_id}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "iam.googleapis.com/PrincipalAccessBoundaryPolicy" + } + ]; +} + +// Request message for UpdatePrincipalAccessBoundaryPolicy method. +message UpdatePrincipalAccessBoundaryPolicyRequest { + // Required. The principal access boundary policy to update. + // + // The principal access boundary policy's `name` field is used to identify the + // policy to update. + PrincipalAccessBoundaryPolicy principal_access_boundary_policy = 1 + [(google.api.field_behavior) = REQUIRED]; + + // Optional. If set, validate the request and preview the update, but do not + // actually post it. + bool validate_only = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The list of fields to update + google.protobuf.FieldMask update_mask = 3 + [(google.api.field_behavior) = OPTIONAL]; +} + +// Request message for DeletePrincipalAccessBoundaryPolicy method. +message DeletePrincipalAccessBoundaryPolicyRequest { + // Required. The name of the principal access boundary policy to delete. + // + // Format: + // `organizations/{organization_id}/locations/{location}/principalAccessBoundaryPolicies/{principal_access_boundary_policy_id}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "iam.googleapis.com/PrincipalAccessBoundaryPolicy" + } + ]; + + // Optional. The etag of the principal access boundary policy. + // If this is provided, it must match the server's etag. + string etag = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If set, validate the request and preview the deletion, but do not + // actually post it. + bool validate_only = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If set to true, the request will force the deletion of the policy + // even if the policy is referenced in policy bindings. + bool force = 4 [(google.api.field_behavior) = OPTIONAL]; +} + +// Request message for ListPrincipalAccessBoundaryPolicies method. +message ListPrincipalAccessBoundaryPoliciesRequest { + // Required. The parent resource, which owns the collection of principal + // access boundary policies. + // + // Format: + // `organizations/{organization_id}/locations/{location}` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "iam.googleapis.com/PrincipalAccessBoundaryPolicy" + } + ]; + + // Optional. The maximum number of principal access boundary policies to + // return. The service may return fewer than this value. + // + // If unspecified, at most 50 principal access boundary policies will be + // returned. The maximum value is 1000; values above 1000 will be coerced to + // 1000. + int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A page token, received from a previous + // `ListPrincipalAccessBoundaryPolicies` call. Provide this to retrieve the + // subsequent page. + // + // When paginating, all other parameters provided to + // `ListPrincipalAccessBoundaryPolicies` must match the call that provided the + // page token. + string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +// Response message for ListPrincipalAccessBoundaryPolicies method. +message ListPrincipalAccessBoundaryPoliciesResponse { + // The principal access boundary policies from the specified parent. + repeated PrincipalAccessBoundaryPolicy principal_access_boundary_policies = 1; + + // Optional. A token, which can be sent as `page_token` to retrieve the next + // page. If this field is omitted, there are no subsequent pages. + string next_page_token = 2 [(google.api.field_behavior) = OPTIONAL]; +} + +// Request message for SearchPrincipalAccessBoundaryPolicyBindings rpc. +message SearchPrincipalAccessBoundaryPolicyBindingsRequest { + // Required. The name of the principal access boundary policy. + // Format: + // `organizations/{organization_id}/locations/{location}/principalAccessBoundaryPolicies/{principal_access_boundary_policy_id}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "iam.googleapis.com/PrincipalAccessBoundaryPolicy" + } + ]; + + // Optional. The maximum number of policy bindings to return. The service may + // return fewer than this value. + // + // If unspecified, at most 50 policy bindings will be returned. + // The maximum value is 1000; values above 1000 will be coerced to 1000. + int32 page_size = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A page token, received from a previous + // `SearchPrincipalAccessBoundaryPolicyBindingsRequest` call. Provide this to + // retrieve the subsequent page. + // + // When paginating, all other parameters provided to + // `SearchPrincipalAccessBoundaryPolicyBindingsRequest` must match the call + // that provided the page token. + string page_token = 4 [(google.api.field_behavior) = OPTIONAL]; +} + +// Response message for SearchPrincipalAccessBoundaryPolicyBindings rpc. +message SearchPrincipalAccessBoundaryPolicyBindingsResponse { + // The policy bindings that reference the specified policy. + repeated PolicyBinding policy_bindings = 1; + + // Optional. A token, which can be sent as `page_token` to retrieve the next + // page. If this field is omitted, there are no subsequent pages. + string next_page_token = 2 [(google.api.field_behavior) = OPTIONAL]; +} diff --git a/java-iam/proto-google-iam-v3beta/src/main/proto/google/iam/v3beta/principal_access_boundary_policy_resources.proto b/java-iam/proto-google-iam-v3beta/src/main/proto/google/iam/v3beta/principal_access_boundary_policy_resources.proto new file mode 100644 index 0000000000..738e0cc05c --- /dev/null +++ b/java-iam/proto-google-iam-v3beta/src/main/proto/google/iam/v3beta/principal_access_boundary_policy_resources.proto @@ -0,0 +1,128 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.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.iam.v3beta; + +import "google/api/field_behavior.proto"; +import "google/api/field_info.proto"; +import "google/api/resource.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.Iam.V3Beta"; +option go_package = "cloud.google.com/go/iam/apiv3beta/iampb;iampb"; +option java_multiple_files = true; +option java_outer_classname = "PrincipalAccessBoundaryPolicyResourcesProto"; +option java_package = "com.google.iam.v3beta"; +option php_namespace = "Google\\Cloud\\Iam\\V3beta"; + +// An IAM principal access boundary policy resource. +message PrincipalAccessBoundaryPolicy { + option (google.api.resource) = { + type: "iam.googleapis.com/PrincipalAccessBoundaryPolicy" + pattern: "organizations/{organization}/locations/{location}/principalAccessBoundaryPolicies/{principal_access_boundary_policy}" + plural: "principalAccessBoundaryPolicies" + singular: "principalAccessBoundaryPolicy" + }; + + // Identifier. The resource name of the principal access boundary policy. + // + // The following format is supported: + // `organizations/{organization_id}/locations/{location}/principalAccessBoundaryPolicies/{policy_id}` + string name = 1 [(google.api.field_behavior) = IDENTIFIER]; + + // Output only. The globally unique ID of the principal access boundary + // policy. + string uid = 2 [ + (google.api.field_info).format = UUID4, + (google.api.field_behavior) = OUTPUT_ONLY + ]; + + // Optional. The etag for the principal access boundary. + // If this is provided on update, it must match the server's etag. + string etag = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The description of the principal access boundary policy. Must be + // less than or equal to 63 characters. + string display_name = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. User defined annotations. See + // https://google.aip.dev/148#annotations for more details such as format and + // size limitations + map annotations = 5 [(google.api.field_behavior) = OPTIONAL]; + + // Output only. The time when the principal access boundary policy was + // created. + google.protobuf.Timestamp create_time = 6 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The time when the principal access boundary policy was most + // recently updated. + google.protobuf.Timestamp update_time = 7 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. The details for the principal access boundary policy. + PrincipalAccessBoundaryPolicyDetails details = 8 + [(google.api.field_behavior) = OPTIONAL]; +} + +// Principal access boundary policy details +message PrincipalAccessBoundaryPolicyDetails { + // Required. A list of principal access boundary policy rules. The number of + // rules in a policy is limited to 500. + repeated PrincipalAccessBoundaryPolicyRule rules = 1 + [(google.api.field_behavior) = REQUIRED]; + + // Optional. + // The version number (for example, `1` or `latest`) that indicates which + // permissions are able to be blocked by the policy. If empty, the PAB policy + // version will be set to the most recent version number at the time of the + // policy's creation. + string enforcement_version = 4 [(google.api.field_behavior) = OPTIONAL]; +} + +// Principal access boundary policy rule that defines the resource boundary. +message PrincipalAccessBoundaryPolicyRule { + // An effect to describe the access relationship. + enum Effect { + // Effect unspecified. + EFFECT_UNSPECIFIED = 0; + + // Allows access to the resources in this rule. + ALLOW = 1; + } + + // Optional. The description of the principal access boundary policy rule. + // Must be less than or equal to 256 characters. + string description = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Required. A list of Resource Manager resources. If a resource is listed in + // the rule, then the rule applies for that resource and its descendants. The + // number of resources in a policy is limited to 500 across all rules in the + // policy. + // + // The following resource types are supported: + // + // * Organizations, such as + // `//cloudresourcemanager.googleapis.com/organizations/123`. + // * Folders, such as `//cloudresourcemanager.googleapis.com/folders/123`. + // * Projects, such as `//cloudresourcemanager.googleapis.com/projects/123` + // or `//cloudresourcemanager.googleapis.com/projects/my-project-id`. + repeated string resources = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The access relationship of principals to the resources in this + // rule. + Effect effect = 3 [(google.api.field_behavior) = REQUIRED]; +} diff --git a/java-iam/renovate.json b/java-iam/renovate.json deleted file mode 100644 index c52f7a39b7..0000000000 --- a/java-iam/renovate.json +++ /dev/null @@ -1,75 +0,0 @@ -{ - "extends": [ - ":separateMajorReleases", - ":combinePatchMinorReleases", - ":ignoreUnstable", - ":prImmediately", - ":updateNotScheduled", - ":automergeDisabled", - ":ignoreModulesAndTests", - ":maintainLockFilesDisabled", - ":autodetectPinVersions" - ], - "ignorePaths": [".kokoro/requirements.txt"], - "packageRules": [ - { - "packagePatterns": [ - "^com.google.guava:" - ], - "versionScheme": "docker" - }, - { - "packagePatterns": [ - "*" - ], - "semanticCommitType": "deps", - "semanticCommitScope": null - }, - { - "packagePatterns": [ - "^org.apache.maven", - "^org.jacoco:", - "^org.codehaus.mojo:", - "^org.sonatype.plugins:", - "^com.coveo:", - "^com.google.cloud:google-cloud-shared-config" - ], - "semanticCommitType": "build", - "semanticCommitScope": "deps" - }, - { - "packagePatterns": [ - "^com.google.api.grpc:proto-google-iam-v1", - "^com.google.cloud:libraries-bom", - "^com.google.cloud.samples:shared-configuration" - ], - "semanticCommitType": "chore", - "semanticCommitScope": "deps" - }, - { - "packagePatterns": [ - "^junit:junit", - "^com.google.truth:truth", - "^org.mockito:mockito-core", - "^org.objenesis:objenesis", - "^com.google.cloud:google-cloud-conformance-tests" - ], - "semanticCommitType": "test", - "semanticCommitScope": "deps" - }, - { - "packagePatterns": [ - "^com.google.cloud:google-cloud-" - ], - "ignoreUnstable": false - }, - { - "packagePatterns": [ - "^com.fasterxml.jackson.core" - ], - "groupName": "jackson dependencies" - } - ], - "semanticCommits": true, - "dependencyDashboard": true -} diff --git a/java-iam/samples/cloud-client/snippets/pom.xml b/java-iam/samples/cloud-client/snippets/pom.xml deleted file mode 100644 index 6006735b60..0000000000 --- a/java-iam/samples/cloud-client/snippets/pom.xml +++ /dev/null @@ -1,98 +0,0 @@ - - - - iam-deny-samples - 4.0.0 - 1.0-SNAPSHOT - - - - - com.google.apis - google-api-services-cloudresourcemanager - v3-rev20221108-2.0.0 - - - com.google.auth - google-auth-library-oauth2-http - 1.14.0 - - - com.google.http-client - google-http-client-jackson2 - 1.42.3 - - - com.google.cloud - google-iam-policy - 1.6.22 - compile - - - com.google.apis - google-api-services-iamcredentials - v1-rev20211203-2.0.0 - - - - - truth - com.google.truth - test - 1.1.3 - - - junit - junit - test - 4.13.2 - - - - - - - - libraries-bom - com.google.cloud - import - pom - 26.2.0 - - - - - - - shared-configuration - com.google.cloud.samples - 1.2.0 - - - - 11 - 11 - - - gce-diregapic - - diff --git a/java-iam/samples/cloud-client/snippets/src/main/java/CreateDenyPolicy.java b/java-iam/samples/cloud-client/snippets/src/main/java/CreateDenyPolicy.java deleted file mode 100644 index d9ea32daa5..0000000000 --- a/java-iam/samples/cloud-client/snippets/src/main/java/CreateDenyPolicy.java +++ /dev/null @@ -1,164 +0,0 @@ -/* - * 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. - */ - -// [START iam_create_deny_policy] - -import com.google.iam.v2.CreatePolicyRequest; -import com.google.iam.v2.DenyRule; -import com.google.iam.v2.PoliciesClient; -import com.google.iam.v2.Policy; -import com.google.iam.v2.PolicyRule; -import com.google.longrunning.Operation; -import com.google.type.Expr; -import java.io.IOException; -import java.net.URLEncoder; -import java.nio.charset.StandardCharsets; -import java.util.concurrent.ExecutionException; -import java.util.concurrent.TimeUnit; -import java.util.concurrent.TimeoutException; - -public class CreateDenyPolicy { - - public static void main(String[] args) - throws IOException, ExecutionException, InterruptedException, TimeoutException { - // TODO(developer): Replace these variables before running the sample. - // ID or number of the Google Cloud project you want to use. - String projectId = "your-google-cloud-project-id"; - - // Specify the id of the Deny policy you want to create. - String policyId = "deny-policy-id"; - - createDenyPolicy(projectId, policyId); - } - - // Create a deny policy. - // You can add deny policies to organizations, folders, and projects. - // Each of these resources can have up to 5 deny policies. - // - // Deny policies contain deny rules, which specify the following: - // 1. The permissions to deny and/or exempt. - // 2. The principals that are denied, or exempted from denial. - // 3. An optional condition on when to enforce the deny rules. - public static void createDenyPolicy(String projectId, String policyId) - throws IOException, ExecutionException, InterruptedException, TimeoutException { - - try (PoliciesClient policiesClient = PoliciesClient.create()) { - // Each deny policy is attached to an organization, folder, or project. - // To work with deny policies, specify the attachment point. - // - // Its format can be one of the following: - // 1. cloudresourcemanager.googleapis.com/organizations/ORG_ID - // 2. cloudresourcemanager.googleapis.com/folders/FOLDER_ID - // 3. cloudresourcemanager.googleapis.com/projects/PROJECT_ID - // - // The attachment point is identified by its URL-encoded resource name. - String urlEncodedResource = - URLEncoder.encode( - "cloudresourcemanager.googleapis.com/projects/", StandardCharsets.UTF_8); - String attachmentPoint = String.format("%s%s", urlEncodedResource, projectId); - - // Construct the full path of the resource to which the policy is attached. - // Its format is: "policies/{attachmentPoint}/denypolicies/{policyId}" - String policyParent = String.format("policies/%s/denypolicies", attachmentPoint); - - DenyRule denyRule = - DenyRule.newBuilder() - // Add one or more principals who should be denied the permissions specified in this - // rule. - // For more information on allowed values, see: - // https://cloud.google.com/iam/docs/principal-identifiers - .addDeniedPrincipals("principalSet://goog/public:all") - - // Optionally, set the principals who should be exempted from the - // list of denied principals. For example, if you want to deny certain permissions - // to a group but exempt a few principals, then add those here. - // .addExceptionPrincipals( - // "principalSet://goog/group/project-admins@example.com") - - // Set the permissions to deny. - // The permission value is of the format: service_fqdn/resource.action - // For the list of supported permissions, see: - // https://cloud.google.com/iam/help/deny/supported-permissions - .addDeniedPermissions("cloudresourcemanager.googleapis.com/projects.delete") - - // Optionally, add the permissions to be exempted from this rule. - // Meaning, the deny rule will not be applicable to these permissions. - // .addExceptionPermissions("cloudresourcemanager.googleapis.com/projects.create") - - // Set the condition which will enforce the deny rule. If this condition is true, - // the deny rule will be applicable. Else, the rule will not be enforced. - .setDenialCondition( - Expr.newBuilder() - // The expression uses Common Expression Language syntax (CEL). - // Here we block access based on tags. - // - // A tag is a key-value pair that can be attached to an organization, folder, - // or project. You can use deny policies to deny permissions based on tags - // without adding an IAM Condition to every role grant. - // For example, imagine that you tag all of your projects as dev, test, or - // prod. You want only members of project-admins@example.com to be able to - // perform operations on projects that are tagged prod. - // To solve this problem, you create a deny rule that denies the - // cloudresourcemanager.googleapis.com/projects.delete permission to everyone - // except project-admins@example.com for resources that are tagged test. - .setExpression("!resource.matchTag('12345678/env', 'test')") - .setTitle("Only for test projects") - .build()) - .build(); - - // Add the deny rule and a description for it. - Policy policy = - Policy.newBuilder() - // Set the deny rule. - .addRules( - PolicyRule.newBuilder() - // Set a description for the rule. - .setDescription( - "block all principals from deleting projects, unless the principal is a member of project-admins@example.com and the project being deleted has a tag with the value test") - .setDenyRule(denyRule) - .build()) - .build(); - - // Set the policy resource path, policy rules and a unique ID for the policy. - CreatePolicyRequest createPolicyRequest = - CreatePolicyRequest.newBuilder() - .setParent(policyParent) - .setPolicy(policy) - .setPolicyId(policyId) - .build(); - - // Build the create policy request. - Operation operation = - policiesClient - .createPolicyCallable() - .futureCall(createPolicyRequest) - .get(3, TimeUnit.MINUTES); - - // Wait for the operation to complete. - if (!operation.getDone() || operation.hasError()) { - System.out.println("Error in creating the policy " + operation.getError()); - return; - } - - // Retrieve the policy name. - Policy response = policiesClient.getPolicy(String.format("%s/%s", policyParent, policyId)); - String policyName = response.getName(); - System.out.println( - "Created the deny policy: " + policyName.substring(policyName.lastIndexOf("/") + 1)); - } - } -} -// [END iam_create_deny_policy] diff --git a/java-iam/samples/cloud-client/snippets/src/main/java/DeleteDenyPolicy.java b/java-iam/samples/cloud-client/snippets/src/main/java/DeleteDenyPolicy.java deleted file mode 100644 index ef0b9d4907..0000000000 --- a/java-iam/samples/cloud-client/snippets/src/main/java/DeleteDenyPolicy.java +++ /dev/null @@ -1,87 +0,0 @@ -/* - * 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. - */ - -// [START iam_delete_deny_policy] - -import com.google.iam.v2.DeletePolicyRequest; -import com.google.iam.v2.PoliciesClient; -import com.google.longrunning.Operation; -import java.io.IOException; -import java.net.URLEncoder; -import java.nio.charset.StandardCharsets; -import java.util.concurrent.ExecutionException; -import java.util.concurrent.TimeUnit; -import java.util.concurrent.TimeoutException; - -public class DeleteDenyPolicy { - - public static void main(String[] args) - throws IOException, InterruptedException, ExecutionException, TimeoutException { - // TODO(developer): Replace these variables before running the sample. - - // ID or number of the Google Cloud project you want to use. - String projectId = "your-google-cloud-project-id"; - - // Specify the ID of the deny policy you want to retrieve. - String policyId = "deny-policy-id"; - - deleteDenyPolicy(projectId, policyId); - } - - // Delete the policy if you no longer want to enforce the rules in a deny policy. - public static void deleteDenyPolicy(String projectId, String policyId) - throws IOException, InterruptedException, ExecutionException, TimeoutException { - try (PoliciesClient policiesClient = PoliciesClient.create()) { - - // Each deny policy is attached to an organization, folder, or project. - // To work with deny policies, specify the attachment point. - // - // Its format can be one of the following: - // 1. cloudresourcemanager.googleapis.com/organizations/ORG_ID - // 2. cloudresourcemanager.googleapis.com/folders/FOLDER_ID - // 3. cloudresourcemanager.googleapis.com/projects/PROJECT_ID - // - // The attachment point is identified by its URL-encoded resource name. - String urlEncodedResource = - URLEncoder.encode( - "cloudresourcemanager.googleapis.com/projects/", StandardCharsets.UTF_8); - String attachmentPoint = String.format("%s%s", urlEncodedResource, projectId); - - // Construct the full path of the resource to which the policy is attached. - // Its format is: "policies/{attachmentPoint}/denypolicies/{policyId}" - String policyParent = String.format("policies/%s/denypolicies/%s", attachmentPoint, policyId); - - // Create the DeletePolicy request. - DeletePolicyRequest deletePolicyRequest = - DeletePolicyRequest.newBuilder().setName(policyParent).build(); - - // Delete the policy and wait for the operation to complete. - Operation operation = - policiesClient - .deletePolicyCallable() - .futureCall(deletePolicyRequest) - .get(3, TimeUnit.MINUTES); - - if (!operation.getDone() || operation.hasError()) { - System.out.println("Error in deleting the policy " + operation.getError()); - return; - } - - System.out.println("Deleted the deny policy: " + policyId); - } - } -} -// [END iam_delete_deny_policy] diff --git a/java-iam/samples/cloud-client/snippets/src/main/java/GetDenyPolicy.java b/java-iam/samples/cloud-client/snippets/src/main/java/GetDenyPolicy.java deleted file mode 100644 index 0cf4e96c8a..0000000000 --- a/java-iam/samples/cloud-client/snippets/src/main/java/GetDenyPolicy.java +++ /dev/null @@ -1,72 +0,0 @@ -/* - * 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. - */ - -// [START iam_get_deny_policy] - -import com.google.iam.v2.GetPolicyRequest; -import com.google.iam.v2.PoliciesClient; -import com.google.iam.v2.Policy; -import java.io.IOException; -import java.net.URLEncoder; -import java.nio.charset.StandardCharsets; - -public class GetDenyPolicy { - - public static void main(String[] args) throws IOException { - // TODO(developer): Replace these variables before running the sample. - - // ID or number of the Google Cloud project you want to use. - String projectId = "your-google-cloud-project-id"; - - // Specify the ID of the deny policy you want to retrieve. - String policyId = "deny-policy-id"; - - getDenyPolicy(projectId, policyId); - } - - // Retrieve the deny policy given the project ID and policy ID. - public static void getDenyPolicy(String projectId, String policyId) throws IOException { - // Create the IAM Policies client. - try (PoliciesClient policiesClient = PoliciesClient.create()) { - - // Each deny policy is attached to an organization, folder, or project. - // To work with deny policies, specify the attachment point. - // - // Its format can be one of the following: - // 1. cloudresourcemanager.googleapis.com/organizations/ORG_ID - // 2. cloudresourcemanager.googleapis.com/folders/FOLDER_ID - // 3. cloudresourcemanager.googleapis.com/projects/PROJECT_ID - // - // The attachment point is identified by its URL-encoded resource name. - String urlEncodedResource = - URLEncoder.encode( - "cloudresourcemanager.googleapis.com/projects/", StandardCharsets.UTF_8); - String attachmentPoint = String.format("%s%s", urlEncodedResource, projectId); - - // Construct the full path of the resource to which the policy is attached. - // Its format is: "policies/{attachmentPoint}/denypolicies/{policyId}" - String policyParent = String.format("policies/%s/denypolicies/%s", attachmentPoint, policyId); - - // Specify the policyParent and execute the GetPolicy request. - GetPolicyRequest getPolicyRequest = - GetPolicyRequest.newBuilder().setName(policyParent).build(); - - Policy policy = policiesClient.getPolicy(getPolicyRequest); - System.out.printf("Retrieved the deny policy: %s : %s%n", policyId, policy); - } - } -} -// [END iam_get_deny_policy] diff --git a/java-iam/samples/cloud-client/snippets/src/main/java/ListDenyPolicies.java b/java-iam/samples/cloud-client/snippets/src/main/java/ListDenyPolicies.java deleted file mode 100644 index 566a5946df..0000000000 --- a/java-iam/samples/cloud-client/snippets/src/main/java/ListDenyPolicies.java +++ /dev/null @@ -1,67 +0,0 @@ -/* - * 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. - */ - -// [START iam_list_deny_policy] - -import com.google.iam.v2.PoliciesClient; -import com.google.iam.v2.Policy; -import java.io.IOException; -import java.net.URLEncoder; -import java.nio.charset.StandardCharsets; - -public class ListDenyPolicies { - - public static void main(String[] args) throws IOException { - // TODO(developer): Replace these variables before running the sample. - // ID or number of the Google Cloud project you want to use. - String projectId = "your-google-cloud-project-id"; - - listDenyPolicies(projectId); - } - - // List all the deny policies that are attached to a resource. - // A resource can have up to 5 deny policies. - public static void listDenyPolicies(String projectId) throws IOException { - // Initialize the Policies client. - try (PoliciesClient policiesClient = PoliciesClient.create()) { - - // Each deny policy is attached to an organization, folder, or project. - // To work with deny policies, specify the attachment point. - // - // Its format can be one of the following: - // 1. cloudresourcemanager.googleapis.com/organizations/ORG_ID - // 2. cloudresourcemanager.googleapis.com/folders/FOLDER_ID - // 3. cloudresourcemanager.googleapis.com/projects/PROJECT_ID - // - // The attachment point is identified by its URL-encoded resource name. - String urlEncodedResource = - URLEncoder.encode( - "cloudresourcemanager.googleapis.com/projects/", StandardCharsets.UTF_8); - String attachmentPoint = String.format("%s%s", urlEncodedResource, projectId); - - // Construct the full path of the resource to which the policy is attached. - // Its format is: "policies/{attachmentPoint}/denypolicies" - String policyParent = String.format("policies/%s/denypolicies", attachmentPoint); - - // Create a list request and iterate over the returned policies. - for (Policy policy : policiesClient.listPolicies(policyParent).iterateAll()) { - System.out.println(policy.getName()); - } - System.out.println("Listed all deny policies"); - } - } -} -// [END iam_list_deny_policy] diff --git a/java-iam/samples/cloud-client/snippets/src/main/java/UpdateDenyPolicy.java b/java-iam/samples/cloud-client/snippets/src/main/java/UpdateDenyPolicy.java deleted file mode 100644 index 28e6bb91a7..0000000000 --- a/java-iam/samples/cloud-client/snippets/src/main/java/UpdateDenyPolicy.java +++ /dev/null @@ -1,158 +0,0 @@ -/* - * 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. - */ - -// [START iam_update_deny_policy] - -import com.google.iam.v2.DenyRule; -import com.google.iam.v2.PoliciesClient; -import com.google.iam.v2.Policy; -import com.google.iam.v2.PolicyRule; -import com.google.iam.v2.UpdatePolicyRequest; -import com.google.longrunning.Operation; -import com.google.type.Expr; -import java.io.IOException; -import java.net.URLEncoder; -import java.nio.charset.StandardCharsets; -import java.util.concurrent.ExecutionException; -import java.util.concurrent.TimeUnit; -import java.util.concurrent.TimeoutException; - -public class UpdateDenyPolicy { - - public static void main(String[] args) - throws IOException, ExecutionException, InterruptedException, TimeoutException { - // TODO(developer): Replace these variables before running the sample. - - // ID or number of the Google Cloud project you want to use. - String projectId = "your-google-cloud-project-id"; - - // Specify the ID of the Deny policy you want to retrieve. - String policyId = "deny-policy-id"; - - // Etag field that identifies the policy version. The etag changes each time - // you update the policy. Get the etag of an existing policy by performing a GetPolicy request. - String etag = "policy_etag"; - - updateDenyPolicy(projectId, policyId, etag); - } - - // Update the deny rules and/ or its display name after policy creation. - public static void updateDenyPolicy(String projectId, String policyId, String etag) - throws IOException, ExecutionException, InterruptedException, TimeoutException { - - try (PoliciesClient policiesClient = PoliciesClient.create()) { - - // Each deny policy is attached to an organization, folder, or project. - // To work with deny policies, specify the attachment point. - // - // Its format can be one of the following: - // 1. cloudresourcemanager.googleapis.com/organizations/ORG_ID - // 2. cloudresourcemanager.googleapis.com/folders/FOLDER_ID - // 3. cloudresourcemanager.googleapis.com/projects/PROJECT_ID - // - // The attachment point is identified by its URL-encoded resource name. - String urlEncodedResource = - URLEncoder.encode( - "cloudresourcemanager.googleapis.com/projects/", StandardCharsets.UTF_8); - String attachmentPoint = String.format("%s%s", urlEncodedResource, projectId); - - // Construct the full path of the resource to which the policy is attached to. - // Its format is: "policies/{attachmentPoint}/denypolicies/{policyId}" - String policyParent = String.format("policies/%s/denypolicies/%s", attachmentPoint, policyId); - - DenyRule denyRule = - DenyRule.newBuilder() - // Add one or more principals who should be denied the permissions specified in this - // rule. - // For more information on allowed values, see: - // https://cloud.google.com/iam/docs/principal-identifiers - .addDeniedPrincipals("principalSet://goog/public:all") - - // Optionally, set the principals who should be exempted from the list of principals - // added in "DeniedPrincipals". - // Example, if you want to deny certain permissions to a group but exempt a few - // principals, then add those here. - // .addExceptionPrincipals( - // "principalSet://goog/group/project-admins@example.com") - - // Set the permissions to deny. - // The permission value is of the format: service_fqdn/resource.action - // For the list of supported permissions, see: - // https://cloud.google.com/iam/help/deny/supported-permissions - .addDeniedPermissions("cloudresourcemanager.googleapis.com/projects.delete") - - // Add the permissions to be exempted from this rule. - // Meaning, the deny rule will not be applicable to these permissions. - // .addExceptionPermissions("cloudresourcemanager.googleapis.com/projects.get") - - // Set the condition which will enforce the deny rule. - // If this condition is true, the deny rule will be applicable. Else, the rule will - // not be enforced. - .setDenialCondition( - Expr.newBuilder() - // The expression uses Common Expression Language syntax (CEL). Here we block - // access based on tags. - // - // A tag is a key-value pair that can be attached to an organization, folder, - // or project. You can use deny policies to deny permissions based on tags - // without adding an IAM Condition to every role grant. - // For example, imagine that you tag all of your projects as dev, test, or - // prod. You want only members of project-admins@example.com to be able to - // perform operations on projects that are tagged prod. - // To solve this problem, you create a deny rule that denies the - // cloudresourcemanager.googleapis.com/projects.delete permission to everyone - // except project-admins@example.com for resources that are tagged prod. - .setExpression("!resource.matchTag('12345678/env', 'prod')") - .setTitle("Only for prod projects") - .build()) - .build(); - - // Set the policy resource path, version (etag) and the updated deny rules. - Policy policy = - Policy.newBuilder() - .setName(policyParent) - .setEtag(etag) - .addRules( - PolicyRule.newBuilder() - // Set the rule description to update. - .setDescription( - "Block all principals from deleting projects, unless the principal is a member of project-admins@example.com and the project being deleted has a tag with the value prod") - // Set the deny rule to update. - .setDenyRule(denyRule) - .build()) - .build(); - - // Create the update policy request. - UpdatePolicyRequest updatePolicyRequest = - UpdatePolicyRequest.newBuilder().setPolicy(policy).build(); - - // Wait for the operation to complete. - Operation operation = - policiesClient - .updatePolicyCallable() - .futureCall(updatePolicyRequest) - .get(3, TimeUnit.MINUTES); - - if (!operation.getDone() || operation.hasError()) { - System.out.println("Error in updating the policy " + operation.getError()); - return; - } - - System.out.println("Updated the deny policy: " + policyId); - } - } -} -// [END iam_update_deny_policy] diff --git a/java-iam/samples/cloud-client/snippets/src/test/java/DenyIT.java b/java-iam/samples/cloud-client/snippets/src/test/java/DenyIT.java deleted file mode 100644 index 76db0dbcd7..0000000000 --- a/java-iam/samples/cloud-client/snippets/src/test/java/DenyIT.java +++ /dev/null @@ -1,130 +0,0 @@ -/* - * 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. - */ - -import static com.google.common.truth.Truth.assertThat; -import static com.google.common.truth.Truth.assertWithMessage; - -import com.google.iam.v2.PoliciesClient; -import com.google.iam.v2.Policy; -import java.io.ByteArrayOutputStream; -import java.io.IOException; -import java.io.PrintStream; -import java.util.UUID; -import java.util.concurrent.ExecutionException; -import java.util.concurrent.TimeoutException; -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; - -@RunWith(JUnit4.class) -public class DenyIT { - - private static final String PROJECT_ID = System.getenv("GOOGLE_CLOUD_PROJECT"); - private static final String GOOGLE_APPLICATION_CREDENTIALS = - System.getenv("GOOGLE_APPLICATION_CREDENTIALS"); - private static String POLICY_ID; - - private ByteArrayOutputStream stdOut; - - // Check if the required environment variables are set. - public static void requireEnvVar(String envVarName) { - assertWithMessage(String.format("Missing environment variable '%s' ", envVarName)) - .that(System.getenv(envVarName)) - .isNotEmpty(); - } - - @BeforeClass - public static void setUp() - throws IOException, InterruptedException, ExecutionException, TimeoutException { - final PrintStream out = System.out; - ByteArrayOutputStream stdOut = new ByteArrayOutputStream(); - System.setOut(new PrintStream(stdOut)); - requireEnvVar("GOOGLE_APPLICATION_CREDENTIALS"); - requireEnvVar("GOOGLE_CLOUD_PROJECT"); - - POLICY_ID = "limit-project-deletion" + UUID.randomUUID(); - - CreateDenyPolicy.createDenyPolicy(PROJECT_ID, POLICY_ID); - assertThat(stdOut.toString()).contains(String.format("Created the deny policy: %s", POLICY_ID)); - - stdOut.close(); - System.setOut(out); - } - - @AfterClass - public static void cleanup() - throws IOException, InterruptedException, ExecutionException, TimeoutException { - final PrintStream out = System.out; - ByteArrayOutputStream stdOut = new ByteArrayOutputStream(); - System.setOut(new PrintStream(stdOut)); - - DeleteDenyPolicy.deleteDenyPolicy(PROJECT_ID, POLICY_ID); - assertThat(stdOut.toString()).contains(String.format("Deleted the deny policy: %s", POLICY_ID)); - - stdOut.close(); - System.setOut(out); - } - - @Before - public void beforeEach() { - stdOut = new ByteArrayOutputStream(); - System.setOut(new PrintStream(stdOut)); - } - - @After - public void afterEach() { - stdOut = null; - System.setOut(null); - } - - @Test - public void testListDenyPolicies() throws IOException { - ListDenyPolicies.listDenyPolicies(PROJECT_ID); - assertThat(stdOut.toString()).contains("Listed all deny policies"); - } - - @Test - public void testGetDenyPolicy() throws IOException { - GetDenyPolicy.getDenyPolicy(PROJECT_ID, POLICY_ID); - assertThat(stdOut.toString()) - .contains(String.format("Retrieved the deny policy: %s", POLICY_ID)); - assertThat(stdOut.toString()).contains(POLICY_ID); - } - - @Test - public void testUpdateDenyPolicy() - throws IOException, ExecutionException, InterruptedException, TimeoutException { - - try (PoliciesClient policiesClient = PoliciesClient.create()) { - // Get the etag from the Deny policy. - String attachmentPoint = - String.format("cloudresourcemanager.googleapis.com/projects/%s", PROJECT_ID) - .replaceAll("/", "%2F"); - String policyParent = - String.format("policies/%s/denypolicies/%s", attachmentPoint, POLICY_ID); - Policy policy = policiesClient.getPolicy(policyParent); - - // Test policy update. - UpdateDenyPolicy.updateDenyPolicy(PROJECT_ID, POLICY_ID, policy.getEtag()); - assertThat(stdOut.toString()) - .contains(String.format("Updated the deny policy: %s", POLICY_ID)); - } - } -} diff --git a/java-iam/synth.metadata b/java-iam/synth.metadata deleted file mode 100644 index 884257a9aa..0000000000 --- a/java-iam/synth.metadata +++ /dev/null @@ -1,125 +0,0 @@ -{ - "sources": [ - { - "git": { - "name": ".", - "remote": "https://github.com/googleapis/java-iam.git", - "sha": "0bde6b4db52bf09a4f1f0fbbb7519b82a4e7eb39" - } - }, - { - "git": { - "name": "googleapis", - "remote": "https://github.com/googleapis/googleapis.git", - "sha": "2921f9fb3bfbd16f6b2da0104373e2b47a80a65e", - "internalRef": "408420890" - } - }, - { - "git": { - "name": "synthtool", - "remote": "https://github.com/googleapis/synthtool.git", - "sha": "7a7c48f96e90d1cdc3ab0cc8293279fdcb10fd36" - } - } - ], - "generatedFiles": [ - ".github/CODEOWNERS", - ".github/ISSUE_TEMPLATE/bug_report.md", - ".github/ISSUE_TEMPLATE/feature_request.md", - ".github/ISSUE_TEMPLATE/support_request.md", - ".github/PULL_REQUEST_TEMPLATE.md", - ".github/blunderbuss.yml", - ".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", - ".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/graalvm-native.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", - "CONTRIBUTING.md", - "LICENSE", - "SECURITY.md", - "codecov.yaml", - "grpc-google-iam-v1/src/main/java/com/google/iam/v1/IAMPolicyGrpc.java", - "java.header", - "license-checks.xml", - "proto-google-iam-v1/src/main/java/com/google/iam/v1/AuditConfigDelta.java", - "proto-google-iam-v1/src/main/java/com/google/iam/v1/AuditConfigDeltaOrBuilder.java", - "proto-google-iam-v1/src/main/java/com/google/iam/v1/Binding.java", - "proto-google-iam-v1/src/main/java/com/google/iam/v1/BindingDelta.java", - "proto-google-iam-v1/src/main/java/com/google/iam/v1/BindingDeltaOrBuilder.java", - "proto-google-iam-v1/src/main/java/com/google/iam/v1/BindingOrBuilder.java", - "proto-google-iam-v1/src/main/java/com/google/iam/v1/GetIamPolicyRequest.java", - "proto-google-iam-v1/src/main/java/com/google/iam/v1/GetIamPolicyRequestOrBuilder.java", - "proto-google-iam-v1/src/main/java/com/google/iam/v1/GetPolicyOptions.java", - "proto-google-iam-v1/src/main/java/com/google/iam/v1/GetPolicyOptionsOrBuilder.java", - "proto-google-iam-v1/src/main/java/com/google/iam/v1/IamPolicyProto.java", - "proto-google-iam-v1/src/main/java/com/google/iam/v1/OptionsProto.java", - "proto-google-iam-v1/src/main/java/com/google/iam/v1/Policy.java", - "proto-google-iam-v1/src/main/java/com/google/iam/v1/PolicyDelta.java", - "proto-google-iam-v1/src/main/java/com/google/iam/v1/PolicyDeltaOrBuilder.java", - "proto-google-iam-v1/src/main/java/com/google/iam/v1/PolicyOrBuilder.java", - "proto-google-iam-v1/src/main/java/com/google/iam/v1/PolicyProto.java", - "proto-google-iam-v1/src/main/java/com/google/iam/v1/SetIamPolicyRequest.java", - "proto-google-iam-v1/src/main/java/com/google/iam/v1/SetIamPolicyRequestOrBuilder.java", - "proto-google-iam-v1/src/main/java/com/google/iam/v1/TestIamPermissionsRequest.java", - "proto-google-iam-v1/src/main/java/com/google/iam/v1/TestIamPermissionsRequestOrBuilder.java", - "proto-google-iam-v1/src/main/java/com/google/iam/v1/TestIamPermissionsResponse.java", - "proto-google-iam-v1/src/main/java/com/google/iam/v1/TestIamPermissionsResponseOrBuilder.java", - "proto-google-iam-v1/src/main/java/com/google/iam/v1/logging/AuditData.java", - "proto-google-iam-v1/src/main/java/com/google/iam/v1/logging/AuditDataOrBuilder.java", - "proto-google-iam-v1/src/main/java/com/google/iam/v1/logging/AuditDataProto.java", - "renovate.json" - ] -} \ No newline at end of file diff --git a/java-shared-dependencies/CHANGELOG.md b/java-shared-dependencies/CHANGELOG.md new file mode 100644 index 0000000000..f9737573f6 --- /dev/null +++ b/java-shared-dependencies/CHANGELOG.md @@ -0,0 +1,1105 @@ +# Changelog + + +## [3.1.2](https://github.com/googleapis/java-shared-dependencies/compare/v3.1.1...v3.1.2) (2023-01-20) + + +### Bug Fixes + +* **java:** Skip fixing poms for special modules ([#1744](https://github.com/googleapis/java-shared-dependencies/issues/1744)) ([#971](https://github.com/googleapis/java-shared-dependencies/issues/971)) ([74a96f1](https://github.com/googleapis/java-shared-dependencies/commit/74a96f1155418bde285877b72b4d7e600d08beb6)) + + +### Dependencies + +* Update dependency com.google.api:gapic-generator-java-bom to v2.14.0 ([#972](https://github.com/googleapis/java-shared-dependencies/issues/972)) ([2c742b5](https://github.com/googleapis/java-shared-dependencies/commit/2c742b56afc441f4922e6f6c737d3c3374ceadec)) +* Update dependency com.google.cloud:google-cloud-core-bom to v2.9.3 ([#974](https://github.com/googleapis/java-shared-dependencies/issues/974)) ([e4cb2ae](https://github.com/googleapis/java-shared-dependencies/commit/e4cb2ae34648c61ac40b7c9628e4ec088186fd57)) +* Update google.core.version to v2.9.2 ([#969](https://github.com/googleapis/java-shared-dependencies/issues/969)) ([aa946a6](https://github.com/googleapis/java-shared-dependencies/commit/aa946a6e33a5c8c3d6ae37bb07c3872c0bab793b)) +* Update google.core.version to v2.9.4 ([#976](https://github.com/googleapis/java-shared-dependencies/issues/976)) ([718246c](https://github.com/googleapis/java-shared-dependencies/commit/718246c985488b138eb0113b5a3200d3eb2af31d)) + +## [3.1.1](https://github.com/googleapis/java-shared-dependencies/compare/v3.1.0...v3.1.1) (2023-01-09) + + +### Dependencies + +* Adding `gapic-generator-java-bom` to `first-party-dependencies` ([#957](https://github.com/googleapis/java-shared-dependencies/issues/957)) ([f051e6e](https://github.com/googleapis/java-shared-dependencies/commit/f051e6ee0ad4a705014d9d2f8211ddad464b3ca4)) +* Update dependency com.google.api-client:google-api-client-bom to v2.1.2 ([#956](https://github.com/googleapis/java-shared-dependencies/issues/956)) ([dbfde36](https://github.com/googleapis/java-shared-dependencies/commit/dbfde36f5b0806192ea99d45382c84cff518f500)) +* Update dependency com.google.api:api-common to v2.3.1 ([#947](https://github.com/googleapis/java-shared-dependencies/issues/947)) ([f35c3bf](https://github.com/googleapis/java-shared-dependencies/commit/f35c3bf518e8b488ddeb28a6ff86719b24a62df5)) +* Update dependency com.google.auth:google-auth-library-bom to v1.14.0 ([#950](https://github.com/googleapis/java-shared-dependencies/issues/950)) ([e5609ca](https://github.com/googleapis/java-shared-dependencies/commit/e5609ca23657e1c37825c6d8930da1fb5080b8a6)) +* Update dependency com.google.code.gson:gson to v2.10.1 ([#958](https://github.com/googleapis/java-shared-dependencies/issues/958)) ([bd35327](https://github.com/googleapis/java-shared-dependencies/commit/bd353274c16d01915923a6fa34796d0b78672fb0)) +* Update dependency com.google.errorprone:error_prone_annotations to v2.17.0 ([#955](https://github.com/googleapis/java-shared-dependencies/issues/955)) ([b656786](https://github.com/googleapis/java-shared-dependencies/commit/b6567863e659ff3eb6cc7b4b42a42acc7ebd24ed)) +* Update dependency com.google.errorprone:error_prone_annotations to v2.18.0 ([#961](https://github.com/googleapis/java-shared-dependencies/issues/961)) ([0c4ff89](https://github.com/googleapis/java-shared-dependencies/commit/0c4ff895e103164dc0c95bc9789f9a3dc6c2f1a4)) +* Update dependency com.google.protobuf:protobuf-bom to v3.21.12 ([#948](https://github.com/googleapis/java-shared-dependencies/issues/948)) ([812ce38](https://github.com/googleapis/java-shared-dependencies/commit/812ce38e95de4db15184f9dd38bbd4c2affa2133)) +* Update dependency io.grpc:grpc-bom to v1.51.1 ([#953](https://github.com/googleapis/java-shared-dependencies/issues/953)) ([a86e70a](https://github.com/googleapis/java-shared-dependencies/commit/a86e70ac7be07cdb3b69d0cf4fc1afedbf7048fd)) +* Update dependency org.checkerframework:checker-qual to v3.29.0 ([#959](https://github.com/googleapis/java-shared-dependencies/issues/959)) ([784a79b](https://github.com/googleapis/java-shared-dependencies/commit/784a79b49b109d18858fd603dbdd37a4947280af)) +* Update dependency org.threeten:threetenbp to v1.6.5 ([#946](https://github.com/googleapis/java-shared-dependencies/issues/946)) ([403555e](https://github.com/googleapis/java-shared-dependencies/commit/403555e4010aef84e909e0b0e48cf5571d9e3184)) +* Update google.core.version to v2.9.1 ([#962](https://github.com/googleapis/java-shared-dependencies/issues/962)) ([c1e648d](https://github.com/googleapis/java-shared-dependencies/commit/c1e648d5045f871ed5670f949978430ad2d49484)) +* Update iam.version to v1.6.23 ([#954](https://github.com/googleapis/java-shared-dependencies/issues/954)) ([bb4730e](https://github.com/googleapis/java-shared-dependencies/commit/bb4730e7dcac57b6653825d63c7408d2182b0a27)) + +## [3.1.0](https://github.com/googleapis/java-shared-dependencies/compare/v3.0.6...v3.1.0) (2022-12-05) + + +### Features + +* Next release from main branch is 3.1.0 ([#910](https://github.com/googleapis/java-shared-dependencies/issues/910)) ([3e36bc6](https://github.com/googleapis/java-shared-dependencies/commit/3e36bc6c5a6ffff771480200ecf5908cb347a50a)) + + +### Dependencies + +* Update dependency com.fasterxml.jackson:jackson-bom to v2.14.1 ([#924](https://github.com/googleapis/java-shared-dependencies/issues/924)) ([c630375](https://github.com/googleapis/java-shared-dependencies/commit/c630375d5059b4ac367979a2507c3870840c08e4)) +* Update dependency com.google.api-client:google-api-client-bom to v2.1.0 ([#934](https://github.com/googleapis/java-shared-dependencies/issues/934)) ([8af7b00](https://github.com/googleapis/java-shared-dependencies/commit/8af7b00cf0758df4015b1999d6f824ba1864be00)) +* Update dependency com.google.api-client:google-api-client-bom to v2.1.1 ([#941](https://github.com/googleapis/java-shared-dependencies/issues/941)) ([6a6e3e7](https://github.com/googleapis/java-shared-dependencies/commit/6a6e3e7d3232c7d74f92849a98e607a6d22b7b4e)) +* Update dependency com.google.auth:google-auth-library-bom to v1.13.0 ([#917](https://github.com/googleapis/java-shared-dependencies/issues/917)) ([1e2448c](https://github.com/googleapis/java-shared-dependencies/commit/1e2448c60cbe3e215b4f9f772d8e0c7cb1434bd0)) +* Update dependency com.google.cloud:grpc-gcp to v1.3.2 ([#942](https://github.com/googleapis/java-shared-dependencies/issues/942)) ([66c3e2a](https://github.com/googleapis/java-shared-dependencies/commit/66c3e2acda213fe9aea60b85f8543e3fdeaa2ecf)) +* Update dependency com.google.cloud.tools:dependencies to v1.5.13 ([#914](https://github.com/googleapis/java-shared-dependencies/issues/914)) ([9c0fa2c](https://github.com/googleapis/java-shared-dependencies/commit/9c0fa2c06ed04a3dddd9f0fd908865279393d373)) +* Update dependency com.google.protobuf:protobuf-bom to v3.21.10 ([#936](https://github.com/googleapis/java-shared-dependencies/issues/936)) ([f8abca8](https://github.com/googleapis/java-shared-dependencies/commit/f8abca8e075c59461c88b8c79fd1c5cd5eacb509)) +* Update dependency io.grpc:grpc-bom to v1.51.0 ([#919](https://github.com/googleapis/java-shared-dependencies/issues/919)) ([713b331](https://github.com/googleapis/java-shared-dependencies/commit/713b331a39917725ed4bd95c80c083c23d2a192e)) +* Update dependency io.perfmark:perfmark-api to v0.26.0 ([#907](https://github.com/googleapis/java-shared-dependencies/issues/907)) ([950cca6](https://github.com/googleapis/java-shared-dependencies/commit/950cca6df2d7e7d24ab8dd7e32c7a264e89d721f)) +* Update dependency org.apache.httpcomponents:httpclient to v4.5.14 ([#943](https://github.com/googleapis/java-shared-dependencies/issues/943)) ([7590b65](https://github.com/googleapis/java-shared-dependencies/commit/7590b6538290d3f9892b2b302505d3ecfca69530)) +* Update dependency org.apache.httpcomponents:httpcore to v4.4.16 ([#933](https://github.com/googleapis/java-shared-dependencies/issues/933)) ([6a68eb9](https://github.com/googleapis/java-shared-dependencies/commit/6a68eb96179a13cf324b4a4026ff6877d447a334)) +* Update dependency org.checkerframework:checker-qual to v3.28.0 ([#940](https://github.com/googleapis/java-shared-dependencies/issues/940)) ([5ea57c3](https://github.com/googleapis/java-shared-dependencies/commit/5ea57c3f5490c3cf7048e71dfab63aba8d7b874f)) +* Update gax.version to v2.20.1 ([#937](https://github.com/googleapis/java-shared-dependencies/issues/937)) ([ca30914](https://github.com/googleapis/java-shared-dependencies/commit/ca30914b59516c634de24b1fa33c8a6c454a0cef)) +* Update google.common-protos.version to v2.11.0 ([#935](https://github.com/googleapis/java-shared-dependencies/issues/935)) ([e92f583](https://github.com/googleapis/java-shared-dependencies/commit/e92f58361c0062414c34b669161f9d6284b0903f)) +* Update google.core.version to v2.8.28 ([#909](https://github.com/googleapis/java-shared-dependencies/issues/909)) ([79a731e](https://github.com/googleapis/java-shared-dependencies/commit/79a731e057fa7b1ac5f4bc6ae15869726bc9c20a)) +* Update google.core.version to v2.9.0 ([#944](https://github.com/googleapis/java-shared-dependencies/issues/944)) ([a50513b](https://github.com/googleapis/java-shared-dependencies/commit/a50513bc8902d059a7b53dc852b02b7e2f9bc3e6)) +* Update iam.version to v1.6.10 ([#915](https://github.com/googleapis/java-shared-dependencies/issues/915)) ([2c06312](https://github.com/googleapis/java-shared-dependencies/commit/2c06312732a56fd94f0ce8447062b42b3da15c92)) +* Update iam.version to v1.6.11 ([#916](https://github.com/googleapis/java-shared-dependencies/issues/916)) ([10b152d](https://github.com/googleapis/java-shared-dependencies/commit/10b152ded8ceded5ae3c60774ea8e75c7b69d9d8)) +* Update iam.version to v1.6.12 ([#918](https://github.com/googleapis/java-shared-dependencies/issues/918)) ([db57153](https://github.com/googleapis/java-shared-dependencies/commit/db57153752380dacb773530aef8079ff68772fc9)) +* Update iam.version to v1.6.13 ([#920](https://github.com/googleapis/java-shared-dependencies/issues/920)) ([763197e](https://github.com/googleapis/java-shared-dependencies/commit/763197e94a34620a2e234885fcdbdcb5fba144c2)) +* Update iam.version to v1.6.14 ([#921](https://github.com/googleapis/java-shared-dependencies/issues/921)) ([036cf6f](https://github.com/googleapis/java-shared-dependencies/commit/036cf6f0df788e9bffd5e21bfd8e560a797ed37d)) +* Update iam.version to v1.6.15 ([#922](https://github.com/googleapis/java-shared-dependencies/issues/922)) ([98b11a7](https://github.com/googleapis/java-shared-dependencies/commit/98b11a72f3818e4505d468c47b7c8105a3b55847)) +* Update iam.version to v1.6.16 ([#923](https://github.com/googleapis/java-shared-dependencies/issues/923)) ([b44d6ba](https://github.com/googleapis/java-shared-dependencies/commit/b44d6babd71d89ed27a0d7cac229d04111bb39e7)) +* Update iam.version to v1.6.17 ([#925](https://github.com/googleapis/java-shared-dependencies/issues/925)) ([f24a7f8](https://github.com/googleapis/java-shared-dependencies/commit/f24a7f8577ca90153d86b9ed3eab5954c1fc5500)) +* Update iam.version to v1.6.18 ([#926](https://github.com/googleapis/java-shared-dependencies/issues/926)) ([c77314d](https://github.com/googleapis/java-shared-dependencies/commit/c77314d5bdfbe960e6f71fb8dc044a60d1973038)) +* Update iam.version to v1.6.19 ([#927](https://github.com/googleapis/java-shared-dependencies/issues/927)) ([2990cf0](https://github.com/googleapis/java-shared-dependencies/commit/2990cf020e526ddba54c2a0542ef8e01f4f517f5)) +* Update iam.version to v1.6.20 ([#928](https://github.com/googleapis/java-shared-dependencies/issues/928)) ([7dbd204](https://github.com/googleapis/java-shared-dependencies/commit/7dbd204cdc0df7107c656e28766afeb14f6793c4)) +* Update iam.version to v1.6.21 ([#929](https://github.com/googleapis/java-shared-dependencies/issues/929)) ([cec2265](https://github.com/googleapis/java-shared-dependencies/commit/cec2265e43eaac7cc1be3c9bb42c0d93872f4075)) +* Update iam.version to v1.6.22 ([#931](https://github.com/googleapis/java-shared-dependencies/issues/931)) ([812ccf4](https://github.com/googleapis/java-shared-dependencies/commit/812ccf46fb0ada475dea2f6eb53839be8940dbde)) +* Update iam.version to v1.6.8 ([#906](https://github.com/googleapis/java-shared-dependencies/issues/906)) ([68ebe06](https://github.com/googleapis/java-shared-dependencies/commit/68ebe06101ec5b24fddb48012e3487c37827ba6a)) +* Update iam.version to v1.6.9 ([#912](https://github.com/googleapis/java-shared-dependencies/issues/912)) ([6a3097b](https://github.com/googleapis/java-shared-dependencies/commit/6a3097b559319f643f63727bd6d4ce5d30091317)) + +## [3.0.6](https://github.com/googleapis/java-shared-dependencies/compare/v3.0.5...v3.0.6) (2022-11-07) + + +### Dependencies + +* Update dependency com.fasterxml.jackson:jackson-bom to v2.14.0 ([#901](https://github.com/googleapis/java-shared-dependencies/issues/901)) ([33c5511](https://github.com/googleapis/java-shared-dependencies/commit/33c55112ff485da1d7a0a32d8b6dade33aa04ff8)) +* Update dependency com.google.api-client:google-api-client-bom to v2.0.1 ([#899](https://github.com/googleapis/java-shared-dependencies/issues/899)) ([4029e89](https://github.com/googleapis/java-shared-dependencies/commit/4029e89be507ddfa030515565fdb6fbf8997324e)) +* Update dependency com.google.api:api-common to v2.2.2 ([#892](https://github.com/googleapis/java-shared-dependencies/issues/892)) ([5c59fbd](https://github.com/googleapis/java-shared-dependencies/commit/5c59fbd3c3cf3efbfda50420c8048e3ff257084c)) +* Update dependency com.google.cloud:grpc-gcp to v1.3.1 ([#884](https://github.com/googleapis/java-shared-dependencies/issues/884)) ([9fffe24](https://github.com/googleapis/java-shared-dependencies/commit/9fffe243b631565a00b0a848a6c73163b1dd33a4)) +* Update dependency com.google.code.gson:gson to v2.10 ([#887](https://github.com/googleapis/java-shared-dependencies/issues/887)) ([15017de](https://github.com/googleapis/java-shared-dependencies/commit/15017de39a35f90bc1b38b828edc23fdce524a07)) +* Update dependency com.google.http-client:google-http-client-bom to v1.42.3 ([#893](https://github.com/googleapis/java-shared-dependencies/issues/893)) ([4c0de9b](https://github.com/googleapis/java-shared-dependencies/commit/4c0de9bd188bfab5fe126c8b01b4d7168f8a5079)) +* Update dependency com.google.protobuf:protobuf-bom to v3.21.9 ([#889](https://github.com/googleapis/java-shared-dependencies/issues/889)) ([8576271](https://github.com/googleapis/java-shared-dependencies/commit/85762716d1bbb97c447f86451094fb8af2528470)) +* Update dependency io.grpc:grpc-bom to v1.50.2 ([#878](https://github.com/googleapis/java-shared-dependencies/issues/878)) ([fd569af](https://github.com/googleapis/java-shared-dependencies/commit/fd569af1e5f1b195e2421fc9e02d8b67afe1c638)) +* Update dependency org.checkerframework:checker-qual to v3.27.0 ([#896](https://github.com/googleapis/java-shared-dependencies/issues/896)) ([f0f7931](https://github.com/googleapis/java-shared-dependencies/commit/f0f7931937a0ed9a32fd87cd58c82b787d368242)) +* Update dependency org.threeten:threetenbp to v1.6.4 ([#894](https://github.com/googleapis/java-shared-dependencies/issues/894)) ([899682d](https://github.com/googleapis/java-shared-dependencies/commit/899682d0405645d9d5288b298af2fda228414669)) +* Update gax.version to v2.19.5 ([#903](https://github.com/googleapis/java-shared-dependencies/issues/903)) ([3e4d8b3](https://github.com/googleapis/java-shared-dependencies/commit/3e4d8b35d3f682b07326ffa0a3e552d097f25a65)) +* Update google.common-protos.version to v2.10.0 ([#900](https://github.com/googleapis/java-shared-dependencies/issues/900)) ([53b54c3](https://github.com/googleapis/java-shared-dependencies/commit/53b54c35f3a7c19df488921a6077e7a9bfb0b103)) +* Update google.core.version to v2.8.23 ([#885](https://github.com/googleapis/java-shared-dependencies/issues/885)) ([686dd7c](https://github.com/googleapis/java-shared-dependencies/commit/686dd7c8f541189302e8cac4ae72ed7d967b5b3f)) +* Update google.core.version to v2.8.24 ([#890](https://github.com/googleapis/java-shared-dependencies/issues/890)) ([1effda3](https://github.com/googleapis/java-shared-dependencies/commit/1effda381c7b886f5ae4d2dac9473da821e655fe)) +* Update google.core.version to v2.8.27 ([#902](https://github.com/googleapis/java-shared-dependencies/issues/902)) ([3bcb804](https://github.com/googleapis/java-shared-dependencies/commit/3bcb804dec4358ed0a9c6c35cf4c35f817821e9a)) +* Update iam.version to v1.6.6 ([#886](https://github.com/googleapis/java-shared-dependencies/issues/886)) ([03d0690](https://github.com/googleapis/java-shared-dependencies/commit/03d0690f01f9217e31dd65d55c28a47f2f2deb22)) +* Update iam.version to v1.6.7 ([#895](https://github.com/googleapis/java-shared-dependencies/issues/895)) ([6cebc20](https://github.com/googleapis/java-shared-dependencies/commit/6cebc205daa98b96a8b27b3fc3cd222319b27e59)) + +## [3.0.5](https://github.com/googleapis/java-shared-dependencies/compare/v3.0.4...v3.0.5) (2022-10-20) + + +### Dependencies + +* Update dependency com.fasterxml.jackson:jackson-bom to v2.13.4.20221013 ([#868](https://github.com/googleapis/java-shared-dependencies/issues/868)) ([ffa7272](https://github.com/googleapis/java-shared-dependencies/commit/ffa7272e6d4775905e64173b3617555ee355019d)) +* Update dependency com.google.auth:google-auth-library-bom to v1.12.0 ([#870](https://github.com/googleapis/java-shared-dependencies/issues/870)) ([6e76f19](https://github.com/googleapis/java-shared-dependencies/commit/6e76f19133515b755b78185ce0135943e878a368)) +* Update dependency com.google.auth:google-auth-library-bom to v1.12.1 ([#871](https://github.com/googleapis/java-shared-dependencies/issues/871)) ([f7f5dc2](https://github.com/googleapis/java-shared-dependencies/commit/f7f5dc26dd54f33954bdf5d43314020de58e055b)) +* Update dependency com.google.cloud:grpc-gcp to v1.3.0 ([#867](https://github.com/googleapis/java-shared-dependencies/issues/867)) ([1927a92](https://github.com/googleapis/java-shared-dependencies/commit/1927a926c615eabbf0e7377c65232e0e5268220e)) +* Update dependency com.google.errorprone:error_prone_annotations to v2.16 ([#865](https://github.com/googleapis/java-shared-dependencies/issues/865)) ([b1734ec](https://github.com/googleapis/java-shared-dependencies/commit/b1734ec1c20e7bdf2582b31fde4648aa9f8de2fe)) +* Update dependency com.google.protobuf:protobuf-bom to v3.21.8 ([#872](https://github.com/googleapis/java-shared-dependencies/issues/872)) ([1c303f2](https://github.com/googleapis/java-shared-dependencies/commit/1c303f2aa5145da4c93605a2d1088e8a3884de81)) +* Update dependency gcp-releasetool to v1.8.10 ([#853](https://github.com/googleapis/java-shared-dependencies/issues/853)) ([c815a59](https://github.com/googleapis/java-shared-dependencies/commit/c815a5996d28676de015d5dd41e2b0405f4bb9dc)) +* Update dependency google-api-core to v2.10.2 ([#858](https://github.com/googleapis/java-shared-dependencies/issues/858)) ([387a156](https://github.com/googleapis/java-shared-dependencies/commit/387a15662db0b20e72fe5bf961c02eb2bc4e75d9)) +* Update dependency io.grpc:grpc-bom to v1.50.0 ([#866](https://github.com/googleapis/java-shared-dependencies/issues/866)) ([3d3d443](https://github.com/googleapis/java-shared-dependencies/commit/3d3d4434636e605f47082641e8e495bbce8f9515)) +* Update dependency io.grpc:grpc-bom to v1.50.1 ([#873](https://github.com/googleapis/java-shared-dependencies/issues/873)) ([956309d](https://github.com/googleapis/java-shared-dependencies/commit/956309d76c9de46885711a77afbfce0d28971096)) +* Update dependency org.checkerframework:checker-qual to v3.26.0 ([#852](https://github.com/googleapis/java-shared-dependencies/issues/852)) ([6926b33](https://github.com/googleapis/java-shared-dependencies/commit/6926b33b83d1aa63e0c78b7b8c72cd1d80e28ef3)) +* Update dependency org.threeten:threetenbp to v1.6.3 ([#869](https://github.com/googleapis/java-shared-dependencies/issues/869)) ([fa4999b](https://github.com/googleapis/java-shared-dependencies/commit/fa4999b6310940e62456e83dad3ec76a7406a218)) +* Update dependency typing-extensions to v4.4.0 ([#854](https://github.com/googleapis/java-shared-dependencies/issues/854)) ([43bd31b](https://github.com/googleapis/java-shared-dependencies/commit/43bd31b66eef50d82ecf8a692053f10eb385d5c1)) +* Update dependency zipp to v3.9.0 ([#859](https://github.com/googleapis/java-shared-dependencies/issues/859)) ([a070ad0](https://github.com/googleapis/java-shared-dependencies/commit/a070ad04ef1bab5690487ba13dd4060827851edf)) +* Update gax.version to v2.19.4 ([#875](https://github.com/googleapis/java-shared-dependencies/issues/875)) ([227bdd8](https://github.com/googleapis/java-shared-dependencies/commit/227bdd86f368b89309814c615828544c29871a5d)) +* Update google.core.version to v2.8.21 ([#861](https://github.com/googleapis/java-shared-dependencies/issues/861)) ([8b502bd](https://github.com/googleapis/java-shared-dependencies/commit/8b502bd43760a2e52cf107567011d9c5132e74bd)) +* Update google.core.version to v2.8.22 ([#879](https://github.com/googleapis/java-shared-dependencies/issues/879)) ([0360e93](https://github.com/googleapis/java-shared-dependencies/commit/0360e931dc45034d3c3c554f2c29ad7ea4a0a9bb)) +* Update iam.version to v1.6.3 ([#857](https://github.com/googleapis/java-shared-dependencies/issues/857)) ([b39e683](https://github.com/googleapis/java-shared-dependencies/commit/b39e6838c3f3f6ef2b350efe8aec1b622893421a)) +* Update iam.version to v1.6.4 ([#862](https://github.com/googleapis/java-shared-dependencies/issues/862)) ([85c9794](https://github.com/googleapis/java-shared-dependencies/commit/85c979401c34454b2d5681eed9d8b3b3679413be)) + +## [3.0.4](https://github.com/googleapis/java-shared-dependencies/compare/v3.0.3...v3.0.4) (2022-10-03) + + +### Dependencies + +* Update dependency cachetools to v5 ([#816](https://github.com/googleapis/java-shared-dependencies/issues/816)) ([3f6c408](https://github.com/googleapis/java-shared-dependencies/commit/3f6c408210c931c286235f61c7aadea5bf5cfe4d)) +* Update dependency certifi to v2022.9.24 ([#818](https://github.com/googleapis/java-shared-dependencies/issues/818)) ([5f04b97](https://github.com/googleapis/java-shared-dependencies/commit/5f04b97c2343146600e8c9ee65afdeb58f5743a6)) +* Update dependency charset-normalizer to v2.1.1 ([#822](https://github.com/googleapis/java-shared-dependencies/issues/822)) ([6997c5a](https://github.com/googleapis/java-shared-dependencies/commit/6997c5acad937ebe3594330de73261a424d42cf3)) +* Update dependency click to v8.1.3 ([#823](https://github.com/googleapis/java-shared-dependencies/issues/823)) ([42bf9f8](https://github.com/googleapis/java-shared-dependencies/commit/42bf9f834fdafea60f2be7ccbf7d363e058cd7c2)) +* Update dependency com.google.protobuf:protobuf-bom to v3.21.7 ([#837](https://github.com/googleapis/java-shared-dependencies/issues/837)) ([d31e507](https://github.com/googleapis/java-shared-dependencies/commit/d31e5077c7e036de5e238e9a611df7ced527574a)) +* Update dependency gcp-releasetool to v1.8.8 ([#819](https://github.com/googleapis/java-shared-dependencies/issues/819)) ([8245d97](https://github.com/googleapis/java-shared-dependencies/commit/8245d975fb12e81454ec7664f9a7c9809bbac697)) +* Update dependency gcp-releasetool to v1.8.9 ([#846](https://github.com/googleapis/java-shared-dependencies/issues/846)) ([04e3283](https://github.com/googleapis/java-shared-dependencies/commit/04e32831c6e87c372444901013a747d2d02ce38d)) +* Update dependency google-api-core to v2.10.1 ([#824](https://github.com/googleapis/java-shared-dependencies/issues/824)) ([818b9aa](https://github.com/googleapis/java-shared-dependencies/commit/818b9aa2ac99d8b1f9b39a74b626122aed5f1d94)) +* Update dependency google-auth to v2.12.0 ([#825](https://github.com/googleapis/java-shared-dependencies/issues/825)) ([07c544b](https://github.com/googleapis/java-shared-dependencies/commit/07c544b5e0fa9f7110bbc957570f7a405962072e)) +* Update dependency google-cloud-core to v2.3.2 ([#820](https://github.com/googleapis/java-shared-dependencies/issues/820)) ([2a219e8](https://github.com/googleapis/java-shared-dependencies/commit/2a219e86f187ba5ad72f2570bd58ca6100128c43)) +* Update dependency google-cloud-storage to v2.5.0 ([#826](https://github.com/googleapis/java-shared-dependencies/issues/826)) ([bb10d18](https://github.com/googleapis/java-shared-dependencies/commit/bb10d1858a515f09d365362ffa0110a5b362c96b)) +* Update dependency google-crc32c to v1.5.0 ([#827](https://github.com/googleapis/java-shared-dependencies/issues/827)) ([7e5dae6](https://github.com/googleapis/java-shared-dependencies/commit/7e5dae60d667cb84b9ee4f6c977bdc35e79e4cf6)) +* Update dependency google-resumable-media to v2.4.0 ([#838](https://github.com/googleapis/java-shared-dependencies/issues/838)) ([ad82d63](https://github.com/googleapis/java-shared-dependencies/commit/ad82d6378f64039da383509638fb4782908eb4bc)) +* Update dependency googleapis-common-protos to v1.56.4 ([#821](https://github.com/googleapis/java-shared-dependencies/issues/821)) ([93d7745](https://github.com/googleapis/java-shared-dependencies/commit/93d77458c9bbf84ec367cdb4caaa41e6f71675c6)) +* Update dependency importlib-metadata to v4.12.0 ([#832](https://github.com/googleapis/java-shared-dependencies/issues/832)) ([ee19fb1](https://github.com/googleapis/java-shared-dependencies/commit/ee19fb1ca5a2a2e1985297e3b72d44de68bc72e3)) +* Update dependency importlib-metadata to v4.13.0 ([#843](https://github.com/googleapis/java-shared-dependencies/issues/843)) ([d2ede60](https://github.com/googleapis/java-shared-dependencies/commit/d2ede601eee8c875780c7eb5924623537480c509)) +* Update dependency importlib-metadata to v5 ([#845](https://github.com/googleapis/java-shared-dependencies/issues/845)) ([03ac7e8](https://github.com/googleapis/java-shared-dependencies/commit/03ac7e800274c5f58d2bc4ddd0561bfcdea1bb27)) +* Update dependency io.grpc:grpc-bom to v1.49.1 ([#802](https://github.com/googleapis/java-shared-dependencies/issues/802)) ([b8c54bf](https://github.com/googleapis/java-shared-dependencies/commit/b8c54bf8f1ddecc788cee151f8afe42de45bdc9d)) +* Update dependency io.grpc:grpc-bom to v1.49.2 ([#842](https://github.com/googleapis/java-shared-dependencies/issues/842)) ([1b1cfa2](https://github.com/googleapis/java-shared-dependencies/commit/1b1cfa27d05f7732da12721305cf41dcbebda232)) +* Update dependency jeepney to v0.8.0 ([#833](https://github.com/googleapis/java-shared-dependencies/issues/833)) ([15d2f9f](https://github.com/googleapis/java-shared-dependencies/commit/15d2f9f52b5a3259db0813df3d2424e256ccb372)) +* Update dependency jinja2 to v3.1.2 ([#834](https://github.com/googleapis/java-shared-dependencies/issues/834)) ([c188f95](https://github.com/googleapis/java-shared-dependencies/commit/c188f95acdb3349f1c4b3ed56e5fffb75e8fbc8d)) +* Update dependency keyring to v23.9.3 ([#828](https://github.com/googleapis/java-shared-dependencies/issues/828)) ([b185aaa](https://github.com/googleapis/java-shared-dependencies/commit/b185aaae716d4d97cb64f0426cac0e778f11223d)) +* Update dependency markupsafe to v2.1.1 ([#829](https://github.com/googleapis/java-shared-dependencies/issues/829)) ([add2825](https://github.com/googleapis/java-shared-dependencies/commit/add2825bd34cd80f529dbe0dadb3c84219177916)) +* Update dependency org.threeten:threetenbp to v1.6.2 ([#808](https://github.com/googleapis/java-shared-dependencies/issues/808)) ([2d2eabd](https://github.com/googleapis/java-shared-dependencies/commit/2d2eabd14d8150207885ea47280c0f7ff3d2962f)) +* Update dependency protobuf to v3.20.2 ([#830](https://github.com/googleapis/java-shared-dependencies/issues/830)) ([5afa76f](https://github.com/googleapis/java-shared-dependencies/commit/5afa76f9ef4705aecba49abc7bb93982fb1ecf3e)) +* Update dependency protobuf to v3.20.3 ([#839](https://github.com/googleapis/java-shared-dependencies/issues/839)) ([d9fc7dd](https://github.com/googleapis/java-shared-dependencies/commit/d9fc7ddd3e663458e6ea3f78a3c6241377df0319)) +* Update dependency protobuf to v4 ([#817](https://github.com/googleapis/java-shared-dependencies/issues/817)) ([ee8d154](https://github.com/googleapis/java-shared-dependencies/commit/ee8d154287ccd256b4dcfa48f28f5ec61a91fe3e)) +* Update dependency pyjwt to v2.5.0 ([#812](https://github.com/googleapis/java-shared-dependencies/issues/812)) ([4d4528e](https://github.com/googleapis/java-shared-dependencies/commit/4d4528e8ce269d49b99d2dbc4fcda2dc37a058cb)) +* Update dependency requests to v2.28.1 ([#813](https://github.com/googleapis/java-shared-dependencies/issues/813)) ([a3a8d89](https://github.com/googleapis/java-shared-dependencies/commit/a3a8d89b0117007a7108553c70aa82dd289e1691)) +* Update dependency typing-extensions to v4.3.0 ([#814](https://github.com/googleapis/java-shared-dependencies/issues/814)) ([da875e5](https://github.com/googleapis/java-shared-dependencies/commit/da875e5e91fa9d8c177e6c3afc9e34242eb914b7)) +* Update dependency zipp to v3.8.1 ([#815](https://github.com/googleapis/java-shared-dependencies/issues/815)) ([15585fd](https://github.com/googleapis/java-shared-dependencies/commit/15585fd0216013fe93be011f93f391f6269aa777)) +* Update gax.version to v2.19.2 ([#847](https://github.com/googleapis/java-shared-dependencies/issues/847)) ([c4afe1f](https://github.com/googleapis/java-shared-dependencies/commit/c4afe1fdc88af29ab039cea618d52c15c90e43e9)) +* Update google.common-protos.version to v2.9.3 ([#803](https://github.com/googleapis/java-shared-dependencies/issues/803)) ([a3e8e5e](https://github.com/googleapis/java-shared-dependencies/commit/a3e8e5eb53a8da14abf3b8d81a4f34fbb2f3b8f9)) +* Update google.common-protos.version to v2.9.5 ([#831](https://github.com/googleapis/java-shared-dependencies/issues/831)) ([1c901db](https://github.com/googleapis/java-shared-dependencies/commit/1c901db8a7740afaec3e809e51d4d369fbf469c4)) +* Update google.common-protos.version to v2.9.6 ([#844](https://github.com/googleapis/java-shared-dependencies/issues/844)) ([9e156be](https://github.com/googleapis/java-shared-dependencies/commit/9e156be59bd89959f04252c3045b8cd7a8be8070)) +* Update google.core.version to v2.8.13 ([#804](https://github.com/googleapis/java-shared-dependencies/issues/804)) ([45ae571](https://github.com/googleapis/java-shared-dependencies/commit/45ae57142bd6d5334eedd46243736b200a459795)) +* Update google.core.version to v2.8.14 ([#805](https://github.com/googleapis/java-shared-dependencies/issues/805)) ([02c9397](https://github.com/googleapis/java-shared-dependencies/commit/02c9397a84bf3fcca8d04e4c9867cc47689abde2)) +* Update google.core.version to v2.8.15 ([#807](https://github.com/googleapis/java-shared-dependencies/issues/807)) ([980856c](https://github.com/googleapis/java-shared-dependencies/commit/980856c43981992a3d08f69eac83aeada752d244)) +* Update google.core.version to v2.8.16 ([#810](https://github.com/googleapis/java-shared-dependencies/issues/810)) ([c2b2c9a](https://github.com/googleapis/java-shared-dependencies/commit/c2b2c9a327fd588f69524bb93a17e5d4ae8f5a42)) +* Update google.core.version to v2.8.17 ([#835](https://github.com/googleapis/java-shared-dependencies/issues/835)) ([3def21d](https://github.com/googleapis/java-shared-dependencies/commit/3def21df2e4253e3df0da064b6c4e472df079d2b)) +* Update google.core.version to v2.8.18 ([#840](https://github.com/googleapis/java-shared-dependencies/issues/840)) ([46566dc](https://github.com/googleapis/java-shared-dependencies/commit/46566dc18c4b1ed41c482b4ce21b92651e2f9dc5)) +* Update google.core.version to v2.8.19 ([#841](https://github.com/googleapis/java-shared-dependencies/issues/841)) ([99afde9](https://github.com/googleapis/java-shared-dependencies/commit/99afde97ea498f549eb75cc58c4ed88edf81b20d)) +* Update google.core.version to v2.8.20 ([#848](https://github.com/googleapis/java-shared-dependencies/issues/848)) ([c980c4f](https://github.com/googleapis/java-shared-dependencies/commit/c980c4fdfc8890d812b4881ba5b87bfd21269a5f)) +* Update iam.version to v1.6.1 ([#806](https://github.com/googleapis/java-shared-dependencies/issues/806)) ([a50158d](https://github.com/googleapis/java-shared-dependencies/commit/a50158d3b83cf8e02d8ee08c94e512b5669a927b)) +* Update iam.version to v1.6.2 ([#849](https://github.com/googleapis/java-shared-dependencies/issues/849)) ([e43ac96](https://github.com/googleapis/java-shared-dependencies/commit/e43ac96bc189a096a9311c9b03e85c86bea07e99)) + +## [3.0.3](https://github.com/googleapis/java-shared-dependencies/compare/v3.0.2...v3.0.3) (2022-09-14) + + +### Dependencies + +* Google-cloud-core 2.8.12 ([#799](https://github.com/googleapis/java-shared-dependencies/issues/799)) ([1b3db8d](https://github.com/googleapis/java-shared-dependencies/commit/1b3db8d1e17c49ebae79fc96164fa9058e1df6e3)) +* Moving gson to first-party-dependencies ([#800](https://github.com/googleapis/java-shared-dependencies/issues/800)) ([a41fcc1](https://github.com/googleapis/java-shared-dependencies/commit/a41fcc11d32e02e5af2837561792e3919f6d4b3f)) +* Update dependency com.google.protobuf:protobuf-bom to v3.21.6 ([#797](https://github.com/googleapis/java-shared-dependencies/issues/797)) ([bc5fdc9](https://github.com/googleapis/java-shared-dependencies/commit/bc5fdc9b3af7973c28f063a9ac156fe2af562814)) +* Update gax.version to v2.19.1 ([#798](https://github.com/googleapis/java-shared-dependencies/issues/798)) ([84e5487](https://github.com/googleapis/java-shared-dependencies/commit/84e5487b2e3dce4bb60badecebde788c3cb702b8)) +* Update google.core.version to v2.8.11 ([#793](https://github.com/googleapis/java-shared-dependencies/issues/793)) ([63c1297](https://github.com/googleapis/java-shared-dependencies/commit/63c129722aa0b821031ff5b4c11004adf7b12044)) + +## [3.0.2](https://github.com/googleapis/java-shared-dependencies/compare/v3.0.1...v3.0.2) (2022-09-08) + + +### Dependencies + +* Update dependency com.fasterxml.jackson:jackson-bom to v2.13.4 ([#789](https://github.com/googleapis/java-shared-dependencies/issues/789)) ([6cf91a9](https://github.com/googleapis/java-shared-dependencies/commit/6cf91a96b9ea6af0fb845b50582dac7aa2892cab)) +* Update dependency com.google.auth:google-auth-library-bom to v1.10.0 ([#781](https://github.com/googleapis/java-shared-dependencies/issues/781)) ([8859e61](https://github.com/googleapis/java-shared-dependencies/commit/8859e61808bfc5cd9546e27e945fc855b36d2554)) +* Update dependency com.google.auth:google-auth-library-bom to v1.11.0 ([#790](https://github.com/googleapis/java-shared-dependencies/issues/790)) ([3431a47](https://github.com/googleapis/java-shared-dependencies/commit/3431a471cbf874a67a4f1a42e31f0ed891dedc92)) +* Update dependency com.google.auth:google-auth-library-bom to v1.9.0 ([#773](https://github.com/googleapis/java-shared-dependencies/issues/773)) ([27fc79f](https://github.com/googleapis/java-shared-dependencies/commit/27fc79f00ee70011df6a368bb8fcfad7f0ce41f0)) +* Update dependency com.google.errorprone:error_prone_annotations to v2.15.0 ([#776](https://github.com/googleapis/java-shared-dependencies/issues/776)) ([bf333b8](https://github.com/googleapis/java-shared-dependencies/commit/bf333b8c88072d21cb959db4d3328bbb55d9ef5c)) +* Update dependency com.google.protobuf:protobuf-bom to v3.21.5 ([#780](https://github.com/googleapis/java-shared-dependencies/issues/780)) ([da7f44d](https://github.com/googleapis/java-shared-dependencies/commit/da7f44d71d6d7f372b5313dab68ce220308614d4)) +* Update dependency io.grpc:grpc-bom to v1.48.1 ([#768](https://github.com/googleapis/java-shared-dependencies/issues/768)) ([5c7768d](https://github.com/googleapis/java-shared-dependencies/commit/5c7768d3c9665dd356de6c39c0a6a5fa6e992f2e)) +* Update dependency io.grpc:grpc-bom to v1.49.0 ([#786](https://github.com/googleapis/java-shared-dependencies/issues/786)) ([8734812](https://github.com/googleapis/java-shared-dependencies/commit/8734812f1b4e2faaa48caf41eff59a85892ae344)) +* Update dependency org.checkerframework:checker-qual to v3.24.0 ([#775](https://github.com/googleapis/java-shared-dependencies/issues/775)) ([df74b7b](https://github.com/googleapis/java-shared-dependencies/commit/df74b7b0dd5dd592523f302d9fb36adb5991cb0b)) +* Update dependency org.checkerframework:checker-qual to v3.25.0 ([#788](https://github.com/googleapis/java-shared-dependencies/issues/788)) ([207035b](https://github.com/googleapis/java-shared-dependencies/commit/207035bd04c9305899eea540acbefaf06a7b1ec9)) +* Update dependency org.threeten:threetenbp to v1.6.1 ([#782](https://github.com/googleapis/java-shared-dependencies/issues/782)) ([0f218ae](https://github.com/googleapis/java-shared-dependencies/commit/0f218aeb6aa33cf1da4a8b1d6c82bbf87946dab9)) +* Update gax.version to v2.19.0 ([#785](https://github.com/googleapis/java-shared-dependencies/issues/785)) ([4448331](https://github.com/googleapis/java-shared-dependencies/commit/4448331c4c6d88ea8076260776d1d47d24aa19fa)) +* Update google.core.version to v2.8.10 ([#787](https://github.com/googleapis/java-shared-dependencies/issues/787)) ([3c344d5](https://github.com/googleapis/java-shared-dependencies/commit/3c344d515e3b9215db5a1f8ef550d800d974e558)) +* Update google.core.version to v2.8.7 ([#774](https://github.com/googleapis/java-shared-dependencies/issues/774)) ([d0cd5e8](https://github.com/googleapis/java-shared-dependencies/commit/d0cd5e8f6ca88787fe0dbf7f30c849cb4c4fae5e)) +* Update google.core.version to v2.8.8 ([#777](https://github.com/googleapis/java-shared-dependencies/issues/777)) ([f00571c](https://github.com/googleapis/java-shared-dependencies/commit/f00571cd1e9f1c4e011fba4a1e1674c1d8d60200)) +* Update google.core.version to v2.8.9 ([#784](https://github.com/googleapis/java-shared-dependencies/issues/784)) ([aa8e505](https://github.com/googleapis/java-shared-dependencies/commit/aa8e505dbb1214b2239e55d5ac83b00c167d77e4)) + +## [3.0.1](https://github.com/googleapis/java-shared-dependencies/compare/v3.0.0...v3.0.1) (2022-08-02) + + +### Dependencies + +* update dependency com.google.code.gson:gson to v2.9.1 ([#766](https://github.com/googleapis/java-shared-dependencies/issues/766)) ([f7b2b06](https://github.com/googleapis/java-shared-dependencies/commit/f7b2b06b80e3e95ff8ab9b1d6a2638ef3069298a)) +* update gax.version to v2.18.7 ([#767](https://github.com/googleapis/java-shared-dependencies/issues/767)) ([9650368](https://github.com/googleapis/java-shared-dependencies/commit/96503682e98cdf348ea2c1365a03a60f4322c712)) +* update google.core.version to v2.8.6 ([#770](https://github.com/googleapis/java-shared-dependencies/issues/770)) ([cfd4377](https://github.com/googleapis/java-shared-dependencies/commit/cfd4377dc178cebb4724065d55d185ce03988d55)) + +## [3.0.0](https://github.com/googleapis/java-shared-dependencies/compare/v2.13.0...v3.0.0) (2022-07-29) + + +### Bug Fixes + +* enable longpaths support for windows test ([#1485](https://github.com/googleapis/java-shared-dependencies/issues/1485)) ([#738](https://github.com/googleapis/java-shared-dependencies/issues/738)) ([11bc8f8](https://github.com/googleapis/java-shared-dependencies/commit/11bc8f81f28be88a97fdeafca21724e33638770c)) + + +### Dependencies + +* update dependency com.google.api-client:google-api-client-bom to v1.35.2 ([#729](https://github.com/googleapis/java-shared-dependencies/issues/729)) ([1fa59af](https://github.com/googleapis/java-shared-dependencies/commit/1fa59af80abb9f278f57658c10158567e825fec6)) +* update dependency com.google.api-client:google-api-client-bom to v2 ([#746](https://github.com/googleapis/java-shared-dependencies/issues/746)) ([2dcb2e0](https://github.com/googleapis/java-shared-dependencies/commit/2dcb2e071e0ba0eea21bb575bd13cd559d4a1ca6)) +* update dependency com.google.api.grpc:grpc-google-common-protos to v2.9.2 ([#741](https://github.com/googleapis/java-shared-dependencies/issues/741)) ([3352d6c](https://github.com/googleapis/java-shared-dependencies/commit/3352d6c36111c04e3f6f3e6360470fa3efb10d8f)) +* update dependency com.google.auth:google-auth-library-bom to v1.8.0 ([#726](https://github.com/googleapis/java-shared-dependencies/issues/726)) ([2c5d64c](https://github.com/googleapis/java-shared-dependencies/commit/2c5d64c127db8384e49113acfeac6928716a2d7f)) +* update dependency com.google.auth:google-auth-library-bom to v1.8.1 ([#742](https://github.com/googleapis/java-shared-dependencies/issues/742)) ([4f53527](https://github.com/googleapis/java-shared-dependencies/commit/4f53527bda7f40896711b7c1d1c02453321ffbc8)) +* update dependency com.google.cloud:first-party-dependencies to v2 ([#747](https://github.com/googleapis/java-shared-dependencies/issues/747)) ([e970ac0](https://github.com/googleapis/java-shared-dependencies/commit/e970ac0599941c825dc2516146a7c6673e68a9b9)) +* update dependency com.google.cloud:grpc-gcp to v1.2.1 ([#751](https://github.com/googleapis/java-shared-dependencies/issues/751)) ([b3284b6](https://github.com/googleapis/java-shared-dependencies/commit/b3284b6ee52a96a6ea8696a05a94443df9ee5b9f)) +* update dependency com.google.cloud:third-party-dependencies to v2 ([#748](https://github.com/googleapis/java-shared-dependencies/issues/748)) ([573b41a](https://github.com/googleapis/java-shared-dependencies/commit/573b41a69504372741cbeb01dd200e7c71967186)) +* update dependency com.google.http-client:google-http-client-bom to v1.42.1 ([#730](https://github.com/googleapis/java-shared-dependencies/issues/730)) ([6b47126](https://github.com/googleapis/java-shared-dependencies/commit/6b47126686b603a5d112e097ce6aa3a1880daf6f)) +* update dependency com.google.http-client:google-http-client-bom to v1.42.2 ([#749](https://github.com/googleapis/java-shared-dependencies/issues/749)) ([299d7b0](https://github.com/googleapis/java-shared-dependencies/commit/299d7b0d4920644e2c3070d12dd1d97da17a5e88)) +* update dependency com.google.protobuf:protobuf-bom to v3.21.2 ([#722](https://github.com/googleapis/java-shared-dependencies/issues/722)) ([7a96b12](https://github.com/googleapis/java-shared-dependencies/commit/7a96b1259a526b63e9376fd6cc18b27cddeb5f0f)) +* update dependency com.google.protobuf:protobuf-bom to v3.21.3 ([#756](https://github.com/googleapis/java-shared-dependencies/issues/756)) ([3d0bac2](https://github.com/googleapis/java-shared-dependencies/commit/3d0bac23487aebb94267c0708f41ff6c02a028a4)) +* update dependency com.google.protobuf:protobuf-bom to v3.21.4 ([#759](https://github.com/googleapis/java-shared-dependencies/issues/759)) ([5a54ef1](https://github.com/googleapis/java-shared-dependencies/commit/5a54ef1a2d56244166d4fcc46041d62c0dc4b411)) +* update dependency io.grpc:grpc-bom to v1.48.0 ([#752](https://github.com/googleapis/java-shared-dependencies/issues/752)) ([20ac908](https://github.com/googleapis/java-shared-dependencies/commit/20ac908932a5e7c8e581bdfcd68579d7e1cedd5f)) +* update dependency org.checkerframework:checker-qual to v3.23.0 ([#736](https://github.com/googleapis/java-shared-dependencies/issues/736)) ([fc01d8f](https://github.com/googleapis/java-shared-dependencies/commit/fc01d8f93f391f12fdb800d5006f0b4505832eeb)) +* update gax.version to v2.18.3 ([#731](https://github.com/googleapis/java-shared-dependencies/issues/731)) ([e8ee554](https://github.com/googleapis/java-shared-dependencies/commit/e8ee554707acb2f71c739d08e2ff02fbe43ffa52)) +* update gax.version to v2.18.4 ([#735](https://github.com/googleapis/java-shared-dependencies/issues/735)) ([11c7415](https://github.com/googleapis/java-shared-dependencies/commit/11c74152a84697924de3a0e838b05f606c3098f7)) +* update gax.version to v2.18.5 ([#758](https://github.com/googleapis/java-shared-dependencies/issues/758)) ([7469fc1](https://github.com/googleapis/java-shared-dependencies/commit/7469fc1cc5095b39a5738e60156711a268f6e052)) +* update gax.version to v2.18.6 ([#763](https://github.com/googleapis/java-shared-dependencies/issues/763)) ([b5ca2f7](https://github.com/googleapis/java-shared-dependencies/commit/b5ca2f7b4d81c705823253f4f03363a32d2be48b)) +* update google.common-protos.version to v2.9.1 ([#724](https://github.com/googleapis/java-shared-dependencies/issues/724)) ([5213dbb](https://github.com/googleapis/java-shared-dependencies/commit/5213dbbfa9c9b73d2420ec2be7782f16c9c4955f)) +* update google.core.version to v2.8.1 ([#725](https://github.com/googleapis/java-shared-dependencies/issues/725)) ([575858a](https://github.com/googleapis/java-shared-dependencies/commit/575858a60f76e46bbc2a2435c2b6c01c8f4ab681)) +* update google.core.version to v2.8.3 ([#760](https://github.com/googleapis/java-shared-dependencies/issues/760)) ([cb10ae4](https://github.com/googleapis/java-shared-dependencies/commit/cb10ae4b76939215ea465af74163b3d4ad65a548)) +* update google.core.version to v2.8.4 ([#762](https://github.com/googleapis/java-shared-dependencies/issues/762)) ([821daaf](https://github.com/googleapis/java-shared-dependencies/commit/821daafefdbcfdfe6e363e580747538096a562ef)) +* update google.core.version to v2.8.5 ([#764](https://github.com/googleapis/java-shared-dependencies/issues/764)) ([a1f8f50](https://github.com/googleapis/java-shared-dependencies/commit/a1f8f501b54143a2cec8e72efd4ceb3ce47f13ae)) +* update iam.version to v1.5.0 ([#732](https://github.com/googleapis/java-shared-dependencies/issues/732)) ([9dce0e5](https://github.com/googleapis/java-shared-dependencies/commit/9dce0e5199c1e425119adc804304958f58003a27)) +* update iam.version to v1.5.1 ([#737](https://github.com/googleapis/java-shared-dependencies/issues/737)) ([df39168](https://github.com/googleapis/java-shared-dependencies/commit/df391685d42fcb1b04f03ab1380a594893bdce37)) +* update iam.version to v1.5.2 ([#743](https://github.com/googleapis/java-shared-dependencies/issues/743)) ([cdde697](https://github.com/googleapis/java-shared-dependencies/commit/cdde697f25a89fc8c2ec7eae6b7c54f69977bb1c)) + +## [2.13.0](https://github.com/googleapis/java-shared-dependencies/compare/v2.12.0...v2.13.0) (2022-06-22) + + +### Dependencies + +* update dependency com.google.api-client:google-api-client-bom to v1.35.0 ([#709](https://github.com/googleapis/java-shared-dependencies/issues/709)) ([239f8c3](https://github.com/googleapis/java-shared-dependencies/commit/239f8c33a11e233e6af79aee8c7e68cd156a0554)) +* update dependency com.google.api-client:google-api-client-bom to v1.35.1 ([#713](https://github.com/googleapis/java-shared-dependencies/issues/713)) ([6559b45](https://github.com/googleapis/java-shared-dependencies/commit/6559b45b027dba783a9525d35e32183d78773cbe)) +* update dependency com.google.api:api-common to v2.2.1 ([#710](https://github.com/googleapis/java-shared-dependencies/issues/710)) ([650d4c5](https://github.com/googleapis/java-shared-dependencies/commit/650d4c5f8c3cfce711257d47280ad773cd2e2414)) +* update dependency com.google.errorprone:error_prone_annotations to v2.14.0 ([#701](https://github.com/googleapis/java-shared-dependencies/issues/701)) ([d24730f](https://github.com/googleapis/java-shared-dependencies/commit/d24730f78669f80b109e590b903446e5552e3e36)) +* update dependency com.google.http-client:google-http-client-bom to v1.42.0 ([#711](https://github.com/googleapis/java-shared-dependencies/issues/711)) ([5168a18](https://github.com/googleapis/java-shared-dependencies/commit/5168a181722128d434a0d0d2ab5cc485686bbc78)) +* update dependency com.google.oauth-client:google-oauth-client-bom to v1.34.0 ([#708](https://github.com/googleapis/java-shared-dependencies/issues/708)) ([620336e](https://github.com/googleapis/java-shared-dependencies/commit/620336e6733e2017116e5e8a7b403b183a728bc1)) +* update dependency com.google.oauth-client:google-oauth-client-bom to v1.34.1 ([#712](https://github.com/googleapis/java-shared-dependencies/issues/712)) ([a2c18a5](https://github.com/googleapis/java-shared-dependencies/commit/a2c18a5bc4152cc9034cec691a29f54a35c38a51)) +* update dependency com.google.protobuf:protobuf-bom to v3.21.0 ([#703](https://github.com/googleapis/java-shared-dependencies/issues/703)) ([5f9fe12](https://github.com/googleapis/java-shared-dependencies/commit/5f9fe1200b4bdf4c54bf947c21bd3ed02f26f990)) +* update dependency com.google.protobuf:protobuf-bom to v3.21.1 ([#705](https://github.com/googleapis/java-shared-dependencies/issues/705)) ([c68edfb](https://github.com/googleapis/java-shared-dependencies/commit/c68edfbe7e1993e1112640b867b29aa2fbcf7579)) +* update dependency io.grpc:grpc-bom to v1.47.0 ([#707](https://github.com/googleapis/java-shared-dependencies/issues/707)) ([d02918a](https://github.com/googleapis/java-shared-dependencies/commit/d02918a0418cd65d1d247f27afb0637f1f8f5666)) +* update dependency org.checkerframework:checker-qual to v3.22.1 ([#706](https://github.com/googleapis/java-shared-dependencies/issues/706)) ([545843b](https://github.com/googleapis/java-shared-dependencies/commit/545843b492cead230b8cc72a1dae7d4922f33b39)) +* update dependency org.checkerframework:checker-qual to v3.22.2 ([#717](https://github.com/googleapis/java-shared-dependencies/issues/717)) ([142852a](https://github.com/googleapis/java-shared-dependencies/commit/142852a37140f221197f5c71aed451def353b1e0)) +* update gax.version to v2.18.2 ([#718](https://github.com/googleapis/java-shared-dependencies/issues/718)) ([5f8156e](https://github.com/googleapis/java-shared-dependencies/commit/5f8156e55c6a07b018a8c5efafa68be781b4288b)) +* update google.common-protos.version to v2.9.0 ([#714](https://github.com/googleapis/java-shared-dependencies/issues/714)) ([9e5591e](https://github.com/googleapis/java-shared-dependencies/commit/9e5591ec3035350450ecbfebd00e08216433b06c)) +* update google.core.version to v2.8.0 ([#719](https://github.com/googleapis/java-shared-dependencies/issues/719)) ([4023c60](https://github.com/googleapis/java-shared-dependencies/commit/4023c6063a2c5b5308da531df1a08c90c491965d)) +* update iam.version to v1.4.0 ([#700](https://github.com/googleapis/java-shared-dependencies/issues/700)) ([c1097a4](https://github.com/googleapis/java-shared-dependencies/commit/c1097a46ab0739b0b7234bc510e4c3d9ce2c2861)) +* update iam.version to v1.4.1 ([#716](https://github.com/googleapis/java-shared-dependencies/issues/716)) ([e2dc7c2](https://github.com/googleapis/java-shared-dependencies/commit/e2dc7c21c39e007878841e2664d548ec44a72d54)) + +## [2.12.0](https://github.com/googleapis/java-shared-dependencies/compare/v2.11.0...v2.12.0) (2022-05-19) + + +### Features + +* add build scripts for native image testing in Java 17 ([#1440](https://github.com/googleapis/java-shared-dependencies/issues/1440)) ([#697](https://github.com/googleapis/java-shared-dependencies/issues/697)) ([f10ec4e](https://github.com/googleapis/java-shared-dependencies/commit/f10ec4e664d8fde868effe366b7182a5fad08dd0)) + + +### Dependencies + +* update gax.version to v2.18.1 ([#695](https://github.com/googleapis/java-shared-dependencies/issues/695)) ([09bc61c](https://github.com/googleapis/java-shared-dependencies/commit/09bc61c9152a99bfe87554a07324f15ae6217d6e)) +* update google.core.version to v2.7.1 ([#698](https://github.com/googleapis/java-shared-dependencies/issues/698)) ([43de259](https://github.com/googleapis/java-shared-dependencies/commit/43de2593f1a6e8fa5e34799364ab683246ddd449)) + +## [2.11.0](https://github.com/googleapis/java-shared-dependencies/compare/v2.10.0...v2.11.0) (2022-05-18) + + +### Features + +* next release from main branch is 2.11.0 ([#674](https://github.com/googleapis/java-shared-dependencies/issues/674)) ([611e3b7](https://github.com/googleapis/java-shared-dependencies/commit/611e3b7c50108a71efc94415166b85d2bf8647e5)) + + +### Dependencies + +* update dependency com.fasterxml.jackson:jackson-bom to v2.13.3 ([#689](https://github.com/googleapis/java-shared-dependencies/issues/689)) ([03897e3](https://github.com/googleapis/java-shared-dependencies/commit/03897e30a71f8f1aa37233da2433ee5afccc1d61)) +* update dependency com.google.api-client:google-api-client-bom to v1.34.1 ([#685](https://github.com/googleapis/java-shared-dependencies/issues/685)) ([9bc0557](https://github.com/googleapis/java-shared-dependencies/commit/9bc0557d8ce2f3d8dc7c8ffafdd36fd4c03e2df5)) +* update dependency com.google.api:api-common to v2.2.0 ([#690](https://github.com/googleapis/java-shared-dependencies/issues/690)) ([47a8736](https://github.com/googleapis/java-shared-dependencies/commit/47a87365e51f73132b15b054d85f8c9baa8e89f6)) +* update dependency com.google.auth:google-auth-library-bom to v1.7.0 ([#691](https://github.com/googleapis/java-shared-dependencies/issues/691)) ([ec6aab7](https://github.com/googleapis/java-shared-dependencies/commit/ec6aab72eaed43574efe47a696bba6a612f161bb)) +* update dependency com.google.errorprone:error_prone_annotations to v2.13.1 ([#672](https://github.com/googleapis/java-shared-dependencies/issues/672)) ([8c7e530](https://github.com/googleapis/java-shared-dependencies/commit/8c7e530d3c7170b2fb76cc27a05164524ba4e00b)) +* update dependency com.google.http-client:google-http-client-bom to v1.41.8 ([#684](https://github.com/googleapis/java-shared-dependencies/issues/684)) ([1305356](https://github.com/googleapis/java-shared-dependencies/commit/1305356775247dbb641b60654ac56da43513088e)) +* update dependency com.google.protobuf:protobuf-bom to v3.20.1 ([#678](https://github.com/googleapis/java-shared-dependencies/issues/678)) ([3e6d4a1](https://github.com/googleapis/java-shared-dependencies/commit/3e6d4a1a8e5d45723071a62c99bb1ab87d2b2b84)) +* update dependency io.grpc:grpc-bom to v1.46.0 ([#680](https://github.com/googleapis/java-shared-dependencies/issues/680)) ([b8a052b](https://github.com/googleapis/java-shared-dependencies/commit/b8a052b75a1bc2703500b4f31c5c6dac887ab8be)) +* update dependency org.checkerframework:checker-qual to v3.22.0 ([#683](https://github.com/googleapis/java-shared-dependencies/issues/683)) ([b0a30cd](https://github.com/googleapis/java-shared-dependencies/commit/b0a30cdecae8dcfb3a6d36e3f194c39a0086673e)) +* update gax.version to v2.17.0 ([#687](https://github.com/googleapis/java-shared-dependencies/issues/687)) ([e0e89ea](https://github.com/googleapis/java-shared-dependencies/commit/e0e89eade481effc723c9c7261f2ebf4e5883621)) +* update gax.version to v2.18.0 ([#692](https://github.com/googleapis/java-shared-dependencies/issues/692)) ([9536612](https://github.com/googleapis/java-shared-dependencies/commit/9536612c77af1e4d912c5b63515ea6f750e53810)) +* update google.core.version to v2.6.1 ([#671](https://github.com/googleapis/java-shared-dependencies/issues/671)) ([e3d1aeb](https://github.com/googleapis/java-shared-dependencies/commit/e3d1aebed31f8e91109d5865afd9525ac3595c90)) +* update google.core.version to v2.7.0 ([#693](https://github.com/googleapis/java-shared-dependencies/issues/693)) ([2171677](https://github.com/googleapis/java-shared-dependencies/commit/2171677e16190de9f37dc16c924d829ea8ccd86c)) +* update iam.version to v1.3.2 ([#673](https://github.com/googleapis/java-shared-dependencies/issues/673)) ([9882baa](https://github.com/googleapis/java-shared-dependencies/commit/9882baa3ecc8d7584788af1916f0d8c5ec670b5c)) +* update iam.version to v1.3.3 ([#679](https://github.com/googleapis/java-shared-dependencies/issues/679)) ([9fe34c8](https://github.com/googleapis/java-shared-dependencies/commit/9fe34c89eabed5eeebad986bffeeeb64dbbc38c1)) +* update iam.version to v1.3.4 ([#686](https://github.com/googleapis/java-shared-dependencies/issues/686)) ([4e95b3a](https://github.com/googleapis/java-shared-dependencies/commit/4e95b3a1d4302812338c220df316391c19ef7473)) +* update opencensus.version to v0.31.1 ([#682](https://github.com/googleapis/java-shared-dependencies/issues/682)) ([5d25746](https://github.com/googleapis/java-shared-dependencies/commit/5d25746bc6c9329b240204cbe7b83e2fee4c6cb3)) + +## [2.10.0](https://github.com/googleapis/java-shared-dependencies/compare/v2.9.0...v2.10.0) (2022-04-15) + + +### Dependencies + +* google-cloud-core 2.6.0 ([#668](https://github.com/googleapis/java-shared-dependencies/issues/668)) ([22f4d18](https://github.com/googleapis/java-shared-dependencies/commit/22f4d1809cbb9848174b3569ab527e4bef00d443)) +* reverting protobuf to 3.19.4 ([#657](https://github.com/googleapis/java-shared-dependencies/issues/657)) ([8501e6d](https://github.com/googleapis/java-shared-dependencies/commit/8501e6d842c10d2370bbd5d5246070134336bddd)) +* update dependency com.fasterxml.jackson:jackson-bom to v2.13.2.20220328 ([#646](https://github.com/googleapis/java-shared-dependencies/issues/646)) ([7bfd6d7](https://github.com/googleapis/java-shared-dependencies/commit/7bfd6d7073859d1955b91b368c6713a72ffa14b6)) +* update dependency com.google.api-client:google-api-client-bom to v1.34.0 ([#662](https://github.com/googleapis/java-shared-dependencies/issues/662)) ([1b8e378](https://github.com/googleapis/java-shared-dependencies/commit/1b8e378fe0ccf2a28c759868caaf5ba593a95728)) +* update dependency com.google.errorprone:error_prone_annotations to v2.12.1 ([#652](https://github.com/googleapis/java-shared-dependencies/issues/652)) ([1cc80ee](https://github.com/googleapis/java-shared-dependencies/commit/1cc80ee984ebcad9bc2a95e2f28c0a49fe924b37)) +* update dependency com.google.errorprone:error_prone_annotations to v2.13.0 ([#669](https://github.com/googleapis/java-shared-dependencies/issues/669)) ([61b7834](https://github.com/googleapis/java-shared-dependencies/commit/61b78341b34a251722be4805a6bdd895cd64836c)) +* update dependency com.google.http-client:google-http-client-bom to v1.41.6 ([#654](https://github.com/googleapis/java-shared-dependencies/issues/654)) ([140ef40](https://github.com/googleapis/java-shared-dependencies/commit/140ef405bc17ed83f5ce177df59affca14fbe49c)) +* update dependency com.google.http-client:google-http-client-bom to v1.41.7 ([#658](https://github.com/googleapis/java-shared-dependencies/issues/658)) ([f6f93e5](https://github.com/googleapis/java-shared-dependencies/commit/f6f93e5b9172c9684623c4c148e4a8fe2fae1e94)) +* update dependency com.google.oauth-client:google-oauth-client-bom to v1.33.2 ([#655](https://github.com/googleapis/java-shared-dependencies/issues/655)) ([20cd9ed](https://github.com/googleapis/java-shared-dependencies/commit/20cd9eda112c96836a5ab7485a4247ed2bc0edb8)) +* update dependency com.google.oauth-client:google-oauth-client-bom to v1.33.3 ([#663](https://github.com/googleapis/java-shared-dependencies/issues/663)) ([f011a46](https://github.com/googleapis/java-shared-dependencies/commit/f011a46c551dba16851b4f8c919c40452fc5d5c3)) +* update dependency com.google.protobuf:protobuf-bom to v3.20.0 ([#651](https://github.com/googleapis/java-shared-dependencies/issues/651)) ([ad2ff73](https://github.com/googleapis/java-shared-dependencies/commit/ad2ff73207dd6493321c77d8eca0022baf13b4ce)) +* update dependency io.grpc:grpc-bom to v1.45.1 ([#647](https://github.com/googleapis/java-shared-dependencies/issues/647)) ([38e46fc](https://github.com/googleapis/java-shared-dependencies/commit/38e46fc4f03af0a02f30ce4a2fa222c71797ae15)) +* update dependency org.checkerframework:checker-qual to v3.21.4 ([#650](https://github.com/googleapis/java-shared-dependencies/issues/650)) ([125e80a](https://github.com/googleapis/java-shared-dependencies/commit/125e80ab2c3225a00c03f5ff5de94872ebb94303)) +* update gax.version to v2.15.0 ([#649](https://github.com/googleapis/java-shared-dependencies/issues/649)) ([c7f32a6](https://github.com/googleapis/java-shared-dependencies/commit/c7f32a68b14520104432282ac9598643700162eb)) +* update gax.version to v2.16.0 ([#664](https://github.com/googleapis/java-shared-dependencies/issues/664)) ([caaf941](https://github.com/googleapis/java-shared-dependencies/commit/caaf941643af04295f5527a0144587d7bf040862)) +* update google.common-protos.version to v2.8.1 ([#656](https://github.com/googleapis/java-shared-dependencies/issues/656)) ([df4a4a2](https://github.com/googleapis/java-shared-dependencies/commit/df4a4a2130a3cdb2965ea42962d1ea6a85506ba7)) +* update google.common-protos.version to v2.8.2 ([#659](https://github.com/googleapis/java-shared-dependencies/issues/659)) ([b499e2b](https://github.com/googleapis/java-shared-dependencies/commit/b499e2bc99506d48d26e35bf6e68c09409ce8b11)) +* update google.common-protos.version to v2.8.3 ([#660](https://github.com/googleapis/java-shared-dependencies/issues/660)) ([461081c](https://github.com/googleapis/java-shared-dependencies/commit/461081c0cf73057c1f6e07fc573453ad467a60ae)) +* update iam.version to v1.3.0 ([#648](https://github.com/googleapis/java-shared-dependencies/issues/648)) ([6670c4f](https://github.com/googleapis/java-shared-dependencies/commit/6670c4f61fcf075c543bfd148eea49796e0662ce)) +* update iam.version to v1.3.1 ([#661](https://github.com/googleapis/java-shared-dependencies/issues/661)) ([cc8fbe6](https://github.com/googleapis/java-shared-dependencies/commit/cc8fbe6eae03341c2ece7d3356febc843a74a812)) + +## [2.9.0](https://github.com/googleapis/java-shared-dependencies/compare/v2.8.0...v2.9.0) (2022-03-28) + + +### Dependencies + +* guava 31.1 ([#635](https://github.com/googleapis/java-shared-dependencies/issues/635)) ([0939b06](https://github.com/googleapis/java-shared-dependencies/commit/0939b063a79cd4ffafb49cf04861ce577e35efd6)) +* update dependency com.fasterxml.jackson:jackson-bom to v2.13.2 ([#626](https://github.com/googleapis/java-shared-dependencies/issues/626)) ([6014663](https://github.com/googleapis/java-shared-dependencies/commit/601466339c9631faa88033d1ff1e31582fb67b7b)) +* update dependency com.fasterxml.jackson:jackson-bom to v2.13.2.20220324 ([#636](https://github.com/googleapis/java-shared-dependencies/issues/636)) ([6c833fa](https://github.com/googleapis/java-shared-dependencies/commit/6c833faa7815147013999bfc2bb6935fd8fe6b34)) +* update dependency com.google.api-client:google-api-client-bom to v1.33.4 ([#642](https://github.com/googleapis/java-shared-dependencies/issues/642)) ([57bd912](https://github.com/googleapis/java-shared-dependencies/commit/57bd9124ce8981b7b3b5d0c87b7c1e5f935b7150)) +* update dependency com.google.api:api-common to v2.1.5 ([#637](https://github.com/googleapis/java-shared-dependencies/issues/637)) ([d3a00fa](https://github.com/googleapis/java-shared-dependencies/commit/d3a00fa5ce9908000122d8365fb2f2d0e388494b)) +* update dependency com.google.auth:google-auth-library-bom to v1.6.0 ([#631](https://github.com/googleapis/java-shared-dependencies/issues/631)) ([53dc7c2](https://github.com/googleapis/java-shared-dependencies/commit/53dc7c2fe255a6c7ca059dd414449bf96780f936)) +* update dependency com.google.cloud:google-cloud-core-bom to v2.5.11 ([#644](https://github.com/googleapis/java-shared-dependencies/issues/644)) ([4331dcc](https://github.com/googleapis/java-shared-dependencies/commit/4331dcc331e8377fcc57e5404321611186ca22cb)) +* update dependency com.google.http-client:google-http-client-bom to v1.41.5 ([#638](https://github.com/googleapis/java-shared-dependencies/issues/638)) ([e007d23](https://github.com/googleapis/java-shared-dependencies/commit/e007d2381bd388a1c199fc3f31d0b965f8ae592d)) +* update dependency io.grpc:grpc-bom to v1.45.0 ([#630](https://github.com/googleapis/java-shared-dependencies/issues/630)) ([20334e3](https://github.com/googleapis/java-shared-dependencies/commit/20334e30d256897cd7ef52c646e5c4549cd7ae69)) +* update dependency org.threeten:threetenbp to v1.6.0 ([#633](https://github.com/googleapis/java-shared-dependencies/issues/633)) ([1a2716d](https://github.com/googleapis/java-shared-dependencies/commit/1a2716d22e442c5cd6adea9449756b9ac3ddbf8e)) +* update gax.version to v2.13.0 ([#641](https://github.com/googleapis/java-shared-dependencies/issues/641)) ([b863746](https://github.com/googleapis/java-shared-dependencies/commit/b863746727fadd45c35198f58eb862f47fe14945)) +* update google.common-protos.version to v2.8.0 ([#639](https://github.com/googleapis/java-shared-dependencies/issues/639)) ([252afba](https://github.com/googleapis/java-shared-dependencies/commit/252afba1df8e4cfdf2574d127097b0978b7778c0)) +* update google.core.version to v2.5.10 ([#628](https://github.com/googleapis/java-shared-dependencies/issues/628)) ([fec6f51](https://github.com/googleapis/java-shared-dependencies/commit/fec6f5121384a04a389bad6f6477a9a5ce468016)) +* update iam.version to v1.2.10 ([#625](https://github.com/googleapis/java-shared-dependencies/issues/625)) ([0d7ca29](https://github.com/googleapis/java-shared-dependencies/commit/0d7ca2924bd24abe14883c173156bb4dc5fb90bf)) + +## [2.8.0](https://github.com/googleapis/java-shared-dependencies/compare/v2.7.0...v2.8.0) (2022-03-02) + + +### Dependencies + +* update dependency com.google.api-client:google-api-client-bom to v1.33.2 ([#602](https://github.com/googleapis/java-shared-dependencies/issues/602)) ([85b132f](https://github.com/googleapis/java-shared-dependencies/commit/85b132f5830772646025b6a9fbbb970a941b86b5)) +* update dependency com.google.api:api-common to v2.1.4 ([#605](https://github.com/googleapis/java-shared-dependencies/issues/605)) ([ca7d49a](https://github.com/googleapis/java-shared-dependencies/commit/ca7d49aee26b6d90abd2afd61c20861d2307fe9c)) +* update dependency com.google.auth:google-auth-library-bom to v1.5.3 ([#614](https://github.com/googleapis/java-shared-dependencies/issues/614)) ([e6413f3](https://github.com/googleapis/java-shared-dependencies/commit/e6413f3b1be78473ace7085c344eda2d78cdf01a)) +* update dependency com.google.cloud:google-cloud-core to v2.5.6 ([#621](https://github.com/googleapis/java-shared-dependencies/issues/621)) ([3d5669f](https://github.com/googleapis/java-shared-dependencies/commit/3d5669f215689dd2df71200ffe37d5a9d385cda8)) +* update dependency com.google.code.gson:gson to v2.9.0 ([#611](https://github.com/googleapis/java-shared-dependencies/issues/611)) ([f59c28d](https://github.com/googleapis/java-shared-dependencies/commit/f59c28d8cd30ada1237f7722135ba148dce6315e)) +* update dependency com.google.http-client:google-http-client-bom to v1.41.4 ([#608](https://github.com/googleapis/java-shared-dependencies/issues/608)) ([f9a4f23](https://github.com/googleapis/java-shared-dependencies/commit/f9a4f23d3a32148ac59e53eaae6558ccbceca12c)) +* update dependency com.google.oauth-client:google-oauth-client-bom to v1.33.1 ([#606](https://github.com/googleapis/java-shared-dependencies/issues/606)) ([3882494](https://github.com/googleapis/java-shared-dependencies/commit/3882494770d48fcc02ed19088aa06612a8e440eb)) +* update dependency com.google.protobuf:protobuf-bom to v3.19.4 ([#593](https://github.com/googleapis/java-shared-dependencies/issues/593)) ([1e155bf](https://github.com/googleapis/java-shared-dependencies/commit/1e155bfc957bbb7e25d2e0994cdecaa81843bdc5)) +* update dependency io.grpc:grpc-bom to v1.44.1 ([#613](https://github.com/googleapis/java-shared-dependencies/issues/613)) ([3038a2c](https://github.com/googleapis/java-shared-dependencies/commit/3038a2c86cd20c91b65f2d7926eeb739147a68db)) +* update dependency junit:junit to v4.13.2 ([#607](https://github.com/googleapis/java-shared-dependencies/issues/607)) ([987e617](https://github.com/googleapis/java-shared-dependencies/commit/987e61796c7a093e005fe8832cf39275c391b2c1)) +* update dependency org.checkerframework:checker-qual to v3.21.3 ([#596](https://github.com/googleapis/java-shared-dependencies/issues/596)) ([ac5083c](https://github.com/googleapis/java-shared-dependencies/commit/ac5083cd010924dc128f041c2cdbab20166a6bf0)) +* update gax.version to v2.12.2 ([#592](https://github.com/googleapis/java-shared-dependencies/issues/592)) ([713ff8d](https://github.com/googleapis/java-shared-dependencies/commit/713ff8dd94f939c417524616bc47c771a3fbe0cf)) +* update google.common-protos.version to v2.7.4 ([#603](https://github.com/googleapis/java-shared-dependencies/issues/603)) ([bb9b4c7](https://github.com/googleapis/java-shared-dependencies/commit/bb9b4c7e39552cc73b3b9d4c826b26e8cb74459f)) +* update google.core.version ([#599](https://github.com/googleapis/java-shared-dependencies/issues/599)) ([327d0df](https://github.com/googleapis/java-shared-dependencies/commit/327d0df9b57203c0d4f426de0380770d3d7910d6)) +* update iam.version to v1.2.6 ([#598](https://github.com/googleapis/java-shared-dependencies/issues/598)) ([2801439](https://github.com/googleapis/java-shared-dependencies/commit/280143964c7c3b93a8d7f67215ba2cc74ffce761)) + +## [2.7.0](https://github.com/googleapis/java-shared-dependencies/compare/v2.6.0...v2.7.0) (2022-01-28) + + +### Dependencies + +* update dependency com.fasterxml.jackson:jackson-bom to v2.13.1 ([#555](https://github.com/googleapis/java-shared-dependencies/issues/555)) ([67b5663](https://github.com/googleapis/java-shared-dependencies/commit/67b56635509215fd132b2ffbcaed995a6de93879)) +* update dependency com.google.api-client:google-api-client-bom to v1.33.1 ([#580](https://github.com/googleapis/java-shared-dependencies/issues/580)) ([895dba2](https://github.com/googleapis/java-shared-dependencies/commit/895dba2afef6c295b0e21a4ccd27feee1b6af8e2)) +* update dependency com.google.api:api-common to v2.1.3 ([#587](https://github.com/googleapis/java-shared-dependencies/issues/587)) ([5dbbce8](https://github.com/googleapis/java-shared-dependencies/commit/5dbbce80baa045818757912e6db4f222c12b75f6)) +* update dependency com.google.auth:google-auth-library-bom to v1.4.0 ([#578](https://github.com/googleapis/java-shared-dependencies/issues/578)) ([c274c62](https://github.com/googleapis/java-shared-dependencies/commit/c274c62905192bcc48c82104bf50cbeaa1894c2b)) +* update dependency com.google.errorprone:error_prone_annotations to v2.11.0 ([#582](https://github.com/googleapis/java-shared-dependencies/issues/582)) ([314da38](https://github.com/googleapis/java-shared-dependencies/commit/314da38c9f12cf425b5d1be8297e9f2a78d13948)) +* update dependency com.google.http-client:google-http-client-bom to v1.41.2 ([#579](https://github.com/googleapis/java-shared-dependencies/issues/579)) ([c8df06d](https://github.com/googleapis/java-shared-dependencies/commit/c8df06ddb3f4a975e928bbdd9dfae293e81efa39)) +* update dependency com.google.oauth-client:google-oauth-client-bom to v1.33.0 ([#576](https://github.com/googleapis/java-shared-dependencies/issues/576)) ([3315988](https://github.com/googleapis/java-shared-dependencies/commit/3315988059ca0223f078b0f760960674bfa8c04a)) +* update dependency com.google.protobuf:protobuf-bom to v3.19.3 ([#571](https://github.com/googleapis/java-shared-dependencies/issues/571)) ([c1931e1](https://github.com/googleapis/java-shared-dependencies/commit/c1931e1c4611ca3d1e2afac1c9e983cf1ec4a7de)) +* update dependency io.grpc:grpc-bom to v1.44.0 ([#586](https://github.com/googleapis/java-shared-dependencies/issues/586)) ([52c47b7](https://github.com/googleapis/java-shared-dependencies/commit/52c47b7425af438ba1a82dac87f9002353a6a87a)) +* update dependency org.checkerframework:checker-qual to v3.21.1 ([#554](https://github.com/googleapis/java-shared-dependencies/issues/554)) ([81bbb91](https://github.com/googleapis/java-shared-dependencies/commit/81bbb91774ab67161371bfd0dfd143de89dee4c9)) +* update gax.version to v2.11.0 ([#581](https://github.com/googleapis/java-shared-dependencies/issues/581)) ([1899612](https://github.com/googleapis/java-shared-dependencies/commit/189961226f84cdd4e283780d2c7d4a4dffc3e00c)) +* update gax.version to v2.9.0 ([#573](https://github.com/googleapis/java-shared-dependencies/issues/573)) ([ee5e38e](https://github.com/googleapis/java-shared-dependencies/commit/ee5e38efea574eeb2b5803192da98ba1ce1c8e6e)) +* update google.common-protos.version to v2.7.2 ([#588](https://github.com/googleapis/java-shared-dependencies/issues/588)) ([caac0e6](https://github.com/googleapis/java-shared-dependencies/commit/caac0e68e336b801becb6322b5b81fce1824ad8a)) +* update google.core.version to v2.4.0 ([#589](https://github.com/googleapis/java-shared-dependencies/issues/589)) ([6a292e3](https://github.com/googleapis/java-shared-dependencies/commit/6a292e3530a06d6b228f3154ed4e979ef68d7aeb)) +* update iam.version to v1.2.1 ([#569](https://github.com/googleapis/java-shared-dependencies/issues/569)) ([62dd270](https://github.com/googleapis/java-shared-dependencies/commit/62dd2705b257c4bb539bfe619234f38d0e13b138)) +* update opencensus.version to v0.30.0 ([#552](https://github.com/googleapis/java-shared-dependencies/issues/552)) ([ebae62e](https://github.com/googleapis/java-shared-dependencies/commit/ebae62eca75234db4fd571f42b8ed0f6ce1bd1f7)) +* update opencensus.version to v0.31.0 ([#585](https://github.com/googleapis/java-shared-dependencies/issues/585)) ([021b066](https://github.com/googleapis/java-shared-dependencies/commit/021b066a833af1629c89fcca593d16b9786ee0bf)) + +## [2.6.0](https://www.github.com/googleapis/java-shared-dependencies/compare/2.5.1...v2.6.0) (2022-01-07) + + +### Bug Fixes + +* **java:** add -ntp flag to native image testing command ([#1299](https://www.github.com/googleapis/java-shared-dependencies/issues/1299)) ([#546](https://www.github.com/googleapis/java-shared-dependencies/issues/546)) ([d8bb8d9](https://www.github.com/googleapis/java-shared-dependencies/commit/d8bb8d9d8e3b8c582f768cd3164e8580ec334511)) +* **java:** run Maven in plain console-friendly mode ([#1301](https://www.github.com/googleapis/java-shared-dependencies/issues/1301)) ([#557](https://www.github.com/googleapis/java-shared-dependencies/issues/557)) ([6b57d08](https://www.github.com/googleapis/java-shared-dependencies/commit/6b57d08816ec6c1dfb637cae022624e896930ad8)) + + +### Dependencies + +* gRPC upgrade to 1.43.2 ([#567](https://www.github.com/googleapis/java-shared-dependencies/issues/567)) ([c946655](https://www.github.com/googleapis/java-shared-dependencies/commit/c94665571f26d24fbbb3f89ef5a3db99663bfdba)) +* update dependency com.google.api-client:google-api-client-bom to v1.33.0 ([#563](https://www.github.com/googleapis/java-shared-dependencies/issues/563)) ([0aedddb](https://www.github.com/googleapis/java-shared-dependencies/commit/0aedddb9a535753767d56f5910f355c7a1c8509c)) +* update dependency com.google.api:api-common to v2.1.2 ([2f154a3](https://www.github.com/googleapis/java-shared-dependencies/commit/2f154a3ff759211438c72859e98b314c7ff8405f)) +* update dependency com.google.http-client:google-http-client-bom to v1.41.0 ([#562](https://www.github.com/googleapis/java-shared-dependencies/issues/562)) ([6da0735](https://www.github.com/googleapis/java-shared-dependencies/commit/6da0735d4db9df998d11c549488a024b800bed65)) +* update dependency io.grpc:grpc-bom to v1.43.1 ([#553](https://www.github.com/googleapis/java-shared-dependencies/issues/553)) ([b787c8f](https://www.github.com/googleapis/java-shared-dependencies/commit/b787c8f2032b7ffc9797158c3ff214b7813f34b7)) +* update dependency org.apache.httpcomponents:httpcore to v4.4.15 ([#550](https://www.github.com/googleapis/java-shared-dependencies/issues/550)) ([e2d3dba](https://www.github.com/googleapis/java-shared-dependencies/commit/e2d3dbad6dd54c117abb5ab1b6137cfee4e5a32b)) +* update dependency org.checkerframework:checker-qual to v3.20.0 ([#549](https://www.github.com/googleapis/java-shared-dependencies/issues/549)) ([586df59](https://www.github.com/googleapis/java-shared-dependencies/commit/586df5949d4ddca11d0705d696882c32d8436c31)) +* update gax.version to v2.8.0 ([#564](https://www.github.com/googleapis/java-shared-dependencies/issues/564)) ([9ad5d4f](https://www.github.com/googleapis/java-shared-dependencies/commit/9ad5d4f5385753a0c5739ef400f5d346e3342b84)) +* update gax.version to v2.8.1 ([2f154a3](https://www.github.com/googleapis/java-shared-dependencies/commit/2f154a3ff759211438c72859e98b314c7ff8405f)) +* update google.common-protos.version to v2.7.1 ([#561](https://www.github.com/googleapis/java-shared-dependencies/issues/561)) ([9aa860d](https://www.github.com/googleapis/java-shared-dependencies/commit/9aa860d92f745f1d4382eb16439bf17ac6ca8ae9)) +* update google.core.version to v2.3.5 ([#565](https://www.github.com/googleapis/java-shared-dependencies/issues/565)) ([2f154a3](https://www.github.com/googleapis/java-shared-dependencies/commit/2f154a3ff759211438c72859e98b314c7ff8405f)) +* update iam.version to v1.2.0 ([#547](https://www.github.com/googleapis/java-shared-dependencies/issues/547)) ([3232c82](https://www.github.com/googleapis/java-shared-dependencies/commit/3232c828b628cb604a200b3e569e56e758e5e11d)) +* upgrading protobuf to 3.19.2 ([#560](https://www.github.com/googleapis/java-shared-dependencies/issues/560)) ([7ef3325](https://www.github.com/googleapis/java-shared-dependencies/commit/7ef33250f5473348d3546210b7a534360f476101)) + +### [2.5.1](https://www.github.com/googleapis/java-shared-dependencies/compare/2.5.0...v2.5.1) (2021-12-03) + + +### Dependencies + +* update dependency com.google.api:api-common to v2.1.1 ([#533](https://www.github.com/googleapis/java-shared-dependencies/issues/533)) ([4e23adb](https://www.github.com/googleapis/java-shared-dependencies/commit/4e23adb666dfaa18ae8bf869aca030153de16d62)) +* update gax.version to v2.7.1 ([#544](https://www.github.com/googleapis/java-shared-dependencies/issues/544)) ([5a0c480](https://www.github.com/googleapis/java-shared-dependencies/commit/5a0c480671fa834e600edc6ac6fe77967d1b79b3)) +* update google.common-protos.version to v2.7.0 ([#542](https://www.github.com/googleapis/java-shared-dependencies/issues/542)) ([af97eb5](https://www.github.com/googleapis/java-shared-dependencies/commit/af97eb5d9cff397080fdb3d4a6dbf7c2692e0358)) +* update google.core.version to v2.3.3 ([#534](https://www.github.com/googleapis/java-shared-dependencies/issues/534)) ([885acef](https://www.github.com/googleapis/java-shared-dependencies/commit/885acefe4ff5313eb53dc43b4825ca597b97dcfd)) + +## [2.5.0](https://www.github.com/googleapis/java-shared-dependencies/compare/2.4.0...v2.5.0) (2021-11-12) + + +### Features + +* next release from main branch is 2.5.0 ([#510](https://www.github.com/googleapis/java-shared-dependencies/issues/510)) ([ca9eb8a](https://www.github.com/googleapis/java-shared-dependencies/commit/ca9eb8a40ae81d69de0d82d9499ef21b0136ae49)) + + +### Bug Fixes + +* dependencies.sh to work with Java 17 ([#516](https://www.github.com/googleapis/java-shared-dependencies/issues/516)) ([8422c1d](https://www.github.com/googleapis/java-shared-dependencies/commit/8422c1d7e9ef479f348e63c530789050b5235426)) + + +### Dependencies + +* update dependency com.google.api:api-common to v2.1.0 ([#508](https://www.github.com/googleapis/java-shared-dependencies/issues/508)) ([ae32d16](https://www.github.com/googleapis/java-shared-dependencies/commit/ae32d1689c78fc1469206c8c0df0ebaca59edd2c)) +* update dependency com.google.auth:google-auth-library-bom to v1.2.2 ([#506](https://www.github.com/googleapis/java-shared-dependencies/issues/506)) ([b9a8209](https://www.github.com/googleapis/java-shared-dependencies/commit/b9a82098655f29e858bd0c7a9b1049a379e5062a)) +* update dependency com.google.auth:google-auth-library-bom to v1.3.0 ([#524](https://www.github.com/googleapis/java-shared-dependencies/issues/524)) ([fc07879](https://www.github.com/googleapis/java-shared-dependencies/commit/fc07879fa6531e39b21977fe77abc19354a1fd33)) +* update dependency com.google.code.gson:gson to v2.8.9 ([#509](https://www.github.com/googleapis/java-shared-dependencies/issues/509)) ([bece99b](https://www.github.com/googleapis/java-shared-dependencies/commit/bece99bb3e0365e60e7376ba18d046ab6436a235)) +* update dependency com.google.errorprone:error_prone_annotations to v2.10.0 ([#512](https://www.github.com/googleapis/java-shared-dependencies/issues/512)) ([c281f13](https://www.github.com/googleapis/java-shared-dependencies/commit/c281f137525e2111e97349657be578ed1fc832f2)) +* update dependency com.google.protobuf:protobuf-bom to v3.19.1 ([#505](https://www.github.com/googleapis/java-shared-dependencies/issues/505)) ([94cde96](https://www.github.com/googleapis/java-shared-dependencies/commit/94cde96069900f9f8c2ff9a522671d03b26828bd)) +* update dependency io.grpc:grpc-bom to v1.42.1 ([#513](https://www.github.com/googleapis/java-shared-dependencies/issues/513)) ([0d2b774](https://www.github.com/googleapis/java-shared-dependencies/commit/0d2b774287a132821cc6fe2789140086bc48d525)) +* update dependency org.checkerframework:checker-qual to v3.19.0 ([#501](https://www.github.com/googleapis/java-shared-dependencies/issues/501)) ([2b3e0b5](https://www.github.com/googleapis/java-shared-dependencies/commit/2b3e0b5ddc3a645b20a837f3123394f1ca114f08)) +* update dependency org.threeten:threetenbp to v1.5.2 ([#514](https://www.github.com/googleapis/java-shared-dependencies/issues/514)) ([4885f40](https://www.github.com/googleapis/java-shared-dependencies/commit/4885f402e2c70435cd10d4f1b893df9873808c56)) +* update gax.version to v2.7.0 ([#515](https://www.github.com/googleapis/java-shared-dependencies/issues/515)) ([567e728](https://www.github.com/googleapis/java-shared-dependencies/commit/567e728b0e59233a04e2d04183e6a0c36cca2437)) +* update google.core.version to v2.3.0 ([#530](https://www.github.com/googleapis/java-shared-dependencies/issues/530)) ([78e87e9](https://www.github.com/googleapis/java-shared-dependencies/commit/78e87e96befab34dc4a494e752aeb473cd14a156)) +* update iam.version to v1.1.7 ([#504](https://www.github.com/googleapis/java-shared-dependencies/issues/504)) ([63dd583](https://www.github.com/googleapis/java-shared-dependencies/commit/63dd583c80f35b01a66fd1908d41467468c66436)) + +## [2.4.0](https://www.github.com/googleapis/java-shared-dependencies/compare/2.3.0...v2.4.0) (2021-10-18) + + +### Dependencies + +* update dependency com.fasterxml.jackson:jackson-bom to v2.13.0 ([dba11b5](https://www.github.com/googleapis/java-shared-dependencies/commit/dba11b5fe14d39cdd62357e7bb1b82831c481150)) +* update dependency com.google.api-client:google-api-client-bom to v1.32.2 ([dba11b5](https://www.github.com/googleapis/java-shared-dependencies/commit/dba11b5fe14d39cdd62357e7bb1b82831c481150)) +* update dependency com.google.api:api-common to v2.0.5 ([dba11b5](https://www.github.com/googleapis/java-shared-dependencies/commit/dba11b5fe14d39cdd62357e7bb1b82831c481150)) +* update dependency com.google.auth:google-auth-library-bom to v1.2.1 ([dba11b5](https://www.github.com/googleapis/java-shared-dependencies/commit/dba11b5fe14d39cdd62357e7bb1b82831c481150)) +* update dependency com.google.guava:guava-bom to v31 ([#498](https://www.github.com/googleapis/java-shared-dependencies/issues/498)) ([dba11b5](https://www.github.com/googleapis/java-shared-dependencies/commit/dba11b5fe14d39cdd62357e7bb1b82831c481150)) +* update dependency com.google.http-client:google-http-client-bom to v1.40.1 ([dba11b5](https://www.github.com/googleapis/java-shared-dependencies/commit/dba11b5fe14d39cdd62357e7bb1b82831c481150)) +* update dependency com.google.protobuf:protobuf-bom to v3.18.1 ([#494](https://www.github.com/googleapis/java-shared-dependencies/issues/494)) ([a30e376](https://www.github.com/googleapis/java-shared-dependencies/commit/a30e3762b5fb0e2d31304d211c12eb2c1320f0c1)) +* update dependency io.grpc:grpc-bom to v1.41.0 ([#482](https://www.github.com/googleapis/java-shared-dependencies/issues/482)) ([8a7d227](https://www.github.com/googleapis/java-shared-dependencies/commit/8a7d227f2a1dab9ff23d247a4e6131c817804c36)) +* update gax.version to v2.6.1 ([dba11b5](https://www.github.com/googleapis/java-shared-dependencies/commit/dba11b5fe14d39cdd62357e7bb1b82831c481150)) +* update iam.version to v1.1.6 ([#485](https://www.github.com/googleapis/java-shared-dependencies/issues/485)) ([cef7e09](https://www.github.com/googleapis/java-shared-dependencies/commit/cef7e090bbc2e3ae775fa83505f98df286ba7d42)) + +## [2.3.0](https://www.github.com/googleapis/java-shared-dependencies/compare/2.2.1...v2.3.0) (2021-09-22) + + +### Dependencies + +* keep protobuf at 3.17.3 (not the latest 3.18.0) ([#476](https://www.github.com/googleapis/java-shared-dependencies/issues/476)) ([e207c81](https://www.github.com/googleapis/java-shared-dependencies/commit/e207c818f220967e3618d7a9d36f2cf26c07892e)) +* update gax.version to v2.5.0 ([#479](https://www.github.com/googleapis/java-shared-dependencies/issues/479)) ([e22e62a](https://www.github.com/googleapis/java-shared-dependencies/commit/e22e62a3b248023ae94da2a02ec50006377a5157)) +* update google.core.version to v2.1.4 ([#473](https://www.github.com/googleapis/java-shared-dependencies/issues/473)) ([116f278](https://www.github.com/googleapis/java-shared-dependencies/commit/116f2783dfc18f215905ceaff9f85f331f83472b)) +* update google.core.version to v2.1.6 ([#478](https://www.github.com/googleapis/java-shared-dependencies/issues/478)) ([9e09728](https://www.github.com/googleapis/java-shared-dependencies/commit/9e0972834764b25e5e194e0e805efc5453120df3)) +* update iam.version to v1.1.1 ([#470](https://www.github.com/googleapis/java-shared-dependencies/issues/470)) ([3b6e960](https://www.github.com/googleapis/java-shared-dependencies/commit/3b6e96050af8d976a30165481d764d8226143a39)) +* update iam.version to v1.1.2 ([#472](https://www.github.com/googleapis/java-shared-dependencies/issues/472)) ([85329cc](https://www.github.com/googleapis/java-shared-dependencies/commit/85329cc6c13d16fe2eeeb076959ee16a752c1f9e)) + +### [2.2.1](https://www.github.com/googleapis/java-shared-dependencies/compare/2.2.0...v2.2.1) (2021-09-13) + + +### Dependencies + +* update gax.version to v2.4.1 ([#464](https://www.github.com/googleapis/java-shared-dependencies/issues/464)) ([bc7c6d7](https://www.github.com/googleapis/java-shared-dependencies/commit/bc7c6d7ca161ebfa31895c375d65bca29d4c7336)) +* update google.core.version to v2.1.3 ([#465](https://www.github.com/googleapis/java-shared-dependencies/issues/465)) ([848f608](https://www.github.com/googleapis/java-shared-dependencies/commit/848f608ae850bd2dd80ec56034eb0c9a18f0415b)) + +## [2.2.0](https://www.github.com/googleapis/java-shared-dependencies/compare/2.1.0...v2.2.0) (2021-08-31) + + +### Dependencies + +* update dependency com.fasterxml.jackson:jackson-bom to v2.12.5 ([#456](https://www.github.com/googleapis/java-shared-dependencies/issues/456)) ([05b58e8](https://www.github.com/googleapis/java-shared-dependencies/commit/05b58e84ff6617bdcbb1ea644aa6e061bdea0319)) +* update dependency com.google.api:api-common to v2.0.2 ([#450](https://www.github.com/googleapis/java-shared-dependencies/issues/450)) ([51caebe](https://www.github.com/googleapis/java-shared-dependencies/commit/51caebe89bfade98866f63952bf82bc663a0179a)) +* update dependency com.google.http-client:google-http-client-bom to v1.40.0 ([#455](https://www.github.com/googleapis/java-shared-dependencies/issues/455)) ([82a5e42](https://www.github.com/googleapis/java-shared-dependencies/commit/82a5e42b06570a2c7c9d53b03161b110a44487a1)) +* update dependency com.google.oauth-client:google-oauth-client-bom to v1.32.1 ([#447](https://www.github.com/googleapis/java-shared-dependencies/issues/447)) ([9d2b895](https://www.github.com/googleapis/java-shared-dependencies/commit/9d2b8958f62daa6a3015a8ac052762fb3d79b35b)) +* update dependency io.grpc:grpc-bom to v1.40.1 ([#451](https://www.github.com/googleapis/java-shared-dependencies/issues/451)) ([df668ea](https://www.github.com/googleapis/java-shared-dependencies/commit/df668ead8830a40acf9d5605d47f93c465b779c0)) +* update gax.version to v2.4.0 ([#458](https://www.github.com/googleapis/java-shared-dependencies/issues/458)) ([a797d9e](https://www.github.com/googleapis/java-shared-dependencies/commit/a797d9eb8a4bcb3025a9511eae61271278a4a5c9)) +* update google.common-protos.version to v2.5.0 ([#457](https://www.github.com/googleapis/java-shared-dependencies/issues/457)) ([38c7bb9](https://www.github.com/googleapis/java-shared-dependencies/commit/38c7bb925414d90ff3065650d06589f79bcab9b6)) +* update google.core.version to v2.1.1 ([#449](https://www.github.com/googleapis/java-shared-dependencies/issues/449)) ([b28723a](https://www.github.com/googleapis/java-shared-dependencies/commit/b28723ace0c27ebc73f23a2d094e0fe9ba8a9075)) +* update google.core.version to v2.1.2 ([#459](https://www.github.com/googleapis/java-shared-dependencies/issues/459)) ([df4d5b7](https://www.github.com/googleapis/java-shared-dependencies/commit/df4d5b7717386f5e0e2cca87bd9afc56b2c7aee8)) +* update iam.version to v1.1.0 ([#448](https://www.github.com/googleapis/java-shared-dependencies/issues/448)) ([3967928](https://www.github.com/googleapis/java-shared-dependencies/commit/39679287f3ef8c1cbca5dfc8aca3f69cfee3d4a6)) + +## [2.1.0](https://www.github.com/googleapis/java-shared-dependencies/compare/2.0.1...v2.1.0) (2021-08-23) + + +### Dependencies + +* update dependency com.google.auth:google-auth-library-bom to v1.1.0 ([#439](https://www.github.com/googleapis/java-shared-dependencies/issues/439)) ([ca52bd9](https://www.github.com/googleapis/java-shared-dependencies/commit/ca52bd9c099c96bf7b5a57aa85d39b58a610c875)) +* update dependency com.google.cloud:google-cloud-core-bom to v2.1.0 ([#444](https://www.github.com/googleapis/java-shared-dependencies/issues/444)) ([ff914c6](https://www.github.com/googleapis/java-shared-dependencies/commit/ff914c6de9e3e7fa6ba75591d3d5077c5421827d)) +* update dependency com.google.code.gson:gson to v2.8.8 ([#442](https://www.github.com/googleapis/java-shared-dependencies/issues/442)) ([79a093f](https://www.github.com/googleapis/java-shared-dependencies/commit/79a093f9ccea4d47cf8b678570a1c9699029a8b2)) +* update dependency com.google.errorprone:error_prone_annotations to v2.9.0 ([#441](https://www.github.com/googleapis/java-shared-dependencies/issues/441)) ([e644a4b](https://www.github.com/googleapis/java-shared-dependencies/commit/e644a4b504ab8aa5771f9be36861d1730ea9bcc9)) +* update dependency io.grpc:grpc-bom to v1.40.0 ([#438](https://www.github.com/googleapis/java-shared-dependencies/issues/438)) ([c3f8fb4](https://www.github.com/googleapis/java-shared-dependencies/commit/c3f8fb4408f5dc6c7f7dc0e14f0c24fa755433a5)) +* update gax.version to v2.3.0 ([#437](https://www.github.com/googleapis/java-shared-dependencies/issues/437)) ([e59aaad](https://www.github.com/googleapis/java-shared-dependencies/commit/e59aaadd76e40ab5ea31c3e812686a4ba0471a49)) + +### [2.0.1](https://www.github.com/googleapis/java-shared-dependencies/compare/2.0.0...v2.0.1) (2021-08-11) + + +### Dependencies + +* update dependency com.google.api:api-common to v2.0.1 ([#431](https://www.github.com/googleapis/java-shared-dependencies/issues/431)) ([b1a52c8](https://www.github.com/googleapis/java-shared-dependencies/commit/b1a52c83e19be7be80086f2010e928171b046f62)) +* update gax.version to v2.1.0 ([#432](https://www.github.com/googleapis/java-shared-dependencies/issues/432)) ([7f53006](https://www.github.com/googleapis/java-shared-dependencies/commit/7f53006d021e839f52325a87d7c4715eff88818d)) +* update google.core.version to v2.0.4 ([#430](https://www.github.com/googleapis/java-shared-dependencies/issues/430)) ([d0465ad](https://www.github.com/googleapis/java-shared-dependencies/commit/d0465ad3a79993d4e854078ea992e53ab9add07f)) +* update google.core.version to v2.0.5 ([#434](https://www.github.com/googleapis/java-shared-dependencies/issues/434)) ([af00753](https://www.github.com/googleapis/java-shared-dependencies/commit/af0075390034cba5cefede8260ab03f728d525a8)) + +## [2.0.0](https://www.github.com/googleapis/java-shared-dependencies/compare/1.4.0...v2.0.0) (2021-08-03) + + +### ⚠ BREAKING CHANGES + +* promote to 2.0.0 (#428) + +### Features + +* promote to 2.0.0 ([#428](https://www.github.com/googleapis/java-shared-dependencies/issues/428)) ([4db31f2](https://www.github.com/googleapis/java-shared-dependencies/commit/4db31f29f1668d4743e8af8996b0c4b30e6831b3)) + + +### Documentation + +* we don't use this as a parent pom ([#407](https://www.github.com/googleapis/java-shared-dependencies/issues/407)) ([4c86aaf](https://www.github.com/googleapis/java-shared-dependencies/commit/4c86aafc05097b6702056f5cb37736127b6df306)) + + +### Dependencies + +* update dependency com.fasterxml.jackson:jackson-bom to v2.12.4 ([#398](https://www.github.com/googleapis/java-shared-dependencies/issues/398)) ([f0d49b5](https://www.github.com/googleapis/java-shared-dependencies/commit/f0d49b54ba334f9351c66c9924e3d0d2ed7c0016)) +* update dependency com.google.api:api-common to v1.10.6 ([#411](https://www.github.com/googleapis/java-shared-dependencies/issues/411)) ([79801b5](https://www.github.com/googleapis/java-shared-dependencies/commit/79801b5fee08a8c97e275ed3674ab6c83b204a90)) +* update dependency com.google.api:api-common to v2 ([#414](https://www.github.com/googleapis/java-shared-dependencies/issues/414)) ([17f6e68](https://www.github.com/googleapis/java-shared-dependencies/commit/17f6e68a2792843dd41d3877c095e97c052c5ac0)) +* update dependency com.google.auth:google-auth-library-bom to v0.27.0 ([#400](https://www.github.com/googleapis/java-shared-dependencies/issues/400)) ([0d5a95b](https://www.github.com/googleapis/java-shared-dependencies/commit/0d5a95b84076684f84b0fdbb93a706113f44457d)) +* update dependency com.google.auth:google-auth-library-bom to v1 ([#413](https://www.github.com/googleapis/java-shared-dependencies/issues/413)) ([94897d3](https://www.github.com/googleapis/java-shared-dependencies/commit/94897d30bb1cac0059e272b058f6221fb7e4733f)) +* update dependency com.google.cloud:grpc-gcp to v1.1.0 ([#403](https://www.github.com/googleapis/java-shared-dependencies/issues/403)) ([3cc59f1](https://www.github.com/googleapis/java-shared-dependencies/commit/3cc59f15ebb31a7f97c9f3d78057022afabe75e9)) +* update dependency com.google.errorprone:error_prone_annotations to v2.8.0 ([#406](https://www.github.com/googleapis/java-shared-dependencies/issues/406)) ([2905787](https://www.github.com/googleapis/java-shared-dependencies/commit/29057879adeda8bc40a903ef3b5feafc83c3d972)) +* update dependency com.google.errorprone:error_prone_annotations to v2.8.1 ([#426](https://www.github.com/googleapis/java-shared-dependencies/issues/426)) ([853b68b](https://www.github.com/googleapis/java-shared-dependencies/commit/853b68b16c88c3abb745ee1f71ba4bb317cbc680)) +* update gax.version to v1.67.0 ([#405](https://www.github.com/googleapis/java-shared-dependencies/issues/405)) ([632dcd0](https://www.github.com/googleapis/java-shared-dependencies/commit/632dcd0a9f10b034a2a2ec92c7c3413490dd2a03)) +* update gax.version to v2 (major) ([#418](https://www.github.com/googleapis/java-shared-dependencies/issues/418)) ([670a9e0](https://www.github.com/googleapis/java-shared-dependencies/commit/670a9e0a9588a7e592eb5dd8c0cb9ab08e07293e)) +* update google.core.version to v1.96.1 ([#417](https://www.github.com/googleapis/java-shared-dependencies/issues/417)) ([49db9cb](https://www.github.com/googleapis/java-shared-dependencies/commit/49db9cb473c8d3d794ad57a41cfc223239482174)) +* update google.core.version to v2 (major) ([#427](https://www.github.com/googleapis/java-shared-dependencies/issues/427)) ([8cc7a92](https://www.github.com/googleapis/java-shared-dependencies/commit/8cc7a922cc3ba10a157e3649d7a783bbbcbee010)) +* update guava to 30.1.1-jre ([#423](https://www.github.com/googleapis/java-shared-dependencies/issues/423)) ([94aca59](https://www.github.com/googleapis/java-shared-dependencies/commit/94aca597804d7b45aae22811b277c44281e62d64)) + +## [1.4.0](https://www.github.com/googleapis/java-shared-dependencies/compare/1.3.0...v1.4.0) (2021-06-30) + + +### Features + +* add grpc-gcp to dependencyManagement ([#389](https://www.github.com/googleapis/java-shared-dependencies/issues/389)) ([57fd2e6](https://www.github.com/googleapis/java-shared-dependencies/commit/57fd2e646e28e37e0b5e4e1b37425d4897a8776f)) + + +### Bug Fixes + +* Add `shopt -s nullglob` to dependencies script ([#392](https://www.github.com/googleapis/java-shared-dependencies/issues/392)) ([f8f29df](https://www.github.com/googleapis/java-shared-dependencies/commit/f8f29df1c9cc6eca517c99113fb9509fd611ac92)) +* Add common httpclient and oauth dependencies ([#391](https://www.github.com/googleapis/java-shared-dependencies/issues/391)) ([09660e1](https://www.github.com/googleapis/java-shared-dependencies/commit/09660e1e50c96dcd7df4e80d8ad357f8256eda6c)) +* Update dependencies.sh to not break on mac ([#384](https://www.github.com/googleapis/java-shared-dependencies/issues/384)) ([0ae2841](https://www.github.com/googleapis/java-shared-dependencies/commit/0ae2841d7ce2885d041795c58a38d2d3973c2e5a)) + + +### Dependencies + +* update dependency com.google.api-client:google-api-client-bom to v1.32.1 ([#390](https://www.github.com/googleapis/java-shared-dependencies/issues/390)) ([00288c1](https://www.github.com/googleapis/java-shared-dependencies/commit/00288c18d09616582c8bec961ecc5c00ef1d4288)) +* update dependency com.google.api:api-common to v1.10.4 ([#385](https://www.github.com/googleapis/java-shared-dependencies/issues/385)) ([5f2b39b](https://www.github.com/googleapis/java-shared-dependencies/commit/5f2b39b5bdc4cec9d5ab2f050e11000ed372d057)) +* update dependency com.google.api:gax-grpc to v1.65.1 ([#382](https://www.github.com/googleapis/java-shared-dependencies/issues/382)) ([a2a1547](https://www.github.com/googleapis/java-shared-dependencies/commit/a2a15471dee21207a0b97b3bc8f6f59d6a4a2d13)) +* update dependency com.google.protobuf:protobuf-bom to v3.17.3 ([#379](https://www.github.com/googleapis/java-shared-dependencies/issues/379)) ([6f43eb5](https://www.github.com/googleapis/java-shared-dependencies/commit/6f43eb553dca98140d343bee3f1003096d79ee6c)) +* update dependency io.grpc:grpc-bom to v1.38.1 ([#386](https://www.github.com/googleapis/java-shared-dependencies/issues/386)) ([7b1d4cf](https://www.github.com/googleapis/java-shared-dependencies/commit/7b1d4cf317fbd75b91d6a63f82b5fc2f46eaf3ca)) +* update dependency io.grpc:grpc-bom to v1.39.0 ([#394](https://www.github.com/googleapis/java-shared-dependencies/issues/394)) ([ebc8af6](https://www.github.com/googleapis/java-shared-dependencies/commit/ebc8af6b3f850b58b35d9720a7a0b1545d4616bd)) +* update gax.version to v1.66.0 ([#395](https://www.github.com/googleapis/java-shared-dependencies/issues/395)) ([c73f73e](https://www.github.com/googleapis/java-shared-dependencies/commit/c73f73e84740a8117be342a66e179eaf3e29c6fd)) +* update google.core.version to v1.95.1 ([#381](https://www.github.com/googleapis/java-shared-dependencies/issues/381)) ([4496153](https://www.github.com/googleapis/java-shared-dependencies/commit/44961532f621b0ab19e9e7feebb7d588aef5d423)) +* update google.core.version to v1.95.2 ([#383](https://www.github.com/googleapis/java-shared-dependencies/issues/383)) ([7216859](https://www.github.com/googleapis/java-shared-dependencies/commit/7216859bcd67fa1ce1119831c33c50a2d5b79324)) +* update google.core.version to v1.95.3 ([#388](https://www.github.com/googleapis/java-shared-dependencies/issues/388)) ([354e4e8](https://www.github.com/googleapis/java-shared-dependencies/commit/354e4e811f4ba886406681a4261ac0455a9eb2d2)) +* update google.core.version to v1.95.4 ([#393](https://www.github.com/googleapis/java-shared-dependencies/issues/393)) ([be78ad8](https://www.github.com/googleapis/java-shared-dependencies/commit/be78ad85e31d8876eabafee7aa8242712573cb46)) + +## [1.3.0](https://www.github.com/googleapis/java-shared-dependencies/compare/1.2.0...v1.3.0) (2021-06-03) + + +### Features + +* add `gcf-owl-bot[bot]` to `ignoreAuthors` ([#365](https://www.github.com/googleapis/java-shared-dependencies/issues/365)) ([7e8309b](https://www.github.com/googleapis/java-shared-dependencies/commit/7e8309bf67ade0fe2b09f792848136cd88b4d2e4)) + + +### Dependencies + +* update dependency com.google.auth:google-auth-library-bom to v0.26.0 ([#368](https://www.github.com/googleapis/java-shared-dependencies/issues/368)) ([38256a8](https://www.github.com/googleapis/java-shared-dependencies/commit/38256a82cb6896c3f5e5ea6ca5d8d671c412bf84)) +* update dependency com.google.cloud:google-cloud-core-bom to v1.95.0 ([#377](https://www.github.com/googleapis/java-shared-dependencies/issues/377)) ([297ea62](https://www.github.com/googleapis/java-shared-dependencies/commit/297ea621e02f8c0679c8b07ed399d11eaacecc14)) +* update dependency com.google.code.gson:gson to v2.8.7 ([#370](https://www.github.com/googleapis/java-shared-dependencies/issues/370)) ([cdc1b8e](https://www.github.com/googleapis/java-shared-dependencies/commit/cdc1b8ea1c93f97b712081ca8dc8ea57f342b69e)) +* update dependency com.google.protobuf:protobuf-bom to v3.17.1 ([#369](https://www.github.com/googleapis/java-shared-dependencies/issues/369)) ([5a19574](https://www.github.com/googleapis/java-shared-dependencies/commit/5a19574bc626bb3c6b573ed1d177e8907188dec1)) +* update dependency com.google.protobuf:protobuf-bom to v3.17.2 ([#374](https://www.github.com/googleapis/java-shared-dependencies/issues/374)) ([83516e6](https://www.github.com/googleapis/java-shared-dependencies/commit/83516e691b99e5e5d22d27e561781a5ade5fb514)) +* update dependency io.grpc:grpc-bom to v1.38.0 ([#364](https://www.github.com/googleapis/java-shared-dependencies/issues/364)) ([00db570](https://www.github.com/googleapis/java-shared-dependencies/commit/00db5701c3b0aa609f3778c06911a9a0248ca342)) +* update gax.version to v1.65.0 ([#376](https://www.github.com/googleapis/java-shared-dependencies/issues/376)) ([b793a0d](https://www.github.com/googleapis/java-shared-dependencies/commit/b793a0d7744ff1b0f8ae5d3d13ec4776ae8d3089)) +* update google.common-protos.version to v2.3.1 ([#366](https://www.github.com/googleapis/java-shared-dependencies/issues/366)) ([7d6a7fa](https://www.github.com/googleapis/java-shared-dependencies/commit/7d6a7fa7a2cad2b3f2ecf45e42d2ed5db0b60a43)) +* update google.common-protos.version to v2.3.2 ([#375](https://www.github.com/googleapis/java-shared-dependencies/issues/375)) ([68a47ad](https://www.github.com/googleapis/java-shared-dependencies/commit/68a47ad3243f3e980db74c9c8505a1b3063c131b)) + +## [1.2.0](https://www.github.com/googleapis/java-shared-dependencies/compare/1.1.0...v1.2.0) (2021-05-18) + + +### Dependencies + +* update dependency com.google.api-client:google-api-client-bom to v1.31.5 ([#353](https://www.github.com/googleapis/java-shared-dependencies/issues/353)) ([8d72ab0](https://www.github.com/googleapis/java-shared-dependencies/commit/8d72ab003e08c864aedc17fc190ba26f393bf0c7)) +* update dependency com.google.errorprone:error_prone_annotations to v2.7.1 ([#360](https://www.github.com/googleapis/java-shared-dependencies/issues/360)) ([8f952d0](https://www.github.com/googleapis/java-shared-dependencies/commit/8f952d05745358fc426a1a2dcb688da5d5010239)) +* update dependency com.google.protobuf:protobuf-bom to v3.17.0 ([#355](https://www.github.com/googleapis/java-shared-dependencies/issues/355)) ([09858fb](https://www.github.com/googleapis/java-shared-dependencies/commit/09858fb4f1b78a77e828501597d20df4db0ebfcf)) +* update dependency io.grpc:grpc-bom to v1.37.1 ([#359](https://www.github.com/googleapis/java-shared-dependencies/issues/359)) ([bc9869e](https://www.github.com/googleapis/java-shared-dependencies/commit/bc9869e914314f951afd69f2acae95c414398f43)) +* update google.common-protos.version to v2.2.1 ([#358](https://www.github.com/googleapis/java-shared-dependencies/issues/358)) ([a3ed764](https://www.github.com/googleapis/java-shared-dependencies/commit/a3ed764a0e5143ee323d4b69c9747b8265d349e2)) +* update iam.version to v1.0.14 ([#352](https://www.github.com/googleapis/java-shared-dependencies/issues/352)) ([bea9a01](https://www.github.com/googleapis/java-shared-dependencies/commit/bea9a01788ac1332a4bc7e06574ef5701700fe90)) + +## [1.1.0](https://www.github.com/googleapis/java-shared-dependencies/compare/1.0.0...v1.1.0) (2021-05-10) + + +### Dependencies + +* update dependency com.google.protobuf:protobuf-bom to v3.16.0 ([#348](https://www.github.com/googleapis/java-shared-dependencies/issues/348)) ([0aacfde](https://www.github.com/googleapis/java-shared-dependencies/commit/0aacfdeec70e30803734db8287c47e4fad5481ef)) +* update gax.version to v1.64.0 ([#345](https://www.github.com/googleapis/java-shared-dependencies/issues/345)) ([478bd35](https://www.github.com/googleapis/java-shared-dependencies/commit/478bd35296293e81c7e70157f50bfbebdc1bb54d)) +* update iam.version to v1.0.13 ([#343](https://www.github.com/googleapis/java-shared-dependencies/issues/343)) ([3637923](https://www.github.com/googleapis/java-shared-dependencies/commit/363792392b71deff5cc5731104b631122fba5e61)) + +## [1.0.0](https://www.github.com/googleapis/java-shared-dependencies/compare/0.21.1...v1.0.0) (2021-04-23) + + +### Features + +* promote to 1.0.0 ([#341](https://www.github.com/googleapis/java-shared-dependencies/issues/341)) ([eddce7b](https://www.github.com/googleapis/java-shared-dependencies/commit/eddce7bda196d757c0bb93a05574cc742e3d7ff6)) + + +### Dependencies + +* update dependency com.google.api:api-common to v1.10.3 ([#340](https://www.github.com/googleapis/java-shared-dependencies/issues/340)) ([6a7fc33](https://www.github.com/googleapis/java-shared-dependencies/commit/6a7fc33548c199d5f310b3ee5024907882d22726)) +* update dependency com.google.auth:google-auth-library-bom to v0.25.4 ([#334](https://www.github.com/googleapis/java-shared-dependencies/issues/334)) ([e5c747d](https://www.github.com/googleapis/java-shared-dependencies/commit/e5c747d245194effc258ae706e7764153010cd53)) +* update dependency com.google.auth:google-auth-library-bom to v0.25.5 ([#338](https://www.github.com/googleapis/java-shared-dependencies/issues/338)) ([ffa1df5](https://www.github.com/googleapis/java-shared-dependencies/commit/ffa1df5497b5365f520b665a202b8caf6521fc9d)) +* update dependency org.threeten:threetenbp to v1.5.1 ([#335](https://www.github.com/googleapis/java-shared-dependencies/issues/335)) ([c8c6df4](https://www.github.com/googleapis/java-shared-dependencies/commit/c8c6df48e7f80944544939e502f4f08543af2631)) +* update google.core.version to v1.94.8 ([#342](https://www.github.com/googleapis/java-shared-dependencies/issues/342)) ([d946dd2](https://www.github.com/googleapis/java-shared-dependencies/commit/d946dd2299aac32f969a2226a1391e1e73f00e62)) + +### [0.21.1](https://www.github.com/googleapis/java-shared-dependencies/compare/0.21.0...v0.21.1) (2021-04-19) + + +### Bug Fixes + +* release scripts from issuing overlapping phases ([#332](https://www.github.com/googleapis/java-shared-dependencies/issues/332)) ([e289825](https://www.github.com/googleapis/java-shared-dependencies/commit/e289825a3bc45b4796db7ce4347f8d9d9251a410)) + + +### Dependencies + +* update dependency com.fasterxml.jackson:jackson-bom to v2.12.3 ([#329](https://www.github.com/googleapis/java-shared-dependencies/issues/329)) ([a77b4fc](https://www.github.com/googleapis/java-shared-dependencies/commit/a77b4fcc2ea5caf366c76a4698bac6d4c9abc92e)) +* update dependency com.google.api-client:google-api-client-bom to v1.31.4 ([#326](https://www.github.com/googleapis/java-shared-dependencies/issues/326)) ([409d24f](https://www.github.com/googleapis/java-shared-dependencies/commit/409d24f8a0cac30e41ca45eb2711aecb335d70dd)) +* update dependency com.google.auth:google-auth-library-bom to v0.25.3 ([#328](https://www.github.com/googleapis/java-shared-dependencies/issues/328)) ([88cfc08](https://www.github.com/googleapis/java-shared-dependencies/commit/88cfc08952881200e23ed95cfa2eebad85ec7ab3)) +* update google.core.version to v1.94.7 ([#324](https://www.github.com/googleapis/java-shared-dependencies/issues/324)) ([0412c88](https://www.github.com/googleapis/java-shared-dependencies/commit/0412c88468940c1182bc0761bfe269a6688fe7b7)) +* update iam.version to v1.0.12 ([#327](https://www.github.com/googleapis/java-shared-dependencies/issues/327)) ([548d5f5](https://www.github.com/googleapis/java-shared-dependencies/commit/548d5f53c4f264f1cbb9ca72fdfe4608ab16b480)) + +## [0.21.0](https://www.github.com/googleapis/java-shared-dependencies/compare/0.20.1...v0.21.0) (2021-04-09) + + +### Dependencies + +* update dependency com.google.auth:google-auth-library-bom to v0.25.0 ([#310](https://www.github.com/googleapis/java-shared-dependencies/issues/310)) ([8f3a0f0](https://www.github.com/googleapis/java-shared-dependencies/commit/8f3a0f002b787f7b27cfe031654fa20bf342f839)) +* update dependency com.google.auth:google-auth-library-bom to v0.25.2 ([#311](https://www.github.com/googleapis/java-shared-dependencies/issues/311)) ([6c47a3e](https://www.github.com/googleapis/java-shared-dependencies/commit/6c47a3edbd9da04ba255487a66c0f3a41393217d)) +* update dependency com.google.errorprone:error_prone_annotations to v2.6.0 ([#315](https://www.github.com/googleapis/java-shared-dependencies/issues/315)) ([dc254ca](https://www.github.com/googleapis/java-shared-dependencies/commit/dc254ca7359b68fe9411f7b96130ffb416b45c6f)) +* update dependency com.google.http-client:google-http-client-bom to v1.39.1 ([#309](https://www.github.com/googleapis/java-shared-dependencies/issues/309)) ([37225e2](https://www.github.com/googleapis/java-shared-dependencies/commit/37225e2d1b32a618765391720b57ff29e7b8f7f9)) +* update dependency com.google.http-client:google-http-client-bom to v1.39.2 ([#321](https://www.github.com/googleapis/java-shared-dependencies/issues/321)) ([273c66d](https://www.github.com/googleapis/java-shared-dependencies/commit/273c66d374f7cd6040aac2f302fd1c1dc0f4a1c0)) +* update dependency com.google.protobuf:protobuf-bom to v3.15.6 ([#308](https://www.github.com/googleapis/java-shared-dependencies/issues/308)) ([b29dd05](https://www.github.com/googleapis/java-shared-dependencies/commit/b29dd0535f02b56607f64ba69e85d4d468902789)) +* update dependency com.google.protobuf:protobuf-bom to v3.15.7 ([#316](https://www.github.com/googleapis/java-shared-dependencies/issues/316)) ([9c00d77](https://www.github.com/googleapis/java-shared-dependencies/commit/9c00d7753c1f7b963deb9ad69dcfe24ba28da5a2)) +* update dependency com.google.protobuf:protobuf-bom to v3.15.8 ([#319](https://www.github.com/googleapis/java-shared-dependencies/issues/319)) ([15e5ae2](https://www.github.com/googleapis/java-shared-dependencies/commit/15e5ae2ef46eedcd790ffd8644677d36db5c63f9)) +* update dependency io.grpc:grpc-bom to v1.37.0 ([#313](https://www.github.com/googleapis/java-shared-dependencies/issues/313)) ([c599351](https://www.github.com/googleapis/java-shared-dependencies/commit/c5993511c7305e1ced42d73552a93a25dc5e1ac1)) +* update gax.version to v1.63.0 ([#318](https://www.github.com/googleapis/java-shared-dependencies/issues/318)) ([ba709da](https://www.github.com/googleapis/java-shared-dependencies/commit/ba709da6fb0e9bcfc83e663588336598737b46e4)) +* update google.core.version to v1.94.4 ([#305](https://www.github.com/googleapis/java-shared-dependencies/issues/305)) ([0d38f4c](https://www.github.com/googleapis/java-shared-dependencies/commit/0d38f4c9ffadcfd9446712b8bf0729399b0c9e91)) +* update google.core.version to v1.94.5 ([#320](https://www.github.com/googleapis/java-shared-dependencies/issues/320)) ([3439721](https://www.github.com/googleapis/java-shared-dependencies/commit/3439721da83a8b92d9c4b6ecfd158cfb1e1a0503)) +* update guava to 30.1.1-android ([#322](https://www.github.com/googleapis/java-shared-dependencies/issues/322)) ([a6b5d3b](https://www.github.com/googleapis/java-shared-dependencies/commit/a6b5d3b8ccfc352bf0d1678952ce3cd8b7a8361e)) +* update iam.version to v1.0.11 ([#304](https://www.github.com/googleapis/java-shared-dependencies/issues/304)) ([95a5264](https://www.github.com/googleapis/java-shared-dependencies/commit/95a526442b3d24c83782523d38dd3931e828d757)) + +### [0.20.1](https://www.github.com/googleapis/java-shared-dependencies/compare/0.20.0...v0.20.1) (2021-03-09) + + +### Dependencies + +* update dependency com.fasterxml.jackson:jackson-bom to v2.12.2 ([#301](https://www.github.com/googleapis/java-shared-dependencies/issues/301)) ([7c01eba](https://www.github.com/googleapis/java-shared-dependencies/commit/7c01ebabb6fd65b7404e56651b0ba27f505bb033)) +* update dependency com.google.api-client:google-api-client-bom to v1.31.3 ([#295](https://www.github.com/googleapis/java-shared-dependencies/issues/295)) ([a0774e9](https://www.github.com/googleapis/java-shared-dependencies/commit/a0774e9d62d00614142bc4c14214a83dda66d4ad)) +* update dependency com.google.api.grpc:grpc-google-iam-v1 to v1.0.10 ([#292](https://www.github.com/googleapis/java-shared-dependencies/issues/292)) ([b629789](https://www.github.com/googleapis/java-shared-dependencies/commit/b629789e3a1cc9a7308b829c034b09b06e24fc07)) +* update dependency com.google.auth:google-auth-library-bom to v0.24.1 ([#293](https://www.github.com/googleapis/java-shared-dependencies/issues/293)) ([d85ec34](https://www.github.com/googleapis/java-shared-dependencies/commit/d85ec347ccdd14dfdab10d365d2c2f8df3035e4d)) +* update dependency com.google.protobuf:protobuf-bom to v3.15.3 ([#294](https://www.github.com/googleapis/java-shared-dependencies/issues/294)) ([58c01aa](https://www.github.com/googleapis/java-shared-dependencies/commit/58c01aa076e2c4954986185f913bac2c51a1e6fb)) +* update dependency com.google.protobuf:protobuf-bom to v3.15.5 ([#302](https://www.github.com/googleapis/java-shared-dependencies/issues/302)) ([e9d5e6e](https://www.github.com/googleapis/java-shared-dependencies/commit/e9d5e6ee6039915da186315ceada673ac37b88d3)) +* update google.core.version to v1.94.2 ([#296](https://www.github.com/googleapis/java-shared-dependencies/issues/296)) ([af83b90](https://www.github.com/googleapis/java-shared-dependencies/commit/af83b901be0c03d507189999215d35345602fad7)) +* update google.core.version to v1.94.3 ([#300](https://www.github.com/googleapis/java-shared-dependencies/issues/300)) ([3e73176](https://www.github.com/googleapis/java-shared-dependencies/commit/3e73176af0b07dfe621163b301174b5b5820dfa2)) + +## [0.20.0](https://www.github.com/googleapis/java-shared-dependencies/compare/0.19.0...v0.20.0) (2021-02-25) + + +### Dependencies + +* update dependency com.google.auth:google-auth-library-bom to v0.24.0 ([#284](https://www.github.com/googleapis/java-shared-dependencies/issues/284)) ([5e4914c](https://www.github.com/googleapis/java-shared-dependencies/commit/5e4914cc4a8ccd41a219f150a7455da116d1594b)) +* update dependency com.google.http-client:google-http-client-bom to v1.39.0 ([#288](https://www.github.com/googleapis/java-shared-dependencies/issues/288)) ([70bb862](https://www.github.com/googleapis/java-shared-dependencies/commit/70bb862029b840fbd99ba0109fa2b8f585812793)) +* update dependency com.google.protobuf:protobuf-bom to v3.15.1 ([#282](https://www.github.com/googleapis/java-shared-dependencies/issues/282)) ([44283bd](https://www.github.com/googleapis/java-shared-dependencies/commit/44283bdfdc9288b4a8d16b6ed3a61541792d147e)) +* update dependency com.google.protobuf:protobuf-bom to v3.15.2 ([#287](https://www.github.com/googleapis/java-shared-dependencies/issues/287)) ([bdae560](https://www.github.com/googleapis/java-shared-dependencies/commit/bdae5600f9033219ef8beb6c4d1c521fb062eaec)) +* update dependency io.grpc:grpc-bom to v1.36.0 ([#285](https://www.github.com/googleapis/java-shared-dependencies/issues/285)) ([c59771b](https://www.github.com/googleapis/java-shared-dependencies/commit/c59771b2436ac1a4fbc92b48049900472dd6d3ff)) +* update gax.version to v1.62.0 ([#291](https://www.github.com/googleapis/java-shared-dependencies/issues/291)) ([66bd070](https://www.github.com/googleapis/java-shared-dependencies/commit/66bd0702bd3deb64e0f6c73635e0ffd51a4d637e)) +* update google.common-protos.version to v2.1.0 ([#289](https://www.github.com/googleapis/java-shared-dependencies/issues/289)) ([43c9f02](https://www.github.com/googleapis/java-shared-dependencies/commit/43c9f026b1fa82f38dcb93b902281c2559e82d8e)) +* update iam.version to v1.0.9 ([#281](https://www.github.com/googleapis/java-shared-dependencies/issues/281)) ([ee44d0b](https://www.github.com/googleapis/java-shared-dependencies/commit/ee44d0b41e101931ccf5de2561dfcfcc9ff88b88)) + +## [0.19.0](https://www.github.com/googleapis/java-shared-dependencies/compare/0.18.0...v0.19.0) (2021-02-19) + + +### Bug Fixes + +* update repo name ([#274](https://www.github.com/googleapis/java-shared-dependencies/issues/274)) ([4a98470](https://www.github.com/googleapis/java-shared-dependencies/commit/4a98470b7493c98137191b7bb3cabca23f98628f)) + + +### Dependencies + +* downgrade opencensus version back to 0.28.0 ([#265](https://www.github.com/googleapis/java-shared-dependencies/issues/265)) ([f37025c](https://www.github.com/googleapis/java-shared-dependencies/commit/f37025c70f951b1e34904ee983815c0ed8ec4086)) +* update dependency com.google.api-client:google-api-client-bom to v1.31.2 ([#254](https://www.github.com/googleapis/java-shared-dependencies/issues/254)) ([1b0b4a6](https://www.github.com/googleapis/java-shared-dependencies/commit/1b0b4a637cae0c22cd0336c527002025780317d5)) +* update dependency com.google.auth:google-auth-library-bom to v0.23.0 ([#261](https://www.github.com/googleapis/java-shared-dependencies/issues/261)) ([1c0b7bd](https://www.github.com/googleapis/java-shared-dependencies/commit/1c0b7bd60b3d73c16cc6c19ab90d8ccedece3706)) +* update dependency com.google.cloud:google-cloud-core to v1.94.1 ([#272](https://www.github.com/googleapis/java-shared-dependencies/issues/272)) ([44fd4c3](https://www.github.com/googleapis/java-shared-dependencies/commit/44fd4c3c6cae98bd514525f03462b830050828a8)) +* update dependency com.google.errorprone:error_prone_annotations to v2.5.1 ([#255](https://www.github.com/googleapis/java-shared-dependencies/issues/255)) ([6367023](https://www.github.com/googleapis/java-shared-dependencies/commit/63670233424e8f24c3924bba5e2cb6ca97525795)) +* update dependency com.google.http-client:google-http-client-bom to v1.38.1 ([#253](https://www.github.com/googleapis/java-shared-dependencies/issues/253)) ([ad87c74](https://www.github.com/googleapis/java-shared-dependencies/commit/ad87c74d9d893726042156d65850806d92e79952)) +* update dependency com.google.protobuf:protobuf-bom to v3.15.0 ([#278](https://www.github.com/googleapis/java-shared-dependencies/issues/278)) ([989efbd](https://www.github.com/googleapis/java-shared-dependencies/commit/989efbd29bcf4135f7abce49a697303df2cf1a60)) +* update dependency io.grpc:grpc-bom to v1.35.0 ([#248](https://www.github.com/googleapis/java-shared-dependencies/issues/248)) ([7a28c6e](https://www.github.com/googleapis/java-shared-dependencies/commit/7a28c6e7053c181993b1288adcae56de89312113)) +* update gax.version to v1.61.0 ([#277](https://www.github.com/googleapis/java-shared-dependencies/issues/277)) ([f1c3fb9](https://www.github.com/googleapis/java-shared-dependencies/commit/f1c3fb9295f2e1c130b9fc329faa60f4f8474ba6)) +* update iam.version to v1.0.7 ([#252](https://www.github.com/googleapis/java-shared-dependencies/issues/252)) ([5cb3ed9](https://www.github.com/googleapis/java-shared-dependencies/commit/5cb3ed906537269cd7f8d9ccf4b065754b5f5b48)) +* update iam.version to v1.0.8 ([#273](https://www.github.com/googleapis/java-shared-dependencies/issues/273)) ([4d5e7f7](https://www.github.com/googleapis/java-shared-dependencies/commit/4d5e7f720d847918b307a83c95cea10c244ba595)) + +## [0.18.0](https://www.github.com/googleapis/java-shared-dependencies/compare/0.17.1...v0.18.0) (2021-01-13) + + +### Features + +* add commons-codec to dependencyManagement ([#251](https://www.github.com/googleapis/java-shared-dependencies/issues/251)) ([4ee990d](https://www.github.com/googleapis/java-shared-dependencies/commit/4ee990d79c9207c81155f6ee9279308a2d4d0f9d)) + + +### Dependencies + +* update dependency com.google.errorprone:error_prone_annotations to v2.5.0 ([#247](https://www.github.com/googleapis/java-shared-dependencies/issues/247)) ([37c0861](https://www.github.com/googleapis/java-shared-dependencies/commit/37c0861cfb89f13a0682c98067c633b13b30b827)) + +### [0.17.1](https://www.github.com/googleapis/java-shared-dependencies/compare/0.17.0...v0.17.1) (2021-01-12) + + +### Dependencies + +* update dependency com.fasterxml.jackson:jackson-bom to v2.12.1 ([#245](https://www.github.com/googleapis/java-shared-dependencies/issues/245)) ([5ffc8a0](https://www.github.com/googleapis/java-shared-dependencies/commit/5ffc8a0d173ea0222ac9610ece0ac2aeb1d17f27)) + +## [0.17.0](https://www.github.com/googleapis/java-shared-dependencies/compare/0.16.1...v0.17.0) (2020-12-15) + + +### Dependencies + +* update dependency com.google.guava:guava-bom to v30.1-android ([#236](https://www.github.com/googleapis/java-shared-dependencies/issues/236)) ([78ebf7f](https://www.github.com/googleapis/java-shared-dependencies/commit/78ebf7fcec3ec0308ccd5103b719f02dde7ec6d8)) +* update dependency io.grpc:grpc-bom to v1.34.1 ([#238](https://www.github.com/googleapis/java-shared-dependencies/issues/238)) ([ee7e020](https://www.github.com/googleapis/java-shared-dependencies/commit/ee7e020a4631f2b288d1c6f5d681423d156e3c2d)) +* update iam.version to v1.0.5 ([#237](https://www.github.com/googleapis/java-shared-dependencies/issues/237)) ([bbe6be6](https://www.github.com/googleapis/java-shared-dependencies/commit/bbe6be650a93cf365f2439ae9c8bebf2ade83ddd)) + +### [0.16.1](https://www.github.com/googleapis/java-shared-dependencies/compare/0.16.0...v0.16.1) (2020-12-14) + + +### Dependencies + +* rollback gRPC to 1.33.1 ([#234](https://www.github.com/googleapis/java-shared-dependencies/issues/234)) ([67cc384](https://www.github.com/googleapis/java-shared-dependencies/commit/67cc384bacab8592d5bbc92db2469affee473eb7)) +* update dependency com.google.auth:google-auth-library-bom to v0.22.1 ([#229](https://www.github.com/googleapis/java-shared-dependencies/issues/229)) ([1c13161](https://www.github.com/googleapis/java-shared-dependencies/commit/1c13161fa289cd5f3923f389fd5b14f3b7b4a84d)) +* update dependency com.google.auth:google-auth-library-bom to v0.22.2 ([#235](https://www.github.com/googleapis/java-shared-dependencies/issues/235)) ([67434eb](https://www.github.com/googleapis/java-shared-dependencies/commit/67434eb4bb0789abcabb3055155672b2c2e70125)) +* update iam.version to v1.0.4 ([#231](https://www.github.com/googleapis/java-shared-dependencies/issues/231)) ([5edf99e](https://www.github.com/googleapis/java-shared-dependencies/commit/5edf99e0149a1b70eb52b8921e9eb04fb84d9160)) + +## [0.16.0](https://www.github.com/googleapis/java-shared-dependencies/compare/0.15.0...v0.16.0) (2020-12-02) + + +### Dependencies + +* update dependency com.fasterxml.jackson:jackson-bom to v2.12.0 ([#225](https://www.github.com/googleapis/java-shared-dependencies/issues/225)) ([b78a1ef](https://www.github.com/googleapis/java-shared-dependencies/commit/b78a1ef83ad946b0d29cd0dff46e48fbde44d120)) +* update dependency com.google.api-client:google-api-client-bom to v1.31.1 ([#215](https://www.github.com/googleapis/java-shared-dependencies/issues/215)) ([08d643a](https://www.github.com/googleapis/java-shared-dependencies/commit/08d643aaf289984b87d734274830712af82585b6)) +* update dependency com.google.protobuf:protobuf-bom to v3.14.0 ([#217](https://www.github.com/googleapis/java-shared-dependencies/issues/217)) ([01a9c64](https://www.github.com/googleapis/java-shared-dependencies/commit/01a9c6442906e8482a53712eba95ccc6f7040928)) +* update dependency io.grpc:grpc-bom to v1.34.0 ([#228](https://www.github.com/googleapis/java-shared-dependencies/issues/228)) ([425d1ea](https://www.github.com/googleapis/java-shared-dependencies/commit/425d1eab2a046c365f816f946576e4030e7c3696)) +* update gax.version to v1.60.1 ([#223](https://www.github.com/googleapis/java-shared-dependencies/issues/223)) ([84c75bd](https://www.github.com/googleapis/java-shared-dependencies/commit/84c75bdbd3f86ef7187373289ee08ad3a0c24719)) +* update google.core.version to v1.94.0 ([#212](https://www.github.com/googleapis/java-shared-dependencies/issues/212)) ([764ef5e](https://www.github.com/googleapis/java-shared-dependencies/commit/764ef5e9a2272cd9244a8fc5cc107ffacf9e9d5b)) + +## [0.15.0](https://www.github.com/googleapis/java-shared-dependencies/compare/0.14.1...v0.15.0) (2020-11-10) + + +### Dependencies + +* update dependency com.google.http-client:google-http-client-bom to v1.38.0 ([#207](https://www.github.com/googleapis/java-shared-dependencies/issues/207)) ([5e3198d](https://www.github.com/googleapis/java-shared-dependencies/commit/5e3198de5e1d0fe55c4d947b12984db7726059da)) +* update google.common-protos.version to v2.0.1 ([#205](https://www.github.com/googleapis/java-shared-dependencies/issues/205)) ([6b12417](https://www.github.com/googleapis/java-shared-dependencies/commit/6b1241737d34e99a55acdcd439aa71ad28d1e26c)) +* update iam.version to v1.0.3 ([#206](https://www.github.com/googleapis/java-shared-dependencies/issues/206)) ([94a4e31](https://www.github.com/googleapis/java-shared-dependencies/commit/94a4e31634718a206ef0f5ff1a8801dc7be4c5c5)) + +### [0.14.1](https://www.github.com/googleapis/java-shared-dependencies/compare/0.14.0...v0.14.1) (2020-10-31) + + +### Dependencies + +* update google.core.version to v1.93.10 ([#200](https://www.github.com/googleapis/java-shared-dependencies/issues/200)) ([2d73dc1](https://www.github.com/googleapis/java-shared-dependencies/commit/2d73dc152469d175c74f85c5c76dcc67993c9783)) + +## [0.14.0](https://www.github.com/googleapis/java-shared-dependencies/compare/0.13.0...v0.14.0) (2020-10-31) + + +### Dependencies + +* update dependency io.grpc:grpc-bom to v1.33.1 ([#192](https://www.github.com/googleapis/java-shared-dependencies/issues/192)) ([b29384d](https://www.github.com/googleapis/java-shared-dependencies/commit/b29384dc40c812f1848f00695228d5437556f029)) +* update dependency org.threeten:threetenbp to v1.5.0 ([#196](https://www.github.com/googleapis/java-shared-dependencies/issues/196)) ([825a6fa](https://www.github.com/googleapis/java-shared-dependencies/commit/825a6fa375d12f1caa0a515b784ffde182bac98d)) +* update iam.version to v1.0.2 ([#194](https://www.github.com/googleapis/java-shared-dependencies/issues/194)) ([5c57239](https://www.github.com/googleapis/java-shared-dependencies/commit/5c572399a1b453f4dc5f6ef8d8850a35be2aef75)) + +## [0.13.0](https://www.github.com/googleapis/java-shared-dependencies/compare/0.12.1...v0.13.0) (2020-10-20) + + +### Features + +* add jackson-core to the list of managed dependencies ([#190](https://www.github.com/googleapis/java-shared-dependencies/issues/190)) ([b37035e](https://www.github.com/googleapis/java-shared-dependencies/commit/b37035ed9b0beeb5e07d6e1c121154eece1a2c87)) + + +### Dependencies + +* update dependency com.google.guava:guava-bom to v30 ([#181](https://www.github.com/googleapis/java-shared-dependencies/issues/181)) ([bdb1e58](https://www.github.com/googleapis/java-shared-dependencies/commit/bdb1e582288d06a872e36ac8b778563f2d088468)) +* update gax.version to v1.60.0 ([#187](https://www.github.com/googleapis/java-shared-dependencies/issues/187)) ([8a8adf7](https://www.github.com/googleapis/java-shared-dependencies/commit/8a8adf7745d563c449bf095aad63b5e4a94e1a7d)) +* update google.common-protos.version to v2 ([#174](https://www.github.com/googleapis/java-shared-dependencies/issues/174)) ([3f7e3ff](https://www.github.com/googleapis/java-shared-dependencies/commit/3f7e3ffd5e07d2f11f0aa981dae2bdf5381e429f)) + +### [0.12.1](https://www.github.com/googleapis/java-shared-dependencies/compare/0.12.0...v0.12.1) (2020-10-16) + + +### Dependencies + +* update dependency com.google.api:api-common to v1.10.1 ([#180](https://www.github.com/googleapis/java-shared-dependencies/issues/180)) ([b1f2d5d](https://www.github.com/googleapis/java-shared-dependencies/commit/b1f2d5dfde24fcf683eeb5600fce7f51190ecce8)) + +## [0.12.0](https://www.github.com/googleapis/java-shared-dependencies/compare/0.11.0...v0.12.0) (2020-10-15) + + +### Dependencies + +* update dependency com.google.api-client:google-api-client-bom to v1.30.11 ([#169](https://www.github.com/googleapis/java-shared-dependencies/issues/169)) ([a1b18d1](https://www.github.com/googleapis/java-shared-dependencies/commit/a1b18d1838c2ceca882615d574ab5d0245794820)) +* update dependency com.google.auth:google-auth-library-bom to v0.22.0 ([#171](https://www.github.com/googleapis/java-shared-dependencies/issues/171)) ([0c7635a](https://www.github.com/googleapis/java-shared-dependencies/commit/0c7635a82d922971ae6aac18dc2ee1879e017516)) + +## [0.11.0](https://www.github.com/googleapis/java-shared-dependencies/compare/0.10.2...v0.11.0) (2020-10-13) + + +### Dependencies + +* update dependency com.google.http-client:google-http-client-bom to v1.37.0 ([#166](https://www.github.com/googleapis/java-shared-dependencies/issues/166)) ([5721225](https://www.github.com/googleapis/java-shared-dependencies/commit/572122574ce8452b6a0fc6df919e9ce2d8ffd2ce)) +* update dependency io.grpc:grpc-bom to v1.32.2 ([#165](https://www.github.com/googleapis/java-shared-dependencies/issues/165)) ([b70ddb0](https://www.github.com/googleapis/java-shared-dependencies/commit/b70ddb00a3be97536cdd80bd57fe6bca1b0973e2)) + +### [0.10.2](https://www.github.com/googleapis/java-shared-dependencies/compare/0.10.1...v0.10.2) (2020-10-08) + + +### Dependencies + +* update dependency org.threeten:threetenbp to v1.4.5 ([#162](https://www.github.com/googleapis/java-shared-dependencies/issues/162)) ([54eccb5](https://www.github.com/googleapis/java-shared-dependencies/commit/54eccb533353ddfe537a7e069a696a3f0f70f211)) + +### [0.10.1](https://www.github.com/googleapis/java-shared-dependencies/compare/0.10.0...v0.10.1) (2020-10-06) + + +### Dependencies + +* update gax.version to v1.59.1 ([#159](https://www.github.com/googleapis/java-shared-dependencies/issues/159)) ([7c84443](https://www.github.com/googleapis/java-shared-dependencies/commit/7c84443db92e1d910590fa89c2e35b14613e7eba)) + +## [0.10.0](https://www.github.com/googleapis/java-shared-dependencies/compare/0.9.1...v0.10.0) (2020-09-23) + + +### Features + +* manage error-prone version ([#147](https://www.github.com/googleapis/java-shared-dependencies/issues/147)) ([0fb3108](https://www.github.com/googleapis/java-shared-dependencies/commit/0fb3108c96abcdef83b5051e842530e6c9934c37)) + + +### Dependencies + +* update google.core.version to v1.93.9 ([#148](https://www.github.com/googleapis/java-shared-dependencies/issues/148)) ([b2a680e](https://www.github.com/googleapis/java-shared-dependencies/commit/b2a680ec9297136dceb622463672cc554359ba5b)) + +### [0.9.1](https://www.github.com/googleapis/java-shared-dependencies/compare/0.9.0...v0.9.1) (2020-09-23) + + +### Dependencies + +* update dependency io.grpc:grpc-bom to v1.32.1 ([#133](https://www.github.com/googleapis/java-shared-dependencies/issues/133)) ([cde0463](https://www.github.com/googleapis/java-shared-dependencies/commit/cde0463dd15c2a510085a3d5e3ac7b418c2fc3d4)) +* update iam.version to v1.0.1 ([#136](https://www.github.com/googleapis/java-shared-dependencies/issues/136)) ([162e2bd](https://www.github.com/googleapis/java-shared-dependencies/commit/162e2bda35fc3427ce571c6747aae4c9eb5866f6)) + +## [0.9.0](https://www.github.com/googleapis/java-shared-dependencies/compare/0.8.6...v0.9.0) (2020-08-31) + + +### Bug Fixes + +* temporarily disable reporting to unblock releases ([#129](https://www.github.com/googleapis/java-shared-dependencies/issues/129)) ([7fff6f2](https://www.github.com/googleapis/java-shared-dependencies/commit/7fff6f2c94a19ba998d8cd47e8be5a6333808df8)) + + +### Dependencies + +* update dependency com.google.protobuf:protobuf-bom to v3.13.0 ([#126](https://www.github.com/googleapis/java-shared-dependencies/issues/126)) ([908063f](https://www.github.com/googleapis/java-shared-dependencies/commit/908063f9b820dd3195b15537189e45be0d4acbbb)) +* update dependency io.grpc:grpc-bom to v1.31.1 ([#124](https://www.github.com/googleapis/java-shared-dependencies/issues/124)) ([553a339](https://www.github.com/googleapis/java-shared-dependencies/commit/553a3393f5bede0e90e16e2d0d87daa2b936ab32)) +* update google.common-protos.version to v1.18.1 ([#119](https://www.github.com/googleapis/java-shared-dependencies/issues/119)) ([05ad27e](https://www.github.com/googleapis/java-shared-dependencies/commit/05ad27e35fe082e148d377315b10943b187b5670)) +* update google.core.version to v1.93.8 ([f72cef3](https://www.github.com/googleapis/java-shared-dependencies/commit/f72cef3d78a036e2b2434bf08b0a75d57b2fa139)) +* update iam.version to v0.15.0 ([#118](https://www.github.com/googleapis/java-shared-dependencies/issues/118)) ([1409a16](https://www.github.com/googleapis/java-shared-dependencies/commit/1409a16826d3fd4a5d9cbcbe46ea4b4af8687a5c)) +* update iam.version to v1 (major) ([#120](https://www.github.com/googleapis/java-shared-dependencies/issues/120)) ([a6243a0](https://www.github.com/googleapis/java-shared-dependencies/commit/a6243a02129e42fec804b5769fb8e3f334ba84ce)) + +### [0.8.6](https://www.github.com/googleapis/java-shared-dependencies/compare/v0.8.5...v0.8.6) (2020-08-07) + + +### Dependencies + +* update gax to v1.58.2 ([#115](https://www.github.com/googleapis/java-shared-dependencies/issues/115)) ([84b48b4](https://www.github.com/googleapis/java-shared-dependencies/commit/84b48b4e77a4b5b4a2db6030609abe241d5ee2e1)) + +### [0.8.5](https://www.github.com/googleapis/java-shared-dependencies/compare/v0.8.4...v0.8.5) (2020-08-07) + + +### Dependencies + +* update gax to v1.58.1 ([#111](https://www.github.com/googleapis/java-shared-dependencies/issues/111)) ([93a1691](https://www.github.com/googleapis/java-shared-dependencies/commit/93a16915b863a610ffdabe0e23aec58c4ae5f4f1)) + +### [0.8.4](https://www.github.com/googleapis/java-shared-dependencies/compare/v0.8.3...v0.8.4) (2020-08-04) + + +### Dependencies + +* update core dependencies ([#104](https://www.github.com/googleapis/java-shared-dependencies/issues/104)) ([5046818](https://www.github.com/googleapis/java-shared-dependencies/commit/504681803d2bba888404acffe9a8853746501358)) +* update dependency com.google.api:api-common to v1.10.0 ([#101](https://www.github.com/googleapis/java-shared-dependencies/issues/101)) ([6472fac](https://www.github.com/googleapis/java-shared-dependencies/commit/6472face89700e3f2f982c04a5e88801876580be)) +* update dependency com.google.protobuf:protobuf-bom to v3.12.4 ([#103](https://www.github.com/googleapis/java-shared-dependencies/issues/103)) ([885bd0e](https://www.github.com/googleapis/java-shared-dependencies/commit/885bd0ef3c9e344bd1fc60e0f3264995064001d9)) + +### [0.8.3](https://www.github.com/googleapis/java-shared-dependencies/compare/v0.8.2...v0.8.3) (2020-07-09) + + +### Dependencies + +* update core dependencies ([#96](https://www.github.com/googleapis/java-shared-dependencies/issues/96)) ([978e69e](https://www.github.com/googleapis/java-shared-dependencies/commit/978e69e9b5999630354ea204c034be2d6b8a2d80)) +* update dependency com.google.api-client:google-api-client-bom to v1.30.10 ([#99](https://www.github.com/googleapis/java-shared-dependencies/issues/99)) ([65c9cce](https://www.github.com/googleapis/java-shared-dependencies/commit/65c9ccea34275fa6f9599043d6e06df169bc433a)) +* update dependency com.google.api:api-common to v1.9.3 ([#91](https://www.github.com/googleapis/java-shared-dependencies/issues/91)) ([2a23a50](https://www.github.com/googleapis/java-shared-dependencies/commit/2a23a50ee5c73b581a02171048e20b14f999949f)) + +### [0.8.2](https://www.github.com/googleapis/java-shared-dependencies/compare/v0.8.1...v0.8.2) (2020-07-01) + + +### Dependencies + +* update dependency com.google.auth:google-auth-library-bom to v0.21.0 ([#86](https://www.github.com/googleapis/java-shared-dependencies/issues/86)) ([dc9d717](https://www.github.com/googleapis/java-shared-dependencies/commit/dc9d717fdec4f0962141ba34e98f5737ec3bc57a)) +* update dependency com.google.http-client:google-http-client-bom to v1.36.0 ([#89](https://www.github.com/googleapis/java-shared-dependencies/issues/89)) ([12437d7](https://www.github.com/googleapis/java-shared-dependencies/commit/12437d7392a430299c3372d18d2650b62be60eaf)) +* update dependency io.grpc:grpc-bom to v1.30.1 ([#82](https://www.github.com/googleapis/java-shared-dependencies/issues/82)) ([a5199a0](https://www.github.com/googleapis/java-shared-dependencies/commit/a5199a02d5bde75e86349b37c1efae64a6379a40)) +* update dependency io.grpc:grpc-bom to v1.30.2 ([#85](https://www.github.com/googleapis/java-shared-dependencies/issues/85)) ([084d18d](https://www.github.com/googleapis/java-shared-dependencies/commit/084d18daab010c6b0be04e67b42ca8ab8ba5f3d5)) + +### [0.8.1](https://www.github.com/googleapis/java-shared-dependencies/compare/v0.8.0...v0.8.1) (2020-06-13) + + +### Reverts + +* Revert "feat: mark javax annotations scope as provided (#70)" (#75) ([d2f23ec](https://www.github.com/googleapis/java-shared-dependencies/commit/d2f23ecae56a1ec07b1217f0fca5347dd0f0406b)), closes [#70](https://www.github.com/googleapis/java-shared-dependencies/issues/70) [#75](https://www.github.com/googleapis/java-shared-dependencies/issues/75) + +## [0.8.0](https://www.github.com/googleapis/java-shared-dependencies/compare/v0.7.0...v0.8.0) (2020-06-12) + + +### Features + +* mark javax annotations scope as provided ([#70](https://www.github.com/googleapis/java-shared-dependencies/issues/70)) ([7bc7057](https://www.github.com/googleapis/java-shared-dependencies/commit/7bc70579a01ab761b52f8eef3d0a184b5eec26ae)) + + +### Dependencies + +* update core dependencies to v1.93.6 ([#74](https://www.github.com/googleapis/java-shared-dependencies/issues/74)) ([791639e](https://www.github.com/googleapis/java-shared-dependencies/commit/791639e805b2dcaf9b8e2c04a0428f74c029f94f)) +* update dependency com.google.api:api-common to v1.9.2 ([#63](https://www.github.com/googleapis/java-shared-dependencies/issues/63)) ([ee92a0e](https://www.github.com/googleapis/java-shared-dependencies/commit/ee92a0eb45595fa229cd6fa745f9f3cfa74bb65c)) +* update dependency io.grpc:grpc-bom to v1.30.0 ([#68](https://www.github.com/googleapis/java-shared-dependencies/issues/68)) ([ccf2310](https://www.github.com/googleapis/java-shared-dependencies/commit/ccf23106d29871855511cba0d4e704e4186347f5)) +* update gax to v1.57.0 ([#73](https://www.github.com/googleapis/java-shared-dependencies/issues/73)) ([b0ae1eb](https://www.github.com/googleapis/java-shared-dependencies/commit/b0ae1ebc7a6d4ca90ee50e3a827fcbcea06cfcf1)) + +## [0.7.0](https://www.github.com/googleapis/java-shared-dependencies/compare/v0.6.0...v0.7.0) (2020-05-28) + + +### Features + +* add core test classifier (needed by BQ) ([#59](https://www.github.com/googleapis/java-shared-dependencies/issues/59)) ([a634d18](https://www.github.com/googleapis/java-shared-dependencies/commit/a634d1886072793f3143f8c5af51008a6d9c857e)) + + +### Dependencies + +* update dependency com.google.protobuf:protobuf-bom to v3.12.2 ([#57](https://www.github.com/googleapis/java-shared-dependencies/issues/57)) ([751f170](https://www.github.com/googleapis/java-shared-dependencies/commit/751f1709b9f6bca6e5a22bf42feadc7373bceef7)) + +## [0.6.0](https://www.github.com/googleapis/java-shared-dependencies/compare/v0.5.0...v0.6.0) (2020-05-27) + + +### Features + +* add grpc-iam-v1 to keep version consistent w proto-iam-v1 ([#55](https://www.github.com/googleapis/java-shared-dependencies/issues/55)) ([0fe26dd](https://www.github.com/googleapis/java-shared-dependencies/commit/0fe26dd73e7c3ada31e53c5f5a84ef4d3c4f3956)) + + +### Dependencies + +* update core dependencies to v1.93.5 ([#53](https://www.github.com/googleapis/java-shared-dependencies/issues/53)) ([9d8d4d6](https://www.github.com/googleapis/java-shared-dependencies/commit/9d8d4d602128e6e32486288cbbec117b80f3fbc6)) +* update dependency com.google.api:api-common to v1.9.1 ([#51](https://www.github.com/googleapis/java-shared-dependencies/issues/51)) ([40276df](https://www.github.com/googleapis/java-shared-dependencies/commit/40276df393e34fb72eead8499968792852a880c7)) + +## [0.5.0](https://www.github.com/googleapis/java-shared-dependencies/compare/v0.4.0...v0.5.0) (2020-05-26) + + +### ⚠ BREAKING CHANGES + +* remove certain test deps and autovalue (#49) +* remove mockito-core (#44) + +### Features + +* remove certain test deps and autovalue ([#49](https://www.github.com/googleapis/java-shared-dependencies/issues/49)) ([0bcf1a0](https://www.github.com/googleapis/java-shared-dependencies/commit/0bcf1a064ab37e1fbb304640f714ad841762949c)) +* remove mockito-core ([#44](https://www.github.com/googleapis/java-shared-dependencies/issues/44)) ([b690f8d](https://www.github.com/googleapis/java-shared-dependencies/commit/b690f8d742cb954744fdb394e3978407561179ca)) + + +### Bug Fixes + +* remove grpc-testing since it's in grpc-bom ([#50](https://www.github.com/googleapis/java-shared-dependencies/issues/50)) ([d7df346](https://www.github.com/googleapis/java-shared-dependencies/commit/d7df346f8f54301c6113f4bb997b84df5d4f45c7)) + + +### Dependencies + +* update dependency com.google.protobuf:protobuf-bom to v3.12.1 ([#48](https://www.github.com/googleapis/java-shared-dependencies/issues/48)) ([d367a31](https://www.github.com/googleapis/java-shared-dependencies/commit/d367a3122b94ec33f804200c38067ae0eac6ddc0)) + +## [0.4.0](https://www.github.com/googleapis/java-shared-dependencies/compare/v0.3.1...v0.4.0) (2020-05-18) + + +### Features + +* add more shared dependencies ([#40](https://www.github.com/googleapis/java-shared-dependencies/issues/40)) ([34d7e2a](https://www.github.com/googleapis/java-shared-dependencies/commit/34d7e2a4bba3cc03d256de78cb2bf8543811742d)) + + +### Dependencies + +* update dependency com.google.protobuf:protobuf-bom to v3.12.0 ([#38](https://www.github.com/googleapis/java-shared-dependencies/issues/38)) ([155653b](https://www.github.com/googleapis/java-shared-dependencies/commit/155653b52f32e917a1aa970a8c5a716f57c7e190)) + +### [0.3.1](https://www.github.com/googleapis/java-shared-dependencies/compare/v0.3.0...v0.3.1) (2020-05-13) + + +### Dependencies + +* update autovalue.version to v1.7.2 ([#35](https://www.github.com/googleapis/java-shared-dependencies/issues/35)) ([50a1511](https://www.github.com/googleapis/java-shared-dependencies/commit/50a1511a47362a2de5cce26de0f0fbd6ea31c7cb)) + + +### Documentation + +* update CONTRIBUTING.md to include code formatting ([#534](https://www.github.com/googleapis/java-shared-dependencies/issues/534)) ([#34](https://www.github.com/googleapis/java-shared-dependencies/issues/34)) ([c916354](https://www.github.com/googleapis/java-shared-dependencies/commit/c91635446a457e01aa38e2cc384d3fd5d43c1b3b)) + +## [0.3.0](https://www.github.com/googleapis/java-shared-dependencies/compare/v0.2.0...v0.3.0) (2020-05-05) + + +### Features + +* add grpc-testing, mockito and truth extensions ([#25](https://www.github.com/googleapis/java-shared-dependencies/issues/25)) ([e906514](https://www.github.com/googleapis/java-shared-dependencies/commit/e9065147889ec42ac7350e2559fabae9abf335a9)) + + +### Dependencies + +* update autovalue.version to v1.7.1 ([#29](https://www.github.com/googleapis/java-shared-dependencies/issues/29)) ([c9e80f8](https://www.github.com/googleapis/java-shared-dependencies/commit/c9e80f8e990d42ab4ebace439da2abe93d33afcb)) +* update dependency com.google.http-client:google-http-client-bom to v1.35.0 ([#23](https://www.github.com/googleapis/java-shared-dependencies/issues/23)) ([e1775c2](https://www.github.com/googleapis/java-shared-dependencies/commit/e1775c253b7ef1fdd306b30a6e7698a9370bbf81)) +* update dependency org.mockito:mockito-core to v3.3.3 ([#27](https://www.github.com/googleapis/java-shared-dependencies/issues/27)) ([8dfa3a5](https://www.github.com/googleapis/java-shared-dependencies/commit/8dfa3a5cc8c6a9e2477b63c2174d501a2bdec58a)) +* update dependency org.threeten:threetenbp to v1.4.4 ([#22](https://www.github.com/googleapis/java-shared-dependencies/issues/22)) ([4734794](https://www.github.com/googleapis/java-shared-dependencies/commit/47347943605ad7fdc3340a1a7691c500bbdf1fa2)) +* update google.common-protos.version to v1.18.0 ([#30](https://www.github.com/googleapis/java-shared-dependencies/issues/30)) ([6cb6cc1](https://www.github.com/googleapis/java-shared-dependencies/commit/6cb6cc1304f105307d60c013eaa1604a7537e17a)) + +## [0.2.0](https://www.github.com/googleapis/java-shared-dependencies/compare/v0.1.1...v0.2.0) (2020-04-22) + + +### Features + +* add truth as a managed test scope dependency ([#19](https://www.github.com/googleapis/java-shared-dependencies/issues/19)) ([36167bf](https://www.github.com/googleapis/java-shared-dependencies/commit/36167bfc19475425416316ede28e72db4d683db1)) +* import google-cloud-core-bom to include all google-cloud-core-* artifacts ([#18](https://www.github.com/googleapis/java-shared-dependencies/issues/18)) ([ed3850c](https://www.github.com/googleapis/java-shared-dependencies/commit/ed3850c6a6ea491b570c461a2108c124c9ef71da)) +* import protobuf-bom to manage all protobuf artifacts ([#21](https://www.github.com/googleapis/java-shared-dependencies/issues/21)) ([dc0f1e0](https://www.github.com/googleapis/java-shared-dependencies/commit/dc0f1e0be1be33f5bdf0426cad1cc2df45f5d10a)) + + +### Dependencies + +* update dependency io.grpc:grpc-bom to v1.29.0 ([#16](https://www.github.com/googleapis/java-shared-dependencies/issues/16)) ([eac0d44](https://www.github.com/googleapis/java-shared-dependencies/commit/eac0d448b0701a3dd5788321ed0494eb2a618f9e)) + +### [0.1.1](https://www.github.com/googleapis/java-shared-dependencies/compare/v0.1.0...v0.1.1) (2020-04-14) + + +### Dependencies + +* update core dependencies ([#2](https://www.github.com/googleapis/java-shared-dependencies/issues/2)) ([5589285](https://www.github.com/googleapis/java-shared-dependencies/commit/5589285e105ccd4746e3e194f959c72f17705d45)) +* update dependency com.google.cloud:google-cloud-core to v1.93.4 ([#9](https://www.github.com/googleapis/java-shared-dependencies/issues/9)) ([882cdd6](https://www.github.com/googleapis/java-shared-dependencies/commit/882cdd63f2948de1b29119b36032c45cb4887913)) +* update dependency com.google.guava:guava-bom to v29 ([#12](https://www.github.com/googleapis/java-shared-dependencies/issues/12)) ([9f844c4](https://www.github.com/googleapis/java-shared-dependencies/commit/9f844c4b86cfd5e228a1d3b215726d632c21abf6)) +* update dependency org.threeten:threetenbp to v1.4.3 ([#7](https://www.github.com/googleapis/java-shared-dependencies/issues/7)) ([cd8d481](https://www.github.com/googleapis/java-shared-dependencies/commit/cd8d4812c34568599c79edac45db5bc973eace0a)) + +## 0.1.0 (2020-03-30) + + +### Features + +* initial generation ([d4cec70](https://www.github.com/googleapis/java-shared-dependencies/commit/d4cec70fef2f22df1215e96793fe9f79b644d3b1)) + + +### Dependencies + +* update dependency com.google.api:api-common to v1.9.0 ([#3](https://www.github.com/googleapis/java-shared-dependencies/issues/3)) ([4f6896a](https://www.github.com/googleapis/java-shared-dependencies/commit/4f6896ac883557ad2e61d0fc66567948ae6622d1)) +* update dependency org.threeten:threetenbp to v1.4.2 ([#4](https://www.github.com/googleapis/java-shared-dependencies/issues/4)) ([9446245](https://www.github.com/googleapis/java-shared-dependencies/commit/944624527027f4386d9e3ab82c64655998a17d7a)) diff --git a/java-shared-dependencies/README.md b/java-shared-dependencies/README.md new file mode 100644 index 0000000000..47abde1753 --- /dev/null +++ b/java-shared-dependencies/README.md @@ -0,0 +1,48 @@ +# Google Cloud Shared Dependencies + +Shared Maven dependencies for Google Cloud Java client libraries. + +[![Maven][maven-version-image]][maven-version-link] + +## Quickstart + +[//]: # ({x-version-update-start:google-cloud-shared-dependencies:released}) +If you are using Maven, add this to the `dependencyManagement` section. +```xml + + + + com.google.cloud + google-cloud-shared-dependencies + 3.58.0 + pom + import + + + +``` +[//]: # ({x-version-update-end}) + +## Versioning + +This library follows [Semantic Versioning](http://semver.org/). + +## Contributing + +Contributions to this library are always welcome and highly encouraged. + +See [CONTRIBUTING.md][contributing] documentation for more information on 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. + +[maven-version-image]: https://img.shields.io/maven-central/v/com.google.cloud/google-cloud-shared-dependencies.svg +[maven-version-link]: https://search.maven.org/search?q=g:com.google.cloud%20AND%20a:google-cloud-shared-dependencies&core=gav +[contributing]: https://github.com/googleapis/java-shared-dependencies/blob/main/CONTRIBUTING.md +[code-of-conduct]: https://github.com/googleapis/java-shared-dependencies/blob/main/CODE_OF_CONDUCT.md#contributor-code-of-conduct +[license]: https://github.com/googleapis/java-shared-dependencies/blob/main/LICENSE diff --git a/java-shared-dependencies/dependency-analyzer/pom.xml b/java-shared-dependencies/dependency-analyzer/pom.xml new file mode 100644 index 0000000000..900b1bcf41 --- /dev/null +++ b/java-shared-dependencies/dependency-analyzer/pom.xml @@ -0,0 +1,82 @@ + + + 4.0.0 + com.google.cloud + dependency-analyzer + 0.0.1-SNATSHOT + + + 17 + 17 + UTF-8 + + + + + + org.codehaus.mojo + exec-maven-plugin + 3.5.0 + + + + java + + + + + com.google.cloud.DependencyAnalyzer + + + ${dep.system} + + ${dep.name} + + ${dep.version} + + + + + org.apache.maven.plugins + maven-surefire-plugin + 3.5.2 + + + + fake_value + + + + + + + + + com.google.code.gson + gson + 2.12.1 + + + com.google.guava + guava + 33.4.0-jre + + + + org.mockito + mockito-core + 5.15.2 + test + + + com.google.truth + truth + 1.4.4 + test + + + + \ No newline at end of file diff --git a/java-shared-dependencies/dependency-analyzer/src/main/java/com/google/cloud/DependencyAnalyzer.java b/java-shared-dependencies/dependency-analyzer/src/main/java/com/google/cloud/DependencyAnalyzer.java new file mode 100644 index 0000000000..7423af8f11 --- /dev/null +++ b/java-shared-dependencies/dependency-analyzer/src/main/java/com/google/cloud/DependencyAnalyzer.java @@ -0,0 +1,125 @@ +package com.google.cloud; + +import static com.google.common.base.Preconditions.checkArgument; + +import com.google.cloud.external.DepsDevClient; +import com.google.cloud.model.Advisory; +import com.google.cloud.model.AdvisoryKey; +import com.google.cloud.model.AnalysisResult; +import com.google.cloud.model.License; +import com.google.cloud.model.ReportResult; +import com.google.cloud.model.PackageInfo; +import com.google.cloud.model.QueryResult; +import com.google.cloud.model.Result; +import com.google.cloud.model.Version; +import com.google.cloud.model.VersionKey; +import java.io.IOException; +import java.net.URISyntaxException; +import java.net.http.HttpClient; +import java.util.ArrayDeque; +import java.util.ArrayList; +import java.util.HashSet; +import java.util.List; +import java.util.Queue; +import java.util.Set; + +public class DependencyAnalyzer { + + private final DepsDevClient depsDevClient; + + public DependencyAnalyzer(DepsDevClient depsDevClient) { + this.depsDevClient = depsDevClient; + } + + public AnalysisResult analyze(String system, String packageName, String packageVersion) + throws URISyntaxException, IOException, InterruptedException, IllegalArgumentException { + VersionKey root = VersionKey.from(system, packageName, packageVersion); + Set seenPackage = new HashSet<>(); + seenPackage.add(root); + Queue queue = new ArrayDeque<>(); + queue.offer(root); + List dependencies = new ArrayList<>(); + while (!queue.isEmpty()) { + VersionKey versionKey = queue.poll(); + dependencies.add(versionKey); + List directDependencies = depsDevClient.getDirectDependencies(versionKey); + // only add unseen dependencies to the queue. + directDependencies + .stream() + .filter(seenPackage::add) + .forEach(queue::offer); + } + + List result = new ArrayList<>(); + for (VersionKey versionKey : dependencies) { + QueryResult packageInfo = depsDevClient.getQueryResult(versionKey); + List licenses = new ArrayList<>(); + List advisories = new ArrayList<>(); + for (Result res : packageInfo.results()) { + Version version = res.version(); + for (String license : version.licenses()) { + licenses.add(License.toLicense(license)); + } + for (AdvisoryKey advisoryKey : version.advisoryKeys()) { + advisories.add(depsDevClient.getAdvisory(advisoryKey.id())); + } + } + + result.add(new PackageInfo(versionKey, licenses, advisories)); + } + + return AnalysisResult.of(result); + } + + /** + * For a given package, checks the package information via deps.dev and reports error if risk information is found. + *

        + * The types of risk checked by the dependency analyzer are: + *

        1. Non-compliant licenses

        + *

        2. Security vulnerability

        + * The analyzer will report all types of risk before existing with error. + * + * @param args a package. A string array with three elements. + *

        The 1st element is the package management system, e.g., maven, npm, etc.

        + *

        The 2nd element is the package name.

        + *

        The 3rd element is the package version.

        + * @throws IllegalArgumentException if the format of package name is incorrect according to the + * package management system. + */ + public static void main(String[] args) throws IllegalArgumentException { + checkArgument(args.length == 3, + """ + The length of the inputs should be 3. + The 1st input should be the package management system. + The 2nd input should be the package name. + The 3rd input should be the package version. + """ + ); + + String system = args[0]; + String packageName = args[1]; + String packageVersion = args[2]; + DependencyAnalyzer dependencyAnalyzer = new DependencyAnalyzer( + new DepsDevClient(HttpClient.newHttpClient())); + AnalysisResult analyzeReport = null; + try { + analyzeReport = dependencyAnalyzer.analyze(system, packageName, packageVersion); + } catch (URISyntaxException | IOException | InterruptedException ex) { + System.out.println( + "Caught exception when fetching package information from https://deps.dev/"); + ex.printStackTrace(); + System.exit(1); + } + + System.out.println("Please copy and paste the package information below to your ticket.\n"); + System.out.println(analyzeReport.toString()); + ReportResult result = analyzeReport.getAnalysisResult(); + System.out.println(result); + if (result.equals(ReportResult.FAIL)) { + System.out.println( + "Please refer to go/cloud-java-rotations#security-advisories-monitoring for further actions"); + System.exit(1); + } + } +} diff --git a/java-shared-dependencies/dependency-analyzer/src/main/java/com/google/cloud/external/DepsDevClient.java b/java-shared-dependencies/dependency-analyzer/src/main/java/com/google/cloud/external/DepsDevClient.java new file mode 100644 index 0000000000..49e9cd0cd4 --- /dev/null +++ b/java-shared-dependencies/dependency-analyzer/src/main/java/com/google/cloud/external/DepsDevClient.java @@ -0,0 +1,131 @@ +package com.google.cloud.external; + +import com.google.cloud.model.Advisory; +import com.google.cloud.model.DependencyResponse; +import com.google.cloud.model.Node; +import com.google.cloud.model.QueryResult; +import com.google.cloud.model.Relation; +import com.google.cloud.model.VersionKey; +import com.google.errorprone.annotations.RestrictedApi; +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonParseException; +import java.io.IOException; +import java.lang.reflect.Type; +import java.net.URI; +import java.net.URISyntaxException; +import java.net.URLEncoder; +import java.net.http.HttpClient; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.net.http.HttpResponse.BodyHandlers; +import java.nio.charset.StandardCharsets; +import java.util.List; +import java.util.stream.Collectors; + +/** + * DepsDevClient is a class that sends HTTP requests to the Deps.dev RESTful API. + * + *

        This class simplifies the process of making API calls by handling authentication, request + * construction, and response parsing. It uses the {@link java.net.http.HttpClient} for sending + * requests and {@link com.google.gson.Gson} for handling JSON serialization/deserialization. + */ +public class DepsDevClient { + + private final HttpClient client; + private final Gson gson; + private final static String ADVISORY_URL_BASE = "https://api.deps.dev/v3/advisories/%s"; + + private final static String DEPENDENCY_URLBASE = + "https://api.deps.dev/v3/systems/%s/packages/%s/versions/%s:dependencies"; + + public final static String QUERY_URL_BASE = + "https://api.deps.dev/v3/query?versionKey.system=%s&versionKey.name=%s&versionKey.version=%s"; + + public DepsDevClient(HttpClient client) { + this.client = client; + this.gson = new GsonBuilder() + .registerTypeAdapter(VersionKey.class, new VersionKeyDeserializer()) + .create(); + } + + public List getDirectDependencies(VersionKey versionKey) + throws URISyntaxException, IOException, InterruptedException { + HttpResponse response = getResponse( + getDependencyUrl( + versionKey.pkgManagement().toString(), + versionKey.name(), + versionKey.version() + ) + ); + DependencyResponse dependencyResponse = gson.fromJson(response.body(), + DependencyResponse.class); + return dependencyResponse + .nodes() + .stream() + .filter(node -> Relation.DIRECT.equals(node.relation())) + .map(Node::versionKey) + .collect(Collectors.toList()); + } + + public QueryResult getQueryResult(VersionKey versionKey) + throws URISyntaxException, IOException, InterruptedException { + HttpResponse response = getResponse( + getQueryUrl( + versionKey.pkgManagement().toString(), + versionKey.name(), + versionKey.version() + ) + ); + return gson.fromJson(response.body(), QueryResult.class); + } + + public Advisory getAdvisory(String advisoryId) + throws URISyntaxException, IOException, InterruptedException { + HttpResponse response = getResponse(getAdvisoryUrl(advisoryId)); + return gson.fromJson(response.body(), Advisory.class); + } + + private String getAdvisoryUrl(String advisoryId) { + return String.format(ADVISORY_URL_BASE, advisoryId); + } + + @RestrictedApi( + explanation = "This method is for internal use only.", + allowedOnPath = "test/java/com/google/cloud/external") + public String getQueryUrl(String system, String name, String version) { + return String.format(QUERY_URL_BASE, system, name, encode(version)); + } + + @RestrictedApi( + explanation = "This method is for internal use only.", + allowedOnPath = "test/java/com/google/cloud/external") + public String getDependencyUrl(String system, String name, String version) { + return String.format(DEPENDENCY_URLBASE, system, name, encode(version)); + } + + private String encode(String str) { + return URLEncoder.encode(str, StandardCharsets.UTF_8); + } + + private HttpResponse getResponse(String endpoint) + throws URISyntaxException, IOException, InterruptedException { + HttpRequest request = HttpRequest.newBuilder().uri(new URI(endpoint)).GET().build(); + return client.send(request, BodyHandlers.ofString()); + } + + static class VersionKeyDeserializer implements JsonDeserializer { + + @Override + public VersionKey deserialize(JsonElement json, Type typeOfT, + JsonDeserializationContext context) throws JsonParseException { + String system = context.deserialize(json.getAsJsonObject().get("system"), String.class); + String name = context.deserialize(json.getAsJsonObject().get("name"), String.class); + String version = context.deserialize(json.getAsJsonObject().get("version"), String.class); + return VersionKey.from(system, name, version); + } + } +} diff --git a/java-shared-dependencies/dependency-analyzer/src/main/java/com/google/cloud/external/GitHubClient.java b/java-shared-dependencies/dependency-analyzer/src/main/java/com/google/cloud/external/GitHubClient.java new file mode 100644 index 0000000000..5c66a1af1a --- /dev/null +++ b/java-shared-dependencies/dependency-analyzer/src/main/java/com/google/cloud/external/GitHubClient.java @@ -0,0 +1,113 @@ +package com.google.cloud.external; + +import com.google.cloud.model.Interval; +import com.google.cloud.model.PullRequest; +import com.google.cloud.model.PullRequestStatistics; +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.reflect.TypeToken; +import java.io.IOException; +import java.net.URI; +import java.net.URISyntaxException; +import java.net.http.HttpClient; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.net.http.HttpResponse.BodyHandlers; +import java.time.Instant; +import java.time.ZoneId; +import java.time.ZonedDateTime; +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; + +/** + * GitHubClient is a class that sends HTTP requests to the GitHub RESTful API. It provides methods + * for interacting with various GitHub resources such as repositories, issues, users, etc. + * + *

        This class simplifies the process of making API calls by handling authentication, request + * construction, and response parsing. It uses the {@link java.net.http.HttpClient} for sending + * requests and {@link com.google.gson.Gson} for handling JSON serialization/deserialization. + */ +public class GitHubClient { + private final HttpClient client; + private final Gson gson; + private static final String PULL_REQUESTS_BASE = + "https://api.github.com/repos/%s/%s/pulls?state=all&per_page=100&page=%s"; + private static final int MAX_PULL_REQUEST_NUM = 1000; + private static final String OPEN_STATE = "open"; + + public GitHubClient(HttpClient client) { + this.client = client; + this.gson = new GsonBuilder().create(); + } + + public PullRequestStatistics listMonthlyPullRequestStatusOf(String organization, String repo) + throws URISyntaxException, IOException, InterruptedException { + return listPullRequestStatus(organization, repo, Interval.MONTHLY); + } + + private PullRequestStatistics listPullRequestStatus( + String organization, String repo, Interval interval) + throws URISyntaxException, IOException, InterruptedException { + List pullRequests = listPullRequests(organization, repo); + ZonedDateTime now = ZonedDateTime.now(); + long created = + pullRequests.stream() + .distinct() + .filter(pullRequest -> pullRequest.state().equals(OPEN_STATE)) + .filter( + pullRequest -> { + ZonedDateTime createdAt = utcTimeFrom(pullRequest.createdAt()); + return now.minusDays(interval.getDays()).isBefore(createdAt); + }) + .count(); + + long merged = + pullRequests.stream() + .distinct() + .filter(pullRequest -> Objects.nonNull(pullRequest.mergedAt())) + .filter( + pullRequest -> { + ZonedDateTime createdAt = utcTimeFrom(pullRequest.mergedAt()); + return now.minusDays(interval.getDays()).isBefore(createdAt); + }) + .count(); + + return new PullRequestStatistics(created, merged, interval); + } + + private List listPullRequests(String organization, String repo) + throws URISyntaxException, IOException, InterruptedException { + List pullRequests = new ArrayList<>(); + int page = 1; + while (pullRequests.size() < MAX_PULL_REQUEST_NUM) { + HttpResponse response = getResponse(getPullRequestsUrl(organization, repo, page)); + pullRequests.addAll( + gson.fromJson(response.body(), new TypeToken>() {}.getType())); + page++; + } + + return pullRequests; + } + + private String getPullRequestsUrl(String organization, String repo, int page) { + return String.format(PULL_REQUESTS_BASE, organization, repo, page); + } + + private ZonedDateTime utcTimeFrom(String time) { + ZoneId zoneIdUTC = ZoneId.of("UTC"); + Instant instant = Instant.parse(time); + return instant.atZone(zoneIdUTC); + } + + private HttpResponse getResponse(String endpoint) + throws URISyntaxException, IOException, InterruptedException { + HttpRequest request = + HttpRequest.newBuilder() + .header("Authorization", System.getenv("GITHUB_TOKEN")) + .uri(new URI(endpoint)) + .GET() + .build(); + return client.send(request, BodyHandlers.ofString()); + } +} diff --git a/java-shared-dependencies/dependency-analyzer/src/main/java/com/google/cloud/model/Advisory.java b/java-shared-dependencies/dependency-analyzer/src/main/java/com/google/cloud/model/Advisory.java new file mode 100644 index 0000000000..dc08fda614 --- /dev/null +++ b/java-shared-dependencies/dependency-analyzer/src/main/java/com/google/cloud/model/Advisory.java @@ -0,0 +1,30 @@ +package com.google.cloud.model; + +/** + * GetAdvisory returns information about security advisories hosted by OSV. + *

        + * For more information, please refer to GetAdvisory. + * + * @param advisoryKey The identifier for the security advisory. + * @param url The URL of the security advisory. + * @param title A brief human-readable description. + * @param aliases Other identifiers used for the advisory, including CVEs. + * @param cvss3Score The severity of the advisory as a CVSS v3 score in the range [0,10]. A higher + * score represents greater severity. + * @param cvss3Vector The severity of the advisory as a CVSS v3 vector string. + */ +public record Advisory( + AdvisoryKey advisoryKey, + String url, + String title, + String[] aliases, + double cvss3Score, + String cvss3Vector) { + + @Override + public String toString() { + return String.format("Advisory (id: %s, more info: [%s](%s))", advisoryKey.id(), title, url); + } +} + diff --git a/java-shared-dependencies/dependency-analyzer/src/main/java/com/google/cloud/model/AdvisoryKey.java b/java-shared-dependencies/dependency-analyzer/src/main/java/com/google/cloud/model/AdvisoryKey.java new file mode 100644 index 0000000000..be01f197d8 --- /dev/null +++ b/java-shared-dependencies/dependency-analyzer/src/main/java/com/google/cloud/model/AdvisoryKey.java @@ -0,0 +1,10 @@ +package com.google.cloud.model; + +/** + * The identifier for the security advisory. + * + * @param id The OSV identifier for the security advisory. + */ +public record AdvisoryKey(String id) { + +} diff --git a/java-shared-dependencies/dependency-analyzer/src/main/java/com/google/cloud/model/AnalysisResult.java b/java-shared-dependencies/dependency-analyzer/src/main/java/com/google/cloud/model/AnalysisResult.java new file mode 100644 index 0000000000..006764055d --- /dev/null +++ b/java-shared-dependencies/dependency-analyzer/src/main/java/com/google/cloud/model/AnalysisResult.java @@ -0,0 +1,124 @@ +package com.google.cloud.model; + +import static com.google.cloud.external.DepsDevClient.QUERY_URL_BASE; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Set; + +public class AnalysisResult { + + private final List packageInfos; + private final Map> advisories; + private final Map> nonCompliantLicenses; + + private AnalysisResult(List result) { + this.packageInfos = result; + this.advisories = getAdvisories(result); + this.nonCompliantLicenses = getNonCompliantLicenses(result); + } + + public static AnalysisResult of(List result) { + return new AnalysisResult(result); + } + + public ReportResult getAnalysisResult() { + if (advisories.isEmpty() && nonCompliantLicenses.isEmpty()) { + return ReportResult.PASS; + } + + return ReportResult.FAIL; + } + + @Override + public String toString() { + return packageInfoReport(); + } + + private Map> getAdvisories(List result) { + Map> advisories = new HashMap<>(); + result.forEach(packageInfo -> { + List adv = packageInfo.advisories(); + if (!adv.isEmpty()) { + advisories.put(packageInfo.versionKey(), packageInfo.advisories()); + } + }); + return advisories; + } + + private Map> getNonCompliantLicenses(List result) { + Map> licenses = new HashMap<>(); + Set compliantCategories = LicenseCategory.compliantCategories(); + + result.forEach(packageInfo -> { + List nonCompliantLicenses = new ArrayList<>(); + for (License license : packageInfo.licenses()) { + // fiter out all compliant categories, the remaining ones are non-compliant. + List nonCompliantCategories = license + .getCategories() + .stream() + .filter(category -> !compliantCategories.contains(category)) + .toList(); + if (!nonCompliantCategories.isEmpty()) { + nonCompliantLicenses.add(license); + } + } + if (!nonCompliantLicenses.isEmpty()) { + licenses.put(packageInfo.versionKey(), nonCompliantLicenses); + } + }); + return licenses; + } + + private String packageInfoReport() { + StringBuilder builder = new StringBuilder(); + PackageInfo root = packageInfos.get(0); + String title = String.format(""" + ## Package information of %s + %s + """, root.versionKey(), packageInfoSection(root)); + builder.append(title); + + builder.append("## Dependencies\n"); + if (packageInfos.size() == 1) { + builder.append(String.format("%s has no dependency.", root.versionKey())); + } else { + for (int i = 1; i < packageInfos.size(); i++) { + PackageInfo info = packageInfos.get(i); + String dependencyInfo = String.format(""" + ### Package information of %s + %s + """, info.versionKey(), packageInfoSection(info)); + builder.append(dependencyInfo); + } + } + builder.append("\n"); + + return builder.toString(); + } + + private String packageInfoSection(PackageInfo packageInfo) { + VersionKey versionKey = packageInfo.versionKey(); + // generate the report using Markdown format. + String packageInfoReport = """ + Licenses: %s + Vulnerabilities: %s. + Checked in [%s (%s)](%s) + """; + return String.format(packageInfoReport, + packageInfo.licenses(), + packageInfo.advisories(), + versionKey.name(), + versionKey.version(), + getQueryUrl( + versionKey.pkgManagement().toString(), + versionKey.name(), + versionKey.version())); + } + + private String getQueryUrl(String system, String name, String version) { + return String.format(QUERY_URL_BASE, system, name, version); + } +} diff --git a/java-shared-dependencies/dependency-analyzer/src/main/java/com/google/cloud/model/DependencyResponse.java b/java-shared-dependencies/dependency-analyzer/src/main/java/com/google/cloud/model/DependencyResponse.java new file mode 100644 index 0000000000..f76fbc8b7a --- /dev/null +++ b/java-shared-dependencies/dependency-analyzer/src/main/java/com/google/cloud/model/DependencyResponse.java @@ -0,0 +1,20 @@ +package com.google.cloud.model; + +import com.google.common.collect.ImmutableList; +import java.util.List; + +/** + * A resolved dependency graph for the given package version. + *

        + * For more information, please refer to GetDependencies. + * + * @param nodes The first node is the root of the graph. + */ +public record DependencyResponse(List nodes) { + + @Override + public List nodes() { + return ImmutableList.copyOf(nodes); + } +} diff --git a/java-shared-dependencies/dependency-analyzer/src/main/java/com/google/cloud/model/Interval.java b/java-shared-dependencies/dependency-analyzer/src/main/java/com/google/cloud/model/Interval.java new file mode 100644 index 0000000000..eead68c1a8 --- /dev/null +++ b/java-shared-dependencies/dependency-analyzer/src/main/java/com/google/cloud/model/Interval.java @@ -0,0 +1,16 @@ +package com.google.cloud.model; + +public enum Interval { + WEEKLY(7), + MONTHLY(30); + + private final int days; + + Interval(int days) { + this.days = days; + } + + public int getDays() { + return days; + } +} diff --git a/java-shared-dependencies/dependency-analyzer/src/main/java/com/google/cloud/model/License.java b/java-shared-dependencies/dependency-analyzer/src/main/java/com/google/cloud/model/License.java new file mode 100644 index 0000000000..246cff06b1 --- /dev/null +++ b/java-shared-dependencies/dependency-analyzer/src/main/java/com/google/cloud/model/License.java @@ -0,0 +1,67 @@ +package com.google.cloud.model; + +import static com.google.cloud.model.LicenseCategory.NOTICE; +import static com.google.cloud.model.LicenseCategory.RESTRICTED; + +import com.google.common.collect.ImmutableSet; +import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; + +/** + * Third-party licenses associated with an open-source software. + *

        + * For more information, please refer to go/thirdpartylicenses. + */ +public enum License { + APACHE_2_0("Apache-2.0", Set.of(NOTICE)), + BCL("BCL", Set.of(RESTRICTED, NOTICE)), + BSD_3_CLAUSE("BSD-3-Clause", Set.of(NOTICE)), + GL2PS("GL2PS", Set.of(RESTRICTED, NOTICE)), + MIT("MIT", Set.of(NOTICE)), + NOT_RECOGNIZED("Not-Recognized", Set.of()); + + private final static Logger LOGGER = Logger.getLogger(License.class.getName()); + + private final String licenseStr; + + private final Set categories; + + License(String licenseStr, Set categories) { + this.licenseStr = licenseStr; + this.categories = categories; + } + + public static License toLicense(String licenseStr) { + String value = licenseStr + .toUpperCase() + .replace('-', '_') + .replace('.', '_'); + try { + return License.valueOf(value); + } catch (IllegalArgumentException exception) { + LOGGER.log(Level.WARNING, String.format("%s is not recognized as any of the known license.", licenseStr)); + return NOT_RECOGNIZED; + } + } + + public Set getCategories() { + return ImmutableSet.copyOf(categories); + } + + @Override + public String toString() { + String nonCompliantPrefix = "%s (Not Google-compliant!)"; + String compliantPrefix = "%s (Google-compliant)"; + Set compliantCategories = LicenseCategory.compliantCategories(); + if (this.categories.isEmpty()) { + return String.format(nonCompliantPrefix, this.licenseStr); + } + for (LicenseCategory category : this.categories) { + if (!compliantCategories.contains(category)) { + return String.format(nonCompliantPrefix, this.licenseStr); + } + } + return String.format(compliantPrefix, this.licenseStr); + } +} diff --git a/java-shared-dependencies/dependency-analyzer/src/main/java/com/google/cloud/model/LicenseCategory.java b/java-shared-dependencies/dependency-analyzer/src/main/java/com/google/cloud/model/LicenseCategory.java new file mode 100644 index 0000000000..642d51b00a --- /dev/null +++ b/java-shared-dependencies/dependency-analyzer/src/main/java/com/google/cloud/model/LicenseCategory.java @@ -0,0 +1,19 @@ +package com.google.cloud.model; + +import com.google.common.collect.ImmutableSet; +import java.util.Set; + +/** + * The type of license associated with open-source software. + *

        + * For more information, please refer to go/thirdpartylicenses. + */ +public enum LicenseCategory { + PERMISSIVE, + RESTRICTED, + NOTICE; + + public static Set compliantCategories() { + return ImmutableSet.of(LicenseCategory.NOTICE); + } +} diff --git a/java-shared-dependencies/dependency-analyzer/src/main/java/com/google/cloud/model/Node.java b/java-shared-dependencies/dependency-analyzer/src/main/java/com/google/cloud/model/Node.java new file mode 100644 index 0000000000..a37c3e4abc --- /dev/null +++ b/java-shared-dependencies/dependency-analyzer/src/main/java/com/google/cloud/model/Node.java @@ -0,0 +1,12 @@ +package com.google.cloud.model; + +/** + * The nodes of the dependency graph. + * + * @param versionKey The package version represented by this node. + * @param relation Whether this node represents a direct or indirect dependency within this + * dependency graph. + */ +public record Node(VersionKey versionKey, Relation relation) { + +} diff --git a/java-shared-dependencies/dependency-analyzer/src/main/java/com/google/cloud/model/PackageInfo.java b/java-shared-dependencies/dependency-analyzer/src/main/java/com/google/cloud/model/PackageInfo.java new file mode 100644 index 0000000000..7aa1f12768 --- /dev/null +++ b/java-shared-dependencies/dependency-analyzer/src/main/java/com/google/cloud/model/PackageInfo.java @@ -0,0 +1,22 @@ +package com.google.cloud.model; + +import com.google.common.collect.ImmutableList; +import java.util.List; + +/** + * Selected package information associated with a package version, including licenses and security + * advisories. + */ +public record PackageInfo( + VersionKey versionKey, + List licenses, + List advisories) { + + public List licenses() { + return ImmutableList.copyOf(licenses); + } + + public List advisories() { + return ImmutableList.copyOf(advisories); + } +} diff --git a/java-shared-dependencies/dependency-analyzer/src/main/java/com/google/cloud/model/PkgManagement.java b/java-shared-dependencies/dependency-analyzer/src/main/java/com/google/cloud/model/PkgManagement.java new file mode 100644 index 0000000000..5e4bd8683d --- /dev/null +++ b/java-shared-dependencies/dependency-analyzer/src/main/java/com/google/cloud/model/PkgManagement.java @@ -0,0 +1,17 @@ +package com.google.cloud.model; + +/** + * The package management system containing the package. + */ +public enum PkgManagement { + MAVEN; + + public static boolean checkPackageName(PkgManagement system, String name) { + if (system == MAVEN) { + String[] strs = name.split(":"); + return strs.length == 2; + } + + return false; + } +} diff --git a/java-shared-dependencies/dependency-analyzer/src/main/java/com/google/cloud/model/PullRequest.java b/java-shared-dependencies/dependency-analyzer/src/main/java/com/google/cloud/model/PullRequest.java new file mode 100644 index 0000000000..04734225f3 --- /dev/null +++ b/java-shared-dependencies/dependency-analyzer/src/main/java/com/google/cloud/model/PullRequest.java @@ -0,0 +1,17 @@ +package com.google.cloud.model; + +import com.google.gson.annotations.SerializedName; + +/** + * A record that represents a GitHub pull request. + * + * @param url The url of the pull request. + * @param state The state of the pull request, e.g., open, merged. + * @param createdAt The creation time of the pull request. + * @param mergedAt The merged time of the pull request; null if not merged. + */ +public record PullRequest( + String url, + String state, + @SerializedName("created_at") String createdAt, + @SerializedName("merged_at") String mergedAt) {} diff --git a/java-shared-dependencies/dependency-analyzer/src/main/java/com/google/cloud/model/PullRequestStatistics.java b/java-shared-dependencies/dependency-analyzer/src/main/java/com/google/cloud/model/PullRequestStatistics.java new file mode 100644 index 0000000000..f151569f73 --- /dev/null +++ b/java-shared-dependencies/dependency-analyzer/src/main/java/com/google/cloud/model/PullRequestStatistics.java @@ -0,0 +1,15 @@ +package com.google.cloud.model; + +/** + * A record that represents statistics about pull requests within a specified time interval. + * + *

        The pull request statistics is used to show pull request freshness in the package information + * report. + * + *

        For example, x pull requests are created and y pull requests are merged in the last 30 days. + * + * @param created The number of pull requests created within the interval. + * @param merged The number of pull requests merged within the interval. + * @param interval The time interval over which the statistics were collected. + */ +public record PullRequestStatistics(long created, long merged, Interval interval) {} diff --git a/java-shared-dependencies/dependency-analyzer/src/main/java/com/google/cloud/model/QueryResult.java b/java-shared-dependencies/dependency-analyzer/src/main/java/com/google/cloud/model/QueryResult.java new file mode 100644 index 0000000000..d1743e5552 --- /dev/null +++ b/java-shared-dependencies/dependency-analyzer/src/main/java/com/google/cloud/model/QueryResult.java @@ -0,0 +1,17 @@ +package com.google.cloud.model; + +import com.google.common.collect.ImmutableList; +import java.util.List; + +/** + * Information about multiple package versions. + *

        + * For more information, please refer to Query + */ +public record QueryResult(List results) { + + @Override + public List results() { + return ImmutableList.copyOf(results); + } +} diff --git a/java-shared-dependencies/dependency-analyzer/src/main/java/com/google/cloud/model/Relation.java b/java-shared-dependencies/dependency-analyzer/src/main/java/com/google/cloud/model/Relation.java new file mode 100644 index 0000000000..1302e37dca --- /dev/null +++ b/java-shared-dependencies/dependency-analyzer/src/main/java/com/google/cloud/model/Relation.java @@ -0,0 +1,12 @@ +package com.google.cloud.model; + +/** + * Relationship between two packages within a dependency graph. + *

        + * For more information, please refer to GetDependencies. + */ +public enum Relation { + SELF, + DIRECT, + INDIRECT +} diff --git a/java-shared-dependencies/dependency-analyzer/src/main/java/com/google/cloud/model/ReportResult.java b/java-shared-dependencies/dependency-analyzer/src/main/java/com/google/cloud/model/ReportResult.java new file mode 100644 index 0000000000..d42a4b8bef --- /dev/null +++ b/java-shared-dependencies/dependency-analyzer/src/main/java/com/google/cloud/model/ReportResult.java @@ -0,0 +1,17 @@ +package com.google.cloud.model; + +public enum ReportResult { + PASS("Pass, package has no known vulnerabilities and non-compliant licenses."), + FAIL("Fail, package has known vulnerabilities or non-compliant licenses."); + + private final String message; + + ReportResult(String message) { + this.message = message; + } + + @Override + public String toString() { + return String.format("Analyze result: %s", message); + } +} diff --git a/java-shared-dependencies/dependency-analyzer/src/main/java/com/google/cloud/model/Result.java b/java-shared-dependencies/dependency-analyzer/src/main/java/com/google/cloud/model/Result.java new file mode 100644 index 0000000000..8b14505af3 --- /dev/null +++ b/java-shared-dependencies/dependency-analyzer/src/main/java/com/google/cloud/model/Result.java @@ -0,0 +1,8 @@ +package com.google.cloud.model; + +/** + * A single Result within a {@link QueryResult}, also a wrapper around {@link Version}. + */ +public record Result(Version version) { + +} diff --git a/java-shared-dependencies/dependency-analyzer/src/main/java/com/google/cloud/model/Version.java b/java-shared-dependencies/dependency-analyzer/src/main/java/com/google/cloud/model/Version.java new file mode 100644 index 0000000000..16acce8623 --- /dev/null +++ b/java-shared-dependencies/dependency-analyzer/src/main/java/com/google/cloud/model/Version.java @@ -0,0 +1,29 @@ +package com.google.cloud.model; + +import com.google.common.collect.ImmutableList; +import java.util.List; + +/** + * Information about a specific package version, including its licenses and any security advisories + * known to affect it. + *

        + * For more information, please refer to GetVersion. + * + * @param versionKey The name of the package version. + * @param licenses The licenses governing the use of this package version. + * @param advisoryKeys Security advisories known to affect this package version. + */ +public record Version( + VersionKey versionKey, + List licenses, + List advisoryKeys) { + + public List advisoryKeys() { + return ImmutableList.copyOf(advisoryKeys); + } + + public List licenses() { + return ImmutableList.copyOf(licenses); + } +} diff --git a/java-shared-dependencies/dependency-analyzer/src/main/java/com/google/cloud/model/VersionKey.java b/java-shared-dependencies/dependency-analyzer/src/main/java/com/google/cloud/model/VersionKey.java new file mode 100644 index 0000000000..589ae7190a --- /dev/null +++ b/java-shared-dependencies/dependency-analyzer/src/main/java/com/google/cloud/model/VersionKey.java @@ -0,0 +1,35 @@ +package com.google.cloud.model; + +/** + * The name of the package version. + */ + +public record VersionKey( + PkgManagement pkgManagement, + String name, + String version) { + + public static VersionKey from(String system, String name, String version) + throws IllegalArgumentException { + PkgManagement pkg = PkgManagement.valueOf(system.toUpperCase()); + if (!PkgManagement.checkPackageName(pkg, name)) { + throw new IllegalArgumentException( + String.format("%s is an incorrect package name in %s package management system", name, + pkg)); + } + return new VersionKey(pkg, name, version); + } + + @Override + public String toString() { + if (pkgManagement == PkgManagement.MAVEN) { + return String.format("%s:%s", name, version); + } + + return "VersionKey{" + + "pkgManagement=" + pkgManagement + + ", name='" + name + '\'' + + ", version='" + version + '\'' + + '}'; + } +} diff --git a/java-shared-dependencies/dependency-analyzer/src/test/java/com/google/cloud/external/DepsDevClientTest.java b/java-shared-dependencies/dependency-analyzer/src/test/java/com/google/cloud/external/DepsDevClientTest.java new file mode 100644 index 0000000000..4ac683d4ef --- /dev/null +++ b/java-shared-dependencies/dependency-analyzer/src/test/java/com/google/cloud/external/DepsDevClientTest.java @@ -0,0 +1,76 @@ +package com.google.cloud.external; + +import static com.google.common.truth.Truth.assertThat; +import static org.junit.Assert.assertEquals; +import static org.mockito.ArgumentMatchers.any; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.when; + +import com.google.cloud.model.AdvisoryKey; +import com.google.cloud.model.QueryResult; +import com.google.cloud.model.Version; +import com.google.cloud.model.VersionKey; +import java.io.IOException; +import java.net.URISyntaxException; +import java.net.http.HttpClient; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.net.http.HttpResponse.BodyHandler; +import java.util.List; +import org.junit.Before; +import org.junit.Test; + +public class DepsDevClientTest { + + private HttpResponse response; + private DepsDevClient client; + + @Before + public void setUp() throws IOException, InterruptedException { + HttpClient httpClient = mock(HttpClient.class); + client = new DepsDevClient(httpClient); + response = mock(HttpResponse.class); + when(httpClient.send(any(HttpRequest.class), any(BodyHandler.class))) + .thenReturn(response); + } + + @Test + public void testGetQueryUrlReturnsEncodedUrl() { + assertEquals( + "https://api.deps.dev/v3/query?versionKey.system=MAVEN&versionKey.name=com.google.errorprone:javac-shaded&versionKey.version=9%2B181-r4173-1", + client.getQueryUrl("MAVEN", "com.google.errorprone:javac-shaded", "9+181-r4173-1")); + } + + @Test + public void testGetDependenciesReturnsEncodedUrl() { + assertEquals( + "https://api.deps.dev/v3/systems/MAVEN/packages/com.google.errorprone:javac-shaded/versions/9%2B181-r4173-1:dependencies", + client.getDependencyUrl("MAVEN", "com.google.errorprone:javac-shaded", "9+181-r4173-1")); + } + + @Test + public void testGetDirectDependenciesOnlyReturnsDirectDeps() + throws IOException, InterruptedException, URISyntaxException, IllegalArgumentException { + String responseBody = "{\"nodes\":[{\"versionKey\":{\"system\":\"MAVEN\", \"name\":\"com.example:example\", \"version\":\"1.2.3\"}, \"bundled\":false, \"relation\":\"SELF\", \"errors\":[]}, {\"versionKey\":{\"system\":\"MAVEN\", \"name\":\"com.example:indirect-dep\", \"version\":\"4.0.0\"}, \"bundled\":false, \"relation\":\"INDIRECT\", \"errors\":[]}, {\"versionKey\":{\"system\":\"MAVEN\", \"name\":\"com.example:direct-dep\", \"version\":\"1.4.0\"}, \"bundled\":false, \"relation\":\"DIRECT\", \"errors\":[]}], \"edges\":[{\"fromNode\":0, \"toNode\":2, \"requirement\":\"^1.1.0\"}, {\"fromNode\":2, \"toNode\":1, \"requirement\":\"^3.0.0 || ^4.0.0\"}], \"error\":\"\"}"; + when(response.body()).thenReturn(responseBody); + VersionKey example = VersionKey.from("maven", "com.example:example", "1.2.3"); + VersionKey direct = VersionKey.from("maven", "com.example:direct-dep", "1.4.0"); + List coordinates = client.getDirectDependencies(example); + assertThat(coordinates).containsExactlyElementsIn(List.of(direct)); + } + + @Test + public void testGetQueryResultSucceed() + throws URISyntaxException, IOException, InterruptedException, IllegalArgumentException { + String responseBody = "{\"results\":[{\"version\":{\"versionKey\":{\"system\":\"MAVEN\",\"name\":\"org.apache.logging.log4j:log4j-core\",\"version\":\"2.17.0\"},\"publishedAt\":\"2021-12-18T01:58:10Z\",\"isDefault\":false,\"licenses\":[\"Apache-2.0\"],\"advisoryKeys\":[{\"id\":\"GHSA-8489-44mv-ggj8\"}],\"links\":[{\"label\":\"SOURCE_REPO\",\"url\":\"https://gitbox.apache.org/repos/asf?p=logging-log4j2.git\"},{\"label\":\"ISSUE_TRACKER\",\"url\":\"https://issues.apache.org/jira/browse/LOG4J2\"},{\"label\":\"HOMEPAGE\",\"url\":\"https://logging.apache.org/log4j/2.x/\"}],\"slsaProvenances\":[],\"registries\":[\"https://repo.maven.apache.org/maven2/\"],\"relatedProjects\":[{\"projectKey\":{\"id\":\"\"},\"relationProvenance\":\"UNVERIFIED_METADATA\",\"relationType\":\"ISSUE_TRACKER\"}]}}]}"; + when(response.body()).thenReturn(responseBody); + VersionKey log4jCore = + VersionKey.from("maven", "org.apache.logging.log4j:log4j-core", "2.17.0"); + QueryResult queryResult = client.getQueryResult(log4jCore); + assertThat(queryResult.results()).hasSize(1); + Version version = queryResult.results().get(0).version(); + assertThat(version.advisoryKeys()).isEqualTo(List.of(new AdvisoryKey("GHSA-8489-44mv-ggj8"))); + assertThat(version.licenses()).isEqualTo(List.of("Apache-2.0")); + assertThat(version.versionKey()).isEqualTo(log4jCore); + } +} diff --git a/java-shared-dependencies/dependency-analyzer/src/test/java/com/google/cloud/external/GitHubClientTest.java b/java-shared-dependencies/dependency-analyzer/src/test/java/com/google/cloud/external/GitHubClientTest.java new file mode 100644 index 0000000000..dae0d1fc79 --- /dev/null +++ b/java-shared-dependencies/dependency-analyzer/src/test/java/com/google/cloud/external/GitHubClientTest.java @@ -0,0 +1,65 @@ +package com.google.cloud.external; + +import static org.junit.Assert.assertEquals; +import static org.mockito.ArgumentMatchers.any; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.when; + +import com.google.cloud.model.Interval; +import com.google.cloud.model.PullRequestStatistics; +import java.io.IOException; +import java.net.URISyntaxException; +import java.net.http.HttpClient; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.net.http.HttpResponse.BodyHandler; +import java.nio.file.Files; +import java.nio.file.Path; +import java.time.Instant; +import java.time.ZoneId; +import java.time.ZonedDateTime; +import org.junit.Before; +import org.junit.Test; +import org.mockito.MockedStatic; +import org.mockito.Mockito; + +public class GitHubClientTest { + + private HttpResponse response; + private GitHubClient client; + + @Before + public void setUp() throws IOException, InterruptedException { + HttpClient httpClient = mock(HttpClient.class); + client = new GitHubClient(httpClient); + response = mock(HttpResponse.class); + when(httpClient.send(any(HttpRequest.class), any(BodyHandler.class))).thenReturn(response); + } + + @Test + public void testListMonthlyPullRequestStatusSucceeds() + throws URISyntaxException, IOException, InterruptedException { + ZonedDateTime fixedNow = ZonedDateTime.parse("2024-05-22T09:33:52Z"); + ZonedDateTime lastMonth = ZonedDateTime.parse("2024-04-22T09:33:52Z"); + Instant prInstant = Instant.parse("2024-05-10T09:33:52Z"); + ZonedDateTime prTime = ZonedDateTime.parse("2024-05-10T09:33:52Z"); + String responseBody = + Files.readString(Path.of("src/test/resources/pull_request_sample_response.txt")); + + try (MockedStatic mockedLocalDateTime = Mockito.mockStatic(ZonedDateTime.class); + MockedStatic mockedInstant = Mockito.mockStatic(Instant.class)) { + mockedLocalDateTime.when(ZonedDateTime::now).thenReturn(fixedNow); + mockedInstant.when(() -> Instant.parse(Mockito.anyString())).thenReturn(prInstant); + when(fixedNow.minusDays(30)).thenReturn(lastMonth); + when(prInstant.atZone(ZoneId.of("UTC"))).thenReturn(prTime); + when(response.body()).thenReturn(responseBody); + String org = ""; + String repo = ""; + PullRequestStatistics status = client.listMonthlyPullRequestStatusOf(org, repo); + + assertEquals(Interval.MONTHLY, status.interval()); + assertEquals(3, status.created()); + assertEquals(7, status.merged()); + } + } +} diff --git a/java-shared-dependencies/dependency-analyzer/src/test/java/com/google/cloud/model/AnalysisResultTest.java b/java-shared-dependencies/dependency-analyzer/src/test/java/com/google/cloud/model/AnalysisResultTest.java new file mode 100644 index 0000000000..ab3bd50b0e --- /dev/null +++ b/java-shared-dependencies/dependency-analyzer/src/test/java/com/google/cloud/model/AnalysisResultTest.java @@ -0,0 +1,151 @@ +package com.google.cloud.model; + + +import static org.junit.Assert.assertEquals; + +import java.util.List; +import org.junit.Test; + +public class AnalysisResultTest { + + @Test + public void testGenerateReportWithAdvisoriesReturnsFailure() + throws IllegalArgumentException { + VersionKey root = VersionKey.from("maven", "com.example:artifact", "1.2.3"); + List results = List.of( + new PackageInfo( + root, + List.of(), + List.of(new Advisory( + new AdvisoryKey("GHSA-2qrg-x229-3v8q"), + "https://osv.dev/vulnerability/GHSA-2qrg-x229-3v8q", + "Deserialization of Untrusted Data in Log4j", + new String[]{"CVE-2019-17571"}, + 9.8, + "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H" + )) + ) + ); + ReportResult result = AnalysisResult.of(results).getAnalysisResult(); + assertEquals(ReportResult.FAIL, result); + } + + @Test + public void testGenerateReportWithNonCompliantLicenseReturnsFailure() + throws IllegalArgumentException { + VersionKey root = VersionKey.from("maven", "com.example:artifact", "1.2.3"); + List results = List.of( + new PackageInfo( + root, + List.of(License.toLicense("BCL")), + List.of() + ) + ); + ReportResult result = AnalysisResult.of(results).getAnalysisResult(); + assertEquals(ReportResult.FAIL, result); + } + + @Test + public void testGenerateReportWithoutRiskSucceeds() + throws IllegalArgumentException { + VersionKey root = VersionKey.from("maven", "com.example:artifact", "1.2.3"); + List results = List.of( + new PackageInfo( + root, + List.of(License.toLicense("Apache-2.0")), + List.of() + ) + ); + ReportResult result = AnalysisResult.of(results).getAnalysisResult(); + assertEquals(ReportResult.PASS, result); + } + + @Test + public void testToStringReturnsNoRiskInformation() { + VersionKey root = VersionKey.from("maven", "com.example:artifact", "1.2.3"); + List results = List.of( + new PackageInfo( + root, + List.of(License.toLicense("Apache-2.0")), + List.of() + ), + new PackageInfo( + VersionKey.from("maven", "com.example:dependency", "4.5.6"), + List.of(License.toLicense("Apache-2.0"), License.toLicense("MIT")), + List.of() + ), + new PackageInfo( + VersionKey.from("maven", "com.example:nested-dependency", "2.3.1"), + List.of(License.toLicense("Apache-2.0"), License.toLicense("MIT")), + List.of() + ) + ); + assertEquals(""" + ## Package information of com.example:artifact:1.2.3 + Licenses: [Apache-2.0 (Google-compliant)] + Vulnerabilities: []. + Checked in [com.example:artifact (1.2.3)](https://api.deps.dev/v3/query?versionKey.system=MAVEN&versionKey.name=com.example:artifact&versionKey.version=1.2.3) + + ## Dependencies + ### Package information of com.example:dependency:4.5.6 + Licenses: [Apache-2.0 (Google-compliant), MIT (Google-compliant)] + Vulnerabilities: []. + Checked in [com.example:dependency (4.5.6)](https://api.deps.dev/v3/query?versionKey.system=MAVEN&versionKey.name=com.example:dependency&versionKey.version=4.5.6) + + ### Package information of com.example:nested-dependency:2.3.1 + Licenses: [Apache-2.0 (Google-compliant), MIT (Google-compliant)] + Vulnerabilities: []. + Checked in [com.example:nested-dependency (2.3.1)](https://api.deps.dev/v3/query?versionKey.system=MAVEN&versionKey.name=com.example:nested-dependency&versionKey.version=2.3.1) + + + """, AnalysisResult.of(results).toString()); + } + + @Test + public void testToStringReturnsRiskInformation() { + VersionKey root = VersionKey.from("maven", "com.example:artifact", "1.2.3"); + List results = List.of( + new PackageInfo( + root, + List.of(License.APACHE_2_0, License.BCL), + List.of() + ), + new PackageInfo( + VersionKey.from("maven", "com.example:dependency", "4.5.6"), + List.of(License.MIT), + List.of(new Advisory( + new AdvisoryKey("GHSA-2qrg-x229-3v8q"), + "https://osv.dev/vulnerability/GHSA-2qrg-x229-3v8q", + "Deserialization of Untrusted Data in Log4j", + new String[]{"CVE-2019-17571"}, + 9.8, + "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H" + )) + ), + new PackageInfo( + VersionKey.from("maven", "com.example:nested-dependency", "2.3.1"), + List.of(License.MIT, License.GL2PS), + List.of() + ) + ); + assertEquals(""" + ## Package information of com.example:artifact:1.2.3 + Licenses: [Apache-2.0 (Google-compliant), BCL (Not Google-compliant!)] + Vulnerabilities: []. + Checked in [com.example:artifact (1.2.3)](https://api.deps.dev/v3/query?versionKey.system=MAVEN&versionKey.name=com.example:artifact&versionKey.version=1.2.3) + + ## Dependencies + ### Package information of com.example:dependency:4.5.6 + Licenses: [MIT (Google-compliant)] + Vulnerabilities: [Advisory (id: GHSA-2qrg-x229-3v8q, more info: [Deserialization of Untrusted Data in Log4j](https://osv.dev/vulnerability/GHSA-2qrg-x229-3v8q))]. + Checked in [com.example:dependency (4.5.6)](https://api.deps.dev/v3/query?versionKey.system=MAVEN&versionKey.name=com.example:dependency&versionKey.version=4.5.6) + + ### Package information of com.example:nested-dependency:2.3.1 + Licenses: [MIT (Google-compliant), GL2PS (Not Google-compliant!)] + Vulnerabilities: []. + Checked in [com.example:nested-dependency (2.3.1)](https://api.deps.dev/v3/query?versionKey.system=MAVEN&versionKey.name=com.example:nested-dependency&versionKey.version=2.3.1) + + + """, AnalysisResult.of(results).toString()); + } +} diff --git a/java-shared-dependencies/dependency-analyzer/src/test/java/com/google/cloud/model/LicenseTest.java b/java-shared-dependencies/dependency-analyzer/src/test/java/com/google/cloud/model/LicenseTest.java new file mode 100644 index 0000000000..9973a50eb5 --- /dev/null +++ b/java-shared-dependencies/dependency-analyzer/src/test/java/com/google/cloud/model/LicenseTest.java @@ -0,0 +1,38 @@ +package com.google.cloud.model; + +import static org.junit.Assert.assertEquals; + +import org.junit.Test; + +public class LicenseTest { + + @Test + public void testToLicenseSucceeds() { + String license = "Apache-2.0"; + assertEquals(License.APACHE_2_0, License.toLicense(license)); + } + + @Test + public void testToLicenseReturnsNonRecognizedLicense() { + String license = "Non-existent-license"; + assertEquals(License.NOT_RECOGNIZED, License.toLicense(license)); + } + + @Test + public void testToStringOfACompliantLicense() { + String license = "Apache-2.0"; + assertEquals("Apache-2.0 (Google-compliant)", License.toLicense(license).toString()); + } + + @Test + public void testToStringOfANonCompliantLicense() { + String license = "BCL"; + assertEquals("BCL (Not Google-compliant!)", License.toLicense(license).toString()); + } + + @Test + public void testToStringOfANotRecognizedLicense() { + String license = "Non-existent-license"; + assertEquals("Not-Recognized (Not Google-compliant!)", License.toLicense(license).toString()); + } +} diff --git a/java-shared-dependencies/dependency-analyzer/src/test/java/com/google/cloud/model/VersionKeyTest.java b/java-shared-dependencies/dependency-analyzer/src/test/java/com/google/cloud/model/VersionKeyTest.java new file mode 100644 index 0000000000..ed7e040101 --- /dev/null +++ b/java-shared-dependencies/dependency-analyzer/src/test/java/com/google/cloud/model/VersionKeyTest.java @@ -0,0 +1,23 @@ +package com.google.cloud.model; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertThrows; + +import org.junit.Test; + +public class VersionKeyTest { + + @Test + public void testVersionKeyWithIncorrectNameThrowsException() { + assertThrows("artifact is an incorrect package name in MAVEN package management system", IllegalArgumentException.class, + () -> VersionKey.from("maven", "artifact", "1.2.3")); + } + + @Test + public void testVersionKeyWithCorrectNameSucceeds() throws IllegalArgumentException { + VersionKey versionKey = VersionKey.from("maven", "group:artifact", "1.2.3"); + assertEquals(PkgManagement.MAVEN, versionKey.pkgManagement()); + assertEquals("group:artifact", versionKey.name()); + assertEquals("1.2.3", versionKey.version()); + } +} diff --git a/java-shared-dependencies/dependency-analyzer/src/test/resources/pull_request_sample_response.txt b/java-shared-dependencies/dependency-analyzer/src/test/resources/pull_request_sample_response.txt new file mode 100644 index 0000000000..6a91ff6d04 --- /dev/null +++ b/java-shared-dependencies/dependency-analyzer/src/test/resources/pull_request_sample_response.txt @@ -0,0 +1 @@ +[{"url":"https://api.github.com/repos/googleapis/sdk-platform-java/pulls/2771","id":1869761809,"node_id":"PR_kwDOD7wwCM5vck0R","html_url":"https://github.com/googleapis/sdk-platform-java/pull/2771","diff_url":"https://github.com/googleapis/sdk-platform-java/pull/2771.diff","patch_url":"https://github.com/googleapis/sdk-platform-java/pull/2771.patch","issue_url":"https://api.github.com/repos/googleapis/sdk-platform-java/issues/2771","number":2771,"state":"open","locked":false,"title":"chore: Migrate Gapic-Generator-Java to JUnit5","user":{"login":"lqiu96","id":6621793,"node_id":"MDQ6VXNlcjY2MjE3OTM=","avatar_url":"https://avatars.githubusercontent.com/u/6621793?v=4","gravatar_id":"","url":"https://api.github.com/users/lqiu96","html_url":"https://github.com/lqiu96","followers_url":"https://api.github.com/users/lqiu96/followers","following_url":"https://api.github.com/users/lqiu96/following{/other_user}","gists_url":"https://api.github.com/users/lqiu96/gists{/gist_id}","starred_url":"https://api.github.com/users/lqiu96/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lqiu96/subscriptions","organizations_url":"https://api.github.com/users/lqiu96/orgs","repos_url":"https://api.github.com/users/lqiu96/repos","events_url":"https://api.github.com/users/lqiu96/events{/privacy}","received_events_url":"https://api.github.com/users/lqiu96/received_events","type":"User","site_admin":false},"body":"Fixes: https://github.com/googleapis/sdk-platform-java/issues/2725","created_at":"2024-05-14T19:49:38Z","updated_at":"2024-05-14T19:59:58Z","closed_at":null,"merged_at":null,"merge_commit_sha":"27a9dcb008bc1c9658c98d4e9d2f08d8e167e9b8","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":5132010215,"node_id":"LA_kwDOD7wwCM8AAAABMeRC5w","url":"https://api.github.com/repos/googleapis/sdk-platform-java/labels/size:%20l","name":"size: l","color":"1d0ef7","default":false,"description":"Pull request size is large."}],"milestone":null,"draft":true,"commits_url":"https://api.github.com/repos/googleapis/sdk-platform-java/pulls/2771/commits","review_comments_url":"https://api.github.com/repos/googleapis/sdk-platform-java/pulls/2771/comments","review_comment_url":"https://api.github.com/repos/googleapis/sdk-platform-java/pulls/comments{/number}","comments_url":"https://api.github.com/repos/googleapis/sdk-platform-java/issues/2771/comments","statuses_url":"https://api.github.com/repos/googleapis/sdk-platform-java/statuses/a73482f9a4e93bed1544bf47b2e2bc6f452c8eee","head":{"label":"googleapis:gapic-generator-junit5","ref":"gapic-generator-junit5","sha":"a73482f9a4e93bed1544bf47b2e2bc6f452c8eee","user":{"login":"googleapis","id":16785467,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE2Nzg1NDY3","avatar_url":"https://avatars.githubusercontent.com/u/16785467?v=4","gravatar_id":"","url":"https://api.github.com/users/googleapis","html_url":"https://github.com/googleapis","followers_url":"https://api.github.com/users/googleapis/followers","following_url":"https://api.github.com/users/googleapis/following{/other_user}","gists_url":"https://api.github.com/users/googleapis/gists{/gist_id}","starred_url":"https://api.github.com/users/googleapis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/googleapis/subscriptions","organizations_url":"https://api.github.com/users/googleapis/orgs","repos_url":"https://api.github.com/users/googleapis/repos","events_url":"https://api.github.com/users/googleapis/events{/privacy}","received_events_url":"https://api.github.com/users/googleapis/received_events","type":"Organization","site_admin":false},"repo":{"id":263991304,"node_id":"MDEwOlJlcG9zaXRvcnkyNjM5OTEzMDQ=","name":"sdk-platform-java","full_name":"googleapis/sdk-platform-java","private":false,"owner":{"login":"googleapis","id":16785467,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE2Nzg1NDY3","avatar_url":"https://avatars.githubusercontent.com/u/16785467?v=4","gravatar_id":"","url":"https://api.github.com/users/googleapis","html_url":"https://github.com/googleapis","followers_url":"https://api.github.com/users/googleapis/followers","following_url":"https://api.github.com/users/googleapis/following{/other_user}","gists_url":"https://api.github.com/users/googleapis/gists{/gist_id}","starred_url":"https://api.github.com/users/googleapis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/googleapis/subscriptions","organizations_url":"https://api.github.com/users/googleapis/orgs","repos_url":"https://api.github.com/users/googleapis/repos","events_url":"https://api.github.com/users/googleapis/events{/privacy}","received_events_url":"https://api.github.com/users/googleapis/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/googleapis/sdk-platform-java","description":"Tooling and shared libraries for Cloud SDK for Java","fork":false,"url":"https://api.github.com/repos/googleapis/sdk-platform-java","forks_url":"https://api.github.com/repos/googleapis/sdk-platform-java/forks","keys_url":"https://api.github.com/repos/googleapis/sdk-platform-java/keys{/key_id}","collaborators_url":"https://api.github.com/repos/googleapis/sdk-platform-java/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/googleapis/sdk-platform-java/teams","hooks_url":"https://api.github.com/repos/googleapis/sdk-platform-java/hooks","issue_events_url":"https://api.github.com/repos/googleapis/sdk-platform-java/issues/events{/number}","events_url":"https://api.github.com/repos/googleapis/sdk-platform-java/events","assignees_url":"https://api.github.com/repos/googleapis/sdk-platform-java/assignees{/user}","branches_url":"https://api.github.com/repos/googleapis/sdk-platform-java/branches{/branch}","tags_url":"https://api.github.com/repos/googleapis/sdk-platform-java/tags","blobs_url":"https://api.github.com/repos/googleapis/sdk-platform-java/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/googleapis/sdk-platform-java/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/googleapis/sdk-platform-java/git/refs{/sha}","trees_url":"https://api.github.com/repos/googleapis/sdk-platform-java/git/trees{/sha}","statuses_url":"https://api.github.com/repos/googleapis/sdk-platform-java/statuses/{sha}","languages_url":"https://api.github.com/repos/googleapis/sdk-platform-java/languages","stargazers_url":"https://api.github.com/repos/googleapis/sdk-platform-java/stargazers","contributors_url":"https://api.github.com/repos/googleapis/sdk-platform-java/contributors","subscribers_url":"https://api.github.com/repos/googleapis/sdk-platform-java/subscribers","subscription_url":"https://api.github.com/repos/googleapis/sdk-platform-java/subscription","commits_url":"https://api.github.com/repos/googleapis/sdk-platform-java/commits{/sha}","git_commits_url":"https://api.github.com/repos/googleapis/sdk-platform-java/git/commits{/sha}","comments_url":"https://api.github.com/repos/googleapis/sdk-platform-java/comments{/number}","issue_comment_url":"https://api.github.com/repos/googleapis/sdk-platform-java/issues/comments{/number}","contents_url":"https://api.github.com/repos/googleapis/sdk-platform-java/contents/{+path}","compare_url":"https://api.github.com/repos/googleapis/sdk-platform-java/compare/{base}...{head}","merges_url":"https://api.github.com/repos/googleapis/sdk-platform-java/merges","archive_url":"https://api.github.com/repos/googleapis/sdk-platform-java/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/googleapis/sdk-platform-java/downloads","issues_url":"https://api.github.com/repos/googleapis/sdk-platform-java/issues{/number}","pulls_url":"https://api.github.com/repos/googleapis/sdk-platform-java/pulls{/number}","milestones_url":"https://api.github.com/repos/googleapis/sdk-platform-java/milestones{/number}","notifications_url":"https://api.github.com/repos/googleapis/sdk-platform-java/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/googleapis/sdk-platform-java/labels{/name}","releases_url":"https://api.github.com/repos/googleapis/sdk-platform-java/releases{/id}","deployments_url":"https://api.github.com/repos/googleapis/sdk-platform-java/deployments","created_at":"2020-05-14T18:15:25Z","updated_at":"2024-05-14T20:57:11Z","pushed_at":"2024-05-14T21:09:51Z","git_url":"git://github.com/googleapis/sdk-platform-java.git","ssh_url":"git@github.com:googleapis/sdk-platform-java.git","clone_url":"https://github.com/googleapis/sdk-platform-java.git","svn_url":"https://github.com/googleapis/sdk-platform-java","homepage":"https://cloud.google.com/java/docs/bom","size":40540,"stargazers_count":59,"watchers_count":59,"language":"Java","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"has_discussions":false,"forks_count":47,"mirror_url":null,"archived":false,"disabled":false,"open_issues_count":189,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"allow_forking":true,"is_template":false,"web_commit_signoff_required":false,"topics":[],"visibility":"public","forks":47,"open_issues":189,"watchers":59,"default_branch":"main"}},"base":{"label":"googleapis:main","ref":"main","sha":"b87356c1d80559fd5ca85ee0edfa3e5f24db6b17","user":{"login":"googleapis","id":16785467,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE2Nzg1NDY3","avatar_url":"https://avatars.githubusercontent.com/u/16785467?v=4","gravatar_id":"","url":"https://api.github.com/users/googleapis","html_url":"https://github.com/googleapis","followers_url":"https://api.github.com/users/googleapis/followers","following_url":"https://api.github.com/users/googleapis/following{/other_user}","gists_url":"https://api.github.com/users/googleapis/gists{/gist_id}","starred_url":"https://api.github.com/users/googleapis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/googleapis/subscriptions","organizations_url":"https://api.github.com/users/googleapis/orgs","repos_url":"https://api.github.com/users/googleapis/repos","events_url":"https://api.github.com/users/googleapis/events{/privacy}","received_events_url":"https://api.github.com/users/googleapis/received_events","type":"Organization","site_admin":false},"repo":{"id":263991304,"node_id":"MDEwOlJlcG9zaXRvcnkyNjM5OTEzMDQ=","name":"sdk-platform-java","full_name":"googleapis/sdk-platform-java","private":false,"owner":{"login":"googleapis","id":16785467,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE2Nzg1NDY3","avatar_url":"https://avatars.githubusercontent.com/u/16785467?v=4","gravatar_id":"","url":"https://api.github.com/users/googleapis","html_url":"https://github.com/googleapis","followers_url":"https://api.github.com/users/googleapis/followers","following_url":"https://api.github.com/users/googleapis/following{/other_user}","gists_url":"https://api.github.com/users/googleapis/gists{/gist_id}","starred_url":"https://api.github.com/users/googleapis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/googleapis/subscriptions","organizations_url":"https://api.github.com/users/googleapis/orgs","repos_url":"https://api.github.com/users/googleapis/repos","events_url":"https://api.github.com/users/googleapis/events{/privacy}","received_events_url":"https://api.github.com/users/googleapis/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/googleapis/sdk-platform-java","description":"Tooling and shared libraries for Cloud SDK for Java","fork":false,"url":"https://api.github.com/repos/googleapis/sdk-platform-java","forks_url":"https://api.github.com/repos/googleapis/sdk-platform-java/forks","keys_url":"https://api.github.com/repos/googleapis/sdk-platform-java/keys{/key_id}","collaborators_url":"https://api.github.com/repos/googleapis/sdk-platform-java/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/googleapis/sdk-platform-java/teams","hooks_url":"https://api.github.com/repos/googleapis/sdk-platform-java/hooks","issue_events_url":"https://api.github.com/repos/googleapis/sdk-platform-java/issues/events{/number}","events_url":"https://api.github.com/repos/googleapis/sdk-platform-java/events","assignees_url":"https://api.github.com/repos/googleapis/sdk-platform-java/assignees{/user}","branches_url":"https://api.github.com/repos/googleapis/sdk-platform-java/branches{/branch}","tags_url":"https://api.github.com/repos/googleapis/sdk-platform-java/tags","blobs_url":"https://api.github.com/repos/googleapis/sdk-platform-java/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/googleapis/sdk-platform-java/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/googleapis/sdk-platform-java/git/refs{/sha}","trees_url":"https://api.github.com/repos/googleapis/sdk-platform-java/git/trees{/sha}","statuses_url":"https://api.github.com/repos/googleapis/sdk-platform-java/statuses/{sha}","languages_url":"https://api.github.com/repos/googleapis/sdk-platform-java/languages","stargazers_url":"https://api.github.com/repos/googleapis/sdk-platform-java/stargazers","contributors_url":"https://api.github.com/repos/googleapis/sdk-platform-java/contributors","subscribers_url":"https://api.github.com/repos/googleapis/sdk-platform-java/subscribers","subscription_url":"https://api.github.com/repos/googleapis/sdk-platform-java/subscription","commits_url":"https://api.github.com/repos/googleapis/sdk-platform-java/commits{/sha}","git_commits_url":"https://api.github.com/repos/googleapis/sdk-platform-java/git/commits{/sha}","comments_url":"https://api.github.com/repos/googleapis/sdk-platform-java/comments{/number}","issue_comment_url":"https://api.github.com/repos/googleapis/sdk-platform-java/issues/comments{/number}","contents_url":"https://api.github.com/repos/googleapis/sdk-platform-java/contents/{+path}","compare_url":"https://api.github.com/repos/googleapis/sdk-platform-java/compare/{base}...{head}","merges_url":"https://api.github.com/repos/googleapis/sdk-platform-java/merges","archive_url":"https://api.github.com/repos/googleapis/sdk-platform-java/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/googleapis/sdk-platform-java/downloads","issues_url":"https://api.github.com/repos/googleapis/sdk-platform-java/issues{/number}","pulls_url":"https://api.github.com/repos/googleapis/sdk-platform-java/pulls{/number}","milestones_url":"https://api.github.com/repos/googleapis/sdk-platform-java/milestones{/number}","notifications_url":"https://api.github.com/repos/googleapis/sdk-platform-java/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/googleapis/sdk-platform-java/labels{/name}","releases_url":"https://api.github.com/repos/googleapis/sdk-platform-java/releases{/id}","deployments_url":"https://api.github.com/repos/googleapis/sdk-platform-java/deployments","created_at":"2020-05-14T18:15:25Z","updated_at":"2024-05-14T20:57:11Z","pushed_at":"2024-05-14T21:09:51Z","git_url":"git://github.com/googleapis/sdk-platform-java.git","ssh_url":"git@github.com:googleapis/sdk-platform-java.git","clone_url":"https://github.com/googleapis/sdk-platform-java.git","svn_url":"https://github.com/googleapis/sdk-platform-java","homepage":"https://cloud.google.com/java/docs/bom","size":40540,"stargazers_count":59,"watchers_count":59,"language":"Java","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"has_discussions":false,"forks_count":47,"mirror_url":null,"archived":false,"disabled":false,"open_issues_count":189,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"allow_forking":true,"is_template":false,"web_commit_signoff_required":false,"topics":[],"visibility":"public","forks":47,"open_issues":189,"watchers":59,"default_branch":"main"}},"_links":{"self":{"href":"https://api.github.com/repos/googleapis/sdk-platform-java/pulls/2771"},"html":{"href":"https://github.com/googleapis/sdk-platform-java/pull/2771"},"issue":{"href":"https://api.github.com/repos/googleapis/sdk-platform-java/issues/2771"},"comments":{"href":"https://api.github.com/repos/googleapis/sdk-platform-java/issues/2771/comments"},"review_comments":{"href":"https://api.github.com/repos/googleapis/sdk-platform-java/pulls/2771/comments"},"review_comment":{"href":"https://api.github.com/repos/googleapis/sdk-platform-java/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/googleapis/sdk-platform-java/pulls/2771/commits"},"statuses":{"href":"https://api.github.com/repos/googleapis/sdk-platform-java/statuses/a73482f9a4e93bed1544bf47b2e2bc6f452c8eee"}},"author_association":"CONTRIBUTOR","auto_merge":null,"active_lock_reason":null},{"url":"https://api.github.com/repos/googleapis/sdk-platform-java/pulls/2770","id":1869660712,"node_id":"PR_kwDOD7wwCM5vcMIo","html_url":"https://github.com/googleapis/sdk-platform-java/pull/2770","diff_url":"https://github.com/googleapis/sdk-platform-java/pull/2770.diff","patch_url":"https://github.com/googleapis/sdk-platform-java/pull/2770.patch","issue_url":"https://api.github.com/repos/googleapis/sdk-platform-java/issues/2770","number":2770,"state":"closed","locked":false,"title":"test(deps): update dependency org.mockito:mockito-core to v5.12.0","user":{"login":"renovate-bot","id":25180681,"node_id":"MDQ6VXNlcjI1MTgwNjgx","avatar_url":"https://avatars.githubusercontent.com/u/25180681?v=4","gravatar_id":"","url":"https://api.github.com/users/renovate-bot","html_url":"https://github.com/renovate-bot","followers_url":"https://api.github.com/users/renovate-bot/followers","following_url":"https://api.github.com/users/renovate-bot/following{/other_user}","gists_url":"https://api.github.com/users/renovate-bot/gists{/gist_id}","starred_url":"https://api.github.com/users/renovate-bot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/renovate-bot/subscriptions","organizations_url":"https://api.github.com/users/renovate-bot/orgs","repos_url":"https://api.github.com/users/renovate-bot/repos","events_url":"https://api.github.com/users/renovate-bot/events{/privacy}","received_events_url":"https://api.github.com/users/renovate-bot/received_events","type":"User","site_admin":false},"body":"[![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)\n\nThis PR contains the following updates:\n\n| Package | Change | Age | Adoption | Passing | Confidence |\n|---|---|---|---|---|---|\n| [org.mockito:mockito-core](https://togithub.com/mockito/mockito) | `5.11.0` -> `5.12.0` | [![age](https://developer.mend.io/api/mc/badges/age/maven/org.mockito:mockito-core/5.12.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://developer.mend.io/api/mc/badges/adoption/maven/org.mockito:mockito-core/5.12.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://developer.mend.io/api/mc/badges/compatibility/maven/org.mockito:mockito-core/5.11.0/5.12.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://developer.mend.io/api/mc/badges/confidence/maven/org.mockito:mockito-core/5.11.0/5.12.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) |\n\n---\n\n> [!WARNING]\n> Some dependencies could not be looked up. Check the Dependency Dashboard for more information.\n\n---\n\n### Release Notes\n\n

        \nmockito/mockito (org.mockito:mockito-core)\n\n### [`v5.12.0`](https://togithub.com/mockito/mockito/releases/tag/v5.12.0)\n\n*Changelog generated by [Shipkit Changelog Gradle Plugin](https://togithub.com/shipkit/shipkit-changelog)*\n\n##### 5.12.0\n\n- 2024-05-11 - [25 commit(s)](https://togithub.com/mockito/mockito/compare/v5.11.0...v5.12.0) by Piotr Przybylak, Stefano Cordio, Tim van der Lippe, dependabot\\[bot], jonghoonpark\n- Bump com.gradle.enterprise from 3.17.2 to 3.17.3 [(#​3341)](https://togithub.com/mockito/mockito/pull/3341)\n- Bump org.jetbrains.kotlin:kotlin-stdlib from 1.9.23 to 1.9.24 [(#​3339)](https://togithub.com/mockito/mockito/pull/3339)\n- Bump versions.bytebuddy from 1.14.14 to 1.14.15 [(#​3338)](https://togithub.com/mockito/mockito/pull/3338)\n- Bump org.shipkit:shipkit-auto-version from 2.0.6 to 2.0.7 [(#​3337)](https://togithub.com/mockito/mockito/pull/3337)\n- Bump org.jetbrains.kotlin:kotlin-gradle-plugin from 1.9.23 to 1.9.24 [(#​3336)](https://togithub.com/mockito/mockito/pull/3336)\n- Fixes [#​3331](https://togithub.com/mockito/mockito/issues/3331) : Fix `AdditionalMatchers.and()` and `AdditionalMatchers.or()` not to swap the order of matchers [(#​3335)](https://togithub.com/mockito/mockito/pull/3335)\n- AdditionalMatchers.and() and or() swap matcher order [(#​3331)](https://togithub.com/mockito/mockito/issues/3331)\n- Bump gradle/wrapper-validation-action from 3.3.1 to 3.3.2 [(#​3327)](https://togithub.com/mockito/mockito/pull/3327)\n- Bump versions.bytebuddy from 1.14.13 to 1.14.14 [(#​3324)](https://togithub.com/mockito/mockito/pull/3324)\n- Bump org.shipkit:shipkit-auto-version from 2.0.5 to 2.0.6 [(#​3322)](https://togithub.com/mockito/mockito/pull/3322)\n- Bump gradle/wrapper-validation-action from 3.3.0 to 3.3.1 [(#​3320)](https://togithub.com/mockito/mockito/pull/3320)\n- Bump com.gradle.enterprise from 3.17 to 3.17.2 [(#​3318)](https://togithub.com/mockito/mockito/pull/3318)\n- Bump gradle/wrapper-validation-action from 2.1.2 to 3.3.0 [(#​3317)](https://togithub.com/mockito/mockito/pull/3317)\n- Update codecov-action version [(#​3316)](https://togithub.com/mockito/mockito/pull/3316)\n- Bump com.google.googlejavaformat:google-java-format from 1.21.0 to 1.22.0 [(#​3312)](https://togithub.com/mockito/mockito/pull/3312)\n- Bump com.gradle.enterprise from 3.16.2 to 3.17 [(#​3311)](https://togithub.com/mockito/mockito/pull/3311)\n- Bump versions.bytebuddy from 1.14.12 to 1.14.13 [(#​3308)](https://togithub.com/mockito/mockito/pull/3308)\n- Fix README logo [(#​3305)](https://togithub.com/mockito/mockito/pull/3305)\n- Bump gradle/wrapper-validation-action from 2.1.1 to 2.1.2 [(#​3303)](https://togithub.com/mockito/mockito/pull/3303)\n- Bump org.shipkit:shipkit-auto-version from 2.0.4 to 2.0.5 [(#​3298)](https://togithub.com/mockito/mockito/pull/3298)\n- Bump org.jetbrains.kotlin:kotlin-gradle-plugin from 1.9.22 to 1.9.23 [(#​3296)](https://togithub.com/mockito/mockito/pull/3296)\n- Bump org.eclipse.platform:org.eclipse.osgi from 3.18.600 to 3.19.0 [(#​3295)](https://togithub.com/mockito/mockito/pull/3295)\n- Bump org.jetbrains.kotlin:kotlin-stdlib from 1.9.22 to 1.9.23 [(#​3292)](https://togithub.com/mockito/mockito/pull/3292)\n- Bump com.google.googlejavaformat:google-java-format from 1.20.0 to 1.21.0 [(#​3291)](https://togithub.com/mockito/mockito/pull/3291)\n- Fixes [#​3286](https://togithub.com/mockito/mockito/issues/3286) : Mockito.only() points to the wanted call as unwanted if it is the first being calledIssue3286 [(#​3287)](https://togithub.com/mockito/mockito/pull/3287)\n- Mockito.only() points to the wanted call as unwanted if it is the first being called. [(#​3286)](https://togithub.com/mockito/mockito/issues/3286)\n- Bump org.codehaus.groovy:groovy from 3.0.20 to 3.0.21 [(#​3284)](https://togithub.com/mockito/mockito/pull/3284)\n\n
        \n\n---\n\n### Configuration\n\n📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).\n\n🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.\n\n♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.\n\n🔕 **Ignore**: Close this PR and you won't be reminded about this update again.\n\n---\n\n - [ ] If you want to rebase/retry this PR, check this box\n\n---\n\nThis PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://developer.mend.io/github/googleapis/sdk-platform-java).\n\n","created_at":"2024-05-14T19:02:21Z","updated_at":"2024-05-14T19:47:04Z","closed_at":"2024-05-14T19:47:04Z","merged_at":"2024-05-14T19:47:04Z","merge_commit_sha":"3d7ab40311ccebc881bb5cbed7cf150355133f78","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":2307402262,"node_id":"MDU6TGFiZWwyMzA3NDAyMjYy","url":"https://api.github.com/repos/googleapis/sdk-platform-java/labels/kokoro:force-run","name":"kokoro:force-run","color":"C1FFB2","default":false,"description":"Add this label to force Kokoro to re-run the tests."},{"id":5133296390,"node_id":"LA_kwDOD7wwCM8AAAABMffjBg","url":"https://api.github.com/repos/googleapis/sdk-platform-java/labels/size:%20xs","name":"size: xs","color":"ae5816","default":false,"description":"Pull request size is extra small."}],"milestone":null,"draft":false,"commits_url":"https://api.github.com/repos/googleapis/sdk-platform-java/pulls/2770/commits","review_comments_url":"https://api.github.com/repos/googleapis/sdk-platform-java/pulls/2770/comments","review_comment_url":"https://api.github.com/repos/googleapis/sdk-platform-java/pulls/comments{/number}","comments_url":"https://api.github.com/repos/googleapis/sdk-platform-java/issues/2770/comments","statuses_url":"https://api.github.com/repos/googleapis/sdk-platform-java/statuses/ef3f0769652205d6f341b68b79a10bab6e14ea75","head":{"label":"renovate-bot:renovate/mockito-monorepo","ref":"renovate/mockito-monorepo","sha":"ef3f0769652205d6f341b68b79a10bab6e14ea75","user":{"login":"renovate-bot","id":25180681,"node_id":"MDQ6VXNlcjI1MTgwNjgx","avatar_url":"https://avatars.githubusercontent.com/u/25180681?v=4","gravatar_id":"","url":"https://api.github.com/users/renovate-bot","html_url":"https://github.com/renovate-bot","followers_url":"https://api.github.com/users/renovate-bot/followers","following_url":"https://api.github.com/users/renovate-bot/following{/other_user}","gists_url":"https://api.github.com/users/renovate-bot/gists{/gist_id}","starred_url":"https://api.github.com/users/renovate-bot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/renovate-bot/subscriptions","organizations_url":"https://api.github.com/users/renovate-bot/orgs","repos_url":"https://api.github.com/users/renovate-bot/repos","events_url":"https://api.github.com/users/renovate-bot/events{/privacy}","received_events_url":"https://api.github.com/users/renovate-bot/received_events","type":"User","site_admin":false},"repo":{"id":439311054,"node_id":"R_kgDOGi9azg","name":"gapic-generator-java","full_name":"renovate-bot/gapic-generator-java","private":false,"owner":{"login":"renovate-bot","id":25180681,"node_id":"MDQ6VXNlcjI1MTgwNjgx","avatar_url":"https://avatars.githubusercontent.com/u/25180681?v=4","gravatar_id":"","url":"https://api.github.com/users/renovate-bot","html_url":"https://github.com/renovate-bot","followers_url":"https://api.github.com/users/renovate-bot/followers","following_url":"https://api.github.com/users/renovate-bot/following{/other_user}","gists_url":"https://api.github.com/users/renovate-bot/gists{/gist_id}","starred_url":"https://api.github.com/users/renovate-bot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/renovate-bot/subscriptions","organizations_url":"https://api.github.com/users/renovate-bot/orgs","repos_url":"https://api.github.com/users/renovate-bot/repos","events_url":"https://api.github.com/users/renovate-bot/events{/privacy}","received_events_url":"https://api.github.com/users/renovate-bot/received_events","type":"User","site_admin":false},"html_url":"https://github.com/renovate-bot/gapic-generator-java","description":"Generates GAPIC Java client libraries from protobufs.","fork":true,"url":"https://api.github.com/repos/renovate-bot/gapic-generator-java","forks_url":"https://api.github.com/repos/renovate-bot/gapic-generator-java/forks","keys_url":"https://api.github.com/repos/renovate-bot/gapic-generator-java/keys{/key_id}","collaborators_url":"https://api.github.com/repos/renovate-bot/gapic-generator-java/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/renovate-bot/gapic-generator-java/teams","hooks_url":"https://api.github.com/repos/renovate-bot/gapic-generator-java/hooks","issue_events_url":"https://api.github.com/repos/renovate-bot/gapic-generator-java/issues/events{/number}","events_url":"https://api.github.com/repos/renovate-bot/gapic-generator-java/events","assignees_url":"https://api.github.com/repos/renovate-bot/gapic-generator-java/assignees{/user}","branches_url":"https://api.github.com/repos/renovate-bot/gapic-generator-java/branches{/branch}","tags_url":"https://api.github.com/repos/renovate-bot/gapic-generator-java/tags","blobs_url":"https://api.github.com/repos/renovate-bot/gapic-generator-java/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/renovate-bot/gapic-generator-java/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/renovate-bot/gapic-generator-java/git/refs{/sha}","trees_url":"https://api.github.com/repos/renovate-bot/gapic-generator-java/git/trees{/sha}","statuses_url":"https://api.github.com/repos/renovate-bot/gapic-generator-java/statuses/{sha}","languages_url":"https://api.github.com/repos/renovate-bot/gapic-generator-java/languages","stargazers_url":"https://api.github.com/repos/renovate-bot/gapic-generator-java/stargazers","contributors_url":"https://api.github.com/repos/renovate-bot/gapic-generator-java/contributors","subscribers_url":"https://api.github.com/repos/renovate-bot/gapic-generator-java/subscribers","subscription_url":"https://api.github.com/repos/renovate-bot/gapic-generator-java/subscription","commits_url":"https://api.github.com/repos/renovate-bot/gapic-generator-java/commits{/sha}","git_commits_url":"https://api.github.com/repos/renovate-bot/gapic-generator-java/git/commits{/sha}","comments_url":"https://api.github.com/repos/renovate-bot/gapic-generator-java/comments{/number}","issue_comment_url":"https://api.github.com/repos/renovate-bot/gapic-generator-java/issues/comments{/number}","contents_url":"https://api.github.com/repos/renovate-bot/gapic-generator-java/contents/{+path}","compare_url":"https://api.github.com/repos/renovate-bot/gapic-generator-java/compare/{base}...{head}","merges_url":"https://api.github.com/repos/renovate-bot/gapic-generator-java/merges","archive_url":"https://api.github.com/repos/renovate-bot/gapic-generator-java/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/renovate-bot/gapic-generator-java/downloads","issues_url":"https://api.github.com/repos/renovate-bot/gapic-generator-java/issues{/number}","pulls_url":"https://api.github.com/repos/renovate-bot/gapic-generator-java/pulls{/number}","milestones_url":"https://api.github.com/repos/renovate-bot/gapic-generator-java/milestones{/number}","notifications_url":"https://api.github.com/repos/renovate-bot/gapic-generator-java/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/renovate-bot/gapic-generator-java/labels{/name}","releases_url":"https://api.github.com/repos/renovate-bot/gapic-generator-java/releases{/id}","deployments_url":"https://api.github.com/repos/renovate-bot/gapic-generator-java/deployments","created_at":"2021-12-17T11:33:15Z","updated_at":"2024-05-14T20:57:21Z","pushed_at":"2024-05-14T20:58:34Z","git_url":"git://github.com/renovate-bot/gapic-generator-java.git","ssh_url":"git@github.com:renovate-bot/gapic-generator-java.git","clone_url":"https://github.com/renovate-bot/gapic-generator-java.git","svn_url":"https://github.com/renovate-bot/gapic-generator-java","homepage":"","size":31486,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"has_discussions":false,"forks_count":0,"mirror_url":null,"archived":false,"disabled":false,"open_issues_count":0,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"allow_forking":true,"is_template":false,"web_commit_signoff_required":false,"topics":[],"visibility":"public","forks":0,"open_issues":0,"watchers":0,"default_branch":"main"}},"base":{"label":"googleapis:main","ref":"main","sha":"a39aa07d013c9c097ad93fd68cf97da1c7d9ff03","user":{"login":"googleapis","id":16785467,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE2Nzg1NDY3","avatar_url":"https://avatars.githubusercontent.com/u/16785467?v=4","gravatar_id":"","url":"https://api.github.com/users/googleapis","html_url":"https://github.com/googleapis","followers_url":"https://api.github.com/users/googleapis/followers","following_url":"https://api.github.com/users/googleapis/following{/other_user}","gists_url":"https://api.github.com/users/googleapis/gists{/gist_id}","starred_url":"https://api.github.com/users/googleapis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/googleapis/subscriptions","organizations_url":"https://api.github.com/users/googleapis/orgs","repos_url":"https://api.github.com/users/googleapis/repos","events_url":"https://api.github.com/users/googleapis/events{/privacy}","received_events_url":"https://api.github.com/users/googleapis/received_events","type":"Organization","site_admin":false},"repo":{"id":263991304,"node_id":"MDEwOlJlcG9zaXRvcnkyNjM5OTEzMDQ=","name":"sdk-platform-java","full_name":"googleapis/sdk-platform-java","private":false,"owner":{"login":"googleapis","id":16785467,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE2Nzg1NDY3","avatar_url":"https://avatars.githubusercontent.com/u/16785467?v=4","gravatar_id":"","url":"https://api.github.com/users/googleapis","html_url":"https://github.com/googleapis","followers_url":"https://api.github.com/users/googleapis/followers","following_url":"https://api.github.com/users/googleapis/following{/other_user}","gists_url":"https://api.github.com/users/googleapis/gists{/gist_id}","starred_url":"https://api.github.com/users/googleapis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/googleapis/subscriptions","organizations_url":"https://api.github.com/users/googleapis/orgs","repos_url":"https://api.github.com/users/googleapis/repos","events_url":"https://api.github.com/users/googleapis/events{/privacy}","received_events_url":"https://api.github.com/users/googleapis/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/googleapis/sdk-platform-java","description":"Tooling and shared libraries for Cloud SDK for Java","fork":false,"url":"https://api.github.com/repos/googleapis/sdk-platform-java","forks_url":"https://api.github.com/repos/googleapis/sdk-platform-java/forks","keys_url":"https://api.github.com/repos/googleapis/sdk-platform-java/keys{/key_id}","collaborators_url":"https://api.github.com/repos/googleapis/sdk-platform-java/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/googleapis/sdk-platform-java/teams","hooks_url":"https://api.github.com/repos/googleapis/sdk-platform-java/hooks","issue_events_url":"https://api.github.com/repos/googleapis/sdk-platform-java/issues/events{/number}","events_url":"https://api.github.com/repos/googleapis/sdk-platform-java/events","assignees_url":"https://api.github.com/repos/googleapis/sdk-platform-java/assignees{/user}","branches_url":"https://api.github.com/repos/googleapis/sdk-platform-java/branches{/branch}","tags_url":"https://api.github.com/repos/googleapis/sdk-platform-java/tags","blobs_url":"https://api.github.com/repos/googleapis/sdk-platform-java/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/googleapis/sdk-platform-java/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/googleapis/sdk-platform-java/git/refs{/sha}","trees_url":"https://api.github.com/repos/googleapis/sdk-platform-java/git/trees{/sha}","statuses_url":"https://api.github.com/repos/googleapis/sdk-platform-java/statuses/{sha}","languages_url":"https://api.github.com/repos/googleapis/sdk-platform-java/languages","stargazers_url":"https://api.github.com/repos/googleapis/sdk-platform-java/stargazers","contributors_url":"https://api.github.com/repos/googleapis/sdk-platform-java/contributors","subscribers_url":"https://api.github.com/repos/googleapis/sdk-platform-java/subscribers","subscription_url":"https://api.github.com/repos/googleapis/sdk-platform-java/subscription","commits_url":"https://api.github.com/repos/googleapis/sdk-platform-java/commits{/sha}","git_commits_url":"https://api.github.com/repos/googleapis/sdk-platform-java/git/commits{/sha}","comments_url":"https://api.github.com/repos/googleapis/sdk-platform-java/comments{/number}","issue_comment_url":"https://api.github.com/repos/googleapis/sdk-platform-java/issues/comments{/number}","contents_url":"https://api.github.com/repos/googleapis/sdk-platform-java/contents/{+path}","compare_url":"https://api.github.com/repos/googleapis/sdk-platform-java/compare/{base}...{head}","merges_url":"https://api.github.com/repos/googleapis/sdk-platform-java/merges","archive_url":"https://api.github.com/repos/googleapis/sdk-platform-java/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/googleapis/sdk-platform-java/downloads","issues_url":"https://api.github.com/repos/googleapis/sdk-platform-java/issues{/number}","pulls_url":"https://api.github.com/repos/googleapis/sdk-platform-java/pulls{/number}","milestones_url":"https://api.github.com/repos/googleapis/sdk-platform-java/milestones{/number}","notifications_url":"https://api.github.com/repos/googleapis/sdk-platform-java/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/googleapis/sdk-platform-java/labels{/name}","releases_url":"https://api.github.com/repos/googleapis/sdk-platform-java/releases{/id}","deployments_url":"https://api.github.com/repos/googleapis/sdk-platform-java/deployments","created_at":"2020-05-14T18:15:25Z","updated_at":"2024-05-14T20:57:11Z","pushed_at":"2024-05-14T21:09:51Z","git_url":"git://github.com/googleapis/sdk-platform-java.git","ssh_url":"git@github.com:googleapis/sdk-platform-java.git","clone_url":"https://github.com/googleapis/sdk-platform-java.git","svn_url":"https://github.com/googleapis/sdk-platform-java","homepage":"https://cloud.google.com/java/docs/bom","size":40540,"stargazers_count":59,"watchers_count":59,"language":"Java","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"has_discussions":false,"forks_count":47,"mirror_url":null,"archived":false,"disabled":false,"open_issues_count":189,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"allow_forking":true,"is_template":false,"web_commit_signoff_required":false,"topics":[],"visibility":"public","forks":47,"open_issues":189,"watchers":59,"default_branch":"main"}},"_links":{"self":{"href":"https://api.github.com/repos/googleapis/sdk-platform-java/pulls/2770"},"html":{"href":"https://github.com/googleapis/sdk-platform-java/pull/2770"},"issue":{"href":"https://api.github.com/repos/googleapis/sdk-platform-java/issues/2770"},"comments":{"href":"https://api.github.com/repos/googleapis/sdk-platform-java/issues/2770/comments"},"review_comments":{"href":"https://api.github.com/repos/googleapis/sdk-platform-java/pulls/2770/comments"},"review_comment":{"href":"https://api.github.com/repos/googleapis/sdk-platform-java/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/googleapis/sdk-platform-java/pulls/2770/commits"},"statuses":{"href":"https://api.github.com/repos/googleapis/sdk-platform-java/statuses/ef3f0769652205d6f341b68b79a10bab6e14ea75"}},"author_association":"CONTRIBUTOR","auto_merge":{"enabled_by":{"login":"JoeWang1127","id":106995533,"node_id":"U_kgDOBmCfTQ","avatar_url":"https://avatars.githubusercontent.com/u/106995533?v=4","gravatar_id":"","url":"https://api.github.com/users/JoeWang1127","html_url":"https://github.com/JoeWang1127","followers_url":"https://api.github.com/users/JoeWang1127/followers","following_url":"https://api.github.com/users/JoeWang1127/following{/other_user}","gists_url":"https://api.github.com/users/JoeWang1127/gists{/gist_id}","starred_url":"https://api.github.com/users/JoeWang1127/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JoeWang1127/subscriptions","organizations_url":"https://api.github.com/users/JoeWang1127/orgs","repos_url":"https://api.github.com/users/JoeWang1127/repos","events_url":"https://api.github.com/users/JoeWang1127/events{/privacy}","received_events_url":"https://api.github.com/users/JoeWang1127/received_events","type":"User","site_admin":false},"merge_method":"squash","commit_title":"test(deps): update dependency org.mockito:mockito-core to v5.12.0 (#2770)","commit_message":"[![Mend\r\nRenovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)\r\n\r\nThis PR contains the following updates:\r\n\r\n| Package | Change | Age | Adoption | Passing | Confidence |\r\n|---|---|---|---|---|---|\r\n| [org.mockito:mockito-core](https://togithub.com/mockito/mockito) |\r\n`5.11.0` -> `5.12.0` |\r\n[![age](https://developer.mend.io/api/mc/badges/age/maven/org.mockito:mockito-core/5.12.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)\r\n|\r\n[![adoption](https://developer.mend.io/api/mc/badges/adoption/maven/org.mockito:mockito-core/5.12.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)\r\n|\r\n[![passing](https://developer.mend.io/api/mc/badges/compatibility/maven/org.mockito:mockito-core/5.11.0/5.12.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)\r\n|\r\n[![confidence](https://developer.mend.io/api/mc/badges/confidence/maven/org.mockito:mockito-core/5.11.0/5.12.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)\r\n|\r\n\r\n---\r\n\r\n> [!WARNING]\r\n> Some dependencies could not be looked up. Check the Dependency\r\nDashboard for more information.\r\n\r\n---\r\n\r\n### Release Notes\r\n\r\n
        \r\nmockito/mockito (org.mockito:mockito-core)\r\n\r\n###\r\n[`v5.12.0`](https://togithub.com/mockito/mockito/releases/tag/v5.12.0)\r\n\r\n*Changelog generated by [Shipkit Changelog Gradle\r\nPlugin](https://togithub.com/shipkit/shipkit-changelog)*\r\n\r\n##### 5.12.0\r\n\r\n- 2024-05-11 - [25\r\ncommit(s)](https://togithub.com/mockito/mockito/compare/v5.11.0...v5.12.0)\r\nby Piotr Przybylak, Stefano Cordio, Tim van der Lippe, dependabot\\[bot],\r\njonghoonpark\r\n- Bump com.gradle.enterprise from 3.17.2 to 3.17.3\r\n[(#​3341)](https://togithub.com/mockito/mockito/pull/3341)\r\n- Bump org.jetbrains.kotlin:kotlin-stdlib from 1.9.23 to 1.9.24\r\n[(#​3339)](https://togithub.com/mockito/mockito/pull/3339)\r\n- Bump versions.bytebuddy from 1.14.14 to 1.14.15\r\n[(#​3338)](https://togithub.com/mockito/mockito/pull/3338)\r\n- Bump org.shipkit:shipkit-auto-version from 2.0.6 to 2.0.7\r\n[(#​3337)](https://togithub.com/mockito/mockito/pull/3337)\r\n- Bump org.jetbrains.kotlin:kotlin-gradle-plugin from 1.9.23 to 1.9.24\r\n[(#​3336)](https://togithub.com/mockito/mockito/pull/3336)\r\n- Fixes [#​3331](https://togithub.com/mockito/mockito/issues/3331)\r\n: Fix `AdditionalMatchers.and()` and `AdditionalMatchers.or()` not to\r\nswap the order of matchers\r\n[(#​3335)](https://togithub.com/mockito/mockito/pull/3335)\r\n- AdditionalMatchers.and() and or() swap matcher order\r\n[(#​3331)](https://togithub.com/mockito/mockito/issues/3331)\r\n- Bump gradle/wrapper-validation-action from 3.3.1 to 3.3.2\r\n[(#​3327)](https://togithub.com/mockito/mockito/pull/3327)\r\n- Bump versions.bytebuddy from 1.14.13 to 1.14.14\r\n[(#​3324)](https://togithub.com/mockito/mockito/pull/3324)\r\n- Bump org.shipkit:shipkit-auto-version from 2.0.5 to 2.0.6\r\n[(#​3322)](https://togithub.com/mockito/mockito/pull/3322)\r\n- Bump gradle/wrapper-validation-action from 3.3.0 to 3.3.1\r\n[(#​3320)](https://togithub.com/mockito/mockito/pull/3320)\r\n- Bump com.gradle.enterprise from 3.17 to 3.17.2\r\n[(#​3318)](https://togithub.com/mockito/mockito/pull/3318)\r\n- Bump gradle/wrapper-validation-action from 2.1.2 to 3.3.0\r\n[(#​3317)](https://togithub.com/mockito/mockito/pull/3317)\r\n- Update codecov-action version\r\n[(#​3316)](https://togithub.com/mockito/mockito/pull/3316)\r\n- Bump com.google.googlejavaformat:google-java-format from 1.21.0 to\r\n1.22.0 [(#​3312)](https://togithub.com/mockito/mockito/pull/3312)\r\n- Bump com.gradle.enterprise from 3.16.2 to 3.17\r\n[(#​3311)](https://togithub.com/mockito/mockito/pull/3311)\r\n- Bump versions.bytebuddy from 1.14.12 to 1.14.13\r\n[(#​3308)](https://togithub.com/mockito/mockito/pull/3308)\r\n- Fix README logo\r\n[(#​3305)](https://togithub.com/mockito/mockito/pull/3305)\r\n- Bump gradle/wrapper-validation-action from 2.1.1 to 2.1.2\r\n[(#​3303)](https://togithub.com/mockito/mockito/pull/3303)\r\n- Bump org.shipkit:shipkit-auto-version from 2.0.4 to 2.0.5\r\n[(#​3298)](https://togithub.com/mockito/mockito/pull/3298)\r\n- Bump org.jetbrains.kotlin:kotlin-gradle-plugin from 1.9.22 to 1.9.23\r\n[(#​3296)](https://togithub.com/mockito/mockito/pull/3296)\r\n- Bump org.eclipse.platform:org.eclipse.osgi from 3.18.600 to 3.19.0\r\n[(#​3295)](https://togithub.com/mockito/mockito/pull/3295)\r\n- Bump org.jetbrains.kotlin:kotlin-stdlib from 1.9.22 to 1.9.23\r\n[(#​3292)](https://togithub.com/mockito/mockito/pull/3292)\r\n- Bump com.google.googlejavaformat:google-java-format from 1.20.0 to\r\n1.21.0 [(#​3291)](https://togithub.com/mockito/mockito/pull/3291)\r\n- Fixes [#​3286](https://togithub.com/mockito/mockito/issues/3286)\r\n: Mockito.only() points to the wanted call as unwanted if it is the\r\nfirst being calledIssue3286\r\n[(#​3287)](https://togithub.com/mockito/mockito/pull/3287)\r\n- Mockito.only() points to the wanted call as unwanted if it is the\r\nfirst being called.\r\n[(#​3286)](https://togithub.com/mockito/mockito/issues/3286)\r\n- Bump org.codehaus.groovy:groovy from 3.0.20 to 3.0.21\r\n[(#​3284)](https://togithub.com/mockito/mockito/pull/3284)\r\n\r\n
        \r\n\r\n---\r\n\r\n### Configuration\r\n\r\n📅 **Schedule**: Branch creation - At any time (no schedule defined),\r\nAutomerge - At any time (no schedule defined).\r\n\r\n🚦 **Automerge**: Disabled by config. Please merge this manually once you\r\nare satisfied.\r\n\r\n♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the\r\nrebase/retry checkbox.\r\n\r\n🔕 **Ignore**: Close this PR and you won't be reminded about this update\r\nagain.\r\n\r\n---\r\n\r\n- [ ] If you want to rebase/retry this PR, check\r\nthis box\r\n\r\n---\r\n\r\nThis PR has been generated by [Mend\r\nRenovate](https://www.mend.io/free-developer-tools/renovate/). View\r\nrepository job log\r\n[here](https://developer.mend.io/github/googleapis/sdk-platform-java).\r\n\r\n\r\n\r\nCo-authored-by: Joe Wang <106995533+JoeWang1127@users.noreply.github.com>"},"active_lock_reason":null},{"url":"https://api.github.com/repos/googleapis/sdk-platform-java/pulls/2769","id":1869542291,"node_id":"PR_kwDOD7wwCM5vbvOT","html_url":"https://github.com/googleapis/sdk-platform-java/pull/2769","diff_url":"https://github.com/googleapis/sdk-platform-java/pull/2769.diff","patch_url":"https://github.com/googleapis/sdk-platform-java/pull/2769.patch","issue_url":"https://api.github.com/repos/googleapis/sdk-platform-java/issues/2769","number":2769,"state":"closed","locked":false,"title":"deps: update opentelemetry-java monorepo to v1.38.0","user":{"login":"renovate-bot","id":25180681,"node_id":"MDQ6VXNlcjI1MTgwNjgx","avatar_url":"https://avatars.githubusercontent.com/u/25180681?v=4","gravatar_id":"","url":"https://api.github.com/users/renovate-bot","html_url":"https://github.com/renovate-bot","followers_url":"https://api.github.com/users/renovate-bot/followers","following_url":"https://api.github.com/users/renovate-bot/following{/other_user}","gists_url":"https://api.github.com/users/renovate-bot/gists{/gist_id}","starred_url":"https://api.github.com/users/renovate-bot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/renovate-bot/subscriptions","organizations_url":"https://api.github.com/users/renovate-bot/orgs","repos_url":"https://api.github.com/users/renovate-bot/repos","events_url":"https://api.github.com/users/renovate-bot/events{/privacy}","received_events_url":"https://api.github.com/users/renovate-bot/received_events","type":"User","site_admin":false},"body":"[![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)\n\nThis PR contains the following updates:\n\n| Package | Change | Age | Adoption | Passing | Confidence |\n|---|---|---|---|---|---|\n| [io.opentelemetry:opentelemetry-api](https://togithub.com/open-telemetry/opentelemetry-java) | `1.37.0` -> `1.38.0` | [![age](https://developer.mend.io/api/mc/badges/age/maven/io.opentelemetry:opentelemetry-api/1.38.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://developer.mend.io/api/mc/badges/adoption/maven/io.opentelemetry:opentelemetry-api/1.38.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://developer.mend.io/api/mc/badges/compatibility/maven/io.opentelemetry:opentelemetry-api/1.37.0/1.38.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://developer.mend.io/api/mc/badges/confidence/maven/io.opentelemetry:opentelemetry-api/1.37.0/1.38.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) |\n| [io.opentelemetry:opentelemetry-bom](https://togithub.com/open-telemetry/opentelemetry-java) | `1.37.0` -> `1.38.0` | [![age](https://developer.mend.io/api/mc/badges/age/maven/io.opentelemetry:opentelemetry-bom/1.38.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://developer.mend.io/api/mc/badges/adoption/maven/io.opentelemetry:opentelemetry-bom/1.38.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://developer.mend.io/api/mc/badges/compatibility/maven/io.opentelemetry:opentelemetry-bom/1.37.0/1.38.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://developer.mend.io/api/mc/badges/confidence/maven/io.opentelemetry:opentelemetry-bom/1.37.0/1.38.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) |\n\n---\n\n> [!WARNING]\n> Some dependencies could not be looked up. Check the Dependency Dashboard for more information.\n\n---\n\n### Release Notes\n\n
        \nopen-telemetry/opentelemetry-java (io.opentelemetry:opentelemetry-api)\n\n### [`v1.38.0`](https://togithub.com/open-telemetry/opentelemetry-java/blob/HEAD/CHANGELOG.md#Version-1380-2024-05-10)\n\n##### API\n\n- Stabilize synchronous gauge\n ([#​6419](https://togithub.com/open-telemetry/opentelemetry-java/pull/6419))\n\n##### Incubator\n\n- Add put(AttributeKey, T) overload to EventBuilder\n ([#​6331](https://togithub.com/open-telemetry/opentelemetry-java/pull/6331))\n\n##### Baggage\n\n- Baggage filters space-only keys\n ([#​6431](https://togithub.com/open-telemetry/opentelemetry-java/pull/6431))\n\n##### SDK\n\n- Add experimental scope config to enable / disable scopes (i.e. meter, logger, tracer)\n ([#​6375](https://togithub.com/open-telemetry/opentelemetry-java/pull/6375))\n\n##### Traces\n\n- Add ReadableSpan#getAttributes\n ([#​6382](https://togithub.com/open-telemetry/opentelemetry-java/pull/6382))\n- Use standard ArrayList size rather than max number of links for initial span links allocation\n ([#​6252](https://togithub.com/open-telemetry/opentelemetry-java/pull/6252))\n\n##### Metrics\n\n- Use low precision Clock#now when computing timestamp for exemplars\n ([#​6417](https://togithub.com/open-telemetry/opentelemetry-java/pull/6417))\n- Update invalid instrument name log message now that forward slash `/` is valid\n ([#​6343](https://togithub.com/open-telemetry/opentelemetry-java/pull/6343))\n\n##### Exporters\n\n- Introduce low allocation OTLP marshalers. If using autoconfigure, opt in\n via `OTEL_JAVA_EXPERIMENTAL_EXPORTER_MEMORY_MODE=REUSABLE_DATA`.\n - Low allocation OTLP logs marshaler\n ([#​6429](https://togithub.com/open-telemetry/opentelemetry-java/pull/6429))\n - Low allocation OTLP metrics marshaler\n ([#​6422](https://togithub.com/open-telemetry/opentelemetry-java/pull/6422))\n - Low allocation OTLP trace marshaler\n ([#​6410](https://togithub.com/open-telemetry/opentelemetry-java/pull/6410))\n - Add memory mode support to OTLP exporters\n ([#​6430](https://togithub.com/open-telemetry/opentelemetry-java/pull/6430))\n - Marshal span status description without allocation\n ([#​6423](https://togithub.com/open-telemetry/opentelemetry-java/pull/6423))\n - Add private constructors for stateless marshalers\n ([#​6434](https://togithub.com/open-telemetry/opentelemetry-java/pull/6434))\n- Mark opentelemetry-exporter-sender-jdk stable\n ([#​6357](https://togithub.com/open-telemetry/opentelemetry-java/pull/6357))\n- PrometheusHttpServer prevent concurrent reads when reusable memory mode\n ([#​6371](https://togithub.com/open-telemetry/opentelemetry-java/pull/6371))\n- Ignore TLS components (SSLContext, TrustManager, KeyManager) if plain HTTP protocol is used for\n exporting\n ([#​6329](https://togithub.com/open-telemetry/opentelemetry-java/pull/6329))\n- Add is_remote_parent span flags to OTLP exported Spans and SpanLinks\n ([#​6388](https://togithub.com/open-telemetry/opentelemetry-java/pull/6388))\n- Add missing fields to OTLP metric exporters `toString()`\n ([#​6402](https://togithub.com/open-telemetry/opentelemetry-java/pull/6402))\n\n##### Extensions\n\n- Rename otel.config.file to otel.experimental.config.file for autoconfigure\n ([#​6396](https://togithub.com/open-telemetry/opentelemetry-java/pull/6396))\n\n##### OpenCensus Shim\n\n- Fix opencensus shim spanBuilderWithRemoteParent behavior\n ([#​6415](https://togithub.com/open-telemetry/opentelemetry-java/pull/6415))\n\n##### Tooling\n\n- Add additional API incubator docs\n ([#​6356](https://togithub.com/open-telemetry/opentelemetry-java/pull/6356))\n- Run build on java 21\n ([#​6370](https://togithub.com/open-telemetry/opentelemetry-java/pull/6370))\n- Fix running tests with java 8 on macos\n ([#​6411](https://togithub.com/open-telemetry/opentelemetry-java/pull/6411))\n- Move away from deprecated gradle enterprise APIs\n ([#​6363](https://togithub.com/open-telemetry/opentelemetry-java/pull/6363))\n\n
        \n\n---\n\n### Configuration\n\n📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).\n\n🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.\n\n♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.\n\n🔕 **Ignore**: Close this PR and you won't be reminded about these updates again.\n\n---\n\n - [ ] If you want to rebase/retry this PR, check this box\n\n---\n\nThis PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://developer.mend.io/github/googleapis/sdk-platform-java).\n\n","created_at":"2024-05-14T18:02:11Z","updated_at":"2024-05-14T19:02:28Z","closed_at":"2024-05-14T19:00:46Z","merged_at":"2024-05-14T19:00:46Z","merge_commit_sha":"0a5c7c4075ee986028535c424e4a62458a25f8d2","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":2307402262,"node_id":"MDU6TGFiZWwyMzA3NDAyMjYy","url":"https://api.github.com/repos/googleapis/sdk-platform-java/labels/kokoro:force-run","name":"kokoro:force-run","color":"C1FFB2","default":false,"description":"Add this label to force Kokoro to re-run the tests."},{"id":5133296390,"node_id":"LA_kwDOD7wwCM8AAAABMffjBg","url":"https://api.github.com/repos/googleapis/sdk-platform-java/labels/size:%20xs","name":"size: xs","color":"ae5816","default":false,"description":"Pull request size is extra small."}],"milestone":null,"draft":false,"commits_url":"https://api.github.com/repos/googleapis/sdk-platform-java/pulls/2769/commits","review_comments_url":"https://api.github.com/repos/googleapis/sdk-platform-java/pulls/2769/comments","review_comment_url":"https://api.github.com/repos/googleapis/sdk-platform-java/pulls/comments{/number}","comments_url":"https://api.github.com/repos/googleapis/sdk-platform-java/issues/2769/comments","statuses_url":"https://api.github.com/repos/googleapis/sdk-platform-java/statuses/d7e77cb79599612686fe4f7d7eb45ee25206b27f","head":{"label":"renovate-bot:renovate/opentelemetry-java-monorepo","ref":"renovate/opentelemetry-java-monorepo","sha":"d7e77cb79599612686fe4f7d7eb45ee25206b27f","user":{"login":"renovate-bot","id":25180681,"node_id":"MDQ6VXNlcjI1MTgwNjgx","avatar_url":"https://avatars.githubusercontent.com/u/25180681?v=4","gravatar_id":"","url":"https://api.github.com/users/renovate-bot","html_url":"https://github.com/renovate-bot","followers_url":"https://api.github.com/users/renovate-bot/followers","following_url":"https://api.github.com/users/renovate-bot/following{/other_user}","gists_url":"https://api.github.com/users/renovate-bot/gists{/gist_id}","starred_url":"https://api.github.com/users/renovate-bot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/renovate-bot/subscriptions","organizations_url":"https://api.github.com/users/renovate-bot/orgs","repos_url":"https://api.github.com/users/renovate-bot/repos","events_url":"https://api.github.com/users/renovate-bot/events{/privacy}","received_events_url":"https://api.github.com/users/renovate-bot/received_events","type":"User","site_admin":false},"repo":{"id":439311054,"node_id":"R_kgDOGi9azg","name":"gapic-generator-java","full_name":"renovate-bot/gapic-generator-java","private":false,"owner":{"login":"renovate-bot","id":25180681,"node_id":"MDQ6VXNlcjI1MTgwNjgx","avatar_url":"https://avatars.githubusercontent.com/u/25180681?v=4","gravatar_id":"","url":"https://api.github.com/users/renovate-bot","html_url":"https://github.com/renovate-bot","followers_url":"https://api.github.com/users/renovate-bot/followers","following_url":"https://api.github.com/users/renovate-bot/following{/other_user}","gists_url":"https://api.github.com/users/renovate-bot/gists{/gist_id}","starred_url":"https://api.github.com/users/renovate-bot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/renovate-bot/subscriptions","organizations_url":"https://api.github.com/users/renovate-bot/orgs","repos_url":"https://api.github.com/users/renovate-bot/repos","events_url":"https://api.github.com/users/renovate-bot/events{/privacy}","received_events_url":"https://api.github.com/users/renovate-bot/received_events","type":"User","site_admin":false},"html_url":"https://github.com/renovate-bot/gapic-generator-java","description":"Generates GAPIC Java client libraries from protobufs.","fork":true,"url":"https://api.github.com/repos/renovate-bot/gapic-generator-java","forks_url":"https://api.github.com/repos/renovate-bot/gapic-generator-java/forks","keys_url":"https://api.github.com/repos/renovate-bot/gapic-generator-java/keys{/key_id}","collaborators_url":"https://api.github.com/repos/renovate-bot/gapic-generator-java/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/renovate-bot/gapic-generator-java/teams","hooks_url":"https://api.github.com/repos/renovate-bot/gapic-generator-java/hooks","issue_events_url":"https://api.github.com/repos/renovate-bot/gapic-generator-java/issues/events{/number}","events_url":"https://api.github.com/repos/renovate-bot/gapic-generator-java/events","assignees_url":"https://api.github.com/repos/renovate-bot/gapic-generator-java/assignees{/user}","branches_url":"https://api.github.com/repos/renovate-bot/gapic-generator-java/branches{/branch}","tags_url":"https://api.github.com/repos/renovate-bot/gapic-generator-java/tags","blobs_url":"https://api.github.com/repos/renovate-bot/gapic-generator-java/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/renovate-bot/gapic-generator-java/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/renovate-bot/gapic-generator-java/git/refs{/sha}","trees_url":"https://api.github.com/repos/renovate-bot/gapic-generator-java/git/trees{/sha}","statuses_url":"https://api.github.com/repos/renovate-bot/gapic-generator-java/statuses/{sha}","languages_url":"https://api.github.com/repos/renovate-bot/gapic-generator-java/languages","stargazers_url":"https://api.github.com/repos/renovate-bot/gapic-generator-java/stargazers","contributors_url":"https://api.github.com/repos/renovate-bot/gapic-generator-java/contributors","subscribers_url":"https://api.github.com/repos/renovate-bot/gapic-generator-java/subscribers","subscription_url":"https://api.github.com/repos/renovate-bot/gapic-generator-java/subscription","commits_url":"https://api.github.com/repos/renovate-bot/gapic-generator-java/commits{/sha}","git_commits_url":"https://api.github.com/repos/renovate-bot/gapic-generator-java/git/commits{/sha}","comments_url":"https://api.github.com/repos/renovate-bot/gapic-generator-java/comments{/number}","issue_comment_url":"https://api.github.com/repos/renovate-bot/gapic-generator-java/issues/comments{/number}","contents_url":"https://api.github.com/repos/renovate-bot/gapic-generator-java/contents/{+path}","compare_url":"https://api.github.com/repos/renovate-bot/gapic-generator-java/compare/{base}...{head}","merges_url":"https://api.github.com/repos/renovate-bot/gapic-generator-java/merges","archive_url":"https://api.github.com/repos/renovate-bot/gapic-generator-java/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/renovate-bot/gapic-generator-java/downloads","issues_url":"https://api.github.com/repos/renovate-bot/gapic-generator-java/issues{/number}","pulls_url":"https://api.github.com/repos/renovate-bot/gapic-generator-java/pulls{/number}","milestones_url":"https://api.github.com/repos/renovate-bot/gapic-generator-java/milestones{/number}","notifications_url":"https://api.github.com/repos/renovate-bot/gapic-generator-java/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/renovate-bot/gapic-generator-java/labels{/name}","releases_url":"https://api.github.com/repos/renovate-bot/gapic-generator-java/releases{/id}","deployments_url":"https://api.github.com/repos/renovate-bot/gapic-generator-java/deployments","created_at":"2021-12-17T11:33:15Z","updated_at":"2024-05-14T20:57:21Z","pushed_at":"2024-05-14T20:58:34Z","git_url":"git://github.com/renovate-bot/gapic-generator-java.git","ssh_url":"git@github.com:renovate-bot/gapic-generator-java.git","clone_url":"https://github.com/renovate-bot/gapic-generator-java.git","svn_url":"https://github.com/renovate-bot/gapic-generator-java","homepage":"","size":31486,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"has_discussions":false,"forks_count":0,"mirror_url":null,"archived":false,"disabled":false,"open_issues_count":0,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"allow_forking":true,"is_template":false,"web_commit_signoff_required":false,"topics":[],"visibility":"public","forks":0,"open_issues":0,"watchers":0,"default_branch":"main"}},"base":{"label":"googleapis:main","ref":"main","sha":"22b7398f07a77935c0c002c78e8e30dca5979652","user":{"login":"googleapis","id":16785467,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE2Nzg1NDY3","avatar_url":"https://avatars.githubusercontent.com/u/16785467?v=4","gravatar_id":"","url":"https://api.github.com/users/googleapis","html_url":"https://github.com/googleapis","followers_url":"https://api.github.com/users/googleapis/followers","following_url":"https://api.github.com/users/googleapis/following{/other_user}","gists_url":"https://api.github.com/users/googleapis/gists{/gist_id}","starred_url":"https://api.github.com/users/googleapis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/googleapis/subscriptions","organizations_url":"https://api.github.com/users/googleapis/orgs","repos_url":"https://api.github.com/users/googleapis/repos","events_url":"https://api.github.com/users/googleapis/events{/privacy}","received_events_url":"https://api.github.com/users/googleapis/received_events","type":"Organization","site_admin":false},"repo":{"id":263991304,"node_id":"MDEwOlJlcG9zaXRvcnkyNjM5OTEzMDQ=","name":"sdk-platform-java","full_name":"googleapis/sdk-platform-java","private":false,"owner":{"login":"googleapis","id":16785467,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE2Nzg1NDY3","avatar_url":"https://avatars.githubusercontent.com/u/16785467?v=4","gravatar_id":"","url":"https://api.github.com/users/googleapis","html_url":"https://github.com/googleapis","followers_url":"https://api.github.com/users/googleapis/followers","following_url":"https://api.github.com/users/googleapis/following{/other_user}","gists_url":"https://api.github.com/users/googleapis/gists{/gist_id}","starred_url":"https://api.github.com/users/googleapis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/googleapis/subscriptions","organizations_url":"https://api.github.com/users/googleapis/orgs","repos_url":"https://api.github.com/users/googleapis/repos","events_url":"https://api.github.com/users/googleapis/events{/privacy}","received_events_url":"https://api.github.com/users/googleapis/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/googleapis/sdk-platform-java","description":"Tooling and shared libraries for Cloud SDK for Java","fork":false,"url":"https://api.github.com/repos/googleapis/sdk-platform-java","forks_url":"https://api.github.com/repos/googleapis/sdk-platform-java/forks","keys_url":"https://api.github.com/repos/googleapis/sdk-platform-java/keys{/key_id}","collaborators_url":"https://api.github.com/repos/googleapis/sdk-platform-java/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/googleapis/sdk-platform-java/teams","hooks_url":"https://api.github.com/repos/googleapis/sdk-platform-java/hooks","issue_events_url":"https://api.github.com/repos/googleapis/sdk-platform-java/issues/events{/number}","events_url":"https://api.github.com/repos/googleapis/sdk-platform-java/events","assignees_url":"https://api.github.com/repos/googleapis/sdk-platform-java/assignees{/user}","branches_url":"https://api.github.com/repos/googleapis/sdk-platform-java/branches{/branch}","tags_url":"https://api.github.com/repos/googleapis/sdk-platform-java/tags","blobs_url":"https://api.github.com/repos/googleapis/sdk-platform-java/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/googleapis/sdk-platform-java/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/googleapis/sdk-platform-java/git/refs{/sha}","trees_url":"https://api.github.com/repos/googleapis/sdk-platform-java/git/trees{/sha}","statuses_url":"https://api.github.com/repos/googleapis/sdk-platform-java/statuses/{sha}","languages_url":"https://api.github.com/repos/googleapis/sdk-platform-java/languages","stargazers_url":"https://api.github.com/repos/googleapis/sdk-platform-java/stargazers","contributors_url":"https://api.github.com/repos/googleapis/sdk-platform-java/contributors","subscribers_url":"https://api.github.com/repos/googleapis/sdk-platform-java/subscribers","subscription_url":"https://api.github.com/repos/googleapis/sdk-platform-java/subscription","commits_url":"https://api.github.com/repos/googleapis/sdk-platform-java/commits{/sha}","git_commits_url":"https://api.github.com/repos/googleapis/sdk-platform-java/git/commits{/sha}","comments_url":"https://api.github.com/repos/googleapis/sdk-platform-java/comments{/number}","issue_comment_url":"https://api.github.com/repos/googleapis/sdk-platform-java/issues/comments{/number}","contents_url":"https://api.github.com/repos/googleapis/sdk-platform-java/contents/{+path}","compare_url":"https://api.github.com/repos/googleapis/sdk-platform-java/compare/{base}...{head}","merges_url":"https://api.github.com/repos/googleapis/sdk-platform-java/merges","archive_url":"https://api.github.com/repos/googleapis/sdk-platform-java/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/googleapis/sdk-platform-java/downloads","issues_url":"https://api.github.com/repos/googleapis/sdk-platform-java/issues{/number}","pulls_url":"https://api.github.com/repos/googleapis/sdk-platform-java/pulls{/number}","milestones_url":"https://api.github.com/repos/googleapis/sdk-platform-java/milestones{/number}","notifications_url":"https://api.github.com/repos/googleapis/sdk-platform-java/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/googleapis/sdk-platform-java/labels{/name}","releases_url":"https://api.github.com/repos/googleapis/sdk-platform-java/releases{/id}","deployments_url":"https://api.github.com/repos/googleapis/sdk-platform-java/deployments","created_at":"2020-05-14T18:15:25Z","updated_at":"2024-05-14T20:57:11Z","pushed_at":"2024-05-14T21:09:51Z","git_url":"git://github.com/googleapis/sdk-platform-java.git","ssh_url":"git@github.com:googleapis/sdk-platform-java.git","clone_url":"https://github.com/googleapis/sdk-platform-java.git","svn_url":"https://github.com/googleapis/sdk-platform-java","homepage":"https://cloud.google.com/java/docs/bom","size":40540,"stargazers_count":59,"watchers_count":59,"language":"Java","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"has_discussions":false,"forks_count":47,"mirror_url":null,"archived":false,"disabled":false,"open_issues_count":189,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"allow_forking":true,"is_template":false,"web_commit_signoff_required":false,"topics":[],"visibility":"public","forks":47,"open_issues":189,"watchers":59,"default_branch":"main"}},"_links":{"self":{"href":"https://api.github.com/repos/googleapis/sdk-platform-java/pulls/2769"},"html":{"href":"https://github.com/googleapis/sdk-platform-java/pull/2769"},"issue":{"href":"https://api.github.com/repos/googleapis/sdk-platform-java/issues/2769"},"comments":{"href":"https://api.github.com/repos/googleapis/sdk-platform-java/issues/2769/comments"},"review_comments":{"href":"https://api.github.com/repos/googleapis/sdk-platform-java/pulls/2769/comments"},"review_comment":{"href":"https://api.github.com/repos/googleapis/sdk-platform-java/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/googleapis/sdk-platform-java/pulls/2769/commits"},"statuses":{"href":"https://api.github.com/repos/googleapis/sdk-platform-java/statuses/d7e77cb79599612686fe4f7d7eb45ee25206b27f"}},"author_association":"CONTRIBUTOR","auto_merge":{"enabled_by":{"login":"JoeWang1127","id":106995533,"node_id":"U_kgDOBmCfTQ","avatar_url":"https://avatars.githubusercontent.com/u/106995533?v=4","gravatar_id":"","url":"https://api.github.com/users/JoeWang1127","html_url":"https://github.com/JoeWang1127","followers_url":"https://api.github.com/users/JoeWang1127/followers","following_url":"https://api.github.com/users/JoeWang1127/following{/other_user}","gists_url":"https://api.github.com/users/JoeWang1127/gists{/gist_id}","starred_url":"https://api.github.com/users/JoeWang1127/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JoeWang1127/subscriptions","organizations_url":"https://api.github.com/users/JoeWang1127/orgs","repos_url":"https://api.github.com/users/JoeWang1127/repos","events_url":"https://api.github.com/users/JoeWang1127/events{/privacy}","received_events_url":"https://api.github.com/users/JoeWang1127/received_events","type":"User","site_admin":false},"merge_method":"squash","commit_title":"deps: update opentelemetry-java monorepo to v1.38.0 (#2769)","commit_message":"[![Mend\r\nRenovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)\r\n\r\nThis PR contains the following updates:\r\n\r\n| Package | Change | Age | Adoption | Passing | Confidence |\r\n|---|---|---|---|---|---|\r\n|\r\n[io.opentelemetry:opentelemetry-api](https://togithub.com/open-telemetry/opentelemetry-java)\r\n| `1.37.0` -> `1.38.0` |\r\n[![age](https://developer.mend.io/api/mc/badges/age/maven/io.opentelemetry:opentelemetry-api/1.38.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)\r\n|\r\n[![adoption](https://developer.mend.io/api/mc/badges/adoption/maven/io.opentelemetry:opentelemetry-api/1.38.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)\r\n|\r\n[![passing](https://developer.mend.io/api/mc/badges/compatibility/maven/io.opentelemetry:opentelemetry-api/1.37.0/1.38.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)\r\n|\r\n[![confidence](https://developer.mend.io/api/mc/badges/confidence/maven/io.opentelemetry:opentelemetry-api/1.37.0/1.38.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)\r\n|\r\n|\r\n[io.opentelemetry:opentelemetry-bom](https://togithub.com/open-telemetry/opentelemetry-java)\r\n| `1.37.0` -> `1.38.0` |\r\n[![age](https://developer.mend.io/api/mc/badges/age/maven/io.opentelemetry:opentelemetry-bom/1.38.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)\r\n|\r\n[![adoption](https://developer.mend.io/api/mc/badges/adoption/maven/io.opentelemetry:opentelemetry-bom/1.38.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)\r\n|\r\n[![passing](https://developer.mend.io/api/mc/badges/compatibility/maven/io.opentelemetry:opentelemetry-bom/1.37.0/1.38.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)\r\n|\r\n[![confidence](https://developer.mend.io/api/mc/badges/confidence/maven/io.opentelemetry:opentelemetry-bom/1.37.0/1.38.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)\r\n|\r\n\r\n---\r\n\r\n> [!WARNING]\r\n> Some dependencies could not be looked up. Check the Dependency\r\nDashboard for more information.\r\n\r\n---\r\n\r\n### Release Notes\r\n\r\n
        \r\nopen-telemetry/opentelemetry-java\r\n(io.opentelemetry:opentelemetry-api)\r\n\r\n###\r\n[`v1.38.0`](https://togithub.com/open-telemetry/opentelemetry-java/blob/HEAD/CHANGELOG.md#Version-1380-2024-05-10)\r\n\r\n##### API\r\n\r\n- Stabilize synchronous gauge\r\n\r\n([#​6419](https://togithub.com/open-telemetry/opentelemetry-java/pull/6419))\r\n\r\n##### Incubator\r\n\r\n- Add put(AttributeKey, T) overload to EventBuilder\r\n\r\n([#​6331](https://togithub.com/open-telemetry/opentelemetry-java/pull/6331))\r\n\r\n##### Baggage\r\n\r\n- Baggage filters space-only keys\r\n\r\n([#​6431](https://togithub.com/open-telemetry/opentelemetry-java/pull/6431))\r\n\r\n##### SDK\r\n\r\n- Add experimental scope config to enable / disable scopes (i.e. meter,\r\nlogger, tracer)\r\n\r\n([#​6375](https://togithub.com/open-telemetry/opentelemetry-java/pull/6375))\r\n\r\n##### Traces\r\n\r\n- Add ReadableSpan#getAttributes\r\n\r\n([#​6382](https://togithub.com/open-telemetry/opentelemetry-java/pull/6382))\r\n- Use standard ArrayList size rather than max number of links for\r\ninitial span links allocation\r\n\r\n([#​6252](https://togithub.com/open-telemetry/opentelemetry-java/pull/6252))\r\n\r\n##### Metrics\r\n\r\n- Use low precision Clock#now when computing timestamp for exemplars\r\n\r\n([#​6417](https://togithub.com/open-telemetry/opentelemetry-java/pull/6417))\r\n- Update invalid instrument name log message now that forward slash `/`\r\nis valid\r\n\r\n([#​6343](https://togithub.com/open-telemetry/opentelemetry-java/pull/6343))\r\n\r\n##### Exporters\r\n\r\n- Introduce low allocation OTLP marshalers. If using autoconfigure, opt\r\nin\r\n via `OTEL_JAVA_EXPERIMENTAL_EXPORTER_MEMORY_MODE=REUSABLE_DATA`.\r\n - Low allocation OTLP logs marshaler\r\n\r\n([#​6429](https://togithub.com/open-telemetry/opentelemetry-java/pull/6429))\r\n - Low allocation OTLP metrics marshaler\r\n\r\n([#​6422](https://togithub.com/open-telemetry/opentelemetry-java/pull/6422))\r\n - Low allocation OTLP trace marshaler\r\n\r\n([#​6410](https://togithub.com/open-telemetry/opentelemetry-java/pull/6410))\r\n - Add memory mode support to OTLP exporters\r\n\r\n([#​6430](https://togithub.com/open-telemetry/opentelemetry-java/pull/6430))\r\n - Marshal span status description without allocation\r\n\r\n([#​6423](https://togithub.com/open-telemetry/opentelemetry-java/pull/6423))\r\n - Add private constructors for stateless marshalers\r\n\r\n([#​6434](https://togithub.com/open-telemetry/opentelemetry-java/pull/6434))\r\n- Mark opentelemetry-exporter-sender-jdk stable\r\n\r\n([#​6357](https://togithub.com/open-telemetry/opentelemetry-java/pull/6357))\r\n- PrometheusHttpServer prevent concurrent reads when reusable memory\r\nmode\r\n\r\n([#​6371](https://togithub.com/open-telemetry/opentelemetry-java/pull/6371))\r\n- Ignore TLS components (SSLContext, TrustManager, KeyManager) if plain\r\nHTTP protocol is used for\r\n exporting\r\n\r\n([#​6329](https://togithub.com/open-telemetry/opentelemetry-java/pull/6329))\r\n- Add is_remote_parent span flags to OTLP exported Spans and SpanLinks\r\n\r\n([#​6388](https://togithub.com/open-telemetry/opentelemetry-java/pull/6388))\r\n- Add missing fields to OTLP metric exporters `toString()`\r\n\r\n([#​6402](https://togithub.com/open-telemetry/opentelemetry-java/pull/6402))\r\n\r\n##### Extensions\r\n\r\n- Rename otel.config.file to otel.experimental.config.file for\r\nautoconfigure\r\n\r\n([#​6396](https://togithub.com/open-telemetry/opentelemetry-java/pull/6396))\r\n\r\n##### OpenCensus Shim\r\n\r\n- Fix opencensus shim spanBuilderWithRemoteParent behavior\r\n\r\n([#​6415](https://togithub.com/open-telemetry/opentelemetry-java/pull/6415))\r\n\r\n##### Tooling\r\n\r\n- Add additional API incubator docs\r\n\r\n([#​6356](https://togithub.com/open-telemetry/opentelemetry-java/pull/6356))\r\n- Run build on java 21\r\n\r\n([#​6370](https://togithub.com/open-telemetry/opentelemetry-java/pull/6370))\r\n- Fix running tests with java 8 on macos\r\n\r\n([#​6411](https://togithub.com/open-telemetry/opentelemetry-java/pull/6411))\r\n- Move away from deprecated gradle enterprise APIs\r\n\r\n([#​6363](https://togithub.com/open-telemetry/opentelemetry-java/pull/6363))\r\n\r\n
        \r\n\r\n---\r\n\r\n### Configuration\r\n\r\n📅 **Schedule**: Branch creation - At any time (no schedule defined),\r\nAutomerge - At any time (no schedule defined).\r\n\r\n🚦 **Automerge**: Disabled by config. Please merge this manually once you\r\nare satisfied.\r\n\r\n♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the\r\nrebase/retry checkbox.\r\n\r\n🔕 **Ignore**: Close this PR and you won't be reminded about these\r\nupdates again.\r\n\r\n---\r\n\r\n- [ ] If you want to rebase/retry this PR, check\r\nthis box\r\n\r\n---\r\n\r\nThis PR has been generated by [Mend\r\nRenovate](https://www.mend.io/free-developer-tools/renovate/). View\r\nrepository job log\r\n[here](https://developer.mend.io/github/googleapis/sdk-platform-java).\r\n\r\n"},"active_lock_reason":null},{"url":"https://api.github.com/repos/googleapis/sdk-platform-java/pulls/2768","id":1869472682,"node_id":"PR_kwDOD7wwCM5vbeOq","html_url":"https://github.com/googleapis/sdk-platform-java/pull/2768","diff_url":"https://github.com/googleapis/sdk-platform-java/pull/2768.diff","patch_url":"https://github.com/googleapis/sdk-platform-java/pull/2768.patch","issue_url":"https://api.github.com/repos/googleapis/sdk-platform-java/issues/2768","number":2768,"state":"closed","locked":false,"title":"deps: update dependency com.google.oauth-client:google-oauth-client-bom to v1.36.0","user":{"login":"renovate-bot","id":25180681,"node_id":"MDQ6VXNlcjI1MTgwNjgx","avatar_url":"https://avatars.githubusercontent.com/u/25180681?v=4","gravatar_id":"","url":"https://api.github.com/users/renovate-bot","html_url":"https://github.com/renovate-bot","followers_url":"https://api.github.com/users/renovate-bot/followers","following_url":"https://api.github.com/users/renovate-bot/following{/other_user}","gists_url":"https://api.github.com/users/renovate-bot/gists{/gist_id}","starred_url":"https://api.github.com/users/renovate-bot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/renovate-bot/subscriptions","organizations_url":"https://api.github.com/users/renovate-bot/orgs","repos_url":"https://api.github.com/users/renovate-bot/repos","events_url":"https://api.github.com/users/renovate-bot/events{/privacy}","received_events_url":"https://api.github.com/users/renovate-bot/received_events","type":"User","site_admin":false},"body":"[![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)\n\nThis PR contains the following updates:\n\n| Package | Change | Age | Adoption | Passing | Confidence |\n|---|---|---|---|---|---|\n| [com.google.oauth-client:google-oauth-client-bom](https://togithub.com/googleapis/google-oauth-java-client/tree/master/google-oauth-client-bom) ([source](https://togithub.com/googleapis/google-oauth-java-client)) | `1.35.0` -> `1.36.0` | [![age](https://developer.mend.io/api/mc/badges/age/maven/com.google.oauth-client:google-oauth-client-bom/1.36.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://developer.mend.io/api/mc/badges/adoption/maven/com.google.oauth-client:google-oauth-client-bom/1.36.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://developer.mend.io/api/mc/badges/compatibility/maven/com.google.oauth-client:google-oauth-client-bom/1.35.0/1.36.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://developer.mend.io/api/mc/badges/confidence/maven/com.google.oauth-client:google-oauth-client-bom/1.35.0/1.36.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) |\n\n---\n\n> [!WARNING]\n> Some dependencies could not be looked up. Check the Dependency Dashboard for more information.\n\n---\n\n### Release Notes\n\n
        \ngoogleapis/google-oauth-java-client (com.google.oauth-client:google-oauth-client-bom)\n\n### [`v1.36.0`](https://togithub.com/googleapis/google-oauth-java-client/blob/HEAD/CHANGELOG.md#1360-2024-05-10)\n\n[Compare Source](https://togithub.com/googleapis/google-oauth-java-client/compare/v1.35.0...v1.36.0)\n\n##### Features\n\n- Servlet classes that use the jakarta namespace ([#​1115](https://togithub.com/googleapis/google-oauth-java-client/issues/1115)) ([11d6a3c](https://togithub.com/googleapis/google-oauth-java-client/commit/11d6a3cb30c4ebfe4fc4e196d99f5764c6ade878))\n\n
        \n\n---\n\n### Configuration\n\n📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).\n\n🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.\n\n♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.\n\n🔕 **Ignore**: Close this PR and you won't be reminded about this update again.\n\n---\n\n - [ ] If you want to rebase/retry this PR, check this box\n\n---\n\nThis PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://developer.mend.io/github/googleapis/sdk-platform-java).\n\n","created_at":"2024-05-14T17:13:38Z","updated_at":"2024-05-14T18:02:15Z","closed_at":"2024-05-14T18:00:55Z","merged_at":"2024-05-14T18:00:54Z","merge_commit_sha":"22b7398f07a77935c0c002c78e8e30dca5979652","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":2307402262,"node_id":"MDU6TGFiZWwyMzA3NDAyMjYy","url":"https://api.github.com/repos/googleapis/sdk-platform-java/labels/kokoro:force-run","name":"kokoro:force-run","color":"C1FFB2","default":false,"description":"Add this label to force Kokoro to re-run the tests."},{"id":5133296390,"node_id":"LA_kwDOD7wwCM8AAAABMffjBg","url":"https://api.github.com/repos/googleapis/sdk-platform-java/labels/size:%20xs","name":"size: xs","color":"ae5816","default":false,"description":"Pull request size is extra small."}],"milestone":null,"draft":false,"commits_url":"https://api.github.com/repos/googleapis/sdk-platform-java/pulls/2768/commits","review_comments_url":"https://api.github.com/repos/googleapis/sdk-platform-java/pulls/2768/comments","review_comment_url":"https://api.github.com/repos/googleapis/sdk-platform-java/pulls/comments{/number}","comments_url":"https://api.github.com/repos/googleapis/sdk-platform-java/issues/2768/comments","statuses_url":"https://api.github.com/repos/googleapis/sdk-platform-java/statuses/e62880459e145b9d968eac09a2c6a9d7e5f56011","head":{"label":"renovate-bot:renovate/google.oauth-client.version","ref":"renovate/google.oauth-client.version","sha":"e62880459e145b9d968eac09a2c6a9d7e5f56011","user":{"login":"renovate-bot","id":25180681,"node_id":"MDQ6VXNlcjI1MTgwNjgx","avatar_url":"https://avatars.githubusercontent.com/u/25180681?v=4","gravatar_id":"","url":"https://api.github.com/users/renovate-bot","html_url":"https://github.com/renovate-bot","followers_url":"https://api.github.com/users/renovate-bot/followers","following_url":"https://api.github.com/users/renovate-bot/following{/other_user}","gists_url":"https://api.github.com/users/renovate-bot/gists{/gist_id}","starred_url":"https://api.github.com/users/renovate-bot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/renovate-bot/subscriptions","organizations_url":"https://api.github.com/users/renovate-bot/orgs","repos_url":"https://api.github.com/users/renovate-bot/repos","events_url":"https://api.github.com/users/renovate-bot/events{/privacy}","received_events_url":"https://api.github.com/users/renovate-bot/received_events","type":"User","site_admin":false},"repo":{"id":439311054,"node_id":"R_kgDOGi9azg","name":"gapic-generator-java","full_name":"renovate-bot/gapic-generator-java","private":false,"owner":{"login":"renovate-bot","id":25180681,"node_id":"MDQ6VXNlcjI1MTgwNjgx","avatar_url":"https://avatars.githubusercontent.com/u/25180681?v=4","gravatar_id":"","url":"https://api.github.com/users/renovate-bot","html_url":"https://github.com/renovate-bot","followers_url":"https://api.github.com/users/renovate-bot/followers","following_url":"https://api.github.com/users/renovate-bot/following{/other_user}","gists_url":"https://api.github.com/users/renovate-bot/gists{/gist_id}","starred_url":"https://api.github.com/users/renovate-bot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/renovate-bot/subscriptions","organizations_url":"https://api.github.com/users/renovate-bot/orgs","repos_url":"https://api.github.com/users/renovate-bot/repos","events_url":"https://api.github.com/users/renovate-bot/events{/privacy}","received_events_url":"https://api.github.com/users/renovate-bot/received_events","type":"User","site_admin":false},"html_url":"https://github.com/renovate-bot/gapic-generator-java","description":"Generates GAPIC Java client libraries from protobufs.","fork":true,"url":"https://api.github.com/repos/renovate-bot/gapic-generator-java","forks_url":"https://api.github.com/repos/renovate-bot/gapic-generator-java/forks","keys_url":"https://api.github.com/repos/renovate-bot/gapic-generator-java/keys{/key_id}","collaborators_url":"https://api.github.com/repos/renovate-bot/gapic-generator-java/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/renovate-bot/gapic-generator-java/teams","hooks_url":"https://api.github.com/repos/renovate-bot/gapic-generator-java/hooks","issue_events_url":"https://api.github.com/repos/renovate-bot/gapic-generator-java/issues/events{/number}","events_url":"https://api.github.com/repos/renovate-bot/gapic-generator-java/events","assignees_url":"https://api.github.com/repos/renovate-bot/gapic-generator-java/assignees{/user}","branches_url":"https://api.github.com/repos/renovate-bot/gapic-generator-java/branches{/branch}","tags_url":"https://api.github.com/repos/renovate-bot/gapic-generator-java/tags","blobs_url":"https://api.github.com/repos/renovate-bot/gapic-generator-java/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/renovate-bot/gapic-generator-java/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/renovate-bot/gapic-generator-java/git/refs{/sha}","trees_url":"https://api.github.com/repos/renovate-bot/gapic-generator-java/git/trees{/sha}","statuses_url":"https://api.github.com/repos/renovate-bot/gapic-generator-java/statuses/{sha}","languages_url":"https://api.github.com/repos/renovate-bot/gapic-generator-java/languages","stargazers_url":"https://api.github.com/repos/renovate-bot/gapic-generator-java/stargazers","contributors_url":"https://api.github.com/repos/renovate-bot/gapic-generator-java/contributors","subscribers_url":"https://api.github.com/repos/renovate-bot/gapic-generator-java/subscribers","subscription_url":"https://api.github.com/repos/renovate-bot/gapic-generator-java/subscription","commits_url":"https://api.github.com/repos/renovate-bot/gapic-generator-java/commits{/sha}","git_commits_url":"https://api.github.com/repos/renovate-bot/gapic-generator-java/git/commits{/sha}","comments_url":"https://api.github.com/repos/renovate-bot/gapic-generator-java/comments{/number}","issue_comment_url":"https://api.github.com/repos/renovate-bot/gapic-generator-java/issues/comments{/number}","contents_url":"https://api.github.com/repos/renovate-bot/gapic-generator-java/contents/{+path}","compare_url":"https://api.github.com/repos/renovate-bot/gapic-generator-java/compare/{base}...{head}","merges_url":"https://api.github.com/repos/renovate-bot/gapic-generator-java/merges","archive_url":"https://api.github.com/repos/renovate-bot/gapic-generator-java/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/renovate-bot/gapic-generator-java/downloads","issues_url":"https://api.github.com/repos/renovate-bot/gapic-generator-java/issues{/number}","pulls_url":"https://api.github.com/repos/renovate-bot/gapic-generator-java/pulls{/number}","milestones_url":"https://api.github.com/repos/renovate-bot/gapic-generator-java/milestones{/number}","notifications_url":"https://api.github.com/repos/renovate-bot/gapic-generator-java/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/renovate-bot/gapic-generator-java/labels{/name}","releases_url":"https://api.github.com/repos/renovate-bot/gapic-generator-java/releases{/id}","deployments_url":"https://api.github.com/repos/renovate-bot/gapic-generator-java/deployments","created_at":"2021-12-17T11:33:15Z","updated_at":"2024-05-14T20:57:21Z","pushed_at":"2024-05-14T20:58:34Z","git_url":"git://github.com/renovate-bot/gapic-generator-java.git","ssh_url":"git@github.com:renovate-bot/gapic-generator-java.git","clone_url":"https://github.com/renovate-bot/gapic-generator-java.git","svn_url":"https://github.com/renovate-bot/gapic-generator-java","homepage":"","size":31486,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"has_discussions":false,"forks_count":0,"mirror_url":null,"archived":false,"disabled":false,"open_issues_count":0,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"allow_forking":true,"is_template":false,"web_commit_signoff_required":false,"topics":[],"visibility":"public","forks":0,"open_issues":0,"watchers":0,"default_branch":"main"}},"base":{"label":"googleapis:main","ref":"main","sha":"891b01d0d35384df3269cdd8b37102b2587c9188","user":{"login":"googleapis","id":16785467,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE2Nzg1NDY3","avatar_url":"https://avatars.githubusercontent.com/u/16785467?v=4","gravatar_id":"","url":"https://api.github.com/users/googleapis","html_url":"https://github.com/googleapis","followers_url":"https://api.github.com/users/googleapis/followers","following_url":"https://api.github.com/users/googleapis/following{/other_user}","gists_url":"https://api.github.com/users/googleapis/gists{/gist_id}","starred_url":"https://api.github.com/users/googleapis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/googleapis/subscriptions","organizations_url":"https://api.github.com/users/googleapis/orgs","repos_url":"https://api.github.com/users/googleapis/repos","events_url":"https://api.github.com/users/googleapis/events{/privacy}","received_events_url":"https://api.github.com/users/googleapis/received_events","type":"Organization","site_admin":false},"repo":{"id":263991304,"node_id":"MDEwOlJlcG9zaXRvcnkyNjM5OTEzMDQ=","name":"sdk-platform-java","full_name":"googleapis/sdk-platform-java","private":false,"owner":{"login":"googleapis","id":16785467,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE2Nzg1NDY3","avatar_url":"https://avatars.githubusercontent.com/u/16785467?v=4","gravatar_id":"","url":"https://api.github.com/users/googleapis","html_url":"https://github.com/googleapis","followers_url":"https://api.github.com/users/googleapis/followers","following_url":"https://api.github.com/users/googleapis/following{/other_user}","gists_url":"https://api.github.com/users/googleapis/gists{/gist_id}","starred_url":"https://api.github.com/users/googleapis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/googleapis/subscriptions","organizations_url":"https://api.github.com/users/googleapis/orgs","repos_url":"https://api.github.com/users/googleapis/repos","events_url":"https://api.github.com/users/googleapis/events{/privacy}","received_events_url":"https://api.github.com/users/googleapis/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/googleapis/sdk-platform-java","description":"Tooling and shared libraries for Cloud SDK for Java","fork":false,"url":"https://api.github.com/repos/googleapis/sdk-platform-java","forks_url":"https://api.github.com/repos/googleapis/sdk-platform-java/forks","keys_url":"https://api.github.com/repos/googleapis/sdk-platform-java/keys{/key_id}","collaborators_url":"https://api.github.com/repos/googleapis/sdk-platform-java/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/googleapis/sdk-platform-java/teams","hooks_url":"https://api.github.com/repos/googleapis/sdk-platform-java/hooks","issue_events_url":"https://api.github.com/repos/googleapis/sdk-platform-java/issues/events{/number}","events_url":"https://api.github.com/repos/googleapis/sdk-platform-java/events","assignees_url":"https://api.github.com/repos/googleapis/sdk-platform-java/assignees{/user}","branches_url":"https://api.github.com/repos/googleapis/sdk-platform-java/branches{/branch}","tags_url":"https://api.github.com/repos/googleapis/sdk-platform-java/tags","blobs_url":"https://api.github.com/repos/googleapis/sdk-platform-java/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/googleapis/sdk-platform-java/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/googleapis/sdk-platform-java/git/refs{/sha}","trees_url":"https://api.github.com/repos/googleapis/sdk-platform-java/git/trees{/sha}","statuses_url":"https://api.github.com/repos/googleapis/sdk-platform-java/statuses/{sha}","languages_url":"https://api.github.com/repos/googleapis/sdk-platform-java/languages","stargazers_url":"https://api.github.com/repos/googleapis/sdk-platform-java/stargazers","contributors_url":"https://api.github.com/repos/googleapis/sdk-platform-java/contributors","subscribers_url":"https://api.github.com/repos/googleapis/sdk-platform-java/subscribers","subscription_url":"https://api.github.com/repos/googleapis/sdk-platform-java/subscription","commits_url":"https://api.github.com/repos/googleapis/sdk-platform-java/commits{/sha}","git_commits_url":"https://api.github.com/repos/googleapis/sdk-platform-java/git/commits{/sha}","comments_url":"https://api.github.com/repos/googleapis/sdk-platform-java/comments{/number}","issue_comment_url":"https://api.github.com/repos/googleapis/sdk-platform-java/issues/comments{/number}","contents_url":"https://api.github.com/repos/googleapis/sdk-platform-java/contents/{+path}","compare_url":"https://api.github.com/repos/googleapis/sdk-platform-java/compare/{base}...{head}","merges_url":"https://api.github.com/repos/googleapis/sdk-platform-java/merges","archive_url":"https://api.github.com/repos/googleapis/sdk-platform-java/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/googleapis/sdk-platform-java/downloads","issues_url":"https://api.github.com/repos/googleapis/sdk-platform-java/issues{/number}","pulls_url":"https://api.github.com/repos/googleapis/sdk-platform-java/pulls{/number}","milestones_url":"https://api.github.com/repos/googleapis/sdk-platform-java/milestones{/number}","notifications_url":"https://api.github.com/repos/googleapis/sdk-platform-java/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/googleapis/sdk-platform-java/labels{/name}","releases_url":"https://api.github.com/repos/googleapis/sdk-platform-java/releases{/id}","deployments_url":"https://api.github.com/repos/googleapis/sdk-platform-java/deployments","created_at":"2020-05-14T18:15:25Z","updated_at":"2024-05-14T20:57:11Z","pushed_at":"2024-05-14T21:09:51Z","git_url":"git://github.com/googleapis/sdk-platform-java.git","ssh_url":"git@github.com:googleapis/sdk-platform-java.git","clone_url":"https://github.com/googleapis/sdk-platform-java.git","svn_url":"https://github.com/googleapis/sdk-platform-java","homepage":"https://cloud.google.com/java/docs/bom","size":40540,"stargazers_count":59,"watchers_count":59,"language":"Java","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"has_discussions":false,"forks_count":47,"mirror_url":null,"archived":false,"disabled":false,"open_issues_count":189,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"allow_forking":true,"is_template":false,"web_commit_signoff_required":false,"topics":[],"visibility":"public","forks":47,"open_issues":189,"watchers":59,"default_branch":"main"}},"_links":{"self":{"href":"https://api.github.com/repos/googleapis/sdk-platform-java/pulls/2768"},"html":{"href":"https://github.com/googleapis/sdk-platform-java/pull/2768"},"issue":{"href":"https://api.github.com/repos/googleapis/sdk-platform-java/issues/2768"},"comments":{"href":"https://api.github.com/repos/googleapis/sdk-platform-java/issues/2768/comments"},"review_comments":{"href":"https://api.github.com/repos/googleapis/sdk-platform-java/pulls/2768/comments"},"review_comment":{"href":"https://api.github.com/repos/googleapis/sdk-platform-java/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/googleapis/sdk-platform-java/pulls/2768/commits"},"statuses":{"href":"https://api.github.com/repos/googleapis/sdk-platform-java/statuses/e62880459e145b9d968eac09a2c6a9d7e5f56011"}},"author_association":"CONTRIBUTOR","auto_merge":null,"active_lock_reason":null},{"url":"https://api.github.com/repos/googleapis/sdk-platform-java/pulls/2767","id":1869018134,"node_id":"PR_kwDOD7wwCM5vZvQW","html_url":"https://github.com/googleapis/sdk-platform-java/pull/2767","diff_url":"https://github.com/googleapis/sdk-platform-java/pull/2767.diff","patch_url":"https://github.com/googleapis/sdk-platform-java/pull/2767.patch","issue_url":"https://api.github.com/repos/googleapis/sdk-platform-java/issues/2767","number":2767,"state":"closed","locked":false,"title":"deps: update dependency com.google.cloud:grpc-gcp to v1.6.0","user":{"login":"renovate-bot","id":25180681,"node_id":"MDQ6VXNlcjI1MTgwNjgx","avatar_url":"https://avatars.githubusercontent.com/u/25180681?v=4","gravatar_id":"","url":"https://api.github.com/users/renovate-bot","html_url":"https://github.com/renovate-bot","followers_url":"https://api.github.com/users/renovate-bot/followers","following_url":"https://api.github.com/users/renovate-bot/following{/other_user}","gists_url":"https://api.github.com/users/renovate-bot/gists{/gist_id}","starred_url":"https://api.github.com/users/renovate-bot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/renovate-bot/subscriptions","organizations_url":"https://api.github.com/users/renovate-bot/orgs","repos_url":"https://api.github.com/users/renovate-bot/repos","events_url":"https://api.github.com/users/renovate-bot/events{/privacy}","received_events_url":"https://api.github.com/users/renovate-bot/received_events","type":"User","site_admin":false},"body":"[![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)\n\nThis PR contains the following updates:\n\n| Package | Change | Age | Adoption | Passing | Confidence |\n|---|---|---|---|---|---|\n| [com.google.cloud:grpc-gcp](https://togithub.com/GoogleCloudPlatform/grpc-gcp-java/tree/master/grpc-gcp) ([source](https://togithub.com/GoogleCloudPlatform/grpc-gcp-java)) | `1.5.0` -> `1.6.0` | [![age](https://developer.mend.io/api/mc/badges/age/maven/com.google.cloud:grpc-gcp/1.6.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://developer.mend.io/api/mc/badges/adoption/maven/com.google.cloud:grpc-gcp/1.6.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://developer.mend.io/api/mc/badges/compatibility/maven/com.google.cloud:grpc-gcp/1.5.0/1.6.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://developer.mend.io/api/mc/badges/confidence/maven/com.google.cloud:grpc-gcp/1.5.0/1.6.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) |\n\n---\n\n> [!WARNING]\n> Some dependencies could not be looked up. Check the Dependency Dashboard for more information.\n\n---\n\n### Configuration\n\n📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).\n\n🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.\n\n♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.\n\n🔕 **Ignore**: Close this PR and you won't be reminded about this update again.\n\n---\n\n - [ ] If you want to rebase/retry this PR, check this box\n\n---\n\nThis PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://developer.mend.io/github/googleapis/sdk-platform-java).\n\n","created_at":"2024-05-14T13:32:19Z","updated_at":"2024-05-14T19:28:05Z","closed_at":"2024-05-14T19:28:05Z","merged_at":"2024-05-14T19:28:05Z","merge_commit_sha":"a39aa07d013c9c097ad93fd68cf97da1c7d9ff03","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":2307402262,"node_id":"MDU6TGFiZWwyMzA3NDAyMjYy","url":"https://api.github.com/repos/googleapis/sdk-platform-java/labels/kokoro:force-run","name":"kokoro:force-run","color":"C1FFB2","default":false,"description":"Add this label to force Kokoro to re-run the tests."},{"id":5133296390,"node_id":"LA_kwDOD7wwCM8AAAABMffjBg","url":"https://api.github.com/repos/googleapis/sdk-platform-java/labels/size:%20xs","name":"size: xs","color":"ae5816","default":false,"description":"Pull request size is extra small."}],"milestone":null,"draft":false,"commits_url":"https://api.github.com/repos/googleapis/sdk-platform-java/pulls/2767/commits","review_comments_url":"https://api.github.com/repos/googleapis/sdk-platform-java/pulls/2767/comments","review_comment_url":"https://api.github.com/repos/googleapis/sdk-platform-java/pulls/comments{/number}","comments_url":"https://api.github.com/repos/googleapis/sdk-platform-java/issues/2767/comments","statuses_url":"https://api.github.com/repos/googleapis/sdk-platform-java/statuses/3e5ff9a2c6975d83614c91b669840eb41eff8591","head":{"label":"renovate-bot:renovate/grpc-gcp.version","ref":"renovate/grpc-gcp.version","sha":"3e5ff9a2c6975d83614c91b669840eb41eff8591","user":{"login":"renovate-bot","id":25180681,"node_id":"MDQ6VXNlcjI1MTgwNjgx","avatar_url":"https://avatars.githubusercontent.com/u/25180681?v=4","gravatar_id":"","url":"https://api.github.com/users/renovate-bot","html_url":"https://github.com/renovate-bot","followers_url":"https://api.github.com/users/renovate-bot/followers","following_url":"https://api.github.com/users/renovate-bot/following{/other_user}","gists_url":"https://api.github.com/users/renovate-bot/gists{/gist_id}","starred_url":"https://api.github.com/users/renovate-bot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/renovate-bot/subscriptions","organizations_url":"https://api.github.com/users/renovate-bot/orgs","repos_url":"https://api.github.com/users/renovate-bot/repos","events_url":"https://api.github.com/users/renovate-bot/events{/privacy}","received_events_url":"https://api.github.com/users/renovate-bot/received_events","type":"User","site_admin":false},"repo":{"id":439311054,"node_id":"R_kgDOGi9azg","name":"gapic-generator-java","full_name":"renovate-bot/gapic-generator-java","private":false,"owner":{"login":"renovate-bot","id":25180681,"node_id":"MDQ6VXNlcjI1MTgwNjgx","avatar_url":"https://avatars.githubusercontent.com/u/25180681?v=4","gravatar_id":"","url":"https://api.github.com/users/renovate-bot","html_url":"https://github.com/renovate-bot","followers_url":"https://api.github.com/users/renovate-bot/followers","following_url":"https://api.github.com/users/renovate-bot/following{/other_user}","gists_url":"https://api.github.com/users/renovate-bot/gists{/gist_id}","starred_url":"https://api.github.com/users/renovate-bot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/renovate-bot/subscriptions","organizations_url":"https://api.github.com/users/renovate-bot/orgs","repos_url":"https://api.github.com/users/renovate-bot/repos","events_url":"https://api.github.com/users/renovate-bot/events{/privacy}","received_events_url":"https://api.github.com/users/renovate-bot/received_events","type":"User","site_admin":false},"html_url":"https://github.com/renovate-bot/gapic-generator-java","description":"Generates GAPIC Java client libraries from protobufs.","fork":true,"url":"https://api.github.com/repos/renovate-bot/gapic-generator-java","forks_url":"https://api.github.com/repos/renovate-bot/gapic-generator-java/forks","keys_url":"https://api.github.com/repos/renovate-bot/gapic-generator-java/keys{/key_id}","collaborators_url":"https://api.github.com/repos/renovate-bot/gapic-generator-java/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/renovate-bot/gapic-generator-java/teams","hooks_url":"https://api.github.com/repos/renovate-bot/gapic-generator-java/hooks","issue_events_url":"https://api.github.com/repos/renovate-bot/gapic-generator-java/issues/events{/number}","events_url":"https://api.github.com/repos/renovate-bot/gapic-generator-java/events","assignees_url":"https://api.github.com/repos/renovate-bot/gapic-generator-java/assignees{/user}","branches_url":"https://api.github.com/repos/renovate-bot/gapic-generator-java/branches{/branch}","tags_url":"https://api.github.com/repos/renovate-bot/gapic-generator-java/tags","blobs_url":"https://api.github.com/repos/renovate-bot/gapic-generator-java/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/renovate-bot/gapic-generator-java/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/renovate-bot/gapic-generator-java/git/refs{/sha}","trees_url":"https://api.github.com/repos/renovate-bot/gapic-generator-java/git/trees{/sha}","statuses_url":"https://api.github.com/repos/renovate-bot/gapic-generator-java/statuses/{sha}","languages_url":"https://api.github.com/repos/renovate-bot/gapic-generator-java/languages","stargazers_url":"https://api.github.com/repos/renovate-bot/gapic-generator-java/stargazers","contributors_url":"https://api.github.com/repos/renovate-bot/gapic-generator-java/contributors","subscribers_url":"https://api.github.com/repos/renovate-bot/gapic-generator-java/subscribers","subscription_url":"https://api.github.com/repos/renovate-bot/gapic-generator-java/subscription","commits_url":"https://api.github.com/repos/renovate-bot/gapic-generator-java/commits{/sha}","git_commits_url":"https://api.github.com/repos/renovate-bot/gapic-generator-java/git/commits{/sha}","comments_url":"https://api.github.com/repos/renovate-bot/gapic-generator-java/comments{/number}","issue_comment_url":"https://api.github.com/repos/renovate-bot/gapic-generator-java/issues/comments{/number}","contents_url":"https://api.github.com/repos/renovate-bot/gapic-generator-java/contents/{+path}","compare_url":"https://api.github.com/repos/renovate-bot/gapic-generator-java/compare/{base}...{head}","merges_url":"https://api.github.com/repos/renovate-bot/gapic-generator-java/merges","archive_url":"https://api.github.com/repos/renovate-bot/gapic-generator-java/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/renovate-bot/gapic-generator-java/downloads","issues_url":"https://api.github.com/repos/renovate-bot/gapic-generator-java/issues{/number}","pulls_url":"https://api.github.com/repos/renovate-bot/gapic-generator-java/pulls{/number}","milestones_url":"https://api.github.com/repos/renovate-bot/gapic-generator-java/milestones{/number}","notifications_url":"https://api.github.com/repos/renovate-bot/gapic-generator-java/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/renovate-bot/gapic-generator-java/labels{/name}","releases_url":"https://api.github.com/repos/renovate-bot/gapic-generator-java/releases{/id}","deployments_url":"https://api.github.com/repos/renovate-bot/gapic-generator-java/deployments","created_at":"2021-12-17T11:33:15Z","updated_at":"2024-05-14T20:57:21Z","pushed_at":"2024-05-14T20:58:34Z","git_url":"git://github.com/renovate-bot/gapic-generator-java.git","ssh_url":"git@github.com:renovate-bot/gapic-generator-java.git","clone_url":"https://github.com/renovate-bot/gapic-generator-java.git","svn_url":"https://github.com/renovate-bot/gapic-generator-java","homepage":"","size":31486,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"has_discussions":false,"forks_count":0,"mirror_url":null,"archived":false,"disabled":false,"open_issues_count":0,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"allow_forking":true,"is_template":false,"web_commit_signoff_required":false,"topics":[],"visibility":"public","forks":0,"open_issues":0,"watchers":0,"default_branch":"main"}},"base":{"label":"googleapis:main","ref":"main","sha":"0a5c7c4075ee986028535c424e4a62458a25f8d2","user":{"login":"googleapis","id":16785467,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE2Nzg1NDY3","avatar_url":"https://avatars.githubusercontent.com/u/16785467?v=4","gravatar_id":"","url":"https://api.github.com/users/googleapis","html_url":"https://github.com/googleapis","followers_url":"https://api.github.com/users/googleapis/followers","following_url":"https://api.github.com/users/googleapis/following{/other_user}","gists_url":"https://api.github.com/users/googleapis/gists{/gist_id}","starred_url":"https://api.github.com/users/googleapis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/googleapis/subscriptions","organizations_url":"https://api.github.com/users/googleapis/orgs","repos_url":"https://api.github.com/users/googleapis/repos","events_url":"https://api.github.com/users/googleapis/events{/privacy}","received_events_url":"https://api.github.com/users/googleapis/received_events","type":"Organization","site_admin":false},"repo":{"id":263991304,"node_id":"MDEwOlJlcG9zaXRvcnkyNjM5OTEzMDQ=","name":"sdk-platform-java","full_name":"googleapis/sdk-platform-java","private":false,"owner":{"login":"googleapis","id":16785467,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE2Nzg1NDY3","avatar_url":"https://avatars.githubusercontent.com/u/16785467?v=4","gravatar_id":"","url":"https://api.github.com/users/googleapis","html_url":"https://github.com/googleapis","followers_url":"https://api.github.com/users/googleapis/followers","following_url":"https://api.github.com/users/googleapis/following{/other_user}","gists_url":"https://api.github.com/users/googleapis/gists{/gist_id}","starred_url":"https://api.github.com/users/googleapis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/googleapis/subscriptions","organizations_url":"https://api.github.com/users/googleapis/orgs","repos_url":"https://api.github.com/users/googleapis/repos","events_url":"https://api.github.com/users/googleapis/events{/privacy}","received_events_url":"https://api.github.com/users/googleapis/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/googleapis/sdk-platform-java","description":"Tooling and shared libraries for Cloud SDK for Java","fork":false,"url":"https://api.github.com/repos/googleapis/sdk-platform-java","forks_url":"https://api.github.com/repos/googleapis/sdk-platform-java/forks","keys_url":"https://api.github.com/repos/googleapis/sdk-platform-java/keys{/key_id}","collaborators_url":"https://api.github.com/repos/googleapis/sdk-platform-java/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/googleapis/sdk-platform-java/teams","hooks_url":"https://api.github.com/repos/googleapis/sdk-platform-java/hooks","issue_events_url":"https://api.github.com/repos/googleapis/sdk-platform-java/issues/events{/number}","events_url":"https://api.github.com/repos/googleapis/sdk-platform-java/events","assignees_url":"https://api.github.com/repos/googleapis/sdk-platform-java/assignees{/user}","branches_url":"https://api.github.com/repos/googleapis/sdk-platform-java/branches{/branch}","tags_url":"https://api.github.com/repos/googleapis/sdk-platform-java/tags","blobs_url":"https://api.github.com/repos/googleapis/sdk-platform-java/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/googleapis/sdk-platform-java/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/googleapis/sdk-platform-java/git/refs{/sha}","trees_url":"https://api.github.com/repos/googleapis/sdk-platform-java/git/trees{/sha}","statuses_url":"https://api.github.com/repos/googleapis/sdk-platform-java/statuses/{sha}","languages_url":"https://api.github.com/repos/googleapis/sdk-platform-java/languages","stargazers_url":"https://api.github.com/repos/googleapis/sdk-platform-java/stargazers","contributors_url":"https://api.github.com/repos/googleapis/sdk-platform-java/contributors","subscribers_url":"https://api.github.com/repos/googleapis/sdk-platform-java/subscribers","subscription_url":"https://api.github.com/repos/googleapis/sdk-platform-java/subscription","commits_url":"https://api.github.com/repos/googleapis/sdk-platform-java/commits{/sha}","git_commits_url":"https://api.github.com/repos/googleapis/sdk-platform-java/git/commits{/sha}","comments_url":"https://api.github.com/repos/googleapis/sdk-platform-java/comments{/number}","issue_comment_url":"https://api.github.com/repos/googleapis/sdk-platform-java/issues/comments{/number}","contents_url":"https://api.github.com/repos/googleapis/sdk-platform-java/contents/{+path}","compare_url":"https://api.github.com/repos/googleapis/sdk-platform-java/compare/{base}...{head}","merges_url":"https://api.github.com/repos/googleapis/sdk-platform-java/merges","archive_url":"https://api.github.com/repos/googleapis/sdk-platform-java/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/googleapis/sdk-platform-java/downloads","issues_url":"https://api.github.com/repos/googleapis/sdk-platform-java/issues{/number}","pulls_url":"https://api.github.com/repos/googleapis/sdk-platform-java/pulls{/number}","milestones_url":"https://api.github.com/repos/googleapis/sdk-platform-java/milestones{/number}","notifications_url":"https://api.github.com/repos/googleapis/sdk-platform-java/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/googleapis/sdk-platform-java/labels{/name}","releases_url":"https://api.github.com/repos/googleapis/sdk-platform-java/releases{/id}","deployments_url":"https://api.github.com/repos/googleapis/sdk-platform-java/deployments","created_at":"2020-05-14T18:15:25Z","updated_at":"2024-05-14T20:57:11Z","pushed_at":"2024-05-14T21:09:51Z","git_url":"git://github.com/googleapis/sdk-platform-java.git","ssh_url":"git@github.com:googleapis/sdk-platform-java.git","clone_url":"https://github.com/googleapis/sdk-platform-java.git","svn_url":"https://github.com/googleapis/sdk-platform-java","homepage":"https://cloud.google.com/java/docs/bom","size":40540,"stargazers_count":59,"watchers_count":59,"language":"Java","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"has_discussions":false,"forks_count":47,"mirror_url":null,"archived":false,"disabled":false,"open_issues_count":189,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"allow_forking":true,"is_template":false,"web_commit_signoff_required":false,"topics":[],"visibility":"public","forks":47,"open_issues":189,"watchers":59,"default_branch":"main"}},"_links":{"self":{"href":"https://api.github.com/repos/googleapis/sdk-platform-java/pulls/2767"},"html":{"href":"https://github.com/googleapis/sdk-platform-java/pull/2767"},"issue":{"href":"https://api.github.com/repos/googleapis/sdk-platform-java/issues/2767"},"comments":{"href":"https://api.github.com/repos/googleapis/sdk-platform-java/issues/2767/comments"},"review_comments":{"href":"https://api.github.com/repos/googleapis/sdk-platform-java/pulls/2767/comments"},"review_comment":{"href":"https://api.github.com/repos/googleapis/sdk-platform-java/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/googleapis/sdk-platform-java/pulls/2767/commits"},"statuses":{"href":"https://api.github.com/repos/googleapis/sdk-platform-java/statuses/3e5ff9a2c6975d83614c91b669840eb41eff8591"}},"author_association":"CONTRIBUTOR","auto_merge":null,"active_lock_reason":null},{"url":"https://api.github.com/repos/googleapis/sdk-platform-java/pulls/2766","id":1868945618,"node_id":"PR_kwDOD7wwCM5vZdjS","html_url":"https://github.com/googleapis/sdk-platform-java/pull/2766","diff_url":"https://github.com/googleapis/sdk-platform-java/pull/2766.diff","patch_url":"https://github.com/googleapis/sdk-platform-java/pull/2766.patch","issue_url":"https://api.github.com/repos/googleapis/sdk-platform-java/issues/2766","number":2766,"state":"closed","locked":false,"title":"deps: update dependency lxml to v5.2.2","user":{"login":"renovate-bot","id":25180681,"node_id":"MDQ6VXNlcjI1MTgwNjgx","avatar_url":"https://avatars.githubusercontent.com/u/25180681?v=4","gravatar_id":"","url":"https://api.github.com/users/renovate-bot","html_url":"https://github.com/renovate-bot","followers_url":"https://api.github.com/users/renovate-bot/followers","following_url":"https://api.github.com/users/renovate-bot/following{/other_user}","gists_url":"https://api.github.com/users/renovate-bot/gists{/gist_id}","starred_url":"https://api.github.com/users/renovate-bot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/renovate-bot/subscriptions","organizations_url":"https://api.github.com/users/renovate-bot/orgs","repos_url":"https://api.github.com/users/renovate-bot/repos","events_url":"https://api.github.com/users/renovate-bot/events{/privacy}","received_events_url":"https://api.github.com/users/renovate-bot/received_events","type":"User","site_admin":false},"body":"[![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)\n\nThis PR contains the following updates:\n\n| Package | Change | Age | Adoption | Passing | Confidence |\n|---|---|---|---|---|---|\n| [lxml](https://lxml.de/) ([source](https://togithub.com/lxml/lxml), [changelog](https://git.launchpad.net/lxml/plain/CHANGES.txt)) | `==5.2.1` -> `==5.2.2` | [![age](https://developer.mend.io/api/mc/badges/age/pypi/lxml/5.2.2?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://developer.mend.io/api/mc/badges/adoption/pypi/lxml/5.2.2?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://developer.mend.io/api/mc/badges/compatibility/pypi/lxml/5.2.1/5.2.2?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://developer.mend.io/api/mc/badges/confidence/pypi/lxml/5.2.1/5.2.2?slim=true)](https://docs.renovatebot.com/merge-confidence/) |\n\n---\n\n> [!WARNING]\n> Some dependencies could not be looked up. Check the Dependency Dashboard for more information.\n\n---\n\n### Release Notes\n\n
        \nlxml/lxml (lxml)\n\n### [`v5.2.2`](https://togithub.com/lxml/lxml/blob/HEAD/CHANGES.txt#522-2024--)\n\n[Compare Source](https://togithub.com/lxml/lxml/compare/lxml-5.2.1...lxml-5.2.2)\n\n\\==================\n\n## Bugs fixed\n\n- [GH#417](https://togithub.com/GH/lxml/issues/417): The `test_feed_parser` test could fail if `lxml_html_clean` was not installed.\n It is now skipped in that case.\n\n- [LP#2059910](https://togithub.com/LP/lxml/issues/2059910): The minimum CPU architecture for the Linux x86 binary wheels was set back to\n \"core2\", without SSE 4.2.\n\n- If libxml2 uses iconv, the compile time version is available as `etree.ICONV_COMPILED_VERSION`.\n\n
        \n\n---\n\n### Configuration\n\n📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).\n\n🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.\n\n♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.\n\n🔕 **Ignore**: Close this PR and you won't be reminded about this update again.\n\n---\n\n - [ ] If you want to rebase/retry this PR, check this box\n\n---\n\nThis PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://developer.mend.io/github/googleapis/sdk-platform-java).\n\n","created_at":"2024-05-14T13:04:09Z","updated_at":"2024-05-14T13:32:28Z","closed_at":"2024-05-14T13:31:00Z","merged_at":"2024-05-14T13:31:00Z","merge_commit_sha":"df7e211e534516f9596e230598b70fdbfdea1ac3","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":2307402262,"node_id":"MDU6TGFiZWwyMzA3NDAyMjYy","url":"https://api.github.com/repos/googleapis/sdk-platform-java/labels/kokoro:force-run","name":"kokoro:force-run","color":"C1FFB2","default":false,"description":"Add this label to force Kokoro to re-run the tests."},{"id":5133296390,"node_id":"LA_kwDOD7wwCM8AAAABMffjBg","url":"https://api.github.com/repos/googleapis/sdk-platform-java/labels/size:%20xs","name":"size: xs","color":"ae5816","default":false,"description":"Pull request size is extra small."}],"milestone":null,"draft":false,"commits_url":"https://api.github.com/repos/googleapis/sdk-platform-java/pulls/2766/commits","review_comments_url":"https://api.github.com/repos/googleapis/sdk-platform-java/pulls/2766/comments","review_comment_url":"https://api.github.com/repos/googleapis/sdk-platform-java/pulls/comments{/number}","comments_url":"https://api.github.com/repos/googleapis/sdk-platform-java/issues/2766/comments","statuses_url":"https://api.github.com/repos/googleapis/sdk-platform-java/statuses/c3275f72abbe839e2443a3c96abcea7aa8f993fb","head":{"label":"renovate-bot:renovate/lxml-5.x","ref":"renovate/lxml-5.x","sha":"c3275f72abbe839e2443a3c96abcea7aa8f993fb","user":{"login":"renovate-bot","id":25180681,"node_id":"MDQ6VXNlcjI1MTgwNjgx","avatar_url":"https://avatars.githubusercontent.com/u/25180681?v=4","gravatar_id":"","url":"https://api.github.com/users/renovate-bot","html_url":"https://github.com/renovate-bot","followers_url":"https://api.github.com/users/renovate-bot/followers","following_url":"https://api.github.com/users/renovate-bot/following{/other_user}","gists_url":"https://api.github.com/users/renovate-bot/gists{/gist_id}","starred_url":"https://api.github.com/users/renovate-bot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/renovate-bot/subscriptions","organizations_url":"https://api.github.com/users/renovate-bot/orgs","repos_url":"https://api.github.com/users/renovate-bot/repos","events_url":"https://api.github.com/users/renovate-bot/events{/privacy}","received_events_url":"https://api.github.com/users/renovate-bot/received_events","type":"User","site_admin":false},"repo":{"id":439311054,"node_id":"R_kgDOGi9azg","name":"gapic-generator-java","full_name":"renovate-bot/gapic-generator-java","private":false,"owner":{"login":"renovate-bot","id":25180681,"node_id":"MDQ6VXNlcjI1MTgwNjgx","avatar_url":"https://avatars.githubusercontent.com/u/25180681?v=4","gravatar_id":"","url":"https://api.github.com/users/renovate-bot","html_url":"https://github.com/renovate-bot","followers_url":"https://api.github.com/users/renovate-bot/followers","following_url":"https://api.github.com/users/renovate-bot/following{/other_user}","gists_url":"https://api.github.com/users/renovate-bot/gists{/gist_id}","starred_url":"https://api.github.com/users/renovate-bot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/renovate-bot/subscriptions","organizations_url":"https://api.github.com/users/renovate-bot/orgs","repos_url":"https://api.github.com/users/renovate-bot/repos","events_url":"https://api.github.com/users/renovate-bot/events{/privacy}","received_events_url":"https://api.github.com/users/renovate-bot/received_events","type":"User","site_admin":false},"html_url":"https://github.com/renovate-bot/gapic-generator-java","description":"Generates GAPIC Java client libraries from protobufs.","fork":true,"url":"https://api.github.com/repos/renovate-bot/gapic-generator-java","forks_url":"https://api.github.com/repos/renovate-bot/gapic-generator-java/forks","keys_url":"https://api.github.com/repos/renovate-bot/gapic-generator-java/keys{/key_id}","collaborators_url":"https://api.github.com/repos/renovate-bot/gapic-generator-java/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/renovate-bot/gapic-generator-java/teams","hooks_url":"https://api.github.com/repos/renovate-bot/gapic-generator-java/hooks","issue_events_url":"https://api.github.com/repos/renovate-bot/gapic-generator-java/issues/events{/number}","events_url":"https://api.github.com/repos/renovate-bot/gapic-generator-java/events","assignees_url":"https://api.github.com/repos/renovate-bot/gapic-generator-java/assignees{/user}","branches_url":"https://api.github.com/repos/renovate-bot/gapic-generator-java/branches{/branch}","tags_url":"https://api.github.com/repos/renovate-bot/gapic-generator-java/tags","blobs_url":"https://api.github.com/repos/renovate-bot/gapic-generator-java/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/renovate-bot/gapic-generator-java/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/renovate-bot/gapic-generator-java/git/refs{/sha}","trees_url":"https://api.github.com/repos/renovate-bot/gapic-generator-java/git/trees{/sha}","statuses_url":"https://api.github.com/repos/renovate-bot/gapic-generator-java/statuses/{sha}","languages_url":"https://api.github.com/repos/renovate-bot/gapic-generator-java/languages","stargazers_url":"https://api.github.com/repos/renovate-bot/gapic-generator-java/stargazers","contributors_url":"https://api.github.com/repos/renovate-bot/gapic-generator-java/contributors","subscribers_url":"https://api.github.com/repos/renovate-bot/gapic-generator-java/subscribers","subscription_url":"https://api.github.com/repos/renovate-bot/gapic-generator-java/subscription","commits_url":"https://api.github.com/repos/renovate-bot/gapic-generator-java/commits{/sha}","git_commits_url":"https://api.github.com/repos/renovate-bot/gapic-generator-java/git/commits{/sha}","comments_url":"https://api.github.com/repos/renovate-bot/gapic-generator-java/comments{/number}","issue_comment_url":"https://api.github.com/repos/renovate-bot/gapic-generator-java/issues/comments{/number}","contents_url":"https://api.github.com/repos/renovate-bot/gapic-generator-java/contents/{+path}","compare_url":"https://api.github.com/repos/renovate-bot/gapic-generator-java/compare/{base}...{head}","merges_url":"https://api.github.com/repos/renovate-bot/gapic-generator-java/merges","archive_url":"https://api.github.com/repos/renovate-bot/gapic-generator-java/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/renovate-bot/gapic-generator-java/downloads","issues_url":"https://api.github.com/repos/renovate-bot/gapic-generator-java/issues{/number}","pulls_url":"https://api.github.com/repos/renovate-bot/gapic-generator-java/pulls{/number}","milestones_url":"https://api.github.com/repos/renovate-bot/gapic-generator-java/milestones{/number}","notifications_url":"https://api.github.com/repos/renovate-bot/gapic-generator-java/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/renovate-bot/gapic-generator-java/labels{/name}","releases_url":"https://api.github.com/repos/renovate-bot/gapic-generator-java/releases{/id}","deployments_url":"https://api.github.com/repos/renovate-bot/gapic-generator-java/deployments","created_at":"2021-12-17T11:33:15Z","updated_at":"2024-05-14T20:57:21Z","pushed_at":"2024-05-14T20:58:34Z","git_url":"git://github.com/renovate-bot/gapic-generator-java.git","ssh_url":"git@github.com:renovate-bot/gapic-generator-java.git","clone_url":"https://github.com/renovate-bot/gapic-generator-java.git","svn_url":"https://github.com/renovate-bot/gapic-generator-java","homepage":"","size":31486,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"has_discussions":false,"forks_count":0,"mirror_url":null,"archived":false,"disabled":false,"open_issues_count":0,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"allow_forking":true,"is_template":false,"web_commit_signoff_required":false,"topics":[],"visibility":"public","forks":0,"open_issues":0,"watchers":0,"default_branch":"main"}},"base":{"label":"googleapis:main","ref":"main","sha":"d67eaf85c409dc7cf653dfb6d753d39a77292135","user":{"login":"googleapis","id":16785467,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE2Nzg1NDY3","avatar_url":"https://avatars.githubusercontent.com/u/16785467?v=4","gravatar_id":"","url":"https://api.github.com/users/googleapis","html_url":"https://github.com/googleapis","followers_url":"https://api.github.com/users/googleapis/followers","following_url":"https://api.github.com/users/googleapis/following{/other_user}","gists_url":"https://api.github.com/users/googleapis/gists{/gist_id}","starred_url":"https://api.github.com/users/googleapis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/googleapis/subscriptions","organizations_url":"https://api.github.com/users/googleapis/orgs","repos_url":"https://api.github.com/users/googleapis/repos","events_url":"https://api.github.com/users/googleapis/events{/privacy}","received_events_url":"https://api.github.com/users/googleapis/received_events","type":"Organization","site_admin":false},"repo":{"id":263991304,"node_id":"MDEwOlJlcG9zaXRvcnkyNjM5OTEzMDQ=","name":"sdk-platform-java","full_name":"googleapis/sdk-platform-java","private":false,"owner":{"login":"googleapis","id":16785467,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE2Nzg1NDY3","avatar_url":"https://avatars.githubusercontent.com/u/16785467?v=4","gravatar_id":"","url":"https://api.github.com/users/googleapis","html_url":"https://github.com/googleapis","followers_url":"https://api.github.com/users/googleapis/followers","following_url":"https://api.github.com/users/googleapis/following{/other_user}","gists_url":"https://api.github.com/users/googleapis/gists{/gist_id}","starred_url":"https://api.github.com/users/googleapis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/googleapis/subscriptions","organizations_url":"https://api.github.com/users/googleapis/orgs","repos_url":"https://api.github.com/users/googleapis/repos","events_url":"https://api.github.com/users/googleapis/events{/privacy}","received_events_url":"https://api.github.com/users/googleapis/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/googleapis/sdk-platform-java","description":"Tooling and shared libraries for Cloud SDK for Java","fork":false,"url":"https://api.github.com/repos/googleapis/sdk-platform-java","forks_url":"https://api.github.com/repos/googleapis/sdk-platform-java/forks","keys_url":"https://api.github.com/repos/googleapis/sdk-platform-java/keys{/key_id}","collaborators_url":"https://api.github.com/repos/googleapis/sdk-platform-java/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/googleapis/sdk-platform-java/teams","hooks_url":"https://api.github.com/repos/googleapis/sdk-platform-java/hooks","issue_events_url":"https://api.github.com/repos/googleapis/sdk-platform-java/issues/events{/number}","events_url":"https://api.github.com/repos/googleapis/sdk-platform-java/events","assignees_url":"https://api.github.com/repos/googleapis/sdk-platform-java/assignees{/user}","branches_url":"https://api.github.com/repos/googleapis/sdk-platform-java/branches{/branch}","tags_url":"https://api.github.com/repos/googleapis/sdk-platform-java/tags","blobs_url":"https://api.github.com/repos/googleapis/sdk-platform-java/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/googleapis/sdk-platform-java/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/googleapis/sdk-platform-java/git/refs{/sha}","trees_url":"https://api.github.com/repos/googleapis/sdk-platform-java/git/trees{/sha}","statuses_url":"https://api.github.com/repos/googleapis/sdk-platform-java/statuses/{sha}","languages_url":"https://api.github.com/repos/googleapis/sdk-platform-java/languages","stargazers_url":"https://api.github.com/repos/googleapis/sdk-platform-java/stargazers","contributors_url":"https://api.github.com/repos/googleapis/sdk-platform-java/contributors","subscribers_url":"https://api.github.com/repos/googleapis/sdk-platform-java/subscribers","subscription_url":"https://api.github.com/repos/googleapis/sdk-platform-java/subscription","commits_url":"https://api.github.com/repos/googleapis/sdk-platform-java/commits{/sha}","git_commits_url":"https://api.github.com/repos/googleapis/sdk-platform-java/git/commits{/sha}","comments_url":"https://api.github.com/repos/googleapis/sdk-platform-java/comments{/number}","issue_comment_url":"https://api.github.com/repos/googleapis/sdk-platform-java/issues/comments{/number}","contents_url":"https://api.github.com/repos/googleapis/sdk-platform-java/contents/{+path}","compare_url":"https://api.github.com/repos/googleapis/sdk-platform-java/compare/{base}...{head}","merges_url":"https://api.github.com/repos/googleapis/sdk-platform-java/merges","archive_url":"https://api.github.com/repos/googleapis/sdk-platform-java/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/googleapis/sdk-platform-java/downloads","issues_url":"https://api.github.com/repos/googleapis/sdk-platform-java/issues{/number}","pulls_url":"https://api.github.com/repos/googleapis/sdk-platform-java/pulls{/number}","milestones_url":"https://api.github.com/repos/googleapis/sdk-platform-java/milestones{/number}","notifications_url":"https://api.github.com/repos/googleapis/sdk-platform-java/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/googleapis/sdk-platform-java/labels{/name}","releases_url":"https://api.github.com/repos/googleapis/sdk-platform-java/releases{/id}","deployments_url":"https://api.github.com/repos/googleapis/sdk-platform-java/deployments","created_at":"2020-05-14T18:15:25Z","updated_at":"2024-05-14T20:57:11Z","pushed_at":"2024-05-14T21:09:51Z","git_url":"git://github.com/googleapis/sdk-platform-java.git","ssh_url":"git@github.com:googleapis/sdk-platform-java.git","clone_url":"https://github.com/googleapis/sdk-platform-java.git","svn_url":"https://github.com/googleapis/sdk-platform-java","homepage":"https://cloud.google.com/java/docs/bom","size":40540,"stargazers_count":59,"watchers_count":59,"language":"Java","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"has_discussions":false,"forks_count":47,"mirror_url":null,"archived":false,"disabled":false,"open_issues_count":189,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"allow_forking":true,"is_template":false,"web_commit_signoff_required":false,"topics":[],"visibility":"public","forks":47,"open_issues":189,"watchers":59,"default_branch":"main"}},"_links":{"self":{"href":"https://api.github.com/repos/googleapis/sdk-platform-java/pulls/2766"},"html":{"href":"https://github.com/googleapis/sdk-platform-java/pull/2766"},"issue":{"href":"https://api.github.com/repos/googleapis/sdk-platform-java/issues/2766"},"comments":{"href":"https://api.github.com/repos/googleapis/sdk-platform-java/issues/2766/comments"},"review_comments":{"href":"https://api.github.com/repos/googleapis/sdk-platform-java/pulls/2766/comments"},"review_comment":{"href":"https://api.github.com/repos/googleapis/sdk-platform-java/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/googleapis/sdk-platform-java/pulls/2766/commits"},"statuses":{"href":"https://api.github.com/repos/googleapis/sdk-platform-java/statuses/c3275f72abbe839e2443a3c96abcea7aa8f993fb"}},"author_association":"CONTRIBUTOR","auto_merge":{"enabled_by":{"login":"JoeWang1127","id":106995533,"node_id":"U_kgDOBmCfTQ","avatar_url":"https://avatars.githubusercontent.com/u/106995533?v=4","gravatar_id":"","url":"https://api.github.com/users/JoeWang1127","html_url":"https://github.com/JoeWang1127","followers_url":"https://api.github.com/users/JoeWang1127/followers","following_url":"https://api.github.com/users/JoeWang1127/following{/other_user}","gists_url":"https://api.github.com/users/JoeWang1127/gists{/gist_id}","starred_url":"https://api.github.com/users/JoeWang1127/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JoeWang1127/subscriptions","organizations_url":"https://api.github.com/users/JoeWang1127/orgs","repos_url":"https://api.github.com/users/JoeWang1127/repos","events_url":"https://api.github.com/users/JoeWang1127/events{/privacy}","received_events_url":"https://api.github.com/users/JoeWang1127/received_events","type":"User","site_admin":false},"merge_method":"squash","commit_title":"deps: update dependency lxml to v5.2.2 (#2766)","commit_message":"[![Mend\r\nRenovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)\r\n\r\nThis PR contains the following updates:\r\n\r\n| Package | Change | Age | Adoption | Passing | Confidence |\r\n|---|---|---|---|---|---|\r\n| [lxml](https://lxml.de/) ([source](https://togithub.com/lxml/lxml),\r\n[changelog](https://git.launchpad.net/lxml/plain/CHANGES.txt)) |\r\n`==5.2.1` -> `==5.2.2` |\r\n[![age](https://developer.mend.io/api/mc/badges/age/pypi/lxml/5.2.2?slim=true)](https://docs.renovatebot.com/merge-confidence/)\r\n|\r\n[![adoption](https://developer.mend.io/api/mc/badges/adoption/pypi/lxml/5.2.2?slim=true)](https://docs.renovatebot.com/merge-confidence/)\r\n|\r\n[![passing](https://developer.mend.io/api/mc/badges/compatibility/pypi/lxml/5.2.1/5.2.2?slim=true)](https://docs.renovatebot.com/merge-confidence/)\r\n|\r\n[![confidence](https://developer.mend.io/api/mc/badges/confidence/pypi/lxml/5.2.1/5.2.2?slim=true)](https://docs.renovatebot.com/merge-confidence/)\r\n|\r\n\r\n---\r\n\r\n> [!WARNING]\r\n> Some dependencies could not be looked up. Check the Dependency\r\nDashboard for more information.\r\n\r\n---\r\n\r\n### Release Notes\r\n\r\n
        \r\nlxml/lxml (lxml)\r\n\r\n###\r\n[`v5.2.2`](https://togithub.com/lxml/lxml/blob/HEAD/CHANGES.txt#522-2024--)\r\n\r\n[Compare\r\nSource](https://togithub.com/lxml/lxml/compare/lxml-5.2.1...lxml-5.2.2)\r\n\r\n\\==================\r\n\r\n## Bugs fixed\r\n\r\n- [GH#417](https://togithub.com/GH/lxml/issues/417): The\r\n`test_feed_parser` test could fail if `lxml_html_clean` was not\r\ninstalled.\r\n It is now skipped in that case.\r\n\r\n- [LP#2059910](https://togithub.com/LP/lxml/issues/2059910): The minimum\r\nCPU architecture for the Linux x86 binary wheels was set back to\r\n \"core2\", without SSE 4.2.\r\n\r\n- If libxml2 uses iconv, the compile time version is available as\r\n`etree.ICONV_COMPILED_VERSION`.\r\n\r\n
        \r\n\r\n---\r\n\r\n### Configuration\r\n\r\n📅 **Schedule**: Branch creation - At any time (no schedule defined),\r\nAutomerge - At any time (no schedule defined).\r\n\r\n🚦 **Automerge**: Disabled by config. Please merge this manually once you\r\nare satisfied.\r\n\r\n♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the\r\nrebase/retry checkbox.\r\n\r\n🔕 **Ignore**: Close this PR and you won't be reminded about this update\r\nagain.\r\n\r\n---\r\n\r\n- [ ] If you want to rebase/retry this PR, check\r\nthis box\r\n\r\n---\r\n\r\nThis PR has been generated by [Mend\r\nRenovate](https://www.mend.io/free-developer-tools/renovate/). View\r\nrepository job log\r\n[here](https://developer.mend.io/github/googleapis/sdk-platform-java).\r\n\r\n"},"active_lock_reason":null},{"url":"https://api.github.com/repos/googleapis/sdk-platform-java/pulls/2765","id":1865466886,"node_id":"PR_kwDOD7wwCM5vMMQG","html_url":"https://github.com/googleapis/sdk-platform-java/pull/2765","diff_url":"https://github.com/googleapis/sdk-platform-java/pull/2765.diff","patch_url":"https://github.com/googleapis/sdk-platform-java/pull/2765.patch","issue_url":"https://api.github.com/repos/googleapis/sdk-platform-java/issues/2765","number":2765,"state":"open","locked":false,"title":"chore: centralize hermetic build workflow implementations","user":{"login":"diegomarquezp","id":22083784,"node_id":"MDQ6VXNlcjIyMDgzNzg0","avatar_url":"https://avatars.githubusercontent.com/u/22083784?v=4","gravatar_id":"","url":"https://api.github.com/users/diegomarquezp","html_url":"https://github.com/diegomarquezp","followers_url":"https://api.github.com/users/diegomarquezp/followers","following_url":"https://api.github.com/users/diegomarquezp/following{/other_user}","gists_url":"https://api.github.com/users/diegomarquezp/gists{/gist_id}","starred_url":"https://api.github.com/users/diegomarquezp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/diegomarquezp/subscriptions","organizations_url":"https://api.github.com/users/diegomarquezp/orgs","repos_url":"https://api.github.com/users/diegomarquezp/repos","events_url":"https://api.github.com/users/diegomarquezp/events{/privacy}","received_events_url":"https://api.github.com/users/diegomarquezp/received_events","type":"User","site_admin":false},"body":"This PR transfers the workflows and their implementations involved in hermetic library generation (i.e. `update_googleapis_committish.yaml` and `hermetic_library_generation.yaml`).\r\n\r\nThe purpose is to simplify the hermetic build setup requirements in HW libraries and google-cloud-java to simply declare two workflows that will delegate all the logic to the workflows and their corresponding scripts stored in sdk-platform-java. \r\n\r\n### Follow ups:\r\n - In google-cloud-java, remove `generation/update_googleapis_commit.sh` and `hermetic_library_generation.sh`, plus the workflows that use them.","created_at":"2024-05-12T23:06:41Z","updated_at":"2024-05-13T00:38:50Z","closed_at":null,"merged_at":null,"merge_commit_sha":"7e766e435c1f6db3c165f22322e93d67fb3923c5","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":5132010215,"node_id":"LA_kwDOD7wwCM8AAAABMeRC5w","url":"https://api.github.com/repos/googleapis/sdk-platform-java/labels/size:%20l","name":"size: l","color":"1d0ef7","default":false,"description":"Pull request size is large."}],"milestone":null,"draft":true,"commits_url":"https://api.github.com/repos/googleapis/sdk-platform-java/pulls/2765/commits","review_comments_url":"https://api.github.com/repos/googleapis/sdk-platform-java/pulls/2765/comments","review_comment_url":"https://api.github.com/repos/googleapis/sdk-platform-java/pulls/comments{/number}","comments_url":"https://api.github.com/repos/googleapis/sdk-platform-java/issues/2765/comments","statuses_url":"https://api.github.com/repos/googleapis/sdk-platform-java/statuses/95a9cd3e60f9fdc9c4dfdbed13c7006bbaa2a8b1","head":{"label":"googleapis:centralized-hermetic-workflows","ref":"centralized-hermetic-workflows","sha":"95a9cd3e60f9fdc9c4dfdbed13c7006bbaa2a8b1","user":{"login":"googleapis","id":16785467,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE2Nzg1NDY3","avatar_url":"https://avatars.githubusercontent.com/u/16785467?v=4","gravatar_id":"","url":"https://api.github.com/users/googleapis","html_url":"https://github.com/googleapis","followers_url":"https://api.github.com/users/googleapis/followers","following_url":"https://api.github.com/users/googleapis/following{/other_user}","gists_url":"https://api.github.com/users/googleapis/gists{/gist_id}","starred_url":"https://api.github.com/users/googleapis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/googleapis/subscriptions","organizations_url":"https://api.github.com/users/googleapis/orgs","repos_url":"https://api.github.com/users/googleapis/repos","events_url":"https://api.github.com/users/googleapis/events{/privacy}","received_events_url":"https://api.github.com/users/googleapis/received_events","type":"Organization","site_admin":false},"repo":{"id":263991304,"node_id":"MDEwOlJlcG9zaXRvcnkyNjM5OTEzMDQ=","name":"sdk-platform-java","full_name":"googleapis/sdk-platform-java","private":false,"owner":{"login":"googleapis","id":16785467,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE2Nzg1NDY3","avatar_url":"https://avatars.githubusercontent.com/u/16785467?v=4","gravatar_id":"","url":"https://api.github.com/users/googleapis","html_url":"https://github.com/googleapis","followers_url":"https://api.github.com/users/googleapis/followers","following_url":"https://api.github.com/users/googleapis/following{/other_user}","gists_url":"https://api.github.com/users/googleapis/gists{/gist_id}","starred_url":"https://api.github.com/users/googleapis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/googleapis/subscriptions","organizations_url":"https://api.github.com/users/googleapis/orgs","repos_url":"https://api.github.com/users/googleapis/repos","events_url":"https://api.github.com/users/googleapis/events{/privacy}","received_events_url":"https://api.github.com/users/googleapis/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/googleapis/sdk-platform-java","description":"Tooling and shared libraries for Cloud SDK for Java","fork":false,"url":"https://api.github.com/repos/googleapis/sdk-platform-java","forks_url":"https://api.github.com/repos/googleapis/sdk-platform-java/forks","keys_url":"https://api.github.com/repos/googleapis/sdk-platform-java/keys{/key_id}","collaborators_url":"https://api.github.com/repos/googleapis/sdk-platform-java/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/googleapis/sdk-platform-java/teams","hooks_url":"https://api.github.com/repos/googleapis/sdk-platform-java/hooks","issue_events_url":"https://api.github.com/repos/googleapis/sdk-platform-java/issues/events{/number}","events_url":"https://api.github.com/repos/googleapis/sdk-platform-java/events","assignees_url":"https://api.github.com/repos/googleapis/sdk-platform-java/assignees{/user}","branches_url":"https://api.github.com/repos/googleapis/sdk-platform-java/branches{/branch}","tags_url":"https://api.github.com/repos/googleapis/sdk-platform-java/tags","blobs_url":"https://api.github.com/repos/googleapis/sdk-platform-java/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/googleapis/sdk-platform-java/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/googleapis/sdk-platform-java/git/refs{/sha}","trees_url":"https://api.github.com/repos/googleapis/sdk-platform-java/git/trees{/sha}","statuses_url":"https://api.github.com/repos/googleapis/sdk-platform-java/statuses/{sha}","languages_url":"https://api.github.com/repos/googleapis/sdk-platform-java/languages","stargazers_url":"https://api.github.com/repos/googleapis/sdk-platform-java/stargazers","contributors_url":"https://api.github.com/repos/googleapis/sdk-platform-java/contributors","subscribers_url":"https://api.github.com/repos/googleapis/sdk-platform-java/subscribers","subscription_url":"https://api.github.com/repos/googleapis/sdk-platform-java/subscription","commits_url":"https://api.github.com/repos/googleapis/sdk-platform-java/commits{/sha}","git_commits_url":"https://api.github.com/repos/googleapis/sdk-platform-java/git/commits{/sha}","comments_url":"https://api.github.com/repos/googleapis/sdk-platform-java/comments{/number}","issue_comment_url":"https://api.github.com/repos/googleapis/sdk-platform-java/issues/comments{/number}","contents_url":"https://api.github.com/repos/googleapis/sdk-platform-java/contents/{+path}","compare_url":"https://api.github.com/repos/googleapis/sdk-platform-java/compare/{base}...{head}","merges_url":"https://api.github.com/repos/googleapis/sdk-platform-java/merges","archive_url":"https://api.github.com/repos/googleapis/sdk-platform-java/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/googleapis/sdk-platform-java/downloads","issues_url":"https://api.github.com/repos/googleapis/sdk-platform-java/issues{/number}","pulls_url":"https://api.github.com/repos/googleapis/sdk-platform-java/pulls{/number}","milestones_url":"https://api.github.com/repos/googleapis/sdk-platform-java/milestones{/number}","notifications_url":"https://api.github.com/repos/googleapis/sdk-platform-java/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/googleapis/sdk-platform-java/labels{/name}","releases_url":"https://api.github.com/repos/googleapis/sdk-platform-java/releases{/id}","deployments_url":"https://api.github.com/repos/googleapis/sdk-platform-java/deployments","created_at":"2020-05-14T18:15:25Z","updated_at":"2024-05-14T20:57:11Z","pushed_at":"2024-05-14T21:09:51Z","git_url":"git://github.com/googleapis/sdk-platform-java.git","ssh_url":"git@github.com:googleapis/sdk-platform-java.git","clone_url":"https://github.com/googleapis/sdk-platform-java.git","svn_url":"https://github.com/googleapis/sdk-platform-java","homepage":"https://cloud.google.com/java/docs/bom","size":40540,"stargazers_count":59,"watchers_count":59,"language":"Java","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"has_discussions":false,"forks_count":47,"mirror_url":null,"archived":false,"disabled":false,"open_issues_count":189,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"allow_forking":true,"is_template":false,"web_commit_signoff_required":false,"topics":[],"visibility":"public","forks":47,"open_issues":189,"watchers":59,"default_branch":"main"}},"base":{"label":"googleapis:main","ref":"main","sha":"e1e1fb66d95adc08baea71c5a0607c20d5a57a8b","user":{"login":"googleapis","id":16785467,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE2Nzg1NDY3","avatar_url":"https://avatars.githubusercontent.com/u/16785467?v=4","gravatar_id":"","url":"https://api.github.com/users/googleapis","html_url":"https://github.com/googleapis","followers_url":"https://api.github.com/users/googleapis/followers","following_url":"https://api.github.com/users/googleapis/following{/other_user}","gists_url":"https://api.github.com/users/googleapis/gists{/gist_id}","starred_url":"https://api.github.com/users/googleapis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/googleapis/subscriptions","organizations_url":"https://api.github.com/users/googleapis/orgs","repos_url":"https://api.github.com/users/googleapis/repos","events_url":"https://api.github.com/users/googleapis/events{/privacy}","received_events_url":"https://api.github.com/users/googleapis/received_events","type":"Organization","site_admin":false},"repo":{"id":263991304,"node_id":"MDEwOlJlcG9zaXRvcnkyNjM5OTEzMDQ=","name":"sdk-platform-java","full_name":"googleapis/sdk-platform-java","private":false,"owner":{"login":"googleapis","id":16785467,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE2Nzg1NDY3","avatar_url":"https://avatars.githubusercontent.com/u/16785467?v=4","gravatar_id":"","url":"https://api.github.com/users/googleapis","html_url":"https://github.com/googleapis","followers_url":"https://api.github.com/users/googleapis/followers","following_url":"https://api.github.com/users/googleapis/following{/other_user}","gists_url":"https://api.github.com/users/googleapis/gists{/gist_id}","starred_url":"https://api.github.com/users/googleapis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/googleapis/subscriptions","organizations_url":"https://api.github.com/users/googleapis/orgs","repos_url":"https://api.github.com/users/googleapis/repos","events_url":"https://api.github.com/users/googleapis/events{/privacy}","received_events_url":"https://api.github.com/users/googleapis/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/googleapis/sdk-platform-java","description":"Tooling and shared libraries for Cloud SDK for Java","fork":false,"url":"https://api.github.com/repos/googleapis/sdk-platform-java","forks_url":"https://api.github.com/repos/googleapis/sdk-platform-java/forks","keys_url":"https://api.github.com/repos/googleapis/sdk-platform-java/keys{/key_id}","collaborators_url":"https://api.github.com/repos/googleapis/sdk-platform-java/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/googleapis/sdk-platform-java/teams","hooks_url":"https://api.github.com/repos/googleapis/sdk-platform-java/hooks","issue_events_url":"https://api.github.com/repos/googleapis/sdk-platform-java/issues/events{/number}","events_url":"https://api.github.com/repos/googleapis/sdk-platform-java/events","assignees_url":"https://api.github.com/repos/googleapis/sdk-platform-java/assignees{/user}","branches_url":"https://api.github.com/repos/googleapis/sdk-platform-java/branches{/branch}","tags_url":"https://api.github.com/repos/googleapis/sdk-platform-java/tags","blobs_url":"https://api.github.com/repos/googleapis/sdk-platform-java/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/googleapis/sdk-platform-java/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/googleapis/sdk-platform-java/git/refs{/sha}","trees_url":"https://api.github.com/repos/googleapis/sdk-platform-java/git/trees{/sha}","statuses_url":"https://api.github.com/repos/googleapis/sdk-platform-java/statuses/{sha}","languages_url":"https://api.github.com/repos/googleapis/sdk-platform-java/languages","stargazers_url":"https://api.github.com/repos/googleapis/sdk-platform-java/stargazers","contributors_url":"https://api.github.com/repos/googleapis/sdk-platform-java/contributors","subscribers_url":"https://api.github.com/repos/googleapis/sdk-platform-java/subscribers","subscription_url":"https://api.github.com/repos/googleapis/sdk-platform-java/subscription","commits_url":"https://api.github.com/repos/googleapis/sdk-platform-java/commits{/sha}","git_commits_url":"https://api.github.com/repos/googleapis/sdk-platform-java/git/commits{/sha}","comments_url":"https://api.github.com/repos/googleapis/sdk-platform-java/comments{/number}","issue_comment_url":"https://api.github.com/repos/googleapis/sdk-platform-java/issues/comments{/number}","contents_url":"https://api.github.com/repos/googleapis/sdk-platform-java/contents/{+path}","compare_url":"https://api.github.com/repos/googleapis/sdk-platform-java/compare/{base}...{head}","merges_url":"https://api.github.com/repos/googleapis/sdk-platform-java/merges","archive_url":"https://api.github.com/repos/googleapis/sdk-platform-java/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/googleapis/sdk-platform-java/downloads","issues_url":"https://api.github.com/repos/googleapis/sdk-platform-java/issues{/number}","pulls_url":"https://api.github.com/repos/googleapis/sdk-platform-java/pulls{/number}","milestones_url":"https://api.github.com/repos/googleapis/sdk-platform-java/milestones{/number}","notifications_url":"https://api.github.com/repos/googleapis/sdk-platform-java/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/googleapis/sdk-platform-java/labels{/name}","releases_url":"https://api.github.com/repos/googleapis/sdk-platform-java/releases{/id}","deployments_url":"https://api.github.com/repos/googleapis/sdk-platform-java/deployments","created_at":"2020-05-14T18:15:25Z","updated_at":"2024-05-14T20:57:11Z","pushed_at":"2024-05-14T21:09:51Z","git_url":"git://github.com/googleapis/sdk-platform-java.git","ssh_url":"git@github.com:googleapis/sdk-platform-java.git","clone_url":"https://github.com/googleapis/sdk-platform-java.git","svn_url":"https://github.com/googleapis/sdk-platform-java","homepage":"https://cloud.google.com/java/docs/bom","size":40540,"stargazers_count":59,"watchers_count":59,"language":"Java","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"has_discussions":false,"forks_count":47,"mirror_url":null,"archived":false,"disabled":false,"open_issues_count":189,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"allow_forking":true,"is_template":false,"web_commit_signoff_required":false,"topics":[],"visibility":"public","forks":47,"open_issues":189,"watchers":59,"default_branch":"main"}},"_links":{"self":{"href":"https://api.github.com/repos/googleapis/sdk-platform-java/pulls/2765"},"html":{"href":"https://github.com/googleapis/sdk-platform-java/pull/2765"},"issue":{"href":"https://api.github.com/repos/googleapis/sdk-platform-java/issues/2765"},"comments":{"href":"https://api.github.com/repos/googleapis/sdk-platform-java/issues/2765/comments"},"review_comments":{"href":"https://api.github.com/repos/googleapis/sdk-platform-java/pulls/2765/comments"},"review_comment":{"href":"https://api.github.com/repos/googleapis/sdk-platform-java/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/googleapis/sdk-platform-java/pulls/2765/commits"},"statuses":{"href":"https://api.github.com/repos/googleapis/sdk-platform-java/statuses/95a9cd3e60f9fdc9c4dfdbed13c7006bbaa2a8b1"}},"author_association":"CONTRIBUTOR","auto_merge":null,"active_lock_reason":null},{"url":"https://api.github.com/repos/googleapis/sdk-platform-java/pulls/2764","id":1864782648,"node_id":"PR_kwDOD7wwCM5vJlM4","html_url":"https://github.com/googleapis/sdk-platform-java/pull/2764","diff_url":"https://github.com/googleapis/sdk-platform-java/pull/2764.diff","patch_url":"https://github.com/googleapis/sdk-platform-java/pull/2764.patch","issue_url":"https://api.github.com/repos/googleapis/sdk-platform-java/issues/2764","number":2764,"state":"open","locked":false,"title":"fix: Replace deprecated protobuf methods.","user":{"login":"blakeli0","id":3975769,"node_id":"MDQ6VXNlcjM5NzU3Njk=","avatar_url":"https://avatars.githubusercontent.com/u/3975769?v=4","gravatar_id":"","url":"https://api.github.com/users/blakeli0","html_url":"https://github.com/blakeli0","followers_url":"https://api.github.com/users/blakeli0/followers","following_url":"https://api.github.com/users/blakeli0/following{/other_user}","gists_url":"https://api.github.com/users/blakeli0/gists{/gist_id}","starred_url":"https://api.github.com/users/blakeli0/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/blakeli0/subscriptions","organizations_url":"https://api.github.com/users/blakeli0/orgs","repos_url":"https://api.github.com/users/blakeli0/repos","events_url":"https://api.github.com/users/blakeli0/events{/privacy}","received_events_url":"https://api.github.com/users/blakeli0/received_events","type":"User","site_admin":false},"body":"`isSynthetic()` is deprecated and will be [removed](https://github.com/protocolbuffers/protobuf/commit/1aeacd4f4eb4e0aa05d6336e2988a565e475e9a0#diff-2228551d02c6661809ca7103db9512eef4c2d01f35556d42316543d92a89edefL2846-L2847) in protobuf-java 4.26.0, replace it so that we can prepare for protobuf-java upgrade.\r\n\r\nPer [official doc](https://github.com/protocolbuffers/protobuf/blob/main/docs/implementing_proto3_presence.md) of protobuf. See b/266950618#comment123 for suggested replacements of `isSynthetic()`.","created_at":"2024-05-11T06:01:40Z","updated_at":"2024-05-14T21:17:06Z","closed_at":null,"merged_at":null,"merge_commit_sha":"75927728d5154dd597511184a0b0d801aa00624d","assignee":null,"assignees":[],"requested_reviewers":[{"login":"suztomo","id":28604,"node_id":"MDQ6VXNlcjI4NjA0","avatar_url":"https://avatars.githubusercontent.com/u/28604?v=4","gravatar_id":"","url":"https://api.github.com/users/suztomo","html_url":"https://github.com/suztomo","followers_url":"https://api.github.com/users/suztomo/followers","following_url":"https://api.github.com/users/suztomo/following{/other_user}","gists_url":"https://api.github.com/users/suztomo/gists{/gist_id}","starred_url":"https://api.github.com/users/suztomo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/suztomo/subscriptions","organizations_url":"https://api.github.com/users/suztomo/orgs","repos_url":"https://api.github.com/users/suztomo/repos","events_url":"https://api.github.com/users/suztomo/events{/privacy}","received_events_url":"https://api.github.com/users/suztomo/received_events","type":"User","site_admin":false},{"login":"lqiu96","id":6621793,"node_id":"MDQ6VXNlcjY2MjE3OTM=","avatar_url":"https://avatars.githubusercontent.com/u/6621793?v=4","gravatar_id":"","url":"https://api.github.com/users/lqiu96","html_url":"https://github.com/lqiu96","followers_url":"https://api.github.com/users/lqiu96/followers","following_url":"https://api.github.com/users/lqiu96/following{/other_user}","gists_url":"https://api.github.com/users/lqiu96/gists{/gist_id}","starred_url":"https://api.github.com/users/lqiu96/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lqiu96/subscriptions","organizations_url":"https://api.github.com/users/lqiu96/orgs","repos_url":"https://api.github.com/users/lqiu96/repos","events_url":"https://api.github.com/users/lqiu96/events{/privacy}","received_events_url":"https://api.github.com/users/lqiu96/received_events","type":"User","site_admin":false}],"requested_teams":[{"name":"cloud-java-team-teamsync","id":5195423,"node_id":"T_kwDOAQAgO84AT0af","slug":"cloud-java-team-teamsync","description":"TeamSync managed team","privacy":"closed","notification_setting":"notifications_enabled","url":"https://api.github.com/organizations/16785467/team/5195423","html_url":"https://github.com/orgs/googleapis/teams/cloud-java-team-teamsync","members_url":"https://api.github.com/organizations/16785467/team/5195423/members{/member}","repositories_url":"https://api.github.com/organizations/16785467/team/5195423/repos","permission":"pull","parent":null}],"labels":[{"id":5133296390,"node_id":"LA_kwDOD7wwCM8AAAABMffjBg","url":"https://api.github.com/repos/googleapis/sdk-platform-java/labels/size:%20xs","name":"size: xs","color":"ae5816","default":false,"description":"Pull request size is extra small."}],"milestone":null,"draft":false,"commits_url":"https://api.github.com/repos/googleapis/sdk-platform-java/pulls/2764/commits","review_comments_url":"https://api.github.com/repos/googleapis/sdk-platform-java/pulls/2764/comments","review_comment_url":"https://api.github.com/repos/googleapis/sdk-platform-java/pulls/comments{/number}","comments_url":"https://api.github.com/repos/googleapis/sdk-platform-java/issues/2764/comments","statuses_url":"https://api.github.com/repos/googleapis/sdk-platform-java/statuses/28b1139f428096392ab3aac15ddd2b512dd37c06","head":{"label":"googleapis:fix-deprecated-proto-methods","ref":"fix-deprecated-proto-methods","sha":"28b1139f428096392ab3aac15ddd2b512dd37c06","user":{"login":"googleapis","id":16785467,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE2Nzg1NDY3","avatar_url":"https://avatars.githubusercontent.com/u/16785467?v=4","gravatar_id":"","url":"https://api.github.com/users/googleapis","html_url":"https://github.com/googleapis","followers_url":"https://api.github.com/users/googleapis/followers","following_url":"https://api.github.com/users/googleapis/following{/other_user}","gists_url":"https://api.github.com/users/googleapis/gists{/gist_id}","starred_url":"https://api.github.com/users/googleapis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/googleapis/subscriptions","organizations_url":"https://api.github.com/users/googleapis/orgs","repos_url":"https://api.github.com/users/googleapis/repos","events_url":"https://api.github.com/users/googleapis/events{/privacy}","received_events_url":"https://api.github.com/users/googleapis/received_events","type":"Organization","site_admin":false},"repo":{"id":263991304,"node_id":"MDEwOlJlcG9zaXRvcnkyNjM5OTEzMDQ=","name":"sdk-platform-java","full_name":"googleapis/sdk-platform-java","private":false,"owner":{"login":"googleapis","id":16785467,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE2Nzg1NDY3","avatar_url":"https://avatars.githubusercontent.com/u/16785467?v=4","gravatar_id":"","url":"https://api.github.com/users/googleapis","html_url":"https://github.com/googleapis","followers_url":"https://api.github.com/users/googleapis/followers","following_url":"https://api.github.com/users/googleapis/following{/other_user}","gists_url":"https://api.github.com/users/googleapis/gists{/gist_id}","starred_url":"https://api.github.com/users/googleapis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/googleapis/subscriptions","organizations_url":"https://api.github.com/users/googleapis/orgs","repos_url":"https://api.github.com/users/googleapis/repos","events_url":"https://api.github.com/users/googleapis/events{/privacy}","received_events_url":"https://api.github.com/users/googleapis/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/googleapis/sdk-platform-java","description":"Tooling and shared libraries for Cloud SDK for Java","fork":false,"url":"https://api.github.com/repos/googleapis/sdk-platform-java","forks_url":"https://api.github.com/repos/googleapis/sdk-platform-java/forks","keys_url":"https://api.github.com/repos/googleapis/sdk-platform-java/keys{/key_id}","collaborators_url":"https://api.github.com/repos/googleapis/sdk-platform-java/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/googleapis/sdk-platform-java/teams","hooks_url":"https://api.github.com/repos/googleapis/sdk-platform-java/hooks","issue_events_url":"https://api.github.com/repos/googleapis/sdk-platform-java/issues/events{/number}","events_url":"https://api.github.com/repos/googleapis/sdk-platform-java/events","assignees_url":"https://api.github.com/repos/googleapis/sdk-platform-java/assignees{/user}","branches_url":"https://api.github.com/repos/googleapis/sdk-platform-java/branches{/branch}","tags_url":"https://api.github.com/repos/googleapis/sdk-platform-java/tags","blobs_url":"https://api.github.com/repos/googleapis/sdk-platform-java/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/googleapis/sdk-platform-java/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/googleapis/sdk-platform-java/git/refs{/sha}","trees_url":"https://api.github.com/repos/googleapis/sdk-platform-java/git/trees{/sha}","statuses_url":"https://api.github.com/repos/googleapis/sdk-platform-java/statuses/{sha}","languages_url":"https://api.github.com/repos/googleapis/sdk-platform-java/languages","stargazers_url":"https://api.github.com/repos/googleapis/sdk-platform-java/stargazers","contributors_url":"https://api.github.com/repos/googleapis/sdk-platform-java/contributors","subscribers_url":"https://api.github.com/repos/googleapis/sdk-platform-java/subscribers","subscription_url":"https://api.github.com/repos/googleapis/sdk-platform-java/subscription","commits_url":"https://api.github.com/repos/googleapis/sdk-platform-java/commits{/sha}","git_commits_url":"https://api.github.com/repos/googleapis/sdk-platform-java/git/commits{/sha}","comments_url":"https://api.github.com/repos/googleapis/sdk-platform-java/comments{/number}","issue_comment_url":"https://api.github.com/repos/googleapis/sdk-platform-java/issues/comments{/number}","contents_url":"https://api.github.com/repos/googleapis/sdk-platform-java/contents/{+path}","compare_url":"https://api.github.com/repos/googleapis/sdk-platform-java/compare/{base}...{head}","merges_url":"https://api.github.com/repos/googleapis/sdk-platform-java/merges","archive_url":"https://api.github.com/repos/googleapis/sdk-platform-java/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/googleapis/sdk-platform-java/downloads","issues_url":"https://api.github.com/repos/googleapis/sdk-platform-java/issues{/number}","pulls_url":"https://api.github.com/repos/googleapis/sdk-platform-java/pulls{/number}","milestones_url":"https://api.github.com/repos/googleapis/sdk-platform-java/milestones{/number}","notifications_url":"https://api.github.com/repos/googleapis/sdk-platform-java/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/googleapis/sdk-platform-java/labels{/name}","releases_url":"https://api.github.com/repos/googleapis/sdk-platform-java/releases{/id}","deployments_url":"https://api.github.com/repos/googleapis/sdk-platform-java/deployments","created_at":"2020-05-14T18:15:25Z","updated_at":"2024-05-14T20:57:11Z","pushed_at":"2024-05-14T21:09:51Z","git_url":"git://github.com/googleapis/sdk-platform-java.git","ssh_url":"git@github.com:googleapis/sdk-platform-java.git","clone_url":"https://github.com/googleapis/sdk-platform-java.git","svn_url":"https://github.com/googleapis/sdk-platform-java","homepage":"https://cloud.google.com/java/docs/bom","size":40540,"stargazers_count":59,"watchers_count":59,"language":"Java","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"has_discussions":false,"forks_count":47,"mirror_url":null,"archived":false,"disabled":false,"open_issues_count":189,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"allow_forking":true,"is_template":false,"web_commit_signoff_required":false,"topics":[],"visibility":"public","forks":47,"open_issues":189,"watchers":59,"default_branch":"main"}},"base":{"label":"googleapis:main","ref":"main","sha":"a4726206146a503822f685caa1e4d04273b738dc","user":{"login":"googleapis","id":16785467,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE2Nzg1NDY3","avatar_url":"https://avatars.githubusercontent.com/u/16785467?v=4","gravatar_id":"","url":"https://api.github.com/users/googleapis","html_url":"https://github.com/googleapis","followers_url":"https://api.github.com/users/googleapis/followers","following_url":"https://api.github.com/users/googleapis/following{/other_user}","gists_url":"https://api.github.com/users/googleapis/gists{/gist_id}","starred_url":"https://api.github.com/users/googleapis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/googleapis/subscriptions","organizations_url":"https://api.github.com/users/googleapis/orgs","repos_url":"https://api.github.com/users/googleapis/repos","events_url":"https://api.github.com/users/googleapis/events{/privacy}","received_events_url":"https://api.github.com/users/googleapis/received_events","type":"Organization","site_admin":false},"repo":{"id":263991304,"node_id":"MDEwOlJlcG9zaXRvcnkyNjM5OTEzMDQ=","name":"sdk-platform-java","full_name":"googleapis/sdk-platform-java","private":false,"owner":{"login":"googleapis","id":16785467,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE2Nzg1NDY3","avatar_url":"https://avatars.githubusercontent.com/u/16785467?v=4","gravatar_id":"","url":"https://api.github.com/users/googleapis","html_url":"https://github.com/googleapis","followers_url":"https://api.github.com/users/googleapis/followers","following_url":"https://api.github.com/users/googleapis/following{/other_user}","gists_url":"https://api.github.com/users/googleapis/gists{/gist_id}","starred_url":"https://api.github.com/users/googleapis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/googleapis/subscriptions","organizations_url":"https://api.github.com/users/googleapis/orgs","repos_url":"https://api.github.com/users/googleapis/repos","events_url":"https://api.github.com/users/googleapis/events{/privacy}","received_events_url":"https://api.github.com/users/googleapis/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/googleapis/sdk-platform-java","description":"Tooling and shared libraries for Cloud SDK for Java","fork":false,"url":"https://api.github.com/repos/googleapis/sdk-platform-java","forks_url":"https://api.github.com/repos/googleapis/sdk-platform-java/forks","keys_url":"https://api.github.com/repos/googleapis/sdk-platform-java/keys{/key_id}","collaborators_url":"https://api.github.com/repos/googleapis/sdk-platform-java/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/googleapis/sdk-platform-java/teams","hooks_url":"https://api.github.com/repos/googleapis/sdk-platform-java/hooks","issue_events_url":"https://api.github.com/repos/googleapis/sdk-platform-java/issues/events{/number}","events_url":"https://api.github.com/repos/googleapis/sdk-platform-java/events","assignees_url":"https://api.github.com/repos/googleapis/sdk-platform-java/assignees{/user}","branches_url":"https://api.github.com/repos/googleapis/sdk-platform-java/branches{/branch}","tags_url":"https://api.github.com/repos/googleapis/sdk-platform-java/tags","blobs_url":"https://api.github.com/repos/googleapis/sdk-platform-java/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/googleapis/sdk-platform-java/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/googleapis/sdk-platform-java/git/refs{/sha}","trees_url":"https://api.github.com/repos/googleapis/sdk-platform-java/git/trees{/sha}","statuses_url":"https://api.github.com/repos/googleapis/sdk-platform-java/statuses/{sha}","languages_url":"https://api.github.com/repos/googleapis/sdk-platform-java/languages","stargazers_url":"https://api.github.com/repos/googleapis/sdk-platform-java/stargazers","contributors_url":"https://api.github.com/repos/googleapis/sdk-platform-java/contributors","subscribers_url":"https://api.github.com/repos/googleapis/sdk-platform-java/subscribers","subscription_url":"https://api.github.com/repos/googleapis/sdk-platform-java/subscription","commits_url":"https://api.github.com/repos/googleapis/sdk-platform-java/commits{/sha}","git_commits_url":"https://api.github.com/repos/googleapis/sdk-platform-java/git/commits{/sha}","comments_url":"https://api.github.com/repos/googleapis/sdk-platform-java/comments{/number}","issue_comment_url":"https://api.github.com/repos/googleapis/sdk-platform-java/issues/comments{/number}","contents_url":"https://api.github.com/repos/googleapis/sdk-platform-java/contents/{+path}","compare_url":"https://api.github.com/repos/googleapis/sdk-platform-java/compare/{base}...{head}","merges_url":"https://api.github.com/repos/googleapis/sdk-platform-java/merges","archive_url":"https://api.github.com/repos/googleapis/sdk-platform-java/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/googleapis/sdk-platform-java/downloads","issues_url":"https://api.github.com/repos/googleapis/sdk-platform-java/issues{/number}","pulls_url":"https://api.github.com/repos/googleapis/sdk-platform-java/pulls{/number}","milestones_url":"https://api.github.com/repos/googleapis/sdk-platform-java/milestones{/number}","notifications_url":"https://api.github.com/repos/googleapis/sdk-platform-java/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/googleapis/sdk-platform-java/labels{/name}","releases_url":"https://api.github.com/repos/googleapis/sdk-platform-java/releases{/id}","deployments_url":"https://api.github.com/repos/googleapis/sdk-platform-java/deployments","created_at":"2020-05-14T18:15:25Z","updated_at":"2024-05-14T20:57:11Z","pushed_at":"2024-05-14T21:09:51Z","git_url":"git://github.com/googleapis/sdk-platform-java.git","ssh_url":"git@github.com:googleapis/sdk-platform-java.git","clone_url":"https://github.com/googleapis/sdk-platform-java.git","svn_url":"https://github.com/googleapis/sdk-platform-java","homepage":"https://cloud.google.com/java/docs/bom","size":40540,"stargazers_count":59,"watchers_count":59,"language":"Java","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"has_discussions":false,"forks_count":47,"mirror_url":null,"archived":false,"disabled":false,"open_issues_count":189,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"allow_forking":true,"is_template":false,"web_commit_signoff_required":false,"topics":[],"visibility":"public","forks":47,"open_issues":189,"watchers":59,"default_branch":"main"}},"_links":{"self":{"href":"https://api.github.com/repos/googleapis/sdk-platform-java/pulls/2764"},"html":{"href":"https://github.com/googleapis/sdk-platform-java/pull/2764"},"issue":{"href":"https://api.github.com/repos/googleapis/sdk-platform-java/issues/2764"},"comments":{"href":"https://api.github.com/repos/googleapis/sdk-platform-java/issues/2764/comments"},"review_comments":{"href":"https://api.github.com/repos/googleapis/sdk-platform-java/pulls/2764/comments"},"review_comment":{"href":"https://api.github.com/repos/googleapis/sdk-platform-java/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/googleapis/sdk-platform-java/pulls/2764/commits"},"statuses":{"href":"https://api.github.com/repos/googleapis/sdk-platform-java/statuses/28b1139f428096392ab3aac15ddd2b512dd37c06"}},"author_association":"COLLABORATOR","auto_merge":null,"active_lock_reason":null},{"url":"https://api.github.com/repos/googleapis/sdk-platform-java/pulls/2761","id":1862759879,"node_id":"PR_kwDOD7wwCM5vB3XH","html_url":"https://github.com/googleapis/sdk-platform-java/pull/2761","diff_url":"https://github.com/googleapis/sdk-platform-java/pull/2761.diff","patch_url":"https://github.com/googleapis/sdk-platform-java/pull/2761.patch","issue_url":"https://api.github.com/repos/googleapis/sdk-platform-java/issues/2761","number":2761,"state":"closed","locked":false,"title":"fix: prepare to generate grafeas","user":{"login":"JoeWang1127","id":106995533,"node_id":"U_kgDOBmCfTQ","avatar_url":"https://avatars.githubusercontent.com/u/106995533?v=4","gravatar_id":"","url":"https://api.github.com/users/JoeWang1127","html_url":"https://github.com/JoeWang1127","followers_url":"https://api.github.com/users/JoeWang1127/followers","following_url":"https://api.github.com/users/JoeWang1127/following{/other_user}","gists_url":"https://api.github.com/users/JoeWang1127/gists{/gist_id}","starred_url":"https://api.github.com/users/JoeWang1127/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JoeWang1127/subscriptions","organizations_url":"https://api.github.com/users/JoeWang1127/orgs","repos_url":"https://api.github.com/users/JoeWang1127/repos","events_url":"https://api.github.com/users/JoeWang1127/events{/privacy}","received_events_url":"https://api.github.com/users/JoeWang1127/received_events","type":"User","site_admin":false},"body":"In this PR:\r\n- Add suffix to sample source folder\r\n- Add unit tests\r\n\r\nContext:\r\n- The package name of grafeas is `io.grafeas.v1` which is not starts with `com`. When copying samples to destination directory, we need to change the suffix of source directory.\r\n- grafeas doesn't have a valid api_id (empty string). Before this change, the `api_id` will be populated as `{library.api_shortname}.googleapis.com`, which is not correct. `api_id` should not be populated to `.repo-metadata.json` if set to empty string.\r\n\r\nWith the library entry added in generation configuration:\r\n```\r\n- api_shortname: containeranalysis\r\n name_pretty: Grafeas\r\n product_documentation: https://grafeas.io\r\n api_description: n/a\r\n client_documentation: \"https://cloud.google.com/java/docs/reference/grafeas/latest/overview\"\r\n release_level: stable\r\n distribution_name: \"io.grafeas:grafeas\"\r\n api_id: \"\"\r\n codeowner_team: \"@googleapis/aap-dpes\"\r\n library_name: grafeas\r\n requires_billing: false\r\n GAPICs:\r\n - proto_path: grafeas/v1\r\n ```\r\n\r\nThe generated java-grafeas is in https://github.com/googleapis/google-cloud-java/pull/10820","created_at":"2024-05-09T20:31:50Z","updated_at":"2024-05-13T20:25:14Z","closed_at":"2024-05-13T20:25:13Z","merged_at":"2024-05-13T20:25:13Z","merge_commit_sha":"1114f1863bf5ae15ee56631fd824a2269e91746d","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":5133297485,"node_id":"LA_kwDOD7wwCM8AAAABMffnTQ","url":"https://api.github.com/repos/googleapis/sdk-platform-java/labels/size:%20m","name":"size: m","color":"c406d7","default":false,"description":"Pull request size is medium."}],"milestone":null,"draft":false,"commits_url":"https://api.github.com/repos/googleapis/sdk-platform-java/pulls/2761/commits","review_comments_url":"https://api.github.com/repos/googleapis/sdk-platform-java/pulls/2761/comments","review_comment_url":"https://api.github.com/repos/googleapis/sdk-platform-java/pulls/comments{/number}","comments_url":"https://api.github.com/repos/googleapis/sdk-platform-java/issues/2761/comments","statuses_url":"https://api.github.com/repos/googleapis/sdk-platform-java/statuses/a8cfbdcfd9744e0df19cab4589354c18a8ad70f7","head":{"label":"googleapis:fix/generate-grafeas","ref":"fix/generate-grafeas","sha":"a8cfbdcfd9744e0df19cab4589354c18a8ad70f7","user":{"login":"googleapis","id":16785467,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE2Nzg1NDY3","avatar_url":"https://avatars.githubusercontent.com/u/16785467?v=4","gravatar_id":"","url":"https://api.github.com/users/googleapis","html_url":"https://github.com/googleapis","followers_url":"https://api.github.com/users/googleapis/followers","following_url":"https://api.github.com/users/googleapis/following{/other_user}","gists_url":"https://api.github.com/users/googleapis/gists{/gist_id}","starred_url":"https://api.github.com/users/googleapis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/googleapis/subscriptions","organizations_url":"https://api.github.com/users/googleapis/orgs","repos_url":"https://api.github.com/users/googleapis/repos","events_url":"https://api.github.com/users/googleapis/events{/privacy}","received_events_url":"https://api.github.com/users/googleapis/received_events","type":"Organization","site_admin":false},"repo":{"id":263991304,"node_id":"MDEwOlJlcG9zaXRvcnkyNjM5OTEzMDQ=","name":"sdk-platform-java","full_name":"googleapis/sdk-platform-java","private":false,"owner":{"login":"googleapis","id":16785467,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE2Nzg1NDY3","avatar_url":"https://avatars.githubusercontent.com/u/16785467?v=4","gravatar_id":"","url":"https://api.github.com/users/googleapis","html_url":"https://github.com/googleapis","followers_url":"https://api.github.com/users/googleapis/followers","following_url":"https://api.github.com/users/googleapis/following{/other_user}","gists_url":"https://api.github.com/users/googleapis/gists{/gist_id}","starred_url":"https://api.github.com/users/googleapis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/googleapis/subscriptions","organizations_url":"https://api.github.com/users/googleapis/orgs","repos_url":"https://api.github.com/users/googleapis/repos","events_url":"https://api.github.com/users/googleapis/events{/privacy}","received_events_url":"https://api.github.com/users/googleapis/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/googleapis/sdk-platform-java","description":"Tooling and shared libraries for Cloud SDK for Java","fork":false,"url":"https://api.github.com/repos/googleapis/sdk-platform-java","forks_url":"https://api.github.com/repos/googleapis/sdk-platform-java/forks","keys_url":"https://api.github.com/repos/googleapis/sdk-platform-java/keys{/key_id}","collaborators_url":"https://api.github.com/repos/googleapis/sdk-platform-java/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/googleapis/sdk-platform-java/teams","hooks_url":"https://api.github.com/repos/googleapis/sdk-platform-java/hooks","issue_events_url":"https://api.github.com/repos/googleapis/sdk-platform-java/issues/events{/number}","events_url":"https://api.github.com/repos/googleapis/sdk-platform-java/events","assignees_url":"https://api.github.com/repos/googleapis/sdk-platform-java/assignees{/user}","branches_url":"https://api.github.com/repos/googleapis/sdk-platform-java/branches{/branch}","tags_url":"https://api.github.com/repos/googleapis/sdk-platform-java/tags","blobs_url":"https://api.github.com/repos/googleapis/sdk-platform-java/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/googleapis/sdk-platform-java/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/googleapis/sdk-platform-java/git/refs{/sha}","trees_url":"https://api.github.com/repos/googleapis/sdk-platform-java/git/trees{/sha}","statuses_url":"https://api.github.com/repos/googleapis/sdk-platform-java/statuses/{sha}","languages_url":"https://api.github.com/repos/googleapis/sdk-platform-java/languages","stargazers_url":"https://api.github.com/repos/googleapis/sdk-platform-java/stargazers","contributors_url":"https://api.github.com/repos/googleapis/sdk-platform-java/contributors","subscribers_url":"https://api.github.com/repos/googleapis/sdk-platform-java/subscribers","subscription_url":"https://api.github.com/repos/googleapis/sdk-platform-java/subscription","commits_url":"https://api.github.com/repos/googleapis/sdk-platform-java/commits{/sha}","git_commits_url":"https://api.github.com/repos/googleapis/sdk-platform-java/git/commits{/sha}","comments_url":"https://api.github.com/repos/googleapis/sdk-platform-java/comments{/number}","issue_comment_url":"https://api.github.com/repos/googleapis/sdk-platform-java/issues/comments{/number}","contents_url":"https://api.github.com/repos/googleapis/sdk-platform-java/contents/{+path}","compare_url":"https://api.github.com/repos/googleapis/sdk-platform-java/compare/{base}...{head}","merges_url":"https://api.github.com/repos/googleapis/sdk-platform-java/merges","archive_url":"https://api.github.com/repos/googleapis/sdk-platform-java/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/googleapis/sdk-platform-java/downloads","issues_url":"https://api.github.com/repos/googleapis/sdk-platform-java/issues{/number}","pulls_url":"https://api.github.com/repos/googleapis/sdk-platform-java/pulls{/number}","milestones_url":"https://api.github.com/repos/googleapis/sdk-platform-java/milestones{/number}","notifications_url":"https://api.github.com/repos/googleapis/sdk-platform-java/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/googleapis/sdk-platform-java/labels{/name}","releases_url":"https://api.github.com/repos/googleapis/sdk-platform-java/releases{/id}","deployments_url":"https://api.github.com/repos/googleapis/sdk-platform-java/deployments","created_at":"2020-05-14T18:15:25Z","updated_at":"2024-05-14T20:57:11Z","pushed_at":"2024-05-14T21:09:51Z","git_url":"git://github.com/googleapis/sdk-platform-java.git","ssh_url":"git@github.com:googleapis/sdk-platform-java.git","clone_url":"https://github.com/googleapis/sdk-platform-java.git","svn_url":"https://github.com/googleapis/sdk-platform-java","homepage":"https://cloud.google.com/java/docs/bom","size":40540,"stargazers_count":59,"watchers_count":59,"language":"Java","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"has_discussions":false,"forks_count":47,"mirror_url":null,"archived":false,"disabled":false,"open_issues_count":189,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"allow_forking":true,"is_template":false,"web_commit_signoff_required":false,"topics":[],"visibility":"public","forks":47,"open_issues":189,"watchers":59,"default_branch":"main"}},"base":{"label":"googleapis:main","ref":"main","sha":"e1e1fb66d95adc08baea71c5a0607c20d5a57a8b","user":{"login":"googleapis","id":16785467,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE2Nzg1NDY3","avatar_url":"https://avatars.githubusercontent.com/u/16785467?v=4","gravatar_id":"","url":"https://api.github.com/users/googleapis","html_url":"https://github.com/googleapis","followers_url":"https://api.github.com/users/googleapis/followers","following_url":"https://api.github.com/users/googleapis/following{/other_user}","gists_url":"https://api.github.com/users/googleapis/gists{/gist_id}","starred_url":"https://api.github.com/users/googleapis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/googleapis/subscriptions","organizations_url":"https://api.github.com/users/googleapis/orgs","repos_url":"https://api.github.com/users/googleapis/repos","events_url":"https://api.github.com/users/googleapis/events{/privacy}","received_events_url":"https://api.github.com/users/googleapis/received_events","type":"Organization","site_admin":false},"repo":{"id":263991304,"node_id":"MDEwOlJlcG9zaXRvcnkyNjM5OTEzMDQ=","name":"sdk-platform-java","full_name":"googleapis/sdk-platform-java","private":false,"owner":{"login":"googleapis","id":16785467,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE2Nzg1NDY3","avatar_url":"https://avatars.githubusercontent.com/u/16785467?v=4","gravatar_id":"","url":"https://api.github.com/users/googleapis","html_url":"https://github.com/googleapis","followers_url":"https://api.github.com/users/googleapis/followers","following_url":"https://api.github.com/users/googleapis/following{/other_user}","gists_url":"https://api.github.com/users/googleapis/gists{/gist_id}","starred_url":"https://api.github.com/users/googleapis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/googleapis/subscriptions","organizations_url":"https://api.github.com/users/googleapis/orgs","repos_url":"https://api.github.com/users/googleapis/repos","events_url":"https://api.github.com/users/googleapis/events{/privacy}","received_events_url":"https://api.github.com/users/googleapis/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/googleapis/sdk-platform-java","description":"Tooling and shared libraries for Cloud SDK for Java","fork":false,"url":"https://api.github.com/repos/googleapis/sdk-platform-java","forks_url":"https://api.github.com/repos/googleapis/sdk-platform-java/forks","keys_url":"https://api.github.com/repos/googleapis/sdk-platform-java/keys{/key_id}","collaborators_url":"https://api.github.com/repos/googleapis/sdk-platform-java/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/googleapis/sdk-platform-java/teams","hooks_url":"https://api.github.com/repos/googleapis/sdk-platform-java/hooks","issue_events_url":"https://api.github.com/repos/googleapis/sdk-platform-java/issues/events{/number}","events_url":"https://api.github.com/repos/googleapis/sdk-platform-java/events","assignees_url":"https://api.github.com/repos/googleapis/sdk-platform-java/assignees{/user}","branches_url":"https://api.github.com/repos/googleapis/sdk-platform-java/branches{/branch}","tags_url":"https://api.github.com/repos/googleapis/sdk-platform-java/tags","blobs_url":"https://api.github.com/repos/googleapis/sdk-platform-java/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/googleapis/sdk-platform-java/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/googleapis/sdk-platform-java/git/refs{/sha}","trees_url":"https://api.github.com/repos/googleapis/sdk-platform-java/git/trees{/sha}","statuses_url":"https://api.github.com/repos/googleapis/sdk-platform-java/statuses/{sha}","languages_url":"https://api.github.com/repos/googleapis/sdk-platform-java/languages","stargazers_url":"https://api.github.com/repos/googleapis/sdk-platform-java/stargazers","contributors_url":"https://api.github.com/repos/googleapis/sdk-platform-java/contributors","subscribers_url":"https://api.github.com/repos/googleapis/sdk-platform-java/subscribers","subscription_url":"https://api.github.com/repos/googleapis/sdk-platform-java/subscription","commits_url":"https://api.github.com/repos/googleapis/sdk-platform-java/commits{/sha}","git_commits_url":"https://api.github.com/repos/googleapis/sdk-platform-java/git/commits{/sha}","comments_url":"https://api.github.com/repos/googleapis/sdk-platform-java/comments{/number}","issue_comment_url":"https://api.github.com/repos/googleapis/sdk-platform-java/issues/comments{/number}","contents_url":"https://api.github.com/repos/googleapis/sdk-platform-java/contents/{+path}","compare_url":"https://api.github.com/repos/googleapis/sdk-platform-java/compare/{base}...{head}","merges_url":"https://api.github.com/repos/googleapis/sdk-platform-java/merges","archive_url":"https://api.github.com/repos/googleapis/sdk-platform-java/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/googleapis/sdk-platform-java/downloads","issues_url":"https://api.github.com/repos/googleapis/sdk-platform-java/issues{/number}","pulls_url":"https://api.github.com/repos/googleapis/sdk-platform-java/pulls{/number}","milestones_url":"https://api.github.com/repos/googleapis/sdk-platform-java/milestones{/number}","notifications_url":"https://api.github.com/repos/googleapis/sdk-platform-java/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/googleapis/sdk-platform-java/labels{/name}","releases_url":"https://api.github.com/repos/googleapis/sdk-platform-java/releases{/id}","deployments_url":"https://api.github.com/repos/googleapis/sdk-platform-java/deployments","created_at":"2020-05-14T18:15:25Z","updated_at":"2024-05-14T20:57:11Z","pushed_at":"2024-05-14T21:09:51Z","git_url":"git://github.com/googleapis/sdk-platform-java.git","ssh_url":"git@github.com:googleapis/sdk-platform-java.git","clone_url":"https://github.com/googleapis/sdk-platform-java.git","svn_url":"https://github.com/googleapis/sdk-platform-java","homepage":"https://cloud.google.com/java/docs/bom","size":40540,"stargazers_count":59,"watchers_count":59,"language":"Java","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"has_discussions":false,"forks_count":47,"mirror_url":null,"archived":false,"disabled":false,"open_issues_count":189,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"allow_forking":true,"is_template":false,"web_commit_signoff_required":false,"topics":[],"visibility":"public","forks":47,"open_issues":189,"watchers":59,"default_branch":"main"}},"_links":{"self":{"href":"https://api.github.com/repos/googleapis/sdk-platform-java/pulls/2761"},"html":{"href":"https://github.com/googleapis/sdk-platform-java/pull/2761"},"issue":{"href":"https://api.github.com/repos/googleapis/sdk-platform-java/issues/2761"},"comments":{"href":"https://api.github.com/repos/googleapis/sdk-platform-java/issues/2761/comments"},"review_comments":{"href":"https://api.github.com/repos/googleapis/sdk-platform-java/pulls/2761/comments"},"review_comment":{"href":"https://api.github.com/repos/googleapis/sdk-platform-java/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/googleapis/sdk-platform-java/pulls/2761/commits"},"statuses":{"href":"https://api.github.com/repos/googleapis/sdk-platform-java/statuses/a8cfbdcfd9744e0df19cab4589354c18a8ad70f7"}},"author_association":"COLLABORATOR","auto_merge":null,"active_lock_reason":null},{"url":"https://api.github.com/repos/googleapis/sdk-platform-java/pulls/2760","id":1862713220,"node_id":"PR_kwDOD7wwCM5vBr-E","html_url":"https://github.com/googleapis/sdk-platform-java/pull/2760","diff_url":"https://github.com/googleapis/sdk-platform-java/pull/2760.diff","patch_url":"https://github.com/googleapis/sdk-platform-java/pull/2760.patch","issue_url":"https://api.github.com/repos/googleapis/sdk-platform-java/issues/2760","number":2760,"state":"closed","locked":false,"title":"ci: increase graalvm ci machine type","user":{"login":"burkedavison","id":40617934,"node_id":"MDQ6VXNlcjQwNjE3OTM0","avatar_url":"https://avatars.githubusercontent.com/u/40617934?v=4","gravatar_id":"","url":"https://api.github.com/users/burkedavison","html_url":"https://github.com/burkedavison","followers_url":"https://api.github.com/users/burkedavison/followers","following_url":"https://api.github.com/users/burkedavison/following{/other_user}","gists_url":"https://api.github.com/users/burkedavison/gists{/gist_id}","starred_url":"https://api.github.com/users/burkedavison/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/burkedavison/subscriptions","organizations_url":"https://api.github.com/users/burkedavison/orgs","repos_url":"https://api.github.com/users/burkedavison/repos","events_url":"https://api.github.com/users/burkedavison/events{/privacy}","received_events_url":"https://api.github.com/users/burkedavison/received_events","type":"User","site_admin":false},"body":"8m33s, 8m44s, 10m43s, 11m28s, 9m41s, 10m47s\r\n\r\nThese test times are all shorter than the ci / build (11) check, making these checks no longer the bottle neck.","created_at":"2024-05-09T20:00:47Z","updated_at":"2024-05-09T20:23:56Z","closed_at":"2024-05-09T20:23:55Z","merged_at":"2024-05-09T20:23:55Z","merge_commit_sha":"197331ba864b0036bb39f0f18d15d81205057808","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":5132322442,"node_id":"LA_kwDOD7wwCM8AAAABMekGig","url":"https://api.github.com/repos/googleapis/sdk-platform-java/labels/size:%20s","name":"size: s","color":"af9955","default":false,"description":"Pull request size is small."}],"milestone":null,"draft":false,"commits_url":"https://api.github.com/repos/googleapis/sdk-platform-java/pulls/2760/commits","review_comments_url":"https://api.github.com/repos/googleapis/sdk-platform-java/pulls/2760/comments","review_comment_url":"https://api.github.com/repos/googleapis/sdk-platform-java/pulls/comments{/number}","comments_url":"https://api.github.com/repos/googleapis/sdk-platform-java/issues/2760/comments","statuses_url":"https://api.github.com/repos/googleapis/sdk-platform-java/statuses/db9bcb0eba9435390f7c84729028cc0273d79af4","head":{"label":"googleapis:beefier-graalvm-machines","ref":"beefier-graalvm-machines","sha":"db9bcb0eba9435390f7c84729028cc0273d79af4","user":{"login":"googleapis","id":16785467,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE2Nzg1NDY3","avatar_url":"https://avatars.githubusercontent.com/u/16785467?v=4","gravatar_id":"","url":"https://api.github.com/users/googleapis","html_url":"https://github.com/googleapis","followers_url":"https://api.github.com/users/googleapis/followers","following_url":"https://api.github.com/users/googleapis/following{/other_user}","gists_url":"https://api.github.com/users/googleapis/gists{/gist_id}","starred_url":"https://api.github.com/users/googleapis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/googleapis/subscriptions","organizations_url":"https://api.github.com/users/googleapis/orgs","repos_url":"https://api.github.com/users/googleapis/repos","events_url":"https://api.github.com/users/googleapis/events{/privacy}","received_events_url":"https://api.github.com/users/googleapis/received_events","type":"Organization","site_admin":false},"repo":{"id":263991304,"node_id":"MDEwOlJlcG9zaXRvcnkyNjM5OTEzMDQ=","name":"sdk-platform-java","full_name":"googleapis/sdk-platform-java","private":false,"owner":{"login":"googleapis","id":16785467,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE2Nzg1NDY3","avatar_url":"https://avatars.githubusercontent.com/u/16785467?v=4","gravatar_id":"","url":"https://api.github.com/users/googleapis","html_url":"https://github.com/googleapis","followers_url":"https://api.github.com/users/googleapis/followers","following_url":"https://api.github.com/users/googleapis/following{/other_user}","gists_url":"https://api.github.com/users/googleapis/gists{/gist_id}","starred_url":"https://api.github.com/users/googleapis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/googleapis/subscriptions","organizations_url":"https://api.github.com/users/googleapis/orgs","repos_url":"https://api.github.com/users/googleapis/repos","events_url":"https://api.github.com/users/googleapis/events{/privacy}","received_events_url":"https://api.github.com/users/googleapis/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/googleapis/sdk-platform-java","description":"Tooling and shared libraries for Cloud SDK for Java","fork":false,"url":"https://api.github.com/repos/googleapis/sdk-platform-java","forks_url":"https://api.github.com/repos/googleapis/sdk-platform-java/forks","keys_url":"https://api.github.com/repos/googleapis/sdk-platform-java/keys{/key_id}","collaborators_url":"https://api.github.com/repos/googleapis/sdk-platform-java/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/googleapis/sdk-platform-java/teams","hooks_url":"https://api.github.com/repos/googleapis/sdk-platform-java/hooks","issue_events_url":"https://api.github.com/repos/googleapis/sdk-platform-java/issues/events{/number}","events_url":"https://api.github.com/repos/googleapis/sdk-platform-java/events","assignees_url":"https://api.github.com/repos/googleapis/sdk-platform-java/assignees{/user}","branches_url":"https://api.github.com/repos/googleapis/sdk-platform-java/branches{/branch}","tags_url":"https://api.github.com/repos/googleapis/sdk-platform-java/tags","blobs_url":"https://api.github.com/repos/googleapis/sdk-platform-java/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/googleapis/sdk-platform-java/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/googleapis/sdk-platform-java/git/refs{/sha}","trees_url":"https://api.github.com/repos/googleapis/sdk-platform-java/git/trees{/sha}","statuses_url":"https://api.github.com/repos/googleapis/sdk-platform-java/statuses/{sha}","languages_url":"https://api.github.com/repos/googleapis/sdk-platform-java/languages","stargazers_url":"https://api.github.com/repos/googleapis/sdk-platform-java/stargazers","contributors_url":"https://api.github.com/repos/googleapis/sdk-platform-java/contributors","subscribers_url":"https://api.github.com/repos/googleapis/sdk-platform-java/subscribers","subscription_url":"https://api.github.com/repos/googleapis/sdk-platform-java/subscription","commits_url":"https://api.github.com/repos/googleapis/sdk-platform-java/commits{/sha}","git_commits_url":"https://api.github.com/repos/googleapis/sdk-platform-java/git/commits{/sha}","comments_url":"https://api.github.com/repos/googleapis/sdk-platform-java/comments{/number}","issue_comment_url":"https://api.github.com/repos/googleapis/sdk-platform-java/issues/comments{/number}","contents_url":"https://api.github.com/repos/googleapis/sdk-platform-java/contents/{+path}","compare_url":"https://api.github.com/repos/googleapis/sdk-platform-java/compare/{base}...{head}","merges_url":"https://api.github.com/repos/googleapis/sdk-platform-java/merges","archive_url":"https://api.github.com/repos/googleapis/sdk-platform-java/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/googleapis/sdk-platform-java/downloads","issues_url":"https://api.github.com/repos/googleapis/sdk-platform-java/issues{/number}","pulls_url":"https://api.github.com/repos/googleapis/sdk-platform-java/pulls{/number}","milestones_url":"https://api.github.com/repos/googleapis/sdk-platform-java/milestones{/number}","notifications_url":"https://api.github.com/repos/googleapis/sdk-platform-java/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/googleapis/sdk-platform-java/labels{/name}","releases_url":"https://api.github.com/repos/googleapis/sdk-platform-java/releases{/id}","deployments_url":"https://api.github.com/repos/googleapis/sdk-platform-java/deployments","created_at":"2020-05-14T18:15:25Z","updated_at":"2024-05-14T20:57:11Z","pushed_at":"2024-05-14T21:09:51Z","git_url":"git://github.com/googleapis/sdk-platform-java.git","ssh_url":"git@github.com:googleapis/sdk-platform-java.git","clone_url":"https://github.com/googleapis/sdk-platform-java.git","svn_url":"https://github.com/googleapis/sdk-platform-java","homepage":"https://cloud.google.com/java/docs/bom","size":40540,"stargazers_count":59,"watchers_count":59,"language":"Java","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"has_discussions":false,"forks_count":47,"mirror_url":null,"archived":false,"disabled":false,"open_issues_count":189,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"allow_forking":true,"is_template":false,"web_commit_signoff_required":false,"topics":[],"visibility":"public","forks":47,"open_issues":189,"watchers":59,"default_branch":"main"}},"base":{"label":"googleapis:main","ref":"main","sha":"69f5aecbb7d615eddf38ef236a944800edb8d731","user":{"login":"googleapis","id":16785467,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE2Nzg1NDY3","avatar_url":"https://avatars.githubusercontent.com/u/16785467?v=4","gravatar_id":"","url":"https://api.github.com/users/googleapis","html_url":"https://github.com/googleapis","followers_url":"https://api.github.com/users/googleapis/followers","following_url":"https://api.github.com/users/googleapis/following{/other_user}","gists_url":"https://api.github.com/users/googleapis/gists{/gist_id}","starred_url":"https://api.github.com/users/googleapis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/googleapis/subscriptions","organizations_url":"https://api.github.com/users/googleapis/orgs","repos_url":"https://api.github.com/users/googleapis/repos","events_url":"https://api.github.com/users/googleapis/events{/privacy}","received_events_url":"https://api.github.com/users/googleapis/received_events","type":"Organization","site_admin":false},"repo":{"id":263991304,"node_id":"MDEwOlJlcG9zaXRvcnkyNjM5OTEzMDQ=","name":"sdk-platform-java","full_name":"googleapis/sdk-platform-java","private":false,"owner":{"login":"googleapis","id":16785467,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE2Nzg1NDY3","avatar_url":"https://avatars.githubusercontent.com/u/16785467?v=4","gravatar_id":"","url":"https://api.github.com/users/googleapis","html_url":"https://github.com/googleapis","followers_url":"https://api.github.com/users/googleapis/followers","following_url":"https://api.github.com/users/googleapis/following{/other_user}","gists_url":"https://api.github.com/users/googleapis/gists{/gist_id}","starred_url":"https://api.github.com/users/googleapis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/googleapis/subscriptions","organizations_url":"https://api.github.com/users/googleapis/orgs","repos_url":"https://api.github.com/users/googleapis/repos","events_url":"https://api.github.com/users/googleapis/events{/privacy}","received_events_url":"https://api.github.com/users/googleapis/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/googleapis/sdk-platform-java","description":"Tooling and shared libraries for Cloud SDK for Java","fork":false,"url":"https://api.github.com/repos/googleapis/sdk-platform-java","forks_url":"https://api.github.com/repos/googleapis/sdk-platform-java/forks","keys_url":"https://api.github.com/repos/googleapis/sdk-platform-java/keys{/key_id}","collaborators_url":"https://api.github.com/repos/googleapis/sdk-platform-java/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/googleapis/sdk-platform-java/teams","hooks_url":"https://api.github.com/repos/googleapis/sdk-platform-java/hooks","issue_events_url":"https://api.github.com/repos/googleapis/sdk-platform-java/issues/events{/number}","events_url":"https://api.github.com/repos/googleapis/sdk-platform-java/events","assignees_url":"https://api.github.com/repos/googleapis/sdk-platform-java/assignees{/user}","branches_url":"https://api.github.com/repos/googleapis/sdk-platform-java/branches{/branch}","tags_url":"https://api.github.com/repos/googleapis/sdk-platform-java/tags","blobs_url":"https://api.github.com/repos/googleapis/sdk-platform-java/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/googleapis/sdk-platform-java/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/googleapis/sdk-platform-java/git/refs{/sha}","trees_url":"https://api.github.com/repos/googleapis/sdk-platform-java/git/trees{/sha}","statuses_url":"https://api.github.com/repos/googleapis/sdk-platform-java/statuses/{sha}","languages_url":"https://api.github.com/repos/googleapis/sdk-platform-java/languages","stargazers_url":"https://api.github.com/repos/googleapis/sdk-platform-java/stargazers","contributors_url":"https://api.github.com/repos/googleapis/sdk-platform-java/contributors","subscribers_url":"https://api.github.com/repos/googleapis/sdk-platform-java/subscribers","subscription_url":"https://api.github.com/repos/googleapis/sdk-platform-java/subscription","commits_url":"https://api.github.com/repos/googleapis/sdk-platform-java/commits{/sha}","git_commits_url":"https://api.github.com/repos/googleapis/sdk-platform-java/git/commits{/sha}","comments_url":"https://api.github.com/repos/googleapis/sdk-platform-java/comments{/number}","issue_comment_url":"https://api.github.com/repos/googleapis/sdk-platform-java/issues/comments{/number}","contents_url":"https://api.github.com/repos/googleapis/sdk-platform-java/contents/{+path}","compare_url":"https://api.github.com/repos/googleapis/sdk-platform-java/compare/{base}...{head}","merges_url":"https://api.github.com/repos/googleapis/sdk-platform-java/merges","archive_url":"https://api.github.com/repos/googleapis/sdk-platform-java/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/googleapis/sdk-platform-java/downloads","issues_url":"https://api.github.com/repos/googleapis/sdk-platform-java/issues{/number}","pulls_url":"https://api.github.com/repos/googleapis/sdk-platform-java/pulls{/number}","milestones_url":"https://api.github.com/repos/googleapis/sdk-platform-java/milestones{/number}","notifications_url":"https://api.github.com/repos/googleapis/sdk-platform-java/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/googleapis/sdk-platform-java/labels{/name}","releases_url":"https://api.github.com/repos/googleapis/sdk-platform-java/releases{/id}","deployments_url":"https://api.github.com/repos/googleapis/sdk-platform-java/deployments","created_at":"2020-05-14T18:15:25Z","updated_at":"2024-05-14T20:57:11Z","pushed_at":"2024-05-14T21:09:51Z","git_url":"git://github.com/googleapis/sdk-platform-java.git","ssh_url":"git@github.com:googleapis/sdk-platform-java.git","clone_url":"https://github.com/googleapis/sdk-platform-java.git","svn_url":"https://github.com/googleapis/sdk-platform-java","homepage":"https://cloud.google.com/java/docs/bom","size":40540,"stargazers_count":59,"watchers_count":59,"language":"Java","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"has_discussions":false,"forks_count":47,"mirror_url":null,"archived":false,"disabled":false,"open_issues_count":189,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"allow_forking":true,"is_template":false,"web_commit_signoff_required":false,"topics":[],"visibility":"public","forks":47,"open_issues":189,"watchers":59,"default_branch":"main"}},"_links":{"self":{"href":"https://api.github.com/repos/googleapis/sdk-platform-java/pulls/2760"},"html":{"href":"https://github.com/googleapis/sdk-platform-java/pull/2760"},"issue":{"href":"https://api.github.com/repos/googleapis/sdk-platform-java/issues/2760"},"comments":{"href":"https://api.github.com/repos/googleapis/sdk-platform-java/issues/2760/comments"},"review_comments":{"href":"https://api.github.com/repos/googleapis/sdk-platform-java/pulls/2760/comments"},"review_comment":{"href":"https://api.github.com/repos/googleapis/sdk-platform-java/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/googleapis/sdk-platform-java/pulls/2760/commits"},"statuses":{"href":"https://api.github.com/repos/googleapis/sdk-platform-java/statuses/db9bcb0eba9435390f7c84729028cc0273d79af4"}},"author_association":"CONTRIBUTOR","auto_merge":{"enabled_by":{"login":"burkedavison","id":40617934,"node_id":"MDQ6VXNlcjQwNjE3OTM0","avatar_url":"https://avatars.githubusercontent.com/u/40617934?v=4","gravatar_id":"","url":"https://api.github.com/users/burkedavison","html_url":"https://github.com/burkedavison","followers_url":"https://api.github.com/users/burkedavison/followers","following_url":"https://api.github.com/users/burkedavison/following{/other_user}","gists_url":"https://api.github.com/users/burkedavison/gists{/gist_id}","starred_url":"https://api.github.com/users/burkedavison/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/burkedavison/subscriptions","organizations_url":"https://api.github.com/users/burkedavison/orgs","repos_url":"https://api.github.com/users/burkedavison/repos","events_url":"https://api.github.com/users/burkedavison/events{/privacy}","received_events_url":"https://api.github.com/users/burkedavison/received_events","type":"User","site_admin":false},"merge_method":"squash","commit_title":"ci: increase graalvm ci machine type (#2760)","commit_message":"8m33s, 8m44s, 10m43s, 11m28s, 9m41s, 10m47s\r\n\r\nThese test times are all shorter than the ci / build (11) check, making\r\nthese checks no longer the bottle neck."},"active_lock_reason":null}] \ No newline at end of file diff --git a/java-shared-dependencies/dependency-convergence-check/README.md b/java-shared-dependencies/dependency-convergence-check/README.md new file mode 100644 index 0000000000..d593196ece --- /dev/null +++ b/java-shared-dependencies/dependency-convergence-check/README.md @@ -0,0 +1,6 @@ +# Dependency Convergence Check + +This project includes a test case for dependency convergence for some (not all) +artifacts in the Google Cloud Shared Dependencies BOM. + +This project is not meant to be used by end-users or published to Maven Central. diff --git a/java-shared-dependencies/dependency-convergence-check/pom.xml b/java-shared-dependencies/dependency-convergence-check/pom.xml new file mode 100644 index 0000000000..a1ccab7fc3 --- /dev/null +++ b/java-shared-dependencies/dependency-convergence-check/pom.xml @@ -0,0 +1,49 @@ + + + 4.0.0 + com.google.cloud + shared-dependencies-dependency-convergence-test + 3.58.1-SNAPSHOT + Dependency convergence test for certain artifacts in Google Cloud Shared Dependencies + + An dependency convergence test case for the shared dependencies BOM. A failure of this test case means + the shared dependencies BOM has outdated dependencies; there are newer version of artifacts + appearing in the dependency tree. + + + + UTF-8 + 1.8 + 1.8 + + + + + + org.apache.maven.shared + maven-shared-utils + 3.2.1 + + + + + + + com.google.guava + guava + 32.1.3-jre + test + + + com.google.cloud.tools + dependencies + 1.5.13 + test + + + junit + junit + test + + + diff --git a/java-shared-dependencies/dependency-convergence-check/src/test/java/com/google/cloud/DependencyConvergenceTest.java b/java-shared-dependencies/dependency-convergence-check/src/test/java/com/google/cloud/DependencyConvergenceTest.java new file mode 100644 index 0000000000..66bf3d753e --- /dev/null +++ b/java-shared-dependencies/dependency-convergence-check/src/test/java/com/google/cloud/DependencyConvergenceTest.java @@ -0,0 +1,114 @@ +/* + * 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. + */ + +package com.google.cloud; + +import static org.junit.Assert.assertTrue; + +import com.google.cloud.tools.opensource.classpath.ClassPathBuilder; +import com.google.cloud.tools.opensource.classpath.ClassPathEntry; +import com.google.cloud.tools.opensource.classpath.ClassPathResult; +import com.google.cloud.tools.opensource.classpath.DependencyMediation; +import com.google.cloud.tools.opensource.dependencies.Bom; +import com.google.cloud.tools.opensource.dependencies.DependencyPath; +import com.google.common.base.Joiner; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableSet; +import java.nio.file.Paths; +import java.util.HashSet; +import java.util.Set; +import org.eclipse.aether.artifact.Artifact; +import org.junit.Test; + +/** + * Test to ensure that certain artifacts in the dependency tree of each entry of the shared + * dependencies BOM have the same version. + */ +public class DependencyConvergenceTest { + + @Test + public void testGrpcConvergence() throws Exception { + // There were cases where the gRPC version set in the shared dependencies BOM and the gRPC + // version declared in gax-grpc's dependency broke the build of downstream projects. Two + // artifacts were using version range to specify exact gRPC versions. + // https://github.com/googleapis/java-shared-dependencies/pull/595 + Bom bom = Bom.readBom(Paths.get("../pom.xml")); + assertConvergence( + bom, + "io.grpc", + "grpc-netty-shaded", + ImmutableSet.of( + // Because OpenCensus's gRPC version does not use version range notation, it does not + // break downstream build + "opencensus-exporter-trace-stackdriver", + "opencensus-exporter-stats-stackdriver", + // Because grpc-gcp's gRPC version does not use version range notation, it does not + // break downstream build + "grpc-gcp", + // Because native-image-support's gRPC dependency is provided scope, it does not bring + // inconsistent gRPC artifacts to users' class paths. + "native-image-support")); + } + + /** + * Asserts the artifact specified at {@code groupId} and {@code artifactId} have the same version + * across the dependency trees of the managed dependencies of {@code bom}. + * + *

        Use {@code excludingArtifactIds} to ignore certain artifacts. + */ + private void assertConvergence( + Bom bom, String groupId, String artifactId, Set excludingArtifactIds) + throws Exception { + ImmutableList managedDependencies = bom.getManagedDependencies(); + + Set foundPaths = new HashSet<>(); + Set foundVersions = new HashSet<>(); + for (Artifact managedDependency : managedDependencies) { + if (excludingArtifactIds.contains(managedDependency.getArtifactId())) { + continue; + } + + ClassPathBuilder classPathBuilder = new ClassPathBuilder(); + ClassPathResult result = + classPathBuilder.resolve( + ImmutableList.of(managedDependency), false, DependencyMediation.MAVEN); + ImmutableList classPath = result.getClassPath(); + for (ClassPathEntry entry : classPath) { + Artifact artifact = entry.getArtifact(); + if (artifactId.equals(artifact.getArtifactId()) && groupId.equals(artifact.getGroupId())) { + ImmutableList dependencyPaths = result.getDependencyPaths(entry); + foundPaths.add(dependencyPaths.get(0)); + foundVersions.add(artifact.getVersion()); + } + } + } + + assertTrue( + "There should be at least one version in the graph but empty; " + + "please check the assertion is using correct groupID and artifactID.", + foundVersions.size() >= 1); + + // Duplicate versions found in the dependency trees + assertTrue( + "The version for " + + groupId + + ":" + + artifactId + + " should be one but there are multiple of them: " + + Joiner.on(", ").join(foundPaths), + foundVersions.size() <= 1); + } +} diff --git a/java-iam/java.header b/java-shared-dependencies/first-party-dependencies/java.header similarity index 100% rename from java-iam/java.header rename to java-shared-dependencies/first-party-dependencies/java.header diff --git a/java-shared-dependencies/first-party-dependencies/license-checks.xml b/java-shared-dependencies/first-party-dependencies/license-checks.xml new file mode 100644 index 0000000000..6597fced80 --- /dev/null +++ b/java-shared-dependencies/first-party-dependencies/license-checks.xml @@ -0,0 +1,10 @@ + + + + + + + + diff --git a/java-shared-dependencies/first-party-dependencies/pom.xml b/java-shared-dependencies/first-party-dependencies/pom.xml new file mode 100644 index 0000000000..2d6530e613 --- /dev/null +++ b/java-shared-dependencies/first-party-dependencies/pom.xml @@ -0,0 +1,83 @@ + + + 4.0.0 + com.google.cloud + first-party-dependencies + pom + 3.58.1-SNAPSHOT + Google Cloud First-party Shared Dependencies + + Shared first-party dependencies for Google Cloud Java libraries. + + + + com.google.cloud + google-cloud-shared-config + 1.17.0 + + + + + UTF-8 + ${project.artifactId} + 1.9.2 + 1.39.0 + 2.7.2 + + + + + + + com.google.api + gapic-generator-java-bom + 2.68.1-SNAPSHOT + pom + import + + + com.google.cloud + grpc-gcp + ${grpc-gcp.version} + + + com.google.cloud + google-cloud-core-bom + 2.66.1-SNAPSHOT + pom + import + + + com.google.oauth-client + google-oauth-client-bom + ${google.oauth-client.version} + pom + import + + + com.google.api-client + google-api-client-bom + ${google.api-client.version} + pom + import + + + + + + com.google.cloud + google-cloud-core + 2.66.1-SNAPSHOT + test-jar + + + com.google.cloud + google-cloud-core + 2.66.1-SNAPSHOT + tests + + + + diff --git a/java-shared-dependencies/pom.xml b/java-shared-dependencies/pom.xml new file mode 100644 index 0000000000..f682ac2ff9 --- /dev/null +++ b/java-shared-dependencies/pom.xml @@ -0,0 +1,47 @@ + + + 4.0.0 + com.google.cloud + google-cloud-shared-dependencies + pom + 3.58.1-SNAPSHOT + + first-party-dependencies + third-party-dependencies + + Google Cloud Shared Dependencies + + Shared build configuration for Google Cloud Java libraries. + + + + com.google.api + gapic-generator-java-pom-parent + 2.68.1-SNAPSHOT + ../gapic-generator-java-pom-parent + + + + UTF-8 + ${project.artifactId} + + + + + + com.google.cloud + first-party-dependencies + 3.58.1-SNAPSHOT + pom + import + + + com.google.cloud + third-party-dependencies + 3.58.1-SNAPSHOT + pom + import + + + + diff --git a/java-shared-dependencies/synth.metadata b/java-shared-dependencies/synth.metadata new file mode 100644 index 0000000000..57d8d055d1 --- /dev/null +++ b/java-shared-dependencies/synth.metadata @@ -0,0 +1,86 @@ +{ + "sources": [ + { + "git": { + "name": ".", + "remote": "https://github.com/googleapis/java-shared-dependencies.git", + "sha": "8a7d227f2a1dab9ff23d247a4e6131c817804c36" + } + }, + { + "git": { + "name": "synthtool", + "remote": "https://github.com/googleapis/synthtool.git", + "sha": "a4be3384ccb92364795d981f2863f6986fcee620" + } + } + ], + "generatedFiles": [ + ".github/CODEOWNERS", + ".github/ISSUE_TEMPLATE/bug_report.md", + ".github/ISSUE_TEMPLATE/feature_request.md", + ".github/ISSUE_TEMPLATE/support_request.md", + ".github/PULL_REQUEST_TEMPLATE.md", + ".github/blunderbuss.yml", + ".github/generated-files-bot.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/ci.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", + "CONTRIBUTING.md", + "LICENSE", + "SECURITY.md", + "codecov.yaml", + "java.header", + "license-checks.xml" + ] +} \ No newline at end of file diff --git a/java-shared-dependencies/third-party-dependencies/java.header b/java-shared-dependencies/third-party-dependencies/java.header new file mode 100644 index 0000000000..d0970ba7d3 --- /dev/null +++ b/java-shared-dependencies/third-party-dependencies/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-shared-dependencies/third-party-dependencies/license-checks.xml b/java-shared-dependencies/third-party-dependencies/license-checks.xml new file mode 100644 index 0000000000..6597fced80 --- /dev/null +++ b/java-shared-dependencies/third-party-dependencies/license-checks.xml @@ -0,0 +1,10 @@ + + + + + + + + diff --git a/java-shared-dependencies/third-party-dependencies/pom.xml b/java-shared-dependencies/third-party-dependencies/pom.xml new file mode 100644 index 0000000000..5a9e186834 --- /dev/null +++ b/java-shared-dependencies/third-party-dependencies/pom.xml @@ -0,0 +1,267 @@ + + + 4.0.0 + com.google.cloud + third-party-dependencies + pom + 3.58.1-SNAPSHOT + Google Cloud Third-party Shared Dependencies + + Shared third-party dependencies for Google Cloud Java libraries. + + + + com.google.api + gapic-generator-java-pom-parent + 2.68.1-SNAPSHOT + ../../gapic-generator-java-pom-parent + + + + UTF-8 + ${project.artifactId} + + 1.8.0 + 1.24 + 0.31.1 + 3.0.2 + 2.18.2 + 1.18.0 + 4.4.16 + 4.5.14 + 5.3.1 + 5.2.5 + + 3.49.0 + 0.27.0 + 0.33.0 + 2.1.0-alpha + 1.29.0-alpha + 0.8 + 17.0.0 + 0.6.0 + 1.16.0 + 1.45.0-alpha + 20250517 + + + + + + org.apache.arrow + arrow-memory-core + ${arrow.version} + + + org.apache.arrow + arrow-memory-netty + ${arrow.version} + + + org.apache.arrow + arrow-vector + ${arrow.version} + + + org.apache.httpcomponents + httpcore + ${httpcomponents.httpcore.version} + + + org.apache.httpcomponents + httpclient + ${httpcomponents.httpclient.version} + + + org.apache.httpcomponents.core5 + httpcore5 + ${apache-httpcore-5.version} + + + org.apache.httpcomponents.client5 + httpclient5 + ${apache-httpclient-5.version} + + + org.threeten + threetenbp + ${threetenbp.version} + + + org.threeten + threeten-extra + ${threeten-extra.version} + + + javax.annotation + javax.annotation-api + ${javax.annotation-api.version} + compile + + + org.codehaus.mojo + animal-sniffer-annotations + ${animal-sniffer.version} + + + com.google.code.findbugs + jsr305 + ${findbugs.version} + + + com.google.errorprone + error_prone_annotations + ${errorprone.version} + + + + com.google.flogger + google-extensions + ${flogger.version} + + + com.google.flogger + flogger-system-backend + ${flogger.version} + + + com.fasterxml.jackson + jackson-bom + ${jackson.version} + pom + import + + + commons-codec + commons-codec + ${codec.version} + + + io.opentelemetry + opentelemetry-bom + ${opentelemetry.version} + pom + import + + + io.opentelemetry.instrumentation + opentelemetry-grpc-1.6 + ${opentelemetry-grpc-instrumentation.version} + + + io.opentelemetry.semconv + opentelemetry-semconv + ${opentelemetry-semconv.version} + + + + + io.opentelemetry + opentelemetry-semconv + 1.26.0-alpha + + + com.google.cloud.opentelemetry + exporter-metrics + ${google.cloud.opentelemetry.version} + + + com.google.cloud.opentelemetry + shared-resourcemapping + ${google.cloud.opentelemetry.version} + + + io.opentelemetry.contrib + opentelemetry-gcp-resources + ${io.opentelemetry.contrib.opentelemetry-gcp-resources.version} + + + + + io.opencensus + opencensus-api + ${opencensus.version} + + + io.opencensus + opencensus-contrib-grpc-util + ${opencensus.version} + + + io.opencensus + opencensus-contrib-http-util + ${opencensus.version} + + + io.opencensus + opencensus-contrib-zpages + ${opencensus.version} + + + io.opencensus + opencensus-exporter-stats-stackdriver + ${opencensus.version} + + + io.opencensus + opencensus-exporter-trace-stackdriver + ${opencensus.version} + + + io.opencensus + opencensus-impl + ${opencensus.version} + + + io.opencensus + opencensus-impl-core + ${opencensus.version} + + + org.checkerframework + checker-qual + ${checker-qual.version} + + + io.perfmark + perfmark-api + ${perfmark-api.version} + + + com.google.j2objc + j2objc-annotations + ${j2objc-annotations.version} + + + com.google.cloud.opentelemetry + detector-resources-support + ${google.cloud.opentelemetry.version} + + + org.json + json + ${json.version} + + + org.junit + junit-bom + ${junit.version} + pom + import + + + dev.cel + cel + ${dev.cel.version} + + + com.google.crypto.tink + tink + ${com.google.crypto.tink.version} + + + + diff --git a/java-shared-dependencies/unmanaged-dependency-check/action.yaml b/java-shared-dependencies/unmanaged-dependency-check/action.yaml new file mode 100644 index 0000000000..06c7378b94 --- /dev/null +++ b/java-shared-dependencies/unmanaged-dependency-check/action.yaml @@ -0,0 +1,43 @@ + name: "Unmanaged dependency check" + description: "Checks whether there's a dependency that is not managed by java shared dependencies." + inputs: + bom-path: + description: "The relative path from the repository root to the pom.xml file" + required: true + runs: + using: "composite" + steps: + - uses: actions/setup-java@v3 + with: + distribution: temurin + java-version: 11 + cache: maven + - name: Set up Maven + uses: stCarolas/setup-maven@v4.5 + with: + maven-version: 3.8.2 + - name: Install latest Java shared dependencies + shell: bash + run: | + cd ${{ github.action_path }}/.. + echo "Install Java shared dependencies" + mvn clean install -V --batch-mode --no-transfer-progress -DskipTests + - name: Install check + shell: bash + run: | + cd ${{ github.action_path }} + echo "Install Unmanaged Dependency Check in $(pwd)" + mvn clean install -V --batch-mode --no-transfer-progress -DskipTests + - name: Run unmanaged dependency check + shell: bash + run: | + bom_absolute_path=$(realpath "${{ inputs.bom-path }}") + cd ${{ github.action_path }} + echo "Running Unmanaged Dependency Check against ${bom_absolute_path}" + unmanaged_dependencies=$(mvn exec:java -Dexec.args="../pom.xml ${bom_absolute_path}" -q) + if [[ "${unmanaged_dependencies}" != "[]" ]]; then + echo "This pull request seems to add new third-party dependency, ${unmanaged_dependencies}, among the artifacts listed in ${{ inputs.bom-path }}." + echo "Please see go/cloud-sdk-java-dependencies." + exit 1 + fi + diff --git a/java-shared-dependencies/unmanaged-dependency-check/pom.xml b/java-shared-dependencies/unmanaged-dependency-check/pom.xml new file mode 100644 index 0000000000..4ad68ca007 --- /dev/null +++ b/java-shared-dependencies/unmanaged-dependency-check/pom.xml @@ -0,0 +1,95 @@ + + + 4.0.0 + com.google.cloud + unmanaged-dependency-check + 0.0.1-SNAPSHOT + Unmanaged dependency check + + + + + + 1.8 + 1.8 + UTF-8 + + + + + + org.codehaus.mojo + exec-maven-plugin + 3.5.0 + + + + java + + + + + install-test-poms + test-compile + + exec + + + bash + + local-install.sh + + src/test/resources + + + + + com.google.cloud.UnmanagedDependencyCheck + + + + + + + + + org.apache.maven.shared + maven-shared-utils + 3.3.3 + + + + + + + com.google.cloud.tools + dependencies + 1.5.13 + + + junit + junit + 4.13.2 + test + + + com.google.truth + truth + 1.4.4 + test + + + org.slf4j + slf4j-api + 2.0.16 + + + org.slf4j + slf4j-simple + 2.0.16 + + + + \ No newline at end of file diff --git a/java-shared-dependencies/unmanaged-dependency-check/src/main/java/com/google/cloud/UnmanagedDependencyCheck.java b/java-shared-dependencies/unmanaged-dependency-check/src/main/java/com/google/cloud/UnmanagedDependencyCheck.java new file mode 100644 index 0000000000..832745b346 --- /dev/null +++ b/java-shared-dependencies/unmanaged-dependency-check/src/main/java/com/google/cloud/UnmanagedDependencyCheck.java @@ -0,0 +1,91 @@ +package com.google.cloud; + +import static com.google.common.base.Preconditions.checkArgument; + +import com.google.cloud.tools.opensource.classpath.ClassPathBuilder; +import com.google.cloud.tools.opensource.classpath.DependencyMediation; +import com.google.cloud.tools.opensource.dependencies.Bom; +import com.google.cloud.tools.opensource.dependencies.MavenRepositoryException; +import java.nio.file.Paths; +import java.util.HashSet; +import java.util.List; +import java.util.Set; +import java.util.stream.Collectors; +import org.eclipse.aether.artifact.Artifact; +import org.eclipse.aether.version.InvalidVersionSpecificationException; + +/** + * A utility class to check unmanaged dependencies in BOM. + */ +public class UnmanagedDependencyCheck { + // Regex of handwritten artifacts. + // There are customized artifacts defined in gapic-bom and handwritten libraries, + // e.g., firestore and datastore, add entries in regex to exclude these artifacts. + private final static String downstreamArtifact = + "(com.google.cloud:google-.*)|" + + "(com.google.api.grpc:(gapic|grpc|proto)-google-.*)|" + + "(com.google.cloud:proto-google-cloud-firestore-bundle-.*)|" + + "(com.google.cloud.datastore:datastore-.*-proto-client)|" + + "(com.google.analytics:google-analytics-.*)|" + + "(com.google.apis:google-api-.*)|" + + "(com.google.area120:google-area120-.*)|" + + "(io.grafeas:grafeas)"; + + /** + * @param args An array with two elements.

        The first string is the path of Java shared + * dependencies BOM.

        The second string is the path of a pom.xml contains BOM. + */ + public static void main(String[] args) + throws MavenRepositoryException, InvalidVersionSpecificationException { + checkArgument(args.length == 2, "The length of the inputs should be 2"); + System.out.println(getUnmanagedDependencies(args[0], args[1])); + } + + /** + * Returns dependency coordinates that are not managed by shared dependency BOM. + * + * @param sharedDependenciesBomPath the path of shared dependency BOM + * @param projectBomPath the path of current project BOM + * @return a list of unmanaged dependencies by the given version of shared dependency BOM + * @throws MavenRepositoryException thrown if the artifacts in Bom can't be reached in remote or + * local Maven repository + * @throws InvalidVersionSpecificationException thrown if the shared dependency version can't be + * parsed + */ + public static List getUnmanagedDependencies( + String sharedDependenciesBomPath, String projectBomPath) + throws MavenRepositoryException, InvalidVersionSpecificationException { + Set sharedDependencies = getManagedDependencies(sharedDependenciesBomPath); + Set managedDependencies = getManagedDependencies(projectBomPath); + + return managedDependencies.stream() + .filter(dependency -> !sharedDependencies.contains(dependency)) + // handwritten artifacts, e.g., com.google.cloud:google-cloud-bigtable, should be excluded. + .filter(dependency -> !dependency.matches(downstreamArtifact)) + .collect(Collectors.toList()); + } + + private static Set getManagedDependencies(String projectBomPath) + throws MavenRepositoryException, InvalidVersionSpecificationException { + return getManagedDependenciesFromBom(Bom.readBom(Paths.get(projectBomPath))); + } + + private static Set getManagedDependenciesFromBom(Bom bom) + throws InvalidVersionSpecificationException { + Set res = new HashSet<>(); + new ClassPathBuilder() + .resolve(bom.getManagedDependencies(), false, DependencyMediation.MAVEN) + .getClassPath() + .forEach( + classPath -> { + Artifact artifact = classPath.getArtifact(); + res.add(String.format("%s:%s", artifact.getGroupId(), artifact.getArtifactId())); + }); + + return res; + } + + private UnmanagedDependencyCheck() { + throw new IllegalStateException("Utility class"); + } +} diff --git a/java-shared-dependencies/unmanaged-dependency-check/src/test/java/com/google/cloud/UnmanagedDependencyCheckTest.java b/java-shared-dependencies/unmanaged-dependency-check/src/test/java/com/google/cloud/UnmanagedDependencyCheckTest.java new file mode 100644 index 0000000000..384db40e0b --- /dev/null +++ b/java-shared-dependencies/unmanaged-dependency-check/src/test/java/com/google/cloud/UnmanagedDependencyCheckTest.java @@ -0,0 +1,44 @@ +package com.google.cloud; + +import static com.google.common.truth.Truth.assertThat; +import static org.junit.Assert.assertTrue; + +import com.google.cloud.tools.opensource.dependencies.MavenRepositoryException; +import com.google.common.collect.ImmutableList; +import java.util.List; +import org.eclipse.aether.version.InvalidVersionSpecificationException; +import org.junit.Test; + +public class UnmanagedDependencyCheckTest { + @Test + public void getUnmanagedDependencyFromSamePomTest() + throws MavenRepositoryException, InvalidVersionSpecificationException { + String sharedDependenciesBom = "src/test/resources/shared-dependency-pom.xml"; + List unManagedDependencies = + UnmanagedDependencyCheck.getUnmanagedDependencies(sharedDependenciesBom, sharedDependenciesBom); + assertTrue(unManagedDependencies.isEmpty()); + } + + @Test + public void getUnmanagedDependencyFromGapicAndHandwrittenBomTest() + throws MavenRepositoryException, InvalidVersionSpecificationException { + List unManagedDependencies = + UnmanagedDependencyCheck.getUnmanagedDependencies( + "src/test/resources/shared-dependency-pom.xml", + "src/test/resources/google-internal-artifact-test-case-pom.xml"); + assertTrue(unManagedDependencies.isEmpty()); + } + + @Test + public void getUnmanagedDependencyFromNestedPomTest() + throws MavenRepositoryException, InvalidVersionSpecificationException { + List unManagedDependencies = + UnmanagedDependencyCheck.getUnmanagedDependencies( + "src/test/resources/shared-dependency-pom.xml", "src/test/resources/transitive-dependency-pom.xml"); + assertThat(unManagedDependencies) + .containsAtLeastElementsIn(ImmutableList.of("com.h2database:h2")); + // test dependency should be ignored. + assertThat(unManagedDependencies) + .doesNotContain(ImmutableList.of("com.mysql:mysql-connector-j")); + } +} diff --git a/java-shared-dependencies/unmanaged-dependency-check/src/test/resources/gax-example-pom.xml b/java-shared-dependencies/unmanaged-dependency-check/src/test/resources/gax-example-pom.xml new file mode 100644 index 0000000000..5bc943c2de --- /dev/null +++ b/java-shared-dependencies/unmanaged-dependency-check/src/test/resources/gax-example-pom.xml @@ -0,0 +1,22 @@ + + + 4.0.0 + com.google.api + gax-grpc + 0.0.1-SNAPSHOT + jar + + + + com.h2database + h2 + 2.2.224 + + + com.mysql + mysql-connector-j + 8.2.0 + test + + + \ No newline at end of file diff --git a/java-shared-dependencies/unmanaged-dependency-check/src/test/resources/google-internal-artifact-test-case-pom.xml b/java-shared-dependencies/unmanaged-dependency-check/src/test/resources/google-internal-artifact-test-case-pom.xml new file mode 100644 index 0000000000..f5342f5ee0 --- /dev/null +++ b/java-shared-dependencies/unmanaged-dependency-check/src/test/resources/google-internal-artifact-test-case-pom.xml @@ -0,0 +1,89 @@ + + + 4.0.0 + com.google.cloud + google-internal-artifact + 0.0.1-SNAPSHOT + pom + + com.google.cloud + google-cloud-shared-config + 1.6.0 + + + + Google Cloud Internal Artifact for testing + https://github.com/googleapis/java-bigtable + + BOM for Google Cloud Internal Artifact for testing + + + + Google LLC + + + + + The Apache Software License, Version 2.0 + http://www.apache.org/licenses/LICENSE-2.0.txt + repo + + + + + + + + com.google.cloud + google-cloud-datastore-bom + 2.18.1 + import + pom + + + + com.google.cloud + google-cloud-firestore-bom + 3.16.0 + import + pom + + + com.google.cloud + google-cloud-bigtable-bom + 2.31.0 + import + pom + + + com.google.cloud + gapic-libraries-bom + 1.27.0 + import + pom + + + + + + + + org.apache.maven.plugins + maven-checkstyle-plugin + + true + + + + + + org.apache.maven.plugins + maven-site-plugin + + + false + + + + + diff --git a/java-shared-dependencies/unmanaged-dependency-check/src/test/resources/local-install.sh b/java-shared-dependencies/unmanaged-dependency-check/src/test/resources/local-install.sh new file mode 100755 index 0000000000..118ddb2490 --- /dev/null +++ b/java-shared-dependencies/unmanaged-dependency-check/src/test/resources/local-install.sh @@ -0,0 +1,7 @@ +#!/usr/bin/env bash + +mvn install -B -ntp -f shared-dependency-pom.xml +mvn install -B -ntp -f gax-example-pom.xml +mvn install -B -ntp -f nested-dependency-pom.xml +mvn install -B -ntp -f transitive-dependency-pom.xml +mvn install -B -ntp -f google-internal-artifact-test-case-pom.xml diff --git a/java-shared-dependencies/unmanaged-dependency-check/src/test/resources/nested-dependency-pom.xml b/java-shared-dependencies/unmanaged-dependency-check/src/test/resources/nested-dependency-pom.xml new file mode 100644 index 0000000000..d841f4daf2 --- /dev/null +++ b/java-shared-dependencies/unmanaged-dependency-check/src/test/resources/nested-dependency-pom.xml @@ -0,0 +1,21 @@ + + + 4.0.0 + com.example + dependencies-bom + pom + 0.0.1-SNAPSHOT + Self Dependencies + + Self dependency pom used in test. + + + + + com.google.api + gax-grpc + 0.0.1-SNAPSHOT + + + + diff --git a/java-shared-dependencies/unmanaged-dependency-check/src/test/resources/shared-dependency-pom.xml b/java-shared-dependencies/unmanaged-dependency-check/src/test/resources/shared-dependency-pom.xml new file mode 100644 index 0000000000..325fd0df0f --- /dev/null +++ b/java-shared-dependencies/unmanaged-dependency-check/src/test/resources/shared-dependency-pom.xml @@ -0,0 +1,24 @@ + + + 4.0.0 + com.example + google-cloud-shared-dependencies-test + pom + 0.0.1-SNAPSHOT + Google Cloud Shared Dependencies + + Shared build configuration for Google Cloud Java libraries in Tests. + + + + + + com.google.cloud + google-cloud-shared-dependencies + 3.22.0 + pom + import + + + + diff --git a/java-shared-dependencies/unmanaged-dependency-check/src/test/resources/transitive-dependency-pom.xml b/java-shared-dependencies/unmanaged-dependency-check/src/test/resources/transitive-dependency-pom.xml new file mode 100644 index 0000000000..899652963b --- /dev/null +++ b/java-shared-dependencies/unmanaged-dependency-check/src/test/resources/transitive-dependency-pom.xml @@ -0,0 +1,23 @@ + + + 4.0.0 + com.example + transitive-dependencies + pom + 0.0.1 + Self Dependencies + + Self dependency pom used in test. + + + + + com.example + dependencies-bom + 0.0.1-SNAPSHOT + pom + import + + + + diff --git a/java-shared-dependencies/upper-bound-check/pom.xml b/java-shared-dependencies/upper-bound-check/pom.xml new file mode 100644 index 0000000000..7858e0a00e --- /dev/null +++ b/java-shared-dependencies/upper-bound-check/pom.xml @@ -0,0 +1,248 @@ + + + 4.0.0 + com.google.cloud + shared-dependencies-upper-bound-test + pom + 3.58.1-SNAPSHOT + Upper bound test for Google Cloud Shared Dependencies + + An upper bound test case for the shared dependencies BOM. A failure of this test case means + the shared dependencies BOM has outdated dependencies; there are newer version of artifacts + appearing in the dependency tree. + + + + com.google.cloud + + google-cloud-shared-config + 1.17.0 + + + + + UTF-8 + ${project.artifactId} + + + + + + com.google.cloud + google-cloud-shared-dependencies + 3.58.1-SNAPSHOT + pom + import + + + + + + + + io.grpc + grpc-alts + + + io.grpc + grpc-api + + + io.grpc + grpc-auth + + + io.grpc + grpc-benchmarks + + + io.grpc + grpc-census + + + io.grpc + grpc-context + + + io.grpc + grpc-core + + + io.grpc + grpc-grpclb + + + io.grpc + grpc-netty + + + io.grpc + grpc-netty-shaded + + + io.grpc + grpc-okhttp + + + io.grpc + grpc-protobuf + + + io.grpc + grpc-rls + + + io.grpc + grpc-services + + + io.grpc + grpc-stub + + + io.grpc + grpc-testing-proto + + + io.grpc + grpc-xds + + + com.google.api + gax + + + com.google.api + gax + + + com.google.api + gax-grpc + + + com.google.api + gax-httpjson + + + com.google.cloud + grpc-gcp + + + com.google.guava + guava + + + com.google.protobuf + protobuf-java + + + com.google.protobuf + protobuf-java-util + + + com.google.api + api-common + + + com.google.api.grpc + proto-google-common-protos + + + com.google.api.grpc + grpc-google-common-protos + + + com.google.cloud + google-cloud-core + + + com.google.cloud + google-cloud-core-grpc + + + com.google.cloud + google-cloud-core-http + + + com.google.auth + google-auth-library-credentials + + + com.google.auth + google-auth-library-oauth2-http + + + com.google.auth + google-auth-library-appengine + + + + com.google.http-client + google-http-client + + + com.google.http-client + google-http-client-android + + + com.google.http-client + google-http-client-apache-v2 + + + com.google.http-client + google-http-client-appengine + + + com.google.http-client + google-http-client-gson + + + com.google.http-client + google-http-client-jackson2 + + + com.google.http-client + google-http-client-protobuf + + + com.google.http-client + google-http-client-xml + + + + org.apache.httpcomponents.core5 + httpcore5 + + + org.apache.httpcomponents.client5 + httpclient5 + + + + com.google.oauth-client + google-oauth-client + + + com.google.api-client + google-api-client + + + com.google.api-client + google-api-client-android + + + com.google.api.grpc + proto-google-iam-v1 + + + com.google.api.grpc + grpc-google-iam-v1 + + + diff --git a/java-showcase-3.21.0/README.md b/java-showcase-3.21.0/README.md new file mode 100644 index 0000000000..736f5d1cf0 --- /dev/null +++ b/java-showcase-3.21.0/README.md @@ -0,0 +1,2 @@ +This is a copy of [GAPIC Showcase](https://github.com/googleapis/gapic-showcase) with protobuf 3.21.0 gen code. +This is intended to test the compatibility between protobuf-java runtime v4.33.0 and gen code 3.21.0. \ No newline at end of file diff --git a/java-showcase-3.21.0/gapic-showcase-extended/proto/BUILD.bazel b/java-showcase-3.21.0/gapic-showcase-extended/proto/BUILD.bazel new file mode 100644 index 0000000000..bc57596d1b --- /dev/null +++ b/java-showcase-3.21.0/gapic-showcase-extended/proto/BUILD.bazel @@ -0,0 +1,34 @@ +# Copyright 2023 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +""" +Provides proto_library target +Exports grpc service config +""" +load ("@rules_proto//proto:defs.bzl", "proto_library") + +# This is an API workspace, having public visibility by default makes perfect sense. +package(default_visibility = ["//visibility:public"]) + +# This BUILD file is the framework for gapic-showcase-extended (an extension to the existing gapic-showcase) +# It serves to augment the existing showcase project with generic protos not *yet* suited to the upstream project +# +# gapic-showcase project is used to test the generated client behavior with a showcase server +# gapic-showcase-extension project is used to test the generator's behavior + +#proto_library( +# name = "showcase_proto_extended", +# srcs = [], +# deps = [] +#) \ No newline at end of file diff --git a/java-showcase-3.21.0/gapic-showcase-extended/proto/wicked.proto b/java-showcase-3.21.0/gapic-showcase-extended/proto/wicked.proto new file mode 100644 index 0000000000..ea45fee918 --- /dev/null +++ b/java-showcase-3.21.0/gapic-showcase-extended/proto/wicked.proto @@ -0,0 +1,49 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT 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"; + +import "google/api/client.proto"; + +package google.showcase.v1beta1; + +option go_package = "github.com/googleapis/gapic-showcase/server/genproto"; +option java_package = "com.google.showcase.v1beta1"; +option java_multiple_files = true; +option ruby_package = "Google::Showcase::V1beta1"; + +// This service is used to show a Service with either non-enabled or non-eligible +// RPCs for HttpJson (Http 1.1). +// Non-Enabled: Missing the (google.api.http) annotation to enabled it +// Non-Eligible: BIDI and Client side streaming are not supported with Http 1.1 +// Service name is reference to `No REST for the Wicked` +service Wicked { + // This service is meant to only run locally on the port 7469 (keypad digits + // for "show"). + option (google.api.default_host) = "localhost:7469"; + + rpc CraftEvilPlan(EvilRequest) returns (EvilResponse); + + rpc BrainstormEvilPlans(stream EvilRequest) returns (stream EvilResponse); + + rpc PersuadeEvilPlan(stream EvilRequest) returns (EvilResponse); +} + +message EvilRequest { + string malicious_idea = 1; +} + +message EvilResponse { + string malicious_plan = 1; +} \ No newline at end of file diff --git a/java-showcase-3.21.0/gapic-showcase/pom.xml b/java-showcase-3.21.0/gapic-showcase/pom.xml new file mode 100644 index 0000000000..cdd0f3d8b7 --- /dev/null +++ b/java-showcase-3.21.0/gapic-showcase/pom.xml @@ -0,0 +1,366 @@ + + + 4.0.0 + com.google.cloud + gapic-showcase + 0.0.1-SNAPSHOT + jar + GAPIC Showcase Client + + GAPIC Showcase is an API that demonstrates Generated API Client (GAPIC) features and common API + patterns used by Google. + + + com.google.cloud + gapic-showcase-parent + 0.0.1-SNAPSHOT + + + + 0.36.2 + + 1.2.13 + 1.5.25 + + + + + + org.jacoco + jacoco-maven-plugin + 0.8.13 + + + report + + report + + + + XML + HTML + + + + + + + com.spotify.fmt + fmt-maven-plugin + 2.25 + + (IT.*\.java)|(.*Test.java)|(TestClientInitializer.java) + + + + com.googlecode.maven-download-plugin + download-maven-plugin + 1.6.8 + + + download-compliance-suite + generate-test-resources + + wget + + + + https://raw.githubusercontent.com/googleapis/gapic-showcase/v${gapic-showcase.version}/server/services/compliance_suite.json + + src/test/resources + + true + + + + + + + + + + io.grpc + grpc-api + + + io.grpc + grpc-stub + + + io.grpc + grpc-protobuf + + + com.google.api + api-common + + + com.google.protobuf + protobuf-java + + + com.google.api.grpc + proto-google-common-protos + + + com.google.api.grpc + grpc-google-common-protos + test + + + com.google.api.grpc + proto-google-iam-v1 + + + com.google.api.grpc + proto-gapic-showcase-v1beta1 + + + com.google.guava + guava + + + com.google.api + gax + + + com.google.api + gax-grpc + + + com.google.api + gax-httpjson + + + + + org.junit.jupiter + junit-jupiter-engine + test + + + org.junit.vintage + junit-vintage-engine + test + + + org.junit.jupiter + junit-jupiter-params + test + + + com.google.truth + truth + 1.4.4 + + + junit + junit + + + test + + + + com.google.api.grpc + grpc-gapic-showcase-v1beta1 + test + + + + com.google.api + gax + test-jar + testlib + test + + + com.google.api + gax-grpc + test-jar + testlib + test + + + com.google.api + gax-httpjson + test-jar + testlib + test + + + com.google.auth + google-auth-library-oauth2-http + test-jar + testlib + test + + + com.google.api.grpc + grpc-google-iam-v1 + test + + + + + io.opentelemetry + opentelemetry-api + test + + + io.opentelemetry + opentelemetry-sdk + test + + + io.opentelemetry + opentelemetry-sdk-testing + test + + + + io.grpc + grpc-opentelemetry + test + + + + + + + + slf4j2_logback + + + + slf4j2_logback + + + + + org.slf4j + slf4j-api + 2.0.16 + test + + + ch.qos.logback + logback-classic + ${slf4j2-logback.version} + test + + + ch.qos.logback + logback-core + ${slf4j2-logback.version} + test + + + + + + org.apache.maven.plugins + maven-compiler-plugin + + + **/com/google/showcase/v1beta1/it/*.java + **/com/google/showcase/v1beta1/it/logging/ITLoggingDisabled.java + **/com/google/showcase/v1beta1/it/logging/ITLogging1x.java + + + + + + + + slf4j1_logback + + + + slf4j1_logback + + + + + org.slf4j + slf4j-api + 1.7.36 + test + + + ch.qos.logback + logback-classic + ${slf4j1-logback.version} + test + + + ch.qos.logback + logback-core + ${slf4j1-logback.version} + test + + + + + + org.apache.maven.plugins + maven-compiler-plugin + + + **/com/google/showcase/v1beta1/it/*.java + **/com/google/showcase/v1beta1/it/logging/ITLoggingDisabled.java + **/com/google/showcase/v1beta1/it/logging/ITLogging.java + + + + + + + + disabledLogging + + + + + disable_logging + + + + + org.slf4j + slf4j-api + 1.7.36 + test + + + ch.qos.logback + logback-classic + ${slf4j1-logback.version} + test + + + ch.qos.logback + logback-core + ${slf4j1-logback.version} + test + + + + + + org.apache.maven.plugins + maven-compiler-plugin + + + **/com/google/showcase/v1beta1/it/*.java + **/com/google/showcase/v1beta1/it/logging/ITLogging1x.java + **/com/google/showcase/v1beta1/it/logging/ITLogging.java + + + + + + + + + diff --git a/java-showcase-3.21.0/gapic-showcase/src/main/java/com/google/showcase/v1beta1/ComplianceClient.java b/java-showcase-3.21.0/gapic-showcase/src/main/java/com/google/showcase/v1beta1/ComplianceClient.java new file mode 100644 index 0000000000..2bd2776fd9 --- /dev/null +++ b/java-showcase-3.21.0/gapic-showcase/src/main/java/com/google/showcase/v1beta1/ComplianceClient.java @@ -0,0 +1,1595 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1; + +import com.google.api.core.ApiFuture; +import com.google.api.core.ApiFutures; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.paging.AbstractFixedSizeCollection; +import com.google.api.gax.paging.AbstractPage; +import com.google.api.gax.paging.AbstractPagedListResponse; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.common.util.concurrent.MoreExecutors; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.showcase.v1beta1.stub.ComplianceStub; +import com.google.showcase.v1beta1.stub.ComplianceStubSettings; +import java.io.IOException; +import java.util.List; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Service Description: This service is used to test that GAPICs implement various REST-related + * features correctly. This mostly means transcoding proto3 requests to REST format correctly for + * various types of HTTP annotations, but it also includes verifying that unknown (numeric) enums + * received by clients can be round-tripped correctly. + * + *

        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 (ComplianceClient complianceClient = ComplianceClient.create()) {
        + *   RepeatRequest request =
        + *       RepeatRequest.newBuilder()
        + *           .setName("name3373707")
        + *           .setInfo(ComplianceData.newBuilder().build())
        + *           .setServerVerify(true)
        + *           .setIntendedBindingUri("intendedBindingUri780142386")
        + *           .setFInt32(-1143775883)
        + *           .setFInt64(-1143775788)
        + *           .setFDouble(-1239459382)
        + *           .setPInt32(-858673665)
        + *           .setPInt64(-858673570)
        + *           .setPDouble(-991225216)
        + *           .build();
        + *   RepeatResponse response = complianceClient.repeatDataBody(request);
        + * }
        + * }
        + * + *

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

        RepeatDataBody

        This method echoes the ComplianceData request. This method exercises sending the entire request object in the REST body.

        + *

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

        + *
          + *
        • repeatDataBody(RepeatRequest request) + *

        + *

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

        + *
          + *
        • repeatDataBodyCallable() + *

        + *

        RepeatDataBodyInfo

        This method echoes the ComplianceData request. This method exercises sending the a message-type field in the REST body. Per AIP-127, only top-level, non-repeated fields can be sent this way.

        + *

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

        + *
          + *
        • repeatDataBodyInfo(RepeatRequest request) + *

        + *

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

        + *
          + *
        • repeatDataBodyInfoCallable() + *

        + *

        RepeatDataQuery

        This method echoes the ComplianceData request. This method exercises sending all request fields as query parameters.

        + *

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

        + *
          + *
        • repeatDataQuery(RepeatRequest request) + *

        + *

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

        + *
          + *
        • repeatDataQueryCallable() + *

        + *

        RepeatDataSimplePath

        This method echoes the ComplianceData request. This method exercises sending some parameters as "simple" path variables (i.e., of the form "/bar/{foo}" rather than "/{foo=bar/*}"), and the rest as query parameters.

        + *

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

        + *
          + *
        • repeatDataSimplePath(RepeatRequest request) + *

        + *

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

        + *
          + *
        • repeatDataSimplePathCallable() + *

        + *

        RepeatDataPathResource

        Same as RepeatDataSimplePath, but with a path resource.

        + *

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

        + *
          + *
        • repeatDataPathResource(RepeatRequest request) + *

        + *

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

        + *
          + *
        • repeatDataPathResourceCallable() + *

        + *

        RepeatDataPathTrailingResource

        Same as RepeatDataSimplePath, but with a trailing resource.

        + *

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

        + *
          + *
        • repeatDataPathTrailingResource(RepeatRequest request) + *

        + *

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

        + *
          + *
        • repeatDataPathTrailingResourceCallable() + *

        + *

        RepeatDataBodyPut

        This method echoes the ComplianceData request, using the HTTP PUT method.

        + *

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

        + *
          + *
        • repeatDataBodyPut(RepeatRequest request) + *

        + *

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

        + *
          + *
        • repeatDataBodyPutCallable() + *

        + *

        RepeatDataBodyPatch

        This method echoes the ComplianceData request, using the HTTP PATCH method.

        + *

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

        + *
          + *
        • repeatDataBodyPatch(RepeatRequest request) + *

        + *

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

        + *
          + *
        • repeatDataBodyPatchCallable() + *

        + *

        GetEnum

        This method requests an enum value from the server. Depending on the contents of EnumRequest, the enum value returned will be a known enum declared in the .proto file, or a made-up enum value the is unknown to the client. To verify that clients can round-trip unknown enum values they receive, use the response from this RPC as the request to VerifyEnum() + *

        The values of enums sent by the server when a known or unknown value is requested will be the same within a single Showcase server run (this is needed for VerifyEnum() to work) but are not guaranteed to be the same across separate Showcase server runs.

        + *

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

        + *
          + *
        • getEnum(EnumRequest request) + *

        + *

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

        + *
          + *
        • getEnumCallable() + *

        + *

        VerifyEnum

        This method is used to verify that clients can round-trip enum values, which is particularly important for unknown enum values over REST. VerifyEnum() verifies that its request, which is presumably the response that the client previously got to a GetEnum(), contains the correct data. If so, it responds with the same EnumResponse; otherwise, the RPC errors. + *

        This works because the values of enums sent by the server when a known or unknown value is requested will be the same within a single Showcase server run, although they are not guaranteed to be the same across separate Showcase server runs.

        + *

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

        + *
          + *
        • verifyEnum(EnumResponse request) + *

        + *

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

        + *
          + *
        • verifyEnumCallable() + *

        + *

        ListLocations

        Lists information about the supported locations for this service.

        + *

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

        + *
          + *
        • listLocations(ListLocationsRequest request) + *

        + *

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

        + *
          + *
        • listLocationsPagedCallable() + *

        • listLocationsCallable() + *

        + *

        GetLocation

        Gets information about a location.

        + *

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

        + *
          + *
        • getLocation(GetLocationRequest request) + *

        + *

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

        + *
          + *
        • getLocationCallable() + *

        + *

        SetIamPolicy

        Sets the access control policy on the specified resource. Replaces any existing policy. + *

        Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED` errors.

        + *

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

        + *
          + *
        • setIamPolicy(SetIamPolicyRequest request) + *

        + *

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

        + *
          + *
        • setIamPolicyCallable() + *

        + *

        GetIamPolicy

        Gets the access control policy for a resource. Returns an empty policy if the resource exists and does not have a policy set.

        + *

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

        + *
          + *
        • getIamPolicy(GetIamPolicyRequest request) + *

        + *

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

        + *
          + *
        • getIamPolicyCallable() + *

        + *

        TestIamPermissions

        Returns permissions that a caller has on the specified resource. If the resource does not exist, this will return an empty set of permissions, not a `NOT_FOUND` error. + *

        Note: This operation is designed to be used for building permission-aware UIs and command-line tools, not for authorization checking. This operation may "fail open" without warning.

        + *

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

        + *
          + *
        • testIamPermissions(TestIamPermissionsRequest request) + *

        + *

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

        + *
          + *
        • testIamPermissionsCallable() + *

        + *
        + * + *

        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 ComplianceSettings 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
        + * ComplianceSettings complianceSettings =
        + *     ComplianceSettings.newBuilder()
        + *         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
        + *         .build();
        + * ComplianceClient complianceClient = ComplianceClient.create(complianceSettings);
        + * }
        + * + *

        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
        + * ComplianceSettings complianceSettings =
        + *     ComplianceSettings.newBuilder().setEndpoint(myEndpoint).build();
        + * ComplianceClient complianceClient = ComplianceClient.create(complianceSettings);
        + * }
        + * + *

        To use REST (HTTP1.1/JSON) transport (instead of gRPC) for sending and receiving requests over + * the wire: + * + *

        {@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
        + * ComplianceSettings complianceSettings = ComplianceSettings.newHttpJsonBuilder().build();
        + * ComplianceClient complianceClient = ComplianceClient.create(complianceSettings);
        + * }
        + * + *

        Please refer to the GitHub repository's samples for more quickstart code snippets. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class ComplianceClient implements BackgroundResource { + private final ComplianceSettings settings; + private final ComplianceStub stub; + + /** Constructs an instance of ComplianceClient with default settings. */ + public static final ComplianceClient create() throws IOException { + return create(ComplianceSettings.newBuilder().build()); + } + + /** + * Constructs an instance of ComplianceClient, 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 ComplianceClient create(ComplianceSettings settings) throws IOException { + return new ComplianceClient(settings); + } + + /** + * Constructs an instance of ComplianceClient, using the given stub for making calls. This is for + * advanced usage - prefer using create(ComplianceSettings). + */ + public static final ComplianceClient create(ComplianceStub stub) { + return new ComplianceClient(stub); + } + + /** + * Constructs an instance of ComplianceClient, 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 ComplianceClient(ComplianceSettings settings) throws IOException { + this.settings = settings; + this.stub = ((ComplianceStubSettings) settings.getStubSettings()).createStub(); + } + + protected ComplianceClient(ComplianceStub stub) { + this.settings = null; + this.stub = stub; + } + + public final ComplianceSettings getSettings() { + return settings; + } + + public ComplianceStub getStub() { + return stub; + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * This method echoes the ComplianceData request. This method exercises sending the entire request + * object in the REST body. + * + *

        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 (ComplianceClient complianceClient = ComplianceClient.create()) {
        +   *   RepeatRequest request =
        +   *       RepeatRequest.newBuilder()
        +   *           .setName("name3373707")
        +   *           .setInfo(ComplianceData.newBuilder().build())
        +   *           .setServerVerify(true)
        +   *           .setIntendedBindingUri("intendedBindingUri780142386")
        +   *           .setFInt32(-1143775883)
        +   *           .setFInt64(-1143775788)
        +   *           .setFDouble(-1239459382)
        +   *           .setPInt32(-858673665)
        +   *           .setPInt64(-858673570)
        +   *           .setPDouble(-991225216)
        +   *           .build();
        +   *   RepeatResponse response = complianceClient.repeatDataBody(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 RepeatResponse repeatDataBody(RepeatRequest request) { + return repeatDataBodyCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * This method echoes the ComplianceData request. This method exercises sending the entire request + * object in the REST body. + * + *

        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 (ComplianceClient complianceClient = ComplianceClient.create()) {
        +   *   RepeatRequest request =
        +   *       RepeatRequest.newBuilder()
        +   *           .setName("name3373707")
        +   *           .setInfo(ComplianceData.newBuilder().build())
        +   *           .setServerVerify(true)
        +   *           .setIntendedBindingUri("intendedBindingUri780142386")
        +   *           .setFInt32(-1143775883)
        +   *           .setFInt64(-1143775788)
        +   *           .setFDouble(-1239459382)
        +   *           .setPInt32(-858673665)
        +   *           .setPInt64(-858673570)
        +   *           .setPDouble(-991225216)
        +   *           .build();
        +   *   ApiFuture future =
        +   *       complianceClient.repeatDataBodyCallable().futureCall(request);
        +   *   // Do something.
        +   *   RepeatResponse response = future.get();
        +   * }
        +   * }
        + */ + public final UnaryCallable repeatDataBodyCallable() { + return stub.repeatDataBodyCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * This method echoes the ComplianceData request. This method exercises sending the a message-type + * field in the REST body. Per AIP-127, only top-level, non-repeated fields can be sent this way. + * + *

        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 (ComplianceClient complianceClient = ComplianceClient.create()) {
        +   *   RepeatRequest request =
        +   *       RepeatRequest.newBuilder()
        +   *           .setName("name3373707")
        +   *           .setInfo(ComplianceData.newBuilder().build())
        +   *           .setServerVerify(true)
        +   *           .setIntendedBindingUri("intendedBindingUri780142386")
        +   *           .setFInt32(-1143775883)
        +   *           .setFInt64(-1143775788)
        +   *           .setFDouble(-1239459382)
        +   *           .setPInt32(-858673665)
        +   *           .setPInt64(-858673570)
        +   *           .setPDouble(-991225216)
        +   *           .build();
        +   *   RepeatResponse response = complianceClient.repeatDataBodyInfo(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 RepeatResponse repeatDataBodyInfo(RepeatRequest request) { + return repeatDataBodyInfoCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * This method echoes the ComplianceData request. This method exercises sending the a message-type + * field in the REST body. Per AIP-127, only top-level, non-repeated fields can be sent this way. + * + *

        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 (ComplianceClient complianceClient = ComplianceClient.create()) {
        +   *   RepeatRequest request =
        +   *       RepeatRequest.newBuilder()
        +   *           .setName("name3373707")
        +   *           .setInfo(ComplianceData.newBuilder().build())
        +   *           .setServerVerify(true)
        +   *           .setIntendedBindingUri("intendedBindingUri780142386")
        +   *           .setFInt32(-1143775883)
        +   *           .setFInt64(-1143775788)
        +   *           .setFDouble(-1239459382)
        +   *           .setPInt32(-858673665)
        +   *           .setPInt64(-858673570)
        +   *           .setPDouble(-991225216)
        +   *           .build();
        +   *   ApiFuture future =
        +   *       complianceClient.repeatDataBodyInfoCallable().futureCall(request);
        +   *   // Do something.
        +   *   RepeatResponse response = future.get();
        +   * }
        +   * }
        + */ + public final UnaryCallable repeatDataBodyInfoCallable() { + return stub.repeatDataBodyInfoCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * This method echoes the ComplianceData request. This method exercises sending all request fields + * as query parameters. + * + *

        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 (ComplianceClient complianceClient = ComplianceClient.create()) {
        +   *   RepeatRequest request =
        +   *       RepeatRequest.newBuilder()
        +   *           .setName("name3373707")
        +   *           .setInfo(ComplianceData.newBuilder().build())
        +   *           .setServerVerify(true)
        +   *           .setIntendedBindingUri("intendedBindingUri780142386")
        +   *           .setFInt32(-1143775883)
        +   *           .setFInt64(-1143775788)
        +   *           .setFDouble(-1239459382)
        +   *           .setPInt32(-858673665)
        +   *           .setPInt64(-858673570)
        +   *           .setPDouble(-991225216)
        +   *           .build();
        +   *   RepeatResponse response = complianceClient.repeatDataQuery(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 RepeatResponse repeatDataQuery(RepeatRequest request) { + return repeatDataQueryCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * This method echoes the ComplianceData request. This method exercises sending all request fields + * as query parameters. + * + *

        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 (ComplianceClient complianceClient = ComplianceClient.create()) {
        +   *   RepeatRequest request =
        +   *       RepeatRequest.newBuilder()
        +   *           .setName("name3373707")
        +   *           .setInfo(ComplianceData.newBuilder().build())
        +   *           .setServerVerify(true)
        +   *           .setIntendedBindingUri("intendedBindingUri780142386")
        +   *           .setFInt32(-1143775883)
        +   *           .setFInt64(-1143775788)
        +   *           .setFDouble(-1239459382)
        +   *           .setPInt32(-858673665)
        +   *           .setPInt64(-858673570)
        +   *           .setPDouble(-991225216)
        +   *           .build();
        +   *   ApiFuture future =
        +   *       complianceClient.repeatDataQueryCallable().futureCall(request);
        +   *   // Do something.
        +   *   RepeatResponse response = future.get();
        +   * }
        +   * }
        + */ + public final UnaryCallable repeatDataQueryCallable() { + return stub.repeatDataQueryCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * This method echoes the ComplianceData request. This method exercises sending some parameters as + * "simple" path variables (i.e., of the form "/bar/{foo}" rather than "/{foo=bar/*}"), and + * the rest as query parameters. + * + *

        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 (ComplianceClient complianceClient = ComplianceClient.create()) {
        +   *   RepeatRequest request =
        +   *       RepeatRequest.newBuilder()
        +   *           .setName("name3373707")
        +   *           .setInfo(ComplianceData.newBuilder().build())
        +   *           .setServerVerify(true)
        +   *           .setIntendedBindingUri("intendedBindingUri780142386")
        +   *           .setFInt32(-1143775883)
        +   *           .setFInt64(-1143775788)
        +   *           .setFDouble(-1239459382)
        +   *           .setPInt32(-858673665)
        +   *           .setPInt64(-858673570)
        +   *           .setPDouble(-991225216)
        +   *           .build();
        +   *   RepeatResponse response = complianceClient.repeatDataSimplePath(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 RepeatResponse repeatDataSimplePath(RepeatRequest request) { + return repeatDataSimplePathCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * This method echoes the ComplianceData request. This method exercises sending some parameters as + * "simple" path variables (i.e., of the form "/bar/{foo}" rather than "/{foo=bar/*}"), and + * the rest as query parameters. + * + *

        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 (ComplianceClient complianceClient = ComplianceClient.create()) {
        +   *   RepeatRequest request =
        +   *       RepeatRequest.newBuilder()
        +   *           .setName("name3373707")
        +   *           .setInfo(ComplianceData.newBuilder().build())
        +   *           .setServerVerify(true)
        +   *           .setIntendedBindingUri("intendedBindingUri780142386")
        +   *           .setFInt32(-1143775883)
        +   *           .setFInt64(-1143775788)
        +   *           .setFDouble(-1239459382)
        +   *           .setPInt32(-858673665)
        +   *           .setPInt64(-858673570)
        +   *           .setPDouble(-991225216)
        +   *           .build();
        +   *   ApiFuture future =
        +   *       complianceClient.repeatDataSimplePathCallable().futureCall(request);
        +   *   // Do something.
        +   *   RepeatResponse response = future.get();
        +   * }
        +   * }
        + */ + public final UnaryCallable repeatDataSimplePathCallable() { + return stub.repeatDataSimplePathCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Same as RepeatDataSimplePath, but with a path 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 (ComplianceClient complianceClient = ComplianceClient.create()) {
        +   *   RepeatRequest request =
        +   *       RepeatRequest.newBuilder()
        +   *           .setName("name3373707")
        +   *           .setInfo(ComplianceData.newBuilder().build())
        +   *           .setServerVerify(true)
        +   *           .setIntendedBindingUri("intendedBindingUri780142386")
        +   *           .setFInt32(-1143775883)
        +   *           .setFInt64(-1143775788)
        +   *           .setFDouble(-1239459382)
        +   *           .setPInt32(-858673665)
        +   *           .setPInt64(-858673570)
        +   *           .setPDouble(-991225216)
        +   *           .build();
        +   *   RepeatResponse response = complianceClient.repeatDataPathResource(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 RepeatResponse repeatDataPathResource(RepeatRequest request) { + return repeatDataPathResourceCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Same as RepeatDataSimplePath, but with a path 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 (ComplianceClient complianceClient = ComplianceClient.create()) {
        +   *   RepeatRequest request =
        +   *       RepeatRequest.newBuilder()
        +   *           .setName("name3373707")
        +   *           .setInfo(ComplianceData.newBuilder().build())
        +   *           .setServerVerify(true)
        +   *           .setIntendedBindingUri("intendedBindingUri780142386")
        +   *           .setFInt32(-1143775883)
        +   *           .setFInt64(-1143775788)
        +   *           .setFDouble(-1239459382)
        +   *           .setPInt32(-858673665)
        +   *           .setPInt64(-858673570)
        +   *           .setPDouble(-991225216)
        +   *           .build();
        +   *   ApiFuture future =
        +   *       complianceClient.repeatDataPathResourceCallable().futureCall(request);
        +   *   // Do something.
        +   *   RepeatResponse response = future.get();
        +   * }
        +   * }
        + */ + public final UnaryCallable repeatDataPathResourceCallable() { + return stub.repeatDataPathResourceCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Same as RepeatDataSimplePath, but with a trailing 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 (ComplianceClient complianceClient = ComplianceClient.create()) {
        +   *   RepeatRequest request =
        +   *       RepeatRequest.newBuilder()
        +   *           .setName("name3373707")
        +   *           .setInfo(ComplianceData.newBuilder().build())
        +   *           .setServerVerify(true)
        +   *           .setIntendedBindingUri("intendedBindingUri780142386")
        +   *           .setFInt32(-1143775883)
        +   *           .setFInt64(-1143775788)
        +   *           .setFDouble(-1239459382)
        +   *           .setPInt32(-858673665)
        +   *           .setPInt64(-858673570)
        +   *           .setPDouble(-991225216)
        +   *           .build();
        +   *   RepeatResponse response = complianceClient.repeatDataPathTrailingResource(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 RepeatResponse repeatDataPathTrailingResource(RepeatRequest request) { + return repeatDataPathTrailingResourceCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Same as RepeatDataSimplePath, but with a trailing 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 (ComplianceClient complianceClient = ComplianceClient.create()) {
        +   *   RepeatRequest request =
        +   *       RepeatRequest.newBuilder()
        +   *           .setName("name3373707")
        +   *           .setInfo(ComplianceData.newBuilder().build())
        +   *           .setServerVerify(true)
        +   *           .setIntendedBindingUri("intendedBindingUri780142386")
        +   *           .setFInt32(-1143775883)
        +   *           .setFInt64(-1143775788)
        +   *           .setFDouble(-1239459382)
        +   *           .setPInt32(-858673665)
        +   *           .setPInt64(-858673570)
        +   *           .setPDouble(-991225216)
        +   *           .build();
        +   *   ApiFuture future =
        +   *       complianceClient.repeatDataPathTrailingResourceCallable().futureCall(request);
        +   *   // Do something.
        +   *   RepeatResponse response = future.get();
        +   * }
        +   * }
        + */ + public final UnaryCallable + repeatDataPathTrailingResourceCallable() { + return stub.repeatDataPathTrailingResourceCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * This method echoes the ComplianceData request, using the HTTP PUT method. + * + *

        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 (ComplianceClient complianceClient = ComplianceClient.create()) {
        +   *   RepeatRequest request =
        +   *       RepeatRequest.newBuilder()
        +   *           .setName("name3373707")
        +   *           .setInfo(ComplianceData.newBuilder().build())
        +   *           .setServerVerify(true)
        +   *           .setIntendedBindingUri("intendedBindingUri780142386")
        +   *           .setFInt32(-1143775883)
        +   *           .setFInt64(-1143775788)
        +   *           .setFDouble(-1239459382)
        +   *           .setPInt32(-858673665)
        +   *           .setPInt64(-858673570)
        +   *           .setPDouble(-991225216)
        +   *           .build();
        +   *   RepeatResponse response = complianceClient.repeatDataBodyPut(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 RepeatResponse repeatDataBodyPut(RepeatRequest request) { + return repeatDataBodyPutCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * This method echoes the ComplianceData request, using the HTTP PUT method. + * + *

        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 (ComplianceClient complianceClient = ComplianceClient.create()) {
        +   *   RepeatRequest request =
        +   *       RepeatRequest.newBuilder()
        +   *           .setName("name3373707")
        +   *           .setInfo(ComplianceData.newBuilder().build())
        +   *           .setServerVerify(true)
        +   *           .setIntendedBindingUri("intendedBindingUri780142386")
        +   *           .setFInt32(-1143775883)
        +   *           .setFInt64(-1143775788)
        +   *           .setFDouble(-1239459382)
        +   *           .setPInt32(-858673665)
        +   *           .setPInt64(-858673570)
        +   *           .setPDouble(-991225216)
        +   *           .build();
        +   *   ApiFuture future =
        +   *       complianceClient.repeatDataBodyPutCallable().futureCall(request);
        +   *   // Do something.
        +   *   RepeatResponse response = future.get();
        +   * }
        +   * }
        + */ + public final UnaryCallable repeatDataBodyPutCallable() { + return stub.repeatDataBodyPutCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * This method echoes the ComplianceData request, using the HTTP PATCH method. + * + *

        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 (ComplianceClient complianceClient = ComplianceClient.create()) {
        +   *   RepeatRequest request =
        +   *       RepeatRequest.newBuilder()
        +   *           .setName("name3373707")
        +   *           .setInfo(ComplianceData.newBuilder().build())
        +   *           .setServerVerify(true)
        +   *           .setIntendedBindingUri("intendedBindingUri780142386")
        +   *           .setFInt32(-1143775883)
        +   *           .setFInt64(-1143775788)
        +   *           .setFDouble(-1239459382)
        +   *           .setPInt32(-858673665)
        +   *           .setPInt64(-858673570)
        +   *           .setPDouble(-991225216)
        +   *           .build();
        +   *   RepeatResponse response = complianceClient.repeatDataBodyPatch(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 RepeatResponse repeatDataBodyPatch(RepeatRequest request) { + return repeatDataBodyPatchCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * This method echoes the ComplianceData request, using the HTTP PATCH method. + * + *

        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 (ComplianceClient complianceClient = ComplianceClient.create()) {
        +   *   RepeatRequest request =
        +   *       RepeatRequest.newBuilder()
        +   *           .setName("name3373707")
        +   *           .setInfo(ComplianceData.newBuilder().build())
        +   *           .setServerVerify(true)
        +   *           .setIntendedBindingUri("intendedBindingUri780142386")
        +   *           .setFInt32(-1143775883)
        +   *           .setFInt64(-1143775788)
        +   *           .setFDouble(-1239459382)
        +   *           .setPInt32(-858673665)
        +   *           .setPInt64(-858673570)
        +   *           .setPDouble(-991225216)
        +   *           .build();
        +   *   ApiFuture future =
        +   *       complianceClient.repeatDataBodyPatchCallable().futureCall(request);
        +   *   // Do something.
        +   *   RepeatResponse response = future.get();
        +   * }
        +   * }
        + */ + public final UnaryCallable repeatDataBodyPatchCallable() { + return stub.repeatDataBodyPatchCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * This method requests an enum value from the server. Depending on the contents of EnumRequest, + * the enum value returned will be a known enum declared in the .proto file, or a made-up enum + * value the is unknown to the client. To verify that clients can round-trip unknown enum values + * they receive, use the response from this RPC as the request to VerifyEnum() + * + *

        The values of enums sent by the server when a known or unknown value is requested will be + * the same within a single Showcase server run (this is needed for VerifyEnum() to work) but are + * not guaranteed to be the same across separate Showcase server runs. + * + *

        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 (ComplianceClient complianceClient = ComplianceClient.create()) {
        +   *   EnumRequest request = EnumRequest.newBuilder().setUnknownEnum(true).build();
        +   *   EnumResponse response = complianceClient.getEnum(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 EnumResponse getEnum(EnumRequest request) { + return getEnumCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * This method requests an enum value from the server. Depending on the contents of EnumRequest, + * the enum value returned will be a known enum declared in the .proto file, or a made-up enum + * value the is unknown to the client. To verify that clients can round-trip unknown enum values + * they receive, use the response from this RPC as the request to VerifyEnum() + * + *

        The values of enums sent by the server when a known or unknown value is requested will be + * the same within a single Showcase server run (this is needed for VerifyEnum() to work) but are + * not guaranteed to be the same across separate Showcase server runs. + * + *

        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 (ComplianceClient complianceClient = ComplianceClient.create()) {
        +   *   EnumRequest request = EnumRequest.newBuilder().setUnknownEnum(true).build();
        +   *   ApiFuture future = complianceClient.getEnumCallable().futureCall(request);
        +   *   // Do something.
        +   *   EnumResponse response = future.get();
        +   * }
        +   * }
        + */ + public final UnaryCallable getEnumCallable() { + return stub.getEnumCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * This method is used to verify that clients can round-trip enum values, which is particularly + * important for unknown enum values over REST. VerifyEnum() verifies that its request, which is + * presumably the response that the client previously got to a GetEnum(), contains the correct + * data. If so, it responds with the same EnumResponse; otherwise, the RPC errors. + * + *

        This works because the values of enums sent by the server when a known or unknown value is + * requested will be the same within a single Showcase server run, although they are not + * guaranteed to be the same across separate Showcase server runs. + * + *

        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 (ComplianceClient complianceClient = ComplianceClient.create()) {
        +   *   EnumResponse request =
        +   *       EnumResponse.newBuilder()
        +   *           .setRequest(EnumRequest.newBuilder().build())
        +   *           .setContinent(Continent.forNumber(0))
        +   *           .build();
        +   *   EnumResponse response = complianceClient.verifyEnum(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 EnumResponse verifyEnum(EnumResponse request) { + return verifyEnumCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * This method is used to verify that clients can round-trip enum values, which is particularly + * important for unknown enum values over REST. VerifyEnum() verifies that its request, which is + * presumably the response that the client previously got to a GetEnum(), contains the correct + * data. If so, it responds with the same EnumResponse; otherwise, the RPC errors. + * + *

        This works because the values of enums sent by the server when a known or unknown value is + * requested will be the same within a single Showcase server run, although they are not + * guaranteed to be the same across separate Showcase server runs. + * + *

        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 (ComplianceClient complianceClient = ComplianceClient.create()) {
        +   *   EnumResponse request =
        +   *       EnumResponse.newBuilder()
        +   *           .setRequest(EnumRequest.newBuilder().build())
        +   *           .setContinent(Continent.forNumber(0))
        +   *           .build();
        +   *   ApiFuture future = complianceClient.verifyEnumCallable().futureCall(request);
        +   *   // Do something.
        +   *   EnumResponse response = future.get();
        +   * }
        +   * }
        + */ + public final UnaryCallable verifyEnumCallable() { + return stub.verifyEnumCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists information about the supported locations for this service. + * + *

        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 (ComplianceClient complianceClient = ComplianceClient.create()) {
        +   *   ListLocationsRequest request =
        +   *       ListLocationsRequest.newBuilder()
        +   *           .setName("name3373707")
        +   *           .setFilter("filter-1274492040")
        +   *           .setPageSize(883849137)
        +   *           .setPageToken("pageToken873572522")
        +   *           .build();
        +   *   for (Location element : complianceClient.listLocations(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 ListLocationsPagedResponse listLocations(ListLocationsRequest request) { + return listLocationsPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists information about the supported locations for this service. + * + *

        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 (ComplianceClient complianceClient = ComplianceClient.create()) {
        +   *   ListLocationsRequest request =
        +   *       ListLocationsRequest.newBuilder()
        +   *           .setName("name3373707")
        +   *           .setFilter("filter-1274492040")
        +   *           .setPageSize(883849137)
        +   *           .setPageToken("pageToken873572522")
        +   *           .build();
        +   *   ApiFuture future =
        +   *       complianceClient.listLocationsPagedCallable().futureCall(request);
        +   *   // Do something.
        +   *   for (Location element : future.get().iterateAll()) {
        +   *     // doThingsWith(element);
        +   *   }
        +   * }
        +   * }
        + */ + public final UnaryCallable + listLocationsPagedCallable() { + return stub.listLocationsPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists information about the supported locations for this service. + * + *

        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 (ComplianceClient complianceClient = ComplianceClient.create()) {
        +   *   ListLocationsRequest request =
        +   *       ListLocationsRequest.newBuilder()
        +   *           .setName("name3373707")
        +   *           .setFilter("filter-1274492040")
        +   *           .setPageSize(883849137)
        +   *           .setPageToken("pageToken873572522")
        +   *           .build();
        +   *   while (true) {
        +   *     ListLocationsResponse response = complianceClient.listLocationsCallable().call(request);
        +   *     for (Location element : response.getLocationsList()) {
        +   *       // doThingsWith(element);
        +   *     }
        +   *     String nextPageToken = response.getNextPageToken();
        +   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
        +   *       request = request.toBuilder().setPageToken(nextPageToken).build();
        +   *     } else {
        +   *       break;
        +   *     }
        +   *   }
        +   * }
        +   * }
        + */ + public final UnaryCallable listLocationsCallable() { + return stub.listLocationsCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets information about a location. + * + *

        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 (ComplianceClient complianceClient = ComplianceClient.create()) {
        +   *   GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build();
        +   *   Location response = complianceClient.getLocation(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 Location getLocation(GetLocationRequest request) { + return getLocationCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets information about a location. + * + *

        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 (ComplianceClient complianceClient = ComplianceClient.create()) {
        +   *   GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build();
        +   *   ApiFuture future = complianceClient.getLocationCallable().futureCall(request);
        +   *   // Do something.
        +   *   Location response = future.get();
        +   * }
        +   * }
        + */ + public final UnaryCallable getLocationCallable() { + return stub.getLocationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Sets the access control policy on the specified resource. Replaces any existing policy. + * + *

        Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED` errors. + * + *

        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 (ComplianceClient complianceClient = ComplianceClient.create()) {
        +   *   SetIamPolicyRequest request =
        +   *       SetIamPolicyRequest.newBuilder()
        +   *           .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString())
        +   *           .setPolicy(Policy.newBuilder().build())
        +   *           .setUpdateMask(FieldMask.newBuilder().build())
        +   *           .build();
        +   *   Policy response = complianceClient.setIamPolicy(request);
        +   * }
        +   * }
        + * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Policy setIamPolicy(SetIamPolicyRequest request) { + return setIamPolicyCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Sets the access control policy on the specified resource. Replaces any existing policy. + * + *

        Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED` errors. + * + *

        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 (ComplianceClient complianceClient = ComplianceClient.create()) {
        +   *   SetIamPolicyRequest request =
        +   *       SetIamPolicyRequest.newBuilder()
        +   *           .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString())
        +   *           .setPolicy(Policy.newBuilder().build())
        +   *           .setUpdateMask(FieldMask.newBuilder().build())
        +   *           .build();
        +   *   ApiFuture future = complianceClient.setIamPolicyCallable().futureCall(request);
        +   *   // Do something.
        +   *   Policy response = future.get();
        +   * }
        +   * }
        + */ + public final UnaryCallable setIamPolicyCallable() { + return stub.setIamPolicyCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets the access control policy for a resource. Returns an empty policy if the resource exists + * and does not have a policy set. + * + *

        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 (ComplianceClient complianceClient = ComplianceClient.create()) {
        +   *   GetIamPolicyRequest request =
        +   *       GetIamPolicyRequest.newBuilder()
        +   *           .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString())
        +   *           .setOptions(GetPolicyOptions.newBuilder().build())
        +   *           .build();
        +   *   Policy response = complianceClient.getIamPolicy(request);
        +   * }
        +   * }
        + * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Policy getIamPolicy(GetIamPolicyRequest request) { + return getIamPolicyCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets the access control policy for a resource. Returns an empty policy if the resource exists + * and does not have a policy set. + * + *

        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 (ComplianceClient complianceClient = ComplianceClient.create()) {
        +   *   GetIamPolicyRequest request =
        +   *       GetIamPolicyRequest.newBuilder()
        +   *           .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString())
        +   *           .setOptions(GetPolicyOptions.newBuilder().build())
        +   *           .build();
        +   *   ApiFuture future = complianceClient.getIamPolicyCallable().futureCall(request);
        +   *   // Do something.
        +   *   Policy response = future.get();
        +   * }
        +   * }
        + */ + public final UnaryCallable getIamPolicyCallable() { + return stub.getIamPolicyCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Returns permissions that a caller has on the specified resource. If the resource does not + * exist, this will return an empty set of permissions, not a `NOT_FOUND` error. + * + *

        Note: This operation is designed to be used for building permission-aware UIs and + * command-line tools, not for authorization checking. This operation may "fail open" without + * warning. + * + *

        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 (ComplianceClient complianceClient = ComplianceClient.create()) {
        +   *   TestIamPermissionsRequest request =
        +   *       TestIamPermissionsRequest.newBuilder()
        +   *           .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString())
        +   *           .addAllPermissions(new ArrayList())
        +   *           .build();
        +   *   TestIamPermissionsResponse response = complianceClient.testIamPermissions(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 TestIamPermissionsResponse testIamPermissions(TestIamPermissionsRequest request) { + return testIamPermissionsCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Returns permissions that a caller has on the specified resource. If the resource does not + * exist, this will return an empty set of permissions, not a `NOT_FOUND` error. + * + *

        Note: This operation is designed to be used for building permission-aware UIs and + * command-line tools, not for authorization checking. This operation may "fail open" without + * warning. + * + *

        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 (ComplianceClient complianceClient = ComplianceClient.create()) {
        +   *   TestIamPermissionsRequest request =
        +   *       TestIamPermissionsRequest.newBuilder()
        +   *           .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString())
        +   *           .addAllPermissions(new ArrayList())
        +   *           .build();
        +   *   ApiFuture future =
        +   *       complianceClient.testIamPermissionsCallable().futureCall(request);
        +   *   // Do something.
        +   *   TestIamPermissionsResponse response = future.get();
        +   * }
        +   * }
        + */ + public final UnaryCallable + testIamPermissionsCallable() { + return stub.testIamPermissionsCallable(); + } + + @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 ListLocationsPagedResponse + extends AbstractPagedListResponse< + ListLocationsRequest, + ListLocationsResponse, + Location, + ListLocationsPage, + ListLocationsFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListLocationsPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + input -> new ListLocationsPagedResponse(input), + MoreExecutors.directExecutor()); + } + + private ListLocationsPagedResponse(ListLocationsPage page) { + super(page, ListLocationsFixedSizeCollection.createEmptyCollection()); + } + } + + public static class ListLocationsPage + extends AbstractPage< + ListLocationsRequest, ListLocationsResponse, Location, ListLocationsPage> { + + private ListLocationsPage( + PageContext context, + ListLocationsResponse response) { + super(context, response); + } + + private static ListLocationsPage createEmptyPage() { + return new ListLocationsPage(null, null); + } + + @Override + protected ListLocationsPage createPage( + PageContext context, + ListLocationsResponse response) { + return new ListLocationsPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class ListLocationsFixedSizeCollection + extends AbstractFixedSizeCollection< + ListLocationsRequest, + ListLocationsResponse, + Location, + ListLocationsPage, + ListLocationsFixedSizeCollection> { + + private ListLocationsFixedSizeCollection(List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListLocationsFixedSizeCollection createEmptyCollection() { + return new ListLocationsFixedSizeCollection(null, 0); + } + + @Override + protected ListLocationsFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListLocationsFixedSizeCollection(pages, collectionSize); + } + } +} diff --git a/java-showcase-3.21.0/gapic-showcase/src/main/java/com/google/showcase/v1beta1/ComplianceSettings.java b/java-showcase-3.21.0/gapic-showcase/src/main/java/com/google/showcase/v1beta1/ComplianceSettings.java new file mode 100644 index 0000000000..b96f3fcdbe --- /dev/null +++ b/java-showcase-3.21.0/gapic-showcase/src/main/java/com/google/showcase/v1beta1/ComplianceSettings.java @@ -0,0 +1,373 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1; + +import static com.google.showcase.v1beta1.ComplianceClient.ListLocationsPagedResponse; + +import com.google.api.core.ApiFunction; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; +import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; +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.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.showcase.v1beta1.stub.ComplianceStubSettings; +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 ComplianceClient}. + * + *

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

          + *
        • The default service address (localhost) and default port (7469) 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 repeatDataBody: + * + *

        {@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
        + * ComplianceSettings.Builder complianceSettingsBuilder = ComplianceSettings.newBuilder();
        + * complianceSettingsBuilder
        + *     .repeatDataBodySettings()
        + *     .setRetrySettings(
        + *         complianceSettingsBuilder
        + *             .repeatDataBodySettings()
        + *             .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());
        + * ComplianceSettings complianceSettings = complianceSettingsBuilder.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. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class ComplianceSettings extends ClientSettings { + + /** Returns the object with the settings used for calls to repeatDataBody. */ + public UnaryCallSettings repeatDataBodySettings() { + return ((ComplianceStubSettings) getStubSettings()).repeatDataBodySettings(); + } + + /** Returns the object with the settings used for calls to repeatDataBodyInfo. */ + public UnaryCallSettings repeatDataBodyInfoSettings() { + return ((ComplianceStubSettings) getStubSettings()).repeatDataBodyInfoSettings(); + } + + /** Returns the object with the settings used for calls to repeatDataQuery. */ + public UnaryCallSettings repeatDataQuerySettings() { + return ((ComplianceStubSettings) getStubSettings()).repeatDataQuerySettings(); + } + + /** Returns the object with the settings used for calls to repeatDataSimplePath. */ + public UnaryCallSettings repeatDataSimplePathSettings() { + return ((ComplianceStubSettings) getStubSettings()).repeatDataSimplePathSettings(); + } + + /** Returns the object with the settings used for calls to repeatDataPathResource. */ + public UnaryCallSettings repeatDataPathResourceSettings() { + return ((ComplianceStubSettings) getStubSettings()).repeatDataPathResourceSettings(); + } + + /** Returns the object with the settings used for calls to repeatDataPathTrailingResource. */ + public UnaryCallSettings repeatDataPathTrailingResourceSettings() { + return ((ComplianceStubSettings) getStubSettings()).repeatDataPathTrailingResourceSettings(); + } + + /** Returns the object with the settings used for calls to repeatDataBodyPut. */ + public UnaryCallSettings repeatDataBodyPutSettings() { + return ((ComplianceStubSettings) getStubSettings()).repeatDataBodyPutSettings(); + } + + /** Returns the object with the settings used for calls to repeatDataBodyPatch. */ + public UnaryCallSettings repeatDataBodyPatchSettings() { + return ((ComplianceStubSettings) getStubSettings()).repeatDataBodyPatchSettings(); + } + + /** Returns the object with the settings used for calls to getEnum. */ + public UnaryCallSettings getEnumSettings() { + return ((ComplianceStubSettings) getStubSettings()).getEnumSettings(); + } + + /** Returns the object with the settings used for calls to verifyEnum. */ + public UnaryCallSettings verifyEnumSettings() { + return ((ComplianceStubSettings) getStubSettings()).verifyEnumSettings(); + } + + /** Returns the object with the settings used for calls to listLocations. */ + public PagedCallSettings + listLocationsSettings() { + return ((ComplianceStubSettings) getStubSettings()).listLocationsSettings(); + } + + /** Returns the object with the settings used for calls to getLocation. */ + public UnaryCallSettings getLocationSettings() { + return ((ComplianceStubSettings) getStubSettings()).getLocationSettings(); + } + + /** Returns the object with the settings used for calls to setIamPolicy. */ + public UnaryCallSettings setIamPolicySettings() { + return ((ComplianceStubSettings) getStubSettings()).setIamPolicySettings(); + } + + /** Returns the object with the settings used for calls to getIamPolicy. */ + public UnaryCallSettings getIamPolicySettings() { + return ((ComplianceStubSettings) getStubSettings()).getIamPolicySettings(); + } + + /** Returns the object with the settings used for calls to testIamPermissions. */ + public UnaryCallSettings + testIamPermissionsSettings() { + return ((ComplianceStubSettings) getStubSettings()).testIamPermissionsSettings(); + } + + public static final ComplianceSettings create(ComplianceStubSettings stub) throws IOException { + return new ComplianceSettings.Builder(stub.toBuilder()).build(); + } + + /** Returns a builder for the default ExecutorProvider for this service. */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return ComplianceStubSettings.defaultExecutorProviderBuilder(); + } + + /** Returns the default service endpoint. */ + public static String getDefaultEndpoint() { + return ComplianceStubSettings.getDefaultEndpoint(); + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return ComplianceStubSettings.getDefaultServiceScopes(); + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return ComplianceStubSettings.defaultCredentialsProviderBuilder(); + } + + /** Returns a builder for the default gRPC ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return ComplianceStubSettings.defaultGrpcTransportProviderBuilder(); + } + + /** Returns a builder for the default REST ChannelProvider for this service. */ + @BetaApi + public static InstantiatingHttpJsonChannelProvider.Builder + defaultHttpJsonTransportProviderBuilder() { + return ComplianceStubSettings.defaultHttpJsonTransportProviderBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return ComplianceStubSettings.defaultTransportChannelProvider(); + } + + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return ComplianceStubSettings.defaultApiClientHeaderProviderBuilder(); + } + + /** Returns a new gRPC builder for this class. */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** Returns a new REST builder for this class. */ + public static Builder newHttpJsonBuilder() { + return Builder.createHttpJsonDefault(); + } + + /** 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 ComplianceSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + } + + /** Builder for ComplianceSettings. */ + public static class Builder extends ClientSettings.Builder { + + protected Builder() throws IOException { + this(((ClientContext) null)); + } + + protected Builder(ClientContext clientContext) { + super(ComplianceStubSettings.newBuilder(clientContext)); + } + + protected Builder(ComplianceSettings settings) { + super(settings.getStubSettings().toBuilder()); + } + + protected Builder(ComplianceStubSettings.Builder stubSettings) { + super(stubSettings); + } + + private static Builder createDefault() { + return new Builder(ComplianceStubSettings.newBuilder()); + } + + private static Builder createHttpJsonDefault() { + return new Builder(ComplianceStubSettings.newHttpJsonBuilder()); + } + + public ComplianceStubSettings.Builder getStubSettingsBuilder() { + return ((ComplianceStubSettings.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 repeatDataBody. */ + public UnaryCallSettings.Builder repeatDataBodySettings() { + return getStubSettingsBuilder().repeatDataBodySettings(); + } + + /** Returns the builder for the settings used for calls to repeatDataBodyInfo. */ + public UnaryCallSettings.Builder repeatDataBodyInfoSettings() { + return getStubSettingsBuilder().repeatDataBodyInfoSettings(); + } + + /** Returns the builder for the settings used for calls to repeatDataQuery. */ + public UnaryCallSettings.Builder repeatDataQuerySettings() { + return getStubSettingsBuilder().repeatDataQuerySettings(); + } + + /** Returns the builder for the settings used for calls to repeatDataSimplePath. */ + public UnaryCallSettings.Builder repeatDataSimplePathSettings() { + return getStubSettingsBuilder().repeatDataSimplePathSettings(); + } + + /** Returns the builder for the settings used for calls to repeatDataPathResource. */ + public UnaryCallSettings.Builder + repeatDataPathResourceSettings() { + return getStubSettingsBuilder().repeatDataPathResourceSettings(); + } + + /** Returns the builder for the settings used for calls to repeatDataPathTrailingResource. */ + public UnaryCallSettings.Builder + repeatDataPathTrailingResourceSettings() { + return getStubSettingsBuilder().repeatDataPathTrailingResourceSettings(); + } + + /** Returns the builder for the settings used for calls to repeatDataBodyPut. */ + public UnaryCallSettings.Builder repeatDataBodyPutSettings() { + return getStubSettingsBuilder().repeatDataBodyPutSettings(); + } + + /** Returns the builder for the settings used for calls to repeatDataBodyPatch. */ + public UnaryCallSettings.Builder repeatDataBodyPatchSettings() { + return getStubSettingsBuilder().repeatDataBodyPatchSettings(); + } + + /** Returns the builder for the settings used for calls to getEnum. */ + public UnaryCallSettings.Builder getEnumSettings() { + return getStubSettingsBuilder().getEnumSettings(); + } + + /** Returns the builder for the settings used for calls to verifyEnum. */ + public UnaryCallSettings.Builder verifyEnumSettings() { + return getStubSettingsBuilder().verifyEnumSettings(); + } + + /** Returns the builder for the settings used for calls to listLocations. */ + public PagedCallSettings.Builder< + ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse> + listLocationsSettings() { + return getStubSettingsBuilder().listLocationsSettings(); + } + + /** Returns the builder for the settings used for calls to getLocation. */ + public UnaryCallSettings.Builder getLocationSettings() { + return getStubSettingsBuilder().getLocationSettings(); + } + + /** Returns the builder for the settings used for calls to setIamPolicy. */ + public UnaryCallSettings.Builder setIamPolicySettings() { + return getStubSettingsBuilder().setIamPolicySettings(); + } + + /** Returns the builder for the settings used for calls to getIamPolicy. */ + public UnaryCallSettings.Builder getIamPolicySettings() { + return getStubSettingsBuilder().getIamPolicySettings(); + } + + /** Returns the builder for the settings used for calls to testIamPermissions. */ + public UnaryCallSettings.Builder + testIamPermissionsSettings() { + return getStubSettingsBuilder().testIamPermissionsSettings(); + } + + @Override + public ComplianceSettings build() throws IOException { + return new ComplianceSettings(this); + } + } +} diff --git a/java-showcase-3.21.0/gapic-showcase/src/main/java/com/google/showcase/v1beta1/EchoClient.java b/java-showcase-3.21.0/gapic-showcase/src/main/java/com/google/showcase/v1beta1/EchoClient.java new file mode 100644 index 0000000000..5f0a0b0a3d --- /dev/null +++ b/java-showcase-3.21.0/gapic-showcase/src/main/java/com/google/showcase/v1beta1/EchoClient.java @@ -0,0 +1,1781 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1; + +import com.google.api.core.ApiFuture; +import com.google.api.core.ApiFutures; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.httpjson.longrunning.OperationsClient; +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.BidiStreamingCallable; +import com.google.api.gax.rpc.ClientStreamingCallable; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.common.util.concurrent.MoreExecutors; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.longrunning.Operation; +import com.google.showcase.v1beta1.stub.EchoStub; +import com.google.showcase.v1beta1.stub.EchoStubSettings; +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: This service is used showcase the four main types of rpcs - unary, server + * side streaming, client side streaming, and bidirectional streaming. This service also exposes + * methods that explicitly implement server delay, and paginated calls. Set the 'showcase-trailer' + * metadata key on any method to have the values echoed in the response trailers. Set the + * 'x-goog-request-params' metadata key on any method to have the values echoed in the response + * headers. + * + *

        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 (EchoClient echoClient = EchoClient.create()) {
        + *   EchoRequest request =
        + *       EchoRequest.newBuilder()
        + *           .setSeverity(Severity.forNumber(0))
        + *           .setHeader("header-1221270899")
        + *           .setOtherHeader("otherHeader-2026585667")
        + *           .setRequestId("requestId693933066")
        + *           .setOtherRequestId("otherRequestId1248995034")
        + *           .build();
        + *   EchoResponse response = echoClient.echo(request);
        + * }
        + * }
        + * + *

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

        Echo

        This method simply echoes the request. This method showcases unary RPCs.

        + *

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

        + *
          + *
        • echo(EchoRequest request) + *

        + *

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

        + *
          + *
        • echoCallable() + *

        + *

        EchoErrorDetails

        This method returns error details in a repeated "google.protobuf.Any" field. This method showcases handling errors thus encoded, particularly over REST transport. Note that GAPICs only allow the type "google.protobuf.Any" for field paths ending in "error.details", and, at run-time, the actual types for these fields must be one of the types in google/rpc/error_details.proto.

        + *

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

        + *
          + *
        • echoErrorDetails(EchoErrorDetailsRequest request) + *

        + *

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

        + *
          + *
        • echoErrorDetailsCallable() + *

        + *

        FailEchoWithDetails

        This method always fails with a gRPC "Aborted" error status that contains multiple error details. These include one instance of each of the standard ones in error_details.proto (https://github.com/googleapis/googleapis/blob/master/google/rpc/error_details.proto) plus a custom, Showcase-defined PoetryError. The intent of this RPC is to verify that GAPICs can process these various error details and surface them to the user in an idiomatic form.

        + *

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

        + *
          + *
        • failEchoWithDetails(FailEchoWithDetailsRequest request) + *

        + *

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

        + *
          + *
        • failEchoWithDetailsCallable() + *

        + *

        Expand

        This method splits the given content into words and will pass each word back through the stream. This method showcases server-side streaming RPCs.

        + *

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

        + *
          + *
        • expandCallable() + *

        + *

        Collect

        This method will collect the words given to it. When the stream is closed by the client, this method will return the a concatenation of the strings passed to it. This method showcases client-side streaming RPCs.

        + *

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

        + *
          + *
        • collectCallable() + *

        + *

        Chat

        This method, upon receiving a request on the stream, will pass the same content back on the stream. This method showcases bidirectional streaming RPCs.

        + *

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

        + *
          + *
        • chatCallable() + *

        + *

        PagedExpand

        This is similar to the Expand method but instead of returning a stream of expanded words, this method returns a paged list of expanded words.

        + *

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

        + *
          + *
        • pagedExpand(PagedExpandRequest request) + *

        + *

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

        + *
          + *
        • pagedExpandPagedCallable() + *

        • pagedExpandCallable() + *

        + *

        PagedExpandLegacy

        This is similar to the PagedExpand except that it uses max_results instead of page_size, as some legacy APIs still do. New APIs should NOT use this pattern.

        + *

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

        + *
          + *
        • pagedExpandLegacy(PagedExpandLegacyRequest request) + *

        + *

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

        + *
          + *
        • pagedExpandLegacyCallable() + *

        + *

        PagedExpandLegacyMapped

        This method returns a map containing lists of words that appear in the input, keyed by their initial character. The only words returned are the ones included in the current page, as determined by page_token and page_size, which both refer to the word indices in the input. This paging result consisting of a map of lists is a pattern used by some legacy APIs. New APIs should NOT use this pattern.

        + *

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

        + *
          + *
        • pagedExpandLegacyMapped(PagedExpandRequest request) + *

        + *

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

        + *
          + *
        • pagedExpandLegacyMappedPagedCallable() + *

        • pagedExpandLegacyMappedCallable() + *

        + *

        Wait

        This method will wait for the requested amount of time and then return. This method showcases how a client handles a request timeout.

        + *

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

        + *
          + *
        • waitAsync(WaitRequest request) + *

        + *

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

        + *
          + *
        • waitOperationCallable() + *

        • waitCallable() + *

        + *

        Block

        This method will block (wait) for the requested amount of time and then return the response or error. This method showcases how a client handles delays or retries.

        + *

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

        + *
          + *
        • block(BlockRequest request) + *

        + *

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

        + *
          + *
        • blockCallable() + *

        + *

        ListLocations

        Lists information about the supported locations for this service.

        + *

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

        + *
          + *
        • listLocations(ListLocationsRequest request) + *

        + *

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

        + *
          + *
        • listLocationsPagedCallable() + *

        • listLocationsCallable() + *

        + *

        GetLocation

        Gets information about a location.

        + *

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

        + *
          + *
        • getLocation(GetLocationRequest request) + *

        + *

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

        + *
          + *
        • getLocationCallable() + *

        + *

        SetIamPolicy

        Sets the access control policy on the specified resource. Replaces any existing policy. + *

        Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED` errors.

        + *

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

        + *
          + *
        • setIamPolicy(SetIamPolicyRequest request) + *

        + *

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

        + *
          + *
        • setIamPolicyCallable() + *

        + *

        GetIamPolicy

        Gets the access control policy for a resource. Returns an empty policy if the resource exists and does not have a policy set.

        + *

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

        + *
          + *
        • getIamPolicy(GetIamPolicyRequest request) + *

        + *

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

        + *
          + *
        • getIamPolicyCallable() + *

        + *

        TestIamPermissions

        Returns permissions that a caller has on the specified resource. If the resource does not exist, this will return an empty set of permissions, not a `NOT_FOUND` error. + *

        Note: This operation is designed to be used for building permission-aware UIs and command-line tools, not for authorization checking. This operation may "fail open" without warning.

        + *

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

        + *
          + *
        • testIamPermissions(TestIamPermissionsRequest request) + *

        + *

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

        + *
          + *
        • testIamPermissionsCallable() + *

        + *
        + * + *

        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 EchoSettings 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
        + * EchoSettings echoSettings =
        + *     EchoSettings.newBuilder()
        + *         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
        + *         .build();
        + * EchoClient echoClient = EchoClient.create(echoSettings);
        + * }
        + * + *

        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
        + * EchoSettings echoSettings = EchoSettings.newBuilder().setEndpoint(myEndpoint).build();
        + * EchoClient echoClient = EchoClient.create(echoSettings);
        + * }
        + * + *

        To use REST (HTTP1.1/JSON) transport (instead of gRPC) for sending and receiving requests over + * the wire: + * + *

        {@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
        + * EchoSettings echoSettings = EchoSettings.newHttpJsonBuilder().build();
        + * EchoClient echoClient = EchoClient.create(echoSettings);
        + * }
        + * + *

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

        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 (EchoClient echoClient = EchoClient.create()) {
        +   *   EchoRequest request =
        +   *       EchoRequest.newBuilder()
        +   *           .setSeverity(Severity.forNumber(0))
        +   *           .setHeader("header-1221270899")
        +   *           .setOtherHeader("otherHeader-2026585667")
        +   *           .setRequestId("requestId693933066")
        +   *           .setOtherRequestId("otherRequestId1248995034")
        +   *           .build();
        +   *   EchoResponse response = echoClient.echo(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 EchoResponse echo(EchoRequest request) { + return echoCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * This method simply echoes the request. This method showcases unary RPCs. + * + *

        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 (EchoClient echoClient = EchoClient.create()) {
        +   *   EchoRequest request =
        +   *       EchoRequest.newBuilder()
        +   *           .setSeverity(Severity.forNumber(0))
        +   *           .setHeader("header-1221270899")
        +   *           .setOtherHeader("otherHeader-2026585667")
        +   *           .setRequestId("requestId693933066")
        +   *           .setOtherRequestId("otherRequestId1248995034")
        +   *           .build();
        +   *   ApiFuture future = echoClient.echoCallable().futureCall(request);
        +   *   // Do something.
        +   *   EchoResponse response = future.get();
        +   * }
        +   * }
        + */ + public final UnaryCallable echoCallable() { + return stub.echoCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * This method returns error details in a repeated "google.protobuf.Any" field. This method + * showcases handling errors thus encoded, particularly over REST transport. Note that GAPICs only + * allow the type "google.protobuf.Any" for field paths ending in "error.details", and, at + * run-time, the actual types for these fields must be one of the types in + * google/rpc/error_details.proto. + * + *

        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 (EchoClient echoClient = EchoClient.create()) {
        +   *   EchoErrorDetailsRequest request =
        +   *       EchoErrorDetailsRequest.newBuilder()
        +   *           .setSingleDetailText("singleDetailText1774380934")
        +   *           .addAllMultiDetailText(new ArrayList())
        +   *           .build();
        +   *   EchoErrorDetailsResponse response = echoClient.echoErrorDetails(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 EchoErrorDetailsResponse echoErrorDetails(EchoErrorDetailsRequest request) { + return echoErrorDetailsCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * This method returns error details in a repeated "google.protobuf.Any" field. This method + * showcases handling errors thus encoded, particularly over REST transport. Note that GAPICs only + * allow the type "google.protobuf.Any" for field paths ending in "error.details", and, at + * run-time, the actual types for these fields must be one of the types in + * google/rpc/error_details.proto. + * + *

        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 (EchoClient echoClient = EchoClient.create()) {
        +   *   EchoErrorDetailsRequest request =
        +   *       EchoErrorDetailsRequest.newBuilder()
        +   *           .setSingleDetailText("singleDetailText1774380934")
        +   *           .addAllMultiDetailText(new ArrayList())
        +   *           .build();
        +   *   ApiFuture future =
        +   *       echoClient.echoErrorDetailsCallable().futureCall(request);
        +   *   // Do something.
        +   *   EchoErrorDetailsResponse response = future.get();
        +   * }
        +   * }
        + */ + public final UnaryCallable + echoErrorDetailsCallable() { + return stub.echoErrorDetailsCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * This method always fails with a gRPC "Aborted" error status that contains multiple error + * details. These include one instance of each of the standard ones in error_details.proto + * (https://github.com/googleapis/googleapis/blob/master/google/rpc/error_details.proto) plus a + * custom, Showcase-defined PoetryError. The intent of this RPC is to verify that GAPICs can + * process these various error details and surface them to the user in an idiomatic form. + * + *

        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 (EchoClient echoClient = EchoClient.create()) {
        +   *   FailEchoWithDetailsRequest request =
        +   *       FailEchoWithDetailsRequest.newBuilder().setMessage("message954925063").build();
        +   *   FailEchoWithDetailsResponse response = echoClient.failEchoWithDetails(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 FailEchoWithDetailsResponse failEchoWithDetails(FailEchoWithDetailsRequest request) { + return failEchoWithDetailsCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * This method always fails with a gRPC "Aborted" error status that contains multiple error + * details. These include one instance of each of the standard ones in error_details.proto + * (https://github.com/googleapis/googleapis/blob/master/google/rpc/error_details.proto) plus a + * custom, Showcase-defined PoetryError. The intent of this RPC is to verify that GAPICs can + * process these various error details and surface them to the user in an idiomatic form. + * + *

        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 (EchoClient echoClient = EchoClient.create()) {
        +   *   FailEchoWithDetailsRequest request =
        +   *       FailEchoWithDetailsRequest.newBuilder().setMessage("message954925063").build();
        +   *   ApiFuture future =
        +   *       echoClient.failEchoWithDetailsCallable().futureCall(request);
        +   *   // Do something.
        +   *   FailEchoWithDetailsResponse response = future.get();
        +   * }
        +   * }
        + */ + public final UnaryCallable + failEchoWithDetailsCallable() { + return stub.failEchoWithDetailsCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * This method splits the given content into words and will pass each word back through the + * stream. This method showcases server-side streaming RPCs. + * + *

        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 (EchoClient echoClient = EchoClient.create()) {
        +   *   ExpandRequest request =
        +   *       ExpandRequest.newBuilder()
        +   *           .setContent("content951530617")
        +   *           .setError(Status.newBuilder().build())
        +   *           .setStreamWaitTime(Duration.newBuilder().build())
        +   *           .build();
        +   *   ServerStream stream = echoClient.expandCallable().call(request);
        +   *   for (EchoResponse response : stream) {
        +   *     // Do something when a response is received.
        +   *   }
        +   * }
        +   * }
        + */ + public final ServerStreamingCallable expandCallable() { + return stub.expandCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * This method will collect the words given to it. When the stream is closed by the client, this + * method will return the a concatenation of the strings passed to it. This method showcases + * client-side streaming RPCs. + * + *

        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 (EchoClient echoClient = EchoClient.create()) {
        +   *   ApiStreamObserver responseObserver =
        +   *       new ApiStreamObserver() {
        +   *         {@literal @}Override
        +   *         public void onNext(EchoResponse response) {
        +   *           // Do something when a response is received.
        +   *         }
        +   *
        +   *         {@literal @}Override
        +   *         public void onError(Throwable t) {
        +   *           // Add error-handling
        +   *         }
        +   *
        +   *         {@literal @}Override
        +   *         public void onCompleted() {
        +   *           // Do something when complete.
        +   *         }
        +   *       };
        +   *   ApiStreamObserver requestObserver =
        +   *       echoClient.collect().clientStreamingCall(responseObserver);
        +   *   EchoRequest request =
        +   *       EchoRequest.newBuilder()
        +   *           .setSeverity(Severity.forNumber(0))
        +   *           .setHeader("header-1221270899")
        +   *           .setOtherHeader("otherHeader-2026585667")
        +   *           .setRequestId("requestId693933066")
        +   *           .setOtherRequestId("otherRequestId1248995034")
        +   *           .build();
        +   *   requestObserver.onNext(request);
        +   * }
        +   * }
        + */ + public final ClientStreamingCallable collectCallable() { + return stub.collectCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * This method, upon receiving a request on the stream, will pass the same content back on the + * stream. This method showcases bidirectional streaming RPCs. + * + *

        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 (EchoClient echoClient = EchoClient.create()) {
        +   *   BidiStream bidiStream = echoClient.chatCallable().call();
        +   *   EchoRequest request =
        +   *       EchoRequest.newBuilder()
        +   *           .setSeverity(Severity.forNumber(0))
        +   *           .setHeader("header-1221270899")
        +   *           .setOtherHeader("otherHeader-2026585667")
        +   *           .setRequestId("requestId693933066")
        +   *           .setOtherRequestId("otherRequestId1248995034")
        +   *           .build();
        +   *   bidiStream.send(request);
        +   *   for (EchoResponse response : bidiStream) {
        +   *     // Do something when a response is received.
        +   *   }
        +   * }
        +   * }
        + */ + public final BidiStreamingCallable chatCallable() { + return stub.chatCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * This is similar to the Expand method but instead of returning a stream of expanded words, this + * method returns a paged list of expanded words. + * + *

        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 (EchoClient echoClient = EchoClient.create()) {
        +   *   PagedExpandRequest request =
        +   *       PagedExpandRequest.newBuilder()
        +   *           .setContent("content951530617")
        +   *           .setPageSize(883849137)
        +   *           .setPageToken("pageToken873572522")
        +   *           .build();
        +   *   for (EchoResponse element : echoClient.pagedExpand(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 PagedExpandPagedResponse pagedExpand(PagedExpandRequest request) { + return pagedExpandPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * This is similar to the Expand method but instead of returning a stream of expanded words, this + * method returns a paged list of expanded words. + * + *

        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 (EchoClient echoClient = EchoClient.create()) {
        +   *   PagedExpandRequest request =
        +   *       PagedExpandRequest.newBuilder()
        +   *           .setContent("content951530617")
        +   *           .setPageSize(883849137)
        +   *           .setPageToken("pageToken873572522")
        +   *           .build();
        +   *   ApiFuture future = echoClient.pagedExpandPagedCallable().futureCall(request);
        +   *   // Do something.
        +   *   for (EchoResponse element : future.get().iterateAll()) {
        +   *     // doThingsWith(element);
        +   *   }
        +   * }
        +   * }
        + */ + public final UnaryCallable + pagedExpandPagedCallable() { + return stub.pagedExpandPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * This is similar to the Expand method but instead of returning a stream of expanded words, this + * method returns a paged list of expanded words. + * + *

        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 (EchoClient echoClient = EchoClient.create()) {
        +   *   PagedExpandRequest request =
        +   *       PagedExpandRequest.newBuilder()
        +   *           .setContent("content951530617")
        +   *           .setPageSize(883849137)
        +   *           .setPageToken("pageToken873572522")
        +   *           .build();
        +   *   while (true) {
        +   *     PagedExpandResponse response = echoClient.pagedExpandCallable().call(request);
        +   *     for (EchoResponse element : response.getResponsesList()) {
        +   *       // doThingsWith(element);
        +   *     }
        +   *     String nextPageToken = response.getNextPageToken();
        +   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
        +   *       request = request.toBuilder().setPageToken(nextPageToken).build();
        +   *     } else {
        +   *       break;
        +   *     }
        +   *   }
        +   * }
        +   * }
        + */ + public final UnaryCallable pagedExpandCallable() { + return stub.pagedExpandCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * This is similar to the PagedExpand except that it uses max_results instead of page_size, as + * some legacy APIs still do. New APIs should NOT use this pattern. + * + *

        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 (EchoClient echoClient = EchoClient.create()) {
        +   *   PagedExpandLegacyRequest request =
        +   *       PagedExpandLegacyRequest.newBuilder()
        +   *           .setContent("content951530617")
        +   *           .setMaxResults(1128457243)
        +   *           .setPageToken("pageToken873572522")
        +   *           .build();
        +   *   PagedExpandResponse response = echoClient.pagedExpandLegacy(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 PagedExpandResponse pagedExpandLegacy(PagedExpandLegacyRequest request) { + return pagedExpandLegacyCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * This is similar to the PagedExpand except that it uses max_results instead of page_size, as + * some legacy APIs still do. New APIs should NOT use this pattern. + * + *

        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 (EchoClient echoClient = EchoClient.create()) {
        +   *   PagedExpandLegacyRequest request =
        +   *       PagedExpandLegacyRequest.newBuilder()
        +   *           .setContent("content951530617")
        +   *           .setMaxResults(1128457243)
        +   *           .setPageToken("pageToken873572522")
        +   *           .build();
        +   *   ApiFuture future =
        +   *       echoClient.pagedExpandLegacyCallable().futureCall(request);
        +   *   // Do something.
        +   *   PagedExpandResponse response = future.get();
        +   * }
        +   * }
        + */ + public final UnaryCallable + pagedExpandLegacyCallable() { + return stub.pagedExpandLegacyCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * This method returns a map containing lists of words that appear in the input, keyed by their + * initial character. The only words returned are the ones included in the current page, as + * determined by page_token and page_size, which both refer to the word indices in the input. This + * paging result consisting of a map of lists is a pattern used by some legacy APIs. New APIs + * should NOT use this pattern. + * + *

        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 (EchoClient echoClient = EchoClient.create()) {
        +   *   PagedExpandRequest request =
        +   *       PagedExpandRequest.newBuilder()
        +   *           .setContent("content951530617")
        +   *           .setPageSize(883849137)
        +   *           .setPageToken("pageToken873572522")
        +   *           .build();
        +   *   for (Map.Entry element :
        +   *       echoClient.pagedExpandLegacyMapped(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 PagedExpandLegacyMappedPagedResponse pagedExpandLegacyMapped( + PagedExpandRequest request) { + return pagedExpandLegacyMappedPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * This method returns a map containing lists of words that appear in the input, keyed by their + * initial character. The only words returned are the ones included in the current page, as + * determined by page_token and page_size, which both refer to the word indices in the input. This + * paging result consisting of a map of lists is a pattern used by some legacy APIs. New APIs + * should NOT use this pattern. + * + *

        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 (EchoClient echoClient = EchoClient.create()) {
        +   *   PagedExpandRequest request =
        +   *       PagedExpandRequest.newBuilder()
        +   *           .setContent("content951530617")
        +   *           .setPageSize(883849137)
        +   *           .setPageToken("pageToken873572522")
        +   *           .build();
        +   *   ApiFuture> future =
        +   *       echoClient.pagedExpandLegacyMappedPagedCallable().futureCall(request);
        +   *   // Do something.
        +   *   for (Map.Entry element : future.get().iterateAll()) {
        +   *     // doThingsWith(element);
        +   *   }
        +   * }
        +   * }
        + */ + public final UnaryCallable + pagedExpandLegacyMappedPagedCallable() { + return stub.pagedExpandLegacyMappedPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * This method returns a map containing lists of words that appear in the input, keyed by their + * initial character. The only words returned are the ones included in the current page, as + * determined by page_token and page_size, which both refer to the word indices in the input. This + * paging result consisting of a map of lists is a pattern used by some legacy APIs. New APIs + * should NOT use this pattern. + * + *

        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 (EchoClient echoClient = EchoClient.create()) {
        +   *   PagedExpandRequest request =
        +   *       PagedExpandRequest.newBuilder()
        +   *           .setContent("content951530617")
        +   *           .setPageSize(883849137)
        +   *           .setPageToken("pageToken873572522")
        +   *           .build();
        +   *   while (true) {
        +   *     PagedExpandLegacyMappedResponse response =
        +   *         echoClient.pagedExpandLegacyMappedCallable().call(request);
        +   *     for (Map.Entry element : response.getAlphabetizedList()) {
        +   *       // doThingsWith(element);
        +   *     }
        +   *     String nextPageToken = response.getNextPageToken();
        +   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
        +   *       request = request.toBuilder().setPageToken(nextPageToken).build();
        +   *     } else {
        +   *       break;
        +   *     }
        +   *   }
        +   * }
        +   * }
        + */ + public final UnaryCallable + pagedExpandLegacyMappedCallable() { + return stub.pagedExpandLegacyMappedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * This method will wait for the requested amount of time and then return. This method showcases + * how a client handles a request timeout. + * + *

        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 (EchoClient echoClient = EchoClient.create()) {
        +   *   WaitRequest request = WaitRequest.newBuilder().build();
        +   *   WaitResponse response = echoClient.waitAsync(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 waitAsync(WaitRequest request) { + return waitOperationCallable().futureCall(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * This method will wait for the requested amount of time and then return. This method showcases + * how a client handles a request timeout. + * + *

        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 (EchoClient echoClient = EchoClient.create()) {
        +   *   WaitRequest request = WaitRequest.newBuilder().build();
        +   *   OperationFuture future =
        +   *       echoClient.waitOperationCallable().futureCall(request);
        +   *   // Do something.
        +   *   WaitResponse response = future.get();
        +   * }
        +   * }
        + */ + public final OperationCallable waitOperationCallable() { + return stub.waitOperationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * This method will wait for the requested amount of time and then return. This method showcases + * how a client handles a request timeout. + * + *

        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 (EchoClient echoClient = EchoClient.create()) {
        +   *   WaitRequest request = WaitRequest.newBuilder().build();
        +   *   ApiFuture future = echoClient.waitCallable().futureCall(request);
        +   *   // Do something.
        +   *   Operation response = future.get();
        +   * }
        +   * }
        + */ + public final UnaryCallable waitCallable() { + return stub.waitCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * This method will block (wait) for the requested amount of time and then return the response or + * error. This method showcases how a client handles delays or retries. + * + *

        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 (EchoClient echoClient = EchoClient.create()) {
        +   *   BlockRequest request =
        +   *       BlockRequest.newBuilder().setResponseDelay(Duration.newBuilder().build()).build();
        +   *   BlockResponse response = echoClient.block(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 BlockResponse block(BlockRequest request) { + return blockCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * This method will block (wait) for the requested amount of time and then return the response or + * error. This method showcases how a client handles delays or retries. + * + *

        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 (EchoClient echoClient = EchoClient.create()) {
        +   *   BlockRequest request =
        +   *       BlockRequest.newBuilder().setResponseDelay(Duration.newBuilder().build()).build();
        +   *   ApiFuture future = echoClient.blockCallable().futureCall(request);
        +   *   // Do something.
        +   *   BlockResponse response = future.get();
        +   * }
        +   * }
        + */ + public final UnaryCallable blockCallable() { + return stub.blockCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists information about the supported locations for this service. + * + *

        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 (EchoClient echoClient = EchoClient.create()) {
        +   *   ListLocationsRequest request =
        +   *       ListLocationsRequest.newBuilder()
        +   *           .setName("name3373707")
        +   *           .setFilter("filter-1274492040")
        +   *           .setPageSize(883849137)
        +   *           .setPageToken("pageToken873572522")
        +   *           .build();
        +   *   for (Location element : echoClient.listLocations(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 ListLocationsPagedResponse listLocations(ListLocationsRequest request) { + return listLocationsPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists information about the supported locations for this service. + * + *

        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 (EchoClient echoClient = EchoClient.create()) {
        +   *   ListLocationsRequest request =
        +   *       ListLocationsRequest.newBuilder()
        +   *           .setName("name3373707")
        +   *           .setFilter("filter-1274492040")
        +   *           .setPageSize(883849137)
        +   *           .setPageToken("pageToken873572522")
        +   *           .build();
        +   *   ApiFuture future = echoClient.listLocationsPagedCallable().futureCall(request);
        +   *   // Do something.
        +   *   for (Location element : future.get().iterateAll()) {
        +   *     // doThingsWith(element);
        +   *   }
        +   * }
        +   * }
        + */ + public final UnaryCallable + listLocationsPagedCallable() { + return stub.listLocationsPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists information about the supported locations for this service. + * + *

        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 (EchoClient echoClient = EchoClient.create()) {
        +   *   ListLocationsRequest request =
        +   *       ListLocationsRequest.newBuilder()
        +   *           .setName("name3373707")
        +   *           .setFilter("filter-1274492040")
        +   *           .setPageSize(883849137)
        +   *           .setPageToken("pageToken873572522")
        +   *           .build();
        +   *   while (true) {
        +   *     ListLocationsResponse response = echoClient.listLocationsCallable().call(request);
        +   *     for (Location element : response.getLocationsList()) {
        +   *       // doThingsWith(element);
        +   *     }
        +   *     String nextPageToken = response.getNextPageToken();
        +   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
        +   *       request = request.toBuilder().setPageToken(nextPageToken).build();
        +   *     } else {
        +   *       break;
        +   *     }
        +   *   }
        +   * }
        +   * }
        + */ + public final UnaryCallable listLocationsCallable() { + return stub.listLocationsCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets information about a location. + * + *

        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 (EchoClient echoClient = EchoClient.create()) {
        +   *   GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build();
        +   *   Location response = echoClient.getLocation(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 Location getLocation(GetLocationRequest request) { + return getLocationCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets information about a location. + * + *

        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 (EchoClient echoClient = EchoClient.create()) {
        +   *   GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build();
        +   *   ApiFuture future = echoClient.getLocationCallable().futureCall(request);
        +   *   // Do something.
        +   *   Location response = future.get();
        +   * }
        +   * }
        + */ + public final UnaryCallable getLocationCallable() { + return stub.getLocationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Sets the access control policy on the specified resource. Replaces any existing policy. + * + *

        Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED` errors. + * + *

        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 (EchoClient echoClient = EchoClient.create()) {
        +   *   SetIamPolicyRequest request =
        +   *       SetIamPolicyRequest.newBuilder()
        +   *           .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString())
        +   *           .setPolicy(Policy.newBuilder().build())
        +   *           .setUpdateMask(FieldMask.newBuilder().build())
        +   *           .build();
        +   *   Policy response = echoClient.setIamPolicy(request);
        +   * }
        +   * }
        + * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Policy setIamPolicy(SetIamPolicyRequest request) { + return setIamPolicyCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Sets the access control policy on the specified resource. Replaces any existing policy. + * + *

        Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED` errors. + * + *

        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 (EchoClient echoClient = EchoClient.create()) {
        +   *   SetIamPolicyRequest request =
        +   *       SetIamPolicyRequest.newBuilder()
        +   *           .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString())
        +   *           .setPolicy(Policy.newBuilder().build())
        +   *           .setUpdateMask(FieldMask.newBuilder().build())
        +   *           .build();
        +   *   ApiFuture future = echoClient.setIamPolicyCallable().futureCall(request);
        +   *   // Do something.
        +   *   Policy response = future.get();
        +   * }
        +   * }
        + */ + public final UnaryCallable setIamPolicyCallable() { + return stub.setIamPolicyCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets the access control policy for a resource. Returns an empty policy if the resource exists + * and does not have a policy set. + * + *

        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 (EchoClient echoClient = EchoClient.create()) {
        +   *   GetIamPolicyRequest request =
        +   *       GetIamPolicyRequest.newBuilder()
        +   *           .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString())
        +   *           .setOptions(GetPolicyOptions.newBuilder().build())
        +   *           .build();
        +   *   Policy response = echoClient.getIamPolicy(request);
        +   * }
        +   * }
        + * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Policy getIamPolicy(GetIamPolicyRequest request) { + return getIamPolicyCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets the access control policy for a resource. Returns an empty policy if the resource exists + * and does not have a policy set. + * + *

        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 (EchoClient echoClient = EchoClient.create()) {
        +   *   GetIamPolicyRequest request =
        +   *       GetIamPolicyRequest.newBuilder()
        +   *           .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString())
        +   *           .setOptions(GetPolicyOptions.newBuilder().build())
        +   *           .build();
        +   *   ApiFuture future = echoClient.getIamPolicyCallable().futureCall(request);
        +   *   // Do something.
        +   *   Policy response = future.get();
        +   * }
        +   * }
        + */ + public final UnaryCallable getIamPolicyCallable() { + return stub.getIamPolicyCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Returns permissions that a caller has on the specified resource. If the resource does not + * exist, this will return an empty set of permissions, not a `NOT_FOUND` error. + * + *

        Note: This operation is designed to be used for building permission-aware UIs and + * command-line tools, not for authorization checking. This operation may "fail open" without + * warning. + * + *

        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 (EchoClient echoClient = EchoClient.create()) {
        +   *   TestIamPermissionsRequest request =
        +   *       TestIamPermissionsRequest.newBuilder()
        +   *           .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString())
        +   *           .addAllPermissions(new ArrayList())
        +   *           .build();
        +   *   TestIamPermissionsResponse response = echoClient.testIamPermissions(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 TestIamPermissionsResponse testIamPermissions(TestIamPermissionsRequest request) { + return testIamPermissionsCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Returns permissions that a caller has on the specified resource. If the resource does not + * exist, this will return an empty set of permissions, not a `NOT_FOUND` error. + * + *

        Note: This operation is designed to be used for building permission-aware UIs and + * command-line tools, not for authorization checking. This operation may "fail open" without + * warning. + * + *

        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 (EchoClient echoClient = EchoClient.create()) {
        +   *   TestIamPermissionsRequest request =
        +   *       TestIamPermissionsRequest.newBuilder()
        +   *           .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString())
        +   *           .addAllPermissions(new ArrayList())
        +   *           .build();
        +   *   ApiFuture future =
        +   *       echoClient.testIamPermissionsCallable().futureCall(request);
        +   *   // Do something.
        +   *   TestIamPermissionsResponse response = future.get();
        +   * }
        +   * }
        + */ + public final UnaryCallable + testIamPermissionsCallable() { + return stub.testIamPermissionsCallable(); + } + + @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 PagedExpandPagedResponse + extends AbstractPagedListResponse< + PagedExpandRequest, + PagedExpandResponse, + EchoResponse, + PagedExpandPage, + PagedExpandFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + PagedExpandPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, input -> new PagedExpandPagedResponse(input), MoreExecutors.directExecutor()); + } + + private PagedExpandPagedResponse(PagedExpandPage page) { + super(page, PagedExpandFixedSizeCollection.createEmptyCollection()); + } + } + + public static class PagedExpandPage + extends AbstractPage { + + private PagedExpandPage( + PageContext context, + PagedExpandResponse response) { + super(context, response); + } + + private static PagedExpandPage createEmptyPage() { + return new PagedExpandPage(null, null); + } + + @Override + protected PagedExpandPage createPage( + PageContext context, + PagedExpandResponse response) { + return new PagedExpandPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class PagedExpandFixedSizeCollection + extends AbstractFixedSizeCollection< + PagedExpandRequest, + PagedExpandResponse, + EchoResponse, + PagedExpandPage, + PagedExpandFixedSizeCollection> { + + private PagedExpandFixedSizeCollection(List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static PagedExpandFixedSizeCollection createEmptyCollection() { + return new PagedExpandFixedSizeCollection(null, 0); + } + + @Override + protected PagedExpandFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new PagedExpandFixedSizeCollection(pages, collectionSize); + } + } + + public static class PagedExpandLegacyMappedPagedResponse + extends AbstractPagedListResponse< + PagedExpandRequest, + PagedExpandLegacyMappedResponse, + Map.Entry, + PagedExpandLegacyMappedPage, + PagedExpandLegacyMappedFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext< + PagedExpandRequest, + PagedExpandLegacyMappedResponse, + Map.Entry> + context, + ApiFuture futureResponse) { + ApiFuture futurePage = + PagedExpandLegacyMappedPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + input -> new PagedExpandLegacyMappedPagedResponse(input), + MoreExecutors.directExecutor()); + } + + private PagedExpandLegacyMappedPagedResponse(PagedExpandLegacyMappedPage page) { + super(page, PagedExpandLegacyMappedFixedSizeCollection.createEmptyCollection()); + } + } + + public static class PagedExpandLegacyMappedPage + extends AbstractPage< + PagedExpandRequest, + PagedExpandLegacyMappedResponse, + Map.Entry, + PagedExpandLegacyMappedPage> { + + private PagedExpandLegacyMappedPage( + PageContext< + PagedExpandRequest, + PagedExpandLegacyMappedResponse, + Map.Entry> + context, + PagedExpandLegacyMappedResponse response) { + super(context, response); + } + + private static PagedExpandLegacyMappedPage createEmptyPage() { + return new PagedExpandLegacyMappedPage(null, null); + } + + @Override + protected PagedExpandLegacyMappedPage createPage( + PageContext< + PagedExpandRequest, + PagedExpandLegacyMappedResponse, + Map.Entry> + context, + PagedExpandLegacyMappedResponse response) { + return new PagedExpandLegacyMappedPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext< + PagedExpandRequest, + PagedExpandLegacyMappedResponse, + Map.Entry> + context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class PagedExpandLegacyMappedFixedSizeCollection + extends AbstractFixedSizeCollection< + PagedExpandRequest, + PagedExpandLegacyMappedResponse, + Map.Entry, + PagedExpandLegacyMappedPage, + PagedExpandLegacyMappedFixedSizeCollection> { + + private PagedExpandLegacyMappedFixedSizeCollection( + List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static PagedExpandLegacyMappedFixedSizeCollection createEmptyCollection() { + return new PagedExpandLegacyMappedFixedSizeCollection(null, 0); + } + + @Override + protected PagedExpandLegacyMappedFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new PagedExpandLegacyMappedFixedSizeCollection(pages, collectionSize); + } + } + + public static class ListLocationsPagedResponse + extends AbstractPagedListResponse< + ListLocationsRequest, + ListLocationsResponse, + Location, + ListLocationsPage, + ListLocationsFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListLocationsPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + input -> new ListLocationsPagedResponse(input), + MoreExecutors.directExecutor()); + } + + private ListLocationsPagedResponse(ListLocationsPage page) { + super(page, ListLocationsFixedSizeCollection.createEmptyCollection()); + } + } + + public static class ListLocationsPage + extends AbstractPage< + ListLocationsRequest, ListLocationsResponse, Location, ListLocationsPage> { + + private ListLocationsPage( + PageContext context, + ListLocationsResponse response) { + super(context, response); + } + + private static ListLocationsPage createEmptyPage() { + return new ListLocationsPage(null, null); + } + + @Override + protected ListLocationsPage createPage( + PageContext context, + ListLocationsResponse response) { + return new ListLocationsPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class ListLocationsFixedSizeCollection + extends AbstractFixedSizeCollection< + ListLocationsRequest, + ListLocationsResponse, + Location, + ListLocationsPage, + ListLocationsFixedSizeCollection> { + + private ListLocationsFixedSizeCollection(List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListLocationsFixedSizeCollection createEmptyCollection() { + return new ListLocationsFixedSizeCollection(null, 0); + } + + @Override + protected ListLocationsFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListLocationsFixedSizeCollection(pages, collectionSize); + } + } +} diff --git a/java-showcase-3.21.0/gapic-showcase/src/main/java/com/google/showcase/v1beta1/EchoSettings.java b/java-showcase-3.21.0/gapic-showcase/src/main/java/com/google/showcase/v1beta1/EchoSettings.java new file mode 100644 index 0000000000..41ab2f8e20 --- /dev/null +++ b/java-showcase-3.21.0/gapic-showcase/src/main/java/com/google/showcase/v1beta1/EchoSettings.java @@ -0,0 +1,438 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1; + +import static com.google.showcase.v1beta1.EchoClient.ListLocationsPagedResponse; +import static com.google.showcase.v1beta1.EchoClient.PagedExpandLegacyMappedPagedResponse; +import static com.google.showcase.v1beta1.EchoClient.PagedExpandPagedResponse; + +import com.google.api.core.ApiFunction; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; +import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; +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.ServerStreamingCallSettings; +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.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.longrunning.Operation; +import com.google.showcase.v1beta1.stub.EchoStubSettings; +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 EchoClient}. + * + *

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

          + *
        • The default service address (localhost) and default port (7469) 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 echo: + * + *

        {@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
        + * EchoSettings.Builder echoSettingsBuilder = EchoSettings.newBuilder();
        + * echoSettingsBuilder
        + *     .echoSettings()
        + *     .setRetrySettings(
        + *         echoSettingsBuilder
        + *             .echoSettings()
        + *             .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());
        + * EchoSettings echoSettings = echoSettingsBuilder.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 wait: + * + *

        {@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
        + * EchoSettings.Builder echoSettingsBuilder = EchoSettings.newBuilder();
        + * TimedRetryAlgorithm timedRetryAlgorithm =
        + *     OperationalTimedPollAlgorithm.create(
        + *         RetrySettings.newBuilder()
        + *             .setInitialRetryDelayDuration(Duration.ofMillis(500))
        + *             .setRetryDelayMultiplier(1.5)
        + *             .setMaxRetryDelayDuration(Duration.ofMillis(5000))
        + *             .setTotalTimeoutDuration(Duration.ofHours(24))
        + *             .build());
        + * echoSettingsBuilder
        + *     .createClusterOperationSettings()
        + *     .setPollingAlgorithm(timedRetryAlgorithm)
        + *     .build();
        + * }
        + */ +@BetaApi +@Generated("by gapic-generator-java") +public class EchoSettings extends ClientSettings { + + /** Returns the object with the settings used for calls to echo. */ + public UnaryCallSettings echoSettings() { + return ((EchoStubSettings) getStubSettings()).echoSettings(); + } + + /** Returns the object with the settings used for calls to echoErrorDetails. */ + public UnaryCallSettings + echoErrorDetailsSettings() { + return ((EchoStubSettings) getStubSettings()).echoErrorDetailsSettings(); + } + + /** Returns the object with the settings used for calls to failEchoWithDetails. */ + public UnaryCallSettings + failEchoWithDetailsSettings() { + return ((EchoStubSettings) getStubSettings()).failEchoWithDetailsSettings(); + } + + /** Returns the object with the settings used for calls to expand. */ + public ServerStreamingCallSettings expandSettings() { + return ((EchoStubSettings) getStubSettings()).expandSettings(); + } + + /** Returns the object with the settings used for calls to collect. */ + public StreamingCallSettings collectSettings() { + return ((EchoStubSettings) getStubSettings()).collectSettings(); + } + + /** Returns the object with the settings used for calls to chat. */ + public StreamingCallSettings chatSettings() { + return ((EchoStubSettings) getStubSettings()).chatSettings(); + } + + /** Returns the object with the settings used for calls to pagedExpand. */ + public PagedCallSettings + pagedExpandSettings() { + return ((EchoStubSettings) getStubSettings()).pagedExpandSettings(); + } + + /** Returns the object with the settings used for calls to pagedExpandLegacy. */ + public UnaryCallSettings + pagedExpandLegacySettings() { + return ((EchoStubSettings) getStubSettings()).pagedExpandLegacySettings(); + } + + /** Returns the object with the settings used for calls to pagedExpandLegacyMapped. */ + public PagedCallSettings< + PagedExpandRequest, PagedExpandLegacyMappedResponse, PagedExpandLegacyMappedPagedResponse> + pagedExpandLegacyMappedSettings() { + return ((EchoStubSettings) getStubSettings()).pagedExpandLegacyMappedSettings(); + } + + /** Returns the object with the settings used for calls to wait. */ + public UnaryCallSettings waitSettings() { + return ((EchoStubSettings) getStubSettings()).waitSettings(); + } + + /** Returns the object with the settings used for calls to wait. */ + public OperationCallSettings waitOperationSettings() { + return ((EchoStubSettings) getStubSettings()).waitOperationSettings(); + } + + /** Returns the object with the settings used for calls to block. */ + public UnaryCallSettings blockSettings() { + return ((EchoStubSettings) getStubSettings()).blockSettings(); + } + + /** Returns the object with the settings used for calls to listLocations. */ + public PagedCallSettings + listLocationsSettings() { + return ((EchoStubSettings) getStubSettings()).listLocationsSettings(); + } + + /** Returns the object with the settings used for calls to getLocation. */ + public UnaryCallSettings getLocationSettings() { + return ((EchoStubSettings) getStubSettings()).getLocationSettings(); + } + + /** Returns the object with the settings used for calls to setIamPolicy. */ + public UnaryCallSettings setIamPolicySettings() { + return ((EchoStubSettings) getStubSettings()).setIamPolicySettings(); + } + + /** Returns the object with the settings used for calls to getIamPolicy. */ + public UnaryCallSettings getIamPolicySettings() { + return ((EchoStubSettings) getStubSettings()).getIamPolicySettings(); + } + + /** Returns the object with the settings used for calls to testIamPermissions. */ + public UnaryCallSettings + testIamPermissionsSettings() { + return ((EchoStubSettings) getStubSettings()).testIamPermissionsSettings(); + } + + public static final EchoSettings create(EchoStubSettings stub) throws IOException { + return new EchoSettings.Builder(stub.toBuilder()).build(); + } + + /** Returns a builder for the default ExecutorProvider for this service. */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return EchoStubSettings.defaultExecutorProviderBuilder(); + } + + /** Returns the default service endpoint. */ + public static String getDefaultEndpoint() { + return EchoStubSettings.getDefaultEndpoint(); + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return EchoStubSettings.getDefaultServiceScopes(); + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return EchoStubSettings.defaultCredentialsProviderBuilder(); + } + + /** Returns a builder for the default gRPC ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return EchoStubSettings.defaultGrpcTransportProviderBuilder(); + } + + /** Returns a builder for the default REST ChannelProvider for this service. */ + @BetaApi + public static InstantiatingHttpJsonChannelProvider.Builder + defaultHttpJsonTransportProviderBuilder() { + return EchoStubSettings.defaultHttpJsonTransportProviderBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return EchoStubSettings.defaultTransportChannelProvider(); + } + + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return EchoStubSettings.defaultApiClientHeaderProviderBuilder(); + } + + /** Returns a new gRPC builder for this class. */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** Returns a new REST builder for this class. */ + public static Builder newHttpJsonBuilder() { + return Builder.createHttpJsonDefault(); + } + + /** 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 EchoSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + } + + /** Builder for EchoSettings. */ + public static class Builder extends ClientSettings.Builder { + + protected Builder() throws IOException { + this(((ClientContext) null)); + } + + protected Builder(ClientContext clientContext) { + super(EchoStubSettings.newBuilder(clientContext)); + } + + protected Builder(EchoSettings settings) { + super(settings.getStubSettings().toBuilder()); + } + + protected Builder(EchoStubSettings.Builder stubSettings) { + super(stubSettings); + } + + private static Builder createDefault() { + return new Builder(EchoStubSettings.newBuilder()); + } + + private static Builder createHttpJsonDefault() { + return new Builder(EchoStubSettings.newHttpJsonBuilder()); + } + + public EchoStubSettings.Builder getStubSettingsBuilder() { + return ((EchoStubSettings.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 echo. */ + public UnaryCallSettings.Builder echoSettings() { + return getStubSettingsBuilder().echoSettings(); + } + + /** Returns the builder for the settings used for calls to echoErrorDetails. */ + public UnaryCallSettings.Builder + echoErrorDetailsSettings() { + return getStubSettingsBuilder().echoErrorDetailsSettings(); + } + + /** Returns the builder for the settings used for calls to failEchoWithDetails. */ + public UnaryCallSettings.Builder + failEchoWithDetailsSettings() { + return getStubSettingsBuilder().failEchoWithDetailsSettings(); + } + + /** Returns the builder for the settings used for calls to expand. */ + public ServerStreamingCallSettings.Builder expandSettings() { + return getStubSettingsBuilder().expandSettings(); + } + + /** Returns the builder for the settings used for calls to collect. */ + public StreamingCallSettings.Builder collectSettings() { + return getStubSettingsBuilder().collectSettings(); + } + + /** Returns the builder for the settings used for calls to chat. */ + public StreamingCallSettings.Builder chatSettings() { + return getStubSettingsBuilder().chatSettings(); + } + + /** Returns the builder for the settings used for calls to pagedExpand. */ + public PagedCallSettings.Builder< + PagedExpandRequest, PagedExpandResponse, PagedExpandPagedResponse> + pagedExpandSettings() { + return getStubSettingsBuilder().pagedExpandSettings(); + } + + /** Returns the builder for the settings used for calls to pagedExpandLegacy. */ + public UnaryCallSettings.Builder + pagedExpandLegacySettings() { + return getStubSettingsBuilder().pagedExpandLegacySettings(); + } + + /** Returns the builder for the settings used for calls to pagedExpandLegacyMapped. */ + public PagedCallSettings.Builder< + PagedExpandRequest, + PagedExpandLegacyMappedResponse, + PagedExpandLegacyMappedPagedResponse> + pagedExpandLegacyMappedSettings() { + return getStubSettingsBuilder().pagedExpandLegacyMappedSettings(); + } + + /** Returns the builder for the settings used for calls to wait. */ + public UnaryCallSettings.Builder waitSettings() { + return getStubSettingsBuilder().waitSettings(); + } + + /** Returns the builder for the settings used for calls to wait. */ + public OperationCallSettings.Builder + waitOperationSettings() { + return getStubSettingsBuilder().waitOperationSettings(); + } + + /** Returns the builder for the settings used for calls to block. */ + public UnaryCallSettings.Builder blockSettings() { + return getStubSettingsBuilder().blockSettings(); + } + + /** Returns the builder for the settings used for calls to listLocations. */ + public PagedCallSettings.Builder< + ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse> + listLocationsSettings() { + return getStubSettingsBuilder().listLocationsSettings(); + } + + /** Returns the builder for the settings used for calls to getLocation. */ + public UnaryCallSettings.Builder getLocationSettings() { + return getStubSettingsBuilder().getLocationSettings(); + } + + /** Returns the builder for the settings used for calls to setIamPolicy. */ + public UnaryCallSettings.Builder setIamPolicySettings() { + return getStubSettingsBuilder().setIamPolicySettings(); + } + + /** Returns the builder for the settings used for calls to getIamPolicy. */ + public UnaryCallSettings.Builder getIamPolicySettings() { + return getStubSettingsBuilder().getIamPolicySettings(); + } + + /** Returns the builder for the settings used for calls to testIamPermissions. */ + public UnaryCallSettings.Builder + testIamPermissionsSettings() { + return getStubSettingsBuilder().testIamPermissionsSettings(); + } + + @Override + public EchoSettings build() throws IOException { + return new EchoSettings(this); + } + } +} diff --git a/java-showcase-3.21.0/gapic-showcase/src/main/java/com/google/showcase/v1beta1/IdentityClient.java b/java-showcase-3.21.0/gapic-showcase/src/main/java/com/google/showcase/v1beta1/IdentityClient.java new file mode 100644 index 0000000000..fbf33c1089 --- /dev/null +++ b/java-showcase-3.21.0/gapic-showcase/src/main/java/com/google/showcase/v1beta1/IdentityClient.java @@ -0,0 +1,1358 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1; + +import com.google.api.core.ApiFuture; +import com.google.api.core.ApiFutures; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.paging.AbstractFixedSizeCollection; +import com.google.api.gax.paging.AbstractPage; +import com.google.api.gax.paging.AbstractPagedListResponse; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.common.util.concurrent.MoreExecutors; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.protobuf.Empty; +import com.google.showcase.v1beta1.stub.IdentityStub; +import com.google.showcase.v1beta1.stub.IdentityStubSettings; +import java.io.IOException; +import java.util.List; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Service Description: A simple identity service. + * + *

        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 (IdentityClient identityClient = IdentityClient.create()) {
        + *   String displayName = "displayName1714148973";
        + *   String email = "email96619420";
        + *   User response = identityClient.createUser(displayName, email);
        + * }
        + * }
        + * + *

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

        CreateUser

        Creates a user.

        + *

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

        + *
          + *
        • createUser(CreateUserRequest request) + *

        + *

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

        + *
          + *
        • createUser(String displayName, String email) + *

        • createUser(String displayName, String email, int age, String nickname, boolean enableNotifications, double heightFeet) + *

        + *

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

        + *
          + *
        • createUserCallable() + *

        + *

        GetUser

        Retrieves the User with the given uri.

        + *

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

        + *
          + *
        • getUser(GetUserRequest request) + *

        + *

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

        + *
          + *
        • getUser(UserName name) + *

        • getUser(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.

        + *
          + *
        • getUserCallable() + *

        + *

        UpdateUser

        Updates a user.

        + *

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

        + *
          + *
        • updateUser(UpdateUserRequest request) + *

        + *

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

        + *
          + *
        • updateUserCallable() + *

        + *

        DeleteUser

        Deletes a user, their profile, and all of their authored messages.

        + *

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

        + *
          + *
        • deleteUser(DeleteUserRequest request) + *

        + *

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

        + *
          + *
        • deleteUser(UserName name) + *

        • deleteUser(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.

        + *
          + *
        • deleteUserCallable() + *

        + *

        ListUsers

        Lists all users.

        + *

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

        + *
          + *
        • listUsers(ListUsersRequest request) + *

        + *

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

        + *
          + *
        • listUsersPagedCallable() + *

        • listUsersCallable() + *

        + *

        ListLocations

        Lists information about the supported locations for this service.

        + *

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

        + *
          + *
        • listLocations(ListLocationsRequest request) + *

        + *

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

        + *
          + *
        • listLocationsPagedCallable() + *

        • listLocationsCallable() + *

        + *

        GetLocation

        Gets information about a location.

        + *

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

        + *
          + *
        • getLocation(GetLocationRequest request) + *

        + *

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

        + *
          + *
        • getLocationCallable() + *

        + *

        SetIamPolicy

        Sets the access control policy on the specified resource. Replaces any existing policy. + *

        Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED` errors.

        + *

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

        + *
          + *
        • setIamPolicy(SetIamPolicyRequest request) + *

        + *

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

        + *
          + *
        • setIamPolicyCallable() + *

        + *

        GetIamPolicy

        Gets the access control policy for a resource. Returns an empty policy if the resource exists and does not have a policy set.

        + *

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

        + *
          + *
        • getIamPolicy(GetIamPolicyRequest request) + *

        + *

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

        + *
          + *
        • getIamPolicyCallable() + *

        + *

        TestIamPermissions

        Returns permissions that a caller has on the specified resource. If the resource does not exist, this will return an empty set of permissions, not a `NOT_FOUND` error. + *

        Note: This operation is designed to be used for building permission-aware UIs and command-line tools, not for authorization checking. This operation may "fail open" without warning.

        + *

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

        + *
          + *
        • testIamPermissions(TestIamPermissionsRequest request) + *

        + *

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

        + *
          + *
        • testIamPermissionsCallable() + *

        + *
        + * + *

        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 IdentitySettings 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
        + * IdentitySettings identitySettings =
        + *     IdentitySettings.newBuilder()
        + *         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
        + *         .build();
        + * IdentityClient identityClient = IdentityClient.create(identitySettings);
        + * }
        + * + *

        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
        + * IdentitySettings identitySettings =
        + *     IdentitySettings.newBuilder().setEndpoint(myEndpoint).build();
        + * IdentityClient identityClient = IdentityClient.create(identitySettings);
        + * }
        + * + *

        To use REST (HTTP1.1/JSON) transport (instead of gRPC) for sending and receiving requests over + * the wire: + * + *

        {@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
        + * IdentitySettings identitySettings = IdentitySettings.newHttpJsonBuilder().build();
        + * IdentityClient identityClient = IdentityClient.create(identitySettings);
        + * }
        + * + *

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

        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 (IdentityClient identityClient = IdentityClient.create()) {
        +   *   String displayName = "displayName1714148973";
        +   *   String email = "email96619420";
        +   *   User response = identityClient.createUser(displayName, email);
        +   * }
        +   * }
        + * + * @param displayName The display_name of the user. + * @param email The email address of the user. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final User createUser(String displayName, String email) { + CreateUserRequest request = + CreateUserRequest.newBuilder() + .setUser(User.newBuilder().setDisplayName(displayName).setEmail(email).build()) + .build(); + return createUser(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a user. + * + *

        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 (IdentityClient identityClient = IdentityClient.create()) {
        +   *   String displayName = "displayName1714148973";
        +   *   String email = "email96619420";
        +   *   int age = 96511;
        +   *   String nickname = "nickname70690926";
        +   *   boolean enableNotifications = true;
        +   *   double heightFeet = -1032737338;
        +   *   User response =
        +   *       identityClient.createUser(
        +   *           displayName, email, age, nickname, enableNotifications, heightFeet);
        +   * }
        +   * }
        + * + * @param displayName The display_name of the user. + * @param email The email address of the user. + * @param age The age of the user in years. + * @param nickname The nickname of the user. + *

        (-- aip.dev/not-precedent: An empty string is a valid nickname. Ordinarily, + * proto3_optional should not be used on a `string` field. --) + * @param enableNotifications Enables the receiving of notifications. The default is true if + * unset. + *

        (-- aip.dev/not-precedent: The default for the feature is true. Ordinarily, the default + * for a `bool` field should be false. --) + * @param heightFeet The height of the user in feet. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final User createUser( + String displayName, + String email, + int age, + String nickname, + boolean enableNotifications, + double heightFeet) { + CreateUserRequest request = + CreateUserRequest.newBuilder() + .setUser( + User.newBuilder() + .setDisplayName(displayName) + .setEmail(email) + .setAge(age) + .setNickname(nickname) + .setEnableNotifications(enableNotifications) + .setHeightFeet(heightFeet) + .build()) + .build(); + return createUser(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a user. + * + *

        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 (IdentityClient identityClient = IdentityClient.create()) {
        +   *   CreateUserRequest request =
        +   *       CreateUserRequest.newBuilder().setUser(User.newBuilder().build()).build();
        +   *   User response = identityClient.createUser(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 User createUser(CreateUserRequest request) { + return createUserCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a user. + * + *

        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 (IdentityClient identityClient = IdentityClient.create()) {
        +   *   CreateUserRequest request =
        +   *       CreateUserRequest.newBuilder().setUser(User.newBuilder().build()).build();
        +   *   ApiFuture future = identityClient.createUserCallable().futureCall(request);
        +   *   // Do something.
        +   *   User response = future.get();
        +   * }
        +   * }
        + */ + public final UnaryCallable createUserCallable() { + return stub.createUserCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Retrieves the User with the given uri. + * + *

        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 (IdentityClient identityClient = IdentityClient.create()) {
        +   *   UserName name = UserName.of("[USER]");
        +   *   User response = identityClient.getUser(name);
        +   * }
        +   * }
        + * + * @param name The resource name of the requested user. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final User getUser(UserName name) { + GetUserRequest request = + GetUserRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + return getUser(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Retrieves the User with the given uri. + * + *

        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 (IdentityClient identityClient = IdentityClient.create()) {
        +   *   String name = UserName.of("[USER]").toString();
        +   *   User response = identityClient.getUser(name);
        +   * }
        +   * }
        + * + * @param name The resource name of the requested user. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final User getUser(String name) { + GetUserRequest request = GetUserRequest.newBuilder().setName(name).build(); + return getUser(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Retrieves the User with the given uri. + * + *

        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 (IdentityClient identityClient = IdentityClient.create()) {
        +   *   GetUserRequest request =
        +   *       GetUserRequest.newBuilder().setName(UserName.of("[USER]").toString()).build();
        +   *   User response = identityClient.getUser(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 User getUser(GetUserRequest request) { + return getUserCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Retrieves the User with the given uri. + * + *

        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 (IdentityClient identityClient = IdentityClient.create()) {
        +   *   GetUserRequest request =
        +   *       GetUserRequest.newBuilder().setName(UserName.of("[USER]").toString()).build();
        +   *   ApiFuture future = identityClient.getUserCallable().futureCall(request);
        +   *   // Do something.
        +   *   User response = future.get();
        +   * }
        +   * }
        + */ + public final UnaryCallable getUserCallable() { + return stub.getUserCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates a user. + * + *

        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 (IdentityClient identityClient = IdentityClient.create()) {
        +   *   UpdateUserRequest request =
        +   *       UpdateUserRequest.newBuilder()
        +   *           .setUser(User.newBuilder().build())
        +   *           .setUpdateMask(FieldMask.newBuilder().build())
        +   *           .build();
        +   *   User response = identityClient.updateUser(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 User updateUser(UpdateUserRequest request) { + return updateUserCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates a user. + * + *

        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 (IdentityClient identityClient = IdentityClient.create()) {
        +   *   UpdateUserRequest request =
        +   *       UpdateUserRequest.newBuilder()
        +   *           .setUser(User.newBuilder().build())
        +   *           .setUpdateMask(FieldMask.newBuilder().build())
        +   *           .build();
        +   *   ApiFuture future = identityClient.updateUserCallable().futureCall(request);
        +   *   // Do something.
        +   *   User response = future.get();
        +   * }
        +   * }
        + */ + public final UnaryCallable updateUserCallable() { + return stub.updateUserCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a user, their profile, and all of their authored messages. + * + *

        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 (IdentityClient identityClient = IdentityClient.create()) {
        +   *   UserName name = UserName.of("[USER]");
        +   *   identityClient.deleteUser(name);
        +   * }
        +   * }
        + * + * @param name The resource name of the user to delete. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final void deleteUser(UserName name) { + DeleteUserRequest request = + DeleteUserRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + deleteUser(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a user, their profile, and all of their authored messages. + * + *

        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 (IdentityClient identityClient = IdentityClient.create()) {
        +   *   String name = UserName.of("[USER]").toString();
        +   *   identityClient.deleteUser(name);
        +   * }
        +   * }
        + * + * @param name The resource name of the user to delete. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final void deleteUser(String name) { + DeleteUserRequest request = DeleteUserRequest.newBuilder().setName(name).build(); + deleteUser(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a user, their profile, and all of their authored messages. + * + *

        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 (IdentityClient identityClient = IdentityClient.create()) {
        +   *   DeleteUserRequest request =
        +   *       DeleteUserRequest.newBuilder().setName(UserName.of("[USER]").toString()).build();
        +   *   identityClient.deleteUser(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 deleteUser(DeleteUserRequest request) { + deleteUserCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a user, their profile, and all of their authored messages. + * + *

        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 (IdentityClient identityClient = IdentityClient.create()) {
        +   *   DeleteUserRequest request =
        +   *       DeleteUserRequest.newBuilder().setName(UserName.of("[USER]").toString()).build();
        +   *   ApiFuture future = identityClient.deleteUserCallable().futureCall(request);
        +   *   // Do something.
        +   *   future.get();
        +   * }
        +   * }
        + */ + public final UnaryCallable deleteUserCallable() { + return stub.deleteUserCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists all users. + * + *

        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 (IdentityClient identityClient = IdentityClient.create()) {
        +   *   ListUsersRequest request =
        +   *       ListUsersRequest.newBuilder()
        +   *           .setPageSize(883849137)
        +   *           .setPageToken("pageToken873572522")
        +   *           .build();
        +   *   for (User element : identityClient.listUsers(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 ListUsersPagedResponse listUsers(ListUsersRequest request) { + return listUsersPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists all users. + * + *

        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 (IdentityClient identityClient = IdentityClient.create()) {
        +   *   ListUsersRequest request =
        +   *       ListUsersRequest.newBuilder()
        +   *           .setPageSize(883849137)
        +   *           .setPageToken("pageToken873572522")
        +   *           .build();
        +   *   ApiFuture future = identityClient.listUsersPagedCallable().futureCall(request);
        +   *   // Do something.
        +   *   for (User element : future.get().iterateAll()) {
        +   *     // doThingsWith(element);
        +   *   }
        +   * }
        +   * }
        + */ + public final UnaryCallable listUsersPagedCallable() { + return stub.listUsersPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists all users. + * + *

        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 (IdentityClient identityClient = IdentityClient.create()) {
        +   *   ListUsersRequest request =
        +   *       ListUsersRequest.newBuilder()
        +   *           .setPageSize(883849137)
        +   *           .setPageToken("pageToken873572522")
        +   *           .build();
        +   *   while (true) {
        +   *     ListUsersResponse response = identityClient.listUsersCallable().call(request);
        +   *     for (User element : response.getUsersList()) {
        +   *       // doThingsWith(element);
        +   *     }
        +   *     String nextPageToken = response.getNextPageToken();
        +   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
        +   *       request = request.toBuilder().setPageToken(nextPageToken).build();
        +   *     } else {
        +   *       break;
        +   *     }
        +   *   }
        +   * }
        +   * }
        + */ + public final UnaryCallable listUsersCallable() { + return stub.listUsersCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists information about the supported locations for this service. + * + *

        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 (IdentityClient identityClient = IdentityClient.create()) {
        +   *   ListLocationsRequest request =
        +   *       ListLocationsRequest.newBuilder()
        +   *           .setName("name3373707")
        +   *           .setFilter("filter-1274492040")
        +   *           .setPageSize(883849137)
        +   *           .setPageToken("pageToken873572522")
        +   *           .build();
        +   *   for (Location element : identityClient.listLocations(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 ListLocationsPagedResponse listLocations(ListLocationsRequest request) { + return listLocationsPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists information about the supported locations for this service. + * + *

        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 (IdentityClient identityClient = IdentityClient.create()) {
        +   *   ListLocationsRequest request =
        +   *       ListLocationsRequest.newBuilder()
        +   *           .setName("name3373707")
        +   *           .setFilter("filter-1274492040")
        +   *           .setPageSize(883849137)
        +   *           .setPageToken("pageToken873572522")
        +   *           .build();
        +   *   ApiFuture future = identityClient.listLocationsPagedCallable().futureCall(request);
        +   *   // Do something.
        +   *   for (Location element : future.get().iterateAll()) {
        +   *     // doThingsWith(element);
        +   *   }
        +   * }
        +   * }
        + */ + public final UnaryCallable + listLocationsPagedCallable() { + return stub.listLocationsPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists information about the supported locations for this service. + * + *

        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 (IdentityClient identityClient = IdentityClient.create()) {
        +   *   ListLocationsRequest request =
        +   *       ListLocationsRequest.newBuilder()
        +   *           .setName("name3373707")
        +   *           .setFilter("filter-1274492040")
        +   *           .setPageSize(883849137)
        +   *           .setPageToken("pageToken873572522")
        +   *           .build();
        +   *   while (true) {
        +   *     ListLocationsResponse response = identityClient.listLocationsCallable().call(request);
        +   *     for (Location element : response.getLocationsList()) {
        +   *       // doThingsWith(element);
        +   *     }
        +   *     String nextPageToken = response.getNextPageToken();
        +   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
        +   *       request = request.toBuilder().setPageToken(nextPageToken).build();
        +   *     } else {
        +   *       break;
        +   *     }
        +   *   }
        +   * }
        +   * }
        + */ + public final UnaryCallable listLocationsCallable() { + return stub.listLocationsCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets information about a location. + * + *

        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 (IdentityClient identityClient = IdentityClient.create()) {
        +   *   GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build();
        +   *   Location response = identityClient.getLocation(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 Location getLocation(GetLocationRequest request) { + return getLocationCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets information about a location. + * + *

        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 (IdentityClient identityClient = IdentityClient.create()) {
        +   *   GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build();
        +   *   ApiFuture future = identityClient.getLocationCallable().futureCall(request);
        +   *   // Do something.
        +   *   Location response = future.get();
        +   * }
        +   * }
        + */ + public final UnaryCallable getLocationCallable() { + return stub.getLocationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Sets the access control policy on the specified resource. Replaces any existing policy. + * + *

        Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED` errors. + * + *

        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 (IdentityClient identityClient = IdentityClient.create()) {
        +   *   SetIamPolicyRequest request =
        +   *       SetIamPolicyRequest.newBuilder()
        +   *           .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString())
        +   *           .setPolicy(Policy.newBuilder().build())
        +   *           .setUpdateMask(FieldMask.newBuilder().build())
        +   *           .build();
        +   *   Policy response = identityClient.setIamPolicy(request);
        +   * }
        +   * }
        + * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Policy setIamPolicy(SetIamPolicyRequest request) { + return setIamPolicyCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Sets the access control policy on the specified resource. Replaces any existing policy. + * + *

        Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED` errors. + * + *

        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 (IdentityClient identityClient = IdentityClient.create()) {
        +   *   SetIamPolicyRequest request =
        +   *       SetIamPolicyRequest.newBuilder()
        +   *           .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString())
        +   *           .setPolicy(Policy.newBuilder().build())
        +   *           .setUpdateMask(FieldMask.newBuilder().build())
        +   *           .build();
        +   *   ApiFuture future = identityClient.setIamPolicyCallable().futureCall(request);
        +   *   // Do something.
        +   *   Policy response = future.get();
        +   * }
        +   * }
        + */ + public final UnaryCallable setIamPolicyCallable() { + return stub.setIamPolicyCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets the access control policy for a resource. Returns an empty policy if the resource exists + * and does not have a policy set. + * + *

        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 (IdentityClient identityClient = IdentityClient.create()) {
        +   *   GetIamPolicyRequest request =
        +   *       GetIamPolicyRequest.newBuilder()
        +   *           .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString())
        +   *           .setOptions(GetPolicyOptions.newBuilder().build())
        +   *           .build();
        +   *   Policy response = identityClient.getIamPolicy(request);
        +   * }
        +   * }
        + * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Policy getIamPolicy(GetIamPolicyRequest request) { + return getIamPolicyCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets the access control policy for a resource. Returns an empty policy if the resource exists + * and does not have a policy set. + * + *

        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 (IdentityClient identityClient = IdentityClient.create()) {
        +   *   GetIamPolicyRequest request =
        +   *       GetIamPolicyRequest.newBuilder()
        +   *           .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString())
        +   *           .setOptions(GetPolicyOptions.newBuilder().build())
        +   *           .build();
        +   *   ApiFuture future = identityClient.getIamPolicyCallable().futureCall(request);
        +   *   // Do something.
        +   *   Policy response = future.get();
        +   * }
        +   * }
        + */ + public final UnaryCallable getIamPolicyCallable() { + return stub.getIamPolicyCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Returns permissions that a caller has on the specified resource. If the resource does not + * exist, this will return an empty set of permissions, not a `NOT_FOUND` error. + * + *

        Note: This operation is designed to be used for building permission-aware UIs and + * command-line tools, not for authorization checking. This operation may "fail open" without + * warning. + * + *

        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 (IdentityClient identityClient = IdentityClient.create()) {
        +   *   TestIamPermissionsRequest request =
        +   *       TestIamPermissionsRequest.newBuilder()
        +   *           .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString())
        +   *           .addAllPermissions(new ArrayList())
        +   *           .build();
        +   *   TestIamPermissionsResponse response = identityClient.testIamPermissions(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 TestIamPermissionsResponse testIamPermissions(TestIamPermissionsRequest request) { + return testIamPermissionsCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Returns permissions that a caller has on the specified resource. If the resource does not + * exist, this will return an empty set of permissions, not a `NOT_FOUND` error. + * + *

        Note: This operation is designed to be used for building permission-aware UIs and + * command-line tools, not for authorization checking. This operation may "fail open" without + * warning. + * + *

        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 (IdentityClient identityClient = IdentityClient.create()) {
        +   *   TestIamPermissionsRequest request =
        +   *       TestIamPermissionsRequest.newBuilder()
        +   *           .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString())
        +   *           .addAllPermissions(new ArrayList())
        +   *           .build();
        +   *   ApiFuture future =
        +   *       identityClient.testIamPermissionsCallable().futureCall(request);
        +   *   // Do something.
        +   *   TestIamPermissionsResponse response = future.get();
        +   * }
        +   * }
        + */ + public final UnaryCallable + testIamPermissionsCallable() { + return stub.testIamPermissionsCallable(); + } + + @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 ListUsersPagedResponse + extends AbstractPagedListResponse< + ListUsersRequest, ListUsersResponse, User, ListUsersPage, ListUsersFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListUsersPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, input -> new ListUsersPagedResponse(input), MoreExecutors.directExecutor()); + } + + private ListUsersPagedResponse(ListUsersPage page) { + super(page, ListUsersFixedSizeCollection.createEmptyCollection()); + } + } + + public static class ListUsersPage + extends AbstractPage { + + private ListUsersPage( + PageContext context, + ListUsersResponse response) { + super(context, response); + } + + private static ListUsersPage createEmptyPage() { + return new ListUsersPage(null, null); + } + + @Override + protected ListUsersPage createPage( + PageContext context, + ListUsersResponse response) { + return new ListUsersPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class ListUsersFixedSizeCollection + extends AbstractFixedSizeCollection< + ListUsersRequest, ListUsersResponse, User, ListUsersPage, ListUsersFixedSizeCollection> { + + private ListUsersFixedSizeCollection(List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListUsersFixedSizeCollection createEmptyCollection() { + return new ListUsersFixedSizeCollection(null, 0); + } + + @Override + protected ListUsersFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListUsersFixedSizeCollection(pages, collectionSize); + } + } + + public static class ListLocationsPagedResponse + extends AbstractPagedListResponse< + ListLocationsRequest, + ListLocationsResponse, + Location, + ListLocationsPage, + ListLocationsFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListLocationsPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + input -> new ListLocationsPagedResponse(input), + MoreExecutors.directExecutor()); + } + + private ListLocationsPagedResponse(ListLocationsPage page) { + super(page, ListLocationsFixedSizeCollection.createEmptyCollection()); + } + } + + public static class ListLocationsPage + extends AbstractPage< + ListLocationsRequest, ListLocationsResponse, Location, ListLocationsPage> { + + private ListLocationsPage( + PageContext context, + ListLocationsResponse response) { + super(context, response); + } + + private static ListLocationsPage createEmptyPage() { + return new ListLocationsPage(null, null); + } + + @Override + protected ListLocationsPage createPage( + PageContext context, + ListLocationsResponse response) { + return new ListLocationsPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class ListLocationsFixedSizeCollection + extends AbstractFixedSizeCollection< + ListLocationsRequest, + ListLocationsResponse, + Location, + ListLocationsPage, + ListLocationsFixedSizeCollection> { + + private ListLocationsFixedSizeCollection(List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListLocationsFixedSizeCollection createEmptyCollection() { + return new ListLocationsFixedSizeCollection(null, 0); + } + + @Override + protected ListLocationsFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListLocationsFixedSizeCollection(pages, collectionSize); + } + } +} diff --git a/java-showcase-3.21.0/gapic-showcase/src/main/java/com/google/showcase/v1beta1/IdentitySettings.java b/java-showcase-3.21.0/gapic-showcase/src/main/java/com/google/showcase/v1beta1/IdentitySettings.java new file mode 100644 index 0000000000..eb2dae0ce1 --- /dev/null +++ b/java-showcase-3.21.0/gapic-showcase/src/main/java/com/google/showcase/v1beta1/IdentitySettings.java @@ -0,0 +1,325 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1; + +import static com.google.showcase.v1beta1.IdentityClient.ListLocationsPagedResponse; +import static com.google.showcase.v1beta1.IdentityClient.ListUsersPagedResponse; + +import com.google.api.core.ApiFunction; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; +import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; +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.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.protobuf.Empty; +import com.google.showcase.v1beta1.stub.IdentityStubSettings; +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 IdentityClient}. + * + *

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

          + *
        • The default service address (localhost) and default port (7469) 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 createUser: + * + *

        {@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
        + * IdentitySettings.Builder identitySettingsBuilder = IdentitySettings.newBuilder();
        + * identitySettingsBuilder
        + *     .createUserSettings()
        + *     .setRetrySettings(
        + *         identitySettingsBuilder
        + *             .createUserSettings()
        + *             .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());
        + * IdentitySettings identitySettings = identitySettingsBuilder.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. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class IdentitySettings extends ClientSettings { + + /** Returns the object with the settings used for calls to createUser. */ + public UnaryCallSettings createUserSettings() { + return ((IdentityStubSettings) getStubSettings()).createUserSettings(); + } + + /** Returns the object with the settings used for calls to getUser. */ + public UnaryCallSettings getUserSettings() { + return ((IdentityStubSettings) getStubSettings()).getUserSettings(); + } + + /** Returns the object with the settings used for calls to updateUser. */ + public UnaryCallSettings updateUserSettings() { + return ((IdentityStubSettings) getStubSettings()).updateUserSettings(); + } + + /** Returns the object with the settings used for calls to deleteUser. */ + public UnaryCallSettings deleteUserSettings() { + return ((IdentityStubSettings) getStubSettings()).deleteUserSettings(); + } + + /** Returns the object with the settings used for calls to listUsers. */ + public PagedCallSettings + listUsersSettings() { + return ((IdentityStubSettings) getStubSettings()).listUsersSettings(); + } + + /** Returns the object with the settings used for calls to listLocations. */ + public PagedCallSettings + listLocationsSettings() { + return ((IdentityStubSettings) getStubSettings()).listLocationsSettings(); + } + + /** Returns the object with the settings used for calls to getLocation. */ + public UnaryCallSettings getLocationSettings() { + return ((IdentityStubSettings) getStubSettings()).getLocationSettings(); + } + + /** Returns the object with the settings used for calls to setIamPolicy. */ + public UnaryCallSettings setIamPolicySettings() { + return ((IdentityStubSettings) getStubSettings()).setIamPolicySettings(); + } + + /** Returns the object with the settings used for calls to getIamPolicy. */ + public UnaryCallSettings getIamPolicySettings() { + return ((IdentityStubSettings) getStubSettings()).getIamPolicySettings(); + } + + /** Returns the object with the settings used for calls to testIamPermissions. */ + public UnaryCallSettings + testIamPermissionsSettings() { + return ((IdentityStubSettings) getStubSettings()).testIamPermissionsSettings(); + } + + public static final IdentitySettings create(IdentityStubSettings stub) throws IOException { + return new IdentitySettings.Builder(stub.toBuilder()).build(); + } + + /** Returns a builder for the default ExecutorProvider for this service. */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return IdentityStubSettings.defaultExecutorProviderBuilder(); + } + + /** Returns the default service endpoint. */ + public static String getDefaultEndpoint() { + return IdentityStubSettings.getDefaultEndpoint(); + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return IdentityStubSettings.getDefaultServiceScopes(); + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return IdentityStubSettings.defaultCredentialsProviderBuilder(); + } + + /** Returns a builder for the default gRPC ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return IdentityStubSettings.defaultGrpcTransportProviderBuilder(); + } + + /** Returns a builder for the default REST ChannelProvider for this service. */ + @BetaApi + public static InstantiatingHttpJsonChannelProvider.Builder + defaultHttpJsonTransportProviderBuilder() { + return IdentityStubSettings.defaultHttpJsonTransportProviderBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return IdentityStubSettings.defaultTransportChannelProvider(); + } + + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return IdentityStubSettings.defaultApiClientHeaderProviderBuilder(); + } + + /** Returns a new gRPC builder for this class. */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** Returns a new REST builder for this class. */ + public static Builder newHttpJsonBuilder() { + return Builder.createHttpJsonDefault(); + } + + /** 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 IdentitySettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + } + + /** Builder for IdentitySettings. */ + public static class Builder extends ClientSettings.Builder { + + protected Builder() throws IOException { + this(((ClientContext) null)); + } + + protected Builder(ClientContext clientContext) { + super(IdentityStubSettings.newBuilder(clientContext)); + } + + protected Builder(IdentitySettings settings) { + super(settings.getStubSettings().toBuilder()); + } + + protected Builder(IdentityStubSettings.Builder stubSettings) { + super(stubSettings); + } + + private static Builder createDefault() { + return new Builder(IdentityStubSettings.newBuilder()); + } + + private static Builder createHttpJsonDefault() { + return new Builder(IdentityStubSettings.newHttpJsonBuilder()); + } + + public IdentityStubSettings.Builder getStubSettingsBuilder() { + return ((IdentityStubSettings.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 createUser. */ + public UnaryCallSettings.Builder createUserSettings() { + return getStubSettingsBuilder().createUserSettings(); + } + + /** Returns the builder for the settings used for calls to getUser. */ + public UnaryCallSettings.Builder getUserSettings() { + return getStubSettingsBuilder().getUserSettings(); + } + + /** Returns the builder for the settings used for calls to updateUser. */ + public UnaryCallSettings.Builder updateUserSettings() { + return getStubSettingsBuilder().updateUserSettings(); + } + + /** Returns the builder for the settings used for calls to deleteUser. */ + public UnaryCallSettings.Builder deleteUserSettings() { + return getStubSettingsBuilder().deleteUserSettings(); + } + + /** Returns the builder for the settings used for calls to listUsers. */ + public PagedCallSettings.Builder + listUsersSettings() { + return getStubSettingsBuilder().listUsersSettings(); + } + + /** Returns the builder for the settings used for calls to listLocations. */ + public PagedCallSettings.Builder< + ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse> + listLocationsSettings() { + return getStubSettingsBuilder().listLocationsSettings(); + } + + /** Returns the builder for the settings used for calls to getLocation. */ + public UnaryCallSettings.Builder getLocationSettings() { + return getStubSettingsBuilder().getLocationSettings(); + } + + /** Returns the builder for the settings used for calls to setIamPolicy. */ + public UnaryCallSettings.Builder setIamPolicySettings() { + return getStubSettingsBuilder().setIamPolicySettings(); + } + + /** Returns the builder for the settings used for calls to getIamPolicy. */ + public UnaryCallSettings.Builder getIamPolicySettings() { + return getStubSettingsBuilder().getIamPolicySettings(); + } + + /** Returns the builder for the settings used for calls to testIamPermissions. */ + public UnaryCallSettings.Builder + testIamPermissionsSettings() { + return getStubSettingsBuilder().testIamPermissionsSettings(); + } + + @Override + public IdentitySettings build() throws IOException { + return new IdentitySettings(this); + } + } +} diff --git a/java-showcase-3.21.0/gapic-showcase/src/main/java/com/google/showcase/v1beta1/MessagingClient.java b/java-showcase-3.21.0/gapic-showcase/src/main/java/com/google/showcase/v1beta1/MessagingClient.java new file mode 100644 index 0000000000..b5bfc0bb2a --- /dev/null +++ b/java-showcase-3.21.0/gapic-showcase/src/main/java/com/google/showcase/v1beta1/MessagingClient.java @@ -0,0 +1,2853 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1; + +import com.google.api.core.ApiFuture; +import com.google.api.core.ApiFutures; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.httpjson.longrunning.OperationsClient; +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.BidiStreamingCallable; +import com.google.api.gax.rpc.ClientStreamingCallable; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.common.util.concurrent.MoreExecutors; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.longrunning.Operation; +import com.google.protobuf.ByteString; +import com.google.protobuf.Empty; +import com.google.showcase.v1beta1.stub.MessagingStub; +import com.google.showcase.v1beta1.stub.MessagingStubSettings; +import java.io.IOException; +import java.util.List; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Service Description: A simple messaging service that implements chat rooms and profile posts. + * + *

        This messaging service showcases the features that API clients generated by gapic-generators + * implement. + * + *

        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 (MessagingClient messagingClient = MessagingClient.create()) {
        + *   String displayName = "displayName1714148973";
        + *   String description = "description-1724546052";
        + *   Room response = messagingClient.createRoom(displayName, description);
        + * }
        + * }
        + * + *

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

        CreateRoom

        Creates a room.

        + *

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

        + *
          + *
        • createRoom(CreateRoomRequest request) + *

        + *

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

        + *
          + *
        • createRoom(String displayName, String description) + *

        + *

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

        + *
          + *
        • createRoomCallable() + *

        + *

        GetRoom

        Retrieves the Room with the given resource name.

        + *

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

        + *
          + *
        • getRoom(GetRoomRequest request) + *

        + *

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

        + *
          + *
        • getRoom(RoomName name) + *

        • getRoom(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.

        + *
          + *
        • getRoomCallable() + *

        + *

        UpdateRoom

        Updates a room.

        + *

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

        + *
          + *
        • updateRoom(UpdateRoomRequest request) + *

        + *

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

        + *
          + *
        • updateRoomCallable() + *

        + *

        DeleteRoom

        Deletes a room and all of its blurbs.

        + *

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

        + *
          + *
        • deleteRoom(DeleteRoomRequest request) + *

        + *

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

        + *
          + *
        • deleteRoom(RoomName name) + *

        • deleteRoom(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.

        + *
          + *
        • deleteRoomCallable() + *

        + *

        ListRooms

        Lists all chat rooms.

        + *

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

        + *
          + *
        • listRooms(ListRoomsRequest request) + *

        + *

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

        + *
          + *
        • listRoomsPagedCallable() + *

        • listRoomsCallable() + *

        + *

        CreateBlurb

        Creates a blurb. If the parent is a room, the blurb is understood to be a message in that room. If the parent is a profile, the blurb is understood to be a post on the profile.

        + *

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

        + *
          + *
        • createBlurb(CreateBlurbRequest request) + *

        + *

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

        + *
          + *
        • createBlurb(ProfileName parent, UserName user, ByteString image) + *

        • createBlurb(ProfileName parent, UserName user, String text) + *

        • createBlurb(ProfileName parent, String user, ByteString image) + *

        • createBlurb(ProfileName parent, String user, String text) + *

        • createBlurb(RoomName parent, UserName user, ByteString image) + *

        • createBlurb(RoomName parent, UserName user, String text) + *

        • createBlurb(RoomName parent, String user, ByteString image) + *

        • createBlurb(RoomName parent, String user, String text) + *

        • createBlurb(String parent, UserName user, ByteString image) + *

        • createBlurb(String parent, UserName user, String text) + *

        • createBlurb(String parent, String user, ByteString image) + *

        • createBlurb(String parent, String user, String text) + *

        + *

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

        + *
          + *
        • createBlurbCallable() + *

        + *

        GetBlurb

        Retrieves the Blurb with the given resource name.

        + *

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

        + *
          + *
        • getBlurb(GetBlurbRequest request) + *

        + *

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

        + *
          + *
        • getBlurb(BlurbName name) + *

        • getBlurb(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.

        + *
          + *
        • getBlurbCallable() + *

        + *

        UpdateBlurb

        Updates a blurb.

        + *

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

        + *
          + *
        • updateBlurb(UpdateBlurbRequest request) + *

        + *

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

        + *
          + *
        • updateBlurbCallable() + *

        + *

        DeleteBlurb

        Deletes a blurb.

        + *

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

        + *
          + *
        • deleteBlurb(DeleteBlurbRequest request) + *

        + *

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

        + *
          + *
        • deleteBlurb(BlurbName name) + *

        • deleteBlurb(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.

        + *
          + *
        • deleteBlurbCallable() + *

        + *

        ListBlurbs

        Lists blurbs for a specific chat room or user profile depending on the parent resource name.

        + *

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

        + *
          + *
        • listBlurbs(ListBlurbsRequest request) + *

        + *

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

        + *
          + *
        • listBlurbs(ProfileName parent) + *

        • listBlurbs(RoomName parent) + *

        • listBlurbs(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.

        + *
          + *
        • listBlurbsPagedCallable() + *

        • listBlurbsCallable() + *

        + *

        SearchBlurbs

        This method searches through all blurbs across all rooms and profiles for blurbs containing to words found in the query. Only posts that contain an exact match of a queried word will be returned.

        + *

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

        + *
          + *
        • searchBlurbsAsync(SearchBlurbsRequest request) + *

        + *

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

        + *
          + *
        • searchBlurbsAsync(ProfileName parent, String query) + *

        • searchBlurbsAsync(RoomName parent, String query) + *

        • searchBlurbsAsync(String parent, String query) + *

        + *

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

        + *
          + *
        • searchBlurbsOperationCallable() + *

        • searchBlurbsCallable() + *

        + *

        StreamBlurbs

        This returns a stream that emits the blurbs that are created for a particular chat room or user profile.

        + *

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

        + *
          + *
        • streamBlurbsCallable() + *

        + *

        SendBlurbs

        This is a stream to create multiple blurbs. If an invalid blurb is requested to be created, the stream will close with an error.

        + *

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

        + *
          + *
        • sendBlurbsCallable() + *

        + *

        Connect

        This method starts a bidirectional stream that receives all blurbs that are being created after the stream has started and sends requests to create blurbs. If an invalid blurb is requested to be created, the stream will close with an error.

        + *

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

        + *
          + *
        • connectCallable() + *

        + *

        ListLocations

        Lists information about the supported locations for this service.

        + *

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

        + *
          + *
        • listLocations(ListLocationsRequest request) + *

        + *

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

        + *
          + *
        • listLocationsPagedCallable() + *

        • listLocationsCallable() + *

        + *

        GetLocation

        Gets information about a location.

        + *

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

        + *
          + *
        • getLocation(GetLocationRequest request) + *

        + *

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

        + *
          + *
        • getLocationCallable() + *

        + *

        SetIamPolicy

        Sets the access control policy on the specified resource. Replaces any existing policy. + *

        Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED` errors.

        + *

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

        + *
          + *
        • setIamPolicy(SetIamPolicyRequest request) + *

        + *

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

        + *
          + *
        • setIamPolicyCallable() + *

        + *

        GetIamPolicy

        Gets the access control policy for a resource. Returns an empty policy if the resource exists and does not have a policy set.

        + *

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

        + *
          + *
        • getIamPolicy(GetIamPolicyRequest request) + *

        + *

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

        + *
          + *
        • getIamPolicyCallable() + *

        + *

        TestIamPermissions

        Returns permissions that a caller has on the specified resource. If the resource does not exist, this will return an empty set of permissions, not a `NOT_FOUND` error. + *

        Note: This operation is designed to be used for building permission-aware UIs and command-line tools, not for authorization checking. This operation may "fail open" without warning.

        + *

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

        + *
          + *
        • testIamPermissions(TestIamPermissionsRequest request) + *

        + *

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

        + *
          + *
        • testIamPermissionsCallable() + *

        + *
        + * + *

        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 MessagingSettings 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
        + * MessagingSettings messagingSettings =
        + *     MessagingSettings.newBuilder()
        + *         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
        + *         .build();
        + * MessagingClient messagingClient = MessagingClient.create(messagingSettings);
        + * }
        + * + *

        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
        + * MessagingSettings messagingSettings =
        + *     MessagingSettings.newBuilder().setEndpoint(myEndpoint).build();
        + * MessagingClient messagingClient = MessagingClient.create(messagingSettings);
        + * }
        + * + *

        To use REST (HTTP1.1/JSON) transport (instead of gRPC) for sending and receiving requests over + * the wire: + * + *

        {@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
        + * MessagingSettings messagingSettings = MessagingSettings.newHttpJsonBuilder().build();
        + * MessagingClient messagingClient = MessagingClient.create(messagingSettings);
        + * }
        + * + *

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

        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 (MessagingClient messagingClient = MessagingClient.create()) {
        +   *   String displayName = "displayName1714148973";
        +   *   String description = "description-1724546052";
        +   *   Room response = messagingClient.createRoom(displayName, description);
        +   * }
        +   * }
        + * + * @param displayName The human readable name of the chat room. + * @param description The description of the chat room. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Room createRoom(String displayName, String description) { + CreateRoomRequest request = + CreateRoomRequest.newBuilder() + .setRoom( + Room.newBuilder().setDisplayName(displayName).setDescription(description).build()) + .build(); + return createRoom(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a room. + * + *

        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 (MessagingClient messagingClient = MessagingClient.create()) {
        +   *   CreateRoomRequest request =
        +   *       CreateRoomRequest.newBuilder().setRoom(Room.newBuilder().build()).build();
        +   *   Room response = messagingClient.createRoom(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 Room createRoom(CreateRoomRequest request) { + return createRoomCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a room. + * + *

        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 (MessagingClient messagingClient = MessagingClient.create()) {
        +   *   CreateRoomRequest request =
        +   *       CreateRoomRequest.newBuilder().setRoom(Room.newBuilder().build()).build();
        +   *   ApiFuture future = messagingClient.createRoomCallable().futureCall(request);
        +   *   // Do something.
        +   *   Room response = future.get();
        +   * }
        +   * }
        + */ + public final UnaryCallable createRoomCallable() { + return stub.createRoomCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Retrieves the Room with the given resource name. + * + *

        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 (MessagingClient messagingClient = MessagingClient.create()) {
        +   *   RoomName name = RoomName.of("[ROOM]");
        +   *   Room response = messagingClient.getRoom(name);
        +   * }
        +   * }
        + * + * @param name The resource name of the requested room. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Room getRoom(RoomName name) { + GetRoomRequest request = + GetRoomRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + return getRoom(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Retrieves the Room with the given resource name. + * + *

        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 (MessagingClient messagingClient = MessagingClient.create()) {
        +   *   String name = RoomName.of("[ROOM]").toString();
        +   *   Room response = messagingClient.getRoom(name);
        +   * }
        +   * }
        + * + * @param name The resource name of the requested room. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Room getRoom(String name) { + GetRoomRequest request = GetRoomRequest.newBuilder().setName(name).build(); + return getRoom(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Retrieves the Room with the given resource name. + * + *

        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 (MessagingClient messagingClient = MessagingClient.create()) {
        +   *   GetRoomRequest request =
        +   *       GetRoomRequest.newBuilder().setName(RoomName.of("[ROOM]").toString()).build();
        +   *   Room response = messagingClient.getRoom(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 Room getRoom(GetRoomRequest request) { + return getRoomCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Retrieves the Room with the given resource name. + * + *

        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 (MessagingClient messagingClient = MessagingClient.create()) {
        +   *   GetRoomRequest request =
        +   *       GetRoomRequest.newBuilder().setName(RoomName.of("[ROOM]").toString()).build();
        +   *   ApiFuture future = messagingClient.getRoomCallable().futureCall(request);
        +   *   // Do something.
        +   *   Room response = future.get();
        +   * }
        +   * }
        + */ + public final UnaryCallable getRoomCallable() { + return stub.getRoomCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates a room. + * + *

        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 (MessagingClient messagingClient = MessagingClient.create()) {
        +   *   UpdateRoomRequest request =
        +   *       UpdateRoomRequest.newBuilder()
        +   *           .setRoom(Room.newBuilder().build())
        +   *           .setUpdateMask(FieldMask.newBuilder().build())
        +   *           .build();
        +   *   Room response = messagingClient.updateRoom(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 Room updateRoom(UpdateRoomRequest request) { + return updateRoomCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates a room. + * + *

        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 (MessagingClient messagingClient = MessagingClient.create()) {
        +   *   UpdateRoomRequest request =
        +   *       UpdateRoomRequest.newBuilder()
        +   *           .setRoom(Room.newBuilder().build())
        +   *           .setUpdateMask(FieldMask.newBuilder().build())
        +   *           .build();
        +   *   ApiFuture future = messagingClient.updateRoomCallable().futureCall(request);
        +   *   // Do something.
        +   *   Room response = future.get();
        +   * }
        +   * }
        + */ + public final UnaryCallable updateRoomCallable() { + return stub.updateRoomCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a room and all of its blurbs. + * + *

        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 (MessagingClient messagingClient = MessagingClient.create()) {
        +   *   RoomName name = RoomName.of("[ROOM]");
        +   *   messagingClient.deleteRoom(name);
        +   * }
        +   * }
        + * + * @param name The resource name of the requested room. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final void deleteRoom(RoomName name) { + DeleteRoomRequest request = + DeleteRoomRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + deleteRoom(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a room and all of its blurbs. + * + *

        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 (MessagingClient messagingClient = MessagingClient.create()) {
        +   *   String name = RoomName.of("[ROOM]").toString();
        +   *   messagingClient.deleteRoom(name);
        +   * }
        +   * }
        + * + * @param name The resource name of the requested room. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final void deleteRoom(String name) { + DeleteRoomRequest request = DeleteRoomRequest.newBuilder().setName(name).build(); + deleteRoom(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a room and all of its blurbs. + * + *

        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 (MessagingClient messagingClient = MessagingClient.create()) {
        +   *   DeleteRoomRequest request =
        +   *       DeleteRoomRequest.newBuilder().setName(RoomName.of("[ROOM]").toString()).build();
        +   *   messagingClient.deleteRoom(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 deleteRoom(DeleteRoomRequest request) { + deleteRoomCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a room and all of its blurbs. + * + *

        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 (MessagingClient messagingClient = MessagingClient.create()) {
        +   *   DeleteRoomRequest request =
        +   *       DeleteRoomRequest.newBuilder().setName(RoomName.of("[ROOM]").toString()).build();
        +   *   ApiFuture future = messagingClient.deleteRoomCallable().futureCall(request);
        +   *   // Do something.
        +   *   future.get();
        +   * }
        +   * }
        + */ + public final UnaryCallable deleteRoomCallable() { + return stub.deleteRoomCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists all chat rooms. + * + *

        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 (MessagingClient messagingClient = MessagingClient.create()) {
        +   *   ListRoomsRequest request =
        +   *       ListRoomsRequest.newBuilder()
        +   *           .setPageSize(883849137)
        +   *           .setPageToken("pageToken873572522")
        +   *           .build();
        +   *   for (Room element : messagingClient.listRooms(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 ListRoomsPagedResponse listRooms(ListRoomsRequest request) { + return listRoomsPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists all chat rooms. + * + *

        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 (MessagingClient messagingClient = MessagingClient.create()) {
        +   *   ListRoomsRequest request =
        +   *       ListRoomsRequest.newBuilder()
        +   *           .setPageSize(883849137)
        +   *           .setPageToken("pageToken873572522")
        +   *           .build();
        +   *   ApiFuture future = messagingClient.listRoomsPagedCallable().futureCall(request);
        +   *   // Do something.
        +   *   for (Room element : future.get().iterateAll()) {
        +   *     // doThingsWith(element);
        +   *   }
        +   * }
        +   * }
        + */ + public final UnaryCallable listRoomsPagedCallable() { + return stub.listRoomsPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists all chat rooms. + * + *

        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 (MessagingClient messagingClient = MessagingClient.create()) {
        +   *   ListRoomsRequest request =
        +   *       ListRoomsRequest.newBuilder()
        +   *           .setPageSize(883849137)
        +   *           .setPageToken("pageToken873572522")
        +   *           .build();
        +   *   while (true) {
        +   *     ListRoomsResponse response = messagingClient.listRoomsCallable().call(request);
        +   *     for (Room element : response.getRoomsList()) {
        +   *       // doThingsWith(element);
        +   *     }
        +   *     String nextPageToken = response.getNextPageToken();
        +   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
        +   *       request = request.toBuilder().setPageToken(nextPageToken).build();
        +   *     } else {
        +   *       break;
        +   *     }
        +   *   }
        +   * }
        +   * }
        + */ + public final UnaryCallable listRoomsCallable() { + return stub.listRoomsCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a blurb. If the parent is a room, the blurb is understood to be a message in that room. + * If the parent is a profile, the blurb is understood to be a post on the profile. + * + *

        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 (MessagingClient messagingClient = MessagingClient.create()) {
        +   *   ProfileName parent = ProfileName.of("[USER]");
        +   *   UserName user = UserName.of("[USER]");
        +   *   ByteString image = ByteString.EMPTY;
        +   *   Blurb response = messagingClient.createBlurb(parent, user, image);
        +   * }
        +   * }
        + * + * @param parent The resource name of the chat room or user profile that this blurb will be tied + * to. + * @param user The resource name of the blurb's author. + * @param image The image content of this blurb. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Blurb createBlurb(ProfileName parent, UserName user, ByteString image) { + CreateBlurbRequest request = + CreateBlurbRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .setBlurb( + Blurb.newBuilder() + .setUser(user == null ? null : user.toString()) + .setImage(image) + .build()) + .build(); + return createBlurb(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a blurb. If the parent is a room, the blurb is understood to be a message in that room. + * If the parent is a profile, the blurb is understood to be a post on the profile. + * + *

        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 (MessagingClient messagingClient = MessagingClient.create()) {
        +   *   ProfileName parent = ProfileName.of("[USER]");
        +   *   UserName user = UserName.of("[USER]");
        +   *   String text = "text3556653";
        +   *   Blurb response = messagingClient.createBlurb(parent, user, text);
        +   * }
        +   * }
        + * + * @param parent The resource name of the chat room or user profile that this blurb will be tied + * to. + * @param user The resource name of the blurb's author. + * @param text The textual content of this blurb. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Blurb createBlurb(ProfileName parent, UserName user, String text) { + CreateBlurbRequest request = + CreateBlurbRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .setBlurb( + Blurb.newBuilder() + .setUser(user == null ? null : user.toString()) + .setText(text) + .build()) + .build(); + return createBlurb(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a blurb. If the parent is a room, the blurb is understood to be a message in that room. + * If the parent is a profile, the blurb is understood to be a post on the profile. + * + *

        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 (MessagingClient messagingClient = MessagingClient.create()) {
        +   *   ProfileName parent = ProfileName.of("[USER]");
        +   *   String user = UserName.of("[USER]").toString();
        +   *   ByteString image = ByteString.EMPTY;
        +   *   Blurb response = messagingClient.createBlurb(parent, user, image);
        +   * }
        +   * }
        + * + * @param parent The resource name of the chat room or user profile that this blurb will be tied + * to. + * @param user The resource name of the blurb's author. + * @param image The image content of this blurb. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Blurb createBlurb(ProfileName parent, String user, ByteString image) { + CreateBlurbRequest request = + CreateBlurbRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .setBlurb(Blurb.newBuilder().setUser(user).setImage(image).build()) + .build(); + return createBlurb(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a blurb. If the parent is a room, the blurb is understood to be a message in that room. + * If the parent is a profile, the blurb is understood to be a post on the profile. + * + *

        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 (MessagingClient messagingClient = MessagingClient.create()) {
        +   *   ProfileName parent = ProfileName.of("[USER]");
        +   *   String user = UserName.of("[USER]").toString();
        +   *   String text = "text3556653";
        +   *   Blurb response = messagingClient.createBlurb(parent, user, text);
        +   * }
        +   * }
        + * + * @param parent The resource name of the chat room or user profile that this blurb will be tied + * to. + * @param user The resource name of the blurb's author. + * @param text The textual content of this blurb. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Blurb createBlurb(ProfileName parent, String user, String text) { + CreateBlurbRequest request = + CreateBlurbRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .setBlurb(Blurb.newBuilder().setUser(user).setText(text).build()) + .build(); + return createBlurb(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a blurb. If the parent is a room, the blurb is understood to be a message in that room. + * If the parent is a profile, the blurb is understood to be a post on the profile. + * + *

        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 (MessagingClient messagingClient = MessagingClient.create()) {
        +   *   RoomName parent = RoomName.of("[ROOM]");
        +   *   UserName user = UserName.of("[USER]");
        +   *   ByteString image = ByteString.EMPTY;
        +   *   Blurb response = messagingClient.createBlurb(parent, user, image);
        +   * }
        +   * }
        + * + * @param parent The resource name of the chat room or user profile that this blurb will be tied + * to. + * @param user The resource name of the blurb's author. + * @param image The image content of this blurb. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Blurb createBlurb(RoomName parent, UserName user, ByteString image) { + CreateBlurbRequest request = + CreateBlurbRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .setBlurb( + Blurb.newBuilder() + .setUser(user == null ? null : user.toString()) + .setImage(image) + .build()) + .build(); + return createBlurb(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a blurb. If the parent is a room, the blurb is understood to be a message in that room. + * If the parent is a profile, the blurb is understood to be a post on the profile. + * + *

        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 (MessagingClient messagingClient = MessagingClient.create()) {
        +   *   RoomName parent = RoomName.of("[ROOM]");
        +   *   UserName user = UserName.of("[USER]");
        +   *   String text = "text3556653";
        +   *   Blurb response = messagingClient.createBlurb(parent, user, text);
        +   * }
        +   * }
        + * + * @param parent The resource name of the chat room or user profile that this blurb will be tied + * to. + * @param user The resource name of the blurb's author. + * @param text The textual content of this blurb. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Blurb createBlurb(RoomName parent, UserName user, String text) { + CreateBlurbRequest request = + CreateBlurbRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .setBlurb( + Blurb.newBuilder() + .setUser(user == null ? null : user.toString()) + .setText(text) + .build()) + .build(); + return createBlurb(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a blurb. If the parent is a room, the blurb is understood to be a message in that room. + * If the parent is a profile, the blurb is understood to be a post on the profile. + * + *

        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 (MessagingClient messagingClient = MessagingClient.create()) {
        +   *   RoomName parent = RoomName.of("[ROOM]");
        +   *   String user = UserName.of("[USER]").toString();
        +   *   ByteString image = ByteString.EMPTY;
        +   *   Blurb response = messagingClient.createBlurb(parent, user, image);
        +   * }
        +   * }
        + * + * @param parent The resource name of the chat room or user profile that this blurb will be tied + * to. + * @param user The resource name of the blurb's author. + * @param image The image content of this blurb. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Blurb createBlurb(RoomName parent, String user, ByteString image) { + CreateBlurbRequest request = + CreateBlurbRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .setBlurb(Blurb.newBuilder().setUser(user).setImage(image).build()) + .build(); + return createBlurb(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a blurb. If the parent is a room, the blurb is understood to be a message in that room. + * If the parent is a profile, the blurb is understood to be a post on the profile. + * + *

        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 (MessagingClient messagingClient = MessagingClient.create()) {
        +   *   RoomName parent = RoomName.of("[ROOM]");
        +   *   String user = UserName.of("[USER]").toString();
        +   *   String text = "text3556653";
        +   *   Blurb response = messagingClient.createBlurb(parent, user, text);
        +   * }
        +   * }
        + * + * @param parent The resource name of the chat room or user profile that this blurb will be tied + * to. + * @param user The resource name of the blurb's author. + * @param text The textual content of this blurb. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Blurb createBlurb(RoomName parent, String user, String text) { + CreateBlurbRequest request = + CreateBlurbRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .setBlurb(Blurb.newBuilder().setUser(user).setText(text).build()) + .build(); + return createBlurb(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a blurb. If the parent is a room, the blurb is understood to be a message in that room. + * If the parent is a profile, the blurb is understood to be a post on the profile. + * + *

        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 (MessagingClient messagingClient = MessagingClient.create()) {
        +   *   String parent = ProfileName.of("[USER]").toString();
        +   *   UserName user = UserName.of("[USER]");
        +   *   ByteString image = ByteString.EMPTY;
        +   *   Blurb response = messagingClient.createBlurb(parent, user, image);
        +   * }
        +   * }
        + * + * @param parent The resource name of the chat room or user profile that this blurb will be tied + * to. + * @param user The resource name of the blurb's author. + * @param image The image content of this blurb. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Blurb createBlurb(String parent, UserName user, ByteString image) { + CreateBlurbRequest request = + CreateBlurbRequest.newBuilder() + .setParent(parent) + .setBlurb( + Blurb.newBuilder() + .setUser(user == null ? null : user.toString()) + .setImage(image) + .build()) + .build(); + return createBlurb(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a blurb. If the parent is a room, the blurb is understood to be a message in that room. + * If the parent is a profile, the blurb is understood to be a post on the profile. + * + *

        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 (MessagingClient messagingClient = MessagingClient.create()) {
        +   *   String parent = ProfileName.of("[USER]").toString();
        +   *   UserName user = UserName.of("[USER]");
        +   *   String text = "text3556653";
        +   *   Blurb response = messagingClient.createBlurb(parent, user, text);
        +   * }
        +   * }
        + * + * @param parent The resource name of the chat room or user profile that this blurb will be tied + * to. + * @param user The resource name of the blurb's author. + * @param text The textual content of this blurb. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Blurb createBlurb(String parent, UserName user, String text) { + CreateBlurbRequest request = + CreateBlurbRequest.newBuilder() + .setParent(parent) + .setBlurb( + Blurb.newBuilder() + .setUser(user == null ? null : user.toString()) + .setText(text) + .build()) + .build(); + return createBlurb(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a blurb. If the parent is a room, the blurb is understood to be a message in that room. + * If the parent is a profile, the blurb is understood to be a post on the profile. + * + *

        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 (MessagingClient messagingClient = MessagingClient.create()) {
        +   *   String parent = ProfileName.of("[USER]").toString();
        +   *   String user = UserName.of("[USER]").toString();
        +   *   ByteString image = ByteString.EMPTY;
        +   *   Blurb response = messagingClient.createBlurb(parent, user, image);
        +   * }
        +   * }
        + * + * @param parent The resource name of the chat room or user profile that this blurb will be tied + * to. + * @param user The resource name of the blurb's author. + * @param image The image content of this blurb. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Blurb createBlurb(String parent, String user, ByteString image) { + CreateBlurbRequest request = + CreateBlurbRequest.newBuilder() + .setParent(parent) + .setBlurb(Blurb.newBuilder().setUser(user).setImage(image).build()) + .build(); + return createBlurb(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a blurb. If the parent is a room, the blurb is understood to be a message in that room. + * If the parent is a profile, the blurb is understood to be a post on the profile. + * + *

        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 (MessagingClient messagingClient = MessagingClient.create()) {
        +   *   String parent = ProfileName.of("[USER]").toString();
        +   *   String user = UserName.of("[USER]").toString();
        +   *   String text = "text3556653";
        +   *   Blurb response = messagingClient.createBlurb(parent, user, text);
        +   * }
        +   * }
        + * + * @param parent The resource name of the chat room or user profile that this blurb will be tied + * to. + * @param user The resource name of the blurb's author. + * @param text The textual content of this blurb. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Blurb createBlurb(String parent, String user, String text) { + CreateBlurbRequest request = + CreateBlurbRequest.newBuilder() + .setParent(parent) + .setBlurb(Blurb.newBuilder().setUser(user).setText(text).build()) + .build(); + return createBlurb(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a blurb. If the parent is a room, the blurb is understood to be a message in that room. + * If the parent is a profile, the blurb is understood to be a post on the profile. + * + *

        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 (MessagingClient messagingClient = MessagingClient.create()) {
        +   *   CreateBlurbRequest request =
        +   *       CreateBlurbRequest.newBuilder()
        +   *           .setParent(ProfileName.of("[USER]").toString())
        +   *           .setBlurb(Blurb.newBuilder().build())
        +   *           .build();
        +   *   Blurb response = messagingClient.createBlurb(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 Blurb createBlurb(CreateBlurbRequest request) { + return createBlurbCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a blurb. If the parent is a room, the blurb is understood to be a message in that room. + * If the parent is a profile, the blurb is understood to be a post on the profile. + * + *

        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 (MessagingClient messagingClient = MessagingClient.create()) {
        +   *   CreateBlurbRequest request =
        +   *       CreateBlurbRequest.newBuilder()
        +   *           .setParent(ProfileName.of("[USER]").toString())
        +   *           .setBlurb(Blurb.newBuilder().build())
        +   *           .build();
        +   *   ApiFuture future = messagingClient.createBlurbCallable().futureCall(request);
        +   *   // Do something.
        +   *   Blurb response = future.get();
        +   * }
        +   * }
        + */ + public final UnaryCallable createBlurbCallable() { + return stub.createBlurbCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Retrieves the Blurb with the given resource name. + * + *

        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 (MessagingClient messagingClient = MessagingClient.create()) {
        +   *   BlurbName name = BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]");
        +   *   Blurb response = messagingClient.getBlurb(name);
        +   * }
        +   * }
        + * + * @param name The resource name of the requested blurb. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Blurb getBlurb(BlurbName name) { + GetBlurbRequest request = + GetBlurbRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + return getBlurb(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Retrieves the Blurb with the given resource name. + * + *

        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 (MessagingClient messagingClient = MessagingClient.create()) {
        +   *   String name =
        +   *       BlurbName.ofUserLegacyUserBlurbName("[USER]", "[LEGACY_USER]", "[BLURB]").toString();
        +   *   Blurb response = messagingClient.getBlurb(name);
        +   * }
        +   * }
        + * + * @param name The resource name of the requested blurb. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Blurb getBlurb(String name) { + GetBlurbRequest request = GetBlurbRequest.newBuilder().setName(name).build(); + return getBlurb(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Retrieves the Blurb with the given resource name. + * + *

        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 (MessagingClient messagingClient = MessagingClient.create()) {
        +   *   GetBlurbRequest request =
        +   *       GetBlurbRequest.newBuilder()
        +   *           .setName(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString())
        +   *           .build();
        +   *   Blurb response = messagingClient.getBlurb(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 Blurb getBlurb(GetBlurbRequest request) { + return getBlurbCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Retrieves the Blurb with the given resource name. + * + *

        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 (MessagingClient messagingClient = MessagingClient.create()) {
        +   *   GetBlurbRequest request =
        +   *       GetBlurbRequest.newBuilder()
        +   *           .setName(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString())
        +   *           .build();
        +   *   ApiFuture future = messagingClient.getBlurbCallable().futureCall(request);
        +   *   // Do something.
        +   *   Blurb response = future.get();
        +   * }
        +   * }
        + */ + public final UnaryCallable getBlurbCallable() { + return stub.getBlurbCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates a blurb. + * + *

        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 (MessagingClient messagingClient = MessagingClient.create()) {
        +   *   UpdateBlurbRequest request =
        +   *       UpdateBlurbRequest.newBuilder()
        +   *           .setBlurb(Blurb.newBuilder().build())
        +   *           .setUpdateMask(FieldMask.newBuilder().build())
        +   *           .build();
        +   *   Blurb response = messagingClient.updateBlurb(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 Blurb updateBlurb(UpdateBlurbRequest request) { + return updateBlurbCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates a blurb. + * + *

        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 (MessagingClient messagingClient = MessagingClient.create()) {
        +   *   UpdateBlurbRequest request =
        +   *       UpdateBlurbRequest.newBuilder()
        +   *           .setBlurb(Blurb.newBuilder().build())
        +   *           .setUpdateMask(FieldMask.newBuilder().build())
        +   *           .build();
        +   *   ApiFuture future = messagingClient.updateBlurbCallable().futureCall(request);
        +   *   // Do something.
        +   *   Blurb response = future.get();
        +   * }
        +   * }
        + */ + public final UnaryCallable updateBlurbCallable() { + return stub.updateBlurbCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a blurb. + * + *

        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 (MessagingClient messagingClient = MessagingClient.create()) {
        +   *   BlurbName name = BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]");
        +   *   messagingClient.deleteBlurb(name);
        +   * }
        +   * }
        + * + * @param name The resource name of the requested blurb. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final void deleteBlurb(BlurbName name) { + DeleteBlurbRequest request = + DeleteBlurbRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + deleteBlurb(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a blurb. + * + *

        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 (MessagingClient messagingClient = MessagingClient.create()) {
        +   *   String name =
        +   *       BlurbName.ofUserLegacyUserBlurbName("[USER]", "[LEGACY_USER]", "[BLURB]").toString();
        +   *   messagingClient.deleteBlurb(name);
        +   * }
        +   * }
        + * + * @param name The resource name of the requested blurb. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final void deleteBlurb(String name) { + DeleteBlurbRequest request = DeleteBlurbRequest.newBuilder().setName(name).build(); + deleteBlurb(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a blurb. + * + *

        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 (MessagingClient messagingClient = MessagingClient.create()) {
        +   *   DeleteBlurbRequest request =
        +   *       DeleteBlurbRequest.newBuilder()
        +   *           .setName(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString())
        +   *           .build();
        +   *   messagingClient.deleteBlurb(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 deleteBlurb(DeleteBlurbRequest request) { + deleteBlurbCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a blurb. + * + *

        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 (MessagingClient messagingClient = MessagingClient.create()) {
        +   *   DeleteBlurbRequest request =
        +   *       DeleteBlurbRequest.newBuilder()
        +   *           .setName(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString())
        +   *           .build();
        +   *   ApiFuture future = messagingClient.deleteBlurbCallable().futureCall(request);
        +   *   // Do something.
        +   *   future.get();
        +   * }
        +   * }
        + */ + public final UnaryCallable deleteBlurbCallable() { + return stub.deleteBlurbCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists blurbs for a specific chat room or user profile depending on the parent resource name. + * + *

        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 (MessagingClient messagingClient = MessagingClient.create()) {
        +   *   ProfileName parent = ProfileName.of("[USER]");
        +   *   for (Blurb element : messagingClient.listBlurbs(parent).iterateAll()) {
        +   *     // doThingsWith(element);
        +   *   }
        +   * }
        +   * }
        + * + * @param parent The resource name of the requested room or profile who blurbs to list. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListBlurbsPagedResponse listBlurbs(ProfileName parent) { + ListBlurbsRequest request = + ListBlurbsRequest.newBuilder().setParent(parent == null ? null : parent.toString()).build(); + return listBlurbs(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists blurbs for a specific chat room or user profile depending on the parent resource name. + * + *

        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 (MessagingClient messagingClient = MessagingClient.create()) {
        +   *   RoomName parent = RoomName.of("[ROOM]");
        +   *   for (Blurb element : messagingClient.listBlurbs(parent).iterateAll()) {
        +   *     // doThingsWith(element);
        +   *   }
        +   * }
        +   * }
        + * + * @param parent The resource name of the requested room or profile who blurbs to list. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListBlurbsPagedResponse listBlurbs(RoomName parent) { + ListBlurbsRequest request = + ListBlurbsRequest.newBuilder().setParent(parent == null ? null : parent.toString()).build(); + return listBlurbs(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists blurbs for a specific chat room or user profile depending on the parent resource name. + * + *

        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 (MessagingClient messagingClient = MessagingClient.create()) {
        +   *   String parent = ProfileName.of("[USER]").toString();
        +   *   for (Blurb element : messagingClient.listBlurbs(parent).iterateAll()) {
        +   *     // doThingsWith(element);
        +   *   }
        +   * }
        +   * }
        + * + * @param parent The resource name of the requested room or profile who blurbs to list. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListBlurbsPagedResponse listBlurbs(String parent) { + ListBlurbsRequest request = ListBlurbsRequest.newBuilder().setParent(parent).build(); + return listBlurbs(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists blurbs for a specific chat room or user profile depending on the parent resource name. + * + *

        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 (MessagingClient messagingClient = MessagingClient.create()) {
        +   *   ListBlurbsRequest request =
        +   *       ListBlurbsRequest.newBuilder()
        +   *           .setParent(ProfileName.of("[USER]").toString())
        +   *           .setPageSize(883849137)
        +   *           .setPageToken("pageToken873572522")
        +   *           .build();
        +   *   for (Blurb element : messagingClient.listBlurbs(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 ListBlurbsPagedResponse listBlurbs(ListBlurbsRequest request) { + return listBlurbsPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists blurbs for a specific chat room or user profile depending on the parent resource name. + * + *

        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 (MessagingClient messagingClient = MessagingClient.create()) {
        +   *   ListBlurbsRequest request =
        +   *       ListBlurbsRequest.newBuilder()
        +   *           .setParent(ProfileName.of("[USER]").toString())
        +   *           .setPageSize(883849137)
        +   *           .setPageToken("pageToken873572522")
        +   *           .build();
        +   *   ApiFuture future = messagingClient.listBlurbsPagedCallable().futureCall(request);
        +   *   // Do something.
        +   *   for (Blurb element : future.get().iterateAll()) {
        +   *     // doThingsWith(element);
        +   *   }
        +   * }
        +   * }
        + */ + public final UnaryCallable listBlurbsPagedCallable() { + return stub.listBlurbsPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists blurbs for a specific chat room or user profile depending on the parent resource name. + * + *

        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 (MessagingClient messagingClient = MessagingClient.create()) {
        +   *   ListBlurbsRequest request =
        +   *       ListBlurbsRequest.newBuilder()
        +   *           .setParent(ProfileName.of("[USER]").toString())
        +   *           .setPageSize(883849137)
        +   *           .setPageToken("pageToken873572522")
        +   *           .build();
        +   *   while (true) {
        +   *     ListBlurbsResponse response = messagingClient.listBlurbsCallable().call(request);
        +   *     for (Blurb element : response.getBlurbsList()) {
        +   *       // doThingsWith(element);
        +   *     }
        +   *     String nextPageToken = response.getNextPageToken();
        +   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
        +   *       request = request.toBuilder().setPageToken(nextPageToken).build();
        +   *     } else {
        +   *       break;
        +   *     }
        +   *   }
        +   * }
        +   * }
        + */ + public final UnaryCallable listBlurbsCallable() { + return stub.listBlurbsCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * This method searches through all blurbs across all rooms and profiles for blurbs containing to + * words found in the query. Only posts that contain an exact match of a queried word will be + * returned. + * + *

        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 (MessagingClient messagingClient = MessagingClient.create()) {
        +   *   ProfileName parent = ProfileName.of("[USER]");
        +   *   String query = "query107944136";
        +   *   SearchBlurbsResponse response = messagingClient.searchBlurbsAsync(parent, query).get();
        +   * }
        +   * }
        + * + * @param parent The rooms or profiles to search. If unset, `SearchBlurbs` will search all rooms + * and all profiles. + * @param query The query used to search for blurbs containing to words of this string. Only posts + * that contain an exact match of a queried word will be returned. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture searchBlurbsAsync( + ProfileName parent, String query) { + SearchBlurbsRequest request = + SearchBlurbsRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .setQuery(query) + .build(); + return searchBlurbsAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * This method searches through all blurbs across all rooms and profiles for blurbs containing to + * words found in the query. Only posts that contain an exact match of a queried word will be + * returned. + * + *

        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 (MessagingClient messagingClient = MessagingClient.create()) {
        +   *   RoomName parent = RoomName.of("[ROOM]");
        +   *   String query = "query107944136";
        +   *   SearchBlurbsResponse response = messagingClient.searchBlurbsAsync(parent, query).get();
        +   * }
        +   * }
        + * + * @param parent The rooms or profiles to search. If unset, `SearchBlurbs` will search all rooms + * and all profiles. + * @param query The query used to search for blurbs containing to words of this string. Only posts + * that contain an exact match of a queried word will be returned. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture searchBlurbsAsync( + RoomName parent, String query) { + SearchBlurbsRequest request = + SearchBlurbsRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .setQuery(query) + .build(); + return searchBlurbsAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * This method searches through all blurbs across all rooms and profiles for blurbs containing to + * words found in the query. Only posts that contain an exact match of a queried word will be + * returned. + * + *

        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 (MessagingClient messagingClient = MessagingClient.create()) {
        +   *   String parent = ProfileName.of("[USER]").toString();
        +   *   String query = "query107944136";
        +   *   SearchBlurbsResponse response = messagingClient.searchBlurbsAsync(parent, query).get();
        +   * }
        +   * }
        + * + * @param parent The rooms or profiles to search. If unset, `SearchBlurbs` will search all rooms + * and all profiles. + * @param query The query used to search for blurbs containing to words of this string. Only posts + * that contain an exact match of a queried word will be returned. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture searchBlurbsAsync( + String parent, String query) { + SearchBlurbsRequest request = + SearchBlurbsRequest.newBuilder().setParent(parent).setQuery(query).build(); + return searchBlurbsAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * This method searches through all blurbs across all rooms and profiles for blurbs containing to + * words found in the query. Only posts that contain an exact match of a queried word will be + * returned. + * + *

        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 (MessagingClient messagingClient = MessagingClient.create()) {
        +   *   SearchBlurbsRequest request =
        +   *       SearchBlurbsRequest.newBuilder()
        +   *           .setQuery("query107944136")
        +   *           .setParent(ProfileName.of("[USER]").toString())
        +   *           .setPageSize(883849137)
        +   *           .setPageToken("pageToken873572522")
        +   *           .build();
        +   *   SearchBlurbsResponse response = messagingClient.searchBlurbsAsync(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 searchBlurbsAsync( + SearchBlurbsRequest request) { + return searchBlurbsOperationCallable().futureCall(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * This method searches through all blurbs across all rooms and profiles for blurbs containing to + * words found in the query. Only posts that contain an exact match of a queried word will be + * returned. + * + *

        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 (MessagingClient messagingClient = MessagingClient.create()) {
        +   *   SearchBlurbsRequest request =
        +   *       SearchBlurbsRequest.newBuilder()
        +   *           .setQuery("query107944136")
        +   *           .setParent(ProfileName.of("[USER]").toString())
        +   *           .setPageSize(883849137)
        +   *           .setPageToken("pageToken873572522")
        +   *           .build();
        +   *   OperationFuture future =
        +   *       messagingClient.searchBlurbsOperationCallable().futureCall(request);
        +   *   // Do something.
        +   *   SearchBlurbsResponse response = future.get();
        +   * }
        +   * }
        + */ + public final OperationCallable + searchBlurbsOperationCallable() { + return stub.searchBlurbsOperationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * This method searches through all blurbs across all rooms and profiles for blurbs containing to + * words found in the query. Only posts that contain an exact match of a queried word will be + * returned. + * + *

        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 (MessagingClient messagingClient = MessagingClient.create()) {
        +   *   SearchBlurbsRequest request =
        +   *       SearchBlurbsRequest.newBuilder()
        +   *           .setQuery("query107944136")
        +   *           .setParent(ProfileName.of("[USER]").toString())
        +   *           .setPageSize(883849137)
        +   *           .setPageToken("pageToken873572522")
        +   *           .build();
        +   *   ApiFuture future = messagingClient.searchBlurbsCallable().futureCall(request);
        +   *   // Do something.
        +   *   Operation response = future.get();
        +   * }
        +   * }
        + */ + public final UnaryCallable searchBlurbsCallable() { + return stub.searchBlurbsCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * This returns a stream that emits the blurbs that are created for a particular chat room or user + * profile. + * + *

        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 (MessagingClient messagingClient = MessagingClient.create()) {
        +   *   StreamBlurbsRequest request =
        +   *       StreamBlurbsRequest.newBuilder()
        +   *           .setName(ProfileName.of("[USER]").toString())
        +   *           .setExpireTime(Timestamp.newBuilder().build())
        +   *           .build();
        +   *   ServerStream stream =
        +   *       messagingClient.streamBlurbsCallable().call(request);
        +   *   for (StreamBlurbsResponse response : stream) {
        +   *     // Do something when a response is received.
        +   *   }
        +   * }
        +   * }
        + */ + public final ServerStreamingCallable + streamBlurbsCallable() { + return stub.streamBlurbsCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * This is a stream to create multiple blurbs. If an invalid blurb is requested to be created, the + * stream will close with an error. + * + *

        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 (MessagingClient messagingClient = MessagingClient.create()) {
        +   *   ApiStreamObserver responseObserver =
        +   *       new ApiStreamObserver() {
        +   *         {@literal @}Override
        +   *         public void onNext(SendBlurbsResponse response) {
        +   *           // Do something when a response is received.
        +   *         }
        +   *
        +   *         {@literal @}Override
        +   *         public void onError(Throwable t) {
        +   *           // Add error-handling
        +   *         }
        +   *
        +   *         {@literal @}Override
        +   *         public void onCompleted() {
        +   *           // Do something when complete.
        +   *         }
        +   *       };
        +   *   ApiStreamObserver requestObserver =
        +   *       messagingClient.sendBlurbs().clientStreamingCall(responseObserver);
        +   *   CreateBlurbRequest request =
        +   *       CreateBlurbRequest.newBuilder()
        +   *           .setParent(ProfileName.of("[USER]").toString())
        +   *           .setBlurb(Blurb.newBuilder().build())
        +   *           .build();
        +   *   requestObserver.onNext(request);
        +   * }
        +   * }
        + */ + public final ClientStreamingCallable + sendBlurbsCallable() { + return stub.sendBlurbsCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * This method starts a bidirectional stream that receives all blurbs that are being created after + * the stream has started and sends requests to create blurbs. If an invalid blurb is requested to + * be created, the stream will close with an error. + * + *

        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 (MessagingClient messagingClient = MessagingClient.create()) {
        +   *   BidiStream bidiStream =
        +   *       messagingClient.connectCallable().call();
        +   *   ConnectRequest request = ConnectRequest.newBuilder().build();
        +   *   bidiStream.send(request);
        +   *   for (StreamBlurbsResponse response : bidiStream) {
        +   *     // Do something when a response is received.
        +   *   }
        +   * }
        +   * }
        + */ + public final BidiStreamingCallable connectCallable() { + return stub.connectCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists information about the supported locations for this service. + * + *

        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 (MessagingClient messagingClient = MessagingClient.create()) {
        +   *   ListLocationsRequest request =
        +   *       ListLocationsRequest.newBuilder()
        +   *           .setName("name3373707")
        +   *           .setFilter("filter-1274492040")
        +   *           .setPageSize(883849137)
        +   *           .setPageToken("pageToken873572522")
        +   *           .build();
        +   *   for (Location element : messagingClient.listLocations(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 ListLocationsPagedResponse listLocations(ListLocationsRequest request) { + return listLocationsPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists information about the supported locations for this service. + * + *

        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 (MessagingClient messagingClient = MessagingClient.create()) {
        +   *   ListLocationsRequest request =
        +   *       ListLocationsRequest.newBuilder()
        +   *           .setName("name3373707")
        +   *           .setFilter("filter-1274492040")
        +   *           .setPageSize(883849137)
        +   *           .setPageToken("pageToken873572522")
        +   *           .build();
        +   *   ApiFuture future = messagingClient.listLocationsPagedCallable().futureCall(request);
        +   *   // Do something.
        +   *   for (Location element : future.get().iterateAll()) {
        +   *     // doThingsWith(element);
        +   *   }
        +   * }
        +   * }
        + */ + public final UnaryCallable + listLocationsPagedCallable() { + return stub.listLocationsPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists information about the supported locations for this service. + * + *

        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 (MessagingClient messagingClient = MessagingClient.create()) {
        +   *   ListLocationsRequest request =
        +   *       ListLocationsRequest.newBuilder()
        +   *           .setName("name3373707")
        +   *           .setFilter("filter-1274492040")
        +   *           .setPageSize(883849137)
        +   *           .setPageToken("pageToken873572522")
        +   *           .build();
        +   *   while (true) {
        +   *     ListLocationsResponse response = messagingClient.listLocationsCallable().call(request);
        +   *     for (Location element : response.getLocationsList()) {
        +   *       // doThingsWith(element);
        +   *     }
        +   *     String nextPageToken = response.getNextPageToken();
        +   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
        +   *       request = request.toBuilder().setPageToken(nextPageToken).build();
        +   *     } else {
        +   *       break;
        +   *     }
        +   *   }
        +   * }
        +   * }
        + */ + public final UnaryCallable listLocationsCallable() { + return stub.listLocationsCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets information about a location. + * + *

        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 (MessagingClient messagingClient = MessagingClient.create()) {
        +   *   GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build();
        +   *   Location response = messagingClient.getLocation(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 Location getLocation(GetLocationRequest request) { + return getLocationCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets information about a location. + * + *

        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 (MessagingClient messagingClient = MessagingClient.create()) {
        +   *   GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build();
        +   *   ApiFuture future = messagingClient.getLocationCallable().futureCall(request);
        +   *   // Do something.
        +   *   Location response = future.get();
        +   * }
        +   * }
        + */ + public final UnaryCallable getLocationCallable() { + return stub.getLocationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Sets the access control policy on the specified resource. Replaces any existing policy. + * + *

        Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED` errors. + * + *

        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 (MessagingClient messagingClient = MessagingClient.create()) {
        +   *   SetIamPolicyRequest request =
        +   *       SetIamPolicyRequest.newBuilder()
        +   *           .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString())
        +   *           .setPolicy(Policy.newBuilder().build())
        +   *           .setUpdateMask(FieldMask.newBuilder().build())
        +   *           .build();
        +   *   Policy response = messagingClient.setIamPolicy(request);
        +   * }
        +   * }
        + * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Policy setIamPolicy(SetIamPolicyRequest request) { + return setIamPolicyCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Sets the access control policy on the specified resource. Replaces any existing policy. + * + *

        Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED` errors. + * + *

        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 (MessagingClient messagingClient = MessagingClient.create()) {
        +   *   SetIamPolicyRequest request =
        +   *       SetIamPolicyRequest.newBuilder()
        +   *           .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString())
        +   *           .setPolicy(Policy.newBuilder().build())
        +   *           .setUpdateMask(FieldMask.newBuilder().build())
        +   *           .build();
        +   *   ApiFuture future = messagingClient.setIamPolicyCallable().futureCall(request);
        +   *   // Do something.
        +   *   Policy response = future.get();
        +   * }
        +   * }
        + */ + public final UnaryCallable setIamPolicyCallable() { + return stub.setIamPolicyCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets the access control policy for a resource. Returns an empty policy if the resource exists + * and does not have a policy set. + * + *

        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 (MessagingClient messagingClient = MessagingClient.create()) {
        +   *   GetIamPolicyRequest request =
        +   *       GetIamPolicyRequest.newBuilder()
        +   *           .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString())
        +   *           .setOptions(GetPolicyOptions.newBuilder().build())
        +   *           .build();
        +   *   Policy response = messagingClient.getIamPolicy(request);
        +   * }
        +   * }
        + * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Policy getIamPolicy(GetIamPolicyRequest request) { + return getIamPolicyCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets the access control policy for a resource. Returns an empty policy if the resource exists + * and does not have a policy set. + * + *

        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 (MessagingClient messagingClient = MessagingClient.create()) {
        +   *   GetIamPolicyRequest request =
        +   *       GetIamPolicyRequest.newBuilder()
        +   *           .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString())
        +   *           .setOptions(GetPolicyOptions.newBuilder().build())
        +   *           .build();
        +   *   ApiFuture future = messagingClient.getIamPolicyCallable().futureCall(request);
        +   *   // Do something.
        +   *   Policy response = future.get();
        +   * }
        +   * }
        + */ + public final UnaryCallable getIamPolicyCallable() { + return stub.getIamPolicyCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Returns permissions that a caller has on the specified resource. If the resource does not + * exist, this will return an empty set of permissions, not a `NOT_FOUND` error. + * + *

        Note: This operation is designed to be used for building permission-aware UIs and + * command-line tools, not for authorization checking. This operation may "fail open" without + * warning. + * + *

        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 (MessagingClient messagingClient = MessagingClient.create()) {
        +   *   TestIamPermissionsRequest request =
        +   *       TestIamPermissionsRequest.newBuilder()
        +   *           .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString())
        +   *           .addAllPermissions(new ArrayList())
        +   *           .build();
        +   *   TestIamPermissionsResponse response = messagingClient.testIamPermissions(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 TestIamPermissionsResponse testIamPermissions(TestIamPermissionsRequest request) { + return testIamPermissionsCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Returns permissions that a caller has on the specified resource. If the resource does not + * exist, this will return an empty set of permissions, not a `NOT_FOUND` error. + * + *

        Note: This operation is designed to be used for building permission-aware UIs and + * command-line tools, not for authorization checking. This operation may "fail open" without + * warning. + * + *

        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 (MessagingClient messagingClient = MessagingClient.create()) {
        +   *   TestIamPermissionsRequest request =
        +   *       TestIamPermissionsRequest.newBuilder()
        +   *           .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString())
        +   *           .addAllPermissions(new ArrayList())
        +   *           .build();
        +   *   ApiFuture future =
        +   *       messagingClient.testIamPermissionsCallable().futureCall(request);
        +   *   // Do something.
        +   *   TestIamPermissionsResponse response = future.get();
        +   * }
        +   * }
        + */ + public final UnaryCallable + testIamPermissionsCallable() { + return stub.testIamPermissionsCallable(); + } + + @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 ListRoomsPagedResponse + extends AbstractPagedListResponse< + ListRoomsRequest, ListRoomsResponse, Room, ListRoomsPage, ListRoomsFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListRoomsPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, input -> new ListRoomsPagedResponse(input), MoreExecutors.directExecutor()); + } + + private ListRoomsPagedResponse(ListRoomsPage page) { + super(page, ListRoomsFixedSizeCollection.createEmptyCollection()); + } + } + + public static class ListRoomsPage + extends AbstractPage { + + private ListRoomsPage( + PageContext context, + ListRoomsResponse response) { + super(context, response); + } + + private static ListRoomsPage createEmptyPage() { + return new ListRoomsPage(null, null); + } + + @Override + protected ListRoomsPage createPage( + PageContext context, + ListRoomsResponse response) { + return new ListRoomsPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class ListRoomsFixedSizeCollection + extends AbstractFixedSizeCollection< + ListRoomsRequest, ListRoomsResponse, Room, ListRoomsPage, ListRoomsFixedSizeCollection> { + + private ListRoomsFixedSizeCollection(List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListRoomsFixedSizeCollection createEmptyCollection() { + return new ListRoomsFixedSizeCollection(null, 0); + } + + @Override + protected ListRoomsFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListRoomsFixedSizeCollection(pages, collectionSize); + } + } + + public static class ListBlurbsPagedResponse + extends AbstractPagedListResponse< + ListBlurbsRequest, + ListBlurbsResponse, + Blurb, + ListBlurbsPage, + ListBlurbsFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListBlurbsPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, input -> new ListBlurbsPagedResponse(input), MoreExecutors.directExecutor()); + } + + private ListBlurbsPagedResponse(ListBlurbsPage page) { + super(page, ListBlurbsFixedSizeCollection.createEmptyCollection()); + } + } + + public static class ListBlurbsPage + extends AbstractPage { + + private ListBlurbsPage( + PageContext context, + ListBlurbsResponse response) { + super(context, response); + } + + private static ListBlurbsPage createEmptyPage() { + return new ListBlurbsPage(null, null); + } + + @Override + protected ListBlurbsPage createPage( + PageContext context, + ListBlurbsResponse response) { + return new ListBlurbsPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class ListBlurbsFixedSizeCollection + extends AbstractFixedSizeCollection< + ListBlurbsRequest, + ListBlurbsResponse, + Blurb, + ListBlurbsPage, + ListBlurbsFixedSizeCollection> { + + private ListBlurbsFixedSizeCollection(List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListBlurbsFixedSizeCollection createEmptyCollection() { + return new ListBlurbsFixedSizeCollection(null, 0); + } + + @Override + protected ListBlurbsFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListBlurbsFixedSizeCollection(pages, collectionSize); + } + } + + public static class ListLocationsPagedResponse + extends AbstractPagedListResponse< + ListLocationsRequest, + ListLocationsResponse, + Location, + ListLocationsPage, + ListLocationsFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListLocationsPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + input -> new ListLocationsPagedResponse(input), + MoreExecutors.directExecutor()); + } + + private ListLocationsPagedResponse(ListLocationsPage page) { + super(page, ListLocationsFixedSizeCollection.createEmptyCollection()); + } + } + + public static class ListLocationsPage + extends AbstractPage< + ListLocationsRequest, ListLocationsResponse, Location, ListLocationsPage> { + + private ListLocationsPage( + PageContext context, + ListLocationsResponse response) { + super(context, response); + } + + private static ListLocationsPage createEmptyPage() { + return new ListLocationsPage(null, null); + } + + @Override + protected ListLocationsPage createPage( + PageContext context, + ListLocationsResponse response) { + return new ListLocationsPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class ListLocationsFixedSizeCollection + extends AbstractFixedSizeCollection< + ListLocationsRequest, + ListLocationsResponse, + Location, + ListLocationsPage, + ListLocationsFixedSizeCollection> { + + private ListLocationsFixedSizeCollection(List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListLocationsFixedSizeCollection createEmptyCollection() { + return new ListLocationsFixedSizeCollection(null, 0); + } + + @Override + protected ListLocationsFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListLocationsFixedSizeCollection(pages, collectionSize); + } + } +} diff --git a/java-showcase-3.21.0/gapic-showcase/src/main/java/com/google/showcase/v1beta1/MessagingSettings.java b/java-showcase-3.21.0/gapic-showcase/src/main/java/com/google/showcase/v1beta1/MessagingSettings.java new file mode 100644 index 0000000000..377a43a4c4 --- /dev/null +++ b/java-showcase-3.21.0/gapic-showcase/src/main/java/com/google/showcase/v1beta1/MessagingSettings.java @@ -0,0 +1,463 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1; + +import static com.google.showcase.v1beta1.MessagingClient.ListBlurbsPagedResponse; +import static com.google.showcase.v1beta1.MessagingClient.ListLocationsPagedResponse; +import static com.google.showcase.v1beta1.MessagingClient.ListRoomsPagedResponse; + +import com.google.api.core.ApiFunction; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; +import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; +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.ServerStreamingCallSettings; +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.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.longrunning.Operation; +import com.google.protobuf.Empty; +import com.google.showcase.v1beta1.stub.MessagingStubSettings; +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 MessagingClient}. + * + *

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

          + *
        • The default service address (localhost) and default port (7469) 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 createRoom: + * + *

        {@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
        + * MessagingSettings.Builder messagingSettingsBuilder = MessagingSettings.newBuilder();
        + * messagingSettingsBuilder
        + *     .createRoomSettings()
        + *     .setRetrySettings(
        + *         messagingSettingsBuilder
        + *             .createRoomSettings()
        + *             .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());
        + * MessagingSettings messagingSettings = messagingSettingsBuilder.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 searchBlurbs: + * + *

        {@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
        + * MessagingSettings.Builder messagingSettingsBuilder = MessagingSettings.newBuilder();
        + * TimedRetryAlgorithm timedRetryAlgorithm =
        + *     OperationalTimedPollAlgorithm.create(
        + *         RetrySettings.newBuilder()
        + *             .setInitialRetryDelayDuration(Duration.ofMillis(500))
        + *             .setRetryDelayMultiplier(1.5)
        + *             .setMaxRetryDelayDuration(Duration.ofMillis(5000))
        + *             .setTotalTimeoutDuration(Duration.ofHours(24))
        + *             .build());
        + * messagingSettingsBuilder
        + *     .createClusterOperationSettings()
        + *     .setPollingAlgorithm(timedRetryAlgorithm)
        + *     .build();
        + * }
        + */ +@BetaApi +@Generated("by gapic-generator-java") +public class MessagingSettings extends ClientSettings { + + /** Returns the object with the settings used for calls to createRoom. */ + public UnaryCallSettings createRoomSettings() { + return ((MessagingStubSettings) getStubSettings()).createRoomSettings(); + } + + /** Returns the object with the settings used for calls to getRoom. */ + public UnaryCallSettings getRoomSettings() { + return ((MessagingStubSettings) getStubSettings()).getRoomSettings(); + } + + /** Returns the object with the settings used for calls to updateRoom. */ + public UnaryCallSettings updateRoomSettings() { + return ((MessagingStubSettings) getStubSettings()).updateRoomSettings(); + } + + /** Returns the object with the settings used for calls to deleteRoom. */ + public UnaryCallSettings deleteRoomSettings() { + return ((MessagingStubSettings) getStubSettings()).deleteRoomSettings(); + } + + /** Returns the object with the settings used for calls to listRooms. */ + public PagedCallSettings + listRoomsSettings() { + return ((MessagingStubSettings) getStubSettings()).listRoomsSettings(); + } + + /** Returns the object with the settings used for calls to createBlurb. */ + public UnaryCallSettings createBlurbSettings() { + return ((MessagingStubSettings) getStubSettings()).createBlurbSettings(); + } + + /** Returns the object with the settings used for calls to getBlurb. */ + public UnaryCallSettings getBlurbSettings() { + return ((MessagingStubSettings) getStubSettings()).getBlurbSettings(); + } + + /** Returns the object with the settings used for calls to updateBlurb. */ + public UnaryCallSettings updateBlurbSettings() { + return ((MessagingStubSettings) getStubSettings()).updateBlurbSettings(); + } + + /** Returns the object with the settings used for calls to deleteBlurb. */ + public UnaryCallSettings deleteBlurbSettings() { + return ((MessagingStubSettings) getStubSettings()).deleteBlurbSettings(); + } + + /** Returns the object with the settings used for calls to listBlurbs. */ + public PagedCallSettings + listBlurbsSettings() { + return ((MessagingStubSettings) getStubSettings()).listBlurbsSettings(); + } + + /** Returns the object with the settings used for calls to searchBlurbs. */ + public UnaryCallSettings searchBlurbsSettings() { + return ((MessagingStubSettings) getStubSettings()).searchBlurbsSettings(); + } + + /** Returns the object with the settings used for calls to searchBlurbs. */ + public OperationCallSettings + searchBlurbsOperationSettings() { + return ((MessagingStubSettings) getStubSettings()).searchBlurbsOperationSettings(); + } + + /** Returns the object with the settings used for calls to streamBlurbs. */ + public ServerStreamingCallSettings + streamBlurbsSettings() { + return ((MessagingStubSettings) getStubSettings()).streamBlurbsSettings(); + } + + /** Returns the object with the settings used for calls to sendBlurbs. */ + public StreamingCallSettings sendBlurbsSettings() { + return ((MessagingStubSettings) getStubSettings()).sendBlurbsSettings(); + } + + /** Returns the object with the settings used for calls to connect. */ + public StreamingCallSettings connectSettings() { + return ((MessagingStubSettings) getStubSettings()).connectSettings(); + } + + /** Returns the object with the settings used for calls to listLocations. */ + public PagedCallSettings + listLocationsSettings() { + return ((MessagingStubSettings) getStubSettings()).listLocationsSettings(); + } + + /** Returns the object with the settings used for calls to getLocation. */ + public UnaryCallSettings getLocationSettings() { + return ((MessagingStubSettings) getStubSettings()).getLocationSettings(); + } + + /** Returns the object with the settings used for calls to setIamPolicy. */ + public UnaryCallSettings setIamPolicySettings() { + return ((MessagingStubSettings) getStubSettings()).setIamPolicySettings(); + } + + /** Returns the object with the settings used for calls to getIamPolicy. */ + public UnaryCallSettings getIamPolicySettings() { + return ((MessagingStubSettings) getStubSettings()).getIamPolicySettings(); + } + + /** Returns the object with the settings used for calls to testIamPermissions. */ + public UnaryCallSettings + testIamPermissionsSettings() { + return ((MessagingStubSettings) getStubSettings()).testIamPermissionsSettings(); + } + + public static final MessagingSettings create(MessagingStubSettings stub) throws IOException { + return new MessagingSettings.Builder(stub.toBuilder()).build(); + } + + /** Returns a builder for the default ExecutorProvider for this service. */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return MessagingStubSettings.defaultExecutorProviderBuilder(); + } + + /** Returns the default service endpoint. */ + public static String getDefaultEndpoint() { + return MessagingStubSettings.getDefaultEndpoint(); + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return MessagingStubSettings.getDefaultServiceScopes(); + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return MessagingStubSettings.defaultCredentialsProviderBuilder(); + } + + /** Returns a builder for the default gRPC ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return MessagingStubSettings.defaultGrpcTransportProviderBuilder(); + } + + /** Returns a builder for the default REST ChannelProvider for this service. */ + @BetaApi + public static InstantiatingHttpJsonChannelProvider.Builder + defaultHttpJsonTransportProviderBuilder() { + return MessagingStubSettings.defaultHttpJsonTransportProviderBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return MessagingStubSettings.defaultTransportChannelProvider(); + } + + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return MessagingStubSettings.defaultApiClientHeaderProviderBuilder(); + } + + /** Returns a new gRPC builder for this class. */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** Returns a new REST builder for this class. */ + public static Builder newHttpJsonBuilder() { + return Builder.createHttpJsonDefault(); + } + + /** 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 MessagingSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + } + + /** Builder for MessagingSettings. */ + public static class Builder extends ClientSettings.Builder { + + protected Builder() throws IOException { + this(((ClientContext) null)); + } + + protected Builder(ClientContext clientContext) { + super(MessagingStubSettings.newBuilder(clientContext)); + } + + protected Builder(MessagingSettings settings) { + super(settings.getStubSettings().toBuilder()); + } + + protected Builder(MessagingStubSettings.Builder stubSettings) { + super(stubSettings); + } + + private static Builder createDefault() { + return new Builder(MessagingStubSettings.newBuilder()); + } + + private static Builder createHttpJsonDefault() { + return new Builder(MessagingStubSettings.newHttpJsonBuilder()); + } + + public MessagingStubSettings.Builder getStubSettingsBuilder() { + return ((MessagingStubSettings.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 createRoom. */ + public UnaryCallSettings.Builder createRoomSettings() { + return getStubSettingsBuilder().createRoomSettings(); + } + + /** Returns the builder for the settings used for calls to getRoom. */ + public UnaryCallSettings.Builder getRoomSettings() { + return getStubSettingsBuilder().getRoomSettings(); + } + + /** Returns the builder for the settings used for calls to updateRoom. */ + public UnaryCallSettings.Builder updateRoomSettings() { + return getStubSettingsBuilder().updateRoomSettings(); + } + + /** Returns the builder for the settings used for calls to deleteRoom. */ + public UnaryCallSettings.Builder deleteRoomSettings() { + return getStubSettingsBuilder().deleteRoomSettings(); + } + + /** Returns the builder for the settings used for calls to listRooms. */ + public PagedCallSettings.Builder + listRoomsSettings() { + return getStubSettingsBuilder().listRoomsSettings(); + } + + /** Returns the builder for the settings used for calls to createBlurb. */ + public UnaryCallSettings.Builder createBlurbSettings() { + return getStubSettingsBuilder().createBlurbSettings(); + } + + /** Returns the builder for the settings used for calls to getBlurb. */ + public UnaryCallSettings.Builder getBlurbSettings() { + return getStubSettingsBuilder().getBlurbSettings(); + } + + /** Returns the builder for the settings used for calls to updateBlurb. */ + public UnaryCallSettings.Builder updateBlurbSettings() { + return getStubSettingsBuilder().updateBlurbSettings(); + } + + /** Returns the builder for the settings used for calls to deleteBlurb. */ + public UnaryCallSettings.Builder deleteBlurbSettings() { + return getStubSettingsBuilder().deleteBlurbSettings(); + } + + /** Returns the builder for the settings used for calls to listBlurbs. */ + public PagedCallSettings.Builder + listBlurbsSettings() { + return getStubSettingsBuilder().listBlurbsSettings(); + } + + /** Returns the builder for the settings used for calls to searchBlurbs. */ + public UnaryCallSettings.Builder searchBlurbsSettings() { + return getStubSettingsBuilder().searchBlurbsSettings(); + } + + /** Returns the builder for the settings used for calls to searchBlurbs. */ + public OperationCallSettings.Builder< + SearchBlurbsRequest, SearchBlurbsResponse, SearchBlurbsMetadata> + searchBlurbsOperationSettings() { + return getStubSettingsBuilder().searchBlurbsOperationSettings(); + } + + /** Returns the builder for the settings used for calls to streamBlurbs. */ + public ServerStreamingCallSettings.Builder + streamBlurbsSettings() { + return getStubSettingsBuilder().streamBlurbsSettings(); + } + + /** Returns the builder for the settings used for calls to sendBlurbs. */ + public StreamingCallSettings.Builder + sendBlurbsSettings() { + return getStubSettingsBuilder().sendBlurbsSettings(); + } + + /** Returns the builder for the settings used for calls to connect. */ + public StreamingCallSettings.Builder connectSettings() { + return getStubSettingsBuilder().connectSettings(); + } + + /** Returns the builder for the settings used for calls to listLocations. */ + public PagedCallSettings.Builder< + ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse> + listLocationsSettings() { + return getStubSettingsBuilder().listLocationsSettings(); + } + + /** Returns the builder for the settings used for calls to getLocation. */ + public UnaryCallSettings.Builder getLocationSettings() { + return getStubSettingsBuilder().getLocationSettings(); + } + + /** Returns the builder for the settings used for calls to setIamPolicy. */ + public UnaryCallSettings.Builder setIamPolicySettings() { + return getStubSettingsBuilder().setIamPolicySettings(); + } + + /** Returns the builder for the settings used for calls to getIamPolicy. */ + public UnaryCallSettings.Builder getIamPolicySettings() { + return getStubSettingsBuilder().getIamPolicySettings(); + } + + /** Returns the builder for the settings used for calls to testIamPermissions. */ + public UnaryCallSettings.Builder + testIamPermissionsSettings() { + return getStubSettingsBuilder().testIamPermissionsSettings(); + } + + @Override + public MessagingSettings build() throws IOException { + return new MessagingSettings(this); + } + } +} diff --git a/java-showcase-3.21.0/gapic-showcase/src/main/java/com/google/showcase/v1beta1/SequenceServiceClient.java b/java-showcase-3.21.0/gapic-showcase/src/main/java/com/google/showcase/v1beta1/SequenceServiceClient.java new file mode 100644 index 0000000000..76ac609f2d --- /dev/null +++ b/java-showcase-3.21.0/gapic-showcase/src/main/java/com/google/showcase/v1beta1/SequenceServiceClient.java @@ -0,0 +1,1342 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1; + +import com.google.api.core.ApiFuture; +import com.google.api.core.ApiFutures; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.paging.AbstractFixedSizeCollection; +import com.google.api.gax.paging.AbstractPage; +import com.google.api.gax.paging.AbstractPagedListResponse; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.common.util.concurrent.MoreExecutors; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.protobuf.Empty; +import com.google.showcase.v1beta1.stub.SequenceServiceStub; +import com.google.showcase.v1beta1.stub.SequenceServiceStubSettings; +import java.io.IOException; +import java.util.List; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * 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 (SequenceServiceClient sequenceServiceClient = SequenceServiceClient.create()) {
        + *   Sequence sequence = Sequence.newBuilder().build();
        + *   Sequence response = sequenceServiceClient.createSequence(sequence);
        + * }
        + * }
        + * + *

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

        CreateSequence

        Creates a sequence.

        + *

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

        + *
          + *
        • createSequence(CreateSequenceRequest request) + *

        + *

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

        + *
          + *
        • createSequence(Sequence sequence) + *

        + *

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

        + *
          + *
        • createSequenceCallable() + *

        + *

        CreateStreamingSequence

        Creates a sequence.

        + *

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

        + *
          + *
        • createStreamingSequence(CreateStreamingSequenceRequest request) + *

        + *

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

        + *
          + *
        • createStreamingSequence(StreamingSequence streamingSequence) + *

        + *

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

        + *
          + *
        • createStreamingSequenceCallable() + *

        + *

        GetSequenceReport

        Retrieves a sequence.

        + *

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

        + *
          + *
        • getSequenceReport(GetSequenceReportRequest request) + *

        + *

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

        + *
          + *
        • getSequenceReport(SequenceReportName name) + *

        • getSequenceReport(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.

        + *
          + *
        • getSequenceReportCallable() + *

        + *

        GetStreamingSequenceReport

        Retrieves a sequence.

        + *

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

        + *
          + *
        • getStreamingSequenceReport(GetStreamingSequenceReportRequest request) + *

        + *

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

        + *
          + *
        • getStreamingSequenceReport(StreamingSequenceReportName name) + *

        • getStreamingSequenceReport(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.

        + *
          + *
        • getStreamingSequenceReportCallable() + *

        + *

        AttemptSequence

        Attempts a sequence.

        + *

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

        + *
          + *
        • attemptSequence(AttemptSequenceRequest request) + *

        + *

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

        + *
          + *
        • attemptSequence(SequenceName name) + *

        • attemptSequence(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.

        + *
          + *
        • attemptSequenceCallable() + *

        + *

        AttemptStreamingSequence

        Attempts a streaming sequence. May not function as expected in HTTP mode due to when http statuses are sent See https://github.com/googleapis/gapic-showcase/issues/1377 for more details

        + *

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

        + *
          + *
        • attemptStreamingSequenceCallable() + *

        + *

        ListLocations

        Lists information about the supported locations for this service.

        + *

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

        + *
          + *
        • listLocations(ListLocationsRequest request) + *

        + *

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

        + *
          + *
        • listLocationsPagedCallable() + *

        • listLocationsCallable() + *

        + *

        GetLocation

        Gets information about a location.

        + *

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

        + *
          + *
        • getLocation(GetLocationRequest request) + *

        + *

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

        + *
          + *
        • getLocationCallable() + *

        + *

        SetIamPolicy

        Sets the access control policy on the specified resource. Replaces any existing policy. + *

        Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED` errors.

        + *

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

        + *
          + *
        • setIamPolicy(SetIamPolicyRequest request) + *

        + *

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

        + *
          + *
        • setIamPolicyCallable() + *

        + *

        GetIamPolicy

        Gets the access control policy for a resource. Returns an empty policy if the resource exists and does not have a policy set.

        + *

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

        + *
          + *
        • getIamPolicy(GetIamPolicyRequest request) + *

        + *

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

        + *
          + *
        • getIamPolicyCallable() + *

        + *

        TestIamPermissions

        Returns permissions that a caller has on the specified resource. If the resource does not exist, this will return an empty set of permissions, not a `NOT_FOUND` error. + *

        Note: This operation is designed to be used for building permission-aware UIs and command-line tools, not for authorization checking. This operation may "fail open" without warning.

        + *

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

        + *
          + *
        • testIamPermissions(TestIamPermissionsRequest request) + *

        + *

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

        + *
          + *
        • testIamPermissionsCallable() + *

        + *
        + * + *

        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 SequenceServiceSettings 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
        + * SequenceServiceSettings sequenceServiceSettings =
        + *     SequenceServiceSettings.newBuilder()
        + *         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
        + *         .build();
        + * SequenceServiceClient sequenceServiceClient =
        + *     SequenceServiceClient.create(sequenceServiceSettings);
        + * }
        + * + *

        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
        + * SequenceServiceSettings sequenceServiceSettings =
        + *     SequenceServiceSettings.newBuilder().setEndpoint(myEndpoint).build();
        + * SequenceServiceClient sequenceServiceClient =
        + *     SequenceServiceClient.create(sequenceServiceSettings);
        + * }
        + * + *

        To use REST (HTTP1.1/JSON) transport (instead of gRPC) for sending and receiving requests over + * the wire: + * + *

        {@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
        + * SequenceServiceSettings sequenceServiceSettings =
        + *     SequenceServiceSettings.newHttpJsonBuilder().build();
        + * SequenceServiceClient sequenceServiceClient =
        + *     SequenceServiceClient.create(sequenceServiceSettings);
        + * }
        + * + *

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

        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 (SequenceServiceClient sequenceServiceClient = SequenceServiceClient.create()) {
        +   *   Sequence sequence = Sequence.newBuilder().build();
        +   *   Sequence response = sequenceServiceClient.createSequence(sequence);
        +   * }
        +   * }
        + * + * @param sequence + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Sequence createSequence(Sequence sequence) { + CreateSequenceRequest request = + CreateSequenceRequest.newBuilder().setSequence(sequence).build(); + return createSequence(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a sequence. + * + *

        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 (SequenceServiceClient sequenceServiceClient = SequenceServiceClient.create()) {
        +   *   CreateSequenceRequest request =
        +   *       CreateSequenceRequest.newBuilder().setSequence(Sequence.newBuilder().build()).build();
        +   *   Sequence response = sequenceServiceClient.createSequence(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 Sequence createSequence(CreateSequenceRequest request) { + return createSequenceCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a sequence. + * + *

        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 (SequenceServiceClient sequenceServiceClient = SequenceServiceClient.create()) {
        +   *   CreateSequenceRequest request =
        +   *       CreateSequenceRequest.newBuilder().setSequence(Sequence.newBuilder().build()).build();
        +   *   ApiFuture future =
        +   *       sequenceServiceClient.createSequenceCallable().futureCall(request);
        +   *   // Do something.
        +   *   Sequence response = future.get();
        +   * }
        +   * }
        + */ + public final UnaryCallable createSequenceCallable() { + return stub.createSequenceCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a sequence. + * + *

        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 (SequenceServiceClient sequenceServiceClient = SequenceServiceClient.create()) {
        +   *   StreamingSequence streamingSequence = StreamingSequence.newBuilder().build();
        +   *   StreamingSequence response = sequenceServiceClient.createStreamingSequence(streamingSequence);
        +   * }
        +   * }
        + * + * @param streamingSequence + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final StreamingSequence createStreamingSequence(StreamingSequence streamingSequence) { + CreateStreamingSequenceRequest request = + CreateStreamingSequenceRequest.newBuilder().setStreamingSequence(streamingSequence).build(); + return createStreamingSequence(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a sequence. + * + *

        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 (SequenceServiceClient sequenceServiceClient = SequenceServiceClient.create()) {
        +   *   CreateStreamingSequenceRequest request =
        +   *       CreateStreamingSequenceRequest.newBuilder()
        +   *           .setStreamingSequence(StreamingSequence.newBuilder().build())
        +   *           .build();
        +   *   StreamingSequence response = sequenceServiceClient.createStreamingSequence(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 StreamingSequence createStreamingSequence(CreateStreamingSequenceRequest request) { + return createStreamingSequenceCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a sequence. + * + *

        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 (SequenceServiceClient sequenceServiceClient = SequenceServiceClient.create()) {
        +   *   CreateStreamingSequenceRequest request =
        +   *       CreateStreamingSequenceRequest.newBuilder()
        +   *           .setStreamingSequence(StreamingSequence.newBuilder().build())
        +   *           .build();
        +   *   ApiFuture future =
        +   *       sequenceServiceClient.createStreamingSequenceCallable().futureCall(request);
        +   *   // Do something.
        +   *   StreamingSequence response = future.get();
        +   * }
        +   * }
        + */ + public final UnaryCallable + createStreamingSequenceCallable() { + return stub.createStreamingSequenceCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Retrieves a sequence. + * + *

        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 (SequenceServiceClient sequenceServiceClient = SequenceServiceClient.create()) {
        +   *   SequenceReportName name = SequenceReportName.of("[SEQUENCE]");
        +   *   SequenceReport response = sequenceServiceClient.getSequenceReport(name);
        +   * }
        +   * }
        + * + * @param name + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final SequenceReport getSequenceReport(SequenceReportName name) { + GetSequenceReportRequest request = + GetSequenceReportRequest.newBuilder() + .setName(name == null ? null : name.toString()) + .build(); + return getSequenceReport(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Retrieves a sequence. + * + *

        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 (SequenceServiceClient sequenceServiceClient = SequenceServiceClient.create()) {
        +   *   String name = SequenceReportName.of("[SEQUENCE]").toString();
        +   *   SequenceReport response = sequenceServiceClient.getSequenceReport(name);
        +   * }
        +   * }
        + * + * @param name + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final SequenceReport getSequenceReport(String name) { + GetSequenceReportRequest request = GetSequenceReportRequest.newBuilder().setName(name).build(); + return getSequenceReport(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Retrieves a sequence. + * + *

        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 (SequenceServiceClient sequenceServiceClient = SequenceServiceClient.create()) {
        +   *   GetSequenceReportRequest request =
        +   *       GetSequenceReportRequest.newBuilder()
        +   *           .setName(SequenceReportName.of("[SEQUENCE]").toString())
        +   *           .build();
        +   *   SequenceReport response = sequenceServiceClient.getSequenceReport(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 SequenceReport getSequenceReport(GetSequenceReportRequest request) { + return getSequenceReportCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Retrieves a sequence. + * + *

        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 (SequenceServiceClient sequenceServiceClient = SequenceServiceClient.create()) {
        +   *   GetSequenceReportRequest request =
        +   *       GetSequenceReportRequest.newBuilder()
        +   *           .setName(SequenceReportName.of("[SEQUENCE]").toString())
        +   *           .build();
        +   *   ApiFuture future =
        +   *       sequenceServiceClient.getSequenceReportCallable().futureCall(request);
        +   *   // Do something.
        +   *   SequenceReport response = future.get();
        +   * }
        +   * }
        + */ + public final UnaryCallable getSequenceReportCallable() { + return stub.getSequenceReportCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Retrieves a sequence. + * + *

        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 (SequenceServiceClient sequenceServiceClient = SequenceServiceClient.create()) {
        +   *   StreamingSequenceReportName name = StreamingSequenceReportName.of("[STREAMING_SEQUENCE]");
        +   *   StreamingSequenceReport response = sequenceServiceClient.getStreamingSequenceReport(name);
        +   * }
        +   * }
        + * + * @param name + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final StreamingSequenceReport getStreamingSequenceReport( + StreamingSequenceReportName name) { + GetStreamingSequenceReportRequest request = + GetStreamingSequenceReportRequest.newBuilder() + .setName(name == null ? null : name.toString()) + .build(); + return getStreamingSequenceReport(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Retrieves a sequence. + * + *

        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 (SequenceServiceClient sequenceServiceClient = SequenceServiceClient.create()) {
        +   *   String name = StreamingSequenceReportName.of("[STREAMING_SEQUENCE]").toString();
        +   *   StreamingSequenceReport response = sequenceServiceClient.getStreamingSequenceReport(name);
        +   * }
        +   * }
        + * + * @param name + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final StreamingSequenceReport getStreamingSequenceReport(String name) { + GetStreamingSequenceReportRequest request = + GetStreamingSequenceReportRequest.newBuilder().setName(name).build(); + return getStreamingSequenceReport(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Retrieves a sequence. + * + *

        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 (SequenceServiceClient sequenceServiceClient = SequenceServiceClient.create()) {
        +   *   GetStreamingSequenceReportRequest request =
        +   *       GetStreamingSequenceReportRequest.newBuilder()
        +   *           .setName(StreamingSequenceReportName.of("[STREAMING_SEQUENCE]").toString())
        +   *           .build();
        +   *   StreamingSequenceReport response = sequenceServiceClient.getStreamingSequenceReport(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 StreamingSequenceReport getStreamingSequenceReport( + GetStreamingSequenceReportRequest request) { + return getStreamingSequenceReportCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Retrieves a sequence. + * + *

        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 (SequenceServiceClient sequenceServiceClient = SequenceServiceClient.create()) {
        +   *   GetStreamingSequenceReportRequest request =
        +   *       GetStreamingSequenceReportRequest.newBuilder()
        +   *           .setName(StreamingSequenceReportName.of("[STREAMING_SEQUENCE]").toString())
        +   *           .build();
        +   *   ApiFuture future =
        +   *       sequenceServiceClient.getStreamingSequenceReportCallable().futureCall(request);
        +   *   // Do something.
        +   *   StreamingSequenceReport response = future.get();
        +   * }
        +   * }
        + */ + public final UnaryCallable + getStreamingSequenceReportCallable() { + return stub.getStreamingSequenceReportCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Attempts a sequence. + * + *

        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 (SequenceServiceClient sequenceServiceClient = SequenceServiceClient.create()) {
        +   *   SequenceName name = SequenceName.of("[SEQUENCE]");
        +   *   sequenceServiceClient.attemptSequence(name);
        +   * }
        +   * }
        + * + * @param name + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final void attemptSequence(SequenceName name) { + AttemptSequenceRequest request = + AttemptSequenceRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + attemptSequence(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Attempts a sequence. + * + *

        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 (SequenceServiceClient sequenceServiceClient = SequenceServiceClient.create()) {
        +   *   String name = SequenceName.of("[SEQUENCE]").toString();
        +   *   sequenceServiceClient.attemptSequence(name);
        +   * }
        +   * }
        + * + * @param name + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final void attemptSequence(String name) { + AttemptSequenceRequest request = AttemptSequenceRequest.newBuilder().setName(name).build(); + attemptSequence(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Attempts a sequence. + * + *

        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 (SequenceServiceClient sequenceServiceClient = SequenceServiceClient.create()) {
        +   *   AttemptSequenceRequest request =
        +   *       AttemptSequenceRequest.newBuilder()
        +   *           .setName(SequenceName.of("[SEQUENCE]").toString())
        +   *           .build();
        +   *   sequenceServiceClient.attemptSequence(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 attemptSequence(AttemptSequenceRequest request) { + attemptSequenceCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Attempts a sequence. + * + *

        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 (SequenceServiceClient sequenceServiceClient = SequenceServiceClient.create()) {
        +   *   AttemptSequenceRequest request =
        +   *       AttemptSequenceRequest.newBuilder()
        +   *           .setName(SequenceName.of("[SEQUENCE]").toString())
        +   *           .build();
        +   *   ApiFuture future = sequenceServiceClient.attemptSequenceCallable().futureCall(request);
        +   *   // Do something.
        +   *   future.get();
        +   * }
        +   * }
        + */ + public final UnaryCallable attemptSequenceCallable() { + return stub.attemptSequenceCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Attempts a streaming sequence. May not function as expected in HTTP mode due to when http + * statuses are sent See https://github.com/googleapis/gapic-showcase/issues/1377 for more details + * + *

        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 (SequenceServiceClient sequenceServiceClient = SequenceServiceClient.create()) {
        +   *   AttemptStreamingSequenceRequest request =
        +   *       AttemptStreamingSequenceRequest.newBuilder()
        +   *           .setName(StreamingSequenceName.of("[STREAMING_SEQUENCE]").toString())
        +   *           .setLastFailIndex(2006482362)
        +   *           .build();
        +   *   ServerStream stream =
        +   *       sequenceServiceClient.attemptStreamingSequenceCallable().call(request);
        +   *   for (AttemptStreamingSequenceResponse response : stream) {
        +   *     // Do something when a response is received.
        +   *   }
        +   * }
        +   * }
        + */ + public final ServerStreamingCallable< + AttemptStreamingSequenceRequest, AttemptStreamingSequenceResponse> + attemptStreamingSequenceCallable() { + return stub.attemptStreamingSequenceCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists information about the supported locations for this service. + * + *

        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 (SequenceServiceClient sequenceServiceClient = SequenceServiceClient.create()) {
        +   *   ListLocationsRequest request =
        +   *       ListLocationsRequest.newBuilder()
        +   *           .setName("name3373707")
        +   *           .setFilter("filter-1274492040")
        +   *           .setPageSize(883849137)
        +   *           .setPageToken("pageToken873572522")
        +   *           .build();
        +   *   for (Location element : sequenceServiceClient.listLocations(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 ListLocationsPagedResponse listLocations(ListLocationsRequest request) { + return listLocationsPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists information about the supported locations for this service. + * + *

        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 (SequenceServiceClient sequenceServiceClient = SequenceServiceClient.create()) {
        +   *   ListLocationsRequest request =
        +   *       ListLocationsRequest.newBuilder()
        +   *           .setName("name3373707")
        +   *           .setFilter("filter-1274492040")
        +   *           .setPageSize(883849137)
        +   *           .setPageToken("pageToken873572522")
        +   *           .build();
        +   *   ApiFuture future =
        +   *       sequenceServiceClient.listLocationsPagedCallable().futureCall(request);
        +   *   // Do something.
        +   *   for (Location element : future.get().iterateAll()) {
        +   *     // doThingsWith(element);
        +   *   }
        +   * }
        +   * }
        + */ + public final UnaryCallable + listLocationsPagedCallable() { + return stub.listLocationsPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists information about the supported locations for this service. + * + *

        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 (SequenceServiceClient sequenceServiceClient = SequenceServiceClient.create()) {
        +   *   ListLocationsRequest request =
        +   *       ListLocationsRequest.newBuilder()
        +   *           .setName("name3373707")
        +   *           .setFilter("filter-1274492040")
        +   *           .setPageSize(883849137)
        +   *           .setPageToken("pageToken873572522")
        +   *           .build();
        +   *   while (true) {
        +   *     ListLocationsResponse response =
        +   *         sequenceServiceClient.listLocationsCallable().call(request);
        +   *     for (Location element : response.getLocationsList()) {
        +   *       // doThingsWith(element);
        +   *     }
        +   *     String nextPageToken = response.getNextPageToken();
        +   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
        +   *       request = request.toBuilder().setPageToken(nextPageToken).build();
        +   *     } else {
        +   *       break;
        +   *     }
        +   *   }
        +   * }
        +   * }
        + */ + public final UnaryCallable listLocationsCallable() { + return stub.listLocationsCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets information about a location. + * + *

        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 (SequenceServiceClient sequenceServiceClient = SequenceServiceClient.create()) {
        +   *   GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build();
        +   *   Location response = sequenceServiceClient.getLocation(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 Location getLocation(GetLocationRequest request) { + return getLocationCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets information about a location. + * + *

        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 (SequenceServiceClient sequenceServiceClient = SequenceServiceClient.create()) {
        +   *   GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build();
        +   *   ApiFuture future = sequenceServiceClient.getLocationCallable().futureCall(request);
        +   *   // Do something.
        +   *   Location response = future.get();
        +   * }
        +   * }
        + */ + public final UnaryCallable getLocationCallable() { + return stub.getLocationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Sets the access control policy on the specified resource. Replaces any existing policy. + * + *

        Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED` errors. + * + *

        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 (SequenceServiceClient sequenceServiceClient = SequenceServiceClient.create()) {
        +   *   SetIamPolicyRequest request =
        +   *       SetIamPolicyRequest.newBuilder()
        +   *           .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString())
        +   *           .setPolicy(Policy.newBuilder().build())
        +   *           .setUpdateMask(FieldMask.newBuilder().build())
        +   *           .build();
        +   *   Policy response = sequenceServiceClient.setIamPolicy(request);
        +   * }
        +   * }
        + * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Policy setIamPolicy(SetIamPolicyRequest request) { + return setIamPolicyCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Sets the access control policy on the specified resource. Replaces any existing policy. + * + *

        Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED` errors. + * + *

        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 (SequenceServiceClient sequenceServiceClient = SequenceServiceClient.create()) {
        +   *   SetIamPolicyRequest request =
        +   *       SetIamPolicyRequest.newBuilder()
        +   *           .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString())
        +   *           .setPolicy(Policy.newBuilder().build())
        +   *           .setUpdateMask(FieldMask.newBuilder().build())
        +   *           .build();
        +   *   ApiFuture future = sequenceServiceClient.setIamPolicyCallable().futureCall(request);
        +   *   // Do something.
        +   *   Policy response = future.get();
        +   * }
        +   * }
        + */ + public final UnaryCallable setIamPolicyCallable() { + return stub.setIamPolicyCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets the access control policy for a resource. Returns an empty policy if the resource exists + * and does not have a policy set. + * + *

        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 (SequenceServiceClient sequenceServiceClient = SequenceServiceClient.create()) {
        +   *   GetIamPolicyRequest request =
        +   *       GetIamPolicyRequest.newBuilder()
        +   *           .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString())
        +   *           .setOptions(GetPolicyOptions.newBuilder().build())
        +   *           .build();
        +   *   Policy response = sequenceServiceClient.getIamPolicy(request);
        +   * }
        +   * }
        + * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Policy getIamPolicy(GetIamPolicyRequest request) { + return getIamPolicyCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets the access control policy for a resource. Returns an empty policy if the resource exists + * and does not have a policy set. + * + *

        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 (SequenceServiceClient sequenceServiceClient = SequenceServiceClient.create()) {
        +   *   GetIamPolicyRequest request =
        +   *       GetIamPolicyRequest.newBuilder()
        +   *           .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString())
        +   *           .setOptions(GetPolicyOptions.newBuilder().build())
        +   *           .build();
        +   *   ApiFuture future = sequenceServiceClient.getIamPolicyCallable().futureCall(request);
        +   *   // Do something.
        +   *   Policy response = future.get();
        +   * }
        +   * }
        + */ + public final UnaryCallable getIamPolicyCallable() { + return stub.getIamPolicyCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Returns permissions that a caller has on the specified resource. If the resource does not + * exist, this will return an empty set of permissions, not a `NOT_FOUND` error. + * + *

        Note: This operation is designed to be used for building permission-aware UIs and + * command-line tools, not for authorization checking. This operation may "fail open" without + * warning. + * + *

        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 (SequenceServiceClient sequenceServiceClient = SequenceServiceClient.create()) {
        +   *   TestIamPermissionsRequest request =
        +   *       TestIamPermissionsRequest.newBuilder()
        +   *           .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString())
        +   *           .addAllPermissions(new ArrayList())
        +   *           .build();
        +   *   TestIamPermissionsResponse response = sequenceServiceClient.testIamPermissions(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 TestIamPermissionsResponse testIamPermissions(TestIamPermissionsRequest request) { + return testIamPermissionsCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Returns permissions that a caller has on the specified resource. If the resource does not + * exist, this will return an empty set of permissions, not a `NOT_FOUND` error. + * + *

        Note: This operation is designed to be used for building permission-aware UIs and + * command-line tools, not for authorization checking. This operation may "fail open" without + * warning. + * + *

        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 (SequenceServiceClient sequenceServiceClient = SequenceServiceClient.create()) {
        +   *   TestIamPermissionsRequest request =
        +   *       TestIamPermissionsRequest.newBuilder()
        +   *           .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString())
        +   *           .addAllPermissions(new ArrayList())
        +   *           .build();
        +   *   ApiFuture future =
        +   *       sequenceServiceClient.testIamPermissionsCallable().futureCall(request);
        +   *   // Do something.
        +   *   TestIamPermissionsResponse response = future.get();
        +   * }
        +   * }
        + */ + public final UnaryCallable + testIamPermissionsCallable() { + return stub.testIamPermissionsCallable(); + } + + @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 ListLocationsPagedResponse + extends AbstractPagedListResponse< + ListLocationsRequest, + ListLocationsResponse, + Location, + ListLocationsPage, + ListLocationsFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListLocationsPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + input -> new ListLocationsPagedResponse(input), + MoreExecutors.directExecutor()); + } + + private ListLocationsPagedResponse(ListLocationsPage page) { + super(page, ListLocationsFixedSizeCollection.createEmptyCollection()); + } + } + + public static class ListLocationsPage + extends AbstractPage< + ListLocationsRequest, ListLocationsResponse, Location, ListLocationsPage> { + + private ListLocationsPage( + PageContext context, + ListLocationsResponse response) { + super(context, response); + } + + private static ListLocationsPage createEmptyPage() { + return new ListLocationsPage(null, null); + } + + @Override + protected ListLocationsPage createPage( + PageContext context, + ListLocationsResponse response) { + return new ListLocationsPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class ListLocationsFixedSizeCollection + extends AbstractFixedSizeCollection< + ListLocationsRequest, + ListLocationsResponse, + Location, + ListLocationsPage, + ListLocationsFixedSizeCollection> { + + private ListLocationsFixedSizeCollection(List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListLocationsFixedSizeCollection createEmptyCollection() { + return new ListLocationsFixedSizeCollection(null, 0); + } + + @Override + protected ListLocationsFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListLocationsFixedSizeCollection(pages, collectionSize); + } + } +} diff --git a/java-showcase-3.21.0/gapic-showcase/src/main/java/com/google/showcase/v1beta1/SequenceServiceSettings.java b/java-showcase-3.21.0/gapic-showcase/src/main/java/com/google/showcase/v1beta1/SequenceServiceSettings.java new file mode 100644 index 0000000000..67eefab806 --- /dev/null +++ b/java-showcase-3.21.0/gapic-showcase/src/main/java/com/google/showcase/v1beta1/SequenceServiceSettings.java @@ -0,0 +1,344 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1; + +import static com.google.showcase.v1beta1.SequenceServiceClient.ListLocationsPagedResponse; + +import com.google.api.core.ApiFunction; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; +import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; +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.ServerStreamingCallSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.protobuf.Empty; +import com.google.showcase.v1beta1.stub.SequenceServiceStubSettings; +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 SequenceServiceClient}. + * + *

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

          + *
        • The default service address (localhost) and default port (7469) 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 createSequence: + * + *

        {@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
        + * SequenceServiceSettings.Builder sequenceServiceSettingsBuilder =
        + *     SequenceServiceSettings.newBuilder();
        + * sequenceServiceSettingsBuilder
        + *     .createSequenceSettings()
        + *     .setRetrySettings(
        + *         sequenceServiceSettingsBuilder
        + *             .createSequenceSettings()
        + *             .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());
        + * SequenceServiceSettings sequenceServiceSettings = sequenceServiceSettingsBuilder.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. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class SequenceServiceSettings extends ClientSettings { + + /** Returns the object with the settings used for calls to createSequence. */ + public UnaryCallSettings createSequenceSettings() { + return ((SequenceServiceStubSettings) getStubSettings()).createSequenceSettings(); + } + + /** Returns the object with the settings used for calls to createStreamingSequence. */ + public UnaryCallSettings + createStreamingSequenceSettings() { + return ((SequenceServiceStubSettings) getStubSettings()).createStreamingSequenceSettings(); + } + + /** Returns the object with the settings used for calls to getSequenceReport. */ + public UnaryCallSettings getSequenceReportSettings() { + return ((SequenceServiceStubSettings) getStubSettings()).getSequenceReportSettings(); + } + + /** Returns the object with the settings used for calls to getStreamingSequenceReport. */ + public UnaryCallSettings + getStreamingSequenceReportSettings() { + return ((SequenceServiceStubSettings) getStubSettings()).getStreamingSequenceReportSettings(); + } + + /** Returns the object with the settings used for calls to attemptSequence. */ + public UnaryCallSettings attemptSequenceSettings() { + return ((SequenceServiceStubSettings) getStubSettings()).attemptSequenceSettings(); + } + + /** Returns the object with the settings used for calls to attemptStreamingSequence. */ + public ServerStreamingCallSettings< + AttemptStreamingSequenceRequest, AttemptStreamingSequenceResponse> + attemptStreamingSequenceSettings() { + return ((SequenceServiceStubSettings) getStubSettings()).attemptStreamingSequenceSettings(); + } + + /** Returns the object with the settings used for calls to listLocations. */ + public PagedCallSettings + listLocationsSettings() { + return ((SequenceServiceStubSettings) getStubSettings()).listLocationsSettings(); + } + + /** Returns the object with the settings used for calls to getLocation. */ + public UnaryCallSettings getLocationSettings() { + return ((SequenceServiceStubSettings) getStubSettings()).getLocationSettings(); + } + + /** Returns the object with the settings used for calls to setIamPolicy. */ + public UnaryCallSettings setIamPolicySettings() { + return ((SequenceServiceStubSettings) getStubSettings()).setIamPolicySettings(); + } + + /** Returns the object with the settings used for calls to getIamPolicy. */ + public UnaryCallSettings getIamPolicySettings() { + return ((SequenceServiceStubSettings) getStubSettings()).getIamPolicySettings(); + } + + /** Returns the object with the settings used for calls to testIamPermissions. */ + public UnaryCallSettings + testIamPermissionsSettings() { + return ((SequenceServiceStubSettings) getStubSettings()).testIamPermissionsSettings(); + } + + public static final SequenceServiceSettings create(SequenceServiceStubSettings stub) + throws IOException { + return new SequenceServiceSettings.Builder(stub.toBuilder()).build(); + } + + /** Returns a builder for the default ExecutorProvider for this service. */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return SequenceServiceStubSettings.defaultExecutorProviderBuilder(); + } + + /** Returns the default service endpoint. */ + public static String getDefaultEndpoint() { + return SequenceServiceStubSettings.getDefaultEndpoint(); + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return SequenceServiceStubSettings.getDefaultServiceScopes(); + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return SequenceServiceStubSettings.defaultCredentialsProviderBuilder(); + } + + /** Returns a builder for the default gRPC ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return SequenceServiceStubSettings.defaultGrpcTransportProviderBuilder(); + } + + /** Returns a builder for the default REST ChannelProvider for this service. */ + @BetaApi + public static InstantiatingHttpJsonChannelProvider.Builder + defaultHttpJsonTransportProviderBuilder() { + return SequenceServiceStubSettings.defaultHttpJsonTransportProviderBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return SequenceServiceStubSettings.defaultTransportChannelProvider(); + } + + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return SequenceServiceStubSettings.defaultApiClientHeaderProviderBuilder(); + } + + /** Returns a new gRPC builder for this class. */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** Returns a new REST builder for this class. */ + public static Builder newHttpJsonBuilder() { + return Builder.createHttpJsonDefault(); + } + + /** 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 SequenceServiceSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + } + + /** Builder for SequenceServiceSettings. */ + public static class Builder extends ClientSettings.Builder { + + protected Builder() throws IOException { + this(((ClientContext) null)); + } + + protected Builder(ClientContext clientContext) { + super(SequenceServiceStubSettings.newBuilder(clientContext)); + } + + protected Builder(SequenceServiceSettings settings) { + super(settings.getStubSettings().toBuilder()); + } + + protected Builder(SequenceServiceStubSettings.Builder stubSettings) { + super(stubSettings); + } + + private static Builder createDefault() { + return new Builder(SequenceServiceStubSettings.newBuilder()); + } + + private static Builder createHttpJsonDefault() { + return new Builder(SequenceServiceStubSettings.newHttpJsonBuilder()); + } + + public SequenceServiceStubSettings.Builder getStubSettingsBuilder() { + return ((SequenceServiceStubSettings.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 createSequence. */ + public UnaryCallSettings.Builder createSequenceSettings() { + return getStubSettingsBuilder().createSequenceSettings(); + } + + /** Returns the builder for the settings used for calls to createStreamingSequence. */ + public UnaryCallSettings.Builder + createStreamingSequenceSettings() { + return getStubSettingsBuilder().createStreamingSequenceSettings(); + } + + /** Returns the builder for the settings used for calls to getSequenceReport. */ + public UnaryCallSettings.Builder + getSequenceReportSettings() { + return getStubSettingsBuilder().getSequenceReportSettings(); + } + + /** Returns the builder for the settings used for calls to getStreamingSequenceReport. */ + public UnaryCallSettings.Builder + getStreamingSequenceReportSettings() { + return getStubSettingsBuilder().getStreamingSequenceReportSettings(); + } + + /** Returns the builder for the settings used for calls to attemptSequence. */ + public UnaryCallSettings.Builder attemptSequenceSettings() { + return getStubSettingsBuilder().attemptSequenceSettings(); + } + + /** Returns the builder for the settings used for calls to attemptStreamingSequence. */ + public ServerStreamingCallSettings.Builder< + AttemptStreamingSequenceRequest, AttemptStreamingSequenceResponse> + attemptStreamingSequenceSettings() { + return getStubSettingsBuilder().attemptStreamingSequenceSettings(); + } + + /** Returns the builder for the settings used for calls to listLocations. */ + public PagedCallSettings.Builder< + ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse> + listLocationsSettings() { + return getStubSettingsBuilder().listLocationsSettings(); + } + + /** Returns the builder for the settings used for calls to getLocation. */ + public UnaryCallSettings.Builder getLocationSettings() { + return getStubSettingsBuilder().getLocationSettings(); + } + + /** Returns the builder for the settings used for calls to setIamPolicy. */ + public UnaryCallSettings.Builder setIamPolicySettings() { + return getStubSettingsBuilder().setIamPolicySettings(); + } + + /** Returns the builder for the settings used for calls to getIamPolicy. */ + public UnaryCallSettings.Builder getIamPolicySettings() { + return getStubSettingsBuilder().getIamPolicySettings(); + } + + /** Returns the builder for the settings used for calls to testIamPermissions. */ + public UnaryCallSettings.Builder + testIamPermissionsSettings() { + return getStubSettingsBuilder().testIamPermissionsSettings(); + } + + @Override + public SequenceServiceSettings build() throws IOException { + return new SequenceServiceSettings(this); + } + } +} diff --git a/java-showcase-3.21.0/gapic-showcase/src/main/java/com/google/showcase/v1beta1/TestingClient.java b/java-showcase-3.21.0/gapic-showcase/src/main/java/com/google/showcase/v1beta1/TestingClient.java new file mode 100644 index 0000000000..517fd7f7d3 --- /dev/null +++ b/java-showcase-3.21.0/gapic-showcase/src/main/java/com/google/showcase/v1beta1/TestingClient.java @@ -0,0 +1,1501 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1; + +import com.google.api.core.ApiFuture; +import com.google.api.core.ApiFutures; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.paging.AbstractFixedSizeCollection; +import com.google.api.gax.paging.AbstractPage; +import com.google.api.gax.paging.AbstractPagedListResponse; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.common.util.concurrent.MoreExecutors; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.protobuf.Empty; +import com.google.showcase.v1beta1.stub.TestingStub; +import com.google.showcase.v1beta1.stub.TestingStubSettings; +import java.io.IOException; +import java.util.List; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Service Description: A service to facilitate running discrete sets of tests against Showcase. + * Adding this comment with special characters for comment formatting tests: 1. + * (abra->kadabra->alakazam) 2) [Nonsense][]: `pokemon/*/psychic/*` + * + *

        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 (TestingClient testingClient = TestingClient.create()) {
        + *   CreateSessionRequest request =
        + *       CreateSessionRequest.newBuilder().setSession(Session.newBuilder().build()).build();
        + *   Session response = testingClient.createSession(request);
        + * }
        + * }
        + * + *

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

        CreateSession

        Creates a new testing session. Adding this comment with special characters for comment formatting tests: 1. (abra->kadabra->alakazam) 2) [Nonsense][]: `pokemon/*/psychic/*`

        + *

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

        + *
          + *
        • createSession(CreateSessionRequest request) + *

        + *

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

        + *
          + *
        • createSessionCallable() + *

        + *

        GetSession

        Gets a testing session.

        + *

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

        + *
          + *
        • getSession(GetSessionRequest request) + *

        + *

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

        + *
          + *
        • getSessionCallable() + *

        + *

        ListSessions

        Lists the current test sessions.

        + *

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

        + *
          + *
        • listSessions(ListSessionsRequest request) + *

        + *

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

        + *
          + *
        • listSessionsPagedCallable() + *

        • listSessionsCallable() + *

        + *

        DeleteSession

        Delete a test session.

        + *

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

        + *
          + *
        • deleteSession(DeleteSessionRequest request) + *

        + *

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

        + *
          + *
        • deleteSessionCallable() + *

        + *

        ReportSession

        Report on the status of a session. This generates a report detailing which tests have been completed, and an overall rollup.

        + *

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

        + *
          + *
        • reportSession(ReportSessionRequest request) + *

        + *

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

        + *
          + *
        • reportSessionCallable() + *

        + *

        ListTests

        List the tests of a sessesion.

        + *

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

        + *
          + *
        • listTests(ListTestsRequest request) + *

        + *

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

        + *
          + *
        • listTestsPagedCallable() + *

        • listTestsCallable() + *

        + *

        DeleteTest

        Explicitly decline to implement a test. + *

        This removes the test from subsequent `ListTests` calls, and attempting to do the test will error. + *

        This method will error if attempting to delete a required test.

        + *

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

        + *
          + *
        • deleteTest(DeleteTestRequest request) + *

        + *

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

        + *
          + *
        • deleteTestCallable() + *

        + *

        VerifyTest

        Register a response to a test. + *

        In cases where a test involves registering a final answer at the end of the test, this method provides the means to do so.

        + *

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

        + *
          + *
        • verifyTest(VerifyTestRequest request) + *

        + *

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

        + *
          + *
        • verifyTestCallable() + *

        + *

        ListLocations

        Lists information about the supported locations for this service.

        + *

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

        + *
          + *
        • listLocations(ListLocationsRequest request) + *

        + *

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

        + *
          + *
        • listLocationsPagedCallable() + *

        • listLocationsCallable() + *

        + *

        GetLocation

        Gets information about a location.

        + *

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

        + *
          + *
        • getLocation(GetLocationRequest request) + *

        + *

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

        + *
          + *
        • getLocationCallable() + *

        + *

        SetIamPolicy

        Sets the access control policy on the specified resource. Replaces any existing policy. + *

        Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED` errors.

        + *

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

        + *
          + *
        • setIamPolicy(SetIamPolicyRequest request) + *

        + *

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

        + *
          + *
        • setIamPolicyCallable() + *

        + *

        GetIamPolicy

        Gets the access control policy for a resource. Returns an empty policy if the resource exists and does not have a policy set.

        + *

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

        + *
          + *
        • getIamPolicy(GetIamPolicyRequest request) + *

        + *

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

        + *
          + *
        • getIamPolicyCallable() + *

        + *

        TestIamPermissions

        Returns permissions that a caller has on the specified resource. If the resource does not exist, this will return an empty set of permissions, not a `NOT_FOUND` error. + *

        Note: This operation is designed to be used for building permission-aware UIs and command-line tools, not for authorization checking. This operation may "fail open" without warning.

        + *

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

        + *
          + *
        • testIamPermissions(TestIamPermissionsRequest request) + *

        + *

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

        + *
          + *
        • testIamPermissionsCallable() + *

        + *
        + * + *

        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 TestingSettings 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
        + * TestingSettings testingSettings =
        + *     TestingSettings.newBuilder()
        + *         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
        + *         .build();
        + * TestingClient testingClient = TestingClient.create(testingSettings);
        + * }
        + * + *

        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
        + * TestingSettings testingSettings = TestingSettings.newBuilder().setEndpoint(myEndpoint).build();
        + * TestingClient testingClient = TestingClient.create(testingSettings);
        + * }
        + * + *

        To use REST (HTTP1.1/JSON) transport (instead of gRPC) for sending and receiving requests over + * the wire: + * + *

        {@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
        + * TestingSettings testingSettings = TestingSettings.newHttpJsonBuilder().build();
        + * TestingClient testingClient = TestingClient.create(testingSettings);
        + * }
        + * + *

        Please refer to the GitHub repository's samples for more quickstart code snippets. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class TestingClient implements BackgroundResource { + private final TestingSettings settings; + private final TestingStub stub; + + /** Constructs an instance of TestingClient with default settings. */ + public static final TestingClient create() throws IOException { + return create(TestingSettings.newBuilder().build()); + } + + /** + * Constructs an instance of TestingClient, 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 TestingClient create(TestingSettings settings) throws IOException { + return new TestingClient(settings); + } + + /** + * Constructs an instance of TestingClient, using the given stub for making calls. This is for + * advanced usage - prefer using create(TestingSettings). + */ + public static final TestingClient create(TestingStub stub) { + return new TestingClient(stub); + } + + /** + * Constructs an instance of TestingClient, 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 TestingClient(TestingSettings settings) throws IOException { + this.settings = settings; + this.stub = ((TestingStubSettings) settings.getStubSettings()).createStub(); + } + + protected TestingClient(TestingStub stub) { + this.settings = null; + this.stub = stub; + } + + public final TestingSettings getSettings() { + return settings; + } + + public TestingStub getStub() { + return stub; + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a new testing session. Adding this comment with special characters for comment + * formatting tests: 1. (abra->kadabra->alakazam) 2) [Nonsense][]: + * `pokemon/*/psychic/*` + * + *

        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 (TestingClient testingClient = TestingClient.create()) {
        +   *   CreateSessionRequest request =
        +   *       CreateSessionRequest.newBuilder().setSession(Session.newBuilder().build()).build();
        +   *   Session response = testingClient.createSession(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 Session createSession(CreateSessionRequest request) { + return createSessionCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a new testing session. Adding this comment with special characters for comment + * formatting tests: 1. (abra->kadabra->alakazam) 2) [Nonsense][]: + * `pokemon/*/psychic/*` + * + *

        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 (TestingClient testingClient = TestingClient.create()) {
        +   *   CreateSessionRequest request =
        +   *       CreateSessionRequest.newBuilder().setSession(Session.newBuilder().build()).build();
        +   *   ApiFuture future = testingClient.createSessionCallable().futureCall(request);
        +   *   // Do something.
        +   *   Session response = future.get();
        +   * }
        +   * }
        + */ + public final UnaryCallable createSessionCallable() { + return stub.createSessionCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets a testing session. + * + *

        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 (TestingClient testingClient = TestingClient.create()) {
        +   *   GetSessionRequest request =
        +   *       GetSessionRequest.newBuilder().setName(SessionName.of("[SESSION]").toString()).build();
        +   *   Session response = testingClient.getSession(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 Session getSession(GetSessionRequest request) { + return getSessionCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets a testing session. + * + *

        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 (TestingClient testingClient = TestingClient.create()) {
        +   *   GetSessionRequest request =
        +   *       GetSessionRequest.newBuilder().setName(SessionName.of("[SESSION]").toString()).build();
        +   *   ApiFuture future = testingClient.getSessionCallable().futureCall(request);
        +   *   // Do something.
        +   *   Session response = future.get();
        +   * }
        +   * }
        + */ + public final UnaryCallable getSessionCallable() { + return stub.getSessionCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists the current test sessions. + * + *

        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 (TestingClient testingClient = TestingClient.create()) {
        +   *   ListSessionsRequest request =
        +   *       ListSessionsRequest.newBuilder()
        +   *           .setPageSize(883849137)
        +   *           .setPageToken("pageToken873572522")
        +   *           .build();
        +   *   for (Session element : testingClient.listSessions(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 ListSessionsPagedResponse listSessions(ListSessionsRequest request) { + return listSessionsPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists the current test sessions. + * + *

        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 (TestingClient testingClient = TestingClient.create()) {
        +   *   ListSessionsRequest request =
        +   *       ListSessionsRequest.newBuilder()
        +   *           .setPageSize(883849137)
        +   *           .setPageToken("pageToken873572522")
        +   *           .build();
        +   *   ApiFuture future = testingClient.listSessionsPagedCallable().futureCall(request);
        +   *   // Do something.
        +   *   for (Session element : future.get().iterateAll()) {
        +   *     // doThingsWith(element);
        +   *   }
        +   * }
        +   * }
        + */ + public final UnaryCallable + listSessionsPagedCallable() { + return stub.listSessionsPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists the current test sessions. + * + *

        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 (TestingClient testingClient = TestingClient.create()) {
        +   *   ListSessionsRequest request =
        +   *       ListSessionsRequest.newBuilder()
        +   *           .setPageSize(883849137)
        +   *           .setPageToken("pageToken873572522")
        +   *           .build();
        +   *   while (true) {
        +   *     ListSessionsResponse response = testingClient.listSessionsCallable().call(request);
        +   *     for (Session element : response.getSessionsList()) {
        +   *       // doThingsWith(element);
        +   *     }
        +   *     String nextPageToken = response.getNextPageToken();
        +   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
        +   *       request = request.toBuilder().setPageToken(nextPageToken).build();
        +   *     } else {
        +   *       break;
        +   *     }
        +   *   }
        +   * }
        +   * }
        + */ + public final UnaryCallable listSessionsCallable() { + return stub.listSessionsCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Delete a test session. + * + *

        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 (TestingClient testingClient = TestingClient.create()) {
        +   *   DeleteSessionRequest request =
        +   *       DeleteSessionRequest.newBuilder().setName(SessionName.of("[SESSION]").toString()).build();
        +   *   testingClient.deleteSession(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 deleteSession(DeleteSessionRequest request) { + deleteSessionCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Delete a test session. + * + *

        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 (TestingClient testingClient = TestingClient.create()) {
        +   *   DeleteSessionRequest request =
        +   *       DeleteSessionRequest.newBuilder().setName(SessionName.of("[SESSION]").toString()).build();
        +   *   ApiFuture future = testingClient.deleteSessionCallable().futureCall(request);
        +   *   // Do something.
        +   *   future.get();
        +   * }
        +   * }
        + */ + public final UnaryCallable deleteSessionCallable() { + return stub.deleteSessionCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Report on the status of a session. This generates a report detailing which tests have been + * completed, and an overall rollup. + * + *

        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 (TestingClient testingClient = TestingClient.create()) {
        +   *   ReportSessionRequest request =
        +   *       ReportSessionRequest.newBuilder().setName(SessionName.of("[SESSION]").toString()).build();
        +   *   ReportSessionResponse response = testingClient.reportSession(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 ReportSessionResponse reportSession(ReportSessionRequest request) { + return reportSessionCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Report on the status of a session. This generates a report detailing which tests have been + * completed, and an overall rollup. + * + *

        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 (TestingClient testingClient = TestingClient.create()) {
        +   *   ReportSessionRequest request =
        +   *       ReportSessionRequest.newBuilder().setName(SessionName.of("[SESSION]").toString()).build();
        +   *   ApiFuture future =
        +   *       testingClient.reportSessionCallable().futureCall(request);
        +   *   // Do something.
        +   *   ReportSessionResponse response = future.get();
        +   * }
        +   * }
        + */ + public final UnaryCallable reportSessionCallable() { + return stub.reportSessionCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * List the tests of a sessesion. + * + *

        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 (TestingClient testingClient = TestingClient.create()) {
        +   *   ListTestsRequest request =
        +   *       ListTestsRequest.newBuilder()
        +   *           .setParent(SessionName.of("[SESSION]").toString())
        +   *           .setPageSize(883849137)
        +   *           .setPageToken("pageToken873572522")
        +   *           .build();
        +   *   for (Test element : testingClient.listTests(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 ListTestsPagedResponse listTests(ListTestsRequest request) { + return listTestsPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * List the tests of a sessesion. + * + *

        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 (TestingClient testingClient = TestingClient.create()) {
        +   *   ListTestsRequest request =
        +   *       ListTestsRequest.newBuilder()
        +   *           .setParent(SessionName.of("[SESSION]").toString())
        +   *           .setPageSize(883849137)
        +   *           .setPageToken("pageToken873572522")
        +   *           .build();
        +   *   ApiFuture future = testingClient.listTestsPagedCallable().futureCall(request);
        +   *   // Do something.
        +   *   for (Test element : future.get().iterateAll()) {
        +   *     // doThingsWith(element);
        +   *   }
        +   * }
        +   * }
        + */ + public final UnaryCallable listTestsPagedCallable() { + return stub.listTestsPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * List the tests of a sessesion. + * + *

        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 (TestingClient testingClient = TestingClient.create()) {
        +   *   ListTestsRequest request =
        +   *       ListTestsRequest.newBuilder()
        +   *           .setParent(SessionName.of("[SESSION]").toString())
        +   *           .setPageSize(883849137)
        +   *           .setPageToken("pageToken873572522")
        +   *           .build();
        +   *   while (true) {
        +   *     ListTestsResponse response = testingClient.listTestsCallable().call(request);
        +   *     for (Test element : response.getTestsList()) {
        +   *       // doThingsWith(element);
        +   *     }
        +   *     String nextPageToken = response.getNextPageToken();
        +   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
        +   *       request = request.toBuilder().setPageToken(nextPageToken).build();
        +   *     } else {
        +   *       break;
        +   *     }
        +   *   }
        +   * }
        +   * }
        + */ + public final UnaryCallable listTestsCallable() { + return stub.listTestsCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Explicitly decline to implement a test. + * + *

        This removes the test from subsequent `ListTests` calls, and attempting to do the test will + * error. + * + *

        This method will error if attempting to delete a required test. + * + *

        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 (TestingClient testingClient = TestingClient.create()) {
        +   *   DeleteTestRequest request =
        +   *       DeleteTestRequest.newBuilder()
        +   *           .setName(TestName.of("[SESSION]", "[TEST]").toString())
        +   *           .build();
        +   *   testingClient.deleteTest(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 deleteTest(DeleteTestRequest request) { + deleteTestCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Explicitly decline to implement a test. + * + *

        This removes the test from subsequent `ListTests` calls, and attempting to do the test will + * error. + * + *

        This method will error if attempting to delete a required test. + * + *

        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 (TestingClient testingClient = TestingClient.create()) {
        +   *   DeleteTestRequest request =
        +   *       DeleteTestRequest.newBuilder()
        +   *           .setName(TestName.of("[SESSION]", "[TEST]").toString())
        +   *           .build();
        +   *   ApiFuture future = testingClient.deleteTestCallable().futureCall(request);
        +   *   // Do something.
        +   *   future.get();
        +   * }
        +   * }
        + */ + public final UnaryCallable deleteTestCallable() { + return stub.deleteTestCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Register a response to a test. + * + *

        In cases where a test involves registering a final answer at the end of the test, this + * method provides the means to do so. + * + *

        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 (TestingClient testingClient = TestingClient.create()) {
        +   *   VerifyTestRequest request =
        +   *       VerifyTestRequest.newBuilder()
        +   *           .setName(TestName.of("[SESSION]", "[TEST]").toString())
        +   *           .setAnswer(ByteString.EMPTY)
        +   *           .addAllAnswers(new ArrayList())
        +   *           .build();
        +   *   VerifyTestResponse response = testingClient.verifyTest(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 VerifyTestResponse verifyTest(VerifyTestRequest request) { + return verifyTestCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Register a response to a test. + * + *

        In cases where a test involves registering a final answer at the end of the test, this + * method provides the means to do so. + * + *

        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 (TestingClient testingClient = TestingClient.create()) {
        +   *   VerifyTestRequest request =
        +   *       VerifyTestRequest.newBuilder()
        +   *           .setName(TestName.of("[SESSION]", "[TEST]").toString())
        +   *           .setAnswer(ByteString.EMPTY)
        +   *           .addAllAnswers(new ArrayList())
        +   *           .build();
        +   *   ApiFuture future = testingClient.verifyTestCallable().futureCall(request);
        +   *   // Do something.
        +   *   VerifyTestResponse response = future.get();
        +   * }
        +   * }
        + */ + public final UnaryCallable verifyTestCallable() { + return stub.verifyTestCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists information about the supported locations for this service. + * + *

        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 (TestingClient testingClient = TestingClient.create()) {
        +   *   ListLocationsRequest request =
        +   *       ListLocationsRequest.newBuilder()
        +   *           .setName("name3373707")
        +   *           .setFilter("filter-1274492040")
        +   *           .setPageSize(883849137)
        +   *           .setPageToken("pageToken873572522")
        +   *           .build();
        +   *   for (Location element : testingClient.listLocations(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 ListLocationsPagedResponse listLocations(ListLocationsRequest request) { + return listLocationsPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists information about the supported locations for this service. + * + *

        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 (TestingClient testingClient = TestingClient.create()) {
        +   *   ListLocationsRequest request =
        +   *       ListLocationsRequest.newBuilder()
        +   *           .setName("name3373707")
        +   *           .setFilter("filter-1274492040")
        +   *           .setPageSize(883849137)
        +   *           .setPageToken("pageToken873572522")
        +   *           .build();
        +   *   ApiFuture future = testingClient.listLocationsPagedCallable().futureCall(request);
        +   *   // Do something.
        +   *   for (Location element : future.get().iterateAll()) {
        +   *     // doThingsWith(element);
        +   *   }
        +   * }
        +   * }
        + */ + public final UnaryCallable + listLocationsPagedCallable() { + return stub.listLocationsPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists information about the supported locations for this service. + * + *

        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 (TestingClient testingClient = TestingClient.create()) {
        +   *   ListLocationsRequest request =
        +   *       ListLocationsRequest.newBuilder()
        +   *           .setName("name3373707")
        +   *           .setFilter("filter-1274492040")
        +   *           .setPageSize(883849137)
        +   *           .setPageToken("pageToken873572522")
        +   *           .build();
        +   *   while (true) {
        +   *     ListLocationsResponse response = testingClient.listLocationsCallable().call(request);
        +   *     for (Location element : response.getLocationsList()) {
        +   *       // doThingsWith(element);
        +   *     }
        +   *     String nextPageToken = response.getNextPageToken();
        +   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
        +   *       request = request.toBuilder().setPageToken(nextPageToken).build();
        +   *     } else {
        +   *       break;
        +   *     }
        +   *   }
        +   * }
        +   * }
        + */ + public final UnaryCallable listLocationsCallable() { + return stub.listLocationsCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets information about a location. + * + *

        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 (TestingClient testingClient = TestingClient.create()) {
        +   *   GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build();
        +   *   Location response = testingClient.getLocation(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 Location getLocation(GetLocationRequest request) { + return getLocationCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets information about a location. + * + *

        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 (TestingClient testingClient = TestingClient.create()) {
        +   *   GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build();
        +   *   ApiFuture future = testingClient.getLocationCallable().futureCall(request);
        +   *   // Do something.
        +   *   Location response = future.get();
        +   * }
        +   * }
        + */ + public final UnaryCallable getLocationCallable() { + return stub.getLocationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Sets the access control policy on the specified resource. Replaces any existing policy. + * + *

        Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED` errors. + * + *

        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 (TestingClient testingClient = TestingClient.create()) {
        +   *   SetIamPolicyRequest request =
        +   *       SetIamPolicyRequest.newBuilder()
        +   *           .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString())
        +   *           .setPolicy(Policy.newBuilder().build())
        +   *           .setUpdateMask(FieldMask.newBuilder().build())
        +   *           .build();
        +   *   Policy response = testingClient.setIamPolicy(request);
        +   * }
        +   * }
        + * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Policy setIamPolicy(SetIamPolicyRequest request) { + return setIamPolicyCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Sets the access control policy on the specified resource. Replaces any existing policy. + * + *

        Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED` errors. + * + *

        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 (TestingClient testingClient = TestingClient.create()) {
        +   *   SetIamPolicyRequest request =
        +   *       SetIamPolicyRequest.newBuilder()
        +   *           .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString())
        +   *           .setPolicy(Policy.newBuilder().build())
        +   *           .setUpdateMask(FieldMask.newBuilder().build())
        +   *           .build();
        +   *   ApiFuture future = testingClient.setIamPolicyCallable().futureCall(request);
        +   *   // Do something.
        +   *   Policy response = future.get();
        +   * }
        +   * }
        + */ + public final UnaryCallable setIamPolicyCallable() { + return stub.setIamPolicyCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets the access control policy for a resource. Returns an empty policy if the resource exists + * and does not have a policy set. + * + *

        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 (TestingClient testingClient = TestingClient.create()) {
        +   *   GetIamPolicyRequest request =
        +   *       GetIamPolicyRequest.newBuilder()
        +   *           .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString())
        +   *           .setOptions(GetPolicyOptions.newBuilder().build())
        +   *           .build();
        +   *   Policy response = testingClient.getIamPolicy(request);
        +   * }
        +   * }
        + * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Policy getIamPolicy(GetIamPolicyRequest request) { + return getIamPolicyCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets the access control policy for a resource. Returns an empty policy if the resource exists + * and does not have a policy set. + * + *

        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 (TestingClient testingClient = TestingClient.create()) {
        +   *   GetIamPolicyRequest request =
        +   *       GetIamPolicyRequest.newBuilder()
        +   *           .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString())
        +   *           .setOptions(GetPolicyOptions.newBuilder().build())
        +   *           .build();
        +   *   ApiFuture future = testingClient.getIamPolicyCallable().futureCall(request);
        +   *   // Do something.
        +   *   Policy response = future.get();
        +   * }
        +   * }
        + */ + public final UnaryCallable getIamPolicyCallable() { + return stub.getIamPolicyCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Returns permissions that a caller has on the specified resource. If the resource does not + * exist, this will return an empty set of permissions, not a `NOT_FOUND` error. + * + *

        Note: This operation is designed to be used for building permission-aware UIs and + * command-line tools, not for authorization checking. This operation may "fail open" without + * warning. + * + *

        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 (TestingClient testingClient = TestingClient.create()) {
        +   *   TestIamPermissionsRequest request =
        +   *       TestIamPermissionsRequest.newBuilder()
        +   *           .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString())
        +   *           .addAllPermissions(new ArrayList())
        +   *           .build();
        +   *   TestIamPermissionsResponse response = testingClient.testIamPermissions(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 TestIamPermissionsResponse testIamPermissions(TestIamPermissionsRequest request) { + return testIamPermissionsCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Returns permissions that a caller has on the specified resource. If the resource does not + * exist, this will return an empty set of permissions, not a `NOT_FOUND` error. + * + *

        Note: This operation is designed to be used for building permission-aware UIs and + * command-line tools, not for authorization checking. This operation may "fail open" without + * warning. + * + *

        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 (TestingClient testingClient = TestingClient.create()) {
        +   *   TestIamPermissionsRequest request =
        +   *       TestIamPermissionsRequest.newBuilder()
        +   *           .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString())
        +   *           .addAllPermissions(new ArrayList())
        +   *           .build();
        +   *   ApiFuture future =
        +   *       testingClient.testIamPermissionsCallable().futureCall(request);
        +   *   // Do something.
        +   *   TestIamPermissionsResponse response = future.get();
        +   * }
        +   * }
        + */ + public final UnaryCallable + testIamPermissionsCallable() { + return stub.testIamPermissionsCallable(); + } + + @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 ListSessionsPagedResponse + extends AbstractPagedListResponse< + ListSessionsRequest, + ListSessionsResponse, + Session, + ListSessionsPage, + ListSessionsFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListSessionsPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + input -> new ListSessionsPagedResponse(input), + MoreExecutors.directExecutor()); + } + + private ListSessionsPagedResponse(ListSessionsPage page) { + super(page, ListSessionsFixedSizeCollection.createEmptyCollection()); + } + } + + public static class ListSessionsPage + extends AbstractPage { + + private ListSessionsPage( + PageContext context, + ListSessionsResponse response) { + super(context, response); + } + + private static ListSessionsPage createEmptyPage() { + return new ListSessionsPage(null, null); + } + + @Override + protected ListSessionsPage createPage( + PageContext context, + ListSessionsResponse response) { + return new ListSessionsPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class ListSessionsFixedSizeCollection + extends AbstractFixedSizeCollection< + ListSessionsRequest, + ListSessionsResponse, + Session, + ListSessionsPage, + ListSessionsFixedSizeCollection> { + + private ListSessionsFixedSizeCollection(List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListSessionsFixedSizeCollection createEmptyCollection() { + return new ListSessionsFixedSizeCollection(null, 0); + } + + @Override + protected ListSessionsFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListSessionsFixedSizeCollection(pages, collectionSize); + } + } + + public static class ListTestsPagedResponse + extends AbstractPagedListResponse< + ListTestsRequest, ListTestsResponse, Test, ListTestsPage, ListTestsFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListTestsPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, input -> new ListTestsPagedResponse(input), MoreExecutors.directExecutor()); + } + + private ListTestsPagedResponse(ListTestsPage page) { + super(page, ListTestsFixedSizeCollection.createEmptyCollection()); + } + } + + public static class ListTestsPage + extends AbstractPage { + + private ListTestsPage( + PageContext context, + ListTestsResponse response) { + super(context, response); + } + + private static ListTestsPage createEmptyPage() { + return new ListTestsPage(null, null); + } + + @Override + protected ListTestsPage createPage( + PageContext context, + ListTestsResponse response) { + return new ListTestsPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class ListTestsFixedSizeCollection + extends AbstractFixedSizeCollection< + ListTestsRequest, ListTestsResponse, Test, ListTestsPage, ListTestsFixedSizeCollection> { + + private ListTestsFixedSizeCollection(List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListTestsFixedSizeCollection createEmptyCollection() { + return new ListTestsFixedSizeCollection(null, 0); + } + + @Override + protected ListTestsFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListTestsFixedSizeCollection(pages, collectionSize); + } + } + + public static class ListLocationsPagedResponse + extends AbstractPagedListResponse< + ListLocationsRequest, + ListLocationsResponse, + Location, + ListLocationsPage, + ListLocationsFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListLocationsPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + input -> new ListLocationsPagedResponse(input), + MoreExecutors.directExecutor()); + } + + private ListLocationsPagedResponse(ListLocationsPage page) { + super(page, ListLocationsFixedSizeCollection.createEmptyCollection()); + } + } + + public static class ListLocationsPage + extends AbstractPage< + ListLocationsRequest, ListLocationsResponse, Location, ListLocationsPage> { + + private ListLocationsPage( + PageContext context, + ListLocationsResponse response) { + super(context, response); + } + + private static ListLocationsPage createEmptyPage() { + return new ListLocationsPage(null, null); + } + + @Override + protected ListLocationsPage createPage( + PageContext context, + ListLocationsResponse response) { + return new ListLocationsPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class ListLocationsFixedSizeCollection + extends AbstractFixedSizeCollection< + ListLocationsRequest, + ListLocationsResponse, + Location, + ListLocationsPage, + ListLocationsFixedSizeCollection> { + + private ListLocationsFixedSizeCollection(List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListLocationsFixedSizeCollection createEmptyCollection() { + return new ListLocationsFixedSizeCollection(null, 0); + } + + @Override + protected ListLocationsFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListLocationsFixedSizeCollection(pages, collectionSize); + } + } +} diff --git a/java-showcase-3.21.0/gapic-showcase/src/main/java/com/google/showcase/v1beta1/TestingSettings.java b/java-showcase-3.21.0/gapic-showcase/src/main/java/com/google/showcase/v1beta1/TestingSettings.java new file mode 100644 index 0000000000..df199941fe --- /dev/null +++ b/java-showcase-3.21.0/gapic-showcase/src/main/java/com/google/showcase/v1beta1/TestingSettings.java @@ -0,0 +1,360 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1; + +import static com.google.showcase.v1beta1.TestingClient.ListLocationsPagedResponse; +import static com.google.showcase.v1beta1.TestingClient.ListSessionsPagedResponse; +import static com.google.showcase.v1beta1.TestingClient.ListTestsPagedResponse; + +import com.google.api.core.ApiFunction; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; +import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; +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.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.protobuf.Empty; +import com.google.showcase.v1beta1.stub.TestingStubSettings; +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 TestingClient}. + * + *

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

          + *
        • The default service address (localhost) and default port (7469) 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 createSession: + * + *

        {@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
        + * TestingSettings.Builder testingSettingsBuilder = TestingSettings.newBuilder();
        + * testingSettingsBuilder
        + *     .createSessionSettings()
        + *     .setRetrySettings(
        + *         testingSettingsBuilder
        + *             .createSessionSettings()
        + *             .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());
        + * TestingSettings testingSettings = testingSettingsBuilder.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. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class TestingSettings extends ClientSettings { + + /** Returns the object with the settings used for calls to createSession. */ + public UnaryCallSettings createSessionSettings() { + return ((TestingStubSettings) getStubSettings()).createSessionSettings(); + } + + /** Returns the object with the settings used for calls to getSession. */ + public UnaryCallSettings getSessionSettings() { + return ((TestingStubSettings) getStubSettings()).getSessionSettings(); + } + + /** Returns the object with the settings used for calls to listSessions. */ + public PagedCallSettings + listSessionsSettings() { + return ((TestingStubSettings) getStubSettings()).listSessionsSettings(); + } + + /** Returns the object with the settings used for calls to deleteSession. */ + public UnaryCallSettings deleteSessionSettings() { + return ((TestingStubSettings) getStubSettings()).deleteSessionSettings(); + } + + /** Returns the object with the settings used for calls to reportSession. */ + public UnaryCallSettings reportSessionSettings() { + return ((TestingStubSettings) getStubSettings()).reportSessionSettings(); + } + + /** Returns the object with the settings used for calls to listTests. */ + public PagedCallSettings + listTestsSettings() { + return ((TestingStubSettings) getStubSettings()).listTestsSettings(); + } + + /** Returns the object with the settings used for calls to deleteTest. */ + public UnaryCallSettings deleteTestSettings() { + return ((TestingStubSettings) getStubSettings()).deleteTestSettings(); + } + + /** Returns the object with the settings used for calls to verifyTest. */ + public UnaryCallSettings verifyTestSettings() { + return ((TestingStubSettings) getStubSettings()).verifyTestSettings(); + } + + /** Returns the object with the settings used for calls to listLocations. */ + public PagedCallSettings + listLocationsSettings() { + return ((TestingStubSettings) getStubSettings()).listLocationsSettings(); + } + + /** Returns the object with the settings used for calls to getLocation. */ + public UnaryCallSettings getLocationSettings() { + return ((TestingStubSettings) getStubSettings()).getLocationSettings(); + } + + /** Returns the object with the settings used for calls to setIamPolicy. */ + public UnaryCallSettings setIamPolicySettings() { + return ((TestingStubSettings) getStubSettings()).setIamPolicySettings(); + } + + /** Returns the object with the settings used for calls to getIamPolicy. */ + public UnaryCallSettings getIamPolicySettings() { + return ((TestingStubSettings) getStubSettings()).getIamPolicySettings(); + } + + /** Returns the object with the settings used for calls to testIamPermissions. */ + public UnaryCallSettings + testIamPermissionsSettings() { + return ((TestingStubSettings) getStubSettings()).testIamPermissionsSettings(); + } + + public static final TestingSettings create(TestingStubSettings stub) throws IOException { + return new TestingSettings.Builder(stub.toBuilder()).build(); + } + + /** Returns a builder for the default ExecutorProvider for this service. */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return TestingStubSettings.defaultExecutorProviderBuilder(); + } + + /** Returns the default service endpoint. */ + public static String getDefaultEndpoint() { + return TestingStubSettings.getDefaultEndpoint(); + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return TestingStubSettings.getDefaultServiceScopes(); + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return TestingStubSettings.defaultCredentialsProviderBuilder(); + } + + /** Returns a builder for the default gRPC ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return TestingStubSettings.defaultGrpcTransportProviderBuilder(); + } + + /** Returns a builder for the default REST ChannelProvider for this service. */ + @BetaApi + public static InstantiatingHttpJsonChannelProvider.Builder + defaultHttpJsonTransportProviderBuilder() { + return TestingStubSettings.defaultHttpJsonTransportProviderBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return TestingStubSettings.defaultTransportChannelProvider(); + } + + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return TestingStubSettings.defaultApiClientHeaderProviderBuilder(); + } + + /** Returns a new gRPC builder for this class. */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** Returns a new REST builder for this class. */ + public static Builder newHttpJsonBuilder() { + return Builder.createHttpJsonDefault(); + } + + /** 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 TestingSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + } + + /** Builder for TestingSettings. */ + public static class Builder extends ClientSettings.Builder { + + protected Builder() throws IOException { + this(((ClientContext) null)); + } + + protected Builder(ClientContext clientContext) { + super(TestingStubSettings.newBuilder(clientContext)); + } + + protected Builder(TestingSettings settings) { + super(settings.getStubSettings().toBuilder()); + } + + protected Builder(TestingStubSettings.Builder stubSettings) { + super(stubSettings); + } + + private static Builder createDefault() { + return new Builder(TestingStubSettings.newBuilder()); + } + + private static Builder createHttpJsonDefault() { + return new Builder(TestingStubSettings.newHttpJsonBuilder()); + } + + public TestingStubSettings.Builder getStubSettingsBuilder() { + return ((TestingStubSettings.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 createSession. */ + public UnaryCallSettings.Builder createSessionSettings() { + return getStubSettingsBuilder().createSessionSettings(); + } + + /** Returns the builder for the settings used for calls to getSession. */ + public UnaryCallSettings.Builder getSessionSettings() { + return getStubSettingsBuilder().getSessionSettings(); + } + + /** Returns the builder for the settings used for calls to listSessions. */ + public PagedCallSettings.Builder< + ListSessionsRequest, ListSessionsResponse, ListSessionsPagedResponse> + listSessionsSettings() { + return getStubSettingsBuilder().listSessionsSettings(); + } + + /** Returns the builder for the settings used for calls to deleteSession. */ + public UnaryCallSettings.Builder deleteSessionSettings() { + return getStubSettingsBuilder().deleteSessionSettings(); + } + + /** Returns the builder for the settings used for calls to reportSession. */ + public UnaryCallSettings.Builder + reportSessionSettings() { + return getStubSettingsBuilder().reportSessionSettings(); + } + + /** Returns the builder for the settings used for calls to listTests. */ + public PagedCallSettings.Builder + listTestsSettings() { + return getStubSettingsBuilder().listTestsSettings(); + } + + /** Returns the builder for the settings used for calls to deleteTest. */ + public UnaryCallSettings.Builder deleteTestSettings() { + return getStubSettingsBuilder().deleteTestSettings(); + } + + /** Returns the builder for the settings used for calls to verifyTest. */ + public UnaryCallSettings.Builder verifyTestSettings() { + return getStubSettingsBuilder().verifyTestSettings(); + } + + /** Returns the builder for the settings used for calls to listLocations. */ + public PagedCallSettings.Builder< + ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse> + listLocationsSettings() { + return getStubSettingsBuilder().listLocationsSettings(); + } + + /** Returns the builder for the settings used for calls to getLocation. */ + public UnaryCallSettings.Builder getLocationSettings() { + return getStubSettingsBuilder().getLocationSettings(); + } + + /** Returns the builder for the settings used for calls to setIamPolicy. */ + public UnaryCallSettings.Builder setIamPolicySettings() { + return getStubSettingsBuilder().setIamPolicySettings(); + } + + /** Returns the builder for the settings used for calls to getIamPolicy. */ + public UnaryCallSettings.Builder getIamPolicySettings() { + return getStubSettingsBuilder().getIamPolicySettings(); + } + + /** Returns the builder for the settings used for calls to testIamPermissions. */ + public UnaryCallSettings.Builder + testIamPermissionsSettings() { + return getStubSettingsBuilder().testIamPermissionsSettings(); + } + + @Override + public TestingSettings build() throws IOException { + return new TestingSettings(this); + } + } +} diff --git a/java-showcase-3.21.0/gapic-showcase/src/main/java/com/google/showcase/v1beta1/gapic_metadata.json b/java-showcase-3.21.0/gapic-showcase/src/main/java/com/google/showcase/v1beta1/gapic_metadata.json new file mode 100644 index 0000000000..4d11ed39b9 --- /dev/null +++ b/java-showcase-3.21.0/gapic-showcase/src/main/java/com/google/showcase/v1beta1/gapic_metadata.json @@ -0,0 +1,316 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "java", + "protoPackage": "google.showcase.v1beta1", + "libraryPackage": "com.google.showcase.v1beta1", + "services": { + "Compliance": { + "clients": { + "grpc": { + "libraryClient": "ComplianceClient", + "rpcs": { + "GetEnum": { + "methods": ["getEnum", "getEnumCallable"] + }, + "GetIamPolicy": { + "methods": ["getIamPolicy", "getIamPolicyCallable"] + }, + "GetLocation": { + "methods": ["getLocation", "getLocationCallable"] + }, + "ListLocations": { + "methods": ["listLocations", "listLocationsPagedCallable", "listLocationsCallable"] + }, + "RepeatDataBody": { + "methods": ["repeatDataBody", "repeatDataBodyCallable"] + }, + "RepeatDataBodyInfo": { + "methods": ["repeatDataBodyInfo", "repeatDataBodyInfoCallable"] + }, + "RepeatDataBodyPatch": { + "methods": ["repeatDataBodyPatch", "repeatDataBodyPatchCallable"] + }, + "RepeatDataBodyPut": { + "methods": ["repeatDataBodyPut", "repeatDataBodyPutCallable"] + }, + "RepeatDataPathResource": { + "methods": ["repeatDataPathResource", "repeatDataPathResourceCallable"] + }, + "RepeatDataPathTrailingResource": { + "methods": ["repeatDataPathTrailingResource", "repeatDataPathTrailingResourceCallable"] + }, + "RepeatDataQuery": { + "methods": ["repeatDataQuery", "repeatDataQueryCallable"] + }, + "RepeatDataSimplePath": { + "methods": ["repeatDataSimplePath", "repeatDataSimplePathCallable"] + }, + "SetIamPolicy": { + "methods": ["setIamPolicy", "setIamPolicyCallable"] + }, + "TestIamPermissions": { + "methods": ["testIamPermissions", "testIamPermissionsCallable"] + }, + "VerifyEnum": { + "methods": ["verifyEnum", "verifyEnumCallable"] + } + } + } + } + }, + "Echo": { + "clients": { + "grpc": { + "libraryClient": "EchoClient", + "rpcs": { + "Block": { + "methods": ["block", "blockCallable"] + }, + "Chat": { + "methods": ["chatCallable"] + }, + "Collect": { + "methods": ["collectCallable"] + }, + "Echo": { + "methods": ["echo", "echoCallable"] + }, + "EchoErrorDetails": { + "methods": ["echoErrorDetails", "echoErrorDetailsCallable"] + }, + "Expand": { + "methods": ["expandCallable"] + }, + "FailEchoWithDetails": { + "methods": ["failEchoWithDetails", "failEchoWithDetailsCallable"] + }, + "GetIamPolicy": { + "methods": ["getIamPolicy", "getIamPolicyCallable"] + }, + "GetLocation": { + "methods": ["getLocation", "getLocationCallable"] + }, + "ListLocations": { + "methods": ["listLocations", "listLocationsPagedCallable", "listLocationsCallable"] + }, + "PagedExpand": { + "methods": ["pagedExpand", "pagedExpandPagedCallable", "pagedExpandCallable"] + }, + "PagedExpandLegacy": { + "methods": ["pagedExpandLegacy", "pagedExpandLegacyCallable"] + }, + "PagedExpandLegacyMapped": { + "methods": ["pagedExpandLegacyMapped", "pagedExpandLegacyMappedPagedCallable", "pagedExpandLegacyMappedCallable"] + }, + "SetIamPolicy": { + "methods": ["setIamPolicy", "setIamPolicyCallable"] + }, + "TestIamPermissions": { + "methods": ["testIamPermissions", "testIamPermissionsCallable"] + }, + "Wait": { + "methods": ["waitAsync", "waitOperationCallable", "waitCallable"] + } + } + } + }, + "apiVersion": "v1_20240408" + }, + "Identity": { + "clients": { + "grpc": { + "libraryClient": "IdentityClient", + "rpcs": { + "CreateUser": { + "methods": ["createUser", "createUser", "createUser", "createUserCallable"] + }, + "DeleteUser": { + "methods": ["deleteUser", "deleteUser", "deleteUser", "deleteUserCallable"] + }, + "GetIamPolicy": { + "methods": ["getIamPolicy", "getIamPolicyCallable"] + }, + "GetLocation": { + "methods": ["getLocation", "getLocationCallable"] + }, + "GetUser": { + "methods": ["getUser", "getUser", "getUser", "getUserCallable"] + }, + "ListLocations": { + "methods": ["listLocations", "listLocationsPagedCallable", "listLocationsCallable"] + }, + "ListUsers": { + "methods": ["listUsers", "listUsersPagedCallable", "listUsersCallable"] + }, + "SetIamPolicy": { + "methods": ["setIamPolicy", "setIamPolicyCallable"] + }, + "TestIamPermissions": { + "methods": ["testIamPermissions", "testIamPermissionsCallable"] + }, + "UpdateUser": { + "methods": ["updateUser", "updateUserCallable"] + } + } + } + } + }, + "Messaging": { + "clients": { + "grpc": { + "libraryClient": "MessagingClient", + "rpcs": { + "Connect": { + "methods": ["connectCallable"] + }, + "CreateBlurb": { + "methods": ["createBlurb", "createBlurb", "createBlurb", "createBlurb", "createBlurb", "createBlurb", "createBlurb", "createBlurb", "createBlurb", "createBlurb", "createBlurb", "createBlurb", "createBlurb", "createBlurbCallable"] + }, + "CreateRoom": { + "methods": ["createRoom", "createRoom", "createRoomCallable"] + }, + "DeleteBlurb": { + "methods": ["deleteBlurb", "deleteBlurb", "deleteBlurb", "deleteBlurbCallable"] + }, + "DeleteRoom": { + "methods": ["deleteRoom", "deleteRoom", "deleteRoom", "deleteRoomCallable"] + }, + "GetBlurb": { + "methods": ["getBlurb", "getBlurb", "getBlurb", "getBlurbCallable"] + }, + "GetIamPolicy": { + "methods": ["getIamPolicy", "getIamPolicyCallable"] + }, + "GetLocation": { + "methods": ["getLocation", "getLocationCallable"] + }, + "GetRoom": { + "methods": ["getRoom", "getRoom", "getRoom", "getRoomCallable"] + }, + "ListBlurbs": { + "methods": ["listBlurbs", "listBlurbs", "listBlurbs", "listBlurbs", "listBlurbsPagedCallable", "listBlurbsCallable"] + }, + "ListLocations": { + "methods": ["listLocations", "listLocationsPagedCallable", "listLocationsCallable"] + }, + "ListRooms": { + "methods": ["listRooms", "listRoomsPagedCallable", "listRoomsCallable"] + }, + "SearchBlurbs": { + "methods": ["searchBlurbsAsync", "searchBlurbsAsync", "searchBlurbsAsync", "searchBlurbsAsync", "searchBlurbsOperationCallable", "searchBlurbsCallable"] + }, + "SendBlurbs": { + "methods": ["sendBlurbsCallable"] + }, + "SetIamPolicy": { + "methods": ["setIamPolicy", "setIamPolicyCallable"] + }, + "StreamBlurbs": { + "methods": ["streamBlurbsCallable"] + }, + "TestIamPermissions": { + "methods": ["testIamPermissions", "testIamPermissionsCallable"] + }, + "UpdateBlurb": { + "methods": ["updateBlurb", "updateBlurbCallable"] + }, + "UpdateRoom": { + "methods": ["updateRoom", "updateRoomCallable"] + } + } + } + } + }, + "SequenceService": { + "clients": { + "grpc": { + "libraryClient": "SequenceServiceClient", + "rpcs": { + "AttemptSequence": { + "methods": ["attemptSequence", "attemptSequence", "attemptSequence", "attemptSequenceCallable"] + }, + "AttemptStreamingSequence": { + "methods": ["attemptStreamingSequenceCallable"] + }, + "CreateSequence": { + "methods": ["createSequence", "createSequence", "createSequenceCallable"] + }, + "CreateStreamingSequence": { + "methods": ["createStreamingSequence", "createStreamingSequence", "createStreamingSequenceCallable"] + }, + "GetIamPolicy": { + "methods": ["getIamPolicy", "getIamPolicyCallable"] + }, + "GetLocation": { + "methods": ["getLocation", "getLocationCallable"] + }, + "GetSequenceReport": { + "methods": ["getSequenceReport", "getSequenceReport", "getSequenceReport", "getSequenceReportCallable"] + }, + "GetStreamingSequenceReport": { + "methods": ["getStreamingSequenceReport", "getStreamingSequenceReport", "getStreamingSequenceReport", "getStreamingSequenceReportCallable"] + }, + "ListLocations": { + "methods": ["listLocations", "listLocationsPagedCallable", "listLocationsCallable"] + }, + "SetIamPolicy": { + "methods": ["setIamPolicy", "setIamPolicyCallable"] + }, + "TestIamPermissions": { + "methods": ["testIamPermissions", "testIamPermissionsCallable"] + } + } + } + } + }, + "Testing": { + "clients": { + "grpc": { + "libraryClient": "TestingClient", + "rpcs": { + "CreateSession": { + "methods": ["createSession", "createSessionCallable"] + }, + "DeleteSession": { + "methods": ["deleteSession", "deleteSessionCallable"] + }, + "DeleteTest": { + "methods": ["deleteTest", "deleteTestCallable"] + }, + "GetIamPolicy": { + "methods": ["getIamPolicy", "getIamPolicyCallable"] + }, + "GetLocation": { + "methods": ["getLocation", "getLocationCallable"] + }, + "GetSession": { + "methods": ["getSession", "getSessionCallable"] + }, + "ListLocations": { + "methods": ["listLocations", "listLocationsPagedCallable", "listLocationsCallable"] + }, + "ListSessions": { + "methods": ["listSessions", "listSessionsPagedCallable", "listSessionsCallable"] + }, + "ListTests": { + "methods": ["listTests", "listTestsPagedCallable", "listTestsCallable"] + }, + "ReportSession": { + "methods": ["reportSession", "reportSessionCallable"] + }, + "SetIamPolicy": { + "methods": ["setIamPolicy", "setIamPolicyCallable"] + }, + "TestIamPermissions": { + "methods": ["testIamPermissions", "testIamPermissionsCallable"] + }, + "VerifyTest": { + "methods": ["verifyTest", "verifyTestCallable"] + } + } + } + } + } + } +} \ No newline at end of file diff --git a/java-showcase-3.21.0/gapic-showcase/src/main/java/com/google/showcase/v1beta1/package-info.java b/java-showcase-3.21.0/gapic-showcase/src/main/java/com/google/showcase/v1beta1/package-info.java new file mode 100644 index 0000000000..56f2990a66 --- /dev/null +++ b/java-showcase-3.21.0/gapic-showcase/src/main/java/com/google/showcase/v1beta1/package-info.java @@ -0,0 +1,166 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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 Client Libraries Showcase API + * + *

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

        ======================= ComplianceClient ======================= + * + *

        Service Description: This service is used to test that GAPICs implement various REST-related + * features correctly. This mostly means transcoding proto3 requests to REST format correctly for + * various types of HTTP annotations, but it also includes verifying that unknown (numeric) enums + * received by clients can be round-tripped correctly. + * + *

        Sample for ComplianceClient: + * + *

        {@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 (ComplianceClient complianceClient = ComplianceClient.create()) {
        + *   RepeatRequest request =
        + *       RepeatRequest.newBuilder()
        + *           .setName("name3373707")
        + *           .setInfo(ComplianceData.newBuilder().build())
        + *           .setServerVerify(true)
        + *           .setIntendedBindingUri("intendedBindingUri780142386")
        + *           .setFInt32(-1143775883)
        + *           .setFInt64(-1143775788)
        + *           .setFDouble(-1239459382)
        + *           .setPInt32(-858673665)
        + *           .setPInt64(-858673570)
        + *           .setPDouble(-991225216)
        + *           .build();
        + *   RepeatResponse response = complianceClient.repeatDataBody(request);
        + * }
        + * }
        + * + *

        ======================= EchoClient ======================= + * + *

        Service Description: This service is used showcase the four main types of rpcs - unary, server + * side streaming, client side streaming, and bidirectional streaming. This service also exposes + * methods that explicitly implement server delay, and paginated calls. Set the 'showcase-trailer' + * metadata key on any method to have the values echoed in the response trailers. Set the + * 'x-goog-request-params' metadata key on any method to have the values echoed in the response + * headers. + * + *

        Sample for EchoClient: + * + *

        {@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 (EchoClient echoClient = EchoClient.create()) {
        + *   EchoRequest request =
        + *       EchoRequest.newBuilder()
        + *           .setSeverity(Severity.forNumber(0))
        + *           .setHeader("header-1221270899")
        + *           .setOtherHeader("otherHeader-2026585667")
        + *           .setRequestId("requestId693933066")
        + *           .setOtherRequestId("otherRequestId1248995034")
        + *           .build();
        + *   EchoResponse response = echoClient.echo(request);
        + * }
        + * }
        + * + *

        ======================= IdentityClient ======================= + * + *

        Service Description: A simple identity service. + * + *

        Sample for IdentityClient: + * + *

        {@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 (IdentityClient identityClient = IdentityClient.create()) {
        + *   String displayName = "displayName1714148973";
        + *   String email = "email96619420";
        + *   User response = identityClient.createUser(displayName, email);
        + * }
        + * }
        + * + *

        ======================= MessagingClient ======================= + * + *

        Service Description: A simple messaging service that implements chat rooms and profile posts. + * + *

        This messaging service showcases the features that API clients generated by gapic-generators + * implement. + * + *

        Sample for MessagingClient: + * + *

        {@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 (MessagingClient messagingClient = MessagingClient.create()) {
        + *   String displayName = "displayName1714148973";
        + *   String description = "description-1724546052";
        + *   Room response = messagingClient.createRoom(displayName, description);
        + * }
        + * }
        + * + *

        ======================= SequenceServiceClient ======================= + * + *

        Sample for SequenceServiceClient: + * + *

        {@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 (SequenceServiceClient sequenceServiceClient = SequenceServiceClient.create()) {
        + *   Sequence sequence = Sequence.newBuilder().build();
        + *   Sequence response = sequenceServiceClient.createSequence(sequence);
        + * }
        + * }
        + * + *

        ======================= TestingClient ======================= + * + *

        Service Description: A service to facilitate running discrete sets of tests against Showcase. + * Adding this comment with special characters for comment formatting tests: 1. + * (abra->kadabra->alakazam) 2) [Nonsense][]: `pokemon/*/psychic/*` + * + *

        Sample for TestingClient: + * + *

        {@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 (TestingClient testingClient = TestingClient.create()) {
        + *   CreateSessionRequest request =
        + *       CreateSessionRequest.newBuilder().setSession(Session.newBuilder().build()).build();
        + *   Session response = testingClient.createSession(request);
        + * }
        + * }
        + */ +@Generated("by gapic-generator-java") +package com.google.showcase.v1beta1; + +import javax.annotation.Generated; diff --git a/java-showcase-3.21.0/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/ComplianceStub.java b/java-showcase-3.21.0/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/ComplianceStub.java new file mode 100644 index 0000000000..3597a8d360 --- /dev/null +++ b/java-showcase-3.21.0/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/ComplianceStub.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. + */ + +package com.google.showcase.v1beta1.stub; + +import static com.google.showcase.v1beta1.ComplianceClient.ListLocationsPagedResponse; + +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.showcase.v1beta1.EnumRequest; +import com.google.showcase.v1beta1.EnumResponse; +import com.google.showcase.v1beta1.RepeatRequest; +import com.google.showcase.v1beta1.RepeatResponse; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Base stub class for the Compliance service API. + * + *

        This class is for advanced usage and reflects the underlying API directly. + */ +@BetaApi +@Generated("by gapic-generator-java") +public abstract class ComplianceStub implements BackgroundResource { + + public UnaryCallable repeatDataBodyCallable() { + throw new UnsupportedOperationException("Not implemented: repeatDataBodyCallable()"); + } + + public UnaryCallable repeatDataBodyInfoCallable() { + throw new UnsupportedOperationException("Not implemented: repeatDataBodyInfoCallable()"); + } + + public UnaryCallable repeatDataQueryCallable() { + throw new UnsupportedOperationException("Not implemented: repeatDataQueryCallable()"); + } + + public UnaryCallable repeatDataSimplePathCallable() { + throw new UnsupportedOperationException("Not implemented: repeatDataSimplePathCallable()"); + } + + public UnaryCallable repeatDataPathResourceCallable() { + throw new UnsupportedOperationException("Not implemented: repeatDataPathResourceCallable()"); + } + + public UnaryCallable repeatDataPathTrailingResourceCallable() { + throw new UnsupportedOperationException( + "Not implemented: repeatDataPathTrailingResourceCallable()"); + } + + public UnaryCallable repeatDataBodyPutCallable() { + throw new UnsupportedOperationException("Not implemented: repeatDataBodyPutCallable()"); + } + + public UnaryCallable repeatDataBodyPatchCallable() { + throw new UnsupportedOperationException("Not implemented: repeatDataBodyPatchCallable()"); + } + + public UnaryCallable getEnumCallable() { + throw new UnsupportedOperationException("Not implemented: getEnumCallable()"); + } + + public UnaryCallable verifyEnumCallable() { + throw new UnsupportedOperationException("Not implemented: verifyEnumCallable()"); + } + + public UnaryCallable + listLocationsPagedCallable() { + throw new UnsupportedOperationException("Not implemented: listLocationsPagedCallable()"); + } + + public UnaryCallable listLocationsCallable() { + throw new UnsupportedOperationException("Not implemented: listLocationsCallable()"); + } + + public UnaryCallable getLocationCallable() { + throw new UnsupportedOperationException("Not implemented: getLocationCallable()"); + } + + public UnaryCallable setIamPolicyCallable() { + throw new UnsupportedOperationException("Not implemented: setIamPolicyCallable()"); + } + + public UnaryCallable getIamPolicyCallable() { + throw new UnsupportedOperationException("Not implemented: getIamPolicyCallable()"); + } + + public UnaryCallable + testIamPermissionsCallable() { + throw new UnsupportedOperationException("Not implemented: testIamPermissionsCallable()"); + } + + @Override + public abstract void close(); +} diff --git a/java-showcase-3.21.0/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/ComplianceStubSettings.java b/java-showcase-3.21.0/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/ComplianceStubSettings.java new file mode 100644 index 0000000000..ad7ae867bf --- /dev/null +++ b/java-showcase-3.21.0/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/ComplianceStubSettings.java @@ -0,0 +1,727 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.stub; + +import static com.google.showcase.v1beta1.ComplianceClient.ListLocationsPagedResponse; + +import com.google.api.core.ApiFunction; +import com.google.api.core.ApiFuture; +import com.google.api.core.BetaApi; +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.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.HttpJsonTransportChannel; +import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; +import com.google.api.gax.retrying.RetrySettings; +import com.google.api.gax.rpc.ApiCallContext; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.PagedListDescriptor; +import com.google.api.gax.rpc.PagedListResponseFactory; +import com.google.api.gax.rpc.StatusCode; +import com.google.api.gax.rpc.StubSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +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.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.showcase.v1beta1.EnumRequest; +import com.google.showcase.v1beta1.EnumResponse; +import com.google.showcase.v1beta1.RepeatRequest; +import com.google.showcase.v1beta1.RepeatResponse; +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 ComplianceStub}. + * + *

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

          + *
        • The default service address (localhost) and default port (7469) 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 repeatDataBody: + * + *

        {@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
        + * ComplianceStubSettings.Builder complianceSettingsBuilder = ComplianceStubSettings.newBuilder();
        + * complianceSettingsBuilder
        + *     .repeatDataBodySettings()
        + *     .setRetrySettings(
        + *         complianceSettingsBuilder
        + *             .repeatDataBodySettings()
        + *             .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());
        + * ComplianceStubSettings complianceSettings = complianceSettingsBuilder.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. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class ComplianceStubSettings extends StubSettings { + /** The default scopes of the service. */ + private static final ImmutableList DEFAULT_SERVICE_SCOPES = + ImmutableList.builder().build(); + + private final UnaryCallSettings repeatDataBodySettings; + private final UnaryCallSettings repeatDataBodyInfoSettings; + private final UnaryCallSettings repeatDataQuerySettings; + private final UnaryCallSettings repeatDataSimplePathSettings; + private final UnaryCallSettings repeatDataPathResourceSettings; + private final UnaryCallSettings + repeatDataPathTrailingResourceSettings; + private final UnaryCallSettings repeatDataBodyPutSettings; + private final UnaryCallSettings repeatDataBodyPatchSettings; + private final UnaryCallSettings getEnumSettings; + private final UnaryCallSettings verifyEnumSettings; + private final PagedCallSettings< + ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse> + listLocationsSettings; + private final UnaryCallSettings getLocationSettings; + private final UnaryCallSettings setIamPolicySettings; + private final UnaryCallSettings getIamPolicySettings; + private final UnaryCallSettings + testIamPermissionsSettings; + + private static final PagedListDescriptor + LIST_LOCATIONS_PAGE_STR_DESC = + new PagedListDescriptor() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public ListLocationsRequest injectToken(ListLocationsRequest payload, String token) { + return ListLocationsRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public ListLocationsRequest injectPageSize(ListLocationsRequest payload, int pageSize) { + return ListLocationsRequest.newBuilder(payload).setPageSize(pageSize).build(); + } + + @Override + public Integer extractPageSize(ListLocationsRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(ListLocationsResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources(ListLocationsResponse payload) { + return payload.getLocationsList(); + } + }; + + private static final PagedListResponseFactory< + ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse> + LIST_LOCATIONS_PAGE_STR_FACT = + new PagedListResponseFactory< + ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListLocationsRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext pageContext = + PageContext.create(callable, LIST_LOCATIONS_PAGE_STR_DESC, request, context); + return ListLocationsPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + /** Returns the object with the settings used for calls to repeatDataBody. */ + public UnaryCallSettings repeatDataBodySettings() { + return repeatDataBodySettings; + } + + /** Returns the object with the settings used for calls to repeatDataBodyInfo. */ + public UnaryCallSettings repeatDataBodyInfoSettings() { + return repeatDataBodyInfoSettings; + } + + /** Returns the object with the settings used for calls to repeatDataQuery. */ + public UnaryCallSettings repeatDataQuerySettings() { + return repeatDataQuerySettings; + } + + /** Returns the object with the settings used for calls to repeatDataSimplePath. */ + public UnaryCallSettings repeatDataSimplePathSettings() { + return repeatDataSimplePathSettings; + } + + /** Returns the object with the settings used for calls to repeatDataPathResource. */ + public UnaryCallSettings repeatDataPathResourceSettings() { + return repeatDataPathResourceSettings; + } + + /** Returns the object with the settings used for calls to repeatDataPathTrailingResource. */ + public UnaryCallSettings repeatDataPathTrailingResourceSettings() { + return repeatDataPathTrailingResourceSettings; + } + + /** Returns the object with the settings used for calls to repeatDataBodyPut. */ + public UnaryCallSettings repeatDataBodyPutSettings() { + return repeatDataBodyPutSettings; + } + + /** Returns the object with the settings used for calls to repeatDataBodyPatch. */ + public UnaryCallSettings repeatDataBodyPatchSettings() { + return repeatDataBodyPatchSettings; + } + + /** Returns the object with the settings used for calls to getEnum. */ + public UnaryCallSettings getEnumSettings() { + return getEnumSettings; + } + + /** Returns the object with the settings used for calls to verifyEnum. */ + public UnaryCallSettings verifyEnumSettings() { + return verifyEnumSettings; + } + + /** Returns the object with the settings used for calls to listLocations. */ + public PagedCallSettings + listLocationsSettings() { + return listLocationsSettings; + } + + /** Returns the object with the settings used for calls to getLocation. */ + public UnaryCallSettings getLocationSettings() { + return getLocationSettings; + } + + /** Returns the object with the settings used for calls to setIamPolicy. */ + public UnaryCallSettings setIamPolicySettings() { + return setIamPolicySettings; + } + + /** Returns the object with the settings used for calls to getIamPolicy. */ + public UnaryCallSettings getIamPolicySettings() { + return getIamPolicySettings; + } + + /** Returns the object with the settings used for calls to testIamPermissions. */ + public UnaryCallSettings + testIamPermissionsSettings() { + return testIamPermissionsSettings; + } + + public ComplianceStub createStub() throws IOException { + if (getTransportChannelProvider() + .getTransportName() + .equals(GrpcTransportChannel.getGrpcTransportName())) { + return GrpcComplianceStub.create(this); + } + if (getTransportChannelProvider() + .getTransportName() + .equals(HttpJsonTransportChannel.getHttpJsonTransportName())) { + return HttpJsonComplianceStub.create(this); + } + throw new UnsupportedOperationException( + String.format( + "Transport not supported: %s", getTransportChannelProvider().getTransportName())); + } + + /** Returns a builder for the default ExecutorProvider for this service. */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return InstantiatingExecutorProvider.newBuilder(); + } + + /** Returns the default service endpoint. */ + @ObsoleteApi("Use getEndpoint() instead") + public static String getDefaultEndpoint() { + return "localhost:7469"; + } + + /** Returns the default mTLS service endpoint. */ + public static String getDefaultMtlsEndpoint() { + return "localhost:7469"; + } + + /** 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 gRPC ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return InstantiatingGrpcChannelProvider.newBuilder() + .setMaxInboundMessageSize(Integer.MAX_VALUE); + } + + /** Returns a builder for the default REST ChannelProvider for this service. */ + @BetaApi + public static InstantiatingHttpJsonChannelProvider.Builder + defaultHttpJsonTransportProviderBuilder() { + return InstantiatingHttpJsonChannelProvider.newBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return defaultGrpcTransportProviderBuilder().build(); + } + + public static ApiClientHeaderProvider.Builder defaultGrpcApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken( + "gapic", GaxProperties.getLibraryVersion(ComplianceStubSettings.class)) + .setTransportToken( + GaxGrpcProperties.getGrpcTokenName(), GaxGrpcProperties.getGrpcVersion()); + } + + public static ApiClientHeaderProvider.Builder defaultHttpJsonApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken( + "gapic", GaxProperties.getLibraryVersion(ComplianceStubSettings.class)) + .setTransportToken( + GaxHttpJsonProperties.getHttpJsonTokenName(), + GaxHttpJsonProperties.getHttpJsonVersion()); + } + + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return ComplianceStubSettings.defaultGrpcApiClientHeaderProviderBuilder(); + } + + /** Returns a new gRPC builder for this class. */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** Returns a new REST builder for this class. */ + public static Builder newHttpJsonBuilder() { + return Builder.createHttpJsonDefault(); + } + + /** 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 ComplianceStubSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + + repeatDataBodySettings = settingsBuilder.repeatDataBodySettings().build(); + repeatDataBodyInfoSettings = settingsBuilder.repeatDataBodyInfoSettings().build(); + repeatDataQuerySettings = settingsBuilder.repeatDataQuerySettings().build(); + repeatDataSimplePathSettings = settingsBuilder.repeatDataSimplePathSettings().build(); + repeatDataPathResourceSettings = settingsBuilder.repeatDataPathResourceSettings().build(); + repeatDataPathTrailingResourceSettings = + settingsBuilder.repeatDataPathTrailingResourceSettings().build(); + repeatDataBodyPutSettings = settingsBuilder.repeatDataBodyPutSettings().build(); + repeatDataBodyPatchSettings = settingsBuilder.repeatDataBodyPatchSettings().build(); + getEnumSettings = settingsBuilder.getEnumSettings().build(); + verifyEnumSettings = settingsBuilder.verifyEnumSettings().build(); + listLocationsSettings = settingsBuilder.listLocationsSettings().build(); + getLocationSettings = settingsBuilder.getLocationSettings().build(); + setIamPolicySettings = settingsBuilder.setIamPolicySettings().build(); + getIamPolicySettings = settingsBuilder.getIamPolicySettings().build(); + testIamPermissionsSettings = settingsBuilder.testIamPermissionsSettings().build(); + } + + /** Builder for ComplianceStubSettings. */ + public static class Builder extends StubSettings.Builder { + private final ImmutableList> unaryMethodSettingsBuilders; + private final UnaryCallSettings.Builder repeatDataBodySettings; + private final UnaryCallSettings.Builder + repeatDataBodyInfoSettings; + private final UnaryCallSettings.Builder repeatDataQuerySettings; + private final UnaryCallSettings.Builder + repeatDataSimplePathSettings; + private final UnaryCallSettings.Builder + repeatDataPathResourceSettings; + private final UnaryCallSettings.Builder + repeatDataPathTrailingResourceSettings; + private final UnaryCallSettings.Builder + repeatDataBodyPutSettings; + private final UnaryCallSettings.Builder + repeatDataBodyPatchSettings; + private final UnaryCallSettings.Builder getEnumSettings; + private final UnaryCallSettings.Builder verifyEnumSettings; + private final PagedCallSettings.Builder< + ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse> + listLocationsSettings; + private final UnaryCallSettings.Builder getLocationSettings; + private final UnaryCallSettings.Builder setIamPolicySettings; + private final UnaryCallSettings.Builder getIamPolicySettings; + private final UnaryCallSettings.Builder + testIamPermissionsSettings; + private static final ImmutableMap> + RETRYABLE_CODE_DEFINITIONS; + + static { + ImmutableMap.Builder> definitions = + ImmutableMap.builder(); + definitions.put("no_retry_codes", ImmutableSet.copyOf(Lists.newArrayList())); + RETRYABLE_CODE_DEFINITIONS = definitions.build(); + } + + private static final ImmutableMap RETRY_PARAM_DEFINITIONS; + + static { + ImmutableMap.Builder definitions = ImmutableMap.builder(); + RetrySettings settings = null; + settings = RetrySettings.newBuilder().setRpcTimeoutMultiplier(1.0).build(); + definitions.put("no_retry_params", settings); + RETRY_PARAM_DEFINITIONS = definitions.build(); + } + + protected Builder() { + this(((ClientContext) null)); + } + + protected Builder(ClientContext clientContext) { + super(clientContext); + + repeatDataBodySettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + repeatDataBodyInfoSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + repeatDataQuerySettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + repeatDataSimplePathSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + repeatDataPathResourceSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + repeatDataPathTrailingResourceSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + repeatDataBodyPutSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + repeatDataBodyPatchSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + getEnumSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + verifyEnumSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + listLocationsSettings = PagedCallSettings.newBuilder(LIST_LOCATIONS_PAGE_STR_FACT); + getLocationSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + setIamPolicySettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + getIamPolicySettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + testIamPermissionsSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + repeatDataBodySettings, + repeatDataBodyInfoSettings, + repeatDataQuerySettings, + repeatDataSimplePathSettings, + repeatDataPathResourceSettings, + repeatDataPathTrailingResourceSettings, + repeatDataBodyPutSettings, + repeatDataBodyPatchSettings, + getEnumSettings, + verifyEnumSettings, + listLocationsSettings, + getLocationSettings, + setIamPolicySettings, + getIamPolicySettings, + testIamPermissionsSettings); + initDefaults(this); + } + + protected Builder(ComplianceStubSettings settings) { + super(settings); + + repeatDataBodySettings = settings.repeatDataBodySettings.toBuilder(); + repeatDataBodyInfoSettings = settings.repeatDataBodyInfoSettings.toBuilder(); + repeatDataQuerySettings = settings.repeatDataQuerySettings.toBuilder(); + repeatDataSimplePathSettings = settings.repeatDataSimplePathSettings.toBuilder(); + repeatDataPathResourceSettings = settings.repeatDataPathResourceSettings.toBuilder(); + repeatDataPathTrailingResourceSettings = + settings.repeatDataPathTrailingResourceSettings.toBuilder(); + repeatDataBodyPutSettings = settings.repeatDataBodyPutSettings.toBuilder(); + repeatDataBodyPatchSettings = settings.repeatDataBodyPatchSettings.toBuilder(); + getEnumSettings = settings.getEnumSettings.toBuilder(); + verifyEnumSettings = settings.verifyEnumSettings.toBuilder(); + listLocationsSettings = settings.listLocationsSettings.toBuilder(); + getLocationSettings = settings.getLocationSettings.toBuilder(); + setIamPolicySettings = settings.setIamPolicySettings.toBuilder(); + getIamPolicySettings = settings.getIamPolicySettings.toBuilder(); + testIamPermissionsSettings = settings.testIamPermissionsSettings.toBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + repeatDataBodySettings, + repeatDataBodyInfoSettings, + repeatDataQuerySettings, + repeatDataSimplePathSettings, + repeatDataPathResourceSettings, + repeatDataPathTrailingResourceSettings, + repeatDataBodyPutSettings, + repeatDataBodyPatchSettings, + getEnumSettings, + verifyEnumSettings, + listLocationsSettings, + getLocationSettings, + setIamPolicySettings, + getIamPolicySettings, + testIamPermissionsSettings); + } + + 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 createHttpJsonDefault() { + Builder builder = new Builder(((ClientContext) null)); + + builder.setTransportChannelProvider(defaultHttpJsonTransportProviderBuilder().build()); + builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); + builder.setInternalHeaderProvider(defaultHttpJsonApiClientHeaderProviderBuilder().build()); + builder.setMtlsEndpoint(getDefaultMtlsEndpoint()); + builder.setSwitchToMtlsEndpointAllowed(true); + + return initDefaults(builder); + } + + private static Builder initDefaults(Builder builder) { + builder + .repeatDataBodySettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .repeatDataBodyInfoSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .repeatDataQuerySettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .repeatDataSimplePathSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .repeatDataPathResourceSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .repeatDataPathTrailingResourceSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .repeatDataBodyPutSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .repeatDataBodyPatchSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .getEnumSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .verifyEnumSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .listLocationsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .getLocationSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .setIamPolicySettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .getIamPolicySettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .testIamPermissionsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_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 repeatDataBody. */ + public UnaryCallSettings.Builder repeatDataBodySettings() { + return repeatDataBodySettings; + } + + /** Returns the builder for the settings used for calls to repeatDataBodyInfo. */ + public UnaryCallSettings.Builder repeatDataBodyInfoSettings() { + return repeatDataBodyInfoSettings; + } + + /** Returns the builder for the settings used for calls to repeatDataQuery. */ + public UnaryCallSettings.Builder repeatDataQuerySettings() { + return repeatDataQuerySettings; + } + + /** Returns the builder for the settings used for calls to repeatDataSimplePath. */ + public UnaryCallSettings.Builder repeatDataSimplePathSettings() { + return repeatDataSimplePathSettings; + } + + /** Returns the builder for the settings used for calls to repeatDataPathResource. */ + public UnaryCallSettings.Builder + repeatDataPathResourceSettings() { + return repeatDataPathResourceSettings; + } + + /** Returns the builder for the settings used for calls to repeatDataPathTrailingResource. */ + public UnaryCallSettings.Builder + repeatDataPathTrailingResourceSettings() { + return repeatDataPathTrailingResourceSettings; + } + + /** Returns the builder for the settings used for calls to repeatDataBodyPut. */ + public UnaryCallSettings.Builder repeatDataBodyPutSettings() { + return repeatDataBodyPutSettings; + } + + /** Returns the builder for the settings used for calls to repeatDataBodyPatch. */ + public UnaryCallSettings.Builder repeatDataBodyPatchSettings() { + return repeatDataBodyPatchSettings; + } + + /** Returns the builder for the settings used for calls to getEnum. */ + public UnaryCallSettings.Builder getEnumSettings() { + return getEnumSettings; + } + + /** Returns the builder for the settings used for calls to verifyEnum. */ + public UnaryCallSettings.Builder verifyEnumSettings() { + return verifyEnumSettings; + } + + /** Returns the builder for the settings used for calls to listLocations. */ + public PagedCallSettings.Builder< + ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse> + listLocationsSettings() { + return listLocationsSettings; + } + + /** Returns the builder for the settings used for calls to getLocation. */ + public UnaryCallSettings.Builder getLocationSettings() { + return getLocationSettings; + } + + /** Returns the builder for the settings used for calls to setIamPolicy. */ + public UnaryCallSettings.Builder setIamPolicySettings() { + return setIamPolicySettings; + } + + /** Returns the builder for the settings used for calls to getIamPolicy. */ + public UnaryCallSettings.Builder getIamPolicySettings() { + return getIamPolicySettings; + } + + /** Returns the builder for the settings used for calls to testIamPermissions. */ + public UnaryCallSettings.Builder + testIamPermissionsSettings() { + return testIamPermissionsSettings; + } + + @Override + public ComplianceStubSettings build() throws IOException { + return new ComplianceStubSettings(this); + } + } +} diff --git a/java-showcase-3.21.0/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/EchoStub.java b/java-showcase-3.21.0/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/EchoStub.java new file mode 100644 index 0000000000..fd0fe7d6b3 --- /dev/null +++ b/java-showcase-3.21.0/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/EchoStub.java @@ -0,0 +1,166 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.stub; + +import static com.google.showcase.v1beta1.EchoClient.ListLocationsPagedResponse; +import static com.google.showcase.v1beta1.EchoClient.PagedExpandLegacyMappedPagedResponse; +import static com.google.showcase.v1beta1.EchoClient.PagedExpandPagedResponse; + +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.rpc.BidiStreamingCallable; +import com.google.api.gax.rpc.ClientStreamingCallable; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.longrunning.Operation; +import com.google.longrunning.stub.OperationsStub; +import com.google.showcase.v1beta1.BlockRequest; +import com.google.showcase.v1beta1.BlockResponse; +import com.google.showcase.v1beta1.EchoErrorDetailsRequest; +import com.google.showcase.v1beta1.EchoErrorDetailsResponse; +import com.google.showcase.v1beta1.EchoRequest; +import com.google.showcase.v1beta1.EchoResponse; +import com.google.showcase.v1beta1.ExpandRequest; +import com.google.showcase.v1beta1.FailEchoWithDetailsRequest; +import com.google.showcase.v1beta1.FailEchoWithDetailsResponse; +import com.google.showcase.v1beta1.PagedExpandLegacyMappedResponse; +import com.google.showcase.v1beta1.PagedExpandLegacyRequest; +import com.google.showcase.v1beta1.PagedExpandRequest; +import com.google.showcase.v1beta1.PagedExpandResponse; +import com.google.showcase.v1beta1.WaitMetadata; +import com.google.showcase.v1beta1.WaitRequest; +import com.google.showcase.v1beta1.WaitResponse; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Base stub class for the Echo service API. + * + *

        This class is for advanced usage and reflects the underlying API directly. + */ +@BetaApi +@Generated("by gapic-generator-java") +public abstract class EchoStub implements BackgroundResource { + + public OperationsStub getOperationsStub() { + return null; + } + + public com.google.api.gax.httpjson.longrunning.stub.OperationsStub getHttpJsonOperationsStub() { + return null; + } + + public UnaryCallable echoCallable() { + throw new UnsupportedOperationException("Not implemented: echoCallable()"); + } + + public UnaryCallable + echoErrorDetailsCallable() { + throw new UnsupportedOperationException("Not implemented: echoErrorDetailsCallable()"); + } + + public UnaryCallable + failEchoWithDetailsCallable() { + throw new UnsupportedOperationException("Not implemented: failEchoWithDetailsCallable()"); + } + + public ServerStreamingCallable expandCallable() { + throw new UnsupportedOperationException("Not implemented: expandCallable()"); + } + + public ClientStreamingCallable collectCallable() { + throw new UnsupportedOperationException("Not implemented: collectCallable()"); + } + + public BidiStreamingCallable chatCallable() { + throw new UnsupportedOperationException("Not implemented: chatCallable()"); + } + + public UnaryCallable pagedExpandPagedCallable() { + throw new UnsupportedOperationException("Not implemented: pagedExpandPagedCallable()"); + } + + public UnaryCallable pagedExpandCallable() { + throw new UnsupportedOperationException("Not implemented: pagedExpandCallable()"); + } + + public UnaryCallable pagedExpandLegacyCallable() { + throw new UnsupportedOperationException("Not implemented: pagedExpandLegacyCallable()"); + } + + public UnaryCallable + pagedExpandLegacyMappedPagedCallable() { + throw new UnsupportedOperationException( + "Not implemented: pagedExpandLegacyMappedPagedCallable()"); + } + + public UnaryCallable + pagedExpandLegacyMappedCallable() { + throw new UnsupportedOperationException("Not implemented: pagedExpandLegacyMappedCallable()"); + } + + public OperationCallable waitOperationCallable() { + throw new UnsupportedOperationException("Not implemented: waitOperationCallable()"); + } + + public UnaryCallable waitCallable() { + throw new UnsupportedOperationException("Not implemented: waitCallable()"); + } + + public UnaryCallable blockCallable() { + throw new UnsupportedOperationException("Not implemented: blockCallable()"); + } + + public UnaryCallable + listLocationsPagedCallable() { + throw new UnsupportedOperationException("Not implemented: listLocationsPagedCallable()"); + } + + public UnaryCallable listLocationsCallable() { + throw new UnsupportedOperationException("Not implemented: listLocationsCallable()"); + } + + public UnaryCallable getLocationCallable() { + throw new UnsupportedOperationException("Not implemented: getLocationCallable()"); + } + + public UnaryCallable setIamPolicyCallable() { + throw new UnsupportedOperationException("Not implemented: setIamPolicyCallable()"); + } + + public UnaryCallable getIamPolicyCallable() { + throw new UnsupportedOperationException("Not implemented: getIamPolicyCallable()"); + } + + public UnaryCallable + testIamPermissionsCallable() { + throw new UnsupportedOperationException("Not implemented: testIamPermissionsCallable()"); + } + + @Override + public abstract void close(); +} diff --git a/java-showcase-3.21.0/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/EchoStubSettings.java b/java-showcase-3.21.0/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/EchoStubSettings.java new file mode 100644 index 0000000000..4ca4053954 --- /dev/null +++ b/java-showcase-3.21.0/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/EchoStubSettings.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. + */ + +package com.google.showcase.v1beta1.stub; + +import static com.google.showcase.v1beta1.EchoClient.ListLocationsPagedResponse; +import static com.google.showcase.v1beta1.EchoClient.PagedExpandLegacyMappedPagedResponse; +import static com.google.showcase.v1beta1.EchoClient.PagedExpandPagedResponse; + +import com.google.api.core.ApiFunction; +import com.google.api.core.ApiFuture; +import com.google.api.core.BetaApi; +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.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.HttpJsonTransportChannel; +import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; +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.ServerStreamingCallSettings; +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.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +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.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.longrunning.Operation; +import com.google.showcase.v1beta1.BlockRequest; +import com.google.showcase.v1beta1.BlockResponse; +import com.google.showcase.v1beta1.EchoErrorDetailsRequest; +import com.google.showcase.v1beta1.EchoErrorDetailsResponse; +import com.google.showcase.v1beta1.EchoRequest; +import com.google.showcase.v1beta1.EchoResponse; +import com.google.showcase.v1beta1.ExpandRequest; +import com.google.showcase.v1beta1.FailEchoWithDetailsRequest; +import com.google.showcase.v1beta1.FailEchoWithDetailsResponse; +import com.google.showcase.v1beta1.PagedExpandLegacyMappedResponse; +import com.google.showcase.v1beta1.PagedExpandLegacyRequest; +import com.google.showcase.v1beta1.PagedExpandRequest; +import com.google.showcase.v1beta1.PagedExpandResponse; +import com.google.showcase.v1beta1.PagedExpandResponseList; +import com.google.showcase.v1beta1.WaitMetadata; +import com.google.showcase.v1beta1.WaitRequest; +import com.google.showcase.v1beta1.WaitResponse; +import java.io.IOException; +import java.time.Duration; +import java.util.List; +import java.util.Map; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Settings class to configure an instance of {@link EchoStub}. + * + *

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

          + *
        • The default service address (localhost) and default port (7469) 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 echo: + * + *

        {@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
        + * EchoStubSettings.Builder echoSettingsBuilder = EchoStubSettings.newBuilder();
        + * echoSettingsBuilder
        + *     .echoSettings()
        + *     .setRetrySettings(
        + *         echoSettingsBuilder
        + *             .echoSettings()
        + *             .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());
        + * EchoStubSettings echoSettings = echoSettingsBuilder.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 wait: + * + *

        {@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
        + * EchoStubSettings.Builder echoSettingsBuilder = EchoStubSettings.newBuilder();
        + * TimedRetryAlgorithm timedRetryAlgorithm =
        + *     OperationalTimedPollAlgorithm.create(
        + *         RetrySettings.newBuilder()
        + *             .setInitialRetryDelayDuration(Duration.ofMillis(500))
        + *             .setRetryDelayMultiplier(1.5)
        + *             .setMaxRetryDelayDuration(Duration.ofMillis(5000))
        + *             .setTotalTimeoutDuration(Duration.ofHours(24))
        + *             .build());
        + * echoSettingsBuilder
        + *     .createClusterOperationSettings()
        + *     .setPollingAlgorithm(timedRetryAlgorithm)
        + *     .build();
        + * }
        + */ +@BetaApi +@Generated("by gapic-generator-java") +public class EchoStubSettings extends StubSettings { + /** The default scopes of the service. */ + private static final ImmutableList DEFAULT_SERVICE_SCOPES = + ImmutableList.builder().build(); + + private final UnaryCallSettings echoSettings; + private final UnaryCallSettings + echoErrorDetailsSettings; + private final UnaryCallSettings + failEchoWithDetailsSettings; + private final ServerStreamingCallSettings expandSettings; + private final StreamingCallSettings collectSettings; + private final StreamingCallSettings chatSettings; + private final PagedCallSettings + pagedExpandSettings; + private final UnaryCallSettings + pagedExpandLegacySettings; + private final PagedCallSettings< + PagedExpandRequest, PagedExpandLegacyMappedResponse, PagedExpandLegacyMappedPagedResponse> + pagedExpandLegacyMappedSettings; + private final UnaryCallSettings waitSettings; + private final OperationCallSettings + waitOperationSettings; + private final UnaryCallSettings blockSettings; + private final PagedCallSettings< + ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse> + listLocationsSettings; + private final UnaryCallSettings getLocationSettings; + private final UnaryCallSettings setIamPolicySettings; + private final UnaryCallSettings getIamPolicySettings; + private final UnaryCallSettings + testIamPermissionsSettings; + + private static final PagedListDescriptor + PAGED_EXPAND_PAGE_STR_DESC = + new PagedListDescriptor() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public PagedExpandRequest injectToken(PagedExpandRequest payload, String token) { + return PagedExpandRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public PagedExpandRequest injectPageSize(PagedExpandRequest payload, int pageSize) { + return PagedExpandRequest.newBuilder(payload).setPageSize(pageSize).build(); + } + + @Override + public Integer extractPageSize(PagedExpandRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(PagedExpandResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources(PagedExpandResponse payload) { + return payload.getResponsesList(); + } + }; + + private static final PagedListDescriptor< + PagedExpandRequest, + PagedExpandLegacyMappedResponse, + Map.Entry> + PAGED_EXPAND_LEGACY_MAPPED_PAGE_STR_DESC = + new PagedListDescriptor< + PagedExpandRequest, + PagedExpandLegacyMappedResponse, + Map.Entry>() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public PagedExpandRequest injectToken(PagedExpandRequest payload, String token) { + return PagedExpandRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public PagedExpandRequest injectPageSize(PagedExpandRequest payload, int pageSize) { + return PagedExpandRequest.newBuilder(payload).setPageSize(pageSize).build(); + } + + @Override + public Integer extractPageSize(PagedExpandRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(PagedExpandLegacyMappedResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable> extractResources( + PagedExpandLegacyMappedResponse payload) { + return payload.getAlphabetizedMap().entrySet(); + } + }; + + private static final PagedListDescriptor + LIST_LOCATIONS_PAGE_STR_DESC = + new PagedListDescriptor() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public ListLocationsRequest injectToken(ListLocationsRequest payload, String token) { + return ListLocationsRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public ListLocationsRequest injectPageSize(ListLocationsRequest payload, int pageSize) { + return ListLocationsRequest.newBuilder(payload).setPageSize(pageSize).build(); + } + + @Override + public Integer extractPageSize(ListLocationsRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(ListLocationsResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources(ListLocationsResponse payload) { + return payload.getLocationsList(); + } + }; + + private static final PagedListResponseFactory< + PagedExpandRequest, PagedExpandResponse, PagedExpandPagedResponse> + PAGED_EXPAND_PAGE_STR_FACT = + new PagedListResponseFactory< + PagedExpandRequest, PagedExpandResponse, PagedExpandPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + PagedExpandRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext pageContext = + PageContext.create(callable, PAGED_EXPAND_PAGE_STR_DESC, request, context); + return PagedExpandPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + private static final PagedListResponseFactory< + PagedExpandRequest, PagedExpandLegacyMappedResponse, PagedExpandLegacyMappedPagedResponse> + PAGED_EXPAND_LEGACY_MAPPED_PAGE_STR_FACT = + new PagedListResponseFactory< + PagedExpandRequest, + PagedExpandLegacyMappedResponse, + PagedExpandLegacyMappedPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + PagedExpandRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext< + PagedExpandRequest, + PagedExpandLegacyMappedResponse, + Map.Entry> + pageContext = + PageContext.create( + callable, PAGED_EXPAND_LEGACY_MAPPED_PAGE_STR_DESC, request, context); + return PagedExpandLegacyMappedPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + private static final PagedListResponseFactory< + ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse> + LIST_LOCATIONS_PAGE_STR_FACT = + new PagedListResponseFactory< + ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListLocationsRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext pageContext = + PageContext.create(callable, LIST_LOCATIONS_PAGE_STR_DESC, request, context); + return ListLocationsPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + /** Returns the object with the settings used for calls to echo. */ + public UnaryCallSettings echoSettings() { + return echoSettings; + } + + /** Returns the object with the settings used for calls to echoErrorDetails. */ + public UnaryCallSettings + echoErrorDetailsSettings() { + return echoErrorDetailsSettings; + } + + /** Returns the object with the settings used for calls to failEchoWithDetails. */ + public UnaryCallSettings + failEchoWithDetailsSettings() { + return failEchoWithDetailsSettings; + } + + /** Returns the object with the settings used for calls to expand. */ + public ServerStreamingCallSettings expandSettings() { + return expandSettings; + } + + /** Returns the object with the settings used for calls to collect. */ + public StreamingCallSettings collectSettings() { + return collectSettings; + } + + /** Returns the object with the settings used for calls to chat. */ + public StreamingCallSettings chatSettings() { + return chatSettings; + } + + /** Returns the object with the settings used for calls to pagedExpand. */ + public PagedCallSettings + pagedExpandSettings() { + return pagedExpandSettings; + } + + /** Returns the object with the settings used for calls to pagedExpandLegacy. */ + public UnaryCallSettings + pagedExpandLegacySettings() { + return pagedExpandLegacySettings; + } + + /** Returns the object with the settings used for calls to pagedExpandLegacyMapped. */ + public PagedCallSettings< + PagedExpandRequest, PagedExpandLegacyMappedResponse, PagedExpandLegacyMappedPagedResponse> + pagedExpandLegacyMappedSettings() { + return pagedExpandLegacyMappedSettings; + } + + /** Returns the object with the settings used for calls to wait. */ + public UnaryCallSettings waitSettings() { + return waitSettings; + } + + /** Returns the object with the settings used for calls to wait. */ + public OperationCallSettings waitOperationSettings() { + return waitOperationSettings; + } + + /** Returns the object with the settings used for calls to block. */ + public UnaryCallSettings blockSettings() { + return blockSettings; + } + + /** Returns the object with the settings used for calls to listLocations. */ + public PagedCallSettings + listLocationsSettings() { + return listLocationsSettings; + } + + /** Returns the object with the settings used for calls to getLocation. */ + public UnaryCallSettings getLocationSettings() { + return getLocationSettings; + } + + /** Returns the object with the settings used for calls to setIamPolicy. */ + public UnaryCallSettings setIamPolicySettings() { + return setIamPolicySettings; + } + + /** Returns the object with the settings used for calls to getIamPolicy. */ + public UnaryCallSettings getIamPolicySettings() { + return getIamPolicySettings; + } + + /** Returns the object with the settings used for calls to testIamPermissions. */ + public UnaryCallSettings + testIamPermissionsSettings() { + return testIamPermissionsSettings; + } + + public EchoStub createStub() throws IOException { + if (getTransportChannelProvider() + .getTransportName() + .equals(GrpcTransportChannel.getGrpcTransportName())) { + return GrpcEchoStub.create(this); + } + if (getTransportChannelProvider() + .getTransportName() + .equals(HttpJsonTransportChannel.getHttpJsonTransportName())) { + return HttpJsonEchoStub.create(this); + } + throw new UnsupportedOperationException( + String.format( + "Transport not supported: %s", getTransportChannelProvider().getTransportName())); + } + + /** Returns a builder for the default ExecutorProvider for this service. */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return InstantiatingExecutorProvider.newBuilder(); + } + + /** Returns the default service endpoint. */ + @ObsoleteApi("Use getEndpoint() instead") + public static String getDefaultEndpoint() { + return "localhost:7469"; + } + + /** Returns the default mTLS service endpoint. */ + public static String getDefaultMtlsEndpoint() { + return "localhost:7469"; + } + + /** 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 gRPC ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return InstantiatingGrpcChannelProvider.newBuilder() + .setMaxInboundMessageSize(Integer.MAX_VALUE); + } + + /** Returns a builder for the default REST ChannelProvider for this service. */ + @BetaApi + public static InstantiatingHttpJsonChannelProvider.Builder + defaultHttpJsonTransportProviderBuilder() { + return InstantiatingHttpJsonChannelProvider.newBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return defaultGrpcTransportProviderBuilder().build(); + } + + public static ApiClientHeaderProvider.Builder defaultGrpcApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken("gapic", GaxProperties.getLibraryVersion(EchoStubSettings.class)) + .setTransportToken(GaxGrpcProperties.getGrpcTokenName(), GaxGrpcProperties.getGrpcVersion()) + .setApiVersionToken("v1_20240408"); + } + + public static ApiClientHeaderProvider.Builder defaultHttpJsonApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken("gapic", GaxProperties.getLibraryVersion(EchoStubSettings.class)) + .setTransportToken( + GaxHttpJsonProperties.getHttpJsonTokenName(), + GaxHttpJsonProperties.getHttpJsonVersion()) + .setApiVersionToken("v1_20240408"); + } + + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return EchoStubSettings.defaultGrpcApiClientHeaderProviderBuilder(); + } + + /** Returns a new gRPC builder for this class. */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** Returns a new REST builder for this class. */ + public static Builder newHttpJsonBuilder() { + return Builder.createHttpJsonDefault(); + } + + /** 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 EchoStubSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + + echoSettings = settingsBuilder.echoSettings().build(); + echoErrorDetailsSettings = settingsBuilder.echoErrorDetailsSettings().build(); + failEchoWithDetailsSettings = settingsBuilder.failEchoWithDetailsSettings().build(); + expandSettings = settingsBuilder.expandSettings().build(); + collectSettings = settingsBuilder.collectSettings().build(); + chatSettings = settingsBuilder.chatSettings().build(); + pagedExpandSettings = settingsBuilder.pagedExpandSettings().build(); + pagedExpandLegacySettings = settingsBuilder.pagedExpandLegacySettings().build(); + pagedExpandLegacyMappedSettings = settingsBuilder.pagedExpandLegacyMappedSettings().build(); + waitSettings = settingsBuilder.waitSettings().build(); + waitOperationSettings = settingsBuilder.waitOperationSettings().build(); + blockSettings = settingsBuilder.blockSettings().build(); + listLocationsSettings = settingsBuilder.listLocationsSettings().build(); + getLocationSettings = settingsBuilder.getLocationSettings().build(); + setIamPolicySettings = settingsBuilder.setIamPolicySettings().build(); + getIamPolicySettings = settingsBuilder.getIamPolicySettings().build(); + testIamPermissionsSettings = settingsBuilder.testIamPermissionsSettings().build(); + } + + /** Builder for EchoStubSettings. */ + public static class Builder extends StubSettings.Builder { + private final ImmutableList> unaryMethodSettingsBuilders; + private final UnaryCallSettings.Builder echoSettings; + private final UnaryCallSettings.Builder + echoErrorDetailsSettings; + private final UnaryCallSettings.Builder + failEchoWithDetailsSettings; + private final ServerStreamingCallSettings.Builder expandSettings; + private final StreamingCallSettings.Builder collectSettings; + private final StreamingCallSettings.Builder chatSettings; + private final PagedCallSettings.Builder< + PagedExpandRequest, PagedExpandResponse, PagedExpandPagedResponse> + pagedExpandSettings; + private final UnaryCallSettings.Builder + pagedExpandLegacySettings; + private final PagedCallSettings.Builder< + PagedExpandRequest, + PagedExpandLegacyMappedResponse, + PagedExpandLegacyMappedPagedResponse> + pagedExpandLegacyMappedSettings; + private final UnaryCallSettings.Builder waitSettings; + private final OperationCallSettings.Builder + waitOperationSettings; + private final UnaryCallSettings.Builder blockSettings; + private final PagedCallSettings.Builder< + ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse> + listLocationsSettings; + private final UnaryCallSettings.Builder getLocationSettings; + private final UnaryCallSettings.Builder setIamPolicySettings; + private final UnaryCallSettings.Builder getIamPolicySettings; + private final UnaryCallSettings.Builder + testIamPermissionsSettings; + 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.UNAVAILABLE, StatusCode.Code.UNKNOWN))); + 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(2.0) + .setMaxRetryDelayDuration(Duration.ofMillis(3000L)) + .setInitialRpcTimeoutDuration(Duration.ofMillis(10000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeoutDuration(Duration.ofMillis(10000L)) + .setTotalTimeoutDuration(Duration.ofMillis(10000L)) + .build(); + definitions.put("retry_policy_1_params", settings); + settings = + RetrySettings.newBuilder() + .setInitialRpcTimeoutDuration(Duration.ofMillis(5000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeoutDuration(Duration.ofMillis(5000L)) + .setTotalTimeoutDuration(Duration.ofMillis(5000L)) + .build(); + definitions.put("no_retry_0_params", settings); + RETRY_PARAM_DEFINITIONS = definitions.build(); + } + + protected Builder() { + this(((ClientContext) null)); + } + + protected Builder(ClientContext clientContext) { + super(clientContext); + + echoSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + echoErrorDetailsSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + failEchoWithDetailsSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + expandSettings = ServerStreamingCallSettings.newBuilder(); + collectSettings = StreamingCallSettings.newBuilder(); + chatSettings = StreamingCallSettings.newBuilder(); + pagedExpandSettings = PagedCallSettings.newBuilder(PAGED_EXPAND_PAGE_STR_FACT); + pagedExpandLegacySettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + pagedExpandLegacyMappedSettings = + PagedCallSettings.newBuilder(PAGED_EXPAND_LEGACY_MAPPED_PAGE_STR_FACT); + waitSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + waitOperationSettings = OperationCallSettings.newBuilder(); + blockSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + listLocationsSettings = PagedCallSettings.newBuilder(LIST_LOCATIONS_PAGE_STR_FACT); + getLocationSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + setIamPolicySettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + getIamPolicySettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + testIamPermissionsSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + echoSettings, + echoErrorDetailsSettings, + failEchoWithDetailsSettings, + pagedExpandSettings, + pagedExpandLegacySettings, + pagedExpandLegacyMappedSettings, + waitSettings, + blockSettings, + listLocationsSettings, + getLocationSettings, + setIamPolicySettings, + getIamPolicySettings, + testIamPermissionsSettings); + initDefaults(this); + } + + protected Builder(EchoStubSettings settings) { + super(settings); + + echoSettings = settings.echoSettings.toBuilder(); + echoErrorDetailsSettings = settings.echoErrorDetailsSettings.toBuilder(); + failEchoWithDetailsSettings = settings.failEchoWithDetailsSettings.toBuilder(); + expandSettings = settings.expandSettings.toBuilder(); + collectSettings = settings.collectSettings.toBuilder(); + chatSettings = settings.chatSettings.toBuilder(); + pagedExpandSettings = settings.pagedExpandSettings.toBuilder(); + pagedExpandLegacySettings = settings.pagedExpandLegacySettings.toBuilder(); + pagedExpandLegacyMappedSettings = settings.pagedExpandLegacyMappedSettings.toBuilder(); + waitSettings = settings.waitSettings.toBuilder(); + waitOperationSettings = settings.waitOperationSettings.toBuilder(); + blockSettings = settings.blockSettings.toBuilder(); + listLocationsSettings = settings.listLocationsSettings.toBuilder(); + getLocationSettings = settings.getLocationSettings.toBuilder(); + setIamPolicySettings = settings.setIamPolicySettings.toBuilder(); + getIamPolicySettings = settings.getIamPolicySettings.toBuilder(); + testIamPermissionsSettings = settings.testIamPermissionsSettings.toBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + echoSettings, + echoErrorDetailsSettings, + failEchoWithDetailsSettings, + pagedExpandSettings, + pagedExpandLegacySettings, + pagedExpandLegacyMappedSettings, + waitSettings, + blockSettings, + listLocationsSettings, + getLocationSettings, + setIamPolicySettings, + getIamPolicySettings, + testIamPermissionsSettings); + } + + 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 createHttpJsonDefault() { + Builder builder = new Builder(((ClientContext) null)); + + builder.setTransportChannelProvider(defaultHttpJsonTransportProviderBuilder().build()); + builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); + builder.setInternalHeaderProvider(defaultHttpJsonApiClientHeaderProviderBuilder().build()); + builder.setMtlsEndpoint(getDefaultMtlsEndpoint()); + builder.setSwitchToMtlsEndpointAllowed(true); + + return initDefaults(builder); + } + + private static Builder initDefaults(Builder builder) { + builder + .echoSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")); + + builder + .echoErrorDetailsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + + builder + .failEchoWithDetailsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + + builder + .expandSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")); + + builder + .pagedExpandSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")); + + builder + .pagedExpandLegacySettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + + builder + .pagedExpandLegacyMappedSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + + builder + .waitSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + + builder + .blockSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + + builder + .listLocationsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + + builder + .getLocationSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + + builder + .setIamPolicySettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + + builder + .getIamPolicySettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + + builder + .testIamPermissionsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + + builder + .waitOperationSettings() + .setInitialCallSettings( + UnaryCallSettings.newUnaryCallSettingsBuilder() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")) + .build()) + .setResponseTransformer( + ProtoOperationTransformers.ResponseTransformer.create(WaitResponse.class)) + .setMetadataTransformer( + ProtoOperationTransformers.MetadataTransformer.create(WaitMetadata.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 echo. */ + public UnaryCallSettings.Builder echoSettings() { + return echoSettings; + } + + /** Returns the builder for the settings used for calls to echoErrorDetails. */ + public UnaryCallSettings.Builder + echoErrorDetailsSettings() { + return echoErrorDetailsSettings; + } + + /** Returns the builder for the settings used for calls to failEchoWithDetails. */ + public UnaryCallSettings.Builder + failEchoWithDetailsSettings() { + return failEchoWithDetailsSettings; + } + + /** Returns the builder for the settings used for calls to expand. */ + public ServerStreamingCallSettings.Builder expandSettings() { + return expandSettings; + } + + /** Returns the builder for the settings used for calls to collect. */ + public StreamingCallSettings.Builder collectSettings() { + return collectSettings; + } + + /** Returns the builder for the settings used for calls to chat. */ + public StreamingCallSettings.Builder chatSettings() { + return chatSettings; + } + + /** Returns the builder for the settings used for calls to pagedExpand. */ + public PagedCallSettings.Builder< + PagedExpandRequest, PagedExpandResponse, PagedExpandPagedResponse> + pagedExpandSettings() { + return pagedExpandSettings; + } + + /** Returns the builder for the settings used for calls to pagedExpandLegacy. */ + public UnaryCallSettings.Builder + pagedExpandLegacySettings() { + return pagedExpandLegacySettings; + } + + /** Returns the builder for the settings used for calls to pagedExpandLegacyMapped. */ + public PagedCallSettings.Builder< + PagedExpandRequest, + PagedExpandLegacyMappedResponse, + PagedExpandLegacyMappedPagedResponse> + pagedExpandLegacyMappedSettings() { + return pagedExpandLegacyMappedSettings; + } + + /** Returns the builder for the settings used for calls to wait. */ + public UnaryCallSettings.Builder waitSettings() { + return waitSettings; + } + + /** Returns the builder for the settings used for calls to wait. */ + public OperationCallSettings.Builder + waitOperationSettings() { + return waitOperationSettings; + } + + /** Returns the builder for the settings used for calls to block. */ + public UnaryCallSettings.Builder blockSettings() { + return blockSettings; + } + + /** Returns the builder for the settings used for calls to listLocations. */ + public PagedCallSettings.Builder< + ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse> + listLocationsSettings() { + return listLocationsSettings; + } + + /** Returns the builder for the settings used for calls to getLocation. */ + public UnaryCallSettings.Builder getLocationSettings() { + return getLocationSettings; + } + + /** Returns the builder for the settings used for calls to setIamPolicy. */ + public UnaryCallSettings.Builder setIamPolicySettings() { + return setIamPolicySettings; + } + + /** Returns the builder for the settings used for calls to getIamPolicy. */ + public UnaryCallSettings.Builder getIamPolicySettings() { + return getIamPolicySettings; + } + + /** Returns the builder for the settings used for calls to testIamPermissions. */ + public UnaryCallSettings.Builder + testIamPermissionsSettings() { + return testIamPermissionsSettings; + } + + @Override + public EchoStubSettings build() throws IOException { + return new EchoStubSettings(this); + } + } +} diff --git a/java-showcase-3.21.0/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/GrpcComplianceCallableFactory.java b/java-showcase-3.21.0/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/GrpcComplianceCallableFactory.java new file mode 100644 index 0000000000..6d1dad969b --- /dev/null +++ b/java-showcase-3.21.0/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/GrpcComplianceCallableFactory.java @@ -0,0 +1,115 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.stub; + +import com.google.api.core.BetaApi; +import com.google.api.gax.grpc.GrpcCallSettings; +import com.google.api.gax.grpc.GrpcCallableFactory; +import com.google.api.gax.grpc.GrpcStubCallableFactory; +import com.google.api.gax.rpc.BatchingCallSettings; +import com.google.api.gax.rpc.BidiStreamingCallable; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientStreamingCallable; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.api.gax.rpc.StreamingCallSettings; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.longrunning.Operation; +import com.google.longrunning.stub.OperationsStub; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * gRPC callable factory implementation for the Compliance service API. + * + *

        This class is for advanced usage. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class GrpcComplianceCallableFactory 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-showcase-3.21.0/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/GrpcComplianceStub.java b/java-showcase-3.21.0/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/GrpcComplianceStub.java new file mode 100644 index 0000000000..1b4ff86061 --- /dev/null +++ b/java-showcase-3.21.0/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/GrpcComplianceStub.java @@ -0,0 +1,580 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.stub; + +import static com.google.showcase.v1beta1.ComplianceClient.ListLocationsPagedResponse; + +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.grpc.GrpcCallSettings; +import com.google.api.gax.grpc.GrpcStubCallableFactory; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.RequestParamsBuilder; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.longrunning.stub.GrpcOperationsStub; +import com.google.showcase.v1beta1.EnumRequest; +import com.google.showcase.v1beta1.EnumResponse; +import com.google.showcase.v1beta1.RepeatRequest; +import com.google.showcase.v1beta1.RepeatResponse; +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 Compliance service API. + * + *

        This class is for advanced usage and reflects the underlying API directly. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class GrpcComplianceStub extends ComplianceStub { + private static final MethodDescriptor + repeatDataBodyMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.showcase.v1beta1.Compliance/RepeatDataBody") + .setRequestMarshaller(ProtoUtils.marshaller(RepeatRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(RepeatResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor + repeatDataBodyInfoMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.showcase.v1beta1.Compliance/RepeatDataBodyInfo") + .setRequestMarshaller(ProtoUtils.marshaller(RepeatRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(RepeatResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor + repeatDataQueryMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.showcase.v1beta1.Compliance/RepeatDataQuery") + .setRequestMarshaller(ProtoUtils.marshaller(RepeatRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(RepeatResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor + repeatDataSimplePathMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.showcase.v1beta1.Compliance/RepeatDataSimplePath") + .setRequestMarshaller(ProtoUtils.marshaller(RepeatRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(RepeatResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor + repeatDataPathResourceMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.showcase.v1beta1.Compliance/RepeatDataPathResource") + .setRequestMarshaller(ProtoUtils.marshaller(RepeatRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(RepeatResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor + repeatDataPathTrailingResourceMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.showcase.v1beta1.Compliance/RepeatDataPathTrailingResource") + .setRequestMarshaller(ProtoUtils.marshaller(RepeatRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(RepeatResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor + repeatDataBodyPutMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.showcase.v1beta1.Compliance/RepeatDataBodyPut") + .setRequestMarshaller(ProtoUtils.marshaller(RepeatRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(RepeatResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor + repeatDataBodyPatchMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.showcase.v1beta1.Compliance/RepeatDataBodyPatch") + .setRequestMarshaller(ProtoUtils.marshaller(RepeatRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(RepeatResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor getEnumMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.showcase.v1beta1.Compliance/GetEnum") + .setRequestMarshaller(ProtoUtils.marshaller(EnumRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(EnumResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor verifyEnumMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.showcase.v1beta1.Compliance/VerifyEnum") + .setRequestMarshaller(ProtoUtils.marshaller(EnumResponse.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(EnumResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor + listLocationsMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.location.Locations/ListLocations") + .setRequestMarshaller( + ProtoUtils.marshaller(ListLocationsRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(ListLocationsResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor getLocationMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.location.Locations/GetLocation") + .setRequestMarshaller(ProtoUtils.marshaller(GetLocationRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Location.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor setIamPolicyMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.iam.v1.IAMPolicy/SetIamPolicy") + .setRequestMarshaller(ProtoUtils.marshaller(SetIamPolicyRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Policy.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor getIamPolicyMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.iam.v1.IAMPolicy/GetIamPolicy") + .setRequestMarshaller(ProtoUtils.marshaller(GetIamPolicyRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Policy.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor + testIamPermissionsMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.iam.v1.IAMPolicy/TestIamPermissions") + .setRequestMarshaller( + ProtoUtils.marshaller(TestIamPermissionsRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(TestIamPermissionsResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private final UnaryCallable repeatDataBodyCallable; + private final UnaryCallable repeatDataBodyInfoCallable; + private final UnaryCallable repeatDataQueryCallable; + private final UnaryCallable repeatDataSimplePathCallable; + private final UnaryCallable repeatDataPathResourceCallable; + private final UnaryCallable repeatDataPathTrailingResourceCallable; + private final UnaryCallable repeatDataBodyPutCallable; + private final UnaryCallable repeatDataBodyPatchCallable; + private final UnaryCallable getEnumCallable; + private final UnaryCallable verifyEnumCallable; + private final UnaryCallable listLocationsCallable; + private final UnaryCallable + listLocationsPagedCallable; + private final UnaryCallable getLocationCallable; + private final UnaryCallable setIamPolicyCallable; + private final UnaryCallable getIamPolicyCallable; + private final UnaryCallable + testIamPermissionsCallable; + + private final BackgroundResource backgroundResources; + private final GrpcOperationsStub operationsStub; + private final GrpcStubCallableFactory callableFactory; + + public static final GrpcComplianceStub create(ComplianceStubSettings settings) + throws IOException { + return new GrpcComplianceStub(settings, ClientContext.create(settings)); + } + + public static final GrpcComplianceStub create(ClientContext clientContext) throws IOException { + return new GrpcComplianceStub(ComplianceStubSettings.newBuilder().build(), clientContext); + } + + public static final GrpcComplianceStub create( + ClientContext clientContext, GrpcStubCallableFactory callableFactory) throws IOException { + return new GrpcComplianceStub( + ComplianceStubSettings.newBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of GrpcComplianceStub, 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 GrpcComplianceStub(ComplianceStubSettings settings, ClientContext clientContext) + throws IOException { + this(settings, clientContext, new GrpcComplianceCallableFactory()); + } + + /** + * Constructs an instance of GrpcComplianceStub, 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 GrpcComplianceStub( + ComplianceStubSettings settings, + ClientContext clientContext, + GrpcStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + this.operationsStub = GrpcOperationsStub.create(clientContext, callableFactory); + + GrpcCallSettings repeatDataBodyTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(repeatDataBodyMethodDescriptor) + .build(); + GrpcCallSettings repeatDataBodyInfoTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(repeatDataBodyInfoMethodDescriptor) + .build(); + GrpcCallSettings repeatDataQueryTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(repeatDataQueryMethodDescriptor) + .build(); + GrpcCallSettings repeatDataSimplePathTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(repeatDataSimplePathMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("info.f_bool", String.valueOf(request.getInfo().getFBool())); + builder.add("info.f_double", String.valueOf(request.getInfo().getFDouble())); + builder.add("info.f_int32", String.valueOf(request.getInfo().getFInt32())); + builder.add( + "info.f_kingdom", String.valueOf(request.getInfo().getFKingdomValue())); + builder.add("info.f_string", String.valueOf(request.getInfo().getFString())); + return builder.build(); + }) + .build(); + GrpcCallSettings repeatDataPathResourceTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(repeatDataPathResourceMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("info.f_bool", String.valueOf(request.getInfo().getFBool())); + builder.add( + "info.f_child.f_string", + String.valueOf(request.getInfo().getFChild().getFString())); + builder.add("info.f_string", String.valueOf(request.getInfo().getFString())); + return builder.build(); + }) + .build(); + GrpcCallSettings + repeatDataPathTrailingResourceTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(repeatDataPathTrailingResourceMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add( + "info.f_child.f_string", + String.valueOf(request.getInfo().getFChild().getFString())); + builder.add("info.f_string", String.valueOf(request.getInfo().getFString())); + return builder.build(); + }) + .build(); + GrpcCallSettings repeatDataBodyPutTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(repeatDataBodyPutMethodDescriptor) + .build(); + GrpcCallSettings repeatDataBodyPatchTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(repeatDataBodyPatchMethodDescriptor) + .build(); + GrpcCallSettings getEnumTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getEnumMethodDescriptor) + .build(); + GrpcCallSettings verifyEnumTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(verifyEnumMethodDescriptor) + .build(); + GrpcCallSettings listLocationsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(listLocationsMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + GrpcCallSettings getLocationTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getLocationMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + GrpcCallSettings setIamPolicyTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(setIamPolicyMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("resource", String.valueOf(request.getResource())); + return builder.build(); + }) + .build(); + GrpcCallSettings getIamPolicyTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getIamPolicyMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("resource", String.valueOf(request.getResource())); + return builder.build(); + }) + .build(); + GrpcCallSettings + testIamPermissionsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(testIamPermissionsMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("resource", String.valueOf(request.getResource())); + return builder.build(); + }) + .build(); + + this.repeatDataBodyCallable = + callableFactory.createUnaryCallable( + repeatDataBodyTransportSettings, settings.repeatDataBodySettings(), clientContext); + this.repeatDataBodyInfoCallable = + callableFactory.createUnaryCallable( + repeatDataBodyInfoTransportSettings, + settings.repeatDataBodyInfoSettings(), + clientContext); + this.repeatDataQueryCallable = + callableFactory.createUnaryCallable( + repeatDataQueryTransportSettings, settings.repeatDataQuerySettings(), clientContext); + this.repeatDataSimplePathCallable = + callableFactory.createUnaryCallable( + repeatDataSimplePathTransportSettings, + settings.repeatDataSimplePathSettings(), + clientContext); + this.repeatDataPathResourceCallable = + callableFactory.createUnaryCallable( + repeatDataPathResourceTransportSettings, + settings.repeatDataPathResourceSettings(), + clientContext); + this.repeatDataPathTrailingResourceCallable = + callableFactory.createUnaryCallable( + repeatDataPathTrailingResourceTransportSettings, + settings.repeatDataPathTrailingResourceSettings(), + clientContext); + this.repeatDataBodyPutCallable = + callableFactory.createUnaryCallable( + repeatDataBodyPutTransportSettings, + settings.repeatDataBodyPutSettings(), + clientContext); + this.repeatDataBodyPatchCallable = + callableFactory.createUnaryCallable( + repeatDataBodyPatchTransportSettings, + settings.repeatDataBodyPatchSettings(), + clientContext); + this.getEnumCallable = + callableFactory.createUnaryCallable( + getEnumTransportSettings, settings.getEnumSettings(), clientContext); + this.verifyEnumCallable = + callableFactory.createUnaryCallable( + verifyEnumTransportSettings, settings.verifyEnumSettings(), clientContext); + this.listLocationsCallable = + callableFactory.createUnaryCallable( + listLocationsTransportSettings, settings.listLocationsSettings(), clientContext); + this.listLocationsPagedCallable = + callableFactory.createPagedCallable( + listLocationsTransportSettings, settings.listLocationsSettings(), clientContext); + this.getLocationCallable = + callableFactory.createUnaryCallable( + getLocationTransportSettings, settings.getLocationSettings(), clientContext); + this.setIamPolicyCallable = + callableFactory.createUnaryCallable( + setIamPolicyTransportSettings, settings.setIamPolicySettings(), clientContext); + this.getIamPolicyCallable = + callableFactory.createUnaryCallable( + getIamPolicyTransportSettings, settings.getIamPolicySettings(), clientContext); + this.testIamPermissionsCallable = + callableFactory.createUnaryCallable( + testIamPermissionsTransportSettings, + settings.testIamPermissionsSettings(), + clientContext); + + this.backgroundResources = + new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + public GrpcOperationsStub getOperationsStub() { + return operationsStub; + } + + @Override + public UnaryCallable repeatDataBodyCallable() { + return repeatDataBodyCallable; + } + + @Override + public UnaryCallable repeatDataBodyInfoCallable() { + return repeatDataBodyInfoCallable; + } + + @Override + public UnaryCallable repeatDataQueryCallable() { + return repeatDataQueryCallable; + } + + @Override + public UnaryCallable repeatDataSimplePathCallable() { + return repeatDataSimplePathCallable; + } + + @Override + public UnaryCallable repeatDataPathResourceCallable() { + return repeatDataPathResourceCallable; + } + + @Override + public UnaryCallable repeatDataPathTrailingResourceCallable() { + return repeatDataPathTrailingResourceCallable; + } + + @Override + public UnaryCallable repeatDataBodyPutCallable() { + return repeatDataBodyPutCallable; + } + + @Override + public UnaryCallable repeatDataBodyPatchCallable() { + return repeatDataBodyPatchCallable; + } + + @Override + public UnaryCallable getEnumCallable() { + return getEnumCallable; + } + + @Override + public UnaryCallable verifyEnumCallable() { + return verifyEnumCallable; + } + + @Override + public UnaryCallable listLocationsCallable() { + return listLocationsCallable; + } + + @Override + public UnaryCallable + listLocationsPagedCallable() { + return listLocationsPagedCallable; + } + + @Override + public UnaryCallable getLocationCallable() { + return getLocationCallable; + } + + @Override + public UnaryCallable setIamPolicyCallable() { + return setIamPolicyCallable; + } + + @Override + public UnaryCallable getIamPolicyCallable() { + return getIamPolicyCallable; + } + + @Override + public UnaryCallable + testIamPermissionsCallable() { + return testIamPermissionsCallable; + } + + @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-showcase-3.21.0/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/GrpcEchoCallableFactory.java b/java-showcase-3.21.0/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/GrpcEchoCallableFactory.java new file mode 100644 index 0000000000..f22d1faaa4 --- /dev/null +++ b/java-showcase-3.21.0/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/GrpcEchoCallableFactory.java @@ -0,0 +1,115 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.stub; + +import com.google.api.core.BetaApi; +import com.google.api.gax.grpc.GrpcCallSettings; +import com.google.api.gax.grpc.GrpcCallableFactory; +import com.google.api.gax.grpc.GrpcStubCallableFactory; +import com.google.api.gax.rpc.BatchingCallSettings; +import com.google.api.gax.rpc.BidiStreamingCallable; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientStreamingCallable; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.api.gax.rpc.StreamingCallSettings; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.longrunning.Operation; +import com.google.longrunning.stub.OperationsStub; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * gRPC callable factory implementation for the Echo service API. + * + *

        This class is for advanced usage. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class GrpcEchoCallableFactory 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-showcase-3.21.0/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/GrpcEchoStub.java b/java-showcase-3.21.0/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/GrpcEchoStub.java new file mode 100644 index 0000000000..4a2d9820af --- /dev/null +++ b/java-showcase-3.21.0/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/GrpcEchoStub.java @@ -0,0 +1,668 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.stub; + +import static com.google.showcase.v1beta1.EchoClient.ListLocationsPagedResponse; +import static com.google.showcase.v1beta1.EchoClient.PagedExpandLegacyMappedPagedResponse; +import static com.google.showcase.v1beta1.EchoClient.PagedExpandPagedResponse; + +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.grpc.GrpcCallSettings; +import com.google.api.gax.grpc.GrpcStubCallableFactory; +import com.google.api.gax.rpc.BidiStreamingCallable; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientStreamingCallable; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.RequestParamsBuilder; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.api.pathtemplate.PathTemplate; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.common.base.Strings; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.longrunning.Operation; +import com.google.longrunning.stub.GrpcOperationsStub; +import com.google.showcase.v1beta1.BlockRequest; +import com.google.showcase.v1beta1.BlockResponse; +import com.google.showcase.v1beta1.EchoErrorDetailsRequest; +import com.google.showcase.v1beta1.EchoErrorDetailsResponse; +import com.google.showcase.v1beta1.EchoRequest; +import com.google.showcase.v1beta1.EchoResponse; +import com.google.showcase.v1beta1.ExpandRequest; +import com.google.showcase.v1beta1.FailEchoWithDetailsRequest; +import com.google.showcase.v1beta1.FailEchoWithDetailsResponse; +import com.google.showcase.v1beta1.PagedExpandLegacyMappedResponse; +import com.google.showcase.v1beta1.PagedExpandLegacyRequest; +import com.google.showcase.v1beta1.PagedExpandRequest; +import com.google.showcase.v1beta1.PagedExpandResponse; +import com.google.showcase.v1beta1.WaitMetadata; +import com.google.showcase.v1beta1.WaitRequest; +import com.google.showcase.v1beta1.WaitResponse; +import io.grpc.MethodDescriptor; +import io.grpc.protobuf.ProtoUtils; +import java.io.IOException; +import java.util.UUID; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * gRPC stub implementation for the Echo service API. + * + *

        This class is for advanced usage and reflects the underlying API directly. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class GrpcEchoStub extends EchoStub { + private static final MethodDescriptor echoMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.showcase.v1beta1.Echo/Echo") + .setRequestMarshaller(ProtoUtils.marshaller(EchoRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(EchoResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor + echoErrorDetailsMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.showcase.v1beta1.Echo/EchoErrorDetails") + .setRequestMarshaller( + ProtoUtils.marshaller(EchoErrorDetailsRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(EchoErrorDetailsResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor + failEchoWithDetailsMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.showcase.v1beta1.Echo/FailEchoWithDetails") + .setRequestMarshaller( + ProtoUtils.marshaller(FailEchoWithDetailsRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(FailEchoWithDetailsResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor expandMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.SERVER_STREAMING) + .setFullMethodName("google.showcase.v1beta1.Echo/Expand") + .setRequestMarshaller(ProtoUtils.marshaller(ExpandRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(EchoResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor collectMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.CLIENT_STREAMING) + .setFullMethodName("google.showcase.v1beta1.Echo/Collect") + .setRequestMarshaller(ProtoUtils.marshaller(EchoRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(EchoResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor chatMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.BIDI_STREAMING) + .setFullMethodName("google.showcase.v1beta1.Echo/Chat") + .setRequestMarshaller(ProtoUtils.marshaller(EchoRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(EchoResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor + pagedExpandMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.showcase.v1beta1.Echo/PagedExpand") + .setRequestMarshaller(ProtoUtils.marshaller(PagedExpandRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(PagedExpandResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor + pagedExpandLegacyMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.showcase.v1beta1.Echo/PagedExpandLegacy") + .setRequestMarshaller( + ProtoUtils.marshaller(PagedExpandLegacyRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(PagedExpandResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor + pagedExpandLegacyMappedMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.showcase.v1beta1.Echo/PagedExpandLegacyMapped") + .setRequestMarshaller(ProtoUtils.marshaller(PagedExpandRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(PagedExpandLegacyMappedResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor waitMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.showcase.v1beta1.Echo/Wait") + .setRequestMarshaller(ProtoUtils.marshaller(WaitRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor blockMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.showcase.v1beta1.Echo/Block") + .setRequestMarshaller(ProtoUtils.marshaller(BlockRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(BlockResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor + listLocationsMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.location.Locations/ListLocations") + .setRequestMarshaller( + ProtoUtils.marshaller(ListLocationsRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(ListLocationsResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor getLocationMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.location.Locations/GetLocation") + .setRequestMarshaller(ProtoUtils.marshaller(GetLocationRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Location.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor setIamPolicyMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.iam.v1.IAMPolicy/SetIamPolicy") + .setRequestMarshaller(ProtoUtils.marshaller(SetIamPolicyRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Policy.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor getIamPolicyMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.iam.v1.IAMPolicy/GetIamPolicy") + .setRequestMarshaller(ProtoUtils.marshaller(GetIamPolicyRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Policy.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor + testIamPermissionsMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.iam.v1.IAMPolicy/TestIamPermissions") + .setRequestMarshaller( + ProtoUtils.marshaller(TestIamPermissionsRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(TestIamPermissionsResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private final UnaryCallable echoCallable; + private final UnaryCallable + echoErrorDetailsCallable; + private final UnaryCallable + failEchoWithDetailsCallable; + private final ServerStreamingCallable expandCallable; + private final ClientStreamingCallable collectCallable; + private final BidiStreamingCallable chatCallable; + private final UnaryCallable pagedExpandCallable; + private final UnaryCallable + pagedExpandPagedCallable; + private final UnaryCallable + pagedExpandLegacyCallable; + private final UnaryCallable + pagedExpandLegacyMappedCallable; + private final UnaryCallable + pagedExpandLegacyMappedPagedCallable; + private final UnaryCallable waitCallable; + private final OperationCallable waitOperationCallable; + private final UnaryCallable blockCallable; + private final UnaryCallable listLocationsCallable; + private final UnaryCallable + listLocationsPagedCallable; + private final UnaryCallable getLocationCallable; + private final UnaryCallable setIamPolicyCallable; + private final UnaryCallable getIamPolicyCallable; + private final UnaryCallable + testIamPermissionsCallable; + + private final BackgroundResource backgroundResources; + private final GrpcOperationsStub operationsStub; + private final GrpcStubCallableFactory callableFactory; + + private static final PathTemplate ECHO_0_PATH_TEMPLATE = PathTemplate.create("{header=**}"); + private static final PathTemplate ECHO_1_PATH_TEMPLATE = PathTemplate.create("{routing_id=**}"); + private static final PathTemplate ECHO_2_PATH_TEMPLATE = + PathTemplate.create("{table_name=regions/*/zones/*/**}"); + private static final PathTemplate ECHO_3_PATH_TEMPLATE = + PathTemplate.create("{super_id=projects/*}/**"); + private static final PathTemplate ECHO_4_PATH_TEMPLATE = + PathTemplate.create("{table_name=projects/*/instances/*/**}"); + private static final PathTemplate ECHO_5_PATH_TEMPLATE = + PathTemplate.create("projects/*/{instance_id=instances/*}/**"); + private static final PathTemplate ECHO_6_PATH_TEMPLATE = PathTemplate.create("{baz=**}"); + private static final PathTemplate ECHO_7_PATH_TEMPLATE = + PathTemplate.create("{qux=projects/*}/**"); + + public static final GrpcEchoStub create(EchoStubSettings settings) throws IOException { + return new GrpcEchoStub(settings, ClientContext.create(settings)); + } + + public static final GrpcEchoStub create(ClientContext clientContext) throws IOException { + return new GrpcEchoStub(EchoStubSettings.newBuilder().build(), clientContext); + } + + public static final GrpcEchoStub create( + ClientContext clientContext, GrpcStubCallableFactory callableFactory) throws IOException { + return new GrpcEchoStub(EchoStubSettings.newBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of GrpcEchoStub, 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 GrpcEchoStub(EchoStubSettings settings, ClientContext clientContext) + throws IOException { + this(settings, clientContext, new GrpcEchoCallableFactory()); + } + + /** + * Constructs an instance of GrpcEchoStub, 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 GrpcEchoStub( + EchoStubSettings settings, + ClientContext clientContext, + GrpcStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + this.operationsStub = GrpcOperationsStub.create(clientContext, callableFactory); + + GrpcCallSettings echoTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(echoMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add(request.getHeader(), "header", ECHO_0_PATH_TEMPLATE); + builder.add(request.getHeader(), "routing_id", ECHO_1_PATH_TEMPLATE); + builder.add(request.getHeader(), "table_name", ECHO_2_PATH_TEMPLATE); + builder.add(request.getHeader(), "super_id", ECHO_3_PATH_TEMPLATE); + builder.add(request.getHeader(), "table_name", ECHO_4_PATH_TEMPLATE); + builder.add(request.getHeader(), "instance_id", ECHO_5_PATH_TEMPLATE); + builder.add(request.getOtherHeader(), "baz", ECHO_6_PATH_TEMPLATE); + builder.add(request.getOtherHeader(), "qux", ECHO_7_PATH_TEMPLATE); + return builder.build(); + }) + .setRequestMutator( + request -> { + EchoRequest.Builder requestBuilder = request.toBuilder(); + if (Strings.isNullOrEmpty(request.getRequestId())) { + requestBuilder.setRequestId(UUID.randomUUID().toString()); + } + if (Strings.isNullOrEmpty(request.getOtherRequestId())) { + requestBuilder.setOtherRequestId(UUID.randomUUID().toString()); + } + return requestBuilder.build(); + }) + .build(); + GrpcCallSettings + echoErrorDetailsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(echoErrorDetailsMethodDescriptor) + .build(); + GrpcCallSettings + failEchoWithDetailsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(failEchoWithDetailsMethodDescriptor) + .build(); + GrpcCallSettings expandTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(expandMethodDescriptor) + .build(); + GrpcCallSettings collectTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(collectMethodDescriptor) + .build(); + GrpcCallSettings chatTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(chatMethodDescriptor) + .build(); + GrpcCallSettings pagedExpandTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(pagedExpandMethodDescriptor) + .build(); + GrpcCallSettings + pagedExpandLegacyTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(pagedExpandLegacyMethodDescriptor) + .build(); + GrpcCallSettings + pagedExpandLegacyMappedTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(pagedExpandLegacyMappedMethodDescriptor) + .build(); + GrpcCallSettings waitTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(waitMethodDescriptor) + .build(); + GrpcCallSettings blockTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(blockMethodDescriptor) + .build(); + GrpcCallSettings listLocationsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(listLocationsMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + GrpcCallSettings getLocationTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getLocationMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + GrpcCallSettings setIamPolicyTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(setIamPolicyMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("resource", String.valueOf(request.getResource())); + return builder.build(); + }) + .build(); + GrpcCallSettings getIamPolicyTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getIamPolicyMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("resource", String.valueOf(request.getResource())); + return builder.build(); + }) + .build(); + GrpcCallSettings + testIamPermissionsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(testIamPermissionsMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("resource", String.valueOf(request.getResource())); + return builder.build(); + }) + .build(); + + this.echoCallable = + callableFactory.createUnaryCallable( + echoTransportSettings, settings.echoSettings(), clientContext); + this.echoErrorDetailsCallable = + callableFactory.createUnaryCallable( + echoErrorDetailsTransportSettings, settings.echoErrorDetailsSettings(), clientContext); + this.failEchoWithDetailsCallable = + callableFactory.createUnaryCallable( + failEchoWithDetailsTransportSettings, + settings.failEchoWithDetailsSettings(), + clientContext); + this.expandCallable = + callableFactory.createServerStreamingCallable( + expandTransportSettings, settings.expandSettings(), clientContext); + this.collectCallable = + callableFactory.createClientStreamingCallable( + collectTransportSettings, settings.collectSettings(), clientContext); + this.chatCallable = + callableFactory.createBidiStreamingCallable( + chatTransportSettings, settings.chatSettings(), clientContext); + this.pagedExpandCallable = + callableFactory.createUnaryCallable( + pagedExpandTransportSettings, settings.pagedExpandSettings(), clientContext); + this.pagedExpandPagedCallable = + callableFactory.createPagedCallable( + pagedExpandTransportSettings, settings.pagedExpandSettings(), clientContext); + this.pagedExpandLegacyCallable = + callableFactory.createUnaryCallable( + pagedExpandLegacyTransportSettings, + settings.pagedExpandLegacySettings(), + clientContext); + this.pagedExpandLegacyMappedCallable = + callableFactory.createUnaryCallable( + pagedExpandLegacyMappedTransportSettings, + settings.pagedExpandLegacyMappedSettings(), + clientContext); + this.pagedExpandLegacyMappedPagedCallable = + callableFactory.createPagedCallable( + pagedExpandLegacyMappedTransportSettings, + settings.pagedExpandLegacyMappedSettings(), + clientContext); + this.waitCallable = + callableFactory.createUnaryCallable( + waitTransportSettings, settings.waitSettings(), clientContext); + this.waitOperationCallable = + callableFactory.createOperationCallable( + waitTransportSettings, settings.waitOperationSettings(), clientContext, operationsStub); + this.blockCallable = + callableFactory.createUnaryCallable( + blockTransportSettings, settings.blockSettings(), clientContext); + this.listLocationsCallable = + callableFactory.createUnaryCallable( + listLocationsTransportSettings, settings.listLocationsSettings(), clientContext); + this.listLocationsPagedCallable = + callableFactory.createPagedCallable( + listLocationsTransportSettings, settings.listLocationsSettings(), clientContext); + this.getLocationCallable = + callableFactory.createUnaryCallable( + getLocationTransportSettings, settings.getLocationSettings(), clientContext); + this.setIamPolicyCallable = + callableFactory.createUnaryCallable( + setIamPolicyTransportSettings, settings.setIamPolicySettings(), clientContext); + this.getIamPolicyCallable = + callableFactory.createUnaryCallable( + getIamPolicyTransportSettings, settings.getIamPolicySettings(), clientContext); + this.testIamPermissionsCallable = + callableFactory.createUnaryCallable( + testIamPermissionsTransportSettings, + settings.testIamPermissionsSettings(), + clientContext); + + this.backgroundResources = + new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + public GrpcOperationsStub getOperationsStub() { + return operationsStub; + } + + @Override + public UnaryCallable echoCallable() { + return echoCallable; + } + + @Override + public UnaryCallable + echoErrorDetailsCallable() { + return echoErrorDetailsCallable; + } + + @Override + public UnaryCallable + failEchoWithDetailsCallable() { + return failEchoWithDetailsCallable; + } + + @Override + public ServerStreamingCallable expandCallable() { + return expandCallable; + } + + @Override + public ClientStreamingCallable collectCallable() { + return collectCallable; + } + + @Override + public BidiStreamingCallable chatCallable() { + return chatCallable; + } + + @Override + public UnaryCallable pagedExpandCallable() { + return pagedExpandCallable; + } + + @Override + public UnaryCallable pagedExpandPagedCallable() { + return pagedExpandPagedCallable; + } + + @Override + public UnaryCallable pagedExpandLegacyCallable() { + return pagedExpandLegacyCallable; + } + + @Override + public UnaryCallable + pagedExpandLegacyMappedCallable() { + return pagedExpandLegacyMappedCallable; + } + + @Override + public UnaryCallable + pagedExpandLegacyMappedPagedCallable() { + return pagedExpandLegacyMappedPagedCallable; + } + + @Override + public UnaryCallable waitCallable() { + return waitCallable; + } + + @Override + public OperationCallable waitOperationCallable() { + return waitOperationCallable; + } + + @Override + public UnaryCallable blockCallable() { + return blockCallable; + } + + @Override + public UnaryCallable listLocationsCallable() { + return listLocationsCallable; + } + + @Override + public UnaryCallable + listLocationsPagedCallable() { + return listLocationsPagedCallable; + } + + @Override + public UnaryCallable getLocationCallable() { + return getLocationCallable; + } + + @Override + public UnaryCallable setIamPolicyCallable() { + return setIamPolicyCallable; + } + + @Override + public UnaryCallable getIamPolicyCallable() { + return getIamPolicyCallable; + } + + @Override + public UnaryCallable + testIamPermissionsCallable() { + return testIamPermissionsCallable; + } + + @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-showcase-3.21.0/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/GrpcIdentityCallableFactory.java b/java-showcase-3.21.0/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/GrpcIdentityCallableFactory.java new file mode 100644 index 0000000000..0b24326bf3 --- /dev/null +++ b/java-showcase-3.21.0/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/GrpcIdentityCallableFactory.java @@ -0,0 +1,115 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.stub; + +import com.google.api.core.BetaApi; +import com.google.api.gax.grpc.GrpcCallSettings; +import com.google.api.gax.grpc.GrpcCallableFactory; +import com.google.api.gax.grpc.GrpcStubCallableFactory; +import com.google.api.gax.rpc.BatchingCallSettings; +import com.google.api.gax.rpc.BidiStreamingCallable; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientStreamingCallable; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.api.gax.rpc.StreamingCallSettings; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.longrunning.Operation; +import com.google.longrunning.stub.OperationsStub; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * gRPC callable factory implementation for the Identity service API. + * + *

        This class is for advanced usage. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class GrpcIdentityCallableFactory 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-showcase-3.21.0/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/GrpcIdentityStub.java b/java-showcase-3.21.0/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/GrpcIdentityStub.java new file mode 100644 index 0000000000..5260967a52 --- /dev/null +++ b/java-showcase-3.21.0/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/GrpcIdentityStub.java @@ -0,0 +1,448 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.stub; + +import static com.google.showcase.v1beta1.IdentityClient.ListLocationsPagedResponse; +import static com.google.showcase.v1beta1.IdentityClient.ListUsersPagedResponse; + +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.grpc.GrpcCallSettings; +import com.google.api.gax.grpc.GrpcStubCallableFactory; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.RequestParamsBuilder; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.longrunning.stub.GrpcOperationsStub; +import com.google.protobuf.Empty; +import com.google.showcase.v1beta1.CreateUserRequest; +import com.google.showcase.v1beta1.DeleteUserRequest; +import com.google.showcase.v1beta1.GetUserRequest; +import com.google.showcase.v1beta1.ListUsersRequest; +import com.google.showcase.v1beta1.ListUsersResponse; +import com.google.showcase.v1beta1.UpdateUserRequest; +import com.google.showcase.v1beta1.User; +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 Identity service API. + * + *

        This class is for advanced usage and reflects the underlying API directly. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class GrpcIdentityStub extends IdentityStub { + private static final MethodDescriptor createUserMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.showcase.v1beta1.Identity/CreateUser") + .setRequestMarshaller(ProtoUtils.marshaller(CreateUserRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(User.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor getUserMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.showcase.v1beta1.Identity/GetUser") + .setRequestMarshaller(ProtoUtils.marshaller(GetUserRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(User.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor updateUserMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.showcase.v1beta1.Identity/UpdateUser") + .setRequestMarshaller(ProtoUtils.marshaller(UpdateUserRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(User.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor deleteUserMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.showcase.v1beta1.Identity/DeleteUser") + .setRequestMarshaller(ProtoUtils.marshaller(DeleteUserRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Empty.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor + listUsersMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.showcase.v1beta1.Identity/ListUsers") + .setRequestMarshaller(ProtoUtils.marshaller(ListUsersRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(ListUsersResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor + listLocationsMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.location.Locations/ListLocations") + .setRequestMarshaller( + ProtoUtils.marshaller(ListLocationsRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(ListLocationsResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor getLocationMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.location.Locations/GetLocation") + .setRequestMarshaller(ProtoUtils.marshaller(GetLocationRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Location.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor setIamPolicyMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.iam.v1.IAMPolicy/SetIamPolicy") + .setRequestMarshaller(ProtoUtils.marshaller(SetIamPolicyRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Policy.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor getIamPolicyMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.iam.v1.IAMPolicy/GetIamPolicy") + .setRequestMarshaller(ProtoUtils.marshaller(GetIamPolicyRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Policy.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor + testIamPermissionsMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.iam.v1.IAMPolicy/TestIamPermissions") + .setRequestMarshaller( + ProtoUtils.marshaller(TestIamPermissionsRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(TestIamPermissionsResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private final UnaryCallable createUserCallable; + private final UnaryCallable getUserCallable; + private final UnaryCallable updateUserCallable; + private final UnaryCallable deleteUserCallable; + private final UnaryCallable listUsersCallable; + private final UnaryCallable listUsersPagedCallable; + private final UnaryCallable listLocationsCallable; + private final UnaryCallable + listLocationsPagedCallable; + private final UnaryCallable getLocationCallable; + private final UnaryCallable setIamPolicyCallable; + private final UnaryCallable getIamPolicyCallable; + private final UnaryCallable + testIamPermissionsCallable; + + private final BackgroundResource backgroundResources; + private final GrpcOperationsStub operationsStub; + private final GrpcStubCallableFactory callableFactory; + + public static final GrpcIdentityStub create(IdentityStubSettings settings) throws IOException { + return new GrpcIdentityStub(settings, ClientContext.create(settings)); + } + + public static final GrpcIdentityStub create(ClientContext clientContext) throws IOException { + return new GrpcIdentityStub(IdentityStubSettings.newBuilder().build(), clientContext); + } + + public static final GrpcIdentityStub create( + ClientContext clientContext, GrpcStubCallableFactory callableFactory) throws IOException { + return new GrpcIdentityStub( + IdentityStubSettings.newBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of GrpcIdentityStub, 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 GrpcIdentityStub(IdentityStubSettings settings, ClientContext clientContext) + throws IOException { + this(settings, clientContext, new GrpcIdentityCallableFactory()); + } + + /** + * Constructs an instance of GrpcIdentityStub, 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 GrpcIdentityStub( + IdentityStubSettings settings, + ClientContext clientContext, + GrpcStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + this.operationsStub = GrpcOperationsStub.create(clientContext, callableFactory); + + GrpcCallSettings createUserTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(createUserMethodDescriptor) + .build(); + GrpcCallSettings getUserTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getUserMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + GrpcCallSettings updateUserTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(updateUserMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("user.name", String.valueOf(request.getUser().getName())); + return builder.build(); + }) + .build(); + GrpcCallSettings deleteUserTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(deleteUserMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + GrpcCallSettings listUsersTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(listUsersMethodDescriptor) + .build(); + GrpcCallSettings listLocationsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(listLocationsMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + GrpcCallSettings getLocationTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getLocationMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + GrpcCallSettings setIamPolicyTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(setIamPolicyMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("resource", String.valueOf(request.getResource())); + return builder.build(); + }) + .build(); + GrpcCallSettings getIamPolicyTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getIamPolicyMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("resource", String.valueOf(request.getResource())); + return builder.build(); + }) + .build(); + GrpcCallSettings + testIamPermissionsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(testIamPermissionsMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("resource", String.valueOf(request.getResource())); + return builder.build(); + }) + .build(); + + this.createUserCallable = + callableFactory.createUnaryCallable( + createUserTransportSettings, settings.createUserSettings(), clientContext); + this.getUserCallable = + callableFactory.createUnaryCallable( + getUserTransportSettings, settings.getUserSettings(), clientContext); + this.updateUserCallable = + callableFactory.createUnaryCallable( + updateUserTransportSettings, settings.updateUserSettings(), clientContext); + this.deleteUserCallable = + callableFactory.createUnaryCallable( + deleteUserTransportSettings, settings.deleteUserSettings(), clientContext); + this.listUsersCallable = + callableFactory.createUnaryCallable( + listUsersTransportSettings, settings.listUsersSettings(), clientContext); + this.listUsersPagedCallable = + callableFactory.createPagedCallable( + listUsersTransportSettings, settings.listUsersSettings(), clientContext); + this.listLocationsCallable = + callableFactory.createUnaryCallable( + listLocationsTransportSettings, settings.listLocationsSettings(), clientContext); + this.listLocationsPagedCallable = + callableFactory.createPagedCallable( + listLocationsTransportSettings, settings.listLocationsSettings(), clientContext); + this.getLocationCallable = + callableFactory.createUnaryCallable( + getLocationTransportSettings, settings.getLocationSettings(), clientContext); + this.setIamPolicyCallable = + callableFactory.createUnaryCallable( + setIamPolicyTransportSettings, settings.setIamPolicySettings(), clientContext); + this.getIamPolicyCallable = + callableFactory.createUnaryCallable( + getIamPolicyTransportSettings, settings.getIamPolicySettings(), clientContext); + this.testIamPermissionsCallable = + callableFactory.createUnaryCallable( + testIamPermissionsTransportSettings, + settings.testIamPermissionsSettings(), + clientContext); + + this.backgroundResources = + new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + public GrpcOperationsStub getOperationsStub() { + return operationsStub; + } + + @Override + public UnaryCallable createUserCallable() { + return createUserCallable; + } + + @Override + public UnaryCallable getUserCallable() { + return getUserCallable; + } + + @Override + public UnaryCallable updateUserCallable() { + return updateUserCallable; + } + + @Override + public UnaryCallable deleteUserCallable() { + return deleteUserCallable; + } + + @Override + public UnaryCallable listUsersCallable() { + return listUsersCallable; + } + + @Override + public UnaryCallable listUsersPagedCallable() { + return listUsersPagedCallable; + } + + @Override + public UnaryCallable listLocationsCallable() { + return listLocationsCallable; + } + + @Override + public UnaryCallable + listLocationsPagedCallable() { + return listLocationsPagedCallable; + } + + @Override + public UnaryCallable getLocationCallable() { + return getLocationCallable; + } + + @Override + public UnaryCallable setIamPolicyCallable() { + return setIamPolicyCallable; + } + + @Override + public UnaryCallable getIamPolicyCallable() { + return getIamPolicyCallable; + } + + @Override + public UnaryCallable + testIamPermissionsCallable() { + return testIamPermissionsCallable; + } + + @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-showcase-3.21.0/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/GrpcMessagingCallableFactory.java b/java-showcase-3.21.0/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/GrpcMessagingCallableFactory.java new file mode 100644 index 0000000000..b1410c4288 --- /dev/null +++ b/java-showcase-3.21.0/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/GrpcMessagingCallableFactory.java @@ -0,0 +1,115 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.stub; + +import com.google.api.core.BetaApi; +import com.google.api.gax.grpc.GrpcCallSettings; +import com.google.api.gax.grpc.GrpcCallableFactory; +import com.google.api.gax.grpc.GrpcStubCallableFactory; +import com.google.api.gax.rpc.BatchingCallSettings; +import com.google.api.gax.rpc.BidiStreamingCallable; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientStreamingCallable; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.api.gax.rpc.StreamingCallSettings; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.longrunning.Operation; +import com.google.longrunning.stub.OperationsStub; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * gRPC callable factory implementation for the Messaging service API. + * + *

        This class is for advanced usage. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class GrpcMessagingCallableFactory 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-showcase-3.21.0/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/GrpcMessagingStub.java b/java-showcase-3.21.0/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/GrpcMessagingStub.java new file mode 100644 index 0000000000..2eb932b344 --- /dev/null +++ b/java-showcase-3.21.0/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/GrpcMessagingStub.java @@ -0,0 +1,747 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.stub; + +import static com.google.showcase.v1beta1.MessagingClient.ListBlurbsPagedResponse; +import static com.google.showcase.v1beta1.MessagingClient.ListLocationsPagedResponse; +import static com.google.showcase.v1beta1.MessagingClient.ListRoomsPagedResponse; + +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.grpc.GrpcCallSettings; +import com.google.api.gax.grpc.GrpcStubCallableFactory; +import com.google.api.gax.rpc.BidiStreamingCallable; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientStreamingCallable; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.RequestParamsBuilder; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.longrunning.Operation; +import com.google.longrunning.stub.GrpcOperationsStub; +import com.google.protobuf.Empty; +import com.google.showcase.v1beta1.Blurb; +import com.google.showcase.v1beta1.ConnectRequest; +import com.google.showcase.v1beta1.CreateBlurbRequest; +import com.google.showcase.v1beta1.CreateRoomRequest; +import com.google.showcase.v1beta1.DeleteBlurbRequest; +import com.google.showcase.v1beta1.DeleteRoomRequest; +import com.google.showcase.v1beta1.GetBlurbRequest; +import com.google.showcase.v1beta1.GetRoomRequest; +import com.google.showcase.v1beta1.ListBlurbsRequest; +import com.google.showcase.v1beta1.ListBlurbsResponse; +import com.google.showcase.v1beta1.ListRoomsRequest; +import com.google.showcase.v1beta1.ListRoomsResponse; +import com.google.showcase.v1beta1.Room; +import com.google.showcase.v1beta1.SearchBlurbsMetadata; +import com.google.showcase.v1beta1.SearchBlurbsRequest; +import com.google.showcase.v1beta1.SearchBlurbsResponse; +import com.google.showcase.v1beta1.SendBlurbsResponse; +import com.google.showcase.v1beta1.StreamBlurbsRequest; +import com.google.showcase.v1beta1.StreamBlurbsResponse; +import com.google.showcase.v1beta1.UpdateBlurbRequest; +import com.google.showcase.v1beta1.UpdateRoomRequest; +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 Messaging service API. + * + *

        This class is for advanced usage and reflects the underlying API directly. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class GrpcMessagingStub extends MessagingStub { + private static final MethodDescriptor createRoomMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.showcase.v1beta1.Messaging/CreateRoom") + .setRequestMarshaller(ProtoUtils.marshaller(CreateRoomRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Room.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor getRoomMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.showcase.v1beta1.Messaging/GetRoom") + .setRequestMarshaller(ProtoUtils.marshaller(GetRoomRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Room.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor updateRoomMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.showcase.v1beta1.Messaging/UpdateRoom") + .setRequestMarshaller(ProtoUtils.marshaller(UpdateRoomRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Room.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor deleteRoomMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.showcase.v1beta1.Messaging/DeleteRoom") + .setRequestMarshaller(ProtoUtils.marshaller(DeleteRoomRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Empty.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor + listRoomsMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.showcase.v1beta1.Messaging/ListRooms") + .setRequestMarshaller(ProtoUtils.marshaller(ListRoomsRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(ListRoomsResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor createBlurbMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.showcase.v1beta1.Messaging/CreateBlurb") + .setRequestMarshaller(ProtoUtils.marshaller(CreateBlurbRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Blurb.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor getBlurbMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.showcase.v1beta1.Messaging/GetBlurb") + .setRequestMarshaller(ProtoUtils.marshaller(GetBlurbRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Blurb.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor updateBlurbMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.showcase.v1beta1.Messaging/UpdateBlurb") + .setRequestMarshaller(ProtoUtils.marshaller(UpdateBlurbRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Blurb.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor deleteBlurbMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.showcase.v1beta1.Messaging/DeleteBlurb") + .setRequestMarshaller(ProtoUtils.marshaller(DeleteBlurbRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Empty.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor + listBlurbsMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.showcase.v1beta1.Messaging/ListBlurbs") + .setRequestMarshaller(ProtoUtils.marshaller(ListBlurbsRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(ListBlurbsResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor + searchBlurbsMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.showcase.v1beta1.Messaging/SearchBlurbs") + .setRequestMarshaller(ProtoUtils.marshaller(SearchBlurbsRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor + streamBlurbsMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.SERVER_STREAMING) + .setFullMethodName("google.showcase.v1beta1.Messaging/StreamBlurbs") + .setRequestMarshaller(ProtoUtils.marshaller(StreamBlurbsRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(StreamBlurbsResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor + sendBlurbsMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.CLIENT_STREAMING) + .setFullMethodName("google.showcase.v1beta1.Messaging/SendBlurbs") + .setRequestMarshaller(ProtoUtils.marshaller(CreateBlurbRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(SendBlurbsResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor + connectMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.BIDI_STREAMING) + .setFullMethodName("google.showcase.v1beta1.Messaging/Connect") + .setRequestMarshaller(ProtoUtils.marshaller(ConnectRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(StreamBlurbsResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor + listLocationsMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.location.Locations/ListLocations") + .setRequestMarshaller( + ProtoUtils.marshaller(ListLocationsRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(ListLocationsResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor getLocationMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.location.Locations/GetLocation") + .setRequestMarshaller(ProtoUtils.marshaller(GetLocationRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Location.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor setIamPolicyMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.iam.v1.IAMPolicy/SetIamPolicy") + .setRequestMarshaller(ProtoUtils.marshaller(SetIamPolicyRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Policy.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor getIamPolicyMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.iam.v1.IAMPolicy/GetIamPolicy") + .setRequestMarshaller(ProtoUtils.marshaller(GetIamPolicyRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Policy.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor + testIamPermissionsMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.iam.v1.IAMPolicy/TestIamPermissions") + .setRequestMarshaller( + ProtoUtils.marshaller(TestIamPermissionsRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(TestIamPermissionsResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private final UnaryCallable createRoomCallable; + private final UnaryCallable getRoomCallable; + private final UnaryCallable updateRoomCallable; + private final UnaryCallable deleteRoomCallable; + private final UnaryCallable listRoomsCallable; + private final UnaryCallable listRoomsPagedCallable; + private final UnaryCallable createBlurbCallable; + private final UnaryCallable getBlurbCallable; + private final UnaryCallable updateBlurbCallable; + private final UnaryCallable deleteBlurbCallable; + private final UnaryCallable listBlurbsCallable; + private final UnaryCallable listBlurbsPagedCallable; + private final UnaryCallable searchBlurbsCallable; + private final OperationCallable + searchBlurbsOperationCallable; + private final ServerStreamingCallable + streamBlurbsCallable; + private final ClientStreamingCallable sendBlurbsCallable; + private final BidiStreamingCallable connectCallable; + private final UnaryCallable listLocationsCallable; + private final UnaryCallable + listLocationsPagedCallable; + private final UnaryCallable getLocationCallable; + private final UnaryCallable setIamPolicyCallable; + private final UnaryCallable getIamPolicyCallable; + private final UnaryCallable + testIamPermissionsCallable; + + private final BackgroundResource backgroundResources; + private final GrpcOperationsStub operationsStub; + private final GrpcStubCallableFactory callableFactory; + + public static final GrpcMessagingStub create(MessagingStubSettings settings) throws IOException { + return new GrpcMessagingStub(settings, ClientContext.create(settings)); + } + + public static final GrpcMessagingStub create(ClientContext clientContext) throws IOException { + return new GrpcMessagingStub(MessagingStubSettings.newBuilder().build(), clientContext); + } + + public static final GrpcMessagingStub create( + ClientContext clientContext, GrpcStubCallableFactory callableFactory) throws IOException { + return new GrpcMessagingStub( + MessagingStubSettings.newBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of GrpcMessagingStub, 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 GrpcMessagingStub(MessagingStubSettings settings, ClientContext clientContext) + throws IOException { + this(settings, clientContext, new GrpcMessagingCallableFactory()); + } + + /** + * Constructs an instance of GrpcMessagingStub, 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 GrpcMessagingStub( + MessagingStubSettings settings, + ClientContext clientContext, + GrpcStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + this.operationsStub = GrpcOperationsStub.create(clientContext, callableFactory); + + GrpcCallSettings createRoomTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(createRoomMethodDescriptor) + .build(); + GrpcCallSettings getRoomTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getRoomMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + GrpcCallSettings updateRoomTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(updateRoomMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("room.name", String.valueOf(request.getRoom().getName())); + return builder.build(); + }) + .build(); + GrpcCallSettings deleteRoomTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(deleteRoomMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + GrpcCallSettings listRoomsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(listRoomsMethodDescriptor) + .build(); + GrpcCallSettings createBlurbTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(createBlurbMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .build(); + GrpcCallSettings getBlurbTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getBlurbMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + GrpcCallSettings updateBlurbTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(updateBlurbMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("blurb.name", String.valueOf(request.getBlurb().getName())); + return builder.build(); + }) + .build(); + GrpcCallSettings deleteBlurbTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(deleteBlurbMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + GrpcCallSettings listBlurbsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(listBlurbsMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .build(); + GrpcCallSettings searchBlurbsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(searchBlurbsMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .build(); + GrpcCallSettings streamBlurbsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(streamBlurbsMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + GrpcCallSettings sendBlurbsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(sendBlurbsMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .build(); + GrpcCallSettings connectTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(connectMethodDescriptor) + .build(); + GrpcCallSettings listLocationsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(listLocationsMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + GrpcCallSettings getLocationTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getLocationMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + GrpcCallSettings setIamPolicyTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(setIamPolicyMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("resource", String.valueOf(request.getResource())); + return builder.build(); + }) + .build(); + GrpcCallSettings getIamPolicyTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getIamPolicyMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("resource", String.valueOf(request.getResource())); + return builder.build(); + }) + .build(); + GrpcCallSettings + testIamPermissionsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(testIamPermissionsMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("resource", String.valueOf(request.getResource())); + return builder.build(); + }) + .build(); + + this.createRoomCallable = + callableFactory.createUnaryCallable( + createRoomTransportSettings, settings.createRoomSettings(), clientContext); + this.getRoomCallable = + callableFactory.createUnaryCallable( + getRoomTransportSettings, settings.getRoomSettings(), clientContext); + this.updateRoomCallable = + callableFactory.createUnaryCallable( + updateRoomTransportSettings, settings.updateRoomSettings(), clientContext); + this.deleteRoomCallable = + callableFactory.createUnaryCallable( + deleteRoomTransportSettings, settings.deleteRoomSettings(), clientContext); + this.listRoomsCallable = + callableFactory.createUnaryCallable( + listRoomsTransportSettings, settings.listRoomsSettings(), clientContext); + this.listRoomsPagedCallable = + callableFactory.createPagedCallable( + listRoomsTransportSettings, settings.listRoomsSettings(), clientContext); + this.createBlurbCallable = + callableFactory.createUnaryCallable( + createBlurbTransportSettings, settings.createBlurbSettings(), clientContext); + this.getBlurbCallable = + callableFactory.createUnaryCallable( + getBlurbTransportSettings, settings.getBlurbSettings(), clientContext); + this.updateBlurbCallable = + callableFactory.createUnaryCallable( + updateBlurbTransportSettings, settings.updateBlurbSettings(), clientContext); + this.deleteBlurbCallable = + callableFactory.createUnaryCallable( + deleteBlurbTransportSettings, settings.deleteBlurbSettings(), clientContext); + this.listBlurbsCallable = + callableFactory.createUnaryCallable( + listBlurbsTransportSettings, settings.listBlurbsSettings(), clientContext); + this.listBlurbsPagedCallable = + callableFactory.createPagedCallable( + listBlurbsTransportSettings, settings.listBlurbsSettings(), clientContext); + this.searchBlurbsCallable = + callableFactory.createUnaryCallable( + searchBlurbsTransportSettings, settings.searchBlurbsSettings(), clientContext); + this.searchBlurbsOperationCallable = + callableFactory.createOperationCallable( + searchBlurbsTransportSettings, + settings.searchBlurbsOperationSettings(), + clientContext, + operationsStub); + this.streamBlurbsCallable = + callableFactory.createServerStreamingCallable( + streamBlurbsTransportSettings, settings.streamBlurbsSettings(), clientContext); + this.sendBlurbsCallable = + callableFactory.createClientStreamingCallable( + sendBlurbsTransportSettings, settings.sendBlurbsSettings(), clientContext); + this.connectCallable = + callableFactory.createBidiStreamingCallable( + connectTransportSettings, settings.connectSettings(), clientContext); + this.listLocationsCallable = + callableFactory.createUnaryCallable( + listLocationsTransportSettings, settings.listLocationsSettings(), clientContext); + this.listLocationsPagedCallable = + callableFactory.createPagedCallable( + listLocationsTransportSettings, settings.listLocationsSettings(), clientContext); + this.getLocationCallable = + callableFactory.createUnaryCallable( + getLocationTransportSettings, settings.getLocationSettings(), clientContext); + this.setIamPolicyCallable = + callableFactory.createUnaryCallable( + setIamPolicyTransportSettings, settings.setIamPolicySettings(), clientContext); + this.getIamPolicyCallable = + callableFactory.createUnaryCallable( + getIamPolicyTransportSettings, settings.getIamPolicySettings(), clientContext); + this.testIamPermissionsCallable = + callableFactory.createUnaryCallable( + testIamPermissionsTransportSettings, + settings.testIamPermissionsSettings(), + clientContext); + + this.backgroundResources = + new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + public GrpcOperationsStub getOperationsStub() { + return operationsStub; + } + + @Override + public UnaryCallable createRoomCallable() { + return createRoomCallable; + } + + @Override + public UnaryCallable getRoomCallable() { + return getRoomCallable; + } + + @Override + public UnaryCallable updateRoomCallable() { + return updateRoomCallable; + } + + @Override + public UnaryCallable deleteRoomCallable() { + return deleteRoomCallable; + } + + @Override + public UnaryCallable listRoomsCallable() { + return listRoomsCallable; + } + + @Override + public UnaryCallable listRoomsPagedCallable() { + return listRoomsPagedCallable; + } + + @Override + public UnaryCallable createBlurbCallable() { + return createBlurbCallable; + } + + @Override + public UnaryCallable getBlurbCallable() { + return getBlurbCallable; + } + + @Override + public UnaryCallable updateBlurbCallable() { + return updateBlurbCallable; + } + + @Override + public UnaryCallable deleteBlurbCallable() { + return deleteBlurbCallable; + } + + @Override + public UnaryCallable listBlurbsCallable() { + return listBlurbsCallable; + } + + @Override + public UnaryCallable listBlurbsPagedCallable() { + return listBlurbsPagedCallable; + } + + @Override + public UnaryCallable searchBlurbsCallable() { + return searchBlurbsCallable; + } + + @Override + public OperationCallable + searchBlurbsOperationCallable() { + return searchBlurbsOperationCallable; + } + + @Override + public ServerStreamingCallable streamBlurbsCallable() { + return streamBlurbsCallable; + } + + @Override + public ClientStreamingCallable sendBlurbsCallable() { + return sendBlurbsCallable; + } + + @Override + public BidiStreamingCallable connectCallable() { + return connectCallable; + } + + @Override + public UnaryCallable listLocationsCallable() { + return listLocationsCallable; + } + + @Override + public UnaryCallable + listLocationsPagedCallable() { + return listLocationsPagedCallable; + } + + @Override + public UnaryCallable getLocationCallable() { + return getLocationCallable; + } + + @Override + public UnaryCallable setIamPolicyCallable() { + return setIamPolicyCallable; + } + + @Override + public UnaryCallable getIamPolicyCallable() { + return getIamPolicyCallable; + } + + @Override + public UnaryCallable + testIamPermissionsCallable() { + return testIamPermissionsCallable; + } + + @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-showcase-3.21.0/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/GrpcSequenceServiceCallableFactory.java b/java-showcase-3.21.0/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/GrpcSequenceServiceCallableFactory.java new file mode 100644 index 0000000000..a6aaad6597 --- /dev/null +++ b/java-showcase-3.21.0/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/GrpcSequenceServiceCallableFactory.java @@ -0,0 +1,115 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.stub; + +import com.google.api.core.BetaApi; +import com.google.api.gax.grpc.GrpcCallSettings; +import com.google.api.gax.grpc.GrpcCallableFactory; +import com.google.api.gax.grpc.GrpcStubCallableFactory; +import com.google.api.gax.rpc.BatchingCallSettings; +import com.google.api.gax.rpc.BidiStreamingCallable; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientStreamingCallable; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.api.gax.rpc.StreamingCallSettings; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.longrunning.Operation; +import com.google.longrunning.stub.OperationsStub; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * gRPC callable factory implementation for the SequenceService service API. + * + *

        This class is for advanced usage. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class GrpcSequenceServiceCallableFactory 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-showcase-3.21.0/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/GrpcSequenceServiceStub.java b/java-showcase-3.21.0/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/GrpcSequenceServiceStub.java new file mode 100644 index 0000000000..90a06a2ea1 --- /dev/null +++ b/java-showcase-3.21.0/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/GrpcSequenceServiceStub.java @@ -0,0 +1,512 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.stub; + +import static com.google.showcase.v1beta1.SequenceServiceClient.ListLocationsPagedResponse; + +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.grpc.GrpcCallSettings; +import com.google.api.gax.grpc.GrpcStubCallableFactory; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.RequestParamsBuilder; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.longrunning.stub.GrpcOperationsStub; +import com.google.protobuf.Empty; +import com.google.showcase.v1beta1.AttemptSequenceRequest; +import com.google.showcase.v1beta1.AttemptStreamingSequenceRequest; +import com.google.showcase.v1beta1.AttemptStreamingSequenceResponse; +import com.google.showcase.v1beta1.CreateSequenceRequest; +import com.google.showcase.v1beta1.CreateStreamingSequenceRequest; +import com.google.showcase.v1beta1.GetSequenceReportRequest; +import com.google.showcase.v1beta1.GetStreamingSequenceReportRequest; +import com.google.showcase.v1beta1.Sequence; +import com.google.showcase.v1beta1.SequenceReport; +import com.google.showcase.v1beta1.StreamingSequence; +import com.google.showcase.v1beta1.StreamingSequenceReport; +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 SequenceService service API. + * + *

        This class is for advanced usage and reflects the underlying API directly. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class GrpcSequenceServiceStub extends SequenceServiceStub { + private static final MethodDescriptor + createSequenceMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.showcase.v1beta1.SequenceService/CreateSequence") + .setRequestMarshaller( + ProtoUtils.marshaller(CreateSequenceRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Sequence.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor + createStreamingSequenceMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.showcase.v1beta1.SequenceService/CreateStreamingSequence") + .setRequestMarshaller( + ProtoUtils.marshaller(CreateStreamingSequenceRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(StreamingSequence.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor + getSequenceReportMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.showcase.v1beta1.SequenceService/GetSequenceReport") + .setRequestMarshaller( + ProtoUtils.marshaller(GetSequenceReportRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(SequenceReport.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor + getStreamingSequenceReportMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.showcase.v1beta1.SequenceService/GetStreamingSequenceReport") + .setRequestMarshaller( + ProtoUtils.marshaller(GetStreamingSequenceReportRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(StreamingSequenceReport.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor + attemptSequenceMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.showcase.v1beta1.SequenceService/AttemptSequence") + .setRequestMarshaller( + ProtoUtils.marshaller(AttemptSequenceRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Empty.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor< + AttemptStreamingSequenceRequest, AttemptStreamingSequenceResponse> + attemptStreamingSequenceMethodDescriptor = + MethodDescriptor + .newBuilder() + .setType(MethodDescriptor.MethodType.SERVER_STREAMING) + .setFullMethodName("google.showcase.v1beta1.SequenceService/AttemptStreamingSequence") + .setRequestMarshaller( + ProtoUtils.marshaller(AttemptStreamingSequenceRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(AttemptStreamingSequenceResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor + listLocationsMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.location.Locations/ListLocations") + .setRequestMarshaller( + ProtoUtils.marshaller(ListLocationsRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(ListLocationsResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor getLocationMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.location.Locations/GetLocation") + .setRequestMarshaller(ProtoUtils.marshaller(GetLocationRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Location.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor setIamPolicyMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.iam.v1.IAMPolicy/SetIamPolicy") + .setRequestMarshaller(ProtoUtils.marshaller(SetIamPolicyRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Policy.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor getIamPolicyMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.iam.v1.IAMPolicy/GetIamPolicy") + .setRequestMarshaller(ProtoUtils.marshaller(GetIamPolicyRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Policy.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor + testIamPermissionsMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.iam.v1.IAMPolicy/TestIamPermissions") + .setRequestMarshaller( + ProtoUtils.marshaller(TestIamPermissionsRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(TestIamPermissionsResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private final UnaryCallable createSequenceCallable; + private final UnaryCallable + createStreamingSequenceCallable; + private final UnaryCallable getSequenceReportCallable; + private final UnaryCallable + getStreamingSequenceReportCallable; + private final UnaryCallable attemptSequenceCallable; + private final ServerStreamingCallable< + AttemptStreamingSequenceRequest, AttemptStreamingSequenceResponse> + attemptStreamingSequenceCallable; + private final UnaryCallable listLocationsCallable; + private final UnaryCallable + listLocationsPagedCallable; + private final UnaryCallable getLocationCallable; + private final UnaryCallable setIamPolicyCallable; + private final UnaryCallable getIamPolicyCallable; + private final UnaryCallable + testIamPermissionsCallable; + + private final BackgroundResource backgroundResources; + private final GrpcOperationsStub operationsStub; + private final GrpcStubCallableFactory callableFactory; + + public static final GrpcSequenceServiceStub create(SequenceServiceStubSettings settings) + throws IOException { + return new GrpcSequenceServiceStub(settings, ClientContext.create(settings)); + } + + public static final GrpcSequenceServiceStub create(ClientContext clientContext) + throws IOException { + return new GrpcSequenceServiceStub( + SequenceServiceStubSettings.newBuilder().build(), clientContext); + } + + public static final GrpcSequenceServiceStub create( + ClientContext clientContext, GrpcStubCallableFactory callableFactory) throws IOException { + return new GrpcSequenceServiceStub( + SequenceServiceStubSettings.newBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of GrpcSequenceServiceStub, 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 GrpcSequenceServiceStub( + SequenceServiceStubSettings settings, ClientContext clientContext) throws IOException { + this(settings, clientContext, new GrpcSequenceServiceCallableFactory()); + } + + /** + * Constructs an instance of GrpcSequenceServiceStub, 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 GrpcSequenceServiceStub( + SequenceServiceStubSettings settings, + ClientContext clientContext, + GrpcStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + this.operationsStub = GrpcOperationsStub.create(clientContext, callableFactory); + + GrpcCallSettings createSequenceTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(createSequenceMethodDescriptor) + .build(); + GrpcCallSettings + createStreamingSequenceTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(createStreamingSequenceMethodDescriptor) + .build(); + GrpcCallSettings getSequenceReportTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getSequenceReportMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + GrpcCallSettings + getStreamingSequenceReportTransportSettings = + GrpcCallSettings + .newBuilder() + .setMethodDescriptor(getStreamingSequenceReportMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + GrpcCallSettings attemptSequenceTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(attemptSequenceMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + GrpcCallSettings + attemptStreamingSequenceTransportSettings = + GrpcCallSettings + .newBuilder() + .setMethodDescriptor(attemptStreamingSequenceMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + GrpcCallSettings listLocationsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(listLocationsMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + GrpcCallSettings getLocationTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getLocationMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + GrpcCallSettings setIamPolicyTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(setIamPolicyMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("resource", String.valueOf(request.getResource())); + return builder.build(); + }) + .build(); + GrpcCallSettings getIamPolicyTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getIamPolicyMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("resource", String.valueOf(request.getResource())); + return builder.build(); + }) + .build(); + GrpcCallSettings + testIamPermissionsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(testIamPermissionsMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("resource", String.valueOf(request.getResource())); + return builder.build(); + }) + .build(); + + this.createSequenceCallable = + callableFactory.createUnaryCallable( + createSequenceTransportSettings, settings.createSequenceSettings(), clientContext); + this.createStreamingSequenceCallable = + callableFactory.createUnaryCallable( + createStreamingSequenceTransportSettings, + settings.createStreamingSequenceSettings(), + clientContext); + this.getSequenceReportCallable = + callableFactory.createUnaryCallable( + getSequenceReportTransportSettings, + settings.getSequenceReportSettings(), + clientContext); + this.getStreamingSequenceReportCallable = + callableFactory.createUnaryCallable( + getStreamingSequenceReportTransportSettings, + settings.getStreamingSequenceReportSettings(), + clientContext); + this.attemptSequenceCallable = + callableFactory.createUnaryCallable( + attemptSequenceTransportSettings, settings.attemptSequenceSettings(), clientContext); + this.attemptStreamingSequenceCallable = + callableFactory.createServerStreamingCallable( + attemptStreamingSequenceTransportSettings, + settings.attemptStreamingSequenceSettings(), + clientContext); + this.listLocationsCallable = + callableFactory.createUnaryCallable( + listLocationsTransportSettings, settings.listLocationsSettings(), clientContext); + this.listLocationsPagedCallable = + callableFactory.createPagedCallable( + listLocationsTransportSettings, settings.listLocationsSettings(), clientContext); + this.getLocationCallable = + callableFactory.createUnaryCallable( + getLocationTransportSettings, settings.getLocationSettings(), clientContext); + this.setIamPolicyCallable = + callableFactory.createUnaryCallable( + setIamPolicyTransportSettings, settings.setIamPolicySettings(), clientContext); + this.getIamPolicyCallable = + callableFactory.createUnaryCallable( + getIamPolicyTransportSettings, settings.getIamPolicySettings(), clientContext); + this.testIamPermissionsCallable = + callableFactory.createUnaryCallable( + testIamPermissionsTransportSettings, + settings.testIamPermissionsSettings(), + clientContext); + + this.backgroundResources = + new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + public GrpcOperationsStub getOperationsStub() { + return operationsStub; + } + + @Override + public UnaryCallable createSequenceCallable() { + return createSequenceCallable; + } + + @Override + public UnaryCallable + createStreamingSequenceCallable() { + return createStreamingSequenceCallable; + } + + @Override + public UnaryCallable getSequenceReportCallable() { + return getSequenceReportCallable; + } + + @Override + public UnaryCallable + getStreamingSequenceReportCallable() { + return getStreamingSequenceReportCallable; + } + + @Override + public UnaryCallable attemptSequenceCallable() { + return attemptSequenceCallable; + } + + @Override + public ServerStreamingCallable + attemptStreamingSequenceCallable() { + return attemptStreamingSequenceCallable; + } + + @Override + public UnaryCallable listLocationsCallable() { + return listLocationsCallable; + } + + @Override + public UnaryCallable + listLocationsPagedCallable() { + return listLocationsPagedCallable; + } + + @Override + public UnaryCallable getLocationCallable() { + return getLocationCallable; + } + + @Override + public UnaryCallable setIamPolicyCallable() { + return setIamPolicyCallable; + } + + @Override + public UnaryCallable getIamPolicyCallable() { + return getIamPolicyCallable; + } + + @Override + public UnaryCallable + testIamPermissionsCallable() { + return testIamPermissionsCallable; + } + + @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-showcase-3.21.0/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/GrpcTestingCallableFactory.java b/java-showcase-3.21.0/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/GrpcTestingCallableFactory.java new file mode 100644 index 0000000000..adbfa10f91 --- /dev/null +++ b/java-showcase-3.21.0/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/GrpcTestingCallableFactory.java @@ -0,0 +1,115 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.stub; + +import com.google.api.core.BetaApi; +import com.google.api.gax.grpc.GrpcCallSettings; +import com.google.api.gax.grpc.GrpcCallableFactory; +import com.google.api.gax.grpc.GrpcStubCallableFactory; +import com.google.api.gax.rpc.BatchingCallSettings; +import com.google.api.gax.rpc.BidiStreamingCallable; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientStreamingCallable; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.api.gax.rpc.StreamingCallSettings; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.longrunning.Operation; +import com.google.longrunning.stub.OperationsStub; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * gRPC callable factory implementation for the Testing service API. + * + *

        This class is for advanced usage. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class GrpcTestingCallableFactory 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-showcase-3.21.0/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/GrpcTestingStub.java b/java-showcase-3.21.0/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/GrpcTestingStub.java new file mode 100644 index 0000000000..b485b9f36d --- /dev/null +++ b/java-showcase-3.21.0/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/GrpcTestingStub.java @@ -0,0 +1,557 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.stub; + +import static com.google.showcase.v1beta1.TestingClient.ListLocationsPagedResponse; +import static com.google.showcase.v1beta1.TestingClient.ListSessionsPagedResponse; +import static com.google.showcase.v1beta1.TestingClient.ListTestsPagedResponse; + +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.grpc.GrpcCallSettings; +import com.google.api.gax.grpc.GrpcStubCallableFactory; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.RequestParamsBuilder; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.longrunning.stub.GrpcOperationsStub; +import com.google.protobuf.Empty; +import com.google.showcase.v1beta1.CreateSessionRequest; +import com.google.showcase.v1beta1.DeleteSessionRequest; +import com.google.showcase.v1beta1.DeleteTestRequest; +import com.google.showcase.v1beta1.GetSessionRequest; +import com.google.showcase.v1beta1.ListSessionsRequest; +import com.google.showcase.v1beta1.ListSessionsResponse; +import com.google.showcase.v1beta1.ListTestsRequest; +import com.google.showcase.v1beta1.ListTestsResponse; +import com.google.showcase.v1beta1.ReportSessionRequest; +import com.google.showcase.v1beta1.ReportSessionResponse; +import com.google.showcase.v1beta1.Session; +import com.google.showcase.v1beta1.VerifyTestRequest; +import com.google.showcase.v1beta1.VerifyTestResponse; +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 Testing service API. + * + *

        This class is for advanced usage and reflects the underlying API directly. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class GrpcTestingStub extends TestingStub { + private static final MethodDescriptor + createSessionMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.showcase.v1beta1.Testing/CreateSession") + .setRequestMarshaller( + ProtoUtils.marshaller(CreateSessionRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Session.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor getSessionMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.showcase.v1beta1.Testing/GetSession") + .setRequestMarshaller(ProtoUtils.marshaller(GetSessionRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Session.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor + listSessionsMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.showcase.v1beta1.Testing/ListSessions") + .setRequestMarshaller(ProtoUtils.marshaller(ListSessionsRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(ListSessionsResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor deleteSessionMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.showcase.v1beta1.Testing/DeleteSession") + .setRequestMarshaller(ProtoUtils.marshaller(DeleteSessionRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Empty.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor + reportSessionMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.showcase.v1beta1.Testing/ReportSession") + .setRequestMarshaller( + ProtoUtils.marshaller(ReportSessionRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(ReportSessionResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor + listTestsMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.showcase.v1beta1.Testing/ListTests") + .setRequestMarshaller(ProtoUtils.marshaller(ListTestsRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(ListTestsResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor deleteTestMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.showcase.v1beta1.Testing/DeleteTest") + .setRequestMarshaller(ProtoUtils.marshaller(DeleteTestRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Empty.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor + verifyTestMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.showcase.v1beta1.Testing/VerifyTest") + .setRequestMarshaller(ProtoUtils.marshaller(VerifyTestRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(VerifyTestResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor + listLocationsMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.location.Locations/ListLocations") + .setRequestMarshaller( + ProtoUtils.marshaller(ListLocationsRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(ListLocationsResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor getLocationMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.location.Locations/GetLocation") + .setRequestMarshaller(ProtoUtils.marshaller(GetLocationRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Location.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor setIamPolicyMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.iam.v1.IAMPolicy/SetIamPolicy") + .setRequestMarshaller(ProtoUtils.marshaller(SetIamPolicyRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Policy.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor getIamPolicyMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.iam.v1.IAMPolicy/GetIamPolicy") + .setRequestMarshaller(ProtoUtils.marshaller(GetIamPolicyRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Policy.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor + testIamPermissionsMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.iam.v1.IAMPolicy/TestIamPermissions") + .setRequestMarshaller( + ProtoUtils.marshaller(TestIamPermissionsRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(TestIamPermissionsResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private final UnaryCallable createSessionCallable; + private final UnaryCallable getSessionCallable; + private final UnaryCallable listSessionsCallable; + private final UnaryCallable + listSessionsPagedCallable; + private final UnaryCallable deleteSessionCallable; + private final UnaryCallable reportSessionCallable; + private final UnaryCallable listTestsCallable; + private final UnaryCallable listTestsPagedCallable; + private final UnaryCallable deleteTestCallable; + private final UnaryCallable verifyTestCallable; + private final UnaryCallable listLocationsCallable; + private final UnaryCallable + listLocationsPagedCallable; + private final UnaryCallable getLocationCallable; + private final UnaryCallable setIamPolicyCallable; + private final UnaryCallable getIamPolicyCallable; + private final UnaryCallable + testIamPermissionsCallable; + + private final BackgroundResource backgroundResources; + private final GrpcOperationsStub operationsStub; + private final GrpcStubCallableFactory callableFactory; + + public static final GrpcTestingStub create(TestingStubSettings settings) throws IOException { + return new GrpcTestingStub(settings, ClientContext.create(settings)); + } + + public static final GrpcTestingStub create(ClientContext clientContext) throws IOException { + return new GrpcTestingStub(TestingStubSettings.newBuilder().build(), clientContext); + } + + public static final GrpcTestingStub create( + ClientContext clientContext, GrpcStubCallableFactory callableFactory) throws IOException { + return new GrpcTestingStub( + TestingStubSettings.newBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of GrpcTestingStub, 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 GrpcTestingStub(TestingStubSettings settings, ClientContext clientContext) + throws IOException { + this(settings, clientContext, new GrpcTestingCallableFactory()); + } + + /** + * Constructs an instance of GrpcTestingStub, 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 GrpcTestingStub( + TestingStubSettings settings, + ClientContext clientContext, + GrpcStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + this.operationsStub = GrpcOperationsStub.create(clientContext, callableFactory); + + GrpcCallSettings createSessionTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(createSessionMethodDescriptor) + .build(); + GrpcCallSettings getSessionTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getSessionMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + GrpcCallSettings listSessionsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(listSessionsMethodDescriptor) + .build(); + GrpcCallSettings deleteSessionTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(deleteSessionMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + GrpcCallSettings reportSessionTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(reportSessionMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + GrpcCallSettings listTestsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(listTestsMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .build(); + GrpcCallSettings deleteTestTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(deleteTestMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + GrpcCallSettings verifyTestTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(verifyTestMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + GrpcCallSettings listLocationsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(listLocationsMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + GrpcCallSettings getLocationTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getLocationMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + GrpcCallSettings setIamPolicyTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(setIamPolicyMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("resource", String.valueOf(request.getResource())); + return builder.build(); + }) + .build(); + GrpcCallSettings getIamPolicyTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getIamPolicyMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("resource", String.valueOf(request.getResource())); + return builder.build(); + }) + .build(); + GrpcCallSettings + testIamPermissionsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(testIamPermissionsMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("resource", String.valueOf(request.getResource())); + return builder.build(); + }) + .build(); + + this.createSessionCallable = + callableFactory.createUnaryCallable( + createSessionTransportSettings, settings.createSessionSettings(), clientContext); + this.getSessionCallable = + callableFactory.createUnaryCallable( + getSessionTransportSettings, settings.getSessionSettings(), clientContext); + this.listSessionsCallable = + callableFactory.createUnaryCallable( + listSessionsTransportSettings, settings.listSessionsSettings(), clientContext); + this.listSessionsPagedCallable = + callableFactory.createPagedCallable( + listSessionsTransportSettings, settings.listSessionsSettings(), clientContext); + this.deleteSessionCallable = + callableFactory.createUnaryCallable( + deleteSessionTransportSettings, settings.deleteSessionSettings(), clientContext); + this.reportSessionCallable = + callableFactory.createUnaryCallable( + reportSessionTransportSettings, settings.reportSessionSettings(), clientContext); + this.listTestsCallable = + callableFactory.createUnaryCallable( + listTestsTransportSettings, settings.listTestsSettings(), clientContext); + this.listTestsPagedCallable = + callableFactory.createPagedCallable( + listTestsTransportSettings, settings.listTestsSettings(), clientContext); + this.deleteTestCallable = + callableFactory.createUnaryCallable( + deleteTestTransportSettings, settings.deleteTestSettings(), clientContext); + this.verifyTestCallable = + callableFactory.createUnaryCallable( + verifyTestTransportSettings, settings.verifyTestSettings(), clientContext); + this.listLocationsCallable = + callableFactory.createUnaryCallable( + listLocationsTransportSettings, settings.listLocationsSettings(), clientContext); + this.listLocationsPagedCallable = + callableFactory.createPagedCallable( + listLocationsTransportSettings, settings.listLocationsSettings(), clientContext); + this.getLocationCallable = + callableFactory.createUnaryCallable( + getLocationTransportSettings, settings.getLocationSettings(), clientContext); + this.setIamPolicyCallable = + callableFactory.createUnaryCallable( + setIamPolicyTransportSettings, settings.setIamPolicySettings(), clientContext); + this.getIamPolicyCallable = + callableFactory.createUnaryCallable( + getIamPolicyTransportSettings, settings.getIamPolicySettings(), clientContext); + this.testIamPermissionsCallable = + callableFactory.createUnaryCallable( + testIamPermissionsTransportSettings, + settings.testIamPermissionsSettings(), + clientContext); + + this.backgroundResources = + new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + public GrpcOperationsStub getOperationsStub() { + return operationsStub; + } + + @Override + public UnaryCallable createSessionCallable() { + return createSessionCallable; + } + + @Override + public UnaryCallable getSessionCallable() { + return getSessionCallable; + } + + @Override + public UnaryCallable listSessionsCallable() { + return listSessionsCallable; + } + + @Override + public UnaryCallable listSessionsPagedCallable() { + return listSessionsPagedCallable; + } + + @Override + public UnaryCallable deleteSessionCallable() { + return deleteSessionCallable; + } + + @Override + public UnaryCallable reportSessionCallable() { + return reportSessionCallable; + } + + @Override + public UnaryCallable listTestsCallable() { + return listTestsCallable; + } + + @Override + public UnaryCallable listTestsPagedCallable() { + return listTestsPagedCallable; + } + + @Override + public UnaryCallable deleteTestCallable() { + return deleteTestCallable; + } + + @Override + public UnaryCallable verifyTestCallable() { + return verifyTestCallable; + } + + @Override + public UnaryCallable listLocationsCallable() { + return listLocationsCallable; + } + + @Override + public UnaryCallable + listLocationsPagedCallable() { + return listLocationsPagedCallable; + } + + @Override + public UnaryCallable getLocationCallable() { + return getLocationCallable; + } + + @Override + public UnaryCallable setIamPolicyCallable() { + return setIamPolicyCallable; + } + + @Override + public UnaryCallable getIamPolicyCallable() { + return getIamPolicyCallable; + } + + @Override + public UnaryCallable + testIamPermissionsCallable() { + return testIamPermissionsCallable; + } + + @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-showcase-3.21.0/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/HttpJsonComplianceCallableFactory.java b/java-showcase-3.21.0/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/HttpJsonComplianceCallableFactory.java new file mode 100644 index 0000000000..a862d01764 --- /dev/null +++ b/java-showcase-3.21.0/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/HttpJsonComplianceCallableFactory.java @@ -0,0 +1,103 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.stub; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.HttpJsonCallSettings; +import com.google.api.gax.httpjson.HttpJsonCallableFactory; +import com.google.api.gax.httpjson.HttpJsonOperationSnapshotCallable; +import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; +import com.google.api.gax.httpjson.longrunning.stub.OperationsStub; +import com.google.api.gax.rpc.BatchingCallSettings; +import com.google.api.gax.rpc.ClientContext; +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.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.longrunning.Operation; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * REST callable factory implementation for the Compliance service API. + * + *

        This class is for advanced usage. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class HttpJsonComplianceCallableFactory + implements HttpJsonStubCallableFactory { + + @Override + public UnaryCallable createUnaryCallable( + HttpJsonCallSettings httpJsonCallSettings, + UnaryCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createUnaryCallable( + httpJsonCallSettings, callSettings, clientContext); + } + + @Override + public + UnaryCallable createPagedCallable( + HttpJsonCallSettings httpJsonCallSettings, + PagedCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createPagedCallable( + httpJsonCallSettings, callSettings, clientContext); + } + + @Override + public UnaryCallable createBatchingCallable( + HttpJsonCallSettings httpJsonCallSettings, + BatchingCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createBatchingCallable( + httpJsonCallSettings, callSettings, clientContext); + } + + @Override + public + OperationCallable createOperationCallable( + HttpJsonCallSettings httpJsonCallSettings, + OperationCallSettings callSettings, + ClientContext clientContext, + OperationsStub operationsStub) { + UnaryCallable innerCallable = + HttpJsonCallableFactory.createBaseUnaryCallable( + httpJsonCallSettings, callSettings.getInitialCallSettings(), clientContext); + HttpJsonOperationSnapshotCallable initialCallable = + new HttpJsonOperationSnapshotCallable( + innerCallable, + httpJsonCallSettings.getMethodDescriptor().getOperationSnapshotFactory()); + return HttpJsonCallableFactory.createOperationCallable( + callSettings, clientContext, operationsStub.longRunningClient(), initialCallable); + } + + @Override + public + ServerStreamingCallable createServerStreamingCallable( + HttpJsonCallSettings httpJsonCallSettings, + ServerStreamingCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createServerStreamingCallable( + httpJsonCallSettings, callSettings, clientContext); + } +} diff --git a/java-showcase-3.21.0/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/HttpJsonComplianceStub.java b/java-showcase-3.21.0/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/HttpJsonComplianceStub.java new file mode 100644 index 0000000000..5bcc7c6fe1 --- /dev/null +++ b/java-showcase-3.21.0/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/HttpJsonComplianceStub.java @@ -0,0 +1,1109 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.stub; + +import static com.google.showcase.v1beta1.ComplianceClient.ListLocationsPagedResponse; + +import com.google.api.core.BetaApi; +import com.google.api.core.InternalApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.httpjson.ApiMethodDescriptor; +import com.google.api.gax.httpjson.HttpJsonCallSettings; +import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; +import com.google.api.gax.httpjson.ProtoMessageRequestFormatter; +import com.google.api.gax.httpjson.ProtoMessageResponseParser; +import com.google.api.gax.httpjson.ProtoRestSerializer; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.RequestParamsBuilder; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.protobuf.TypeRegistry; +import com.google.showcase.v1beta1.EnumRequest; +import com.google.showcase.v1beta1.EnumResponse; +import com.google.showcase.v1beta1.RepeatRequest; +import com.google.showcase.v1beta1.RepeatResponse; +import java.io.IOException; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * REST stub implementation for the Compliance service API. + * + *

        This class is for advanced usage and reflects the underlying API directly. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class HttpJsonComplianceStub extends ComplianceStub { + private static final TypeRegistry typeRegistry = TypeRegistry.newBuilder().build(); + + private static final ApiMethodDescriptor + repeatDataBodyMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.showcase.v1beta1.Compliance/RepeatDataBody") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/repeat:body", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("*", request.toBuilder().build(), false)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(RepeatResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + repeatDataBodyInfoMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.showcase.v1beta1.Compliance/RepeatDataBodyInfo") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/repeat:bodyinfo", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "fDouble", request.getFDouble()); + serializer.putQueryParam(fields, "fInt32", request.getFInt32()); + serializer.putQueryParam(fields, "fInt64", request.getFInt64()); + if (request.hasIntendedBindingUri()) { + serializer.putQueryParam( + fields, "intendedBindingUri", request.getIntendedBindingUri()); + } + serializer.putQueryParam(fields, "name", request.getName()); + if (request.hasPDouble()) { + serializer.putQueryParam(fields, "pDouble", request.getPDouble()); + } + if (request.hasPInt32()) { + serializer.putQueryParam(fields, "pInt32", request.getPInt32()); + } + if (request.hasPInt64()) { + serializer.putQueryParam(fields, "pInt64", request.getPInt64()); + } + serializer.putQueryParam( + fields, "serverVerify", request.getServerVerify()); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create().toBody("info", request.getInfo(), false)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(RepeatResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + repeatDataQueryMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.showcase.v1beta1.Compliance/RepeatDataQuery") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/repeat:query", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "fDouble", request.getFDouble()); + serializer.putQueryParam(fields, "fInt32", request.getFInt32()); + serializer.putQueryParam(fields, "fInt64", request.getFInt64()); + serializer.putQueryParam(fields, "info", request.getInfo()); + if (request.hasIntendedBindingUri()) { + serializer.putQueryParam( + fields, "intendedBindingUri", request.getIntendedBindingUri()); + } + serializer.putQueryParam(fields, "name", request.getName()); + if (request.hasPDouble()) { + serializer.putQueryParam(fields, "pDouble", request.getPDouble()); + } + if (request.hasPInt32()) { + serializer.putQueryParam(fields, "pInt32", request.getPInt32()); + } + if (request.hasPInt64()) { + serializer.putQueryParam(fields, "pInt64", request.getPInt64()); + } + serializer.putQueryParam( + fields, "serverVerify", request.getServerVerify()); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(RepeatResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + repeatDataSimplePathMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.showcase.v1beta1.Compliance/RepeatDataSimplePath") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/repeat/{info.fString}/{info.fInt32}/{info.fDouble}/{info.fBool}/{info.fKingdom}:simplepath", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam( + fields, "info.fBool", request.getInfo().getFBool()); + serializer.putPathParam( + fields, "info.fDouble", request.getInfo().getFDouble()); + serializer.putPathParam( + fields, "info.fInt32", request.getInfo().getFInt32()); + serializer.putPathParam( + fields, "info.fKingdom", request.getInfo().getFKingdomValue()); + serializer.putPathParam( + fields, "info.fString", request.getInfo().getFString()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "fDouble", request.getFDouble()); + serializer.putQueryParam(fields, "fInt32", request.getFInt32()); + serializer.putQueryParam(fields, "fInt64", request.getFInt64()); + serializer.putQueryParam(fields, "info", request.getInfo()); + if (request.hasIntendedBindingUri()) { + serializer.putQueryParam( + fields, "intendedBindingUri", request.getIntendedBindingUri()); + } + serializer.putQueryParam(fields, "name", request.getName()); + if (request.hasPDouble()) { + serializer.putQueryParam(fields, "pDouble", request.getPDouble()); + } + if (request.hasPInt32()) { + serializer.putQueryParam(fields, "pInt32", request.getPInt32()); + } + if (request.hasPInt64()) { + serializer.putQueryParam(fields, "pInt64", request.getPInt64()); + } + serializer.putQueryParam( + fields, "serverVerify", request.getServerVerify()); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(RepeatResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + repeatDataPathResourceMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.showcase.v1beta1.Compliance/RepeatDataPathResource") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/repeat/{info.fString=first/*}/{info.fChild.fString=second/*}/bool/{info.fBool}:pathresource", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam( + fields, "info.fBool", request.getInfo().getFBool()); + serializer.putPathParam( + fields, + "info.fChild.fString", + request.getInfo().getFChild().getFString()); + serializer.putPathParam( + fields, "info.fString", request.getInfo().getFString()); + return fields; + }) + .setAdditionalPaths( + "/v1beta1/repeat/{info.fChild.fString=first/*}/{info.fString=second/*}/bool/{info.fBool}:childfirstpathresource") + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "fDouble", request.getFDouble()); + serializer.putQueryParam(fields, "fInt32", request.getFInt32()); + serializer.putQueryParam(fields, "fInt64", request.getFInt64()); + serializer.putQueryParam(fields, "info", request.getInfo()); + if (request.hasIntendedBindingUri()) { + serializer.putQueryParam( + fields, "intendedBindingUri", request.getIntendedBindingUri()); + } + serializer.putQueryParam(fields, "name", request.getName()); + if (request.hasPDouble()) { + serializer.putQueryParam(fields, "pDouble", request.getPDouble()); + } + if (request.hasPInt32()) { + serializer.putQueryParam(fields, "pInt32", request.getPInt32()); + } + if (request.hasPInt64()) { + serializer.putQueryParam(fields, "pInt64", request.getPInt64()); + } + serializer.putQueryParam( + fields, "serverVerify", request.getServerVerify()); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(RepeatResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + repeatDataPathTrailingResourceMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName( + "google.showcase.v1beta1.Compliance/RepeatDataPathTrailingResource") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/repeat/{info.fString=first/*}/{info.fChild.fString=second/**}:pathtrailingresource", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam( + fields, + "info.fChild.fString", + request.getInfo().getFChild().getFString()); + serializer.putPathParam( + fields, "info.fString", request.getInfo().getFString()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "fDouble", request.getFDouble()); + serializer.putQueryParam(fields, "fInt32", request.getFInt32()); + serializer.putQueryParam(fields, "fInt64", request.getFInt64()); + serializer.putQueryParam(fields, "info", request.getInfo()); + if (request.hasIntendedBindingUri()) { + serializer.putQueryParam( + fields, "intendedBindingUri", request.getIntendedBindingUri()); + } + serializer.putQueryParam(fields, "name", request.getName()); + if (request.hasPDouble()) { + serializer.putQueryParam(fields, "pDouble", request.getPDouble()); + } + if (request.hasPInt32()) { + serializer.putQueryParam(fields, "pInt32", request.getPInt32()); + } + if (request.hasPInt64()) { + serializer.putQueryParam(fields, "pInt64", request.getPInt64()); + } + serializer.putQueryParam( + fields, "serverVerify", request.getServerVerify()); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(RepeatResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + repeatDataBodyPutMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.showcase.v1beta1.Compliance/RepeatDataBodyPut") + .setHttpMethod("PUT") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/repeat:bodyput", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("*", request.toBuilder().build(), false)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(RepeatResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + repeatDataBodyPatchMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.showcase.v1beta1.Compliance/RepeatDataBodyPatch") + .setHttpMethod("PATCH") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/repeat:bodypatch", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("*", request.toBuilder().build(), false)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(RepeatResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor getEnumMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.showcase.v1beta1.Compliance/GetEnum") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/compliance/enum", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = ProtoRestSerializer.create(); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "unknownEnum", request.getUnknownEnum()); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(EnumResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor verifyEnumMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.showcase.v1beta1.Compliance/VerifyEnum") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/compliance/enum", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = ProtoRestSerializer.create(); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "continent", request.getContinentValue()); + serializer.putQueryParam(fields, "request", request.getRequest()); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(EnumResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + listLocationsMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.location.Locations/ListLocations") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/{name=projects/*}/locations", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(ListLocationsResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + getLocationMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.location.Locations/GetLocation") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/{name=projects/*/locations/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Location.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + setIamPolicyMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.iam.v1.IAMPolicy/SetIamPolicy") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/{resource=users/*}:setIamPolicy", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "resource", request.getResource()); + return fields; + }) + .setAdditionalPaths( + "/v1beta1/{resource=rooms/*}:setIamPolicy", + "/v1beta1/{resource=rooms/*/blurbs/*}:setIamPolicy", + "/v1beta1/{resource=sequences/*}:setIamPolicy") + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("*", request.toBuilder().clearResource().build(), false)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Policy.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + getIamPolicyMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.iam.v1.IAMPolicy/GetIamPolicy") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/{resource=users/*}:getIamPolicy", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "resource", request.getResource()); + return fields; + }) + .setAdditionalPaths( + "/v1beta1/{resource=rooms/*}:getIamPolicy", + "/v1beta1/{resource=rooms/*/blurbs/*}:getIamPolicy", + "/v1beta1/{resource=sequences/*}:getIamPolicy") + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Policy.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + testIamPermissionsMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.iam.v1.IAMPolicy/TestIamPermissions") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/{resource=users/*}:testIamPermissions", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "resource", request.getResource()); + return fields; + }) + .setAdditionalPaths( + "/v1beta1/{resource=rooms/*}:testIamPermissions", + "/v1beta1/{resource=rooms/*/blurbs/*}:testIamPermissions", + "/v1beta1/{resource=sequences/*}:testIamPermissions") + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("*", request.toBuilder().clearResource().build(), false)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(TestIamPermissionsResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private final UnaryCallable repeatDataBodyCallable; + private final UnaryCallable repeatDataBodyInfoCallable; + private final UnaryCallable repeatDataQueryCallable; + private final UnaryCallable repeatDataSimplePathCallable; + private final UnaryCallable repeatDataPathResourceCallable; + private final UnaryCallable repeatDataPathTrailingResourceCallable; + private final UnaryCallable repeatDataBodyPutCallable; + private final UnaryCallable repeatDataBodyPatchCallable; + private final UnaryCallable getEnumCallable; + private final UnaryCallable verifyEnumCallable; + private final UnaryCallable listLocationsCallable; + private final UnaryCallable + listLocationsPagedCallable; + private final UnaryCallable getLocationCallable; + private final UnaryCallable setIamPolicyCallable; + private final UnaryCallable getIamPolicyCallable; + private final UnaryCallable + testIamPermissionsCallable; + + private final BackgroundResource backgroundResources; + private final HttpJsonStubCallableFactory callableFactory; + + public static final HttpJsonComplianceStub create(ComplianceStubSettings settings) + throws IOException { + return new HttpJsonComplianceStub(settings, ClientContext.create(settings)); + } + + public static final HttpJsonComplianceStub create(ClientContext clientContext) + throws IOException { + return new HttpJsonComplianceStub( + ComplianceStubSettings.newHttpJsonBuilder().build(), clientContext); + } + + public static final HttpJsonComplianceStub create( + ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { + return new HttpJsonComplianceStub( + ComplianceStubSettings.newHttpJsonBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of HttpJsonComplianceStub, 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 HttpJsonComplianceStub(ComplianceStubSettings settings, ClientContext clientContext) + throws IOException { + this(settings, clientContext, new HttpJsonComplianceCallableFactory()); + } + + /** + * Constructs an instance of HttpJsonComplianceStub, 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 HttpJsonComplianceStub( + ComplianceStubSettings settings, + ClientContext clientContext, + HttpJsonStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + + HttpJsonCallSettings repeatDataBodyTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(repeatDataBodyMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings repeatDataBodyInfoTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(repeatDataBodyInfoMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings repeatDataQueryTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(repeatDataQueryMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings repeatDataSimplePathTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(repeatDataSimplePathMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("info.f_bool", String.valueOf(request.getInfo().getFBool())); + builder.add("info.f_double", String.valueOf(request.getInfo().getFDouble())); + builder.add("info.f_int32", String.valueOf(request.getInfo().getFInt32())); + builder.add( + "info.f_kingdom", String.valueOf(request.getInfo().getFKingdomValue())); + builder.add("info.f_string", String.valueOf(request.getInfo().getFString())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings repeatDataPathResourceTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(repeatDataPathResourceMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("info.f_bool", String.valueOf(request.getInfo().getFBool())); + builder.add( + "info.f_child.f_string", + String.valueOf(request.getInfo().getFChild().getFString())); + builder.add("info.f_string", String.valueOf(request.getInfo().getFString())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings + repeatDataPathTrailingResourceTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(repeatDataPathTrailingResourceMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add( + "info.f_child.f_string", + String.valueOf(request.getInfo().getFChild().getFString())); + builder.add("info.f_string", String.valueOf(request.getInfo().getFString())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings repeatDataBodyPutTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(repeatDataBodyPutMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings repeatDataBodyPatchTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(repeatDataBodyPatchMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings getEnumTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getEnumMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings verifyEnumTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(verifyEnumMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings + listLocationsTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(listLocationsMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings getLocationTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getLocationMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings setIamPolicyTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(setIamPolicyMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("resource", String.valueOf(request.getResource())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings getIamPolicyTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getIamPolicyMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("resource", String.valueOf(request.getResource())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings + testIamPermissionsTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(testIamPermissionsMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("resource", String.valueOf(request.getResource())); + return builder.build(); + }) + .build(); + + this.repeatDataBodyCallable = + callableFactory.createUnaryCallable( + repeatDataBodyTransportSettings, settings.repeatDataBodySettings(), clientContext); + this.repeatDataBodyInfoCallable = + callableFactory.createUnaryCallable( + repeatDataBodyInfoTransportSettings, + settings.repeatDataBodyInfoSettings(), + clientContext); + this.repeatDataQueryCallable = + callableFactory.createUnaryCallable( + repeatDataQueryTransportSettings, settings.repeatDataQuerySettings(), clientContext); + this.repeatDataSimplePathCallable = + callableFactory.createUnaryCallable( + repeatDataSimplePathTransportSettings, + settings.repeatDataSimplePathSettings(), + clientContext); + this.repeatDataPathResourceCallable = + callableFactory.createUnaryCallable( + repeatDataPathResourceTransportSettings, + settings.repeatDataPathResourceSettings(), + clientContext); + this.repeatDataPathTrailingResourceCallable = + callableFactory.createUnaryCallable( + repeatDataPathTrailingResourceTransportSettings, + settings.repeatDataPathTrailingResourceSettings(), + clientContext); + this.repeatDataBodyPutCallable = + callableFactory.createUnaryCallable( + repeatDataBodyPutTransportSettings, + settings.repeatDataBodyPutSettings(), + clientContext); + this.repeatDataBodyPatchCallable = + callableFactory.createUnaryCallable( + repeatDataBodyPatchTransportSettings, + settings.repeatDataBodyPatchSettings(), + clientContext); + this.getEnumCallable = + callableFactory.createUnaryCallable( + getEnumTransportSettings, settings.getEnumSettings(), clientContext); + this.verifyEnumCallable = + callableFactory.createUnaryCallable( + verifyEnumTransportSettings, settings.verifyEnumSettings(), clientContext); + this.listLocationsCallable = + callableFactory.createUnaryCallable( + listLocationsTransportSettings, settings.listLocationsSettings(), clientContext); + this.listLocationsPagedCallable = + callableFactory.createPagedCallable( + listLocationsTransportSettings, settings.listLocationsSettings(), clientContext); + this.getLocationCallable = + callableFactory.createUnaryCallable( + getLocationTransportSettings, settings.getLocationSettings(), clientContext); + this.setIamPolicyCallable = + callableFactory.createUnaryCallable( + setIamPolicyTransportSettings, settings.setIamPolicySettings(), clientContext); + this.getIamPolicyCallable = + callableFactory.createUnaryCallable( + getIamPolicyTransportSettings, settings.getIamPolicySettings(), clientContext); + this.testIamPermissionsCallable = + callableFactory.createUnaryCallable( + testIamPermissionsTransportSettings, + settings.testIamPermissionsSettings(), + clientContext); + + this.backgroundResources = + new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + @InternalApi + public static List getMethodDescriptors() { + List methodDescriptors = new ArrayList<>(); + methodDescriptors.add(repeatDataBodyMethodDescriptor); + methodDescriptors.add(repeatDataBodyInfoMethodDescriptor); + methodDescriptors.add(repeatDataQueryMethodDescriptor); + methodDescriptors.add(repeatDataSimplePathMethodDescriptor); + methodDescriptors.add(repeatDataPathResourceMethodDescriptor); + methodDescriptors.add(repeatDataPathTrailingResourceMethodDescriptor); + methodDescriptors.add(repeatDataBodyPutMethodDescriptor); + methodDescriptors.add(repeatDataBodyPatchMethodDescriptor); + methodDescriptors.add(getEnumMethodDescriptor); + methodDescriptors.add(verifyEnumMethodDescriptor); + methodDescriptors.add(listLocationsMethodDescriptor); + methodDescriptors.add(getLocationMethodDescriptor); + methodDescriptors.add(setIamPolicyMethodDescriptor); + methodDescriptors.add(getIamPolicyMethodDescriptor); + methodDescriptors.add(testIamPermissionsMethodDescriptor); + return methodDescriptors; + } + + @Override + public UnaryCallable repeatDataBodyCallable() { + return repeatDataBodyCallable; + } + + @Override + public UnaryCallable repeatDataBodyInfoCallable() { + return repeatDataBodyInfoCallable; + } + + @Override + public UnaryCallable repeatDataQueryCallable() { + return repeatDataQueryCallable; + } + + @Override + public UnaryCallable repeatDataSimplePathCallable() { + return repeatDataSimplePathCallable; + } + + @Override + public UnaryCallable repeatDataPathResourceCallable() { + return repeatDataPathResourceCallable; + } + + @Override + public UnaryCallable repeatDataPathTrailingResourceCallable() { + return repeatDataPathTrailingResourceCallable; + } + + @Override + public UnaryCallable repeatDataBodyPutCallable() { + return repeatDataBodyPutCallable; + } + + @Override + public UnaryCallable repeatDataBodyPatchCallable() { + return repeatDataBodyPatchCallable; + } + + @Override + public UnaryCallable getEnumCallable() { + return getEnumCallable; + } + + @Override + public UnaryCallable verifyEnumCallable() { + return verifyEnumCallable; + } + + @Override + public UnaryCallable listLocationsCallable() { + return listLocationsCallable; + } + + @Override + public UnaryCallable + listLocationsPagedCallable() { + return listLocationsPagedCallable; + } + + @Override + public UnaryCallable getLocationCallable() { + return getLocationCallable; + } + + @Override + public UnaryCallable setIamPolicyCallable() { + return setIamPolicyCallable; + } + + @Override + public UnaryCallable getIamPolicyCallable() { + return getIamPolicyCallable; + } + + @Override + public UnaryCallable + testIamPermissionsCallable() { + return testIamPermissionsCallable; + } + + @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-showcase-3.21.0/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/HttpJsonEchoCallableFactory.java b/java-showcase-3.21.0/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/HttpJsonEchoCallableFactory.java new file mode 100644 index 0000000000..ff4dcba729 --- /dev/null +++ b/java-showcase-3.21.0/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/HttpJsonEchoCallableFactory.java @@ -0,0 +1,103 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.stub; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.HttpJsonCallSettings; +import com.google.api.gax.httpjson.HttpJsonCallableFactory; +import com.google.api.gax.httpjson.HttpJsonOperationSnapshotCallable; +import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; +import com.google.api.gax.httpjson.longrunning.stub.OperationsStub; +import com.google.api.gax.rpc.BatchingCallSettings; +import com.google.api.gax.rpc.ClientContext; +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.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.longrunning.Operation; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * REST callable factory implementation for the Echo service API. + * + *

        This class is for advanced usage. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class HttpJsonEchoCallableFactory + implements HttpJsonStubCallableFactory { + + @Override + public UnaryCallable createUnaryCallable( + HttpJsonCallSettings httpJsonCallSettings, + UnaryCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createUnaryCallable( + httpJsonCallSettings, callSettings, clientContext); + } + + @Override + public + UnaryCallable createPagedCallable( + HttpJsonCallSettings httpJsonCallSettings, + PagedCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createPagedCallable( + httpJsonCallSettings, callSettings, clientContext); + } + + @Override + public UnaryCallable createBatchingCallable( + HttpJsonCallSettings httpJsonCallSettings, + BatchingCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createBatchingCallable( + httpJsonCallSettings, callSettings, clientContext); + } + + @Override + public + OperationCallable createOperationCallable( + HttpJsonCallSettings httpJsonCallSettings, + OperationCallSettings callSettings, + ClientContext clientContext, + OperationsStub operationsStub) { + UnaryCallable innerCallable = + HttpJsonCallableFactory.createBaseUnaryCallable( + httpJsonCallSettings, callSettings.getInitialCallSettings(), clientContext); + HttpJsonOperationSnapshotCallable initialCallable = + new HttpJsonOperationSnapshotCallable( + innerCallable, + httpJsonCallSettings.getMethodDescriptor().getOperationSnapshotFactory()); + return HttpJsonCallableFactory.createOperationCallable( + callSettings, clientContext, operationsStub.longRunningClient(), initialCallable); + } + + @Override + public + ServerStreamingCallable createServerStreamingCallable( + HttpJsonCallSettings httpJsonCallSettings, + ServerStreamingCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createServerStreamingCallable( + httpJsonCallSettings, callSettings, clientContext); + } +} diff --git a/java-showcase-3.21.0/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/HttpJsonEchoStub.java b/java-showcase-3.21.0/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/HttpJsonEchoStub.java new file mode 100644 index 0000000000..1a7f5e5cc4 --- /dev/null +++ b/java-showcase-3.21.0/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/HttpJsonEchoStub.java @@ -0,0 +1,1058 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.stub; + +import static com.google.showcase.v1beta1.EchoClient.ListLocationsPagedResponse; +import static com.google.showcase.v1beta1.EchoClient.PagedExpandLegacyMappedPagedResponse; +import static com.google.showcase.v1beta1.EchoClient.PagedExpandPagedResponse; + +import com.google.api.HttpRule; +import com.google.api.core.BetaApi; +import com.google.api.core.InternalApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.httpjson.ApiMethodDescriptor; +import com.google.api.gax.httpjson.HttpJsonCallSettings; +import com.google.api.gax.httpjson.HttpJsonOperationSnapshot; +import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; +import com.google.api.gax.httpjson.ProtoMessageRequestFormatter; +import com.google.api.gax.httpjson.ProtoMessageResponseParser; +import com.google.api.gax.httpjson.ProtoRestSerializer; +import com.google.api.gax.httpjson.longrunning.stub.HttpJsonOperationsStub; +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.OperationCallable; +import com.google.api.gax.rpc.RequestParamsBuilder; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.api.pathtemplate.PathTemplate; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.common.base.Strings; +import com.google.common.collect.ImmutableMap; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.longrunning.Operation; +import com.google.protobuf.TypeRegistry; +import com.google.showcase.v1beta1.BlockRequest; +import com.google.showcase.v1beta1.BlockResponse; +import com.google.showcase.v1beta1.EchoErrorDetailsRequest; +import com.google.showcase.v1beta1.EchoErrorDetailsResponse; +import com.google.showcase.v1beta1.EchoRequest; +import com.google.showcase.v1beta1.EchoResponse; +import com.google.showcase.v1beta1.ExpandRequest; +import com.google.showcase.v1beta1.FailEchoWithDetailsRequest; +import com.google.showcase.v1beta1.FailEchoWithDetailsResponse; +import com.google.showcase.v1beta1.PagedExpandLegacyMappedResponse; +import com.google.showcase.v1beta1.PagedExpandLegacyRequest; +import com.google.showcase.v1beta1.PagedExpandRequest; +import com.google.showcase.v1beta1.PagedExpandResponse; +import com.google.showcase.v1beta1.WaitMetadata; +import com.google.showcase.v1beta1.WaitRequest; +import com.google.showcase.v1beta1.WaitResponse; +import java.io.IOException; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.UUID; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * REST stub implementation for the Echo service API. + * + *

        This class is for advanced usage and reflects the underlying API directly. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class HttpJsonEchoStub extends EchoStub { + private static final TypeRegistry typeRegistry = + TypeRegistry.newBuilder() + .add(WaitResponse.getDescriptor()) + .add(WaitMetadata.getDescriptor()) + .build(); + + private static final ApiMethodDescriptor echoMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.showcase.v1beta1.Echo/Echo") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/echo:echo", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = ProtoRestSerializer.create(); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("*", request.toBuilder().build(), false)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(EchoResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + echoErrorDetailsMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.showcase.v1beta1.Echo/EchoErrorDetails") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/echo:error-details", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("*", request.toBuilder().build(), false)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(EchoErrorDetailsResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + failEchoWithDetailsMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.showcase.v1beta1.Echo/FailEchoWithDetails") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/echo:failWithDetails", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("*", request.toBuilder().build(), false)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(FailEchoWithDetailsResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor expandMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.showcase.v1beta1.Echo/Expand") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.SERVER_STREAMING) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/echo:expand", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("*", request.toBuilder().build(), false)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(EchoResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + pagedExpandMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.showcase.v1beta1.Echo/PagedExpand") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/echo:pagedExpand", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("*", request.toBuilder().build(), false)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(PagedExpandResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + pagedExpandLegacyMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.showcase.v1beta1.Echo/PagedExpandLegacy") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/echo:pagedExpandLegacy", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("*", request.toBuilder().build(), false)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(PagedExpandResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + pagedExpandLegacyMappedMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.showcase.v1beta1.Echo/PagedExpandLegacyMapped") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/echo:pagedExpandLegacyMapped", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("*", request.toBuilder().build(), false)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(PagedExpandLegacyMappedResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor waitMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.showcase.v1beta1.Echo/Wait") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/echo:wait", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = ProtoRestSerializer.create(); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("*", request.toBuilder().build(), false)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Operation.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .setOperationSnapshotFactory( + (WaitRequest request, Operation response) -> + HttpJsonOperationSnapshot.create(response)) + .build(); + + private static final ApiMethodDescriptor blockMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.showcase.v1beta1.Echo/Block") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/echo:block", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = ProtoRestSerializer.create(); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("*", request.toBuilder().build(), false)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(BlockResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + listLocationsMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.location.Locations/ListLocations") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/{name=projects/*}/locations", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(ListLocationsResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + getLocationMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.location.Locations/GetLocation") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/{name=projects/*/locations/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Location.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + setIamPolicyMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.iam.v1.IAMPolicy/SetIamPolicy") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/{resource=users/*}:setIamPolicy", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "resource", request.getResource()); + return fields; + }) + .setAdditionalPaths( + "/v1beta1/{resource=rooms/*}:setIamPolicy", + "/v1beta1/{resource=rooms/*/blurbs/*}:setIamPolicy", + "/v1beta1/{resource=sequences/*}:setIamPolicy") + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("*", request.toBuilder().clearResource().build(), false)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Policy.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + getIamPolicyMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.iam.v1.IAMPolicy/GetIamPolicy") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/{resource=users/*}:getIamPolicy", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "resource", request.getResource()); + return fields; + }) + .setAdditionalPaths( + "/v1beta1/{resource=rooms/*}:getIamPolicy", + "/v1beta1/{resource=rooms/*/blurbs/*}:getIamPolicy", + "/v1beta1/{resource=sequences/*}:getIamPolicy") + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Policy.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + testIamPermissionsMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.iam.v1.IAMPolicy/TestIamPermissions") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/{resource=users/*}:testIamPermissions", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "resource", request.getResource()); + return fields; + }) + .setAdditionalPaths( + "/v1beta1/{resource=rooms/*}:testIamPermissions", + "/v1beta1/{resource=rooms/*/blurbs/*}:testIamPermissions", + "/v1beta1/{resource=sequences/*}:testIamPermissions") + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("*", request.toBuilder().clearResource().build(), false)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(TestIamPermissionsResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private final UnaryCallable echoCallable; + private final UnaryCallable + echoErrorDetailsCallable; + private final UnaryCallable + failEchoWithDetailsCallable; + private final ServerStreamingCallable expandCallable; + private final UnaryCallable pagedExpandCallable; + private final UnaryCallable + pagedExpandPagedCallable; + private final UnaryCallable + pagedExpandLegacyCallable; + private final UnaryCallable + pagedExpandLegacyMappedCallable; + private final UnaryCallable + pagedExpandLegacyMappedPagedCallable; + private final UnaryCallable waitCallable; + private final OperationCallable waitOperationCallable; + private final UnaryCallable blockCallable; + private final UnaryCallable listLocationsCallable; + private final UnaryCallable + listLocationsPagedCallable; + private final UnaryCallable getLocationCallable; + private final UnaryCallable setIamPolicyCallable; + private final UnaryCallable getIamPolicyCallable; + private final UnaryCallable + testIamPermissionsCallable; + + private final BackgroundResource backgroundResources; + private final HttpJsonOperationsStub httpJsonOperationsStub; + private final HttpJsonStubCallableFactory callableFactory; + + private static final PathTemplate ECHO_0_PATH_TEMPLATE = PathTemplate.create("{header=**}"); + private static final PathTemplate ECHO_1_PATH_TEMPLATE = PathTemplate.create("{routing_id=**}"); + private static final PathTemplate ECHO_2_PATH_TEMPLATE = + PathTemplate.create("{table_name=regions/*/zones/*/**}"); + private static final PathTemplate ECHO_3_PATH_TEMPLATE = + PathTemplate.create("{super_id=projects/*}/**"); + private static final PathTemplate ECHO_4_PATH_TEMPLATE = + PathTemplate.create("{table_name=projects/*/instances/*/**}"); + private static final PathTemplate ECHO_5_PATH_TEMPLATE = + PathTemplate.create("projects/*/{instance_id=instances/*}/**"); + private static final PathTemplate ECHO_6_PATH_TEMPLATE = PathTemplate.create("{baz=**}"); + private static final PathTemplate ECHO_7_PATH_TEMPLATE = + PathTemplate.create("{qux=projects/*}/**"); + + public static final HttpJsonEchoStub create(EchoStubSettings settings) throws IOException { + return new HttpJsonEchoStub(settings, ClientContext.create(settings)); + } + + public static final HttpJsonEchoStub create(ClientContext clientContext) throws IOException { + return new HttpJsonEchoStub(EchoStubSettings.newHttpJsonBuilder().build(), clientContext); + } + + public static final HttpJsonEchoStub create( + ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { + return new HttpJsonEchoStub( + EchoStubSettings.newHttpJsonBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of HttpJsonEchoStub, 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 HttpJsonEchoStub(EchoStubSettings settings, ClientContext clientContext) + throws IOException { + this(settings, clientContext, new HttpJsonEchoCallableFactory()); + } + + /** + * Constructs an instance of HttpJsonEchoStub, 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 HttpJsonEchoStub( + EchoStubSettings settings, + ClientContext clientContext, + HttpJsonStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + this.httpJsonOperationsStub = + HttpJsonOperationsStub.create( + clientContext, + callableFactory, + typeRegistry, + ImmutableMap.builder() + .put( + "google.longrunning.Operations.CancelOperation", + HttpRule.newBuilder().setPost("/v1beta1/{name=operations/**}:cancel").build()) + .put( + "google.longrunning.Operations.DeleteOperation", + HttpRule.newBuilder().setDelete("/v1beta1/{name=operations/**}").build()) + .put( + "google.longrunning.Operations.GetOperation", + HttpRule.newBuilder().setGet("/v1beta1/{name=operations/**}").build()) + .put( + "google.longrunning.Operations.ListOperations", + HttpRule.newBuilder().setGet("/v1beta1/operations").build()) + .build()); + + HttpJsonCallSettings echoTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(echoMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add(request.getHeader(), "header", ECHO_0_PATH_TEMPLATE); + builder.add(request.getHeader(), "routing_id", ECHO_1_PATH_TEMPLATE); + builder.add(request.getHeader(), "table_name", ECHO_2_PATH_TEMPLATE); + builder.add(request.getHeader(), "super_id", ECHO_3_PATH_TEMPLATE); + builder.add(request.getHeader(), "table_name", ECHO_4_PATH_TEMPLATE); + builder.add(request.getHeader(), "instance_id", ECHO_5_PATH_TEMPLATE); + builder.add(request.getOtherHeader(), "baz", ECHO_6_PATH_TEMPLATE); + builder.add(request.getOtherHeader(), "qux", ECHO_7_PATH_TEMPLATE); + return builder.build(); + }) + .setRequestMutator( + request -> { + EchoRequest.Builder requestBuilder = request.toBuilder(); + if (Strings.isNullOrEmpty(request.getRequestId())) { + requestBuilder.setRequestId(UUID.randomUUID().toString()); + } + if (Strings.isNullOrEmpty(request.getOtherRequestId())) { + requestBuilder.setOtherRequestId(UUID.randomUUID().toString()); + } + return requestBuilder.build(); + }) + .build(); + HttpJsonCallSettings + echoErrorDetailsTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(echoErrorDetailsMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings + failEchoWithDetailsTransportSettings = + HttpJsonCallSettings + .newBuilder() + .setMethodDescriptor(failEchoWithDetailsMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings expandTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(expandMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings pagedExpandTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(pagedExpandMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings + pagedExpandLegacyTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(pagedExpandLegacyMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings + pagedExpandLegacyMappedTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(pagedExpandLegacyMappedMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings waitTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(waitMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings blockTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(blockMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings + listLocationsTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(listLocationsMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings getLocationTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getLocationMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings setIamPolicyTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(setIamPolicyMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("resource", String.valueOf(request.getResource())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings getIamPolicyTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getIamPolicyMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("resource", String.valueOf(request.getResource())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings + testIamPermissionsTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(testIamPermissionsMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("resource", String.valueOf(request.getResource())); + return builder.build(); + }) + .build(); + + this.echoCallable = + callableFactory.createUnaryCallable( + echoTransportSettings, settings.echoSettings(), clientContext); + this.echoErrorDetailsCallable = + callableFactory.createUnaryCallable( + echoErrorDetailsTransportSettings, settings.echoErrorDetailsSettings(), clientContext); + this.failEchoWithDetailsCallable = + callableFactory.createUnaryCallable( + failEchoWithDetailsTransportSettings, + settings.failEchoWithDetailsSettings(), + clientContext); + this.expandCallable = + callableFactory.createServerStreamingCallable( + expandTransportSettings, settings.expandSettings(), clientContext); + this.pagedExpandCallable = + callableFactory.createUnaryCallable( + pagedExpandTransportSettings, settings.pagedExpandSettings(), clientContext); + this.pagedExpandPagedCallable = + callableFactory.createPagedCallable( + pagedExpandTransportSettings, settings.pagedExpandSettings(), clientContext); + this.pagedExpandLegacyCallable = + callableFactory.createUnaryCallable( + pagedExpandLegacyTransportSettings, + settings.pagedExpandLegacySettings(), + clientContext); + this.pagedExpandLegacyMappedCallable = + callableFactory.createUnaryCallable( + pagedExpandLegacyMappedTransportSettings, + settings.pagedExpandLegacyMappedSettings(), + clientContext); + this.pagedExpandLegacyMappedPagedCallable = + callableFactory.createPagedCallable( + pagedExpandLegacyMappedTransportSettings, + settings.pagedExpandLegacyMappedSettings(), + clientContext); + this.waitCallable = + callableFactory.createUnaryCallable( + waitTransportSettings, settings.waitSettings(), clientContext); + this.waitOperationCallable = + callableFactory.createOperationCallable( + waitTransportSettings, + settings.waitOperationSettings(), + clientContext, + httpJsonOperationsStub); + this.blockCallable = + callableFactory.createUnaryCallable( + blockTransportSettings, settings.blockSettings(), clientContext); + this.listLocationsCallable = + callableFactory.createUnaryCallable( + listLocationsTransportSettings, settings.listLocationsSettings(), clientContext); + this.listLocationsPagedCallable = + callableFactory.createPagedCallable( + listLocationsTransportSettings, settings.listLocationsSettings(), clientContext); + this.getLocationCallable = + callableFactory.createUnaryCallable( + getLocationTransportSettings, settings.getLocationSettings(), clientContext); + this.setIamPolicyCallable = + callableFactory.createUnaryCallable( + setIamPolicyTransportSettings, settings.setIamPolicySettings(), clientContext); + this.getIamPolicyCallable = + callableFactory.createUnaryCallable( + getIamPolicyTransportSettings, settings.getIamPolicySettings(), clientContext); + this.testIamPermissionsCallable = + callableFactory.createUnaryCallable( + testIamPermissionsTransportSettings, + settings.testIamPermissionsSettings(), + clientContext); + + this.backgroundResources = + new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + @InternalApi + public static List getMethodDescriptors() { + List methodDescriptors = new ArrayList<>(); + methodDescriptors.add(echoMethodDescriptor); + methodDescriptors.add(echoErrorDetailsMethodDescriptor); + methodDescriptors.add(failEchoWithDetailsMethodDescriptor); + methodDescriptors.add(expandMethodDescriptor); + methodDescriptors.add(pagedExpandMethodDescriptor); + methodDescriptors.add(pagedExpandLegacyMethodDescriptor); + methodDescriptors.add(pagedExpandLegacyMappedMethodDescriptor); + methodDescriptors.add(waitMethodDescriptor); + methodDescriptors.add(blockMethodDescriptor); + methodDescriptors.add(listLocationsMethodDescriptor); + methodDescriptors.add(getLocationMethodDescriptor); + methodDescriptors.add(setIamPolicyMethodDescriptor); + methodDescriptors.add(getIamPolicyMethodDescriptor); + methodDescriptors.add(testIamPermissionsMethodDescriptor); + return methodDescriptors; + } + + public HttpJsonOperationsStub getHttpJsonOperationsStub() { + return httpJsonOperationsStub; + } + + @Override + public UnaryCallable echoCallable() { + return echoCallable; + } + + @Override + public UnaryCallable + echoErrorDetailsCallable() { + return echoErrorDetailsCallable; + } + + @Override + public UnaryCallable + failEchoWithDetailsCallable() { + return failEchoWithDetailsCallable; + } + + @Override + public ServerStreamingCallable expandCallable() { + return expandCallable; + } + + @Override + public UnaryCallable pagedExpandCallable() { + return pagedExpandCallable; + } + + @Override + public UnaryCallable pagedExpandPagedCallable() { + return pagedExpandPagedCallable; + } + + @Override + public UnaryCallable pagedExpandLegacyCallable() { + return pagedExpandLegacyCallable; + } + + @Override + public UnaryCallable + pagedExpandLegacyMappedCallable() { + return pagedExpandLegacyMappedCallable; + } + + @Override + public UnaryCallable + pagedExpandLegacyMappedPagedCallable() { + return pagedExpandLegacyMappedPagedCallable; + } + + @Override + public UnaryCallable waitCallable() { + return waitCallable; + } + + @Override + public OperationCallable waitOperationCallable() { + return waitOperationCallable; + } + + @Override + public UnaryCallable blockCallable() { + return blockCallable; + } + + @Override + public UnaryCallable listLocationsCallable() { + return listLocationsCallable; + } + + @Override + public UnaryCallable + listLocationsPagedCallable() { + return listLocationsPagedCallable; + } + + @Override + public UnaryCallable getLocationCallable() { + return getLocationCallable; + } + + @Override + public UnaryCallable setIamPolicyCallable() { + return setIamPolicyCallable; + } + + @Override + public UnaryCallable getIamPolicyCallable() { + return getIamPolicyCallable; + } + + @Override + public UnaryCallable + testIamPermissionsCallable() { + return testIamPermissionsCallable; + } + + @Override + public ClientStreamingCallable collectCallable() { + throw new UnsupportedOperationException( + "Not implemented: collectCallable(). REST transport is not implemented for this method" + + " yet."); + } + + @Override + public BidiStreamingCallable chatCallable() { + throw new UnsupportedOperationException( + "Not implemented: chatCallable(). REST transport is not implemented for this method yet."); + } + + @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-showcase-3.21.0/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/HttpJsonIdentityCallableFactory.java b/java-showcase-3.21.0/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/HttpJsonIdentityCallableFactory.java new file mode 100644 index 0000000000..19b5dfa5a7 --- /dev/null +++ b/java-showcase-3.21.0/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/HttpJsonIdentityCallableFactory.java @@ -0,0 +1,103 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.stub; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.HttpJsonCallSettings; +import com.google.api.gax.httpjson.HttpJsonCallableFactory; +import com.google.api.gax.httpjson.HttpJsonOperationSnapshotCallable; +import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; +import com.google.api.gax.httpjson.longrunning.stub.OperationsStub; +import com.google.api.gax.rpc.BatchingCallSettings; +import com.google.api.gax.rpc.ClientContext; +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.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.longrunning.Operation; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * REST callable factory implementation for the Identity service API. + * + *

        This class is for advanced usage. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class HttpJsonIdentityCallableFactory + implements HttpJsonStubCallableFactory { + + @Override + public UnaryCallable createUnaryCallable( + HttpJsonCallSettings httpJsonCallSettings, + UnaryCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createUnaryCallable( + httpJsonCallSettings, callSettings, clientContext); + } + + @Override + public + UnaryCallable createPagedCallable( + HttpJsonCallSettings httpJsonCallSettings, + PagedCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createPagedCallable( + httpJsonCallSettings, callSettings, clientContext); + } + + @Override + public UnaryCallable createBatchingCallable( + HttpJsonCallSettings httpJsonCallSettings, + BatchingCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createBatchingCallable( + httpJsonCallSettings, callSettings, clientContext); + } + + @Override + public + OperationCallable createOperationCallable( + HttpJsonCallSettings httpJsonCallSettings, + OperationCallSettings callSettings, + ClientContext clientContext, + OperationsStub operationsStub) { + UnaryCallable innerCallable = + HttpJsonCallableFactory.createBaseUnaryCallable( + httpJsonCallSettings, callSettings.getInitialCallSettings(), clientContext); + HttpJsonOperationSnapshotCallable initialCallable = + new HttpJsonOperationSnapshotCallable( + innerCallable, + httpJsonCallSettings.getMethodDescriptor().getOperationSnapshotFactory()); + return HttpJsonCallableFactory.createOperationCallable( + callSettings, clientContext, operationsStub.longRunningClient(), initialCallable); + } + + @Override + public + ServerStreamingCallable createServerStreamingCallable( + HttpJsonCallSettings httpJsonCallSettings, + ServerStreamingCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createServerStreamingCallable( + httpJsonCallSettings, callSettings, clientContext); + } +} diff --git a/java-showcase-3.21.0/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/HttpJsonIdentityStub.java b/java-showcase-3.21.0/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/HttpJsonIdentityStub.java new file mode 100644 index 0000000000..53a2149e7c --- /dev/null +++ b/java-showcase-3.21.0/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/HttpJsonIdentityStub.java @@ -0,0 +1,735 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.stub; + +import static com.google.showcase.v1beta1.IdentityClient.ListLocationsPagedResponse; +import static com.google.showcase.v1beta1.IdentityClient.ListUsersPagedResponse; + +import com.google.api.core.BetaApi; +import com.google.api.core.InternalApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.httpjson.ApiMethodDescriptor; +import com.google.api.gax.httpjson.HttpJsonCallSettings; +import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; +import com.google.api.gax.httpjson.ProtoMessageRequestFormatter; +import com.google.api.gax.httpjson.ProtoMessageResponseParser; +import com.google.api.gax.httpjson.ProtoRestSerializer; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.RequestParamsBuilder; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.protobuf.Empty; +import com.google.protobuf.TypeRegistry; +import com.google.showcase.v1beta1.CreateUserRequest; +import com.google.showcase.v1beta1.DeleteUserRequest; +import com.google.showcase.v1beta1.GetUserRequest; +import com.google.showcase.v1beta1.ListUsersRequest; +import com.google.showcase.v1beta1.ListUsersResponse; +import com.google.showcase.v1beta1.UpdateUserRequest; +import com.google.showcase.v1beta1.User; +import java.io.IOException; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * REST stub implementation for the Identity service API. + * + *

        This class is for advanced usage and reflects the underlying API directly. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class HttpJsonIdentityStub extends IdentityStub { + private static final TypeRegistry typeRegistry = TypeRegistry.newBuilder().build(); + + private static final ApiMethodDescriptor createUserMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.showcase.v1beta1.Identity/CreateUser") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/users", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("*", request.toBuilder().build(), false)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(User.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor getUserMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.showcase.v1beta1.Identity/GetUser") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/{name=users/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(User.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor updateUserMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.showcase.v1beta1.Identity/UpdateUser") + .setHttpMethod("PATCH") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/{user.name=users/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "user.name", request.getUser().getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "updateMask", request.getUpdateMask()); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create().toBody("user", request.getUser(), false)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(User.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor deleteUserMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.showcase.v1beta1.Identity/DeleteUser") + .setHttpMethod("DELETE") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/{name=users/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Empty.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + listUsersMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.showcase.v1beta1.Identity/ListUsers") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/users", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "pageSize", request.getPageSize()); + serializer.putQueryParam(fields, "pageToken", request.getPageToken()); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(ListUsersResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + listLocationsMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.location.Locations/ListLocations") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/{name=projects/*}/locations", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(ListLocationsResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + getLocationMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.location.Locations/GetLocation") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/{name=projects/*/locations/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Location.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + setIamPolicyMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.iam.v1.IAMPolicy/SetIamPolicy") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/{resource=users/*}:setIamPolicy", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "resource", request.getResource()); + return fields; + }) + .setAdditionalPaths( + "/v1beta1/{resource=rooms/*}:setIamPolicy", + "/v1beta1/{resource=rooms/*/blurbs/*}:setIamPolicy", + "/v1beta1/{resource=sequences/*}:setIamPolicy") + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("*", request.toBuilder().clearResource().build(), false)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Policy.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + getIamPolicyMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.iam.v1.IAMPolicy/GetIamPolicy") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/{resource=users/*}:getIamPolicy", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "resource", request.getResource()); + return fields; + }) + .setAdditionalPaths( + "/v1beta1/{resource=rooms/*}:getIamPolicy", + "/v1beta1/{resource=rooms/*/blurbs/*}:getIamPolicy", + "/v1beta1/{resource=sequences/*}:getIamPolicy") + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Policy.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + testIamPermissionsMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.iam.v1.IAMPolicy/TestIamPermissions") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/{resource=users/*}:testIamPermissions", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "resource", request.getResource()); + return fields; + }) + .setAdditionalPaths( + "/v1beta1/{resource=rooms/*}:testIamPermissions", + "/v1beta1/{resource=rooms/*/blurbs/*}:testIamPermissions", + "/v1beta1/{resource=sequences/*}:testIamPermissions") + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("*", request.toBuilder().clearResource().build(), false)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(TestIamPermissionsResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private final UnaryCallable createUserCallable; + private final UnaryCallable getUserCallable; + private final UnaryCallable updateUserCallable; + private final UnaryCallable deleteUserCallable; + private final UnaryCallable listUsersCallable; + private final UnaryCallable listUsersPagedCallable; + private final UnaryCallable listLocationsCallable; + private final UnaryCallable + listLocationsPagedCallable; + private final UnaryCallable getLocationCallable; + private final UnaryCallable setIamPolicyCallable; + private final UnaryCallable getIamPolicyCallable; + private final UnaryCallable + testIamPermissionsCallable; + + private final BackgroundResource backgroundResources; + private final HttpJsonStubCallableFactory callableFactory; + + public static final HttpJsonIdentityStub create(IdentityStubSettings settings) + throws IOException { + return new HttpJsonIdentityStub(settings, ClientContext.create(settings)); + } + + public static final HttpJsonIdentityStub create(ClientContext clientContext) throws IOException { + return new HttpJsonIdentityStub( + IdentityStubSettings.newHttpJsonBuilder().build(), clientContext); + } + + public static final HttpJsonIdentityStub create( + ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { + return new HttpJsonIdentityStub( + IdentityStubSettings.newHttpJsonBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of HttpJsonIdentityStub, 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 HttpJsonIdentityStub(IdentityStubSettings settings, ClientContext clientContext) + throws IOException { + this(settings, clientContext, new HttpJsonIdentityCallableFactory()); + } + + /** + * Constructs an instance of HttpJsonIdentityStub, 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 HttpJsonIdentityStub( + IdentityStubSettings settings, + ClientContext clientContext, + HttpJsonStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + + HttpJsonCallSettings createUserTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(createUserMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings getUserTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getUserMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings updateUserTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(updateUserMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("user.name", String.valueOf(request.getUser().getName())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings deleteUserTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(deleteUserMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings listUsersTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(listUsersMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings + listLocationsTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(listLocationsMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings getLocationTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getLocationMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings setIamPolicyTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(setIamPolicyMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("resource", String.valueOf(request.getResource())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings getIamPolicyTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getIamPolicyMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("resource", String.valueOf(request.getResource())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings + testIamPermissionsTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(testIamPermissionsMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("resource", String.valueOf(request.getResource())); + return builder.build(); + }) + .build(); + + this.createUserCallable = + callableFactory.createUnaryCallable( + createUserTransportSettings, settings.createUserSettings(), clientContext); + this.getUserCallable = + callableFactory.createUnaryCallable( + getUserTransportSettings, settings.getUserSettings(), clientContext); + this.updateUserCallable = + callableFactory.createUnaryCallable( + updateUserTransportSettings, settings.updateUserSettings(), clientContext); + this.deleteUserCallable = + callableFactory.createUnaryCallable( + deleteUserTransportSettings, settings.deleteUserSettings(), clientContext); + this.listUsersCallable = + callableFactory.createUnaryCallable( + listUsersTransportSettings, settings.listUsersSettings(), clientContext); + this.listUsersPagedCallable = + callableFactory.createPagedCallable( + listUsersTransportSettings, settings.listUsersSettings(), clientContext); + this.listLocationsCallable = + callableFactory.createUnaryCallable( + listLocationsTransportSettings, settings.listLocationsSettings(), clientContext); + this.listLocationsPagedCallable = + callableFactory.createPagedCallable( + listLocationsTransportSettings, settings.listLocationsSettings(), clientContext); + this.getLocationCallable = + callableFactory.createUnaryCallable( + getLocationTransportSettings, settings.getLocationSettings(), clientContext); + this.setIamPolicyCallable = + callableFactory.createUnaryCallable( + setIamPolicyTransportSettings, settings.setIamPolicySettings(), clientContext); + this.getIamPolicyCallable = + callableFactory.createUnaryCallable( + getIamPolicyTransportSettings, settings.getIamPolicySettings(), clientContext); + this.testIamPermissionsCallable = + callableFactory.createUnaryCallable( + testIamPermissionsTransportSettings, + settings.testIamPermissionsSettings(), + clientContext); + + this.backgroundResources = + new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + @InternalApi + public static List getMethodDescriptors() { + List methodDescriptors = new ArrayList<>(); + methodDescriptors.add(createUserMethodDescriptor); + methodDescriptors.add(getUserMethodDescriptor); + methodDescriptors.add(updateUserMethodDescriptor); + methodDescriptors.add(deleteUserMethodDescriptor); + methodDescriptors.add(listUsersMethodDescriptor); + methodDescriptors.add(listLocationsMethodDescriptor); + methodDescriptors.add(getLocationMethodDescriptor); + methodDescriptors.add(setIamPolicyMethodDescriptor); + methodDescriptors.add(getIamPolicyMethodDescriptor); + methodDescriptors.add(testIamPermissionsMethodDescriptor); + return methodDescriptors; + } + + @Override + public UnaryCallable createUserCallable() { + return createUserCallable; + } + + @Override + public UnaryCallable getUserCallable() { + return getUserCallable; + } + + @Override + public UnaryCallable updateUserCallable() { + return updateUserCallable; + } + + @Override + public UnaryCallable deleteUserCallable() { + return deleteUserCallable; + } + + @Override + public UnaryCallable listUsersCallable() { + return listUsersCallable; + } + + @Override + public UnaryCallable listUsersPagedCallable() { + return listUsersPagedCallable; + } + + @Override + public UnaryCallable listLocationsCallable() { + return listLocationsCallable; + } + + @Override + public UnaryCallable + listLocationsPagedCallable() { + return listLocationsPagedCallable; + } + + @Override + public UnaryCallable getLocationCallable() { + return getLocationCallable; + } + + @Override + public UnaryCallable setIamPolicyCallable() { + return setIamPolicyCallable; + } + + @Override + public UnaryCallable getIamPolicyCallable() { + return getIamPolicyCallable; + } + + @Override + public UnaryCallable + testIamPermissionsCallable() { + return testIamPermissionsCallable; + } + + @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-showcase-3.21.0/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/HttpJsonMessagingCallableFactory.java b/java-showcase-3.21.0/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/HttpJsonMessagingCallableFactory.java new file mode 100644 index 0000000000..666726fc52 --- /dev/null +++ b/java-showcase-3.21.0/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/HttpJsonMessagingCallableFactory.java @@ -0,0 +1,103 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.stub; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.HttpJsonCallSettings; +import com.google.api.gax.httpjson.HttpJsonCallableFactory; +import com.google.api.gax.httpjson.HttpJsonOperationSnapshotCallable; +import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; +import com.google.api.gax.httpjson.longrunning.stub.OperationsStub; +import com.google.api.gax.rpc.BatchingCallSettings; +import com.google.api.gax.rpc.ClientContext; +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.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.longrunning.Operation; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * REST callable factory implementation for the Messaging service API. + * + *

        This class is for advanced usage. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class HttpJsonMessagingCallableFactory + implements HttpJsonStubCallableFactory { + + @Override + public UnaryCallable createUnaryCallable( + HttpJsonCallSettings httpJsonCallSettings, + UnaryCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createUnaryCallable( + httpJsonCallSettings, callSettings, clientContext); + } + + @Override + public + UnaryCallable createPagedCallable( + HttpJsonCallSettings httpJsonCallSettings, + PagedCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createPagedCallable( + httpJsonCallSettings, callSettings, clientContext); + } + + @Override + public UnaryCallable createBatchingCallable( + HttpJsonCallSettings httpJsonCallSettings, + BatchingCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createBatchingCallable( + httpJsonCallSettings, callSettings, clientContext); + } + + @Override + public + OperationCallable createOperationCallable( + HttpJsonCallSettings httpJsonCallSettings, + OperationCallSettings callSettings, + ClientContext clientContext, + OperationsStub operationsStub) { + UnaryCallable innerCallable = + HttpJsonCallableFactory.createBaseUnaryCallable( + httpJsonCallSettings, callSettings.getInitialCallSettings(), clientContext); + HttpJsonOperationSnapshotCallable initialCallable = + new HttpJsonOperationSnapshotCallable( + innerCallable, + httpJsonCallSettings.getMethodDescriptor().getOperationSnapshotFactory()); + return HttpJsonCallableFactory.createOperationCallable( + callSettings, clientContext, operationsStub.longRunningClient(), initialCallable); + } + + @Override + public + ServerStreamingCallable createServerStreamingCallable( + HttpJsonCallSettings httpJsonCallSettings, + ServerStreamingCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createServerStreamingCallable( + httpJsonCallSettings, callSettings, clientContext); + } +} diff --git a/java-showcase-3.21.0/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/HttpJsonMessagingStub.java b/java-showcase-3.21.0/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/HttpJsonMessagingStub.java new file mode 100644 index 0000000000..af225c30d7 --- /dev/null +++ b/java-showcase-3.21.0/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/HttpJsonMessagingStub.java @@ -0,0 +1,1223 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.stub; + +import static com.google.showcase.v1beta1.MessagingClient.ListBlurbsPagedResponse; +import static com.google.showcase.v1beta1.MessagingClient.ListLocationsPagedResponse; +import static com.google.showcase.v1beta1.MessagingClient.ListRoomsPagedResponse; + +import com.google.api.HttpRule; +import com.google.api.core.BetaApi; +import com.google.api.core.InternalApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.httpjson.ApiMethodDescriptor; +import com.google.api.gax.httpjson.HttpJsonCallSettings; +import com.google.api.gax.httpjson.HttpJsonOperationSnapshot; +import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; +import com.google.api.gax.httpjson.ProtoMessageRequestFormatter; +import com.google.api.gax.httpjson.ProtoMessageResponseParser; +import com.google.api.gax.httpjson.ProtoRestSerializer; +import com.google.api.gax.httpjson.longrunning.stub.HttpJsonOperationsStub; +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.OperationCallable; +import com.google.api.gax.rpc.RequestParamsBuilder; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.common.collect.ImmutableMap; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.longrunning.Operation; +import com.google.protobuf.Empty; +import com.google.protobuf.TypeRegistry; +import com.google.showcase.v1beta1.Blurb; +import com.google.showcase.v1beta1.ConnectRequest; +import com.google.showcase.v1beta1.CreateBlurbRequest; +import com.google.showcase.v1beta1.CreateRoomRequest; +import com.google.showcase.v1beta1.DeleteBlurbRequest; +import com.google.showcase.v1beta1.DeleteRoomRequest; +import com.google.showcase.v1beta1.GetBlurbRequest; +import com.google.showcase.v1beta1.GetRoomRequest; +import com.google.showcase.v1beta1.ListBlurbsRequest; +import com.google.showcase.v1beta1.ListBlurbsResponse; +import com.google.showcase.v1beta1.ListRoomsRequest; +import com.google.showcase.v1beta1.ListRoomsResponse; +import com.google.showcase.v1beta1.Room; +import com.google.showcase.v1beta1.SearchBlurbsMetadata; +import com.google.showcase.v1beta1.SearchBlurbsRequest; +import com.google.showcase.v1beta1.SearchBlurbsResponse; +import com.google.showcase.v1beta1.SendBlurbsResponse; +import com.google.showcase.v1beta1.StreamBlurbsRequest; +import com.google.showcase.v1beta1.StreamBlurbsResponse; +import com.google.showcase.v1beta1.UpdateBlurbRequest; +import com.google.showcase.v1beta1.UpdateRoomRequest; +import java.io.IOException; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * REST stub implementation for the Messaging service API. + * + *

        This class is for advanced usage and reflects the underlying API directly. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class HttpJsonMessagingStub extends MessagingStub { + private static final TypeRegistry typeRegistry = + TypeRegistry.newBuilder() + .add(SearchBlurbsResponse.getDescriptor()) + .add(SearchBlurbsMetadata.getDescriptor()) + .build(); + + private static final ApiMethodDescriptor createRoomMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.showcase.v1beta1.Messaging/CreateRoom") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/rooms", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("*", request.toBuilder().build(), false)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Room.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor getRoomMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.showcase.v1beta1.Messaging/GetRoom") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/{name=rooms/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Room.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor updateRoomMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.showcase.v1beta1.Messaging/UpdateRoom") + .setHttpMethod("PATCH") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/{room.name=rooms/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "room.name", request.getRoom().getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "updateMask", request.getUpdateMask()); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create().toBody("room", request.getRoom(), false)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Room.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor deleteRoomMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.showcase.v1beta1.Messaging/DeleteRoom") + .setHttpMethod("DELETE") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/{name=rooms/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Empty.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + listRoomsMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.showcase.v1beta1.Messaging/ListRooms") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/rooms", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "pageSize", request.getPageSize()); + serializer.putQueryParam(fields, "pageToken", request.getPageToken()); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(ListRoomsResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor createBlurbMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.showcase.v1beta1.Messaging/CreateBlurb") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/{parent=rooms/*}/blurbs", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "parent", request.getParent()); + return fields; + }) + .setAdditionalPaths("/v1beta1/{parent=users/*/profile}/blurbs") + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("*", request.toBuilder().clearParent().build(), false)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Blurb.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor getBlurbMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.showcase.v1beta1.Messaging/GetBlurb") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/{name=rooms/*/blurbs/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setAdditionalPaths("/v1beta1/{name=users/*/profile/blurbs/*}") + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Blurb.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor updateBlurbMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.showcase.v1beta1.Messaging/UpdateBlurb") + .setHttpMethod("PATCH") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/{blurb.name=rooms/*/blurbs/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "blurb.name", request.getBlurb().getName()); + return fields; + }) + .setAdditionalPaths("/v1beta1/{blurb.name=users/*/profile/blurbs/*}") + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "updateMask", request.getUpdateMask()); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create().toBody("blurb", request.getBlurb(), false)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Blurb.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor deleteBlurbMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.showcase.v1beta1.Messaging/DeleteBlurb") + .setHttpMethod("DELETE") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/{name=rooms/*/blurbs/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setAdditionalPaths("/v1beta1/{name=users/*/profile/blurbs/*}") + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Empty.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + listBlurbsMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.showcase.v1beta1.Messaging/ListBlurbs") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/{parent=rooms/*}/blurbs", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "parent", request.getParent()); + return fields; + }) + .setAdditionalPaths("/v1beta1/{parent=users/*/profile}/blurbs") + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "pageSize", request.getPageSize()); + serializer.putQueryParam(fields, "pageToken", request.getPageToken()); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(ListBlurbsResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + searchBlurbsMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.showcase.v1beta1.Messaging/SearchBlurbs") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/{parent=rooms/*}/blurbs:search", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "parent", request.getParent()); + return fields; + }) + .setAdditionalPaths("/v1beta1/{parent=users/*/profile}/blurbs:search") + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("*", request.toBuilder().clearParent().build(), false)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Operation.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .setOperationSnapshotFactory( + (SearchBlurbsRequest request, Operation response) -> + HttpJsonOperationSnapshot.create(response)) + .build(); + + private static final ApiMethodDescriptor + streamBlurbsMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.showcase.v1beta1.Messaging/StreamBlurbs") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.SERVER_STREAMING) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/{name=rooms/*}/blurbs:stream", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setAdditionalPaths("/v1beta1/{name=users/*/profile}/blurbs:stream") + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("*", request.toBuilder().clearName().build(), false)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(StreamBlurbsResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + listLocationsMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.location.Locations/ListLocations") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/{name=projects/*}/locations", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(ListLocationsResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + getLocationMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.location.Locations/GetLocation") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/{name=projects/*/locations/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Location.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + setIamPolicyMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.iam.v1.IAMPolicy/SetIamPolicy") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/{resource=users/*}:setIamPolicy", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "resource", request.getResource()); + return fields; + }) + .setAdditionalPaths( + "/v1beta1/{resource=rooms/*}:setIamPolicy", + "/v1beta1/{resource=rooms/*/blurbs/*}:setIamPolicy", + "/v1beta1/{resource=sequences/*}:setIamPolicy") + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("*", request.toBuilder().clearResource().build(), false)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Policy.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + getIamPolicyMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.iam.v1.IAMPolicy/GetIamPolicy") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/{resource=users/*}:getIamPolicy", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "resource", request.getResource()); + return fields; + }) + .setAdditionalPaths( + "/v1beta1/{resource=rooms/*}:getIamPolicy", + "/v1beta1/{resource=rooms/*/blurbs/*}:getIamPolicy", + "/v1beta1/{resource=sequences/*}:getIamPolicy") + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Policy.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + testIamPermissionsMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.iam.v1.IAMPolicy/TestIamPermissions") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/{resource=users/*}:testIamPermissions", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "resource", request.getResource()); + return fields; + }) + .setAdditionalPaths( + "/v1beta1/{resource=rooms/*}:testIamPermissions", + "/v1beta1/{resource=rooms/*/blurbs/*}:testIamPermissions", + "/v1beta1/{resource=sequences/*}:testIamPermissions") + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("*", request.toBuilder().clearResource().build(), false)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(TestIamPermissionsResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private final UnaryCallable createRoomCallable; + private final UnaryCallable getRoomCallable; + private final UnaryCallable updateRoomCallable; + private final UnaryCallable deleteRoomCallable; + private final UnaryCallable listRoomsCallable; + private final UnaryCallable listRoomsPagedCallable; + private final UnaryCallable createBlurbCallable; + private final UnaryCallable getBlurbCallable; + private final UnaryCallable updateBlurbCallable; + private final UnaryCallable deleteBlurbCallable; + private final UnaryCallable listBlurbsCallable; + private final UnaryCallable listBlurbsPagedCallable; + private final UnaryCallable searchBlurbsCallable; + private final OperationCallable + searchBlurbsOperationCallable; + private final ServerStreamingCallable + streamBlurbsCallable; + private final UnaryCallable listLocationsCallable; + private final UnaryCallable + listLocationsPagedCallable; + private final UnaryCallable getLocationCallable; + private final UnaryCallable setIamPolicyCallable; + private final UnaryCallable getIamPolicyCallable; + private final UnaryCallable + testIamPermissionsCallable; + + private final BackgroundResource backgroundResources; + private final HttpJsonOperationsStub httpJsonOperationsStub; + private final HttpJsonStubCallableFactory callableFactory; + + public static final HttpJsonMessagingStub create(MessagingStubSettings settings) + throws IOException { + return new HttpJsonMessagingStub(settings, ClientContext.create(settings)); + } + + public static final HttpJsonMessagingStub create(ClientContext clientContext) throws IOException { + return new HttpJsonMessagingStub( + MessagingStubSettings.newHttpJsonBuilder().build(), clientContext); + } + + public static final HttpJsonMessagingStub create( + ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { + return new HttpJsonMessagingStub( + MessagingStubSettings.newHttpJsonBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of HttpJsonMessagingStub, 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 HttpJsonMessagingStub(MessagingStubSettings settings, ClientContext clientContext) + throws IOException { + this(settings, clientContext, new HttpJsonMessagingCallableFactory()); + } + + /** + * Constructs an instance of HttpJsonMessagingStub, 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 HttpJsonMessagingStub( + MessagingStubSettings settings, + ClientContext clientContext, + HttpJsonStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + this.httpJsonOperationsStub = + HttpJsonOperationsStub.create( + clientContext, + callableFactory, + typeRegistry, + ImmutableMap.builder() + .put( + "google.longrunning.Operations.CancelOperation", + HttpRule.newBuilder().setPost("/v1beta1/{name=operations/**}:cancel").build()) + .put( + "google.longrunning.Operations.DeleteOperation", + HttpRule.newBuilder().setDelete("/v1beta1/{name=operations/**}").build()) + .put( + "google.longrunning.Operations.GetOperation", + HttpRule.newBuilder().setGet("/v1beta1/{name=operations/**}").build()) + .put( + "google.longrunning.Operations.ListOperations", + HttpRule.newBuilder().setGet("/v1beta1/operations").build()) + .build()); + + HttpJsonCallSettings createRoomTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(createRoomMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings getRoomTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getRoomMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings updateRoomTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(updateRoomMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("room.name", String.valueOf(request.getRoom().getName())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings deleteRoomTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(deleteRoomMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings listRoomsTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(listRoomsMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings createBlurbTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(createBlurbMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings getBlurbTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getBlurbMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings updateBlurbTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(updateBlurbMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("blurb.name", String.valueOf(request.getBlurb().getName())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings deleteBlurbTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(deleteBlurbMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings listBlurbsTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(listBlurbsMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings searchBlurbsTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(searchBlurbsMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings streamBlurbsTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(streamBlurbsMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings + listLocationsTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(listLocationsMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings getLocationTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getLocationMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings setIamPolicyTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(setIamPolicyMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("resource", String.valueOf(request.getResource())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings getIamPolicyTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getIamPolicyMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("resource", String.valueOf(request.getResource())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings + testIamPermissionsTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(testIamPermissionsMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("resource", String.valueOf(request.getResource())); + return builder.build(); + }) + .build(); + + this.createRoomCallable = + callableFactory.createUnaryCallable( + createRoomTransportSettings, settings.createRoomSettings(), clientContext); + this.getRoomCallable = + callableFactory.createUnaryCallable( + getRoomTransportSettings, settings.getRoomSettings(), clientContext); + this.updateRoomCallable = + callableFactory.createUnaryCallable( + updateRoomTransportSettings, settings.updateRoomSettings(), clientContext); + this.deleteRoomCallable = + callableFactory.createUnaryCallable( + deleteRoomTransportSettings, settings.deleteRoomSettings(), clientContext); + this.listRoomsCallable = + callableFactory.createUnaryCallable( + listRoomsTransportSettings, settings.listRoomsSettings(), clientContext); + this.listRoomsPagedCallable = + callableFactory.createPagedCallable( + listRoomsTransportSettings, settings.listRoomsSettings(), clientContext); + this.createBlurbCallable = + callableFactory.createUnaryCallable( + createBlurbTransportSettings, settings.createBlurbSettings(), clientContext); + this.getBlurbCallable = + callableFactory.createUnaryCallable( + getBlurbTransportSettings, settings.getBlurbSettings(), clientContext); + this.updateBlurbCallable = + callableFactory.createUnaryCallable( + updateBlurbTransportSettings, settings.updateBlurbSettings(), clientContext); + this.deleteBlurbCallable = + callableFactory.createUnaryCallable( + deleteBlurbTransportSettings, settings.deleteBlurbSettings(), clientContext); + this.listBlurbsCallable = + callableFactory.createUnaryCallable( + listBlurbsTransportSettings, settings.listBlurbsSettings(), clientContext); + this.listBlurbsPagedCallable = + callableFactory.createPagedCallable( + listBlurbsTransportSettings, settings.listBlurbsSettings(), clientContext); + this.searchBlurbsCallable = + callableFactory.createUnaryCallable( + searchBlurbsTransportSettings, settings.searchBlurbsSettings(), clientContext); + this.searchBlurbsOperationCallable = + callableFactory.createOperationCallable( + searchBlurbsTransportSettings, + settings.searchBlurbsOperationSettings(), + clientContext, + httpJsonOperationsStub); + this.streamBlurbsCallable = + callableFactory.createServerStreamingCallable( + streamBlurbsTransportSettings, settings.streamBlurbsSettings(), clientContext); + this.listLocationsCallable = + callableFactory.createUnaryCallable( + listLocationsTransportSettings, settings.listLocationsSettings(), clientContext); + this.listLocationsPagedCallable = + callableFactory.createPagedCallable( + listLocationsTransportSettings, settings.listLocationsSettings(), clientContext); + this.getLocationCallable = + callableFactory.createUnaryCallable( + getLocationTransportSettings, settings.getLocationSettings(), clientContext); + this.setIamPolicyCallable = + callableFactory.createUnaryCallable( + setIamPolicyTransportSettings, settings.setIamPolicySettings(), clientContext); + this.getIamPolicyCallable = + callableFactory.createUnaryCallable( + getIamPolicyTransportSettings, settings.getIamPolicySettings(), clientContext); + this.testIamPermissionsCallable = + callableFactory.createUnaryCallable( + testIamPermissionsTransportSettings, + settings.testIamPermissionsSettings(), + clientContext); + + this.backgroundResources = + new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + @InternalApi + public static List getMethodDescriptors() { + List methodDescriptors = new ArrayList<>(); + methodDescriptors.add(createRoomMethodDescriptor); + methodDescriptors.add(getRoomMethodDescriptor); + methodDescriptors.add(updateRoomMethodDescriptor); + methodDescriptors.add(deleteRoomMethodDescriptor); + methodDescriptors.add(listRoomsMethodDescriptor); + methodDescriptors.add(createBlurbMethodDescriptor); + methodDescriptors.add(getBlurbMethodDescriptor); + methodDescriptors.add(updateBlurbMethodDescriptor); + methodDescriptors.add(deleteBlurbMethodDescriptor); + methodDescriptors.add(listBlurbsMethodDescriptor); + methodDescriptors.add(searchBlurbsMethodDescriptor); + methodDescriptors.add(streamBlurbsMethodDescriptor); + methodDescriptors.add(listLocationsMethodDescriptor); + methodDescriptors.add(getLocationMethodDescriptor); + methodDescriptors.add(setIamPolicyMethodDescriptor); + methodDescriptors.add(getIamPolicyMethodDescriptor); + methodDescriptors.add(testIamPermissionsMethodDescriptor); + return methodDescriptors; + } + + public HttpJsonOperationsStub getHttpJsonOperationsStub() { + return httpJsonOperationsStub; + } + + @Override + public UnaryCallable createRoomCallable() { + return createRoomCallable; + } + + @Override + public UnaryCallable getRoomCallable() { + return getRoomCallable; + } + + @Override + public UnaryCallable updateRoomCallable() { + return updateRoomCallable; + } + + @Override + public UnaryCallable deleteRoomCallable() { + return deleteRoomCallable; + } + + @Override + public UnaryCallable listRoomsCallable() { + return listRoomsCallable; + } + + @Override + public UnaryCallable listRoomsPagedCallable() { + return listRoomsPagedCallable; + } + + @Override + public UnaryCallable createBlurbCallable() { + return createBlurbCallable; + } + + @Override + public UnaryCallable getBlurbCallable() { + return getBlurbCallable; + } + + @Override + public UnaryCallable updateBlurbCallable() { + return updateBlurbCallable; + } + + @Override + public UnaryCallable deleteBlurbCallable() { + return deleteBlurbCallable; + } + + @Override + public UnaryCallable listBlurbsCallable() { + return listBlurbsCallable; + } + + @Override + public UnaryCallable listBlurbsPagedCallable() { + return listBlurbsPagedCallable; + } + + @Override + public UnaryCallable searchBlurbsCallable() { + return searchBlurbsCallable; + } + + @Override + public OperationCallable + searchBlurbsOperationCallable() { + return searchBlurbsOperationCallable; + } + + @Override + public ServerStreamingCallable streamBlurbsCallable() { + return streamBlurbsCallable; + } + + @Override + public UnaryCallable listLocationsCallable() { + return listLocationsCallable; + } + + @Override + public UnaryCallable + listLocationsPagedCallable() { + return listLocationsPagedCallable; + } + + @Override + public UnaryCallable getLocationCallable() { + return getLocationCallable; + } + + @Override + public UnaryCallable setIamPolicyCallable() { + return setIamPolicyCallable; + } + + @Override + public UnaryCallable getIamPolicyCallable() { + return getIamPolicyCallable; + } + + @Override + public UnaryCallable + testIamPermissionsCallable() { + return testIamPermissionsCallable; + } + + @Override + public ClientStreamingCallable sendBlurbsCallable() { + throw new UnsupportedOperationException( + "Not implemented: sendBlurbsCallable(). REST transport is not implemented for this method" + + " yet."); + } + + @Override + public BidiStreamingCallable connectCallable() { + throw new UnsupportedOperationException( + "Not implemented: connectCallable(). REST transport is not implemented for this method" + + " yet."); + } + + @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-showcase-3.21.0/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/HttpJsonSequenceServiceCallableFactory.java b/java-showcase-3.21.0/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/HttpJsonSequenceServiceCallableFactory.java new file mode 100644 index 0000000000..9f2c729229 --- /dev/null +++ b/java-showcase-3.21.0/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/HttpJsonSequenceServiceCallableFactory.java @@ -0,0 +1,103 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.stub; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.HttpJsonCallSettings; +import com.google.api.gax.httpjson.HttpJsonCallableFactory; +import com.google.api.gax.httpjson.HttpJsonOperationSnapshotCallable; +import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; +import com.google.api.gax.httpjson.longrunning.stub.OperationsStub; +import com.google.api.gax.rpc.BatchingCallSettings; +import com.google.api.gax.rpc.ClientContext; +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.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.longrunning.Operation; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * REST callable factory implementation for the SequenceService service API. + * + *

        This class is for advanced usage. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class HttpJsonSequenceServiceCallableFactory + implements HttpJsonStubCallableFactory { + + @Override + public UnaryCallable createUnaryCallable( + HttpJsonCallSettings httpJsonCallSettings, + UnaryCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createUnaryCallable( + httpJsonCallSettings, callSettings, clientContext); + } + + @Override + public + UnaryCallable createPagedCallable( + HttpJsonCallSettings httpJsonCallSettings, + PagedCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createPagedCallable( + httpJsonCallSettings, callSettings, clientContext); + } + + @Override + public UnaryCallable createBatchingCallable( + HttpJsonCallSettings httpJsonCallSettings, + BatchingCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createBatchingCallable( + httpJsonCallSettings, callSettings, clientContext); + } + + @Override + public + OperationCallable createOperationCallable( + HttpJsonCallSettings httpJsonCallSettings, + OperationCallSettings callSettings, + ClientContext clientContext, + OperationsStub operationsStub) { + UnaryCallable innerCallable = + HttpJsonCallableFactory.createBaseUnaryCallable( + httpJsonCallSettings, callSettings.getInitialCallSettings(), clientContext); + HttpJsonOperationSnapshotCallable initialCallable = + new HttpJsonOperationSnapshotCallable( + innerCallable, + httpJsonCallSettings.getMethodDescriptor().getOperationSnapshotFactory()); + return HttpJsonCallableFactory.createOperationCallable( + callSettings, clientContext, operationsStub.longRunningClient(), initialCallable); + } + + @Override + public + ServerStreamingCallable createServerStreamingCallable( + HttpJsonCallSettings httpJsonCallSettings, + ServerStreamingCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createServerStreamingCallable( + httpJsonCallSettings, callSettings, clientContext); + } +} diff --git a/java-showcase-3.21.0/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/HttpJsonSequenceServiceStub.java b/java-showcase-3.21.0/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/HttpJsonSequenceServiceStub.java new file mode 100644 index 0000000000..2c7a3b5e26 --- /dev/null +++ b/java-showcase-3.21.0/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/HttpJsonSequenceServiceStub.java @@ -0,0 +1,820 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.stub; + +import static com.google.showcase.v1beta1.SequenceServiceClient.ListLocationsPagedResponse; + +import com.google.api.core.BetaApi; +import com.google.api.core.InternalApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.httpjson.ApiMethodDescriptor; +import com.google.api.gax.httpjson.HttpJsonCallSettings; +import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; +import com.google.api.gax.httpjson.ProtoMessageRequestFormatter; +import com.google.api.gax.httpjson.ProtoMessageResponseParser; +import com.google.api.gax.httpjson.ProtoRestSerializer; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.RequestParamsBuilder; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.protobuf.Empty; +import com.google.protobuf.TypeRegistry; +import com.google.showcase.v1beta1.AttemptSequenceRequest; +import com.google.showcase.v1beta1.AttemptStreamingSequenceRequest; +import com.google.showcase.v1beta1.AttemptStreamingSequenceResponse; +import com.google.showcase.v1beta1.CreateSequenceRequest; +import com.google.showcase.v1beta1.CreateStreamingSequenceRequest; +import com.google.showcase.v1beta1.GetSequenceReportRequest; +import com.google.showcase.v1beta1.GetStreamingSequenceReportRequest; +import com.google.showcase.v1beta1.Sequence; +import com.google.showcase.v1beta1.SequenceReport; +import com.google.showcase.v1beta1.StreamingSequence; +import com.google.showcase.v1beta1.StreamingSequenceReport; +import java.io.IOException; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * REST stub implementation for the SequenceService service API. + * + *

        This class is for advanced usage and reflects the underlying API directly. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class HttpJsonSequenceServiceStub extends SequenceServiceStub { + private static final TypeRegistry typeRegistry = TypeRegistry.newBuilder().build(); + + private static final ApiMethodDescriptor + createSequenceMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.showcase.v1beta1.SequenceService/CreateSequence") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/sequences", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("sequence", request.getSequence(), false)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Sequence.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + createStreamingSequenceMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.showcase.v1beta1.SequenceService/CreateStreamingSequence") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/streamingSequences", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody( + "streamingSequence", request.getStreamingSequence(), false)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(StreamingSequence.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + getSequenceReportMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.showcase.v1beta1.SequenceService/GetSequenceReport") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/{name=sequences/*/sequenceReport}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(SequenceReport.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor< + GetStreamingSequenceReportRequest, StreamingSequenceReport> + getStreamingSequenceReportMethodDescriptor = + ApiMethodDescriptor + .newBuilder() + .setFullMethodName( + "google.showcase.v1beta1.SequenceService/GetStreamingSequenceReport") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/{name=streamingSequences/*/streamingSequenceReport}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(StreamingSequenceReport.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + attemptSequenceMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.showcase.v1beta1.SequenceService/AttemptSequence") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/{name=sequences/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("*", request.toBuilder().clearName().build(), false)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Empty.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor< + AttemptStreamingSequenceRequest, AttemptStreamingSequenceResponse> + attemptStreamingSequenceMethodDescriptor = + ApiMethodDescriptor + .newBuilder() + .setFullMethodName("google.showcase.v1beta1.SequenceService/AttemptStreamingSequence") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.SERVER_STREAMING) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/{name=streamingSequences/*}:stream", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("*", request.toBuilder().clearName().build(), false)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(AttemptStreamingSequenceResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + listLocationsMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.location.Locations/ListLocations") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/{name=projects/*}/locations", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(ListLocationsResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + getLocationMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.location.Locations/GetLocation") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/{name=projects/*/locations/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Location.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + setIamPolicyMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.iam.v1.IAMPolicy/SetIamPolicy") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/{resource=users/*}:setIamPolicy", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "resource", request.getResource()); + return fields; + }) + .setAdditionalPaths( + "/v1beta1/{resource=rooms/*}:setIamPolicy", + "/v1beta1/{resource=rooms/*/blurbs/*}:setIamPolicy", + "/v1beta1/{resource=sequences/*}:setIamPolicy") + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("*", request.toBuilder().clearResource().build(), false)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Policy.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + getIamPolicyMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.iam.v1.IAMPolicy/GetIamPolicy") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/{resource=users/*}:getIamPolicy", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "resource", request.getResource()); + return fields; + }) + .setAdditionalPaths( + "/v1beta1/{resource=rooms/*}:getIamPolicy", + "/v1beta1/{resource=rooms/*/blurbs/*}:getIamPolicy", + "/v1beta1/{resource=sequences/*}:getIamPolicy") + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Policy.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + testIamPermissionsMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.iam.v1.IAMPolicy/TestIamPermissions") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/{resource=users/*}:testIamPermissions", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "resource", request.getResource()); + return fields; + }) + .setAdditionalPaths( + "/v1beta1/{resource=rooms/*}:testIamPermissions", + "/v1beta1/{resource=rooms/*/blurbs/*}:testIamPermissions", + "/v1beta1/{resource=sequences/*}:testIamPermissions") + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("*", request.toBuilder().clearResource().build(), false)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(TestIamPermissionsResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private final UnaryCallable createSequenceCallable; + private final UnaryCallable + createStreamingSequenceCallable; + private final UnaryCallable getSequenceReportCallable; + private final UnaryCallable + getStreamingSequenceReportCallable; + private final UnaryCallable attemptSequenceCallable; + private final ServerStreamingCallable< + AttemptStreamingSequenceRequest, AttemptStreamingSequenceResponse> + attemptStreamingSequenceCallable; + private final UnaryCallable listLocationsCallable; + private final UnaryCallable + listLocationsPagedCallable; + private final UnaryCallable getLocationCallable; + private final UnaryCallable setIamPolicyCallable; + private final UnaryCallable getIamPolicyCallable; + private final UnaryCallable + testIamPermissionsCallable; + + private final BackgroundResource backgroundResources; + private final HttpJsonStubCallableFactory callableFactory; + + public static final HttpJsonSequenceServiceStub create(SequenceServiceStubSettings settings) + throws IOException { + return new HttpJsonSequenceServiceStub(settings, ClientContext.create(settings)); + } + + public static final HttpJsonSequenceServiceStub create(ClientContext clientContext) + throws IOException { + return new HttpJsonSequenceServiceStub( + SequenceServiceStubSettings.newHttpJsonBuilder().build(), clientContext); + } + + public static final HttpJsonSequenceServiceStub create( + ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { + return new HttpJsonSequenceServiceStub( + SequenceServiceStubSettings.newHttpJsonBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of HttpJsonSequenceServiceStub, 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 HttpJsonSequenceServiceStub( + SequenceServiceStubSettings settings, ClientContext clientContext) throws IOException { + this(settings, clientContext, new HttpJsonSequenceServiceCallableFactory()); + } + + /** + * Constructs an instance of HttpJsonSequenceServiceStub, 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 HttpJsonSequenceServiceStub( + SequenceServiceStubSettings settings, + ClientContext clientContext, + HttpJsonStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + + HttpJsonCallSettings createSequenceTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(createSequenceMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings + createStreamingSequenceTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(createStreamingSequenceMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings + getSequenceReportTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getSequenceReportMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings + getStreamingSequenceReportTransportSettings = + HttpJsonCallSettings + .newBuilder() + .setMethodDescriptor(getStreamingSequenceReportMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings attemptSequenceTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(attemptSequenceMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings + attemptStreamingSequenceTransportSettings = + HttpJsonCallSettings + .newBuilder() + .setMethodDescriptor(attemptStreamingSequenceMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings + listLocationsTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(listLocationsMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings getLocationTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getLocationMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings setIamPolicyTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(setIamPolicyMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("resource", String.valueOf(request.getResource())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings getIamPolicyTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getIamPolicyMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("resource", String.valueOf(request.getResource())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings + testIamPermissionsTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(testIamPermissionsMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("resource", String.valueOf(request.getResource())); + return builder.build(); + }) + .build(); + + this.createSequenceCallable = + callableFactory.createUnaryCallable( + createSequenceTransportSettings, settings.createSequenceSettings(), clientContext); + this.createStreamingSequenceCallable = + callableFactory.createUnaryCallable( + createStreamingSequenceTransportSettings, + settings.createStreamingSequenceSettings(), + clientContext); + this.getSequenceReportCallable = + callableFactory.createUnaryCallable( + getSequenceReportTransportSettings, + settings.getSequenceReportSettings(), + clientContext); + this.getStreamingSequenceReportCallable = + callableFactory.createUnaryCallable( + getStreamingSequenceReportTransportSettings, + settings.getStreamingSequenceReportSettings(), + clientContext); + this.attemptSequenceCallable = + callableFactory.createUnaryCallable( + attemptSequenceTransportSettings, settings.attemptSequenceSettings(), clientContext); + this.attemptStreamingSequenceCallable = + callableFactory.createServerStreamingCallable( + attemptStreamingSequenceTransportSettings, + settings.attemptStreamingSequenceSettings(), + clientContext); + this.listLocationsCallable = + callableFactory.createUnaryCallable( + listLocationsTransportSettings, settings.listLocationsSettings(), clientContext); + this.listLocationsPagedCallable = + callableFactory.createPagedCallable( + listLocationsTransportSettings, settings.listLocationsSettings(), clientContext); + this.getLocationCallable = + callableFactory.createUnaryCallable( + getLocationTransportSettings, settings.getLocationSettings(), clientContext); + this.setIamPolicyCallable = + callableFactory.createUnaryCallable( + setIamPolicyTransportSettings, settings.setIamPolicySettings(), clientContext); + this.getIamPolicyCallable = + callableFactory.createUnaryCallable( + getIamPolicyTransportSettings, settings.getIamPolicySettings(), clientContext); + this.testIamPermissionsCallable = + callableFactory.createUnaryCallable( + testIamPermissionsTransportSettings, + settings.testIamPermissionsSettings(), + clientContext); + + this.backgroundResources = + new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + @InternalApi + public static List getMethodDescriptors() { + List methodDescriptors = new ArrayList<>(); + methodDescriptors.add(createSequenceMethodDescriptor); + methodDescriptors.add(createStreamingSequenceMethodDescriptor); + methodDescriptors.add(getSequenceReportMethodDescriptor); + methodDescriptors.add(getStreamingSequenceReportMethodDescriptor); + methodDescriptors.add(attemptSequenceMethodDescriptor); + methodDescriptors.add(attemptStreamingSequenceMethodDescriptor); + methodDescriptors.add(listLocationsMethodDescriptor); + methodDescriptors.add(getLocationMethodDescriptor); + methodDescriptors.add(setIamPolicyMethodDescriptor); + methodDescriptors.add(getIamPolicyMethodDescriptor); + methodDescriptors.add(testIamPermissionsMethodDescriptor); + return methodDescriptors; + } + + @Override + public UnaryCallable createSequenceCallable() { + return createSequenceCallable; + } + + @Override + public UnaryCallable + createStreamingSequenceCallable() { + return createStreamingSequenceCallable; + } + + @Override + public UnaryCallable getSequenceReportCallable() { + return getSequenceReportCallable; + } + + @Override + public UnaryCallable + getStreamingSequenceReportCallable() { + return getStreamingSequenceReportCallable; + } + + @Override + public UnaryCallable attemptSequenceCallable() { + return attemptSequenceCallable; + } + + @Override + public ServerStreamingCallable + attemptStreamingSequenceCallable() { + return attemptStreamingSequenceCallable; + } + + @Override + public UnaryCallable listLocationsCallable() { + return listLocationsCallable; + } + + @Override + public UnaryCallable + listLocationsPagedCallable() { + return listLocationsPagedCallable; + } + + @Override + public UnaryCallable getLocationCallable() { + return getLocationCallable; + } + + @Override + public UnaryCallable setIamPolicyCallable() { + return setIamPolicyCallable; + } + + @Override + public UnaryCallable getIamPolicyCallable() { + return getIamPolicyCallable; + } + + @Override + public UnaryCallable + testIamPermissionsCallable() { + return testIamPermissionsCallable; + } + + @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-showcase-3.21.0/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/HttpJsonTestingCallableFactory.java b/java-showcase-3.21.0/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/HttpJsonTestingCallableFactory.java new file mode 100644 index 0000000000..fc3e0297b0 --- /dev/null +++ b/java-showcase-3.21.0/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/HttpJsonTestingCallableFactory.java @@ -0,0 +1,103 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.stub; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.HttpJsonCallSettings; +import com.google.api.gax.httpjson.HttpJsonCallableFactory; +import com.google.api.gax.httpjson.HttpJsonOperationSnapshotCallable; +import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; +import com.google.api.gax.httpjson.longrunning.stub.OperationsStub; +import com.google.api.gax.rpc.BatchingCallSettings; +import com.google.api.gax.rpc.ClientContext; +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.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.longrunning.Operation; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * REST callable factory implementation for the Testing service API. + * + *

        This class is for advanced usage. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class HttpJsonTestingCallableFactory + implements HttpJsonStubCallableFactory { + + @Override + public UnaryCallable createUnaryCallable( + HttpJsonCallSettings httpJsonCallSettings, + UnaryCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createUnaryCallable( + httpJsonCallSettings, callSettings, clientContext); + } + + @Override + public + UnaryCallable createPagedCallable( + HttpJsonCallSettings httpJsonCallSettings, + PagedCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createPagedCallable( + httpJsonCallSettings, callSettings, clientContext); + } + + @Override + public UnaryCallable createBatchingCallable( + HttpJsonCallSettings httpJsonCallSettings, + BatchingCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createBatchingCallable( + httpJsonCallSettings, callSettings, clientContext); + } + + @Override + public + OperationCallable createOperationCallable( + HttpJsonCallSettings httpJsonCallSettings, + OperationCallSettings callSettings, + ClientContext clientContext, + OperationsStub operationsStub) { + UnaryCallable innerCallable = + HttpJsonCallableFactory.createBaseUnaryCallable( + httpJsonCallSettings, callSettings.getInitialCallSettings(), clientContext); + HttpJsonOperationSnapshotCallable initialCallable = + new HttpJsonOperationSnapshotCallable( + innerCallable, + httpJsonCallSettings.getMethodDescriptor().getOperationSnapshotFactory()); + return HttpJsonCallableFactory.createOperationCallable( + callSettings, clientContext, operationsStub.longRunningClient(), initialCallable); + } + + @Override + public + ServerStreamingCallable createServerStreamingCallable( + HttpJsonCallSettings httpJsonCallSettings, + ServerStreamingCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createServerStreamingCallable( + httpJsonCallSettings, callSettings, clientContext); + } +} diff --git a/java-showcase-3.21.0/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/HttpJsonTestingStub.java b/java-showcase-3.21.0/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/HttpJsonTestingStub.java new file mode 100644 index 0000000000..11d87107de --- /dev/null +++ b/java-showcase-3.21.0/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/HttpJsonTestingStub.java @@ -0,0 +1,916 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.stub; + +import static com.google.showcase.v1beta1.TestingClient.ListLocationsPagedResponse; +import static com.google.showcase.v1beta1.TestingClient.ListSessionsPagedResponse; +import static com.google.showcase.v1beta1.TestingClient.ListTestsPagedResponse; + +import com.google.api.core.BetaApi; +import com.google.api.core.InternalApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.httpjson.ApiMethodDescriptor; +import com.google.api.gax.httpjson.HttpJsonCallSettings; +import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; +import com.google.api.gax.httpjson.ProtoMessageRequestFormatter; +import com.google.api.gax.httpjson.ProtoMessageResponseParser; +import com.google.api.gax.httpjson.ProtoRestSerializer; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.RequestParamsBuilder; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.protobuf.Empty; +import com.google.protobuf.TypeRegistry; +import com.google.showcase.v1beta1.CreateSessionRequest; +import com.google.showcase.v1beta1.DeleteSessionRequest; +import com.google.showcase.v1beta1.DeleteTestRequest; +import com.google.showcase.v1beta1.GetSessionRequest; +import com.google.showcase.v1beta1.ListSessionsRequest; +import com.google.showcase.v1beta1.ListSessionsResponse; +import com.google.showcase.v1beta1.ListTestsRequest; +import com.google.showcase.v1beta1.ListTestsResponse; +import com.google.showcase.v1beta1.ReportSessionRequest; +import com.google.showcase.v1beta1.ReportSessionResponse; +import com.google.showcase.v1beta1.Session; +import com.google.showcase.v1beta1.VerifyTestRequest; +import com.google.showcase.v1beta1.VerifyTestResponse; +import java.io.IOException; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * REST stub implementation for the Testing service API. + * + *

        This class is for advanced usage and reflects the underlying API directly. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class HttpJsonTestingStub extends TestingStub { + private static final TypeRegistry typeRegistry = TypeRegistry.newBuilder().build(); + + private static final ApiMethodDescriptor + createSessionMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.showcase.v1beta1.Testing/CreateSession") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/sessions", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("session", request.getSession(), false)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Session.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor getSessionMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.showcase.v1beta1.Testing/GetSession") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/{name=sessions/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Session.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + listSessionsMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.showcase.v1beta1.Testing/ListSessions") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/sessions", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "pageSize", request.getPageSize()); + serializer.putQueryParam(fields, "pageToken", request.getPageToken()); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(ListSessionsResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + deleteSessionMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.showcase.v1beta1.Testing/DeleteSession") + .setHttpMethod("DELETE") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/{name=sessions/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Empty.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + reportSessionMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.showcase.v1beta1.Testing/ReportSession") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/{name=sessions/*}:report", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(ReportSessionResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + listTestsMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.showcase.v1beta1.Testing/ListTests") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/{parent=sessions/*}/tests", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "parent", request.getParent()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "pageSize", request.getPageSize()); + serializer.putQueryParam(fields, "pageToken", request.getPageToken()); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(ListTestsResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor deleteTestMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.showcase.v1beta1.Testing/DeleteTest") + .setHttpMethod("DELETE") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/{name=sessions/*/tests/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Empty.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + verifyTestMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.showcase.v1beta1.Testing/VerifyTest") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/{name=sessions/*/tests/*}:check", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "answer", request.getAnswer()); + serializer.putQueryParam(fields, "answers", request.getAnswersList()); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(VerifyTestResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + listLocationsMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.location.Locations/ListLocations") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/{name=projects/*}/locations", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(ListLocationsResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + getLocationMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.location.Locations/GetLocation") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/{name=projects/*/locations/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Location.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + setIamPolicyMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.iam.v1.IAMPolicy/SetIamPolicy") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/{resource=users/*}:setIamPolicy", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "resource", request.getResource()); + return fields; + }) + .setAdditionalPaths( + "/v1beta1/{resource=rooms/*}:setIamPolicy", + "/v1beta1/{resource=rooms/*/blurbs/*}:setIamPolicy", + "/v1beta1/{resource=sequences/*}:setIamPolicy") + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("*", request.toBuilder().clearResource().build(), false)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Policy.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + getIamPolicyMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.iam.v1.IAMPolicy/GetIamPolicy") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/{resource=users/*}:getIamPolicy", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "resource", request.getResource()); + return fields; + }) + .setAdditionalPaths( + "/v1beta1/{resource=rooms/*}:getIamPolicy", + "/v1beta1/{resource=rooms/*/blurbs/*}:getIamPolicy", + "/v1beta1/{resource=sequences/*}:getIamPolicy") + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Policy.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + testIamPermissionsMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.iam.v1.IAMPolicy/TestIamPermissions") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/{resource=users/*}:testIamPermissions", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "resource", request.getResource()); + return fields; + }) + .setAdditionalPaths( + "/v1beta1/{resource=rooms/*}:testIamPermissions", + "/v1beta1/{resource=rooms/*/blurbs/*}:testIamPermissions", + "/v1beta1/{resource=sequences/*}:testIamPermissions") + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("*", request.toBuilder().clearResource().build(), false)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(TestIamPermissionsResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private final UnaryCallable createSessionCallable; + private final UnaryCallable getSessionCallable; + private final UnaryCallable listSessionsCallable; + private final UnaryCallable + listSessionsPagedCallable; + private final UnaryCallable deleteSessionCallable; + private final UnaryCallable reportSessionCallable; + private final UnaryCallable listTestsCallable; + private final UnaryCallable listTestsPagedCallable; + private final UnaryCallable deleteTestCallable; + private final UnaryCallable verifyTestCallable; + private final UnaryCallable listLocationsCallable; + private final UnaryCallable + listLocationsPagedCallable; + private final UnaryCallable getLocationCallable; + private final UnaryCallable setIamPolicyCallable; + private final UnaryCallable getIamPolicyCallable; + private final UnaryCallable + testIamPermissionsCallable; + + private final BackgroundResource backgroundResources; + private final HttpJsonStubCallableFactory callableFactory; + + public static final HttpJsonTestingStub create(TestingStubSettings settings) throws IOException { + return new HttpJsonTestingStub(settings, ClientContext.create(settings)); + } + + public static final HttpJsonTestingStub create(ClientContext clientContext) throws IOException { + return new HttpJsonTestingStub(TestingStubSettings.newHttpJsonBuilder().build(), clientContext); + } + + public static final HttpJsonTestingStub create( + ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { + return new HttpJsonTestingStub( + TestingStubSettings.newHttpJsonBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of HttpJsonTestingStub, 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 HttpJsonTestingStub(TestingStubSettings settings, ClientContext clientContext) + throws IOException { + this(settings, clientContext, new HttpJsonTestingCallableFactory()); + } + + /** + * Constructs an instance of HttpJsonTestingStub, 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 HttpJsonTestingStub( + TestingStubSettings settings, + ClientContext clientContext, + HttpJsonStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + + HttpJsonCallSettings createSessionTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(createSessionMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings getSessionTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getSessionMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings listSessionsTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(listSessionsMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings deleteSessionTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(deleteSessionMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings + reportSessionTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(reportSessionMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings listTestsTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(listTestsMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings deleteTestTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(deleteTestMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings verifyTestTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(verifyTestMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings + listLocationsTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(listLocationsMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings getLocationTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getLocationMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings setIamPolicyTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(setIamPolicyMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("resource", String.valueOf(request.getResource())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings getIamPolicyTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getIamPolicyMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("resource", String.valueOf(request.getResource())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings + testIamPermissionsTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(testIamPermissionsMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("resource", String.valueOf(request.getResource())); + return builder.build(); + }) + .build(); + + this.createSessionCallable = + callableFactory.createUnaryCallable( + createSessionTransportSettings, settings.createSessionSettings(), clientContext); + this.getSessionCallable = + callableFactory.createUnaryCallable( + getSessionTransportSettings, settings.getSessionSettings(), clientContext); + this.listSessionsCallable = + callableFactory.createUnaryCallable( + listSessionsTransportSettings, settings.listSessionsSettings(), clientContext); + this.listSessionsPagedCallable = + callableFactory.createPagedCallable( + listSessionsTransportSettings, settings.listSessionsSettings(), clientContext); + this.deleteSessionCallable = + callableFactory.createUnaryCallable( + deleteSessionTransportSettings, settings.deleteSessionSettings(), clientContext); + this.reportSessionCallable = + callableFactory.createUnaryCallable( + reportSessionTransportSettings, settings.reportSessionSettings(), clientContext); + this.listTestsCallable = + callableFactory.createUnaryCallable( + listTestsTransportSettings, settings.listTestsSettings(), clientContext); + this.listTestsPagedCallable = + callableFactory.createPagedCallable( + listTestsTransportSettings, settings.listTestsSettings(), clientContext); + this.deleteTestCallable = + callableFactory.createUnaryCallable( + deleteTestTransportSettings, settings.deleteTestSettings(), clientContext); + this.verifyTestCallable = + callableFactory.createUnaryCallable( + verifyTestTransportSettings, settings.verifyTestSettings(), clientContext); + this.listLocationsCallable = + callableFactory.createUnaryCallable( + listLocationsTransportSettings, settings.listLocationsSettings(), clientContext); + this.listLocationsPagedCallable = + callableFactory.createPagedCallable( + listLocationsTransportSettings, settings.listLocationsSettings(), clientContext); + this.getLocationCallable = + callableFactory.createUnaryCallable( + getLocationTransportSettings, settings.getLocationSettings(), clientContext); + this.setIamPolicyCallable = + callableFactory.createUnaryCallable( + setIamPolicyTransportSettings, settings.setIamPolicySettings(), clientContext); + this.getIamPolicyCallable = + callableFactory.createUnaryCallable( + getIamPolicyTransportSettings, settings.getIamPolicySettings(), clientContext); + this.testIamPermissionsCallable = + callableFactory.createUnaryCallable( + testIamPermissionsTransportSettings, + settings.testIamPermissionsSettings(), + clientContext); + + this.backgroundResources = + new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + @InternalApi + public static List getMethodDescriptors() { + List methodDescriptors = new ArrayList<>(); + methodDescriptors.add(createSessionMethodDescriptor); + methodDescriptors.add(getSessionMethodDescriptor); + methodDescriptors.add(listSessionsMethodDescriptor); + methodDescriptors.add(deleteSessionMethodDescriptor); + methodDescriptors.add(reportSessionMethodDescriptor); + methodDescriptors.add(listTestsMethodDescriptor); + methodDescriptors.add(deleteTestMethodDescriptor); + methodDescriptors.add(verifyTestMethodDescriptor); + methodDescriptors.add(listLocationsMethodDescriptor); + methodDescriptors.add(getLocationMethodDescriptor); + methodDescriptors.add(setIamPolicyMethodDescriptor); + methodDescriptors.add(getIamPolicyMethodDescriptor); + methodDescriptors.add(testIamPermissionsMethodDescriptor); + return methodDescriptors; + } + + @Override + public UnaryCallable createSessionCallable() { + return createSessionCallable; + } + + @Override + public UnaryCallable getSessionCallable() { + return getSessionCallable; + } + + @Override + public UnaryCallable listSessionsCallable() { + return listSessionsCallable; + } + + @Override + public UnaryCallable listSessionsPagedCallable() { + return listSessionsPagedCallable; + } + + @Override + public UnaryCallable deleteSessionCallable() { + return deleteSessionCallable; + } + + @Override + public UnaryCallable reportSessionCallable() { + return reportSessionCallable; + } + + @Override + public UnaryCallable listTestsCallable() { + return listTestsCallable; + } + + @Override + public UnaryCallable listTestsPagedCallable() { + return listTestsPagedCallable; + } + + @Override + public UnaryCallable deleteTestCallable() { + return deleteTestCallable; + } + + @Override + public UnaryCallable verifyTestCallable() { + return verifyTestCallable; + } + + @Override + public UnaryCallable listLocationsCallable() { + return listLocationsCallable; + } + + @Override + public UnaryCallable + listLocationsPagedCallable() { + return listLocationsPagedCallable; + } + + @Override + public UnaryCallable getLocationCallable() { + return getLocationCallable; + } + + @Override + public UnaryCallable setIamPolicyCallable() { + return setIamPolicyCallable; + } + + @Override + public UnaryCallable getIamPolicyCallable() { + return getIamPolicyCallable; + } + + @Override + public UnaryCallable + testIamPermissionsCallable() { + return testIamPermissionsCallable; + } + + @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-showcase-3.21.0/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/IdentityStub.java b/java-showcase-3.21.0/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/IdentityStub.java new file mode 100644 index 0000000000..0993f240a7 --- /dev/null +++ b/java-showcase-3.21.0/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/IdentityStub.java @@ -0,0 +1,106 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.stub; + +import static com.google.showcase.v1beta1.IdentityClient.ListLocationsPagedResponse; +import static com.google.showcase.v1beta1.IdentityClient.ListUsersPagedResponse; + +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.protobuf.Empty; +import com.google.showcase.v1beta1.CreateUserRequest; +import com.google.showcase.v1beta1.DeleteUserRequest; +import com.google.showcase.v1beta1.GetUserRequest; +import com.google.showcase.v1beta1.ListUsersRequest; +import com.google.showcase.v1beta1.ListUsersResponse; +import com.google.showcase.v1beta1.UpdateUserRequest; +import com.google.showcase.v1beta1.User; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Base stub class for the Identity service API. + * + *

        This class is for advanced usage and reflects the underlying API directly. + */ +@BetaApi +@Generated("by gapic-generator-java") +public abstract class IdentityStub implements BackgroundResource { + + public UnaryCallable createUserCallable() { + throw new UnsupportedOperationException("Not implemented: createUserCallable()"); + } + + public UnaryCallable getUserCallable() { + throw new UnsupportedOperationException("Not implemented: getUserCallable()"); + } + + public UnaryCallable updateUserCallable() { + throw new UnsupportedOperationException("Not implemented: updateUserCallable()"); + } + + public UnaryCallable deleteUserCallable() { + throw new UnsupportedOperationException("Not implemented: deleteUserCallable()"); + } + + public UnaryCallable listUsersPagedCallable() { + throw new UnsupportedOperationException("Not implemented: listUsersPagedCallable()"); + } + + public UnaryCallable listUsersCallable() { + throw new UnsupportedOperationException("Not implemented: listUsersCallable()"); + } + + public UnaryCallable + listLocationsPagedCallable() { + throw new UnsupportedOperationException("Not implemented: listLocationsPagedCallable()"); + } + + public UnaryCallable listLocationsCallable() { + throw new UnsupportedOperationException("Not implemented: listLocationsCallable()"); + } + + public UnaryCallable getLocationCallable() { + throw new UnsupportedOperationException("Not implemented: getLocationCallable()"); + } + + public UnaryCallable setIamPolicyCallable() { + throw new UnsupportedOperationException("Not implemented: setIamPolicyCallable()"); + } + + public UnaryCallable getIamPolicyCallable() { + throw new UnsupportedOperationException("Not implemented: getIamPolicyCallable()"); + } + + public UnaryCallable + testIamPermissionsCallable() { + throw new UnsupportedOperationException("Not implemented: testIamPermissionsCallable()"); + } + + @Override + public abstract void close(); +} diff --git a/java-showcase-3.21.0/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/IdentityStubSettings.java b/java-showcase-3.21.0/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/IdentityStubSettings.java new file mode 100644 index 0000000000..3415264909 --- /dev/null +++ b/java-showcase-3.21.0/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/IdentityStubSettings.java @@ -0,0 +1,682 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.stub; + +import static com.google.showcase.v1beta1.IdentityClient.ListLocationsPagedResponse; +import static com.google.showcase.v1beta1.IdentityClient.ListUsersPagedResponse; + +import com.google.api.core.ApiFunction; +import com.google.api.core.ApiFuture; +import com.google.api.core.BetaApi; +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.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.HttpJsonTransportChannel; +import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; +import com.google.api.gax.retrying.RetrySettings; +import com.google.api.gax.rpc.ApiCallContext; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.PagedListDescriptor; +import com.google.api.gax.rpc.PagedListResponseFactory; +import com.google.api.gax.rpc.StatusCode; +import com.google.api.gax.rpc.StubSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +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.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.protobuf.Empty; +import com.google.showcase.v1beta1.CreateUserRequest; +import com.google.showcase.v1beta1.DeleteUserRequest; +import com.google.showcase.v1beta1.GetUserRequest; +import com.google.showcase.v1beta1.ListUsersRequest; +import com.google.showcase.v1beta1.ListUsersResponse; +import com.google.showcase.v1beta1.UpdateUserRequest; +import com.google.showcase.v1beta1.User; +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 IdentityStub}. + * + *

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

          + *
        • The default service address (localhost) and default port (7469) 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 createUser: + * + *

        {@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
        + * IdentityStubSettings.Builder identitySettingsBuilder = IdentityStubSettings.newBuilder();
        + * identitySettingsBuilder
        + *     .createUserSettings()
        + *     .setRetrySettings(
        + *         identitySettingsBuilder
        + *             .createUserSettings()
        + *             .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());
        + * IdentityStubSettings identitySettings = identitySettingsBuilder.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. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class IdentityStubSettings extends StubSettings { + /** The default scopes of the service. */ + private static final ImmutableList DEFAULT_SERVICE_SCOPES = + ImmutableList.builder().build(); + + private final UnaryCallSettings createUserSettings; + private final UnaryCallSettings getUserSettings; + private final UnaryCallSettings updateUserSettings; + private final UnaryCallSettings deleteUserSettings; + private final PagedCallSettings + listUsersSettings; + private final PagedCallSettings< + ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse> + listLocationsSettings; + private final UnaryCallSettings getLocationSettings; + private final UnaryCallSettings setIamPolicySettings; + private final UnaryCallSettings getIamPolicySettings; + private final UnaryCallSettings + testIamPermissionsSettings; + + private static final PagedListDescriptor + LIST_USERS_PAGE_STR_DESC = + new PagedListDescriptor() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public ListUsersRequest injectToken(ListUsersRequest payload, String token) { + return ListUsersRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public ListUsersRequest injectPageSize(ListUsersRequest payload, int pageSize) { + return ListUsersRequest.newBuilder(payload).setPageSize(pageSize).build(); + } + + @Override + public Integer extractPageSize(ListUsersRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(ListUsersResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources(ListUsersResponse payload) { + return payload.getUsersList(); + } + }; + + private static final PagedListDescriptor + LIST_LOCATIONS_PAGE_STR_DESC = + new PagedListDescriptor() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public ListLocationsRequest injectToken(ListLocationsRequest payload, String token) { + return ListLocationsRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public ListLocationsRequest injectPageSize(ListLocationsRequest payload, int pageSize) { + return ListLocationsRequest.newBuilder(payload).setPageSize(pageSize).build(); + } + + @Override + public Integer extractPageSize(ListLocationsRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(ListLocationsResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources(ListLocationsResponse payload) { + return payload.getLocationsList(); + } + }; + + private static final PagedListResponseFactory< + ListUsersRequest, ListUsersResponse, ListUsersPagedResponse> + LIST_USERS_PAGE_STR_FACT = + new PagedListResponseFactory< + ListUsersRequest, ListUsersResponse, ListUsersPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListUsersRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext pageContext = + PageContext.create(callable, LIST_USERS_PAGE_STR_DESC, request, context); + return ListUsersPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + private static final PagedListResponseFactory< + ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse> + LIST_LOCATIONS_PAGE_STR_FACT = + new PagedListResponseFactory< + ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListLocationsRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext pageContext = + PageContext.create(callable, LIST_LOCATIONS_PAGE_STR_DESC, request, context); + return ListLocationsPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + /** Returns the object with the settings used for calls to createUser. */ + public UnaryCallSettings createUserSettings() { + return createUserSettings; + } + + /** Returns the object with the settings used for calls to getUser. */ + public UnaryCallSettings getUserSettings() { + return getUserSettings; + } + + /** Returns the object with the settings used for calls to updateUser. */ + public UnaryCallSettings updateUserSettings() { + return updateUserSettings; + } + + /** Returns the object with the settings used for calls to deleteUser. */ + public UnaryCallSettings deleteUserSettings() { + return deleteUserSettings; + } + + /** Returns the object with the settings used for calls to listUsers. */ + public PagedCallSettings + listUsersSettings() { + return listUsersSettings; + } + + /** Returns the object with the settings used for calls to listLocations. */ + public PagedCallSettings + listLocationsSettings() { + return listLocationsSettings; + } + + /** Returns the object with the settings used for calls to getLocation. */ + public UnaryCallSettings getLocationSettings() { + return getLocationSettings; + } + + /** Returns the object with the settings used for calls to setIamPolicy. */ + public UnaryCallSettings setIamPolicySettings() { + return setIamPolicySettings; + } + + /** Returns the object with the settings used for calls to getIamPolicy. */ + public UnaryCallSettings getIamPolicySettings() { + return getIamPolicySettings; + } + + /** Returns the object with the settings used for calls to testIamPermissions. */ + public UnaryCallSettings + testIamPermissionsSettings() { + return testIamPermissionsSettings; + } + + public IdentityStub createStub() throws IOException { + if (getTransportChannelProvider() + .getTransportName() + .equals(GrpcTransportChannel.getGrpcTransportName())) { + return GrpcIdentityStub.create(this); + } + if (getTransportChannelProvider() + .getTransportName() + .equals(HttpJsonTransportChannel.getHttpJsonTransportName())) { + return HttpJsonIdentityStub.create(this); + } + throw new UnsupportedOperationException( + String.format( + "Transport not supported: %s", getTransportChannelProvider().getTransportName())); + } + + /** Returns a builder for the default ExecutorProvider for this service. */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return InstantiatingExecutorProvider.newBuilder(); + } + + /** Returns the default service endpoint. */ + @ObsoleteApi("Use getEndpoint() instead") + public static String getDefaultEndpoint() { + return "localhost:7469"; + } + + /** Returns the default mTLS service endpoint. */ + public static String getDefaultMtlsEndpoint() { + return "localhost:7469"; + } + + /** 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 gRPC ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return InstantiatingGrpcChannelProvider.newBuilder() + .setMaxInboundMessageSize(Integer.MAX_VALUE); + } + + /** Returns a builder for the default REST ChannelProvider for this service. */ + @BetaApi + public static InstantiatingHttpJsonChannelProvider.Builder + defaultHttpJsonTransportProviderBuilder() { + return InstantiatingHttpJsonChannelProvider.newBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return defaultGrpcTransportProviderBuilder().build(); + } + + public static ApiClientHeaderProvider.Builder defaultGrpcApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken("gapic", GaxProperties.getLibraryVersion(IdentityStubSettings.class)) + .setTransportToken( + GaxGrpcProperties.getGrpcTokenName(), GaxGrpcProperties.getGrpcVersion()); + } + + public static ApiClientHeaderProvider.Builder defaultHttpJsonApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken("gapic", GaxProperties.getLibraryVersion(IdentityStubSettings.class)) + .setTransportToken( + GaxHttpJsonProperties.getHttpJsonTokenName(), + GaxHttpJsonProperties.getHttpJsonVersion()); + } + + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return IdentityStubSettings.defaultGrpcApiClientHeaderProviderBuilder(); + } + + /** Returns a new gRPC builder for this class. */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** Returns a new REST builder for this class. */ + public static Builder newHttpJsonBuilder() { + return Builder.createHttpJsonDefault(); + } + + /** 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 IdentityStubSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + + createUserSettings = settingsBuilder.createUserSettings().build(); + getUserSettings = settingsBuilder.getUserSettings().build(); + updateUserSettings = settingsBuilder.updateUserSettings().build(); + deleteUserSettings = settingsBuilder.deleteUserSettings().build(); + listUsersSettings = settingsBuilder.listUsersSettings().build(); + listLocationsSettings = settingsBuilder.listLocationsSettings().build(); + getLocationSettings = settingsBuilder.getLocationSettings().build(); + setIamPolicySettings = settingsBuilder.setIamPolicySettings().build(); + getIamPolicySettings = settingsBuilder.getIamPolicySettings().build(); + testIamPermissionsSettings = settingsBuilder.testIamPermissionsSettings().build(); + } + + /** Builder for IdentityStubSettings. */ + public static class Builder extends StubSettings.Builder { + private final ImmutableList> unaryMethodSettingsBuilders; + private final UnaryCallSettings.Builder createUserSettings; + private final UnaryCallSettings.Builder getUserSettings; + private final UnaryCallSettings.Builder updateUserSettings; + private final UnaryCallSettings.Builder deleteUserSettings; + private final PagedCallSettings.Builder< + ListUsersRequest, ListUsersResponse, ListUsersPagedResponse> + listUsersSettings; + private final PagedCallSettings.Builder< + ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse> + listLocationsSettings; + private final UnaryCallSettings.Builder getLocationSettings; + private final UnaryCallSettings.Builder setIamPolicySettings; + private final UnaryCallSettings.Builder getIamPolicySettings; + private final UnaryCallSettings.Builder + testIamPermissionsSettings; + 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_2_codes", + ImmutableSet.copyOf( + Lists.newArrayList( + StatusCode.Code.UNAVAILABLE, StatusCode.Code.UNKNOWN))); + 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(200L)) + .setRetryDelayMultiplier(2.0) + .setMaxRetryDelayDuration(Duration.ofMillis(3000L)) + .setInitialRpcTimeoutDuration(Duration.ofMillis(5000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeoutDuration(Duration.ofMillis(5000L)) + .setTotalTimeoutDuration(Duration.ofMillis(5000L)) + .build(); + definitions.put("retry_policy_2_params", settings); + RETRY_PARAM_DEFINITIONS = definitions.build(); + } + + protected Builder() { + this(((ClientContext) null)); + } + + protected Builder(ClientContext clientContext) { + super(clientContext); + + createUserSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + getUserSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + updateUserSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + deleteUserSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + listUsersSettings = PagedCallSettings.newBuilder(LIST_USERS_PAGE_STR_FACT); + listLocationsSettings = PagedCallSettings.newBuilder(LIST_LOCATIONS_PAGE_STR_FACT); + getLocationSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + setIamPolicySettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + getIamPolicySettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + testIamPermissionsSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + createUserSettings, + getUserSettings, + updateUserSettings, + deleteUserSettings, + listUsersSettings, + listLocationsSettings, + getLocationSettings, + setIamPolicySettings, + getIamPolicySettings, + testIamPermissionsSettings); + initDefaults(this); + } + + protected Builder(IdentityStubSettings settings) { + super(settings); + + createUserSettings = settings.createUserSettings.toBuilder(); + getUserSettings = settings.getUserSettings.toBuilder(); + updateUserSettings = settings.updateUserSettings.toBuilder(); + deleteUserSettings = settings.deleteUserSettings.toBuilder(); + listUsersSettings = settings.listUsersSettings.toBuilder(); + listLocationsSettings = settings.listLocationsSettings.toBuilder(); + getLocationSettings = settings.getLocationSettings.toBuilder(); + setIamPolicySettings = settings.setIamPolicySettings.toBuilder(); + getIamPolicySettings = settings.getIamPolicySettings.toBuilder(); + testIamPermissionsSettings = settings.testIamPermissionsSettings.toBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + createUserSettings, + getUserSettings, + updateUserSettings, + deleteUserSettings, + listUsersSettings, + listLocationsSettings, + getLocationSettings, + setIamPolicySettings, + getIamPolicySettings, + testIamPermissionsSettings); + } + + 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 createHttpJsonDefault() { + Builder builder = new Builder(((ClientContext) null)); + + builder.setTransportChannelProvider(defaultHttpJsonTransportProviderBuilder().build()); + builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); + builder.setInternalHeaderProvider(defaultHttpJsonApiClientHeaderProviderBuilder().build()); + builder.setMtlsEndpoint(getDefaultMtlsEndpoint()); + builder.setSwitchToMtlsEndpointAllowed(true); + + return initDefaults(builder); + } + + private static Builder initDefaults(Builder builder) { + builder + .createUserSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .getUserSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_2_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_2_params")); + + builder + .updateUserSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .deleteUserSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .listUsersSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_2_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_2_params")); + + builder + .listLocationsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .getLocationSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .setIamPolicySettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .getIamPolicySettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .testIamPermissionsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_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 createUser. */ + public UnaryCallSettings.Builder createUserSettings() { + return createUserSettings; + } + + /** Returns the builder for the settings used for calls to getUser. */ + public UnaryCallSettings.Builder getUserSettings() { + return getUserSettings; + } + + /** Returns the builder for the settings used for calls to updateUser. */ + public UnaryCallSettings.Builder updateUserSettings() { + return updateUserSettings; + } + + /** Returns the builder for the settings used for calls to deleteUser. */ + public UnaryCallSettings.Builder deleteUserSettings() { + return deleteUserSettings; + } + + /** Returns the builder for the settings used for calls to listUsers. */ + public PagedCallSettings.Builder + listUsersSettings() { + return listUsersSettings; + } + + /** Returns the builder for the settings used for calls to listLocations. */ + public PagedCallSettings.Builder< + ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse> + listLocationsSettings() { + return listLocationsSettings; + } + + /** Returns the builder for the settings used for calls to getLocation. */ + public UnaryCallSettings.Builder getLocationSettings() { + return getLocationSettings; + } + + /** Returns the builder for the settings used for calls to setIamPolicy. */ + public UnaryCallSettings.Builder setIamPolicySettings() { + return setIamPolicySettings; + } + + /** Returns the builder for the settings used for calls to getIamPolicy. */ + public UnaryCallSettings.Builder getIamPolicySettings() { + return getIamPolicySettings; + } + + /** Returns the builder for the settings used for calls to testIamPermissions. */ + public UnaryCallSettings.Builder + testIamPermissionsSettings() { + return testIamPermissionsSettings; + } + + @Override + public IdentityStubSettings build() throws IOException { + return new IdentityStubSettings(this); + } + } +} diff --git a/java-showcase-3.21.0/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/MessagingStub.java b/java-showcase-3.21.0/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/MessagingStub.java new file mode 100644 index 0000000000..45f38d5e07 --- /dev/null +++ b/java-showcase-3.21.0/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/MessagingStub.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. + */ + +package com.google.showcase.v1beta1.stub; + +import static com.google.showcase.v1beta1.MessagingClient.ListBlurbsPagedResponse; +import static com.google.showcase.v1beta1.MessagingClient.ListLocationsPagedResponse; +import static com.google.showcase.v1beta1.MessagingClient.ListRoomsPagedResponse; + +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.rpc.BidiStreamingCallable; +import com.google.api.gax.rpc.ClientStreamingCallable; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.longrunning.Operation; +import com.google.longrunning.stub.OperationsStub; +import com.google.protobuf.Empty; +import com.google.showcase.v1beta1.Blurb; +import com.google.showcase.v1beta1.ConnectRequest; +import com.google.showcase.v1beta1.CreateBlurbRequest; +import com.google.showcase.v1beta1.CreateRoomRequest; +import com.google.showcase.v1beta1.DeleteBlurbRequest; +import com.google.showcase.v1beta1.DeleteRoomRequest; +import com.google.showcase.v1beta1.GetBlurbRequest; +import com.google.showcase.v1beta1.GetRoomRequest; +import com.google.showcase.v1beta1.ListBlurbsRequest; +import com.google.showcase.v1beta1.ListBlurbsResponse; +import com.google.showcase.v1beta1.ListRoomsRequest; +import com.google.showcase.v1beta1.ListRoomsResponse; +import com.google.showcase.v1beta1.Room; +import com.google.showcase.v1beta1.SearchBlurbsMetadata; +import com.google.showcase.v1beta1.SearchBlurbsRequest; +import com.google.showcase.v1beta1.SearchBlurbsResponse; +import com.google.showcase.v1beta1.SendBlurbsResponse; +import com.google.showcase.v1beta1.StreamBlurbsRequest; +import com.google.showcase.v1beta1.StreamBlurbsResponse; +import com.google.showcase.v1beta1.UpdateBlurbRequest; +import com.google.showcase.v1beta1.UpdateRoomRequest; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Base stub class for the Messaging service API. + * + *

        This class is for advanced usage and reflects the underlying API directly. + */ +@BetaApi +@Generated("by gapic-generator-java") +public abstract class MessagingStub implements BackgroundResource { + + public OperationsStub getOperationsStub() { + return null; + } + + public com.google.api.gax.httpjson.longrunning.stub.OperationsStub getHttpJsonOperationsStub() { + return null; + } + + public UnaryCallable createRoomCallable() { + throw new UnsupportedOperationException("Not implemented: createRoomCallable()"); + } + + public UnaryCallable getRoomCallable() { + throw new UnsupportedOperationException("Not implemented: getRoomCallable()"); + } + + public UnaryCallable updateRoomCallable() { + throw new UnsupportedOperationException("Not implemented: updateRoomCallable()"); + } + + public UnaryCallable deleteRoomCallable() { + throw new UnsupportedOperationException("Not implemented: deleteRoomCallable()"); + } + + public UnaryCallable listRoomsPagedCallable() { + throw new UnsupportedOperationException("Not implemented: listRoomsPagedCallable()"); + } + + public UnaryCallable listRoomsCallable() { + throw new UnsupportedOperationException("Not implemented: listRoomsCallable()"); + } + + public UnaryCallable createBlurbCallable() { + throw new UnsupportedOperationException("Not implemented: createBlurbCallable()"); + } + + public UnaryCallable getBlurbCallable() { + throw new UnsupportedOperationException("Not implemented: getBlurbCallable()"); + } + + public UnaryCallable updateBlurbCallable() { + throw new UnsupportedOperationException("Not implemented: updateBlurbCallable()"); + } + + public UnaryCallable deleteBlurbCallable() { + throw new UnsupportedOperationException("Not implemented: deleteBlurbCallable()"); + } + + public UnaryCallable listBlurbsPagedCallable() { + throw new UnsupportedOperationException("Not implemented: listBlurbsPagedCallable()"); + } + + public UnaryCallable listBlurbsCallable() { + throw new UnsupportedOperationException("Not implemented: listBlurbsCallable()"); + } + + public OperationCallable + searchBlurbsOperationCallable() { + throw new UnsupportedOperationException("Not implemented: searchBlurbsOperationCallable()"); + } + + public UnaryCallable searchBlurbsCallable() { + throw new UnsupportedOperationException("Not implemented: searchBlurbsCallable()"); + } + + public ServerStreamingCallable streamBlurbsCallable() { + throw new UnsupportedOperationException("Not implemented: streamBlurbsCallable()"); + } + + public ClientStreamingCallable sendBlurbsCallable() { + throw new UnsupportedOperationException("Not implemented: sendBlurbsCallable()"); + } + + public BidiStreamingCallable connectCallable() { + throw new UnsupportedOperationException("Not implemented: connectCallable()"); + } + + public UnaryCallable + listLocationsPagedCallable() { + throw new UnsupportedOperationException("Not implemented: listLocationsPagedCallable()"); + } + + public UnaryCallable listLocationsCallable() { + throw new UnsupportedOperationException("Not implemented: listLocationsCallable()"); + } + + public UnaryCallable getLocationCallable() { + throw new UnsupportedOperationException("Not implemented: getLocationCallable()"); + } + + public UnaryCallable setIamPolicyCallable() { + throw new UnsupportedOperationException("Not implemented: setIamPolicyCallable()"); + } + + public UnaryCallable getIamPolicyCallable() { + throw new UnsupportedOperationException("Not implemented: getIamPolicyCallable()"); + } + + public UnaryCallable + testIamPermissionsCallable() { + throw new UnsupportedOperationException("Not implemented: testIamPermissionsCallable()"); + } + + @Override + public abstract void close(); +} diff --git a/java-showcase-3.21.0/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/MessagingStubSettings.java b/java-showcase-3.21.0/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/MessagingStubSettings.java new file mode 100644 index 0000000000..84828250d7 --- /dev/null +++ b/java-showcase-3.21.0/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/MessagingStubSettings.java @@ -0,0 +1,1027 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.stub; + +import static com.google.showcase.v1beta1.MessagingClient.ListBlurbsPagedResponse; +import static com.google.showcase.v1beta1.MessagingClient.ListLocationsPagedResponse; +import static com.google.showcase.v1beta1.MessagingClient.ListRoomsPagedResponse; + +import com.google.api.core.ApiFunction; +import com.google.api.core.ApiFuture; +import com.google.api.core.BetaApi; +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.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.HttpJsonTransportChannel; +import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; +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.ServerStreamingCallSettings; +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.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +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.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.longrunning.Operation; +import com.google.protobuf.Empty; +import com.google.showcase.v1beta1.Blurb; +import com.google.showcase.v1beta1.ConnectRequest; +import com.google.showcase.v1beta1.CreateBlurbRequest; +import com.google.showcase.v1beta1.CreateRoomRequest; +import com.google.showcase.v1beta1.DeleteBlurbRequest; +import com.google.showcase.v1beta1.DeleteRoomRequest; +import com.google.showcase.v1beta1.GetBlurbRequest; +import com.google.showcase.v1beta1.GetRoomRequest; +import com.google.showcase.v1beta1.ListBlurbsRequest; +import com.google.showcase.v1beta1.ListBlurbsResponse; +import com.google.showcase.v1beta1.ListRoomsRequest; +import com.google.showcase.v1beta1.ListRoomsResponse; +import com.google.showcase.v1beta1.Room; +import com.google.showcase.v1beta1.SearchBlurbsMetadata; +import com.google.showcase.v1beta1.SearchBlurbsRequest; +import com.google.showcase.v1beta1.SearchBlurbsResponse; +import com.google.showcase.v1beta1.SendBlurbsResponse; +import com.google.showcase.v1beta1.StreamBlurbsRequest; +import com.google.showcase.v1beta1.StreamBlurbsResponse; +import com.google.showcase.v1beta1.UpdateBlurbRequest; +import com.google.showcase.v1beta1.UpdateRoomRequest; +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 MessagingStub}. + * + *

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

          + *
        • The default service address (localhost) and default port (7469) 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 createRoom: + * + *

        {@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
        + * MessagingStubSettings.Builder messagingSettingsBuilder = MessagingStubSettings.newBuilder();
        + * messagingSettingsBuilder
        + *     .createRoomSettings()
        + *     .setRetrySettings(
        + *         messagingSettingsBuilder
        + *             .createRoomSettings()
        + *             .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());
        + * MessagingStubSettings messagingSettings = messagingSettingsBuilder.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 searchBlurbs: + * + *

        {@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
        + * MessagingStubSettings.Builder messagingSettingsBuilder = MessagingStubSettings.newBuilder();
        + * TimedRetryAlgorithm timedRetryAlgorithm =
        + *     OperationalTimedPollAlgorithm.create(
        + *         RetrySettings.newBuilder()
        + *             .setInitialRetryDelayDuration(Duration.ofMillis(500))
        + *             .setRetryDelayMultiplier(1.5)
        + *             .setMaxRetryDelayDuration(Duration.ofMillis(5000))
        + *             .setTotalTimeoutDuration(Duration.ofHours(24))
        + *             .build());
        + * messagingSettingsBuilder
        + *     .createClusterOperationSettings()
        + *     .setPollingAlgorithm(timedRetryAlgorithm)
        + *     .build();
        + * }
        + */ +@BetaApi +@Generated("by gapic-generator-java") +public class MessagingStubSettings extends StubSettings { + /** The default scopes of the service. */ + private static final ImmutableList DEFAULT_SERVICE_SCOPES = + ImmutableList.builder().build(); + + private final UnaryCallSettings createRoomSettings; + private final UnaryCallSettings getRoomSettings; + private final UnaryCallSettings updateRoomSettings; + private final UnaryCallSettings deleteRoomSettings; + private final PagedCallSettings + listRoomsSettings; + private final UnaryCallSettings createBlurbSettings; + private final UnaryCallSettings getBlurbSettings; + private final UnaryCallSettings updateBlurbSettings; + private final UnaryCallSettings deleteBlurbSettings; + private final PagedCallSettings + listBlurbsSettings; + private final UnaryCallSettings searchBlurbsSettings; + private final OperationCallSettings< + SearchBlurbsRequest, SearchBlurbsResponse, SearchBlurbsMetadata> + searchBlurbsOperationSettings; + private final ServerStreamingCallSettings + streamBlurbsSettings; + private final StreamingCallSettings sendBlurbsSettings; + private final StreamingCallSettings connectSettings; + private final PagedCallSettings< + ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse> + listLocationsSettings; + private final UnaryCallSettings getLocationSettings; + private final UnaryCallSettings setIamPolicySettings; + private final UnaryCallSettings getIamPolicySettings; + private final UnaryCallSettings + testIamPermissionsSettings; + + private static final PagedListDescriptor + LIST_ROOMS_PAGE_STR_DESC = + new PagedListDescriptor() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public ListRoomsRequest injectToken(ListRoomsRequest payload, String token) { + return ListRoomsRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public ListRoomsRequest injectPageSize(ListRoomsRequest payload, int pageSize) { + return ListRoomsRequest.newBuilder(payload).setPageSize(pageSize).build(); + } + + @Override + public Integer extractPageSize(ListRoomsRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(ListRoomsResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources(ListRoomsResponse payload) { + return payload.getRoomsList(); + } + }; + + private static final PagedListDescriptor + LIST_BLURBS_PAGE_STR_DESC = + new PagedListDescriptor() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public ListBlurbsRequest injectToken(ListBlurbsRequest payload, String token) { + return ListBlurbsRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public ListBlurbsRequest injectPageSize(ListBlurbsRequest payload, int pageSize) { + return ListBlurbsRequest.newBuilder(payload).setPageSize(pageSize).build(); + } + + @Override + public Integer extractPageSize(ListBlurbsRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(ListBlurbsResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources(ListBlurbsResponse payload) { + return payload.getBlurbsList(); + } + }; + + private static final PagedListDescriptor + LIST_LOCATIONS_PAGE_STR_DESC = + new PagedListDescriptor() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public ListLocationsRequest injectToken(ListLocationsRequest payload, String token) { + return ListLocationsRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public ListLocationsRequest injectPageSize(ListLocationsRequest payload, int pageSize) { + return ListLocationsRequest.newBuilder(payload).setPageSize(pageSize).build(); + } + + @Override + public Integer extractPageSize(ListLocationsRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(ListLocationsResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources(ListLocationsResponse payload) { + return payload.getLocationsList(); + } + }; + + private static final PagedListResponseFactory< + ListRoomsRequest, ListRoomsResponse, ListRoomsPagedResponse> + LIST_ROOMS_PAGE_STR_FACT = + new PagedListResponseFactory< + ListRoomsRequest, ListRoomsResponse, ListRoomsPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListRoomsRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext pageContext = + PageContext.create(callable, LIST_ROOMS_PAGE_STR_DESC, request, context); + return ListRoomsPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + private static final PagedListResponseFactory< + ListBlurbsRequest, ListBlurbsResponse, ListBlurbsPagedResponse> + LIST_BLURBS_PAGE_STR_FACT = + new PagedListResponseFactory< + ListBlurbsRequest, ListBlurbsResponse, ListBlurbsPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListBlurbsRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext pageContext = + PageContext.create(callable, LIST_BLURBS_PAGE_STR_DESC, request, context); + return ListBlurbsPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + private static final PagedListResponseFactory< + ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse> + LIST_LOCATIONS_PAGE_STR_FACT = + new PagedListResponseFactory< + ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListLocationsRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext pageContext = + PageContext.create(callable, LIST_LOCATIONS_PAGE_STR_DESC, request, context); + return ListLocationsPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + /** Returns the object with the settings used for calls to createRoom. */ + public UnaryCallSettings createRoomSettings() { + return createRoomSettings; + } + + /** Returns the object with the settings used for calls to getRoom. */ + public UnaryCallSettings getRoomSettings() { + return getRoomSettings; + } + + /** Returns the object with the settings used for calls to updateRoom. */ + public UnaryCallSettings updateRoomSettings() { + return updateRoomSettings; + } + + /** Returns the object with the settings used for calls to deleteRoom. */ + public UnaryCallSettings deleteRoomSettings() { + return deleteRoomSettings; + } + + /** Returns the object with the settings used for calls to listRooms. */ + public PagedCallSettings + listRoomsSettings() { + return listRoomsSettings; + } + + /** Returns the object with the settings used for calls to createBlurb. */ + public UnaryCallSettings createBlurbSettings() { + return createBlurbSettings; + } + + /** Returns the object with the settings used for calls to getBlurb. */ + public UnaryCallSettings getBlurbSettings() { + return getBlurbSettings; + } + + /** Returns the object with the settings used for calls to updateBlurb. */ + public UnaryCallSettings updateBlurbSettings() { + return updateBlurbSettings; + } + + /** Returns the object with the settings used for calls to deleteBlurb. */ + public UnaryCallSettings deleteBlurbSettings() { + return deleteBlurbSettings; + } + + /** Returns the object with the settings used for calls to listBlurbs. */ + public PagedCallSettings + listBlurbsSettings() { + return listBlurbsSettings; + } + + /** Returns the object with the settings used for calls to searchBlurbs. */ + public UnaryCallSettings searchBlurbsSettings() { + return searchBlurbsSettings; + } + + /** Returns the object with the settings used for calls to searchBlurbs. */ + public OperationCallSettings + searchBlurbsOperationSettings() { + return searchBlurbsOperationSettings; + } + + /** Returns the object with the settings used for calls to streamBlurbs. */ + public ServerStreamingCallSettings + streamBlurbsSettings() { + return streamBlurbsSettings; + } + + /** Returns the object with the settings used for calls to sendBlurbs. */ + public StreamingCallSettings sendBlurbsSettings() { + return sendBlurbsSettings; + } + + /** Returns the object with the settings used for calls to connect. */ + public StreamingCallSettings connectSettings() { + return connectSettings; + } + + /** Returns the object with the settings used for calls to listLocations. */ + public PagedCallSettings + listLocationsSettings() { + return listLocationsSettings; + } + + /** Returns the object with the settings used for calls to getLocation. */ + public UnaryCallSettings getLocationSettings() { + return getLocationSettings; + } + + /** Returns the object with the settings used for calls to setIamPolicy. */ + public UnaryCallSettings setIamPolicySettings() { + return setIamPolicySettings; + } + + /** Returns the object with the settings used for calls to getIamPolicy. */ + public UnaryCallSettings getIamPolicySettings() { + return getIamPolicySettings; + } + + /** Returns the object with the settings used for calls to testIamPermissions. */ + public UnaryCallSettings + testIamPermissionsSettings() { + return testIamPermissionsSettings; + } + + public MessagingStub createStub() throws IOException { + if (getTransportChannelProvider() + .getTransportName() + .equals(GrpcTransportChannel.getGrpcTransportName())) { + return GrpcMessagingStub.create(this); + } + if (getTransportChannelProvider() + .getTransportName() + .equals(HttpJsonTransportChannel.getHttpJsonTransportName())) { + return HttpJsonMessagingStub.create(this); + } + throw new UnsupportedOperationException( + String.format( + "Transport not supported: %s", getTransportChannelProvider().getTransportName())); + } + + /** Returns a builder for the default ExecutorProvider for this service. */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return InstantiatingExecutorProvider.newBuilder(); + } + + /** Returns the default service endpoint. */ + @ObsoleteApi("Use getEndpoint() instead") + public static String getDefaultEndpoint() { + return "localhost:7469"; + } + + /** Returns the default mTLS service endpoint. */ + public static String getDefaultMtlsEndpoint() { + return "localhost:7469"; + } + + /** 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 gRPC ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return InstantiatingGrpcChannelProvider.newBuilder() + .setMaxInboundMessageSize(Integer.MAX_VALUE); + } + + /** Returns a builder for the default REST ChannelProvider for this service. */ + @BetaApi + public static InstantiatingHttpJsonChannelProvider.Builder + defaultHttpJsonTransportProviderBuilder() { + return InstantiatingHttpJsonChannelProvider.newBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return defaultGrpcTransportProviderBuilder().build(); + } + + public static ApiClientHeaderProvider.Builder defaultGrpcApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken("gapic", GaxProperties.getLibraryVersion(MessagingStubSettings.class)) + .setTransportToken( + GaxGrpcProperties.getGrpcTokenName(), GaxGrpcProperties.getGrpcVersion()); + } + + public static ApiClientHeaderProvider.Builder defaultHttpJsonApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken("gapic", GaxProperties.getLibraryVersion(MessagingStubSettings.class)) + .setTransportToken( + GaxHttpJsonProperties.getHttpJsonTokenName(), + GaxHttpJsonProperties.getHttpJsonVersion()); + } + + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return MessagingStubSettings.defaultGrpcApiClientHeaderProviderBuilder(); + } + + /** Returns a new gRPC builder for this class. */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** Returns a new REST builder for this class. */ + public static Builder newHttpJsonBuilder() { + return Builder.createHttpJsonDefault(); + } + + /** 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 MessagingStubSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + + createRoomSettings = settingsBuilder.createRoomSettings().build(); + getRoomSettings = settingsBuilder.getRoomSettings().build(); + updateRoomSettings = settingsBuilder.updateRoomSettings().build(); + deleteRoomSettings = settingsBuilder.deleteRoomSettings().build(); + listRoomsSettings = settingsBuilder.listRoomsSettings().build(); + createBlurbSettings = settingsBuilder.createBlurbSettings().build(); + getBlurbSettings = settingsBuilder.getBlurbSettings().build(); + updateBlurbSettings = settingsBuilder.updateBlurbSettings().build(); + deleteBlurbSettings = settingsBuilder.deleteBlurbSettings().build(); + listBlurbsSettings = settingsBuilder.listBlurbsSettings().build(); + searchBlurbsSettings = settingsBuilder.searchBlurbsSettings().build(); + searchBlurbsOperationSettings = settingsBuilder.searchBlurbsOperationSettings().build(); + streamBlurbsSettings = settingsBuilder.streamBlurbsSettings().build(); + sendBlurbsSettings = settingsBuilder.sendBlurbsSettings().build(); + connectSettings = settingsBuilder.connectSettings().build(); + listLocationsSettings = settingsBuilder.listLocationsSettings().build(); + getLocationSettings = settingsBuilder.getLocationSettings().build(); + setIamPolicySettings = settingsBuilder.setIamPolicySettings().build(); + getIamPolicySettings = settingsBuilder.getIamPolicySettings().build(); + testIamPermissionsSettings = settingsBuilder.testIamPermissionsSettings().build(); + } + + /** Builder for MessagingStubSettings. */ + public static class Builder extends StubSettings.Builder { + private final ImmutableList> unaryMethodSettingsBuilders; + private final UnaryCallSettings.Builder createRoomSettings; + private final UnaryCallSettings.Builder getRoomSettings; + private final UnaryCallSettings.Builder updateRoomSettings; + private final UnaryCallSettings.Builder deleteRoomSettings; + private final PagedCallSettings.Builder< + ListRoomsRequest, ListRoomsResponse, ListRoomsPagedResponse> + listRoomsSettings; + private final UnaryCallSettings.Builder createBlurbSettings; + private final UnaryCallSettings.Builder getBlurbSettings; + private final UnaryCallSettings.Builder updateBlurbSettings; + private final UnaryCallSettings.Builder deleteBlurbSettings; + private final PagedCallSettings.Builder< + ListBlurbsRequest, ListBlurbsResponse, ListBlurbsPagedResponse> + listBlurbsSettings; + private final UnaryCallSettings.Builder searchBlurbsSettings; + private final OperationCallSettings.Builder< + SearchBlurbsRequest, SearchBlurbsResponse, SearchBlurbsMetadata> + searchBlurbsOperationSettings; + private final ServerStreamingCallSettings.Builder + streamBlurbsSettings; + private final StreamingCallSettings.Builder + sendBlurbsSettings; + private final StreamingCallSettings.Builder + connectSettings; + private final PagedCallSettings.Builder< + ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse> + listLocationsSettings; + private final UnaryCallSettings.Builder getLocationSettings; + private final UnaryCallSettings.Builder setIamPolicySettings; + private final UnaryCallSettings.Builder getIamPolicySettings; + private final UnaryCallSettings.Builder + testIamPermissionsSettings; + private static final ImmutableMap> + RETRYABLE_CODE_DEFINITIONS; + + static { + ImmutableMap.Builder> definitions = + ImmutableMap.builder(); + definitions.put( + "no_retry_0_codes", ImmutableSet.copyOf(Lists.newArrayList())); + definitions.put( + "retry_policy_1_codes", + ImmutableSet.copyOf( + Lists.newArrayList( + StatusCode.Code.UNAVAILABLE, StatusCode.Code.UNKNOWN))); + RETRYABLE_CODE_DEFINITIONS = definitions.build(); + } + + private static final ImmutableMap RETRY_PARAM_DEFINITIONS; + + static { + ImmutableMap.Builder definitions = ImmutableMap.builder(); + RetrySettings settings = null; + settings = + RetrySettings.newBuilder() + .setInitialRpcTimeoutDuration(Duration.ofMillis(5000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeoutDuration(Duration.ofMillis(5000L)) + .setTotalTimeoutDuration(Duration.ofMillis(5000L)) + .build(); + definitions.put("no_retry_0_params", settings); + settings = + RetrySettings.newBuilder() + .setInitialRetryDelayDuration(Duration.ofMillis(100L)) + .setRetryDelayMultiplier(2.0) + .setMaxRetryDelayDuration(Duration.ofMillis(3000L)) + .setInitialRpcTimeoutDuration(Duration.ofMillis(10000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeoutDuration(Duration.ofMillis(10000L)) + .setTotalTimeoutDuration(Duration.ofMillis(10000L)) + .build(); + definitions.put("retry_policy_1_params", settings); + RETRY_PARAM_DEFINITIONS = definitions.build(); + } + + protected Builder() { + this(((ClientContext) null)); + } + + protected Builder(ClientContext clientContext) { + super(clientContext); + + createRoomSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + getRoomSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + updateRoomSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + deleteRoomSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + listRoomsSettings = PagedCallSettings.newBuilder(LIST_ROOMS_PAGE_STR_FACT); + createBlurbSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + getBlurbSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + updateBlurbSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + deleteBlurbSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + listBlurbsSettings = PagedCallSettings.newBuilder(LIST_BLURBS_PAGE_STR_FACT); + searchBlurbsSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + searchBlurbsOperationSettings = OperationCallSettings.newBuilder(); + streamBlurbsSettings = ServerStreamingCallSettings.newBuilder(); + sendBlurbsSettings = StreamingCallSettings.newBuilder(); + connectSettings = StreamingCallSettings.newBuilder(); + listLocationsSettings = PagedCallSettings.newBuilder(LIST_LOCATIONS_PAGE_STR_FACT); + getLocationSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + setIamPolicySettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + getIamPolicySettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + testIamPermissionsSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + createRoomSettings, + getRoomSettings, + updateRoomSettings, + deleteRoomSettings, + listRoomsSettings, + createBlurbSettings, + getBlurbSettings, + updateBlurbSettings, + deleteBlurbSettings, + listBlurbsSettings, + searchBlurbsSettings, + listLocationsSettings, + getLocationSettings, + setIamPolicySettings, + getIamPolicySettings, + testIamPermissionsSettings); + initDefaults(this); + } + + protected Builder(MessagingStubSettings settings) { + super(settings); + + createRoomSettings = settings.createRoomSettings.toBuilder(); + getRoomSettings = settings.getRoomSettings.toBuilder(); + updateRoomSettings = settings.updateRoomSettings.toBuilder(); + deleteRoomSettings = settings.deleteRoomSettings.toBuilder(); + listRoomsSettings = settings.listRoomsSettings.toBuilder(); + createBlurbSettings = settings.createBlurbSettings.toBuilder(); + getBlurbSettings = settings.getBlurbSettings.toBuilder(); + updateBlurbSettings = settings.updateBlurbSettings.toBuilder(); + deleteBlurbSettings = settings.deleteBlurbSettings.toBuilder(); + listBlurbsSettings = settings.listBlurbsSettings.toBuilder(); + searchBlurbsSettings = settings.searchBlurbsSettings.toBuilder(); + searchBlurbsOperationSettings = settings.searchBlurbsOperationSettings.toBuilder(); + streamBlurbsSettings = settings.streamBlurbsSettings.toBuilder(); + sendBlurbsSettings = settings.sendBlurbsSettings.toBuilder(); + connectSettings = settings.connectSettings.toBuilder(); + listLocationsSettings = settings.listLocationsSettings.toBuilder(); + getLocationSettings = settings.getLocationSettings.toBuilder(); + setIamPolicySettings = settings.setIamPolicySettings.toBuilder(); + getIamPolicySettings = settings.getIamPolicySettings.toBuilder(); + testIamPermissionsSettings = settings.testIamPermissionsSettings.toBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + createRoomSettings, + getRoomSettings, + updateRoomSettings, + deleteRoomSettings, + listRoomsSettings, + createBlurbSettings, + getBlurbSettings, + updateBlurbSettings, + deleteBlurbSettings, + listBlurbsSettings, + searchBlurbsSettings, + listLocationsSettings, + getLocationSettings, + setIamPolicySettings, + getIamPolicySettings, + testIamPermissionsSettings); + } + + 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 createHttpJsonDefault() { + Builder builder = new Builder(((ClientContext) null)); + + builder.setTransportChannelProvider(defaultHttpJsonTransportProviderBuilder().build()); + builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); + builder.setInternalHeaderProvider(defaultHttpJsonApiClientHeaderProviderBuilder().build()); + builder.setMtlsEndpoint(getDefaultMtlsEndpoint()); + builder.setSwitchToMtlsEndpointAllowed(true); + + return initDefaults(builder); + } + + private static Builder initDefaults(Builder builder) { + builder + .createRoomSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + + builder + .getRoomSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")); + + builder + .updateRoomSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + + builder + .deleteRoomSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + + builder + .listRoomsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")); + + builder + .createBlurbSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + + builder + .getBlurbSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")); + + builder + .updateBlurbSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + + builder + .deleteBlurbSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + + builder + .listBlurbsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")); + + builder + .searchBlurbsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")); + + builder + .streamBlurbsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + + builder + .listLocationsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + + builder + .getLocationSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + + builder + .setIamPolicySettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + + builder + .getIamPolicySettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + + builder + .testIamPermissionsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + + builder + .searchBlurbsOperationSettings() + .setInitialCallSettings( + UnaryCallSettings + .newUnaryCallSettingsBuilder() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")) + .build()) + .setResponseTransformer( + ProtoOperationTransformers.ResponseTransformer.create(SearchBlurbsResponse.class)) + .setMetadataTransformer( + ProtoOperationTransformers.MetadataTransformer.create(SearchBlurbsMetadata.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 createRoom. */ + public UnaryCallSettings.Builder createRoomSettings() { + return createRoomSettings; + } + + /** Returns the builder for the settings used for calls to getRoom. */ + public UnaryCallSettings.Builder getRoomSettings() { + return getRoomSettings; + } + + /** Returns the builder for the settings used for calls to updateRoom. */ + public UnaryCallSettings.Builder updateRoomSettings() { + return updateRoomSettings; + } + + /** Returns the builder for the settings used for calls to deleteRoom. */ + public UnaryCallSettings.Builder deleteRoomSettings() { + return deleteRoomSettings; + } + + /** Returns the builder for the settings used for calls to listRooms. */ + public PagedCallSettings.Builder + listRoomsSettings() { + return listRoomsSettings; + } + + /** Returns the builder for the settings used for calls to createBlurb. */ + public UnaryCallSettings.Builder createBlurbSettings() { + return createBlurbSettings; + } + + /** Returns the builder for the settings used for calls to getBlurb. */ + public UnaryCallSettings.Builder getBlurbSettings() { + return getBlurbSettings; + } + + /** Returns the builder for the settings used for calls to updateBlurb. */ + public UnaryCallSettings.Builder updateBlurbSettings() { + return updateBlurbSettings; + } + + /** Returns the builder for the settings used for calls to deleteBlurb. */ + public UnaryCallSettings.Builder deleteBlurbSettings() { + return deleteBlurbSettings; + } + + /** Returns the builder for the settings used for calls to listBlurbs. */ + public PagedCallSettings.Builder + listBlurbsSettings() { + return listBlurbsSettings; + } + + /** Returns the builder for the settings used for calls to searchBlurbs. */ + public UnaryCallSettings.Builder searchBlurbsSettings() { + return searchBlurbsSettings; + } + + /** Returns the builder for the settings used for calls to searchBlurbs. */ + public OperationCallSettings.Builder< + SearchBlurbsRequest, SearchBlurbsResponse, SearchBlurbsMetadata> + searchBlurbsOperationSettings() { + return searchBlurbsOperationSettings; + } + + /** Returns the builder for the settings used for calls to streamBlurbs. */ + public ServerStreamingCallSettings.Builder + streamBlurbsSettings() { + return streamBlurbsSettings; + } + + /** Returns the builder for the settings used for calls to sendBlurbs. */ + public StreamingCallSettings.Builder + sendBlurbsSettings() { + return sendBlurbsSettings; + } + + /** Returns the builder for the settings used for calls to connect. */ + public StreamingCallSettings.Builder connectSettings() { + return connectSettings; + } + + /** Returns the builder for the settings used for calls to listLocations. */ + public PagedCallSettings.Builder< + ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse> + listLocationsSettings() { + return listLocationsSettings; + } + + /** Returns the builder for the settings used for calls to getLocation. */ + public UnaryCallSettings.Builder getLocationSettings() { + return getLocationSettings; + } + + /** Returns the builder for the settings used for calls to setIamPolicy. */ + public UnaryCallSettings.Builder setIamPolicySettings() { + return setIamPolicySettings; + } + + /** Returns the builder for the settings used for calls to getIamPolicy. */ + public UnaryCallSettings.Builder getIamPolicySettings() { + return getIamPolicySettings; + } + + /** Returns the builder for the settings used for calls to testIamPermissions. */ + public UnaryCallSettings.Builder + testIamPermissionsSettings() { + return testIamPermissionsSettings; + } + + @Override + public MessagingStubSettings build() throws IOException { + return new MessagingStubSettings(this); + } + } +} diff --git a/java-showcase-3.21.0/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/SequenceServiceStub.java b/java-showcase-3.21.0/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/SequenceServiceStub.java new file mode 100644 index 0000000000..10ffc4271d --- /dev/null +++ b/java-showcase-3.21.0/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/SequenceServiceStub.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. + */ + +package com.google.showcase.v1beta1.stub; + +import static com.google.showcase.v1beta1.SequenceServiceClient.ListLocationsPagedResponse; + +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.protobuf.Empty; +import com.google.showcase.v1beta1.AttemptSequenceRequest; +import com.google.showcase.v1beta1.AttemptStreamingSequenceRequest; +import com.google.showcase.v1beta1.AttemptStreamingSequenceResponse; +import com.google.showcase.v1beta1.CreateSequenceRequest; +import com.google.showcase.v1beta1.CreateStreamingSequenceRequest; +import com.google.showcase.v1beta1.GetSequenceReportRequest; +import com.google.showcase.v1beta1.GetStreamingSequenceReportRequest; +import com.google.showcase.v1beta1.Sequence; +import com.google.showcase.v1beta1.SequenceReport; +import com.google.showcase.v1beta1.StreamingSequence; +import com.google.showcase.v1beta1.StreamingSequenceReport; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Base stub class for the SequenceService service API. + * + *

        This class is for advanced usage and reflects the underlying API directly. + */ +@BetaApi +@Generated("by gapic-generator-java") +public abstract class SequenceServiceStub implements BackgroundResource { + + public UnaryCallable createSequenceCallable() { + throw new UnsupportedOperationException("Not implemented: createSequenceCallable()"); + } + + public UnaryCallable + createStreamingSequenceCallable() { + throw new UnsupportedOperationException("Not implemented: createStreamingSequenceCallable()"); + } + + public UnaryCallable getSequenceReportCallable() { + throw new UnsupportedOperationException("Not implemented: getSequenceReportCallable()"); + } + + public UnaryCallable + getStreamingSequenceReportCallable() { + throw new UnsupportedOperationException( + "Not implemented: getStreamingSequenceReportCallable()"); + } + + public UnaryCallable attemptSequenceCallable() { + throw new UnsupportedOperationException("Not implemented: attemptSequenceCallable()"); + } + + public ServerStreamingCallable + attemptStreamingSequenceCallable() { + throw new UnsupportedOperationException("Not implemented: attemptStreamingSequenceCallable()"); + } + + public UnaryCallable + listLocationsPagedCallable() { + throw new UnsupportedOperationException("Not implemented: listLocationsPagedCallable()"); + } + + public UnaryCallable listLocationsCallable() { + throw new UnsupportedOperationException("Not implemented: listLocationsCallable()"); + } + + public UnaryCallable getLocationCallable() { + throw new UnsupportedOperationException("Not implemented: getLocationCallable()"); + } + + public UnaryCallable setIamPolicyCallable() { + throw new UnsupportedOperationException("Not implemented: setIamPolicyCallable()"); + } + + public UnaryCallable getIamPolicyCallable() { + throw new UnsupportedOperationException("Not implemented: getIamPolicyCallable()"); + } + + public UnaryCallable + testIamPermissionsCallable() { + throw new UnsupportedOperationException("Not implemented: testIamPermissionsCallable()"); + } + + @Override + public abstract void close(); +} diff --git a/java-showcase-3.21.0/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/SequenceServiceStubSettings.java b/java-showcase-3.21.0/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/SequenceServiceStubSettings.java new file mode 100644 index 0000000000..00bc19a4c0 --- /dev/null +++ b/java-showcase-3.21.0/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/SequenceServiceStubSettings.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. + */ + +package com.google.showcase.v1beta1.stub; + +import static com.google.showcase.v1beta1.SequenceServiceClient.ListLocationsPagedResponse; + +import com.google.api.core.ApiFunction; +import com.google.api.core.ApiFuture; +import com.google.api.core.BetaApi; +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.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.HttpJsonTransportChannel; +import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; +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.ServerStreamingCallSettings; +import com.google.api.gax.rpc.StatusCode; +import com.google.api.gax.rpc.StubSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +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.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.protobuf.Empty; +import com.google.showcase.v1beta1.AttemptSequenceRequest; +import com.google.showcase.v1beta1.AttemptStreamingSequenceRequest; +import com.google.showcase.v1beta1.AttemptStreamingSequenceResponse; +import com.google.showcase.v1beta1.CreateSequenceRequest; +import com.google.showcase.v1beta1.CreateStreamingSequenceRequest; +import com.google.showcase.v1beta1.GetSequenceReportRequest; +import com.google.showcase.v1beta1.GetStreamingSequenceReportRequest; +import com.google.showcase.v1beta1.Sequence; +import com.google.showcase.v1beta1.SequenceReport; +import com.google.showcase.v1beta1.StreamingSequence; +import com.google.showcase.v1beta1.StreamingSequenceReport; +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 SequenceServiceStub}. + * + *

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

          + *
        • The default service address (localhost) and default port (7469) 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 createSequence: + * + *

        {@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
        + * SequenceServiceStubSettings.Builder sequenceServiceSettingsBuilder =
        + *     SequenceServiceStubSettings.newBuilder();
        + * sequenceServiceSettingsBuilder
        + *     .createSequenceSettings()
        + *     .setRetrySettings(
        + *         sequenceServiceSettingsBuilder
        + *             .createSequenceSettings()
        + *             .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());
        + * SequenceServiceStubSettings sequenceServiceSettings = sequenceServiceSettingsBuilder.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. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class SequenceServiceStubSettings extends StubSettings { + /** The default scopes of the service. */ + private static final ImmutableList DEFAULT_SERVICE_SCOPES = + ImmutableList.builder().build(); + + private final UnaryCallSettings createSequenceSettings; + private final UnaryCallSettings + createStreamingSequenceSettings; + private final UnaryCallSettings + getSequenceReportSettings; + private final UnaryCallSettings + getStreamingSequenceReportSettings; + private final UnaryCallSettings attemptSequenceSettings; + private final ServerStreamingCallSettings< + AttemptStreamingSequenceRequest, AttemptStreamingSequenceResponse> + attemptStreamingSequenceSettings; + private final PagedCallSettings< + ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse> + listLocationsSettings; + private final UnaryCallSettings getLocationSettings; + private final UnaryCallSettings setIamPolicySettings; + private final UnaryCallSettings getIamPolicySettings; + private final UnaryCallSettings + testIamPermissionsSettings; + + private static final PagedListDescriptor + LIST_LOCATIONS_PAGE_STR_DESC = + new PagedListDescriptor() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public ListLocationsRequest injectToken(ListLocationsRequest payload, String token) { + return ListLocationsRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public ListLocationsRequest injectPageSize(ListLocationsRequest payload, int pageSize) { + return ListLocationsRequest.newBuilder(payload).setPageSize(pageSize).build(); + } + + @Override + public Integer extractPageSize(ListLocationsRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(ListLocationsResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources(ListLocationsResponse payload) { + return payload.getLocationsList(); + } + }; + + private static final PagedListResponseFactory< + ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse> + LIST_LOCATIONS_PAGE_STR_FACT = + new PagedListResponseFactory< + ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListLocationsRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext pageContext = + PageContext.create(callable, LIST_LOCATIONS_PAGE_STR_DESC, request, context); + return ListLocationsPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + /** Returns the object with the settings used for calls to createSequence. */ + public UnaryCallSettings createSequenceSettings() { + return createSequenceSettings; + } + + /** Returns the object with the settings used for calls to createStreamingSequence. */ + public UnaryCallSettings + createStreamingSequenceSettings() { + return createStreamingSequenceSettings; + } + + /** Returns the object with the settings used for calls to getSequenceReport. */ + public UnaryCallSettings getSequenceReportSettings() { + return getSequenceReportSettings; + } + + /** Returns the object with the settings used for calls to getStreamingSequenceReport. */ + public UnaryCallSettings + getStreamingSequenceReportSettings() { + return getStreamingSequenceReportSettings; + } + + /** Returns the object with the settings used for calls to attemptSequence. */ + public UnaryCallSettings attemptSequenceSettings() { + return attemptSequenceSettings; + } + + /** Returns the object with the settings used for calls to attemptStreamingSequence. */ + public ServerStreamingCallSettings< + AttemptStreamingSequenceRequest, AttemptStreamingSequenceResponse> + attemptStreamingSequenceSettings() { + return attemptStreamingSequenceSettings; + } + + /** Returns the object with the settings used for calls to listLocations. */ + public PagedCallSettings + listLocationsSettings() { + return listLocationsSettings; + } + + /** Returns the object with the settings used for calls to getLocation. */ + public UnaryCallSettings getLocationSettings() { + return getLocationSettings; + } + + /** Returns the object with the settings used for calls to setIamPolicy. */ + public UnaryCallSettings setIamPolicySettings() { + return setIamPolicySettings; + } + + /** Returns the object with the settings used for calls to getIamPolicy. */ + public UnaryCallSettings getIamPolicySettings() { + return getIamPolicySettings; + } + + /** Returns the object with the settings used for calls to testIamPermissions. */ + public UnaryCallSettings + testIamPermissionsSettings() { + return testIamPermissionsSettings; + } + + public SequenceServiceStub createStub() throws IOException { + if (getTransportChannelProvider() + .getTransportName() + .equals(GrpcTransportChannel.getGrpcTransportName())) { + return GrpcSequenceServiceStub.create(this); + } + if (getTransportChannelProvider() + .getTransportName() + .equals(HttpJsonTransportChannel.getHttpJsonTransportName())) { + return HttpJsonSequenceServiceStub.create(this); + } + throw new UnsupportedOperationException( + String.format( + "Transport not supported: %s", getTransportChannelProvider().getTransportName())); + } + + /** Returns a builder for the default ExecutorProvider for this service. */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return InstantiatingExecutorProvider.newBuilder(); + } + + /** Returns the default service endpoint. */ + @ObsoleteApi("Use getEndpoint() instead") + public static String getDefaultEndpoint() { + return "localhost:7469"; + } + + /** Returns the default mTLS service endpoint. */ + public static String getDefaultMtlsEndpoint() { + return "localhost:7469"; + } + + /** 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 gRPC ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return InstantiatingGrpcChannelProvider.newBuilder() + .setMaxInboundMessageSize(Integer.MAX_VALUE); + } + + /** Returns a builder for the default REST ChannelProvider for this service. */ + @BetaApi + public static InstantiatingHttpJsonChannelProvider.Builder + defaultHttpJsonTransportProviderBuilder() { + return InstantiatingHttpJsonChannelProvider.newBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return defaultGrpcTransportProviderBuilder().build(); + } + + public static ApiClientHeaderProvider.Builder defaultGrpcApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken( + "gapic", GaxProperties.getLibraryVersion(SequenceServiceStubSettings.class)) + .setTransportToken( + GaxGrpcProperties.getGrpcTokenName(), GaxGrpcProperties.getGrpcVersion()); + } + + public static ApiClientHeaderProvider.Builder defaultHttpJsonApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken( + "gapic", GaxProperties.getLibraryVersion(SequenceServiceStubSettings.class)) + .setTransportToken( + GaxHttpJsonProperties.getHttpJsonTokenName(), + GaxHttpJsonProperties.getHttpJsonVersion()); + } + + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return SequenceServiceStubSettings.defaultGrpcApiClientHeaderProviderBuilder(); + } + + /** Returns a new gRPC builder for this class. */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** Returns a new REST builder for this class. */ + public static Builder newHttpJsonBuilder() { + return Builder.createHttpJsonDefault(); + } + + /** 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 SequenceServiceStubSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + + createSequenceSettings = settingsBuilder.createSequenceSettings().build(); + createStreamingSequenceSettings = settingsBuilder.createStreamingSequenceSettings().build(); + getSequenceReportSettings = settingsBuilder.getSequenceReportSettings().build(); + getStreamingSequenceReportSettings = + settingsBuilder.getStreamingSequenceReportSettings().build(); + attemptSequenceSettings = settingsBuilder.attemptSequenceSettings().build(); + attemptStreamingSequenceSettings = settingsBuilder.attemptStreamingSequenceSettings().build(); + listLocationsSettings = settingsBuilder.listLocationsSettings().build(); + getLocationSettings = settingsBuilder.getLocationSettings().build(); + setIamPolicySettings = settingsBuilder.setIamPolicySettings().build(); + getIamPolicySettings = settingsBuilder.getIamPolicySettings().build(); + testIamPermissionsSettings = settingsBuilder.testIamPermissionsSettings().build(); + } + + /** Builder for SequenceServiceStubSettings. */ + public static class Builder extends StubSettings.Builder { + private final ImmutableList> unaryMethodSettingsBuilders; + private final UnaryCallSettings.Builder createSequenceSettings; + private final UnaryCallSettings.Builder + createStreamingSequenceSettings; + private final UnaryCallSettings.Builder + getSequenceReportSettings; + private final UnaryCallSettings.Builder< + GetStreamingSequenceReportRequest, StreamingSequenceReport> + getStreamingSequenceReportSettings; + private final UnaryCallSettings.Builder attemptSequenceSettings; + private final ServerStreamingCallSettings.Builder< + AttemptStreamingSequenceRequest, AttemptStreamingSequenceResponse> + attemptStreamingSequenceSettings; + private final PagedCallSettings.Builder< + ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse> + listLocationsSettings; + private final UnaryCallSettings.Builder getLocationSettings; + private final UnaryCallSettings.Builder setIamPolicySettings; + private final UnaryCallSettings.Builder getIamPolicySettings; + private final UnaryCallSettings.Builder + testIamPermissionsSettings; + private static final ImmutableMap> + RETRYABLE_CODE_DEFINITIONS; + + static { + ImmutableMap.Builder> definitions = + ImmutableMap.builder(); + definitions.put( + "no_retry_0_codes", ImmutableSet.copyOf(Lists.newArrayList())); + definitions.put( + "retry_policy_1_codes", + ImmutableSet.copyOf( + Lists.newArrayList( + StatusCode.Code.UNAVAILABLE, StatusCode.Code.UNKNOWN))); + RETRYABLE_CODE_DEFINITIONS = definitions.build(); + } + + private static final ImmutableMap RETRY_PARAM_DEFINITIONS; + + static { + ImmutableMap.Builder definitions = ImmutableMap.builder(); + RetrySettings settings = null; + settings = + RetrySettings.newBuilder() + .setInitialRpcTimeoutDuration(Duration.ofMillis(5000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeoutDuration(Duration.ofMillis(5000L)) + .setTotalTimeoutDuration(Duration.ofMillis(5000L)) + .build(); + definitions.put("no_retry_0_params", settings); + settings = + RetrySettings.newBuilder() + .setInitialRetryDelayDuration(Duration.ofMillis(100L)) + .setRetryDelayMultiplier(2.0) + .setMaxRetryDelayDuration(Duration.ofMillis(3000L)) + .setInitialRpcTimeoutDuration(Duration.ofMillis(10000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeoutDuration(Duration.ofMillis(10000L)) + .setTotalTimeoutDuration(Duration.ofMillis(10000L)) + .build(); + definitions.put("retry_policy_1_params", settings); + RETRY_PARAM_DEFINITIONS = definitions.build(); + } + + protected Builder() { + this(((ClientContext) null)); + } + + protected Builder(ClientContext clientContext) { + super(clientContext); + + createSequenceSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + createStreamingSequenceSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + getSequenceReportSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + getStreamingSequenceReportSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + attemptSequenceSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + attemptStreamingSequenceSettings = ServerStreamingCallSettings.newBuilder(); + listLocationsSettings = PagedCallSettings.newBuilder(LIST_LOCATIONS_PAGE_STR_FACT); + getLocationSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + setIamPolicySettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + getIamPolicySettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + testIamPermissionsSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + createSequenceSettings, + createStreamingSequenceSettings, + getSequenceReportSettings, + getStreamingSequenceReportSettings, + attemptSequenceSettings, + listLocationsSettings, + getLocationSettings, + setIamPolicySettings, + getIamPolicySettings, + testIamPermissionsSettings); + initDefaults(this); + } + + protected Builder(SequenceServiceStubSettings settings) { + super(settings); + + createSequenceSettings = settings.createSequenceSettings.toBuilder(); + createStreamingSequenceSettings = settings.createStreamingSequenceSettings.toBuilder(); + getSequenceReportSettings = settings.getSequenceReportSettings.toBuilder(); + getStreamingSequenceReportSettings = settings.getStreamingSequenceReportSettings.toBuilder(); + attemptSequenceSettings = settings.attemptSequenceSettings.toBuilder(); + attemptStreamingSequenceSettings = settings.attemptStreamingSequenceSettings.toBuilder(); + listLocationsSettings = settings.listLocationsSettings.toBuilder(); + getLocationSettings = settings.getLocationSettings.toBuilder(); + setIamPolicySettings = settings.setIamPolicySettings.toBuilder(); + getIamPolicySettings = settings.getIamPolicySettings.toBuilder(); + testIamPermissionsSettings = settings.testIamPermissionsSettings.toBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + createSequenceSettings, + createStreamingSequenceSettings, + getSequenceReportSettings, + getStreamingSequenceReportSettings, + attemptSequenceSettings, + listLocationsSettings, + getLocationSettings, + setIamPolicySettings, + getIamPolicySettings, + testIamPermissionsSettings); + } + + 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 createHttpJsonDefault() { + Builder builder = new Builder(((ClientContext) null)); + + builder.setTransportChannelProvider(defaultHttpJsonTransportProviderBuilder().build()); + builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); + builder.setInternalHeaderProvider(defaultHttpJsonApiClientHeaderProviderBuilder().build()); + builder.setMtlsEndpoint(getDefaultMtlsEndpoint()); + builder.setSwitchToMtlsEndpointAllowed(true); + + return initDefaults(builder); + } + + private static Builder initDefaults(Builder builder) { + builder + .createSequenceSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + + builder + .createStreamingSequenceSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + + builder + .getSequenceReportSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + + builder + .getStreamingSequenceReportSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + + builder + .attemptSequenceSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")); + + builder + .attemptStreamingSequenceSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + + builder + .listLocationsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + + builder + .getLocationSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + + builder + .setIamPolicySettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + + builder + .getIamPolicySettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + + builder + .testIamPermissionsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + + return builder; + } + + /** + * Applies the given settings updater function to all of the unary API methods in this service. + * + *

        Note: This method does not support applying settings to streaming methods. + */ + public Builder applyToAllUnaryMethods( + ApiFunction, Void> settingsUpdater) { + super.applyToAllUnaryMethods(unaryMethodSettingsBuilders, settingsUpdater); + return this; + } + + public ImmutableList> unaryMethodSettingsBuilders() { + return unaryMethodSettingsBuilders; + } + + /** Returns the builder for the settings used for calls to createSequence. */ + public UnaryCallSettings.Builder createSequenceSettings() { + return createSequenceSettings; + } + + /** Returns the builder for the settings used for calls to createStreamingSequence. */ + public UnaryCallSettings.Builder + createStreamingSequenceSettings() { + return createStreamingSequenceSettings; + } + + /** Returns the builder for the settings used for calls to getSequenceReport. */ + public UnaryCallSettings.Builder + getSequenceReportSettings() { + return getSequenceReportSettings; + } + + /** Returns the builder for the settings used for calls to getStreamingSequenceReport. */ + public UnaryCallSettings.Builder + getStreamingSequenceReportSettings() { + return getStreamingSequenceReportSettings; + } + + /** Returns the builder for the settings used for calls to attemptSequence. */ + public UnaryCallSettings.Builder attemptSequenceSettings() { + return attemptSequenceSettings; + } + + /** Returns the builder for the settings used for calls to attemptStreamingSequence. */ + public ServerStreamingCallSettings.Builder< + AttemptStreamingSequenceRequest, AttemptStreamingSequenceResponse> + attemptStreamingSequenceSettings() { + return attemptStreamingSequenceSettings; + } + + /** Returns the builder for the settings used for calls to listLocations. */ + public PagedCallSettings.Builder< + ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse> + listLocationsSettings() { + return listLocationsSettings; + } + + /** Returns the builder for the settings used for calls to getLocation. */ + public UnaryCallSettings.Builder getLocationSettings() { + return getLocationSettings; + } + + /** Returns the builder for the settings used for calls to setIamPolicy. */ + public UnaryCallSettings.Builder setIamPolicySettings() { + return setIamPolicySettings; + } + + /** Returns the builder for the settings used for calls to getIamPolicy. */ + public UnaryCallSettings.Builder getIamPolicySettings() { + return getIamPolicySettings; + } + + /** Returns the builder for the settings used for calls to testIamPermissions. */ + public UnaryCallSettings.Builder + testIamPermissionsSettings() { + return testIamPermissionsSettings; + } + + @Override + public SequenceServiceStubSettings build() throws IOException { + return new SequenceServiceStubSettings(this); + } + } +} diff --git a/java-showcase-3.21.0/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/TestingStub.java b/java-showcase-3.21.0/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/TestingStub.java new file mode 100644 index 0000000000..fba2d4fa93 --- /dev/null +++ b/java-showcase-3.21.0/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/TestingStub.java @@ -0,0 +1,129 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.stub; + +import static com.google.showcase.v1beta1.TestingClient.ListLocationsPagedResponse; +import static com.google.showcase.v1beta1.TestingClient.ListSessionsPagedResponse; +import static com.google.showcase.v1beta1.TestingClient.ListTestsPagedResponse; + +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.protobuf.Empty; +import com.google.showcase.v1beta1.CreateSessionRequest; +import com.google.showcase.v1beta1.DeleteSessionRequest; +import com.google.showcase.v1beta1.DeleteTestRequest; +import com.google.showcase.v1beta1.GetSessionRequest; +import com.google.showcase.v1beta1.ListSessionsRequest; +import com.google.showcase.v1beta1.ListSessionsResponse; +import com.google.showcase.v1beta1.ListTestsRequest; +import com.google.showcase.v1beta1.ListTestsResponse; +import com.google.showcase.v1beta1.ReportSessionRequest; +import com.google.showcase.v1beta1.ReportSessionResponse; +import com.google.showcase.v1beta1.Session; +import com.google.showcase.v1beta1.VerifyTestRequest; +import com.google.showcase.v1beta1.VerifyTestResponse; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Base stub class for the Testing service API. + * + *

        This class is for advanced usage and reflects the underlying API directly. + */ +@BetaApi +@Generated("by gapic-generator-java") +public abstract class TestingStub implements BackgroundResource { + + public UnaryCallable createSessionCallable() { + throw new UnsupportedOperationException("Not implemented: createSessionCallable()"); + } + + public UnaryCallable getSessionCallable() { + throw new UnsupportedOperationException("Not implemented: getSessionCallable()"); + } + + public UnaryCallable listSessionsPagedCallable() { + throw new UnsupportedOperationException("Not implemented: listSessionsPagedCallable()"); + } + + public UnaryCallable listSessionsCallable() { + throw new UnsupportedOperationException("Not implemented: listSessionsCallable()"); + } + + public UnaryCallable deleteSessionCallable() { + throw new UnsupportedOperationException("Not implemented: deleteSessionCallable()"); + } + + public UnaryCallable reportSessionCallable() { + throw new UnsupportedOperationException("Not implemented: reportSessionCallable()"); + } + + public UnaryCallable listTestsPagedCallable() { + throw new UnsupportedOperationException("Not implemented: listTestsPagedCallable()"); + } + + public UnaryCallable listTestsCallable() { + throw new UnsupportedOperationException("Not implemented: listTestsCallable()"); + } + + public UnaryCallable deleteTestCallable() { + throw new UnsupportedOperationException("Not implemented: deleteTestCallable()"); + } + + public UnaryCallable verifyTestCallable() { + throw new UnsupportedOperationException("Not implemented: verifyTestCallable()"); + } + + public UnaryCallable + listLocationsPagedCallable() { + throw new UnsupportedOperationException("Not implemented: listLocationsPagedCallable()"); + } + + public UnaryCallable listLocationsCallable() { + throw new UnsupportedOperationException("Not implemented: listLocationsCallable()"); + } + + public UnaryCallable getLocationCallable() { + throw new UnsupportedOperationException("Not implemented: getLocationCallable()"); + } + + public UnaryCallable setIamPolicyCallable() { + throw new UnsupportedOperationException("Not implemented: setIamPolicyCallable()"); + } + + public UnaryCallable getIamPolicyCallable() { + throw new UnsupportedOperationException("Not implemented: getIamPolicyCallable()"); + } + + public UnaryCallable + testIamPermissionsCallable() { + throw new UnsupportedOperationException("Not implemented: testIamPermissionsCallable()"); + } + + @Override + public abstract void close(); +} diff --git a/java-showcase-3.21.0/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/TestingStubSettings.java b/java-showcase-3.21.0/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/TestingStubSettings.java new file mode 100644 index 0000000000..0f1fa4ad5b --- /dev/null +++ b/java-showcase-3.21.0/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/TestingStubSettings.java @@ -0,0 +1,801 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.stub; + +import static com.google.showcase.v1beta1.TestingClient.ListLocationsPagedResponse; +import static com.google.showcase.v1beta1.TestingClient.ListSessionsPagedResponse; +import static com.google.showcase.v1beta1.TestingClient.ListTestsPagedResponse; + +import com.google.api.core.ApiFunction; +import com.google.api.core.ApiFuture; +import com.google.api.core.BetaApi; +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.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.HttpJsonTransportChannel; +import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; +import com.google.api.gax.retrying.RetrySettings; +import com.google.api.gax.rpc.ApiCallContext; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.PagedListDescriptor; +import com.google.api.gax.rpc.PagedListResponseFactory; +import com.google.api.gax.rpc.StatusCode; +import com.google.api.gax.rpc.StubSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +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.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.protobuf.Empty; +import com.google.showcase.v1beta1.CreateSessionRequest; +import com.google.showcase.v1beta1.DeleteSessionRequest; +import com.google.showcase.v1beta1.DeleteTestRequest; +import com.google.showcase.v1beta1.GetSessionRequest; +import com.google.showcase.v1beta1.ListSessionsRequest; +import com.google.showcase.v1beta1.ListSessionsResponse; +import com.google.showcase.v1beta1.ListTestsRequest; +import com.google.showcase.v1beta1.ListTestsResponse; +import com.google.showcase.v1beta1.ReportSessionRequest; +import com.google.showcase.v1beta1.ReportSessionResponse; +import com.google.showcase.v1beta1.Session; +import com.google.showcase.v1beta1.Test; +import com.google.showcase.v1beta1.VerifyTestRequest; +import com.google.showcase.v1beta1.VerifyTestResponse; +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 TestingStub}. + * + *

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

          + *
        • The default service address (localhost) and default port (7469) 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 createSession: + * + *

        {@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
        + * TestingStubSettings.Builder testingSettingsBuilder = TestingStubSettings.newBuilder();
        + * testingSettingsBuilder
        + *     .createSessionSettings()
        + *     .setRetrySettings(
        + *         testingSettingsBuilder
        + *             .createSessionSettings()
        + *             .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());
        + * TestingStubSettings testingSettings = testingSettingsBuilder.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. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class TestingStubSettings extends StubSettings { + /** The default scopes of the service. */ + private static final ImmutableList DEFAULT_SERVICE_SCOPES = + ImmutableList.builder().build(); + + private final UnaryCallSettings createSessionSettings; + private final UnaryCallSettings getSessionSettings; + private final PagedCallSettings< + ListSessionsRequest, ListSessionsResponse, ListSessionsPagedResponse> + listSessionsSettings; + private final UnaryCallSettings deleteSessionSettings; + private final UnaryCallSettings + reportSessionSettings; + private final PagedCallSettings + listTestsSettings; + private final UnaryCallSettings deleteTestSettings; + private final UnaryCallSettings verifyTestSettings; + private final PagedCallSettings< + ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse> + listLocationsSettings; + private final UnaryCallSettings getLocationSettings; + private final UnaryCallSettings setIamPolicySettings; + private final UnaryCallSettings getIamPolicySettings; + private final UnaryCallSettings + testIamPermissionsSettings; + + private static final PagedListDescriptor + LIST_SESSIONS_PAGE_STR_DESC = + new PagedListDescriptor() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public ListSessionsRequest injectToken(ListSessionsRequest payload, String token) { + return ListSessionsRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public ListSessionsRequest injectPageSize(ListSessionsRequest payload, int pageSize) { + return ListSessionsRequest.newBuilder(payload).setPageSize(pageSize).build(); + } + + @Override + public Integer extractPageSize(ListSessionsRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(ListSessionsResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources(ListSessionsResponse payload) { + return payload.getSessionsList(); + } + }; + + private static final PagedListDescriptor + LIST_TESTS_PAGE_STR_DESC = + new PagedListDescriptor() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public ListTestsRequest injectToken(ListTestsRequest payload, String token) { + return ListTestsRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public ListTestsRequest injectPageSize(ListTestsRequest payload, int pageSize) { + return ListTestsRequest.newBuilder(payload).setPageSize(pageSize).build(); + } + + @Override + public Integer extractPageSize(ListTestsRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(ListTestsResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources(ListTestsResponse payload) { + return payload.getTestsList(); + } + }; + + private static final PagedListDescriptor + LIST_LOCATIONS_PAGE_STR_DESC = + new PagedListDescriptor() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public ListLocationsRequest injectToken(ListLocationsRequest payload, String token) { + return ListLocationsRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public ListLocationsRequest injectPageSize(ListLocationsRequest payload, int pageSize) { + return ListLocationsRequest.newBuilder(payload).setPageSize(pageSize).build(); + } + + @Override + public Integer extractPageSize(ListLocationsRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(ListLocationsResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources(ListLocationsResponse payload) { + return payload.getLocationsList(); + } + }; + + private static final PagedListResponseFactory< + ListSessionsRequest, ListSessionsResponse, ListSessionsPagedResponse> + LIST_SESSIONS_PAGE_STR_FACT = + new PagedListResponseFactory< + ListSessionsRequest, ListSessionsResponse, ListSessionsPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListSessionsRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext pageContext = + PageContext.create(callable, LIST_SESSIONS_PAGE_STR_DESC, request, context); + return ListSessionsPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + private static final PagedListResponseFactory< + ListTestsRequest, ListTestsResponse, ListTestsPagedResponse> + LIST_TESTS_PAGE_STR_FACT = + new PagedListResponseFactory< + ListTestsRequest, ListTestsResponse, ListTestsPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListTestsRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext pageContext = + PageContext.create(callable, LIST_TESTS_PAGE_STR_DESC, request, context); + return ListTestsPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + private static final PagedListResponseFactory< + ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse> + LIST_LOCATIONS_PAGE_STR_FACT = + new PagedListResponseFactory< + ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListLocationsRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext pageContext = + PageContext.create(callable, LIST_LOCATIONS_PAGE_STR_DESC, request, context); + return ListLocationsPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + /** Returns the object with the settings used for calls to createSession. */ + public UnaryCallSettings createSessionSettings() { + return createSessionSettings; + } + + /** Returns the object with the settings used for calls to getSession. */ + public UnaryCallSettings getSessionSettings() { + return getSessionSettings; + } + + /** Returns the object with the settings used for calls to listSessions. */ + public PagedCallSettings + listSessionsSettings() { + return listSessionsSettings; + } + + /** Returns the object with the settings used for calls to deleteSession. */ + public UnaryCallSettings deleteSessionSettings() { + return deleteSessionSettings; + } + + /** Returns the object with the settings used for calls to reportSession. */ + public UnaryCallSettings reportSessionSettings() { + return reportSessionSettings; + } + + /** Returns the object with the settings used for calls to listTests. */ + public PagedCallSettings + listTestsSettings() { + return listTestsSettings; + } + + /** Returns the object with the settings used for calls to deleteTest. */ + public UnaryCallSettings deleteTestSettings() { + return deleteTestSettings; + } + + /** Returns the object with the settings used for calls to verifyTest. */ + public UnaryCallSettings verifyTestSettings() { + return verifyTestSettings; + } + + /** Returns the object with the settings used for calls to listLocations. */ + public PagedCallSettings + listLocationsSettings() { + return listLocationsSettings; + } + + /** Returns the object with the settings used for calls to getLocation. */ + public UnaryCallSettings getLocationSettings() { + return getLocationSettings; + } + + /** Returns the object with the settings used for calls to setIamPolicy. */ + public UnaryCallSettings setIamPolicySettings() { + return setIamPolicySettings; + } + + /** Returns the object with the settings used for calls to getIamPolicy. */ + public UnaryCallSettings getIamPolicySettings() { + return getIamPolicySettings; + } + + /** Returns the object with the settings used for calls to testIamPermissions. */ + public UnaryCallSettings + testIamPermissionsSettings() { + return testIamPermissionsSettings; + } + + public TestingStub createStub() throws IOException { + if (getTransportChannelProvider() + .getTransportName() + .equals(GrpcTransportChannel.getGrpcTransportName())) { + return GrpcTestingStub.create(this); + } + if (getTransportChannelProvider() + .getTransportName() + .equals(HttpJsonTransportChannel.getHttpJsonTransportName())) { + return HttpJsonTestingStub.create(this); + } + throw new UnsupportedOperationException( + String.format( + "Transport not supported: %s", getTransportChannelProvider().getTransportName())); + } + + /** Returns a builder for the default ExecutorProvider for this service. */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return InstantiatingExecutorProvider.newBuilder(); + } + + /** Returns the default service endpoint. */ + @ObsoleteApi("Use getEndpoint() instead") + public static String getDefaultEndpoint() { + return "localhost:7469"; + } + + /** Returns the default mTLS service endpoint. */ + public static String getDefaultMtlsEndpoint() { + return "localhost:7469"; + } + + /** 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 gRPC ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return InstantiatingGrpcChannelProvider.newBuilder() + .setMaxInboundMessageSize(Integer.MAX_VALUE); + } + + /** Returns a builder for the default REST ChannelProvider for this service. */ + @BetaApi + public static InstantiatingHttpJsonChannelProvider.Builder + defaultHttpJsonTransportProviderBuilder() { + return InstantiatingHttpJsonChannelProvider.newBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return defaultGrpcTransportProviderBuilder().build(); + } + + public static ApiClientHeaderProvider.Builder defaultGrpcApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken("gapic", GaxProperties.getLibraryVersion(TestingStubSettings.class)) + .setTransportToken( + GaxGrpcProperties.getGrpcTokenName(), GaxGrpcProperties.getGrpcVersion()); + } + + public static ApiClientHeaderProvider.Builder defaultHttpJsonApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken("gapic", GaxProperties.getLibraryVersion(TestingStubSettings.class)) + .setTransportToken( + GaxHttpJsonProperties.getHttpJsonTokenName(), + GaxHttpJsonProperties.getHttpJsonVersion()); + } + + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return TestingStubSettings.defaultGrpcApiClientHeaderProviderBuilder(); + } + + /** Returns a new gRPC builder for this class. */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** Returns a new REST builder for this class. */ + public static Builder newHttpJsonBuilder() { + return Builder.createHttpJsonDefault(); + } + + /** 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 TestingStubSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + + createSessionSettings = settingsBuilder.createSessionSettings().build(); + getSessionSettings = settingsBuilder.getSessionSettings().build(); + listSessionsSettings = settingsBuilder.listSessionsSettings().build(); + deleteSessionSettings = settingsBuilder.deleteSessionSettings().build(); + reportSessionSettings = settingsBuilder.reportSessionSettings().build(); + listTestsSettings = settingsBuilder.listTestsSettings().build(); + deleteTestSettings = settingsBuilder.deleteTestSettings().build(); + verifyTestSettings = settingsBuilder.verifyTestSettings().build(); + listLocationsSettings = settingsBuilder.listLocationsSettings().build(); + getLocationSettings = settingsBuilder.getLocationSettings().build(); + setIamPolicySettings = settingsBuilder.setIamPolicySettings().build(); + getIamPolicySettings = settingsBuilder.getIamPolicySettings().build(); + testIamPermissionsSettings = settingsBuilder.testIamPermissionsSettings().build(); + } + + /** Builder for TestingStubSettings. */ + public static class Builder extends StubSettings.Builder { + private final ImmutableList> unaryMethodSettingsBuilders; + private final UnaryCallSettings.Builder createSessionSettings; + private final UnaryCallSettings.Builder getSessionSettings; + private final PagedCallSettings.Builder< + ListSessionsRequest, ListSessionsResponse, ListSessionsPagedResponse> + listSessionsSettings; + private final UnaryCallSettings.Builder deleteSessionSettings; + private final UnaryCallSettings.Builder + reportSessionSettings; + private final PagedCallSettings.Builder< + ListTestsRequest, ListTestsResponse, ListTestsPagedResponse> + listTestsSettings; + private final UnaryCallSettings.Builder deleteTestSettings; + private final UnaryCallSettings.Builder + verifyTestSettings; + private final PagedCallSettings.Builder< + ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse> + listLocationsSettings; + private final UnaryCallSettings.Builder getLocationSettings; + private final UnaryCallSettings.Builder setIamPolicySettings; + private final UnaryCallSettings.Builder getIamPolicySettings; + private final UnaryCallSettings.Builder + testIamPermissionsSettings; + private static final ImmutableMap> + RETRYABLE_CODE_DEFINITIONS; + + static { + ImmutableMap.Builder> definitions = + ImmutableMap.builder(); + definitions.put("no_retry_codes", ImmutableSet.copyOf(Lists.newArrayList())); + RETRYABLE_CODE_DEFINITIONS = definitions.build(); + } + + private static final ImmutableMap RETRY_PARAM_DEFINITIONS; + + static { + ImmutableMap.Builder definitions = ImmutableMap.builder(); + RetrySettings settings = null; + settings = RetrySettings.newBuilder().setRpcTimeoutMultiplier(1.0).build(); + definitions.put("no_retry_params", settings); + RETRY_PARAM_DEFINITIONS = definitions.build(); + } + + protected Builder() { + this(((ClientContext) null)); + } + + protected Builder(ClientContext clientContext) { + super(clientContext); + + createSessionSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + getSessionSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + listSessionsSettings = PagedCallSettings.newBuilder(LIST_SESSIONS_PAGE_STR_FACT); + deleteSessionSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + reportSessionSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + listTestsSettings = PagedCallSettings.newBuilder(LIST_TESTS_PAGE_STR_FACT); + deleteTestSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + verifyTestSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + listLocationsSettings = PagedCallSettings.newBuilder(LIST_LOCATIONS_PAGE_STR_FACT); + getLocationSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + setIamPolicySettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + getIamPolicySettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + testIamPermissionsSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + createSessionSettings, + getSessionSettings, + listSessionsSettings, + deleteSessionSettings, + reportSessionSettings, + listTestsSettings, + deleteTestSettings, + verifyTestSettings, + listLocationsSettings, + getLocationSettings, + setIamPolicySettings, + getIamPolicySettings, + testIamPermissionsSettings); + initDefaults(this); + } + + protected Builder(TestingStubSettings settings) { + super(settings); + + createSessionSettings = settings.createSessionSettings.toBuilder(); + getSessionSettings = settings.getSessionSettings.toBuilder(); + listSessionsSettings = settings.listSessionsSettings.toBuilder(); + deleteSessionSettings = settings.deleteSessionSettings.toBuilder(); + reportSessionSettings = settings.reportSessionSettings.toBuilder(); + listTestsSettings = settings.listTestsSettings.toBuilder(); + deleteTestSettings = settings.deleteTestSettings.toBuilder(); + verifyTestSettings = settings.verifyTestSettings.toBuilder(); + listLocationsSettings = settings.listLocationsSettings.toBuilder(); + getLocationSettings = settings.getLocationSettings.toBuilder(); + setIamPolicySettings = settings.setIamPolicySettings.toBuilder(); + getIamPolicySettings = settings.getIamPolicySettings.toBuilder(); + testIamPermissionsSettings = settings.testIamPermissionsSettings.toBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + createSessionSettings, + getSessionSettings, + listSessionsSettings, + deleteSessionSettings, + reportSessionSettings, + listTestsSettings, + deleteTestSettings, + verifyTestSettings, + listLocationsSettings, + getLocationSettings, + setIamPolicySettings, + getIamPolicySettings, + testIamPermissionsSettings); + } + + 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 createHttpJsonDefault() { + Builder builder = new Builder(((ClientContext) null)); + + builder.setTransportChannelProvider(defaultHttpJsonTransportProviderBuilder().build()); + builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); + builder.setInternalHeaderProvider(defaultHttpJsonApiClientHeaderProviderBuilder().build()); + builder.setMtlsEndpoint(getDefaultMtlsEndpoint()); + builder.setSwitchToMtlsEndpointAllowed(true); + + return initDefaults(builder); + } + + private static Builder initDefaults(Builder builder) { + builder + .createSessionSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .getSessionSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .listSessionsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .deleteSessionSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .reportSessionSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .listTestsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .deleteTestSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .verifyTestSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .listLocationsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .getLocationSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .setIamPolicySettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .getIamPolicySettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .testIamPermissionsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_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 createSession. */ + public UnaryCallSettings.Builder createSessionSettings() { + return createSessionSettings; + } + + /** Returns the builder for the settings used for calls to getSession. */ + public UnaryCallSettings.Builder getSessionSettings() { + return getSessionSettings; + } + + /** Returns the builder for the settings used for calls to listSessions. */ + public PagedCallSettings.Builder< + ListSessionsRequest, ListSessionsResponse, ListSessionsPagedResponse> + listSessionsSettings() { + return listSessionsSettings; + } + + /** Returns the builder for the settings used for calls to deleteSession. */ + public UnaryCallSettings.Builder deleteSessionSettings() { + return deleteSessionSettings; + } + + /** Returns the builder for the settings used for calls to reportSession. */ + public UnaryCallSettings.Builder + reportSessionSettings() { + return reportSessionSettings; + } + + /** Returns the builder for the settings used for calls to listTests. */ + public PagedCallSettings.Builder + listTestsSettings() { + return listTestsSettings; + } + + /** Returns the builder for the settings used for calls to deleteTest. */ + public UnaryCallSettings.Builder deleteTestSettings() { + return deleteTestSettings; + } + + /** Returns the builder for the settings used for calls to verifyTest. */ + public UnaryCallSettings.Builder verifyTestSettings() { + return verifyTestSettings; + } + + /** Returns the builder for the settings used for calls to listLocations. */ + public PagedCallSettings.Builder< + ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse> + listLocationsSettings() { + return listLocationsSettings; + } + + /** Returns the builder for the settings used for calls to getLocation. */ + public UnaryCallSettings.Builder getLocationSettings() { + return getLocationSettings; + } + + /** Returns the builder for the settings used for calls to setIamPolicy. */ + public UnaryCallSettings.Builder setIamPolicySettings() { + return setIamPolicySettings; + } + + /** Returns the builder for the settings used for calls to getIamPolicy. */ + public UnaryCallSettings.Builder getIamPolicySettings() { + return getIamPolicySettings; + } + + /** Returns the builder for the settings used for calls to testIamPermissions. */ + public UnaryCallSettings.Builder + testIamPermissionsSettings() { + return testIamPermissionsSettings; + } + + @Override + public TestingStubSettings build() throws IOException { + return new TestingStubSettings(this); + } + } +} diff --git a/java-showcase-3.21.0/gapic-showcase/src/main/resources/META-INF/native-image/com.google.showcase.v1beta1/reflect-config.json b/java-showcase-3.21.0/gapic-showcase/src/main/resources/META-INF/native-image/com.google.showcase.v1beta1/reflect-config.json new file mode 100644 index 0000000000..077caee652 --- /dev/null +++ b/java-showcase-3.21.0/gapic-showcase/src/main/resources/META-INF/native-image/com.google.showcase.v1beta1/reflect-config.json @@ -0,0 +1,3674 @@ +[ + { + "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.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.FieldInfo", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.FieldInfo$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.FieldInfo$Format", + "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.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.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.RoutingParameter", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.RoutingParameter$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.RoutingRule", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.RoutingRule$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.api.TypeReference", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.TypeReference$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.location.GetLocationRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.location.GetLocationRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.location.ListLocationsRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.location.ListLocationsRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.location.ListLocationsResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.location.ListLocationsResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.location.Location", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.location.Location$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.iam.v1.AuditConfig", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.iam.v1.AuditConfig$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.iam.v1.AuditConfigDelta", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.iam.v1.AuditConfigDelta$Action", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.iam.v1.AuditConfigDelta$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.iam.v1.AuditLogConfig", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.iam.v1.AuditLogConfig$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.iam.v1.AuditLogConfig$LogType", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.iam.v1.Binding", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.iam.v1.Binding$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.iam.v1.BindingDelta", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.iam.v1.BindingDelta$Action", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.iam.v1.BindingDelta$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.iam.v1.GetIamPolicyRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.iam.v1.GetIamPolicyRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.iam.v1.GetPolicyOptions", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.iam.v1.GetPolicyOptions$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.iam.v1.Policy", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.iam.v1.Policy$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.iam.v1.PolicyDelta", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.iam.v1.PolicyDelta$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.iam.v1.SetIamPolicyRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.iam.v1.SetIamPolicyRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.iam.v1.TestIamPermissionsRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.iam.v1.TestIamPermissionsRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.iam.v1.TestIamPermissionsResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.iam.v1.TestIamPermissionsResponse$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$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$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$JSType", + "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$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.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.rpc.BadRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.rpc.BadRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.rpc.BadRequest$FieldViolation", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.rpc.BadRequest$FieldViolation$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.rpc.Code", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.rpc.DebugInfo", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.rpc.DebugInfo$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.rpc.ErrorInfo", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.rpc.ErrorInfo$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.rpc.Help", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.rpc.Help$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.rpc.Help$Link", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.rpc.Help$Link$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.rpc.LocalizedMessage", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.rpc.LocalizedMessage$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.rpc.PreconditionFailure", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.rpc.PreconditionFailure$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.rpc.PreconditionFailure$Violation", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.rpc.PreconditionFailure$Violation$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.rpc.QuotaFailure", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.rpc.QuotaFailure$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.rpc.QuotaFailure$Violation", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.rpc.QuotaFailure$Violation$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.rpc.RequestInfo", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.rpc.RequestInfo$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.rpc.ResourceInfo", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.rpc.ResourceInfo$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.rpc.RetryInfo", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.rpc.RetryInfo$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 + }, + { + "name": "com.google.showcase.v1beta1.AttemptSequenceRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.AttemptSequenceRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.AttemptStreamingSequenceRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.AttemptStreamingSequenceRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.AttemptStreamingSequenceResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.AttemptStreamingSequenceResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.BlockRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.BlockRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.BlockResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.BlockResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.Blurb", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.Blurb$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.ComplianceData", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.ComplianceData$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.ComplianceData$LifeKingdom", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.ComplianceDataChild", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.ComplianceDataChild$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.ComplianceDataGrandchild", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.ComplianceDataGrandchild$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.ComplianceGroup", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.ComplianceGroup$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.ComplianceSuite", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.ComplianceSuite$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.ConnectRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.ConnectRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.ConnectRequest$ConnectConfig", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.ConnectRequest$ConnectConfig$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.Continent", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.CreateBlurbRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.CreateBlurbRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.CreateRoomRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.CreateRoomRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.CreateSequenceRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.CreateSequenceRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.CreateSessionRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.CreateSessionRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.CreateStreamingSequenceRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.CreateStreamingSequenceRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.CreateUserRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.CreateUserRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.DeleteBlurbRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.DeleteBlurbRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.DeleteRoomRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.DeleteRoomRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.DeleteSessionRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.DeleteSessionRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.DeleteTestRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.DeleteTestRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.DeleteUserRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.DeleteUserRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.EchoErrorDetailsRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.EchoErrorDetailsRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.EchoErrorDetailsResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.EchoErrorDetailsResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.EchoErrorDetailsResponse$MultipleDetails", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.EchoErrorDetailsResponse$MultipleDetails$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.EchoErrorDetailsResponse$SingleDetail", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.EchoErrorDetailsResponse$SingleDetail$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.EchoRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.EchoRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.EchoResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.EchoResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.EnumRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.EnumRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.EnumResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.EnumResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.ErrorWithMultipleDetails", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.ErrorWithMultipleDetails$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.ErrorWithSingleDetail", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.ErrorWithSingleDetail$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.ExpandRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.ExpandRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.FailEchoWithDetailsRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.FailEchoWithDetailsRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.FailEchoWithDetailsResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.FailEchoWithDetailsResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.GetBlurbRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.GetBlurbRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.GetRoomRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.GetRoomRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.GetSequenceReportRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.GetSequenceReportRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.GetSessionRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.GetSessionRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.GetStreamingSequenceReportRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.GetStreamingSequenceReportRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.GetUserRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.GetUserRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.Issue", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.Issue$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.Issue$Severity", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.Issue$Type", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.ListBlurbsRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.ListBlurbsRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.ListBlurbsResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.ListBlurbsResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.ListRoomsRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.ListRoomsRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.ListRoomsResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.ListRoomsResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.ListSessionsRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.ListSessionsRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.ListSessionsResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.ListSessionsResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.ListTestsRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.ListTestsRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.ListTestsResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.ListTestsResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.ListUsersRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.ListUsersRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.ListUsersResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.ListUsersResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.PagedExpandLegacyMappedResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.PagedExpandLegacyMappedResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.PagedExpandLegacyRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.PagedExpandLegacyRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.PagedExpandRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.PagedExpandRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.PagedExpandResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.PagedExpandResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.PagedExpandResponseList", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.PagedExpandResponseList$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.PoetryError", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.PoetryError$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.RepeatRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.RepeatRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.RepeatResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.RepeatResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.ReportSessionRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.ReportSessionRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.ReportSessionResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.ReportSessionResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.ReportSessionResponse$Result", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.RestError", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.RestError$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.RestError$Status", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.RestError$Status$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.Room", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.Room$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.SearchBlurbsMetadata", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.SearchBlurbsMetadata$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.SearchBlurbsRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.SearchBlurbsRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.SearchBlurbsResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.SearchBlurbsResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.SendBlurbsResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.SendBlurbsResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.Sequence", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.Sequence$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.Sequence$Response", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.Sequence$Response$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.SequenceReport", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.SequenceReport$Attempt", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.SequenceReport$Attempt$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.SequenceReport$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.Session", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.Session$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.Session$Version", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.Severity", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.StreamBlurbsRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.StreamBlurbsRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.StreamBlurbsResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.StreamBlurbsResponse$Action", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.StreamBlurbsResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.StreamingSequence", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.StreamingSequence$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.StreamingSequence$Response", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.StreamingSequence$Response$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.StreamingSequenceReport", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.StreamingSequenceReport$Attempt", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.StreamingSequenceReport$Attempt$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.StreamingSequenceReport$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.Test", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.Test$Blueprint", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.Test$Blueprint$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.Test$Blueprint$Invocation", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.Test$Blueprint$Invocation$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.Test$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.Test$ExpectationLevel", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.TestRun", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.TestRun$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.UpdateBlurbRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.UpdateBlurbRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.UpdateRoomRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.UpdateRoomRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.UpdateUserRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.UpdateUserRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.User", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.User$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.VerifyTestRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.VerifyTestRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.VerifyTestResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.VerifyTestResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.WaitMetadata", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.WaitMetadata$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.WaitRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.WaitRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.WaitResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.WaitResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.type.Expr", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.type.Expr$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + } +] \ No newline at end of file diff --git a/java-showcase-3.21.0/gapic-showcase/src/test/java/com/google/showcase/v1beta1/ComplianceClientHttpJsonTest.java b/java-showcase-3.21.0/gapic-showcase/src/test/java/com/google/showcase/v1beta1/ComplianceClientHttpJsonTest.java new file mode 100644 index 0000000000..345817b5e5 --- /dev/null +++ b/java-showcase-3.21.0/gapic-showcase/src/test/java/com/google/showcase/v1beta1/ComplianceClientHttpJsonTest.java @@ -0,0 +1,1215 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1; + +import static com.google.showcase.v1beta1.ComplianceClient.ListLocationsPagedResponse; + +import com.google.api.gax.core.NoCredentialsProvider; +import com.google.api.gax.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.testing.MockHttpService; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ApiException; +import com.google.api.gax.rpc.ApiExceptionFactory; +import com.google.api.gax.rpc.InvalidArgumentException; +import com.google.api.gax.rpc.StatusCode; +import com.google.api.gax.rpc.testing.FakeStatusCode; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.common.collect.Lists; +import com.google.iam.v1.AuditConfig; +import com.google.iam.v1.Binding; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.GetPolicyOptions; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.protobuf.Any; +import com.google.protobuf.ByteString; +import com.google.protobuf.FieldMask; +import com.google.showcase.v1beta1.stub.HttpJsonComplianceStub; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +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 ComplianceClientHttpJsonTest { + private static MockHttpService mockService; + private static ComplianceClient client; + + @BeforeClass + public static void startStaticServer() throws IOException { + mockService = + new MockHttpService( + HttpJsonComplianceStub.getMethodDescriptors(), ComplianceSettings.getDefaultEndpoint()); + ComplianceSettings settings = + ComplianceSettings.newHttpJsonBuilder() + .setTransportChannelProvider( + ComplianceSettings.defaultHttpJsonTransportProviderBuilder() + .setHttpTransport(mockService) + .build()) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = ComplianceClient.create(settings); + } + + @AfterClass + public static void stopServer() { + client.close(); + } + + @Before + public void setUp() {} + + @After + public void tearDown() throws Exception { + mockService.reset(); + } + + @Test + public void repeatDataBodyTest() throws Exception { + RepeatResponse expectedResponse = + RepeatResponse.newBuilder() + .setRequest(RepeatRequest.newBuilder().build()) + .setBindingUri("bindingUri1514820775") + .build(); + mockService.addResponse(expectedResponse); + + RepeatRequest request = + RepeatRequest.newBuilder() + .setName("name3373707") + .setInfo(ComplianceData.newBuilder().build()) + .setServerVerify(true) + .setIntendedBindingUri("intendedBindingUri780142386") + .setFInt32(-1143775883) + .setFInt64(-1143775788) + .setFDouble(-1239459382) + .setPInt32(-858673665) + .setPInt64(-858673570) + .setPDouble(-991225216) + .build(); + + RepeatResponse actualResponse = client.repeatDataBody(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void repeatDataBodyExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + RepeatRequest request = + RepeatRequest.newBuilder() + .setName("name3373707") + .setInfo(ComplianceData.newBuilder().build()) + .setServerVerify(true) + .setIntendedBindingUri("intendedBindingUri780142386") + .setFInt32(-1143775883) + .setFInt64(-1143775788) + .setFDouble(-1239459382) + .setPInt32(-858673665) + .setPInt64(-858673570) + .setPDouble(-991225216) + .build(); + client.repeatDataBody(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void repeatDataBodyInfoTest() throws Exception { + RepeatResponse expectedResponse = + RepeatResponse.newBuilder() + .setRequest(RepeatRequest.newBuilder().build()) + .setBindingUri("bindingUri1514820775") + .build(); + mockService.addResponse(expectedResponse); + + RepeatRequest request = + RepeatRequest.newBuilder() + .setName("name3373707") + .setInfo(ComplianceData.newBuilder().build()) + .setServerVerify(true) + .setIntendedBindingUri("intendedBindingUri780142386") + .setFInt32(-1143775883) + .setFInt64(-1143775788) + .setFDouble(-1239459382) + .setPInt32(-858673665) + .setPInt64(-858673570) + .setPDouble(-991225216) + .build(); + + RepeatResponse actualResponse = client.repeatDataBodyInfo(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void repeatDataBodyInfoExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + RepeatRequest request = + RepeatRequest.newBuilder() + .setName("name3373707") + .setInfo(ComplianceData.newBuilder().build()) + .setServerVerify(true) + .setIntendedBindingUri("intendedBindingUri780142386") + .setFInt32(-1143775883) + .setFInt64(-1143775788) + .setFDouble(-1239459382) + .setPInt32(-858673665) + .setPInt64(-858673570) + .setPDouble(-991225216) + .build(); + client.repeatDataBodyInfo(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void repeatDataQueryTest() throws Exception { + RepeatResponse expectedResponse = + RepeatResponse.newBuilder() + .setRequest(RepeatRequest.newBuilder().build()) + .setBindingUri("bindingUri1514820775") + .build(); + mockService.addResponse(expectedResponse); + + RepeatRequest request = + RepeatRequest.newBuilder() + .setName("name3373707") + .setInfo(ComplianceData.newBuilder().build()) + .setServerVerify(true) + .setIntendedBindingUri("intendedBindingUri780142386") + .setFInt32(-1143775883) + .setFInt64(-1143775788) + .setFDouble(-1239459382) + .setPInt32(-858673665) + .setPInt64(-858673570) + .setPDouble(-991225216) + .build(); + + RepeatResponse actualResponse = client.repeatDataQuery(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void repeatDataQueryExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + RepeatRequest request = + RepeatRequest.newBuilder() + .setName("name3373707") + .setInfo(ComplianceData.newBuilder().build()) + .setServerVerify(true) + .setIntendedBindingUri("intendedBindingUri780142386") + .setFInt32(-1143775883) + .setFInt64(-1143775788) + .setFDouble(-1239459382) + .setPInt32(-858673665) + .setPInt64(-858673570) + .setPDouble(-991225216) + .build(); + client.repeatDataQuery(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void repeatDataSimplePathTest() throws Exception { + RepeatResponse expectedResponse = + RepeatResponse.newBuilder() + .setRequest(RepeatRequest.newBuilder().build()) + .setBindingUri("bindingUri1514820775") + .build(); + mockService.addResponse(expectedResponse); + + RepeatRequest request = + RepeatRequest.newBuilder() + .setName("name3373707") + .setInfo( + ComplianceData.newBuilder() + .setFString("fString-9139") + .setFInt32(-1143775883) + .setFSint32(-815756300) + .setFSfixed32(-763212615) + .setFUint32(-758497998) + .setFFixed32(1837548026) + .setFInt64(-1143775788) + .setFSint64(-815756205) + .setFSfixed64(-763212520) + .setFUint64(-758497903) + .setFFixed64(1837548121) + .setFDouble(-1239459382) + .setFFloat(-1146609341) + .setFBool(true) + .setFBytes(ByteString.EMPTY) + .setFChild(ComplianceDataChild.newBuilder().build()) + .setPString("pString-1191954271") + .setPInt32(-858673665) + .setPDouble(-991225216) + .setPBool(true) + .setPChild(ComplianceDataChild.newBuilder().build()) + .build()) + .setServerVerify(true) + .setIntendedBindingUri("intendedBindingUri780142386") + .setFInt32(-1143775883) + .setFInt64(-1143775788) + .setFDouble(-1239459382) + .setPInt32(-858673665) + .setPInt64(-858673570) + .setPDouble(-991225216) + .build(); + + RepeatResponse actualResponse = client.repeatDataSimplePath(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void repeatDataSimplePathExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + RepeatRequest request = + RepeatRequest.newBuilder() + .setName("name3373707") + .setInfo( + ComplianceData.newBuilder() + .setFString("fString-9139") + .setFInt32(-1143775883) + .setFSint32(-815756300) + .setFSfixed32(-763212615) + .setFUint32(-758497998) + .setFFixed32(1837548026) + .setFInt64(-1143775788) + .setFSint64(-815756205) + .setFSfixed64(-763212520) + .setFUint64(-758497903) + .setFFixed64(1837548121) + .setFDouble(-1239459382) + .setFFloat(-1146609341) + .setFBool(true) + .setFBytes(ByteString.EMPTY) + .setFChild(ComplianceDataChild.newBuilder().build()) + .setPString("pString-1191954271") + .setPInt32(-858673665) + .setPDouble(-991225216) + .setPBool(true) + .setPChild(ComplianceDataChild.newBuilder().build()) + .build()) + .setServerVerify(true) + .setIntendedBindingUri("intendedBindingUri780142386") + .setFInt32(-1143775883) + .setFInt64(-1143775788) + .setFDouble(-1239459382) + .setPInt32(-858673665) + .setPInt64(-858673570) + .setPDouble(-991225216) + .build(); + client.repeatDataSimplePath(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void repeatDataPathResourceTest() throws Exception { + RepeatResponse expectedResponse = + RepeatResponse.newBuilder() + .setRequest(RepeatRequest.newBuilder().build()) + .setBindingUri("bindingUri1514820775") + .build(); + mockService.addResponse(expectedResponse); + + RepeatRequest request = + RepeatRequest.newBuilder() + .setName("name3373707") + .setInfo( + ComplianceData.newBuilder() + .setFString("first/firs-9148") + .setFInt32(-1143775883) + .setFSint32(-815756300) + .setFSfixed32(-763212615) + .setFUint32(-758497998) + .setFFixed32(1837548026) + .setFInt64(-1143775788) + .setFSint64(-815756205) + .setFSfixed64(-763212520) + .setFUint64(-758497903) + .setFFixed64(1837548121) + .setFDouble(-1239459382) + .setFFloat(-1146609341) + .setFBool(true) + .setFBytes(ByteString.EMPTY) + .setFChild( + ComplianceDataChild.newBuilder() + .setFString("second/secon-5446") + .setFFloat(-1146609341) + .setFDouble(-1239459382) + .setFBool(true) + .setFContinent(Continent.forNumber(0)) + .setFChild(ComplianceDataGrandchild.newBuilder().build()) + .setPString("pString-1191954271") + .setPFloat(-861507123) + .setPDouble(-991225216) + .setPBool(true) + .setPContinent(Continent.forNumber(0)) + .setPChild(ComplianceDataGrandchild.newBuilder().build()) + .build()) + .setPString("pString-1191954271") + .setPInt32(-858673665) + .setPDouble(-991225216) + .setPBool(true) + .setPChild(ComplianceDataChild.newBuilder().build()) + .build()) + .setServerVerify(true) + .setIntendedBindingUri("intendedBindingUri780142386") + .setFInt32(-1143775883) + .setFInt64(-1143775788) + .setFDouble(-1239459382) + .setPInt32(-858673665) + .setPInt64(-858673570) + .setPDouble(-991225216) + .build(); + + RepeatResponse actualResponse = client.repeatDataPathResource(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void repeatDataPathResourceExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + RepeatRequest request = + RepeatRequest.newBuilder() + .setName("name3373707") + .setInfo( + ComplianceData.newBuilder() + .setFString("first/firs-9148") + .setFInt32(-1143775883) + .setFSint32(-815756300) + .setFSfixed32(-763212615) + .setFUint32(-758497998) + .setFFixed32(1837548026) + .setFInt64(-1143775788) + .setFSint64(-815756205) + .setFSfixed64(-763212520) + .setFUint64(-758497903) + .setFFixed64(1837548121) + .setFDouble(-1239459382) + .setFFloat(-1146609341) + .setFBool(true) + .setFBytes(ByteString.EMPTY) + .setFChild( + ComplianceDataChild.newBuilder() + .setFString("second/secon-5446") + .setFFloat(-1146609341) + .setFDouble(-1239459382) + .setFBool(true) + .setFContinent(Continent.forNumber(0)) + .setFChild(ComplianceDataGrandchild.newBuilder().build()) + .setPString("pString-1191954271") + .setPFloat(-861507123) + .setPDouble(-991225216) + .setPBool(true) + .setPContinent(Continent.forNumber(0)) + .setPChild(ComplianceDataGrandchild.newBuilder().build()) + .build()) + .setPString("pString-1191954271") + .setPInt32(-858673665) + .setPDouble(-991225216) + .setPBool(true) + .setPChild(ComplianceDataChild.newBuilder().build()) + .build()) + .setServerVerify(true) + .setIntendedBindingUri("intendedBindingUri780142386") + .setFInt32(-1143775883) + .setFInt64(-1143775788) + .setFDouble(-1239459382) + .setPInt32(-858673665) + .setPInt64(-858673570) + .setPDouble(-991225216) + .build(); + client.repeatDataPathResource(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void repeatDataPathTrailingResourceTest() throws Exception { + RepeatResponse expectedResponse = + RepeatResponse.newBuilder() + .setRequest(RepeatRequest.newBuilder().build()) + .setBindingUri("bindingUri1514820775") + .build(); + mockService.addResponse(expectedResponse); + + RepeatRequest request = + RepeatRequest.newBuilder() + .setName("name3373707") + .setInfo( + ComplianceData.newBuilder() + .setFString("first/firs-9148") + .setFInt32(-1143775883) + .setFSint32(-815756300) + .setFSfixed32(-763212615) + .setFUint32(-758497998) + .setFFixed32(1837548026) + .setFInt64(-1143775788) + .setFSint64(-815756205) + .setFSfixed64(-763212520) + .setFUint64(-758497903) + .setFFixed64(1837548121) + .setFDouble(-1239459382) + .setFFloat(-1146609341) + .setFBool(true) + .setFBytes(ByteString.EMPTY) + .setFChild( + ComplianceDataChild.newBuilder() + .setFString("second/secon-3276") + .setFFloat(-1146609341) + .setFDouble(-1239459382) + .setFBool(true) + .setFContinent(Continent.forNumber(0)) + .setFChild(ComplianceDataGrandchild.newBuilder().build()) + .setPString("pString-1191954271") + .setPFloat(-861507123) + .setPDouble(-991225216) + .setPBool(true) + .setPContinent(Continent.forNumber(0)) + .setPChild(ComplianceDataGrandchild.newBuilder().build()) + .build()) + .setPString("pString-1191954271") + .setPInt32(-858673665) + .setPDouble(-991225216) + .setPBool(true) + .setPChild(ComplianceDataChild.newBuilder().build()) + .build()) + .setServerVerify(true) + .setIntendedBindingUri("intendedBindingUri780142386") + .setFInt32(-1143775883) + .setFInt64(-1143775788) + .setFDouble(-1239459382) + .setPInt32(-858673665) + .setPInt64(-858673570) + .setPDouble(-991225216) + .build(); + + RepeatResponse actualResponse = client.repeatDataPathTrailingResource(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void repeatDataPathTrailingResourceExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + RepeatRequest request = + RepeatRequest.newBuilder() + .setName("name3373707") + .setInfo( + ComplianceData.newBuilder() + .setFString("first/firs-9148") + .setFInt32(-1143775883) + .setFSint32(-815756300) + .setFSfixed32(-763212615) + .setFUint32(-758497998) + .setFFixed32(1837548026) + .setFInt64(-1143775788) + .setFSint64(-815756205) + .setFSfixed64(-763212520) + .setFUint64(-758497903) + .setFFixed64(1837548121) + .setFDouble(-1239459382) + .setFFloat(-1146609341) + .setFBool(true) + .setFBytes(ByteString.EMPTY) + .setFChild( + ComplianceDataChild.newBuilder() + .setFString("second/secon-3276") + .setFFloat(-1146609341) + .setFDouble(-1239459382) + .setFBool(true) + .setFContinent(Continent.forNumber(0)) + .setFChild(ComplianceDataGrandchild.newBuilder().build()) + .setPString("pString-1191954271") + .setPFloat(-861507123) + .setPDouble(-991225216) + .setPBool(true) + .setPContinent(Continent.forNumber(0)) + .setPChild(ComplianceDataGrandchild.newBuilder().build()) + .build()) + .setPString("pString-1191954271") + .setPInt32(-858673665) + .setPDouble(-991225216) + .setPBool(true) + .setPChild(ComplianceDataChild.newBuilder().build()) + .build()) + .setServerVerify(true) + .setIntendedBindingUri("intendedBindingUri780142386") + .setFInt32(-1143775883) + .setFInt64(-1143775788) + .setFDouble(-1239459382) + .setPInt32(-858673665) + .setPInt64(-858673570) + .setPDouble(-991225216) + .build(); + client.repeatDataPathTrailingResource(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void repeatDataBodyPutTest() throws Exception { + RepeatResponse expectedResponse = + RepeatResponse.newBuilder() + .setRequest(RepeatRequest.newBuilder().build()) + .setBindingUri("bindingUri1514820775") + .build(); + mockService.addResponse(expectedResponse); + + RepeatRequest request = + RepeatRequest.newBuilder() + .setName("name3373707") + .setInfo(ComplianceData.newBuilder().build()) + .setServerVerify(true) + .setIntendedBindingUri("intendedBindingUri780142386") + .setFInt32(-1143775883) + .setFInt64(-1143775788) + .setFDouble(-1239459382) + .setPInt32(-858673665) + .setPInt64(-858673570) + .setPDouble(-991225216) + .build(); + + RepeatResponse actualResponse = client.repeatDataBodyPut(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void repeatDataBodyPutExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + RepeatRequest request = + RepeatRequest.newBuilder() + .setName("name3373707") + .setInfo(ComplianceData.newBuilder().build()) + .setServerVerify(true) + .setIntendedBindingUri("intendedBindingUri780142386") + .setFInt32(-1143775883) + .setFInt64(-1143775788) + .setFDouble(-1239459382) + .setPInt32(-858673665) + .setPInt64(-858673570) + .setPDouble(-991225216) + .build(); + client.repeatDataBodyPut(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void repeatDataBodyPatchTest() throws Exception { + RepeatResponse expectedResponse = + RepeatResponse.newBuilder() + .setRequest(RepeatRequest.newBuilder().build()) + .setBindingUri("bindingUri1514820775") + .build(); + mockService.addResponse(expectedResponse); + + RepeatRequest request = + RepeatRequest.newBuilder() + .setName("name3373707") + .setInfo(ComplianceData.newBuilder().build()) + .setServerVerify(true) + .setIntendedBindingUri("intendedBindingUri780142386") + .setFInt32(-1143775883) + .setFInt64(-1143775788) + .setFDouble(-1239459382) + .setPInt32(-858673665) + .setPInt64(-858673570) + .setPDouble(-991225216) + .build(); + + RepeatResponse actualResponse = client.repeatDataBodyPatch(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void repeatDataBodyPatchExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + RepeatRequest request = + RepeatRequest.newBuilder() + .setName("name3373707") + .setInfo(ComplianceData.newBuilder().build()) + .setServerVerify(true) + .setIntendedBindingUri("intendedBindingUri780142386") + .setFInt32(-1143775883) + .setFInt64(-1143775788) + .setFDouble(-1239459382) + .setPInt32(-858673665) + .setPInt64(-858673570) + .setPDouble(-991225216) + .build(); + client.repeatDataBodyPatch(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getEnumTest() throws Exception { + EnumResponse expectedResponse = + EnumResponse.newBuilder() + .setRequest(EnumRequest.newBuilder().build()) + .setContinent(Continent.forNumber(0)) + .build(); + mockService.addResponse(expectedResponse); + + EnumRequest request = EnumRequest.newBuilder().setUnknownEnum(true).build(); + + EnumResponse actualResponse = client.getEnum(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void getEnumExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + EnumRequest request = EnumRequest.newBuilder().setUnknownEnum(true).build(); + client.getEnum(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void verifyEnumTest() throws Exception { + EnumResponse expectedResponse = + EnumResponse.newBuilder() + .setRequest(EnumRequest.newBuilder().build()) + .setContinent(Continent.forNumber(0)) + .build(); + mockService.addResponse(expectedResponse); + + EnumResponse request = + EnumResponse.newBuilder() + .setRequest(EnumRequest.newBuilder().build()) + .setContinent(Continent.forNumber(0)) + .build(); + + EnumResponse actualResponse = client.verifyEnum(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void verifyEnumExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + EnumResponse request = + EnumResponse.newBuilder() + .setRequest(EnumRequest.newBuilder().build()) + .setContinent(Continent.forNumber(0)) + .build(); + client.verifyEnum(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listLocationsTest() throws Exception { + Location responsesElement = Location.newBuilder().build(); + ListLocationsResponse expectedResponse = + ListLocationsResponse.newBuilder() + .setNextPageToken("") + .addAllLocations(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + ListLocationsRequest request = + ListLocationsRequest.newBuilder() + .setName("projects/project-3664") + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + + ListLocationsPagedResponse pagedListResponse = client.listLocations(request); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getLocationsList().get(0), resources.get(0)); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void listLocationsExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ListLocationsRequest request = + ListLocationsRequest.newBuilder() + .setName("projects/project-3664") + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + client.listLocations(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getLocationTest() throws Exception { + Location expectedResponse = + Location.newBuilder() + .setName("name3373707") + .setLocationId("locationId1541836720") + .setDisplayName("displayName1714148973") + .putAllLabels(new HashMap()) + .setMetadata(Any.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + GetLocationRequest request = + GetLocationRequest.newBuilder() + .setName("projects/project-9062/locations/location-9062") + .build(); + + Location actualResponse = client.getLocation(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void getLocationExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + GetLocationRequest request = + GetLocationRequest.newBuilder() + .setName("projects/project-9062/locations/location-9062") + .build(); + client.getLocation(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void setIamPolicyTest() throws Exception { + Policy expectedResponse = + Policy.newBuilder() + .setVersion(351608024) + .addAllBindings(new ArrayList()) + .addAllAuditConfigs(new ArrayList()) + .setEtag(ByteString.EMPTY) + .build(); + mockService.addResponse(expectedResponse); + + SetIamPolicyRequest request = + SetIamPolicyRequest.newBuilder() + .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString()) + .setPolicy(Policy.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .build(); + + Policy actualResponse = client.setIamPolicy(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void setIamPolicyExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + SetIamPolicyRequest request = + SetIamPolicyRequest.newBuilder() + .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString()) + .setPolicy(Policy.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .build(); + client.setIamPolicy(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getIamPolicyTest() throws Exception { + Policy expectedResponse = + Policy.newBuilder() + .setVersion(351608024) + .addAllBindings(new ArrayList()) + .addAllAuditConfigs(new ArrayList()) + .setEtag(ByteString.EMPTY) + .build(); + mockService.addResponse(expectedResponse); + + GetIamPolicyRequest request = + GetIamPolicyRequest.newBuilder() + .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString()) + .setOptions(GetPolicyOptions.newBuilder().build()) + .build(); + + Policy actualResponse = client.getIamPolicy(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void getIamPolicyExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + GetIamPolicyRequest request = + GetIamPolicyRequest.newBuilder() + .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString()) + .setOptions(GetPolicyOptions.newBuilder().build()) + .build(); + client.getIamPolicy(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void testIamPermissionsTest() throws Exception { + TestIamPermissionsResponse expectedResponse = + TestIamPermissionsResponse.newBuilder().addAllPermissions(new ArrayList()).build(); + mockService.addResponse(expectedResponse); + + TestIamPermissionsRequest request = + TestIamPermissionsRequest.newBuilder() + .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString()) + .addAllPermissions(new ArrayList()) + .build(); + + TestIamPermissionsResponse actualResponse = client.testIamPermissions(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void testIamPermissionsExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + TestIamPermissionsRequest request = + TestIamPermissionsRequest.newBuilder() + .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString()) + .addAllPermissions(new ArrayList()) + .build(); + client.testIamPermissions(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } +} diff --git a/java-showcase-3.21.0/gapic-showcase/src/test/java/com/google/showcase/v1beta1/ComplianceClientTest.java b/java-showcase-3.21.0/gapic-showcase/src/test/java/com/google/showcase/v1beta1/ComplianceClientTest.java new file mode 100644 index 0000000000..8f76905d59 --- /dev/null +++ b/java-showcase-3.21.0/gapic-showcase/src/test/java/com/google/showcase/v1beta1/ComplianceClientTest.java @@ -0,0 +1,1014 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1; + +import static com.google.showcase.v1beta1.ComplianceClient.ListLocationsPagedResponse; + +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.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.common.collect.Lists; +import com.google.iam.v1.AuditConfig; +import com.google.iam.v1.Binding; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.GetPolicyOptions; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.protobuf.AbstractMessage; +import com.google.protobuf.Any; +import com.google.protobuf.ByteString; +import com.google.protobuf.FieldMask; +import io.grpc.StatusRuntimeException; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.UUID; +import javax.annotation.Generated; +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Assert; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; + +@Generated("by gapic-generator-java") +public class ComplianceClientTest { + private static MockCompliance mockCompliance; + private static MockIAMPolicy mockIAMPolicy; + private static MockLocations mockLocations; + private static MockServiceHelper mockServiceHelper; + private LocalChannelProvider channelProvider; + private ComplianceClient client; + + @BeforeClass + public static void startStaticServer() { + mockCompliance = new MockCompliance(); + mockLocations = new MockLocations(); + mockIAMPolicy = new MockIAMPolicy(); + mockServiceHelper = + new MockServiceHelper( + UUID.randomUUID().toString(), + Arrays.asList(mockCompliance, mockLocations, mockIAMPolicy)); + mockServiceHelper.start(); + } + + @AfterClass + public static void stopServer() { + mockServiceHelper.stop(); + } + + @Before + public void setUp() throws IOException { + mockServiceHelper.reset(); + channelProvider = mockServiceHelper.createChannelProvider(); + ComplianceSettings settings = + ComplianceSettings.newBuilder() + .setTransportChannelProvider(channelProvider) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = ComplianceClient.create(settings); + } + + @After + public void tearDown() throws Exception { + client.close(); + } + + @Test + public void repeatDataBodyTest() throws Exception { + RepeatResponse expectedResponse = + RepeatResponse.newBuilder() + .setRequest(RepeatRequest.newBuilder().build()) + .setBindingUri("bindingUri1514820775") + .build(); + mockCompliance.addResponse(expectedResponse); + + RepeatRequest request = + RepeatRequest.newBuilder() + .setName("name3373707") + .setInfo(ComplianceData.newBuilder().build()) + .setServerVerify(true) + .setIntendedBindingUri("intendedBindingUri780142386") + .setFInt32(-1143775883) + .setFInt64(-1143775788) + .setFDouble(-1239459382) + .setPInt32(-858673665) + .setPInt64(-858673570) + .setPDouble(-991225216) + .build(); + + RepeatResponse actualResponse = client.repeatDataBody(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockCompliance.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + RepeatRequest actualRequest = ((RepeatRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getName(), actualRequest.getName()); + Assert.assertEquals(request.getInfo(), actualRequest.getInfo()); + Assert.assertEquals(request.getServerVerify(), actualRequest.getServerVerify()); + Assert.assertEquals(request.getIntendedBindingUri(), actualRequest.getIntendedBindingUri()); + Assert.assertEquals(request.getFInt32(), actualRequest.getFInt32()); + Assert.assertEquals(request.getFInt64(), actualRequest.getFInt64()); + Assert.assertEquals(request.getFDouble(), actualRequest.getFDouble(), 0.0001); + Assert.assertEquals(request.getPInt32(), actualRequest.getPInt32()); + Assert.assertEquals(request.getPInt64(), actualRequest.getPInt64()); + Assert.assertEquals(request.getPDouble(), actualRequest.getPDouble(), 0.0001); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void repeatDataBodyExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockCompliance.addException(exception); + + try { + RepeatRequest request = + RepeatRequest.newBuilder() + .setName("name3373707") + .setInfo(ComplianceData.newBuilder().build()) + .setServerVerify(true) + .setIntendedBindingUri("intendedBindingUri780142386") + .setFInt32(-1143775883) + .setFInt64(-1143775788) + .setFDouble(-1239459382) + .setPInt32(-858673665) + .setPInt64(-858673570) + .setPDouble(-991225216) + .build(); + client.repeatDataBody(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void repeatDataBodyInfoTest() throws Exception { + RepeatResponse expectedResponse = + RepeatResponse.newBuilder() + .setRequest(RepeatRequest.newBuilder().build()) + .setBindingUri("bindingUri1514820775") + .build(); + mockCompliance.addResponse(expectedResponse); + + RepeatRequest request = + RepeatRequest.newBuilder() + .setName("name3373707") + .setInfo(ComplianceData.newBuilder().build()) + .setServerVerify(true) + .setIntendedBindingUri("intendedBindingUri780142386") + .setFInt32(-1143775883) + .setFInt64(-1143775788) + .setFDouble(-1239459382) + .setPInt32(-858673665) + .setPInt64(-858673570) + .setPDouble(-991225216) + .build(); + + RepeatResponse actualResponse = client.repeatDataBodyInfo(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockCompliance.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + RepeatRequest actualRequest = ((RepeatRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getName(), actualRequest.getName()); + Assert.assertEquals(request.getInfo(), actualRequest.getInfo()); + Assert.assertEquals(request.getServerVerify(), actualRequest.getServerVerify()); + Assert.assertEquals(request.getIntendedBindingUri(), actualRequest.getIntendedBindingUri()); + Assert.assertEquals(request.getFInt32(), actualRequest.getFInt32()); + Assert.assertEquals(request.getFInt64(), actualRequest.getFInt64()); + Assert.assertEquals(request.getFDouble(), actualRequest.getFDouble(), 0.0001); + Assert.assertEquals(request.getPInt32(), actualRequest.getPInt32()); + Assert.assertEquals(request.getPInt64(), actualRequest.getPInt64()); + Assert.assertEquals(request.getPDouble(), actualRequest.getPDouble(), 0.0001); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void repeatDataBodyInfoExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockCompliance.addException(exception); + + try { + RepeatRequest request = + RepeatRequest.newBuilder() + .setName("name3373707") + .setInfo(ComplianceData.newBuilder().build()) + .setServerVerify(true) + .setIntendedBindingUri("intendedBindingUri780142386") + .setFInt32(-1143775883) + .setFInt64(-1143775788) + .setFDouble(-1239459382) + .setPInt32(-858673665) + .setPInt64(-858673570) + .setPDouble(-991225216) + .build(); + client.repeatDataBodyInfo(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void repeatDataQueryTest() throws Exception { + RepeatResponse expectedResponse = + RepeatResponse.newBuilder() + .setRequest(RepeatRequest.newBuilder().build()) + .setBindingUri("bindingUri1514820775") + .build(); + mockCompliance.addResponse(expectedResponse); + + RepeatRequest request = + RepeatRequest.newBuilder() + .setName("name3373707") + .setInfo(ComplianceData.newBuilder().build()) + .setServerVerify(true) + .setIntendedBindingUri("intendedBindingUri780142386") + .setFInt32(-1143775883) + .setFInt64(-1143775788) + .setFDouble(-1239459382) + .setPInt32(-858673665) + .setPInt64(-858673570) + .setPDouble(-991225216) + .build(); + + RepeatResponse actualResponse = client.repeatDataQuery(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockCompliance.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + RepeatRequest actualRequest = ((RepeatRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getName(), actualRequest.getName()); + Assert.assertEquals(request.getInfo(), actualRequest.getInfo()); + Assert.assertEquals(request.getServerVerify(), actualRequest.getServerVerify()); + Assert.assertEquals(request.getIntendedBindingUri(), actualRequest.getIntendedBindingUri()); + Assert.assertEquals(request.getFInt32(), actualRequest.getFInt32()); + Assert.assertEquals(request.getFInt64(), actualRequest.getFInt64()); + Assert.assertEquals(request.getFDouble(), actualRequest.getFDouble(), 0.0001); + Assert.assertEquals(request.getPInt32(), actualRequest.getPInt32()); + Assert.assertEquals(request.getPInt64(), actualRequest.getPInt64()); + Assert.assertEquals(request.getPDouble(), actualRequest.getPDouble(), 0.0001); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void repeatDataQueryExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockCompliance.addException(exception); + + try { + RepeatRequest request = + RepeatRequest.newBuilder() + .setName("name3373707") + .setInfo(ComplianceData.newBuilder().build()) + .setServerVerify(true) + .setIntendedBindingUri("intendedBindingUri780142386") + .setFInt32(-1143775883) + .setFInt64(-1143775788) + .setFDouble(-1239459382) + .setPInt32(-858673665) + .setPInt64(-858673570) + .setPDouble(-991225216) + .build(); + client.repeatDataQuery(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void repeatDataSimplePathTest() throws Exception { + RepeatResponse expectedResponse = + RepeatResponse.newBuilder() + .setRequest(RepeatRequest.newBuilder().build()) + .setBindingUri("bindingUri1514820775") + .build(); + mockCompliance.addResponse(expectedResponse); + + RepeatRequest request = + RepeatRequest.newBuilder() + .setName("name3373707") + .setInfo(ComplianceData.newBuilder().build()) + .setServerVerify(true) + .setIntendedBindingUri("intendedBindingUri780142386") + .setFInt32(-1143775883) + .setFInt64(-1143775788) + .setFDouble(-1239459382) + .setPInt32(-858673665) + .setPInt64(-858673570) + .setPDouble(-991225216) + .build(); + + RepeatResponse actualResponse = client.repeatDataSimplePath(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockCompliance.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + RepeatRequest actualRequest = ((RepeatRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getName(), actualRequest.getName()); + Assert.assertEquals(request.getInfo(), actualRequest.getInfo()); + Assert.assertEquals(request.getServerVerify(), actualRequest.getServerVerify()); + Assert.assertEquals(request.getIntendedBindingUri(), actualRequest.getIntendedBindingUri()); + Assert.assertEquals(request.getFInt32(), actualRequest.getFInt32()); + Assert.assertEquals(request.getFInt64(), actualRequest.getFInt64()); + Assert.assertEquals(request.getFDouble(), actualRequest.getFDouble(), 0.0001); + Assert.assertEquals(request.getPInt32(), actualRequest.getPInt32()); + Assert.assertEquals(request.getPInt64(), actualRequest.getPInt64()); + Assert.assertEquals(request.getPDouble(), actualRequest.getPDouble(), 0.0001); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void repeatDataSimplePathExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockCompliance.addException(exception); + + try { + RepeatRequest request = + RepeatRequest.newBuilder() + .setName("name3373707") + .setInfo(ComplianceData.newBuilder().build()) + .setServerVerify(true) + .setIntendedBindingUri("intendedBindingUri780142386") + .setFInt32(-1143775883) + .setFInt64(-1143775788) + .setFDouble(-1239459382) + .setPInt32(-858673665) + .setPInt64(-858673570) + .setPDouble(-991225216) + .build(); + client.repeatDataSimplePath(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void repeatDataPathResourceTest() throws Exception { + RepeatResponse expectedResponse = + RepeatResponse.newBuilder() + .setRequest(RepeatRequest.newBuilder().build()) + .setBindingUri("bindingUri1514820775") + .build(); + mockCompliance.addResponse(expectedResponse); + + RepeatRequest request = + RepeatRequest.newBuilder() + .setName("name3373707") + .setInfo(ComplianceData.newBuilder().build()) + .setServerVerify(true) + .setIntendedBindingUri("intendedBindingUri780142386") + .setFInt32(-1143775883) + .setFInt64(-1143775788) + .setFDouble(-1239459382) + .setPInt32(-858673665) + .setPInt64(-858673570) + .setPDouble(-991225216) + .build(); + + RepeatResponse actualResponse = client.repeatDataPathResource(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockCompliance.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + RepeatRequest actualRequest = ((RepeatRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getName(), actualRequest.getName()); + Assert.assertEquals(request.getInfo(), actualRequest.getInfo()); + Assert.assertEquals(request.getServerVerify(), actualRequest.getServerVerify()); + Assert.assertEquals(request.getIntendedBindingUri(), actualRequest.getIntendedBindingUri()); + Assert.assertEquals(request.getFInt32(), actualRequest.getFInt32()); + Assert.assertEquals(request.getFInt64(), actualRequest.getFInt64()); + Assert.assertEquals(request.getFDouble(), actualRequest.getFDouble(), 0.0001); + Assert.assertEquals(request.getPInt32(), actualRequest.getPInt32()); + Assert.assertEquals(request.getPInt64(), actualRequest.getPInt64()); + Assert.assertEquals(request.getPDouble(), actualRequest.getPDouble(), 0.0001); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void repeatDataPathResourceExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockCompliance.addException(exception); + + try { + RepeatRequest request = + RepeatRequest.newBuilder() + .setName("name3373707") + .setInfo(ComplianceData.newBuilder().build()) + .setServerVerify(true) + .setIntendedBindingUri("intendedBindingUri780142386") + .setFInt32(-1143775883) + .setFInt64(-1143775788) + .setFDouble(-1239459382) + .setPInt32(-858673665) + .setPInt64(-858673570) + .setPDouble(-991225216) + .build(); + client.repeatDataPathResource(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void repeatDataPathTrailingResourceTest() throws Exception { + RepeatResponse expectedResponse = + RepeatResponse.newBuilder() + .setRequest(RepeatRequest.newBuilder().build()) + .setBindingUri("bindingUri1514820775") + .build(); + mockCompliance.addResponse(expectedResponse); + + RepeatRequest request = + RepeatRequest.newBuilder() + .setName("name3373707") + .setInfo(ComplianceData.newBuilder().build()) + .setServerVerify(true) + .setIntendedBindingUri("intendedBindingUri780142386") + .setFInt32(-1143775883) + .setFInt64(-1143775788) + .setFDouble(-1239459382) + .setPInt32(-858673665) + .setPInt64(-858673570) + .setPDouble(-991225216) + .build(); + + RepeatResponse actualResponse = client.repeatDataPathTrailingResource(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockCompliance.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + RepeatRequest actualRequest = ((RepeatRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getName(), actualRequest.getName()); + Assert.assertEquals(request.getInfo(), actualRequest.getInfo()); + Assert.assertEquals(request.getServerVerify(), actualRequest.getServerVerify()); + Assert.assertEquals(request.getIntendedBindingUri(), actualRequest.getIntendedBindingUri()); + Assert.assertEquals(request.getFInt32(), actualRequest.getFInt32()); + Assert.assertEquals(request.getFInt64(), actualRequest.getFInt64()); + Assert.assertEquals(request.getFDouble(), actualRequest.getFDouble(), 0.0001); + Assert.assertEquals(request.getPInt32(), actualRequest.getPInt32()); + Assert.assertEquals(request.getPInt64(), actualRequest.getPInt64()); + Assert.assertEquals(request.getPDouble(), actualRequest.getPDouble(), 0.0001); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void repeatDataPathTrailingResourceExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockCompliance.addException(exception); + + try { + RepeatRequest request = + RepeatRequest.newBuilder() + .setName("name3373707") + .setInfo(ComplianceData.newBuilder().build()) + .setServerVerify(true) + .setIntendedBindingUri("intendedBindingUri780142386") + .setFInt32(-1143775883) + .setFInt64(-1143775788) + .setFDouble(-1239459382) + .setPInt32(-858673665) + .setPInt64(-858673570) + .setPDouble(-991225216) + .build(); + client.repeatDataPathTrailingResource(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void repeatDataBodyPutTest() throws Exception { + RepeatResponse expectedResponse = + RepeatResponse.newBuilder() + .setRequest(RepeatRequest.newBuilder().build()) + .setBindingUri("bindingUri1514820775") + .build(); + mockCompliance.addResponse(expectedResponse); + + RepeatRequest request = + RepeatRequest.newBuilder() + .setName("name3373707") + .setInfo(ComplianceData.newBuilder().build()) + .setServerVerify(true) + .setIntendedBindingUri("intendedBindingUri780142386") + .setFInt32(-1143775883) + .setFInt64(-1143775788) + .setFDouble(-1239459382) + .setPInt32(-858673665) + .setPInt64(-858673570) + .setPDouble(-991225216) + .build(); + + RepeatResponse actualResponse = client.repeatDataBodyPut(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockCompliance.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + RepeatRequest actualRequest = ((RepeatRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getName(), actualRequest.getName()); + Assert.assertEquals(request.getInfo(), actualRequest.getInfo()); + Assert.assertEquals(request.getServerVerify(), actualRequest.getServerVerify()); + Assert.assertEquals(request.getIntendedBindingUri(), actualRequest.getIntendedBindingUri()); + Assert.assertEquals(request.getFInt32(), actualRequest.getFInt32()); + Assert.assertEquals(request.getFInt64(), actualRequest.getFInt64()); + Assert.assertEquals(request.getFDouble(), actualRequest.getFDouble(), 0.0001); + Assert.assertEquals(request.getPInt32(), actualRequest.getPInt32()); + Assert.assertEquals(request.getPInt64(), actualRequest.getPInt64()); + Assert.assertEquals(request.getPDouble(), actualRequest.getPDouble(), 0.0001); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void repeatDataBodyPutExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockCompliance.addException(exception); + + try { + RepeatRequest request = + RepeatRequest.newBuilder() + .setName("name3373707") + .setInfo(ComplianceData.newBuilder().build()) + .setServerVerify(true) + .setIntendedBindingUri("intendedBindingUri780142386") + .setFInt32(-1143775883) + .setFInt64(-1143775788) + .setFDouble(-1239459382) + .setPInt32(-858673665) + .setPInt64(-858673570) + .setPDouble(-991225216) + .build(); + client.repeatDataBodyPut(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void repeatDataBodyPatchTest() throws Exception { + RepeatResponse expectedResponse = + RepeatResponse.newBuilder() + .setRequest(RepeatRequest.newBuilder().build()) + .setBindingUri("bindingUri1514820775") + .build(); + mockCompliance.addResponse(expectedResponse); + + RepeatRequest request = + RepeatRequest.newBuilder() + .setName("name3373707") + .setInfo(ComplianceData.newBuilder().build()) + .setServerVerify(true) + .setIntendedBindingUri("intendedBindingUri780142386") + .setFInt32(-1143775883) + .setFInt64(-1143775788) + .setFDouble(-1239459382) + .setPInt32(-858673665) + .setPInt64(-858673570) + .setPDouble(-991225216) + .build(); + + RepeatResponse actualResponse = client.repeatDataBodyPatch(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockCompliance.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + RepeatRequest actualRequest = ((RepeatRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getName(), actualRequest.getName()); + Assert.assertEquals(request.getInfo(), actualRequest.getInfo()); + Assert.assertEquals(request.getServerVerify(), actualRequest.getServerVerify()); + Assert.assertEquals(request.getIntendedBindingUri(), actualRequest.getIntendedBindingUri()); + Assert.assertEquals(request.getFInt32(), actualRequest.getFInt32()); + Assert.assertEquals(request.getFInt64(), actualRequest.getFInt64()); + Assert.assertEquals(request.getFDouble(), actualRequest.getFDouble(), 0.0001); + Assert.assertEquals(request.getPInt32(), actualRequest.getPInt32()); + Assert.assertEquals(request.getPInt64(), actualRequest.getPInt64()); + Assert.assertEquals(request.getPDouble(), actualRequest.getPDouble(), 0.0001); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void repeatDataBodyPatchExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockCompliance.addException(exception); + + try { + RepeatRequest request = + RepeatRequest.newBuilder() + .setName("name3373707") + .setInfo(ComplianceData.newBuilder().build()) + .setServerVerify(true) + .setIntendedBindingUri("intendedBindingUri780142386") + .setFInt32(-1143775883) + .setFInt64(-1143775788) + .setFDouble(-1239459382) + .setPInt32(-858673665) + .setPInt64(-858673570) + .setPDouble(-991225216) + .build(); + client.repeatDataBodyPatch(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getEnumTest() throws Exception { + EnumResponse expectedResponse = + EnumResponse.newBuilder() + .setRequest(EnumRequest.newBuilder().build()) + .setContinent(Continent.forNumber(0)) + .build(); + mockCompliance.addResponse(expectedResponse); + + EnumRequest request = EnumRequest.newBuilder().setUnknownEnum(true).build(); + + EnumResponse actualResponse = client.getEnum(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockCompliance.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + EnumRequest actualRequest = ((EnumRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getUnknownEnum(), actualRequest.getUnknownEnum()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getEnumExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockCompliance.addException(exception); + + try { + EnumRequest request = EnumRequest.newBuilder().setUnknownEnum(true).build(); + client.getEnum(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void verifyEnumTest() throws Exception { + EnumResponse expectedResponse = + EnumResponse.newBuilder() + .setRequest(EnumRequest.newBuilder().build()) + .setContinent(Continent.forNumber(0)) + .build(); + mockCompliance.addResponse(expectedResponse); + + EnumResponse request = + EnumResponse.newBuilder() + .setRequest(EnumRequest.newBuilder().build()) + .setContinent(Continent.forNumber(0)) + .build(); + + EnumResponse actualResponse = client.verifyEnum(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockCompliance.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + EnumResponse actualRequest = ((EnumResponse) actualRequests.get(0)); + + Assert.assertEquals(request.getRequest(), actualRequest.getRequest()); + Assert.assertEquals(request.getContinent(), actualRequest.getContinent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void verifyEnumExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockCompliance.addException(exception); + + try { + EnumResponse request = + EnumResponse.newBuilder() + .setRequest(EnumRequest.newBuilder().build()) + .setContinent(Continent.forNumber(0)) + .build(); + client.verifyEnum(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listLocationsTest() throws Exception { + Location responsesElement = Location.newBuilder().build(); + ListLocationsResponse expectedResponse = + ListLocationsResponse.newBuilder() + .setNextPageToken("") + .addAllLocations(Arrays.asList(responsesElement)) + .build(); + mockLocations.addResponse(expectedResponse); + + ListLocationsRequest request = + ListLocationsRequest.newBuilder() + .setName("name3373707") + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + + ListLocationsPagedResponse pagedListResponse = client.listLocations(request); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getLocationsList().get(0), resources.get(0)); + + List actualRequests = mockLocations.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListLocationsRequest actualRequest = ((ListLocationsRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getName(), actualRequest.getName()); + Assert.assertEquals(request.getFilter(), actualRequest.getFilter()); + Assert.assertEquals(request.getPageSize(), actualRequest.getPageSize()); + Assert.assertEquals(request.getPageToken(), actualRequest.getPageToken()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listLocationsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockLocations.addException(exception); + + try { + ListLocationsRequest request = + ListLocationsRequest.newBuilder() + .setName("name3373707") + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + client.listLocations(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getLocationTest() throws Exception { + Location expectedResponse = + Location.newBuilder() + .setName("name3373707") + .setLocationId("locationId1541836720") + .setDisplayName("displayName1714148973") + .putAllLabels(new HashMap()) + .setMetadata(Any.newBuilder().build()) + .build(); + mockLocations.addResponse(expectedResponse); + + GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build(); + + Location actualResponse = client.getLocation(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockLocations.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetLocationRequest actualRequest = ((GetLocationRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getName(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getLocationExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockLocations.addException(exception); + + try { + GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build(); + client.getLocation(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void setIamPolicyTest() throws Exception { + Policy expectedResponse = + Policy.newBuilder() + .setVersion(351608024) + .addAllBindings(new ArrayList()) + .addAllAuditConfigs(new ArrayList()) + .setEtag(ByteString.EMPTY) + .build(); + mockIAMPolicy.addResponse(expectedResponse); + + SetIamPolicyRequest request = + SetIamPolicyRequest.newBuilder() + .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString()) + .setPolicy(Policy.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .build(); + + Policy actualResponse = client.setIamPolicy(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockIAMPolicy.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + SetIamPolicyRequest actualRequest = ((SetIamPolicyRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getResource(), actualRequest.getResource()); + Assert.assertEquals(request.getPolicy(), actualRequest.getPolicy()); + Assert.assertEquals(request.getUpdateMask(), actualRequest.getUpdateMask()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void setIamPolicyExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockIAMPolicy.addException(exception); + + try { + SetIamPolicyRequest request = + SetIamPolicyRequest.newBuilder() + .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString()) + .setPolicy(Policy.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .build(); + client.setIamPolicy(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getIamPolicyTest() throws Exception { + Policy expectedResponse = + Policy.newBuilder() + .setVersion(351608024) + .addAllBindings(new ArrayList()) + .addAllAuditConfigs(new ArrayList()) + .setEtag(ByteString.EMPTY) + .build(); + mockIAMPolicy.addResponse(expectedResponse); + + GetIamPolicyRequest request = + GetIamPolicyRequest.newBuilder() + .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString()) + .setOptions(GetPolicyOptions.newBuilder().build()) + .build(); + + Policy actualResponse = client.getIamPolicy(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockIAMPolicy.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetIamPolicyRequest actualRequest = ((GetIamPolicyRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getResource(), actualRequest.getResource()); + Assert.assertEquals(request.getOptions(), actualRequest.getOptions()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getIamPolicyExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockIAMPolicy.addException(exception); + + try { + GetIamPolicyRequest request = + GetIamPolicyRequest.newBuilder() + .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString()) + .setOptions(GetPolicyOptions.newBuilder().build()) + .build(); + client.getIamPolicy(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void testIamPermissionsTest() throws Exception { + TestIamPermissionsResponse expectedResponse = + TestIamPermissionsResponse.newBuilder().addAllPermissions(new ArrayList()).build(); + mockIAMPolicy.addResponse(expectedResponse); + + TestIamPermissionsRequest request = + TestIamPermissionsRequest.newBuilder() + .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString()) + .addAllPermissions(new ArrayList()) + .build(); + + TestIamPermissionsResponse actualResponse = client.testIamPermissions(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockIAMPolicy.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + TestIamPermissionsRequest actualRequest = ((TestIamPermissionsRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getResource(), actualRequest.getResource()); + Assert.assertEquals(request.getPermissionsList(), actualRequest.getPermissionsList()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void testIamPermissionsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockIAMPolicy.addException(exception); + + try { + TestIamPermissionsRequest request = + TestIamPermissionsRequest.newBuilder() + .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString()) + .addAllPermissions(new ArrayList()) + .build(); + client.testIamPermissions(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } +} diff --git a/java-showcase-3.21.0/gapic-showcase/src/test/java/com/google/showcase/v1beta1/EchoClientHttpJsonTest.java b/java-showcase-3.21.0/gapic-showcase/src/test/java/com/google/showcase/v1beta1/EchoClientHttpJsonTest.java new file mode 100644 index 0000000000..a558473f2f --- /dev/null +++ b/java-showcase-3.21.0/gapic-showcase/src/test/java/com/google/showcase/v1beta1/EchoClientHttpJsonTest.java @@ -0,0 +1,827 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1; + +import static com.google.showcase.v1beta1.EchoClient.ListLocationsPagedResponse; +import static com.google.showcase.v1beta1.EchoClient.PagedExpandLegacyMappedPagedResponse; +import static com.google.showcase.v1beta1.EchoClient.PagedExpandPagedResponse; + +import com.google.api.gax.core.NoCredentialsProvider; +import com.google.api.gax.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.testing.MockHttpService; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ApiException; +import com.google.api.gax.rpc.ApiExceptionFactory; +import com.google.api.gax.rpc.InvalidArgumentException; +import com.google.api.gax.rpc.StatusCode; +import com.google.api.gax.rpc.testing.FakeStatusCode; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.common.collect.Lists; +import com.google.iam.v1.AuditConfig; +import com.google.iam.v1.Binding; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.GetPolicyOptions; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.longrunning.Operation; +import com.google.protobuf.Any; +import com.google.protobuf.ByteString; +import com.google.protobuf.Duration; +import com.google.protobuf.FieldMask; +import com.google.showcase.v1beta1.stub.HttpJsonEchoStub; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +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 EchoClientHttpJsonTest { + private static MockHttpService mockService; + private static EchoClient client; + + @BeforeClass + public static void startStaticServer() throws IOException { + mockService = + new MockHttpService( + HttpJsonEchoStub.getMethodDescriptors(), EchoSettings.getDefaultEndpoint()); + EchoSettings settings = + EchoSettings.newHttpJsonBuilder() + .setTransportChannelProvider( + EchoSettings.defaultHttpJsonTransportProviderBuilder() + .setHttpTransport(mockService) + .build()) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = EchoClient.create(settings); + } + + @AfterClass + public static void stopServer() { + client.close(); + } + + @Before + public void setUp() {} + + @After + public void tearDown() throws Exception { + mockService.reset(); + } + + @Test + public void echoTest() throws Exception { + EchoResponse expectedResponse = + EchoResponse.newBuilder() + .setContent("content951530617") + .setSeverity(Severity.forNumber(0)) + .setRequestId("requestId693933066") + .setOtherRequestId("otherRequestId1248995034") + .build(); + mockService.addResponse(expectedResponse); + + EchoRequest request = + EchoRequest.newBuilder() + .setSeverity(Severity.forNumber(0)) + .setHeader("header-1221270899") + .setOtherHeader("otherHeader-2026585667") + .setRequestId("requestId693933066") + .setOtherRequestId("otherRequestId1248995034") + .build(); + + EchoResponse actualResponse = client.echo(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void echoExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + EchoRequest request = + EchoRequest.newBuilder() + .setSeverity(Severity.forNumber(0)) + .setHeader("header-1221270899") + .setOtherHeader("otherHeader-2026585667") + .setRequestId("requestId693933066") + .setOtherRequestId("otherRequestId1248995034") + .build(); + client.echo(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void echoErrorDetailsTest() throws Exception { + EchoErrorDetailsResponse expectedResponse = + EchoErrorDetailsResponse.newBuilder() + .setSingleDetail(EchoErrorDetailsResponse.SingleDetail.newBuilder().build()) + .setMultipleDetails(EchoErrorDetailsResponse.MultipleDetails.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + EchoErrorDetailsRequest request = + EchoErrorDetailsRequest.newBuilder() + .setSingleDetailText("singleDetailText1774380934") + .addAllMultiDetailText(new ArrayList()) + .build(); + + EchoErrorDetailsResponse actualResponse = client.echoErrorDetails(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void echoErrorDetailsExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + EchoErrorDetailsRequest request = + EchoErrorDetailsRequest.newBuilder() + .setSingleDetailText("singleDetailText1774380934") + .addAllMultiDetailText(new ArrayList()) + .build(); + client.echoErrorDetails(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void failEchoWithDetailsTest() throws Exception { + FailEchoWithDetailsResponse expectedResponse = FailEchoWithDetailsResponse.newBuilder().build(); + mockService.addResponse(expectedResponse); + + FailEchoWithDetailsRequest request = + FailEchoWithDetailsRequest.newBuilder().setMessage("message954925063").build(); + + FailEchoWithDetailsResponse actualResponse = client.failEchoWithDetails(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void failEchoWithDetailsExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + FailEchoWithDetailsRequest request = + FailEchoWithDetailsRequest.newBuilder().setMessage("message954925063").build(); + client.failEchoWithDetails(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void expandTest() throws Exception {} + + @Test + public void expandExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + } + + @Test + public void collectUnsupportedMethodTest() throws Exception { + // The collect() method is not supported in REST transport. + // This empty test is generated for technical reasons. + } + + @Test + public void chatUnsupportedMethodTest() throws Exception { + // The chat() method is not supported in REST transport. + // This empty test is generated for technical reasons. + } + + @Test + public void pagedExpandTest() throws Exception { + EchoResponse responsesElement = EchoResponse.newBuilder().build(); + PagedExpandResponse expectedResponse = + PagedExpandResponse.newBuilder() + .setNextPageToken("") + .addAllResponses(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + PagedExpandRequest request = + PagedExpandRequest.newBuilder() + .setContent("content951530617") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + + PagedExpandPagedResponse pagedListResponse = client.pagedExpand(request); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getResponsesList().get(0), resources.get(0)); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void pagedExpandExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + PagedExpandRequest request = + PagedExpandRequest.newBuilder() + .setContent("content951530617") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + client.pagedExpand(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void pagedExpandLegacyTest() throws Exception { + PagedExpandResponse expectedResponse = + PagedExpandResponse.newBuilder() + .addAllResponses(new ArrayList()) + .setNextPageToken("nextPageToken-1386094857") + .build(); + mockService.addResponse(expectedResponse); + + PagedExpandLegacyRequest request = + PagedExpandLegacyRequest.newBuilder() + .setContent("content951530617") + .setMaxResults(1128457243) + .setPageToken("pageToken873572522") + .build(); + + PagedExpandResponse actualResponse = client.pagedExpandLegacy(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void pagedExpandLegacyExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + PagedExpandLegacyRequest request = + PagedExpandLegacyRequest.newBuilder() + .setContent("content951530617") + .setMaxResults(1128457243) + .setPageToken("pageToken873572522") + .build(); + client.pagedExpandLegacy(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void pagedExpandLegacyMappedTest() throws Exception { + PagedExpandResponseList responsesElement = PagedExpandResponseList.newBuilder().build(); + PagedExpandLegacyMappedResponse expectedResponse = + PagedExpandLegacyMappedResponse.newBuilder() + .setNextPageToken("") + .putAllAlphabetized(Collections.singletonMap("alphabetized", responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + PagedExpandRequest request = + PagedExpandRequest.newBuilder() + .setContent("content951530617") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + + PagedExpandLegacyMappedPagedResponse pagedListResponse = + client.pagedExpandLegacyMapped(request); + + List> resources = + Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals( + expectedResponse.getAlphabetizedMap().entrySet().iterator().next(), resources.get(0)); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void pagedExpandLegacyMappedExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + PagedExpandRequest request = + PagedExpandRequest.newBuilder() + .setContent("content951530617") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + client.pagedExpandLegacyMapped(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void waitTest() throws Exception { + WaitResponse expectedResponse = + WaitResponse.newBuilder().setContent("content951530617").build(); + Operation resultOperation = + Operation.newBuilder() + .setName("waitTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockService.addResponse(resultOperation); + + WaitRequest request = WaitRequest.newBuilder().build(); + + WaitResponse actualResponse = client.waitAsync(request).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void waitExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + WaitRequest request = WaitRequest.newBuilder().build(); + client.waitAsync(request).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + } + } + + @Test + public void blockTest() throws Exception { + BlockResponse expectedResponse = + BlockResponse.newBuilder().setContent("content951530617").build(); + mockService.addResponse(expectedResponse); + + BlockRequest request = + BlockRequest.newBuilder().setResponseDelay(Duration.newBuilder().build()).build(); + + BlockResponse actualResponse = client.block(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void blockExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + BlockRequest request = + BlockRequest.newBuilder().setResponseDelay(Duration.newBuilder().build()).build(); + client.block(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listLocationsTest() throws Exception { + Location responsesElement = Location.newBuilder().build(); + ListLocationsResponse expectedResponse = + ListLocationsResponse.newBuilder() + .setNextPageToken("") + .addAllLocations(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + ListLocationsRequest request = + ListLocationsRequest.newBuilder() + .setName("projects/project-3664") + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + + ListLocationsPagedResponse pagedListResponse = client.listLocations(request); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getLocationsList().get(0), resources.get(0)); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void listLocationsExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ListLocationsRequest request = + ListLocationsRequest.newBuilder() + .setName("projects/project-3664") + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + client.listLocations(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getLocationTest() throws Exception { + Location expectedResponse = + Location.newBuilder() + .setName("name3373707") + .setLocationId("locationId1541836720") + .setDisplayName("displayName1714148973") + .putAllLabels(new HashMap()) + .setMetadata(Any.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + GetLocationRequest request = + GetLocationRequest.newBuilder() + .setName("projects/project-9062/locations/location-9062") + .build(); + + Location actualResponse = client.getLocation(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void getLocationExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + GetLocationRequest request = + GetLocationRequest.newBuilder() + .setName("projects/project-9062/locations/location-9062") + .build(); + client.getLocation(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void setIamPolicyTest() throws Exception { + Policy expectedResponse = + Policy.newBuilder() + .setVersion(351608024) + .addAllBindings(new ArrayList()) + .addAllAuditConfigs(new ArrayList()) + .setEtag(ByteString.EMPTY) + .build(); + mockService.addResponse(expectedResponse); + + SetIamPolicyRequest request = + SetIamPolicyRequest.newBuilder() + .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString()) + .setPolicy(Policy.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .build(); + + Policy actualResponse = client.setIamPolicy(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void setIamPolicyExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + SetIamPolicyRequest request = + SetIamPolicyRequest.newBuilder() + .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString()) + .setPolicy(Policy.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .build(); + client.setIamPolicy(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getIamPolicyTest() throws Exception { + Policy expectedResponse = + Policy.newBuilder() + .setVersion(351608024) + .addAllBindings(new ArrayList()) + .addAllAuditConfigs(new ArrayList()) + .setEtag(ByteString.EMPTY) + .build(); + mockService.addResponse(expectedResponse); + + GetIamPolicyRequest request = + GetIamPolicyRequest.newBuilder() + .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString()) + .setOptions(GetPolicyOptions.newBuilder().build()) + .build(); + + Policy actualResponse = client.getIamPolicy(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void getIamPolicyExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + GetIamPolicyRequest request = + GetIamPolicyRequest.newBuilder() + .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString()) + .setOptions(GetPolicyOptions.newBuilder().build()) + .build(); + client.getIamPolicy(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void testIamPermissionsTest() throws Exception { + TestIamPermissionsResponse expectedResponse = + TestIamPermissionsResponse.newBuilder().addAllPermissions(new ArrayList()).build(); + mockService.addResponse(expectedResponse); + + TestIamPermissionsRequest request = + TestIamPermissionsRequest.newBuilder() + .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString()) + .addAllPermissions(new ArrayList()) + .build(); + + TestIamPermissionsResponse actualResponse = client.testIamPermissions(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void testIamPermissionsExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + TestIamPermissionsRequest request = + TestIamPermissionsRequest.newBuilder() + .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString()) + .addAllPermissions(new ArrayList()) + .build(); + client.testIamPermissions(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } +} diff --git a/java-showcase-3.21.0/gapic-showcase/src/test/java/com/google/showcase/v1beta1/EchoClientTest.java b/java-showcase-3.21.0/gapic-showcase/src/test/java/com/google/showcase/v1beta1/EchoClientTest.java new file mode 100644 index 0000000000..44ce3dff79 --- /dev/null +++ b/java-showcase-3.21.0/gapic-showcase/src/test/java/com/google/showcase/v1beta1/EchoClientTest.java @@ -0,0 +1,941 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1; + +import static com.google.showcase.v1beta1.EchoClient.ListLocationsPagedResponse; +import static com.google.showcase.v1beta1.EchoClient.PagedExpandLegacyMappedPagedResponse; +import static com.google.showcase.v1beta1.EchoClient.PagedExpandPagedResponse; + +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.ClientStreamingCallable; +import com.google.api.gax.rpc.InvalidArgumentException; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.api.gax.rpc.StatusCode; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.common.collect.Lists; +import com.google.iam.v1.AuditConfig; +import com.google.iam.v1.Binding; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.GetPolicyOptions; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.longrunning.Operation; +import com.google.protobuf.AbstractMessage; +import com.google.protobuf.Any; +import com.google.protobuf.ByteString; +import com.google.protobuf.Duration; +import com.google.protobuf.FieldMask; +import com.google.rpc.Status; +import io.grpc.StatusRuntimeException; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collections; +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 EchoClientTest { + private static MockEcho mockEcho; + private static MockIAMPolicy mockIAMPolicy; + private static MockLocations mockLocations; + private static MockServiceHelper mockServiceHelper; + private LocalChannelProvider channelProvider; + private EchoClient client; + + @BeforeClass + public static void startStaticServer() { + mockEcho = new MockEcho(); + mockLocations = new MockLocations(); + mockIAMPolicy = new MockIAMPolicy(); + mockServiceHelper = + new MockServiceHelper( + UUID.randomUUID().toString(), + Arrays.asList(mockEcho, mockLocations, mockIAMPolicy)); + mockServiceHelper.start(); + } + + @AfterClass + public static void stopServer() { + mockServiceHelper.stop(); + } + + @Before + public void setUp() throws IOException { + mockServiceHelper.reset(); + channelProvider = mockServiceHelper.createChannelProvider(); + EchoSettings settings = + EchoSettings.newBuilder() + .setTransportChannelProvider(channelProvider) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = EchoClient.create(settings); + } + + @After + public void tearDown() throws Exception { + client.close(); + } + + @Test + public void echoTest() throws Exception { + EchoResponse expectedResponse = + EchoResponse.newBuilder() + .setContent("content951530617") + .setSeverity(Severity.forNumber(0)) + .setRequestId("requestId693933066") + .setOtherRequestId("otherRequestId1248995034") + .build(); + mockEcho.addResponse(expectedResponse); + + EchoRequest request = + EchoRequest.newBuilder() + .setSeverity(Severity.forNumber(0)) + .setHeader("header-1221270899") + .setOtherHeader("otherHeader-2026585667") + .setRequestId("requestId693933066") + .setOtherRequestId("otherRequestId1248995034") + .build(); + + EchoResponse actualResponse = client.echo(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockEcho.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + EchoRequest actualRequest = ((EchoRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getContent(), actualRequest.getContent()); + Assert.assertEquals(request.getError(), actualRequest.getError()); + Assert.assertEquals(request.getSeverity(), actualRequest.getSeverity()); + Assert.assertEquals(request.getHeader(), actualRequest.getHeader()); + Assert.assertEquals(request.getOtherHeader(), actualRequest.getOtherHeader()); + Assert.assertEquals(request.getRequestId(), actualRequest.getRequestId()); + Assert.assertEquals(request.getOtherRequestId(), actualRequest.getOtherRequestId()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void echoExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockEcho.addException(exception); + + try { + EchoRequest request = + EchoRequest.newBuilder() + .setSeverity(Severity.forNumber(0)) + .setHeader("header-1221270899") + .setOtherHeader("otherHeader-2026585667") + .setRequestId("requestId693933066") + .setOtherRequestId("otherRequestId1248995034") + .build(); + client.echo(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void echoErrorDetailsTest() throws Exception { + EchoErrorDetailsResponse expectedResponse = + EchoErrorDetailsResponse.newBuilder() + .setSingleDetail(EchoErrorDetailsResponse.SingleDetail.newBuilder().build()) + .setMultipleDetails(EchoErrorDetailsResponse.MultipleDetails.newBuilder().build()) + .build(); + mockEcho.addResponse(expectedResponse); + + EchoErrorDetailsRequest request = + EchoErrorDetailsRequest.newBuilder() + .setSingleDetailText("singleDetailText1774380934") + .addAllMultiDetailText(new ArrayList()) + .build(); + + EchoErrorDetailsResponse actualResponse = client.echoErrorDetails(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockEcho.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + EchoErrorDetailsRequest actualRequest = ((EchoErrorDetailsRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getSingleDetailText(), actualRequest.getSingleDetailText()); + Assert.assertEquals(request.getMultiDetailTextList(), actualRequest.getMultiDetailTextList()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void echoErrorDetailsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockEcho.addException(exception); + + try { + EchoErrorDetailsRequest request = + EchoErrorDetailsRequest.newBuilder() + .setSingleDetailText("singleDetailText1774380934") + .addAllMultiDetailText(new ArrayList()) + .build(); + client.echoErrorDetails(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void failEchoWithDetailsTest() throws Exception { + FailEchoWithDetailsResponse expectedResponse = FailEchoWithDetailsResponse.newBuilder().build(); + mockEcho.addResponse(expectedResponse); + + FailEchoWithDetailsRequest request = + FailEchoWithDetailsRequest.newBuilder().setMessage("message954925063").build(); + + FailEchoWithDetailsResponse actualResponse = client.failEchoWithDetails(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockEcho.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + FailEchoWithDetailsRequest actualRequest = ((FailEchoWithDetailsRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getMessage(), actualRequest.getMessage()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void failEchoWithDetailsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockEcho.addException(exception); + + try { + FailEchoWithDetailsRequest request = + FailEchoWithDetailsRequest.newBuilder().setMessage("message954925063").build(); + client.failEchoWithDetails(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void expandTest() throws Exception { + EchoResponse expectedResponse = + EchoResponse.newBuilder() + .setContent("content951530617") + .setSeverity(Severity.forNumber(0)) + .setRequestId("requestId693933066") + .setOtherRequestId("otherRequestId1248995034") + .build(); + mockEcho.addResponse(expectedResponse); + ExpandRequest request = + ExpandRequest.newBuilder() + .setContent("content951530617") + .setError(Status.newBuilder().build()) + .setStreamWaitTime(Duration.newBuilder().build()) + .build(); + + MockStreamObserver responseObserver = new MockStreamObserver<>(); + + ServerStreamingCallable callable = client.expandCallable(); + callable.serverStreamingCall(request, responseObserver); + + List actualResponses = responseObserver.future().get(); + Assert.assertEquals(1, actualResponses.size()); + Assert.assertEquals(expectedResponse, actualResponses.get(0)); + } + + @Test + public void expandExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockEcho.addException(exception); + ExpandRequest request = + ExpandRequest.newBuilder() + .setContent("content951530617") + .setError(Status.newBuilder().build()) + .setStreamWaitTime(Duration.newBuilder().build()) + .build(); + + MockStreamObserver responseObserver = new MockStreamObserver<>(); + + ServerStreamingCallable callable = client.expandCallable(); + callable.serverStreamingCall(request, responseObserver); + + 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()); + } + } + + @Test + public void collectTest() throws Exception { + EchoResponse expectedResponse = + EchoResponse.newBuilder() + .setContent("content951530617") + .setSeverity(Severity.forNumber(0)) + .setRequestId("requestId693933066") + .setOtherRequestId("otherRequestId1248995034") + .build(); + mockEcho.addResponse(expectedResponse); + EchoRequest request = + EchoRequest.newBuilder() + .setSeverity(Severity.forNumber(0)) + .setHeader("header-1221270899") + .setOtherHeader("otherHeader-2026585667") + .setRequestId("requestId693933066") + .setOtherRequestId("otherRequestId1248995034") + .build(); + + MockStreamObserver responseObserver = new MockStreamObserver<>(); + + ClientStreamingCallable callable = client.collectCallable(); + ApiStreamObserver requestObserver = callable.clientStreamingCall(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 collectExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockEcho.addException(exception); + EchoRequest request = + EchoRequest.newBuilder() + .setSeverity(Severity.forNumber(0)) + .setHeader("header-1221270899") + .setOtherHeader("otherHeader-2026585667") + .setRequestId("requestId693933066") + .setOtherRequestId("otherRequestId1248995034") + .build(); + + MockStreamObserver responseObserver = new MockStreamObserver<>(); + + ClientStreamingCallable callable = client.collectCallable(); + ApiStreamObserver requestObserver = callable.clientStreamingCall(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()); + } + } + + @Test + public void chatTest() throws Exception { + EchoResponse expectedResponse = + EchoResponse.newBuilder() + .setContent("content951530617") + .setSeverity(Severity.forNumber(0)) + .setRequestId("requestId693933066") + .setOtherRequestId("otherRequestId1248995034") + .build(); + mockEcho.addResponse(expectedResponse); + EchoRequest request = + EchoRequest.newBuilder() + .setSeverity(Severity.forNumber(0)) + .setHeader("header-1221270899") + .setOtherHeader("otherHeader-2026585667") + .setRequestId("requestId693933066") + .setOtherRequestId("otherRequestId1248995034") + .build(); + + MockStreamObserver responseObserver = new MockStreamObserver<>(); + + BidiStreamingCallable callable = client.chatCallable(); + 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 chatExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockEcho.addException(exception); + EchoRequest request = + EchoRequest.newBuilder() + .setSeverity(Severity.forNumber(0)) + .setHeader("header-1221270899") + .setOtherHeader("otherHeader-2026585667") + .setRequestId("requestId693933066") + .setOtherRequestId("otherRequestId1248995034") + .build(); + + MockStreamObserver responseObserver = new MockStreamObserver<>(); + + BidiStreamingCallable callable = client.chatCallable(); + 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()); + } + } + + @Test + public void pagedExpandTest() throws Exception { + EchoResponse responsesElement = EchoResponse.newBuilder().build(); + PagedExpandResponse expectedResponse = + PagedExpandResponse.newBuilder() + .setNextPageToken("") + .addAllResponses(Arrays.asList(responsesElement)) + .build(); + mockEcho.addResponse(expectedResponse); + + PagedExpandRequest request = + PagedExpandRequest.newBuilder() + .setContent("content951530617") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + + PagedExpandPagedResponse pagedListResponse = client.pagedExpand(request); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getResponsesList().get(0), resources.get(0)); + + List actualRequests = mockEcho.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + PagedExpandRequest actualRequest = ((PagedExpandRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getContent(), actualRequest.getContent()); + Assert.assertEquals(request.getPageSize(), actualRequest.getPageSize()); + Assert.assertEquals(request.getPageToken(), actualRequest.getPageToken()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void pagedExpandExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockEcho.addException(exception); + + try { + PagedExpandRequest request = + PagedExpandRequest.newBuilder() + .setContent("content951530617") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + client.pagedExpand(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void pagedExpandLegacyTest() throws Exception { + PagedExpandResponse expectedResponse = + PagedExpandResponse.newBuilder() + .addAllResponses(new ArrayList()) + .setNextPageToken("nextPageToken-1386094857") + .build(); + mockEcho.addResponse(expectedResponse); + + PagedExpandLegacyRequest request = + PagedExpandLegacyRequest.newBuilder() + .setContent("content951530617") + .setMaxResults(1128457243) + .setPageToken("pageToken873572522") + .build(); + + PagedExpandResponse actualResponse = client.pagedExpandLegacy(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockEcho.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + PagedExpandLegacyRequest actualRequest = ((PagedExpandLegacyRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getContent(), actualRequest.getContent()); + Assert.assertEquals(request.getMaxResults(), actualRequest.getMaxResults()); + Assert.assertEquals(request.getPageToken(), actualRequest.getPageToken()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void pagedExpandLegacyExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockEcho.addException(exception); + + try { + PagedExpandLegacyRequest request = + PagedExpandLegacyRequest.newBuilder() + .setContent("content951530617") + .setMaxResults(1128457243) + .setPageToken("pageToken873572522") + .build(); + client.pagedExpandLegacy(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void pagedExpandLegacyMappedTest() throws Exception { + PagedExpandResponseList responsesElement = PagedExpandResponseList.newBuilder().build(); + PagedExpandLegacyMappedResponse expectedResponse = + PagedExpandLegacyMappedResponse.newBuilder() + .setNextPageToken("") + .putAllAlphabetized(Collections.singletonMap("alphabetized", responsesElement)) + .build(); + mockEcho.addResponse(expectedResponse); + + PagedExpandRequest request = + PagedExpandRequest.newBuilder() + .setContent("content951530617") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + + PagedExpandLegacyMappedPagedResponse pagedListResponse = + client.pagedExpandLegacyMapped(request); + + List> resources = + Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals( + expectedResponse.getAlphabetizedMap().entrySet().iterator().next(), resources.get(0)); + + List actualRequests = mockEcho.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + PagedExpandRequest actualRequest = ((PagedExpandRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getContent(), actualRequest.getContent()); + Assert.assertEquals(request.getPageSize(), actualRequest.getPageSize()); + Assert.assertEquals(request.getPageToken(), actualRequest.getPageToken()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void pagedExpandLegacyMappedExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockEcho.addException(exception); + + try { + PagedExpandRequest request = + PagedExpandRequest.newBuilder() + .setContent("content951530617") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + client.pagedExpandLegacyMapped(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void waitTest() throws Exception { + WaitResponse expectedResponse = + WaitResponse.newBuilder().setContent("content951530617").build(); + Operation resultOperation = + Operation.newBuilder() + .setName("waitTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockEcho.addResponse(resultOperation); + + WaitRequest request = WaitRequest.newBuilder().build(); + + WaitResponse actualResponse = client.waitAsync(request).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockEcho.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + WaitRequest actualRequest = ((WaitRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getEndTime(), actualRequest.getEndTime()); + Assert.assertEquals(request.getTtl(), actualRequest.getTtl()); + Assert.assertEquals(request.getError(), actualRequest.getError()); + Assert.assertEquals(request.getSuccess(), actualRequest.getSuccess()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void waitExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockEcho.addException(exception); + + try { + WaitRequest request = WaitRequest.newBuilder().build(); + client.waitAsync(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 blockTest() throws Exception { + BlockResponse expectedResponse = + BlockResponse.newBuilder().setContent("content951530617").build(); + mockEcho.addResponse(expectedResponse); + + BlockRequest request = + BlockRequest.newBuilder().setResponseDelay(Duration.newBuilder().build()).build(); + + BlockResponse actualResponse = client.block(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockEcho.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + BlockRequest actualRequest = ((BlockRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getResponseDelay(), actualRequest.getResponseDelay()); + Assert.assertEquals(request.getError(), actualRequest.getError()); + Assert.assertEquals(request.getSuccess(), actualRequest.getSuccess()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void blockExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockEcho.addException(exception); + + try { + BlockRequest request = + BlockRequest.newBuilder().setResponseDelay(Duration.newBuilder().build()).build(); + client.block(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listLocationsTest() throws Exception { + Location responsesElement = Location.newBuilder().build(); + ListLocationsResponse expectedResponse = + ListLocationsResponse.newBuilder() + .setNextPageToken("") + .addAllLocations(Arrays.asList(responsesElement)) + .build(); + mockLocations.addResponse(expectedResponse); + + ListLocationsRequest request = + ListLocationsRequest.newBuilder() + .setName("name3373707") + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + + ListLocationsPagedResponse pagedListResponse = client.listLocations(request); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getLocationsList().get(0), resources.get(0)); + + List actualRequests = mockLocations.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListLocationsRequest actualRequest = ((ListLocationsRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getName(), actualRequest.getName()); + Assert.assertEquals(request.getFilter(), actualRequest.getFilter()); + Assert.assertEquals(request.getPageSize(), actualRequest.getPageSize()); + Assert.assertEquals(request.getPageToken(), actualRequest.getPageToken()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listLocationsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockLocations.addException(exception); + + try { + ListLocationsRequest request = + ListLocationsRequest.newBuilder() + .setName("name3373707") + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + client.listLocations(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getLocationTest() throws Exception { + Location expectedResponse = + Location.newBuilder() + .setName("name3373707") + .setLocationId("locationId1541836720") + .setDisplayName("displayName1714148973") + .putAllLabels(new HashMap()) + .setMetadata(Any.newBuilder().build()) + .build(); + mockLocations.addResponse(expectedResponse); + + GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build(); + + Location actualResponse = client.getLocation(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockLocations.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetLocationRequest actualRequest = ((GetLocationRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getName(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getLocationExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockLocations.addException(exception); + + try { + GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build(); + client.getLocation(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void setIamPolicyTest() throws Exception { + Policy expectedResponse = + Policy.newBuilder() + .setVersion(351608024) + .addAllBindings(new ArrayList()) + .addAllAuditConfigs(new ArrayList()) + .setEtag(ByteString.EMPTY) + .build(); + mockIAMPolicy.addResponse(expectedResponse); + + SetIamPolicyRequest request = + SetIamPolicyRequest.newBuilder() + .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString()) + .setPolicy(Policy.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .build(); + + Policy actualResponse = client.setIamPolicy(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockIAMPolicy.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + SetIamPolicyRequest actualRequest = ((SetIamPolicyRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getResource(), actualRequest.getResource()); + Assert.assertEquals(request.getPolicy(), actualRequest.getPolicy()); + Assert.assertEquals(request.getUpdateMask(), actualRequest.getUpdateMask()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void setIamPolicyExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockIAMPolicy.addException(exception); + + try { + SetIamPolicyRequest request = + SetIamPolicyRequest.newBuilder() + .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString()) + .setPolicy(Policy.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .build(); + client.setIamPolicy(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getIamPolicyTest() throws Exception { + Policy expectedResponse = + Policy.newBuilder() + .setVersion(351608024) + .addAllBindings(new ArrayList()) + .addAllAuditConfigs(new ArrayList()) + .setEtag(ByteString.EMPTY) + .build(); + mockIAMPolicy.addResponse(expectedResponse); + + GetIamPolicyRequest request = + GetIamPolicyRequest.newBuilder() + .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString()) + .setOptions(GetPolicyOptions.newBuilder().build()) + .build(); + + Policy actualResponse = client.getIamPolicy(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockIAMPolicy.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetIamPolicyRequest actualRequest = ((GetIamPolicyRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getResource(), actualRequest.getResource()); + Assert.assertEquals(request.getOptions(), actualRequest.getOptions()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getIamPolicyExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockIAMPolicy.addException(exception); + + try { + GetIamPolicyRequest request = + GetIamPolicyRequest.newBuilder() + .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString()) + .setOptions(GetPolicyOptions.newBuilder().build()) + .build(); + client.getIamPolicy(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void testIamPermissionsTest() throws Exception { + TestIamPermissionsResponse expectedResponse = + TestIamPermissionsResponse.newBuilder().addAllPermissions(new ArrayList()).build(); + mockIAMPolicy.addResponse(expectedResponse); + + TestIamPermissionsRequest request = + TestIamPermissionsRequest.newBuilder() + .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString()) + .addAllPermissions(new ArrayList()) + .build(); + + TestIamPermissionsResponse actualResponse = client.testIamPermissions(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockIAMPolicy.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + TestIamPermissionsRequest actualRequest = ((TestIamPermissionsRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getResource(), actualRequest.getResource()); + Assert.assertEquals(request.getPermissionsList(), actualRequest.getPermissionsList()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void testIamPermissionsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockIAMPolicy.addException(exception); + + try { + TestIamPermissionsRequest request = + TestIamPermissionsRequest.newBuilder() + .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString()) + .addAllPermissions(new ArrayList()) + .build(); + client.testIamPermissions(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } +} diff --git a/java-showcase-3.21.0/gapic-showcase/src/test/java/com/google/showcase/v1beta1/IdentityClientHttpJsonTest.java b/java-showcase-3.21.0/gapic-showcase/src/test/java/com/google/showcase/v1beta1/IdentityClientHttpJsonTest.java new file mode 100644 index 0000000000..fb43faeb39 --- /dev/null +++ b/java-showcase-3.21.0/gapic-showcase/src/test/java/com/google/showcase/v1beta1/IdentityClientHttpJsonTest.java @@ -0,0 +1,815 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1; + +import static com.google.showcase.v1beta1.IdentityClient.ListLocationsPagedResponse; +import static com.google.showcase.v1beta1.IdentityClient.ListUsersPagedResponse; + +import com.google.api.gax.core.NoCredentialsProvider; +import com.google.api.gax.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.testing.MockHttpService; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ApiException; +import com.google.api.gax.rpc.ApiExceptionFactory; +import com.google.api.gax.rpc.InvalidArgumentException; +import com.google.api.gax.rpc.StatusCode; +import com.google.api.gax.rpc.testing.FakeStatusCode; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.common.collect.Lists; +import com.google.iam.v1.AuditConfig; +import com.google.iam.v1.Binding; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.GetPolicyOptions; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.protobuf.Any; +import com.google.protobuf.ByteString; +import com.google.protobuf.Empty; +import com.google.protobuf.FieldMask; +import com.google.protobuf.Timestamp; +import com.google.showcase.v1beta1.stub.HttpJsonIdentityStub; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +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 IdentityClientHttpJsonTest { + private static MockHttpService mockService; + private static IdentityClient client; + + @BeforeClass + public static void startStaticServer() throws IOException { + mockService = + new MockHttpService( + HttpJsonIdentityStub.getMethodDescriptors(), IdentitySettings.getDefaultEndpoint()); + IdentitySettings settings = + IdentitySettings.newHttpJsonBuilder() + .setTransportChannelProvider( + IdentitySettings.defaultHttpJsonTransportProviderBuilder() + .setHttpTransport(mockService) + .build()) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = IdentityClient.create(settings); + } + + @AfterClass + public static void stopServer() { + client.close(); + } + + @Before + public void setUp() {} + + @After + public void tearDown() throws Exception { + mockService.reset(); + } + + @Test + public void createUserTest() throws Exception { + User expectedResponse = + User.newBuilder() + .setName(UserName.of("[USER]").toString()) + .setDisplayName("displayName1714148973") + .setEmail("email96619420") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setAge(96511) + .setHeightFeet(-1032737338) + .setNickname("nickname70690926") + .setEnableNotifications(true) + .build(); + mockService.addResponse(expectedResponse); + + String displayName = "displayName1714148973"; + String email = "email96619420"; + + User actualResponse = client.createUser(displayName, email); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void createUserExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String displayName = "displayName1714148973"; + String email = "email96619420"; + client.createUser(displayName, email); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createUserTest2() throws Exception { + User expectedResponse = + User.newBuilder() + .setName(UserName.of("[USER]").toString()) + .setDisplayName("displayName1714148973") + .setEmail("email96619420") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setAge(96511) + .setHeightFeet(-1032737338) + .setNickname("nickname70690926") + .setEnableNotifications(true) + .build(); + mockService.addResponse(expectedResponse); + + String displayName = "displayName1714148973"; + String email = "email96619420"; + int age = 96511; + String nickname = "nickname70690926"; + boolean enableNotifications = true; + double heightFeet = -1032737338; + + User actualResponse = + client.createUser(displayName, email, age, nickname, enableNotifications, heightFeet); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void createUserExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String displayName = "displayName1714148973"; + String email = "email96619420"; + int age = 96511; + String nickname = "nickname70690926"; + boolean enableNotifications = true; + double heightFeet = -1032737338; + client.createUser(displayName, email, age, nickname, enableNotifications, heightFeet); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getUserTest() throws Exception { + User expectedResponse = + User.newBuilder() + .setName(UserName.of("[USER]").toString()) + .setDisplayName("displayName1714148973") + .setEmail("email96619420") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setAge(96511) + .setHeightFeet(-1032737338) + .setNickname("nickname70690926") + .setEnableNotifications(true) + .build(); + mockService.addResponse(expectedResponse); + + UserName name = UserName.of("[USER]"); + + User actualResponse = client.getUser(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void getUserExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + UserName name = UserName.of("[USER]"); + client.getUser(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getUserTest2() throws Exception { + User expectedResponse = + User.newBuilder() + .setName(UserName.of("[USER]").toString()) + .setDisplayName("displayName1714148973") + .setEmail("email96619420") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setAge(96511) + .setHeightFeet(-1032737338) + .setNickname("nickname70690926") + .setEnableNotifications(true) + .build(); + mockService.addResponse(expectedResponse); + + String name = "users/user-6376"; + + User actualResponse = client.getUser(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void getUserExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String name = "users/user-6376"; + client.getUser(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void updateUserTest() throws Exception { + User expectedResponse = + User.newBuilder() + .setName(UserName.of("[USER]").toString()) + .setDisplayName("displayName1714148973") + .setEmail("email96619420") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setAge(96511) + .setHeightFeet(-1032737338) + .setNickname("nickname70690926") + .setEnableNotifications(true) + .build(); + mockService.addResponse(expectedResponse); + + UpdateUserRequest request = + UpdateUserRequest.newBuilder() + .setUser( + User.newBuilder() + .setName(UserName.of("[USER]").toString()) + .setDisplayName("displayName1714148973") + .setEmail("email96619420") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setAge(96511) + .setHeightFeet(-1032737338) + .setNickname("nickname70690926") + .setEnableNotifications(true) + .build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .build(); + + User actualResponse = client.updateUser(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void updateUserExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + UpdateUserRequest request = + UpdateUserRequest.newBuilder() + .setUser( + User.newBuilder() + .setName(UserName.of("[USER]").toString()) + .setDisplayName("displayName1714148973") + .setEmail("email96619420") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setAge(96511) + .setHeightFeet(-1032737338) + .setNickname("nickname70690926") + .setEnableNotifications(true) + .build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .build(); + client.updateUser(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void deleteUserTest() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockService.addResponse(expectedResponse); + + UserName name = UserName.of("[USER]"); + + client.deleteUser(name); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void deleteUserExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + UserName name = UserName.of("[USER]"); + client.deleteUser(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void deleteUserTest2() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockService.addResponse(expectedResponse); + + String name = "users/user-6376"; + + client.deleteUser(name); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void deleteUserExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String name = "users/user-6376"; + client.deleteUser(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listUsersTest() throws Exception { + User responsesElement = User.newBuilder().build(); + ListUsersResponse expectedResponse = + ListUsersResponse.newBuilder() + .setNextPageToken("") + .addAllUsers(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + ListUsersRequest request = + ListUsersRequest.newBuilder() + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + + ListUsersPagedResponse pagedListResponse = client.listUsers(request); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getUsersList().get(0), resources.get(0)); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void listUsersExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ListUsersRequest request = + ListUsersRequest.newBuilder() + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + client.listUsers(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listLocationsTest() throws Exception { + Location responsesElement = Location.newBuilder().build(); + ListLocationsResponse expectedResponse = + ListLocationsResponse.newBuilder() + .setNextPageToken("") + .addAllLocations(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + ListLocationsRequest request = + ListLocationsRequest.newBuilder() + .setName("projects/project-3664") + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + + ListLocationsPagedResponse pagedListResponse = client.listLocations(request); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getLocationsList().get(0), resources.get(0)); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void listLocationsExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ListLocationsRequest request = + ListLocationsRequest.newBuilder() + .setName("projects/project-3664") + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + client.listLocations(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getLocationTest() throws Exception { + Location expectedResponse = + Location.newBuilder() + .setName("name3373707") + .setLocationId("locationId1541836720") + .setDisplayName("displayName1714148973") + .putAllLabels(new HashMap()) + .setMetadata(Any.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + GetLocationRequest request = + GetLocationRequest.newBuilder() + .setName("projects/project-9062/locations/location-9062") + .build(); + + Location actualResponse = client.getLocation(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void getLocationExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + GetLocationRequest request = + GetLocationRequest.newBuilder() + .setName("projects/project-9062/locations/location-9062") + .build(); + client.getLocation(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void setIamPolicyTest() throws Exception { + Policy expectedResponse = + Policy.newBuilder() + .setVersion(351608024) + .addAllBindings(new ArrayList()) + .addAllAuditConfigs(new ArrayList()) + .setEtag(ByteString.EMPTY) + .build(); + mockService.addResponse(expectedResponse); + + SetIamPolicyRequest request = + SetIamPolicyRequest.newBuilder() + .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString()) + .setPolicy(Policy.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .build(); + + Policy actualResponse = client.setIamPolicy(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void setIamPolicyExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + SetIamPolicyRequest request = + SetIamPolicyRequest.newBuilder() + .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString()) + .setPolicy(Policy.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .build(); + client.setIamPolicy(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getIamPolicyTest() throws Exception { + Policy expectedResponse = + Policy.newBuilder() + .setVersion(351608024) + .addAllBindings(new ArrayList()) + .addAllAuditConfigs(new ArrayList()) + .setEtag(ByteString.EMPTY) + .build(); + mockService.addResponse(expectedResponse); + + GetIamPolicyRequest request = + GetIamPolicyRequest.newBuilder() + .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString()) + .setOptions(GetPolicyOptions.newBuilder().build()) + .build(); + + Policy actualResponse = client.getIamPolicy(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void getIamPolicyExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + GetIamPolicyRequest request = + GetIamPolicyRequest.newBuilder() + .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString()) + .setOptions(GetPolicyOptions.newBuilder().build()) + .build(); + client.getIamPolicy(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void testIamPermissionsTest() throws Exception { + TestIamPermissionsResponse expectedResponse = + TestIamPermissionsResponse.newBuilder().addAllPermissions(new ArrayList()).build(); + mockService.addResponse(expectedResponse); + + TestIamPermissionsRequest request = + TestIamPermissionsRequest.newBuilder() + .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString()) + .addAllPermissions(new ArrayList()) + .build(); + + TestIamPermissionsResponse actualResponse = client.testIamPermissions(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void testIamPermissionsExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + TestIamPermissionsRequest request = + TestIamPermissionsRequest.newBuilder() + .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString()) + .addAllPermissions(new ArrayList()) + .build(); + client.testIamPermissions(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } +} diff --git a/java-showcase-3.21.0/gapic-showcase/src/test/java/com/google/showcase/v1beta1/IdentityClientTest.java b/java-showcase-3.21.0/gapic-showcase/src/test/java/com/google/showcase/v1beta1/IdentityClientTest.java new file mode 100644 index 0000000000..a799116534 --- /dev/null +++ b/java-showcase-3.21.0/gapic-showcase/src/test/java/com/google/showcase/v1beta1/IdentityClientTest.java @@ -0,0 +1,733 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1; + +import static com.google.showcase.v1beta1.IdentityClient.ListLocationsPagedResponse; +import static com.google.showcase.v1beta1.IdentityClient.ListUsersPagedResponse; + +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.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.common.collect.Lists; +import com.google.iam.v1.AuditConfig; +import com.google.iam.v1.Binding; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.GetPolicyOptions; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.protobuf.AbstractMessage; +import com.google.protobuf.Any; +import com.google.protobuf.ByteString; +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.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 IdentityClientTest { + private static MockIAMPolicy mockIAMPolicy; + private static MockIdentity mockIdentity; + private static MockLocations mockLocations; + private static MockServiceHelper mockServiceHelper; + private LocalChannelProvider channelProvider; + private IdentityClient client; + + @BeforeClass + public static void startStaticServer() { + mockIdentity = new MockIdentity(); + mockLocations = new MockLocations(); + mockIAMPolicy = new MockIAMPolicy(); + mockServiceHelper = + new MockServiceHelper( + UUID.randomUUID().toString(), + Arrays.asList(mockIdentity, mockLocations, mockIAMPolicy)); + mockServiceHelper.start(); + } + + @AfterClass + public static void stopServer() { + mockServiceHelper.stop(); + } + + @Before + public void setUp() throws IOException { + mockServiceHelper.reset(); + channelProvider = mockServiceHelper.createChannelProvider(); + IdentitySettings settings = + IdentitySettings.newBuilder() + .setTransportChannelProvider(channelProvider) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = IdentityClient.create(settings); + } + + @After + public void tearDown() throws Exception { + client.close(); + } + + @Test + public void createUserTest() throws Exception { + User expectedResponse = + User.newBuilder() + .setName(UserName.of("[USER]").toString()) + .setDisplayName("displayName1714148973") + .setEmail("email96619420") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setAge(96511) + .setHeightFeet(-1032737338) + .setNickname("nickname70690926") + .setEnableNotifications(true) + .build(); + mockIdentity.addResponse(expectedResponse); + + String displayName = "displayName1714148973"; + String email = "email96619420"; + + User actualResponse = client.createUser(displayName, email); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockIdentity.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateUserRequest actualRequest = ((CreateUserRequest) actualRequests.get(0)); + + Assert.assertEquals(displayName, actualRequest.getUser().getDisplayName()); + Assert.assertEquals(email, actualRequest.getUser().getEmail()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void createUserExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockIdentity.addException(exception); + + try { + String displayName = "displayName1714148973"; + String email = "email96619420"; + client.createUser(displayName, email); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createUserTest2() throws Exception { + User expectedResponse = + User.newBuilder() + .setName(UserName.of("[USER]").toString()) + .setDisplayName("displayName1714148973") + .setEmail("email96619420") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setAge(96511) + .setHeightFeet(-1032737338) + .setNickname("nickname70690926") + .setEnableNotifications(true) + .build(); + mockIdentity.addResponse(expectedResponse); + + String displayName = "displayName1714148973"; + String email = "email96619420"; + int age = 96511; + String nickname = "nickname70690926"; + boolean enableNotifications = true; + double heightFeet = -1032737338; + + User actualResponse = + client.createUser(displayName, email, age, nickname, enableNotifications, heightFeet); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockIdentity.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateUserRequest actualRequest = ((CreateUserRequest) actualRequests.get(0)); + + Assert.assertEquals(displayName, actualRequest.getUser().getDisplayName()); + Assert.assertEquals(email, actualRequest.getUser().getEmail()); + Assert.assertEquals(age, actualRequest.getUser().getAge()); + Assert.assertEquals(nickname, actualRequest.getUser().getNickname()); + Assert.assertEquals(enableNotifications, actualRequest.getUser().getEnableNotifications()); + Assert.assertEquals(heightFeet, actualRequest.getUser().getHeightFeet(), 0.0001); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void createUserExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockIdentity.addException(exception); + + try { + String displayName = "displayName1714148973"; + String email = "email96619420"; + int age = 96511; + String nickname = "nickname70690926"; + boolean enableNotifications = true; + double heightFeet = -1032737338; + client.createUser(displayName, email, age, nickname, enableNotifications, heightFeet); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getUserTest() throws Exception { + User expectedResponse = + User.newBuilder() + .setName(UserName.of("[USER]").toString()) + .setDisplayName("displayName1714148973") + .setEmail("email96619420") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setAge(96511) + .setHeightFeet(-1032737338) + .setNickname("nickname70690926") + .setEnableNotifications(true) + .build(); + mockIdentity.addResponse(expectedResponse); + + UserName name = UserName.of("[USER]"); + + User actualResponse = client.getUser(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockIdentity.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetUserRequest actualRequest = ((GetUserRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getUserExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockIdentity.addException(exception); + + try { + UserName name = UserName.of("[USER]"); + client.getUser(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getUserTest2() throws Exception { + User expectedResponse = + User.newBuilder() + .setName(UserName.of("[USER]").toString()) + .setDisplayName("displayName1714148973") + .setEmail("email96619420") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setAge(96511) + .setHeightFeet(-1032737338) + .setNickname("nickname70690926") + .setEnableNotifications(true) + .build(); + mockIdentity.addResponse(expectedResponse); + + String name = "name3373707"; + + User actualResponse = client.getUser(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockIdentity.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetUserRequest actualRequest = ((GetUserRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getUserExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockIdentity.addException(exception); + + try { + String name = "name3373707"; + client.getUser(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void updateUserTest() throws Exception { + User expectedResponse = + User.newBuilder() + .setName(UserName.of("[USER]").toString()) + .setDisplayName("displayName1714148973") + .setEmail("email96619420") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setAge(96511) + .setHeightFeet(-1032737338) + .setNickname("nickname70690926") + .setEnableNotifications(true) + .build(); + mockIdentity.addResponse(expectedResponse); + + UpdateUserRequest request = + UpdateUserRequest.newBuilder() + .setUser(User.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .build(); + + User actualResponse = client.updateUser(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockIdentity.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + UpdateUserRequest actualRequest = ((UpdateUserRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getUser(), actualRequest.getUser()); + Assert.assertEquals(request.getUpdateMask(), actualRequest.getUpdateMask()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void updateUserExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockIdentity.addException(exception); + + try { + UpdateUserRequest request = + UpdateUserRequest.newBuilder() + .setUser(User.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .build(); + client.updateUser(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void deleteUserTest() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockIdentity.addResponse(expectedResponse); + + UserName name = UserName.of("[USER]"); + + client.deleteUser(name); + + List actualRequests = mockIdentity.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeleteUserRequest actualRequest = ((DeleteUserRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void deleteUserExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockIdentity.addException(exception); + + try { + UserName name = UserName.of("[USER]"); + client.deleteUser(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void deleteUserTest2() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockIdentity.addResponse(expectedResponse); + + String name = "name3373707"; + + client.deleteUser(name); + + List actualRequests = mockIdentity.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeleteUserRequest actualRequest = ((DeleteUserRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void deleteUserExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockIdentity.addException(exception); + + try { + String name = "name3373707"; + client.deleteUser(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listUsersTest() throws Exception { + User responsesElement = User.newBuilder().build(); + ListUsersResponse expectedResponse = + ListUsersResponse.newBuilder() + .setNextPageToken("") + .addAllUsers(Arrays.asList(responsesElement)) + .build(); + mockIdentity.addResponse(expectedResponse); + + ListUsersRequest request = + ListUsersRequest.newBuilder() + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + + ListUsersPagedResponse pagedListResponse = client.listUsers(request); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getUsersList().get(0), resources.get(0)); + + List actualRequests = mockIdentity.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListUsersRequest actualRequest = ((ListUsersRequest) 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 listUsersExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockIdentity.addException(exception); + + try { + ListUsersRequest request = + ListUsersRequest.newBuilder() + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + client.listUsers(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listLocationsTest() throws Exception { + Location responsesElement = Location.newBuilder().build(); + ListLocationsResponse expectedResponse = + ListLocationsResponse.newBuilder() + .setNextPageToken("") + .addAllLocations(Arrays.asList(responsesElement)) + .build(); + mockLocations.addResponse(expectedResponse); + + ListLocationsRequest request = + ListLocationsRequest.newBuilder() + .setName("name3373707") + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + + ListLocationsPagedResponse pagedListResponse = client.listLocations(request); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getLocationsList().get(0), resources.get(0)); + + List actualRequests = mockLocations.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListLocationsRequest actualRequest = ((ListLocationsRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getName(), actualRequest.getName()); + Assert.assertEquals(request.getFilter(), actualRequest.getFilter()); + Assert.assertEquals(request.getPageSize(), actualRequest.getPageSize()); + Assert.assertEquals(request.getPageToken(), actualRequest.getPageToken()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listLocationsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockLocations.addException(exception); + + try { + ListLocationsRequest request = + ListLocationsRequest.newBuilder() + .setName("name3373707") + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + client.listLocations(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getLocationTest() throws Exception { + Location expectedResponse = + Location.newBuilder() + .setName("name3373707") + .setLocationId("locationId1541836720") + .setDisplayName("displayName1714148973") + .putAllLabels(new HashMap()) + .setMetadata(Any.newBuilder().build()) + .build(); + mockLocations.addResponse(expectedResponse); + + GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build(); + + Location actualResponse = client.getLocation(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockLocations.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetLocationRequest actualRequest = ((GetLocationRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getName(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getLocationExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockLocations.addException(exception); + + try { + GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build(); + client.getLocation(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void setIamPolicyTest() throws Exception { + Policy expectedResponse = + Policy.newBuilder() + .setVersion(351608024) + .addAllBindings(new ArrayList()) + .addAllAuditConfigs(new ArrayList()) + .setEtag(ByteString.EMPTY) + .build(); + mockIAMPolicy.addResponse(expectedResponse); + + SetIamPolicyRequest request = + SetIamPolicyRequest.newBuilder() + .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString()) + .setPolicy(Policy.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .build(); + + Policy actualResponse = client.setIamPolicy(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockIAMPolicy.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + SetIamPolicyRequest actualRequest = ((SetIamPolicyRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getResource(), actualRequest.getResource()); + Assert.assertEquals(request.getPolicy(), actualRequest.getPolicy()); + Assert.assertEquals(request.getUpdateMask(), actualRequest.getUpdateMask()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void setIamPolicyExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockIAMPolicy.addException(exception); + + try { + SetIamPolicyRequest request = + SetIamPolicyRequest.newBuilder() + .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString()) + .setPolicy(Policy.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .build(); + client.setIamPolicy(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getIamPolicyTest() throws Exception { + Policy expectedResponse = + Policy.newBuilder() + .setVersion(351608024) + .addAllBindings(new ArrayList()) + .addAllAuditConfigs(new ArrayList()) + .setEtag(ByteString.EMPTY) + .build(); + mockIAMPolicy.addResponse(expectedResponse); + + GetIamPolicyRequest request = + GetIamPolicyRequest.newBuilder() + .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString()) + .setOptions(GetPolicyOptions.newBuilder().build()) + .build(); + + Policy actualResponse = client.getIamPolicy(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockIAMPolicy.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetIamPolicyRequest actualRequest = ((GetIamPolicyRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getResource(), actualRequest.getResource()); + Assert.assertEquals(request.getOptions(), actualRequest.getOptions()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getIamPolicyExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockIAMPolicy.addException(exception); + + try { + GetIamPolicyRequest request = + GetIamPolicyRequest.newBuilder() + .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString()) + .setOptions(GetPolicyOptions.newBuilder().build()) + .build(); + client.getIamPolicy(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void testIamPermissionsTest() throws Exception { + TestIamPermissionsResponse expectedResponse = + TestIamPermissionsResponse.newBuilder().addAllPermissions(new ArrayList()).build(); + mockIAMPolicy.addResponse(expectedResponse); + + TestIamPermissionsRequest request = + TestIamPermissionsRequest.newBuilder() + .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString()) + .addAllPermissions(new ArrayList()) + .build(); + + TestIamPermissionsResponse actualResponse = client.testIamPermissions(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockIAMPolicy.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + TestIamPermissionsRequest actualRequest = ((TestIamPermissionsRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getResource(), actualRequest.getResource()); + Assert.assertEquals(request.getPermissionsList(), actualRequest.getPermissionsList()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void testIamPermissionsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockIAMPolicy.addException(exception); + + try { + TestIamPermissionsRequest request = + TestIamPermissionsRequest.newBuilder() + .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString()) + .addAllPermissions(new ArrayList()) + .build(); + client.testIamPermissions(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } +} diff --git a/java-showcase-3.21.0/gapic-showcase/src/test/java/com/google/showcase/v1beta1/MessagingClientHttpJsonTest.java b/java-showcase-3.21.0/gapic-showcase/src/test/java/com/google/showcase/v1beta1/MessagingClientHttpJsonTest.java new file mode 100644 index 0000000000..bdeb1df2f5 --- /dev/null +++ b/java-showcase-3.21.0/gapic-showcase/src/test/java/com/google/showcase/v1beta1/MessagingClientHttpJsonTest.java @@ -0,0 +1,1937 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1; + +import static com.google.showcase.v1beta1.MessagingClient.ListBlurbsPagedResponse; +import static com.google.showcase.v1beta1.MessagingClient.ListLocationsPagedResponse; +import static com.google.showcase.v1beta1.MessagingClient.ListRoomsPagedResponse; + +import com.google.api.gax.core.NoCredentialsProvider; +import com.google.api.gax.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.testing.MockHttpService; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ApiException; +import com.google.api.gax.rpc.ApiExceptionFactory; +import com.google.api.gax.rpc.InvalidArgumentException; +import com.google.api.gax.rpc.StatusCode; +import com.google.api.gax.rpc.testing.FakeStatusCode; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.common.collect.Lists; +import com.google.iam.v1.AuditConfig; +import com.google.iam.v1.Binding; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.GetPolicyOptions; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.longrunning.Operation; +import com.google.protobuf.Any; +import com.google.protobuf.ByteString; +import com.google.protobuf.Empty; +import com.google.protobuf.FieldMask; +import com.google.protobuf.Timestamp; +import com.google.showcase.v1beta1.stub.HttpJsonMessagingStub; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +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 MessagingClientHttpJsonTest { + private static MockHttpService mockService; + private static MessagingClient client; + + @BeforeClass + public static void startStaticServer() throws IOException { + mockService = + new MockHttpService( + HttpJsonMessagingStub.getMethodDescriptors(), MessagingSettings.getDefaultEndpoint()); + MessagingSettings settings = + MessagingSettings.newHttpJsonBuilder() + .setTransportChannelProvider( + MessagingSettings.defaultHttpJsonTransportProviderBuilder() + .setHttpTransport(mockService) + .build()) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = MessagingClient.create(settings); + } + + @AfterClass + public static void stopServer() { + client.close(); + } + + @Before + public void setUp() {} + + @After + public void tearDown() throws Exception { + mockService.reset(); + } + + @Test + public void createRoomTest() throws Exception { + Room expectedResponse = + Room.newBuilder() + .setName(RoomName.of("[ROOM]").toString()) + .setDisplayName("displayName1714148973") + .setDescription("description-1724546052") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + String displayName = "displayName1714148973"; + String description = "description-1724546052"; + + Room actualResponse = client.createRoom(displayName, description); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void createRoomExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String displayName = "displayName1714148973"; + String description = "description-1724546052"; + client.createRoom(displayName, description); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getRoomTest() throws Exception { + Room expectedResponse = + Room.newBuilder() + .setName(RoomName.of("[ROOM]").toString()) + .setDisplayName("displayName1714148973") + .setDescription("description-1724546052") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + RoomName name = RoomName.of("[ROOM]"); + + Room actualResponse = client.getRoom(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void getRoomExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + RoomName name = RoomName.of("[ROOM]"); + client.getRoom(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getRoomTest2() throws Exception { + Room expectedResponse = + Room.newBuilder() + .setName(RoomName.of("[ROOM]").toString()) + .setDisplayName("displayName1714148973") + .setDescription("description-1724546052") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + String name = "rooms/room-472"; + + Room actualResponse = client.getRoom(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void getRoomExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String name = "rooms/room-472"; + client.getRoom(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void updateRoomTest() throws Exception { + Room expectedResponse = + Room.newBuilder() + .setName(RoomName.of("[ROOM]").toString()) + .setDisplayName("displayName1714148973") + .setDescription("description-1724546052") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + UpdateRoomRequest request = + UpdateRoomRequest.newBuilder() + .setRoom( + Room.newBuilder() + .setName(RoomName.of("[ROOM]").toString()) + .setDisplayName("displayName1714148973") + .setDescription("description-1724546052") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .build(); + + Room actualResponse = client.updateRoom(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void updateRoomExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + UpdateRoomRequest request = + UpdateRoomRequest.newBuilder() + .setRoom( + Room.newBuilder() + .setName(RoomName.of("[ROOM]").toString()) + .setDisplayName("displayName1714148973") + .setDescription("description-1724546052") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .build(); + client.updateRoom(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void deleteRoomTest() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockService.addResponse(expectedResponse); + + RoomName name = RoomName.of("[ROOM]"); + + client.deleteRoom(name); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void deleteRoomExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + RoomName name = RoomName.of("[ROOM]"); + client.deleteRoom(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void deleteRoomTest2() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockService.addResponse(expectedResponse); + + String name = "rooms/room-472"; + + client.deleteRoom(name); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void deleteRoomExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String name = "rooms/room-472"; + client.deleteRoom(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listRoomsTest() throws Exception { + Room responsesElement = Room.newBuilder().build(); + ListRoomsResponse expectedResponse = + ListRoomsResponse.newBuilder() + .setNextPageToken("") + .addAllRooms(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + ListRoomsRequest request = + ListRoomsRequest.newBuilder() + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + + ListRoomsPagedResponse pagedListResponse = client.listRooms(request); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getRoomsList().get(0), resources.get(0)); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void listRoomsExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ListRoomsRequest request = + ListRoomsRequest.newBuilder() + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + client.listRooms(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createBlurbTest() throws Exception { + Blurb expectedResponse = + Blurb.newBuilder() + .setName( + BlurbName.ofUserLegacyUserBlurbName("[USER]", "[LEGACY_USER]", "[BLURB]") + .toString()) + .setUser(UserName.of("[USER]").toString()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + ProfileName parent = ProfileName.of("[USER]"); + UserName user = UserName.of("[USER]"); + ByteString image = ByteString.EMPTY; + + Blurb actualResponse = client.createBlurb(parent, user, image); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void createBlurbExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ProfileName parent = ProfileName.of("[USER]"); + UserName user = UserName.of("[USER]"); + ByteString image = ByteString.EMPTY; + client.createBlurb(parent, user, image); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createBlurbTest2() throws Exception { + Blurb expectedResponse = + Blurb.newBuilder() + .setName( + BlurbName.ofUserLegacyUserBlurbName("[USER]", "[LEGACY_USER]", "[BLURB]") + .toString()) + .setUser(UserName.of("[USER]").toString()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + ProfileName parent = ProfileName.of("[USER]"); + UserName user = UserName.of("[USER]"); + String text = "text3556653"; + + Blurb actualResponse = client.createBlurb(parent, user, text); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void createBlurbExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ProfileName parent = ProfileName.of("[USER]"); + UserName user = UserName.of("[USER]"); + String text = "text3556653"; + client.createBlurb(parent, user, text); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createBlurbTest3() throws Exception { + Blurb expectedResponse = + Blurb.newBuilder() + .setName( + BlurbName.ofUserLegacyUserBlurbName("[USER]", "[LEGACY_USER]", "[BLURB]") + .toString()) + .setUser(UserName.of("[USER]").toString()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + ProfileName parent = ProfileName.of("[USER]"); + String user = "user3599307"; + ByteString image = ByteString.EMPTY; + + Blurb actualResponse = client.createBlurb(parent, user, image); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void createBlurbExceptionTest3() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ProfileName parent = ProfileName.of("[USER]"); + String user = "user3599307"; + ByteString image = ByteString.EMPTY; + client.createBlurb(parent, user, image); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createBlurbTest4() throws Exception { + Blurb expectedResponse = + Blurb.newBuilder() + .setName( + BlurbName.ofUserLegacyUserBlurbName("[USER]", "[LEGACY_USER]", "[BLURB]") + .toString()) + .setUser(UserName.of("[USER]").toString()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + ProfileName parent = ProfileName.of("[USER]"); + String user = "user3599307"; + String text = "text3556653"; + + Blurb actualResponse = client.createBlurb(parent, user, text); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void createBlurbExceptionTest4() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ProfileName parent = ProfileName.of("[USER]"); + String user = "user3599307"; + String text = "text3556653"; + client.createBlurb(parent, user, text); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createBlurbTest5() throws Exception { + Blurb expectedResponse = + Blurb.newBuilder() + .setName( + BlurbName.ofUserLegacyUserBlurbName("[USER]", "[LEGACY_USER]", "[BLURB]") + .toString()) + .setUser(UserName.of("[USER]").toString()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + RoomName parent = RoomName.of("[ROOM]"); + UserName user = UserName.of("[USER]"); + ByteString image = ByteString.EMPTY; + + Blurb actualResponse = client.createBlurb(parent, user, image); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void createBlurbExceptionTest5() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + RoomName parent = RoomName.of("[ROOM]"); + UserName user = UserName.of("[USER]"); + ByteString image = ByteString.EMPTY; + client.createBlurb(parent, user, image); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createBlurbTest6() throws Exception { + Blurb expectedResponse = + Blurb.newBuilder() + .setName( + BlurbName.ofUserLegacyUserBlurbName("[USER]", "[LEGACY_USER]", "[BLURB]") + .toString()) + .setUser(UserName.of("[USER]").toString()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + RoomName parent = RoomName.of("[ROOM]"); + UserName user = UserName.of("[USER]"); + String text = "text3556653"; + + Blurb actualResponse = client.createBlurb(parent, user, text); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void createBlurbExceptionTest6() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + RoomName parent = RoomName.of("[ROOM]"); + UserName user = UserName.of("[USER]"); + String text = "text3556653"; + client.createBlurb(parent, user, text); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createBlurbTest7() throws Exception { + Blurb expectedResponse = + Blurb.newBuilder() + .setName( + BlurbName.ofUserLegacyUserBlurbName("[USER]", "[LEGACY_USER]", "[BLURB]") + .toString()) + .setUser(UserName.of("[USER]").toString()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + RoomName parent = RoomName.of("[ROOM]"); + String user = "user3599307"; + ByteString image = ByteString.EMPTY; + + Blurb actualResponse = client.createBlurb(parent, user, image); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void createBlurbExceptionTest7() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + RoomName parent = RoomName.of("[ROOM]"); + String user = "user3599307"; + ByteString image = ByteString.EMPTY; + client.createBlurb(parent, user, image); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createBlurbTest8() throws Exception { + Blurb expectedResponse = + Blurb.newBuilder() + .setName( + BlurbName.ofUserLegacyUserBlurbName("[USER]", "[LEGACY_USER]", "[BLURB]") + .toString()) + .setUser(UserName.of("[USER]").toString()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + RoomName parent = RoomName.of("[ROOM]"); + String user = "user3599307"; + String text = "text3556653"; + + Blurb actualResponse = client.createBlurb(parent, user, text); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void createBlurbExceptionTest8() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + RoomName parent = RoomName.of("[ROOM]"); + String user = "user3599307"; + String text = "text3556653"; + client.createBlurb(parent, user, text); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createBlurbTest9() throws Exception { + Blurb expectedResponse = + Blurb.newBuilder() + .setName( + BlurbName.ofUserLegacyUserBlurbName("[USER]", "[LEGACY_USER]", "[BLURB]") + .toString()) + .setUser(UserName.of("[USER]").toString()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + String parent = "rooms/room-4889"; + UserName user = UserName.of("[USER]"); + ByteString image = ByteString.EMPTY; + + Blurb actualResponse = client.createBlurb(parent, user, image); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void createBlurbExceptionTest9() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String parent = "rooms/room-4889"; + UserName user = UserName.of("[USER]"); + ByteString image = ByteString.EMPTY; + client.createBlurb(parent, user, image); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createBlurbTest10() throws Exception { + Blurb expectedResponse = + Blurb.newBuilder() + .setName( + BlurbName.ofUserLegacyUserBlurbName("[USER]", "[LEGACY_USER]", "[BLURB]") + .toString()) + .setUser(UserName.of("[USER]").toString()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + String parent = "rooms/room-4889"; + UserName user = UserName.of("[USER]"); + String text = "text3556653"; + + Blurb actualResponse = client.createBlurb(parent, user, text); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void createBlurbExceptionTest10() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String parent = "rooms/room-4889"; + UserName user = UserName.of("[USER]"); + String text = "text3556653"; + client.createBlurb(parent, user, text); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createBlurbTest11() throws Exception { + Blurb expectedResponse = + Blurb.newBuilder() + .setName( + BlurbName.ofUserLegacyUserBlurbName("[USER]", "[LEGACY_USER]", "[BLURB]") + .toString()) + .setUser(UserName.of("[USER]").toString()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + String parent = "rooms/room-4889"; + String user = "user3599307"; + ByteString image = ByteString.EMPTY; + + Blurb actualResponse = client.createBlurb(parent, user, image); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void createBlurbExceptionTest11() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String parent = "rooms/room-4889"; + String user = "user3599307"; + ByteString image = ByteString.EMPTY; + client.createBlurb(parent, user, image); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createBlurbTest12() throws Exception { + Blurb expectedResponse = + Blurb.newBuilder() + .setName( + BlurbName.ofUserLegacyUserBlurbName("[USER]", "[LEGACY_USER]", "[BLURB]") + .toString()) + .setUser(UserName.of("[USER]").toString()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + String parent = "rooms/room-4889"; + String user = "user3599307"; + String text = "text3556653"; + + Blurb actualResponse = client.createBlurb(parent, user, text); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void createBlurbExceptionTest12() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String parent = "rooms/room-4889"; + String user = "user3599307"; + String text = "text3556653"; + client.createBlurb(parent, user, text); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getBlurbTest() throws Exception { + Blurb expectedResponse = + Blurb.newBuilder() + .setName(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString()) + .setUser(UserName.of("[USER]").toString()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + BlurbName name = BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]"); + + Blurb actualResponse = client.getBlurb(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void getBlurbExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + BlurbName name = BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]"); + client.getBlurb(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getBlurbTest2() throws Exception { + Blurb expectedResponse = + Blurb.newBuilder() + .setName(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString()) + .setUser(UserName.of("[USER]").toString()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + String name = "rooms/room-9094/blurbs/blurb-9094"; + + Blurb actualResponse = client.getBlurb(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void getBlurbExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String name = "rooms/room-9094/blurbs/blurb-9094"; + client.getBlurb(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void updateBlurbTest() throws Exception { + Blurb expectedResponse = + Blurb.newBuilder() + .setName(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString()) + .setUser(UserName.of("[USER]").toString()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + UpdateBlurbRequest request = + UpdateBlurbRequest.newBuilder() + .setBlurb( + Blurb.newBuilder() + .setName(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString()) + .setUser(UserName.of("[USER]").toString()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .build(); + + Blurb actualResponse = client.updateBlurb(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void updateBlurbExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + UpdateBlurbRequest request = + UpdateBlurbRequest.newBuilder() + .setBlurb( + Blurb.newBuilder() + .setName(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString()) + .setUser(UserName.of("[USER]").toString()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .build(); + client.updateBlurb(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void deleteBlurbTest() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockService.addResponse(expectedResponse); + + BlurbName name = BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]"); + + client.deleteBlurb(name); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void deleteBlurbExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + BlurbName name = BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]"); + client.deleteBlurb(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void deleteBlurbTest2() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockService.addResponse(expectedResponse); + + String name = "rooms/room-9094/blurbs/blurb-9094"; + + client.deleteBlurb(name); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void deleteBlurbExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String name = "rooms/room-9094/blurbs/blurb-9094"; + client.deleteBlurb(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listBlurbsTest() throws Exception { + Blurb responsesElement = Blurb.newBuilder().build(); + ListBlurbsResponse expectedResponse = + ListBlurbsResponse.newBuilder() + .setNextPageToken("") + .addAllBlurbs(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + ProfileName parent = ProfileName.of("[USER]"); + + ListBlurbsPagedResponse pagedListResponse = client.listBlurbs(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getBlurbsList().get(0), resources.get(0)); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void listBlurbsExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ProfileName parent = ProfileName.of("[USER]"); + client.listBlurbs(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listBlurbsTest2() throws Exception { + Blurb responsesElement = Blurb.newBuilder().build(); + ListBlurbsResponse expectedResponse = + ListBlurbsResponse.newBuilder() + .setNextPageToken("") + .addAllBlurbs(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + RoomName parent = RoomName.of("[ROOM]"); + + ListBlurbsPagedResponse pagedListResponse = client.listBlurbs(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getBlurbsList().get(0), resources.get(0)); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void listBlurbsExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + RoomName parent = RoomName.of("[ROOM]"); + client.listBlurbs(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listBlurbsTest3() throws Exception { + Blurb responsesElement = Blurb.newBuilder().build(); + ListBlurbsResponse expectedResponse = + ListBlurbsResponse.newBuilder() + .setNextPageToken("") + .addAllBlurbs(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + String parent = "rooms/room-4889"; + + ListBlurbsPagedResponse pagedListResponse = client.listBlurbs(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getBlurbsList().get(0), resources.get(0)); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void listBlurbsExceptionTest3() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String parent = "rooms/room-4889"; + client.listBlurbs(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void searchBlurbsTest() throws Exception { + SearchBlurbsResponse expectedResponse = + SearchBlurbsResponse.newBuilder() + .addAllBlurbs(new ArrayList()) + .setNextPageToken("nextPageToken-1386094857") + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("searchBlurbsTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockService.addResponse(resultOperation); + + ProfileName parent = ProfileName.of("[USER]"); + String query = "query107944136"; + + SearchBlurbsResponse actualResponse = client.searchBlurbsAsync(parent, query).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void searchBlurbsExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ProfileName parent = ProfileName.of("[USER]"); + String query = "query107944136"; + client.searchBlurbsAsync(parent, query).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + } + } + + @Test + public void searchBlurbsTest2() throws Exception { + SearchBlurbsResponse expectedResponse = + SearchBlurbsResponse.newBuilder() + .addAllBlurbs(new ArrayList()) + .setNextPageToken("nextPageToken-1386094857") + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("searchBlurbsTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockService.addResponse(resultOperation); + + RoomName parent = RoomName.of("[ROOM]"); + String query = "query107944136"; + + SearchBlurbsResponse actualResponse = client.searchBlurbsAsync(parent, query).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void searchBlurbsExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + RoomName parent = RoomName.of("[ROOM]"); + String query = "query107944136"; + client.searchBlurbsAsync(parent, query).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + } + } + + @Test + public void searchBlurbsTest3() throws Exception { + SearchBlurbsResponse expectedResponse = + SearchBlurbsResponse.newBuilder() + .addAllBlurbs(new ArrayList()) + .setNextPageToken("nextPageToken-1386094857") + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("searchBlurbsTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockService.addResponse(resultOperation); + + String parent = "rooms/room-4889"; + String query = "query107944136"; + + SearchBlurbsResponse actualResponse = client.searchBlurbsAsync(parent, query).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void searchBlurbsExceptionTest3() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String parent = "rooms/room-4889"; + String query = "query107944136"; + client.searchBlurbsAsync(parent, query).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + } + } + + @Test + public void streamBlurbsTest() throws Exception {} + + @Test + public void streamBlurbsExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + } + + @Test + public void sendBlurbsUnsupportedMethodTest() throws Exception { + // The sendBlurbs() method is not supported in REST transport. + // This empty test is generated for technical reasons. + } + + @Test + public void connectUnsupportedMethodTest() throws Exception { + // The connect() method is not supported in REST transport. + // This empty test is generated for technical reasons. + } + + @Test + public void listLocationsTest() throws Exception { + Location responsesElement = Location.newBuilder().build(); + ListLocationsResponse expectedResponse = + ListLocationsResponse.newBuilder() + .setNextPageToken("") + .addAllLocations(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + ListLocationsRequest request = + ListLocationsRequest.newBuilder() + .setName("projects/project-3664") + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + + ListLocationsPagedResponse pagedListResponse = client.listLocations(request); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getLocationsList().get(0), resources.get(0)); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void listLocationsExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ListLocationsRequest request = + ListLocationsRequest.newBuilder() + .setName("projects/project-3664") + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + client.listLocations(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getLocationTest() throws Exception { + Location expectedResponse = + Location.newBuilder() + .setName("name3373707") + .setLocationId("locationId1541836720") + .setDisplayName("displayName1714148973") + .putAllLabels(new HashMap()) + .setMetadata(Any.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + GetLocationRequest request = + GetLocationRequest.newBuilder() + .setName("projects/project-9062/locations/location-9062") + .build(); + + Location actualResponse = client.getLocation(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void getLocationExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + GetLocationRequest request = + GetLocationRequest.newBuilder() + .setName("projects/project-9062/locations/location-9062") + .build(); + client.getLocation(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void setIamPolicyTest() throws Exception { + Policy expectedResponse = + Policy.newBuilder() + .setVersion(351608024) + .addAllBindings(new ArrayList()) + .addAllAuditConfigs(new ArrayList()) + .setEtag(ByteString.EMPTY) + .build(); + mockService.addResponse(expectedResponse); + + SetIamPolicyRequest request = + SetIamPolicyRequest.newBuilder() + .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString()) + .setPolicy(Policy.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .build(); + + Policy actualResponse = client.setIamPolicy(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void setIamPolicyExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + SetIamPolicyRequest request = + SetIamPolicyRequest.newBuilder() + .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString()) + .setPolicy(Policy.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .build(); + client.setIamPolicy(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getIamPolicyTest() throws Exception { + Policy expectedResponse = + Policy.newBuilder() + .setVersion(351608024) + .addAllBindings(new ArrayList()) + .addAllAuditConfigs(new ArrayList()) + .setEtag(ByteString.EMPTY) + .build(); + mockService.addResponse(expectedResponse); + + GetIamPolicyRequest request = + GetIamPolicyRequest.newBuilder() + .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString()) + .setOptions(GetPolicyOptions.newBuilder().build()) + .build(); + + Policy actualResponse = client.getIamPolicy(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void getIamPolicyExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + GetIamPolicyRequest request = + GetIamPolicyRequest.newBuilder() + .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString()) + .setOptions(GetPolicyOptions.newBuilder().build()) + .build(); + client.getIamPolicy(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void testIamPermissionsTest() throws Exception { + TestIamPermissionsResponse expectedResponse = + TestIamPermissionsResponse.newBuilder().addAllPermissions(new ArrayList()).build(); + mockService.addResponse(expectedResponse); + + TestIamPermissionsRequest request = + TestIamPermissionsRequest.newBuilder() + .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString()) + .addAllPermissions(new ArrayList()) + .build(); + + TestIamPermissionsResponse actualResponse = client.testIamPermissions(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void testIamPermissionsExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + TestIamPermissionsRequest request = + TestIamPermissionsRequest.newBuilder() + .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString()) + .addAllPermissions(new ArrayList()) + .build(); + client.testIamPermissions(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } +} diff --git a/java-showcase-3.21.0/gapic-showcase/src/test/java/com/google/showcase/v1beta1/MessagingClientTest.java b/java-showcase-3.21.0/gapic-showcase/src/test/java/com/google/showcase/v1beta1/MessagingClientTest.java new file mode 100644 index 0000000000..65b8248d12 --- /dev/null +++ b/java-showcase-3.21.0/gapic-showcase/src/test/java/com/google/showcase/v1beta1/MessagingClientTest.java @@ -0,0 +1,1882 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1; + +import static com.google.showcase.v1beta1.MessagingClient.ListBlurbsPagedResponse; +import static com.google.showcase.v1beta1.MessagingClient.ListLocationsPagedResponse; +import static com.google.showcase.v1beta1.MessagingClient.ListRoomsPagedResponse; + +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.ClientStreamingCallable; +import com.google.api.gax.rpc.InvalidArgumentException; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.api.gax.rpc.StatusCode; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.common.collect.Lists; +import com.google.iam.v1.AuditConfig; +import com.google.iam.v1.Binding; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.GetPolicyOptions; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.longrunning.Operation; +import com.google.protobuf.AbstractMessage; +import com.google.protobuf.Any; +import com.google.protobuf.ByteString; +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.HashMap; +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 MessagingClientTest { + private static MockIAMPolicy mockIAMPolicy; + private static MockLocations mockLocations; + private static MockMessaging mockMessaging; + private static MockServiceHelper mockServiceHelper; + private LocalChannelProvider channelProvider; + private MessagingClient client; + + @BeforeClass + public static void startStaticServer() { + mockMessaging = new MockMessaging(); + mockLocations = new MockLocations(); + mockIAMPolicy = new MockIAMPolicy(); + mockServiceHelper = + new MockServiceHelper( + UUID.randomUUID().toString(), + Arrays.asList(mockMessaging, mockLocations, mockIAMPolicy)); + mockServiceHelper.start(); + } + + @AfterClass + public static void stopServer() { + mockServiceHelper.stop(); + } + + @Before + public void setUp() throws IOException { + mockServiceHelper.reset(); + channelProvider = mockServiceHelper.createChannelProvider(); + MessagingSettings settings = + MessagingSettings.newBuilder() + .setTransportChannelProvider(channelProvider) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = MessagingClient.create(settings); + } + + @After + public void tearDown() throws Exception { + client.close(); + } + + @Test + public void createRoomTest() throws Exception { + Room expectedResponse = + Room.newBuilder() + .setName(RoomName.of("[ROOM]").toString()) + .setDisplayName("displayName1714148973") + .setDescription("description-1724546052") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .build(); + mockMessaging.addResponse(expectedResponse); + + String displayName = "displayName1714148973"; + String description = "description-1724546052"; + + Room actualResponse = client.createRoom(displayName, description); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockMessaging.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateRoomRequest actualRequest = ((CreateRoomRequest) actualRequests.get(0)); + + Assert.assertEquals(displayName, actualRequest.getRoom().getDisplayName()); + Assert.assertEquals(description, actualRequest.getRoom().getDescription()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void createRoomExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockMessaging.addException(exception); + + try { + String displayName = "displayName1714148973"; + String description = "description-1724546052"; + client.createRoom(displayName, description); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getRoomTest() throws Exception { + Room expectedResponse = + Room.newBuilder() + .setName(RoomName.of("[ROOM]").toString()) + .setDisplayName("displayName1714148973") + .setDescription("description-1724546052") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .build(); + mockMessaging.addResponse(expectedResponse); + + RoomName name = RoomName.of("[ROOM]"); + + Room actualResponse = client.getRoom(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockMessaging.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetRoomRequest actualRequest = ((GetRoomRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getRoomExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockMessaging.addException(exception); + + try { + RoomName name = RoomName.of("[ROOM]"); + client.getRoom(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getRoomTest2() throws Exception { + Room expectedResponse = + Room.newBuilder() + .setName(RoomName.of("[ROOM]").toString()) + .setDisplayName("displayName1714148973") + .setDescription("description-1724546052") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .build(); + mockMessaging.addResponse(expectedResponse); + + String name = "name3373707"; + + Room actualResponse = client.getRoom(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockMessaging.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetRoomRequest actualRequest = ((GetRoomRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getRoomExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockMessaging.addException(exception); + + try { + String name = "name3373707"; + client.getRoom(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void updateRoomTest() throws Exception { + Room expectedResponse = + Room.newBuilder() + .setName(RoomName.of("[ROOM]").toString()) + .setDisplayName("displayName1714148973") + .setDescription("description-1724546052") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .build(); + mockMessaging.addResponse(expectedResponse); + + UpdateRoomRequest request = + UpdateRoomRequest.newBuilder() + .setRoom(Room.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .build(); + + Room actualResponse = client.updateRoom(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockMessaging.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + UpdateRoomRequest actualRequest = ((UpdateRoomRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getRoom(), actualRequest.getRoom()); + Assert.assertEquals(request.getUpdateMask(), actualRequest.getUpdateMask()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void updateRoomExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockMessaging.addException(exception); + + try { + UpdateRoomRequest request = + UpdateRoomRequest.newBuilder() + .setRoom(Room.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .build(); + client.updateRoom(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void deleteRoomTest() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockMessaging.addResponse(expectedResponse); + + RoomName name = RoomName.of("[ROOM]"); + + client.deleteRoom(name); + + List actualRequests = mockMessaging.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeleteRoomRequest actualRequest = ((DeleteRoomRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void deleteRoomExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockMessaging.addException(exception); + + try { + RoomName name = RoomName.of("[ROOM]"); + client.deleteRoom(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void deleteRoomTest2() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockMessaging.addResponse(expectedResponse); + + String name = "name3373707"; + + client.deleteRoom(name); + + List actualRequests = mockMessaging.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeleteRoomRequest actualRequest = ((DeleteRoomRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void deleteRoomExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockMessaging.addException(exception); + + try { + String name = "name3373707"; + client.deleteRoom(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listRoomsTest() throws Exception { + Room responsesElement = Room.newBuilder().build(); + ListRoomsResponse expectedResponse = + ListRoomsResponse.newBuilder() + .setNextPageToken("") + .addAllRooms(Arrays.asList(responsesElement)) + .build(); + mockMessaging.addResponse(expectedResponse); + + ListRoomsRequest request = + ListRoomsRequest.newBuilder() + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + + ListRoomsPagedResponse pagedListResponse = client.listRooms(request); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getRoomsList().get(0), resources.get(0)); + + List actualRequests = mockMessaging.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListRoomsRequest actualRequest = ((ListRoomsRequest) 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 listRoomsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockMessaging.addException(exception); + + try { + ListRoomsRequest request = + ListRoomsRequest.newBuilder() + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + client.listRooms(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createBlurbTest() throws Exception { + Blurb expectedResponse = + Blurb.newBuilder() + .setName( + BlurbName.ofUserLegacyUserBlurbName("[USER]", "[LEGACY_USER]", "[BLURB]") + .toString()) + .setUser(UserName.of("[USER]").toString()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .build(); + mockMessaging.addResponse(expectedResponse); + + ProfileName parent = ProfileName.of("[USER]"); + UserName user = UserName.of("[USER]"); + ByteString image = ByteString.EMPTY; + + Blurb actualResponse = client.createBlurb(parent, user, image); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockMessaging.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateBlurbRequest actualRequest = ((CreateBlurbRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertEquals(user.toString(), actualRequest.getBlurb().getUser()); + Assert.assertEquals(image, actualRequest.getBlurb().getImage()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void createBlurbExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockMessaging.addException(exception); + + try { + ProfileName parent = ProfileName.of("[USER]"); + UserName user = UserName.of("[USER]"); + ByteString image = ByteString.EMPTY; + client.createBlurb(parent, user, image); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createBlurbTest2() throws Exception { + Blurb expectedResponse = + Blurb.newBuilder() + .setName( + BlurbName.ofUserLegacyUserBlurbName("[USER]", "[LEGACY_USER]", "[BLURB]") + .toString()) + .setUser(UserName.of("[USER]").toString()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .build(); + mockMessaging.addResponse(expectedResponse); + + ProfileName parent = ProfileName.of("[USER]"); + UserName user = UserName.of("[USER]"); + String text = "text3556653"; + + Blurb actualResponse = client.createBlurb(parent, user, text); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockMessaging.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateBlurbRequest actualRequest = ((CreateBlurbRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertEquals(user.toString(), actualRequest.getBlurb().getUser()); + Assert.assertEquals(text, actualRequest.getBlurb().getText()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void createBlurbExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockMessaging.addException(exception); + + try { + ProfileName parent = ProfileName.of("[USER]"); + UserName user = UserName.of("[USER]"); + String text = "text3556653"; + client.createBlurb(parent, user, text); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createBlurbTest3() throws Exception { + Blurb expectedResponse = + Blurb.newBuilder() + .setName( + BlurbName.ofUserLegacyUserBlurbName("[USER]", "[LEGACY_USER]", "[BLURB]") + .toString()) + .setUser(UserName.of("[USER]").toString()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .build(); + mockMessaging.addResponse(expectedResponse); + + ProfileName parent = ProfileName.of("[USER]"); + String user = "user3599307"; + ByteString image = ByteString.EMPTY; + + Blurb actualResponse = client.createBlurb(parent, user, image); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockMessaging.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateBlurbRequest actualRequest = ((CreateBlurbRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertEquals(user, actualRequest.getBlurb().getUser()); + Assert.assertEquals(image, actualRequest.getBlurb().getImage()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void createBlurbExceptionTest3() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockMessaging.addException(exception); + + try { + ProfileName parent = ProfileName.of("[USER]"); + String user = "user3599307"; + ByteString image = ByteString.EMPTY; + client.createBlurb(parent, user, image); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createBlurbTest4() throws Exception { + Blurb expectedResponse = + Blurb.newBuilder() + .setName( + BlurbName.ofUserLegacyUserBlurbName("[USER]", "[LEGACY_USER]", "[BLURB]") + .toString()) + .setUser(UserName.of("[USER]").toString()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .build(); + mockMessaging.addResponse(expectedResponse); + + ProfileName parent = ProfileName.of("[USER]"); + String user = "user3599307"; + String text = "text3556653"; + + Blurb actualResponse = client.createBlurb(parent, user, text); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockMessaging.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateBlurbRequest actualRequest = ((CreateBlurbRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertEquals(user, actualRequest.getBlurb().getUser()); + Assert.assertEquals(text, actualRequest.getBlurb().getText()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void createBlurbExceptionTest4() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockMessaging.addException(exception); + + try { + ProfileName parent = ProfileName.of("[USER]"); + String user = "user3599307"; + String text = "text3556653"; + client.createBlurb(parent, user, text); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createBlurbTest5() throws Exception { + Blurb expectedResponse = + Blurb.newBuilder() + .setName( + BlurbName.ofUserLegacyUserBlurbName("[USER]", "[LEGACY_USER]", "[BLURB]") + .toString()) + .setUser(UserName.of("[USER]").toString()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .build(); + mockMessaging.addResponse(expectedResponse); + + RoomName parent = RoomName.of("[ROOM]"); + UserName user = UserName.of("[USER]"); + ByteString image = ByteString.EMPTY; + + Blurb actualResponse = client.createBlurb(parent, user, image); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockMessaging.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateBlurbRequest actualRequest = ((CreateBlurbRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertEquals(user.toString(), actualRequest.getBlurb().getUser()); + Assert.assertEquals(image, actualRequest.getBlurb().getImage()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void createBlurbExceptionTest5() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockMessaging.addException(exception); + + try { + RoomName parent = RoomName.of("[ROOM]"); + UserName user = UserName.of("[USER]"); + ByteString image = ByteString.EMPTY; + client.createBlurb(parent, user, image); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createBlurbTest6() throws Exception { + Blurb expectedResponse = + Blurb.newBuilder() + .setName( + BlurbName.ofUserLegacyUserBlurbName("[USER]", "[LEGACY_USER]", "[BLURB]") + .toString()) + .setUser(UserName.of("[USER]").toString()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .build(); + mockMessaging.addResponse(expectedResponse); + + RoomName parent = RoomName.of("[ROOM]"); + UserName user = UserName.of("[USER]"); + String text = "text3556653"; + + Blurb actualResponse = client.createBlurb(parent, user, text); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockMessaging.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateBlurbRequest actualRequest = ((CreateBlurbRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertEquals(user.toString(), actualRequest.getBlurb().getUser()); + Assert.assertEquals(text, actualRequest.getBlurb().getText()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void createBlurbExceptionTest6() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockMessaging.addException(exception); + + try { + RoomName parent = RoomName.of("[ROOM]"); + UserName user = UserName.of("[USER]"); + String text = "text3556653"; + client.createBlurb(parent, user, text); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createBlurbTest7() throws Exception { + Blurb expectedResponse = + Blurb.newBuilder() + .setName( + BlurbName.ofUserLegacyUserBlurbName("[USER]", "[LEGACY_USER]", "[BLURB]") + .toString()) + .setUser(UserName.of("[USER]").toString()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .build(); + mockMessaging.addResponse(expectedResponse); + + RoomName parent = RoomName.of("[ROOM]"); + String user = "user3599307"; + ByteString image = ByteString.EMPTY; + + Blurb actualResponse = client.createBlurb(parent, user, image); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockMessaging.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateBlurbRequest actualRequest = ((CreateBlurbRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertEquals(user, actualRequest.getBlurb().getUser()); + Assert.assertEquals(image, actualRequest.getBlurb().getImage()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void createBlurbExceptionTest7() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockMessaging.addException(exception); + + try { + RoomName parent = RoomName.of("[ROOM]"); + String user = "user3599307"; + ByteString image = ByteString.EMPTY; + client.createBlurb(parent, user, image); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createBlurbTest8() throws Exception { + Blurb expectedResponse = + Blurb.newBuilder() + .setName( + BlurbName.ofUserLegacyUserBlurbName("[USER]", "[LEGACY_USER]", "[BLURB]") + .toString()) + .setUser(UserName.of("[USER]").toString()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .build(); + mockMessaging.addResponse(expectedResponse); + + RoomName parent = RoomName.of("[ROOM]"); + String user = "user3599307"; + String text = "text3556653"; + + Blurb actualResponse = client.createBlurb(parent, user, text); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockMessaging.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateBlurbRequest actualRequest = ((CreateBlurbRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertEquals(user, actualRequest.getBlurb().getUser()); + Assert.assertEquals(text, actualRequest.getBlurb().getText()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void createBlurbExceptionTest8() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockMessaging.addException(exception); + + try { + RoomName parent = RoomName.of("[ROOM]"); + String user = "user3599307"; + String text = "text3556653"; + client.createBlurb(parent, user, text); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createBlurbTest9() throws Exception { + Blurb expectedResponse = + Blurb.newBuilder() + .setName( + BlurbName.ofUserLegacyUserBlurbName("[USER]", "[LEGACY_USER]", "[BLURB]") + .toString()) + .setUser(UserName.of("[USER]").toString()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .build(); + mockMessaging.addResponse(expectedResponse); + + String parent = "parent-995424086"; + UserName user = UserName.of("[USER]"); + ByteString image = ByteString.EMPTY; + + Blurb actualResponse = client.createBlurb(parent, user, image); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockMessaging.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateBlurbRequest actualRequest = ((CreateBlurbRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertEquals(user.toString(), actualRequest.getBlurb().getUser()); + Assert.assertEquals(image, actualRequest.getBlurb().getImage()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void createBlurbExceptionTest9() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockMessaging.addException(exception); + + try { + String parent = "parent-995424086"; + UserName user = UserName.of("[USER]"); + ByteString image = ByteString.EMPTY; + client.createBlurb(parent, user, image); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createBlurbTest10() throws Exception { + Blurb expectedResponse = + Blurb.newBuilder() + .setName( + BlurbName.ofUserLegacyUserBlurbName("[USER]", "[LEGACY_USER]", "[BLURB]") + .toString()) + .setUser(UserName.of("[USER]").toString()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .build(); + mockMessaging.addResponse(expectedResponse); + + String parent = "parent-995424086"; + UserName user = UserName.of("[USER]"); + String text = "text3556653"; + + Blurb actualResponse = client.createBlurb(parent, user, text); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockMessaging.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateBlurbRequest actualRequest = ((CreateBlurbRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertEquals(user.toString(), actualRequest.getBlurb().getUser()); + Assert.assertEquals(text, actualRequest.getBlurb().getText()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void createBlurbExceptionTest10() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockMessaging.addException(exception); + + try { + String parent = "parent-995424086"; + UserName user = UserName.of("[USER]"); + String text = "text3556653"; + client.createBlurb(parent, user, text); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createBlurbTest11() throws Exception { + Blurb expectedResponse = + Blurb.newBuilder() + .setName( + BlurbName.ofUserLegacyUserBlurbName("[USER]", "[LEGACY_USER]", "[BLURB]") + .toString()) + .setUser(UserName.of("[USER]").toString()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .build(); + mockMessaging.addResponse(expectedResponse); + + String parent = "parent-995424086"; + String user = "user3599307"; + ByteString image = ByteString.EMPTY; + + Blurb actualResponse = client.createBlurb(parent, user, image); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockMessaging.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateBlurbRequest actualRequest = ((CreateBlurbRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertEquals(user, actualRequest.getBlurb().getUser()); + Assert.assertEquals(image, actualRequest.getBlurb().getImage()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void createBlurbExceptionTest11() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockMessaging.addException(exception); + + try { + String parent = "parent-995424086"; + String user = "user3599307"; + ByteString image = ByteString.EMPTY; + client.createBlurb(parent, user, image); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createBlurbTest12() throws Exception { + Blurb expectedResponse = + Blurb.newBuilder() + .setName( + BlurbName.ofUserLegacyUserBlurbName("[USER]", "[LEGACY_USER]", "[BLURB]") + .toString()) + .setUser(UserName.of("[USER]").toString()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .build(); + mockMessaging.addResponse(expectedResponse); + + String parent = "parent-995424086"; + String user = "user3599307"; + String text = "text3556653"; + + Blurb actualResponse = client.createBlurb(parent, user, text); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockMessaging.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateBlurbRequest actualRequest = ((CreateBlurbRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertEquals(user, actualRequest.getBlurb().getUser()); + Assert.assertEquals(text, actualRequest.getBlurb().getText()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void createBlurbExceptionTest12() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockMessaging.addException(exception); + + try { + String parent = "parent-995424086"; + String user = "user3599307"; + String text = "text3556653"; + client.createBlurb(parent, user, text); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getBlurbTest() throws Exception { + Blurb expectedResponse = + Blurb.newBuilder() + .setName(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString()) + .setUser(UserName.of("[USER]").toString()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .build(); + mockMessaging.addResponse(expectedResponse); + + BlurbName name = BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]"); + + Blurb actualResponse = client.getBlurb(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockMessaging.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetBlurbRequest actualRequest = ((GetBlurbRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getBlurbExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockMessaging.addException(exception); + + try { + BlurbName name = BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]"); + client.getBlurb(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getBlurbTest2() throws Exception { + Blurb expectedResponse = + Blurb.newBuilder() + .setName(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString()) + .setUser(UserName.of("[USER]").toString()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .build(); + mockMessaging.addResponse(expectedResponse); + + String name = "name3373707"; + + Blurb actualResponse = client.getBlurb(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockMessaging.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetBlurbRequest actualRequest = ((GetBlurbRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getBlurbExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockMessaging.addException(exception); + + try { + String name = "name3373707"; + client.getBlurb(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void updateBlurbTest() throws Exception { + Blurb expectedResponse = + Blurb.newBuilder() + .setName(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString()) + .setUser(UserName.of("[USER]").toString()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .build(); + mockMessaging.addResponse(expectedResponse); + + UpdateBlurbRequest request = + UpdateBlurbRequest.newBuilder() + .setBlurb(Blurb.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .build(); + + Blurb actualResponse = client.updateBlurb(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockMessaging.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + UpdateBlurbRequest actualRequest = ((UpdateBlurbRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getBlurb(), actualRequest.getBlurb()); + Assert.assertEquals(request.getUpdateMask(), actualRequest.getUpdateMask()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void updateBlurbExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockMessaging.addException(exception); + + try { + UpdateBlurbRequest request = + UpdateBlurbRequest.newBuilder() + .setBlurb(Blurb.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .build(); + client.updateBlurb(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void deleteBlurbTest() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockMessaging.addResponse(expectedResponse); + + BlurbName name = BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]"); + + client.deleteBlurb(name); + + List actualRequests = mockMessaging.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeleteBlurbRequest actualRequest = ((DeleteBlurbRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void deleteBlurbExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockMessaging.addException(exception); + + try { + BlurbName name = BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]"); + client.deleteBlurb(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void deleteBlurbTest2() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockMessaging.addResponse(expectedResponse); + + String name = "name3373707"; + + client.deleteBlurb(name); + + List actualRequests = mockMessaging.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeleteBlurbRequest actualRequest = ((DeleteBlurbRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void deleteBlurbExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockMessaging.addException(exception); + + try { + String name = "name3373707"; + client.deleteBlurb(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listBlurbsTest() throws Exception { + Blurb responsesElement = Blurb.newBuilder().build(); + ListBlurbsResponse expectedResponse = + ListBlurbsResponse.newBuilder() + .setNextPageToken("") + .addAllBlurbs(Arrays.asList(responsesElement)) + .build(); + mockMessaging.addResponse(expectedResponse); + + ProfileName parent = ProfileName.of("[USER]"); + + ListBlurbsPagedResponse pagedListResponse = client.listBlurbs(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getBlurbsList().get(0), resources.get(0)); + + List actualRequests = mockMessaging.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListBlurbsRequest actualRequest = ((ListBlurbsRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listBlurbsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockMessaging.addException(exception); + + try { + ProfileName parent = ProfileName.of("[USER]"); + client.listBlurbs(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listBlurbsTest2() throws Exception { + Blurb responsesElement = Blurb.newBuilder().build(); + ListBlurbsResponse expectedResponse = + ListBlurbsResponse.newBuilder() + .setNextPageToken("") + .addAllBlurbs(Arrays.asList(responsesElement)) + .build(); + mockMessaging.addResponse(expectedResponse); + + RoomName parent = RoomName.of("[ROOM]"); + + ListBlurbsPagedResponse pagedListResponse = client.listBlurbs(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getBlurbsList().get(0), resources.get(0)); + + List actualRequests = mockMessaging.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListBlurbsRequest actualRequest = ((ListBlurbsRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listBlurbsExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockMessaging.addException(exception); + + try { + RoomName parent = RoomName.of("[ROOM]"); + client.listBlurbs(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listBlurbsTest3() throws Exception { + Blurb responsesElement = Blurb.newBuilder().build(); + ListBlurbsResponse expectedResponse = + ListBlurbsResponse.newBuilder() + .setNextPageToken("") + .addAllBlurbs(Arrays.asList(responsesElement)) + .build(); + mockMessaging.addResponse(expectedResponse); + + String parent = "parent-995424086"; + + ListBlurbsPagedResponse pagedListResponse = client.listBlurbs(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getBlurbsList().get(0), resources.get(0)); + + List actualRequests = mockMessaging.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListBlurbsRequest actualRequest = ((ListBlurbsRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listBlurbsExceptionTest3() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockMessaging.addException(exception); + + try { + String parent = "parent-995424086"; + client.listBlurbs(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void searchBlurbsTest() throws Exception { + SearchBlurbsResponse expectedResponse = + SearchBlurbsResponse.newBuilder() + .addAllBlurbs(new ArrayList()) + .setNextPageToken("nextPageToken-1386094857") + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("searchBlurbsTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockMessaging.addResponse(resultOperation); + + ProfileName parent = ProfileName.of("[USER]"); + String query = "query107944136"; + + SearchBlurbsResponse actualResponse = client.searchBlurbsAsync(parent, query).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockMessaging.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + SearchBlurbsRequest actualRequest = ((SearchBlurbsRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertEquals(query, actualRequest.getQuery()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void searchBlurbsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockMessaging.addException(exception); + + try { + ProfileName parent = ProfileName.of("[USER]"); + String query = "query107944136"; + client.searchBlurbsAsync(parent, query).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 searchBlurbsTest2() throws Exception { + SearchBlurbsResponse expectedResponse = + SearchBlurbsResponse.newBuilder() + .addAllBlurbs(new ArrayList()) + .setNextPageToken("nextPageToken-1386094857") + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("searchBlurbsTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockMessaging.addResponse(resultOperation); + + RoomName parent = RoomName.of("[ROOM]"); + String query = "query107944136"; + + SearchBlurbsResponse actualResponse = client.searchBlurbsAsync(parent, query).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockMessaging.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + SearchBlurbsRequest actualRequest = ((SearchBlurbsRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertEquals(query, actualRequest.getQuery()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void searchBlurbsExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockMessaging.addException(exception); + + try { + RoomName parent = RoomName.of("[ROOM]"); + String query = "query107944136"; + client.searchBlurbsAsync(parent, query).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 searchBlurbsTest3() throws Exception { + SearchBlurbsResponse expectedResponse = + SearchBlurbsResponse.newBuilder() + .addAllBlurbs(new ArrayList()) + .setNextPageToken("nextPageToken-1386094857") + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("searchBlurbsTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockMessaging.addResponse(resultOperation); + + String parent = "parent-995424086"; + String query = "query107944136"; + + SearchBlurbsResponse actualResponse = client.searchBlurbsAsync(parent, query).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockMessaging.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + SearchBlurbsRequest actualRequest = ((SearchBlurbsRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertEquals(query, actualRequest.getQuery()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void searchBlurbsExceptionTest3() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockMessaging.addException(exception); + + try { + String parent = "parent-995424086"; + String query = "query107944136"; + client.searchBlurbsAsync(parent, query).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 streamBlurbsTest() throws Exception { + StreamBlurbsResponse expectedResponse = + StreamBlurbsResponse.newBuilder().setBlurb(Blurb.newBuilder().build()).build(); + mockMessaging.addResponse(expectedResponse); + StreamBlurbsRequest request = + StreamBlurbsRequest.newBuilder() + .setName(ProfileName.of("[USER]").toString()) + .setExpireTime(Timestamp.newBuilder().build()) + .build(); + + MockStreamObserver responseObserver = new MockStreamObserver<>(); + + ServerStreamingCallable callable = + client.streamBlurbsCallable(); + callable.serverStreamingCall(request, responseObserver); + + List actualResponses = responseObserver.future().get(); + Assert.assertEquals(1, actualResponses.size()); + Assert.assertEquals(expectedResponse, actualResponses.get(0)); + } + + @Test + public void streamBlurbsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockMessaging.addException(exception); + StreamBlurbsRequest request = + StreamBlurbsRequest.newBuilder() + .setName(ProfileName.of("[USER]").toString()) + .setExpireTime(Timestamp.newBuilder().build()) + .build(); + + MockStreamObserver responseObserver = new MockStreamObserver<>(); + + ServerStreamingCallable callable = + client.streamBlurbsCallable(); + callable.serverStreamingCall(request, responseObserver); + + 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()); + } + } + + @Test + public void sendBlurbsTest() throws Exception { + SendBlurbsResponse expectedResponse = + SendBlurbsResponse.newBuilder().addAllNames(new ArrayList()).build(); + mockMessaging.addResponse(expectedResponse); + CreateBlurbRequest request = + CreateBlurbRequest.newBuilder() + .setParent(ProfileName.of("[USER]").toString()) + .setBlurb(Blurb.newBuilder().build()) + .build(); + + MockStreamObserver responseObserver = new MockStreamObserver<>(); + + ClientStreamingCallable callable = + client.sendBlurbsCallable(); + ApiStreamObserver requestObserver = + callable.clientStreamingCall(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 sendBlurbsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockMessaging.addException(exception); + CreateBlurbRequest request = + CreateBlurbRequest.newBuilder() + .setParent(ProfileName.of("[USER]").toString()) + .setBlurb(Blurb.newBuilder().build()) + .build(); + + MockStreamObserver responseObserver = new MockStreamObserver<>(); + + ClientStreamingCallable callable = + client.sendBlurbsCallable(); + ApiStreamObserver requestObserver = + callable.clientStreamingCall(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()); + } + } + + @Test + public void connectTest() throws Exception { + StreamBlurbsResponse expectedResponse = + StreamBlurbsResponse.newBuilder().setBlurb(Blurb.newBuilder().build()).build(); + mockMessaging.addResponse(expectedResponse); + ConnectRequest request = ConnectRequest.newBuilder().build(); + + MockStreamObserver responseObserver = new MockStreamObserver<>(); + + BidiStreamingCallable callable = client.connectCallable(); + 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 connectExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockMessaging.addException(exception); + ConnectRequest request = ConnectRequest.newBuilder().build(); + + MockStreamObserver responseObserver = new MockStreamObserver<>(); + + BidiStreamingCallable callable = client.connectCallable(); + 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()); + } + } + + @Test + public void listLocationsTest() throws Exception { + Location responsesElement = Location.newBuilder().build(); + ListLocationsResponse expectedResponse = + ListLocationsResponse.newBuilder() + .setNextPageToken("") + .addAllLocations(Arrays.asList(responsesElement)) + .build(); + mockLocations.addResponse(expectedResponse); + + ListLocationsRequest request = + ListLocationsRequest.newBuilder() + .setName("name3373707") + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + + ListLocationsPagedResponse pagedListResponse = client.listLocations(request); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getLocationsList().get(0), resources.get(0)); + + List actualRequests = mockLocations.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListLocationsRequest actualRequest = ((ListLocationsRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getName(), actualRequest.getName()); + Assert.assertEquals(request.getFilter(), actualRequest.getFilter()); + Assert.assertEquals(request.getPageSize(), actualRequest.getPageSize()); + Assert.assertEquals(request.getPageToken(), actualRequest.getPageToken()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listLocationsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockLocations.addException(exception); + + try { + ListLocationsRequest request = + ListLocationsRequest.newBuilder() + .setName("name3373707") + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + client.listLocations(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getLocationTest() throws Exception { + Location expectedResponse = + Location.newBuilder() + .setName("name3373707") + .setLocationId("locationId1541836720") + .setDisplayName("displayName1714148973") + .putAllLabels(new HashMap()) + .setMetadata(Any.newBuilder().build()) + .build(); + mockLocations.addResponse(expectedResponse); + + GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build(); + + Location actualResponse = client.getLocation(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockLocations.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetLocationRequest actualRequest = ((GetLocationRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getName(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getLocationExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockLocations.addException(exception); + + try { + GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build(); + client.getLocation(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void setIamPolicyTest() throws Exception { + Policy expectedResponse = + Policy.newBuilder() + .setVersion(351608024) + .addAllBindings(new ArrayList()) + .addAllAuditConfigs(new ArrayList()) + .setEtag(ByteString.EMPTY) + .build(); + mockIAMPolicy.addResponse(expectedResponse); + + SetIamPolicyRequest request = + SetIamPolicyRequest.newBuilder() + .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString()) + .setPolicy(Policy.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .build(); + + Policy actualResponse = client.setIamPolicy(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockIAMPolicy.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + SetIamPolicyRequest actualRequest = ((SetIamPolicyRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getResource(), actualRequest.getResource()); + Assert.assertEquals(request.getPolicy(), actualRequest.getPolicy()); + Assert.assertEquals(request.getUpdateMask(), actualRequest.getUpdateMask()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void setIamPolicyExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockIAMPolicy.addException(exception); + + try { + SetIamPolicyRequest request = + SetIamPolicyRequest.newBuilder() + .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString()) + .setPolicy(Policy.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .build(); + client.setIamPolicy(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getIamPolicyTest() throws Exception { + Policy expectedResponse = + Policy.newBuilder() + .setVersion(351608024) + .addAllBindings(new ArrayList()) + .addAllAuditConfigs(new ArrayList()) + .setEtag(ByteString.EMPTY) + .build(); + mockIAMPolicy.addResponse(expectedResponse); + + GetIamPolicyRequest request = + GetIamPolicyRequest.newBuilder() + .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString()) + .setOptions(GetPolicyOptions.newBuilder().build()) + .build(); + + Policy actualResponse = client.getIamPolicy(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockIAMPolicy.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetIamPolicyRequest actualRequest = ((GetIamPolicyRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getResource(), actualRequest.getResource()); + Assert.assertEquals(request.getOptions(), actualRequest.getOptions()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getIamPolicyExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockIAMPolicy.addException(exception); + + try { + GetIamPolicyRequest request = + GetIamPolicyRequest.newBuilder() + .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString()) + .setOptions(GetPolicyOptions.newBuilder().build()) + .build(); + client.getIamPolicy(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void testIamPermissionsTest() throws Exception { + TestIamPermissionsResponse expectedResponse = + TestIamPermissionsResponse.newBuilder().addAllPermissions(new ArrayList()).build(); + mockIAMPolicy.addResponse(expectedResponse); + + TestIamPermissionsRequest request = + TestIamPermissionsRequest.newBuilder() + .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString()) + .addAllPermissions(new ArrayList()) + .build(); + + TestIamPermissionsResponse actualResponse = client.testIamPermissions(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockIAMPolicy.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + TestIamPermissionsRequest actualRequest = ((TestIamPermissionsRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getResource(), actualRequest.getResource()); + Assert.assertEquals(request.getPermissionsList(), actualRequest.getPermissionsList()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void testIamPermissionsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockIAMPolicy.addException(exception); + + try { + TestIamPermissionsRequest request = + TestIamPermissionsRequest.newBuilder() + .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString()) + .addAllPermissions(new ArrayList()) + .build(); + client.testIamPermissions(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } +} diff --git a/java-showcase-3.21.0/gapic-showcase/src/test/java/com/google/showcase/v1beta1/MockCompliance.java b/java-showcase-3.21.0/gapic-showcase/src/test/java/com/google/showcase/v1beta1/MockCompliance.java new file mode 100644 index 0000000000..dbf0d0e821 --- /dev/null +++ b/java-showcase-3.21.0/gapic-showcase/src/test/java/com/google/showcase/v1beta1/MockCompliance.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.showcase.v1beta1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.grpc.testing.MockGrpcService; +import com.google.protobuf.AbstractMessage; +import io.grpc.ServerServiceDefinition; +import java.util.List; +import javax.annotation.Generated; + +@BetaApi +@Generated("by gapic-generator-java") +public class MockCompliance implements MockGrpcService { + private final MockComplianceImpl serviceImpl; + + public MockCompliance() { + serviceImpl = new MockComplianceImpl(); + } + + @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-showcase-3.21.0/gapic-showcase/src/test/java/com/google/showcase/v1beta1/MockComplianceImpl.java b/java-showcase-3.21.0/gapic-showcase/src/test/java/com/google/showcase/v1beta1/MockComplianceImpl.java new file mode 100644 index 0000000000..935a0a8532 --- /dev/null +++ b/java-showcase-3.21.0/gapic-showcase/src/test/java/com/google/showcase/v1beta1/MockComplianceImpl.java @@ -0,0 +1,271 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1; + +import com.google.api.core.BetaApi; +import com.google.protobuf.AbstractMessage; +import com.google.showcase.v1beta1.ComplianceGrpc.ComplianceImplBase; +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 MockComplianceImpl extends ComplianceImplBase { + private List requests; + private Queue responses; + + public MockComplianceImpl() { + 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 repeatDataBody( + RepeatRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof RepeatResponse) { + requests.add(request); + responseObserver.onNext(((RepeatResponse) 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 RepeatDataBody, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + RepeatResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void repeatDataBodyInfo( + RepeatRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof RepeatResponse) { + requests.add(request); + responseObserver.onNext(((RepeatResponse) 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 RepeatDataBodyInfo, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + RepeatResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void repeatDataQuery( + RepeatRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof RepeatResponse) { + requests.add(request); + responseObserver.onNext(((RepeatResponse) 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 RepeatDataQuery, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + RepeatResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void repeatDataSimplePath( + RepeatRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof RepeatResponse) { + requests.add(request); + responseObserver.onNext(((RepeatResponse) 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 RepeatDataSimplePath, expected %s or" + + " %s", + response == null ? "null" : response.getClass().getName(), + RepeatResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void repeatDataPathResource( + RepeatRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof RepeatResponse) { + requests.add(request); + responseObserver.onNext(((RepeatResponse) 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 RepeatDataPathResource, expected %s or" + + " %s", + response == null ? "null" : response.getClass().getName(), + RepeatResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void repeatDataPathTrailingResource( + RepeatRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof RepeatResponse) { + requests.add(request); + responseObserver.onNext(((RepeatResponse) 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 RepeatDataPathTrailingResource," + + " expected %s or %s", + response == null ? "null" : response.getClass().getName(), + RepeatResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void repeatDataBodyPut( + RepeatRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof RepeatResponse) { + requests.add(request); + responseObserver.onNext(((RepeatResponse) 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 RepeatDataBodyPut, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + RepeatResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void repeatDataBodyPatch( + RepeatRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof RepeatResponse) { + requests.add(request); + responseObserver.onNext(((RepeatResponse) 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 RepeatDataBodyPatch, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + RepeatResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void getEnum(EnumRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof EnumResponse) { + requests.add(request); + responseObserver.onNext(((EnumResponse) 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 GetEnum, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + EnumResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void verifyEnum(EnumResponse request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof EnumResponse) { + requests.add(request); + responseObserver.onNext(((EnumResponse) 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 VerifyEnum, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + EnumResponse.class.getName(), + Exception.class.getName()))); + } + } +} diff --git a/java-showcase-3.21.0/gapic-showcase/src/test/java/com/google/showcase/v1beta1/MockEcho.java b/java-showcase-3.21.0/gapic-showcase/src/test/java/com/google/showcase/v1beta1/MockEcho.java new file mode 100644 index 0000000000..fc9db96a3e --- /dev/null +++ b/java-showcase-3.21.0/gapic-showcase/src/test/java/com/google/showcase/v1beta1/MockEcho.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.showcase.v1beta1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.grpc.testing.MockGrpcService; +import com.google.protobuf.AbstractMessage; +import io.grpc.ServerServiceDefinition; +import java.util.List; +import javax.annotation.Generated; + +@BetaApi +@Generated("by gapic-generator-java") +public class MockEcho implements MockGrpcService { + private final MockEchoImpl serviceImpl; + + public MockEcho() { + serviceImpl = new MockEchoImpl(); + } + + @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-showcase-3.21.0/gapic-showcase/src/test/java/com/google/showcase/v1beta1/MockEchoImpl.java b/java-showcase-3.21.0/gapic-showcase/src/test/java/com/google/showcase/v1beta1/MockEchoImpl.java new file mode 100644 index 0000000000..f505bb9ad9 --- /dev/null +++ b/java-showcase-3.21.0/gapic-showcase/src/test/java/com/google/showcase/v1beta1/MockEchoImpl.java @@ -0,0 +1,321 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1; + +import com.google.api.core.BetaApi; +import com.google.longrunning.Operation; +import com.google.protobuf.AbstractMessage; +import com.google.showcase.v1beta1.EchoGrpc.EchoImplBase; +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 MockEchoImpl extends EchoImplBase { + private List requests; + private Queue responses; + + public MockEchoImpl() { + 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 echo(EchoRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof EchoResponse) { + requests.add(request); + responseObserver.onNext(((EchoResponse) 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 Echo, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + EchoResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void echoErrorDetails( + EchoErrorDetailsRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof EchoErrorDetailsResponse) { + requests.add(request); + responseObserver.onNext(((EchoErrorDetailsResponse) 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 EchoErrorDetails, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + EchoErrorDetailsResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void failEchoWithDetails( + FailEchoWithDetailsRequest request, + StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof FailEchoWithDetailsResponse) { + requests.add(request); + responseObserver.onNext(((FailEchoWithDetailsResponse) 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 FailEchoWithDetails, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + FailEchoWithDetailsResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void expand(ExpandRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof EchoResponse) { + requests.add(request); + responseObserver.onNext(((EchoResponse) 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 Expand, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + EchoResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public StreamObserver collect(final StreamObserver responseObserver) { + StreamObserver requestObserver = + new StreamObserver() { + @Override + public void onNext(EchoRequest value) { + requests.add(value); + final Object response = responses.remove(); + if (response instanceof EchoResponse) { + responseObserver.onNext(((EchoResponse) response)); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method Collect, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + EchoResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void onError(Throwable t) { + responseObserver.onError(t); + } + + @Override + public void onCompleted() { + responseObserver.onCompleted(); + } + }; + return requestObserver; + } + + @Override + public StreamObserver chat(final StreamObserver responseObserver) { + StreamObserver requestObserver = + new StreamObserver() { + @Override + public void onNext(EchoRequest value) { + requests.add(value); + final Object response = responses.remove(); + if (response instanceof EchoResponse) { + responseObserver.onNext(((EchoResponse) response)); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method Chat, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + EchoResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void onError(Throwable t) { + responseObserver.onError(t); + } + + @Override + public void onCompleted() { + responseObserver.onCompleted(); + } + }; + return requestObserver; + } + + @Override + public void pagedExpand( + PagedExpandRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof PagedExpandResponse) { + requests.add(request); + responseObserver.onNext(((PagedExpandResponse) 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 PagedExpand, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + PagedExpandResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void pagedExpandLegacy( + PagedExpandLegacyRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof PagedExpandResponse) { + requests.add(request); + responseObserver.onNext(((PagedExpandResponse) 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 PagedExpandLegacy, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + PagedExpandResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void pagedExpandLegacyMapped( + PagedExpandRequest request, + StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof PagedExpandLegacyMappedResponse) { + requests.add(request); + responseObserver.onNext(((PagedExpandLegacyMappedResponse) 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 PagedExpandLegacyMapped, expected %s or" + + " %s", + response == null ? "null" : response.getClass().getName(), + PagedExpandLegacyMappedResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void wait(WaitRequest 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 Wait, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void block(BlockRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof BlockResponse) { + requests.add(request); + responseObserver.onNext(((BlockResponse) 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 Block, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + BlockResponse.class.getName(), + Exception.class.getName()))); + } + } +} diff --git a/java-showcase-3.21.0/gapic-showcase/src/test/java/com/google/showcase/v1beta1/MockIAMPolicy.java b/java-showcase-3.21.0/gapic-showcase/src/test/java/com/google/showcase/v1beta1/MockIAMPolicy.java new file mode 100644 index 0000000000..ef37c3d404 --- /dev/null +++ b/java-showcase-3.21.0/gapic-showcase/src/test/java/com/google/showcase/v1beta1/MockIAMPolicy.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.showcase.v1beta1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.grpc.testing.MockGrpcService; +import com.google.protobuf.AbstractMessage; +import io.grpc.ServerServiceDefinition; +import java.util.List; +import javax.annotation.Generated; + +@BetaApi +@Generated("by gapic-generator-java") +public class MockIAMPolicy implements MockGrpcService { + private final MockIAMPolicyImpl serviceImpl; + + public MockIAMPolicy() { + serviceImpl = new MockIAMPolicyImpl(); + } + + @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-showcase-3.21.0/gapic-showcase/src/test/java/com/google/showcase/v1beta1/MockIAMPolicyImpl.java b/java-showcase-3.21.0/gapic-showcase/src/test/java/com/google/showcase/v1beta1/MockIAMPolicyImpl.java new file mode 100644 index 0000000000..3c9b26728b --- /dev/null +++ b/java-showcase-3.21.0/gapic-showcase/src/test/java/com/google/showcase/v1beta1/MockIAMPolicyImpl.java @@ -0,0 +1,127 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1; + +import com.google.api.core.BetaApi; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.IAMPolicyGrpc.IAMPolicyImplBase; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.protobuf.AbstractMessage; +import io.grpc.stub.StreamObserver; +import java.util.ArrayList; +import java.util.LinkedList; +import java.util.List; +import java.util.Queue; +import javax.annotation.Generated; + +@BetaApi +@Generated("by gapic-generator-java") +public class MockIAMPolicyImpl extends IAMPolicyImplBase { + private List requests; + private Queue responses; + + public MockIAMPolicyImpl() { + 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 testIamPermissions( + TestIamPermissionsRequest request, + StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof TestIamPermissionsResponse) { + requests.add(request); + responseObserver.onNext(((TestIamPermissionsResponse) 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 TestIamPermissions, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + TestIamPermissionsResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void setIamPolicy(SetIamPolicyRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Policy) { + requests.add(request); + responseObserver.onNext(((Policy) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method SetIamPolicy, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Policy.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void getIamPolicy(GetIamPolicyRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Policy) { + requests.add(request); + responseObserver.onNext(((Policy) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method GetIamPolicy, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Policy.class.getName(), + Exception.class.getName()))); + } + } +} diff --git a/java-showcase-3.21.0/gapic-showcase/src/test/java/com/google/showcase/v1beta1/MockIdentity.java b/java-showcase-3.21.0/gapic-showcase/src/test/java/com/google/showcase/v1beta1/MockIdentity.java new file mode 100644 index 0000000000..e6b7dd1c46 --- /dev/null +++ b/java-showcase-3.21.0/gapic-showcase/src/test/java/com/google/showcase/v1beta1/MockIdentity.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.showcase.v1beta1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.grpc.testing.MockGrpcService; +import com.google.protobuf.AbstractMessage; +import io.grpc.ServerServiceDefinition; +import java.util.List; +import javax.annotation.Generated; + +@BetaApi +@Generated("by gapic-generator-java") +public class MockIdentity implements MockGrpcService { + private final MockIdentityImpl serviceImpl; + + public MockIdentity() { + serviceImpl = new MockIdentityImpl(); + } + + @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-showcase-3.21.0/gapic-showcase/src/test/java/com/google/showcase/v1beta1/MockIdentityImpl.java b/java-showcase-3.21.0/gapic-showcase/src/test/java/com/google/showcase/v1beta1/MockIdentityImpl.java new file mode 100644 index 0000000000..31b7602e49 --- /dev/null +++ b/java-showcase-3.21.0/gapic-showcase/src/test/java/com/google/showcase/v1beta1/MockIdentityImpl.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. + */ + +package com.google.showcase.v1beta1; + +import com.google.api.core.BetaApi; +import com.google.protobuf.AbstractMessage; +import com.google.protobuf.Empty; +import com.google.showcase.v1beta1.IdentityGrpc.IdentityImplBase; +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 MockIdentityImpl extends IdentityImplBase { + private List requests; + private Queue responses; + + public MockIdentityImpl() { + 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 createUser(CreateUserRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof User) { + requests.add(request); + responseObserver.onNext(((User) 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 CreateUser, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + User.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void getUser(GetUserRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof User) { + requests.add(request); + responseObserver.onNext(((User) 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 GetUser, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + User.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void updateUser(UpdateUserRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof User) { + requests.add(request); + responseObserver.onNext(((User) 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 UpdateUser, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + User.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void deleteUser(DeleteUserRequest 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 DeleteUser, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Empty.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void listUsers( + ListUsersRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof ListUsersResponse) { + requests.add(request); + responseObserver.onNext(((ListUsersResponse) 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 ListUsers, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + ListUsersResponse.class.getName(), + Exception.class.getName()))); + } + } +} diff --git a/java-showcase-3.21.0/gapic-showcase/src/test/java/com/google/showcase/v1beta1/MockLocations.java b/java-showcase-3.21.0/gapic-showcase/src/test/java/com/google/showcase/v1beta1/MockLocations.java new file mode 100644 index 0000000000..43855bd7e0 --- /dev/null +++ b/java-showcase-3.21.0/gapic-showcase/src/test/java/com/google/showcase/v1beta1/MockLocations.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.showcase.v1beta1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.grpc.testing.MockGrpcService; +import com.google.protobuf.AbstractMessage; +import io.grpc.ServerServiceDefinition; +import java.util.List; +import javax.annotation.Generated; + +@BetaApi +@Generated("by gapic-generator-java") +public class MockLocations implements MockGrpcService { + private final MockLocationsImpl serviceImpl; + + public MockLocations() { + serviceImpl = new MockLocationsImpl(); + } + + @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-showcase-3.21.0/gapic-showcase/src/test/java/com/google/showcase/v1beta1/MockLocationsImpl.java b/java-showcase-3.21.0/gapic-showcase/src/test/java/com/google/showcase/v1beta1/MockLocationsImpl.java new file mode 100644 index 0000000000..59502a268d --- /dev/null +++ b/java-showcase-3.21.0/gapic-showcase/src/test/java/com/google/showcase/v1beta1/MockLocationsImpl.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. + */ + +package com.google.showcase.v1beta1; + +import com.google.api.core.BetaApi; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.cloud.location.LocationsGrpc.LocationsImplBase; +import com.google.protobuf.AbstractMessage; +import io.grpc.stub.StreamObserver; +import java.util.ArrayList; +import java.util.LinkedList; +import java.util.List; +import java.util.Queue; +import javax.annotation.Generated; + +@BetaApi +@Generated("by gapic-generator-java") +public class MockLocationsImpl extends LocationsImplBase { + private List requests; + private Queue responses; + + public MockLocationsImpl() { + 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 listLocations( + ListLocationsRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof ListLocationsResponse) { + requests.add(request); + responseObserver.onNext(((ListLocationsResponse) 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 ListLocations, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + ListLocationsResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void getLocation(GetLocationRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Location) { + requests.add(request); + responseObserver.onNext(((Location) 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 GetLocation, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Location.class.getName(), + Exception.class.getName()))); + } + } +} diff --git a/java-showcase-3.21.0/gapic-showcase/src/test/java/com/google/showcase/v1beta1/MockMessaging.java b/java-showcase-3.21.0/gapic-showcase/src/test/java/com/google/showcase/v1beta1/MockMessaging.java new file mode 100644 index 0000000000..b9517576ed --- /dev/null +++ b/java-showcase-3.21.0/gapic-showcase/src/test/java/com/google/showcase/v1beta1/MockMessaging.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.showcase.v1beta1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.grpc.testing.MockGrpcService; +import com.google.protobuf.AbstractMessage; +import io.grpc.ServerServiceDefinition; +import java.util.List; +import javax.annotation.Generated; + +@BetaApi +@Generated("by gapic-generator-java") +public class MockMessaging implements MockGrpcService { + private final MockMessagingImpl serviceImpl; + + public MockMessaging() { + serviceImpl = new MockMessagingImpl(); + } + + @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-showcase-3.21.0/gapic-showcase/src/test/java/com/google/showcase/v1beta1/MockMessagingImpl.java b/java-showcase-3.21.0/gapic-showcase/src/test/java/com/google/showcase/v1beta1/MockMessagingImpl.java new file mode 100644 index 0000000000..2a36840c7c --- /dev/null +++ b/java-showcase-3.21.0/gapic-showcase/src/test/java/com/google/showcase/v1beta1/MockMessagingImpl.java @@ -0,0 +1,380 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1; + +import com.google.api.core.BetaApi; +import com.google.longrunning.Operation; +import com.google.protobuf.AbstractMessage; +import com.google.protobuf.Empty; +import com.google.showcase.v1beta1.MessagingGrpc.MessagingImplBase; +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 MockMessagingImpl extends MessagingImplBase { + private List requests; + private Queue responses; + + public MockMessagingImpl() { + 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 createRoom(CreateRoomRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Room) { + requests.add(request); + responseObserver.onNext(((Room) 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 CreateRoom, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Room.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void getRoom(GetRoomRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Room) { + requests.add(request); + responseObserver.onNext(((Room) 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 GetRoom, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Room.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void updateRoom(UpdateRoomRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Room) { + requests.add(request); + responseObserver.onNext(((Room) 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 UpdateRoom, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Room.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void deleteRoom(DeleteRoomRequest 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 DeleteRoom, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Empty.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void listRooms( + ListRoomsRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof ListRoomsResponse) { + requests.add(request); + responseObserver.onNext(((ListRoomsResponse) 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 ListRooms, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + ListRoomsResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void createBlurb(CreateBlurbRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Blurb) { + requests.add(request); + responseObserver.onNext(((Blurb) 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 CreateBlurb, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Blurb.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void getBlurb(GetBlurbRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Blurb) { + requests.add(request); + responseObserver.onNext(((Blurb) 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 GetBlurb, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Blurb.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void updateBlurb(UpdateBlurbRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Blurb) { + requests.add(request); + responseObserver.onNext(((Blurb) 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 UpdateBlurb, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Blurb.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void deleteBlurb(DeleteBlurbRequest 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 DeleteBlurb, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Empty.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void listBlurbs( + ListBlurbsRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof ListBlurbsResponse) { + requests.add(request); + responseObserver.onNext(((ListBlurbsResponse) 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 ListBlurbs, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + ListBlurbsResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void searchBlurbs( + SearchBlurbsRequest 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 SearchBlurbs, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void streamBlurbs( + StreamBlurbsRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof StreamBlurbsResponse) { + requests.add(request); + responseObserver.onNext(((StreamBlurbsResponse) 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 StreamBlurbs, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + StreamBlurbsResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public StreamObserver sendBlurbs( + final StreamObserver responseObserver) { + StreamObserver requestObserver = + new StreamObserver() { + @Override + public void onNext(CreateBlurbRequest value) { + requests.add(value); + final Object response = responses.remove(); + if (response instanceof SendBlurbsResponse) { + responseObserver.onNext(((SendBlurbsResponse) response)); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method SendBlurbs, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + SendBlurbsResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void onError(Throwable t) { + responseObserver.onError(t); + } + + @Override + public void onCompleted() { + responseObserver.onCompleted(); + } + }; + return requestObserver; + } + + @Override + public StreamObserver connect( + final StreamObserver responseObserver) { + StreamObserver requestObserver = + new StreamObserver() { + @Override + public void onNext(ConnectRequest value) { + requests.add(value); + final Object response = responses.remove(); + if (response instanceof StreamBlurbsResponse) { + responseObserver.onNext(((StreamBlurbsResponse) response)); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method Connect, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + StreamBlurbsResponse.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-showcase-3.21.0/gapic-showcase/src/test/java/com/google/showcase/v1beta1/MockSequenceService.java b/java-showcase-3.21.0/gapic-showcase/src/test/java/com/google/showcase/v1beta1/MockSequenceService.java new file mode 100644 index 0000000000..606571e14d --- /dev/null +++ b/java-showcase-3.21.0/gapic-showcase/src/test/java/com/google/showcase/v1beta1/MockSequenceService.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.showcase.v1beta1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.grpc.testing.MockGrpcService; +import com.google.protobuf.AbstractMessage; +import io.grpc.ServerServiceDefinition; +import java.util.List; +import javax.annotation.Generated; + +@BetaApi +@Generated("by gapic-generator-java") +public class MockSequenceService implements MockGrpcService { + private final MockSequenceServiceImpl serviceImpl; + + public MockSequenceService() { + serviceImpl = new MockSequenceServiceImpl(); + } + + @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-showcase-3.21.0/gapic-showcase/src/test/java/com/google/showcase/v1beta1/MockSequenceServiceImpl.java b/java-showcase-3.21.0/gapic-showcase/src/test/java/com/google/showcase/v1beta1/MockSequenceServiceImpl.java new file mode 100644 index 0000000000..92e5fb15c8 --- /dev/null +++ b/java-showcase-3.21.0/gapic-showcase/src/test/java/com/google/showcase/v1beta1/MockSequenceServiceImpl.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.showcase.v1beta1; + +import com.google.api.core.BetaApi; +import com.google.protobuf.AbstractMessage; +import com.google.protobuf.Empty; +import com.google.showcase.v1beta1.SequenceServiceGrpc.SequenceServiceImplBase; +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 MockSequenceServiceImpl extends SequenceServiceImplBase { + private List requests; + private Queue responses; + + public MockSequenceServiceImpl() { + 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 createSequence( + CreateSequenceRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Sequence) { + requests.add(request); + responseObserver.onNext(((Sequence) 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 CreateSequence, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Sequence.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void createStreamingSequence( + CreateStreamingSequenceRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof StreamingSequence) { + requests.add(request); + responseObserver.onNext(((StreamingSequence) 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 CreateStreamingSequence, expected %s or" + + " %s", + response == null ? "null" : response.getClass().getName(), + StreamingSequence.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void getSequenceReport( + GetSequenceReportRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof SequenceReport) { + requests.add(request); + responseObserver.onNext(((SequenceReport) 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 GetSequenceReport, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + SequenceReport.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void getStreamingSequenceReport( + GetStreamingSequenceReportRequest request, + StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof StreamingSequenceReport) { + requests.add(request); + responseObserver.onNext(((StreamingSequenceReport) 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 GetStreamingSequenceReport, expected %s" + + " or %s", + response == null ? "null" : response.getClass().getName(), + StreamingSequenceReport.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void attemptSequence( + AttemptSequenceRequest 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 AttemptSequence, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Empty.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void attemptStreamingSequence( + AttemptStreamingSequenceRequest request, + StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof AttemptStreamingSequenceResponse) { + requests.add(request); + responseObserver.onNext(((AttemptStreamingSequenceResponse) 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 AttemptStreamingSequence, expected %s" + + " or %s", + response == null ? "null" : response.getClass().getName(), + AttemptStreamingSequenceResponse.class.getName(), + Exception.class.getName()))); + } + } +} diff --git a/java-showcase-3.21.0/gapic-showcase/src/test/java/com/google/showcase/v1beta1/MockTesting.java b/java-showcase-3.21.0/gapic-showcase/src/test/java/com/google/showcase/v1beta1/MockTesting.java new file mode 100644 index 0000000000..c03ddbbe4a --- /dev/null +++ b/java-showcase-3.21.0/gapic-showcase/src/test/java/com/google/showcase/v1beta1/MockTesting.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.showcase.v1beta1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.grpc.testing.MockGrpcService; +import com.google.protobuf.AbstractMessage; +import io.grpc.ServerServiceDefinition; +import java.util.List; +import javax.annotation.Generated; + +@BetaApi +@Generated("by gapic-generator-java") +public class MockTesting implements MockGrpcService { + private final MockTestingImpl serviceImpl; + + public MockTesting() { + serviceImpl = new MockTestingImpl(); + } + + @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-showcase-3.21.0/gapic-showcase/src/test/java/com/google/showcase/v1beta1/MockTestingImpl.java b/java-showcase-3.21.0/gapic-showcase/src/test/java/com/google/showcase/v1beta1/MockTestingImpl.java new file mode 100644 index 0000000000..a73afd59a3 --- /dev/null +++ b/java-showcase-3.21.0/gapic-showcase/src/test/java/com/google/showcase/v1beta1/MockTestingImpl.java @@ -0,0 +1,226 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1; + +import com.google.api.core.BetaApi; +import com.google.protobuf.AbstractMessage; +import com.google.protobuf.Empty; +import com.google.showcase.v1beta1.TestingGrpc.TestingImplBase; +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 MockTestingImpl extends TestingImplBase { + private List requests; + private Queue responses; + + public MockTestingImpl() { + 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 createSession( + CreateSessionRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Session) { + requests.add(request); + responseObserver.onNext(((Session) 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 CreateSession, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Session.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void getSession(GetSessionRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Session) { + requests.add(request); + responseObserver.onNext(((Session) 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 GetSession, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Session.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void listSessions( + ListSessionsRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof ListSessionsResponse) { + requests.add(request); + responseObserver.onNext(((ListSessionsResponse) 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 ListSessions, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + ListSessionsResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void deleteSession(DeleteSessionRequest 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 DeleteSession, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Empty.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void reportSession( + ReportSessionRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof ReportSessionResponse) { + requests.add(request); + responseObserver.onNext(((ReportSessionResponse) 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 ReportSession, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + ReportSessionResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void listTests( + ListTestsRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof ListTestsResponse) { + requests.add(request); + responseObserver.onNext(((ListTestsResponse) 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 ListTests, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + ListTestsResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void deleteTest(DeleteTestRequest 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 DeleteTest, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Empty.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void verifyTest( + VerifyTestRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof VerifyTestResponse) { + requests.add(request); + responseObserver.onNext(((VerifyTestResponse) 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 VerifyTest, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + VerifyTestResponse.class.getName(), + Exception.class.getName()))); + } + } +} diff --git a/java-showcase-3.21.0/gapic-showcase/src/test/java/com/google/showcase/v1beta1/SequenceServiceClientHttpJsonTest.java b/java-showcase-3.21.0/gapic-showcase/src/test/java/com/google/showcase/v1beta1/SequenceServiceClientHttpJsonTest.java new file mode 100644 index 0000000000..6dc92ad8b4 --- /dev/null +++ b/java-showcase-3.21.0/gapic-showcase/src/test/java/com/google/showcase/v1beta1/SequenceServiceClientHttpJsonTest.java @@ -0,0 +1,735 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1; + +import static com.google.showcase.v1beta1.SequenceServiceClient.ListLocationsPagedResponse; + +import com.google.api.gax.core.NoCredentialsProvider; +import com.google.api.gax.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.testing.MockHttpService; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ApiException; +import com.google.api.gax.rpc.ApiExceptionFactory; +import com.google.api.gax.rpc.InvalidArgumentException; +import com.google.api.gax.rpc.StatusCode; +import com.google.api.gax.rpc.testing.FakeStatusCode; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.common.collect.Lists; +import com.google.iam.v1.AuditConfig; +import com.google.iam.v1.Binding; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.GetPolicyOptions; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.protobuf.Any; +import com.google.protobuf.ByteString; +import com.google.protobuf.Empty; +import com.google.protobuf.FieldMask; +import com.google.showcase.v1beta1.stub.HttpJsonSequenceServiceStub; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +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 SequenceServiceClientHttpJsonTest { + private static MockHttpService mockService; + private static SequenceServiceClient client; + + @BeforeClass + public static void startStaticServer() throws IOException { + mockService = + new MockHttpService( + HttpJsonSequenceServiceStub.getMethodDescriptors(), + SequenceServiceSettings.getDefaultEndpoint()); + SequenceServiceSettings settings = + SequenceServiceSettings.newHttpJsonBuilder() + .setTransportChannelProvider( + SequenceServiceSettings.defaultHttpJsonTransportProviderBuilder() + .setHttpTransport(mockService) + .build()) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = SequenceServiceClient.create(settings); + } + + @AfterClass + public static void stopServer() { + client.close(); + } + + @Before + public void setUp() {} + + @After + public void tearDown() throws Exception { + mockService.reset(); + } + + @Test + public void createSequenceTest() throws Exception { + Sequence expectedResponse = + Sequence.newBuilder() + .setName(SequenceName.of("[SEQUENCE]").toString()) + .addAllResponses(new ArrayList()) + .build(); + mockService.addResponse(expectedResponse); + + Sequence sequence = Sequence.newBuilder().build(); + + Sequence actualResponse = client.createSequence(sequence); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void createSequenceExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + Sequence sequence = Sequence.newBuilder().build(); + client.createSequence(sequence); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createStreamingSequenceTest() throws Exception { + StreamingSequence expectedResponse = + StreamingSequence.newBuilder() + .setName(StreamingSequenceName.of("[STREAMING_SEQUENCE]").toString()) + .setContent("content951530617") + .addAllResponses(new ArrayList()) + .build(); + mockService.addResponse(expectedResponse); + + StreamingSequence streamingSequence = StreamingSequence.newBuilder().build(); + + StreamingSequence actualResponse = client.createStreamingSequence(streamingSequence); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void createStreamingSequenceExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + StreamingSequence streamingSequence = StreamingSequence.newBuilder().build(); + client.createStreamingSequence(streamingSequence); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getSequenceReportTest() throws Exception { + SequenceReport expectedResponse = + SequenceReport.newBuilder() + .setName(SequenceReportName.of("[SEQUENCE]").toString()) + .addAllAttempts(new ArrayList()) + .build(); + mockService.addResponse(expectedResponse); + + SequenceReportName name = SequenceReportName.of("[SEQUENCE]"); + + SequenceReport actualResponse = client.getSequenceReport(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void getSequenceReportExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + SequenceReportName name = SequenceReportName.of("[SEQUENCE]"); + client.getSequenceReport(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getSequenceReportTest2() throws Exception { + SequenceReport expectedResponse = + SequenceReport.newBuilder() + .setName(SequenceReportName.of("[SEQUENCE]").toString()) + .addAllAttempts(new ArrayList()) + .build(); + mockService.addResponse(expectedResponse); + + String name = "sequences/sequence-5566/sequenceReport"; + + SequenceReport actualResponse = client.getSequenceReport(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void getSequenceReportExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String name = "sequences/sequence-5566/sequenceReport"; + client.getSequenceReport(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getStreamingSequenceReportTest() throws Exception { + StreamingSequenceReport expectedResponse = + StreamingSequenceReport.newBuilder() + .setName(StreamingSequenceReportName.of("[STREAMING_SEQUENCE]").toString()) + .addAllAttempts(new ArrayList()) + .build(); + mockService.addResponse(expectedResponse); + + StreamingSequenceReportName name = StreamingSequenceReportName.of("[STREAMING_SEQUENCE]"); + + StreamingSequenceReport actualResponse = client.getStreamingSequenceReport(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void getStreamingSequenceReportExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + StreamingSequenceReportName name = StreamingSequenceReportName.of("[STREAMING_SEQUENCE]"); + client.getStreamingSequenceReport(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getStreamingSequenceReportTest2() throws Exception { + StreamingSequenceReport expectedResponse = + StreamingSequenceReport.newBuilder() + .setName(StreamingSequenceReportName.of("[STREAMING_SEQUENCE]").toString()) + .addAllAttempts(new ArrayList()) + .build(); + mockService.addResponse(expectedResponse); + + String name = "streamingSequences/streamingSequence-962/streamingSequenceReport"; + + StreamingSequenceReport actualResponse = client.getStreamingSequenceReport(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void getStreamingSequenceReportExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String name = "streamingSequences/streamingSequence-962/streamingSequenceReport"; + client.getStreamingSequenceReport(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void attemptSequenceTest() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockService.addResponse(expectedResponse); + + SequenceName name = SequenceName.of("[SEQUENCE]"); + + client.attemptSequence(name); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void attemptSequenceExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + SequenceName name = SequenceName.of("[SEQUENCE]"); + client.attemptSequence(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void attemptSequenceTest2() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockService.addResponse(expectedResponse); + + String name = "sequences/sequence-9950"; + + client.attemptSequence(name); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void attemptSequenceExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String name = "sequences/sequence-9950"; + client.attemptSequence(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void attemptStreamingSequenceTest() throws Exception {} + + @Test + public void attemptStreamingSequenceExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + } + + @Test + public void listLocationsTest() throws Exception { + Location responsesElement = Location.newBuilder().build(); + ListLocationsResponse expectedResponse = + ListLocationsResponse.newBuilder() + .setNextPageToken("") + .addAllLocations(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + ListLocationsRequest request = + ListLocationsRequest.newBuilder() + .setName("projects/project-3664") + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + + ListLocationsPagedResponse pagedListResponse = client.listLocations(request); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getLocationsList().get(0), resources.get(0)); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void listLocationsExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ListLocationsRequest request = + ListLocationsRequest.newBuilder() + .setName("projects/project-3664") + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + client.listLocations(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getLocationTest() throws Exception { + Location expectedResponse = + Location.newBuilder() + .setName("name3373707") + .setLocationId("locationId1541836720") + .setDisplayName("displayName1714148973") + .putAllLabels(new HashMap()) + .setMetadata(Any.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + GetLocationRequest request = + GetLocationRequest.newBuilder() + .setName("projects/project-9062/locations/location-9062") + .build(); + + Location actualResponse = client.getLocation(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void getLocationExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + GetLocationRequest request = + GetLocationRequest.newBuilder() + .setName("projects/project-9062/locations/location-9062") + .build(); + client.getLocation(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void setIamPolicyTest() throws Exception { + Policy expectedResponse = + Policy.newBuilder() + .setVersion(351608024) + .addAllBindings(new ArrayList()) + .addAllAuditConfigs(new ArrayList()) + .setEtag(ByteString.EMPTY) + .build(); + mockService.addResponse(expectedResponse); + + SetIamPolicyRequest request = + SetIamPolicyRequest.newBuilder() + .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString()) + .setPolicy(Policy.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .build(); + + Policy actualResponse = client.setIamPolicy(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void setIamPolicyExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + SetIamPolicyRequest request = + SetIamPolicyRequest.newBuilder() + .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString()) + .setPolicy(Policy.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .build(); + client.setIamPolicy(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getIamPolicyTest() throws Exception { + Policy expectedResponse = + Policy.newBuilder() + .setVersion(351608024) + .addAllBindings(new ArrayList()) + .addAllAuditConfigs(new ArrayList()) + .setEtag(ByteString.EMPTY) + .build(); + mockService.addResponse(expectedResponse); + + GetIamPolicyRequest request = + GetIamPolicyRequest.newBuilder() + .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString()) + .setOptions(GetPolicyOptions.newBuilder().build()) + .build(); + + Policy actualResponse = client.getIamPolicy(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void getIamPolicyExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + GetIamPolicyRequest request = + GetIamPolicyRequest.newBuilder() + .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString()) + .setOptions(GetPolicyOptions.newBuilder().build()) + .build(); + client.getIamPolicy(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void testIamPermissionsTest() throws Exception { + TestIamPermissionsResponse expectedResponse = + TestIamPermissionsResponse.newBuilder().addAllPermissions(new ArrayList()).build(); + mockService.addResponse(expectedResponse); + + TestIamPermissionsRequest request = + TestIamPermissionsRequest.newBuilder() + .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString()) + .addAllPermissions(new ArrayList()) + .build(); + + TestIamPermissionsResponse actualResponse = client.testIamPermissions(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void testIamPermissionsExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + TestIamPermissionsRequest request = + TestIamPermissionsRequest.newBuilder() + .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString()) + .addAllPermissions(new ArrayList()) + .build(); + client.testIamPermissions(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } +} diff --git a/java-showcase-3.21.0/gapic-showcase/src/test/java/com/google/showcase/v1beta1/SequenceServiceClientTest.java b/java-showcase-3.21.0/gapic-showcase/src/test/java/com/google/showcase/v1beta1/SequenceServiceClientTest.java new file mode 100644 index 0000000000..43d36555c0 --- /dev/null +++ b/java-showcase-3.21.0/gapic-showcase/src/test/java/com/google/showcase/v1beta1/SequenceServiceClientTest.java @@ -0,0 +1,712 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1; + +import static com.google.showcase.v1beta1.SequenceServiceClient.ListLocationsPagedResponse; + +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.InvalidArgumentException; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.api.gax.rpc.StatusCode; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.common.collect.Lists; +import com.google.iam.v1.AuditConfig; +import com.google.iam.v1.Binding; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.GetPolicyOptions; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.protobuf.AbstractMessage; +import com.google.protobuf.Any; +import com.google.protobuf.ByteString; +import com.google.protobuf.Empty; +import com.google.protobuf.FieldMask; +import io.grpc.StatusRuntimeException; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.UUID; +import 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 SequenceServiceClientTest { + private static MockIAMPolicy mockIAMPolicy; + private static MockLocations mockLocations; + private static MockSequenceService mockSequenceService; + private static MockServiceHelper mockServiceHelper; + private LocalChannelProvider channelProvider; + private SequenceServiceClient client; + + @BeforeClass + public static void startStaticServer() { + mockSequenceService = new MockSequenceService(); + mockLocations = new MockLocations(); + mockIAMPolicy = new MockIAMPolicy(); + mockServiceHelper = + new MockServiceHelper( + UUID.randomUUID().toString(), + Arrays.asList(mockSequenceService, mockLocations, mockIAMPolicy)); + mockServiceHelper.start(); + } + + @AfterClass + public static void stopServer() { + mockServiceHelper.stop(); + } + + @Before + public void setUp() throws IOException { + mockServiceHelper.reset(); + channelProvider = mockServiceHelper.createChannelProvider(); + SequenceServiceSettings settings = + SequenceServiceSettings.newBuilder() + .setTransportChannelProvider(channelProvider) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = SequenceServiceClient.create(settings); + } + + @After + public void tearDown() throws Exception { + client.close(); + } + + @Test + public void createSequenceTest() throws Exception { + Sequence expectedResponse = + Sequence.newBuilder() + .setName(SequenceName.of("[SEQUENCE]").toString()) + .addAllResponses(new ArrayList()) + .build(); + mockSequenceService.addResponse(expectedResponse); + + Sequence sequence = Sequence.newBuilder().build(); + + Sequence actualResponse = client.createSequence(sequence); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockSequenceService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateSequenceRequest actualRequest = ((CreateSequenceRequest) actualRequests.get(0)); + + Assert.assertEquals(sequence, actualRequest.getSequence()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void createSequenceExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockSequenceService.addException(exception); + + try { + Sequence sequence = Sequence.newBuilder().build(); + client.createSequence(sequence); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createStreamingSequenceTest() throws Exception { + StreamingSequence expectedResponse = + StreamingSequence.newBuilder() + .setName(StreamingSequenceName.of("[STREAMING_SEQUENCE]").toString()) + .setContent("content951530617") + .addAllResponses(new ArrayList()) + .build(); + mockSequenceService.addResponse(expectedResponse); + + StreamingSequence streamingSequence = StreamingSequence.newBuilder().build(); + + StreamingSequence actualResponse = client.createStreamingSequence(streamingSequence); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockSequenceService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateStreamingSequenceRequest actualRequest = + ((CreateStreamingSequenceRequest) actualRequests.get(0)); + + Assert.assertEquals(streamingSequence, actualRequest.getStreamingSequence()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void createStreamingSequenceExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockSequenceService.addException(exception); + + try { + StreamingSequence streamingSequence = StreamingSequence.newBuilder().build(); + client.createStreamingSequence(streamingSequence); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getSequenceReportTest() throws Exception { + SequenceReport expectedResponse = + SequenceReport.newBuilder() + .setName(SequenceReportName.of("[SEQUENCE]").toString()) + .addAllAttempts(new ArrayList()) + .build(); + mockSequenceService.addResponse(expectedResponse); + + SequenceReportName name = SequenceReportName.of("[SEQUENCE]"); + + SequenceReport actualResponse = client.getSequenceReport(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockSequenceService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetSequenceReportRequest actualRequest = ((GetSequenceReportRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getSequenceReportExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockSequenceService.addException(exception); + + try { + SequenceReportName name = SequenceReportName.of("[SEQUENCE]"); + client.getSequenceReport(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getSequenceReportTest2() throws Exception { + SequenceReport expectedResponse = + SequenceReport.newBuilder() + .setName(SequenceReportName.of("[SEQUENCE]").toString()) + .addAllAttempts(new ArrayList()) + .build(); + mockSequenceService.addResponse(expectedResponse); + + String name = "name3373707"; + + SequenceReport actualResponse = client.getSequenceReport(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockSequenceService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetSequenceReportRequest actualRequest = ((GetSequenceReportRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getSequenceReportExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockSequenceService.addException(exception); + + try { + String name = "name3373707"; + client.getSequenceReport(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getStreamingSequenceReportTest() throws Exception { + StreamingSequenceReport expectedResponse = + StreamingSequenceReport.newBuilder() + .setName(StreamingSequenceReportName.of("[STREAMING_SEQUENCE]").toString()) + .addAllAttempts(new ArrayList()) + .build(); + mockSequenceService.addResponse(expectedResponse); + + StreamingSequenceReportName name = StreamingSequenceReportName.of("[STREAMING_SEQUENCE]"); + + StreamingSequenceReport actualResponse = client.getStreamingSequenceReport(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockSequenceService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetStreamingSequenceReportRequest actualRequest = + ((GetStreamingSequenceReportRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getStreamingSequenceReportExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockSequenceService.addException(exception); + + try { + StreamingSequenceReportName name = StreamingSequenceReportName.of("[STREAMING_SEQUENCE]"); + client.getStreamingSequenceReport(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getStreamingSequenceReportTest2() throws Exception { + StreamingSequenceReport expectedResponse = + StreamingSequenceReport.newBuilder() + .setName(StreamingSequenceReportName.of("[STREAMING_SEQUENCE]").toString()) + .addAllAttempts(new ArrayList()) + .build(); + mockSequenceService.addResponse(expectedResponse); + + String name = "name3373707"; + + StreamingSequenceReport actualResponse = client.getStreamingSequenceReport(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockSequenceService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetStreamingSequenceReportRequest actualRequest = + ((GetStreamingSequenceReportRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getStreamingSequenceReportExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockSequenceService.addException(exception); + + try { + String name = "name3373707"; + client.getStreamingSequenceReport(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void attemptSequenceTest() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockSequenceService.addResponse(expectedResponse); + + SequenceName name = SequenceName.of("[SEQUENCE]"); + + client.attemptSequence(name); + + List actualRequests = mockSequenceService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + AttemptSequenceRequest actualRequest = ((AttemptSequenceRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void attemptSequenceExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockSequenceService.addException(exception); + + try { + SequenceName name = SequenceName.of("[SEQUENCE]"); + client.attemptSequence(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void attemptSequenceTest2() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockSequenceService.addResponse(expectedResponse); + + String name = "name3373707"; + + client.attemptSequence(name); + + List actualRequests = mockSequenceService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + AttemptSequenceRequest actualRequest = ((AttemptSequenceRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void attemptSequenceExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockSequenceService.addException(exception); + + try { + String name = "name3373707"; + client.attemptSequence(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void attemptStreamingSequenceTest() throws Exception { + AttemptStreamingSequenceResponse expectedResponse = + AttemptStreamingSequenceResponse.newBuilder().setContent("content951530617").build(); + mockSequenceService.addResponse(expectedResponse); + AttemptStreamingSequenceRequest request = + AttemptStreamingSequenceRequest.newBuilder() + .setName(StreamingSequenceName.of("[STREAMING_SEQUENCE]").toString()) + .setLastFailIndex(2006482362) + .build(); + + MockStreamObserver responseObserver = + new MockStreamObserver<>(); + + ServerStreamingCallable + callable = client.attemptStreamingSequenceCallable(); + callable.serverStreamingCall(request, responseObserver); + + List actualResponses = responseObserver.future().get(); + Assert.assertEquals(1, actualResponses.size()); + Assert.assertEquals(expectedResponse, actualResponses.get(0)); + } + + @Test + public void attemptStreamingSequenceExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockSequenceService.addException(exception); + AttemptStreamingSequenceRequest request = + AttemptStreamingSequenceRequest.newBuilder() + .setName(StreamingSequenceName.of("[STREAMING_SEQUENCE]").toString()) + .setLastFailIndex(2006482362) + .build(); + + MockStreamObserver responseObserver = + new MockStreamObserver<>(); + + ServerStreamingCallable + callable = client.attemptStreamingSequenceCallable(); + callable.serverStreamingCall(request, responseObserver); + + 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()); + } + } + + @Test + public void listLocationsTest() throws Exception { + Location responsesElement = Location.newBuilder().build(); + ListLocationsResponse expectedResponse = + ListLocationsResponse.newBuilder() + .setNextPageToken("") + .addAllLocations(Arrays.asList(responsesElement)) + .build(); + mockLocations.addResponse(expectedResponse); + + ListLocationsRequest request = + ListLocationsRequest.newBuilder() + .setName("name3373707") + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + + ListLocationsPagedResponse pagedListResponse = client.listLocations(request); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getLocationsList().get(0), resources.get(0)); + + List actualRequests = mockLocations.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListLocationsRequest actualRequest = ((ListLocationsRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getName(), actualRequest.getName()); + Assert.assertEquals(request.getFilter(), actualRequest.getFilter()); + Assert.assertEquals(request.getPageSize(), actualRequest.getPageSize()); + Assert.assertEquals(request.getPageToken(), actualRequest.getPageToken()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listLocationsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockLocations.addException(exception); + + try { + ListLocationsRequest request = + ListLocationsRequest.newBuilder() + .setName("name3373707") + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + client.listLocations(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getLocationTest() throws Exception { + Location expectedResponse = + Location.newBuilder() + .setName("name3373707") + .setLocationId("locationId1541836720") + .setDisplayName("displayName1714148973") + .putAllLabels(new HashMap()) + .setMetadata(Any.newBuilder().build()) + .build(); + mockLocations.addResponse(expectedResponse); + + GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build(); + + Location actualResponse = client.getLocation(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockLocations.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetLocationRequest actualRequest = ((GetLocationRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getName(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getLocationExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockLocations.addException(exception); + + try { + GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build(); + client.getLocation(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void setIamPolicyTest() throws Exception { + Policy expectedResponse = + Policy.newBuilder() + .setVersion(351608024) + .addAllBindings(new ArrayList()) + .addAllAuditConfigs(new ArrayList()) + .setEtag(ByteString.EMPTY) + .build(); + mockIAMPolicy.addResponse(expectedResponse); + + SetIamPolicyRequest request = + SetIamPolicyRequest.newBuilder() + .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString()) + .setPolicy(Policy.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .build(); + + Policy actualResponse = client.setIamPolicy(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockIAMPolicy.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + SetIamPolicyRequest actualRequest = ((SetIamPolicyRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getResource(), actualRequest.getResource()); + Assert.assertEquals(request.getPolicy(), actualRequest.getPolicy()); + Assert.assertEquals(request.getUpdateMask(), actualRequest.getUpdateMask()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void setIamPolicyExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockIAMPolicy.addException(exception); + + try { + SetIamPolicyRequest request = + SetIamPolicyRequest.newBuilder() + .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString()) + .setPolicy(Policy.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .build(); + client.setIamPolicy(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getIamPolicyTest() throws Exception { + Policy expectedResponse = + Policy.newBuilder() + .setVersion(351608024) + .addAllBindings(new ArrayList()) + .addAllAuditConfigs(new ArrayList()) + .setEtag(ByteString.EMPTY) + .build(); + mockIAMPolicy.addResponse(expectedResponse); + + GetIamPolicyRequest request = + GetIamPolicyRequest.newBuilder() + .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString()) + .setOptions(GetPolicyOptions.newBuilder().build()) + .build(); + + Policy actualResponse = client.getIamPolicy(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockIAMPolicy.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetIamPolicyRequest actualRequest = ((GetIamPolicyRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getResource(), actualRequest.getResource()); + Assert.assertEquals(request.getOptions(), actualRequest.getOptions()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getIamPolicyExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockIAMPolicy.addException(exception); + + try { + GetIamPolicyRequest request = + GetIamPolicyRequest.newBuilder() + .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString()) + .setOptions(GetPolicyOptions.newBuilder().build()) + .build(); + client.getIamPolicy(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void testIamPermissionsTest() throws Exception { + TestIamPermissionsResponse expectedResponse = + TestIamPermissionsResponse.newBuilder().addAllPermissions(new ArrayList()).build(); + mockIAMPolicy.addResponse(expectedResponse); + + TestIamPermissionsRequest request = + TestIamPermissionsRequest.newBuilder() + .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString()) + .addAllPermissions(new ArrayList()) + .build(); + + TestIamPermissionsResponse actualResponse = client.testIamPermissions(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockIAMPolicy.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + TestIamPermissionsRequest actualRequest = ((TestIamPermissionsRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getResource(), actualRequest.getResource()); + Assert.assertEquals(request.getPermissionsList(), actualRequest.getPermissionsList()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void testIamPermissionsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockIAMPolicy.addException(exception); + + try { + TestIamPermissionsRequest request = + TestIamPermissionsRequest.newBuilder() + .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString()) + .addAllPermissions(new ArrayList()) + .build(); + client.testIamPermissions(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } +} diff --git a/java-showcase-3.21.0/gapic-showcase/src/test/java/com/google/showcase/v1beta1/TestingClientHttpJsonTest.java b/java-showcase-3.21.0/gapic-showcase/src/test/java/com/google/showcase/v1beta1/TestingClientHttpJsonTest.java new file mode 100644 index 0000000000..5a6df6a7ee --- /dev/null +++ b/java-showcase-3.21.0/gapic-showcase/src/test/java/com/google/showcase/v1beta1/TestingClientHttpJsonTest.java @@ -0,0 +1,766 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1; + +import static com.google.showcase.v1beta1.TestingClient.ListLocationsPagedResponse; +import static com.google.showcase.v1beta1.TestingClient.ListSessionsPagedResponse; +import static com.google.showcase.v1beta1.TestingClient.ListTestsPagedResponse; + +import com.google.api.gax.core.NoCredentialsProvider; +import com.google.api.gax.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.testing.MockHttpService; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ApiException; +import com.google.api.gax.rpc.ApiExceptionFactory; +import com.google.api.gax.rpc.InvalidArgumentException; +import com.google.api.gax.rpc.StatusCode; +import com.google.api.gax.rpc.testing.FakeStatusCode; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.common.collect.Lists; +import com.google.iam.v1.AuditConfig; +import com.google.iam.v1.Binding; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.GetPolicyOptions; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.protobuf.Any; +import com.google.protobuf.ByteString; +import com.google.protobuf.Empty; +import com.google.protobuf.FieldMask; +import com.google.showcase.v1beta1.stub.HttpJsonTestingStub; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +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 TestingClientHttpJsonTest { + private static MockHttpService mockService; + private static TestingClient client; + + @BeforeClass + public static void startStaticServer() throws IOException { + mockService = + new MockHttpService( + HttpJsonTestingStub.getMethodDescriptors(), TestingSettings.getDefaultEndpoint()); + TestingSettings settings = + TestingSettings.newHttpJsonBuilder() + .setTransportChannelProvider( + TestingSettings.defaultHttpJsonTransportProviderBuilder() + .setHttpTransport(mockService) + .build()) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = TestingClient.create(settings); + } + + @AfterClass + public static void stopServer() { + client.close(); + } + + @Before + public void setUp() {} + + @After + public void tearDown() throws Exception { + mockService.reset(); + } + + @Test + public void createSessionTest() throws Exception { + Session expectedResponse = + Session.newBuilder().setName(SessionName.of("[SESSION]").toString()).build(); + mockService.addResponse(expectedResponse); + + CreateSessionRequest request = + CreateSessionRequest.newBuilder().setSession(Session.newBuilder().build()).build(); + + Session actualResponse = client.createSession(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void createSessionExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + CreateSessionRequest request = + CreateSessionRequest.newBuilder().setSession(Session.newBuilder().build()).build(); + client.createSession(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getSessionTest() throws Exception { + Session expectedResponse = + Session.newBuilder().setName(SessionName.of("[SESSION]").toString()).build(); + mockService.addResponse(expectedResponse); + + GetSessionRequest request = + GetSessionRequest.newBuilder().setName(SessionName.of("[SESSION]").toString()).build(); + + Session actualResponse = client.getSession(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void getSessionExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + GetSessionRequest request = + GetSessionRequest.newBuilder().setName(SessionName.of("[SESSION]").toString()).build(); + client.getSession(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listSessionsTest() throws Exception { + Session responsesElement = Session.newBuilder().build(); + ListSessionsResponse expectedResponse = + ListSessionsResponse.newBuilder() + .setNextPageToken("") + .addAllSessions(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + ListSessionsRequest request = + ListSessionsRequest.newBuilder() + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + + ListSessionsPagedResponse pagedListResponse = client.listSessions(request); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getSessionsList().get(0), resources.get(0)); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void listSessionsExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ListSessionsRequest request = + ListSessionsRequest.newBuilder() + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + client.listSessions(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void deleteSessionTest() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockService.addResponse(expectedResponse); + + DeleteSessionRequest request = + DeleteSessionRequest.newBuilder().setName(SessionName.of("[SESSION]").toString()).build(); + + client.deleteSession(request); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void deleteSessionExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + DeleteSessionRequest request = + DeleteSessionRequest.newBuilder().setName(SessionName.of("[SESSION]").toString()).build(); + client.deleteSession(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void reportSessionTest() throws Exception { + ReportSessionResponse expectedResponse = + ReportSessionResponse.newBuilder().addAllTestRuns(new ArrayList()).build(); + mockService.addResponse(expectedResponse); + + ReportSessionRequest request = + ReportSessionRequest.newBuilder().setName(SessionName.of("[SESSION]").toString()).build(); + + ReportSessionResponse actualResponse = client.reportSession(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void reportSessionExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ReportSessionRequest request = + ReportSessionRequest.newBuilder().setName(SessionName.of("[SESSION]").toString()).build(); + client.reportSession(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listTestsTest() throws Exception { + com.google.showcase.v1beta1.Test responsesElement = + com.google.showcase.v1beta1.Test.newBuilder().build(); + ListTestsResponse expectedResponse = + ListTestsResponse.newBuilder() + .setNextPageToken("") + .addAllTests(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + ListTestsRequest request = + ListTestsRequest.newBuilder() + .setParent(SessionName.of("[SESSION]").toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + + ListTestsPagedResponse pagedListResponse = client.listTests(request); + + List resources = + Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getTestsList().get(0), resources.get(0)); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void listTestsExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ListTestsRequest request = + ListTestsRequest.newBuilder() + .setParent(SessionName.of("[SESSION]").toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + client.listTests(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void deleteTestTest() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockService.addResponse(expectedResponse); + + DeleteTestRequest request = + DeleteTestRequest.newBuilder() + .setName(TestName.of("[SESSION]", "[TEST]").toString()) + .build(); + + client.deleteTest(request); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void deleteTestExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + DeleteTestRequest request = + DeleteTestRequest.newBuilder() + .setName(TestName.of("[SESSION]", "[TEST]").toString()) + .build(); + client.deleteTest(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void verifyTestTest() throws Exception { + VerifyTestResponse expectedResponse = + VerifyTestResponse.newBuilder().setIssue(Issue.newBuilder().build()).build(); + mockService.addResponse(expectedResponse); + + VerifyTestRequest request = + VerifyTestRequest.newBuilder() + .setName(TestName.of("[SESSION]", "[TEST]").toString()) + .setAnswer(ByteString.EMPTY) + .addAllAnswers(new ArrayList()) + .build(); + + VerifyTestResponse actualResponse = client.verifyTest(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void verifyTestExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + VerifyTestRequest request = + VerifyTestRequest.newBuilder() + .setName(TestName.of("[SESSION]", "[TEST]").toString()) + .setAnswer(ByteString.EMPTY) + .addAllAnswers(new ArrayList()) + .build(); + client.verifyTest(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listLocationsTest() throws Exception { + Location responsesElement = Location.newBuilder().build(); + ListLocationsResponse expectedResponse = + ListLocationsResponse.newBuilder() + .setNextPageToken("") + .addAllLocations(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + ListLocationsRequest request = + ListLocationsRequest.newBuilder() + .setName("projects/project-3664") + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + + ListLocationsPagedResponse pagedListResponse = client.listLocations(request); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getLocationsList().get(0), resources.get(0)); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void listLocationsExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ListLocationsRequest request = + ListLocationsRequest.newBuilder() + .setName("projects/project-3664") + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + client.listLocations(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getLocationTest() throws Exception { + Location expectedResponse = + Location.newBuilder() + .setName("name3373707") + .setLocationId("locationId1541836720") + .setDisplayName("displayName1714148973") + .putAllLabels(new HashMap()) + .setMetadata(Any.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + GetLocationRequest request = + GetLocationRequest.newBuilder() + .setName("projects/project-9062/locations/location-9062") + .build(); + + Location actualResponse = client.getLocation(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void getLocationExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + GetLocationRequest request = + GetLocationRequest.newBuilder() + .setName("projects/project-9062/locations/location-9062") + .build(); + client.getLocation(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void setIamPolicyTest() throws Exception { + Policy expectedResponse = + Policy.newBuilder() + .setVersion(351608024) + .addAllBindings(new ArrayList()) + .addAllAuditConfigs(new ArrayList()) + .setEtag(ByteString.EMPTY) + .build(); + mockService.addResponse(expectedResponse); + + SetIamPolicyRequest request = + SetIamPolicyRequest.newBuilder() + .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString()) + .setPolicy(Policy.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .build(); + + Policy actualResponse = client.setIamPolicy(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void setIamPolicyExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + SetIamPolicyRequest request = + SetIamPolicyRequest.newBuilder() + .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString()) + .setPolicy(Policy.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .build(); + client.setIamPolicy(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getIamPolicyTest() throws Exception { + Policy expectedResponse = + Policy.newBuilder() + .setVersion(351608024) + .addAllBindings(new ArrayList()) + .addAllAuditConfigs(new ArrayList()) + .setEtag(ByteString.EMPTY) + .build(); + mockService.addResponse(expectedResponse); + + GetIamPolicyRequest request = + GetIamPolicyRequest.newBuilder() + .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString()) + .setOptions(GetPolicyOptions.newBuilder().build()) + .build(); + + Policy actualResponse = client.getIamPolicy(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void getIamPolicyExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + GetIamPolicyRequest request = + GetIamPolicyRequest.newBuilder() + .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString()) + .setOptions(GetPolicyOptions.newBuilder().build()) + .build(); + client.getIamPolicy(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void testIamPermissionsTest() throws Exception { + TestIamPermissionsResponse expectedResponse = + TestIamPermissionsResponse.newBuilder().addAllPermissions(new ArrayList()).build(); + mockService.addResponse(expectedResponse); + + TestIamPermissionsRequest request = + TestIamPermissionsRequest.newBuilder() + .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString()) + .addAllPermissions(new ArrayList()) + .build(); + + TestIamPermissionsResponse actualResponse = client.testIamPermissions(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void testIamPermissionsExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + TestIamPermissionsRequest request = + TestIamPermissionsRequest.newBuilder() + .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString()) + .addAllPermissions(new ArrayList()) + .build(); + client.testIamPermissions(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } +} diff --git a/java-showcase-3.21.0/gapic-showcase/src/test/java/com/google/showcase/v1beta1/TestingClientTest.java b/java-showcase-3.21.0/gapic-showcase/src/test/java/com/google/showcase/v1beta1/TestingClientTest.java new file mode 100644 index 0000000000..1d6280165d --- /dev/null +++ b/java-showcase-3.21.0/gapic-showcase/src/test/java/com/google/showcase/v1beta1/TestingClientTest.java @@ -0,0 +1,703 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1; + +import static com.google.showcase.v1beta1.TestingClient.ListLocationsPagedResponse; +import static com.google.showcase.v1beta1.TestingClient.ListSessionsPagedResponse; +import static com.google.showcase.v1beta1.TestingClient.ListTestsPagedResponse; + +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.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.common.collect.Lists; +import com.google.iam.v1.AuditConfig; +import com.google.iam.v1.Binding; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.GetPolicyOptions; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.protobuf.AbstractMessage; +import com.google.protobuf.Any; +import com.google.protobuf.ByteString; +import com.google.protobuf.Empty; +import com.google.protobuf.FieldMask; +import io.grpc.StatusRuntimeException; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.UUID; +import javax.annotation.Generated; +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Assert; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; + +@Generated("by gapic-generator-java") +public class TestingClientTest { + private static MockIAMPolicy mockIAMPolicy; + private static MockLocations mockLocations; + private static MockServiceHelper mockServiceHelper; + private static MockTesting mockTesting; + private LocalChannelProvider channelProvider; + private TestingClient client; + + @BeforeClass + public static void startStaticServer() { + mockTesting = new MockTesting(); + mockLocations = new MockLocations(); + mockIAMPolicy = new MockIAMPolicy(); + mockServiceHelper = + new MockServiceHelper( + UUID.randomUUID().toString(), + Arrays.asList(mockTesting, mockLocations, mockIAMPolicy)); + mockServiceHelper.start(); + } + + @AfterClass + public static void stopServer() { + mockServiceHelper.stop(); + } + + @Before + public void setUp() throws IOException { + mockServiceHelper.reset(); + channelProvider = mockServiceHelper.createChannelProvider(); + TestingSettings settings = + TestingSettings.newBuilder() + .setTransportChannelProvider(channelProvider) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = TestingClient.create(settings); + } + + @After + public void tearDown() throws Exception { + client.close(); + } + + @Test + public void createSessionTest() throws Exception { + Session expectedResponse = + Session.newBuilder().setName(SessionName.of("[SESSION]").toString()).build(); + mockTesting.addResponse(expectedResponse); + + CreateSessionRequest request = + CreateSessionRequest.newBuilder().setSession(Session.newBuilder().build()).build(); + + Session actualResponse = client.createSession(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockTesting.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateSessionRequest actualRequest = ((CreateSessionRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getSession(), actualRequest.getSession()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void createSessionExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockTesting.addException(exception); + + try { + CreateSessionRequest request = + CreateSessionRequest.newBuilder().setSession(Session.newBuilder().build()).build(); + client.createSession(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getSessionTest() throws Exception { + Session expectedResponse = + Session.newBuilder().setName(SessionName.of("[SESSION]").toString()).build(); + mockTesting.addResponse(expectedResponse); + + GetSessionRequest request = + GetSessionRequest.newBuilder().setName(SessionName.of("[SESSION]").toString()).build(); + + Session actualResponse = client.getSession(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockTesting.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetSessionRequest actualRequest = ((GetSessionRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getName(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getSessionExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockTesting.addException(exception); + + try { + GetSessionRequest request = + GetSessionRequest.newBuilder().setName(SessionName.of("[SESSION]").toString()).build(); + client.getSession(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listSessionsTest() throws Exception { + Session responsesElement = Session.newBuilder().build(); + ListSessionsResponse expectedResponse = + ListSessionsResponse.newBuilder() + .setNextPageToken("") + .addAllSessions(Arrays.asList(responsesElement)) + .build(); + mockTesting.addResponse(expectedResponse); + + ListSessionsRequest request = + ListSessionsRequest.newBuilder() + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + + ListSessionsPagedResponse pagedListResponse = client.listSessions(request); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getSessionsList().get(0), resources.get(0)); + + List actualRequests = mockTesting.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListSessionsRequest actualRequest = ((ListSessionsRequest) 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 listSessionsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockTesting.addException(exception); + + try { + ListSessionsRequest request = + ListSessionsRequest.newBuilder() + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + client.listSessions(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void deleteSessionTest() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockTesting.addResponse(expectedResponse); + + DeleteSessionRequest request = + DeleteSessionRequest.newBuilder().setName(SessionName.of("[SESSION]").toString()).build(); + + client.deleteSession(request); + + List actualRequests = mockTesting.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeleteSessionRequest actualRequest = ((DeleteSessionRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getName(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void deleteSessionExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockTesting.addException(exception); + + try { + DeleteSessionRequest request = + DeleteSessionRequest.newBuilder().setName(SessionName.of("[SESSION]").toString()).build(); + client.deleteSession(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void reportSessionTest() throws Exception { + ReportSessionResponse expectedResponse = + ReportSessionResponse.newBuilder().addAllTestRuns(new ArrayList()).build(); + mockTesting.addResponse(expectedResponse); + + ReportSessionRequest request = + ReportSessionRequest.newBuilder().setName(SessionName.of("[SESSION]").toString()).build(); + + ReportSessionResponse actualResponse = client.reportSession(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockTesting.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ReportSessionRequest actualRequest = ((ReportSessionRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getName(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void reportSessionExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockTesting.addException(exception); + + try { + ReportSessionRequest request = + ReportSessionRequest.newBuilder().setName(SessionName.of("[SESSION]").toString()).build(); + client.reportSession(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listTestsTest() throws Exception { + com.google.showcase.v1beta1.Test responsesElement = + com.google.showcase.v1beta1.Test.newBuilder().build(); + ListTestsResponse expectedResponse = + ListTestsResponse.newBuilder() + .setNextPageToken("") + .addAllTests(Arrays.asList(responsesElement)) + .build(); + mockTesting.addResponse(expectedResponse); + + ListTestsRequest request = + ListTestsRequest.newBuilder() + .setParent(SessionName.of("[SESSION]").toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + + ListTestsPagedResponse pagedListResponse = client.listTests(request); + + List resources = + Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getTestsList().get(0), resources.get(0)); + + List actualRequests = mockTesting.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListTestsRequest actualRequest = ((ListTestsRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getParent(), actualRequest.getParent()); + Assert.assertEquals(request.getPageSize(), actualRequest.getPageSize()); + Assert.assertEquals(request.getPageToken(), actualRequest.getPageToken()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listTestsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockTesting.addException(exception); + + try { + ListTestsRequest request = + ListTestsRequest.newBuilder() + .setParent(SessionName.of("[SESSION]").toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + client.listTests(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void deleteTestTest() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockTesting.addResponse(expectedResponse); + + DeleteTestRequest request = + DeleteTestRequest.newBuilder() + .setName(TestName.of("[SESSION]", "[TEST]").toString()) + .build(); + + client.deleteTest(request); + + List actualRequests = mockTesting.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeleteTestRequest actualRequest = ((DeleteTestRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getName(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void deleteTestExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockTesting.addException(exception); + + try { + DeleteTestRequest request = + DeleteTestRequest.newBuilder() + .setName(TestName.of("[SESSION]", "[TEST]").toString()) + .build(); + client.deleteTest(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void verifyTestTest() throws Exception { + VerifyTestResponse expectedResponse = + VerifyTestResponse.newBuilder().setIssue(Issue.newBuilder().build()).build(); + mockTesting.addResponse(expectedResponse); + + VerifyTestRequest request = + VerifyTestRequest.newBuilder() + .setName(TestName.of("[SESSION]", "[TEST]").toString()) + .setAnswer(ByteString.EMPTY) + .addAllAnswers(new ArrayList()) + .build(); + + VerifyTestResponse actualResponse = client.verifyTest(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockTesting.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + VerifyTestRequest actualRequest = ((VerifyTestRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getName(), actualRequest.getName()); + Assert.assertEquals(request.getAnswer(), actualRequest.getAnswer()); + Assert.assertEquals(request.getAnswersList(), actualRequest.getAnswersList()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void verifyTestExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockTesting.addException(exception); + + try { + VerifyTestRequest request = + VerifyTestRequest.newBuilder() + .setName(TestName.of("[SESSION]", "[TEST]").toString()) + .setAnswer(ByteString.EMPTY) + .addAllAnswers(new ArrayList()) + .build(); + client.verifyTest(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listLocationsTest() throws Exception { + Location responsesElement = Location.newBuilder().build(); + ListLocationsResponse expectedResponse = + ListLocationsResponse.newBuilder() + .setNextPageToken("") + .addAllLocations(Arrays.asList(responsesElement)) + .build(); + mockLocations.addResponse(expectedResponse); + + ListLocationsRequest request = + ListLocationsRequest.newBuilder() + .setName("name3373707") + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + + ListLocationsPagedResponse pagedListResponse = client.listLocations(request); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getLocationsList().get(0), resources.get(0)); + + List actualRequests = mockLocations.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListLocationsRequest actualRequest = ((ListLocationsRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getName(), actualRequest.getName()); + Assert.assertEquals(request.getFilter(), actualRequest.getFilter()); + Assert.assertEquals(request.getPageSize(), actualRequest.getPageSize()); + Assert.assertEquals(request.getPageToken(), actualRequest.getPageToken()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listLocationsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockLocations.addException(exception); + + try { + ListLocationsRequest request = + ListLocationsRequest.newBuilder() + .setName("name3373707") + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + client.listLocations(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getLocationTest() throws Exception { + Location expectedResponse = + Location.newBuilder() + .setName("name3373707") + .setLocationId("locationId1541836720") + .setDisplayName("displayName1714148973") + .putAllLabels(new HashMap()) + .setMetadata(Any.newBuilder().build()) + .build(); + mockLocations.addResponse(expectedResponse); + + GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build(); + + Location actualResponse = client.getLocation(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockLocations.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetLocationRequest actualRequest = ((GetLocationRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getName(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getLocationExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockLocations.addException(exception); + + try { + GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build(); + client.getLocation(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void setIamPolicyTest() throws Exception { + Policy expectedResponse = + Policy.newBuilder() + .setVersion(351608024) + .addAllBindings(new ArrayList()) + .addAllAuditConfigs(new ArrayList()) + .setEtag(ByteString.EMPTY) + .build(); + mockIAMPolicy.addResponse(expectedResponse); + + SetIamPolicyRequest request = + SetIamPolicyRequest.newBuilder() + .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString()) + .setPolicy(Policy.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .build(); + + Policy actualResponse = client.setIamPolicy(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockIAMPolicy.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + SetIamPolicyRequest actualRequest = ((SetIamPolicyRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getResource(), actualRequest.getResource()); + Assert.assertEquals(request.getPolicy(), actualRequest.getPolicy()); + Assert.assertEquals(request.getUpdateMask(), actualRequest.getUpdateMask()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void setIamPolicyExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockIAMPolicy.addException(exception); + + try { + SetIamPolicyRequest request = + SetIamPolicyRequest.newBuilder() + .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString()) + .setPolicy(Policy.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .build(); + client.setIamPolicy(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getIamPolicyTest() throws Exception { + Policy expectedResponse = + Policy.newBuilder() + .setVersion(351608024) + .addAllBindings(new ArrayList()) + .addAllAuditConfigs(new ArrayList()) + .setEtag(ByteString.EMPTY) + .build(); + mockIAMPolicy.addResponse(expectedResponse); + + GetIamPolicyRequest request = + GetIamPolicyRequest.newBuilder() + .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString()) + .setOptions(GetPolicyOptions.newBuilder().build()) + .build(); + + Policy actualResponse = client.getIamPolicy(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockIAMPolicy.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetIamPolicyRequest actualRequest = ((GetIamPolicyRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getResource(), actualRequest.getResource()); + Assert.assertEquals(request.getOptions(), actualRequest.getOptions()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getIamPolicyExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockIAMPolicy.addException(exception); + + try { + GetIamPolicyRequest request = + GetIamPolicyRequest.newBuilder() + .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString()) + .setOptions(GetPolicyOptions.newBuilder().build()) + .build(); + client.getIamPolicy(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void testIamPermissionsTest() throws Exception { + TestIamPermissionsResponse expectedResponse = + TestIamPermissionsResponse.newBuilder().addAllPermissions(new ArrayList()).build(); + mockIAMPolicy.addResponse(expectedResponse); + + TestIamPermissionsRequest request = + TestIamPermissionsRequest.newBuilder() + .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString()) + .addAllPermissions(new ArrayList()) + .build(); + + TestIamPermissionsResponse actualResponse = client.testIamPermissions(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockIAMPolicy.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + TestIamPermissionsRequest actualRequest = ((TestIamPermissionsRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getResource(), actualRequest.getResource()); + Assert.assertEquals(request.getPermissionsList(), actualRequest.getPermissionsList()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void testIamPermissionsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockIAMPolicy.addException(exception); + + try { + TestIamPermissionsRequest request = + TestIamPermissionsRequest.newBuilder() + .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString()) + .addAllPermissions(new ArrayList()) + .build(); + client.testIamPermissions(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } +} diff --git a/java-showcase-3.21.0/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/ITApiKeyCredentials.java b/java-showcase-3.21.0/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/ITApiKeyCredentials.java new file mode 100644 index 0000000000..5867bcfea9 --- /dev/null +++ b/java-showcase-3.21.0/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/ITApiKeyCredentials.java @@ -0,0 +1,219 @@ +/* + * 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 + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.it; + +import static com.google.common.truth.Truth.assertThat; + +import com.google.api.client.http.javanet.NetHttpTransport; +import com.google.api.gax.rpc.FixedHeaderProvider; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.auth.http.AuthHttpConstants; +import com.google.common.collect.ImmutableList; +import com.google.showcase.v1beta1.EchoClient; +import com.google.showcase.v1beta1.EchoRequest; +import com.google.showcase.v1beta1.EchoSettings; +import com.google.showcase.v1beta1.it.util.GrpcCapturingClientInterceptor; +import com.google.showcase.v1beta1.it.util.HttpJsonCapturingClientInterceptor; +import com.google.showcase.v1beta1.it.util.TestClientInitializer; +import io.grpc.ManagedChannelBuilder; +import io.grpc.Metadata; +import java.io.IOException; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.concurrent.TimeUnit; +import java.util.stream.Collectors; +import java.util.stream.StreamSupport; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; + +/** + * Test suite to confirm a client can be instantiated with API key credentials and correct + * authorization sent via headers to back end + */ +class ITApiKeyCredentials { + + private static final String API_KEY = "fake_api_key"; + private static final String API_KEY_AUTH_HEADER = "x-goog-api-key"; + private static final String HTTP_RESPONSE_HEADER_STRING = + "x-showcase-request-" + API_KEY_AUTH_HEADER; + private static final String GRPC_ENDPOINT = "localhost:7469"; + private static final String HTTP_ENDPOINT = "http://localhost:7469"; + + private static HttpJsonCapturingClientInterceptor httpJsonInterceptor; + private static EchoClient grpcClient; + private static EchoClient httpJsonClient; + private static GrpcCapturingClientInterceptor grpcInterceptor; + + @BeforeEach + void setup() throws IOException { + grpcInterceptor = new GrpcCapturingClientInterceptor(); + httpJsonInterceptor = new HttpJsonCapturingClientInterceptor(); + } + + @AfterEach + void tearDown() throws InterruptedException { + if (httpJsonClient != null) { + httpJsonClient.close(); + httpJsonClient.awaitTermination( + TestClientInitializer.AWAIT_TERMINATION_SECONDS, TimeUnit.SECONDS); + } + if (grpcClient != null) { + grpcClient.close(); + grpcClient.awaitTermination( + TestClientInitializer.AWAIT_TERMINATION_SECONDS, TimeUnit.SECONDS); + } + } + + @Test + void testCreateGrpcClient_withApiKey_sendsApiHeaderToServer() throws IOException { + Metadata.Key apiKeyAuthHeader = + Metadata.Key.of(API_KEY_AUTH_HEADER, Metadata.ASCII_STRING_MARSHALLER); + Metadata.Key defaultAuthorizationHeader = + Metadata.Key.of(AuthHttpConstants.AUTHORIZATION, Metadata.ASCII_STRING_MARSHALLER); + EchoSettings.Builder echoBuilder = + EchoSettings.newBuilder() + .setApiKey(API_KEY) + .setEndpoint(GRPC_ENDPOINT) + .setTransportChannelProvider( + EchoSettings.defaultGrpcTransportProviderBuilder() + .setChannelConfigurator(ManagedChannelBuilder::usePlaintext) + .setInterceptorProvider(() -> ImmutableList.of(grpcInterceptor)) + .build()); + EchoSettings settings = echoBuilder.build(); + grpcClient = EchoClient.create(settings); + + grpcClient.echo(EchoRequest.newBuilder().build()); + + assertThat(echoBuilder.getApiKey()).isEqualTo(API_KEY); + assertThat(settings.getApiKey()).isEqualTo(API_KEY); + String headerValue = grpcInterceptor.metadata.get(apiKeyAuthHeader); + assertThat(headerValue).isEqualTo(API_KEY); + String defaultAuthorizationHeaderValue = + grpcInterceptor.metadata.get(defaultAuthorizationHeader); + assertThat(defaultAuthorizationHeaderValue).isNull(); + } + + @Test + void testCreateGrpcClient_withApiKeySetViaSetterAndHeader_dedupsHeader() throws IOException { + String apiHeaderKey = "fake_api_key_2"; + Metadata.Key apiKeyAuthHeader = + Metadata.Key.of(API_KEY_AUTH_HEADER, Metadata.ASCII_STRING_MARSHALLER); + Metadata.Key defaultAuthorizationHeader = + Metadata.Key.of(AuthHttpConstants.AUTHORIZATION, Metadata.ASCII_STRING_MARSHALLER); + Map header = + new HashMap() { + { + put(API_KEY_AUTH_HEADER, apiHeaderKey); + } + }; + FixedHeaderProvider headerProvider = FixedHeaderProvider.create(header); + + TransportChannelProvider transportChannelProvider = + EchoSettings.defaultGrpcTransportProviderBuilder() + .setHeaderProvider(headerProvider) + .setChannelConfigurator(ManagedChannelBuilder::usePlaintext) + .setInterceptorProvider(() -> ImmutableList.of(grpcInterceptor)) + .build(); + EchoSettings settings = + EchoSettings.newBuilder() + .setApiKey(API_KEY) + .setEndpoint(GRPC_ENDPOINT) + .setTransportChannelProvider(transportChannelProvider) + .build(); + grpcClient = EchoClient.create(settings); + + grpcClient.echo(EchoRequest.newBuilder().build()); + + Iterable matchingHeaders = grpcInterceptor.metadata.getAll(apiKeyAuthHeader); + List matchingHeadersList = + StreamSupport.stream(matchingHeaders.spliterator(), false).collect(Collectors.toList()); + + String headerValue = matchingHeadersList.get(0); + assertThat(headerValue).isEqualTo(API_KEY); + assertThat(matchingHeadersList.size()).isEqualTo(1); + } + + @Test + void testCreateHttpClient_withApiKey_sendsApiHeaderToServer() throws Exception { + EchoSettings httpJsonEchoSettings = + EchoSettings.newHttpJsonBuilder() + .setApiKey(API_KEY) + .setTransportChannelProvider( + EchoSettings.defaultHttpJsonTransportProviderBuilder() + .setHttpTransport( + new NetHttpTransport.Builder().doNotValidateCertificate().build()) + .setEndpoint(HTTP_ENDPOINT) + .setInterceptorProvider(() -> ImmutableList.of(httpJsonInterceptor)) + .build()) + .build(); + httpJsonClient = EchoClient.create(httpJsonEchoSettings); + + httpJsonClient.echo(EchoRequest.newBuilder().build()); + + ArrayList headerValues = + (ArrayList) + httpJsonInterceptor.metadata.getHeaders().get(HTTP_RESPONSE_HEADER_STRING); + String headerValue = headerValues.get(0); + assertThat(headerValue).isEqualTo(API_KEY); + } + + @Test + void testCreateHttpClient_withApiKeySetViaSetterAndHeader_dedupsHeader() throws Exception { + String apiHeaderKey = "fake_api_key_2"; + Metadata.Key apiKeyAuthHeader = + Metadata.Key.of(API_KEY_AUTH_HEADER, Metadata.ASCII_STRING_MARSHALLER); + Metadata.Key defaultAuthorizationHeader = + Metadata.Key.of(AuthHttpConstants.AUTHORIZATION, Metadata.ASCII_STRING_MARSHALLER); + Map header = + new HashMap() { + { + put(API_KEY_AUTH_HEADER, apiHeaderKey); + } + }; + FixedHeaderProvider headerProvider = FixedHeaderProvider.create(header); + + TransportChannelProvider transportChannelProvider = + EchoSettings.defaultHttpJsonTransportProviderBuilder() + .setHeaderProvider(headerProvider) + .setInterceptorProvider(() -> ImmutableList.of(httpJsonInterceptor)) + .build(); + EchoSettings httpJsonEchoSettings = + EchoSettings.newHttpJsonBuilder() + .setApiKey(API_KEY) + .setTransportChannelProvider( + EchoSettings.defaultHttpJsonTransportProviderBuilder() + .setHttpTransport( + new NetHttpTransport.Builder().doNotValidateCertificate().build()) + .setEndpoint(HTTP_ENDPOINT) + .setInterceptorProvider(() -> ImmutableList.of(httpJsonInterceptor)) + .build()) + .build(); + httpJsonClient = EchoClient.create(httpJsonEchoSettings); + + httpJsonClient.echo(EchoRequest.newBuilder().build()); + + ArrayList headerValues = + (ArrayList) + httpJsonInterceptor.metadata.getHeaders().get(HTTP_RESPONSE_HEADER_STRING); + String headerValue = headerValues.get(0); + assertThat(headerValue).isEqualTo(API_KEY); + assertThat(headerValues.size()).isEqualTo(1); + } +} diff --git a/java-showcase-3.21.0/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/ITAutoPopulatedFields.java b/java-showcase-3.21.0/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/ITAutoPopulatedFields.java new file mode 100644 index 0000000000..f73b6b3c7d --- /dev/null +++ b/java-showcase-3.21.0/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/ITAutoPopulatedFields.java @@ -0,0 +1,379 @@ +/* + * 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 + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.showcase.v1beta1.it; + +import static org.junit.jupiter.api.Assertions.assertThrows; + +import com.google.api.gax.httpjson.ApiMethodDescriptor; +import com.google.api.gax.httpjson.ForwardingHttpJsonClientCall; +import com.google.api.gax.httpjson.HttpJsonCallOptions; +import com.google.api.gax.httpjson.HttpJsonChannel; +import com.google.api.gax.httpjson.HttpJsonClientCall; +import com.google.api.gax.httpjson.HttpJsonClientInterceptor; +import com.google.api.gax.retrying.RetrySettings; +import com.google.api.gax.retrying.RetryingFuture; +import com.google.api.gax.rpc.StatusCode.Code; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableSet; +import com.google.common.truth.Truth; +import com.google.rpc.Status; +import com.google.showcase.v1beta1.EchoClient; +import com.google.showcase.v1beta1.EchoRequest; +import com.google.showcase.v1beta1.EchoResponse; +import com.google.showcase.v1beta1.it.util.TestClientInitializer; +import io.grpc.CallOptions; +import io.grpc.Channel; +import io.grpc.ClientCall; +import io.grpc.ClientInterceptor; +import io.grpc.ForwardingClientCall; +import io.grpc.MethodDescriptor; +import java.util.ArrayList; +import java.util.List; +import java.util.Set; +import java.util.UUID; +import java.util.concurrent.ExecutionException; +import java.util.concurrent.TimeUnit; +import java.util.function.Consumer; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.threeten.bp.Duration; + +class ITAutoPopulatedFields { + + private static class HttpJsonInterceptor implements HttpJsonClientInterceptor { + private Consumer onRequestIntercepted; + + private HttpJsonInterceptor() {} + + private void setOnRequestIntercepted(Consumer onRequestIntercepted) { + this.onRequestIntercepted = onRequestIntercepted; + } + + @Override + public HttpJsonClientCall interceptCall( + ApiMethodDescriptor method, + HttpJsonCallOptions callOptions, + HttpJsonChannel next) { + HttpJsonClientCall call = next.newCall(method, callOptions); + + return new ForwardingHttpJsonClientCall.SimpleForwardingHttpJsonClientCall( + call) { + @Override + public void sendMessage(ReqT message) { + // Capture the request message + if (onRequestIntercepted != null) { + onRequestIntercepted.accept(message); + } + super.sendMessage(message); + } + }; + } + } + + // Implement a request interceptor to retrieve the request ID being sent on the request. + private static class GRPCInterceptor implements ClientInterceptor { + private Consumer onRequestIntercepted; + + private GRPCInterceptor() {} + + private void setOnRequestIntercepted(Consumer onRequestIntercepted) { + this.onRequestIntercepted = onRequestIntercepted; + } + + @Override + public ClientCall interceptCall( + MethodDescriptor method, CallOptions callOptions, Channel next) { + + return new ForwardingClientCall.SimpleForwardingClientCall( + next.newCall(method, callOptions)) { + @Override + public void sendMessage(ReqT message) { + // Capture the request message + if (onRequestIntercepted != null) { + onRequestIntercepted.accept(message); + } + super.sendMessage(message); + } + }; + } + } + + private GRPCInterceptor grpcRequestInterceptor; + private HttpJsonInterceptor httpJsonInterceptor; + private EchoClient grpcClientWithoutRetries; + private EchoClient grpcClientWithRetries; + + private EchoClient httpJsonClient; + private EchoClient httpJsonClientWithRetries; + + @BeforeEach + void createClients() throws Exception { + RetrySettings defaultRetrySettings = + RetrySettings.newBuilder() + .setInitialRpcTimeout(Duration.ofMillis(5000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ofMillis(5000L)) + .setTotalTimeout(Duration.ofMillis(5000L)) + // Cap retries at 5 + .setMaxAttempts(5) + .build(); + + // Adding `Code.INTERNAL` is necessary because for httpJson requests, the httpJson status code + // is mapped here: + // https://github.com/googleapis/sdk-platform-java/blob/acdde47445916dd306ce8b91489fab45c9c2ef50/gax-java/gax-httpjson/src/main/java/com/google/api/gax/httpjson/HttpJsonStatusCode.java#L96-L133 + // Therefore, just setting the error code to `Code.UNKNOWN` for httpJson will get translated + // instead to `Code.INTERNAL`. + Set retryableCodes = ImmutableSet.of(Code.UNKNOWN, Code.INTERNAL); + + // Create gRPC Interceptor and Client + grpcRequestInterceptor = new ITAutoPopulatedFields.GRPCInterceptor(); + grpcClientWithoutRetries = + TestClientInitializer.createGrpcEchoClient(ImmutableList.of(grpcRequestInterceptor)); + grpcClientWithRetries = + TestClientInitializer.createGrpcEchoClientWithRetrySettings( + defaultRetrySettings, retryableCodes, ImmutableList.of(grpcRequestInterceptor)); + + // Create HttpJson Interceptor and Client + httpJsonInterceptor = new ITAutoPopulatedFields.HttpJsonInterceptor(); + httpJsonClient = + TestClientInitializer.createHttpJsonEchoClient(ImmutableList.of(httpJsonInterceptor)); + httpJsonClientWithRetries = + TestClientInitializer.createHttpJsonEchoClientWithRetrySettings( + defaultRetrySettings, retryableCodes, ImmutableList.of(httpJsonInterceptor)); + } + + @AfterEach + void destroyClient() throws InterruptedException { + grpcClientWithoutRetries.close(); + grpcClientWithRetries.close(); + httpJsonClient.close(); + + grpcClientWithoutRetries.awaitTermination( + TestClientInitializer.AWAIT_TERMINATION_SECONDS, TimeUnit.SECONDS); + grpcClientWithRetries.awaitTermination( + TestClientInitializer.AWAIT_TERMINATION_SECONDS, TimeUnit.SECONDS); + httpJsonClient.awaitTermination( + TestClientInitializer.AWAIT_TERMINATION_SECONDS, TimeUnit.SECONDS); + } + + @Test + void testGrpc_autoPopulateRequestIdWhenAttemptedOnceSuccessfully() { + List capturedRequestIds = new ArrayList<>(); + grpcRequestInterceptor.setOnRequestIntercepted( + request -> { + if (request instanceof EchoRequest) { + EchoRequest echoRequest = (EchoRequest) request; + capturedRequestIds.add(echoRequest.getRequestId()); + } + }); + grpcClientWithoutRetries.echo(EchoRequest.newBuilder().build()); + Truth.assertThat(capturedRequestIds).isNotEmpty(); + // Autopopulation of UUID is currently only configured for format UUID4. + Integer UUIDVersion = 4; + Truth.assertThat(UUID.fromString(capturedRequestIds.get(0)).version()).isEqualTo(UUIDVersion); + } + + @Test + void testGrpc_shouldNotAutoPopulateRequestIdIfSetInRequest() { + List capturedRequestIds = new ArrayList<>(); + grpcRequestInterceptor.setOnRequestIntercepted( + request -> { + if (request instanceof EchoRequest) { + EchoRequest echoRequest = (EchoRequest) request; + capturedRequestIds.add(echoRequest.getRequestId()); + } + }); + String UUIDsent = UUID.randomUUID().toString(); + grpcClientWithoutRetries.echo(EchoRequest.newBuilder().setRequestId(UUIDsent).build()); + Truth.assertThat(capturedRequestIds).isNotEmpty(); + Truth.assertThat(capturedRequestIds).contains(UUIDsent); + } + + @Test + void testHttpJson_autoPopulateRequestIdWhenAttemptedOnceSuccessfully() { + List capturedRequestIds = new ArrayList<>(); + httpJsonInterceptor.setOnRequestIntercepted( + request -> { + if (request instanceof EchoRequest) { + EchoRequest echoRequest = (EchoRequest) request; + capturedRequestIds.add(echoRequest.getRequestId()); + } + }); + httpJsonClient.echo(EchoRequest.newBuilder().build()); + Truth.assertThat(capturedRequestIds).isNotEmpty(); + // Autopopulation of UUID is currently only configured for format UUID4. + Integer UUIDVersion = 4; + Truth.assertThat(UUID.fromString(capturedRequestIds.get(0)).version()).isEqualTo(UUIDVersion); + } + + @Test + void testHttpJson_shouldNotAutoPopulateRequestIdIfSetInRequest() { + String UUIDsent = UUID.randomUUID().toString(); + List capturedRequestIds = new ArrayList<>(); + httpJsonInterceptor.setOnRequestIntercepted( + request -> { + if (request instanceof EchoRequest) { + EchoRequest echoRequest = (EchoRequest) request; + capturedRequestIds.add(echoRequest.getRequestId()); + } + }); + httpJsonClient.echo(EchoRequest.newBuilder().setRequestId(UUIDsent).build()); + Truth.assertThat(capturedRequestIds).isNotEmpty(); + Truth.assertThat(capturedRequestIds).contains(UUIDsent); + } + + @Test + void testGRPC_setsSameRequestIdIfSetInRequestWhenRequestsAreRetried() throws Exception { + List capturedRequestIds = new ArrayList<>(); + grpcRequestInterceptor.setOnRequestIntercepted( + request -> { + if (request instanceof EchoRequest) { + EchoRequest echoRequest = (EchoRequest) request; + capturedRequestIds.add(echoRequest.getRequestId()); + } + }); + String UUIDsent = UUID.randomUUID().toString(); + EchoRequest requestSent = + EchoRequest.newBuilder() + .setRequestId(UUIDsent) + .setError(Status.newBuilder().setCode(Code.UNKNOWN.ordinal()).build()) + .build(); + + try { + RetryingFuture retryingFuture = + (RetryingFuture) + grpcClientWithRetries.echoCallable().futureCall(requestSent); + assertThrows(ExecutionException.class, () -> retryingFuture.get(10, TimeUnit.SECONDS)); + // assert that the number of request IDs is equal to the max attempt + Truth.assertThat(capturedRequestIds).hasSize(5); + // assert that each request ID sent is the same as the UUIDSent + Truth.assertThat(capturedRequestIds) + .containsExactly(UUIDsent, UUIDsent, UUIDsent, UUIDsent, UUIDsent); + } finally { + grpcClientWithRetries.close(); + grpcClientWithRetries.awaitTermination( + TestClientInitializer.AWAIT_TERMINATION_SECONDS, TimeUnit.SECONDS); + } + } + + @Test + void testGRPC_setsSameAutoPopulatedRequestIdWhenRequestsAreRetried() throws Exception { + List capturedRequestIds = new ArrayList<>(); + grpcRequestInterceptor.setOnRequestIntercepted( + request -> { + if (request instanceof EchoRequest) { + EchoRequest echoRequest = (EchoRequest) request; + capturedRequestIds.add(echoRequest.getRequestId()); + } + }); + + EchoRequest requestSent = + EchoRequest.newBuilder() + .setError(Status.newBuilder().setCode(Code.UNKNOWN.ordinal()).build()) + .build(); + + try { + RetryingFuture retryingFuture = + (RetryingFuture) + grpcClientWithRetries.echoCallable().futureCall(requestSent); + assertThrows(ExecutionException.class, () -> retryingFuture.get(10, TimeUnit.SECONDS)); + // assert that the number of request IDs is equal to the max attempt + Truth.assertThat(capturedRequestIds).hasSize(5); + // assert that each request ID sent is the same + Truth.assertThat(capturedRequestIds) + .containsExactly( + capturedRequestIds.get(0), + capturedRequestIds.get(0), + capturedRequestIds.get(0), + capturedRequestIds.get(0), + capturedRequestIds.get(0)); + } finally { + grpcClientWithRetries.close(); + grpcClientWithRetries.awaitTermination( + TestClientInitializer.AWAIT_TERMINATION_SECONDS, TimeUnit.SECONDS); + } + } + + @Test + void testHttpJson_setsSameRequestIdIfSetInRequestWhenRequestsAreRetried() throws Exception { + List capturedRequestIds = new ArrayList<>(); + httpJsonInterceptor.setOnRequestIntercepted( + request -> { + if (request instanceof EchoRequest) { + EchoRequest echoRequest = (EchoRequest) request; + capturedRequestIds.add(echoRequest.getRequestId()); + } + }); + String UUIDsent = UUID.randomUUID().toString(); + EchoRequest requestSent = + EchoRequest.newBuilder() + .setRequestId(UUIDsent) + .setError(Status.newBuilder().setCode(Code.UNKNOWN.getHttpStatusCode()).build()) + .build(); + try { + RetryingFuture retryingFuture = + (RetryingFuture) + httpJsonClientWithRetries.echoCallable().futureCall(requestSent); + assertThrows(ExecutionException.class, () -> retryingFuture.get(10, TimeUnit.SECONDS)); + // assert that the number of request IDs is equal to the max attempt + Truth.assertThat(capturedRequestIds).hasSize(5); + // assert that each request ID sent is the same as the UUIDSent + Truth.assertThat(capturedRequestIds) + .containsExactly(UUIDsent, UUIDsent, UUIDsent, UUIDsent, UUIDsent); + } finally { + httpJsonClientWithRetries.close(); + httpJsonClientWithRetries.awaitTermination( + TestClientInitializer.AWAIT_TERMINATION_SECONDS, TimeUnit.SECONDS); + } + } + + @Test + void testHttpJson_setsSameAutoPopulatedRequestIdWhenRequestsAreRetried() throws Exception { + List capturedRequestIds = new ArrayList<>(); + httpJsonInterceptor.setOnRequestIntercepted( + request -> { + if (request instanceof EchoRequest) { + EchoRequest echoRequest = (EchoRequest) request; + capturedRequestIds.add(echoRequest.getRequestId()); + } + }); + EchoRequest requestSent = + EchoRequest.newBuilder() + .setError(Status.newBuilder().setCode(Code.UNKNOWN.getHttpStatusCode()).build()) + .build(); + try { + RetryingFuture retryingFuture = + (RetryingFuture) + httpJsonClientWithRetries.echoCallable().futureCall(requestSent); + assertThrows(ExecutionException.class, () -> retryingFuture.get(10, TimeUnit.SECONDS)); + // assert that the number of request IDs is equal to the max attempt + Truth.assertThat(capturedRequestIds).hasSize(5); + // assert that each request ID sent is the same + Truth.assertThat(capturedRequestIds) + .containsExactly( + capturedRequestIds.get(0), + capturedRequestIds.get(0), + capturedRequestIds.get(0), + capturedRequestIds.get(0), + capturedRequestIds.get(0)); + } finally { + httpJsonClientWithRetries.close(); + httpJsonClientWithRetries.awaitTermination( + TestClientInitializer.AWAIT_TERMINATION_SECONDS, TimeUnit.SECONDS); + } + } +} diff --git a/java-showcase-3.21.0/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/ITBidiStreaming.java b/java-showcase-3.21.0/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/ITBidiStreaming.java new file mode 100644 index 0000000000..72b8f1b0de --- /dev/null +++ b/java-showcase-3.21.0/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/ITBidiStreaming.java @@ -0,0 +1,107 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.it; + +import static com.google.common.truth.Truth.assertThat; + +import com.google.api.core.SettableApiFuture; +import com.google.api.gax.rpc.ClientStream; +import com.google.api.gax.rpc.ResponseObserver; +import com.google.api.gax.rpc.StreamController; +import com.google.showcase.v1beta1.EchoClient; +import com.google.showcase.v1beta1.EchoRequest; +import com.google.showcase.v1beta1.EchoResponse; +import com.google.showcase.v1beta1.it.util.TestClientInitializer; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.util.concurrent.TimeUnit; +import org.junit.jupiter.api.AfterAll; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Test; + +class ITBidiStreaming { + + private static EchoClient grpcClient; + + @BeforeAll + static void createClients() throws Exception { + // Create gRPC Echo Client + grpcClient = TestClientInitializer.createGrpcEchoClient(); + } + + @AfterAll + static void destroyClients() throws Exception { + grpcClient.close(); + grpcClient.awaitTermination(TestClientInitializer.AWAIT_TERMINATION_SECONDS, TimeUnit.SECONDS); + } + + // The current implementation of BIDI streaming on Echo showcase server is that it would echo the + // request content back on every request, so this test verifies that the response content is + // exactly the same as request content. + // Ideally we should make the BIDI streaming server more generic, e.g. only respond when there are + // three requests, respond twice for every request etc. If that happens, the response content may + // not be exactly the same as request content. + @Test + void testGrpc_splitCall_shouldListensToResponse() throws Exception { + // given + List expected = Arrays.asList("The rain in Spain stays mainly on the plain".split(" ")); + TestResponseObserver responseObserver = new TestResponseObserver(); + + // when + ClientStream clientStream = grpcClient.chatCallable().splitCall(responseObserver); + expected.forEach( + requestContent -> { + EchoRequest request = EchoRequest.newBuilder().setContent(requestContent).build(); + clientStream.send(request); + }); + clientStream.closeSend(); + + // then + List actual = responseObserver.getFuture().get(); + assertThat(actual).containsExactlyElementsIn(expected).inOrder(); + } + + private static class TestResponseObserver implements ResponseObserver { + private final List responses = new ArrayList<>(); + private final SettableApiFuture> future = SettableApiFuture.create(); + + @Override + public void onStart(StreamController controller) { + // no-op + } + + @Override + public void onResponse(EchoResponse response) { + responses.add(response.getContent()); + } + + @Override + public void onError(Throwable t) { + // no-op + } + + @Override + public void onComplete() { + future.set(responses); + } + + public SettableApiFuture> getFuture() { + return future; + } + } +} diff --git a/java-showcase-3.21.0/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/ITClientShutdown.java b/java-showcase-3.21.0/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/ITClientShutdown.java new file mode 100644 index 0000000000..e55ee8d1ed --- /dev/null +++ b/java-showcase-3.21.0/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/ITClientShutdown.java @@ -0,0 +1,163 @@ +/* + * 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 + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.showcase.v1beta1.it; + +import com.google.api.gax.retrying.RetrySettings; +import com.google.api.gax.rpc.StatusCode; +import com.google.common.collect.ImmutableSet; +import com.google.common.truth.Truth; +import com.google.showcase.v1beta1.BlockRequest; +import com.google.showcase.v1beta1.BlockResponse; +import com.google.showcase.v1beta1.EchoClient; +import com.google.showcase.v1beta1.EchoRequest; +import com.google.showcase.v1beta1.it.util.TestClientInitializer; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.Timeout; +import org.threeten.bp.Duration; + +class ITClientShutdown { + + private static final long DEFAULT_RPC_TIMEOUT_MS = 15000L; + private static final long DEFAULT_CLIENT_TERMINATION_MS = 5000L; + + // Test to ensure the client can close + terminate properly + @Test + @Timeout(15) + void testGrpc_closeClient() throws Exception { + EchoClient grpcClient = TestClientInitializer.createGrpcEchoClient(); + assertClientTerminated(grpcClient); + } + + // Test to ensure the client can close + terminate properly + @Test + @Timeout(15) + void testHttpJson_closeClient() throws Exception { + EchoClient httpjsonClient = TestClientInitializer.createHttpJsonEchoClient(); + assertClientTerminated(httpjsonClient); + } + + // Test to ensure the client can close + terminate after a quick RPC invocation + @Test + @Timeout(15) + void testGrpc_rpcInvoked_closeClient() throws Exception { + EchoClient grpcClient = TestClientInitializer.createGrpcEchoClient(); + // Response is ignored for this test + grpcClient.echo(EchoRequest.newBuilder().setContent("Test").build()); + assertClientTerminated(grpcClient); + } + + // Test to ensure the client can close + terminate after a quick RPC invocation + @Test + @Timeout(15) + void testHttpJson_rpcInvoked_closeClient() throws Exception { + EchoClient httpjsonClient = TestClientInitializer.createHttpJsonEchoClient(); + // Response is ignored for this test + httpjsonClient.echo(EchoRequest.newBuilder().setContent("Test").build()); + assertClientTerminated(httpjsonClient); + } + + // This test is to ensure that the client is able to close + terminate any resources + // once a response has been received. Set a max test duration of 15s to ensure that + // the test does not continue on forever. + @Test + @Timeout(15) + void testGrpc_rpcInvokedWithLargeTimeout_closeClientOnceResponseReceived() throws Exception { + // Set the maxAttempts to 1 to ensure there are no retries scheduled. The single RPC + // invocation should time out in 15s, but the client will receive a response in 2s. + // Any outstanding tasks (timeout tasks) should be cancelled once a response has been + // received so the client can properly terminate. + RetrySettings defaultRetrySettings = + RetrySettings.newBuilder() + .setInitialRpcTimeout(Duration.ofMillis(DEFAULT_RPC_TIMEOUT_MS)) + .setMaxRpcTimeout(Duration.ofMillis(DEFAULT_RPC_TIMEOUT_MS)) + .setTotalTimeout(Duration.ofMillis(DEFAULT_RPC_TIMEOUT_MS)) + .setMaxAttempts(1) + .build(); + EchoClient grpcClient = + TestClientInitializer.createGrpcEchoClientCustomBlockSettings( + defaultRetrySettings, ImmutableSet.of(StatusCode.Code.DEADLINE_EXCEEDED)); + + BlockRequest blockRequest = + BlockRequest.newBuilder() + .setSuccess(BlockResponse.newBuilder().setContent("gRPCBlockContent_2sDelay")) + .setResponseDelay(com.google.protobuf.Duration.newBuilder().setSeconds(2).build()) + .build(); + + // Response is ignored for this test + grpcClient.block(blockRequest); + + assertClientTerminated(grpcClient); + } + + // This test is to ensure that the client is able to close + terminate any resources + // once a response has been received. Set a max test duration of 15s to ensure that + // the test does not continue on forever. + @Test + @Timeout(15) + void testHttpJson_rpcInvokedWithLargeTimeout_closeClientOnceResponseReceived() throws Exception { + // Set the maxAttempts to 1 to ensure there are no retries scheduled. The single RPC + // invocation should time out in 15s, but the client will receive a response in 2s. + // Any outstanding tasks (timeout tasks) should be cancelled once a response has been + // received so the client can properly terminate. + RetrySettings defaultRetrySettings = + RetrySettings.newBuilder() + .setInitialRpcTimeout(Duration.ofMillis(DEFAULT_RPC_TIMEOUT_MS)) + .setMaxRpcTimeout(Duration.ofMillis(DEFAULT_RPC_TIMEOUT_MS)) + .setTotalTimeout(Duration.ofMillis(DEFAULT_RPC_TIMEOUT_MS)) + .setMaxAttempts(1) + .build(); + EchoClient httpjsonClient = + TestClientInitializer.createHttpJsonEchoClientCustomBlockSettings( + defaultRetrySettings, ImmutableSet.of(StatusCode.Code.DEADLINE_EXCEEDED)); + + BlockRequest blockRequest = + BlockRequest.newBuilder() + .setSuccess(BlockResponse.newBuilder().setContent("httpjsonBlockContent_2sDelay")) + .setResponseDelay(com.google.protobuf.Duration.newBuilder().setSeconds(2).build()) + .build(); + + // Response is ignored for this test + httpjsonClient.block(blockRequest); + + assertClientTerminated(httpjsonClient); + } + + // This helper method asserts that the client is able to terminate within + // `AWAIT_TERMINATION_SECONDS` + private void assertClientTerminated(EchoClient echoClient) throws InterruptedException { + long start = System.currentTimeMillis(); + // Intentionally do not run echoClient.awaitTermination(...) as this test will + // check that everything is properly terminated after close() is called. + echoClient.close(); + + // Loop until the client has terminated successfully. For tests that use this, + // try to ensure there is a timeout associated, otherwise this may run forever. + // Future enhancement: Use awaitility instead of busy waiting + while (!echoClient.isTerminated()) { + Thread.sleep(500L); + } + // The busy-wait time won't be accurate, so account for a bit of buffer + long end = System.currentTimeMillis(); + + Truth.assertThat(echoClient.isShutdown()).isTrue(); + + // Check the termination time. If all the tasks/ resources are closed successfully, + // the termination time should only occur shortly after `close()` was invoked. The + // `DEFAULT_TERMINATION_MS` value should include a bit of buffer. + long terminationTime = end - start; + Truth.assertThat(terminationTime).isLessThan(DEFAULT_CLIENT_TERMINATION_MS); + } +} diff --git a/java-showcase-3.21.0/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/ITClientSideStreaming.java b/java-showcase-3.21.0/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/ITClientSideStreaming.java new file mode 100644 index 0000000000..61b507f49a --- /dev/null +++ b/java-showcase-3.21.0/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/ITClientSideStreaming.java @@ -0,0 +1,123 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.it; + +import static com.google.common.truth.Truth.assertThat; +import static org.junit.jupiter.api.Assertions.assertThrows; + +import com.google.api.core.SettableApiFuture; +import com.google.api.gax.rpc.ApiStreamObserver; +import com.google.api.gax.rpc.CancelledException; +import com.google.api.gax.rpc.StatusCode; +import com.google.rpc.Status; +import com.google.showcase.v1beta1.EchoClient; +import com.google.showcase.v1beta1.EchoRequest; +import com.google.showcase.v1beta1.EchoResponse; +import com.google.showcase.v1beta1.it.util.TestClientInitializer; +import java.util.ArrayList; +import java.util.List; +import java.util.concurrent.ExecutionException; +import java.util.concurrent.TimeUnit; +import org.junit.jupiter.api.AfterAll; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Test; + +class ITClientSideStreaming { + + private static EchoClient grpcClient; + + @BeforeAll + static void createClients() throws Exception { + // Create gRPC Echo Client + grpcClient = TestClientInitializer.createGrpcEchoClient(); + } + + @AfterAll + static void destroyClients() throws InterruptedException { + grpcClient.close(); + grpcClient.awaitTermination(TestClientInitializer.AWAIT_TERMINATION_SECONDS, TimeUnit.SECONDS); + } + + @Test + void testGrpc_sendStreamedContent_receiveConcatenatedResponse() + throws ExecutionException, InterruptedException { + CollectStreamObserver responseObserver = new CollectStreamObserver<>(); + ApiStreamObserver requestObserver = + grpcClient.collectCallable().clientStreamingCall(responseObserver); + String content = "The rain in Spain stays mainly on the plain"; + for (String message : content.split("\\s")) { + requestObserver.onNext(EchoRequest.newBuilder().setContent(message).build()); + } + requestObserver.onCompleted(); + + List serverResponse = responseObserver.future().get(); + assertThat(serverResponse).hasSize(1); + assertThat(serverResponse.get(0).getContent()) + .isEqualTo("The rain in Spain stays mainly on the plain"); + } + + @Test + void testGrpc_sendStreamedContent_handleServerError() { + CollectStreamObserver responseObserver = new CollectStreamObserver<>(); + ApiStreamObserver requestObserver = + grpcClient.collectCallable().clientStreamingCall(responseObserver); + String content = "The rain in Spain stays mainly on the plain"; + for (String message : content.split("\\s")) { + requestObserver.onNext(EchoRequest.newBuilder().setContent(message).build()); + } + Status cancelledStatus = + Status.newBuilder().setCode(StatusCode.Code.CANCELLED.ordinal()).build(); + requestObserver.onNext(EchoRequest.newBuilder().setError(cancelledStatus).build()); + requestObserver.onCompleted(); + + ExecutionException exception = + assertThrows(ExecutionException.class, () -> responseObserver.future().get()); + assertThat(exception.getCause()).isInstanceOf(CancelledException.class); + CancelledException cancelledException = (CancelledException) exception.getCause(); + assertThat(cancelledException.getStatusCode().getCode()).isEqualTo(StatusCode.Code.CANCELLED); + } + + /** + * Implementation of {@link ApiStreamObserver} to accumulate streamed content. + * + * @param + */ + private class CollectStreamObserver implements ApiStreamObserver { + + private final SettableApiFuture> future = SettableApiFuture.create(); + private final List messages = new ArrayList<>(); + + @Override + public void onNext(T message) { + this.messages.add(message); + } + + @Override + public void onError(Throwable throwable) { + this.future.setException(throwable); + } + + @Override + public void onCompleted() { + future.set(this.messages); + } + + public SettableApiFuture> future() { + return this.future; + } + } +} diff --git a/java-showcase-3.21.0/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/ITCommonServiceMixins.java b/java-showcase-3.21.0/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/ITCommonServiceMixins.java new file mode 100644 index 0000000000..a64f95a258 --- /dev/null +++ b/java-showcase-3.21.0/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/ITCommonServiceMixins.java @@ -0,0 +1,133 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.it; + +import static com.google.common.truth.Truth.assertThat; + +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.Location; +import com.google.common.collect.ImmutableList; +import com.google.showcase.v1beta1.EchoClient; +import com.google.showcase.v1beta1.it.util.TestClientInitializer; +import java.util.ArrayList; +import java.util.List; +import java.util.concurrent.TimeUnit; +import org.junit.jupiter.api.AfterAll; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Test; + +class ITCommonServiceMixins { + + // The showcase server always returns a fixed list of locations. See + // https://github.com/googleapis/gapic-showcase/blob/main/server/services/locations_service.go + private static final List EXPECTED_LOCATIONS = + ImmutableList.of( + Location.newBuilder() + .setName("projects/showcase/locations/us-north") + .setDisplayName("us-north") + .build(), + Location.newBuilder() + .setName("projects/showcase/locations/us-south") + .setDisplayName("us-south") + .build(), + Location.newBuilder() + .setName("projects/showcase/locations/us-east") + .setDisplayName("us-east") + .build(), + Location.newBuilder() + .setName("projects/showcase/locations/us-west") + .setDisplayName("us-west") + .build()); + private static EchoClient grpcClient; + private static EchoClient httpjsonClient; + + @BeforeAll + static void createClients() throws Exception { + // Create gRPC Echo Client + grpcClient = TestClientInitializer.createGrpcEchoClient(); + + // Create HttpJson Echo Client + httpjsonClient = TestClientInitializer.createHttpJsonEchoClient(); + } + + @AfterAll + static void destroyClients() throws InterruptedException { + grpcClient.close(); + httpjsonClient.close(); + + grpcClient.awaitTermination(TestClientInitializer.AWAIT_TERMINATION_SECONDS, TimeUnit.SECONDS); + httpjsonClient.awaitTermination( + TestClientInitializer.AWAIT_TERMINATION_SECONDS, TimeUnit.SECONDS); + } + + @Test + void testGrpc_getLocation() { + GetLocationRequest request = + GetLocationRequest.newBuilder().setName("projects/showcase/location/us-central1").build(); + Location location = grpcClient.getLocation(request); + assertThat(location) + .isEqualTo( + Location.newBuilder() + .setName("projects/showcase/location/us-central1") + .setDisplayName("us-central1") + .build()); + } + + @Test + void testGrpc_listLocations() { + ListLocationsRequest request = + ListLocationsRequest.newBuilder().setName("projects/showcase").build(); + EchoClient.ListLocationsPagedResponse locationsPagedResponse = + grpcClient.listLocations(request); + + List actualLocations = new ArrayList<>(); + for (Location location : locationsPagedResponse.iterateAll()) { + actualLocations.add(location); + } + + assertThat(actualLocations).containsExactlyElementsIn(EXPECTED_LOCATIONS).inOrder(); + } + + @Test + void testHttpJson_getLocation() { + GetLocationRequest request = + GetLocationRequest.newBuilder().setName("projects/showcase/locations/us-central1").build(); + Location location = httpjsonClient.getLocation(request); + assertThat(location) + .isEqualTo( + Location.newBuilder() + .setName("projects/showcase/locations/us-central1") + .setDisplayName("us-central1") + .build()); + } + + @Test + void testHttpJson_listLocations() { + ListLocationsRequest request = + ListLocationsRequest.newBuilder().setName("projects/showcase").build(); + EchoClient.ListLocationsPagedResponse locationsPagedResponse = + httpjsonClient.listLocations(request); + + List actualLocations = new ArrayList<>(); + for (Location location : locationsPagedResponse.iterateAll()) { + actualLocations.add(location); + } + + assertThat(actualLocations).containsExactlyElementsIn(EXPECTED_LOCATIONS).inOrder(); + } +} diff --git a/java-showcase-3.21.0/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/ITCrud.java b/java-showcase-3.21.0/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/ITCrud.java new file mode 100644 index 0000000000..bfb9e335e5 --- /dev/null +++ b/java-showcase-3.21.0/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/ITCrud.java @@ -0,0 +1,189 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.showcase.v1beta1.it; + +import static com.google.common.truth.Truth.assertThat; + +import com.google.common.collect.ImmutableList; +import com.google.protobuf.FieldMask; +import com.google.showcase.v1beta1.CreateUserRequest; +import com.google.showcase.v1beta1.DeleteUserRequest; +import com.google.showcase.v1beta1.IdentityClient; +import com.google.showcase.v1beta1.ListUsersRequest; +import com.google.showcase.v1beta1.ListUsersResponse; +import com.google.showcase.v1beta1.UpdateUserRequest; +import com.google.showcase.v1beta1.User; +import com.google.showcase.v1beta1.it.util.TestClientInitializer; +import java.util.Arrays; +import java.util.List; +import java.util.concurrent.TimeUnit; +import org.junit.jupiter.api.AfterAll; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; + +class ITCrud { + + private static final User DEFAULT_USER = + User.newBuilder() + .setDisplayName("Jane Doe") + .setEmail("janedoe@example.com") + .setNickname("Doe") + .setHeightFeet(5) + .setAge(25) + .build(); + + private static IdentityClient grpcClient; + private static IdentityClient httpjsonClient; + + @BeforeAll + public static void createClients() throws Exception { + // Create gRPC IdentityClient + grpcClient = TestClientInitializer.createGrpcIdentityClient(); + // Create HttpJson IdentityClient + httpjsonClient = TestClientInitializer.createHttpJsonIdentityClient(); + } + + @AfterAll + public static void destroyClients() throws InterruptedException { + grpcClient.close(); + httpjsonClient.close(); + + grpcClient.awaitTermination(TestClientInitializer.AWAIT_TERMINATION_SECONDS, TimeUnit.SECONDS); + httpjsonClient.awaitTermination( + TestClientInitializer.AWAIT_TERMINATION_SECONDS, TimeUnit.SECONDS); + } + + @BeforeEach + void cleanupData() { + IdentityClient.ListUsersPagedResponse pagedResponse = + grpcClient.listUsers(ListUsersRequest.newBuilder().setPageSize(5).build()); + for (IdentityClient.ListUsersPage listUsersPage : pagedResponse.iteratePages()) { + for (User user : listUsersPage.getResponse().getUsersList()) { + grpcClient.deleteUser(user.getName()); + } + } + pagedResponse = httpjsonClient.listUsers(ListUsersRequest.newBuilder().setPageSize(5).build()); + assertThat(pagedResponse.getPage().getResponse().getUsersList().size()).isEqualTo(0); + } + + @Test + void testHttpJson_Create() { + User userResponse = createDefaultUser(); + + // These properties should be the same + assertThat(userResponse.getDisplayName()).isEqualTo(DEFAULT_USER.getDisplayName()); + assertThat(userResponse.getEmail()).isEqualTo(DEFAULT_USER.getEmail()); + assertThat(userResponse.getNickname()).isEqualTo(DEFAULT_USER.getNickname()); + assertThat(userResponse.getHeightFeet()).isEqualTo(DEFAULT_USER.getHeightFeet()); + assertThat(userResponse.getAge()).isEqualTo(DEFAULT_USER.getAge()); + + // Assert that the server populates these fields + assertThat(userResponse.getName()).isNotEmpty(); + assertThat(userResponse.getCreateTime()).isNotNull(); + assertThat(userResponse.getUpdateTime()).isNotNull(); + assertThat(userResponse.getEnableNotifications()).isNotNull(); + } + + @Test + void testHttpJson_Read() { + List expectedUsersList = + ImmutableList.of( + createDefaultUser(), + createUser( + DEFAULT_USER.toBuilder() + .setNickname("John Smith") + .setEmail("johnsmith@example.com") + .build())); + // Assert that only one User exists + IdentityClient.ListUsersPagedResponse listUsersPagedResponse = + httpjsonClient.listUsers(ListUsersRequest.newBuilder().setPageSize(5).build()); + ListUsersResponse listUsersResponse = listUsersPagedResponse.getPage().getResponse(); + assertThat(listUsersResponse.getUsersList().size()).isEqualTo(2); + + // Check that the response from both List (pagination) and Get + // List Users + assertThat(listUsersResponse.getUsersList()).containsExactlyElementsIn(expectedUsersList); + + // Get User + User defaultUser = expectedUsersList.get(0); + User getUserResponse = httpjsonClient.getUser(defaultUser.getName()); + assertThat(getUserResponse).isEqualTo(defaultUser); + } + + @Test + void testHttpJson_Update() { + User userResponse = createDefaultUser(); + // Update multiple fields in the User. Age + Nickname are not included in the FieldMask + // userResponse's enableNotifications field is populated from the server + User updateUser = + userResponse.toBuilder() + .setAge(50) + .setNickname("Smith") + .setEmail("janedoe@jane.com") + .setHeightFeet(6.0) + .setEnableNotifications(true) + .build(); + User updateUserResponse = + httpjsonClient.updateUser( + UpdateUserRequest.newBuilder() + .setUser(updateUser) + .setUpdateMask( + FieldMask.newBuilder() + .addAllPaths(Arrays.asList("email", "height_feet", "enable_notifications")) + .build()) + .build()); + + // Assert that only the fields in the FieldMask are updated correctly + assertThat(updateUserResponse).isNotEqualTo(userResponse); + assertThat(updateUserResponse.getAge()).isEqualTo(userResponse.getAge()); + assertThat(updateUserResponse.getNickname()).isEqualTo(userResponse.getNickname()); + + assertThat(updateUserResponse.getEmail()).isEqualTo(updateUser.getEmail()); + assertThat(updateUserResponse.getHeightFeet()).isEqualTo(updateUser.getHeightFeet()); + assertThat(updateUserResponse.getEnableNotifications()) + .isEqualTo(updateUser.getEnableNotifications()); + } + + @Test + void testHttpJson_Delete() { + User userResponse = createDefaultUser(); + + httpjsonClient.deleteUser( + DeleteUserRequest.newBuilder().setName(userResponse.getName()).build()); + + IdentityClient.ListUsersPagedResponse listUsersPagedResponse = + httpjsonClient.listUsers(ListUsersRequest.newBuilder().setPageSize(5).build()); + assertThat(listUsersPagedResponse.getPage().getResponse().getUsersList().size()).isEqualTo(0); + } + + private User createDefaultUser() { + return createUser(DEFAULT_USER); + } + + /** + * Helper method to create a user with the DEFAULT_USER configs. Server returns a generated name + * (not username) that is used to identify the individual user and each test uses the name for the + * RPC. Server also populates a few additional fields (Create Time, Updated Time, and Enable + * Notifications). + * + * @param user User to be created + * @return newly created user + */ + private User createUser(User user) { + return httpjsonClient.createUser(CreateUserRequest.newBuilder().setUser(user).build()); + } +} diff --git a/java-showcase-3.21.0/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/ITDynamicRoutingHeaders.java b/java-showcase-3.21.0/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/ITDynamicRoutingHeaders.java new file mode 100644 index 0000000000..7828da8b53 --- /dev/null +++ b/java-showcase-3.21.0/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/ITDynamicRoutingHeaders.java @@ -0,0 +1,400 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.showcase.v1beta1.it; + +import static com.google.api.gax.rpc.internal.Headers.DYNAMIC_ROUTING_HEADER_KEY; +import static com.google.common.truth.Truth.assertThat; + +import com.google.api.gax.httpjson.ApiMethodDescriptor; +import com.google.api.gax.httpjson.ForwardingHttpJsonClientCall; +import com.google.api.gax.httpjson.ForwardingHttpJsonClientCallListener; +import com.google.api.gax.httpjson.HttpJsonCallOptions; +import com.google.api.gax.httpjson.HttpJsonChannel; +import com.google.api.gax.httpjson.HttpJsonClientCall; +import com.google.api.gax.httpjson.HttpJsonClientInterceptor; +import com.google.api.gax.httpjson.HttpJsonMetadata; +import com.google.common.collect.ImmutableList; +import com.google.showcase.v1beta1.ComplianceClient; +import com.google.showcase.v1beta1.ComplianceData; +import com.google.showcase.v1beta1.EchoClient; +import com.google.showcase.v1beta1.EchoRequest; +import com.google.showcase.v1beta1.RepeatRequest; +import com.google.showcase.v1beta1.RepeatResponse; +import com.google.showcase.v1beta1.it.util.TestClientInitializer; +import io.grpc.CallOptions; +import io.grpc.Channel; +import io.grpc.ClientCall; +import io.grpc.ClientInterceptor; +import io.grpc.ForwardingClientCall; +import io.grpc.Metadata; +import io.grpc.MethodDescriptor; +import java.util.Arrays; +import java.util.List; +import java.util.concurrent.TimeUnit; +import java.util.stream.Collectors; +import org.junit.jupiter.api.AfterAll; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; + +class ITDynamicRoutingHeaders { + private static final String SPLIT_TOKEN = "&"; + private static final Metadata.Key REQUEST_PARAMS_HEADER_KEY = + Metadata.Key.of(DYNAMIC_ROUTING_HEADER_KEY, Metadata.ASCII_STRING_MARSHALLER); + + // Implement a request interceptor to retrieve the headers being sent on the request. + // The headers being set are part of the Metadata + private static class GrpcCapturingClientInterceptor implements ClientInterceptor { + private Metadata metadata; + + @Override + public ClientCall interceptCall( + MethodDescriptor method, final CallOptions callOptions, Channel next) { + ClientCall call = next.newCall(method, callOptions); + return new ForwardingClientCall.SimpleForwardingClientCall(call) { + @Override + public void start(ClientCall.Listener responseListener, Metadata headers) { + metadata = headers; + super.start(responseListener, headers); + } + }; + } + } + + // Implement a request interceptor to retrieve the headers being sent on the request + // The headers being set are part of the CallOptions + private static class HttpJsonCapturingClientInterceptor implements HttpJsonClientInterceptor { + private String requestParam; + + @Override + public HttpJsonClientCall interceptCall( + ApiMethodDescriptor method, + HttpJsonCallOptions callOptions, + HttpJsonChannel next) { + HttpJsonClientCall call = next.newCall(method, callOptions); + return new ForwardingHttpJsonClientCall.SimpleForwardingHttpJsonClientCall< + RequestT, ResponseT>(call) { + @Override + public void start(Listener responseListener, HttpJsonMetadata requestHeaders) { + Listener forwardingResponseListener = + new ForwardingHttpJsonClientCallListener.SimpleForwardingHttpJsonClientCallListener< + ResponseT>(responseListener) { + @Override + public void onHeaders(HttpJsonMetadata responseHeaders) { + super.onHeaders(responseHeaders); + } + + @Override + public void onMessage(ResponseT message) { + super.onMessage(message); + } + + @Override + public void onClose(int statusCode, HttpJsonMetadata trailers) { + super.onClose(statusCode, trailers); + } + }; + + super.start(forwardingResponseListener, requestHeaders); + if (requestHeaders.getHeaders().containsKey(DYNAMIC_ROUTING_HEADER_KEY)) { + requestParam = + String.valueOf(requestHeaders.getHeaders().get(DYNAMIC_ROUTING_HEADER_KEY)); + } + } + }; + } + } + + private static HttpJsonCapturingClientInterceptor httpJsonInterceptor; + private static HttpJsonCapturingClientInterceptor httpJsonComplianceInterceptor; + private static GrpcCapturingClientInterceptor grpcInterceptor; + private static GrpcCapturingClientInterceptor grpcComplianceInterceptor; + + private static EchoClient grpcClient; + private static EchoClient httpJsonClient; + private static ComplianceClient grpcComplianceClient; + private static ComplianceClient httpJsonComplianceClient; + + @BeforeAll + static void createClients() throws Exception { + // Create gRPC Interceptor and Client + grpcInterceptor = new GrpcCapturingClientInterceptor(); + grpcClient = TestClientInitializer.createGrpcEchoClient(ImmutableList.of(grpcInterceptor)); + + // Create gRPC ComplianceClient and Interceptor + // Creating a compliance client because echo client doesn't have an implicit enum routing test + // case + grpcComplianceInterceptor = new GrpcCapturingClientInterceptor(); + grpcComplianceClient = + TestClientInitializer.createGrpcComplianceClient( + ImmutableList.of(grpcComplianceInterceptor)); + + // Create HttpJson ComplianceClient and Interceptor + httpJsonComplianceInterceptor = new HttpJsonCapturingClientInterceptor(); + httpJsonComplianceClient = + TestClientInitializer.createHttpJsonComplianceClient( + ImmutableList.of(httpJsonComplianceInterceptor)); + + // Create HttpJson Interceptor and Client + httpJsonInterceptor = new HttpJsonCapturingClientInterceptor(); + httpJsonClient = + TestClientInitializer.createHttpJsonEchoClient(ImmutableList.of(httpJsonInterceptor)); + } + + @BeforeEach + void cleanUpParams() { + grpcInterceptor.metadata = null; + grpcComplianceInterceptor.metadata = null; + httpJsonInterceptor.requestParam = null; + httpJsonComplianceInterceptor.requestParam = null; + } + + @AfterAll + static void destroyClient() throws InterruptedException { + grpcClient.close(); + grpcComplianceClient.close(); + + httpJsonClient.close(); + httpJsonComplianceClient.close(); + + grpcClient.awaitTermination(TestClientInitializer.AWAIT_TERMINATION_SECONDS, TimeUnit.SECONDS); + grpcComplianceClient.awaitTermination( + TestClientInitializer.AWAIT_TERMINATION_SECONDS, TimeUnit.SECONDS); + + httpJsonClient.awaitTermination( + TestClientInitializer.AWAIT_TERMINATION_SECONDS, TimeUnit.SECONDS); + httpJsonComplianceClient.awaitTermination( + TestClientInitializer.AWAIT_TERMINATION_SECONDS, TimeUnit.SECONDS); + } + + @Test + void testGrpc_noRoutingHeaderUsed() { + grpcClient.echo(EchoRequest.newBuilder().build()); + String headerValue = grpcInterceptor.metadata.get(REQUEST_PARAMS_HEADER_KEY); + assertThat(headerValue).isNull(); + } + + @Test + void testHttpJson_noRoutingHeaderUsed() { + httpJsonClient.echo(EchoRequest.newBuilder().build()); + String headerValue = httpJsonInterceptor.requestParam; + assertThat(headerValue).isNull(); + } + + @Test + void testGrpc_emptyHeader() { + grpcClient.echo(EchoRequest.newBuilder().setHeader("").build()); + String headerValue = grpcInterceptor.metadata.get(REQUEST_PARAMS_HEADER_KEY); + assertThat(headerValue).isNull(); + } + + @Test + void testHttpJson_emptyHeader() { + httpJsonClient.echo(EchoRequest.newBuilder().setHeader("").build()); + String headerValue = httpJsonInterceptor.requestParam; + assertThat(headerValue).isNull(); + } + + @Test + void testGrpc_matchesHeaderName() { + grpcClient.echo(EchoRequest.newBuilder().setHeader("potato").build()); + String headerValue = grpcInterceptor.metadata.get(REQUEST_PARAMS_HEADER_KEY); + assertThat(headerValue).isNotNull(); + List requestHeaders = + Arrays.stream(headerValue.split(SPLIT_TOKEN)).collect(Collectors.toList()); + List expectedHeaders = ImmutableList.of("header=potato", "routing_id=potato"); + assertThat(requestHeaders).containsExactlyElementsIn(expectedHeaders); + } + + @Test + void testGrpc_implicitHeaders_enumsEncodedasInt() { + RepeatRequest request = + RepeatRequest.newBuilder().setInfo(ComplianceData.newBuilder().setFKingdomValue(5)).build(); + RepeatResponse actualResponse = grpcComplianceClient.repeatDataSimplePath(request); + String headerValue = grpcComplianceInterceptor.metadata.get(REQUEST_PARAMS_HEADER_KEY); + assertThat(headerValue).isNotNull(); + List requestHeaders = + Arrays.stream(headerValue.split(SPLIT_TOKEN)).collect(Collectors.toList()); + // fields beside "info.f_kingdom" are default values (false, 0.0, 0) since we are not setting + // them in the request message. + List expectedHeaders = + ImmutableList.of( + "info.f_bool=false", "info.f_double=0.0", "info.f_int32=0", "info.f_kingdom=5"); + assertThat(requestHeaders).containsExactlyElementsIn(expectedHeaders); + } + + @Test + void testHttpJson_implicitHeaders_enumsEncodedasInt() { + RepeatRequest request = + RepeatRequest.newBuilder() + .setInfo( + ComplianceData.newBuilder() + .setFString("test") + .setFInt32(1) + .setFDouble(2) + .setFBool(true) + .setFKingdomValue(3)) + .build(); + RepeatResponse actualResponse = httpJsonComplianceClient.repeatDataSimplePath(request); + String headerValue = httpJsonComplianceInterceptor.requestParam; + assertThat(headerValue).isNotNull(); + List requestHeaders = + Arrays.stream(headerValue.split(SPLIT_TOKEN)).collect(Collectors.toList()); + // In this case, we are setting the values explicitly. + List expectedHeaders = + ImmutableList.of( + "info.f_bool=true", + "info.f_double=2.0", + "info.f_int32=1", + "info.f_kingdom=3", + "info.f_string=test"); + assertThat(requestHeaders).containsExactlyElementsIn(expectedHeaders); + } + + @Test + void testHttpJson_matchesHeaderName() { + httpJsonClient.echo(EchoRequest.newBuilder().setHeader("potato").build()); + String headerValue = httpJsonInterceptor.requestParam; + assertThat(headerValue).isNotNull(); + List requestHeaders = + Arrays.stream(headerValue.split(SPLIT_TOKEN)).collect(Collectors.toList()); + List expectedHeaders = ImmutableList.of("header=potato", "routing_id=potato"); + assertThat(requestHeaders).containsExactlyElementsIn(expectedHeaders); + } + + @Test + void testGrpc_matchesOtherHeaderName() { + grpcClient.echo(EchoRequest.newBuilder().setOtherHeader("instances/456").build()); + String headerValue = grpcInterceptor.metadata.get(REQUEST_PARAMS_HEADER_KEY); + assertThat(headerValue).isNotNull(); + List requestHeaders = + Arrays.stream(headerValue.split(SPLIT_TOKEN)).collect(Collectors.toList()); + List expectedHeaders = ImmutableList.of("baz=instances%2F456"); + assertThat(requestHeaders).containsExactlyElementsIn(expectedHeaders); + } + + @Test + void testHttpJson_matchesOtherHeaderName() { + httpJsonClient.echo(EchoRequest.newBuilder().setOtherHeader("instances/456").build()); + String headerValue = httpJsonInterceptor.requestParam; + assertThat(headerValue).isNotNull(); + List requestHeaders = + Arrays.stream(headerValue.split(SPLIT_TOKEN)).collect(Collectors.toList()); + List expectedHeaders = ImmutableList.of("baz=instances%2F456"); + assertThat(requestHeaders).containsExactlyElementsIn(expectedHeaders); + } + + @Test + void testGrpc_matchesMultipleOfSameRoutingHeader_usesHeader() { + grpcClient.echo(EchoRequest.newBuilder().setHeader("projects/123/instances/456").build()); + String headerValue = grpcInterceptor.metadata.get(REQUEST_PARAMS_HEADER_KEY); + assertThat(headerValue).isNotNull(); + List requestHeaders = + Arrays.stream(headerValue.split(SPLIT_TOKEN)).collect(Collectors.toList()); + List expectedHeaders = + ImmutableList.of( + "header=projects%2F123%2Finstances%2F456", + "routing_id=projects%2F123%2Finstances%2F456", + "super_id=projects%2F123", + "table_name=projects%2F123%2Finstances%2F456", + "instance_id=instances%2F456"); + assertThat(requestHeaders).containsExactlyElementsIn(expectedHeaders); + } + + @Test + void testHttpJson_matchesMultipleOfSameRoutingHeader_usesHeader() { + httpJsonClient.echo(EchoRequest.newBuilder().setHeader("projects/123/instances/456").build()); + String headerValue = httpJsonInterceptor.requestParam; + assertThat(headerValue).isNotNull(); + List requestHeaders = + Arrays.stream(headerValue.split(SPLIT_TOKEN)).collect(Collectors.toList()); + List expectedHeaders = + ImmutableList.of( + "header=projects%2F123%2Finstances%2F456", + "routing_id=projects%2F123%2Finstances%2F456", + "super_id=projects%2F123", + "table_name=projects%2F123%2Finstances%2F456", + "instance_id=instances%2F456"); + assertThat(requestHeaders).containsExactlyElementsIn(expectedHeaders).inOrder(); + } + + @Test + void testGrpc_matchesMultipleOfSameRoutingHeader_usesOtherHeader() { + grpcClient.echo(EchoRequest.newBuilder().setOtherHeader("projects/123/instances/456").build()); + String headerValue = grpcInterceptor.metadata.get(REQUEST_PARAMS_HEADER_KEY); + assertThat(headerValue).isNotNull(); + List requestHeaders = + Arrays.stream(headerValue.split(SPLIT_TOKEN)).collect(Collectors.toList()); + List expectedHeaders = + ImmutableList.of("baz=projects%2F123%2Finstances%2F456", "qux=projects%2F123"); + assertThat(requestHeaders).containsExactlyElementsIn(expectedHeaders); + } + + @Test + void testHttpJson_matchesMultipleOfSameRoutingHeader_usesOtherHeader() { + httpJsonClient.echo( + EchoRequest.newBuilder().setOtherHeader("projects/123/instances/456").build()); + String headerValue = httpJsonInterceptor.requestParam; + assertThat(headerValue).isNotNull(); + List requestHeaders = + Arrays.stream(headerValue.split(SPLIT_TOKEN)).collect(Collectors.toList()); + List expectedHeaders = + ImmutableList.of("baz=projects%2F123%2Finstances%2F456", "qux=projects%2F123"); + assertThat(requestHeaders).containsExactlyElementsIn(expectedHeaders); + } + + @Test + void testGrpc_matchesMultipleRoutingHeaders() { + grpcClient.echo( + EchoRequest.newBuilder() + .setHeader("regions/123/zones/456") + .setOtherHeader("projects/123/instances/456") + .build()); + String headerValue = grpcInterceptor.metadata.get(REQUEST_PARAMS_HEADER_KEY); + assertThat(headerValue).isNotNull(); + List requestHeaders = + Arrays.stream(headerValue.split(SPLIT_TOKEN)).collect(Collectors.toList()); + List expectedHeaders = + ImmutableList.of( + "baz=projects%2F123%2Finstances%2F456", + "qux=projects%2F123", + "table_name=regions%2F123%2Fzones%2F456", + "header=regions%2F123%2Fzones%2F456", + "routing_id=regions%2F123%2Fzones%2F456"); + assertThat(requestHeaders).containsExactlyElementsIn(expectedHeaders); + } + + @Test + void testHttpJson_matchesMultipleRoutingHeaders() { + httpJsonClient.echo( + EchoRequest.newBuilder() + .setHeader("regions/123/zones/456") + .setOtherHeader("projects/123/instances/456") + .build()); + String headerValue = httpJsonInterceptor.requestParam; + assertThat(headerValue).isNotNull(); + List requestHeaders = + Arrays.stream(headerValue.split(SPLIT_TOKEN)).collect(Collectors.toList()); + List expectedHeaders = + ImmutableList.of( + "baz=projects%2F123%2Finstances%2F456", + "qux=projects%2F123", + "table_name=regions%2F123%2Fzones%2F456", + "header=regions%2F123%2Fzones%2F456", + "routing_id=regions%2F123%2Fzones%2F456"); + assertThat(requestHeaders).containsExactlyElementsIn(expectedHeaders); + } +} diff --git a/java-showcase-3.21.0/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/ITEndpointContext.java b/java-showcase-3.21.0/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/ITEndpointContext.java new file mode 100644 index 0000000000..0f50051b68 --- /dev/null +++ b/java-showcase-3.21.0/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/ITEndpointContext.java @@ -0,0 +1,469 @@ +package com.google.showcase.v1beta1.it; + +import static org.junit.jupiter.api.Assertions.assertThrows; + +import com.google.api.gax.core.CredentialsProvider; +import com.google.api.gax.core.NoCredentialsProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.UnauthenticatedException; +import com.google.auth.Credentials; +import com.google.auth.oauth2.GoogleCredentials; +import com.google.common.truth.Truth; +import com.google.showcase.v1beta1.EchoClient; +import com.google.showcase.v1beta1.EchoRequest; +import com.google.showcase.v1beta1.EchoSettings; +import com.google.showcase.v1beta1.it.util.TestClientInitializer; +import com.google.showcase.v1beta1.stub.EchoStub; +import com.google.showcase.v1beta1.stub.EchoStubSettings; +import io.grpc.ManagedChannelBuilder; +import java.io.IOException; +import java.net.URI; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.concurrent.TimeUnit; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.Test; + +/** + * This IT tests the different user configurations allowed and their effects on endpoint and + * universe domain resolution. + * + *

        In these tests, the client is not initialized with the default configuration: + * `EchoClient.create()`. For showcase tests run in CI, the client must be supplied explicitly + * supplied with a Credentials value. The tests use a wrapped Credentials and Credentials Provider + * (UniverseDomainCredentials and UniverseDomainCredentialsProvider) which allow for testing this. + * + *

        Endpoint resolution has the same behavior for both gRPC and HttpJson. The showcase tests below + * only use the gRPC transport for testing. HttpJson functionality exists inside the wrapper + * classes, but is not being used. + */ +class ITEndpointContext { + /** + * Inside the test cases below, we must explicitly configure serviceName. Normally this should not + * be configured at all, but showcase clients do not have a serviceName. The ExtendStubSettings + * wrapper return the serviceName by overriding the `getServiceName()` result. + */ + private static class ExtendedEchoStubSettings extends EchoStubSettings { + + private static final String DUMMY_MTLS_ENDPOINT = "mtls.googleapis.com:443"; + + protected ExtendedEchoStubSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + } + + @Override + public String getServiceName() { + return "test"; + } + + public static ExtendedEchoStubSettings.Builder newBuilder() { + return ExtendedEchoStubSettings.Builder.createDefault(); + } + + public static ExtendedEchoStubSettings.Builder newHttpJsonBuilder() { + return ExtendedEchoStubSettings.Builder.createHttpJsonDefault(); + } + + public static class Builder extends EchoStubSettings.Builder { + + protected Builder(ClientContext clientContext) { + super(clientContext); + } + + private static ExtendedEchoStubSettings.Builder createDefault() { + Builder builder = new Builder(((ClientContext) null)); + builder.setTransportChannelProvider(defaultTransportChannelProvider()); + builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); + builder.setInternalHeaderProvider(defaultApiClientHeaderProviderBuilder().build()); + builder.setMtlsEndpoint(DUMMY_MTLS_ENDPOINT); + builder.setSwitchToMtlsEndpointAllowed(true); + return builder; + } + + private static ExtendedEchoStubSettings.Builder createHttpJsonDefault() { + Builder builder = new Builder(((ClientContext) null)); + builder.setTransportChannelProvider(defaultHttpJsonTransportProviderBuilder().build()); + builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); + builder.setInternalHeaderProvider(defaultApiClientHeaderProviderBuilder().build()); + builder.setMtlsEndpoint(DUMMY_MTLS_ENDPOINT); + builder.setSwitchToMtlsEndpointAllowed(true); + return builder; + } + + @Override + public ExtendedEchoStubSettings build() throws IOException { + return new ExtendedEchoStubSettings(this); + } + } + } + + /** + * Without this ClientSettings wrapper, we must expose a serviceName setter to + * (Client|Stub)Settings and pass the StubSettings to the client. However, this will result in a + * null ClientSettings (See {@link EchoClient#create(EchoStub)}). Passing the stub to the Client + * will result in a NPE when doing `Client.getSettings().get(Endpoint|UniverseDomain)` as the + * ClientSettings is stored as null. + */ + private static class ExtendedEchoSettings extends EchoSettings { + + protected ExtendedEchoSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + } + + public static EchoSettings.Builder newBuilder() { + return ExtendedEchoSettings.Builder.createDefault(); + } + + public static EchoSettings.Builder newHttpJsonBuilder() { + return ExtendedEchoSettings.Builder.createHttpJsonDefault(); + } + + public static class Builder extends EchoSettings.Builder { + protected Builder() throws IOException {} + + private static ExtendedEchoSettings.Builder createDefault() { + return new ExtendedEchoSettings.Builder(ExtendedEchoStubSettings.newBuilder()); + } + + private static ExtendedEchoSettings.Builder createHttpJsonDefault() { + return new ExtendedEchoSettings.Builder(ExtendedEchoStubSettings.newHttpJsonBuilder()); + } + + protected Builder(ClientContext clientContext) { + super(clientContext); + } + + protected Builder(EchoSettings settings) { + super(settings); + } + + protected Builder(ExtendedEchoStubSettings.Builder stubSettings) { + super(stubSettings); + } + } + } + + /** + * Credentials Wrapper for showcase testing which is used to override the Universe Domain value. + * + *

        For the tests below, it will act as a valid Credentials and is used to test the flows where + * the user passes in a Credentials (i.e. ServiceAccount, AccessToken, Oauth, etc.) + */ + private static class UniverseDomainCredentials extends Credentials { + + private final String universeDomain; + + private UniverseDomainCredentials(String universeDomain) { + this.universeDomain = universeDomain; + } + + @Override + public String getAuthenticationType() { + return null; + } + + @Override + public Map> getRequestMetadata(URI uri) { + return new HashMap<>(); + } + + @Override + public boolean hasRequestMetadata() { + return false; + } + + @Override + public boolean hasRequestMetadataOnly() { + return false; + } + + @Override + public void refresh() { + // no-op + } + + @Override + public String getUniverseDomain() { + return universeDomain; + } + } + + /** + * CredentialsProvider wrapper to return the wrapped Universe Domain Credentials. This will return + * the custom Universe Domain value. + */ + private static class UniverseDomainCredentialsProvider implements CredentialsProvider { + + private final String universeDomain; + + public UniverseDomainCredentialsProvider(String universeDomain) { + this.universeDomain = universeDomain; + } + + public static UniverseDomainCredentialsProvider create() { + return new UniverseDomainCredentialsProvider(GoogleCredentials.GOOGLE_DEFAULT_UNIVERSE); + } + + public static UniverseDomainCredentialsProvider create(String universeDomain) { + return new UniverseDomainCredentialsProvider(universeDomain); + } + + @Override + public Credentials getCredentials() { + return new UniverseDomainCredentials(universeDomain); + } + } + + private static final String DEFAULT_ENDPOINT = "test.googleapis.com:443"; + private static final EchoRequest DEFAULT_REQUEST = + EchoRequest.newBuilder().setContent("echo").build(); + + private EchoClient echoClient; + + @AfterEach + void cleanup() throws InterruptedException { + if (echoClient != null) { + echoClient.close(); + echoClient.awaitTermination( + TestClientInitializer.AWAIT_TERMINATION_SECONDS, TimeUnit.SECONDS); + } + } + + // Default (no configuration) + @Test + void endpointResolution_default() throws IOException { + EchoSettings echoSettings = + ExtendedEchoSettings.newBuilder() + .setCredentialsProvider(UniverseDomainCredentialsProvider.create()) + .build(); + echoClient = EchoClient.create(echoSettings); + Truth.assertThat(echoClient.getSettings().getEndpoint()).isEqualTo(DEFAULT_ENDPOINT); + Truth.assertThat(echoClient.getSettings().getUniverseDomain()) + .isEqualTo(GoogleCredentials.GOOGLE_DEFAULT_UNIVERSE); + } + + // User configuration + @Test + void endpointResolution_userSetEndpoint() throws IOException { + String customEndpoint = "test.com:123"; + EchoSettings echoSettings = + ExtendedEchoSettings.newBuilder() + .setCredentialsProvider(UniverseDomainCredentialsProvider.create()) + .setEndpoint(customEndpoint) + .build(); + echoClient = EchoClient.create(echoSettings); + Truth.assertThat(echoClient.getSettings().getEndpoint()).isEqualTo(customEndpoint); + Truth.assertThat(echoClient.getSettings().getUniverseDomain()) + .isEqualTo(GoogleCredentials.GOOGLE_DEFAULT_UNIVERSE); + } + + @Test + void endpointResolution_userSetUniverseDomainAndNoUserSetEndpoint() throws IOException { + String customUniverseDomain = "random.com"; + EchoSettings echoSettings = + ExtendedEchoSettings.newBuilder() + .setCredentialsProvider(UniverseDomainCredentialsProvider.create()) + .setUniverseDomain(customUniverseDomain) + .build(); + echoClient = EchoClient.create(echoSettings); + // If user configured the universe domain, the endpoint is constructed from it + Truth.assertThat(echoClient.getSettings().getEndpoint()).isEqualTo("test.random.com:443"); + Truth.assertThat(echoClient.getSettings().getUniverseDomain()).isEqualTo(customUniverseDomain); + } + + @Test + void endpointResolution_userSetEndpointAndUniverseDomain() throws IOException { + String customEndpoint = "custom.endpoint.com:443"; + String customUniverseDomain = "random.com"; + EchoSettings echoSettings = + ExtendedEchoSettings.newBuilder() + .setCredentialsProvider(UniverseDomainCredentialsProvider.create()) + .setEndpoint(customEndpoint) + .setUniverseDomain(customUniverseDomain) + .build(); + echoClient = EchoClient.create(echoSettings); + // Custom Endpoint sets the endpoint for the client to use + Truth.assertThat(echoClient.getSettings().getEndpoint()).isEqualTo(customEndpoint); + // The universe domain doesn't match the endpoint. The call will fail validation when RPC is + // called. + Truth.assertThat(echoClient.getSettings().getUniverseDomain()).isEqualTo(customUniverseDomain); + } + + @Test + void universeDomainValidation_credentialsGDU_noUserConfiguration() throws IOException { + EchoSettings echoSettings = + ExtendedEchoSettings.newBuilder() + .setCredentialsProvider(UniverseDomainCredentialsProvider.create()) + .setEndpoint(TestClientInitializer.DEFAULT_GRPC_ENDPOINT) + .setTransportChannelProvider( + EchoSettings.defaultGrpcTransportProviderBuilder() + .setChannelConfigurator(ManagedChannelBuilder::usePlaintext) + .build()) + .build(); + echoClient = EchoClient.create(echoSettings); + + // Does not throw an error + echoClient.echo(DEFAULT_REQUEST); + } + + @Test + void universeDomainValidation_credentialsNonGDU_noUserConfiguration() throws IOException { + EchoSettings echoSettings = + ExtendedEchoSettings.newBuilder() + .setCredentialsProvider(UniverseDomainCredentialsProvider.create("random.com")) + .setEndpoint(TestClientInitializer.DEFAULT_GRPC_ENDPOINT) + .setTransportChannelProvider( + EchoSettings.defaultGrpcTransportProviderBuilder() + .setChannelConfigurator(ManagedChannelBuilder::usePlaintext) + .build()) + .build(); + echoClient = EchoClient.create(echoSettings); + + UnauthenticatedException exception = + assertThrows(UnauthenticatedException.class, () -> echoClient.echo(DEFAULT_REQUEST)); + Truth.assertThat(exception.getMessage()) + .contains( + "The configured universe domain (googleapis.com) does not match the universe domain" + + " found in the credentials (random.com)."); + } + + @Test + void universeDomainValidation_credentialsNonGDUMatchesUserConfiguration() throws IOException { + String universeDomain = "random.com"; + EchoSettings echoSettings = + ExtendedEchoSettings.newBuilder() + .setCredentialsProvider(UniverseDomainCredentialsProvider.create(universeDomain)) + .setEndpoint(TestClientInitializer.DEFAULT_GRPC_ENDPOINT) + .setUniverseDomain(universeDomain) + .setTransportChannelProvider( + EchoSettings.defaultGrpcTransportProviderBuilder() + .setChannelConfigurator(ManagedChannelBuilder::usePlaintext) + .build()) + .build(); + echoClient = EchoClient.create(echoSettings); + + // Does not throw an error + echoClient.echo(DEFAULT_REQUEST); + } + + @Test + void universeDomainValidation_credentialsNonGDUDoesNotMatchUserConfiguration() + throws IOException { + String universeDomain = "random.com"; + String userConfigurationUniverseDomain = "test.com"; + EchoSettings echoSettings = + ExtendedEchoSettings.newBuilder() + .setCredentialsProvider(UniverseDomainCredentialsProvider.create(universeDomain)) + .setEndpoint(TestClientInitializer.DEFAULT_GRPC_ENDPOINT) + .setUniverseDomain(userConfigurationUniverseDomain) + .setTransportChannelProvider( + EchoSettings.defaultGrpcTransportProviderBuilder() + .setChannelConfigurator(ManagedChannelBuilder::usePlaintext) + .build()) + .build(); + echoClient = EchoClient.create(echoSettings); + + UnauthenticatedException exception = + assertThrows(UnauthenticatedException.class, () -> echoClient.echo(DEFAULT_REQUEST)); + Truth.assertThat(exception.getMessage()) + .contains( + "The configured universe domain (test.com) does not match the universe domain found in" + + " the credentials (random.com)."); + } + + // This test uses NoCredentialsProvider (will default to GDU) + @Test + void universeDomainValidation_noCredentials_noUserSetUniverseDomain() throws IOException { + EchoSettings echoSettings = + ExtendedEchoSettings.newBuilder() + .setCredentialsProvider(NoCredentialsProvider.create()) + .setEndpoint(TestClientInitializer.DEFAULT_GRPC_ENDPOINT) + .setTransportChannelProvider( + EchoSettings.defaultGrpcTransportProviderBuilder() + .setChannelConfigurator(ManagedChannelBuilder::usePlaintext) + .build()) + .build(); + echoClient = EchoClient.create(echoSettings); + + // Does not throw an error + echoClient.echo(DEFAULT_REQUEST); + } + + // This test uses NoCredentialsProvider (will default to GDU) + @Test + void universeDomainValidation_noCredentials_userSetUniverseDomain() throws IOException { + String universeDomain = "random.com"; + EchoSettings echoSettings = + ExtendedEchoSettings.newBuilder() + .setCredentialsProvider(NoCredentialsProvider.create()) + .setEndpoint(TestClientInitializer.DEFAULT_GRPC_ENDPOINT) + .setUniverseDomain(universeDomain) + .setTransportChannelProvider( + EchoSettings.defaultGrpcTransportProviderBuilder() + .setChannelConfigurator(ManagedChannelBuilder::usePlaintext) + .build()) + .build(); + echoClient = EchoClient.create(echoSettings); + + UnauthenticatedException exception = + assertThrows(UnauthenticatedException.class, () -> echoClient.echo(DEFAULT_REQUEST)); + Truth.assertThat(exception.getMessage()) + .contains( + "The configured universe domain (random.com) does not match the universe domain found" + + " in the credentials (googleapis.com)."); + } + + // Default in Builder (no configuration) + @Test + void endpointResolution_defaultViaBuilder() { + EchoSettings.Builder echoSettingsBuilder = EchoSettings.newBuilder(); + // `StubSettings.newBuilder()` will return the clientSettingsEndpoint + Truth.assertThat(echoSettingsBuilder.getEndpoint()).isEqualTo(null); + } + + // User configuration in Builder + @Test + void endpointResolution_userConfigurationViaBuilder() { + EchoSettings.Builder echoSettingsBuilder = + EchoSettings.newBuilder().setEndpoint("test.com:123"); + // `StubSettings.newBuilder()` will return the clientSettingsEndpoint + Truth.assertThat(echoSettingsBuilder.getEndpoint()).isEqualTo("test.com:123"); + } + + @Test + void endpointResolution_builderBuilderBackToBuilder() throws IOException { + String customEndpoint = "test.com:123"; + EchoStubSettings.Builder echoStubSettingsBuilder = + EchoStubSettings.newBuilder().setEndpoint(customEndpoint); + // `StubSettings.newBuilder()` will return the clientSettingsEndpoint + Truth.assertThat(echoStubSettingsBuilder.getEndpoint()).isEqualTo(customEndpoint); + + // EndpointContext is recomputed when the Builder is re-built + EchoStubSettings echoStubSettings = echoStubSettingsBuilder.build(); + Truth.assertThat(echoStubSettings.getEndpoint()).isEqualTo(customEndpoint); + + // Calling toBuilder on StubSettings keeps the configurations the same + echoStubSettingsBuilder = echoStubSettings.toBuilder(); + Truth.assertThat(echoStubSettingsBuilder.getEndpoint()).isEqualTo(customEndpoint); + } + + @Test + void universeDomainValidation_quotaProjectId_credentialsNonGDUMatchesUserConfiguration() + throws IOException { + String universeDomain = "random.com"; + EchoSettings echoSettings = + ExtendedEchoSettings.newBuilder() + .setQuotaProjectId("exampleProject") + .setCredentialsProvider(UniverseDomainCredentialsProvider.create(universeDomain)) + .setEndpoint(TestClientInitializer.DEFAULT_GRPC_ENDPOINT) + .setUniverseDomain(universeDomain) + .setTransportChannelProvider( + EchoSettings.defaultGrpcTransportProviderBuilder() + .setChannelConfigurator(ManagedChannelBuilder::usePlaintext) + .build()) + .build(); + echoClient = EchoClient.create(echoSettings); + Truth.assertThat(echoClient.echo(DEFAULT_REQUEST).getContent()).isEqualTo("echo"); + } +} diff --git a/java-showcase-3.21.0/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/ITGdch.java b/java-showcase-3.21.0/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/ITGdch.java new file mode 100644 index 0000000000..f043d45cfc --- /dev/null +++ b/java-showcase-3.21.0/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/ITGdch.java @@ -0,0 +1,224 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.it; + +import static com.google.common.truth.Truth.assertThat; +import static com.google.common.truth.Truth.assertWithMessage; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotSame; +import static org.junit.jupiter.api.Assertions.assertThrows; +import static org.junit.jupiter.api.Assertions.assertTrue; + +import com.google.api.client.json.GenericJson; +import com.google.api.client.json.JsonFactory; +import com.google.api.client.json.gson.GsonFactory; +import com.google.api.gax.core.FixedCredentialsProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.auth.Credentials; +import com.google.auth.oauth2.GdchCredentials; +import com.google.auth.oauth2.GdchCredentialsTestUtil; +import com.google.showcase.v1beta1.EchoClient; +import com.google.showcase.v1beta1.EchoSettings; +import com.google.showcase.v1beta1.it.util.InterceptingMockTokenServerTransportFactory; +import com.google.showcase.v1beta1.it.util.TestClientInitializer; +import com.google.showcase.v1beta1.stub.EchoStubSettings; +import java.io.File; +import java.io.FileWriter; +import java.io.IOException; +import java.io.InputStream; +import java.net.URI; +import java.nio.file.Files; +import java.nio.file.Path; +import java.nio.file.StandardCopyOption; +import java.util.concurrent.TimeUnit; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.io.TempDir; + +/** + * Test suite to confirm a client can be instantiated with GDCH credentials. No calls are made since + * it is not feasible to test against real GDCH servers (or replicate an environment) + */ +class ITGdch { + + private static final String CA_CERT_FILENAME = "fake_cert.pem"; + private static final String CA_CERT_RESOURCE_PATH = "/" + CA_CERT_FILENAME; + private static final String CA_CERT_JSON_KEY = "ca_cert_path"; + private static final String GDCH_CREDENTIAL_FILENAME = "test_gdch_credential.json"; + private static final String GDCH_CREDENTIAL_RESOURCE_PATH = "/" + GDCH_CREDENTIAL_FILENAME; + private static final String GDCH_TOKEN_STRING = "1/MkSJoj1xsli0AccessToken_NKPY2"; + private static final String SID_NAME = "service-identity-name"; + + private EchoClient client; + private EchoSettings settings; + private EchoStubSettings stubSettings; + private Credentials initialCredentials; + private ClientContext context; + private InterceptingMockTokenServerTransportFactory transportFactory; + private String projectId; + private URI tokenUri; + + @BeforeEach + void setup(@TempDir Path tempDir) throws IOException { + transportFactory = new InterceptingMockTokenServerTransportFactory(); + prepareCredentials(tempDir); + settings = + EchoSettings.newBuilder() + .setCredentialsProvider(FixedCredentialsProvider.create(initialCredentials)) + .build(); + } + + @AfterEach + void tearDown() throws InterruptedException { + if (client != null) { + client.close(); + client.awaitTermination(TestClientInitializer.AWAIT_TERMINATION_SECONDS, TimeUnit.SECONDS); + } + } + + private void prepareCredentials(Path tempDir) throws IOException { + // Copy file so it can be referenced by Path even in native-image builds + File caCertFile = new File(tempDir.toFile(), CA_CERT_FILENAME); + try (InputStream inputStream = getClass().getResourceAsStream(CA_CERT_RESOURCE_PATH)) { + assertThat(inputStream).isNotNull(); + Files.copy(inputStream, caCertFile.toPath(), StandardCopyOption.REPLACE_EXISTING); + } + assertWithMessage(caCertFile.toPath() + " should exist").that(caCertFile.exists()).isTrue(); + + // open gdch credential json (still needs its "ca_cert_path" to point to the CA certificate + // obtained from above) + JsonFactory factory = new GsonFactory(); + GenericJson converted = + factory.fromInputStream( + getClass().getResourceAsStream(GDCH_CREDENTIAL_RESOURCE_PATH), GenericJson.class); + + // modify and save to a temporary folder + converted.set(CA_CERT_JSON_KEY, caCertFile.toPath().toAbsolutePath().toString()); + projectId = converted.get("project").toString(); + tokenUri = URI.create(converted.get("token_uri").toString()); + + File tempGdchCredentialFile = new File(tempDir.toFile(), GDCH_CREDENTIAL_FILENAME); + try (FileWriter fileWriter = new FileWriter(tempGdchCredentialFile)) { + String preparedJson = converted.toPrettyString(); + fileWriter.write(preparedJson); + } + + // use temp location to instantiate credentials + initialCredentials = GdchCredentialsTestUtil.fromJson(converted, transportFactory); + } + + /** + * {@link com.google.api.gax.rpc.ClientContext} will create a new {@link GdchCredentials} with an + * audience defaulted to the endpoint if the audience is not manually passed. This test confirms + * that a new credential is created from the context and can be refreshed + * + * @throws IOException + */ + @Test + void testCreateClient_withGdchCredentialAndNoAudience_defaultsToEndpointBasedAudience() + throws IOException { + + // we create the client as usual - no audience passed + String testEndpoint = "custom-endpoint:123"; + settings = settings.toBuilder().setEndpoint(testEndpoint).build(); + context = ClientContext.create(settings); + stubSettings = EchoStubSettings.newBuilder(context).build(); + client = EchoClient.create(stubSettings.createStub()); + + // We retrieve from context and from client + // the client has only access to creds provider, which may differ from the actual credentials + // used in the Context + Credentials fromContext = context.getCredentials(); + Credentials fromClient = initialCredentials; + + // Since ClientContext.create() uses a modified version of GdchCredentials + // via GdchCredentials.createWithGdchAudience(), they should be different objects + assertNotSame(fromContext, fromClient); + + // When credentials don't have an audience (such as the ones we passed to client creation and + // now stored in the + // provider) they will throw if we try to refresh them + NullPointerException expectedEx = + assertThrows(NullPointerException.class, () -> initialCredentials.refresh()); + assertTrue( + expectedEx.getMessage().contains("Audience are not configured for GDCH service account")); + + // However, the credentials prepared in ClientContext should be able to refresh since the + // audience would be + // internally defaulted the endpoint of the StubSettings + registerCredential(fromContext); + ((GdchCredentials) fromContext).refreshAccessToken(); + String usedAudience = transportFactory.transport.getLastAudienceSent(); + assertEquals(testEndpoint, usedAudience); + } + + /** + * Confirms creating a client with a valid audience is successful. We cannot confirm which + * audience is chosen (our passed audience or the endpoint) but this is confirmed in the unit + * tests. + * + * @throws IOException + */ + @Test + void testCreateClient_withGdchCredentialWithValidAudience_usesCredentialWithPassedAudience() + throws IOException { + + // Similar to the previous test, create a client as usual but this time we pass a explicit + // audience. It should + // be created without issues + String testAudience = "valid-audience"; + settings = + settings.toBuilder().setGdchApiAudience(testAudience).setEndpoint("localhost:7469").build(); + context = ClientContext.create(settings); + stubSettings = EchoStubSettings.newBuilder(context).build(); + client = EchoClient.create(stubSettings.createStub()); + + // We retrieve both creds from the creds provider and the ones prepared in the context (which + // should have been + // re-created using GdchCredentials.createWithAudience("valid-audience")) + Credentials fromContext = context.getCredentials(); + assertNotSame(fromContext, initialCredentials); + + // Again, since the initial credentials don't have an audience, we should not be able to refresh + // them + NullPointerException thrownByClientCreds = + assertThrows(NullPointerException.class, () -> initialCredentials.refresh()); + assertTrue( + thrownByClientCreds + .getMessage() + .contains("Audience are not configured for GDCH service account")); + + // But the credentials prepared in ClientContext should be able to refresh since the audience + // would be internally + // set to the one passed in stub settings + registerCredential(fromContext); + ((GdchCredentials) fromContext).refreshAccessToken(); + String usedAudience = transportFactory.transport.getLastAudienceSent(); + assertEquals(testAudience, usedAudience); + } + + private void registerCredential(Credentials fromContext) { + GdchCredentialsTestUtil.registerGdchCredentialWithMockTransport( + (GdchCredentials) fromContext, + transportFactory.transport, + projectId, + SID_NAME, + GDCH_TOKEN_STRING, + tokenUri); + } +} diff --git a/java-showcase-3.21.0/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/ITHttpAnnotation.java b/java-showcase-3.21.0/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/ITHttpAnnotation.java new file mode 100644 index 0000000000..0daf858d14 --- /dev/null +++ b/java-showcase-3.21.0/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/ITHttpAnnotation.java @@ -0,0 +1,145 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.showcase.v1beta1.it; + +import static com.google.common.truth.Truth.assertThat; + +import com.google.api.client.http.javanet.NetHttpTransport; +import com.google.api.gax.core.NoCredentialsProvider; +import com.google.common.collect.ImmutableMap; +import com.google.protobuf.util.JsonFormat; +import com.google.showcase.v1beta1.ComplianceClient; +import com.google.showcase.v1beta1.ComplianceData; +import com.google.showcase.v1beta1.ComplianceGroup; +import com.google.showcase.v1beta1.ComplianceSettings; +import com.google.showcase.v1beta1.ComplianceSuite; +import com.google.showcase.v1beta1.RepeatRequest; +import com.google.showcase.v1beta1.RepeatResponse; +import com.google.showcase.v1beta1.it.util.TestClientInitializer; +import java.io.IOException; +import java.io.InputStreamReader; +import java.nio.charset.StandardCharsets; +import java.security.GeneralSecurityException; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import java.util.concurrent.TimeUnit; +import java.util.function.Function; +import java.util.stream.Collectors; +import java.util.stream.Stream; +import org.junit.jupiter.api.AfterAll; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.Arguments; +import org.junit.jupiter.params.provider.MethodSource; + +// This test runs from the parameters in the compliance_suite.json file +// The file is downloaded from the gapic-showcase repo. Each compliance +// group is a set of HttpJson behaviors we want to test for. Each group +// tests the product of the rpc list and requests list. +class ITHttpAnnotation { + + static Stream data() { + return Stream.of( + Arguments.of("Fully working conversions, resources"), + Arguments.of("Binding selection testing"), + Arguments.of("Cases that apply to non-path requests"), + Arguments.of("Fully working conversions, no resources")); + } + + private static ComplianceClient httpjsonClient; + private static ComplianceSuite complianceSuite; + private static Map> validComplianceRpcMap; + + @BeforeAll + static void createClients() throws IOException, GeneralSecurityException { + ComplianceSuite.Builder builder = ComplianceSuite.newBuilder(); + JsonFormat.parser() + .merge( + new InputStreamReader( + Objects.requireNonNull( + ITHttpAnnotation.class + .getClassLoader() + .getResourceAsStream("compliance_suite.json")), + StandardCharsets.UTF_8), + builder); + complianceSuite = builder.build(); + + ComplianceSettings httpjsonComplianceSettings = + ComplianceSettings.newHttpJsonBuilder() + .setCredentialsProvider(NoCredentialsProvider.create()) + .setTransportChannelProvider( + ComplianceSettings.defaultHttpJsonTransportProviderBuilder() + .setHttpTransport( + new NetHttpTransport.Builder().doNotValidateCertificate().build()) + .setEndpoint("http://localhost:7469") + .build()) + .build(); + httpjsonClient = ComplianceClient.create(httpjsonComplianceSettings); + + // Mapping of Compliance Suite file RPC Names to ComplianceClient methods + validComplianceRpcMap = + ImmutableMap.of( + "Compliance.RepeatDataBody", + httpjsonClient::repeatDataBody, + "Compliance.RepeatDataBodyInfo", + httpjsonClient::repeatDataBodyInfo, + "Compliance.RepeatDataQuery", + httpjsonClient::repeatDataQuery, + "Compliance.RepeatDataSimplePath", + httpjsonClient::repeatDataSimplePath, + "Compliance.RepeatDataBodyPut", + httpjsonClient::repeatDataBodyPut, + "Compliance.RepeatDataBodyPatch", + httpjsonClient::repeatDataBodyPatch, + "Compliance.RepeatDataPathResource", + httpjsonClient::repeatDataPathResource); + } + + @AfterAll + static void destroyClients() throws InterruptedException { + httpjsonClient.close(); + httpjsonClient.awaitTermination( + TestClientInitializer.AWAIT_TERMINATION_SECONDS, TimeUnit.SECONDS); + } + + // Verify that the input's info is the same as the response's info + // This ensures that the entire group's behavior over HttpJson + // works as intended + @ParameterizedTest + @MethodSource("data") + void testComplianceGroup(String groupName) { + Optional complianceGroupOptional = + complianceSuite.getGroupList().stream() + .filter(x -> x.getName().equals(groupName)) + .findFirst(); + assertThat(complianceGroupOptional.isPresent()).isTrue(); + ComplianceGroup complianceGroup = complianceGroupOptional.get(); + List validRpcList = + complianceGroup.getRpcsList().stream() + .filter(validComplianceRpcMap::containsKey) + .collect(Collectors.toList()); + for (String rpcName : validRpcList) { + Function rpc = validComplianceRpcMap.get(rpcName); + for (RepeatRequest repeatRequest : complianceGroup.getRequestsList()) { + ComplianceData expectedData = repeatRequest.getInfo(); + RepeatResponse response = rpc.apply(repeatRequest); + assertThat(response.getRequest().getInfo()).isEqualTo(expectedData); + } + } + } +} diff --git a/java-showcase-3.21.0/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/ITIam.java b/java-showcase-3.21.0/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/ITIam.java new file mode 100644 index 0000000000..893eeb2679 --- /dev/null +++ b/java-showcase-3.21.0/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/ITIam.java @@ -0,0 +1,180 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.showcase.v1beta1.it; + +import static com.google.common.truth.Truth.assertThat; +import static org.junit.jupiter.api.Assertions.assertThrows; + +import com.google.api.gax.rpc.InvalidArgumentException; +import com.google.common.collect.ImmutableList; +import com.google.iam.v1.Binding; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.showcase.v1beta1.IdentityClient; +import com.google.showcase.v1beta1.it.util.TestClientInitializer; +import java.util.List; +import java.util.UUID; +import java.util.concurrent.TimeUnit; +import org.junit.jupiter.api.AfterAll; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; + +class ITIam { + private static final Policy DEFAULT_POLICY = + Policy.newBuilder() + .addBindings(Binding.newBuilder().setRole("foo.editor").addMembers("allUsers")) + .build(); + private static IdentityClient grpcClient; + private static IdentityClient httpjsonClient; + private String resourceName; + + @BeforeAll + static void createClients() throws Exception { + grpcClient = TestClientInitializer.createGrpcIdentityClient(); + httpjsonClient = TestClientInitializer.createHttpJsonIdentityClient(); + } + + @BeforeEach + void setupTests() { + resourceName = "users/" + UUID.randomUUID().toString().substring(0, 8); + } + + @AfterAll + public static void destroyClients() throws InterruptedException { + grpcClient.close(); + httpjsonClient.close(); + + grpcClient.awaitTermination(TestClientInitializer.AWAIT_TERMINATION_SECONDS, TimeUnit.SECONDS); + httpjsonClient.awaitTermination( + TestClientInitializer.AWAIT_TERMINATION_SECONDS, TimeUnit.SECONDS); + } + + @Test + void testGrpc_setIamPolicy() { + SetIamPolicyRequest policyRequest = + SetIamPolicyRequest.newBuilder() + .setPolicy(DEFAULT_POLICY) + .setResource(resourceName) + .build(); + Policy policy = grpcClient.setIamPolicy(policyRequest); + assertThat(policy).isEqualTo(DEFAULT_POLICY); + } + + @Test + void testHttpJson_setIamPolicy() { + SetIamPolicyRequest policyRequest = + SetIamPolicyRequest.newBuilder() + .setPolicy(DEFAULT_POLICY) + .setResource(resourceName) + .build(); + Policy policy = httpjsonClient.setIamPolicy(policyRequest); + assertThat(policy).isEqualTo(DEFAULT_POLICY); + } + + @Test + void testGrpc_getIamPolicy() { + SetIamPolicyRequest policyRequest = + SetIamPolicyRequest.newBuilder() + .setPolicy(DEFAULT_POLICY) + .setResource(resourceName) + .build(); + grpcClient.setIamPolicy(policyRequest); + + Policy policy = + grpcClient.getIamPolicy( + GetIamPolicyRequest.newBuilder().setResource(policyRequest.getResource()).build()); + assertThat(policy).isEqualTo(DEFAULT_POLICY); + } + + @Test + void testHttpJson_getIamPolicy() { + SetIamPolicyRequest policyRequest = + SetIamPolicyRequest.newBuilder() + .setPolicy(DEFAULT_POLICY) + .setResource(resourceName) + .build(); + httpjsonClient.setIamPolicy(policyRequest); + + Policy policy = + httpjsonClient.getIamPolicy( + GetIamPolicyRequest.newBuilder().setResource(policyRequest.getResource()).build()); + assertThat(policy).isEqualTo(DEFAULT_POLICY); + } + + @Test + void testGrpc_testIamPermissions() { + SetIamPolicyRequest policyRequest = + SetIamPolicyRequest.newBuilder() + .setPolicy(DEFAULT_POLICY) + .setResource(resourceName) + .build(); + grpcClient.setIamPolicy(policyRequest); + List permissions = ImmutableList.of("foo.create", "foo.write"); + TestIamPermissionsResponse testIamPermissionsResponse = + grpcClient.testIamPermissions( + TestIamPermissionsRequest.newBuilder() + .setResource(policyRequest.getResource()) + .addAllPermissions(permissions) + .build()); + // Showcase server will simply echo the request's Permissions List back + // if the resource exists and contains a policy + assertThat(testIamPermissionsResponse.getPermissionsList()) + .containsExactlyElementsIn(permissions); + } + + @Test + void testHttpJson_testIamPermissions() { + SetIamPolicyRequest policyRequest = + SetIamPolicyRequest.newBuilder() + .setPolicy(DEFAULT_POLICY) + .setResource(resourceName) + .build(); + httpjsonClient.setIamPolicy(policyRequest); + List permissions = ImmutableList.of("foo.create", "foo.write"); + TestIamPermissionsResponse testIamPermissionsResponse = + httpjsonClient.testIamPermissions( + TestIamPermissionsRequest.newBuilder() + .setResource(policyRequest.getResource()) + .addAllPermissions(permissions) + .build()); + // Showcase server will simply echo the request's Permissions List back + // if the resource exists and contains a policy + assertThat(testIamPermissionsResponse.getPermissionsList()) + .containsExactlyElementsIn(permissions); + } + + // The tests below simply assert that an exception is being thrown for an invalid request + // in both transports. Showcase's IAM backend service will throw a few exceptions for a few + // cases, and we simply assert that an exception has been thrown for a single case with a single + // RPC (No resource in the request for SetIamPolicy's RPC). + @Test + void testGrpc_iamThrowsException() { + SetIamPolicyRequest setIamPolicyRequest = SetIamPolicyRequest.newBuilder().build(); + assertThrows( + InvalidArgumentException.class, () -> grpcClient.setIamPolicy(setIamPolicyRequest)); + } + + @Test + void testHttpJson_iamThrowsException() { + SetIamPolicyRequest setIamPolicyRequest = SetIamPolicyRequest.newBuilder().build(); + assertThrows( + InvalidArgumentException.class, () -> httpjsonClient.setIamPolicy(setIamPolicyRequest)); + } +} diff --git a/java-showcase-3.21.0/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/ITLongRunningOperation.java b/java-showcase-3.21.0/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/ITLongRunningOperation.java new file mode 100644 index 0000000000..09208861ba --- /dev/null +++ b/java-showcase-3.21.0/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/ITLongRunningOperation.java @@ -0,0 +1,196 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.showcase.v1beta1.it; + +import static com.google.common.truth.Truth.assertThat; +import static org.junit.jupiter.api.Assertions.assertThrows; + +import com.google.api.gax.longrunning.OperationFuture; +import com.google.api.gax.retrying.RetrySettings; +import com.google.protobuf.Timestamp; +import com.google.showcase.v1beta1.EchoClient; +import com.google.showcase.v1beta1.WaitMetadata; +import com.google.showcase.v1beta1.WaitRequest; +import com.google.showcase.v1beta1.WaitResponse; +import com.google.showcase.v1beta1.it.util.TestClientInitializer; +import java.util.concurrent.CancellationException; +import java.util.concurrent.TimeUnit; +import org.junit.jupiter.api.Test; +import org.threeten.bp.Duration; +import org.threeten.bp.Instant; +import org.threeten.bp.temporal.ChronoUnit; + +/** + * For this test, we test a combination of various LRO RetrySettings and try to ensure that the + * calls are polling correctly. Each test attempts to test the number of attempts done in each call. + */ +class ITLongRunningOperation { + + @Test + void testGRPC_LROSuccessfulResponse_doesNotExceedTotalTimeout() throws Exception { + RetrySettings initialUnaryRetrySettings = + RetrySettings.newBuilder() + .setInitialRpcTimeout(Duration.ofMillis(3000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ofMillis(3000L)) + .setTotalTimeout(Duration.ofMillis(3000L)) + .build(); + RetrySettings pollingRetrySettings = + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(3000L)) + .setRetryDelayMultiplier(2.0) + .setMaxRetryDelay(Duration.ofMillis(5000L)) + .setTotalTimeout(Duration.ofMillis(10000L)) + .build(); + EchoClient grpcClient = + TestClientInitializer.createGrpcEchoClientCustomWaitSettings( + initialUnaryRetrySettings, pollingRetrySettings); + try { + long epochSecondsInFuture = Instant.now().plus(5, ChronoUnit.SECONDS).getEpochSecond(); + WaitRequest waitRequest = + WaitRequest.newBuilder() + .setSuccess(WaitResponse.newBuilder().setContent("gRPCWaitContent_5sDelay_noRetry")) + .setEndTime(Timestamp.newBuilder().setSeconds(epochSecondsInFuture).build()) + .build(); + OperationFuture operationFuture = + grpcClient.waitOperationCallable().futureCall(waitRequest); + WaitResponse waitResponse = operationFuture.get(); + assertThat(waitResponse.getContent()).isEqualTo("gRPCWaitContent_5sDelay_noRetry"); + int attemptCount = operationFuture.getPollingFuture().getAttemptSettings().getAttemptCount(); + assertThat(attemptCount).isAtLeast(2); + } finally { + grpcClient.close(); + grpcClient.awaitTermination( + TestClientInitializer.AWAIT_TERMINATION_SECONDS, TimeUnit.SECONDS); + } + } + + @Test + void testHttpJson_LROSuccessfulResponse_doesNotExceedTotalTimeout() throws Exception { + RetrySettings initialUnaryRetrySettings = + RetrySettings.newBuilder() + .setInitialRpcTimeout(Duration.ofMillis(3000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ofMillis(3000L)) + .setTotalTimeout(Duration.ofMillis(3000L)) + .build(); + RetrySettings pollingRetrySettings = + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(3000L)) + .setRetryDelayMultiplier(2.0) + .setMaxRetryDelay(Duration.ofMillis(5000L)) + .setTotalTimeout(Duration.ofMillis(10000L)) + .build(); + EchoClient httpjsonClient = + TestClientInitializer.createHttpJsonEchoClientCustomWaitSettings( + initialUnaryRetrySettings, pollingRetrySettings); + try { + long epochSecondsInFuture = Instant.now().plus(5, ChronoUnit.SECONDS).getEpochSecond(); + WaitRequest waitRequest = + WaitRequest.newBuilder() + .setSuccess( + WaitResponse.newBuilder().setContent("httpjsonWaitContent_5sDelay_noRetry")) + .setEndTime(Timestamp.newBuilder().setSeconds(epochSecondsInFuture).build()) + .build(); + OperationFuture operationFuture = + httpjsonClient.waitOperationCallable().futureCall(waitRequest); + WaitResponse waitResponse = operationFuture.get(); + assertThat(waitResponse.getContent()).isEqualTo("httpjsonWaitContent_5sDelay_noRetry"); + int attemptCount = operationFuture.getPollingFuture().getAttemptSettings().getAttemptCount(); + assertThat(attemptCount).isAtLeast(2); + } finally { + httpjsonClient.close(); + httpjsonClient.awaitTermination( + TestClientInitializer.AWAIT_TERMINATION_SECONDS, TimeUnit.SECONDS); + } + } + + @Test + void testGRPC_LROUnsuccessfulResponse_exceedsTotalTimeout_throwsDeadlineExceededException() + throws Exception { + RetrySettings initialUnaryRetrySettings = + RetrySettings.newBuilder() + .setInitialRpcTimeout(Duration.ofMillis(5000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ofMillis(5000L)) + .setTotalTimeout(Duration.ofMillis(5000L)) + .build(); + RetrySettings pollingRetrySettings = + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(1000L)) + .setRetryDelayMultiplier(2.0) + .setMaxRetryDelay(Duration.ofMillis(3000L)) + .setTotalTimeout(Duration.ofMillis(5000L)) + .build(); + EchoClient grpcClient = + TestClientInitializer.createGrpcEchoClientCustomWaitSettings( + initialUnaryRetrySettings, pollingRetrySettings); + try { + WaitRequest waitRequest = + WaitRequest.newBuilder() + .setSuccess(WaitResponse.newBuilder().setContent("httpjsonWaitContent_10sDelay")) + .setTtl(com.google.protobuf.Duration.newBuilder().setSeconds(10)) + .build(); + OperationFuture operationFuture = + grpcClient.waitOperationCallable().futureCall(waitRequest); + assertThrows(CancellationException.class, operationFuture::get); + int attemptCount = operationFuture.getPollingFuture().getAttemptSettings().getAttemptCount(); + assertThat(attemptCount).isGreaterThan(1); + } finally { + grpcClient.close(); + grpcClient.awaitTermination( + TestClientInitializer.AWAIT_TERMINATION_SECONDS, TimeUnit.SECONDS); + } + } + + @Test + void testHttpJson_LROUnsuccessfulResponse_exceedsTotalTimeout_throwsDeadlineExceededException() + throws Exception { + RetrySettings initialUnaryRetrySettings = + RetrySettings.newBuilder() + .setInitialRpcTimeout(Duration.ofMillis(500L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ofMillis(500L)) + .setTotalTimeout(Duration.ofMillis(500L)) + .build(); + RetrySettings pollingRetrySettings = + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(100L)) + .setRetryDelayMultiplier(2.0) + .setMaxRetryDelay(Duration.ofMillis(500L)) + .setTotalTimeout(Duration.ofMillis(1000L)) + .build(); + EchoClient httpjsonClient = + TestClientInitializer.createHttpJsonEchoClientCustomWaitSettings( + initialUnaryRetrySettings, pollingRetrySettings); + try { + WaitRequest waitRequest = + WaitRequest.newBuilder() + .setSuccess(WaitResponse.newBuilder().setContent("httpjsonWaitContent_10sDelay")) + .setTtl(com.google.protobuf.Duration.newBuilder().setSeconds(10)) + .build(); + OperationFuture operationFuture = + httpjsonClient.waitOperationCallable().futureCall(waitRequest); + assertThrows(CancellationException.class, operationFuture::get); + int attemptCount = operationFuture.getPollingFuture().getAttemptSettings().getAttemptCount(); + assertThat(attemptCount).isGreaterThan(1); + } finally { + httpjsonClient.close(); + httpjsonClient.awaitTermination( + TestClientInitializer.AWAIT_TERMINATION_SECONDS, TimeUnit.SECONDS); + } + } +} diff --git a/java-showcase-3.21.0/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/ITNumericEnums.java b/java-showcase-3.21.0/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/ITNumericEnums.java new file mode 100644 index 0000000000..76c54a803c --- /dev/null +++ b/java-showcase-3.21.0/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/ITNumericEnums.java @@ -0,0 +1,67 @@ +/* + * 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 + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.it; + +import static org.junit.jupiter.api.Assertions.assertEquals; + +import com.google.api.client.http.javanet.NetHttpTransport; +import com.google.api.gax.core.NoCredentialsProvider; +import com.google.showcase.v1beta1.ComplianceClient; +import com.google.showcase.v1beta1.ComplianceSettings; +import com.google.showcase.v1beta1.EnumRequest; +import com.google.showcase.v1beta1.EnumResponse; +import com.google.showcase.v1beta1.it.util.TestClientInitializer; +import java.io.IOException; +import java.security.GeneralSecurityException; +import java.util.concurrent.TimeUnit; +import org.junit.jupiter.api.AfterAll; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Test; + +class ITNumericEnums { + + private static ComplianceClient httpjsonClient; + + @BeforeAll + static void createClients() throws GeneralSecurityException, IOException { + ComplianceSettings complianceSettings = + ComplianceSettings.newHttpJsonBuilder() + .setCredentialsProvider(NoCredentialsProvider.create()) + .setTransportChannelProvider( + ComplianceSettings.defaultHttpJsonTransportProviderBuilder() + .setHttpTransport( + new NetHttpTransport.Builder().doNotValidateCertificate().build()) + .setEndpoint("http://localhost:7469") + .build()) + .build(); + httpjsonClient = ComplianceClient.create(complianceSettings); + } + + @AfterAll + static void destroyClients() throws InterruptedException { + httpjsonClient.close(); + httpjsonClient.awaitTermination( + TestClientInitializer.AWAIT_TERMINATION_SECONDS, TimeUnit.SECONDS); + } + + @Test + void verifyEnums() { + EnumRequest request = EnumRequest.newBuilder().setUnknownEnum(true).build(); + EnumResponse initialResponse = httpjsonClient.getEnum(request); + assertEquals(initialResponse, httpjsonClient.verifyEnum(initialResponse)); + } +} diff --git a/java-showcase-3.21.0/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/ITOtelMetrics.java b/java-showcase-3.21.0/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/ITOtelMetrics.java new file mode 100644 index 0000000000..ad973e4137 --- /dev/null +++ b/java-showcase-3.21.0/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/ITOtelMetrics.java @@ -0,0 +1,922 @@ +/* + * Copyright 2024 Google LLC + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Google LLC nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +package com.google.showcase.v1beta1.it; + +import static org.junit.Assert.assertThrows; + +import com.google.api.client.http.javanet.NetHttpTransport; +import com.google.api.core.ApiFunction; +import com.google.api.core.ApiFuture; +import com.google.api.gax.core.NoCredentialsProvider; +import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; +import com.google.api.gax.retrying.RetrySettings; +import com.google.api.gax.rpc.InvalidArgumentException; +import com.google.api.gax.rpc.StatusCode.Code; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.api.gax.rpc.UnavailableException; +import com.google.api.gax.tracing.MetricsTracer; +import com.google.api.gax.tracing.MetricsTracerFactory; +import com.google.api.gax.tracing.OpenTelemetryMetricsRecorder; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.ImmutableSet; +import com.google.common.truth.Truth; +import com.google.protobuf.Duration; +import com.google.rpc.Status; +import com.google.showcase.v1beta1.BlockRequest; +import com.google.showcase.v1beta1.BlockResponse; +import com.google.showcase.v1beta1.EchoClient; +import com.google.showcase.v1beta1.EchoRequest; +import com.google.showcase.v1beta1.EchoSettings; +import com.google.showcase.v1beta1.it.util.TestClientInitializer; +import com.google.showcase.v1beta1.stub.EchoStub; +import com.google.showcase.v1beta1.stub.EchoStubSettings; +import io.grpc.ManagedChannelBuilder; +import io.grpc.opentelemetry.GrpcOpenTelemetry; +import io.opentelemetry.api.OpenTelemetry; +import io.opentelemetry.api.common.AttributeKey; +import io.opentelemetry.api.common.Attributes; +import io.opentelemetry.sdk.OpenTelemetrySdk; +import io.opentelemetry.sdk.metrics.SdkMeterProvider; +import io.opentelemetry.sdk.metrics.data.Data; +import io.opentelemetry.sdk.metrics.data.HistogramPointData; +import io.opentelemetry.sdk.metrics.data.LongPointData; +import io.opentelemetry.sdk.metrics.data.MetricData; +import io.opentelemetry.sdk.metrics.data.PointData; +import io.opentelemetry.sdk.testing.exporter.InMemoryMetricReader; +import java.io.IOException; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Optional; +import java.util.Set; +import java.util.concurrent.ExecutionException; +import java.util.concurrent.TimeUnit; +import java.util.function.Predicate; +import java.util.stream.Collectors; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; + +/** + * Showcase Test to confirm that metrics are being collected and that the correct metrics are being + * recorded. Utilizes an in-memory metric reader to collect the data. + * + *

        Every test flows through the same way and runs through the same assertions. First, all th + * metrics are pulled in via {@link #getMetricDataList()} which are polled until all the metrics are + * collected. Then the test will attempt check that reader collected the correct number of data + * points in {@link #verifyPointDataSum(List, int)}. Then, check that the attributes to be collected + * via {@link #verifyStatusAttribute(List, List)}. Finally, check that the status for each attempt + * is correct. + */ +class ITOtelMetrics { + private static final int DEFAULT_OPERATION_COUNT = 1; + private static final String SERVICE_NAME = "ShowcaseTest"; + private static final String ATTEMPT_COUNT = SERVICE_NAME + "/attempt_count"; + private static final String OPERATION_COUNT = SERVICE_NAME + "/operation_count"; + private static final String ATTEMPT_LATENCY = SERVICE_NAME + "/attempt_latency"; + private static final String OPERATION_LATENCY = SERVICE_NAME + "/operation_latency"; + private static final Set GAX_METRICS = + ImmutableSet.of(ATTEMPT_COUNT, OPERATION_COUNT, ATTEMPT_LATENCY, OPERATION_LATENCY); + + // Gax provides four metrics by default. This number may change as new metrics are added. + private static final int NUM_GAX_OTEL_METRICS = 4; + private static final int NUM_DEFAULT_FLUSH_ATTEMPTS = 10; + + private InMemoryMetricReader inMemoryMetricReader; + private EchoClient grpcClient; + private EchoClient httpClient; + + /** + * Internal class in the Otel Showcases test used to assert that number of status codes recorded. + */ + private static class StatusCount { + private final Code statusCode; + private final int count; + + public StatusCount(Code statusCode) { + this(statusCode, 1); + } + + public StatusCount(Code statusCode, int count) { + this.statusCode = statusCode; + this.count = count; + } + + public Code getStatusCode() { + return statusCode; + } + + public int getCount() { + return count; + } + } + + private OpenTelemetryMetricsRecorder createOtelMetricsRecorder( + InMemoryMetricReader inMemoryMetricReader) { + SdkMeterProvider sdkMeterProvider = + SdkMeterProvider.builder().registerMetricReader(inMemoryMetricReader).build(); + + OpenTelemetry openTelemetry = + OpenTelemetrySdk.builder().setMeterProvider(sdkMeterProvider).build(); + return new OpenTelemetryMetricsRecorder(openTelemetry, SERVICE_NAME); + } + + @BeforeEach + void setup() throws Exception { + inMemoryMetricReader = InMemoryMetricReader.create(); + OpenTelemetryMetricsRecorder otelMetricsRecorder = + createOtelMetricsRecorder(inMemoryMetricReader); + grpcClient = + TestClientInitializer.createGrpcEchoClientOpentelemetry( + new MetricsTracerFactory(otelMetricsRecorder)); + httpClient = + TestClientInitializer.createHttpJsonEchoClientOpentelemetry( + new MetricsTracerFactory(otelMetricsRecorder)); + } + + @AfterEach + void cleanup() throws InterruptedException, IOException { + inMemoryMetricReader.close(); + inMemoryMetricReader.shutdown(); + + grpcClient.close(); + httpClient.close(); + + grpcClient.awaitTermination(TestClientInitializer.AWAIT_TERMINATION_SECONDS, TimeUnit.SECONDS); + httpClient.awaitTermination(TestClientInitializer.AWAIT_TERMINATION_SECONDS, TimeUnit.SECONDS); + } + + /** + * Iterate through all MetricData elements and check that the number of PointData values matches + * the expected value. A PointData element may have multiple values/ counts inside, so this + * extracts the value/ count from the PointData before summing. + * + *

        The expected sum for an operation is `1`. Expected sum for an attempt may be 1+. + */ + private void verifyPointDataSum(List metricDataList, int attemptCount) { + for (MetricData metricData : metricDataList) { + Data data = metricData.getData(); + List points = new ArrayList<>(data.getPoints()); + switch (metricData.getName()) { + case OPERATION_COUNT: + long operationCountSum = + points.stream().map(x -> ((LongPointData) x).getValue()).reduce(0L, Long::sum); + Truth.assertThat(operationCountSum).isEqualTo(DEFAULT_OPERATION_COUNT); + break; + case ATTEMPT_COUNT: + long attemptCountSum = + points.stream().map(x -> ((LongPointData) x).getValue()).reduce(0L, Long::sum); + Truth.assertThat(attemptCountSum).isEqualTo(attemptCount); + break; + case OPERATION_LATENCY: + long operationLatencyCountSum = + points.stream().map(x -> ((HistogramPointData) x).getCount()).reduce(0L, Long::sum); + // It is difficult to verify the actual latency values (operation or attempt) + // without flaky behavior. Test that the number of data points recorded matches. + Truth.assertThat(operationLatencyCountSum).isEqualTo(DEFAULT_OPERATION_COUNT); + break; + case ATTEMPT_LATENCY: + long attemptLatencyCountSum = + points.stream().map(x -> ((HistogramPointData) x).getCount()).reduce(0L, Long::sum); + // It is difficult to verify the actual latency values (operation or attempt) + // without flaky behavior. Test that the number of data points recorded matches. + Truth.assertThat(attemptLatencyCountSum).isEqualTo(attemptCount); + break; + default: + break; + } + } + } + + /** + * Extract the attributes from MetricData and ensures that default attributes are recorded. Uses + * the `OPERATION_COUNT` MetricData to test the attributes. The `OPERATION_COUNT` is only recorded + * once and should only have one element of PointData. + * + *

        Although the Status attribute is recorded by default on every operation, this helper method + * does not verify it. This is because every individual attempt (retry) may have a different + * status. {@link #verifyStatusAttribute(List, List)} is used to verify the statuses for every + * attempt. + */ + private void verifyDefaultMetricsAttributes( + List metricDataList, Map defaultAttributeMapping) { + Optional metricDataOptional = + metricDataList.stream().filter(x -> x.getName().equals(OPERATION_COUNT)).findAny(); + Truth.assertThat(metricDataOptional.isPresent()).isTrue(); + MetricData operationCountMetricData = metricDataOptional.get(); + + List pointDataList = new ArrayList<>(operationCountMetricData.getData().getPoints()); + // Operation Metrics should only have a 1 data point + Truth.assertThat(pointDataList.size()).isEqualTo(1); + Attributes recordedAttributes = pointDataList.get(0).getAttributes(); + Map, Object> recordedAttributesMap = recordedAttributes.asMap(); + for (Map.Entry entrySet : defaultAttributeMapping.entrySet()) { + String key = entrySet.getKey(); + String value = entrySet.getValue(); + AttributeKey stringAttributeKey = AttributeKey.stringKey(key); + Truth.assertThat(recordedAttributesMap.containsKey(stringAttributeKey)).isTrue(); + Truth.assertThat(recordedAttributesMap.get(stringAttributeKey)).isEqualTo(value); + } + } + + /** + * Extract the attributes from MetricData and ensures that default attributes are recorded. Uses + * the `ATTEMPT_COUNT` MetricData to test the attributes. The `ATTEMPT_COUNT` is recorded for + * every retry attempt and should record the status received that each attempt made. + */ + private void verifyStatusAttribute( + List metricDataList, List statusCountList) { + Optional metricDataOptional = + metricDataList.stream().filter(x -> x.getName().equals(ATTEMPT_COUNT)).findAny(); + Truth.assertThat(metricDataOptional.isPresent()).isTrue(); + MetricData attemptCountMetricData = metricDataOptional.get(); + + List pointDataList = new ArrayList<>(attemptCountMetricData.getData().getPoints()); + Truth.assertThat(pointDataList.size()).isEqualTo(statusCountList.size()); + + // The data for attempt count may not be ordered (i.e. the last data point recorded may be the + // first element in the PointData list). Search for the expected StatusCode from the + // statusCountList + // and match with the data inside the pointDataList + for (StatusCount statusCount : statusCountList) { + Code statusCode = statusCount.getStatusCode(); + Predicate pointDataPredicate = + x -> + x.getAttributes() + .get(AttributeKey.stringKey(MetricsTracer.STATUS_ATTRIBUTE)) + .equals(statusCode.toString()); + Optional pointDataOptional = + pointDataList.stream().filter(pointDataPredicate).findFirst(); + Truth.assertThat(pointDataOptional.isPresent()).isTrue(); + LongPointData longPointData = (LongPointData) pointDataOptional.get(); + Truth.assertThat(longPointData.getValue()).isEqualTo(statusCount.getCount()); + } + } + + /** Uses the default InMemoryMetricReader configured for showcase tests. */ + private List getMetricDataList() throws InterruptedException { + return getMetricDataList(inMemoryMetricReader); + } + + /** + * Attempts to retrieve the metrics from a custom InMemoryMetricsReader. Sleep every second for at + * most 10s to try and retrieve all the metrics available. If it is unable to retrieve all the + * metrics, fail the test. + */ + private List getMetricDataList(InMemoryMetricReader metricReader) + throws InterruptedException { + for (int i = 0; i < NUM_DEFAULT_FLUSH_ATTEMPTS; i++) { + Thread.sleep(1000L); + List metricData = new ArrayList<>(metricReader.collectAllMetrics()); + // Depending on the OpenTelemetry instance (i.e. OpenTelemetry, GrpcOpenTelemetry, etc.) + // there may be additional metrics recorded. Only check to ensure the Gax Metrics + // are recorded properly. Any additional metrics are fine to be passed. + if (metricData.size() >= NUM_GAX_OTEL_METRICS && areAllGaxMetricsRecorded(metricData)) { + return metricData; + } + } + Assertions.fail("Unable to collect all the GAX metrics required for the test"); + return new ArrayList<>(); + } + + private boolean areAllGaxMetricsRecorded(List metricData) { + return metricData.stream().filter(data -> GAX_METRICS.contains(data.getName())).count() + == NUM_GAX_OTEL_METRICS; + } + + @Test + void testGrpc_operationSucceeded_recordsMetrics() throws InterruptedException { + int attemptCount = 1; + EchoRequest echoRequest = + EchoRequest.newBuilder().setContent("test_grpc_operation_succeeded").build(); + grpcClient.echo(echoRequest); + + List actualMetricDataList = getMetricDataList(); + verifyPointDataSum(actualMetricDataList, attemptCount); + + Map expectedAttributes = + ImmutableMap.of( + MetricsTracer.METHOD_ATTRIBUTE, + "Echo.Echo", + MetricsTracer.LANGUAGE_ATTRIBUTE, + MetricsTracer.DEFAULT_LANGUAGE); + verifyDefaultMetricsAttributes(actualMetricDataList, expectedAttributes); + + List statusCountList = ImmutableList.of(new StatusCount(Code.OK)); + verifyStatusAttribute(actualMetricDataList, statusCountList); + } + + @Test + void testHttpJson_operationSucceeded_recordsMetrics() throws InterruptedException { + int attemptCount = 1; + EchoRequest echoRequest = EchoRequest.newBuilder().setContent("content").build(); + httpClient.echo(echoRequest); + + List actualMetricDataList = getMetricDataList(); + verifyPointDataSum(actualMetricDataList, attemptCount); + + Map expectedAttributes = + ImmutableMap.of( + MetricsTracer.METHOD_ATTRIBUTE, + "Echo.Echo", + MetricsTracer.LANGUAGE_ATTRIBUTE, + MetricsTracer.DEFAULT_LANGUAGE); + verifyDefaultMetricsAttributes(actualMetricDataList, expectedAttributes); + + List statusCountList = ImmutableList.of(new StatusCount(Code.OK)); + verifyStatusAttribute(actualMetricDataList, statusCountList); + } + + @Test + void testGrpc_operationCancelled_recordsMetrics() throws Exception { + int attemptCount = 1; + BlockRequest blockRequest = + BlockRequest.newBuilder() + .setResponseDelay(Duration.newBuilder().setSeconds(5)) + .setSuccess(BlockResponse.newBuilder().setContent("grpc_operationCancelled")) + .build(); + + UnaryCallable blockCallable = grpcClient.blockCallable(); + ApiFuture blockResponseApiFuture = blockCallable.futureCall(blockRequest); + // Sleep 1s before cancelling to let the request go through + Thread.sleep(1000); + blockResponseApiFuture.cancel(true); + + List actualMetricDataList = getMetricDataList(); + verifyPointDataSum(actualMetricDataList, attemptCount); + + Map expectedAttributes = + ImmutableMap.of( + MetricsTracer.METHOD_ATTRIBUTE, + "Echo.Block", + MetricsTracer.LANGUAGE_ATTRIBUTE, + MetricsTracer.DEFAULT_LANGUAGE); + verifyDefaultMetricsAttributes(actualMetricDataList, expectedAttributes); + + List statusCountList = ImmutableList.of(new StatusCount(Code.CANCELLED)); + verifyStatusAttribute(actualMetricDataList, statusCountList); + } + + @Test + void testHttpJson_operationCancelled_recordsMetrics() throws Exception { + int attemptCount = 1; + BlockRequest blockRequest = + BlockRequest.newBuilder().setResponseDelay(Duration.newBuilder().setSeconds(5)).build(); + + UnaryCallable blockCallable = httpClient.blockCallable(); + ApiFuture blockResponseApiFuture = blockCallable.futureCall(blockRequest); + // Sleep 1s before cancelling to let the request go through + Thread.sleep(1000); + blockResponseApiFuture.cancel(true); + + List actualMetricDataList = getMetricDataList(); + verifyPointDataSum(actualMetricDataList, attemptCount); + + Map expectedAttributes = + ImmutableMap.of( + MetricsTracer.METHOD_ATTRIBUTE, + "Echo.Block", + MetricsTracer.LANGUAGE_ATTRIBUTE, + MetricsTracer.DEFAULT_LANGUAGE); + verifyDefaultMetricsAttributes(actualMetricDataList, expectedAttributes); + + List statusCountList = ImmutableList.of(new StatusCount(Code.CANCELLED)); + verifyStatusAttribute(actualMetricDataList, statusCountList); + } + + @Test + void testGrpc_operationFailed_recordsMetrics() throws InterruptedException { + int attemptCount = 1; + Code statusCode = Code.INVALID_ARGUMENT; + BlockRequest blockRequest = + BlockRequest.newBuilder() + .setResponseDelay(Duration.newBuilder().setSeconds(2)) + .setError(Status.newBuilder().setCode(statusCode.ordinal())) + .build(); + + UnaryCallable blockCallable = grpcClient.blockCallable(); + ApiFuture blockResponseApiFuture = blockCallable.futureCall(blockRequest); + assertThrows(ExecutionException.class, blockResponseApiFuture::get); + + List actualMetricDataList = getMetricDataList(); + verifyPointDataSum(actualMetricDataList, attemptCount); + + Map expectedAttributes = + ImmutableMap.of( + MetricsTracer.METHOD_ATTRIBUTE, + "Echo.Block", + MetricsTracer.LANGUAGE_ATTRIBUTE, + MetricsTracer.DEFAULT_LANGUAGE); + verifyDefaultMetricsAttributes(actualMetricDataList, expectedAttributes); + + List statusCountList = ImmutableList.of(new StatusCount(statusCode)); + verifyStatusAttribute(actualMetricDataList, statusCountList); + } + + @Test + void testHttpJson_operationFailed_recordsMetrics() throws InterruptedException { + int attemptCount = 1; + Code statusCode = Code.INVALID_ARGUMENT; + BlockRequest blockRequest = + BlockRequest.newBuilder() + .setResponseDelay(Duration.newBuilder().setSeconds(2)) + .setError(Status.newBuilder().setCode(statusCode.ordinal())) + .build(); + + UnaryCallable blockCallable = httpClient.blockCallable(); + ApiFuture blockResponseApiFuture = blockCallable.futureCall(blockRequest); + assertThrows(ExecutionException.class, blockResponseApiFuture::get); + + List actualMetricDataList = getMetricDataList(); + verifyPointDataSum(actualMetricDataList, attemptCount); + + Map expectedAttributes = + ImmutableMap.of( + MetricsTracer.METHOD_ATTRIBUTE, + "Echo.Block", + MetricsTracer.LANGUAGE_ATTRIBUTE, + MetricsTracer.DEFAULT_LANGUAGE); + verifyDefaultMetricsAttributes(actualMetricDataList, expectedAttributes); + + List statusCountList = ImmutableList.of(new StatusCount(statusCode)); + verifyStatusAttribute(actualMetricDataList, statusCountList); + } + + @Test + void testGrpc_attemptFailedRetriesExhausted_recordsMetrics() throws Exception { + int attemptCount = 3; + Code statusCode = Code.UNAVAILABLE; + // A custom EchoClient is used in this test because retries have jitter, and we cannot + // predict the number of attempts that are scheduled for an RPC invocation otherwise. + // The custom retrySettings limit to a set number of attempts before the call gives up. + RetrySettings retrySettings = + RetrySettings.newBuilder() + .setTotalTimeout(org.threeten.bp.Duration.ofMillis(5000L)) + .setMaxAttempts(3) + .build(); + + EchoStubSettings.Builder grpcEchoSettingsBuilder = EchoStubSettings.newBuilder(); + grpcEchoSettingsBuilder + .echoSettings() + .setRetrySettings(retrySettings) + .setRetryableCodes(ImmutableSet.of(statusCode)); + EchoSettings grpcEchoSettings = EchoSettings.create(grpcEchoSettingsBuilder.build()); + grpcEchoSettings = + grpcEchoSettings.toBuilder() + .setCredentialsProvider(NoCredentialsProvider.create()) + .setTransportChannelProvider( + EchoSettings.defaultGrpcTransportProviderBuilder() + .setChannelConfigurator(ManagedChannelBuilder::usePlaintext) + .build()) + .setEndpoint("localhost:7469") + .build(); + + EchoStubSettings echoStubSettings = + (EchoStubSettings) + grpcEchoSettings.getStubSettings().toBuilder() + .setTracerFactory( + new MetricsTracerFactory(createOtelMetricsRecorder(inMemoryMetricReader))) + .build(); + EchoStub stub = echoStubSettings.createStub(); + EchoClient grpcClient = EchoClient.create(stub); + + EchoRequest echoRequest = + EchoRequest.newBuilder() + .setError(Status.newBuilder().setCode(statusCode.ordinal()).build()) + .build(); + + assertThrows(UnavailableException.class, () -> grpcClient.echo(echoRequest)); + + List actualMetricDataList = getMetricDataList(); + verifyPointDataSum(actualMetricDataList, attemptCount); + + Map expectedAttributes = + ImmutableMap.of( + MetricsTracer.METHOD_ATTRIBUTE, + "Echo.Echo", + MetricsTracer.LANGUAGE_ATTRIBUTE, + MetricsTracer.DEFAULT_LANGUAGE); + verifyDefaultMetricsAttributes(actualMetricDataList, expectedAttributes); + + List statusCountList = ImmutableList.of(new StatusCount(statusCode, 3)); + verifyStatusAttribute(actualMetricDataList, statusCountList); + + grpcClient.close(); + grpcClient.awaitTermination(TestClientInitializer.AWAIT_TERMINATION_SECONDS, TimeUnit.SECONDS); + } + + @Test + void testHttpJson_attemptFailedRetriesExhausted_recordsMetrics() throws Exception { + int attemptCount = 3; + Code statusCode = Code.UNAVAILABLE; + // A custom EchoClient is used in this test because retries have jitter, and we cannot + // predict the number of attempts that are scheduled for an RPC invocation otherwise. + // The custom retrySettings limit to a set number of attempts before the call gives up. + RetrySettings retrySettings = + RetrySettings.newBuilder() + .setTotalTimeout(org.threeten.bp.Duration.ofMillis(5000L)) + .setMaxAttempts(3) + .build(); + + EchoStubSettings.Builder httpJsonEchoSettingsBuilder = EchoStubSettings.newHttpJsonBuilder(); + httpJsonEchoSettingsBuilder + .echoSettings() + .setRetrySettings(retrySettings) + .setRetryableCodes(ImmutableSet.of(statusCode)); + EchoSettings httpJsonEchoSettings = EchoSettings.create(httpJsonEchoSettingsBuilder.build()); + httpJsonEchoSettings = + httpJsonEchoSettings.toBuilder() + .setCredentialsProvider(NoCredentialsProvider.create()) + .setTransportChannelProvider( + EchoSettings.defaultHttpJsonTransportProviderBuilder() + .setHttpTransport( + new NetHttpTransport.Builder().doNotValidateCertificate().build()) + .setEndpoint("http://localhost:7469") + .build()) + .build(); + + EchoStubSettings echoStubSettings = + (EchoStubSettings) + httpJsonEchoSettings.getStubSettings().toBuilder() + .setTracerFactory( + new MetricsTracerFactory(createOtelMetricsRecorder(inMemoryMetricReader))) + .build(); + EchoStub stub = echoStubSettings.createStub(); + EchoClient httpClient = EchoClient.create(stub); + + EchoRequest echoRequest = + EchoRequest.newBuilder() + .setError(Status.newBuilder().setCode(statusCode.ordinal()).build()) + .build(); + + assertThrows(UnavailableException.class, () -> httpClient.echo(echoRequest)); + + List actualMetricDataList = getMetricDataList(); + verifyPointDataSum(actualMetricDataList, attemptCount); + + Map expectedAttributes = + ImmutableMap.of( + MetricsTracer.METHOD_ATTRIBUTE, + "Echo.Echo", + MetricsTracer.LANGUAGE_ATTRIBUTE, + MetricsTracer.DEFAULT_LANGUAGE); + verifyDefaultMetricsAttributes(actualMetricDataList, expectedAttributes); + + List statusCountList = ImmutableList.of(new StatusCount(statusCode, 3)); + verifyStatusAttribute(actualMetricDataList, statusCountList); + + httpClient.close(); + httpClient.awaitTermination(TestClientInitializer.AWAIT_TERMINATION_SECONDS, TimeUnit.SECONDS); + } + + @Test + void testGrpc_attemptPermanentFailure_recordsMetrics() throws InterruptedException { + int attemptCount = 1; + Code statusCode = Code.INVALID_ARGUMENT; + BlockRequest blockRequest = + BlockRequest.newBuilder() + .setResponseDelay(Duration.newBuilder().setSeconds(2).build()) + .setError(Status.newBuilder().setCode(statusCode.ordinal()).build()) + .build(); + + assertThrows(InvalidArgumentException.class, () -> grpcClient.block(blockRequest)); + + List actualMetricDataList = getMetricDataList(); + verifyPointDataSum(actualMetricDataList, attemptCount); + + Map expectedAttributes = + ImmutableMap.of( + MetricsTracer.METHOD_ATTRIBUTE, + "Echo.Block", + MetricsTracer.LANGUAGE_ATTRIBUTE, + MetricsTracer.DEFAULT_LANGUAGE); + verifyDefaultMetricsAttributes(actualMetricDataList, expectedAttributes); + + List statusCountList = ImmutableList.of(new StatusCount(statusCode)); + verifyStatusAttribute(actualMetricDataList, statusCountList); + } + + @Test + void testHttpJson_attemptPermanentFailure_recordsMetrics() throws InterruptedException { + int attemptCount = 1; + Code statusCode = Code.INVALID_ARGUMENT; + BlockRequest blockRequest = + BlockRequest.newBuilder() + .setResponseDelay(Duration.newBuilder().setSeconds(2).build()) + .setError(Status.newBuilder().setCode(statusCode.ordinal()).build()) + .build(); + + assertThrows(InvalidArgumentException.class, () -> httpClient.block(blockRequest)); + + List actualMetricDataList = getMetricDataList(); + verifyPointDataSum(actualMetricDataList, attemptCount); + + Map expectedAttributes = + ImmutableMap.of( + MetricsTracer.METHOD_ATTRIBUTE, + "Echo.Block", + MetricsTracer.LANGUAGE_ATTRIBUTE, + MetricsTracer.DEFAULT_LANGUAGE); + verifyDefaultMetricsAttributes(actualMetricDataList, expectedAttributes); + + List statusCountList = ImmutableList.of(new StatusCount(statusCode)); + verifyStatusAttribute(actualMetricDataList, statusCountList); + } + + @Test + void testGrpc_multipleFailedAttempts_successfulOperation() throws Exception { + int attemptCount = 3; + // Disable Jitter on this test to try and ensure that the there are 3 attempts made + // for test. The first two calls should result in a DEADLINE_EXCEEDED exception as + // 0.5s and 1s are too short for the 1s blocking call (1s still requires time for + // the showcase server to respond back to the client). The 3rd and final call (2s) + // should result in an OK Status Code. + RetrySettings retrySettings = + RetrySettings.newBuilder() + .setInitialRpcTimeout(org.threeten.bp.Duration.ofMillis(500L)) + .setRpcTimeoutMultiplier(2.0) + .setMaxRpcTimeout(org.threeten.bp.Duration.ofMillis(2000L)) + .setTotalTimeout(org.threeten.bp.Duration.ofMillis(6000L)) + .setJittered(false) + .build(); + + EchoStubSettings.Builder grpcEchoSettingsBuilder = EchoStubSettings.newBuilder(); + grpcEchoSettingsBuilder + .blockSettings() + .setRetrySettings(retrySettings) + .setRetryableCodes(ImmutableSet.of(Code.DEADLINE_EXCEEDED)); + EchoSettings grpcEchoSettings = EchoSettings.create(grpcEchoSettingsBuilder.build()); + grpcEchoSettings = + grpcEchoSettings.toBuilder() + .setCredentialsProvider(NoCredentialsProvider.create()) + .setTransportChannelProvider( + EchoSettings.defaultGrpcTransportProviderBuilder() + .setChannelConfigurator(ManagedChannelBuilder::usePlaintext) + .build()) + .setEndpoint("localhost:7469") + .build(); + + EchoStubSettings echoStubSettings = + (EchoStubSettings) + grpcEchoSettings.getStubSettings().toBuilder() + .setTracerFactory( + new MetricsTracerFactory(createOtelMetricsRecorder(inMemoryMetricReader))) + .build(); + EchoStub stub = echoStubSettings.createStub(); + + EchoClient grpcClient = EchoClient.create(stub); + + BlockRequest blockRequest = + BlockRequest.newBuilder() + .setResponseDelay(Duration.newBuilder().setSeconds(1)) + .setSuccess(BlockResponse.newBuilder().setContent("grpcBlockResponse")) + .build(); + + grpcClient.block(blockRequest); + + List actualMetricDataList = getMetricDataList(); + verifyPointDataSum(actualMetricDataList, attemptCount); + + Map expectedAttributes = + ImmutableMap.of( + MetricsTracer.METHOD_ATTRIBUTE, + "Echo.Block", + MetricsTracer.LANGUAGE_ATTRIBUTE, + MetricsTracer.DEFAULT_LANGUAGE); + verifyDefaultMetricsAttributes(actualMetricDataList, expectedAttributes); + + List statusCountList = + ImmutableList.of(new StatusCount(Code.DEADLINE_EXCEEDED, 2), new StatusCount(Code.OK)); + verifyStatusAttribute(actualMetricDataList, statusCountList); + + grpcClient.close(); + grpcClient.awaitTermination(TestClientInitializer.AWAIT_TERMINATION_SECONDS, TimeUnit.SECONDS); + } + + @Test + void testHttpJson_multipleFailedAttempts_successfulOperation() throws Exception { + int attemptCount = 3; + RetrySettings retrySettings = + RetrySettings.newBuilder() + .setInitialRpcTimeout(org.threeten.bp.Duration.ofMillis(500L)) + .setRpcTimeoutMultiplier(2.0) + .setMaxRpcTimeout(org.threeten.bp.Duration.ofMillis(2000L)) + .setTotalTimeout(org.threeten.bp.Duration.ofMillis(6000L)) + .setJittered(false) + .build(); + + EchoStubSettings.Builder httpJsonEchoSettingsBuilder = EchoStubSettings.newHttpJsonBuilder(); + httpJsonEchoSettingsBuilder + .blockSettings() + .setRetrySettings(retrySettings) + .setRetryableCodes(ImmutableSet.of(Code.DEADLINE_EXCEEDED)); + EchoSettings httpJsonEchoSettings = EchoSettings.create(httpJsonEchoSettingsBuilder.build()); + httpJsonEchoSettings = + httpJsonEchoSettings.toBuilder() + .setCredentialsProvider(NoCredentialsProvider.create()) + .setTransportChannelProvider( + EchoSettings.defaultHttpJsonTransportProviderBuilder() + .setHttpTransport( + new NetHttpTransport.Builder().doNotValidateCertificate().build()) + .setEndpoint("http://localhost:7469") + .build()) + .build(); + + EchoStubSettings echoStubSettings = + (EchoStubSettings) + httpJsonEchoSettings.getStubSettings().toBuilder() + .setTracerFactory( + new MetricsTracerFactory(createOtelMetricsRecorder(inMemoryMetricReader))) + .build(); + EchoStub stub = echoStubSettings.createStub(); + + EchoClient httpClient = EchoClient.create(stub); + + BlockRequest blockRequest = + BlockRequest.newBuilder() + .setResponseDelay(Duration.newBuilder().setSeconds(1)) + .setSuccess(BlockResponse.newBuilder().setContent("httpjsonBlockResponse")) + .build(); + + httpClient.block(blockRequest); + + List actualMetricDataList = getMetricDataList(); + verifyPointDataSum(actualMetricDataList, attemptCount); + + Map expectedAttributes = + ImmutableMap.of( + MetricsTracer.METHOD_ATTRIBUTE, + "Echo.Block", + MetricsTracer.LANGUAGE_ATTRIBUTE, + MetricsTracer.DEFAULT_LANGUAGE); + verifyDefaultMetricsAttributes(actualMetricDataList, expectedAttributes); + + httpClient.close(); + httpClient.awaitTermination(TestClientInitializer.AWAIT_TERMINATION_SECONDS, TimeUnit.SECONDS); + } + + @Test + void recordsCustomAttributes() throws InterruptedException, IOException { + InstantiatingGrpcChannelProvider channelProvider = + EchoSettings.defaultGrpcTransportProviderBuilder() + .setChannelConfigurator(ManagedChannelBuilder::usePlaintext) + .setAttemptDirectPathXds() + .build(); + + // Add custom attributes to be added as client level attributes + Map customAttributes = new HashMap<>(); + String directpathEnabled = "directpath_enabled"; + customAttributes.put(directpathEnabled, String.valueOf(channelProvider.canUseDirectPath())); + String directpathXdsEnabled = "directpathxds_enabled"; + customAttributes.put( + directpathXdsEnabled, String.valueOf(channelProvider.isDirectPathXdsEnabled())); + String randomAttributeKey1 = "testing"; + String randomAttributeValue1 = "showcase"; + String randomAttributeKey2 = "hello"; + String randomAttributeValue2 = "world"; + customAttributes.put(randomAttributeKey1, randomAttributeValue1); + customAttributes.put(randomAttributeKey2, randomAttributeValue2); + + InMemoryMetricReader inMemoryMetricReader = InMemoryMetricReader.create(); + OpenTelemetryMetricsRecorder otelMetricsRecorder = + createOtelMetricsRecorder(inMemoryMetricReader); + MetricsTracerFactory metricsTracerFactory = + new MetricsTracerFactory(otelMetricsRecorder, customAttributes); + + EchoSettings grpcEchoSettings = + EchoSettings.newBuilder() + .setCredentialsProvider(NoCredentialsProvider.create()) + .setTransportChannelProvider(channelProvider) + .setEndpoint(TestClientInitializer.DEFAULT_GRPC_ENDPOINT) + .build(); + + EchoStubSettings echoStubSettings = + (EchoStubSettings) + grpcEchoSettings.getStubSettings().toBuilder() + .setTracerFactory(metricsTracerFactory) + .build(); + EchoStub stub = echoStubSettings.createStub(); + EchoClient grpcClient = EchoClient.create(stub); + + EchoRequest echoRequest = EchoRequest.newBuilder().setContent("content").build(); + grpcClient.echo(echoRequest); + + List actualMetricDataList = getMetricDataList(inMemoryMetricReader); + Map expectedAttributes = + ImmutableMap.of( + MetricsTracer.METHOD_ATTRIBUTE, + "Echo.Echo", + MetricsTracer.LANGUAGE_ATTRIBUTE, + MetricsTracer.DEFAULT_LANGUAGE, + directpathEnabled, + "false", + directpathXdsEnabled, + "true", + randomAttributeKey1, + randomAttributeValue1, + randomAttributeKey2, + randomAttributeValue2); + verifyDefaultMetricsAttributes(actualMetricDataList, expectedAttributes); + } + + // This test case uses GrpcOpenTelemetry from grpc-java and includes additional grpc-java specific + // metrics. This test case ensures that the `setSampledToLocalTracing` set to true will ensure + // that + // the gRPC full method name in the stub is recorded (not recorded as `other`). + @Test + void grpcOpenTelemetryImplementation_setSampledToLocalTracing_methodFullNameIsRecorded() + throws Exception { + SdkMeterProvider sdkMeterProvider = + SdkMeterProvider.builder().registerMetricReader(inMemoryMetricReader).build(); + + OpenTelemetry openTelemetry = + OpenTelemetrySdk.builder().setMeterProvider(sdkMeterProvider).build(); + + GrpcOpenTelemetry grpcOpenTelemetry = GrpcOpenTelemetry.newBuilder().sdk(openTelemetry).build(); + + // Java-Spanner configures the InstantiatingGrpcChannelProvider with gRPCOpenTelemetry + // This setup below is copied from their implementation + InstantiatingGrpcChannelProvider.Builder builder = + EchoSettings.defaultGrpcTransportProviderBuilder(); + ApiFunction channelConfigurator = + builder.getChannelConfigurator(); + builder.setChannelConfigurator( + b -> { + b.usePlaintext(); + grpcOpenTelemetry.configureChannelBuilder(b); + if (channelConfigurator != null) { + return channelConfigurator.apply(b); + } + return b; + }); + + OpenTelemetryMetricsRecorder otelMetricsRecorder = + new OpenTelemetryMetricsRecorder(openTelemetry, SERVICE_NAME); + + // Create a custom EchoClient that is different from what is created by default in setup() + EchoClient echoClient = + TestClientInitializer.createGrpcEchoClientOpentelemetry( + new MetricsTracerFactory(otelMetricsRecorder), builder.build()); + + EchoRequest echoRequest = + EchoRequest.newBuilder().setContent("test_grpc_request_succeeded").build(); + echoClient.echo(echoRequest); + + List metricDataList = getMetricDataList(); + + String gRPCMetricNamePrefix = "grpc."; + String gRPCMethodNameAttributeKey = "grpc.method"; + + List grpcMetricDataList = + metricDataList.stream() + .filter(x -> x.getName().startsWith(gRPCMetricNamePrefix)) + .collect(Collectors.toList()); + Truth.assertThat(grpcMetricDataList).isNotEmpty(); + for (MetricData grpcMetricData : grpcMetricDataList) { + List pointDataList = new ArrayList<>(grpcMetricData.getData().getPoints()); + + for (PointData pointData : pointDataList) { + String methodName = + pointData.getAttributes().get(AttributeKey.stringKey(gRPCMethodNameAttributeKey)); + + // All the attributes in the gRPC metrics should have the full method name + Truth.assertThat(methodName).doesNotMatch("other"); + Truth.assertThat(methodName).matches("^google.showcase.v1beta1.Echo/.*$"); + } + } + + echoClient.close(); + echoClient.awaitTermination(TestClientInitializer.AWAIT_TERMINATION_SECONDS, TimeUnit.SECONDS); + } +} diff --git a/java-showcase-3.21.0/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/ITPagination.java b/java-showcase-3.21.0/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/ITPagination.java new file mode 100644 index 0000000000..ebcabeab9e --- /dev/null +++ b/java-showcase-3.21.0/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/ITPagination.java @@ -0,0 +1,147 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.it; + +import static com.google.common.truth.Truth.assertThat; + +import com.google.showcase.v1beta1.EchoClient; +import com.google.showcase.v1beta1.EchoResponse; +import com.google.showcase.v1beta1.PagedExpandRequest; +import com.google.showcase.v1beta1.it.util.TestClientInitializer; +import java.util.concurrent.TimeUnit; +import org.junit.jupiter.api.AfterAll; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Test; + +class ITPagination { + + private static EchoClient grpcClient; + private static EchoClient httpjsonClient; + + @BeforeAll + static void createClients() throws Exception { + // Create gRPC Echo Client + grpcClient = TestClientInitializer.createGrpcEchoClient(); + // Create Http JSON Echo Client + httpjsonClient = TestClientInitializer.createHttpJsonEchoClient(); + } + + @AfterAll + static void destroyClients() throws InterruptedException { + grpcClient.close(); + httpjsonClient.close(); + + grpcClient.awaitTermination(TestClientInitializer.AWAIT_TERMINATION_SECONDS, TimeUnit.SECONDS); + httpjsonClient.awaitTermination( + TestClientInitializer.AWAIT_TERMINATION_SECONDS, TimeUnit.SECONDS); + } + + // This tests that pagination returns the correct number of pages + responses and that + // the content is correct. + // + // The pageToken is where the streaming responses come back from and the page size denotes + // how many of the responses come back together (in a page). i.e for PageSize = 2 and + // PageToken = 3, see below: + // | A | Series | Of | Words | That | Will | Be | Sent | Back | One | By | One + // Page # | - | - | - | 1 | 1 | 2 | 2 | 3 | 3 | 4 | 4 | 5 + // Token # | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 + @Test + void testPagedExpandWithTokenGrpc() { + int pageSize = 2; + int pageToken = 3; + String content = "A series of words that will be sent back one by one"; + int contentLength = content.split(" ").length; + + EchoClient.PagedExpandPagedResponse pagedExpandPagedResponse = + grpcClient.pagedExpand( + PagedExpandRequest.newBuilder() + .setContent(content) + .setPageSize(pageSize) + .setPageToken(String.valueOf(pageToken)) + .build()); + + String[] expected = content.split(" "); + int numExpectedPages = ((contentLength - pageToken) / pageSize); + // If the responses can't be evenly split into pages, then the extra responses + // will go to an additional page + if ((contentLength - pageToken) % pageSize != 0) { + numExpectedPages++; + } + int numExpectedResponses = contentLength - pageToken; + + validatePagedResponses( + pagedExpandPagedResponse, expected, pageToken, numExpectedResponses, numExpectedPages); + } + + // This tests that pagination returns the correct number of pages + responses and that + // the content is correct. + // + // The pageToken is where the streaming responses come back from and the page size denotes + // how many of the responses come back together (in a page). i.e for PageSize = 2 and + // PageToken = 3, see below: + // | A | Series | Of | Words | That | Will | Be | Sent | Back | One | By | One + // Page # | - | - | - | 1 | 1 | 2 | 2 | 3 | 3 | 4 | 4 | 5 + // Token # | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 + @Test + void testPagedExpandWithTokenHttpJson() { + int pageSize = 2; + int pageToken = 3; + String content = "A series of words that will be sent back one by one"; + int contentLength = content.split(" ").length; + + EchoClient.PagedExpandPagedResponse pagedExpandPagedResponse = + httpjsonClient.pagedExpand( + PagedExpandRequest.newBuilder() + .setContent(content) + .setPageSize(pageSize) + .setPageToken(String.valueOf(pageToken)) + .build()); + + String[] expected = content.split(" "); + int numExpectedPages = ((contentLength - pageToken) / pageSize); + // If the responses can't be evenly split into pages, then the extra responses + // will go to an additional page + if ((contentLength - pageToken) % pageSize != 0) { + numExpectedPages++; + } + int numExpectedResponses = contentLength - pageToken; + + validatePagedResponses( + pagedExpandPagedResponse, expected, pageToken, numExpectedResponses, numExpectedPages); + } + + private void validatePagedResponses( + EchoClient.PagedExpandPagedResponse pagedExpandPagedResponse, + String[] expected, + int pageToken, + int numExpectedResponses, + int numExpectedPages) { + int numResponses = 0; + int numPages = 0; + for (EchoClient.PagedExpandPage page : pagedExpandPagedResponse.iteratePages()) { + for (EchoResponse echoResponse : page.getValues()) { + // Add pageToken as offset to the expected array to start indexing at the pageToken + assertThat(echoResponse.getContent()).isEqualTo(expected[numResponses + pageToken]); + numResponses++; + } + numPages++; + } + + assertThat(numPages).isEqualTo(numExpectedPages); + assertThat(numResponses).isEqualTo(numExpectedResponses); + } +} diff --git a/java-showcase-3.21.0/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/ITServerSideStreaming.java b/java-showcase-3.21.0/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/ITServerSideStreaming.java new file mode 100644 index 0000000000..9d9ccba39e --- /dev/null +++ b/java-showcase-3.21.0/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/ITServerSideStreaming.java @@ -0,0 +1,201 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.it; + +import static com.google.common.truth.Truth.assertThat; +import static org.junit.jupiter.api.Assertions.assertThrows; + +import com.google.api.gax.core.NoCredentialsProvider; +import com.google.api.gax.rpc.CancelledException; +import com.google.api.gax.rpc.ServerStream; +import com.google.api.gax.rpc.StatusCode; +import com.google.api.gax.rpc.WatchdogTimeoutException; +import com.google.common.collect.ImmutableList; +import com.google.rpc.Status; +import com.google.showcase.v1beta1.EchoClient; +import com.google.showcase.v1beta1.EchoResponse; +import com.google.showcase.v1beta1.EchoSettings; +import com.google.showcase.v1beta1.ExpandRequest; +import com.google.showcase.v1beta1.it.util.TestClientInitializer; +import io.grpc.ManagedChannelBuilder; +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; +import java.util.concurrent.TimeUnit; +import java.util.stream.Collectors; +import org.junit.jupiter.api.AfterAll; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; +import org.threeten.bp.Duration; + +class ITServerSideStreaming { + + private static EchoClient grpcClient; + private static EchoClient httpjsonClient; + + @BeforeAll + static void createClients() throws Exception { + // Create gRPC Echo Client + grpcClient = TestClientInitializer.createGrpcEchoClient(); + // Create Http JSON Echo Client + httpjsonClient = TestClientInitializer.createHttpJsonEchoClient(); + } + + @AfterAll + static void destroyClients() throws InterruptedException { + grpcClient.close(); + httpjsonClient.close(); + + grpcClient.awaitTermination(TestClientInitializer.AWAIT_TERMINATION_SECONDS, TimeUnit.SECONDS); + httpjsonClient.awaitTermination( + TestClientInitializer.AWAIT_TERMINATION_SECONDS, TimeUnit.SECONDS); + } + + @Test + void testGrpc_receiveStreamedContent() { + String content = "The rain in Spain stays mainly on the plain!"; + ServerStream responseStream = + grpcClient.expandCallable().call(ExpandRequest.newBuilder().setContent(content).build()); + ArrayList responses = new ArrayList<>(); + for (EchoResponse response : responseStream) { + responses.add(response.getContent()); + } + + assertThat(responses) + .containsExactlyElementsIn( + ImmutableList.of( + "The", "rain", "in", "Spain", "stays", "mainly", "on", "the", "plain!")) + .inOrder(); + } + + @Test + void testGrpc_receiveStreamedContentStreamAPI() { + String content = "The rain in Spain stays mainly on the plain!"; + ServerStream responseStream = + grpcClient.expandCallable().call(ExpandRequest.newBuilder().setContent(content).build()); + assertThat(responseStream.stream().map(EchoResponse::getContent).collect(Collectors.toList())) + .containsExactlyElementsIn( + ImmutableList.of( + "The", "rain", "in", "Spain", "stays", "mainly", "on", "the", "plain!")) + .inOrder(); + } + + @Test + void testGrpc_serverError_receiveErrorAfterLastWordInStream() { + String content = "The rain in Spain"; + Status cancelledStatus = + Status.newBuilder().setCode(StatusCode.Code.CANCELLED.ordinal()).build(); + ServerStream responseStream = + grpcClient + .expandCallable() + .call(ExpandRequest.newBuilder().setContent(content).setError(cancelledStatus).build()); + Iterator echoResponseIterator = responseStream.iterator(); + + assertThat(echoResponseIterator.next().getContent()).isEqualTo("The"); + assertThat(echoResponseIterator.next().getContent()).isEqualTo("rain"); + assertThat(echoResponseIterator.next().getContent()).isEqualTo("in"); + assertThat(echoResponseIterator.next().getContent()).isEqualTo("Spain"); + CancelledException cancelledException = + assertThrows(CancelledException.class, echoResponseIterator::next); + assertThat(cancelledException.getStatusCode().getCode()).isEqualTo(StatusCode.Code.CANCELLED); + } + + @Test + void testGrpc_serverWaitTimeout_watchdogCancelsStream() throws Exception { + EchoSettings.Builder settings = + EchoSettings.newBuilder() + .setCredentialsProvider(NoCredentialsProvider.create()) + .setTransportChannelProvider( + EchoSettings.defaultGrpcTransportProviderBuilder() + .setChannelConfigurator(ManagedChannelBuilder::usePlaintext) + .build()) + .setEndpoint("localhost:7469"); + + settings + .expandSettings() + .setIdleTimeout(Duration.ofMillis(100)) + .setWaitTimeout(Duration.ofMillis(100)); + + settings.getStubSettingsBuilder().setStreamWatchdogCheckInterval(Duration.ofMillis(50)); + + EchoClient echoClient = EchoClient.create(settings.build()); + + String content = "The rain in Spain stays mainly on the plain!"; + ServerStream responseStream = + echoClient + .expandCallable() + .call( + ExpandRequest.newBuilder() + .setContent(content) + // Configure server interval for returning the next response + .setStreamWaitTime( + com.google.protobuf.Duration.newBuilder().setSeconds(1).build()) + .build()); + List responses = new ArrayList<>(); + WatchdogTimeoutException exception = + assertThrows( + WatchdogTimeoutException.class, + () -> responseStream.forEach(x -> responses.add(x.getContent()))); + assertThat(exception) + .hasMessageThat() + .contains("Canceled due to timeout waiting for next response"); + echoClient.close(); + echoClient.awaitTermination(TestClientInitializer.AWAIT_TERMINATION_SECONDS, TimeUnit.SECONDS); + } + + @Test + void testHttpJson_receiveStreamedContent() { + String content = "The rain in Spain stays mainly on the plain!"; + ServerStream responseStream = + httpjsonClient + .expandCallable() + .call(ExpandRequest.newBuilder().setContent(content).build()); + ArrayList responses = new ArrayList<>(); + for (EchoResponse response : responseStream) { + responses.add(response.getContent()); + } + + assertThat(responses) + .containsExactlyElementsIn( + ImmutableList.of( + "The", "rain", "in", "Spain", "stays", "mainly", "on", "the", "plain!")) + .inOrder(); + } + + @Disabled( + value = "Ignore until https://github.com/googleapis/gapic-showcase/issues/1286 is resolved") + @Test + void testHttpJson_serverError_receiveErrorAfterLastWordInStream() { + String content = "The rain in Spain"; + Status cancelledStatus = + Status.newBuilder().setCode(StatusCode.Code.CANCELLED.ordinal()).build(); + ServerStream responseStream = + httpjsonClient + .expandCallable() + .call(ExpandRequest.newBuilder().setContent(content).setError(cancelledStatus).build()); + Iterator echoResponseIterator = responseStream.iterator(); + + assertThat(echoResponseIterator.next().getContent()).isEqualTo("The"); + assertThat(echoResponseIterator.next().getContent()).isEqualTo("rain"); + assertThat(echoResponseIterator.next().getContent()).isEqualTo("in"); + assertThat(echoResponseIterator.next().getContent()).isEqualTo("Spain"); + CancelledException cancelledException = + assertThrows(CancelledException.class, echoResponseIterator::next); + assertThat(cancelledException.getStatusCode().getCode()).isEqualTo(StatusCode.Code.CANCELLED); + } +} diff --git a/java-showcase-3.21.0/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/ITTimeObjectsPropagationTest.java b/java-showcase-3.21.0/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/ITTimeObjectsPropagationTest.java new file mode 100644 index 0000000000..f7f801f627 --- /dev/null +++ b/java-showcase-3.21.0/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/ITTimeObjectsPropagationTest.java @@ -0,0 +1,64 @@ +package com.google.showcase.v1beta1.it; + +import static org.junit.Assert.assertEquals; + +import com.google.api.gax.retrying.RetrySettings; +import org.junit.Test; + +/** + * Tests to confirm that usage of retry settings can be done regardless of whether threeten or + * java.time is being used + */ +public class ITTimeObjectsPropagationTest { + @Test + public void testRetrySettings_fromJavaTimeHasEquivalentThreetenValues() { + java.time.Duration javaTimeCommonValue = java.time.Duration.ofMillis(123l); + org.threeten.bp.Duration threetenConvertedValue = + org.threeten.bp.Duration.ofMillis(javaTimeCommonValue.toMillis()); + RetrySettings javaTimeRetrySettings = + RetrySettings.newBuilder() + .setInitialRetryDelayDuration(javaTimeCommonValue) + .setMaxRetryDelayDuration(javaTimeCommonValue) + .setInitialRpcTimeoutDuration(javaTimeCommonValue) + .setMaxRpcTimeoutDuration(javaTimeCommonValue) + .setTotalTimeoutDuration(javaTimeCommonValue) + .build(); + + assertEquals( + threetenConvertedValue.toMillis(), javaTimeRetrySettings.getInitialRetryDelay().toMillis()); + assertEquals( + threetenConvertedValue.toMillis(), javaTimeRetrySettings.getMaxRetryDelay().toMillis()); + assertEquals( + threetenConvertedValue.toMillis(), javaTimeRetrySettings.getInitialRpcTimeout().toMillis()); + assertEquals( + threetenConvertedValue.toMillis(), javaTimeRetrySettings.getMaxRpcTimeout().toMillis()); + assertEquals( + threetenConvertedValue.toMillis(), javaTimeRetrySettings.getTotalTimeout().toMillis()); + } + + @Test + public void testRetrySettings_fromThreetenHasEquivalentJavaTimeValues() { + org.threeten.bp.Duration threetenCommonValue = org.threeten.bp.Duration.ofMillis(123l); + java.time.Duration javaTimeConvertedValue = + java.time.Duration.ofMillis(threetenCommonValue.toMillis()); + RetrySettings threetenRetrySettings = + RetrySettings.newBuilder() + .setInitialRetryDelay(threetenCommonValue) + .setMaxRetryDelay(threetenCommonValue) + .setInitialRpcTimeout(threetenCommonValue) + .setMaxRpcTimeout(threetenCommonValue) + .setTotalTimeout(threetenCommonValue) + .build(); + + assertEquals( + javaTimeConvertedValue.toMillis(), threetenRetrySettings.getInitialRetryDelay().toMillis()); + assertEquals( + javaTimeConvertedValue.toMillis(), threetenRetrySettings.getMaxRetryDelay().toMillis()); + assertEquals( + javaTimeConvertedValue.toMillis(), threetenRetrySettings.getInitialRpcTimeout().toMillis()); + assertEquals( + javaTimeConvertedValue.toMillis(), threetenRetrySettings.getMaxRpcTimeout().toMillis()); + assertEquals( + javaTimeConvertedValue.toMillis(), threetenRetrySettings.getTotalTimeout().toMillis()); + } +} diff --git a/java-showcase-3.21.0/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/ITUnaryCallable.java b/java-showcase-3.21.0/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/ITUnaryCallable.java new file mode 100644 index 0000000000..4d6018f6fc --- /dev/null +++ b/java-showcase-3.21.0/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/ITUnaryCallable.java @@ -0,0 +1,101 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.it; + +import static com.google.common.truth.Truth.assertThat; +import static org.junit.jupiter.api.Assertions.assertThrows; + +import com.google.api.gax.grpc.GrpcStatusCode; +import com.google.api.gax.rpc.CancelledException; +import com.google.api.gax.rpc.StatusCode; +import com.google.rpc.Status; +import com.google.showcase.v1beta1.EchoClient; +import com.google.showcase.v1beta1.EchoRequest; +import com.google.showcase.v1beta1.EchoResponse; +import com.google.showcase.v1beta1.it.util.TestClientInitializer; +import java.util.concurrent.TimeUnit; +import org.junit.jupiter.api.AfterAll; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Test; + +class ITUnaryCallable { + + private static EchoClient grpcClient; + + private static EchoClient httpjsonClient; + + @BeforeAll + static void createClients() throws Exception { + // Create gRPC Echo Client + grpcClient = TestClientInitializer.createGrpcEchoClient(); + // Create Http JSON Echo Client + httpjsonClient = TestClientInitializer.createHttpJsonEchoClient(); + } + + @AfterAll + static void destroyClients() throws InterruptedException { + grpcClient.close(); + httpjsonClient.close(); + + grpcClient.awaitTermination(TestClientInitializer.AWAIT_TERMINATION_SECONDS, TimeUnit.SECONDS); + httpjsonClient.awaitTermination( + TestClientInitializer.AWAIT_TERMINATION_SECONDS, TimeUnit.SECONDS); + } + + @Test + void testGrpc_receiveContent() { + assertThat(echoGrpc("grpc-echo?")).isEqualTo("grpc-echo?"); + assertThat(echoGrpc("grpc-echo!")).isEqualTo("grpc-echo!"); + } + + @Test + void testGrpc_serverResponseError_throwsException() { + Status cancelledStatus = + Status.newBuilder().setCode(StatusCode.Code.CANCELLED.ordinal()).build(); + EchoRequest requestWithServerError = EchoRequest.newBuilder().setError(cancelledStatus).build(); + CancelledException exception = + assertThrows(CancelledException.class, () -> grpcClient.echo(requestWithServerError)); + assertThat(exception.getStatusCode().getCode()).isEqualTo(GrpcStatusCode.Code.CANCELLED); + } + + @Test + void testHttpJson_receiveContent() { + assertThat(echoHttpJson("http-echo?")).isEqualTo("http-echo?"); + assertThat(echoHttpJson("http-echo!")).isEqualTo("http-echo!"); + } + + @Test + void testHttpJson_serverResponseError_throwsException() { + EchoRequest requestWithServerError = + EchoRequest.newBuilder() + .setError(Status.newBuilder().setCode(StatusCode.Code.CANCELLED.ordinal()).build()) + .build(); + CancelledException exception = + assertThrows(CancelledException.class, () -> httpjsonClient.echo(requestWithServerError)); + assertThat(exception.getStatusCode().getCode()).isEqualTo(StatusCode.Code.CANCELLED); + } + + private String echoGrpc(String value) { + EchoResponse response = grpcClient.echo(EchoRequest.newBuilder().setContent(value).build()); + return response.getContent(); + } + + private String echoHttpJson(String value) { + EchoResponse response = httpjsonClient.echo(EchoRequest.newBuilder().setContent(value).build()); + return response.getContent(); + } +} diff --git a/java-showcase-3.21.0/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/ITUnaryDeadline.java b/java-showcase-3.21.0/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/ITUnaryDeadline.java new file mode 100644 index 0000000000..984598bc9e --- /dev/null +++ b/java-showcase-3.21.0/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/ITUnaryDeadline.java @@ -0,0 +1,368 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.showcase.v1beta1.it; + +import static com.google.common.truth.Truth.assertThat; +import static org.junit.jupiter.api.Assertions.assertThrows; + +import com.google.api.gax.retrying.RetrySettings; +import com.google.api.gax.retrying.RetryingFuture; +import com.google.api.gax.rpc.DeadlineExceededException; +import com.google.api.gax.rpc.StatusCode; +import com.google.common.collect.ImmutableSet; +import com.google.showcase.v1beta1.BlockRequest; +import com.google.showcase.v1beta1.BlockResponse; +import com.google.showcase.v1beta1.EchoClient; +import com.google.showcase.v1beta1.it.util.TestClientInitializer; +import java.util.concurrent.ExecutionException; +import java.util.concurrent.TimeUnit; +import org.junit.jupiter.api.Test; +import org.threeten.bp.Duration; + +/** + * For this test, we test a combination of various RetrySettings to try and ensure that the timeouts + * set by the customer are cancelled when timeouts have exceeded their limits + * + *

        Each test attempts to get the number of attempts done in each call. The attemptCount is + * incremented by 1 as the first attempt is zero indexed. + */ +class ITUnaryDeadline { + + @Test + void testGRPC_unarySuccessfulResponse_doesNotExceedTotalTimeout() throws Exception { + RetrySettings defaultNoRetrySettings = + RetrySettings.newBuilder() + .setInitialRpcTimeout(Duration.ofMillis(5000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ofMillis(5000L)) + .setTotalTimeout(Duration.ofMillis(5000L)) + // Explicitly set retries as disabled (maxAttempts == 1) + .setMaxAttempts(1) + .build(); + EchoClient grpcClient = + TestClientInitializer.createGrpcEchoClientCustomBlockSettings( + defaultNoRetrySettings, ImmutableSet.of(StatusCode.Code.DEADLINE_EXCEEDED)); + try { + BlockRequest blockRequest = + BlockRequest.newBuilder() + .setSuccess(BlockResponse.newBuilder().setContent("gRPCBlockContent_3sDelay_noRetry")) + .setResponseDelay(com.google.protobuf.Duration.newBuilder().setSeconds(3).build()) + .build(); + RetryingFuture retryingFuture = + (RetryingFuture) grpcClient.blockCallable().futureCall(blockRequest); + BlockResponse blockResponse = retryingFuture.get(10, TimeUnit.SECONDS); + assertThat(blockResponse.getContent()).isEqualTo("gRPCBlockContent_3sDelay_noRetry"); + // Guarantee that this only runs once + int attemptCount = retryingFuture.getAttemptSettings().getAttemptCount() + 1; + assertThat(attemptCount).isEqualTo(1); + } finally { + grpcClient.close(); + grpcClient.awaitTermination( + TestClientInitializer.AWAIT_TERMINATION_SECONDS, TimeUnit.SECONDS); + } + } + + @Test + void testHttpJson_unarySuccessfulResponse_doesNotExceedTotalTimeout() throws Exception { + RetrySettings defaultNoRetrySettings = + RetrySettings.newBuilder() + .setInitialRpcTimeout(Duration.ofMillis(5000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ofMillis(5000L)) + .setTotalTimeout(Duration.ofMillis(5000L)) + // Explicitly set retries as disabled (maxAttempts == 1) + .setMaxAttempts(1) + .build(); + EchoClient httpjsonClient = + TestClientInitializer.createHttpJsonEchoClientCustomBlockSettings( + defaultNoRetrySettings, ImmutableSet.of(StatusCode.Code.DEADLINE_EXCEEDED)); + try { + BlockRequest blockRequest = + BlockRequest.newBuilder() + .setSuccess( + BlockResponse.newBuilder().setContent("httpjsonBlockContent_3sDelay_noRetry")) + .setResponseDelay(com.google.protobuf.Duration.newBuilder().setSeconds(3).build()) + .build(); + RetryingFuture retryingFuture = + (RetryingFuture) httpjsonClient.blockCallable().futureCall(blockRequest); + BlockResponse blockResponse = retryingFuture.get(10, TimeUnit.SECONDS); + assertThat(blockResponse.getContent()).isEqualTo("httpjsonBlockContent_3sDelay_noRetry"); + // Guarantee that this only runs once + int attemptCount = retryingFuture.getAttemptSettings().getAttemptCount() + 1; + assertThat(attemptCount).isEqualTo(1); + } finally { + httpjsonClient.close(); + httpjsonClient.awaitTermination( + TestClientInitializer.AWAIT_TERMINATION_SECONDS, TimeUnit.SECONDS); + } + } + + // Retry is configured by setting the initial RPC timeout (1.5s) to be less than + // the RPC delay (2s). The next RPC timeout (3s) will wait long enough for the delay. + @Test + void testGRPC_unarySuccessfulResponse_exceedsRPCDeadlineButWithinTotalTimeout() throws Exception { + RetrySettings defaultRetrySettings = + RetrySettings.newBuilder() + .setInitialRpcTimeout(Duration.ofMillis(1500L)) + .setRpcTimeoutMultiplier(2.0) + .setMaxRpcTimeout(Duration.ofMillis(3000L)) + .setTotalTimeout(Duration.ofMillis(5000L)) + .build(); + EchoClient grpcClient = + TestClientInitializer.createGrpcEchoClientCustomBlockSettings( + defaultRetrySettings, ImmutableSet.of(StatusCode.Code.DEADLINE_EXCEEDED)); + try { + BlockRequest blockRequest = + BlockRequest.newBuilder() + .setSuccess(BlockResponse.newBuilder().setContent("gRPCBlockContent_2sDelay_Retry")) + .setResponseDelay(com.google.protobuf.Duration.newBuilder().setSeconds(2).build()) + .build(); + RetryingFuture retryingFuture = + (RetryingFuture) grpcClient.blockCallable().futureCall(blockRequest); + BlockResponse blockResponse = retryingFuture.get(10, TimeUnit.SECONDS); + assertThat(blockResponse.getContent()).isEqualTo("gRPCBlockContent_2sDelay_Retry"); + // Guarantee that this only runs twice + int attemptCount = retryingFuture.getAttemptSettings().getAttemptCount() + 1; + assertThat(attemptCount).isEqualTo(2); + } finally { + grpcClient.close(); + grpcClient.awaitTermination( + TestClientInitializer.AWAIT_TERMINATION_SECONDS, TimeUnit.SECONDS); + } + } + + // Retry is configured by setting the initial RPC timeout (1.5s) to be less than + // the RPC delay (2s). The next RPC timeout (3s) will wait long enough for the delay. + @Test + void testHttpJson_unarySuccessfulResponse_exceedsRPCDeadlineButWithinTotalTimeout() + throws Exception { + RetrySettings defaultRetrySettings = + RetrySettings.newBuilder() + .setInitialRpcTimeout(Duration.ofMillis(1500L)) + .setRpcTimeoutMultiplier(2.0) + .setMaxRpcTimeout(Duration.ofMillis(3000L)) + .setTotalTimeout(Duration.ofMillis(5000L)) + .build(); + EchoClient httpjsonClient = + TestClientInitializer.createHttpJsonEchoClientCustomBlockSettings( + defaultRetrySettings, ImmutableSet.of(StatusCode.Code.DEADLINE_EXCEEDED)); + try { + BlockRequest blockRequest = + BlockRequest.newBuilder() + .setSuccess( + BlockResponse.newBuilder().setContent("httpjsonBlockContent_2sDelay_Retry")) + .setResponseDelay(com.google.protobuf.Duration.newBuilder().setSeconds(2).build()) + .build(); + RetryingFuture retryingFuture = + (RetryingFuture) httpjsonClient.blockCallable().futureCall(blockRequest); + BlockResponse blockResponse = retryingFuture.get(10, TimeUnit.SECONDS); + assertThat(blockResponse.getContent()).isEqualTo("httpjsonBlockContent_2sDelay_Retry"); + // Guarantee that this only runs twice + int attemptCount = retryingFuture.getAttemptSettings().getAttemptCount() + 1; + assertThat(attemptCount).isEqualTo(2); + } finally { + httpjsonClient.close(); + httpjsonClient.awaitTermination( + TestClientInitializer.AWAIT_TERMINATION_SECONDS, TimeUnit.SECONDS); + } + } + + // Request is set to block for 6 seconds to allow the RPC to timeout. If retries are + // disabled, the RPC timeout is set to be the totalTimeout (5s). + @Test + void + testGRPC_unaryUnsuccessfulResponse_exceedsRPCTimeoutAndTotalTimeout_throwsDeadlineExceededException() + throws Exception { + RetrySettings defaultNoRetrySettings = + RetrySettings.newBuilder() + .setInitialRpcTimeout(Duration.ofMillis(5000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ofMillis(5000L)) + .setTotalTimeout(Duration.ofMillis(5000L)) + // Explicitly set retries as disabled (maxAttempts == 1) + .setMaxAttempts(1) + .build(); + EchoClient grpcClient = + TestClientInitializer.createGrpcEchoClientCustomBlockSettings( + defaultNoRetrySettings, ImmutableSet.of(StatusCode.Code.DEADLINE_EXCEEDED)); + try { + BlockRequest blockRequest = + BlockRequest.newBuilder() + .setSuccess(BlockResponse.newBuilder().setContent("gRPCBlockContent_6sDelay_noRetry")) + .setResponseDelay(com.google.protobuf.Duration.newBuilder().setSeconds(6).build()) + .build(); + RetryingFuture retryingFuture = + (RetryingFuture) grpcClient.blockCallable().futureCall(blockRequest); + ExecutionException exception = + assertThrows(ExecutionException.class, () -> retryingFuture.get(10, TimeUnit.SECONDS)); + assertThat(exception.getCause()).isInstanceOf(DeadlineExceededException.class); + DeadlineExceededException deadlineExceededException = + (DeadlineExceededException) exception.getCause(); + assertThat(deadlineExceededException.getStatusCode().getCode()) + .isEqualTo(StatusCode.Code.DEADLINE_EXCEEDED); + // We can guarantee that this only runs once + int attemptCount = retryingFuture.getAttemptSettings().getAttemptCount() + 1; + assertThat(attemptCount).isEqualTo(1); + } finally { + grpcClient.close(); + grpcClient.awaitTermination( + TestClientInitializer.AWAIT_TERMINATION_SECONDS, TimeUnit.SECONDS); + } + } + + // Request is set to block for 6 seconds to allow the RPC to timeout. If retries are + // disabled, the RPC timeout is set to be the totalTimeout (5s). + @Test + void + testHttpJson_unaryUnsuccessfulResponse_exceedsRPCTimeoutAndTotalTimeout_throwsDeadlineExceededException() + throws Exception { + RetrySettings defaultNoRetrySettings = + RetrySettings.newBuilder() + .setInitialRpcTimeout(Duration.ofMillis(5000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ofMillis(5000L)) + .setTotalTimeout(Duration.ofMillis(5000L)) + // Explicitly set retries as disabled (maxAttempts == 1) + .setMaxAttempts(1) + .build(); + EchoClient httpjsonClient = + TestClientInitializer.createHttpJsonEchoClientCustomBlockSettings( + defaultNoRetrySettings, ImmutableSet.of(StatusCode.Code.DEADLINE_EXCEEDED)); + try { + BlockRequest blockRequest = + BlockRequest.newBuilder() + .setSuccess( + BlockResponse.newBuilder().setContent("httpjsonBlockContent_6sDelay_noRetry")) + .setResponseDelay(com.google.protobuf.Duration.newBuilder().setSeconds(6).build()) + .build(); + RetryingFuture retryingFuture = + (RetryingFuture) httpjsonClient.blockCallable().futureCall(blockRequest); + ExecutionException exception = + assertThrows(ExecutionException.class, () -> retryingFuture.get(10, TimeUnit.SECONDS)); + assertThat(exception.getCause()).isInstanceOf(DeadlineExceededException.class); + DeadlineExceededException deadlineExceededException = + (DeadlineExceededException) exception.getCause(); + assertThat(deadlineExceededException.getStatusCode().getCode()) + .isEqualTo(StatusCode.Code.DEADLINE_EXCEEDED); + // We can guarantee that this only runs once + int attemptCount = retryingFuture.getAttemptSettings().getAttemptCount() + 1; + assertThat(attemptCount).isEqualTo(1); + } finally { + httpjsonClient.close(); + httpjsonClient.awaitTermination( + TestClientInitializer.AWAIT_TERMINATION_SECONDS, TimeUnit.SECONDS); + } + } + + // The purpose of this test is to ensure that the deadlineScheduleExecutor is able + // to properly cancel the HttpRequest for each retry attempt. This test attempts to + // make a call every 100ms for 1 second. If the requestRunnable blocks until we + // receive a response from the server (200ms) regardless of it was cancelled, then + // we would expect at most 50 responses. + @Test + void testGRPC_unaryCallableRetry_deadlineExecutorTimesOutRequest_throwsDeadlineExceededException() + throws Exception { + RetrySettings defaultRetrySettings = + RetrySettings.newBuilder() + .setInitialRpcTimeout(Duration.ofMillis(100L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ofMillis(100L)) + .setTotalTimeout(Duration.ofMillis(1000L)) + .build(); + EchoClient grpcClient = + TestClientInitializer.createGrpcEchoClientCustomBlockSettings( + defaultRetrySettings, ImmutableSet.of(StatusCode.Code.DEADLINE_EXCEEDED)); + try { + BlockRequest blockRequest = + BlockRequest.newBuilder() + .setSuccess( + BlockResponse.newBuilder().setContent("gRPCBlockContent_200msDelay_Retry")) + // Set the timeout to be longer than the RPC timeout + .setResponseDelay( + com.google.protobuf.Duration.newBuilder().setNanos(200000000).build()) + .build(); + RetryingFuture retryingFuture = + (RetryingFuture) grpcClient.blockCallable().futureCall(blockRequest); + ExecutionException exception = + assertThrows(ExecutionException.class, () -> retryingFuture.get(10, TimeUnit.SECONDS)); + assertThat(exception.getCause()).isInstanceOf(DeadlineExceededException.class); + DeadlineExceededException deadlineExceededException = + (DeadlineExceededException) exception.getCause(); + assertThat(deadlineExceededException.getStatusCode().getCode()) + .isEqualTo(StatusCode.Code.DEADLINE_EXCEEDED); + // We cannot guarantee the number of attempts. The RetrySettings should be configured + // such that there is no delay between the attempts, but the execution takes time + // to run. Theoretically this should run exactly 100 times. + int attemptCount = retryingFuture.getAttemptSettings().getAttemptCount() + 1; + assertThat(attemptCount).isGreaterThan(5); + assertThat(attemptCount).isAtMost(10); + } finally { + grpcClient.close(); + grpcClient.awaitTermination( + TestClientInitializer.AWAIT_TERMINATION_SECONDS, TimeUnit.SECONDS); + } + } + + // The purpose of this test is to ensure that the deadlineScheduleExecutor is able + // to properly cancel the HttpRequest for each retry attempt. This test attempts to + // make a call every 100ms for 1 second. If the requestRunnable blocks until we + // receive a response from the server (200ms) regardless of it was cancelled, then + // we would expect at most 50 responses. + @Test + void + testHttpJson_unaryCallableRetry_deadlineExecutorTimesOutRequest_throwsDeadlineExceededException() + throws Exception { + RetrySettings defaultRetrySettings = + RetrySettings.newBuilder() + .setInitialRpcTimeout(Duration.ofMillis(100L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ofMillis(100L)) + .setTotalTimeout(Duration.ofMillis(10000L)) + .build(); + EchoClient httpjsonClient = + TestClientInitializer.createHttpJsonEchoClientCustomBlockSettings( + defaultRetrySettings, ImmutableSet.of(StatusCode.Code.DEADLINE_EXCEEDED)); + try { + BlockRequest blockRequest = + BlockRequest.newBuilder() + .setSuccess( + BlockResponse.newBuilder().setContent("httpjsonBlockContent_200msDelay_Retry")) + // Set the timeout to be longer than the RPC timeout + .setResponseDelay( + com.google.protobuf.Duration.newBuilder().setNanos(200000000).build()) + .build(); + RetryingFuture retryingFuture = + (RetryingFuture) httpjsonClient.blockCallable().futureCall(blockRequest); + ExecutionException exception = + assertThrows(ExecutionException.class, () -> retryingFuture.get(15, TimeUnit.SECONDS)); + assertThat(exception.getCause()).isInstanceOf(DeadlineExceededException.class); + DeadlineExceededException deadlineExceededException = + (DeadlineExceededException) exception.getCause(); + assertThat(deadlineExceededException.getStatusCode().getCode()) + .isEqualTo(StatusCode.Code.DEADLINE_EXCEEDED); + // We cannot guarantee the number of attempts. The RetrySettings should be configured + // such that there is no delay between the attempts, but the execution takes time + // to run. Theoretically this should run exactly 100 times. + int attemptCount = retryingFuture.getAttemptSettings().getAttemptCount() + 1; + assertThat(attemptCount).isGreaterThan(80); + assertThat(attemptCount).isAtMost(100); + } finally { + httpjsonClient.close(); + httpjsonClient.awaitTermination( + TestClientInitializer.AWAIT_TERMINATION_SECONDS, TimeUnit.SECONDS); + } + } +} diff --git a/java-showcase-3.21.0/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/ITVersionHeaders.java b/java-showcase-3.21.0/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/ITVersionHeaders.java new file mode 100644 index 0000000000..1cf9f0f577 --- /dev/null +++ b/java-showcase-3.21.0/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/ITVersionHeaders.java @@ -0,0 +1,249 @@ +/* + * 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 + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.showcase.v1beta1.it; + +import static com.google.common.truth.Truth.assertThat; +import static org.junit.jupiter.api.Assertions.assertThrows; +import static org.junit.jupiter.api.Assertions.assertTrue; + +import com.google.api.gax.httpjson.*; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.FixedHeaderProvider; +import com.google.api.gax.rpc.StubSettings; +import com.google.common.collect.ImmutableList; +import com.google.showcase.v1beta1.*; +import com.google.showcase.v1beta1.it.util.GrpcCapturingClientInterceptor; +import com.google.showcase.v1beta1.it.util.HttpJsonCapturingClientInterceptor; +import com.google.showcase.v1beta1.it.util.TestClientInitializer; +import com.google.showcase.v1beta1.stub.ComplianceStubSettings; +import com.google.showcase.v1beta1.stub.EchoStubSettings; +import io.grpc.*; +import java.io.IOException; +import java.util.ArrayList; +import java.util.concurrent.TimeUnit; +import java.util.regex.Pattern; +import org.junit.jupiter.api.AfterAll; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Test; + +// TODO: add testing on error responses once feat is implemented in showcase. +// https://github.com/googleapis/gapic-showcase/pull/1456 +// TODO: watch for showcase gRPC trailer changes suggested in +// https://github.com/googleapis/gapic-showcase/pull/1509#issuecomment-2089147103 +class ITVersionHeaders { + private static final String HTTP_RESPONSE_HEADER_STRING = + "x-showcase-request-" + ApiClientHeaderProvider.API_VERSION_HEADER_KEY; + private static final String HTTP_CLIENT_API_HEADER_KEY = + "x-showcase-request-" + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(); + private static final Metadata.Key API_VERSION_HEADER_KEY = + Metadata.Key.of( + ApiClientHeaderProvider.API_VERSION_HEADER_KEY, Metadata.ASCII_STRING_MARSHALLER); + + private static final Metadata.Key API_CLIENT_HEADER_KEY = + Metadata.Key.of( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), Metadata.ASCII_STRING_MARSHALLER); + + private static final String EXPECTED_ECHO_API_VERSION = "v1_20240408"; + private static final String CUSTOM_API_VERSION = "user-supplied-version"; + private static final String EXPECTED_EXCEPTION_MESSAGE = + "Header provider can't override the header: " + + ApiClientHeaderProvider.API_VERSION_HEADER_KEY; + + private static HttpJsonCapturingClientInterceptor httpJsonInterceptor; + private static GrpcCapturingClientInterceptor grpcInterceptor; + private static HttpJsonCapturingClientInterceptor httpJsonComplianceInterceptor; + private static GrpcCapturingClientInterceptor grpcComplianceInterceptor; + private static EchoClient grpcClient; + private static EchoClient httpJsonClient; + private static ComplianceClient grpcComplianceClient; + private static ComplianceClient httpJsonComplianceClient; + + @BeforeAll + static void createClients() throws Exception { + // Create gRPC Interceptor and Client + grpcInterceptor = new GrpcCapturingClientInterceptor(); + grpcClient = TestClientInitializer.createGrpcEchoClient(ImmutableList.of(grpcInterceptor)); + + // Create HttpJson Interceptor and Client + httpJsonInterceptor = new HttpJsonCapturingClientInterceptor(); + httpJsonClient = + TestClientInitializer.createHttpJsonEchoClient(ImmutableList.of(httpJsonInterceptor)); + + // Create gRPC ComplianceClient and Interceptor + // Creating a compliance client to test case where api version is not set + grpcComplianceInterceptor = new GrpcCapturingClientInterceptor(); + grpcComplianceClient = + TestClientInitializer.createGrpcComplianceClient( + ImmutableList.of(grpcComplianceInterceptor)); + + // Create HttpJson ComplianceClient and Interceptor + httpJsonComplianceInterceptor = new HttpJsonCapturingClientInterceptor(); + httpJsonComplianceClient = + TestClientInitializer.createHttpJsonComplianceClient( + ImmutableList.of(httpJsonComplianceInterceptor)); + } + + @AfterAll + static void destroyClient() throws InterruptedException { + grpcClient.close(); + httpJsonClient.close(); + grpcComplianceClient.close(); + httpJsonComplianceClient.close(); + + grpcClient.awaitTermination(TestClientInitializer.AWAIT_TERMINATION_SECONDS, TimeUnit.SECONDS); + httpJsonClient.awaitTermination( + TestClientInitializer.AWAIT_TERMINATION_SECONDS, TimeUnit.SECONDS); + grpcComplianceClient.awaitTermination( + TestClientInitializer.AWAIT_TERMINATION_SECONDS, TimeUnit.SECONDS); + httpJsonComplianceClient.awaitTermination( + TestClientInitializer.AWAIT_TERMINATION_SECONDS, TimeUnit.SECONDS); + } + + @Test + void testGrpc_matchesApiVersion() { + grpcClient.echo(EchoRequest.newBuilder().build()); + String headerValue = grpcInterceptor.metadata.get(API_VERSION_HEADER_KEY); + assertThat(headerValue).isEqualTo(EXPECTED_ECHO_API_VERSION); + } + + @Test + void testHttpJson_matchesHeaderName() { + httpJsonClient.echo(EchoRequest.newBuilder().build()); + ArrayList headerValues = + (ArrayList) httpJsonInterceptor.metadata.getHeaders().get(HTTP_RESPONSE_HEADER_STRING); + String headerValue = (String) headerValues.get(0); + assertThat(headerValue).isEqualTo(EXPECTED_ECHO_API_VERSION); + } + + @Test + void testGrpc_noApiVersion() { + RepeatRequest request = + RepeatRequest.newBuilder().setInfo(ComplianceData.newBuilder().setFString("test")).build(); + grpcComplianceClient.repeatDataSimplePath(request); + assertThat(API_VERSION_HEADER_KEY).isNotIn(grpcComplianceInterceptor.metadata.keys()); + } + + @Test + void testHttpJson_noApiVersion() { + RepeatRequest request = + RepeatRequest.newBuilder().setInfo(ComplianceData.newBuilder().setFString("test")).build(); + httpJsonComplianceClient.repeatDataSimplePath(request); + assertThat(API_VERSION_HEADER_KEY) + .isNotIn(httpJsonComplianceInterceptor.metadata.getHeaders().keySet()); + } + + @Test + void testGrpcEcho_userApiVersionThrowsException() throws IOException { + StubSettings stubSettings = + grpcClient.getSettings().getStubSettings().toBuilder() + .setHeaderProvider( + FixedHeaderProvider.create( + ApiClientHeaderProvider.API_VERSION_HEADER_KEY, CUSTOM_API_VERSION)) + .build(); + + IllegalArgumentException exception = + assertThrows( + IllegalArgumentException.class, + () -> EchoClient.create(EchoSettings.create((EchoStubSettings) stubSettings))); + assertThat(exception.getMessage()).isEqualTo(EXPECTED_EXCEPTION_MESSAGE); + } + + @Test + void testHttpJsonEcho_userApiVersionThrowsException() throws IOException { + StubSettings stubSettings = + httpJsonClient.getSettings().getStubSettings().toBuilder() + .setHeaderProvider( + FixedHeaderProvider.create( + ApiClientHeaderProvider.API_VERSION_HEADER_KEY, CUSTOM_API_VERSION)) + .build(); + + IllegalArgumentException exception = + assertThrows( + IllegalArgumentException.class, + () -> EchoClient.create(EchoSettings.create((EchoStubSettings) stubSettings))); + assertThat(exception.getMessage()).isEqualTo(EXPECTED_EXCEPTION_MESSAGE); + } + + @Test + void testGrpcCompliance_userApiVersionSetSuccess() throws IOException { + StubSettings stubSettingsWithApiVersionHeader = + grpcComplianceClient.getSettings().getStubSettings().toBuilder() + .setHeaderProvider( + FixedHeaderProvider.create( + ApiClientHeaderProvider.API_VERSION_HEADER_KEY, CUSTOM_API_VERSION)) + .build(); + try (ComplianceClient customComplianceClient = + ComplianceClient.create( + ComplianceSettings.create((ComplianceStubSettings) stubSettingsWithApiVersionHeader))) { + + RepeatRequest request = + RepeatRequest.newBuilder() + .setInfo(ComplianceData.newBuilder().setFString("test")) + .build(); + customComplianceClient.repeatDataSimplePath(request); + String headerValue = grpcComplianceInterceptor.metadata.get(API_VERSION_HEADER_KEY); + assertThat(headerValue).isEqualTo(CUSTOM_API_VERSION); + } + } + + @Test + void testHttpJsonCompliance_userApiVersionSetSuccess() throws IOException { + StubSettings httpJsonStubSettingsWithApiVersionHeader = + httpJsonComplianceClient.getSettings().getStubSettings().toBuilder() + .setHeaderProvider( + FixedHeaderProvider.create( + ApiClientHeaderProvider.API_VERSION_HEADER_KEY, CUSTOM_API_VERSION)) + .build(); + try (ComplianceClient customComplianceClient = + ComplianceClient.create( + ComplianceSettings.create( + (ComplianceStubSettings) httpJsonStubSettingsWithApiVersionHeader))) { + + RepeatRequest request = + RepeatRequest.newBuilder() + .setInfo(ComplianceData.newBuilder().setFString("test")) + .build(); + customComplianceClient.repeatDataSimplePath(request); + + ArrayList headerValues = + (ArrayList) + httpJsonComplianceInterceptor.metadata.getHeaders().get(HTTP_RESPONSE_HEADER_STRING); + String headerValue = (String) headerValues.get(0); + assertThat(headerValue).isEqualTo(CUSTOM_API_VERSION); + } + } + + @Test + void testGrpcCall_sendsCorrectApiClientHeader() { + Pattern defautlGrpcHeaderPattern = + Pattern.compile("gl-java/.* gapic/.*?--protobuf-\\d.* gax/.* grpc/.* protobuf/\\d.*"); + grpcClient.echo(EchoRequest.newBuilder().build()); + String headerValue = grpcInterceptor.metadata.get(API_CLIENT_HEADER_KEY); + assertTrue(defautlGrpcHeaderPattern.matcher(headerValue).matches()); + } + + @Test + void testHttpJson_sendsCorrectApiClientHeader() { + Pattern defautlHttpHeaderPattern = + Pattern.compile("gl-java/.* gapic/.*?--protobuf-\\d.* gax/.* rest/ protobuf/\\d.*"); + httpJsonClient.echo(EchoRequest.newBuilder().build()); + ArrayList headerValues = + (ArrayList) + httpJsonInterceptor.metadata.getHeaders().get(HTTP_CLIENT_API_HEADER_KEY); + String headerValue = headerValues.get(0); + assertTrue(defautlHttpHeaderPattern.matcher(headerValue).matches()); + } +} diff --git a/java-showcase-3.21.0/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/logging/ITLogging.java b/java-showcase-3.21.0/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/logging/ITLogging.java new file mode 100644 index 0000000000..5979b88c41 --- /dev/null +++ b/java-showcase-3.21.0/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/logging/ITLogging.java @@ -0,0 +1,257 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.it.logging; + +import static com.google.common.truth.Truth.assertThat; + +import ch.qos.logback.classic.Level; +import ch.qos.logback.classic.spi.ILoggingEvent; +import com.google.api.gax.grpc.GrpcLoggingInterceptor; +import com.google.api.gax.httpjson.HttpJsonLoggingInterceptor; +import com.google.common.collect.ImmutableMap; +import com.google.showcase.v1beta1.EchoClient; +import com.google.showcase.v1beta1.EchoRequest; +import com.google.showcase.v1beta1.EchoResponse; +import com.google.showcase.v1beta1.it.util.TestClientInitializer; +import java.util.List; +import java.util.Map; +import java.util.concurrent.TimeUnit; +import org.junit.jupiter.api.AfterAll; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Test; +import org.slf4j.LoggerFactory; +import org.slf4j.event.KeyValuePair; + +// This test needs to run with GOOGLE_SDK_JAVA_LOGGING=true +// mvn clean verify -P '!showcase,enable-integration-tests,loggingTestBase,slf4j2_logback' +public class ITLogging { + private static EchoClient grpcClient; + + private static EchoClient httpjsonClient; + + private static final KeyValuePair SERVICE_NAME_KEY_VALUE_PAIR = + new KeyValuePair("serviceName", "google.showcase.v1beta1.Echo"); + private static final KeyValuePair RPC_NAME_KEY_VALUE_PAIR = + new KeyValuePair("rpcName", "google.showcase.v1beta1.Echo/Echo"); + private static final KeyValuePair RESPONSE_STATUS_KEY_VALUE_PAIR = + new KeyValuePair("response.status", "OK"); + private static final KeyValuePair RESPONSE_STATUS_KEY_VALUE_PAIR_HTTP = + new KeyValuePair("response.status", "200"); + private static final KeyValuePair REQUEST_URL_KEY_VALUE_PAIR = + new KeyValuePair("request.url", "http://localhost:7469"); + + private static final KeyValuePair RESPONSE_HEADERS_KEY_VALUE_PAIR = + new KeyValuePair("response.headers", ImmutableMap.of("content-type", "application/grpc")); + + private static final String SENDING_REQUEST_MESSAGE = "Sending request"; + private static final String RECEIVING_RESPONSE_MESSAGE = "Received response"; + private static final String ECHO_STRING = "echo?"; + + private TestAppender setupTestLogger(Class clazz, Level level) { + TestAppender testAppender = new TestAppender(); + testAppender.start(); + org.slf4j.Logger logger = LoggerFactory.getLogger(clazz); + ((ch.qos.logback.classic.Logger) logger).setLevel(level); + ((ch.qos.logback.classic.Logger) logger).addAppender(testAppender); + return testAppender; + } + + @BeforeAll + static void createClients() throws Exception { + // Create gRPC Echo Client + grpcClient = TestClientInitializer.createGrpcEchoClient(); + // Create Http JSON Echo Client + httpjsonClient = TestClientInitializer.createHttpJsonEchoClient(); + } + + @AfterAll + static void destroyClients() throws InterruptedException { + grpcClient.close(); + httpjsonClient.close(); + + grpcClient.awaitTermination(TestClientInitializer.AWAIT_TERMINATION_SECONDS, TimeUnit.SECONDS); + httpjsonClient.awaitTermination( + TestClientInitializer.AWAIT_TERMINATION_SECONDS, TimeUnit.SECONDS); + } + + @Test + void testGrpc_receiveContent_logDebug() { + TestAppender testAppender = setupTestLogger(GrpcLoggingInterceptor.class, Level.DEBUG); + assertThat(echoGrpc(ECHO_STRING)).isEqualTo(ECHO_STRING); + + assertThat(testAppender.events.size()).isEqualTo(2); + // logging event for request + ILoggingEvent loggingEvent1 = testAppender.events.get(0); + assertThat(loggingEvent1.getMessage()).isEqualTo(SENDING_REQUEST_MESSAGE); + assertThat(loggingEvent1.getLevel()).isEqualTo(Level.DEBUG); + List keyValuePairs = loggingEvent1.getKeyValuePairs(); + assertThat(keyValuePairs.size()).isEqualTo(4); + assertThat(keyValuePairs).containsAtLeast(SERVICE_NAME_KEY_VALUE_PAIR, RPC_NAME_KEY_VALUE_PAIR); + + for (KeyValuePair kvp : keyValuePairs) { + if (kvp.key.equals("request.payload")) { + Map payload = (Map) kvp.value; + assertThat(payload.get("content")).isEqualTo(ECHO_STRING); + assertThat(payload.get("requestId")).isNotNull(); + assertThat(payload.get("otherRequestId")).isNotNull(); + } + if (kvp.key.equals("request.headers")) { + Map headers = (Map) kvp.value; + assertThat(headers).containsKey("x-goog-api-version"); + assertThat(headers).containsKey("x-goog-api-client"); + } + } + + // logging event for response + ILoggingEvent loggingEvent2 = testAppender.events.get(1); + assertThat(loggingEvent2.getMessage()).isEqualTo(RECEIVING_RESPONSE_MESSAGE); + + assertThat(loggingEvent2.getLevel()).isEqualTo(Level.DEBUG); + List keyValuePairs2 = loggingEvent2.getKeyValuePairs(); + assertThat(keyValuePairs2.size()).isEqualTo(5); + assertThat(keyValuePairs2) + .containsAtLeast( + RESPONSE_STATUS_KEY_VALUE_PAIR, + RESPONSE_HEADERS_KEY_VALUE_PAIR, + SERVICE_NAME_KEY_VALUE_PAIR, + RPC_NAME_KEY_VALUE_PAIR); + for (KeyValuePair kvp : keyValuePairs2) { + if (kvp.key.equals("response.payload")) { + Map payload = (Map) kvp.value; + assertThat(payload.get("content")).isEqualTo(ECHO_STRING); + assertThat(payload.get("requestId")).isNotNull(); + assertThat(payload.get("otherRequestId")).isNotNull(); + } + } + testAppender.stop(); + } + + @Test + void testGrpc_receiveContent_logInfo() { + TestAppender testAppender = setupTestLogger(GrpcLoggingInterceptor.class, Level.INFO); + assertThat(echoGrpc(ECHO_STRING)).isEqualTo(ECHO_STRING); + + assertThat(testAppender.events.size()).isEqualTo(2); + // logging event for request + ILoggingEvent loggingEvent1 = testAppender.events.get(0); + assertThat(loggingEvent1.getMessage()).isEqualTo(SENDING_REQUEST_MESSAGE); + assertThat(loggingEvent1.getLevel()).isEqualTo(Level.INFO); + List keyValuePairs = loggingEvent1.getKeyValuePairs(); + assertThat(keyValuePairs.size()).isEqualTo(2); + assertThat(keyValuePairs).containsAtLeast(SERVICE_NAME_KEY_VALUE_PAIR, RPC_NAME_KEY_VALUE_PAIR); + + // logging event for response + ILoggingEvent loggingEvent2 = testAppender.events.get(1); + assertThat(loggingEvent2.getMessage()).isEqualTo(RECEIVING_RESPONSE_MESSAGE); + + assertThat(loggingEvent2.getLevel()).isEqualTo(Level.INFO); + List keyValuePairs2 = loggingEvent2.getKeyValuePairs(); + assertThat(keyValuePairs2.size()).isEqualTo(3); + assertThat(keyValuePairs2) + .containsAtLeast( + RESPONSE_STATUS_KEY_VALUE_PAIR, SERVICE_NAME_KEY_VALUE_PAIR, RPC_NAME_KEY_VALUE_PAIR); + testAppender.stop(); + } + + @Test + void testHttpJson_receiveContent_logDebug() { + TestAppender testAppender = setupTestLogger(HttpJsonLoggingInterceptor.class, Level.DEBUG); + assertThat(echoHttpJson(ECHO_STRING)).isEqualTo(ECHO_STRING); + assertThat(testAppender.events.size()).isEqualTo(2); + // logging event for request + ILoggingEvent loggingEvent1 = testAppender.events.get(0); + assertThat(loggingEvent1.getMessage()).isEqualTo(SENDING_REQUEST_MESSAGE); + assertThat(loggingEvent1.getLevel()).isEqualTo(Level.DEBUG); + List keyValuePairs = loggingEvent1.getKeyValuePairs(); + assertThat(keyValuePairs.size()).isEqualTo(4); + assertThat(keyValuePairs).contains(RPC_NAME_KEY_VALUE_PAIR); + assertThat(keyValuePairs).contains(REQUEST_URL_KEY_VALUE_PAIR); + + for (KeyValuePair kvp : keyValuePairs) { + if (kvp.key.equals("request.payload")) { + Map payload = (Map) kvp.value; + assertThat(payload.get("content")).isEqualTo(ECHO_STRING); + assertThat(payload.get("requestId")).isNotNull(); + assertThat(payload.get("otherRequestId")).isNotNull(); + } + if (kvp.key.equals("request.headers")) { + Map headers = (Map) kvp.value; + assertThat(headers).containsKey("x-goog-api-version"); + assertThat(headers).containsKey("x-goog-api-client"); + } + } + + // logging event for response + ILoggingEvent loggingEvent2 = testAppender.events.get(1); + assertThat(loggingEvent2.getMessage()).isEqualTo(RECEIVING_RESPONSE_MESSAGE); + + assertThat(loggingEvent2.getLevel()).isEqualTo(Level.DEBUG); + List keyValuePairs2 = loggingEvent2.getKeyValuePairs(); + assertThat(keyValuePairs2.size()).isEqualTo(4); + assertThat(keyValuePairs2) + .containsAtLeast(RESPONSE_STATUS_KEY_VALUE_PAIR_HTTP, RPC_NAME_KEY_VALUE_PAIR); + for (KeyValuePair kvp : keyValuePairs2) { + if (kvp.key.equals("response.payload")) { + Map payload = (Map) kvp.value; + assertThat(payload.get("content")).isEqualTo(ECHO_STRING); + assertThat(payload.get("requestId")).isNotNull(); + assertThat(payload.get("otherRequestId")).isNotNull(); + } + if (kvp.key.equals("response.headers")) { + Map headers = (Map) kvp.value; + assertThat(headers.size()).isEqualTo(11); + } + } + testAppender.stop(); + } + + @Test + void testHttpJson_receiveContent_logInfo() { + TestAppender testAppender = setupTestLogger(HttpJsonLoggingInterceptor.class, Level.INFO); + assertThat(echoHttpJson(ECHO_STRING)).isEqualTo(ECHO_STRING); + assertThat(testAppender.events.size()).isEqualTo(2); + // logging event for request + ILoggingEvent loggingEvent1 = testAppender.events.get(0); + assertThat(loggingEvent1.getMessage()).isEqualTo(SENDING_REQUEST_MESSAGE); + assertThat(loggingEvent1.getLevel()).isEqualTo(Level.INFO); + List keyValuePairs = loggingEvent1.getKeyValuePairs(); + assertThat(keyValuePairs.size()).isEqualTo(2); + assertThat(keyValuePairs).contains(RPC_NAME_KEY_VALUE_PAIR); + assertThat(keyValuePairs).contains(REQUEST_URL_KEY_VALUE_PAIR); + + // logging event for response + ILoggingEvent loggingEvent2 = testAppender.events.get(1); + assertThat(loggingEvent2.getMessage()).isEqualTo(RECEIVING_RESPONSE_MESSAGE); + + assertThat(loggingEvent2.getLevel()).isEqualTo(Level.INFO); + List keyValuePairs2 = loggingEvent2.getKeyValuePairs(); + assertThat(keyValuePairs2.size()).isEqualTo(2); + assertThat(keyValuePairs2) + .containsAtLeast(RESPONSE_STATUS_KEY_VALUE_PAIR_HTTP, RPC_NAME_KEY_VALUE_PAIR); + testAppender.stop(); + } + + private String echoGrpc(String value) { + EchoResponse response = grpcClient.echo(EchoRequest.newBuilder().setContent(value).build()); + return response.getContent(); + } + + private String echoHttpJson(String value) { + EchoResponse response = httpjsonClient.echo(EchoRequest.newBuilder().setContent(value).build()); + return response.getContent(); + } +} diff --git a/java-showcase-3.21.0/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/logging/ITLogging1x.java b/java-showcase-3.21.0/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/logging/ITLogging1x.java new file mode 100644 index 0000000000..d0dec4b80d --- /dev/null +++ b/java-showcase-3.21.0/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/logging/ITLogging1x.java @@ -0,0 +1,217 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.it.logging; + +import static com.google.common.truth.Truth.assertThat; + +import ch.qos.logback.classic.Level; +import ch.qos.logback.classic.spi.ILoggingEvent; +import com.google.api.gax.grpc.GrpcLoggingInterceptor; +import com.google.api.gax.httpjson.HttpJsonLoggingInterceptor; +import com.google.common.collect.ImmutableMap; +import com.google.showcase.v1beta1.EchoClient; +import com.google.showcase.v1beta1.EchoRequest; +import com.google.showcase.v1beta1.EchoResponse; +import com.google.showcase.v1beta1.it.util.TestClientInitializer; +import java.util.Map; +import java.util.concurrent.TimeUnit; +import org.junit.jupiter.api.AfterAll; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Test; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +// This test needs to run with GOOGLE_SDK_JAVA_LOGGING=true +// mvn verify -P +// '!showcase,enable-integration-tests,loggingTestBase,slf4j1_logback ' +public class ITLogging1x { + private static EchoClient grpcClient; + + private static EchoClient httpjsonClient; + + private static final String ECHO_STRING = "echo?"; + private static final String SERVICE_NAME = "google.showcase.v1beta1.Echo"; + private static final String RPC_NAME = "google.showcase.v1beta1.Echo/Echo"; + private static final String ENDPOINT = "http://localhost:7469"; + private static final String SENDING_REQUEST_MESSAGE = "Sending request"; + private static final String RECEIVING_RESPONSE_MESSAGE = "Received response"; + + private static Logger logger = LoggerFactory.getLogger(ITLogging1x.class); + + private TestAppender setupTestLogger(Class clazz, Level level) { + TestAppender testAppender = new TestAppender(); + testAppender.start(); + Logger logger = LoggerFactory.getLogger(clazz); + ((ch.qos.logback.classic.Logger) logger).setLevel(level); + ((ch.qos.logback.classic.Logger) logger).addAppender(testAppender); + return testAppender; + } + + @BeforeAll + static void createClients() throws Exception { + // Create gRPC Echo Client + grpcClient = TestClientInitializer.createGrpcEchoClient(); + // Create Http JSON Echo Client + httpjsonClient = TestClientInitializer.createHttpJsonEchoClient(); + } + + @AfterAll + static void destroyClients() throws InterruptedException { + grpcClient.close(); + httpjsonClient.close(); + + grpcClient.awaitTermination(TestClientInitializer.AWAIT_TERMINATION_SECONDS, TimeUnit.SECONDS); + httpjsonClient.awaitTermination( + TestClientInitializer.AWAIT_TERMINATION_SECONDS, TimeUnit.SECONDS); + } + + @Test + void test() { + assertThat(logger.isInfoEnabled()).isTrue(); + assertThat(logger.isDebugEnabled()).isTrue(); + } + + @Test + void testGrpc_receiveContent_logDebug() { + TestAppender testAppender = setupTestLogger(GrpcLoggingInterceptor.class, Level.DEBUG); + assertThat(echoGrpc(ECHO_STRING)).isEqualTo(ECHO_STRING); + + assertThat(testAppender.events.size()).isEqualTo(2); + // logging event for request + ILoggingEvent loggingEvent1 = testAppender.events.get(0); + assertThat(loggingEvent1.getMessage()).isEqualTo(SENDING_REQUEST_MESSAGE); + assertThat(loggingEvent1.getLevel()).isEqualTo(Level.DEBUG); + Map mdcPropertyMap = loggingEvent1.getMDCPropertyMap(); + assertThat(mdcPropertyMap) + .containsAtLeastEntriesIn( + ImmutableMap.of("serviceName", SERVICE_NAME, "rpcName", RPC_NAME)); + assertThat(mdcPropertyMap).containsKey("request.headers"); + assertThat(mdcPropertyMap.get("request.headers")).startsWith("{\"x-goog-api-"); + + assertThat(mdcPropertyMap).containsKey("request.payload"); + assertThat(mdcPropertyMap.get("request.payload")) + .startsWith("{\"content\":\"echo?\",\"requestId\":"); + + // logging event for response + ILoggingEvent loggingEvent2 = testAppender.events.get(1); + assertThat(loggingEvent2.getMessage()).isEqualTo(RECEIVING_RESPONSE_MESSAGE); + assertThat(loggingEvent2.getLevel()).isEqualTo(Level.DEBUG); + Map responseMdcPropertyMap = loggingEvent2.getMDCPropertyMap(); + assertThat(responseMdcPropertyMap) + .containsAtLeastEntriesIn( + ImmutableMap.of( + "serviceName", SERVICE_NAME, "rpcName", RPC_NAME, "response.status", "OK")); + assertThat(responseMdcPropertyMap).containsKey("response.payload"); + assertThat(responseMdcPropertyMap).containsKey("response.headers"); + + testAppender.stop(); + } + + @Test + void testGrpc_receiveContent_logInfo() { + TestAppender testAppender = setupTestLogger(GrpcLoggingInterceptor.class, Level.INFO); + assertThat(echoGrpc(ECHO_STRING)).isEqualTo(ECHO_STRING); + + assertThat(testAppender.events.size()).isEqualTo(2); + // logging event for request + ILoggingEvent loggingEvent1 = testAppender.events.get(0); + assertThat(loggingEvent1.getMessage()).isEqualTo(SENDING_REQUEST_MESSAGE); + assertThat(loggingEvent1.getLevel()).isEqualTo(Level.INFO); + Map mdcPropertyMap = loggingEvent1.getMDCPropertyMap(); + assertThat(mdcPropertyMap) + .containsExactlyEntriesIn( + ImmutableMap.of("serviceName", SERVICE_NAME, "rpcName", RPC_NAME)); + + // logging event for response + ILoggingEvent loggingEvent2 = testAppender.events.get(1); + assertThat(loggingEvent2.getMessage()).isEqualTo(RECEIVING_RESPONSE_MESSAGE); + assertThat(loggingEvent2.getLevel()).isEqualTo(Level.INFO); + Map responseMdcPropertyMap = loggingEvent2.getMDCPropertyMap(); + assertThat(responseMdcPropertyMap) + .containsExactlyEntriesIn( + ImmutableMap.of( + "serviceName", SERVICE_NAME, "rpcName", RPC_NAME, "response.status", "OK")); + + testAppender.stop(); + } + + @Test + void testHttpJson_receiveContent_logDebug() { + TestAppender testAppender = setupTestLogger(HttpJsonLoggingInterceptor.class, Level.DEBUG); + assertThat(echoHttpJson(ECHO_STRING)).isEqualTo(ECHO_STRING); + assertThat(testAppender.events.size()).isEqualTo(2); + // logging event for request + ILoggingEvent loggingEvent1 = testAppender.events.get(0); + assertThat(loggingEvent1.getMessage()).isEqualTo(SENDING_REQUEST_MESSAGE); + assertThat(loggingEvent1.getLevel()).isEqualTo(Level.DEBUG); + Map mdcPropertyMap = loggingEvent1.getMDCPropertyMap(); + assertThat(mdcPropertyMap).containsEntry("rpcName", RPC_NAME); + assertThat(mdcPropertyMap).containsEntry("request.url", ENDPOINT); + assertThat(mdcPropertyMap).containsKey("request.headers"); + assertThat(mdcPropertyMap.get("request.headers")).startsWith("{\"x-goog-api-"); + assertThat(mdcPropertyMap).containsKey("request.payload"); + assertThat(mdcPropertyMap.get("request.payload")) + .startsWith("{\"content\":\"echo?\",\"requestId\":"); + + // logging event for response + ILoggingEvent loggingEvent2 = testAppender.events.get(1); + assertThat(loggingEvent2.getMessage()).isEqualTo(RECEIVING_RESPONSE_MESSAGE); + assertThat(loggingEvent2.getLevel()).isEqualTo(Level.DEBUG); + Map responseMdcPropertyMap = loggingEvent2.getMDCPropertyMap(); + assertThat(responseMdcPropertyMap) + .containsAtLeastEntriesIn(ImmutableMap.of("rpcName", RPC_NAME, "response.status", "200")); + assertThat(responseMdcPropertyMap).containsKey("response.payload"); + assertThat(responseMdcPropertyMap).containsKey("response.headers"); + testAppender.stop(); + } + + @Test + void testHttpJson_receiveContent_logInfo() { + TestAppender testAppender = setupTestLogger(HttpJsonLoggingInterceptor.class, Level.INFO); + assertThat(echoHttpJson(ECHO_STRING)).isEqualTo(ECHO_STRING); + assertThat(testAppender.events.size()).isEqualTo(2); + // logging event for request + ILoggingEvent loggingEvent1 = testAppender.events.get(0); + assertThat(loggingEvent1.getMessage()).isEqualTo(SENDING_REQUEST_MESSAGE); + assertThat(loggingEvent1.getLevel()).isEqualTo(Level.INFO); + Map mdcPropertyMap = loggingEvent1.getMDCPropertyMap(); + assertThat(mdcPropertyMap) + .containsExactlyEntriesIn( + ImmutableMap.of( + "rpcName", RPC_NAME, + "request.url", ENDPOINT)); + + // logging event for response + ILoggingEvent loggingEvent2 = testAppender.events.get(1); + assertThat(loggingEvent2.getMessage()).isEqualTo(RECEIVING_RESPONSE_MESSAGE); + assertThat(loggingEvent2.getLevel()).isEqualTo(Level.INFO); + Map responseMdcPropertyMap = loggingEvent2.getMDCPropertyMap(); + assertThat(responseMdcPropertyMap) + .containsExactlyEntriesIn(ImmutableMap.of("rpcName", RPC_NAME, "response.status", "200")); + testAppender.stop(); + } + + private String echoGrpc(String value) { + EchoResponse response = grpcClient.echo(EchoRequest.newBuilder().setContent(value).build()); + return response.getContent(); + } + + private String echoHttpJson(String value) { + EchoResponse response = httpjsonClient.echo(EchoRequest.newBuilder().setContent(value).build()); + return response.getContent(); + } +} diff --git a/java-showcase-3.21.0/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/logging/ITLoggingDisabled.java b/java-showcase-3.21.0/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/logging/ITLoggingDisabled.java new file mode 100644 index 0000000000..16c6acb0a6 --- /dev/null +++ b/java-showcase-3.21.0/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/logging/ITLoggingDisabled.java @@ -0,0 +1,78 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.it.logging; + +import static com.google.common.truth.Truth.assertThat; + +import ch.qos.logback.classic.Level; +import ch.qos.logback.classic.spi.ILoggingEvent; +import ch.qos.logback.core.read.ListAppender; +import com.google.api.gax.grpc.GrpcLoggingInterceptor; +import com.google.showcase.v1beta1.EchoClient; +import com.google.showcase.v1beta1.EchoRequest; +import com.google.showcase.v1beta1.EchoResponse; +import com.google.showcase.v1beta1.it.util.TestClientInitializer; +import java.util.concurrent.TimeUnit; +import org.junit.jupiter.api.AfterAll; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Test; +import org.slf4j.LoggerFactory; + +// mvn verify -P '!showcase,enable-integration-tests,loggingTestBase,disabledLogging' +public class ITLoggingDisabled { + + private static EchoClient grpcClient; + private static final String ECHO_STRING = "echo?"; + + private TestAppender setupTestLogger(Class clazz) { + TestAppender testAppender = new TestAppender(); + testAppender.start(); + ListAppender listAppender = new ListAppender<>(); + listAppender.start(); + org.slf4j.Logger logger = LoggerFactory.getLogger(clazz); + ((ch.qos.logback.classic.Logger) logger).setLevel(Level.DEBUG); + ((ch.qos.logback.classic.Logger) logger).addAppender(testAppender); + return testAppender; + } + + @BeforeAll + static void createClients() throws Exception { + // Create gRPC Echo Client + grpcClient = TestClientInitializer.createGrpcEchoClient(); + } + + @AfterAll + static void destroyClients() throws InterruptedException { + grpcClient.close(); + + grpcClient.awaitTermination(TestClientInitializer.AWAIT_TERMINATION_SECONDS, TimeUnit.SECONDS); + } + + // only run when GOOGLE_SDK_JAVA_LOGGING!=true + @Test + void testloggingDisabled() { + TestAppender testAppender = setupTestLogger(GrpcLoggingInterceptor.class); + assertThat(echoGrpc(ECHO_STRING)).isEqualTo(ECHO_STRING); + + assertThat(testAppender.events.size()).isEqualTo(0); + } + + private String echoGrpc(String value) { + EchoResponse response = grpcClient.echo(EchoRequest.newBuilder().setContent(value).build()); + return response.getContent(); + } +} diff --git a/java-showcase-3.21.0/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/logging/TestAppender.java b/java-showcase-3.21.0/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/logging/TestAppender.java new file mode 100644 index 0000000000..92a6996936 --- /dev/null +++ b/java-showcase-3.21.0/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/logging/TestAppender.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.showcase.v1beta1.it.logging; + +import ch.qos.logback.classic.spi.ILoggingEvent; +import ch.qos.logback.core.AppenderBase; +import java.util.ArrayList; +import java.util.List; + +/** Logback appender used to set up tests. */ +public class TestAppender extends AppenderBase { + public List events = new ArrayList<>(); + + @Override + protected void append(ILoggingEvent eventObject) { + // triggering Logback to capture the current MDC context and store it with the log event + // the default ListAppender does not capture MDC contents + eventObject.getMDCPropertyMap(); + + events.add(eventObject); + } + + public void clearEvents() { + events.clear(); + } +} diff --git a/java-showcase-3.21.0/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/util/GrpcCapturingClientInterceptor.java b/java-showcase-3.21.0/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/util/GrpcCapturingClientInterceptor.java new file mode 100644 index 0000000000..e7d2a01f56 --- /dev/null +++ b/java-showcase-3.21.0/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/util/GrpcCapturingClientInterceptor.java @@ -0,0 +1,83 @@ +/* + * 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 + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.it.util; + +import io.grpc.CallOptions; +import io.grpc.Channel; +import io.grpc.ClientCall; +import io.grpc.ClientInterceptor; +import io.grpc.ForwardingClientCall; +import io.grpc.Metadata; +import io.grpc.MethodDescriptor; +import io.grpc.Status; + +/** Implements a client interceptor to retrieve the metadata from a GRPC client request. */ +public class GrpcCapturingClientInterceptor implements ClientInterceptor { + public Metadata metadata; + + @Override + public ClientCall interceptCall( + MethodDescriptor method, final CallOptions callOptions, Channel next) { + ClientCall call = next.newCall(method, callOptions); + return new ForwardingClientCall.SimpleForwardingClientCall(call) { + @Override + public void start(Listener responseListener, Metadata headers) { + Listener wrappedListener = + new SimpleForwardingClientCallListener(responseListener) { + @Override + public void onClose(Status status, Metadata trailers) { + if (status.isOk()) { + metadata = trailers; + } + super.onClose(status, trailers); + } + }; + + super.start(wrappedListener, headers); + } + }; + } + + private static class SimpleForwardingClientCallListener + extends ClientCall.Listener { + private final ClientCall.Listener delegate; + + SimpleForwardingClientCallListener(ClientCall.Listener delegate) { + this.delegate = delegate; + } + + @Override + public void onHeaders(Metadata headers) { + delegate.onHeaders(headers); + } + + @Override + public void onMessage(RespT message) { + delegate.onMessage(message); + } + + @Override + public void onClose(Status status, Metadata trailers) { + delegate.onClose(status, trailers); + } + + @Override + public void onReady() { + delegate.onReady(); + } + } +} diff --git a/java-showcase-3.21.0/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/util/HttpJsonCapturingClientInterceptor.java b/java-showcase-3.21.0/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/util/HttpJsonCapturingClientInterceptor.java new file mode 100644 index 0000000000..ec9b9da9cb --- /dev/null +++ b/java-showcase-3.21.0/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/util/HttpJsonCapturingClientInterceptor.java @@ -0,0 +1,66 @@ +/* + * 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 + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.it.util; + +import com.google.api.gax.httpjson.ApiMethodDescriptor; +import com.google.api.gax.httpjson.ForwardingHttpJsonClientCall; +import com.google.api.gax.httpjson.ForwardingHttpJsonClientCallListener; +import com.google.api.gax.httpjson.HttpJsonCallOptions; +import com.google.api.gax.httpjson.HttpJsonChannel; +import com.google.api.gax.httpjson.HttpJsonClientCall; +import com.google.api.gax.httpjson.HttpJsonClientInterceptor; +import com.google.api.gax.httpjson.HttpJsonMetadata; + +/** Implements a client interceptor to retrieve the response headers from a HTTP client request. */ +public class HttpJsonCapturingClientInterceptor implements HttpJsonClientInterceptor { + public HttpJsonMetadata metadata; + + @Override + public HttpJsonClientCall interceptCall( + ApiMethodDescriptor method, + HttpJsonCallOptions callOptions, + HttpJsonChannel next) { + HttpJsonClientCall call = next.newCall(method, callOptions); + return new ForwardingHttpJsonClientCall.SimpleForwardingHttpJsonClientCall( + call) { + @Override + public void start(Listener responseListener, HttpJsonMetadata requestHeaders) { + Listener forwardingResponseListener = + new ForwardingHttpJsonClientCallListener.SimpleForwardingHttpJsonClientCallListener< + ResponseT>(responseListener) { + @Override + public void onHeaders(HttpJsonMetadata responseHeaders) { + metadata = responseHeaders; + super.onHeaders(responseHeaders); + } + + @Override + public void onMessage(ResponseT message) { + super.onMessage(message); + } + + @Override + public void onClose(int statusCode, HttpJsonMetadata trailers) { + super.onClose(statusCode, trailers); + } + }; + + super.start(forwardingResponseListener, requestHeaders); + } + }; + } +} diff --git a/java-showcase-3.21.0/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/util/InterceptingMockTokenServerTransport.java b/java-showcase-3.21.0/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/util/InterceptingMockTokenServerTransport.java new file mode 100644 index 0000000000..4545d87f20 --- /dev/null +++ b/java-showcase-3.21.0/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/util/InterceptingMockTokenServerTransport.java @@ -0,0 +1,48 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.it.util; + +import com.google.api.client.http.LowLevelHttpRequest; +import com.google.api.client.json.JsonFactory; +import com.google.api.client.json.gson.GsonFactory; +import com.google.api.client.json.webtoken.JsonWebSignature; +import com.google.api.client.testing.http.MockLowLevelHttpRequest; +import com.google.auth.TestUtils; +import com.google.auth.oauth2.MockTokenServerTransport; +import java.io.IOException; +import java.util.Map; + +public class InterceptingMockTokenServerTransport extends MockTokenServerTransport { + private MockLowLevelHttpRequest lastRequest; + private static final JsonFactory JSON_FACTORY = new GsonFactory(); + + @Override + public LowLevelHttpRequest buildRequest(String method, String url) throws IOException { + MockLowLevelHttpRequest baseRequest = (MockLowLevelHttpRequest) super.buildRequest(method, url); + lastRequest = baseRequest; + return baseRequest; + } + + public String getLastAudienceSent() throws IOException { + String contentString = lastRequest.getContentAsString(); + Map query = TestUtils.parseQuery(contentString); + String assertion = query.get("assertion"); + JsonWebSignature signature = JsonWebSignature.parse(JSON_FACTORY, assertion); + String foundTargetAudience = (String) signature.getPayload().get("api_audience"); + return foundTargetAudience; + } +} diff --git a/java-showcase-3.21.0/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/util/InterceptingMockTokenServerTransportFactory.java b/java-showcase-3.21.0/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/util/InterceptingMockTokenServerTransportFactory.java new file mode 100644 index 0000000000..ffb1e04132 --- /dev/null +++ b/java-showcase-3.21.0/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/util/InterceptingMockTokenServerTransportFactory.java @@ -0,0 +1,31 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.it.util; + +import com.google.api.client.http.HttpTransport; +import com.google.auth.oauth2.MockTokenServerTransportFactory; + +public class InterceptingMockTokenServerTransportFactory extends MockTokenServerTransportFactory { + + public InterceptingMockTokenServerTransport transport = + new InterceptingMockTokenServerTransport(); + + @Override + public HttpTransport create() { + return transport; + } +} diff --git a/java-showcase-3.21.0/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/util/TestClientInitializer.java b/java-showcase-3.21.0/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/util/TestClientInitializer.java new file mode 100644 index 0000000000..a3db1a00e3 --- /dev/null +++ b/java-showcase-3.21.0/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/util/TestClientInitializer.java @@ -0,0 +1,343 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.it.util; + +import com.google.api.client.http.javanet.NetHttpTransport; +import com.google.api.gax.core.NoCredentialsProvider; +import com.google.api.gax.httpjson.HttpJsonClientInterceptor; +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.StatusCode; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.tracing.ApiTracerFactory; +import com.google.common.collect.ImmutableList; +import com.google.showcase.v1beta1.ComplianceClient; +import com.google.showcase.v1beta1.ComplianceSettings; +import com.google.showcase.v1beta1.EchoClient; +import com.google.showcase.v1beta1.EchoSettings; +import com.google.showcase.v1beta1.IdentityClient; +import com.google.showcase.v1beta1.IdentitySettings; +import com.google.showcase.v1beta1.WaitRequest; +import com.google.showcase.v1beta1.stub.EchoStub; +import com.google.showcase.v1beta1.stub.EchoStubSettings; +import io.grpc.ClientInterceptor; +import io.grpc.ManagedChannelBuilder; +import java.util.List; +import java.util.Set; + +public class TestClientInitializer { + + public static final int AWAIT_TERMINATION_SECONDS = 10; + + // gRPC's endpoint must follow the format of {host}:{port} + public static final String DEFAULT_GRPC_ENDPOINT = "localhost:7469"; + // httpjson's endpoint uses `https://` by default if the scheme is not specified + // local test requires `http://` as not SSL/TLS has been set up for showcase + public static final String DEFAULT_HTTPJSON_ENDPOINT = "http://localhost:7469"; + + public static EchoClient createGrpcEchoClient() throws Exception { + return createGrpcEchoClient(ImmutableList.of()); + } + + public static EchoClient createGrpcEchoClient(List interceptorList) + throws Exception { + EchoSettings grpcEchoSettings = + EchoSettings.newBuilder() + .setCredentialsProvider(NoCredentialsProvider.create()) + .setTransportChannelProvider( + EchoSettings.defaultGrpcTransportProviderBuilder() + .setChannelConfigurator(ManagedChannelBuilder::usePlaintext) + .setInterceptorProvider(() -> interceptorList) + .build()) + .setEndpoint(DEFAULT_GRPC_ENDPOINT) + .build(); + return EchoClient.create(grpcEchoSettings); + } + + public static EchoClient createGrpcEchoClientWithRetrySettings( + RetrySettings retrySettings, + Set retryableCodes, + List interceptorList) + throws Exception { + EchoStubSettings.Builder grpcEchoSettingsBuilder = EchoStubSettings.newBuilder(); + grpcEchoSettingsBuilder + .echoSettings() + .setRetrySettings(retrySettings) + .setRetryableCodes(retryableCodes); + EchoSettings grpcEchoSettings = EchoSettings.create(grpcEchoSettingsBuilder.build()); + grpcEchoSettings = + grpcEchoSettings.toBuilder() + .setCredentialsProvider(NoCredentialsProvider.create()) + .setTransportChannelProvider( + EchoSettings.defaultGrpcTransportProviderBuilder() + .setChannelConfigurator(ManagedChannelBuilder::usePlaintext) + .setInterceptorProvider(() -> interceptorList) + .build()) + .setEndpoint(DEFAULT_GRPC_ENDPOINT) + .build(); + return EchoClient.create(grpcEchoSettings); + } + + public static EchoClient createHttpJsonEchoClient() throws Exception { + return createHttpJsonEchoClient(ImmutableList.of()); + } + + public static EchoClient createHttpJsonEchoClient(List interceptorList) + throws Exception { + EchoSettings httpJsonEchoSettings = + EchoSettings.newHttpJsonBuilder() + .setCredentialsProvider(NoCredentialsProvider.create()) + .setTransportChannelProvider( + EchoSettings.defaultHttpJsonTransportProviderBuilder() + .setHttpTransport( + new NetHttpTransport.Builder().doNotValidateCertificate().build()) + .setEndpoint(DEFAULT_HTTPJSON_ENDPOINT) + .setInterceptorProvider(() -> interceptorList) + .build()) + .build(); + return EchoClient.create(httpJsonEchoSettings); + } + + public static EchoClient createHttpJsonEchoClientWithRetrySettings( + RetrySettings retrySettings, + Set retryableCodes, + List interceptorList) + throws Exception { + EchoStubSettings.Builder httpJsonEchoSettingsBuilder = EchoStubSettings.newHttpJsonBuilder(); + httpJsonEchoSettingsBuilder + .echoSettings() + .setRetrySettings(retrySettings) + .setRetryableCodes(retryableCodes); + EchoSettings httpJsonEchoSettings = EchoSettings.create(httpJsonEchoSettingsBuilder.build()); + httpJsonEchoSettings = + httpJsonEchoSettings.toBuilder() + .setCredentialsProvider(NoCredentialsProvider.create()) + .setTransportChannelProvider( + EchoSettings.defaultHttpJsonTransportProviderBuilder() + .setHttpTransport( + new NetHttpTransport.Builder().doNotValidateCertificate().build()) + .setInterceptorProvider(() -> interceptorList) + .setEndpoint(DEFAULT_HTTPJSON_ENDPOINT) + .build()) + .build(); + return EchoClient.create(httpJsonEchoSettings); + } + + public static EchoClient createGrpcEchoClientCustomBlockSettings( + RetrySettings retrySettings, Set retryableCodes) throws Exception { + EchoStubSettings.Builder grpcEchoSettingsBuilder = EchoStubSettings.newBuilder(); + grpcEchoSettingsBuilder + .blockSettings() + .setRetrySettings(retrySettings) + .setRetryableCodes(retryableCodes); + EchoSettings grpcEchoSettings = EchoSettings.create(grpcEchoSettingsBuilder.build()); + grpcEchoSettings = + grpcEchoSettings.toBuilder() + .setCredentialsProvider(NoCredentialsProvider.create()) + .setTransportChannelProvider( + EchoSettings.defaultGrpcTransportProviderBuilder() + .setChannelConfigurator(ManagedChannelBuilder::usePlaintext) + .build()) + .setEndpoint(DEFAULT_GRPC_ENDPOINT) + .build(); + return EchoClient.create(grpcEchoSettings); + } + + public static EchoClient createHttpJsonEchoClientCustomBlockSettings( + RetrySettings retrySettings, Set retryableCodes) throws Exception { + EchoStubSettings.Builder httpJsonEchoSettingsBuilder = EchoStubSettings.newHttpJsonBuilder(); + httpJsonEchoSettingsBuilder + .blockSettings() + .setRetrySettings(retrySettings) + .setRetryableCodes(retryableCodes); + EchoSettings httpJsonEchoSettings = EchoSettings.create(httpJsonEchoSettingsBuilder.build()); + httpJsonEchoSettings = + httpJsonEchoSettings.toBuilder() + .setCredentialsProvider(NoCredentialsProvider.create()) + .setTransportChannelProvider( + EchoSettings.defaultHttpJsonTransportProviderBuilder() + .setHttpTransport( + new NetHttpTransport.Builder().doNotValidateCertificate().build()) + .setEndpoint(DEFAULT_HTTPJSON_ENDPOINT) + .build()) + .build(); + return EchoClient.create(httpJsonEchoSettings); + } + + public static EchoClient createGrpcEchoClientCustomWaitSettings( + RetrySettings initialUnaryRetrySettings, RetrySettings pollingRetrySettings) + throws Exception { + EchoStubSettings.Builder grpcEchoSettingsBuilder = EchoStubSettings.newBuilder(); + grpcEchoSettingsBuilder + .waitOperationSettings() + .setInitialCallSettings( + UnaryCallSettings.newUnaryCallSettingsBuilder() + .setRetrySettings(initialUnaryRetrySettings) + .build()) + .setPollingAlgorithm(OperationTimedPollAlgorithm.create(pollingRetrySettings)); + EchoSettings grpcEchoSettings = EchoSettings.create(grpcEchoSettingsBuilder.build()); + grpcEchoSettings = + grpcEchoSettings.toBuilder() + .setCredentialsProvider(NoCredentialsProvider.create()) + .setTransportChannelProvider( + EchoSettings.defaultGrpcTransportProviderBuilder() + .setChannelConfigurator(ManagedChannelBuilder::usePlaintext) + .build()) + .setEndpoint(DEFAULT_GRPC_ENDPOINT) + .build(); + return EchoClient.create(grpcEchoSettings); + } + + public static EchoClient createHttpJsonEchoClientCustomWaitSettings( + RetrySettings initialUnaryRetrySettings, RetrySettings pollingRetrySettings) + throws Exception { + EchoStubSettings.Builder httpJsonEchoSettingsBuilder = EchoStubSettings.newHttpJsonBuilder(); + httpJsonEchoSettingsBuilder + .waitOperationSettings() + .setInitialCallSettings( + UnaryCallSettings.newUnaryCallSettingsBuilder() + .setRetrySettings(initialUnaryRetrySettings) + .build()) + .setPollingAlgorithm(OperationTimedPollAlgorithm.create(pollingRetrySettings)); + EchoSettings httpJsonEchoSettings = EchoSettings.create(httpJsonEchoSettingsBuilder.build()); + httpJsonEchoSettings = + httpJsonEchoSettings.toBuilder() + .setCredentialsProvider(NoCredentialsProvider.create()) + .setTransportChannelProvider( + EchoSettings.defaultHttpJsonTransportProviderBuilder() + .setHttpTransport( + new NetHttpTransport.Builder().doNotValidateCertificate().build()) + .setEndpoint(DEFAULT_HTTPJSON_ENDPOINT) + .build()) + .build(); + return EchoClient.create(httpJsonEchoSettings); + } + + public static IdentityClient createGrpcIdentityClient() throws Exception { + IdentitySettings grpcIdentitySettings = + IdentitySettings.newHttpJsonBuilder() + .setCredentialsProvider(NoCredentialsProvider.create()) + .setTransportChannelProvider( + IdentitySettings.defaultGrpcTransportProviderBuilder() + .setChannelConfigurator(ManagedChannelBuilder::usePlaintext) + .build()) + .setEndpoint(DEFAULT_GRPC_ENDPOINT) + .build(); + return IdentityClient.create(grpcIdentitySettings); + } + + public static IdentityClient createHttpJsonIdentityClient() throws Exception { + IdentitySettings httpjsonIdentitySettings = + IdentitySettings.newHttpJsonBuilder() + .setCredentialsProvider(NoCredentialsProvider.create()) + .setTransportChannelProvider( + EchoSettings.defaultHttpJsonTransportProviderBuilder() + .setHttpTransport( + new NetHttpTransport.Builder().doNotValidateCertificate().build()) + .setEndpoint(DEFAULT_HTTPJSON_ENDPOINT) + .build()) + .build(); + return IdentityClient.create(httpjsonIdentitySettings); + } + + // Create grpcComplianceClient with Interceptor + public static ComplianceClient createGrpcComplianceClient(List interceptorList) + throws Exception { + ComplianceSettings grpcComplianceSettings = + ComplianceSettings.newBuilder() + .setCredentialsProvider(NoCredentialsProvider.create()) + .setTransportChannelProvider( + ComplianceSettings.defaultGrpcTransportProviderBuilder() + .setChannelConfigurator(ManagedChannelBuilder::usePlaintext) + .setInterceptorProvider(() -> interceptorList) + .build()) + .setEndpoint(DEFAULT_GRPC_ENDPOINT) + .build(); + return ComplianceClient.create(grpcComplianceSettings); + } + + public static ComplianceClient createHttpJsonComplianceClient( + List interceptorList) throws Exception { + ComplianceSettings httpJsonComplianceSettings = + ComplianceSettings.newHttpJsonBuilder() + .setCredentialsProvider(NoCredentialsProvider.create()) + .setTransportChannelProvider( + EchoSettings.defaultHttpJsonTransportProviderBuilder() + .setHttpTransport( + new NetHttpTransport.Builder().doNotValidateCertificate().build()) + .setEndpoint(DEFAULT_HTTPJSON_ENDPOINT) + .setInterceptorProvider(() -> interceptorList) + .build()) + .build(); + return ComplianceClient.create(httpJsonComplianceSettings); + } + + public static EchoClient createGrpcEchoClientOpentelemetry(ApiTracerFactory metricsTracerFactory) + throws Exception { + return createGrpcEchoClientOpentelemetry( + metricsTracerFactory, + EchoSettings.defaultGrpcTransportProviderBuilder() + .setChannelConfigurator(ManagedChannelBuilder::usePlaintext) + .build()); + } + + public static EchoClient createGrpcEchoClientOpentelemetry( + ApiTracerFactory metricsTracerFactory, TransportChannelProvider transportChannelProvider) + throws Exception { + EchoSettings grpcEchoSettings = + EchoSettings.newBuilder() + .setCredentialsProvider(NoCredentialsProvider.create()) + .setTransportChannelProvider(transportChannelProvider) + .setEndpoint(DEFAULT_GRPC_ENDPOINT) + .build(); + + EchoStubSettings echoStubSettings = + (EchoStubSettings) + grpcEchoSettings.getStubSettings().toBuilder() + .setTracerFactory(metricsTracerFactory) + .build(); + EchoStub stub = echoStubSettings.createStub(); + + return EchoClient.create(stub); + } + + public static EchoClient createHttpJsonEchoClientOpentelemetry( + ApiTracerFactory metricsTracerFactory) throws Exception { + + EchoSettings httpJsonEchoSettings = + EchoSettings.newHttpJsonBuilder() + .setCredentialsProvider(NoCredentialsProvider.create()) + .setTransportChannelProvider( + EchoSettings.defaultHttpJsonTransportProviderBuilder() + .setHttpTransport( + new NetHttpTransport.Builder().doNotValidateCertificate().build()) + .setEndpoint(DEFAULT_HTTPJSON_ENDPOINT) + .build()) + .build(); + + EchoStubSettings echoStubSettings = + (EchoStubSettings) + httpJsonEchoSettings.getStubSettings().toBuilder() + .setTracerFactory(metricsTracerFactory) + .build(); + EchoStub stub = echoStubSettings.createStub(); + + return EchoClient.create(stub); + } +} diff --git a/java-showcase-3.21.0/gapic-showcase/src/test/resources/META-INF/native-image/resource-config.json b/java-showcase-3.21.0/gapic-showcase/src/test/resources/META-INF/native-image/resource-config.json new file mode 100644 index 0000000000..bfa2659f0a --- /dev/null +++ b/java-showcase-3.21.0/gapic-showcase/src/test/resources/META-INF/native-image/resource-config.json @@ -0,0 +1,6 @@ +{ + "resources": [ + { "pattern": ".*.json" }, + { "pattern": ".*.pem" } + ] +} \ No newline at end of file diff --git a/java-showcase-3.21.0/gapic-showcase/src/test/resources/compliance_suite.json b/java-showcase-3.21.0/gapic-showcase/src/test/resources/compliance_suite.json new file mode 100644 index 0000000000..a458819b35 --- /dev/null +++ b/java-showcase-3.21.0/gapic-showcase/src/test/resources/compliance_suite.json @@ -0,0 +1,240 @@ +{ + "group": [ + { + "name": "Fully working conversions, no resources", + "rpcs": ["Compliance.RepeatDataBody", "Compliance.RepeatDataBodyPut", "Compliance.RepeatDataBodyPatch", "Compliance.RepeatDataQuery", "Compliance.RepeatDataSimplePath", "Compliance.RepeatDataBodyInfo"], + "requests": [ + { + "name": "Basic data types", + "serverVerify": true, + "info": { + "fString": "Hello", + "fInt32": -1, + "fSint32" : -2, + "fSfixed32": -3, + "fUint32": 5, + "fFixed32": 7, + "fInt64": -11, + "fSint64": -13, + "fSfixed64": -17, + "fUint64": 19, + "fFixed64":23, + "fDouble": -29e4, + "fFloat": -31, + "fBool": true, + "fKingdom": "ANIMALIA", + + "pString": "Goodbye", + "pInt32": -37, + "pDouble": -41.43, + "pBool": true, + "pKingdom": "PLANTAE", + + "fChild": { + "fString": "second/bool/salutation" + } + }, + "fInt32": -10, + "fInt64": -110, + "fDouble": -54e4, + + "pInt32": -47, + "pInt64": -477, + "pDouble": -61.73 + }, + { + "name": "Basic types, no optional fields", + "serverVerify": true, + "info": { + "fString": "Hello", + "fInt32": -1, + "fSint32" : -2, + "fSfixed32": -3, + "fUint32": 5, + "fFixed32": 7, + "fInt64": -11, + "fSint64": -13, + "fSfixed64": -17, + "fUint64": 19, + "fFixed64":23, + "fDouble": -29e4, + "fFloat": -31, + "fBool": true, + "fKingdom": "ANIMALIA", + + "fChild": { + "fString": "second/bool/salutation" + } + } + }, + + { + "name": "Zero values for non-string fields", + "serverVerify": true, + "info": { + "fString": "Hello", + "fInt32": 0, + "fSint32" : 0, + "fSfixed32": 0, + "fUint32": 0, + "fFixed32": 0, + "fInt64": 0, + "fSint64": 0, + "fSfixed64": 0, + "fUint64": 0, + "fFixed64": 0, + "fDouble": 0, + "fFloat": 0, + "fBool": false, + "fKingdom": "LIFE_KINGDOM_UNSPECIFIED", + + "pString": "Goodbye", + "pInt32": 0, + "pDouble": 0, + "pBool": false, + "pKingdom": "LIFE_KINGDOM_UNSPECIFIED" + } + }, + { + "name": "Extreme values", + "serverVerify": true, + "info": { + "fString": "non-ASCII+non-printable string ☺ → ← \"\\\/\b\f\r\t\u1234 works, not newlines yet", + "fInt32": 2147483647, + "fSint32" : 2147483647, + "fSfixed32": 2147483647, + "fUint32": 4294967295, + "fFixed32": 4294967295, + "fInt64": "9223372036854775807", + "fSint64": "9223372036854775807", + "fSfixed64": "9223372036854775807", + "fUint64": "18446744073709551615", + "fFixed64": "18446744073709551615", + "fDouble": 1.797693134862315708145274237317043567981e+308, + "fFloat": 3.40282346638528859811704183484516925440e+38, + "fBool": false, + + "pString": "Goodbye", + "pInt32": 2147483647, + "pDouble": 1.797693134862315708145274237317043567981e+308, + "pBool": false + } + }, + { + "name": "Strings with spaces", + "serverVerify": true, + "info": { + "fString": "Hello there" + } + }, + { + "name": "Strings with quotes", + "serverVerify": true, + "info": { + "fString": "Hello \"You\"" + } + }, + { + "name": "Strings with percents", + "serverVerify": true, + "info": { + "fString": "Hello 100%" + } + } + ] + }, + { + "name": "Fully working conversions, resources", + "rpcs": ["Compliance.RepeatDataBody", "Compliance.RepeatDataBodyPut", "Compliance.RepeatDataBodyPatch", "Compliance.RepeatDataQuery"], + "requests": [ + { + "name": "Strings with slashes and values that resemble subsequent resource templates", + "serverVerify": true, + "info": { + "fString": "first/hello/second/greetings", + "pBool": true, + + "fChild": { + "fString": "second/zzz/bool/true" + } + } + } + ] + }, + { + "name": "Binding selection testing", + "rpcs": ["Compliance.RepeatDataPathResource"], + "requests": [ + { + "name": "Binding testing baseline no Uri verification", + "serverVerify": true, + "info": { + "fString": "first/hello", + "pBool": true, + + "fChild": { + "fString": "second/greetings" + } + } + }, + { + "name": "Binding testing first binding", + "serverVerify": true, + "info": { + "fString": "first/hello", + "pBool": true, + + "fChild": { + "fString": "second/greetings" + } + }, + "intendedBindingUri": "/v1beta1/repeat/{info.f_string=first/*}/{info.f_child.f_string=second/*}/bool/{info.f_bool}:pathresource" + }, + { + "name": "Binding testing additional binding", + "serverVerify": true, + "info": { + "fString": "second/greetings", + "pBool": true, + + "fChild": { + "fString": "first/hello" + } + }, + "intendedBindingUri": "/v1beta1/repeat/{info.f_child.f_string=first/*}/{info.f_string=second/*}/bool/{info.f_bool}:childfirstpathresource" + } + ] + }, + { + "name": "Cases that apply to non-path requests", + "rpcs": ["Compliance.RepeatDataBody", "Compliance.RepeatDataBodyPut", "Compliance.RepeatDataBodyPatch", "Compliance.RepeatDataQuery"], + "requests": [ + { + "name": "Zero values for all fields", + "serverVerify": true, + "info": { + "fString": "", + "fInt32": 0, + "fSint32" : 0, + "fSfixed32": 0, + "fUint32": 0, + "fFixed32": 0, + "fInt64": 0, + "fSint64": 0, + "fSfixed64": 0, + "fUint64": 0, + "fFixed64":20, + "fDouble": 0, + "fFloat": 0, + "fBool": false, + + "pString": "", + "pInt32": 0, + "pDouble": 0, + "pBool": false + } + } + ] + } + ] +} diff --git a/java-showcase-3.21.0/gapic-showcase/src/test/resources/fake_cert.pem b/java-showcase-3.21.0/gapic-showcase/src/test/resources/fake_cert.pem new file mode 100644 index 0000000000..03febfd3ae --- /dev/null +++ b/java-showcase-3.21.0/gapic-showcase/src/test/resources/fake_cert.pem @@ -0,0 +1,15 @@ +-----BEGIN CERTIFICATE----- +MIICUTCCAfugAwIBAgIBADANBgkqhkiG9w0BAQQFADBXMQswCQYDVQQGEwJDTjEL +MAkGA1UECBMCUE4xCzAJBgNVBAcTAkNOMQswCQYDVQQKEwJPTjELMAkGA1UECxMC +VU4xFDASBgNVBAMTC0hlcm9uZyBZYW5nMB4XDTA1MDcxNTIxMTk0N1oXDTA1MDgx +NDIxMTk0N1owVzELMAkGA1UEBhMCQ04xCzAJBgNVBAgTAlBOMQswCQYDVQQHEwJD +TjELMAkGA1UEChMCT04xCzAJBgNVBAsTAlVOMRQwEgYDVQQDEwtIZXJvbmcgWWFu +ZzBcMA0GCSqGSIb3DQEBAQUAA0sAMEgCQQCp5hnG7ogBhtlynpOS21cBewKE/B7j +V14qeyslnr26xZUsSVko36ZnhiaO/zbMOoRcKK9vEcgMtcLFuQTWDl3RAgMBAAGj +gbEwga4wHQYDVR0OBBYEFFXI70krXeQDxZgbaCQoR4jUDncEMH8GA1UdIwR4MHaA +FFXI70krXeQDxZgbaCQoR4jUDncEoVukWTBXMQswCQYDVQQGEwJDTjELMAkGA1UE +CBMCUE4xCzAJBgNVBAcTAkNOMQswCQYDVQQKEwJPTjELMAkGA1UECxMCVU4xFDAS +BgNVBAMTC0hlcm9uZyBZYW5nggEAMAwGA1UdEwQFMAMBAf8wDQYJKoZIhvcNAQEE +BQADQQA/ugzBrjjK9jcWnDVfGHlk3icNRq0oV7Ri32z/+HQX67aRfgZu7KWdI+Ju +Wm7DCfrPNGVwFWUQOmsPue9rZBgO +-----END CERTIFICATE----- diff --git a/java-showcase-3.21.0/gapic-showcase/src/test/resources/test_gdch_credential.json b/java-showcase-3.21.0/gapic-showcase/src/test/resources/test_gdch_credential.json new file mode 100644 index 0000000000..16c2582cdc --- /dev/null +++ b/java-showcase-3.21.0/gapic-showcase/src/test/resources/test_gdch_credential.json @@ -0,0 +1,10 @@ +{ + "type": "gdch_service_account", + "format_version": "1", + "project": "project-id", + "private_key_id": "d84a4fefcf50791d4a90f2d7af17469d6282df9d", + "private_key": "-----BEGIN PRIVATE KEY-----\nMIICdgIBADANBgkqhkiG9w0BAQEFAASCAmAwggJcAgEAAoGBALX0PQoe1igW12i\nkv1bN/r9lN749y2ijmbc/mFHPyS3hNTyOCjDvBbXYbDhQJzWVUikh4mvGBA07qTj79Xc3yBDfKP2IeyYQIFe0t0\nzkd7R9Zdn98Y2rIQC47aAbDfubtkU1U72t4zL11kHvoa0/RuFZjncvlr42X7be7lYh4p3NAgMBAAECgYASk5wDw\n4Az2ZkmeuN6Fk/y9H+Lcb2pskJIXjrL533vrDWGOC48LrsThMQPv8cxBky8HFSEklPpkfTF95tpD43iVwJRB/Gr\nCtGTw65IfJ4/tI09h6zGc4yqvIo1cHX/LQ+SxKLGyir/dQM925rGt/VojxY5ryJR7GLbCzxPnJm/oQJBANwOCO6\nD2hy1LQYJhXh7O+RLtA/tSnT1xyMQsGT+uUCMiKS2bSKx2wxo9k7h3OegNJIu1q6nZ6AbxDK8H3+d0dUCQQDTrP\nSXagBxzp8PecbaCHjzNRSQE2in81qYnrAFNB4o3DpHyMMY6s5ALLeHKscEWnqP8Ur6X4PvzZecCWU9BKAZAkAut\nLPknAuxSCsUOvUfS1i87ex77Ot+w6POp34pEX+UWb+u5iFn2cQacDTHLV1LtE80L8jVLSbrbrlH43H0DjU5AkEA\ngidhycxS86dxpEljnOMCw8CKoUBd5I880IUahEiUltk7OLJYS/Ts1wbn3kPOVX3wyJs8WBDtBkFrDHW2ezth2QJ\nADj3e1YhMVdjJW5jqwlD/VNddGjgzyunmiZg0uOXsHXbytYmsA545S8KRQFaJKFXYYFo2kOjqOiC1T2cAzMDjCQ\n==\n-----END PRIVATE KEY-----\n", + "name": "service-identity-name", + "ca_cert_path": "fake-cert-path", + "token_uri": "https://service-identity.fake-domain/authenticate" +} diff --git a/java-showcase-3.21.0/grpc-gapic-showcase-v1beta1/clirr-ignored-differences.xml b/java-showcase-3.21.0/grpc-gapic-showcase-v1beta1/clirr-ignored-differences.xml new file mode 100644 index 0000000000..731f7543e2 --- /dev/null +++ b/java-showcase-3.21.0/grpc-gapic-showcase-v1beta1/clirr-ignored-differences.xml @@ -0,0 +1,8 @@ + + + + 7012 + com/google/showcase/v1beta1/EchoGrpc$AsyncService + *failEchoWithDetails(*) + + diff --git a/java-showcase-3.21.0/grpc-gapic-showcase-v1beta1/pom.xml b/java-showcase-3.21.0/grpc-gapic-showcase-v1beta1/pom.xml new file mode 100644 index 0000000000..9fce31015f --- /dev/null +++ b/java-showcase-3.21.0/grpc-gapic-showcase-v1beta1/pom.xml @@ -0,0 +1,65 @@ + + 4.0.0 + com.google.api.grpc + grpc-gapic-showcase-v1beta1 + 0.0.1-SNAPSHOT + grpc-gapic-showcase-v1beta1 + GRPC library for grpc-google-cloud-iot-v1 + + com.google.cloud + gapic-showcase-parent + 0.0.1-SNAPSHOT + + + + true + + + + + io.grpc + grpc-api + + + io.grpc + grpc-stub + + + io.grpc + grpc-protobuf + + + com.google.protobuf + protobuf-java + + + com.google.api.grpc + proto-gapic-showcase-v1beta1 + + + com.google.api.grpc + proto-google-iam-v1 + + + com.google.guava + guava + + + + + + + showcase-sonar-analysis + + + enableShowcaseTestCoverage + + + + true + + + + diff --git a/java-showcase-3.21.0/grpc-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ComplianceGrpc.java b/java-showcase-3.21.0/grpc-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ComplianceGrpc.java new file mode 100644 index 0000000000..5c42138987 --- /dev/null +++ b/java-showcase-3.21.0/grpc-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ComplianceGrpc.java @@ -0,0 +1,1638 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.showcase.v1beta1; + +import static io.grpc.MethodDescriptor.generateFullMethodName; + +/** + * + * + *

        + * This service is used to test that GAPICs implement various REST-related features correctly. This mostly means transcoding proto3 requests to REST format
        + * correctly for various types of HTTP annotations, but it also includes verifying that unknown (numeric) enums received by clients can be round-tripped
        + * correctly.
        + * 
        + */ +@io.grpc.stub.annotations.GrpcGenerated +public final class ComplianceGrpc { + + private ComplianceGrpc() {} + + public static final java.lang.String SERVICE_NAME = "google.showcase.v1beta1.Compliance"; + + // Static method descriptors that strictly reflect the proto. + private static volatile io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.RepeatRequest, com.google.showcase.v1beta1.RepeatResponse> + getRepeatDataBodyMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "RepeatDataBody", + requestType = com.google.showcase.v1beta1.RepeatRequest.class, + responseType = com.google.showcase.v1beta1.RepeatResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.RepeatRequest, com.google.showcase.v1beta1.RepeatResponse> + getRepeatDataBodyMethod() { + io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.RepeatRequest, com.google.showcase.v1beta1.RepeatResponse> + getRepeatDataBodyMethod; + if ((getRepeatDataBodyMethod = ComplianceGrpc.getRepeatDataBodyMethod) == null) { + synchronized (ComplianceGrpc.class) { + if ((getRepeatDataBodyMethod = ComplianceGrpc.getRepeatDataBodyMethod) == null) { + ComplianceGrpc.getRepeatDataBodyMethod = + getRepeatDataBodyMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "RepeatDataBody")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.RepeatRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.RepeatResponse.getDefaultInstance())) + .setSchemaDescriptor(new ComplianceMethodDescriptorSupplier("RepeatDataBody")) + .build(); + } + } + } + return getRepeatDataBodyMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.RepeatRequest, com.google.showcase.v1beta1.RepeatResponse> + getRepeatDataBodyInfoMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "RepeatDataBodyInfo", + requestType = com.google.showcase.v1beta1.RepeatRequest.class, + responseType = com.google.showcase.v1beta1.RepeatResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.RepeatRequest, com.google.showcase.v1beta1.RepeatResponse> + getRepeatDataBodyInfoMethod() { + io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.RepeatRequest, com.google.showcase.v1beta1.RepeatResponse> + getRepeatDataBodyInfoMethod; + if ((getRepeatDataBodyInfoMethod = ComplianceGrpc.getRepeatDataBodyInfoMethod) == null) { + synchronized (ComplianceGrpc.class) { + if ((getRepeatDataBodyInfoMethod = ComplianceGrpc.getRepeatDataBodyInfoMethod) == null) { + ComplianceGrpc.getRepeatDataBodyInfoMethod = + getRepeatDataBodyInfoMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "RepeatDataBodyInfo")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.RepeatRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.RepeatResponse.getDefaultInstance())) + .setSchemaDescriptor( + new ComplianceMethodDescriptorSupplier("RepeatDataBodyInfo")) + .build(); + } + } + } + return getRepeatDataBodyInfoMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.RepeatRequest, com.google.showcase.v1beta1.RepeatResponse> + getRepeatDataQueryMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "RepeatDataQuery", + requestType = com.google.showcase.v1beta1.RepeatRequest.class, + responseType = com.google.showcase.v1beta1.RepeatResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.RepeatRequest, com.google.showcase.v1beta1.RepeatResponse> + getRepeatDataQueryMethod() { + io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.RepeatRequest, com.google.showcase.v1beta1.RepeatResponse> + getRepeatDataQueryMethod; + if ((getRepeatDataQueryMethod = ComplianceGrpc.getRepeatDataQueryMethod) == null) { + synchronized (ComplianceGrpc.class) { + if ((getRepeatDataQueryMethod = ComplianceGrpc.getRepeatDataQueryMethod) == null) { + ComplianceGrpc.getRepeatDataQueryMethod = + getRepeatDataQueryMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "RepeatDataQuery")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.RepeatRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.RepeatResponse.getDefaultInstance())) + .setSchemaDescriptor( + new ComplianceMethodDescriptorSupplier("RepeatDataQuery")) + .build(); + } + } + } + return getRepeatDataQueryMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.RepeatRequest, com.google.showcase.v1beta1.RepeatResponse> + getRepeatDataSimplePathMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "RepeatDataSimplePath", + requestType = com.google.showcase.v1beta1.RepeatRequest.class, + responseType = com.google.showcase.v1beta1.RepeatResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.RepeatRequest, com.google.showcase.v1beta1.RepeatResponse> + getRepeatDataSimplePathMethod() { + io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.RepeatRequest, com.google.showcase.v1beta1.RepeatResponse> + getRepeatDataSimplePathMethod; + if ((getRepeatDataSimplePathMethod = ComplianceGrpc.getRepeatDataSimplePathMethod) == null) { + synchronized (ComplianceGrpc.class) { + if ((getRepeatDataSimplePathMethod = ComplianceGrpc.getRepeatDataSimplePathMethod) + == null) { + ComplianceGrpc.getRepeatDataSimplePathMethod = + getRepeatDataSimplePathMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName(SERVICE_NAME, "RepeatDataSimplePath")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.RepeatRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.RepeatResponse.getDefaultInstance())) + .setSchemaDescriptor( + new ComplianceMethodDescriptorSupplier("RepeatDataSimplePath")) + .build(); + } + } + } + return getRepeatDataSimplePathMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.RepeatRequest, com.google.showcase.v1beta1.RepeatResponse> + getRepeatDataPathResourceMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "RepeatDataPathResource", + requestType = com.google.showcase.v1beta1.RepeatRequest.class, + responseType = com.google.showcase.v1beta1.RepeatResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.RepeatRequest, com.google.showcase.v1beta1.RepeatResponse> + getRepeatDataPathResourceMethod() { + io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.RepeatRequest, com.google.showcase.v1beta1.RepeatResponse> + getRepeatDataPathResourceMethod; + if ((getRepeatDataPathResourceMethod = ComplianceGrpc.getRepeatDataPathResourceMethod) + == null) { + synchronized (ComplianceGrpc.class) { + if ((getRepeatDataPathResourceMethod = ComplianceGrpc.getRepeatDataPathResourceMethod) + == null) { + ComplianceGrpc.getRepeatDataPathResourceMethod = + getRepeatDataPathResourceMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName(SERVICE_NAME, "RepeatDataPathResource")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.RepeatRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.RepeatResponse.getDefaultInstance())) + .setSchemaDescriptor( + new ComplianceMethodDescriptorSupplier("RepeatDataPathResource")) + .build(); + } + } + } + return getRepeatDataPathResourceMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.RepeatRequest, com.google.showcase.v1beta1.RepeatResponse> + getRepeatDataPathTrailingResourceMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "RepeatDataPathTrailingResource", + requestType = com.google.showcase.v1beta1.RepeatRequest.class, + responseType = com.google.showcase.v1beta1.RepeatResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.RepeatRequest, com.google.showcase.v1beta1.RepeatResponse> + getRepeatDataPathTrailingResourceMethod() { + io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.RepeatRequest, com.google.showcase.v1beta1.RepeatResponse> + getRepeatDataPathTrailingResourceMethod; + if ((getRepeatDataPathTrailingResourceMethod = + ComplianceGrpc.getRepeatDataPathTrailingResourceMethod) + == null) { + synchronized (ComplianceGrpc.class) { + if ((getRepeatDataPathTrailingResourceMethod = + ComplianceGrpc.getRepeatDataPathTrailingResourceMethod) + == null) { + ComplianceGrpc.getRepeatDataPathTrailingResourceMethod = + getRepeatDataPathTrailingResourceMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName(SERVICE_NAME, "RepeatDataPathTrailingResource")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.RepeatRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.RepeatResponse.getDefaultInstance())) + .setSchemaDescriptor( + new ComplianceMethodDescriptorSupplier("RepeatDataPathTrailingResource")) + .build(); + } + } + } + return getRepeatDataPathTrailingResourceMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.RepeatRequest, com.google.showcase.v1beta1.RepeatResponse> + getRepeatDataBodyPutMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "RepeatDataBodyPut", + requestType = com.google.showcase.v1beta1.RepeatRequest.class, + responseType = com.google.showcase.v1beta1.RepeatResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.RepeatRequest, com.google.showcase.v1beta1.RepeatResponse> + getRepeatDataBodyPutMethod() { + io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.RepeatRequest, com.google.showcase.v1beta1.RepeatResponse> + getRepeatDataBodyPutMethod; + if ((getRepeatDataBodyPutMethod = ComplianceGrpc.getRepeatDataBodyPutMethod) == null) { + synchronized (ComplianceGrpc.class) { + if ((getRepeatDataBodyPutMethod = ComplianceGrpc.getRepeatDataBodyPutMethod) == null) { + ComplianceGrpc.getRepeatDataBodyPutMethod = + getRepeatDataBodyPutMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "RepeatDataBodyPut")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.RepeatRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.RepeatResponse.getDefaultInstance())) + .setSchemaDescriptor( + new ComplianceMethodDescriptorSupplier("RepeatDataBodyPut")) + .build(); + } + } + } + return getRepeatDataBodyPutMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.RepeatRequest, com.google.showcase.v1beta1.RepeatResponse> + getRepeatDataBodyPatchMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "RepeatDataBodyPatch", + requestType = com.google.showcase.v1beta1.RepeatRequest.class, + responseType = com.google.showcase.v1beta1.RepeatResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.RepeatRequest, com.google.showcase.v1beta1.RepeatResponse> + getRepeatDataBodyPatchMethod() { + io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.RepeatRequest, com.google.showcase.v1beta1.RepeatResponse> + getRepeatDataBodyPatchMethod; + if ((getRepeatDataBodyPatchMethod = ComplianceGrpc.getRepeatDataBodyPatchMethod) == null) { + synchronized (ComplianceGrpc.class) { + if ((getRepeatDataBodyPatchMethod = ComplianceGrpc.getRepeatDataBodyPatchMethod) == null) { + ComplianceGrpc.getRepeatDataBodyPatchMethod = + getRepeatDataBodyPatchMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName(SERVICE_NAME, "RepeatDataBodyPatch")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.RepeatRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.RepeatResponse.getDefaultInstance())) + .setSchemaDescriptor( + new ComplianceMethodDescriptorSupplier("RepeatDataBodyPatch")) + .build(); + } + } + } + return getRepeatDataBodyPatchMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.EnumRequest, com.google.showcase.v1beta1.EnumResponse> + getGetEnumMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "GetEnum", + requestType = com.google.showcase.v1beta1.EnumRequest.class, + responseType = com.google.showcase.v1beta1.EnumResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.EnumRequest, com.google.showcase.v1beta1.EnumResponse> + getGetEnumMethod() { + io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.EnumRequest, com.google.showcase.v1beta1.EnumResponse> + getGetEnumMethod; + if ((getGetEnumMethod = ComplianceGrpc.getGetEnumMethod) == null) { + synchronized (ComplianceGrpc.class) { + if ((getGetEnumMethod = ComplianceGrpc.getGetEnumMethod) == null) { + ComplianceGrpc.getGetEnumMethod = + getGetEnumMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetEnum")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.EnumRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.EnumResponse.getDefaultInstance())) + .setSchemaDescriptor(new ComplianceMethodDescriptorSupplier("GetEnum")) + .build(); + } + } + } + return getGetEnumMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.EnumResponse, com.google.showcase.v1beta1.EnumResponse> + getVerifyEnumMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "VerifyEnum", + requestType = com.google.showcase.v1beta1.EnumResponse.class, + responseType = com.google.showcase.v1beta1.EnumResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.EnumResponse, com.google.showcase.v1beta1.EnumResponse> + getVerifyEnumMethod() { + io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.EnumResponse, com.google.showcase.v1beta1.EnumResponse> + getVerifyEnumMethod; + if ((getVerifyEnumMethod = ComplianceGrpc.getVerifyEnumMethod) == null) { + synchronized (ComplianceGrpc.class) { + if ((getVerifyEnumMethod = ComplianceGrpc.getVerifyEnumMethod) == null) { + ComplianceGrpc.getVerifyEnumMethod = + getVerifyEnumMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "VerifyEnum")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.EnumResponse.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.EnumResponse.getDefaultInstance())) + .setSchemaDescriptor(new ComplianceMethodDescriptorSupplier("VerifyEnum")) + .build(); + } + } + } + return getVerifyEnumMethod; + } + + /** Creates a new async stub that supports all call types for the service */ + public static ComplianceStub newStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public ComplianceStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new ComplianceStub(channel, callOptions); + } + }; + return ComplianceStub.newStub(factory, channel); + } + + /** Creates a new blocking-style stub that supports all types of calls on the service */ + public static ComplianceBlockingV2Stub newBlockingV2Stub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public ComplianceBlockingV2Stub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new ComplianceBlockingV2Stub(channel, callOptions); + } + }; + return ComplianceBlockingV2Stub.newStub(factory, channel); + } + + /** + * Creates a new blocking-style stub that supports unary and streaming output calls on the service + */ + public static ComplianceBlockingStub newBlockingStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public ComplianceBlockingStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new ComplianceBlockingStub(channel, callOptions); + } + }; + return ComplianceBlockingStub.newStub(factory, channel); + } + + /** Creates a new ListenableFuture-style stub that supports unary calls on the service */ + public static ComplianceFutureStub newFutureStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public ComplianceFutureStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new ComplianceFutureStub(channel, callOptions); + } + }; + return ComplianceFutureStub.newStub(factory, channel); + } + + /** + * + * + *
        +   * This service is used to test that GAPICs implement various REST-related features correctly. This mostly means transcoding proto3 requests to REST format
        +   * correctly for various types of HTTP annotations, but it also includes verifying that unknown (numeric) enums received by clients can be round-tripped
        +   * correctly.
        +   * 
        + */ + public interface AsyncService { + + /** + * + * + *
        +     * This method echoes the ComplianceData request. This method exercises
        +     * sending the entire request object in the REST body.
        +     * 
        + */ + default void repeatDataBody( + com.google.showcase.v1beta1.RepeatRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getRepeatDataBodyMethod(), responseObserver); + } + + /** + * + * + *
        +     * This method echoes the ComplianceData request. This method exercises
        +     * sending the a message-type field in the REST body. Per AIP-127, only
        +     * top-level, non-repeated fields can be sent this way.
        +     * 
        + */ + default void repeatDataBodyInfo( + com.google.showcase.v1beta1.RepeatRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getRepeatDataBodyInfoMethod(), responseObserver); + } + + /** + * + * + *
        +     * This method echoes the ComplianceData request. This method exercises
        +     * sending all request fields as query parameters.
        +     * 
        + */ + default void repeatDataQuery( + com.google.showcase.v1beta1.RepeatRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getRepeatDataQueryMethod(), responseObserver); + } + + /** + * + * + *
        +     * This method echoes the ComplianceData request. This method exercises
        +     * sending some parameters as "simple" path variables (i.e., of the form
        +     * "/bar/{foo}" rather than "/{foo=bar/*}"), and the rest as query parameters.
        +     * 
        + */ + default void repeatDataSimplePath( + com.google.showcase.v1beta1.RepeatRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getRepeatDataSimplePathMethod(), responseObserver); + } + + /** + * + * + *
        +     * Same as RepeatDataSimplePath, but with a path resource.
        +     * 
        + */ + default void repeatDataPathResource( + com.google.showcase.v1beta1.RepeatRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getRepeatDataPathResourceMethod(), responseObserver); + } + + /** + * + * + *
        +     * Same as RepeatDataSimplePath, but with a trailing resource.
        +     * 
        + */ + default void repeatDataPathTrailingResource( + com.google.showcase.v1beta1.RepeatRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getRepeatDataPathTrailingResourceMethod(), responseObserver); + } + + /** + * + * + *
        +     * This method echoes the ComplianceData request, using the HTTP PUT method.
        +     * 
        + */ + default void repeatDataBodyPut( + com.google.showcase.v1beta1.RepeatRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getRepeatDataBodyPutMethod(), responseObserver); + } + + /** + * + * + *
        +     * This method echoes the ComplianceData request, using the HTTP PATCH method.
        +     * 
        + */ + default void repeatDataBodyPatch( + com.google.showcase.v1beta1.RepeatRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getRepeatDataBodyPatchMethod(), responseObserver); + } + + /** + * + * + *
        +     * This method requests an enum value from the server. Depending on the contents of EnumRequest, the enum value returned will be a known enum declared in the
        +     * .proto file, or a made-up enum value the is unknown to the client. To verify that clients can round-trip unknown enum values they receive, use the
        +     * response from this RPC as the request to VerifyEnum()
        +     * The values of enums sent by the server when a known or unknown value is requested will be the same within a single Showcase server run (this is needed for
        +     * VerifyEnum() to work) but are not guaranteed to be the same across separate Showcase server runs.
        +     * 
        + */ + default void getEnum( + com.google.showcase.v1beta1.EnumRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getGetEnumMethod(), responseObserver); + } + + /** + * + * + *
        +     * This method is used to verify that clients can round-trip enum values, which is particularly important for unknown enum values over REST. VerifyEnum()
        +     * verifies that its request, which is presumably the response that the client previously got to a GetEnum(), contains the correct data. If so, it responds
        +     * with the same EnumResponse; otherwise, the RPC errors.
        +     * This works because the values of enums sent by the server when a known or unknown value is requested will be the same within a single Showcase server run,
        +     * although they are not guaranteed to be the same across separate Showcase server runs.
        +     * 
        + */ + default void verifyEnum( + com.google.showcase.v1beta1.EnumResponse request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getVerifyEnumMethod(), responseObserver); + } + } + + /** + * Base class for the server implementation of the service Compliance. + * + *
        +   * This service is used to test that GAPICs implement various REST-related features correctly. This mostly means transcoding proto3 requests to REST format
        +   * correctly for various types of HTTP annotations, but it also includes verifying that unknown (numeric) enums received by clients can be round-tripped
        +   * correctly.
        +   * 
        + */ + public abstract static class ComplianceImplBase implements io.grpc.BindableService, AsyncService { + + @java.lang.Override + public final io.grpc.ServerServiceDefinition bindService() { + return ComplianceGrpc.bindService(this); + } + } + + /** + * A stub to allow clients to do asynchronous rpc calls to service Compliance. + * + *
        +   * This service is used to test that GAPICs implement various REST-related features correctly. This mostly means transcoding proto3 requests to REST format
        +   * correctly for various types of HTTP annotations, but it also includes verifying that unknown (numeric) enums received by clients can be round-tripped
        +   * correctly.
        +   * 
        + */ + public static final class ComplianceStub extends io.grpc.stub.AbstractAsyncStub { + private ComplianceStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected ComplianceStub build(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new ComplianceStub(channel, callOptions); + } + + /** + * + * + *
        +     * This method echoes the ComplianceData request. This method exercises
        +     * sending the entire request object in the REST body.
        +     * 
        + */ + public void repeatDataBody( + com.google.showcase.v1beta1.RepeatRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getRepeatDataBodyMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
        +     * This method echoes the ComplianceData request. This method exercises
        +     * sending the a message-type field in the REST body. Per AIP-127, only
        +     * top-level, non-repeated fields can be sent this way.
        +     * 
        + */ + public void repeatDataBodyInfo( + com.google.showcase.v1beta1.RepeatRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getRepeatDataBodyInfoMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
        +     * This method echoes the ComplianceData request. This method exercises
        +     * sending all request fields as query parameters.
        +     * 
        + */ + public void repeatDataQuery( + com.google.showcase.v1beta1.RepeatRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getRepeatDataQueryMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
        +     * This method echoes the ComplianceData request. This method exercises
        +     * sending some parameters as "simple" path variables (i.e., of the form
        +     * "/bar/{foo}" rather than "/{foo=bar/*}"), and the rest as query parameters.
        +     * 
        + */ + public void repeatDataSimplePath( + com.google.showcase.v1beta1.RepeatRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getRepeatDataSimplePathMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
        +     * Same as RepeatDataSimplePath, but with a path resource.
        +     * 
        + */ + public void repeatDataPathResource( + com.google.showcase.v1beta1.RepeatRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getRepeatDataPathResourceMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
        +     * Same as RepeatDataSimplePath, but with a trailing resource.
        +     * 
        + */ + public void repeatDataPathTrailingResource( + com.google.showcase.v1beta1.RepeatRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getRepeatDataPathTrailingResourceMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
        +     * This method echoes the ComplianceData request, using the HTTP PUT method.
        +     * 
        + */ + public void repeatDataBodyPut( + com.google.showcase.v1beta1.RepeatRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getRepeatDataBodyPutMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
        +     * This method echoes the ComplianceData request, using the HTTP PATCH method.
        +     * 
        + */ + public void repeatDataBodyPatch( + com.google.showcase.v1beta1.RepeatRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getRepeatDataBodyPatchMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
        +     * This method requests an enum value from the server. Depending on the contents of EnumRequest, the enum value returned will be a known enum declared in the
        +     * .proto file, or a made-up enum value the is unknown to the client. To verify that clients can round-trip unknown enum values they receive, use the
        +     * response from this RPC as the request to VerifyEnum()
        +     * The values of enums sent by the server when a known or unknown value is requested will be the same within a single Showcase server run (this is needed for
        +     * VerifyEnum() to work) but are not guaranteed to be the same across separate Showcase server runs.
        +     * 
        + */ + public void getEnum( + com.google.showcase.v1beta1.EnumRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getGetEnumMethod(), getCallOptions()), request, responseObserver); + } + + /** + * + * + *
        +     * This method is used to verify that clients can round-trip enum values, which is particularly important for unknown enum values over REST. VerifyEnum()
        +     * verifies that its request, which is presumably the response that the client previously got to a GetEnum(), contains the correct data. If so, it responds
        +     * with the same EnumResponse; otherwise, the RPC errors.
        +     * This works because the values of enums sent by the server when a known or unknown value is requested will be the same within a single Showcase server run,
        +     * although they are not guaranteed to be the same across separate Showcase server runs.
        +     * 
        + */ + public void verifyEnum( + com.google.showcase.v1beta1.EnumResponse request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getVerifyEnumMethod(), getCallOptions()), request, responseObserver); + } + } + + /** + * A stub to allow clients to do synchronous rpc calls to service Compliance. + * + *
        +   * This service is used to test that GAPICs implement various REST-related features correctly. This mostly means transcoding proto3 requests to REST format
        +   * correctly for various types of HTTP annotations, but it also includes verifying that unknown (numeric) enums received by clients can be round-tripped
        +   * correctly.
        +   * 
        + */ + public static final class ComplianceBlockingV2Stub + extends io.grpc.stub.AbstractBlockingStub { + private ComplianceBlockingV2Stub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected ComplianceBlockingV2Stub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new ComplianceBlockingV2Stub(channel, callOptions); + } + + /** + * + * + *
        +     * This method echoes the ComplianceData request. This method exercises
        +     * sending the entire request object in the REST body.
        +     * 
        + */ + public com.google.showcase.v1beta1.RepeatResponse repeatDataBody( + com.google.showcase.v1beta1.RepeatRequest request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getRepeatDataBodyMethod(), getCallOptions(), request); + } + + /** + * + * + *
        +     * This method echoes the ComplianceData request. This method exercises
        +     * sending the a message-type field in the REST body. Per AIP-127, only
        +     * top-level, non-repeated fields can be sent this way.
        +     * 
        + */ + public com.google.showcase.v1beta1.RepeatResponse repeatDataBodyInfo( + com.google.showcase.v1beta1.RepeatRequest request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getRepeatDataBodyInfoMethod(), getCallOptions(), request); + } + + /** + * + * + *
        +     * This method echoes the ComplianceData request. This method exercises
        +     * sending all request fields as query parameters.
        +     * 
        + */ + public com.google.showcase.v1beta1.RepeatResponse repeatDataQuery( + com.google.showcase.v1beta1.RepeatRequest request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getRepeatDataQueryMethod(), getCallOptions(), request); + } + + /** + * + * + *
        +     * This method echoes the ComplianceData request. This method exercises
        +     * sending some parameters as "simple" path variables (i.e., of the form
        +     * "/bar/{foo}" rather than "/{foo=bar/*}"), and the rest as query parameters.
        +     * 
        + */ + public com.google.showcase.v1beta1.RepeatResponse repeatDataSimplePath( + com.google.showcase.v1beta1.RepeatRequest request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getRepeatDataSimplePathMethod(), getCallOptions(), request); + } + + /** + * + * + *
        +     * Same as RepeatDataSimplePath, but with a path resource.
        +     * 
        + */ + public com.google.showcase.v1beta1.RepeatResponse repeatDataPathResource( + com.google.showcase.v1beta1.RepeatRequest request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getRepeatDataPathResourceMethod(), getCallOptions(), request); + } + + /** + * + * + *
        +     * Same as RepeatDataSimplePath, but with a trailing resource.
        +     * 
        + */ + public com.google.showcase.v1beta1.RepeatResponse repeatDataPathTrailingResource( + com.google.showcase.v1beta1.RepeatRequest request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getRepeatDataPathTrailingResourceMethod(), getCallOptions(), request); + } + + /** + * + * + *
        +     * This method echoes the ComplianceData request, using the HTTP PUT method.
        +     * 
        + */ + public com.google.showcase.v1beta1.RepeatResponse repeatDataBodyPut( + com.google.showcase.v1beta1.RepeatRequest request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getRepeatDataBodyPutMethod(), getCallOptions(), request); + } + + /** + * + * + *
        +     * This method echoes the ComplianceData request, using the HTTP PATCH method.
        +     * 
        + */ + public com.google.showcase.v1beta1.RepeatResponse repeatDataBodyPatch( + com.google.showcase.v1beta1.RepeatRequest request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getRepeatDataBodyPatchMethod(), getCallOptions(), request); + } + + /** + * + * + *
        +     * This method requests an enum value from the server. Depending on the contents of EnumRequest, the enum value returned will be a known enum declared in the
        +     * .proto file, or a made-up enum value the is unknown to the client. To verify that clients can round-trip unknown enum values they receive, use the
        +     * response from this RPC as the request to VerifyEnum()
        +     * The values of enums sent by the server when a known or unknown value is requested will be the same within a single Showcase server run (this is needed for
        +     * VerifyEnum() to work) but are not guaranteed to be the same across separate Showcase server runs.
        +     * 
        + */ + public com.google.showcase.v1beta1.EnumResponse getEnum( + com.google.showcase.v1beta1.EnumRequest request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getGetEnumMethod(), getCallOptions(), request); + } + + /** + * + * + *
        +     * This method is used to verify that clients can round-trip enum values, which is particularly important for unknown enum values over REST. VerifyEnum()
        +     * verifies that its request, which is presumably the response that the client previously got to a GetEnum(), contains the correct data. If so, it responds
        +     * with the same EnumResponse; otherwise, the RPC errors.
        +     * This works because the values of enums sent by the server when a known or unknown value is requested will be the same within a single Showcase server run,
        +     * although they are not guaranteed to be the same across separate Showcase server runs.
        +     * 
        + */ + public com.google.showcase.v1beta1.EnumResponse verifyEnum( + com.google.showcase.v1beta1.EnumResponse request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getVerifyEnumMethod(), getCallOptions(), request); + } + } + + /** + * A stub to allow clients to do limited synchronous rpc calls to service Compliance. + * + *
        +   * This service is used to test that GAPICs implement various REST-related features correctly. This mostly means transcoding proto3 requests to REST format
        +   * correctly for various types of HTTP annotations, but it also includes verifying that unknown (numeric) enums received by clients can be round-tripped
        +   * correctly.
        +   * 
        + */ + public static final class ComplianceBlockingStub + extends io.grpc.stub.AbstractBlockingStub { + private ComplianceBlockingStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected ComplianceBlockingStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new ComplianceBlockingStub(channel, callOptions); + } + + /** + * + * + *
        +     * This method echoes the ComplianceData request. This method exercises
        +     * sending the entire request object in the REST body.
        +     * 
        + */ + public com.google.showcase.v1beta1.RepeatResponse repeatDataBody( + com.google.showcase.v1beta1.RepeatRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getRepeatDataBodyMethod(), getCallOptions(), request); + } + + /** + * + * + *
        +     * This method echoes the ComplianceData request. This method exercises
        +     * sending the a message-type field in the REST body. Per AIP-127, only
        +     * top-level, non-repeated fields can be sent this way.
        +     * 
        + */ + public com.google.showcase.v1beta1.RepeatResponse repeatDataBodyInfo( + com.google.showcase.v1beta1.RepeatRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getRepeatDataBodyInfoMethod(), getCallOptions(), request); + } + + /** + * + * + *
        +     * This method echoes the ComplianceData request. This method exercises
        +     * sending all request fields as query parameters.
        +     * 
        + */ + public com.google.showcase.v1beta1.RepeatResponse repeatDataQuery( + com.google.showcase.v1beta1.RepeatRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getRepeatDataQueryMethod(), getCallOptions(), request); + } + + /** + * + * + *
        +     * This method echoes the ComplianceData request. This method exercises
        +     * sending some parameters as "simple" path variables (i.e., of the form
        +     * "/bar/{foo}" rather than "/{foo=bar/*}"), and the rest as query parameters.
        +     * 
        + */ + public com.google.showcase.v1beta1.RepeatResponse repeatDataSimplePath( + com.google.showcase.v1beta1.RepeatRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getRepeatDataSimplePathMethod(), getCallOptions(), request); + } + + /** + * + * + *
        +     * Same as RepeatDataSimplePath, but with a path resource.
        +     * 
        + */ + public com.google.showcase.v1beta1.RepeatResponse repeatDataPathResource( + com.google.showcase.v1beta1.RepeatRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getRepeatDataPathResourceMethod(), getCallOptions(), request); + } + + /** + * + * + *
        +     * Same as RepeatDataSimplePath, but with a trailing resource.
        +     * 
        + */ + public com.google.showcase.v1beta1.RepeatResponse repeatDataPathTrailingResource( + com.google.showcase.v1beta1.RepeatRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getRepeatDataPathTrailingResourceMethod(), getCallOptions(), request); + } + + /** + * + * + *
        +     * This method echoes the ComplianceData request, using the HTTP PUT method.
        +     * 
        + */ + public com.google.showcase.v1beta1.RepeatResponse repeatDataBodyPut( + com.google.showcase.v1beta1.RepeatRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getRepeatDataBodyPutMethod(), getCallOptions(), request); + } + + /** + * + * + *
        +     * This method echoes the ComplianceData request, using the HTTP PATCH method.
        +     * 
        + */ + public com.google.showcase.v1beta1.RepeatResponse repeatDataBodyPatch( + com.google.showcase.v1beta1.RepeatRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getRepeatDataBodyPatchMethod(), getCallOptions(), request); + } + + /** + * + * + *
        +     * This method requests an enum value from the server. Depending on the contents of EnumRequest, the enum value returned will be a known enum declared in the
        +     * .proto file, or a made-up enum value the is unknown to the client. To verify that clients can round-trip unknown enum values they receive, use the
        +     * response from this RPC as the request to VerifyEnum()
        +     * The values of enums sent by the server when a known or unknown value is requested will be the same within a single Showcase server run (this is needed for
        +     * VerifyEnum() to work) but are not guaranteed to be the same across separate Showcase server runs.
        +     * 
        + */ + public com.google.showcase.v1beta1.EnumResponse getEnum( + com.google.showcase.v1beta1.EnumRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getGetEnumMethod(), getCallOptions(), request); + } + + /** + * + * + *
        +     * This method is used to verify that clients can round-trip enum values, which is particularly important for unknown enum values over REST. VerifyEnum()
        +     * verifies that its request, which is presumably the response that the client previously got to a GetEnum(), contains the correct data. If so, it responds
        +     * with the same EnumResponse; otherwise, the RPC errors.
        +     * This works because the values of enums sent by the server when a known or unknown value is requested will be the same within a single Showcase server run,
        +     * although they are not guaranteed to be the same across separate Showcase server runs.
        +     * 
        + */ + public com.google.showcase.v1beta1.EnumResponse verifyEnum( + com.google.showcase.v1beta1.EnumResponse request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getVerifyEnumMethod(), getCallOptions(), request); + } + } + + /** + * A stub to allow clients to do ListenableFuture-style rpc calls to service Compliance. + * + *
        +   * This service is used to test that GAPICs implement various REST-related features correctly. This mostly means transcoding proto3 requests to REST format
        +   * correctly for various types of HTTP annotations, but it also includes verifying that unknown (numeric) enums received by clients can be round-tripped
        +   * correctly.
        +   * 
        + */ + public static final class ComplianceFutureStub + extends io.grpc.stub.AbstractFutureStub { + private ComplianceFutureStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected ComplianceFutureStub build(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new ComplianceFutureStub(channel, callOptions); + } + + /** + * + * + *
        +     * This method echoes the ComplianceData request. This method exercises
        +     * sending the entire request object in the REST body.
        +     * 
        + */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.showcase.v1beta1.RepeatResponse> + repeatDataBody(com.google.showcase.v1beta1.RepeatRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getRepeatDataBodyMethod(), getCallOptions()), request); + } + + /** + * + * + *
        +     * This method echoes the ComplianceData request. This method exercises
        +     * sending the a message-type field in the REST body. Per AIP-127, only
        +     * top-level, non-repeated fields can be sent this way.
        +     * 
        + */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.showcase.v1beta1.RepeatResponse> + repeatDataBodyInfo(com.google.showcase.v1beta1.RepeatRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getRepeatDataBodyInfoMethod(), getCallOptions()), request); + } + + /** + * + * + *
        +     * This method echoes the ComplianceData request. This method exercises
        +     * sending all request fields as query parameters.
        +     * 
        + */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.showcase.v1beta1.RepeatResponse> + repeatDataQuery(com.google.showcase.v1beta1.RepeatRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getRepeatDataQueryMethod(), getCallOptions()), request); + } + + /** + * + * + *
        +     * This method echoes the ComplianceData request. This method exercises
        +     * sending some parameters as "simple" path variables (i.e., of the form
        +     * "/bar/{foo}" rather than "/{foo=bar/*}"), and the rest as query parameters.
        +     * 
        + */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.showcase.v1beta1.RepeatResponse> + repeatDataSimplePath(com.google.showcase.v1beta1.RepeatRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getRepeatDataSimplePathMethod(), getCallOptions()), request); + } + + /** + * + * + *
        +     * Same as RepeatDataSimplePath, but with a path resource.
        +     * 
        + */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.showcase.v1beta1.RepeatResponse> + repeatDataPathResource(com.google.showcase.v1beta1.RepeatRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getRepeatDataPathResourceMethod(), getCallOptions()), request); + } + + /** + * + * + *
        +     * Same as RepeatDataSimplePath, but with a trailing resource.
        +     * 
        + */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.showcase.v1beta1.RepeatResponse> + repeatDataPathTrailingResource(com.google.showcase.v1beta1.RepeatRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getRepeatDataPathTrailingResourceMethod(), getCallOptions()), + request); + } + + /** + * + * + *
        +     * This method echoes the ComplianceData request, using the HTTP PUT method.
        +     * 
        + */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.showcase.v1beta1.RepeatResponse> + repeatDataBodyPut(com.google.showcase.v1beta1.RepeatRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getRepeatDataBodyPutMethod(), getCallOptions()), request); + } + + /** + * + * + *
        +     * This method echoes the ComplianceData request, using the HTTP PATCH method.
        +     * 
        + */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.showcase.v1beta1.RepeatResponse> + repeatDataBodyPatch(com.google.showcase.v1beta1.RepeatRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getRepeatDataBodyPatchMethod(), getCallOptions()), request); + } + + /** + * + * + *
        +     * This method requests an enum value from the server. Depending on the contents of EnumRequest, the enum value returned will be a known enum declared in the
        +     * .proto file, or a made-up enum value the is unknown to the client. To verify that clients can round-trip unknown enum values they receive, use the
        +     * response from this RPC as the request to VerifyEnum()
        +     * The values of enums sent by the server when a known or unknown value is requested will be the same within a single Showcase server run (this is needed for
        +     * VerifyEnum() to work) but are not guaranteed to be the same across separate Showcase server runs.
        +     * 
        + */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.showcase.v1beta1.EnumResponse> + getEnum(com.google.showcase.v1beta1.EnumRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getGetEnumMethod(), getCallOptions()), request); + } + + /** + * + * + *
        +     * This method is used to verify that clients can round-trip enum values, which is particularly important for unknown enum values over REST. VerifyEnum()
        +     * verifies that its request, which is presumably the response that the client previously got to a GetEnum(), contains the correct data. If so, it responds
        +     * with the same EnumResponse; otherwise, the RPC errors.
        +     * This works because the values of enums sent by the server when a known or unknown value is requested will be the same within a single Showcase server run,
        +     * although they are not guaranteed to be the same across separate Showcase server runs.
        +     * 
        + */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.showcase.v1beta1.EnumResponse> + verifyEnum(com.google.showcase.v1beta1.EnumResponse request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getVerifyEnumMethod(), getCallOptions()), request); + } + } + + private static final int METHODID_REPEAT_DATA_BODY = 0; + private static final int METHODID_REPEAT_DATA_BODY_INFO = 1; + private static final int METHODID_REPEAT_DATA_QUERY = 2; + private static final int METHODID_REPEAT_DATA_SIMPLE_PATH = 3; + private static final int METHODID_REPEAT_DATA_PATH_RESOURCE = 4; + private static final int METHODID_REPEAT_DATA_PATH_TRAILING_RESOURCE = 5; + private static final int METHODID_REPEAT_DATA_BODY_PUT = 6; + private static final int METHODID_REPEAT_DATA_BODY_PATCH = 7; + private static final int METHODID_GET_ENUM = 8; + private static final int METHODID_VERIFY_ENUM = 9; + + 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_REPEAT_DATA_BODY: + serviceImpl.repeatDataBody( + (com.google.showcase.v1beta1.RepeatRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_REPEAT_DATA_BODY_INFO: + serviceImpl.repeatDataBodyInfo( + (com.google.showcase.v1beta1.RepeatRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_REPEAT_DATA_QUERY: + serviceImpl.repeatDataQuery( + (com.google.showcase.v1beta1.RepeatRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_REPEAT_DATA_SIMPLE_PATH: + serviceImpl.repeatDataSimplePath( + (com.google.showcase.v1beta1.RepeatRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_REPEAT_DATA_PATH_RESOURCE: + serviceImpl.repeatDataPathResource( + (com.google.showcase.v1beta1.RepeatRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_REPEAT_DATA_PATH_TRAILING_RESOURCE: + serviceImpl.repeatDataPathTrailingResource( + (com.google.showcase.v1beta1.RepeatRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_REPEAT_DATA_BODY_PUT: + serviceImpl.repeatDataBodyPut( + (com.google.showcase.v1beta1.RepeatRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_REPEAT_DATA_BODY_PATCH: + serviceImpl.repeatDataBodyPatch( + (com.google.showcase.v1beta1.RepeatRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_GET_ENUM: + serviceImpl.getEnum( + (com.google.showcase.v1beta1.EnumRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_VERIFY_ENUM: + serviceImpl.verifyEnum( + (com.google.showcase.v1beta1.EnumResponse) 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( + getRepeatDataBodyMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.showcase.v1beta1.RepeatRequest, + com.google.showcase.v1beta1.RepeatResponse>( + service, METHODID_REPEAT_DATA_BODY))) + .addMethod( + getRepeatDataBodyInfoMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.showcase.v1beta1.RepeatRequest, + com.google.showcase.v1beta1.RepeatResponse>( + service, METHODID_REPEAT_DATA_BODY_INFO))) + .addMethod( + getRepeatDataQueryMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.showcase.v1beta1.RepeatRequest, + com.google.showcase.v1beta1.RepeatResponse>( + service, METHODID_REPEAT_DATA_QUERY))) + .addMethod( + getRepeatDataSimplePathMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.showcase.v1beta1.RepeatRequest, + com.google.showcase.v1beta1.RepeatResponse>( + service, METHODID_REPEAT_DATA_SIMPLE_PATH))) + .addMethod( + getRepeatDataPathResourceMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.showcase.v1beta1.RepeatRequest, + com.google.showcase.v1beta1.RepeatResponse>( + service, METHODID_REPEAT_DATA_PATH_RESOURCE))) + .addMethod( + getRepeatDataPathTrailingResourceMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.showcase.v1beta1.RepeatRequest, + com.google.showcase.v1beta1.RepeatResponse>( + service, METHODID_REPEAT_DATA_PATH_TRAILING_RESOURCE))) + .addMethod( + getRepeatDataBodyPutMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.showcase.v1beta1.RepeatRequest, + com.google.showcase.v1beta1.RepeatResponse>( + service, METHODID_REPEAT_DATA_BODY_PUT))) + .addMethod( + getRepeatDataBodyPatchMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.showcase.v1beta1.RepeatRequest, + com.google.showcase.v1beta1.RepeatResponse>( + service, METHODID_REPEAT_DATA_BODY_PATCH))) + .addMethod( + getGetEnumMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.showcase.v1beta1.EnumRequest, + com.google.showcase.v1beta1.EnumResponse>(service, METHODID_GET_ENUM))) + .addMethod( + getVerifyEnumMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.showcase.v1beta1.EnumResponse, + com.google.showcase.v1beta1.EnumResponse>(service, METHODID_VERIFY_ENUM))) + .build(); + } + + private abstract static class ComplianceBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoFileDescriptorSupplier, + io.grpc.protobuf.ProtoServiceDescriptorSupplier { + ComplianceBaseDescriptorSupplier() {} + + @java.lang.Override + public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() { + return com.google.showcase.v1beta1.ComplianceOuterClass.getDescriptor(); + } + + @java.lang.Override + public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() { + return getFileDescriptor().findServiceByName("Compliance"); + } + } + + private static final class ComplianceFileDescriptorSupplier + extends ComplianceBaseDescriptorSupplier { + ComplianceFileDescriptorSupplier() {} + } + + private static final class ComplianceMethodDescriptorSupplier + extends ComplianceBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoMethodDescriptorSupplier { + private final java.lang.String methodName; + + ComplianceMethodDescriptorSupplier(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 (ComplianceGrpc.class) { + result = serviceDescriptor; + if (result == null) { + serviceDescriptor = + result = + io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME) + .setSchemaDescriptor(new ComplianceFileDescriptorSupplier()) + .addMethod(getRepeatDataBodyMethod()) + .addMethod(getRepeatDataBodyInfoMethod()) + .addMethod(getRepeatDataQueryMethod()) + .addMethod(getRepeatDataSimplePathMethod()) + .addMethod(getRepeatDataPathResourceMethod()) + .addMethod(getRepeatDataPathTrailingResourceMethod()) + .addMethod(getRepeatDataBodyPutMethod()) + .addMethod(getRepeatDataBodyPatchMethod()) + .addMethod(getGetEnumMethod()) + .addMethod(getVerifyEnumMethod()) + .build(); + } + } + } + return result; + } +} diff --git a/java-showcase-3.21.0/grpc-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/EchoGrpc.java b/java-showcase-3.21.0/grpc-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/EchoGrpc.java new file mode 100644 index 0000000000..0d30b3d3e2 --- /dev/null +++ b/java-showcase-3.21.0/grpc-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/EchoGrpc.java @@ -0,0 +1,1770 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.showcase.v1beta1; + +import static io.grpc.MethodDescriptor.generateFullMethodName; + +/** + * + * + *
        + * This service is used showcase the four main types of rpcs - unary, server
        + * side streaming, client side streaming, and bidirectional streaming. This
        + * service also exposes methods that explicitly implement server delay, and
        + * paginated calls. Set the 'showcase-trailer' metadata key on any method
        + * to have the values echoed in the response trailers. Set the
        + * 'x-goog-request-params' metadata key on any method to have the values
        + * echoed in the response headers.
        + * 
        + */ +@io.grpc.stub.annotations.GrpcGenerated +public final class EchoGrpc { + + private EchoGrpc() {} + + public static final java.lang.String SERVICE_NAME = "google.showcase.v1beta1.Echo"; + + // Static method descriptors that strictly reflect the proto. + private static volatile io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.EchoRequest, com.google.showcase.v1beta1.EchoResponse> + getEchoMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "Echo", + requestType = com.google.showcase.v1beta1.EchoRequest.class, + responseType = com.google.showcase.v1beta1.EchoResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.EchoRequest, com.google.showcase.v1beta1.EchoResponse> + getEchoMethod() { + io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.EchoRequest, com.google.showcase.v1beta1.EchoResponse> + getEchoMethod; + if ((getEchoMethod = EchoGrpc.getEchoMethod) == null) { + synchronized (EchoGrpc.class) { + if ((getEchoMethod = EchoGrpc.getEchoMethod) == null) { + EchoGrpc.getEchoMethod = + getEchoMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "Echo")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.EchoRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.EchoResponse.getDefaultInstance())) + .setSchemaDescriptor(new EchoMethodDescriptorSupplier("Echo")) + .build(); + } + } + } + return getEchoMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.EchoErrorDetailsRequest, + com.google.showcase.v1beta1.EchoErrorDetailsResponse> + getEchoErrorDetailsMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "EchoErrorDetails", + requestType = com.google.showcase.v1beta1.EchoErrorDetailsRequest.class, + responseType = com.google.showcase.v1beta1.EchoErrorDetailsResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.EchoErrorDetailsRequest, + com.google.showcase.v1beta1.EchoErrorDetailsResponse> + getEchoErrorDetailsMethod() { + io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.EchoErrorDetailsRequest, + com.google.showcase.v1beta1.EchoErrorDetailsResponse> + getEchoErrorDetailsMethod; + if ((getEchoErrorDetailsMethod = EchoGrpc.getEchoErrorDetailsMethod) == null) { + synchronized (EchoGrpc.class) { + if ((getEchoErrorDetailsMethod = EchoGrpc.getEchoErrorDetailsMethod) == null) { + EchoGrpc.getEchoErrorDetailsMethod = + getEchoErrorDetailsMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "EchoErrorDetails")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.EchoErrorDetailsRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.EchoErrorDetailsResponse + .getDefaultInstance())) + .setSchemaDescriptor(new EchoMethodDescriptorSupplier("EchoErrorDetails")) + .build(); + } + } + } + return getEchoErrorDetailsMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.FailEchoWithDetailsRequest, + com.google.showcase.v1beta1.FailEchoWithDetailsResponse> + getFailEchoWithDetailsMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "FailEchoWithDetails", + requestType = com.google.showcase.v1beta1.FailEchoWithDetailsRequest.class, + responseType = com.google.showcase.v1beta1.FailEchoWithDetailsResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.FailEchoWithDetailsRequest, + com.google.showcase.v1beta1.FailEchoWithDetailsResponse> + getFailEchoWithDetailsMethod() { + io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.FailEchoWithDetailsRequest, + com.google.showcase.v1beta1.FailEchoWithDetailsResponse> + getFailEchoWithDetailsMethod; + if ((getFailEchoWithDetailsMethod = EchoGrpc.getFailEchoWithDetailsMethod) == null) { + synchronized (EchoGrpc.class) { + if ((getFailEchoWithDetailsMethod = EchoGrpc.getFailEchoWithDetailsMethod) == null) { + EchoGrpc.getFailEchoWithDetailsMethod = + getFailEchoWithDetailsMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName(SERVICE_NAME, "FailEchoWithDetails")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.FailEchoWithDetailsRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.FailEchoWithDetailsResponse + .getDefaultInstance())) + .setSchemaDescriptor(new EchoMethodDescriptorSupplier("FailEchoWithDetails")) + .build(); + } + } + } + return getFailEchoWithDetailsMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.ExpandRequest, com.google.showcase.v1beta1.EchoResponse> + getExpandMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "Expand", + requestType = com.google.showcase.v1beta1.ExpandRequest.class, + responseType = com.google.showcase.v1beta1.EchoResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.SERVER_STREAMING) + public static io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.ExpandRequest, com.google.showcase.v1beta1.EchoResponse> + getExpandMethod() { + io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.ExpandRequest, com.google.showcase.v1beta1.EchoResponse> + getExpandMethod; + if ((getExpandMethod = EchoGrpc.getExpandMethod) == null) { + synchronized (EchoGrpc.class) { + if ((getExpandMethod = EchoGrpc.getExpandMethod) == null) { + EchoGrpc.getExpandMethod = + getExpandMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.SERVER_STREAMING) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "Expand")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.ExpandRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.EchoResponse.getDefaultInstance())) + .setSchemaDescriptor(new EchoMethodDescriptorSupplier("Expand")) + .build(); + } + } + } + return getExpandMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.EchoRequest, com.google.showcase.v1beta1.EchoResponse> + getCollectMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "Collect", + requestType = com.google.showcase.v1beta1.EchoRequest.class, + responseType = com.google.showcase.v1beta1.EchoResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.CLIENT_STREAMING) + public static io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.EchoRequest, com.google.showcase.v1beta1.EchoResponse> + getCollectMethod() { + io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.EchoRequest, com.google.showcase.v1beta1.EchoResponse> + getCollectMethod; + if ((getCollectMethod = EchoGrpc.getCollectMethod) == null) { + synchronized (EchoGrpc.class) { + if ((getCollectMethod = EchoGrpc.getCollectMethod) == null) { + EchoGrpc.getCollectMethod = + getCollectMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.CLIENT_STREAMING) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "Collect")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.EchoRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.EchoResponse.getDefaultInstance())) + .setSchemaDescriptor(new EchoMethodDescriptorSupplier("Collect")) + .build(); + } + } + } + return getCollectMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.EchoRequest, com.google.showcase.v1beta1.EchoResponse> + getChatMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "Chat", + requestType = com.google.showcase.v1beta1.EchoRequest.class, + responseType = com.google.showcase.v1beta1.EchoResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.BIDI_STREAMING) + public static io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.EchoRequest, com.google.showcase.v1beta1.EchoResponse> + getChatMethod() { + io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.EchoRequest, com.google.showcase.v1beta1.EchoResponse> + getChatMethod; + if ((getChatMethod = EchoGrpc.getChatMethod) == null) { + synchronized (EchoGrpc.class) { + if ((getChatMethod = EchoGrpc.getChatMethod) == null) { + EchoGrpc.getChatMethod = + getChatMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.BIDI_STREAMING) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "Chat")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.EchoRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.EchoResponse.getDefaultInstance())) + .setSchemaDescriptor(new EchoMethodDescriptorSupplier("Chat")) + .build(); + } + } + } + return getChatMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.PagedExpandRequest, + com.google.showcase.v1beta1.PagedExpandResponse> + getPagedExpandMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "PagedExpand", + requestType = com.google.showcase.v1beta1.PagedExpandRequest.class, + responseType = com.google.showcase.v1beta1.PagedExpandResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.PagedExpandRequest, + com.google.showcase.v1beta1.PagedExpandResponse> + getPagedExpandMethod() { + io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.PagedExpandRequest, + com.google.showcase.v1beta1.PagedExpandResponse> + getPagedExpandMethod; + if ((getPagedExpandMethod = EchoGrpc.getPagedExpandMethod) == null) { + synchronized (EchoGrpc.class) { + if ((getPagedExpandMethod = EchoGrpc.getPagedExpandMethod) == null) { + EchoGrpc.getPagedExpandMethod = + getPagedExpandMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "PagedExpand")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.PagedExpandRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.PagedExpandResponse.getDefaultInstance())) + .setSchemaDescriptor(new EchoMethodDescriptorSupplier("PagedExpand")) + .build(); + } + } + } + return getPagedExpandMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.PagedExpandLegacyRequest, + com.google.showcase.v1beta1.PagedExpandResponse> + getPagedExpandLegacyMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "PagedExpandLegacy", + requestType = com.google.showcase.v1beta1.PagedExpandLegacyRequest.class, + responseType = com.google.showcase.v1beta1.PagedExpandResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.PagedExpandLegacyRequest, + com.google.showcase.v1beta1.PagedExpandResponse> + getPagedExpandLegacyMethod() { + io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.PagedExpandLegacyRequest, + com.google.showcase.v1beta1.PagedExpandResponse> + getPagedExpandLegacyMethod; + if ((getPagedExpandLegacyMethod = EchoGrpc.getPagedExpandLegacyMethod) == null) { + synchronized (EchoGrpc.class) { + if ((getPagedExpandLegacyMethod = EchoGrpc.getPagedExpandLegacyMethod) == null) { + EchoGrpc.getPagedExpandLegacyMethod = + getPagedExpandLegacyMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "PagedExpandLegacy")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.PagedExpandLegacyRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.PagedExpandResponse.getDefaultInstance())) + .setSchemaDescriptor(new EchoMethodDescriptorSupplier("PagedExpandLegacy")) + .build(); + } + } + } + return getPagedExpandLegacyMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.PagedExpandRequest, + com.google.showcase.v1beta1.PagedExpandLegacyMappedResponse> + getPagedExpandLegacyMappedMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "PagedExpandLegacyMapped", + requestType = com.google.showcase.v1beta1.PagedExpandRequest.class, + responseType = com.google.showcase.v1beta1.PagedExpandLegacyMappedResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.PagedExpandRequest, + com.google.showcase.v1beta1.PagedExpandLegacyMappedResponse> + getPagedExpandLegacyMappedMethod() { + io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.PagedExpandRequest, + com.google.showcase.v1beta1.PagedExpandLegacyMappedResponse> + getPagedExpandLegacyMappedMethod; + if ((getPagedExpandLegacyMappedMethod = EchoGrpc.getPagedExpandLegacyMappedMethod) == null) { + synchronized (EchoGrpc.class) { + if ((getPagedExpandLegacyMappedMethod = EchoGrpc.getPagedExpandLegacyMappedMethod) + == null) { + EchoGrpc.getPagedExpandLegacyMappedMethod = + getPagedExpandLegacyMappedMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName(SERVICE_NAME, "PagedExpandLegacyMapped")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.PagedExpandRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.PagedExpandLegacyMappedResponse + .getDefaultInstance())) + .setSchemaDescriptor( + new EchoMethodDescriptorSupplier("PagedExpandLegacyMapped")) + .build(); + } + } + } + return getPagedExpandLegacyMappedMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.WaitRequest, com.google.longrunning.Operation> + getWaitMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "Wait", + requestType = com.google.showcase.v1beta1.WaitRequest.class, + responseType = com.google.longrunning.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.WaitRequest, com.google.longrunning.Operation> + getWaitMethod() { + io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.WaitRequest, com.google.longrunning.Operation> + getWaitMethod; + if ((getWaitMethod = EchoGrpc.getWaitMethod) == null) { + synchronized (EchoGrpc.class) { + if ((getWaitMethod = EchoGrpc.getWaitMethod) == null) { + EchoGrpc.getWaitMethod = + getWaitMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "Wait")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.WaitRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor(new EchoMethodDescriptorSupplier("Wait")) + .build(); + } + } + } + return getWaitMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.BlockRequest, com.google.showcase.v1beta1.BlockResponse> + getBlockMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "Block", + requestType = com.google.showcase.v1beta1.BlockRequest.class, + responseType = com.google.showcase.v1beta1.BlockResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.BlockRequest, com.google.showcase.v1beta1.BlockResponse> + getBlockMethod() { + io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.BlockRequest, com.google.showcase.v1beta1.BlockResponse> + getBlockMethod; + if ((getBlockMethod = EchoGrpc.getBlockMethod) == null) { + synchronized (EchoGrpc.class) { + if ((getBlockMethod = EchoGrpc.getBlockMethod) == null) { + EchoGrpc.getBlockMethod = + getBlockMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "Block")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.BlockRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.BlockResponse.getDefaultInstance())) + .setSchemaDescriptor(new EchoMethodDescriptorSupplier("Block")) + .build(); + } + } + } + return getBlockMethod; + } + + /** Creates a new async stub that supports all call types for the service */ + public static EchoStub newStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public EchoStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new EchoStub(channel, callOptions); + } + }; + return EchoStub.newStub(factory, channel); + } + + /** Creates a new blocking-style stub that supports all types of calls on the service */ + public static EchoBlockingV2Stub newBlockingV2Stub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public EchoBlockingV2Stub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new EchoBlockingV2Stub(channel, callOptions); + } + }; + return EchoBlockingV2Stub.newStub(factory, channel); + } + + /** + * Creates a new blocking-style stub that supports unary and streaming output calls on the service + */ + public static EchoBlockingStub newBlockingStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public EchoBlockingStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new EchoBlockingStub(channel, callOptions); + } + }; + return EchoBlockingStub.newStub(factory, channel); + } + + /** Creates a new ListenableFuture-style stub that supports unary calls on the service */ + public static EchoFutureStub newFutureStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public EchoFutureStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new EchoFutureStub(channel, callOptions); + } + }; + return EchoFutureStub.newStub(factory, channel); + } + + /** + * + * + *
        +   * This service is used showcase the four main types of rpcs - unary, server
        +   * side streaming, client side streaming, and bidirectional streaming. This
        +   * service also exposes methods that explicitly implement server delay, and
        +   * paginated calls. Set the 'showcase-trailer' metadata key on any method
        +   * to have the values echoed in the response trailers. Set the
        +   * 'x-goog-request-params' metadata key on any method to have the values
        +   * echoed in the response headers.
        +   * 
        + */ + public interface AsyncService { + + /** + * + * + *
        +     * This method simply echoes the request. This method showcases unary RPCs.
        +     * 
        + */ + default void echo( + com.google.showcase.v1beta1.EchoRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getEchoMethod(), responseObserver); + } + + /** + * + * + *
        +     * This method returns error details in a repeated "google.protobuf.Any"
        +     * field. This method showcases handling errors thus encoded, particularly
        +     * over REST transport. Note that GAPICs only allow the type
        +     * "google.protobuf.Any" for field paths ending in "error.details", and, at
        +     * run-time, the actual types for these fields must be one of the types in
        +     * google/rpc/error_details.proto.
        +     * 
        + */ + default void echoErrorDetails( + com.google.showcase.v1beta1.EchoErrorDetailsRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getEchoErrorDetailsMethod(), responseObserver); + } + + /** + * + * + *
        +     * This method always fails with a gRPC "Aborted" error status that contains
        +     * multiple error details.  These include one instance of each of the standard
        +     * ones in error_details.proto
        +     * (https://github.com/googleapis/googleapis/blob/master/google/rpc/error_details.proto)
        +     * plus a custom, Showcase-defined PoetryError. The intent of this RPC is to
        +     * verify that GAPICs can process these various error details and surface them
        +     * to the user in an idiomatic form.
        +     * 
        + */ + default void failEchoWithDetails( + com.google.showcase.v1beta1.FailEchoWithDetailsRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getFailEchoWithDetailsMethod(), responseObserver); + } + + /** + * + * + *
        +     * This method splits the given content into words and will pass each word back
        +     * through the stream. This method showcases server-side streaming RPCs.
        +     * 
        + */ + default void expand( + com.google.showcase.v1beta1.ExpandRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getExpandMethod(), responseObserver); + } + + /** + * + * + *
        +     * This method will collect the words given to it. When the stream is closed
        +     * by the client, this method will return the a concatenation of the strings
        +     * passed to it. This method showcases client-side streaming RPCs.
        +     * 
        + */ + default io.grpc.stub.StreamObserver collect( + io.grpc.stub.StreamObserver responseObserver) { + return io.grpc.stub.ServerCalls.asyncUnimplementedStreamingCall( + getCollectMethod(), responseObserver); + } + + /** + * + * + *
        +     * This method, upon receiving a request on the stream, will pass the same
        +     * content back on the stream. This method showcases bidirectional
        +     * streaming RPCs.
        +     * 
        + */ + default io.grpc.stub.StreamObserver chat( + io.grpc.stub.StreamObserver responseObserver) { + return io.grpc.stub.ServerCalls.asyncUnimplementedStreamingCall( + getChatMethod(), responseObserver); + } + + /** + * + * + *
        +     * This is similar to the Expand method but instead of returning a stream of
        +     * expanded words, this method returns a paged list of expanded words.
        +     * 
        + */ + default void pagedExpand( + com.google.showcase.v1beta1.PagedExpandRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getPagedExpandMethod(), responseObserver); + } + + /** + * + * + *
        +     * This is similar to the PagedExpand except that it uses
        +     * max_results instead of page_size, as some legacy APIs still
        +     * do. New APIs should NOT use this pattern.
        +     * 
        + */ + default void pagedExpandLegacy( + com.google.showcase.v1beta1.PagedExpandLegacyRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getPagedExpandLegacyMethod(), responseObserver); + } + + /** + * + * + *
        +     * This method returns a map containing lists of words that appear in the input, keyed by their
        +     * initial character. The only words returned are the ones included in the current page,
        +     * as determined by page_token and page_size, which both refer to the word indices in the
        +     * input. This paging result consisting of a map of lists is a pattern used by some legacy
        +     * APIs. New APIs should NOT use this pattern.
        +     * 
        + */ + default void pagedExpandLegacyMapped( + com.google.showcase.v1beta1.PagedExpandRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getPagedExpandLegacyMappedMethod(), responseObserver); + } + + /** + * + * + *
        +     * This method will wait for the requested amount of time and then return.
        +     * This method showcases how a client handles a request timeout.
        +     * 
        + */ + default void wait( + com.google.showcase.v1beta1.WaitRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getWaitMethod(), responseObserver); + } + + /** + * + * + *
        +     * This method will block (wait) for the requested amount of time
        +     * and then return the response or error.
        +     * This method showcases how a client handles delays or retries.
        +     * 
        + */ + default void block( + com.google.showcase.v1beta1.BlockRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getBlockMethod(), responseObserver); + } + } + + /** + * Base class for the server implementation of the service Echo. + * + *
        +   * This service is used showcase the four main types of rpcs - unary, server
        +   * side streaming, client side streaming, and bidirectional streaming. This
        +   * service also exposes methods that explicitly implement server delay, and
        +   * paginated calls. Set the 'showcase-trailer' metadata key on any method
        +   * to have the values echoed in the response trailers. Set the
        +   * 'x-goog-request-params' metadata key on any method to have the values
        +   * echoed in the response headers.
        +   * 
        + */ + public abstract static class EchoImplBase implements io.grpc.BindableService, AsyncService { + + @java.lang.Override + public final io.grpc.ServerServiceDefinition bindService() { + return EchoGrpc.bindService(this); + } + } + + /** + * A stub to allow clients to do asynchronous rpc calls to service Echo. + * + *
        +   * This service is used showcase the four main types of rpcs - unary, server
        +   * side streaming, client side streaming, and bidirectional streaming. This
        +   * service also exposes methods that explicitly implement server delay, and
        +   * paginated calls. Set the 'showcase-trailer' metadata key on any method
        +   * to have the values echoed in the response trailers. Set the
        +   * 'x-goog-request-params' metadata key on any method to have the values
        +   * echoed in the response headers.
        +   * 
        + */ + public static final class EchoStub extends io.grpc.stub.AbstractAsyncStub { + private EchoStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected EchoStub build(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new EchoStub(channel, callOptions); + } + + /** + * + * + *
        +     * This method simply echoes the request. This method showcases unary RPCs.
        +     * 
        + */ + public void echo( + com.google.showcase.v1beta1.EchoRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getEchoMethod(), getCallOptions()), request, responseObserver); + } + + /** + * + * + *
        +     * This method returns error details in a repeated "google.protobuf.Any"
        +     * field. This method showcases handling errors thus encoded, particularly
        +     * over REST transport. Note that GAPICs only allow the type
        +     * "google.protobuf.Any" for field paths ending in "error.details", and, at
        +     * run-time, the actual types for these fields must be one of the types in
        +     * google/rpc/error_details.proto.
        +     * 
        + */ + public void echoErrorDetails( + com.google.showcase.v1beta1.EchoErrorDetailsRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getEchoErrorDetailsMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
        +     * This method always fails with a gRPC "Aborted" error status that contains
        +     * multiple error details.  These include one instance of each of the standard
        +     * ones in error_details.proto
        +     * (https://github.com/googleapis/googleapis/blob/master/google/rpc/error_details.proto)
        +     * plus a custom, Showcase-defined PoetryError. The intent of this RPC is to
        +     * verify that GAPICs can process these various error details and surface them
        +     * to the user in an idiomatic form.
        +     * 
        + */ + public void failEchoWithDetails( + com.google.showcase.v1beta1.FailEchoWithDetailsRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getFailEchoWithDetailsMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
        +     * This method splits the given content into words and will pass each word back
        +     * through the stream. This method showcases server-side streaming RPCs.
        +     * 
        + */ + public void expand( + com.google.showcase.v1beta1.ExpandRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncServerStreamingCall( + getChannel().newCall(getExpandMethod(), getCallOptions()), request, responseObserver); + } + + /** + * + * + *
        +     * This method will collect the words given to it. When the stream is closed
        +     * by the client, this method will return the a concatenation of the strings
        +     * passed to it. This method showcases client-side streaming RPCs.
        +     * 
        + */ + public io.grpc.stub.StreamObserver collect( + io.grpc.stub.StreamObserver responseObserver) { + return io.grpc.stub.ClientCalls.asyncClientStreamingCall( + getChannel().newCall(getCollectMethod(), getCallOptions()), responseObserver); + } + + /** + * + * + *
        +     * This method, upon receiving a request on the stream, will pass the same
        +     * content back on the stream. This method showcases bidirectional
        +     * streaming RPCs.
        +     * 
        + */ + public io.grpc.stub.StreamObserver chat( + io.grpc.stub.StreamObserver responseObserver) { + return io.grpc.stub.ClientCalls.asyncBidiStreamingCall( + getChannel().newCall(getChatMethod(), getCallOptions()), responseObserver); + } + + /** + * + * + *
        +     * This is similar to the Expand method but instead of returning a stream of
        +     * expanded words, this method returns a paged list of expanded words.
        +     * 
        + */ + public void pagedExpand( + com.google.showcase.v1beta1.PagedExpandRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getPagedExpandMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
        +     * This is similar to the PagedExpand except that it uses
        +     * max_results instead of page_size, as some legacy APIs still
        +     * do. New APIs should NOT use this pattern.
        +     * 
        + */ + public void pagedExpandLegacy( + com.google.showcase.v1beta1.PagedExpandLegacyRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getPagedExpandLegacyMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
        +     * This method returns a map containing lists of words that appear in the input, keyed by their
        +     * initial character. The only words returned are the ones included in the current page,
        +     * as determined by page_token and page_size, which both refer to the word indices in the
        +     * input. This paging result consisting of a map of lists is a pattern used by some legacy
        +     * APIs. New APIs should NOT use this pattern.
        +     * 
        + */ + public void pagedExpandLegacyMapped( + com.google.showcase.v1beta1.PagedExpandRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getPagedExpandLegacyMappedMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
        +     * This method will wait for the requested amount of time and then return.
        +     * This method showcases how a client handles a request timeout.
        +     * 
        + */ + public void wait( + com.google.showcase.v1beta1.WaitRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getWaitMethod(), getCallOptions()), request, responseObserver); + } + + /** + * + * + *
        +     * This method will block (wait) for the requested amount of time
        +     * and then return the response or error.
        +     * This method showcases how a client handles delays or retries.
        +     * 
        + */ + public void block( + com.google.showcase.v1beta1.BlockRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getBlockMethod(), getCallOptions()), request, responseObserver); + } + } + + /** + * A stub to allow clients to do synchronous rpc calls to service Echo. + * + *
        +   * This service is used showcase the four main types of rpcs - unary, server
        +   * side streaming, client side streaming, and bidirectional streaming. This
        +   * service also exposes methods that explicitly implement server delay, and
        +   * paginated calls. Set the 'showcase-trailer' metadata key on any method
        +   * to have the values echoed in the response trailers. Set the
        +   * 'x-goog-request-params' metadata key on any method to have the values
        +   * echoed in the response headers.
        +   * 
        + */ + public static final class EchoBlockingV2Stub + extends io.grpc.stub.AbstractBlockingStub { + private EchoBlockingV2Stub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected EchoBlockingV2Stub build(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new EchoBlockingV2Stub(channel, callOptions); + } + + /** + * + * + *
        +     * This method simply echoes the request. This method showcases unary RPCs.
        +     * 
        + */ + public com.google.showcase.v1beta1.EchoResponse echo( + com.google.showcase.v1beta1.EchoRequest request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getEchoMethod(), getCallOptions(), request); + } + + /** + * + * + *
        +     * This method returns error details in a repeated "google.protobuf.Any"
        +     * field. This method showcases handling errors thus encoded, particularly
        +     * over REST transport. Note that GAPICs only allow the type
        +     * "google.protobuf.Any" for field paths ending in "error.details", and, at
        +     * run-time, the actual types for these fields must be one of the types in
        +     * google/rpc/error_details.proto.
        +     * 
        + */ + public com.google.showcase.v1beta1.EchoErrorDetailsResponse echoErrorDetails( + com.google.showcase.v1beta1.EchoErrorDetailsRequest request) + throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getEchoErrorDetailsMethod(), getCallOptions(), request); + } + + /** + * + * + *
        +     * This method always fails with a gRPC "Aborted" error status that contains
        +     * multiple error details.  These include one instance of each of the standard
        +     * ones in error_details.proto
        +     * (https://github.com/googleapis/googleapis/blob/master/google/rpc/error_details.proto)
        +     * plus a custom, Showcase-defined PoetryError. The intent of this RPC is to
        +     * verify that GAPICs can process these various error details and surface them
        +     * to the user in an idiomatic form.
        +     * 
        + */ + public com.google.showcase.v1beta1.FailEchoWithDetailsResponse failEchoWithDetails( + com.google.showcase.v1beta1.FailEchoWithDetailsRequest request) + throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getFailEchoWithDetailsMethod(), getCallOptions(), request); + } + + /** + * + * + *
        +     * This method splits the given content into words and will pass each word back
        +     * through the stream. This method showcases server-side streaming RPCs.
        +     * 
        + */ + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/10918") + public io.grpc.stub.BlockingClientCall expand( + com.google.showcase.v1beta1.ExpandRequest request) { + return io.grpc.stub.ClientCalls.blockingV2ServerStreamingCall( + getChannel(), getExpandMethod(), getCallOptions(), request); + } + + /** + * + * + *
        +     * This method will collect the words given to it. When the stream is closed
        +     * by the client, this method will return the a concatenation of the strings
        +     * passed to it. This method showcases client-side streaming RPCs.
        +     * 
        + */ + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/10918") + public io.grpc.stub.BlockingClientCall< + com.google.showcase.v1beta1.EchoRequest, com.google.showcase.v1beta1.EchoResponse> + collect() { + return io.grpc.stub.ClientCalls.blockingClientStreamingCall( + getChannel(), getCollectMethod(), getCallOptions()); + } + + /** + * + * + *
        +     * This method, upon receiving a request on the stream, will pass the same
        +     * content back on the stream. This method showcases bidirectional
        +     * streaming RPCs.
        +     * 
        + */ + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/10918") + public io.grpc.stub.BlockingClientCall< + com.google.showcase.v1beta1.EchoRequest, com.google.showcase.v1beta1.EchoResponse> + chat() { + return io.grpc.stub.ClientCalls.blockingBidiStreamingCall( + getChannel(), getChatMethod(), getCallOptions()); + } + + /** + * + * + *
        +     * This is similar to the Expand method but instead of returning a stream of
        +     * expanded words, this method returns a paged list of expanded words.
        +     * 
        + */ + public com.google.showcase.v1beta1.PagedExpandResponse pagedExpand( + com.google.showcase.v1beta1.PagedExpandRequest request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getPagedExpandMethod(), getCallOptions(), request); + } + + /** + * + * + *
        +     * This is similar to the PagedExpand except that it uses
        +     * max_results instead of page_size, as some legacy APIs still
        +     * do. New APIs should NOT use this pattern.
        +     * 
        + */ + public com.google.showcase.v1beta1.PagedExpandResponse pagedExpandLegacy( + com.google.showcase.v1beta1.PagedExpandLegacyRequest request) + throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getPagedExpandLegacyMethod(), getCallOptions(), request); + } + + /** + * + * + *
        +     * This method returns a map containing lists of words that appear in the input, keyed by their
        +     * initial character. The only words returned are the ones included in the current page,
        +     * as determined by page_token and page_size, which both refer to the word indices in the
        +     * input. This paging result consisting of a map of lists is a pattern used by some legacy
        +     * APIs. New APIs should NOT use this pattern.
        +     * 
        + */ + public com.google.showcase.v1beta1.PagedExpandLegacyMappedResponse pagedExpandLegacyMapped( + com.google.showcase.v1beta1.PagedExpandRequest request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getPagedExpandLegacyMappedMethod(), getCallOptions(), request); + } + + /** + * + * + *
        +     * This method will wait for the requested amount of time and then return.
        +     * This method showcases how a client handles a request timeout.
        +     * 
        + */ + public com.google.longrunning.Operation wait(com.google.showcase.v1beta1.WaitRequest request) + throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getWaitMethod(), getCallOptions(), request); + } + + /** + * + * + *
        +     * This method will block (wait) for the requested amount of time
        +     * and then return the response or error.
        +     * This method showcases how a client handles delays or retries.
        +     * 
        + */ + public com.google.showcase.v1beta1.BlockResponse block( + com.google.showcase.v1beta1.BlockRequest request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getBlockMethod(), getCallOptions(), request); + } + } + + /** + * A stub to allow clients to do limited synchronous rpc calls to service Echo. + * + *
        +   * This service is used showcase the four main types of rpcs - unary, server
        +   * side streaming, client side streaming, and bidirectional streaming. This
        +   * service also exposes methods that explicitly implement server delay, and
        +   * paginated calls. Set the 'showcase-trailer' metadata key on any method
        +   * to have the values echoed in the response trailers. Set the
        +   * 'x-goog-request-params' metadata key on any method to have the values
        +   * echoed in the response headers.
        +   * 
        + */ + public static final class EchoBlockingStub + extends io.grpc.stub.AbstractBlockingStub { + private EchoBlockingStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected EchoBlockingStub build(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new EchoBlockingStub(channel, callOptions); + } + + /** + * + * + *
        +     * This method simply echoes the request. This method showcases unary RPCs.
        +     * 
        + */ + public com.google.showcase.v1beta1.EchoResponse echo( + com.google.showcase.v1beta1.EchoRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getEchoMethod(), getCallOptions(), request); + } + + /** + * + * + *
        +     * This method returns error details in a repeated "google.protobuf.Any"
        +     * field. This method showcases handling errors thus encoded, particularly
        +     * over REST transport. Note that GAPICs only allow the type
        +     * "google.protobuf.Any" for field paths ending in "error.details", and, at
        +     * run-time, the actual types for these fields must be one of the types in
        +     * google/rpc/error_details.proto.
        +     * 
        + */ + public com.google.showcase.v1beta1.EchoErrorDetailsResponse echoErrorDetails( + com.google.showcase.v1beta1.EchoErrorDetailsRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getEchoErrorDetailsMethod(), getCallOptions(), request); + } + + /** + * + * + *
        +     * This method always fails with a gRPC "Aborted" error status that contains
        +     * multiple error details.  These include one instance of each of the standard
        +     * ones in error_details.proto
        +     * (https://github.com/googleapis/googleapis/blob/master/google/rpc/error_details.proto)
        +     * plus a custom, Showcase-defined PoetryError. The intent of this RPC is to
        +     * verify that GAPICs can process these various error details and surface them
        +     * to the user in an idiomatic form.
        +     * 
        + */ + public com.google.showcase.v1beta1.FailEchoWithDetailsResponse failEchoWithDetails( + com.google.showcase.v1beta1.FailEchoWithDetailsRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getFailEchoWithDetailsMethod(), getCallOptions(), request); + } + + /** + * + * + *
        +     * This method splits the given content into words and will pass each word back
        +     * through the stream. This method showcases server-side streaming RPCs.
        +     * 
        + */ + public java.util.Iterator expand( + com.google.showcase.v1beta1.ExpandRequest request) { + return io.grpc.stub.ClientCalls.blockingServerStreamingCall( + getChannel(), getExpandMethod(), getCallOptions(), request); + } + + /** + * + * + *
        +     * This is similar to the Expand method but instead of returning a stream of
        +     * expanded words, this method returns a paged list of expanded words.
        +     * 
        + */ + public com.google.showcase.v1beta1.PagedExpandResponse pagedExpand( + com.google.showcase.v1beta1.PagedExpandRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getPagedExpandMethod(), getCallOptions(), request); + } + + /** + * + * + *
        +     * This is similar to the PagedExpand except that it uses
        +     * max_results instead of page_size, as some legacy APIs still
        +     * do. New APIs should NOT use this pattern.
        +     * 
        + */ + public com.google.showcase.v1beta1.PagedExpandResponse pagedExpandLegacy( + com.google.showcase.v1beta1.PagedExpandLegacyRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getPagedExpandLegacyMethod(), getCallOptions(), request); + } + + /** + * + * + *
        +     * This method returns a map containing lists of words that appear in the input, keyed by their
        +     * initial character. The only words returned are the ones included in the current page,
        +     * as determined by page_token and page_size, which both refer to the word indices in the
        +     * input. This paging result consisting of a map of lists is a pattern used by some legacy
        +     * APIs. New APIs should NOT use this pattern.
        +     * 
        + */ + public com.google.showcase.v1beta1.PagedExpandLegacyMappedResponse pagedExpandLegacyMapped( + com.google.showcase.v1beta1.PagedExpandRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getPagedExpandLegacyMappedMethod(), getCallOptions(), request); + } + + /** + * + * + *
        +     * This method will wait for the requested amount of time and then return.
        +     * This method showcases how a client handles a request timeout.
        +     * 
        + */ + public com.google.longrunning.Operation wait(com.google.showcase.v1beta1.WaitRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getWaitMethod(), getCallOptions(), request); + } + + /** + * + * + *
        +     * This method will block (wait) for the requested amount of time
        +     * and then return the response or error.
        +     * This method showcases how a client handles delays or retries.
        +     * 
        + */ + public com.google.showcase.v1beta1.BlockResponse block( + com.google.showcase.v1beta1.BlockRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getBlockMethod(), getCallOptions(), request); + } + } + + /** + * A stub to allow clients to do ListenableFuture-style rpc calls to service Echo. + * + *
        +   * This service is used showcase the four main types of rpcs - unary, server
        +   * side streaming, client side streaming, and bidirectional streaming. This
        +   * service also exposes methods that explicitly implement server delay, and
        +   * paginated calls. Set the 'showcase-trailer' metadata key on any method
        +   * to have the values echoed in the response trailers. Set the
        +   * 'x-goog-request-params' metadata key on any method to have the values
        +   * echoed in the response headers.
        +   * 
        + */ + public static final class EchoFutureStub extends io.grpc.stub.AbstractFutureStub { + private EchoFutureStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected EchoFutureStub build(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new EchoFutureStub(channel, callOptions); + } + + /** + * + * + *
        +     * This method simply echoes the request. This method showcases unary RPCs.
        +     * 
        + */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.showcase.v1beta1.EchoResponse> + echo(com.google.showcase.v1beta1.EchoRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getEchoMethod(), getCallOptions()), request); + } + + /** + * + * + *
        +     * This method returns error details in a repeated "google.protobuf.Any"
        +     * field. This method showcases handling errors thus encoded, particularly
        +     * over REST transport. Note that GAPICs only allow the type
        +     * "google.protobuf.Any" for field paths ending in "error.details", and, at
        +     * run-time, the actual types for these fields must be one of the types in
        +     * google/rpc/error_details.proto.
        +     * 
        + */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.showcase.v1beta1.EchoErrorDetailsResponse> + echoErrorDetails(com.google.showcase.v1beta1.EchoErrorDetailsRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getEchoErrorDetailsMethod(), getCallOptions()), request); + } + + /** + * + * + *
        +     * This method always fails with a gRPC "Aborted" error status that contains
        +     * multiple error details.  These include one instance of each of the standard
        +     * ones in error_details.proto
        +     * (https://github.com/googleapis/googleapis/blob/master/google/rpc/error_details.proto)
        +     * plus a custom, Showcase-defined PoetryError. The intent of this RPC is to
        +     * verify that GAPICs can process these various error details and surface them
        +     * to the user in an idiomatic form.
        +     * 
        + */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.showcase.v1beta1.FailEchoWithDetailsResponse> + failEchoWithDetails(com.google.showcase.v1beta1.FailEchoWithDetailsRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getFailEchoWithDetailsMethod(), getCallOptions()), request); + } + + /** + * + * + *
        +     * This is similar to the Expand method but instead of returning a stream of
        +     * expanded words, this method returns a paged list of expanded words.
        +     * 
        + */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.showcase.v1beta1.PagedExpandResponse> + pagedExpand(com.google.showcase.v1beta1.PagedExpandRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getPagedExpandMethod(), getCallOptions()), request); + } + + /** + * + * + *
        +     * This is similar to the PagedExpand except that it uses
        +     * max_results instead of page_size, as some legacy APIs still
        +     * do. New APIs should NOT use this pattern.
        +     * 
        + */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.showcase.v1beta1.PagedExpandResponse> + pagedExpandLegacy(com.google.showcase.v1beta1.PagedExpandLegacyRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getPagedExpandLegacyMethod(), getCallOptions()), request); + } + + /** + * + * + *
        +     * This method returns a map containing lists of words that appear in the input, keyed by their
        +     * initial character. The only words returned are the ones included in the current page,
        +     * as determined by page_token and page_size, which both refer to the word indices in the
        +     * input. This paging result consisting of a map of lists is a pattern used by some legacy
        +     * APIs. New APIs should NOT use this pattern.
        +     * 
        + */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.showcase.v1beta1.PagedExpandLegacyMappedResponse> + pagedExpandLegacyMapped(com.google.showcase.v1beta1.PagedExpandRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getPagedExpandLegacyMappedMethod(), getCallOptions()), request); + } + + /** + * + * + *
        +     * This method will wait for the requested amount of time and then return.
        +     * This method showcases how a client handles a request timeout.
        +     * 
        + */ + public com.google.common.util.concurrent.ListenableFuture + wait(com.google.showcase.v1beta1.WaitRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getWaitMethod(), getCallOptions()), request); + } + + /** + * + * + *
        +     * This method will block (wait) for the requested amount of time
        +     * and then return the response or error.
        +     * This method showcases how a client handles delays or retries.
        +     * 
        + */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.showcase.v1beta1.BlockResponse> + block(com.google.showcase.v1beta1.BlockRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getBlockMethod(), getCallOptions()), request); + } + } + + private static final int METHODID_ECHO = 0; + private static final int METHODID_ECHO_ERROR_DETAILS = 1; + private static final int METHODID_FAIL_ECHO_WITH_DETAILS = 2; + private static final int METHODID_EXPAND = 3; + private static final int METHODID_PAGED_EXPAND = 4; + private static final int METHODID_PAGED_EXPAND_LEGACY = 5; + private static final int METHODID_PAGED_EXPAND_LEGACY_MAPPED = 6; + private static final int METHODID_WAIT = 7; + private static final int METHODID_BLOCK = 8; + private static final int METHODID_COLLECT = 9; + private static final int METHODID_CHAT = 10; + + 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_ECHO: + serviceImpl.echo( + (com.google.showcase.v1beta1.EchoRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_ECHO_ERROR_DETAILS: + serviceImpl.echoErrorDetails( + (com.google.showcase.v1beta1.EchoErrorDetailsRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_FAIL_ECHO_WITH_DETAILS: + serviceImpl.failEchoWithDetails( + (com.google.showcase.v1beta1.FailEchoWithDetailsRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_EXPAND: + serviceImpl.expand( + (com.google.showcase.v1beta1.ExpandRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_PAGED_EXPAND: + serviceImpl.pagedExpand( + (com.google.showcase.v1beta1.PagedExpandRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_PAGED_EXPAND_LEGACY: + serviceImpl.pagedExpandLegacy( + (com.google.showcase.v1beta1.PagedExpandLegacyRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_PAGED_EXPAND_LEGACY_MAPPED: + serviceImpl.pagedExpandLegacyMapped( + (com.google.showcase.v1beta1.PagedExpandRequest) request, + (io.grpc.stub.StreamObserver< + com.google.showcase.v1beta1.PagedExpandLegacyMappedResponse>) + responseObserver); + break; + case METHODID_WAIT: + serviceImpl.wait( + (com.google.showcase.v1beta1.WaitRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_BLOCK: + serviceImpl.block( + (com.google.showcase.v1beta1.BlockRequest) 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_COLLECT: + return (io.grpc.stub.StreamObserver) + serviceImpl.collect( + (io.grpc.stub.StreamObserver) + responseObserver); + case METHODID_CHAT: + return (io.grpc.stub.StreamObserver) + serviceImpl.chat( + (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( + getEchoMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.showcase.v1beta1.EchoRequest, + com.google.showcase.v1beta1.EchoResponse>(service, METHODID_ECHO))) + .addMethod( + getEchoErrorDetailsMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.showcase.v1beta1.EchoErrorDetailsRequest, + com.google.showcase.v1beta1.EchoErrorDetailsResponse>( + service, METHODID_ECHO_ERROR_DETAILS))) + .addMethod( + getFailEchoWithDetailsMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.showcase.v1beta1.FailEchoWithDetailsRequest, + com.google.showcase.v1beta1.FailEchoWithDetailsResponse>( + service, METHODID_FAIL_ECHO_WITH_DETAILS))) + .addMethod( + getExpandMethod(), + io.grpc.stub.ServerCalls.asyncServerStreamingCall( + new MethodHandlers< + com.google.showcase.v1beta1.ExpandRequest, + com.google.showcase.v1beta1.EchoResponse>(service, METHODID_EXPAND))) + .addMethod( + getCollectMethod(), + io.grpc.stub.ServerCalls.asyncClientStreamingCall( + new MethodHandlers< + com.google.showcase.v1beta1.EchoRequest, + com.google.showcase.v1beta1.EchoResponse>(service, METHODID_COLLECT))) + .addMethod( + getChatMethod(), + io.grpc.stub.ServerCalls.asyncBidiStreamingCall( + new MethodHandlers< + com.google.showcase.v1beta1.EchoRequest, + com.google.showcase.v1beta1.EchoResponse>(service, METHODID_CHAT))) + .addMethod( + getPagedExpandMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.showcase.v1beta1.PagedExpandRequest, + com.google.showcase.v1beta1.PagedExpandResponse>( + service, METHODID_PAGED_EXPAND))) + .addMethod( + getPagedExpandLegacyMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.showcase.v1beta1.PagedExpandLegacyRequest, + com.google.showcase.v1beta1.PagedExpandResponse>( + service, METHODID_PAGED_EXPAND_LEGACY))) + .addMethod( + getPagedExpandLegacyMappedMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.showcase.v1beta1.PagedExpandRequest, + com.google.showcase.v1beta1.PagedExpandLegacyMappedResponse>( + service, METHODID_PAGED_EXPAND_LEGACY_MAPPED))) + .addMethod( + getWaitMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.showcase.v1beta1.WaitRequest, com.google.longrunning.Operation>( + service, METHODID_WAIT))) + .addMethod( + getBlockMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.showcase.v1beta1.BlockRequest, + com.google.showcase.v1beta1.BlockResponse>(service, METHODID_BLOCK))) + .build(); + } + + private abstract static class EchoBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoFileDescriptorSupplier, + io.grpc.protobuf.ProtoServiceDescriptorSupplier { + EchoBaseDescriptorSupplier() {} + + @java.lang.Override + public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() { + return com.google.showcase.v1beta1.EchoOuterClass.getDescriptor(); + } + + @java.lang.Override + public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() { + return getFileDescriptor().findServiceByName("Echo"); + } + } + + private static final class EchoFileDescriptorSupplier extends EchoBaseDescriptorSupplier { + EchoFileDescriptorSupplier() {} + } + + private static final class EchoMethodDescriptorSupplier extends EchoBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoMethodDescriptorSupplier { + private final java.lang.String methodName; + + EchoMethodDescriptorSupplier(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 (EchoGrpc.class) { + result = serviceDescriptor; + if (result == null) { + serviceDescriptor = + result = + io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME) + .setSchemaDescriptor(new EchoFileDescriptorSupplier()) + .addMethod(getEchoMethod()) + .addMethod(getEchoErrorDetailsMethod()) + .addMethod(getFailEchoWithDetailsMethod()) + .addMethod(getExpandMethod()) + .addMethod(getCollectMethod()) + .addMethod(getChatMethod()) + .addMethod(getPagedExpandMethod()) + .addMethod(getPagedExpandLegacyMethod()) + .addMethod(getPagedExpandLegacyMappedMethod()) + .addMethod(getWaitMethod()) + .addMethod(getBlockMethod()) + .build(); + } + } + } + return result; + } +} diff --git a/java-showcase-3.21.0/grpc-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/IdentityGrpc.java b/java-showcase-3.21.0/grpc-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/IdentityGrpc.java new file mode 100644 index 0000000000..bc0f6987e3 --- /dev/null +++ b/java-showcase-3.21.0/grpc-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/IdentityGrpc.java @@ -0,0 +1,886 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.showcase.v1beta1; + +import static io.grpc.MethodDescriptor.generateFullMethodName; + +/** + * + * + *
        + * A simple identity service.
        + * 
        + */ +@io.grpc.stub.annotations.GrpcGenerated +public final class IdentityGrpc { + + private IdentityGrpc() {} + + public static final java.lang.String SERVICE_NAME = "google.showcase.v1beta1.Identity"; + + // Static method descriptors that strictly reflect the proto. + private static volatile io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.CreateUserRequest, com.google.showcase.v1beta1.User> + getCreateUserMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "CreateUser", + requestType = com.google.showcase.v1beta1.CreateUserRequest.class, + responseType = com.google.showcase.v1beta1.User.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.CreateUserRequest, com.google.showcase.v1beta1.User> + getCreateUserMethod() { + io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.CreateUserRequest, com.google.showcase.v1beta1.User> + getCreateUserMethod; + if ((getCreateUserMethod = IdentityGrpc.getCreateUserMethod) == null) { + synchronized (IdentityGrpc.class) { + if ((getCreateUserMethod = IdentityGrpc.getCreateUserMethod) == null) { + IdentityGrpc.getCreateUserMethod = + getCreateUserMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "CreateUser")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.CreateUserRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.User.getDefaultInstance())) + .setSchemaDescriptor(new IdentityMethodDescriptorSupplier("CreateUser")) + .build(); + } + } + } + return getCreateUserMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.GetUserRequest, com.google.showcase.v1beta1.User> + getGetUserMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "GetUser", + requestType = com.google.showcase.v1beta1.GetUserRequest.class, + responseType = com.google.showcase.v1beta1.User.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.GetUserRequest, com.google.showcase.v1beta1.User> + getGetUserMethod() { + io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.GetUserRequest, com.google.showcase.v1beta1.User> + getGetUserMethod; + if ((getGetUserMethod = IdentityGrpc.getGetUserMethod) == null) { + synchronized (IdentityGrpc.class) { + if ((getGetUserMethod = IdentityGrpc.getGetUserMethod) == null) { + IdentityGrpc.getGetUserMethod = + getGetUserMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetUser")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.GetUserRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.User.getDefaultInstance())) + .setSchemaDescriptor(new IdentityMethodDescriptorSupplier("GetUser")) + .build(); + } + } + } + return getGetUserMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.UpdateUserRequest, com.google.showcase.v1beta1.User> + getUpdateUserMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "UpdateUser", + requestType = com.google.showcase.v1beta1.UpdateUserRequest.class, + responseType = com.google.showcase.v1beta1.User.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.UpdateUserRequest, com.google.showcase.v1beta1.User> + getUpdateUserMethod() { + io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.UpdateUserRequest, com.google.showcase.v1beta1.User> + getUpdateUserMethod; + if ((getUpdateUserMethod = IdentityGrpc.getUpdateUserMethod) == null) { + synchronized (IdentityGrpc.class) { + if ((getUpdateUserMethod = IdentityGrpc.getUpdateUserMethod) == null) { + IdentityGrpc.getUpdateUserMethod = + getUpdateUserMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "UpdateUser")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.UpdateUserRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.User.getDefaultInstance())) + .setSchemaDescriptor(new IdentityMethodDescriptorSupplier("UpdateUser")) + .build(); + } + } + } + return getUpdateUserMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.DeleteUserRequest, com.google.protobuf.Empty> + getDeleteUserMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "DeleteUser", + requestType = com.google.showcase.v1beta1.DeleteUserRequest.class, + responseType = com.google.protobuf.Empty.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.DeleteUserRequest, com.google.protobuf.Empty> + getDeleteUserMethod() { + io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.DeleteUserRequest, com.google.protobuf.Empty> + getDeleteUserMethod; + if ((getDeleteUserMethod = IdentityGrpc.getDeleteUserMethod) == null) { + synchronized (IdentityGrpc.class) { + if ((getDeleteUserMethod = IdentityGrpc.getDeleteUserMethod) == null) { + IdentityGrpc.getDeleteUserMethod = + getDeleteUserMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "DeleteUser")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.DeleteUserRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.protobuf.Empty.getDefaultInstance())) + .setSchemaDescriptor(new IdentityMethodDescriptorSupplier("DeleteUser")) + .build(); + } + } + } + return getDeleteUserMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.ListUsersRequest, + com.google.showcase.v1beta1.ListUsersResponse> + getListUsersMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "ListUsers", + requestType = com.google.showcase.v1beta1.ListUsersRequest.class, + responseType = com.google.showcase.v1beta1.ListUsersResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.ListUsersRequest, + com.google.showcase.v1beta1.ListUsersResponse> + getListUsersMethod() { + io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.ListUsersRequest, + com.google.showcase.v1beta1.ListUsersResponse> + getListUsersMethod; + if ((getListUsersMethod = IdentityGrpc.getListUsersMethod) == null) { + synchronized (IdentityGrpc.class) { + if ((getListUsersMethod = IdentityGrpc.getListUsersMethod) == null) { + IdentityGrpc.getListUsersMethod = + getListUsersMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "ListUsers")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.ListUsersRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.ListUsersResponse.getDefaultInstance())) + .setSchemaDescriptor(new IdentityMethodDescriptorSupplier("ListUsers")) + .build(); + } + } + } + return getListUsersMethod; + } + + /** Creates a new async stub that supports all call types for the service */ + public static IdentityStub newStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public IdentityStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new IdentityStub(channel, callOptions); + } + }; + return IdentityStub.newStub(factory, channel); + } + + /** Creates a new blocking-style stub that supports all types of calls on the service */ + public static IdentityBlockingV2Stub newBlockingV2Stub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public IdentityBlockingV2Stub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new IdentityBlockingV2Stub(channel, callOptions); + } + }; + return IdentityBlockingV2Stub.newStub(factory, channel); + } + + /** + * Creates a new blocking-style stub that supports unary and streaming output calls on the service + */ + public static IdentityBlockingStub newBlockingStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public IdentityBlockingStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new IdentityBlockingStub(channel, callOptions); + } + }; + return IdentityBlockingStub.newStub(factory, channel); + } + + /** Creates a new ListenableFuture-style stub that supports unary calls on the service */ + public static IdentityFutureStub newFutureStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public IdentityFutureStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new IdentityFutureStub(channel, callOptions); + } + }; + return IdentityFutureStub.newStub(factory, channel); + } + + /** + * + * + *
        +   * A simple identity service.
        +   * 
        + */ + public interface AsyncService { + + /** + * + * + *
        +     * Creates a user.
        +     * 
        + */ + default void createUser( + com.google.showcase.v1beta1.CreateUserRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getCreateUserMethod(), responseObserver); + } + + /** + * + * + *
        +     * Retrieves the User with the given uri.
        +     * 
        + */ + default void getUser( + com.google.showcase.v1beta1.GetUserRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getGetUserMethod(), responseObserver); + } + + /** + * + * + *
        +     * Updates a user.
        +     * 
        + */ + default void updateUser( + com.google.showcase.v1beta1.UpdateUserRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getUpdateUserMethod(), responseObserver); + } + + /** + * + * + *
        +     * Deletes a user, their profile, and all of their authored messages.
        +     * 
        + */ + default void deleteUser( + com.google.showcase.v1beta1.DeleteUserRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getDeleteUserMethod(), responseObserver); + } + + /** + * + * + *
        +     * Lists all users.
        +     * 
        + */ + default void listUsers( + com.google.showcase.v1beta1.ListUsersRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getListUsersMethod(), responseObserver); + } + } + + /** + * Base class for the server implementation of the service Identity. + * + *
        +   * A simple identity service.
        +   * 
        + */ + public abstract static class IdentityImplBase implements io.grpc.BindableService, AsyncService { + + @java.lang.Override + public final io.grpc.ServerServiceDefinition bindService() { + return IdentityGrpc.bindService(this); + } + } + + /** + * A stub to allow clients to do asynchronous rpc calls to service Identity. + * + *
        +   * A simple identity service.
        +   * 
        + */ + public static final class IdentityStub extends io.grpc.stub.AbstractAsyncStub { + private IdentityStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected IdentityStub build(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new IdentityStub(channel, callOptions); + } + + /** + * + * + *
        +     * Creates a user.
        +     * 
        + */ + public void createUser( + com.google.showcase.v1beta1.CreateUserRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getCreateUserMethod(), getCallOptions()), request, responseObserver); + } + + /** + * + * + *
        +     * Retrieves the User with the given uri.
        +     * 
        + */ + public void getUser( + com.google.showcase.v1beta1.GetUserRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getGetUserMethod(), getCallOptions()), request, responseObserver); + } + + /** + * + * + *
        +     * Updates a user.
        +     * 
        + */ + public void updateUser( + com.google.showcase.v1beta1.UpdateUserRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getUpdateUserMethod(), getCallOptions()), request, responseObserver); + } + + /** + * + * + *
        +     * Deletes a user, their profile, and all of their authored messages.
        +     * 
        + */ + public void deleteUser( + com.google.showcase.v1beta1.DeleteUserRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getDeleteUserMethod(), getCallOptions()), request, responseObserver); + } + + /** + * + * + *
        +     * Lists all users.
        +     * 
        + */ + public void listUsers( + com.google.showcase.v1beta1.ListUsersRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getListUsersMethod(), getCallOptions()), request, responseObserver); + } + } + + /** + * A stub to allow clients to do synchronous rpc calls to service Identity. + * + *
        +   * A simple identity service.
        +   * 
        + */ + public static final class IdentityBlockingV2Stub + extends io.grpc.stub.AbstractBlockingStub { + private IdentityBlockingV2Stub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected IdentityBlockingV2Stub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new IdentityBlockingV2Stub(channel, callOptions); + } + + /** + * + * + *
        +     * Creates a user.
        +     * 
        + */ + public com.google.showcase.v1beta1.User createUser( + com.google.showcase.v1beta1.CreateUserRequest request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getCreateUserMethod(), getCallOptions(), request); + } + + /** + * + * + *
        +     * Retrieves the User with the given uri.
        +     * 
        + */ + public com.google.showcase.v1beta1.User getUser( + com.google.showcase.v1beta1.GetUserRequest request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getGetUserMethod(), getCallOptions(), request); + } + + /** + * + * + *
        +     * Updates a user.
        +     * 
        + */ + public com.google.showcase.v1beta1.User updateUser( + com.google.showcase.v1beta1.UpdateUserRequest request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getUpdateUserMethod(), getCallOptions(), request); + } + + /** + * + * + *
        +     * Deletes a user, their profile, and all of their authored messages.
        +     * 
        + */ + public com.google.protobuf.Empty deleteUser( + com.google.showcase.v1beta1.DeleteUserRequest request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getDeleteUserMethod(), getCallOptions(), request); + } + + /** + * + * + *
        +     * Lists all users.
        +     * 
        + */ + public com.google.showcase.v1beta1.ListUsersResponse listUsers( + com.google.showcase.v1beta1.ListUsersRequest request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getListUsersMethod(), getCallOptions(), request); + } + } + + /** + * A stub to allow clients to do limited synchronous rpc calls to service Identity. + * + *
        +   * A simple identity service.
        +   * 
        + */ + public static final class IdentityBlockingStub + extends io.grpc.stub.AbstractBlockingStub { + private IdentityBlockingStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected IdentityBlockingStub build(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new IdentityBlockingStub(channel, callOptions); + } + + /** + * + * + *
        +     * Creates a user.
        +     * 
        + */ + public com.google.showcase.v1beta1.User createUser( + com.google.showcase.v1beta1.CreateUserRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getCreateUserMethod(), getCallOptions(), request); + } + + /** + * + * + *
        +     * Retrieves the User with the given uri.
        +     * 
        + */ + public com.google.showcase.v1beta1.User getUser( + com.google.showcase.v1beta1.GetUserRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getGetUserMethod(), getCallOptions(), request); + } + + /** + * + * + *
        +     * Updates a user.
        +     * 
        + */ + public com.google.showcase.v1beta1.User updateUser( + com.google.showcase.v1beta1.UpdateUserRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getUpdateUserMethod(), getCallOptions(), request); + } + + /** + * + * + *
        +     * Deletes a user, their profile, and all of their authored messages.
        +     * 
        + */ + public com.google.protobuf.Empty deleteUser( + com.google.showcase.v1beta1.DeleteUserRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getDeleteUserMethod(), getCallOptions(), request); + } + + /** + * + * + *
        +     * Lists all users.
        +     * 
        + */ + public com.google.showcase.v1beta1.ListUsersResponse listUsers( + com.google.showcase.v1beta1.ListUsersRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getListUsersMethod(), getCallOptions(), request); + } + } + + /** + * A stub to allow clients to do ListenableFuture-style rpc calls to service Identity. + * + *
        +   * A simple identity service.
        +   * 
        + */ + public static final class IdentityFutureStub + extends io.grpc.stub.AbstractFutureStub { + private IdentityFutureStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected IdentityFutureStub build(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new IdentityFutureStub(channel, callOptions); + } + + /** + * + * + *
        +     * Creates a user.
        +     * 
        + */ + public com.google.common.util.concurrent.ListenableFuture + createUser(com.google.showcase.v1beta1.CreateUserRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getCreateUserMethod(), getCallOptions()), request); + } + + /** + * + * + *
        +     * Retrieves the User with the given uri.
        +     * 
        + */ + public com.google.common.util.concurrent.ListenableFuture + getUser(com.google.showcase.v1beta1.GetUserRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getGetUserMethod(), getCallOptions()), request); + } + + /** + * + * + *
        +     * Updates a user.
        +     * 
        + */ + public com.google.common.util.concurrent.ListenableFuture + updateUser(com.google.showcase.v1beta1.UpdateUserRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getUpdateUserMethod(), getCallOptions()), request); + } + + /** + * + * + *
        +     * Deletes a user, their profile, and all of their authored messages.
        +     * 
        + */ + public com.google.common.util.concurrent.ListenableFuture deleteUser( + com.google.showcase.v1beta1.DeleteUserRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getDeleteUserMethod(), getCallOptions()), request); + } + + /** + * + * + *
        +     * Lists all users.
        +     * 
        + */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.showcase.v1beta1.ListUsersResponse> + listUsers(com.google.showcase.v1beta1.ListUsersRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getListUsersMethod(), getCallOptions()), request); + } + } + + private static final int METHODID_CREATE_USER = 0; + private static final int METHODID_GET_USER = 1; + private static final int METHODID_UPDATE_USER = 2; + private static final int METHODID_DELETE_USER = 3; + private static final int METHODID_LIST_USERS = 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_CREATE_USER: + serviceImpl.createUser( + (com.google.showcase.v1beta1.CreateUserRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_GET_USER: + serviceImpl.getUser( + (com.google.showcase.v1beta1.GetUserRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_UPDATE_USER: + serviceImpl.updateUser( + (com.google.showcase.v1beta1.UpdateUserRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_DELETE_USER: + serviceImpl.deleteUser( + (com.google.showcase.v1beta1.DeleteUserRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_LIST_USERS: + serviceImpl.listUsers( + (com.google.showcase.v1beta1.ListUsersRequest) 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( + getCreateUserMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.showcase.v1beta1.CreateUserRequest, + com.google.showcase.v1beta1.User>(service, METHODID_CREATE_USER))) + .addMethod( + getGetUserMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.showcase.v1beta1.GetUserRequest, com.google.showcase.v1beta1.User>( + service, METHODID_GET_USER))) + .addMethod( + getUpdateUserMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.showcase.v1beta1.UpdateUserRequest, + com.google.showcase.v1beta1.User>(service, METHODID_UPDATE_USER))) + .addMethod( + getDeleteUserMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.showcase.v1beta1.DeleteUserRequest, com.google.protobuf.Empty>( + service, METHODID_DELETE_USER))) + .addMethod( + getListUsersMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.showcase.v1beta1.ListUsersRequest, + com.google.showcase.v1beta1.ListUsersResponse>(service, METHODID_LIST_USERS))) + .build(); + } + + private abstract static class IdentityBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoFileDescriptorSupplier, + io.grpc.protobuf.ProtoServiceDescriptorSupplier { + IdentityBaseDescriptorSupplier() {} + + @java.lang.Override + public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() { + return com.google.showcase.v1beta1.IdentityOuterClass.getDescriptor(); + } + + @java.lang.Override + public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() { + return getFileDescriptor().findServiceByName("Identity"); + } + } + + private static final class IdentityFileDescriptorSupplier extends IdentityBaseDescriptorSupplier { + IdentityFileDescriptorSupplier() {} + } + + private static final class IdentityMethodDescriptorSupplier extends IdentityBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoMethodDescriptorSupplier { + private final java.lang.String methodName; + + IdentityMethodDescriptorSupplier(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 (IdentityGrpc.class) { + result = serviceDescriptor; + if (result == null) { + serviceDescriptor = + result = + io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME) + .setSchemaDescriptor(new IdentityFileDescriptorSupplier()) + .addMethod(getCreateUserMethod()) + .addMethod(getGetUserMethod()) + .addMethod(getUpdateUserMethod()) + .addMethod(getDeleteUserMethod()) + .addMethod(getListUsersMethod()) + .build(); + } + } + } + return result; + } +} diff --git a/java-showcase-3.21.0/grpc-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/MessagingGrpc.java b/java-showcase-3.21.0/grpc-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/MessagingGrpc.java new file mode 100644 index 0000000000..48b744397b --- /dev/null +++ b/java-showcase-3.21.0/grpc-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/MessagingGrpc.java @@ -0,0 +1,2004 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.showcase.v1beta1; + +import static io.grpc.MethodDescriptor.generateFullMethodName; + +/** + * + * + *
        + * A simple messaging service that implements chat rooms and profile posts.
        + * This messaging service showcases the features that API clients
        + * generated by gapic-generators implement.
        + * 
        + */ +@io.grpc.stub.annotations.GrpcGenerated +public final class MessagingGrpc { + + private MessagingGrpc() {} + + public static final java.lang.String SERVICE_NAME = "google.showcase.v1beta1.Messaging"; + + // Static method descriptors that strictly reflect the proto. + private static volatile io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.CreateRoomRequest, com.google.showcase.v1beta1.Room> + getCreateRoomMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "CreateRoom", + requestType = com.google.showcase.v1beta1.CreateRoomRequest.class, + responseType = com.google.showcase.v1beta1.Room.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.CreateRoomRequest, com.google.showcase.v1beta1.Room> + getCreateRoomMethod() { + io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.CreateRoomRequest, com.google.showcase.v1beta1.Room> + getCreateRoomMethod; + if ((getCreateRoomMethod = MessagingGrpc.getCreateRoomMethod) == null) { + synchronized (MessagingGrpc.class) { + if ((getCreateRoomMethod = MessagingGrpc.getCreateRoomMethod) == null) { + MessagingGrpc.getCreateRoomMethod = + getCreateRoomMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "CreateRoom")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.CreateRoomRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.Room.getDefaultInstance())) + .setSchemaDescriptor(new MessagingMethodDescriptorSupplier("CreateRoom")) + .build(); + } + } + } + return getCreateRoomMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.GetRoomRequest, com.google.showcase.v1beta1.Room> + getGetRoomMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "GetRoom", + requestType = com.google.showcase.v1beta1.GetRoomRequest.class, + responseType = com.google.showcase.v1beta1.Room.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.GetRoomRequest, com.google.showcase.v1beta1.Room> + getGetRoomMethod() { + io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.GetRoomRequest, com.google.showcase.v1beta1.Room> + getGetRoomMethod; + if ((getGetRoomMethod = MessagingGrpc.getGetRoomMethod) == null) { + synchronized (MessagingGrpc.class) { + if ((getGetRoomMethod = MessagingGrpc.getGetRoomMethod) == null) { + MessagingGrpc.getGetRoomMethod = + getGetRoomMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetRoom")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.GetRoomRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.Room.getDefaultInstance())) + .setSchemaDescriptor(new MessagingMethodDescriptorSupplier("GetRoom")) + .build(); + } + } + } + return getGetRoomMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.UpdateRoomRequest, com.google.showcase.v1beta1.Room> + getUpdateRoomMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "UpdateRoom", + requestType = com.google.showcase.v1beta1.UpdateRoomRequest.class, + responseType = com.google.showcase.v1beta1.Room.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.UpdateRoomRequest, com.google.showcase.v1beta1.Room> + getUpdateRoomMethod() { + io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.UpdateRoomRequest, com.google.showcase.v1beta1.Room> + getUpdateRoomMethod; + if ((getUpdateRoomMethod = MessagingGrpc.getUpdateRoomMethod) == null) { + synchronized (MessagingGrpc.class) { + if ((getUpdateRoomMethod = MessagingGrpc.getUpdateRoomMethod) == null) { + MessagingGrpc.getUpdateRoomMethod = + getUpdateRoomMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "UpdateRoom")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.UpdateRoomRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.Room.getDefaultInstance())) + .setSchemaDescriptor(new MessagingMethodDescriptorSupplier("UpdateRoom")) + .build(); + } + } + } + return getUpdateRoomMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.DeleteRoomRequest, com.google.protobuf.Empty> + getDeleteRoomMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "DeleteRoom", + requestType = com.google.showcase.v1beta1.DeleteRoomRequest.class, + responseType = com.google.protobuf.Empty.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.DeleteRoomRequest, com.google.protobuf.Empty> + getDeleteRoomMethod() { + io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.DeleteRoomRequest, com.google.protobuf.Empty> + getDeleteRoomMethod; + if ((getDeleteRoomMethod = MessagingGrpc.getDeleteRoomMethod) == null) { + synchronized (MessagingGrpc.class) { + if ((getDeleteRoomMethod = MessagingGrpc.getDeleteRoomMethod) == null) { + MessagingGrpc.getDeleteRoomMethod = + getDeleteRoomMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "DeleteRoom")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.DeleteRoomRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.protobuf.Empty.getDefaultInstance())) + .setSchemaDescriptor(new MessagingMethodDescriptorSupplier("DeleteRoom")) + .build(); + } + } + } + return getDeleteRoomMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.ListRoomsRequest, + com.google.showcase.v1beta1.ListRoomsResponse> + getListRoomsMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "ListRooms", + requestType = com.google.showcase.v1beta1.ListRoomsRequest.class, + responseType = com.google.showcase.v1beta1.ListRoomsResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.ListRoomsRequest, + com.google.showcase.v1beta1.ListRoomsResponse> + getListRoomsMethod() { + io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.ListRoomsRequest, + com.google.showcase.v1beta1.ListRoomsResponse> + getListRoomsMethod; + if ((getListRoomsMethod = MessagingGrpc.getListRoomsMethod) == null) { + synchronized (MessagingGrpc.class) { + if ((getListRoomsMethod = MessagingGrpc.getListRoomsMethod) == null) { + MessagingGrpc.getListRoomsMethod = + getListRoomsMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "ListRooms")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.ListRoomsRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.ListRoomsResponse.getDefaultInstance())) + .setSchemaDescriptor(new MessagingMethodDescriptorSupplier("ListRooms")) + .build(); + } + } + } + return getListRoomsMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.CreateBlurbRequest, com.google.showcase.v1beta1.Blurb> + getCreateBlurbMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "CreateBlurb", + requestType = com.google.showcase.v1beta1.CreateBlurbRequest.class, + responseType = com.google.showcase.v1beta1.Blurb.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.CreateBlurbRequest, com.google.showcase.v1beta1.Blurb> + getCreateBlurbMethod() { + io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.CreateBlurbRequest, com.google.showcase.v1beta1.Blurb> + getCreateBlurbMethod; + if ((getCreateBlurbMethod = MessagingGrpc.getCreateBlurbMethod) == null) { + synchronized (MessagingGrpc.class) { + if ((getCreateBlurbMethod = MessagingGrpc.getCreateBlurbMethod) == null) { + MessagingGrpc.getCreateBlurbMethod = + getCreateBlurbMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "CreateBlurb")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.CreateBlurbRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.Blurb.getDefaultInstance())) + .setSchemaDescriptor(new MessagingMethodDescriptorSupplier("CreateBlurb")) + .build(); + } + } + } + return getCreateBlurbMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.GetBlurbRequest, com.google.showcase.v1beta1.Blurb> + getGetBlurbMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "GetBlurb", + requestType = com.google.showcase.v1beta1.GetBlurbRequest.class, + responseType = com.google.showcase.v1beta1.Blurb.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.GetBlurbRequest, com.google.showcase.v1beta1.Blurb> + getGetBlurbMethod() { + io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.GetBlurbRequest, com.google.showcase.v1beta1.Blurb> + getGetBlurbMethod; + if ((getGetBlurbMethod = MessagingGrpc.getGetBlurbMethod) == null) { + synchronized (MessagingGrpc.class) { + if ((getGetBlurbMethod = MessagingGrpc.getGetBlurbMethod) == null) { + MessagingGrpc.getGetBlurbMethod = + getGetBlurbMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetBlurb")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.GetBlurbRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.Blurb.getDefaultInstance())) + .setSchemaDescriptor(new MessagingMethodDescriptorSupplier("GetBlurb")) + .build(); + } + } + } + return getGetBlurbMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.UpdateBlurbRequest, com.google.showcase.v1beta1.Blurb> + getUpdateBlurbMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "UpdateBlurb", + requestType = com.google.showcase.v1beta1.UpdateBlurbRequest.class, + responseType = com.google.showcase.v1beta1.Blurb.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.UpdateBlurbRequest, com.google.showcase.v1beta1.Blurb> + getUpdateBlurbMethod() { + io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.UpdateBlurbRequest, com.google.showcase.v1beta1.Blurb> + getUpdateBlurbMethod; + if ((getUpdateBlurbMethod = MessagingGrpc.getUpdateBlurbMethod) == null) { + synchronized (MessagingGrpc.class) { + if ((getUpdateBlurbMethod = MessagingGrpc.getUpdateBlurbMethod) == null) { + MessagingGrpc.getUpdateBlurbMethod = + getUpdateBlurbMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "UpdateBlurb")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.UpdateBlurbRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.Blurb.getDefaultInstance())) + .setSchemaDescriptor(new MessagingMethodDescriptorSupplier("UpdateBlurb")) + .build(); + } + } + } + return getUpdateBlurbMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.DeleteBlurbRequest, com.google.protobuf.Empty> + getDeleteBlurbMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "DeleteBlurb", + requestType = com.google.showcase.v1beta1.DeleteBlurbRequest.class, + responseType = com.google.protobuf.Empty.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.DeleteBlurbRequest, com.google.protobuf.Empty> + getDeleteBlurbMethod() { + io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.DeleteBlurbRequest, com.google.protobuf.Empty> + getDeleteBlurbMethod; + if ((getDeleteBlurbMethod = MessagingGrpc.getDeleteBlurbMethod) == null) { + synchronized (MessagingGrpc.class) { + if ((getDeleteBlurbMethod = MessagingGrpc.getDeleteBlurbMethod) == null) { + MessagingGrpc.getDeleteBlurbMethod = + getDeleteBlurbMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "DeleteBlurb")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.DeleteBlurbRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.protobuf.Empty.getDefaultInstance())) + .setSchemaDescriptor(new MessagingMethodDescriptorSupplier("DeleteBlurb")) + .build(); + } + } + } + return getDeleteBlurbMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.ListBlurbsRequest, + com.google.showcase.v1beta1.ListBlurbsResponse> + getListBlurbsMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "ListBlurbs", + requestType = com.google.showcase.v1beta1.ListBlurbsRequest.class, + responseType = com.google.showcase.v1beta1.ListBlurbsResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.ListBlurbsRequest, + com.google.showcase.v1beta1.ListBlurbsResponse> + getListBlurbsMethod() { + io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.ListBlurbsRequest, + com.google.showcase.v1beta1.ListBlurbsResponse> + getListBlurbsMethod; + if ((getListBlurbsMethod = MessagingGrpc.getListBlurbsMethod) == null) { + synchronized (MessagingGrpc.class) { + if ((getListBlurbsMethod = MessagingGrpc.getListBlurbsMethod) == null) { + MessagingGrpc.getListBlurbsMethod = + getListBlurbsMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "ListBlurbs")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.ListBlurbsRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.ListBlurbsResponse.getDefaultInstance())) + .setSchemaDescriptor(new MessagingMethodDescriptorSupplier("ListBlurbs")) + .build(); + } + } + } + return getListBlurbsMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.SearchBlurbsRequest, com.google.longrunning.Operation> + getSearchBlurbsMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "SearchBlurbs", + requestType = com.google.showcase.v1beta1.SearchBlurbsRequest.class, + responseType = com.google.longrunning.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.SearchBlurbsRequest, com.google.longrunning.Operation> + getSearchBlurbsMethod() { + io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.SearchBlurbsRequest, com.google.longrunning.Operation> + getSearchBlurbsMethod; + if ((getSearchBlurbsMethod = MessagingGrpc.getSearchBlurbsMethod) == null) { + synchronized (MessagingGrpc.class) { + if ((getSearchBlurbsMethod = MessagingGrpc.getSearchBlurbsMethod) == null) { + MessagingGrpc.getSearchBlurbsMethod = + getSearchBlurbsMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "SearchBlurbs")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.SearchBlurbsRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor(new MessagingMethodDescriptorSupplier("SearchBlurbs")) + .build(); + } + } + } + return getSearchBlurbsMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.StreamBlurbsRequest, + com.google.showcase.v1beta1.StreamBlurbsResponse> + getStreamBlurbsMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "StreamBlurbs", + requestType = com.google.showcase.v1beta1.StreamBlurbsRequest.class, + responseType = com.google.showcase.v1beta1.StreamBlurbsResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.SERVER_STREAMING) + public static io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.StreamBlurbsRequest, + com.google.showcase.v1beta1.StreamBlurbsResponse> + getStreamBlurbsMethod() { + io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.StreamBlurbsRequest, + com.google.showcase.v1beta1.StreamBlurbsResponse> + getStreamBlurbsMethod; + if ((getStreamBlurbsMethod = MessagingGrpc.getStreamBlurbsMethod) == null) { + synchronized (MessagingGrpc.class) { + if ((getStreamBlurbsMethod = MessagingGrpc.getStreamBlurbsMethod) == null) { + MessagingGrpc.getStreamBlurbsMethod = + getStreamBlurbsMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.SERVER_STREAMING) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "StreamBlurbs")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.StreamBlurbsRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.StreamBlurbsResponse + .getDefaultInstance())) + .setSchemaDescriptor(new MessagingMethodDescriptorSupplier("StreamBlurbs")) + .build(); + } + } + } + return getStreamBlurbsMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.CreateBlurbRequest, + com.google.showcase.v1beta1.SendBlurbsResponse> + getSendBlurbsMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "SendBlurbs", + requestType = com.google.showcase.v1beta1.CreateBlurbRequest.class, + responseType = com.google.showcase.v1beta1.SendBlurbsResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.CLIENT_STREAMING) + public static io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.CreateBlurbRequest, + com.google.showcase.v1beta1.SendBlurbsResponse> + getSendBlurbsMethod() { + io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.CreateBlurbRequest, + com.google.showcase.v1beta1.SendBlurbsResponse> + getSendBlurbsMethod; + if ((getSendBlurbsMethod = MessagingGrpc.getSendBlurbsMethod) == null) { + synchronized (MessagingGrpc.class) { + if ((getSendBlurbsMethod = MessagingGrpc.getSendBlurbsMethod) == null) { + MessagingGrpc.getSendBlurbsMethod = + getSendBlurbsMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.CLIENT_STREAMING) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "SendBlurbs")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.CreateBlurbRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.SendBlurbsResponse.getDefaultInstance())) + .setSchemaDescriptor(new MessagingMethodDescriptorSupplier("SendBlurbs")) + .build(); + } + } + } + return getSendBlurbsMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.ConnectRequest, + com.google.showcase.v1beta1.StreamBlurbsResponse> + getConnectMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "Connect", + requestType = com.google.showcase.v1beta1.ConnectRequest.class, + responseType = com.google.showcase.v1beta1.StreamBlurbsResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.BIDI_STREAMING) + public static io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.ConnectRequest, + com.google.showcase.v1beta1.StreamBlurbsResponse> + getConnectMethod() { + io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.ConnectRequest, + com.google.showcase.v1beta1.StreamBlurbsResponse> + getConnectMethod; + if ((getConnectMethod = MessagingGrpc.getConnectMethod) == null) { + synchronized (MessagingGrpc.class) { + if ((getConnectMethod = MessagingGrpc.getConnectMethod) == null) { + MessagingGrpc.getConnectMethod = + getConnectMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.BIDI_STREAMING) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "Connect")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.ConnectRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.StreamBlurbsResponse + .getDefaultInstance())) + .setSchemaDescriptor(new MessagingMethodDescriptorSupplier("Connect")) + .build(); + } + } + } + return getConnectMethod; + } + + /** Creates a new async stub that supports all call types for the service */ + public static MessagingStub newStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public MessagingStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new MessagingStub(channel, callOptions); + } + }; + return MessagingStub.newStub(factory, channel); + } + + /** Creates a new blocking-style stub that supports all types of calls on the service */ + public static MessagingBlockingV2Stub newBlockingV2Stub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public MessagingBlockingV2Stub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new MessagingBlockingV2Stub(channel, callOptions); + } + }; + return MessagingBlockingV2Stub.newStub(factory, channel); + } + + /** + * Creates a new blocking-style stub that supports unary and streaming output calls on the service + */ + public static MessagingBlockingStub newBlockingStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public MessagingBlockingStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new MessagingBlockingStub(channel, callOptions); + } + }; + return MessagingBlockingStub.newStub(factory, channel); + } + + /** Creates a new ListenableFuture-style stub that supports unary calls on the service */ + public static MessagingFutureStub newFutureStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public MessagingFutureStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new MessagingFutureStub(channel, callOptions); + } + }; + return MessagingFutureStub.newStub(factory, channel); + } + + /** + * + * + *
        +   * A simple messaging service that implements chat rooms and profile posts.
        +   * This messaging service showcases the features that API clients
        +   * generated by gapic-generators implement.
        +   * 
        + */ + public interface AsyncService { + + /** + * + * + *
        +     * Creates a room.
        +     * 
        + */ + default void createRoom( + com.google.showcase.v1beta1.CreateRoomRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getCreateRoomMethod(), responseObserver); + } + + /** + * + * + *
        +     * Retrieves the Room with the given resource name.
        +     * 
        + */ + default void getRoom( + com.google.showcase.v1beta1.GetRoomRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getGetRoomMethod(), responseObserver); + } + + /** + * + * + *
        +     * Updates a room.
        +     * 
        + */ + default void updateRoom( + com.google.showcase.v1beta1.UpdateRoomRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getUpdateRoomMethod(), responseObserver); + } + + /** + * + * + *
        +     * Deletes a room and all of its blurbs.
        +     * 
        + */ + default void deleteRoom( + com.google.showcase.v1beta1.DeleteRoomRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getDeleteRoomMethod(), responseObserver); + } + + /** + * + * + *
        +     * Lists all chat rooms.
        +     * 
        + */ + default void listRooms( + com.google.showcase.v1beta1.ListRoomsRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getListRoomsMethod(), responseObserver); + } + + /** + * + * + *
        +     * Creates a blurb. If the parent is a room, the blurb is understood to be a
        +     * message in that room. If the parent is a profile, the blurb is understood
        +     * to be a post on the profile.
        +     * 
        + */ + default void createBlurb( + com.google.showcase.v1beta1.CreateBlurbRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getCreateBlurbMethod(), responseObserver); + } + + /** + * + * + *
        +     * Retrieves the Blurb with the given resource name.
        +     * 
        + */ + default void getBlurb( + com.google.showcase.v1beta1.GetBlurbRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getGetBlurbMethod(), responseObserver); + } + + /** + * + * + *
        +     * Updates a blurb.
        +     * 
        + */ + default void updateBlurb( + com.google.showcase.v1beta1.UpdateBlurbRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getUpdateBlurbMethod(), responseObserver); + } + + /** + * + * + *
        +     * Deletes a blurb.
        +     * 
        + */ + default void deleteBlurb( + com.google.showcase.v1beta1.DeleteBlurbRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getDeleteBlurbMethod(), responseObserver); + } + + /** + * + * + *
        +     * Lists blurbs for a specific chat room or user profile depending on the
        +     * parent resource name.
        +     * 
        + */ + default void listBlurbs( + com.google.showcase.v1beta1.ListBlurbsRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getListBlurbsMethod(), responseObserver); + } + + /** + * + * + *
        +     * This method searches through all blurbs across all rooms and profiles
        +     * for blurbs containing to words found in the query. Only posts that
        +     * contain an exact match of a queried word will be returned.
        +     * 
        + */ + default void searchBlurbs( + com.google.showcase.v1beta1.SearchBlurbsRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getSearchBlurbsMethod(), responseObserver); + } + + /** + * + * + *
        +     * This returns a stream that emits the blurbs that are created for a
        +     * particular chat room or user profile.
        +     * 
        + */ + default void streamBlurbs( + com.google.showcase.v1beta1.StreamBlurbsRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getStreamBlurbsMethod(), responseObserver); + } + + /** + * + * + *
        +     * This is a stream to create multiple blurbs. If an invalid blurb is
        +     * requested to be created, the stream will close with an error.
        +     * 
        + */ + default io.grpc.stub.StreamObserver sendBlurbs( + io.grpc.stub.StreamObserver + responseObserver) { + return io.grpc.stub.ServerCalls.asyncUnimplementedStreamingCall( + getSendBlurbsMethod(), responseObserver); + } + + /** + * + * + *
        +     * This method starts a bidirectional stream that receives all blurbs that
        +     * are being created after the stream has started and sends requests to create
        +     * blurbs. If an invalid blurb is requested to be created, the stream will
        +     * close with an error.
        +     * 
        + */ + default io.grpc.stub.StreamObserver connect( + io.grpc.stub.StreamObserver + responseObserver) { + return io.grpc.stub.ServerCalls.asyncUnimplementedStreamingCall( + getConnectMethod(), responseObserver); + } + } + + /** + * Base class for the server implementation of the service Messaging. + * + *
        +   * A simple messaging service that implements chat rooms and profile posts.
        +   * This messaging service showcases the features that API clients
        +   * generated by gapic-generators implement.
        +   * 
        + */ + public abstract static class MessagingImplBase implements io.grpc.BindableService, AsyncService { + + @java.lang.Override + public final io.grpc.ServerServiceDefinition bindService() { + return MessagingGrpc.bindService(this); + } + } + + /** + * A stub to allow clients to do asynchronous rpc calls to service Messaging. + * + *
        +   * A simple messaging service that implements chat rooms and profile posts.
        +   * This messaging service showcases the features that API clients
        +   * generated by gapic-generators implement.
        +   * 
        + */ + public static final class MessagingStub extends io.grpc.stub.AbstractAsyncStub { + private MessagingStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected MessagingStub build(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new MessagingStub(channel, callOptions); + } + + /** + * + * + *
        +     * Creates a room.
        +     * 
        + */ + public void createRoom( + com.google.showcase.v1beta1.CreateRoomRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getCreateRoomMethod(), getCallOptions()), request, responseObserver); + } + + /** + * + * + *
        +     * Retrieves the Room with the given resource name.
        +     * 
        + */ + public void getRoom( + com.google.showcase.v1beta1.GetRoomRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getGetRoomMethod(), getCallOptions()), request, responseObserver); + } + + /** + * + * + *
        +     * Updates a room.
        +     * 
        + */ + public void updateRoom( + com.google.showcase.v1beta1.UpdateRoomRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getUpdateRoomMethod(), getCallOptions()), request, responseObserver); + } + + /** + * + * + *
        +     * Deletes a room and all of its blurbs.
        +     * 
        + */ + public void deleteRoom( + com.google.showcase.v1beta1.DeleteRoomRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getDeleteRoomMethod(), getCallOptions()), request, responseObserver); + } + + /** + * + * + *
        +     * Lists all chat rooms.
        +     * 
        + */ + public void listRooms( + com.google.showcase.v1beta1.ListRoomsRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getListRoomsMethod(), getCallOptions()), request, responseObserver); + } + + /** + * + * + *
        +     * Creates a blurb. If the parent is a room, the blurb is understood to be a
        +     * message in that room. If the parent is a profile, the blurb is understood
        +     * to be a post on the profile.
        +     * 
        + */ + public void createBlurb( + com.google.showcase.v1beta1.CreateBlurbRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getCreateBlurbMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
        +     * Retrieves the Blurb with the given resource name.
        +     * 
        + */ + public void getBlurb( + com.google.showcase.v1beta1.GetBlurbRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getGetBlurbMethod(), getCallOptions()), request, responseObserver); + } + + /** + * + * + *
        +     * Updates a blurb.
        +     * 
        + */ + public void updateBlurb( + com.google.showcase.v1beta1.UpdateBlurbRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getUpdateBlurbMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
        +     * Deletes a blurb.
        +     * 
        + */ + public void deleteBlurb( + com.google.showcase.v1beta1.DeleteBlurbRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getDeleteBlurbMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
        +     * Lists blurbs for a specific chat room or user profile depending on the
        +     * parent resource name.
        +     * 
        + */ + public void listBlurbs( + com.google.showcase.v1beta1.ListBlurbsRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getListBlurbsMethod(), getCallOptions()), request, responseObserver); + } + + /** + * + * + *
        +     * This method searches through all blurbs across all rooms and profiles
        +     * for blurbs containing to words found in the query. Only posts that
        +     * contain an exact match of a queried word will be returned.
        +     * 
        + */ + public void searchBlurbs( + com.google.showcase.v1beta1.SearchBlurbsRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getSearchBlurbsMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
        +     * This returns a stream that emits the blurbs that are created for a
        +     * particular chat room or user profile.
        +     * 
        + */ + public void streamBlurbs( + com.google.showcase.v1beta1.StreamBlurbsRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncServerStreamingCall( + getChannel().newCall(getStreamBlurbsMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
        +     * This is a stream to create multiple blurbs. If an invalid blurb is
        +     * requested to be created, the stream will close with an error.
        +     * 
        + */ + public io.grpc.stub.StreamObserver sendBlurbs( + io.grpc.stub.StreamObserver + responseObserver) { + return io.grpc.stub.ClientCalls.asyncClientStreamingCall( + getChannel().newCall(getSendBlurbsMethod(), getCallOptions()), responseObserver); + } + + /** + * + * + *
        +     * This method starts a bidirectional stream that receives all blurbs that
        +     * are being created after the stream has started and sends requests to create
        +     * blurbs. If an invalid blurb is requested to be created, the stream will
        +     * close with an error.
        +     * 
        + */ + public io.grpc.stub.StreamObserver connect( + io.grpc.stub.StreamObserver + responseObserver) { + return io.grpc.stub.ClientCalls.asyncBidiStreamingCall( + getChannel().newCall(getConnectMethod(), getCallOptions()), responseObserver); + } + } + + /** + * A stub to allow clients to do synchronous rpc calls to service Messaging. + * + *
        +   * A simple messaging service that implements chat rooms and profile posts.
        +   * This messaging service showcases the features that API clients
        +   * generated by gapic-generators implement.
        +   * 
        + */ + public static final class MessagingBlockingV2Stub + extends io.grpc.stub.AbstractBlockingStub { + private MessagingBlockingV2Stub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected MessagingBlockingV2Stub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new MessagingBlockingV2Stub(channel, callOptions); + } + + /** + * + * + *
        +     * Creates a room.
        +     * 
        + */ + public com.google.showcase.v1beta1.Room createRoom( + com.google.showcase.v1beta1.CreateRoomRequest request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getCreateRoomMethod(), getCallOptions(), request); + } + + /** + * + * + *
        +     * Retrieves the Room with the given resource name.
        +     * 
        + */ + public com.google.showcase.v1beta1.Room getRoom( + com.google.showcase.v1beta1.GetRoomRequest request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getGetRoomMethod(), getCallOptions(), request); + } + + /** + * + * + *
        +     * Updates a room.
        +     * 
        + */ + public com.google.showcase.v1beta1.Room updateRoom( + com.google.showcase.v1beta1.UpdateRoomRequest request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getUpdateRoomMethod(), getCallOptions(), request); + } + + /** + * + * + *
        +     * Deletes a room and all of its blurbs.
        +     * 
        + */ + public com.google.protobuf.Empty deleteRoom( + com.google.showcase.v1beta1.DeleteRoomRequest request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getDeleteRoomMethod(), getCallOptions(), request); + } + + /** + * + * + *
        +     * Lists all chat rooms.
        +     * 
        + */ + public com.google.showcase.v1beta1.ListRoomsResponse listRooms( + com.google.showcase.v1beta1.ListRoomsRequest request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getListRoomsMethod(), getCallOptions(), request); + } + + /** + * + * + *
        +     * Creates a blurb. If the parent is a room, the blurb is understood to be a
        +     * message in that room. If the parent is a profile, the blurb is understood
        +     * to be a post on the profile.
        +     * 
        + */ + public com.google.showcase.v1beta1.Blurb createBlurb( + com.google.showcase.v1beta1.CreateBlurbRequest request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getCreateBlurbMethod(), getCallOptions(), request); + } + + /** + * + * + *
        +     * Retrieves the Blurb with the given resource name.
        +     * 
        + */ + public com.google.showcase.v1beta1.Blurb getBlurb( + com.google.showcase.v1beta1.GetBlurbRequest request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getGetBlurbMethod(), getCallOptions(), request); + } + + /** + * + * + *
        +     * Updates a blurb.
        +     * 
        + */ + public com.google.showcase.v1beta1.Blurb updateBlurb( + com.google.showcase.v1beta1.UpdateBlurbRequest request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getUpdateBlurbMethod(), getCallOptions(), request); + } + + /** + * + * + *
        +     * Deletes a blurb.
        +     * 
        + */ + public com.google.protobuf.Empty deleteBlurb( + com.google.showcase.v1beta1.DeleteBlurbRequest request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getDeleteBlurbMethod(), getCallOptions(), request); + } + + /** + * + * + *
        +     * Lists blurbs for a specific chat room or user profile depending on the
        +     * parent resource name.
        +     * 
        + */ + public com.google.showcase.v1beta1.ListBlurbsResponse listBlurbs( + com.google.showcase.v1beta1.ListBlurbsRequest request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getListBlurbsMethod(), getCallOptions(), request); + } + + /** + * + * + *
        +     * This method searches through all blurbs across all rooms and profiles
        +     * for blurbs containing to words found in the query. Only posts that
        +     * contain an exact match of a queried word will be returned.
        +     * 
        + */ + public com.google.longrunning.Operation searchBlurbs( + com.google.showcase.v1beta1.SearchBlurbsRequest request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getSearchBlurbsMethod(), getCallOptions(), request); + } + + /** + * + * + *
        +     * This returns a stream that emits the blurbs that are created for a
        +     * particular chat room or user profile.
        +     * 
        + */ + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/10918") + public io.grpc.stub.BlockingClientCall + streamBlurbs(com.google.showcase.v1beta1.StreamBlurbsRequest request) { + return io.grpc.stub.ClientCalls.blockingV2ServerStreamingCall( + getChannel(), getStreamBlurbsMethod(), getCallOptions(), request); + } + + /** + * + * + *
        +     * This is a stream to create multiple blurbs. If an invalid blurb is
        +     * requested to be created, the stream will close with an error.
        +     * 
        + */ + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/10918") + public io.grpc.stub.BlockingClientCall< + com.google.showcase.v1beta1.CreateBlurbRequest, + com.google.showcase.v1beta1.SendBlurbsResponse> + sendBlurbs() { + return io.grpc.stub.ClientCalls.blockingClientStreamingCall( + getChannel(), getSendBlurbsMethod(), getCallOptions()); + } + + /** + * + * + *
        +     * This method starts a bidirectional stream that receives all blurbs that
        +     * are being created after the stream has started and sends requests to create
        +     * blurbs. If an invalid blurb is requested to be created, the stream will
        +     * close with an error.
        +     * 
        + */ + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/10918") + public io.grpc.stub.BlockingClientCall< + com.google.showcase.v1beta1.ConnectRequest, + com.google.showcase.v1beta1.StreamBlurbsResponse> + connect() { + return io.grpc.stub.ClientCalls.blockingBidiStreamingCall( + getChannel(), getConnectMethod(), getCallOptions()); + } + } + + /** + * A stub to allow clients to do limited synchronous rpc calls to service Messaging. + * + *
        +   * A simple messaging service that implements chat rooms and profile posts.
        +   * This messaging service showcases the features that API clients
        +   * generated by gapic-generators implement.
        +   * 
        + */ + public static final class MessagingBlockingStub + extends io.grpc.stub.AbstractBlockingStub { + private MessagingBlockingStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected MessagingBlockingStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new MessagingBlockingStub(channel, callOptions); + } + + /** + * + * + *
        +     * Creates a room.
        +     * 
        + */ + public com.google.showcase.v1beta1.Room createRoom( + com.google.showcase.v1beta1.CreateRoomRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getCreateRoomMethod(), getCallOptions(), request); + } + + /** + * + * + *
        +     * Retrieves the Room with the given resource name.
        +     * 
        + */ + public com.google.showcase.v1beta1.Room getRoom( + com.google.showcase.v1beta1.GetRoomRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getGetRoomMethod(), getCallOptions(), request); + } + + /** + * + * + *
        +     * Updates a room.
        +     * 
        + */ + public com.google.showcase.v1beta1.Room updateRoom( + com.google.showcase.v1beta1.UpdateRoomRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getUpdateRoomMethod(), getCallOptions(), request); + } + + /** + * + * + *
        +     * Deletes a room and all of its blurbs.
        +     * 
        + */ + public com.google.protobuf.Empty deleteRoom( + com.google.showcase.v1beta1.DeleteRoomRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getDeleteRoomMethod(), getCallOptions(), request); + } + + /** + * + * + *
        +     * Lists all chat rooms.
        +     * 
        + */ + public com.google.showcase.v1beta1.ListRoomsResponse listRooms( + com.google.showcase.v1beta1.ListRoomsRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getListRoomsMethod(), getCallOptions(), request); + } + + /** + * + * + *
        +     * Creates a blurb. If the parent is a room, the blurb is understood to be a
        +     * message in that room. If the parent is a profile, the blurb is understood
        +     * to be a post on the profile.
        +     * 
        + */ + public com.google.showcase.v1beta1.Blurb createBlurb( + com.google.showcase.v1beta1.CreateBlurbRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getCreateBlurbMethod(), getCallOptions(), request); + } + + /** + * + * + *
        +     * Retrieves the Blurb with the given resource name.
        +     * 
        + */ + public com.google.showcase.v1beta1.Blurb getBlurb( + com.google.showcase.v1beta1.GetBlurbRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getGetBlurbMethod(), getCallOptions(), request); + } + + /** + * + * + *
        +     * Updates a blurb.
        +     * 
        + */ + public com.google.showcase.v1beta1.Blurb updateBlurb( + com.google.showcase.v1beta1.UpdateBlurbRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getUpdateBlurbMethod(), getCallOptions(), request); + } + + /** + * + * + *
        +     * Deletes a blurb.
        +     * 
        + */ + public com.google.protobuf.Empty deleteBlurb( + com.google.showcase.v1beta1.DeleteBlurbRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getDeleteBlurbMethod(), getCallOptions(), request); + } + + /** + * + * + *
        +     * Lists blurbs for a specific chat room or user profile depending on the
        +     * parent resource name.
        +     * 
        + */ + public com.google.showcase.v1beta1.ListBlurbsResponse listBlurbs( + com.google.showcase.v1beta1.ListBlurbsRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getListBlurbsMethod(), getCallOptions(), request); + } + + /** + * + * + *
        +     * This method searches through all blurbs across all rooms and profiles
        +     * for blurbs containing to words found in the query. Only posts that
        +     * contain an exact match of a queried word will be returned.
        +     * 
        + */ + public com.google.longrunning.Operation searchBlurbs( + com.google.showcase.v1beta1.SearchBlurbsRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getSearchBlurbsMethod(), getCallOptions(), request); + } + + /** + * + * + *
        +     * This returns a stream that emits the blurbs that are created for a
        +     * particular chat room or user profile.
        +     * 
        + */ + public java.util.Iterator streamBlurbs( + com.google.showcase.v1beta1.StreamBlurbsRequest request) { + return io.grpc.stub.ClientCalls.blockingServerStreamingCall( + getChannel(), getStreamBlurbsMethod(), getCallOptions(), request); + } + } + + /** + * A stub to allow clients to do ListenableFuture-style rpc calls to service Messaging. + * + *
        +   * A simple messaging service that implements chat rooms and profile posts.
        +   * This messaging service showcases the features that API clients
        +   * generated by gapic-generators implement.
        +   * 
        + */ + public static final class MessagingFutureStub + extends io.grpc.stub.AbstractFutureStub { + private MessagingFutureStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected MessagingFutureStub build(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new MessagingFutureStub(channel, callOptions); + } + + /** + * + * + *
        +     * Creates a room.
        +     * 
        + */ + public com.google.common.util.concurrent.ListenableFuture + createRoom(com.google.showcase.v1beta1.CreateRoomRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getCreateRoomMethod(), getCallOptions()), request); + } + + /** + * + * + *
        +     * Retrieves the Room with the given resource name.
        +     * 
        + */ + public com.google.common.util.concurrent.ListenableFuture + getRoom(com.google.showcase.v1beta1.GetRoomRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getGetRoomMethod(), getCallOptions()), request); + } + + /** + * + * + *
        +     * Updates a room.
        +     * 
        + */ + public com.google.common.util.concurrent.ListenableFuture + updateRoom(com.google.showcase.v1beta1.UpdateRoomRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getUpdateRoomMethod(), getCallOptions()), request); + } + + /** + * + * + *
        +     * Deletes a room and all of its blurbs.
        +     * 
        + */ + public com.google.common.util.concurrent.ListenableFuture deleteRoom( + com.google.showcase.v1beta1.DeleteRoomRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getDeleteRoomMethod(), getCallOptions()), request); + } + + /** + * + * + *
        +     * Lists all chat rooms.
        +     * 
        + */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.showcase.v1beta1.ListRoomsResponse> + listRooms(com.google.showcase.v1beta1.ListRoomsRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getListRoomsMethod(), getCallOptions()), request); + } + + /** + * + * + *
        +     * Creates a blurb. If the parent is a room, the blurb is understood to be a
        +     * message in that room. If the parent is a profile, the blurb is understood
        +     * to be a post on the profile.
        +     * 
        + */ + public com.google.common.util.concurrent.ListenableFuture + createBlurb(com.google.showcase.v1beta1.CreateBlurbRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getCreateBlurbMethod(), getCallOptions()), request); + } + + /** + * + * + *
        +     * Retrieves the Blurb with the given resource name.
        +     * 
        + */ + public com.google.common.util.concurrent.ListenableFuture + getBlurb(com.google.showcase.v1beta1.GetBlurbRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getGetBlurbMethod(), getCallOptions()), request); + } + + /** + * + * + *
        +     * Updates a blurb.
        +     * 
        + */ + public com.google.common.util.concurrent.ListenableFuture + updateBlurb(com.google.showcase.v1beta1.UpdateBlurbRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getUpdateBlurbMethod(), getCallOptions()), request); + } + + /** + * + * + *
        +     * Deletes a blurb.
        +     * 
        + */ + public com.google.common.util.concurrent.ListenableFuture + deleteBlurb(com.google.showcase.v1beta1.DeleteBlurbRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getDeleteBlurbMethod(), getCallOptions()), request); + } + + /** + * + * + *
        +     * Lists blurbs for a specific chat room or user profile depending on the
        +     * parent resource name.
        +     * 
        + */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.showcase.v1beta1.ListBlurbsResponse> + listBlurbs(com.google.showcase.v1beta1.ListBlurbsRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getListBlurbsMethod(), getCallOptions()), request); + } + + /** + * + * + *
        +     * This method searches through all blurbs across all rooms and profiles
        +     * for blurbs containing to words found in the query. Only posts that
        +     * contain an exact match of a queried word will be returned.
        +     * 
        + */ + public com.google.common.util.concurrent.ListenableFuture + searchBlurbs(com.google.showcase.v1beta1.SearchBlurbsRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getSearchBlurbsMethod(), getCallOptions()), request); + } + } + + private static final int METHODID_CREATE_ROOM = 0; + private static final int METHODID_GET_ROOM = 1; + private static final int METHODID_UPDATE_ROOM = 2; + private static final int METHODID_DELETE_ROOM = 3; + private static final int METHODID_LIST_ROOMS = 4; + private static final int METHODID_CREATE_BLURB = 5; + private static final int METHODID_GET_BLURB = 6; + private static final int METHODID_UPDATE_BLURB = 7; + private static final int METHODID_DELETE_BLURB = 8; + private static final int METHODID_LIST_BLURBS = 9; + private static final int METHODID_SEARCH_BLURBS = 10; + private static final int METHODID_STREAM_BLURBS = 11; + private static final int METHODID_SEND_BLURBS = 12; + private static final int METHODID_CONNECT = 13; + + 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_CREATE_ROOM: + serviceImpl.createRoom( + (com.google.showcase.v1beta1.CreateRoomRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_GET_ROOM: + serviceImpl.getRoom( + (com.google.showcase.v1beta1.GetRoomRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_UPDATE_ROOM: + serviceImpl.updateRoom( + (com.google.showcase.v1beta1.UpdateRoomRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_DELETE_ROOM: + serviceImpl.deleteRoom( + (com.google.showcase.v1beta1.DeleteRoomRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_LIST_ROOMS: + serviceImpl.listRooms( + (com.google.showcase.v1beta1.ListRoomsRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_CREATE_BLURB: + serviceImpl.createBlurb( + (com.google.showcase.v1beta1.CreateBlurbRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_GET_BLURB: + serviceImpl.getBlurb( + (com.google.showcase.v1beta1.GetBlurbRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_UPDATE_BLURB: + serviceImpl.updateBlurb( + (com.google.showcase.v1beta1.UpdateBlurbRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_DELETE_BLURB: + serviceImpl.deleteBlurb( + (com.google.showcase.v1beta1.DeleteBlurbRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_LIST_BLURBS: + serviceImpl.listBlurbs( + (com.google.showcase.v1beta1.ListBlurbsRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_SEARCH_BLURBS: + serviceImpl.searchBlurbs( + (com.google.showcase.v1beta1.SearchBlurbsRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_STREAM_BLURBS: + serviceImpl.streamBlurbs( + (com.google.showcase.v1beta1.StreamBlurbsRequest) 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_SEND_BLURBS: + return (io.grpc.stub.StreamObserver) + serviceImpl.sendBlurbs( + (io.grpc.stub.StreamObserver) + responseObserver); + case METHODID_CONNECT: + return (io.grpc.stub.StreamObserver) + serviceImpl.connect( + (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( + getCreateRoomMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.showcase.v1beta1.CreateRoomRequest, + com.google.showcase.v1beta1.Room>(service, METHODID_CREATE_ROOM))) + .addMethod( + getGetRoomMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.showcase.v1beta1.GetRoomRequest, com.google.showcase.v1beta1.Room>( + service, METHODID_GET_ROOM))) + .addMethod( + getUpdateRoomMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.showcase.v1beta1.UpdateRoomRequest, + com.google.showcase.v1beta1.Room>(service, METHODID_UPDATE_ROOM))) + .addMethod( + getDeleteRoomMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.showcase.v1beta1.DeleteRoomRequest, com.google.protobuf.Empty>( + service, METHODID_DELETE_ROOM))) + .addMethod( + getListRoomsMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.showcase.v1beta1.ListRoomsRequest, + com.google.showcase.v1beta1.ListRoomsResponse>(service, METHODID_LIST_ROOMS))) + .addMethod( + getCreateBlurbMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.showcase.v1beta1.CreateBlurbRequest, + com.google.showcase.v1beta1.Blurb>(service, METHODID_CREATE_BLURB))) + .addMethod( + getGetBlurbMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.showcase.v1beta1.GetBlurbRequest, com.google.showcase.v1beta1.Blurb>( + service, METHODID_GET_BLURB))) + .addMethod( + getUpdateBlurbMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.showcase.v1beta1.UpdateBlurbRequest, + com.google.showcase.v1beta1.Blurb>(service, METHODID_UPDATE_BLURB))) + .addMethod( + getDeleteBlurbMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.showcase.v1beta1.DeleteBlurbRequest, com.google.protobuf.Empty>( + service, METHODID_DELETE_BLURB))) + .addMethod( + getListBlurbsMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.showcase.v1beta1.ListBlurbsRequest, + com.google.showcase.v1beta1.ListBlurbsResponse>(service, METHODID_LIST_BLURBS))) + .addMethod( + getSearchBlurbsMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.showcase.v1beta1.SearchBlurbsRequest, + com.google.longrunning.Operation>(service, METHODID_SEARCH_BLURBS))) + .addMethod( + getStreamBlurbsMethod(), + io.grpc.stub.ServerCalls.asyncServerStreamingCall( + new MethodHandlers< + com.google.showcase.v1beta1.StreamBlurbsRequest, + com.google.showcase.v1beta1.StreamBlurbsResponse>( + service, METHODID_STREAM_BLURBS))) + .addMethod( + getSendBlurbsMethod(), + io.grpc.stub.ServerCalls.asyncClientStreamingCall( + new MethodHandlers< + com.google.showcase.v1beta1.CreateBlurbRequest, + com.google.showcase.v1beta1.SendBlurbsResponse>(service, METHODID_SEND_BLURBS))) + .addMethod( + getConnectMethod(), + io.grpc.stub.ServerCalls.asyncBidiStreamingCall( + new MethodHandlers< + com.google.showcase.v1beta1.ConnectRequest, + com.google.showcase.v1beta1.StreamBlurbsResponse>(service, METHODID_CONNECT))) + .build(); + } + + private abstract static class MessagingBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoFileDescriptorSupplier, + io.grpc.protobuf.ProtoServiceDescriptorSupplier { + MessagingBaseDescriptorSupplier() {} + + @java.lang.Override + public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() { + return com.google.showcase.v1beta1.MessagingOuterClass.getDescriptor(); + } + + @java.lang.Override + public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() { + return getFileDescriptor().findServiceByName("Messaging"); + } + } + + private static final class MessagingFileDescriptorSupplier + extends MessagingBaseDescriptorSupplier { + MessagingFileDescriptorSupplier() {} + } + + private static final class MessagingMethodDescriptorSupplier + extends MessagingBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoMethodDescriptorSupplier { + private final java.lang.String methodName; + + MessagingMethodDescriptorSupplier(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 (MessagingGrpc.class) { + result = serviceDescriptor; + if (result == null) { + serviceDescriptor = + result = + io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME) + .setSchemaDescriptor(new MessagingFileDescriptorSupplier()) + .addMethod(getCreateRoomMethod()) + .addMethod(getGetRoomMethod()) + .addMethod(getUpdateRoomMethod()) + .addMethod(getDeleteRoomMethod()) + .addMethod(getListRoomsMethod()) + .addMethod(getCreateBlurbMethod()) + .addMethod(getGetBlurbMethod()) + .addMethod(getUpdateBlurbMethod()) + .addMethod(getDeleteBlurbMethod()) + .addMethod(getListBlurbsMethod()) + .addMethod(getSearchBlurbsMethod()) + .addMethod(getStreamBlurbsMethod()) + .addMethod(getSendBlurbsMethod()) + .addMethod(getConnectMethod()) + .build(); + } + } + } + return result; + } +} diff --git a/java-showcase-3.21.0/grpc-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/SequenceServiceGrpc.java b/java-showcase-3.21.0/grpc-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/SequenceServiceGrpc.java new file mode 100644 index 0000000000..7172cf958f --- /dev/null +++ b/java-showcase-3.21.0/grpc-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/SequenceServiceGrpc.java @@ -0,0 +1,1045 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.showcase.v1beta1; + +import static io.grpc.MethodDescriptor.generateFullMethodName; + +/** */ +@io.grpc.stub.annotations.GrpcGenerated +public final class SequenceServiceGrpc { + + private SequenceServiceGrpc() {} + + public static final java.lang.String SERVICE_NAME = "google.showcase.v1beta1.SequenceService"; + + // Static method descriptors that strictly reflect the proto. + private static volatile io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.CreateSequenceRequest, com.google.showcase.v1beta1.Sequence> + getCreateSequenceMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "CreateSequence", + requestType = com.google.showcase.v1beta1.CreateSequenceRequest.class, + responseType = com.google.showcase.v1beta1.Sequence.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.CreateSequenceRequest, com.google.showcase.v1beta1.Sequence> + getCreateSequenceMethod() { + io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.CreateSequenceRequest, com.google.showcase.v1beta1.Sequence> + getCreateSequenceMethod; + if ((getCreateSequenceMethod = SequenceServiceGrpc.getCreateSequenceMethod) == null) { + synchronized (SequenceServiceGrpc.class) { + if ((getCreateSequenceMethod = SequenceServiceGrpc.getCreateSequenceMethod) == null) { + SequenceServiceGrpc.getCreateSequenceMethod = + getCreateSequenceMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "CreateSequence")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.CreateSequenceRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.Sequence.getDefaultInstance())) + .setSchemaDescriptor( + new SequenceServiceMethodDescriptorSupplier("CreateSequence")) + .build(); + } + } + } + return getCreateSequenceMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.CreateStreamingSequenceRequest, + com.google.showcase.v1beta1.StreamingSequence> + getCreateStreamingSequenceMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "CreateStreamingSequence", + requestType = com.google.showcase.v1beta1.CreateStreamingSequenceRequest.class, + responseType = com.google.showcase.v1beta1.StreamingSequence.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.CreateStreamingSequenceRequest, + com.google.showcase.v1beta1.StreamingSequence> + getCreateStreamingSequenceMethod() { + io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.CreateStreamingSequenceRequest, + com.google.showcase.v1beta1.StreamingSequence> + getCreateStreamingSequenceMethod; + if ((getCreateStreamingSequenceMethod = SequenceServiceGrpc.getCreateStreamingSequenceMethod) + == null) { + synchronized (SequenceServiceGrpc.class) { + if ((getCreateStreamingSequenceMethod = + SequenceServiceGrpc.getCreateStreamingSequenceMethod) + == null) { + SequenceServiceGrpc.getCreateStreamingSequenceMethod = + getCreateStreamingSequenceMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName(SERVICE_NAME, "CreateStreamingSequence")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.CreateStreamingSequenceRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.StreamingSequence.getDefaultInstance())) + .setSchemaDescriptor( + new SequenceServiceMethodDescriptorSupplier("CreateStreamingSequence")) + .build(); + } + } + } + return getCreateStreamingSequenceMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.GetSequenceReportRequest, + com.google.showcase.v1beta1.SequenceReport> + getGetSequenceReportMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "GetSequenceReport", + requestType = com.google.showcase.v1beta1.GetSequenceReportRequest.class, + responseType = com.google.showcase.v1beta1.SequenceReport.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.GetSequenceReportRequest, + com.google.showcase.v1beta1.SequenceReport> + getGetSequenceReportMethod() { + io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.GetSequenceReportRequest, + com.google.showcase.v1beta1.SequenceReport> + getGetSequenceReportMethod; + if ((getGetSequenceReportMethod = SequenceServiceGrpc.getGetSequenceReportMethod) == null) { + synchronized (SequenceServiceGrpc.class) { + if ((getGetSequenceReportMethod = SequenceServiceGrpc.getGetSequenceReportMethod) == null) { + SequenceServiceGrpc.getGetSequenceReportMethod = + getGetSequenceReportMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetSequenceReport")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.GetSequenceReportRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.SequenceReport.getDefaultInstance())) + .setSchemaDescriptor( + new SequenceServiceMethodDescriptorSupplier("GetSequenceReport")) + .build(); + } + } + } + return getGetSequenceReportMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.GetStreamingSequenceReportRequest, + com.google.showcase.v1beta1.StreamingSequenceReport> + getGetStreamingSequenceReportMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "GetStreamingSequenceReport", + requestType = com.google.showcase.v1beta1.GetStreamingSequenceReportRequest.class, + responseType = com.google.showcase.v1beta1.StreamingSequenceReport.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.GetStreamingSequenceReportRequest, + com.google.showcase.v1beta1.StreamingSequenceReport> + getGetStreamingSequenceReportMethod() { + io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.GetStreamingSequenceReportRequest, + com.google.showcase.v1beta1.StreamingSequenceReport> + getGetStreamingSequenceReportMethod; + if ((getGetStreamingSequenceReportMethod = + SequenceServiceGrpc.getGetStreamingSequenceReportMethod) + == null) { + synchronized (SequenceServiceGrpc.class) { + if ((getGetStreamingSequenceReportMethod = + SequenceServiceGrpc.getGetStreamingSequenceReportMethod) + == null) { + SequenceServiceGrpc.getGetStreamingSequenceReportMethod = + getGetStreamingSequenceReportMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName(SERVICE_NAME, "GetStreamingSequenceReport")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.GetStreamingSequenceReportRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.StreamingSequenceReport + .getDefaultInstance())) + .setSchemaDescriptor( + new SequenceServiceMethodDescriptorSupplier("GetStreamingSequenceReport")) + .build(); + } + } + } + return getGetStreamingSequenceReportMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.AttemptSequenceRequest, com.google.protobuf.Empty> + getAttemptSequenceMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "AttemptSequence", + requestType = com.google.showcase.v1beta1.AttemptSequenceRequest.class, + responseType = com.google.protobuf.Empty.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.AttemptSequenceRequest, com.google.protobuf.Empty> + getAttemptSequenceMethod() { + io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.AttemptSequenceRequest, com.google.protobuf.Empty> + getAttemptSequenceMethod; + if ((getAttemptSequenceMethod = SequenceServiceGrpc.getAttemptSequenceMethod) == null) { + synchronized (SequenceServiceGrpc.class) { + if ((getAttemptSequenceMethod = SequenceServiceGrpc.getAttemptSequenceMethod) == null) { + SequenceServiceGrpc.getAttemptSequenceMethod = + getAttemptSequenceMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "AttemptSequence")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.AttemptSequenceRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.protobuf.Empty.getDefaultInstance())) + .setSchemaDescriptor( + new SequenceServiceMethodDescriptorSupplier("AttemptSequence")) + .build(); + } + } + } + return getAttemptSequenceMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.AttemptStreamingSequenceRequest, + com.google.showcase.v1beta1.AttemptStreamingSequenceResponse> + getAttemptStreamingSequenceMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "AttemptStreamingSequence", + requestType = com.google.showcase.v1beta1.AttemptStreamingSequenceRequest.class, + responseType = com.google.showcase.v1beta1.AttemptStreamingSequenceResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.SERVER_STREAMING) + public static io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.AttemptStreamingSequenceRequest, + com.google.showcase.v1beta1.AttemptStreamingSequenceResponse> + getAttemptStreamingSequenceMethod() { + io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.AttemptStreamingSequenceRequest, + com.google.showcase.v1beta1.AttemptStreamingSequenceResponse> + getAttemptStreamingSequenceMethod; + if ((getAttemptStreamingSequenceMethod = SequenceServiceGrpc.getAttemptStreamingSequenceMethod) + == null) { + synchronized (SequenceServiceGrpc.class) { + if ((getAttemptStreamingSequenceMethod = + SequenceServiceGrpc.getAttemptStreamingSequenceMethod) + == null) { + SequenceServiceGrpc.getAttemptStreamingSequenceMethod = + getAttemptStreamingSequenceMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.SERVER_STREAMING) + .setFullMethodName( + generateFullMethodName(SERVICE_NAME, "AttemptStreamingSequence")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.AttemptStreamingSequenceRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.AttemptStreamingSequenceResponse + .getDefaultInstance())) + .setSchemaDescriptor( + new SequenceServiceMethodDescriptorSupplier("AttemptStreamingSequence")) + .build(); + } + } + } + return getAttemptStreamingSequenceMethod; + } + + /** Creates a new async stub that supports all call types for the service */ + public static SequenceServiceStub newStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public SequenceServiceStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new SequenceServiceStub(channel, callOptions); + } + }; + return SequenceServiceStub.newStub(factory, channel); + } + + /** Creates a new blocking-style stub that supports all types of calls on the service */ + public static SequenceServiceBlockingV2Stub newBlockingV2Stub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public SequenceServiceBlockingV2Stub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new SequenceServiceBlockingV2Stub(channel, callOptions); + } + }; + return SequenceServiceBlockingV2Stub.newStub(factory, channel); + } + + /** + * Creates a new blocking-style stub that supports unary and streaming output calls on the service + */ + public static SequenceServiceBlockingStub newBlockingStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public SequenceServiceBlockingStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new SequenceServiceBlockingStub(channel, callOptions); + } + }; + return SequenceServiceBlockingStub.newStub(factory, channel); + } + + /** Creates a new ListenableFuture-style stub that supports unary calls on the service */ + public static SequenceServiceFutureStub newFutureStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public SequenceServiceFutureStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new SequenceServiceFutureStub(channel, callOptions); + } + }; + return SequenceServiceFutureStub.newStub(factory, channel); + } + + /** */ + public interface AsyncService { + + /** + * + * + *
        +     * Creates a sequence.
        +     * 
        + */ + default void createSequence( + com.google.showcase.v1beta1.CreateSequenceRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getCreateSequenceMethod(), responseObserver); + } + + /** + * + * + *
        +     * Creates a sequence.
        +     * 
        + */ + default void createStreamingSequence( + com.google.showcase.v1beta1.CreateStreamingSequenceRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getCreateStreamingSequenceMethod(), responseObserver); + } + + /** + * + * + *
        +     * Retrieves a sequence.
        +     * 
        + */ + default void getSequenceReport( + com.google.showcase.v1beta1.GetSequenceReportRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getGetSequenceReportMethod(), responseObserver); + } + + /** + * + * + *
        +     * Retrieves a sequence.
        +     * 
        + */ + default void getStreamingSequenceReport( + com.google.showcase.v1beta1.GetStreamingSequenceReportRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getGetStreamingSequenceReportMethod(), responseObserver); + } + + /** + * + * + *
        +     * Attempts a sequence.
        +     * 
        + */ + default void attemptSequence( + com.google.showcase.v1beta1.AttemptSequenceRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getAttemptSequenceMethod(), responseObserver); + } + + /** + * + * + *
        +     * Attempts a streaming sequence.
        +     * May not function as expected in HTTP mode due to when http statuses are sent
        +     * See https://github.com/googleapis/gapic-showcase/issues/1377 for more details
        +     * 
        + */ + default void attemptStreamingSequence( + com.google.showcase.v1beta1.AttemptStreamingSequenceRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getAttemptStreamingSequenceMethod(), responseObserver); + } + } + + /** Base class for the server implementation of the service SequenceService. */ + public abstract static class SequenceServiceImplBase + implements io.grpc.BindableService, AsyncService { + + @java.lang.Override + public final io.grpc.ServerServiceDefinition bindService() { + return SequenceServiceGrpc.bindService(this); + } + } + + /** A stub to allow clients to do asynchronous rpc calls to service SequenceService. */ + public static final class SequenceServiceStub + extends io.grpc.stub.AbstractAsyncStub { + private SequenceServiceStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected SequenceServiceStub build(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new SequenceServiceStub(channel, callOptions); + } + + /** + * + * + *
        +     * Creates a sequence.
        +     * 
        + */ + public void createSequence( + com.google.showcase.v1beta1.CreateSequenceRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getCreateSequenceMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
        +     * Creates a sequence.
        +     * 
        + */ + public void createStreamingSequence( + com.google.showcase.v1beta1.CreateStreamingSequenceRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getCreateStreamingSequenceMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
        +     * Retrieves a sequence.
        +     * 
        + */ + public void getSequenceReport( + com.google.showcase.v1beta1.GetSequenceReportRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getGetSequenceReportMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
        +     * Retrieves a sequence.
        +     * 
        + */ + public void getStreamingSequenceReport( + com.google.showcase.v1beta1.GetStreamingSequenceReportRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getGetStreamingSequenceReportMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
        +     * Attempts a sequence.
        +     * 
        + */ + public void attemptSequence( + com.google.showcase.v1beta1.AttemptSequenceRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getAttemptSequenceMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
        +     * Attempts a streaming sequence.
        +     * May not function as expected in HTTP mode due to when http statuses are sent
        +     * See https://github.com/googleapis/gapic-showcase/issues/1377 for more details
        +     * 
        + */ + public void attemptStreamingSequence( + com.google.showcase.v1beta1.AttemptStreamingSequenceRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncServerStreamingCall( + getChannel().newCall(getAttemptStreamingSequenceMethod(), getCallOptions()), + request, + responseObserver); + } + } + + /** A stub to allow clients to do synchronous rpc calls to service SequenceService. */ + public static final class SequenceServiceBlockingV2Stub + extends io.grpc.stub.AbstractBlockingStub { + private SequenceServiceBlockingV2Stub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected SequenceServiceBlockingV2Stub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new SequenceServiceBlockingV2Stub(channel, callOptions); + } + + /** + * + * + *
        +     * Creates a sequence.
        +     * 
        + */ + public com.google.showcase.v1beta1.Sequence createSequence( + com.google.showcase.v1beta1.CreateSequenceRequest request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getCreateSequenceMethod(), getCallOptions(), request); + } + + /** + * + * + *
        +     * Creates a sequence.
        +     * 
        + */ + public com.google.showcase.v1beta1.StreamingSequence createStreamingSequence( + com.google.showcase.v1beta1.CreateStreamingSequenceRequest request) + throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getCreateStreamingSequenceMethod(), getCallOptions(), request); + } + + /** + * + * + *
        +     * Retrieves a sequence.
        +     * 
        + */ + public com.google.showcase.v1beta1.SequenceReport getSequenceReport( + com.google.showcase.v1beta1.GetSequenceReportRequest request) + throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getGetSequenceReportMethod(), getCallOptions(), request); + } + + /** + * + * + *
        +     * Retrieves a sequence.
        +     * 
        + */ + public com.google.showcase.v1beta1.StreamingSequenceReport getStreamingSequenceReport( + com.google.showcase.v1beta1.GetStreamingSequenceReportRequest request) + throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getGetStreamingSequenceReportMethod(), getCallOptions(), request); + } + + /** + * + * + *
        +     * Attempts a sequence.
        +     * 
        + */ + public com.google.protobuf.Empty attemptSequence( + com.google.showcase.v1beta1.AttemptSequenceRequest request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getAttemptSequenceMethod(), getCallOptions(), request); + } + + /** + * + * + *
        +     * Attempts a streaming sequence.
        +     * May not function as expected in HTTP mode due to when http statuses are sent
        +     * See https://github.com/googleapis/gapic-showcase/issues/1377 for more details
        +     * 
        + */ + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/10918") + public io.grpc.stub.BlockingClientCall< + ?, com.google.showcase.v1beta1.AttemptStreamingSequenceResponse> + attemptStreamingSequence( + com.google.showcase.v1beta1.AttemptStreamingSequenceRequest request) { + return io.grpc.stub.ClientCalls.blockingV2ServerStreamingCall( + getChannel(), getAttemptStreamingSequenceMethod(), getCallOptions(), request); + } + } + + /** A stub to allow clients to do limited synchronous rpc calls to service SequenceService. */ + public static final class SequenceServiceBlockingStub + extends io.grpc.stub.AbstractBlockingStub { + private SequenceServiceBlockingStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected SequenceServiceBlockingStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new SequenceServiceBlockingStub(channel, callOptions); + } + + /** + * + * + *
        +     * Creates a sequence.
        +     * 
        + */ + public com.google.showcase.v1beta1.Sequence createSequence( + com.google.showcase.v1beta1.CreateSequenceRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getCreateSequenceMethod(), getCallOptions(), request); + } + + /** + * + * + *
        +     * Creates a sequence.
        +     * 
        + */ + public com.google.showcase.v1beta1.StreamingSequence createStreamingSequence( + com.google.showcase.v1beta1.CreateStreamingSequenceRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getCreateStreamingSequenceMethod(), getCallOptions(), request); + } + + /** + * + * + *
        +     * Retrieves a sequence.
        +     * 
        + */ + public com.google.showcase.v1beta1.SequenceReport getSequenceReport( + com.google.showcase.v1beta1.GetSequenceReportRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getGetSequenceReportMethod(), getCallOptions(), request); + } + + /** + * + * + *
        +     * Retrieves a sequence.
        +     * 
        + */ + public com.google.showcase.v1beta1.StreamingSequenceReport getStreamingSequenceReport( + com.google.showcase.v1beta1.GetStreamingSequenceReportRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getGetStreamingSequenceReportMethod(), getCallOptions(), request); + } + + /** + * + * + *
        +     * Attempts a sequence.
        +     * 
        + */ + public com.google.protobuf.Empty attemptSequence( + com.google.showcase.v1beta1.AttemptSequenceRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getAttemptSequenceMethod(), getCallOptions(), request); + } + + /** + * + * + *
        +     * Attempts a streaming sequence.
        +     * May not function as expected in HTTP mode due to when http statuses are sent
        +     * See https://github.com/googleapis/gapic-showcase/issues/1377 for more details
        +     * 
        + */ + public java.util.Iterator + attemptStreamingSequence( + com.google.showcase.v1beta1.AttemptStreamingSequenceRequest request) { + return io.grpc.stub.ClientCalls.blockingServerStreamingCall( + getChannel(), getAttemptStreamingSequenceMethod(), getCallOptions(), request); + } + } + + /** A stub to allow clients to do ListenableFuture-style rpc calls to service SequenceService. */ + public static final class SequenceServiceFutureStub + extends io.grpc.stub.AbstractFutureStub { + private SequenceServiceFutureStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected SequenceServiceFutureStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new SequenceServiceFutureStub(channel, callOptions); + } + + /** + * + * + *
        +     * Creates a sequence.
        +     * 
        + */ + public com.google.common.util.concurrent.ListenableFuture + createSequence(com.google.showcase.v1beta1.CreateSequenceRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getCreateSequenceMethod(), getCallOptions()), request); + } + + /** + * + * + *
        +     * Creates a sequence.
        +     * 
        + */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.showcase.v1beta1.StreamingSequence> + createStreamingSequence( + com.google.showcase.v1beta1.CreateStreamingSequenceRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getCreateStreamingSequenceMethod(), getCallOptions()), request); + } + + /** + * + * + *
        +     * Retrieves a sequence.
        +     * 
        + */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.showcase.v1beta1.SequenceReport> + getSequenceReport(com.google.showcase.v1beta1.GetSequenceReportRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getGetSequenceReportMethod(), getCallOptions()), request); + } + + /** + * + * + *
        +     * Retrieves a sequence.
        +     * 
        + */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.showcase.v1beta1.StreamingSequenceReport> + getStreamingSequenceReport( + com.google.showcase.v1beta1.GetStreamingSequenceReportRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getGetStreamingSequenceReportMethod(), getCallOptions()), request); + } + + /** + * + * + *
        +     * Attempts a sequence.
        +     * 
        + */ + public com.google.common.util.concurrent.ListenableFuture + attemptSequence(com.google.showcase.v1beta1.AttemptSequenceRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getAttemptSequenceMethod(), getCallOptions()), request); + } + } + + private static final int METHODID_CREATE_SEQUENCE = 0; + private static final int METHODID_CREATE_STREAMING_SEQUENCE = 1; + private static final int METHODID_GET_SEQUENCE_REPORT = 2; + private static final int METHODID_GET_STREAMING_SEQUENCE_REPORT = 3; + private static final int METHODID_ATTEMPT_SEQUENCE = 4; + private static final int METHODID_ATTEMPT_STREAMING_SEQUENCE = 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_CREATE_SEQUENCE: + serviceImpl.createSequence( + (com.google.showcase.v1beta1.CreateSequenceRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_CREATE_STREAMING_SEQUENCE: + serviceImpl.createStreamingSequence( + (com.google.showcase.v1beta1.CreateStreamingSequenceRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_GET_SEQUENCE_REPORT: + serviceImpl.getSequenceReport( + (com.google.showcase.v1beta1.GetSequenceReportRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_GET_STREAMING_SEQUENCE_REPORT: + serviceImpl.getStreamingSequenceReport( + (com.google.showcase.v1beta1.GetStreamingSequenceReportRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_ATTEMPT_SEQUENCE: + serviceImpl.attemptSequence( + (com.google.showcase.v1beta1.AttemptSequenceRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_ATTEMPT_STREAMING_SEQUENCE: + serviceImpl.attemptStreamingSequence( + (com.google.showcase.v1beta1.AttemptStreamingSequenceRequest) request, + (io.grpc.stub.StreamObserver< + com.google.showcase.v1beta1.AttemptStreamingSequenceResponse>) + 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( + getCreateSequenceMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.showcase.v1beta1.CreateSequenceRequest, + com.google.showcase.v1beta1.Sequence>(service, METHODID_CREATE_SEQUENCE))) + .addMethod( + getCreateStreamingSequenceMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.showcase.v1beta1.CreateStreamingSequenceRequest, + com.google.showcase.v1beta1.StreamingSequence>( + service, METHODID_CREATE_STREAMING_SEQUENCE))) + .addMethod( + getGetSequenceReportMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.showcase.v1beta1.GetSequenceReportRequest, + com.google.showcase.v1beta1.SequenceReport>( + service, METHODID_GET_SEQUENCE_REPORT))) + .addMethod( + getGetStreamingSequenceReportMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.showcase.v1beta1.GetStreamingSequenceReportRequest, + com.google.showcase.v1beta1.StreamingSequenceReport>( + service, METHODID_GET_STREAMING_SEQUENCE_REPORT))) + .addMethod( + getAttemptSequenceMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.showcase.v1beta1.AttemptSequenceRequest, com.google.protobuf.Empty>( + service, METHODID_ATTEMPT_SEQUENCE))) + .addMethod( + getAttemptStreamingSequenceMethod(), + io.grpc.stub.ServerCalls.asyncServerStreamingCall( + new MethodHandlers< + com.google.showcase.v1beta1.AttemptStreamingSequenceRequest, + com.google.showcase.v1beta1.AttemptStreamingSequenceResponse>( + service, METHODID_ATTEMPT_STREAMING_SEQUENCE))) + .build(); + } + + private abstract static class SequenceServiceBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoFileDescriptorSupplier, + io.grpc.protobuf.ProtoServiceDescriptorSupplier { + SequenceServiceBaseDescriptorSupplier() {} + + @java.lang.Override + public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() { + return com.google.showcase.v1beta1.SequenceOuterClass.getDescriptor(); + } + + @java.lang.Override + public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() { + return getFileDescriptor().findServiceByName("SequenceService"); + } + } + + private static final class SequenceServiceFileDescriptorSupplier + extends SequenceServiceBaseDescriptorSupplier { + SequenceServiceFileDescriptorSupplier() {} + } + + private static final class SequenceServiceMethodDescriptorSupplier + extends SequenceServiceBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoMethodDescriptorSupplier { + private final java.lang.String methodName; + + SequenceServiceMethodDescriptorSupplier(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 (SequenceServiceGrpc.class) { + result = serviceDescriptor; + if (result == null) { + serviceDescriptor = + result = + io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME) + .setSchemaDescriptor(new SequenceServiceFileDescriptorSupplier()) + .addMethod(getCreateSequenceMethod()) + .addMethod(getCreateStreamingSequenceMethod()) + .addMethod(getGetSequenceReportMethod()) + .addMethod(getGetStreamingSequenceReportMethod()) + .addMethod(getAttemptSequenceMethod()) + .addMethod(getAttemptStreamingSequenceMethod()) + .build(); + } + } + } + return result; + } +} diff --git a/java-showcase-3.21.0/grpc-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/TestingGrpc.java b/java-showcase-3.21.0/grpc-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/TestingGrpc.java new file mode 100644 index 0000000000..36f60a584b --- /dev/null +++ b/java-showcase-3.21.0/grpc-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/TestingGrpc.java @@ -0,0 +1,1363 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.showcase.v1beta1; + +import static io.grpc.MethodDescriptor.generateFullMethodName; + +/** + * + * + *
        + * A service to facilitate running discrete sets of tests
        + * against Showcase.
        + * Adding this comment with special characters for comment formatting tests:
        + * 1. (abra->kadabra->alakazam)
        + * 2) [Nonsense][]: `pokemon/*/psychic/*`
        + * 
        + */ +@io.grpc.stub.annotations.GrpcGenerated +public final class TestingGrpc { + + private TestingGrpc() {} + + public static final java.lang.String SERVICE_NAME = "google.showcase.v1beta1.Testing"; + + // Static method descriptors that strictly reflect the proto. + private static volatile io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.CreateSessionRequest, com.google.showcase.v1beta1.Session> + getCreateSessionMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "CreateSession", + requestType = com.google.showcase.v1beta1.CreateSessionRequest.class, + responseType = com.google.showcase.v1beta1.Session.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.CreateSessionRequest, com.google.showcase.v1beta1.Session> + getCreateSessionMethod() { + io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.CreateSessionRequest, com.google.showcase.v1beta1.Session> + getCreateSessionMethod; + if ((getCreateSessionMethod = TestingGrpc.getCreateSessionMethod) == null) { + synchronized (TestingGrpc.class) { + if ((getCreateSessionMethod = TestingGrpc.getCreateSessionMethod) == null) { + TestingGrpc.getCreateSessionMethod = + getCreateSessionMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "CreateSession")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.CreateSessionRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.Session.getDefaultInstance())) + .setSchemaDescriptor(new TestingMethodDescriptorSupplier("CreateSession")) + .build(); + } + } + } + return getCreateSessionMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.GetSessionRequest, com.google.showcase.v1beta1.Session> + getGetSessionMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "GetSession", + requestType = com.google.showcase.v1beta1.GetSessionRequest.class, + responseType = com.google.showcase.v1beta1.Session.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.GetSessionRequest, com.google.showcase.v1beta1.Session> + getGetSessionMethod() { + io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.GetSessionRequest, com.google.showcase.v1beta1.Session> + getGetSessionMethod; + if ((getGetSessionMethod = TestingGrpc.getGetSessionMethod) == null) { + synchronized (TestingGrpc.class) { + if ((getGetSessionMethod = TestingGrpc.getGetSessionMethod) == null) { + TestingGrpc.getGetSessionMethod = + getGetSessionMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetSession")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.GetSessionRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.Session.getDefaultInstance())) + .setSchemaDescriptor(new TestingMethodDescriptorSupplier("GetSession")) + .build(); + } + } + } + return getGetSessionMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.ListSessionsRequest, + com.google.showcase.v1beta1.ListSessionsResponse> + getListSessionsMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "ListSessions", + requestType = com.google.showcase.v1beta1.ListSessionsRequest.class, + responseType = com.google.showcase.v1beta1.ListSessionsResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.ListSessionsRequest, + com.google.showcase.v1beta1.ListSessionsResponse> + getListSessionsMethod() { + io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.ListSessionsRequest, + com.google.showcase.v1beta1.ListSessionsResponse> + getListSessionsMethod; + if ((getListSessionsMethod = TestingGrpc.getListSessionsMethod) == null) { + synchronized (TestingGrpc.class) { + if ((getListSessionsMethod = TestingGrpc.getListSessionsMethod) == null) { + TestingGrpc.getListSessionsMethod = + getListSessionsMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "ListSessions")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.ListSessionsRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.ListSessionsResponse + .getDefaultInstance())) + .setSchemaDescriptor(new TestingMethodDescriptorSupplier("ListSessions")) + .build(); + } + } + } + return getListSessionsMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.DeleteSessionRequest, com.google.protobuf.Empty> + getDeleteSessionMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "DeleteSession", + requestType = com.google.showcase.v1beta1.DeleteSessionRequest.class, + responseType = com.google.protobuf.Empty.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.DeleteSessionRequest, com.google.protobuf.Empty> + getDeleteSessionMethod() { + io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.DeleteSessionRequest, com.google.protobuf.Empty> + getDeleteSessionMethod; + if ((getDeleteSessionMethod = TestingGrpc.getDeleteSessionMethod) == null) { + synchronized (TestingGrpc.class) { + if ((getDeleteSessionMethod = TestingGrpc.getDeleteSessionMethod) == null) { + TestingGrpc.getDeleteSessionMethod = + getDeleteSessionMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "DeleteSession")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.DeleteSessionRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.protobuf.Empty.getDefaultInstance())) + .setSchemaDescriptor(new TestingMethodDescriptorSupplier("DeleteSession")) + .build(); + } + } + } + return getDeleteSessionMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.ReportSessionRequest, + com.google.showcase.v1beta1.ReportSessionResponse> + getReportSessionMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "ReportSession", + requestType = com.google.showcase.v1beta1.ReportSessionRequest.class, + responseType = com.google.showcase.v1beta1.ReportSessionResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.ReportSessionRequest, + com.google.showcase.v1beta1.ReportSessionResponse> + getReportSessionMethod() { + io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.ReportSessionRequest, + com.google.showcase.v1beta1.ReportSessionResponse> + getReportSessionMethod; + if ((getReportSessionMethod = TestingGrpc.getReportSessionMethod) == null) { + synchronized (TestingGrpc.class) { + if ((getReportSessionMethod = TestingGrpc.getReportSessionMethod) == null) { + TestingGrpc.getReportSessionMethod = + getReportSessionMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "ReportSession")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.ReportSessionRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.ReportSessionResponse + .getDefaultInstance())) + .setSchemaDescriptor(new TestingMethodDescriptorSupplier("ReportSession")) + .build(); + } + } + } + return getReportSessionMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.ListTestsRequest, + com.google.showcase.v1beta1.ListTestsResponse> + getListTestsMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "ListTests", + requestType = com.google.showcase.v1beta1.ListTestsRequest.class, + responseType = com.google.showcase.v1beta1.ListTestsResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.ListTestsRequest, + com.google.showcase.v1beta1.ListTestsResponse> + getListTestsMethod() { + io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.ListTestsRequest, + com.google.showcase.v1beta1.ListTestsResponse> + getListTestsMethod; + if ((getListTestsMethod = TestingGrpc.getListTestsMethod) == null) { + synchronized (TestingGrpc.class) { + if ((getListTestsMethod = TestingGrpc.getListTestsMethod) == null) { + TestingGrpc.getListTestsMethod = + getListTestsMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "ListTests")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.ListTestsRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.ListTestsResponse.getDefaultInstance())) + .setSchemaDescriptor(new TestingMethodDescriptorSupplier("ListTests")) + .build(); + } + } + } + return getListTestsMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.DeleteTestRequest, com.google.protobuf.Empty> + getDeleteTestMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "DeleteTest", + requestType = com.google.showcase.v1beta1.DeleteTestRequest.class, + responseType = com.google.protobuf.Empty.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.DeleteTestRequest, com.google.protobuf.Empty> + getDeleteTestMethod() { + io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.DeleteTestRequest, com.google.protobuf.Empty> + getDeleteTestMethod; + if ((getDeleteTestMethod = TestingGrpc.getDeleteTestMethod) == null) { + synchronized (TestingGrpc.class) { + if ((getDeleteTestMethod = TestingGrpc.getDeleteTestMethod) == null) { + TestingGrpc.getDeleteTestMethod = + getDeleteTestMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "DeleteTest")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.DeleteTestRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.protobuf.Empty.getDefaultInstance())) + .setSchemaDescriptor(new TestingMethodDescriptorSupplier("DeleteTest")) + .build(); + } + } + } + return getDeleteTestMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.VerifyTestRequest, + com.google.showcase.v1beta1.VerifyTestResponse> + getVerifyTestMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "VerifyTest", + requestType = com.google.showcase.v1beta1.VerifyTestRequest.class, + responseType = com.google.showcase.v1beta1.VerifyTestResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.VerifyTestRequest, + com.google.showcase.v1beta1.VerifyTestResponse> + getVerifyTestMethod() { + io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.VerifyTestRequest, + com.google.showcase.v1beta1.VerifyTestResponse> + getVerifyTestMethod; + if ((getVerifyTestMethod = TestingGrpc.getVerifyTestMethod) == null) { + synchronized (TestingGrpc.class) { + if ((getVerifyTestMethod = TestingGrpc.getVerifyTestMethod) == null) { + TestingGrpc.getVerifyTestMethod = + getVerifyTestMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "VerifyTest")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.VerifyTestRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.VerifyTestResponse.getDefaultInstance())) + .setSchemaDescriptor(new TestingMethodDescriptorSupplier("VerifyTest")) + .build(); + } + } + } + return getVerifyTestMethod; + } + + /** Creates a new async stub that supports all call types for the service */ + public static TestingStub newStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public TestingStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new TestingStub(channel, callOptions); + } + }; + return TestingStub.newStub(factory, channel); + } + + /** Creates a new blocking-style stub that supports all types of calls on the service */ + public static TestingBlockingV2Stub newBlockingV2Stub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public TestingBlockingV2Stub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new TestingBlockingV2Stub(channel, callOptions); + } + }; + return TestingBlockingV2Stub.newStub(factory, channel); + } + + /** + * Creates a new blocking-style stub that supports unary and streaming output calls on the service + */ + public static TestingBlockingStub newBlockingStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public TestingBlockingStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new TestingBlockingStub(channel, callOptions); + } + }; + return TestingBlockingStub.newStub(factory, channel); + } + + /** Creates a new ListenableFuture-style stub that supports unary calls on the service */ + public static TestingFutureStub newFutureStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public TestingFutureStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new TestingFutureStub(channel, callOptions); + } + }; + return TestingFutureStub.newStub(factory, channel); + } + + /** + * + * + *
        +   * A service to facilitate running discrete sets of tests
        +   * against Showcase.
        +   * Adding this comment with special characters for comment formatting tests:
        +   * 1. (abra->kadabra->alakazam)
        +   * 2) [Nonsense][]: `pokemon/*/psychic/*`
        +   * 
        + */ + public interface AsyncService { + + /** + * + * + *
        +     * Creates a new testing session.
        +     * Adding this comment with special characters for comment formatting tests:
        +     * 1. (abra->kadabra->alakazam)
        +     * 2) [Nonsense][]: `pokemon/*/psychic/*`
        +     * 
        + */ + default void createSession( + com.google.showcase.v1beta1.CreateSessionRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getCreateSessionMethod(), responseObserver); + } + + /** + * + * + *
        +     * Gets a testing session.
        +     * 
        + */ + default void getSession( + com.google.showcase.v1beta1.GetSessionRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getGetSessionMethod(), responseObserver); + } + + /** + * + * + *
        +     * Lists the current test sessions.
        +     * 
        + */ + default void listSessions( + com.google.showcase.v1beta1.ListSessionsRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getListSessionsMethod(), responseObserver); + } + + /** + * + * + *
        +     * Delete a test session.
        +     * 
        + */ + default void deleteSession( + com.google.showcase.v1beta1.DeleteSessionRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getDeleteSessionMethod(), responseObserver); + } + + /** + * + * + *
        +     * Report on the status of a session.
        +     * This generates a report detailing which tests have been completed,
        +     * and an overall rollup.
        +     * 
        + */ + default void reportSession( + com.google.showcase.v1beta1.ReportSessionRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getReportSessionMethod(), responseObserver); + } + + /** + * + * + *
        +     * List the tests of a sessesion.
        +     * 
        + */ + default void listTests( + com.google.showcase.v1beta1.ListTestsRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getListTestsMethod(), responseObserver); + } + + /** + * + * + *
        +     * Explicitly decline to implement a test.
        +     * This removes the test from subsequent `ListTests` calls, and
        +     * attempting to do the test will error.
        +     * This method will error if attempting to delete a required test.
        +     * 
        + */ + default void deleteTest( + com.google.showcase.v1beta1.DeleteTestRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getDeleteTestMethod(), responseObserver); + } + + /** + * + * + *
        +     * Register a response to a test.
        +     * In cases where a test involves registering a final answer at the
        +     * end of the test, this method provides the means to do so.
        +     * 
        + */ + default void verifyTest( + com.google.showcase.v1beta1.VerifyTestRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getVerifyTestMethod(), responseObserver); + } + } + + /** + * Base class for the server implementation of the service Testing. + * + *
        +   * A service to facilitate running discrete sets of tests
        +   * against Showcase.
        +   * Adding this comment with special characters for comment formatting tests:
        +   * 1. (abra->kadabra->alakazam)
        +   * 2) [Nonsense][]: `pokemon/*/psychic/*`
        +   * 
        + */ + public abstract static class TestingImplBase implements io.grpc.BindableService, AsyncService { + + @java.lang.Override + public final io.grpc.ServerServiceDefinition bindService() { + return TestingGrpc.bindService(this); + } + } + + /** + * A stub to allow clients to do asynchronous rpc calls to service Testing. + * + *
        +   * A service to facilitate running discrete sets of tests
        +   * against Showcase.
        +   * Adding this comment with special characters for comment formatting tests:
        +   * 1. (abra->kadabra->alakazam)
        +   * 2) [Nonsense][]: `pokemon/*/psychic/*`
        +   * 
        + */ + public static final class TestingStub extends io.grpc.stub.AbstractAsyncStub { + private TestingStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected TestingStub build(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new TestingStub(channel, callOptions); + } + + /** + * + * + *
        +     * Creates a new testing session.
        +     * Adding this comment with special characters for comment formatting tests:
        +     * 1. (abra->kadabra->alakazam)
        +     * 2) [Nonsense][]: `pokemon/*/psychic/*`
        +     * 
        + */ + public void createSession( + com.google.showcase.v1beta1.CreateSessionRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getCreateSessionMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
        +     * Gets a testing session.
        +     * 
        + */ + public void getSession( + com.google.showcase.v1beta1.GetSessionRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getGetSessionMethod(), getCallOptions()), request, responseObserver); + } + + /** + * + * + *
        +     * Lists the current test sessions.
        +     * 
        + */ + public void listSessions( + com.google.showcase.v1beta1.ListSessionsRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getListSessionsMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
        +     * Delete a test session.
        +     * 
        + */ + public void deleteSession( + com.google.showcase.v1beta1.DeleteSessionRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getDeleteSessionMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
        +     * Report on the status of a session.
        +     * This generates a report detailing which tests have been completed,
        +     * and an overall rollup.
        +     * 
        + */ + public void reportSession( + com.google.showcase.v1beta1.ReportSessionRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getReportSessionMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
        +     * List the tests of a sessesion.
        +     * 
        + */ + public void listTests( + com.google.showcase.v1beta1.ListTestsRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getListTestsMethod(), getCallOptions()), request, responseObserver); + } + + /** + * + * + *
        +     * Explicitly decline to implement a test.
        +     * This removes the test from subsequent `ListTests` calls, and
        +     * attempting to do the test will error.
        +     * This method will error if attempting to delete a required test.
        +     * 
        + */ + public void deleteTest( + com.google.showcase.v1beta1.DeleteTestRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getDeleteTestMethod(), getCallOptions()), request, responseObserver); + } + + /** + * + * + *
        +     * Register a response to a test.
        +     * In cases where a test involves registering a final answer at the
        +     * end of the test, this method provides the means to do so.
        +     * 
        + */ + public void verifyTest( + com.google.showcase.v1beta1.VerifyTestRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getVerifyTestMethod(), getCallOptions()), request, responseObserver); + } + } + + /** + * A stub to allow clients to do synchronous rpc calls to service Testing. + * + *
        +   * A service to facilitate running discrete sets of tests
        +   * against Showcase.
        +   * Adding this comment with special characters for comment formatting tests:
        +   * 1. (abra->kadabra->alakazam)
        +   * 2) [Nonsense][]: `pokemon/*/psychic/*`
        +   * 
        + */ + public static final class TestingBlockingV2Stub + extends io.grpc.stub.AbstractBlockingStub { + private TestingBlockingV2Stub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected TestingBlockingV2Stub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new TestingBlockingV2Stub(channel, callOptions); + } + + /** + * + * + *
        +     * Creates a new testing session.
        +     * Adding this comment with special characters for comment formatting tests:
        +     * 1. (abra->kadabra->alakazam)
        +     * 2) [Nonsense][]: `pokemon/*/psychic/*`
        +     * 
        + */ + public com.google.showcase.v1beta1.Session createSession( + com.google.showcase.v1beta1.CreateSessionRequest request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getCreateSessionMethod(), getCallOptions(), request); + } + + /** + * + * + *
        +     * Gets a testing session.
        +     * 
        + */ + public com.google.showcase.v1beta1.Session getSession( + com.google.showcase.v1beta1.GetSessionRequest request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getGetSessionMethod(), getCallOptions(), request); + } + + /** + * + * + *
        +     * Lists the current test sessions.
        +     * 
        + */ + public com.google.showcase.v1beta1.ListSessionsResponse listSessions( + com.google.showcase.v1beta1.ListSessionsRequest request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getListSessionsMethod(), getCallOptions(), request); + } + + /** + * + * + *
        +     * Delete a test session.
        +     * 
        + */ + public com.google.protobuf.Empty deleteSession( + com.google.showcase.v1beta1.DeleteSessionRequest request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getDeleteSessionMethod(), getCallOptions(), request); + } + + /** + * + * + *
        +     * Report on the status of a session.
        +     * This generates a report detailing which tests have been completed,
        +     * and an overall rollup.
        +     * 
        + */ + public com.google.showcase.v1beta1.ReportSessionResponse reportSession( + com.google.showcase.v1beta1.ReportSessionRequest request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getReportSessionMethod(), getCallOptions(), request); + } + + /** + * + * + *
        +     * List the tests of a sessesion.
        +     * 
        + */ + public com.google.showcase.v1beta1.ListTestsResponse listTests( + com.google.showcase.v1beta1.ListTestsRequest request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getListTestsMethod(), getCallOptions(), request); + } + + /** + * + * + *
        +     * Explicitly decline to implement a test.
        +     * This removes the test from subsequent `ListTests` calls, and
        +     * attempting to do the test will error.
        +     * This method will error if attempting to delete a required test.
        +     * 
        + */ + public com.google.protobuf.Empty deleteTest( + com.google.showcase.v1beta1.DeleteTestRequest request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getDeleteTestMethod(), getCallOptions(), request); + } + + /** + * + * + *
        +     * Register a response to a test.
        +     * In cases where a test involves registering a final answer at the
        +     * end of the test, this method provides the means to do so.
        +     * 
        + */ + public com.google.showcase.v1beta1.VerifyTestResponse verifyTest( + com.google.showcase.v1beta1.VerifyTestRequest request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getVerifyTestMethod(), getCallOptions(), request); + } + } + + /** + * A stub to allow clients to do limited synchronous rpc calls to service Testing. + * + *
        +   * A service to facilitate running discrete sets of tests
        +   * against Showcase.
        +   * Adding this comment with special characters for comment formatting tests:
        +   * 1. (abra->kadabra->alakazam)
        +   * 2) [Nonsense][]: `pokemon/*/psychic/*`
        +   * 
        + */ + public static final class TestingBlockingStub + extends io.grpc.stub.AbstractBlockingStub { + private TestingBlockingStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected TestingBlockingStub build(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new TestingBlockingStub(channel, callOptions); + } + + /** + * + * + *
        +     * Creates a new testing session.
        +     * Adding this comment with special characters for comment formatting tests:
        +     * 1. (abra->kadabra->alakazam)
        +     * 2) [Nonsense][]: `pokemon/*/psychic/*`
        +     * 
        + */ + public com.google.showcase.v1beta1.Session createSession( + com.google.showcase.v1beta1.CreateSessionRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getCreateSessionMethod(), getCallOptions(), request); + } + + /** + * + * + *
        +     * Gets a testing session.
        +     * 
        + */ + public com.google.showcase.v1beta1.Session getSession( + com.google.showcase.v1beta1.GetSessionRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getGetSessionMethod(), getCallOptions(), request); + } + + /** + * + * + *
        +     * Lists the current test sessions.
        +     * 
        + */ + public com.google.showcase.v1beta1.ListSessionsResponse listSessions( + com.google.showcase.v1beta1.ListSessionsRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getListSessionsMethod(), getCallOptions(), request); + } + + /** + * + * + *
        +     * Delete a test session.
        +     * 
        + */ + public com.google.protobuf.Empty deleteSession( + com.google.showcase.v1beta1.DeleteSessionRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getDeleteSessionMethod(), getCallOptions(), request); + } + + /** + * + * + *
        +     * Report on the status of a session.
        +     * This generates a report detailing which tests have been completed,
        +     * and an overall rollup.
        +     * 
        + */ + public com.google.showcase.v1beta1.ReportSessionResponse reportSession( + com.google.showcase.v1beta1.ReportSessionRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getReportSessionMethod(), getCallOptions(), request); + } + + /** + * + * + *
        +     * List the tests of a sessesion.
        +     * 
        + */ + public com.google.showcase.v1beta1.ListTestsResponse listTests( + com.google.showcase.v1beta1.ListTestsRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getListTestsMethod(), getCallOptions(), request); + } + + /** + * + * + *
        +     * Explicitly decline to implement a test.
        +     * This removes the test from subsequent `ListTests` calls, and
        +     * attempting to do the test will error.
        +     * This method will error if attempting to delete a required test.
        +     * 
        + */ + public com.google.protobuf.Empty deleteTest( + com.google.showcase.v1beta1.DeleteTestRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getDeleteTestMethod(), getCallOptions(), request); + } + + /** + * + * + *
        +     * Register a response to a test.
        +     * In cases where a test involves registering a final answer at the
        +     * end of the test, this method provides the means to do so.
        +     * 
        + */ + public com.google.showcase.v1beta1.VerifyTestResponse verifyTest( + com.google.showcase.v1beta1.VerifyTestRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getVerifyTestMethod(), getCallOptions(), request); + } + } + + /** + * A stub to allow clients to do ListenableFuture-style rpc calls to service Testing. + * + *
        +   * A service to facilitate running discrete sets of tests
        +   * against Showcase.
        +   * Adding this comment with special characters for comment formatting tests:
        +   * 1. (abra->kadabra->alakazam)
        +   * 2) [Nonsense][]: `pokemon/*/psychic/*`
        +   * 
        + */ + public static final class TestingFutureStub + extends io.grpc.stub.AbstractFutureStub { + private TestingFutureStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected TestingFutureStub build(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new TestingFutureStub(channel, callOptions); + } + + /** + * + * + *
        +     * Creates a new testing session.
        +     * Adding this comment with special characters for comment formatting tests:
        +     * 1. (abra->kadabra->alakazam)
        +     * 2) [Nonsense][]: `pokemon/*/psychic/*`
        +     * 
        + */ + public com.google.common.util.concurrent.ListenableFuture + createSession(com.google.showcase.v1beta1.CreateSessionRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getCreateSessionMethod(), getCallOptions()), request); + } + + /** + * + * + *
        +     * Gets a testing session.
        +     * 
        + */ + public com.google.common.util.concurrent.ListenableFuture + getSession(com.google.showcase.v1beta1.GetSessionRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getGetSessionMethod(), getCallOptions()), request); + } + + /** + * + * + *
        +     * Lists the current test sessions.
        +     * 
        + */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.showcase.v1beta1.ListSessionsResponse> + listSessions(com.google.showcase.v1beta1.ListSessionsRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getListSessionsMethod(), getCallOptions()), request); + } + + /** + * + * + *
        +     * Delete a test session.
        +     * 
        + */ + public com.google.common.util.concurrent.ListenableFuture + deleteSession(com.google.showcase.v1beta1.DeleteSessionRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getDeleteSessionMethod(), getCallOptions()), request); + } + + /** + * + * + *
        +     * Report on the status of a session.
        +     * This generates a report detailing which tests have been completed,
        +     * and an overall rollup.
        +     * 
        + */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.showcase.v1beta1.ReportSessionResponse> + reportSession(com.google.showcase.v1beta1.ReportSessionRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getReportSessionMethod(), getCallOptions()), request); + } + + /** + * + * + *
        +     * List the tests of a sessesion.
        +     * 
        + */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.showcase.v1beta1.ListTestsResponse> + listTests(com.google.showcase.v1beta1.ListTestsRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getListTestsMethod(), getCallOptions()), request); + } + + /** + * + * + *
        +     * Explicitly decline to implement a test.
        +     * This removes the test from subsequent `ListTests` calls, and
        +     * attempting to do the test will error.
        +     * This method will error if attempting to delete a required test.
        +     * 
        + */ + public com.google.common.util.concurrent.ListenableFuture deleteTest( + com.google.showcase.v1beta1.DeleteTestRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getDeleteTestMethod(), getCallOptions()), request); + } + + /** + * + * + *
        +     * Register a response to a test.
        +     * In cases where a test involves registering a final answer at the
        +     * end of the test, this method provides the means to do so.
        +     * 
        + */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.showcase.v1beta1.VerifyTestResponse> + verifyTest(com.google.showcase.v1beta1.VerifyTestRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getVerifyTestMethod(), getCallOptions()), request); + } + } + + private static final int METHODID_CREATE_SESSION = 0; + private static final int METHODID_GET_SESSION = 1; + private static final int METHODID_LIST_SESSIONS = 2; + private static final int METHODID_DELETE_SESSION = 3; + private static final int METHODID_REPORT_SESSION = 4; + private static final int METHODID_LIST_TESTS = 5; + private static final int METHODID_DELETE_TEST = 6; + private static final int METHODID_VERIFY_TEST = 7; + + 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_CREATE_SESSION: + serviceImpl.createSession( + (com.google.showcase.v1beta1.CreateSessionRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_GET_SESSION: + serviceImpl.getSession( + (com.google.showcase.v1beta1.GetSessionRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_LIST_SESSIONS: + serviceImpl.listSessions( + (com.google.showcase.v1beta1.ListSessionsRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_DELETE_SESSION: + serviceImpl.deleteSession( + (com.google.showcase.v1beta1.DeleteSessionRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_REPORT_SESSION: + serviceImpl.reportSession( + (com.google.showcase.v1beta1.ReportSessionRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_LIST_TESTS: + serviceImpl.listTests( + (com.google.showcase.v1beta1.ListTestsRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_DELETE_TEST: + serviceImpl.deleteTest( + (com.google.showcase.v1beta1.DeleteTestRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_VERIFY_TEST: + serviceImpl.verifyTest( + (com.google.showcase.v1beta1.VerifyTestRequest) 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( + getCreateSessionMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.showcase.v1beta1.CreateSessionRequest, + com.google.showcase.v1beta1.Session>(service, METHODID_CREATE_SESSION))) + .addMethod( + getGetSessionMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.showcase.v1beta1.GetSessionRequest, + com.google.showcase.v1beta1.Session>(service, METHODID_GET_SESSION))) + .addMethod( + getListSessionsMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.showcase.v1beta1.ListSessionsRequest, + com.google.showcase.v1beta1.ListSessionsResponse>( + service, METHODID_LIST_SESSIONS))) + .addMethod( + getDeleteSessionMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.showcase.v1beta1.DeleteSessionRequest, com.google.protobuf.Empty>( + service, METHODID_DELETE_SESSION))) + .addMethod( + getReportSessionMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.showcase.v1beta1.ReportSessionRequest, + com.google.showcase.v1beta1.ReportSessionResponse>( + service, METHODID_REPORT_SESSION))) + .addMethod( + getListTestsMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.showcase.v1beta1.ListTestsRequest, + com.google.showcase.v1beta1.ListTestsResponse>(service, METHODID_LIST_TESTS))) + .addMethod( + getDeleteTestMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.showcase.v1beta1.DeleteTestRequest, com.google.protobuf.Empty>( + service, METHODID_DELETE_TEST))) + .addMethod( + getVerifyTestMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.showcase.v1beta1.VerifyTestRequest, + com.google.showcase.v1beta1.VerifyTestResponse>(service, METHODID_VERIFY_TEST))) + .build(); + } + + private abstract static class TestingBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoFileDescriptorSupplier, + io.grpc.protobuf.ProtoServiceDescriptorSupplier { + TestingBaseDescriptorSupplier() {} + + @java.lang.Override + public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() { + return com.google.showcase.v1beta1.TestingOuterClass.getDescriptor(); + } + + @java.lang.Override + public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() { + return getFileDescriptor().findServiceByName("Testing"); + } + } + + private static final class TestingFileDescriptorSupplier extends TestingBaseDescriptorSupplier { + TestingFileDescriptorSupplier() {} + } + + private static final class TestingMethodDescriptorSupplier extends TestingBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoMethodDescriptorSupplier { + private final java.lang.String methodName; + + TestingMethodDescriptorSupplier(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 (TestingGrpc.class) { + result = serviceDescriptor; + if (result == null) { + serviceDescriptor = + result = + io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME) + .setSchemaDescriptor(new TestingFileDescriptorSupplier()) + .addMethod(getCreateSessionMethod()) + .addMethod(getGetSessionMethod()) + .addMethod(getListSessionsMethod()) + .addMethod(getDeleteSessionMethod()) + .addMethod(getReportSessionMethod()) + .addMethod(getListTestsMethod()) + .addMethod(getDeleteTestMethod()) + .addMethod(getVerifyTestMethod()) + .build(); + } + } + } + return result; + } +} diff --git a/java-showcase-3.21.0/pom.xml b/java-showcase-3.21.0/pom.xml new file mode 100644 index 0000000000..70ae97a21f --- /dev/null +++ b/java-showcase-3.21.0/pom.xml @@ -0,0 +1,259 @@ + + + 4.0.0 + com.google.cloud + gapic-showcase-parent + pom + 0.0.1-SNAPSHOT + GAPIC Showcase Client Core Parent + + Java idiomatic client for Google Cloud Platform services. + + + + com.google.cloud + google-cloud-shared-config + 1.17.0 + + + + + UTF-8 + UTF-8 + github + google-cloud-showcase-parent + true + true + true + + + + + + com.google.cloud + google-cloud-shared-dependencies + 3.58.1-SNAPSHOT + pom + import + + + com.google.api.grpc + proto-gapic-showcase-v1beta1 + 0.0.1-SNAPSHOT + + + com.google.api.grpc + grpc-gapic-showcase-v1beta1 + 0.0.1-SNAPSHOT + + + com.google.cloud + gapic-showcase + 0.0.1-SNAPSHOT + + + org.junit + junit-bom + 5.11.4 + pom + import + + + + + + gapic-showcase + grpc-gapic-showcase-v1beta1 + proto-gapic-showcase-v1beta1 + + + + + native + + + + org.apache.maven.plugins + maven-compiler-plugin + + + + **/com/google/showcase/v1beta1/it/logging/*.java + + + + + org.graalvm.buildtools + native-maven-plugin + true + + + test-native + + test + + test + + + + + --no-fallback + --no-server + --verbose + + + + + + + + showcase + + true + + + + + org.apache.maven.plugins + maven-compiler-plugin + + + + **/com/google/showcase/v1beta1/it/logging/*.java + + + + + org.apache.maven.plugins + maven-surefire-plugin + 3.5.2 + + sponge_log + ${skipUnitTests} + + + + org.apache.maven.plugins + maven-failsafe-plugin + + + + + org.apache.maven.surefire + surefire-junit-platform + ${surefire.version} + + + + + org.codehaus.mojo + flatten-maven-plugin + + + + + + + loggingTestBase + + + + + org.apache.maven.plugins + maven-surefire-plugin + 3.5.2 + + sponge_log + ${skipUnitTests} + + + + org.apache.maven.plugins + maven-failsafe-plugin + + + + + org.apache.maven.surefire + surefire-junit-platform + ${surefire.version} + + + + + org.codehaus.mojo + flatten-maven-plugin + + + + + + enable-golden-tests + + + + org.apache.maven.plugins + maven-compiler-plugin + + + + **/com/google/showcase/v1beta1/it/logging/*.java + + + + + org.codehaus.mojo + exec-maven-plugin + 3.5.0 + false + + + verify-showcase + + exec + + test + + bash + + scripts/verify.sh + + + + + + + + + + update + + + + org.codehaus.mojo + exec-maven-plugin + 3.5.0 + false + + + verify-showcase + + exec + + generate-sources + + bash + + scripts/generate_showcase.sh + --replace + true + + + + + + + + + + diff --git a/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/pom.xml b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/pom.xml new file mode 100644 index 0000000000..cef41f54ff --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/pom.xml @@ -0,0 +1,57 @@ + + 4.0.0 + com.google.api.grpc + proto-gapic-showcase-v1beta1 + 0.0.1-SNAPSHOT + proto-gapic-showcase-v1beta1 + PROTO library for proto-gapic-showcase-v1beta1 + + com.google.cloud + gapic-showcase-parent + 0.0.1-SNAPSHOT + + + + true + + + + + com.google.protobuf + protobuf-java + + + com.google.api.grpc + proto-google-common-protos + + + com.google.api.grpc + proto-google-iam-v1 + + + com.google.api + api-common + + + com.google.guava + guava + + + + + + + showcase-sonar-analysis + + + enableShowcaseTestCoverage + + + + true + + + + diff --git a/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/AttemptSequenceRequest.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/AttemptSequenceRequest.java new file mode 100644 index 0000000000..7f7e53ed8c --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/AttemptSequenceRequest.java @@ -0,0 +1,603 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/sequence.proto + +package com.google.showcase.v1beta1; + +/** Protobuf type {@code google.showcase.v1beta1.AttemptSequenceRequest} */ +public final class AttemptSequenceRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.AttemptSequenceRequest) + AttemptSequenceRequestOrBuilder { + private static final long serialVersionUID = 0L; + + // Use AttemptSequenceRequest.newBuilder() to construct. + private AttemptSequenceRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private AttemptSequenceRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new AttemptSequenceRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private AttemptSequenceRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.SequenceOuterClass + .internal_static_google_showcase_v1beta1_AttemptSequenceRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.SequenceOuterClass + .internal_static_google_showcase_v1beta1_AttemptSequenceRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.AttemptSequenceRequest.class, + com.google.showcase.v1beta1.AttemptSequenceRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + + /** + * + * 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; + } + } + + /** + * + * 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_); + } + unknownFields.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 += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.showcase.v1beta1.AttemptSequenceRequest)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.AttemptSequenceRequest other = + (com.google.showcase.v1beta1.AttemptSequenceRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.showcase.v1beta1.AttemptSequenceRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.AttemptSequenceRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.AttemptSequenceRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.AttemptSequenceRequest 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.showcase.v1beta1.AttemptSequenceRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.AttemptSequenceRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.AttemptSequenceRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.AttemptSequenceRequest 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.showcase.v1beta1.AttemptSequenceRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.AttemptSequenceRequest 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.showcase.v1beta1.AttemptSequenceRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.AttemptSequenceRequest 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.showcase.v1beta1.AttemptSequenceRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** Protobuf type {@code google.showcase.v1beta1.AttemptSequenceRequest} */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.AttemptSequenceRequest) + com.google.showcase.v1beta1.AttemptSequenceRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.SequenceOuterClass + .internal_static_google_showcase_v1beta1_AttemptSequenceRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.SequenceOuterClass + .internal_static_google_showcase_v1beta1_AttemptSequenceRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.AttemptSequenceRequest.class, + com.google.showcase.v1beta1.AttemptSequenceRequest.Builder.class); + } + + // Construct using com.google.showcase.v1beta1.AttemptSequenceRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.showcase.v1beta1.SequenceOuterClass + .internal_static_google_showcase_v1beta1_AttemptSequenceRequest_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.AttemptSequenceRequest getDefaultInstanceForType() { + return com.google.showcase.v1beta1.AttemptSequenceRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.AttemptSequenceRequest build() { + com.google.showcase.v1beta1.AttemptSequenceRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.AttemptSequenceRequest buildPartial() { + com.google.showcase.v1beta1.AttemptSequenceRequest result = + new com.google.showcase.v1beta1.AttemptSequenceRequest(this); + result.name_ = name_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.showcase.v1beta1.AttemptSequenceRequest) { + return mergeFrom((com.google.showcase.v1beta1.AttemptSequenceRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.showcase.v1beta1.AttemptSequenceRequest other) { + if (other == com.google.showcase.v1beta1.AttemptSequenceRequest.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.showcase.v1beta1.AttemptSequenceRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.showcase.v1beta1.AttemptSequenceRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + + /** + * + * 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; + } + } + + /** + * + * 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; + } + } + + /** + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + + /** + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + + /** + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.showcase.v1beta1.AttemptSequenceRequest) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.AttemptSequenceRequest) + private static final com.google.showcase.v1beta1.AttemptSequenceRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.AttemptSequenceRequest(); + } + + public static com.google.showcase.v1beta1.AttemptSequenceRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public AttemptSequenceRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new AttemptSequenceRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.showcase.v1beta1.AttemptSequenceRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/AttemptSequenceRequestOrBuilder.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/AttemptSequenceRequestOrBuilder.java new file mode 100644 index 0000000000..bbe1dcfbdb --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/AttemptSequenceRequestOrBuilder.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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/sequence.proto + +package com.google.showcase.v1beta1; + +public interface AttemptSequenceRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.AttemptSequenceRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + + /** + * + * 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-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/AttemptStreamingSequenceRequest.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/AttemptStreamingSequenceRequest.java new file mode 100644 index 0000000000..1bdd243c27 --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/AttemptStreamingSequenceRequest.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: schema/google/showcase/v1beta1/sequence.proto + +package com.google.showcase.v1beta1; + +/** Protobuf type {@code google.showcase.v1beta1.AttemptStreamingSequenceRequest} */ +public final class AttemptStreamingSequenceRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.AttemptStreamingSequenceRequest) + AttemptStreamingSequenceRequestOrBuilder { + private static final long serialVersionUID = 0L; + + // Use AttemptStreamingSequenceRequest.newBuilder() to construct. + private AttemptStreamingSequenceRequest( + com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private AttemptStreamingSequenceRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new AttemptStreamingSequenceRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private AttemptStreamingSequenceRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + break; + } + case 16: + { + lastFailIndex_ = input.readInt32(); + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.SequenceOuterClass + .internal_static_google_showcase_v1beta1_AttemptStreamingSequenceRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.SequenceOuterClass + .internal_static_google_showcase_v1beta1_AttemptStreamingSequenceRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.AttemptStreamingSequenceRequest.class, + com.google.showcase.v1beta1.AttemptStreamingSequenceRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + + /** + * + * 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; + } + } + + /** + * + * 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 LAST_FAIL_INDEX_FIELD_NUMBER = 2; + private int lastFailIndex_; + + /** + * + * + *
        +   * used to send the index of the last failed message
        +   * in the string "content" of an AttemptStreamingSequenceResponse
        +   * needed for stream resumption logic testing
        +   * 
        + * + * int32 last_fail_index = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The lastFailIndex. + */ + @java.lang.Override + public int getLastFailIndex() { + return lastFailIndex_; + } + + 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 (lastFailIndex_ != 0) { + output.writeInt32(2, lastFailIndex_); + } + unknownFields.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 (lastFailIndex_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(2, lastFailIndex_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.showcase.v1beta1.AttemptStreamingSequenceRequest)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.AttemptStreamingSequenceRequest other = + (com.google.showcase.v1beta1.AttemptStreamingSequenceRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (getLastFailIndex() != other.getLastFailIndex()) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (37 * hash) + LAST_FAIL_INDEX_FIELD_NUMBER; + hash = (53 * hash) + getLastFailIndex(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.showcase.v1beta1.AttemptStreamingSequenceRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.AttemptStreamingSequenceRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.AttemptStreamingSequenceRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.AttemptStreamingSequenceRequest 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.showcase.v1beta1.AttemptStreamingSequenceRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.AttemptStreamingSequenceRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.AttemptStreamingSequenceRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.AttemptStreamingSequenceRequest 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.showcase.v1beta1.AttemptStreamingSequenceRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.AttemptStreamingSequenceRequest 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.showcase.v1beta1.AttemptStreamingSequenceRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.AttemptStreamingSequenceRequest 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.showcase.v1beta1.AttemptStreamingSequenceRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** Protobuf type {@code google.showcase.v1beta1.AttemptStreamingSequenceRequest} */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.AttemptStreamingSequenceRequest) + com.google.showcase.v1beta1.AttemptStreamingSequenceRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.SequenceOuterClass + .internal_static_google_showcase_v1beta1_AttemptStreamingSequenceRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.SequenceOuterClass + .internal_static_google_showcase_v1beta1_AttemptStreamingSequenceRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.AttemptStreamingSequenceRequest.class, + com.google.showcase.v1beta1.AttemptStreamingSequenceRequest.Builder.class); + } + + // Construct using com.google.showcase.v1beta1.AttemptStreamingSequenceRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + lastFailIndex_ = 0; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.showcase.v1beta1.SequenceOuterClass + .internal_static_google_showcase_v1beta1_AttemptStreamingSequenceRequest_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.AttemptStreamingSequenceRequest getDefaultInstanceForType() { + return com.google.showcase.v1beta1.AttemptStreamingSequenceRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.AttemptStreamingSequenceRequest build() { + com.google.showcase.v1beta1.AttemptStreamingSequenceRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.AttemptStreamingSequenceRequest buildPartial() { + com.google.showcase.v1beta1.AttemptStreamingSequenceRequest result = + new com.google.showcase.v1beta1.AttemptStreamingSequenceRequest(this); + result.name_ = name_; + result.lastFailIndex_ = lastFailIndex_; + 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.showcase.v1beta1.AttemptStreamingSequenceRequest) { + return mergeFrom((com.google.showcase.v1beta1.AttemptStreamingSequenceRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.showcase.v1beta1.AttemptStreamingSequenceRequest other) { + if (other == com.google.showcase.v1beta1.AttemptStreamingSequenceRequest.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + if (other.getLastFailIndex() != 0) { + setLastFailIndex(other.getLastFailIndex()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.showcase.v1beta1.AttemptStreamingSequenceRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.showcase.v1beta1.AttemptStreamingSequenceRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + + /** + * + * 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; + } + } + + /** + * + * 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; + } + } + + /** + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + + /** + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + + /** + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + + private int lastFailIndex_; + + /** + * + * + *
        +     * used to send the index of the last failed message
        +     * in the string "content" of an AttemptStreamingSequenceResponse
        +     * needed for stream resumption logic testing
        +     * 
        + * + * int32 last_fail_index = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The lastFailIndex. + */ + @java.lang.Override + public int getLastFailIndex() { + return lastFailIndex_; + } + + /** + * + * + *
        +     * used to send the index of the last failed message
        +     * in the string "content" of an AttemptStreamingSequenceResponse
        +     * needed for stream resumption logic testing
        +     * 
        + * + * int32 last_fail_index = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The lastFailIndex to set. + * @return This builder for chaining. + */ + public Builder setLastFailIndex(int value) { + + lastFailIndex_ = value; + onChanged(); + return this; + } + + /** + * + * + *
        +     * used to send the index of the last failed message
        +     * in the string "content" of an AttemptStreamingSequenceResponse
        +     * needed for stream resumption logic testing
        +     * 
        + * + * int32 last_fail_index = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearLastFailIndex() { + + lastFailIndex_ = 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.showcase.v1beta1.AttemptStreamingSequenceRequest) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.AttemptStreamingSequenceRequest) + private static final com.google.showcase.v1beta1.AttemptStreamingSequenceRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.AttemptStreamingSequenceRequest(); + } + + public static com.google.showcase.v1beta1.AttemptStreamingSequenceRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public AttemptStreamingSequenceRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new AttemptStreamingSequenceRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.showcase.v1beta1.AttemptStreamingSequenceRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/AttemptStreamingSequenceRequestOrBuilder.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/AttemptStreamingSequenceRequestOrBuilder.java new file mode 100644 index 0000000000..4e6cda9daf --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/AttemptStreamingSequenceRequestOrBuilder.java @@ -0,0 +1,58 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/sequence.proto + +package com.google.showcase.v1beta1; + +public interface AttemptStreamingSequenceRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.AttemptStreamingSequenceRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + + /** + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
        +   * used to send the index of the last failed message
        +   * in the string "content" of an AttemptStreamingSequenceResponse
        +   * needed for stream resumption logic testing
        +   * 
        + * + * int32 last_fail_index = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The lastFailIndex. + */ + int getLastFailIndex(); +} diff --git a/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/AttemptStreamingSequenceResponse.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/AttemptStreamingSequenceResponse.java new file mode 100644 index 0000000000..959c9eb5f7 --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/AttemptStreamingSequenceResponse.java @@ -0,0 +1,652 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/sequence.proto + +package com.google.showcase.v1beta1; + +/** + * + * + *
        + * The response message for the Echo methods.
        + * 
        + * + * Protobuf type {@code google.showcase.v1beta1.AttemptStreamingSequenceResponse} + */ +public final class AttemptStreamingSequenceResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.AttemptStreamingSequenceResponse) + AttemptStreamingSequenceResponseOrBuilder { + private static final long serialVersionUID = 0L; + + // Use AttemptStreamingSequenceResponse.newBuilder() to construct. + private AttemptStreamingSequenceResponse( + com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private AttemptStreamingSequenceResponse() { + content_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new AttemptStreamingSequenceResponse(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private AttemptStreamingSequenceResponse( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + content_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.SequenceOuterClass + .internal_static_google_showcase_v1beta1_AttemptStreamingSequenceResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.SequenceOuterClass + .internal_static_google_showcase_v1beta1_AttemptStreamingSequenceResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.AttemptStreamingSequenceResponse.class, + com.google.showcase.v1beta1.AttemptStreamingSequenceResponse.Builder.class); + } + + public static final int CONTENT_FIELD_NUMBER = 1; + private volatile java.lang.Object content_; + + /** + * + * + *
        +   * The content specified in the request.
        +   * 
        + * + * string content = 1; + * + * @return The content. + */ + @java.lang.Override + public java.lang.String getContent() { + java.lang.Object ref = content_; + 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(); + content_ = s; + return s; + } + } + + /** + * + * + *
        +   * The content specified in the request.
        +   * 
        + * + * string content = 1; + * + * @return The bytes for content. + */ + @java.lang.Override + public com.google.protobuf.ByteString getContentBytes() { + java.lang.Object ref = content_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + content_ = 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(content_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, content_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(content_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, content_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.showcase.v1beta1.AttemptStreamingSequenceResponse)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.AttemptStreamingSequenceResponse other = + (com.google.showcase.v1beta1.AttemptStreamingSequenceResponse) obj; + + if (!getContent().equals(other.getContent())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + CONTENT_FIELD_NUMBER; + hash = (53 * hash) + getContent().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.showcase.v1beta1.AttemptStreamingSequenceResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.AttemptStreamingSequenceResponse parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.AttemptStreamingSequenceResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.AttemptStreamingSequenceResponse 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.showcase.v1beta1.AttemptStreamingSequenceResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.AttemptStreamingSequenceResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.AttemptStreamingSequenceResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.AttemptStreamingSequenceResponse 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.showcase.v1beta1.AttemptStreamingSequenceResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.AttemptStreamingSequenceResponse 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.showcase.v1beta1.AttemptStreamingSequenceResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.AttemptStreamingSequenceResponse 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.showcase.v1beta1.AttemptStreamingSequenceResponse 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 message for the Echo methods.
        +   * 
        + * + * Protobuf type {@code google.showcase.v1beta1.AttemptStreamingSequenceResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.AttemptStreamingSequenceResponse) + com.google.showcase.v1beta1.AttemptStreamingSequenceResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.SequenceOuterClass + .internal_static_google_showcase_v1beta1_AttemptStreamingSequenceResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.SequenceOuterClass + .internal_static_google_showcase_v1beta1_AttemptStreamingSequenceResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.AttemptStreamingSequenceResponse.class, + com.google.showcase.v1beta1.AttemptStreamingSequenceResponse.Builder.class); + } + + // Construct using com.google.showcase.v1beta1.AttemptStreamingSequenceResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + content_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.showcase.v1beta1.SequenceOuterClass + .internal_static_google_showcase_v1beta1_AttemptStreamingSequenceResponse_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.AttemptStreamingSequenceResponse + getDefaultInstanceForType() { + return com.google.showcase.v1beta1.AttemptStreamingSequenceResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.AttemptStreamingSequenceResponse build() { + com.google.showcase.v1beta1.AttemptStreamingSequenceResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.AttemptStreamingSequenceResponse buildPartial() { + com.google.showcase.v1beta1.AttemptStreamingSequenceResponse result = + new com.google.showcase.v1beta1.AttemptStreamingSequenceResponse(this); + result.content_ = content_; + 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.showcase.v1beta1.AttemptStreamingSequenceResponse) { + return mergeFrom((com.google.showcase.v1beta1.AttemptStreamingSequenceResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.showcase.v1beta1.AttemptStreamingSequenceResponse other) { + if (other + == com.google.showcase.v1beta1.AttemptStreamingSequenceResponse.getDefaultInstance()) + return this; + if (!other.getContent().isEmpty()) { + content_ = other.content_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.showcase.v1beta1.AttemptStreamingSequenceResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.showcase.v1beta1.AttemptStreamingSequenceResponse) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object content_ = ""; + + /** + * + * + *
        +     * The content specified in the request.
        +     * 
        + * + * string content = 1; + * + * @return The content. + */ + public java.lang.String getContent() { + java.lang.Object ref = content_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + content_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
        +     * The content specified in the request.
        +     * 
        + * + * string content = 1; + * + * @return The bytes for content. + */ + public com.google.protobuf.ByteString getContentBytes() { + java.lang.Object ref = content_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + content_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
        +     * The content specified in the request.
        +     * 
        + * + * string content = 1; + * + * @param value The content to set. + * @return This builder for chaining. + */ + public Builder setContent(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + content_ = value; + onChanged(); + return this; + } + + /** + * + * + *
        +     * The content specified in the request.
        +     * 
        + * + * string content = 1; + * + * @return This builder for chaining. + */ + public Builder clearContent() { + + content_ = getDefaultInstance().getContent(); + onChanged(); + return this; + } + + /** + * + * + *
        +     * The content specified in the request.
        +     * 
        + * + * string content = 1; + * + * @param value The bytes for content to set. + * @return This builder for chaining. + */ + public Builder setContentBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + content_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.showcase.v1beta1.AttemptStreamingSequenceResponse) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.AttemptStreamingSequenceResponse) + private static final com.google.showcase.v1beta1.AttemptStreamingSequenceResponse + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.AttemptStreamingSequenceResponse(); + } + + public static com.google.showcase.v1beta1.AttemptStreamingSequenceResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public AttemptStreamingSequenceResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new AttemptStreamingSequenceResponse(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.showcase.v1beta1.AttemptStreamingSequenceResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/AttemptStreamingSequenceResponseOrBuilder.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/AttemptStreamingSequenceResponseOrBuilder.java new file mode 100644 index 0000000000..b8ca583828 --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/AttemptStreamingSequenceResponseOrBuilder.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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/sequence.proto + +package com.google.showcase.v1beta1; + +public interface AttemptStreamingSequenceResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.AttemptStreamingSequenceResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
        +   * The content specified in the request.
        +   * 
        + * + * string content = 1; + * + * @return The content. + */ + java.lang.String getContent(); + + /** + * + * + *
        +   * The content specified in the request.
        +   * 
        + * + * string content = 1; + * + * @return The bytes for content. + */ + com.google.protobuf.ByteString getContentBytes(); +} diff --git a/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/BlockRequest.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/BlockRequest.java new file mode 100644 index 0000000000..eac6e1a2c7 --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/BlockRequest.java @@ -0,0 +1,1457 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/echo.proto + +package com.google.showcase.v1beta1; + +/** + * + * + *
        + * The request for Block method.
        + * 
        + * + * Protobuf type {@code google.showcase.v1beta1.BlockRequest} + */ +public final class BlockRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.BlockRequest) + BlockRequestOrBuilder { + private static final long serialVersionUID = 0L; + + // Use BlockRequest.newBuilder() to construct. + private BlockRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private BlockRequest() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new BlockRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private BlockRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + com.google.protobuf.Duration.Builder subBuilder = null; + if (responseDelay_ != null) { + subBuilder = responseDelay_.toBuilder(); + } + responseDelay_ = + input.readMessage(com.google.protobuf.Duration.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(responseDelay_); + responseDelay_ = subBuilder.buildPartial(); + } + + break; + } + case 18: + { + com.google.rpc.Status.Builder subBuilder = null; + if (responseCase_ == 2) { + subBuilder = ((com.google.rpc.Status) response_).toBuilder(); + } + response_ = input.readMessage(com.google.rpc.Status.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom((com.google.rpc.Status) response_); + response_ = subBuilder.buildPartial(); + } + responseCase_ = 2; + break; + } + case 26: + { + com.google.showcase.v1beta1.BlockResponse.Builder subBuilder = null; + if (responseCase_ == 3) { + subBuilder = ((com.google.showcase.v1beta1.BlockResponse) response_).toBuilder(); + } + response_ = + input.readMessage( + com.google.showcase.v1beta1.BlockResponse.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom((com.google.showcase.v1beta1.BlockResponse) response_); + response_ = subBuilder.buildPartial(); + } + responseCase_ = 3; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.EchoOuterClass + .internal_static_google_showcase_v1beta1_BlockRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.EchoOuterClass + .internal_static_google_showcase_v1beta1_BlockRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.BlockRequest.class, + com.google.showcase.v1beta1.BlockRequest.Builder.class); + } + + private int responseCase_ = 0; + private java.lang.Object response_; + + public enum ResponseCase + implements + com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + ERROR(2), + SUCCESS(3), + RESPONSE_NOT_SET(0); + private final int value; + + private ResponseCase(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 ResponseCase valueOf(int value) { + return forNumber(value); + } + + public static ResponseCase forNumber(int value) { + switch (value) { + case 2: + return ERROR; + case 3: + return SUCCESS; + case 0: + return RESPONSE_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public ResponseCase getResponseCase() { + return ResponseCase.forNumber(responseCase_); + } + + public static final int RESPONSE_DELAY_FIELD_NUMBER = 1; + private com.google.protobuf.Duration responseDelay_; + + /** + * + * + *
        +   * The amount of time to block before returning a response.
        +   * 
        + * + * .google.protobuf.Duration response_delay = 1; + * + * @return Whether the responseDelay field is set. + */ + @java.lang.Override + public boolean hasResponseDelay() { + return responseDelay_ != null; + } + + /** + * + * + *
        +   * The amount of time to block before returning a response.
        +   * 
        + * + * .google.protobuf.Duration response_delay = 1; + * + * @return The responseDelay. + */ + @java.lang.Override + public com.google.protobuf.Duration getResponseDelay() { + return responseDelay_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : responseDelay_; + } + + /** + * + * + *
        +   * The amount of time to block before returning a response.
        +   * 
        + * + * .google.protobuf.Duration response_delay = 1; + */ + @java.lang.Override + public com.google.protobuf.DurationOrBuilder getResponseDelayOrBuilder() { + return getResponseDelay(); + } + + public static final int ERROR_FIELD_NUMBER = 2; + + /** + * + * + *
        +   * The error that will be returned by the server. If this code is specified
        +   * to be the OK rpc code, an empty response will be returned.
        +   * 
        + * + * .google.rpc.Status error = 2; + * + * @return Whether the error field is set. + */ + @java.lang.Override + public boolean hasError() { + return responseCase_ == 2; + } + + /** + * + * + *
        +   * The error that will be returned by the server. If this code is specified
        +   * to be the OK rpc code, an empty response will be returned.
        +   * 
        + * + * .google.rpc.Status error = 2; + * + * @return The error. + */ + @java.lang.Override + public com.google.rpc.Status getError() { + if (responseCase_ == 2) { + return (com.google.rpc.Status) response_; + } + return com.google.rpc.Status.getDefaultInstance(); + } + + /** + * + * + *
        +   * The error that will be returned by the server. If this code is specified
        +   * to be the OK rpc code, an empty response will be returned.
        +   * 
        + * + * .google.rpc.Status error = 2; + */ + @java.lang.Override + public com.google.rpc.StatusOrBuilder getErrorOrBuilder() { + if (responseCase_ == 2) { + return (com.google.rpc.Status) response_; + } + return com.google.rpc.Status.getDefaultInstance(); + } + + public static final int SUCCESS_FIELD_NUMBER = 3; + + /** + * + * + *
        +   * The response to be returned that will signify successful method call.
        +   * 
        + * + * .google.showcase.v1beta1.BlockResponse success = 3; + * + * @return Whether the success field is set. + */ + @java.lang.Override + public boolean hasSuccess() { + return responseCase_ == 3; + } + + /** + * + * + *
        +   * The response to be returned that will signify successful method call.
        +   * 
        + * + * .google.showcase.v1beta1.BlockResponse success = 3; + * + * @return The success. + */ + @java.lang.Override + public com.google.showcase.v1beta1.BlockResponse getSuccess() { + if (responseCase_ == 3) { + return (com.google.showcase.v1beta1.BlockResponse) response_; + } + return com.google.showcase.v1beta1.BlockResponse.getDefaultInstance(); + } + + /** + * + * + *
        +   * The response to be returned that will signify successful method call.
        +   * 
        + * + * .google.showcase.v1beta1.BlockResponse success = 3; + */ + @java.lang.Override + public com.google.showcase.v1beta1.BlockResponseOrBuilder getSuccessOrBuilder() { + if (responseCase_ == 3) { + return (com.google.showcase.v1beta1.BlockResponse) response_; + } + return com.google.showcase.v1beta1.BlockResponse.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 (responseDelay_ != null) { + output.writeMessage(1, getResponseDelay()); + } + if (responseCase_ == 2) { + output.writeMessage(2, (com.google.rpc.Status) response_); + } + if (responseCase_ == 3) { + output.writeMessage(3, (com.google.showcase.v1beta1.BlockResponse) response_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (responseDelay_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getResponseDelay()); + } + if (responseCase_ == 2) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 2, (com.google.rpc.Status) response_); + } + if (responseCase_ == 3) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 3, (com.google.showcase.v1beta1.BlockResponse) response_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.showcase.v1beta1.BlockRequest)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.BlockRequest other = (com.google.showcase.v1beta1.BlockRequest) obj; + + if (hasResponseDelay() != other.hasResponseDelay()) return false; + if (hasResponseDelay()) { + if (!getResponseDelay().equals(other.getResponseDelay())) return false; + } + if (!getResponseCase().equals(other.getResponseCase())) return false; + switch (responseCase_) { + case 2: + if (!getError().equals(other.getError())) return false; + break; + case 3: + if (!getSuccess().equals(other.getSuccess())) return false; + break; + case 0: + default: + } + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasResponseDelay()) { + hash = (37 * hash) + RESPONSE_DELAY_FIELD_NUMBER; + hash = (53 * hash) + getResponseDelay().hashCode(); + } + switch (responseCase_) { + case 2: + hash = (37 * hash) + ERROR_FIELD_NUMBER; + hash = (53 * hash) + getError().hashCode(); + break; + case 3: + hash = (37 * hash) + SUCCESS_FIELD_NUMBER; + hash = (53 * hash) + getSuccess().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.showcase.v1beta1.BlockRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.BlockRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.BlockRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.BlockRequest 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.showcase.v1beta1.BlockRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.BlockRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.BlockRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.BlockRequest 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.showcase.v1beta1.BlockRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.BlockRequest 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.showcase.v1beta1.BlockRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.BlockRequest 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.showcase.v1beta1.BlockRequest 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 request for Block method.
        +   * 
        + * + * Protobuf type {@code google.showcase.v1beta1.BlockRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.BlockRequest) + com.google.showcase.v1beta1.BlockRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.EchoOuterClass + .internal_static_google_showcase_v1beta1_BlockRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.EchoOuterClass + .internal_static_google_showcase_v1beta1_BlockRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.BlockRequest.class, + com.google.showcase.v1beta1.BlockRequest.Builder.class); + } + + // Construct using com.google.showcase.v1beta1.BlockRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (responseDelayBuilder_ == null) { + responseDelay_ = null; + } else { + responseDelay_ = null; + responseDelayBuilder_ = null; + } + responseCase_ = 0; + response_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.showcase.v1beta1.EchoOuterClass + .internal_static_google_showcase_v1beta1_BlockRequest_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.BlockRequest getDefaultInstanceForType() { + return com.google.showcase.v1beta1.BlockRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.BlockRequest build() { + com.google.showcase.v1beta1.BlockRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.BlockRequest buildPartial() { + com.google.showcase.v1beta1.BlockRequest result = + new com.google.showcase.v1beta1.BlockRequest(this); + if (responseDelayBuilder_ == null) { + result.responseDelay_ = responseDelay_; + } else { + result.responseDelay_ = responseDelayBuilder_.build(); + } + if (responseCase_ == 2) { + if (errorBuilder_ == null) { + result.response_ = response_; + } else { + result.response_ = errorBuilder_.build(); + } + } + if (responseCase_ == 3) { + if (successBuilder_ == null) { + result.response_ = response_; + } else { + result.response_ = successBuilder_.build(); + } + } + result.responseCase_ = responseCase_; + 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.showcase.v1beta1.BlockRequest) { + return mergeFrom((com.google.showcase.v1beta1.BlockRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.showcase.v1beta1.BlockRequest other) { + if (other == com.google.showcase.v1beta1.BlockRequest.getDefaultInstance()) return this; + if (other.hasResponseDelay()) { + mergeResponseDelay(other.getResponseDelay()); + } + switch (other.getResponseCase()) { + case ERROR: + { + mergeError(other.getError()); + break; + } + case SUCCESS: + { + mergeSuccess(other.getSuccess()); + break; + } + case RESPONSE_NOT_SET: + { + break; + } + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.showcase.v1beta1.BlockRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.showcase.v1beta1.BlockRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int responseCase_ = 0; + private java.lang.Object response_; + + public ResponseCase getResponseCase() { + return ResponseCase.forNumber(responseCase_); + } + + public Builder clearResponse() { + responseCase_ = 0; + response_ = null; + onChanged(); + return this; + } + + private com.google.protobuf.Duration responseDelay_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder> + responseDelayBuilder_; + + /** + * + * + *
        +     * The amount of time to block before returning a response.
        +     * 
        + * + * .google.protobuf.Duration response_delay = 1; + * + * @return Whether the responseDelay field is set. + */ + public boolean hasResponseDelay() { + return responseDelayBuilder_ != null || responseDelay_ != null; + } + + /** + * + * + *
        +     * The amount of time to block before returning a response.
        +     * 
        + * + * .google.protobuf.Duration response_delay = 1; + * + * @return The responseDelay. + */ + public com.google.protobuf.Duration getResponseDelay() { + if (responseDelayBuilder_ == null) { + return responseDelay_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : responseDelay_; + } else { + return responseDelayBuilder_.getMessage(); + } + } + + /** + * + * + *
        +     * The amount of time to block before returning a response.
        +     * 
        + * + * .google.protobuf.Duration response_delay = 1; + */ + public Builder setResponseDelay(com.google.protobuf.Duration value) { + if (responseDelayBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + responseDelay_ = value; + onChanged(); + } else { + responseDelayBuilder_.setMessage(value); + } + + return this; + } + + /** + * + * + *
        +     * The amount of time to block before returning a response.
        +     * 
        + * + * .google.protobuf.Duration response_delay = 1; + */ + public Builder setResponseDelay(com.google.protobuf.Duration.Builder builderForValue) { + if (responseDelayBuilder_ == null) { + responseDelay_ = builderForValue.build(); + onChanged(); + } else { + responseDelayBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + + /** + * + * + *
        +     * The amount of time to block before returning a response.
        +     * 
        + * + * .google.protobuf.Duration response_delay = 1; + */ + public Builder mergeResponseDelay(com.google.protobuf.Duration value) { + if (responseDelayBuilder_ == null) { + if (responseDelay_ != null) { + responseDelay_ = + com.google.protobuf.Duration.newBuilder(responseDelay_) + .mergeFrom(value) + .buildPartial(); + } else { + responseDelay_ = value; + } + onChanged(); + } else { + responseDelayBuilder_.mergeFrom(value); + } + + return this; + } + + /** + * + * + *
        +     * The amount of time to block before returning a response.
        +     * 
        + * + * .google.protobuf.Duration response_delay = 1; + */ + public Builder clearResponseDelay() { + if (responseDelayBuilder_ == null) { + responseDelay_ = null; + onChanged(); + } else { + responseDelay_ = null; + responseDelayBuilder_ = null; + } + + return this; + } + + /** + * + * + *
        +     * The amount of time to block before returning a response.
        +     * 
        + * + * .google.protobuf.Duration response_delay = 1; + */ + public com.google.protobuf.Duration.Builder getResponseDelayBuilder() { + + onChanged(); + return getResponseDelayFieldBuilder().getBuilder(); + } + + /** + * + * + *
        +     * The amount of time to block before returning a response.
        +     * 
        + * + * .google.protobuf.Duration response_delay = 1; + */ + public com.google.protobuf.DurationOrBuilder getResponseDelayOrBuilder() { + if (responseDelayBuilder_ != null) { + return responseDelayBuilder_.getMessageOrBuilder(); + } else { + return responseDelay_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : responseDelay_; + } + } + + /** + * + * + *
        +     * The amount of time to block before returning a response.
        +     * 
        + * + * .google.protobuf.Duration response_delay = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder> + getResponseDelayFieldBuilder() { + if (responseDelayBuilder_ == null) { + responseDelayBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder>( + getResponseDelay(), getParentForChildren(), isClean()); + responseDelay_ = null; + } + return responseDelayBuilder_; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.rpc.Status, com.google.rpc.Status.Builder, com.google.rpc.StatusOrBuilder> + errorBuilder_; + + /** + * + * + *
        +     * The error that will be returned by the server. If this code is specified
        +     * to be the OK rpc code, an empty response will be returned.
        +     * 
        + * + * .google.rpc.Status error = 2; + * + * @return Whether the error field is set. + */ + @java.lang.Override + public boolean hasError() { + return responseCase_ == 2; + } + + /** + * + * + *
        +     * The error that will be returned by the server. If this code is specified
        +     * to be the OK rpc code, an empty response will be returned.
        +     * 
        + * + * .google.rpc.Status error = 2; + * + * @return The error. + */ + @java.lang.Override + public com.google.rpc.Status getError() { + if (errorBuilder_ == null) { + if (responseCase_ == 2) { + return (com.google.rpc.Status) response_; + } + return com.google.rpc.Status.getDefaultInstance(); + } else { + if (responseCase_ == 2) { + return errorBuilder_.getMessage(); + } + return com.google.rpc.Status.getDefaultInstance(); + } + } + + /** + * + * + *
        +     * The error that will be returned by the server. If this code is specified
        +     * to be the OK rpc code, an empty response will be returned.
        +     * 
        + * + * .google.rpc.Status error = 2; + */ + public Builder setError(com.google.rpc.Status value) { + if (errorBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + response_ = value; + onChanged(); + } else { + errorBuilder_.setMessage(value); + } + responseCase_ = 2; + return this; + } + + /** + * + * + *
        +     * The error that will be returned by the server. If this code is specified
        +     * to be the OK rpc code, an empty response will be returned.
        +     * 
        + * + * .google.rpc.Status error = 2; + */ + public Builder setError(com.google.rpc.Status.Builder builderForValue) { + if (errorBuilder_ == null) { + response_ = builderForValue.build(); + onChanged(); + } else { + errorBuilder_.setMessage(builderForValue.build()); + } + responseCase_ = 2; + return this; + } + + /** + * + * + *
        +     * The error that will be returned by the server. If this code is specified
        +     * to be the OK rpc code, an empty response will be returned.
        +     * 
        + * + * .google.rpc.Status error = 2; + */ + public Builder mergeError(com.google.rpc.Status value) { + if (errorBuilder_ == null) { + if (responseCase_ == 2 && response_ != com.google.rpc.Status.getDefaultInstance()) { + response_ = + com.google.rpc.Status.newBuilder((com.google.rpc.Status) response_) + .mergeFrom(value) + .buildPartial(); + } else { + response_ = value; + } + onChanged(); + } else { + if (responseCase_ == 2) { + errorBuilder_.mergeFrom(value); + } else { + errorBuilder_.setMessage(value); + } + } + responseCase_ = 2; + return this; + } + + /** + * + * + *
        +     * The error that will be returned by the server. If this code is specified
        +     * to be the OK rpc code, an empty response will be returned.
        +     * 
        + * + * .google.rpc.Status error = 2; + */ + public Builder clearError() { + if (errorBuilder_ == null) { + if (responseCase_ == 2) { + responseCase_ = 0; + response_ = null; + onChanged(); + } + } else { + if (responseCase_ == 2) { + responseCase_ = 0; + response_ = null; + } + errorBuilder_.clear(); + } + return this; + } + + /** + * + * + *
        +     * The error that will be returned by the server. If this code is specified
        +     * to be the OK rpc code, an empty response will be returned.
        +     * 
        + * + * .google.rpc.Status error = 2; + */ + public com.google.rpc.Status.Builder getErrorBuilder() { + return getErrorFieldBuilder().getBuilder(); + } + + /** + * + * + *
        +     * The error that will be returned by the server. If this code is specified
        +     * to be the OK rpc code, an empty response will be returned.
        +     * 
        + * + * .google.rpc.Status error = 2; + */ + @java.lang.Override + public com.google.rpc.StatusOrBuilder getErrorOrBuilder() { + if ((responseCase_ == 2) && (errorBuilder_ != null)) { + return errorBuilder_.getMessageOrBuilder(); + } else { + if (responseCase_ == 2) { + return (com.google.rpc.Status) response_; + } + return com.google.rpc.Status.getDefaultInstance(); + } + } + + /** + * + * + *
        +     * The error that will be returned by the server. If this code is specified
        +     * to be the OK rpc code, an empty response will be returned.
        +     * 
        + * + * .google.rpc.Status error = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.rpc.Status, com.google.rpc.Status.Builder, com.google.rpc.StatusOrBuilder> + getErrorFieldBuilder() { + if (errorBuilder_ == null) { + if (!(responseCase_ == 2)) { + response_ = com.google.rpc.Status.getDefaultInstance(); + } + errorBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.rpc.Status, + com.google.rpc.Status.Builder, + com.google.rpc.StatusOrBuilder>( + (com.google.rpc.Status) response_, getParentForChildren(), isClean()); + response_ = null; + } + responseCase_ = 2; + onChanged(); + ; + return errorBuilder_; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.showcase.v1beta1.BlockResponse, + com.google.showcase.v1beta1.BlockResponse.Builder, + com.google.showcase.v1beta1.BlockResponseOrBuilder> + successBuilder_; + + /** + * + * + *
        +     * The response to be returned that will signify successful method call.
        +     * 
        + * + * .google.showcase.v1beta1.BlockResponse success = 3; + * + * @return Whether the success field is set. + */ + @java.lang.Override + public boolean hasSuccess() { + return responseCase_ == 3; + } + + /** + * + * + *
        +     * The response to be returned that will signify successful method call.
        +     * 
        + * + * .google.showcase.v1beta1.BlockResponse success = 3; + * + * @return The success. + */ + @java.lang.Override + public com.google.showcase.v1beta1.BlockResponse getSuccess() { + if (successBuilder_ == null) { + if (responseCase_ == 3) { + return (com.google.showcase.v1beta1.BlockResponse) response_; + } + return com.google.showcase.v1beta1.BlockResponse.getDefaultInstance(); + } else { + if (responseCase_ == 3) { + return successBuilder_.getMessage(); + } + return com.google.showcase.v1beta1.BlockResponse.getDefaultInstance(); + } + } + + /** + * + * + *
        +     * The response to be returned that will signify successful method call.
        +     * 
        + * + * .google.showcase.v1beta1.BlockResponse success = 3; + */ + public Builder setSuccess(com.google.showcase.v1beta1.BlockResponse value) { + if (successBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + response_ = value; + onChanged(); + } else { + successBuilder_.setMessage(value); + } + responseCase_ = 3; + return this; + } + + /** + * + * + *
        +     * The response to be returned that will signify successful method call.
        +     * 
        + * + * .google.showcase.v1beta1.BlockResponse success = 3; + */ + public Builder setSuccess(com.google.showcase.v1beta1.BlockResponse.Builder builderForValue) { + if (successBuilder_ == null) { + response_ = builderForValue.build(); + onChanged(); + } else { + successBuilder_.setMessage(builderForValue.build()); + } + responseCase_ = 3; + return this; + } + + /** + * + * + *
        +     * The response to be returned that will signify successful method call.
        +     * 
        + * + * .google.showcase.v1beta1.BlockResponse success = 3; + */ + public Builder mergeSuccess(com.google.showcase.v1beta1.BlockResponse value) { + if (successBuilder_ == null) { + if (responseCase_ == 3 + && response_ != com.google.showcase.v1beta1.BlockResponse.getDefaultInstance()) { + response_ = + com.google.showcase.v1beta1.BlockResponse.newBuilder( + (com.google.showcase.v1beta1.BlockResponse) response_) + .mergeFrom(value) + .buildPartial(); + } else { + response_ = value; + } + onChanged(); + } else { + if (responseCase_ == 3) { + successBuilder_.mergeFrom(value); + } else { + successBuilder_.setMessage(value); + } + } + responseCase_ = 3; + return this; + } + + /** + * + * + *
        +     * The response to be returned that will signify successful method call.
        +     * 
        + * + * .google.showcase.v1beta1.BlockResponse success = 3; + */ + public Builder clearSuccess() { + if (successBuilder_ == null) { + if (responseCase_ == 3) { + responseCase_ = 0; + response_ = null; + onChanged(); + } + } else { + if (responseCase_ == 3) { + responseCase_ = 0; + response_ = null; + } + successBuilder_.clear(); + } + return this; + } + + /** + * + * + *
        +     * The response to be returned that will signify successful method call.
        +     * 
        + * + * .google.showcase.v1beta1.BlockResponse success = 3; + */ + public com.google.showcase.v1beta1.BlockResponse.Builder getSuccessBuilder() { + return getSuccessFieldBuilder().getBuilder(); + } + + /** + * + * + *
        +     * The response to be returned that will signify successful method call.
        +     * 
        + * + * .google.showcase.v1beta1.BlockResponse success = 3; + */ + @java.lang.Override + public com.google.showcase.v1beta1.BlockResponseOrBuilder getSuccessOrBuilder() { + if ((responseCase_ == 3) && (successBuilder_ != null)) { + return successBuilder_.getMessageOrBuilder(); + } else { + if (responseCase_ == 3) { + return (com.google.showcase.v1beta1.BlockResponse) response_; + } + return com.google.showcase.v1beta1.BlockResponse.getDefaultInstance(); + } + } + + /** + * + * + *
        +     * The response to be returned that will signify successful method call.
        +     * 
        + * + * .google.showcase.v1beta1.BlockResponse success = 3; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.showcase.v1beta1.BlockResponse, + com.google.showcase.v1beta1.BlockResponse.Builder, + com.google.showcase.v1beta1.BlockResponseOrBuilder> + getSuccessFieldBuilder() { + if (successBuilder_ == null) { + if (!(responseCase_ == 3)) { + response_ = com.google.showcase.v1beta1.BlockResponse.getDefaultInstance(); + } + successBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.showcase.v1beta1.BlockResponse, + com.google.showcase.v1beta1.BlockResponse.Builder, + com.google.showcase.v1beta1.BlockResponseOrBuilder>( + (com.google.showcase.v1beta1.BlockResponse) response_, + getParentForChildren(), + isClean()); + response_ = null; + } + responseCase_ = 3; + onChanged(); + ; + return successBuilder_; + } + + @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.showcase.v1beta1.BlockRequest) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.BlockRequest) + private static final com.google.showcase.v1beta1.BlockRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.BlockRequest(); + } + + public static com.google.showcase.v1beta1.BlockRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public BlockRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new BlockRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.showcase.v1beta1.BlockRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/BlockRequestOrBuilder.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/BlockRequestOrBuilder.java new file mode 100644 index 0000000000..6c60854c42 --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/BlockRequestOrBuilder.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: schema/google/showcase/v1beta1/echo.proto + +package com.google.showcase.v1beta1; + +public interface BlockRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.BlockRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
        +   * The amount of time to block before returning a response.
        +   * 
        + * + * .google.protobuf.Duration response_delay = 1; + * + * @return Whether the responseDelay field is set. + */ + boolean hasResponseDelay(); + + /** + * + * + *
        +   * The amount of time to block before returning a response.
        +   * 
        + * + * .google.protobuf.Duration response_delay = 1; + * + * @return The responseDelay. + */ + com.google.protobuf.Duration getResponseDelay(); + + /** + * + * + *
        +   * The amount of time to block before returning a response.
        +   * 
        + * + * .google.protobuf.Duration response_delay = 1; + */ + com.google.protobuf.DurationOrBuilder getResponseDelayOrBuilder(); + + /** + * + * + *
        +   * The error that will be returned by the server. If this code is specified
        +   * to be the OK rpc code, an empty response will be returned.
        +   * 
        + * + * .google.rpc.Status error = 2; + * + * @return Whether the error field is set. + */ + boolean hasError(); + + /** + * + * + *
        +   * The error that will be returned by the server. If this code is specified
        +   * to be the OK rpc code, an empty response will be returned.
        +   * 
        + * + * .google.rpc.Status error = 2; + * + * @return The error. + */ + com.google.rpc.Status getError(); + + /** + * + * + *
        +   * The error that will be returned by the server. If this code is specified
        +   * to be the OK rpc code, an empty response will be returned.
        +   * 
        + * + * .google.rpc.Status error = 2; + */ + com.google.rpc.StatusOrBuilder getErrorOrBuilder(); + + /** + * + * + *
        +   * The response to be returned that will signify successful method call.
        +   * 
        + * + * .google.showcase.v1beta1.BlockResponse success = 3; + * + * @return Whether the success field is set. + */ + boolean hasSuccess(); + + /** + * + * + *
        +   * The response to be returned that will signify successful method call.
        +   * 
        + * + * .google.showcase.v1beta1.BlockResponse success = 3; + * + * @return The success. + */ + com.google.showcase.v1beta1.BlockResponse getSuccess(); + + /** + * + * + *
        +   * The response to be returned that will signify successful method call.
        +   * 
        + * + * .google.showcase.v1beta1.BlockResponse success = 3; + */ + com.google.showcase.v1beta1.BlockResponseOrBuilder getSuccessOrBuilder(); + + public com.google.showcase.v1beta1.BlockRequest.ResponseCase getResponseCase(); +} diff --git a/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/BlockResponse.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/BlockResponse.java new file mode 100644 index 0000000000..61e898ce4a --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/BlockResponse.java @@ -0,0 +1,652 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/echo.proto + +package com.google.showcase.v1beta1; + +/** + * + * + *
        + * The response for Block method.
        + * 
        + * + * Protobuf type {@code google.showcase.v1beta1.BlockResponse} + */ +public final class BlockResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.BlockResponse) + BlockResponseOrBuilder { + private static final long serialVersionUID = 0L; + + // Use BlockResponse.newBuilder() to construct. + private BlockResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private BlockResponse() { + content_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new BlockResponse(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private BlockResponse( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + content_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.EchoOuterClass + .internal_static_google_showcase_v1beta1_BlockResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.EchoOuterClass + .internal_static_google_showcase_v1beta1_BlockResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.BlockResponse.class, + com.google.showcase.v1beta1.BlockResponse.Builder.class); + } + + public static final int CONTENT_FIELD_NUMBER = 1; + private volatile java.lang.Object content_; + + /** + * + * + *
        +   * This content can contain anything, the server will not depend on a value
        +   * here.
        +   * 
        + * + * string content = 1; + * + * @return The content. + */ + @java.lang.Override + public java.lang.String getContent() { + java.lang.Object ref = content_; + 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(); + content_ = s; + return s; + } + } + + /** + * + * + *
        +   * This content can contain anything, the server will not depend on a value
        +   * here.
        +   * 
        + * + * string content = 1; + * + * @return The bytes for content. + */ + @java.lang.Override + public com.google.protobuf.ByteString getContentBytes() { + java.lang.Object ref = content_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + content_ = 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(content_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, content_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(content_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, content_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.showcase.v1beta1.BlockResponse)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.BlockResponse other = + (com.google.showcase.v1beta1.BlockResponse) obj; + + if (!getContent().equals(other.getContent())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + CONTENT_FIELD_NUMBER; + hash = (53 * hash) + getContent().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.showcase.v1beta1.BlockResponse parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.BlockResponse parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.BlockResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.BlockResponse 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.showcase.v1beta1.BlockResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.BlockResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.BlockResponse parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.BlockResponse 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.showcase.v1beta1.BlockResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.BlockResponse 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.showcase.v1beta1.BlockResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.BlockResponse 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.showcase.v1beta1.BlockResponse 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 for Block method.
        +   * 
        + * + * Protobuf type {@code google.showcase.v1beta1.BlockResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.BlockResponse) + com.google.showcase.v1beta1.BlockResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.EchoOuterClass + .internal_static_google_showcase_v1beta1_BlockResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.EchoOuterClass + .internal_static_google_showcase_v1beta1_BlockResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.BlockResponse.class, + com.google.showcase.v1beta1.BlockResponse.Builder.class); + } + + // Construct using com.google.showcase.v1beta1.BlockResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + content_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.showcase.v1beta1.EchoOuterClass + .internal_static_google_showcase_v1beta1_BlockResponse_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.BlockResponse getDefaultInstanceForType() { + return com.google.showcase.v1beta1.BlockResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.BlockResponse build() { + com.google.showcase.v1beta1.BlockResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.BlockResponse buildPartial() { + com.google.showcase.v1beta1.BlockResponse result = + new com.google.showcase.v1beta1.BlockResponse(this); + result.content_ = content_; + 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.showcase.v1beta1.BlockResponse) { + return mergeFrom((com.google.showcase.v1beta1.BlockResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.showcase.v1beta1.BlockResponse other) { + if (other == com.google.showcase.v1beta1.BlockResponse.getDefaultInstance()) return this; + if (!other.getContent().isEmpty()) { + content_ = other.content_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.showcase.v1beta1.BlockResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.showcase.v1beta1.BlockResponse) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object content_ = ""; + + /** + * + * + *
        +     * This content can contain anything, the server will not depend on a value
        +     * here.
        +     * 
        + * + * string content = 1; + * + * @return The content. + */ + public java.lang.String getContent() { + java.lang.Object ref = content_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + content_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
        +     * This content can contain anything, the server will not depend on a value
        +     * here.
        +     * 
        + * + * string content = 1; + * + * @return The bytes for content. + */ + public com.google.protobuf.ByteString getContentBytes() { + java.lang.Object ref = content_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + content_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
        +     * This content can contain anything, the server will not depend on a value
        +     * here.
        +     * 
        + * + * string content = 1; + * + * @param value The content to set. + * @return This builder for chaining. + */ + public Builder setContent(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + content_ = value; + onChanged(); + return this; + } + + /** + * + * + *
        +     * This content can contain anything, the server will not depend on a value
        +     * here.
        +     * 
        + * + * string content = 1; + * + * @return This builder for chaining. + */ + public Builder clearContent() { + + content_ = getDefaultInstance().getContent(); + onChanged(); + return this; + } + + /** + * + * + *
        +     * This content can contain anything, the server will not depend on a value
        +     * here.
        +     * 
        + * + * string content = 1; + * + * @param value The bytes for content to set. + * @return This builder for chaining. + */ + public Builder setContentBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + content_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.showcase.v1beta1.BlockResponse) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.BlockResponse) + private static final com.google.showcase.v1beta1.BlockResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.BlockResponse(); + } + + public static com.google.showcase.v1beta1.BlockResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public BlockResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new BlockResponse(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.showcase.v1beta1.BlockResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/BlockResponseOrBuilder.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/BlockResponseOrBuilder.java new file mode 100644 index 0000000000..ca73f88030 --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/BlockResponseOrBuilder.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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/echo.proto + +package com.google.showcase.v1beta1; + +public interface BlockResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.BlockResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
        +   * This content can contain anything, the server will not depend on a value
        +   * here.
        +   * 
        + * + * string content = 1; + * + * @return The content. + */ + java.lang.String getContent(); + + /** + * + * + *
        +   * This content can contain anything, the server will not depend on a value
        +   * here.
        +   * 
        + * + * string content = 1; + * + * @return The bytes for content. + */ + com.google.protobuf.ByteString getContentBytes(); +} diff --git a/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/Blurb.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/Blurb.java new file mode 100644 index 0000000000..000967a381 --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/Blurb.java @@ -0,0 +1,2517 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/messaging.proto + +package com.google.showcase.v1beta1; + +/** + * + * + *
        + * This protocol buffer message represents a blurb sent to a chat room or
        + * posted on a user profile.
        + * 
        + * + * Protobuf type {@code google.showcase.v1beta1.Blurb} + */ +public final class Blurb extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.Blurb) + BlurbOrBuilder { + private static final long serialVersionUID = 0L; + + // Use Blurb.newBuilder() to construct. + private Blurb(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Blurb() { + name_ = ""; + user_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Blurb(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private Blurb( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + user_ = s; + break; + } + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + contentCase_ = 3; + content_ = s; + break; + } + case 34: + { + content_ = input.readBytes(); + contentCase_ = 4; + break; + } + case 42: + { + com.google.protobuf.Timestamp.Builder subBuilder = null; + if (createTime_ != null) { + subBuilder = createTime_.toBuilder(); + } + createTime_ = + input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(createTime_); + createTime_ = subBuilder.buildPartial(); + } + + break; + } + case 50: + { + com.google.protobuf.Timestamp.Builder subBuilder = null; + if (updateTime_ != null) { + subBuilder = updateTime_.toBuilder(); + } + updateTime_ = + input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(updateTime_); + updateTime_ = subBuilder.buildPartial(); + } + + break; + } + case 58: + { + java.lang.String s = input.readStringRequireUtf8(); + legacyIdCase_ = 7; + legacyId_ = s; + break; + } + case 66: + { + java.lang.String s = input.readStringRequireUtf8(); + legacyIdCase_ = 8; + legacyId_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.MessagingOuterClass + .internal_static_google_showcase_v1beta1_Blurb_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.MessagingOuterClass + .internal_static_google_showcase_v1beta1_Blurb_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.Blurb.class, + com.google.showcase.v1beta1.Blurb.Builder.class); + } + + private int contentCase_ = 0; + private java.lang.Object content_; + + public enum ContentCase + implements + com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + TEXT(3), + IMAGE(4), + CONTENT_NOT_SET(0); + private final int value; + + private ContentCase(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 ContentCase valueOf(int value) { + return forNumber(value); + } + + public static ContentCase forNumber(int value) { + switch (value) { + case 3: + return TEXT; + case 4: + return IMAGE; + case 0: + return CONTENT_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public ContentCase getContentCase() { + return ContentCase.forNumber(contentCase_); + } + + private int legacyIdCase_ = 0; + private java.lang.Object legacyId_; + + public enum LegacyIdCase + implements + com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + LEGACY_ROOM_ID(7), + LEGACY_USER_ID(8), + LEGACYID_NOT_SET(0); + private final int value; + + private LegacyIdCase(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 LegacyIdCase valueOf(int value) { + return forNumber(value); + } + + public static LegacyIdCase forNumber(int value) { + switch (value) { + case 7: + return LEGACY_ROOM_ID; + case 8: + return LEGACY_USER_ID; + case 0: + return LEGACYID_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public LegacyIdCase getLegacyIdCase() { + return LegacyIdCase.forNumber(legacyIdCase_); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + + /** + * + * + *
        +   * The resource name of the chat room.
        +   * 
        + * + * 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 chat room.
        +   * 
        + * + * 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 USER_FIELD_NUMBER = 2; + private volatile java.lang.Object user_; + + /** + * + * + *
        +   * The resource name of the blurb's author.
        +   * 
        + * + * + * string user = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The user. + */ + @java.lang.Override + public java.lang.String getUser() { + java.lang.Object ref = user_; + 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(); + user_ = s; + return s; + } + } + + /** + * + * + *
        +   * The resource name of the blurb's author.
        +   * 
        + * + * + * string user = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for user. + */ + @java.lang.Override + public com.google.protobuf.ByteString getUserBytes() { + java.lang.Object ref = user_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + user_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int TEXT_FIELD_NUMBER = 3; + + /** + * + * + *
        +   * The textual content of this blurb.
        +   * 
        + * + * string text = 3; + * + * @return Whether the text field is set. + */ + public boolean hasText() { + return contentCase_ == 3; + } + + /** + * + * + *
        +   * The textual content of this blurb.
        +   * 
        + * + * string text = 3; + * + * @return The text. + */ + public java.lang.String getText() { + java.lang.Object ref = ""; + if (contentCase_ == 3) { + ref = content_; + } + 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 (contentCase_ == 3) { + content_ = s; + } + return s; + } + } + + /** + * + * + *
        +   * The textual content of this blurb.
        +   * 
        + * + * string text = 3; + * + * @return The bytes for text. + */ + public com.google.protobuf.ByteString getTextBytes() { + java.lang.Object ref = ""; + if (contentCase_ == 3) { + ref = content_; + } + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + if (contentCase_ == 3) { + content_ = b; + } + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int IMAGE_FIELD_NUMBER = 4; + + /** + * + * + *
        +   * The image content of this blurb.
        +   * 
        + * + * bytes image = 4; + * + * @return Whether the image field is set. + */ + @java.lang.Override + public boolean hasImage() { + return contentCase_ == 4; + } + + /** + * + * + *
        +   * The image content of this blurb.
        +   * 
        + * + * bytes image = 4; + * + * @return The image. + */ + @java.lang.Override + public com.google.protobuf.ByteString getImage() { + if (contentCase_ == 4) { + return (com.google.protobuf.ByteString) content_; + } + return com.google.protobuf.ByteString.EMPTY; + } + + public static final int CREATE_TIME_FIELD_NUMBER = 5; + private com.google.protobuf.Timestamp createTime_; + + /** + * + * + *
        +   * The timestamp at which the blurb was created.
        +   * 
        + * + * .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 createTime_ != null; + } + + /** + * + * + *
        +   * The timestamp at which the blurb was created.
        +   * 
        + * + * .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_; + } + + /** + * + * + *
        +   * The timestamp at which the blurb was created.
        +   * 
        + * + * .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { + return getCreateTime(); + } + + public static final int UPDATE_TIME_FIELD_NUMBER = 6; + private com.google.protobuf.Timestamp updateTime_; + + /** + * + * + *
        +   * The latest timestamp at which the blurb was updated.
        +   * 
        + * + * .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 updateTime_ != null; + } + + /** + * + * + *
        +   * The latest timestamp at which the blurb was updated.
        +   * 
        + * + * .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_; + } + + /** + * + * + *
        +   * The latest timestamp at which the blurb was updated.
        +   * 
        + * + * .google.protobuf.Timestamp update_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder() { + return getUpdateTime(); + } + + public static final int LEGACY_ROOM_ID_FIELD_NUMBER = 7; + + /** + * + * + *
        +   * The legacy id of the room. This field is used to signal
        +   * the use of the compound resource pattern
        +   * `rooms/{room}/blurbs/legacy/{legacy_room}.{blurb}`
        +   * 
        + * + * string legacy_room_id = 7; + * + * @return Whether the legacyRoomId field is set. + */ + public boolean hasLegacyRoomId() { + return legacyIdCase_ == 7; + } + + /** + * + * + *
        +   * The legacy id of the room. This field is used to signal
        +   * the use of the compound resource pattern
        +   * `rooms/{room}/blurbs/legacy/{legacy_room}.{blurb}`
        +   * 
        + * + * string legacy_room_id = 7; + * + * @return The legacyRoomId. + */ + public java.lang.String getLegacyRoomId() { + java.lang.Object ref = ""; + if (legacyIdCase_ == 7) { + ref = legacyId_; + } + 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 (legacyIdCase_ == 7) { + legacyId_ = s; + } + return s; + } + } + + /** + * + * + *
        +   * The legacy id of the room. This field is used to signal
        +   * the use of the compound resource pattern
        +   * `rooms/{room}/blurbs/legacy/{legacy_room}.{blurb}`
        +   * 
        + * + * string legacy_room_id = 7; + * + * @return The bytes for legacyRoomId. + */ + public com.google.protobuf.ByteString getLegacyRoomIdBytes() { + java.lang.Object ref = ""; + if (legacyIdCase_ == 7) { + ref = legacyId_; + } + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + if (legacyIdCase_ == 7) { + legacyId_ = b; + } + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int LEGACY_USER_ID_FIELD_NUMBER = 8; + + /** + * + * + *
        +   * The legacy id of the user. This field is used to signal
        +   * the use of the compound resource pattern
        +   * `users/{user}/profile/blurbs/legacy/{legacy_user}~{blurb}`
        +   * 
        + * + * string legacy_user_id = 8; + * + * @return Whether the legacyUserId field is set. + */ + public boolean hasLegacyUserId() { + return legacyIdCase_ == 8; + } + + /** + * + * + *
        +   * The legacy id of the user. This field is used to signal
        +   * the use of the compound resource pattern
        +   * `users/{user}/profile/blurbs/legacy/{legacy_user}~{blurb}`
        +   * 
        + * + * string legacy_user_id = 8; + * + * @return The legacyUserId. + */ + public java.lang.String getLegacyUserId() { + java.lang.Object ref = ""; + if (legacyIdCase_ == 8) { + ref = legacyId_; + } + 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 (legacyIdCase_ == 8) { + legacyId_ = s; + } + return s; + } + } + + /** + * + * + *
        +   * The legacy id of the user. This field is used to signal
        +   * the use of the compound resource pattern
        +   * `users/{user}/profile/blurbs/legacy/{legacy_user}~{blurb}`
        +   * 
        + * + * string legacy_user_id = 8; + * + * @return The bytes for legacyUserId. + */ + public com.google.protobuf.ByteString getLegacyUserIdBytes() { + java.lang.Object ref = ""; + if (legacyIdCase_ == 8) { + ref = legacyId_; + } + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + if (legacyIdCase_ == 8) { + legacyId_ = 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(user_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, user_); + } + if (contentCase_ == 3) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, content_); + } + if (contentCase_ == 4) { + output.writeBytes(4, (com.google.protobuf.ByteString) content_); + } + if (createTime_ != null) { + output.writeMessage(5, getCreateTime()); + } + if (updateTime_ != null) { + output.writeMessage(6, getUpdateTime()); + } + if (legacyIdCase_ == 7) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 7, legacyId_); + } + if (legacyIdCase_ == 8) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 8, legacyId_); + } + unknownFields.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(user_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, user_); + } + if (contentCase_ == 3) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, content_); + } + if (contentCase_ == 4) { + size += + com.google.protobuf.CodedOutputStream.computeBytesSize( + 4, (com.google.protobuf.ByteString) content_); + } + if (createTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(5, getCreateTime()); + } + if (updateTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(6, getUpdateTime()); + } + if (legacyIdCase_ == 7) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(7, legacyId_); + } + if (legacyIdCase_ == 8) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(8, legacyId_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.showcase.v1beta1.Blurb)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.Blurb other = (com.google.showcase.v1beta1.Blurb) obj; + + if (!getName().equals(other.getName())) return false; + if (!getUser().equals(other.getUser())) 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 (!getContentCase().equals(other.getContentCase())) return false; + switch (contentCase_) { + case 3: + if (!getText().equals(other.getText())) return false; + break; + case 4: + if (!getImage().equals(other.getImage())) return false; + break; + case 0: + default: + } + if (!getLegacyIdCase().equals(other.getLegacyIdCase())) return false; + switch (legacyIdCase_) { + case 7: + if (!getLegacyRoomId().equals(other.getLegacyRoomId())) return false; + break; + case 8: + if (!getLegacyUserId().equals(other.getLegacyUserId())) return false; + break; + case 0: + default: + } + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (37 * hash) + USER_FIELD_NUMBER; + hash = (53 * hash) + getUser().hashCode(); + if (hasCreateTime()) { + hash = (37 * hash) + CREATE_TIME_FIELD_NUMBER; + hash = (53 * hash) + getCreateTime().hashCode(); + } + if (hasUpdateTime()) { + hash = (37 * hash) + UPDATE_TIME_FIELD_NUMBER; + hash = (53 * hash) + getUpdateTime().hashCode(); + } + switch (contentCase_) { + case 3: + hash = (37 * hash) + TEXT_FIELD_NUMBER; + hash = (53 * hash) + getText().hashCode(); + break; + case 4: + hash = (37 * hash) + IMAGE_FIELD_NUMBER; + hash = (53 * hash) + getImage().hashCode(); + break; + case 0: + default: + } + switch (legacyIdCase_) { + case 7: + hash = (37 * hash) + LEGACY_ROOM_ID_FIELD_NUMBER; + hash = (53 * hash) + getLegacyRoomId().hashCode(); + break; + case 8: + hash = (37 * hash) + LEGACY_USER_ID_FIELD_NUMBER; + hash = (53 * hash) + getLegacyUserId().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.showcase.v1beta1.Blurb parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.Blurb parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.Blurb parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.Blurb 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.showcase.v1beta1.Blurb parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.Blurb parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.Blurb parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.Blurb 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.showcase.v1beta1.Blurb parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.Blurb 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.showcase.v1beta1.Blurb parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.Blurb 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.showcase.v1beta1.Blurb 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; + } + + /** + * + * + *
        +   * This protocol buffer message represents a blurb sent to a chat room or
        +   * posted on a user profile.
        +   * 
        + * + * Protobuf type {@code google.showcase.v1beta1.Blurb} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.Blurb) + com.google.showcase.v1beta1.BlurbOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.MessagingOuterClass + .internal_static_google_showcase_v1beta1_Blurb_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.MessagingOuterClass + .internal_static_google_showcase_v1beta1_Blurb_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.Blurb.class, + com.google.showcase.v1beta1.Blurb.Builder.class); + } + + // Construct using com.google.showcase.v1beta1.Blurb.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + user_ = ""; + + if (createTimeBuilder_ == null) { + createTime_ = null; + } else { + createTime_ = null; + createTimeBuilder_ = null; + } + if (updateTimeBuilder_ == null) { + updateTime_ = null; + } else { + updateTime_ = null; + updateTimeBuilder_ = null; + } + contentCase_ = 0; + content_ = null; + legacyIdCase_ = 0; + legacyId_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.showcase.v1beta1.MessagingOuterClass + .internal_static_google_showcase_v1beta1_Blurb_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.Blurb getDefaultInstanceForType() { + return com.google.showcase.v1beta1.Blurb.getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.Blurb build() { + com.google.showcase.v1beta1.Blurb result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.Blurb buildPartial() { + com.google.showcase.v1beta1.Blurb result = new com.google.showcase.v1beta1.Blurb(this); + result.name_ = name_; + result.user_ = user_; + if (contentCase_ == 3) { + result.content_ = content_; + } + if (contentCase_ == 4) { + result.content_ = content_; + } + if (createTimeBuilder_ == null) { + result.createTime_ = createTime_; + } else { + result.createTime_ = createTimeBuilder_.build(); + } + if (updateTimeBuilder_ == null) { + result.updateTime_ = updateTime_; + } else { + result.updateTime_ = updateTimeBuilder_.build(); + } + if (legacyIdCase_ == 7) { + result.legacyId_ = legacyId_; + } + if (legacyIdCase_ == 8) { + result.legacyId_ = legacyId_; + } + result.contentCase_ = contentCase_; + result.legacyIdCase_ = legacyIdCase_; + 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.showcase.v1beta1.Blurb) { + return mergeFrom((com.google.showcase.v1beta1.Blurb) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.showcase.v1beta1.Blurb other) { + if (other == com.google.showcase.v1beta1.Blurb.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + if (!other.getUser().isEmpty()) { + user_ = other.user_; + onChanged(); + } + if (other.hasCreateTime()) { + mergeCreateTime(other.getCreateTime()); + } + if (other.hasUpdateTime()) { + mergeUpdateTime(other.getUpdateTime()); + } + switch (other.getContentCase()) { + case TEXT: + { + contentCase_ = 3; + content_ = other.content_; + onChanged(); + break; + } + case IMAGE: + { + setImage(other.getImage()); + break; + } + case CONTENT_NOT_SET: + { + break; + } + } + switch (other.getLegacyIdCase()) { + case LEGACY_ROOM_ID: + { + legacyIdCase_ = 7; + legacyId_ = other.legacyId_; + onChanged(); + break; + } + case LEGACY_USER_ID: + { + legacyIdCase_ = 8; + legacyId_ = other.legacyId_; + onChanged(); + break; + } + case LEGACYID_NOT_SET: + { + break; + } + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.showcase.v1beta1.Blurb parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.showcase.v1beta1.Blurb) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int contentCase_ = 0; + private java.lang.Object content_; + + public ContentCase getContentCase() { + return ContentCase.forNumber(contentCase_); + } + + public Builder clearContent() { + contentCase_ = 0; + content_ = null; + onChanged(); + return this; + } + + private int legacyIdCase_ = 0; + private java.lang.Object legacyId_; + + public LegacyIdCase getLegacyIdCase() { + return LegacyIdCase.forNumber(legacyIdCase_); + } + + public Builder clearLegacyId() { + legacyIdCase_ = 0; + legacyId_ = null; + onChanged(); + return this; + } + + private java.lang.Object name_ = ""; + + /** + * + * + *
        +     * The resource name of the chat room.
        +     * 
        + * + * 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 chat room.
        +     * 
        + * + * 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 chat room.
        +     * 
        + * + * string name = 1; + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + + /** + * + * + *
        +     * The resource name of the chat room.
        +     * 
        + * + * string name = 1; + * + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + + /** + * + * + *
        +     * The resource name of the chat room.
        +     * 
        + * + * string name = 1; + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + + private java.lang.Object user_ = ""; + + /** + * + * + *
        +     * The resource name of the blurb's author.
        +     * 
        + * + * + * string user = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The user. + */ + public java.lang.String getUser() { + java.lang.Object ref = user_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + user_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
        +     * The resource name of the blurb's author.
        +     * 
        + * + * + * string user = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for user. + */ + public com.google.protobuf.ByteString getUserBytes() { + java.lang.Object ref = user_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + user_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
        +     * The resource name of the blurb's author.
        +     * 
        + * + * + * string user = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The user to set. + * @return This builder for chaining. + */ + public Builder setUser(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + user_ = value; + onChanged(); + return this; + } + + /** + * + * + *
        +     * The resource name of the blurb's author.
        +     * 
        + * + * + * string user = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearUser() { + + user_ = getDefaultInstance().getUser(); + onChanged(); + return this; + } + + /** + * + * + *
        +     * The resource name of the blurb's author.
        +     * 
        + * + * + * string user = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for user to set. + * @return This builder for chaining. + */ + public Builder setUserBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + user_ = value; + onChanged(); + return this; + } + + /** + * + * + *
        +     * The textual content of this blurb.
        +     * 
        + * + * string text = 3; + * + * @return Whether the text field is set. + */ + @java.lang.Override + public boolean hasText() { + return contentCase_ == 3; + } + + /** + * + * + *
        +     * The textual content of this blurb.
        +     * 
        + * + * string text = 3; + * + * @return The text. + */ + @java.lang.Override + public java.lang.String getText() { + java.lang.Object ref = ""; + if (contentCase_ == 3) { + ref = content_; + } + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (contentCase_ == 3) { + content_ = s; + } + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
        +     * The textual content of this blurb.
        +     * 
        + * + * string text = 3; + * + * @return The bytes for text. + */ + @java.lang.Override + public com.google.protobuf.ByteString getTextBytes() { + java.lang.Object ref = ""; + if (contentCase_ == 3) { + ref = content_; + } + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + if (contentCase_ == 3) { + content_ = b; + } + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
        +     * The textual content of this blurb.
        +     * 
        + * + * string text = 3; + * + * @param value The text to set. + * @return This builder for chaining. + */ + public Builder setText(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + contentCase_ = 3; + content_ = value; + onChanged(); + return this; + } + + /** + * + * + *
        +     * The textual content of this blurb.
        +     * 
        + * + * string text = 3; + * + * @return This builder for chaining. + */ + public Builder clearText() { + if (contentCase_ == 3) { + contentCase_ = 0; + content_ = null; + onChanged(); + } + return this; + } + + /** + * + * + *
        +     * The textual content of this blurb.
        +     * 
        + * + * string text = 3; + * + * @param value The bytes for text to set. + * @return This builder for chaining. + */ + public Builder setTextBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + contentCase_ = 3; + content_ = value; + onChanged(); + return this; + } + + /** + * + * + *
        +     * The image content of this blurb.
        +     * 
        + * + * bytes image = 4; + * + * @return Whether the image field is set. + */ + public boolean hasImage() { + return contentCase_ == 4; + } + + /** + * + * + *
        +     * The image content of this blurb.
        +     * 
        + * + * bytes image = 4; + * + * @return The image. + */ + public com.google.protobuf.ByteString getImage() { + if (contentCase_ == 4) { + return (com.google.protobuf.ByteString) content_; + } + return com.google.protobuf.ByteString.EMPTY; + } + + /** + * + * + *
        +     * The image content of this blurb.
        +     * 
        + * + * bytes image = 4; + * + * @param value The image to set. + * @return This builder for chaining. + */ + public Builder setImage(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + contentCase_ = 4; + content_ = value; + onChanged(); + return this; + } + + /** + * + * + *
        +     * The image content of this blurb.
        +     * 
        + * + * bytes image = 4; + * + * @return This builder for chaining. + */ + public Builder clearImage() { + if (contentCase_ == 4) { + contentCase_ = 0; + content_ = null; + 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_; + + /** + * + * + *
        +     * The timestamp at which the blurb was created.
        +     * 
        + * + * + * .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the createTime field is set. + */ + public boolean hasCreateTime() { + return createTimeBuilder_ != null || createTime_ != null; + } + + /** + * + * + *
        +     * The timestamp at which the blurb was created.
        +     * 
        + * + * + * .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(); + } + } + + /** + * + * + *
        +     * The timestamp at which the blurb was created.
        +     * 
        + * + * + * .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; + onChanged(); + } else { + createTimeBuilder_.setMessage(value); + } + + return this; + } + + /** + * + * + *
        +     * The timestamp at which the blurb was created.
        +     * 
        + * + * + * .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(); + onChanged(); + } else { + createTimeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + + /** + * + * + *
        +     * The timestamp at which the blurb was created.
        +     * 
        + * + * + * .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeCreateTime(com.google.protobuf.Timestamp value) { + if (createTimeBuilder_ == null) { + if (createTime_ != null) { + createTime_ = + com.google.protobuf.Timestamp.newBuilder(createTime_).mergeFrom(value).buildPartial(); + } else { + createTime_ = value; + } + onChanged(); + } else { + createTimeBuilder_.mergeFrom(value); + } + + return this; + } + + /** + * + * + *
        +     * The timestamp at which the blurb was created.
        +     * 
        + * + * + * .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearCreateTime() { + if (createTimeBuilder_ == null) { + createTime_ = null; + onChanged(); + } else { + createTime_ = null; + createTimeBuilder_ = null; + } + + return this; + } + + /** + * + * + *
        +     * The timestamp at which the blurb was created.
        +     * 
        + * + * + * .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.Timestamp.Builder getCreateTimeBuilder() { + + onChanged(); + return getCreateTimeFieldBuilder().getBuilder(); + } + + /** + * + * + *
        +     * The timestamp at which the blurb was created.
        +     * 
        + * + * + * .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_; + } + } + + /** + * + * + *
        +     * The timestamp at which the blurb was created.
        +     * 
        + * + * + * .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_; + + /** + * + * + *
        +     * The latest timestamp at which the blurb was updated.
        +     * 
        + * + * + * .google.protobuf.Timestamp update_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the updateTime field is set. + */ + public boolean hasUpdateTime() { + return updateTimeBuilder_ != null || updateTime_ != null; + } + + /** + * + * + *
        +     * The latest timestamp at which the blurb was updated.
        +     * 
        + * + * + * .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(); + } + } + + /** + * + * + *
        +     * The latest timestamp at which the blurb was updated.
        +     * 
        + * + * + * .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; + onChanged(); + } else { + updateTimeBuilder_.setMessage(value); + } + + return this; + } + + /** + * + * + *
        +     * The latest timestamp at which the blurb was updated.
        +     * 
        + * + * + * .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(); + onChanged(); + } else { + updateTimeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + + /** + * + * + *
        +     * The latest timestamp at which the blurb was updated.
        +     * 
        + * + * + * .google.protobuf.Timestamp update_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeUpdateTime(com.google.protobuf.Timestamp value) { + if (updateTimeBuilder_ == null) { + if (updateTime_ != null) { + updateTime_ = + com.google.protobuf.Timestamp.newBuilder(updateTime_).mergeFrom(value).buildPartial(); + } else { + updateTime_ = value; + } + onChanged(); + } else { + updateTimeBuilder_.mergeFrom(value); + } + + return this; + } + + /** + * + * + *
        +     * The latest timestamp at which the blurb was updated.
        +     * 
        + * + * + * .google.protobuf.Timestamp update_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearUpdateTime() { + if (updateTimeBuilder_ == null) { + updateTime_ = null; + onChanged(); + } else { + updateTime_ = null; + updateTimeBuilder_ = null; + } + + return this; + } + + /** + * + * + *
        +     * The latest timestamp at which the blurb was updated.
        +     * 
        + * + * + * .google.protobuf.Timestamp update_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.Timestamp.Builder getUpdateTimeBuilder() { + + onChanged(); + return getUpdateTimeFieldBuilder().getBuilder(); + } + + /** + * + * + *
        +     * The latest timestamp at which the blurb was updated.
        +     * 
        + * + * + * .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_; + } + } + + /** + * + * + *
        +     * The latest timestamp at which the blurb was updated.
        +     * 
        + * + * + * .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_; + } + + /** + * + * + *
        +     * The legacy id of the room. This field is used to signal
        +     * the use of the compound resource pattern
        +     * `rooms/{room}/blurbs/legacy/{legacy_room}.{blurb}`
        +     * 
        + * + * string legacy_room_id = 7; + * + * @return Whether the legacyRoomId field is set. + */ + @java.lang.Override + public boolean hasLegacyRoomId() { + return legacyIdCase_ == 7; + } + + /** + * + * + *
        +     * The legacy id of the room. This field is used to signal
        +     * the use of the compound resource pattern
        +     * `rooms/{room}/blurbs/legacy/{legacy_room}.{blurb}`
        +     * 
        + * + * string legacy_room_id = 7; + * + * @return The legacyRoomId. + */ + @java.lang.Override + public java.lang.String getLegacyRoomId() { + java.lang.Object ref = ""; + if (legacyIdCase_ == 7) { + ref = legacyId_; + } + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (legacyIdCase_ == 7) { + legacyId_ = s; + } + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
        +     * The legacy id of the room. This field is used to signal
        +     * the use of the compound resource pattern
        +     * `rooms/{room}/blurbs/legacy/{legacy_room}.{blurb}`
        +     * 
        + * + * string legacy_room_id = 7; + * + * @return The bytes for legacyRoomId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getLegacyRoomIdBytes() { + java.lang.Object ref = ""; + if (legacyIdCase_ == 7) { + ref = legacyId_; + } + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + if (legacyIdCase_ == 7) { + legacyId_ = b; + } + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
        +     * The legacy id of the room. This field is used to signal
        +     * the use of the compound resource pattern
        +     * `rooms/{room}/blurbs/legacy/{legacy_room}.{blurb}`
        +     * 
        + * + * string legacy_room_id = 7; + * + * @param value The legacyRoomId to set. + * @return This builder for chaining. + */ + public Builder setLegacyRoomId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + legacyIdCase_ = 7; + legacyId_ = value; + onChanged(); + return this; + } + + /** + * + * + *
        +     * The legacy id of the room. This field is used to signal
        +     * the use of the compound resource pattern
        +     * `rooms/{room}/blurbs/legacy/{legacy_room}.{blurb}`
        +     * 
        + * + * string legacy_room_id = 7; + * + * @return This builder for chaining. + */ + public Builder clearLegacyRoomId() { + if (legacyIdCase_ == 7) { + legacyIdCase_ = 0; + legacyId_ = null; + onChanged(); + } + return this; + } + + /** + * + * + *
        +     * The legacy id of the room. This field is used to signal
        +     * the use of the compound resource pattern
        +     * `rooms/{room}/blurbs/legacy/{legacy_room}.{blurb}`
        +     * 
        + * + * string legacy_room_id = 7; + * + * @param value The bytes for legacyRoomId to set. + * @return This builder for chaining. + */ + public Builder setLegacyRoomIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + legacyIdCase_ = 7; + legacyId_ = value; + onChanged(); + return this; + } + + /** + * + * + *
        +     * The legacy id of the user. This field is used to signal
        +     * the use of the compound resource pattern
        +     * `users/{user}/profile/blurbs/legacy/{legacy_user}~{blurb}`
        +     * 
        + * + * string legacy_user_id = 8; + * + * @return Whether the legacyUserId field is set. + */ + @java.lang.Override + public boolean hasLegacyUserId() { + return legacyIdCase_ == 8; + } + + /** + * + * + *
        +     * The legacy id of the user. This field is used to signal
        +     * the use of the compound resource pattern
        +     * `users/{user}/profile/blurbs/legacy/{legacy_user}~{blurb}`
        +     * 
        + * + * string legacy_user_id = 8; + * + * @return The legacyUserId. + */ + @java.lang.Override + public java.lang.String getLegacyUserId() { + java.lang.Object ref = ""; + if (legacyIdCase_ == 8) { + ref = legacyId_; + } + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (legacyIdCase_ == 8) { + legacyId_ = s; + } + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
        +     * The legacy id of the user. This field is used to signal
        +     * the use of the compound resource pattern
        +     * `users/{user}/profile/blurbs/legacy/{legacy_user}~{blurb}`
        +     * 
        + * + * string legacy_user_id = 8; + * + * @return The bytes for legacyUserId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getLegacyUserIdBytes() { + java.lang.Object ref = ""; + if (legacyIdCase_ == 8) { + ref = legacyId_; + } + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + if (legacyIdCase_ == 8) { + legacyId_ = b; + } + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
        +     * The legacy id of the user. This field is used to signal
        +     * the use of the compound resource pattern
        +     * `users/{user}/profile/blurbs/legacy/{legacy_user}~{blurb}`
        +     * 
        + * + * string legacy_user_id = 8; + * + * @param value The legacyUserId to set. + * @return This builder for chaining. + */ + public Builder setLegacyUserId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + legacyIdCase_ = 8; + legacyId_ = value; + onChanged(); + return this; + } + + /** + * + * + *
        +     * The legacy id of the user. This field is used to signal
        +     * the use of the compound resource pattern
        +     * `users/{user}/profile/blurbs/legacy/{legacy_user}~{blurb}`
        +     * 
        + * + * string legacy_user_id = 8; + * + * @return This builder for chaining. + */ + public Builder clearLegacyUserId() { + if (legacyIdCase_ == 8) { + legacyIdCase_ = 0; + legacyId_ = null; + onChanged(); + } + return this; + } + + /** + * + * + *
        +     * The legacy id of the user. This field is used to signal
        +     * the use of the compound resource pattern
        +     * `users/{user}/profile/blurbs/legacy/{legacy_user}~{blurb}`
        +     * 
        + * + * string legacy_user_id = 8; + * + * @param value The bytes for legacyUserId to set. + * @return This builder for chaining. + */ + public Builder setLegacyUserIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + legacyIdCase_ = 8; + legacyId_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.showcase.v1beta1.Blurb) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.Blurb) + private static final com.google.showcase.v1beta1.Blurb DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.Blurb(); + } + + public static com.google.showcase.v1beta1.Blurb getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Blurb parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Blurb(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.showcase.v1beta1.Blurb getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/BlurbName.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/BlurbName.java new file mode 100644 index 0000000000..cd7fed2a8a --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/BlurbName.java @@ -0,0 +1,458 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1; + +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 BlurbName implements ResourceName { + private static final PathTemplate USER_LEGACY_USER_BLURB = + PathTemplate.createWithoutUrlEncoding( + "users/{user}/profile/blurbs/legacy/{legacy_user}~{blurb}"); + private static final PathTemplate USER_BLURB = + PathTemplate.createWithoutUrlEncoding("users/{user}/profile/blurbs/{blurb}"); + private static final PathTemplate ROOM_BLURB = + PathTemplate.createWithoutUrlEncoding("rooms/{room}/blurbs/{blurb}"); + private static final PathTemplate ROOM_LEGACY_ROOM_BLURB = + PathTemplate.createWithoutUrlEncoding("rooms/{room}/blurbs/legacy/{legacy_room}.{blurb}"); + private volatile Map fieldValuesMap; + private PathTemplate pathTemplate; + private String fixedValue; + private final String user; + private final String legacyUser; + private final String blurb; + private final String room; + private final String legacyRoom; + + @Deprecated + protected BlurbName() { + user = null; + legacyUser = null; + blurb = null; + room = null; + legacyRoom = null; + } + + private BlurbName(Builder builder) { + user = Preconditions.checkNotNull(builder.getUser()); + legacyUser = Preconditions.checkNotNull(builder.getLegacyUser()); + blurb = Preconditions.checkNotNull(builder.getBlurb()); + room = null; + legacyRoom = null; + pathTemplate = USER_LEGACY_USER_BLURB; + } + + private BlurbName(UserBlurbBuilder builder) { + user = Preconditions.checkNotNull(builder.getUser()); + blurb = Preconditions.checkNotNull(builder.getBlurb()); + legacyUser = null; + room = null; + legacyRoom = null; + pathTemplate = USER_BLURB; + } + + private BlurbName(RoomBlurbBuilder builder) { + room = Preconditions.checkNotNull(builder.getRoom()); + blurb = Preconditions.checkNotNull(builder.getBlurb()); + user = null; + legacyUser = null; + legacyRoom = null; + pathTemplate = ROOM_BLURB; + } + + private BlurbName(RoomLegacyRoomBlurbBuilder builder) { + room = Preconditions.checkNotNull(builder.getRoom()); + legacyRoom = Preconditions.checkNotNull(builder.getLegacyRoom()); + blurb = Preconditions.checkNotNull(builder.getBlurb()); + user = null; + legacyUser = null; + pathTemplate = ROOM_LEGACY_ROOM_BLURB; + } + + public String getUser() { + return user; + } + + public String getLegacyUser() { + return legacyUser; + } + + public String getBlurb() { + return blurb; + } + + public String getRoom() { + return room; + } + + public String getLegacyRoom() { + return legacyRoom; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public static Builder newUserLegacyUserBlurbBuilder() { + return new Builder(); + } + + public static UserBlurbBuilder newUserBlurbBuilder() { + return new UserBlurbBuilder(); + } + + public static RoomBlurbBuilder newRoomBlurbBuilder() { + return new RoomBlurbBuilder(); + } + + public static RoomLegacyRoomBlurbBuilder newRoomLegacyRoomBlurbBuilder() { + return new RoomLegacyRoomBlurbBuilder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + public static BlurbName of(String user, String legacyUser, String blurb) { + return newBuilder().setUser(user).setLegacyUser(legacyUser).setBlurb(blurb).build(); + } + + public static BlurbName ofUserLegacyUserBlurbName(String user, String legacyUser, String blurb) { + return newBuilder().setUser(user).setLegacyUser(legacyUser).setBlurb(blurb).build(); + } + + public static BlurbName ofUserBlurbName(String user, String blurb) { + return newUserBlurbBuilder().setUser(user).setBlurb(blurb).build(); + } + + public static BlurbName ofRoomBlurbName(String room, String blurb) { + return newRoomBlurbBuilder().setRoom(room).setBlurb(blurb).build(); + } + + public static BlurbName ofRoomLegacyRoomBlurbName(String room, String legacyRoom, String blurb) { + return newRoomLegacyRoomBlurbBuilder() + .setRoom(room) + .setLegacyRoom(legacyRoom) + .setBlurb(blurb) + .build(); + } + + public static String format(String user, String legacyUser, String blurb) { + return newBuilder().setUser(user).setLegacyUser(legacyUser).setBlurb(blurb).build().toString(); + } + + public static String formatUserLegacyUserBlurbName(String user, String legacyUser, String blurb) { + return newBuilder().setUser(user).setLegacyUser(legacyUser).setBlurb(blurb).build().toString(); + } + + public static String formatUserBlurbName(String user, String blurb) { + return newUserBlurbBuilder().setUser(user).setBlurb(blurb).build().toString(); + } + + public static String formatRoomBlurbName(String room, String blurb) { + return newRoomBlurbBuilder().setRoom(room).setBlurb(blurb).build().toString(); + } + + public static String formatRoomLegacyRoomBlurbName(String room, String legacyRoom, String blurb) { + return newRoomLegacyRoomBlurbBuilder() + .setRoom(room) + .setLegacyRoom(legacyRoom) + .setBlurb(blurb) + .build() + .toString(); + } + + public static BlurbName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + if (USER_LEGACY_USER_BLURB.matches(formattedString)) { + Map matchMap = USER_LEGACY_USER_BLURB.match(formattedString); + return ofUserLegacyUserBlurbName( + matchMap.get("user"), matchMap.get("legacy_user"), matchMap.get("blurb")); + } else if (USER_BLURB.matches(formattedString)) { + Map matchMap = USER_BLURB.match(formattedString); + return ofUserBlurbName(matchMap.get("user"), matchMap.get("blurb")); + } else if (ROOM_BLURB.matches(formattedString)) { + Map matchMap = ROOM_BLURB.match(formattedString); + return ofRoomBlurbName(matchMap.get("room"), matchMap.get("blurb")); + } else if (ROOM_LEGACY_ROOM_BLURB.matches(formattedString)) { + Map matchMap = ROOM_LEGACY_ROOM_BLURB.match(formattedString); + return ofRoomLegacyRoomBlurbName( + matchMap.get("room"), matchMap.get("legacy_room"), matchMap.get("blurb")); + } + throw new ValidationException("BlurbName.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 (BlurbName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return USER_LEGACY_USER_BLURB.matches(formattedString) + || USER_BLURB.matches(formattedString) + || ROOM_BLURB.matches(formattedString) + || ROOM_LEGACY_ROOM_BLURB.matches(formattedString); + } + + @Override + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + if (user != null) { + fieldMapBuilder.put("user", user); + } + if (legacyUser != null) { + fieldMapBuilder.put("legacy_user", legacyUser); + } + if (blurb != null) { + fieldMapBuilder.put("blurb", blurb); + } + if (room != null) { + fieldMapBuilder.put("room", room); + } + if (legacyRoom != null) { + fieldMapBuilder.put("legacy_room", legacyRoom); + } + 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()) { + BlurbName that = ((BlurbName) o); + return Objects.equals(this.user, that.user) + && Objects.equals(this.legacyUser, that.legacyUser) + && Objects.equals(this.blurb, that.blurb) + && Objects.equals(this.room, that.room) + && Objects.equals(this.legacyRoom, that.legacyRoom); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= Objects.hashCode(fixedValue); + h *= 1000003; + h ^= Objects.hashCode(user); + h *= 1000003; + h ^= Objects.hashCode(legacyUser); + h *= 1000003; + h ^= Objects.hashCode(blurb); + h *= 1000003; + h ^= Objects.hashCode(room); + h *= 1000003; + h ^= Objects.hashCode(legacyRoom); + return h; + } + + /** Builder for users/{user}/profile/blurbs/legacy/{legacy_user}~{blurb}. */ + public static class Builder { + private String user; + private String legacyUser; + private String blurb; + + protected Builder() {} + + public String getUser() { + return user; + } + + public String getLegacyUser() { + return legacyUser; + } + + public String getBlurb() { + return blurb; + } + + public Builder setUser(String user) { + this.user = user; + return this; + } + + public Builder setLegacyUser(String legacyUser) { + this.legacyUser = legacyUser; + return this; + } + + public Builder setBlurb(String blurb) { + this.blurb = blurb; + return this; + } + + private Builder(BlurbName blurbName) { + Preconditions.checkArgument( + Objects.equals(blurbName.pathTemplate, USER_LEGACY_USER_BLURB), + "toBuilder is only supported when BlurbName has the pattern of" + + " users/{user}/profile/blurbs/legacy/{legacy_user}~{blurb}"); + this.user = blurbName.user; + this.legacyUser = blurbName.legacyUser; + this.blurb = blurbName.blurb; + } + + public BlurbName build() { + return new BlurbName(this); + } + } + + /** Builder for users/{user}/profile/blurbs/{blurb}. */ + public static class UserBlurbBuilder { + private String user; + private String blurb; + + protected UserBlurbBuilder() {} + + public String getUser() { + return user; + } + + public String getBlurb() { + return blurb; + } + + public UserBlurbBuilder setUser(String user) { + this.user = user; + return this; + } + + public UserBlurbBuilder setBlurb(String blurb) { + this.blurb = blurb; + return this; + } + + public BlurbName build() { + return new BlurbName(this); + } + } + + /** Builder for rooms/{room}/blurbs/{blurb}. */ + public static class RoomBlurbBuilder { + private String room; + private String blurb; + + protected RoomBlurbBuilder() {} + + public String getRoom() { + return room; + } + + public String getBlurb() { + return blurb; + } + + public RoomBlurbBuilder setRoom(String room) { + this.room = room; + return this; + } + + public RoomBlurbBuilder setBlurb(String blurb) { + this.blurb = blurb; + return this; + } + + public BlurbName build() { + return new BlurbName(this); + } + } + + /** Builder for rooms/{room}/blurbs/legacy/{legacy_room}.{blurb}. */ + public static class RoomLegacyRoomBlurbBuilder { + private String room; + private String legacyRoom; + private String blurb; + + protected RoomLegacyRoomBlurbBuilder() {} + + public String getRoom() { + return room; + } + + public String getLegacyRoom() { + return legacyRoom; + } + + public String getBlurb() { + return blurb; + } + + public RoomLegacyRoomBlurbBuilder setRoom(String room) { + this.room = room; + return this; + } + + public RoomLegacyRoomBlurbBuilder setLegacyRoom(String legacyRoom) { + this.legacyRoom = legacyRoom; + return this; + } + + public RoomLegacyRoomBlurbBuilder setBlurb(String blurb) { + this.blurb = blurb; + return this; + } + + public BlurbName build() { + return new BlurbName(this); + } + } +} diff --git a/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/BlurbOrBuilder.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/BlurbOrBuilder.java new file mode 100644 index 0000000000..6d1bbf363a --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/BlurbOrBuilder.java @@ -0,0 +1,320 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/messaging.proto + +package com.google.showcase.v1beta1; + +public interface BlurbOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.Blurb) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
        +   * The resource name of the chat room.
        +   * 
        + * + * string name = 1; + * + * @return The name. + */ + java.lang.String getName(); + + /** + * + * + *
        +   * The resource name of the chat room.
        +   * 
        + * + * string name = 1; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
        +   * The resource name of the blurb's author.
        +   * 
        + * + * + * string user = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The user. + */ + java.lang.String getUser(); + + /** + * + * + *
        +   * The resource name of the blurb's author.
        +   * 
        + * + * + * string user = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for user. + */ + com.google.protobuf.ByteString getUserBytes(); + + /** + * + * + *
        +   * The textual content of this blurb.
        +   * 
        + * + * string text = 3; + * + * @return Whether the text field is set. + */ + boolean hasText(); + + /** + * + * + *
        +   * The textual content of this blurb.
        +   * 
        + * + * string text = 3; + * + * @return The text. + */ + java.lang.String getText(); + + /** + * + * + *
        +   * The textual content of this blurb.
        +   * 
        + * + * string text = 3; + * + * @return The bytes for text. + */ + com.google.protobuf.ByteString getTextBytes(); + + /** + * + * + *
        +   * The image content of this blurb.
        +   * 
        + * + * bytes image = 4; + * + * @return Whether the image field is set. + */ + boolean hasImage(); + + /** + * + * + *
        +   * The image content of this blurb.
        +   * 
        + * + * bytes image = 4; + * + * @return The image. + */ + com.google.protobuf.ByteString getImage(); + + /** + * + * + *
        +   * The timestamp at which the blurb was created.
        +   * 
        + * + * .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the createTime field is set. + */ + boolean hasCreateTime(); + + /** + * + * + *
        +   * The timestamp at which the blurb was created.
        +   * 
        + * + * .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The createTime. + */ + com.google.protobuf.Timestamp getCreateTime(); + + /** + * + * + *
        +   * The timestamp at which the blurb was created.
        +   * 
        + * + * .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder(); + + /** + * + * + *
        +   * The latest timestamp at which the blurb was updated.
        +   * 
        + * + * .google.protobuf.Timestamp update_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the updateTime field is set. + */ + boolean hasUpdateTime(); + + /** + * + * + *
        +   * The latest timestamp at which the blurb was updated.
        +   * 
        + * + * .google.protobuf.Timestamp update_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The updateTime. + */ + com.google.protobuf.Timestamp getUpdateTime(); + + /** + * + * + *
        +   * The latest timestamp at which the blurb was updated.
        +   * 
        + * + * .google.protobuf.Timestamp update_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder(); + + /** + * + * + *
        +   * The legacy id of the room. This field is used to signal
        +   * the use of the compound resource pattern
        +   * `rooms/{room}/blurbs/legacy/{legacy_room}.{blurb}`
        +   * 
        + * + * string legacy_room_id = 7; + * + * @return Whether the legacyRoomId field is set. + */ + boolean hasLegacyRoomId(); + + /** + * + * + *
        +   * The legacy id of the room. This field is used to signal
        +   * the use of the compound resource pattern
        +   * `rooms/{room}/blurbs/legacy/{legacy_room}.{blurb}`
        +   * 
        + * + * string legacy_room_id = 7; + * + * @return The legacyRoomId. + */ + java.lang.String getLegacyRoomId(); + + /** + * + * + *
        +   * The legacy id of the room. This field is used to signal
        +   * the use of the compound resource pattern
        +   * `rooms/{room}/blurbs/legacy/{legacy_room}.{blurb}`
        +   * 
        + * + * string legacy_room_id = 7; + * + * @return The bytes for legacyRoomId. + */ + com.google.protobuf.ByteString getLegacyRoomIdBytes(); + + /** + * + * + *
        +   * The legacy id of the user. This field is used to signal
        +   * the use of the compound resource pattern
        +   * `users/{user}/profile/blurbs/legacy/{legacy_user}~{blurb}`
        +   * 
        + * + * string legacy_user_id = 8; + * + * @return Whether the legacyUserId field is set. + */ + boolean hasLegacyUserId(); + + /** + * + * + *
        +   * The legacy id of the user. This field is used to signal
        +   * the use of the compound resource pattern
        +   * `users/{user}/profile/blurbs/legacy/{legacy_user}~{blurb}`
        +   * 
        + * + * string legacy_user_id = 8; + * + * @return The legacyUserId. + */ + java.lang.String getLegacyUserId(); + + /** + * + * + *
        +   * The legacy id of the user. This field is used to signal
        +   * the use of the compound resource pattern
        +   * `users/{user}/profile/blurbs/legacy/{legacy_user}~{blurb}`
        +   * 
        + * + * string legacy_user_id = 8; + * + * @return The bytes for legacyUserId. + */ + com.google.protobuf.ByteString getLegacyUserIdBytes(); + + public com.google.showcase.v1beta1.Blurb.ContentCase getContentCase(); + + public com.google.showcase.v1beta1.Blurb.LegacyIdCase getLegacyIdCase(); +} diff --git a/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ComplianceData.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ComplianceData.java new file mode 100644 index 0000000000..ad646647b2 --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ComplianceData.java @@ -0,0 +1,2887 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/compliance.proto + +package com.google.showcase.v1beta1; + +/** + * + * + *
        + * ComplianceData is a message used for testing REST transcoding of
        + * different data types.
        + * 
        + * + * Protobuf type {@code google.showcase.v1beta1.ComplianceData} + */ +public final class ComplianceData extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.ComplianceData) + ComplianceDataOrBuilder { + private static final long serialVersionUID = 0L; + + // Use ComplianceData.newBuilder() to construct. + private ComplianceData(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ComplianceData() { + fString_ = ""; + fBytes_ = com.google.protobuf.ByteString.EMPTY; + fKingdom_ = 0; + pString_ = ""; + pKingdom_ = 0; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ComplianceData(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ComplianceData( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + fString_ = s; + break; + } + case 16: + { + fInt32_ = input.readInt32(); + break; + } + case 24: + { + fSint32_ = input.readSInt32(); + break; + } + case 37: + { + fSfixed32_ = input.readSFixed32(); + break; + } + case 40: + { + fUint32_ = input.readUInt32(); + break; + } + case 53: + { + fFixed32_ = input.readFixed32(); + break; + } + case 56: + { + fInt64_ = input.readInt64(); + break; + } + case 64: + { + fSint64_ = input.readSInt64(); + break; + } + case 73: + { + fSfixed64_ = input.readSFixed64(); + break; + } + case 80: + { + fUint64_ = input.readUInt64(); + break; + } + case 89: + { + fFixed64_ = input.readFixed64(); + break; + } + case 97: + { + fDouble_ = input.readDouble(); + break; + } + case 109: + { + fFloat_ = input.readFloat(); + break; + } + case 112: + { + fBool_ = input.readBool(); + break; + } + case 122: + { + fBytes_ = input.readBytes(); + break; + } + case 130: + { + com.google.showcase.v1beta1.ComplianceDataChild.Builder subBuilder = null; + if (fChild_ != null) { + subBuilder = fChild_.toBuilder(); + } + fChild_ = + input.readMessage( + com.google.showcase.v1beta1.ComplianceDataChild.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(fChild_); + fChild_ = subBuilder.buildPartial(); + } + + break; + } + case 138: + { + java.lang.String s = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + pString_ = s; + break; + } + case 144: + { + bitField0_ |= 0x00000002; + pInt32_ = input.readInt32(); + break; + } + case 153: + { + bitField0_ |= 0x00000004; + pDouble_ = input.readDouble(); + break; + } + case 160: + { + bitField0_ |= 0x00000008; + pBool_ = input.readBool(); + break; + } + case 170: + { + com.google.showcase.v1beta1.ComplianceDataChild.Builder subBuilder = null; + if (((bitField0_ & 0x00000020) != 0)) { + subBuilder = pChild_.toBuilder(); + } + pChild_ = + input.readMessage( + com.google.showcase.v1beta1.ComplianceDataChild.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(pChild_); + pChild_ = subBuilder.buildPartial(); + } + bitField0_ |= 0x00000020; + break; + } + case 176: + { + int rawValue = input.readEnum(); + + fKingdom_ = rawValue; + break; + } + case 184: + { + int rawValue = input.readEnum(); + bitField0_ |= 0x00000010; + pKingdom_ = rawValue; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.ComplianceOuterClass + .internal_static_google_showcase_v1beta1_ComplianceData_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.ComplianceOuterClass + .internal_static_google_showcase_v1beta1_ComplianceData_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.ComplianceData.class, + com.google.showcase.v1beta1.ComplianceData.Builder.class); + } + + /** Protobuf enum {@code google.showcase.v1beta1.ComplianceData.LifeKingdom} */ + public enum LifeKingdom implements com.google.protobuf.ProtocolMessageEnum { + /** LIFE_KINGDOM_UNSPECIFIED = 0; */ + LIFE_KINGDOM_UNSPECIFIED(0), + /** ARCHAEBACTERIA = 1; */ + ARCHAEBACTERIA(1), + /** EUBACTERIA = 2; */ + EUBACTERIA(2), + /** PROTISTA = 3; */ + PROTISTA(3), + /** FUNGI = 4; */ + FUNGI(4), + /** PLANTAE = 5; */ + PLANTAE(5), + /** ANIMALIA = 6; */ + ANIMALIA(6), + UNRECOGNIZED(-1), + ; + + /** LIFE_KINGDOM_UNSPECIFIED = 0; */ + public static final int LIFE_KINGDOM_UNSPECIFIED_VALUE = 0; + + /** ARCHAEBACTERIA = 1; */ + public static final int ARCHAEBACTERIA_VALUE = 1; + + /** EUBACTERIA = 2; */ + public static final int EUBACTERIA_VALUE = 2; + + /** PROTISTA = 3; */ + public static final int PROTISTA_VALUE = 3; + + /** FUNGI = 4; */ + public static final int FUNGI_VALUE = 4; + + /** PLANTAE = 5; */ + public static final int PLANTAE_VALUE = 5; + + /** ANIMALIA = 6; */ + public static final int ANIMALIA_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 LifeKingdom 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 LifeKingdom forNumber(int value) { + switch (value) { + case 0: + return LIFE_KINGDOM_UNSPECIFIED; + case 1: + return ARCHAEBACTERIA; + case 2: + return EUBACTERIA; + case 3: + return PROTISTA; + case 4: + return FUNGI; + case 5: + return PLANTAE; + case 6: + return ANIMALIA; + 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 LifeKingdom findValueByNumber(int number) { + return LifeKingdom.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.showcase.v1beta1.ComplianceData.getDescriptor().getEnumTypes().get(0); + } + + private static final LifeKingdom[] VALUES = values(); + + public static LifeKingdom 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 LifeKingdom(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.showcase.v1beta1.ComplianceData.LifeKingdom) + } + + private int bitField0_; + public static final int F_STRING_FIELD_NUMBER = 1; + private volatile java.lang.Object fString_; + + /** + * string f_string = 1; + * + * @return The fString. + */ + @java.lang.Override + public java.lang.String getFString() { + java.lang.Object ref = fString_; + 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(); + fString_ = s; + return s; + } + } + + /** + * string f_string = 1; + * + * @return The bytes for fString. + */ + @java.lang.Override + public com.google.protobuf.ByteString getFStringBytes() { + java.lang.Object ref = fString_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + fString_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int F_INT32_FIELD_NUMBER = 2; + private int fInt32_; + + /** + * int32 f_int32 = 2; + * + * @return The fInt32. + */ + @java.lang.Override + public int getFInt32() { + return fInt32_; + } + + public static final int F_SINT32_FIELD_NUMBER = 3; + private int fSint32_; + + /** + * sint32 f_sint32 = 3; + * + * @return The fSint32. + */ + @java.lang.Override + public int getFSint32() { + return fSint32_; + } + + public static final int F_SFIXED32_FIELD_NUMBER = 4; + private int fSfixed32_; + + /** + * sfixed32 f_sfixed32 = 4; + * + * @return The fSfixed32. + */ + @java.lang.Override + public int getFSfixed32() { + return fSfixed32_; + } + + public static final int F_UINT32_FIELD_NUMBER = 5; + private int fUint32_; + + /** + * uint32 f_uint32 = 5; + * + * @return The fUint32. + */ + @java.lang.Override + public int getFUint32() { + return fUint32_; + } + + public static final int F_FIXED32_FIELD_NUMBER = 6; + private int fFixed32_; + + /** + * fixed32 f_fixed32 = 6; + * + * @return The fFixed32. + */ + @java.lang.Override + public int getFFixed32() { + return fFixed32_; + } + + public static final int F_INT64_FIELD_NUMBER = 7; + private long fInt64_; + + /** + * int64 f_int64 = 7; + * + * @return The fInt64. + */ + @java.lang.Override + public long getFInt64() { + return fInt64_; + } + + public static final int F_SINT64_FIELD_NUMBER = 8; + private long fSint64_; + + /** + * sint64 f_sint64 = 8; + * + * @return The fSint64. + */ + @java.lang.Override + public long getFSint64() { + return fSint64_; + } + + public static final int F_SFIXED64_FIELD_NUMBER = 9; + private long fSfixed64_; + + /** + * sfixed64 f_sfixed64 = 9; + * + * @return The fSfixed64. + */ + @java.lang.Override + public long getFSfixed64() { + return fSfixed64_; + } + + public static final int F_UINT64_FIELD_NUMBER = 10; + private long fUint64_; + + /** + * uint64 f_uint64 = 10; + * + * @return The fUint64. + */ + @java.lang.Override + public long getFUint64() { + return fUint64_; + } + + public static final int F_FIXED64_FIELD_NUMBER = 11; + private long fFixed64_; + + /** + * fixed64 f_fixed64 = 11; + * + * @return The fFixed64. + */ + @java.lang.Override + public long getFFixed64() { + return fFixed64_; + } + + public static final int F_DOUBLE_FIELD_NUMBER = 12; + private double fDouble_; + + /** + * double f_double = 12; + * + * @return The fDouble. + */ + @java.lang.Override + public double getFDouble() { + return fDouble_; + } + + public static final int F_FLOAT_FIELD_NUMBER = 13; + private float fFloat_; + + /** + * float f_float = 13; + * + * @return The fFloat. + */ + @java.lang.Override + public float getFFloat() { + return fFloat_; + } + + public static final int F_BOOL_FIELD_NUMBER = 14; + private boolean fBool_; + + /** + * bool f_bool = 14; + * + * @return The fBool. + */ + @java.lang.Override + public boolean getFBool() { + return fBool_; + } + + public static final int F_BYTES_FIELD_NUMBER = 15; + private com.google.protobuf.ByteString fBytes_; + + /** + * bytes f_bytes = 15; + * + * @return The fBytes. + */ + @java.lang.Override + public com.google.protobuf.ByteString getFBytes() { + return fBytes_; + } + + public static final int F_KINGDOM_FIELD_NUMBER = 22; + private int fKingdom_; + + /** + * .google.showcase.v1beta1.ComplianceData.LifeKingdom f_kingdom = 22; + * + * @return The enum numeric value on the wire for fKingdom. + */ + @java.lang.Override + public int getFKingdomValue() { + return fKingdom_; + } + + /** + * .google.showcase.v1beta1.ComplianceData.LifeKingdom f_kingdom = 22; + * + * @return The fKingdom. + */ + @java.lang.Override + public com.google.showcase.v1beta1.ComplianceData.LifeKingdom getFKingdom() { + @SuppressWarnings("deprecation") + com.google.showcase.v1beta1.ComplianceData.LifeKingdom result = + com.google.showcase.v1beta1.ComplianceData.LifeKingdom.valueOf(fKingdom_); + return result == null + ? com.google.showcase.v1beta1.ComplianceData.LifeKingdom.UNRECOGNIZED + : result; + } + + public static final int F_CHILD_FIELD_NUMBER = 16; + private com.google.showcase.v1beta1.ComplianceDataChild fChild_; + + /** + * .google.showcase.v1beta1.ComplianceDataChild f_child = 16; + * + * @return Whether the fChild field is set. + */ + @java.lang.Override + public boolean hasFChild() { + return fChild_ != null; + } + + /** + * .google.showcase.v1beta1.ComplianceDataChild f_child = 16; + * + * @return The fChild. + */ + @java.lang.Override + public com.google.showcase.v1beta1.ComplianceDataChild getFChild() { + return fChild_ == null + ? com.google.showcase.v1beta1.ComplianceDataChild.getDefaultInstance() + : fChild_; + } + + /** .google.showcase.v1beta1.ComplianceDataChild f_child = 16; */ + @java.lang.Override + public com.google.showcase.v1beta1.ComplianceDataChildOrBuilder getFChildOrBuilder() { + return getFChild(); + } + + public static final int P_STRING_FIELD_NUMBER = 17; + private volatile java.lang.Object pString_; + + /** + * optional string p_string = 17; + * + * @return Whether the pString field is set. + */ + @java.lang.Override + public boolean hasPString() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * optional string p_string = 17; + * + * @return The pString. + */ + @java.lang.Override + public java.lang.String getPString() { + java.lang.Object ref = pString_; + 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(); + pString_ = s; + return s; + } + } + + /** + * optional string p_string = 17; + * + * @return The bytes for pString. + */ + @java.lang.Override + public com.google.protobuf.ByteString getPStringBytes() { + java.lang.Object ref = pString_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pString_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int P_INT32_FIELD_NUMBER = 18; + private int pInt32_; + + /** + * optional int32 p_int32 = 18; + * + * @return Whether the pInt32 field is set. + */ + @java.lang.Override + public boolean hasPInt32() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * optional int32 p_int32 = 18; + * + * @return The pInt32. + */ + @java.lang.Override + public int getPInt32() { + return pInt32_; + } + + public static final int P_DOUBLE_FIELD_NUMBER = 19; + private double pDouble_; + + /** + * optional double p_double = 19; + * + * @return Whether the pDouble field is set. + */ + @java.lang.Override + public boolean hasPDouble() { + return ((bitField0_ & 0x00000004) != 0); + } + + /** + * optional double p_double = 19; + * + * @return The pDouble. + */ + @java.lang.Override + public double getPDouble() { + return pDouble_; + } + + public static final int P_BOOL_FIELD_NUMBER = 20; + private boolean pBool_; + + /** + * optional bool p_bool = 20; + * + * @return Whether the pBool field is set. + */ + @java.lang.Override + public boolean hasPBool() { + return ((bitField0_ & 0x00000008) != 0); + } + + /** + * optional bool p_bool = 20; + * + * @return The pBool. + */ + @java.lang.Override + public boolean getPBool() { + return pBool_; + } + + public static final int P_KINGDOM_FIELD_NUMBER = 23; + private int pKingdom_; + + /** + * optional .google.showcase.v1beta1.ComplianceData.LifeKingdom p_kingdom = 23; + * + * @return Whether the pKingdom field is set. + */ + @java.lang.Override + public boolean hasPKingdom() { + return ((bitField0_ & 0x00000010) != 0); + } + + /** + * optional .google.showcase.v1beta1.ComplianceData.LifeKingdom p_kingdom = 23; + * + * @return The enum numeric value on the wire for pKingdom. + */ + @java.lang.Override + public int getPKingdomValue() { + return pKingdom_; + } + + /** + * optional .google.showcase.v1beta1.ComplianceData.LifeKingdom p_kingdom = 23; + * + * @return The pKingdom. + */ + @java.lang.Override + public com.google.showcase.v1beta1.ComplianceData.LifeKingdom getPKingdom() { + @SuppressWarnings("deprecation") + com.google.showcase.v1beta1.ComplianceData.LifeKingdom result = + com.google.showcase.v1beta1.ComplianceData.LifeKingdom.valueOf(pKingdom_); + return result == null + ? com.google.showcase.v1beta1.ComplianceData.LifeKingdom.UNRECOGNIZED + : result; + } + + public static final int P_CHILD_FIELD_NUMBER = 21; + private com.google.showcase.v1beta1.ComplianceDataChild pChild_; + + /** + * optional .google.showcase.v1beta1.ComplianceDataChild p_child = 21; + * + * @return Whether the pChild field is set. + */ + @java.lang.Override + public boolean hasPChild() { + return ((bitField0_ & 0x00000020) != 0); + } + + /** + * optional .google.showcase.v1beta1.ComplianceDataChild p_child = 21; + * + * @return The pChild. + */ + @java.lang.Override + public com.google.showcase.v1beta1.ComplianceDataChild getPChild() { + return pChild_ == null + ? com.google.showcase.v1beta1.ComplianceDataChild.getDefaultInstance() + : pChild_; + } + + /** optional .google.showcase.v1beta1.ComplianceDataChild p_child = 21; */ + @java.lang.Override + public com.google.showcase.v1beta1.ComplianceDataChildOrBuilder getPChildOrBuilder() { + return pChild_ == null + ? com.google.showcase.v1beta1.ComplianceDataChild.getDefaultInstance() + : pChild_; + } + + 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(fString_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, fString_); + } + if (fInt32_ != 0) { + output.writeInt32(2, fInt32_); + } + if (fSint32_ != 0) { + output.writeSInt32(3, fSint32_); + } + if (fSfixed32_ != 0) { + output.writeSFixed32(4, fSfixed32_); + } + if (fUint32_ != 0) { + output.writeUInt32(5, fUint32_); + } + if (fFixed32_ != 0) { + output.writeFixed32(6, fFixed32_); + } + if (fInt64_ != 0L) { + output.writeInt64(7, fInt64_); + } + if (fSint64_ != 0L) { + output.writeSInt64(8, fSint64_); + } + if (fSfixed64_ != 0L) { + output.writeSFixed64(9, fSfixed64_); + } + if (fUint64_ != 0L) { + output.writeUInt64(10, fUint64_); + } + if (fFixed64_ != 0L) { + output.writeFixed64(11, fFixed64_); + } + if (java.lang.Double.doubleToRawLongBits(fDouble_) != 0) { + output.writeDouble(12, fDouble_); + } + if (java.lang.Float.floatToRawIntBits(fFloat_) != 0) { + output.writeFloat(13, fFloat_); + } + if (fBool_ != false) { + output.writeBool(14, fBool_); + } + if (!fBytes_.isEmpty()) { + output.writeBytes(15, fBytes_); + } + if (fChild_ != null) { + output.writeMessage(16, getFChild()); + } + if (((bitField0_ & 0x00000001) != 0)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 17, pString_); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeInt32(18, pInt32_); + } + if (((bitField0_ & 0x00000004) != 0)) { + output.writeDouble(19, pDouble_); + } + if (((bitField0_ & 0x00000008) != 0)) { + output.writeBool(20, pBool_); + } + if (((bitField0_ & 0x00000020) != 0)) { + output.writeMessage(21, getPChild()); + } + if (fKingdom_ + != com.google.showcase.v1beta1.ComplianceData.LifeKingdom.LIFE_KINGDOM_UNSPECIFIED + .getNumber()) { + output.writeEnum(22, fKingdom_); + } + if (((bitField0_ & 0x00000010) != 0)) { + output.writeEnum(23, pKingdom_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(fString_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, fString_); + } + if (fInt32_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(2, fInt32_); + } + if (fSint32_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeSInt32Size(3, fSint32_); + } + if (fSfixed32_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeSFixed32Size(4, fSfixed32_); + } + if (fUint32_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeUInt32Size(5, fUint32_); + } + if (fFixed32_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeFixed32Size(6, fFixed32_); + } + if (fInt64_ != 0L) { + size += com.google.protobuf.CodedOutputStream.computeInt64Size(7, fInt64_); + } + if (fSint64_ != 0L) { + size += com.google.protobuf.CodedOutputStream.computeSInt64Size(8, fSint64_); + } + if (fSfixed64_ != 0L) { + size += com.google.protobuf.CodedOutputStream.computeSFixed64Size(9, fSfixed64_); + } + if (fUint64_ != 0L) { + size += com.google.protobuf.CodedOutputStream.computeUInt64Size(10, fUint64_); + } + if (fFixed64_ != 0L) { + size += com.google.protobuf.CodedOutputStream.computeFixed64Size(11, fFixed64_); + } + if (java.lang.Double.doubleToRawLongBits(fDouble_) != 0) { + size += com.google.protobuf.CodedOutputStream.computeDoubleSize(12, fDouble_); + } + if (java.lang.Float.floatToRawIntBits(fFloat_) != 0) { + size += com.google.protobuf.CodedOutputStream.computeFloatSize(13, fFloat_); + } + if (fBool_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(14, fBool_); + } + if (!fBytes_.isEmpty()) { + size += com.google.protobuf.CodedOutputStream.computeBytesSize(15, fBytes_); + } + if (fChild_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(16, getFChild()); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(17, pString_); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(18, pInt32_); + } + if (((bitField0_ & 0x00000004) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeDoubleSize(19, pDouble_); + } + if (((bitField0_ & 0x00000008) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(20, pBool_); + } + if (((bitField0_ & 0x00000020) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(21, getPChild()); + } + if (fKingdom_ + != com.google.showcase.v1beta1.ComplianceData.LifeKingdom.LIFE_KINGDOM_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(22, fKingdom_); + } + if (((bitField0_ & 0x00000010) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(23, pKingdom_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.showcase.v1beta1.ComplianceData)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.ComplianceData other = + (com.google.showcase.v1beta1.ComplianceData) obj; + + if (!getFString().equals(other.getFString())) return false; + if (getFInt32() != other.getFInt32()) return false; + if (getFSint32() != other.getFSint32()) return false; + if (getFSfixed32() != other.getFSfixed32()) return false; + if (getFUint32() != other.getFUint32()) return false; + if (getFFixed32() != other.getFFixed32()) return false; + if (getFInt64() != other.getFInt64()) return false; + if (getFSint64() != other.getFSint64()) return false; + if (getFSfixed64() != other.getFSfixed64()) return false; + if (getFUint64() != other.getFUint64()) return false; + if (getFFixed64() != other.getFFixed64()) return false; + if (java.lang.Double.doubleToLongBits(getFDouble()) + != java.lang.Double.doubleToLongBits(other.getFDouble())) return false; + if (java.lang.Float.floatToIntBits(getFFloat()) + != java.lang.Float.floatToIntBits(other.getFFloat())) return false; + if (getFBool() != other.getFBool()) return false; + if (!getFBytes().equals(other.getFBytes())) return false; + if (fKingdom_ != other.fKingdom_) return false; + if (hasFChild() != other.hasFChild()) return false; + if (hasFChild()) { + if (!getFChild().equals(other.getFChild())) return false; + } + if (hasPString() != other.hasPString()) return false; + if (hasPString()) { + if (!getPString().equals(other.getPString())) return false; + } + if (hasPInt32() != other.hasPInt32()) return false; + if (hasPInt32()) { + if (getPInt32() != other.getPInt32()) return false; + } + if (hasPDouble() != other.hasPDouble()) return false; + if (hasPDouble()) { + if (java.lang.Double.doubleToLongBits(getPDouble()) + != java.lang.Double.doubleToLongBits(other.getPDouble())) return false; + } + if (hasPBool() != other.hasPBool()) return false; + if (hasPBool()) { + if (getPBool() != other.getPBool()) return false; + } + if (hasPKingdom() != other.hasPKingdom()) return false; + if (hasPKingdom()) { + if (pKingdom_ != other.pKingdom_) return false; + } + if (hasPChild() != other.hasPChild()) return false; + if (hasPChild()) { + if (!getPChild().equals(other.getPChild())) return false; + } + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + F_STRING_FIELD_NUMBER; + hash = (53 * hash) + getFString().hashCode(); + hash = (37 * hash) + F_INT32_FIELD_NUMBER; + hash = (53 * hash) + getFInt32(); + hash = (37 * hash) + F_SINT32_FIELD_NUMBER; + hash = (53 * hash) + getFSint32(); + hash = (37 * hash) + F_SFIXED32_FIELD_NUMBER; + hash = (53 * hash) + getFSfixed32(); + hash = (37 * hash) + F_UINT32_FIELD_NUMBER; + hash = (53 * hash) + getFUint32(); + hash = (37 * hash) + F_FIXED32_FIELD_NUMBER; + hash = (53 * hash) + getFFixed32(); + hash = (37 * hash) + F_INT64_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getFInt64()); + hash = (37 * hash) + F_SINT64_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getFSint64()); + hash = (37 * hash) + F_SFIXED64_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getFSfixed64()); + hash = (37 * hash) + F_UINT64_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getFUint64()); + hash = (37 * hash) + F_FIXED64_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getFFixed64()); + hash = (37 * hash) + F_DOUBLE_FIELD_NUMBER; + hash = + (53 * hash) + + com.google.protobuf.Internal.hashLong( + java.lang.Double.doubleToLongBits(getFDouble())); + hash = (37 * hash) + F_FLOAT_FIELD_NUMBER; + hash = (53 * hash) + java.lang.Float.floatToIntBits(getFFloat()); + hash = (37 * hash) + F_BOOL_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getFBool()); + hash = (37 * hash) + F_BYTES_FIELD_NUMBER; + hash = (53 * hash) + getFBytes().hashCode(); + hash = (37 * hash) + F_KINGDOM_FIELD_NUMBER; + hash = (53 * hash) + fKingdom_; + if (hasFChild()) { + hash = (37 * hash) + F_CHILD_FIELD_NUMBER; + hash = (53 * hash) + getFChild().hashCode(); + } + if (hasPString()) { + hash = (37 * hash) + P_STRING_FIELD_NUMBER; + hash = (53 * hash) + getPString().hashCode(); + } + if (hasPInt32()) { + hash = (37 * hash) + P_INT32_FIELD_NUMBER; + hash = (53 * hash) + getPInt32(); + } + if (hasPDouble()) { + hash = (37 * hash) + P_DOUBLE_FIELD_NUMBER; + hash = + (53 * hash) + + com.google.protobuf.Internal.hashLong( + java.lang.Double.doubleToLongBits(getPDouble())); + } + if (hasPBool()) { + hash = (37 * hash) + P_BOOL_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getPBool()); + } + if (hasPKingdom()) { + hash = (37 * hash) + P_KINGDOM_FIELD_NUMBER; + hash = (53 * hash) + pKingdom_; + } + if (hasPChild()) { + hash = (37 * hash) + P_CHILD_FIELD_NUMBER; + hash = (53 * hash) + getPChild().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.showcase.v1beta1.ComplianceData parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.ComplianceData parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.ComplianceData parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.ComplianceData 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.showcase.v1beta1.ComplianceData parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.ComplianceData parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.ComplianceData parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.ComplianceData 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.showcase.v1beta1.ComplianceData parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.ComplianceData 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.showcase.v1beta1.ComplianceData parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.ComplianceData 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.showcase.v1beta1.ComplianceData 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; + } + + /** + * + * + *
        +   * ComplianceData is a message used for testing REST transcoding of
        +   * different data types.
        +   * 
        + * + * Protobuf type {@code google.showcase.v1beta1.ComplianceData} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.ComplianceData) + com.google.showcase.v1beta1.ComplianceDataOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.ComplianceOuterClass + .internal_static_google_showcase_v1beta1_ComplianceData_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.ComplianceOuterClass + .internal_static_google_showcase_v1beta1_ComplianceData_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.ComplianceData.class, + com.google.showcase.v1beta1.ComplianceData.Builder.class); + } + + // Construct using com.google.showcase.v1beta1.ComplianceData.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getPChildFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + fString_ = ""; + + fInt32_ = 0; + + fSint32_ = 0; + + fSfixed32_ = 0; + + fUint32_ = 0; + + fFixed32_ = 0; + + fInt64_ = 0L; + + fSint64_ = 0L; + + fSfixed64_ = 0L; + + fUint64_ = 0L; + + fFixed64_ = 0L; + + fDouble_ = 0D; + + fFloat_ = 0F; + + fBool_ = false; + + fBytes_ = com.google.protobuf.ByteString.EMPTY; + + fKingdom_ = 0; + + if (fChildBuilder_ == null) { + fChild_ = null; + } else { + fChild_ = null; + fChildBuilder_ = null; + } + pString_ = ""; + bitField0_ = (bitField0_ & ~0x00000001); + pInt32_ = 0; + bitField0_ = (bitField0_ & ~0x00000002); + pDouble_ = 0D; + bitField0_ = (bitField0_ & ~0x00000004); + pBool_ = false; + bitField0_ = (bitField0_ & ~0x00000008); + pKingdom_ = 0; + bitField0_ = (bitField0_ & ~0x00000010); + if (pChildBuilder_ == null) { + pChild_ = null; + } else { + pChildBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000020); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.showcase.v1beta1.ComplianceOuterClass + .internal_static_google_showcase_v1beta1_ComplianceData_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.ComplianceData getDefaultInstanceForType() { + return com.google.showcase.v1beta1.ComplianceData.getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.ComplianceData build() { + com.google.showcase.v1beta1.ComplianceData result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.ComplianceData buildPartial() { + com.google.showcase.v1beta1.ComplianceData result = + new com.google.showcase.v1beta1.ComplianceData(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + result.fString_ = fString_; + result.fInt32_ = fInt32_; + result.fSint32_ = fSint32_; + result.fSfixed32_ = fSfixed32_; + result.fUint32_ = fUint32_; + result.fFixed32_ = fFixed32_; + result.fInt64_ = fInt64_; + result.fSint64_ = fSint64_; + result.fSfixed64_ = fSfixed64_; + result.fUint64_ = fUint64_; + result.fFixed64_ = fFixed64_; + result.fDouble_ = fDouble_; + result.fFloat_ = fFloat_; + result.fBool_ = fBool_; + result.fBytes_ = fBytes_; + result.fKingdom_ = fKingdom_; + if (fChildBuilder_ == null) { + result.fChild_ = fChild_; + } else { + result.fChild_ = fChildBuilder_.build(); + } + if (((from_bitField0_ & 0x00000001) != 0)) { + to_bitField0_ |= 0x00000001; + } + result.pString_ = pString_; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.pInt32_ = pInt32_; + to_bitField0_ |= 0x00000002; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.pDouble_ = pDouble_; + to_bitField0_ |= 0x00000004; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.pBool_ = pBool_; + to_bitField0_ |= 0x00000008; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + to_bitField0_ |= 0x00000010; + } + result.pKingdom_ = pKingdom_; + if (((from_bitField0_ & 0x00000020) != 0)) { + if (pChildBuilder_ == null) { + result.pChild_ = pChild_; + } else { + result.pChild_ = pChildBuilder_.build(); + } + to_bitField0_ |= 0x00000020; + } + result.bitField0_ = to_bitField0_; + 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.showcase.v1beta1.ComplianceData) { + return mergeFrom((com.google.showcase.v1beta1.ComplianceData) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.showcase.v1beta1.ComplianceData other) { + if (other == com.google.showcase.v1beta1.ComplianceData.getDefaultInstance()) return this; + if (!other.getFString().isEmpty()) { + fString_ = other.fString_; + onChanged(); + } + if (other.getFInt32() != 0) { + setFInt32(other.getFInt32()); + } + if (other.getFSint32() != 0) { + setFSint32(other.getFSint32()); + } + if (other.getFSfixed32() != 0) { + setFSfixed32(other.getFSfixed32()); + } + if (other.getFUint32() != 0) { + setFUint32(other.getFUint32()); + } + if (other.getFFixed32() != 0) { + setFFixed32(other.getFFixed32()); + } + if (other.getFInt64() != 0L) { + setFInt64(other.getFInt64()); + } + if (other.getFSint64() != 0L) { + setFSint64(other.getFSint64()); + } + if (other.getFSfixed64() != 0L) { + setFSfixed64(other.getFSfixed64()); + } + if (other.getFUint64() != 0L) { + setFUint64(other.getFUint64()); + } + if (other.getFFixed64() != 0L) { + setFFixed64(other.getFFixed64()); + } + if (other.getFDouble() != 0D) { + setFDouble(other.getFDouble()); + } + if (other.getFFloat() != 0F) { + setFFloat(other.getFFloat()); + } + if (other.getFBool() != false) { + setFBool(other.getFBool()); + } + if (other.getFBytes() != com.google.protobuf.ByteString.EMPTY) { + setFBytes(other.getFBytes()); + } + if (other.fKingdom_ != 0) { + setFKingdomValue(other.getFKingdomValue()); + } + if (other.hasFChild()) { + mergeFChild(other.getFChild()); + } + if (other.hasPString()) { + bitField0_ |= 0x00000001; + pString_ = other.pString_; + onChanged(); + } + if (other.hasPInt32()) { + setPInt32(other.getPInt32()); + } + if (other.hasPDouble()) { + setPDouble(other.getPDouble()); + } + if (other.hasPBool()) { + setPBool(other.getPBool()); + } + if (other.hasPKingdom()) { + setPKingdom(other.getPKingdom()); + } + if (other.hasPChild()) { + mergePChild(other.getPChild()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.showcase.v1beta1.ComplianceData parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.showcase.v1beta1.ComplianceData) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.lang.Object fString_ = ""; + + /** + * string f_string = 1; + * + * @return The fString. + */ + public java.lang.String getFString() { + java.lang.Object ref = fString_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + fString_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * string f_string = 1; + * + * @return The bytes for fString. + */ + public com.google.protobuf.ByteString getFStringBytes() { + java.lang.Object ref = fString_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + fString_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * string f_string = 1; + * + * @param value The fString to set. + * @return This builder for chaining. + */ + public Builder setFString(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + fString_ = value; + onChanged(); + return this; + } + + /** + * string f_string = 1; + * + * @return This builder for chaining. + */ + public Builder clearFString() { + + fString_ = getDefaultInstance().getFString(); + onChanged(); + return this; + } + + /** + * string f_string = 1; + * + * @param value The bytes for fString to set. + * @return This builder for chaining. + */ + public Builder setFStringBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + fString_ = value; + onChanged(); + return this; + } + + private int fInt32_; + + /** + * int32 f_int32 = 2; + * + * @return The fInt32. + */ + @java.lang.Override + public int getFInt32() { + return fInt32_; + } + + /** + * int32 f_int32 = 2; + * + * @param value The fInt32 to set. + * @return This builder for chaining. + */ + public Builder setFInt32(int value) { + + fInt32_ = value; + onChanged(); + return this; + } + + /** + * int32 f_int32 = 2; + * + * @return This builder for chaining. + */ + public Builder clearFInt32() { + + fInt32_ = 0; + onChanged(); + return this; + } + + private int fSint32_; + + /** + * sint32 f_sint32 = 3; + * + * @return The fSint32. + */ + @java.lang.Override + public int getFSint32() { + return fSint32_; + } + + /** + * sint32 f_sint32 = 3; + * + * @param value The fSint32 to set. + * @return This builder for chaining. + */ + public Builder setFSint32(int value) { + + fSint32_ = value; + onChanged(); + return this; + } + + /** + * sint32 f_sint32 = 3; + * + * @return This builder for chaining. + */ + public Builder clearFSint32() { + + fSint32_ = 0; + onChanged(); + return this; + } + + private int fSfixed32_; + + /** + * sfixed32 f_sfixed32 = 4; + * + * @return The fSfixed32. + */ + @java.lang.Override + public int getFSfixed32() { + return fSfixed32_; + } + + /** + * sfixed32 f_sfixed32 = 4; + * + * @param value The fSfixed32 to set. + * @return This builder for chaining. + */ + public Builder setFSfixed32(int value) { + + fSfixed32_ = value; + onChanged(); + return this; + } + + /** + * sfixed32 f_sfixed32 = 4; + * + * @return This builder for chaining. + */ + public Builder clearFSfixed32() { + + fSfixed32_ = 0; + onChanged(); + return this; + } + + private int fUint32_; + + /** + * uint32 f_uint32 = 5; + * + * @return The fUint32. + */ + @java.lang.Override + public int getFUint32() { + return fUint32_; + } + + /** + * uint32 f_uint32 = 5; + * + * @param value The fUint32 to set. + * @return This builder for chaining. + */ + public Builder setFUint32(int value) { + + fUint32_ = value; + onChanged(); + return this; + } + + /** + * uint32 f_uint32 = 5; + * + * @return This builder for chaining. + */ + public Builder clearFUint32() { + + fUint32_ = 0; + onChanged(); + return this; + } + + private int fFixed32_; + + /** + * fixed32 f_fixed32 = 6; + * + * @return The fFixed32. + */ + @java.lang.Override + public int getFFixed32() { + return fFixed32_; + } + + /** + * fixed32 f_fixed32 = 6; + * + * @param value The fFixed32 to set. + * @return This builder for chaining. + */ + public Builder setFFixed32(int value) { + + fFixed32_ = value; + onChanged(); + return this; + } + + /** + * fixed32 f_fixed32 = 6; + * + * @return This builder for chaining. + */ + public Builder clearFFixed32() { + + fFixed32_ = 0; + onChanged(); + return this; + } + + private long fInt64_; + + /** + * int64 f_int64 = 7; + * + * @return The fInt64. + */ + @java.lang.Override + public long getFInt64() { + return fInt64_; + } + + /** + * int64 f_int64 = 7; + * + * @param value The fInt64 to set. + * @return This builder for chaining. + */ + public Builder setFInt64(long value) { + + fInt64_ = value; + onChanged(); + return this; + } + + /** + * int64 f_int64 = 7; + * + * @return This builder for chaining. + */ + public Builder clearFInt64() { + + fInt64_ = 0L; + onChanged(); + return this; + } + + private long fSint64_; + + /** + * sint64 f_sint64 = 8; + * + * @return The fSint64. + */ + @java.lang.Override + public long getFSint64() { + return fSint64_; + } + + /** + * sint64 f_sint64 = 8; + * + * @param value The fSint64 to set. + * @return This builder for chaining. + */ + public Builder setFSint64(long value) { + + fSint64_ = value; + onChanged(); + return this; + } + + /** + * sint64 f_sint64 = 8; + * + * @return This builder for chaining. + */ + public Builder clearFSint64() { + + fSint64_ = 0L; + onChanged(); + return this; + } + + private long fSfixed64_; + + /** + * sfixed64 f_sfixed64 = 9; + * + * @return The fSfixed64. + */ + @java.lang.Override + public long getFSfixed64() { + return fSfixed64_; + } + + /** + * sfixed64 f_sfixed64 = 9; + * + * @param value The fSfixed64 to set. + * @return This builder for chaining. + */ + public Builder setFSfixed64(long value) { + + fSfixed64_ = value; + onChanged(); + return this; + } + + /** + * sfixed64 f_sfixed64 = 9; + * + * @return This builder for chaining. + */ + public Builder clearFSfixed64() { + + fSfixed64_ = 0L; + onChanged(); + return this; + } + + private long fUint64_; + + /** + * uint64 f_uint64 = 10; + * + * @return The fUint64. + */ + @java.lang.Override + public long getFUint64() { + return fUint64_; + } + + /** + * uint64 f_uint64 = 10; + * + * @param value The fUint64 to set. + * @return This builder for chaining. + */ + public Builder setFUint64(long value) { + + fUint64_ = value; + onChanged(); + return this; + } + + /** + * uint64 f_uint64 = 10; + * + * @return This builder for chaining. + */ + public Builder clearFUint64() { + + fUint64_ = 0L; + onChanged(); + return this; + } + + private long fFixed64_; + + /** + * fixed64 f_fixed64 = 11; + * + * @return The fFixed64. + */ + @java.lang.Override + public long getFFixed64() { + return fFixed64_; + } + + /** + * fixed64 f_fixed64 = 11; + * + * @param value The fFixed64 to set. + * @return This builder for chaining. + */ + public Builder setFFixed64(long value) { + + fFixed64_ = value; + onChanged(); + return this; + } + + /** + * fixed64 f_fixed64 = 11; + * + * @return This builder for chaining. + */ + public Builder clearFFixed64() { + + fFixed64_ = 0L; + onChanged(); + return this; + } + + private double fDouble_; + + /** + * double f_double = 12; + * + * @return The fDouble. + */ + @java.lang.Override + public double getFDouble() { + return fDouble_; + } + + /** + * double f_double = 12; + * + * @param value The fDouble to set. + * @return This builder for chaining. + */ + public Builder setFDouble(double value) { + + fDouble_ = value; + onChanged(); + return this; + } + + /** + * double f_double = 12; + * + * @return This builder for chaining. + */ + public Builder clearFDouble() { + + fDouble_ = 0D; + onChanged(); + return this; + } + + private float fFloat_; + + /** + * float f_float = 13; + * + * @return The fFloat. + */ + @java.lang.Override + public float getFFloat() { + return fFloat_; + } + + /** + * float f_float = 13; + * + * @param value The fFloat to set. + * @return This builder for chaining. + */ + public Builder setFFloat(float value) { + + fFloat_ = value; + onChanged(); + return this; + } + + /** + * float f_float = 13; + * + * @return This builder for chaining. + */ + public Builder clearFFloat() { + + fFloat_ = 0F; + onChanged(); + return this; + } + + private boolean fBool_; + + /** + * bool f_bool = 14; + * + * @return The fBool. + */ + @java.lang.Override + public boolean getFBool() { + return fBool_; + } + + /** + * bool f_bool = 14; + * + * @param value The fBool to set. + * @return This builder for chaining. + */ + public Builder setFBool(boolean value) { + + fBool_ = value; + onChanged(); + return this; + } + + /** + * bool f_bool = 14; + * + * @return This builder for chaining. + */ + public Builder clearFBool() { + + fBool_ = false; + onChanged(); + return this; + } + + private com.google.protobuf.ByteString fBytes_ = com.google.protobuf.ByteString.EMPTY; + + /** + * bytes f_bytes = 15; + * + * @return The fBytes. + */ + @java.lang.Override + public com.google.protobuf.ByteString getFBytes() { + return fBytes_; + } + + /** + * bytes f_bytes = 15; + * + * @param value The fBytes to set. + * @return This builder for chaining. + */ + public Builder setFBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + + fBytes_ = value; + onChanged(); + return this; + } + + /** + * bytes f_bytes = 15; + * + * @return This builder for chaining. + */ + public Builder clearFBytes() { + + fBytes_ = getDefaultInstance().getFBytes(); + onChanged(); + return this; + } + + private int fKingdom_ = 0; + + /** + * .google.showcase.v1beta1.ComplianceData.LifeKingdom f_kingdom = 22; + * + * @return The enum numeric value on the wire for fKingdom. + */ + @java.lang.Override + public int getFKingdomValue() { + return fKingdom_; + } + + /** + * .google.showcase.v1beta1.ComplianceData.LifeKingdom f_kingdom = 22; + * + * @param value The enum numeric value on the wire for fKingdom to set. + * @return This builder for chaining. + */ + public Builder setFKingdomValue(int value) { + + fKingdom_ = value; + onChanged(); + return this; + } + + /** + * .google.showcase.v1beta1.ComplianceData.LifeKingdom f_kingdom = 22; + * + * @return The fKingdom. + */ + @java.lang.Override + public com.google.showcase.v1beta1.ComplianceData.LifeKingdom getFKingdom() { + @SuppressWarnings("deprecation") + com.google.showcase.v1beta1.ComplianceData.LifeKingdom result = + com.google.showcase.v1beta1.ComplianceData.LifeKingdom.valueOf(fKingdom_); + return result == null + ? com.google.showcase.v1beta1.ComplianceData.LifeKingdom.UNRECOGNIZED + : result; + } + + /** + * .google.showcase.v1beta1.ComplianceData.LifeKingdom f_kingdom = 22; + * + * @param value The fKingdom to set. + * @return This builder for chaining. + */ + public Builder setFKingdom(com.google.showcase.v1beta1.ComplianceData.LifeKingdom value) { + if (value == null) { + throw new NullPointerException(); + } + + fKingdom_ = value.getNumber(); + onChanged(); + return this; + } + + /** + * .google.showcase.v1beta1.ComplianceData.LifeKingdom f_kingdom = 22; + * + * @return This builder for chaining. + */ + public Builder clearFKingdom() { + + fKingdom_ = 0; + onChanged(); + return this; + } + + private com.google.showcase.v1beta1.ComplianceDataChild fChild_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.showcase.v1beta1.ComplianceDataChild, + com.google.showcase.v1beta1.ComplianceDataChild.Builder, + com.google.showcase.v1beta1.ComplianceDataChildOrBuilder> + fChildBuilder_; + + /** + * .google.showcase.v1beta1.ComplianceDataChild f_child = 16; + * + * @return Whether the fChild field is set. + */ + public boolean hasFChild() { + return fChildBuilder_ != null || fChild_ != null; + } + + /** + * .google.showcase.v1beta1.ComplianceDataChild f_child = 16; + * + * @return The fChild. + */ + public com.google.showcase.v1beta1.ComplianceDataChild getFChild() { + if (fChildBuilder_ == null) { + return fChild_ == null + ? com.google.showcase.v1beta1.ComplianceDataChild.getDefaultInstance() + : fChild_; + } else { + return fChildBuilder_.getMessage(); + } + } + + /** .google.showcase.v1beta1.ComplianceDataChild f_child = 16; */ + public Builder setFChild(com.google.showcase.v1beta1.ComplianceDataChild value) { + if (fChildBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + fChild_ = value; + onChanged(); + } else { + fChildBuilder_.setMessage(value); + } + + return this; + } + + /** .google.showcase.v1beta1.ComplianceDataChild f_child = 16; */ + public Builder setFChild( + com.google.showcase.v1beta1.ComplianceDataChild.Builder builderForValue) { + if (fChildBuilder_ == null) { + fChild_ = builderForValue.build(); + onChanged(); + } else { + fChildBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + + /** .google.showcase.v1beta1.ComplianceDataChild f_child = 16; */ + public Builder mergeFChild(com.google.showcase.v1beta1.ComplianceDataChild value) { + if (fChildBuilder_ == null) { + if (fChild_ != null) { + fChild_ = + com.google.showcase.v1beta1.ComplianceDataChild.newBuilder(fChild_) + .mergeFrom(value) + .buildPartial(); + } else { + fChild_ = value; + } + onChanged(); + } else { + fChildBuilder_.mergeFrom(value); + } + + return this; + } + + /** .google.showcase.v1beta1.ComplianceDataChild f_child = 16; */ + public Builder clearFChild() { + if (fChildBuilder_ == null) { + fChild_ = null; + onChanged(); + } else { + fChild_ = null; + fChildBuilder_ = null; + } + + return this; + } + + /** .google.showcase.v1beta1.ComplianceDataChild f_child = 16; */ + public com.google.showcase.v1beta1.ComplianceDataChild.Builder getFChildBuilder() { + + onChanged(); + return getFChildFieldBuilder().getBuilder(); + } + + /** .google.showcase.v1beta1.ComplianceDataChild f_child = 16; */ + public com.google.showcase.v1beta1.ComplianceDataChildOrBuilder getFChildOrBuilder() { + if (fChildBuilder_ != null) { + return fChildBuilder_.getMessageOrBuilder(); + } else { + return fChild_ == null + ? com.google.showcase.v1beta1.ComplianceDataChild.getDefaultInstance() + : fChild_; + } + } + + /** .google.showcase.v1beta1.ComplianceDataChild f_child = 16; */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.showcase.v1beta1.ComplianceDataChild, + com.google.showcase.v1beta1.ComplianceDataChild.Builder, + com.google.showcase.v1beta1.ComplianceDataChildOrBuilder> + getFChildFieldBuilder() { + if (fChildBuilder_ == null) { + fChildBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.showcase.v1beta1.ComplianceDataChild, + com.google.showcase.v1beta1.ComplianceDataChild.Builder, + com.google.showcase.v1beta1.ComplianceDataChildOrBuilder>( + getFChild(), getParentForChildren(), isClean()); + fChild_ = null; + } + return fChildBuilder_; + } + + private java.lang.Object pString_ = ""; + + /** + * optional string p_string = 17; + * + * @return Whether the pString field is set. + */ + public boolean hasPString() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * optional string p_string = 17; + * + * @return The pString. + */ + public java.lang.String getPString() { + java.lang.Object ref = pString_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pString_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * optional string p_string = 17; + * + * @return The bytes for pString. + */ + public com.google.protobuf.ByteString getPStringBytes() { + java.lang.Object ref = pString_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pString_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * optional string p_string = 17; + * + * @param value The pString to set. + * @return This builder for chaining. + */ + public Builder setPString(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000001; + pString_ = value; + onChanged(); + return this; + } + + /** + * optional string p_string = 17; + * + * @return This builder for chaining. + */ + public Builder clearPString() { + bitField0_ = (bitField0_ & ~0x00000001); + pString_ = getDefaultInstance().getPString(); + onChanged(); + return this; + } + + /** + * optional string p_string = 17; + * + * @param value The bytes for pString to set. + * @return This builder for chaining. + */ + public Builder setPStringBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + bitField0_ |= 0x00000001; + pString_ = value; + onChanged(); + return this; + } + + private int pInt32_; + + /** + * optional int32 p_int32 = 18; + * + * @return Whether the pInt32 field is set. + */ + @java.lang.Override + public boolean hasPInt32() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * optional int32 p_int32 = 18; + * + * @return The pInt32. + */ + @java.lang.Override + public int getPInt32() { + return pInt32_; + } + + /** + * optional int32 p_int32 = 18; + * + * @param value The pInt32 to set. + * @return This builder for chaining. + */ + public Builder setPInt32(int value) { + bitField0_ |= 0x00000002; + pInt32_ = value; + onChanged(); + return this; + } + + /** + * optional int32 p_int32 = 18; + * + * @return This builder for chaining. + */ + public Builder clearPInt32() { + bitField0_ = (bitField0_ & ~0x00000002); + pInt32_ = 0; + onChanged(); + return this; + } + + private double pDouble_; + + /** + * optional double p_double = 19; + * + * @return Whether the pDouble field is set. + */ + @java.lang.Override + public boolean hasPDouble() { + return ((bitField0_ & 0x00000004) != 0); + } + + /** + * optional double p_double = 19; + * + * @return The pDouble. + */ + @java.lang.Override + public double getPDouble() { + return pDouble_; + } + + /** + * optional double p_double = 19; + * + * @param value The pDouble to set. + * @return This builder for chaining. + */ + public Builder setPDouble(double value) { + bitField0_ |= 0x00000004; + pDouble_ = value; + onChanged(); + return this; + } + + /** + * optional double p_double = 19; + * + * @return This builder for chaining. + */ + public Builder clearPDouble() { + bitField0_ = (bitField0_ & ~0x00000004); + pDouble_ = 0D; + onChanged(); + return this; + } + + private boolean pBool_; + + /** + * optional bool p_bool = 20; + * + * @return Whether the pBool field is set. + */ + @java.lang.Override + public boolean hasPBool() { + return ((bitField0_ & 0x00000008) != 0); + } + + /** + * optional bool p_bool = 20; + * + * @return The pBool. + */ + @java.lang.Override + public boolean getPBool() { + return pBool_; + } + + /** + * optional bool p_bool = 20; + * + * @param value The pBool to set. + * @return This builder for chaining. + */ + public Builder setPBool(boolean value) { + bitField0_ |= 0x00000008; + pBool_ = value; + onChanged(); + return this; + } + + /** + * optional bool p_bool = 20; + * + * @return This builder for chaining. + */ + public Builder clearPBool() { + bitField0_ = (bitField0_ & ~0x00000008); + pBool_ = false; + onChanged(); + return this; + } + + private int pKingdom_ = 0; + + /** + * optional .google.showcase.v1beta1.ComplianceData.LifeKingdom p_kingdom = 23; + * + * @return Whether the pKingdom field is set. + */ + @java.lang.Override + public boolean hasPKingdom() { + return ((bitField0_ & 0x00000010) != 0); + } + + /** + * optional .google.showcase.v1beta1.ComplianceData.LifeKingdom p_kingdom = 23; + * + * @return The enum numeric value on the wire for pKingdom. + */ + @java.lang.Override + public int getPKingdomValue() { + return pKingdom_; + } + + /** + * optional .google.showcase.v1beta1.ComplianceData.LifeKingdom p_kingdom = 23; + * + * @param value The enum numeric value on the wire for pKingdom to set. + * @return This builder for chaining. + */ + public Builder setPKingdomValue(int value) { + bitField0_ |= 0x00000010; + pKingdom_ = value; + onChanged(); + return this; + } + + /** + * optional .google.showcase.v1beta1.ComplianceData.LifeKingdom p_kingdom = 23; + * + * @return The pKingdom. + */ + @java.lang.Override + public com.google.showcase.v1beta1.ComplianceData.LifeKingdom getPKingdom() { + @SuppressWarnings("deprecation") + com.google.showcase.v1beta1.ComplianceData.LifeKingdom result = + com.google.showcase.v1beta1.ComplianceData.LifeKingdom.valueOf(pKingdom_); + return result == null + ? com.google.showcase.v1beta1.ComplianceData.LifeKingdom.UNRECOGNIZED + : result; + } + + /** + * optional .google.showcase.v1beta1.ComplianceData.LifeKingdom p_kingdom = 23; + * + * @param value The pKingdom to set. + * @return This builder for chaining. + */ + public Builder setPKingdom(com.google.showcase.v1beta1.ComplianceData.LifeKingdom value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000010; + pKingdom_ = value.getNumber(); + onChanged(); + return this; + } + + /** + * optional .google.showcase.v1beta1.ComplianceData.LifeKingdom p_kingdom = 23; + * + * @return This builder for chaining. + */ + public Builder clearPKingdom() { + bitField0_ = (bitField0_ & ~0x00000010); + pKingdom_ = 0; + onChanged(); + return this; + } + + private com.google.showcase.v1beta1.ComplianceDataChild pChild_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.showcase.v1beta1.ComplianceDataChild, + com.google.showcase.v1beta1.ComplianceDataChild.Builder, + com.google.showcase.v1beta1.ComplianceDataChildOrBuilder> + pChildBuilder_; + + /** + * optional .google.showcase.v1beta1.ComplianceDataChild p_child = 21; + * + * @return Whether the pChild field is set. + */ + public boolean hasPChild() { + return ((bitField0_ & 0x00000020) != 0); + } + + /** + * optional .google.showcase.v1beta1.ComplianceDataChild p_child = 21; + * + * @return The pChild. + */ + public com.google.showcase.v1beta1.ComplianceDataChild getPChild() { + if (pChildBuilder_ == null) { + return pChild_ == null + ? com.google.showcase.v1beta1.ComplianceDataChild.getDefaultInstance() + : pChild_; + } else { + return pChildBuilder_.getMessage(); + } + } + + /** optional .google.showcase.v1beta1.ComplianceDataChild p_child = 21; */ + public Builder setPChild(com.google.showcase.v1beta1.ComplianceDataChild value) { + if (pChildBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + pChild_ = value; + onChanged(); + } else { + pChildBuilder_.setMessage(value); + } + bitField0_ |= 0x00000020; + return this; + } + + /** optional .google.showcase.v1beta1.ComplianceDataChild p_child = 21; */ + public Builder setPChild( + com.google.showcase.v1beta1.ComplianceDataChild.Builder builderForValue) { + if (pChildBuilder_ == null) { + pChild_ = builderForValue.build(); + onChanged(); + } else { + pChildBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000020; + return this; + } + + /** optional .google.showcase.v1beta1.ComplianceDataChild p_child = 21; */ + public Builder mergePChild(com.google.showcase.v1beta1.ComplianceDataChild value) { + if (pChildBuilder_ == null) { + if (((bitField0_ & 0x00000020) != 0) + && pChild_ != null + && pChild_ != com.google.showcase.v1beta1.ComplianceDataChild.getDefaultInstance()) { + pChild_ = + com.google.showcase.v1beta1.ComplianceDataChild.newBuilder(pChild_) + .mergeFrom(value) + .buildPartial(); + } else { + pChild_ = value; + } + onChanged(); + } else { + pChildBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000020; + return this; + } + + /** optional .google.showcase.v1beta1.ComplianceDataChild p_child = 21; */ + public Builder clearPChild() { + if (pChildBuilder_ == null) { + pChild_ = null; + onChanged(); + } else { + pChildBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000020); + return this; + } + + /** optional .google.showcase.v1beta1.ComplianceDataChild p_child = 21; */ + public com.google.showcase.v1beta1.ComplianceDataChild.Builder getPChildBuilder() { + bitField0_ |= 0x00000020; + onChanged(); + return getPChildFieldBuilder().getBuilder(); + } + + /** optional .google.showcase.v1beta1.ComplianceDataChild p_child = 21; */ + public com.google.showcase.v1beta1.ComplianceDataChildOrBuilder getPChildOrBuilder() { + if (pChildBuilder_ != null) { + return pChildBuilder_.getMessageOrBuilder(); + } else { + return pChild_ == null + ? com.google.showcase.v1beta1.ComplianceDataChild.getDefaultInstance() + : pChild_; + } + } + + /** optional .google.showcase.v1beta1.ComplianceDataChild p_child = 21; */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.showcase.v1beta1.ComplianceDataChild, + com.google.showcase.v1beta1.ComplianceDataChild.Builder, + com.google.showcase.v1beta1.ComplianceDataChildOrBuilder> + getPChildFieldBuilder() { + if (pChildBuilder_ == null) { + pChildBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.showcase.v1beta1.ComplianceDataChild, + com.google.showcase.v1beta1.ComplianceDataChild.Builder, + com.google.showcase.v1beta1.ComplianceDataChildOrBuilder>( + getPChild(), getParentForChildren(), isClean()); + pChild_ = null; + } + return pChildBuilder_; + } + + @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.showcase.v1beta1.ComplianceData) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.ComplianceData) + private static final com.google.showcase.v1beta1.ComplianceData DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.ComplianceData(); + } + + public static com.google.showcase.v1beta1.ComplianceData getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ComplianceData parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ComplianceData(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.showcase.v1beta1.ComplianceData getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ComplianceDataChild.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ComplianceDataChild.java new file mode 100644 index 0000000000..8add33da44 --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ComplianceDataChild.java @@ -0,0 +1,1929 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/compliance.proto + +package com.google.showcase.v1beta1; + +/** Protobuf type {@code google.showcase.v1beta1.ComplianceDataChild} */ +public final class ComplianceDataChild extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.ComplianceDataChild) + ComplianceDataChildOrBuilder { + private static final long serialVersionUID = 0L; + + // Use ComplianceDataChild.newBuilder() to construct. + private ComplianceDataChild(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ComplianceDataChild() { + fString_ = ""; + fContinent_ = 0; + pString_ = ""; + pContinent_ = 0; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ComplianceDataChild(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ComplianceDataChild( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + fString_ = s; + break; + } + case 21: + { + fFloat_ = input.readFloat(); + break; + } + case 25: + { + fDouble_ = input.readDouble(); + break; + } + case 32: + { + fBool_ = input.readBool(); + break; + } + case 42: + { + com.google.showcase.v1beta1.ComplianceDataGrandchild.Builder subBuilder = null; + if (fChild_ != null) { + subBuilder = fChild_.toBuilder(); + } + fChild_ = + input.readMessage( + com.google.showcase.v1beta1.ComplianceDataGrandchild.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(fChild_); + fChild_ = subBuilder.buildPartial(); + } + + break; + } + case 50: + { + java.lang.String s = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + pString_ = s; + break; + } + case 61: + { + bitField0_ |= 0x00000002; + pFloat_ = input.readFloat(); + break; + } + case 65: + { + bitField0_ |= 0x00000004; + pDouble_ = input.readDouble(); + break; + } + case 72: + { + bitField0_ |= 0x00000008; + pBool_ = input.readBool(); + break; + } + case 82: + { + com.google.showcase.v1beta1.ComplianceDataGrandchild.Builder subBuilder = null; + if (((bitField0_ & 0x00000010) != 0)) { + subBuilder = pChild_.toBuilder(); + } + pChild_ = + input.readMessage( + com.google.showcase.v1beta1.ComplianceDataGrandchild.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(pChild_); + pChild_ = subBuilder.buildPartial(); + } + bitField0_ |= 0x00000010; + break; + } + case 88: + { + int rawValue = input.readEnum(); + + fContinent_ = rawValue; + break; + } + case 96: + { + int rawValue = input.readEnum(); + + pContinent_ = rawValue; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.ComplianceOuterClass + .internal_static_google_showcase_v1beta1_ComplianceDataChild_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.ComplianceOuterClass + .internal_static_google_showcase_v1beta1_ComplianceDataChild_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.ComplianceDataChild.class, + com.google.showcase.v1beta1.ComplianceDataChild.Builder.class); + } + + private int bitField0_; + public static final int F_STRING_FIELD_NUMBER = 1; + private volatile java.lang.Object fString_; + + /** + * string f_string = 1; + * + * @return The fString. + */ + @java.lang.Override + public java.lang.String getFString() { + java.lang.Object ref = fString_; + 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(); + fString_ = s; + return s; + } + } + + /** + * string f_string = 1; + * + * @return The bytes for fString. + */ + @java.lang.Override + public com.google.protobuf.ByteString getFStringBytes() { + java.lang.Object ref = fString_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + fString_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int F_FLOAT_FIELD_NUMBER = 2; + private float fFloat_; + + /** + * float f_float = 2; + * + * @return The fFloat. + */ + @java.lang.Override + public float getFFloat() { + return fFloat_; + } + + public static final int F_DOUBLE_FIELD_NUMBER = 3; + private double fDouble_; + + /** + * double f_double = 3; + * + * @return The fDouble. + */ + @java.lang.Override + public double getFDouble() { + return fDouble_; + } + + public static final int F_BOOL_FIELD_NUMBER = 4; + private boolean fBool_; + + /** + * bool f_bool = 4; + * + * @return The fBool. + */ + @java.lang.Override + public boolean getFBool() { + return fBool_; + } + + public static final int F_CONTINENT_FIELD_NUMBER = 11; + private int fContinent_; + + /** + * .google.showcase.v1beta1.Continent f_continent = 11; + * + * @return The enum numeric value on the wire for fContinent. + */ + @java.lang.Override + public int getFContinentValue() { + return fContinent_; + } + + /** + * .google.showcase.v1beta1.Continent f_continent = 11; + * + * @return The fContinent. + */ + @java.lang.Override + public com.google.showcase.v1beta1.Continent getFContinent() { + @SuppressWarnings("deprecation") + com.google.showcase.v1beta1.Continent result = + com.google.showcase.v1beta1.Continent.valueOf(fContinent_); + return result == null ? com.google.showcase.v1beta1.Continent.UNRECOGNIZED : result; + } + + public static final int F_CHILD_FIELD_NUMBER = 5; + private com.google.showcase.v1beta1.ComplianceDataGrandchild fChild_; + + /** + * .google.showcase.v1beta1.ComplianceDataGrandchild f_child = 5; + * + * @return Whether the fChild field is set. + */ + @java.lang.Override + public boolean hasFChild() { + return fChild_ != null; + } + + /** + * .google.showcase.v1beta1.ComplianceDataGrandchild f_child = 5; + * + * @return The fChild. + */ + @java.lang.Override + public com.google.showcase.v1beta1.ComplianceDataGrandchild getFChild() { + return fChild_ == null + ? com.google.showcase.v1beta1.ComplianceDataGrandchild.getDefaultInstance() + : fChild_; + } + + /** .google.showcase.v1beta1.ComplianceDataGrandchild f_child = 5; */ + @java.lang.Override + public com.google.showcase.v1beta1.ComplianceDataGrandchildOrBuilder getFChildOrBuilder() { + return getFChild(); + } + + public static final int P_STRING_FIELD_NUMBER = 6; + private volatile java.lang.Object pString_; + + /** + * optional string p_string = 6; + * + * @return Whether the pString field is set. + */ + @java.lang.Override + public boolean hasPString() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * optional string p_string = 6; + * + * @return The pString. + */ + @java.lang.Override + public java.lang.String getPString() { + java.lang.Object ref = pString_; + 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(); + pString_ = s; + return s; + } + } + + /** + * optional string p_string = 6; + * + * @return The bytes for pString. + */ + @java.lang.Override + public com.google.protobuf.ByteString getPStringBytes() { + java.lang.Object ref = pString_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pString_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int P_FLOAT_FIELD_NUMBER = 7; + private float pFloat_; + + /** + * optional float p_float = 7; + * + * @return Whether the pFloat field is set. + */ + @java.lang.Override + public boolean hasPFloat() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * optional float p_float = 7; + * + * @return The pFloat. + */ + @java.lang.Override + public float getPFloat() { + return pFloat_; + } + + public static final int P_DOUBLE_FIELD_NUMBER = 8; + private double pDouble_; + + /** + * optional double p_double = 8; + * + * @return Whether the pDouble field is set. + */ + @java.lang.Override + public boolean hasPDouble() { + return ((bitField0_ & 0x00000004) != 0); + } + + /** + * optional double p_double = 8; + * + * @return The pDouble. + */ + @java.lang.Override + public double getPDouble() { + return pDouble_; + } + + public static final int P_BOOL_FIELD_NUMBER = 9; + private boolean pBool_; + + /** + * optional bool p_bool = 9; + * + * @return Whether the pBool field is set. + */ + @java.lang.Override + public boolean hasPBool() { + return ((bitField0_ & 0x00000008) != 0); + } + + /** + * optional bool p_bool = 9; + * + * @return The pBool. + */ + @java.lang.Override + public boolean getPBool() { + return pBool_; + } + + public static final int P_CONTINENT_FIELD_NUMBER = 12; + private int pContinent_; + + /** + * .google.showcase.v1beta1.Continent p_continent = 12; + * + * @return The enum numeric value on the wire for pContinent. + */ + @java.lang.Override + public int getPContinentValue() { + return pContinent_; + } + + /** + * .google.showcase.v1beta1.Continent p_continent = 12; + * + * @return The pContinent. + */ + @java.lang.Override + public com.google.showcase.v1beta1.Continent getPContinent() { + @SuppressWarnings("deprecation") + com.google.showcase.v1beta1.Continent result = + com.google.showcase.v1beta1.Continent.valueOf(pContinent_); + return result == null ? com.google.showcase.v1beta1.Continent.UNRECOGNIZED : result; + } + + public static final int P_CHILD_FIELD_NUMBER = 10; + private com.google.showcase.v1beta1.ComplianceDataGrandchild pChild_; + + /** + * optional .google.showcase.v1beta1.ComplianceDataGrandchild p_child = 10; + * + * @return Whether the pChild field is set. + */ + @java.lang.Override + public boolean hasPChild() { + return ((bitField0_ & 0x00000010) != 0); + } + + /** + * optional .google.showcase.v1beta1.ComplianceDataGrandchild p_child = 10; + * + * @return The pChild. + */ + @java.lang.Override + public com.google.showcase.v1beta1.ComplianceDataGrandchild getPChild() { + return pChild_ == null + ? com.google.showcase.v1beta1.ComplianceDataGrandchild.getDefaultInstance() + : pChild_; + } + + /** optional .google.showcase.v1beta1.ComplianceDataGrandchild p_child = 10; */ + @java.lang.Override + public com.google.showcase.v1beta1.ComplianceDataGrandchildOrBuilder getPChildOrBuilder() { + return pChild_ == null + ? com.google.showcase.v1beta1.ComplianceDataGrandchild.getDefaultInstance() + : pChild_; + } + + 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(fString_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, fString_); + } + if (java.lang.Float.floatToRawIntBits(fFloat_) != 0) { + output.writeFloat(2, fFloat_); + } + if (java.lang.Double.doubleToRawLongBits(fDouble_) != 0) { + output.writeDouble(3, fDouble_); + } + if (fBool_ != false) { + output.writeBool(4, fBool_); + } + if (fChild_ != null) { + output.writeMessage(5, getFChild()); + } + if (((bitField0_ & 0x00000001) != 0)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 6, pString_); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeFloat(7, pFloat_); + } + if (((bitField0_ & 0x00000004) != 0)) { + output.writeDouble(8, pDouble_); + } + if (((bitField0_ & 0x00000008) != 0)) { + output.writeBool(9, pBool_); + } + if (((bitField0_ & 0x00000010) != 0)) { + output.writeMessage(10, getPChild()); + } + if (fContinent_ != com.google.showcase.v1beta1.Continent.CONTINENT_UNSPECIFIED.getNumber()) { + output.writeEnum(11, fContinent_); + } + if (pContinent_ != com.google.showcase.v1beta1.Continent.CONTINENT_UNSPECIFIED.getNumber()) { + output.writeEnum(12, pContinent_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(fString_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, fString_); + } + if (java.lang.Float.floatToRawIntBits(fFloat_) != 0) { + size += com.google.protobuf.CodedOutputStream.computeFloatSize(2, fFloat_); + } + if (java.lang.Double.doubleToRawLongBits(fDouble_) != 0) { + size += com.google.protobuf.CodedOutputStream.computeDoubleSize(3, fDouble_); + } + if (fBool_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(4, fBool_); + } + if (fChild_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(5, getFChild()); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(6, pString_); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeFloatSize(7, pFloat_); + } + if (((bitField0_ & 0x00000004) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeDoubleSize(8, pDouble_); + } + if (((bitField0_ & 0x00000008) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(9, pBool_); + } + if (((bitField0_ & 0x00000010) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(10, getPChild()); + } + if (fContinent_ != com.google.showcase.v1beta1.Continent.CONTINENT_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(11, fContinent_); + } + if (pContinent_ != com.google.showcase.v1beta1.Continent.CONTINENT_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(12, pContinent_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.showcase.v1beta1.ComplianceDataChild)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.ComplianceDataChild other = + (com.google.showcase.v1beta1.ComplianceDataChild) obj; + + if (!getFString().equals(other.getFString())) return false; + if (java.lang.Float.floatToIntBits(getFFloat()) + != java.lang.Float.floatToIntBits(other.getFFloat())) return false; + if (java.lang.Double.doubleToLongBits(getFDouble()) + != java.lang.Double.doubleToLongBits(other.getFDouble())) return false; + if (getFBool() != other.getFBool()) return false; + if (fContinent_ != other.fContinent_) return false; + if (hasFChild() != other.hasFChild()) return false; + if (hasFChild()) { + if (!getFChild().equals(other.getFChild())) return false; + } + if (hasPString() != other.hasPString()) return false; + if (hasPString()) { + if (!getPString().equals(other.getPString())) return false; + } + if (hasPFloat() != other.hasPFloat()) return false; + if (hasPFloat()) { + if (java.lang.Float.floatToIntBits(getPFloat()) + != java.lang.Float.floatToIntBits(other.getPFloat())) return false; + } + if (hasPDouble() != other.hasPDouble()) return false; + if (hasPDouble()) { + if (java.lang.Double.doubleToLongBits(getPDouble()) + != java.lang.Double.doubleToLongBits(other.getPDouble())) return false; + } + if (hasPBool() != other.hasPBool()) return false; + if (hasPBool()) { + if (getPBool() != other.getPBool()) return false; + } + if (pContinent_ != other.pContinent_) return false; + if (hasPChild() != other.hasPChild()) return false; + if (hasPChild()) { + if (!getPChild().equals(other.getPChild())) return false; + } + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + F_STRING_FIELD_NUMBER; + hash = (53 * hash) + getFString().hashCode(); + hash = (37 * hash) + F_FLOAT_FIELD_NUMBER; + hash = (53 * hash) + java.lang.Float.floatToIntBits(getFFloat()); + hash = (37 * hash) + F_DOUBLE_FIELD_NUMBER; + hash = + (53 * hash) + + com.google.protobuf.Internal.hashLong( + java.lang.Double.doubleToLongBits(getFDouble())); + hash = (37 * hash) + F_BOOL_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getFBool()); + hash = (37 * hash) + F_CONTINENT_FIELD_NUMBER; + hash = (53 * hash) + fContinent_; + if (hasFChild()) { + hash = (37 * hash) + F_CHILD_FIELD_NUMBER; + hash = (53 * hash) + getFChild().hashCode(); + } + if (hasPString()) { + hash = (37 * hash) + P_STRING_FIELD_NUMBER; + hash = (53 * hash) + getPString().hashCode(); + } + if (hasPFloat()) { + hash = (37 * hash) + P_FLOAT_FIELD_NUMBER; + hash = (53 * hash) + java.lang.Float.floatToIntBits(getPFloat()); + } + if (hasPDouble()) { + hash = (37 * hash) + P_DOUBLE_FIELD_NUMBER; + hash = + (53 * hash) + + com.google.protobuf.Internal.hashLong( + java.lang.Double.doubleToLongBits(getPDouble())); + } + if (hasPBool()) { + hash = (37 * hash) + P_BOOL_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getPBool()); + } + hash = (37 * hash) + P_CONTINENT_FIELD_NUMBER; + hash = (53 * hash) + pContinent_; + if (hasPChild()) { + hash = (37 * hash) + P_CHILD_FIELD_NUMBER; + hash = (53 * hash) + getPChild().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.showcase.v1beta1.ComplianceDataChild parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.ComplianceDataChild parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.ComplianceDataChild parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.ComplianceDataChild 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.showcase.v1beta1.ComplianceDataChild parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.ComplianceDataChild parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.ComplianceDataChild parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.ComplianceDataChild 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.showcase.v1beta1.ComplianceDataChild parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.ComplianceDataChild 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.showcase.v1beta1.ComplianceDataChild parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.ComplianceDataChild 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.showcase.v1beta1.ComplianceDataChild prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** Protobuf type {@code google.showcase.v1beta1.ComplianceDataChild} */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.ComplianceDataChild) + com.google.showcase.v1beta1.ComplianceDataChildOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.ComplianceOuterClass + .internal_static_google_showcase_v1beta1_ComplianceDataChild_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.ComplianceOuterClass + .internal_static_google_showcase_v1beta1_ComplianceDataChild_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.ComplianceDataChild.class, + com.google.showcase.v1beta1.ComplianceDataChild.Builder.class); + } + + // Construct using com.google.showcase.v1beta1.ComplianceDataChild.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getPChildFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + fString_ = ""; + + fFloat_ = 0F; + + fDouble_ = 0D; + + fBool_ = false; + + fContinent_ = 0; + + if (fChildBuilder_ == null) { + fChild_ = null; + } else { + fChild_ = null; + fChildBuilder_ = null; + } + pString_ = ""; + bitField0_ = (bitField0_ & ~0x00000001); + pFloat_ = 0F; + bitField0_ = (bitField0_ & ~0x00000002); + pDouble_ = 0D; + bitField0_ = (bitField0_ & ~0x00000004); + pBool_ = false; + bitField0_ = (bitField0_ & ~0x00000008); + pContinent_ = 0; + + if (pChildBuilder_ == null) { + pChild_ = null; + } else { + pChildBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000010); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.showcase.v1beta1.ComplianceOuterClass + .internal_static_google_showcase_v1beta1_ComplianceDataChild_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.ComplianceDataChild getDefaultInstanceForType() { + return com.google.showcase.v1beta1.ComplianceDataChild.getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.ComplianceDataChild build() { + com.google.showcase.v1beta1.ComplianceDataChild result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.ComplianceDataChild buildPartial() { + com.google.showcase.v1beta1.ComplianceDataChild result = + new com.google.showcase.v1beta1.ComplianceDataChild(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + result.fString_ = fString_; + result.fFloat_ = fFloat_; + result.fDouble_ = fDouble_; + result.fBool_ = fBool_; + result.fContinent_ = fContinent_; + if (fChildBuilder_ == null) { + result.fChild_ = fChild_; + } else { + result.fChild_ = fChildBuilder_.build(); + } + if (((from_bitField0_ & 0x00000001) != 0)) { + to_bitField0_ |= 0x00000001; + } + result.pString_ = pString_; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.pFloat_ = pFloat_; + to_bitField0_ |= 0x00000002; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.pDouble_ = pDouble_; + to_bitField0_ |= 0x00000004; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.pBool_ = pBool_; + to_bitField0_ |= 0x00000008; + } + result.pContinent_ = pContinent_; + if (((from_bitField0_ & 0x00000010) != 0)) { + if (pChildBuilder_ == null) { + result.pChild_ = pChild_; + } else { + result.pChild_ = pChildBuilder_.build(); + } + to_bitField0_ |= 0x00000010; + } + result.bitField0_ = to_bitField0_; + 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.showcase.v1beta1.ComplianceDataChild) { + return mergeFrom((com.google.showcase.v1beta1.ComplianceDataChild) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.showcase.v1beta1.ComplianceDataChild other) { + if (other == com.google.showcase.v1beta1.ComplianceDataChild.getDefaultInstance()) + return this; + if (!other.getFString().isEmpty()) { + fString_ = other.fString_; + onChanged(); + } + if (other.getFFloat() != 0F) { + setFFloat(other.getFFloat()); + } + if (other.getFDouble() != 0D) { + setFDouble(other.getFDouble()); + } + if (other.getFBool() != false) { + setFBool(other.getFBool()); + } + if (other.fContinent_ != 0) { + setFContinentValue(other.getFContinentValue()); + } + if (other.hasFChild()) { + mergeFChild(other.getFChild()); + } + if (other.hasPString()) { + bitField0_ |= 0x00000001; + pString_ = other.pString_; + onChanged(); + } + if (other.hasPFloat()) { + setPFloat(other.getPFloat()); + } + if (other.hasPDouble()) { + setPDouble(other.getPDouble()); + } + if (other.hasPBool()) { + setPBool(other.getPBool()); + } + if (other.pContinent_ != 0) { + setPContinentValue(other.getPContinentValue()); + } + if (other.hasPChild()) { + mergePChild(other.getPChild()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.showcase.v1beta1.ComplianceDataChild parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.showcase.v1beta1.ComplianceDataChild) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.lang.Object fString_ = ""; + + /** + * string f_string = 1; + * + * @return The fString. + */ + public java.lang.String getFString() { + java.lang.Object ref = fString_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + fString_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * string f_string = 1; + * + * @return The bytes for fString. + */ + public com.google.protobuf.ByteString getFStringBytes() { + java.lang.Object ref = fString_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + fString_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * string f_string = 1; + * + * @param value The fString to set. + * @return This builder for chaining. + */ + public Builder setFString(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + fString_ = value; + onChanged(); + return this; + } + + /** + * string f_string = 1; + * + * @return This builder for chaining. + */ + public Builder clearFString() { + + fString_ = getDefaultInstance().getFString(); + onChanged(); + return this; + } + + /** + * string f_string = 1; + * + * @param value The bytes for fString to set. + * @return This builder for chaining. + */ + public Builder setFStringBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + fString_ = value; + onChanged(); + return this; + } + + private float fFloat_; + + /** + * float f_float = 2; + * + * @return The fFloat. + */ + @java.lang.Override + public float getFFloat() { + return fFloat_; + } + + /** + * float f_float = 2; + * + * @param value The fFloat to set. + * @return This builder for chaining. + */ + public Builder setFFloat(float value) { + + fFloat_ = value; + onChanged(); + return this; + } + + /** + * float f_float = 2; + * + * @return This builder for chaining. + */ + public Builder clearFFloat() { + + fFloat_ = 0F; + onChanged(); + return this; + } + + private double fDouble_; + + /** + * double f_double = 3; + * + * @return The fDouble. + */ + @java.lang.Override + public double getFDouble() { + return fDouble_; + } + + /** + * double f_double = 3; + * + * @param value The fDouble to set. + * @return This builder for chaining. + */ + public Builder setFDouble(double value) { + + fDouble_ = value; + onChanged(); + return this; + } + + /** + * double f_double = 3; + * + * @return This builder for chaining. + */ + public Builder clearFDouble() { + + fDouble_ = 0D; + onChanged(); + return this; + } + + private boolean fBool_; + + /** + * bool f_bool = 4; + * + * @return The fBool. + */ + @java.lang.Override + public boolean getFBool() { + return fBool_; + } + + /** + * bool f_bool = 4; + * + * @param value The fBool to set. + * @return This builder for chaining. + */ + public Builder setFBool(boolean value) { + + fBool_ = value; + onChanged(); + return this; + } + + /** + * bool f_bool = 4; + * + * @return This builder for chaining. + */ + public Builder clearFBool() { + + fBool_ = false; + onChanged(); + return this; + } + + private int fContinent_ = 0; + + /** + * .google.showcase.v1beta1.Continent f_continent = 11; + * + * @return The enum numeric value on the wire for fContinent. + */ + @java.lang.Override + public int getFContinentValue() { + return fContinent_; + } + + /** + * .google.showcase.v1beta1.Continent f_continent = 11; + * + * @param value The enum numeric value on the wire for fContinent to set. + * @return This builder for chaining. + */ + public Builder setFContinentValue(int value) { + + fContinent_ = value; + onChanged(); + return this; + } + + /** + * .google.showcase.v1beta1.Continent f_continent = 11; + * + * @return The fContinent. + */ + @java.lang.Override + public com.google.showcase.v1beta1.Continent getFContinent() { + @SuppressWarnings("deprecation") + com.google.showcase.v1beta1.Continent result = + com.google.showcase.v1beta1.Continent.valueOf(fContinent_); + return result == null ? com.google.showcase.v1beta1.Continent.UNRECOGNIZED : result; + } + + /** + * .google.showcase.v1beta1.Continent f_continent = 11; + * + * @param value The fContinent to set. + * @return This builder for chaining. + */ + public Builder setFContinent(com.google.showcase.v1beta1.Continent value) { + if (value == null) { + throw new NullPointerException(); + } + + fContinent_ = value.getNumber(); + onChanged(); + return this; + } + + /** + * .google.showcase.v1beta1.Continent f_continent = 11; + * + * @return This builder for chaining. + */ + public Builder clearFContinent() { + + fContinent_ = 0; + onChanged(); + return this; + } + + private com.google.showcase.v1beta1.ComplianceDataGrandchild fChild_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.showcase.v1beta1.ComplianceDataGrandchild, + com.google.showcase.v1beta1.ComplianceDataGrandchild.Builder, + com.google.showcase.v1beta1.ComplianceDataGrandchildOrBuilder> + fChildBuilder_; + + /** + * .google.showcase.v1beta1.ComplianceDataGrandchild f_child = 5; + * + * @return Whether the fChild field is set. + */ + public boolean hasFChild() { + return fChildBuilder_ != null || fChild_ != null; + } + + /** + * .google.showcase.v1beta1.ComplianceDataGrandchild f_child = 5; + * + * @return The fChild. + */ + public com.google.showcase.v1beta1.ComplianceDataGrandchild getFChild() { + if (fChildBuilder_ == null) { + return fChild_ == null + ? com.google.showcase.v1beta1.ComplianceDataGrandchild.getDefaultInstance() + : fChild_; + } else { + return fChildBuilder_.getMessage(); + } + } + + /** .google.showcase.v1beta1.ComplianceDataGrandchild f_child = 5; */ + public Builder setFChild(com.google.showcase.v1beta1.ComplianceDataGrandchild value) { + if (fChildBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + fChild_ = value; + onChanged(); + } else { + fChildBuilder_.setMessage(value); + } + + return this; + } + + /** .google.showcase.v1beta1.ComplianceDataGrandchild f_child = 5; */ + public Builder setFChild( + com.google.showcase.v1beta1.ComplianceDataGrandchild.Builder builderForValue) { + if (fChildBuilder_ == null) { + fChild_ = builderForValue.build(); + onChanged(); + } else { + fChildBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + + /** .google.showcase.v1beta1.ComplianceDataGrandchild f_child = 5; */ + public Builder mergeFChild(com.google.showcase.v1beta1.ComplianceDataGrandchild value) { + if (fChildBuilder_ == null) { + if (fChild_ != null) { + fChild_ = + com.google.showcase.v1beta1.ComplianceDataGrandchild.newBuilder(fChild_) + .mergeFrom(value) + .buildPartial(); + } else { + fChild_ = value; + } + onChanged(); + } else { + fChildBuilder_.mergeFrom(value); + } + + return this; + } + + /** .google.showcase.v1beta1.ComplianceDataGrandchild f_child = 5; */ + public Builder clearFChild() { + if (fChildBuilder_ == null) { + fChild_ = null; + onChanged(); + } else { + fChild_ = null; + fChildBuilder_ = null; + } + + return this; + } + + /** .google.showcase.v1beta1.ComplianceDataGrandchild f_child = 5; */ + public com.google.showcase.v1beta1.ComplianceDataGrandchild.Builder getFChildBuilder() { + + onChanged(); + return getFChildFieldBuilder().getBuilder(); + } + + /** .google.showcase.v1beta1.ComplianceDataGrandchild f_child = 5; */ + public com.google.showcase.v1beta1.ComplianceDataGrandchildOrBuilder getFChildOrBuilder() { + if (fChildBuilder_ != null) { + return fChildBuilder_.getMessageOrBuilder(); + } else { + return fChild_ == null + ? com.google.showcase.v1beta1.ComplianceDataGrandchild.getDefaultInstance() + : fChild_; + } + } + + /** .google.showcase.v1beta1.ComplianceDataGrandchild f_child = 5; */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.showcase.v1beta1.ComplianceDataGrandchild, + com.google.showcase.v1beta1.ComplianceDataGrandchild.Builder, + com.google.showcase.v1beta1.ComplianceDataGrandchildOrBuilder> + getFChildFieldBuilder() { + if (fChildBuilder_ == null) { + fChildBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.showcase.v1beta1.ComplianceDataGrandchild, + com.google.showcase.v1beta1.ComplianceDataGrandchild.Builder, + com.google.showcase.v1beta1.ComplianceDataGrandchildOrBuilder>( + getFChild(), getParentForChildren(), isClean()); + fChild_ = null; + } + return fChildBuilder_; + } + + private java.lang.Object pString_ = ""; + + /** + * optional string p_string = 6; + * + * @return Whether the pString field is set. + */ + public boolean hasPString() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * optional string p_string = 6; + * + * @return The pString. + */ + public java.lang.String getPString() { + java.lang.Object ref = pString_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pString_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * optional string p_string = 6; + * + * @return The bytes for pString. + */ + public com.google.protobuf.ByteString getPStringBytes() { + java.lang.Object ref = pString_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pString_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * optional string p_string = 6; + * + * @param value The pString to set. + * @return This builder for chaining. + */ + public Builder setPString(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000001; + pString_ = value; + onChanged(); + return this; + } + + /** + * optional string p_string = 6; + * + * @return This builder for chaining. + */ + public Builder clearPString() { + bitField0_ = (bitField0_ & ~0x00000001); + pString_ = getDefaultInstance().getPString(); + onChanged(); + return this; + } + + /** + * optional string p_string = 6; + * + * @param value The bytes for pString to set. + * @return This builder for chaining. + */ + public Builder setPStringBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + bitField0_ |= 0x00000001; + pString_ = value; + onChanged(); + return this; + } + + private float pFloat_; + + /** + * optional float p_float = 7; + * + * @return Whether the pFloat field is set. + */ + @java.lang.Override + public boolean hasPFloat() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * optional float p_float = 7; + * + * @return The pFloat. + */ + @java.lang.Override + public float getPFloat() { + return pFloat_; + } + + /** + * optional float p_float = 7; + * + * @param value The pFloat to set. + * @return This builder for chaining. + */ + public Builder setPFloat(float value) { + bitField0_ |= 0x00000002; + pFloat_ = value; + onChanged(); + return this; + } + + /** + * optional float p_float = 7; + * + * @return This builder for chaining. + */ + public Builder clearPFloat() { + bitField0_ = (bitField0_ & ~0x00000002); + pFloat_ = 0F; + onChanged(); + return this; + } + + private double pDouble_; + + /** + * optional double p_double = 8; + * + * @return Whether the pDouble field is set. + */ + @java.lang.Override + public boolean hasPDouble() { + return ((bitField0_ & 0x00000004) != 0); + } + + /** + * optional double p_double = 8; + * + * @return The pDouble. + */ + @java.lang.Override + public double getPDouble() { + return pDouble_; + } + + /** + * optional double p_double = 8; + * + * @param value The pDouble to set. + * @return This builder for chaining. + */ + public Builder setPDouble(double value) { + bitField0_ |= 0x00000004; + pDouble_ = value; + onChanged(); + return this; + } + + /** + * optional double p_double = 8; + * + * @return This builder for chaining. + */ + public Builder clearPDouble() { + bitField0_ = (bitField0_ & ~0x00000004); + pDouble_ = 0D; + onChanged(); + return this; + } + + private boolean pBool_; + + /** + * optional bool p_bool = 9; + * + * @return Whether the pBool field is set. + */ + @java.lang.Override + public boolean hasPBool() { + return ((bitField0_ & 0x00000008) != 0); + } + + /** + * optional bool p_bool = 9; + * + * @return The pBool. + */ + @java.lang.Override + public boolean getPBool() { + return pBool_; + } + + /** + * optional bool p_bool = 9; + * + * @param value The pBool to set. + * @return This builder for chaining. + */ + public Builder setPBool(boolean value) { + bitField0_ |= 0x00000008; + pBool_ = value; + onChanged(); + return this; + } + + /** + * optional bool p_bool = 9; + * + * @return This builder for chaining. + */ + public Builder clearPBool() { + bitField0_ = (bitField0_ & ~0x00000008); + pBool_ = false; + onChanged(); + return this; + } + + private int pContinent_ = 0; + + /** + * .google.showcase.v1beta1.Continent p_continent = 12; + * + * @return The enum numeric value on the wire for pContinent. + */ + @java.lang.Override + public int getPContinentValue() { + return pContinent_; + } + + /** + * .google.showcase.v1beta1.Continent p_continent = 12; + * + * @param value The enum numeric value on the wire for pContinent to set. + * @return This builder for chaining. + */ + public Builder setPContinentValue(int value) { + + pContinent_ = value; + onChanged(); + return this; + } + + /** + * .google.showcase.v1beta1.Continent p_continent = 12; + * + * @return The pContinent. + */ + @java.lang.Override + public com.google.showcase.v1beta1.Continent getPContinent() { + @SuppressWarnings("deprecation") + com.google.showcase.v1beta1.Continent result = + com.google.showcase.v1beta1.Continent.valueOf(pContinent_); + return result == null ? com.google.showcase.v1beta1.Continent.UNRECOGNIZED : result; + } + + /** + * .google.showcase.v1beta1.Continent p_continent = 12; + * + * @param value The pContinent to set. + * @return This builder for chaining. + */ + public Builder setPContinent(com.google.showcase.v1beta1.Continent value) { + if (value == null) { + throw new NullPointerException(); + } + + pContinent_ = value.getNumber(); + onChanged(); + return this; + } + + /** + * .google.showcase.v1beta1.Continent p_continent = 12; + * + * @return This builder for chaining. + */ + public Builder clearPContinent() { + + pContinent_ = 0; + onChanged(); + return this; + } + + private com.google.showcase.v1beta1.ComplianceDataGrandchild pChild_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.showcase.v1beta1.ComplianceDataGrandchild, + com.google.showcase.v1beta1.ComplianceDataGrandchild.Builder, + com.google.showcase.v1beta1.ComplianceDataGrandchildOrBuilder> + pChildBuilder_; + + /** + * optional .google.showcase.v1beta1.ComplianceDataGrandchild p_child = 10; + * + * @return Whether the pChild field is set. + */ + public boolean hasPChild() { + return ((bitField0_ & 0x00000010) != 0); + } + + /** + * optional .google.showcase.v1beta1.ComplianceDataGrandchild p_child = 10; + * + * @return The pChild. + */ + public com.google.showcase.v1beta1.ComplianceDataGrandchild getPChild() { + if (pChildBuilder_ == null) { + return pChild_ == null + ? com.google.showcase.v1beta1.ComplianceDataGrandchild.getDefaultInstance() + : pChild_; + } else { + return pChildBuilder_.getMessage(); + } + } + + /** optional .google.showcase.v1beta1.ComplianceDataGrandchild p_child = 10; */ + public Builder setPChild(com.google.showcase.v1beta1.ComplianceDataGrandchild value) { + if (pChildBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + pChild_ = value; + onChanged(); + } else { + pChildBuilder_.setMessage(value); + } + bitField0_ |= 0x00000010; + return this; + } + + /** optional .google.showcase.v1beta1.ComplianceDataGrandchild p_child = 10; */ + public Builder setPChild( + com.google.showcase.v1beta1.ComplianceDataGrandchild.Builder builderForValue) { + if (pChildBuilder_ == null) { + pChild_ = builderForValue.build(); + onChanged(); + } else { + pChildBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000010; + return this; + } + + /** optional .google.showcase.v1beta1.ComplianceDataGrandchild p_child = 10; */ + public Builder mergePChild(com.google.showcase.v1beta1.ComplianceDataGrandchild value) { + if (pChildBuilder_ == null) { + if (((bitField0_ & 0x00000010) != 0) + && pChild_ != null + && pChild_ + != com.google.showcase.v1beta1.ComplianceDataGrandchild.getDefaultInstance()) { + pChild_ = + com.google.showcase.v1beta1.ComplianceDataGrandchild.newBuilder(pChild_) + .mergeFrom(value) + .buildPartial(); + } else { + pChild_ = value; + } + onChanged(); + } else { + pChildBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000010; + return this; + } + + /** optional .google.showcase.v1beta1.ComplianceDataGrandchild p_child = 10; */ + public Builder clearPChild() { + if (pChildBuilder_ == null) { + pChild_ = null; + onChanged(); + } else { + pChildBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000010); + return this; + } + + /** optional .google.showcase.v1beta1.ComplianceDataGrandchild p_child = 10; */ + public com.google.showcase.v1beta1.ComplianceDataGrandchild.Builder getPChildBuilder() { + bitField0_ |= 0x00000010; + onChanged(); + return getPChildFieldBuilder().getBuilder(); + } + + /** optional .google.showcase.v1beta1.ComplianceDataGrandchild p_child = 10; */ + public com.google.showcase.v1beta1.ComplianceDataGrandchildOrBuilder getPChildOrBuilder() { + if (pChildBuilder_ != null) { + return pChildBuilder_.getMessageOrBuilder(); + } else { + return pChild_ == null + ? com.google.showcase.v1beta1.ComplianceDataGrandchild.getDefaultInstance() + : pChild_; + } + } + + /** optional .google.showcase.v1beta1.ComplianceDataGrandchild p_child = 10; */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.showcase.v1beta1.ComplianceDataGrandchild, + com.google.showcase.v1beta1.ComplianceDataGrandchild.Builder, + com.google.showcase.v1beta1.ComplianceDataGrandchildOrBuilder> + getPChildFieldBuilder() { + if (pChildBuilder_ == null) { + pChildBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.showcase.v1beta1.ComplianceDataGrandchild, + com.google.showcase.v1beta1.ComplianceDataGrandchild.Builder, + com.google.showcase.v1beta1.ComplianceDataGrandchildOrBuilder>( + getPChild(), getParentForChildren(), isClean()); + pChild_ = null; + } + return pChildBuilder_; + } + + @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.showcase.v1beta1.ComplianceDataChild) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.ComplianceDataChild) + private static final com.google.showcase.v1beta1.ComplianceDataChild DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.ComplianceDataChild(); + } + + public static com.google.showcase.v1beta1.ComplianceDataChild getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ComplianceDataChild parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ComplianceDataChild(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.showcase.v1beta1.ComplianceDataChild getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ComplianceDataChildOrBuilder.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ComplianceDataChildOrBuilder.java new file mode 100644 index 0000000000..d388a3776e --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ComplianceDataChildOrBuilder.java @@ -0,0 +1,185 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/compliance.proto + +package com.google.showcase.v1beta1; + +public interface ComplianceDataChildOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.ComplianceDataChild) + com.google.protobuf.MessageOrBuilder { + + /** + * string f_string = 1; + * + * @return The fString. + */ + java.lang.String getFString(); + + /** + * string f_string = 1; + * + * @return The bytes for fString. + */ + com.google.protobuf.ByteString getFStringBytes(); + + /** + * float f_float = 2; + * + * @return The fFloat. + */ + float getFFloat(); + + /** + * double f_double = 3; + * + * @return The fDouble. + */ + double getFDouble(); + + /** + * bool f_bool = 4; + * + * @return The fBool. + */ + boolean getFBool(); + + /** + * .google.showcase.v1beta1.Continent f_continent = 11; + * + * @return The enum numeric value on the wire for fContinent. + */ + int getFContinentValue(); + + /** + * .google.showcase.v1beta1.Continent f_continent = 11; + * + * @return The fContinent. + */ + com.google.showcase.v1beta1.Continent getFContinent(); + + /** + * .google.showcase.v1beta1.ComplianceDataGrandchild f_child = 5; + * + * @return Whether the fChild field is set. + */ + boolean hasFChild(); + + /** + * .google.showcase.v1beta1.ComplianceDataGrandchild f_child = 5; + * + * @return The fChild. + */ + com.google.showcase.v1beta1.ComplianceDataGrandchild getFChild(); + + /** .google.showcase.v1beta1.ComplianceDataGrandchild f_child = 5; */ + com.google.showcase.v1beta1.ComplianceDataGrandchildOrBuilder getFChildOrBuilder(); + + /** + * optional string p_string = 6; + * + * @return Whether the pString field is set. + */ + boolean hasPString(); + + /** + * optional string p_string = 6; + * + * @return The pString. + */ + java.lang.String getPString(); + + /** + * optional string p_string = 6; + * + * @return The bytes for pString. + */ + com.google.protobuf.ByteString getPStringBytes(); + + /** + * optional float p_float = 7; + * + * @return Whether the pFloat field is set. + */ + boolean hasPFloat(); + + /** + * optional float p_float = 7; + * + * @return The pFloat. + */ + float getPFloat(); + + /** + * optional double p_double = 8; + * + * @return Whether the pDouble field is set. + */ + boolean hasPDouble(); + + /** + * optional double p_double = 8; + * + * @return The pDouble. + */ + double getPDouble(); + + /** + * optional bool p_bool = 9; + * + * @return Whether the pBool field is set. + */ + boolean hasPBool(); + + /** + * optional bool p_bool = 9; + * + * @return The pBool. + */ + boolean getPBool(); + + /** + * .google.showcase.v1beta1.Continent p_continent = 12; + * + * @return The enum numeric value on the wire for pContinent. + */ + int getPContinentValue(); + + /** + * .google.showcase.v1beta1.Continent p_continent = 12; + * + * @return The pContinent. + */ + com.google.showcase.v1beta1.Continent getPContinent(); + + /** + * optional .google.showcase.v1beta1.ComplianceDataGrandchild p_child = 10; + * + * @return Whether the pChild field is set. + */ + boolean hasPChild(); + + /** + * optional .google.showcase.v1beta1.ComplianceDataGrandchild p_child = 10; + * + * @return The pChild. + */ + com.google.showcase.v1beta1.ComplianceDataGrandchild getPChild(); + + /** optional .google.showcase.v1beta1.ComplianceDataGrandchild p_child = 10; */ + com.google.showcase.v1beta1.ComplianceDataGrandchildOrBuilder getPChildOrBuilder(); +} diff --git a/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ComplianceDataGrandchild.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ComplianceDataGrandchild.java new file mode 100644 index 0000000000..4882baa2d7 --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ComplianceDataGrandchild.java @@ -0,0 +1,733 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/compliance.proto + +package com.google.showcase.v1beta1; + +/** Protobuf type {@code google.showcase.v1beta1.ComplianceDataGrandchild} */ +public final class ComplianceDataGrandchild extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.ComplianceDataGrandchild) + ComplianceDataGrandchildOrBuilder { + private static final long serialVersionUID = 0L; + + // Use ComplianceDataGrandchild.newBuilder() to construct. + private ComplianceDataGrandchild(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ComplianceDataGrandchild() { + fString_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ComplianceDataGrandchild(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ComplianceDataGrandchild( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + fString_ = s; + break; + } + case 17: + { + fDouble_ = input.readDouble(); + break; + } + case 24: + { + fBool_ = input.readBool(); + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.ComplianceOuterClass + .internal_static_google_showcase_v1beta1_ComplianceDataGrandchild_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.ComplianceOuterClass + .internal_static_google_showcase_v1beta1_ComplianceDataGrandchild_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.ComplianceDataGrandchild.class, + com.google.showcase.v1beta1.ComplianceDataGrandchild.Builder.class); + } + + public static final int F_STRING_FIELD_NUMBER = 1; + private volatile java.lang.Object fString_; + + /** + * string f_string = 1; + * + * @return The fString. + */ + @java.lang.Override + public java.lang.String getFString() { + java.lang.Object ref = fString_; + 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(); + fString_ = s; + return s; + } + } + + /** + * string f_string = 1; + * + * @return The bytes for fString. + */ + @java.lang.Override + public com.google.protobuf.ByteString getFStringBytes() { + java.lang.Object ref = fString_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + fString_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int F_DOUBLE_FIELD_NUMBER = 2; + private double fDouble_; + + /** + * double f_double = 2; + * + * @return The fDouble. + */ + @java.lang.Override + public double getFDouble() { + return fDouble_; + } + + public static final int F_BOOL_FIELD_NUMBER = 3; + private boolean fBool_; + + /** + * bool f_bool = 3; + * + * @return The fBool. + */ + @java.lang.Override + public boolean getFBool() { + return fBool_; + } + + 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(fString_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, fString_); + } + if (java.lang.Double.doubleToRawLongBits(fDouble_) != 0) { + output.writeDouble(2, fDouble_); + } + if (fBool_ != false) { + output.writeBool(3, fBool_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(fString_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, fString_); + } + if (java.lang.Double.doubleToRawLongBits(fDouble_) != 0) { + size += com.google.protobuf.CodedOutputStream.computeDoubleSize(2, fDouble_); + } + if (fBool_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(3, fBool_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.showcase.v1beta1.ComplianceDataGrandchild)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.ComplianceDataGrandchild other = + (com.google.showcase.v1beta1.ComplianceDataGrandchild) obj; + + if (!getFString().equals(other.getFString())) return false; + if (java.lang.Double.doubleToLongBits(getFDouble()) + != java.lang.Double.doubleToLongBits(other.getFDouble())) return false; + if (getFBool() != other.getFBool()) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + F_STRING_FIELD_NUMBER; + hash = (53 * hash) + getFString().hashCode(); + hash = (37 * hash) + F_DOUBLE_FIELD_NUMBER; + hash = + (53 * hash) + + com.google.protobuf.Internal.hashLong( + java.lang.Double.doubleToLongBits(getFDouble())); + hash = (37 * hash) + F_BOOL_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getFBool()); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.showcase.v1beta1.ComplianceDataGrandchild parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.ComplianceDataGrandchild parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.ComplianceDataGrandchild parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.ComplianceDataGrandchild 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.showcase.v1beta1.ComplianceDataGrandchild parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.ComplianceDataGrandchild parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.ComplianceDataGrandchild parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.ComplianceDataGrandchild 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.showcase.v1beta1.ComplianceDataGrandchild parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.ComplianceDataGrandchild 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.showcase.v1beta1.ComplianceDataGrandchild parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.ComplianceDataGrandchild 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.showcase.v1beta1.ComplianceDataGrandchild prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** Protobuf type {@code google.showcase.v1beta1.ComplianceDataGrandchild} */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.ComplianceDataGrandchild) + com.google.showcase.v1beta1.ComplianceDataGrandchildOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.ComplianceOuterClass + .internal_static_google_showcase_v1beta1_ComplianceDataGrandchild_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.ComplianceOuterClass + .internal_static_google_showcase_v1beta1_ComplianceDataGrandchild_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.ComplianceDataGrandchild.class, + com.google.showcase.v1beta1.ComplianceDataGrandchild.Builder.class); + } + + // Construct using com.google.showcase.v1beta1.ComplianceDataGrandchild.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + fString_ = ""; + + fDouble_ = 0D; + + fBool_ = false; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.showcase.v1beta1.ComplianceOuterClass + .internal_static_google_showcase_v1beta1_ComplianceDataGrandchild_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.ComplianceDataGrandchild getDefaultInstanceForType() { + return com.google.showcase.v1beta1.ComplianceDataGrandchild.getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.ComplianceDataGrandchild build() { + com.google.showcase.v1beta1.ComplianceDataGrandchild result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.ComplianceDataGrandchild buildPartial() { + com.google.showcase.v1beta1.ComplianceDataGrandchild result = + new com.google.showcase.v1beta1.ComplianceDataGrandchild(this); + result.fString_ = fString_; + result.fDouble_ = fDouble_; + result.fBool_ = fBool_; + 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.showcase.v1beta1.ComplianceDataGrandchild) { + return mergeFrom((com.google.showcase.v1beta1.ComplianceDataGrandchild) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.showcase.v1beta1.ComplianceDataGrandchild other) { + if (other == com.google.showcase.v1beta1.ComplianceDataGrandchild.getDefaultInstance()) + return this; + if (!other.getFString().isEmpty()) { + fString_ = other.fString_; + onChanged(); + } + if (other.getFDouble() != 0D) { + setFDouble(other.getFDouble()); + } + if (other.getFBool() != false) { + setFBool(other.getFBool()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.showcase.v1beta1.ComplianceDataGrandchild parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.showcase.v1beta1.ComplianceDataGrandchild) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object fString_ = ""; + + /** + * string f_string = 1; + * + * @return The fString. + */ + public java.lang.String getFString() { + java.lang.Object ref = fString_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + fString_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * string f_string = 1; + * + * @return The bytes for fString. + */ + public com.google.protobuf.ByteString getFStringBytes() { + java.lang.Object ref = fString_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + fString_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * string f_string = 1; + * + * @param value The fString to set. + * @return This builder for chaining. + */ + public Builder setFString(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + fString_ = value; + onChanged(); + return this; + } + + /** + * string f_string = 1; + * + * @return This builder for chaining. + */ + public Builder clearFString() { + + fString_ = getDefaultInstance().getFString(); + onChanged(); + return this; + } + + /** + * string f_string = 1; + * + * @param value The bytes for fString to set. + * @return This builder for chaining. + */ + public Builder setFStringBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + fString_ = value; + onChanged(); + return this; + } + + private double fDouble_; + + /** + * double f_double = 2; + * + * @return The fDouble. + */ + @java.lang.Override + public double getFDouble() { + return fDouble_; + } + + /** + * double f_double = 2; + * + * @param value The fDouble to set. + * @return This builder for chaining. + */ + public Builder setFDouble(double value) { + + fDouble_ = value; + onChanged(); + return this; + } + + /** + * double f_double = 2; + * + * @return This builder for chaining. + */ + public Builder clearFDouble() { + + fDouble_ = 0D; + onChanged(); + return this; + } + + private boolean fBool_; + + /** + * bool f_bool = 3; + * + * @return The fBool. + */ + @java.lang.Override + public boolean getFBool() { + return fBool_; + } + + /** + * bool f_bool = 3; + * + * @param value The fBool to set. + * @return This builder for chaining. + */ + public Builder setFBool(boolean value) { + + fBool_ = value; + onChanged(); + return this; + } + + /** + * bool f_bool = 3; + * + * @return This builder for chaining. + */ + public Builder clearFBool() { + + fBool_ = 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.showcase.v1beta1.ComplianceDataGrandchild) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.ComplianceDataGrandchild) + private static final com.google.showcase.v1beta1.ComplianceDataGrandchild DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.ComplianceDataGrandchild(); + } + + public static com.google.showcase.v1beta1.ComplianceDataGrandchild getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ComplianceDataGrandchild parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ComplianceDataGrandchild(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.showcase.v1beta1.ComplianceDataGrandchild getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ComplianceDataGrandchildOrBuilder.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ComplianceDataGrandchildOrBuilder.java new file mode 100644 index 0000000000..e37e4e9f13 --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ComplianceDataGrandchildOrBuilder.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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/compliance.proto + +package com.google.showcase.v1beta1; + +public interface ComplianceDataGrandchildOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.ComplianceDataGrandchild) + com.google.protobuf.MessageOrBuilder { + + /** + * string f_string = 1; + * + * @return The fString. + */ + java.lang.String getFString(); + + /** + * string f_string = 1; + * + * @return The bytes for fString. + */ + com.google.protobuf.ByteString getFStringBytes(); + + /** + * double f_double = 2; + * + * @return The fDouble. + */ + double getFDouble(); + + /** + * bool f_bool = 3; + * + * @return The fBool. + */ + boolean getFBool(); +} diff --git a/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ComplianceDataOrBuilder.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ComplianceDataOrBuilder.java new file mode 100644 index 0000000000..4b0b34b205 --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ComplianceDataOrBuilder.java @@ -0,0 +1,269 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/compliance.proto + +package com.google.showcase.v1beta1; + +public interface ComplianceDataOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.ComplianceData) + com.google.protobuf.MessageOrBuilder { + + /** + * string f_string = 1; + * + * @return The fString. + */ + java.lang.String getFString(); + + /** + * string f_string = 1; + * + * @return The bytes for fString. + */ + com.google.protobuf.ByteString getFStringBytes(); + + /** + * int32 f_int32 = 2; + * + * @return The fInt32. + */ + int getFInt32(); + + /** + * sint32 f_sint32 = 3; + * + * @return The fSint32. + */ + int getFSint32(); + + /** + * sfixed32 f_sfixed32 = 4; + * + * @return The fSfixed32. + */ + int getFSfixed32(); + + /** + * uint32 f_uint32 = 5; + * + * @return The fUint32. + */ + int getFUint32(); + + /** + * fixed32 f_fixed32 = 6; + * + * @return The fFixed32. + */ + int getFFixed32(); + + /** + * int64 f_int64 = 7; + * + * @return The fInt64. + */ + long getFInt64(); + + /** + * sint64 f_sint64 = 8; + * + * @return The fSint64. + */ + long getFSint64(); + + /** + * sfixed64 f_sfixed64 = 9; + * + * @return The fSfixed64. + */ + long getFSfixed64(); + + /** + * uint64 f_uint64 = 10; + * + * @return The fUint64. + */ + long getFUint64(); + + /** + * fixed64 f_fixed64 = 11; + * + * @return The fFixed64. + */ + long getFFixed64(); + + /** + * double f_double = 12; + * + * @return The fDouble. + */ + double getFDouble(); + + /** + * float f_float = 13; + * + * @return The fFloat. + */ + float getFFloat(); + + /** + * bool f_bool = 14; + * + * @return The fBool. + */ + boolean getFBool(); + + /** + * bytes f_bytes = 15; + * + * @return The fBytes. + */ + com.google.protobuf.ByteString getFBytes(); + + /** + * .google.showcase.v1beta1.ComplianceData.LifeKingdom f_kingdom = 22; + * + * @return The enum numeric value on the wire for fKingdom. + */ + int getFKingdomValue(); + + /** + * .google.showcase.v1beta1.ComplianceData.LifeKingdom f_kingdom = 22; + * + * @return The fKingdom. + */ + com.google.showcase.v1beta1.ComplianceData.LifeKingdom getFKingdom(); + + /** + * .google.showcase.v1beta1.ComplianceDataChild f_child = 16; + * + * @return Whether the fChild field is set. + */ + boolean hasFChild(); + + /** + * .google.showcase.v1beta1.ComplianceDataChild f_child = 16; + * + * @return The fChild. + */ + com.google.showcase.v1beta1.ComplianceDataChild getFChild(); + + /** .google.showcase.v1beta1.ComplianceDataChild f_child = 16; */ + com.google.showcase.v1beta1.ComplianceDataChildOrBuilder getFChildOrBuilder(); + + /** + * optional string p_string = 17; + * + * @return Whether the pString field is set. + */ + boolean hasPString(); + + /** + * optional string p_string = 17; + * + * @return The pString. + */ + java.lang.String getPString(); + + /** + * optional string p_string = 17; + * + * @return The bytes for pString. + */ + com.google.protobuf.ByteString getPStringBytes(); + + /** + * optional int32 p_int32 = 18; + * + * @return Whether the pInt32 field is set. + */ + boolean hasPInt32(); + + /** + * optional int32 p_int32 = 18; + * + * @return The pInt32. + */ + int getPInt32(); + + /** + * optional double p_double = 19; + * + * @return Whether the pDouble field is set. + */ + boolean hasPDouble(); + + /** + * optional double p_double = 19; + * + * @return The pDouble. + */ + double getPDouble(); + + /** + * optional bool p_bool = 20; + * + * @return Whether the pBool field is set. + */ + boolean hasPBool(); + + /** + * optional bool p_bool = 20; + * + * @return The pBool. + */ + boolean getPBool(); + + /** + * optional .google.showcase.v1beta1.ComplianceData.LifeKingdom p_kingdom = 23; + * + * @return Whether the pKingdom field is set. + */ + boolean hasPKingdom(); + + /** + * optional .google.showcase.v1beta1.ComplianceData.LifeKingdom p_kingdom = 23; + * + * @return The enum numeric value on the wire for pKingdom. + */ + int getPKingdomValue(); + + /** + * optional .google.showcase.v1beta1.ComplianceData.LifeKingdom p_kingdom = 23; + * + * @return The pKingdom. + */ + com.google.showcase.v1beta1.ComplianceData.LifeKingdom getPKingdom(); + + /** + * optional .google.showcase.v1beta1.ComplianceDataChild p_child = 21; + * + * @return Whether the pChild field is set. + */ + boolean hasPChild(); + + /** + * optional .google.showcase.v1beta1.ComplianceDataChild p_child = 21; + * + * @return The pChild. + */ + com.google.showcase.v1beta1.ComplianceDataChild getPChild(); + + /** optional .google.showcase.v1beta1.ComplianceDataChild p_child = 21; */ + com.google.showcase.v1beta1.ComplianceDataChildOrBuilder getPChildOrBuilder(); +} diff --git a/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ComplianceGroup.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ComplianceGroup.java new file mode 100644 index 0000000000..7cd8869afd --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ComplianceGroup.java @@ -0,0 +1,1148 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/compliance.proto + +package com.google.showcase.v1beta1; + +/** + * + * + *
        + * ComplianceGroups encapsulates a group of RPC requests to the Compliance
        + * server: one request for each combination of elements of `rpcs` and of
        + * `requests`.
        + * 
        + * + * Protobuf type {@code google.showcase.v1beta1.ComplianceGroup} + */ +public final class ComplianceGroup extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.ComplianceGroup) + ComplianceGroupOrBuilder { + private static final long serialVersionUID = 0L; + + // Use ComplianceGroup.newBuilder() to construct. + private ComplianceGroup(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ComplianceGroup() { + name_ = ""; + rpcs_ = com.google.protobuf.LazyStringArrayList.EMPTY; + requests_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ComplianceGroup(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ComplianceGroup( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + rpcs_ = new com.google.protobuf.LazyStringArrayList(); + mutable_bitField0_ |= 0x00000001; + } + rpcs_.add(s); + break; + } + case 26: + { + if (!((mutable_bitField0_ & 0x00000002) != 0)) { + requests_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000002; + } + requests_.add( + input.readMessage( + com.google.showcase.v1beta1.RepeatRequest.parser(), extensionRegistry)); + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + rpcs_ = rpcs_.getUnmodifiableView(); + } + if (((mutable_bitField0_ & 0x00000002) != 0)) { + requests_ = java.util.Collections.unmodifiableList(requests_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.ComplianceOuterClass + .internal_static_google_showcase_v1beta1_ComplianceGroup_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.ComplianceOuterClass + .internal_static_google_showcase_v1beta1_ComplianceGroup_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.ComplianceGroup.class, + com.google.showcase.v1beta1.ComplianceGroup.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + + /** + * 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; + } + } + + /** + * 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 RPCS_FIELD_NUMBER = 2; + private com.google.protobuf.LazyStringList rpcs_; + + /** + * repeated string rpcs = 2; + * + * @return A list containing the rpcs. + */ + public com.google.protobuf.ProtocolStringList getRpcsList() { + return rpcs_; + } + + /** + * repeated string rpcs = 2; + * + * @return The count of rpcs. + */ + public int getRpcsCount() { + return rpcs_.size(); + } + + /** + * repeated string rpcs = 2; + * + * @param index The index of the element to return. + * @return The rpcs at the given index. + */ + public java.lang.String getRpcs(int index) { + return rpcs_.get(index); + } + + /** + * repeated string rpcs = 2; + * + * @param index The index of the value to return. + * @return The bytes of the rpcs at the given index. + */ + public com.google.protobuf.ByteString getRpcsBytes(int index) { + return rpcs_.getByteString(index); + } + + public static final int REQUESTS_FIELD_NUMBER = 3; + private java.util.List requests_; + + /** repeated .google.showcase.v1beta1.RepeatRequest requests = 3; */ + @java.lang.Override + public java.util.List getRequestsList() { + return requests_; + } + + /** repeated .google.showcase.v1beta1.RepeatRequest requests = 3; */ + @java.lang.Override + public java.util.List + getRequestsOrBuilderList() { + return requests_; + } + + /** repeated .google.showcase.v1beta1.RepeatRequest requests = 3; */ + @java.lang.Override + public int getRequestsCount() { + return requests_.size(); + } + + /** repeated .google.showcase.v1beta1.RepeatRequest requests = 3; */ + @java.lang.Override + public com.google.showcase.v1beta1.RepeatRequest getRequests(int index) { + return requests_.get(index); + } + + /** repeated .google.showcase.v1beta1.RepeatRequest requests = 3; */ + @java.lang.Override + public com.google.showcase.v1beta1.RepeatRequestOrBuilder getRequestsOrBuilder(int index) { + return requests_.get(index); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + for (int i = 0; i < rpcs_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, rpcs_.getRaw(i)); + } + for (int i = 0; i < requests_.size(); i++) { + output.writeMessage(3, requests_.get(i)); + } + unknownFields.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_); + } + { + int dataSize = 0; + for (int i = 0; i < rpcs_.size(); i++) { + dataSize += computeStringSizeNoTag(rpcs_.getRaw(i)); + } + size += dataSize; + size += 1 * getRpcsList().size(); + } + for (int i = 0; i < requests_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, requests_.get(i)); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.showcase.v1beta1.ComplianceGroup)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.ComplianceGroup other = + (com.google.showcase.v1beta1.ComplianceGroup) obj; + + if (!getName().equals(other.getName())) return false; + if (!getRpcsList().equals(other.getRpcsList())) return false; + if (!getRequestsList().equals(other.getRequestsList())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + if (getRpcsCount() > 0) { + hash = (37 * hash) + RPCS_FIELD_NUMBER; + hash = (53 * hash) + getRpcsList().hashCode(); + } + if (getRequestsCount() > 0) { + hash = (37 * hash) + REQUESTS_FIELD_NUMBER; + hash = (53 * hash) + getRequestsList().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.showcase.v1beta1.ComplianceGroup parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.ComplianceGroup parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.ComplianceGroup parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.ComplianceGroup 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.showcase.v1beta1.ComplianceGroup parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.ComplianceGroup parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.ComplianceGroup parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.ComplianceGroup 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.showcase.v1beta1.ComplianceGroup parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.ComplianceGroup 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.showcase.v1beta1.ComplianceGroup parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.ComplianceGroup 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.showcase.v1beta1.ComplianceGroup 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; + } + + /** + * + * + *
        +   * ComplianceGroups encapsulates a group of RPC requests to the Compliance
        +   * server: one request for each combination of elements of `rpcs` and of
        +   * `requests`.
        +   * 
        + * + * Protobuf type {@code google.showcase.v1beta1.ComplianceGroup} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.ComplianceGroup) + com.google.showcase.v1beta1.ComplianceGroupOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.ComplianceOuterClass + .internal_static_google_showcase_v1beta1_ComplianceGroup_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.ComplianceOuterClass + .internal_static_google_showcase_v1beta1_ComplianceGroup_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.ComplianceGroup.class, + com.google.showcase.v1beta1.ComplianceGroup.Builder.class); + } + + // Construct using com.google.showcase.v1beta1.ComplianceGroup.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getRequestsFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + rpcs_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000001); + if (requestsBuilder_ == null) { + requests_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + } else { + requestsBuilder_.clear(); + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.showcase.v1beta1.ComplianceOuterClass + .internal_static_google_showcase_v1beta1_ComplianceGroup_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.ComplianceGroup getDefaultInstanceForType() { + return com.google.showcase.v1beta1.ComplianceGroup.getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.ComplianceGroup build() { + com.google.showcase.v1beta1.ComplianceGroup result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.ComplianceGroup buildPartial() { + com.google.showcase.v1beta1.ComplianceGroup result = + new com.google.showcase.v1beta1.ComplianceGroup(this); + int from_bitField0_ = bitField0_; + result.name_ = name_; + if (((bitField0_ & 0x00000001) != 0)) { + rpcs_ = rpcs_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.rpcs_ = rpcs_; + if (requestsBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0)) { + requests_ = java.util.Collections.unmodifiableList(requests_); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.requests_ = requests_; + } else { + result.requests_ = requestsBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.showcase.v1beta1.ComplianceGroup) { + return mergeFrom((com.google.showcase.v1beta1.ComplianceGroup) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.showcase.v1beta1.ComplianceGroup other) { + if (other == com.google.showcase.v1beta1.ComplianceGroup.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + if (!other.rpcs_.isEmpty()) { + if (rpcs_.isEmpty()) { + rpcs_ = other.rpcs_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureRpcsIsMutable(); + rpcs_.addAll(other.rpcs_); + } + onChanged(); + } + if (requestsBuilder_ == null) { + if (!other.requests_.isEmpty()) { + if (requests_.isEmpty()) { + requests_ = other.requests_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureRequestsIsMutable(); + requests_.addAll(other.requests_); + } + onChanged(); + } + } else { + if (!other.requests_.isEmpty()) { + if (requestsBuilder_.isEmpty()) { + requestsBuilder_.dispose(); + requestsBuilder_ = null; + requests_ = other.requests_; + bitField0_ = (bitField0_ & ~0x00000002); + requestsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getRequestsFieldBuilder() + : null; + } else { + requestsBuilder_.addAllMessages(other.requests_); + } + } + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.showcase.v1beta1.ComplianceGroup parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.showcase.v1beta1.ComplianceGroup) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + + /** + * string name = 1; + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * 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; + } + } + + /** + * string name = 1; + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + + /** + * string name = 1; + * + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + + /** + * string name = 1; + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + + private com.google.protobuf.LazyStringList rpcs_ = + com.google.protobuf.LazyStringArrayList.EMPTY; + + private void ensureRpcsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + rpcs_ = new com.google.protobuf.LazyStringArrayList(rpcs_); + bitField0_ |= 0x00000001; + } + } + + /** + * repeated string rpcs = 2; + * + * @return A list containing the rpcs. + */ + public com.google.protobuf.ProtocolStringList getRpcsList() { + return rpcs_.getUnmodifiableView(); + } + + /** + * repeated string rpcs = 2; + * + * @return The count of rpcs. + */ + public int getRpcsCount() { + return rpcs_.size(); + } + + /** + * repeated string rpcs = 2; + * + * @param index The index of the element to return. + * @return The rpcs at the given index. + */ + public java.lang.String getRpcs(int index) { + return rpcs_.get(index); + } + + /** + * repeated string rpcs = 2; + * + * @param index The index of the value to return. + * @return The bytes of the rpcs at the given index. + */ + public com.google.protobuf.ByteString getRpcsBytes(int index) { + return rpcs_.getByteString(index); + } + + /** + * repeated string rpcs = 2; + * + * @param index The index to set the value at. + * @param value The rpcs to set. + * @return This builder for chaining. + */ + public Builder setRpcs(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureRpcsIsMutable(); + rpcs_.set(index, value); + onChanged(); + return this; + } + + /** + * repeated string rpcs = 2; + * + * @param value The rpcs to add. + * @return This builder for chaining. + */ + public Builder addRpcs(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureRpcsIsMutable(); + rpcs_.add(value); + onChanged(); + return this; + } + + /** + * repeated string rpcs = 2; + * + * @param values The rpcs to add. + * @return This builder for chaining. + */ + public Builder addAllRpcs(java.lang.Iterable values) { + ensureRpcsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, rpcs_); + onChanged(); + return this; + } + + /** + * repeated string rpcs = 2; + * + * @return This builder for chaining. + */ + public Builder clearRpcs() { + rpcs_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * repeated string rpcs = 2; + * + * @param value The bytes of the rpcs to add. + * @return This builder for chaining. + */ + public Builder addRpcsBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureRpcsIsMutable(); + rpcs_.add(value); + onChanged(); + return this; + } + + private java.util.List requests_ = + java.util.Collections.emptyList(); + + private void ensureRequestsIsMutable() { + if (!((bitField0_ & 0x00000002) != 0)) { + requests_ = new java.util.ArrayList(requests_); + bitField0_ |= 0x00000002; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.showcase.v1beta1.RepeatRequest, + com.google.showcase.v1beta1.RepeatRequest.Builder, + com.google.showcase.v1beta1.RepeatRequestOrBuilder> + requestsBuilder_; + + /** repeated .google.showcase.v1beta1.RepeatRequest requests = 3; */ + public java.util.List getRequestsList() { + if (requestsBuilder_ == null) { + return java.util.Collections.unmodifiableList(requests_); + } else { + return requestsBuilder_.getMessageList(); + } + } + + /** repeated .google.showcase.v1beta1.RepeatRequest requests = 3; */ + public int getRequestsCount() { + if (requestsBuilder_ == null) { + return requests_.size(); + } else { + return requestsBuilder_.getCount(); + } + } + + /** repeated .google.showcase.v1beta1.RepeatRequest requests = 3; */ + public com.google.showcase.v1beta1.RepeatRequest getRequests(int index) { + if (requestsBuilder_ == null) { + return requests_.get(index); + } else { + return requestsBuilder_.getMessage(index); + } + } + + /** repeated .google.showcase.v1beta1.RepeatRequest requests = 3; */ + public Builder setRequests(int index, com.google.showcase.v1beta1.RepeatRequest value) { + if (requestsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureRequestsIsMutable(); + requests_.set(index, value); + onChanged(); + } else { + requestsBuilder_.setMessage(index, value); + } + return this; + } + + /** repeated .google.showcase.v1beta1.RepeatRequest requests = 3; */ + public Builder setRequests( + int index, com.google.showcase.v1beta1.RepeatRequest.Builder builderForValue) { + if (requestsBuilder_ == null) { + ensureRequestsIsMutable(); + requests_.set(index, builderForValue.build()); + onChanged(); + } else { + requestsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + + /** repeated .google.showcase.v1beta1.RepeatRequest requests = 3; */ + public Builder addRequests(com.google.showcase.v1beta1.RepeatRequest value) { + if (requestsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureRequestsIsMutable(); + requests_.add(value); + onChanged(); + } else { + requestsBuilder_.addMessage(value); + } + return this; + } + + /** repeated .google.showcase.v1beta1.RepeatRequest requests = 3; */ + public Builder addRequests(int index, com.google.showcase.v1beta1.RepeatRequest value) { + if (requestsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureRequestsIsMutable(); + requests_.add(index, value); + onChanged(); + } else { + requestsBuilder_.addMessage(index, value); + } + return this; + } + + /** repeated .google.showcase.v1beta1.RepeatRequest requests = 3; */ + public Builder addRequests(com.google.showcase.v1beta1.RepeatRequest.Builder builderForValue) { + if (requestsBuilder_ == null) { + ensureRequestsIsMutable(); + requests_.add(builderForValue.build()); + onChanged(); + } else { + requestsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + + /** repeated .google.showcase.v1beta1.RepeatRequest requests = 3; */ + public Builder addRequests( + int index, com.google.showcase.v1beta1.RepeatRequest.Builder builderForValue) { + if (requestsBuilder_ == null) { + ensureRequestsIsMutable(); + requests_.add(index, builderForValue.build()); + onChanged(); + } else { + requestsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + + /** repeated .google.showcase.v1beta1.RepeatRequest requests = 3; */ + public Builder addAllRequests( + java.lang.Iterable values) { + if (requestsBuilder_ == null) { + ensureRequestsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, requests_); + onChanged(); + } else { + requestsBuilder_.addAllMessages(values); + } + return this; + } + + /** repeated .google.showcase.v1beta1.RepeatRequest requests = 3; */ + public Builder clearRequests() { + if (requestsBuilder_ == null) { + requests_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + } else { + requestsBuilder_.clear(); + } + return this; + } + + /** repeated .google.showcase.v1beta1.RepeatRequest requests = 3; */ + public Builder removeRequests(int index) { + if (requestsBuilder_ == null) { + ensureRequestsIsMutable(); + requests_.remove(index); + onChanged(); + } else { + requestsBuilder_.remove(index); + } + return this; + } + + /** repeated .google.showcase.v1beta1.RepeatRequest requests = 3; */ + public com.google.showcase.v1beta1.RepeatRequest.Builder getRequestsBuilder(int index) { + return getRequestsFieldBuilder().getBuilder(index); + } + + /** repeated .google.showcase.v1beta1.RepeatRequest requests = 3; */ + public com.google.showcase.v1beta1.RepeatRequestOrBuilder getRequestsOrBuilder(int index) { + if (requestsBuilder_ == null) { + return requests_.get(index); + } else { + return requestsBuilder_.getMessageOrBuilder(index); + } + } + + /** repeated .google.showcase.v1beta1.RepeatRequest requests = 3; */ + public java.util.List + getRequestsOrBuilderList() { + if (requestsBuilder_ != null) { + return requestsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(requests_); + } + } + + /** repeated .google.showcase.v1beta1.RepeatRequest requests = 3; */ + public com.google.showcase.v1beta1.RepeatRequest.Builder addRequestsBuilder() { + return getRequestsFieldBuilder() + .addBuilder(com.google.showcase.v1beta1.RepeatRequest.getDefaultInstance()); + } + + /** repeated .google.showcase.v1beta1.RepeatRequest requests = 3; */ + public com.google.showcase.v1beta1.RepeatRequest.Builder addRequestsBuilder(int index) { + return getRequestsFieldBuilder() + .addBuilder(index, com.google.showcase.v1beta1.RepeatRequest.getDefaultInstance()); + } + + /** repeated .google.showcase.v1beta1.RepeatRequest requests = 3; */ + public java.util.List + getRequestsBuilderList() { + return getRequestsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.showcase.v1beta1.RepeatRequest, + com.google.showcase.v1beta1.RepeatRequest.Builder, + com.google.showcase.v1beta1.RepeatRequestOrBuilder> + getRequestsFieldBuilder() { + if (requestsBuilder_ == null) { + requestsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.showcase.v1beta1.RepeatRequest, + com.google.showcase.v1beta1.RepeatRequest.Builder, + com.google.showcase.v1beta1.RepeatRequestOrBuilder>( + requests_, ((bitField0_ & 0x00000002) != 0), getParentForChildren(), isClean()); + requests_ = null; + } + return requestsBuilder_; + } + + @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.showcase.v1beta1.ComplianceGroup) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.ComplianceGroup) + private static final com.google.showcase.v1beta1.ComplianceGroup DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.ComplianceGroup(); + } + + public static com.google.showcase.v1beta1.ComplianceGroup getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ComplianceGroup parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ComplianceGroup(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.showcase.v1beta1.ComplianceGroup getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ComplianceGroupOrBuilder.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ComplianceGroupOrBuilder.java new file mode 100644 index 0000000000..0053920088 --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ComplianceGroupOrBuilder.java @@ -0,0 +1,85 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/compliance.proto + +package com.google.showcase.v1beta1; + +public interface ComplianceGroupOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.ComplianceGroup) + com.google.protobuf.MessageOrBuilder { + + /** + * string name = 1; + * + * @return The name. + */ + java.lang.String getName(); + + /** + * string name = 1; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * repeated string rpcs = 2; + * + * @return A list containing the rpcs. + */ + java.util.List getRpcsList(); + + /** + * repeated string rpcs = 2; + * + * @return The count of rpcs. + */ + int getRpcsCount(); + + /** + * repeated string rpcs = 2; + * + * @param index The index of the element to return. + * @return The rpcs at the given index. + */ + java.lang.String getRpcs(int index); + + /** + * repeated string rpcs = 2; + * + * @param index The index of the value to return. + * @return The bytes of the rpcs at the given index. + */ + com.google.protobuf.ByteString getRpcsBytes(int index); + + /** repeated .google.showcase.v1beta1.RepeatRequest requests = 3; */ + java.util.List getRequestsList(); + + /** repeated .google.showcase.v1beta1.RepeatRequest requests = 3; */ + com.google.showcase.v1beta1.RepeatRequest getRequests(int index); + + /** repeated .google.showcase.v1beta1.RepeatRequest requests = 3; */ + int getRequestsCount(); + + /** repeated .google.showcase.v1beta1.RepeatRequest requests = 3; */ + java.util.List + getRequestsOrBuilderList(); + + /** repeated .google.showcase.v1beta1.RepeatRequest requests = 3; */ + com.google.showcase.v1beta1.RepeatRequestOrBuilder getRequestsOrBuilder(int index); +} diff --git a/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ComplianceOuterClass.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ComplianceOuterClass.java new file mode 100644 index 0000000000..2dd24e23f7 --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ComplianceOuterClass.java @@ -0,0 +1,370 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/compliance.proto + +package com.google.showcase.v1beta1; + +public final class ComplianceOuterClass { + private ComplianceOuterClass() {} + + 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_showcase_v1beta1_RepeatRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_showcase_v1beta1_RepeatRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_showcase_v1beta1_RepeatResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_showcase_v1beta1_RepeatResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_showcase_v1beta1_ComplianceSuite_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_showcase_v1beta1_ComplianceSuite_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_showcase_v1beta1_ComplianceGroup_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_showcase_v1beta1_ComplianceGroup_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_showcase_v1beta1_ComplianceData_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_showcase_v1beta1_ComplianceData_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_showcase_v1beta1_ComplianceDataChild_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_showcase_v1beta1_ComplianceDataChild_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_showcase_v1beta1_ComplianceDataGrandchild_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_showcase_v1beta1_ComplianceDataGrandchild_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_showcase_v1beta1_EnumRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_showcase_v1beta1_EnumRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_showcase_v1beta1_EnumResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_showcase_v1beta1_EnumResponse_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" + + "/schema/google/showcase/v1beta1/complia" + + "nce.proto\022\027google.showcase.v1beta1\032\034goog" + + "le/api/annotations.proto\032\027google/api/client.proto\"\303\002\n\r" + + "RepeatRequest\022\014\n" + + "\004name\030\001 \001(\t\0225\n" + + "\004info\030\002 \001(\0132\'.google.showcase.v1beta1.ComplianceData\022\025\n\r" + + "server_verify\030\003 \001(\010\022!\n" + + "\024intended_binding_uri\030\n" + + " \001(\tH\000\210\001\001\022\017\n" + + "\007f_int32\030\004 \001(\005\022\017\n" + + "\007f_int64\030\005 \001(\003\022\020\n" + + "\010f_double\030\006 \001(\001\022\024\n" + + "\007p_int32\030\007 \001(\005H\001\210\001\001\022\024\n" + + "\007p_int64\030\010 \001(\003H\002\210\001\001\022\025\n" + + "\010p_double\030\t \001(\001H\003\210\001\001B\027\n" + + "\025_intended_binding_uriB\n\n" + + "\010_p_int32B\n\n" + + "\010_p_int64B\013\n" + + "\t_p_double\"^\n" + + "\016RepeatResponse\0227\n" + + "\007request\030\001 \001(\0132&.google.showcase.v1beta1.RepeatRequest\022\023\n" + + "\013binding_uri\030\002 \001(\t\"J\n" + + "\017ComplianceSuite\0227\n" + + "\005group\030\001 \003(\0132(.google.showcase.v1beta1.ComplianceGroup\"g\n" + + "\017ComplianceGroup\022\014\n" + + "\004name\030\001 \001(\t\022\014\n" + + "\004rpcs\030\002 \003(\t\0228\n" + + "\010requests\030\003 \003(\0132&.google.showcase.v1beta1.RepeatRequest\"\340\006\n" + + "\016ComplianceData\022\020\n" + + "\010f_string\030\001 \001(\t\022\017\n" + + "\007f_int32\030\002 \001(\005\022\020\n" + + "\010f_sint32\030\003 \001(\021\022\022\n\n" + + "f_sfixed32\030\004 \001(\017\022\020\n" + + "\010f_uint32\030\005 \001(\r" + + "\022\021\n" + + "\tf_fixed32\030\006 \001(\007\022\017\n" + + "\007f_int64\030\007 \001(\003\022\020\n" + + "\010f_sint64\030\010 \001(\022\022\022\n\n" + + "f_sfixed64\030\t \001(\020\022\020\n" + + "\010f_uint64\030\n" + + " \001(\004\022\021\n" + + "\tf_fixed64\030\013 \001(\006\022\020\n" + + "\010f_double\030\014 \001(\001\022\017\n" + + "\007f_float\030\r" + + " \001(\002\022\016\n" + + "\006f_bool\030\016 \001(\010\022\017\n" + + "\007f_bytes\030\017 \001(\014\022F\n" + + "\tf_kingdom\030\026 \001(\016" + + "23.google.showcase.v1beta1.ComplianceData.LifeKingdom\022=\n" + + "\007f_child\030\020 \001(\0132,.google.showcase.v1beta1.ComplianceDataChild\022\025\n" + + "\010p_string\030\021 \001(\tH\000\210\001\001\022\024\n" + + "\007p_int32\030\022 \001(\005H\001\210\001\001\022\025\n" + + "\010p_double\030\023 \001(\001H\002\210\001\001\022\023\n" + + "\006p_bool\030\024 \001(\010H\003\210\001\001\022K\n" + + "\tp_kingdom\030\027 \001(\01623.google.showca" + + "se.v1beta1.ComplianceData.LifeKingdomH\004\210\001\001\022B\n" + + "\007p_child\030\025" + + " \001(\0132,.google.showcase.v1beta1.ComplianceDataChildH\005\210\001\001\"\203\001\n" + + "\013LifeKingdom\022\034\n" + + "\030LIFE_KINGDOM_UNSPECIFIED\020\000\022\022\n" + + "\016ARCHAEBACTERIA\020\001\022\016\n\n" + + "EUBACTERIA\020\002\022\014\n" + + "\010PROTISTA\020\003\022\t\n" + + "\005FUNGI\020\004\022\013\n" + + "\007PLANTAE\020\005\022\014\n" + + "\010ANIMALIA\020\006B\013\n" + + "\t_p_stringB\n\n" + + "\010_p_int32B\013\n" + + "\t_p_doubleB\t\n" + + "\007_p_boolB\014\n\n" + + "_p_kingdomB\n\n" + + "\010_p_child\"\357\003\n" + + "\023ComplianceDataChild\022\020\n" + + "\010f_string\030\001 \001(\t\022\017\n" + + "\007f_float\030\002 \001(\002\022\020\n" + + "\010f_double\030\003 \001(\001\022\016\n" + + "\006f_bool\030\004 \001(\010\0227\n" + + "\013f_continent\030\013 \001(\0162\".google.showcase.v1beta1.Continent\022B\n" + + "\007f_child\030\005" + + " \001(\01321.google.showcase.v1beta1.ComplianceDataGrandchild\022\025\n" + + "\010p_string\030\006 \001(\tH\000\210\001\001\022\024\n" + + "\007p_float\030\007 \001(\002H\001\210\001\001\022\025\n" + + "\010p_double\030\010 \001(\001H\002\210\001\001\022\023\n" + + "\006p_bool\030\t \001(\010H\003\210\001\001\0227\n" + + "\013p_continent\030\014 \001(\0162\".google.showcase.v1beta1.Continent\022G\n" + + "\007p_child\030\n" + + " \001(\01321.google.showcase.v1beta1.ComplianceDataGrandchildH\004\210\001\001B\013\n" + + "\t_p_stringB\n\n" + + "\010_p_floatB\013\n" + + "\t_p_doubleB\t\n" + + "\007_p_boolB\n\n" + + "\010_p_child\"N\n" + + "\030ComplianceDataGrandchild\022\020\n" + + "\010f_string\030\001 \001(\t\022\020\n" + + "\010f_double\030\002 \001(\001\022\016\n" + + "\006f_bool\030\003 \001(\010\"#\n" + + "\013EnumRequest\022\024\n" + + "\014unknown_enum\030\001 \001(\010\"|\n" + + "\014EnumResponse\0225\n" + + "\007request\030\001 \001(\0132$.google.showcase.v1beta1.EnumRequest\0225\n" + + "\tcontinent\030\002 \001(\0162\".google.showcase.v1beta1.Continent*i\n" + + "\tContinent\022\031\n" + + "\025CONTINENT_UNSPECIFIED\020\000\022\n\n" + + "\006AFRICA\020\001\022\013\n" + + "\007AMERICA\020\002\022\r\n" + + "\tANTARTICA\020\003\022\r\n" + + "\tAUSTRALIA\020\004\022\n\n" + + "\006EUROPE\020\0052\330\r\n\n" + + "Compliance\022\202\001\n" + + "\016RepeatDataBody\022&.google.showcase.v1beta1.RepeatReques" + + "t\032\'.google.showcase.v1beta1.RepeatResponse\"\037\202\323\344\223\002\031\"\024/v1beta1/repeat:body:\001*\022\215\001\n" + + "\022RepeatDataBodyInfo\022&.google.showcase.v1b" + + "eta1.RepeatRequest\032\'.google.showcase.v1beta1.RepeatResponse\"&\202\323\344\223\002" + + " \"\030/v1beta1/repeat:bodyinfo:\004info\022\201\001\n" + + "\017RepeatDataQuery\022&.google.showcase.v1beta1.RepeatRequest\032" + + "\'.google.showcase.v1beta1.RepeatResponse\"\035\202\323\344\223\002\027\022\025/v1beta1/repeat:query\022\331\001\n" + + "\024RepeatDataSimplePath\022&.google.showcase.v1bet" + + "a1.RepeatRequest\032\'.google.showcase.v1bet" + + "a1.RepeatResponse\"p\202\323\344\223\002j\022h/v1beta1/repe" + + "at/{info.f_string}/{info.f_int32}/{info." + + "f_double}/{info.f_bool}/{info.f_kingdom}:simplepath\022\323\002\n" + + "\026RepeatDataPathResource\022&.google.showcase.v1beta1.RepeatRequest\032\'" + + ".google.showcase.v1beta1.RepeatResponse\"" + + "\347\001\202\323\344\223\002\340\001\022h/v1beta1/repeat/{info.f_strin" + + "g=first/*}/{info.f_child.f_string=second/*}/bool/{info.f_bool}:pathresourceZt\022r/" + + "v1beta1/repeat/{info.f_child.f_string=fi" + + "rst/*}/{info.f_string=second/*}/bool/{info.f_bool}:childfirstpathresource\022\331\001\n" + + "\036RepeatDataPathTrailingResource\022&.google.sh" + + "owcase.v1beta1.RepeatRequest\032\'.google.sh" + + "owcase.v1beta1.RepeatResponse\"f\202\323\344\223\002`\022^/" + + "v1beta1/repeat/{info.f_string=first/*}/{" + + "info.f_child.f_string=second/**}:pathtrailingresource\022\210\001\n" + + "\021RepeatDataBodyPut\022&.google.showcase.v1beta1.RepeatRequest\032\'.go" + + "ogle.showcase.v1beta1.RepeatResponse\"\"\202\323\344\223\002\034\032\027/v1beta1/repeat:bodyput:\001*\022\214\001\n" + + "\023RepeatDataBodyPatch\022&.google.showcase.v1bet" + + "a1.RepeatRequest\032\'.google.showcase.v1bet" + + "a1.RepeatResponse\"$\202\323\344\223\002\0362\031/v1beta1/repeat:bodypatch:\001*\022x\n" + + "\007GetEnum\022$.google.show" + + "case.v1beta1.EnumRequest\032%.google.showcase.v1beta1.EnumResponse\"" + + " \202\323\344\223\002\032\022\030/v1beta1/compliance/enum\022|\n\n" + + "VerifyEnum\022%.google" + + ".showcase.v1beta1.EnumResponse\032%.google.showcase.v1beta1.EnumResponse\"" + + " \202\323\344\223\002\032\"\030/" + + "v1beta1/compliance/enum\032\021\312A\016localhost:7469Bq\n" + + "\033com.google.showcase.v1beta1P\001Z4github.com/googleapis/gapic-showcase/server" + + "/genproto\352\002\031Google::Showcase::V1beta1b\006proto3" + }; + descriptor = + com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( + descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + com.google.api.AnnotationsProto.getDescriptor(), + com.google.api.ClientProto.getDescriptor(), + }); + internal_static_google_showcase_v1beta1_RepeatRequest_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_showcase_v1beta1_RepeatRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_showcase_v1beta1_RepeatRequest_descriptor, + new java.lang.String[] { + "Name", + "Info", + "ServerVerify", + "IntendedBindingUri", + "FInt32", + "FInt64", + "FDouble", + "PInt32", + "PInt64", + "PDouble", + "IntendedBindingUri", + "PInt32", + "PInt64", + "PDouble", + }); + internal_static_google_showcase_v1beta1_RepeatResponse_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_google_showcase_v1beta1_RepeatResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_showcase_v1beta1_RepeatResponse_descriptor, + new java.lang.String[] { + "Request", "BindingUri", + }); + internal_static_google_showcase_v1beta1_ComplianceSuite_descriptor = + getDescriptor().getMessageTypes().get(2); + internal_static_google_showcase_v1beta1_ComplianceSuite_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_showcase_v1beta1_ComplianceSuite_descriptor, + new java.lang.String[] { + "Group", + }); + internal_static_google_showcase_v1beta1_ComplianceGroup_descriptor = + getDescriptor().getMessageTypes().get(3); + internal_static_google_showcase_v1beta1_ComplianceGroup_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_showcase_v1beta1_ComplianceGroup_descriptor, + new java.lang.String[] { + "Name", "Rpcs", "Requests", + }); + internal_static_google_showcase_v1beta1_ComplianceData_descriptor = + getDescriptor().getMessageTypes().get(4); + internal_static_google_showcase_v1beta1_ComplianceData_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_showcase_v1beta1_ComplianceData_descriptor, + new java.lang.String[] { + "FString", + "FInt32", + "FSint32", + "FSfixed32", + "FUint32", + "FFixed32", + "FInt64", + "FSint64", + "FSfixed64", + "FUint64", + "FFixed64", + "FDouble", + "FFloat", + "FBool", + "FBytes", + "FKingdom", + "FChild", + "PString", + "PInt32", + "PDouble", + "PBool", + "PKingdom", + "PChild", + "PString", + "PInt32", + "PDouble", + "PBool", + "PKingdom", + "PChild", + }); + internal_static_google_showcase_v1beta1_ComplianceDataChild_descriptor = + getDescriptor().getMessageTypes().get(5); + internal_static_google_showcase_v1beta1_ComplianceDataChild_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_showcase_v1beta1_ComplianceDataChild_descriptor, + new java.lang.String[] { + "FString", + "FFloat", + "FDouble", + "FBool", + "FContinent", + "FChild", + "PString", + "PFloat", + "PDouble", + "PBool", + "PContinent", + "PChild", + "PString", + "PFloat", + "PDouble", + "PBool", + "PChild", + }); + internal_static_google_showcase_v1beta1_ComplianceDataGrandchild_descriptor = + getDescriptor().getMessageTypes().get(6); + internal_static_google_showcase_v1beta1_ComplianceDataGrandchild_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_showcase_v1beta1_ComplianceDataGrandchild_descriptor, + new java.lang.String[] { + "FString", "FDouble", "FBool", + }); + internal_static_google_showcase_v1beta1_EnumRequest_descriptor = + getDescriptor().getMessageTypes().get(7); + internal_static_google_showcase_v1beta1_EnumRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_showcase_v1beta1_EnumRequest_descriptor, + new java.lang.String[] { + "UnknownEnum", + }); + internal_static_google_showcase_v1beta1_EnumResponse_descriptor = + getDescriptor().getMessageTypes().get(8); + internal_static_google_showcase_v1beta1_EnumResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_showcase_v1beta1_EnumResponse_descriptor, + new java.lang.String[] { + "Request", "Continent", + }); + com.google.protobuf.ExtensionRegistry registry = + com.google.protobuf.ExtensionRegistry.newInstance(); + registry.add(com.google.api.ClientProto.defaultHost); + registry.add(com.google.api.AnnotationsProto.http); + com.google.protobuf.Descriptors.FileDescriptor.internalUpdateFileDescriptor( + descriptor, registry); + com.google.api.AnnotationsProto.getDescriptor(); + com.google.api.ClientProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ComplianceSuite.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ComplianceSuite.java new file mode 100644 index 0000000000..e812510224 --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ComplianceSuite.java @@ -0,0 +1,793 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/compliance.proto + +package com.google.showcase.v1beta1; + +/** + * + * + *
        + * ComplianceSuite contains a set of requests that microgenerators should issue
        + * over REST to the Compliance service to test their gRPC-to-REST transcoding
        + * implementation.
        + * 
        + * + * Protobuf type {@code google.showcase.v1beta1.ComplianceSuite} + */ +public final class ComplianceSuite extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.ComplianceSuite) + ComplianceSuiteOrBuilder { + private static final long serialVersionUID = 0L; + + // Use ComplianceSuite.newBuilder() to construct. + private ComplianceSuite(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ComplianceSuite() { + group_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ComplianceSuite(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ComplianceSuite( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + group_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + group_.add( + input.readMessage( + com.google.showcase.v1beta1.ComplianceGroup.parser(), extensionRegistry)); + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + group_ = java.util.Collections.unmodifiableList(group_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.ComplianceOuterClass + .internal_static_google_showcase_v1beta1_ComplianceSuite_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.ComplianceOuterClass + .internal_static_google_showcase_v1beta1_ComplianceSuite_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.ComplianceSuite.class, + com.google.showcase.v1beta1.ComplianceSuite.Builder.class); + } + + public static final int GROUP_FIELD_NUMBER = 1; + private java.util.List group_; + + /** repeated .google.showcase.v1beta1.ComplianceGroup group = 1; */ + @java.lang.Override + public java.util.List getGroupList() { + return group_; + } + + /** repeated .google.showcase.v1beta1.ComplianceGroup group = 1; */ + @java.lang.Override + public java.util.List + getGroupOrBuilderList() { + return group_; + } + + /** repeated .google.showcase.v1beta1.ComplianceGroup group = 1; */ + @java.lang.Override + public int getGroupCount() { + return group_.size(); + } + + /** repeated .google.showcase.v1beta1.ComplianceGroup group = 1; */ + @java.lang.Override + public com.google.showcase.v1beta1.ComplianceGroup getGroup(int index) { + return group_.get(index); + } + + /** repeated .google.showcase.v1beta1.ComplianceGroup group = 1; */ + @java.lang.Override + public com.google.showcase.v1beta1.ComplianceGroupOrBuilder getGroupOrBuilder(int index) { + return group_.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 < group_.size(); i++) { + output.writeMessage(1, group_.get(i)); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < group_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, group_.get(i)); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.showcase.v1beta1.ComplianceSuite)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.ComplianceSuite other = + (com.google.showcase.v1beta1.ComplianceSuite) obj; + + if (!getGroupList().equals(other.getGroupList())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getGroupCount() > 0) { + hash = (37 * hash) + GROUP_FIELD_NUMBER; + hash = (53 * hash) + getGroupList().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.showcase.v1beta1.ComplianceSuite parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.ComplianceSuite parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.ComplianceSuite parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.ComplianceSuite 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.showcase.v1beta1.ComplianceSuite parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.ComplianceSuite parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.ComplianceSuite parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.ComplianceSuite 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.showcase.v1beta1.ComplianceSuite parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.ComplianceSuite 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.showcase.v1beta1.ComplianceSuite parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.ComplianceSuite 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.showcase.v1beta1.ComplianceSuite 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; + } + + /** + * + * + *
        +   * ComplianceSuite contains a set of requests that microgenerators should issue
        +   * over REST to the Compliance service to test their gRPC-to-REST transcoding
        +   * implementation.
        +   * 
        + * + * Protobuf type {@code google.showcase.v1beta1.ComplianceSuite} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.ComplianceSuite) + com.google.showcase.v1beta1.ComplianceSuiteOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.ComplianceOuterClass + .internal_static_google_showcase_v1beta1_ComplianceSuite_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.ComplianceOuterClass + .internal_static_google_showcase_v1beta1_ComplianceSuite_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.ComplianceSuite.class, + com.google.showcase.v1beta1.ComplianceSuite.Builder.class); + } + + // Construct using com.google.showcase.v1beta1.ComplianceSuite.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getGroupFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (groupBuilder_ == null) { + group_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + groupBuilder_.clear(); + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.showcase.v1beta1.ComplianceOuterClass + .internal_static_google_showcase_v1beta1_ComplianceSuite_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.ComplianceSuite getDefaultInstanceForType() { + return com.google.showcase.v1beta1.ComplianceSuite.getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.ComplianceSuite build() { + com.google.showcase.v1beta1.ComplianceSuite result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.ComplianceSuite buildPartial() { + com.google.showcase.v1beta1.ComplianceSuite result = + new com.google.showcase.v1beta1.ComplianceSuite(this); + int from_bitField0_ = bitField0_; + if (groupBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + group_ = java.util.Collections.unmodifiableList(group_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.group_ = group_; + } else { + result.group_ = groupBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.showcase.v1beta1.ComplianceSuite) { + return mergeFrom((com.google.showcase.v1beta1.ComplianceSuite) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.showcase.v1beta1.ComplianceSuite other) { + if (other == com.google.showcase.v1beta1.ComplianceSuite.getDefaultInstance()) return this; + if (groupBuilder_ == null) { + if (!other.group_.isEmpty()) { + if (group_.isEmpty()) { + group_ = other.group_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureGroupIsMutable(); + group_.addAll(other.group_); + } + onChanged(); + } + } else { + if (!other.group_.isEmpty()) { + if (groupBuilder_.isEmpty()) { + groupBuilder_.dispose(); + groupBuilder_ = null; + group_ = other.group_; + bitField0_ = (bitField0_ & ~0x00000001); + groupBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getGroupFieldBuilder() + : null; + } else { + groupBuilder_.addAllMessages(other.group_); + } + } + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.showcase.v1beta1.ComplianceSuite parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.showcase.v1beta1.ComplianceSuite) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.util.List group_ = + java.util.Collections.emptyList(); + + private void ensureGroupIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + group_ = new java.util.ArrayList(group_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.showcase.v1beta1.ComplianceGroup, + com.google.showcase.v1beta1.ComplianceGroup.Builder, + com.google.showcase.v1beta1.ComplianceGroupOrBuilder> + groupBuilder_; + + /** repeated .google.showcase.v1beta1.ComplianceGroup group = 1; */ + public java.util.List getGroupList() { + if (groupBuilder_ == null) { + return java.util.Collections.unmodifiableList(group_); + } else { + return groupBuilder_.getMessageList(); + } + } + + /** repeated .google.showcase.v1beta1.ComplianceGroup group = 1; */ + public int getGroupCount() { + if (groupBuilder_ == null) { + return group_.size(); + } else { + return groupBuilder_.getCount(); + } + } + + /** repeated .google.showcase.v1beta1.ComplianceGroup group = 1; */ + public com.google.showcase.v1beta1.ComplianceGroup getGroup(int index) { + if (groupBuilder_ == null) { + return group_.get(index); + } else { + return groupBuilder_.getMessage(index); + } + } + + /** repeated .google.showcase.v1beta1.ComplianceGroup group = 1; */ + public Builder setGroup(int index, com.google.showcase.v1beta1.ComplianceGroup value) { + if (groupBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureGroupIsMutable(); + group_.set(index, value); + onChanged(); + } else { + groupBuilder_.setMessage(index, value); + } + return this; + } + + /** repeated .google.showcase.v1beta1.ComplianceGroup group = 1; */ + public Builder setGroup( + int index, com.google.showcase.v1beta1.ComplianceGroup.Builder builderForValue) { + if (groupBuilder_ == null) { + ensureGroupIsMutable(); + group_.set(index, builderForValue.build()); + onChanged(); + } else { + groupBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + + /** repeated .google.showcase.v1beta1.ComplianceGroup group = 1; */ + public Builder addGroup(com.google.showcase.v1beta1.ComplianceGroup value) { + if (groupBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureGroupIsMutable(); + group_.add(value); + onChanged(); + } else { + groupBuilder_.addMessage(value); + } + return this; + } + + /** repeated .google.showcase.v1beta1.ComplianceGroup group = 1; */ + public Builder addGroup(int index, com.google.showcase.v1beta1.ComplianceGroup value) { + if (groupBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureGroupIsMutable(); + group_.add(index, value); + onChanged(); + } else { + groupBuilder_.addMessage(index, value); + } + return this; + } + + /** repeated .google.showcase.v1beta1.ComplianceGroup group = 1; */ + public Builder addGroup(com.google.showcase.v1beta1.ComplianceGroup.Builder builderForValue) { + if (groupBuilder_ == null) { + ensureGroupIsMutable(); + group_.add(builderForValue.build()); + onChanged(); + } else { + groupBuilder_.addMessage(builderForValue.build()); + } + return this; + } + + /** repeated .google.showcase.v1beta1.ComplianceGroup group = 1; */ + public Builder addGroup( + int index, com.google.showcase.v1beta1.ComplianceGroup.Builder builderForValue) { + if (groupBuilder_ == null) { + ensureGroupIsMutable(); + group_.add(index, builderForValue.build()); + onChanged(); + } else { + groupBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + + /** repeated .google.showcase.v1beta1.ComplianceGroup group = 1; */ + public Builder addAllGroup( + java.lang.Iterable values) { + if (groupBuilder_ == null) { + ensureGroupIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, group_); + onChanged(); + } else { + groupBuilder_.addAllMessages(values); + } + return this; + } + + /** repeated .google.showcase.v1beta1.ComplianceGroup group = 1; */ + public Builder clearGroup() { + if (groupBuilder_ == null) { + group_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + groupBuilder_.clear(); + } + return this; + } + + /** repeated .google.showcase.v1beta1.ComplianceGroup group = 1; */ + public Builder removeGroup(int index) { + if (groupBuilder_ == null) { + ensureGroupIsMutable(); + group_.remove(index); + onChanged(); + } else { + groupBuilder_.remove(index); + } + return this; + } + + /** repeated .google.showcase.v1beta1.ComplianceGroup group = 1; */ + public com.google.showcase.v1beta1.ComplianceGroup.Builder getGroupBuilder(int index) { + return getGroupFieldBuilder().getBuilder(index); + } + + /** repeated .google.showcase.v1beta1.ComplianceGroup group = 1; */ + public com.google.showcase.v1beta1.ComplianceGroupOrBuilder getGroupOrBuilder(int index) { + if (groupBuilder_ == null) { + return group_.get(index); + } else { + return groupBuilder_.getMessageOrBuilder(index); + } + } + + /** repeated .google.showcase.v1beta1.ComplianceGroup group = 1; */ + public java.util.List + getGroupOrBuilderList() { + if (groupBuilder_ != null) { + return groupBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(group_); + } + } + + /** repeated .google.showcase.v1beta1.ComplianceGroup group = 1; */ + public com.google.showcase.v1beta1.ComplianceGroup.Builder addGroupBuilder() { + return getGroupFieldBuilder() + .addBuilder(com.google.showcase.v1beta1.ComplianceGroup.getDefaultInstance()); + } + + /** repeated .google.showcase.v1beta1.ComplianceGroup group = 1; */ + public com.google.showcase.v1beta1.ComplianceGroup.Builder addGroupBuilder(int index) { + return getGroupFieldBuilder() + .addBuilder(index, com.google.showcase.v1beta1.ComplianceGroup.getDefaultInstance()); + } + + /** repeated .google.showcase.v1beta1.ComplianceGroup group = 1; */ + public java.util.List + getGroupBuilderList() { + return getGroupFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.showcase.v1beta1.ComplianceGroup, + com.google.showcase.v1beta1.ComplianceGroup.Builder, + com.google.showcase.v1beta1.ComplianceGroupOrBuilder> + getGroupFieldBuilder() { + if (groupBuilder_ == null) { + groupBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.showcase.v1beta1.ComplianceGroup, + com.google.showcase.v1beta1.ComplianceGroup.Builder, + com.google.showcase.v1beta1.ComplianceGroupOrBuilder>( + group_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + group_ = null; + } + return groupBuilder_; + } + + @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.showcase.v1beta1.ComplianceSuite) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.ComplianceSuite) + private static final com.google.showcase.v1beta1.ComplianceSuite DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.ComplianceSuite(); + } + + public static com.google.showcase.v1beta1.ComplianceSuite getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ComplianceSuite parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ComplianceSuite(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.showcase.v1beta1.ComplianceSuite getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ComplianceSuiteOrBuilder.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ComplianceSuiteOrBuilder.java new file mode 100644 index 0000000000..0d0ead0677 --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ComplianceSuiteOrBuilder.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 + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/compliance.proto + +package com.google.showcase.v1beta1; + +public interface ComplianceSuiteOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.ComplianceSuite) + com.google.protobuf.MessageOrBuilder { + + /** repeated .google.showcase.v1beta1.ComplianceGroup group = 1; */ + java.util.List getGroupList(); + + /** repeated .google.showcase.v1beta1.ComplianceGroup group = 1; */ + com.google.showcase.v1beta1.ComplianceGroup getGroup(int index); + + /** repeated .google.showcase.v1beta1.ComplianceGroup group = 1; */ + int getGroupCount(); + + /** repeated .google.showcase.v1beta1.ComplianceGroup group = 1; */ + java.util.List + getGroupOrBuilderList(); + + /** repeated .google.showcase.v1beta1.ComplianceGroup group = 1; */ + com.google.showcase.v1beta1.ComplianceGroupOrBuilder getGroupOrBuilder(int index); +} diff --git a/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ConnectRequest.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ConnectRequest.java new file mode 100644 index 0000000000..8f00f61855 --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ConnectRequest.java @@ -0,0 +1,1835 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/messaging.proto + +package com.google.showcase.v1beta1; + +/** + * + * + *
        + * The request message for the google.showcase.v1beta1.Messaging\Connect
        + * method.
        + * 
        + * + * Protobuf type {@code google.showcase.v1beta1.ConnectRequest} + */ +public final class ConnectRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.ConnectRequest) + ConnectRequestOrBuilder { + private static final long serialVersionUID = 0L; + + // Use ConnectRequest.newBuilder() to construct. + private ConnectRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ConnectRequest() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ConnectRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ConnectRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + com.google.showcase.v1beta1.ConnectRequest.ConnectConfig.Builder subBuilder = null; + if (requestCase_ == 1) { + subBuilder = + ((com.google.showcase.v1beta1.ConnectRequest.ConnectConfig) request_) + .toBuilder(); + } + request_ = + input.readMessage( + com.google.showcase.v1beta1.ConnectRequest.ConnectConfig.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom( + (com.google.showcase.v1beta1.ConnectRequest.ConnectConfig) request_); + request_ = subBuilder.buildPartial(); + } + requestCase_ = 1; + break; + } + case 18: + { + com.google.showcase.v1beta1.Blurb.Builder subBuilder = null; + if (requestCase_ == 2) { + subBuilder = ((com.google.showcase.v1beta1.Blurb) request_).toBuilder(); + } + request_ = + input.readMessage(com.google.showcase.v1beta1.Blurb.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom((com.google.showcase.v1beta1.Blurb) request_); + request_ = subBuilder.buildPartial(); + } + requestCase_ = 2; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.MessagingOuterClass + .internal_static_google_showcase_v1beta1_ConnectRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.MessagingOuterClass + .internal_static_google_showcase_v1beta1_ConnectRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.ConnectRequest.class, + com.google.showcase.v1beta1.ConnectRequest.Builder.class); + } + + public interface ConnectConfigOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.ConnectRequest.ConnectConfig) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
        +     * The room or profile to follow and create messages for.
        +     * 
        + * + * string parent = 1 [(.google.api.resource_reference) = { ... } + * + * @return The parent. + */ + java.lang.String getParent(); + + /** + * + * + *
        +     * The room or profile to follow and create messages for.
        +     * 
        + * + * string parent = 1 [(.google.api.resource_reference) = { ... } + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + } + + /** Protobuf type {@code google.showcase.v1beta1.ConnectRequest.ConnectConfig} */ + public static final class ConnectConfig extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.ConnectRequest.ConnectConfig) + ConnectConfigOrBuilder { + private static final long serialVersionUID = 0L; + + // Use ConnectConfig.newBuilder() to construct. + private ConnectConfig(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ConnectConfig() { + parent_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ConnectConfig(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ConnectConfig( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + parent_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.MessagingOuterClass + .internal_static_google_showcase_v1beta1_ConnectRequest_ConnectConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.MessagingOuterClass + .internal_static_google_showcase_v1beta1_ConnectRequest_ConnectConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.ConnectRequest.ConnectConfig.class, + com.google.showcase.v1beta1.ConnectRequest.ConnectConfig.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + private volatile java.lang.Object parent_; + + /** + * + * + *
        +     * The room or profile to follow and create messages for.
        +     * 
        + * + * string parent = 1 [(.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; + } + } + + /** + * + * + *
        +     * The room or profile to follow and create messages for.
        +     * 
        + * + * string parent = 1 [(.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; + } + } + + 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_); + } + unknownFields.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_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.showcase.v1beta1.ConnectRequest.ConnectConfig)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.ConnectRequest.ConnectConfig other = + (com.google.showcase.v1beta1.ConnectRequest.ConnectConfig) obj; + + if (!getParent().equals(other.getParent())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + PARENT_FIELD_NUMBER; + hash = (53 * hash) + getParent().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.showcase.v1beta1.ConnectRequest.ConnectConfig parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.ConnectRequest.ConnectConfig parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.ConnectRequest.ConnectConfig parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.ConnectRequest.ConnectConfig 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.showcase.v1beta1.ConnectRequest.ConnectConfig parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.ConnectRequest.ConnectConfig parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.ConnectRequest.ConnectConfig parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.ConnectRequest.ConnectConfig 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.showcase.v1beta1.ConnectRequest.ConnectConfig parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.ConnectRequest.ConnectConfig 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.showcase.v1beta1.ConnectRequest.ConnectConfig parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.ConnectRequest.ConnectConfig 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.showcase.v1beta1.ConnectRequest.ConnectConfig prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** Protobuf type {@code google.showcase.v1beta1.ConnectRequest.ConnectConfig} */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.ConnectRequest.ConnectConfig) + com.google.showcase.v1beta1.ConnectRequest.ConnectConfigOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.MessagingOuterClass + .internal_static_google_showcase_v1beta1_ConnectRequest_ConnectConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.MessagingOuterClass + .internal_static_google_showcase_v1beta1_ConnectRequest_ConnectConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.ConnectRequest.ConnectConfig.class, + com.google.showcase.v1beta1.ConnectRequest.ConnectConfig.Builder.class); + } + + // Construct using com.google.showcase.v1beta1.ConnectRequest.ConnectConfig.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + parent_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.showcase.v1beta1.MessagingOuterClass + .internal_static_google_showcase_v1beta1_ConnectRequest_ConnectConfig_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.ConnectRequest.ConnectConfig getDefaultInstanceForType() { + return com.google.showcase.v1beta1.ConnectRequest.ConnectConfig.getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.ConnectRequest.ConnectConfig build() { + com.google.showcase.v1beta1.ConnectRequest.ConnectConfig result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.ConnectRequest.ConnectConfig buildPartial() { + com.google.showcase.v1beta1.ConnectRequest.ConnectConfig result = + new com.google.showcase.v1beta1.ConnectRequest.ConnectConfig(this); + result.parent_ = parent_; + 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.showcase.v1beta1.ConnectRequest.ConnectConfig) { + return mergeFrom((com.google.showcase.v1beta1.ConnectRequest.ConnectConfig) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.showcase.v1beta1.ConnectRequest.ConnectConfig other) { + if (other == com.google.showcase.v1beta1.ConnectRequest.ConnectConfig.getDefaultInstance()) + return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.showcase.v1beta1.ConnectRequest.ConnectConfig parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.showcase.v1beta1.ConnectRequest.ConnectConfig) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object parent_ = ""; + + /** + * + * + *
        +       * The room or profile to follow and create messages for.
        +       * 
        + * + * string parent = 1 [(.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; + } + } + + /** + * + * + *
        +       * The room or profile to follow and create messages for.
        +       * 
        + * + * string parent = 1 [(.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; + } + } + + /** + * + * + *
        +       * The room or profile to follow and create messages for.
        +       * 
        + * + * string parent = 1 [(.google.api.resource_reference) = { ... } + * + * @param value The parent to set. + * @return This builder for chaining. + */ + public Builder setParent(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + parent_ = value; + onChanged(); + return this; + } + + /** + * + * + *
        +       * The room or profile to follow and create messages for.
        +       * 
        + * + * string parent = 1 [(.google.api.resource_reference) = { ... } + * + * @return This builder for chaining. + */ + public Builder clearParent() { + + parent_ = getDefaultInstance().getParent(); + onChanged(); + return this; + } + + /** + * + * + *
        +       * The room or profile to follow and create messages for.
        +       * 
        + * + * string parent = 1 [(.google.api.resource_reference) = { ... } + * + * @param value The bytes for parent to set. + * @return This builder for chaining. + */ + public Builder setParentBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + parent_ = value; + onChanged(); + return this; + } + + @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.showcase.v1beta1.ConnectRequest.ConnectConfig) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.ConnectRequest.ConnectConfig) + private static final com.google.showcase.v1beta1.ConnectRequest.ConnectConfig DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.ConnectRequest.ConnectConfig(); + } + + public static com.google.showcase.v1beta1.ConnectRequest.ConnectConfig getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ConnectConfig parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ConnectConfig(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.showcase.v1beta1.ConnectRequest.ConnectConfig getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + private int requestCase_ = 0; + private java.lang.Object request_; + + public enum RequestCase + implements + com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + CONFIG(1), + BLURB(2), + 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 1: + return CONFIG; + case 2: + return BLURB; + 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 CONFIG_FIELD_NUMBER = 1; + + /** + * + * + *
        +   * Provides information that specifies how to process subsequent requests.
        +   * The first `ConnectRequest` message must contain a `config`  message.
        +   * 
        + * + * .google.showcase.v1beta1.ConnectRequest.ConnectConfig config = 1; + * + * @return Whether the config field is set. + */ + @java.lang.Override + public boolean hasConfig() { + return requestCase_ == 1; + } + + /** + * + * + *
        +   * Provides information that specifies how to process subsequent requests.
        +   * The first `ConnectRequest` message must contain a `config`  message.
        +   * 
        + * + * .google.showcase.v1beta1.ConnectRequest.ConnectConfig config = 1; + * + * @return The config. + */ + @java.lang.Override + public com.google.showcase.v1beta1.ConnectRequest.ConnectConfig getConfig() { + if (requestCase_ == 1) { + return (com.google.showcase.v1beta1.ConnectRequest.ConnectConfig) request_; + } + return com.google.showcase.v1beta1.ConnectRequest.ConnectConfig.getDefaultInstance(); + } + + /** + * + * + *
        +   * Provides information that specifies how to process subsequent requests.
        +   * The first `ConnectRequest` message must contain a `config`  message.
        +   * 
        + * + * .google.showcase.v1beta1.ConnectRequest.ConnectConfig config = 1; + */ + @java.lang.Override + public com.google.showcase.v1beta1.ConnectRequest.ConnectConfigOrBuilder getConfigOrBuilder() { + if (requestCase_ == 1) { + return (com.google.showcase.v1beta1.ConnectRequest.ConnectConfig) request_; + } + return com.google.showcase.v1beta1.ConnectRequest.ConnectConfig.getDefaultInstance(); + } + + public static final int BLURB_FIELD_NUMBER = 2; + + /** + * + * + *
        +   * The blurb to be created.
        +   * 
        + * + * .google.showcase.v1beta1.Blurb blurb = 2; + * + * @return Whether the blurb field is set. + */ + @java.lang.Override + public boolean hasBlurb() { + return requestCase_ == 2; + } + + /** + * + * + *
        +   * The blurb to be created.
        +   * 
        + * + * .google.showcase.v1beta1.Blurb blurb = 2; + * + * @return The blurb. + */ + @java.lang.Override + public com.google.showcase.v1beta1.Blurb getBlurb() { + if (requestCase_ == 2) { + return (com.google.showcase.v1beta1.Blurb) request_; + } + return com.google.showcase.v1beta1.Blurb.getDefaultInstance(); + } + + /** + * + * + *
        +   * The blurb to be created.
        +   * 
        + * + * .google.showcase.v1beta1.Blurb blurb = 2; + */ + @java.lang.Override + public com.google.showcase.v1beta1.BlurbOrBuilder getBlurbOrBuilder() { + if (requestCase_ == 2) { + return (com.google.showcase.v1beta1.Blurb) request_; + } + return com.google.showcase.v1beta1.Blurb.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 (requestCase_ == 1) { + output.writeMessage(1, (com.google.showcase.v1beta1.ConnectRequest.ConnectConfig) request_); + } + if (requestCase_ == 2) { + output.writeMessage(2, (com.google.showcase.v1beta1.Blurb) request_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (requestCase_ == 1) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 1, (com.google.showcase.v1beta1.ConnectRequest.ConnectConfig) request_); + } + if (requestCase_ == 2) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 2, (com.google.showcase.v1beta1.Blurb) request_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.showcase.v1beta1.ConnectRequest)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.ConnectRequest other = + (com.google.showcase.v1beta1.ConnectRequest) obj; + + if (!getRequestCase().equals(other.getRequestCase())) return false; + switch (requestCase_) { + case 1: + if (!getConfig().equals(other.getConfig())) return false; + break; + case 2: + if (!getBlurb().equals(other.getBlurb())) return false; + break; + case 0: + default: + } + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + switch (requestCase_) { + case 1: + hash = (37 * hash) + CONFIG_FIELD_NUMBER; + hash = (53 * hash) + getConfig().hashCode(); + break; + case 2: + hash = (37 * hash) + BLURB_FIELD_NUMBER; + hash = (53 * hash) + getBlurb().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.showcase.v1beta1.ConnectRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.ConnectRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.ConnectRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.ConnectRequest 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.showcase.v1beta1.ConnectRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.ConnectRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.ConnectRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.ConnectRequest 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.showcase.v1beta1.ConnectRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.ConnectRequest 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.showcase.v1beta1.ConnectRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.ConnectRequest 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.showcase.v1beta1.ConnectRequest 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 request message for the google.showcase.v1beta1.Messaging\Connect
        +   * method.
        +   * 
        + * + * Protobuf type {@code google.showcase.v1beta1.ConnectRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.ConnectRequest) + com.google.showcase.v1beta1.ConnectRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.MessagingOuterClass + .internal_static_google_showcase_v1beta1_ConnectRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.MessagingOuterClass + .internal_static_google_showcase_v1beta1_ConnectRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.ConnectRequest.class, + com.google.showcase.v1beta1.ConnectRequest.Builder.class); + } + + // Construct using com.google.showcase.v1beta1.ConnectRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + requestCase_ = 0; + request_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.showcase.v1beta1.MessagingOuterClass + .internal_static_google_showcase_v1beta1_ConnectRequest_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.ConnectRequest getDefaultInstanceForType() { + return com.google.showcase.v1beta1.ConnectRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.ConnectRequest build() { + com.google.showcase.v1beta1.ConnectRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.ConnectRequest buildPartial() { + com.google.showcase.v1beta1.ConnectRequest result = + new com.google.showcase.v1beta1.ConnectRequest(this); + if (requestCase_ == 1) { + if (configBuilder_ == null) { + result.request_ = request_; + } else { + result.request_ = configBuilder_.build(); + } + } + if (requestCase_ == 2) { + if (blurbBuilder_ == null) { + result.request_ = request_; + } else { + result.request_ = blurbBuilder_.build(); + } + } + result.requestCase_ = requestCase_; + 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.showcase.v1beta1.ConnectRequest) { + return mergeFrom((com.google.showcase.v1beta1.ConnectRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.showcase.v1beta1.ConnectRequest other) { + if (other == com.google.showcase.v1beta1.ConnectRequest.getDefaultInstance()) return this; + switch (other.getRequestCase()) { + case CONFIG: + { + mergeConfig(other.getConfig()); + break; + } + case BLURB: + { + mergeBlurb(other.getBlurb()); + break; + } + case REQUEST_NOT_SET: + { + break; + } + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.showcase.v1beta1.ConnectRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.showcase.v1beta1.ConnectRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + 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 com.google.protobuf.SingleFieldBuilderV3< + com.google.showcase.v1beta1.ConnectRequest.ConnectConfig, + com.google.showcase.v1beta1.ConnectRequest.ConnectConfig.Builder, + com.google.showcase.v1beta1.ConnectRequest.ConnectConfigOrBuilder> + configBuilder_; + + /** + * + * + *
        +     * Provides information that specifies how to process subsequent requests.
        +     * The first `ConnectRequest` message must contain a `config`  message.
        +     * 
        + * + * .google.showcase.v1beta1.ConnectRequest.ConnectConfig config = 1; + * + * @return Whether the config field is set. + */ + @java.lang.Override + public boolean hasConfig() { + return requestCase_ == 1; + } + + /** + * + * + *
        +     * Provides information that specifies how to process subsequent requests.
        +     * The first `ConnectRequest` message must contain a `config`  message.
        +     * 
        + * + * .google.showcase.v1beta1.ConnectRequest.ConnectConfig config = 1; + * + * @return The config. + */ + @java.lang.Override + public com.google.showcase.v1beta1.ConnectRequest.ConnectConfig getConfig() { + if (configBuilder_ == null) { + if (requestCase_ == 1) { + return (com.google.showcase.v1beta1.ConnectRequest.ConnectConfig) request_; + } + return com.google.showcase.v1beta1.ConnectRequest.ConnectConfig.getDefaultInstance(); + } else { + if (requestCase_ == 1) { + return configBuilder_.getMessage(); + } + return com.google.showcase.v1beta1.ConnectRequest.ConnectConfig.getDefaultInstance(); + } + } + + /** + * + * + *
        +     * Provides information that specifies how to process subsequent requests.
        +     * The first `ConnectRequest` message must contain a `config`  message.
        +     * 
        + * + * .google.showcase.v1beta1.ConnectRequest.ConnectConfig config = 1; + */ + public Builder setConfig(com.google.showcase.v1beta1.ConnectRequest.ConnectConfig value) { + if (configBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + request_ = value; + onChanged(); + } else { + configBuilder_.setMessage(value); + } + requestCase_ = 1; + return this; + } + + /** + * + * + *
        +     * Provides information that specifies how to process subsequent requests.
        +     * The first `ConnectRequest` message must contain a `config`  message.
        +     * 
        + * + * .google.showcase.v1beta1.ConnectRequest.ConnectConfig config = 1; + */ + public Builder setConfig( + com.google.showcase.v1beta1.ConnectRequest.ConnectConfig.Builder builderForValue) { + if (configBuilder_ == null) { + request_ = builderForValue.build(); + onChanged(); + } else { + configBuilder_.setMessage(builderForValue.build()); + } + requestCase_ = 1; + return this; + } + + /** + * + * + *
        +     * Provides information that specifies how to process subsequent requests.
        +     * The first `ConnectRequest` message must contain a `config`  message.
        +     * 
        + * + * .google.showcase.v1beta1.ConnectRequest.ConnectConfig config = 1; + */ + public Builder mergeConfig(com.google.showcase.v1beta1.ConnectRequest.ConnectConfig value) { + if (configBuilder_ == null) { + if (requestCase_ == 1 + && request_ + != com.google.showcase.v1beta1.ConnectRequest.ConnectConfig.getDefaultInstance()) { + request_ = + com.google.showcase.v1beta1.ConnectRequest.ConnectConfig.newBuilder( + (com.google.showcase.v1beta1.ConnectRequest.ConnectConfig) request_) + .mergeFrom(value) + .buildPartial(); + } else { + request_ = value; + } + onChanged(); + } else { + if (requestCase_ == 1) { + configBuilder_.mergeFrom(value); + } else { + configBuilder_.setMessage(value); + } + } + requestCase_ = 1; + return this; + } + + /** + * + * + *
        +     * Provides information that specifies how to process subsequent requests.
        +     * The first `ConnectRequest` message must contain a `config`  message.
        +     * 
        + * + * .google.showcase.v1beta1.ConnectRequest.ConnectConfig config = 1; + */ + public Builder clearConfig() { + if (configBuilder_ == null) { + if (requestCase_ == 1) { + requestCase_ = 0; + request_ = null; + onChanged(); + } + } else { + if (requestCase_ == 1) { + requestCase_ = 0; + request_ = null; + } + configBuilder_.clear(); + } + return this; + } + + /** + * + * + *
        +     * Provides information that specifies how to process subsequent requests.
        +     * The first `ConnectRequest` message must contain a `config`  message.
        +     * 
        + * + * .google.showcase.v1beta1.ConnectRequest.ConnectConfig config = 1; + */ + public com.google.showcase.v1beta1.ConnectRequest.ConnectConfig.Builder getConfigBuilder() { + return getConfigFieldBuilder().getBuilder(); + } + + /** + * + * + *
        +     * Provides information that specifies how to process subsequent requests.
        +     * The first `ConnectRequest` message must contain a `config`  message.
        +     * 
        + * + * .google.showcase.v1beta1.ConnectRequest.ConnectConfig config = 1; + */ + @java.lang.Override + public com.google.showcase.v1beta1.ConnectRequest.ConnectConfigOrBuilder getConfigOrBuilder() { + if ((requestCase_ == 1) && (configBuilder_ != null)) { + return configBuilder_.getMessageOrBuilder(); + } else { + if (requestCase_ == 1) { + return (com.google.showcase.v1beta1.ConnectRequest.ConnectConfig) request_; + } + return com.google.showcase.v1beta1.ConnectRequest.ConnectConfig.getDefaultInstance(); + } + } + + /** + * + * + *
        +     * Provides information that specifies how to process subsequent requests.
        +     * The first `ConnectRequest` message must contain a `config`  message.
        +     * 
        + * + * .google.showcase.v1beta1.ConnectRequest.ConnectConfig config = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.showcase.v1beta1.ConnectRequest.ConnectConfig, + com.google.showcase.v1beta1.ConnectRequest.ConnectConfig.Builder, + com.google.showcase.v1beta1.ConnectRequest.ConnectConfigOrBuilder> + getConfigFieldBuilder() { + if (configBuilder_ == null) { + if (!(requestCase_ == 1)) { + request_ = com.google.showcase.v1beta1.ConnectRequest.ConnectConfig.getDefaultInstance(); + } + configBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.showcase.v1beta1.ConnectRequest.ConnectConfig, + com.google.showcase.v1beta1.ConnectRequest.ConnectConfig.Builder, + com.google.showcase.v1beta1.ConnectRequest.ConnectConfigOrBuilder>( + (com.google.showcase.v1beta1.ConnectRequest.ConnectConfig) request_, + getParentForChildren(), + isClean()); + request_ = null; + } + requestCase_ = 1; + onChanged(); + ; + return configBuilder_; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.showcase.v1beta1.Blurb, + com.google.showcase.v1beta1.Blurb.Builder, + com.google.showcase.v1beta1.BlurbOrBuilder> + blurbBuilder_; + + /** + * + * + *
        +     * The blurb to be created.
        +     * 
        + * + * .google.showcase.v1beta1.Blurb blurb = 2; + * + * @return Whether the blurb field is set. + */ + @java.lang.Override + public boolean hasBlurb() { + return requestCase_ == 2; + } + + /** + * + * + *
        +     * The blurb to be created.
        +     * 
        + * + * .google.showcase.v1beta1.Blurb blurb = 2; + * + * @return The blurb. + */ + @java.lang.Override + public com.google.showcase.v1beta1.Blurb getBlurb() { + if (blurbBuilder_ == null) { + if (requestCase_ == 2) { + return (com.google.showcase.v1beta1.Blurb) request_; + } + return com.google.showcase.v1beta1.Blurb.getDefaultInstance(); + } else { + if (requestCase_ == 2) { + return blurbBuilder_.getMessage(); + } + return com.google.showcase.v1beta1.Blurb.getDefaultInstance(); + } + } + + /** + * + * + *
        +     * The blurb to be created.
        +     * 
        + * + * .google.showcase.v1beta1.Blurb blurb = 2; + */ + public Builder setBlurb(com.google.showcase.v1beta1.Blurb value) { + if (blurbBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + request_ = value; + onChanged(); + } else { + blurbBuilder_.setMessage(value); + } + requestCase_ = 2; + return this; + } + + /** + * + * + *
        +     * The blurb to be created.
        +     * 
        + * + * .google.showcase.v1beta1.Blurb blurb = 2; + */ + public Builder setBlurb(com.google.showcase.v1beta1.Blurb.Builder builderForValue) { + if (blurbBuilder_ == null) { + request_ = builderForValue.build(); + onChanged(); + } else { + blurbBuilder_.setMessage(builderForValue.build()); + } + requestCase_ = 2; + return this; + } + + /** + * + * + *
        +     * The blurb to be created.
        +     * 
        + * + * .google.showcase.v1beta1.Blurb blurb = 2; + */ + public Builder mergeBlurb(com.google.showcase.v1beta1.Blurb value) { + if (blurbBuilder_ == null) { + if (requestCase_ == 2 + && request_ != com.google.showcase.v1beta1.Blurb.getDefaultInstance()) { + request_ = + com.google.showcase.v1beta1.Blurb.newBuilder( + (com.google.showcase.v1beta1.Blurb) request_) + .mergeFrom(value) + .buildPartial(); + } else { + request_ = value; + } + onChanged(); + } else { + if (requestCase_ == 2) { + blurbBuilder_.mergeFrom(value); + } else { + blurbBuilder_.setMessage(value); + } + } + requestCase_ = 2; + return this; + } + + /** + * + * + *
        +     * The blurb to be created.
        +     * 
        + * + * .google.showcase.v1beta1.Blurb blurb = 2; + */ + public Builder clearBlurb() { + if (blurbBuilder_ == null) { + if (requestCase_ == 2) { + requestCase_ = 0; + request_ = null; + onChanged(); + } + } else { + if (requestCase_ == 2) { + requestCase_ = 0; + request_ = null; + } + blurbBuilder_.clear(); + } + return this; + } + + /** + * + * + *
        +     * The blurb to be created.
        +     * 
        + * + * .google.showcase.v1beta1.Blurb blurb = 2; + */ + public com.google.showcase.v1beta1.Blurb.Builder getBlurbBuilder() { + return getBlurbFieldBuilder().getBuilder(); + } + + /** + * + * + *
        +     * The blurb to be created.
        +     * 
        + * + * .google.showcase.v1beta1.Blurb blurb = 2; + */ + @java.lang.Override + public com.google.showcase.v1beta1.BlurbOrBuilder getBlurbOrBuilder() { + if ((requestCase_ == 2) && (blurbBuilder_ != null)) { + return blurbBuilder_.getMessageOrBuilder(); + } else { + if (requestCase_ == 2) { + return (com.google.showcase.v1beta1.Blurb) request_; + } + return com.google.showcase.v1beta1.Blurb.getDefaultInstance(); + } + } + + /** + * + * + *
        +     * The blurb to be created.
        +     * 
        + * + * .google.showcase.v1beta1.Blurb blurb = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.showcase.v1beta1.Blurb, + com.google.showcase.v1beta1.Blurb.Builder, + com.google.showcase.v1beta1.BlurbOrBuilder> + getBlurbFieldBuilder() { + if (blurbBuilder_ == null) { + if (!(requestCase_ == 2)) { + request_ = com.google.showcase.v1beta1.Blurb.getDefaultInstance(); + } + blurbBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.showcase.v1beta1.Blurb, + com.google.showcase.v1beta1.Blurb.Builder, + com.google.showcase.v1beta1.BlurbOrBuilder>( + (com.google.showcase.v1beta1.Blurb) request_, getParentForChildren(), isClean()); + request_ = null; + } + requestCase_ = 2; + onChanged(); + ; + return blurbBuilder_; + } + + @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.showcase.v1beta1.ConnectRequest) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.ConnectRequest) + private static final com.google.showcase.v1beta1.ConnectRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.ConnectRequest(); + } + + public static com.google.showcase.v1beta1.ConnectRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ConnectRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ConnectRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.showcase.v1beta1.ConnectRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ConnectRequestOrBuilder.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ConnectRequestOrBuilder.java new file mode 100644 index 0000000000..62f0110274 --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ConnectRequestOrBuilder.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: schema/google/showcase/v1beta1/messaging.proto + +package com.google.showcase.v1beta1; + +public interface ConnectRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.ConnectRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
        +   * Provides information that specifies how to process subsequent requests.
        +   * The first `ConnectRequest` message must contain a `config`  message.
        +   * 
        + * + * .google.showcase.v1beta1.ConnectRequest.ConnectConfig config = 1; + * + * @return Whether the config field is set. + */ + boolean hasConfig(); + + /** + * + * + *
        +   * Provides information that specifies how to process subsequent requests.
        +   * The first `ConnectRequest` message must contain a `config`  message.
        +   * 
        + * + * .google.showcase.v1beta1.ConnectRequest.ConnectConfig config = 1; + * + * @return The config. + */ + com.google.showcase.v1beta1.ConnectRequest.ConnectConfig getConfig(); + + /** + * + * + *
        +   * Provides information that specifies how to process subsequent requests.
        +   * The first `ConnectRequest` message must contain a `config`  message.
        +   * 
        + * + * .google.showcase.v1beta1.ConnectRequest.ConnectConfig config = 1; + */ + com.google.showcase.v1beta1.ConnectRequest.ConnectConfigOrBuilder getConfigOrBuilder(); + + /** + * + * + *
        +   * The blurb to be created.
        +   * 
        + * + * .google.showcase.v1beta1.Blurb blurb = 2; + * + * @return Whether the blurb field is set. + */ + boolean hasBlurb(); + + /** + * + * + *
        +   * The blurb to be created.
        +   * 
        + * + * .google.showcase.v1beta1.Blurb blurb = 2; + * + * @return The blurb. + */ + com.google.showcase.v1beta1.Blurb getBlurb(); + + /** + * + * + *
        +   * The blurb to be created.
        +   * 
        + * + * .google.showcase.v1beta1.Blurb blurb = 2; + */ + com.google.showcase.v1beta1.BlurbOrBuilder getBlurbOrBuilder(); + + public com.google.showcase.v1beta1.ConnectRequest.RequestCase getRequestCase(); +} diff --git a/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/Continent.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/Continent.java new file mode 100644 index 0000000000..3e3b35a327 --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/Continent.java @@ -0,0 +1,143 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/compliance.proto + +package com.google.showcase.v1beta1; + +/** Protobuf enum {@code google.showcase.v1beta1.Continent} */ +public enum Continent implements com.google.protobuf.ProtocolMessageEnum { + /** CONTINENT_UNSPECIFIED = 0; */ + CONTINENT_UNSPECIFIED(0), + /** AFRICA = 1; */ + AFRICA(1), + /** AMERICA = 2; */ + AMERICA(2), + /** ANTARTICA = 3; */ + ANTARTICA(3), + /** AUSTRALIA = 4; */ + AUSTRALIA(4), + /** EUROPE = 5; */ + EUROPE(5), + UNRECOGNIZED(-1), + ; + + /** CONTINENT_UNSPECIFIED = 0; */ + public static final int CONTINENT_UNSPECIFIED_VALUE = 0; + + /** AFRICA = 1; */ + public static final int AFRICA_VALUE = 1; + + /** AMERICA = 2; */ + public static final int AMERICA_VALUE = 2; + + /** ANTARTICA = 3; */ + public static final int ANTARTICA_VALUE = 3; + + /** AUSTRALIA = 4; */ + public static final int AUSTRALIA_VALUE = 4; + + /** EUROPE = 5; */ + public static final int EUROPE_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 Continent 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 Continent forNumber(int value) { + switch (value) { + case 0: + return CONTINENT_UNSPECIFIED; + case 1: + return AFRICA; + case 2: + return AMERICA; + case 3: + return ANTARTICA; + case 4: + return AUSTRALIA; + case 5: + return EUROPE; + 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 Continent findValueByNumber(int number) { + return Continent.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.showcase.v1beta1.ComplianceOuterClass.getDescriptor().getEnumTypes().get(0); + } + + private static final Continent[] VALUES = values(); + + public static Continent 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 Continent(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.showcase.v1beta1.Continent) +} diff --git a/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/CreateBlurbRequest.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/CreateBlurbRequest.java new file mode 100644 index 0000000000..468650424e --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/CreateBlurbRequest.java @@ -0,0 +1,948 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/messaging.proto + +package com.google.showcase.v1beta1; + +/** + * + * + *
        + * The request message for the google.showcase.v1beta1.Messaging\CreateBlurb
        + * method.
        + * 
        + * + * Protobuf type {@code google.showcase.v1beta1.CreateBlurbRequest} + */ +public final class CreateBlurbRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.CreateBlurbRequest) + CreateBlurbRequestOrBuilder { + private static final long serialVersionUID = 0L; + + // Use CreateBlurbRequest.newBuilder() to construct. + private CreateBlurbRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private CreateBlurbRequest() { + parent_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new CreateBlurbRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private CreateBlurbRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + parent_ = s; + break; + } + case 18: + { + com.google.showcase.v1beta1.Blurb.Builder subBuilder = null; + if (blurb_ != null) { + subBuilder = blurb_.toBuilder(); + } + blurb_ = + input.readMessage(com.google.showcase.v1beta1.Blurb.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(blurb_); + blurb_ = subBuilder.buildPartial(); + } + + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.MessagingOuterClass + .internal_static_google_showcase_v1beta1_CreateBlurbRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.MessagingOuterClass + .internal_static_google_showcase_v1beta1_CreateBlurbRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.CreateBlurbRequest.class, + com.google.showcase.v1beta1.CreateBlurbRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + private volatile java.lang.Object parent_; + + /** + * + * + *
        +   * The resource name of the chat room or user profile that this blurb will
        +   * be tied to.
        +   * 
        + * + * + * 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; + } + } + + /** + * + * + *
        +   * The resource name of the chat room or user profile that this blurb will
        +   * be tied to.
        +   * 
        + * + * + * 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 BLURB_FIELD_NUMBER = 2; + private com.google.showcase.v1beta1.Blurb blurb_; + + /** + * + * + *
        +   * The blurb to create.
        +   * 
        + * + * .google.showcase.v1beta1.Blurb blurb = 2; + * + * @return Whether the blurb field is set. + */ + @java.lang.Override + public boolean hasBlurb() { + return blurb_ != null; + } + + /** + * + * + *
        +   * The blurb to create.
        +   * 
        + * + * .google.showcase.v1beta1.Blurb blurb = 2; + * + * @return The blurb. + */ + @java.lang.Override + public com.google.showcase.v1beta1.Blurb getBlurb() { + return blurb_ == null ? com.google.showcase.v1beta1.Blurb.getDefaultInstance() : blurb_; + } + + /** + * + * + *
        +   * The blurb to create.
        +   * 
        + * + * .google.showcase.v1beta1.Blurb blurb = 2; + */ + @java.lang.Override + public com.google.showcase.v1beta1.BlurbOrBuilder getBlurbOrBuilder() { + return getBlurb(); + } + + 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 (blurb_ != null) { + output.writeMessage(2, getBlurb()); + } + unknownFields.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 (blurb_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getBlurb()); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.showcase.v1beta1.CreateBlurbRequest)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.CreateBlurbRequest other = + (com.google.showcase.v1beta1.CreateBlurbRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (hasBlurb() != other.hasBlurb()) return false; + if (hasBlurb()) { + if (!getBlurb().equals(other.getBlurb())) return false; + } + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + PARENT_FIELD_NUMBER; + hash = (53 * hash) + getParent().hashCode(); + if (hasBlurb()) { + hash = (37 * hash) + BLURB_FIELD_NUMBER; + hash = (53 * hash) + getBlurb().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.showcase.v1beta1.CreateBlurbRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.CreateBlurbRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.CreateBlurbRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.CreateBlurbRequest 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.showcase.v1beta1.CreateBlurbRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.CreateBlurbRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.CreateBlurbRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.CreateBlurbRequest 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.showcase.v1beta1.CreateBlurbRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.CreateBlurbRequest 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.showcase.v1beta1.CreateBlurbRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.CreateBlurbRequest 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.showcase.v1beta1.CreateBlurbRequest 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 request message for the google.showcase.v1beta1.Messaging\CreateBlurb
        +   * method.
        +   * 
        + * + * Protobuf type {@code google.showcase.v1beta1.CreateBlurbRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.CreateBlurbRequest) + com.google.showcase.v1beta1.CreateBlurbRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.MessagingOuterClass + .internal_static_google_showcase_v1beta1_CreateBlurbRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.MessagingOuterClass + .internal_static_google_showcase_v1beta1_CreateBlurbRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.CreateBlurbRequest.class, + com.google.showcase.v1beta1.CreateBlurbRequest.Builder.class); + } + + // Construct using com.google.showcase.v1beta1.CreateBlurbRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + parent_ = ""; + + if (blurbBuilder_ == null) { + blurb_ = null; + } else { + blurb_ = null; + blurbBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.showcase.v1beta1.MessagingOuterClass + .internal_static_google_showcase_v1beta1_CreateBlurbRequest_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.CreateBlurbRequest getDefaultInstanceForType() { + return com.google.showcase.v1beta1.CreateBlurbRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.CreateBlurbRequest build() { + com.google.showcase.v1beta1.CreateBlurbRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.CreateBlurbRequest buildPartial() { + com.google.showcase.v1beta1.CreateBlurbRequest result = + new com.google.showcase.v1beta1.CreateBlurbRequest(this); + result.parent_ = parent_; + if (blurbBuilder_ == null) { + result.blurb_ = blurb_; + } else { + result.blurb_ = blurbBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.showcase.v1beta1.CreateBlurbRequest) { + return mergeFrom((com.google.showcase.v1beta1.CreateBlurbRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.showcase.v1beta1.CreateBlurbRequest other) { + if (other == com.google.showcase.v1beta1.CreateBlurbRequest.getDefaultInstance()) return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + onChanged(); + } + if (other.hasBlurb()) { + mergeBlurb(other.getBlurb()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.showcase.v1beta1.CreateBlurbRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.showcase.v1beta1.CreateBlurbRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object parent_ = ""; + + /** + * + * + *
        +     * The resource name of the chat room or user profile that this blurb will
        +     * be tied to.
        +     * 
        + * + * + * 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; + } + } + + /** + * + * + *
        +     * The resource name of the chat room or user profile that this blurb will
        +     * be tied to.
        +     * 
        + * + * + * 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; + } + } + + /** + * + * + *
        +     * The resource name of the chat room or user profile that this blurb will
        +     * be tied to.
        +     * 
        + * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The parent to set. + * @return This builder for chaining. + */ + public Builder setParent(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + parent_ = value; + onChanged(); + return this; + } + + /** + * + * + *
        +     * The resource name of the chat room or user profile that this blurb will
        +     * be tied to.
        +     * 
        + * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearParent() { + + parent_ = getDefaultInstance().getParent(); + onChanged(); + return this; + } + + /** + * + * + *
        +     * The resource name of the chat room or user profile that this blurb will
        +     * be tied to.
        +     * 
        + * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for parent to set. + * @return This builder for chaining. + */ + public Builder setParentBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + parent_ = value; + onChanged(); + return this; + } + + private com.google.showcase.v1beta1.Blurb blurb_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.showcase.v1beta1.Blurb, + com.google.showcase.v1beta1.Blurb.Builder, + com.google.showcase.v1beta1.BlurbOrBuilder> + blurbBuilder_; + + /** + * + * + *
        +     * The blurb to create.
        +     * 
        + * + * .google.showcase.v1beta1.Blurb blurb = 2; + * + * @return Whether the blurb field is set. + */ + public boolean hasBlurb() { + return blurbBuilder_ != null || blurb_ != null; + } + + /** + * + * + *
        +     * The blurb to create.
        +     * 
        + * + * .google.showcase.v1beta1.Blurb blurb = 2; + * + * @return The blurb. + */ + public com.google.showcase.v1beta1.Blurb getBlurb() { + if (blurbBuilder_ == null) { + return blurb_ == null ? com.google.showcase.v1beta1.Blurb.getDefaultInstance() : blurb_; + } else { + return blurbBuilder_.getMessage(); + } + } + + /** + * + * + *
        +     * The blurb to create.
        +     * 
        + * + * .google.showcase.v1beta1.Blurb blurb = 2; + */ + public Builder setBlurb(com.google.showcase.v1beta1.Blurb value) { + if (blurbBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + blurb_ = value; + onChanged(); + } else { + blurbBuilder_.setMessage(value); + } + + return this; + } + + /** + * + * + *
        +     * The blurb to create.
        +     * 
        + * + * .google.showcase.v1beta1.Blurb blurb = 2; + */ + public Builder setBlurb(com.google.showcase.v1beta1.Blurb.Builder builderForValue) { + if (blurbBuilder_ == null) { + blurb_ = builderForValue.build(); + onChanged(); + } else { + blurbBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + + /** + * + * + *
        +     * The blurb to create.
        +     * 
        + * + * .google.showcase.v1beta1.Blurb blurb = 2; + */ + public Builder mergeBlurb(com.google.showcase.v1beta1.Blurb value) { + if (blurbBuilder_ == null) { + if (blurb_ != null) { + blurb_ = + com.google.showcase.v1beta1.Blurb.newBuilder(blurb_).mergeFrom(value).buildPartial(); + } else { + blurb_ = value; + } + onChanged(); + } else { + blurbBuilder_.mergeFrom(value); + } + + return this; + } + + /** + * + * + *
        +     * The blurb to create.
        +     * 
        + * + * .google.showcase.v1beta1.Blurb blurb = 2; + */ + public Builder clearBlurb() { + if (blurbBuilder_ == null) { + blurb_ = null; + onChanged(); + } else { + blurb_ = null; + blurbBuilder_ = null; + } + + return this; + } + + /** + * + * + *
        +     * The blurb to create.
        +     * 
        + * + * .google.showcase.v1beta1.Blurb blurb = 2; + */ + public com.google.showcase.v1beta1.Blurb.Builder getBlurbBuilder() { + + onChanged(); + return getBlurbFieldBuilder().getBuilder(); + } + + /** + * + * + *
        +     * The blurb to create.
        +     * 
        + * + * .google.showcase.v1beta1.Blurb blurb = 2; + */ + public com.google.showcase.v1beta1.BlurbOrBuilder getBlurbOrBuilder() { + if (blurbBuilder_ != null) { + return blurbBuilder_.getMessageOrBuilder(); + } else { + return blurb_ == null ? com.google.showcase.v1beta1.Blurb.getDefaultInstance() : blurb_; + } + } + + /** + * + * + *
        +     * The blurb to create.
        +     * 
        + * + * .google.showcase.v1beta1.Blurb blurb = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.showcase.v1beta1.Blurb, + com.google.showcase.v1beta1.Blurb.Builder, + com.google.showcase.v1beta1.BlurbOrBuilder> + getBlurbFieldBuilder() { + if (blurbBuilder_ == null) { + blurbBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.showcase.v1beta1.Blurb, + com.google.showcase.v1beta1.Blurb.Builder, + com.google.showcase.v1beta1.BlurbOrBuilder>( + getBlurb(), getParentForChildren(), isClean()); + blurb_ = null; + } + return blurbBuilder_; + } + + @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.showcase.v1beta1.CreateBlurbRequest) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.CreateBlurbRequest) + private static final com.google.showcase.v1beta1.CreateBlurbRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.CreateBlurbRequest(); + } + + public static com.google.showcase.v1beta1.CreateBlurbRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CreateBlurbRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new CreateBlurbRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.showcase.v1beta1.CreateBlurbRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/CreateBlurbRequestOrBuilder.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/CreateBlurbRequestOrBuilder.java new file mode 100644 index 0000000000..10a4eb4e42 --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/CreateBlurbRequestOrBuilder.java @@ -0,0 +1,94 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/messaging.proto + +package com.google.showcase.v1beta1; + +public interface CreateBlurbRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.CreateBlurbRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
        +   * The resource name of the chat room or user profile that this blurb will
        +   * be tied to.
        +   * 
        + * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + + /** + * + * + *
        +   * The resource name of the chat room or user profile that this blurb will
        +   * be tied to.
        +   * 
        + * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
        +   * The blurb to create.
        +   * 
        + * + * .google.showcase.v1beta1.Blurb blurb = 2; + * + * @return Whether the blurb field is set. + */ + boolean hasBlurb(); + + /** + * + * + *
        +   * The blurb to create.
        +   * 
        + * + * .google.showcase.v1beta1.Blurb blurb = 2; + * + * @return The blurb. + */ + com.google.showcase.v1beta1.Blurb getBlurb(); + + /** + * + * + *
        +   * The blurb to create.
        +   * 
        + * + * .google.showcase.v1beta1.Blurb blurb = 2; + */ + com.google.showcase.v1beta1.BlurbOrBuilder getBlurbOrBuilder(); +} diff --git a/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/CreateRoomRequest.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/CreateRoomRequest.java new file mode 100644 index 0000000000..0c9f48e9f2 --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/CreateRoomRequest.java @@ -0,0 +1,740 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/messaging.proto + +package com.google.showcase.v1beta1; + +/** + * + * + *
        + * The request message for the google.showcase.v1beta1.Messaging\CreateRoom
        + * method.
        + * 
        + * + * Protobuf type {@code google.showcase.v1beta1.CreateRoomRequest} + */ +public final class CreateRoomRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.CreateRoomRequest) + CreateRoomRequestOrBuilder { + private static final long serialVersionUID = 0L; + + // Use CreateRoomRequest.newBuilder() to construct. + private CreateRoomRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private CreateRoomRequest() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new CreateRoomRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private CreateRoomRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + com.google.showcase.v1beta1.Room.Builder subBuilder = null; + if (room_ != null) { + subBuilder = room_.toBuilder(); + } + room_ = + input.readMessage(com.google.showcase.v1beta1.Room.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(room_); + room_ = subBuilder.buildPartial(); + } + + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.MessagingOuterClass + .internal_static_google_showcase_v1beta1_CreateRoomRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.MessagingOuterClass + .internal_static_google_showcase_v1beta1_CreateRoomRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.CreateRoomRequest.class, + com.google.showcase.v1beta1.CreateRoomRequest.Builder.class); + } + + public static final int ROOM_FIELD_NUMBER = 1; + private com.google.showcase.v1beta1.Room room_; + + /** + * + * + *
        +   * The room to create.
        +   * 
        + * + * .google.showcase.v1beta1.Room room = 1; + * + * @return Whether the room field is set. + */ + @java.lang.Override + public boolean hasRoom() { + return room_ != null; + } + + /** + * + * + *
        +   * The room to create.
        +   * 
        + * + * .google.showcase.v1beta1.Room room = 1; + * + * @return The room. + */ + @java.lang.Override + public com.google.showcase.v1beta1.Room getRoom() { + return room_ == null ? com.google.showcase.v1beta1.Room.getDefaultInstance() : room_; + } + + /** + * + * + *
        +   * The room to create.
        +   * 
        + * + * .google.showcase.v1beta1.Room room = 1; + */ + @java.lang.Override + public com.google.showcase.v1beta1.RoomOrBuilder getRoomOrBuilder() { + return getRoom(); + } + + 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 (room_ != null) { + output.writeMessage(1, getRoom()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (room_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getRoom()); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.showcase.v1beta1.CreateRoomRequest)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.CreateRoomRequest other = + (com.google.showcase.v1beta1.CreateRoomRequest) obj; + + if (hasRoom() != other.hasRoom()) return false; + if (hasRoom()) { + if (!getRoom().equals(other.getRoom())) return false; + } + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasRoom()) { + hash = (37 * hash) + ROOM_FIELD_NUMBER; + hash = (53 * hash) + getRoom().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.showcase.v1beta1.CreateRoomRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.CreateRoomRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.CreateRoomRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.CreateRoomRequest 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.showcase.v1beta1.CreateRoomRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.CreateRoomRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.CreateRoomRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.CreateRoomRequest 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.showcase.v1beta1.CreateRoomRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.CreateRoomRequest 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.showcase.v1beta1.CreateRoomRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.CreateRoomRequest 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.showcase.v1beta1.CreateRoomRequest 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 request message for the google.showcase.v1beta1.Messaging\CreateRoom
        +   * method.
        +   * 
        + * + * Protobuf type {@code google.showcase.v1beta1.CreateRoomRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.CreateRoomRequest) + com.google.showcase.v1beta1.CreateRoomRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.MessagingOuterClass + .internal_static_google_showcase_v1beta1_CreateRoomRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.MessagingOuterClass + .internal_static_google_showcase_v1beta1_CreateRoomRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.CreateRoomRequest.class, + com.google.showcase.v1beta1.CreateRoomRequest.Builder.class); + } + + // Construct using com.google.showcase.v1beta1.CreateRoomRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (roomBuilder_ == null) { + room_ = null; + } else { + room_ = null; + roomBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.showcase.v1beta1.MessagingOuterClass + .internal_static_google_showcase_v1beta1_CreateRoomRequest_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.CreateRoomRequest getDefaultInstanceForType() { + return com.google.showcase.v1beta1.CreateRoomRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.CreateRoomRequest build() { + com.google.showcase.v1beta1.CreateRoomRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.CreateRoomRequest buildPartial() { + com.google.showcase.v1beta1.CreateRoomRequest result = + new com.google.showcase.v1beta1.CreateRoomRequest(this); + if (roomBuilder_ == null) { + result.room_ = room_; + } else { + result.room_ = roomBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.showcase.v1beta1.CreateRoomRequest) { + return mergeFrom((com.google.showcase.v1beta1.CreateRoomRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.showcase.v1beta1.CreateRoomRequest other) { + if (other == com.google.showcase.v1beta1.CreateRoomRequest.getDefaultInstance()) return this; + if (other.hasRoom()) { + mergeRoom(other.getRoom()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.showcase.v1beta1.CreateRoomRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.showcase.v1beta1.CreateRoomRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private com.google.showcase.v1beta1.Room room_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.showcase.v1beta1.Room, + com.google.showcase.v1beta1.Room.Builder, + com.google.showcase.v1beta1.RoomOrBuilder> + roomBuilder_; + + /** + * + * + *
        +     * The room to create.
        +     * 
        + * + * .google.showcase.v1beta1.Room room = 1; + * + * @return Whether the room field is set. + */ + public boolean hasRoom() { + return roomBuilder_ != null || room_ != null; + } + + /** + * + * + *
        +     * The room to create.
        +     * 
        + * + * .google.showcase.v1beta1.Room room = 1; + * + * @return The room. + */ + public com.google.showcase.v1beta1.Room getRoom() { + if (roomBuilder_ == null) { + return room_ == null ? com.google.showcase.v1beta1.Room.getDefaultInstance() : room_; + } else { + return roomBuilder_.getMessage(); + } + } + + /** + * + * + *
        +     * The room to create.
        +     * 
        + * + * .google.showcase.v1beta1.Room room = 1; + */ + public Builder setRoom(com.google.showcase.v1beta1.Room value) { + if (roomBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + room_ = value; + onChanged(); + } else { + roomBuilder_.setMessage(value); + } + + return this; + } + + /** + * + * + *
        +     * The room to create.
        +     * 
        + * + * .google.showcase.v1beta1.Room room = 1; + */ + public Builder setRoom(com.google.showcase.v1beta1.Room.Builder builderForValue) { + if (roomBuilder_ == null) { + room_ = builderForValue.build(); + onChanged(); + } else { + roomBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + + /** + * + * + *
        +     * The room to create.
        +     * 
        + * + * .google.showcase.v1beta1.Room room = 1; + */ + public Builder mergeRoom(com.google.showcase.v1beta1.Room value) { + if (roomBuilder_ == null) { + if (room_ != null) { + room_ = + com.google.showcase.v1beta1.Room.newBuilder(room_).mergeFrom(value).buildPartial(); + } else { + room_ = value; + } + onChanged(); + } else { + roomBuilder_.mergeFrom(value); + } + + return this; + } + + /** + * + * + *
        +     * The room to create.
        +     * 
        + * + * .google.showcase.v1beta1.Room room = 1; + */ + public Builder clearRoom() { + if (roomBuilder_ == null) { + room_ = null; + onChanged(); + } else { + room_ = null; + roomBuilder_ = null; + } + + return this; + } + + /** + * + * + *
        +     * The room to create.
        +     * 
        + * + * .google.showcase.v1beta1.Room room = 1; + */ + public com.google.showcase.v1beta1.Room.Builder getRoomBuilder() { + + onChanged(); + return getRoomFieldBuilder().getBuilder(); + } + + /** + * + * + *
        +     * The room to create.
        +     * 
        + * + * .google.showcase.v1beta1.Room room = 1; + */ + public com.google.showcase.v1beta1.RoomOrBuilder getRoomOrBuilder() { + if (roomBuilder_ != null) { + return roomBuilder_.getMessageOrBuilder(); + } else { + return room_ == null ? com.google.showcase.v1beta1.Room.getDefaultInstance() : room_; + } + } + + /** + * + * + *
        +     * The room to create.
        +     * 
        + * + * .google.showcase.v1beta1.Room room = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.showcase.v1beta1.Room, + com.google.showcase.v1beta1.Room.Builder, + com.google.showcase.v1beta1.RoomOrBuilder> + getRoomFieldBuilder() { + if (roomBuilder_ == null) { + roomBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.showcase.v1beta1.Room, + com.google.showcase.v1beta1.Room.Builder, + com.google.showcase.v1beta1.RoomOrBuilder>( + getRoom(), getParentForChildren(), isClean()); + room_ = null; + } + return roomBuilder_; + } + + @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.showcase.v1beta1.CreateRoomRequest) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.CreateRoomRequest) + private static final com.google.showcase.v1beta1.CreateRoomRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.CreateRoomRequest(); + } + + public static com.google.showcase.v1beta1.CreateRoomRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CreateRoomRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new CreateRoomRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.showcase.v1beta1.CreateRoomRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/CreateRoomRequestOrBuilder.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/CreateRoomRequestOrBuilder.java new file mode 100644 index 0000000000..70ac5ce00f --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/CreateRoomRequestOrBuilder.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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/messaging.proto + +package com.google.showcase.v1beta1; + +public interface CreateRoomRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.CreateRoomRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
        +   * The room to create.
        +   * 
        + * + * .google.showcase.v1beta1.Room room = 1; + * + * @return Whether the room field is set. + */ + boolean hasRoom(); + + /** + * + * + *
        +   * The room to create.
        +   * 
        + * + * .google.showcase.v1beta1.Room room = 1; + * + * @return The room. + */ + com.google.showcase.v1beta1.Room getRoom(); + + /** + * + * + *
        +   * The room to create.
        +   * 
        + * + * .google.showcase.v1beta1.Room room = 1; + */ + com.google.showcase.v1beta1.RoomOrBuilder getRoomOrBuilder(); +} diff --git a/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/CreateSequenceRequest.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/CreateSequenceRequest.java new file mode 100644 index 0000000000..c43a97e737 --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/CreateSequenceRequest.java @@ -0,0 +1,645 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/sequence.proto + +package com.google.showcase.v1beta1; + +/** Protobuf type {@code google.showcase.v1beta1.CreateSequenceRequest} */ +public final class CreateSequenceRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.CreateSequenceRequest) + CreateSequenceRequestOrBuilder { + private static final long serialVersionUID = 0L; + + // Use CreateSequenceRequest.newBuilder() to construct. + private CreateSequenceRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private CreateSequenceRequest() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new CreateSequenceRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private CreateSequenceRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + com.google.showcase.v1beta1.Sequence.Builder subBuilder = null; + if (sequence_ != null) { + subBuilder = sequence_.toBuilder(); + } + sequence_ = + input.readMessage( + com.google.showcase.v1beta1.Sequence.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(sequence_); + sequence_ = subBuilder.buildPartial(); + } + + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.SequenceOuterClass + .internal_static_google_showcase_v1beta1_CreateSequenceRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.SequenceOuterClass + .internal_static_google_showcase_v1beta1_CreateSequenceRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.CreateSequenceRequest.class, + com.google.showcase.v1beta1.CreateSequenceRequest.Builder.class); + } + + public static final int SEQUENCE_FIELD_NUMBER = 1; + private com.google.showcase.v1beta1.Sequence sequence_; + + /** + * .google.showcase.v1beta1.Sequence sequence = 1; + * + * @return Whether the sequence field is set. + */ + @java.lang.Override + public boolean hasSequence() { + return sequence_ != null; + } + + /** + * .google.showcase.v1beta1.Sequence sequence = 1; + * + * @return The sequence. + */ + @java.lang.Override + public com.google.showcase.v1beta1.Sequence getSequence() { + return sequence_ == null + ? com.google.showcase.v1beta1.Sequence.getDefaultInstance() + : sequence_; + } + + /** .google.showcase.v1beta1.Sequence sequence = 1; */ + @java.lang.Override + public com.google.showcase.v1beta1.SequenceOrBuilder getSequenceOrBuilder() { + return getSequence(); + } + + 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 (sequence_ != null) { + output.writeMessage(1, getSequence()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (sequence_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getSequence()); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.showcase.v1beta1.CreateSequenceRequest)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.CreateSequenceRequest other = + (com.google.showcase.v1beta1.CreateSequenceRequest) obj; + + if (hasSequence() != other.hasSequence()) return false; + if (hasSequence()) { + if (!getSequence().equals(other.getSequence())) return false; + } + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasSequence()) { + hash = (37 * hash) + SEQUENCE_FIELD_NUMBER; + hash = (53 * hash) + getSequence().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.showcase.v1beta1.CreateSequenceRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.CreateSequenceRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.CreateSequenceRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.CreateSequenceRequest 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.showcase.v1beta1.CreateSequenceRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.CreateSequenceRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.CreateSequenceRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.CreateSequenceRequest 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.showcase.v1beta1.CreateSequenceRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.CreateSequenceRequest 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.showcase.v1beta1.CreateSequenceRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.CreateSequenceRequest 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.showcase.v1beta1.CreateSequenceRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** Protobuf type {@code google.showcase.v1beta1.CreateSequenceRequest} */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.CreateSequenceRequest) + com.google.showcase.v1beta1.CreateSequenceRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.SequenceOuterClass + .internal_static_google_showcase_v1beta1_CreateSequenceRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.SequenceOuterClass + .internal_static_google_showcase_v1beta1_CreateSequenceRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.CreateSequenceRequest.class, + com.google.showcase.v1beta1.CreateSequenceRequest.Builder.class); + } + + // Construct using com.google.showcase.v1beta1.CreateSequenceRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (sequenceBuilder_ == null) { + sequence_ = null; + } else { + sequence_ = null; + sequenceBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.showcase.v1beta1.SequenceOuterClass + .internal_static_google_showcase_v1beta1_CreateSequenceRequest_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.CreateSequenceRequest getDefaultInstanceForType() { + return com.google.showcase.v1beta1.CreateSequenceRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.CreateSequenceRequest build() { + com.google.showcase.v1beta1.CreateSequenceRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.CreateSequenceRequest buildPartial() { + com.google.showcase.v1beta1.CreateSequenceRequest result = + new com.google.showcase.v1beta1.CreateSequenceRequest(this); + if (sequenceBuilder_ == null) { + result.sequence_ = sequence_; + } else { + result.sequence_ = sequenceBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.showcase.v1beta1.CreateSequenceRequest) { + return mergeFrom((com.google.showcase.v1beta1.CreateSequenceRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.showcase.v1beta1.CreateSequenceRequest other) { + if (other == com.google.showcase.v1beta1.CreateSequenceRequest.getDefaultInstance()) + return this; + if (other.hasSequence()) { + mergeSequence(other.getSequence()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.showcase.v1beta1.CreateSequenceRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.showcase.v1beta1.CreateSequenceRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private com.google.showcase.v1beta1.Sequence sequence_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.showcase.v1beta1.Sequence, + com.google.showcase.v1beta1.Sequence.Builder, + com.google.showcase.v1beta1.SequenceOrBuilder> + sequenceBuilder_; + + /** + * .google.showcase.v1beta1.Sequence sequence = 1; + * + * @return Whether the sequence field is set. + */ + public boolean hasSequence() { + return sequenceBuilder_ != null || sequence_ != null; + } + + /** + * .google.showcase.v1beta1.Sequence sequence = 1; + * + * @return The sequence. + */ + public com.google.showcase.v1beta1.Sequence getSequence() { + if (sequenceBuilder_ == null) { + return sequence_ == null + ? com.google.showcase.v1beta1.Sequence.getDefaultInstance() + : sequence_; + } else { + return sequenceBuilder_.getMessage(); + } + } + + /** .google.showcase.v1beta1.Sequence sequence = 1; */ + public Builder setSequence(com.google.showcase.v1beta1.Sequence value) { + if (sequenceBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + sequence_ = value; + onChanged(); + } else { + sequenceBuilder_.setMessage(value); + } + + return this; + } + + /** .google.showcase.v1beta1.Sequence sequence = 1; */ + public Builder setSequence(com.google.showcase.v1beta1.Sequence.Builder builderForValue) { + if (sequenceBuilder_ == null) { + sequence_ = builderForValue.build(); + onChanged(); + } else { + sequenceBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + + /** .google.showcase.v1beta1.Sequence sequence = 1; */ + public Builder mergeSequence(com.google.showcase.v1beta1.Sequence value) { + if (sequenceBuilder_ == null) { + if (sequence_ != null) { + sequence_ = + com.google.showcase.v1beta1.Sequence.newBuilder(sequence_) + .mergeFrom(value) + .buildPartial(); + } else { + sequence_ = value; + } + onChanged(); + } else { + sequenceBuilder_.mergeFrom(value); + } + + return this; + } + + /** .google.showcase.v1beta1.Sequence sequence = 1; */ + public Builder clearSequence() { + if (sequenceBuilder_ == null) { + sequence_ = null; + onChanged(); + } else { + sequence_ = null; + sequenceBuilder_ = null; + } + + return this; + } + + /** .google.showcase.v1beta1.Sequence sequence = 1; */ + public com.google.showcase.v1beta1.Sequence.Builder getSequenceBuilder() { + + onChanged(); + return getSequenceFieldBuilder().getBuilder(); + } + + /** .google.showcase.v1beta1.Sequence sequence = 1; */ + public com.google.showcase.v1beta1.SequenceOrBuilder getSequenceOrBuilder() { + if (sequenceBuilder_ != null) { + return sequenceBuilder_.getMessageOrBuilder(); + } else { + return sequence_ == null + ? com.google.showcase.v1beta1.Sequence.getDefaultInstance() + : sequence_; + } + } + + /** .google.showcase.v1beta1.Sequence sequence = 1; */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.showcase.v1beta1.Sequence, + com.google.showcase.v1beta1.Sequence.Builder, + com.google.showcase.v1beta1.SequenceOrBuilder> + getSequenceFieldBuilder() { + if (sequenceBuilder_ == null) { + sequenceBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.showcase.v1beta1.Sequence, + com.google.showcase.v1beta1.Sequence.Builder, + com.google.showcase.v1beta1.SequenceOrBuilder>( + getSequence(), getParentForChildren(), isClean()); + sequence_ = null; + } + return sequenceBuilder_; + } + + @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.showcase.v1beta1.CreateSequenceRequest) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.CreateSequenceRequest) + private static final com.google.showcase.v1beta1.CreateSequenceRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.CreateSequenceRequest(); + } + + public static com.google.showcase.v1beta1.CreateSequenceRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CreateSequenceRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new CreateSequenceRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.showcase.v1beta1.CreateSequenceRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/CreateSequenceRequestOrBuilder.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/CreateSequenceRequestOrBuilder.java new file mode 100644 index 0000000000..93b0341821 --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/CreateSequenceRequestOrBuilder.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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/sequence.proto + +package com.google.showcase.v1beta1; + +public interface CreateSequenceRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.CreateSequenceRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * .google.showcase.v1beta1.Sequence sequence = 1; + * + * @return Whether the sequence field is set. + */ + boolean hasSequence(); + + /** + * .google.showcase.v1beta1.Sequence sequence = 1; + * + * @return The sequence. + */ + com.google.showcase.v1beta1.Sequence getSequence(); + + /** .google.showcase.v1beta1.Sequence sequence = 1; */ + com.google.showcase.v1beta1.SequenceOrBuilder getSequenceOrBuilder(); +} diff --git a/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/CreateSessionRequest.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/CreateSessionRequest.java new file mode 100644 index 0000000000..aee834a67e --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/CreateSessionRequest.java @@ -0,0 +1,770 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/testing.proto + +package com.google.showcase.v1beta1; + +/** + * + * + *
        + * The request for the CreateSession method.
        + * 
        + * + * Protobuf type {@code google.showcase.v1beta1.CreateSessionRequest} + */ +public final class CreateSessionRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.CreateSessionRequest) + CreateSessionRequestOrBuilder { + private static final long serialVersionUID = 0L; + + // Use CreateSessionRequest.newBuilder() to construct. + private CreateSessionRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private CreateSessionRequest() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new CreateSessionRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private CreateSessionRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + com.google.showcase.v1beta1.Session.Builder subBuilder = null; + if (session_ != null) { + subBuilder = session_.toBuilder(); + } + session_ = + input.readMessage( + com.google.showcase.v1beta1.Session.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(session_); + session_ = subBuilder.buildPartial(); + } + + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.TestingOuterClass + .internal_static_google_showcase_v1beta1_CreateSessionRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.TestingOuterClass + .internal_static_google_showcase_v1beta1_CreateSessionRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.CreateSessionRequest.class, + com.google.showcase.v1beta1.CreateSessionRequest.Builder.class); + } + + public static final int SESSION_FIELD_NUMBER = 1; + private com.google.showcase.v1beta1.Session session_; + + /** + * + * + *
        +   * The session to be created.
        +   * Sessions are immutable once they are created (although they can
        +   * be deleted).
        +   * 
        + * + * .google.showcase.v1beta1.Session session = 1; + * + * @return Whether the session field is set. + */ + @java.lang.Override + public boolean hasSession() { + return session_ != null; + } + + /** + * + * + *
        +   * The session to be created.
        +   * Sessions are immutable once they are created (although they can
        +   * be deleted).
        +   * 
        + * + * .google.showcase.v1beta1.Session session = 1; + * + * @return The session. + */ + @java.lang.Override + public com.google.showcase.v1beta1.Session getSession() { + return session_ == null ? com.google.showcase.v1beta1.Session.getDefaultInstance() : session_; + } + + /** + * + * + *
        +   * The session to be created.
        +   * Sessions are immutable once they are created (although they can
        +   * be deleted).
        +   * 
        + * + * .google.showcase.v1beta1.Session session = 1; + */ + @java.lang.Override + public com.google.showcase.v1beta1.SessionOrBuilder getSessionOrBuilder() { + return getSession(); + } + + 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 (session_ != null) { + output.writeMessage(1, getSession()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (session_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getSession()); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.showcase.v1beta1.CreateSessionRequest)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.CreateSessionRequest other = + (com.google.showcase.v1beta1.CreateSessionRequest) obj; + + if (hasSession() != other.hasSession()) return false; + if (hasSession()) { + if (!getSession().equals(other.getSession())) return false; + } + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasSession()) { + hash = (37 * hash) + SESSION_FIELD_NUMBER; + hash = (53 * hash) + getSession().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.showcase.v1beta1.CreateSessionRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.CreateSessionRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.CreateSessionRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.CreateSessionRequest 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.showcase.v1beta1.CreateSessionRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.CreateSessionRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.CreateSessionRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.CreateSessionRequest 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.showcase.v1beta1.CreateSessionRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.CreateSessionRequest 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.showcase.v1beta1.CreateSessionRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.CreateSessionRequest 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.showcase.v1beta1.CreateSessionRequest 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 request for the CreateSession method.
        +   * 
        + * + * Protobuf type {@code google.showcase.v1beta1.CreateSessionRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.CreateSessionRequest) + com.google.showcase.v1beta1.CreateSessionRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.TestingOuterClass + .internal_static_google_showcase_v1beta1_CreateSessionRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.TestingOuterClass + .internal_static_google_showcase_v1beta1_CreateSessionRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.CreateSessionRequest.class, + com.google.showcase.v1beta1.CreateSessionRequest.Builder.class); + } + + // Construct using com.google.showcase.v1beta1.CreateSessionRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (sessionBuilder_ == null) { + session_ = null; + } else { + session_ = null; + sessionBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.showcase.v1beta1.TestingOuterClass + .internal_static_google_showcase_v1beta1_CreateSessionRequest_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.CreateSessionRequest getDefaultInstanceForType() { + return com.google.showcase.v1beta1.CreateSessionRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.CreateSessionRequest build() { + com.google.showcase.v1beta1.CreateSessionRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.CreateSessionRequest buildPartial() { + com.google.showcase.v1beta1.CreateSessionRequest result = + new com.google.showcase.v1beta1.CreateSessionRequest(this); + if (sessionBuilder_ == null) { + result.session_ = session_; + } else { + result.session_ = sessionBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.showcase.v1beta1.CreateSessionRequest) { + return mergeFrom((com.google.showcase.v1beta1.CreateSessionRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.showcase.v1beta1.CreateSessionRequest other) { + if (other == com.google.showcase.v1beta1.CreateSessionRequest.getDefaultInstance()) + return this; + if (other.hasSession()) { + mergeSession(other.getSession()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.showcase.v1beta1.CreateSessionRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.showcase.v1beta1.CreateSessionRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private com.google.showcase.v1beta1.Session session_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.showcase.v1beta1.Session, + com.google.showcase.v1beta1.Session.Builder, + com.google.showcase.v1beta1.SessionOrBuilder> + sessionBuilder_; + + /** + * + * + *
        +     * The session to be created.
        +     * Sessions are immutable once they are created (although they can
        +     * be deleted).
        +     * 
        + * + * .google.showcase.v1beta1.Session session = 1; + * + * @return Whether the session field is set. + */ + public boolean hasSession() { + return sessionBuilder_ != null || session_ != null; + } + + /** + * + * + *
        +     * The session to be created.
        +     * Sessions are immutable once they are created (although they can
        +     * be deleted).
        +     * 
        + * + * .google.showcase.v1beta1.Session session = 1; + * + * @return The session. + */ + public com.google.showcase.v1beta1.Session getSession() { + if (sessionBuilder_ == null) { + return session_ == null + ? com.google.showcase.v1beta1.Session.getDefaultInstance() + : session_; + } else { + return sessionBuilder_.getMessage(); + } + } + + /** + * + * + *
        +     * The session to be created.
        +     * Sessions are immutable once they are created (although they can
        +     * be deleted).
        +     * 
        + * + * .google.showcase.v1beta1.Session session = 1; + */ + public Builder setSession(com.google.showcase.v1beta1.Session value) { + if (sessionBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + session_ = value; + onChanged(); + } else { + sessionBuilder_.setMessage(value); + } + + return this; + } + + /** + * + * + *
        +     * The session to be created.
        +     * Sessions are immutable once they are created (although they can
        +     * be deleted).
        +     * 
        + * + * .google.showcase.v1beta1.Session session = 1; + */ + public Builder setSession(com.google.showcase.v1beta1.Session.Builder builderForValue) { + if (sessionBuilder_ == null) { + session_ = builderForValue.build(); + onChanged(); + } else { + sessionBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + + /** + * + * + *
        +     * The session to be created.
        +     * Sessions are immutable once they are created (although they can
        +     * be deleted).
        +     * 
        + * + * .google.showcase.v1beta1.Session session = 1; + */ + public Builder mergeSession(com.google.showcase.v1beta1.Session value) { + if (sessionBuilder_ == null) { + if (session_ != null) { + session_ = + com.google.showcase.v1beta1.Session.newBuilder(session_) + .mergeFrom(value) + .buildPartial(); + } else { + session_ = value; + } + onChanged(); + } else { + sessionBuilder_.mergeFrom(value); + } + + return this; + } + + /** + * + * + *
        +     * The session to be created.
        +     * Sessions are immutable once they are created (although they can
        +     * be deleted).
        +     * 
        + * + * .google.showcase.v1beta1.Session session = 1; + */ + public Builder clearSession() { + if (sessionBuilder_ == null) { + session_ = null; + onChanged(); + } else { + session_ = null; + sessionBuilder_ = null; + } + + return this; + } + + /** + * + * + *
        +     * The session to be created.
        +     * Sessions are immutable once they are created (although they can
        +     * be deleted).
        +     * 
        + * + * .google.showcase.v1beta1.Session session = 1; + */ + public com.google.showcase.v1beta1.Session.Builder getSessionBuilder() { + + onChanged(); + return getSessionFieldBuilder().getBuilder(); + } + + /** + * + * + *
        +     * The session to be created.
        +     * Sessions are immutable once they are created (although they can
        +     * be deleted).
        +     * 
        + * + * .google.showcase.v1beta1.Session session = 1; + */ + public com.google.showcase.v1beta1.SessionOrBuilder getSessionOrBuilder() { + if (sessionBuilder_ != null) { + return sessionBuilder_.getMessageOrBuilder(); + } else { + return session_ == null + ? com.google.showcase.v1beta1.Session.getDefaultInstance() + : session_; + } + } + + /** + * + * + *
        +     * The session to be created.
        +     * Sessions are immutable once they are created (although they can
        +     * be deleted).
        +     * 
        + * + * .google.showcase.v1beta1.Session session = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.showcase.v1beta1.Session, + com.google.showcase.v1beta1.Session.Builder, + com.google.showcase.v1beta1.SessionOrBuilder> + getSessionFieldBuilder() { + if (sessionBuilder_ == null) { + sessionBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.showcase.v1beta1.Session, + com.google.showcase.v1beta1.Session.Builder, + com.google.showcase.v1beta1.SessionOrBuilder>( + getSession(), getParentForChildren(), isClean()); + session_ = null; + } + return sessionBuilder_; + } + + @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.showcase.v1beta1.CreateSessionRequest) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.CreateSessionRequest) + private static final com.google.showcase.v1beta1.CreateSessionRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.CreateSessionRequest(); + } + + public static com.google.showcase.v1beta1.CreateSessionRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CreateSessionRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new CreateSessionRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.showcase.v1beta1.CreateSessionRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/CreateSessionRequestOrBuilder.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/CreateSessionRequestOrBuilder.java new file mode 100644 index 0000000000..e1b21c09f4 --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/CreateSessionRequestOrBuilder.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: schema/google/showcase/v1beta1/testing.proto + +package com.google.showcase.v1beta1; + +public interface CreateSessionRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.CreateSessionRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
        +   * The session to be created.
        +   * Sessions are immutable once they are created (although they can
        +   * be deleted).
        +   * 
        + * + * .google.showcase.v1beta1.Session session = 1; + * + * @return Whether the session field is set. + */ + boolean hasSession(); + + /** + * + * + *
        +   * The session to be created.
        +   * Sessions are immutable once they are created (although they can
        +   * be deleted).
        +   * 
        + * + * .google.showcase.v1beta1.Session session = 1; + * + * @return The session. + */ + com.google.showcase.v1beta1.Session getSession(); + + /** + * + * + *
        +   * The session to be created.
        +   * Sessions are immutable once they are created (although they can
        +   * be deleted).
        +   * 
        + * + * .google.showcase.v1beta1.Session session = 1; + */ + com.google.showcase.v1beta1.SessionOrBuilder getSessionOrBuilder(); +} diff --git a/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/CreateStreamingSequenceRequest.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/CreateStreamingSequenceRequest.java new file mode 100644 index 0000000000..74997f3ed8 --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/CreateStreamingSequenceRequest.java @@ -0,0 +1,648 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/sequence.proto + +package com.google.showcase.v1beta1; + +/** Protobuf type {@code google.showcase.v1beta1.CreateStreamingSequenceRequest} */ +public final class CreateStreamingSequenceRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.CreateStreamingSequenceRequest) + CreateStreamingSequenceRequestOrBuilder { + private static final long serialVersionUID = 0L; + + // Use CreateStreamingSequenceRequest.newBuilder() to construct. + private CreateStreamingSequenceRequest( + com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private CreateStreamingSequenceRequest() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new CreateStreamingSequenceRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private CreateStreamingSequenceRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + com.google.showcase.v1beta1.StreamingSequence.Builder subBuilder = null; + if (streamingSequence_ != null) { + subBuilder = streamingSequence_.toBuilder(); + } + streamingSequence_ = + input.readMessage( + com.google.showcase.v1beta1.StreamingSequence.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(streamingSequence_); + streamingSequence_ = subBuilder.buildPartial(); + } + + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.SequenceOuterClass + .internal_static_google_showcase_v1beta1_CreateStreamingSequenceRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.SequenceOuterClass + .internal_static_google_showcase_v1beta1_CreateStreamingSequenceRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.CreateStreamingSequenceRequest.class, + com.google.showcase.v1beta1.CreateStreamingSequenceRequest.Builder.class); + } + + public static final int STREAMING_SEQUENCE_FIELD_NUMBER = 1; + private com.google.showcase.v1beta1.StreamingSequence streamingSequence_; + + /** + * .google.showcase.v1beta1.StreamingSequence streaming_sequence = 1; + * + * @return Whether the streamingSequence field is set. + */ + @java.lang.Override + public boolean hasStreamingSequence() { + return streamingSequence_ != null; + } + + /** + * .google.showcase.v1beta1.StreamingSequence streaming_sequence = 1; + * + * @return The streamingSequence. + */ + @java.lang.Override + public com.google.showcase.v1beta1.StreamingSequence getStreamingSequence() { + return streamingSequence_ == null + ? com.google.showcase.v1beta1.StreamingSequence.getDefaultInstance() + : streamingSequence_; + } + + /** .google.showcase.v1beta1.StreamingSequence streaming_sequence = 1; */ + @java.lang.Override + public com.google.showcase.v1beta1.StreamingSequenceOrBuilder getStreamingSequenceOrBuilder() { + return getStreamingSequence(); + } + + 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 (streamingSequence_ != null) { + output.writeMessage(1, getStreamingSequence()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (streamingSequence_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getStreamingSequence()); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.showcase.v1beta1.CreateStreamingSequenceRequest)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.CreateStreamingSequenceRequest other = + (com.google.showcase.v1beta1.CreateStreamingSequenceRequest) obj; + + if (hasStreamingSequence() != other.hasStreamingSequence()) return false; + if (hasStreamingSequence()) { + if (!getStreamingSequence().equals(other.getStreamingSequence())) return false; + } + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasStreamingSequence()) { + hash = (37 * hash) + STREAMING_SEQUENCE_FIELD_NUMBER; + hash = (53 * hash) + getStreamingSequence().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.showcase.v1beta1.CreateStreamingSequenceRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.CreateStreamingSequenceRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.CreateStreamingSequenceRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.CreateStreamingSequenceRequest 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.showcase.v1beta1.CreateStreamingSequenceRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.CreateStreamingSequenceRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.CreateStreamingSequenceRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.CreateStreamingSequenceRequest 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.showcase.v1beta1.CreateStreamingSequenceRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.CreateStreamingSequenceRequest 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.showcase.v1beta1.CreateStreamingSequenceRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.CreateStreamingSequenceRequest 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.showcase.v1beta1.CreateStreamingSequenceRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** Protobuf type {@code google.showcase.v1beta1.CreateStreamingSequenceRequest} */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.CreateStreamingSequenceRequest) + com.google.showcase.v1beta1.CreateStreamingSequenceRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.SequenceOuterClass + .internal_static_google_showcase_v1beta1_CreateStreamingSequenceRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.SequenceOuterClass + .internal_static_google_showcase_v1beta1_CreateStreamingSequenceRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.CreateStreamingSequenceRequest.class, + com.google.showcase.v1beta1.CreateStreamingSequenceRequest.Builder.class); + } + + // Construct using com.google.showcase.v1beta1.CreateStreamingSequenceRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (streamingSequenceBuilder_ == null) { + streamingSequence_ = null; + } else { + streamingSequence_ = null; + streamingSequenceBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.showcase.v1beta1.SequenceOuterClass + .internal_static_google_showcase_v1beta1_CreateStreamingSequenceRequest_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.CreateStreamingSequenceRequest getDefaultInstanceForType() { + return com.google.showcase.v1beta1.CreateStreamingSequenceRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.CreateStreamingSequenceRequest build() { + com.google.showcase.v1beta1.CreateStreamingSequenceRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.CreateStreamingSequenceRequest buildPartial() { + com.google.showcase.v1beta1.CreateStreamingSequenceRequest result = + new com.google.showcase.v1beta1.CreateStreamingSequenceRequest(this); + if (streamingSequenceBuilder_ == null) { + result.streamingSequence_ = streamingSequence_; + } else { + result.streamingSequence_ = streamingSequenceBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.showcase.v1beta1.CreateStreamingSequenceRequest) { + return mergeFrom((com.google.showcase.v1beta1.CreateStreamingSequenceRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.showcase.v1beta1.CreateStreamingSequenceRequest other) { + if (other == com.google.showcase.v1beta1.CreateStreamingSequenceRequest.getDefaultInstance()) + return this; + if (other.hasStreamingSequence()) { + mergeStreamingSequence(other.getStreamingSequence()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.showcase.v1beta1.CreateStreamingSequenceRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.showcase.v1beta1.CreateStreamingSequenceRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private com.google.showcase.v1beta1.StreamingSequence streamingSequence_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.showcase.v1beta1.StreamingSequence, + com.google.showcase.v1beta1.StreamingSequence.Builder, + com.google.showcase.v1beta1.StreamingSequenceOrBuilder> + streamingSequenceBuilder_; + + /** + * .google.showcase.v1beta1.StreamingSequence streaming_sequence = 1; + * + * @return Whether the streamingSequence field is set. + */ + public boolean hasStreamingSequence() { + return streamingSequenceBuilder_ != null || streamingSequence_ != null; + } + + /** + * .google.showcase.v1beta1.StreamingSequence streaming_sequence = 1; + * + * @return The streamingSequence. + */ + public com.google.showcase.v1beta1.StreamingSequence getStreamingSequence() { + if (streamingSequenceBuilder_ == null) { + return streamingSequence_ == null + ? com.google.showcase.v1beta1.StreamingSequence.getDefaultInstance() + : streamingSequence_; + } else { + return streamingSequenceBuilder_.getMessage(); + } + } + + /** .google.showcase.v1beta1.StreamingSequence streaming_sequence = 1; */ + public Builder setStreamingSequence(com.google.showcase.v1beta1.StreamingSequence value) { + if (streamingSequenceBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + streamingSequence_ = value; + onChanged(); + } else { + streamingSequenceBuilder_.setMessage(value); + } + + return this; + } + + /** .google.showcase.v1beta1.StreamingSequence streaming_sequence = 1; */ + public Builder setStreamingSequence( + com.google.showcase.v1beta1.StreamingSequence.Builder builderForValue) { + if (streamingSequenceBuilder_ == null) { + streamingSequence_ = builderForValue.build(); + onChanged(); + } else { + streamingSequenceBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + + /** .google.showcase.v1beta1.StreamingSequence streaming_sequence = 1; */ + public Builder mergeStreamingSequence(com.google.showcase.v1beta1.StreamingSequence value) { + if (streamingSequenceBuilder_ == null) { + if (streamingSequence_ != null) { + streamingSequence_ = + com.google.showcase.v1beta1.StreamingSequence.newBuilder(streamingSequence_) + .mergeFrom(value) + .buildPartial(); + } else { + streamingSequence_ = value; + } + onChanged(); + } else { + streamingSequenceBuilder_.mergeFrom(value); + } + + return this; + } + + /** .google.showcase.v1beta1.StreamingSequence streaming_sequence = 1; */ + public Builder clearStreamingSequence() { + if (streamingSequenceBuilder_ == null) { + streamingSequence_ = null; + onChanged(); + } else { + streamingSequence_ = null; + streamingSequenceBuilder_ = null; + } + + return this; + } + + /** .google.showcase.v1beta1.StreamingSequence streaming_sequence = 1; */ + public com.google.showcase.v1beta1.StreamingSequence.Builder getStreamingSequenceBuilder() { + + onChanged(); + return getStreamingSequenceFieldBuilder().getBuilder(); + } + + /** .google.showcase.v1beta1.StreamingSequence streaming_sequence = 1; */ + public com.google.showcase.v1beta1.StreamingSequenceOrBuilder getStreamingSequenceOrBuilder() { + if (streamingSequenceBuilder_ != null) { + return streamingSequenceBuilder_.getMessageOrBuilder(); + } else { + return streamingSequence_ == null + ? com.google.showcase.v1beta1.StreamingSequence.getDefaultInstance() + : streamingSequence_; + } + } + + /** .google.showcase.v1beta1.StreamingSequence streaming_sequence = 1; */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.showcase.v1beta1.StreamingSequence, + com.google.showcase.v1beta1.StreamingSequence.Builder, + com.google.showcase.v1beta1.StreamingSequenceOrBuilder> + getStreamingSequenceFieldBuilder() { + if (streamingSequenceBuilder_ == null) { + streamingSequenceBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.showcase.v1beta1.StreamingSequence, + com.google.showcase.v1beta1.StreamingSequence.Builder, + com.google.showcase.v1beta1.StreamingSequenceOrBuilder>( + getStreamingSequence(), getParentForChildren(), isClean()); + streamingSequence_ = null; + } + return streamingSequenceBuilder_; + } + + @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.showcase.v1beta1.CreateStreamingSequenceRequest) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.CreateStreamingSequenceRequest) + private static final com.google.showcase.v1beta1.CreateStreamingSequenceRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.CreateStreamingSequenceRequest(); + } + + public static com.google.showcase.v1beta1.CreateStreamingSequenceRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CreateStreamingSequenceRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new CreateStreamingSequenceRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.showcase.v1beta1.CreateStreamingSequenceRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/CreateStreamingSequenceRequestOrBuilder.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/CreateStreamingSequenceRequestOrBuilder.java new file mode 100644 index 0000000000..6540c0105f --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/CreateStreamingSequenceRequestOrBuilder.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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/sequence.proto + +package com.google.showcase.v1beta1; + +public interface CreateStreamingSequenceRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.CreateStreamingSequenceRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * .google.showcase.v1beta1.StreamingSequence streaming_sequence = 1; + * + * @return Whether the streamingSequence field is set. + */ + boolean hasStreamingSequence(); + + /** + * .google.showcase.v1beta1.StreamingSequence streaming_sequence = 1; + * + * @return The streamingSequence. + */ + com.google.showcase.v1beta1.StreamingSequence getStreamingSequence(); + + /** .google.showcase.v1beta1.StreamingSequence streaming_sequence = 1; */ + com.google.showcase.v1beta1.StreamingSequenceOrBuilder getStreamingSequenceOrBuilder(); +} diff --git a/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/CreateUserRequest.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/CreateUserRequest.java new file mode 100644 index 0000000000..a6cade3e11 --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/CreateUserRequest.java @@ -0,0 +1,740 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/identity.proto + +package com.google.showcase.v1beta1; + +/** + * + * + *
        + * The request message for the google.showcase.v1beta1.Identity\CreateUser
        + * method.
        + * 
        + * + * Protobuf type {@code google.showcase.v1beta1.CreateUserRequest} + */ +public final class CreateUserRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.CreateUserRequest) + CreateUserRequestOrBuilder { + private static final long serialVersionUID = 0L; + + // Use CreateUserRequest.newBuilder() to construct. + private CreateUserRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private CreateUserRequest() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new CreateUserRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private CreateUserRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + com.google.showcase.v1beta1.User.Builder subBuilder = null; + if (user_ != null) { + subBuilder = user_.toBuilder(); + } + user_ = + input.readMessage(com.google.showcase.v1beta1.User.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(user_); + user_ = subBuilder.buildPartial(); + } + + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.IdentityOuterClass + .internal_static_google_showcase_v1beta1_CreateUserRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.IdentityOuterClass + .internal_static_google_showcase_v1beta1_CreateUserRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.CreateUserRequest.class, + com.google.showcase.v1beta1.CreateUserRequest.Builder.class); + } + + public static final int USER_FIELD_NUMBER = 1; + private com.google.showcase.v1beta1.User user_; + + /** + * + * + *
        +   * The user to create.
        +   * 
        + * + * .google.showcase.v1beta1.User user = 1; + * + * @return Whether the user field is set. + */ + @java.lang.Override + public boolean hasUser() { + return user_ != null; + } + + /** + * + * + *
        +   * The user to create.
        +   * 
        + * + * .google.showcase.v1beta1.User user = 1; + * + * @return The user. + */ + @java.lang.Override + public com.google.showcase.v1beta1.User getUser() { + return user_ == null ? com.google.showcase.v1beta1.User.getDefaultInstance() : user_; + } + + /** + * + * + *
        +   * The user to create.
        +   * 
        + * + * .google.showcase.v1beta1.User user = 1; + */ + @java.lang.Override + public com.google.showcase.v1beta1.UserOrBuilder getUserOrBuilder() { + return getUser(); + } + + 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 (user_ != null) { + output.writeMessage(1, getUser()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (user_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getUser()); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.showcase.v1beta1.CreateUserRequest)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.CreateUserRequest other = + (com.google.showcase.v1beta1.CreateUserRequest) obj; + + if (hasUser() != other.hasUser()) return false; + if (hasUser()) { + if (!getUser().equals(other.getUser())) return false; + } + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasUser()) { + hash = (37 * hash) + USER_FIELD_NUMBER; + hash = (53 * hash) + getUser().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.showcase.v1beta1.CreateUserRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.CreateUserRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.CreateUserRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.CreateUserRequest 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.showcase.v1beta1.CreateUserRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.CreateUserRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.CreateUserRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.CreateUserRequest 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.showcase.v1beta1.CreateUserRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.CreateUserRequest 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.showcase.v1beta1.CreateUserRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.CreateUserRequest 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.showcase.v1beta1.CreateUserRequest 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 request message for the google.showcase.v1beta1.Identity\CreateUser
        +   * method.
        +   * 
        + * + * Protobuf type {@code google.showcase.v1beta1.CreateUserRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.CreateUserRequest) + com.google.showcase.v1beta1.CreateUserRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.IdentityOuterClass + .internal_static_google_showcase_v1beta1_CreateUserRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.IdentityOuterClass + .internal_static_google_showcase_v1beta1_CreateUserRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.CreateUserRequest.class, + com.google.showcase.v1beta1.CreateUserRequest.Builder.class); + } + + // Construct using com.google.showcase.v1beta1.CreateUserRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (userBuilder_ == null) { + user_ = null; + } else { + user_ = null; + userBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.showcase.v1beta1.IdentityOuterClass + .internal_static_google_showcase_v1beta1_CreateUserRequest_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.CreateUserRequest getDefaultInstanceForType() { + return com.google.showcase.v1beta1.CreateUserRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.CreateUserRequest build() { + com.google.showcase.v1beta1.CreateUserRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.CreateUserRequest buildPartial() { + com.google.showcase.v1beta1.CreateUserRequest result = + new com.google.showcase.v1beta1.CreateUserRequest(this); + if (userBuilder_ == null) { + result.user_ = user_; + } else { + result.user_ = userBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.showcase.v1beta1.CreateUserRequest) { + return mergeFrom((com.google.showcase.v1beta1.CreateUserRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.showcase.v1beta1.CreateUserRequest other) { + if (other == com.google.showcase.v1beta1.CreateUserRequest.getDefaultInstance()) return this; + if (other.hasUser()) { + mergeUser(other.getUser()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.showcase.v1beta1.CreateUserRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.showcase.v1beta1.CreateUserRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private com.google.showcase.v1beta1.User user_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.showcase.v1beta1.User, + com.google.showcase.v1beta1.User.Builder, + com.google.showcase.v1beta1.UserOrBuilder> + userBuilder_; + + /** + * + * + *
        +     * The user to create.
        +     * 
        + * + * .google.showcase.v1beta1.User user = 1; + * + * @return Whether the user field is set. + */ + public boolean hasUser() { + return userBuilder_ != null || user_ != null; + } + + /** + * + * + *
        +     * The user to create.
        +     * 
        + * + * .google.showcase.v1beta1.User user = 1; + * + * @return The user. + */ + public com.google.showcase.v1beta1.User getUser() { + if (userBuilder_ == null) { + return user_ == null ? com.google.showcase.v1beta1.User.getDefaultInstance() : user_; + } else { + return userBuilder_.getMessage(); + } + } + + /** + * + * + *
        +     * The user to create.
        +     * 
        + * + * .google.showcase.v1beta1.User user = 1; + */ + public Builder setUser(com.google.showcase.v1beta1.User value) { + if (userBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + user_ = value; + onChanged(); + } else { + userBuilder_.setMessage(value); + } + + return this; + } + + /** + * + * + *
        +     * The user to create.
        +     * 
        + * + * .google.showcase.v1beta1.User user = 1; + */ + public Builder setUser(com.google.showcase.v1beta1.User.Builder builderForValue) { + if (userBuilder_ == null) { + user_ = builderForValue.build(); + onChanged(); + } else { + userBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + + /** + * + * + *
        +     * The user to create.
        +     * 
        + * + * .google.showcase.v1beta1.User user = 1; + */ + public Builder mergeUser(com.google.showcase.v1beta1.User value) { + if (userBuilder_ == null) { + if (user_ != null) { + user_ = + com.google.showcase.v1beta1.User.newBuilder(user_).mergeFrom(value).buildPartial(); + } else { + user_ = value; + } + onChanged(); + } else { + userBuilder_.mergeFrom(value); + } + + return this; + } + + /** + * + * + *
        +     * The user to create.
        +     * 
        + * + * .google.showcase.v1beta1.User user = 1; + */ + public Builder clearUser() { + if (userBuilder_ == null) { + user_ = null; + onChanged(); + } else { + user_ = null; + userBuilder_ = null; + } + + return this; + } + + /** + * + * + *
        +     * The user to create.
        +     * 
        + * + * .google.showcase.v1beta1.User user = 1; + */ + public com.google.showcase.v1beta1.User.Builder getUserBuilder() { + + onChanged(); + return getUserFieldBuilder().getBuilder(); + } + + /** + * + * + *
        +     * The user to create.
        +     * 
        + * + * .google.showcase.v1beta1.User user = 1; + */ + public com.google.showcase.v1beta1.UserOrBuilder getUserOrBuilder() { + if (userBuilder_ != null) { + return userBuilder_.getMessageOrBuilder(); + } else { + return user_ == null ? com.google.showcase.v1beta1.User.getDefaultInstance() : user_; + } + } + + /** + * + * + *
        +     * The user to create.
        +     * 
        + * + * .google.showcase.v1beta1.User user = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.showcase.v1beta1.User, + com.google.showcase.v1beta1.User.Builder, + com.google.showcase.v1beta1.UserOrBuilder> + getUserFieldBuilder() { + if (userBuilder_ == null) { + userBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.showcase.v1beta1.User, + com.google.showcase.v1beta1.User.Builder, + com.google.showcase.v1beta1.UserOrBuilder>( + getUser(), getParentForChildren(), isClean()); + user_ = null; + } + return userBuilder_; + } + + @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.showcase.v1beta1.CreateUserRequest) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.CreateUserRequest) + private static final com.google.showcase.v1beta1.CreateUserRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.CreateUserRequest(); + } + + public static com.google.showcase.v1beta1.CreateUserRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CreateUserRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new CreateUserRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.showcase.v1beta1.CreateUserRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/CreateUserRequestOrBuilder.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/CreateUserRequestOrBuilder.java new file mode 100644 index 0000000000..d33fee565d --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/CreateUserRequestOrBuilder.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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/identity.proto + +package com.google.showcase.v1beta1; + +public interface CreateUserRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.CreateUserRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
        +   * The user to create.
        +   * 
        + * + * .google.showcase.v1beta1.User user = 1; + * + * @return Whether the user field is set. + */ + boolean hasUser(); + + /** + * + * + *
        +   * The user to create.
        +   * 
        + * + * .google.showcase.v1beta1.User user = 1; + * + * @return The user. + */ + com.google.showcase.v1beta1.User getUser(); + + /** + * + * + *
        +   * The user to create.
        +   * 
        + * + * .google.showcase.v1beta1.User user = 1; + */ + com.google.showcase.v1beta1.UserOrBuilder getUserOrBuilder(); +} diff --git a/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/DeleteBlurbRequest.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/DeleteBlurbRequest.java new file mode 100644 index 0000000000..8ea6535496 --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/DeleteBlurbRequest.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: schema/google/showcase/v1beta1/messaging.proto + +package com.google.showcase.v1beta1; + +/** + * + * + *
        + * The request message for the google.showcase.v1beta1.Messaging\DeleteBlurb
        + * method.
        + * 
        + * + * Protobuf type {@code google.showcase.v1beta1.DeleteBlurbRequest} + */ +public final class DeleteBlurbRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.DeleteBlurbRequest) + DeleteBlurbRequestOrBuilder { + private static final long serialVersionUID = 0L; + + // Use DeleteBlurbRequest.newBuilder() to construct. + private DeleteBlurbRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private DeleteBlurbRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new DeleteBlurbRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private DeleteBlurbRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.MessagingOuterClass + .internal_static_google_showcase_v1beta1_DeleteBlurbRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.MessagingOuterClass + .internal_static_google_showcase_v1beta1_DeleteBlurbRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.DeleteBlurbRequest.class, + com.google.showcase.v1beta1.DeleteBlurbRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + + /** + * + * + *
        +   * The resource name of the requested blurb.
        +   * 
        + * + * + * 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; + } + } + + /** + * + * + *
        +   * The resource name of the requested blurb.
        +   * 
        + * + * + * 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_); + } + unknownFields.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 += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.showcase.v1beta1.DeleteBlurbRequest)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.DeleteBlurbRequest other = + (com.google.showcase.v1beta1.DeleteBlurbRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.showcase.v1beta1.DeleteBlurbRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.DeleteBlurbRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.DeleteBlurbRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.DeleteBlurbRequest 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.showcase.v1beta1.DeleteBlurbRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.DeleteBlurbRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.DeleteBlurbRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.DeleteBlurbRequest 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.showcase.v1beta1.DeleteBlurbRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.DeleteBlurbRequest 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.showcase.v1beta1.DeleteBlurbRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.DeleteBlurbRequest 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.showcase.v1beta1.DeleteBlurbRequest 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 request message for the google.showcase.v1beta1.Messaging\DeleteBlurb
        +   * method.
        +   * 
        + * + * Protobuf type {@code google.showcase.v1beta1.DeleteBlurbRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.DeleteBlurbRequest) + com.google.showcase.v1beta1.DeleteBlurbRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.MessagingOuterClass + .internal_static_google_showcase_v1beta1_DeleteBlurbRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.MessagingOuterClass + .internal_static_google_showcase_v1beta1_DeleteBlurbRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.DeleteBlurbRequest.class, + com.google.showcase.v1beta1.DeleteBlurbRequest.Builder.class); + } + + // Construct using com.google.showcase.v1beta1.DeleteBlurbRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.showcase.v1beta1.MessagingOuterClass + .internal_static_google_showcase_v1beta1_DeleteBlurbRequest_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.DeleteBlurbRequest getDefaultInstanceForType() { + return com.google.showcase.v1beta1.DeleteBlurbRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.DeleteBlurbRequest build() { + com.google.showcase.v1beta1.DeleteBlurbRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.DeleteBlurbRequest buildPartial() { + com.google.showcase.v1beta1.DeleteBlurbRequest result = + new com.google.showcase.v1beta1.DeleteBlurbRequest(this); + result.name_ = name_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.showcase.v1beta1.DeleteBlurbRequest) { + return mergeFrom((com.google.showcase.v1beta1.DeleteBlurbRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.showcase.v1beta1.DeleteBlurbRequest other) { + if (other == com.google.showcase.v1beta1.DeleteBlurbRequest.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.showcase.v1beta1.DeleteBlurbRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.showcase.v1beta1.DeleteBlurbRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + + /** + * + * + *
        +     * The resource name of the requested blurb.
        +     * 
        + * + * + * 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; + } + } + + /** + * + * + *
        +     * The resource name of the requested blurb.
        +     * 
        + * + * + * 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; + } + } + + /** + * + * + *
        +     * The resource name of the requested blurb.
        +     * 
        + * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + + /** + * + * + *
        +     * The resource name of the requested blurb.
        +     * 
        + * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + + /** + * + * + *
        +     * The resource name of the requested blurb.
        +     * 
        + * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.showcase.v1beta1.DeleteBlurbRequest) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.DeleteBlurbRequest) + private static final com.google.showcase.v1beta1.DeleteBlurbRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.DeleteBlurbRequest(); + } + + public static com.google.showcase.v1beta1.DeleteBlurbRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DeleteBlurbRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new DeleteBlurbRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.showcase.v1beta1.DeleteBlurbRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/DeleteBlurbRequestOrBuilder.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/DeleteBlurbRequestOrBuilder.java new file mode 100644 index 0000000000..6a512694ee --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/DeleteBlurbRequestOrBuilder.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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/messaging.proto + +package com.google.showcase.v1beta1; + +public interface DeleteBlurbRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.DeleteBlurbRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
        +   * The resource name of the requested blurb.
        +   * 
        + * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + + /** + * + * + *
        +   * The resource name of the requested blurb.
        +   * 
        + * + * + * 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-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/DeleteRoomRequest.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/DeleteRoomRequest.java new file mode 100644 index 0000000000..fdc7728a40 --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/DeleteRoomRequest.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: schema/google/showcase/v1beta1/messaging.proto + +package com.google.showcase.v1beta1; + +/** + * + * + *
        + * The request message for the google.showcase.v1beta1.Messaging\DeleteRoom
        + * method.
        + * 
        + * + * Protobuf type {@code google.showcase.v1beta1.DeleteRoomRequest} + */ +public final class DeleteRoomRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.DeleteRoomRequest) + DeleteRoomRequestOrBuilder { + private static final long serialVersionUID = 0L; + + // Use DeleteRoomRequest.newBuilder() to construct. + private DeleteRoomRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private DeleteRoomRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new DeleteRoomRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private DeleteRoomRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.MessagingOuterClass + .internal_static_google_showcase_v1beta1_DeleteRoomRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.MessagingOuterClass + .internal_static_google_showcase_v1beta1_DeleteRoomRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.DeleteRoomRequest.class, + com.google.showcase.v1beta1.DeleteRoomRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + + /** + * + * + *
        +   * The resource name of the requested room.
        +   * 
        + * + * + * 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; + } + } + + /** + * + * + *
        +   * The resource name of the requested room.
        +   * 
        + * + * + * 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_); + } + unknownFields.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 += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.showcase.v1beta1.DeleteRoomRequest)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.DeleteRoomRequest other = + (com.google.showcase.v1beta1.DeleteRoomRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.showcase.v1beta1.DeleteRoomRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.DeleteRoomRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.DeleteRoomRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.DeleteRoomRequest 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.showcase.v1beta1.DeleteRoomRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.DeleteRoomRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.DeleteRoomRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.DeleteRoomRequest 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.showcase.v1beta1.DeleteRoomRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.DeleteRoomRequest 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.showcase.v1beta1.DeleteRoomRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.DeleteRoomRequest 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.showcase.v1beta1.DeleteRoomRequest 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 request message for the google.showcase.v1beta1.Messaging\DeleteRoom
        +   * method.
        +   * 
        + * + * Protobuf type {@code google.showcase.v1beta1.DeleteRoomRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.DeleteRoomRequest) + com.google.showcase.v1beta1.DeleteRoomRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.MessagingOuterClass + .internal_static_google_showcase_v1beta1_DeleteRoomRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.MessagingOuterClass + .internal_static_google_showcase_v1beta1_DeleteRoomRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.DeleteRoomRequest.class, + com.google.showcase.v1beta1.DeleteRoomRequest.Builder.class); + } + + // Construct using com.google.showcase.v1beta1.DeleteRoomRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.showcase.v1beta1.MessagingOuterClass + .internal_static_google_showcase_v1beta1_DeleteRoomRequest_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.DeleteRoomRequest getDefaultInstanceForType() { + return com.google.showcase.v1beta1.DeleteRoomRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.DeleteRoomRequest build() { + com.google.showcase.v1beta1.DeleteRoomRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.DeleteRoomRequest buildPartial() { + com.google.showcase.v1beta1.DeleteRoomRequest result = + new com.google.showcase.v1beta1.DeleteRoomRequest(this); + result.name_ = name_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.showcase.v1beta1.DeleteRoomRequest) { + return mergeFrom((com.google.showcase.v1beta1.DeleteRoomRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.showcase.v1beta1.DeleteRoomRequest other) { + if (other == com.google.showcase.v1beta1.DeleteRoomRequest.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.showcase.v1beta1.DeleteRoomRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.showcase.v1beta1.DeleteRoomRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + + /** + * + * + *
        +     * The resource name of the requested room.
        +     * 
        + * + * + * 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; + } + } + + /** + * + * + *
        +     * The resource name of the requested room.
        +     * 
        + * + * + * 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; + } + } + + /** + * + * + *
        +     * The resource name of the requested room.
        +     * 
        + * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + + /** + * + * + *
        +     * The resource name of the requested room.
        +     * 
        + * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + + /** + * + * + *
        +     * The resource name of the requested room.
        +     * 
        + * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.showcase.v1beta1.DeleteRoomRequest) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.DeleteRoomRequest) + private static final com.google.showcase.v1beta1.DeleteRoomRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.DeleteRoomRequest(); + } + + public static com.google.showcase.v1beta1.DeleteRoomRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DeleteRoomRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new DeleteRoomRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.showcase.v1beta1.DeleteRoomRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/DeleteRoomRequestOrBuilder.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/DeleteRoomRequestOrBuilder.java new file mode 100644 index 0000000000..28767d0d0b --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/DeleteRoomRequestOrBuilder.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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/messaging.proto + +package com.google.showcase.v1beta1; + +public interface DeleteRoomRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.DeleteRoomRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
        +   * The resource name of the requested room.
        +   * 
        + * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + + /** + * + * + *
        +   * The resource name of the requested room.
        +   * 
        + * + * + * 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-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/DeleteSessionRequest.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/DeleteSessionRequest.java new file mode 100644 index 0000000000..28372c3544 --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/DeleteSessionRequest.java @@ -0,0 +1,646 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/testing.proto + +package com.google.showcase.v1beta1; + +/** + * + * + *
        + * Request for the DeleteSession method.
        + * 
        + * + * Protobuf type {@code google.showcase.v1beta1.DeleteSessionRequest} + */ +public final class DeleteSessionRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.DeleteSessionRequest) + DeleteSessionRequestOrBuilder { + private static final long serialVersionUID = 0L; + + // Use DeleteSessionRequest.newBuilder() to construct. + private DeleteSessionRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private DeleteSessionRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new DeleteSessionRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private DeleteSessionRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.TestingOuterClass + .internal_static_google_showcase_v1beta1_DeleteSessionRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.TestingOuterClass + .internal_static_google_showcase_v1beta1_DeleteSessionRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.DeleteSessionRequest.class, + com.google.showcase.v1beta1.DeleteSessionRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + + /** + * + * + *
        +   * The session to be deleted.
        +   * 
        + * + * string name = 1 [(.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; + } + } + + /** + * + * + *
        +   * The session to be deleted.
        +   * 
        + * + * string name = 1 [(.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_); + } + unknownFields.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 += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.showcase.v1beta1.DeleteSessionRequest)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.DeleteSessionRequest other = + (com.google.showcase.v1beta1.DeleteSessionRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.showcase.v1beta1.DeleteSessionRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.DeleteSessionRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.DeleteSessionRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.DeleteSessionRequest 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.showcase.v1beta1.DeleteSessionRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.DeleteSessionRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.DeleteSessionRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.DeleteSessionRequest 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.showcase.v1beta1.DeleteSessionRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.DeleteSessionRequest 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.showcase.v1beta1.DeleteSessionRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.DeleteSessionRequest 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.showcase.v1beta1.DeleteSessionRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
        +   * Request for the DeleteSession method.
        +   * 
        + * + * Protobuf type {@code google.showcase.v1beta1.DeleteSessionRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.DeleteSessionRequest) + com.google.showcase.v1beta1.DeleteSessionRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.TestingOuterClass + .internal_static_google_showcase_v1beta1_DeleteSessionRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.TestingOuterClass + .internal_static_google_showcase_v1beta1_DeleteSessionRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.DeleteSessionRequest.class, + com.google.showcase.v1beta1.DeleteSessionRequest.Builder.class); + } + + // Construct using com.google.showcase.v1beta1.DeleteSessionRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.showcase.v1beta1.TestingOuterClass + .internal_static_google_showcase_v1beta1_DeleteSessionRequest_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.DeleteSessionRequest getDefaultInstanceForType() { + return com.google.showcase.v1beta1.DeleteSessionRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.DeleteSessionRequest build() { + com.google.showcase.v1beta1.DeleteSessionRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.DeleteSessionRequest buildPartial() { + com.google.showcase.v1beta1.DeleteSessionRequest result = + new com.google.showcase.v1beta1.DeleteSessionRequest(this); + result.name_ = name_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.showcase.v1beta1.DeleteSessionRequest) { + return mergeFrom((com.google.showcase.v1beta1.DeleteSessionRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.showcase.v1beta1.DeleteSessionRequest other) { + if (other == com.google.showcase.v1beta1.DeleteSessionRequest.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.showcase.v1beta1.DeleteSessionRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.showcase.v1beta1.DeleteSessionRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + + /** + * + * + *
        +     * The session to be deleted.
        +     * 
        + * + * string name = 1 [(.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; + } + } + + /** + * + * + *
        +     * The session to be deleted.
        +     * 
        + * + * string name = 1 [(.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; + } + } + + /** + * + * + *
        +     * The session to be deleted.
        +     * 
        + * + * string name = 1 [(.google.api.resource_reference) = { ... } + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + + /** + * + * + *
        +     * The session to be deleted.
        +     * 
        + * + * string name = 1 [(.google.api.resource_reference) = { ... } + * + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + + /** + * + * + *
        +     * The session to be deleted.
        +     * 
        + * + * string name = 1 [(.google.api.resource_reference) = { ... } + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.showcase.v1beta1.DeleteSessionRequest) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.DeleteSessionRequest) + private static final com.google.showcase.v1beta1.DeleteSessionRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.DeleteSessionRequest(); + } + + public static com.google.showcase.v1beta1.DeleteSessionRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DeleteSessionRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new DeleteSessionRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.showcase.v1beta1.DeleteSessionRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/DeleteSessionRequestOrBuilder.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/DeleteSessionRequestOrBuilder.java new file mode 100644 index 0000000000..c64c0e3f26 --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/DeleteSessionRequestOrBuilder.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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/testing.proto + +package com.google.showcase.v1beta1; + +public interface DeleteSessionRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.DeleteSessionRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
        +   * The session to be deleted.
        +   * 
        + * + * string name = 1 [(.google.api.resource_reference) = { ... } + * + * @return The name. + */ + java.lang.String getName(); + + /** + * + * + *
        +   * The session to be deleted.
        +   * 
        + * + * string name = 1 [(.google.api.resource_reference) = { ... } + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); +} diff --git a/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/DeleteTestRequest.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/DeleteTestRequest.java new file mode 100644 index 0000000000..fc7e9645f7 --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/DeleteTestRequest.java @@ -0,0 +1,645 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/testing.proto + +package com.google.showcase.v1beta1; + +/** + * + * + *
        + * Request message for deleting a test.
        + * 
        + * + * Protobuf type {@code google.showcase.v1beta1.DeleteTestRequest} + */ +public final class DeleteTestRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.DeleteTestRequest) + DeleteTestRequestOrBuilder { + private static final long serialVersionUID = 0L; + + // Use DeleteTestRequest.newBuilder() to construct. + private DeleteTestRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private DeleteTestRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new DeleteTestRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private DeleteTestRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.TestingOuterClass + .internal_static_google_showcase_v1beta1_DeleteTestRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.TestingOuterClass + .internal_static_google_showcase_v1beta1_DeleteTestRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.DeleteTestRequest.class, + com.google.showcase.v1beta1.DeleteTestRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + + /** + * + * + *
        +   * The test to be deleted.
        +   * 
        + * + * string name = 1 [(.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; + } + } + + /** + * + * + *
        +   * The test to be deleted.
        +   * 
        + * + * string name = 1 [(.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_); + } + unknownFields.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 += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.showcase.v1beta1.DeleteTestRequest)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.DeleteTestRequest other = + (com.google.showcase.v1beta1.DeleteTestRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.showcase.v1beta1.DeleteTestRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.DeleteTestRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.DeleteTestRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.DeleteTestRequest 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.showcase.v1beta1.DeleteTestRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.DeleteTestRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.DeleteTestRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.DeleteTestRequest 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.showcase.v1beta1.DeleteTestRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.DeleteTestRequest 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.showcase.v1beta1.DeleteTestRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.DeleteTestRequest 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.showcase.v1beta1.DeleteTestRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
        +   * Request message for deleting a test.
        +   * 
        + * + * Protobuf type {@code google.showcase.v1beta1.DeleteTestRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.DeleteTestRequest) + com.google.showcase.v1beta1.DeleteTestRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.TestingOuterClass + .internal_static_google_showcase_v1beta1_DeleteTestRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.TestingOuterClass + .internal_static_google_showcase_v1beta1_DeleteTestRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.DeleteTestRequest.class, + com.google.showcase.v1beta1.DeleteTestRequest.Builder.class); + } + + // Construct using com.google.showcase.v1beta1.DeleteTestRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.showcase.v1beta1.TestingOuterClass + .internal_static_google_showcase_v1beta1_DeleteTestRequest_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.DeleteTestRequest getDefaultInstanceForType() { + return com.google.showcase.v1beta1.DeleteTestRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.DeleteTestRequest build() { + com.google.showcase.v1beta1.DeleteTestRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.DeleteTestRequest buildPartial() { + com.google.showcase.v1beta1.DeleteTestRequest result = + new com.google.showcase.v1beta1.DeleteTestRequest(this); + result.name_ = name_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.showcase.v1beta1.DeleteTestRequest) { + return mergeFrom((com.google.showcase.v1beta1.DeleteTestRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.showcase.v1beta1.DeleteTestRequest other) { + if (other == com.google.showcase.v1beta1.DeleteTestRequest.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.showcase.v1beta1.DeleteTestRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.showcase.v1beta1.DeleteTestRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + + /** + * + * + *
        +     * The test to be deleted.
        +     * 
        + * + * string name = 1 [(.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; + } + } + + /** + * + * + *
        +     * The test to be deleted.
        +     * 
        + * + * string name = 1 [(.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; + } + } + + /** + * + * + *
        +     * The test to be deleted.
        +     * 
        + * + * string name = 1 [(.google.api.resource_reference) = { ... } + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + + /** + * + * + *
        +     * The test to be deleted.
        +     * 
        + * + * string name = 1 [(.google.api.resource_reference) = { ... } + * + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + + /** + * + * + *
        +     * The test to be deleted.
        +     * 
        + * + * string name = 1 [(.google.api.resource_reference) = { ... } + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.showcase.v1beta1.DeleteTestRequest) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.DeleteTestRequest) + private static final com.google.showcase.v1beta1.DeleteTestRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.DeleteTestRequest(); + } + + public static com.google.showcase.v1beta1.DeleteTestRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DeleteTestRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new DeleteTestRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.showcase.v1beta1.DeleteTestRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/DeleteTestRequestOrBuilder.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/DeleteTestRequestOrBuilder.java new file mode 100644 index 0000000000..f40d9e8ae2 --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/DeleteTestRequestOrBuilder.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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/testing.proto + +package com.google.showcase.v1beta1; + +public interface DeleteTestRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.DeleteTestRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
        +   * The test to be deleted.
        +   * 
        + * + * string name = 1 [(.google.api.resource_reference) = { ... } + * + * @return The name. + */ + java.lang.String getName(); + + /** + * + * + *
        +   * The test to be deleted.
        +   * 
        + * + * string name = 1 [(.google.api.resource_reference) = { ... } + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); +} diff --git a/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/DeleteUserRequest.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/DeleteUserRequest.java new file mode 100644 index 0000000000..a150ee2378 --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/DeleteUserRequest.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: schema/google/showcase/v1beta1/identity.proto + +package com.google.showcase.v1beta1; + +/** + * + * + *
        + * The request message for the google.showcase.v1beta1.Identity\DeleteUser
        + * method.
        + * 
        + * + * Protobuf type {@code google.showcase.v1beta1.DeleteUserRequest} + */ +public final class DeleteUserRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.DeleteUserRequest) + DeleteUserRequestOrBuilder { + private static final long serialVersionUID = 0L; + + // Use DeleteUserRequest.newBuilder() to construct. + private DeleteUserRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private DeleteUserRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new DeleteUserRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private DeleteUserRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.IdentityOuterClass + .internal_static_google_showcase_v1beta1_DeleteUserRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.IdentityOuterClass + .internal_static_google_showcase_v1beta1_DeleteUserRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.DeleteUserRequest.class, + com.google.showcase.v1beta1.DeleteUserRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + + /** + * + * + *
        +   * The resource name of the user to delete.
        +   * 
        + * + * + * 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; + } + } + + /** + * + * + *
        +   * The resource name of the user to delete.
        +   * 
        + * + * + * 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_); + } + unknownFields.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 += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.showcase.v1beta1.DeleteUserRequest)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.DeleteUserRequest other = + (com.google.showcase.v1beta1.DeleteUserRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.showcase.v1beta1.DeleteUserRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.DeleteUserRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.DeleteUserRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.DeleteUserRequest 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.showcase.v1beta1.DeleteUserRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.DeleteUserRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.DeleteUserRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.DeleteUserRequest 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.showcase.v1beta1.DeleteUserRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.DeleteUserRequest 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.showcase.v1beta1.DeleteUserRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.DeleteUserRequest 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.showcase.v1beta1.DeleteUserRequest 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 request message for the google.showcase.v1beta1.Identity\DeleteUser
        +   * method.
        +   * 
        + * + * Protobuf type {@code google.showcase.v1beta1.DeleteUserRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.DeleteUserRequest) + com.google.showcase.v1beta1.DeleteUserRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.IdentityOuterClass + .internal_static_google_showcase_v1beta1_DeleteUserRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.IdentityOuterClass + .internal_static_google_showcase_v1beta1_DeleteUserRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.DeleteUserRequest.class, + com.google.showcase.v1beta1.DeleteUserRequest.Builder.class); + } + + // Construct using com.google.showcase.v1beta1.DeleteUserRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.showcase.v1beta1.IdentityOuterClass + .internal_static_google_showcase_v1beta1_DeleteUserRequest_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.DeleteUserRequest getDefaultInstanceForType() { + return com.google.showcase.v1beta1.DeleteUserRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.DeleteUserRequest build() { + com.google.showcase.v1beta1.DeleteUserRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.DeleteUserRequest buildPartial() { + com.google.showcase.v1beta1.DeleteUserRequest result = + new com.google.showcase.v1beta1.DeleteUserRequest(this); + result.name_ = name_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.showcase.v1beta1.DeleteUserRequest) { + return mergeFrom((com.google.showcase.v1beta1.DeleteUserRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.showcase.v1beta1.DeleteUserRequest other) { + if (other == com.google.showcase.v1beta1.DeleteUserRequest.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.showcase.v1beta1.DeleteUserRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.showcase.v1beta1.DeleteUserRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + + /** + * + * + *
        +     * The resource name of the user to delete.
        +     * 
        + * + * + * 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; + } + } + + /** + * + * + *
        +     * The resource name of the user to delete.
        +     * 
        + * + * + * 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; + } + } + + /** + * + * + *
        +     * The resource name of the user to delete.
        +     * 
        + * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + + /** + * + * + *
        +     * The resource name of the user to delete.
        +     * 
        + * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + + /** + * + * + *
        +     * The resource name of the user to delete.
        +     * 
        + * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.showcase.v1beta1.DeleteUserRequest) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.DeleteUserRequest) + private static final com.google.showcase.v1beta1.DeleteUserRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.DeleteUserRequest(); + } + + public static com.google.showcase.v1beta1.DeleteUserRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DeleteUserRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new DeleteUserRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.showcase.v1beta1.DeleteUserRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/DeleteUserRequestOrBuilder.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/DeleteUserRequestOrBuilder.java new file mode 100644 index 0000000000..ec8973af2f --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/DeleteUserRequestOrBuilder.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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/identity.proto + +package com.google.showcase.v1beta1; + +public interface DeleteUserRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.DeleteUserRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
        +   * The resource name of the user to delete.
        +   * 
        + * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + + /** + * + * + *
        +   * The resource name of the user to delete.
        +   * 
        + * + * + * 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-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/EchoErrorDetailsRequest.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/EchoErrorDetailsRequest.java new file mode 100644 index 0000000000..54b686e83c --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/EchoErrorDetailsRequest.java @@ -0,0 +1,960 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/echo.proto + +package com.google.showcase.v1beta1; + +/** + * + * + *
        + * The request message used for the EchoErrorDetails method.
        + * 
        + * + * Protobuf type {@code google.showcase.v1beta1.EchoErrorDetailsRequest} + */ +public final class EchoErrorDetailsRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.EchoErrorDetailsRequest) + EchoErrorDetailsRequestOrBuilder { + private static final long serialVersionUID = 0L; + + // Use EchoErrorDetailsRequest.newBuilder() to construct. + private EchoErrorDetailsRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private EchoErrorDetailsRequest() { + singleDetailText_ = ""; + multiDetailText_ = com.google.protobuf.LazyStringArrayList.EMPTY; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new EchoErrorDetailsRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private EchoErrorDetailsRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + singleDetailText_ = s; + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + multiDetailText_ = new com.google.protobuf.LazyStringArrayList(); + mutable_bitField0_ |= 0x00000001; + } + multiDetailText_.add(s); + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + multiDetailText_ = multiDetailText_.getUnmodifiableView(); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.EchoOuterClass + .internal_static_google_showcase_v1beta1_EchoErrorDetailsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.EchoOuterClass + .internal_static_google_showcase_v1beta1_EchoErrorDetailsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.EchoErrorDetailsRequest.class, + com.google.showcase.v1beta1.EchoErrorDetailsRequest.Builder.class); + } + + public static final int SINGLE_DETAIL_TEXT_FIELD_NUMBER = 1; + private volatile java.lang.Object singleDetailText_; + + /** + * + * + *
        +   * Content to return in a singular `*.error.details` field of type
        +   * `google.protobuf.Any`
        +   * 
        + * + * string single_detail_text = 1; + * + * @return The singleDetailText. + */ + @java.lang.Override + public java.lang.String getSingleDetailText() { + java.lang.Object ref = singleDetailText_; + 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(); + singleDetailText_ = s; + return s; + } + } + + /** + * + * + *
        +   * Content to return in a singular `*.error.details` field of type
        +   * `google.protobuf.Any`
        +   * 
        + * + * string single_detail_text = 1; + * + * @return The bytes for singleDetailText. + */ + @java.lang.Override + public com.google.protobuf.ByteString getSingleDetailTextBytes() { + java.lang.Object ref = singleDetailText_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + singleDetailText_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int MULTI_DETAIL_TEXT_FIELD_NUMBER = 2; + private com.google.protobuf.LazyStringList multiDetailText_; + + /** + * + * + *
        +   * Content to return in a repeated `*.error.details` field of type
        +   * `google.protobuf.Any`
        +   * 
        + * + * repeated string multi_detail_text = 2; + * + * @return A list containing the multiDetailText. + */ + public com.google.protobuf.ProtocolStringList getMultiDetailTextList() { + return multiDetailText_; + } + + /** + * + * + *
        +   * Content to return in a repeated `*.error.details` field of type
        +   * `google.protobuf.Any`
        +   * 
        + * + * repeated string multi_detail_text = 2; + * + * @return The count of multiDetailText. + */ + public int getMultiDetailTextCount() { + return multiDetailText_.size(); + } + + /** + * + * + *
        +   * Content to return in a repeated `*.error.details` field of type
        +   * `google.protobuf.Any`
        +   * 
        + * + * repeated string multi_detail_text = 2; + * + * @param index The index of the element to return. + * @return The multiDetailText at the given index. + */ + public java.lang.String getMultiDetailText(int index) { + return multiDetailText_.get(index); + } + + /** + * + * + *
        +   * Content to return in a repeated `*.error.details` field of type
        +   * `google.protobuf.Any`
        +   * 
        + * + * repeated string multi_detail_text = 2; + * + * @param index The index of the value to return. + * @return The bytes of the multiDetailText at the given index. + */ + public com.google.protobuf.ByteString getMultiDetailTextBytes(int index) { + return multiDetailText_.getByteString(index); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(singleDetailText_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, singleDetailText_); + } + for (int i = 0; i < multiDetailText_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, multiDetailText_.getRaw(i)); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(singleDetailText_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, singleDetailText_); + } + { + int dataSize = 0; + for (int i = 0; i < multiDetailText_.size(); i++) { + dataSize += computeStringSizeNoTag(multiDetailText_.getRaw(i)); + } + size += dataSize; + size += 1 * getMultiDetailTextList().size(); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.showcase.v1beta1.EchoErrorDetailsRequest)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.EchoErrorDetailsRequest other = + (com.google.showcase.v1beta1.EchoErrorDetailsRequest) obj; + + if (!getSingleDetailText().equals(other.getSingleDetailText())) return false; + if (!getMultiDetailTextList().equals(other.getMultiDetailTextList())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + SINGLE_DETAIL_TEXT_FIELD_NUMBER; + hash = (53 * hash) + getSingleDetailText().hashCode(); + if (getMultiDetailTextCount() > 0) { + hash = (37 * hash) + MULTI_DETAIL_TEXT_FIELD_NUMBER; + hash = (53 * hash) + getMultiDetailTextList().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.showcase.v1beta1.EchoErrorDetailsRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.EchoErrorDetailsRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.EchoErrorDetailsRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.EchoErrorDetailsRequest 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.showcase.v1beta1.EchoErrorDetailsRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.EchoErrorDetailsRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.EchoErrorDetailsRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.EchoErrorDetailsRequest 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.showcase.v1beta1.EchoErrorDetailsRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.EchoErrorDetailsRequest 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.showcase.v1beta1.EchoErrorDetailsRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.EchoErrorDetailsRequest 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.showcase.v1beta1.EchoErrorDetailsRequest 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 request message used for the EchoErrorDetails method.
        +   * 
        + * + * Protobuf type {@code google.showcase.v1beta1.EchoErrorDetailsRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.EchoErrorDetailsRequest) + com.google.showcase.v1beta1.EchoErrorDetailsRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.EchoOuterClass + .internal_static_google_showcase_v1beta1_EchoErrorDetailsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.EchoOuterClass + .internal_static_google_showcase_v1beta1_EchoErrorDetailsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.EchoErrorDetailsRequest.class, + com.google.showcase.v1beta1.EchoErrorDetailsRequest.Builder.class); + } + + // Construct using com.google.showcase.v1beta1.EchoErrorDetailsRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + singleDetailText_ = ""; + + multiDetailText_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000001); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.showcase.v1beta1.EchoOuterClass + .internal_static_google_showcase_v1beta1_EchoErrorDetailsRequest_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.EchoErrorDetailsRequest getDefaultInstanceForType() { + return com.google.showcase.v1beta1.EchoErrorDetailsRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.EchoErrorDetailsRequest build() { + com.google.showcase.v1beta1.EchoErrorDetailsRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.EchoErrorDetailsRequest buildPartial() { + com.google.showcase.v1beta1.EchoErrorDetailsRequest result = + new com.google.showcase.v1beta1.EchoErrorDetailsRequest(this); + int from_bitField0_ = bitField0_; + result.singleDetailText_ = singleDetailText_; + if (((bitField0_ & 0x00000001) != 0)) { + multiDetailText_ = multiDetailText_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.multiDetailText_ = multiDetailText_; + 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.showcase.v1beta1.EchoErrorDetailsRequest) { + return mergeFrom((com.google.showcase.v1beta1.EchoErrorDetailsRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.showcase.v1beta1.EchoErrorDetailsRequest other) { + if (other == com.google.showcase.v1beta1.EchoErrorDetailsRequest.getDefaultInstance()) + return this; + if (!other.getSingleDetailText().isEmpty()) { + singleDetailText_ = other.singleDetailText_; + onChanged(); + } + if (!other.multiDetailText_.isEmpty()) { + if (multiDetailText_.isEmpty()) { + multiDetailText_ = other.multiDetailText_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureMultiDetailTextIsMutable(); + multiDetailText_.addAll(other.multiDetailText_); + } + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.showcase.v1beta1.EchoErrorDetailsRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.showcase.v1beta1.EchoErrorDetailsRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.lang.Object singleDetailText_ = ""; + + /** + * + * + *
        +     * Content to return in a singular `*.error.details` field of type
        +     * `google.protobuf.Any`
        +     * 
        + * + * string single_detail_text = 1; + * + * @return The singleDetailText. + */ + public java.lang.String getSingleDetailText() { + java.lang.Object ref = singleDetailText_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + singleDetailText_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
        +     * Content to return in a singular `*.error.details` field of type
        +     * `google.protobuf.Any`
        +     * 
        + * + * string single_detail_text = 1; + * + * @return The bytes for singleDetailText. + */ + public com.google.protobuf.ByteString getSingleDetailTextBytes() { + java.lang.Object ref = singleDetailText_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + singleDetailText_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
        +     * Content to return in a singular `*.error.details` field of type
        +     * `google.protobuf.Any`
        +     * 
        + * + * string single_detail_text = 1; + * + * @param value The singleDetailText to set. + * @return This builder for chaining. + */ + public Builder setSingleDetailText(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + singleDetailText_ = value; + onChanged(); + return this; + } + + /** + * + * + *
        +     * Content to return in a singular `*.error.details` field of type
        +     * `google.protobuf.Any`
        +     * 
        + * + * string single_detail_text = 1; + * + * @return This builder for chaining. + */ + public Builder clearSingleDetailText() { + + singleDetailText_ = getDefaultInstance().getSingleDetailText(); + onChanged(); + return this; + } + + /** + * + * + *
        +     * Content to return in a singular `*.error.details` field of type
        +     * `google.protobuf.Any`
        +     * 
        + * + * string single_detail_text = 1; + * + * @param value The bytes for singleDetailText to set. + * @return This builder for chaining. + */ + public Builder setSingleDetailTextBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + singleDetailText_ = value; + onChanged(); + return this; + } + + private com.google.protobuf.LazyStringList multiDetailText_ = + com.google.protobuf.LazyStringArrayList.EMPTY; + + private void ensureMultiDetailTextIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + multiDetailText_ = new com.google.protobuf.LazyStringArrayList(multiDetailText_); + bitField0_ |= 0x00000001; + } + } + + /** + * + * + *
        +     * Content to return in a repeated `*.error.details` field of type
        +     * `google.protobuf.Any`
        +     * 
        + * + * repeated string multi_detail_text = 2; + * + * @return A list containing the multiDetailText. + */ + public com.google.protobuf.ProtocolStringList getMultiDetailTextList() { + return multiDetailText_.getUnmodifiableView(); + } + + /** + * + * + *
        +     * Content to return in a repeated `*.error.details` field of type
        +     * `google.protobuf.Any`
        +     * 
        + * + * repeated string multi_detail_text = 2; + * + * @return The count of multiDetailText. + */ + public int getMultiDetailTextCount() { + return multiDetailText_.size(); + } + + /** + * + * + *
        +     * Content to return in a repeated `*.error.details` field of type
        +     * `google.protobuf.Any`
        +     * 
        + * + * repeated string multi_detail_text = 2; + * + * @param index The index of the element to return. + * @return The multiDetailText at the given index. + */ + public java.lang.String getMultiDetailText(int index) { + return multiDetailText_.get(index); + } + + /** + * + * + *
        +     * Content to return in a repeated `*.error.details` field of type
        +     * `google.protobuf.Any`
        +     * 
        + * + * repeated string multi_detail_text = 2; + * + * @param index The index of the value to return. + * @return The bytes of the multiDetailText at the given index. + */ + public com.google.protobuf.ByteString getMultiDetailTextBytes(int index) { + return multiDetailText_.getByteString(index); + } + + /** + * + * + *
        +     * Content to return in a repeated `*.error.details` field of type
        +     * `google.protobuf.Any`
        +     * 
        + * + * repeated string multi_detail_text = 2; + * + * @param index The index to set the value at. + * @param value The multiDetailText to set. + * @return This builder for chaining. + */ + public Builder setMultiDetailText(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureMultiDetailTextIsMutable(); + multiDetailText_.set(index, value); + onChanged(); + return this; + } + + /** + * + * + *
        +     * Content to return in a repeated `*.error.details` field of type
        +     * `google.protobuf.Any`
        +     * 
        + * + * repeated string multi_detail_text = 2; + * + * @param value The multiDetailText to add. + * @return This builder for chaining. + */ + public Builder addMultiDetailText(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureMultiDetailTextIsMutable(); + multiDetailText_.add(value); + onChanged(); + return this; + } + + /** + * + * + *
        +     * Content to return in a repeated `*.error.details` field of type
        +     * `google.protobuf.Any`
        +     * 
        + * + * repeated string multi_detail_text = 2; + * + * @param values The multiDetailText to add. + * @return This builder for chaining. + */ + public Builder addAllMultiDetailText(java.lang.Iterable values) { + ensureMultiDetailTextIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, multiDetailText_); + onChanged(); + return this; + } + + /** + * + * + *
        +     * Content to return in a repeated `*.error.details` field of type
        +     * `google.protobuf.Any`
        +     * 
        + * + * repeated string multi_detail_text = 2; + * + * @return This builder for chaining. + */ + public Builder clearMultiDetailText() { + multiDetailText_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
        +     * Content to return in a repeated `*.error.details` field of type
        +     * `google.protobuf.Any`
        +     * 
        + * + * repeated string multi_detail_text = 2; + * + * @param value The bytes of the multiDetailText to add. + * @return This builder for chaining. + */ + public Builder addMultiDetailTextBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureMultiDetailTextIsMutable(); + multiDetailText_.add(value); + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.showcase.v1beta1.EchoErrorDetailsRequest) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.EchoErrorDetailsRequest) + private static final com.google.showcase.v1beta1.EchoErrorDetailsRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.EchoErrorDetailsRequest(); + } + + public static com.google.showcase.v1beta1.EchoErrorDetailsRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public EchoErrorDetailsRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new EchoErrorDetailsRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.showcase.v1beta1.EchoErrorDetailsRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/EchoErrorDetailsRequestOrBuilder.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/EchoErrorDetailsRequestOrBuilder.java new file mode 100644 index 0000000000..b104dfa891 --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/EchoErrorDetailsRequestOrBuilder.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: schema/google/showcase/v1beta1/echo.proto + +package com.google.showcase.v1beta1; + +public interface EchoErrorDetailsRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.EchoErrorDetailsRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
        +   * Content to return in a singular `*.error.details` field of type
        +   * `google.protobuf.Any`
        +   * 
        + * + * string single_detail_text = 1; + * + * @return The singleDetailText. + */ + java.lang.String getSingleDetailText(); + + /** + * + * + *
        +   * Content to return in a singular `*.error.details` field of type
        +   * `google.protobuf.Any`
        +   * 
        + * + * string single_detail_text = 1; + * + * @return The bytes for singleDetailText. + */ + com.google.protobuf.ByteString getSingleDetailTextBytes(); + + /** + * + * + *
        +   * Content to return in a repeated `*.error.details` field of type
        +   * `google.protobuf.Any`
        +   * 
        + * + * repeated string multi_detail_text = 2; + * + * @return A list containing the multiDetailText. + */ + java.util.List getMultiDetailTextList(); + + /** + * + * + *
        +   * Content to return in a repeated `*.error.details` field of type
        +   * `google.protobuf.Any`
        +   * 
        + * + * repeated string multi_detail_text = 2; + * + * @return The count of multiDetailText. + */ + int getMultiDetailTextCount(); + + /** + * + * + *
        +   * Content to return in a repeated `*.error.details` field of type
        +   * `google.protobuf.Any`
        +   * 
        + * + * repeated string multi_detail_text = 2; + * + * @param index The index of the element to return. + * @return The multiDetailText at the given index. + */ + java.lang.String getMultiDetailText(int index); + + /** + * + * + *
        +   * Content to return in a repeated `*.error.details` field of type
        +   * `google.protobuf.Any`
        +   * 
        + * + * repeated string multi_detail_text = 2; + * + * @param index The index of the value to return. + * @return The bytes of the multiDetailText at the given index. + */ + com.google.protobuf.ByteString getMultiDetailTextBytes(int index); +} diff --git a/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/EchoErrorDetailsResponse.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/EchoErrorDetailsResponse.java new file mode 100644 index 0000000000..bce7281bf9 --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/EchoErrorDetailsResponse.java @@ -0,0 +1,2274 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/echo.proto + +package com.google.showcase.v1beta1; + +/** + * + * + *
        + * The response message used for the EchoErrorDetails method.
        + * 
        + * + * Protobuf type {@code google.showcase.v1beta1.EchoErrorDetailsResponse} + */ +public final class EchoErrorDetailsResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.EchoErrorDetailsResponse) + EchoErrorDetailsResponseOrBuilder { + private static final long serialVersionUID = 0L; + + // Use EchoErrorDetailsResponse.newBuilder() to construct. + private EchoErrorDetailsResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private EchoErrorDetailsResponse() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new EchoErrorDetailsResponse(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private EchoErrorDetailsResponse( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + com.google.showcase.v1beta1.EchoErrorDetailsResponse.SingleDetail.Builder subBuilder = + null; + if (singleDetail_ != null) { + subBuilder = singleDetail_.toBuilder(); + } + singleDetail_ = + input.readMessage( + com.google.showcase.v1beta1.EchoErrorDetailsResponse.SingleDetail.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(singleDetail_); + singleDetail_ = subBuilder.buildPartial(); + } + + break; + } + case 18: + { + com.google.showcase.v1beta1.EchoErrorDetailsResponse.MultipleDetails.Builder + subBuilder = null; + if (multipleDetails_ != null) { + subBuilder = multipleDetails_.toBuilder(); + } + multipleDetails_ = + input.readMessage( + com.google.showcase.v1beta1.EchoErrorDetailsResponse.MultipleDetails.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(multipleDetails_); + multipleDetails_ = subBuilder.buildPartial(); + } + + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.EchoOuterClass + .internal_static_google_showcase_v1beta1_EchoErrorDetailsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.EchoOuterClass + .internal_static_google_showcase_v1beta1_EchoErrorDetailsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.EchoErrorDetailsResponse.class, + com.google.showcase.v1beta1.EchoErrorDetailsResponse.Builder.class); + } + + public interface SingleDetailOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.EchoErrorDetailsResponse.SingleDetail) + com.google.protobuf.MessageOrBuilder { + + /** + * .google.showcase.v1beta1.ErrorWithSingleDetail error = 1; + * + * @return Whether the error field is set. + */ + boolean hasError(); + + /** + * .google.showcase.v1beta1.ErrorWithSingleDetail error = 1; + * + * @return The error. + */ + com.google.showcase.v1beta1.ErrorWithSingleDetail getError(); + + /** .google.showcase.v1beta1.ErrorWithSingleDetail error = 1; */ + com.google.showcase.v1beta1.ErrorWithSingleDetailOrBuilder getErrorOrBuilder(); + } + + /** Protobuf type {@code google.showcase.v1beta1.EchoErrorDetailsResponse.SingleDetail} */ + public static final class SingleDetail extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.EchoErrorDetailsResponse.SingleDetail) + SingleDetailOrBuilder { + private static final long serialVersionUID = 0L; + + // Use SingleDetail.newBuilder() to construct. + private SingleDetail(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private SingleDetail() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new SingleDetail(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private SingleDetail( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + com.google.showcase.v1beta1.ErrorWithSingleDetail.Builder subBuilder = null; + if (error_ != null) { + subBuilder = error_.toBuilder(); + } + error_ = + input.readMessage( + com.google.showcase.v1beta1.ErrorWithSingleDetail.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(error_); + error_ = subBuilder.buildPartial(); + } + + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.EchoOuterClass + .internal_static_google_showcase_v1beta1_EchoErrorDetailsResponse_SingleDetail_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.EchoOuterClass + .internal_static_google_showcase_v1beta1_EchoErrorDetailsResponse_SingleDetail_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.EchoErrorDetailsResponse.SingleDetail.class, + com.google.showcase.v1beta1.EchoErrorDetailsResponse.SingleDetail.Builder.class); + } + + public static final int ERROR_FIELD_NUMBER = 1; + private com.google.showcase.v1beta1.ErrorWithSingleDetail error_; + + /** + * .google.showcase.v1beta1.ErrorWithSingleDetail error = 1; + * + * @return Whether the error field is set. + */ + @java.lang.Override + public boolean hasError() { + return error_ != null; + } + + /** + * .google.showcase.v1beta1.ErrorWithSingleDetail error = 1; + * + * @return The error. + */ + @java.lang.Override + public com.google.showcase.v1beta1.ErrorWithSingleDetail getError() { + return error_ == null + ? com.google.showcase.v1beta1.ErrorWithSingleDetail.getDefaultInstance() + : error_; + } + + /** .google.showcase.v1beta1.ErrorWithSingleDetail error = 1; */ + @java.lang.Override + public com.google.showcase.v1beta1.ErrorWithSingleDetailOrBuilder getErrorOrBuilder() { + return getError(); + } + + 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 (error_ != null) { + output.writeMessage(1, getError()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (error_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getError()); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.showcase.v1beta1.EchoErrorDetailsResponse.SingleDetail)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.EchoErrorDetailsResponse.SingleDetail other = + (com.google.showcase.v1beta1.EchoErrorDetailsResponse.SingleDetail) obj; + + if (hasError() != other.hasError()) return false; + if (hasError()) { + if (!getError().equals(other.getError())) return false; + } + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasError()) { + hash = (37 * hash) + ERROR_FIELD_NUMBER; + hash = (53 * hash) + getError().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.showcase.v1beta1.EchoErrorDetailsResponse.SingleDetail parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.EchoErrorDetailsResponse.SingleDetail parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.EchoErrorDetailsResponse.SingleDetail parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.EchoErrorDetailsResponse.SingleDetail 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.showcase.v1beta1.EchoErrorDetailsResponse.SingleDetail parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.EchoErrorDetailsResponse.SingleDetail parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.EchoErrorDetailsResponse.SingleDetail parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.EchoErrorDetailsResponse.SingleDetail 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.showcase.v1beta1.EchoErrorDetailsResponse.SingleDetail + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.EchoErrorDetailsResponse.SingleDetail + 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.showcase.v1beta1.EchoErrorDetailsResponse.SingleDetail parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.EchoErrorDetailsResponse.SingleDetail 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.showcase.v1beta1.EchoErrorDetailsResponse.SingleDetail prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** Protobuf type {@code google.showcase.v1beta1.EchoErrorDetailsResponse.SingleDetail} */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.EchoErrorDetailsResponse.SingleDetail) + com.google.showcase.v1beta1.EchoErrorDetailsResponse.SingleDetailOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.EchoOuterClass + .internal_static_google_showcase_v1beta1_EchoErrorDetailsResponse_SingleDetail_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.EchoOuterClass + .internal_static_google_showcase_v1beta1_EchoErrorDetailsResponse_SingleDetail_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.EchoErrorDetailsResponse.SingleDetail.class, + com.google.showcase.v1beta1.EchoErrorDetailsResponse.SingleDetail.Builder.class); + } + + // Construct using + // com.google.showcase.v1beta1.EchoErrorDetailsResponse.SingleDetail.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (errorBuilder_ == null) { + error_ = null; + } else { + error_ = null; + errorBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.showcase.v1beta1.EchoOuterClass + .internal_static_google_showcase_v1beta1_EchoErrorDetailsResponse_SingleDetail_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.EchoErrorDetailsResponse.SingleDetail + getDefaultInstanceForType() { + return com.google.showcase.v1beta1.EchoErrorDetailsResponse.SingleDetail + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.EchoErrorDetailsResponse.SingleDetail build() { + com.google.showcase.v1beta1.EchoErrorDetailsResponse.SingleDetail result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.EchoErrorDetailsResponse.SingleDetail buildPartial() { + com.google.showcase.v1beta1.EchoErrorDetailsResponse.SingleDetail result = + new com.google.showcase.v1beta1.EchoErrorDetailsResponse.SingleDetail(this); + if (errorBuilder_ == null) { + result.error_ = error_; + } else { + result.error_ = errorBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, + java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.showcase.v1beta1.EchoErrorDetailsResponse.SingleDetail) { + return mergeFrom( + (com.google.showcase.v1beta1.EchoErrorDetailsResponse.SingleDetail) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.showcase.v1beta1.EchoErrorDetailsResponse.SingleDetail other) { + if (other + == com.google.showcase.v1beta1.EchoErrorDetailsResponse.SingleDetail + .getDefaultInstance()) return this; + if (other.hasError()) { + mergeError(other.getError()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.showcase.v1beta1.EchoErrorDetailsResponse.SingleDetail parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.showcase.v1beta1.EchoErrorDetailsResponse.SingleDetail) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private com.google.showcase.v1beta1.ErrorWithSingleDetail error_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.showcase.v1beta1.ErrorWithSingleDetail, + com.google.showcase.v1beta1.ErrorWithSingleDetail.Builder, + com.google.showcase.v1beta1.ErrorWithSingleDetailOrBuilder> + errorBuilder_; + + /** + * .google.showcase.v1beta1.ErrorWithSingleDetail error = 1; + * + * @return Whether the error field is set. + */ + public boolean hasError() { + return errorBuilder_ != null || error_ != null; + } + + /** + * .google.showcase.v1beta1.ErrorWithSingleDetail error = 1; + * + * @return The error. + */ + public com.google.showcase.v1beta1.ErrorWithSingleDetail getError() { + if (errorBuilder_ == null) { + return error_ == null + ? com.google.showcase.v1beta1.ErrorWithSingleDetail.getDefaultInstance() + : error_; + } else { + return errorBuilder_.getMessage(); + } + } + + /** .google.showcase.v1beta1.ErrorWithSingleDetail error = 1; */ + public Builder setError(com.google.showcase.v1beta1.ErrorWithSingleDetail value) { + if (errorBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + error_ = value; + onChanged(); + } else { + errorBuilder_.setMessage(value); + } + + return this; + } + + /** .google.showcase.v1beta1.ErrorWithSingleDetail error = 1; */ + public Builder setError( + com.google.showcase.v1beta1.ErrorWithSingleDetail.Builder builderForValue) { + if (errorBuilder_ == null) { + error_ = builderForValue.build(); + onChanged(); + } else { + errorBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + + /** .google.showcase.v1beta1.ErrorWithSingleDetail error = 1; */ + public Builder mergeError(com.google.showcase.v1beta1.ErrorWithSingleDetail value) { + if (errorBuilder_ == null) { + if (error_ != null) { + error_ = + com.google.showcase.v1beta1.ErrorWithSingleDetail.newBuilder(error_) + .mergeFrom(value) + .buildPartial(); + } else { + error_ = value; + } + onChanged(); + } else { + errorBuilder_.mergeFrom(value); + } + + return this; + } + + /** .google.showcase.v1beta1.ErrorWithSingleDetail error = 1; */ + public Builder clearError() { + if (errorBuilder_ == null) { + error_ = null; + onChanged(); + } else { + error_ = null; + errorBuilder_ = null; + } + + return this; + } + + /** .google.showcase.v1beta1.ErrorWithSingleDetail error = 1; */ + public com.google.showcase.v1beta1.ErrorWithSingleDetail.Builder getErrorBuilder() { + + onChanged(); + return getErrorFieldBuilder().getBuilder(); + } + + /** .google.showcase.v1beta1.ErrorWithSingleDetail error = 1; */ + public com.google.showcase.v1beta1.ErrorWithSingleDetailOrBuilder getErrorOrBuilder() { + if (errorBuilder_ != null) { + return errorBuilder_.getMessageOrBuilder(); + } else { + return error_ == null + ? com.google.showcase.v1beta1.ErrorWithSingleDetail.getDefaultInstance() + : error_; + } + } + + /** .google.showcase.v1beta1.ErrorWithSingleDetail error = 1; */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.showcase.v1beta1.ErrorWithSingleDetail, + com.google.showcase.v1beta1.ErrorWithSingleDetail.Builder, + com.google.showcase.v1beta1.ErrorWithSingleDetailOrBuilder> + getErrorFieldBuilder() { + if (errorBuilder_ == null) { + errorBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.showcase.v1beta1.ErrorWithSingleDetail, + com.google.showcase.v1beta1.ErrorWithSingleDetail.Builder, + com.google.showcase.v1beta1.ErrorWithSingleDetailOrBuilder>( + getError(), getParentForChildren(), isClean()); + error_ = null; + } + return errorBuilder_; + } + + @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.showcase.v1beta1.EchoErrorDetailsResponse.SingleDetail) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.EchoErrorDetailsResponse.SingleDetail) + private static final com.google.showcase.v1beta1.EchoErrorDetailsResponse.SingleDetail + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.EchoErrorDetailsResponse.SingleDetail(); + } + + public static com.google.showcase.v1beta1.EchoErrorDetailsResponse.SingleDetail + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SingleDetail parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new SingleDetail(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.showcase.v1beta1.EchoErrorDetailsResponse.SingleDetail + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface MultipleDetailsOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.EchoErrorDetailsResponse.MultipleDetails) + com.google.protobuf.MessageOrBuilder { + + /** + * .google.showcase.v1beta1.ErrorWithMultipleDetails error = 1; + * + * @return Whether the error field is set. + */ + boolean hasError(); + + /** + * .google.showcase.v1beta1.ErrorWithMultipleDetails error = 1; + * + * @return The error. + */ + com.google.showcase.v1beta1.ErrorWithMultipleDetails getError(); + + /** .google.showcase.v1beta1.ErrorWithMultipleDetails error = 1; */ + com.google.showcase.v1beta1.ErrorWithMultipleDetailsOrBuilder getErrorOrBuilder(); + } + + /** Protobuf type {@code google.showcase.v1beta1.EchoErrorDetailsResponse.MultipleDetails} */ + public static final class MultipleDetails extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.EchoErrorDetailsResponse.MultipleDetails) + MultipleDetailsOrBuilder { + private static final long serialVersionUID = 0L; + + // Use MultipleDetails.newBuilder() to construct. + private MultipleDetails(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private MultipleDetails() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new MultipleDetails(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private MultipleDetails( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + com.google.showcase.v1beta1.ErrorWithMultipleDetails.Builder subBuilder = null; + if (error_ != null) { + subBuilder = error_.toBuilder(); + } + error_ = + input.readMessage( + com.google.showcase.v1beta1.ErrorWithMultipleDetails.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(error_); + error_ = subBuilder.buildPartial(); + } + + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.EchoOuterClass + .internal_static_google_showcase_v1beta1_EchoErrorDetailsResponse_MultipleDetails_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.EchoOuterClass + .internal_static_google_showcase_v1beta1_EchoErrorDetailsResponse_MultipleDetails_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.EchoErrorDetailsResponse.MultipleDetails.class, + com.google.showcase.v1beta1.EchoErrorDetailsResponse.MultipleDetails.Builder.class); + } + + public static final int ERROR_FIELD_NUMBER = 1; + private com.google.showcase.v1beta1.ErrorWithMultipleDetails error_; + + /** + * .google.showcase.v1beta1.ErrorWithMultipleDetails error = 1; + * + * @return Whether the error field is set. + */ + @java.lang.Override + public boolean hasError() { + return error_ != null; + } + + /** + * .google.showcase.v1beta1.ErrorWithMultipleDetails error = 1; + * + * @return The error. + */ + @java.lang.Override + public com.google.showcase.v1beta1.ErrorWithMultipleDetails getError() { + return error_ == null + ? com.google.showcase.v1beta1.ErrorWithMultipleDetails.getDefaultInstance() + : error_; + } + + /** .google.showcase.v1beta1.ErrorWithMultipleDetails error = 1; */ + @java.lang.Override + public com.google.showcase.v1beta1.ErrorWithMultipleDetailsOrBuilder getErrorOrBuilder() { + return getError(); + } + + 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 (error_ != null) { + output.writeMessage(1, getError()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (error_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getError()); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.showcase.v1beta1.EchoErrorDetailsResponse.MultipleDetails)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.EchoErrorDetailsResponse.MultipleDetails other = + (com.google.showcase.v1beta1.EchoErrorDetailsResponse.MultipleDetails) obj; + + if (hasError() != other.hasError()) return false; + if (hasError()) { + if (!getError().equals(other.getError())) return false; + } + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasError()) { + hash = (37 * hash) + ERROR_FIELD_NUMBER; + hash = (53 * hash) + getError().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.showcase.v1beta1.EchoErrorDetailsResponse.MultipleDetails parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.EchoErrorDetailsResponse.MultipleDetails parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.EchoErrorDetailsResponse.MultipleDetails parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.EchoErrorDetailsResponse.MultipleDetails 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.showcase.v1beta1.EchoErrorDetailsResponse.MultipleDetails parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.EchoErrorDetailsResponse.MultipleDetails parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.EchoErrorDetailsResponse.MultipleDetails parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.EchoErrorDetailsResponse.MultipleDetails 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.showcase.v1beta1.EchoErrorDetailsResponse.MultipleDetails + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.EchoErrorDetailsResponse.MultipleDetails + 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.showcase.v1beta1.EchoErrorDetailsResponse.MultipleDetails parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.EchoErrorDetailsResponse.MultipleDetails 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.showcase.v1beta1.EchoErrorDetailsResponse.MultipleDetails prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** Protobuf type {@code google.showcase.v1beta1.EchoErrorDetailsResponse.MultipleDetails} */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.EchoErrorDetailsResponse.MultipleDetails) + com.google.showcase.v1beta1.EchoErrorDetailsResponse.MultipleDetailsOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.EchoOuterClass + .internal_static_google_showcase_v1beta1_EchoErrorDetailsResponse_MultipleDetails_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.EchoOuterClass + .internal_static_google_showcase_v1beta1_EchoErrorDetailsResponse_MultipleDetails_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.EchoErrorDetailsResponse.MultipleDetails.class, + com.google.showcase.v1beta1.EchoErrorDetailsResponse.MultipleDetails.Builder.class); + } + + // Construct using + // com.google.showcase.v1beta1.EchoErrorDetailsResponse.MultipleDetails.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (errorBuilder_ == null) { + error_ = null; + } else { + error_ = null; + errorBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.showcase.v1beta1.EchoOuterClass + .internal_static_google_showcase_v1beta1_EchoErrorDetailsResponse_MultipleDetails_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.EchoErrorDetailsResponse.MultipleDetails + getDefaultInstanceForType() { + return com.google.showcase.v1beta1.EchoErrorDetailsResponse.MultipleDetails + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.EchoErrorDetailsResponse.MultipleDetails build() { + com.google.showcase.v1beta1.EchoErrorDetailsResponse.MultipleDetails result = + buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.EchoErrorDetailsResponse.MultipleDetails buildPartial() { + com.google.showcase.v1beta1.EchoErrorDetailsResponse.MultipleDetails result = + new com.google.showcase.v1beta1.EchoErrorDetailsResponse.MultipleDetails(this); + if (errorBuilder_ == null) { + result.error_ = error_; + } else { + result.error_ = errorBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, + java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.showcase.v1beta1.EchoErrorDetailsResponse.MultipleDetails) { + return mergeFrom( + (com.google.showcase.v1beta1.EchoErrorDetailsResponse.MultipleDetails) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.showcase.v1beta1.EchoErrorDetailsResponse.MultipleDetails other) { + if (other + == com.google.showcase.v1beta1.EchoErrorDetailsResponse.MultipleDetails + .getDefaultInstance()) return this; + if (other.hasError()) { + mergeError(other.getError()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.showcase.v1beta1.EchoErrorDetailsResponse.MultipleDetails parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.showcase.v1beta1.EchoErrorDetailsResponse.MultipleDetails) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private com.google.showcase.v1beta1.ErrorWithMultipleDetails error_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.showcase.v1beta1.ErrorWithMultipleDetails, + com.google.showcase.v1beta1.ErrorWithMultipleDetails.Builder, + com.google.showcase.v1beta1.ErrorWithMultipleDetailsOrBuilder> + errorBuilder_; + + /** + * .google.showcase.v1beta1.ErrorWithMultipleDetails error = 1; + * + * @return Whether the error field is set. + */ + public boolean hasError() { + return errorBuilder_ != null || error_ != null; + } + + /** + * .google.showcase.v1beta1.ErrorWithMultipleDetails error = 1; + * + * @return The error. + */ + public com.google.showcase.v1beta1.ErrorWithMultipleDetails getError() { + if (errorBuilder_ == null) { + return error_ == null + ? com.google.showcase.v1beta1.ErrorWithMultipleDetails.getDefaultInstance() + : error_; + } else { + return errorBuilder_.getMessage(); + } + } + + /** .google.showcase.v1beta1.ErrorWithMultipleDetails error = 1; */ + public Builder setError(com.google.showcase.v1beta1.ErrorWithMultipleDetails value) { + if (errorBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + error_ = value; + onChanged(); + } else { + errorBuilder_.setMessage(value); + } + + return this; + } + + /** .google.showcase.v1beta1.ErrorWithMultipleDetails error = 1; */ + public Builder setError( + com.google.showcase.v1beta1.ErrorWithMultipleDetails.Builder builderForValue) { + if (errorBuilder_ == null) { + error_ = builderForValue.build(); + onChanged(); + } else { + errorBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + + /** .google.showcase.v1beta1.ErrorWithMultipleDetails error = 1; */ + public Builder mergeError(com.google.showcase.v1beta1.ErrorWithMultipleDetails value) { + if (errorBuilder_ == null) { + if (error_ != null) { + error_ = + com.google.showcase.v1beta1.ErrorWithMultipleDetails.newBuilder(error_) + .mergeFrom(value) + .buildPartial(); + } else { + error_ = value; + } + onChanged(); + } else { + errorBuilder_.mergeFrom(value); + } + + return this; + } + + /** .google.showcase.v1beta1.ErrorWithMultipleDetails error = 1; */ + public Builder clearError() { + if (errorBuilder_ == null) { + error_ = null; + onChanged(); + } else { + error_ = null; + errorBuilder_ = null; + } + + return this; + } + + /** .google.showcase.v1beta1.ErrorWithMultipleDetails error = 1; */ + public com.google.showcase.v1beta1.ErrorWithMultipleDetails.Builder getErrorBuilder() { + + onChanged(); + return getErrorFieldBuilder().getBuilder(); + } + + /** .google.showcase.v1beta1.ErrorWithMultipleDetails error = 1; */ + public com.google.showcase.v1beta1.ErrorWithMultipleDetailsOrBuilder getErrorOrBuilder() { + if (errorBuilder_ != null) { + return errorBuilder_.getMessageOrBuilder(); + } else { + return error_ == null + ? com.google.showcase.v1beta1.ErrorWithMultipleDetails.getDefaultInstance() + : error_; + } + } + + /** .google.showcase.v1beta1.ErrorWithMultipleDetails error = 1; */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.showcase.v1beta1.ErrorWithMultipleDetails, + com.google.showcase.v1beta1.ErrorWithMultipleDetails.Builder, + com.google.showcase.v1beta1.ErrorWithMultipleDetailsOrBuilder> + getErrorFieldBuilder() { + if (errorBuilder_ == null) { + errorBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.showcase.v1beta1.ErrorWithMultipleDetails, + com.google.showcase.v1beta1.ErrorWithMultipleDetails.Builder, + com.google.showcase.v1beta1.ErrorWithMultipleDetailsOrBuilder>( + getError(), getParentForChildren(), isClean()); + error_ = null; + } + return errorBuilder_; + } + + @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.showcase.v1beta1.EchoErrorDetailsResponse.MultipleDetails) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.EchoErrorDetailsResponse.MultipleDetails) + private static final com.google.showcase.v1beta1.EchoErrorDetailsResponse.MultipleDetails + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.EchoErrorDetailsResponse.MultipleDetails(); + } + + public static com.google.showcase.v1beta1.EchoErrorDetailsResponse.MultipleDetails + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public MultipleDetails parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new MultipleDetails(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.showcase.v1beta1.EchoErrorDetailsResponse.MultipleDetails + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public static final int SINGLE_DETAIL_FIELD_NUMBER = 1; + private com.google.showcase.v1beta1.EchoErrorDetailsResponse.SingleDetail singleDetail_; + + /** + * .google.showcase.v1beta1.EchoErrorDetailsResponse.SingleDetail single_detail = 1; + * + * @return Whether the singleDetail field is set. + */ + @java.lang.Override + public boolean hasSingleDetail() { + return singleDetail_ != null; + } + + /** + * .google.showcase.v1beta1.EchoErrorDetailsResponse.SingleDetail single_detail = 1; + * + * @return The singleDetail. + */ + @java.lang.Override + public com.google.showcase.v1beta1.EchoErrorDetailsResponse.SingleDetail getSingleDetail() { + return singleDetail_ == null + ? com.google.showcase.v1beta1.EchoErrorDetailsResponse.SingleDetail.getDefaultInstance() + : singleDetail_; + } + + /** + * .google.showcase.v1beta1.EchoErrorDetailsResponse.SingleDetail single_detail = 1; + */ + @java.lang.Override + public com.google.showcase.v1beta1.EchoErrorDetailsResponse.SingleDetailOrBuilder + getSingleDetailOrBuilder() { + return getSingleDetail(); + } + + public static final int MULTIPLE_DETAILS_FIELD_NUMBER = 2; + private com.google.showcase.v1beta1.EchoErrorDetailsResponse.MultipleDetails multipleDetails_; + + /** + * .google.showcase.v1beta1.EchoErrorDetailsResponse.MultipleDetails multiple_details = 2; + * + * + * @return Whether the multipleDetails field is set. + */ + @java.lang.Override + public boolean hasMultipleDetails() { + return multipleDetails_ != null; + } + + /** + * .google.showcase.v1beta1.EchoErrorDetailsResponse.MultipleDetails multiple_details = 2; + * + * + * @return The multipleDetails. + */ + @java.lang.Override + public com.google.showcase.v1beta1.EchoErrorDetailsResponse.MultipleDetails getMultipleDetails() { + return multipleDetails_ == null + ? com.google.showcase.v1beta1.EchoErrorDetailsResponse.MultipleDetails.getDefaultInstance() + : multipleDetails_; + } + + /** + * .google.showcase.v1beta1.EchoErrorDetailsResponse.MultipleDetails multiple_details = 2; + * + */ + @java.lang.Override + public com.google.showcase.v1beta1.EchoErrorDetailsResponse.MultipleDetailsOrBuilder + getMultipleDetailsOrBuilder() { + return getMultipleDetails(); + } + + 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 (singleDetail_ != null) { + output.writeMessage(1, getSingleDetail()); + } + if (multipleDetails_ != null) { + output.writeMessage(2, getMultipleDetails()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (singleDetail_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getSingleDetail()); + } + if (multipleDetails_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getMultipleDetails()); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.showcase.v1beta1.EchoErrorDetailsResponse)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.EchoErrorDetailsResponse other = + (com.google.showcase.v1beta1.EchoErrorDetailsResponse) obj; + + if (hasSingleDetail() != other.hasSingleDetail()) return false; + if (hasSingleDetail()) { + if (!getSingleDetail().equals(other.getSingleDetail())) return false; + } + if (hasMultipleDetails() != other.hasMultipleDetails()) return false; + if (hasMultipleDetails()) { + if (!getMultipleDetails().equals(other.getMultipleDetails())) return false; + } + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasSingleDetail()) { + hash = (37 * hash) + SINGLE_DETAIL_FIELD_NUMBER; + hash = (53 * hash) + getSingleDetail().hashCode(); + } + if (hasMultipleDetails()) { + hash = (37 * hash) + MULTIPLE_DETAILS_FIELD_NUMBER; + hash = (53 * hash) + getMultipleDetails().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.showcase.v1beta1.EchoErrorDetailsResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.EchoErrorDetailsResponse parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.EchoErrorDetailsResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.EchoErrorDetailsResponse 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.showcase.v1beta1.EchoErrorDetailsResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.EchoErrorDetailsResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.EchoErrorDetailsResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.EchoErrorDetailsResponse 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.showcase.v1beta1.EchoErrorDetailsResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.EchoErrorDetailsResponse 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.showcase.v1beta1.EchoErrorDetailsResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.EchoErrorDetailsResponse 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.showcase.v1beta1.EchoErrorDetailsResponse 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 message used for the EchoErrorDetails method.
        +   * 
        + * + * Protobuf type {@code google.showcase.v1beta1.EchoErrorDetailsResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.EchoErrorDetailsResponse) + com.google.showcase.v1beta1.EchoErrorDetailsResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.EchoOuterClass + .internal_static_google_showcase_v1beta1_EchoErrorDetailsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.EchoOuterClass + .internal_static_google_showcase_v1beta1_EchoErrorDetailsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.EchoErrorDetailsResponse.class, + com.google.showcase.v1beta1.EchoErrorDetailsResponse.Builder.class); + } + + // Construct using com.google.showcase.v1beta1.EchoErrorDetailsResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (singleDetailBuilder_ == null) { + singleDetail_ = null; + } else { + singleDetail_ = null; + singleDetailBuilder_ = null; + } + if (multipleDetailsBuilder_ == null) { + multipleDetails_ = null; + } else { + multipleDetails_ = null; + multipleDetailsBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.showcase.v1beta1.EchoOuterClass + .internal_static_google_showcase_v1beta1_EchoErrorDetailsResponse_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.EchoErrorDetailsResponse getDefaultInstanceForType() { + return com.google.showcase.v1beta1.EchoErrorDetailsResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.EchoErrorDetailsResponse build() { + com.google.showcase.v1beta1.EchoErrorDetailsResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.EchoErrorDetailsResponse buildPartial() { + com.google.showcase.v1beta1.EchoErrorDetailsResponse result = + new com.google.showcase.v1beta1.EchoErrorDetailsResponse(this); + if (singleDetailBuilder_ == null) { + result.singleDetail_ = singleDetail_; + } else { + result.singleDetail_ = singleDetailBuilder_.build(); + } + if (multipleDetailsBuilder_ == null) { + result.multipleDetails_ = multipleDetails_; + } else { + result.multipleDetails_ = multipleDetailsBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.showcase.v1beta1.EchoErrorDetailsResponse) { + return mergeFrom((com.google.showcase.v1beta1.EchoErrorDetailsResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.showcase.v1beta1.EchoErrorDetailsResponse other) { + if (other == com.google.showcase.v1beta1.EchoErrorDetailsResponse.getDefaultInstance()) + return this; + if (other.hasSingleDetail()) { + mergeSingleDetail(other.getSingleDetail()); + } + if (other.hasMultipleDetails()) { + mergeMultipleDetails(other.getMultipleDetails()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.showcase.v1beta1.EchoErrorDetailsResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.showcase.v1beta1.EchoErrorDetailsResponse) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private com.google.showcase.v1beta1.EchoErrorDetailsResponse.SingleDetail singleDetail_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.showcase.v1beta1.EchoErrorDetailsResponse.SingleDetail, + com.google.showcase.v1beta1.EchoErrorDetailsResponse.SingleDetail.Builder, + com.google.showcase.v1beta1.EchoErrorDetailsResponse.SingleDetailOrBuilder> + singleDetailBuilder_; + + /** + * .google.showcase.v1beta1.EchoErrorDetailsResponse.SingleDetail single_detail = 1; + * + * + * @return Whether the singleDetail field is set. + */ + public boolean hasSingleDetail() { + return singleDetailBuilder_ != null || singleDetail_ != null; + } + + /** + * .google.showcase.v1beta1.EchoErrorDetailsResponse.SingleDetail single_detail = 1; + * + * + * @return The singleDetail. + */ + public com.google.showcase.v1beta1.EchoErrorDetailsResponse.SingleDetail getSingleDetail() { + if (singleDetailBuilder_ == null) { + return singleDetail_ == null + ? com.google.showcase.v1beta1.EchoErrorDetailsResponse.SingleDetail.getDefaultInstance() + : singleDetail_; + } else { + return singleDetailBuilder_.getMessage(); + } + } + + /** + * .google.showcase.v1beta1.EchoErrorDetailsResponse.SingleDetail single_detail = 1; + * + */ + public Builder setSingleDetail( + com.google.showcase.v1beta1.EchoErrorDetailsResponse.SingleDetail value) { + if (singleDetailBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + singleDetail_ = value; + onChanged(); + } else { + singleDetailBuilder_.setMessage(value); + } + + return this; + } + + /** + * .google.showcase.v1beta1.EchoErrorDetailsResponse.SingleDetail single_detail = 1; + * + */ + public Builder setSingleDetail( + com.google.showcase.v1beta1.EchoErrorDetailsResponse.SingleDetail.Builder builderForValue) { + if (singleDetailBuilder_ == null) { + singleDetail_ = builderForValue.build(); + onChanged(); + } else { + singleDetailBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + + /** + * .google.showcase.v1beta1.EchoErrorDetailsResponse.SingleDetail single_detail = 1; + * + */ + public Builder mergeSingleDetail( + com.google.showcase.v1beta1.EchoErrorDetailsResponse.SingleDetail value) { + if (singleDetailBuilder_ == null) { + if (singleDetail_ != null) { + singleDetail_ = + com.google.showcase.v1beta1.EchoErrorDetailsResponse.SingleDetail.newBuilder( + singleDetail_) + .mergeFrom(value) + .buildPartial(); + } else { + singleDetail_ = value; + } + onChanged(); + } else { + singleDetailBuilder_.mergeFrom(value); + } + + return this; + } + + /** + * .google.showcase.v1beta1.EchoErrorDetailsResponse.SingleDetail single_detail = 1; + * + */ + public Builder clearSingleDetail() { + if (singleDetailBuilder_ == null) { + singleDetail_ = null; + onChanged(); + } else { + singleDetail_ = null; + singleDetailBuilder_ = null; + } + + return this; + } + + /** + * .google.showcase.v1beta1.EchoErrorDetailsResponse.SingleDetail single_detail = 1; + * + */ + public com.google.showcase.v1beta1.EchoErrorDetailsResponse.SingleDetail.Builder + getSingleDetailBuilder() { + + onChanged(); + return getSingleDetailFieldBuilder().getBuilder(); + } + + /** + * .google.showcase.v1beta1.EchoErrorDetailsResponse.SingleDetail single_detail = 1; + * + */ + public com.google.showcase.v1beta1.EchoErrorDetailsResponse.SingleDetailOrBuilder + getSingleDetailOrBuilder() { + if (singleDetailBuilder_ != null) { + return singleDetailBuilder_.getMessageOrBuilder(); + } else { + return singleDetail_ == null + ? com.google.showcase.v1beta1.EchoErrorDetailsResponse.SingleDetail.getDefaultInstance() + : singleDetail_; + } + } + + /** + * .google.showcase.v1beta1.EchoErrorDetailsResponse.SingleDetail single_detail = 1; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.showcase.v1beta1.EchoErrorDetailsResponse.SingleDetail, + com.google.showcase.v1beta1.EchoErrorDetailsResponse.SingleDetail.Builder, + com.google.showcase.v1beta1.EchoErrorDetailsResponse.SingleDetailOrBuilder> + getSingleDetailFieldBuilder() { + if (singleDetailBuilder_ == null) { + singleDetailBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.showcase.v1beta1.EchoErrorDetailsResponse.SingleDetail, + com.google.showcase.v1beta1.EchoErrorDetailsResponse.SingleDetail.Builder, + com.google.showcase.v1beta1.EchoErrorDetailsResponse.SingleDetailOrBuilder>( + getSingleDetail(), getParentForChildren(), isClean()); + singleDetail_ = null; + } + return singleDetailBuilder_; + } + + private com.google.showcase.v1beta1.EchoErrorDetailsResponse.MultipleDetails multipleDetails_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.showcase.v1beta1.EchoErrorDetailsResponse.MultipleDetails, + com.google.showcase.v1beta1.EchoErrorDetailsResponse.MultipleDetails.Builder, + com.google.showcase.v1beta1.EchoErrorDetailsResponse.MultipleDetailsOrBuilder> + multipleDetailsBuilder_; + + /** + * .google.showcase.v1beta1.EchoErrorDetailsResponse.MultipleDetails multiple_details = 2; + * + * + * @return Whether the multipleDetails field is set. + */ + public boolean hasMultipleDetails() { + return multipleDetailsBuilder_ != null || multipleDetails_ != null; + } + + /** + * .google.showcase.v1beta1.EchoErrorDetailsResponse.MultipleDetails multiple_details = 2; + * + * + * @return The multipleDetails. + */ + public com.google.showcase.v1beta1.EchoErrorDetailsResponse.MultipleDetails + getMultipleDetails() { + if (multipleDetailsBuilder_ == null) { + return multipleDetails_ == null + ? com.google.showcase.v1beta1.EchoErrorDetailsResponse.MultipleDetails + .getDefaultInstance() + : multipleDetails_; + } else { + return multipleDetailsBuilder_.getMessage(); + } + } + + /** + * .google.showcase.v1beta1.EchoErrorDetailsResponse.MultipleDetails multiple_details = 2; + * + */ + public Builder setMultipleDetails( + com.google.showcase.v1beta1.EchoErrorDetailsResponse.MultipleDetails value) { + if (multipleDetailsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + multipleDetails_ = value; + onChanged(); + } else { + multipleDetailsBuilder_.setMessage(value); + } + + return this; + } + + /** + * .google.showcase.v1beta1.EchoErrorDetailsResponse.MultipleDetails multiple_details = 2; + * + */ + public Builder setMultipleDetails( + com.google.showcase.v1beta1.EchoErrorDetailsResponse.MultipleDetails.Builder + builderForValue) { + if (multipleDetailsBuilder_ == null) { + multipleDetails_ = builderForValue.build(); + onChanged(); + } else { + multipleDetailsBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + + /** + * .google.showcase.v1beta1.EchoErrorDetailsResponse.MultipleDetails multiple_details = 2; + * + */ + public Builder mergeMultipleDetails( + com.google.showcase.v1beta1.EchoErrorDetailsResponse.MultipleDetails value) { + if (multipleDetailsBuilder_ == null) { + if (multipleDetails_ != null) { + multipleDetails_ = + com.google.showcase.v1beta1.EchoErrorDetailsResponse.MultipleDetails.newBuilder( + multipleDetails_) + .mergeFrom(value) + .buildPartial(); + } else { + multipleDetails_ = value; + } + onChanged(); + } else { + multipleDetailsBuilder_.mergeFrom(value); + } + + return this; + } + + /** + * .google.showcase.v1beta1.EchoErrorDetailsResponse.MultipleDetails multiple_details = 2; + * + */ + public Builder clearMultipleDetails() { + if (multipleDetailsBuilder_ == null) { + multipleDetails_ = null; + onChanged(); + } else { + multipleDetails_ = null; + multipleDetailsBuilder_ = null; + } + + return this; + } + + /** + * .google.showcase.v1beta1.EchoErrorDetailsResponse.MultipleDetails multiple_details = 2; + * + */ + public com.google.showcase.v1beta1.EchoErrorDetailsResponse.MultipleDetails.Builder + getMultipleDetailsBuilder() { + + onChanged(); + return getMultipleDetailsFieldBuilder().getBuilder(); + } + + /** + * .google.showcase.v1beta1.EchoErrorDetailsResponse.MultipleDetails multiple_details = 2; + * + */ + public com.google.showcase.v1beta1.EchoErrorDetailsResponse.MultipleDetailsOrBuilder + getMultipleDetailsOrBuilder() { + if (multipleDetailsBuilder_ != null) { + return multipleDetailsBuilder_.getMessageOrBuilder(); + } else { + return multipleDetails_ == null + ? com.google.showcase.v1beta1.EchoErrorDetailsResponse.MultipleDetails + .getDefaultInstance() + : multipleDetails_; + } + } + + /** + * .google.showcase.v1beta1.EchoErrorDetailsResponse.MultipleDetails multiple_details = 2; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.showcase.v1beta1.EchoErrorDetailsResponse.MultipleDetails, + com.google.showcase.v1beta1.EchoErrorDetailsResponse.MultipleDetails.Builder, + com.google.showcase.v1beta1.EchoErrorDetailsResponse.MultipleDetailsOrBuilder> + getMultipleDetailsFieldBuilder() { + if (multipleDetailsBuilder_ == null) { + multipleDetailsBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.showcase.v1beta1.EchoErrorDetailsResponse.MultipleDetails, + com.google.showcase.v1beta1.EchoErrorDetailsResponse.MultipleDetails.Builder, + com.google.showcase.v1beta1.EchoErrorDetailsResponse.MultipleDetailsOrBuilder>( + getMultipleDetails(), getParentForChildren(), isClean()); + multipleDetails_ = null; + } + return multipleDetailsBuilder_; + } + + @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.showcase.v1beta1.EchoErrorDetailsResponse) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.EchoErrorDetailsResponse) + private static final com.google.showcase.v1beta1.EchoErrorDetailsResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.EchoErrorDetailsResponse(); + } + + public static com.google.showcase.v1beta1.EchoErrorDetailsResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public EchoErrorDetailsResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new EchoErrorDetailsResponse(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.showcase.v1beta1.EchoErrorDetailsResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/EchoErrorDetailsResponseOrBuilder.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/EchoErrorDetailsResponseOrBuilder.java new file mode 100644 index 0000000000..bb1f10f76c --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/EchoErrorDetailsResponseOrBuilder.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: schema/google/showcase/v1beta1/echo.proto + +package com.google.showcase.v1beta1; + +public interface EchoErrorDetailsResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.EchoErrorDetailsResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * .google.showcase.v1beta1.EchoErrorDetailsResponse.SingleDetail single_detail = 1; + * + * @return Whether the singleDetail field is set. + */ + boolean hasSingleDetail(); + + /** + * .google.showcase.v1beta1.EchoErrorDetailsResponse.SingleDetail single_detail = 1; + * + * @return The singleDetail. + */ + com.google.showcase.v1beta1.EchoErrorDetailsResponse.SingleDetail getSingleDetail(); + + /** + * .google.showcase.v1beta1.EchoErrorDetailsResponse.SingleDetail single_detail = 1; + */ + com.google.showcase.v1beta1.EchoErrorDetailsResponse.SingleDetailOrBuilder + getSingleDetailOrBuilder(); + + /** + * .google.showcase.v1beta1.EchoErrorDetailsResponse.MultipleDetails multiple_details = 2; + * + * + * @return Whether the multipleDetails field is set. + */ + boolean hasMultipleDetails(); + + /** + * .google.showcase.v1beta1.EchoErrorDetailsResponse.MultipleDetails multiple_details = 2; + * + * + * @return The multipleDetails. + */ + com.google.showcase.v1beta1.EchoErrorDetailsResponse.MultipleDetails getMultipleDetails(); + + /** + * .google.showcase.v1beta1.EchoErrorDetailsResponse.MultipleDetails multiple_details = 2; + * + */ + com.google.showcase.v1beta1.EchoErrorDetailsResponse.MultipleDetailsOrBuilder + getMultipleDetailsOrBuilder(); +} diff --git a/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/EchoOuterClass.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/EchoOuterClass.java new file mode 100644 index 0000000000..5c73f5d3e1 --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/EchoOuterClass.java @@ -0,0 +1,506 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/echo.proto + +package com.google.showcase.v1beta1; + +public final class EchoOuterClass { + private EchoOuterClass() {} + + 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_showcase_v1beta1_EchoRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_showcase_v1beta1_EchoRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_showcase_v1beta1_EchoResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_showcase_v1beta1_EchoResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_showcase_v1beta1_EchoErrorDetailsRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_showcase_v1beta1_EchoErrorDetailsRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_showcase_v1beta1_EchoErrorDetailsResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_showcase_v1beta1_EchoErrorDetailsResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_showcase_v1beta1_EchoErrorDetailsResponse_SingleDetail_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_showcase_v1beta1_EchoErrorDetailsResponse_SingleDetail_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_showcase_v1beta1_EchoErrorDetailsResponse_MultipleDetails_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_showcase_v1beta1_EchoErrorDetailsResponse_MultipleDetails_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_showcase_v1beta1_ErrorWithSingleDetail_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_showcase_v1beta1_ErrorWithSingleDetail_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_showcase_v1beta1_ErrorWithMultipleDetails_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_showcase_v1beta1_ErrorWithMultipleDetails_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_showcase_v1beta1_PoetryError_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_showcase_v1beta1_PoetryError_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_showcase_v1beta1_FailEchoWithDetailsRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_showcase_v1beta1_FailEchoWithDetailsRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_showcase_v1beta1_FailEchoWithDetailsResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_showcase_v1beta1_FailEchoWithDetailsResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_showcase_v1beta1_ExpandRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_showcase_v1beta1_ExpandRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_showcase_v1beta1_PagedExpandRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_showcase_v1beta1_PagedExpandRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_showcase_v1beta1_PagedExpandLegacyRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_showcase_v1beta1_PagedExpandLegacyRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_showcase_v1beta1_PagedExpandResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_showcase_v1beta1_PagedExpandResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_showcase_v1beta1_PagedExpandResponseList_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_showcase_v1beta1_PagedExpandResponseList_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_showcase_v1beta1_PagedExpandLegacyMappedResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_showcase_v1beta1_PagedExpandLegacyMappedResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_showcase_v1beta1_PagedExpandLegacyMappedResponse_AlphabetizedEntry_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_showcase_v1beta1_PagedExpandLegacyMappedResponse_AlphabetizedEntry_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_showcase_v1beta1_WaitRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_showcase_v1beta1_WaitRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_showcase_v1beta1_WaitResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_showcase_v1beta1_WaitResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_showcase_v1beta1_WaitMetadata_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_showcase_v1beta1_WaitMetadata_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_showcase_v1beta1_BlockRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_showcase_v1beta1_BlockRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_showcase_v1beta1_BlockResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_showcase_v1beta1_BlockResponse_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" + + ")schema/google/showcase/v1beta1/echo.pr" + + "oto\022\027google.showcase.v1beta1\032\034google/api" + + "/annotations.proto\032\027google/api/client.pr" + + "oto\032\037google/api/field_behavior.proto\032\033go" + + "ogle/api/field_info.proto\032\030google/api/ro" + + "uting.proto\032#google/longrunning/operatio" + + "ns.proto\032\031google/protobuf/any.proto\032\036goo" + + "gle/protobuf/duration.proto\032\037google/prot" + + "obuf/timestamp.proto\032\027google/rpc/status.proto\"\210\002\n" + + "\013EchoRequest\022\021\n" + + "\007content\030\001 \001(\tH\000\022#\n" + + "\005error\030\002 \001(\0132\022.google.rpc.StatusH\000\0223\n" + + "\010severity\030\003 \001(\0162!.google.showcase.v1beta1.Severity\022\016\n" + + "\006header\030\004 \001(\t\022\024\n" + + "\014other_header\030\005 \001(\t\022\034\n\n" + + "request_id\030\007 \001(\tB\010\342\214\317\327\010\002\010\001\022\'\n" + + "\020other_request_id\030\010 \001(" + + "\tB\010\342\214\317\327\010\002\010\001H\001\210\001\001B\n\n" + + "\010responseB\023\n" + + "\021_other_request_id\"\202\001\n" + + "\014EchoResponse\022\017\n" + + "\007content\030\001 \001(\t\0223\n" + + "\010severity\030\002 \001(\0162!.google.showcase.v1beta1.Severity\022\022\n\n" + + "request_id\030\003 \001(\t\022\030\n" + + "\020other_request_id\030\004 \001(\t\"P\n" + + "\027EchoErrorDetailsRequest\022\032\n" + + "\022single_detail_text\030\001 \001(\t\022\031\n" + + "\021multi_detail_text\030\002 \003(\t\"\362\002\n" + + "\030EchoErrorDetailsResponse\022U\n\r" + + "single_detail\030\001 \001(\0132>.google.showcase.v1" + + "beta1.EchoErrorDetailsResponse.SingleDetail\022[\n" + + "\020multiple_details\030\002 \001(\0132A.google.s" + + "howcase.v1beta1.EchoErrorDetailsResponse.MultipleDetails\032M\n" + + "\014SingleDetail\022=\n" + + "\005error\030\001 \001(\0132..google.showcase.v1beta1.ErrorWithSingleDetail\032S\n" + + "\017MultipleDetails\022@\n" + + "\005error\030\001 \001(\01321.google.showcase.v1beta1.ErrorWithMultipleDetails\">\n" + + "\025ErrorWithSingleDetail\022%\n" + + "\007details\030\001 \001(\0132\024.google.protobuf.Any\"A\n" + + "\030ErrorWithMultipleDetails\022%\n" + + "\007details\030\001 \003(\0132\024.google.protobuf.Any\"\033\n" + + "\013PoetryError\022\014\n" + + "\004poem\030\001 \001(\t\"-\n" + + "\032FailEchoWithDetailsRequest\022\017\n" + + "\007message\030\001 \001(\t\"\035\n" + + "\033FailEchoWithDetailsResponse\"x\n\r" + + "ExpandRequest\022\017\n" + + "\007content\030\001 \001(\t\022!\n" + + "\005error\030\002 \001(\0132\022.google.rpc.Status\0223\n" + + "\020stream_wait_time\030\003 \001(\0132\031.google.protobuf.Duration\"Q\n" + + "\022PagedExpandRequest\022\024\n" + + "\007content\030\001 \001(\tB\003\340A\002\022\021\n" + + "\tpage_size\030\002 \001(\005\022\022\n\n" + + "page_token\030\003 \001(\t\"Y\n" + + "\030PagedExpandLegacyRequest\022\024\n" + + "\007content\030\001 \001(\tB\003\340A\002\022\023\n" + + "\013max_results\030\002 \001(\005\022\022\n\n" + + "page_token\030\003 \001(\t\"h\n" + + "\023PagedExpandResponse\0228\n" + + "\tresponses\030\001 \003(\0132%.google.showcase.v1beta1.EchoResponse\022\027\n" + + "\017next_page_token\030\002 \001(\t\"(\n" + + "\027PagedExpandResponseList\022\r\n" + + "\005words\030\001 \003(\t\"\203\002\n" + + "\037PagedExpandLegacyMappedResponse\022`\n" + + "\014alphabetized\030\001 \003(\013" + + "2J.google.showcase.v1beta1.PagedExpandLegacyMappedResponse.AlphabetizedEntry\022\027\n" + + "\017next_page_token\030\002 \001(\t\032e\n" + + "\021AlphabetizedEntry\022\013\n" + + "\003key\030\001 \001(\t\022?\n" + + "\005value\030\002 \001(\01320.google." + + "showcase.v1beta1.PagedExpandResponseList:\0028\001\"\331\001\n" + + "\013WaitRequest\022.\n" + + "\010end_time\030\001 \001(\0132\032.google.protobuf.TimestampH\000\022(\n" + + "\003ttl\030\004 \001(\0132\031.google.protobuf.DurationH\000\022#\n" + + "\005error\030\002 \001(\0132\022.google.rpc.StatusH\001\0228\n" + + "\007success\030\003 \001(\0132%.google.showcase.v1beta1.WaitResponseH\001B\005\n" + + "\003endB\n\n" + + "\010response\"\037\n" + + "\014WaitResponse\022\017\n" + + "\007content\030\001 \001(\t\"<\n" + + "\014WaitMetadata\022,\n" + + "\010end_time\030\001 \001(\0132\032.google.protobuf.Timestamp\"\255\001\n" + + "\014BlockRequest\0221\n" + + "\016response_delay\030\001 \001(\0132\031.google.protobuf.Duration\022#\n" + + "\005error\030\002 \001(\0132\022.google.rpc.StatusH\000\0229\n" + + "\007success\030\003 \001(\0132&.google.showcase.v1beta1.BlockResponseH\000B\n\n" + + "\010response\" \n\r" + + "BlockResponse\022\017\n" + + "\007content\030\001 \001(\t*D\n" + + "\010Severity\022\017\n" + + "\013UNNECESSARY\020\000\022\r" + + "\n" + + "\tNECESSARY\020\001\022\n\n" + + "\006URGENT\020\002\022\014\n" + + "\010CRITICAL\020\0032\337\016\n" + + "\004Echo\022\224\003\n" + + "\004Echo\022$.google.showcase.v1beta1.EchoRequest\032%.google.showcase.v1beta" + + "1.EchoResponse\"\276\002\202\323\344\223\002\027\"\022/v1beta1/echo:echo:\001*\212\323\344\223\002\232\002\022\010\n" + + "\006header\022\031\n" + + "\006header\022\017{routing_id=**}\022+\n" + + "\006header\022!{table_name=regions/*/zones/*/**}\022\"\n" + + "\006header\022\030{super_id=projects/*}/**\0220\n" + + "\006header\022&{table_name=projects/*/instances/*/**}\0221\n" + + "\006header\022\'projects/*/{instance_id=instances/*}/**\022\030\n" + + "\014other_header\022\010{baz=**}\022#\n" + + "\014other_header\022\023{qux=projects/*}/**\022\237\001\n" + + "\020EchoErrorDetails\0220.google.showcase.v1beta1.EchoErrorDetailsR" + + "equest\0321.google.showcase.v1beta1.EchoErrorDetailsResponse\"&\202\323\344\223\002" + + " \"\033/v1beta1/echo:error-details:\001*\022\252\001\n" + + "\023FailEchoWithDetails\0223.google.showcase.v1beta1.FailEchoWith" + + "DetailsRequest\0324.google.showcase.v1beta1" + + ".FailEchoWithDetailsResponse\"(\202\323\344\223\002\"\"\035/v1beta1/echo:failWithDetails:\001*\022\212\001\n" + + "\006Expand\022&.google.showcase.v1beta1.ExpandReques" + + "t\032%.google.showcase.v1beta1.EchoResponse\"/\202\323\344\223\002\031\"\024/v1beta1/echo:expand:\001*\332A\r" + + "content,error0\001\022z\n" + + "\007Collect\022$.google.showcase" + + ".v1beta1.EchoRequest\032%.google.showcase.v1beta1.EchoResponse\"" + + " \202\323\344\223\002\032\"\025/v1beta1/echo:collect:\001*(\001\022W\n" + + "\004Chat\022$.google.showcas" + + "e.v1beta1.EchoRequest\032%.google.showcase.v1beta1.EchoResponse(\0010\001\022\216\001\n" + + "\013PagedExpand\022+.google.showcase.v1beta1.PagedExpandRe" + + "quest\032,.google.showcase.v1beta1.PagedExp" + + "andResponse\"$\202\323\344\223\002\036\"\031/v1beta1/echo:pagedExpand:\001*\022\240\001\n" + + "\021PagedExpandLegacy\0221.google.showcase.v1beta1.PagedExpandLegacyReque" + + "st\032,.google.showcase.v1beta1.PagedExpand" + + "Response\"*\202\323\344\223\002$\"\037/v1beta1/echo:pagedExpandLegacy:\001*\022\262\001\n" + + "\027PagedExpandLegacyMapped\022+.google.showcase.v1beta1.PagedExpandRe" + + "quest\0328.google.showcase.v1beta1.PagedExp" + + "andLegacyMappedResponse\"0\202\323\344\223\002*\"%/v1beta1/echo:pagedExpandLegacyMapped:\001*\022\211\001\n" + + "\004Wait\022$.google.showcase.v1beta1.WaitRequest" + + "\032\035.google.longrunning.Operation\"<\202\323\344\223\002\027\"\022/v1beta1/echo:wait:\001*\312A\034\n" + + "\014WaitResponse\022\014WaitMetadata\022v\n" + + "\005Block\022%.google.showcase.v1beta1.BlockRequest\032&.google.showcase." + + "v1beta1.BlockResponse\"\036\202\323\344\223\002\030\"\023/v1beta1/" + + "echo:block:\001*\032\"\312A\016localhost:7469\212\324\333\322\017\013v1_20240408Bq\n" + + "\033com.google.showcase.v1beta1P\001Z4github.com/googleapis/gapic-showcase" + + "/server/genproto\352\002\031Google::Showcase::V1beta1b\006proto3" + }; + descriptor = + com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( + descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + com.google.api.AnnotationsProto.getDescriptor(), + com.google.api.ClientProto.getDescriptor(), + com.google.api.FieldBehaviorProto.getDescriptor(), + com.google.api.FieldInfoProto.getDescriptor(), + com.google.api.RoutingProto.getDescriptor(), + com.google.longrunning.OperationsProto.getDescriptor(), + com.google.protobuf.AnyProto.getDescriptor(), + com.google.protobuf.DurationProto.getDescriptor(), + com.google.protobuf.TimestampProto.getDescriptor(), + com.google.rpc.StatusProto.getDescriptor(), + }); + internal_static_google_showcase_v1beta1_EchoRequest_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_showcase_v1beta1_EchoRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_showcase_v1beta1_EchoRequest_descriptor, + new java.lang.String[] { + "Content", + "Error", + "Severity", + "Header", + "OtherHeader", + "RequestId", + "OtherRequestId", + "Response", + "OtherRequestId", + }); + internal_static_google_showcase_v1beta1_EchoResponse_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_google_showcase_v1beta1_EchoResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_showcase_v1beta1_EchoResponse_descriptor, + new java.lang.String[] { + "Content", "Severity", "RequestId", "OtherRequestId", + }); + internal_static_google_showcase_v1beta1_EchoErrorDetailsRequest_descriptor = + getDescriptor().getMessageTypes().get(2); + internal_static_google_showcase_v1beta1_EchoErrorDetailsRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_showcase_v1beta1_EchoErrorDetailsRequest_descriptor, + new java.lang.String[] { + "SingleDetailText", "MultiDetailText", + }); + internal_static_google_showcase_v1beta1_EchoErrorDetailsResponse_descriptor = + getDescriptor().getMessageTypes().get(3); + internal_static_google_showcase_v1beta1_EchoErrorDetailsResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_showcase_v1beta1_EchoErrorDetailsResponse_descriptor, + new java.lang.String[] { + "SingleDetail", "MultipleDetails", + }); + internal_static_google_showcase_v1beta1_EchoErrorDetailsResponse_SingleDetail_descriptor = + internal_static_google_showcase_v1beta1_EchoErrorDetailsResponse_descriptor + .getNestedTypes() + .get(0); + internal_static_google_showcase_v1beta1_EchoErrorDetailsResponse_SingleDetail_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_showcase_v1beta1_EchoErrorDetailsResponse_SingleDetail_descriptor, + new java.lang.String[] { + "Error", + }); + internal_static_google_showcase_v1beta1_EchoErrorDetailsResponse_MultipleDetails_descriptor = + internal_static_google_showcase_v1beta1_EchoErrorDetailsResponse_descriptor + .getNestedTypes() + .get(1); + internal_static_google_showcase_v1beta1_EchoErrorDetailsResponse_MultipleDetails_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_showcase_v1beta1_EchoErrorDetailsResponse_MultipleDetails_descriptor, + new java.lang.String[] { + "Error", + }); + internal_static_google_showcase_v1beta1_ErrorWithSingleDetail_descriptor = + getDescriptor().getMessageTypes().get(4); + internal_static_google_showcase_v1beta1_ErrorWithSingleDetail_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_showcase_v1beta1_ErrorWithSingleDetail_descriptor, + new java.lang.String[] { + "Details", + }); + internal_static_google_showcase_v1beta1_ErrorWithMultipleDetails_descriptor = + getDescriptor().getMessageTypes().get(5); + internal_static_google_showcase_v1beta1_ErrorWithMultipleDetails_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_showcase_v1beta1_ErrorWithMultipleDetails_descriptor, + new java.lang.String[] { + "Details", + }); + internal_static_google_showcase_v1beta1_PoetryError_descriptor = + getDescriptor().getMessageTypes().get(6); + internal_static_google_showcase_v1beta1_PoetryError_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_showcase_v1beta1_PoetryError_descriptor, + new java.lang.String[] { + "Poem", + }); + internal_static_google_showcase_v1beta1_FailEchoWithDetailsRequest_descriptor = + getDescriptor().getMessageTypes().get(7); + internal_static_google_showcase_v1beta1_FailEchoWithDetailsRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_showcase_v1beta1_FailEchoWithDetailsRequest_descriptor, + new java.lang.String[] { + "Message", + }); + internal_static_google_showcase_v1beta1_FailEchoWithDetailsResponse_descriptor = + getDescriptor().getMessageTypes().get(8); + internal_static_google_showcase_v1beta1_FailEchoWithDetailsResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_showcase_v1beta1_FailEchoWithDetailsResponse_descriptor, + new java.lang.String[] {}); + internal_static_google_showcase_v1beta1_ExpandRequest_descriptor = + getDescriptor().getMessageTypes().get(9); + internal_static_google_showcase_v1beta1_ExpandRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_showcase_v1beta1_ExpandRequest_descriptor, + new java.lang.String[] { + "Content", "Error", "StreamWaitTime", + }); + internal_static_google_showcase_v1beta1_PagedExpandRequest_descriptor = + getDescriptor().getMessageTypes().get(10); + internal_static_google_showcase_v1beta1_PagedExpandRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_showcase_v1beta1_PagedExpandRequest_descriptor, + new java.lang.String[] { + "Content", "PageSize", "PageToken", + }); + internal_static_google_showcase_v1beta1_PagedExpandLegacyRequest_descriptor = + getDescriptor().getMessageTypes().get(11); + internal_static_google_showcase_v1beta1_PagedExpandLegacyRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_showcase_v1beta1_PagedExpandLegacyRequest_descriptor, + new java.lang.String[] { + "Content", "MaxResults", "PageToken", + }); + internal_static_google_showcase_v1beta1_PagedExpandResponse_descriptor = + getDescriptor().getMessageTypes().get(12); + internal_static_google_showcase_v1beta1_PagedExpandResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_showcase_v1beta1_PagedExpandResponse_descriptor, + new java.lang.String[] { + "Responses", "NextPageToken", + }); + internal_static_google_showcase_v1beta1_PagedExpandResponseList_descriptor = + getDescriptor().getMessageTypes().get(13); + internal_static_google_showcase_v1beta1_PagedExpandResponseList_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_showcase_v1beta1_PagedExpandResponseList_descriptor, + new java.lang.String[] { + "Words", + }); + internal_static_google_showcase_v1beta1_PagedExpandLegacyMappedResponse_descriptor = + getDescriptor().getMessageTypes().get(14); + internal_static_google_showcase_v1beta1_PagedExpandLegacyMappedResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_showcase_v1beta1_PagedExpandLegacyMappedResponse_descriptor, + new java.lang.String[] { + "Alphabetized", "NextPageToken", + }); + internal_static_google_showcase_v1beta1_PagedExpandLegacyMappedResponse_AlphabetizedEntry_descriptor = + internal_static_google_showcase_v1beta1_PagedExpandLegacyMappedResponse_descriptor + .getNestedTypes() + .get(0); + internal_static_google_showcase_v1beta1_PagedExpandLegacyMappedResponse_AlphabetizedEntry_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_showcase_v1beta1_PagedExpandLegacyMappedResponse_AlphabetizedEntry_descriptor, + new java.lang.String[] { + "Key", "Value", + }); + internal_static_google_showcase_v1beta1_WaitRequest_descriptor = + getDescriptor().getMessageTypes().get(15); + internal_static_google_showcase_v1beta1_WaitRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_showcase_v1beta1_WaitRequest_descriptor, + new java.lang.String[] { + "EndTime", "Ttl", "Error", "Success", "End", "Response", + }); + internal_static_google_showcase_v1beta1_WaitResponse_descriptor = + getDescriptor().getMessageTypes().get(16); + internal_static_google_showcase_v1beta1_WaitResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_showcase_v1beta1_WaitResponse_descriptor, + new java.lang.String[] { + "Content", + }); + internal_static_google_showcase_v1beta1_WaitMetadata_descriptor = + getDescriptor().getMessageTypes().get(17); + internal_static_google_showcase_v1beta1_WaitMetadata_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_showcase_v1beta1_WaitMetadata_descriptor, + new java.lang.String[] { + "EndTime", + }); + internal_static_google_showcase_v1beta1_BlockRequest_descriptor = + getDescriptor().getMessageTypes().get(18); + internal_static_google_showcase_v1beta1_BlockRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_showcase_v1beta1_BlockRequest_descriptor, + new java.lang.String[] { + "ResponseDelay", "Error", "Success", "Response", + }); + internal_static_google_showcase_v1beta1_BlockResponse_descriptor = + getDescriptor().getMessageTypes().get(19); + internal_static_google_showcase_v1beta1_BlockResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_showcase_v1beta1_BlockResponse_descriptor, + new java.lang.String[] { + "Content", + }); + com.google.protobuf.ExtensionRegistry registry = + com.google.protobuf.ExtensionRegistry.newInstance(); + registry.add(com.google.api.ClientProto.apiVersion); + registry.add(com.google.api.ClientProto.defaultHost); + registry.add(com.google.api.FieldBehaviorProto.fieldBehavior); + registry.add(com.google.api.FieldInfoProto.fieldInfo); + registry.add(com.google.api.AnnotationsProto.http); + registry.add(com.google.api.ClientProto.methodSignature); + registry.add(com.google.api.RoutingProto.routing); + 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.FieldInfoProto.getDescriptor(); + com.google.api.RoutingProto.getDescriptor(); + com.google.longrunning.OperationsProto.getDescriptor(); + com.google.protobuf.AnyProto.getDescriptor(); + com.google.protobuf.DurationProto.getDescriptor(); + com.google.protobuf.TimestampProto.getDescriptor(); + com.google.rpc.StatusProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/EchoRequest.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/EchoRequest.java new file mode 100644 index 0000000000..762a037753 --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/EchoRequest.java @@ -0,0 +1,2039 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/echo.proto + +package com.google.showcase.v1beta1; + +/** + * + * + *
        + * The request message used for the Echo, Collect and Chat methods.
        + * If content or opt are set in this message then the request will succeed.
        + * If status is set in this message then the status will be returned as an
        + * error.
        + * 
        + * + * Protobuf type {@code google.showcase.v1beta1.EchoRequest} + */ +public final class EchoRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.EchoRequest) + EchoRequestOrBuilder { + private static final long serialVersionUID = 0L; + + // Use EchoRequest.newBuilder() to construct. + private EchoRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private EchoRequest() { + severity_ = 0; + header_ = ""; + otherHeader_ = ""; + requestId_ = ""; + otherRequestId_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new EchoRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private EchoRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + responseCase_ = 1; + response_ = s; + break; + } + case 18: + { + com.google.rpc.Status.Builder subBuilder = null; + if (responseCase_ == 2) { + subBuilder = ((com.google.rpc.Status) response_).toBuilder(); + } + response_ = input.readMessage(com.google.rpc.Status.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom((com.google.rpc.Status) response_); + response_ = subBuilder.buildPartial(); + } + responseCase_ = 2; + break; + } + case 24: + { + int rawValue = input.readEnum(); + + severity_ = rawValue; + break; + } + case 34: + { + java.lang.String s = input.readStringRequireUtf8(); + + header_ = s; + break; + } + case 42: + { + java.lang.String s = input.readStringRequireUtf8(); + + otherHeader_ = s; + break; + } + case 58: + { + java.lang.String s = input.readStringRequireUtf8(); + + requestId_ = s; + break; + } + case 66: + { + java.lang.String s = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + otherRequestId_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.EchoOuterClass + .internal_static_google_showcase_v1beta1_EchoRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.EchoOuterClass + .internal_static_google_showcase_v1beta1_EchoRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.EchoRequest.class, + com.google.showcase.v1beta1.EchoRequest.Builder.class); + } + + private int bitField0_; + private int responseCase_ = 0; + private java.lang.Object response_; + + public enum ResponseCase + implements + com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + CONTENT(1), + ERROR(2), + RESPONSE_NOT_SET(0); + private final int value; + + private ResponseCase(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 ResponseCase valueOf(int value) { + return forNumber(value); + } + + public static ResponseCase forNumber(int value) { + switch (value) { + case 1: + return CONTENT; + case 2: + return ERROR; + case 0: + return RESPONSE_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public ResponseCase getResponseCase() { + return ResponseCase.forNumber(responseCase_); + } + + public static final int CONTENT_FIELD_NUMBER = 1; + + /** + * + * + *
        +   * The content to be echoed by the server.
        +   * 
        + * + * string content = 1; + * + * @return Whether the content field is set. + */ + public boolean hasContent() { + return responseCase_ == 1; + } + + /** + * + * + *
        +   * The content to be echoed by the server.
        +   * 
        + * + * string content = 1; + * + * @return The content. + */ + public java.lang.String getContent() { + java.lang.Object ref = ""; + if (responseCase_ == 1) { + ref = response_; + } + 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 (responseCase_ == 1) { + response_ = s; + } + return s; + } + } + + /** + * + * + *
        +   * The content to be echoed by the server.
        +   * 
        + * + * string content = 1; + * + * @return The bytes for content. + */ + public com.google.protobuf.ByteString getContentBytes() { + java.lang.Object ref = ""; + if (responseCase_ == 1) { + ref = response_; + } + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + if (responseCase_ == 1) { + response_ = b; + } + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int ERROR_FIELD_NUMBER = 2; + + /** + * + * + *
        +   * The error to be thrown by the server.
        +   * 
        + * + * .google.rpc.Status error = 2; + * + * @return Whether the error field is set. + */ + @java.lang.Override + public boolean hasError() { + return responseCase_ == 2; + } + + /** + * + * + *
        +   * The error to be thrown by the server.
        +   * 
        + * + * .google.rpc.Status error = 2; + * + * @return The error. + */ + @java.lang.Override + public com.google.rpc.Status getError() { + if (responseCase_ == 2) { + return (com.google.rpc.Status) response_; + } + return com.google.rpc.Status.getDefaultInstance(); + } + + /** + * + * + *
        +   * The error to be thrown by the server.
        +   * 
        + * + * .google.rpc.Status error = 2; + */ + @java.lang.Override + public com.google.rpc.StatusOrBuilder getErrorOrBuilder() { + if (responseCase_ == 2) { + return (com.google.rpc.Status) response_; + } + return com.google.rpc.Status.getDefaultInstance(); + } + + public static final int SEVERITY_FIELD_NUMBER = 3; + private int severity_; + + /** + * + * + *
        +   * The severity to be echoed by the server.
        +   * 
        + * + * .google.showcase.v1beta1.Severity severity = 3; + * + * @return The enum numeric value on the wire for severity. + */ + @java.lang.Override + public int getSeverityValue() { + return severity_; + } + + /** + * + * + *
        +   * The severity to be echoed by the server.
        +   * 
        + * + * .google.showcase.v1beta1.Severity severity = 3; + * + * @return The severity. + */ + @java.lang.Override + public com.google.showcase.v1beta1.Severity getSeverity() { + @SuppressWarnings("deprecation") + com.google.showcase.v1beta1.Severity result = + com.google.showcase.v1beta1.Severity.valueOf(severity_); + return result == null ? com.google.showcase.v1beta1.Severity.UNRECOGNIZED : result; + } + + public static final int HEADER_FIELD_NUMBER = 4; + private volatile java.lang.Object header_; + + /** + * + * + *
        +   * Optional. This field can be set to test the routing annotation on the Echo method.
        +   * 
        + * + * string header = 4; + * + * @return The header. + */ + @java.lang.Override + public java.lang.String getHeader() { + java.lang.Object ref = header_; + 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(); + header_ = s; + return s; + } + } + + /** + * + * + *
        +   * Optional. This field can be set to test the routing annotation on the Echo method.
        +   * 
        + * + * string header = 4; + * + * @return The bytes for header. + */ + @java.lang.Override + public com.google.protobuf.ByteString getHeaderBytes() { + java.lang.Object ref = header_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + header_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int OTHER_HEADER_FIELD_NUMBER = 5; + private volatile java.lang.Object otherHeader_; + + /** + * + * + *
        +   * Optional. This field can be set to test the routing annotation on the Echo method.
        +   * 
        + * + * string other_header = 5; + * + * @return The otherHeader. + */ + @java.lang.Override + public java.lang.String getOtherHeader() { + java.lang.Object ref = otherHeader_; + 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(); + otherHeader_ = s; + return s; + } + } + + /** + * + * + *
        +   * Optional. This field can be set to test the routing annotation on the Echo method.
        +   * 
        + * + * string other_header = 5; + * + * @return The bytes for otherHeader. + */ + @java.lang.Override + public com.google.protobuf.ByteString getOtherHeaderBytes() { + java.lang.Object ref = otherHeader_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + otherHeader_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int REQUEST_ID_FIELD_NUMBER = 7; + private volatile java.lang.Object requestId_; + + /** + * + * + *
        +   * To facilitate testing of https://google.aip.dev/client-libraries/4235
        +   * 
        + * + * string request_id = 7 [(.google.api.field_info) = { ... } + * + * @return The requestId. + */ + @java.lang.Override + public java.lang.String getRequestId() { + java.lang.Object ref = requestId_; + 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(); + requestId_ = s; + return s; + } + } + + /** + * + * + *
        +   * To facilitate testing of https://google.aip.dev/client-libraries/4235
        +   * 
        + * + * string request_id = 7 [(.google.api.field_info) = { ... } + * + * @return The bytes for requestId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getRequestIdBytes() { + java.lang.Object ref = requestId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + requestId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int OTHER_REQUEST_ID_FIELD_NUMBER = 8; + private volatile java.lang.Object otherRequestId_; + + /** + * + * + *
        +   * To facilitate testing of https://google.aip.dev/client-libraries/4235
        +   * 
        + * + * optional string other_request_id = 8 [(.google.api.field_info) = { ... } + * + * @return Whether the otherRequestId field is set. + */ + @java.lang.Override + public boolean hasOtherRequestId() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
        +   * To facilitate testing of https://google.aip.dev/client-libraries/4235
        +   * 
        + * + * optional string other_request_id = 8 [(.google.api.field_info) = { ... } + * + * @return The otherRequestId. + */ + @java.lang.Override + public java.lang.String getOtherRequestId() { + java.lang.Object ref = otherRequestId_; + 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(); + otherRequestId_ = s; + return s; + } + } + + /** + * + * + *
        +   * To facilitate testing of https://google.aip.dev/client-libraries/4235
        +   * 
        + * + * optional string other_request_id = 8 [(.google.api.field_info) = { ... } + * + * @return The bytes for otherRequestId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getOtherRequestIdBytes() { + java.lang.Object ref = otherRequestId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + otherRequestId_ = 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 (responseCase_ == 1) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, response_); + } + if (responseCase_ == 2) { + output.writeMessage(2, (com.google.rpc.Status) response_); + } + if (severity_ != com.google.showcase.v1beta1.Severity.UNNECESSARY.getNumber()) { + output.writeEnum(3, severity_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(header_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, header_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(otherHeader_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 5, otherHeader_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(requestId_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 7, requestId_); + } + if (((bitField0_ & 0x00000001) != 0)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 8, otherRequestId_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (responseCase_ == 1) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, response_); + } + if (responseCase_ == 2) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 2, (com.google.rpc.Status) response_); + } + if (severity_ != com.google.showcase.v1beta1.Severity.UNNECESSARY.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(3, severity_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(header_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, header_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(otherHeader_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, otherHeader_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(requestId_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(7, requestId_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(8, otherRequestId_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.showcase.v1beta1.EchoRequest)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.EchoRequest other = (com.google.showcase.v1beta1.EchoRequest) obj; + + if (severity_ != other.severity_) return false; + if (!getHeader().equals(other.getHeader())) return false; + if (!getOtherHeader().equals(other.getOtherHeader())) return false; + if (!getRequestId().equals(other.getRequestId())) return false; + if (hasOtherRequestId() != other.hasOtherRequestId()) return false; + if (hasOtherRequestId()) { + if (!getOtherRequestId().equals(other.getOtherRequestId())) return false; + } + if (!getResponseCase().equals(other.getResponseCase())) return false; + switch (responseCase_) { + case 1: + if (!getContent().equals(other.getContent())) return false; + break; + case 2: + if (!getError().equals(other.getError())) return false; + break; + case 0: + default: + } + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + SEVERITY_FIELD_NUMBER; + hash = (53 * hash) + severity_; + hash = (37 * hash) + HEADER_FIELD_NUMBER; + hash = (53 * hash) + getHeader().hashCode(); + hash = (37 * hash) + OTHER_HEADER_FIELD_NUMBER; + hash = (53 * hash) + getOtherHeader().hashCode(); + hash = (37 * hash) + REQUEST_ID_FIELD_NUMBER; + hash = (53 * hash) + getRequestId().hashCode(); + if (hasOtherRequestId()) { + hash = (37 * hash) + OTHER_REQUEST_ID_FIELD_NUMBER; + hash = (53 * hash) + getOtherRequestId().hashCode(); + } + switch (responseCase_) { + case 1: + hash = (37 * hash) + CONTENT_FIELD_NUMBER; + hash = (53 * hash) + getContent().hashCode(); + break; + case 2: + hash = (37 * hash) + ERROR_FIELD_NUMBER; + hash = (53 * hash) + getError().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.showcase.v1beta1.EchoRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.EchoRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.EchoRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.EchoRequest 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.showcase.v1beta1.EchoRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.EchoRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.EchoRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.EchoRequest 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.showcase.v1beta1.EchoRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.EchoRequest 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.showcase.v1beta1.EchoRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.EchoRequest 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.showcase.v1beta1.EchoRequest 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 request message used for the Echo, Collect and Chat methods.
        +   * If content or opt are set in this message then the request will succeed.
        +   * If status is set in this message then the status will be returned as an
        +   * error.
        +   * 
        + * + * Protobuf type {@code google.showcase.v1beta1.EchoRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.EchoRequest) + com.google.showcase.v1beta1.EchoRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.EchoOuterClass + .internal_static_google_showcase_v1beta1_EchoRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.EchoOuterClass + .internal_static_google_showcase_v1beta1_EchoRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.EchoRequest.class, + com.google.showcase.v1beta1.EchoRequest.Builder.class); + } + + // Construct using com.google.showcase.v1beta1.EchoRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + severity_ = 0; + + header_ = ""; + + otherHeader_ = ""; + + requestId_ = ""; + + otherRequestId_ = ""; + bitField0_ = (bitField0_ & ~0x00000001); + responseCase_ = 0; + response_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.showcase.v1beta1.EchoOuterClass + .internal_static_google_showcase_v1beta1_EchoRequest_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.EchoRequest getDefaultInstanceForType() { + return com.google.showcase.v1beta1.EchoRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.EchoRequest build() { + com.google.showcase.v1beta1.EchoRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.EchoRequest buildPartial() { + com.google.showcase.v1beta1.EchoRequest result = + new com.google.showcase.v1beta1.EchoRequest(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (responseCase_ == 1) { + result.response_ = response_; + } + if (responseCase_ == 2) { + if (errorBuilder_ == null) { + result.response_ = response_; + } else { + result.response_ = errorBuilder_.build(); + } + } + result.severity_ = severity_; + result.header_ = header_; + result.otherHeader_ = otherHeader_; + result.requestId_ = requestId_; + if (((from_bitField0_ & 0x00000001) != 0)) { + to_bitField0_ |= 0x00000001; + } + result.otherRequestId_ = otherRequestId_; + result.bitField0_ = to_bitField0_; + result.responseCase_ = responseCase_; + 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.showcase.v1beta1.EchoRequest) { + return mergeFrom((com.google.showcase.v1beta1.EchoRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.showcase.v1beta1.EchoRequest other) { + if (other == com.google.showcase.v1beta1.EchoRequest.getDefaultInstance()) return this; + if (other.severity_ != 0) { + setSeverityValue(other.getSeverityValue()); + } + if (!other.getHeader().isEmpty()) { + header_ = other.header_; + onChanged(); + } + if (!other.getOtherHeader().isEmpty()) { + otherHeader_ = other.otherHeader_; + onChanged(); + } + if (!other.getRequestId().isEmpty()) { + requestId_ = other.requestId_; + onChanged(); + } + if (other.hasOtherRequestId()) { + bitField0_ |= 0x00000001; + otherRequestId_ = other.otherRequestId_; + onChanged(); + } + switch (other.getResponseCase()) { + case CONTENT: + { + responseCase_ = 1; + response_ = other.response_; + onChanged(); + break; + } + case ERROR: + { + mergeError(other.getError()); + break; + } + case RESPONSE_NOT_SET: + { + break; + } + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.showcase.v1beta1.EchoRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.showcase.v1beta1.EchoRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int responseCase_ = 0; + private java.lang.Object response_; + + public ResponseCase getResponseCase() { + return ResponseCase.forNumber(responseCase_); + } + + public Builder clearResponse() { + responseCase_ = 0; + response_ = null; + onChanged(); + return this; + } + + private int bitField0_; + + /** + * + * + *
        +     * The content to be echoed by the server.
        +     * 
        + * + * string content = 1; + * + * @return Whether the content field is set. + */ + @java.lang.Override + public boolean hasContent() { + return responseCase_ == 1; + } + + /** + * + * + *
        +     * The content to be echoed by the server.
        +     * 
        + * + * string content = 1; + * + * @return The content. + */ + @java.lang.Override + public java.lang.String getContent() { + java.lang.Object ref = ""; + if (responseCase_ == 1) { + ref = response_; + } + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (responseCase_ == 1) { + response_ = s; + } + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
        +     * The content to be echoed by the server.
        +     * 
        + * + * string content = 1; + * + * @return The bytes for content. + */ + @java.lang.Override + public com.google.protobuf.ByteString getContentBytes() { + java.lang.Object ref = ""; + if (responseCase_ == 1) { + ref = response_; + } + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + if (responseCase_ == 1) { + response_ = b; + } + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
        +     * The content to be echoed by the server.
        +     * 
        + * + * string content = 1; + * + * @param value The content to set. + * @return This builder for chaining. + */ + public Builder setContent(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + responseCase_ = 1; + response_ = value; + onChanged(); + return this; + } + + /** + * + * + *
        +     * The content to be echoed by the server.
        +     * 
        + * + * string content = 1; + * + * @return This builder for chaining. + */ + public Builder clearContent() { + if (responseCase_ == 1) { + responseCase_ = 0; + response_ = null; + onChanged(); + } + return this; + } + + /** + * + * + *
        +     * The content to be echoed by the server.
        +     * 
        + * + * string content = 1; + * + * @param value The bytes for content to set. + * @return This builder for chaining. + */ + public Builder setContentBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + responseCase_ = 1; + response_ = value; + onChanged(); + return this; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.rpc.Status, com.google.rpc.Status.Builder, com.google.rpc.StatusOrBuilder> + errorBuilder_; + + /** + * + * + *
        +     * The error to be thrown by the server.
        +     * 
        + * + * .google.rpc.Status error = 2; + * + * @return Whether the error field is set. + */ + @java.lang.Override + public boolean hasError() { + return responseCase_ == 2; + } + + /** + * + * + *
        +     * The error to be thrown by the server.
        +     * 
        + * + * .google.rpc.Status error = 2; + * + * @return The error. + */ + @java.lang.Override + public com.google.rpc.Status getError() { + if (errorBuilder_ == null) { + if (responseCase_ == 2) { + return (com.google.rpc.Status) response_; + } + return com.google.rpc.Status.getDefaultInstance(); + } else { + if (responseCase_ == 2) { + return errorBuilder_.getMessage(); + } + return com.google.rpc.Status.getDefaultInstance(); + } + } + + /** + * + * + *
        +     * The error to be thrown by the server.
        +     * 
        + * + * .google.rpc.Status error = 2; + */ + public Builder setError(com.google.rpc.Status value) { + if (errorBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + response_ = value; + onChanged(); + } else { + errorBuilder_.setMessage(value); + } + responseCase_ = 2; + return this; + } + + /** + * + * + *
        +     * The error to be thrown by the server.
        +     * 
        + * + * .google.rpc.Status error = 2; + */ + public Builder setError(com.google.rpc.Status.Builder builderForValue) { + if (errorBuilder_ == null) { + response_ = builderForValue.build(); + onChanged(); + } else { + errorBuilder_.setMessage(builderForValue.build()); + } + responseCase_ = 2; + return this; + } + + /** + * + * + *
        +     * The error to be thrown by the server.
        +     * 
        + * + * .google.rpc.Status error = 2; + */ + public Builder mergeError(com.google.rpc.Status value) { + if (errorBuilder_ == null) { + if (responseCase_ == 2 && response_ != com.google.rpc.Status.getDefaultInstance()) { + response_ = + com.google.rpc.Status.newBuilder((com.google.rpc.Status) response_) + .mergeFrom(value) + .buildPartial(); + } else { + response_ = value; + } + onChanged(); + } else { + if (responseCase_ == 2) { + errorBuilder_.mergeFrom(value); + } else { + errorBuilder_.setMessage(value); + } + } + responseCase_ = 2; + return this; + } + + /** + * + * + *
        +     * The error to be thrown by the server.
        +     * 
        + * + * .google.rpc.Status error = 2; + */ + public Builder clearError() { + if (errorBuilder_ == null) { + if (responseCase_ == 2) { + responseCase_ = 0; + response_ = null; + onChanged(); + } + } else { + if (responseCase_ == 2) { + responseCase_ = 0; + response_ = null; + } + errorBuilder_.clear(); + } + return this; + } + + /** + * + * + *
        +     * The error to be thrown by the server.
        +     * 
        + * + * .google.rpc.Status error = 2; + */ + public com.google.rpc.Status.Builder getErrorBuilder() { + return getErrorFieldBuilder().getBuilder(); + } + + /** + * + * + *
        +     * The error to be thrown by the server.
        +     * 
        + * + * .google.rpc.Status error = 2; + */ + @java.lang.Override + public com.google.rpc.StatusOrBuilder getErrorOrBuilder() { + if ((responseCase_ == 2) && (errorBuilder_ != null)) { + return errorBuilder_.getMessageOrBuilder(); + } else { + if (responseCase_ == 2) { + return (com.google.rpc.Status) response_; + } + return com.google.rpc.Status.getDefaultInstance(); + } + } + + /** + * + * + *
        +     * The error to be thrown by the server.
        +     * 
        + * + * .google.rpc.Status error = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.rpc.Status, com.google.rpc.Status.Builder, com.google.rpc.StatusOrBuilder> + getErrorFieldBuilder() { + if (errorBuilder_ == null) { + if (!(responseCase_ == 2)) { + response_ = com.google.rpc.Status.getDefaultInstance(); + } + errorBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.rpc.Status, + com.google.rpc.Status.Builder, + com.google.rpc.StatusOrBuilder>( + (com.google.rpc.Status) response_, getParentForChildren(), isClean()); + response_ = null; + } + responseCase_ = 2; + onChanged(); + ; + return errorBuilder_; + } + + private int severity_ = 0; + + /** + * + * + *
        +     * The severity to be echoed by the server.
        +     * 
        + * + * .google.showcase.v1beta1.Severity severity = 3; + * + * @return The enum numeric value on the wire for severity. + */ + @java.lang.Override + public int getSeverityValue() { + return severity_; + } + + /** + * + * + *
        +     * The severity to be echoed by the server.
        +     * 
        + * + * .google.showcase.v1beta1.Severity severity = 3; + * + * @param value The enum numeric value on the wire for severity to set. + * @return This builder for chaining. + */ + public Builder setSeverityValue(int value) { + + severity_ = value; + onChanged(); + return this; + } + + /** + * + * + *
        +     * The severity to be echoed by the server.
        +     * 
        + * + * .google.showcase.v1beta1.Severity severity = 3; + * + * @return The severity. + */ + @java.lang.Override + public com.google.showcase.v1beta1.Severity getSeverity() { + @SuppressWarnings("deprecation") + com.google.showcase.v1beta1.Severity result = + com.google.showcase.v1beta1.Severity.valueOf(severity_); + return result == null ? com.google.showcase.v1beta1.Severity.UNRECOGNIZED : result; + } + + /** + * + * + *
        +     * The severity to be echoed by the server.
        +     * 
        + * + * .google.showcase.v1beta1.Severity severity = 3; + * + * @param value The severity to set. + * @return This builder for chaining. + */ + public Builder setSeverity(com.google.showcase.v1beta1.Severity value) { + if (value == null) { + throw new NullPointerException(); + } + + severity_ = value.getNumber(); + onChanged(); + return this; + } + + /** + * + * + *
        +     * The severity to be echoed by the server.
        +     * 
        + * + * .google.showcase.v1beta1.Severity severity = 3; + * + * @return This builder for chaining. + */ + public Builder clearSeverity() { + + severity_ = 0; + onChanged(); + return this; + } + + private java.lang.Object header_ = ""; + + /** + * + * + *
        +     * Optional. This field can be set to test the routing annotation on the Echo method.
        +     * 
        + * + * string header = 4; + * + * @return The header. + */ + public java.lang.String getHeader() { + java.lang.Object ref = header_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + header_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
        +     * Optional. This field can be set to test the routing annotation on the Echo method.
        +     * 
        + * + * string header = 4; + * + * @return The bytes for header. + */ + public com.google.protobuf.ByteString getHeaderBytes() { + java.lang.Object ref = header_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + header_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
        +     * Optional. This field can be set to test the routing annotation on the Echo method.
        +     * 
        + * + * string header = 4; + * + * @param value The header to set. + * @return This builder for chaining. + */ + public Builder setHeader(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + header_ = value; + onChanged(); + return this; + } + + /** + * + * + *
        +     * Optional. This field can be set to test the routing annotation on the Echo method.
        +     * 
        + * + * string header = 4; + * + * @return This builder for chaining. + */ + public Builder clearHeader() { + + header_ = getDefaultInstance().getHeader(); + onChanged(); + return this; + } + + /** + * + * + *
        +     * Optional. This field can be set to test the routing annotation on the Echo method.
        +     * 
        + * + * string header = 4; + * + * @param value The bytes for header to set. + * @return This builder for chaining. + */ + public Builder setHeaderBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + header_ = value; + onChanged(); + return this; + } + + private java.lang.Object otherHeader_ = ""; + + /** + * + * + *
        +     * Optional. This field can be set to test the routing annotation on the Echo method.
        +     * 
        + * + * string other_header = 5; + * + * @return The otherHeader. + */ + public java.lang.String getOtherHeader() { + java.lang.Object ref = otherHeader_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + otherHeader_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
        +     * Optional. This field can be set to test the routing annotation on the Echo method.
        +     * 
        + * + * string other_header = 5; + * + * @return The bytes for otherHeader. + */ + public com.google.protobuf.ByteString getOtherHeaderBytes() { + java.lang.Object ref = otherHeader_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + otherHeader_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
        +     * Optional. This field can be set to test the routing annotation on the Echo method.
        +     * 
        + * + * string other_header = 5; + * + * @param value The otherHeader to set. + * @return This builder for chaining. + */ + public Builder setOtherHeader(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + otherHeader_ = value; + onChanged(); + return this; + } + + /** + * + * + *
        +     * Optional. This field can be set to test the routing annotation on the Echo method.
        +     * 
        + * + * string other_header = 5; + * + * @return This builder for chaining. + */ + public Builder clearOtherHeader() { + + otherHeader_ = getDefaultInstance().getOtherHeader(); + onChanged(); + return this; + } + + /** + * + * + *
        +     * Optional. This field can be set to test the routing annotation on the Echo method.
        +     * 
        + * + * string other_header = 5; + * + * @param value The bytes for otherHeader to set. + * @return This builder for chaining. + */ + public Builder setOtherHeaderBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + otherHeader_ = value; + onChanged(); + return this; + } + + private java.lang.Object requestId_ = ""; + + /** + * + * + *
        +     * To facilitate testing of https://google.aip.dev/client-libraries/4235
        +     * 
        + * + * string request_id = 7 [(.google.api.field_info) = { ... } + * + * @return The requestId. + */ + public java.lang.String getRequestId() { + java.lang.Object ref = requestId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + requestId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
        +     * To facilitate testing of https://google.aip.dev/client-libraries/4235
        +     * 
        + * + * string request_id = 7 [(.google.api.field_info) = { ... } + * + * @return The bytes for requestId. + */ + public com.google.protobuf.ByteString getRequestIdBytes() { + java.lang.Object ref = requestId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + requestId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
        +     * To facilitate testing of https://google.aip.dev/client-libraries/4235
        +     * 
        + * + * string request_id = 7 [(.google.api.field_info) = { ... } + * + * @param value The requestId to set. + * @return This builder for chaining. + */ + public Builder setRequestId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + requestId_ = value; + onChanged(); + return this; + } + + /** + * + * + *
        +     * To facilitate testing of https://google.aip.dev/client-libraries/4235
        +     * 
        + * + * string request_id = 7 [(.google.api.field_info) = { ... } + * + * @return This builder for chaining. + */ + public Builder clearRequestId() { + + requestId_ = getDefaultInstance().getRequestId(); + onChanged(); + return this; + } + + /** + * + * + *
        +     * To facilitate testing of https://google.aip.dev/client-libraries/4235
        +     * 
        + * + * string request_id = 7 [(.google.api.field_info) = { ... } + * + * @param value The bytes for requestId to set. + * @return This builder for chaining. + */ + public Builder setRequestIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + requestId_ = value; + onChanged(); + return this; + } + + private java.lang.Object otherRequestId_ = ""; + + /** + * + * + *
        +     * To facilitate testing of https://google.aip.dev/client-libraries/4235
        +     * 
        + * + * optional string other_request_id = 8 [(.google.api.field_info) = { ... } + * + * @return Whether the otherRequestId field is set. + */ + public boolean hasOtherRequestId() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
        +     * To facilitate testing of https://google.aip.dev/client-libraries/4235
        +     * 
        + * + * optional string other_request_id = 8 [(.google.api.field_info) = { ... } + * + * @return The otherRequestId. + */ + public java.lang.String getOtherRequestId() { + java.lang.Object ref = otherRequestId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + otherRequestId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
        +     * To facilitate testing of https://google.aip.dev/client-libraries/4235
        +     * 
        + * + * optional string other_request_id = 8 [(.google.api.field_info) = { ... } + * + * @return The bytes for otherRequestId. + */ + public com.google.protobuf.ByteString getOtherRequestIdBytes() { + java.lang.Object ref = otherRequestId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + otherRequestId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
        +     * To facilitate testing of https://google.aip.dev/client-libraries/4235
        +     * 
        + * + * optional string other_request_id = 8 [(.google.api.field_info) = { ... } + * + * @param value The otherRequestId to set. + * @return This builder for chaining. + */ + public Builder setOtherRequestId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000001; + otherRequestId_ = value; + onChanged(); + return this; + } + + /** + * + * + *
        +     * To facilitate testing of https://google.aip.dev/client-libraries/4235
        +     * 
        + * + * optional string other_request_id = 8 [(.google.api.field_info) = { ... } + * + * @return This builder for chaining. + */ + public Builder clearOtherRequestId() { + bitField0_ = (bitField0_ & ~0x00000001); + otherRequestId_ = getDefaultInstance().getOtherRequestId(); + onChanged(); + return this; + } + + /** + * + * + *
        +     * To facilitate testing of https://google.aip.dev/client-libraries/4235
        +     * 
        + * + * optional string other_request_id = 8 [(.google.api.field_info) = { ... } + * + * @param value The bytes for otherRequestId to set. + * @return This builder for chaining. + */ + public Builder setOtherRequestIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + bitField0_ |= 0x00000001; + otherRequestId_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.showcase.v1beta1.EchoRequest) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.EchoRequest) + private static final com.google.showcase.v1beta1.EchoRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.EchoRequest(); + } + + public static com.google.showcase.v1beta1.EchoRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public EchoRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new EchoRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.showcase.v1beta1.EchoRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/EchoRequestOrBuilder.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/EchoRequestOrBuilder.java new file mode 100644 index 0000000000..6abd7f146d --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/EchoRequestOrBuilder.java @@ -0,0 +1,246 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/echo.proto + +package com.google.showcase.v1beta1; + +public interface EchoRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.EchoRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
        +   * The content to be echoed by the server.
        +   * 
        + * + * string content = 1; + * + * @return Whether the content field is set. + */ + boolean hasContent(); + + /** + * + * + *
        +   * The content to be echoed by the server.
        +   * 
        + * + * string content = 1; + * + * @return The content. + */ + java.lang.String getContent(); + + /** + * + * + *
        +   * The content to be echoed by the server.
        +   * 
        + * + * string content = 1; + * + * @return The bytes for content. + */ + com.google.protobuf.ByteString getContentBytes(); + + /** + * + * + *
        +   * The error to be thrown by the server.
        +   * 
        + * + * .google.rpc.Status error = 2; + * + * @return Whether the error field is set. + */ + boolean hasError(); + + /** + * + * + *
        +   * The error to be thrown by the server.
        +   * 
        + * + * .google.rpc.Status error = 2; + * + * @return The error. + */ + com.google.rpc.Status getError(); + + /** + * + * + *
        +   * The error to be thrown by the server.
        +   * 
        + * + * .google.rpc.Status error = 2; + */ + com.google.rpc.StatusOrBuilder getErrorOrBuilder(); + + /** + * + * + *
        +   * The severity to be echoed by the server.
        +   * 
        + * + * .google.showcase.v1beta1.Severity severity = 3; + * + * @return The enum numeric value on the wire for severity. + */ + int getSeverityValue(); + + /** + * + * + *
        +   * The severity to be echoed by the server.
        +   * 
        + * + * .google.showcase.v1beta1.Severity severity = 3; + * + * @return The severity. + */ + com.google.showcase.v1beta1.Severity getSeverity(); + + /** + * + * + *
        +   * Optional. This field can be set to test the routing annotation on the Echo method.
        +   * 
        + * + * string header = 4; + * + * @return The header. + */ + java.lang.String getHeader(); + + /** + * + * + *
        +   * Optional. This field can be set to test the routing annotation on the Echo method.
        +   * 
        + * + * string header = 4; + * + * @return The bytes for header. + */ + com.google.protobuf.ByteString getHeaderBytes(); + + /** + * + * + *
        +   * Optional. This field can be set to test the routing annotation on the Echo method.
        +   * 
        + * + * string other_header = 5; + * + * @return The otherHeader. + */ + java.lang.String getOtherHeader(); + + /** + * + * + *
        +   * Optional. This field can be set to test the routing annotation on the Echo method.
        +   * 
        + * + * string other_header = 5; + * + * @return The bytes for otherHeader. + */ + com.google.protobuf.ByteString getOtherHeaderBytes(); + + /** + * + * + *
        +   * To facilitate testing of https://google.aip.dev/client-libraries/4235
        +   * 
        + * + * string request_id = 7 [(.google.api.field_info) = { ... } + * + * @return The requestId. + */ + java.lang.String getRequestId(); + + /** + * + * + *
        +   * To facilitate testing of https://google.aip.dev/client-libraries/4235
        +   * 
        + * + * string request_id = 7 [(.google.api.field_info) = { ... } + * + * @return The bytes for requestId. + */ + com.google.protobuf.ByteString getRequestIdBytes(); + + /** + * + * + *
        +   * To facilitate testing of https://google.aip.dev/client-libraries/4235
        +   * 
        + * + * optional string other_request_id = 8 [(.google.api.field_info) = { ... } + * + * @return Whether the otherRequestId field is set. + */ + boolean hasOtherRequestId(); + + /** + * + * + *
        +   * To facilitate testing of https://google.aip.dev/client-libraries/4235
        +   * 
        + * + * optional string other_request_id = 8 [(.google.api.field_info) = { ... } + * + * @return The otherRequestId. + */ + java.lang.String getOtherRequestId(); + + /** + * + * + *
        +   * To facilitate testing of https://google.aip.dev/client-libraries/4235
        +   * 
        + * + * optional string other_request_id = 8 [(.google.api.field_info) = { ... } + * + * @return The bytes for otherRequestId. + */ + com.google.protobuf.ByteString getOtherRequestIdBytes(); + + public com.google.showcase.v1beta1.EchoRequest.ResponseCase getResponseCase(); +} diff --git a/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/EchoResponse.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/EchoResponse.java new file mode 100644 index 0000000000..78616eba8e --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/EchoResponse.java @@ -0,0 +1,1173 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/echo.proto + +package com.google.showcase.v1beta1; + +/** + * + * + *
        + * The response message for the Echo methods.
        + * 
        + * + * Protobuf type {@code google.showcase.v1beta1.EchoResponse} + */ +public final class EchoResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.EchoResponse) + EchoResponseOrBuilder { + private static final long serialVersionUID = 0L; + + // Use EchoResponse.newBuilder() to construct. + private EchoResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private EchoResponse() { + content_ = ""; + severity_ = 0; + requestId_ = ""; + otherRequestId_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new EchoResponse(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private EchoResponse( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + content_ = s; + break; + } + case 16: + { + int rawValue = input.readEnum(); + + severity_ = rawValue; + break; + } + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + + requestId_ = s; + break; + } + case 34: + { + java.lang.String s = input.readStringRequireUtf8(); + + otherRequestId_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.EchoOuterClass + .internal_static_google_showcase_v1beta1_EchoResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.EchoOuterClass + .internal_static_google_showcase_v1beta1_EchoResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.EchoResponse.class, + com.google.showcase.v1beta1.EchoResponse.Builder.class); + } + + public static final int CONTENT_FIELD_NUMBER = 1; + private volatile java.lang.Object content_; + + /** + * + * + *
        +   * The content specified in the request.
        +   * 
        + * + * string content = 1; + * + * @return The content. + */ + @java.lang.Override + public java.lang.String getContent() { + java.lang.Object ref = content_; + 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(); + content_ = s; + return s; + } + } + + /** + * + * + *
        +   * The content specified in the request.
        +   * 
        + * + * string content = 1; + * + * @return The bytes for content. + */ + @java.lang.Override + public com.google.protobuf.ByteString getContentBytes() { + java.lang.Object ref = content_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + content_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int SEVERITY_FIELD_NUMBER = 2; + private int severity_; + + /** + * + * + *
        +   * The severity specified in the request.
        +   * 
        + * + * .google.showcase.v1beta1.Severity severity = 2; + * + * @return The enum numeric value on the wire for severity. + */ + @java.lang.Override + public int getSeverityValue() { + return severity_; + } + + /** + * + * + *
        +   * The severity specified in the request.
        +   * 
        + * + * .google.showcase.v1beta1.Severity severity = 2; + * + * @return The severity. + */ + @java.lang.Override + public com.google.showcase.v1beta1.Severity getSeverity() { + @SuppressWarnings("deprecation") + com.google.showcase.v1beta1.Severity result = + com.google.showcase.v1beta1.Severity.valueOf(severity_); + return result == null ? com.google.showcase.v1beta1.Severity.UNRECOGNIZED : result; + } + + public static final int REQUEST_ID_FIELD_NUMBER = 3; + private volatile java.lang.Object requestId_; + + /** + * + * + *
        +   * The request ID specified or autopopulated in the request.
        +   * 
        + * + * string request_id = 3; + * + * @return The requestId. + */ + @java.lang.Override + public java.lang.String getRequestId() { + java.lang.Object ref = requestId_; + 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(); + requestId_ = s; + return s; + } + } + + /** + * + * + *
        +   * The request ID specified or autopopulated in the request.
        +   * 
        + * + * string request_id = 3; + * + * @return The bytes for requestId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getRequestIdBytes() { + java.lang.Object ref = requestId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + requestId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int OTHER_REQUEST_ID_FIELD_NUMBER = 4; + private volatile java.lang.Object otherRequestId_; + + /** + * + * + *
        +   * The other request ID specified or autopopulated in the request.
        +   * 
        + * + * string other_request_id = 4; + * + * @return The otherRequestId. + */ + @java.lang.Override + public java.lang.String getOtherRequestId() { + java.lang.Object ref = otherRequestId_; + 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(); + otherRequestId_ = s; + return s; + } + } + + /** + * + * + *
        +   * The other request ID specified or autopopulated in the request.
        +   * 
        + * + * string other_request_id = 4; + * + * @return The bytes for otherRequestId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getOtherRequestIdBytes() { + java.lang.Object ref = otherRequestId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + otherRequestId_ = 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(content_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, content_); + } + if (severity_ != com.google.showcase.v1beta1.Severity.UNNECESSARY.getNumber()) { + output.writeEnum(2, severity_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(requestId_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, requestId_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(otherRequestId_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, otherRequestId_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(content_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, content_); + } + if (severity_ != com.google.showcase.v1beta1.Severity.UNNECESSARY.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(2, severity_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(requestId_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, requestId_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(otherRequestId_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, otherRequestId_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.showcase.v1beta1.EchoResponse)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.EchoResponse other = (com.google.showcase.v1beta1.EchoResponse) obj; + + if (!getContent().equals(other.getContent())) return false; + if (severity_ != other.severity_) return false; + if (!getRequestId().equals(other.getRequestId())) return false; + if (!getOtherRequestId().equals(other.getOtherRequestId())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + CONTENT_FIELD_NUMBER; + hash = (53 * hash) + getContent().hashCode(); + hash = (37 * hash) + SEVERITY_FIELD_NUMBER; + hash = (53 * hash) + severity_; + hash = (37 * hash) + REQUEST_ID_FIELD_NUMBER; + hash = (53 * hash) + getRequestId().hashCode(); + hash = (37 * hash) + OTHER_REQUEST_ID_FIELD_NUMBER; + hash = (53 * hash) + getOtherRequestId().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.showcase.v1beta1.EchoResponse parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.EchoResponse parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.EchoResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.EchoResponse 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.showcase.v1beta1.EchoResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.EchoResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.EchoResponse parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.EchoResponse 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.showcase.v1beta1.EchoResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.EchoResponse 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.showcase.v1beta1.EchoResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.EchoResponse 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.showcase.v1beta1.EchoResponse 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 message for the Echo methods.
        +   * 
        + * + * Protobuf type {@code google.showcase.v1beta1.EchoResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.EchoResponse) + com.google.showcase.v1beta1.EchoResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.EchoOuterClass + .internal_static_google_showcase_v1beta1_EchoResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.EchoOuterClass + .internal_static_google_showcase_v1beta1_EchoResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.EchoResponse.class, + com.google.showcase.v1beta1.EchoResponse.Builder.class); + } + + // Construct using com.google.showcase.v1beta1.EchoResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + content_ = ""; + + severity_ = 0; + + requestId_ = ""; + + otherRequestId_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.showcase.v1beta1.EchoOuterClass + .internal_static_google_showcase_v1beta1_EchoResponse_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.EchoResponse getDefaultInstanceForType() { + return com.google.showcase.v1beta1.EchoResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.EchoResponse build() { + com.google.showcase.v1beta1.EchoResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.EchoResponse buildPartial() { + com.google.showcase.v1beta1.EchoResponse result = + new com.google.showcase.v1beta1.EchoResponse(this); + result.content_ = content_; + result.severity_ = severity_; + result.requestId_ = requestId_; + result.otherRequestId_ = otherRequestId_; + 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.showcase.v1beta1.EchoResponse) { + return mergeFrom((com.google.showcase.v1beta1.EchoResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.showcase.v1beta1.EchoResponse other) { + if (other == com.google.showcase.v1beta1.EchoResponse.getDefaultInstance()) return this; + if (!other.getContent().isEmpty()) { + content_ = other.content_; + onChanged(); + } + if (other.severity_ != 0) { + setSeverityValue(other.getSeverityValue()); + } + if (!other.getRequestId().isEmpty()) { + requestId_ = other.requestId_; + onChanged(); + } + if (!other.getOtherRequestId().isEmpty()) { + otherRequestId_ = other.otherRequestId_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.showcase.v1beta1.EchoResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.showcase.v1beta1.EchoResponse) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object content_ = ""; + + /** + * + * + *
        +     * The content specified in the request.
        +     * 
        + * + * string content = 1; + * + * @return The content. + */ + public java.lang.String getContent() { + java.lang.Object ref = content_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + content_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
        +     * The content specified in the request.
        +     * 
        + * + * string content = 1; + * + * @return The bytes for content. + */ + public com.google.protobuf.ByteString getContentBytes() { + java.lang.Object ref = content_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + content_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
        +     * The content specified in the request.
        +     * 
        + * + * string content = 1; + * + * @param value The content to set. + * @return This builder for chaining. + */ + public Builder setContent(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + content_ = value; + onChanged(); + return this; + } + + /** + * + * + *
        +     * The content specified in the request.
        +     * 
        + * + * string content = 1; + * + * @return This builder for chaining. + */ + public Builder clearContent() { + + content_ = getDefaultInstance().getContent(); + onChanged(); + return this; + } + + /** + * + * + *
        +     * The content specified in the request.
        +     * 
        + * + * string content = 1; + * + * @param value The bytes for content to set. + * @return This builder for chaining. + */ + public Builder setContentBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + content_ = value; + onChanged(); + return this; + } + + private int severity_ = 0; + + /** + * + * + *
        +     * The severity specified in the request.
        +     * 
        + * + * .google.showcase.v1beta1.Severity severity = 2; + * + * @return The enum numeric value on the wire for severity. + */ + @java.lang.Override + public int getSeverityValue() { + return severity_; + } + + /** + * + * + *
        +     * The severity specified in the request.
        +     * 
        + * + * .google.showcase.v1beta1.Severity severity = 2; + * + * @param value The enum numeric value on the wire for severity to set. + * @return This builder for chaining. + */ + public Builder setSeverityValue(int value) { + + severity_ = value; + onChanged(); + return this; + } + + /** + * + * + *
        +     * The severity specified in the request.
        +     * 
        + * + * .google.showcase.v1beta1.Severity severity = 2; + * + * @return The severity. + */ + @java.lang.Override + public com.google.showcase.v1beta1.Severity getSeverity() { + @SuppressWarnings("deprecation") + com.google.showcase.v1beta1.Severity result = + com.google.showcase.v1beta1.Severity.valueOf(severity_); + return result == null ? com.google.showcase.v1beta1.Severity.UNRECOGNIZED : result; + } + + /** + * + * + *
        +     * The severity specified in the request.
        +     * 
        + * + * .google.showcase.v1beta1.Severity severity = 2; + * + * @param value The severity to set. + * @return This builder for chaining. + */ + public Builder setSeverity(com.google.showcase.v1beta1.Severity value) { + if (value == null) { + throw new NullPointerException(); + } + + severity_ = value.getNumber(); + onChanged(); + return this; + } + + /** + * + * + *
        +     * The severity specified in the request.
        +     * 
        + * + * .google.showcase.v1beta1.Severity severity = 2; + * + * @return This builder for chaining. + */ + public Builder clearSeverity() { + + severity_ = 0; + onChanged(); + return this; + } + + private java.lang.Object requestId_ = ""; + + /** + * + * + *
        +     * The request ID specified or autopopulated in the request.
        +     * 
        + * + * string request_id = 3; + * + * @return The requestId. + */ + public java.lang.String getRequestId() { + java.lang.Object ref = requestId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + requestId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
        +     * The request ID specified or autopopulated in the request.
        +     * 
        + * + * string request_id = 3; + * + * @return The bytes for requestId. + */ + public com.google.protobuf.ByteString getRequestIdBytes() { + java.lang.Object ref = requestId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + requestId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
        +     * The request ID specified or autopopulated in the request.
        +     * 
        + * + * string request_id = 3; + * + * @param value The requestId to set. + * @return This builder for chaining. + */ + public Builder setRequestId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + requestId_ = value; + onChanged(); + return this; + } + + /** + * + * + *
        +     * The request ID specified or autopopulated in the request.
        +     * 
        + * + * string request_id = 3; + * + * @return This builder for chaining. + */ + public Builder clearRequestId() { + + requestId_ = getDefaultInstance().getRequestId(); + onChanged(); + return this; + } + + /** + * + * + *
        +     * The request ID specified or autopopulated in the request.
        +     * 
        + * + * string request_id = 3; + * + * @param value The bytes for requestId to set. + * @return This builder for chaining. + */ + public Builder setRequestIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + requestId_ = value; + onChanged(); + return this; + } + + private java.lang.Object otherRequestId_ = ""; + + /** + * + * + *
        +     * The other request ID specified or autopopulated in the request.
        +     * 
        + * + * string other_request_id = 4; + * + * @return The otherRequestId. + */ + public java.lang.String getOtherRequestId() { + java.lang.Object ref = otherRequestId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + otherRequestId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
        +     * The other request ID specified or autopopulated in the request.
        +     * 
        + * + * string other_request_id = 4; + * + * @return The bytes for otherRequestId. + */ + public com.google.protobuf.ByteString getOtherRequestIdBytes() { + java.lang.Object ref = otherRequestId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + otherRequestId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
        +     * The other request ID specified or autopopulated in the request.
        +     * 
        + * + * string other_request_id = 4; + * + * @param value The otherRequestId to set. + * @return This builder for chaining. + */ + public Builder setOtherRequestId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + otherRequestId_ = value; + onChanged(); + return this; + } + + /** + * + * + *
        +     * The other request ID specified or autopopulated in the request.
        +     * 
        + * + * string other_request_id = 4; + * + * @return This builder for chaining. + */ + public Builder clearOtherRequestId() { + + otherRequestId_ = getDefaultInstance().getOtherRequestId(); + onChanged(); + return this; + } + + /** + * + * + *
        +     * The other request ID specified or autopopulated in the request.
        +     * 
        + * + * string other_request_id = 4; + * + * @param value The bytes for otherRequestId to set. + * @return This builder for chaining. + */ + public Builder setOtherRequestIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + otherRequestId_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.showcase.v1beta1.EchoResponse) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.EchoResponse) + private static final com.google.showcase.v1beta1.EchoResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.EchoResponse(); + } + + public static com.google.showcase.v1beta1.EchoResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public EchoResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new EchoResponse(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.showcase.v1beta1.EchoResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/EchoResponseOrBuilder.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/EchoResponseOrBuilder.java new file mode 100644 index 0000000000..06a060f86b --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/EchoResponseOrBuilder.java @@ -0,0 +1,129 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/echo.proto + +package com.google.showcase.v1beta1; + +public interface EchoResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.EchoResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
        +   * The content specified in the request.
        +   * 
        + * + * string content = 1; + * + * @return The content. + */ + java.lang.String getContent(); + + /** + * + * + *
        +   * The content specified in the request.
        +   * 
        + * + * string content = 1; + * + * @return The bytes for content. + */ + com.google.protobuf.ByteString getContentBytes(); + + /** + * + * + *
        +   * The severity specified in the request.
        +   * 
        + * + * .google.showcase.v1beta1.Severity severity = 2; + * + * @return The enum numeric value on the wire for severity. + */ + int getSeverityValue(); + + /** + * + * + *
        +   * The severity specified in the request.
        +   * 
        + * + * .google.showcase.v1beta1.Severity severity = 2; + * + * @return The severity. + */ + com.google.showcase.v1beta1.Severity getSeverity(); + + /** + * + * + *
        +   * The request ID specified or autopopulated in the request.
        +   * 
        + * + * string request_id = 3; + * + * @return The requestId. + */ + java.lang.String getRequestId(); + + /** + * + * + *
        +   * The request ID specified or autopopulated in the request.
        +   * 
        + * + * string request_id = 3; + * + * @return The bytes for requestId. + */ + com.google.protobuf.ByteString getRequestIdBytes(); + + /** + * + * + *
        +   * The other request ID specified or autopopulated in the request.
        +   * 
        + * + * string other_request_id = 4; + * + * @return The otherRequestId. + */ + java.lang.String getOtherRequestId(); + + /** + * + * + *
        +   * The other request ID specified or autopopulated in the request.
        +   * 
        + * + * string other_request_id = 4; + * + * @return The bytes for otherRequestId. + */ + com.google.protobuf.ByteString getOtherRequestIdBytes(); +} diff --git a/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/EnumRequest.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/EnumRequest.java new file mode 100644 index 0000000000..063ccca508 --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/EnumRequest.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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/compliance.proto + +package com.google.showcase.v1beta1; + +/** Protobuf type {@code google.showcase.v1beta1.EnumRequest} */ +public final class EnumRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.EnumRequest) + EnumRequestOrBuilder { + private static final long serialVersionUID = 0L; + + // Use EnumRequest.newBuilder() to construct. + private EnumRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private EnumRequest() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new EnumRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private EnumRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: + { + unknownEnum_ = input.readBool(); + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.ComplianceOuterClass + .internal_static_google_showcase_v1beta1_EnumRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.ComplianceOuterClass + .internal_static_google_showcase_v1beta1_EnumRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.EnumRequest.class, + com.google.showcase.v1beta1.EnumRequest.Builder.class); + } + + public static final int UNKNOWN_ENUM_FIELD_NUMBER = 1; + private boolean unknownEnum_; + + /** + * + * + *
        +   * Whether the client is requesting a new, unknown enum value or a known enum value already declared in this proto file.
        +   * 
        + * + * bool unknown_enum = 1; + * + * @return The unknownEnum. + */ + @java.lang.Override + public boolean getUnknownEnum() { + return unknownEnum_; + } + + 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 (unknownEnum_ != false) { + output.writeBool(1, unknownEnum_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (unknownEnum_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(1, unknownEnum_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.showcase.v1beta1.EnumRequest)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.EnumRequest other = (com.google.showcase.v1beta1.EnumRequest) obj; + + if (getUnknownEnum() != other.getUnknownEnum()) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + UNKNOWN_ENUM_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getUnknownEnum()); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.showcase.v1beta1.EnumRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.EnumRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.EnumRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.EnumRequest 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.showcase.v1beta1.EnumRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.EnumRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.EnumRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.EnumRequest 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.showcase.v1beta1.EnumRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.EnumRequest 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.showcase.v1beta1.EnumRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.EnumRequest 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.showcase.v1beta1.EnumRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** Protobuf type {@code google.showcase.v1beta1.EnumRequest} */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.EnumRequest) + com.google.showcase.v1beta1.EnumRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.ComplianceOuterClass + .internal_static_google_showcase_v1beta1_EnumRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.ComplianceOuterClass + .internal_static_google_showcase_v1beta1_EnumRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.EnumRequest.class, + com.google.showcase.v1beta1.EnumRequest.Builder.class); + } + + // Construct using com.google.showcase.v1beta1.EnumRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + unknownEnum_ = false; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.showcase.v1beta1.ComplianceOuterClass + .internal_static_google_showcase_v1beta1_EnumRequest_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.EnumRequest getDefaultInstanceForType() { + return com.google.showcase.v1beta1.EnumRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.EnumRequest build() { + com.google.showcase.v1beta1.EnumRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.EnumRequest buildPartial() { + com.google.showcase.v1beta1.EnumRequest result = + new com.google.showcase.v1beta1.EnumRequest(this); + result.unknownEnum_ = unknownEnum_; + 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.showcase.v1beta1.EnumRequest) { + return mergeFrom((com.google.showcase.v1beta1.EnumRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.showcase.v1beta1.EnumRequest other) { + if (other == com.google.showcase.v1beta1.EnumRequest.getDefaultInstance()) return this; + if (other.getUnknownEnum() != false) { + setUnknownEnum(other.getUnknownEnum()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.showcase.v1beta1.EnumRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.showcase.v1beta1.EnumRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private boolean unknownEnum_; + + /** + * + * + *
        +     * Whether the client is requesting a new, unknown enum value or a known enum value already declared in this proto file.
        +     * 
        + * + * bool unknown_enum = 1; + * + * @return The unknownEnum. + */ + @java.lang.Override + public boolean getUnknownEnum() { + return unknownEnum_; + } + + /** + * + * + *
        +     * Whether the client is requesting a new, unknown enum value or a known enum value already declared in this proto file.
        +     * 
        + * + * bool unknown_enum = 1; + * + * @param value The unknownEnum to set. + * @return This builder for chaining. + */ + public Builder setUnknownEnum(boolean value) { + + unknownEnum_ = value; + onChanged(); + return this; + } + + /** + * + * + *
        +     * Whether the client is requesting a new, unknown enum value or a known enum value already declared in this proto file.
        +     * 
        + * + * bool unknown_enum = 1; + * + * @return This builder for chaining. + */ + public Builder clearUnknownEnum() { + + unknownEnum_ = 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.showcase.v1beta1.EnumRequest) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.EnumRequest) + private static final com.google.showcase.v1beta1.EnumRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.EnumRequest(); + } + + public static com.google.showcase.v1beta1.EnumRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public EnumRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new EnumRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.showcase.v1beta1.EnumRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/EnumRequestOrBuilder.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/EnumRequestOrBuilder.java new file mode 100644 index 0000000000..69854016d5 --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/EnumRequestOrBuilder.java @@ -0,0 +1,38 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/compliance.proto + +package com.google.showcase.v1beta1; + +public interface EnumRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.EnumRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
        +   * Whether the client is requesting a new, unknown enum value or a known enum value already declared in this proto file.
        +   * 
        + * + * bool unknown_enum = 1; + * + * @return The unknownEnum. + */ + boolean getUnknownEnum(); +} diff --git a/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/EnumResponse.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/EnumResponse.java new file mode 100644 index 0000000000..07f3f02cde --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/EnumResponse.java @@ -0,0 +1,888 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/compliance.proto + +package com.google.showcase.v1beta1; + +/** Protobuf type {@code google.showcase.v1beta1.EnumResponse} */ +public final class EnumResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.EnumResponse) + EnumResponseOrBuilder { + private static final long serialVersionUID = 0L; + + // Use EnumResponse.newBuilder() to construct. + private EnumResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private EnumResponse() { + continent_ = 0; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new EnumResponse(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private EnumResponse( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + com.google.showcase.v1beta1.EnumRequest.Builder subBuilder = null; + if (request_ != null) { + subBuilder = request_.toBuilder(); + } + request_ = + input.readMessage( + com.google.showcase.v1beta1.EnumRequest.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(request_); + request_ = subBuilder.buildPartial(); + } + + break; + } + case 16: + { + int rawValue = input.readEnum(); + + continent_ = rawValue; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.ComplianceOuterClass + .internal_static_google_showcase_v1beta1_EnumResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.ComplianceOuterClass + .internal_static_google_showcase_v1beta1_EnumResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.EnumResponse.class, + com.google.showcase.v1beta1.EnumResponse.Builder.class); + } + + public static final int REQUEST_FIELD_NUMBER = 1; + private com.google.showcase.v1beta1.EnumRequest request_; + + /** + * + * + *
        +   * The original request for a known or unknown enum from the server.
        +   * 
        + * + * .google.showcase.v1beta1.EnumRequest request = 1; + * + * @return Whether the request field is set. + */ + @java.lang.Override + public boolean hasRequest() { + return request_ != null; + } + + /** + * + * + *
        +   * The original request for a known or unknown enum from the server.
        +   * 
        + * + * .google.showcase.v1beta1.EnumRequest request = 1; + * + * @return The request. + */ + @java.lang.Override + public com.google.showcase.v1beta1.EnumRequest getRequest() { + return request_ == null + ? com.google.showcase.v1beta1.EnumRequest.getDefaultInstance() + : request_; + } + + /** + * + * + *
        +   * The original request for a known or unknown enum from the server.
        +   * 
        + * + * .google.showcase.v1beta1.EnumRequest request = 1; + */ + @java.lang.Override + public com.google.showcase.v1beta1.EnumRequestOrBuilder getRequestOrBuilder() { + return getRequest(); + } + + public static final int CONTINENT_FIELD_NUMBER = 2; + private int continent_; + + /** + * + * + *
        +   * The actual enum the server provided.
        +   * 
        + * + * .google.showcase.v1beta1.Continent continent = 2; + * + * @return The enum numeric value on the wire for continent. + */ + @java.lang.Override + public int getContinentValue() { + return continent_; + } + + /** + * + * + *
        +   * The actual enum the server provided.
        +   * 
        + * + * .google.showcase.v1beta1.Continent continent = 2; + * + * @return The continent. + */ + @java.lang.Override + public com.google.showcase.v1beta1.Continent getContinent() { + @SuppressWarnings("deprecation") + com.google.showcase.v1beta1.Continent result = + com.google.showcase.v1beta1.Continent.valueOf(continent_); + return result == null ? com.google.showcase.v1beta1.Continent.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 (request_ != null) { + output.writeMessage(1, getRequest()); + } + if (continent_ != com.google.showcase.v1beta1.Continent.CONTINENT_UNSPECIFIED.getNumber()) { + output.writeEnum(2, continent_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (request_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getRequest()); + } + if (continent_ != com.google.showcase.v1beta1.Continent.CONTINENT_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(2, continent_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.showcase.v1beta1.EnumResponse)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.EnumResponse other = (com.google.showcase.v1beta1.EnumResponse) obj; + + if (hasRequest() != other.hasRequest()) return false; + if (hasRequest()) { + if (!getRequest().equals(other.getRequest())) return false; + } + if (continent_ != other.continent_) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasRequest()) { + hash = (37 * hash) + REQUEST_FIELD_NUMBER; + hash = (53 * hash) + getRequest().hashCode(); + } + hash = (37 * hash) + CONTINENT_FIELD_NUMBER; + hash = (53 * hash) + continent_; + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.showcase.v1beta1.EnumResponse parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.EnumResponse parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.EnumResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.EnumResponse 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.showcase.v1beta1.EnumResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.EnumResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.EnumResponse parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.EnumResponse 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.showcase.v1beta1.EnumResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.EnumResponse 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.showcase.v1beta1.EnumResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.EnumResponse 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.showcase.v1beta1.EnumResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** Protobuf type {@code google.showcase.v1beta1.EnumResponse} */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.EnumResponse) + com.google.showcase.v1beta1.EnumResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.ComplianceOuterClass + .internal_static_google_showcase_v1beta1_EnumResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.ComplianceOuterClass + .internal_static_google_showcase_v1beta1_EnumResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.EnumResponse.class, + com.google.showcase.v1beta1.EnumResponse.Builder.class); + } + + // Construct using com.google.showcase.v1beta1.EnumResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (requestBuilder_ == null) { + request_ = null; + } else { + request_ = null; + requestBuilder_ = null; + } + continent_ = 0; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.showcase.v1beta1.ComplianceOuterClass + .internal_static_google_showcase_v1beta1_EnumResponse_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.EnumResponse getDefaultInstanceForType() { + return com.google.showcase.v1beta1.EnumResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.EnumResponse build() { + com.google.showcase.v1beta1.EnumResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.EnumResponse buildPartial() { + com.google.showcase.v1beta1.EnumResponse result = + new com.google.showcase.v1beta1.EnumResponse(this); + if (requestBuilder_ == null) { + result.request_ = request_; + } else { + result.request_ = requestBuilder_.build(); + } + result.continent_ = continent_; + 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.showcase.v1beta1.EnumResponse) { + return mergeFrom((com.google.showcase.v1beta1.EnumResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.showcase.v1beta1.EnumResponse other) { + if (other == com.google.showcase.v1beta1.EnumResponse.getDefaultInstance()) return this; + if (other.hasRequest()) { + mergeRequest(other.getRequest()); + } + if (other.continent_ != 0) { + setContinentValue(other.getContinentValue()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.showcase.v1beta1.EnumResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.showcase.v1beta1.EnumResponse) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private com.google.showcase.v1beta1.EnumRequest request_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.showcase.v1beta1.EnumRequest, + com.google.showcase.v1beta1.EnumRequest.Builder, + com.google.showcase.v1beta1.EnumRequestOrBuilder> + requestBuilder_; + + /** + * + * + *
        +     * The original request for a known or unknown enum from the server.
        +     * 
        + * + * .google.showcase.v1beta1.EnumRequest request = 1; + * + * @return Whether the request field is set. + */ + public boolean hasRequest() { + return requestBuilder_ != null || request_ != null; + } + + /** + * + * + *
        +     * The original request for a known or unknown enum from the server.
        +     * 
        + * + * .google.showcase.v1beta1.EnumRequest request = 1; + * + * @return The request. + */ + public com.google.showcase.v1beta1.EnumRequest getRequest() { + if (requestBuilder_ == null) { + return request_ == null + ? com.google.showcase.v1beta1.EnumRequest.getDefaultInstance() + : request_; + } else { + return requestBuilder_.getMessage(); + } + } + + /** + * + * + *
        +     * The original request for a known or unknown enum from the server.
        +     * 
        + * + * .google.showcase.v1beta1.EnumRequest request = 1; + */ + public Builder setRequest(com.google.showcase.v1beta1.EnumRequest value) { + if (requestBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + request_ = value; + onChanged(); + } else { + requestBuilder_.setMessage(value); + } + + return this; + } + + /** + * + * + *
        +     * The original request for a known or unknown enum from the server.
        +     * 
        + * + * .google.showcase.v1beta1.EnumRequest request = 1; + */ + public Builder setRequest(com.google.showcase.v1beta1.EnumRequest.Builder builderForValue) { + if (requestBuilder_ == null) { + request_ = builderForValue.build(); + onChanged(); + } else { + requestBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + + /** + * + * + *
        +     * The original request for a known or unknown enum from the server.
        +     * 
        + * + * .google.showcase.v1beta1.EnumRequest request = 1; + */ + public Builder mergeRequest(com.google.showcase.v1beta1.EnumRequest value) { + if (requestBuilder_ == null) { + if (request_ != null) { + request_ = + com.google.showcase.v1beta1.EnumRequest.newBuilder(request_) + .mergeFrom(value) + .buildPartial(); + } else { + request_ = value; + } + onChanged(); + } else { + requestBuilder_.mergeFrom(value); + } + + return this; + } + + /** + * + * + *
        +     * The original request for a known or unknown enum from the server.
        +     * 
        + * + * .google.showcase.v1beta1.EnumRequest request = 1; + */ + public Builder clearRequest() { + if (requestBuilder_ == null) { + request_ = null; + onChanged(); + } else { + request_ = null; + requestBuilder_ = null; + } + + return this; + } + + /** + * + * + *
        +     * The original request for a known or unknown enum from the server.
        +     * 
        + * + * .google.showcase.v1beta1.EnumRequest request = 1; + */ + public com.google.showcase.v1beta1.EnumRequest.Builder getRequestBuilder() { + + onChanged(); + return getRequestFieldBuilder().getBuilder(); + } + + /** + * + * + *
        +     * The original request for a known or unknown enum from the server.
        +     * 
        + * + * .google.showcase.v1beta1.EnumRequest request = 1; + */ + public com.google.showcase.v1beta1.EnumRequestOrBuilder getRequestOrBuilder() { + if (requestBuilder_ != null) { + return requestBuilder_.getMessageOrBuilder(); + } else { + return request_ == null + ? com.google.showcase.v1beta1.EnumRequest.getDefaultInstance() + : request_; + } + } + + /** + * + * + *
        +     * The original request for a known or unknown enum from the server.
        +     * 
        + * + * .google.showcase.v1beta1.EnumRequest request = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.showcase.v1beta1.EnumRequest, + com.google.showcase.v1beta1.EnumRequest.Builder, + com.google.showcase.v1beta1.EnumRequestOrBuilder> + getRequestFieldBuilder() { + if (requestBuilder_ == null) { + requestBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.showcase.v1beta1.EnumRequest, + com.google.showcase.v1beta1.EnumRequest.Builder, + com.google.showcase.v1beta1.EnumRequestOrBuilder>( + getRequest(), getParentForChildren(), isClean()); + request_ = null; + } + return requestBuilder_; + } + + private int continent_ = 0; + + /** + * + * + *
        +     * The actual enum the server provided.
        +     * 
        + * + * .google.showcase.v1beta1.Continent continent = 2; + * + * @return The enum numeric value on the wire for continent. + */ + @java.lang.Override + public int getContinentValue() { + return continent_; + } + + /** + * + * + *
        +     * The actual enum the server provided.
        +     * 
        + * + * .google.showcase.v1beta1.Continent continent = 2; + * + * @param value The enum numeric value on the wire for continent to set. + * @return This builder for chaining. + */ + public Builder setContinentValue(int value) { + + continent_ = value; + onChanged(); + return this; + } + + /** + * + * + *
        +     * The actual enum the server provided.
        +     * 
        + * + * .google.showcase.v1beta1.Continent continent = 2; + * + * @return The continent. + */ + @java.lang.Override + public com.google.showcase.v1beta1.Continent getContinent() { + @SuppressWarnings("deprecation") + com.google.showcase.v1beta1.Continent result = + com.google.showcase.v1beta1.Continent.valueOf(continent_); + return result == null ? com.google.showcase.v1beta1.Continent.UNRECOGNIZED : result; + } + + /** + * + * + *
        +     * The actual enum the server provided.
        +     * 
        + * + * .google.showcase.v1beta1.Continent continent = 2; + * + * @param value The continent to set. + * @return This builder for chaining. + */ + public Builder setContinent(com.google.showcase.v1beta1.Continent value) { + if (value == null) { + throw new NullPointerException(); + } + + continent_ = value.getNumber(); + onChanged(); + return this; + } + + /** + * + * + *
        +     * The actual enum the server provided.
        +     * 
        + * + * .google.showcase.v1beta1.Continent continent = 2; + * + * @return This builder for chaining. + */ + public Builder clearContinent() { + + continent_ = 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.showcase.v1beta1.EnumResponse) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.EnumResponse) + private static final com.google.showcase.v1beta1.EnumResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.EnumResponse(); + } + + public static com.google.showcase.v1beta1.EnumResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public EnumResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new EnumResponse(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.showcase.v1beta1.EnumResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/EnumResponseOrBuilder.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/EnumResponseOrBuilder.java new file mode 100644 index 0000000000..24aa273d73 --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/EnumResponseOrBuilder.java @@ -0,0 +1,88 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/compliance.proto + +package com.google.showcase.v1beta1; + +public interface EnumResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.EnumResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
        +   * The original request for a known or unknown enum from the server.
        +   * 
        + * + * .google.showcase.v1beta1.EnumRequest request = 1; + * + * @return Whether the request field is set. + */ + boolean hasRequest(); + + /** + * + * + *
        +   * The original request for a known or unknown enum from the server.
        +   * 
        + * + * .google.showcase.v1beta1.EnumRequest request = 1; + * + * @return The request. + */ + com.google.showcase.v1beta1.EnumRequest getRequest(); + + /** + * + * + *
        +   * The original request for a known or unknown enum from the server.
        +   * 
        + * + * .google.showcase.v1beta1.EnumRequest request = 1; + */ + com.google.showcase.v1beta1.EnumRequestOrBuilder getRequestOrBuilder(); + + /** + * + * + *
        +   * The actual enum the server provided.
        +   * 
        + * + * .google.showcase.v1beta1.Continent continent = 2; + * + * @return The enum numeric value on the wire for continent. + */ + int getContinentValue(); + + /** + * + * + *
        +   * The actual enum the server provided.
        +   * 
        + * + * .google.showcase.v1beta1.Continent continent = 2; + * + * @return The continent. + */ + com.google.showcase.v1beta1.Continent getContinent(); +} diff --git a/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ErrorWithMultipleDetails.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ErrorWithMultipleDetails.java new file mode 100644 index 0000000000..6cbd143ea7 --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ErrorWithMultipleDetails.java @@ -0,0 +1,765 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/echo.proto + +package com.google.showcase.v1beta1; + +/** Protobuf type {@code google.showcase.v1beta1.ErrorWithMultipleDetails} */ +public final class ErrorWithMultipleDetails extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.ErrorWithMultipleDetails) + ErrorWithMultipleDetailsOrBuilder { + private static final long serialVersionUID = 0L; + + // Use ErrorWithMultipleDetails.newBuilder() to construct. + private ErrorWithMultipleDetails(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ErrorWithMultipleDetails() { + details_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ErrorWithMultipleDetails(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ErrorWithMultipleDetails( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + details_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + details_.add(input.readMessage(com.google.protobuf.Any.parser(), extensionRegistry)); + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + details_ = java.util.Collections.unmodifiableList(details_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.EchoOuterClass + .internal_static_google_showcase_v1beta1_ErrorWithMultipleDetails_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.EchoOuterClass + .internal_static_google_showcase_v1beta1_ErrorWithMultipleDetails_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.ErrorWithMultipleDetails.class, + com.google.showcase.v1beta1.ErrorWithMultipleDetails.Builder.class); + } + + public static final int DETAILS_FIELD_NUMBER = 1; + private java.util.List details_; + + /** repeated .google.protobuf.Any details = 1; */ + @java.lang.Override + public java.util.List getDetailsList() { + return details_; + } + + /** repeated .google.protobuf.Any details = 1; */ + @java.lang.Override + public java.util.List getDetailsOrBuilderList() { + return details_; + } + + /** repeated .google.protobuf.Any details = 1; */ + @java.lang.Override + public int getDetailsCount() { + return details_.size(); + } + + /** repeated .google.protobuf.Any details = 1; */ + @java.lang.Override + public com.google.protobuf.Any getDetails(int index) { + return details_.get(index); + } + + /** repeated .google.protobuf.Any details = 1; */ + @java.lang.Override + public com.google.protobuf.AnyOrBuilder getDetailsOrBuilder(int index) { + return details_.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 < details_.size(); i++) { + output.writeMessage(1, details_.get(i)); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < details_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, details_.get(i)); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.showcase.v1beta1.ErrorWithMultipleDetails)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.ErrorWithMultipleDetails other = + (com.google.showcase.v1beta1.ErrorWithMultipleDetails) obj; + + if (!getDetailsList().equals(other.getDetailsList())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getDetailsCount() > 0) { + hash = (37 * hash) + DETAILS_FIELD_NUMBER; + hash = (53 * hash) + getDetailsList().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.showcase.v1beta1.ErrorWithMultipleDetails parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.ErrorWithMultipleDetails parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.ErrorWithMultipleDetails parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.ErrorWithMultipleDetails 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.showcase.v1beta1.ErrorWithMultipleDetails parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.ErrorWithMultipleDetails parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.ErrorWithMultipleDetails parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.ErrorWithMultipleDetails 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.showcase.v1beta1.ErrorWithMultipleDetails parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.ErrorWithMultipleDetails 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.showcase.v1beta1.ErrorWithMultipleDetails parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.ErrorWithMultipleDetails 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.showcase.v1beta1.ErrorWithMultipleDetails prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** Protobuf type {@code google.showcase.v1beta1.ErrorWithMultipleDetails} */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.ErrorWithMultipleDetails) + com.google.showcase.v1beta1.ErrorWithMultipleDetailsOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.EchoOuterClass + .internal_static_google_showcase_v1beta1_ErrorWithMultipleDetails_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.EchoOuterClass + .internal_static_google_showcase_v1beta1_ErrorWithMultipleDetails_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.ErrorWithMultipleDetails.class, + com.google.showcase.v1beta1.ErrorWithMultipleDetails.Builder.class); + } + + // Construct using com.google.showcase.v1beta1.ErrorWithMultipleDetails.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getDetailsFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (detailsBuilder_ == null) { + details_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + detailsBuilder_.clear(); + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.showcase.v1beta1.EchoOuterClass + .internal_static_google_showcase_v1beta1_ErrorWithMultipleDetails_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.ErrorWithMultipleDetails getDefaultInstanceForType() { + return com.google.showcase.v1beta1.ErrorWithMultipleDetails.getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.ErrorWithMultipleDetails build() { + com.google.showcase.v1beta1.ErrorWithMultipleDetails result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.ErrorWithMultipleDetails buildPartial() { + com.google.showcase.v1beta1.ErrorWithMultipleDetails result = + new com.google.showcase.v1beta1.ErrorWithMultipleDetails(this); + int from_bitField0_ = bitField0_; + if (detailsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + details_ = java.util.Collections.unmodifiableList(details_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.details_ = details_; + } else { + result.details_ = detailsBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.showcase.v1beta1.ErrorWithMultipleDetails) { + return mergeFrom((com.google.showcase.v1beta1.ErrorWithMultipleDetails) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.showcase.v1beta1.ErrorWithMultipleDetails other) { + if (other == com.google.showcase.v1beta1.ErrorWithMultipleDetails.getDefaultInstance()) + return this; + if (detailsBuilder_ == null) { + if (!other.details_.isEmpty()) { + if (details_.isEmpty()) { + details_ = other.details_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureDetailsIsMutable(); + details_.addAll(other.details_); + } + onChanged(); + } + } else { + if (!other.details_.isEmpty()) { + if (detailsBuilder_.isEmpty()) { + detailsBuilder_.dispose(); + detailsBuilder_ = null; + details_ = other.details_; + bitField0_ = (bitField0_ & ~0x00000001); + detailsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getDetailsFieldBuilder() + : null; + } else { + detailsBuilder_.addAllMessages(other.details_); + } + } + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.showcase.v1beta1.ErrorWithMultipleDetails parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.showcase.v1beta1.ErrorWithMultipleDetails) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.util.List details_ = java.util.Collections.emptyList(); + + private void ensureDetailsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + details_ = new java.util.ArrayList(details_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.protobuf.Any, + com.google.protobuf.Any.Builder, + com.google.protobuf.AnyOrBuilder> + detailsBuilder_; + + /** repeated .google.protobuf.Any details = 1; */ + public java.util.List getDetailsList() { + if (detailsBuilder_ == null) { + return java.util.Collections.unmodifiableList(details_); + } else { + return detailsBuilder_.getMessageList(); + } + } + + /** repeated .google.protobuf.Any details = 1; */ + public int getDetailsCount() { + if (detailsBuilder_ == null) { + return details_.size(); + } else { + return detailsBuilder_.getCount(); + } + } + + /** repeated .google.protobuf.Any details = 1; */ + public com.google.protobuf.Any getDetails(int index) { + if (detailsBuilder_ == null) { + return details_.get(index); + } else { + return detailsBuilder_.getMessage(index); + } + } + + /** repeated .google.protobuf.Any details = 1; */ + public Builder setDetails(int index, com.google.protobuf.Any value) { + if (detailsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureDetailsIsMutable(); + details_.set(index, value); + onChanged(); + } else { + detailsBuilder_.setMessage(index, value); + } + return this; + } + + /** repeated .google.protobuf.Any details = 1; */ + public Builder setDetails(int index, com.google.protobuf.Any.Builder builderForValue) { + if (detailsBuilder_ == null) { + ensureDetailsIsMutable(); + details_.set(index, builderForValue.build()); + onChanged(); + } else { + detailsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + + /** repeated .google.protobuf.Any details = 1; */ + public Builder addDetails(com.google.protobuf.Any value) { + if (detailsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureDetailsIsMutable(); + details_.add(value); + onChanged(); + } else { + detailsBuilder_.addMessage(value); + } + return this; + } + + /** repeated .google.protobuf.Any details = 1; */ + public Builder addDetails(int index, com.google.protobuf.Any value) { + if (detailsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureDetailsIsMutable(); + details_.add(index, value); + onChanged(); + } else { + detailsBuilder_.addMessage(index, value); + } + return this; + } + + /** repeated .google.protobuf.Any details = 1; */ + public Builder addDetails(com.google.protobuf.Any.Builder builderForValue) { + if (detailsBuilder_ == null) { + ensureDetailsIsMutable(); + details_.add(builderForValue.build()); + onChanged(); + } else { + detailsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + + /** repeated .google.protobuf.Any details = 1; */ + public Builder addDetails(int index, com.google.protobuf.Any.Builder builderForValue) { + if (detailsBuilder_ == null) { + ensureDetailsIsMutable(); + details_.add(index, builderForValue.build()); + onChanged(); + } else { + detailsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + + /** repeated .google.protobuf.Any details = 1; */ + public Builder addAllDetails(java.lang.Iterable values) { + if (detailsBuilder_ == null) { + ensureDetailsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, details_); + onChanged(); + } else { + detailsBuilder_.addAllMessages(values); + } + return this; + } + + /** repeated .google.protobuf.Any details = 1; */ + public Builder clearDetails() { + if (detailsBuilder_ == null) { + details_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + detailsBuilder_.clear(); + } + return this; + } + + /** repeated .google.protobuf.Any details = 1; */ + public Builder removeDetails(int index) { + if (detailsBuilder_ == null) { + ensureDetailsIsMutable(); + details_.remove(index); + onChanged(); + } else { + detailsBuilder_.remove(index); + } + return this; + } + + /** repeated .google.protobuf.Any details = 1; */ + public com.google.protobuf.Any.Builder getDetailsBuilder(int index) { + return getDetailsFieldBuilder().getBuilder(index); + } + + /** repeated .google.protobuf.Any details = 1; */ + public com.google.protobuf.AnyOrBuilder getDetailsOrBuilder(int index) { + if (detailsBuilder_ == null) { + return details_.get(index); + } else { + return detailsBuilder_.getMessageOrBuilder(index); + } + } + + /** repeated .google.protobuf.Any details = 1; */ + public java.util.List getDetailsOrBuilderList() { + if (detailsBuilder_ != null) { + return detailsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(details_); + } + } + + /** repeated .google.protobuf.Any details = 1; */ + public com.google.protobuf.Any.Builder addDetailsBuilder() { + return getDetailsFieldBuilder().addBuilder(com.google.protobuf.Any.getDefaultInstance()); + } + + /** repeated .google.protobuf.Any details = 1; */ + public com.google.protobuf.Any.Builder addDetailsBuilder(int index) { + return getDetailsFieldBuilder() + .addBuilder(index, com.google.protobuf.Any.getDefaultInstance()); + } + + /** repeated .google.protobuf.Any details = 1; */ + public java.util.List getDetailsBuilderList() { + return getDetailsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.protobuf.Any, + com.google.protobuf.Any.Builder, + com.google.protobuf.AnyOrBuilder> + getDetailsFieldBuilder() { + if (detailsBuilder_ == null) { + detailsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.protobuf.Any, + com.google.protobuf.Any.Builder, + com.google.protobuf.AnyOrBuilder>( + details_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + details_ = null; + } + return detailsBuilder_; + } + + @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.showcase.v1beta1.ErrorWithMultipleDetails) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.ErrorWithMultipleDetails) + private static final com.google.showcase.v1beta1.ErrorWithMultipleDetails DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.ErrorWithMultipleDetails(); + } + + public static com.google.showcase.v1beta1.ErrorWithMultipleDetails getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ErrorWithMultipleDetails parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ErrorWithMultipleDetails(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.showcase.v1beta1.ErrorWithMultipleDetails getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ErrorWithMultipleDetailsOrBuilder.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ErrorWithMultipleDetailsOrBuilder.java new file mode 100644 index 0000000000..2192bf7742 --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ErrorWithMultipleDetailsOrBuilder.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: schema/google/showcase/v1beta1/echo.proto + +package com.google.showcase.v1beta1; + +public interface ErrorWithMultipleDetailsOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.ErrorWithMultipleDetails) + com.google.protobuf.MessageOrBuilder { + + /** repeated .google.protobuf.Any details = 1; */ + java.util.List getDetailsList(); + + /** repeated .google.protobuf.Any details = 1; */ + com.google.protobuf.Any getDetails(int index); + + /** repeated .google.protobuf.Any details = 1; */ + int getDetailsCount(); + + /** repeated .google.protobuf.Any details = 1; */ + java.util.List getDetailsOrBuilderList(); + + /** repeated .google.protobuf.Any details = 1; */ + com.google.protobuf.AnyOrBuilder getDetailsOrBuilder(int index); +} diff --git a/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ErrorWithSingleDetail.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ErrorWithSingleDetail.java new file mode 100644 index 0000000000..351b0407dc --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ErrorWithSingleDetail.java @@ -0,0 +1,633 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/echo.proto + +package com.google.showcase.v1beta1; + +/** Protobuf type {@code google.showcase.v1beta1.ErrorWithSingleDetail} */ +public final class ErrorWithSingleDetail extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.ErrorWithSingleDetail) + ErrorWithSingleDetailOrBuilder { + private static final long serialVersionUID = 0L; + + // Use ErrorWithSingleDetail.newBuilder() to construct. + private ErrorWithSingleDetail(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ErrorWithSingleDetail() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ErrorWithSingleDetail(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ErrorWithSingleDetail( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + com.google.protobuf.Any.Builder subBuilder = null; + if (details_ != null) { + subBuilder = details_.toBuilder(); + } + details_ = input.readMessage(com.google.protobuf.Any.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(details_); + details_ = subBuilder.buildPartial(); + } + + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.EchoOuterClass + .internal_static_google_showcase_v1beta1_ErrorWithSingleDetail_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.EchoOuterClass + .internal_static_google_showcase_v1beta1_ErrorWithSingleDetail_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.ErrorWithSingleDetail.class, + com.google.showcase.v1beta1.ErrorWithSingleDetail.Builder.class); + } + + public static final int DETAILS_FIELD_NUMBER = 1; + private com.google.protobuf.Any details_; + + /** + * .google.protobuf.Any details = 1; + * + * @return Whether the details field is set. + */ + @java.lang.Override + public boolean hasDetails() { + return details_ != null; + } + + /** + * .google.protobuf.Any details = 1; + * + * @return The details. + */ + @java.lang.Override + public com.google.protobuf.Any getDetails() { + return details_ == null ? com.google.protobuf.Any.getDefaultInstance() : details_; + } + + /** .google.protobuf.Any details = 1; */ + @java.lang.Override + public com.google.protobuf.AnyOrBuilder getDetailsOrBuilder() { + return getDetails(); + } + + 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 (details_ != null) { + output.writeMessage(1, getDetails()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (details_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getDetails()); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.showcase.v1beta1.ErrorWithSingleDetail)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.ErrorWithSingleDetail other = + (com.google.showcase.v1beta1.ErrorWithSingleDetail) obj; + + if (hasDetails() != other.hasDetails()) return false; + if (hasDetails()) { + if (!getDetails().equals(other.getDetails())) return false; + } + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasDetails()) { + hash = (37 * hash) + DETAILS_FIELD_NUMBER; + hash = (53 * hash) + getDetails().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.showcase.v1beta1.ErrorWithSingleDetail parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.ErrorWithSingleDetail parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.ErrorWithSingleDetail parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.ErrorWithSingleDetail 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.showcase.v1beta1.ErrorWithSingleDetail parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.ErrorWithSingleDetail parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.ErrorWithSingleDetail parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.ErrorWithSingleDetail 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.showcase.v1beta1.ErrorWithSingleDetail parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.ErrorWithSingleDetail 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.showcase.v1beta1.ErrorWithSingleDetail parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.ErrorWithSingleDetail 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.showcase.v1beta1.ErrorWithSingleDetail prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** Protobuf type {@code google.showcase.v1beta1.ErrorWithSingleDetail} */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.ErrorWithSingleDetail) + com.google.showcase.v1beta1.ErrorWithSingleDetailOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.EchoOuterClass + .internal_static_google_showcase_v1beta1_ErrorWithSingleDetail_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.EchoOuterClass + .internal_static_google_showcase_v1beta1_ErrorWithSingleDetail_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.ErrorWithSingleDetail.class, + com.google.showcase.v1beta1.ErrorWithSingleDetail.Builder.class); + } + + // Construct using com.google.showcase.v1beta1.ErrorWithSingleDetail.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (detailsBuilder_ == null) { + details_ = null; + } else { + details_ = null; + detailsBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.showcase.v1beta1.EchoOuterClass + .internal_static_google_showcase_v1beta1_ErrorWithSingleDetail_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.ErrorWithSingleDetail getDefaultInstanceForType() { + return com.google.showcase.v1beta1.ErrorWithSingleDetail.getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.ErrorWithSingleDetail build() { + com.google.showcase.v1beta1.ErrorWithSingleDetail result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.ErrorWithSingleDetail buildPartial() { + com.google.showcase.v1beta1.ErrorWithSingleDetail result = + new com.google.showcase.v1beta1.ErrorWithSingleDetail(this); + if (detailsBuilder_ == null) { + result.details_ = details_; + } else { + result.details_ = detailsBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.showcase.v1beta1.ErrorWithSingleDetail) { + return mergeFrom((com.google.showcase.v1beta1.ErrorWithSingleDetail) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.showcase.v1beta1.ErrorWithSingleDetail other) { + if (other == com.google.showcase.v1beta1.ErrorWithSingleDetail.getDefaultInstance()) + return this; + if (other.hasDetails()) { + mergeDetails(other.getDetails()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.showcase.v1beta1.ErrorWithSingleDetail parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.showcase.v1beta1.ErrorWithSingleDetail) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private com.google.protobuf.Any details_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Any, + com.google.protobuf.Any.Builder, + com.google.protobuf.AnyOrBuilder> + detailsBuilder_; + + /** + * .google.protobuf.Any details = 1; + * + * @return Whether the details field is set. + */ + public boolean hasDetails() { + return detailsBuilder_ != null || details_ != null; + } + + /** + * .google.protobuf.Any details = 1; + * + * @return The details. + */ + public com.google.protobuf.Any getDetails() { + if (detailsBuilder_ == null) { + return details_ == null ? com.google.protobuf.Any.getDefaultInstance() : details_; + } else { + return detailsBuilder_.getMessage(); + } + } + + /** .google.protobuf.Any details = 1; */ + public Builder setDetails(com.google.protobuf.Any value) { + if (detailsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + details_ = value; + onChanged(); + } else { + detailsBuilder_.setMessage(value); + } + + return this; + } + + /** .google.protobuf.Any details = 1; */ + public Builder setDetails(com.google.protobuf.Any.Builder builderForValue) { + if (detailsBuilder_ == null) { + details_ = builderForValue.build(); + onChanged(); + } else { + detailsBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + + /** .google.protobuf.Any details = 1; */ + public Builder mergeDetails(com.google.protobuf.Any value) { + if (detailsBuilder_ == null) { + if (details_ != null) { + details_ = com.google.protobuf.Any.newBuilder(details_).mergeFrom(value).buildPartial(); + } else { + details_ = value; + } + onChanged(); + } else { + detailsBuilder_.mergeFrom(value); + } + + return this; + } + + /** .google.protobuf.Any details = 1; */ + public Builder clearDetails() { + if (detailsBuilder_ == null) { + details_ = null; + onChanged(); + } else { + details_ = null; + detailsBuilder_ = null; + } + + return this; + } + + /** .google.protobuf.Any details = 1; */ + public com.google.protobuf.Any.Builder getDetailsBuilder() { + + onChanged(); + return getDetailsFieldBuilder().getBuilder(); + } + + /** .google.protobuf.Any details = 1; */ + public com.google.protobuf.AnyOrBuilder getDetailsOrBuilder() { + if (detailsBuilder_ != null) { + return detailsBuilder_.getMessageOrBuilder(); + } else { + return details_ == null ? com.google.protobuf.Any.getDefaultInstance() : details_; + } + } + + /** .google.protobuf.Any details = 1; */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Any, + com.google.protobuf.Any.Builder, + com.google.protobuf.AnyOrBuilder> + getDetailsFieldBuilder() { + if (detailsBuilder_ == null) { + detailsBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Any, + com.google.protobuf.Any.Builder, + com.google.protobuf.AnyOrBuilder>(getDetails(), getParentForChildren(), isClean()); + details_ = null; + } + return detailsBuilder_; + } + + @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.showcase.v1beta1.ErrorWithSingleDetail) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.ErrorWithSingleDetail) + private static final com.google.showcase.v1beta1.ErrorWithSingleDetail DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.ErrorWithSingleDetail(); + } + + public static com.google.showcase.v1beta1.ErrorWithSingleDetail getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ErrorWithSingleDetail parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ErrorWithSingleDetail(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.showcase.v1beta1.ErrorWithSingleDetail getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ErrorWithSingleDetailOrBuilder.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ErrorWithSingleDetailOrBuilder.java new file mode 100644 index 0000000000..adbe5e8f8b --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ErrorWithSingleDetailOrBuilder.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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/echo.proto + +package com.google.showcase.v1beta1; + +public interface ErrorWithSingleDetailOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.ErrorWithSingleDetail) + com.google.protobuf.MessageOrBuilder { + + /** + * .google.protobuf.Any details = 1; + * + * @return Whether the details field is set. + */ + boolean hasDetails(); + + /** + * .google.protobuf.Any details = 1; + * + * @return The details. + */ + com.google.protobuf.Any getDetails(); + + /** .google.protobuf.Any details = 1; */ + com.google.protobuf.AnyOrBuilder getDetailsOrBuilder(); +} diff --git a/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ExpandRequest.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ExpandRequest.java new file mode 100644 index 0000000000..b390ae638a --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ExpandRequest.java @@ -0,0 +1,1206 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/echo.proto + +package com.google.showcase.v1beta1; + +/** + * + * + *
        + * The request message for the Expand method.
        + * 
        + * + * Protobuf type {@code google.showcase.v1beta1.ExpandRequest} + */ +public final class ExpandRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.ExpandRequest) + ExpandRequestOrBuilder { + private static final long serialVersionUID = 0L; + + // Use ExpandRequest.newBuilder() to construct. + private ExpandRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ExpandRequest() { + content_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ExpandRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ExpandRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + content_ = s; + break; + } + case 18: + { + com.google.rpc.Status.Builder subBuilder = null; + if (error_ != null) { + subBuilder = error_.toBuilder(); + } + error_ = input.readMessage(com.google.rpc.Status.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(error_); + error_ = subBuilder.buildPartial(); + } + + break; + } + case 26: + { + com.google.protobuf.Duration.Builder subBuilder = null; + if (streamWaitTime_ != null) { + subBuilder = streamWaitTime_.toBuilder(); + } + streamWaitTime_ = + input.readMessage(com.google.protobuf.Duration.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(streamWaitTime_); + streamWaitTime_ = subBuilder.buildPartial(); + } + + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.EchoOuterClass + .internal_static_google_showcase_v1beta1_ExpandRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.EchoOuterClass + .internal_static_google_showcase_v1beta1_ExpandRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.ExpandRequest.class, + com.google.showcase.v1beta1.ExpandRequest.Builder.class); + } + + public static final int CONTENT_FIELD_NUMBER = 1; + private volatile java.lang.Object content_; + + /** + * + * + *
        +   * The content that will be split into words and returned on the stream.
        +   * 
        + * + * string content = 1; + * + * @return The content. + */ + @java.lang.Override + public java.lang.String getContent() { + java.lang.Object ref = content_; + 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(); + content_ = s; + return s; + } + } + + /** + * + * + *
        +   * The content that will be split into words and returned on the stream.
        +   * 
        + * + * string content = 1; + * + * @return The bytes for content. + */ + @java.lang.Override + public com.google.protobuf.ByteString getContentBytes() { + java.lang.Object ref = content_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + content_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int ERROR_FIELD_NUMBER = 2; + private com.google.rpc.Status error_; + + /** + * + * + *
        +   * The error that is thrown after all words are sent on the stream.
        +   * 
        + * + * .google.rpc.Status error = 2; + * + * @return Whether the error field is set. + */ + @java.lang.Override + public boolean hasError() { + return error_ != null; + } + + /** + * + * + *
        +   * The error that is thrown after all words are sent on the stream.
        +   * 
        + * + * .google.rpc.Status error = 2; + * + * @return The error. + */ + @java.lang.Override + public com.google.rpc.Status getError() { + return error_ == null ? com.google.rpc.Status.getDefaultInstance() : error_; + } + + /** + * + * + *
        +   * The error that is thrown after all words are sent on the stream.
        +   * 
        + * + * .google.rpc.Status error = 2; + */ + @java.lang.Override + public com.google.rpc.StatusOrBuilder getErrorOrBuilder() { + return getError(); + } + + public static final int STREAM_WAIT_TIME_FIELD_NUMBER = 3; + private com.google.protobuf.Duration streamWaitTime_; + + /** + * + * + *
        +   * The wait time between each server streaming messages
        +   * 
        + * + * .google.protobuf.Duration stream_wait_time = 3; + * + * @return Whether the streamWaitTime field is set. + */ + @java.lang.Override + public boolean hasStreamWaitTime() { + return streamWaitTime_ != null; + } + + /** + * + * + *
        +   * The wait time between each server streaming messages
        +   * 
        + * + * .google.protobuf.Duration stream_wait_time = 3; + * + * @return The streamWaitTime. + */ + @java.lang.Override + public com.google.protobuf.Duration getStreamWaitTime() { + return streamWaitTime_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : streamWaitTime_; + } + + /** + * + * + *
        +   * The wait time between each server streaming messages
        +   * 
        + * + * .google.protobuf.Duration stream_wait_time = 3; + */ + @java.lang.Override + public com.google.protobuf.DurationOrBuilder getStreamWaitTimeOrBuilder() { + return getStreamWaitTime(); + } + + 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(content_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, content_); + } + if (error_ != null) { + output.writeMessage(2, getError()); + } + if (streamWaitTime_ != null) { + output.writeMessage(3, getStreamWaitTime()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(content_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, content_); + } + if (error_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getError()); + } + if (streamWaitTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getStreamWaitTime()); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.showcase.v1beta1.ExpandRequest)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.ExpandRequest other = + (com.google.showcase.v1beta1.ExpandRequest) obj; + + if (!getContent().equals(other.getContent())) return false; + if (hasError() != other.hasError()) return false; + if (hasError()) { + if (!getError().equals(other.getError())) return false; + } + if (hasStreamWaitTime() != other.hasStreamWaitTime()) return false; + if (hasStreamWaitTime()) { + if (!getStreamWaitTime().equals(other.getStreamWaitTime())) return false; + } + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + CONTENT_FIELD_NUMBER; + hash = (53 * hash) + getContent().hashCode(); + if (hasError()) { + hash = (37 * hash) + ERROR_FIELD_NUMBER; + hash = (53 * hash) + getError().hashCode(); + } + if (hasStreamWaitTime()) { + hash = (37 * hash) + STREAM_WAIT_TIME_FIELD_NUMBER; + hash = (53 * hash) + getStreamWaitTime().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.showcase.v1beta1.ExpandRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.ExpandRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.ExpandRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.ExpandRequest 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.showcase.v1beta1.ExpandRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.ExpandRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.ExpandRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.ExpandRequest 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.showcase.v1beta1.ExpandRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.ExpandRequest 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.showcase.v1beta1.ExpandRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.ExpandRequest 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.showcase.v1beta1.ExpandRequest 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 request message for the Expand method.
        +   * 
        + * + * Protobuf type {@code google.showcase.v1beta1.ExpandRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.ExpandRequest) + com.google.showcase.v1beta1.ExpandRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.EchoOuterClass + .internal_static_google_showcase_v1beta1_ExpandRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.EchoOuterClass + .internal_static_google_showcase_v1beta1_ExpandRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.ExpandRequest.class, + com.google.showcase.v1beta1.ExpandRequest.Builder.class); + } + + // Construct using com.google.showcase.v1beta1.ExpandRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + content_ = ""; + + if (errorBuilder_ == null) { + error_ = null; + } else { + error_ = null; + errorBuilder_ = null; + } + if (streamWaitTimeBuilder_ == null) { + streamWaitTime_ = null; + } else { + streamWaitTime_ = null; + streamWaitTimeBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.showcase.v1beta1.EchoOuterClass + .internal_static_google_showcase_v1beta1_ExpandRequest_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.ExpandRequest getDefaultInstanceForType() { + return com.google.showcase.v1beta1.ExpandRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.ExpandRequest build() { + com.google.showcase.v1beta1.ExpandRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.ExpandRequest buildPartial() { + com.google.showcase.v1beta1.ExpandRequest result = + new com.google.showcase.v1beta1.ExpandRequest(this); + result.content_ = content_; + if (errorBuilder_ == null) { + result.error_ = error_; + } else { + result.error_ = errorBuilder_.build(); + } + if (streamWaitTimeBuilder_ == null) { + result.streamWaitTime_ = streamWaitTime_; + } else { + result.streamWaitTime_ = streamWaitTimeBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.showcase.v1beta1.ExpandRequest) { + return mergeFrom((com.google.showcase.v1beta1.ExpandRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.showcase.v1beta1.ExpandRequest other) { + if (other == com.google.showcase.v1beta1.ExpandRequest.getDefaultInstance()) return this; + if (!other.getContent().isEmpty()) { + content_ = other.content_; + onChanged(); + } + if (other.hasError()) { + mergeError(other.getError()); + } + if (other.hasStreamWaitTime()) { + mergeStreamWaitTime(other.getStreamWaitTime()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.showcase.v1beta1.ExpandRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.showcase.v1beta1.ExpandRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object content_ = ""; + + /** + * + * + *
        +     * The content that will be split into words and returned on the stream.
        +     * 
        + * + * string content = 1; + * + * @return The content. + */ + public java.lang.String getContent() { + java.lang.Object ref = content_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + content_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
        +     * The content that will be split into words and returned on the stream.
        +     * 
        + * + * string content = 1; + * + * @return The bytes for content. + */ + public com.google.protobuf.ByteString getContentBytes() { + java.lang.Object ref = content_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + content_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
        +     * The content that will be split into words and returned on the stream.
        +     * 
        + * + * string content = 1; + * + * @param value The content to set. + * @return This builder for chaining. + */ + public Builder setContent(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + content_ = value; + onChanged(); + return this; + } + + /** + * + * + *
        +     * The content that will be split into words and returned on the stream.
        +     * 
        + * + * string content = 1; + * + * @return This builder for chaining. + */ + public Builder clearContent() { + + content_ = getDefaultInstance().getContent(); + onChanged(); + return this; + } + + /** + * + * + *
        +     * The content that will be split into words and returned on the stream.
        +     * 
        + * + * string content = 1; + * + * @param value The bytes for content to set. + * @return This builder for chaining. + */ + public Builder setContentBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + content_ = value; + onChanged(); + return this; + } + + private com.google.rpc.Status error_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.rpc.Status, com.google.rpc.Status.Builder, com.google.rpc.StatusOrBuilder> + errorBuilder_; + + /** + * + * + *
        +     * The error that is thrown after all words are sent on the stream.
        +     * 
        + * + * .google.rpc.Status error = 2; + * + * @return Whether the error field is set. + */ + public boolean hasError() { + return errorBuilder_ != null || error_ != null; + } + + /** + * + * + *
        +     * The error that is thrown after all words are sent on the stream.
        +     * 
        + * + * .google.rpc.Status error = 2; + * + * @return The error. + */ + public com.google.rpc.Status getError() { + if (errorBuilder_ == null) { + return error_ == null ? com.google.rpc.Status.getDefaultInstance() : error_; + } else { + return errorBuilder_.getMessage(); + } + } + + /** + * + * + *
        +     * The error that is thrown after all words are sent on the stream.
        +     * 
        + * + * .google.rpc.Status error = 2; + */ + public Builder setError(com.google.rpc.Status value) { + if (errorBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + error_ = value; + onChanged(); + } else { + errorBuilder_.setMessage(value); + } + + return this; + } + + /** + * + * + *
        +     * The error that is thrown after all words are sent on the stream.
        +     * 
        + * + * .google.rpc.Status error = 2; + */ + public Builder setError(com.google.rpc.Status.Builder builderForValue) { + if (errorBuilder_ == null) { + error_ = builderForValue.build(); + onChanged(); + } else { + errorBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + + /** + * + * + *
        +     * The error that is thrown after all words are sent on the stream.
        +     * 
        + * + * .google.rpc.Status error = 2; + */ + public Builder mergeError(com.google.rpc.Status value) { + if (errorBuilder_ == null) { + if (error_ != null) { + error_ = com.google.rpc.Status.newBuilder(error_).mergeFrom(value).buildPartial(); + } else { + error_ = value; + } + onChanged(); + } else { + errorBuilder_.mergeFrom(value); + } + + return this; + } + + /** + * + * + *
        +     * The error that is thrown after all words are sent on the stream.
        +     * 
        + * + * .google.rpc.Status error = 2; + */ + public Builder clearError() { + if (errorBuilder_ == null) { + error_ = null; + onChanged(); + } else { + error_ = null; + errorBuilder_ = null; + } + + return this; + } + + /** + * + * + *
        +     * The error that is thrown after all words are sent on the stream.
        +     * 
        + * + * .google.rpc.Status error = 2; + */ + public com.google.rpc.Status.Builder getErrorBuilder() { + + onChanged(); + return getErrorFieldBuilder().getBuilder(); + } + + /** + * + * + *
        +     * The error that is thrown after all words are sent on the stream.
        +     * 
        + * + * .google.rpc.Status error = 2; + */ + public com.google.rpc.StatusOrBuilder getErrorOrBuilder() { + if (errorBuilder_ != null) { + return errorBuilder_.getMessageOrBuilder(); + } else { + return error_ == null ? com.google.rpc.Status.getDefaultInstance() : error_; + } + } + + /** + * + * + *
        +     * The error that is thrown after all words are sent on the stream.
        +     * 
        + * + * .google.rpc.Status error = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.rpc.Status, com.google.rpc.Status.Builder, com.google.rpc.StatusOrBuilder> + getErrorFieldBuilder() { + if (errorBuilder_ == null) { + errorBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.rpc.Status, + com.google.rpc.Status.Builder, + com.google.rpc.StatusOrBuilder>(getError(), getParentForChildren(), isClean()); + error_ = null; + } + return errorBuilder_; + } + + private com.google.protobuf.Duration streamWaitTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder> + streamWaitTimeBuilder_; + + /** + * + * + *
        +     * The wait time between each server streaming messages
        +     * 
        + * + * .google.protobuf.Duration stream_wait_time = 3; + * + * @return Whether the streamWaitTime field is set. + */ + public boolean hasStreamWaitTime() { + return streamWaitTimeBuilder_ != null || streamWaitTime_ != null; + } + + /** + * + * + *
        +     * The wait time between each server streaming messages
        +     * 
        + * + * .google.protobuf.Duration stream_wait_time = 3; + * + * @return The streamWaitTime. + */ + public com.google.protobuf.Duration getStreamWaitTime() { + if (streamWaitTimeBuilder_ == null) { + return streamWaitTime_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : streamWaitTime_; + } else { + return streamWaitTimeBuilder_.getMessage(); + } + } + + /** + * + * + *
        +     * The wait time between each server streaming messages
        +     * 
        + * + * .google.protobuf.Duration stream_wait_time = 3; + */ + public Builder setStreamWaitTime(com.google.protobuf.Duration value) { + if (streamWaitTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + streamWaitTime_ = value; + onChanged(); + } else { + streamWaitTimeBuilder_.setMessage(value); + } + + return this; + } + + /** + * + * + *
        +     * The wait time between each server streaming messages
        +     * 
        + * + * .google.protobuf.Duration stream_wait_time = 3; + */ + public Builder setStreamWaitTime(com.google.protobuf.Duration.Builder builderForValue) { + if (streamWaitTimeBuilder_ == null) { + streamWaitTime_ = builderForValue.build(); + onChanged(); + } else { + streamWaitTimeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + + /** + * + * + *
        +     * The wait time between each server streaming messages
        +     * 
        + * + * .google.protobuf.Duration stream_wait_time = 3; + */ + public Builder mergeStreamWaitTime(com.google.protobuf.Duration value) { + if (streamWaitTimeBuilder_ == null) { + if (streamWaitTime_ != null) { + streamWaitTime_ = + com.google.protobuf.Duration.newBuilder(streamWaitTime_) + .mergeFrom(value) + .buildPartial(); + } else { + streamWaitTime_ = value; + } + onChanged(); + } else { + streamWaitTimeBuilder_.mergeFrom(value); + } + + return this; + } + + /** + * + * + *
        +     * The wait time between each server streaming messages
        +     * 
        + * + * .google.protobuf.Duration stream_wait_time = 3; + */ + public Builder clearStreamWaitTime() { + if (streamWaitTimeBuilder_ == null) { + streamWaitTime_ = null; + onChanged(); + } else { + streamWaitTime_ = null; + streamWaitTimeBuilder_ = null; + } + + return this; + } + + /** + * + * + *
        +     * The wait time between each server streaming messages
        +     * 
        + * + * .google.protobuf.Duration stream_wait_time = 3; + */ + public com.google.protobuf.Duration.Builder getStreamWaitTimeBuilder() { + + onChanged(); + return getStreamWaitTimeFieldBuilder().getBuilder(); + } + + /** + * + * + *
        +     * The wait time between each server streaming messages
        +     * 
        + * + * .google.protobuf.Duration stream_wait_time = 3; + */ + public com.google.protobuf.DurationOrBuilder getStreamWaitTimeOrBuilder() { + if (streamWaitTimeBuilder_ != null) { + return streamWaitTimeBuilder_.getMessageOrBuilder(); + } else { + return streamWaitTime_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : streamWaitTime_; + } + } + + /** + * + * + *
        +     * The wait time between each server streaming messages
        +     * 
        + * + * .google.protobuf.Duration stream_wait_time = 3; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder> + getStreamWaitTimeFieldBuilder() { + if (streamWaitTimeBuilder_ == null) { + streamWaitTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder>( + getStreamWaitTime(), getParentForChildren(), isClean()); + streamWaitTime_ = null; + } + return streamWaitTimeBuilder_; + } + + @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.showcase.v1beta1.ExpandRequest) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.ExpandRequest) + private static final com.google.showcase.v1beta1.ExpandRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.ExpandRequest(); + } + + public static com.google.showcase.v1beta1.ExpandRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ExpandRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ExpandRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.showcase.v1beta1.ExpandRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ExpandRequestOrBuilder.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ExpandRequestOrBuilder.java new file mode 100644 index 0000000000..ae2335873e --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ExpandRequestOrBuilder.java @@ -0,0 +1,125 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/echo.proto + +package com.google.showcase.v1beta1; + +public interface ExpandRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.ExpandRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
        +   * The content that will be split into words and returned on the stream.
        +   * 
        + * + * string content = 1; + * + * @return The content. + */ + java.lang.String getContent(); + + /** + * + * + *
        +   * The content that will be split into words and returned on the stream.
        +   * 
        + * + * string content = 1; + * + * @return The bytes for content. + */ + com.google.protobuf.ByteString getContentBytes(); + + /** + * + * + *
        +   * The error that is thrown after all words are sent on the stream.
        +   * 
        + * + * .google.rpc.Status error = 2; + * + * @return Whether the error field is set. + */ + boolean hasError(); + + /** + * + * + *
        +   * The error that is thrown after all words are sent on the stream.
        +   * 
        + * + * .google.rpc.Status error = 2; + * + * @return The error. + */ + com.google.rpc.Status getError(); + + /** + * + * + *
        +   * The error that is thrown after all words are sent on the stream.
        +   * 
        + * + * .google.rpc.Status error = 2; + */ + com.google.rpc.StatusOrBuilder getErrorOrBuilder(); + + /** + * + * + *
        +   * The wait time between each server streaming messages
        +   * 
        + * + * .google.protobuf.Duration stream_wait_time = 3; + * + * @return Whether the streamWaitTime field is set. + */ + boolean hasStreamWaitTime(); + + /** + * + * + *
        +   * The wait time between each server streaming messages
        +   * 
        + * + * .google.protobuf.Duration stream_wait_time = 3; + * + * @return The streamWaitTime. + */ + com.google.protobuf.Duration getStreamWaitTime(); + + /** + * + * + *
        +   * The wait time between each server streaming messages
        +   * 
        + * + * .google.protobuf.Duration stream_wait_time = 3; + */ + com.google.protobuf.DurationOrBuilder getStreamWaitTimeOrBuilder(); +} diff --git a/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/FailEchoWithDetailsRequest.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/FailEchoWithDetailsRequest.java new file mode 100644 index 0000000000..21fcc8ec64 --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/FailEchoWithDetailsRequest.java @@ -0,0 +1,655 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/echo.proto + +package com.google.showcase.v1beta1; + +/** + * + * + *
        + * The request message used for the FailEchoWithDetails method.
        + * 
        + * + * Protobuf type {@code google.showcase.v1beta1.FailEchoWithDetailsRequest} + */ +public final class FailEchoWithDetailsRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.FailEchoWithDetailsRequest) + FailEchoWithDetailsRequestOrBuilder { + private static final long serialVersionUID = 0L; + + // Use FailEchoWithDetailsRequest.newBuilder() to construct. + private FailEchoWithDetailsRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private FailEchoWithDetailsRequest() { + message_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new FailEchoWithDetailsRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private FailEchoWithDetailsRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + message_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.EchoOuterClass + .internal_static_google_showcase_v1beta1_FailEchoWithDetailsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.EchoOuterClass + .internal_static_google_showcase_v1beta1_FailEchoWithDetailsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.FailEchoWithDetailsRequest.class, + com.google.showcase.v1beta1.FailEchoWithDetailsRequest.Builder.class); + } + + public static final int MESSAGE_FIELD_NUMBER = 1; + private volatile java.lang.Object message_; + + /** + * + * + *
        +   * Optional message to echo back in the PoetryError. If empty, a value will be
        +   * provided.
        +   * 
        + * + * string message = 1; + * + * @return The message. + */ + @java.lang.Override + public java.lang.String getMessage() { + java.lang.Object ref = message_; + 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(); + message_ = s; + return s; + } + } + + /** + * + * + *
        +   * Optional message to echo back in the PoetryError. If empty, a value will be
        +   * provided.
        +   * 
        + * + * string message = 1; + * + * @return The bytes for message. + */ + @java.lang.Override + public com.google.protobuf.ByteString getMessageBytes() { + java.lang.Object ref = message_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + message_ = 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(message_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, message_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(message_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, message_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.showcase.v1beta1.FailEchoWithDetailsRequest)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.FailEchoWithDetailsRequest other = + (com.google.showcase.v1beta1.FailEchoWithDetailsRequest) obj; + + if (!getMessage().equals(other.getMessage())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + MESSAGE_FIELD_NUMBER; + hash = (53 * hash) + getMessage().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.showcase.v1beta1.FailEchoWithDetailsRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.FailEchoWithDetailsRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.FailEchoWithDetailsRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.FailEchoWithDetailsRequest 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.showcase.v1beta1.FailEchoWithDetailsRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.FailEchoWithDetailsRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.FailEchoWithDetailsRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.FailEchoWithDetailsRequest 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.showcase.v1beta1.FailEchoWithDetailsRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.FailEchoWithDetailsRequest 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.showcase.v1beta1.FailEchoWithDetailsRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.FailEchoWithDetailsRequest 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.showcase.v1beta1.FailEchoWithDetailsRequest 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 request message used for the FailEchoWithDetails method.
        +   * 
        + * + * Protobuf type {@code google.showcase.v1beta1.FailEchoWithDetailsRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.FailEchoWithDetailsRequest) + com.google.showcase.v1beta1.FailEchoWithDetailsRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.EchoOuterClass + .internal_static_google_showcase_v1beta1_FailEchoWithDetailsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.EchoOuterClass + .internal_static_google_showcase_v1beta1_FailEchoWithDetailsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.FailEchoWithDetailsRequest.class, + com.google.showcase.v1beta1.FailEchoWithDetailsRequest.Builder.class); + } + + // Construct using com.google.showcase.v1beta1.FailEchoWithDetailsRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + message_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.showcase.v1beta1.EchoOuterClass + .internal_static_google_showcase_v1beta1_FailEchoWithDetailsRequest_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.FailEchoWithDetailsRequest getDefaultInstanceForType() { + return com.google.showcase.v1beta1.FailEchoWithDetailsRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.FailEchoWithDetailsRequest build() { + com.google.showcase.v1beta1.FailEchoWithDetailsRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.FailEchoWithDetailsRequest buildPartial() { + com.google.showcase.v1beta1.FailEchoWithDetailsRequest result = + new com.google.showcase.v1beta1.FailEchoWithDetailsRequest(this); + result.message_ = message_; + 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.showcase.v1beta1.FailEchoWithDetailsRequest) { + return mergeFrom((com.google.showcase.v1beta1.FailEchoWithDetailsRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.showcase.v1beta1.FailEchoWithDetailsRequest other) { + if (other == com.google.showcase.v1beta1.FailEchoWithDetailsRequest.getDefaultInstance()) + return this; + if (!other.getMessage().isEmpty()) { + message_ = other.message_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.showcase.v1beta1.FailEchoWithDetailsRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.showcase.v1beta1.FailEchoWithDetailsRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object message_ = ""; + + /** + * + * + *
        +     * Optional message to echo back in the PoetryError. If empty, a value will be
        +     * provided.
        +     * 
        + * + * string message = 1; + * + * @return The message. + */ + public java.lang.String getMessage() { + java.lang.Object ref = message_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + message_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
        +     * Optional message to echo back in the PoetryError. If empty, a value will be
        +     * provided.
        +     * 
        + * + * string message = 1; + * + * @return The bytes for message. + */ + public com.google.protobuf.ByteString getMessageBytes() { + java.lang.Object ref = message_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + message_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
        +     * Optional message to echo back in the PoetryError. If empty, a value will be
        +     * provided.
        +     * 
        + * + * string message = 1; + * + * @param value The message to set. + * @return This builder for chaining. + */ + public Builder setMessage(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + message_ = value; + onChanged(); + return this; + } + + /** + * + * + *
        +     * Optional message to echo back in the PoetryError. If empty, a value will be
        +     * provided.
        +     * 
        + * + * string message = 1; + * + * @return This builder for chaining. + */ + public Builder clearMessage() { + + message_ = getDefaultInstance().getMessage(); + onChanged(); + return this; + } + + /** + * + * + *
        +     * Optional message to echo back in the PoetryError. If empty, a value will be
        +     * provided.
        +     * 
        + * + * string message = 1; + * + * @param value The bytes for message to set. + * @return This builder for chaining. + */ + public Builder setMessageBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + message_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.showcase.v1beta1.FailEchoWithDetailsRequest) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.FailEchoWithDetailsRequest) + private static final com.google.showcase.v1beta1.FailEchoWithDetailsRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.FailEchoWithDetailsRequest(); + } + + public static com.google.showcase.v1beta1.FailEchoWithDetailsRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public FailEchoWithDetailsRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new FailEchoWithDetailsRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.showcase.v1beta1.FailEchoWithDetailsRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/FailEchoWithDetailsRequestOrBuilder.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/FailEchoWithDetailsRequestOrBuilder.java new file mode 100644 index 0000000000..ce0fea97b9 --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/FailEchoWithDetailsRequestOrBuilder.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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/echo.proto + +package com.google.showcase.v1beta1; + +public interface FailEchoWithDetailsRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.FailEchoWithDetailsRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
        +   * Optional message to echo back in the PoetryError. If empty, a value will be
        +   * provided.
        +   * 
        + * + * string message = 1; + * + * @return The message. + */ + java.lang.String getMessage(); + + /** + * + * + *
        +   * Optional message to echo back in the PoetryError. If empty, a value will be
        +   * provided.
        +   * 
        + * + * string message = 1; + * + * @return The bytes for message. + */ + com.google.protobuf.ByteString getMessageBytes(); +} diff --git a/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/FailEchoWithDetailsResponse.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/FailEchoWithDetailsResponse.java new file mode 100644 index 0000000000..95486c63e4 --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/FailEchoWithDetailsResponse.java @@ -0,0 +1,463 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/echo.proto + +package com.google.showcase.v1beta1; + +/** + * + * + *
        + * The response message declared (but never used) for the FailEchoWithDetails
        + * method.
        + * 
        + * + * Protobuf type {@code google.showcase.v1beta1.FailEchoWithDetailsResponse} + */ +public final class FailEchoWithDetailsResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.FailEchoWithDetailsResponse) + FailEchoWithDetailsResponseOrBuilder { + private static final long serialVersionUID = 0L; + + // Use FailEchoWithDetailsResponse.newBuilder() to construct. + private FailEchoWithDetailsResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private FailEchoWithDetailsResponse() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new FailEchoWithDetailsResponse(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private FailEchoWithDetailsResponse( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.EchoOuterClass + .internal_static_google_showcase_v1beta1_FailEchoWithDetailsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.EchoOuterClass + .internal_static_google_showcase_v1beta1_FailEchoWithDetailsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.FailEchoWithDetailsResponse.class, + com.google.showcase.v1beta1.FailEchoWithDetailsResponse.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 { + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.showcase.v1beta1.FailEchoWithDetailsResponse)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.FailEchoWithDetailsResponse other = + (com.google.showcase.v1beta1.FailEchoWithDetailsResponse) obj; + + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.showcase.v1beta1.FailEchoWithDetailsResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.FailEchoWithDetailsResponse parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.FailEchoWithDetailsResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.FailEchoWithDetailsResponse 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.showcase.v1beta1.FailEchoWithDetailsResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.FailEchoWithDetailsResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.FailEchoWithDetailsResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.FailEchoWithDetailsResponse 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.showcase.v1beta1.FailEchoWithDetailsResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.FailEchoWithDetailsResponse 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.showcase.v1beta1.FailEchoWithDetailsResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.FailEchoWithDetailsResponse 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.showcase.v1beta1.FailEchoWithDetailsResponse 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 message declared (but never used) for the FailEchoWithDetails
        +   * method.
        +   * 
        + * + * Protobuf type {@code google.showcase.v1beta1.FailEchoWithDetailsResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.FailEchoWithDetailsResponse) + com.google.showcase.v1beta1.FailEchoWithDetailsResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.EchoOuterClass + .internal_static_google_showcase_v1beta1_FailEchoWithDetailsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.EchoOuterClass + .internal_static_google_showcase_v1beta1_FailEchoWithDetailsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.FailEchoWithDetailsResponse.class, + com.google.showcase.v1beta1.FailEchoWithDetailsResponse.Builder.class); + } + + // Construct using com.google.showcase.v1beta1.FailEchoWithDetailsResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.showcase.v1beta1.EchoOuterClass + .internal_static_google_showcase_v1beta1_FailEchoWithDetailsResponse_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.FailEchoWithDetailsResponse getDefaultInstanceForType() { + return com.google.showcase.v1beta1.FailEchoWithDetailsResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.FailEchoWithDetailsResponse build() { + com.google.showcase.v1beta1.FailEchoWithDetailsResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.FailEchoWithDetailsResponse buildPartial() { + com.google.showcase.v1beta1.FailEchoWithDetailsResponse result = + new com.google.showcase.v1beta1.FailEchoWithDetailsResponse(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.showcase.v1beta1.FailEchoWithDetailsResponse) { + return mergeFrom((com.google.showcase.v1beta1.FailEchoWithDetailsResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.showcase.v1beta1.FailEchoWithDetailsResponse other) { + if (other == com.google.showcase.v1beta1.FailEchoWithDetailsResponse.getDefaultInstance()) + return this; + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.showcase.v1beta1.FailEchoWithDetailsResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.showcase.v1beta1.FailEchoWithDetailsResponse) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + 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.showcase.v1beta1.FailEchoWithDetailsResponse) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.FailEchoWithDetailsResponse) + private static final com.google.showcase.v1beta1.FailEchoWithDetailsResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.FailEchoWithDetailsResponse(); + } + + public static com.google.showcase.v1beta1.FailEchoWithDetailsResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public FailEchoWithDetailsResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new FailEchoWithDetailsResponse(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.showcase.v1beta1.FailEchoWithDetailsResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/FailEchoWithDetailsResponseOrBuilder.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/FailEchoWithDetailsResponseOrBuilder.java new file mode 100644 index 0000000000..55af89e422 --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/FailEchoWithDetailsResponseOrBuilder.java @@ -0,0 +1,24 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/echo.proto + +package com.google.showcase.v1beta1; + +public interface FailEchoWithDetailsResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.FailEchoWithDetailsResponse) + com.google.protobuf.MessageOrBuilder {} diff --git a/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/GetBlurbRequest.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/GetBlurbRequest.java new file mode 100644 index 0000000000..82e6106608 --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/GetBlurbRequest.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: schema/google/showcase/v1beta1/messaging.proto + +package com.google.showcase.v1beta1; + +/** + * + * + *
        + * The request message for the google.showcase.v1beta1.Messaging\GetBlurb
        + * method.
        + * 
        + * + * Protobuf type {@code google.showcase.v1beta1.GetBlurbRequest} + */ +public final class GetBlurbRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.GetBlurbRequest) + GetBlurbRequestOrBuilder { + private static final long serialVersionUID = 0L; + + // Use GetBlurbRequest.newBuilder() to construct. + private GetBlurbRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private GetBlurbRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new GetBlurbRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private GetBlurbRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.MessagingOuterClass + .internal_static_google_showcase_v1beta1_GetBlurbRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.MessagingOuterClass + .internal_static_google_showcase_v1beta1_GetBlurbRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.GetBlurbRequest.class, + com.google.showcase.v1beta1.GetBlurbRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + + /** + * + * + *
        +   * The resource name of the requested blurb.
        +   * 
        + * + * + * 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; + } + } + + /** + * + * + *
        +   * The resource name of the requested blurb.
        +   * 
        + * + * + * 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_); + } + unknownFields.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 += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.showcase.v1beta1.GetBlurbRequest)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.GetBlurbRequest other = + (com.google.showcase.v1beta1.GetBlurbRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.showcase.v1beta1.GetBlurbRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.GetBlurbRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.GetBlurbRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.GetBlurbRequest 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.showcase.v1beta1.GetBlurbRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.GetBlurbRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.GetBlurbRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.GetBlurbRequest 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.showcase.v1beta1.GetBlurbRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.GetBlurbRequest 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.showcase.v1beta1.GetBlurbRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.GetBlurbRequest 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.showcase.v1beta1.GetBlurbRequest 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 request message for the google.showcase.v1beta1.Messaging\GetBlurb
        +   * method.
        +   * 
        + * + * Protobuf type {@code google.showcase.v1beta1.GetBlurbRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.GetBlurbRequest) + com.google.showcase.v1beta1.GetBlurbRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.MessagingOuterClass + .internal_static_google_showcase_v1beta1_GetBlurbRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.MessagingOuterClass + .internal_static_google_showcase_v1beta1_GetBlurbRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.GetBlurbRequest.class, + com.google.showcase.v1beta1.GetBlurbRequest.Builder.class); + } + + // Construct using com.google.showcase.v1beta1.GetBlurbRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.showcase.v1beta1.MessagingOuterClass + .internal_static_google_showcase_v1beta1_GetBlurbRequest_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.GetBlurbRequest getDefaultInstanceForType() { + return com.google.showcase.v1beta1.GetBlurbRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.GetBlurbRequest build() { + com.google.showcase.v1beta1.GetBlurbRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.GetBlurbRequest buildPartial() { + com.google.showcase.v1beta1.GetBlurbRequest result = + new com.google.showcase.v1beta1.GetBlurbRequest(this); + result.name_ = name_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.showcase.v1beta1.GetBlurbRequest) { + return mergeFrom((com.google.showcase.v1beta1.GetBlurbRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.showcase.v1beta1.GetBlurbRequest other) { + if (other == com.google.showcase.v1beta1.GetBlurbRequest.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.showcase.v1beta1.GetBlurbRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.showcase.v1beta1.GetBlurbRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + + /** + * + * + *
        +     * The resource name of the requested blurb.
        +     * 
        + * + * + * 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; + } + } + + /** + * + * + *
        +     * The resource name of the requested blurb.
        +     * 
        + * + * + * 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; + } + } + + /** + * + * + *
        +     * The resource name of the requested blurb.
        +     * 
        + * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + + /** + * + * + *
        +     * The resource name of the requested blurb.
        +     * 
        + * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + + /** + * + * + *
        +     * The resource name of the requested blurb.
        +     * 
        + * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.showcase.v1beta1.GetBlurbRequest) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.GetBlurbRequest) + private static final com.google.showcase.v1beta1.GetBlurbRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.GetBlurbRequest(); + } + + public static com.google.showcase.v1beta1.GetBlurbRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GetBlurbRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new GetBlurbRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.showcase.v1beta1.GetBlurbRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/GetBlurbRequestOrBuilder.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/GetBlurbRequestOrBuilder.java new file mode 100644 index 0000000000..8cf0368c63 --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/GetBlurbRequestOrBuilder.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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/messaging.proto + +package com.google.showcase.v1beta1; + +public interface GetBlurbRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.GetBlurbRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
        +   * The resource name of the requested blurb.
        +   * 
        + * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + + /** + * + * + *
        +   * The resource name of the requested blurb.
        +   * 
        + * + * + * 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-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/GetRoomRequest.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/GetRoomRequest.java new file mode 100644 index 0000000000..2e5c7f0576 --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/GetRoomRequest.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: schema/google/showcase/v1beta1/messaging.proto + +package com.google.showcase.v1beta1; + +/** + * + * + *
        + * The request message for the google.showcase.v1beta1.Messaging\GetRoom
        + * method.
        + * 
        + * + * Protobuf type {@code google.showcase.v1beta1.GetRoomRequest} + */ +public final class GetRoomRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.GetRoomRequest) + GetRoomRequestOrBuilder { + private static final long serialVersionUID = 0L; + + // Use GetRoomRequest.newBuilder() to construct. + private GetRoomRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private GetRoomRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new GetRoomRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private GetRoomRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.MessagingOuterClass + .internal_static_google_showcase_v1beta1_GetRoomRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.MessagingOuterClass + .internal_static_google_showcase_v1beta1_GetRoomRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.GetRoomRequest.class, + com.google.showcase.v1beta1.GetRoomRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + + /** + * + * + *
        +   * The resource name of the requested room.
        +   * 
        + * + * + * 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; + } + } + + /** + * + * + *
        +   * The resource name of the requested room.
        +   * 
        + * + * + * 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_); + } + unknownFields.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 += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.showcase.v1beta1.GetRoomRequest)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.GetRoomRequest other = + (com.google.showcase.v1beta1.GetRoomRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.showcase.v1beta1.GetRoomRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.GetRoomRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.GetRoomRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.GetRoomRequest 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.showcase.v1beta1.GetRoomRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.GetRoomRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.GetRoomRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.GetRoomRequest 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.showcase.v1beta1.GetRoomRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.GetRoomRequest 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.showcase.v1beta1.GetRoomRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.GetRoomRequest 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.showcase.v1beta1.GetRoomRequest 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 request message for the google.showcase.v1beta1.Messaging\GetRoom
        +   * method.
        +   * 
        + * + * Protobuf type {@code google.showcase.v1beta1.GetRoomRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.GetRoomRequest) + com.google.showcase.v1beta1.GetRoomRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.MessagingOuterClass + .internal_static_google_showcase_v1beta1_GetRoomRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.MessagingOuterClass + .internal_static_google_showcase_v1beta1_GetRoomRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.GetRoomRequest.class, + com.google.showcase.v1beta1.GetRoomRequest.Builder.class); + } + + // Construct using com.google.showcase.v1beta1.GetRoomRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.showcase.v1beta1.MessagingOuterClass + .internal_static_google_showcase_v1beta1_GetRoomRequest_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.GetRoomRequest getDefaultInstanceForType() { + return com.google.showcase.v1beta1.GetRoomRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.GetRoomRequest build() { + com.google.showcase.v1beta1.GetRoomRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.GetRoomRequest buildPartial() { + com.google.showcase.v1beta1.GetRoomRequest result = + new com.google.showcase.v1beta1.GetRoomRequest(this); + result.name_ = name_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.showcase.v1beta1.GetRoomRequest) { + return mergeFrom((com.google.showcase.v1beta1.GetRoomRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.showcase.v1beta1.GetRoomRequest other) { + if (other == com.google.showcase.v1beta1.GetRoomRequest.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.showcase.v1beta1.GetRoomRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.showcase.v1beta1.GetRoomRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + + /** + * + * + *
        +     * The resource name of the requested room.
        +     * 
        + * + * + * 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; + } + } + + /** + * + * + *
        +     * The resource name of the requested room.
        +     * 
        + * + * + * 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; + } + } + + /** + * + * + *
        +     * The resource name of the requested room.
        +     * 
        + * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + + /** + * + * + *
        +     * The resource name of the requested room.
        +     * 
        + * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + + /** + * + * + *
        +     * The resource name of the requested room.
        +     * 
        + * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.showcase.v1beta1.GetRoomRequest) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.GetRoomRequest) + private static final com.google.showcase.v1beta1.GetRoomRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.GetRoomRequest(); + } + + public static com.google.showcase.v1beta1.GetRoomRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GetRoomRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new GetRoomRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.showcase.v1beta1.GetRoomRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/GetRoomRequestOrBuilder.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/GetRoomRequestOrBuilder.java new file mode 100644 index 0000000000..8529a6b78d --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/GetRoomRequestOrBuilder.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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/messaging.proto + +package com.google.showcase.v1beta1; + +public interface GetRoomRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.GetRoomRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
        +   * The resource name of the requested room.
        +   * 
        + * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + + /** + * + * + *
        +   * The resource name of the requested room.
        +   * 
        + * + * + * 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-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/GetSequenceReportRequest.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/GetSequenceReportRequest.java new file mode 100644 index 0000000000..8dbf20eb47 --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/GetSequenceReportRequest.java @@ -0,0 +1,603 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/sequence.proto + +package com.google.showcase.v1beta1; + +/** Protobuf type {@code google.showcase.v1beta1.GetSequenceReportRequest} */ +public final class GetSequenceReportRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.GetSequenceReportRequest) + GetSequenceReportRequestOrBuilder { + private static final long serialVersionUID = 0L; + + // Use GetSequenceReportRequest.newBuilder() to construct. + private GetSequenceReportRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private GetSequenceReportRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new GetSequenceReportRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private GetSequenceReportRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.SequenceOuterClass + .internal_static_google_showcase_v1beta1_GetSequenceReportRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.SequenceOuterClass + .internal_static_google_showcase_v1beta1_GetSequenceReportRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.GetSequenceReportRequest.class, + com.google.showcase.v1beta1.GetSequenceReportRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + + /** + * + * 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; + } + } + + /** + * + * 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_); + } + unknownFields.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 += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.showcase.v1beta1.GetSequenceReportRequest)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.GetSequenceReportRequest other = + (com.google.showcase.v1beta1.GetSequenceReportRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.showcase.v1beta1.GetSequenceReportRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.GetSequenceReportRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.GetSequenceReportRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.GetSequenceReportRequest 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.showcase.v1beta1.GetSequenceReportRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.GetSequenceReportRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.GetSequenceReportRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.GetSequenceReportRequest 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.showcase.v1beta1.GetSequenceReportRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.GetSequenceReportRequest 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.showcase.v1beta1.GetSequenceReportRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.GetSequenceReportRequest 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.showcase.v1beta1.GetSequenceReportRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** Protobuf type {@code google.showcase.v1beta1.GetSequenceReportRequest} */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.GetSequenceReportRequest) + com.google.showcase.v1beta1.GetSequenceReportRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.SequenceOuterClass + .internal_static_google_showcase_v1beta1_GetSequenceReportRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.SequenceOuterClass + .internal_static_google_showcase_v1beta1_GetSequenceReportRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.GetSequenceReportRequest.class, + com.google.showcase.v1beta1.GetSequenceReportRequest.Builder.class); + } + + // Construct using com.google.showcase.v1beta1.GetSequenceReportRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.showcase.v1beta1.SequenceOuterClass + .internal_static_google_showcase_v1beta1_GetSequenceReportRequest_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.GetSequenceReportRequest getDefaultInstanceForType() { + return com.google.showcase.v1beta1.GetSequenceReportRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.GetSequenceReportRequest build() { + com.google.showcase.v1beta1.GetSequenceReportRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.GetSequenceReportRequest buildPartial() { + com.google.showcase.v1beta1.GetSequenceReportRequest result = + new com.google.showcase.v1beta1.GetSequenceReportRequest(this); + result.name_ = name_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.showcase.v1beta1.GetSequenceReportRequest) { + return mergeFrom((com.google.showcase.v1beta1.GetSequenceReportRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.showcase.v1beta1.GetSequenceReportRequest other) { + if (other == com.google.showcase.v1beta1.GetSequenceReportRequest.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.showcase.v1beta1.GetSequenceReportRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.showcase.v1beta1.GetSequenceReportRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + + /** + * + * 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; + } + } + + /** + * + * 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; + } + } + + /** + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + + /** + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + + /** + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.showcase.v1beta1.GetSequenceReportRequest) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.GetSequenceReportRequest) + private static final com.google.showcase.v1beta1.GetSequenceReportRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.GetSequenceReportRequest(); + } + + public static com.google.showcase.v1beta1.GetSequenceReportRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GetSequenceReportRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new GetSequenceReportRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.showcase.v1beta1.GetSequenceReportRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/GetSequenceReportRequestOrBuilder.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/GetSequenceReportRequestOrBuilder.java new file mode 100644 index 0000000000..3444856fc6 --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/GetSequenceReportRequestOrBuilder.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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/sequence.proto + +package com.google.showcase.v1beta1; + +public interface GetSequenceReportRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.GetSequenceReportRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + + /** + * + * 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-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/GetSessionRequest.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/GetSessionRequest.java new file mode 100644 index 0000000000..1a8602adad --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/GetSessionRequest.java @@ -0,0 +1,645 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/testing.proto + +package com.google.showcase.v1beta1; + +/** + * + * + *
        + * The request for the GetSession method.
        + * 
        + * + * Protobuf type {@code google.showcase.v1beta1.GetSessionRequest} + */ +public final class GetSessionRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.GetSessionRequest) + GetSessionRequestOrBuilder { + private static final long serialVersionUID = 0L; + + // Use GetSessionRequest.newBuilder() to construct. + private GetSessionRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private GetSessionRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new GetSessionRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private GetSessionRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.TestingOuterClass + .internal_static_google_showcase_v1beta1_GetSessionRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.TestingOuterClass + .internal_static_google_showcase_v1beta1_GetSessionRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.GetSessionRequest.class, + com.google.showcase.v1beta1.GetSessionRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + + /** + * + * + *
        +   * The session to be retrieved.
        +   * 
        + * + * string name = 1 [(.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; + } + } + + /** + * + * + *
        +   * The session to be retrieved.
        +   * 
        + * + * string name = 1 [(.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_); + } + unknownFields.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 += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.showcase.v1beta1.GetSessionRequest)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.GetSessionRequest other = + (com.google.showcase.v1beta1.GetSessionRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.showcase.v1beta1.GetSessionRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.GetSessionRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.GetSessionRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.GetSessionRequest 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.showcase.v1beta1.GetSessionRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.GetSessionRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.GetSessionRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.GetSessionRequest 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.showcase.v1beta1.GetSessionRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.GetSessionRequest 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.showcase.v1beta1.GetSessionRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.GetSessionRequest 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.showcase.v1beta1.GetSessionRequest 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 request for the GetSession method.
        +   * 
        + * + * Protobuf type {@code google.showcase.v1beta1.GetSessionRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.GetSessionRequest) + com.google.showcase.v1beta1.GetSessionRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.TestingOuterClass + .internal_static_google_showcase_v1beta1_GetSessionRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.TestingOuterClass + .internal_static_google_showcase_v1beta1_GetSessionRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.GetSessionRequest.class, + com.google.showcase.v1beta1.GetSessionRequest.Builder.class); + } + + // Construct using com.google.showcase.v1beta1.GetSessionRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.showcase.v1beta1.TestingOuterClass + .internal_static_google_showcase_v1beta1_GetSessionRequest_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.GetSessionRequest getDefaultInstanceForType() { + return com.google.showcase.v1beta1.GetSessionRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.GetSessionRequest build() { + com.google.showcase.v1beta1.GetSessionRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.GetSessionRequest buildPartial() { + com.google.showcase.v1beta1.GetSessionRequest result = + new com.google.showcase.v1beta1.GetSessionRequest(this); + result.name_ = name_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.showcase.v1beta1.GetSessionRequest) { + return mergeFrom((com.google.showcase.v1beta1.GetSessionRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.showcase.v1beta1.GetSessionRequest other) { + if (other == com.google.showcase.v1beta1.GetSessionRequest.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.showcase.v1beta1.GetSessionRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.showcase.v1beta1.GetSessionRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + + /** + * + * + *
        +     * The session to be retrieved.
        +     * 
        + * + * string name = 1 [(.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; + } + } + + /** + * + * + *
        +     * The session to be retrieved.
        +     * 
        + * + * string name = 1 [(.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; + } + } + + /** + * + * + *
        +     * The session to be retrieved.
        +     * 
        + * + * string name = 1 [(.google.api.resource_reference) = { ... } + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + + /** + * + * + *
        +     * The session to be retrieved.
        +     * 
        + * + * string name = 1 [(.google.api.resource_reference) = { ... } + * + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + + /** + * + * + *
        +     * The session to be retrieved.
        +     * 
        + * + * string name = 1 [(.google.api.resource_reference) = { ... } + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.showcase.v1beta1.GetSessionRequest) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.GetSessionRequest) + private static final com.google.showcase.v1beta1.GetSessionRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.GetSessionRequest(); + } + + public static com.google.showcase.v1beta1.GetSessionRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GetSessionRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new GetSessionRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.showcase.v1beta1.GetSessionRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/GetSessionRequestOrBuilder.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/GetSessionRequestOrBuilder.java new file mode 100644 index 0000000000..631848993d --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/GetSessionRequestOrBuilder.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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/testing.proto + +package com.google.showcase.v1beta1; + +public interface GetSessionRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.GetSessionRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
        +   * The session to be retrieved.
        +   * 
        + * + * string name = 1 [(.google.api.resource_reference) = { ... } + * + * @return The name. + */ + java.lang.String getName(); + + /** + * + * + *
        +   * The session to be retrieved.
        +   * 
        + * + * string name = 1 [(.google.api.resource_reference) = { ... } + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); +} diff --git a/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/GetStreamingSequenceReportRequest.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/GetStreamingSequenceReportRequest.java new file mode 100644 index 0000000000..78c299eddc --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/GetStreamingSequenceReportRequest.java @@ -0,0 +1,609 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/sequence.proto + +package com.google.showcase.v1beta1; + +/** Protobuf type {@code google.showcase.v1beta1.GetStreamingSequenceReportRequest} */ +public final class GetStreamingSequenceReportRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.GetStreamingSequenceReportRequest) + GetStreamingSequenceReportRequestOrBuilder { + private static final long serialVersionUID = 0L; + + // Use GetStreamingSequenceReportRequest.newBuilder() to construct. + private GetStreamingSequenceReportRequest( + com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private GetStreamingSequenceReportRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new GetStreamingSequenceReportRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private GetStreamingSequenceReportRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.SequenceOuterClass + .internal_static_google_showcase_v1beta1_GetStreamingSequenceReportRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.SequenceOuterClass + .internal_static_google_showcase_v1beta1_GetStreamingSequenceReportRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.GetStreamingSequenceReportRequest.class, + com.google.showcase.v1beta1.GetStreamingSequenceReportRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + + /** + * + * 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; + } + } + + /** + * + * 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_); + } + unknownFields.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 += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.showcase.v1beta1.GetStreamingSequenceReportRequest)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.GetStreamingSequenceReportRequest other = + (com.google.showcase.v1beta1.GetStreamingSequenceReportRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.showcase.v1beta1.GetStreamingSequenceReportRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.GetStreamingSequenceReportRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.GetStreamingSequenceReportRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.GetStreamingSequenceReportRequest 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.showcase.v1beta1.GetStreamingSequenceReportRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.GetStreamingSequenceReportRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.GetStreamingSequenceReportRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.GetStreamingSequenceReportRequest 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.showcase.v1beta1.GetStreamingSequenceReportRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.GetStreamingSequenceReportRequest 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.showcase.v1beta1.GetStreamingSequenceReportRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.GetStreamingSequenceReportRequest 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.showcase.v1beta1.GetStreamingSequenceReportRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** Protobuf type {@code google.showcase.v1beta1.GetStreamingSequenceReportRequest} */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.GetStreamingSequenceReportRequest) + com.google.showcase.v1beta1.GetStreamingSequenceReportRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.SequenceOuterClass + .internal_static_google_showcase_v1beta1_GetStreamingSequenceReportRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.SequenceOuterClass + .internal_static_google_showcase_v1beta1_GetStreamingSequenceReportRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.GetStreamingSequenceReportRequest.class, + com.google.showcase.v1beta1.GetStreamingSequenceReportRequest.Builder.class); + } + + // Construct using com.google.showcase.v1beta1.GetStreamingSequenceReportRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.showcase.v1beta1.SequenceOuterClass + .internal_static_google_showcase_v1beta1_GetStreamingSequenceReportRequest_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.GetStreamingSequenceReportRequest + getDefaultInstanceForType() { + return com.google.showcase.v1beta1.GetStreamingSequenceReportRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.GetStreamingSequenceReportRequest build() { + com.google.showcase.v1beta1.GetStreamingSequenceReportRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.GetStreamingSequenceReportRequest buildPartial() { + com.google.showcase.v1beta1.GetStreamingSequenceReportRequest result = + new com.google.showcase.v1beta1.GetStreamingSequenceReportRequest(this); + result.name_ = name_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.showcase.v1beta1.GetStreamingSequenceReportRequest) { + return mergeFrom((com.google.showcase.v1beta1.GetStreamingSequenceReportRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.showcase.v1beta1.GetStreamingSequenceReportRequest other) { + if (other + == com.google.showcase.v1beta1.GetStreamingSequenceReportRequest.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.showcase.v1beta1.GetStreamingSequenceReportRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.showcase.v1beta1.GetStreamingSequenceReportRequest) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + + /** + * + * 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; + } + } + + /** + * + * 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; + } + } + + /** + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + + /** + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + + /** + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.showcase.v1beta1.GetStreamingSequenceReportRequest) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.GetStreamingSequenceReportRequest) + private static final com.google.showcase.v1beta1.GetStreamingSequenceReportRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.GetStreamingSequenceReportRequest(); + } + + public static com.google.showcase.v1beta1.GetStreamingSequenceReportRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GetStreamingSequenceReportRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new GetStreamingSequenceReportRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.showcase.v1beta1.GetStreamingSequenceReportRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/GetStreamingSequenceReportRequestOrBuilder.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/GetStreamingSequenceReportRequestOrBuilder.java new file mode 100644 index 0000000000..2f436b93a7 --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/GetStreamingSequenceReportRequestOrBuilder.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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/sequence.proto + +package com.google.showcase.v1beta1; + +public interface GetStreamingSequenceReportRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.GetStreamingSequenceReportRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + + /** + * + * 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-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/GetUserRequest.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/GetUserRequest.java new file mode 100644 index 0000000000..0ffccfa9ce --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/GetUserRequest.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: schema/google/showcase/v1beta1/identity.proto + +package com.google.showcase.v1beta1; + +/** + * + * + *
        + * The request message for the google.showcase.v1beta1.Identity\GetUser
        + * method.
        + * 
        + * + * Protobuf type {@code google.showcase.v1beta1.GetUserRequest} + */ +public final class GetUserRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.GetUserRequest) + GetUserRequestOrBuilder { + private static final long serialVersionUID = 0L; + + // Use GetUserRequest.newBuilder() to construct. + private GetUserRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private GetUserRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new GetUserRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private GetUserRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.IdentityOuterClass + .internal_static_google_showcase_v1beta1_GetUserRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.IdentityOuterClass + .internal_static_google_showcase_v1beta1_GetUserRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.GetUserRequest.class, + com.google.showcase.v1beta1.GetUserRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + + /** + * + * + *
        +   * The resource name of the requested user.
        +   * 
        + * + * + * 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; + } + } + + /** + * + * + *
        +   * The resource name of the requested user.
        +   * 
        + * + * + * 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_); + } + unknownFields.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 += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.showcase.v1beta1.GetUserRequest)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.GetUserRequest other = + (com.google.showcase.v1beta1.GetUserRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.showcase.v1beta1.GetUserRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.GetUserRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.GetUserRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.GetUserRequest 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.showcase.v1beta1.GetUserRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.GetUserRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.GetUserRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.GetUserRequest 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.showcase.v1beta1.GetUserRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.GetUserRequest 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.showcase.v1beta1.GetUserRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.GetUserRequest 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.showcase.v1beta1.GetUserRequest 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 request message for the google.showcase.v1beta1.Identity\GetUser
        +   * method.
        +   * 
        + * + * Protobuf type {@code google.showcase.v1beta1.GetUserRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.GetUserRequest) + com.google.showcase.v1beta1.GetUserRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.IdentityOuterClass + .internal_static_google_showcase_v1beta1_GetUserRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.IdentityOuterClass + .internal_static_google_showcase_v1beta1_GetUserRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.GetUserRequest.class, + com.google.showcase.v1beta1.GetUserRequest.Builder.class); + } + + // Construct using com.google.showcase.v1beta1.GetUserRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.showcase.v1beta1.IdentityOuterClass + .internal_static_google_showcase_v1beta1_GetUserRequest_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.GetUserRequest getDefaultInstanceForType() { + return com.google.showcase.v1beta1.GetUserRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.GetUserRequest build() { + com.google.showcase.v1beta1.GetUserRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.GetUserRequest buildPartial() { + com.google.showcase.v1beta1.GetUserRequest result = + new com.google.showcase.v1beta1.GetUserRequest(this); + result.name_ = name_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.showcase.v1beta1.GetUserRequest) { + return mergeFrom((com.google.showcase.v1beta1.GetUserRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.showcase.v1beta1.GetUserRequest other) { + if (other == com.google.showcase.v1beta1.GetUserRequest.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.showcase.v1beta1.GetUserRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.showcase.v1beta1.GetUserRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + + /** + * + * + *
        +     * The resource name of the requested user.
        +     * 
        + * + * + * 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; + } + } + + /** + * + * + *
        +     * The resource name of the requested user.
        +     * 
        + * + * + * 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; + } + } + + /** + * + * + *
        +     * The resource name of the requested user.
        +     * 
        + * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + + /** + * + * + *
        +     * The resource name of the requested user.
        +     * 
        + * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + + /** + * + * + *
        +     * The resource name of the requested user.
        +     * 
        + * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.showcase.v1beta1.GetUserRequest) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.GetUserRequest) + private static final com.google.showcase.v1beta1.GetUserRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.GetUserRequest(); + } + + public static com.google.showcase.v1beta1.GetUserRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GetUserRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new GetUserRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.showcase.v1beta1.GetUserRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/GetUserRequestOrBuilder.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/GetUserRequestOrBuilder.java new file mode 100644 index 0000000000..7555bcc95e --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/GetUserRequestOrBuilder.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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/identity.proto + +package com.google.showcase.v1beta1; + +public interface GetUserRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.GetUserRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
        +   * The resource name of the requested user.
        +   * 
        + * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + + /** + * + * + *
        +   * The resource name of the requested user.
        +   * 
        + * + * + * 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-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/IdentityOuterClass.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/IdentityOuterClass.java new file mode 100644 index 0000000000..77da312fd8 --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/IdentityOuterClass.java @@ -0,0 +1,226 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/identity.proto + +package com.google.showcase.v1beta1; + +public final class IdentityOuterClass { + private IdentityOuterClass() {} + + 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_showcase_v1beta1_User_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_showcase_v1beta1_User_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_showcase_v1beta1_CreateUserRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_showcase_v1beta1_CreateUserRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_showcase_v1beta1_GetUserRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_showcase_v1beta1_GetUserRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_showcase_v1beta1_UpdateUserRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_showcase_v1beta1_UpdateUserRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_showcase_v1beta1_DeleteUserRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_showcase_v1beta1_DeleteUserRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_showcase_v1beta1_ListUsersRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_showcase_v1beta1_ListUsersRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_showcase_v1beta1_ListUsersResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_showcase_v1beta1_ListUsersResponse_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" + + "-schema/google/showcase/v1beta1/identit" + + "y.proto\022\027google.showcase.v1beta1\032\034google" + + "/api/annotations.proto\032\027google/api/clien" + + "t.proto\032\037google/api/field_behavior.proto" + + "\032\031google/api/resource.proto\032\033google/protobuf/empty.proto\032" + + " google/protobuf/field_mask.proto\032\037google/protobuf/timestamp.proto\"\204\003\n" + + "\004User\022\014\n" + + "\004name\030\001 \001(\t\022\031\n" + + "\014display_name\030\002 \001(\tB\003\340A\002\022\022\n" + + "\005email\030\003 \001(\tB\003\340A\002\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\020\n" + + "\003age\030\006 \001(\005H\000\210\001\001\022\030\n" + + "\013height_feet\030\007 \001(\001H\001\210\001\001\022\025\n" + + "\010nickname\030\010 \001(\tH\002\210\001\001\022!\n" + + "\024enable_notifications\030\t \001(\010H\003\210\001\001:/\352A,\n" + + "\034showcase.googleapis.com/User\022\014users/{user}B\006\n" + + "\004_ageB\016\n" + + "\014_height_feetB\013\n" + + "\t_nicknameB\027\n" + + "\025_enable_notifications\"@\n" + + "\021CreateUserRequest\022+\n" + + "\004user\030\001 \001(\0132\035.google.showcase.v1beta1.User\"D\n" + + "\016GetUserRequest\0222\n" + + "\004name\030\001 \001(\tB$\372A\036\n" + + "\034showcase.googleapis.com/User\340A\002\"q\n" + + "\021UpdateUserRequest\022+\n" + + "\004user\030\001 \001(\0132\035.google.showcase.v1beta1.User\022/\n" + + "\013update_mask\030\002 \001(\0132\032.google.protobuf.FieldMask\"G\n" + + "\021DeleteUserRequest\0222\n" + + "\004name\030\001 \001(\tB$\372A\036\n" + + "\034showcase.googleapis.com/User\340A\002\"9\n" + + "\020ListUsersRequest\022\021\n" + + "\tpage_size\030\001 \001(\005\022\022\n" + + "\n" + + "page_token\030\002 \001(\t\"Z\n" + + "\021ListUsersResponse\022,\n" + + "\005users\030\001 \003(\0132\035.google.showcase.v1beta1.User\022\027\n" + + "\017next_page_token\030\002 \001(\t2\212\006\n" + + "\010Identity\022\363\001\n\n" + + "CreateUser\022*.google.showcase.v1beta1.CreateUserRequest\032\035.google.showcase." + + "v1beta1.User\"\231\001\202\323\344\223\002\023\"\016/v1beta1/users:\001*" + + "\332A\034user.display_name,user.email\332A^user.d" + + "isplay_name,user.email,user.age,user.nic" + + "kname,user.enable_notifications,user.height_feet\022y\n" + + "\007GetUser\022\'.google.showcase.v1beta1.GetUserRequest\032\035.google.showcase.v" + + "1beta1.User\"&\202\323\344\223\002\031\022\027/v1beta1/{name=users/*}\332A\004name\022\203\001\n\n" + + "UpdateUser\022*.google.showcase.v1beta1.UpdateUserRequest\032\035.google." + + "showcase.v1beta1.User\"*\202\323\344\223\002$2\034/v1beta1/{user.name=users/*}:\004user\022x\n\n" + + "DeleteUser\022*.google.showcase.v1beta1.DeleteUserRequ" + + "est\032\026.google.protobuf.Empty\"&\202\323\344\223\002\031*\027/v1beta1/{name=users/*}\332A\004name\022z\n" + + "\tListUsers\022).google.showcase.v1beta1.ListUsersRequ" + + "est\032*.google.showcase.v1beta1.ListUsersR" + + "esponse\"\026\202\323\344\223\002\020\022\016/v1beta1/users\032\021\312A\016localhost:7469Bq\n" + + "\033com.google.showcase.v1beta1P\001Z4github.com/googleapis/gapic-showcas" + + "e/server/genproto\352\002\031Google::Showcase::V1beta1b\006proto3" + }; + descriptor = + com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( + descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + com.google.api.AnnotationsProto.getDescriptor(), + com.google.api.ClientProto.getDescriptor(), + com.google.api.FieldBehaviorProto.getDescriptor(), + com.google.api.ResourceProto.getDescriptor(), + com.google.protobuf.EmptyProto.getDescriptor(), + com.google.protobuf.FieldMaskProto.getDescriptor(), + com.google.protobuf.TimestampProto.getDescriptor(), + }); + internal_static_google_showcase_v1beta1_User_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_showcase_v1beta1_User_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_showcase_v1beta1_User_descriptor, + new java.lang.String[] { + "Name", + "DisplayName", + "Email", + "CreateTime", + "UpdateTime", + "Age", + "HeightFeet", + "Nickname", + "EnableNotifications", + "Age", + "HeightFeet", + "Nickname", + "EnableNotifications", + }); + internal_static_google_showcase_v1beta1_CreateUserRequest_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_google_showcase_v1beta1_CreateUserRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_showcase_v1beta1_CreateUserRequest_descriptor, + new java.lang.String[] { + "User", + }); + internal_static_google_showcase_v1beta1_GetUserRequest_descriptor = + getDescriptor().getMessageTypes().get(2); + internal_static_google_showcase_v1beta1_GetUserRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_showcase_v1beta1_GetUserRequest_descriptor, + new java.lang.String[] { + "Name", + }); + internal_static_google_showcase_v1beta1_UpdateUserRequest_descriptor = + getDescriptor().getMessageTypes().get(3); + internal_static_google_showcase_v1beta1_UpdateUserRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_showcase_v1beta1_UpdateUserRequest_descriptor, + new java.lang.String[] { + "User", "UpdateMask", + }); + internal_static_google_showcase_v1beta1_DeleteUserRequest_descriptor = + getDescriptor().getMessageTypes().get(4); + internal_static_google_showcase_v1beta1_DeleteUserRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_showcase_v1beta1_DeleteUserRequest_descriptor, + new java.lang.String[] { + "Name", + }); + internal_static_google_showcase_v1beta1_ListUsersRequest_descriptor = + getDescriptor().getMessageTypes().get(5); + internal_static_google_showcase_v1beta1_ListUsersRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_showcase_v1beta1_ListUsersRequest_descriptor, + new java.lang.String[] { + "PageSize", "PageToken", + }); + internal_static_google_showcase_v1beta1_ListUsersResponse_descriptor = + getDescriptor().getMessageTypes().get(6); + internal_static_google_showcase_v1beta1_ListUsersResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_showcase_v1beta1_ListUsersResponse_descriptor, + new java.lang.String[] { + "Users", "NextPageToken", + }); + 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.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.FieldBehaviorProto.getDescriptor(); + com.google.api.ResourceProto.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-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/Issue.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/Issue.java new file mode 100644 index 0000000000..1e4f2a52db --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/Issue.java @@ -0,0 +1,1267 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/testing.proto + +package com.google.showcase.v1beta1; + +/** + * + * + *
        + * An issue found in the test.
        + * 
        + * + * Protobuf type {@code google.showcase.v1beta1.Issue} + */ +public final class Issue extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.Issue) + IssueOrBuilder { + private static final long serialVersionUID = 0L; + + // Use Issue.newBuilder() to construct. + private Issue(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Issue() { + type_ = 0; + severity_ = 0; + description_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Issue(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private Issue( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: + { + int rawValue = input.readEnum(); + + type_ = rawValue; + break; + } + case 16: + { + int rawValue = input.readEnum(); + + severity_ = rawValue; + break; + } + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + + description_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.TestingOuterClass + .internal_static_google_showcase_v1beta1_Issue_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.TestingOuterClass + .internal_static_google_showcase_v1beta1_Issue_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.Issue.class, + com.google.showcase.v1beta1.Issue.Builder.class); + } + + /** + * + * + *
        +   * The different potential types of issues.
        +   * 
        + * + * Protobuf enum {@code google.showcase.v1beta1.Issue.Type} + */ + public enum Type implements com.google.protobuf.ProtocolMessageEnum { + /** TYPE_UNSPECIFIED = 0; */ + TYPE_UNSPECIFIED(0), + /** + * + * + *
        +     * The test was never instrumented.
        +     * 
        + * + * SKIPPED = 1; + */ + SKIPPED(1), + /** + * + * + *
        +     * The test was started but never confirmed.
        +     * 
        + * + * PENDING = 2; + */ + PENDING(2), + /** + * + * + *
        +     * The test was instrumented, but Showcase got an unexpected
        +     * value when the generator tried to confirm success.
        +     * 
        + * + * INCORRECT_CONFIRMATION = 3; + */ + INCORRECT_CONFIRMATION(3), + UNRECOGNIZED(-1), + ; + + /** TYPE_UNSPECIFIED = 0; */ + public static final int TYPE_UNSPECIFIED_VALUE = 0; + + /** + * + * + *
        +     * The test was never instrumented.
        +     * 
        + * + * SKIPPED = 1; + */ + public static final int SKIPPED_VALUE = 1; + + /** + * + * + *
        +     * The test was started but never confirmed.
        +     * 
        + * + * PENDING = 2; + */ + public static final int PENDING_VALUE = 2; + + /** + * + * + *
        +     * The test was instrumented, but Showcase got an unexpected
        +     * value when the generator tried to confirm success.
        +     * 
        + * + * INCORRECT_CONFIRMATION = 3; + */ + public static final int INCORRECT_CONFIRMATION_VALUE = 3; + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static Type valueOf(int value) { + return forNumber(value); + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + */ + public static Type forNumber(int value) { + switch (value) { + case 0: + return TYPE_UNSPECIFIED; + case 1: + return SKIPPED; + case 2: + return PENDING; + case 3: + return INCORRECT_CONFIRMATION; + default: + return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap internalGetValueMap() { + return internalValueMap; + } + + private static final com.google.protobuf.Internal.EnumLiteMap internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public Type findValueByNumber(int number) { + return Type.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { + 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.showcase.v1beta1.Issue.getDescriptor().getEnumTypes().get(0); + } + + private static final Type[] VALUES = values(); + + public static Type valueOf(com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException("EnumValueDescriptor is not for this type."); + } + if (desc.getIndex() == -1) { + return UNRECOGNIZED; + } + return VALUES[desc.getIndex()]; + } + + private final int value; + + private Type(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.showcase.v1beta1.Issue.Type) + } + + /** + * + * + *
        +   * Severity levels.
        +   * 
        + * + * Protobuf enum {@code google.showcase.v1beta1.Issue.Severity} + */ + public enum Severity implements com.google.protobuf.ProtocolMessageEnum { + /** SEVERITY_UNSPECIFIED = 0; */ + SEVERITY_UNSPECIFIED(0), + /** + * + * + *
        +     * Errors.
        +     * 
        + * + * ERROR = 1; + */ + ERROR(1), + /** + * + * + *
        +     * Warnings.
        +     * 
        + * + * WARNING = 2; + */ + WARNING(2), + UNRECOGNIZED(-1), + ; + + /** SEVERITY_UNSPECIFIED = 0; */ + public static final int SEVERITY_UNSPECIFIED_VALUE = 0; + + /** + * + * + *
        +     * Errors.
        +     * 
        + * + * ERROR = 1; + */ + public static final int ERROR_VALUE = 1; + + /** + * + * + *
        +     * Warnings.
        +     * 
        + * + * WARNING = 2; + */ + public static final int WARNING_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 Severity 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 Severity forNumber(int value) { + switch (value) { + case 0: + return SEVERITY_UNSPECIFIED; + case 1: + return ERROR; + case 2: + return WARNING; + 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 Severity findValueByNumber(int number) { + return Severity.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.showcase.v1beta1.Issue.getDescriptor().getEnumTypes().get(1); + } + + private static final Severity[] VALUES = values(); + + public static Severity 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 Severity(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.showcase.v1beta1.Issue.Severity) + } + + public static final int TYPE_FIELD_NUMBER = 1; + private int type_; + + /** + * + * + *
        +   * The type of the issue.
        +   * 
        + * + * .google.showcase.v1beta1.Issue.Type type = 1; + * + * @return The enum numeric value on the wire for type. + */ + @java.lang.Override + public int getTypeValue() { + return type_; + } + + /** + * + * + *
        +   * The type of the issue.
        +   * 
        + * + * .google.showcase.v1beta1.Issue.Type type = 1; + * + * @return The type. + */ + @java.lang.Override + public com.google.showcase.v1beta1.Issue.Type getType() { + @SuppressWarnings("deprecation") + com.google.showcase.v1beta1.Issue.Type result = + com.google.showcase.v1beta1.Issue.Type.valueOf(type_); + return result == null ? com.google.showcase.v1beta1.Issue.Type.UNRECOGNIZED : result; + } + + public static final int SEVERITY_FIELD_NUMBER = 2; + private int severity_; + + /** + * + * + *
        +   * The severity of the issue.
        +   * 
        + * + * .google.showcase.v1beta1.Issue.Severity severity = 2; + * + * @return The enum numeric value on the wire for severity. + */ + @java.lang.Override + public int getSeverityValue() { + return severity_; + } + + /** + * + * + *
        +   * The severity of the issue.
        +   * 
        + * + * .google.showcase.v1beta1.Issue.Severity severity = 2; + * + * @return The severity. + */ + @java.lang.Override + public com.google.showcase.v1beta1.Issue.Severity getSeverity() { + @SuppressWarnings("deprecation") + com.google.showcase.v1beta1.Issue.Severity result = + com.google.showcase.v1beta1.Issue.Severity.valueOf(severity_); + return result == null ? com.google.showcase.v1beta1.Issue.Severity.UNRECOGNIZED : result; + } + + public static final int DESCRIPTION_FIELD_NUMBER = 3; + private volatile java.lang.Object description_; + + /** + * + * + *
        +   * A description of the issue.
        +   * 
        + * + * 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; + } + } + + /** + * + * + *
        +   * A description of the issue.
        +   * 
        + * + * string description = 3; + * + * @return The bytes for description. + */ + @java.lang.Override + public com.google.protobuf.ByteString getDescriptionBytes() { + java.lang.Object ref = description_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + description_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (type_ != com.google.showcase.v1beta1.Issue.Type.TYPE_UNSPECIFIED.getNumber()) { + output.writeEnum(1, type_); + } + if (severity_ != com.google.showcase.v1beta1.Issue.Severity.SEVERITY_UNSPECIFIED.getNumber()) { + output.writeEnum(2, severity_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(description_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, description_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (type_ != com.google.showcase.v1beta1.Issue.Type.TYPE_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(1, type_); + } + if (severity_ != com.google.showcase.v1beta1.Issue.Severity.SEVERITY_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(2, severity_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(description_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, description_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.showcase.v1beta1.Issue)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.Issue other = (com.google.showcase.v1beta1.Issue) obj; + + if (type_ != other.type_) return false; + if (severity_ != other.severity_) return false; + if (!getDescription().equals(other.getDescription())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + TYPE_FIELD_NUMBER; + hash = (53 * hash) + type_; + hash = (37 * hash) + SEVERITY_FIELD_NUMBER; + hash = (53 * hash) + severity_; + hash = (37 * hash) + DESCRIPTION_FIELD_NUMBER; + hash = (53 * hash) + getDescription().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.showcase.v1beta1.Issue parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.Issue parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.Issue parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.Issue 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.showcase.v1beta1.Issue parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.Issue parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.Issue parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.Issue 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.showcase.v1beta1.Issue parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.Issue 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.showcase.v1beta1.Issue parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.Issue 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.showcase.v1beta1.Issue 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 issue found in the test.
        +   * 
        + * + * Protobuf type {@code google.showcase.v1beta1.Issue} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.Issue) + com.google.showcase.v1beta1.IssueOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.TestingOuterClass + .internal_static_google_showcase_v1beta1_Issue_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.TestingOuterClass + .internal_static_google_showcase_v1beta1_Issue_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.Issue.class, + com.google.showcase.v1beta1.Issue.Builder.class); + } + + // Construct using com.google.showcase.v1beta1.Issue.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + type_ = 0; + + severity_ = 0; + + description_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.showcase.v1beta1.TestingOuterClass + .internal_static_google_showcase_v1beta1_Issue_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.Issue getDefaultInstanceForType() { + return com.google.showcase.v1beta1.Issue.getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.Issue build() { + com.google.showcase.v1beta1.Issue result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.Issue buildPartial() { + com.google.showcase.v1beta1.Issue result = new com.google.showcase.v1beta1.Issue(this); + result.type_ = type_; + result.severity_ = severity_; + result.description_ = description_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.showcase.v1beta1.Issue) { + return mergeFrom((com.google.showcase.v1beta1.Issue) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.showcase.v1beta1.Issue other) { + if (other == com.google.showcase.v1beta1.Issue.getDefaultInstance()) return this; + if (other.type_ != 0) { + setTypeValue(other.getTypeValue()); + } + if (other.severity_ != 0) { + setSeverityValue(other.getSeverityValue()); + } + if (!other.getDescription().isEmpty()) { + description_ = other.description_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.showcase.v1beta1.Issue parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.showcase.v1beta1.Issue) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int type_ = 0; + + /** + * + * + *
        +     * The type of the issue.
        +     * 
        + * + * .google.showcase.v1beta1.Issue.Type type = 1; + * + * @return The enum numeric value on the wire for type. + */ + @java.lang.Override + public int getTypeValue() { + return type_; + } + + /** + * + * + *
        +     * The type of the issue.
        +     * 
        + * + * .google.showcase.v1beta1.Issue.Type type = 1; + * + * @param value The enum numeric value on the wire for type to set. + * @return This builder for chaining. + */ + public Builder setTypeValue(int value) { + + type_ = value; + onChanged(); + return this; + } + + /** + * + * + *
        +     * The type of the issue.
        +     * 
        + * + * .google.showcase.v1beta1.Issue.Type type = 1; + * + * @return The type. + */ + @java.lang.Override + public com.google.showcase.v1beta1.Issue.Type getType() { + @SuppressWarnings("deprecation") + com.google.showcase.v1beta1.Issue.Type result = + com.google.showcase.v1beta1.Issue.Type.valueOf(type_); + return result == null ? com.google.showcase.v1beta1.Issue.Type.UNRECOGNIZED : result; + } + + /** + * + * + *
        +     * The type of the issue.
        +     * 
        + * + * .google.showcase.v1beta1.Issue.Type type = 1; + * + * @param value The type to set. + * @return This builder for chaining. + */ + public Builder setType(com.google.showcase.v1beta1.Issue.Type value) { + if (value == null) { + throw new NullPointerException(); + } + + type_ = value.getNumber(); + onChanged(); + return this; + } + + /** + * + * + *
        +     * The type of the issue.
        +     * 
        + * + * .google.showcase.v1beta1.Issue.Type type = 1; + * + * @return This builder for chaining. + */ + public Builder clearType() { + + type_ = 0; + onChanged(); + return this; + } + + private int severity_ = 0; + + /** + * + * + *
        +     * The severity of the issue.
        +     * 
        + * + * .google.showcase.v1beta1.Issue.Severity severity = 2; + * + * @return The enum numeric value on the wire for severity. + */ + @java.lang.Override + public int getSeverityValue() { + return severity_; + } + + /** + * + * + *
        +     * The severity of the issue.
        +     * 
        + * + * .google.showcase.v1beta1.Issue.Severity severity = 2; + * + * @param value The enum numeric value on the wire for severity to set. + * @return This builder for chaining. + */ + public Builder setSeverityValue(int value) { + + severity_ = value; + onChanged(); + return this; + } + + /** + * + * + *
        +     * The severity of the issue.
        +     * 
        + * + * .google.showcase.v1beta1.Issue.Severity severity = 2; + * + * @return The severity. + */ + @java.lang.Override + public com.google.showcase.v1beta1.Issue.Severity getSeverity() { + @SuppressWarnings("deprecation") + com.google.showcase.v1beta1.Issue.Severity result = + com.google.showcase.v1beta1.Issue.Severity.valueOf(severity_); + return result == null ? com.google.showcase.v1beta1.Issue.Severity.UNRECOGNIZED : result; + } + + /** + * + * + *
        +     * The severity of the issue.
        +     * 
        + * + * .google.showcase.v1beta1.Issue.Severity severity = 2; + * + * @param value The severity to set. + * @return This builder for chaining. + */ + public Builder setSeverity(com.google.showcase.v1beta1.Issue.Severity value) { + if (value == null) { + throw new NullPointerException(); + } + + severity_ = value.getNumber(); + onChanged(); + return this; + } + + /** + * + * + *
        +     * The severity of the issue.
        +     * 
        + * + * .google.showcase.v1beta1.Issue.Severity severity = 2; + * + * @return This builder for chaining. + */ + public Builder clearSeverity() { + + severity_ = 0; + onChanged(); + return this; + } + + private java.lang.Object description_ = ""; + + /** + * + * + *
        +     * A description of the issue.
        +     * 
        + * + * 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; + } + } + + /** + * + * + *
        +     * A description of the issue.
        +     * 
        + * + * 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; + } + } + + /** + * + * + *
        +     * A description of the issue.
        +     * 
        + * + * string description = 3; + * + * @param value The description to set. + * @return This builder for chaining. + */ + public Builder setDescription(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + description_ = value; + onChanged(); + return this; + } + + /** + * + * + *
        +     * A description of the issue.
        +     * 
        + * + * string description = 3; + * + * @return This builder for chaining. + */ + public Builder clearDescription() { + + description_ = getDefaultInstance().getDescription(); + onChanged(); + return this; + } + + /** + * + * + *
        +     * A description of the issue.
        +     * 
        + * + * string description = 3; + * + * @param value The bytes for description to set. + * @return This builder for chaining. + */ + public Builder setDescriptionBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + description_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.showcase.v1beta1.Issue) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.Issue) + private static final com.google.showcase.v1beta1.Issue DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.Issue(); + } + + public static com.google.showcase.v1beta1.Issue getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Issue parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Issue(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.showcase.v1beta1.Issue getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/IssueOrBuilder.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/IssueOrBuilder.java new file mode 100644 index 0000000000..ca34257b92 --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/IssueOrBuilder.java @@ -0,0 +1,103 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/testing.proto + +package com.google.showcase.v1beta1; + +public interface IssueOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.Issue) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
        +   * The type of the issue.
        +   * 
        + * + * .google.showcase.v1beta1.Issue.Type type = 1; + * + * @return The enum numeric value on the wire for type. + */ + int getTypeValue(); + + /** + * + * + *
        +   * The type of the issue.
        +   * 
        + * + * .google.showcase.v1beta1.Issue.Type type = 1; + * + * @return The type. + */ + com.google.showcase.v1beta1.Issue.Type getType(); + + /** + * + * + *
        +   * The severity of the issue.
        +   * 
        + * + * .google.showcase.v1beta1.Issue.Severity severity = 2; + * + * @return The enum numeric value on the wire for severity. + */ + int getSeverityValue(); + + /** + * + * + *
        +   * The severity of the issue.
        +   * 
        + * + * .google.showcase.v1beta1.Issue.Severity severity = 2; + * + * @return The severity. + */ + com.google.showcase.v1beta1.Issue.Severity getSeverity(); + + /** + * + * + *
        +   * A description of the issue.
        +   * 
        + * + * string description = 3; + * + * @return The description. + */ + java.lang.String getDescription(); + + /** + * + * + *
        +   * A description of the issue.
        +   * 
        + * + * string description = 3; + * + * @return The bytes for description. + */ + com.google.protobuf.ByteString getDescriptionBytes(); +} diff --git a/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListBlurbsRequest.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListBlurbsRequest.java new file mode 100644 index 0000000000..431e4fdbbe --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListBlurbsRequest.java @@ -0,0 +1,963 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/messaging.proto + +package com.google.showcase.v1beta1; + +/** + * + * + *
        + * The request message for the google.showcase.v1beta1.Messaging\ListBlurbs
        + * method.
        + * 
        + * + * Protobuf type {@code google.showcase.v1beta1.ListBlurbsRequest} + */ +public final class ListBlurbsRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.ListBlurbsRequest) + ListBlurbsRequestOrBuilder { + private static final long serialVersionUID = 0L; + + // Use ListBlurbsRequest.newBuilder() to construct. + private ListBlurbsRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListBlurbsRequest() { + parent_ = ""; + pageToken_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListBlurbsRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ListBlurbsRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + parent_ = s; + break; + } + case 16: + { + pageSize_ = input.readInt32(); + break; + } + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + + pageToken_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.MessagingOuterClass + .internal_static_google_showcase_v1beta1_ListBlurbsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.MessagingOuterClass + .internal_static_google_showcase_v1beta1_ListBlurbsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.ListBlurbsRequest.class, + com.google.showcase.v1beta1.ListBlurbsRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + private volatile java.lang.Object parent_; + + /** + * + * + *
        +   * The resource name of the requested room or profile who blurbs to list.
        +   * 
        + * + * + * 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; + } + } + + /** + * + * + *
        +   * The resource name of the requested room or profile who blurbs to list.
        +   * 
        + * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + @java.lang.Override + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PAGE_SIZE_FIELD_NUMBER = 2; + private int pageSize_; + + /** + * + * + *
        +   * The maximum number of blurbs to return. Server may return fewer
        +   * blurbs than requested. If unspecified, server will pick an appropriate
        +   * default.
        +   * 
        + * + * int32 page_size = 2; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + + public static final int PAGE_TOKEN_FIELD_NUMBER = 3; + private volatile java.lang.Object pageToken_; + + /** + * + * + *
        +   * The value of google.showcase.v1beta1.ListBlurbsResponse.next_page_token
        +   * returned from the previous call to
        +   * `google.showcase.v1beta1.Messaging\ListBlurbs` method.
        +   * 
        + * + * string page_token = 3; + * + * @return The pageToken. + */ + @java.lang.Override + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; + } + } + + /** + * + * + *
        +   * The value of google.showcase.v1beta1.ListBlurbsResponse.next_page_token
        +   * returned from the previous call to
        +   * `google.showcase.v1beta1.Messaging\ListBlurbs` method.
        +   * 
        + * + * string page_token = 3; + * + * @return The bytes for pageToken. + */ + @java.lang.Override + public com.google.protobuf.ByteString getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!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_); + } + unknownFields.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_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.showcase.v1beta1.ListBlurbsRequest)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.ListBlurbsRequest other = + (com.google.showcase.v1beta1.ListBlurbsRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (getPageSize() != other.getPageSize()) return false; + if (!getPageToken().equals(other.getPageToken())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + PARENT_FIELD_NUMBER; + hash = (53 * hash) + getParent().hashCode(); + hash = (37 * hash) + PAGE_SIZE_FIELD_NUMBER; + hash = (53 * hash) + getPageSize(); + hash = (37 * hash) + PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getPageToken().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.showcase.v1beta1.ListBlurbsRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.ListBlurbsRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.ListBlurbsRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.ListBlurbsRequest 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.showcase.v1beta1.ListBlurbsRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.ListBlurbsRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.ListBlurbsRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.ListBlurbsRequest 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.showcase.v1beta1.ListBlurbsRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.ListBlurbsRequest 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.showcase.v1beta1.ListBlurbsRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.ListBlurbsRequest 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.showcase.v1beta1.ListBlurbsRequest 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 request message for the google.showcase.v1beta1.Messaging\ListBlurbs
        +   * method.
        +   * 
        + * + * Protobuf type {@code google.showcase.v1beta1.ListBlurbsRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.ListBlurbsRequest) + com.google.showcase.v1beta1.ListBlurbsRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.MessagingOuterClass + .internal_static_google_showcase_v1beta1_ListBlurbsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.MessagingOuterClass + .internal_static_google_showcase_v1beta1_ListBlurbsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.ListBlurbsRequest.class, + com.google.showcase.v1beta1.ListBlurbsRequest.Builder.class); + } + + // Construct using com.google.showcase.v1beta1.ListBlurbsRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + parent_ = ""; + + pageSize_ = 0; + + pageToken_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.showcase.v1beta1.MessagingOuterClass + .internal_static_google_showcase_v1beta1_ListBlurbsRequest_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.ListBlurbsRequest getDefaultInstanceForType() { + return com.google.showcase.v1beta1.ListBlurbsRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.ListBlurbsRequest build() { + com.google.showcase.v1beta1.ListBlurbsRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.ListBlurbsRequest buildPartial() { + com.google.showcase.v1beta1.ListBlurbsRequest result = + new com.google.showcase.v1beta1.ListBlurbsRequest(this); + result.parent_ = parent_; + result.pageSize_ = pageSize_; + result.pageToken_ = pageToken_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.showcase.v1beta1.ListBlurbsRequest) { + return mergeFrom((com.google.showcase.v1beta1.ListBlurbsRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.showcase.v1beta1.ListBlurbsRequest other) { + if (other == com.google.showcase.v1beta1.ListBlurbsRequest.getDefaultInstance()) return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + onChanged(); + } + if (other.getPageSize() != 0) { + setPageSize(other.getPageSize()); + } + if (!other.getPageToken().isEmpty()) { + pageToken_ = other.pageToken_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.showcase.v1beta1.ListBlurbsRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.showcase.v1beta1.ListBlurbsRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object parent_ = ""; + + /** + * + * + *
        +     * The resource name of the requested room or profile who blurbs to list.
        +     * 
        + * + * + * 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; + } + } + + /** + * + * + *
        +     * The resource name of the requested room or profile who blurbs to list.
        +     * 
        + * + * + * 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; + } + } + + /** + * + * + *
        +     * The resource name of the requested room or profile who blurbs to list.
        +     * 
        + * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The parent to set. + * @return This builder for chaining. + */ + public Builder setParent(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + parent_ = value; + onChanged(); + return this; + } + + /** + * + * + *
        +     * The resource name of the requested room or profile who blurbs to list.
        +     * 
        + * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearParent() { + + parent_ = getDefaultInstance().getParent(); + onChanged(); + return this; + } + + /** + * + * + *
        +     * The resource name of the requested room or profile who blurbs to list.
        +     * 
        + * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for parent to set. + * @return This builder for chaining. + */ + public Builder setParentBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + parent_ = value; + onChanged(); + return this; + } + + private int pageSize_; + + /** + * + * + *
        +     * The maximum number of blurbs to return. Server may return fewer
        +     * blurbs than requested. If unspecified, server will pick an appropriate
        +     * default.
        +     * 
        + * + * int32 page_size = 2; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + + /** + * + * + *
        +     * The maximum number of blurbs to return. Server may return fewer
        +     * blurbs than requested. If unspecified, server will pick an appropriate
        +     * default.
        +     * 
        + * + * int32 page_size = 2; + * + * @param value The pageSize to set. + * @return This builder for chaining. + */ + public Builder setPageSize(int value) { + + pageSize_ = value; + onChanged(); + return this; + } + + /** + * + * + *
        +     * The maximum number of blurbs to return. Server may return fewer
        +     * blurbs than requested. If unspecified, server will pick an appropriate
        +     * default.
        +     * 
        + * + * int32 page_size = 2; + * + * @return This builder for chaining. + */ + public Builder clearPageSize() { + + pageSize_ = 0; + onChanged(); + return this; + } + + private java.lang.Object pageToken_ = ""; + + /** + * + * + *
        +     * The value of google.showcase.v1beta1.ListBlurbsResponse.next_page_token
        +     * returned from the previous call to
        +     * `google.showcase.v1beta1.Messaging\ListBlurbs` method.
        +     * 
        + * + * string page_token = 3; + * + * @return The pageToken. + */ + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
        +     * The value of google.showcase.v1beta1.ListBlurbsResponse.next_page_token
        +     * returned from the previous call to
        +     * `google.showcase.v1beta1.Messaging\ListBlurbs` method.
        +     * 
        + * + * string page_token = 3; + * + * @return The bytes for pageToken. + */ + public com.google.protobuf.ByteString getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
        +     * The value of google.showcase.v1beta1.ListBlurbsResponse.next_page_token
        +     * returned from the previous call to
        +     * `google.showcase.v1beta1.Messaging\ListBlurbs` method.
        +     * 
        + * + * string page_token = 3; + * + * @param value The pageToken to set. + * @return This builder for chaining. + */ + public Builder setPageToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + pageToken_ = value; + onChanged(); + return this; + } + + /** + * + * + *
        +     * The value of google.showcase.v1beta1.ListBlurbsResponse.next_page_token
        +     * returned from the previous call to
        +     * `google.showcase.v1beta1.Messaging\ListBlurbs` method.
        +     * 
        + * + * string page_token = 3; + * + * @return This builder for chaining. + */ + public Builder clearPageToken() { + + pageToken_ = getDefaultInstance().getPageToken(); + onChanged(); + return this; + } + + /** + * + * + *
        +     * The value of google.showcase.v1beta1.ListBlurbsResponse.next_page_token
        +     * returned from the previous call to
        +     * `google.showcase.v1beta1.Messaging\ListBlurbs` method.
        +     * 
        + * + * string page_token = 3; + * + * @param value The bytes for pageToken to set. + * @return This builder for chaining. + */ + public Builder setPageTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + pageToken_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.showcase.v1beta1.ListBlurbsRequest) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.ListBlurbsRequest) + private static final com.google.showcase.v1beta1.ListBlurbsRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.ListBlurbsRequest(); + } + + public static com.google.showcase.v1beta1.ListBlurbsRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListBlurbsRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ListBlurbsRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.showcase.v1beta1.ListBlurbsRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListBlurbsRequestOrBuilder.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListBlurbsRequestOrBuilder.java new file mode 100644 index 0000000000..609bdee635 --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListBlurbsRequestOrBuilder.java @@ -0,0 +1,100 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/messaging.proto + +package com.google.showcase.v1beta1; + +public interface ListBlurbsRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.ListBlurbsRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
        +   * The resource name of the requested room or profile who blurbs to list.
        +   * 
        + * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + + /** + * + * + *
        +   * The resource name of the requested room or profile who blurbs to list.
        +   * 
        + * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
        +   * The maximum number of blurbs to return. Server may return fewer
        +   * blurbs than requested. If unspecified, server will pick an appropriate
        +   * default.
        +   * 
        + * + * int32 page_size = 2; + * + * @return The pageSize. + */ + int getPageSize(); + + /** + * + * + *
        +   * The value of google.showcase.v1beta1.ListBlurbsResponse.next_page_token
        +   * returned from the previous call to
        +   * `google.showcase.v1beta1.Messaging\ListBlurbs` method.
        +   * 
        + * + * string page_token = 3; + * + * @return The pageToken. + */ + java.lang.String getPageToken(); + + /** + * + * + *
        +   * The value of google.showcase.v1beta1.ListBlurbsResponse.next_page_token
        +   * returned from the previous call to
        +   * `google.showcase.v1beta1.Messaging\ListBlurbs` method.
        +   * 
        + * + * string page_token = 3; + * + * @return The bytes for pageToken. + */ + com.google.protobuf.ByteString getPageTokenBytes(); +} diff --git a/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListBlurbsResponse.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListBlurbsResponse.java new file mode 100644 index 0000000000..6efce8118e --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListBlurbsResponse.java @@ -0,0 +1,1178 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/messaging.proto + +package com.google.showcase.v1beta1; + +/** + * + * + *
        + * The response message for the google.showcase.v1beta1.Messaging\ListBlurbs
        + * method.
        + * 
        + * + * Protobuf type {@code google.showcase.v1beta1.ListBlurbsResponse} + */ +public final class ListBlurbsResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.ListBlurbsResponse) + ListBlurbsResponseOrBuilder { + private static final long serialVersionUID = 0L; + + // Use ListBlurbsResponse.newBuilder() to construct. + private ListBlurbsResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListBlurbsResponse() { + blurbs_ = java.util.Collections.emptyList(); + nextPageToken_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListBlurbsResponse(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ListBlurbsResponse( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + blurbs_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + blurbs_.add( + input.readMessage(com.google.showcase.v1beta1.Blurb.parser(), extensionRegistry)); + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + nextPageToken_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + blurbs_ = java.util.Collections.unmodifiableList(blurbs_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.MessagingOuterClass + .internal_static_google_showcase_v1beta1_ListBlurbsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.MessagingOuterClass + .internal_static_google_showcase_v1beta1_ListBlurbsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.ListBlurbsResponse.class, + com.google.showcase.v1beta1.ListBlurbsResponse.Builder.class); + } + + public static final int BLURBS_FIELD_NUMBER = 1; + private java.util.List blurbs_; + + /** + * + * + *
        +   * The list of blurbs.
        +   * 
        + * + * repeated .google.showcase.v1beta1.Blurb blurbs = 1; + */ + @java.lang.Override + public java.util.List getBlurbsList() { + return blurbs_; + } + + /** + * + * + *
        +   * The list of blurbs.
        +   * 
        + * + * repeated .google.showcase.v1beta1.Blurb blurbs = 1; + */ + @java.lang.Override + public java.util.List + getBlurbsOrBuilderList() { + return blurbs_; + } + + /** + * + * + *
        +   * The list of blurbs.
        +   * 
        + * + * repeated .google.showcase.v1beta1.Blurb blurbs = 1; + */ + @java.lang.Override + public int getBlurbsCount() { + return blurbs_.size(); + } + + /** + * + * + *
        +   * The list of blurbs.
        +   * 
        + * + * repeated .google.showcase.v1beta1.Blurb blurbs = 1; + */ + @java.lang.Override + public com.google.showcase.v1beta1.Blurb getBlurbs(int index) { + return blurbs_.get(index); + } + + /** + * + * + *
        +   * The list of blurbs.
        +   * 
        + * + * repeated .google.showcase.v1beta1.Blurb blurbs = 1; + */ + @java.lang.Override + public com.google.showcase.v1beta1.BlurbOrBuilder getBlurbsOrBuilder(int index) { + return blurbs_.get(index); + } + + public static final int NEXT_PAGE_TOKEN_FIELD_NUMBER = 2; + private volatile java.lang.Object nextPageToken_; + + /** + * + * + *
        +   * A token to retrieve next page of results.
        +   * Pass this value in ListBlurbsRequest.page_token field in the subsequent
        +   * call to `google.showcase.v1beta1.Blurb\ListBlurbs` method to retrieve
        +   * the next page of results.
        +   * 
        + * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + @java.lang.Override + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nextPageToken_ = s; + return s; + } + } + + /** + * + * + *
        +   * A token to retrieve next page of results.
        +   * Pass this value in ListBlurbsRequest.page_token field in the subsequent
        +   * call to `google.showcase.v1beta1.Blurb\ListBlurbs` method to retrieve
        +   * the next page of results.
        +   * 
        + * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + nextPageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + for (int i = 0; i < blurbs_.size(); i++) { + output.writeMessage(1, blurbs_.get(i)); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nextPageToken_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, nextPageToken_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < blurbs_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, blurbs_.get(i)); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nextPageToken_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, nextPageToken_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.showcase.v1beta1.ListBlurbsResponse)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.ListBlurbsResponse other = + (com.google.showcase.v1beta1.ListBlurbsResponse) obj; + + if (!getBlurbsList().equals(other.getBlurbsList())) return false; + if (!getNextPageToken().equals(other.getNextPageToken())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getBlurbsCount() > 0) { + hash = (37 * hash) + BLURBS_FIELD_NUMBER; + hash = (53 * hash) + getBlurbsList().hashCode(); + } + hash = (37 * hash) + NEXT_PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getNextPageToken().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.showcase.v1beta1.ListBlurbsResponse parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.ListBlurbsResponse parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.ListBlurbsResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.ListBlurbsResponse 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.showcase.v1beta1.ListBlurbsResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.ListBlurbsResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.ListBlurbsResponse parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.ListBlurbsResponse 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.showcase.v1beta1.ListBlurbsResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.ListBlurbsResponse 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.showcase.v1beta1.ListBlurbsResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.ListBlurbsResponse 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.showcase.v1beta1.ListBlurbsResponse 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 message for the google.showcase.v1beta1.Messaging\ListBlurbs
        +   * method.
        +   * 
        + * + * Protobuf type {@code google.showcase.v1beta1.ListBlurbsResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.ListBlurbsResponse) + com.google.showcase.v1beta1.ListBlurbsResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.MessagingOuterClass + .internal_static_google_showcase_v1beta1_ListBlurbsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.MessagingOuterClass + .internal_static_google_showcase_v1beta1_ListBlurbsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.ListBlurbsResponse.class, + com.google.showcase.v1beta1.ListBlurbsResponse.Builder.class); + } + + // Construct using com.google.showcase.v1beta1.ListBlurbsResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getBlurbsFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (blurbsBuilder_ == null) { + blurbs_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + blurbsBuilder_.clear(); + } + nextPageToken_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.showcase.v1beta1.MessagingOuterClass + .internal_static_google_showcase_v1beta1_ListBlurbsResponse_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.ListBlurbsResponse getDefaultInstanceForType() { + return com.google.showcase.v1beta1.ListBlurbsResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.ListBlurbsResponse build() { + com.google.showcase.v1beta1.ListBlurbsResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.ListBlurbsResponse buildPartial() { + com.google.showcase.v1beta1.ListBlurbsResponse result = + new com.google.showcase.v1beta1.ListBlurbsResponse(this); + int from_bitField0_ = bitField0_; + if (blurbsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + blurbs_ = java.util.Collections.unmodifiableList(blurbs_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.blurbs_ = blurbs_; + } else { + result.blurbs_ = blurbsBuilder_.build(); + } + result.nextPageToken_ = nextPageToken_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.showcase.v1beta1.ListBlurbsResponse) { + return mergeFrom((com.google.showcase.v1beta1.ListBlurbsResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.showcase.v1beta1.ListBlurbsResponse other) { + if (other == com.google.showcase.v1beta1.ListBlurbsResponse.getDefaultInstance()) return this; + if (blurbsBuilder_ == null) { + if (!other.blurbs_.isEmpty()) { + if (blurbs_.isEmpty()) { + blurbs_ = other.blurbs_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureBlurbsIsMutable(); + blurbs_.addAll(other.blurbs_); + } + onChanged(); + } + } else { + if (!other.blurbs_.isEmpty()) { + if (blurbsBuilder_.isEmpty()) { + blurbsBuilder_.dispose(); + blurbsBuilder_ = null; + blurbs_ = other.blurbs_; + bitField0_ = (bitField0_ & ~0x00000001); + blurbsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getBlurbsFieldBuilder() + : null; + } else { + blurbsBuilder_.addAllMessages(other.blurbs_); + } + } + } + if (!other.getNextPageToken().isEmpty()) { + nextPageToken_ = other.nextPageToken_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.showcase.v1beta1.ListBlurbsResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.showcase.v1beta1.ListBlurbsResponse) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.util.List blurbs_ = + java.util.Collections.emptyList(); + + private void ensureBlurbsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + blurbs_ = new java.util.ArrayList(blurbs_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.showcase.v1beta1.Blurb, + com.google.showcase.v1beta1.Blurb.Builder, + com.google.showcase.v1beta1.BlurbOrBuilder> + blurbsBuilder_; + + /** + * + * + *
        +     * The list of blurbs.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Blurb blurbs = 1; + */ + public java.util.List getBlurbsList() { + if (blurbsBuilder_ == null) { + return java.util.Collections.unmodifiableList(blurbs_); + } else { + return blurbsBuilder_.getMessageList(); + } + } + + /** + * + * + *
        +     * The list of blurbs.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Blurb blurbs = 1; + */ + public int getBlurbsCount() { + if (blurbsBuilder_ == null) { + return blurbs_.size(); + } else { + return blurbsBuilder_.getCount(); + } + } + + /** + * + * + *
        +     * The list of blurbs.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Blurb blurbs = 1; + */ + public com.google.showcase.v1beta1.Blurb getBlurbs(int index) { + if (blurbsBuilder_ == null) { + return blurbs_.get(index); + } else { + return blurbsBuilder_.getMessage(index); + } + } + + /** + * + * + *
        +     * The list of blurbs.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Blurb blurbs = 1; + */ + public Builder setBlurbs(int index, com.google.showcase.v1beta1.Blurb value) { + if (blurbsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureBlurbsIsMutable(); + blurbs_.set(index, value); + onChanged(); + } else { + blurbsBuilder_.setMessage(index, value); + } + return this; + } + + /** + * + * + *
        +     * The list of blurbs.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Blurb blurbs = 1; + */ + public Builder setBlurbs(int index, com.google.showcase.v1beta1.Blurb.Builder builderForValue) { + if (blurbsBuilder_ == null) { + ensureBlurbsIsMutable(); + blurbs_.set(index, builderForValue.build()); + onChanged(); + } else { + blurbsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
        +     * The list of blurbs.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Blurb blurbs = 1; + */ + public Builder addBlurbs(com.google.showcase.v1beta1.Blurb value) { + if (blurbsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureBlurbsIsMutable(); + blurbs_.add(value); + onChanged(); + } else { + blurbsBuilder_.addMessage(value); + } + return this; + } + + /** + * + * + *
        +     * The list of blurbs.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Blurb blurbs = 1; + */ + public Builder addBlurbs(int index, com.google.showcase.v1beta1.Blurb value) { + if (blurbsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureBlurbsIsMutable(); + blurbs_.add(index, value); + onChanged(); + } else { + blurbsBuilder_.addMessage(index, value); + } + return this; + } + + /** + * + * + *
        +     * The list of blurbs.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Blurb blurbs = 1; + */ + public Builder addBlurbs(com.google.showcase.v1beta1.Blurb.Builder builderForValue) { + if (blurbsBuilder_ == null) { + ensureBlurbsIsMutable(); + blurbs_.add(builderForValue.build()); + onChanged(); + } else { + blurbsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + + /** + * + * + *
        +     * The list of blurbs.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Blurb blurbs = 1; + */ + public Builder addBlurbs(int index, com.google.showcase.v1beta1.Blurb.Builder builderForValue) { + if (blurbsBuilder_ == null) { + ensureBlurbsIsMutable(); + blurbs_.add(index, builderForValue.build()); + onChanged(); + } else { + blurbsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
        +     * The list of blurbs.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Blurb blurbs = 1; + */ + public Builder addAllBlurbs( + java.lang.Iterable values) { + if (blurbsBuilder_ == null) { + ensureBlurbsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, blurbs_); + onChanged(); + } else { + blurbsBuilder_.addAllMessages(values); + } + return this; + } + + /** + * + * + *
        +     * The list of blurbs.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Blurb blurbs = 1; + */ + public Builder clearBlurbs() { + if (blurbsBuilder_ == null) { + blurbs_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + blurbsBuilder_.clear(); + } + return this; + } + + /** + * + * + *
        +     * The list of blurbs.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Blurb blurbs = 1; + */ + public Builder removeBlurbs(int index) { + if (blurbsBuilder_ == null) { + ensureBlurbsIsMutable(); + blurbs_.remove(index); + onChanged(); + } else { + blurbsBuilder_.remove(index); + } + return this; + } + + /** + * + * + *
        +     * The list of blurbs.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Blurb blurbs = 1; + */ + public com.google.showcase.v1beta1.Blurb.Builder getBlurbsBuilder(int index) { + return getBlurbsFieldBuilder().getBuilder(index); + } + + /** + * + * + *
        +     * The list of blurbs.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Blurb blurbs = 1; + */ + public com.google.showcase.v1beta1.BlurbOrBuilder getBlurbsOrBuilder(int index) { + if (blurbsBuilder_ == null) { + return blurbs_.get(index); + } else { + return blurbsBuilder_.getMessageOrBuilder(index); + } + } + + /** + * + * + *
        +     * The list of blurbs.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Blurb blurbs = 1; + */ + public java.util.List + getBlurbsOrBuilderList() { + if (blurbsBuilder_ != null) { + return blurbsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(blurbs_); + } + } + + /** + * + * + *
        +     * The list of blurbs.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Blurb blurbs = 1; + */ + public com.google.showcase.v1beta1.Blurb.Builder addBlurbsBuilder() { + return getBlurbsFieldBuilder() + .addBuilder(com.google.showcase.v1beta1.Blurb.getDefaultInstance()); + } + + /** + * + * + *
        +     * The list of blurbs.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Blurb blurbs = 1; + */ + public com.google.showcase.v1beta1.Blurb.Builder addBlurbsBuilder(int index) { + return getBlurbsFieldBuilder() + .addBuilder(index, com.google.showcase.v1beta1.Blurb.getDefaultInstance()); + } + + /** + * + * + *
        +     * The list of blurbs.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Blurb blurbs = 1; + */ + public java.util.List getBlurbsBuilderList() { + return getBlurbsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.showcase.v1beta1.Blurb, + com.google.showcase.v1beta1.Blurb.Builder, + com.google.showcase.v1beta1.BlurbOrBuilder> + getBlurbsFieldBuilder() { + if (blurbsBuilder_ == null) { + blurbsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.showcase.v1beta1.Blurb, + com.google.showcase.v1beta1.Blurb.Builder, + com.google.showcase.v1beta1.BlurbOrBuilder>( + blurbs_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + blurbs_ = null; + } + return blurbsBuilder_; + } + + private java.lang.Object nextPageToken_ = ""; + + /** + * + * + *
        +     * A token to retrieve next page of results.
        +     * Pass this value in ListBlurbsRequest.page_token field in the subsequent
        +     * call to `google.showcase.v1beta1.Blurb\ListBlurbs` method to retrieve
        +     * the next page of results.
        +     * 
        + * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nextPageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
        +     * A token to retrieve next page of results.
        +     * Pass this value in ListBlurbsRequest.page_token field in the subsequent
        +     * call to `google.showcase.v1beta1.Blurb\ListBlurbs` method to retrieve
        +     * the next page of results.
        +     * 
        + * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + public com.google.protobuf.ByteString getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + nextPageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
        +     * A token to retrieve next page of results.
        +     * Pass this value in ListBlurbsRequest.page_token field in the subsequent
        +     * call to `google.showcase.v1beta1.Blurb\ListBlurbs` method to retrieve
        +     * the next page of results.
        +     * 
        + * + * string next_page_token = 2; + * + * @param value The nextPageToken to set. + * @return This builder for chaining. + */ + public Builder setNextPageToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + nextPageToken_ = value; + onChanged(); + return this; + } + + /** + * + * + *
        +     * A token to retrieve next page of results.
        +     * Pass this value in ListBlurbsRequest.page_token field in the subsequent
        +     * call to `google.showcase.v1beta1.Blurb\ListBlurbs` method to retrieve
        +     * the next page of results.
        +     * 
        + * + * string next_page_token = 2; + * + * @return This builder for chaining. + */ + public Builder clearNextPageToken() { + + nextPageToken_ = getDefaultInstance().getNextPageToken(); + onChanged(); + return this; + } + + /** + * + * + *
        +     * A token to retrieve next page of results.
        +     * Pass this value in ListBlurbsRequest.page_token field in the subsequent
        +     * call to `google.showcase.v1beta1.Blurb\ListBlurbs` method to retrieve
        +     * the next page of results.
        +     * 
        + * + * string next_page_token = 2; + * + * @param value The bytes for nextPageToken to set. + * @return This builder for chaining. + */ + public Builder setNextPageTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + nextPageToken_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.showcase.v1beta1.ListBlurbsResponse) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.ListBlurbsResponse) + private static final com.google.showcase.v1beta1.ListBlurbsResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.ListBlurbsResponse(); + } + + public static com.google.showcase.v1beta1.ListBlurbsResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListBlurbsResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ListBlurbsResponse(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.showcase.v1beta1.ListBlurbsResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListBlurbsResponseOrBuilder.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListBlurbsResponseOrBuilder.java new file mode 100644 index 0000000000..48fb48aa4d --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListBlurbsResponseOrBuilder.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: schema/google/showcase/v1beta1/messaging.proto + +package com.google.showcase.v1beta1; + +public interface ListBlurbsResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.ListBlurbsResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
        +   * The list of blurbs.
        +   * 
        + * + * repeated .google.showcase.v1beta1.Blurb blurbs = 1; + */ + java.util.List getBlurbsList(); + + /** + * + * + *
        +   * The list of blurbs.
        +   * 
        + * + * repeated .google.showcase.v1beta1.Blurb blurbs = 1; + */ + com.google.showcase.v1beta1.Blurb getBlurbs(int index); + + /** + * + * + *
        +   * The list of blurbs.
        +   * 
        + * + * repeated .google.showcase.v1beta1.Blurb blurbs = 1; + */ + int getBlurbsCount(); + + /** + * + * + *
        +   * The list of blurbs.
        +   * 
        + * + * repeated .google.showcase.v1beta1.Blurb blurbs = 1; + */ + java.util.List getBlurbsOrBuilderList(); + + /** + * + * + *
        +   * The list of blurbs.
        +   * 
        + * + * repeated .google.showcase.v1beta1.Blurb blurbs = 1; + */ + com.google.showcase.v1beta1.BlurbOrBuilder getBlurbsOrBuilder(int index); + + /** + * + * + *
        +   * A token to retrieve next page of results.
        +   * Pass this value in ListBlurbsRequest.page_token field in the subsequent
        +   * call to `google.showcase.v1beta1.Blurb\ListBlurbs` method to retrieve
        +   * the next page of results.
        +   * 
        + * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + java.lang.String getNextPageToken(); + + /** + * + * + *
        +   * A token to retrieve next page of results.
        +   * Pass this value in ListBlurbsRequest.page_token field in the subsequent
        +   * call to `google.showcase.v1beta1.Blurb\ListBlurbs` method to retrieve
        +   * the next page of results.
        +   * 
        + * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + com.google.protobuf.ByteString getNextPageTokenBytes(); +} diff --git a/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListRoomsRequest.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListRoomsRequest.java new file mode 100644 index 0000000000..308d153f79 --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListRoomsRequest.java @@ -0,0 +1,759 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/messaging.proto + +package com.google.showcase.v1beta1; + +/** + * + * + *
        + * The request message for the google.showcase.v1beta1.Messaging\ListRooms
        + * method.
        + * 
        + * + * Protobuf type {@code google.showcase.v1beta1.ListRoomsRequest} + */ +public final class ListRoomsRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.ListRoomsRequest) + ListRoomsRequestOrBuilder { + private static final long serialVersionUID = 0L; + + // Use ListRoomsRequest.newBuilder() to construct. + private ListRoomsRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListRoomsRequest() { + pageToken_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListRoomsRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ListRoomsRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: + { + pageSize_ = input.readInt32(); + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + pageToken_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.MessagingOuterClass + .internal_static_google_showcase_v1beta1_ListRoomsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.MessagingOuterClass + .internal_static_google_showcase_v1beta1_ListRoomsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.ListRoomsRequest.class, + com.google.showcase.v1beta1.ListRoomsRequest.Builder.class); + } + + public static final int PAGE_SIZE_FIELD_NUMBER = 1; + private int pageSize_; + + /** + * + * + *
        +   * The maximum number of rooms return. Server may return fewer rooms
        +   * than requested. If unspecified, server will pick an appropriate default.
        +   * 
        + * + * int32 page_size = 1; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + + public static final int PAGE_TOKEN_FIELD_NUMBER = 2; + private volatile java.lang.Object pageToken_; + + /** + * + * + *
        +   * The value of google.showcase.v1beta1.ListRoomsResponse.next_page_token
        +   * returned from the previous call to
        +   * `google.showcase.v1beta1.Messaging\ListRooms` method.
        +   * 
        + * + * string page_token = 2; + * + * @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; + } + } + + /** + * + * + *
        +   * The value of google.showcase.v1beta1.ListRoomsResponse.next_page_token
        +   * returned from the previous call to
        +   * `google.showcase.v1beta1.Messaging\ListRooms` method.
        +   * 
        + * + * string page_token = 2; + * + * @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_); + } + unknownFields.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 += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.showcase.v1beta1.ListRoomsRequest)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.ListRoomsRequest other = + (com.google.showcase.v1beta1.ListRoomsRequest) obj; + + if (getPageSize() != other.getPageSize()) return false; + if (!getPageToken().equals(other.getPageToken())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + PAGE_SIZE_FIELD_NUMBER; + hash = (53 * hash) + getPageSize(); + hash = (37 * hash) + PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getPageToken().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.showcase.v1beta1.ListRoomsRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.ListRoomsRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.ListRoomsRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.ListRoomsRequest 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.showcase.v1beta1.ListRoomsRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.ListRoomsRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.ListRoomsRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.ListRoomsRequest 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.showcase.v1beta1.ListRoomsRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.ListRoomsRequest 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.showcase.v1beta1.ListRoomsRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.ListRoomsRequest 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.showcase.v1beta1.ListRoomsRequest 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 request message for the google.showcase.v1beta1.Messaging\ListRooms
        +   * method.
        +   * 
        + * + * Protobuf type {@code google.showcase.v1beta1.ListRoomsRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.ListRoomsRequest) + com.google.showcase.v1beta1.ListRoomsRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.MessagingOuterClass + .internal_static_google_showcase_v1beta1_ListRoomsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.MessagingOuterClass + .internal_static_google_showcase_v1beta1_ListRoomsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.ListRoomsRequest.class, + com.google.showcase.v1beta1.ListRoomsRequest.Builder.class); + } + + // Construct using com.google.showcase.v1beta1.ListRoomsRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + pageSize_ = 0; + + pageToken_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.showcase.v1beta1.MessagingOuterClass + .internal_static_google_showcase_v1beta1_ListRoomsRequest_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.ListRoomsRequest getDefaultInstanceForType() { + return com.google.showcase.v1beta1.ListRoomsRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.ListRoomsRequest build() { + com.google.showcase.v1beta1.ListRoomsRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.ListRoomsRequest buildPartial() { + com.google.showcase.v1beta1.ListRoomsRequest result = + new com.google.showcase.v1beta1.ListRoomsRequest(this); + result.pageSize_ = pageSize_; + result.pageToken_ = pageToken_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.showcase.v1beta1.ListRoomsRequest) { + return mergeFrom((com.google.showcase.v1beta1.ListRoomsRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.showcase.v1beta1.ListRoomsRequest other) { + if (other == com.google.showcase.v1beta1.ListRoomsRequest.getDefaultInstance()) return this; + if (other.getPageSize() != 0) { + setPageSize(other.getPageSize()); + } + if (!other.getPageToken().isEmpty()) { + pageToken_ = other.pageToken_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.showcase.v1beta1.ListRoomsRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.showcase.v1beta1.ListRoomsRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int pageSize_; + + /** + * + * + *
        +     * The maximum number of rooms return. Server may return fewer rooms
        +     * than requested. If unspecified, server will pick an appropriate default.
        +     * 
        + * + * int32 page_size = 1; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + + /** + * + * + *
        +     * The maximum number of rooms return. Server may return fewer rooms
        +     * than requested. If unspecified, server will pick an appropriate default.
        +     * 
        + * + * int32 page_size = 1; + * + * @param value The pageSize to set. + * @return This builder for chaining. + */ + public Builder setPageSize(int value) { + + pageSize_ = value; + onChanged(); + return this; + } + + /** + * + * + *
        +     * The maximum number of rooms return. Server may return fewer rooms
        +     * than requested. If unspecified, server will pick an appropriate default.
        +     * 
        + * + * int32 page_size = 1; + * + * @return This builder for chaining. + */ + public Builder clearPageSize() { + + pageSize_ = 0; + onChanged(); + return this; + } + + private java.lang.Object pageToken_ = ""; + + /** + * + * + *
        +     * The value of google.showcase.v1beta1.ListRoomsResponse.next_page_token
        +     * returned from the previous call to
        +     * `google.showcase.v1beta1.Messaging\ListRooms` method.
        +     * 
        + * + * string page_token = 2; + * + * @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; + } + } + + /** + * + * + *
        +     * The value of google.showcase.v1beta1.ListRoomsResponse.next_page_token
        +     * returned from the previous call to
        +     * `google.showcase.v1beta1.Messaging\ListRooms` method.
        +     * 
        + * + * string page_token = 2; + * + * @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; + } + } + + /** + * + * + *
        +     * The value of google.showcase.v1beta1.ListRoomsResponse.next_page_token
        +     * returned from the previous call to
        +     * `google.showcase.v1beta1.Messaging\ListRooms` method.
        +     * 
        + * + * string page_token = 2; + * + * @param value The pageToken to set. + * @return This builder for chaining. + */ + public Builder setPageToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + pageToken_ = value; + onChanged(); + return this; + } + + /** + * + * + *
        +     * The value of google.showcase.v1beta1.ListRoomsResponse.next_page_token
        +     * returned from the previous call to
        +     * `google.showcase.v1beta1.Messaging\ListRooms` method.
        +     * 
        + * + * string page_token = 2; + * + * @return This builder for chaining. + */ + public Builder clearPageToken() { + + pageToken_ = getDefaultInstance().getPageToken(); + onChanged(); + return this; + } + + /** + * + * + *
        +     * The value of google.showcase.v1beta1.ListRoomsResponse.next_page_token
        +     * returned from the previous call to
        +     * `google.showcase.v1beta1.Messaging\ListRooms` method.
        +     * 
        + * + * string page_token = 2; + * + * @param value The bytes for pageToken to set. + * @return This builder for chaining. + */ + public Builder setPageTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + pageToken_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.showcase.v1beta1.ListRoomsRequest) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.ListRoomsRequest) + private static final com.google.showcase.v1beta1.ListRoomsRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.ListRoomsRequest(); + } + + public static com.google.showcase.v1beta1.ListRoomsRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListRoomsRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ListRoomsRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.showcase.v1beta1.ListRoomsRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListRoomsRequestOrBuilder.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListRoomsRequestOrBuilder.java new file mode 100644 index 0000000000..36d0587032 --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListRoomsRequestOrBuilder.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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/messaging.proto + +package com.google.showcase.v1beta1; + +public interface ListRoomsRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.ListRoomsRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
        +   * The maximum number of rooms return. Server may return fewer rooms
        +   * than requested. If unspecified, server will pick an appropriate default.
        +   * 
        + * + * int32 page_size = 1; + * + * @return The pageSize. + */ + int getPageSize(); + + /** + * + * + *
        +   * The value of google.showcase.v1beta1.ListRoomsResponse.next_page_token
        +   * returned from the previous call to
        +   * `google.showcase.v1beta1.Messaging\ListRooms` method.
        +   * 
        + * + * string page_token = 2; + * + * @return The pageToken. + */ + java.lang.String getPageToken(); + + /** + * + * + *
        +   * The value of google.showcase.v1beta1.ListRoomsResponse.next_page_token
        +   * returned from the previous call to
        +   * `google.showcase.v1beta1.Messaging\ListRooms` method.
        +   * 
        + * + * string page_token = 2; + * + * @return The bytes for pageToken. + */ + com.google.protobuf.ByteString getPageTokenBytes(); +} diff --git a/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListRoomsResponse.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListRoomsResponse.java new file mode 100644 index 0000000000..ad0c941576 --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListRoomsResponse.java @@ -0,0 +1,1178 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/messaging.proto + +package com.google.showcase.v1beta1; + +/** + * + * + *
        + * The response message for the google.showcase.v1beta1.Messaging\ListRooms
        + * method.
        + * 
        + * + * Protobuf type {@code google.showcase.v1beta1.ListRoomsResponse} + */ +public final class ListRoomsResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.ListRoomsResponse) + ListRoomsResponseOrBuilder { + private static final long serialVersionUID = 0L; + + // Use ListRoomsResponse.newBuilder() to construct. + private ListRoomsResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListRoomsResponse() { + rooms_ = java.util.Collections.emptyList(); + nextPageToken_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListRoomsResponse(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ListRoomsResponse( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + rooms_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + rooms_.add( + input.readMessage(com.google.showcase.v1beta1.Room.parser(), extensionRegistry)); + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + nextPageToken_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + rooms_ = java.util.Collections.unmodifiableList(rooms_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.MessagingOuterClass + .internal_static_google_showcase_v1beta1_ListRoomsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.MessagingOuterClass + .internal_static_google_showcase_v1beta1_ListRoomsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.ListRoomsResponse.class, + com.google.showcase.v1beta1.ListRoomsResponse.Builder.class); + } + + public static final int ROOMS_FIELD_NUMBER = 1; + private java.util.List rooms_; + + /** + * + * + *
        +   * The list of rooms.
        +   * 
        + * + * repeated .google.showcase.v1beta1.Room rooms = 1; + */ + @java.lang.Override + public java.util.List getRoomsList() { + return rooms_; + } + + /** + * + * + *
        +   * The list of rooms.
        +   * 
        + * + * repeated .google.showcase.v1beta1.Room rooms = 1; + */ + @java.lang.Override + public java.util.List + getRoomsOrBuilderList() { + return rooms_; + } + + /** + * + * + *
        +   * The list of rooms.
        +   * 
        + * + * repeated .google.showcase.v1beta1.Room rooms = 1; + */ + @java.lang.Override + public int getRoomsCount() { + return rooms_.size(); + } + + /** + * + * + *
        +   * The list of rooms.
        +   * 
        + * + * repeated .google.showcase.v1beta1.Room rooms = 1; + */ + @java.lang.Override + public com.google.showcase.v1beta1.Room getRooms(int index) { + return rooms_.get(index); + } + + /** + * + * + *
        +   * The list of rooms.
        +   * 
        + * + * repeated .google.showcase.v1beta1.Room rooms = 1; + */ + @java.lang.Override + public com.google.showcase.v1beta1.RoomOrBuilder getRoomsOrBuilder(int index) { + return rooms_.get(index); + } + + public static final int NEXT_PAGE_TOKEN_FIELD_NUMBER = 2; + private volatile java.lang.Object nextPageToken_; + + /** + * + * + *
        +   * A token to retrieve next page of results.
        +   * Pass this value in ListRoomsRequest.page_token field in the subsequent
        +   * call to `google.showcase.v1beta1.Messaging\ListRooms` method to retrieve
        +   * the next page of results.
        +   * 
        + * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + @java.lang.Override + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nextPageToken_ = s; + return s; + } + } + + /** + * + * + *
        +   * A token to retrieve next page of results.
        +   * Pass this value in ListRoomsRequest.page_token field in the subsequent
        +   * call to `google.showcase.v1beta1.Messaging\ListRooms` method to retrieve
        +   * the next page of results.
        +   * 
        + * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + nextPageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + for (int i = 0; i < rooms_.size(); i++) { + output.writeMessage(1, rooms_.get(i)); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nextPageToken_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, nextPageToken_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < rooms_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, rooms_.get(i)); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nextPageToken_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, nextPageToken_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.showcase.v1beta1.ListRoomsResponse)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.ListRoomsResponse other = + (com.google.showcase.v1beta1.ListRoomsResponse) obj; + + if (!getRoomsList().equals(other.getRoomsList())) return false; + if (!getNextPageToken().equals(other.getNextPageToken())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getRoomsCount() > 0) { + hash = (37 * hash) + ROOMS_FIELD_NUMBER; + hash = (53 * hash) + getRoomsList().hashCode(); + } + hash = (37 * hash) + NEXT_PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getNextPageToken().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.showcase.v1beta1.ListRoomsResponse parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.ListRoomsResponse parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.ListRoomsResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.ListRoomsResponse 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.showcase.v1beta1.ListRoomsResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.ListRoomsResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.ListRoomsResponse parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.ListRoomsResponse 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.showcase.v1beta1.ListRoomsResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.ListRoomsResponse 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.showcase.v1beta1.ListRoomsResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.ListRoomsResponse 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.showcase.v1beta1.ListRoomsResponse 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 message for the google.showcase.v1beta1.Messaging\ListRooms
        +   * method.
        +   * 
        + * + * Protobuf type {@code google.showcase.v1beta1.ListRoomsResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.ListRoomsResponse) + com.google.showcase.v1beta1.ListRoomsResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.MessagingOuterClass + .internal_static_google_showcase_v1beta1_ListRoomsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.MessagingOuterClass + .internal_static_google_showcase_v1beta1_ListRoomsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.ListRoomsResponse.class, + com.google.showcase.v1beta1.ListRoomsResponse.Builder.class); + } + + // Construct using com.google.showcase.v1beta1.ListRoomsResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getRoomsFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (roomsBuilder_ == null) { + rooms_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + roomsBuilder_.clear(); + } + nextPageToken_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.showcase.v1beta1.MessagingOuterClass + .internal_static_google_showcase_v1beta1_ListRoomsResponse_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.ListRoomsResponse getDefaultInstanceForType() { + return com.google.showcase.v1beta1.ListRoomsResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.ListRoomsResponse build() { + com.google.showcase.v1beta1.ListRoomsResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.ListRoomsResponse buildPartial() { + com.google.showcase.v1beta1.ListRoomsResponse result = + new com.google.showcase.v1beta1.ListRoomsResponse(this); + int from_bitField0_ = bitField0_; + if (roomsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + rooms_ = java.util.Collections.unmodifiableList(rooms_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.rooms_ = rooms_; + } else { + result.rooms_ = roomsBuilder_.build(); + } + result.nextPageToken_ = nextPageToken_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.showcase.v1beta1.ListRoomsResponse) { + return mergeFrom((com.google.showcase.v1beta1.ListRoomsResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.showcase.v1beta1.ListRoomsResponse other) { + if (other == com.google.showcase.v1beta1.ListRoomsResponse.getDefaultInstance()) return this; + if (roomsBuilder_ == null) { + if (!other.rooms_.isEmpty()) { + if (rooms_.isEmpty()) { + rooms_ = other.rooms_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureRoomsIsMutable(); + rooms_.addAll(other.rooms_); + } + onChanged(); + } + } else { + if (!other.rooms_.isEmpty()) { + if (roomsBuilder_.isEmpty()) { + roomsBuilder_.dispose(); + roomsBuilder_ = null; + rooms_ = other.rooms_; + bitField0_ = (bitField0_ & ~0x00000001); + roomsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getRoomsFieldBuilder() + : null; + } else { + roomsBuilder_.addAllMessages(other.rooms_); + } + } + } + if (!other.getNextPageToken().isEmpty()) { + nextPageToken_ = other.nextPageToken_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.showcase.v1beta1.ListRoomsResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.showcase.v1beta1.ListRoomsResponse) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.util.List rooms_ = + java.util.Collections.emptyList(); + + private void ensureRoomsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + rooms_ = new java.util.ArrayList(rooms_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.showcase.v1beta1.Room, + com.google.showcase.v1beta1.Room.Builder, + com.google.showcase.v1beta1.RoomOrBuilder> + roomsBuilder_; + + /** + * + * + *
        +     * The list of rooms.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Room rooms = 1; + */ + public java.util.List getRoomsList() { + if (roomsBuilder_ == null) { + return java.util.Collections.unmodifiableList(rooms_); + } else { + return roomsBuilder_.getMessageList(); + } + } + + /** + * + * + *
        +     * The list of rooms.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Room rooms = 1; + */ + public int getRoomsCount() { + if (roomsBuilder_ == null) { + return rooms_.size(); + } else { + return roomsBuilder_.getCount(); + } + } + + /** + * + * + *
        +     * The list of rooms.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Room rooms = 1; + */ + public com.google.showcase.v1beta1.Room getRooms(int index) { + if (roomsBuilder_ == null) { + return rooms_.get(index); + } else { + return roomsBuilder_.getMessage(index); + } + } + + /** + * + * + *
        +     * The list of rooms.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Room rooms = 1; + */ + public Builder setRooms(int index, com.google.showcase.v1beta1.Room value) { + if (roomsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureRoomsIsMutable(); + rooms_.set(index, value); + onChanged(); + } else { + roomsBuilder_.setMessage(index, value); + } + return this; + } + + /** + * + * + *
        +     * The list of rooms.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Room rooms = 1; + */ + public Builder setRooms(int index, com.google.showcase.v1beta1.Room.Builder builderForValue) { + if (roomsBuilder_ == null) { + ensureRoomsIsMutable(); + rooms_.set(index, builderForValue.build()); + onChanged(); + } else { + roomsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
        +     * The list of rooms.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Room rooms = 1; + */ + public Builder addRooms(com.google.showcase.v1beta1.Room value) { + if (roomsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureRoomsIsMutable(); + rooms_.add(value); + onChanged(); + } else { + roomsBuilder_.addMessage(value); + } + return this; + } + + /** + * + * + *
        +     * The list of rooms.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Room rooms = 1; + */ + public Builder addRooms(int index, com.google.showcase.v1beta1.Room value) { + if (roomsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureRoomsIsMutable(); + rooms_.add(index, value); + onChanged(); + } else { + roomsBuilder_.addMessage(index, value); + } + return this; + } + + /** + * + * + *
        +     * The list of rooms.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Room rooms = 1; + */ + public Builder addRooms(com.google.showcase.v1beta1.Room.Builder builderForValue) { + if (roomsBuilder_ == null) { + ensureRoomsIsMutable(); + rooms_.add(builderForValue.build()); + onChanged(); + } else { + roomsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + + /** + * + * + *
        +     * The list of rooms.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Room rooms = 1; + */ + public Builder addRooms(int index, com.google.showcase.v1beta1.Room.Builder builderForValue) { + if (roomsBuilder_ == null) { + ensureRoomsIsMutable(); + rooms_.add(index, builderForValue.build()); + onChanged(); + } else { + roomsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
        +     * The list of rooms.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Room rooms = 1; + */ + public Builder addAllRooms( + java.lang.Iterable values) { + if (roomsBuilder_ == null) { + ensureRoomsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, rooms_); + onChanged(); + } else { + roomsBuilder_.addAllMessages(values); + } + return this; + } + + /** + * + * + *
        +     * The list of rooms.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Room rooms = 1; + */ + public Builder clearRooms() { + if (roomsBuilder_ == null) { + rooms_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + roomsBuilder_.clear(); + } + return this; + } + + /** + * + * + *
        +     * The list of rooms.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Room rooms = 1; + */ + public Builder removeRooms(int index) { + if (roomsBuilder_ == null) { + ensureRoomsIsMutable(); + rooms_.remove(index); + onChanged(); + } else { + roomsBuilder_.remove(index); + } + return this; + } + + /** + * + * + *
        +     * The list of rooms.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Room rooms = 1; + */ + public com.google.showcase.v1beta1.Room.Builder getRoomsBuilder(int index) { + return getRoomsFieldBuilder().getBuilder(index); + } + + /** + * + * + *
        +     * The list of rooms.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Room rooms = 1; + */ + public com.google.showcase.v1beta1.RoomOrBuilder getRoomsOrBuilder(int index) { + if (roomsBuilder_ == null) { + return rooms_.get(index); + } else { + return roomsBuilder_.getMessageOrBuilder(index); + } + } + + /** + * + * + *
        +     * The list of rooms.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Room rooms = 1; + */ + public java.util.List + getRoomsOrBuilderList() { + if (roomsBuilder_ != null) { + return roomsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(rooms_); + } + } + + /** + * + * + *
        +     * The list of rooms.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Room rooms = 1; + */ + public com.google.showcase.v1beta1.Room.Builder addRoomsBuilder() { + return getRoomsFieldBuilder() + .addBuilder(com.google.showcase.v1beta1.Room.getDefaultInstance()); + } + + /** + * + * + *
        +     * The list of rooms.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Room rooms = 1; + */ + public com.google.showcase.v1beta1.Room.Builder addRoomsBuilder(int index) { + return getRoomsFieldBuilder() + .addBuilder(index, com.google.showcase.v1beta1.Room.getDefaultInstance()); + } + + /** + * + * + *
        +     * The list of rooms.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Room rooms = 1; + */ + public java.util.List getRoomsBuilderList() { + return getRoomsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.showcase.v1beta1.Room, + com.google.showcase.v1beta1.Room.Builder, + com.google.showcase.v1beta1.RoomOrBuilder> + getRoomsFieldBuilder() { + if (roomsBuilder_ == null) { + roomsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.showcase.v1beta1.Room, + com.google.showcase.v1beta1.Room.Builder, + com.google.showcase.v1beta1.RoomOrBuilder>( + rooms_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + rooms_ = null; + } + return roomsBuilder_; + } + + private java.lang.Object nextPageToken_ = ""; + + /** + * + * + *
        +     * A token to retrieve next page of results.
        +     * Pass this value in ListRoomsRequest.page_token field in the subsequent
        +     * call to `google.showcase.v1beta1.Messaging\ListRooms` method to retrieve
        +     * the next page of results.
        +     * 
        + * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nextPageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
        +     * A token to retrieve next page of results.
        +     * Pass this value in ListRoomsRequest.page_token field in the subsequent
        +     * call to `google.showcase.v1beta1.Messaging\ListRooms` method to retrieve
        +     * the next page of results.
        +     * 
        + * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + public com.google.protobuf.ByteString getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + nextPageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
        +     * A token to retrieve next page of results.
        +     * Pass this value in ListRoomsRequest.page_token field in the subsequent
        +     * call to `google.showcase.v1beta1.Messaging\ListRooms` method to retrieve
        +     * the next page of results.
        +     * 
        + * + * string next_page_token = 2; + * + * @param value The nextPageToken to set. + * @return This builder for chaining. + */ + public Builder setNextPageToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + nextPageToken_ = value; + onChanged(); + return this; + } + + /** + * + * + *
        +     * A token to retrieve next page of results.
        +     * Pass this value in ListRoomsRequest.page_token field in the subsequent
        +     * call to `google.showcase.v1beta1.Messaging\ListRooms` method to retrieve
        +     * the next page of results.
        +     * 
        + * + * string next_page_token = 2; + * + * @return This builder for chaining. + */ + public Builder clearNextPageToken() { + + nextPageToken_ = getDefaultInstance().getNextPageToken(); + onChanged(); + return this; + } + + /** + * + * + *
        +     * A token to retrieve next page of results.
        +     * Pass this value in ListRoomsRequest.page_token field in the subsequent
        +     * call to `google.showcase.v1beta1.Messaging\ListRooms` method to retrieve
        +     * the next page of results.
        +     * 
        + * + * string next_page_token = 2; + * + * @param value The bytes for nextPageToken to set. + * @return This builder for chaining. + */ + public Builder setNextPageTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + nextPageToken_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.showcase.v1beta1.ListRoomsResponse) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.ListRoomsResponse) + private static final com.google.showcase.v1beta1.ListRoomsResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.ListRoomsResponse(); + } + + public static com.google.showcase.v1beta1.ListRoomsResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListRoomsResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ListRoomsResponse(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.showcase.v1beta1.ListRoomsResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListRoomsResponseOrBuilder.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListRoomsResponseOrBuilder.java new file mode 100644 index 0000000000..f14ac868aa --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListRoomsResponseOrBuilder.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: schema/google/showcase/v1beta1/messaging.proto + +package com.google.showcase.v1beta1; + +public interface ListRoomsResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.ListRoomsResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
        +   * The list of rooms.
        +   * 
        + * + * repeated .google.showcase.v1beta1.Room rooms = 1; + */ + java.util.List getRoomsList(); + + /** + * + * + *
        +   * The list of rooms.
        +   * 
        + * + * repeated .google.showcase.v1beta1.Room rooms = 1; + */ + com.google.showcase.v1beta1.Room getRooms(int index); + + /** + * + * + *
        +   * The list of rooms.
        +   * 
        + * + * repeated .google.showcase.v1beta1.Room rooms = 1; + */ + int getRoomsCount(); + + /** + * + * + *
        +   * The list of rooms.
        +   * 
        + * + * repeated .google.showcase.v1beta1.Room rooms = 1; + */ + java.util.List getRoomsOrBuilderList(); + + /** + * + * + *
        +   * The list of rooms.
        +   * 
        + * + * repeated .google.showcase.v1beta1.Room rooms = 1; + */ + com.google.showcase.v1beta1.RoomOrBuilder getRoomsOrBuilder(int index); + + /** + * + * + *
        +   * A token to retrieve next page of results.
        +   * Pass this value in ListRoomsRequest.page_token field in the subsequent
        +   * call to `google.showcase.v1beta1.Messaging\ListRooms` method to retrieve
        +   * the next page of results.
        +   * 
        + * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + java.lang.String getNextPageToken(); + + /** + * + * + *
        +   * A token to retrieve next page of results.
        +   * Pass this value in ListRoomsRequest.page_token field in the subsequent
        +   * call to `google.showcase.v1beta1.Messaging\ListRooms` method to retrieve
        +   * the next page of results.
        +   * 
        + * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + com.google.protobuf.ByteString getNextPageTokenBytes(); +} diff --git a/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListSessionsRequest.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListSessionsRequest.java new file mode 100644 index 0000000000..28c0395297 --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListSessionsRequest.java @@ -0,0 +1,740 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/testing.proto + +package com.google.showcase.v1beta1; + +/** + * + * + *
        + * The request for the ListSessions method.
        + * 
        + * + * Protobuf type {@code google.showcase.v1beta1.ListSessionsRequest} + */ +public final class ListSessionsRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.ListSessionsRequest) + ListSessionsRequestOrBuilder { + private static final long serialVersionUID = 0L; + + // Use ListSessionsRequest.newBuilder() to construct. + private ListSessionsRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListSessionsRequest() { + pageToken_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListSessionsRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ListSessionsRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: + { + pageSize_ = input.readInt32(); + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + pageToken_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.TestingOuterClass + .internal_static_google_showcase_v1beta1_ListSessionsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.TestingOuterClass + .internal_static_google_showcase_v1beta1_ListSessionsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.ListSessionsRequest.class, + com.google.showcase.v1beta1.ListSessionsRequest.Builder.class); + } + + public static final int PAGE_SIZE_FIELD_NUMBER = 1; + private int pageSize_; + + /** + * + * + *
        +   * The maximum number of sessions to return per page.
        +   * 
        + * + * int32 page_size = 1; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + + public static final int PAGE_TOKEN_FIELD_NUMBER = 2; + private volatile java.lang.Object pageToken_; + + /** + * + * + *
        +   * The page token, for retrieving subsequent pages.
        +   * 
        + * + * string page_token = 2; + * + * @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; + } + } + + /** + * + * + *
        +   * The page token, for retrieving subsequent pages.
        +   * 
        + * + * string page_token = 2; + * + * @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_); + } + unknownFields.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 += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.showcase.v1beta1.ListSessionsRequest)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.ListSessionsRequest other = + (com.google.showcase.v1beta1.ListSessionsRequest) obj; + + if (getPageSize() != other.getPageSize()) return false; + if (!getPageToken().equals(other.getPageToken())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + PAGE_SIZE_FIELD_NUMBER; + hash = (53 * hash) + getPageSize(); + hash = (37 * hash) + PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getPageToken().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.showcase.v1beta1.ListSessionsRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.ListSessionsRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.ListSessionsRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.ListSessionsRequest 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.showcase.v1beta1.ListSessionsRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.ListSessionsRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.ListSessionsRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.ListSessionsRequest 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.showcase.v1beta1.ListSessionsRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.ListSessionsRequest 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.showcase.v1beta1.ListSessionsRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.ListSessionsRequest 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.showcase.v1beta1.ListSessionsRequest 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 request for the ListSessions method.
        +   * 
        + * + * Protobuf type {@code google.showcase.v1beta1.ListSessionsRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.ListSessionsRequest) + com.google.showcase.v1beta1.ListSessionsRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.TestingOuterClass + .internal_static_google_showcase_v1beta1_ListSessionsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.TestingOuterClass + .internal_static_google_showcase_v1beta1_ListSessionsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.ListSessionsRequest.class, + com.google.showcase.v1beta1.ListSessionsRequest.Builder.class); + } + + // Construct using com.google.showcase.v1beta1.ListSessionsRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + pageSize_ = 0; + + pageToken_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.showcase.v1beta1.TestingOuterClass + .internal_static_google_showcase_v1beta1_ListSessionsRequest_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.ListSessionsRequest getDefaultInstanceForType() { + return com.google.showcase.v1beta1.ListSessionsRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.ListSessionsRequest build() { + com.google.showcase.v1beta1.ListSessionsRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.ListSessionsRequest buildPartial() { + com.google.showcase.v1beta1.ListSessionsRequest result = + new com.google.showcase.v1beta1.ListSessionsRequest(this); + result.pageSize_ = pageSize_; + result.pageToken_ = pageToken_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.showcase.v1beta1.ListSessionsRequest) { + return mergeFrom((com.google.showcase.v1beta1.ListSessionsRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.showcase.v1beta1.ListSessionsRequest other) { + if (other == com.google.showcase.v1beta1.ListSessionsRequest.getDefaultInstance()) + return this; + if (other.getPageSize() != 0) { + setPageSize(other.getPageSize()); + } + if (!other.getPageToken().isEmpty()) { + pageToken_ = other.pageToken_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.showcase.v1beta1.ListSessionsRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.showcase.v1beta1.ListSessionsRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int pageSize_; + + /** + * + * + *
        +     * The maximum number of sessions to return per page.
        +     * 
        + * + * int32 page_size = 1; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + + /** + * + * + *
        +     * The maximum number of sessions to return per page.
        +     * 
        + * + * int32 page_size = 1; + * + * @param value The pageSize to set. + * @return This builder for chaining. + */ + public Builder setPageSize(int value) { + + pageSize_ = value; + onChanged(); + return this; + } + + /** + * + * + *
        +     * The maximum number of sessions to return per page.
        +     * 
        + * + * int32 page_size = 1; + * + * @return This builder for chaining. + */ + public Builder clearPageSize() { + + pageSize_ = 0; + onChanged(); + return this; + } + + private java.lang.Object pageToken_ = ""; + + /** + * + * + *
        +     * The page token, for retrieving subsequent pages.
        +     * 
        + * + * string page_token = 2; + * + * @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; + } + } + + /** + * + * + *
        +     * The page token, for retrieving subsequent pages.
        +     * 
        + * + * string page_token = 2; + * + * @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; + } + } + + /** + * + * + *
        +     * The page token, for retrieving subsequent pages.
        +     * 
        + * + * string page_token = 2; + * + * @param value The pageToken to set. + * @return This builder for chaining. + */ + public Builder setPageToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + pageToken_ = value; + onChanged(); + return this; + } + + /** + * + * + *
        +     * The page token, for retrieving subsequent pages.
        +     * 
        + * + * string page_token = 2; + * + * @return This builder for chaining. + */ + public Builder clearPageToken() { + + pageToken_ = getDefaultInstance().getPageToken(); + onChanged(); + return this; + } + + /** + * + * + *
        +     * The page token, for retrieving subsequent pages.
        +     * 
        + * + * string page_token = 2; + * + * @param value The bytes for pageToken to set. + * @return This builder for chaining. + */ + public Builder setPageTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + pageToken_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.showcase.v1beta1.ListSessionsRequest) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.ListSessionsRequest) + private static final com.google.showcase.v1beta1.ListSessionsRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.ListSessionsRequest(); + } + + public static com.google.showcase.v1beta1.ListSessionsRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListSessionsRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ListSessionsRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.showcase.v1beta1.ListSessionsRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListSessionsRequestOrBuilder.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListSessionsRequestOrBuilder.java new file mode 100644 index 0000000000..ef4c9b52b0 --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListSessionsRequestOrBuilder.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: schema/google/showcase/v1beta1/testing.proto + +package com.google.showcase.v1beta1; + +public interface ListSessionsRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.ListSessionsRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
        +   * The maximum number of sessions to return per page.
        +   * 
        + * + * int32 page_size = 1; + * + * @return The pageSize. + */ + int getPageSize(); + + /** + * + * + *
        +   * The page token, for retrieving subsequent pages.
        +   * 
        + * + * string page_token = 2; + * + * @return The pageToken. + */ + java.lang.String getPageToken(); + + /** + * + * + *
        +   * The page token, for retrieving subsequent pages.
        +   * 
        + * + * string page_token = 2; + * + * @return The bytes for pageToken. + */ + com.google.protobuf.ByteString getPageTokenBytes(); +} diff --git a/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListSessionsResponse.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListSessionsResponse.java new file mode 100644 index 0000000000..dfd32eb721 --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListSessionsResponse.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: schema/google/showcase/v1beta1/testing.proto + +package com.google.showcase.v1beta1; + +/** + * + * + *
        + * Response for the ListSessions method.
        + * 
        + * + * Protobuf type {@code google.showcase.v1beta1.ListSessionsResponse} + */ +public final class ListSessionsResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.ListSessionsResponse) + ListSessionsResponseOrBuilder { + private static final long serialVersionUID = 0L; + + // Use ListSessionsResponse.newBuilder() to construct. + private ListSessionsResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListSessionsResponse() { + sessions_ = java.util.Collections.emptyList(); + nextPageToken_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListSessionsResponse(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ListSessionsResponse( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + sessions_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + sessions_.add( + input.readMessage( + com.google.showcase.v1beta1.Session.parser(), extensionRegistry)); + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + nextPageToken_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + sessions_ = java.util.Collections.unmodifiableList(sessions_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.TestingOuterClass + .internal_static_google_showcase_v1beta1_ListSessionsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.TestingOuterClass + .internal_static_google_showcase_v1beta1_ListSessionsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.ListSessionsResponse.class, + com.google.showcase.v1beta1.ListSessionsResponse.Builder.class); + } + + public static final int SESSIONS_FIELD_NUMBER = 1; + private java.util.List sessions_; + + /** + * + * + *
        +   * The sessions being returned.
        +   * 
        + * + * repeated .google.showcase.v1beta1.Session sessions = 1; + */ + @java.lang.Override + public java.util.List getSessionsList() { + return sessions_; + } + + /** + * + * + *
        +   * The sessions being returned.
        +   * 
        + * + * repeated .google.showcase.v1beta1.Session sessions = 1; + */ + @java.lang.Override + public java.util.List + getSessionsOrBuilderList() { + return sessions_; + } + + /** + * + * + *
        +   * The sessions being returned.
        +   * 
        + * + * repeated .google.showcase.v1beta1.Session sessions = 1; + */ + @java.lang.Override + public int getSessionsCount() { + return sessions_.size(); + } + + /** + * + * + *
        +   * The sessions being returned.
        +   * 
        + * + * repeated .google.showcase.v1beta1.Session sessions = 1; + */ + @java.lang.Override + public com.google.showcase.v1beta1.Session getSessions(int index) { + return sessions_.get(index); + } + + /** + * + * + *
        +   * The sessions being returned.
        +   * 
        + * + * repeated .google.showcase.v1beta1.Session sessions = 1; + */ + @java.lang.Override + public com.google.showcase.v1beta1.SessionOrBuilder getSessionsOrBuilder(int index) { + return sessions_.get(index); + } + + public static final int NEXT_PAGE_TOKEN_FIELD_NUMBER = 2; + private volatile java.lang.Object nextPageToken_; + + /** + * + * + *
        +   * The next page token, if any.
        +   * An empty value here means the last page has been reached.
        +   * 
        + * + * 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; + } + } + + /** + * + * + *
        +   * The next page token, if any.
        +   * An empty value here means the last page has been reached.
        +   * 
        + * + * 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 < sessions_.size(); i++) { + output.writeMessage(1, sessions_.get(i)); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nextPageToken_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, nextPageToken_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < sessions_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, sessions_.get(i)); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nextPageToken_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, nextPageToken_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.showcase.v1beta1.ListSessionsResponse)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.ListSessionsResponse other = + (com.google.showcase.v1beta1.ListSessionsResponse) obj; + + if (!getSessionsList().equals(other.getSessionsList())) return false; + if (!getNextPageToken().equals(other.getNextPageToken())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getSessionsCount() > 0) { + hash = (37 * hash) + SESSIONS_FIELD_NUMBER; + hash = (53 * hash) + getSessionsList().hashCode(); + } + hash = (37 * hash) + NEXT_PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getNextPageToken().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.showcase.v1beta1.ListSessionsResponse parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.ListSessionsResponse parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.ListSessionsResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.ListSessionsResponse 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.showcase.v1beta1.ListSessionsResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.ListSessionsResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.ListSessionsResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.ListSessionsResponse 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.showcase.v1beta1.ListSessionsResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.ListSessionsResponse 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.showcase.v1beta1.ListSessionsResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.ListSessionsResponse 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.showcase.v1beta1.ListSessionsResponse 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 for the ListSessions method.
        +   * 
        + * + * Protobuf type {@code google.showcase.v1beta1.ListSessionsResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.ListSessionsResponse) + com.google.showcase.v1beta1.ListSessionsResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.TestingOuterClass + .internal_static_google_showcase_v1beta1_ListSessionsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.TestingOuterClass + .internal_static_google_showcase_v1beta1_ListSessionsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.ListSessionsResponse.class, + com.google.showcase.v1beta1.ListSessionsResponse.Builder.class); + } + + // Construct using com.google.showcase.v1beta1.ListSessionsResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getSessionsFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (sessionsBuilder_ == null) { + sessions_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + sessionsBuilder_.clear(); + } + nextPageToken_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.showcase.v1beta1.TestingOuterClass + .internal_static_google_showcase_v1beta1_ListSessionsResponse_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.ListSessionsResponse getDefaultInstanceForType() { + return com.google.showcase.v1beta1.ListSessionsResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.ListSessionsResponse build() { + com.google.showcase.v1beta1.ListSessionsResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.ListSessionsResponse buildPartial() { + com.google.showcase.v1beta1.ListSessionsResponse result = + new com.google.showcase.v1beta1.ListSessionsResponse(this); + int from_bitField0_ = bitField0_; + if (sessionsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + sessions_ = java.util.Collections.unmodifiableList(sessions_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.sessions_ = sessions_; + } else { + result.sessions_ = sessionsBuilder_.build(); + } + result.nextPageToken_ = nextPageToken_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.showcase.v1beta1.ListSessionsResponse) { + return mergeFrom((com.google.showcase.v1beta1.ListSessionsResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.showcase.v1beta1.ListSessionsResponse other) { + if (other == com.google.showcase.v1beta1.ListSessionsResponse.getDefaultInstance()) + return this; + if (sessionsBuilder_ == null) { + if (!other.sessions_.isEmpty()) { + if (sessions_.isEmpty()) { + sessions_ = other.sessions_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureSessionsIsMutable(); + sessions_.addAll(other.sessions_); + } + onChanged(); + } + } else { + if (!other.sessions_.isEmpty()) { + if (sessionsBuilder_.isEmpty()) { + sessionsBuilder_.dispose(); + sessionsBuilder_ = null; + sessions_ = other.sessions_; + bitField0_ = (bitField0_ & ~0x00000001); + sessionsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getSessionsFieldBuilder() + : null; + } else { + sessionsBuilder_.addAllMessages(other.sessions_); + } + } + } + if (!other.getNextPageToken().isEmpty()) { + nextPageToken_ = other.nextPageToken_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.showcase.v1beta1.ListSessionsResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.showcase.v1beta1.ListSessionsResponse) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.util.List sessions_ = + java.util.Collections.emptyList(); + + private void ensureSessionsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + sessions_ = new java.util.ArrayList(sessions_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.showcase.v1beta1.Session, + com.google.showcase.v1beta1.Session.Builder, + com.google.showcase.v1beta1.SessionOrBuilder> + sessionsBuilder_; + + /** + * + * + *
        +     * The sessions being returned.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Session sessions = 1; + */ + public java.util.List getSessionsList() { + if (sessionsBuilder_ == null) { + return java.util.Collections.unmodifiableList(sessions_); + } else { + return sessionsBuilder_.getMessageList(); + } + } + + /** + * + * + *
        +     * The sessions being returned.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Session sessions = 1; + */ + public int getSessionsCount() { + if (sessionsBuilder_ == null) { + return sessions_.size(); + } else { + return sessionsBuilder_.getCount(); + } + } + + /** + * + * + *
        +     * The sessions being returned.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Session sessions = 1; + */ + public com.google.showcase.v1beta1.Session getSessions(int index) { + if (sessionsBuilder_ == null) { + return sessions_.get(index); + } else { + return sessionsBuilder_.getMessage(index); + } + } + + /** + * + * + *
        +     * The sessions being returned.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Session sessions = 1; + */ + public Builder setSessions(int index, com.google.showcase.v1beta1.Session value) { + if (sessionsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureSessionsIsMutable(); + sessions_.set(index, value); + onChanged(); + } else { + sessionsBuilder_.setMessage(index, value); + } + return this; + } + + /** + * + * + *
        +     * The sessions being returned.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Session sessions = 1; + */ + public Builder setSessions( + int index, com.google.showcase.v1beta1.Session.Builder builderForValue) { + if (sessionsBuilder_ == null) { + ensureSessionsIsMutable(); + sessions_.set(index, builderForValue.build()); + onChanged(); + } else { + sessionsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
        +     * The sessions being returned.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Session sessions = 1; + */ + public Builder addSessions(com.google.showcase.v1beta1.Session value) { + if (sessionsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureSessionsIsMutable(); + sessions_.add(value); + onChanged(); + } else { + sessionsBuilder_.addMessage(value); + } + return this; + } + + /** + * + * + *
        +     * The sessions being returned.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Session sessions = 1; + */ + public Builder addSessions(int index, com.google.showcase.v1beta1.Session value) { + if (sessionsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureSessionsIsMutable(); + sessions_.add(index, value); + onChanged(); + } else { + sessionsBuilder_.addMessage(index, value); + } + return this; + } + + /** + * + * + *
        +     * The sessions being returned.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Session sessions = 1; + */ + public Builder addSessions(com.google.showcase.v1beta1.Session.Builder builderForValue) { + if (sessionsBuilder_ == null) { + ensureSessionsIsMutable(); + sessions_.add(builderForValue.build()); + onChanged(); + } else { + sessionsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + + /** + * + * + *
        +     * The sessions being returned.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Session sessions = 1; + */ + public Builder addSessions( + int index, com.google.showcase.v1beta1.Session.Builder builderForValue) { + if (sessionsBuilder_ == null) { + ensureSessionsIsMutable(); + sessions_.add(index, builderForValue.build()); + onChanged(); + } else { + sessionsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
        +     * The sessions being returned.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Session sessions = 1; + */ + public Builder addAllSessions( + java.lang.Iterable values) { + if (sessionsBuilder_ == null) { + ensureSessionsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, sessions_); + onChanged(); + } else { + sessionsBuilder_.addAllMessages(values); + } + return this; + } + + /** + * + * + *
        +     * The sessions being returned.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Session sessions = 1; + */ + public Builder clearSessions() { + if (sessionsBuilder_ == null) { + sessions_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + sessionsBuilder_.clear(); + } + return this; + } + + /** + * + * + *
        +     * The sessions being returned.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Session sessions = 1; + */ + public Builder removeSessions(int index) { + if (sessionsBuilder_ == null) { + ensureSessionsIsMutable(); + sessions_.remove(index); + onChanged(); + } else { + sessionsBuilder_.remove(index); + } + return this; + } + + /** + * + * + *
        +     * The sessions being returned.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Session sessions = 1; + */ + public com.google.showcase.v1beta1.Session.Builder getSessionsBuilder(int index) { + return getSessionsFieldBuilder().getBuilder(index); + } + + /** + * + * + *
        +     * The sessions being returned.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Session sessions = 1; + */ + public com.google.showcase.v1beta1.SessionOrBuilder getSessionsOrBuilder(int index) { + if (sessionsBuilder_ == null) { + return sessions_.get(index); + } else { + return sessionsBuilder_.getMessageOrBuilder(index); + } + } + + /** + * + * + *
        +     * The sessions being returned.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Session sessions = 1; + */ + public java.util.List + getSessionsOrBuilderList() { + if (sessionsBuilder_ != null) { + return sessionsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(sessions_); + } + } + + /** + * + * + *
        +     * The sessions being returned.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Session sessions = 1; + */ + public com.google.showcase.v1beta1.Session.Builder addSessionsBuilder() { + return getSessionsFieldBuilder() + .addBuilder(com.google.showcase.v1beta1.Session.getDefaultInstance()); + } + + /** + * + * + *
        +     * The sessions being returned.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Session sessions = 1; + */ + public com.google.showcase.v1beta1.Session.Builder addSessionsBuilder(int index) { + return getSessionsFieldBuilder() + .addBuilder(index, com.google.showcase.v1beta1.Session.getDefaultInstance()); + } + + /** + * + * + *
        +     * The sessions being returned.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Session sessions = 1; + */ + public java.util.List getSessionsBuilderList() { + return getSessionsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.showcase.v1beta1.Session, + com.google.showcase.v1beta1.Session.Builder, + com.google.showcase.v1beta1.SessionOrBuilder> + getSessionsFieldBuilder() { + if (sessionsBuilder_ == null) { + sessionsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.showcase.v1beta1.Session, + com.google.showcase.v1beta1.Session.Builder, + com.google.showcase.v1beta1.SessionOrBuilder>( + sessions_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + sessions_ = null; + } + return sessionsBuilder_; + } + + private java.lang.Object nextPageToken_ = ""; + + /** + * + * + *
        +     * The next page token, if any.
        +     * An empty value here means the last page has been reached.
        +     * 
        + * + * 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; + } + } + + /** + * + * + *
        +     * The next page token, if any.
        +     * An empty value here means the last page has been reached.
        +     * 
        + * + * 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; + } + } + + /** + * + * + *
        +     * The next page token, if any.
        +     * An empty value here means the last page has been reached.
        +     * 
        + * + * string next_page_token = 2; + * + * @param value The nextPageToken to set. + * @return This builder for chaining. + */ + public Builder setNextPageToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + nextPageToken_ = value; + onChanged(); + return this; + } + + /** + * + * + *
        +     * The next page token, if any.
        +     * An empty value here means the last page has been reached.
        +     * 
        + * + * string next_page_token = 2; + * + * @return This builder for chaining. + */ + public Builder clearNextPageToken() { + + nextPageToken_ = getDefaultInstance().getNextPageToken(); + onChanged(); + return this; + } + + /** + * + * + *
        +     * The next page token, if any.
        +     * An empty value here means the last page has been reached.
        +     * 
        + * + * string next_page_token = 2; + * + * @param value The bytes for nextPageToken to set. + * @return This builder for chaining. + */ + public Builder setNextPageTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + nextPageToken_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.showcase.v1beta1.ListSessionsResponse) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.ListSessionsResponse) + private static final com.google.showcase.v1beta1.ListSessionsResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.ListSessionsResponse(); + } + + public static com.google.showcase.v1beta1.ListSessionsResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListSessionsResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ListSessionsResponse(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.showcase.v1beta1.ListSessionsResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListSessionsResponseOrBuilder.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListSessionsResponseOrBuilder.java new file mode 100644 index 0000000000..d8475fb2cb --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListSessionsResponseOrBuilder.java @@ -0,0 +1,108 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/testing.proto + +package com.google.showcase.v1beta1; + +public interface ListSessionsResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.ListSessionsResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
        +   * The sessions being returned.
        +   * 
        + * + * repeated .google.showcase.v1beta1.Session sessions = 1; + */ + java.util.List getSessionsList(); + + /** + * + * + *
        +   * The sessions being returned.
        +   * 
        + * + * repeated .google.showcase.v1beta1.Session sessions = 1; + */ + com.google.showcase.v1beta1.Session getSessions(int index); + + /** + * + * + *
        +   * The sessions being returned.
        +   * 
        + * + * repeated .google.showcase.v1beta1.Session sessions = 1; + */ + int getSessionsCount(); + + /** + * + * + *
        +   * The sessions being returned.
        +   * 
        + * + * repeated .google.showcase.v1beta1.Session sessions = 1; + */ + java.util.List getSessionsOrBuilderList(); + + /** + * + * + *
        +   * The sessions being returned.
        +   * 
        + * + * repeated .google.showcase.v1beta1.Session sessions = 1; + */ + com.google.showcase.v1beta1.SessionOrBuilder getSessionsOrBuilder(int index); + + /** + * + * + *
        +   * The next page token, if any.
        +   * An empty value here means the last page has been reached.
        +   * 
        + * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + java.lang.String getNextPageToken(); + + /** + * + * + *
        +   * The next page token, if any.
        +   * An empty value here means the last page has been reached.
        +   * 
        + * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + com.google.protobuf.ByteString getNextPageTokenBytes(); +} diff --git a/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListTestsRequest.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListTestsRequest.java new file mode 100644 index 0000000000..93b02387a1 --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListTestsRequest.java @@ -0,0 +1,925 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/testing.proto + +package com.google.showcase.v1beta1; + +/** + * + * + *
        + * The request for the ListTests method.
        + * 
        + * + * Protobuf type {@code google.showcase.v1beta1.ListTestsRequest} + */ +public final class ListTestsRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.ListTestsRequest) + ListTestsRequestOrBuilder { + private static final long serialVersionUID = 0L; + + // Use ListTestsRequest.newBuilder() to construct. + private ListTestsRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListTestsRequest() { + parent_ = ""; + pageToken_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListTestsRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ListTestsRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + parent_ = s; + break; + } + case 16: + { + pageSize_ = input.readInt32(); + break; + } + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + + pageToken_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.TestingOuterClass + .internal_static_google_showcase_v1beta1_ListTestsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.TestingOuterClass + .internal_static_google_showcase_v1beta1_ListTestsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.ListTestsRequest.class, + com.google.showcase.v1beta1.ListTestsRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + private volatile java.lang.Object parent_; + + /** + * + * + *
        +   * The session.
        +   * 
        + * + * string parent = 1 [(.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; + } + } + + /** + * + * + *
        +   * The session.
        +   * 
        + * + * string parent = 1 [(.google.api.resource_reference) = { ... } + * + * @return The bytes for parent. + */ + @java.lang.Override + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PAGE_SIZE_FIELD_NUMBER = 2; + private int pageSize_; + + /** + * + * + *
        +   * The maximum number of tests to return per page.
        +   * 
        + * + * int32 page_size = 2; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + + public static final int PAGE_TOKEN_FIELD_NUMBER = 3; + private volatile java.lang.Object pageToken_; + + /** + * + * + *
        +   * The page token, for retrieving subsequent pages.
        +   * 
        + * + * string page_token = 3; + * + * @return The pageToken. + */ + @java.lang.Override + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; + } + } + + /** + * + * + *
        +   * The page token, for retrieving subsequent pages.
        +   * 
        + * + * string page_token = 3; + * + * @return The bytes for pageToken. + */ + @java.lang.Override + public com.google.protobuf.ByteString getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!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_); + } + unknownFields.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_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.showcase.v1beta1.ListTestsRequest)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.ListTestsRequest other = + (com.google.showcase.v1beta1.ListTestsRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (getPageSize() != other.getPageSize()) return false; + if (!getPageToken().equals(other.getPageToken())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + PARENT_FIELD_NUMBER; + hash = (53 * hash) + getParent().hashCode(); + hash = (37 * hash) + PAGE_SIZE_FIELD_NUMBER; + hash = (53 * hash) + getPageSize(); + hash = (37 * hash) + PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getPageToken().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.showcase.v1beta1.ListTestsRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.ListTestsRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.ListTestsRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.ListTestsRequest 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.showcase.v1beta1.ListTestsRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.ListTestsRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.ListTestsRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.ListTestsRequest 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.showcase.v1beta1.ListTestsRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.ListTestsRequest 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.showcase.v1beta1.ListTestsRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.ListTestsRequest 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.showcase.v1beta1.ListTestsRequest 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 request for the ListTests method.
        +   * 
        + * + * Protobuf type {@code google.showcase.v1beta1.ListTestsRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.ListTestsRequest) + com.google.showcase.v1beta1.ListTestsRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.TestingOuterClass + .internal_static_google_showcase_v1beta1_ListTestsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.TestingOuterClass + .internal_static_google_showcase_v1beta1_ListTestsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.ListTestsRequest.class, + com.google.showcase.v1beta1.ListTestsRequest.Builder.class); + } + + // Construct using com.google.showcase.v1beta1.ListTestsRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + parent_ = ""; + + pageSize_ = 0; + + pageToken_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.showcase.v1beta1.TestingOuterClass + .internal_static_google_showcase_v1beta1_ListTestsRequest_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.ListTestsRequest getDefaultInstanceForType() { + return com.google.showcase.v1beta1.ListTestsRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.ListTestsRequest build() { + com.google.showcase.v1beta1.ListTestsRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.ListTestsRequest buildPartial() { + com.google.showcase.v1beta1.ListTestsRequest result = + new com.google.showcase.v1beta1.ListTestsRequest(this); + result.parent_ = parent_; + result.pageSize_ = pageSize_; + result.pageToken_ = pageToken_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.showcase.v1beta1.ListTestsRequest) { + return mergeFrom((com.google.showcase.v1beta1.ListTestsRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.showcase.v1beta1.ListTestsRequest other) { + if (other == com.google.showcase.v1beta1.ListTestsRequest.getDefaultInstance()) return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + onChanged(); + } + if (other.getPageSize() != 0) { + setPageSize(other.getPageSize()); + } + if (!other.getPageToken().isEmpty()) { + pageToken_ = other.pageToken_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.showcase.v1beta1.ListTestsRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.showcase.v1beta1.ListTestsRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object parent_ = ""; + + /** + * + * + *
        +     * The session.
        +     * 
        + * + * string parent = 1 [(.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; + } + } + + /** + * + * + *
        +     * The session.
        +     * 
        + * + * string parent = 1 [(.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; + } + } + + /** + * + * + *
        +     * The session.
        +     * 
        + * + * string parent = 1 [(.google.api.resource_reference) = { ... } + * + * @param value The parent to set. + * @return This builder for chaining. + */ + public Builder setParent(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + parent_ = value; + onChanged(); + return this; + } + + /** + * + * + *
        +     * The session.
        +     * 
        + * + * string parent = 1 [(.google.api.resource_reference) = { ... } + * + * @return This builder for chaining. + */ + public Builder clearParent() { + + parent_ = getDefaultInstance().getParent(); + onChanged(); + return this; + } + + /** + * + * + *
        +     * The session.
        +     * 
        + * + * string parent = 1 [(.google.api.resource_reference) = { ... } + * + * @param value The bytes for parent to set. + * @return This builder for chaining. + */ + public Builder setParentBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + parent_ = value; + onChanged(); + return this; + } + + private int pageSize_; + + /** + * + * + *
        +     * The maximum number of tests to return per page.
        +     * 
        + * + * int32 page_size = 2; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + + /** + * + * + *
        +     * The maximum number of tests to return per page.
        +     * 
        + * + * int32 page_size = 2; + * + * @param value The pageSize to set. + * @return This builder for chaining. + */ + public Builder setPageSize(int value) { + + pageSize_ = value; + onChanged(); + return this; + } + + /** + * + * + *
        +     * The maximum number of tests to return per page.
        +     * 
        + * + * int32 page_size = 2; + * + * @return This builder for chaining. + */ + public Builder clearPageSize() { + + pageSize_ = 0; + onChanged(); + return this; + } + + private java.lang.Object pageToken_ = ""; + + /** + * + * + *
        +     * The page token, for retrieving subsequent pages.
        +     * 
        + * + * string page_token = 3; + * + * @return The pageToken. + */ + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
        +     * The page token, for retrieving subsequent pages.
        +     * 
        + * + * string page_token = 3; + * + * @return The bytes for pageToken. + */ + public com.google.protobuf.ByteString getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
        +     * The page token, for retrieving subsequent pages.
        +     * 
        + * + * string page_token = 3; + * + * @param value The pageToken to set. + * @return This builder for chaining. + */ + public Builder setPageToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + pageToken_ = value; + onChanged(); + return this; + } + + /** + * + * + *
        +     * The page token, for retrieving subsequent pages.
        +     * 
        + * + * string page_token = 3; + * + * @return This builder for chaining. + */ + public Builder clearPageToken() { + + pageToken_ = getDefaultInstance().getPageToken(); + onChanged(); + return this; + } + + /** + * + * + *
        +     * The page token, for retrieving subsequent pages.
        +     * 
        + * + * string page_token = 3; + * + * @param value The bytes for pageToken to set. + * @return This builder for chaining. + */ + public Builder setPageTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + pageToken_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.showcase.v1beta1.ListTestsRequest) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.ListTestsRequest) + private static final com.google.showcase.v1beta1.ListTestsRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.ListTestsRequest(); + } + + public static com.google.showcase.v1beta1.ListTestsRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListTestsRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ListTestsRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.showcase.v1beta1.ListTestsRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListTestsRequestOrBuilder.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListTestsRequestOrBuilder.java new file mode 100644 index 0000000000..451ba9e531 --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListTestsRequestOrBuilder.java @@ -0,0 +1,90 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/testing.proto + +package com.google.showcase.v1beta1; + +public interface ListTestsRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.ListTestsRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
        +   * The session.
        +   * 
        + * + * string parent = 1 [(.google.api.resource_reference) = { ... } + * + * @return The parent. + */ + java.lang.String getParent(); + + /** + * + * + *
        +   * The session.
        +   * 
        + * + * string parent = 1 [(.google.api.resource_reference) = { ... } + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
        +   * The maximum number of tests to return per page.
        +   * 
        + * + * int32 page_size = 2; + * + * @return The pageSize. + */ + int getPageSize(); + + /** + * + * + *
        +   * The page token, for retrieving subsequent pages.
        +   * 
        + * + * string page_token = 3; + * + * @return The pageToken. + */ + java.lang.String getPageToken(); + + /** + * + * + *
        +   * The page token, for retrieving subsequent pages.
        +   * 
        + * + * string page_token = 3; + * + * @return The bytes for pageToken. + */ + com.google.protobuf.ByteString getPageTokenBytes(); +} diff --git a/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListTestsResponse.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListTestsResponse.java new file mode 100644 index 0000000000..57c616d2fc --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListTestsResponse.java @@ -0,0 +1,1162 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/testing.proto + +package com.google.showcase.v1beta1; + +/** + * + * + *
        + * The response for the ListTests method.
        + * 
        + * + * Protobuf type {@code google.showcase.v1beta1.ListTestsResponse} + */ +public final class ListTestsResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.ListTestsResponse) + ListTestsResponseOrBuilder { + private static final long serialVersionUID = 0L; + + // Use ListTestsResponse.newBuilder() to construct. + private ListTestsResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListTestsResponse() { + tests_ = java.util.Collections.emptyList(); + nextPageToken_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListTestsResponse(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ListTestsResponse( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + tests_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + tests_.add( + input.readMessage(com.google.showcase.v1beta1.Test.parser(), extensionRegistry)); + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + nextPageToken_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + tests_ = java.util.Collections.unmodifiableList(tests_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.TestingOuterClass + .internal_static_google_showcase_v1beta1_ListTestsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.TestingOuterClass + .internal_static_google_showcase_v1beta1_ListTestsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.ListTestsResponse.class, + com.google.showcase.v1beta1.ListTestsResponse.Builder.class); + } + + public static final int TESTS_FIELD_NUMBER = 1; + private java.util.List tests_; + + /** + * + * + *
        +   * The tests being returned.
        +   * 
        + * + * repeated .google.showcase.v1beta1.Test tests = 1; + */ + @java.lang.Override + public java.util.List getTestsList() { + return tests_; + } + + /** + * + * + *
        +   * The tests being returned.
        +   * 
        + * + * repeated .google.showcase.v1beta1.Test tests = 1; + */ + @java.lang.Override + public java.util.List + getTestsOrBuilderList() { + return tests_; + } + + /** + * + * + *
        +   * The tests being returned.
        +   * 
        + * + * repeated .google.showcase.v1beta1.Test tests = 1; + */ + @java.lang.Override + public int getTestsCount() { + return tests_.size(); + } + + /** + * + * + *
        +   * The tests being returned.
        +   * 
        + * + * repeated .google.showcase.v1beta1.Test tests = 1; + */ + @java.lang.Override + public com.google.showcase.v1beta1.Test getTests(int index) { + return tests_.get(index); + } + + /** + * + * + *
        +   * The tests being returned.
        +   * 
        + * + * repeated .google.showcase.v1beta1.Test tests = 1; + */ + @java.lang.Override + public com.google.showcase.v1beta1.TestOrBuilder getTestsOrBuilder(int index) { + return tests_.get(index); + } + + public static final int NEXT_PAGE_TOKEN_FIELD_NUMBER = 2; + private volatile java.lang.Object nextPageToken_; + + /** + * + * + *
        +   * The next page token, if any.
        +   * An empty value here means the last page has been reached.
        +   * 
        + * + * 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; + } + } + + /** + * + * + *
        +   * The next page token, if any.
        +   * An empty value here means the last page has been reached.
        +   * 
        + * + * 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 < tests_.size(); i++) { + output.writeMessage(1, tests_.get(i)); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nextPageToken_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, nextPageToken_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < tests_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, tests_.get(i)); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nextPageToken_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, nextPageToken_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.showcase.v1beta1.ListTestsResponse)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.ListTestsResponse other = + (com.google.showcase.v1beta1.ListTestsResponse) obj; + + if (!getTestsList().equals(other.getTestsList())) return false; + if (!getNextPageToken().equals(other.getNextPageToken())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getTestsCount() > 0) { + hash = (37 * hash) + TESTS_FIELD_NUMBER; + hash = (53 * hash) + getTestsList().hashCode(); + } + hash = (37 * hash) + NEXT_PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getNextPageToken().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.showcase.v1beta1.ListTestsResponse parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.ListTestsResponse parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.ListTestsResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.ListTestsResponse 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.showcase.v1beta1.ListTestsResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.ListTestsResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.ListTestsResponse parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.ListTestsResponse 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.showcase.v1beta1.ListTestsResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.ListTestsResponse 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.showcase.v1beta1.ListTestsResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.ListTestsResponse 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.showcase.v1beta1.ListTestsResponse 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 for the ListTests method.
        +   * 
        + * + * Protobuf type {@code google.showcase.v1beta1.ListTestsResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.ListTestsResponse) + com.google.showcase.v1beta1.ListTestsResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.TestingOuterClass + .internal_static_google_showcase_v1beta1_ListTestsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.TestingOuterClass + .internal_static_google_showcase_v1beta1_ListTestsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.ListTestsResponse.class, + com.google.showcase.v1beta1.ListTestsResponse.Builder.class); + } + + // Construct using com.google.showcase.v1beta1.ListTestsResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getTestsFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (testsBuilder_ == null) { + tests_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + testsBuilder_.clear(); + } + nextPageToken_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.showcase.v1beta1.TestingOuterClass + .internal_static_google_showcase_v1beta1_ListTestsResponse_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.ListTestsResponse getDefaultInstanceForType() { + return com.google.showcase.v1beta1.ListTestsResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.ListTestsResponse build() { + com.google.showcase.v1beta1.ListTestsResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.ListTestsResponse buildPartial() { + com.google.showcase.v1beta1.ListTestsResponse result = + new com.google.showcase.v1beta1.ListTestsResponse(this); + int from_bitField0_ = bitField0_; + if (testsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + tests_ = java.util.Collections.unmodifiableList(tests_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.tests_ = tests_; + } else { + result.tests_ = testsBuilder_.build(); + } + result.nextPageToken_ = nextPageToken_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.showcase.v1beta1.ListTestsResponse) { + return mergeFrom((com.google.showcase.v1beta1.ListTestsResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.showcase.v1beta1.ListTestsResponse other) { + if (other == com.google.showcase.v1beta1.ListTestsResponse.getDefaultInstance()) return this; + if (testsBuilder_ == null) { + if (!other.tests_.isEmpty()) { + if (tests_.isEmpty()) { + tests_ = other.tests_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureTestsIsMutable(); + tests_.addAll(other.tests_); + } + onChanged(); + } + } else { + if (!other.tests_.isEmpty()) { + if (testsBuilder_.isEmpty()) { + testsBuilder_.dispose(); + testsBuilder_ = null; + tests_ = other.tests_; + bitField0_ = (bitField0_ & ~0x00000001); + testsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getTestsFieldBuilder() + : null; + } else { + testsBuilder_.addAllMessages(other.tests_); + } + } + } + if (!other.getNextPageToken().isEmpty()) { + nextPageToken_ = other.nextPageToken_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.showcase.v1beta1.ListTestsResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.showcase.v1beta1.ListTestsResponse) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.util.List tests_ = + java.util.Collections.emptyList(); + + private void ensureTestsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + tests_ = new java.util.ArrayList(tests_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.showcase.v1beta1.Test, + com.google.showcase.v1beta1.Test.Builder, + com.google.showcase.v1beta1.TestOrBuilder> + testsBuilder_; + + /** + * + * + *
        +     * The tests being returned.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Test tests = 1; + */ + public java.util.List getTestsList() { + if (testsBuilder_ == null) { + return java.util.Collections.unmodifiableList(tests_); + } else { + return testsBuilder_.getMessageList(); + } + } + + /** + * + * + *
        +     * The tests being returned.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Test tests = 1; + */ + public int getTestsCount() { + if (testsBuilder_ == null) { + return tests_.size(); + } else { + return testsBuilder_.getCount(); + } + } + + /** + * + * + *
        +     * The tests being returned.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Test tests = 1; + */ + public com.google.showcase.v1beta1.Test getTests(int index) { + if (testsBuilder_ == null) { + return tests_.get(index); + } else { + return testsBuilder_.getMessage(index); + } + } + + /** + * + * + *
        +     * The tests being returned.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Test tests = 1; + */ + public Builder setTests(int index, com.google.showcase.v1beta1.Test value) { + if (testsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureTestsIsMutable(); + tests_.set(index, value); + onChanged(); + } else { + testsBuilder_.setMessage(index, value); + } + return this; + } + + /** + * + * + *
        +     * The tests being returned.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Test tests = 1; + */ + public Builder setTests(int index, com.google.showcase.v1beta1.Test.Builder builderForValue) { + if (testsBuilder_ == null) { + ensureTestsIsMutable(); + tests_.set(index, builderForValue.build()); + onChanged(); + } else { + testsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
        +     * The tests being returned.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Test tests = 1; + */ + public Builder addTests(com.google.showcase.v1beta1.Test value) { + if (testsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureTestsIsMutable(); + tests_.add(value); + onChanged(); + } else { + testsBuilder_.addMessage(value); + } + return this; + } + + /** + * + * + *
        +     * The tests being returned.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Test tests = 1; + */ + public Builder addTests(int index, com.google.showcase.v1beta1.Test value) { + if (testsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureTestsIsMutable(); + tests_.add(index, value); + onChanged(); + } else { + testsBuilder_.addMessage(index, value); + } + return this; + } + + /** + * + * + *
        +     * The tests being returned.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Test tests = 1; + */ + public Builder addTests(com.google.showcase.v1beta1.Test.Builder builderForValue) { + if (testsBuilder_ == null) { + ensureTestsIsMutable(); + tests_.add(builderForValue.build()); + onChanged(); + } else { + testsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + + /** + * + * + *
        +     * The tests being returned.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Test tests = 1; + */ + public Builder addTests(int index, com.google.showcase.v1beta1.Test.Builder builderForValue) { + if (testsBuilder_ == null) { + ensureTestsIsMutable(); + tests_.add(index, builderForValue.build()); + onChanged(); + } else { + testsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
        +     * The tests being returned.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Test tests = 1; + */ + public Builder addAllTests( + java.lang.Iterable values) { + if (testsBuilder_ == null) { + ensureTestsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, tests_); + onChanged(); + } else { + testsBuilder_.addAllMessages(values); + } + return this; + } + + /** + * + * + *
        +     * The tests being returned.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Test tests = 1; + */ + public Builder clearTests() { + if (testsBuilder_ == null) { + tests_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + testsBuilder_.clear(); + } + return this; + } + + /** + * + * + *
        +     * The tests being returned.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Test tests = 1; + */ + public Builder removeTests(int index) { + if (testsBuilder_ == null) { + ensureTestsIsMutable(); + tests_.remove(index); + onChanged(); + } else { + testsBuilder_.remove(index); + } + return this; + } + + /** + * + * + *
        +     * The tests being returned.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Test tests = 1; + */ + public com.google.showcase.v1beta1.Test.Builder getTestsBuilder(int index) { + return getTestsFieldBuilder().getBuilder(index); + } + + /** + * + * + *
        +     * The tests being returned.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Test tests = 1; + */ + public com.google.showcase.v1beta1.TestOrBuilder getTestsOrBuilder(int index) { + if (testsBuilder_ == null) { + return tests_.get(index); + } else { + return testsBuilder_.getMessageOrBuilder(index); + } + } + + /** + * + * + *
        +     * The tests being returned.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Test tests = 1; + */ + public java.util.List + getTestsOrBuilderList() { + if (testsBuilder_ != null) { + return testsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(tests_); + } + } + + /** + * + * + *
        +     * The tests being returned.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Test tests = 1; + */ + public com.google.showcase.v1beta1.Test.Builder addTestsBuilder() { + return getTestsFieldBuilder() + .addBuilder(com.google.showcase.v1beta1.Test.getDefaultInstance()); + } + + /** + * + * + *
        +     * The tests being returned.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Test tests = 1; + */ + public com.google.showcase.v1beta1.Test.Builder addTestsBuilder(int index) { + return getTestsFieldBuilder() + .addBuilder(index, com.google.showcase.v1beta1.Test.getDefaultInstance()); + } + + /** + * + * + *
        +     * The tests being returned.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Test tests = 1; + */ + public java.util.List getTestsBuilderList() { + return getTestsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.showcase.v1beta1.Test, + com.google.showcase.v1beta1.Test.Builder, + com.google.showcase.v1beta1.TestOrBuilder> + getTestsFieldBuilder() { + if (testsBuilder_ == null) { + testsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.showcase.v1beta1.Test, + com.google.showcase.v1beta1.Test.Builder, + com.google.showcase.v1beta1.TestOrBuilder>( + tests_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + tests_ = null; + } + return testsBuilder_; + } + + private java.lang.Object nextPageToken_ = ""; + + /** + * + * + *
        +     * The next page token, if any.
        +     * An empty value here means the last page has been reached.
        +     * 
        + * + * 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; + } + } + + /** + * + * + *
        +     * The next page token, if any.
        +     * An empty value here means the last page has been reached.
        +     * 
        + * + * 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; + } + } + + /** + * + * + *
        +     * The next page token, if any.
        +     * An empty value here means the last page has been reached.
        +     * 
        + * + * string next_page_token = 2; + * + * @param value The nextPageToken to set. + * @return This builder for chaining. + */ + public Builder setNextPageToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + nextPageToken_ = value; + onChanged(); + return this; + } + + /** + * + * + *
        +     * The next page token, if any.
        +     * An empty value here means the last page has been reached.
        +     * 
        + * + * string next_page_token = 2; + * + * @return This builder for chaining. + */ + public Builder clearNextPageToken() { + + nextPageToken_ = getDefaultInstance().getNextPageToken(); + onChanged(); + return this; + } + + /** + * + * + *
        +     * The next page token, if any.
        +     * An empty value here means the last page has been reached.
        +     * 
        + * + * string next_page_token = 2; + * + * @param value The bytes for nextPageToken to set. + * @return This builder for chaining. + */ + public Builder setNextPageTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + nextPageToken_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.showcase.v1beta1.ListTestsResponse) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.ListTestsResponse) + private static final com.google.showcase.v1beta1.ListTestsResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.ListTestsResponse(); + } + + public static com.google.showcase.v1beta1.ListTestsResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListTestsResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ListTestsResponse(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.showcase.v1beta1.ListTestsResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListTestsResponseOrBuilder.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListTestsResponseOrBuilder.java new file mode 100644 index 0000000000..981c759a8c --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListTestsResponseOrBuilder.java @@ -0,0 +1,108 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/testing.proto + +package com.google.showcase.v1beta1; + +public interface ListTestsResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.ListTestsResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
        +   * The tests being returned.
        +   * 
        + * + * repeated .google.showcase.v1beta1.Test tests = 1; + */ + java.util.List getTestsList(); + + /** + * + * + *
        +   * The tests being returned.
        +   * 
        + * + * repeated .google.showcase.v1beta1.Test tests = 1; + */ + com.google.showcase.v1beta1.Test getTests(int index); + + /** + * + * + *
        +   * The tests being returned.
        +   * 
        + * + * repeated .google.showcase.v1beta1.Test tests = 1; + */ + int getTestsCount(); + + /** + * + * + *
        +   * The tests being returned.
        +   * 
        + * + * repeated .google.showcase.v1beta1.Test tests = 1; + */ + java.util.List getTestsOrBuilderList(); + + /** + * + * + *
        +   * The tests being returned.
        +   * 
        + * + * repeated .google.showcase.v1beta1.Test tests = 1; + */ + com.google.showcase.v1beta1.TestOrBuilder getTestsOrBuilder(int index); + + /** + * + * + *
        +   * The next page token, if any.
        +   * An empty value here means the last page has been reached.
        +   * 
        + * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + java.lang.String getNextPageToken(); + + /** + * + * + *
        +   * The next page token, if any.
        +   * An empty value here means the last page has been reached.
        +   * 
        + * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + com.google.protobuf.ByteString getNextPageTokenBytes(); +} diff --git a/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListUsersRequest.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListUsersRequest.java new file mode 100644 index 0000000000..c38a00dc07 --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListUsersRequest.java @@ -0,0 +1,759 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/identity.proto + +package com.google.showcase.v1beta1; + +/** + * + * + *
        + * The request message for the google.showcase.v1beta1.Identity\ListUsers
        + * method.
        + * 
        + * + * Protobuf type {@code google.showcase.v1beta1.ListUsersRequest} + */ +public final class ListUsersRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.ListUsersRequest) + ListUsersRequestOrBuilder { + private static final long serialVersionUID = 0L; + + // Use ListUsersRequest.newBuilder() to construct. + private ListUsersRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListUsersRequest() { + pageToken_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListUsersRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ListUsersRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: + { + pageSize_ = input.readInt32(); + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + pageToken_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.IdentityOuterClass + .internal_static_google_showcase_v1beta1_ListUsersRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.IdentityOuterClass + .internal_static_google_showcase_v1beta1_ListUsersRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.ListUsersRequest.class, + com.google.showcase.v1beta1.ListUsersRequest.Builder.class); + } + + public static final int PAGE_SIZE_FIELD_NUMBER = 1; + private int pageSize_; + + /** + * + * + *
        +   * The maximum number of users to return. Server may return fewer users
        +   * than requested. If unspecified, server will pick an appropriate default.
        +   * 
        + * + * int32 page_size = 1; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + + public static final int PAGE_TOKEN_FIELD_NUMBER = 2; + private volatile java.lang.Object pageToken_; + + /** + * + * + *
        +   * The value of google.showcase.v1beta1.ListUsersResponse.next_page_token
        +   * returned from the previous call to
        +   * `google.showcase.v1beta1.Identity\ListUsers` method.
        +   * 
        + * + * string page_token = 2; + * + * @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; + } + } + + /** + * + * + *
        +   * The value of google.showcase.v1beta1.ListUsersResponse.next_page_token
        +   * returned from the previous call to
        +   * `google.showcase.v1beta1.Identity\ListUsers` method.
        +   * 
        + * + * string page_token = 2; + * + * @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_); + } + unknownFields.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 += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.showcase.v1beta1.ListUsersRequest)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.ListUsersRequest other = + (com.google.showcase.v1beta1.ListUsersRequest) obj; + + if (getPageSize() != other.getPageSize()) return false; + if (!getPageToken().equals(other.getPageToken())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + PAGE_SIZE_FIELD_NUMBER; + hash = (53 * hash) + getPageSize(); + hash = (37 * hash) + PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getPageToken().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.showcase.v1beta1.ListUsersRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.ListUsersRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.ListUsersRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.ListUsersRequest 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.showcase.v1beta1.ListUsersRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.ListUsersRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.ListUsersRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.ListUsersRequest 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.showcase.v1beta1.ListUsersRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.ListUsersRequest 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.showcase.v1beta1.ListUsersRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.ListUsersRequest 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.showcase.v1beta1.ListUsersRequest 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 request message for the google.showcase.v1beta1.Identity\ListUsers
        +   * method.
        +   * 
        + * + * Protobuf type {@code google.showcase.v1beta1.ListUsersRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.ListUsersRequest) + com.google.showcase.v1beta1.ListUsersRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.IdentityOuterClass + .internal_static_google_showcase_v1beta1_ListUsersRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.IdentityOuterClass + .internal_static_google_showcase_v1beta1_ListUsersRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.ListUsersRequest.class, + com.google.showcase.v1beta1.ListUsersRequest.Builder.class); + } + + // Construct using com.google.showcase.v1beta1.ListUsersRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + pageSize_ = 0; + + pageToken_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.showcase.v1beta1.IdentityOuterClass + .internal_static_google_showcase_v1beta1_ListUsersRequest_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.ListUsersRequest getDefaultInstanceForType() { + return com.google.showcase.v1beta1.ListUsersRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.ListUsersRequest build() { + com.google.showcase.v1beta1.ListUsersRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.ListUsersRequest buildPartial() { + com.google.showcase.v1beta1.ListUsersRequest result = + new com.google.showcase.v1beta1.ListUsersRequest(this); + result.pageSize_ = pageSize_; + result.pageToken_ = pageToken_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.showcase.v1beta1.ListUsersRequest) { + return mergeFrom((com.google.showcase.v1beta1.ListUsersRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.showcase.v1beta1.ListUsersRequest other) { + if (other == com.google.showcase.v1beta1.ListUsersRequest.getDefaultInstance()) return this; + if (other.getPageSize() != 0) { + setPageSize(other.getPageSize()); + } + if (!other.getPageToken().isEmpty()) { + pageToken_ = other.pageToken_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.showcase.v1beta1.ListUsersRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.showcase.v1beta1.ListUsersRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int pageSize_; + + /** + * + * + *
        +     * The maximum number of users to return. Server may return fewer users
        +     * than requested. If unspecified, server will pick an appropriate default.
        +     * 
        + * + * int32 page_size = 1; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + + /** + * + * + *
        +     * The maximum number of users to return. Server may return fewer users
        +     * than requested. If unspecified, server will pick an appropriate default.
        +     * 
        + * + * int32 page_size = 1; + * + * @param value The pageSize to set. + * @return This builder for chaining. + */ + public Builder setPageSize(int value) { + + pageSize_ = value; + onChanged(); + return this; + } + + /** + * + * + *
        +     * The maximum number of users to return. Server may return fewer users
        +     * than requested. If unspecified, server will pick an appropriate default.
        +     * 
        + * + * int32 page_size = 1; + * + * @return This builder for chaining. + */ + public Builder clearPageSize() { + + pageSize_ = 0; + onChanged(); + return this; + } + + private java.lang.Object pageToken_ = ""; + + /** + * + * + *
        +     * The value of google.showcase.v1beta1.ListUsersResponse.next_page_token
        +     * returned from the previous call to
        +     * `google.showcase.v1beta1.Identity\ListUsers` method.
        +     * 
        + * + * string page_token = 2; + * + * @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; + } + } + + /** + * + * + *
        +     * The value of google.showcase.v1beta1.ListUsersResponse.next_page_token
        +     * returned from the previous call to
        +     * `google.showcase.v1beta1.Identity\ListUsers` method.
        +     * 
        + * + * string page_token = 2; + * + * @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; + } + } + + /** + * + * + *
        +     * The value of google.showcase.v1beta1.ListUsersResponse.next_page_token
        +     * returned from the previous call to
        +     * `google.showcase.v1beta1.Identity\ListUsers` method.
        +     * 
        + * + * string page_token = 2; + * + * @param value The pageToken to set. + * @return This builder for chaining. + */ + public Builder setPageToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + pageToken_ = value; + onChanged(); + return this; + } + + /** + * + * + *
        +     * The value of google.showcase.v1beta1.ListUsersResponse.next_page_token
        +     * returned from the previous call to
        +     * `google.showcase.v1beta1.Identity\ListUsers` method.
        +     * 
        + * + * string page_token = 2; + * + * @return This builder for chaining. + */ + public Builder clearPageToken() { + + pageToken_ = getDefaultInstance().getPageToken(); + onChanged(); + return this; + } + + /** + * + * + *
        +     * The value of google.showcase.v1beta1.ListUsersResponse.next_page_token
        +     * returned from the previous call to
        +     * `google.showcase.v1beta1.Identity\ListUsers` method.
        +     * 
        + * + * string page_token = 2; + * + * @param value The bytes for pageToken to set. + * @return This builder for chaining. + */ + public Builder setPageTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + pageToken_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.showcase.v1beta1.ListUsersRequest) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.ListUsersRequest) + private static final com.google.showcase.v1beta1.ListUsersRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.ListUsersRequest(); + } + + public static com.google.showcase.v1beta1.ListUsersRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListUsersRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ListUsersRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.showcase.v1beta1.ListUsersRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListUsersRequestOrBuilder.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListUsersRequestOrBuilder.java new file mode 100644 index 0000000000..bebb9a3b7b --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListUsersRequestOrBuilder.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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/identity.proto + +package com.google.showcase.v1beta1; + +public interface ListUsersRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.ListUsersRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
        +   * The maximum number of users to return. Server may return fewer users
        +   * than requested. If unspecified, server will pick an appropriate default.
        +   * 
        + * + * int32 page_size = 1; + * + * @return The pageSize. + */ + int getPageSize(); + + /** + * + * + *
        +   * The value of google.showcase.v1beta1.ListUsersResponse.next_page_token
        +   * returned from the previous call to
        +   * `google.showcase.v1beta1.Identity\ListUsers` method.
        +   * 
        + * + * string page_token = 2; + * + * @return The pageToken. + */ + java.lang.String getPageToken(); + + /** + * + * + *
        +   * The value of google.showcase.v1beta1.ListUsersResponse.next_page_token
        +   * returned from the previous call to
        +   * `google.showcase.v1beta1.Identity\ListUsers` method.
        +   * 
        + * + * string page_token = 2; + * + * @return The bytes for pageToken. + */ + com.google.protobuf.ByteString getPageTokenBytes(); +} diff --git a/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListUsersResponse.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListUsersResponse.java new file mode 100644 index 0000000000..b1dc9df720 --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListUsersResponse.java @@ -0,0 +1,1178 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/identity.proto + +package com.google.showcase.v1beta1; + +/** + * + * + *
        + * The response message for the google.showcase.v1beta1.Identity\ListUsers
        + * method.
        + * 
        + * + * Protobuf type {@code google.showcase.v1beta1.ListUsersResponse} + */ +public final class ListUsersResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.ListUsersResponse) + ListUsersResponseOrBuilder { + private static final long serialVersionUID = 0L; + + // Use ListUsersResponse.newBuilder() to construct. + private ListUsersResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListUsersResponse() { + users_ = java.util.Collections.emptyList(); + nextPageToken_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListUsersResponse(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ListUsersResponse( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + users_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + users_.add( + input.readMessage(com.google.showcase.v1beta1.User.parser(), extensionRegistry)); + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + nextPageToken_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + users_ = java.util.Collections.unmodifiableList(users_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.IdentityOuterClass + .internal_static_google_showcase_v1beta1_ListUsersResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.IdentityOuterClass + .internal_static_google_showcase_v1beta1_ListUsersResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.ListUsersResponse.class, + com.google.showcase.v1beta1.ListUsersResponse.Builder.class); + } + + public static final int USERS_FIELD_NUMBER = 1; + private java.util.List users_; + + /** + * + * + *
        +   * The list of users.
        +   * 
        + * + * repeated .google.showcase.v1beta1.User users = 1; + */ + @java.lang.Override + public java.util.List getUsersList() { + return users_; + } + + /** + * + * + *
        +   * The list of users.
        +   * 
        + * + * repeated .google.showcase.v1beta1.User users = 1; + */ + @java.lang.Override + public java.util.List + getUsersOrBuilderList() { + return users_; + } + + /** + * + * + *
        +   * The list of users.
        +   * 
        + * + * repeated .google.showcase.v1beta1.User users = 1; + */ + @java.lang.Override + public int getUsersCount() { + return users_.size(); + } + + /** + * + * + *
        +   * The list of users.
        +   * 
        + * + * repeated .google.showcase.v1beta1.User users = 1; + */ + @java.lang.Override + public com.google.showcase.v1beta1.User getUsers(int index) { + return users_.get(index); + } + + /** + * + * + *
        +   * The list of users.
        +   * 
        + * + * repeated .google.showcase.v1beta1.User users = 1; + */ + @java.lang.Override + public com.google.showcase.v1beta1.UserOrBuilder getUsersOrBuilder(int index) { + return users_.get(index); + } + + public static final int NEXT_PAGE_TOKEN_FIELD_NUMBER = 2; + private volatile java.lang.Object nextPageToken_; + + /** + * + * + *
        +   * A token to retrieve next page of results.
        +   * Pass this value in ListUsersRequest.page_token field in the subsequent
        +   * call to `google.showcase.v1beta1.Message\ListUsers` method to retrieve the
        +   * next page of results.
        +   * 
        + * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + @java.lang.Override + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nextPageToken_ = s; + return s; + } + } + + /** + * + * + *
        +   * A token to retrieve next page of results.
        +   * Pass this value in ListUsersRequest.page_token field in the subsequent
        +   * call to `google.showcase.v1beta1.Message\ListUsers` method to retrieve the
        +   * next page of results.
        +   * 
        + * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + nextPageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + for (int i = 0; i < users_.size(); i++) { + output.writeMessage(1, users_.get(i)); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nextPageToken_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, nextPageToken_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < users_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, users_.get(i)); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nextPageToken_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, nextPageToken_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.showcase.v1beta1.ListUsersResponse)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.ListUsersResponse other = + (com.google.showcase.v1beta1.ListUsersResponse) obj; + + if (!getUsersList().equals(other.getUsersList())) return false; + if (!getNextPageToken().equals(other.getNextPageToken())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getUsersCount() > 0) { + hash = (37 * hash) + USERS_FIELD_NUMBER; + hash = (53 * hash) + getUsersList().hashCode(); + } + hash = (37 * hash) + NEXT_PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getNextPageToken().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.showcase.v1beta1.ListUsersResponse parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.ListUsersResponse parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.ListUsersResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.ListUsersResponse 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.showcase.v1beta1.ListUsersResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.ListUsersResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.ListUsersResponse parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.ListUsersResponse 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.showcase.v1beta1.ListUsersResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.ListUsersResponse 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.showcase.v1beta1.ListUsersResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.ListUsersResponse 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.showcase.v1beta1.ListUsersResponse 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 message for the google.showcase.v1beta1.Identity\ListUsers
        +   * method.
        +   * 
        + * + * Protobuf type {@code google.showcase.v1beta1.ListUsersResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.ListUsersResponse) + com.google.showcase.v1beta1.ListUsersResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.IdentityOuterClass + .internal_static_google_showcase_v1beta1_ListUsersResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.IdentityOuterClass + .internal_static_google_showcase_v1beta1_ListUsersResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.ListUsersResponse.class, + com.google.showcase.v1beta1.ListUsersResponse.Builder.class); + } + + // Construct using com.google.showcase.v1beta1.ListUsersResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getUsersFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (usersBuilder_ == null) { + users_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + usersBuilder_.clear(); + } + nextPageToken_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.showcase.v1beta1.IdentityOuterClass + .internal_static_google_showcase_v1beta1_ListUsersResponse_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.ListUsersResponse getDefaultInstanceForType() { + return com.google.showcase.v1beta1.ListUsersResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.ListUsersResponse build() { + com.google.showcase.v1beta1.ListUsersResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.ListUsersResponse buildPartial() { + com.google.showcase.v1beta1.ListUsersResponse result = + new com.google.showcase.v1beta1.ListUsersResponse(this); + int from_bitField0_ = bitField0_; + if (usersBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + users_ = java.util.Collections.unmodifiableList(users_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.users_ = users_; + } else { + result.users_ = usersBuilder_.build(); + } + result.nextPageToken_ = nextPageToken_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.showcase.v1beta1.ListUsersResponse) { + return mergeFrom((com.google.showcase.v1beta1.ListUsersResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.showcase.v1beta1.ListUsersResponse other) { + if (other == com.google.showcase.v1beta1.ListUsersResponse.getDefaultInstance()) return this; + if (usersBuilder_ == null) { + if (!other.users_.isEmpty()) { + if (users_.isEmpty()) { + users_ = other.users_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureUsersIsMutable(); + users_.addAll(other.users_); + } + onChanged(); + } + } else { + if (!other.users_.isEmpty()) { + if (usersBuilder_.isEmpty()) { + usersBuilder_.dispose(); + usersBuilder_ = null; + users_ = other.users_; + bitField0_ = (bitField0_ & ~0x00000001); + usersBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getUsersFieldBuilder() + : null; + } else { + usersBuilder_.addAllMessages(other.users_); + } + } + } + if (!other.getNextPageToken().isEmpty()) { + nextPageToken_ = other.nextPageToken_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.showcase.v1beta1.ListUsersResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.showcase.v1beta1.ListUsersResponse) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.util.List users_ = + java.util.Collections.emptyList(); + + private void ensureUsersIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + users_ = new java.util.ArrayList(users_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.showcase.v1beta1.User, + com.google.showcase.v1beta1.User.Builder, + com.google.showcase.v1beta1.UserOrBuilder> + usersBuilder_; + + /** + * + * + *
        +     * The list of users.
        +     * 
        + * + * repeated .google.showcase.v1beta1.User users = 1; + */ + public java.util.List getUsersList() { + if (usersBuilder_ == null) { + return java.util.Collections.unmodifiableList(users_); + } else { + return usersBuilder_.getMessageList(); + } + } + + /** + * + * + *
        +     * The list of users.
        +     * 
        + * + * repeated .google.showcase.v1beta1.User users = 1; + */ + public int getUsersCount() { + if (usersBuilder_ == null) { + return users_.size(); + } else { + return usersBuilder_.getCount(); + } + } + + /** + * + * + *
        +     * The list of users.
        +     * 
        + * + * repeated .google.showcase.v1beta1.User users = 1; + */ + public com.google.showcase.v1beta1.User getUsers(int index) { + if (usersBuilder_ == null) { + return users_.get(index); + } else { + return usersBuilder_.getMessage(index); + } + } + + /** + * + * + *
        +     * The list of users.
        +     * 
        + * + * repeated .google.showcase.v1beta1.User users = 1; + */ + public Builder setUsers(int index, com.google.showcase.v1beta1.User value) { + if (usersBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureUsersIsMutable(); + users_.set(index, value); + onChanged(); + } else { + usersBuilder_.setMessage(index, value); + } + return this; + } + + /** + * + * + *
        +     * The list of users.
        +     * 
        + * + * repeated .google.showcase.v1beta1.User users = 1; + */ + public Builder setUsers(int index, com.google.showcase.v1beta1.User.Builder builderForValue) { + if (usersBuilder_ == null) { + ensureUsersIsMutable(); + users_.set(index, builderForValue.build()); + onChanged(); + } else { + usersBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
        +     * The list of users.
        +     * 
        + * + * repeated .google.showcase.v1beta1.User users = 1; + */ + public Builder addUsers(com.google.showcase.v1beta1.User value) { + if (usersBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureUsersIsMutable(); + users_.add(value); + onChanged(); + } else { + usersBuilder_.addMessage(value); + } + return this; + } + + /** + * + * + *
        +     * The list of users.
        +     * 
        + * + * repeated .google.showcase.v1beta1.User users = 1; + */ + public Builder addUsers(int index, com.google.showcase.v1beta1.User value) { + if (usersBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureUsersIsMutable(); + users_.add(index, value); + onChanged(); + } else { + usersBuilder_.addMessage(index, value); + } + return this; + } + + /** + * + * + *
        +     * The list of users.
        +     * 
        + * + * repeated .google.showcase.v1beta1.User users = 1; + */ + public Builder addUsers(com.google.showcase.v1beta1.User.Builder builderForValue) { + if (usersBuilder_ == null) { + ensureUsersIsMutable(); + users_.add(builderForValue.build()); + onChanged(); + } else { + usersBuilder_.addMessage(builderForValue.build()); + } + return this; + } + + /** + * + * + *
        +     * The list of users.
        +     * 
        + * + * repeated .google.showcase.v1beta1.User users = 1; + */ + public Builder addUsers(int index, com.google.showcase.v1beta1.User.Builder builderForValue) { + if (usersBuilder_ == null) { + ensureUsersIsMutable(); + users_.add(index, builderForValue.build()); + onChanged(); + } else { + usersBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
        +     * The list of users.
        +     * 
        + * + * repeated .google.showcase.v1beta1.User users = 1; + */ + public Builder addAllUsers( + java.lang.Iterable values) { + if (usersBuilder_ == null) { + ensureUsersIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, users_); + onChanged(); + } else { + usersBuilder_.addAllMessages(values); + } + return this; + } + + /** + * + * + *
        +     * The list of users.
        +     * 
        + * + * repeated .google.showcase.v1beta1.User users = 1; + */ + public Builder clearUsers() { + if (usersBuilder_ == null) { + users_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + usersBuilder_.clear(); + } + return this; + } + + /** + * + * + *
        +     * The list of users.
        +     * 
        + * + * repeated .google.showcase.v1beta1.User users = 1; + */ + public Builder removeUsers(int index) { + if (usersBuilder_ == null) { + ensureUsersIsMutable(); + users_.remove(index); + onChanged(); + } else { + usersBuilder_.remove(index); + } + return this; + } + + /** + * + * + *
        +     * The list of users.
        +     * 
        + * + * repeated .google.showcase.v1beta1.User users = 1; + */ + public com.google.showcase.v1beta1.User.Builder getUsersBuilder(int index) { + return getUsersFieldBuilder().getBuilder(index); + } + + /** + * + * + *
        +     * The list of users.
        +     * 
        + * + * repeated .google.showcase.v1beta1.User users = 1; + */ + public com.google.showcase.v1beta1.UserOrBuilder getUsersOrBuilder(int index) { + if (usersBuilder_ == null) { + return users_.get(index); + } else { + return usersBuilder_.getMessageOrBuilder(index); + } + } + + /** + * + * + *
        +     * The list of users.
        +     * 
        + * + * repeated .google.showcase.v1beta1.User users = 1; + */ + public java.util.List + getUsersOrBuilderList() { + if (usersBuilder_ != null) { + return usersBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(users_); + } + } + + /** + * + * + *
        +     * The list of users.
        +     * 
        + * + * repeated .google.showcase.v1beta1.User users = 1; + */ + public com.google.showcase.v1beta1.User.Builder addUsersBuilder() { + return getUsersFieldBuilder() + .addBuilder(com.google.showcase.v1beta1.User.getDefaultInstance()); + } + + /** + * + * + *
        +     * The list of users.
        +     * 
        + * + * repeated .google.showcase.v1beta1.User users = 1; + */ + public com.google.showcase.v1beta1.User.Builder addUsersBuilder(int index) { + return getUsersFieldBuilder() + .addBuilder(index, com.google.showcase.v1beta1.User.getDefaultInstance()); + } + + /** + * + * + *
        +     * The list of users.
        +     * 
        + * + * repeated .google.showcase.v1beta1.User users = 1; + */ + public java.util.List getUsersBuilderList() { + return getUsersFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.showcase.v1beta1.User, + com.google.showcase.v1beta1.User.Builder, + com.google.showcase.v1beta1.UserOrBuilder> + getUsersFieldBuilder() { + if (usersBuilder_ == null) { + usersBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.showcase.v1beta1.User, + com.google.showcase.v1beta1.User.Builder, + com.google.showcase.v1beta1.UserOrBuilder>( + users_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + users_ = null; + } + return usersBuilder_; + } + + private java.lang.Object nextPageToken_ = ""; + + /** + * + * + *
        +     * A token to retrieve next page of results.
        +     * Pass this value in ListUsersRequest.page_token field in the subsequent
        +     * call to `google.showcase.v1beta1.Message\ListUsers` method to retrieve the
        +     * next page of results.
        +     * 
        + * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nextPageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
        +     * A token to retrieve next page of results.
        +     * Pass this value in ListUsersRequest.page_token field in the subsequent
        +     * call to `google.showcase.v1beta1.Message\ListUsers` method to retrieve the
        +     * next page of results.
        +     * 
        + * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + public com.google.protobuf.ByteString getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + nextPageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
        +     * A token to retrieve next page of results.
        +     * Pass this value in ListUsersRequest.page_token field in the subsequent
        +     * call to `google.showcase.v1beta1.Message\ListUsers` method to retrieve the
        +     * next page of results.
        +     * 
        + * + * string next_page_token = 2; + * + * @param value The nextPageToken to set. + * @return This builder for chaining. + */ + public Builder setNextPageToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + nextPageToken_ = value; + onChanged(); + return this; + } + + /** + * + * + *
        +     * A token to retrieve next page of results.
        +     * Pass this value in ListUsersRequest.page_token field in the subsequent
        +     * call to `google.showcase.v1beta1.Message\ListUsers` method to retrieve the
        +     * next page of results.
        +     * 
        + * + * string next_page_token = 2; + * + * @return This builder for chaining. + */ + public Builder clearNextPageToken() { + + nextPageToken_ = getDefaultInstance().getNextPageToken(); + onChanged(); + return this; + } + + /** + * + * + *
        +     * A token to retrieve next page of results.
        +     * Pass this value in ListUsersRequest.page_token field in the subsequent
        +     * call to `google.showcase.v1beta1.Message\ListUsers` method to retrieve the
        +     * next page of results.
        +     * 
        + * + * string next_page_token = 2; + * + * @param value The bytes for nextPageToken to set. + * @return This builder for chaining. + */ + public Builder setNextPageTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + nextPageToken_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.showcase.v1beta1.ListUsersResponse) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.ListUsersResponse) + private static final com.google.showcase.v1beta1.ListUsersResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.ListUsersResponse(); + } + + public static com.google.showcase.v1beta1.ListUsersResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListUsersResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ListUsersResponse(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.showcase.v1beta1.ListUsersResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListUsersResponseOrBuilder.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListUsersResponseOrBuilder.java new file mode 100644 index 0000000000..ddcf85b023 --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListUsersResponseOrBuilder.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: schema/google/showcase/v1beta1/identity.proto + +package com.google.showcase.v1beta1; + +public interface ListUsersResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.ListUsersResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
        +   * The list of users.
        +   * 
        + * + * repeated .google.showcase.v1beta1.User users = 1; + */ + java.util.List getUsersList(); + + /** + * + * + *
        +   * The list of users.
        +   * 
        + * + * repeated .google.showcase.v1beta1.User users = 1; + */ + com.google.showcase.v1beta1.User getUsers(int index); + + /** + * + * + *
        +   * The list of users.
        +   * 
        + * + * repeated .google.showcase.v1beta1.User users = 1; + */ + int getUsersCount(); + + /** + * + * + *
        +   * The list of users.
        +   * 
        + * + * repeated .google.showcase.v1beta1.User users = 1; + */ + java.util.List getUsersOrBuilderList(); + + /** + * + * + *
        +   * The list of users.
        +   * 
        + * + * repeated .google.showcase.v1beta1.User users = 1; + */ + com.google.showcase.v1beta1.UserOrBuilder getUsersOrBuilder(int index); + + /** + * + * + *
        +   * A token to retrieve next page of results.
        +   * Pass this value in ListUsersRequest.page_token field in the subsequent
        +   * call to `google.showcase.v1beta1.Message\ListUsers` method to retrieve the
        +   * next page of results.
        +   * 
        + * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + java.lang.String getNextPageToken(); + + /** + * + * + *
        +   * A token to retrieve next page of results.
        +   * Pass this value in ListUsersRequest.page_token field in the subsequent
        +   * call to `google.showcase.v1beta1.Message\ListUsers` method to retrieve the
        +   * next page of results.
        +   * 
        + * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + com.google.protobuf.ByteString getNextPageTokenBytes(); +} diff --git a/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/MessagingOuterClass.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/MessagingOuterClass.java new file mode 100644 index 0000000000..5f48a7ca5a --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/MessagingOuterClass.java @@ -0,0 +1,492 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/messaging.proto + +package com.google.showcase.v1beta1; + +public final class MessagingOuterClass { + private MessagingOuterClass() {} + + 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_showcase_v1beta1_Room_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_showcase_v1beta1_Room_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_showcase_v1beta1_CreateRoomRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_showcase_v1beta1_CreateRoomRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_showcase_v1beta1_GetRoomRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_showcase_v1beta1_GetRoomRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_showcase_v1beta1_UpdateRoomRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_showcase_v1beta1_UpdateRoomRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_showcase_v1beta1_DeleteRoomRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_showcase_v1beta1_DeleteRoomRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_showcase_v1beta1_ListRoomsRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_showcase_v1beta1_ListRoomsRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_showcase_v1beta1_ListRoomsResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_showcase_v1beta1_ListRoomsResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_showcase_v1beta1_Blurb_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_showcase_v1beta1_Blurb_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_showcase_v1beta1_CreateBlurbRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_showcase_v1beta1_CreateBlurbRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_showcase_v1beta1_GetBlurbRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_showcase_v1beta1_GetBlurbRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_showcase_v1beta1_UpdateBlurbRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_showcase_v1beta1_UpdateBlurbRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_showcase_v1beta1_DeleteBlurbRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_showcase_v1beta1_DeleteBlurbRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_showcase_v1beta1_ListBlurbsRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_showcase_v1beta1_ListBlurbsRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_showcase_v1beta1_ListBlurbsResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_showcase_v1beta1_ListBlurbsResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_showcase_v1beta1_SearchBlurbsRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_showcase_v1beta1_SearchBlurbsRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_showcase_v1beta1_SearchBlurbsMetadata_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_showcase_v1beta1_SearchBlurbsMetadata_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_showcase_v1beta1_SearchBlurbsResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_showcase_v1beta1_SearchBlurbsResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_showcase_v1beta1_StreamBlurbsRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_showcase_v1beta1_StreamBlurbsRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_showcase_v1beta1_StreamBlurbsResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_showcase_v1beta1_StreamBlurbsResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_showcase_v1beta1_SendBlurbsResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_showcase_v1beta1_SendBlurbsResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_showcase_v1beta1_ConnectRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_showcase_v1beta1_ConnectRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_showcase_v1beta1_ConnectRequest_ConnectConfig_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_showcase_v1beta1_ConnectRequest_ConnectConfig_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.schema/google/showcase/v1beta1/messagi" + + "ng.proto\022\027google.showcase.v1beta1\032\034googl" + + "e/api/annotations.proto\032\027google/api/clie" + + "nt.proto\032\037google/api/field_behavior.prot" + + "o\032\031google/api/resource.proto\032#google/lon" + + "grunning/operations.proto\032\033google/protob" + + "uf/empty.proto\032 google/protobuf/field_ma" + + "sk.proto\032\037google/protobuf/timestamp.prot" + + "o\032\036google/rpc/error_details.proto\"\341\001\n\004Ro" + + "om\022\014\n\004name\030\001 \001(\t\022\031\n\014display_name\030\002 \001(\tB\003" + + "\340A\002\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.Ti" + + "mestampB\003\340A\003:/\352A,\n\034showcase.googleapis.c" + + "om/Room\022\014rooms/{room}\"@\n\021CreateRoomReque" + + "st\022+\n\004room\030\001 \001(\0132\035.google.showcase.v1bet" + + "a1.Room\"D\n\016GetRoomRequest\0222\n\004name\030\001 \001(\tB" + + "$\372A\036\n\034showcase.googleapis.com/Room\340A\002\"q\n" + + "\021UpdateRoomRequest\022+\n\004room\030\001 \001(\0132\035.googl" + + "e.showcase.v1beta1.Room\022/\n\013update_mask\030\002" + + " \001(\0132\032.google.protobuf.FieldMask\"G\n\021Dele" + + "teRoomRequest\0222\n\004name\030\001 \001(\tB$\372A\036\n\034showca" + + "se.googleapis.com/Room\340A\002\"9\n\020ListRoomsRe" + + "quest\022\021\n\tpage_size\030\001 \001(\005\022\022\n\npage_token\030\002" + + " \001(\t\"Z\n\021ListRoomsResponse\022,\n\005rooms\030\001 \003(\013" + + "2\035.google.showcase.v1beta1.Room\022\027\n\017next_" + + "page_token\030\002 \001(\t\"\366\003\n\005Blurb\022\014\n\004name\030\001 \001(\t" + + "\0222\n\004user\030\002 \001(\tB$\372A\036\n\034showcase.googleapis" + + ".com/User\340A\002\022\016\n\004text\030\003 \001(\tH\000\022\017\n\005image\030\004 " + + "\001(\014H\000\0224\n\013create_time\030\005 \001(\0132\032.google.prot" + + "obuf.TimestampB\003\340A\003\0224\n\013update_time\030\006 \001(\013" + + "2\032.google.protobuf.TimestampB\003\340A\003\022\030\n\016leg" + + "acy_room_id\030\007 \001(\tH\001\022\030\n\016legacy_user_id\030\010 " + + "\001(\tH\001:\321\001\352A\315\001\n\035showcase.googleapis.com/Bl" + + "urb\0228users/{user}/profile/blurbs/legacy/" + + "{legacy_user}~{blurb}\022#users/{user}/prof" + + "ile/blurbs/{blurb}\022\033rooms/{room}/blurbs/" + + "{blurb}\0220rooms/{room}/blurbs/legacy/{leg" + + "acy_room}.{blurb}B\t\n\007contentB\013\n\tlegacy_i" + + "d\"z\n\022CreateBlurbRequest\0225\n\006parent\030\001 \001(\tB" + + "%\372A\037\022\035showcase.googleapis.com/Blurb\340A\002\022-" + + "\n\005blurb\030\002 \001(\0132\036.google.showcase.v1beta1." + + "Blurb\"F\n\017GetBlurbRequest\0223\n\004name\030\001 \001(\tB%" + + "\372A\037\n\035showcase.googleapis.com/Blurb\340A\002\"t\n" + + "\022UpdateBlurbRequest\022-\n\005blurb\030\001 \001(\0132\036.goo" + + "gle.showcase.v1beta1.Blurb\022/\n\013update_mas" + + "k\030\002 \001(\0132\032.google.protobuf.FieldMask\"I\n\022D" + + "eleteBlurbRequest\0223\n\004name\030\001 \001(\tB%\372A\037\n\035sh" + + "owcase.googleapis.com/Blurb\340A\002\"q\n\021ListBl" + + "urbsRequest\0225\n\006parent\030\001 \001(\tB%\372A\037\022\035showca" + + "se.googleapis.com/Blurb\340A\002\022\021\n\tpage_size\030" + + "\002 \001(\005\022\022\n\npage_token\030\003 \001(\t\"]\n\022ListBlurbsR" + + "esponse\022.\n\006blurbs\030\001 \003(\0132\036.google.showcas" + + "e.v1beta1.Blurb\022\027\n\017next_page_token\030\002 \001(\t" + + "\"\204\001\n\023SearchBlurbsRequest\022\022\n\005query\030\001 \001(\tB" + + "\003\340A\002\0222\n\006parent\030\002 \001(\tB\"\372A\037\022\035showcase.goog" + + "leapis.com/Blurb\022\021\n\tpage_size\030\003 \001(\005\022\022\n\np" + + "age_token\030\004 \001(\t\"A\n\024SearchBlurbsMetadata\022" + + ")\n\nretry_info\030\001 \001(\0132\025.google.rpc.RetryIn" + + "fo\"_\n\024SearchBlurbsResponse\022.\n\006blurbs\030\001 \003" + + "(\0132\036.google.showcase.v1beta1.Blurb\022\027\n\017ne" + + "xt_page_token\030\002 \001(\t\"\200\001\n\023StreamBlurbsRequ" + + "est\0223\n\004name\030\001 \001(\tB%\372A\037\022\035showcase.googlea" + + "pis.com/Blurb\340A\002\0224\n\013expire_time\030\002 \001(\0132\032." + + "google.protobuf.TimestampB\003\340A\002\"\321\001\n\024Strea" + + "mBlurbsResponse\022-\n\005blurb\030\001 \001(\0132\036.google." + + "showcase.v1beta1.Blurb\022D\n\006action\030\002 \001(\01624" + + ".google.showcase.v1beta1.StreamBlurbsRes" + + "ponse.Action\"D\n\006Action\022\026\n\022ACTION_UNSPECI" + + "FIED\020\000\022\n\n\006CREATE\020\001\022\n\n\006UPDATE\020\002\022\n\n\006DELETE" + + "\020\003\"#\n\022SendBlurbsResponse\022\r\n\005names\030\001 \003(\t\"" + + "\332\001\n\016ConnectRequest\022G\n\006config\030\001 \001(\01325.goo" + + "gle.showcase.v1beta1.ConnectRequest.Conn" + + "ectConfigH\000\022/\n\005blurb\030\002 \001(\0132\036.google.show" + + "case.v1beta1.BlurbH\000\032C\n\rConnectConfig\0222\n" + + "\006parent\030\001 \001(\tB\"\372A\037\022\035showcase.googleapis." + + "com/BlurbB\t\n\007request2\264\023\n\tMessaging\022\227\001\n\nC" + + "reateRoom\022*.google.showcase.v1beta1.Crea" + + "teRoomRequest\032\035.google.showcase.v1beta1." + + "Room\">\202\323\344\223\002\023\"\016/v1beta1/rooms:\001*\332A\"room.d" + + "isplay_name,room.description\022y\n\007GetRoom\022" + + "\'.google.showcase.v1beta1.GetRoomRequest" + + "\032\035.google.showcase.v1beta1.Room\"&\202\323\344\223\002\031\022" + + "\027/v1beta1/{name=rooms/*}\332A\004name\022\203\001\n\nUpda" + + "teRoom\022*.google.showcase.v1beta1.UpdateR" + + "oomRequest\032\035.google.showcase.v1beta1.Roo" + + "m\"*\202\323\344\223\002$2\034/v1beta1/{room.name=rooms/*}:" + + "\004room\022x\n\nDeleteRoom\022*.google.showcase.v1" + + "beta1.DeleteRoomRequest\032\026.google.protobu" + + "f.Empty\"&\202\323\344\223\002\031*\027/v1beta1/{name=rooms/*}" + + "\332A\004name\022z\n\tListRooms\022).google.showcase.v" + + "1beta1.ListRoomsRequest\032*.google.showcas" + + "e.v1beta1.ListRoomsResponse\"\026\202\323\344\223\002\020\022\016/v1" + + "beta1/rooms\022\366\001\n\013CreateBlurb\022+.google.sho" + + "wcase.v1beta1.CreateBlurbRequest\032\036.googl" + + "e.showcase.v1beta1.Blurb\"\231\001\202\323\344\223\002T\" /v1be" + + "ta1/{parent=rooms/*}/blurbs:\001*Z-\"(/v1bet" + + "a1/{parent=users/*/profile}/blurbs:\001*\332A\034" + + "parent,blurb.user,blurb.text\332A\035parent,bl" + + "urb.user,blurb.image\022\261\001\n\010GetBlurb\022(.goog" + + "le.showcase.v1beta1.GetBlurbRequest\032\036.go" + + "ogle.showcase.v1beta1.Blurb\"[\202\323\344\223\002N\022 /v1" + + "beta1/{name=rooms/*/blurbs/*}Z*\022(/v1beta" + + "1/{name=users/*/profile/blurbs/*}\332A\004name" + + "\022\312\001\n\013UpdateBlurb\022+.google.showcase.v1bet" + + "a1.UpdateBlurbRequest\032\036.google.showcase." + + "v1beta1.Blurb\"n\202\323\344\223\002h2&/v1beta1/{blurb.n" + + "ame=rooms/*/blurbs/*}:\005blurbZ72./v1beta1" + + "/{blurb.name=users/*/profile/blurbs/*}:\005" + + "blurb\022\257\001\n\013DeleteBlurb\022+.google.showcase." + + "v1beta1.DeleteBlurbRequest\032\026.google.prot" + + "obuf.Empty\"[\202\323\344\223\002N* /v1beta1/{name=rooms" + + "/*/blurbs/*}Z**(/v1beta1/{name=users/*/p" + + "rofile/blurbs/*}\332A\004name\022\304\001\n\nListBlurbs\022*" + + ".google.showcase.v1beta1.ListBlurbsReque" + + "st\032+.google.showcase.v1beta1.ListBlurbsR" + + "esponse\"]\202\323\344\223\002N\022 /v1beta1/{parent=rooms/" + + "*}/blurbsZ*\022(/v1beta1/{parent=users/*/pr" + + "ofile}/blurbs\332A\006parent\022\201\002\n\014SearchBlurbs\022" + + ",.google.showcase.v1beta1.SearchBlurbsRe" + + "quest\032\035.google.longrunning.Operation\"\243\001\202" + + "\323\344\223\002_\"\'/v1beta1/{parent=rooms/*}/blurbs:" + + "search:\001*Z1\"//v1beta1/{parent=users/*/pr" + + "ofile}/blurbs:search\312A,\n\024SearchBlurbsRes" + + "ponse\022\024SearchBlurbsMetadata\332A\014parent,que" + + "ry\022\323\001\n\014StreamBlurbs\022,.google.showcase.v1" + + "beta1.StreamBlurbsRequest\032-.google.showc" + + "ase.v1beta1.StreamBlurbsResponse\"d\202\323\344\223\002^" + + "\"%/v1beta1/{name=rooms/*}/blurbs:stream:" + + "\001*Z2\"-/v1beta1/{name=users/*/profile}/bl" + + "urbs:stream:\001*0\001\022\316\001\n\nSendBlurbs\022+.google" + + ".showcase.v1beta1.CreateBlurbRequest\032+.g" + + "oogle.showcase.v1beta1.SendBlurbsRespons" + + "e\"d\202\323\344\223\002^\"%/v1beta1/{parent=rooms/*}/blu" + + "rbs:send:\001*Z2\"-/v1beta1/{parent=users/*/" + + "profile}/blurbs:send:\001*(\001\022e\n\007Connect\022\'.g" + + "oogle.showcase.v1beta1.ConnectRequest\032-." + + "google.showcase.v1beta1.StreamBlurbsResp" + + "onse(\0010\001\032\021\312A\016localhost:7469Bq\n\033com.googl" + + "e.showcase.v1beta1P\001Z4github.com/googlea" + + "pis/gapic-showcase/server/genproto\352\002\031Goo" + + "gle::Showcase::V1beta1b\006proto3" + }; + descriptor = + com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( + descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + com.google.api.AnnotationsProto.getDescriptor(), + com.google.api.ClientProto.getDescriptor(), + com.google.api.FieldBehaviorProto.getDescriptor(), + com.google.api.ResourceProto.getDescriptor(), + com.google.longrunning.OperationsProto.getDescriptor(), + com.google.protobuf.EmptyProto.getDescriptor(), + com.google.protobuf.FieldMaskProto.getDescriptor(), + com.google.protobuf.TimestampProto.getDescriptor(), + com.google.rpc.ErrorDetailsProto.getDescriptor(), + }); + internal_static_google_showcase_v1beta1_Room_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_showcase_v1beta1_Room_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_showcase_v1beta1_Room_descriptor, + new java.lang.String[] { + "Name", "DisplayName", "Description", "CreateTime", "UpdateTime", + }); + internal_static_google_showcase_v1beta1_CreateRoomRequest_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_google_showcase_v1beta1_CreateRoomRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_showcase_v1beta1_CreateRoomRequest_descriptor, + new java.lang.String[] { + "Room", + }); + internal_static_google_showcase_v1beta1_GetRoomRequest_descriptor = + getDescriptor().getMessageTypes().get(2); + internal_static_google_showcase_v1beta1_GetRoomRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_showcase_v1beta1_GetRoomRequest_descriptor, + new java.lang.String[] { + "Name", + }); + internal_static_google_showcase_v1beta1_UpdateRoomRequest_descriptor = + getDescriptor().getMessageTypes().get(3); + internal_static_google_showcase_v1beta1_UpdateRoomRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_showcase_v1beta1_UpdateRoomRequest_descriptor, + new java.lang.String[] { + "Room", "UpdateMask", + }); + internal_static_google_showcase_v1beta1_DeleteRoomRequest_descriptor = + getDescriptor().getMessageTypes().get(4); + internal_static_google_showcase_v1beta1_DeleteRoomRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_showcase_v1beta1_DeleteRoomRequest_descriptor, + new java.lang.String[] { + "Name", + }); + internal_static_google_showcase_v1beta1_ListRoomsRequest_descriptor = + getDescriptor().getMessageTypes().get(5); + internal_static_google_showcase_v1beta1_ListRoomsRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_showcase_v1beta1_ListRoomsRequest_descriptor, + new java.lang.String[] { + "PageSize", "PageToken", + }); + internal_static_google_showcase_v1beta1_ListRoomsResponse_descriptor = + getDescriptor().getMessageTypes().get(6); + internal_static_google_showcase_v1beta1_ListRoomsResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_showcase_v1beta1_ListRoomsResponse_descriptor, + new java.lang.String[] { + "Rooms", "NextPageToken", + }); + internal_static_google_showcase_v1beta1_Blurb_descriptor = + getDescriptor().getMessageTypes().get(7); + internal_static_google_showcase_v1beta1_Blurb_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_showcase_v1beta1_Blurb_descriptor, + new java.lang.String[] { + "Name", + "User", + "Text", + "Image", + "CreateTime", + "UpdateTime", + "LegacyRoomId", + "LegacyUserId", + "Content", + "LegacyId", + }); + internal_static_google_showcase_v1beta1_CreateBlurbRequest_descriptor = + getDescriptor().getMessageTypes().get(8); + internal_static_google_showcase_v1beta1_CreateBlurbRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_showcase_v1beta1_CreateBlurbRequest_descriptor, + new java.lang.String[] { + "Parent", "Blurb", + }); + internal_static_google_showcase_v1beta1_GetBlurbRequest_descriptor = + getDescriptor().getMessageTypes().get(9); + internal_static_google_showcase_v1beta1_GetBlurbRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_showcase_v1beta1_GetBlurbRequest_descriptor, + new java.lang.String[] { + "Name", + }); + internal_static_google_showcase_v1beta1_UpdateBlurbRequest_descriptor = + getDescriptor().getMessageTypes().get(10); + internal_static_google_showcase_v1beta1_UpdateBlurbRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_showcase_v1beta1_UpdateBlurbRequest_descriptor, + new java.lang.String[] { + "Blurb", "UpdateMask", + }); + internal_static_google_showcase_v1beta1_DeleteBlurbRequest_descriptor = + getDescriptor().getMessageTypes().get(11); + internal_static_google_showcase_v1beta1_DeleteBlurbRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_showcase_v1beta1_DeleteBlurbRequest_descriptor, + new java.lang.String[] { + "Name", + }); + internal_static_google_showcase_v1beta1_ListBlurbsRequest_descriptor = + getDescriptor().getMessageTypes().get(12); + internal_static_google_showcase_v1beta1_ListBlurbsRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_showcase_v1beta1_ListBlurbsRequest_descriptor, + new java.lang.String[] { + "Parent", "PageSize", "PageToken", + }); + internal_static_google_showcase_v1beta1_ListBlurbsResponse_descriptor = + getDescriptor().getMessageTypes().get(13); + internal_static_google_showcase_v1beta1_ListBlurbsResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_showcase_v1beta1_ListBlurbsResponse_descriptor, + new java.lang.String[] { + "Blurbs", "NextPageToken", + }); + internal_static_google_showcase_v1beta1_SearchBlurbsRequest_descriptor = + getDescriptor().getMessageTypes().get(14); + internal_static_google_showcase_v1beta1_SearchBlurbsRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_showcase_v1beta1_SearchBlurbsRequest_descriptor, + new java.lang.String[] { + "Query", "Parent", "PageSize", "PageToken", + }); + internal_static_google_showcase_v1beta1_SearchBlurbsMetadata_descriptor = + getDescriptor().getMessageTypes().get(15); + internal_static_google_showcase_v1beta1_SearchBlurbsMetadata_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_showcase_v1beta1_SearchBlurbsMetadata_descriptor, + new java.lang.String[] { + "RetryInfo", + }); + internal_static_google_showcase_v1beta1_SearchBlurbsResponse_descriptor = + getDescriptor().getMessageTypes().get(16); + internal_static_google_showcase_v1beta1_SearchBlurbsResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_showcase_v1beta1_SearchBlurbsResponse_descriptor, + new java.lang.String[] { + "Blurbs", "NextPageToken", + }); + internal_static_google_showcase_v1beta1_StreamBlurbsRequest_descriptor = + getDescriptor().getMessageTypes().get(17); + internal_static_google_showcase_v1beta1_StreamBlurbsRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_showcase_v1beta1_StreamBlurbsRequest_descriptor, + new java.lang.String[] { + "Name", "ExpireTime", + }); + internal_static_google_showcase_v1beta1_StreamBlurbsResponse_descriptor = + getDescriptor().getMessageTypes().get(18); + internal_static_google_showcase_v1beta1_StreamBlurbsResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_showcase_v1beta1_StreamBlurbsResponse_descriptor, + new java.lang.String[] { + "Blurb", "Action", + }); + internal_static_google_showcase_v1beta1_SendBlurbsResponse_descriptor = + getDescriptor().getMessageTypes().get(19); + internal_static_google_showcase_v1beta1_SendBlurbsResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_showcase_v1beta1_SendBlurbsResponse_descriptor, + new java.lang.String[] { + "Names", + }); + internal_static_google_showcase_v1beta1_ConnectRequest_descriptor = + getDescriptor().getMessageTypes().get(20); + internal_static_google_showcase_v1beta1_ConnectRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_showcase_v1beta1_ConnectRequest_descriptor, + new java.lang.String[] { + "Config", "Blurb", "Request", + }); + internal_static_google_showcase_v1beta1_ConnectRequest_ConnectConfig_descriptor = + internal_static_google_showcase_v1beta1_ConnectRequest_descriptor.getNestedTypes().get(0); + internal_static_google_showcase_v1beta1_ConnectRequest_ConnectConfig_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_showcase_v1beta1_ConnectRequest_ConnectConfig_descriptor, + new java.lang.String[] { + "Parent", + }); + 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.ResourceProto.resource); + 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(); + com.google.rpc.ErrorDetailsProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/PagedExpandLegacyMappedResponse.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/PagedExpandLegacyMappedResponse.java new file mode 100644 index 0000000000..982a20cb30 --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/PagedExpandLegacyMappedResponse.java @@ -0,0 +1,1042 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/echo.proto + +package com.google.showcase.v1beta1; + +/** Protobuf type {@code google.showcase.v1beta1.PagedExpandLegacyMappedResponse} */ +public final class PagedExpandLegacyMappedResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.PagedExpandLegacyMappedResponse) + PagedExpandLegacyMappedResponseOrBuilder { + private static final long serialVersionUID = 0L; + + // Use PagedExpandLegacyMappedResponse.newBuilder() to construct. + private PagedExpandLegacyMappedResponse( + com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private PagedExpandLegacyMappedResponse() { + nextPageToken_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new PagedExpandLegacyMappedResponse(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private PagedExpandLegacyMappedResponse( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + alphabetized_ = + com.google.protobuf.MapField.newMapField( + AlphabetizedDefaultEntryHolder.defaultEntry); + mutable_bitField0_ |= 0x00000001; + } + com.google.protobuf.MapEntry< + java.lang.String, com.google.showcase.v1beta1.PagedExpandResponseList> + alphabetized__ = + input.readMessage( + AlphabetizedDefaultEntryHolder.defaultEntry.getParserForType(), + extensionRegistry); + alphabetized_.getMutableMap().put(alphabetized__.getKey(), alphabetized__.getValue()); + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + nextPageToken_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.EchoOuterClass + .internal_static_google_showcase_v1beta1_PagedExpandLegacyMappedResponse_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + @java.lang.Override + protected com.google.protobuf.MapField internalGetMapField(int number) { + switch (number) { + case 1: + return internalGetAlphabetized(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.EchoOuterClass + .internal_static_google_showcase_v1beta1_PagedExpandLegacyMappedResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.PagedExpandLegacyMappedResponse.class, + com.google.showcase.v1beta1.PagedExpandLegacyMappedResponse.Builder.class); + } + + public static final int ALPHABETIZED_FIELD_NUMBER = 1; + + private static final class AlphabetizedDefaultEntryHolder { + static final com.google.protobuf.MapEntry< + java.lang.String, com.google.showcase.v1beta1.PagedExpandResponseList> + defaultEntry = + com.google.protobuf.MapEntry + . + newDefaultInstance( + com.google.showcase.v1beta1.EchoOuterClass + .internal_static_google_showcase_v1beta1_PagedExpandLegacyMappedResponse_AlphabetizedEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.MESSAGE, + com.google.showcase.v1beta1.PagedExpandResponseList.getDefaultInstance()); + } + + private com.google.protobuf.MapField< + java.lang.String, com.google.showcase.v1beta1.PagedExpandResponseList> + alphabetized_; + + private com.google.protobuf.MapField< + java.lang.String, com.google.showcase.v1beta1.PagedExpandResponseList> + internalGetAlphabetized() { + if (alphabetized_ == null) { + return com.google.protobuf.MapField.emptyMapField( + AlphabetizedDefaultEntryHolder.defaultEntry); + } + return alphabetized_; + } + + public int getAlphabetizedCount() { + return internalGetAlphabetized().getMap().size(); + } + + /** + * + * + *
        +   * The words that were expanded, indexed by their initial character.
        +   * (-- aip.dev/not-precedent: This is a legacy, non-standard pattern that violates
        +   *     aip.dev/158. Ordinarily, this should be a `repeated` field, as in PagedExpandResponse. --)
        +   * 
        + * + * map<string, .google.showcase.v1beta1.PagedExpandResponseList> alphabetized = 1; + * + */ + @java.lang.Override + public boolean containsAlphabetized(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + return internalGetAlphabetized().getMap().containsKey(key); + } + + /** Use {@link #getAlphabetizedMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map + getAlphabetized() { + return getAlphabetizedMap(); + } + + /** + * + * + *
        +   * The words that were expanded, indexed by their initial character.
        +   * (-- aip.dev/not-precedent: This is a legacy, non-standard pattern that violates
        +   *     aip.dev/158. Ordinarily, this should be a `repeated` field, as in PagedExpandResponse. --)
        +   * 
        + * + * map<string, .google.showcase.v1beta1.PagedExpandResponseList> alphabetized = 1; + * + */ + @java.lang.Override + public java.util.Map + getAlphabetizedMap() { + return internalGetAlphabetized().getMap(); + } + + /** + * + * + *
        +   * The words that were expanded, indexed by their initial character.
        +   * (-- aip.dev/not-precedent: This is a legacy, non-standard pattern that violates
        +   *     aip.dev/158. Ordinarily, this should be a `repeated` field, as in PagedExpandResponse. --)
        +   * 
        + * + * map<string, .google.showcase.v1beta1.PagedExpandResponseList> alphabetized = 1; + * + */ + @java.lang.Override + public com.google.showcase.v1beta1.PagedExpandResponseList getAlphabetizedOrDefault( + java.lang.String key, com.google.showcase.v1beta1.PagedExpandResponseList defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = + internalGetAlphabetized().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + + /** + * + * + *
        +   * The words that were expanded, indexed by their initial character.
        +   * (-- aip.dev/not-precedent: This is a legacy, non-standard pattern that violates
        +   *     aip.dev/158. Ordinarily, this should be a `repeated` field, as in PagedExpandResponse. --)
        +   * 
        + * + * map<string, .google.showcase.v1beta1.PagedExpandResponseList> alphabetized = 1; + * + */ + @java.lang.Override + public com.google.showcase.v1beta1.PagedExpandResponseList getAlphabetizedOrThrow( + java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = + internalGetAlphabetized().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public static final int NEXT_PAGE_TOKEN_FIELD_NUMBER = 2; + private volatile java.lang.Object nextPageToken_; + + /** + * + * + *
        +   * The next page token.
        +   * 
        + * + * 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; + } + } + + /** + * + * + *
        +   * The next page token.
        +   * 
        + * + * 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 { + com.google.protobuf.GeneratedMessageV3.serializeStringMapTo( + output, internalGetAlphabetized(), AlphabetizedDefaultEntryHolder.defaultEntry, 1); + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nextPageToken_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, nextPageToken_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (java.util.Map.Entry + entry : internalGetAlphabetized().getMap().entrySet()) { + com.google.protobuf.MapEntry< + java.lang.String, com.google.showcase.v1beta1.PagedExpandResponseList> + alphabetized__ = + AlphabetizedDefaultEntryHolder.defaultEntry + .newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, alphabetized__); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nextPageToken_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, nextPageToken_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.showcase.v1beta1.PagedExpandLegacyMappedResponse)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.PagedExpandLegacyMappedResponse other = + (com.google.showcase.v1beta1.PagedExpandLegacyMappedResponse) obj; + + if (!internalGetAlphabetized().equals(other.internalGetAlphabetized())) return false; + if (!getNextPageToken().equals(other.getNextPageToken())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (!internalGetAlphabetized().getMap().isEmpty()) { + hash = (37 * hash) + ALPHABETIZED_FIELD_NUMBER; + hash = (53 * hash) + internalGetAlphabetized().hashCode(); + } + hash = (37 * hash) + NEXT_PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getNextPageToken().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.showcase.v1beta1.PagedExpandLegacyMappedResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.PagedExpandLegacyMappedResponse parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.PagedExpandLegacyMappedResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.PagedExpandLegacyMappedResponse 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.showcase.v1beta1.PagedExpandLegacyMappedResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.PagedExpandLegacyMappedResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.PagedExpandLegacyMappedResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.PagedExpandLegacyMappedResponse 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.showcase.v1beta1.PagedExpandLegacyMappedResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.PagedExpandLegacyMappedResponse 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.showcase.v1beta1.PagedExpandLegacyMappedResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.PagedExpandLegacyMappedResponse 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.showcase.v1beta1.PagedExpandLegacyMappedResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** Protobuf type {@code google.showcase.v1beta1.PagedExpandLegacyMappedResponse} */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.PagedExpandLegacyMappedResponse) + com.google.showcase.v1beta1.PagedExpandLegacyMappedResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.EchoOuterClass + .internal_static_google_showcase_v1beta1_PagedExpandLegacyMappedResponse_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMapField(int number) { + switch (number) { + case 1: + return internalGetAlphabetized(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMutableMapField(int number) { + switch (number) { + case 1: + return internalGetMutableAlphabetized(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.EchoOuterClass + .internal_static_google_showcase_v1beta1_PagedExpandLegacyMappedResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.PagedExpandLegacyMappedResponse.class, + com.google.showcase.v1beta1.PagedExpandLegacyMappedResponse.Builder.class); + } + + // Construct using com.google.showcase.v1beta1.PagedExpandLegacyMappedResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + internalGetMutableAlphabetized().clear(); + nextPageToken_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.showcase.v1beta1.EchoOuterClass + .internal_static_google_showcase_v1beta1_PagedExpandLegacyMappedResponse_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.PagedExpandLegacyMappedResponse getDefaultInstanceForType() { + return com.google.showcase.v1beta1.PagedExpandLegacyMappedResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.PagedExpandLegacyMappedResponse build() { + com.google.showcase.v1beta1.PagedExpandLegacyMappedResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.PagedExpandLegacyMappedResponse buildPartial() { + com.google.showcase.v1beta1.PagedExpandLegacyMappedResponse result = + new com.google.showcase.v1beta1.PagedExpandLegacyMappedResponse(this); + int from_bitField0_ = bitField0_; + result.alphabetized_ = internalGetAlphabetized(); + result.alphabetized_.makeImmutable(); + result.nextPageToken_ = nextPageToken_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.showcase.v1beta1.PagedExpandLegacyMappedResponse) { + return mergeFrom((com.google.showcase.v1beta1.PagedExpandLegacyMappedResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.showcase.v1beta1.PagedExpandLegacyMappedResponse other) { + if (other == com.google.showcase.v1beta1.PagedExpandLegacyMappedResponse.getDefaultInstance()) + return this; + internalGetMutableAlphabetized().mergeFrom(other.internalGetAlphabetized()); + if (!other.getNextPageToken().isEmpty()) { + nextPageToken_ = other.nextPageToken_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.showcase.v1beta1.PagedExpandLegacyMappedResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.showcase.v1beta1.PagedExpandLegacyMappedResponse) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private com.google.protobuf.MapField< + java.lang.String, com.google.showcase.v1beta1.PagedExpandResponseList> + alphabetized_; + + private com.google.protobuf.MapField< + java.lang.String, com.google.showcase.v1beta1.PagedExpandResponseList> + internalGetAlphabetized() { + if (alphabetized_ == null) { + return com.google.protobuf.MapField.emptyMapField( + AlphabetizedDefaultEntryHolder.defaultEntry); + } + return alphabetized_; + } + + private com.google.protobuf.MapField< + java.lang.String, com.google.showcase.v1beta1.PagedExpandResponseList> + internalGetMutableAlphabetized() { + onChanged(); + ; + if (alphabetized_ == null) { + alphabetized_ = + com.google.protobuf.MapField.newMapField(AlphabetizedDefaultEntryHolder.defaultEntry); + } + if (!alphabetized_.isMutable()) { + alphabetized_ = alphabetized_.copy(); + } + return alphabetized_; + } + + public int getAlphabetizedCount() { + return internalGetAlphabetized().getMap().size(); + } + + /** + * + * + *
        +     * The words that were expanded, indexed by their initial character.
        +     * (-- aip.dev/not-precedent: This is a legacy, non-standard pattern that violates
        +     *     aip.dev/158. Ordinarily, this should be a `repeated` field, as in PagedExpandResponse. --)
        +     * 
        + * + * map<string, .google.showcase.v1beta1.PagedExpandResponseList> alphabetized = 1; + * + */ + @java.lang.Override + public boolean containsAlphabetized(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + return internalGetAlphabetized().getMap().containsKey(key); + } + + /** Use {@link #getAlphabetizedMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map + getAlphabetized() { + return getAlphabetizedMap(); + } + + /** + * + * + *
        +     * The words that were expanded, indexed by their initial character.
        +     * (-- aip.dev/not-precedent: This is a legacy, non-standard pattern that violates
        +     *     aip.dev/158. Ordinarily, this should be a `repeated` field, as in PagedExpandResponse. --)
        +     * 
        + * + * map<string, .google.showcase.v1beta1.PagedExpandResponseList> alphabetized = 1; + * + */ + @java.lang.Override + public java.util.Map + getAlphabetizedMap() { + return internalGetAlphabetized().getMap(); + } + + /** + * + * + *
        +     * The words that were expanded, indexed by their initial character.
        +     * (-- aip.dev/not-precedent: This is a legacy, non-standard pattern that violates
        +     *     aip.dev/158. Ordinarily, this should be a `repeated` field, as in PagedExpandResponse. --)
        +     * 
        + * + * map<string, .google.showcase.v1beta1.PagedExpandResponseList> alphabetized = 1; + * + */ + @java.lang.Override + public com.google.showcase.v1beta1.PagedExpandResponseList getAlphabetizedOrDefault( + java.lang.String key, com.google.showcase.v1beta1.PagedExpandResponseList defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = + internalGetAlphabetized().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + + /** + * + * + *
        +     * The words that were expanded, indexed by their initial character.
        +     * (-- aip.dev/not-precedent: This is a legacy, non-standard pattern that violates
        +     *     aip.dev/158. Ordinarily, this should be a `repeated` field, as in PagedExpandResponse. --)
        +     * 
        + * + * map<string, .google.showcase.v1beta1.PagedExpandResponseList> alphabetized = 1; + * + */ + @java.lang.Override + public com.google.showcase.v1beta1.PagedExpandResponseList getAlphabetizedOrThrow( + java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = + internalGetAlphabetized().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public Builder clearAlphabetized() { + internalGetMutableAlphabetized().getMutableMap().clear(); + return this; + } + + /** + * + * + *
        +     * The words that were expanded, indexed by their initial character.
        +     * (-- aip.dev/not-precedent: This is a legacy, non-standard pattern that violates
        +     *     aip.dev/158. Ordinarily, this should be a `repeated` field, as in PagedExpandResponse. --)
        +     * 
        + * + * map<string, .google.showcase.v1beta1.PagedExpandResponseList> alphabetized = 1; + * + */ + public Builder removeAlphabetized(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + internalGetMutableAlphabetized().getMutableMap().remove(key); + return this; + } + + /** Use alternate mutation accessors instead. */ + @java.lang.Deprecated + public java.util.Map + getMutableAlphabetized() { + return internalGetMutableAlphabetized().getMutableMap(); + } + + /** + * + * + *
        +     * The words that were expanded, indexed by their initial character.
        +     * (-- aip.dev/not-precedent: This is a legacy, non-standard pattern that violates
        +     *     aip.dev/158. Ordinarily, this should be a `repeated` field, as in PagedExpandResponse. --)
        +     * 
        + * + * map<string, .google.showcase.v1beta1.PagedExpandResponseList> alphabetized = 1; + * + */ + public Builder putAlphabetized( + java.lang.String key, com.google.showcase.v1beta1.PagedExpandResponseList value) { + if (key == null) { + throw new NullPointerException("map key"); + } + if (value == null) { + throw new NullPointerException("map value"); + } + + internalGetMutableAlphabetized().getMutableMap().put(key, value); + return this; + } + + /** + * + * + *
        +     * The words that were expanded, indexed by their initial character.
        +     * (-- aip.dev/not-precedent: This is a legacy, non-standard pattern that violates
        +     *     aip.dev/158. Ordinarily, this should be a `repeated` field, as in PagedExpandResponse. --)
        +     * 
        + * + * map<string, .google.showcase.v1beta1.PagedExpandResponseList> alphabetized = 1; + * + */ + public Builder putAllAlphabetized( + java.util.Map + values) { + internalGetMutableAlphabetized().getMutableMap().putAll(values); + return this; + } + + private java.lang.Object nextPageToken_ = ""; + + /** + * + * + *
        +     * The next page token.
        +     * 
        + * + * 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; + } + } + + /** + * + * + *
        +     * The next page token.
        +     * 
        + * + * 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; + } + } + + /** + * + * + *
        +     * The next page token.
        +     * 
        + * + * string next_page_token = 2; + * + * @param value The nextPageToken to set. + * @return This builder for chaining. + */ + public Builder setNextPageToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + nextPageToken_ = value; + onChanged(); + return this; + } + + /** + * + * + *
        +     * The next page token.
        +     * 
        + * + * string next_page_token = 2; + * + * @return This builder for chaining. + */ + public Builder clearNextPageToken() { + + nextPageToken_ = getDefaultInstance().getNextPageToken(); + onChanged(); + return this; + } + + /** + * + * + *
        +     * The next page token.
        +     * 
        + * + * string next_page_token = 2; + * + * @param value The bytes for nextPageToken to set. + * @return This builder for chaining. + */ + public Builder setNextPageTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + nextPageToken_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.showcase.v1beta1.PagedExpandLegacyMappedResponse) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.PagedExpandLegacyMappedResponse) + private static final com.google.showcase.v1beta1.PagedExpandLegacyMappedResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.PagedExpandLegacyMappedResponse(); + } + + public static com.google.showcase.v1beta1.PagedExpandLegacyMappedResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public PagedExpandLegacyMappedResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new PagedExpandLegacyMappedResponse(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.showcase.v1beta1.PagedExpandLegacyMappedResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/PagedExpandLegacyMappedResponseOrBuilder.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/PagedExpandLegacyMappedResponseOrBuilder.java new file mode 100644 index 0000000000..fadc9734cd --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/PagedExpandLegacyMappedResponseOrBuilder.java @@ -0,0 +1,132 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/echo.proto + +package com.google.showcase.v1beta1; + +public interface PagedExpandLegacyMappedResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.PagedExpandLegacyMappedResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
        +   * The words that were expanded, indexed by their initial character.
        +   * (-- aip.dev/not-precedent: This is a legacy, non-standard pattern that violates
        +   *     aip.dev/158. Ordinarily, this should be a `repeated` field, as in PagedExpandResponse. --)
        +   * 
        + * + * map<string, .google.showcase.v1beta1.PagedExpandResponseList> alphabetized = 1; + * + */ + int getAlphabetizedCount(); + + /** + * + * + *
        +   * The words that were expanded, indexed by their initial character.
        +   * (-- aip.dev/not-precedent: This is a legacy, non-standard pattern that violates
        +   *     aip.dev/158. Ordinarily, this should be a `repeated` field, as in PagedExpandResponse. --)
        +   * 
        + * + * map<string, .google.showcase.v1beta1.PagedExpandResponseList> alphabetized = 1; + * + */ + boolean containsAlphabetized(java.lang.String key); + + /** Use {@link #getAlphabetizedMap()} instead. */ + @java.lang.Deprecated + java.util.Map + getAlphabetized(); + + /** + * + * + *
        +   * The words that were expanded, indexed by their initial character.
        +   * (-- aip.dev/not-precedent: This is a legacy, non-standard pattern that violates
        +   *     aip.dev/158. Ordinarily, this should be a `repeated` field, as in PagedExpandResponse. --)
        +   * 
        + * + * map<string, .google.showcase.v1beta1.PagedExpandResponseList> alphabetized = 1; + * + */ + java.util.Map + getAlphabetizedMap(); + + /** + * + * + *
        +   * The words that were expanded, indexed by their initial character.
        +   * (-- aip.dev/not-precedent: This is a legacy, non-standard pattern that violates
        +   *     aip.dev/158. Ordinarily, this should be a `repeated` field, as in PagedExpandResponse. --)
        +   * 
        + * + * map<string, .google.showcase.v1beta1.PagedExpandResponseList> alphabetized = 1; + * + */ + + /* nullable */ + com.google.showcase.v1beta1.PagedExpandResponseList getAlphabetizedOrDefault( + java.lang.String key, + /* nullable */ + com.google.showcase.v1beta1.PagedExpandResponseList defaultValue); + + /** + * + * + *
        +   * The words that were expanded, indexed by their initial character.
        +   * (-- aip.dev/not-precedent: This is a legacy, non-standard pattern that violates
        +   *     aip.dev/158. Ordinarily, this should be a `repeated` field, as in PagedExpandResponse. --)
        +   * 
        + * + * map<string, .google.showcase.v1beta1.PagedExpandResponseList> alphabetized = 1; + * + */ + com.google.showcase.v1beta1.PagedExpandResponseList getAlphabetizedOrThrow(java.lang.String key); + + /** + * + * + *
        +   * The next page token.
        +   * 
        + * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + java.lang.String getNextPageToken(); + + /** + * + * + *
        +   * The next page token.
        +   * 
        + * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + com.google.protobuf.ByteString getNextPageTokenBytes(); +} diff --git a/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/PagedExpandLegacyRequest.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/PagedExpandLegacyRequest.java new file mode 100644 index 0000000000..67b02877b7 --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/PagedExpandLegacyRequest.java @@ -0,0 +1,939 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/echo.proto + +package com.google.showcase.v1beta1; + +/** + * + * + *
        + * The request for the PagedExpandLegacy method.  This is a pattern used by some legacy APIs. New
        + * APIs should NOT use this pattern, but rather something like PagedExpandRequest which conforms to
        + * aip.dev/158.
        + * 
        + * + * Protobuf type {@code google.showcase.v1beta1.PagedExpandLegacyRequest} + */ +public final class PagedExpandLegacyRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.PagedExpandLegacyRequest) + PagedExpandLegacyRequestOrBuilder { + private static final long serialVersionUID = 0L; + + // Use PagedExpandLegacyRequest.newBuilder() to construct. + private PagedExpandLegacyRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private PagedExpandLegacyRequest() { + content_ = ""; + pageToken_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new PagedExpandLegacyRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private PagedExpandLegacyRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + content_ = s; + break; + } + case 16: + { + maxResults_ = input.readInt32(); + break; + } + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + + pageToken_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.EchoOuterClass + .internal_static_google_showcase_v1beta1_PagedExpandLegacyRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.EchoOuterClass + .internal_static_google_showcase_v1beta1_PagedExpandLegacyRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.PagedExpandLegacyRequest.class, + com.google.showcase.v1beta1.PagedExpandLegacyRequest.Builder.class); + } + + public static final int CONTENT_FIELD_NUMBER = 1; + private volatile java.lang.Object content_; + + /** + * + * + *
        +   * The string to expand.
        +   * 
        + * + * string content = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The content. + */ + @java.lang.Override + public java.lang.String getContent() { + java.lang.Object ref = content_; + 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(); + content_ = s; + return s; + } + } + + /** + * + * + *
        +   * The string to expand.
        +   * 
        + * + * string content = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for content. + */ + @java.lang.Override + public com.google.protobuf.ByteString getContentBytes() { + java.lang.Object ref = content_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + content_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int MAX_RESULTS_FIELD_NUMBER = 2; + private int maxResults_; + + /** + * + * + *
        +   * The number of words to returned in each page.
        +   * (-- aip.dev/not-precedent: This is a legacy, non-standard pattern that
        +   *     violates aip.dev/158. Ordinarily, this should be page_size. --)
        +   * 
        + * + * int32 max_results = 2; + * + * @return The maxResults. + */ + @java.lang.Override + public int getMaxResults() { + return maxResults_; + } + + public static final int PAGE_TOKEN_FIELD_NUMBER = 3; + private volatile java.lang.Object pageToken_; + + /** + * + * + *
        +   * The position of the page to be returned.
        +   * 
        + * + * string page_token = 3; + * + * @return The pageToken. + */ + @java.lang.Override + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; + } + } + + /** + * + * + *
        +   * The position of the page to be returned.
        +   * 
        + * + * string page_token = 3; + * + * @return The bytes for pageToken. + */ + @java.lang.Override + public com.google.protobuf.ByteString getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(content_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, content_); + } + if (maxResults_ != 0) { + output.writeInt32(2, maxResults_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(pageToken_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, pageToken_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(content_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, content_); + } + if (maxResults_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(2, maxResults_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(pageToken_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, pageToken_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.showcase.v1beta1.PagedExpandLegacyRequest)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.PagedExpandLegacyRequest other = + (com.google.showcase.v1beta1.PagedExpandLegacyRequest) obj; + + if (!getContent().equals(other.getContent())) return false; + if (getMaxResults() != other.getMaxResults()) return false; + if (!getPageToken().equals(other.getPageToken())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + CONTENT_FIELD_NUMBER; + hash = (53 * hash) + getContent().hashCode(); + hash = (37 * hash) + MAX_RESULTS_FIELD_NUMBER; + hash = (53 * hash) + getMaxResults(); + hash = (37 * hash) + PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getPageToken().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.showcase.v1beta1.PagedExpandLegacyRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.PagedExpandLegacyRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.PagedExpandLegacyRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.PagedExpandLegacyRequest 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.showcase.v1beta1.PagedExpandLegacyRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.PagedExpandLegacyRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.PagedExpandLegacyRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.PagedExpandLegacyRequest 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.showcase.v1beta1.PagedExpandLegacyRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.PagedExpandLegacyRequest 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.showcase.v1beta1.PagedExpandLegacyRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.PagedExpandLegacyRequest 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.showcase.v1beta1.PagedExpandLegacyRequest 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 request for the PagedExpandLegacy method.  This is a pattern used by some legacy APIs. New
        +   * APIs should NOT use this pattern, but rather something like PagedExpandRequest which conforms to
        +   * aip.dev/158.
        +   * 
        + * + * Protobuf type {@code google.showcase.v1beta1.PagedExpandLegacyRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.PagedExpandLegacyRequest) + com.google.showcase.v1beta1.PagedExpandLegacyRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.EchoOuterClass + .internal_static_google_showcase_v1beta1_PagedExpandLegacyRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.EchoOuterClass + .internal_static_google_showcase_v1beta1_PagedExpandLegacyRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.PagedExpandLegacyRequest.class, + com.google.showcase.v1beta1.PagedExpandLegacyRequest.Builder.class); + } + + // Construct using com.google.showcase.v1beta1.PagedExpandLegacyRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + content_ = ""; + + maxResults_ = 0; + + pageToken_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.showcase.v1beta1.EchoOuterClass + .internal_static_google_showcase_v1beta1_PagedExpandLegacyRequest_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.PagedExpandLegacyRequest getDefaultInstanceForType() { + return com.google.showcase.v1beta1.PagedExpandLegacyRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.PagedExpandLegacyRequest build() { + com.google.showcase.v1beta1.PagedExpandLegacyRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.PagedExpandLegacyRequest buildPartial() { + com.google.showcase.v1beta1.PagedExpandLegacyRequest result = + new com.google.showcase.v1beta1.PagedExpandLegacyRequest(this); + result.content_ = content_; + result.maxResults_ = maxResults_; + result.pageToken_ = pageToken_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.showcase.v1beta1.PagedExpandLegacyRequest) { + return mergeFrom((com.google.showcase.v1beta1.PagedExpandLegacyRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.showcase.v1beta1.PagedExpandLegacyRequest other) { + if (other == com.google.showcase.v1beta1.PagedExpandLegacyRequest.getDefaultInstance()) + return this; + if (!other.getContent().isEmpty()) { + content_ = other.content_; + onChanged(); + } + if (other.getMaxResults() != 0) { + setMaxResults(other.getMaxResults()); + } + if (!other.getPageToken().isEmpty()) { + pageToken_ = other.pageToken_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.showcase.v1beta1.PagedExpandLegacyRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.showcase.v1beta1.PagedExpandLegacyRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object content_ = ""; + + /** + * + * + *
        +     * The string to expand.
        +     * 
        + * + * string content = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The content. + */ + public java.lang.String getContent() { + java.lang.Object ref = content_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + content_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
        +     * The string to expand.
        +     * 
        + * + * string content = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for content. + */ + public com.google.protobuf.ByteString getContentBytes() { + java.lang.Object ref = content_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + content_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
        +     * The string to expand.
        +     * 
        + * + * string content = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The content to set. + * @return This builder for chaining. + */ + public Builder setContent(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + content_ = value; + onChanged(); + return this; + } + + /** + * + * + *
        +     * The string to expand.
        +     * 
        + * + * string content = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearContent() { + + content_ = getDefaultInstance().getContent(); + onChanged(); + return this; + } + + /** + * + * + *
        +     * The string to expand.
        +     * 
        + * + * string content = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for content to set. + * @return This builder for chaining. + */ + public Builder setContentBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + content_ = value; + onChanged(); + return this; + } + + private int maxResults_; + + /** + * + * + *
        +     * The number of words to returned in each page.
        +     * (-- aip.dev/not-precedent: This is a legacy, non-standard pattern that
        +     *     violates aip.dev/158. Ordinarily, this should be page_size. --)
        +     * 
        + * + * int32 max_results = 2; + * + * @return The maxResults. + */ + @java.lang.Override + public int getMaxResults() { + return maxResults_; + } + + /** + * + * + *
        +     * The number of words to returned in each page.
        +     * (-- aip.dev/not-precedent: This is a legacy, non-standard pattern that
        +     *     violates aip.dev/158. Ordinarily, this should be page_size. --)
        +     * 
        + * + * int32 max_results = 2; + * + * @param value The maxResults to set. + * @return This builder for chaining. + */ + public Builder setMaxResults(int value) { + + maxResults_ = value; + onChanged(); + return this; + } + + /** + * + * + *
        +     * The number of words to returned in each page.
        +     * (-- aip.dev/not-precedent: This is a legacy, non-standard pattern that
        +     *     violates aip.dev/158. Ordinarily, this should be page_size. --)
        +     * 
        + * + * int32 max_results = 2; + * + * @return This builder for chaining. + */ + public Builder clearMaxResults() { + + maxResults_ = 0; + onChanged(); + return this; + } + + private java.lang.Object pageToken_ = ""; + + /** + * + * + *
        +     * The position of the page to be returned.
        +     * 
        + * + * string page_token = 3; + * + * @return The pageToken. + */ + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
        +     * The position of the page to be returned.
        +     * 
        + * + * string page_token = 3; + * + * @return The bytes for pageToken. + */ + public com.google.protobuf.ByteString getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
        +     * The position of the page to be returned.
        +     * 
        + * + * string page_token = 3; + * + * @param value The pageToken to set. + * @return This builder for chaining. + */ + public Builder setPageToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + pageToken_ = value; + onChanged(); + return this; + } + + /** + * + * + *
        +     * The position of the page to be returned.
        +     * 
        + * + * string page_token = 3; + * + * @return This builder for chaining. + */ + public Builder clearPageToken() { + + pageToken_ = getDefaultInstance().getPageToken(); + onChanged(); + return this; + } + + /** + * + * + *
        +     * The position of the page to be returned.
        +     * 
        + * + * string page_token = 3; + * + * @param value The bytes for pageToken to set. + * @return This builder for chaining. + */ + public Builder setPageTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + pageToken_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.showcase.v1beta1.PagedExpandLegacyRequest) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.PagedExpandLegacyRequest) + private static final com.google.showcase.v1beta1.PagedExpandLegacyRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.PagedExpandLegacyRequest(); + } + + public static com.google.showcase.v1beta1.PagedExpandLegacyRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public PagedExpandLegacyRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new PagedExpandLegacyRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.showcase.v1beta1.PagedExpandLegacyRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/PagedExpandLegacyRequestOrBuilder.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/PagedExpandLegacyRequestOrBuilder.java new file mode 100644 index 0000000000..c9e94d7c28 --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/PagedExpandLegacyRequestOrBuilder.java @@ -0,0 +1,92 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/echo.proto + +package com.google.showcase.v1beta1; + +public interface PagedExpandLegacyRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.PagedExpandLegacyRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
        +   * The string to expand.
        +   * 
        + * + * string content = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The content. + */ + java.lang.String getContent(); + + /** + * + * + *
        +   * The string to expand.
        +   * 
        + * + * string content = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for content. + */ + com.google.protobuf.ByteString getContentBytes(); + + /** + * + * + *
        +   * The number of words to returned in each page.
        +   * (-- aip.dev/not-precedent: This is a legacy, non-standard pattern that
        +   *     violates aip.dev/158. Ordinarily, this should be page_size. --)
        +   * 
        + * + * int32 max_results = 2; + * + * @return The maxResults. + */ + int getMaxResults(); + + /** + * + * + *
        +   * The position of the page to be returned.
        +   * 
        + * + * string page_token = 3; + * + * @return The pageToken. + */ + java.lang.String getPageToken(); + + /** + * + * + *
        +   * The position of the page to be returned.
        +   * 
        + * + * string page_token = 3; + * + * @return The bytes for pageToken. + */ + com.google.protobuf.ByteString getPageTokenBytes(); +} diff --git a/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/PagedExpandRequest.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/PagedExpandRequest.java new file mode 100644 index 0000000000..e1f0478ab1 --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/PagedExpandRequest.java @@ -0,0 +1,925 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/echo.proto + +package com.google.showcase.v1beta1; + +/** + * + * + *
        + * The request for the PagedExpand method.
        + * 
        + * + * Protobuf type {@code google.showcase.v1beta1.PagedExpandRequest} + */ +public final class PagedExpandRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.PagedExpandRequest) + PagedExpandRequestOrBuilder { + private static final long serialVersionUID = 0L; + + // Use PagedExpandRequest.newBuilder() to construct. + private PagedExpandRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private PagedExpandRequest() { + content_ = ""; + pageToken_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new PagedExpandRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private PagedExpandRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + content_ = s; + break; + } + case 16: + { + pageSize_ = input.readInt32(); + break; + } + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + + pageToken_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.EchoOuterClass + .internal_static_google_showcase_v1beta1_PagedExpandRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.EchoOuterClass + .internal_static_google_showcase_v1beta1_PagedExpandRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.PagedExpandRequest.class, + com.google.showcase.v1beta1.PagedExpandRequest.Builder.class); + } + + public static final int CONTENT_FIELD_NUMBER = 1; + private volatile java.lang.Object content_; + + /** + * + * + *
        +   * The string to expand.
        +   * 
        + * + * string content = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The content. + */ + @java.lang.Override + public java.lang.String getContent() { + java.lang.Object ref = content_; + 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(); + content_ = s; + return s; + } + } + + /** + * + * + *
        +   * The string to expand.
        +   * 
        + * + * string content = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for content. + */ + @java.lang.Override + public com.google.protobuf.ByteString getContentBytes() { + java.lang.Object ref = content_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + content_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PAGE_SIZE_FIELD_NUMBER = 2; + private int pageSize_; + + /** + * + * + *
        +   * The number of words to returned in each page.
        +   * 
        + * + * int32 page_size = 2; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + + public static final int PAGE_TOKEN_FIELD_NUMBER = 3; + private volatile java.lang.Object pageToken_; + + /** + * + * + *
        +   * The position of the page to be returned.
        +   * 
        + * + * string page_token = 3; + * + * @return The pageToken. + */ + @java.lang.Override + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; + } + } + + /** + * + * + *
        +   * The position of the page to be returned.
        +   * 
        + * + * string page_token = 3; + * + * @return The bytes for pageToken. + */ + @java.lang.Override + public com.google.protobuf.ByteString getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(content_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, content_); + } + if (pageSize_ != 0) { + output.writeInt32(2, pageSize_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(pageToken_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, pageToken_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(content_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, content_); + } + 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_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.showcase.v1beta1.PagedExpandRequest)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.PagedExpandRequest other = + (com.google.showcase.v1beta1.PagedExpandRequest) obj; + + if (!getContent().equals(other.getContent())) return false; + if (getPageSize() != other.getPageSize()) return false; + if (!getPageToken().equals(other.getPageToken())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + CONTENT_FIELD_NUMBER; + hash = (53 * hash) + getContent().hashCode(); + hash = (37 * hash) + PAGE_SIZE_FIELD_NUMBER; + hash = (53 * hash) + getPageSize(); + hash = (37 * hash) + PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getPageToken().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.showcase.v1beta1.PagedExpandRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.PagedExpandRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.PagedExpandRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.PagedExpandRequest 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.showcase.v1beta1.PagedExpandRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.PagedExpandRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.PagedExpandRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.PagedExpandRequest 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.showcase.v1beta1.PagedExpandRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.PagedExpandRequest 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.showcase.v1beta1.PagedExpandRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.PagedExpandRequest 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.showcase.v1beta1.PagedExpandRequest 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 request for the PagedExpand method.
        +   * 
        + * + * Protobuf type {@code google.showcase.v1beta1.PagedExpandRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.PagedExpandRequest) + com.google.showcase.v1beta1.PagedExpandRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.EchoOuterClass + .internal_static_google_showcase_v1beta1_PagedExpandRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.EchoOuterClass + .internal_static_google_showcase_v1beta1_PagedExpandRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.PagedExpandRequest.class, + com.google.showcase.v1beta1.PagedExpandRequest.Builder.class); + } + + // Construct using com.google.showcase.v1beta1.PagedExpandRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + content_ = ""; + + pageSize_ = 0; + + pageToken_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.showcase.v1beta1.EchoOuterClass + .internal_static_google_showcase_v1beta1_PagedExpandRequest_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.PagedExpandRequest getDefaultInstanceForType() { + return com.google.showcase.v1beta1.PagedExpandRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.PagedExpandRequest build() { + com.google.showcase.v1beta1.PagedExpandRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.PagedExpandRequest buildPartial() { + com.google.showcase.v1beta1.PagedExpandRequest result = + new com.google.showcase.v1beta1.PagedExpandRequest(this); + result.content_ = content_; + result.pageSize_ = pageSize_; + result.pageToken_ = pageToken_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.showcase.v1beta1.PagedExpandRequest) { + return mergeFrom((com.google.showcase.v1beta1.PagedExpandRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.showcase.v1beta1.PagedExpandRequest other) { + if (other == com.google.showcase.v1beta1.PagedExpandRequest.getDefaultInstance()) return this; + if (!other.getContent().isEmpty()) { + content_ = other.content_; + onChanged(); + } + if (other.getPageSize() != 0) { + setPageSize(other.getPageSize()); + } + if (!other.getPageToken().isEmpty()) { + pageToken_ = other.pageToken_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.showcase.v1beta1.PagedExpandRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.showcase.v1beta1.PagedExpandRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object content_ = ""; + + /** + * + * + *
        +     * The string to expand.
        +     * 
        + * + * string content = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The content. + */ + public java.lang.String getContent() { + java.lang.Object ref = content_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + content_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
        +     * The string to expand.
        +     * 
        + * + * string content = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for content. + */ + public com.google.protobuf.ByteString getContentBytes() { + java.lang.Object ref = content_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + content_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
        +     * The string to expand.
        +     * 
        + * + * string content = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The content to set. + * @return This builder for chaining. + */ + public Builder setContent(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + content_ = value; + onChanged(); + return this; + } + + /** + * + * + *
        +     * The string to expand.
        +     * 
        + * + * string content = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearContent() { + + content_ = getDefaultInstance().getContent(); + onChanged(); + return this; + } + + /** + * + * + *
        +     * The string to expand.
        +     * 
        + * + * string content = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for content to set. + * @return This builder for chaining. + */ + public Builder setContentBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + content_ = value; + onChanged(); + return this; + } + + private int pageSize_; + + /** + * + * + *
        +     * The number of words to returned in each page.
        +     * 
        + * + * int32 page_size = 2; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + + /** + * + * + *
        +     * The number of words to returned in each page.
        +     * 
        + * + * int32 page_size = 2; + * + * @param value The pageSize to set. + * @return This builder for chaining. + */ + public Builder setPageSize(int value) { + + pageSize_ = value; + onChanged(); + return this; + } + + /** + * + * + *
        +     * The number of words to returned in each page.
        +     * 
        + * + * int32 page_size = 2; + * + * @return This builder for chaining. + */ + public Builder clearPageSize() { + + pageSize_ = 0; + onChanged(); + return this; + } + + private java.lang.Object pageToken_ = ""; + + /** + * + * + *
        +     * The position of the page to be returned.
        +     * 
        + * + * string page_token = 3; + * + * @return The pageToken. + */ + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
        +     * The position of the page to be returned.
        +     * 
        + * + * string page_token = 3; + * + * @return The bytes for pageToken. + */ + public com.google.protobuf.ByteString getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
        +     * The position of the page to be returned.
        +     * 
        + * + * string page_token = 3; + * + * @param value The pageToken to set. + * @return This builder for chaining. + */ + public Builder setPageToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + pageToken_ = value; + onChanged(); + return this; + } + + /** + * + * + *
        +     * The position of the page to be returned.
        +     * 
        + * + * string page_token = 3; + * + * @return This builder for chaining. + */ + public Builder clearPageToken() { + + pageToken_ = getDefaultInstance().getPageToken(); + onChanged(); + return this; + } + + /** + * + * + *
        +     * The position of the page to be returned.
        +     * 
        + * + * string page_token = 3; + * + * @param value The bytes for pageToken to set. + * @return This builder for chaining. + */ + public Builder setPageTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + pageToken_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.showcase.v1beta1.PagedExpandRequest) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.PagedExpandRequest) + private static final com.google.showcase.v1beta1.PagedExpandRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.PagedExpandRequest(); + } + + public static com.google.showcase.v1beta1.PagedExpandRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public PagedExpandRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new PagedExpandRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.showcase.v1beta1.PagedExpandRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/PagedExpandRequestOrBuilder.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/PagedExpandRequestOrBuilder.java new file mode 100644 index 0000000000..c111c66bb2 --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/PagedExpandRequestOrBuilder.java @@ -0,0 +1,90 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/echo.proto + +package com.google.showcase.v1beta1; + +public interface PagedExpandRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.PagedExpandRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
        +   * The string to expand.
        +   * 
        + * + * string content = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The content. + */ + java.lang.String getContent(); + + /** + * + * + *
        +   * The string to expand.
        +   * 
        + * + * string content = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for content. + */ + com.google.protobuf.ByteString getContentBytes(); + + /** + * + * + *
        +   * The number of words to returned in each page.
        +   * 
        + * + * int32 page_size = 2; + * + * @return The pageSize. + */ + int getPageSize(); + + /** + * + * + *
        +   * The position of the page to be returned.
        +   * 
        + * + * string page_token = 3; + * + * @return The pageToken. + */ + java.lang.String getPageToken(); + + /** + * + * + *
        +   * The position of the page to be returned.
        +   * 
        + * + * string page_token = 3; + * + * @return The bytes for pageToken. + */ + com.google.protobuf.ByteString getPageTokenBytes(); +} diff --git a/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/PagedExpandResponse.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/PagedExpandResponse.java new file mode 100644 index 0000000000..83103b1e30 --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/PagedExpandResponse.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: schema/google/showcase/v1beta1/echo.proto + +package com.google.showcase.v1beta1; + +/** + * + * + *
        + * The response for the PagedExpand method.
        + * 
        + * + * Protobuf type {@code google.showcase.v1beta1.PagedExpandResponse} + */ +public final class PagedExpandResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.PagedExpandResponse) + PagedExpandResponseOrBuilder { + private static final long serialVersionUID = 0L; + + // Use PagedExpandResponse.newBuilder() to construct. + private PagedExpandResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private PagedExpandResponse() { + responses_ = java.util.Collections.emptyList(); + nextPageToken_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new PagedExpandResponse(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private PagedExpandResponse( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + responses_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + responses_.add( + input.readMessage( + com.google.showcase.v1beta1.EchoResponse.parser(), extensionRegistry)); + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + nextPageToken_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + responses_ = java.util.Collections.unmodifiableList(responses_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.EchoOuterClass + .internal_static_google_showcase_v1beta1_PagedExpandResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.EchoOuterClass + .internal_static_google_showcase_v1beta1_PagedExpandResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.PagedExpandResponse.class, + com.google.showcase.v1beta1.PagedExpandResponse.Builder.class); + } + + public static final int RESPONSES_FIELD_NUMBER = 1; + private java.util.List responses_; + + /** + * + * + *
        +   * The words that were expanded.
        +   * 
        + * + * repeated .google.showcase.v1beta1.EchoResponse responses = 1; + */ + @java.lang.Override + public java.util.List getResponsesList() { + return responses_; + } + + /** + * + * + *
        +   * The words that were expanded.
        +   * 
        + * + * repeated .google.showcase.v1beta1.EchoResponse responses = 1; + */ + @java.lang.Override + public java.util.List + getResponsesOrBuilderList() { + return responses_; + } + + /** + * + * + *
        +   * The words that were expanded.
        +   * 
        + * + * repeated .google.showcase.v1beta1.EchoResponse responses = 1; + */ + @java.lang.Override + public int getResponsesCount() { + return responses_.size(); + } + + /** + * + * + *
        +   * The words that were expanded.
        +   * 
        + * + * repeated .google.showcase.v1beta1.EchoResponse responses = 1; + */ + @java.lang.Override + public com.google.showcase.v1beta1.EchoResponse getResponses(int index) { + return responses_.get(index); + } + + /** + * + * + *
        +   * The words that were expanded.
        +   * 
        + * + * repeated .google.showcase.v1beta1.EchoResponse responses = 1; + */ + @java.lang.Override + public com.google.showcase.v1beta1.EchoResponseOrBuilder getResponsesOrBuilder(int index) { + return responses_.get(index); + } + + public static final int NEXT_PAGE_TOKEN_FIELD_NUMBER = 2; + private volatile java.lang.Object nextPageToken_; + + /** + * + * + *
        +   * The next page token.
        +   * 
        + * + * 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; + } + } + + /** + * + * + *
        +   * The next page token.
        +   * 
        + * + * 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 < responses_.size(); i++) { + output.writeMessage(1, responses_.get(i)); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nextPageToken_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, nextPageToken_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < responses_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, responses_.get(i)); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nextPageToken_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, nextPageToken_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.showcase.v1beta1.PagedExpandResponse)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.PagedExpandResponse other = + (com.google.showcase.v1beta1.PagedExpandResponse) obj; + + if (!getResponsesList().equals(other.getResponsesList())) return false; + if (!getNextPageToken().equals(other.getNextPageToken())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getResponsesCount() > 0) { + hash = (37 * hash) + RESPONSES_FIELD_NUMBER; + hash = (53 * hash) + getResponsesList().hashCode(); + } + hash = (37 * hash) + NEXT_PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getNextPageToken().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.showcase.v1beta1.PagedExpandResponse parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.PagedExpandResponse parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.PagedExpandResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.PagedExpandResponse 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.showcase.v1beta1.PagedExpandResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.PagedExpandResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.PagedExpandResponse parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.PagedExpandResponse 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.showcase.v1beta1.PagedExpandResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.PagedExpandResponse 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.showcase.v1beta1.PagedExpandResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.PagedExpandResponse 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.showcase.v1beta1.PagedExpandResponse 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 for the PagedExpand method.
        +   * 
        + * + * Protobuf type {@code google.showcase.v1beta1.PagedExpandResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.PagedExpandResponse) + com.google.showcase.v1beta1.PagedExpandResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.EchoOuterClass + .internal_static_google_showcase_v1beta1_PagedExpandResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.EchoOuterClass + .internal_static_google_showcase_v1beta1_PagedExpandResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.PagedExpandResponse.class, + com.google.showcase.v1beta1.PagedExpandResponse.Builder.class); + } + + // Construct using com.google.showcase.v1beta1.PagedExpandResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getResponsesFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (responsesBuilder_ == null) { + responses_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + responsesBuilder_.clear(); + } + nextPageToken_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.showcase.v1beta1.EchoOuterClass + .internal_static_google_showcase_v1beta1_PagedExpandResponse_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.PagedExpandResponse getDefaultInstanceForType() { + return com.google.showcase.v1beta1.PagedExpandResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.PagedExpandResponse build() { + com.google.showcase.v1beta1.PagedExpandResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.PagedExpandResponse buildPartial() { + com.google.showcase.v1beta1.PagedExpandResponse result = + new com.google.showcase.v1beta1.PagedExpandResponse(this); + int from_bitField0_ = bitField0_; + if (responsesBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + responses_ = java.util.Collections.unmodifiableList(responses_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.responses_ = responses_; + } else { + result.responses_ = responsesBuilder_.build(); + } + result.nextPageToken_ = nextPageToken_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.showcase.v1beta1.PagedExpandResponse) { + return mergeFrom((com.google.showcase.v1beta1.PagedExpandResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.showcase.v1beta1.PagedExpandResponse other) { + if (other == com.google.showcase.v1beta1.PagedExpandResponse.getDefaultInstance()) + return this; + if (responsesBuilder_ == null) { + if (!other.responses_.isEmpty()) { + if (responses_.isEmpty()) { + responses_ = other.responses_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureResponsesIsMutable(); + responses_.addAll(other.responses_); + } + onChanged(); + } + } else { + if (!other.responses_.isEmpty()) { + if (responsesBuilder_.isEmpty()) { + responsesBuilder_.dispose(); + responsesBuilder_ = null; + responses_ = other.responses_; + bitField0_ = (bitField0_ & ~0x00000001); + responsesBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getResponsesFieldBuilder() + : null; + } else { + responsesBuilder_.addAllMessages(other.responses_); + } + } + } + if (!other.getNextPageToken().isEmpty()) { + nextPageToken_ = other.nextPageToken_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.showcase.v1beta1.PagedExpandResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.showcase.v1beta1.PagedExpandResponse) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.util.List responses_ = + java.util.Collections.emptyList(); + + private void ensureResponsesIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + responses_ = new java.util.ArrayList(responses_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.showcase.v1beta1.EchoResponse, + com.google.showcase.v1beta1.EchoResponse.Builder, + com.google.showcase.v1beta1.EchoResponseOrBuilder> + responsesBuilder_; + + /** + * + * + *
        +     * The words that were expanded.
        +     * 
        + * + * repeated .google.showcase.v1beta1.EchoResponse responses = 1; + */ + public java.util.List getResponsesList() { + if (responsesBuilder_ == null) { + return java.util.Collections.unmodifiableList(responses_); + } else { + return responsesBuilder_.getMessageList(); + } + } + + /** + * + * + *
        +     * The words that were expanded.
        +     * 
        + * + * repeated .google.showcase.v1beta1.EchoResponse responses = 1; + */ + public int getResponsesCount() { + if (responsesBuilder_ == null) { + return responses_.size(); + } else { + return responsesBuilder_.getCount(); + } + } + + /** + * + * + *
        +     * The words that were expanded.
        +     * 
        + * + * repeated .google.showcase.v1beta1.EchoResponse responses = 1; + */ + public com.google.showcase.v1beta1.EchoResponse getResponses(int index) { + if (responsesBuilder_ == null) { + return responses_.get(index); + } else { + return responsesBuilder_.getMessage(index); + } + } + + /** + * + * + *
        +     * The words that were expanded.
        +     * 
        + * + * repeated .google.showcase.v1beta1.EchoResponse responses = 1; + */ + public Builder setResponses(int index, com.google.showcase.v1beta1.EchoResponse value) { + if (responsesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureResponsesIsMutable(); + responses_.set(index, value); + onChanged(); + } else { + responsesBuilder_.setMessage(index, value); + } + return this; + } + + /** + * + * + *
        +     * The words that were expanded.
        +     * 
        + * + * repeated .google.showcase.v1beta1.EchoResponse responses = 1; + */ + public Builder setResponses( + int index, com.google.showcase.v1beta1.EchoResponse.Builder builderForValue) { + if (responsesBuilder_ == null) { + ensureResponsesIsMutable(); + responses_.set(index, builderForValue.build()); + onChanged(); + } else { + responsesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
        +     * The words that were expanded.
        +     * 
        + * + * repeated .google.showcase.v1beta1.EchoResponse responses = 1; + */ + public Builder addResponses(com.google.showcase.v1beta1.EchoResponse value) { + if (responsesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureResponsesIsMutable(); + responses_.add(value); + onChanged(); + } else { + responsesBuilder_.addMessage(value); + } + return this; + } + + /** + * + * + *
        +     * The words that were expanded.
        +     * 
        + * + * repeated .google.showcase.v1beta1.EchoResponse responses = 1; + */ + public Builder addResponses(int index, com.google.showcase.v1beta1.EchoResponse value) { + if (responsesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureResponsesIsMutable(); + responses_.add(index, value); + onChanged(); + } else { + responsesBuilder_.addMessage(index, value); + } + return this; + } + + /** + * + * + *
        +     * The words that were expanded.
        +     * 
        + * + * repeated .google.showcase.v1beta1.EchoResponse responses = 1; + */ + public Builder addResponses(com.google.showcase.v1beta1.EchoResponse.Builder builderForValue) { + if (responsesBuilder_ == null) { + ensureResponsesIsMutable(); + responses_.add(builderForValue.build()); + onChanged(); + } else { + responsesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + + /** + * + * + *
        +     * The words that were expanded.
        +     * 
        + * + * repeated .google.showcase.v1beta1.EchoResponse responses = 1; + */ + public Builder addResponses( + int index, com.google.showcase.v1beta1.EchoResponse.Builder builderForValue) { + if (responsesBuilder_ == null) { + ensureResponsesIsMutable(); + responses_.add(index, builderForValue.build()); + onChanged(); + } else { + responsesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
        +     * The words that were expanded.
        +     * 
        + * + * repeated .google.showcase.v1beta1.EchoResponse responses = 1; + */ + public Builder addAllResponses( + java.lang.Iterable values) { + if (responsesBuilder_ == null) { + ensureResponsesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, responses_); + onChanged(); + } else { + responsesBuilder_.addAllMessages(values); + } + return this; + } + + /** + * + * + *
        +     * The words that were expanded.
        +     * 
        + * + * repeated .google.showcase.v1beta1.EchoResponse responses = 1; + */ + public Builder clearResponses() { + if (responsesBuilder_ == null) { + responses_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + responsesBuilder_.clear(); + } + return this; + } + + /** + * + * + *
        +     * The words that were expanded.
        +     * 
        + * + * repeated .google.showcase.v1beta1.EchoResponse responses = 1; + */ + public Builder removeResponses(int index) { + if (responsesBuilder_ == null) { + ensureResponsesIsMutable(); + responses_.remove(index); + onChanged(); + } else { + responsesBuilder_.remove(index); + } + return this; + } + + /** + * + * + *
        +     * The words that were expanded.
        +     * 
        + * + * repeated .google.showcase.v1beta1.EchoResponse responses = 1; + */ + public com.google.showcase.v1beta1.EchoResponse.Builder getResponsesBuilder(int index) { + return getResponsesFieldBuilder().getBuilder(index); + } + + /** + * + * + *
        +     * The words that were expanded.
        +     * 
        + * + * repeated .google.showcase.v1beta1.EchoResponse responses = 1; + */ + public com.google.showcase.v1beta1.EchoResponseOrBuilder getResponsesOrBuilder(int index) { + if (responsesBuilder_ == null) { + return responses_.get(index); + } else { + return responsesBuilder_.getMessageOrBuilder(index); + } + } + + /** + * + * + *
        +     * The words that were expanded.
        +     * 
        + * + * repeated .google.showcase.v1beta1.EchoResponse responses = 1; + */ + public java.util.List + getResponsesOrBuilderList() { + if (responsesBuilder_ != null) { + return responsesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(responses_); + } + } + + /** + * + * + *
        +     * The words that were expanded.
        +     * 
        + * + * repeated .google.showcase.v1beta1.EchoResponse responses = 1; + */ + public com.google.showcase.v1beta1.EchoResponse.Builder addResponsesBuilder() { + return getResponsesFieldBuilder() + .addBuilder(com.google.showcase.v1beta1.EchoResponse.getDefaultInstance()); + } + + /** + * + * + *
        +     * The words that were expanded.
        +     * 
        + * + * repeated .google.showcase.v1beta1.EchoResponse responses = 1; + */ + public com.google.showcase.v1beta1.EchoResponse.Builder addResponsesBuilder(int index) { + return getResponsesFieldBuilder() + .addBuilder(index, com.google.showcase.v1beta1.EchoResponse.getDefaultInstance()); + } + + /** + * + * + *
        +     * The words that were expanded.
        +     * 
        + * + * repeated .google.showcase.v1beta1.EchoResponse responses = 1; + */ + public java.util.List + getResponsesBuilderList() { + return getResponsesFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.showcase.v1beta1.EchoResponse, + com.google.showcase.v1beta1.EchoResponse.Builder, + com.google.showcase.v1beta1.EchoResponseOrBuilder> + getResponsesFieldBuilder() { + if (responsesBuilder_ == null) { + responsesBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.showcase.v1beta1.EchoResponse, + com.google.showcase.v1beta1.EchoResponse.Builder, + com.google.showcase.v1beta1.EchoResponseOrBuilder>( + responses_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + responses_ = null; + } + return responsesBuilder_; + } + + private java.lang.Object nextPageToken_ = ""; + + /** + * + * + *
        +     * The next page token.
        +     * 
        + * + * 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; + } + } + + /** + * + * + *
        +     * The next page token.
        +     * 
        + * + * 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; + } + } + + /** + * + * + *
        +     * The next page token.
        +     * 
        + * + * string next_page_token = 2; + * + * @param value The nextPageToken to set. + * @return This builder for chaining. + */ + public Builder setNextPageToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + nextPageToken_ = value; + onChanged(); + return this; + } + + /** + * + * + *
        +     * The next page token.
        +     * 
        + * + * string next_page_token = 2; + * + * @return This builder for chaining. + */ + public Builder clearNextPageToken() { + + nextPageToken_ = getDefaultInstance().getNextPageToken(); + onChanged(); + return this; + } + + /** + * + * + *
        +     * The next page token.
        +     * 
        + * + * string next_page_token = 2; + * + * @param value The bytes for nextPageToken to set. + * @return This builder for chaining. + */ + public Builder setNextPageTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + nextPageToken_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.showcase.v1beta1.PagedExpandResponse) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.PagedExpandResponse) + private static final com.google.showcase.v1beta1.PagedExpandResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.PagedExpandResponse(); + } + + public static com.google.showcase.v1beta1.PagedExpandResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public PagedExpandResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new PagedExpandResponse(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.showcase.v1beta1.PagedExpandResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/PagedExpandResponseList.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/PagedExpandResponseList.java new file mode 100644 index 0000000000..4d2cbaa0ed --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/PagedExpandResponseList.java @@ -0,0 +1,676 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/echo.proto + +package com.google.showcase.v1beta1; + +/** + * + * + *
        + * A list of words.
        + * 
        + * + * Protobuf type {@code google.showcase.v1beta1.PagedExpandResponseList} + */ +public final class PagedExpandResponseList extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.PagedExpandResponseList) + PagedExpandResponseListOrBuilder { + private static final long serialVersionUID = 0L; + + // Use PagedExpandResponseList.newBuilder() to construct. + private PagedExpandResponseList(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private PagedExpandResponseList() { + words_ = com.google.protobuf.LazyStringArrayList.EMPTY; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new PagedExpandResponseList(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private PagedExpandResponseList( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + words_ = new com.google.protobuf.LazyStringArrayList(); + mutable_bitField0_ |= 0x00000001; + } + words_.add(s); + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + words_ = words_.getUnmodifiableView(); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.EchoOuterClass + .internal_static_google_showcase_v1beta1_PagedExpandResponseList_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.EchoOuterClass + .internal_static_google_showcase_v1beta1_PagedExpandResponseList_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.PagedExpandResponseList.class, + com.google.showcase.v1beta1.PagedExpandResponseList.Builder.class); + } + + public static final int WORDS_FIELD_NUMBER = 1; + private com.google.protobuf.LazyStringList words_; + + /** + * repeated string words = 1; + * + * @return A list containing the words. + */ + public com.google.protobuf.ProtocolStringList getWordsList() { + return words_; + } + + /** + * repeated string words = 1; + * + * @return The count of words. + */ + public int getWordsCount() { + return words_.size(); + } + + /** + * repeated string words = 1; + * + * @param index The index of the element to return. + * @return The words at the given index. + */ + public java.lang.String getWords(int index) { + return words_.get(index); + } + + /** + * repeated string words = 1; + * + * @param index The index of the value to return. + * @return The bytes of the words at the given index. + */ + public com.google.protobuf.ByteString getWordsBytes(int index) { + return words_.getByteString(index); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + for (int i = 0; i < words_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, words_.getRaw(i)); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + { + int dataSize = 0; + for (int i = 0; i < words_.size(); i++) { + dataSize += computeStringSizeNoTag(words_.getRaw(i)); + } + size += dataSize; + size += 1 * getWordsList().size(); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.showcase.v1beta1.PagedExpandResponseList)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.PagedExpandResponseList other = + (com.google.showcase.v1beta1.PagedExpandResponseList) obj; + + if (!getWordsList().equals(other.getWordsList())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getWordsCount() > 0) { + hash = (37 * hash) + WORDS_FIELD_NUMBER; + hash = (53 * hash) + getWordsList().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.showcase.v1beta1.PagedExpandResponseList parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.PagedExpandResponseList parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.PagedExpandResponseList parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.PagedExpandResponseList 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.showcase.v1beta1.PagedExpandResponseList parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.PagedExpandResponseList parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.PagedExpandResponseList parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.PagedExpandResponseList 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.showcase.v1beta1.PagedExpandResponseList parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.PagedExpandResponseList 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.showcase.v1beta1.PagedExpandResponseList parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.PagedExpandResponseList 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.showcase.v1beta1.PagedExpandResponseList prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
        +   * A list of words.
        +   * 
        + * + * Protobuf type {@code google.showcase.v1beta1.PagedExpandResponseList} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.PagedExpandResponseList) + com.google.showcase.v1beta1.PagedExpandResponseListOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.EchoOuterClass + .internal_static_google_showcase_v1beta1_PagedExpandResponseList_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.EchoOuterClass + .internal_static_google_showcase_v1beta1_PagedExpandResponseList_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.PagedExpandResponseList.class, + com.google.showcase.v1beta1.PagedExpandResponseList.Builder.class); + } + + // Construct using com.google.showcase.v1beta1.PagedExpandResponseList.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + words_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000001); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.showcase.v1beta1.EchoOuterClass + .internal_static_google_showcase_v1beta1_PagedExpandResponseList_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.PagedExpandResponseList getDefaultInstanceForType() { + return com.google.showcase.v1beta1.PagedExpandResponseList.getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.PagedExpandResponseList build() { + com.google.showcase.v1beta1.PagedExpandResponseList result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.PagedExpandResponseList buildPartial() { + com.google.showcase.v1beta1.PagedExpandResponseList result = + new com.google.showcase.v1beta1.PagedExpandResponseList(this); + int from_bitField0_ = bitField0_; + if (((bitField0_ & 0x00000001) != 0)) { + words_ = words_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.words_ = words_; + 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.showcase.v1beta1.PagedExpandResponseList) { + return mergeFrom((com.google.showcase.v1beta1.PagedExpandResponseList) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.showcase.v1beta1.PagedExpandResponseList other) { + if (other == com.google.showcase.v1beta1.PagedExpandResponseList.getDefaultInstance()) + return this; + if (!other.words_.isEmpty()) { + if (words_.isEmpty()) { + words_ = other.words_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureWordsIsMutable(); + words_.addAll(other.words_); + } + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.showcase.v1beta1.PagedExpandResponseList parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.showcase.v1beta1.PagedExpandResponseList) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private com.google.protobuf.LazyStringList words_ = + com.google.protobuf.LazyStringArrayList.EMPTY; + + private void ensureWordsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + words_ = new com.google.protobuf.LazyStringArrayList(words_); + bitField0_ |= 0x00000001; + } + } + + /** + * repeated string words = 1; + * + * @return A list containing the words. + */ + public com.google.protobuf.ProtocolStringList getWordsList() { + return words_.getUnmodifiableView(); + } + + /** + * repeated string words = 1; + * + * @return The count of words. + */ + public int getWordsCount() { + return words_.size(); + } + + /** + * repeated string words = 1; + * + * @param index The index of the element to return. + * @return The words at the given index. + */ + public java.lang.String getWords(int index) { + return words_.get(index); + } + + /** + * repeated string words = 1; + * + * @param index The index of the value to return. + * @return The bytes of the words at the given index. + */ + public com.google.protobuf.ByteString getWordsBytes(int index) { + return words_.getByteString(index); + } + + /** + * repeated string words = 1; + * + * @param index The index to set the value at. + * @param value The words to set. + * @return This builder for chaining. + */ + public Builder setWords(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureWordsIsMutable(); + words_.set(index, value); + onChanged(); + return this; + } + + /** + * repeated string words = 1; + * + * @param value The words to add. + * @return This builder for chaining. + */ + public Builder addWords(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureWordsIsMutable(); + words_.add(value); + onChanged(); + return this; + } + + /** + * repeated string words = 1; + * + * @param values The words to add. + * @return This builder for chaining. + */ + public Builder addAllWords(java.lang.Iterable values) { + ensureWordsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, words_); + onChanged(); + return this; + } + + /** + * repeated string words = 1; + * + * @return This builder for chaining. + */ + public Builder clearWords() { + words_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * repeated string words = 1; + * + * @param value The bytes of the words to add. + * @return This builder for chaining. + */ + public Builder addWordsBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureWordsIsMutable(); + words_.add(value); + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.showcase.v1beta1.PagedExpandResponseList) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.PagedExpandResponseList) + private static final com.google.showcase.v1beta1.PagedExpandResponseList DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.PagedExpandResponseList(); + } + + public static com.google.showcase.v1beta1.PagedExpandResponseList getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public PagedExpandResponseList parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new PagedExpandResponseList(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.showcase.v1beta1.PagedExpandResponseList getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/PagedExpandResponseListOrBuilder.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/PagedExpandResponseListOrBuilder.java new file mode 100644 index 0000000000..ca8e53aab6 --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/PagedExpandResponseListOrBuilder.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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/echo.proto + +package com.google.showcase.v1beta1; + +public interface PagedExpandResponseListOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.PagedExpandResponseList) + com.google.protobuf.MessageOrBuilder { + + /** + * repeated string words = 1; + * + * @return A list containing the words. + */ + java.util.List getWordsList(); + + /** + * repeated string words = 1; + * + * @return The count of words. + */ + int getWordsCount(); + + /** + * repeated string words = 1; + * + * @param index The index of the element to return. + * @return The words at the given index. + */ + java.lang.String getWords(int index); + + /** + * repeated string words = 1; + * + * @param index The index of the value to return. + * @return The bytes of the words at the given index. + */ + com.google.protobuf.ByteString getWordsBytes(int index); +} diff --git a/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/PagedExpandResponseOrBuilder.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/PagedExpandResponseOrBuilder.java new file mode 100644 index 0000000000..9171114d4a --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/PagedExpandResponseOrBuilder.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: schema/google/showcase/v1beta1/echo.proto + +package com.google.showcase.v1beta1; + +public interface PagedExpandResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.PagedExpandResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
        +   * The words that were expanded.
        +   * 
        + * + * repeated .google.showcase.v1beta1.EchoResponse responses = 1; + */ + java.util.List getResponsesList(); + + /** + * + * + *
        +   * The words that were expanded.
        +   * 
        + * + * repeated .google.showcase.v1beta1.EchoResponse responses = 1; + */ + com.google.showcase.v1beta1.EchoResponse getResponses(int index); + + /** + * + * + *
        +   * The words that were expanded.
        +   * 
        + * + * repeated .google.showcase.v1beta1.EchoResponse responses = 1; + */ + int getResponsesCount(); + + /** + * + * + *
        +   * The words that were expanded.
        +   * 
        + * + * repeated .google.showcase.v1beta1.EchoResponse responses = 1; + */ + java.util.List + getResponsesOrBuilderList(); + + /** + * + * + *
        +   * The words that were expanded.
        +   * 
        + * + * repeated .google.showcase.v1beta1.EchoResponse responses = 1; + */ + com.google.showcase.v1beta1.EchoResponseOrBuilder getResponsesOrBuilder(int index); + + /** + * + * + *
        +   * The next page token.
        +   * 
        + * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + java.lang.String getNextPageToken(); + + /** + * + * + *
        +   * The next page token.
        +   * 
        + * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + com.google.protobuf.ByteString getNextPageTokenBytes(); +} diff --git a/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/PoetryError.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/PoetryError.java new file mode 100644 index 0000000000..b2e280ccf1 --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/PoetryError.java @@ -0,0 +1,606 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/echo.proto + +package com.google.showcase.v1beta1; + +/** + * + * + *
        + * The custom error detail to be included in the error response from the
        + * FailEchoWithDetails method. Client libraries should be able to
        + * surface this custom error detail.
        + * 
        + * + * Protobuf type {@code google.showcase.v1beta1.PoetryError} + */ +public final class PoetryError extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.PoetryError) + PoetryErrorOrBuilder { + private static final long serialVersionUID = 0L; + + // Use PoetryError.newBuilder() to construct. + private PoetryError(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private PoetryError() { + poem_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new PoetryError(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private PoetryError( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + poem_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.EchoOuterClass + .internal_static_google_showcase_v1beta1_PoetryError_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.EchoOuterClass + .internal_static_google_showcase_v1beta1_PoetryError_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.PoetryError.class, + com.google.showcase.v1beta1.PoetryError.Builder.class); + } + + public static final int POEM_FIELD_NUMBER = 1; + private volatile java.lang.Object poem_; + + /** + * string poem = 1; + * + * @return The poem. + */ + @java.lang.Override + public java.lang.String getPoem() { + java.lang.Object ref = poem_; + 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(); + poem_ = s; + return s; + } + } + + /** + * string poem = 1; + * + * @return The bytes for poem. + */ + @java.lang.Override + public com.google.protobuf.ByteString getPoemBytes() { + java.lang.Object ref = poem_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + poem_ = 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(poem_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, poem_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(poem_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, poem_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.showcase.v1beta1.PoetryError)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.PoetryError other = (com.google.showcase.v1beta1.PoetryError) obj; + + if (!getPoem().equals(other.getPoem())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + POEM_FIELD_NUMBER; + hash = (53 * hash) + getPoem().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.showcase.v1beta1.PoetryError parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.PoetryError parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.PoetryError parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.PoetryError 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.showcase.v1beta1.PoetryError parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.PoetryError parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.PoetryError parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.PoetryError 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.showcase.v1beta1.PoetryError parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.PoetryError 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.showcase.v1beta1.PoetryError parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.PoetryError 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.showcase.v1beta1.PoetryError 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 custom error detail to be included in the error response from the
        +   * FailEchoWithDetails method. Client libraries should be able to
        +   * surface this custom error detail.
        +   * 
        + * + * Protobuf type {@code google.showcase.v1beta1.PoetryError} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.PoetryError) + com.google.showcase.v1beta1.PoetryErrorOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.EchoOuterClass + .internal_static_google_showcase_v1beta1_PoetryError_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.EchoOuterClass + .internal_static_google_showcase_v1beta1_PoetryError_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.PoetryError.class, + com.google.showcase.v1beta1.PoetryError.Builder.class); + } + + // Construct using com.google.showcase.v1beta1.PoetryError.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + poem_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.showcase.v1beta1.EchoOuterClass + .internal_static_google_showcase_v1beta1_PoetryError_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.PoetryError getDefaultInstanceForType() { + return com.google.showcase.v1beta1.PoetryError.getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.PoetryError build() { + com.google.showcase.v1beta1.PoetryError result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.PoetryError buildPartial() { + com.google.showcase.v1beta1.PoetryError result = + new com.google.showcase.v1beta1.PoetryError(this); + result.poem_ = poem_; + 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.showcase.v1beta1.PoetryError) { + return mergeFrom((com.google.showcase.v1beta1.PoetryError) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.showcase.v1beta1.PoetryError other) { + if (other == com.google.showcase.v1beta1.PoetryError.getDefaultInstance()) return this; + if (!other.getPoem().isEmpty()) { + poem_ = other.poem_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.showcase.v1beta1.PoetryError parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.showcase.v1beta1.PoetryError) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object poem_ = ""; + + /** + * string poem = 1; + * + * @return The poem. + */ + public java.lang.String getPoem() { + java.lang.Object ref = poem_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + poem_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * string poem = 1; + * + * @return The bytes for poem. + */ + public com.google.protobuf.ByteString getPoemBytes() { + java.lang.Object ref = poem_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + poem_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * string poem = 1; + * + * @param value The poem to set. + * @return This builder for chaining. + */ + public Builder setPoem(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + poem_ = value; + onChanged(); + return this; + } + + /** + * string poem = 1; + * + * @return This builder for chaining. + */ + public Builder clearPoem() { + + poem_ = getDefaultInstance().getPoem(); + onChanged(); + return this; + } + + /** + * string poem = 1; + * + * @param value The bytes for poem to set. + * @return This builder for chaining. + */ + public Builder setPoemBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + poem_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.showcase.v1beta1.PoetryError) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.PoetryError) + private static final com.google.showcase.v1beta1.PoetryError DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.PoetryError(); + } + + public static com.google.showcase.v1beta1.PoetryError getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public PoetryError parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new PoetryError(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.showcase.v1beta1.PoetryError getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/PoetryErrorOrBuilder.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/PoetryErrorOrBuilder.java new file mode 100644 index 0000000000..a7ae660a46 --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/PoetryErrorOrBuilder.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: schema/google/showcase/v1beta1/echo.proto + +package com.google.showcase.v1beta1; + +public interface PoetryErrorOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.PoetryError) + com.google.protobuf.MessageOrBuilder { + + /** + * string poem = 1; + * + * @return The poem. + */ + java.lang.String getPoem(); + + /** + * string poem = 1; + * + * @return The bytes for poem. + */ + com.google.protobuf.ByteString getPoemBytes(); +} diff --git a/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ProfileName.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ProfileName.java new file mode 100644 index 0000000000..86d11a20a2 --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ProfileName.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.showcase.v1beta1; + +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +@Generated("by gapic-generator-java") +public class ProfileName implements ResourceName { + private static final PathTemplate USER = + PathTemplate.createWithoutUrlEncoding("users/{user}/profile/blurbs"); + private volatile Map fieldValuesMap; + private final String user; + + @Deprecated + protected ProfileName() { + user = null; + } + + private ProfileName(Builder builder) { + user = Preconditions.checkNotNull(builder.getUser()); + } + + public String getUser() { + return user; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + public static ProfileName of(String user) { + return newBuilder().setUser(user).build(); + } + + public static String format(String user) { + return newBuilder().setUser(user).build().toString(); + } + + public static ProfileName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + USER.validatedMatch( + formattedString, "ProfileName.parse: formattedString not in valid format"); + return of(matchMap.get("user")); + } + + 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 (ProfileName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return USER.matches(formattedString); + } + + @Override + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + if (user != null) { + fieldMapBuilder.put("user", user); + } + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return USER.instantiate("user", user); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o != null && getClass() == o.getClass()) { + ProfileName that = ((ProfileName) o); + return Objects.equals(this.user, that.user); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= Objects.hashCode(user); + return h; + } + + /** Builder for users/{user}/profile/blurbs. */ + public static class Builder { + private String user; + + protected Builder() {} + + public String getUser() { + return user; + } + + public Builder setUser(String user) { + this.user = user; + return this; + } + + private Builder(ProfileName profileName) { + this.user = profileName.user; + } + + public ProfileName build() { + return new ProfileName(this); + } + } +} diff --git a/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/RepeatRequest.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/RepeatRequest.java new file mode 100644 index 0000000000..4135ea6b9f --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/RepeatRequest.java @@ -0,0 +1,1660 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/compliance.proto + +package com.google.showcase.v1beta1; + +/** Protobuf type {@code google.showcase.v1beta1.RepeatRequest} */ +public final class RepeatRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.RepeatRequest) + RepeatRequestOrBuilder { + private static final long serialVersionUID = 0L; + + // Use RepeatRequest.newBuilder() to construct. + private RepeatRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private RepeatRequest() { + name_ = ""; + intendedBindingUri_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new RepeatRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private RepeatRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + break; + } + case 18: + { + com.google.showcase.v1beta1.ComplianceData.Builder subBuilder = null; + if (info_ != null) { + subBuilder = info_.toBuilder(); + } + info_ = + input.readMessage( + com.google.showcase.v1beta1.ComplianceData.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(info_); + info_ = subBuilder.buildPartial(); + } + + break; + } + case 24: + { + serverVerify_ = input.readBool(); + break; + } + case 32: + { + fInt32_ = input.readInt32(); + break; + } + case 40: + { + fInt64_ = input.readInt64(); + break; + } + case 49: + { + fDouble_ = input.readDouble(); + break; + } + case 56: + { + bitField0_ |= 0x00000002; + pInt32_ = input.readInt32(); + break; + } + case 64: + { + bitField0_ |= 0x00000004; + pInt64_ = input.readInt64(); + break; + } + case 73: + { + bitField0_ |= 0x00000008; + pDouble_ = input.readDouble(); + break; + } + case 82: + { + java.lang.String s = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + intendedBindingUri_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.ComplianceOuterClass + .internal_static_google_showcase_v1beta1_RepeatRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.ComplianceOuterClass + .internal_static_google_showcase_v1beta1_RepeatRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.RepeatRequest.class, + com.google.showcase.v1beta1.RepeatRequest.Builder.class); + } + + private int bitField0_; + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + + /** + * 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; + } + } + + /** + * 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 INFO_FIELD_NUMBER = 2; + private com.google.showcase.v1beta1.ComplianceData info_; + + /** + * .google.showcase.v1beta1.ComplianceData info = 2; + * + * @return Whether the info field is set. + */ + @java.lang.Override + public boolean hasInfo() { + return info_ != null; + } + + /** + * .google.showcase.v1beta1.ComplianceData info = 2; + * + * @return The info. + */ + @java.lang.Override + public com.google.showcase.v1beta1.ComplianceData getInfo() { + return info_ == null ? com.google.showcase.v1beta1.ComplianceData.getDefaultInstance() : info_; + } + + /** .google.showcase.v1beta1.ComplianceData info = 2; */ + @java.lang.Override + public com.google.showcase.v1beta1.ComplianceDataOrBuilder getInfoOrBuilder() { + return getInfo(); + } + + public static final int SERVER_VERIFY_FIELD_NUMBER = 3; + private boolean serverVerify_; + + /** + * + * + *
        +   * If true, the server will verify that the received request matches
        +   * the request with the same name in the compliance test suite.
        +   * 
        + * + * bool server_verify = 3; + * + * @return The serverVerify. + */ + @java.lang.Override + public boolean getServerVerify() { + return serverVerify_; + } + + public static final int INTENDED_BINDING_URI_FIELD_NUMBER = 10; + private volatile java.lang.Object intendedBindingUri_; + + /** + * + * + *
        +   * The URI template this request is expected to be bound to server-side.
        +   * 
        + * + * optional string intended_binding_uri = 10; + * + * @return Whether the intendedBindingUri field is set. + */ + @java.lang.Override + public boolean hasIntendedBindingUri() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
        +   * The URI template this request is expected to be bound to server-side.
        +   * 
        + * + * optional string intended_binding_uri = 10; + * + * @return The intendedBindingUri. + */ + @java.lang.Override + public java.lang.String getIntendedBindingUri() { + java.lang.Object ref = intendedBindingUri_; + 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(); + intendedBindingUri_ = s; + return s; + } + } + + /** + * + * + *
        +   * The URI template this request is expected to be bound to server-side.
        +   * 
        + * + * optional string intended_binding_uri = 10; + * + * @return The bytes for intendedBindingUri. + */ + @java.lang.Override + public com.google.protobuf.ByteString getIntendedBindingUriBytes() { + java.lang.Object ref = intendedBindingUri_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + intendedBindingUri_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int F_INT32_FIELD_NUMBER = 4; + private int fInt32_; + + /** + * + * + *
        +   * Some top level fields, to test that these are encoded correctly
        +   * in query params.
        +   * 
        + * + * int32 f_int32 = 4; + * + * @return The fInt32. + */ + @java.lang.Override + public int getFInt32() { + return fInt32_; + } + + public static final int F_INT64_FIELD_NUMBER = 5; + private long fInt64_; + + /** + * int64 f_int64 = 5; + * + * @return The fInt64. + */ + @java.lang.Override + public long getFInt64() { + return fInt64_; + } + + public static final int F_DOUBLE_FIELD_NUMBER = 6; + private double fDouble_; + + /** + * double f_double = 6; + * + * @return The fDouble. + */ + @java.lang.Override + public double getFDouble() { + return fDouble_; + } + + public static final int P_INT32_FIELD_NUMBER = 7; + private int pInt32_; + + /** + * optional int32 p_int32 = 7; + * + * @return Whether the pInt32 field is set. + */ + @java.lang.Override + public boolean hasPInt32() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * optional int32 p_int32 = 7; + * + * @return The pInt32. + */ + @java.lang.Override + public int getPInt32() { + return pInt32_; + } + + public static final int P_INT64_FIELD_NUMBER = 8; + private long pInt64_; + + /** + * optional int64 p_int64 = 8; + * + * @return Whether the pInt64 field is set. + */ + @java.lang.Override + public boolean hasPInt64() { + return ((bitField0_ & 0x00000004) != 0); + } + + /** + * optional int64 p_int64 = 8; + * + * @return The pInt64. + */ + @java.lang.Override + public long getPInt64() { + return pInt64_; + } + + public static final int P_DOUBLE_FIELD_NUMBER = 9; + private double pDouble_; + + /** + * optional double p_double = 9; + * + * @return Whether the pDouble field is set. + */ + @java.lang.Override + public boolean hasPDouble() { + return ((bitField0_ & 0x00000008) != 0); + } + + /** + * optional double p_double = 9; + * + * @return The pDouble. + */ + @java.lang.Override + public double getPDouble() { + return pDouble_; + } + + 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 (info_ != null) { + output.writeMessage(2, getInfo()); + } + if (serverVerify_ != false) { + output.writeBool(3, serverVerify_); + } + if (fInt32_ != 0) { + output.writeInt32(4, fInt32_); + } + if (fInt64_ != 0L) { + output.writeInt64(5, fInt64_); + } + if (java.lang.Double.doubleToRawLongBits(fDouble_) != 0) { + output.writeDouble(6, fDouble_); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeInt32(7, pInt32_); + } + if (((bitField0_ & 0x00000004) != 0)) { + output.writeInt64(8, pInt64_); + } + if (((bitField0_ & 0x00000008) != 0)) { + output.writeDouble(9, pDouble_); + } + if (((bitField0_ & 0x00000001) != 0)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 10, intendedBindingUri_); + } + unknownFields.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 (info_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getInfo()); + } + if (serverVerify_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(3, serverVerify_); + } + if (fInt32_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(4, fInt32_); + } + if (fInt64_ != 0L) { + size += com.google.protobuf.CodedOutputStream.computeInt64Size(5, fInt64_); + } + if (java.lang.Double.doubleToRawLongBits(fDouble_) != 0) { + size += com.google.protobuf.CodedOutputStream.computeDoubleSize(6, fDouble_); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(7, pInt32_); + } + if (((bitField0_ & 0x00000004) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeInt64Size(8, pInt64_); + } + if (((bitField0_ & 0x00000008) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeDoubleSize(9, pDouble_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(10, intendedBindingUri_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.showcase.v1beta1.RepeatRequest)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.RepeatRequest other = + (com.google.showcase.v1beta1.RepeatRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (hasInfo() != other.hasInfo()) return false; + if (hasInfo()) { + if (!getInfo().equals(other.getInfo())) return false; + } + if (getServerVerify() != other.getServerVerify()) return false; + if (hasIntendedBindingUri() != other.hasIntendedBindingUri()) return false; + if (hasIntendedBindingUri()) { + if (!getIntendedBindingUri().equals(other.getIntendedBindingUri())) return false; + } + if (getFInt32() != other.getFInt32()) return false; + if (getFInt64() != other.getFInt64()) return false; + if (java.lang.Double.doubleToLongBits(getFDouble()) + != java.lang.Double.doubleToLongBits(other.getFDouble())) return false; + if (hasPInt32() != other.hasPInt32()) return false; + if (hasPInt32()) { + if (getPInt32() != other.getPInt32()) return false; + } + if (hasPInt64() != other.hasPInt64()) return false; + if (hasPInt64()) { + if (getPInt64() != other.getPInt64()) return false; + } + if (hasPDouble() != other.hasPDouble()) return false; + if (hasPDouble()) { + if (java.lang.Double.doubleToLongBits(getPDouble()) + != java.lang.Double.doubleToLongBits(other.getPDouble())) return false; + } + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + if (hasInfo()) { + hash = (37 * hash) + INFO_FIELD_NUMBER; + hash = (53 * hash) + getInfo().hashCode(); + } + hash = (37 * hash) + SERVER_VERIFY_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getServerVerify()); + if (hasIntendedBindingUri()) { + hash = (37 * hash) + INTENDED_BINDING_URI_FIELD_NUMBER; + hash = (53 * hash) + getIntendedBindingUri().hashCode(); + } + hash = (37 * hash) + F_INT32_FIELD_NUMBER; + hash = (53 * hash) + getFInt32(); + hash = (37 * hash) + F_INT64_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getFInt64()); + hash = (37 * hash) + F_DOUBLE_FIELD_NUMBER; + hash = + (53 * hash) + + com.google.protobuf.Internal.hashLong( + java.lang.Double.doubleToLongBits(getFDouble())); + if (hasPInt32()) { + hash = (37 * hash) + P_INT32_FIELD_NUMBER; + hash = (53 * hash) + getPInt32(); + } + if (hasPInt64()) { + hash = (37 * hash) + P_INT64_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getPInt64()); + } + if (hasPDouble()) { + hash = (37 * hash) + P_DOUBLE_FIELD_NUMBER; + hash = + (53 * hash) + + com.google.protobuf.Internal.hashLong( + java.lang.Double.doubleToLongBits(getPDouble())); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.showcase.v1beta1.RepeatRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.RepeatRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.RepeatRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.RepeatRequest 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.showcase.v1beta1.RepeatRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.RepeatRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.RepeatRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.RepeatRequest 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.showcase.v1beta1.RepeatRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.RepeatRequest 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.showcase.v1beta1.RepeatRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.RepeatRequest 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.showcase.v1beta1.RepeatRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** Protobuf type {@code google.showcase.v1beta1.RepeatRequest} */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.RepeatRequest) + com.google.showcase.v1beta1.RepeatRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.ComplianceOuterClass + .internal_static_google_showcase_v1beta1_RepeatRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.ComplianceOuterClass + .internal_static_google_showcase_v1beta1_RepeatRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.RepeatRequest.class, + com.google.showcase.v1beta1.RepeatRequest.Builder.class); + } + + // Construct using com.google.showcase.v1beta1.RepeatRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + if (infoBuilder_ == null) { + info_ = null; + } else { + info_ = null; + infoBuilder_ = null; + } + serverVerify_ = false; + + intendedBindingUri_ = ""; + bitField0_ = (bitField0_ & ~0x00000001); + fInt32_ = 0; + + fInt64_ = 0L; + + fDouble_ = 0D; + + pInt32_ = 0; + bitField0_ = (bitField0_ & ~0x00000002); + pInt64_ = 0L; + bitField0_ = (bitField0_ & ~0x00000004); + pDouble_ = 0D; + bitField0_ = (bitField0_ & ~0x00000008); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.showcase.v1beta1.ComplianceOuterClass + .internal_static_google_showcase_v1beta1_RepeatRequest_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.RepeatRequest getDefaultInstanceForType() { + return com.google.showcase.v1beta1.RepeatRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.RepeatRequest build() { + com.google.showcase.v1beta1.RepeatRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.RepeatRequest buildPartial() { + com.google.showcase.v1beta1.RepeatRequest result = + new com.google.showcase.v1beta1.RepeatRequest(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + result.name_ = name_; + if (infoBuilder_ == null) { + result.info_ = info_; + } else { + result.info_ = infoBuilder_.build(); + } + result.serverVerify_ = serverVerify_; + if (((from_bitField0_ & 0x00000001) != 0)) { + to_bitField0_ |= 0x00000001; + } + result.intendedBindingUri_ = intendedBindingUri_; + result.fInt32_ = fInt32_; + result.fInt64_ = fInt64_; + result.fDouble_ = fDouble_; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.pInt32_ = pInt32_; + to_bitField0_ |= 0x00000002; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.pInt64_ = pInt64_; + to_bitField0_ |= 0x00000004; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.pDouble_ = pDouble_; + to_bitField0_ |= 0x00000008; + } + result.bitField0_ = to_bitField0_; + 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.showcase.v1beta1.RepeatRequest) { + return mergeFrom((com.google.showcase.v1beta1.RepeatRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.showcase.v1beta1.RepeatRequest other) { + if (other == com.google.showcase.v1beta1.RepeatRequest.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + if (other.hasInfo()) { + mergeInfo(other.getInfo()); + } + if (other.getServerVerify() != false) { + setServerVerify(other.getServerVerify()); + } + if (other.hasIntendedBindingUri()) { + bitField0_ |= 0x00000001; + intendedBindingUri_ = other.intendedBindingUri_; + onChanged(); + } + if (other.getFInt32() != 0) { + setFInt32(other.getFInt32()); + } + if (other.getFInt64() != 0L) { + setFInt64(other.getFInt64()); + } + if (other.getFDouble() != 0D) { + setFDouble(other.getFDouble()); + } + if (other.hasPInt32()) { + setPInt32(other.getPInt32()); + } + if (other.hasPInt64()) { + setPInt64(other.getPInt64()); + } + if (other.hasPDouble()) { + setPDouble(other.getPDouble()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.showcase.v1beta1.RepeatRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.showcase.v1beta1.RepeatRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + + /** + * string name = 1; + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * 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; + } + } + + /** + * string name = 1; + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + + /** + * string name = 1; + * + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + + /** + * string name = 1; + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + + private com.google.showcase.v1beta1.ComplianceData info_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.showcase.v1beta1.ComplianceData, + com.google.showcase.v1beta1.ComplianceData.Builder, + com.google.showcase.v1beta1.ComplianceDataOrBuilder> + infoBuilder_; + + /** + * .google.showcase.v1beta1.ComplianceData info = 2; + * + * @return Whether the info field is set. + */ + public boolean hasInfo() { + return infoBuilder_ != null || info_ != null; + } + + /** + * .google.showcase.v1beta1.ComplianceData info = 2; + * + * @return The info. + */ + public com.google.showcase.v1beta1.ComplianceData getInfo() { + if (infoBuilder_ == null) { + return info_ == null + ? com.google.showcase.v1beta1.ComplianceData.getDefaultInstance() + : info_; + } else { + return infoBuilder_.getMessage(); + } + } + + /** .google.showcase.v1beta1.ComplianceData info = 2; */ + public Builder setInfo(com.google.showcase.v1beta1.ComplianceData value) { + if (infoBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + info_ = value; + onChanged(); + } else { + infoBuilder_.setMessage(value); + } + + return this; + } + + /** .google.showcase.v1beta1.ComplianceData info = 2; */ + public Builder setInfo(com.google.showcase.v1beta1.ComplianceData.Builder builderForValue) { + if (infoBuilder_ == null) { + info_ = builderForValue.build(); + onChanged(); + } else { + infoBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + + /** .google.showcase.v1beta1.ComplianceData info = 2; */ + public Builder mergeInfo(com.google.showcase.v1beta1.ComplianceData value) { + if (infoBuilder_ == null) { + if (info_ != null) { + info_ = + com.google.showcase.v1beta1.ComplianceData.newBuilder(info_) + .mergeFrom(value) + .buildPartial(); + } else { + info_ = value; + } + onChanged(); + } else { + infoBuilder_.mergeFrom(value); + } + + return this; + } + + /** .google.showcase.v1beta1.ComplianceData info = 2; */ + public Builder clearInfo() { + if (infoBuilder_ == null) { + info_ = null; + onChanged(); + } else { + info_ = null; + infoBuilder_ = null; + } + + return this; + } + + /** .google.showcase.v1beta1.ComplianceData info = 2; */ + public com.google.showcase.v1beta1.ComplianceData.Builder getInfoBuilder() { + + onChanged(); + return getInfoFieldBuilder().getBuilder(); + } + + /** .google.showcase.v1beta1.ComplianceData info = 2; */ + public com.google.showcase.v1beta1.ComplianceDataOrBuilder getInfoOrBuilder() { + if (infoBuilder_ != null) { + return infoBuilder_.getMessageOrBuilder(); + } else { + return info_ == null + ? com.google.showcase.v1beta1.ComplianceData.getDefaultInstance() + : info_; + } + } + + /** .google.showcase.v1beta1.ComplianceData info = 2; */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.showcase.v1beta1.ComplianceData, + com.google.showcase.v1beta1.ComplianceData.Builder, + com.google.showcase.v1beta1.ComplianceDataOrBuilder> + getInfoFieldBuilder() { + if (infoBuilder_ == null) { + infoBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.showcase.v1beta1.ComplianceData, + com.google.showcase.v1beta1.ComplianceData.Builder, + com.google.showcase.v1beta1.ComplianceDataOrBuilder>( + getInfo(), getParentForChildren(), isClean()); + info_ = null; + } + return infoBuilder_; + } + + private boolean serverVerify_; + + /** + * + * + *
        +     * If true, the server will verify that the received request matches
        +     * the request with the same name in the compliance test suite.
        +     * 
        + * + * bool server_verify = 3; + * + * @return The serverVerify. + */ + @java.lang.Override + public boolean getServerVerify() { + return serverVerify_; + } + + /** + * + * + *
        +     * If true, the server will verify that the received request matches
        +     * the request with the same name in the compliance test suite.
        +     * 
        + * + * bool server_verify = 3; + * + * @param value The serverVerify to set. + * @return This builder for chaining. + */ + public Builder setServerVerify(boolean value) { + + serverVerify_ = value; + onChanged(); + return this; + } + + /** + * + * + *
        +     * If true, the server will verify that the received request matches
        +     * the request with the same name in the compliance test suite.
        +     * 
        + * + * bool server_verify = 3; + * + * @return This builder for chaining. + */ + public Builder clearServerVerify() { + + serverVerify_ = false; + onChanged(); + return this; + } + + private java.lang.Object intendedBindingUri_ = ""; + + /** + * + * + *
        +     * The URI template this request is expected to be bound to server-side.
        +     * 
        + * + * optional string intended_binding_uri = 10; + * + * @return Whether the intendedBindingUri field is set. + */ + public boolean hasIntendedBindingUri() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
        +     * The URI template this request is expected to be bound to server-side.
        +     * 
        + * + * optional string intended_binding_uri = 10; + * + * @return The intendedBindingUri. + */ + public java.lang.String getIntendedBindingUri() { + java.lang.Object ref = intendedBindingUri_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + intendedBindingUri_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
        +     * The URI template this request is expected to be bound to server-side.
        +     * 
        + * + * optional string intended_binding_uri = 10; + * + * @return The bytes for intendedBindingUri. + */ + public com.google.protobuf.ByteString getIntendedBindingUriBytes() { + java.lang.Object ref = intendedBindingUri_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + intendedBindingUri_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
        +     * The URI template this request is expected to be bound to server-side.
        +     * 
        + * + * optional string intended_binding_uri = 10; + * + * @param value The intendedBindingUri to set. + * @return This builder for chaining. + */ + public Builder setIntendedBindingUri(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000001; + intendedBindingUri_ = value; + onChanged(); + return this; + } + + /** + * + * + *
        +     * The URI template this request is expected to be bound to server-side.
        +     * 
        + * + * optional string intended_binding_uri = 10; + * + * @return This builder for chaining. + */ + public Builder clearIntendedBindingUri() { + bitField0_ = (bitField0_ & ~0x00000001); + intendedBindingUri_ = getDefaultInstance().getIntendedBindingUri(); + onChanged(); + return this; + } + + /** + * + * + *
        +     * The URI template this request is expected to be bound to server-side.
        +     * 
        + * + * optional string intended_binding_uri = 10; + * + * @param value The bytes for intendedBindingUri to set. + * @return This builder for chaining. + */ + public Builder setIntendedBindingUriBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + bitField0_ |= 0x00000001; + intendedBindingUri_ = value; + onChanged(); + return this; + } + + private int fInt32_; + + /** + * + * + *
        +     * Some top level fields, to test that these are encoded correctly
        +     * in query params.
        +     * 
        + * + * int32 f_int32 = 4; + * + * @return The fInt32. + */ + @java.lang.Override + public int getFInt32() { + return fInt32_; + } + + /** + * + * + *
        +     * Some top level fields, to test that these are encoded correctly
        +     * in query params.
        +     * 
        + * + * int32 f_int32 = 4; + * + * @param value The fInt32 to set. + * @return This builder for chaining. + */ + public Builder setFInt32(int value) { + + fInt32_ = value; + onChanged(); + return this; + } + + /** + * + * + *
        +     * Some top level fields, to test that these are encoded correctly
        +     * in query params.
        +     * 
        + * + * int32 f_int32 = 4; + * + * @return This builder for chaining. + */ + public Builder clearFInt32() { + + fInt32_ = 0; + onChanged(); + return this; + } + + private long fInt64_; + + /** + * int64 f_int64 = 5; + * + * @return The fInt64. + */ + @java.lang.Override + public long getFInt64() { + return fInt64_; + } + + /** + * int64 f_int64 = 5; + * + * @param value The fInt64 to set. + * @return This builder for chaining. + */ + public Builder setFInt64(long value) { + + fInt64_ = value; + onChanged(); + return this; + } + + /** + * int64 f_int64 = 5; + * + * @return This builder for chaining. + */ + public Builder clearFInt64() { + + fInt64_ = 0L; + onChanged(); + return this; + } + + private double fDouble_; + + /** + * double f_double = 6; + * + * @return The fDouble. + */ + @java.lang.Override + public double getFDouble() { + return fDouble_; + } + + /** + * double f_double = 6; + * + * @param value The fDouble to set. + * @return This builder for chaining. + */ + public Builder setFDouble(double value) { + + fDouble_ = value; + onChanged(); + return this; + } + + /** + * double f_double = 6; + * + * @return This builder for chaining. + */ + public Builder clearFDouble() { + + fDouble_ = 0D; + onChanged(); + return this; + } + + private int pInt32_; + + /** + * optional int32 p_int32 = 7; + * + * @return Whether the pInt32 field is set. + */ + @java.lang.Override + public boolean hasPInt32() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * optional int32 p_int32 = 7; + * + * @return The pInt32. + */ + @java.lang.Override + public int getPInt32() { + return pInt32_; + } + + /** + * optional int32 p_int32 = 7; + * + * @param value The pInt32 to set. + * @return This builder for chaining. + */ + public Builder setPInt32(int value) { + bitField0_ |= 0x00000002; + pInt32_ = value; + onChanged(); + return this; + } + + /** + * optional int32 p_int32 = 7; + * + * @return This builder for chaining. + */ + public Builder clearPInt32() { + bitField0_ = (bitField0_ & ~0x00000002); + pInt32_ = 0; + onChanged(); + return this; + } + + private long pInt64_; + + /** + * optional int64 p_int64 = 8; + * + * @return Whether the pInt64 field is set. + */ + @java.lang.Override + public boolean hasPInt64() { + return ((bitField0_ & 0x00000004) != 0); + } + + /** + * optional int64 p_int64 = 8; + * + * @return The pInt64. + */ + @java.lang.Override + public long getPInt64() { + return pInt64_; + } + + /** + * optional int64 p_int64 = 8; + * + * @param value The pInt64 to set. + * @return This builder for chaining. + */ + public Builder setPInt64(long value) { + bitField0_ |= 0x00000004; + pInt64_ = value; + onChanged(); + return this; + } + + /** + * optional int64 p_int64 = 8; + * + * @return This builder for chaining. + */ + public Builder clearPInt64() { + bitField0_ = (bitField0_ & ~0x00000004); + pInt64_ = 0L; + onChanged(); + return this; + } + + private double pDouble_; + + /** + * optional double p_double = 9; + * + * @return Whether the pDouble field is set. + */ + @java.lang.Override + public boolean hasPDouble() { + return ((bitField0_ & 0x00000008) != 0); + } + + /** + * optional double p_double = 9; + * + * @return The pDouble. + */ + @java.lang.Override + public double getPDouble() { + return pDouble_; + } + + /** + * optional double p_double = 9; + * + * @param value The pDouble to set. + * @return This builder for chaining. + */ + public Builder setPDouble(double value) { + bitField0_ |= 0x00000008; + pDouble_ = value; + onChanged(); + return this; + } + + /** + * optional double p_double = 9; + * + * @return This builder for chaining. + */ + public Builder clearPDouble() { + bitField0_ = (bitField0_ & ~0x00000008); + pDouble_ = 0D; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.showcase.v1beta1.RepeatRequest) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.RepeatRequest) + private static final com.google.showcase.v1beta1.RepeatRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.RepeatRequest(); + } + + public static com.google.showcase.v1beta1.RepeatRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public RepeatRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new RepeatRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.showcase.v1beta1.RepeatRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/RepeatRequestOrBuilder.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/RepeatRequestOrBuilder.java new file mode 100644 index 0000000000..8fc2590475 --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/RepeatRequestOrBuilder.java @@ -0,0 +1,179 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/compliance.proto + +package com.google.showcase.v1beta1; + +public interface RepeatRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.RepeatRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * string name = 1; + * + * @return The name. + */ + java.lang.String getName(); + + /** + * string name = 1; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * .google.showcase.v1beta1.ComplianceData info = 2; + * + * @return Whether the info field is set. + */ + boolean hasInfo(); + + /** + * .google.showcase.v1beta1.ComplianceData info = 2; + * + * @return The info. + */ + com.google.showcase.v1beta1.ComplianceData getInfo(); + + /** .google.showcase.v1beta1.ComplianceData info = 2; */ + com.google.showcase.v1beta1.ComplianceDataOrBuilder getInfoOrBuilder(); + + /** + * + * + *
        +   * If true, the server will verify that the received request matches
        +   * the request with the same name in the compliance test suite.
        +   * 
        + * + * bool server_verify = 3; + * + * @return The serverVerify. + */ + boolean getServerVerify(); + + /** + * + * + *
        +   * The URI template this request is expected to be bound to server-side.
        +   * 
        + * + * optional string intended_binding_uri = 10; + * + * @return Whether the intendedBindingUri field is set. + */ + boolean hasIntendedBindingUri(); + + /** + * + * + *
        +   * The URI template this request is expected to be bound to server-side.
        +   * 
        + * + * optional string intended_binding_uri = 10; + * + * @return The intendedBindingUri. + */ + java.lang.String getIntendedBindingUri(); + + /** + * + * + *
        +   * The URI template this request is expected to be bound to server-side.
        +   * 
        + * + * optional string intended_binding_uri = 10; + * + * @return The bytes for intendedBindingUri. + */ + com.google.protobuf.ByteString getIntendedBindingUriBytes(); + + /** + * + * + *
        +   * Some top level fields, to test that these are encoded correctly
        +   * in query params.
        +   * 
        + * + * int32 f_int32 = 4; + * + * @return The fInt32. + */ + int getFInt32(); + + /** + * int64 f_int64 = 5; + * + * @return The fInt64. + */ + long getFInt64(); + + /** + * double f_double = 6; + * + * @return The fDouble. + */ + double getFDouble(); + + /** + * optional int32 p_int32 = 7; + * + * @return Whether the pInt32 field is set. + */ + boolean hasPInt32(); + + /** + * optional int32 p_int32 = 7; + * + * @return The pInt32. + */ + int getPInt32(); + + /** + * optional int64 p_int64 = 8; + * + * @return Whether the pInt64 field is set. + */ + boolean hasPInt64(); + + /** + * optional int64 p_int64 = 8; + * + * @return The pInt64. + */ + long getPInt64(); + + /** + * optional double p_double = 9; + * + * @return Whether the pDouble field is set. + */ + boolean hasPDouble(); + + /** + * optional double p_double = 9; + * + * @return The pDouble. + */ + double getPDouble(); +} diff --git a/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/RepeatResponse.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/RepeatResponse.java new file mode 100644 index 0000000000..eeb18d60ec --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/RepeatResponse.java @@ -0,0 +1,830 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/compliance.proto + +package com.google.showcase.v1beta1; + +/** Protobuf type {@code google.showcase.v1beta1.RepeatResponse} */ +public final class RepeatResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.RepeatResponse) + RepeatResponseOrBuilder { + private static final long serialVersionUID = 0L; + + // Use RepeatResponse.newBuilder() to construct. + private RepeatResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private RepeatResponse() { + bindingUri_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new RepeatResponse(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private RepeatResponse( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + com.google.showcase.v1beta1.RepeatRequest.Builder subBuilder = null; + if (request_ != null) { + subBuilder = request_.toBuilder(); + } + request_ = + input.readMessage( + com.google.showcase.v1beta1.RepeatRequest.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(request_); + request_ = subBuilder.buildPartial(); + } + + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + bindingUri_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.ComplianceOuterClass + .internal_static_google_showcase_v1beta1_RepeatResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.ComplianceOuterClass + .internal_static_google_showcase_v1beta1_RepeatResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.RepeatResponse.class, + com.google.showcase.v1beta1.RepeatResponse.Builder.class); + } + + public static final int REQUEST_FIELD_NUMBER = 1; + private com.google.showcase.v1beta1.RepeatRequest request_; + + /** + * .google.showcase.v1beta1.RepeatRequest request = 1; + * + * @return Whether the request field is set. + */ + @java.lang.Override + public boolean hasRequest() { + return request_ != null; + } + + /** + * .google.showcase.v1beta1.RepeatRequest request = 1; + * + * @return The request. + */ + @java.lang.Override + public com.google.showcase.v1beta1.RepeatRequest getRequest() { + return request_ == null + ? com.google.showcase.v1beta1.RepeatRequest.getDefaultInstance() + : request_; + } + + /** .google.showcase.v1beta1.RepeatRequest request = 1; */ + @java.lang.Override + public com.google.showcase.v1beta1.RepeatRequestOrBuilder getRequestOrBuilder() { + return getRequest(); + } + + public static final int BINDING_URI_FIELD_NUMBER = 2; + private volatile java.lang.Object bindingUri_; + + /** + * + * + *
        +   * The URI template the request was bound to server-side.
        +   * 
        + * + * string binding_uri = 2; + * + * @return The bindingUri. + */ + @java.lang.Override + public java.lang.String getBindingUri() { + java.lang.Object ref = bindingUri_; + 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(); + bindingUri_ = s; + return s; + } + } + + /** + * + * + *
        +   * The URI template the request was bound to server-side.
        +   * 
        + * + * string binding_uri = 2; + * + * @return The bytes for bindingUri. + */ + @java.lang.Override + public com.google.protobuf.ByteString getBindingUriBytes() { + java.lang.Object ref = bindingUri_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + bindingUri_ = 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 (request_ != null) { + output.writeMessage(1, getRequest()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(bindingUri_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, bindingUri_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (request_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getRequest()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(bindingUri_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, bindingUri_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.showcase.v1beta1.RepeatResponse)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.RepeatResponse other = + (com.google.showcase.v1beta1.RepeatResponse) obj; + + if (hasRequest() != other.hasRequest()) return false; + if (hasRequest()) { + if (!getRequest().equals(other.getRequest())) return false; + } + if (!getBindingUri().equals(other.getBindingUri())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasRequest()) { + hash = (37 * hash) + REQUEST_FIELD_NUMBER; + hash = (53 * hash) + getRequest().hashCode(); + } + hash = (37 * hash) + BINDING_URI_FIELD_NUMBER; + hash = (53 * hash) + getBindingUri().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.showcase.v1beta1.RepeatResponse parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.RepeatResponse parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.RepeatResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.RepeatResponse 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.showcase.v1beta1.RepeatResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.RepeatResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.RepeatResponse parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.RepeatResponse 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.showcase.v1beta1.RepeatResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.RepeatResponse 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.showcase.v1beta1.RepeatResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.RepeatResponse 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.showcase.v1beta1.RepeatResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** Protobuf type {@code google.showcase.v1beta1.RepeatResponse} */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.RepeatResponse) + com.google.showcase.v1beta1.RepeatResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.ComplianceOuterClass + .internal_static_google_showcase_v1beta1_RepeatResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.ComplianceOuterClass + .internal_static_google_showcase_v1beta1_RepeatResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.RepeatResponse.class, + com.google.showcase.v1beta1.RepeatResponse.Builder.class); + } + + // Construct using com.google.showcase.v1beta1.RepeatResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (requestBuilder_ == null) { + request_ = null; + } else { + request_ = null; + requestBuilder_ = null; + } + bindingUri_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.showcase.v1beta1.ComplianceOuterClass + .internal_static_google_showcase_v1beta1_RepeatResponse_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.RepeatResponse getDefaultInstanceForType() { + return com.google.showcase.v1beta1.RepeatResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.RepeatResponse build() { + com.google.showcase.v1beta1.RepeatResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.RepeatResponse buildPartial() { + com.google.showcase.v1beta1.RepeatResponse result = + new com.google.showcase.v1beta1.RepeatResponse(this); + if (requestBuilder_ == null) { + result.request_ = request_; + } else { + result.request_ = requestBuilder_.build(); + } + result.bindingUri_ = bindingUri_; + 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.showcase.v1beta1.RepeatResponse) { + return mergeFrom((com.google.showcase.v1beta1.RepeatResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.showcase.v1beta1.RepeatResponse other) { + if (other == com.google.showcase.v1beta1.RepeatResponse.getDefaultInstance()) return this; + if (other.hasRequest()) { + mergeRequest(other.getRequest()); + } + if (!other.getBindingUri().isEmpty()) { + bindingUri_ = other.bindingUri_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.showcase.v1beta1.RepeatResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.showcase.v1beta1.RepeatResponse) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private com.google.showcase.v1beta1.RepeatRequest request_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.showcase.v1beta1.RepeatRequest, + com.google.showcase.v1beta1.RepeatRequest.Builder, + com.google.showcase.v1beta1.RepeatRequestOrBuilder> + requestBuilder_; + + /** + * .google.showcase.v1beta1.RepeatRequest request = 1; + * + * @return Whether the request field is set. + */ + public boolean hasRequest() { + return requestBuilder_ != null || request_ != null; + } + + /** + * .google.showcase.v1beta1.RepeatRequest request = 1; + * + * @return The request. + */ + public com.google.showcase.v1beta1.RepeatRequest getRequest() { + if (requestBuilder_ == null) { + return request_ == null + ? com.google.showcase.v1beta1.RepeatRequest.getDefaultInstance() + : request_; + } else { + return requestBuilder_.getMessage(); + } + } + + /** .google.showcase.v1beta1.RepeatRequest request = 1; */ + public Builder setRequest(com.google.showcase.v1beta1.RepeatRequest value) { + if (requestBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + request_ = value; + onChanged(); + } else { + requestBuilder_.setMessage(value); + } + + return this; + } + + /** .google.showcase.v1beta1.RepeatRequest request = 1; */ + public Builder setRequest(com.google.showcase.v1beta1.RepeatRequest.Builder builderForValue) { + if (requestBuilder_ == null) { + request_ = builderForValue.build(); + onChanged(); + } else { + requestBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + + /** .google.showcase.v1beta1.RepeatRequest request = 1; */ + public Builder mergeRequest(com.google.showcase.v1beta1.RepeatRequest value) { + if (requestBuilder_ == null) { + if (request_ != null) { + request_ = + com.google.showcase.v1beta1.RepeatRequest.newBuilder(request_) + .mergeFrom(value) + .buildPartial(); + } else { + request_ = value; + } + onChanged(); + } else { + requestBuilder_.mergeFrom(value); + } + + return this; + } + + /** .google.showcase.v1beta1.RepeatRequest request = 1; */ + public Builder clearRequest() { + if (requestBuilder_ == null) { + request_ = null; + onChanged(); + } else { + request_ = null; + requestBuilder_ = null; + } + + return this; + } + + /** .google.showcase.v1beta1.RepeatRequest request = 1; */ + public com.google.showcase.v1beta1.RepeatRequest.Builder getRequestBuilder() { + + onChanged(); + return getRequestFieldBuilder().getBuilder(); + } + + /** .google.showcase.v1beta1.RepeatRequest request = 1; */ + public com.google.showcase.v1beta1.RepeatRequestOrBuilder getRequestOrBuilder() { + if (requestBuilder_ != null) { + return requestBuilder_.getMessageOrBuilder(); + } else { + return request_ == null + ? com.google.showcase.v1beta1.RepeatRequest.getDefaultInstance() + : request_; + } + } + + /** .google.showcase.v1beta1.RepeatRequest request = 1; */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.showcase.v1beta1.RepeatRequest, + com.google.showcase.v1beta1.RepeatRequest.Builder, + com.google.showcase.v1beta1.RepeatRequestOrBuilder> + getRequestFieldBuilder() { + if (requestBuilder_ == null) { + requestBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.showcase.v1beta1.RepeatRequest, + com.google.showcase.v1beta1.RepeatRequest.Builder, + com.google.showcase.v1beta1.RepeatRequestOrBuilder>( + getRequest(), getParentForChildren(), isClean()); + request_ = null; + } + return requestBuilder_; + } + + private java.lang.Object bindingUri_ = ""; + + /** + * + * + *
        +     * The URI template the request was bound to server-side.
        +     * 
        + * + * string binding_uri = 2; + * + * @return The bindingUri. + */ + public java.lang.String getBindingUri() { + java.lang.Object ref = bindingUri_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + bindingUri_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
        +     * The URI template the request was bound to server-side.
        +     * 
        + * + * string binding_uri = 2; + * + * @return The bytes for bindingUri. + */ + public com.google.protobuf.ByteString getBindingUriBytes() { + java.lang.Object ref = bindingUri_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + bindingUri_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
        +     * The URI template the request was bound to server-side.
        +     * 
        + * + * string binding_uri = 2; + * + * @param value The bindingUri to set. + * @return This builder for chaining. + */ + public Builder setBindingUri(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + bindingUri_ = value; + onChanged(); + return this; + } + + /** + * + * + *
        +     * The URI template the request was bound to server-side.
        +     * 
        + * + * string binding_uri = 2; + * + * @return This builder for chaining. + */ + public Builder clearBindingUri() { + + bindingUri_ = getDefaultInstance().getBindingUri(); + onChanged(); + return this; + } + + /** + * + * + *
        +     * The URI template the request was bound to server-side.
        +     * 
        + * + * string binding_uri = 2; + * + * @param value The bytes for bindingUri to set. + * @return This builder for chaining. + */ + public Builder setBindingUriBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + bindingUri_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.showcase.v1beta1.RepeatResponse) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.RepeatResponse) + private static final com.google.showcase.v1beta1.RepeatResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.RepeatResponse(); + } + + public static com.google.showcase.v1beta1.RepeatResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public RepeatResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new RepeatResponse(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.showcase.v1beta1.RepeatResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/RepeatResponseOrBuilder.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/RepeatResponseOrBuilder.java new file mode 100644 index 0000000000..db14129a3e --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/RepeatResponseOrBuilder.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: schema/google/showcase/v1beta1/compliance.proto + +package com.google.showcase.v1beta1; + +public interface RepeatResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.RepeatResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * .google.showcase.v1beta1.RepeatRequest request = 1; + * + * @return Whether the request field is set. + */ + boolean hasRequest(); + + /** + * .google.showcase.v1beta1.RepeatRequest request = 1; + * + * @return The request. + */ + com.google.showcase.v1beta1.RepeatRequest getRequest(); + + /** .google.showcase.v1beta1.RepeatRequest request = 1; */ + com.google.showcase.v1beta1.RepeatRequestOrBuilder getRequestOrBuilder(); + + /** + * + * + *
        +   * The URI template the request was bound to server-side.
        +   * 
        + * + * string binding_uri = 2; + * + * @return The bindingUri. + */ + java.lang.String getBindingUri(); + + /** + * + * + *
        +   * The URI template the request was bound to server-side.
        +   * 
        + * + * string binding_uri = 2; + * + * @return The bytes for bindingUri. + */ + com.google.protobuf.ByteString getBindingUriBytes(); +} diff --git a/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ReportSessionRequest.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ReportSessionRequest.java new file mode 100644 index 0000000000..0001110e5a --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ReportSessionRequest.java @@ -0,0 +1,646 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/testing.proto + +package com.google.showcase.v1beta1; + +/** + * + * + *
        + * Request message for reporting on a session.
        + * 
        + * + * Protobuf type {@code google.showcase.v1beta1.ReportSessionRequest} + */ +public final class ReportSessionRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.ReportSessionRequest) + ReportSessionRequestOrBuilder { + private static final long serialVersionUID = 0L; + + // Use ReportSessionRequest.newBuilder() to construct. + private ReportSessionRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ReportSessionRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ReportSessionRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ReportSessionRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.TestingOuterClass + .internal_static_google_showcase_v1beta1_ReportSessionRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.TestingOuterClass + .internal_static_google_showcase_v1beta1_ReportSessionRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.ReportSessionRequest.class, + com.google.showcase.v1beta1.ReportSessionRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + + /** + * + * + *
        +   * The session to be reported on.
        +   * 
        + * + * string name = 1 [(.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; + } + } + + /** + * + * + *
        +   * The session to be reported on.
        +   * 
        + * + * string name = 1 [(.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_); + } + unknownFields.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 += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.showcase.v1beta1.ReportSessionRequest)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.ReportSessionRequest other = + (com.google.showcase.v1beta1.ReportSessionRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.showcase.v1beta1.ReportSessionRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.ReportSessionRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.ReportSessionRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.ReportSessionRequest 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.showcase.v1beta1.ReportSessionRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.ReportSessionRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.ReportSessionRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.ReportSessionRequest 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.showcase.v1beta1.ReportSessionRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.ReportSessionRequest 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.showcase.v1beta1.ReportSessionRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.ReportSessionRequest 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.showcase.v1beta1.ReportSessionRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
        +   * Request message for reporting on a session.
        +   * 
        + * + * Protobuf type {@code google.showcase.v1beta1.ReportSessionRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.ReportSessionRequest) + com.google.showcase.v1beta1.ReportSessionRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.TestingOuterClass + .internal_static_google_showcase_v1beta1_ReportSessionRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.TestingOuterClass + .internal_static_google_showcase_v1beta1_ReportSessionRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.ReportSessionRequest.class, + com.google.showcase.v1beta1.ReportSessionRequest.Builder.class); + } + + // Construct using com.google.showcase.v1beta1.ReportSessionRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.showcase.v1beta1.TestingOuterClass + .internal_static_google_showcase_v1beta1_ReportSessionRequest_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.ReportSessionRequest getDefaultInstanceForType() { + return com.google.showcase.v1beta1.ReportSessionRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.ReportSessionRequest build() { + com.google.showcase.v1beta1.ReportSessionRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.ReportSessionRequest buildPartial() { + com.google.showcase.v1beta1.ReportSessionRequest result = + new com.google.showcase.v1beta1.ReportSessionRequest(this); + result.name_ = name_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.showcase.v1beta1.ReportSessionRequest) { + return mergeFrom((com.google.showcase.v1beta1.ReportSessionRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.showcase.v1beta1.ReportSessionRequest other) { + if (other == com.google.showcase.v1beta1.ReportSessionRequest.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.showcase.v1beta1.ReportSessionRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.showcase.v1beta1.ReportSessionRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + + /** + * + * + *
        +     * The session to be reported on.
        +     * 
        + * + * string name = 1 [(.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; + } + } + + /** + * + * + *
        +     * The session to be reported on.
        +     * 
        + * + * string name = 1 [(.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; + } + } + + /** + * + * + *
        +     * The session to be reported on.
        +     * 
        + * + * string name = 1 [(.google.api.resource_reference) = { ... } + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + + /** + * + * + *
        +     * The session to be reported on.
        +     * 
        + * + * string name = 1 [(.google.api.resource_reference) = { ... } + * + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + + /** + * + * + *
        +     * The session to be reported on.
        +     * 
        + * + * string name = 1 [(.google.api.resource_reference) = { ... } + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.showcase.v1beta1.ReportSessionRequest) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.ReportSessionRequest) + private static final com.google.showcase.v1beta1.ReportSessionRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.ReportSessionRequest(); + } + + public static com.google.showcase.v1beta1.ReportSessionRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ReportSessionRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ReportSessionRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.showcase.v1beta1.ReportSessionRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ReportSessionRequestOrBuilder.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ReportSessionRequestOrBuilder.java new file mode 100644 index 0000000000..63fed63d3b --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ReportSessionRequestOrBuilder.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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/testing.proto + +package com.google.showcase.v1beta1; + +public interface ReportSessionRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.ReportSessionRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
        +   * The session to be reported on.
        +   * 
        + * + * string name = 1 [(.google.api.resource_reference) = { ... } + * + * @return The name. + */ + java.lang.String getName(); + + /** + * + * + *
        +   * The session to be reported on.
        +   * 
        + * + * string name = 1 [(.google.api.resource_reference) = { ... } + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); +} diff --git a/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ReportSessionResponse.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ReportSessionResponse.java new file mode 100644 index 0000000000..b5285ddf67 --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ReportSessionResponse.java @@ -0,0 +1,1307 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/testing.proto + +package com.google.showcase.v1beta1; + +/** + * + * + *
        + * Response message for reporting on a session.
        + * 
        + * + * Protobuf type {@code google.showcase.v1beta1.ReportSessionResponse} + */ +public final class ReportSessionResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.ReportSessionResponse) + ReportSessionResponseOrBuilder { + private static final long serialVersionUID = 0L; + + // Use ReportSessionResponse.newBuilder() to construct. + private ReportSessionResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ReportSessionResponse() { + result_ = 0; + testRuns_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ReportSessionResponse(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ReportSessionResponse( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: + { + int rawValue = input.readEnum(); + + result_ = rawValue; + break; + } + case 18: + { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + testRuns_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + testRuns_.add( + input.readMessage( + com.google.showcase.v1beta1.TestRun.parser(), extensionRegistry)); + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + testRuns_ = java.util.Collections.unmodifiableList(testRuns_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.TestingOuterClass + .internal_static_google_showcase_v1beta1_ReportSessionResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.TestingOuterClass + .internal_static_google_showcase_v1beta1_ReportSessionResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.ReportSessionResponse.class, + com.google.showcase.v1beta1.ReportSessionResponse.Builder.class); + } + + /** + * + * + *
        +   * The topline state of the report.
        +   * 
        + * + * Protobuf enum {@code google.showcase.v1beta1.ReportSessionResponse.Result} + */ + public enum Result implements com.google.protobuf.ProtocolMessageEnum { + /** RESULT_UNSPECIFIED = 0; */ + RESULT_UNSPECIFIED(0), + /** + * + * + *
        +     * The session is complete, and everything passed.
        +     * 
        + * + * PASSED = 1; + */ + PASSED(1), + /** + * + * + *
        +     * The session had an explicit failure.
        +     * 
        + * + * FAILED = 2; + */ + FAILED(2), + /** + * + * + *
        +     * The session is incomplete. This is a failure response.
        +     * 
        + * + * INCOMPLETE = 3; + */ + INCOMPLETE(3), + UNRECOGNIZED(-1), + ; + + /** RESULT_UNSPECIFIED = 0; */ + public static final int RESULT_UNSPECIFIED_VALUE = 0; + + /** + * + * + *
        +     * The session is complete, and everything passed.
        +     * 
        + * + * PASSED = 1; + */ + public static final int PASSED_VALUE = 1; + + /** + * + * + *
        +     * The session had an explicit failure.
        +     * 
        + * + * FAILED = 2; + */ + public static final int FAILED_VALUE = 2; + + /** + * + * + *
        +     * The session is incomplete. This is a failure response.
        +     * 
        + * + * INCOMPLETE = 3; + */ + public static final int INCOMPLETE_VALUE = 3; + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static Result 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 Result forNumber(int value) { + switch (value) { + case 0: + return RESULT_UNSPECIFIED; + case 1: + return PASSED; + case 2: + return FAILED; + case 3: + return INCOMPLETE; + 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 Result findValueByNumber(int number) { + return Result.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.showcase.v1beta1.ReportSessionResponse.getDescriptor() + .getEnumTypes() + .get(0); + } + + private static final Result[] VALUES = values(); + + public static Result 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 Result(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.showcase.v1beta1.ReportSessionResponse.Result) + } + + public static final int RESULT_FIELD_NUMBER = 1; + private int result_; + + /** + * + * + *
        +   * The state of the report.
        +   * 
        + * + * .google.showcase.v1beta1.ReportSessionResponse.Result result = 1; + * + * @return The enum numeric value on the wire for result. + */ + @java.lang.Override + public int getResultValue() { + return result_; + } + + /** + * + * + *
        +   * The state of the report.
        +   * 
        + * + * .google.showcase.v1beta1.ReportSessionResponse.Result result = 1; + * + * @return The result. + */ + @java.lang.Override + public com.google.showcase.v1beta1.ReportSessionResponse.Result getResult() { + @SuppressWarnings("deprecation") + com.google.showcase.v1beta1.ReportSessionResponse.Result result = + com.google.showcase.v1beta1.ReportSessionResponse.Result.valueOf(result_); + return result == null + ? com.google.showcase.v1beta1.ReportSessionResponse.Result.UNRECOGNIZED + : result; + } + + public static final int TEST_RUNS_FIELD_NUMBER = 2; + private java.util.List testRuns_; + + /** + * + * + *
        +   * The test runs of this session.
        +   * 
        + * + * repeated .google.showcase.v1beta1.TestRun test_runs = 2; + */ + @java.lang.Override + public java.util.List getTestRunsList() { + return testRuns_; + } + + /** + * + * + *
        +   * The test runs of this session.
        +   * 
        + * + * repeated .google.showcase.v1beta1.TestRun test_runs = 2; + */ + @java.lang.Override + public java.util.List + getTestRunsOrBuilderList() { + return testRuns_; + } + + /** + * + * + *
        +   * The test runs of this session.
        +   * 
        + * + * repeated .google.showcase.v1beta1.TestRun test_runs = 2; + */ + @java.lang.Override + public int getTestRunsCount() { + return testRuns_.size(); + } + + /** + * + * + *
        +   * The test runs of this session.
        +   * 
        + * + * repeated .google.showcase.v1beta1.TestRun test_runs = 2; + */ + @java.lang.Override + public com.google.showcase.v1beta1.TestRun getTestRuns(int index) { + return testRuns_.get(index); + } + + /** + * + * + *
        +   * The test runs of this session.
        +   * 
        + * + * repeated .google.showcase.v1beta1.TestRun test_runs = 2; + */ + @java.lang.Override + public com.google.showcase.v1beta1.TestRunOrBuilder getTestRunsOrBuilder(int index) { + return testRuns_.get(index); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (result_ + != com.google.showcase.v1beta1.ReportSessionResponse.Result.RESULT_UNSPECIFIED + .getNumber()) { + output.writeEnum(1, result_); + } + for (int i = 0; i < testRuns_.size(); i++) { + output.writeMessage(2, testRuns_.get(i)); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (result_ + != com.google.showcase.v1beta1.ReportSessionResponse.Result.RESULT_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(1, result_); + } + for (int i = 0; i < testRuns_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, testRuns_.get(i)); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.showcase.v1beta1.ReportSessionResponse)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.ReportSessionResponse other = + (com.google.showcase.v1beta1.ReportSessionResponse) obj; + + if (result_ != other.result_) return false; + if (!getTestRunsList().equals(other.getTestRunsList())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + RESULT_FIELD_NUMBER; + hash = (53 * hash) + result_; + if (getTestRunsCount() > 0) { + hash = (37 * hash) + TEST_RUNS_FIELD_NUMBER; + hash = (53 * hash) + getTestRunsList().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.showcase.v1beta1.ReportSessionResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.ReportSessionResponse parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.ReportSessionResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.ReportSessionResponse 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.showcase.v1beta1.ReportSessionResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.ReportSessionResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.ReportSessionResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.ReportSessionResponse 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.showcase.v1beta1.ReportSessionResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.ReportSessionResponse 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.showcase.v1beta1.ReportSessionResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.ReportSessionResponse 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.showcase.v1beta1.ReportSessionResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
        +   * Response message for reporting on a session.
        +   * 
        + * + * Protobuf type {@code google.showcase.v1beta1.ReportSessionResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.ReportSessionResponse) + com.google.showcase.v1beta1.ReportSessionResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.TestingOuterClass + .internal_static_google_showcase_v1beta1_ReportSessionResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.TestingOuterClass + .internal_static_google_showcase_v1beta1_ReportSessionResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.ReportSessionResponse.class, + com.google.showcase.v1beta1.ReportSessionResponse.Builder.class); + } + + // Construct using com.google.showcase.v1beta1.ReportSessionResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getTestRunsFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + result_ = 0; + + if (testRunsBuilder_ == null) { + testRuns_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + testRunsBuilder_.clear(); + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.showcase.v1beta1.TestingOuterClass + .internal_static_google_showcase_v1beta1_ReportSessionResponse_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.ReportSessionResponse getDefaultInstanceForType() { + return com.google.showcase.v1beta1.ReportSessionResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.ReportSessionResponse build() { + com.google.showcase.v1beta1.ReportSessionResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.ReportSessionResponse buildPartial() { + com.google.showcase.v1beta1.ReportSessionResponse result = + new com.google.showcase.v1beta1.ReportSessionResponse(this); + int from_bitField0_ = bitField0_; + result.result_ = result_; + if (testRunsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + testRuns_ = java.util.Collections.unmodifiableList(testRuns_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.testRuns_ = testRuns_; + } else { + result.testRuns_ = testRunsBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.showcase.v1beta1.ReportSessionResponse) { + return mergeFrom((com.google.showcase.v1beta1.ReportSessionResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.showcase.v1beta1.ReportSessionResponse other) { + if (other == com.google.showcase.v1beta1.ReportSessionResponse.getDefaultInstance()) + return this; + if (other.result_ != 0) { + setResultValue(other.getResultValue()); + } + if (testRunsBuilder_ == null) { + if (!other.testRuns_.isEmpty()) { + if (testRuns_.isEmpty()) { + testRuns_ = other.testRuns_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureTestRunsIsMutable(); + testRuns_.addAll(other.testRuns_); + } + onChanged(); + } + } else { + if (!other.testRuns_.isEmpty()) { + if (testRunsBuilder_.isEmpty()) { + testRunsBuilder_.dispose(); + testRunsBuilder_ = null; + testRuns_ = other.testRuns_; + bitField0_ = (bitField0_ & ~0x00000001); + testRunsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getTestRunsFieldBuilder() + : null; + } else { + testRunsBuilder_.addAllMessages(other.testRuns_); + } + } + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.showcase.v1beta1.ReportSessionResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.showcase.v1beta1.ReportSessionResponse) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private int result_ = 0; + + /** + * + * + *
        +     * The state of the report.
        +     * 
        + * + * .google.showcase.v1beta1.ReportSessionResponse.Result result = 1; + * + * @return The enum numeric value on the wire for result. + */ + @java.lang.Override + public int getResultValue() { + return result_; + } + + /** + * + * + *
        +     * The state of the report.
        +     * 
        + * + * .google.showcase.v1beta1.ReportSessionResponse.Result result = 1; + * + * @param value The enum numeric value on the wire for result to set. + * @return This builder for chaining. + */ + public Builder setResultValue(int value) { + + result_ = value; + onChanged(); + return this; + } + + /** + * + * + *
        +     * The state of the report.
        +     * 
        + * + * .google.showcase.v1beta1.ReportSessionResponse.Result result = 1; + * + * @return The result. + */ + @java.lang.Override + public com.google.showcase.v1beta1.ReportSessionResponse.Result getResult() { + @SuppressWarnings("deprecation") + com.google.showcase.v1beta1.ReportSessionResponse.Result result = + com.google.showcase.v1beta1.ReportSessionResponse.Result.valueOf(result_); + return result == null + ? com.google.showcase.v1beta1.ReportSessionResponse.Result.UNRECOGNIZED + : result; + } + + /** + * + * + *
        +     * The state of the report.
        +     * 
        + * + * .google.showcase.v1beta1.ReportSessionResponse.Result result = 1; + * + * @param value The result to set. + * @return This builder for chaining. + */ + public Builder setResult(com.google.showcase.v1beta1.ReportSessionResponse.Result value) { + if (value == null) { + throw new NullPointerException(); + } + + result_ = value.getNumber(); + onChanged(); + return this; + } + + /** + * + * + *
        +     * The state of the report.
        +     * 
        + * + * .google.showcase.v1beta1.ReportSessionResponse.Result result = 1; + * + * @return This builder for chaining. + */ + public Builder clearResult() { + + result_ = 0; + onChanged(); + return this; + } + + private java.util.List testRuns_ = + java.util.Collections.emptyList(); + + private void ensureTestRunsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + testRuns_ = new java.util.ArrayList(testRuns_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.showcase.v1beta1.TestRun, + com.google.showcase.v1beta1.TestRun.Builder, + com.google.showcase.v1beta1.TestRunOrBuilder> + testRunsBuilder_; + + /** + * + * + *
        +     * The test runs of this session.
        +     * 
        + * + * repeated .google.showcase.v1beta1.TestRun test_runs = 2; + */ + public java.util.List getTestRunsList() { + if (testRunsBuilder_ == null) { + return java.util.Collections.unmodifiableList(testRuns_); + } else { + return testRunsBuilder_.getMessageList(); + } + } + + /** + * + * + *
        +     * The test runs of this session.
        +     * 
        + * + * repeated .google.showcase.v1beta1.TestRun test_runs = 2; + */ + public int getTestRunsCount() { + if (testRunsBuilder_ == null) { + return testRuns_.size(); + } else { + return testRunsBuilder_.getCount(); + } + } + + /** + * + * + *
        +     * The test runs of this session.
        +     * 
        + * + * repeated .google.showcase.v1beta1.TestRun test_runs = 2; + */ + public com.google.showcase.v1beta1.TestRun getTestRuns(int index) { + if (testRunsBuilder_ == null) { + return testRuns_.get(index); + } else { + return testRunsBuilder_.getMessage(index); + } + } + + /** + * + * + *
        +     * The test runs of this session.
        +     * 
        + * + * repeated .google.showcase.v1beta1.TestRun test_runs = 2; + */ + public Builder setTestRuns(int index, com.google.showcase.v1beta1.TestRun value) { + if (testRunsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureTestRunsIsMutable(); + testRuns_.set(index, value); + onChanged(); + } else { + testRunsBuilder_.setMessage(index, value); + } + return this; + } + + /** + * + * + *
        +     * The test runs of this session.
        +     * 
        + * + * repeated .google.showcase.v1beta1.TestRun test_runs = 2; + */ + public Builder setTestRuns( + int index, com.google.showcase.v1beta1.TestRun.Builder builderForValue) { + if (testRunsBuilder_ == null) { + ensureTestRunsIsMutable(); + testRuns_.set(index, builderForValue.build()); + onChanged(); + } else { + testRunsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
        +     * The test runs of this session.
        +     * 
        + * + * repeated .google.showcase.v1beta1.TestRun test_runs = 2; + */ + public Builder addTestRuns(com.google.showcase.v1beta1.TestRun value) { + if (testRunsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureTestRunsIsMutable(); + testRuns_.add(value); + onChanged(); + } else { + testRunsBuilder_.addMessage(value); + } + return this; + } + + /** + * + * + *
        +     * The test runs of this session.
        +     * 
        + * + * repeated .google.showcase.v1beta1.TestRun test_runs = 2; + */ + public Builder addTestRuns(int index, com.google.showcase.v1beta1.TestRun value) { + if (testRunsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureTestRunsIsMutable(); + testRuns_.add(index, value); + onChanged(); + } else { + testRunsBuilder_.addMessage(index, value); + } + return this; + } + + /** + * + * + *
        +     * The test runs of this session.
        +     * 
        + * + * repeated .google.showcase.v1beta1.TestRun test_runs = 2; + */ + public Builder addTestRuns(com.google.showcase.v1beta1.TestRun.Builder builderForValue) { + if (testRunsBuilder_ == null) { + ensureTestRunsIsMutable(); + testRuns_.add(builderForValue.build()); + onChanged(); + } else { + testRunsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + + /** + * + * + *
        +     * The test runs of this session.
        +     * 
        + * + * repeated .google.showcase.v1beta1.TestRun test_runs = 2; + */ + public Builder addTestRuns( + int index, com.google.showcase.v1beta1.TestRun.Builder builderForValue) { + if (testRunsBuilder_ == null) { + ensureTestRunsIsMutable(); + testRuns_.add(index, builderForValue.build()); + onChanged(); + } else { + testRunsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
        +     * The test runs of this session.
        +     * 
        + * + * repeated .google.showcase.v1beta1.TestRun test_runs = 2; + */ + public Builder addAllTestRuns( + java.lang.Iterable values) { + if (testRunsBuilder_ == null) { + ensureTestRunsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, testRuns_); + onChanged(); + } else { + testRunsBuilder_.addAllMessages(values); + } + return this; + } + + /** + * + * + *
        +     * The test runs of this session.
        +     * 
        + * + * repeated .google.showcase.v1beta1.TestRun test_runs = 2; + */ + public Builder clearTestRuns() { + if (testRunsBuilder_ == null) { + testRuns_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + testRunsBuilder_.clear(); + } + return this; + } + + /** + * + * + *
        +     * The test runs of this session.
        +     * 
        + * + * repeated .google.showcase.v1beta1.TestRun test_runs = 2; + */ + public Builder removeTestRuns(int index) { + if (testRunsBuilder_ == null) { + ensureTestRunsIsMutable(); + testRuns_.remove(index); + onChanged(); + } else { + testRunsBuilder_.remove(index); + } + return this; + } + + /** + * + * + *
        +     * The test runs of this session.
        +     * 
        + * + * repeated .google.showcase.v1beta1.TestRun test_runs = 2; + */ + public com.google.showcase.v1beta1.TestRun.Builder getTestRunsBuilder(int index) { + return getTestRunsFieldBuilder().getBuilder(index); + } + + /** + * + * + *
        +     * The test runs of this session.
        +     * 
        + * + * repeated .google.showcase.v1beta1.TestRun test_runs = 2; + */ + public com.google.showcase.v1beta1.TestRunOrBuilder getTestRunsOrBuilder(int index) { + if (testRunsBuilder_ == null) { + return testRuns_.get(index); + } else { + return testRunsBuilder_.getMessageOrBuilder(index); + } + } + + /** + * + * + *
        +     * The test runs of this session.
        +     * 
        + * + * repeated .google.showcase.v1beta1.TestRun test_runs = 2; + */ + public java.util.List + getTestRunsOrBuilderList() { + if (testRunsBuilder_ != null) { + return testRunsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(testRuns_); + } + } + + /** + * + * + *
        +     * The test runs of this session.
        +     * 
        + * + * repeated .google.showcase.v1beta1.TestRun test_runs = 2; + */ + public com.google.showcase.v1beta1.TestRun.Builder addTestRunsBuilder() { + return getTestRunsFieldBuilder() + .addBuilder(com.google.showcase.v1beta1.TestRun.getDefaultInstance()); + } + + /** + * + * + *
        +     * The test runs of this session.
        +     * 
        + * + * repeated .google.showcase.v1beta1.TestRun test_runs = 2; + */ + public com.google.showcase.v1beta1.TestRun.Builder addTestRunsBuilder(int index) { + return getTestRunsFieldBuilder() + .addBuilder(index, com.google.showcase.v1beta1.TestRun.getDefaultInstance()); + } + + /** + * + * + *
        +     * The test runs of this session.
        +     * 
        + * + * repeated .google.showcase.v1beta1.TestRun test_runs = 2; + */ + public java.util.List getTestRunsBuilderList() { + return getTestRunsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.showcase.v1beta1.TestRun, + com.google.showcase.v1beta1.TestRun.Builder, + com.google.showcase.v1beta1.TestRunOrBuilder> + getTestRunsFieldBuilder() { + if (testRunsBuilder_ == null) { + testRunsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.showcase.v1beta1.TestRun, + com.google.showcase.v1beta1.TestRun.Builder, + com.google.showcase.v1beta1.TestRunOrBuilder>( + testRuns_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + testRuns_ = null; + } + return testRunsBuilder_; + } + + @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.showcase.v1beta1.ReportSessionResponse) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.ReportSessionResponse) + private static final com.google.showcase.v1beta1.ReportSessionResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.ReportSessionResponse(); + } + + public static com.google.showcase.v1beta1.ReportSessionResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ReportSessionResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ReportSessionResponse(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.showcase.v1beta1.ReportSessionResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ReportSessionResponseOrBuilder.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ReportSessionResponseOrBuilder.java new file mode 100644 index 0000000000..c37784bc94 --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ReportSessionResponseOrBuilder.java @@ -0,0 +1,106 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/testing.proto + +package com.google.showcase.v1beta1; + +public interface ReportSessionResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.ReportSessionResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
        +   * The state of the report.
        +   * 
        + * + * .google.showcase.v1beta1.ReportSessionResponse.Result result = 1; + * + * @return The enum numeric value on the wire for result. + */ + int getResultValue(); + + /** + * + * + *
        +   * The state of the report.
        +   * 
        + * + * .google.showcase.v1beta1.ReportSessionResponse.Result result = 1; + * + * @return The result. + */ + com.google.showcase.v1beta1.ReportSessionResponse.Result getResult(); + + /** + * + * + *
        +   * The test runs of this session.
        +   * 
        + * + * repeated .google.showcase.v1beta1.TestRun test_runs = 2; + */ + java.util.List getTestRunsList(); + + /** + * + * + *
        +   * The test runs of this session.
        +   * 
        + * + * repeated .google.showcase.v1beta1.TestRun test_runs = 2; + */ + com.google.showcase.v1beta1.TestRun getTestRuns(int index); + + /** + * + * + *
        +   * The test runs of this session.
        +   * 
        + * + * repeated .google.showcase.v1beta1.TestRun test_runs = 2; + */ + int getTestRunsCount(); + + /** + * + * + *
        +   * The test runs of this session.
        +   * 
        + * + * repeated .google.showcase.v1beta1.TestRun test_runs = 2; + */ + java.util.List getTestRunsOrBuilderList(); + + /** + * + * + *
        +   * The test runs of this session.
        +   * 
        + * + * repeated .google.showcase.v1beta1.TestRun test_runs = 2; + */ + com.google.showcase.v1beta1.TestRunOrBuilder getTestRunsOrBuilder(int index); +} diff --git a/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/RestError.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/RestError.java new file mode 100644 index 0000000000..4571408339 --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/RestError.java @@ -0,0 +1,2154 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/rest_error.proto + +package com.google.showcase.v1beta1; + +/** + * + * + *
        + * HTTP/JSON error representation as defined in
        + * https://google.aip.dev/193#http11json-representation,
        + * 
        + * + * Protobuf type {@code google.showcase.v1beta1.RestError} + */ +public final class RestError extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.RestError) + RestErrorOrBuilder { + private static final long serialVersionUID = 0L; + + // Use RestError.newBuilder() to construct. + private RestError(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private RestError() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new RestError(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private RestError( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + com.google.showcase.v1beta1.RestError.Status.Builder subBuilder = null; + if (error_ != null) { + subBuilder = error_.toBuilder(); + } + error_ = + input.readMessage( + com.google.showcase.v1beta1.RestError.Status.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(error_); + error_ = subBuilder.buildPartial(); + } + + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.RestErrorOuterClass + .internal_static_google_showcase_v1beta1_RestError_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.RestErrorOuterClass + .internal_static_google_showcase_v1beta1_RestError_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.RestError.class, + com.google.showcase.v1beta1.RestError.Builder.class); + } + + public interface StatusOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.RestError.Status) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
        +     * The HTTP status code that corresponds to `google.rpc.Status.code`.
        +     * 
        + * + * int32 code = 1; + * + * @return The code. + */ + int getCode(); + + /** + * + * + *
        +     * This corresponds to `google.rpc.Status.message`.
        +     * 
        + * + * string message = 2; + * + * @return The message. + */ + java.lang.String getMessage(); + + /** + * + * + *
        +     * This corresponds to `google.rpc.Status.message`.
        +     * 
        + * + * string message = 2; + * + * @return The bytes for message. + */ + com.google.protobuf.ByteString getMessageBytes(); + + /** + * + * + *
        +     * This is the enum version for `google.rpc.Status.code`.
        +     * 
        + * + * .google.rpc.Code status = 4; + * + * @return The enum numeric value on the wire for status. + */ + int getStatusValue(); + + /** + * + * + *
        +     * This is the enum version for `google.rpc.Status.code`.
        +     * 
        + * + * .google.rpc.Code status = 4; + * + * @return The status. + */ + com.google.rpc.Code getStatus(); + + /** + * + * + *
        +     * This corresponds to `google.rpc.Status.details`.
        +     * 
        + * + * repeated .google.protobuf.Any details = 5; + */ + java.util.List getDetailsList(); + + /** + * + * + *
        +     * This corresponds to `google.rpc.Status.details`.
        +     * 
        + * + * repeated .google.protobuf.Any details = 5; + */ + com.google.protobuf.Any getDetails(int index); + + /** + * + * + *
        +     * This corresponds to `google.rpc.Status.details`.
        +     * 
        + * + * repeated .google.protobuf.Any details = 5; + */ + int getDetailsCount(); + + /** + * + * + *
        +     * This corresponds to `google.rpc.Status.details`.
        +     * 
        + * + * repeated .google.protobuf.Any details = 5; + */ + java.util.List getDetailsOrBuilderList(); + + /** + * + * + *
        +     * This corresponds to `google.rpc.Status.details`.
        +     * 
        + * + * repeated .google.protobuf.Any details = 5; + */ + com.google.protobuf.AnyOrBuilder getDetailsOrBuilder(int index); + } + + /** Protobuf type {@code google.showcase.v1beta1.RestError.Status} */ + public static final class Status extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.RestError.Status) + StatusOrBuilder { + private static final long serialVersionUID = 0L; + + // Use Status.newBuilder() to construct. + private Status(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Status() { + message_ = ""; + status_ = 0; + details_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Status(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private Status( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: + { + code_ = input.readInt32(); + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + message_ = s; + break; + } + case 32: + { + int rawValue = input.readEnum(); + + status_ = rawValue; + break; + } + case 42: + { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + details_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + details_.add( + input.readMessage(com.google.protobuf.Any.parser(), extensionRegistry)); + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + details_ = java.util.Collections.unmodifiableList(details_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.RestErrorOuterClass + .internal_static_google_showcase_v1beta1_RestError_Status_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.RestErrorOuterClass + .internal_static_google_showcase_v1beta1_RestError_Status_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.RestError.Status.class, + com.google.showcase.v1beta1.RestError.Status.Builder.class); + } + + public static final int CODE_FIELD_NUMBER = 1; + private int code_; + + /** + * + * + *
        +     * The HTTP status code that corresponds to `google.rpc.Status.code`.
        +     * 
        + * + * int32 code = 1; + * + * @return The code. + */ + @java.lang.Override + public int getCode() { + return code_; + } + + public static final int MESSAGE_FIELD_NUMBER = 2; + private volatile java.lang.Object message_; + + /** + * + * + *
        +     * This corresponds to `google.rpc.Status.message`.
        +     * 
        + * + * string message = 2; + * + * @return The message. + */ + @java.lang.Override + public java.lang.String getMessage() { + java.lang.Object ref = message_; + 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(); + message_ = s; + return s; + } + } + + /** + * + * + *
        +     * This corresponds to `google.rpc.Status.message`.
        +     * 
        + * + * string message = 2; + * + * @return The bytes for message. + */ + @java.lang.Override + public com.google.protobuf.ByteString getMessageBytes() { + java.lang.Object ref = message_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + message_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int STATUS_FIELD_NUMBER = 4; + private int status_; + + /** + * + * + *
        +     * This is the enum version for `google.rpc.Status.code`.
        +     * 
        + * + * .google.rpc.Code status = 4; + * + * @return The enum numeric value on the wire for status. + */ + @java.lang.Override + public int getStatusValue() { + return status_; + } + + /** + * + * + *
        +     * This is the enum version for `google.rpc.Status.code`.
        +     * 
        + * + * .google.rpc.Code status = 4; + * + * @return The status. + */ + @java.lang.Override + public com.google.rpc.Code getStatus() { + @SuppressWarnings("deprecation") + com.google.rpc.Code result = com.google.rpc.Code.valueOf(status_); + return result == null ? com.google.rpc.Code.UNRECOGNIZED : result; + } + + public static final int DETAILS_FIELD_NUMBER = 5; + private java.util.List details_; + + /** + * + * + *
        +     * This corresponds to `google.rpc.Status.details`.
        +     * 
        + * + * repeated .google.protobuf.Any details = 5; + */ + @java.lang.Override + public java.util.List getDetailsList() { + return details_; + } + + /** + * + * + *
        +     * This corresponds to `google.rpc.Status.details`.
        +     * 
        + * + * repeated .google.protobuf.Any details = 5; + */ + @java.lang.Override + public java.util.List getDetailsOrBuilderList() { + return details_; + } + + /** + * + * + *
        +     * This corresponds to `google.rpc.Status.details`.
        +     * 
        + * + * repeated .google.protobuf.Any details = 5; + */ + @java.lang.Override + public int getDetailsCount() { + return details_.size(); + } + + /** + * + * + *
        +     * This corresponds to `google.rpc.Status.details`.
        +     * 
        + * + * repeated .google.protobuf.Any details = 5; + */ + @java.lang.Override + public com.google.protobuf.Any getDetails(int index) { + return details_.get(index); + } + + /** + * + * + *
        +     * This corresponds to `google.rpc.Status.details`.
        +     * 
        + * + * repeated .google.protobuf.Any details = 5; + */ + @java.lang.Override + public com.google.protobuf.AnyOrBuilder getDetailsOrBuilder(int index) { + return details_.get(index); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (code_ != 0) { + output.writeInt32(1, code_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(message_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, message_); + } + if (status_ != com.google.rpc.Code.OK.getNumber()) { + output.writeEnum(4, status_); + } + for (int i = 0; i < details_.size(); i++) { + output.writeMessage(5, details_.get(i)); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (code_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(1, code_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(message_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, message_); + } + if (status_ != com.google.rpc.Code.OK.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(4, status_); + } + for (int i = 0; i < details_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(5, details_.get(i)); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.showcase.v1beta1.RestError.Status)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.RestError.Status other = + (com.google.showcase.v1beta1.RestError.Status) obj; + + if (getCode() != other.getCode()) return false; + if (!getMessage().equals(other.getMessage())) return false; + if (status_ != other.status_) return false; + if (!getDetailsList().equals(other.getDetailsList())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + CODE_FIELD_NUMBER; + hash = (53 * hash) + getCode(); + hash = (37 * hash) + MESSAGE_FIELD_NUMBER; + hash = (53 * hash) + getMessage().hashCode(); + hash = (37 * hash) + STATUS_FIELD_NUMBER; + hash = (53 * hash) + status_; + if (getDetailsCount() > 0) { + hash = (37 * hash) + DETAILS_FIELD_NUMBER; + hash = (53 * hash) + getDetailsList().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.showcase.v1beta1.RestError.Status parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.RestError.Status parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.RestError.Status parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.RestError.Status 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.showcase.v1beta1.RestError.Status parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.RestError.Status parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.RestError.Status parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.RestError.Status 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.showcase.v1beta1.RestError.Status parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.RestError.Status 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.showcase.v1beta1.RestError.Status parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.RestError.Status 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.showcase.v1beta1.RestError.Status prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** Protobuf type {@code google.showcase.v1beta1.RestError.Status} */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.RestError.Status) + com.google.showcase.v1beta1.RestError.StatusOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.RestErrorOuterClass + .internal_static_google_showcase_v1beta1_RestError_Status_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.RestErrorOuterClass + .internal_static_google_showcase_v1beta1_RestError_Status_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.RestError.Status.class, + com.google.showcase.v1beta1.RestError.Status.Builder.class); + } + + // Construct using com.google.showcase.v1beta1.RestError.Status.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getDetailsFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + code_ = 0; + + message_ = ""; + + status_ = 0; + + if (detailsBuilder_ == null) { + details_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + detailsBuilder_.clear(); + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.showcase.v1beta1.RestErrorOuterClass + .internal_static_google_showcase_v1beta1_RestError_Status_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.RestError.Status getDefaultInstanceForType() { + return com.google.showcase.v1beta1.RestError.Status.getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.RestError.Status build() { + com.google.showcase.v1beta1.RestError.Status result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.RestError.Status buildPartial() { + com.google.showcase.v1beta1.RestError.Status result = + new com.google.showcase.v1beta1.RestError.Status(this); + int from_bitField0_ = bitField0_; + result.code_ = code_; + result.message_ = message_; + result.status_ = status_; + if (detailsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + details_ = java.util.Collections.unmodifiableList(details_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.details_ = details_; + } else { + result.details_ = detailsBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, + java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.showcase.v1beta1.RestError.Status) { + return mergeFrom((com.google.showcase.v1beta1.RestError.Status) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.showcase.v1beta1.RestError.Status other) { + if (other == com.google.showcase.v1beta1.RestError.Status.getDefaultInstance()) return this; + if (other.getCode() != 0) { + setCode(other.getCode()); + } + if (!other.getMessage().isEmpty()) { + message_ = other.message_; + onChanged(); + } + if (other.status_ != 0) { + setStatusValue(other.getStatusValue()); + } + if (detailsBuilder_ == null) { + if (!other.details_.isEmpty()) { + if (details_.isEmpty()) { + details_ = other.details_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureDetailsIsMutable(); + details_.addAll(other.details_); + } + onChanged(); + } + } else { + if (!other.details_.isEmpty()) { + if (detailsBuilder_.isEmpty()) { + detailsBuilder_.dispose(); + detailsBuilder_ = null; + details_ = other.details_; + bitField0_ = (bitField0_ & ~0x00000001); + detailsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getDetailsFieldBuilder() + : null; + } else { + detailsBuilder_.addAllMessages(other.details_); + } + } + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.showcase.v1beta1.RestError.Status parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.showcase.v1beta1.RestError.Status) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private int code_; + + /** + * + * + *
        +       * The HTTP status code that corresponds to `google.rpc.Status.code`.
        +       * 
        + * + * int32 code = 1; + * + * @return The code. + */ + @java.lang.Override + public int getCode() { + return code_; + } + + /** + * + * + *
        +       * The HTTP status code that corresponds to `google.rpc.Status.code`.
        +       * 
        + * + * int32 code = 1; + * + * @param value The code to set. + * @return This builder for chaining. + */ + public Builder setCode(int value) { + + code_ = value; + onChanged(); + return this; + } + + /** + * + * + *
        +       * The HTTP status code that corresponds to `google.rpc.Status.code`.
        +       * 
        + * + * int32 code = 1; + * + * @return This builder for chaining. + */ + public Builder clearCode() { + + code_ = 0; + onChanged(); + return this; + } + + private java.lang.Object message_ = ""; + + /** + * + * + *
        +       * This corresponds to `google.rpc.Status.message`.
        +       * 
        + * + * string message = 2; + * + * @return The message. + */ + public java.lang.String getMessage() { + java.lang.Object ref = message_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + message_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
        +       * This corresponds to `google.rpc.Status.message`.
        +       * 
        + * + * string message = 2; + * + * @return The bytes for message. + */ + public com.google.protobuf.ByteString getMessageBytes() { + java.lang.Object ref = message_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + message_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
        +       * This corresponds to `google.rpc.Status.message`.
        +       * 
        + * + * string message = 2; + * + * @param value The message to set. + * @return This builder for chaining. + */ + public Builder setMessage(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + message_ = value; + onChanged(); + return this; + } + + /** + * + * + *
        +       * This corresponds to `google.rpc.Status.message`.
        +       * 
        + * + * string message = 2; + * + * @return This builder for chaining. + */ + public Builder clearMessage() { + + message_ = getDefaultInstance().getMessage(); + onChanged(); + return this; + } + + /** + * + * + *
        +       * This corresponds to `google.rpc.Status.message`.
        +       * 
        + * + * string message = 2; + * + * @param value The bytes for message to set. + * @return This builder for chaining. + */ + public Builder setMessageBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + message_ = value; + onChanged(); + return this; + } + + private int status_ = 0; + + /** + * + * + *
        +       * This is the enum version for `google.rpc.Status.code`.
        +       * 
        + * + * .google.rpc.Code status = 4; + * + * @return The enum numeric value on the wire for status. + */ + @java.lang.Override + public int getStatusValue() { + return status_; + } + + /** + * + * + *
        +       * This is the enum version for `google.rpc.Status.code`.
        +       * 
        + * + * .google.rpc.Code status = 4; + * + * @param value The enum numeric value on the wire for status to set. + * @return This builder for chaining. + */ + public Builder setStatusValue(int value) { + + status_ = value; + onChanged(); + return this; + } + + /** + * + * + *
        +       * This is the enum version for `google.rpc.Status.code`.
        +       * 
        + * + * .google.rpc.Code status = 4; + * + * @return The status. + */ + @java.lang.Override + public com.google.rpc.Code getStatus() { + @SuppressWarnings("deprecation") + com.google.rpc.Code result = com.google.rpc.Code.valueOf(status_); + return result == null ? com.google.rpc.Code.UNRECOGNIZED : result; + } + + /** + * + * + *
        +       * This is the enum version for `google.rpc.Status.code`.
        +       * 
        + * + * .google.rpc.Code status = 4; + * + * @param value The status to set. + * @return This builder for chaining. + */ + public Builder setStatus(com.google.rpc.Code value) { + if (value == null) { + throw new NullPointerException(); + } + + status_ = value.getNumber(); + onChanged(); + return this; + } + + /** + * + * + *
        +       * This is the enum version for `google.rpc.Status.code`.
        +       * 
        + * + * .google.rpc.Code status = 4; + * + * @return This builder for chaining. + */ + public Builder clearStatus() { + + status_ = 0; + onChanged(); + return this; + } + + private java.util.List details_ = java.util.Collections.emptyList(); + + private void ensureDetailsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + details_ = new java.util.ArrayList(details_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.protobuf.Any, + com.google.protobuf.Any.Builder, + com.google.protobuf.AnyOrBuilder> + detailsBuilder_; + + /** + * + * + *
        +       * This corresponds to `google.rpc.Status.details`.
        +       * 
        + * + * repeated .google.protobuf.Any details = 5; + */ + public java.util.List getDetailsList() { + if (detailsBuilder_ == null) { + return java.util.Collections.unmodifiableList(details_); + } else { + return detailsBuilder_.getMessageList(); + } + } + + /** + * + * + *
        +       * This corresponds to `google.rpc.Status.details`.
        +       * 
        + * + * repeated .google.protobuf.Any details = 5; + */ + public int getDetailsCount() { + if (detailsBuilder_ == null) { + return details_.size(); + } else { + return detailsBuilder_.getCount(); + } + } + + /** + * + * + *
        +       * This corresponds to `google.rpc.Status.details`.
        +       * 
        + * + * repeated .google.protobuf.Any details = 5; + */ + public com.google.protobuf.Any getDetails(int index) { + if (detailsBuilder_ == null) { + return details_.get(index); + } else { + return detailsBuilder_.getMessage(index); + } + } + + /** + * + * + *
        +       * This corresponds to `google.rpc.Status.details`.
        +       * 
        + * + * repeated .google.protobuf.Any details = 5; + */ + public Builder setDetails(int index, com.google.protobuf.Any value) { + if (detailsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureDetailsIsMutable(); + details_.set(index, value); + onChanged(); + } else { + detailsBuilder_.setMessage(index, value); + } + return this; + } + + /** + * + * + *
        +       * This corresponds to `google.rpc.Status.details`.
        +       * 
        + * + * repeated .google.protobuf.Any details = 5; + */ + public Builder setDetails(int index, com.google.protobuf.Any.Builder builderForValue) { + if (detailsBuilder_ == null) { + ensureDetailsIsMutable(); + details_.set(index, builderForValue.build()); + onChanged(); + } else { + detailsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
        +       * This corresponds to `google.rpc.Status.details`.
        +       * 
        + * + * repeated .google.protobuf.Any details = 5; + */ + public Builder addDetails(com.google.protobuf.Any value) { + if (detailsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureDetailsIsMutable(); + details_.add(value); + onChanged(); + } else { + detailsBuilder_.addMessage(value); + } + return this; + } + + /** + * + * + *
        +       * This corresponds to `google.rpc.Status.details`.
        +       * 
        + * + * repeated .google.protobuf.Any details = 5; + */ + public Builder addDetails(int index, com.google.protobuf.Any value) { + if (detailsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureDetailsIsMutable(); + details_.add(index, value); + onChanged(); + } else { + detailsBuilder_.addMessage(index, value); + } + return this; + } + + /** + * + * + *
        +       * This corresponds to `google.rpc.Status.details`.
        +       * 
        + * + * repeated .google.protobuf.Any details = 5; + */ + public Builder addDetails(com.google.protobuf.Any.Builder builderForValue) { + if (detailsBuilder_ == null) { + ensureDetailsIsMutable(); + details_.add(builderForValue.build()); + onChanged(); + } else { + detailsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + + /** + * + * + *
        +       * This corresponds to `google.rpc.Status.details`.
        +       * 
        + * + * repeated .google.protobuf.Any details = 5; + */ + public Builder addDetails(int index, com.google.protobuf.Any.Builder builderForValue) { + if (detailsBuilder_ == null) { + ensureDetailsIsMutable(); + details_.add(index, builderForValue.build()); + onChanged(); + } else { + detailsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
        +       * This corresponds to `google.rpc.Status.details`.
        +       * 
        + * + * repeated .google.protobuf.Any details = 5; + */ + public Builder addAllDetails(java.lang.Iterable values) { + if (detailsBuilder_ == null) { + ensureDetailsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, details_); + onChanged(); + } else { + detailsBuilder_.addAllMessages(values); + } + return this; + } + + /** + * + * + *
        +       * This corresponds to `google.rpc.Status.details`.
        +       * 
        + * + * repeated .google.protobuf.Any details = 5; + */ + public Builder clearDetails() { + if (detailsBuilder_ == null) { + details_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + detailsBuilder_.clear(); + } + return this; + } + + /** + * + * + *
        +       * This corresponds to `google.rpc.Status.details`.
        +       * 
        + * + * repeated .google.protobuf.Any details = 5; + */ + public Builder removeDetails(int index) { + if (detailsBuilder_ == null) { + ensureDetailsIsMutable(); + details_.remove(index); + onChanged(); + } else { + detailsBuilder_.remove(index); + } + return this; + } + + /** + * + * + *
        +       * This corresponds to `google.rpc.Status.details`.
        +       * 
        + * + * repeated .google.protobuf.Any details = 5; + */ + public com.google.protobuf.Any.Builder getDetailsBuilder(int index) { + return getDetailsFieldBuilder().getBuilder(index); + } + + /** + * + * + *
        +       * This corresponds to `google.rpc.Status.details`.
        +       * 
        + * + * repeated .google.protobuf.Any details = 5; + */ + public com.google.protobuf.AnyOrBuilder getDetailsOrBuilder(int index) { + if (detailsBuilder_ == null) { + return details_.get(index); + } else { + return detailsBuilder_.getMessageOrBuilder(index); + } + } + + /** + * + * + *
        +       * This corresponds to `google.rpc.Status.details`.
        +       * 
        + * + * repeated .google.protobuf.Any details = 5; + */ + public java.util.List getDetailsOrBuilderList() { + if (detailsBuilder_ != null) { + return detailsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(details_); + } + } + + /** + * + * + *
        +       * This corresponds to `google.rpc.Status.details`.
        +       * 
        + * + * repeated .google.protobuf.Any details = 5; + */ + public com.google.protobuf.Any.Builder addDetailsBuilder() { + return getDetailsFieldBuilder().addBuilder(com.google.protobuf.Any.getDefaultInstance()); + } + + /** + * + * + *
        +       * This corresponds to `google.rpc.Status.details`.
        +       * 
        + * + * repeated .google.protobuf.Any details = 5; + */ + public com.google.protobuf.Any.Builder addDetailsBuilder(int index) { + return getDetailsFieldBuilder() + .addBuilder(index, com.google.protobuf.Any.getDefaultInstance()); + } + + /** + * + * + *
        +       * This corresponds to `google.rpc.Status.details`.
        +       * 
        + * + * repeated .google.protobuf.Any details = 5; + */ + public java.util.List getDetailsBuilderList() { + return getDetailsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.protobuf.Any, + com.google.protobuf.Any.Builder, + com.google.protobuf.AnyOrBuilder> + getDetailsFieldBuilder() { + if (detailsBuilder_ == null) { + detailsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.protobuf.Any, + com.google.protobuf.Any.Builder, + com.google.protobuf.AnyOrBuilder>( + details_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + details_ = null; + } + return detailsBuilder_; + } + + @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.showcase.v1beta1.RestError.Status) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.RestError.Status) + private static final com.google.showcase.v1beta1.RestError.Status DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.RestError.Status(); + } + + public static com.google.showcase.v1beta1.RestError.Status getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Status parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Status(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.showcase.v1beta1.RestError.Status getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public static final int ERROR_FIELD_NUMBER = 1; + private com.google.showcase.v1beta1.RestError.Status error_; + + /** + * .google.showcase.v1beta1.RestError.Status error = 1; + * + * @return Whether the error field is set. + */ + @java.lang.Override + public boolean hasError() { + return error_ != null; + } + + /** + * .google.showcase.v1beta1.RestError.Status error = 1; + * + * @return The error. + */ + @java.lang.Override + public com.google.showcase.v1beta1.RestError.Status getError() { + return error_ == null + ? com.google.showcase.v1beta1.RestError.Status.getDefaultInstance() + : error_; + } + + /** .google.showcase.v1beta1.RestError.Status error = 1; */ + @java.lang.Override + public com.google.showcase.v1beta1.RestError.StatusOrBuilder getErrorOrBuilder() { + return getError(); + } + + 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 (error_ != null) { + output.writeMessage(1, getError()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (error_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getError()); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.showcase.v1beta1.RestError)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.RestError other = (com.google.showcase.v1beta1.RestError) obj; + + if (hasError() != other.hasError()) return false; + if (hasError()) { + if (!getError().equals(other.getError())) return false; + } + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasError()) { + hash = (37 * hash) + ERROR_FIELD_NUMBER; + hash = (53 * hash) + getError().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.showcase.v1beta1.RestError parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.RestError parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.RestError parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.RestError 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.showcase.v1beta1.RestError parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.RestError parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.RestError parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.RestError 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.showcase.v1beta1.RestError parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.RestError 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.showcase.v1beta1.RestError parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.RestError 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.showcase.v1beta1.RestError 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; + } + + /** + * + * + *
        +   * HTTP/JSON error representation as defined in
        +   * https://google.aip.dev/193#http11json-representation,
        +   * 
        + * + * Protobuf type {@code google.showcase.v1beta1.RestError} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.RestError) + com.google.showcase.v1beta1.RestErrorOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.RestErrorOuterClass + .internal_static_google_showcase_v1beta1_RestError_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.RestErrorOuterClass + .internal_static_google_showcase_v1beta1_RestError_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.RestError.class, + com.google.showcase.v1beta1.RestError.Builder.class); + } + + // Construct using com.google.showcase.v1beta1.RestError.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (errorBuilder_ == null) { + error_ = null; + } else { + error_ = null; + errorBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.showcase.v1beta1.RestErrorOuterClass + .internal_static_google_showcase_v1beta1_RestError_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.RestError getDefaultInstanceForType() { + return com.google.showcase.v1beta1.RestError.getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.RestError build() { + com.google.showcase.v1beta1.RestError result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.RestError buildPartial() { + com.google.showcase.v1beta1.RestError result = + new com.google.showcase.v1beta1.RestError(this); + if (errorBuilder_ == null) { + result.error_ = error_; + } else { + result.error_ = errorBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.showcase.v1beta1.RestError) { + return mergeFrom((com.google.showcase.v1beta1.RestError) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.showcase.v1beta1.RestError other) { + if (other == com.google.showcase.v1beta1.RestError.getDefaultInstance()) return this; + if (other.hasError()) { + mergeError(other.getError()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.showcase.v1beta1.RestError parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.showcase.v1beta1.RestError) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private com.google.showcase.v1beta1.RestError.Status error_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.showcase.v1beta1.RestError.Status, + com.google.showcase.v1beta1.RestError.Status.Builder, + com.google.showcase.v1beta1.RestError.StatusOrBuilder> + errorBuilder_; + + /** + * .google.showcase.v1beta1.RestError.Status error = 1; + * + * @return Whether the error field is set. + */ + public boolean hasError() { + return errorBuilder_ != null || error_ != null; + } + + /** + * .google.showcase.v1beta1.RestError.Status error = 1; + * + * @return The error. + */ + public com.google.showcase.v1beta1.RestError.Status getError() { + if (errorBuilder_ == null) { + return error_ == null + ? com.google.showcase.v1beta1.RestError.Status.getDefaultInstance() + : error_; + } else { + return errorBuilder_.getMessage(); + } + } + + /** .google.showcase.v1beta1.RestError.Status error = 1; */ + public Builder setError(com.google.showcase.v1beta1.RestError.Status value) { + if (errorBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + error_ = value; + onChanged(); + } else { + errorBuilder_.setMessage(value); + } + + return this; + } + + /** .google.showcase.v1beta1.RestError.Status error = 1; */ + public Builder setError(com.google.showcase.v1beta1.RestError.Status.Builder builderForValue) { + if (errorBuilder_ == null) { + error_ = builderForValue.build(); + onChanged(); + } else { + errorBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + + /** .google.showcase.v1beta1.RestError.Status error = 1; */ + public Builder mergeError(com.google.showcase.v1beta1.RestError.Status value) { + if (errorBuilder_ == null) { + if (error_ != null) { + error_ = + com.google.showcase.v1beta1.RestError.Status.newBuilder(error_) + .mergeFrom(value) + .buildPartial(); + } else { + error_ = value; + } + onChanged(); + } else { + errorBuilder_.mergeFrom(value); + } + + return this; + } + + /** .google.showcase.v1beta1.RestError.Status error = 1; */ + public Builder clearError() { + if (errorBuilder_ == null) { + error_ = null; + onChanged(); + } else { + error_ = null; + errorBuilder_ = null; + } + + return this; + } + + /** .google.showcase.v1beta1.RestError.Status error = 1; */ + public com.google.showcase.v1beta1.RestError.Status.Builder getErrorBuilder() { + + onChanged(); + return getErrorFieldBuilder().getBuilder(); + } + + /** .google.showcase.v1beta1.RestError.Status error = 1; */ + public com.google.showcase.v1beta1.RestError.StatusOrBuilder getErrorOrBuilder() { + if (errorBuilder_ != null) { + return errorBuilder_.getMessageOrBuilder(); + } else { + return error_ == null + ? com.google.showcase.v1beta1.RestError.Status.getDefaultInstance() + : error_; + } + } + + /** .google.showcase.v1beta1.RestError.Status error = 1; */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.showcase.v1beta1.RestError.Status, + com.google.showcase.v1beta1.RestError.Status.Builder, + com.google.showcase.v1beta1.RestError.StatusOrBuilder> + getErrorFieldBuilder() { + if (errorBuilder_ == null) { + errorBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.showcase.v1beta1.RestError.Status, + com.google.showcase.v1beta1.RestError.Status.Builder, + com.google.showcase.v1beta1.RestError.StatusOrBuilder>( + getError(), getParentForChildren(), isClean()); + error_ = null; + } + return errorBuilder_; + } + + @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.showcase.v1beta1.RestError) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.RestError) + private static final com.google.showcase.v1beta1.RestError DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.RestError(); + } + + public static com.google.showcase.v1beta1.RestError getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public RestError parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new RestError(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.showcase.v1beta1.RestError getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/RestErrorOrBuilder.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/RestErrorOrBuilder.java new file mode 100644 index 0000000000..c5bd85534f --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/RestErrorOrBuilder.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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/rest_error.proto + +package com.google.showcase.v1beta1; + +public interface RestErrorOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.RestError) + com.google.protobuf.MessageOrBuilder { + + /** + * .google.showcase.v1beta1.RestError.Status error = 1; + * + * @return Whether the error field is set. + */ + boolean hasError(); + + /** + * .google.showcase.v1beta1.RestError.Status error = 1; + * + * @return The error. + */ + com.google.showcase.v1beta1.RestError.Status getError(); + + /** .google.showcase.v1beta1.RestError.Status error = 1; */ + com.google.showcase.v1beta1.RestError.StatusOrBuilder getErrorOrBuilder(); +} diff --git a/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/RestErrorOuterClass.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/RestErrorOuterClass.java new file mode 100644 index 0000000000..62a5a5cdc0 --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/RestErrorOuterClass.java @@ -0,0 +1,87 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/rest_error.proto + +package com.google.showcase.v1beta1; + +public final class RestErrorOuterClass { + private RestErrorOuterClass() {} + + 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_showcase_v1beta1_RestError_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_showcase_v1beta1_RestError_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_showcase_v1beta1_RestError_Status_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_showcase_v1beta1_RestError_Status_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/schema/google/showcase/v1beta1/rest_er" + + "ror.proto\022\027google.showcase.v1beta1\032\031goog" + + "le/protobuf/any.proto\032\025google/rpc/code.p" + + "roto\"\267\001\n\tRestError\0228\n\005error\030\001 \001(\0132).goog" + + "le.showcase.v1beta1.RestError.Status\032p\n\006" + + "Status\022\014\n\004code\030\001 \001(\005\022\017\n\007message\030\002 \001(\t\022 \n" + + "\006status\030\004 \001(\0162\020.google.rpc.Code\022%\n\007detai" + + "ls\030\005 \003(\0132\024.google.protobuf.AnyBq\n\033com.go" + + "ogle.showcase.v1beta1P\001Z4github.com/goog" + + "leapis/gapic-showcase/server/genproto\352\002\031" + + "Google::Showcase::V1beta1b\006proto3" + }; + descriptor = + com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( + descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + com.google.protobuf.AnyProto.getDescriptor(), + com.google.rpc.CodeProto.getDescriptor(), + }); + internal_static_google_showcase_v1beta1_RestError_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_showcase_v1beta1_RestError_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_showcase_v1beta1_RestError_descriptor, + new java.lang.String[] { + "Error", + }); + internal_static_google_showcase_v1beta1_RestError_Status_descriptor = + internal_static_google_showcase_v1beta1_RestError_descriptor.getNestedTypes().get(0); + internal_static_google_showcase_v1beta1_RestError_Status_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_showcase_v1beta1_RestError_Status_descriptor, + new java.lang.String[] { + "Code", "Message", "Status", "Details", + }); + com.google.protobuf.AnyProto.getDescriptor(); + com.google.rpc.CodeProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/Room.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/Room.java new file mode 100644 index 0000000000..e01afc2b5d --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/Room.java @@ -0,0 +1,1623 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/messaging.proto + +package com.google.showcase.v1beta1; + +/** + * + * + *
        + * A chat room.
        + * 
        + * + * Protobuf type {@code google.showcase.v1beta1.Room} + */ +public final class Room extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.Room) + RoomOrBuilder { + private static final long serialVersionUID = 0L; + + // Use Room.newBuilder() to construct. + private Room(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Room() { + name_ = ""; + displayName_ = ""; + description_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Room(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private Room( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + displayName_ = s; + break; + } + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + + description_ = s; + break; + } + case 34: + { + com.google.protobuf.Timestamp.Builder subBuilder = null; + if (createTime_ != null) { + subBuilder = createTime_.toBuilder(); + } + createTime_ = + input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(createTime_); + createTime_ = subBuilder.buildPartial(); + } + + break; + } + case 42: + { + com.google.protobuf.Timestamp.Builder subBuilder = null; + if (updateTime_ != null) { + subBuilder = updateTime_.toBuilder(); + } + updateTime_ = + input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(updateTime_); + updateTime_ = subBuilder.buildPartial(); + } + + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.MessagingOuterClass + .internal_static_google_showcase_v1beta1_Room_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.MessagingOuterClass + .internal_static_google_showcase_v1beta1_Room_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.Room.class, com.google.showcase.v1beta1.Room.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + + /** + * + * + *
        +   * The resource name of the chat room.
        +   * 
        + * + * 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 chat room.
        +   * 
        + * + * 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 DISPLAY_NAME_FIELD_NUMBER = 2; + private volatile java.lang.Object displayName_; + + /** + * + * + *
        +   * The human readable name of the chat room.
        +   * 
        + * + * string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The displayName. + */ + @java.lang.Override + public java.lang.String getDisplayName() { + java.lang.Object ref = displayName_; + 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(); + displayName_ = s; + return s; + } + } + + /** + * + * + *
        +   * The human readable name of the chat room.
        +   * 
        + * + * string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for displayName. + */ + @java.lang.Override + public com.google.protobuf.ByteString getDisplayNameBytes() { + java.lang.Object ref = displayName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + displayName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int DESCRIPTION_FIELD_NUMBER = 3; + private volatile java.lang.Object description_; + + /** + * + * + *
        +   * The description of the chat room.
        +   * 
        + * + * 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; + } + } + + /** + * + * + *
        +   * The description of the chat room.
        +   * 
        + * + * 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_; + + /** + * + * + *
        +   * The timestamp at which the room was created.
        +   * 
        + * + * .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 createTime_ != null; + } + + /** + * + * + *
        +   * The timestamp at which the room was created.
        +   * 
        + * + * .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_; + } + + /** + * + * + *
        +   * The timestamp at which the room was created.
        +   * 
        + * + * .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { + return getCreateTime(); + } + + public static final int UPDATE_TIME_FIELD_NUMBER = 5; + private com.google.protobuf.Timestamp updateTime_; + + /** + * + * + *
        +   * The latest timestamp at which the room was updated.
        +   * 
        + * + * .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the updateTime field is set. + */ + @java.lang.Override + public boolean hasUpdateTime() { + return updateTime_ != null; + } + + /** + * + * + *
        +   * The latest timestamp at which the room was updated.
        +   * 
        + * + * .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The updateTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getUpdateTime() { + return updateTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : updateTime_; + } + + /** + * + * + *
        +   * The latest timestamp at which the room was updated.
        +   * 
        + * + * .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder() { + return getUpdateTime(); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(displayName_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, displayName_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(description_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, description_); + } + if (createTime_ != null) { + output.writeMessage(4, getCreateTime()); + } + if (updateTime_ != null) { + output.writeMessage(5, getUpdateTime()); + } + unknownFields.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(displayName_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, displayName_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(description_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, description_); + } + if (createTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, getCreateTime()); + } + if (updateTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(5, getUpdateTime()); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.showcase.v1beta1.Room)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.Room other = (com.google.showcase.v1beta1.Room) obj; + + if (!getName().equals(other.getName())) return false; + if (!getDisplayName().equals(other.getDisplayName())) 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 (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (37 * hash) + DISPLAY_NAME_FIELD_NUMBER; + hash = (53 * hash) + getDisplayName().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 = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.showcase.v1beta1.Room parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.Room parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.Room parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.Room 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.showcase.v1beta1.Room parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.Room parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.Room parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.Room 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.showcase.v1beta1.Room parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.Room 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.showcase.v1beta1.Room parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.Room 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.showcase.v1beta1.Room prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
        +   * A chat room.
        +   * 
        + * + * Protobuf type {@code google.showcase.v1beta1.Room} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.Room) + com.google.showcase.v1beta1.RoomOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.MessagingOuterClass + .internal_static_google_showcase_v1beta1_Room_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.MessagingOuterClass + .internal_static_google_showcase_v1beta1_Room_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.Room.class, + com.google.showcase.v1beta1.Room.Builder.class); + } + + // Construct using com.google.showcase.v1beta1.Room.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + displayName_ = ""; + + description_ = ""; + + if (createTimeBuilder_ == null) { + createTime_ = null; + } else { + createTime_ = null; + createTimeBuilder_ = null; + } + if (updateTimeBuilder_ == null) { + updateTime_ = null; + } else { + updateTime_ = null; + updateTimeBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.showcase.v1beta1.MessagingOuterClass + .internal_static_google_showcase_v1beta1_Room_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.Room getDefaultInstanceForType() { + return com.google.showcase.v1beta1.Room.getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.Room build() { + com.google.showcase.v1beta1.Room result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.Room buildPartial() { + com.google.showcase.v1beta1.Room result = new com.google.showcase.v1beta1.Room(this); + result.name_ = name_; + result.displayName_ = displayName_; + result.description_ = description_; + if (createTimeBuilder_ == null) { + result.createTime_ = createTime_; + } else { + result.createTime_ = createTimeBuilder_.build(); + } + if (updateTimeBuilder_ == null) { + result.updateTime_ = updateTime_; + } else { + result.updateTime_ = updateTimeBuilder_.build(); + } + 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.showcase.v1beta1.Room) { + return mergeFrom((com.google.showcase.v1beta1.Room) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.showcase.v1beta1.Room other) { + if (other == com.google.showcase.v1beta1.Room.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + if (!other.getDisplayName().isEmpty()) { + displayName_ = other.displayName_; + onChanged(); + } + if (!other.getDescription().isEmpty()) { + description_ = other.description_; + onChanged(); + } + if (other.hasCreateTime()) { + mergeCreateTime(other.getCreateTime()); + } + if (other.hasUpdateTime()) { + mergeUpdateTime(other.getUpdateTime()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.showcase.v1beta1.Room parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.showcase.v1beta1.Room) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + + /** + * + * + *
        +     * The resource name of the chat room.
        +     * 
        + * + * 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 chat room.
        +     * 
        + * + * 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 chat room.
        +     * 
        + * + * string name = 1; + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + + /** + * + * + *
        +     * The resource name of the chat room.
        +     * 
        + * + * string name = 1; + * + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + + /** + * + * + *
        +     * The resource name of the chat room.
        +     * 
        + * + * string name = 1; + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + + private java.lang.Object displayName_ = ""; + + /** + * + * + *
        +     * The human readable name of the chat room.
        +     * 
        + * + * string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The displayName. + */ + public java.lang.String getDisplayName() { + java.lang.Object ref = displayName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + displayName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
        +     * The human readable name of the chat room.
        +     * 
        + * + * string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for displayName. + */ + public com.google.protobuf.ByteString getDisplayNameBytes() { + java.lang.Object ref = displayName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + displayName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
        +     * The human readable name of the chat room.
        +     * 
        + * + * string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The displayName to set. + * @return This builder for chaining. + */ + public Builder setDisplayName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + displayName_ = value; + onChanged(); + return this; + } + + /** + * + * + *
        +     * The human readable name of the chat room.
        +     * 
        + * + * string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearDisplayName() { + + displayName_ = getDefaultInstance().getDisplayName(); + onChanged(); + return this; + } + + /** + * + * + *
        +     * The human readable name of the chat room.
        +     * 
        + * + * string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for displayName to set. + * @return This builder for chaining. + */ + public Builder setDisplayNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + displayName_ = value; + onChanged(); + return this; + } + + private java.lang.Object description_ = ""; + + /** + * + * + *
        +     * The description of the chat room.
        +     * 
        + * + * 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; + } + } + + /** + * + * + *
        +     * The description of the chat room.
        +     * 
        + * + * 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; + } + } + + /** + * + * + *
        +     * The description of the chat room.
        +     * 
        + * + * string description = 3; + * + * @param value The description to set. + * @return This builder for chaining. + */ + public Builder setDescription(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + description_ = value; + onChanged(); + return this; + } + + /** + * + * + *
        +     * The description of the chat room.
        +     * 
        + * + * string description = 3; + * + * @return This builder for chaining. + */ + public Builder clearDescription() { + + description_ = getDefaultInstance().getDescription(); + onChanged(); + return this; + } + + /** + * + * + *
        +     * The description of the chat room.
        +     * 
        + * + * string description = 3; + * + * @param value The bytes for description to set. + * @return This builder for chaining. + */ + public Builder setDescriptionBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + description_ = value; + onChanged(); + return this; + } + + private com.google.protobuf.Timestamp createTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + createTimeBuilder_; + + /** + * + * + *
        +     * The timestamp at which the room was created.
        +     * 
        + * + * + * .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the createTime field is set. + */ + public boolean hasCreateTime() { + return createTimeBuilder_ != null || createTime_ != null; + } + + /** + * + * + *
        +     * The timestamp at which the room was created.
        +     * 
        + * + * + * .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(); + } + } + + /** + * + * + *
        +     * The timestamp at which the room was created.
        +     * 
        + * + * + * .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; + onChanged(); + } else { + createTimeBuilder_.setMessage(value); + } + + return this; + } + + /** + * + * + *
        +     * The timestamp at which the room was created.
        +     * 
        + * + * + * .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(); + onChanged(); + } else { + createTimeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + + /** + * + * + *
        +     * The timestamp at which the room was created.
        +     * 
        + * + * + * .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeCreateTime(com.google.protobuf.Timestamp value) { + if (createTimeBuilder_ == null) { + if (createTime_ != null) { + createTime_ = + com.google.protobuf.Timestamp.newBuilder(createTime_).mergeFrom(value).buildPartial(); + } else { + createTime_ = value; + } + onChanged(); + } else { + createTimeBuilder_.mergeFrom(value); + } + + return this; + } + + /** + * + * + *
        +     * The timestamp at which the room was created.
        +     * 
        + * + * + * .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearCreateTime() { + if (createTimeBuilder_ == null) { + createTime_ = null; + onChanged(); + } else { + createTime_ = null; + createTimeBuilder_ = null; + } + + return this; + } + + /** + * + * + *
        +     * The timestamp at which the room was created.
        +     * 
        + * + * + * .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.Timestamp.Builder getCreateTimeBuilder() { + + onChanged(); + return getCreateTimeFieldBuilder().getBuilder(); + } + + /** + * + * + *
        +     * The timestamp at which the room was created.
        +     * 
        + * + * + * .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_; + } + } + + /** + * + * + *
        +     * The timestamp at which the room was created.
        +     * 
        + * + * + * .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_; + + /** + * + * + *
        +     * The latest timestamp at which the room was updated.
        +     * 
        + * + * + * .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the updateTime field is set. + */ + public boolean hasUpdateTime() { + return updateTimeBuilder_ != null || updateTime_ != null; + } + + /** + * + * + *
        +     * The latest timestamp at which the room was updated.
        +     * 
        + * + * + * .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The updateTime. + */ + public com.google.protobuf.Timestamp getUpdateTime() { + if (updateTimeBuilder_ == null) { + return updateTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : updateTime_; + } else { + return updateTimeBuilder_.getMessage(); + } + } + + /** + * + * + *
        +     * The latest timestamp at which the room was updated.
        +     * 
        + * + * + * .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setUpdateTime(com.google.protobuf.Timestamp value) { + if (updateTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + updateTime_ = value; + onChanged(); + } else { + updateTimeBuilder_.setMessage(value); + } + + return this; + } + + /** + * + * + *
        +     * The latest timestamp at which the room was updated.
        +     * 
        + * + * + * .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setUpdateTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (updateTimeBuilder_ == null) { + updateTime_ = builderForValue.build(); + onChanged(); + } else { + updateTimeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + + /** + * + * + *
        +     * The latest timestamp at which the room was updated.
        +     * 
        + * + * + * .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeUpdateTime(com.google.protobuf.Timestamp value) { + if (updateTimeBuilder_ == null) { + if (updateTime_ != null) { + updateTime_ = + com.google.protobuf.Timestamp.newBuilder(updateTime_).mergeFrom(value).buildPartial(); + } else { + updateTime_ = value; + } + onChanged(); + } else { + updateTimeBuilder_.mergeFrom(value); + } + + return this; + } + + /** + * + * + *
        +     * The latest timestamp at which the room was updated.
        +     * 
        + * + * + * .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearUpdateTime() { + if (updateTimeBuilder_ == null) { + updateTime_ = null; + onChanged(); + } else { + updateTime_ = null; + updateTimeBuilder_ = null; + } + + return this; + } + + /** + * + * + *
        +     * The latest timestamp at which the room was updated.
        +     * 
        + * + * + * .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.Timestamp.Builder getUpdateTimeBuilder() { + + onChanged(); + return getUpdateTimeFieldBuilder().getBuilder(); + } + + /** + * + * + *
        +     * The latest timestamp at which the room was updated.
        +     * 
        + * + * + * .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder() { + if (updateTimeBuilder_ != null) { + return updateTimeBuilder_.getMessageOrBuilder(); + } else { + return updateTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : updateTime_; + } + } + + /** + * + * + *
        +     * The latest timestamp at which the room was updated.
        +     * 
        + * + * + * .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getUpdateTimeFieldBuilder() { + if (updateTimeBuilder_ == null) { + updateTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getUpdateTime(), getParentForChildren(), isClean()); + updateTime_ = null; + } + return updateTimeBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.showcase.v1beta1.Room) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.Room) + private static final com.google.showcase.v1beta1.Room DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.Room(); + } + + public static com.google.showcase.v1beta1.Room getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Room parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Room(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.showcase.v1beta1.Room getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/RoomName.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/RoomName.java new file mode 100644 index 0000000000..a3c3707242 --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/RoomName.java @@ -0,0 +1,166 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1; + +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +@Generated("by gapic-generator-java") +public class RoomName implements ResourceName { + private static final PathTemplate ROOM = PathTemplate.createWithoutUrlEncoding("rooms/{room}"); + private volatile Map fieldValuesMap; + private final String room; + + @Deprecated + protected RoomName() { + room = null; + } + + private RoomName(Builder builder) { + room = Preconditions.checkNotNull(builder.getRoom()); + } + + public String getRoom() { + return room; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + public static RoomName of(String room) { + return newBuilder().setRoom(room).build(); + } + + public static String format(String room) { + return newBuilder().setRoom(room).build().toString(); + } + + public static RoomName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + ROOM.validatedMatch(formattedString, "RoomName.parse: formattedString not in valid format"); + return of(matchMap.get("room")); + } + + 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 (RoomName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return ROOM.matches(formattedString); + } + + @Override + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + if (room != null) { + fieldMapBuilder.put("room", room); + } + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return ROOM.instantiate("room", room); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o != null && getClass() == o.getClass()) { + RoomName that = ((RoomName) o); + return Objects.equals(this.room, that.room); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= Objects.hashCode(room); + return h; + } + + /** Builder for rooms/{room}. */ + public static class Builder { + private String room; + + protected Builder() {} + + public String getRoom() { + return room; + } + + public Builder setRoom(String room) { + this.room = room; + return this; + } + + private Builder(RoomName roomName) { + this.room = roomName.room; + } + + public RoomName build() { + return new RoomName(this); + } + } +} diff --git a/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/RoomOrBuilder.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/RoomOrBuilder.java new file mode 100644 index 0000000000..bd16570831 --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/RoomOrBuilder.java @@ -0,0 +1,183 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/messaging.proto + +package com.google.showcase.v1beta1; + +public interface RoomOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.Room) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
        +   * The resource name of the chat room.
        +   * 
        + * + * string name = 1; + * + * @return The name. + */ + java.lang.String getName(); + + /** + * + * + *
        +   * The resource name of the chat room.
        +   * 
        + * + * string name = 1; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
        +   * The human readable name of the chat room.
        +   * 
        + * + * string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The displayName. + */ + java.lang.String getDisplayName(); + + /** + * + * + *
        +   * The human readable name of the chat room.
        +   * 
        + * + * string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for displayName. + */ + com.google.protobuf.ByteString getDisplayNameBytes(); + + /** + * + * + *
        +   * The description of the chat room.
        +   * 
        + * + * string description = 3; + * + * @return The description. + */ + java.lang.String getDescription(); + + /** + * + * + *
        +   * The description of the chat room.
        +   * 
        + * + * string description = 3; + * + * @return The bytes for description. + */ + com.google.protobuf.ByteString getDescriptionBytes(); + + /** + * + * + *
        +   * The timestamp at which the room was created.
        +   * 
        + * + * .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the createTime field is set. + */ + boolean hasCreateTime(); + + /** + * + * + *
        +   * The timestamp at which the room was created.
        +   * 
        + * + * .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The createTime. + */ + com.google.protobuf.Timestamp getCreateTime(); + + /** + * + * + *
        +   * The timestamp at which the room was created.
        +   * 
        + * + * .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder(); + + /** + * + * + *
        +   * The latest timestamp at which the room was updated.
        +   * 
        + * + * .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the updateTime field is set. + */ + boolean hasUpdateTime(); + + /** + * + * + *
        +   * The latest timestamp at which the room was updated.
        +   * 
        + * + * .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The updateTime. + */ + com.google.protobuf.Timestamp getUpdateTime(); + + /** + * + * + *
        +   * The latest timestamp at which the room was updated.
        +   * 
        + * + * .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder(); +} diff --git a/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/SearchBlurbsMetadata.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/SearchBlurbsMetadata.java new file mode 100644 index 0000000000..b564fe4b9e --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/SearchBlurbsMetadata.java @@ -0,0 +1,740 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/messaging.proto + +package com.google.showcase.v1beta1; + +/** + * + * + *
        + * The operation metadata message for the
        + * google.showcase.v1beta1.Messaging\SearchBlurbs method.
        + * 
        + * + * Protobuf type {@code google.showcase.v1beta1.SearchBlurbsMetadata} + */ +public final class SearchBlurbsMetadata extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.SearchBlurbsMetadata) + SearchBlurbsMetadataOrBuilder { + private static final long serialVersionUID = 0L; + + // Use SearchBlurbsMetadata.newBuilder() to construct. + private SearchBlurbsMetadata(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private SearchBlurbsMetadata() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new SearchBlurbsMetadata(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private SearchBlurbsMetadata( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + com.google.rpc.RetryInfo.Builder subBuilder = null; + if (retryInfo_ != null) { + subBuilder = retryInfo_.toBuilder(); + } + retryInfo_ = input.readMessage(com.google.rpc.RetryInfo.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(retryInfo_); + retryInfo_ = subBuilder.buildPartial(); + } + + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.MessagingOuterClass + .internal_static_google_showcase_v1beta1_SearchBlurbsMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.MessagingOuterClass + .internal_static_google_showcase_v1beta1_SearchBlurbsMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.SearchBlurbsMetadata.class, + com.google.showcase.v1beta1.SearchBlurbsMetadata.Builder.class); + } + + public static final int RETRY_INFO_FIELD_NUMBER = 1; + private com.google.rpc.RetryInfo retryInfo_; + + /** + * + * + *
        +   * This signals to the client when to next poll for response.
        +   * 
        + * + * .google.rpc.RetryInfo retry_info = 1; + * + * @return Whether the retryInfo field is set. + */ + @java.lang.Override + public boolean hasRetryInfo() { + return retryInfo_ != null; + } + + /** + * + * + *
        +   * This signals to the client when to next poll for response.
        +   * 
        + * + * .google.rpc.RetryInfo retry_info = 1; + * + * @return The retryInfo. + */ + @java.lang.Override + public com.google.rpc.RetryInfo getRetryInfo() { + return retryInfo_ == null ? com.google.rpc.RetryInfo.getDefaultInstance() : retryInfo_; + } + + /** + * + * + *
        +   * This signals to the client when to next poll for response.
        +   * 
        + * + * .google.rpc.RetryInfo retry_info = 1; + */ + @java.lang.Override + public com.google.rpc.RetryInfoOrBuilder getRetryInfoOrBuilder() { + return getRetryInfo(); + } + + 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 (retryInfo_ != null) { + output.writeMessage(1, getRetryInfo()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (retryInfo_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getRetryInfo()); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.showcase.v1beta1.SearchBlurbsMetadata)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.SearchBlurbsMetadata other = + (com.google.showcase.v1beta1.SearchBlurbsMetadata) obj; + + if (hasRetryInfo() != other.hasRetryInfo()) return false; + if (hasRetryInfo()) { + if (!getRetryInfo().equals(other.getRetryInfo())) return false; + } + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasRetryInfo()) { + hash = (37 * hash) + RETRY_INFO_FIELD_NUMBER; + hash = (53 * hash) + getRetryInfo().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.showcase.v1beta1.SearchBlurbsMetadata parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.SearchBlurbsMetadata parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.SearchBlurbsMetadata parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.SearchBlurbsMetadata 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.showcase.v1beta1.SearchBlurbsMetadata parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.SearchBlurbsMetadata parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.SearchBlurbsMetadata parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.SearchBlurbsMetadata 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.showcase.v1beta1.SearchBlurbsMetadata parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.SearchBlurbsMetadata 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.showcase.v1beta1.SearchBlurbsMetadata parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.SearchBlurbsMetadata 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.showcase.v1beta1.SearchBlurbsMetadata 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 operation metadata message for the
        +   * google.showcase.v1beta1.Messaging\SearchBlurbs method.
        +   * 
        + * + * Protobuf type {@code google.showcase.v1beta1.SearchBlurbsMetadata} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.SearchBlurbsMetadata) + com.google.showcase.v1beta1.SearchBlurbsMetadataOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.MessagingOuterClass + .internal_static_google_showcase_v1beta1_SearchBlurbsMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.MessagingOuterClass + .internal_static_google_showcase_v1beta1_SearchBlurbsMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.SearchBlurbsMetadata.class, + com.google.showcase.v1beta1.SearchBlurbsMetadata.Builder.class); + } + + // Construct using com.google.showcase.v1beta1.SearchBlurbsMetadata.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (retryInfoBuilder_ == null) { + retryInfo_ = null; + } else { + retryInfo_ = null; + retryInfoBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.showcase.v1beta1.MessagingOuterClass + .internal_static_google_showcase_v1beta1_SearchBlurbsMetadata_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.SearchBlurbsMetadata getDefaultInstanceForType() { + return com.google.showcase.v1beta1.SearchBlurbsMetadata.getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.SearchBlurbsMetadata build() { + com.google.showcase.v1beta1.SearchBlurbsMetadata result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.SearchBlurbsMetadata buildPartial() { + com.google.showcase.v1beta1.SearchBlurbsMetadata result = + new com.google.showcase.v1beta1.SearchBlurbsMetadata(this); + if (retryInfoBuilder_ == null) { + result.retryInfo_ = retryInfo_; + } else { + result.retryInfo_ = retryInfoBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.showcase.v1beta1.SearchBlurbsMetadata) { + return mergeFrom((com.google.showcase.v1beta1.SearchBlurbsMetadata) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.showcase.v1beta1.SearchBlurbsMetadata other) { + if (other == com.google.showcase.v1beta1.SearchBlurbsMetadata.getDefaultInstance()) + return this; + if (other.hasRetryInfo()) { + mergeRetryInfo(other.getRetryInfo()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.showcase.v1beta1.SearchBlurbsMetadata parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.showcase.v1beta1.SearchBlurbsMetadata) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private com.google.rpc.RetryInfo retryInfo_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.rpc.RetryInfo, + com.google.rpc.RetryInfo.Builder, + com.google.rpc.RetryInfoOrBuilder> + retryInfoBuilder_; + + /** + * + * + *
        +     * This signals to the client when to next poll for response.
        +     * 
        + * + * .google.rpc.RetryInfo retry_info = 1; + * + * @return Whether the retryInfo field is set. + */ + public boolean hasRetryInfo() { + return retryInfoBuilder_ != null || retryInfo_ != null; + } + + /** + * + * + *
        +     * This signals to the client when to next poll for response.
        +     * 
        + * + * .google.rpc.RetryInfo retry_info = 1; + * + * @return The retryInfo. + */ + public com.google.rpc.RetryInfo getRetryInfo() { + if (retryInfoBuilder_ == null) { + return retryInfo_ == null ? com.google.rpc.RetryInfo.getDefaultInstance() : retryInfo_; + } else { + return retryInfoBuilder_.getMessage(); + } + } + + /** + * + * + *
        +     * This signals to the client when to next poll for response.
        +     * 
        + * + * .google.rpc.RetryInfo retry_info = 1; + */ + public Builder setRetryInfo(com.google.rpc.RetryInfo value) { + if (retryInfoBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + retryInfo_ = value; + onChanged(); + } else { + retryInfoBuilder_.setMessage(value); + } + + return this; + } + + /** + * + * + *
        +     * This signals to the client when to next poll for response.
        +     * 
        + * + * .google.rpc.RetryInfo retry_info = 1; + */ + public Builder setRetryInfo(com.google.rpc.RetryInfo.Builder builderForValue) { + if (retryInfoBuilder_ == null) { + retryInfo_ = builderForValue.build(); + onChanged(); + } else { + retryInfoBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + + /** + * + * + *
        +     * This signals to the client when to next poll for response.
        +     * 
        + * + * .google.rpc.RetryInfo retry_info = 1; + */ + public Builder mergeRetryInfo(com.google.rpc.RetryInfo value) { + if (retryInfoBuilder_ == null) { + if (retryInfo_ != null) { + retryInfo_ = + com.google.rpc.RetryInfo.newBuilder(retryInfo_).mergeFrom(value).buildPartial(); + } else { + retryInfo_ = value; + } + onChanged(); + } else { + retryInfoBuilder_.mergeFrom(value); + } + + return this; + } + + /** + * + * + *
        +     * This signals to the client when to next poll for response.
        +     * 
        + * + * .google.rpc.RetryInfo retry_info = 1; + */ + public Builder clearRetryInfo() { + if (retryInfoBuilder_ == null) { + retryInfo_ = null; + onChanged(); + } else { + retryInfo_ = null; + retryInfoBuilder_ = null; + } + + return this; + } + + /** + * + * + *
        +     * This signals to the client when to next poll for response.
        +     * 
        + * + * .google.rpc.RetryInfo retry_info = 1; + */ + public com.google.rpc.RetryInfo.Builder getRetryInfoBuilder() { + + onChanged(); + return getRetryInfoFieldBuilder().getBuilder(); + } + + /** + * + * + *
        +     * This signals to the client when to next poll for response.
        +     * 
        + * + * .google.rpc.RetryInfo retry_info = 1; + */ + public com.google.rpc.RetryInfoOrBuilder getRetryInfoOrBuilder() { + if (retryInfoBuilder_ != null) { + return retryInfoBuilder_.getMessageOrBuilder(); + } else { + return retryInfo_ == null ? com.google.rpc.RetryInfo.getDefaultInstance() : retryInfo_; + } + } + + /** + * + * + *
        +     * This signals to the client when to next poll for response.
        +     * 
        + * + * .google.rpc.RetryInfo retry_info = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.rpc.RetryInfo, + com.google.rpc.RetryInfo.Builder, + com.google.rpc.RetryInfoOrBuilder> + getRetryInfoFieldBuilder() { + if (retryInfoBuilder_ == null) { + retryInfoBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.rpc.RetryInfo, + com.google.rpc.RetryInfo.Builder, + com.google.rpc.RetryInfoOrBuilder>( + getRetryInfo(), getParentForChildren(), isClean()); + retryInfo_ = null; + } + return retryInfoBuilder_; + } + + @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.showcase.v1beta1.SearchBlurbsMetadata) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.SearchBlurbsMetadata) + private static final com.google.showcase.v1beta1.SearchBlurbsMetadata DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.SearchBlurbsMetadata(); + } + + public static com.google.showcase.v1beta1.SearchBlurbsMetadata getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SearchBlurbsMetadata parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new SearchBlurbsMetadata(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.showcase.v1beta1.SearchBlurbsMetadata getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/SearchBlurbsMetadataOrBuilder.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/SearchBlurbsMetadataOrBuilder.java new file mode 100644 index 0000000000..bb168ffb4f --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/SearchBlurbsMetadataOrBuilder.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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/messaging.proto + +package com.google.showcase.v1beta1; + +public interface SearchBlurbsMetadataOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.SearchBlurbsMetadata) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
        +   * This signals to the client when to next poll for response.
        +   * 
        + * + * .google.rpc.RetryInfo retry_info = 1; + * + * @return Whether the retryInfo field is set. + */ + boolean hasRetryInfo(); + + /** + * + * + *
        +   * This signals to the client when to next poll for response.
        +   * 
        + * + * .google.rpc.RetryInfo retry_info = 1; + * + * @return The retryInfo. + */ + com.google.rpc.RetryInfo getRetryInfo(); + + /** + * + * + *
        +   * This signals to the client when to next poll for response.
        +   * 
        + * + * .google.rpc.RetryInfo retry_info = 1; + */ + com.google.rpc.RetryInfoOrBuilder getRetryInfoOrBuilder(); +} diff --git a/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/SearchBlurbsRequest.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/SearchBlurbsRequest.java new file mode 100644 index 0000000000..84459a3872 --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/SearchBlurbsRequest.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: schema/google/showcase/v1beta1/messaging.proto + +package com.google.showcase.v1beta1; + +/** + * + * + *
        + * The request message for the google.showcase.v1beta1.Messaging\SearchBlurbs
        + * method.
        + * 
        + * + * Protobuf type {@code google.showcase.v1beta1.SearchBlurbsRequest} + */ +public final class SearchBlurbsRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.SearchBlurbsRequest) + SearchBlurbsRequestOrBuilder { + private static final long serialVersionUID = 0L; + + // Use SearchBlurbsRequest.newBuilder() to construct. + private SearchBlurbsRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private SearchBlurbsRequest() { + query_ = ""; + parent_ = ""; + pageToken_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new SearchBlurbsRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private SearchBlurbsRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + query_ = s; + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + parent_ = s; + break; + } + case 24: + { + pageSize_ = input.readInt32(); + break; + } + case 34: + { + java.lang.String s = input.readStringRequireUtf8(); + + pageToken_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.MessagingOuterClass + .internal_static_google_showcase_v1beta1_SearchBlurbsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.MessagingOuterClass + .internal_static_google_showcase_v1beta1_SearchBlurbsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.SearchBlurbsRequest.class, + com.google.showcase.v1beta1.SearchBlurbsRequest.Builder.class); + } + + public static final int QUERY_FIELD_NUMBER = 1; + private volatile java.lang.Object query_; + + /** + * + * + *
        +   * The query used to search for blurbs containing to words of this string.
        +   * Only posts that contain an exact match of a queried word will be returned.
        +   * 
        + * + * string query = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The query. + */ + @java.lang.Override + public java.lang.String getQuery() { + java.lang.Object ref = query_; + 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(); + query_ = s; + return s; + } + } + + /** + * + * + *
        +   * The query used to search for blurbs containing to words of this string.
        +   * Only posts that contain an exact match of a queried word will be returned.
        +   * 
        + * + * string query = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for query. + */ + @java.lang.Override + public com.google.protobuf.ByteString getQueryBytes() { + java.lang.Object ref = query_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + query_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PARENT_FIELD_NUMBER = 2; + private volatile java.lang.Object parent_; + + /** + * + * + *
        +   * The rooms or profiles to search. If unset, `SearchBlurbs` will search all
        +   * rooms and all profiles.
        +   * 
        + * + * string parent = 2 [(.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; + } + } + + /** + * + * + *
        +   * The rooms or profiles to search. If unset, `SearchBlurbs` will search all
        +   * rooms and all profiles.
        +   * 
        + * + * string parent = 2 [(.google.api.resource_reference) = { ... } + * + * @return The bytes for parent. + */ + @java.lang.Override + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PAGE_SIZE_FIELD_NUMBER = 3; + private int pageSize_; + + /** + * + * + *
        +   * The maximum number of blurbs return. Server may return fewer
        +   * blurbs than requested. If unspecified, server will pick an appropriate
        +   * default.
        +   * 
        + * + * int32 page_size = 3; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + + public static final int PAGE_TOKEN_FIELD_NUMBER = 4; + private volatile java.lang.Object pageToken_; + + /** + * + * + *
        +   * The value of
        +   * google.showcase.v1beta1.SearchBlurbsResponse.next_page_token
        +   * returned from the previous call to
        +   * `google.showcase.v1beta1.Messaging\SearchBlurbs` method.
        +   * 
        + * + * string page_token = 4; + * + * @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; + } + } + + /** + * + * + *
        +   * The value of
        +   * google.showcase.v1beta1.SearchBlurbsResponse.next_page_token
        +   * returned from the previous call to
        +   * `google.showcase.v1beta1.Messaging\SearchBlurbs` method.
        +   * 
        + * + * string page_token = 4; + * + * @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(query_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, query_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, parent_); + } + if (pageSize_ != 0) { + output.writeInt32(3, pageSize_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(pageToken_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, pageToken_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(query_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, query_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, parent_); + } + if (pageSize_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(3, pageSize_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(pageToken_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, pageToken_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.showcase.v1beta1.SearchBlurbsRequest)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.SearchBlurbsRequest other = + (com.google.showcase.v1beta1.SearchBlurbsRequest) obj; + + if (!getQuery().equals(other.getQuery())) return false; + if (!getParent().equals(other.getParent())) return false; + if (getPageSize() != other.getPageSize()) return false; + if (!getPageToken().equals(other.getPageToken())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + QUERY_FIELD_NUMBER; + hash = (53 * hash) + getQuery().hashCode(); + hash = (37 * hash) + PARENT_FIELD_NUMBER; + hash = (53 * hash) + getParent().hashCode(); + hash = (37 * hash) + PAGE_SIZE_FIELD_NUMBER; + hash = (53 * hash) + getPageSize(); + hash = (37 * hash) + PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getPageToken().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.showcase.v1beta1.SearchBlurbsRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.SearchBlurbsRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.SearchBlurbsRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.SearchBlurbsRequest 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.showcase.v1beta1.SearchBlurbsRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.SearchBlurbsRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.SearchBlurbsRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.SearchBlurbsRequest 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.showcase.v1beta1.SearchBlurbsRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.SearchBlurbsRequest 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.showcase.v1beta1.SearchBlurbsRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.SearchBlurbsRequest 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.showcase.v1beta1.SearchBlurbsRequest 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 request message for the google.showcase.v1beta1.Messaging\SearchBlurbs
        +   * method.
        +   * 
        + * + * Protobuf type {@code google.showcase.v1beta1.SearchBlurbsRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.SearchBlurbsRequest) + com.google.showcase.v1beta1.SearchBlurbsRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.MessagingOuterClass + .internal_static_google_showcase_v1beta1_SearchBlurbsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.MessagingOuterClass + .internal_static_google_showcase_v1beta1_SearchBlurbsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.SearchBlurbsRequest.class, + com.google.showcase.v1beta1.SearchBlurbsRequest.Builder.class); + } + + // Construct using com.google.showcase.v1beta1.SearchBlurbsRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + query_ = ""; + + parent_ = ""; + + pageSize_ = 0; + + pageToken_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.showcase.v1beta1.MessagingOuterClass + .internal_static_google_showcase_v1beta1_SearchBlurbsRequest_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.SearchBlurbsRequest getDefaultInstanceForType() { + return com.google.showcase.v1beta1.SearchBlurbsRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.SearchBlurbsRequest build() { + com.google.showcase.v1beta1.SearchBlurbsRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.SearchBlurbsRequest buildPartial() { + com.google.showcase.v1beta1.SearchBlurbsRequest result = + new com.google.showcase.v1beta1.SearchBlurbsRequest(this); + result.query_ = query_; + result.parent_ = parent_; + result.pageSize_ = pageSize_; + result.pageToken_ = pageToken_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.showcase.v1beta1.SearchBlurbsRequest) { + return mergeFrom((com.google.showcase.v1beta1.SearchBlurbsRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.showcase.v1beta1.SearchBlurbsRequest other) { + if (other == com.google.showcase.v1beta1.SearchBlurbsRequest.getDefaultInstance()) + return this; + if (!other.getQuery().isEmpty()) { + query_ = other.query_; + onChanged(); + } + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + onChanged(); + } + if (other.getPageSize() != 0) { + setPageSize(other.getPageSize()); + } + if (!other.getPageToken().isEmpty()) { + pageToken_ = other.pageToken_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.showcase.v1beta1.SearchBlurbsRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.showcase.v1beta1.SearchBlurbsRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object query_ = ""; + + /** + * + * + *
        +     * The query used to search for blurbs containing to words of this string.
        +     * Only posts that contain an exact match of a queried word will be returned.
        +     * 
        + * + * string query = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The query. + */ + public java.lang.String getQuery() { + java.lang.Object ref = query_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + query_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
        +     * The query used to search for blurbs containing to words of this string.
        +     * Only posts that contain an exact match of a queried word will be returned.
        +     * 
        + * + * string query = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for query. + */ + public com.google.protobuf.ByteString getQueryBytes() { + java.lang.Object ref = query_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + query_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
        +     * The query used to search for blurbs containing to words of this string.
        +     * Only posts that contain an exact match of a queried word will be returned.
        +     * 
        + * + * string query = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The query to set. + * @return This builder for chaining. + */ + public Builder setQuery(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + query_ = value; + onChanged(); + return this; + } + + /** + * + * + *
        +     * The query used to search for blurbs containing to words of this string.
        +     * Only posts that contain an exact match of a queried word will be returned.
        +     * 
        + * + * string query = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearQuery() { + + query_ = getDefaultInstance().getQuery(); + onChanged(); + return this; + } + + /** + * + * + *
        +     * The query used to search for blurbs containing to words of this string.
        +     * Only posts that contain an exact match of a queried word will be returned.
        +     * 
        + * + * string query = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for query to set. + * @return This builder for chaining. + */ + public Builder setQueryBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + query_ = value; + onChanged(); + return this; + } + + private java.lang.Object parent_ = ""; + + /** + * + * + *
        +     * The rooms or profiles to search. If unset, `SearchBlurbs` will search all
        +     * rooms and all profiles.
        +     * 
        + * + * string parent = 2 [(.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; + } + } + + /** + * + * + *
        +     * The rooms or profiles to search. If unset, `SearchBlurbs` will search all
        +     * rooms and all profiles.
        +     * 
        + * + * string parent = 2 [(.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; + } + } + + /** + * + * + *
        +     * The rooms or profiles to search. If unset, `SearchBlurbs` will search all
        +     * rooms and all profiles.
        +     * 
        + * + * string parent = 2 [(.google.api.resource_reference) = { ... } + * + * @param value The parent to set. + * @return This builder for chaining. + */ + public Builder setParent(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + parent_ = value; + onChanged(); + return this; + } + + /** + * + * + *
        +     * The rooms or profiles to search. If unset, `SearchBlurbs` will search all
        +     * rooms and all profiles.
        +     * 
        + * + * string parent = 2 [(.google.api.resource_reference) = { ... } + * + * @return This builder for chaining. + */ + public Builder clearParent() { + + parent_ = getDefaultInstance().getParent(); + onChanged(); + return this; + } + + /** + * + * + *
        +     * The rooms or profiles to search. If unset, `SearchBlurbs` will search all
        +     * rooms and all profiles.
        +     * 
        + * + * string parent = 2 [(.google.api.resource_reference) = { ... } + * + * @param value The bytes for parent to set. + * @return This builder for chaining. + */ + public Builder setParentBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + parent_ = value; + onChanged(); + return this; + } + + private int pageSize_; + + /** + * + * + *
        +     * The maximum number of blurbs return. Server may return fewer
        +     * blurbs than requested. If unspecified, server will pick an appropriate
        +     * default.
        +     * 
        + * + * int32 page_size = 3; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + + /** + * + * + *
        +     * The maximum number of blurbs return. Server may return fewer
        +     * blurbs than requested. If unspecified, server will pick an appropriate
        +     * default.
        +     * 
        + * + * int32 page_size = 3; + * + * @param value The pageSize to set. + * @return This builder for chaining. + */ + public Builder setPageSize(int value) { + + pageSize_ = value; + onChanged(); + return this; + } + + /** + * + * + *
        +     * The maximum number of blurbs return. Server may return fewer
        +     * blurbs than requested. If unspecified, server will pick an appropriate
        +     * default.
        +     * 
        + * + * int32 page_size = 3; + * + * @return This builder for chaining. + */ + public Builder clearPageSize() { + + pageSize_ = 0; + onChanged(); + return this; + } + + private java.lang.Object pageToken_ = ""; + + /** + * + * + *
        +     * The value of
        +     * google.showcase.v1beta1.SearchBlurbsResponse.next_page_token
        +     * returned from the previous call to
        +     * `google.showcase.v1beta1.Messaging\SearchBlurbs` method.
        +     * 
        + * + * string page_token = 4; + * + * @return The pageToken. + */ + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
        +     * The value of
        +     * google.showcase.v1beta1.SearchBlurbsResponse.next_page_token
        +     * returned from the previous call to
        +     * `google.showcase.v1beta1.Messaging\SearchBlurbs` method.
        +     * 
        + * + * string page_token = 4; + * + * @return The bytes for pageToken. + */ + public com.google.protobuf.ByteString getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
        +     * The value of
        +     * google.showcase.v1beta1.SearchBlurbsResponse.next_page_token
        +     * returned from the previous call to
        +     * `google.showcase.v1beta1.Messaging\SearchBlurbs` method.
        +     * 
        + * + * string page_token = 4; + * + * @param value The pageToken to set. + * @return This builder for chaining. + */ + public Builder setPageToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + pageToken_ = value; + onChanged(); + return this; + } + + /** + * + * + *
        +     * The value of
        +     * google.showcase.v1beta1.SearchBlurbsResponse.next_page_token
        +     * returned from the previous call to
        +     * `google.showcase.v1beta1.Messaging\SearchBlurbs` method.
        +     * 
        + * + * string page_token = 4; + * + * @return This builder for chaining. + */ + public Builder clearPageToken() { + + pageToken_ = getDefaultInstance().getPageToken(); + onChanged(); + return this; + } + + /** + * + * + *
        +     * The value of
        +     * google.showcase.v1beta1.SearchBlurbsResponse.next_page_token
        +     * returned from the previous call to
        +     * `google.showcase.v1beta1.Messaging\SearchBlurbs` method.
        +     * 
        + * + * string page_token = 4; + * + * @param value The bytes for pageToken to set. + * @return This builder for chaining. + */ + public Builder setPageTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + pageToken_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.showcase.v1beta1.SearchBlurbsRequest) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.SearchBlurbsRequest) + private static final com.google.showcase.v1beta1.SearchBlurbsRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.SearchBlurbsRequest(); + } + + public static com.google.showcase.v1beta1.SearchBlurbsRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SearchBlurbsRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new SearchBlurbsRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.showcase.v1beta1.SearchBlurbsRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/SearchBlurbsRequestOrBuilder.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/SearchBlurbsRequestOrBuilder.java new file mode 100644 index 0000000000..c55a0f9e4a --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/SearchBlurbsRequestOrBuilder.java @@ -0,0 +1,128 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/messaging.proto + +package com.google.showcase.v1beta1; + +public interface SearchBlurbsRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.SearchBlurbsRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
        +   * The query used to search for blurbs containing to words of this string.
        +   * Only posts that contain an exact match of a queried word will be returned.
        +   * 
        + * + * string query = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The query. + */ + java.lang.String getQuery(); + + /** + * + * + *
        +   * The query used to search for blurbs containing to words of this string.
        +   * Only posts that contain an exact match of a queried word will be returned.
        +   * 
        + * + * string query = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for query. + */ + com.google.protobuf.ByteString getQueryBytes(); + + /** + * + * + *
        +   * The rooms or profiles to search. If unset, `SearchBlurbs` will search all
        +   * rooms and all profiles.
        +   * 
        + * + * string parent = 2 [(.google.api.resource_reference) = { ... } + * + * @return The parent. + */ + java.lang.String getParent(); + + /** + * + * + *
        +   * The rooms or profiles to search. If unset, `SearchBlurbs` will search all
        +   * rooms and all profiles.
        +   * 
        + * + * string parent = 2 [(.google.api.resource_reference) = { ... } + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
        +   * The maximum number of blurbs return. Server may return fewer
        +   * blurbs than requested. If unspecified, server will pick an appropriate
        +   * default.
        +   * 
        + * + * int32 page_size = 3; + * + * @return The pageSize. + */ + int getPageSize(); + + /** + * + * + *
        +   * The value of
        +   * google.showcase.v1beta1.SearchBlurbsResponse.next_page_token
        +   * returned from the previous call to
        +   * `google.showcase.v1beta1.Messaging\SearchBlurbs` method.
        +   * 
        + * + * string page_token = 4; + * + * @return The pageToken. + */ + java.lang.String getPageToken(); + + /** + * + * + *
        +   * The value of
        +   * google.showcase.v1beta1.SearchBlurbsResponse.next_page_token
        +   * returned from the previous call to
        +   * `google.showcase.v1beta1.Messaging\SearchBlurbs` method.
        +   * 
        + * + * string page_token = 4; + * + * @return The bytes for pageToken. + */ + com.google.protobuf.ByteString getPageTokenBytes(); +} diff --git a/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/SearchBlurbsResponse.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/SearchBlurbsResponse.java new file mode 100644 index 0000000000..1150887389 --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/SearchBlurbsResponse.java @@ -0,0 +1,1179 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/messaging.proto + +package com.google.showcase.v1beta1; + +/** + * + * + *
        + * The operation response message for the
        + * google.showcase.v1beta1.Messaging\SearchBlurbs method.
        + * 
        + * + * Protobuf type {@code google.showcase.v1beta1.SearchBlurbsResponse} + */ +public final class SearchBlurbsResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.SearchBlurbsResponse) + SearchBlurbsResponseOrBuilder { + private static final long serialVersionUID = 0L; + + // Use SearchBlurbsResponse.newBuilder() to construct. + private SearchBlurbsResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private SearchBlurbsResponse() { + blurbs_ = java.util.Collections.emptyList(); + nextPageToken_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new SearchBlurbsResponse(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private SearchBlurbsResponse( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + blurbs_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + blurbs_.add( + input.readMessage(com.google.showcase.v1beta1.Blurb.parser(), extensionRegistry)); + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + nextPageToken_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + blurbs_ = java.util.Collections.unmodifiableList(blurbs_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.MessagingOuterClass + .internal_static_google_showcase_v1beta1_SearchBlurbsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.MessagingOuterClass + .internal_static_google_showcase_v1beta1_SearchBlurbsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.SearchBlurbsResponse.class, + com.google.showcase.v1beta1.SearchBlurbsResponse.Builder.class); + } + + public static final int BLURBS_FIELD_NUMBER = 1; + private java.util.List blurbs_; + + /** + * + * + *
        +   * Blurbs that matched the search query.
        +   * 
        + * + * repeated .google.showcase.v1beta1.Blurb blurbs = 1; + */ + @java.lang.Override + public java.util.List getBlurbsList() { + return blurbs_; + } + + /** + * + * + *
        +   * Blurbs that matched the search query.
        +   * 
        + * + * repeated .google.showcase.v1beta1.Blurb blurbs = 1; + */ + @java.lang.Override + public java.util.List + getBlurbsOrBuilderList() { + return blurbs_; + } + + /** + * + * + *
        +   * Blurbs that matched the search query.
        +   * 
        + * + * repeated .google.showcase.v1beta1.Blurb blurbs = 1; + */ + @java.lang.Override + public int getBlurbsCount() { + return blurbs_.size(); + } + + /** + * + * + *
        +   * Blurbs that matched the search query.
        +   * 
        + * + * repeated .google.showcase.v1beta1.Blurb blurbs = 1; + */ + @java.lang.Override + public com.google.showcase.v1beta1.Blurb getBlurbs(int index) { + return blurbs_.get(index); + } + + /** + * + * + *
        +   * Blurbs that matched the search query.
        +   * 
        + * + * repeated .google.showcase.v1beta1.Blurb blurbs = 1; + */ + @java.lang.Override + public com.google.showcase.v1beta1.BlurbOrBuilder getBlurbsOrBuilder(int index) { + return blurbs_.get(index); + } + + public static final int NEXT_PAGE_TOKEN_FIELD_NUMBER = 2; + private volatile java.lang.Object nextPageToken_; + + /** + * + * + *
        +   * A token to retrieve next page of results.
        +   * Pass this value in SearchBlurbsRequest.page_token field in the subsequent
        +   * call to `google.showcase.v1beta1.Blurb\SearchBlurbs` method to
        +   * retrieve the next page of results.
        +   * 
        + * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + @java.lang.Override + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nextPageToken_ = s; + return s; + } + } + + /** + * + * + *
        +   * A token to retrieve next page of results.
        +   * Pass this value in SearchBlurbsRequest.page_token field in the subsequent
        +   * call to `google.showcase.v1beta1.Blurb\SearchBlurbs` method to
        +   * retrieve the next page of results.
        +   * 
        + * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + nextPageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + for (int i = 0; i < blurbs_.size(); i++) { + output.writeMessage(1, blurbs_.get(i)); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nextPageToken_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, nextPageToken_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < blurbs_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, blurbs_.get(i)); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nextPageToken_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, nextPageToken_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.showcase.v1beta1.SearchBlurbsResponse)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.SearchBlurbsResponse other = + (com.google.showcase.v1beta1.SearchBlurbsResponse) obj; + + if (!getBlurbsList().equals(other.getBlurbsList())) return false; + if (!getNextPageToken().equals(other.getNextPageToken())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getBlurbsCount() > 0) { + hash = (37 * hash) + BLURBS_FIELD_NUMBER; + hash = (53 * hash) + getBlurbsList().hashCode(); + } + hash = (37 * hash) + NEXT_PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getNextPageToken().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.showcase.v1beta1.SearchBlurbsResponse parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.SearchBlurbsResponse parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.SearchBlurbsResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.SearchBlurbsResponse 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.showcase.v1beta1.SearchBlurbsResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.SearchBlurbsResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.SearchBlurbsResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.SearchBlurbsResponse 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.showcase.v1beta1.SearchBlurbsResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.SearchBlurbsResponse 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.showcase.v1beta1.SearchBlurbsResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.SearchBlurbsResponse 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.showcase.v1beta1.SearchBlurbsResponse 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 operation response message for the
        +   * google.showcase.v1beta1.Messaging\SearchBlurbs method.
        +   * 
        + * + * Protobuf type {@code google.showcase.v1beta1.SearchBlurbsResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.SearchBlurbsResponse) + com.google.showcase.v1beta1.SearchBlurbsResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.MessagingOuterClass + .internal_static_google_showcase_v1beta1_SearchBlurbsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.MessagingOuterClass + .internal_static_google_showcase_v1beta1_SearchBlurbsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.SearchBlurbsResponse.class, + com.google.showcase.v1beta1.SearchBlurbsResponse.Builder.class); + } + + // Construct using com.google.showcase.v1beta1.SearchBlurbsResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getBlurbsFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (blurbsBuilder_ == null) { + blurbs_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + blurbsBuilder_.clear(); + } + nextPageToken_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.showcase.v1beta1.MessagingOuterClass + .internal_static_google_showcase_v1beta1_SearchBlurbsResponse_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.SearchBlurbsResponse getDefaultInstanceForType() { + return com.google.showcase.v1beta1.SearchBlurbsResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.SearchBlurbsResponse build() { + com.google.showcase.v1beta1.SearchBlurbsResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.SearchBlurbsResponse buildPartial() { + com.google.showcase.v1beta1.SearchBlurbsResponse result = + new com.google.showcase.v1beta1.SearchBlurbsResponse(this); + int from_bitField0_ = bitField0_; + if (blurbsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + blurbs_ = java.util.Collections.unmodifiableList(blurbs_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.blurbs_ = blurbs_; + } else { + result.blurbs_ = blurbsBuilder_.build(); + } + result.nextPageToken_ = nextPageToken_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.showcase.v1beta1.SearchBlurbsResponse) { + return mergeFrom((com.google.showcase.v1beta1.SearchBlurbsResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.showcase.v1beta1.SearchBlurbsResponse other) { + if (other == com.google.showcase.v1beta1.SearchBlurbsResponse.getDefaultInstance()) + return this; + if (blurbsBuilder_ == null) { + if (!other.blurbs_.isEmpty()) { + if (blurbs_.isEmpty()) { + blurbs_ = other.blurbs_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureBlurbsIsMutable(); + blurbs_.addAll(other.blurbs_); + } + onChanged(); + } + } else { + if (!other.blurbs_.isEmpty()) { + if (blurbsBuilder_.isEmpty()) { + blurbsBuilder_.dispose(); + blurbsBuilder_ = null; + blurbs_ = other.blurbs_; + bitField0_ = (bitField0_ & ~0x00000001); + blurbsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getBlurbsFieldBuilder() + : null; + } else { + blurbsBuilder_.addAllMessages(other.blurbs_); + } + } + } + if (!other.getNextPageToken().isEmpty()) { + nextPageToken_ = other.nextPageToken_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.showcase.v1beta1.SearchBlurbsResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.showcase.v1beta1.SearchBlurbsResponse) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.util.List blurbs_ = + java.util.Collections.emptyList(); + + private void ensureBlurbsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + blurbs_ = new java.util.ArrayList(blurbs_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.showcase.v1beta1.Blurb, + com.google.showcase.v1beta1.Blurb.Builder, + com.google.showcase.v1beta1.BlurbOrBuilder> + blurbsBuilder_; + + /** + * + * + *
        +     * Blurbs that matched the search query.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Blurb blurbs = 1; + */ + public java.util.List getBlurbsList() { + if (blurbsBuilder_ == null) { + return java.util.Collections.unmodifiableList(blurbs_); + } else { + return blurbsBuilder_.getMessageList(); + } + } + + /** + * + * + *
        +     * Blurbs that matched the search query.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Blurb blurbs = 1; + */ + public int getBlurbsCount() { + if (blurbsBuilder_ == null) { + return blurbs_.size(); + } else { + return blurbsBuilder_.getCount(); + } + } + + /** + * + * + *
        +     * Blurbs that matched the search query.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Blurb blurbs = 1; + */ + public com.google.showcase.v1beta1.Blurb getBlurbs(int index) { + if (blurbsBuilder_ == null) { + return blurbs_.get(index); + } else { + return blurbsBuilder_.getMessage(index); + } + } + + /** + * + * + *
        +     * Blurbs that matched the search query.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Blurb blurbs = 1; + */ + public Builder setBlurbs(int index, com.google.showcase.v1beta1.Blurb value) { + if (blurbsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureBlurbsIsMutable(); + blurbs_.set(index, value); + onChanged(); + } else { + blurbsBuilder_.setMessage(index, value); + } + return this; + } + + /** + * + * + *
        +     * Blurbs that matched the search query.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Blurb blurbs = 1; + */ + public Builder setBlurbs(int index, com.google.showcase.v1beta1.Blurb.Builder builderForValue) { + if (blurbsBuilder_ == null) { + ensureBlurbsIsMutable(); + blurbs_.set(index, builderForValue.build()); + onChanged(); + } else { + blurbsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
        +     * Blurbs that matched the search query.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Blurb blurbs = 1; + */ + public Builder addBlurbs(com.google.showcase.v1beta1.Blurb value) { + if (blurbsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureBlurbsIsMutable(); + blurbs_.add(value); + onChanged(); + } else { + blurbsBuilder_.addMessage(value); + } + return this; + } + + /** + * + * + *
        +     * Blurbs that matched the search query.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Blurb blurbs = 1; + */ + public Builder addBlurbs(int index, com.google.showcase.v1beta1.Blurb value) { + if (blurbsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureBlurbsIsMutable(); + blurbs_.add(index, value); + onChanged(); + } else { + blurbsBuilder_.addMessage(index, value); + } + return this; + } + + /** + * + * + *
        +     * Blurbs that matched the search query.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Blurb blurbs = 1; + */ + public Builder addBlurbs(com.google.showcase.v1beta1.Blurb.Builder builderForValue) { + if (blurbsBuilder_ == null) { + ensureBlurbsIsMutable(); + blurbs_.add(builderForValue.build()); + onChanged(); + } else { + blurbsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + + /** + * + * + *
        +     * Blurbs that matched the search query.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Blurb blurbs = 1; + */ + public Builder addBlurbs(int index, com.google.showcase.v1beta1.Blurb.Builder builderForValue) { + if (blurbsBuilder_ == null) { + ensureBlurbsIsMutable(); + blurbs_.add(index, builderForValue.build()); + onChanged(); + } else { + blurbsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
        +     * Blurbs that matched the search query.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Blurb blurbs = 1; + */ + public Builder addAllBlurbs( + java.lang.Iterable values) { + if (blurbsBuilder_ == null) { + ensureBlurbsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, blurbs_); + onChanged(); + } else { + blurbsBuilder_.addAllMessages(values); + } + return this; + } + + /** + * + * + *
        +     * Blurbs that matched the search query.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Blurb blurbs = 1; + */ + public Builder clearBlurbs() { + if (blurbsBuilder_ == null) { + blurbs_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + blurbsBuilder_.clear(); + } + return this; + } + + /** + * + * + *
        +     * Blurbs that matched the search query.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Blurb blurbs = 1; + */ + public Builder removeBlurbs(int index) { + if (blurbsBuilder_ == null) { + ensureBlurbsIsMutable(); + blurbs_.remove(index); + onChanged(); + } else { + blurbsBuilder_.remove(index); + } + return this; + } + + /** + * + * + *
        +     * Blurbs that matched the search query.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Blurb blurbs = 1; + */ + public com.google.showcase.v1beta1.Blurb.Builder getBlurbsBuilder(int index) { + return getBlurbsFieldBuilder().getBuilder(index); + } + + /** + * + * + *
        +     * Blurbs that matched the search query.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Blurb blurbs = 1; + */ + public com.google.showcase.v1beta1.BlurbOrBuilder getBlurbsOrBuilder(int index) { + if (blurbsBuilder_ == null) { + return blurbs_.get(index); + } else { + return blurbsBuilder_.getMessageOrBuilder(index); + } + } + + /** + * + * + *
        +     * Blurbs that matched the search query.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Blurb blurbs = 1; + */ + public java.util.List + getBlurbsOrBuilderList() { + if (blurbsBuilder_ != null) { + return blurbsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(blurbs_); + } + } + + /** + * + * + *
        +     * Blurbs that matched the search query.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Blurb blurbs = 1; + */ + public com.google.showcase.v1beta1.Blurb.Builder addBlurbsBuilder() { + return getBlurbsFieldBuilder() + .addBuilder(com.google.showcase.v1beta1.Blurb.getDefaultInstance()); + } + + /** + * + * + *
        +     * Blurbs that matched the search query.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Blurb blurbs = 1; + */ + public com.google.showcase.v1beta1.Blurb.Builder addBlurbsBuilder(int index) { + return getBlurbsFieldBuilder() + .addBuilder(index, com.google.showcase.v1beta1.Blurb.getDefaultInstance()); + } + + /** + * + * + *
        +     * Blurbs that matched the search query.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Blurb blurbs = 1; + */ + public java.util.List getBlurbsBuilderList() { + return getBlurbsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.showcase.v1beta1.Blurb, + com.google.showcase.v1beta1.Blurb.Builder, + com.google.showcase.v1beta1.BlurbOrBuilder> + getBlurbsFieldBuilder() { + if (blurbsBuilder_ == null) { + blurbsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.showcase.v1beta1.Blurb, + com.google.showcase.v1beta1.Blurb.Builder, + com.google.showcase.v1beta1.BlurbOrBuilder>( + blurbs_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + blurbs_ = null; + } + return blurbsBuilder_; + } + + private java.lang.Object nextPageToken_ = ""; + + /** + * + * + *
        +     * A token to retrieve next page of results.
        +     * Pass this value in SearchBlurbsRequest.page_token field in the subsequent
        +     * call to `google.showcase.v1beta1.Blurb\SearchBlurbs` method to
        +     * retrieve the next page of results.
        +     * 
        + * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nextPageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
        +     * A token to retrieve next page of results.
        +     * Pass this value in SearchBlurbsRequest.page_token field in the subsequent
        +     * call to `google.showcase.v1beta1.Blurb\SearchBlurbs` method to
        +     * retrieve the next page of results.
        +     * 
        + * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + public com.google.protobuf.ByteString getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + nextPageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
        +     * A token to retrieve next page of results.
        +     * Pass this value in SearchBlurbsRequest.page_token field in the subsequent
        +     * call to `google.showcase.v1beta1.Blurb\SearchBlurbs` method to
        +     * retrieve the next page of results.
        +     * 
        + * + * string next_page_token = 2; + * + * @param value The nextPageToken to set. + * @return This builder for chaining. + */ + public Builder setNextPageToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + nextPageToken_ = value; + onChanged(); + return this; + } + + /** + * + * + *
        +     * A token to retrieve next page of results.
        +     * Pass this value in SearchBlurbsRequest.page_token field in the subsequent
        +     * call to `google.showcase.v1beta1.Blurb\SearchBlurbs` method to
        +     * retrieve the next page of results.
        +     * 
        + * + * string next_page_token = 2; + * + * @return This builder for chaining. + */ + public Builder clearNextPageToken() { + + nextPageToken_ = getDefaultInstance().getNextPageToken(); + onChanged(); + return this; + } + + /** + * + * + *
        +     * A token to retrieve next page of results.
        +     * Pass this value in SearchBlurbsRequest.page_token field in the subsequent
        +     * call to `google.showcase.v1beta1.Blurb\SearchBlurbs` method to
        +     * retrieve the next page of results.
        +     * 
        + * + * string next_page_token = 2; + * + * @param value The bytes for nextPageToken to set. + * @return This builder for chaining. + */ + public Builder setNextPageTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + nextPageToken_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.showcase.v1beta1.SearchBlurbsResponse) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.SearchBlurbsResponse) + private static final com.google.showcase.v1beta1.SearchBlurbsResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.SearchBlurbsResponse(); + } + + public static com.google.showcase.v1beta1.SearchBlurbsResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SearchBlurbsResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new SearchBlurbsResponse(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.showcase.v1beta1.SearchBlurbsResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/SearchBlurbsResponseOrBuilder.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/SearchBlurbsResponseOrBuilder.java new file mode 100644 index 0000000000..90f1e1e1b4 --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/SearchBlurbsResponseOrBuilder.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: schema/google/showcase/v1beta1/messaging.proto + +package com.google.showcase.v1beta1; + +public interface SearchBlurbsResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.SearchBlurbsResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
        +   * Blurbs that matched the search query.
        +   * 
        + * + * repeated .google.showcase.v1beta1.Blurb blurbs = 1; + */ + java.util.List getBlurbsList(); + + /** + * + * + *
        +   * Blurbs that matched the search query.
        +   * 
        + * + * repeated .google.showcase.v1beta1.Blurb blurbs = 1; + */ + com.google.showcase.v1beta1.Blurb getBlurbs(int index); + + /** + * + * + *
        +   * Blurbs that matched the search query.
        +   * 
        + * + * repeated .google.showcase.v1beta1.Blurb blurbs = 1; + */ + int getBlurbsCount(); + + /** + * + * + *
        +   * Blurbs that matched the search query.
        +   * 
        + * + * repeated .google.showcase.v1beta1.Blurb blurbs = 1; + */ + java.util.List getBlurbsOrBuilderList(); + + /** + * + * + *
        +   * Blurbs that matched the search query.
        +   * 
        + * + * repeated .google.showcase.v1beta1.Blurb blurbs = 1; + */ + com.google.showcase.v1beta1.BlurbOrBuilder getBlurbsOrBuilder(int index); + + /** + * + * + *
        +   * A token to retrieve next page of results.
        +   * Pass this value in SearchBlurbsRequest.page_token field in the subsequent
        +   * call to `google.showcase.v1beta1.Blurb\SearchBlurbs` method to
        +   * retrieve the next page of results.
        +   * 
        + * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + java.lang.String getNextPageToken(); + + /** + * + * + *
        +   * A token to retrieve next page of results.
        +   * Pass this value in SearchBlurbsRequest.page_token field in the subsequent
        +   * call to `google.showcase.v1beta1.Blurb\SearchBlurbs` method to
        +   * retrieve the next page of results.
        +   * 
        + * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + com.google.protobuf.ByteString getNextPageTokenBytes(); +} diff --git a/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/SendBlurbsResponse.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/SendBlurbsResponse.java new file mode 100644 index 0000000000..3735c00f79 --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/SendBlurbsResponse.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: schema/google/showcase/v1beta1/messaging.proto + +package com.google.showcase.v1beta1; + +/** + * + * + *
        + * The response message for the google.showcase.v1beta1.Messaging\SendBlurbs
        + * method.
        + * 
        + * + * Protobuf type {@code google.showcase.v1beta1.SendBlurbsResponse} + */ +public final class SendBlurbsResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.SendBlurbsResponse) + SendBlurbsResponseOrBuilder { + private static final long serialVersionUID = 0L; + + // Use SendBlurbsResponse.newBuilder() to construct. + private SendBlurbsResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private SendBlurbsResponse() { + names_ = com.google.protobuf.LazyStringArrayList.EMPTY; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new SendBlurbsResponse(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private SendBlurbsResponse( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + names_ = new com.google.protobuf.LazyStringArrayList(); + mutable_bitField0_ |= 0x00000001; + } + names_.add(s); + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + names_ = names_.getUnmodifiableView(); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.MessagingOuterClass + .internal_static_google_showcase_v1beta1_SendBlurbsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.MessagingOuterClass + .internal_static_google_showcase_v1beta1_SendBlurbsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.SendBlurbsResponse.class, + com.google.showcase.v1beta1.SendBlurbsResponse.Builder.class); + } + + public static final int NAMES_FIELD_NUMBER = 1; + private com.google.protobuf.LazyStringList names_; + + /** + * + * + *
        +   * The names of successful blurb creations.
        +   * 
        + * + * repeated string names = 1; + * + * @return A list containing the names. + */ + public com.google.protobuf.ProtocolStringList getNamesList() { + return names_; + } + + /** + * + * + *
        +   * The names of successful blurb creations.
        +   * 
        + * + * repeated string names = 1; + * + * @return The count of names. + */ + public int getNamesCount() { + return names_.size(); + } + + /** + * + * + *
        +   * The names of successful blurb creations.
        +   * 
        + * + * repeated string names = 1; + * + * @param index The index of the element to return. + * @return The names at the given index. + */ + public java.lang.String getNames(int index) { + return names_.get(index); + } + + /** + * + * + *
        +   * The names of successful blurb creations.
        +   * 
        + * + * repeated string names = 1; + * + * @param index The index of the value to return. + * @return The bytes of the names at the given index. + */ + public com.google.protobuf.ByteString getNamesBytes(int index) { + return names_.getByteString(index); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + for (int i = 0; i < names_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, names_.getRaw(i)); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + { + int dataSize = 0; + for (int i = 0; i < names_.size(); i++) { + dataSize += computeStringSizeNoTag(names_.getRaw(i)); + } + size += dataSize; + size += 1 * getNamesList().size(); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.showcase.v1beta1.SendBlurbsResponse)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.SendBlurbsResponse other = + (com.google.showcase.v1beta1.SendBlurbsResponse) obj; + + if (!getNamesList().equals(other.getNamesList())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getNamesCount() > 0) { + hash = (37 * hash) + NAMES_FIELD_NUMBER; + hash = (53 * hash) + getNamesList().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.showcase.v1beta1.SendBlurbsResponse parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.SendBlurbsResponse parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.SendBlurbsResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.SendBlurbsResponse 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.showcase.v1beta1.SendBlurbsResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.SendBlurbsResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.SendBlurbsResponse parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.SendBlurbsResponse 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.showcase.v1beta1.SendBlurbsResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.SendBlurbsResponse 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.showcase.v1beta1.SendBlurbsResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.SendBlurbsResponse 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.showcase.v1beta1.SendBlurbsResponse 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 message for the google.showcase.v1beta1.Messaging\SendBlurbs
        +   * method.
        +   * 
        + * + * Protobuf type {@code google.showcase.v1beta1.SendBlurbsResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.SendBlurbsResponse) + com.google.showcase.v1beta1.SendBlurbsResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.MessagingOuterClass + .internal_static_google_showcase_v1beta1_SendBlurbsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.MessagingOuterClass + .internal_static_google_showcase_v1beta1_SendBlurbsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.SendBlurbsResponse.class, + com.google.showcase.v1beta1.SendBlurbsResponse.Builder.class); + } + + // Construct using com.google.showcase.v1beta1.SendBlurbsResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + names_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000001); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.showcase.v1beta1.MessagingOuterClass + .internal_static_google_showcase_v1beta1_SendBlurbsResponse_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.SendBlurbsResponse getDefaultInstanceForType() { + return com.google.showcase.v1beta1.SendBlurbsResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.SendBlurbsResponse build() { + com.google.showcase.v1beta1.SendBlurbsResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.SendBlurbsResponse buildPartial() { + com.google.showcase.v1beta1.SendBlurbsResponse result = + new com.google.showcase.v1beta1.SendBlurbsResponse(this); + int from_bitField0_ = bitField0_; + if (((bitField0_ & 0x00000001) != 0)) { + names_ = names_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.names_ = names_; + 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.showcase.v1beta1.SendBlurbsResponse) { + return mergeFrom((com.google.showcase.v1beta1.SendBlurbsResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.showcase.v1beta1.SendBlurbsResponse other) { + if (other == com.google.showcase.v1beta1.SendBlurbsResponse.getDefaultInstance()) return this; + if (!other.names_.isEmpty()) { + if (names_.isEmpty()) { + names_ = other.names_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureNamesIsMutable(); + names_.addAll(other.names_); + } + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.showcase.v1beta1.SendBlurbsResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.showcase.v1beta1.SendBlurbsResponse) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private com.google.protobuf.LazyStringList names_ = + com.google.protobuf.LazyStringArrayList.EMPTY; + + private void ensureNamesIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + names_ = new com.google.protobuf.LazyStringArrayList(names_); + bitField0_ |= 0x00000001; + } + } + + /** + * + * + *
        +     * The names of successful blurb creations.
        +     * 
        + * + * repeated string names = 1; + * + * @return A list containing the names. + */ + public com.google.protobuf.ProtocolStringList getNamesList() { + return names_.getUnmodifiableView(); + } + + /** + * + * + *
        +     * The names of successful blurb creations.
        +     * 
        + * + * repeated string names = 1; + * + * @return The count of names. + */ + public int getNamesCount() { + return names_.size(); + } + + /** + * + * + *
        +     * The names of successful blurb creations.
        +     * 
        + * + * repeated string names = 1; + * + * @param index The index of the element to return. + * @return The names at the given index. + */ + public java.lang.String getNames(int index) { + return names_.get(index); + } + + /** + * + * + *
        +     * The names of successful blurb creations.
        +     * 
        + * + * repeated string names = 1; + * + * @param index The index of the value to return. + * @return The bytes of the names at the given index. + */ + public com.google.protobuf.ByteString getNamesBytes(int index) { + return names_.getByteString(index); + } + + /** + * + * + *
        +     * The names of successful blurb creations.
        +     * 
        + * + * repeated string names = 1; + * + * @param index The index to set the value at. + * @param value The names to set. + * @return This builder for chaining. + */ + public Builder setNames(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureNamesIsMutable(); + names_.set(index, value); + onChanged(); + return this; + } + + /** + * + * + *
        +     * The names of successful blurb creations.
        +     * 
        + * + * repeated string names = 1; + * + * @param value The names to add. + * @return This builder for chaining. + */ + public Builder addNames(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureNamesIsMutable(); + names_.add(value); + onChanged(); + return this; + } + + /** + * + * + *
        +     * The names of successful blurb creations.
        +     * 
        + * + * repeated string names = 1; + * + * @param values The names to add. + * @return This builder for chaining. + */ + public Builder addAllNames(java.lang.Iterable values) { + ensureNamesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, names_); + onChanged(); + return this; + } + + /** + * + * + *
        +     * The names of successful blurb creations.
        +     * 
        + * + * repeated string names = 1; + * + * @return This builder for chaining. + */ + public Builder clearNames() { + names_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
        +     * The names of successful blurb creations.
        +     * 
        + * + * repeated string names = 1; + * + * @param value The bytes of the names to add. + * @return This builder for chaining. + */ + public Builder addNamesBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureNamesIsMutable(); + names_.add(value); + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.showcase.v1beta1.SendBlurbsResponse) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.SendBlurbsResponse) + private static final com.google.showcase.v1beta1.SendBlurbsResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.SendBlurbsResponse(); + } + + public static com.google.showcase.v1beta1.SendBlurbsResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SendBlurbsResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new SendBlurbsResponse(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.showcase.v1beta1.SendBlurbsResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/SendBlurbsResponseOrBuilder.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/SendBlurbsResponseOrBuilder.java new file mode 100644 index 0000000000..658b06a1e5 --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/SendBlurbsResponseOrBuilder.java @@ -0,0 +1,79 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/messaging.proto + +package com.google.showcase.v1beta1; + +public interface SendBlurbsResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.SendBlurbsResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
        +   * The names of successful blurb creations.
        +   * 
        + * + * repeated string names = 1; + * + * @return A list containing the names. + */ + java.util.List getNamesList(); + + /** + * + * + *
        +   * The names of successful blurb creations.
        +   * 
        + * + * repeated string names = 1; + * + * @return The count of names. + */ + int getNamesCount(); + + /** + * + * + *
        +   * The names of successful blurb creations.
        +   * 
        + * + * repeated string names = 1; + * + * @param index The index of the element to return. + * @return The names at the given index. + */ + java.lang.String getNames(int index); + + /** + * + * + *
        +   * The names of successful blurb creations.
        +   * 
        + * + * repeated string names = 1; + * + * @param index The index of the value to return. + * @return The bytes of the names at the given index. + */ + com.google.protobuf.ByteString getNamesBytes(int index); +} diff --git a/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/Sequence.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/Sequence.java new file mode 100644 index 0000000000..edc2abf0f5 --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/Sequence.java @@ -0,0 +1,2202 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/sequence.proto + +package com.google.showcase.v1beta1; + +/** Protobuf type {@code google.showcase.v1beta1.Sequence} */ +public final class Sequence extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.Sequence) + SequenceOrBuilder { + private static final long serialVersionUID = 0L; + + // Use Sequence.newBuilder() to construct. + private Sequence(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Sequence() { + name_ = ""; + responses_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Sequence(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private Sequence( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + break; + } + case 18: + { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + responses_ = + new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + responses_.add( + input.readMessage( + com.google.showcase.v1beta1.Sequence.Response.parser(), extensionRegistry)); + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + responses_ = java.util.Collections.unmodifiableList(responses_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.SequenceOuterClass + .internal_static_google_showcase_v1beta1_Sequence_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.SequenceOuterClass + .internal_static_google_showcase_v1beta1_Sequence_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.Sequence.class, + com.google.showcase.v1beta1.Sequence.Builder.class); + } + + public interface ResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.Sequence.Response) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
        +     * The status to return for an individual attempt.
        +     * 
        + * + * .google.rpc.Status status = 1; + * + * @return Whether the status field is set. + */ + boolean hasStatus(); + + /** + * + * + *
        +     * The status to return for an individual attempt.
        +     * 
        + * + * .google.rpc.Status status = 1; + * + * @return The status. + */ + com.google.rpc.Status getStatus(); + + /** + * + * + *
        +     * The status to return for an individual attempt.
        +     * 
        + * + * .google.rpc.Status status = 1; + */ + com.google.rpc.StatusOrBuilder getStatusOrBuilder(); + + /** + * + * + *
        +     * The amount of time to delay sending the response.
        +     * 
        + * + * .google.protobuf.Duration delay = 2; + * + * @return Whether the delay field is set. + */ + boolean hasDelay(); + + /** + * + * + *
        +     * The amount of time to delay sending the response.
        +     * 
        + * + * .google.protobuf.Duration delay = 2; + * + * @return The delay. + */ + com.google.protobuf.Duration getDelay(); + + /** + * + * + *
        +     * The amount of time to delay sending the response.
        +     * 
        + * + * .google.protobuf.Duration delay = 2; + */ + com.google.protobuf.DurationOrBuilder getDelayOrBuilder(); + } + + /** + * + * + *
        +   * A server response to an RPC Attempt in a sequence.
        +   * 
        + * + * Protobuf type {@code google.showcase.v1beta1.Sequence.Response} + */ + public static final class Response extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.Sequence.Response) + ResponseOrBuilder { + private static final long serialVersionUID = 0L; + + // Use Response.newBuilder() to construct. + private Response(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Response() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Response(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private Response( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + com.google.rpc.Status.Builder subBuilder = null; + if (status_ != null) { + subBuilder = status_.toBuilder(); + } + status_ = input.readMessage(com.google.rpc.Status.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(status_); + status_ = subBuilder.buildPartial(); + } + + break; + } + case 18: + { + com.google.protobuf.Duration.Builder subBuilder = null; + if (delay_ != null) { + subBuilder = delay_.toBuilder(); + } + delay_ = + input.readMessage(com.google.protobuf.Duration.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(delay_); + delay_ = subBuilder.buildPartial(); + } + + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.SequenceOuterClass + .internal_static_google_showcase_v1beta1_Sequence_Response_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.SequenceOuterClass + .internal_static_google_showcase_v1beta1_Sequence_Response_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.Sequence.Response.class, + com.google.showcase.v1beta1.Sequence.Response.Builder.class); + } + + public static final int STATUS_FIELD_NUMBER = 1; + private com.google.rpc.Status status_; + + /** + * + * + *
        +     * The status to return for an individual attempt.
        +     * 
        + * + * .google.rpc.Status status = 1; + * + * @return Whether the status field is set. + */ + @java.lang.Override + public boolean hasStatus() { + return status_ != null; + } + + /** + * + * + *
        +     * The status to return for an individual attempt.
        +     * 
        + * + * .google.rpc.Status status = 1; + * + * @return The status. + */ + @java.lang.Override + public com.google.rpc.Status getStatus() { + return status_ == null ? com.google.rpc.Status.getDefaultInstance() : status_; + } + + /** + * + * + *
        +     * The status to return for an individual attempt.
        +     * 
        + * + * .google.rpc.Status status = 1; + */ + @java.lang.Override + public com.google.rpc.StatusOrBuilder getStatusOrBuilder() { + return getStatus(); + } + + public static final int DELAY_FIELD_NUMBER = 2; + private com.google.protobuf.Duration delay_; + + /** + * + * + *
        +     * The amount of time to delay sending the response.
        +     * 
        + * + * .google.protobuf.Duration delay = 2; + * + * @return Whether the delay field is set. + */ + @java.lang.Override + public boolean hasDelay() { + return delay_ != null; + } + + /** + * + * + *
        +     * The amount of time to delay sending the response.
        +     * 
        + * + * .google.protobuf.Duration delay = 2; + * + * @return The delay. + */ + @java.lang.Override + public com.google.protobuf.Duration getDelay() { + return delay_ == null ? com.google.protobuf.Duration.getDefaultInstance() : delay_; + } + + /** + * + * + *
        +     * The amount of time to delay sending the response.
        +     * 
        + * + * .google.protobuf.Duration delay = 2; + */ + @java.lang.Override + public com.google.protobuf.DurationOrBuilder getDelayOrBuilder() { + return getDelay(); + } + + 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 (status_ != null) { + output.writeMessage(1, getStatus()); + } + if (delay_ != null) { + output.writeMessage(2, getDelay()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (status_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getStatus()); + } + if (delay_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getDelay()); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.showcase.v1beta1.Sequence.Response)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.Sequence.Response other = + (com.google.showcase.v1beta1.Sequence.Response) obj; + + if (hasStatus() != other.hasStatus()) return false; + if (hasStatus()) { + if (!getStatus().equals(other.getStatus())) return false; + } + if (hasDelay() != other.hasDelay()) return false; + if (hasDelay()) { + if (!getDelay().equals(other.getDelay())) return false; + } + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasStatus()) { + hash = (37 * hash) + STATUS_FIELD_NUMBER; + hash = (53 * hash) + getStatus().hashCode(); + } + if (hasDelay()) { + hash = (37 * hash) + DELAY_FIELD_NUMBER; + hash = (53 * hash) + getDelay().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.showcase.v1beta1.Sequence.Response parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.Sequence.Response parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.Sequence.Response parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.Sequence.Response 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.showcase.v1beta1.Sequence.Response parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.Sequence.Response parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.Sequence.Response parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.Sequence.Response 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.showcase.v1beta1.Sequence.Response parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.Sequence.Response 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.showcase.v1beta1.Sequence.Response parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.Sequence.Response 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.showcase.v1beta1.Sequence.Response prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
        +     * A server response to an RPC Attempt in a sequence.
        +     * 
        + * + * Protobuf type {@code google.showcase.v1beta1.Sequence.Response} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.Sequence.Response) + com.google.showcase.v1beta1.Sequence.ResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.SequenceOuterClass + .internal_static_google_showcase_v1beta1_Sequence_Response_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.SequenceOuterClass + .internal_static_google_showcase_v1beta1_Sequence_Response_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.Sequence.Response.class, + com.google.showcase.v1beta1.Sequence.Response.Builder.class); + } + + // Construct using com.google.showcase.v1beta1.Sequence.Response.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (statusBuilder_ == null) { + status_ = null; + } else { + status_ = null; + statusBuilder_ = null; + } + if (delayBuilder_ == null) { + delay_ = null; + } else { + delay_ = null; + delayBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.showcase.v1beta1.SequenceOuterClass + .internal_static_google_showcase_v1beta1_Sequence_Response_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.Sequence.Response getDefaultInstanceForType() { + return com.google.showcase.v1beta1.Sequence.Response.getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.Sequence.Response build() { + com.google.showcase.v1beta1.Sequence.Response result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.Sequence.Response buildPartial() { + com.google.showcase.v1beta1.Sequence.Response result = + new com.google.showcase.v1beta1.Sequence.Response(this); + if (statusBuilder_ == null) { + result.status_ = status_; + } else { + result.status_ = statusBuilder_.build(); + } + if (delayBuilder_ == null) { + result.delay_ = delay_; + } else { + result.delay_ = delayBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, + java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.showcase.v1beta1.Sequence.Response) { + return mergeFrom((com.google.showcase.v1beta1.Sequence.Response) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.showcase.v1beta1.Sequence.Response other) { + if (other == com.google.showcase.v1beta1.Sequence.Response.getDefaultInstance()) + return this; + if (other.hasStatus()) { + mergeStatus(other.getStatus()); + } + if (other.hasDelay()) { + mergeDelay(other.getDelay()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.showcase.v1beta1.Sequence.Response parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.showcase.v1beta1.Sequence.Response) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private com.google.rpc.Status status_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.rpc.Status, com.google.rpc.Status.Builder, com.google.rpc.StatusOrBuilder> + statusBuilder_; + + /** + * + * + *
        +       * The status to return for an individual attempt.
        +       * 
        + * + * .google.rpc.Status status = 1; + * + * @return Whether the status field is set. + */ + public boolean hasStatus() { + return statusBuilder_ != null || status_ != null; + } + + /** + * + * + *
        +       * The status to return for an individual attempt.
        +       * 
        + * + * .google.rpc.Status status = 1; + * + * @return The status. + */ + public com.google.rpc.Status getStatus() { + if (statusBuilder_ == null) { + return status_ == null ? com.google.rpc.Status.getDefaultInstance() : status_; + } else { + return statusBuilder_.getMessage(); + } + } + + /** + * + * + *
        +       * The status to return for an individual attempt.
        +       * 
        + * + * .google.rpc.Status status = 1; + */ + public Builder setStatus(com.google.rpc.Status value) { + if (statusBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + status_ = value; + onChanged(); + } else { + statusBuilder_.setMessage(value); + } + + return this; + } + + /** + * + * + *
        +       * The status to return for an individual attempt.
        +       * 
        + * + * .google.rpc.Status status = 1; + */ + public Builder setStatus(com.google.rpc.Status.Builder builderForValue) { + if (statusBuilder_ == null) { + status_ = builderForValue.build(); + onChanged(); + } else { + statusBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + + /** + * + * + *
        +       * The status to return for an individual attempt.
        +       * 
        + * + * .google.rpc.Status status = 1; + */ + public Builder mergeStatus(com.google.rpc.Status value) { + if (statusBuilder_ == null) { + if (status_ != null) { + status_ = com.google.rpc.Status.newBuilder(status_).mergeFrom(value).buildPartial(); + } else { + status_ = value; + } + onChanged(); + } else { + statusBuilder_.mergeFrom(value); + } + + return this; + } + + /** + * + * + *
        +       * The status to return for an individual attempt.
        +       * 
        + * + * .google.rpc.Status status = 1; + */ + public Builder clearStatus() { + if (statusBuilder_ == null) { + status_ = null; + onChanged(); + } else { + status_ = null; + statusBuilder_ = null; + } + + return this; + } + + /** + * + * + *
        +       * The status to return for an individual attempt.
        +       * 
        + * + * .google.rpc.Status status = 1; + */ + public com.google.rpc.Status.Builder getStatusBuilder() { + + onChanged(); + return getStatusFieldBuilder().getBuilder(); + } + + /** + * + * + *
        +       * The status to return for an individual attempt.
        +       * 
        + * + * .google.rpc.Status status = 1; + */ + public com.google.rpc.StatusOrBuilder getStatusOrBuilder() { + if (statusBuilder_ != null) { + return statusBuilder_.getMessageOrBuilder(); + } else { + return status_ == null ? com.google.rpc.Status.getDefaultInstance() : status_; + } + } + + /** + * + * + *
        +       * The status to return for an individual attempt.
        +       * 
        + * + * .google.rpc.Status status = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.rpc.Status, com.google.rpc.Status.Builder, com.google.rpc.StatusOrBuilder> + getStatusFieldBuilder() { + if (statusBuilder_ == null) { + statusBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.rpc.Status, + com.google.rpc.Status.Builder, + com.google.rpc.StatusOrBuilder>(getStatus(), getParentForChildren(), isClean()); + status_ = null; + } + return statusBuilder_; + } + + private com.google.protobuf.Duration delay_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder> + delayBuilder_; + + /** + * + * + *
        +       * The amount of time to delay sending the response.
        +       * 
        + * + * .google.protobuf.Duration delay = 2; + * + * @return Whether the delay field is set. + */ + public boolean hasDelay() { + return delayBuilder_ != null || delay_ != null; + } + + /** + * + * + *
        +       * The amount of time to delay sending the response.
        +       * 
        + * + * .google.protobuf.Duration delay = 2; + * + * @return The delay. + */ + public com.google.protobuf.Duration getDelay() { + if (delayBuilder_ == null) { + return delay_ == null ? com.google.protobuf.Duration.getDefaultInstance() : delay_; + } else { + return delayBuilder_.getMessage(); + } + } + + /** + * + * + *
        +       * The amount of time to delay sending the response.
        +       * 
        + * + * .google.protobuf.Duration delay = 2; + */ + public Builder setDelay(com.google.protobuf.Duration value) { + if (delayBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + delay_ = value; + onChanged(); + } else { + delayBuilder_.setMessage(value); + } + + return this; + } + + /** + * + * + *
        +       * The amount of time to delay sending the response.
        +       * 
        + * + * .google.protobuf.Duration delay = 2; + */ + public Builder setDelay(com.google.protobuf.Duration.Builder builderForValue) { + if (delayBuilder_ == null) { + delay_ = builderForValue.build(); + onChanged(); + } else { + delayBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + + /** + * + * + *
        +       * The amount of time to delay sending the response.
        +       * 
        + * + * .google.protobuf.Duration delay = 2; + */ + public Builder mergeDelay(com.google.protobuf.Duration value) { + if (delayBuilder_ == null) { + if (delay_ != null) { + delay_ = + com.google.protobuf.Duration.newBuilder(delay_).mergeFrom(value).buildPartial(); + } else { + delay_ = value; + } + onChanged(); + } else { + delayBuilder_.mergeFrom(value); + } + + return this; + } + + /** + * + * + *
        +       * The amount of time to delay sending the response.
        +       * 
        + * + * .google.protobuf.Duration delay = 2; + */ + public Builder clearDelay() { + if (delayBuilder_ == null) { + delay_ = null; + onChanged(); + } else { + delay_ = null; + delayBuilder_ = null; + } + + return this; + } + + /** + * + * + *
        +       * The amount of time to delay sending the response.
        +       * 
        + * + * .google.protobuf.Duration delay = 2; + */ + public com.google.protobuf.Duration.Builder getDelayBuilder() { + + onChanged(); + return getDelayFieldBuilder().getBuilder(); + } + + /** + * + * + *
        +       * The amount of time to delay sending the response.
        +       * 
        + * + * .google.protobuf.Duration delay = 2; + */ + public com.google.protobuf.DurationOrBuilder getDelayOrBuilder() { + if (delayBuilder_ != null) { + return delayBuilder_.getMessageOrBuilder(); + } else { + return delay_ == null ? com.google.protobuf.Duration.getDefaultInstance() : delay_; + } + } + + /** + * + * + *
        +       * The amount of time to delay sending the response.
        +       * 
        + * + * .google.protobuf.Duration delay = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder> + getDelayFieldBuilder() { + if (delayBuilder_ == null) { + delayBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder>( + getDelay(), getParentForChildren(), isClean()); + delay_ = null; + } + return delayBuilder_; + } + + @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.showcase.v1beta1.Sequence.Response) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.Sequence.Response) + private static final com.google.showcase.v1beta1.Sequence.Response DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.Sequence.Response(); + } + + public static com.google.showcase.v1beta1.Sequence.Response getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Response parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Response(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.showcase.v1beta1.Sequence.Response getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + + /** + * 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; + } + } + + /** + * 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 RESPONSES_FIELD_NUMBER = 2; + private java.util.List responses_; + + /** + * + * + *
        +   * Sequence of responses to return in order for each attempt. If empty, the
        +   * default response is an immediate OK.
        +   * 
        + * + * repeated .google.showcase.v1beta1.Sequence.Response responses = 2; + */ + @java.lang.Override + public java.util.List getResponsesList() { + return responses_; + } + + /** + * + * + *
        +   * Sequence of responses to return in order for each attempt. If empty, the
        +   * default response is an immediate OK.
        +   * 
        + * + * repeated .google.showcase.v1beta1.Sequence.Response responses = 2; + */ + @java.lang.Override + public java.util.List + getResponsesOrBuilderList() { + return responses_; + } + + /** + * + * + *
        +   * Sequence of responses to return in order for each attempt. If empty, the
        +   * default response is an immediate OK.
        +   * 
        + * + * repeated .google.showcase.v1beta1.Sequence.Response responses = 2; + */ + @java.lang.Override + public int getResponsesCount() { + return responses_.size(); + } + + /** + * + * + *
        +   * Sequence of responses to return in order for each attempt. If empty, the
        +   * default response is an immediate OK.
        +   * 
        + * + * repeated .google.showcase.v1beta1.Sequence.Response responses = 2; + */ + @java.lang.Override + public com.google.showcase.v1beta1.Sequence.Response getResponses(int index) { + return responses_.get(index); + } + + /** + * + * + *
        +   * Sequence of responses to return in order for each attempt. If empty, the
        +   * default response is an immediate OK.
        +   * 
        + * + * repeated .google.showcase.v1beta1.Sequence.Response responses = 2; + */ + @java.lang.Override + public com.google.showcase.v1beta1.Sequence.ResponseOrBuilder getResponsesOrBuilder(int index) { + return responses_.get(index); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + for (int i = 0; i < responses_.size(); i++) { + output.writeMessage(2, responses_.get(i)); + } + unknownFields.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_); + } + for (int i = 0; i < responses_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, responses_.get(i)); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.showcase.v1beta1.Sequence)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.Sequence other = (com.google.showcase.v1beta1.Sequence) obj; + + if (!getName().equals(other.getName())) return false; + if (!getResponsesList().equals(other.getResponsesList())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + if (getResponsesCount() > 0) { + hash = (37 * hash) + RESPONSES_FIELD_NUMBER; + hash = (53 * hash) + getResponsesList().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.showcase.v1beta1.Sequence parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.Sequence parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.Sequence parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.Sequence 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.showcase.v1beta1.Sequence parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.Sequence parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.Sequence parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.Sequence 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.showcase.v1beta1.Sequence parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.Sequence 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.showcase.v1beta1.Sequence parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.Sequence 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.showcase.v1beta1.Sequence prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** Protobuf type {@code google.showcase.v1beta1.Sequence} */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.Sequence) + com.google.showcase.v1beta1.SequenceOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.SequenceOuterClass + .internal_static_google_showcase_v1beta1_Sequence_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.SequenceOuterClass + .internal_static_google_showcase_v1beta1_Sequence_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.Sequence.class, + com.google.showcase.v1beta1.Sequence.Builder.class); + } + + // Construct using com.google.showcase.v1beta1.Sequence.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getResponsesFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + if (responsesBuilder_ == null) { + responses_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + responsesBuilder_.clear(); + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.showcase.v1beta1.SequenceOuterClass + .internal_static_google_showcase_v1beta1_Sequence_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.Sequence getDefaultInstanceForType() { + return com.google.showcase.v1beta1.Sequence.getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.Sequence build() { + com.google.showcase.v1beta1.Sequence result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.Sequence buildPartial() { + com.google.showcase.v1beta1.Sequence result = new com.google.showcase.v1beta1.Sequence(this); + int from_bitField0_ = bitField0_; + result.name_ = name_; + if (responsesBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + responses_ = java.util.Collections.unmodifiableList(responses_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.responses_ = responses_; + } else { + result.responses_ = responsesBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.showcase.v1beta1.Sequence) { + return mergeFrom((com.google.showcase.v1beta1.Sequence) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.showcase.v1beta1.Sequence other) { + if (other == com.google.showcase.v1beta1.Sequence.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + if (responsesBuilder_ == null) { + if (!other.responses_.isEmpty()) { + if (responses_.isEmpty()) { + responses_ = other.responses_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureResponsesIsMutable(); + responses_.addAll(other.responses_); + } + onChanged(); + } + } else { + if (!other.responses_.isEmpty()) { + if (responsesBuilder_.isEmpty()) { + responsesBuilder_.dispose(); + responsesBuilder_ = null; + responses_ = other.responses_; + bitField0_ = (bitField0_ & ~0x00000001); + responsesBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getResponsesFieldBuilder() + : null; + } else { + responsesBuilder_.addAllMessages(other.responses_); + } + } + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.showcase.v1beta1.Sequence parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.showcase.v1beta1.Sequence) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + + /** + * 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; + } + } + + /** + * 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; + } + } + + /** + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + + /** + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + + /** + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + + private java.util.List responses_ = + java.util.Collections.emptyList(); + + private void ensureResponsesIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + responses_ = + new java.util.ArrayList(responses_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.showcase.v1beta1.Sequence.Response, + com.google.showcase.v1beta1.Sequence.Response.Builder, + com.google.showcase.v1beta1.Sequence.ResponseOrBuilder> + responsesBuilder_; + + /** + * + * + *
        +     * Sequence of responses to return in order for each attempt. If empty, the
        +     * default response is an immediate OK.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Sequence.Response responses = 2; + */ + public java.util.List getResponsesList() { + if (responsesBuilder_ == null) { + return java.util.Collections.unmodifiableList(responses_); + } else { + return responsesBuilder_.getMessageList(); + } + } + + /** + * + * + *
        +     * Sequence of responses to return in order for each attempt. If empty, the
        +     * default response is an immediate OK.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Sequence.Response responses = 2; + */ + public int getResponsesCount() { + if (responsesBuilder_ == null) { + return responses_.size(); + } else { + return responsesBuilder_.getCount(); + } + } + + /** + * + * + *
        +     * Sequence of responses to return in order for each attempt. If empty, the
        +     * default response is an immediate OK.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Sequence.Response responses = 2; + */ + public com.google.showcase.v1beta1.Sequence.Response getResponses(int index) { + if (responsesBuilder_ == null) { + return responses_.get(index); + } else { + return responsesBuilder_.getMessage(index); + } + } + + /** + * + * + *
        +     * Sequence of responses to return in order for each attempt. If empty, the
        +     * default response is an immediate OK.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Sequence.Response responses = 2; + */ + public Builder setResponses(int index, com.google.showcase.v1beta1.Sequence.Response value) { + if (responsesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureResponsesIsMutable(); + responses_.set(index, value); + onChanged(); + } else { + responsesBuilder_.setMessage(index, value); + } + return this; + } + + /** + * + * + *
        +     * Sequence of responses to return in order for each attempt. If empty, the
        +     * default response is an immediate OK.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Sequence.Response responses = 2; + */ + public Builder setResponses( + int index, com.google.showcase.v1beta1.Sequence.Response.Builder builderForValue) { + if (responsesBuilder_ == null) { + ensureResponsesIsMutable(); + responses_.set(index, builderForValue.build()); + onChanged(); + } else { + responsesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
        +     * Sequence of responses to return in order for each attempt. If empty, the
        +     * default response is an immediate OK.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Sequence.Response responses = 2; + */ + public Builder addResponses(com.google.showcase.v1beta1.Sequence.Response value) { + if (responsesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureResponsesIsMutable(); + responses_.add(value); + onChanged(); + } else { + responsesBuilder_.addMessage(value); + } + return this; + } + + /** + * + * + *
        +     * Sequence of responses to return in order for each attempt. If empty, the
        +     * default response is an immediate OK.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Sequence.Response responses = 2; + */ + public Builder addResponses(int index, com.google.showcase.v1beta1.Sequence.Response value) { + if (responsesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureResponsesIsMutable(); + responses_.add(index, value); + onChanged(); + } else { + responsesBuilder_.addMessage(index, value); + } + return this; + } + + /** + * + * + *
        +     * Sequence of responses to return in order for each attempt. If empty, the
        +     * default response is an immediate OK.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Sequence.Response responses = 2; + */ + public Builder addResponses( + com.google.showcase.v1beta1.Sequence.Response.Builder builderForValue) { + if (responsesBuilder_ == null) { + ensureResponsesIsMutable(); + responses_.add(builderForValue.build()); + onChanged(); + } else { + responsesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + + /** + * + * + *
        +     * Sequence of responses to return in order for each attempt. If empty, the
        +     * default response is an immediate OK.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Sequence.Response responses = 2; + */ + public Builder addResponses( + int index, com.google.showcase.v1beta1.Sequence.Response.Builder builderForValue) { + if (responsesBuilder_ == null) { + ensureResponsesIsMutable(); + responses_.add(index, builderForValue.build()); + onChanged(); + } else { + responsesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
        +     * Sequence of responses to return in order for each attempt. If empty, the
        +     * default response is an immediate OK.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Sequence.Response responses = 2; + */ + public Builder addAllResponses( + java.lang.Iterable values) { + if (responsesBuilder_ == null) { + ensureResponsesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, responses_); + onChanged(); + } else { + responsesBuilder_.addAllMessages(values); + } + return this; + } + + /** + * + * + *
        +     * Sequence of responses to return in order for each attempt. If empty, the
        +     * default response is an immediate OK.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Sequence.Response responses = 2; + */ + public Builder clearResponses() { + if (responsesBuilder_ == null) { + responses_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + responsesBuilder_.clear(); + } + return this; + } + + /** + * + * + *
        +     * Sequence of responses to return in order for each attempt. If empty, the
        +     * default response is an immediate OK.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Sequence.Response responses = 2; + */ + public Builder removeResponses(int index) { + if (responsesBuilder_ == null) { + ensureResponsesIsMutable(); + responses_.remove(index); + onChanged(); + } else { + responsesBuilder_.remove(index); + } + return this; + } + + /** + * + * + *
        +     * Sequence of responses to return in order for each attempt. If empty, the
        +     * default response is an immediate OK.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Sequence.Response responses = 2; + */ + public com.google.showcase.v1beta1.Sequence.Response.Builder getResponsesBuilder(int index) { + return getResponsesFieldBuilder().getBuilder(index); + } + + /** + * + * + *
        +     * Sequence of responses to return in order for each attempt. If empty, the
        +     * default response is an immediate OK.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Sequence.Response responses = 2; + */ + public com.google.showcase.v1beta1.Sequence.ResponseOrBuilder getResponsesOrBuilder(int index) { + if (responsesBuilder_ == null) { + return responses_.get(index); + } else { + return responsesBuilder_.getMessageOrBuilder(index); + } + } + + /** + * + * + *
        +     * Sequence of responses to return in order for each attempt. If empty, the
        +     * default response is an immediate OK.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Sequence.Response responses = 2; + */ + public java.util.List + getResponsesOrBuilderList() { + if (responsesBuilder_ != null) { + return responsesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(responses_); + } + } + + /** + * + * + *
        +     * Sequence of responses to return in order for each attempt. If empty, the
        +     * default response is an immediate OK.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Sequence.Response responses = 2; + */ + public com.google.showcase.v1beta1.Sequence.Response.Builder addResponsesBuilder() { + return getResponsesFieldBuilder() + .addBuilder(com.google.showcase.v1beta1.Sequence.Response.getDefaultInstance()); + } + + /** + * + * + *
        +     * Sequence of responses to return in order for each attempt. If empty, the
        +     * default response is an immediate OK.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Sequence.Response responses = 2; + */ + public com.google.showcase.v1beta1.Sequence.Response.Builder addResponsesBuilder(int index) { + return getResponsesFieldBuilder() + .addBuilder(index, com.google.showcase.v1beta1.Sequence.Response.getDefaultInstance()); + } + + /** + * + * + *
        +     * Sequence of responses to return in order for each attempt. If empty, the
        +     * default response is an immediate OK.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Sequence.Response responses = 2; + */ + public java.util.List + getResponsesBuilderList() { + return getResponsesFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.showcase.v1beta1.Sequence.Response, + com.google.showcase.v1beta1.Sequence.Response.Builder, + com.google.showcase.v1beta1.Sequence.ResponseOrBuilder> + getResponsesFieldBuilder() { + if (responsesBuilder_ == null) { + responsesBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.showcase.v1beta1.Sequence.Response, + com.google.showcase.v1beta1.Sequence.Response.Builder, + com.google.showcase.v1beta1.Sequence.ResponseOrBuilder>( + responses_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + responses_ = null; + } + return responsesBuilder_; + } + + @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.showcase.v1beta1.Sequence) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.Sequence) + private static final com.google.showcase.v1beta1.Sequence DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.Sequence(); + } + + public static com.google.showcase.v1beta1.Sequence getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Sequence parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Sequence(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.showcase.v1beta1.Sequence getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/SequenceName.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/SequenceName.java new file mode 100644 index 0000000000..a5317c10c4 --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/SequenceName.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.showcase.v1beta1; + +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +@Generated("by gapic-generator-java") +public class SequenceName implements ResourceName { + private static final PathTemplate SEQUENCE = + PathTemplate.createWithoutUrlEncoding("sequences/{sequence}"); + private volatile Map fieldValuesMap; + private final String sequence; + + @Deprecated + protected SequenceName() { + sequence = null; + } + + private SequenceName(Builder builder) { + sequence = Preconditions.checkNotNull(builder.getSequence()); + } + + public String getSequence() { + return sequence; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + public static SequenceName of(String sequence) { + return newBuilder().setSequence(sequence).build(); + } + + public static String format(String sequence) { + return newBuilder().setSequence(sequence).build().toString(); + } + + public static SequenceName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + SEQUENCE.validatedMatch( + formattedString, "SequenceName.parse: formattedString not in valid format"); + return of(matchMap.get("sequence")); + } + + 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 (SequenceName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return SEQUENCE.matches(formattedString); + } + + @Override + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + if (sequence != null) { + fieldMapBuilder.put("sequence", sequence); + } + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return SEQUENCE.instantiate("sequence", sequence); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o != null && getClass() == o.getClass()) { + SequenceName that = ((SequenceName) o); + return Objects.equals(this.sequence, that.sequence); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= Objects.hashCode(sequence); + return h; + } + + /** Builder for sequences/{sequence}. */ + public static class Builder { + private String sequence; + + protected Builder() {} + + public String getSequence() { + return sequence; + } + + public Builder setSequence(String sequence) { + this.sequence = sequence; + return this; + } + + private Builder(SequenceName sequenceName) { + this.sequence = sequenceName.sequence; + } + + public SequenceName build() { + return new SequenceName(this); + } + } +} diff --git a/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/SequenceOrBuilder.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/SequenceOrBuilder.java new file mode 100644 index 0000000000..448b730da9 --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/SequenceOrBuilder.java @@ -0,0 +1,100 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/sequence.proto + +package com.google.showcase.v1beta1; + +public interface SequenceOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.Sequence) + com.google.protobuf.MessageOrBuilder { + + /** + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The name. + */ + java.lang.String getName(); + + /** + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
        +   * Sequence of responses to return in order for each attempt. If empty, the
        +   * default response is an immediate OK.
        +   * 
        + * + * repeated .google.showcase.v1beta1.Sequence.Response responses = 2; + */ + java.util.List getResponsesList(); + + /** + * + * + *
        +   * Sequence of responses to return in order for each attempt. If empty, the
        +   * default response is an immediate OK.
        +   * 
        + * + * repeated .google.showcase.v1beta1.Sequence.Response responses = 2; + */ + com.google.showcase.v1beta1.Sequence.Response getResponses(int index); + + /** + * + * + *
        +   * Sequence of responses to return in order for each attempt. If empty, the
        +   * default response is an immediate OK.
        +   * 
        + * + * repeated .google.showcase.v1beta1.Sequence.Response responses = 2; + */ + int getResponsesCount(); + + /** + * + * + *
        +   * Sequence of responses to return in order for each attempt. If empty, the
        +   * default response is an immediate OK.
        +   * 
        + * + * repeated .google.showcase.v1beta1.Sequence.Response responses = 2; + */ + java.util.List + getResponsesOrBuilderList(); + + /** + * + * + *
        +   * Sequence of responses to return in order for each attempt. If empty, the
        +   * default response is an immediate OK.
        +   * 
        + * + * repeated .google.showcase.v1beta1.Sequence.Response responses = 2; + */ + com.google.showcase.v1beta1.Sequence.ResponseOrBuilder getResponsesOrBuilder(int index); +} diff --git a/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/SequenceOuterClass.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/SequenceOuterClass.java new file mode 100644 index 0000000000..8767f3199f --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/SequenceOuterClass.java @@ -0,0 +1,350 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/sequence.proto + +package com.google.showcase.v1beta1; + +public final class SequenceOuterClass { + private SequenceOuterClass() {} + + 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_showcase_v1beta1_Sequence_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_showcase_v1beta1_Sequence_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_showcase_v1beta1_Sequence_Response_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_showcase_v1beta1_Sequence_Response_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_showcase_v1beta1_StreamingSequence_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_showcase_v1beta1_StreamingSequence_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_showcase_v1beta1_StreamingSequence_Response_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_showcase_v1beta1_StreamingSequence_Response_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_showcase_v1beta1_StreamingSequenceReport_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_showcase_v1beta1_StreamingSequenceReport_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_showcase_v1beta1_StreamingSequenceReport_Attempt_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_showcase_v1beta1_StreamingSequenceReport_Attempt_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_showcase_v1beta1_SequenceReport_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_showcase_v1beta1_SequenceReport_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_showcase_v1beta1_SequenceReport_Attempt_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_showcase_v1beta1_SequenceReport_Attempt_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_showcase_v1beta1_CreateSequenceRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_showcase_v1beta1_CreateSequenceRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_showcase_v1beta1_CreateStreamingSequenceRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_showcase_v1beta1_CreateStreamingSequenceRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_showcase_v1beta1_AttemptSequenceRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_showcase_v1beta1_AttemptSequenceRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_showcase_v1beta1_AttemptStreamingSequenceRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_showcase_v1beta1_AttemptStreamingSequenceRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_showcase_v1beta1_AttemptStreamingSequenceResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_showcase_v1beta1_AttemptStreamingSequenceResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_showcase_v1beta1_GetSequenceReportRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_showcase_v1beta1_GetSequenceReportRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_showcase_v1beta1_GetStreamingSequenceReportRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_showcase_v1beta1_GetStreamingSequenceReportRequest_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-schema/google/showcase/v1beta1/sequenc" + + "e.proto\022\027google.showcase.v1beta1\032\034google" + + "/api/annotations.proto\032\027google/api/clien" + + "t.proto\032\037google/api/field_behavior.proto" + + "\032\031google/api/resource.proto\032\036google/prot" + + "obuf/duration.proto\032\033google/protobuf/emp" + + "ty.proto\032\037google/protobuf/timestamp.prot" + + "o\032\027google/rpc/status.proto\"\363\001\n\010Sequence\022" + + "\021\n\004name\030\001 \001(\tB\003\340A\003\022=\n\tresponses\030\002 \003(\0132*." + + "google.showcase.v1beta1.Sequence.Respons" + + "e\032X\n\010Response\022\"\n\006status\030\001 \001(\0132\022.google.r" + + "pc.Status\022(\n\005delay\030\002 \001(\0132\031.google.protob" + + "uf.Duration:;\352A8\n showcase.googleapis.co" + + "m/Sequence\022\024sequences/{sequence}\"\312\002\n\021Str" + + "eamingSequence\022\021\n\004name\030\001 \001(\tB\003\340A\003\022\017\n\007con" + + "tent\030\002 \001(\t\022F\n\tresponses\030\003 \003(\01323.google.s" + + "howcase.v1beta1.StreamingSequence.Respon" + + "se\032p\n\010Response\022\"\n\006status\030\001 \001(\0132\022.google." + + "rpc.Status\022(\n\005delay\030\002 \001(\0132\031.google.proto" + + "buf.Duration\022\026\n\016response_index\030\003 \001(\005:W\352A" + + "T\n)showcase.googleapis.com/StreamingSequ" + + "ence\022\'streamingSequences/{streaming_sequ" + + "ence}\"\322\003\n\027StreamingSequenceReport\022\021\n\004nam" + + "e\030\001 \001(\tB\003\340A\003\022J\n\010attempts\030\002 \003(\01328.google." + + "showcase.v1beta1.StreamingSequenceReport" + + ".Attempt\032\340\001\n\007Attempt\022\026\n\016attempt_number\030\001" + + " \001(\005\0224\n\020attempt_deadline\030\002 \001(\0132\032.google." + + "protobuf.Timestamp\0221\n\rresponse_time\030\003 \001(" + + "\0132\032.google.protobuf.Timestamp\0220\n\rattempt" + + "_delay\030\004 \001(\0132\031.google.protobuf.Duration\022" + + "\"\n\006status\030\005 \001(\0132\022.google.rpc.Status:u\352Ar" + + "\n/showcase.googleapis.com/StreamingSeque" + + "nceReport\022?streamingSequences/{streaming" + + "_sequence}/streamingSequenceReport\"\233\003\n\016S" + + "equenceReport\022\021\n\004name\030\001 \001(\tB\003\340A\003\022A\n\010atte" + + "mpts\030\002 \003(\0132/.google.showcase.v1beta1.Seq" + + "uenceReport.Attempt\032\340\001\n\007Attempt\022\026\n\016attem" + + "pt_number\030\001 \001(\005\0224\n\020attempt_deadline\030\002 \001(" + + "\0132\032.google.protobuf.Timestamp\0221\n\rrespons" + + "e_time\030\003 \001(\0132\032.google.protobuf.Timestamp" + + "\0220\n\rattempt_delay\030\004 \001(\0132\031.google.protobu" + + "f.Duration\022\"\n\006status\030\005 \001(\0132\022.google.rpc." + + "Status:P\352AM\n&showcase.googleapis.com/Seq" + + "uenceReport\022#sequences/{sequence}/sequen" + + "ceReport\"L\n\025CreateSequenceRequest\0223\n\010seq" + + "uence\030\001 \001(\0132!.google.showcase.v1beta1.Se" + + "quence\"h\n\036CreateStreamingSequenceRequest" + + "\022F\n\022streaming_sequence\030\001 \001(\0132*.google.sh" + + "owcase.v1beta1.StreamingSequence\"P\n\026Atte" + + "mptSequenceRequest\0226\n\004name\030\001 \001(\tB(\372A\"\n s" + + "howcase.googleapis.com/Sequence\340A\002\"\200\001\n\037A" + + "ttemptStreamingSequenceRequest\022?\n\004name\030\001" + + " \001(\tB1\372A+\n)showcase.googleapis.com/Strea" + + "mingSequence\340A\002\022\034\n\017last_fail_index\030\002 \001(\005" + + "B\003\340A\001\"3\n AttemptStreamingSequenceRespons" + + "e\022\017\n\007content\030\001 \001(\t\"X\n\030GetSequenceReportR" + + "equest\022<\n\004name\030\001 \001(\tB.\372A(\n&showcase.goog" + + "leapis.com/SequenceReport\340A\002\"j\n!GetStrea" + + "mingSequenceReportRequest\022E\n\004name\030\001 \001(\tB" + + "7\372A1\n/showcase.googleapis.com/StreamingS" + + "equenceReport\340A\0022\360\010\n\017SequenceService\022\224\001\n" + + "\016CreateSequence\022..google.showcase.v1beta" + + "1.CreateSequenceRequest\032!.google.showcas" + + "e.v1beta1.Sequence\"/\202\323\344\223\002\036\"\022/v1beta1/seq" + + "uences:\010sequence\332A\010sequence\022\314\001\n\027CreateSt" + + "reamingSequence\0227.google.showcase.v1beta" + + "1.CreateStreamingSequenceRequest\032*.googl" + + "e.showcase.v1beta1.StreamingSequence\"L\202\323" + + "\344\223\0021\"\033/v1beta1/streamingSequences:\022strea" + + "ming_sequence\332A\022streaming_sequence\022\252\001\n\021G" + + "etSequenceReport\0221.google.showcase.v1bet" + + "a1.GetSequenceReportRequest\032\'.google.sho" + + "wcase.v1beta1.SequenceReport\"9\202\323\344\223\002,\022*/v" + + "1beta1/{name=sequences/*/sequenceReport}" + + "\332A\004name\022\327\001\n\032GetStreamingSequenceReport\022:" + + ".google.showcase.v1beta1.GetStreamingSeq" + + "uenceReportRequest\0320.google.showcase.v1b" + + "eta1.StreamingSequenceReport\"K\202\323\344\223\002>\022 builder) { + super(builder); + } + + private SequenceReport() { + name_ = ""; + attempts_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new SequenceReport(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private SequenceReport( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + break; + } + case 18: + { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + attempts_ = + new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + attempts_.add( + input.readMessage( + com.google.showcase.v1beta1.SequenceReport.Attempt.parser(), + extensionRegistry)); + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + attempts_ = java.util.Collections.unmodifiableList(attempts_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.SequenceOuterClass + .internal_static_google_showcase_v1beta1_SequenceReport_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.SequenceOuterClass + .internal_static_google_showcase_v1beta1_SequenceReport_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.SequenceReport.class, + com.google.showcase.v1beta1.SequenceReport.Builder.class); + } + + public interface AttemptOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.SequenceReport.Attempt) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
        +     * The attempt number - starting at 0.
        +     * 
        + * + * int32 attempt_number = 1; + * + * @return The attemptNumber. + */ + int getAttemptNumber(); + + /** + * + * + *
        +     * The deadline dictated by the attempt to the server.
        +     * 
        + * + * .google.protobuf.Timestamp attempt_deadline = 2; + * + * @return Whether the attemptDeadline field is set. + */ + boolean hasAttemptDeadline(); + + /** + * + * + *
        +     * The deadline dictated by the attempt to the server.
        +     * 
        + * + * .google.protobuf.Timestamp attempt_deadline = 2; + * + * @return The attemptDeadline. + */ + com.google.protobuf.Timestamp getAttemptDeadline(); + + /** + * + * + *
        +     * The deadline dictated by the attempt to the server.
        +     * 
        + * + * .google.protobuf.Timestamp attempt_deadline = 2; + */ + com.google.protobuf.TimestampOrBuilder getAttemptDeadlineOrBuilder(); + + /** + * + * + *
        +     * The time that the server responded to the RPC attempt. Used for
        +     * calculating attempt_delay.
        +     * 
        + * + * .google.protobuf.Timestamp response_time = 3; + * + * @return Whether the responseTime field is set. + */ + boolean hasResponseTime(); + + /** + * + * + *
        +     * The time that the server responded to the RPC attempt. Used for
        +     * calculating attempt_delay.
        +     * 
        + * + * .google.protobuf.Timestamp response_time = 3; + * + * @return The responseTime. + */ + com.google.protobuf.Timestamp getResponseTime(); + + /** + * + * + *
        +     * The time that the server responded to the RPC attempt. Used for
        +     * calculating attempt_delay.
        +     * 
        + * + * .google.protobuf.Timestamp response_time = 3; + */ + com.google.protobuf.TimestampOrBuilder getResponseTimeOrBuilder(); + + /** + * + * + *
        +     * The server perceived delay between sending the last response and
        +     * receiving this attempt. Used for validating attempt delay backoff.
        +     * 
        + * + * .google.protobuf.Duration attempt_delay = 4; + * + * @return Whether the attemptDelay field is set. + */ + boolean hasAttemptDelay(); + + /** + * + * + *
        +     * The server perceived delay between sending the last response and
        +     * receiving this attempt. Used for validating attempt delay backoff.
        +     * 
        + * + * .google.protobuf.Duration attempt_delay = 4; + * + * @return The attemptDelay. + */ + com.google.protobuf.Duration getAttemptDelay(); + + /** + * + * + *
        +     * The server perceived delay between sending the last response and
        +     * receiving this attempt. Used for validating attempt delay backoff.
        +     * 
        + * + * .google.protobuf.Duration attempt_delay = 4; + */ + com.google.protobuf.DurationOrBuilder getAttemptDelayOrBuilder(); + + /** + * + * + *
        +     * The status returned to the attempt.
        +     * 
        + * + * .google.rpc.Status status = 5; + * + * @return Whether the status field is set. + */ + boolean hasStatus(); + + /** + * + * + *
        +     * The status returned to the attempt.
        +     * 
        + * + * .google.rpc.Status status = 5; + * + * @return The status. + */ + com.google.rpc.Status getStatus(); + + /** + * + * + *
        +     * The status returned to the attempt.
        +     * 
        + * + * .google.rpc.Status status = 5; + */ + com.google.rpc.StatusOrBuilder getStatusOrBuilder(); + } + + /** + * + * + *
        +   * Contains metrics on individual RPC Attempts in a sequence.
        +   * 
        + * + * Protobuf type {@code google.showcase.v1beta1.SequenceReport.Attempt} + */ + public static final class Attempt extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.SequenceReport.Attempt) + AttemptOrBuilder { + private static final long serialVersionUID = 0L; + + // Use Attempt.newBuilder() to construct. + private Attempt(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Attempt() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Attempt(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private Attempt( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: + { + attemptNumber_ = input.readInt32(); + break; + } + case 18: + { + com.google.protobuf.Timestamp.Builder subBuilder = null; + if (attemptDeadline_ != null) { + subBuilder = attemptDeadline_.toBuilder(); + } + attemptDeadline_ = + input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(attemptDeadline_); + attemptDeadline_ = subBuilder.buildPartial(); + } + + break; + } + case 26: + { + com.google.protobuf.Timestamp.Builder subBuilder = null; + if (responseTime_ != null) { + subBuilder = responseTime_.toBuilder(); + } + responseTime_ = + input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(responseTime_); + responseTime_ = subBuilder.buildPartial(); + } + + break; + } + case 34: + { + com.google.protobuf.Duration.Builder subBuilder = null; + if (attemptDelay_ != null) { + subBuilder = attemptDelay_.toBuilder(); + } + attemptDelay_ = + input.readMessage(com.google.protobuf.Duration.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(attemptDelay_); + attemptDelay_ = subBuilder.buildPartial(); + } + + break; + } + case 42: + { + com.google.rpc.Status.Builder subBuilder = null; + if (status_ != null) { + subBuilder = status_.toBuilder(); + } + status_ = input.readMessage(com.google.rpc.Status.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(status_); + status_ = subBuilder.buildPartial(); + } + + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.SequenceOuterClass + .internal_static_google_showcase_v1beta1_SequenceReport_Attempt_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.SequenceOuterClass + .internal_static_google_showcase_v1beta1_SequenceReport_Attempt_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.SequenceReport.Attempt.class, + com.google.showcase.v1beta1.SequenceReport.Attempt.Builder.class); + } + + public static final int ATTEMPT_NUMBER_FIELD_NUMBER = 1; + private int attemptNumber_; + + /** + * + * + *
        +     * The attempt number - starting at 0.
        +     * 
        + * + * int32 attempt_number = 1; + * + * @return The attemptNumber. + */ + @java.lang.Override + public int getAttemptNumber() { + return attemptNumber_; + } + + public static final int ATTEMPT_DEADLINE_FIELD_NUMBER = 2; + private com.google.protobuf.Timestamp attemptDeadline_; + + /** + * + * + *
        +     * The deadline dictated by the attempt to the server.
        +     * 
        + * + * .google.protobuf.Timestamp attempt_deadline = 2; + * + * @return Whether the attemptDeadline field is set. + */ + @java.lang.Override + public boolean hasAttemptDeadline() { + return attemptDeadline_ != null; + } + + /** + * + * + *
        +     * The deadline dictated by the attempt to the server.
        +     * 
        + * + * .google.protobuf.Timestamp attempt_deadline = 2; + * + * @return The attemptDeadline. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getAttemptDeadline() { + return attemptDeadline_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : attemptDeadline_; + } + + /** + * + * + *
        +     * The deadline dictated by the attempt to the server.
        +     * 
        + * + * .google.protobuf.Timestamp attempt_deadline = 2; + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getAttemptDeadlineOrBuilder() { + return getAttemptDeadline(); + } + + public static final int RESPONSE_TIME_FIELD_NUMBER = 3; + private com.google.protobuf.Timestamp responseTime_; + + /** + * + * + *
        +     * The time that the server responded to the RPC attempt. Used for
        +     * calculating attempt_delay.
        +     * 
        + * + * .google.protobuf.Timestamp response_time = 3; + * + * @return Whether the responseTime field is set. + */ + @java.lang.Override + public boolean hasResponseTime() { + return responseTime_ != null; + } + + /** + * + * + *
        +     * The time that the server responded to the RPC attempt. Used for
        +     * calculating attempt_delay.
        +     * 
        + * + * .google.protobuf.Timestamp response_time = 3; + * + * @return The responseTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getResponseTime() { + return responseTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : responseTime_; + } + + /** + * + * + *
        +     * The time that the server responded to the RPC attempt. Used for
        +     * calculating attempt_delay.
        +     * 
        + * + * .google.protobuf.Timestamp response_time = 3; + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getResponseTimeOrBuilder() { + return getResponseTime(); + } + + public static final int ATTEMPT_DELAY_FIELD_NUMBER = 4; + private com.google.protobuf.Duration attemptDelay_; + + /** + * + * + *
        +     * The server perceived delay between sending the last response and
        +     * receiving this attempt. Used for validating attempt delay backoff.
        +     * 
        + * + * .google.protobuf.Duration attempt_delay = 4; + * + * @return Whether the attemptDelay field is set. + */ + @java.lang.Override + public boolean hasAttemptDelay() { + return attemptDelay_ != null; + } + + /** + * + * + *
        +     * The server perceived delay between sending the last response and
        +     * receiving this attempt. Used for validating attempt delay backoff.
        +     * 
        + * + * .google.protobuf.Duration attempt_delay = 4; + * + * @return The attemptDelay. + */ + @java.lang.Override + public com.google.protobuf.Duration getAttemptDelay() { + return attemptDelay_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : attemptDelay_; + } + + /** + * + * + *
        +     * The server perceived delay between sending the last response and
        +     * receiving this attempt. Used for validating attempt delay backoff.
        +     * 
        + * + * .google.protobuf.Duration attempt_delay = 4; + */ + @java.lang.Override + public com.google.protobuf.DurationOrBuilder getAttemptDelayOrBuilder() { + return getAttemptDelay(); + } + + public static final int STATUS_FIELD_NUMBER = 5; + private com.google.rpc.Status status_; + + /** + * + * + *
        +     * The status returned to the attempt.
        +     * 
        + * + * .google.rpc.Status status = 5; + * + * @return Whether the status field is set. + */ + @java.lang.Override + public boolean hasStatus() { + return status_ != null; + } + + /** + * + * + *
        +     * The status returned to the attempt.
        +     * 
        + * + * .google.rpc.Status status = 5; + * + * @return The status. + */ + @java.lang.Override + public com.google.rpc.Status getStatus() { + return status_ == null ? com.google.rpc.Status.getDefaultInstance() : status_; + } + + /** + * + * + *
        +     * The status returned to the attempt.
        +     * 
        + * + * .google.rpc.Status status = 5; + */ + @java.lang.Override + public com.google.rpc.StatusOrBuilder getStatusOrBuilder() { + return getStatus(); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (attemptNumber_ != 0) { + output.writeInt32(1, attemptNumber_); + } + if (attemptDeadline_ != null) { + output.writeMessage(2, getAttemptDeadline()); + } + if (responseTime_ != null) { + output.writeMessage(3, getResponseTime()); + } + if (attemptDelay_ != null) { + output.writeMessage(4, getAttemptDelay()); + } + if (status_ != null) { + output.writeMessage(5, getStatus()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (attemptNumber_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(1, attemptNumber_); + } + if (attemptDeadline_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getAttemptDeadline()); + } + if (responseTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getResponseTime()); + } + if (attemptDelay_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, getAttemptDelay()); + } + if (status_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(5, getStatus()); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.showcase.v1beta1.SequenceReport.Attempt)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.SequenceReport.Attempt other = + (com.google.showcase.v1beta1.SequenceReport.Attempt) obj; + + if (getAttemptNumber() != other.getAttemptNumber()) return false; + if (hasAttemptDeadline() != other.hasAttemptDeadline()) return false; + if (hasAttemptDeadline()) { + if (!getAttemptDeadline().equals(other.getAttemptDeadline())) return false; + } + if (hasResponseTime() != other.hasResponseTime()) return false; + if (hasResponseTime()) { + if (!getResponseTime().equals(other.getResponseTime())) return false; + } + if (hasAttemptDelay() != other.hasAttemptDelay()) return false; + if (hasAttemptDelay()) { + if (!getAttemptDelay().equals(other.getAttemptDelay())) return false; + } + if (hasStatus() != other.hasStatus()) return false; + if (hasStatus()) { + if (!getStatus().equals(other.getStatus())) return false; + } + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + ATTEMPT_NUMBER_FIELD_NUMBER; + hash = (53 * hash) + getAttemptNumber(); + if (hasAttemptDeadline()) { + hash = (37 * hash) + ATTEMPT_DEADLINE_FIELD_NUMBER; + hash = (53 * hash) + getAttemptDeadline().hashCode(); + } + if (hasResponseTime()) { + hash = (37 * hash) + RESPONSE_TIME_FIELD_NUMBER; + hash = (53 * hash) + getResponseTime().hashCode(); + } + if (hasAttemptDelay()) { + hash = (37 * hash) + ATTEMPT_DELAY_FIELD_NUMBER; + hash = (53 * hash) + getAttemptDelay().hashCode(); + } + if (hasStatus()) { + hash = (37 * hash) + STATUS_FIELD_NUMBER; + hash = (53 * hash) + getStatus().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.showcase.v1beta1.SequenceReport.Attempt parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.SequenceReport.Attempt parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.SequenceReport.Attempt parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.SequenceReport.Attempt 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.showcase.v1beta1.SequenceReport.Attempt parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.SequenceReport.Attempt parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.SequenceReport.Attempt parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.SequenceReport.Attempt 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.showcase.v1beta1.SequenceReport.Attempt parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.SequenceReport.Attempt 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.showcase.v1beta1.SequenceReport.Attempt parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.SequenceReport.Attempt 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.showcase.v1beta1.SequenceReport.Attempt prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
        +     * Contains metrics on individual RPC Attempts in a sequence.
        +     * 
        + * + * Protobuf type {@code google.showcase.v1beta1.SequenceReport.Attempt} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.SequenceReport.Attempt) + com.google.showcase.v1beta1.SequenceReport.AttemptOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.SequenceOuterClass + .internal_static_google_showcase_v1beta1_SequenceReport_Attempt_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.SequenceOuterClass + .internal_static_google_showcase_v1beta1_SequenceReport_Attempt_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.SequenceReport.Attempt.class, + com.google.showcase.v1beta1.SequenceReport.Attempt.Builder.class); + } + + // Construct using com.google.showcase.v1beta1.SequenceReport.Attempt.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + attemptNumber_ = 0; + + if (attemptDeadlineBuilder_ == null) { + attemptDeadline_ = null; + } else { + attemptDeadline_ = null; + attemptDeadlineBuilder_ = null; + } + if (responseTimeBuilder_ == null) { + responseTime_ = null; + } else { + responseTime_ = null; + responseTimeBuilder_ = null; + } + if (attemptDelayBuilder_ == null) { + attemptDelay_ = null; + } else { + attemptDelay_ = null; + attemptDelayBuilder_ = null; + } + if (statusBuilder_ == null) { + status_ = null; + } else { + status_ = null; + statusBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.showcase.v1beta1.SequenceOuterClass + .internal_static_google_showcase_v1beta1_SequenceReport_Attempt_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.SequenceReport.Attempt getDefaultInstanceForType() { + return com.google.showcase.v1beta1.SequenceReport.Attempt.getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.SequenceReport.Attempt build() { + com.google.showcase.v1beta1.SequenceReport.Attempt result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.SequenceReport.Attempt buildPartial() { + com.google.showcase.v1beta1.SequenceReport.Attempt result = + new com.google.showcase.v1beta1.SequenceReport.Attempt(this); + result.attemptNumber_ = attemptNumber_; + if (attemptDeadlineBuilder_ == null) { + result.attemptDeadline_ = attemptDeadline_; + } else { + result.attemptDeadline_ = attemptDeadlineBuilder_.build(); + } + if (responseTimeBuilder_ == null) { + result.responseTime_ = responseTime_; + } else { + result.responseTime_ = responseTimeBuilder_.build(); + } + if (attemptDelayBuilder_ == null) { + result.attemptDelay_ = attemptDelay_; + } else { + result.attemptDelay_ = attemptDelayBuilder_.build(); + } + if (statusBuilder_ == null) { + result.status_ = status_; + } else { + result.status_ = statusBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, + java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.showcase.v1beta1.SequenceReport.Attempt) { + return mergeFrom((com.google.showcase.v1beta1.SequenceReport.Attempt) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.showcase.v1beta1.SequenceReport.Attempt other) { + if (other == com.google.showcase.v1beta1.SequenceReport.Attempt.getDefaultInstance()) + return this; + if (other.getAttemptNumber() != 0) { + setAttemptNumber(other.getAttemptNumber()); + } + if (other.hasAttemptDeadline()) { + mergeAttemptDeadline(other.getAttemptDeadline()); + } + if (other.hasResponseTime()) { + mergeResponseTime(other.getResponseTime()); + } + if (other.hasAttemptDelay()) { + mergeAttemptDelay(other.getAttemptDelay()); + } + if (other.hasStatus()) { + mergeStatus(other.getStatus()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.showcase.v1beta1.SequenceReport.Attempt parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.showcase.v1beta1.SequenceReport.Attempt) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int attemptNumber_; + + /** + * + * + *
        +       * The attempt number - starting at 0.
        +       * 
        + * + * int32 attempt_number = 1; + * + * @return The attemptNumber. + */ + @java.lang.Override + public int getAttemptNumber() { + return attemptNumber_; + } + + /** + * + * + *
        +       * The attempt number - starting at 0.
        +       * 
        + * + * int32 attempt_number = 1; + * + * @param value The attemptNumber to set. + * @return This builder for chaining. + */ + public Builder setAttemptNumber(int value) { + + attemptNumber_ = value; + onChanged(); + return this; + } + + /** + * + * + *
        +       * The attempt number - starting at 0.
        +       * 
        + * + * int32 attempt_number = 1; + * + * @return This builder for chaining. + */ + public Builder clearAttemptNumber() { + + attemptNumber_ = 0; + onChanged(); + return this; + } + + private com.google.protobuf.Timestamp attemptDeadline_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + attemptDeadlineBuilder_; + + /** + * + * + *
        +       * The deadline dictated by the attempt to the server.
        +       * 
        + * + * .google.protobuf.Timestamp attempt_deadline = 2; + * + * @return Whether the attemptDeadline field is set. + */ + public boolean hasAttemptDeadline() { + return attemptDeadlineBuilder_ != null || attemptDeadline_ != null; + } + + /** + * + * + *
        +       * The deadline dictated by the attempt to the server.
        +       * 
        + * + * .google.protobuf.Timestamp attempt_deadline = 2; + * + * @return The attemptDeadline. + */ + public com.google.protobuf.Timestamp getAttemptDeadline() { + if (attemptDeadlineBuilder_ == null) { + return attemptDeadline_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : attemptDeadline_; + } else { + return attemptDeadlineBuilder_.getMessage(); + } + } + + /** + * + * + *
        +       * The deadline dictated by the attempt to the server.
        +       * 
        + * + * .google.protobuf.Timestamp attempt_deadline = 2; + */ + public Builder setAttemptDeadline(com.google.protobuf.Timestamp value) { + if (attemptDeadlineBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + attemptDeadline_ = value; + onChanged(); + } else { + attemptDeadlineBuilder_.setMessage(value); + } + + return this; + } + + /** + * + * + *
        +       * The deadline dictated by the attempt to the server.
        +       * 
        + * + * .google.protobuf.Timestamp attempt_deadline = 2; + */ + public Builder setAttemptDeadline(com.google.protobuf.Timestamp.Builder builderForValue) { + if (attemptDeadlineBuilder_ == null) { + attemptDeadline_ = builderForValue.build(); + onChanged(); + } else { + attemptDeadlineBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + + /** + * + * + *
        +       * The deadline dictated by the attempt to the server.
        +       * 
        + * + * .google.protobuf.Timestamp attempt_deadline = 2; + */ + public Builder mergeAttemptDeadline(com.google.protobuf.Timestamp value) { + if (attemptDeadlineBuilder_ == null) { + if (attemptDeadline_ != null) { + attemptDeadline_ = + com.google.protobuf.Timestamp.newBuilder(attemptDeadline_) + .mergeFrom(value) + .buildPartial(); + } else { + attemptDeadline_ = value; + } + onChanged(); + } else { + attemptDeadlineBuilder_.mergeFrom(value); + } + + return this; + } + + /** + * + * + *
        +       * The deadline dictated by the attempt to the server.
        +       * 
        + * + * .google.protobuf.Timestamp attempt_deadline = 2; + */ + public Builder clearAttemptDeadline() { + if (attemptDeadlineBuilder_ == null) { + attemptDeadline_ = null; + onChanged(); + } else { + attemptDeadline_ = null; + attemptDeadlineBuilder_ = null; + } + + return this; + } + + /** + * + * + *
        +       * The deadline dictated by the attempt to the server.
        +       * 
        + * + * .google.protobuf.Timestamp attempt_deadline = 2; + */ + public com.google.protobuf.Timestamp.Builder getAttemptDeadlineBuilder() { + + onChanged(); + return getAttemptDeadlineFieldBuilder().getBuilder(); + } + + /** + * + * + *
        +       * The deadline dictated by the attempt to the server.
        +       * 
        + * + * .google.protobuf.Timestamp attempt_deadline = 2; + */ + public com.google.protobuf.TimestampOrBuilder getAttemptDeadlineOrBuilder() { + if (attemptDeadlineBuilder_ != null) { + return attemptDeadlineBuilder_.getMessageOrBuilder(); + } else { + return attemptDeadline_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : attemptDeadline_; + } + } + + /** + * + * + *
        +       * The deadline dictated by the attempt to the server.
        +       * 
        + * + * .google.protobuf.Timestamp attempt_deadline = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getAttemptDeadlineFieldBuilder() { + if (attemptDeadlineBuilder_ == null) { + attemptDeadlineBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getAttemptDeadline(), getParentForChildren(), isClean()); + attemptDeadline_ = null; + } + return attemptDeadlineBuilder_; + } + + private com.google.protobuf.Timestamp responseTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + responseTimeBuilder_; + + /** + * + * + *
        +       * The time that the server responded to the RPC attempt. Used for
        +       * calculating attempt_delay.
        +       * 
        + * + * .google.protobuf.Timestamp response_time = 3; + * + * @return Whether the responseTime field is set. + */ + public boolean hasResponseTime() { + return responseTimeBuilder_ != null || responseTime_ != null; + } + + /** + * + * + *
        +       * The time that the server responded to the RPC attempt. Used for
        +       * calculating attempt_delay.
        +       * 
        + * + * .google.protobuf.Timestamp response_time = 3; + * + * @return The responseTime. + */ + public com.google.protobuf.Timestamp getResponseTime() { + if (responseTimeBuilder_ == null) { + return responseTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : responseTime_; + } else { + return responseTimeBuilder_.getMessage(); + } + } + + /** + * + * + *
        +       * The time that the server responded to the RPC attempt. Used for
        +       * calculating attempt_delay.
        +       * 
        + * + * .google.protobuf.Timestamp response_time = 3; + */ + public Builder setResponseTime(com.google.protobuf.Timestamp value) { + if (responseTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + responseTime_ = value; + onChanged(); + } else { + responseTimeBuilder_.setMessage(value); + } + + return this; + } + + /** + * + * + *
        +       * The time that the server responded to the RPC attempt. Used for
        +       * calculating attempt_delay.
        +       * 
        + * + * .google.protobuf.Timestamp response_time = 3; + */ + public Builder setResponseTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (responseTimeBuilder_ == null) { + responseTime_ = builderForValue.build(); + onChanged(); + } else { + responseTimeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + + /** + * + * + *
        +       * The time that the server responded to the RPC attempt. Used for
        +       * calculating attempt_delay.
        +       * 
        + * + * .google.protobuf.Timestamp response_time = 3; + */ + public Builder mergeResponseTime(com.google.protobuf.Timestamp value) { + if (responseTimeBuilder_ == null) { + if (responseTime_ != null) { + responseTime_ = + com.google.protobuf.Timestamp.newBuilder(responseTime_) + .mergeFrom(value) + .buildPartial(); + } else { + responseTime_ = value; + } + onChanged(); + } else { + responseTimeBuilder_.mergeFrom(value); + } + + return this; + } + + /** + * + * + *
        +       * The time that the server responded to the RPC attempt. Used for
        +       * calculating attempt_delay.
        +       * 
        + * + * .google.protobuf.Timestamp response_time = 3; + */ + public Builder clearResponseTime() { + if (responseTimeBuilder_ == null) { + responseTime_ = null; + onChanged(); + } else { + responseTime_ = null; + responseTimeBuilder_ = null; + } + + return this; + } + + /** + * + * + *
        +       * The time that the server responded to the RPC attempt. Used for
        +       * calculating attempt_delay.
        +       * 
        + * + * .google.protobuf.Timestamp response_time = 3; + */ + public com.google.protobuf.Timestamp.Builder getResponseTimeBuilder() { + + onChanged(); + return getResponseTimeFieldBuilder().getBuilder(); + } + + /** + * + * + *
        +       * The time that the server responded to the RPC attempt. Used for
        +       * calculating attempt_delay.
        +       * 
        + * + * .google.protobuf.Timestamp response_time = 3; + */ + public com.google.protobuf.TimestampOrBuilder getResponseTimeOrBuilder() { + if (responseTimeBuilder_ != null) { + return responseTimeBuilder_.getMessageOrBuilder(); + } else { + return responseTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : responseTime_; + } + } + + /** + * + * + *
        +       * The time that the server responded to the RPC attempt. Used for
        +       * calculating attempt_delay.
        +       * 
        + * + * .google.protobuf.Timestamp response_time = 3; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getResponseTimeFieldBuilder() { + if (responseTimeBuilder_ == null) { + responseTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getResponseTime(), getParentForChildren(), isClean()); + responseTime_ = null; + } + return responseTimeBuilder_; + } + + private com.google.protobuf.Duration attemptDelay_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder> + attemptDelayBuilder_; + + /** + * + * + *
        +       * The server perceived delay between sending the last response and
        +       * receiving this attempt. Used for validating attempt delay backoff.
        +       * 
        + * + * .google.protobuf.Duration attempt_delay = 4; + * + * @return Whether the attemptDelay field is set. + */ + public boolean hasAttemptDelay() { + return attemptDelayBuilder_ != null || attemptDelay_ != null; + } + + /** + * + * + *
        +       * The server perceived delay between sending the last response and
        +       * receiving this attempt. Used for validating attempt delay backoff.
        +       * 
        + * + * .google.protobuf.Duration attempt_delay = 4; + * + * @return The attemptDelay. + */ + public com.google.protobuf.Duration getAttemptDelay() { + if (attemptDelayBuilder_ == null) { + return attemptDelay_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : attemptDelay_; + } else { + return attemptDelayBuilder_.getMessage(); + } + } + + /** + * + * + *
        +       * The server perceived delay between sending the last response and
        +       * receiving this attempt. Used for validating attempt delay backoff.
        +       * 
        + * + * .google.protobuf.Duration attempt_delay = 4; + */ + public Builder setAttemptDelay(com.google.protobuf.Duration value) { + if (attemptDelayBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + attemptDelay_ = value; + onChanged(); + } else { + attemptDelayBuilder_.setMessage(value); + } + + return this; + } + + /** + * + * + *
        +       * The server perceived delay between sending the last response and
        +       * receiving this attempt. Used for validating attempt delay backoff.
        +       * 
        + * + * .google.protobuf.Duration attempt_delay = 4; + */ + public Builder setAttemptDelay(com.google.protobuf.Duration.Builder builderForValue) { + if (attemptDelayBuilder_ == null) { + attemptDelay_ = builderForValue.build(); + onChanged(); + } else { + attemptDelayBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + + /** + * + * + *
        +       * The server perceived delay between sending the last response and
        +       * receiving this attempt. Used for validating attempt delay backoff.
        +       * 
        + * + * .google.protobuf.Duration attempt_delay = 4; + */ + public Builder mergeAttemptDelay(com.google.protobuf.Duration value) { + if (attemptDelayBuilder_ == null) { + if (attemptDelay_ != null) { + attemptDelay_ = + com.google.protobuf.Duration.newBuilder(attemptDelay_) + .mergeFrom(value) + .buildPartial(); + } else { + attemptDelay_ = value; + } + onChanged(); + } else { + attemptDelayBuilder_.mergeFrom(value); + } + + return this; + } + + /** + * + * + *
        +       * The server perceived delay between sending the last response and
        +       * receiving this attempt. Used for validating attempt delay backoff.
        +       * 
        + * + * .google.protobuf.Duration attempt_delay = 4; + */ + public Builder clearAttemptDelay() { + if (attemptDelayBuilder_ == null) { + attemptDelay_ = null; + onChanged(); + } else { + attemptDelay_ = null; + attemptDelayBuilder_ = null; + } + + return this; + } + + /** + * + * + *
        +       * The server perceived delay between sending the last response and
        +       * receiving this attempt. Used for validating attempt delay backoff.
        +       * 
        + * + * .google.protobuf.Duration attempt_delay = 4; + */ + public com.google.protobuf.Duration.Builder getAttemptDelayBuilder() { + + onChanged(); + return getAttemptDelayFieldBuilder().getBuilder(); + } + + /** + * + * + *
        +       * The server perceived delay between sending the last response and
        +       * receiving this attempt. Used for validating attempt delay backoff.
        +       * 
        + * + * .google.protobuf.Duration attempt_delay = 4; + */ + public com.google.protobuf.DurationOrBuilder getAttemptDelayOrBuilder() { + if (attemptDelayBuilder_ != null) { + return attemptDelayBuilder_.getMessageOrBuilder(); + } else { + return attemptDelay_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : attemptDelay_; + } + } + + /** + * + * + *
        +       * The server perceived delay between sending the last response and
        +       * receiving this attempt. Used for validating attempt delay backoff.
        +       * 
        + * + * .google.protobuf.Duration attempt_delay = 4; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder> + getAttemptDelayFieldBuilder() { + if (attemptDelayBuilder_ == null) { + attemptDelayBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder>( + getAttemptDelay(), getParentForChildren(), isClean()); + attemptDelay_ = null; + } + return attemptDelayBuilder_; + } + + private com.google.rpc.Status status_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.rpc.Status, com.google.rpc.Status.Builder, com.google.rpc.StatusOrBuilder> + statusBuilder_; + + /** + * + * + *
        +       * The status returned to the attempt.
        +       * 
        + * + * .google.rpc.Status status = 5; + * + * @return Whether the status field is set. + */ + public boolean hasStatus() { + return statusBuilder_ != null || status_ != null; + } + + /** + * + * + *
        +       * The status returned to the attempt.
        +       * 
        + * + * .google.rpc.Status status = 5; + * + * @return The status. + */ + public com.google.rpc.Status getStatus() { + if (statusBuilder_ == null) { + return status_ == null ? com.google.rpc.Status.getDefaultInstance() : status_; + } else { + return statusBuilder_.getMessage(); + } + } + + /** + * + * + *
        +       * The status returned to the attempt.
        +       * 
        + * + * .google.rpc.Status status = 5; + */ + public Builder setStatus(com.google.rpc.Status value) { + if (statusBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + status_ = value; + onChanged(); + } else { + statusBuilder_.setMessage(value); + } + + return this; + } + + /** + * + * + *
        +       * The status returned to the attempt.
        +       * 
        + * + * .google.rpc.Status status = 5; + */ + public Builder setStatus(com.google.rpc.Status.Builder builderForValue) { + if (statusBuilder_ == null) { + status_ = builderForValue.build(); + onChanged(); + } else { + statusBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + + /** + * + * + *
        +       * The status returned to the attempt.
        +       * 
        + * + * .google.rpc.Status status = 5; + */ + public Builder mergeStatus(com.google.rpc.Status value) { + if (statusBuilder_ == null) { + if (status_ != null) { + status_ = com.google.rpc.Status.newBuilder(status_).mergeFrom(value).buildPartial(); + } else { + status_ = value; + } + onChanged(); + } else { + statusBuilder_.mergeFrom(value); + } + + return this; + } + + /** + * + * + *
        +       * The status returned to the attempt.
        +       * 
        + * + * .google.rpc.Status status = 5; + */ + public Builder clearStatus() { + if (statusBuilder_ == null) { + status_ = null; + onChanged(); + } else { + status_ = null; + statusBuilder_ = null; + } + + return this; + } + + /** + * + * + *
        +       * The status returned to the attempt.
        +       * 
        + * + * .google.rpc.Status status = 5; + */ + public com.google.rpc.Status.Builder getStatusBuilder() { + + onChanged(); + return getStatusFieldBuilder().getBuilder(); + } + + /** + * + * + *
        +       * The status returned to the attempt.
        +       * 
        + * + * .google.rpc.Status status = 5; + */ + public com.google.rpc.StatusOrBuilder getStatusOrBuilder() { + if (statusBuilder_ != null) { + return statusBuilder_.getMessageOrBuilder(); + } else { + return status_ == null ? com.google.rpc.Status.getDefaultInstance() : status_; + } + } + + /** + * + * + *
        +       * The status returned to the attempt.
        +       * 
        + * + * .google.rpc.Status status = 5; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.rpc.Status, com.google.rpc.Status.Builder, com.google.rpc.StatusOrBuilder> + getStatusFieldBuilder() { + if (statusBuilder_ == null) { + statusBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.rpc.Status, + com.google.rpc.Status.Builder, + com.google.rpc.StatusOrBuilder>(getStatus(), getParentForChildren(), isClean()); + status_ = null; + } + return statusBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.showcase.v1beta1.SequenceReport.Attempt) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.SequenceReport.Attempt) + private static final com.google.showcase.v1beta1.SequenceReport.Attempt DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.SequenceReport.Attempt(); + } + + public static com.google.showcase.v1beta1.SequenceReport.Attempt getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Attempt parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Attempt(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.showcase.v1beta1.SequenceReport.Attempt getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + + /** + * 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; + } + } + + /** + * 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 ATTEMPTS_FIELD_NUMBER = 2; + private java.util.List attempts_; + + /** + * + * + *
        +   * The set of RPC attempts received by the server for a Sequence.
        +   * 
        + * + * repeated .google.showcase.v1beta1.SequenceReport.Attempt attempts = 2; + */ + @java.lang.Override + public java.util.List getAttemptsList() { + return attempts_; + } + + /** + * + * + *
        +   * The set of RPC attempts received by the server for a Sequence.
        +   * 
        + * + * repeated .google.showcase.v1beta1.SequenceReport.Attempt attempts = 2; + */ + @java.lang.Override + public java.util.List + getAttemptsOrBuilderList() { + return attempts_; + } + + /** + * + * + *
        +   * The set of RPC attempts received by the server for a Sequence.
        +   * 
        + * + * repeated .google.showcase.v1beta1.SequenceReport.Attempt attempts = 2; + */ + @java.lang.Override + public int getAttemptsCount() { + return attempts_.size(); + } + + /** + * + * + *
        +   * The set of RPC attempts received by the server for a Sequence.
        +   * 
        + * + * repeated .google.showcase.v1beta1.SequenceReport.Attempt attempts = 2; + */ + @java.lang.Override + public com.google.showcase.v1beta1.SequenceReport.Attempt getAttempts(int index) { + return attempts_.get(index); + } + + /** + * + * + *
        +   * The set of RPC attempts received by the server for a Sequence.
        +   * 
        + * + * repeated .google.showcase.v1beta1.SequenceReport.Attempt attempts = 2; + */ + @java.lang.Override + public com.google.showcase.v1beta1.SequenceReport.AttemptOrBuilder getAttemptsOrBuilder( + int index) { + return attempts_.get(index); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + for (int i = 0; i < attempts_.size(); i++) { + output.writeMessage(2, attempts_.get(i)); + } + unknownFields.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_); + } + for (int i = 0; i < attempts_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, attempts_.get(i)); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.showcase.v1beta1.SequenceReport)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.SequenceReport other = + (com.google.showcase.v1beta1.SequenceReport) obj; + + if (!getName().equals(other.getName())) return false; + if (!getAttemptsList().equals(other.getAttemptsList())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + if (getAttemptsCount() > 0) { + hash = (37 * hash) + ATTEMPTS_FIELD_NUMBER; + hash = (53 * hash) + getAttemptsList().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.showcase.v1beta1.SequenceReport parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.SequenceReport parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.SequenceReport parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.SequenceReport 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.showcase.v1beta1.SequenceReport parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.SequenceReport parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.SequenceReport parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.SequenceReport 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.showcase.v1beta1.SequenceReport parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.SequenceReport 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.showcase.v1beta1.SequenceReport parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.SequenceReport 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.showcase.v1beta1.SequenceReport prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** Protobuf type {@code google.showcase.v1beta1.SequenceReport} */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.SequenceReport) + com.google.showcase.v1beta1.SequenceReportOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.SequenceOuterClass + .internal_static_google_showcase_v1beta1_SequenceReport_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.SequenceOuterClass + .internal_static_google_showcase_v1beta1_SequenceReport_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.SequenceReport.class, + com.google.showcase.v1beta1.SequenceReport.Builder.class); + } + + // Construct using com.google.showcase.v1beta1.SequenceReport.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getAttemptsFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + if (attemptsBuilder_ == null) { + attempts_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + attemptsBuilder_.clear(); + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.showcase.v1beta1.SequenceOuterClass + .internal_static_google_showcase_v1beta1_SequenceReport_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.SequenceReport getDefaultInstanceForType() { + return com.google.showcase.v1beta1.SequenceReport.getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.SequenceReport build() { + com.google.showcase.v1beta1.SequenceReport result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.SequenceReport buildPartial() { + com.google.showcase.v1beta1.SequenceReport result = + new com.google.showcase.v1beta1.SequenceReport(this); + int from_bitField0_ = bitField0_; + result.name_ = name_; + if (attemptsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + attempts_ = java.util.Collections.unmodifiableList(attempts_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.attempts_ = attempts_; + } else { + result.attempts_ = attemptsBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.showcase.v1beta1.SequenceReport) { + return mergeFrom((com.google.showcase.v1beta1.SequenceReport) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.showcase.v1beta1.SequenceReport other) { + if (other == com.google.showcase.v1beta1.SequenceReport.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + if (attemptsBuilder_ == null) { + if (!other.attempts_.isEmpty()) { + if (attempts_.isEmpty()) { + attempts_ = other.attempts_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureAttemptsIsMutable(); + attempts_.addAll(other.attempts_); + } + onChanged(); + } + } else { + if (!other.attempts_.isEmpty()) { + if (attemptsBuilder_.isEmpty()) { + attemptsBuilder_.dispose(); + attemptsBuilder_ = null; + attempts_ = other.attempts_; + bitField0_ = (bitField0_ & ~0x00000001); + attemptsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getAttemptsFieldBuilder() + : null; + } else { + attemptsBuilder_.addAllMessages(other.attempts_); + } + } + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.showcase.v1beta1.SequenceReport parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.showcase.v1beta1.SequenceReport) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + + /** + * 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; + } + } + + /** + * 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; + } + } + + /** + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + + /** + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + + /** + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + + private java.util.List attempts_ = + java.util.Collections.emptyList(); + + private void ensureAttemptsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + attempts_ = + new java.util.ArrayList(attempts_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.showcase.v1beta1.SequenceReport.Attempt, + com.google.showcase.v1beta1.SequenceReport.Attempt.Builder, + com.google.showcase.v1beta1.SequenceReport.AttemptOrBuilder> + attemptsBuilder_; + + /** + * + * + *
        +     * The set of RPC attempts received by the server for a Sequence.
        +     * 
        + * + * repeated .google.showcase.v1beta1.SequenceReport.Attempt attempts = 2; + */ + public java.util.List getAttemptsList() { + if (attemptsBuilder_ == null) { + return java.util.Collections.unmodifiableList(attempts_); + } else { + return attemptsBuilder_.getMessageList(); + } + } + + /** + * + * + *
        +     * The set of RPC attempts received by the server for a Sequence.
        +     * 
        + * + * repeated .google.showcase.v1beta1.SequenceReport.Attempt attempts = 2; + */ + public int getAttemptsCount() { + if (attemptsBuilder_ == null) { + return attempts_.size(); + } else { + return attemptsBuilder_.getCount(); + } + } + + /** + * + * + *
        +     * The set of RPC attempts received by the server for a Sequence.
        +     * 
        + * + * repeated .google.showcase.v1beta1.SequenceReport.Attempt attempts = 2; + */ + public com.google.showcase.v1beta1.SequenceReport.Attempt getAttempts(int index) { + if (attemptsBuilder_ == null) { + return attempts_.get(index); + } else { + return attemptsBuilder_.getMessage(index); + } + } + + /** + * + * + *
        +     * The set of RPC attempts received by the server for a Sequence.
        +     * 
        + * + * repeated .google.showcase.v1beta1.SequenceReport.Attempt attempts = 2; + */ + public Builder setAttempts( + int index, com.google.showcase.v1beta1.SequenceReport.Attempt value) { + if (attemptsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureAttemptsIsMutable(); + attempts_.set(index, value); + onChanged(); + } else { + attemptsBuilder_.setMessage(index, value); + } + return this; + } + + /** + * + * + *
        +     * The set of RPC attempts received by the server for a Sequence.
        +     * 
        + * + * repeated .google.showcase.v1beta1.SequenceReport.Attempt attempts = 2; + */ + public Builder setAttempts( + int index, com.google.showcase.v1beta1.SequenceReport.Attempt.Builder builderForValue) { + if (attemptsBuilder_ == null) { + ensureAttemptsIsMutable(); + attempts_.set(index, builderForValue.build()); + onChanged(); + } else { + attemptsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
        +     * The set of RPC attempts received by the server for a Sequence.
        +     * 
        + * + * repeated .google.showcase.v1beta1.SequenceReport.Attempt attempts = 2; + */ + public Builder addAttempts(com.google.showcase.v1beta1.SequenceReport.Attempt value) { + if (attemptsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureAttemptsIsMutable(); + attempts_.add(value); + onChanged(); + } else { + attemptsBuilder_.addMessage(value); + } + return this; + } + + /** + * + * + *
        +     * The set of RPC attempts received by the server for a Sequence.
        +     * 
        + * + * repeated .google.showcase.v1beta1.SequenceReport.Attempt attempts = 2; + */ + public Builder addAttempts( + int index, com.google.showcase.v1beta1.SequenceReport.Attempt value) { + if (attemptsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureAttemptsIsMutable(); + attempts_.add(index, value); + onChanged(); + } else { + attemptsBuilder_.addMessage(index, value); + } + return this; + } + + /** + * + * + *
        +     * The set of RPC attempts received by the server for a Sequence.
        +     * 
        + * + * repeated .google.showcase.v1beta1.SequenceReport.Attempt attempts = 2; + */ + public Builder addAttempts( + com.google.showcase.v1beta1.SequenceReport.Attempt.Builder builderForValue) { + if (attemptsBuilder_ == null) { + ensureAttemptsIsMutable(); + attempts_.add(builderForValue.build()); + onChanged(); + } else { + attemptsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + + /** + * + * + *
        +     * The set of RPC attempts received by the server for a Sequence.
        +     * 
        + * + * repeated .google.showcase.v1beta1.SequenceReport.Attempt attempts = 2; + */ + public Builder addAttempts( + int index, com.google.showcase.v1beta1.SequenceReport.Attempt.Builder builderForValue) { + if (attemptsBuilder_ == null) { + ensureAttemptsIsMutable(); + attempts_.add(index, builderForValue.build()); + onChanged(); + } else { + attemptsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
        +     * The set of RPC attempts received by the server for a Sequence.
        +     * 
        + * + * repeated .google.showcase.v1beta1.SequenceReport.Attempt attempts = 2; + */ + public Builder addAllAttempts( + java.lang.Iterable values) { + if (attemptsBuilder_ == null) { + ensureAttemptsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, attempts_); + onChanged(); + } else { + attemptsBuilder_.addAllMessages(values); + } + return this; + } + + /** + * + * + *
        +     * The set of RPC attempts received by the server for a Sequence.
        +     * 
        + * + * repeated .google.showcase.v1beta1.SequenceReport.Attempt attempts = 2; + */ + public Builder clearAttempts() { + if (attemptsBuilder_ == null) { + attempts_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + attemptsBuilder_.clear(); + } + return this; + } + + /** + * + * + *
        +     * The set of RPC attempts received by the server for a Sequence.
        +     * 
        + * + * repeated .google.showcase.v1beta1.SequenceReport.Attempt attempts = 2; + */ + public Builder removeAttempts(int index) { + if (attemptsBuilder_ == null) { + ensureAttemptsIsMutable(); + attempts_.remove(index); + onChanged(); + } else { + attemptsBuilder_.remove(index); + } + return this; + } + + /** + * + * + *
        +     * The set of RPC attempts received by the server for a Sequence.
        +     * 
        + * + * repeated .google.showcase.v1beta1.SequenceReport.Attempt attempts = 2; + */ + public com.google.showcase.v1beta1.SequenceReport.Attempt.Builder getAttemptsBuilder( + int index) { + return getAttemptsFieldBuilder().getBuilder(index); + } + + /** + * + * + *
        +     * The set of RPC attempts received by the server for a Sequence.
        +     * 
        + * + * repeated .google.showcase.v1beta1.SequenceReport.Attempt attempts = 2; + */ + public com.google.showcase.v1beta1.SequenceReport.AttemptOrBuilder getAttemptsOrBuilder( + int index) { + if (attemptsBuilder_ == null) { + return attempts_.get(index); + } else { + return attemptsBuilder_.getMessageOrBuilder(index); + } + } + + /** + * + * + *
        +     * The set of RPC attempts received by the server for a Sequence.
        +     * 
        + * + * repeated .google.showcase.v1beta1.SequenceReport.Attempt attempts = 2; + */ + public java.util.List + getAttemptsOrBuilderList() { + if (attemptsBuilder_ != null) { + return attemptsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(attempts_); + } + } + + /** + * + * + *
        +     * The set of RPC attempts received by the server for a Sequence.
        +     * 
        + * + * repeated .google.showcase.v1beta1.SequenceReport.Attempt attempts = 2; + */ + public com.google.showcase.v1beta1.SequenceReport.Attempt.Builder addAttemptsBuilder() { + return getAttemptsFieldBuilder() + .addBuilder(com.google.showcase.v1beta1.SequenceReport.Attempt.getDefaultInstance()); + } + + /** + * + * + *
        +     * The set of RPC attempts received by the server for a Sequence.
        +     * 
        + * + * repeated .google.showcase.v1beta1.SequenceReport.Attempt attempts = 2; + */ + public com.google.showcase.v1beta1.SequenceReport.Attempt.Builder addAttemptsBuilder( + int index) { + return getAttemptsFieldBuilder() + .addBuilder( + index, com.google.showcase.v1beta1.SequenceReport.Attempt.getDefaultInstance()); + } + + /** + * + * + *
        +     * The set of RPC attempts received by the server for a Sequence.
        +     * 
        + * + * repeated .google.showcase.v1beta1.SequenceReport.Attempt attempts = 2; + */ + public java.util.List + getAttemptsBuilderList() { + return getAttemptsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.showcase.v1beta1.SequenceReport.Attempt, + com.google.showcase.v1beta1.SequenceReport.Attempt.Builder, + com.google.showcase.v1beta1.SequenceReport.AttemptOrBuilder> + getAttemptsFieldBuilder() { + if (attemptsBuilder_ == null) { + attemptsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.showcase.v1beta1.SequenceReport.Attempt, + com.google.showcase.v1beta1.SequenceReport.Attempt.Builder, + com.google.showcase.v1beta1.SequenceReport.AttemptOrBuilder>( + attempts_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + attempts_ = null; + } + return attemptsBuilder_; + } + + @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.showcase.v1beta1.SequenceReport) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.SequenceReport) + private static final com.google.showcase.v1beta1.SequenceReport DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.SequenceReport(); + } + + public static com.google.showcase.v1beta1.SequenceReport getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SequenceReport parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new SequenceReport(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.showcase.v1beta1.SequenceReport getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/SequenceReportName.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/SequenceReportName.java new file mode 100644 index 0000000000..8099990181 --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/SequenceReportName.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.showcase.v1beta1; + +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +@Generated("by gapic-generator-java") +public class SequenceReportName implements ResourceName { + private static final PathTemplate SEQUENCE = + PathTemplate.createWithoutUrlEncoding("sequences/{sequence}/sequenceReport"); + private volatile Map fieldValuesMap; + private final String sequence; + + @Deprecated + protected SequenceReportName() { + sequence = null; + } + + private SequenceReportName(Builder builder) { + sequence = Preconditions.checkNotNull(builder.getSequence()); + } + + public String getSequence() { + return sequence; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + public static SequenceReportName of(String sequence) { + return newBuilder().setSequence(sequence).build(); + } + + public static String format(String sequence) { + return newBuilder().setSequence(sequence).build().toString(); + } + + public static SequenceReportName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + SEQUENCE.validatedMatch( + formattedString, "SequenceReportName.parse: formattedString not in valid format"); + return of(matchMap.get("sequence")); + } + + 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 (SequenceReportName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return SEQUENCE.matches(formattedString); + } + + @Override + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + if (sequence != null) { + fieldMapBuilder.put("sequence", sequence); + } + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return SEQUENCE.instantiate("sequence", sequence); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o != null && getClass() == o.getClass()) { + SequenceReportName that = ((SequenceReportName) o); + return Objects.equals(this.sequence, that.sequence); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= Objects.hashCode(sequence); + return h; + } + + /** Builder for sequences/{sequence}/sequenceReport. */ + public static class Builder { + private String sequence; + + protected Builder() {} + + public String getSequence() { + return sequence; + } + + public Builder setSequence(String sequence) { + this.sequence = sequence; + return this; + } + + private Builder(SequenceReportName sequenceReportName) { + this.sequence = sequenceReportName.sequence; + } + + public SequenceReportName build() { + return new SequenceReportName(this); + } + } +} diff --git a/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/SequenceReportOrBuilder.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/SequenceReportOrBuilder.java new file mode 100644 index 0000000000..c1b362d84b --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/SequenceReportOrBuilder.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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/sequence.proto + +package com.google.showcase.v1beta1; + +public interface SequenceReportOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.SequenceReport) + com.google.protobuf.MessageOrBuilder { + + /** + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The name. + */ + java.lang.String getName(); + + /** + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
        +   * The set of RPC attempts received by the server for a Sequence.
        +   * 
        + * + * repeated .google.showcase.v1beta1.SequenceReport.Attempt attempts = 2; + */ + java.util.List getAttemptsList(); + + /** + * + * + *
        +   * The set of RPC attempts received by the server for a Sequence.
        +   * 
        + * + * repeated .google.showcase.v1beta1.SequenceReport.Attempt attempts = 2; + */ + com.google.showcase.v1beta1.SequenceReport.Attempt getAttempts(int index); + + /** + * + * + *
        +   * The set of RPC attempts received by the server for a Sequence.
        +   * 
        + * + * repeated .google.showcase.v1beta1.SequenceReport.Attempt attempts = 2; + */ + int getAttemptsCount(); + + /** + * + * + *
        +   * The set of RPC attempts received by the server for a Sequence.
        +   * 
        + * + * repeated .google.showcase.v1beta1.SequenceReport.Attempt attempts = 2; + */ + java.util.List + getAttemptsOrBuilderList(); + + /** + * + * + *
        +   * The set of RPC attempts received by the server for a Sequence.
        +   * 
        + * + * repeated .google.showcase.v1beta1.SequenceReport.Attempt attempts = 2; + */ + com.google.showcase.v1beta1.SequenceReport.AttemptOrBuilder getAttemptsOrBuilder(int index); +} diff --git a/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/Session.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/Session.java new file mode 100644 index 0000000000..3e91b808df --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/Session.java @@ -0,0 +1,973 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/testing.proto + +package com.google.showcase.v1beta1; + +/** + * + * + *
        + * A session is a suite of tests, generally being made in the context
        + * of testing code generation.
        + * A session defines tests it may expect, based on which version of the
        + * code generation spec is in use.
        + * 
        + * + * Protobuf type {@code google.showcase.v1beta1.Session} + */ +public final class Session extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.Session) + SessionOrBuilder { + private static final long serialVersionUID = 0L; + + // Use Session.newBuilder() to construct. + private Session(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Session() { + name_ = ""; + version_ = 0; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Session(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private Session( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + break; + } + case 16: + { + int rawValue = input.readEnum(); + + version_ = rawValue; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.TestingOuterClass + .internal_static_google_showcase_v1beta1_Session_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.TestingOuterClass + .internal_static_google_showcase_v1beta1_Session_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.Session.class, + com.google.showcase.v1beta1.Session.Builder.class); + } + + /** + * + * + *
        +   * The specification versions understood by Showcase.
        +   * 
        + * + * Protobuf enum {@code google.showcase.v1beta1.Session.Version} + */ + public enum Version implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
        +     * Unspecified version. If passed on creation, the session will default
        +     * to using the latest stable release.
        +     * 
        + * + * VERSION_UNSPECIFIED = 0; + */ + VERSION_UNSPECIFIED(0), + /** + * + * + *
        +     * The latest v1. Currently, this is v1.0.
        +     * 
        + * + * V1_LATEST = 1; + */ + V1_LATEST(1), + /** + * + * + *
        +     * v1.0. (Until the spec is "GA", this will be a moving target.)
        +     * 
        + * + * V1_0 = 2; + */ + V1_0(2), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
        +     * Unspecified version. If passed on creation, the session will default
        +     * to using the latest stable release.
        +     * 
        + * + * VERSION_UNSPECIFIED = 0; + */ + public static final int VERSION_UNSPECIFIED_VALUE = 0; + + /** + * + * + *
        +     * The latest v1. Currently, this is v1.0.
        +     * 
        + * + * V1_LATEST = 1; + */ + public static final int V1_LATEST_VALUE = 1; + + /** + * + * + *
        +     * v1.0. (Until the spec is "GA", this will be a moving target.)
        +     * 
        + * + * V1_0 = 2; + */ + public static final int V1_0_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 Version 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 Version forNumber(int value) { + switch (value) { + case 0: + return VERSION_UNSPECIFIED; + case 1: + return V1_LATEST; + case 2: + return V1_0; + 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 Version findValueByNumber(int number) { + return Version.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.showcase.v1beta1.Session.getDescriptor().getEnumTypes().get(0); + } + + private static final Version[] VALUES = values(); + + public static Version 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 Version(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.showcase.v1beta1.Session.Version) + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + + /** + * + * + *
        +   * The name of the session. The ID must conform to ^[a-z]+$
        +   * If this is not provided, Showcase chooses one at random.
        +   * 
        + * + * 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 name of the session. The ID must conform to ^[a-z]+$
        +   * If this is not provided, Showcase chooses one at random.
        +   * 
        + * + * 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 VERSION_FIELD_NUMBER = 2; + private int version_; + + /** + * + * + *
        +   * Required. The version this session is using.
        +   * 
        + * + * .google.showcase.v1beta1.Session.Version version = 2; + * + * @return The enum numeric value on the wire for version. + */ + @java.lang.Override + public int getVersionValue() { + return version_; + } + + /** + * + * + *
        +   * Required. The version this session is using.
        +   * 
        + * + * .google.showcase.v1beta1.Session.Version version = 2; + * + * @return The version. + */ + @java.lang.Override + public com.google.showcase.v1beta1.Session.Version getVersion() { + @SuppressWarnings("deprecation") + com.google.showcase.v1beta1.Session.Version result = + com.google.showcase.v1beta1.Session.Version.valueOf(version_); + return result == null ? com.google.showcase.v1beta1.Session.Version.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 (version_ != com.google.showcase.v1beta1.Session.Version.VERSION_UNSPECIFIED.getNumber()) { + output.writeEnum(2, version_); + } + unknownFields.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 (version_ != com.google.showcase.v1beta1.Session.Version.VERSION_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(2, version_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.showcase.v1beta1.Session)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.Session other = (com.google.showcase.v1beta1.Session) obj; + + if (!getName().equals(other.getName())) return false; + if (version_ != other.version_) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (37 * hash) + VERSION_FIELD_NUMBER; + hash = (53 * hash) + version_; + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.showcase.v1beta1.Session parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.Session parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.Session parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.Session 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.showcase.v1beta1.Session parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.Session parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.Session parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.Session 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.showcase.v1beta1.Session parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.Session 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.showcase.v1beta1.Session parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.Session 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.showcase.v1beta1.Session prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
        +   * A session is a suite of tests, generally being made in the context
        +   * of testing code generation.
        +   * A session defines tests it may expect, based on which version of the
        +   * code generation spec is in use.
        +   * 
        + * + * Protobuf type {@code google.showcase.v1beta1.Session} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.Session) + com.google.showcase.v1beta1.SessionOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.TestingOuterClass + .internal_static_google_showcase_v1beta1_Session_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.TestingOuterClass + .internal_static_google_showcase_v1beta1_Session_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.Session.class, + com.google.showcase.v1beta1.Session.Builder.class); + } + + // Construct using com.google.showcase.v1beta1.Session.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + version_ = 0; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.showcase.v1beta1.TestingOuterClass + .internal_static_google_showcase_v1beta1_Session_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.Session getDefaultInstanceForType() { + return com.google.showcase.v1beta1.Session.getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.Session build() { + com.google.showcase.v1beta1.Session result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.Session buildPartial() { + com.google.showcase.v1beta1.Session result = new com.google.showcase.v1beta1.Session(this); + result.name_ = name_; + result.version_ = version_; + 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.showcase.v1beta1.Session) { + return mergeFrom((com.google.showcase.v1beta1.Session) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.showcase.v1beta1.Session other) { + if (other == com.google.showcase.v1beta1.Session.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + if (other.version_ != 0) { + setVersionValue(other.getVersionValue()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.showcase.v1beta1.Session parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.showcase.v1beta1.Session) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + + /** + * + * + *
        +     * The name of the session. The ID must conform to ^[a-z]+$
        +     * If this is not provided, Showcase chooses one at random.
        +     * 
        + * + * 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 name of the session. The ID must conform to ^[a-z]+$
        +     * If this is not provided, Showcase chooses one at random.
        +     * 
        + * + * 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 name of the session. The ID must conform to ^[a-z]+$
        +     * If this is not provided, Showcase chooses one at random.
        +     * 
        + * + * string name = 1; + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + + /** + * + * + *
        +     * The name of the session. The ID must conform to ^[a-z]+$
        +     * If this is not provided, Showcase chooses one at random.
        +     * 
        + * + * string name = 1; + * + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + + /** + * + * + *
        +     * The name of the session. The ID must conform to ^[a-z]+$
        +     * If this is not provided, Showcase chooses one at random.
        +     * 
        + * + * string name = 1; + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + + private int version_ = 0; + + /** + * + * + *
        +     * Required. The version this session is using.
        +     * 
        + * + * .google.showcase.v1beta1.Session.Version version = 2; + * + * @return The enum numeric value on the wire for version. + */ + @java.lang.Override + public int getVersionValue() { + return version_; + } + + /** + * + * + *
        +     * Required. The version this session is using.
        +     * 
        + * + * .google.showcase.v1beta1.Session.Version version = 2; + * + * @param value The enum numeric value on the wire for version to set. + * @return This builder for chaining. + */ + public Builder setVersionValue(int value) { + + version_ = value; + onChanged(); + return this; + } + + /** + * + * + *
        +     * Required. The version this session is using.
        +     * 
        + * + * .google.showcase.v1beta1.Session.Version version = 2; + * + * @return The version. + */ + @java.lang.Override + public com.google.showcase.v1beta1.Session.Version getVersion() { + @SuppressWarnings("deprecation") + com.google.showcase.v1beta1.Session.Version result = + com.google.showcase.v1beta1.Session.Version.valueOf(version_); + return result == null ? com.google.showcase.v1beta1.Session.Version.UNRECOGNIZED : result; + } + + /** + * + * + *
        +     * Required. The version this session is using.
        +     * 
        + * + * .google.showcase.v1beta1.Session.Version version = 2; + * + * @param value The version to set. + * @return This builder for chaining. + */ + public Builder setVersion(com.google.showcase.v1beta1.Session.Version value) { + if (value == null) { + throw new NullPointerException(); + } + + version_ = value.getNumber(); + onChanged(); + return this; + } + + /** + * + * + *
        +     * Required. The version this session is using.
        +     * 
        + * + * .google.showcase.v1beta1.Session.Version version = 2; + * + * @return This builder for chaining. + */ + public Builder clearVersion() { + + 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.showcase.v1beta1.Session) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.Session) + private static final com.google.showcase.v1beta1.Session DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.Session(); + } + + public static com.google.showcase.v1beta1.Session getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Session parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Session(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.showcase.v1beta1.Session getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/SessionName.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/SessionName.java new file mode 100644 index 0000000000..b081a0cbfc --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/SessionName.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.showcase.v1beta1; + +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +@Generated("by gapic-generator-java") +public class SessionName implements ResourceName { + private static final PathTemplate SESSION = + PathTemplate.createWithoutUrlEncoding("sessions/{session}"); + private volatile Map fieldValuesMap; + private final String session; + + @Deprecated + protected SessionName() { + session = null; + } + + private SessionName(Builder builder) { + session = Preconditions.checkNotNull(builder.getSession()); + } + + public String getSession() { + return session; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + public static SessionName of(String session) { + return newBuilder().setSession(session).build(); + } + + public static String format(String session) { + return newBuilder().setSession(session).build().toString(); + } + + public static SessionName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + SESSION.validatedMatch( + formattedString, "SessionName.parse: formattedString not in valid format"); + return of(matchMap.get("session")); + } + + 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 (SessionName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return SESSION.matches(formattedString); + } + + @Override + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + if (session != null) { + fieldMapBuilder.put("session", session); + } + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return SESSION.instantiate("session", session); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o != null && getClass() == o.getClass()) { + SessionName that = ((SessionName) o); + return Objects.equals(this.session, that.session); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= Objects.hashCode(session); + return h; + } + + /** Builder for sessions/{session}. */ + public static class Builder { + private String session; + + protected Builder() {} + + public String getSession() { + return session; + } + + public Builder setSession(String session) { + this.session = session; + return this; + } + + private Builder(SessionName sessionName) { + this.session = sessionName.session; + } + + public SessionName build() { + return new SessionName(this); + } + } +} diff --git a/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/SessionOrBuilder.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/SessionOrBuilder.java new file mode 100644 index 0000000000..395bec0425 --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/SessionOrBuilder.java @@ -0,0 +1,79 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/testing.proto + +package com.google.showcase.v1beta1; + +public interface SessionOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.Session) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
        +   * The name of the session. The ID must conform to ^[a-z]+$
        +   * If this is not provided, Showcase chooses one at random.
        +   * 
        + * + * string name = 1; + * + * @return The name. + */ + java.lang.String getName(); + + /** + * + * + *
        +   * The name of the session. The ID must conform to ^[a-z]+$
        +   * If this is not provided, Showcase chooses one at random.
        +   * 
        + * + * string name = 1; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
        +   * Required. The version this session is using.
        +   * 
        + * + * .google.showcase.v1beta1.Session.Version version = 2; + * + * @return The enum numeric value on the wire for version. + */ + int getVersionValue(); + + /** + * + * + *
        +   * Required. The version this session is using.
        +   * 
        + * + * .google.showcase.v1beta1.Session.Version version = 2; + * + * @return The version. + */ + com.google.showcase.v1beta1.Session.Version getVersion(); +} diff --git a/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/Severity.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/Severity.java new file mode 100644 index 0000000000..968c84bcb3 --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/Severity.java @@ -0,0 +1,137 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/echo.proto + +package com.google.showcase.v1beta1; + +/** + * + * + *
        + * A severity enum used to test enum capabilities in GAPIC surfaces.
        + * 
        + * + * Protobuf enum {@code google.showcase.v1beta1.Severity} + */ +public enum Severity implements com.google.protobuf.ProtocolMessageEnum { + /** UNNECESSARY = 0; */ + UNNECESSARY(0), + /** NECESSARY = 1; */ + NECESSARY(1), + /** URGENT = 2; */ + URGENT(2), + /** CRITICAL = 3; */ + CRITICAL(3), + UNRECOGNIZED(-1), + ; + + /** UNNECESSARY = 0; */ + public static final int UNNECESSARY_VALUE = 0; + + /** NECESSARY = 1; */ + public static final int NECESSARY_VALUE = 1; + + /** URGENT = 2; */ + public static final int URGENT_VALUE = 2; + + /** CRITICAL = 3; */ + public static final int CRITICAL_VALUE = 3; + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static Severity 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 Severity forNumber(int value) { + switch (value) { + case 0: + return UNNECESSARY; + case 1: + return NECESSARY; + case 2: + return URGENT; + case 3: + return CRITICAL; + 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 Severity findValueByNumber(int number) { + return Severity.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.showcase.v1beta1.EchoOuterClass.getDescriptor().getEnumTypes().get(0); + } + + private static final Severity[] VALUES = values(); + + public static Severity 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 Severity(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.showcase.v1beta1.Severity) +} diff --git a/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/StreamBlurbsRequest.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/StreamBlurbsRequest.java new file mode 100644 index 0000000000..8d5621bdc7 --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/StreamBlurbsRequest.java @@ -0,0 +1,958 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/messaging.proto + +package com.google.showcase.v1beta1; + +/** + * + * + *
        + * The request message for the google.showcase.v1beta1.Messaging\StreamBlurbs
        + * method.
        + * 
        + * + * Protobuf type {@code google.showcase.v1beta1.StreamBlurbsRequest} + */ +public final class StreamBlurbsRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.StreamBlurbsRequest) + StreamBlurbsRequestOrBuilder { + private static final long serialVersionUID = 0L; + + // Use StreamBlurbsRequest.newBuilder() to construct. + private StreamBlurbsRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private StreamBlurbsRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new StreamBlurbsRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private StreamBlurbsRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + break; + } + case 18: + { + com.google.protobuf.Timestamp.Builder subBuilder = null; + if (expireTime_ != null) { + subBuilder = expireTime_.toBuilder(); + } + expireTime_ = + input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(expireTime_); + expireTime_ = subBuilder.buildPartial(); + } + + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.MessagingOuterClass + .internal_static_google_showcase_v1beta1_StreamBlurbsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.MessagingOuterClass + .internal_static_google_showcase_v1beta1_StreamBlurbsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.StreamBlurbsRequest.class, + com.google.showcase.v1beta1.StreamBlurbsRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + + /** + * + * + *
        +   * The resource name of a chat room or user profile whose blurbs to stream.
        +   * 
        + * + * + * 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; + } + } + + /** + * + * + *
        +   * The resource name of a chat room or user profile whose blurbs to stream.
        +   * 
        + * + * + * 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 EXPIRE_TIME_FIELD_NUMBER = 2; + private com.google.protobuf.Timestamp expireTime_; + + /** + * + * + *
        +   * The time at which this stream will close.
        +   * 
        + * + * .google.protobuf.Timestamp expire_time = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the expireTime field is set. + */ + @java.lang.Override + public boolean hasExpireTime() { + return expireTime_ != null; + } + + /** + * + * + *
        +   * The time at which this stream will close.
        +   * 
        + * + * .google.protobuf.Timestamp expire_time = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The expireTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getExpireTime() { + return expireTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : expireTime_; + } + + /** + * + * + *
        +   * The time at which this stream will close.
        +   * 
        + * + * .google.protobuf.Timestamp expire_time = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getExpireTimeOrBuilder() { + return getExpireTime(); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + if (expireTime_ != null) { + output.writeMessage(2, getExpireTime()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + if (expireTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getExpireTime()); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.showcase.v1beta1.StreamBlurbsRequest)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.StreamBlurbsRequest other = + (com.google.showcase.v1beta1.StreamBlurbsRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (hasExpireTime() != other.hasExpireTime()) return false; + if (hasExpireTime()) { + if (!getExpireTime().equals(other.getExpireTime())) return false; + } + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + if (hasExpireTime()) { + hash = (37 * hash) + EXPIRE_TIME_FIELD_NUMBER; + hash = (53 * hash) + getExpireTime().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.showcase.v1beta1.StreamBlurbsRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.StreamBlurbsRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.StreamBlurbsRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.StreamBlurbsRequest 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.showcase.v1beta1.StreamBlurbsRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.StreamBlurbsRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.StreamBlurbsRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.StreamBlurbsRequest 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.showcase.v1beta1.StreamBlurbsRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.StreamBlurbsRequest 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.showcase.v1beta1.StreamBlurbsRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.StreamBlurbsRequest 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.showcase.v1beta1.StreamBlurbsRequest 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 request message for the google.showcase.v1beta1.Messaging\StreamBlurbs
        +   * method.
        +   * 
        + * + * Protobuf type {@code google.showcase.v1beta1.StreamBlurbsRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.StreamBlurbsRequest) + com.google.showcase.v1beta1.StreamBlurbsRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.MessagingOuterClass + .internal_static_google_showcase_v1beta1_StreamBlurbsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.MessagingOuterClass + .internal_static_google_showcase_v1beta1_StreamBlurbsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.StreamBlurbsRequest.class, + com.google.showcase.v1beta1.StreamBlurbsRequest.Builder.class); + } + + // Construct using com.google.showcase.v1beta1.StreamBlurbsRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + if (expireTimeBuilder_ == null) { + expireTime_ = null; + } else { + expireTime_ = null; + expireTimeBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.showcase.v1beta1.MessagingOuterClass + .internal_static_google_showcase_v1beta1_StreamBlurbsRequest_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.StreamBlurbsRequest getDefaultInstanceForType() { + return com.google.showcase.v1beta1.StreamBlurbsRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.StreamBlurbsRequest build() { + com.google.showcase.v1beta1.StreamBlurbsRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.StreamBlurbsRequest buildPartial() { + com.google.showcase.v1beta1.StreamBlurbsRequest result = + new com.google.showcase.v1beta1.StreamBlurbsRequest(this); + result.name_ = name_; + if (expireTimeBuilder_ == null) { + result.expireTime_ = expireTime_; + } else { + result.expireTime_ = expireTimeBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.showcase.v1beta1.StreamBlurbsRequest) { + return mergeFrom((com.google.showcase.v1beta1.StreamBlurbsRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.showcase.v1beta1.StreamBlurbsRequest other) { + if (other == com.google.showcase.v1beta1.StreamBlurbsRequest.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + if (other.hasExpireTime()) { + mergeExpireTime(other.getExpireTime()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.showcase.v1beta1.StreamBlurbsRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.showcase.v1beta1.StreamBlurbsRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + + /** + * + * + *
        +     * The resource name of a chat room or user profile whose blurbs to stream.
        +     * 
        + * + * + * 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; + } + } + + /** + * + * + *
        +     * The resource name of a chat room or user profile whose blurbs to stream.
        +     * 
        + * + * + * 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; + } + } + + /** + * + * + *
        +     * The resource name of a chat room or user profile whose blurbs to stream.
        +     * 
        + * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + + /** + * + * + *
        +     * The resource name of a chat room or user profile whose blurbs to stream.
        +     * 
        + * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + + /** + * + * + *
        +     * The resource name of a chat room or user profile whose blurbs to stream.
        +     * 
        + * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + + private com.google.protobuf.Timestamp expireTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + expireTimeBuilder_; + + /** + * + * + *
        +     * The time at which this stream will close.
        +     * 
        + * + * .google.protobuf.Timestamp expire_time = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the expireTime field is set. + */ + public boolean hasExpireTime() { + return expireTimeBuilder_ != null || expireTime_ != null; + } + + /** + * + * + *
        +     * The time at which this stream will close.
        +     * 
        + * + * .google.protobuf.Timestamp expire_time = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The expireTime. + */ + public com.google.protobuf.Timestamp getExpireTime() { + if (expireTimeBuilder_ == null) { + return expireTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : expireTime_; + } else { + return expireTimeBuilder_.getMessage(); + } + } + + /** + * + * + *
        +     * The time at which this stream will close.
        +     * 
        + * + * .google.protobuf.Timestamp expire_time = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setExpireTime(com.google.protobuf.Timestamp value) { + if (expireTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + expireTime_ = value; + onChanged(); + } else { + expireTimeBuilder_.setMessage(value); + } + + return this; + } + + /** + * + * + *
        +     * The time at which this stream will close.
        +     * 
        + * + * .google.protobuf.Timestamp expire_time = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setExpireTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (expireTimeBuilder_ == null) { + expireTime_ = builderForValue.build(); + onChanged(); + } else { + expireTimeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + + /** + * + * + *
        +     * The time at which this stream will close.
        +     * 
        + * + * .google.protobuf.Timestamp expire_time = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeExpireTime(com.google.protobuf.Timestamp value) { + if (expireTimeBuilder_ == null) { + if (expireTime_ != null) { + expireTime_ = + com.google.protobuf.Timestamp.newBuilder(expireTime_).mergeFrom(value).buildPartial(); + } else { + expireTime_ = value; + } + onChanged(); + } else { + expireTimeBuilder_.mergeFrom(value); + } + + return this; + } + + /** + * + * + *
        +     * The time at which this stream will close.
        +     * 
        + * + * .google.protobuf.Timestamp expire_time = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearExpireTime() { + if (expireTimeBuilder_ == null) { + expireTime_ = null; + onChanged(); + } else { + expireTime_ = null; + expireTimeBuilder_ = null; + } + + return this; + } + + /** + * + * + *
        +     * The time at which this stream will close.
        +     * 
        + * + * .google.protobuf.Timestamp expire_time = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.protobuf.Timestamp.Builder getExpireTimeBuilder() { + + onChanged(); + return getExpireTimeFieldBuilder().getBuilder(); + } + + /** + * + * + *
        +     * The time at which this stream will close.
        +     * 
        + * + * .google.protobuf.Timestamp expire_time = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.protobuf.TimestampOrBuilder getExpireTimeOrBuilder() { + if (expireTimeBuilder_ != null) { + return expireTimeBuilder_.getMessageOrBuilder(); + } else { + return expireTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : expireTime_; + } + } + + /** + * + * + *
        +     * The time at which this stream will close.
        +     * 
        + * + * .google.protobuf.Timestamp expire_time = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getExpireTimeFieldBuilder() { + if (expireTimeBuilder_ == null) { + expireTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getExpireTime(), getParentForChildren(), isClean()); + expireTime_ = null; + } + return expireTimeBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.showcase.v1beta1.StreamBlurbsRequest) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.StreamBlurbsRequest) + private static final com.google.showcase.v1beta1.StreamBlurbsRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.StreamBlurbsRequest(); + } + + public static com.google.showcase.v1beta1.StreamBlurbsRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public StreamBlurbsRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new StreamBlurbsRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.showcase.v1beta1.StreamBlurbsRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/StreamBlurbsRequestOrBuilder.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/StreamBlurbsRequestOrBuilder.java new file mode 100644 index 0000000000..12f8efe90a --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/StreamBlurbsRequestOrBuilder.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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/messaging.proto + +package com.google.showcase.v1beta1; + +public interface StreamBlurbsRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.StreamBlurbsRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
        +   * The resource name of a chat room or user profile whose blurbs to stream.
        +   * 
        + * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + + /** + * + * + *
        +   * The resource name of a chat room or user profile whose blurbs to stream.
        +   * 
        + * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
        +   * The time at which this stream will close.
        +   * 
        + * + * .google.protobuf.Timestamp expire_time = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the expireTime field is set. + */ + boolean hasExpireTime(); + + /** + * + * + *
        +   * The time at which this stream will close.
        +   * 
        + * + * .google.protobuf.Timestamp expire_time = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The expireTime. + */ + com.google.protobuf.Timestamp getExpireTime(); + + /** + * + * + *
        +   * The time at which this stream will close.
        +   * 
        + * + * .google.protobuf.Timestamp expire_time = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.protobuf.TimestampOrBuilder getExpireTimeOrBuilder(); +} diff --git a/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/StreamBlurbsResponse.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/StreamBlurbsResponse.java new file mode 100644 index 0000000000..8f7b1931ab --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/StreamBlurbsResponse.java @@ -0,0 +1,1071 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/messaging.proto + +package com.google.showcase.v1beta1; + +/** + * + * + *
        + * The response message for the google.showcase.v1beta1.Messaging\StreamBlurbs
        + * method.
        + * 
        + * + * Protobuf type {@code google.showcase.v1beta1.StreamBlurbsResponse} + */ +public final class StreamBlurbsResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.StreamBlurbsResponse) + StreamBlurbsResponseOrBuilder { + private static final long serialVersionUID = 0L; + + // Use StreamBlurbsResponse.newBuilder() to construct. + private StreamBlurbsResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private StreamBlurbsResponse() { + action_ = 0; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new StreamBlurbsResponse(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private StreamBlurbsResponse( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + com.google.showcase.v1beta1.Blurb.Builder subBuilder = null; + if (blurb_ != null) { + subBuilder = blurb_.toBuilder(); + } + blurb_ = + input.readMessage(com.google.showcase.v1beta1.Blurb.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(blurb_); + blurb_ = subBuilder.buildPartial(); + } + + break; + } + case 16: + { + int rawValue = input.readEnum(); + + action_ = rawValue; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.MessagingOuterClass + .internal_static_google_showcase_v1beta1_StreamBlurbsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.MessagingOuterClass + .internal_static_google_showcase_v1beta1_StreamBlurbsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.StreamBlurbsResponse.class, + com.google.showcase.v1beta1.StreamBlurbsResponse.Builder.class); + } + + /** + * + * + *
        +   * The action that triggered the blurb to be returned.
        +   * 
        + * + * Protobuf enum {@code google.showcase.v1beta1.StreamBlurbsResponse.Action} + */ + public enum Action implements com.google.protobuf.ProtocolMessageEnum { + /** ACTION_UNSPECIFIED = 0; */ + ACTION_UNSPECIFIED(0), + /** + * + * + *
        +     * Specifies that the blurb was created.
        +     * 
        + * + * CREATE = 1; + */ + CREATE(1), + /** + * + * + *
        +     * Specifies that the blurb was updated.
        +     * 
        + * + * UPDATE = 2; + */ + UPDATE(2), + /** + * + * + *
        +     * Specifies that the blurb was deleted.
        +     * 
        + * + * DELETE = 3; + */ + DELETE(3), + UNRECOGNIZED(-1), + ; + + /** ACTION_UNSPECIFIED = 0; */ + public static final int ACTION_UNSPECIFIED_VALUE = 0; + + /** + * + * + *
        +     * Specifies that the blurb was created.
        +     * 
        + * + * CREATE = 1; + */ + public static final int CREATE_VALUE = 1; + + /** + * + * + *
        +     * Specifies that the blurb was updated.
        +     * 
        + * + * UPDATE = 2; + */ + public static final int UPDATE_VALUE = 2; + + /** + * + * + *
        +     * Specifies that the blurb was deleted.
        +     * 
        + * + * DELETE = 3; + */ + public static final int DELETE_VALUE = 3; + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static Action 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 Action forNumber(int value) { + switch (value) { + case 0: + return ACTION_UNSPECIFIED; + case 1: + return CREATE; + case 2: + return UPDATE; + case 3: + return DELETE; + 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 Action findValueByNumber(int number) { + return Action.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.showcase.v1beta1.StreamBlurbsResponse.getDescriptor().getEnumTypes().get(0); + } + + private static final Action[] VALUES = values(); + + public static Action 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 Action(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.showcase.v1beta1.StreamBlurbsResponse.Action) + } + + public static final int BLURB_FIELD_NUMBER = 1; + private com.google.showcase.v1beta1.Blurb blurb_; + + /** + * + * + *
        +   * The blurb that was either created, updated, or deleted.
        +   * 
        + * + * .google.showcase.v1beta1.Blurb blurb = 1; + * + * @return Whether the blurb field is set. + */ + @java.lang.Override + public boolean hasBlurb() { + return blurb_ != null; + } + + /** + * + * + *
        +   * The blurb that was either created, updated, or deleted.
        +   * 
        + * + * .google.showcase.v1beta1.Blurb blurb = 1; + * + * @return The blurb. + */ + @java.lang.Override + public com.google.showcase.v1beta1.Blurb getBlurb() { + return blurb_ == null ? com.google.showcase.v1beta1.Blurb.getDefaultInstance() : blurb_; + } + + /** + * + * + *
        +   * The blurb that was either created, updated, or deleted.
        +   * 
        + * + * .google.showcase.v1beta1.Blurb blurb = 1; + */ + @java.lang.Override + public com.google.showcase.v1beta1.BlurbOrBuilder getBlurbOrBuilder() { + return getBlurb(); + } + + public static final int ACTION_FIELD_NUMBER = 2; + private int action_; + + /** + * + * + *
        +   * The action that triggered the blurb to be returned.
        +   * 
        + * + * .google.showcase.v1beta1.StreamBlurbsResponse.Action action = 2; + * + * @return The enum numeric value on the wire for action. + */ + @java.lang.Override + public int getActionValue() { + return action_; + } + + /** + * + * + *
        +   * The action that triggered the blurb to be returned.
        +   * 
        + * + * .google.showcase.v1beta1.StreamBlurbsResponse.Action action = 2; + * + * @return The action. + */ + @java.lang.Override + public com.google.showcase.v1beta1.StreamBlurbsResponse.Action getAction() { + @SuppressWarnings("deprecation") + com.google.showcase.v1beta1.StreamBlurbsResponse.Action result = + com.google.showcase.v1beta1.StreamBlurbsResponse.Action.valueOf(action_); + return result == null + ? com.google.showcase.v1beta1.StreamBlurbsResponse.Action.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 (blurb_ != null) { + output.writeMessage(1, getBlurb()); + } + if (action_ + != com.google.showcase.v1beta1.StreamBlurbsResponse.Action.ACTION_UNSPECIFIED.getNumber()) { + output.writeEnum(2, action_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (blurb_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getBlurb()); + } + if (action_ + != com.google.showcase.v1beta1.StreamBlurbsResponse.Action.ACTION_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(2, action_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.showcase.v1beta1.StreamBlurbsResponse)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.StreamBlurbsResponse other = + (com.google.showcase.v1beta1.StreamBlurbsResponse) obj; + + if (hasBlurb() != other.hasBlurb()) return false; + if (hasBlurb()) { + if (!getBlurb().equals(other.getBlurb())) return false; + } + if (action_ != other.action_) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasBlurb()) { + hash = (37 * hash) + BLURB_FIELD_NUMBER; + hash = (53 * hash) + getBlurb().hashCode(); + } + hash = (37 * hash) + ACTION_FIELD_NUMBER; + hash = (53 * hash) + action_; + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.showcase.v1beta1.StreamBlurbsResponse parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.StreamBlurbsResponse parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.StreamBlurbsResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.StreamBlurbsResponse 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.showcase.v1beta1.StreamBlurbsResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.StreamBlurbsResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.StreamBlurbsResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.StreamBlurbsResponse 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.showcase.v1beta1.StreamBlurbsResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.StreamBlurbsResponse 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.showcase.v1beta1.StreamBlurbsResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.StreamBlurbsResponse 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.showcase.v1beta1.StreamBlurbsResponse 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 message for the google.showcase.v1beta1.Messaging\StreamBlurbs
        +   * method.
        +   * 
        + * + * Protobuf type {@code google.showcase.v1beta1.StreamBlurbsResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.StreamBlurbsResponse) + com.google.showcase.v1beta1.StreamBlurbsResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.MessagingOuterClass + .internal_static_google_showcase_v1beta1_StreamBlurbsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.MessagingOuterClass + .internal_static_google_showcase_v1beta1_StreamBlurbsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.StreamBlurbsResponse.class, + com.google.showcase.v1beta1.StreamBlurbsResponse.Builder.class); + } + + // Construct using com.google.showcase.v1beta1.StreamBlurbsResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (blurbBuilder_ == null) { + blurb_ = null; + } else { + blurb_ = null; + blurbBuilder_ = null; + } + action_ = 0; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.showcase.v1beta1.MessagingOuterClass + .internal_static_google_showcase_v1beta1_StreamBlurbsResponse_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.StreamBlurbsResponse getDefaultInstanceForType() { + return com.google.showcase.v1beta1.StreamBlurbsResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.StreamBlurbsResponse build() { + com.google.showcase.v1beta1.StreamBlurbsResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.StreamBlurbsResponse buildPartial() { + com.google.showcase.v1beta1.StreamBlurbsResponse result = + new com.google.showcase.v1beta1.StreamBlurbsResponse(this); + if (blurbBuilder_ == null) { + result.blurb_ = blurb_; + } else { + result.blurb_ = blurbBuilder_.build(); + } + result.action_ = action_; + 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.showcase.v1beta1.StreamBlurbsResponse) { + return mergeFrom((com.google.showcase.v1beta1.StreamBlurbsResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.showcase.v1beta1.StreamBlurbsResponse other) { + if (other == com.google.showcase.v1beta1.StreamBlurbsResponse.getDefaultInstance()) + return this; + if (other.hasBlurb()) { + mergeBlurb(other.getBlurb()); + } + if (other.action_ != 0) { + setActionValue(other.getActionValue()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.showcase.v1beta1.StreamBlurbsResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.showcase.v1beta1.StreamBlurbsResponse) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private com.google.showcase.v1beta1.Blurb blurb_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.showcase.v1beta1.Blurb, + com.google.showcase.v1beta1.Blurb.Builder, + com.google.showcase.v1beta1.BlurbOrBuilder> + blurbBuilder_; + + /** + * + * + *
        +     * The blurb that was either created, updated, or deleted.
        +     * 
        + * + * .google.showcase.v1beta1.Blurb blurb = 1; + * + * @return Whether the blurb field is set. + */ + public boolean hasBlurb() { + return blurbBuilder_ != null || blurb_ != null; + } + + /** + * + * + *
        +     * The blurb that was either created, updated, or deleted.
        +     * 
        + * + * .google.showcase.v1beta1.Blurb blurb = 1; + * + * @return The blurb. + */ + public com.google.showcase.v1beta1.Blurb getBlurb() { + if (blurbBuilder_ == null) { + return blurb_ == null ? com.google.showcase.v1beta1.Blurb.getDefaultInstance() : blurb_; + } else { + return blurbBuilder_.getMessage(); + } + } + + /** + * + * + *
        +     * The blurb that was either created, updated, or deleted.
        +     * 
        + * + * .google.showcase.v1beta1.Blurb blurb = 1; + */ + public Builder setBlurb(com.google.showcase.v1beta1.Blurb value) { + if (blurbBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + blurb_ = value; + onChanged(); + } else { + blurbBuilder_.setMessage(value); + } + + return this; + } + + /** + * + * + *
        +     * The blurb that was either created, updated, or deleted.
        +     * 
        + * + * .google.showcase.v1beta1.Blurb blurb = 1; + */ + public Builder setBlurb(com.google.showcase.v1beta1.Blurb.Builder builderForValue) { + if (blurbBuilder_ == null) { + blurb_ = builderForValue.build(); + onChanged(); + } else { + blurbBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + + /** + * + * + *
        +     * The blurb that was either created, updated, or deleted.
        +     * 
        + * + * .google.showcase.v1beta1.Blurb blurb = 1; + */ + public Builder mergeBlurb(com.google.showcase.v1beta1.Blurb value) { + if (blurbBuilder_ == null) { + if (blurb_ != null) { + blurb_ = + com.google.showcase.v1beta1.Blurb.newBuilder(blurb_).mergeFrom(value).buildPartial(); + } else { + blurb_ = value; + } + onChanged(); + } else { + blurbBuilder_.mergeFrom(value); + } + + return this; + } + + /** + * + * + *
        +     * The blurb that was either created, updated, or deleted.
        +     * 
        + * + * .google.showcase.v1beta1.Blurb blurb = 1; + */ + public Builder clearBlurb() { + if (blurbBuilder_ == null) { + blurb_ = null; + onChanged(); + } else { + blurb_ = null; + blurbBuilder_ = null; + } + + return this; + } + + /** + * + * + *
        +     * The blurb that was either created, updated, or deleted.
        +     * 
        + * + * .google.showcase.v1beta1.Blurb blurb = 1; + */ + public com.google.showcase.v1beta1.Blurb.Builder getBlurbBuilder() { + + onChanged(); + return getBlurbFieldBuilder().getBuilder(); + } + + /** + * + * + *
        +     * The blurb that was either created, updated, or deleted.
        +     * 
        + * + * .google.showcase.v1beta1.Blurb blurb = 1; + */ + public com.google.showcase.v1beta1.BlurbOrBuilder getBlurbOrBuilder() { + if (blurbBuilder_ != null) { + return blurbBuilder_.getMessageOrBuilder(); + } else { + return blurb_ == null ? com.google.showcase.v1beta1.Blurb.getDefaultInstance() : blurb_; + } + } + + /** + * + * + *
        +     * The blurb that was either created, updated, or deleted.
        +     * 
        + * + * .google.showcase.v1beta1.Blurb blurb = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.showcase.v1beta1.Blurb, + com.google.showcase.v1beta1.Blurb.Builder, + com.google.showcase.v1beta1.BlurbOrBuilder> + getBlurbFieldBuilder() { + if (blurbBuilder_ == null) { + blurbBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.showcase.v1beta1.Blurb, + com.google.showcase.v1beta1.Blurb.Builder, + com.google.showcase.v1beta1.BlurbOrBuilder>( + getBlurb(), getParentForChildren(), isClean()); + blurb_ = null; + } + return blurbBuilder_; + } + + private int action_ = 0; + + /** + * + * + *
        +     * The action that triggered the blurb to be returned.
        +     * 
        + * + * .google.showcase.v1beta1.StreamBlurbsResponse.Action action = 2; + * + * @return The enum numeric value on the wire for action. + */ + @java.lang.Override + public int getActionValue() { + return action_; + } + + /** + * + * + *
        +     * The action that triggered the blurb to be returned.
        +     * 
        + * + * .google.showcase.v1beta1.StreamBlurbsResponse.Action action = 2; + * + * @param value The enum numeric value on the wire for action to set. + * @return This builder for chaining. + */ + public Builder setActionValue(int value) { + + action_ = value; + onChanged(); + return this; + } + + /** + * + * + *
        +     * The action that triggered the blurb to be returned.
        +     * 
        + * + * .google.showcase.v1beta1.StreamBlurbsResponse.Action action = 2; + * + * @return The action. + */ + @java.lang.Override + public com.google.showcase.v1beta1.StreamBlurbsResponse.Action getAction() { + @SuppressWarnings("deprecation") + com.google.showcase.v1beta1.StreamBlurbsResponse.Action result = + com.google.showcase.v1beta1.StreamBlurbsResponse.Action.valueOf(action_); + return result == null + ? com.google.showcase.v1beta1.StreamBlurbsResponse.Action.UNRECOGNIZED + : result; + } + + /** + * + * + *
        +     * The action that triggered the blurb to be returned.
        +     * 
        + * + * .google.showcase.v1beta1.StreamBlurbsResponse.Action action = 2; + * + * @param value The action to set. + * @return This builder for chaining. + */ + public Builder setAction(com.google.showcase.v1beta1.StreamBlurbsResponse.Action value) { + if (value == null) { + throw new NullPointerException(); + } + + action_ = value.getNumber(); + onChanged(); + return this; + } + + /** + * + * + *
        +     * The action that triggered the blurb to be returned.
        +     * 
        + * + * .google.showcase.v1beta1.StreamBlurbsResponse.Action action = 2; + * + * @return This builder for chaining. + */ + public Builder clearAction() { + + action_ = 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.showcase.v1beta1.StreamBlurbsResponse) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.StreamBlurbsResponse) + private static final com.google.showcase.v1beta1.StreamBlurbsResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.StreamBlurbsResponse(); + } + + public static com.google.showcase.v1beta1.StreamBlurbsResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public StreamBlurbsResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new StreamBlurbsResponse(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.showcase.v1beta1.StreamBlurbsResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/StreamBlurbsResponseOrBuilder.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/StreamBlurbsResponseOrBuilder.java new file mode 100644 index 0000000000..44652ad61d --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/StreamBlurbsResponseOrBuilder.java @@ -0,0 +1,88 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/messaging.proto + +package com.google.showcase.v1beta1; + +public interface StreamBlurbsResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.StreamBlurbsResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
        +   * The blurb that was either created, updated, or deleted.
        +   * 
        + * + * .google.showcase.v1beta1.Blurb blurb = 1; + * + * @return Whether the blurb field is set. + */ + boolean hasBlurb(); + + /** + * + * + *
        +   * The blurb that was either created, updated, or deleted.
        +   * 
        + * + * .google.showcase.v1beta1.Blurb blurb = 1; + * + * @return The blurb. + */ + com.google.showcase.v1beta1.Blurb getBlurb(); + + /** + * + * + *
        +   * The blurb that was either created, updated, or deleted.
        +   * 
        + * + * .google.showcase.v1beta1.Blurb blurb = 1; + */ + com.google.showcase.v1beta1.BlurbOrBuilder getBlurbOrBuilder(); + + /** + * + * + *
        +   * The action that triggered the blurb to be returned.
        +   * 
        + * + * .google.showcase.v1beta1.StreamBlurbsResponse.Action action = 2; + * + * @return The enum numeric value on the wire for action. + */ + int getActionValue(); + + /** + * + * + *
        +   * The action that triggered the blurb to be returned.
        +   * 
        + * + * .google.showcase.v1beta1.StreamBlurbsResponse.Action action = 2; + * + * @return The action. + */ + com.google.showcase.v1beta1.StreamBlurbsResponse.Action getAction(); +} diff --git a/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/StreamingSequence.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/StreamingSequence.java new file mode 100644 index 0000000000..bc9352c6eb --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/StreamingSequence.java @@ -0,0 +1,2512 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/sequence.proto + +package com.google.showcase.v1beta1; + +/** Protobuf type {@code google.showcase.v1beta1.StreamingSequence} */ +public final class StreamingSequence extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.StreamingSequence) + StreamingSequenceOrBuilder { + private static final long serialVersionUID = 0L; + + // Use StreamingSequence.newBuilder() to construct. + private StreamingSequence(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private StreamingSequence() { + name_ = ""; + content_ = ""; + responses_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new StreamingSequence(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private StreamingSequence( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + content_ = s; + break; + } + case 26: + { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + responses_ = + new java.util.ArrayList< + com.google.showcase.v1beta1.StreamingSequence.Response>(); + mutable_bitField0_ |= 0x00000001; + } + responses_.add( + input.readMessage( + com.google.showcase.v1beta1.StreamingSequence.Response.parser(), + extensionRegistry)); + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + responses_ = java.util.Collections.unmodifiableList(responses_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.SequenceOuterClass + .internal_static_google_showcase_v1beta1_StreamingSequence_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.SequenceOuterClass + .internal_static_google_showcase_v1beta1_StreamingSequence_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.StreamingSequence.class, + com.google.showcase.v1beta1.StreamingSequence.Builder.class); + } + + public interface ResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.StreamingSequence.Response) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
        +     * The status to return for an individual attempt.
        +     * 
        + * + * .google.rpc.Status status = 1; + * + * @return Whether the status field is set. + */ + boolean hasStatus(); + + /** + * + * + *
        +     * The status to return for an individual attempt.
        +     * 
        + * + * .google.rpc.Status status = 1; + * + * @return The status. + */ + com.google.rpc.Status getStatus(); + + /** + * + * + *
        +     * The status to return for an individual attempt.
        +     * 
        + * + * .google.rpc.Status status = 1; + */ + com.google.rpc.StatusOrBuilder getStatusOrBuilder(); + + /** + * + * + *
        +     * The amount of time to delay sending the response.
        +     * 
        + * + * .google.protobuf.Duration delay = 2; + * + * @return Whether the delay field is set. + */ + boolean hasDelay(); + + /** + * + * + *
        +     * The amount of time to delay sending the response.
        +     * 
        + * + * .google.protobuf.Duration delay = 2; + * + * @return The delay. + */ + com.google.protobuf.Duration getDelay(); + + /** + * + * + *
        +     * The amount of time to delay sending the response.
        +     * 
        + * + * .google.protobuf.Duration delay = 2; + */ + com.google.protobuf.DurationOrBuilder getDelayOrBuilder(); + + /** + * + * + *
        +     * The index that the status should be sent
        +     * 
        + * + * int32 response_index = 3; + * + * @return The responseIndex. + */ + int getResponseIndex(); + } + + /** + * + * + *
        +   * A server response to an RPC Attempt in a sequence.
        +   * 
        + * + * Protobuf type {@code google.showcase.v1beta1.StreamingSequence.Response} + */ + public static final class Response extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.StreamingSequence.Response) + ResponseOrBuilder { + private static final long serialVersionUID = 0L; + + // Use Response.newBuilder() to construct. + private Response(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Response() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Response(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private Response( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + com.google.rpc.Status.Builder subBuilder = null; + if (status_ != null) { + subBuilder = status_.toBuilder(); + } + status_ = input.readMessage(com.google.rpc.Status.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(status_); + status_ = subBuilder.buildPartial(); + } + + break; + } + case 18: + { + com.google.protobuf.Duration.Builder subBuilder = null; + if (delay_ != null) { + subBuilder = delay_.toBuilder(); + } + delay_ = + input.readMessage(com.google.protobuf.Duration.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(delay_); + delay_ = subBuilder.buildPartial(); + } + + break; + } + case 24: + { + responseIndex_ = input.readInt32(); + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.SequenceOuterClass + .internal_static_google_showcase_v1beta1_StreamingSequence_Response_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.SequenceOuterClass + .internal_static_google_showcase_v1beta1_StreamingSequence_Response_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.StreamingSequence.Response.class, + com.google.showcase.v1beta1.StreamingSequence.Response.Builder.class); + } + + public static final int STATUS_FIELD_NUMBER = 1; + private com.google.rpc.Status status_; + + /** + * + * + *
        +     * The status to return for an individual attempt.
        +     * 
        + * + * .google.rpc.Status status = 1; + * + * @return Whether the status field is set. + */ + @java.lang.Override + public boolean hasStatus() { + return status_ != null; + } + + /** + * + * + *
        +     * The status to return for an individual attempt.
        +     * 
        + * + * .google.rpc.Status status = 1; + * + * @return The status. + */ + @java.lang.Override + public com.google.rpc.Status getStatus() { + return status_ == null ? com.google.rpc.Status.getDefaultInstance() : status_; + } + + /** + * + * + *
        +     * The status to return for an individual attempt.
        +     * 
        + * + * .google.rpc.Status status = 1; + */ + @java.lang.Override + public com.google.rpc.StatusOrBuilder getStatusOrBuilder() { + return getStatus(); + } + + public static final int DELAY_FIELD_NUMBER = 2; + private com.google.protobuf.Duration delay_; + + /** + * + * + *
        +     * The amount of time to delay sending the response.
        +     * 
        + * + * .google.protobuf.Duration delay = 2; + * + * @return Whether the delay field is set. + */ + @java.lang.Override + public boolean hasDelay() { + return delay_ != null; + } + + /** + * + * + *
        +     * The amount of time to delay sending the response.
        +     * 
        + * + * .google.protobuf.Duration delay = 2; + * + * @return The delay. + */ + @java.lang.Override + public com.google.protobuf.Duration getDelay() { + return delay_ == null ? com.google.protobuf.Duration.getDefaultInstance() : delay_; + } + + /** + * + * + *
        +     * The amount of time to delay sending the response.
        +     * 
        + * + * .google.protobuf.Duration delay = 2; + */ + @java.lang.Override + public com.google.protobuf.DurationOrBuilder getDelayOrBuilder() { + return getDelay(); + } + + public static final int RESPONSE_INDEX_FIELD_NUMBER = 3; + private int responseIndex_; + + /** + * + * + *
        +     * The index that the status should be sent
        +     * 
        + * + * int32 response_index = 3; + * + * @return The responseIndex. + */ + @java.lang.Override + public int getResponseIndex() { + return responseIndex_; + } + + 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 (status_ != null) { + output.writeMessage(1, getStatus()); + } + if (delay_ != null) { + output.writeMessage(2, getDelay()); + } + if (responseIndex_ != 0) { + output.writeInt32(3, responseIndex_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (status_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getStatus()); + } + if (delay_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getDelay()); + } + if (responseIndex_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(3, responseIndex_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.showcase.v1beta1.StreamingSequence.Response)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.StreamingSequence.Response other = + (com.google.showcase.v1beta1.StreamingSequence.Response) obj; + + if (hasStatus() != other.hasStatus()) return false; + if (hasStatus()) { + if (!getStatus().equals(other.getStatus())) return false; + } + if (hasDelay() != other.hasDelay()) return false; + if (hasDelay()) { + if (!getDelay().equals(other.getDelay())) return false; + } + if (getResponseIndex() != other.getResponseIndex()) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasStatus()) { + hash = (37 * hash) + STATUS_FIELD_NUMBER; + hash = (53 * hash) + getStatus().hashCode(); + } + if (hasDelay()) { + hash = (37 * hash) + DELAY_FIELD_NUMBER; + hash = (53 * hash) + getDelay().hashCode(); + } + hash = (37 * hash) + RESPONSE_INDEX_FIELD_NUMBER; + hash = (53 * hash) + getResponseIndex(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.showcase.v1beta1.StreamingSequence.Response parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.StreamingSequence.Response parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.StreamingSequence.Response parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.StreamingSequence.Response 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.showcase.v1beta1.StreamingSequence.Response parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.StreamingSequence.Response parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.StreamingSequence.Response parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.StreamingSequence.Response 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.showcase.v1beta1.StreamingSequence.Response parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.StreamingSequence.Response 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.showcase.v1beta1.StreamingSequence.Response parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.StreamingSequence.Response 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.showcase.v1beta1.StreamingSequence.Response prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
        +     * A server response to an RPC Attempt in a sequence.
        +     * 
        + * + * Protobuf type {@code google.showcase.v1beta1.StreamingSequence.Response} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.StreamingSequence.Response) + com.google.showcase.v1beta1.StreamingSequence.ResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.SequenceOuterClass + .internal_static_google_showcase_v1beta1_StreamingSequence_Response_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.SequenceOuterClass + .internal_static_google_showcase_v1beta1_StreamingSequence_Response_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.StreamingSequence.Response.class, + com.google.showcase.v1beta1.StreamingSequence.Response.Builder.class); + } + + // Construct using com.google.showcase.v1beta1.StreamingSequence.Response.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (statusBuilder_ == null) { + status_ = null; + } else { + status_ = null; + statusBuilder_ = null; + } + if (delayBuilder_ == null) { + delay_ = null; + } else { + delay_ = null; + delayBuilder_ = null; + } + responseIndex_ = 0; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.showcase.v1beta1.SequenceOuterClass + .internal_static_google_showcase_v1beta1_StreamingSequence_Response_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.StreamingSequence.Response getDefaultInstanceForType() { + return com.google.showcase.v1beta1.StreamingSequence.Response.getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.StreamingSequence.Response build() { + com.google.showcase.v1beta1.StreamingSequence.Response result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.StreamingSequence.Response buildPartial() { + com.google.showcase.v1beta1.StreamingSequence.Response result = + new com.google.showcase.v1beta1.StreamingSequence.Response(this); + if (statusBuilder_ == null) { + result.status_ = status_; + } else { + result.status_ = statusBuilder_.build(); + } + if (delayBuilder_ == null) { + result.delay_ = delay_; + } else { + result.delay_ = delayBuilder_.build(); + } + result.responseIndex_ = responseIndex_; + 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.showcase.v1beta1.StreamingSequence.Response) { + return mergeFrom((com.google.showcase.v1beta1.StreamingSequence.Response) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.showcase.v1beta1.StreamingSequence.Response other) { + if (other == com.google.showcase.v1beta1.StreamingSequence.Response.getDefaultInstance()) + return this; + if (other.hasStatus()) { + mergeStatus(other.getStatus()); + } + if (other.hasDelay()) { + mergeDelay(other.getDelay()); + } + if (other.getResponseIndex() != 0) { + setResponseIndex(other.getResponseIndex()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.showcase.v1beta1.StreamingSequence.Response parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.showcase.v1beta1.StreamingSequence.Response) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private com.google.rpc.Status status_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.rpc.Status, com.google.rpc.Status.Builder, com.google.rpc.StatusOrBuilder> + statusBuilder_; + + /** + * + * + *
        +       * The status to return for an individual attempt.
        +       * 
        + * + * .google.rpc.Status status = 1; + * + * @return Whether the status field is set. + */ + public boolean hasStatus() { + return statusBuilder_ != null || status_ != null; + } + + /** + * + * + *
        +       * The status to return for an individual attempt.
        +       * 
        + * + * .google.rpc.Status status = 1; + * + * @return The status. + */ + public com.google.rpc.Status getStatus() { + if (statusBuilder_ == null) { + return status_ == null ? com.google.rpc.Status.getDefaultInstance() : status_; + } else { + return statusBuilder_.getMessage(); + } + } + + /** + * + * + *
        +       * The status to return for an individual attempt.
        +       * 
        + * + * .google.rpc.Status status = 1; + */ + public Builder setStatus(com.google.rpc.Status value) { + if (statusBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + status_ = value; + onChanged(); + } else { + statusBuilder_.setMessage(value); + } + + return this; + } + + /** + * + * + *
        +       * The status to return for an individual attempt.
        +       * 
        + * + * .google.rpc.Status status = 1; + */ + public Builder setStatus(com.google.rpc.Status.Builder builderForValue) { + if (statusBuilder_ == null) { + status_ = builderForValue.build(); + onChanged(); + } else { + statusBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + + /** + * + * + *
        +       * The status to return for an individual attempt.
        +       * 
        + * + * .google.rpc.Status status = 1; + */ + public Builder mergeStatus(com.google.rpc.Status value) { + if (statusBuilder_ == null) { + if (status_ != null) { + status_ = com.google.rpc.Status.newBuilder(status_).mergeFrom(value).buildPartial(); + } else { + status_ = value; + } + onChanged(); + } else { + statusBuilder_.mergeFrom(value); + } + + return this; + } + + /** + * + * + *
        +       * The status to return for an individual attempt.
        +       * 
        + * + * .google.rpc.Status status = 1; + */ + public Builder clearStatus() { + if (statusBuilder_ == null) { + status_ = null; + onChanged(); + } else { + status_ = null; + statusBuilder_ = null; + } + + return this; + } + + /** + * + * + *
        +       * The status to return for an individual attempt.
        +       * 
        + * + * .google.rpc.Status status = 1; + */ + public com.google.rpc.Status.Builder getStatusBuilder() { + + onChanged(); + return getStatusFieldBuilder().getBuilder(); + } + + /** + * + * + *
        +       * The status to return for an individual attempt.
        +       * 
        + * + * .google.rpc.Status status = 1; + */ + public com.google.rpc.StatusOrBuilder getStatusOrBuilder() { + if (statusBuilder_ != null) { + return statusBuilder_.getMessageOrBuilder(); + } else { + return status_ == null ? com.google.rpc.Status.getDefaultInstance() : status_; + } + } + + /** + * + * + *
        +       * The status to return for an individual attempt.
        +       * 
        + * + * .google.rpc.Status status = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.rpc.Status, com.google.rpc.Status.Builder, com.google.rpc.StatusOrBuilder> + getStatusFieldBuilder() { + if (statusBuilder_ == null) { + statusBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.rpc.Status, + com.google.rpc.Status.Builder, + com.google.rpc.StatusOrBuilder>(getStatus(), getParentForChildren(), isClean()); + status_ = null; + } + return statusBuilder_; + } + + private com.google.protobuf.Duration delay_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder> + delayBuilder_; + + /** + * + * + *
        +       * The amount of time to delay sending the response.
        +       * 
        + * + * .google.protobuf.Duration delay = 2; + * + * @return Whether the delay field is set. + */ + public boolean hasDelay() { + return delayBuilder_ != null || delay_ != null; + } + + /** + * + * + *
        +       * The amount of time to delay sending the response.
        +       * 
        + * + * .google.protobuf.Duration delay = 2; + * + * @return The delay. + */ + public com.google.protobuf.Duration getDelay() { + if (delayBuilder_ == null) { + return delay_ == null ? com.google.protobuf.Duration.getDefaultInstance() : delay_; + } else { + return delayBuilder_.getMessage(); + } + } + + /** + * + * + *
        +       * The amount of time to delay sending the response.
        +       * 
        + * + * .google.protobuf.Duration delay = 2; + */ + public Builder setDelay(com.google.protobuf.Duration value) { + if (delayBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + delay_ = value; + onChanged(); + } else { + delayBuilder_.setMessage(value); + } + + return this; + } + + /** + * + * + *
        +       * The amount of time to delay sending the response.
        +       * 
        + * + * .google.protobuf.Duration delay = 2; + */ + public Builder setDelay(com.google.protobuf.Duration.Builder builderForValue) { + if (delayBuilder_ == null) { + delay_ = builderForValue.build(); + onChanged(); + } else { + delayBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + + /** + * + * + *
        +       * The amount of time to delay sending the response.
        +       * 
        + * + * .google.protobuf.Duration delay = 2; + */ + public Builder mergeDelay(com.google.protobuf.Duration value) { + if (delayBuilder_ == null) { + if (delay_ != null) { + delay_ = + com.google.protobuf.Duration.newBuilder(delay_).mergeFrom(value).buildPartial(); + } else { + delay_ = value; + } + onChanged(); + } else { + delayBuilder_.mergeFrom(value); + } + + return this; + } + + /** + * + * + *
        +       * The amount of time to delay sending the response.
        +       * 
        + * + * .google.protobuf.Duration delay = 2; + */ + public Builder clearDelay() { + if (delayBuilder_ == null) { + delay_ = null; + onChanged(); + } else { + delay_ = null; + delayBuilder_ = null; + } + + return this; + } + + /** + * + * + *
        +       * The amount of time to delay sending the response.
        +       * 
        + * + * .google.protobuf.Duration delay = 2; + */ + public com.google.protobuf.Duration.Builder getDelayBuilder() { + + onChanged(); + return getDelayFieldBuilder().getBuilder(); + } + + /** + * + * + *
        +       * The amount of time to delay sending the response.
        +       * 
        + * + * .google.protobuf.Duration delay = 2; + */ + public com.google.protobuf.DurationOrBuilder getDelayOrBuilder() { + if (delayBuilder_ != null) { + return delayBuilder_.getMessageOrBuilder(); + } else { + return delay_ == null ? com.google.protobuf.Duration.getDefaultInstance() : delay_; + } + } + + /** + * + * + *
        +       * The amount of time to delay sending the response.
        +       * 
        + * + * .google.protobuf.Duration delay = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder> + getDelayFieldBuilder() { + if (delayBuilder_ == null) { + delayBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder>( + getDelay(), getParentForChildren(), isClean()); + delay_ = null; + } + return delayBuilder_; + } + + private int responseIndex_; + + /** + * + * + *
        +       * The index that the status should be sent
        +       * 
        + * + * int32 response_index = 3; + * + * @return The responseIndex. + */ + @java.lang.Override + public int getResponseIndex() { + return responseIndex_; + } + + /** + * + * + *
        +       * The index that the status should be sent
        +       * 
        + * + * int32 response_index = 3; + * + * @param value The responseIndex to set. + * @return This builder for chaining. + */ + public Builder setResponseIndex(int value) { + + responseIndex_ = value; + onChanged(); + return this; + } + + /** + * + * + *
        +       * The index that the status should be sent
        +       * 
        + * + * int32 response_index = 3; + * + * @return This builder for chaining. + */ + public Builder clearResponseIndex() { + + responseIndex_ = 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.showcase.v1beta1.StreamingSequence.Response) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.StreamingSequence.Response) + private static final com.google.showcase.v1beta1.StreamingSequence.Response DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.StreamingSequence.Response(); + } + + public static com.google.showcase.v1beta1.StreamingSequence.Response getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Response parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Response(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.showcase.v1beta1.StreamingSequence.Response getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + + /** + * 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; + } + } + + /** + * 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 CONTENT_FIELD_NUMBER = 2; + private volatile java.lang.Object content_; + + /** + * + * + *
        +   * The Content that the stream will send
        +   * 
        + * + * string content = 2; + * + * @return The content. + */ + @java.lang.Override + public java.lang.String getContent() { + java.lang.Object ref = content_; + 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(); + content_ = s; + return s; + } + } + + /** + * + * + *
        +   * The Content that the stream will send
        +   * 
        + * + * string content = 2; + * + * @return The bytes for content. + */ + @java.lang.Override + public com.google.protobuf.ByteString getContentBytes() { + java.lang.Object ref = content_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + content_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int RESPONSES_FIELD_NUMBER = 3; + private java.util.List responses_; + + /** + * + * + *
        +   * Sequence of responses to return in order for each attempt. If empty, the
        +   * default response is an immediate OK.
        +   * 
        + * + * repeated .google.showcase.v1beta1.StreamingSequence.Response responses = 3; + */ + @java.lang.Override + public java.util.List getResponsesList() { + return responses_; + } + + /** + * + * + *
        +   * Sequence of responses to return in order for each attempt. If empty, the
        +   * default response is an immediate OK.
        +   * 
        + * + * repeated .google.showcase.v1beta1.StreamingSequence.Response responses = 3; + */ + @java.lang.Override + public java.util.List + getResponsesOrBuilderList() { + return responses_; + } + + /** + * + * + *
        +   * Sequence of responses to return in order for each attempt. If empty, the
        +   * default response is an immediate OK.
        +   * 
        + * + * repeated .google.showcase.v1beta1.StreamingSequence.Response responses = 3; + */ + @java.lang.Override + public int getResponsesCount() { + return responses_.size(); + } + + /** + * + * + *
        +   * Sequence of responses to return in order for each attempt. If empty, the
        +   * default response is an immediate OK.
        +   * 
        + * + * repeated .google.showcase.v1beta1.StreamingSequence.Response responses = 3; + */ + @java.lang.Override + public com.google.showcase.v1beta1.StreamingSequence.Response getResponses(int index) { + return responses_.get(index); + } + + /** + * + * + *
        +   * Sequence of responses to return in order for each attempt. If empty, the
        +   * default response is an immediate OK.
        +   * 
        + * + * repeated .google.showcase.v1beta1.StreamingSequence.Response responses = 3; + */ + @java.lang.Override + public com.google.showcase.v1beta1.StreamingSequence.ResponseOrBuilder getResponsesOrBuilder( + int index) { + return responses_.get(index); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(content_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, content_); + } + for (int i = 0; i < responses_.size(); i++) { + output.writeMessage(3, responses_.get(i)); + } + unknownFields.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(content_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, content_); + } + for (int i = 0; i < responses_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, responses_.get(i)); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.showcase.v1beta1.StreamingSequence)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.StreamingSequence other = + (com.google.showcase.v1beta1.StreamingSequence) obj; + + if (!getName().equals(other.getName())) return false; + if (!getContent().equals(other.getContent())) return false; + if (!getResponsesList().equals(other.getResponsesList())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (37 * hash) + CONTENT_FIELD_NUMBER; + hash = (53 * hash) + getContent().hashCode(); + if (getResponsesCount() > 0) { + hash = (37 * hash) + RESPONSES_FIELD_NUMBER; + hash = (53 * hash) + getResponsesList().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.showcase.v1beta1.StreamingSequence parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.StreamingSequence parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.StreamingSequence parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.StreamingSequence 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.showcase.v1beta1.StreamingSequence parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.StreamingSequence parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.StreamingSequence parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.StreamingSequence 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.showcase.v1beta1.StreamingSequence parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.StreamingSequence 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.showcase.v1beta1.StreamingSequence parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.StreamingSequence 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.showcase.v1beta1.StreamingSequence prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** Protobuf type {@code google.showcase.v1beta1.StreamingSequence} */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.StreamingSequence) + com.google.showcase.v1beta1.StreamingSequenceOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.SequenceOuterClass + .internal_static_google_showcase_v1beta1_StreamingSequence_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.SequenceOuterClass + .internal_static_google_showcase_v1beta1_StreamingSequence_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.StreamingSequence.class, + com.google.showcase.v1beta1.StreamingSequence.Builder.class); + } + + // Construct using com.google.showcase.v1beta1.StreamingSequence.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getResponsesFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + content_ = ""; + + if (responsesBuilder_ == null) { + responses_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + responsesBuilder_.clear(); + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.showcase.v1beta1.SequenceOuterClass + .internal_static_google_showcase_v1beta1_StreamingSequence_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.StreamingSequence getDefaultInstanceForType() { + return com.google.showcase.v1beta1.StreamingSequence.getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.StreamingSequence build() { + com.google.showcase.v1beta1.StreamingSequence result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.StreamingSequence buildPartial() { + com.google.showcase.v1beta1.StreamingSequence result = + new com.google.showcase.v1beta1.StreamingSequence(this); + int from_bitField0_ = bitField0_; + result.name_ = name_; + result.content_ = content_; + if (responsesBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + responses_ = java.util.Collections.unmodifiableList(responses_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.responses_ = responses_; + } else { + result.responses_ = responsesBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.showcase.v1beta1.StreamingSequence) { + return mergeFrom((com.google.showcase.v1beta1.StreamingSequence) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.showcase.v1beta1.StreamingSequence other) { + if (other == com.google.showcase.v1beta1.StreamingSequence.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + if (!other.getContent().isEmpty()) { + content_ = other.content_; + onChanged(); + } + if (responsesBuilder_ == null) { + if (!other.responses_.isEmpty()) { + if (responses_.isEmpty()) { + responses_ = other.responses_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureResponsesIsMutable(); + responses_.addAll(other.responses_); + } + onChanged(); + } + } else { + if (!other.responses_.isEmpty()) { + if (responsesBuilder_.isEmpty()) { + responsesBuilder_.dispose(); + responsesBuilder_ = null; + responses_ = other.responses_; + bitField0_ = (bitField0_ & ~0x00000001); + responsesBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getResponsesFieldBuilder() + : null; + } else { + responsesBuilder_.addAllMessages(other.responses_); + } + } + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.showcase.v1beta1.StreamingSequence parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.showcase.v1beta1.StreamingSequence) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + + /** + * 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; + } + } + + /** + * 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; + } + } + + /** + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + + /** + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + + /** + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + + private java.lang.Object content_ = ""; + + /** + * + * + *
        +     * The Content that the stream will send
        +     * 
        + * + * string content = 2; + * + * @return The content. + */ + public java.lang.String getContent() { + java.lang.Object ref = content_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + content_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
        +     * The Content that the stream will send
        +     * 
        + * + * string content = 2; + * + * @return The bytes for content. + */ + public com.google.protobuf.ByteString getContentBytes() { + java.lang.Object ref = content_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + content_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
        +     * The Content that the stream will send
        +     * 
        + * + * string content = 2; + * + * @param value The content to set. + * @return This builder for chaining. + */ + public Builder setContent(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + content_ = value; + onChanged(); + return this; + } + + /** + * + * + *
        +     * The Content that the stream will send
        +     * 
        + * + * string content = 2; + * + * @return This builder for chaining. + */ + public Builder clearContent() { + + content_ = getDefaultInstance().getContent(); + onChanged(); + return this; + } + + /** + * + * + *
        +     * The Content that the stream will send
        +     * 
        + * + * string content = 2; + * + * @param value The bytes for content to set. + * @return This builder for chaining. + */ + public Builder setContentBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + content_ = value; + onChanged(); + return this; + } + + private java.util.List responses_ = + java.util.Collections.emptyList(); + + private void ensureResponsesIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + responses_ = + new java.util.ArrayList( + responses_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.showcase.v1beta1.StreamingSequence.Response, + com.google.showcase.v1beta1.StreamingSequence.Response.Builder, + com.google.showcase.v1beta1.StreamingSequence.ResponseOrBuilder> + responsesBuilder_; + + /** + * + * + *
        +     * Sequence of responses to return in order for each attempt. If empty, the
        +     * default response is an immediate OK.
        +     * 
        + * + * repeated .google.showcase.v1beta1.StreamingSequence.Response responses = 3; + */ + public java.util.List + getResponsesList() { + if (responsesBuilder_ == null) { + return java.util.Collections.unmodifiableList(responses_); + } else { + return responsesBuilder_.getMessageList(); + } + } + + /** + * + * + *
        +     * Sequence of responses to return in order for each attempt. If empty, the
        +     * default response is an immediate OK.
        +     * 
        + * + * repeated .google.showcase.v1beta1.StreamingSequence.Response responses = 3; + */ + public int getResponsesCount() { + if (responsesBuilder_ == null) { + return responses_.size(); + } else { + return responsesBuilder_.getCount(); + } + } + + /** + * + * + *
        +     * Sequence of responses to return in order for each attempt. If empty, the
        +     * default response is an immediate OK.
        +     * 
        + * + * repeated .google.showcase.v1beta1.StreamingSequence.Response responses = 3; + */ + public com.google.showcase.v1beta1.StreamingSequence.Response getResponses(int index) { + if (responsesBuilder_ == null) { + return responses_.get(index); + } else { + return responsesBuilder_.getMessage(index); + } + } + + /** + * + * + *
        +     * Sequence of responses to return in order for each attempt. If empty, the
        +     * default response is an immediate OK.
        +     * 
        + * + * repeated .google.showcase.v1beta1.StreamingSequence.Response responses = 3; + */ + public Builder setResponses( + int index, com.google.showcase.v1beta1.StreamingSequence.Response value) { + if (responsesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureResponsesIsMutable(); + responses_.set(index, value); + onChanged(); + } else { + responsesBuilder_.setMessage(index, value); + } + return this; + } + + /** + * + * + *
        +     * Sequence of responses to return in order for each attempt. If empty, the
        +     * default response is an immediate OK.
        +     * 
        + * + * repeated .google.showcase.v1beta1.StreamingSequence.Response responses = 3; + */ + public Builder setResponses( + int index, com.google.showcase.v1beta1.StreamingSequence.Response.Builder builderForValue) { + if (responsesBuilder_ == null) { + ensureResponsesIsMutable(); + responses_.set(index, builderForValue.build()); + onChanged(); + } else { + responsesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
        +     * Sequence of responses to return in order for each attempt. If empty, the
        +     * default response is an immediate OK.
        +     * 
        + * + * repeated .google.showcase.v1beta1.StreamingSequence.Response responses = 3; + */ + public Builder addResponses(com.google.showcase.v1beta1.StreamingSequence.Response value) { + if (responsesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureResponsesIsMutable(); + responses_.add(value); + onChanged(); + } else { + responsesBuilder_.addMessage(value); + } + return this; + } + + /** + * + * + *
        +     * Sequence of responses to return in order for each attempt. If empty, the
        +     * default response is an immediate OK.
        +     * 
        + * + * repeated .google.showcase.v1beta1.StreamingSequence.Response responses = 3; + */ + public Builder addResponses( + int index, com.google.showcase.v1beta1.StreamingSequence.Response value) { + if (responsesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureResponsesIsMutable(); + responses_.add(index, value); + onChanged(); + } else { + responsesBuilder_.addMessage(index, value); + } + return this; + } + + /** + * + * + *
        +     * Sequence of responses to return in order for each attempt. If empty, the
        +     * default response is an immediate OK.
        +     * 
        + * + * repeated .google.showcase.v1beta1.StreamingSequence.Response responses = 3; + */ + public Builder addResponses( + com.google.showcase.v1beta1.StreamingSequence.Response.Builder builderForValue) { + if (responsesBuilder_ == null) { + ensureResponsesIsMutable(); + responses_.add(builderForValue.build()); + onChanged(); + } else { + responsesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + + /** + * + * + *
        +     * Sequence of responses to return in order for each attempt. If empty, the
        +     * default response is an immediate OK.
        +     * 
        + * + * repeated .google.showcase.v1beta1.StreamingSequence.Response responses = 3; + */ + public Builder addResponses( + int index, com.google.showcase.v1beta1.StreamingSequence.Response.Builder builderForValue) { + if (responsesBuilder_ == null) { + ensureResponsesIsMutable(); + responses_.add(index, builderForValue.build()); + onChanged(); + } else { + responsesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
        +     * Sequence of responses to return in order for each attempt. If empty, the
        +     * default response is an immediate OK.
        +     * 
        + * + * repeated .google.showcase.v1beta1.StreamingSequence.Response responses = 3; + */ + public Builder addAllResponses( + java.lang.Iterable + values) { + if (responsesBuilder_ == null) { + ensureResponsesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, responses_); + onChanged(); + } else { + responsesBuilder_.addAllMessages(values); + } + return this; + } + + /** + * + * + *
        +     * Sequence of responses to return in order for each attempt. If empty, the
        +     * default response is an immediate OK.
        +     * 
        + * + * repeated .google.showcase.v1beta1.StreamingSequence.Response responses = 3; + */ + public Builder clearResponses() { + if (responsesBuilder_ == null) { + responses_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + responsesBuilder_.clear(); + } + return this; + } + + /** + * + * + *
        +     * Sequence of responses to return in order for each attempt. If empty, the
        +     * default response is an immediate OK.
        +     * 
        + * + * repeated .google.showcase.v1beta1.StreamingSequence.Response responses = 3; + */ + public Builder removeResponses(int index) { + if (responsesBuilder_ == null) { + ensureResponsesIsMutable(); + responses_.remove(index); + onChanged(); + } else { + responsesBuilder_.remove(index); + } + return this; + } + + /** + * + * + *
        +     * Sequence of responses to return in order for each attempt. If empty, the
        +     * default response is an immediate OK.
        +     * 
        + * + * repeated .google.showcase.v1beta1.StreamingSequence.Response responses = 3; + */ + public com.google.showcase.v1beta1.StreamingSequence.Response.Builder getResponsesBuilder( + int index) { + return getResponsesFieldBuilder().getBuilder(index); + } + + /** + * + * + *
        +     * Sequence of responses to return in order for each attempt. If empty, the
        +     * default response is an immediate OK.
        +     * 
        + * + * repeated .google.showcase.v1beta1.StreamingSequence.Response responses = 3; + */ + public com.google.showcase.v1beta1.StreamingSequence.ResponseOrBuilder getResponsesOrBuilder( + int index) { + if (responsesBuilder_ == null) { + return responses_.get(index); + } else { + return responsesBuilder_.getMessageOrBuilder(index); + } + } + + /** + * + * + *
        +     * Sequence of responses to return in order for each attempt. If empty, the
        +     * default response is an immediate OK.
        +     * 
        + * + * repeated .google.showcase.v1beta1.StreamingSequence.Response responses = 3; + */ + public java.util.List + getResponsesOrBuilderList() { + if (responsesBuilder_ != null) { + return responsesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(responses_); + } + } + + /** + * + * + *
        +     * Sequence of responses to return in order for each attempt. If empty, the
        +     * default response is an immediate OK.
        +     * 
        + * + * repeated .google.showcase.v1beta1.StreamingSequence.Response responses = 3; + */ + public com.google.showcase.v1beta1.StreamingSequence.Response.Builder addResponsesBuilder() { + return getResponsesFieldBuilder() + .addBuilder(com.google.showcase.v1beta1.StreamingSequence.Response.getDefaultInstance()); + } + + /** + * + * + *
        +     * Sequence of responses to return in order for each attempt. If empty, the
        +     * default response is an immediate OK.
        +     * 
        + * + * repeated .google.showcase.v1beta1.StreamingSequence.Response responses = 3; + */ + public com.google.showcase.v1beta1.StreamingSequence.Response.Builder addResponsesBuilder( + int index) { + return getResponsesFieldBuilder() + .addBuilder( + index, com.google.showcase.v1beta1.StreamingSequence.Response.getDefaultInstance()); + } + + /** + * + * + *
        +     * Sequence of responses to return in order for each attempt. If empty, the
        +     * default response is an immediate OK.
        +     * 
        + * + * repeated .google.showcase.v1beta1.StreamingSequence.Response responses = 3; + */ + public java.util.List + getResponsesBuilderList() { + return getResponsesFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.showcase.v1beta1.StreamingSequence.Response, + com.google.showcase.v1beta1.StreamingSequence.Response.Builder, + com.google.showcase.v1beta1.StreamingSequence.ResponseOrBuilder> + getResponsesFieldBuilder() { + if (responsesBuilder_ == null) { + responsesBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.showcase.v1beta1.StreamingSequence.Response, + com.google.showcase.v1beta1.StreamingSequence.Response.Builder, + com.google.showcase.v1beta1.StreamingSequence.ResponseOrBuilder>( + responses_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + responses_ = null; + } + return responsesBuilder_; + } + + @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.showcase.v1beta1.StreamingSequence) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.StreamingSequence) + private static final com.google.showcase.v1beta1.StreamingSequence DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.StreamingSequence(); + } + + public static com.google.showcase.v1beta1.StreamingSequence getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public StreamingSequence parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new StreamingSequence(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.showcase.v1beta1.StreamingSequence getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/StreamingSequenceName.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/StreamingSequenceName.java new file mode 100644 index 0000000000..ee58f2349c --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/StreamingSequenceName.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.showcase.v1beta1; + +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +@Generated("by gapic-generator-java") +public class StreamingSequenceName implements ResourceName { + private static final PathTemplate STREAMING_SEQUENCE = + PathTemplate.createWithoutUrlEncoding("streamingSequences/{streaming_sequence}"); + private volatile Map fieldValuesMap; + private final String streamingSequence; + + @Deprecated + protected StreamingSequenceName() { + streamingSequence = null; + } + + private StreamingSequenceName(Builder builder) { + streamingSequence = Preconditions.checkNotNull(builder.getStreamingSequence()); + } + + public String getStreamingSequence() { + return streamingSequence; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + public static StreamingSequenceName of(String streamingSequence) { + return newBuilder().setStreamingSequence(streamingSequence).build(); + } + + public static String format(String streamingSequence) { + return newBuilder().setStreamingSequence(streamingSequence).build().toString(); + } + + public static StreamingSequenceName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + STREAMING_SEQUENCE.validatedMatch( + formattedString, "StreamingSequenceName.parse: formattedString not in valid format"); + return of(matchMap.get("streaming_sequence")); + } + + 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 (StreamingSequenceName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return STREAMING_SEQUENCE.matches(formattedString); + } + + @Override + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + if (streamingSequence != null) { + fieldMapBuilder.put("streaming_sequence", streamingSequence); + } + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return STREAMING_SEQUENCE.instantiate("streaming_sequence", streamingSequence); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o != null && getClass() == o.getClass()) { + StreamingSequenceName that = ((StreamingSequenceName) o); + return Objects.equals(this.streamingSequence, that.streamingSequence); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= Objects.hashCode(streamingSequence); + return h; + } + + /** Builder for streamingSequences/{streaming_sequence}. */ + public static class Builder { + private String streamingSequence; + + protected Builder() {} + + public String getStreamingSequence() { + return streamingSequence; + } + + public Builder setStreamingSequence(String streamingSequence) { + this.streamingSequence = streamingSequence; + return this; + } + + private Builder(StreamingSequenceName streamingSequenceName) { + this.streamingSequence = streamingSequenceName.streamingSequence; + } + + public StreamingSequenceName build() { + return new StreamingSequenceName(this); + } + } +} diff --git a/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/StreamingSequenceOrBuilder.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/StreamingSequenceOrBuilder.java new file mode 100644 index 0000000000..2c05ec00aa --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/StreamingSequenceOrBuilder.java @@ -0,0 +1,126 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/sequence.proto + +package com.google.showcase.v1beta1; + +public interface StreamingSequenceOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.StreamingSequence) + com.google.protobuf.MessageOrBuilder { + + /** + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The name. + */ + java.lang.String getName(); + + /** + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
        +   * The Content that the stream will send
        +   * 
        + * + * string content = 2; + * + * @return The content. + */ + java.lang.String getContent(); + + /** + * + * + *
        +   * The Content that the stream will send
        +   * 
        + * + * string content = 2; + * + * @return The bytes for content. + */ + com.google.protobuf.ByteString getContentBytes(); + + /** + * + * + *
        +   * Sequence of responses to return in order for each attempt. If empty, the
        +   * default response is an immediate OK.
        +   * 
        + * + * repeated .google.showcase.v1beta1.StreamingSequence.Response responses = 3; + */ + java.util.List getResponsesList(); + + /** + * + * + *
        +   * Sequence of responses to return in order for each attempt. If empty, the
        +   * default response is an immediate OK.
        +   * 
        + * + * repeated .google.showcase.v1beta1.StreamingSequence.Response responses = 3; + */ + com.google.showcase.v1beta1.StreamingSequence.Response getResponses(int index); + + /** + * + * + *
        +   * Sequence of responses to return in order for each attempt. If empty, the
        +   * default response is an immediate OK.
        +   * 
        + * + * repeated .google.showcase.v1beta1.StreamingSequence.Response responses = 3; + */ + int getResponsesCount(); + + /** + * + * + *
        +   * Sequence of responses to return in order for each attempt. If empty, the
        +   * default response is an immediate OK.
        +   * 
        + * + * repeated .google.showcase.v1beta1.StreamingSequence.Response responses = 3; + */ + java.util.List + getResponsesOrBuilderList(); + + /** + * + * + *
        +   * Sequence of responses to return in order for each attempt. If empty, the
        +   * default response is an immediate OK.
        +   * 
        + * + * repeated .google.showcase.v1beta1.StreamingSequence.Response responses = 3; + */ + com.google.showcase.v1beta1.StreamingSequence.ResponseOrBuilder getResponsesOrBuilder(int index); +} diff --git a/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/StreamingSequenceReport.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/StreamingSequenceReport.java new file mode 100644 index 0000000000..4e4a388dea --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/StreamingSequenceReport.java @@ -0,0 +1,3005 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/sequence.proto + +package com.google.showcase.v1beta1; + +/** Protobuf type {@code google.showcase.v1beta1.StreamingSequenceReport} */ +public final class StreamingSequenceReport extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.StreamingSequenceReport) + StreamingSequenceReportOrBuilder { + private static final long serialVersionUID = 0L; + + // Use StreamingSequenceReport.newBuilder() to construct. + private StreamingSequenceReport(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private StreamingSequenceReport() { + name_ = ""; + attempts_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new StreamingSequenceReport(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private StreamingSequenceReport( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + break; + } + case 18: + { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + attempts_ = + new java.util.ArrayList< + com.google.showcase.v1beta1.StreamingSequenceReport.Attempt>(); + mutable_bitField0_ |= 0x00000001; + } + attempts_.add( + input.readMessage( + com.google.showcase.v1beta1.StreamingSequenceReport.Attempt.parser(), + extensionRegistry)); + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + attempts_ = java.util.Collections.unmodifiableList(attempts_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.SequenceOuterClass + .internal_static_google_showcase_v1beta1_StreamingSequenceReport_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.SequenceOuterClass + .internal_static_google_showcase_v1beta1_StreamingSequenceReport_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.StreamingSequenceReport.class, + com.google.showcase.v1beta1.StreamingSequenceReport.Builder.class); + } + + public interface AttemptOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.StreamingSequenceReport.Attempt) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
        +     * The attempt number - starting at 0.
        +     * 
        + * + * int32 attempt_number = 1; + * + * @return The attemptNumber. + */ + int getAttemptNumber(); + + /** + * + * + *
        +     * The deadline dictated by the attempt to the server.
        +     * 
        + * + * .google.protobuf.Timestamp attempt_deadline = 2; + * + * @return Whether the attemptDeadline field is set. + */ + boolean hasAttemptDeadline(); + + /** + * + * + *
        +     * The deadline dictated by the attempt to the server.
        +     * 
        + * + * .google.protobuf.Timestamp attempt_deadline = 2; + * + * @return The attemptDeadline. + */ + com.google.protobuf.Timestamp getAttemptDeadline(); + + /** + * + * + *
        +     * The deadline dictated by the attempt to the server.
        +     * 
        + * + * .google.protobuf.Timestamp attempt_deadline = 2; + */ + com.google.protobuf.TimestampOrBuilder getAttemptDeadlineOrBuilder(); + + /** + * + * + *
        +     * The time that the server responded to the RPC attempt. Used for
        +     * calculating attempt_delay.
        +     * 
        + * + * .google.protobuf.Timestamp response_time = 3; + * + * @return Whether the responseTime field is set. + */ + boolean hasResponseTime(); + + /** + * + * + *
        +     * The time that the server responded to the RPC attempt. Used for
        +     * calculating attempt_delay.
        +     * 
        + * + * .google.protobuf.Timestamp response_time = 3; + * + * @return The responseTime. + */ + com.google.protobuf.Timestamp getResponseTime(); + + /** + * + * + *
        +     * The time that the server responded to the RPC attempt. Used for
        +     * calculating attempt_delay.
        +     * 
        + * + * .google.protobuf.Timestamp response_time = 3; + */ + com.google.protobuf.TimestampOrBuilder getResponseTimeOrBuilder(); + + /** + * + * + *
        +     * The server perceived delay between sending the last response and
        +     * receiving this attempt. Used for validating attempt delay backoff.
        +     * 
        + * + * .google.protobuf.Duration attempt_delay = 4; + * + * @return Whether the attemptDelay field is set. + */ + boolean hasAttemptDelay(); + + /** + * + * + *
        +     * The server perceived delay between sending the last response and
        +     * receiving this attempt. Used for validating attempt delay backoff.
        +     * 
        + * + * .google.protobuf.Duration attempt_delay = 4; + * + * @return The attemptDelay. + */ + com.google.protobuf.Duration getAttemptDelay(); + + /** + * + * + *
        +     * The server perceived delay between sending the last response and
        +     * receiving this attempt. Used for validating attempt delay backoff.
        +     * 
        + * + * .google.protobuf.Duration attempt_delay = 4; + */ + com.google.protobuf.DurationOrBuilder getAttemptDelayOrBuilder(); + + /** + * + * + *
        +     * The status returned to the attempt.
        +     * 
        + * + * .google.rpc.Status status = 5; + * + * @return Whether the status field is set. + */ + boolean hasStatus(); + + /** + * + * + *
        +     * The status returned to the attempt.
        +     * 
        + * + * .google.rpc.Status status = 5; + * + * @return The status. + */ + com.google.rpc.Status getStatus(); + + /** + * + * + *
        +     * The status returned to the attempt.
        +     * 
        + * + * .google.rpc.Status status = 5; + */ + com.google.rpc.StatusOrBuilder getStatusOrBuilder(); + } + + /** + * + * + *
        +   * Contains metrics on individual RPC Attempts in a sequence.
        +   * 
        + * + * Protobuf type {@code google.showcase.v1beta1.StreamingSequenceReport.Attempt} + */ + public static final class Attempt extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.StreamingSequenceReport.Attempt) + AttemptOrBuilder { + private static final long serialVersionUID = 0L; + + // Use Attempt.newBuilder() to construct. + private Attempt(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Attempt() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Attempt(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private Attempt( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: + { + attemptNumber_ = input.readInt32(); + break; + } + case 18: + { + com.google.protobuf.Timestamp.Builder subBuilder = null; + if (attemptDeadline_ != null) { + subBuilder = attemptDeadline_.toBuilder(); + } + attemptDeadline_ = + input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(attemptDeadline_); + attemptDeadline_ = subBuilder.buildPartial(); + } + + break; + } + case 26: + { + com.google.protobuf.Timestamp.Builder subBuilder = null; + if (responseTime_ != null) { + subBuilder = responseTime_.toBuilder(); + } + responseTime_ = + input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(responseTime_); + responseTime_ = subBuilder.buildPartial(); + } + + break; + } + case 34: + { + com.google.protobuf.Duration.Builder subBuilder = null; + if (attemptDelay_ != null) { + subBuilder = attemptDelay_.toBuilder(); + } + attemptDelay_ = + input.readMessage(com.google.protobuf.Duration.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(attemptDelay_); + attemptDelay_ = subBuilder.buildPartial(); + } + + break; + } + case 42: + { + com.google.rpc.Status.Builder subBuilder = null; + if (status_ != null) { + subBuilder = status_.toBuilder(); + } + status_ = input.readMessage(com.google.rpc.Status.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(status_); + status_ = subBuilder.buildPartial(); + } + + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.SequenceOuterClass + .internal_static_google_showcase_v1beta1_StreamingSequenceReport_Attempt_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.SequenceOuterClass + .internal_static_google_showcase_v1beta1_StreamingSequenceReport_Attempt_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.StreamingSequenceReport.Attempt.class, + com.google.showcase.v1beta1.StreamingSequenceReport.Attempt.Builder.class); + } + + public static final int ATTEMPT_NUMBER_FIELD_NUMBER = 1; + private int attemptNumber_; + + /** + * + * + *
        +     * The attempt number - starting at 0.
        +     * 
        + * + * int32 attempt_number = 1; + * + * @return The attemptNumber. + */ + @java.lang.Override + public int getAttemptNumber() { + return attemptNumber_; + } + + public static final int ATTEMPT_DEADLINE_FIELD_NUMBER = 2; + private com.google.protobuf.Timestamp attemptDeadline_; + + /** + * + * + *
        +     * The deadline dictated by the attempt to the server.
        +     * 
        + * + * .google.protobuf.Timestamp attempt_deadline = 2; + * + * @return Whether the attemptDeadline field is set. + */ + @java.lang.Override + public boolean hasAttemptDeadline() { + return attemptDeadline_ != null; + } + + /** + * + * + *
        +     * The deadline dictated by the attempt to the server.
        +     * 
        + * + * .google.protobuf.Timestamp attempt_deadline = 2; + * + * @return The attemptDeadline. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getAttemptDeadline() { + return attemptDeadline_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : attemptDeadline_; + } + + /** + * + * + *
        +     * The deadline dictated by the attempt to the server.
        +     * 
        + * + * .google.protobuf.Timestamp attempt_deadline = 2; + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getAttemptDeadlineOrBuilder() { + return getAttemptDeadline(); + } + + public static final int RESPONSE_TIME_FIELD_NUMBER = 3; + private com.google.protobuf.Timestamp responseTime_; + + /** + * + * + *
        +     * The time that the server responded to the RPC attempt. Used for
        +     * calculating attempt_delay.
        +     * 
        + * + * .google.protobuf.Timestamp response_time = 3; + * + * @return Whether the responseTime field is set. + */ + @java.lang.Override + public boolean hasResponseTime() { + return responseTime_ != null; + } + + /** + * + * + *
        +     * The time that the server responded to the RPC attempt. Used for
        +     * calculating attempt_delay.
        +     * 
        + * + * .google.protobuf.Timestamp response_time = 3; + * + * @return The responseTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getResponseTime() { + return responseTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : responseTime_; + } + + /** + * + * + *
        +     * The time that the server responded to the RPC attempt. Used for
        +     * calculating attempt_delay.
        +     * 
        + * + * .google.protobuf.Timestamp response_time = 3; + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getResponseTimeOrBuilder() { + return getResponseTime(); + } + + public static final int ATTEMPT_DELAY_FIELD_NUMBER = 4; + private com.google.protobuf.Duration attemptDelay_; + + /** + * + * + *
        +     * The server perceived delay between sending the last response and
        +     * receiving this attempt. Used for validating attempt delay backoff.
        +     * 
        + * + * .google.protobuf.Duration attempt_delay = 4; + * + * @return Whether the attemptDelay field is set. + */ + @java.lang.Override + public boolean hasAttemptDelay() { + return attemptDelay_ != null; + } + + /** + * + * + *
        +     * The server perceived delay between sending the last response and
        +     * receiving this attempt. Used for validating attempt delay backoff.
        +     * 
        + * + * .google.protobuf.Duration attempt_delay = 4; + * + * @return The attemptDelay. + */ + @java.lang.Override + public com.google.protobuf.Duration getAttemptDelay() { + return attemptDelay_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : attemptDelay_; + } + + /** + * + * + *
        +     * The server perceived delay between sending the last response and
        +     * receiving this attempt. Used for validating attempt delay backoff.
        +     * 
        + * + * .google.protobuf.Duration attempt_delay = 4; + */ + @java.lang.Override + public com.google.protobuf.DurationOrBuilder getAttemptDelayOrBuilder() { + return getAttemptDelay(); + } + + public static final int STATUS_FIELD_NUMBER = 5; + private com.google.rpc.Status status_; + + /** + * + * + *
        +     * The status returned to the attempt.
        +     * 
        + * + * .google.rpc.Status status = 5; + * + * @return Whether the status field is set. + */ + @java.lang.Override + public boolean hasStatus() { + return status_ != null; + } + + /** + * + * + *
        +     * The status returned to the attempt.
        +     * 
        + * + * .google.rpc.Status status = 5; + * + * @return The status. + */ + @java.lang.Override + public com.google.rpc.Status getStatus() { + return status_ == null ? com.google.rpc.Status.getDefaultInstance() : status_; + } + + /** + * + * + *
        +     * The status returned to the attempt.
        +     * 
        + * + * .google.rpc.Status status = 5; + */ + @java.lang.Override + public com.google.rpc.StatusOrBuilder getStatusOrBuilder() { + return getStatus(); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (attemptNumber_ != 0) { + output.writeInt32(1, attemptNumber_); + } + if (attemptDeadline_ != null) { + output.writeMessage(2, getAttemptDeadline()); + } + if (responseTime_ != null) { + output.writeMessage(3, getResponseTime()); + } + if (attemptDelay_ != null) { + output.writeMessage(4, getAttemptDelay()); + } + if (status_ != null) { + output.writeMessage(5, getStatus()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (attemptNumber_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(1, attemptNumber_); + } + if (attemptDeadline_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getAttemptDeadline()); + } + if (responseTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getResponseTime()); + } + if (attemptDelay_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, getAttemptDelay()); + } + if (status_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(5, getStatus()); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.showcase.v1beta1.StreamingSequenceReport.Attempt)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.StreamingSequenceReport.Attempt other = + (com.google.showcase.v1beta1.StreamingSequenceReport.Attempt) obj; + + if (getAttemptNumber() != other.getAttemptNumber()) return false; + if (hasAttemptDeadline() != other.hasAttemptDeadline()) return false; + if (hasAttemptDeadline()) { + if (!getAttemptDeadline().equals(other.getAttemptDeadline())) return false; + } + if (hasResponseTime() != other.hasResponseTime()) return false; + if (hasResponseTime()) { + if (!getResponseTime().equals(other.getResponseTime())) return false; + } + if (hasAttemptDelay() != other.hasAttemptDelay()) return false; + if (hasAttemptDelay()) { + if (!getAttemptDelay().equals(other.getAttemptDelay())) return false; + } + if (hasStatus() != other.hasStatus()) return false; + if (hasStatus()) { + if (!getStatus().equals(other.getStatus())) return false; + } + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + ATTEMPT_NUMBER_FIELD_NUMBER; + hash = (53 * hash) + getAttemptNumber(); + if (hasAttemptDeadline()) { + hash = (37 * hash) + ATTEMPT_DEADLINE_FIELD_NUMBER; + hash = (53 * hash) + getAttemptDeadline().hashCode(); + } + if (hasResponseTime()) { + hash = (37 * hash) + RESPONSE_TIME_FIELD_NUMBER; + hash = (53 * hash) + getResponseTime().hashCode(); + } + if (hasAttemptDelay()) { + hash = (37 * hash) + ATTEMPT_DELAY_FIELD_NUMBER; + hash = (53 * hash) + getAttemptDelay().hashCode(); + } + if (hasStatus()) { + hash = (37 * hash) + STATUS_FIELD_NUMBER; + hash = (53 * hash) + getStatus().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.showcase.v1beta1.StreamingSequenceReport.Attempt parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.StreamingSequenceReport.Attempt parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.StreamingSequenceReport.Attempt parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.StreamingSequenceReport.Attempt 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.showcase.v1beta1.StreamingSequenceReport.Attempt parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.StreamingSequenceReport.Attempt parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.StreamingSequenceReport.Attempt parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.StreamingSequenceReport.Attempt 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.showcase.v1beta1.StreamingSequenceReport.Attempt parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.StreamingSequenceReport.Attempt 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.showcase.v1beta1.StreamingSequenceReport.Attempt parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.StreamingSequenceReport.Attempt 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.showcase.v1beta1.StreamingSequenceReport.Attempt prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
        +     * Contains metrics on individual RPC Attempts in a sequence.
        +     * 
        + * + * Protobuf type {@code google.showcase.v1beta1.StreamingSequenceReport.Attempt} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.StreamingSequenceReport.Attempt) + com.google.showcase.v1beta1.StreamingSequenceReport.AttemptOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.SequenceOuterClass + .internal_static_google_showcase_v1beta1_StreamingSequenceReport_Attempt_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.SequenceOuterClass + .internal_static_google_showcase_v1beta1_StreamingSequenceReport_Attempt_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.StreamingSequenceReport.Attempt.class, + com.google.showcase.v1beta1.StreamingSequenceReport.Attempt.Builder.class); + } + + // Construct using com.google.showcase.v1beta1.StreamingSequenceReport.Attempt.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + attemptNumber_ = 0; + + if (attemptDeadlineBuilder_ == null) { + attemptDeadline_ = null; + } else { + attemptDeadline_ = null; + attemptDeadlineBuilder_ = null; + } + if (responseTimeBuilder_ == null) { + responseTime_ = null; + } else { + responseTime_ = null; + responseTimeBuilder_ = null; + } + if (attemptDelayBuilder_ == null) { + attemptDelay_ = null; + } else { + attemptDelay_ = null; + attemptDelayBuilder_ = null; + } + if (statusBuilder_ == null) { + status_ = null; + } else { + status_ = null; + statusBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.showcase.v1beta1.SequenceOuterClass + .internal_static_google_showcase_v1beta1_StreamingSequenceReport_Attempt_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.StreamingSequenceReport.Attempt + getDefaultInstanceForType() { + return com.google.showcase.v1beta1.StreamingSequenceReport.Attempt.getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.StreamingSequenceReport.Attempt build() { + com.google.showcase.v1beta1.StreamingSequenceReport.Attempt result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.StreamingSequenceReport.Attempt buildPartial() { + com.google.showcase.v1beta1.StreamingSequenceReport.Attempt result = + new com.google.showcase.v1beta1.StreamingSequenceReport.Attempt(this); + result.attemptNumber_ = attemptNumber_; + if (attemptDeadlineBuilder_ == null) { + result.attemptDeadline_ = attemptDeadline_; + } else { + result.attemptDeadline_ = attemptDeadlineBuilder_.build(); + } + if (responseTimeBuilder_ == null) { + result.responseTime_ = responseTime_; + } else { + result.responseTime_ = responseTimeBuilder_.build(); + } + if (attemptDelayBuilder_ == null) { + result.attemptDelay_ = attemptDelay_; + } else { + result.attemptDelay_ = attemptDelayBuilder_.build(); + } + if (statusBuilder_ == null) { + result.status_ = status_; + } else { + result.status_ = statusBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, + java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.showcase.v1beta1.StreamingSequenceReport.Attempt) { + return mergeFrom((com.google.showcase.v1beta1.StreamingSequenceReport.Attempt) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.showcase.v1beta1.StreamingSequenceReport.Attempt other) { + if (other + == com.google.showcase.v1beta1.StreamingSequenceReport.Attempt.getDefaultInstance()) + return this; + if (other.getAttemptNumber() != 0) { + setAttemptNumber(other.getAttemptNumber()); + } + if (other.hasAttemptDeadline()) { + mergeAttemptDeadline(other.getAttemptDeadline()); + } + if (other.hasResponseTime()) { + mergeResponseTime(other.getResponseTime()); + } + if (other.hasAttemptDelay()) { + mergeAttemptDelay(other.getAttemptDelay()); + } + if (other.hasStatus()) { + mergeStatus(other.getStatus()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.showcase.v1beta1.StreamingSequenceReport.Attempt parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.showcase.v1beta1.StreamingSequenceReport.Attempt) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int attemptNumber_; + + /** + * + * + *
        +       * The attempt number - starting at 0.
        +       * 
        + * + * int32 attempt_number = 1; + * + * @return The attemptNumber. + */ + @java.lang.Override + public int getAttemptNumber() { + return attemptNumber_; + } + + /** + * + * + *
        +       * The attempt number - starting at 0.
        +       * 
        + * + * int32 attempt_number = 1; + * + * @param value The attemptNumber to set. + * @return This builder for chaining. + */ + public Builder setAttemptNumber(int value) { + + attemptNumber_ = value; + onChanged(); + return this; + } + + /** + * + * + *
        +       * The attempt number - starting at 0.
        +       * 
        + * + * int32 attempt_number = 1; + * + * @return This builder for chaining. + */ + public Builder clearAttemptNumber() { + + attemptNumber_ = 0; + onChanged(); + return this; + } + + private com.google.protobuf.Timestamp attemptDeadline_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + attemptDeadlineBuilder_; + + /** + * + * + *
        +       * The deadline dictated by the attempt to the server.
        +       * 
        + * + * .google.protobuf.Timestamp attempt_deadline = 2; + * + * @return Whether the attemptDeadline field is set. + */ + public boolean hasAttemptDeadline() { + return attemptDeadlineBuilder_ != null || attemptDeadline_ != null; + } + + /** + * + * + *
        +       * The deadline dictated by the attempt to the server.
        +       * 
        + * + * .google.protobuf.Timestamp attempt_deadline = 2; + * + * @return The attemptDeadline. + */ + public com.google.protobuf.Timestamp getAttemptDeadline() { + if (attemptDeadlineBuilder_ == null) { + return attemptDeadline_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : attemptDeadline_; + } else { + return attemptDeadlineBuilder_.getMessage(); + } + } + + /** + * + * + *
        +       * The deadline dictated by the attempt to the server.
        +       * 
        + * + * .google.protobuf.Timestamp attempt_deadline = 2; + */ + public Builder setAttemptDeadline(com.google.protobuf.Timestamp value) { + if (attemptDeadlineBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + attemptDeadline_ = value; + onChanged(); + } else { + attemptDeadlineBuilder_.setMessage(value); + } + + return this; + } + + /** + * + * + *
        +       * The deadline dictated by the attempt to the server.
        +       * 
        + * + * .google.protobuf.Timestamp attempt_deadline = 2; + */ + public Builder setAttemptDeadline(com.google.protobuf.Timestamp.Builder builderForValue) { + if (attemptDeadlineBuilder_ == null) { + attemptDeadline_ = builderForValue.build(); + onChanged(); + } else { + attemptDeadlineBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + + /** + * + * + *
        +       * The deadline dictated by the attempt to the server.
        +       * 
        + * + * .google.protobuf.Timestamp attempt_deadline = 2; + */ + public Builder mergeAttemptDeadline(com.google.protobuf.Timestamp value) { + if (attemptDeadlineBuilder_ == null) { + if (attemptDeadline_ != null) { + attemptDeadline_ = + com.google.protobuf.Timestamp.newBuilder(attemptDeadline_) + .mergeFrom(value) + .buildPartial(); + } else { + attemptDeadline_ = value; + } + onChanged(); + } else { + attemptDeadlineBuilder_.mergeFrom(value); + } + + return this; + } + + /** + * + * + *
        +       * The deadline dictated by the attempt to the server.
        +       * 
        + * + * .google.protobuf.Timestamp attempt_deadline = 2; + */ + public Builder clearAttemptDeadline() { + if (attemptDeadlineBuilder_ == null) { + attemptDeadline_ = null; + onChanged(); + } else { + attemptDeadline_ = null; + attemptDeadlineBuilder_ = null; + } + + return this; + } + + /** + * + * + *
        +       * The deadline dictated by the attempt to the server.
        +       * 
        + * + * .google.protobuf.Timestamp attempt_deadline = 2; + */ + public com.google.protobuf.Timestamp.Builder getAttemptDeadlineBuilder() { + + onChanged(); + return getAttemptDeadlineFieldBuilder().getBuilder(); + } + + /** + * + * + *
        +       * The deadline dictated by the attempt to the server.
        +       * 
        + * + * .google.protobuf.Timestamp attempt_deadline = 2; + */ + public com.google.protobuf.TimestampOrBuilder getAttemptDeadlineOrBuilder() { + if (attemptDeadlineBuilder_ != null) { + return attemptDeadlineBuilder_.getMessageOrBuilder(); + } else { + return attemptDeadline_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : attemptDeadline_; + } + } + + /** + * + * + *
        +       * The deadline dictated by the attempt to the server.
        +       * 
        + * + * .google.protobuf.Timestamp attempt_deadline = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getAttemptDeadlineFieldBuilder() { + if (attemptDeadlineBuilder_ == null) { + attemptDeadlineBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getAttemptDeadline(), getParentForChildren(), isClean()); + attemptDeadline_ = null; + } + return attemptDeadlineBuilder_; + } + + private com.google.protobuf.Timestamp responseTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + responseTimeBuilder_; + + /** + * + * + *
        +       * The time that the server responded to the RPC attempt. Used for
        +       * calculating attempt_delay.
        +       * 
        + * + * .google.protobuf.Timestamp response_time = 3; + * + * @return Whether the responseTime field is set. + */ + public boolean hasResponseTime() { + return responseTimeBuilder_ != null || responseTime_ != null; + } + + /** + * + * + *
        +       * The time that the server responded to the RPC attempt. Used for
        +       * calculating attempt_delay.
        +       * 
        + * + * .google.protobuf.Timestamp response_time = 3; + * + * @return The responseTime. + */ + public com.google.protobuf.Timestamp getResponseTime() { + if (responseTimeBuilder_ == null) { + return responseTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : responseTime_; + } else { + return responseTimeBuilder_.getMessage(); + } + } + + /** + * + * + *
        +       * The time that the server responded to the RPC attempt. Used for
        +       * calculating attempt_delay.
        +       * 
        + * + * .google.protobuf.Timestamp response_time = 3; + */ + public Builder setResponseTime(com.google.protobuf.Timestamp value) { + if (responseTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + responseTime_ = value; + onChanged(); + } else { + responseTimeBuilder_.setMessage(value); + } + + return this; + } + + /** + * + * + *
        +       * The time that the server responded to the RPC attempt. Used for
        +       * calculating attempt_delay.
        +       * 
        + * + * .google.protobuf.Timestamp response_time = 3; + */ + public Builder setResponseTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (responseTimeBuilder_ == null) { + responseTime_ = builderForValue.build(); + onChanged(); + } else { + responseTimeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + + /** + * + * + *
        +       * The time that the server responded to the RPC attempt. Used for
        +       * calculating attempt_delay.
        +       * 
        + * + * .google.protobuf.Timestamp response_time = 3; + */ + public Builder mergeResponseTime(com.google.protobuf.Timestamp value) { + if (responseTimeBuilder_ == null) { + if (responseTime_ != null) { + responseTime_ = + com.google.protobuf.Timestamp.newBuilder(responseTime_) + .mergeFrom(value) + .buildPartial(); + } else { + responseTime_ = value; + } + onChanged(); + } else { + responseTimeBuilder_.mergeFrom(value); + } + + return this; + } + + /** + * + * + *
        +       * The time that the server responded to the RPC attempt. Used for
        +       * calculating attempt_delay.
        +       * 
        + * + * .google.protobuf.Timestamp response_time = 3; + */ + public Builder clearResponseTime() { + if (responseTimeBuilder_ == null) { + responseTime_ = null; + onChanged(); + } else { + responseTime_ = null; + responseTimeBuilder_ = null; + } + + return this; + } + + /** + * + * + *
        +       * The time that the server responded to the RPC attempt. Used for
        +       * calculating attempt_delay.
        +       * 
        + * + * .google.protobuf.Timestamp response_time = 3; + */ + public com.google.protobuf.Timestamp.Builder getResponseTimeBuilder() { + + onChanged(); + return getResponseTimeFieldBuilder().getBuilder(); + } + + /** + * + * + *
        +       * The time that the server responded to the RPC attempt. Used for
        +       * calculating attempt_delay.
        +       * 
        + * + * .google.protobuf.Timestamp response_time = 3; + */ + public com.google.protobuf.TimestampOrBuilder getResponseTimeOrBuilder() { + if (responseTimeBuilder_ != null) { + return responseTimeBuilder_.getMessageOrBuilder(); + } else { + return responseTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : responseTime_; + } + } + + /** + * + * + *
        +       * The time that the server responded to the RPC attempt. Used for
        +       * calculating attempt_delay.
        +       * 
        + * + * .google.protobuf.Timestamp response_time = 3; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getResponseTimeFieldBuilder() { + if (responseTimeBuilder_ == null) { + responseTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getResponseTime(), getParentForChildren(), isClean()); + responseTime_ = null; + } + return responseTimeBuilder_; + } + + private com.google.protobuf.Duration attemptDelay_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder> + attemptDelayBuilder_; + + /** + * + * + *
        +       * The server perceived delay between sending the last response and
        +       * receiving this attempt. Used for validating attempt delay backoff.
        +       * 
        + * + * .google.protobuf.Duration attempt_delay = 4; + * + * @return Whether the attemptDelay field is set. + */ + public boolean hasAttemptDelay() { + return attemptDelayBuilder_ != null || attemptDelay_ != null; + } + + /** + * + * + *
        +       * The server perceived delay between sending the last response and
        +       * receiving this attempt. Used for validating attempt delay backoff.
        +       * 
        + * + * .google.protobuf.Duration attempt_delay = 4; + * + * @return The attemptDelay. + */ + public com.google.protobuf.Duration getAttemptDelay() { + if (attemptDelayBuilder_ == null) { + return attemptDelay_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : attemptDelay_; + } else { + return attemptDelayBuilder_.getMessage(); + } + } + + /** + * + * + *
        +       * The server perceived delay between sending the last response and
        +       * receiving this attempt. Used for validating attempt delay backoff.
        +       * 
        + * + * .google.protobuf.Duration attempt_delay = 4; + */ + public Builder setAttemptDelay(com.google.protobuf.Duration value) { + if (attemptDelayBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + attemptDelay_ = value; + onChanged(); + } else { + attemptDelayBuilder_.setMessage(value); + } + + return this; + } + + /** + * + * + *
        +       * The server perceived delay between sending the last response and
        +       * receiving this attempt. Used for validating attempt delay backoff.
        +       * 
        + * + * .google.protobuf.Duration attempt_delay = 4; + */ + public Builder setAttemptDelay(com.google.protobuf.Duration.Builder builderForValue) { + if (attemptDelayBuilder_ == null) { + attemptDelay_ = builderForValue.build(); + onChanged(); + } else { + attemptDelayBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + + /** + * + * + *
        +       * The server perceived delay between sending the last response and
        +       * receiving this attempt. Used for validating attempt delay backoff.
        +       * 
        + * + * .google.protobuf.Duration attempt_delay = 4; + */ + public Builder mergeAttemptDelay(com.google.protobuf.Duration value) { + if (attemptDelayBuilder_ == null) { + if (attemptDelay_ != null) { + attemptDelay_ = + com.google.protobuf.Duration.newBuilder(attemptDelay_) + .mergeFrom(value) + .buildPartial(); + } else { + attemptDelay_ = value; + } + onChanged(); + } else { + attemptDelayBuilder_.mergeFrom(value); + } + + return this; + } + + /** + * + * + *
        +       * The server perceived delay between sending the last response and
        +       * receiving this attempt. Used for validating attempt delay backoff.
        +       * 
        + * + * .google.protobuf.Duration attempt_delay = 4; + */ + public Builder clearAttemptDelay() { + if (attemptDelayBuilder_ == null) { + attemptDelay_ = null; + onChanged(); + } else { + attemptDelay_ = null; + attemptDelayBuilder_ = null; + } + + return this; + } + + /** + * + * + *
        +       * The server perceived delay between sending the last response and
        +       * receiving this attempt. Used for validating attempt delay backoff.
        +       * 
        + * + * .google.protobuf.Duration attempt_delay = 4; + */ + public com.google.protobuf.Duration.Builder getAttemptDelayBuilder() { + + onChanged(); + return getAttemptDelayFieldBuilder().getBuilder(); + } + + /** + * + * + *
        +       * The server perceived delay between sending the last response and
        +       * receiving this attempt. Used for validating attempt delay backoff.
        +       * 
        + * + * .google.protobuf.Duration attempt_delay = 4; + */ + public com.google.protobuf.DurationOrBuilder getAttemptDelayOrBuilder() { + if (attemptDelayBuilder_ != null) { + return attemptDelayBuilder_.getMessageOrBuilder(); + } else { + return attemptDelay_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : attemptDelay_; + } + } + + /** + * + * + *
        +       * The server perceived delay between sending the last response and
        +       * receiving this attempt. Used for validating attempt delay backoff.
        +       * 
        + * + * .google.protobuf.Duration attempt_delay = 4; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder> + getAttemptDelayFieldBuilder() { + if (attemptDelayBuilder_ == null) { + attemptDelayBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder>( + getAttemptDelay(), getParentForChildren(), isClean()); + attemptDelay_ = null; + } + return attemptDelayBuilder_; + } + + private com.google.rpc.Status status_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.rpc.Status, com.google.rpc.Status.Builder, com.google.rpc.StatusOrBuilder> + statusBuilder_; + + /** + * + * + *
        +       * The status returned to the attempt.
        +       * 
        + * + * .google.rpc.Status status = 5; + * + * @return Whether the status field is set. + */ + public boolean hasStatus() { + return statusBuilder_ != null || status_ != null; + } + + /** + * + * + *
        +       * The status returned to the attempt.
        +       * 
        + * + * .google.rpc.Status status = 5; + * + * @return The status. + */ + public com.google.rpc.Status getStatus() { + if (statusBuilder_ == null) { + return status_ == null ? com.google.rpc.Status.getDefaultInstance() : status_; + } else { + return statusBuilder_.getMessage(); + } + } + + /** + * + * + *
        +       * The status returned to the attempt.
        +       * 
        + * + * .google.rpc.Status status = 5; + */ + public Builder setStatus(com.google.rpc.Status value) { + if (statusBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + status_ = value; + onChanged(); + } else { + statusBuilder_.setMessage(value); + } + + return this; + } + + /** + * + * + *
        +       * The status returned to the attempt.
        +       * 
        + * + * .google.rpc.Status status = 5; + */ + public Builder setStatus(com.google.rpc.Status.Builder builderForValue) { + if (statusBuilder_ == null) { + status_ = builderForValue.build(); + onChanged(); + } else { + statusBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + + /** + * + * + *
        +       * The status returned to the attempt.
        +       * 
        + * + * .google.rpc.Status status = 5; + */ + public Builder mergeStatus(com.google.rpc.Status value) { + if (statusBuilder_ == null) { + if (status_ != null) { + status_ = com.google.rpc.Status.newBuilder(status_).mergeFrom(value).buildPartial(); + } else { + status_ = value; + } + onChanged(); + } else { + statusBuilder_.mergeFrom(value); + } + + return this; + } + + /** + * + * + *
        +       * The status returned to the attempt.
        +       * 
        + * + * .google.rpc.Status status = 5; + */ + public Builder clearStatus() { + if (statusBuilder_ == null) { + status_ = null; + onChanged(); + } else { + status_ = null; + statusBuilder_ = null; + } + + return this; + } + + /** + * + * + *
        +       * The status returned to the attempt.
        +       * 
        + * + * .google.rpc.Status status = 5; + */ + public com.google.rpc.Status.Builder getStatusBuilder() { + + onChanged(); + return getStatusFieldBuilder().getBuilder(); + } + + /** + * + * + *
        +       * The status returned to the attempt.
        +       * 
        + * + * .google.rpc.Status status = 5; + */ + public com.google.rpc.StatusOrBuilder getStatusOrBuilder() { + if (statusBuilder_ != null) { + return statusBuilder_.getMessageOrBuilder(); + } else { + return status_ == null ? com.google.rpc.Status.getDefaultInstance() : status_; + } + } + + /** + * + * + *
        +       * The status returned to the attempt.
        +       * 
        + * + * .google.rpc.Status status = 5; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.rpc.Status, com.google.rpc.Status.Builder, com.google.rpc.StatusOrBuilder> + getStatusFieldBuilder() { + if (statusBuilder_ == null) { + statusBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.rpc.Status, + com.google.rpc.Status.Builder, + com.google.rpc.StatusOrBuilder>(getStatus(), getParentForChildren(), isClean()); + status_ = null; + } + return statusBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.showcase.v1beta1.StreamingSequenceReport.Attempt) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.StreamingSequenceReport.Attempt) + private static final com.google.showcase.v1beta1.StreamingSequenceReport.Attempt + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.StreamingSequenceReport.Attempt(); + } + + public static com.google.showcase.v1beta1.StreamingSequenceReport.Attempt getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Attempt parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Attempt(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.showcase.v1beta1.StreamingSequenceReport.Attempt getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + + /** + * 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; + } + } + + /** + * 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 ATTEMPTS_FIELD_NUMBER = 2; + private java.util.List attempts_; + + /** + * + * + *
        +   * The set of RPC attempts received by the server for a Sequence.
        +   * 
        + * + * repeated .google.showcase.v1beta1.StreamingSequenceReport.Attempt attempts = 2; + */ + @java.lang.Override + public java.util.List + getAttemptsList() { + return attempts_; + } + + /** + * + * + *
        +   * The set of RPC attempts received by the server for a Sequence.
        +   * 
        + * + * repeated .google.showcase.v1beta1.StreamingSequenceReport.Attempt attempts = 2; + */ + @java.lang.Override + public java.util.List< + ? extends com.google.showcase.v1beta1.StreamingSequenceReport.AttemptOrBuilder> + getAttemptsOrBuilderList() { + return attempts_; + } + + /** + * + * + *
        +   * The set of RPC attempts received by the server for a Sequence.
        +   * 
        + * + * repeated .google.showcase.v1beta1.StreamingSequenceReport.Attempt attempts = 2; + */ + @java.lang.Override + public int getAttemptsCount() { + return attempts_.size(); + } + + /** + * + * + *
        +   * The set of RPC attempts received by the server for a Sequence.
        +   * 
        + * + * repeated .google.showcase.v1beta1.StreamingSequenceReport.Attempt attempts = 2; + */ + @java.lang.Override + public com.google.showcase.v1beta1.StreamingSequenceReport.Attempt getAttempts(int index) { + return attempts_.get(index); + } + + /** + * + * + *
        +   * The set of RPC attempts received by the server for a Sequence.
        +   * 
        + * + * repeated .google.showcase.v1beta1.StreamingSequenceReport.Attempt attempts = 2; + */ + @java.lang.Override + public com.google.showcase.v1beta1.StreamingSequenceReport.AttemptOrBuilder getAttemptsOrBuilder( + int index) { + return attempts_.get(index); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + for (int i = 0; i < attempts_.size(); i++) { + output.writeMessage(2, attempts_.get(i)); + } + unknownFields.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_); + } + for (int i = 0; i < attempts_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, attempts_.get(i)); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.showcase.v1beta1.StreamingSequenceReport)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.StreamingSequenceReport other = + (com.google.showcase.v1beta1.StreamingSequenceReport) obj; + + if (!getName().equals(other.getName())) return false; + if (!getAttemptsList().equals(other.getAttemptsList())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + if (getAttemptsCount() > 0) { + hash = (37 * hash) + ATTEMPTS_FIELD_NUMBER; + hash = (53 * hash) + getAttemptsList().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.showcase.v1beta1.StreamingSequenceReport parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.StreamingSequenceReport parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.StreamingSequenceReport parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.StreamingSequenceReport 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.showcase.v1beta1.StreamingSequenceReport parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.StreamingSequenceReport parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.StreamingSequenceReport parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.StreamingSequenceReport 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.showcase.v1beta1.StreamingSequenceReport parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.StreamingSequenceReport 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.showcase.v1beta1.StreamingSequenceReport parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.StreamingSequenceReport 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.showcase.v1beta1.StreamingSequenceReport prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** Protobuf type {@code google.showcase.v1beta1.StreamingSequenceReport} */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.StreamingSequenceReport) + com.google.showcase.v1beta1.StreamingSequenceReportOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.SequenceOuterClass + .internal_static_google_showcase_v1beta1_StreamingSequenceReport_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.SequenceOuterClass + .internal_static_google_showcase_v1beta1_StreamingSequenceReport_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.StreamingSequenceReport.class, + com.google.showcase.v1beta1.StreamingSequenceReport.Builder.class); + } + + // Construct using com.google.showcase.v1beta1.StreamingSequenceReport.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getAttemptsFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + if (attemptsBuilder_ == null) { + attempts_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + attemptsBuilder_.clear(); + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.showcase.v1beta1.SequenceOuterClass + .internal_static_google_showcase_v1beta1_StreamingSequenceReport_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.StreamingSequenceReport getDefaultInstanceForType() { + return com.google.showcase.v1beta1.StreamingSequenceReport.getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.StreamingSequenceReport build() { + com.google.showcase.v1beta1.StreamingSequenceReport result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.StreamingSequenceReport buildPartial() { + com.google.showcase.v1beta1.StreamingSequenceReport result = + new com.google.showcase.v1beta1.StreamingSequenceReport(this); + int from_bitField0_ = bitField0_; + result.name_ = name_; + if (attemptsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + attempts_ = java.util.Collections.unmodifiableList(attempts_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.attempts_ = attempts_; + } else { + result.attempts_ = attemptsBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.showcase.v1beta1.StreamingSequenceReport) { + return mergeFrom((com.google.showcase.v1beta1.StreamingSequenceReport) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.showcase.v1beta1.StreamingSequenceReport other) { + if (other == com.google.showcase.v1beta1.StreamingSequenceReport.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + if (attemptsBuilder_ == null) { + if (!other.attempts_.isEmpty()) { + if (attempts_.isEmpty()) { + attempts_ = other.attempts_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureAttemptsIsMutable(); + attempts_.addAll(other.attempts_); + } + onChanged(); + } + } else { + if (!other.attempts_.isEmpty()) { + if (attemptsBuilder_.isEmpty()) { + attemptsBuilder_.dispose(); + attemptsBuilder_ = null; + attempts_ = other.attempts_; + bitField0_ = (bitField0_ & ~0x00000001); + attemptsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getAttemptsFieldBuilder() + : null; + } else { + attemptsBuilder_.addAllMessages(other.attempts_); + } + } + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.showcase.v1beta1.StreamingSequenceReport parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.showcase.v1beta1.StreamingSequenceReport) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + + /** + * 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; + } + } + + /** + * 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; + } + } + + /** + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + + /** + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + + /** + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + + private java.util.List attempts_ = + java.util.Collections.emptyList(); + + private void ensureAttemptsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + attempts_ = + new java.util.ArrayList( + attempts_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.showcase.v1beta1.StreamingSequenceReport.Attempt, + com.google.showcase.v1beta1.StreamingSequenceReport.Attempt.Builder, + com.google.showcase.v1beta1.StreamingSequenceReport.AttemptOrBuilder> + attemptsBuilder_; + + /** + * + * + *
        +     * The set of RPC attempts received by the server for a Sequence.
        +     * 
        + * + * repeated .google.showcase.v1beta1.StreamingSequenceReport.Attempt attempts = 2; + */ + public java.util.List + getAttemptsList() { + if (attemptsBuilder_ == null) { + return java.util.Collections.unmodifiableList(attempts_); + } else { + return attemptsBuilder_.getMessageList(); + } + } + + /** + * + * + *
        +     * The set of RPC attempts received by the server for a Sequence.
        +     * 
        + * + * repeated .google.showcase.v1beta1.StreamingSequenceReport.Attempt attempts = 2; + */ + public int getAttemptsCount() { + if (attemptsBuilder_ == null) { + return attempts_.size(); + } else { + return attemptsBuilder_.getCount(); + } + } + + /** + * + * + *
        +     * The set of RPC attempts received by the server for a Sequence.
        +     * 
        + * + * repeated .google.showcase.v1beta1.StreamingSequenceReport.Attempt attempts = 2; + */ + public com.google.showcase.v1beta1.StreamingSequenceReport.Attempt getAttempts(int index) { + if (attemptsBuilder_ == null) { + return attempts_.get(index); + } else { + return attemptsBuilder_.getMessage(index); + } + } + + /** + * + * + *
        +     * The set of RPC attempts received by the server for a Sequence.
        +     * 
        + * + * repeated .google.showcase.v1beta1.StreamingSequenceReport.Attempt attempts = 2; + */ + public Builder setAttempts( + int index, com.google.showcase.v1beta1.StreamingSequenceReport.Attempt value) { + if (attemptsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureAttemptsIsMutable(); + attempts_.set(index, value); + onChanged(); + } else { + attemptsBuilder_.setMessage(index, value); + } + return this; + } + + /** + * + * + *
        +     * The set of RPC attempts received by the server for a Sequence.
        +     * 
        + * + * repeated .google.showcase.v1beta1.StreamingSequenceReport.Attempt attempts = 2; + */ + public Builder setAttempts( + int index, + com.google.showcase.v1beta1.StreamingSequenceReport.Attempt.Builder builderForValue) { + if (attemptsBuilder_ == null) { + ensureAttemptsIsMutable(); + attempts_.set(index, builderForValue.build()); + onChanged(); + } else { + attemptsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
        +     * The set of RPC attempts received by the server for a Sequence.
        +     * 
        + * + * repeated .google.showcase.v1beta1.StreamingSequenceReport.Attempt attempts = 2; + */ + public Builder addAttempts(com.google.showcase.v1beta1.StreamingSequenceReport.Attempt value) { + if (attemptsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureAttemptsIsMutable(); + attempts_.add(value); + onChanged(); + } else { + attemptsBuilder_.addMessage(value); + } + return this; + } + + /** + * + * + *
        +     * The set of RPC attempts received by the server for a Sequence.
        +     * 
        + * + * repeated .google.showcase.v1beta1.StreamingSequenceReport.Attempt attempts = 2; + */ + public Builder addAttempts( + int index, com.google.showcase.v1beta1.StreamingSequenceReport.Attempt value) { + if (attemptsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureAttemptsIsMutable(); + attempts_.add(index, value); + onChanged(); + } else { + attemptsBuilder_.addMessage(index, value); + } + return this; + } + + /** + * + * + *
        +     * The set of RPC attempts received by the server for a Sequence.
        +     * 
        + * + * repeated .google.showcase.v1beta1.StreamingSequenceReport.Attempt attempts = 2; + */ + public Builder addAttempts( + com.google.showcase.v1beta1.StreamingSequenceReport.Attempt.Builder builderForValue) { + if (attemptsBuilder_ == null) { + ensureAttemptsIsMutable(); + attempts_.add(builderForValue.build()); + onChanged(); + } else { + attemptsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + + /** + * + * + *
        +     * The set of RPC attempts received by the server for a Sequence.
        +     * 
        + * + * repeated .google.showcase.v1beta1.StreamingSequenceReport.Attempt attempts = 2; + */ + public Builder addAttempts( + int index, + com.google.showcase.v1beta1.StreamingSequenceReport.Attempt.Builder builderForValue) { + if (attemptsBuilder_ == null) { + ensureAttemptsIsMutable(); + attempts_.add(index, builderForValue.build()); + onChanged(); + } else { + attemptsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
        +     * The set of RPC attempts received by the server for a Sequence.
        +     * 
        + * + * repeated .google.showcase.v1beta1.StreamingSequenceReport.Attempt attempts = 2; + */ + public Builder addAllAttempts( + java.lang.Iterable + values) { + if (attemptsBuilder_ == null) { + ensureAttemptsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, attempts_); + onChanged(); + } else { + attemptsBuilder_.addAllMessages(values); + } + return this; + } + + /** + * + * + *
        +     * The set of RPC attempts received by the server for a Sequence.
        +     * 
        + * + * repeated .google.showcase.v1beta1.StreamingSequenceReport.Attempt attempts = 2; + */ + public Builder clearAttempts() { + if (attemptsBuilder_ == null) { + attempts_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + attemptsBuilder_.clear(); + } + return this; + } + + /** + * + * + *
        +     * The set of RPC attempts received by the server for a Sequence.
        +     * 
        + * + * repeated .google.showcase.v1beta1.StreamingSequenceReport.Attempt attempts = 2; + */ + public Builder removeAttempts(int index) { + if (attemptsBuilder_ == null) { + ensureAttemptsIsMutable(); + attempts_.remove(index); + onChanged(); + } else { + attemptsBuilder_.remove(index); + } + return this; + } + + /** + * + * + *
        +     * The set of RPC attempts received by the server for a Sequence.
        +     * 
        + * + * repeated .google.showcase.v1beta1.StreamingSequenceReport.Attempt attempts = 2; + */ + public com.google.showcase.v1beta1.StreamingSequenceReport.Attempt.Builder getAttemptsBuilder( + int index) { + return getAttemptsFieldBuilder().getBuilder(index); + } + + /** + * + * + *
        +     * The set of RPC attempts received by the server for a Sequence.
        +     * 
        + * + * repeated .google.showcase.v1beta1.StreamingSequenceReport.Attempt attempts = 2; + */ + public com.google.showcase.v1beta1.StreamingSequenceReport.AttemptOrBuilder + getAttemptsOrBuilder(int index) { + if (attemptsBuilder_ == null) { + return attempts_.get(index); + } else { + return attemptsBuilder_.getMessageOrBuilder(index); + } + } + + /** + * + * + *
        +     * The set of RPC attempts received by the server for a Sequence.
        +     * 
        + * + * repeated .google.showcase.v1beta1.StreamingSequenceReport.Attempt attempts = 2; + */ + public java.util.List< + ? extends com.google.showcase.v1beta1.StreamingSequenceReport.AttemptOrBuilder> + getAttemptsOrBuilderList() { + if (attemptsBuilder_ != null) { + return attemptsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(attempts_); + } + } + + /** + * + * + *
        +     * The set of RPC attempts received by the server for a Sequence.
        +     * 
        + * + * repeated .google.showcase.v1beta1.StreamingSequenceReport.Attempt attempts = 2; + */ + public com.google.showcase.v1beta1.StreamingSequenceReport.Attempt.Builder + addAttemptsBuilder() { + return getAttemptsFieldBuilder() + .addBuilder( + com.google.showcase.v1beta1.StreamingSequenceReport.Attempt.getDefaultInstance()); + } + + /** + * + * + *
        +     * The set of RPC attempts received by the server for a Sequence.
        +     * 
        + * + * repeated .google.showcase.v1beta1.StreamingSequenceReport.Attempt attempts = 2; + */ + public com.google.showcase.v1beta1.StreamingSequenceReport.Attempt.Builder addAttemptsBuilder( + int index) { + return getAttemptsFieldBuilder() + .addBuilder( + index, + com.google.showcase.v1beta1.StreamingSequenceReport.Attempt.getDefaultInstance()); + } + + /** + * + * + *
        +     * The set of RPC attempts received by the server for a Sequence.
        +     * 
        + * + * repeated .google.showcase.v1beta1.StreamingSequenceReport.Attempt attempts = 2; + */ + public java.util.List + getAttemptsBuilderList() { + return getAttemptsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.showcase.v1beta1.StreamingSequenceReport.Attempt, + com.google.showcase.v1beta1.StreamingSequenceReport.Attempt.Builder, + com.google.showcase.v1beta1.StreamingSequenceReport.AttemptOrBuilder> + getAttemptsFieldBuilder() { + if (attemptsBuilder_ == null) { + attemptsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.showcase.v1beta1.StreamingSequenceReport.Attempt, + com.google.showcase.v1beta1.StreamingSequenceReport.Attempt.Builder, + com.google.showcase.v1beta1.StreamingSequenceReport.AttemptOrBuilder>( + attempts_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + attempts_ = null; + } + return attemptsBuilder_; + } + + @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.showcase.v1beta1.StreamingSequenceReport) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.StreamingSequenceReport) + private static final com.google.showcase.v1beta1.StreamingSequenceReport DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.StreamingSequenceReport(); + } + + public static com.google.showcase.v1beta1.StreamingSequenceReport getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public StreamingSequenceReport parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new StreamingSequenceReport(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.showcase.v1beta1.StreamingSequenceReport getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/StreamingSequenceReportName.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/StreamingSequenceReportName.java new file mode 100644 index 0000000000..d3e5c33ade --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/StreamingSequenceReportName.java @@ -0,0 +1,170 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1; + +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +@Generated("by gapic-generator-java") +public class StreamingSequenceReportName implements ResourceName { + private static final PathTemplate STREAMING_SEQUENCE = + PathTemplate.createWithoutUrlEncoding( + "streamingSequences/{streaming_sequence}/streamingSequenceReport"); + private volatile Map fieldValuesMap; + private final String streamingSequence; + + @Deprecated + protected StreamingSequenceReportName() { + streamingSequence = null; + } + + private StreamingSequenceReportName(Builder builder) { + streamingSequence = Preconditions.checkNotNull(builder.getStreamingSequence()); + } + + public String getStreamingSequence() { + return streamingSequence; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + public static StreamingSequenceReportName of(String streamingSequence) { + return newBuilder().setStreamingSequence(streamingSequence).build(); + } + + public static String format(String streamingSequence) { + return newBuilder().setStreamingSequence(streamingSequence).build().toString(); + } + + public static StreamingSequenceReportName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + STREAMING_SEQUENCE.validatedMatch( + formattedString, + "StreamingSequenceReportName.parse: formattedString not in valid format"); + return of(matchMap.get("streaming_sequence")); + } + + 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 (StreamingSequenceReportName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return STREAMING_SEQUENCE.matches(formattedString); + } + + @Override + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + if (streamingSequence != null) { + fieldMapBuilder.put("streaming_sequence", streamingSequence); + } + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return STREAMING_SEQUENCE.instantiate("streaming_sequence", streamingSequence); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o != null && getClass() == o.getClass()) { + StreamingSequenceReportName that = ((StreamingSequenceReportName) o); + return Objects.equals(this.streamingSequence, that.streamingSequence); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= Objects.hashCode(streamingSequence); + return h; + } + + /** Builder for streamingSequences/{streaming_sequence}/streamingSequenceReport. */ + public static class Builder { + private String streamingSequence; + + protected Builder() {} + + public String getStreamingSequence() { + return streamingSequence; + } + + public Builder setStreamingSequence(String streamingSequence) { + this.streamingSequence = streamingSequence; + return this; + } + + private Builder(StreamingSequenceReportName streamingSequenceReportName) { + this.streamingSequence = streamingSequenceReportName.streamingSequence; + } + + public StreamingSequenceReportName build() { + return new StreamingSequenceReportName(this); + } + } +} diff --git a/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/StreamingSequenceReportOrBuilder.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/StreamingSequenceReportOrBuilder.java new file mode 100644 index 0000000000..0fa913ae50 --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/StreamingSequenceReportOrBuilder.java @@ -0,0 +1,96 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/sequence.proto + +package com.google.showcase.v1beta1; + +public interface StreamingSequenceReportOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.StreamingSequenceReport) + com.google.protobuf.MessageOrBuilder { + + /** + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The name. + */ + java.lang.String getName(); + + /** + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
        +   * The set of RPC attempts received by the server for a Sequence.
        +   * 
        + * + * repeated .google.showcase.v1beta1.StreamingSequenceReport.Attempt attempts = 2; + */ + java.util.List getAttemptsList(); + + /** + * + * + *
        +   * The set of RPC attempts received by the server for a Sequence.
        +   * 
        + * + * repeated .google.showcase.v1beta1.StreamingSequenceReport.Attempt attempts = 2; + */ + com.google.showcase.v1beta1.StreamingSequenceReport.Attempt getAttempts(int index); + + /** + * + * + *
        +   * The set of RPC attempts received by the server for a Sequence.
        +   * 
        + * + * repeated .google.showcase.v1beta1.StreamingSequenceReport.Attempt attempts = 2; + */ + int getAttemptsCount(); + + /** + * + * + *
        +   * The set of RPC attempts received by the server for a Sequence.
        +   * 
        + * + * repeated .google.showcase.v1beta1.StreamingSequenceReport.Attempt attempts = 2; + */ + java.util.List + getAttemptsOrBuilderList(); + + /** + * + * + *
        +   * The set of RPC attempts received by the server for a Sequence.
        +   * 
        + * + * repeated .google.showcase.v1beta1.StreamingSequenceReport.Attempt attempts = 2; + */ + com.google.showcase.v1beta1.StreamingSequenceReport.AttemptOrBuilder getAttemptsOrBuilder( + int index); +} diff --git a/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/Test.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/Test.java new file mode 100644 index 0000000000..0df6475834 --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/Test.java @@ -0,0 +1,4374 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/testing.proto + +package com.google.showcase.v1beta1; + +/** Protobuf type {@code google.showcase.v1beta1.Test} */ +public final class Test extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.Test) + TestOrBuilder { + private static final long serialVersionUID = 0L; + + // Use Test.newBuilder() to construct. + private Test(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Test() { + name_ = ""; + expectationLevel_ = 0; + description_ = ""; + blueprints_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Test(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private Test( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + break; + } + case 16: + { + int rawValue = input.readEnum(); + + expectationLevel_ = rawValue; + break; + } + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + + description_ = s; + break; + } + case 34: + { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + blueprints_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + blueprints_.add( + input.readMessage( + com.google.showcase.v1beta1.Test.Blueprint.parser(), extensionRegistry)); + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + blueprints_ = java.util.Collections.unmodifiableList(blueprints_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.TestingOuterClass + .internal_static_google_showcase_v1beta1_Test_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.TestingOuterClass + .internal_static_google_showcase_v1beta1_Test_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.Test.class, com.google.showcase.v1beta1.Test.Builder.class); + } + + /** + * + * + *
        +   * Whether or not a test is required, recommended, or optional.
        +   * 
        + * + * Protobuf enum {@code google.showcase.v1beta1.Test.ExpectationLevel} + */ + public enum ExpectationLevel implements com.google.protobuf.ProtocolMessageEnum { + /** EXPECTATION_LEVEL_UNSPECIFIED = 0; */ + EXPECTATION_LEVEL_UNSPECIFIED(0), + /** + * + * + *
        +     * This test is strictly required.
        +     * 
        + * + * REQUIRED = 1; + */ + REQUIRED(1), + /** + * + * + *
        +     * This test is recommended.
        +     * If a generator explicitly ignores a recommended test (see `DeleteTest`),
        +     * then the report may still pass, but with a warning.
        +     * If a generator skips a recommended test and does not explicitly
        +     * express that intention, the report will fail.
        +     * 
        + * + * RECOMMENDED = 2; + */ + RECOMMENDED(2), + /** + * + * + *
        +     * This test is optional.
        +     * If a generator explicitly ignores an optional test (see `DeleteTest`),
        +     * then the report may still pass, and no warning will be issued.
        +     * If a generator skips an optional test and does not explicitly
        +     * express that intention, the report may still pass, but with a
        +     * warning.
        +     * 
        + * + * OPTIONAL = 3; + */ + OPTIONAL(3), + UNRECOGNIZED(-1), + ; + + /** EXPECTATION_LEVEL_UNSPECIFIED = 0; */ + public static final int EXPECTATION_LEVEL_UNSPECIFIED_VALUE = 0; + + /** + * + * + *
        +     * This test is strictly required.
        +     * 
        + * + * REQUIRED = 1; + */ + public static final int REQUIRED_VALUE = 1; + + /** + * + * + *
        +     * This test is recommended.
        +     * If a generator explicitly ignores a recommended test (see `DeleteTest`),
        +     * then the report may still pass, but with a warning.
        +     * If a generator skips a recommended test and does not explicitly
        +     * express that intention, the report will fail.
        +     * 
        + * + * RECOMMENDED = 2; + */ + public static final int RECOMMENDED_VALUE = 2; + + /** + * + * + *
        +     * This test is optional.
        +     * If a generator explicitly ignores an optional test (see `DeleteTest`),
        +     * then the report may still pass, and no warning will be issued.
        +     * If a generator skips an optional test and does not explicitly
        +     * express that intention, the report may still pass, but with a
        +     * warning.
        +     * 
        + * + * OPTIONAL = 3; + */ + public static final int OPTIONAL_VALUE = 3; + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static ExpectationLevel 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 ExpectationLevel forNumber(int value) { + switch (value) { + case 0: + return EXPECTATION_LEVEL_UNSPECIFIED; + case 1: + return REQUIRED; + case 2: + return RECOMMENDED; + case 3: + return OPTIONAL; + 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 ExpectationLevel findValueByNumber(int number) { + return ExpectationLevel.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.showcase.v1beta1.Test.getDescriptor().getEnumTypes().get(0); + } + + private static final ExpectationLevel[] VALUES = values(); + + public static ExpectationLevel 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 ExpectationLevel(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.showcase.v1beta1.Test.ExpectationLevel) + } + + public interface BlueprintOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.Test.Blueprint) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
        +     * The name of this blueprint.
        +     * 
        + * + * string name = 1; + * + * @return The name. + */ + java.lang.String getName(); + + /** + * + * + *
        +     * The name of this blueprint.
        +     * 
        + * + * string name = 1; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
        +     * A description of this blueprint.
        +     * 
        + * + * string description = 2; + * + * @return The description. + */ + java.lang.String getDescription(); + + /** + * + * + *
        +     * A description of this blueprint.
        +     * 
        + * + * string description = 2; + * + * @return The bytes for description. + */ + com.google.protobuf.ByteString getDescriptionBytes(); + + /** + * + * + *
        +     * The initial request to trigger this test.
        +     * 
        + * + * .google.showcase.v1beta1.Test.Blueprint.Invocation request = 3; + * + * @return Whether the request field is set. + */ + boolean hasRequest(); + + /** + * + * + *
        +     * The initial request to trigger this test.
        +     * 
        + * + * .google.showcase.v1beta1.Test.Blueprint.Invocation request = 3; + * + * @return The request. + */ + com.google.showcase.v1beta1.Test.Blueprint.Invocation getRequest(); + + /** + * + * + *
        +     * The initial request to trigger this test.
        +     * 
        + * + * .google.showcase.v1beta1.Test.Blueprint.Invocation request = 3; + */ + com.google.showcase.v1beta1.Test.Blueprint.InvocationOrBuilder getRequestOrBuilder(); + + /** + * + * + *
        +     * An ordered list of method calls that can be called to trigger this test.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Test.Blueprint.Invocation additional_requests = 4; + * + */ + java.util.List + getAdditionalRequestsList(); + + /** + * + * + *
        +     * An ordered list of method calls that can be called to trigger this test.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Test.Blueprint.Invocation additional_requests = 4; + * + */ + com.google.showcase.v1beta1.Test.Blueprint.Invocation getAdditionalRequests(int index); + + /** + * + * + *
        +     * An ordered list of method calls that can be called to trigger this test.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Test.Blueprint.Invocation additional_requests = 4; + * + */ + int getAdditionalRequestsCount(); + + /** + * + * + *
        +     * An ordered list of method calls that can be called to trigger this test.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Test.Blueprint.Invocation additional_requests = 4; + * + */ + java.util.List + getAdditionalRequestsOrBuilderList(); + + /** + * + * + *
        +     * An ordered list of method calls that can be called to trigger this test.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Test.Blueprint.Invocation additional_requests = 4; + * + */ + com.google.showcase.v1beta1.Test.Blueprint.InvocationOrBuilder getAdditionalRequestsOrBuilder( + int index); + } + + /** + * + * + *
        +   * A blueprint is an explicit definition of methods and requests that are needed
        +   * to be made to test this specific test case. Ideally this would be represented
        +   * by something more robust like CEL, but as of writing this, I am unsure if CEL
        +   * is ready.
        +   * 
        + * + * Protobuf type {@code google.showcase.v1beta1.Test.Blueprint} + */ + public static final class Blueprint extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.Test.Blueprint) + BlueprintOrBuilder { + private static final long serialVersionUID = 0L; + + // Use Blueprint.newBuilder() to construct. + private Blueprint(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Blueprint() { + name_ = ""; + description_ = ""; + additionalRequests_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Blueprint(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private Blueprint( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + description_ = s; + break; + } + case 26: + { + com.google.showcase.v1beta1.Test.Blueprint.Invocation.Builder subBuilder = null; + if (request_ != null) { + subBuilder = request_.toBuilder(); + } + request_ = + input.readMessage( + com.google.showcase.v1beta1.Test.Blueprint.Invocation.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(request_); + request_ = subBuilder.buildPartial(); + } + + break; + } + case 34: + { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + additionalRequests_ = + new java.util.ArrayList< + com.google.showcase.v1beta1.Test.Blueprint.Invocation>(); + mutable_bitField0_ |= 0x00000001; + } + additionalRequests_.add( + input.readMessage( + com.google.showcase.v1beta1.Test.Blueprint.Invocation.parser(), + extensionRegistry)); + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + additionalRequests_ = java.util.Collections.unmodifiableList(additionalRequests_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.TestingOuterClass + .internal_static_google_showcase_v1beta1_Test_Blueprint_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.TestingOuterClass + .internal_static_google_showcase_v1beta1_Test_Blueprint_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.Test.Blueprint.class, + com.google.showcase.v1beta1.Test.Blueprint.Builder.class); + } + + public interface InvocationOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.Test.Blueprint.Invocation) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
        +       * The fully qualified name of the showcase method to be invoked.
        +       * 
        + * + * string method = 1; + * + * @return The method. + */ + java.lang.String getMethod(); + + /** + * + * + *
        +       * The fully qualified name of the showcase method to be invoked.
        +       * 
        + * + * string method = 1; + * + * @return The bytes for method. + */ + com.google.protobuf.ByteString getMethodBytes(); + + /** + * + * + *
        +       * The request to be made if a specific request is necessary.
        +       * 
        + * + * bytes serialized_request = 2; + * + * @return The serializedRequest. + */ + com.google.protobuf.ByteString getSerializedRequest(); + } + + /** + * + * + *
        +     * A message representing a method invocation.
        +     * 
        + * + * Protobuf type {@code google.showcase.v1beta1.Test.Blueprint.Invocation} + */ + public static final class Invocation extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.Test.Blueprint.Invocation) + InvocationOrBuilder { + private static final long serialVersionUID = 0L; + + // Use Invocation.newBuilder() to construct. + private Invocation(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Invocation() { + method_ = ""; + serializedRequest_ = com.google.protobuf.ByteString.EMPTY; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Invocation(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private Invocation( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + method_ = s; + break; + } + case 18: + { + serializedRequest_ = input.readBytes(); + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.TestingOuterClass + .internal_static_google_showcase_v1beta1_Test_Blueprint_Invocation_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.TestingOuterClass + .internal_static_google_showcase_v1beta1_Test_Blueprint_Invocation_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.Test.Blueprint.Invocation.class, + com.google.showcase.v1beta1.Test.Blueprint.Invocation.Builder.class); + } + + public static final int METHOD_FIELD_NUMBER = 1; + private volatile java.lang.Object method_; + + /** + * + * + *
        +       * The fully qualified name of the showcase method to be invoked.
        +       * 
        + * + * string method = 1; + * + * @return The method. + */ + @java.lang.Override + public java.lang.String getMethod() { + java.lang.Object ref = method_; + 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(); + method_ = s; + return s; + } + } + + /** + * + * + *
        +       * The fully qualified name of the showcase method to be invoked.
        +       * 
        + * + * string method = 1; + * + * @return The bytes for method. + */ + @java.lang.Override + public com.google.protobuf.ByteString getMethodBytes() { + java.lang.Object ref = method_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + method_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int SERIALIZED_REQUEST_FIELD_NUMBER = 2; + private com.google.protobuf.ByteString serializedRequest_; + + /** + * + * + *
        +       * The request to be made if a specific request is necessary.
        +       * 
        + * + * bytes serialized_request = 2; + * + * @return The serializedRequest. + */ + @java.lang.Override + public com.google.protobuf.ByteString getSerializedRequest() { + return serializedRequest_; + } + + 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(method_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, method_); + } + if (!serializedRequest_.isEmpty()) { + output.writeBytes(2, serializedRequest_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(method_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, method_); + } + if (!serializedRequest_.isEmpty()) { + size += com.google.protobuf.CodedOutputStream.computeBytesSize(2, serializedRequest_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.showcase.v1beta1.Test.Blueprint.Invocation)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.Test.Blueprint.Invocation other = + (com.google.showcase.v1beta1.Test.Blueprint.Invocation) obj; + + if (!getMethod().equals(other.getMethod())) return false; + if (!getSerializedRequest().equals(other.getSerializedRequest())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + METHOD_FIELD_NUMBER; + hash = (53 * hash) + getMethod().hashCode(); + hash = (37 * hash) + SERIALIZED_REQUEST_FIELD_NUMBER; + hash = (53 * hash) + getSerializedRequest().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.showcase.v1beta1.Test.Blueprint.Invocation parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.Test.Blueprint.Invocation parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.Test.Blueprint.Invocation parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.Test.Blueprint.Invocation 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.showcase.v1beta1.Test.Blueprint.Invocation parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.Test.Blueprint.Invocation parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.Test.Blueprint.Invocation parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.Test.Blueprint.Invocation 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.showcase.v1beta1.Test.Blueprint.Invocation parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.Test.Blueprint.Invocation 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.showcase.v1beta1.Test.Blueprint.Invocation parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.Test.Blueprint.Invocation 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.showcase.v1beta1.Test.Blueprint.Invocation prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
        +       * A message representing a method invocation.
        +       * 
        + * + * Protobuf type {@code google.showcase.v1beta1.Test.Blueprint.Invocation} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.Test.Blueprint.Invocation) + com.google.showcase.v1beta1.Test.Blueprint.InvocationOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.TestingOuterClass + .internal_static_google_showcase_v1beta1_Test_Blueprint_Invocation_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.TestingOuterClass + .internal_static_google_showcase_v1beta1_Test_Blueprint_Invocation_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.Test.Blueprint.Invocation.class, + com.google.showcase.v1beta1.Test.Blueprint.Invocation.Builder.class); + } + + // Construct using com.google.showcase.v1beta1.Test.Blueprint.Invocation.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + method_ = ""; + + serializedRequest_ = com.google.protobuf.ByteString.EMPTY; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.showcase.v1beta1.TestingOuterClass + .internal_static_google_showcase_v1beta1_Test_Blueprint_Invocation_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.Test.Blueprint.Invocation getDefaultInstanceForType() { + return com.google.showcase.v1beta1.Test.Blueprint.Invocation.getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.Test.Blueprint.Invocation build() { + com.google.showcase.v1beta1.Test.Blueprint.Invocation result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.Test.Blueprint.Invocation buildPartial() { + com.google.showcase.v1beta1.Test.Blueprint.Invocation result = + new com.google.showcase.v1beta1.Test.Blueprint.Invocation(this); + result.method_ = method_; + result.serializedRequest_ = serializedRequest_; + 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.showcase.v1beta1.Test.Blueprint.Invocation) { + return mergeFrom((com.google.showcase.v1beta1.Test.Blueprint.Invocation) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.showcase.v1beta1.Test.Blueprint.Invocation other) { + if (other == com.google.showcase.v1beta1.Test.Blueprint.Invocation.getDefaultInstance()) + return this; + if (!other.getMethod().isEmpty()) { + method_ = other.method_; + onChanged(); + } + if (other.getSerializedRequest() != com.google.protobuf.ByteString.EMPTY) { + setSerializedRequest(other.getSerializedRequest()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.showcase.v1beta1.Test.Blueprint.Invocation parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.showcase.v1beta1.Test.Blueprint.Invocation) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object method_ = ""; + + /** + * + * + *
        +         * The fully qualified name of the showcase method to be invoked.
        +         * 
        + * + * string method = 1; + * + * @return The method. + */ + public java.lang.String getMethod() { + java.lang.Object ref = method_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + method_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
        +         * The fully qualified name of the showcase method to be invoked.
        +         * 
        + * + * string method = 1; + * + * @return The bytes for method. + */ + public com.google.protobuf.ByteString getMethodBytes() { + java.lang.Object ref = method_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + method_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
        +         * The fully qualified name of the showcase method to be invoked.
        +         * 
        + * + * string method = 1; + * + * @param value The method to set. + * @return This builder for chaining. + */ + public Builder setMethod(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + method_ = value; + onChanged(); + return this; + } + + /** + * + * + *
        +         * The fully qualified name of the showcase method to be invoked.
        +         * 
        + * + * string method = 1; + * + * @return This builder for chaining. + */ + public Builder clearMethod() { + + method_ = getDefaultInstance().getMethod(); + onChanged(); + return this; + } + + /** + * + * + *
        +         * The fully qualified name of the showcase method to be invoked.
        +         * 
        + * + * string method = 1; + * + * @param value The bytes for method to set. + * @return This builder for chaining. + */ + public Builder setMethodBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + method_ = value; + onChanged(); + return this; + } + + private com.google.protobuf.ByteString serializedRequest_ = + com.google.protobuf.ByteString.EMPTY; + + /** + * + * + *
        +         * The request to be made if a specific request is necessary.
        +         * 
        + * + * bytes serialized_request = 2; + * + * @return The serializedRequest. + */ + @java.lang.Override + public com.google.protobuf.ByteString getSerializedRequest() { + return serializedRequest_; + } + + /** + * + * + *
        +         * The request to be made if a specific request is necessary.
        +         * 
        + * + * bytes serialized_request = 2; + * + * @param value The serializedRequest to set. + * @return This builder for chaining. + */ + public Builder setSerializedRequest(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + + serializedRequest_ = value; + onChanged(); + return this; + } + + /** + * + * + *
        +         * The request to be made if a specific request is necessary.
        +         * 
        + * + * bytes serialized_request = 2; + * + * @return This builder for chaining. + */ + public Builder clearSerializedRequest() { + + serializedRequest_ = getDefaultInstance().getSerializedRequest(); + 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.showcase.v1beta1.Test.Blueprint.Invocation) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.Test.Blueprint.Invocation) + private static final com.google.showcase.v1beta1.Test.Blueprint.Invocation DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.Test.Blueprint.Invocation(); + } + + public static com.google.showcase.v1beta1.Test.Blueprint.Invocation getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Invocation parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Invocation(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.showcase.v1beta1.Test.Blueprint.Invocation getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + + /** + * + * + *
        +     * The name of this blueprint.
        +     * 
        + * + * 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 name of this blueprint.
        +     * 
        + * + * 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; + private volatile java.lang.Object description_; + + /** + * + * + *
        +     * A description of this blueprint.
        +     * 
        + * + * 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; + } + } + + /** + * + * + *
        +     * A description of this blueprint.
        +     * 
        + * + * 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 REQUEST_FIELD_NUMBER = 3; + private com.google.showcase.v1beta1.Test.Blueprint.Invocation request_; + + /** + * + * + *
        +     * The initial request to trigger this test.
        +     * 
        + * + * .google.showcase.v1beta1.Test.Blueprint.Invocation request = 3; + * + * @return Whether the request field is set. + */ + @java.lang.Override + public boolean hasRequest() { + return request_ != null; + } + + /** + * + * + *
        +     * The initial request to trigger this test.
        +     * 
        + * + * .google.showcase.v1beta1.Test.Blueprint.Invocation request = 3; + * + * @return The request. + */ + @java.lang.Override + public com.google.showcase.v1beta1.Test.Blueprint.Invocation getRequest() { + return request_ == null + ? com.google.showcase.v1beta1.Test.Blueprint.Invocation.getDefaultInstance() + : request_; + } + + /** + * + * + *
        +     * The initial request to trigger this test.
        +     * 
        + * + * .google.showcase.v1beta1.Test.Blueprint.Invocation request = 3; + */ + @java.lang.Override + public com.google.showcase.v1beta1.Test.Blueprint.InvocationOrBuilder getRequestOrBuilder() { + return getRequest(); + } + + public static final int ADDITIONAL_REQUESTS_FIELD_NUMBER = 4; + private java.util.List + additionalRequests_; + + /** + * + * + *
        +     * An ordered list of method calls that can be called to trigger this test.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Test.Blueprint.Invocation additional_requests = 4; + * + */ + @java.lang.Override + public java.util.List + getAdditionalRequestsList() { + return additionalRequests_; + } + + /** + * + * + *
        +     * An ordered list of method calls that can be called to trigger this test.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Test.Blueprint.Invocation additional_requests = 4; + * + */ + @java.lang.Override + public java.util.List + getAdditionalRequestsOrBuilderList() { + return additionalRequests_; + } + + /** + * + * + *
        +     * An ordered list of method calls that can be called to trigger this test.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Test.Blueprint.Invocation additional_requests = 4; + * + */ + @java.lang.Override + public int getAdditionalRequestsCount() { + return additionalRequests_.size(); + } + + /** + * + * + *
        +     * An ordered list of method calls that can be called to trigger this test.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Test.Blueprint.Invocation additional_requests = 4; + * + */ + @java.lang.Override + public com.google.showcase.v1beta1.Test.Blueprint.Invocation getAdditionalRequests(int index) { + return additionalRequests_.get(index); + } + + /** + * + * + *
        +     * An ordered list of method calls that can be called to trigger this test.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Test.Blueprint.Invocation additional_requests = 4; + * + */ + @java.lang.Override + public com.google.showcase.v1beta1.Test.Blueprint.InvocationOrBuilder + getAdditionalRequestsOrBuilder(int index) { + return additionalRequests_.get(index); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!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 (request_ != null) { + output.writeMessage(3, getRequest()); + } + for (int i = 0; i < additionalRequests_.size(); i++) { + output.writeMessage(4, additionalRequests_.get(i)); + } + unknownFields.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 (request_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getRequest()); + } + for (int i = 0; i < additionalRequests_.size(); i++) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize(4, additionalRequests_.get(i)); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.showcase.v1beta1.Test.Blueprint)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.Test.Blueprint other = + (com.google.showcase.v1beta1.Test.Blueprint) obj; + + if (!getName().equals(other.getName())) return false; + if (!getDescription().equals(other.getDescription())) return false; + if (hasRequest() != other.hasRequest()) return false; + if (hasRequest()) { + if (!getRequest().equals(other.getRequest())) return false; + } + if (!getAdditionalRequestsList().equals(other.getAdditionalRequestsList())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (37 * hash) + DESCRIPTION_FIELD_NUMBER; + hash = (53 * hash) + getDescription().hashCode(); + if (hasRequest()) { + hash = (37 * hash) + REQUEST_FIELD_NUMBER; + hash = (53 * hash) + getRequest().hashCode(); + } + if (getAdditionalRequestsCount() > 0) { + hash = (37 * hash) + ADDITIONAL_REQUESTS_FIELD_NUMBER; + hash = (53 * hash) + getAdditionalRequestsList().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.showcase.v1beta1.Test.Blueprint parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.Test.Blueprint parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.Test.Blueprint parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.Test.Blueprint 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.showcase.v1beta1.Test.Blueprint parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.Test.Blueprint parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.Test.Blueprint parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.Test.Blueprint 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.showcase.v1beta1.Test.Blueprint parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.Test.Blueprint 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.showcase.v1beta1.Test.Blueprint parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.Test.Blueprint 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.showcase.v1beta1.Test.Blueprint prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
        +     * A blueprint is an explicit definition of methods and requests that are needed
        +     * to be made to test this specific test case. Ideally this would be represented
        +     * by something more robust like CEL, but as of writing this, I am unsure if CEL
        +     * is ready.
        +     * 
        + * + * Protobuf type {@code google.showcase.v1beta1.Test.Blueprint} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.Test.Blueprint) + com.google.showcase.v1beta1.Test.BlueprintOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.TestingOuterClass + .internal_static_google_showcase_v1beta1_Test_Blueprint_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.TestingOuterClass + .internal_static_google_showcase_v1beta1_Test_Blueprint_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.Test.Blueprint.class, + com.google.showcase.v1beta1.Test.Blueprint.Builder.class); + } + + // Construct using com.google.showcase.v1beta1.Test.Blueprint.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getAdditionalRequestsFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + description_ = ""; + + if (requestBuilder_ == null) { + request_ = null; + } else { + request_ = null; + requestBuilder_ = null; + } + if (additionalRequestsBuilder_ == null) { + additionalRequests_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + additionalRequestsBuilder_.clear(); + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.showcase.v1beta1.TestingOuterClass + .internal_static_google_showcase_v1beta1_Test_Blueprint_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.Test.Blueprint getDefaultInstanceForType() { + return com.google.showcase.v1beta1.Test.Blueprint.getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.Test.Blueprint build() { + com.google.showcase.v1beta1.Test.Blueprint result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.Test.Blueprint buildPartial() { + com.google.showcase.v1beta1.Test.Blueprint result = + new com.google.showcase.v1beta1.Test.Blueprint(this); + int from_bitField0_ = bitField0_; + result.name_ = name_; + result.description_ = description_; + if (requestBuilder_ == null) { + result.request_ = request_; + } else { + result.request_ = requestBuilder_.build(); + } + if (additionalRequestsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + additionalRequests_ = java.util.Collections.unmodifiableList(additionalRequests_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.additionalRequests_ = additionalRequests_; + } else { + result.additionalRequests_ = additionalRequestsBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, + java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.showcase.v1beta1.Test.Blueprint) { + return mergeFrom((com.google.showcase.v1beta1.Test.Blueprint) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.showcase.v1beta1.Test.Blueprint other) { + if (other == com.google.showcase.v1beta1.Test.Blueprint.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + if (!other.getDescription().isEmpty()) { + description_ = other.description_; + onChanged(); + } + if (other.hasRequest()) { + mergeRequest(other.getRequest()); + } + if (additionalRequestsBuilder_ == null) { + if (!other.additionalRequests_.isEmpty()) { + if (additionalRequests_.isEmpty()) { + additionalRequests_ = other.additionalRequests_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureAdditionalRequestsIsMutable(); + additionalRequests_.addAll(other.additionalRequests_); + } + onChanged(); + } + } else { + if (!other.additionalRequests_.isEmpty()) { + if (additionalRequestsBuilder_.isEmpty()) { + additionalRequestsBuilder_.dispose(); + additionalRequestsBuilder_ = null; + additionalRequests_ = other.additionalRequests_; + bitField0_ = (bitField0_ & ~0x00000001); + additionalRequestsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getAdditionalRequestsFieldBuilder() + : null; + } else { + additionalRequestsBuilder_.addAllMessages(other.additionalRequests_); + } + } + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.showcase.v1beta1.Test.Blueprint parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.showcase.v1beta1.Test.Blueprint) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + + /** + * + * + *
        +       * The name of this blueprint.
        +       * 
        + * + * 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 name of this blueprint.
        +       * 
        + * + * 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 name of this blueprint.
        +       * 
        + * + * string name = 1; + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + + /** + * + * + *
        +       * The name of this blueprint.
        +       * 
        + * + * string name = 1; + * + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + + /** + * + * + *
        +       * The name of this blueprint.
        +       * 
        + * + * string name = 1; + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + + private java.lang.Object description_ = ""; + + /** + * + * + *
        +       * A description of this blueprint.
        +       * 
        + * + * 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; + } + } + + /** + * + * + *
        +       * A description of this blueprint.
        +       * 
        + * + * 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; + } + } + + /** + * + * + *
        +       * A description of this blueprint.
        +       * 
        + * + * 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; + onChanged(); + return this; + } + + /** + * + * + *
        +       * A description of this blueprint.
        +       * 
        + * + * string description = 2; + * + * @return This builder for chaining. + */ + public Builder clearDescription() { + + description_ = getDefaultInstance().getDescription(); + onChanged(); + return this; + } + + /** + * + * + *
        +       * A description of this blueprint.
        +       * 
        + * + * 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; + onChanged(); + return this; + } + + private com.google.showcase.v1beta1.Test.Blueprint.Invocation request_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.showcase.v1beta1.Test.Blueprint.Invocation, + com.google.showcase.v1beta1.Test.Blueprint.Invocation.Builder, + com.google.showcase.v1beta1.Test.Blueprint.InvocationOrBuilder> + requestBuilder_; + + /** + * + * + *
        +       * The initial request to trigger this test.
        +       * 
        + * + * .google.showcase.v1beta1.Test.Blueprint.Invocation request = 3; + * + * @return Whether the request field is set. + */ + public boolean hasRequest() { + return requestBuilder_ != null || request_ != null; + } + + /** + * + * + *
        +       * The initial request to trigger this test.
        +       * 
        + * + * .google.showcase.v1beta1.Test.Blueprint.Invocation request = 3; + * + * @return The request. + */ + public com.google.showcase.v1beta1.Test.Blueprint.Invocation getRequest() { + if (requestBuilder_ == null) { + return request_ == null + ? com.google.showcase.v1beta1.Test.Blueprint.Invocation.getDefaultInstance() + : request_; + } else { + return requestBuilder_.getMessage(); + } + } + + /** + * + * + *
        +       * The initial request to trigger this test.
        +       * 
        + * + * .google.showcase.v1beta1.Test.Blueprint.Invocation request = 3; + */ + public Builder setRequest(com.google.showcase.v1beta1.Test.Blueprint.Invocation value) { + if (requestBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + request_ = value; + onChanged(); + } else { + requestBuilder_.setMessage(value); + } + + return this; + } + + /** + * + * + *
        +       * The initial request to trigger this test.
        +       * 
        + * + * .google.showcase.v1beta1.Test.Blueprint.Invocation request = 3; + */ + public Builder setRequest( + com.google.showcase.v1beta1.Test.Blueprint.Invocation.Builder builderForValue) { + if (requestBuilder_ == null) { + request_ = builderForValue.build(); + onChanged(); + } else { + requestBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + + /** + * + * + *
        +       * The initial request to trigger this test.
        +       * 
        + * + * .google.showcase.v1beta1.Test.Blueprint.Invocation request = 3; + */ + public Builder mergeRequest(com.google.showcase.v1beta1.Test.Blueprint.Invocation value) { + if (requestBuilder_ == null) { + if (request_ != null) { + request_ = + com.google.showcase.v1beta1.Test.Blueprint.Invocation.newBuilder(request_) + .mergeFrom(value) + .buildPartial(); + } else { + request_ = value; + } + onChanged(); + } else { + requestBuilder_.mergeFrom(value); + } + + return this; + } + + /** + * + * + *
        +       * The initial request to trigger this test.
        +       * 
        + * + * .google.showcase.v1beta1.Test.Blueprint.Invocation request = 3; + */ + public Builder clearRequest() { + if (requestBuilder_ == null) { + request_ = null; + onChanged(); + } else { + request_ = null; + requestBuilder_ = null; + } + + return this; + } + + /** + * + * + *
        +       * The initial request to trigger this test.
        +       * 
        + * + * .google.showcase.v1beta1.Test.Blueprint.Invocation request = 3; + */ + public com.google.showcase.v1beta1.Test.Blueprint.Invocation.Builder getRequestBuilder() { + + onChanged(); + return getRequestFieldBuilder().getBuilder(); + } + + /** + * + * + *
        +       * The initial request to trigger this test.
        +       * 
        + * + * .google.showcase.v1beta1.Test.Blueprint.Invocation request = 3; + */ + public com.google.showcase.v1beta1.Test.Blueprint.InvocationOrBuilder getRequestOrBuilder() { + if (requestBuilder_ != null) { + return requestBuilder_.getMessageOrBuilder(); + } else { + return request_ == null + ? com.google.showcase.v1beta1.Test.Blueprint.Invocation.getDefaultInstance() + : request_; + } + } + + /** + * + * + *
        +       * The initial request to trigger this test.
        +       * 
        + * + * .google.showcase.v1beta1.Test.Blueprint.Invocation request = 3; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.showcase.v1beta1.Test.Blueprint.Invocation, + com.google.showcase.v1beta1.Test.Blueprint.Invocation.Builder, + com.google.showcase.v1beta1.Test.Blueprint.InvocationOrBuilder> + getRequestFieldBuilder() { + if (requestBuilder_ == null) { + requestBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.showcase.v1beta1.Test.Blueprint.Invocation, + com.google.showcase.v1beta1.Test.Blueprint.Invocation.Builder, + com.google.showcase.v1beta1.Test.Blueprint.InvocationOrBuilder>( + getRequest(), getParentForChildren(), isClean()); + request_ = null; + } + return requestBuilder_; + } + + private java.util.List + additionalRequests_ = java.util.Collections.emptyList(); + + private void ensureAdditionalRequestsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + additionalRequests_ = + new java.util.ArrayList( + additionalRequests_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.showcase.v1beta1.Test.Blueprint.Invocation, + com.google.showcase.v1beta1.Test.Blueprint.Invocation.Builder, + com.google.showcase.v1beta1.Test.Blueprint.InvocationOrBuilder> + additionalRequestsBuilder_; + + /** + * + * + *
        +       * An ordered list of method calls that can be called to trigger this test.
        +       * 
        + * + * repeated .google.showcase.v1beta1.Test.Blueprint.Invocation additional_requests = 4; + * + */ + public java.util.List + getAdditionalRequestsList() { + if (additionalRequestsBuilder_ == null) { + return java.util.Collections.unmodifiableList(additionalRequests_); + } else { + return additionalRequestsBuilder_.getMessageList(); + } + } + + /** + * + * + *
        +       * An ordered list of method calls that can be called to trigger this test.
        +       * 
        + * + * repeated .google.showcase.v1beta1.Test.Blueprint.Invocation additional_requests = 4; + * + */ + public int getAdditionalRequestsCount() { + if (additionalRequestsBuilder_ == null) { + return additionalRequests_.size(); + } else { + return additionalRequestsBuilder_.getCount(); + } + } + + /** + * + * + *
        +       * An ordered list of method calls that can be called to trigger this test.
        +       * 
        + * + * repeated .google.showcase.v1beta1.Test.Blueprint.Invocation additional_requests = 4; + * + */ + public com.google.showcase.v1beta1.Test.Blueprint.Invocation getAdditionalRequests( + int index) { + if (additionalRequestsBuilder_ == null) { + return additionalRequests_.get(index); + } else { + return additionalRequestsBuilder_.getMessage(index); + } + } + + /** + * + * + *
        +       * An ordered list of method calls that can be called to trigger this test.
        +       * 
        + * + * repeated .google.showcase.v1beta1.Test.Blueprint.Invocation additional_requests = 4; + * + */ + public Builder setAdditionalRequests( + int index, com.google.showcase.v1beta1.Test.Blueprint.Invocation value) { + if (additionalRequestsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureAdditionalRequestsIsMutable(); + additionalRequests_.set(index, value); + onChanged(); + } else { + additionalRequestsBuilder_.setMessage(index, value); + } + return this; + } + + /** + * + * + *
        +       * An ordered list of method calls that can be called to trigger this test.
        +       * 
        + * + * repeated .google.showcase.v1beta1.Test.Blueprint.Invocation additional_requests = 4; + * + */ + public Builder setAdditionalRequests( + int index, + com.google.showcase.v1beta1.Test.Blueprint.Invocation.Builder builderForValue) { + if (additionalRequestsBuilder_ == null) { + ensureAdditionalRequestsIsMutable(); + additionalRequests_.set(index, builderForValue.build()); + onChanged(); + } else { + additionalRequestsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
        +       * An ordered list of method calls that can be called to trigger this test.
        +       * 
        + * + * repeated .google.showcase.v1beta1.Test.Blueprint.Invocation additional_requests = 4; + * + */ + public Builder addAdditionalRequests( + com.google.showcase.v1beta1.Test.Blueprint.Invocation value) { + if (additionalRequestsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureAdditionalRequestsIsMutable(); + additionalRequests_.add(value); + onChanged(); + } else { + additionalRequestsBuilder_.addMessage(value); + } + return this; + } + + /** + * + * + *
        +       * An ordered list of method calls that can be called to trigger this test.
        +       * 
        + * + * repeated .google.showcase.v1beta1.Test.Blueprint.Invocation additional_requests = 4; + * + */ + public Builder addAdditionalRequests( + int index, com.google.showcase.v1beta1.Test.Blueprint.Invocation value) { + if (additionalRequestsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureAdditionalRequestsIsMutable(); + additionalRequests_.add(index, value); + onChanged(); + } else { + additionalRequestsBuilder_.addMessage(index, value); + } + return this; + } + + /** + * + * + *
        +       * An ordered list of method calls that can be called to trigger this test.
        +       * 
        + * + * repeated .google.showcase.v1beta1.Test.Blueprint.Invocation additional_requests = 4; + * + */ + public Builder addAdditionalRequests( + com.google.showcase.v1beta1.Test.Blueprint.Invocation.Builder builderForValue) { + if (additionalRequestsBuilder_ == null) { + ensureAdditionalRequestsIsMutable(); + additionalRequests_.add(builderForValue.build()); + onChanged(); + } else { + additionalRequestsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + + /** + * + * + *
        +       * An ordered list of method calls that can be called to trigger this test.
        +       * 
        + * + * repeated .google.showcase.v1beta1.Test.Blueprint.Invocation additional_requests = 4; + * + */ + public Builder addAdditionalRequests( + int index, + com.google.showcase.v1beta1.Test.Blueprint.Invocation.Builder builderForValue) { + if (additionalRequestsBuilder_ == null) { + ensureAdditionalRequestsIsMutable(); + additionalRequests_.add(index, builderForValue.build()); + onChanged(); + } else { + additionalRequestsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
        +       * An ordered list of method calls that can be called to trigger this test.
        +       * 
        + * + * repeated .google.showcase.v1beta1.Test.Blueprint.Invocation additional_requests = 4; + * + */ + public Builder addAllAdditionalRequests( + java.lang.Iterable + values) { + if (additionalRequestsBuilder_ == null) { + ensureAdditionalRequestsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, additionalRequests_); + onChanged(); + } else { + additionalRequestsBuilder_.addAllMessages(values); + } + return this; + } + + /** + * + * + *
        +       * An ordered list of method calls that can be called to trigger this test.
        +       * 
        + * + * repeated .google.showcase.v1beta1.Test.Blueprint.Invocation additional_requests = 4; + * + */ + public Builder clearAdditionalRequests() { + if (additionalRequestsBuilder_ == null) { + additionalRequests_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + additionalRequestsBuilder_.clear(); + } + return this; + } + + /** + * + * + *
        +       * An ordered list of method calls that can be called to trigger this test.
        +       * 
        + * + * repeated .google.showcase.v1beta1.Test.Blueprint.Invocation additional_requests = 4; + * + */ + public Builder removeAdditionalRequests(int index) { + if (additionalRequestsBuilder_ == null) { + ensureAdditionalRequestsIsMutable(); + additionalRequests_.remove(index); + onChanged(); + } else { + additionalRequestsBuilder_.remove(index); + } + return this; + } + + /** + * + * + *
        +       * An ordered list of method calls that can be called to trigger this test.
        +       * 
        + * + * repeated .google.showcase.v1beta1.Test.Blueprint.Invocation additional_requests = 4; + * + */ + public com.google.showcase.v1beta1.Test.Blueprint.Invocation.Builder + getAdditionalRequestsBuilder(int index) { + return getAdditionalRequestsFieldBuilder().getBuilder(index); + } + + /** + * + * + *
        +       * An ordered list of method calls that can be called to trigger this test.
        +       * 
        + * + * repeated .google.showcase.v1beta1.Test.Blueprint.Invocation additional_requests = 4; + * + */ + public com.google.showcase.v1beta1.Test.Blueprint.InvocationOrBuilder + getAdditionalRequestsOrBuilder(int index) { + if (additionalRequestsBuilder_ == null) { + return additionalRequests_.get(index); + } else { + return additionalRequestsBuilder_.getMessageOrBuilder(index); + } + } + + /** + * + * + *
        +       * An ordered list of method calls that can be called to trigger this test.
        +       * 
        + * + * repeated .google.showcase.v1beta1.Test.Blueprint.Invocation additional_requests = 4; + * + */ + public java.util.List< + ? extends com.google.showcase.v1beta1.Test.Blueprint.InvocationOrBuilder> + getAdditionalRequestsOrBuilderList() { + if (additionalRequestsBuilder_ != null) { + return additionalRequestsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(additionalRequests_); + } + } + + /** + * + * + *
        +       * An ordered list of method calls that can be called to trigger this test.
        +       * 
        + * + * repeated .google.showcase.v1beta1.Test.Blueprint.Invocation additional_requests = 4; + * + */ + public com.google.showcase.v1beta1.Test.Blueprint.Invocation.Builder + addAdditionalRequestsBuilder() { + return getAdditionalRequestsFieldBuilder() + .addBuilder(com.google.showcase.v1beta1.Test.Blueprint.Invocation.getDefaultInstance()); + } + + /** + * + * + *
        +       * An ordered list of method calls that can be called to trigger this test.
        +       * 
        + * + * repeated .google.showcase.v1beta1.Test.Blueprint.Invocation additional_requests = 4; + * + */ + public com.google.showcase.v1beta1.Test.Blueprint.Invocation.Builder + addAdditionalRequestsBuilder(int index) { + return getAdditionalRequestsFieldBuilder() + .addBuilder( + index, com.google.showcase.v1beta1.Test.Blueprint.Invocation.getDefaultInstance()); + } + + /** + * + * + *
        +       * An ordered list of method calls that can be called to trigger this test.
        +       * 
        + * + * repeated .google.showcase.v1beta1.Test.Blueprint.Invocation additional_requests = 4; + * + */ + public java.util.List + getAdditionalRequestsBuilderList() { + return getAdditionalRequestsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.showcase.v1beta1.Test.Blueprint.Invocation, + com.google.showcase.v1beta1.Test.Blueprint.Invocation.Builder, + com.google.showcase.v1beta1.Test.Blueprint.InvocationOrBuilder> + getAdditionalRequestsFieldBuilder() { + if (additionalRequestsBuilder_ == null) { + additionalRequestsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.showcase.v1beta1.Test.Blueprint.Invocation, + com.google.showcase.v1beta1.Test.Blueprint.Invocation.Builder, + com.google.showcase.v1beta1.Test.Blueprint.InvocationOrBuilder>( + additionalRequests_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + additionalRequests_ = null; + } + return additionalRequestsBuilder_; + } + + @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.showcase.v1beta1.Test.Blueprint) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.Test.Blueprint) + private static final com.google.showcase.v1beta1.Test.Blueprint DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.Test.Blueprint(); + } + + public static com.google.showcase.v1beta1.Test.Blueprint getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Blueprint parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Blueprint(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.showcase.v1beta1.Test.Blueprint getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + + /** + * + * + *
        +   * The name of the test.
        +   * The tests/* portion of the names are hard-coded, and do not change
        +   * from session to session.
        +   * 
        + * + * 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 name of the test.
        +   * The tests/* portion of the names are hard-coded, and do not change
        +   * from session to session.
        +   * 
        + * + * 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 EXPECTATION_LEVEL_FIELD_NUMBER = 2; + private int expectationLevel_; + + /** + * + * + *
        +   * The expectation level for this test.
        +   * 
        + * + * .google.showcase.v1beta1.Test.ExpectationLevel expectation_level = 2; + * + * @return The enum numeric value on the wire for expectationLevel. + */ + @java.lang.Override + public int getExpectationLevelValue() { + return expectationLevel_; + } + + /** + * + * + *
        +   * The expectation level for this test.
        +   * 
        + * + * .google.showcase.v1beta1.Test.ExpectationLevel expectation_level = 2; + * + * @return The expectationLevel. + */ + @java.lang.Override + public com.google.showcase.v1beta1.Test.ExpectationLevel getExpectationLevel() { + @SuppressWarnings("deprecation") + com.google.showcase.v1beta1.Test.ExpectationLevel result = + com.google.showcase.v1beta1.Test.ExpectationLevel.valueOf(expectationLevel_); + return result == null ? com.google.showcase.v1beta1.Test.ExpectationLevel.UNRECOGNIZED : result; + } + + public static final int DESCRIPTION_FIELD_NUMBER = 3; + private volatile java.lang.Object description_; + + /** + * + * + *
        +   * A description of the test.
        +   * 
        + * + * 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; + } + } + + /** + * + * + *
        +   * A description of the test.
        +   * 
        + * + * 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 BLUEPRINTS_FIELD_NUMBER = 4; + private java.util.List blueprints_; + + /** + * + * + *
        +   * The blueprints that will satisfy this test. There may be multiple blueprints
        +   * that can signal to the server that this test case is being exercised. Although
        +   * multiple blueprints are specified, only a single blueprint needs to be run to
        +   * signal that the test case was exercised.
        +   * 
        + * + * repeated .google.showcase.v1beta1.Test.Blueprint blueprints = 4; + */ + @java.lang.Override + public java.util.List getBlueprintsList() { + return blueprints_; + } + + /** + * + * + *
        +   * The blueprints that will satisfy this test. There may be multiple blueprints
        +   * that can signal to the server that this test case is being exercised. Although
        +   * multiple blueprints are specified, only a single blueprint needs to be run to
        +   * signal that the test case was exercised.
        +   * 
        + * + * repeated .google.showcase.v1beta1.Test.Blueprint blueprints = 4; + */ + @java.lang.Override + public java.util.List + getBlueprintsOrBuilderList() { + return blueprints_; + } + + /** + * + * + *
        +   * The blueprints that will satisfy this test. There may be multiple blueprints
        +   * that can signal to the server that this test case is being exercised. Although
        +   * multiple blueprints are specified, only a single blueprint needs to be run to
        +   * signal that the test case was exercised.
        +   * 
        + * + * repeated .google.showcase.v1beta1.Test.Blueprint blueprints = 4; + */ + @java.lang.Override + public int getBlueprintsCount() { + return blueprints_.size(); + } + + /** + * + * + *
        +   * The blueprints that will satisfy this test. There may be multiple blueprints
        +   * that can signal to the server that this test case is being exercised. Although
        +   * multiple blueprints are specified, only a single blueprint needs to be run to
        +   * signal that the test case was exercised.
        +   * 
        + * + * repeated .google.showcase.v1beta1.Test.Blueprint blueprints = 4; + */ + @java.lang.Override + public com.google.showcase.v1beta1.Test.Blueprint getBlueprints(int index) { + return blueprints_.get(index); + } + + /** + * + * + *
        +   * The blueprints that will satisfy this test. There may be multiple blueprints
        +   * that can signal to the server that this test case is being exercised. Although
        +   * multiple blueprints are specified, only a single blueprint needs to be run to
        +   * signal that the test case was exercised.
        +   * 
        + * + * repeated .google.showcase.v1beta1.Test.Blueprint blueprints = 4; + */ + @java.lang.Override + public com.google.showcase.v1beta1.Test.BlueprintOrBuilder getBlueprintsOrBuilder(int index) { + return blueprints_.get(index); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + if (expectationLevel_ + != com.google.showcase.v1beta1.Test.ExpectationLevel.EXPECTATION_LEVEL_UNSPECIFIED + .getNumber()) { + output.writeEnum(2, expectationLevel_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(description_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, description_); + } + for (int i = 0; i < blueprints_.size(); i++) { + output.writeMessage(4, blueprints_.get(i)); + } + unknownFields.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 (expectationLevel_ + != com.google.showcase.v1beta1.Test.ExpectationLevel.EXPECTATION_LEVEL_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(2, expectationLevel_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(description_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, description_); + } + for (int i = 0; i < blueprints_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, blueprints_.get(i)); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.showcase.v1beta1.Test)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.Test other = (com.google.showcase.v1beta1.Test) obj; + + if (!getName().equals(other.getName())) return false; + if (expectationLevel_ != other.expectationLevel_) return false; + if (!getDescription().equals(other.getDescription())) return false; + if (!getBlueprintsList().equals(other.getBlueprintsList())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (37 * hash) + EXPECTATION_LEVEL_FIELD_NUMBER; + hash = (53 * hash) + expectationLevel_; + hash = (37 * hash) + DESCRIPTION_FIELD_NUMBER; + hash = (53 * hash) + getDescription().hashCode(); + if (getBlueprintsCount() > 0) { + hash = (37 * hash) + BLUEPRINTS_FIELD_NUMBER; + hash = (53 * hash) + getBlueprintsList().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.showcase.v1beta1.Test parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.Test parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.Test parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.Test 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.showcase.v1beta1.Test parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.Test parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.Test parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.Test 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.showcase.v1beta1.Test parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.Test 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.showcase.v1beta1.Test parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.Test 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.showcase.v1beta1.Test prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** Protobuf type {@code google.showcase.v1beta1.Test} */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.Test) + com.google.showcase.v1beta1.TestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.TestingOuterClass + .internal_static_google_showcase_v1beta1_Test_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.TestingOuterClass + .internal_static_google_showcase_v1beta1_Test_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.Test.class, + com.google.showcase.v1beta1.Test.Builder.class); + } + + // Construct using com.google.showcase.v1beta1.Test.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getBlueprintsFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + expectationLevel_ = 0; + + description_ = ""; + + if (blueprintsBuilder_ == null) { + blueprints_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + blueprintsBuilder_.clear(); + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.showcase.v1beta1.TestingOuterClass + .internal_static_google_showcase_v1beta1_Test_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.Test getDefaultInstanceForType() { + return com.google.showcase.v1beta1.Test.getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.Test build() { + com.google.showcase.v1beta1.Test result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.Test buildPartial() { + com.google.showcase.v1beta1.Test result = new com.google.showcase.v1beta1.Test(this); + int from_bitField0_ = bitField0_; + result.name_ = name_; + result.expectationLevel_ = expectationLevel_; + result.description_ = description_; + if (blueprintsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + blueprints_ = java.util.Collections.unmodifiableList(blueprints_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.blueprints_ = blueprints_; + } else { + result.blueprints_ = blueprintsBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.showcase.v1beta1.Test) { + return mergeFrom((com.google.showcase.v1beta1.Test) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.showcase.v1beta1.Test other) { + if (other == com.google.showcase.v1beta1.Test.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + if (other.expectationLevel_ != 0) { + setExpectationLevelValue(other.getExpectationLevelValue()); + } + if (!other.getDescription().isEmpty()) { + description_ = other.description_; + onChanged(); + } + if (blueprintsBuilder_ == null) { + if (!other.blueprints_.isEmpty()) { + if (blueprints_.isEmpty()) { + blueprints_ = other.blueprints_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureBlueprintsIsMutable(); + blueprints_.addAll(other.blueprints_); + } + onChanged(); + } + } else { + if (!other.blueprints_.isEmpty()) { + if (blueprintsBuilder_.isEmpty()) { + blueprintsBuilder_.dispose(); + blueprintsBuilder_ = null; + blueprints_ = other.blueprints_; + bitField0_ = (bitField0_ & ~0x00000001); + blueprintsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getBlueprintsFieldBuilder() + : null; + } else { + blueprintsBuilder_.addAllMessages(other.blueprints_); + } + } + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.showcase.v1beta1.Test parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.showcase.v1beta1.Test) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + + /** + * + * + *
        +     * The name of the test.
        +     * The tests/* portion of the names are hard-coded, and do not change
        +     * from session to session.
        +     * 
        + * + * 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 name of the test.
        +     * The tests/* portion of the names are hard-coded, and do not change
        +     * from session to session.
        +     * 
        + * + * 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 name of the test.
        +     * The tests/* portion of the names are hard-coded, and do not change
        +     * from session to session.
        +     * 
        + * + * string name = 1; + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + + /** + * + * + *
        +     * The name of the test.
        +     * The tests/* portion of the names are hard-coded, and do not change
        +     * from session to session.
        +     * 
        + * + * string name = 1; + * + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + + /** + * + * + *
        +     * The name of the test.
        +     * The tests/* portion of the names are hard-coded, and do not change
        +     * from session to session.
        +     * 
        + * + * string name = 1; + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + + private int expectationLevel_ = 0; + + /** + * + * + *
        +     * The expectation level for this test.
        +     * 
        + * + * .google.showcase.v1beta1.Test.ExpectationLevel expectation_level = 2; + * + * @return The enum numeric value on the wire for expectationLevel. + */ + @java.lang.Override + public int getExpectationLevelValue() { + return expectationLevel_; + } + + /** + * + * + *
        +     * The expectation level for this test.
        +     * 
        + * + * .google.showcase.v1beta1.Test.ExpectationLevel expectation_level = 2; + * + * @param value The enum numeric value on the wire for expectationLevel to set. + * @return This builder for chaining. + */ + public Builder setExpectationLevelValue(int value) { + + expectationLevel_ = value; + onChanged(); + return this; + } + + /** + * + * + *
        +     * The expectation level for this test.
        +     * 
        + * + * .google.showcase.v1beta1.Test.ExpectationLevel expectation_level = 2; + * + * @return The expectationLevel. + */ + @java.lang.Override + public com.google.showcase.v1beta1.Test.ExpectationLevel getExpectationLevel() { + @SuppressWarnings("deprecation") + com.google.showcase.v1beta1.Test.ExpectationLevel result = + com.google.showcase.v1beta1.Test.ExpectationLevel.valueOf(expectationLevel_); + return result == null + ? com.google.showcase.v1beta1.Test.ExpectationLevel.UNRECOGNIZED + : result; + } + + /** + * + * + *
        +     * The expectation level for this test.
        +     * 
        + * + * .google.showcase.v1beta1.Test.ExpectationLevel expectation_level = 2; + * + * @param value The expectationLevel to set. + * @return This builder for chaining. + */ + public Builder setExpectationLevel(com.google.showcase.v1beta1.Test.ExpectationLevel value) { + if (value == null) { + throw new NullPointerException(); + } + + expectationLevel_ = value.getNumber(); + onChanged(); + return this; + } + + /** + * + * + *
        +     * The expectation level for this test.
        +     * 
        + * + * .google.showcase.v1beta1.Test.ExpectationLevel expectation_level = 2; + * + * @return This builder for chaining. + */ + public Builder clearExpectationLevel() { + + expectationLevel_ = 0; + onChanged(); + return this; + } + + private java.lang.Object description_ = ""; + + /** + * + * + *
        +     * A description of the test.
        +     * 
        + * + * 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; + } + } + + /** + * + * + *
        +     * A description of the test.
        +     * 
        + * + * 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; + } + } + + /** + * + * + *
        +     * A description of the test.
        +     * 
        + * + * string description = 3; + * + * @param value The description to set. + * @return This builder for chaining. + */ + public Builder setDescription(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + description_ = value; + onChanged(); + return this; + } + + /** + * + * + *
        +     * A description of the test.
        +     * 
        + * + * string description = 3; + * + * @return This builder for chaining. + */ + public Builder clearDescription() { + + description_ = getDefaultInstance().getDescription(); + onChanged(); + return this; + } + + /** + * + * + *
        +     * A description of the test.
        +     * 
        + * + * string description = 3; + * + * @param value The bytes for description to set. + * @return This builder for chaining. + */ + public Builder setDescriptionBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + description_ = value; + onChanged(); + return this; + } + + private java.util.List blueprints_ = + java.util.Collections.emptyList(); + + private void ensureBlueprintsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + blueprints_ = + new java.util.ArrayList(blueprints_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.showcase.v1beta1.Test.Blueprint, + com.google.showcase.v1beta1.Test.Blueprint.Builder, + com.google.showcase.v1beta1.Test.BlueprintOrBuilder> + blueprintsBuilder_; + + /** + * + * + *
        +     * The blueprints that will satisfy this test. There may be multiple blueprints
        +     * that can signal to the server that this test case is being exercised. Although
        +     * multiple blueprints are specified, only a single blueprint needs to be run to
        +     * signal that the test case was exercised.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Test.Blueprint blueprints = 4; + */ + public java.util.List getBlueprintsList() { + if (blueprintsBuilder_ == null) { + return java.util.Collections.unmodifiableList(blueprints_); + } else { + return blueprintsBuilder_.getMessageList(); + } + } + + /** + * + * + *
        +     * The blueprints that will satisfy this test. There may be multiple blueprints
        +     * that can signal to the server that this test case is being exercised. Although
        +     * multiple blueprints are specified, only a single blueprint needs to be run to
        +     * signal that the test case was exercised.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Test.Blueprint blueprints = 4; + */ + public int getBlueprintsCount() { + if (blueprintsBuilder_ == null) { + return blueprints_.size(); + } else { + return blueprintsBuilder_.getCount(); + } + } + + /** + * + * + *
        +     * The blueprints that will satisfy this test. There may be multiple blueprints
        +     * that can signal to the server that this test case is being exercised. Although
        +     * multiple blueprints are specified, only a single blueprint needs to be run to
        +     * signal that the test case was exercised.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Test.Blueprint blueprints = 4; + */ + public com.google.showcase.v1beta1.Test.Blueprint getBlueprints(int index) { + if (blueprintsBuilder_ == null) { + return blueprints_.get(index); + } else { + return blueprintsBuilder_.getMessage(index); + } + } + + /** + * + * + *
        +     * The blueprints that will satisfy this test. There may be multiple blueprints
        +     * that can signal to the server that this test case is being exercised. Although
        +     * multiple blueprints are specified, only a single blueprint needs to be run to
        +     * signal that the test case was exercised.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Test.Blueprint blueprints = 4; + */ + public Builder setBlueprints(int index, com.google.showcase.v1beta1.Test.Blueprint value) { + if (blueprintsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureBlueprintsIsMutable(); + blueprints_.set(index, value); + onChanged(); + } else { + blueprintsBuilder_.setMessage(index, value); + } + return this; + } + + /** + * + * + *
        +     * The blueprints that will satisfy this test. There may be multiple blueprints
        +     * that can signal to the server that this test case is being exercised. Although
        +     * multiple blueprints are specified, only a single blueprint needs to be run to
        +     * signal that the test case was exercised.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Test.Blueprint blueprints = 4; + */ + public Builder setBlueprints( + int index, com.google.showcase.v1beta1.Test.Blueprint.Builder builderForValue) { + if (blueprintsBuilder_ == null) { + ensureBlueprintsIsMutable(); + blueprints_.set(index, builderForValue.build()); + onChanged(); + } else { + blueprintsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
        +     * The blueprints that will satisfy this test. There may be multiple blueprints
        +     * that can signal to the server that this test case is being exercised. Although
        +     * multiple blueprints are specified, only a single blueprint needs to be run to
        +     * signal that the test case was exercised.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Test.Blueprint blueprints = 4; + */ + public Builder addBlueprints(com.google.showcase.v1beta1.Test.Blueprint value) { + if (blueprintsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureBlueprintsIsMutable(); + blueprints_.add(value); + onChanged(); + } else { + blueprintsBuilder_.addMessage(value); + } + return this; + } + + /** + * + * + *
        +     * The blueprints that will satisfy this test. There may be multiple blueprints
        +     * that can signal to the server that this test case is being exercised. Although
        +     * multiple blueprints are specified, only a single blueprint needs to be run to
        +     * signal that the test case was exercised.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Test.Blueprint blueprints = 4; + */ + public Builder addBlueprints(int index, com.google.showcase.v1beta1.Test.Blueprint value) { + if (blueprintsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureBlueprintsIsMutable(); + blueprints_.add(index, value); + onChanged(); + } else { + blueprintsBuilder_.addMessage(index, value); + } + return this; + } + + /** + * + * + *
        +     * The blueprints that will satisfy this test. There may be multiple blueprints
        +     * that can signal to the server that this test case is being exercised. Although
        +     * multiple blueprints are specified, only a single blueprint needs to be run to
        +     * signal that the test case was exercised.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Test.Blueprint blueprints = 4; + */ + public Builder addBlueprints( + com.google.showcase.v1beta1.Test.Blueprint.Builder builderForValue) { + if (blueprintsBuilder_ == null) { + ensureBlueprintsIsMutable(); + blueprints_.add(builderForValue.build()); + onChanged(); + } else { + blueprintsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + + /** + * + * + *
        +     * The blueprints that will satisfy this test. There may be multiple blueprints
        +     * that can signal to the server that this test case is being exercised. Although
        +     * multiple blueprints are specified, only a single blueprint needs to be run to
        +     * signal that the test case was exercised.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Test.Blueprint blueprints = 4; + */ + public Builder addBlueprints( + int index, com.google.showcase.v1beta1.Test.Blueprint.Builder builderForValue) { + if (blueprintsBuilder_ == null) { + ensureBlueprintsIsMutable(); + blueprints_.add(index, builderForValue.build()); + onChanged(); + } else { + blueprintsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
        +     * The blueprints that will satisfy this test. There may be multiple blueprints
        +     * that can signal to the server that this test case is being exercised. Although
        +     * multiple blueprints are specified, only a single blueprint needs to be run to
        +     * signal that the test case was exercised.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Test.Blueprint blueprints = 4; + */ + public Builder addAllBlueprints( + java.lang.Iterable values) { + if (blueprintsBuilder_ == null) { + ensureBlueprintsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, blueprints_); + onChanged(); + } else { + blueprintsBuilder_.addAllMessages(values); + } + return this; + } + + /** + * + * + *
        +     * The blueprints that will satisfy this test. There may be multiple blueprints
        +     * that can signal to the server that this test case is being exercised. Although
        +     * multiple blueprints are specified, only a single blueprint needs to be run to
        +     * signal that the test case was exercised.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Test.Blueprint blueprints = 4; + */ + public Builder clearBlueprints() { + if (blueprintsBuilder_ == null) { + blueprints_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + blueprintsBuilder_.clear(); + } + return this; + } + + /** + * + * + *
        +     * The blueprints that will satisfy this test. There may be multiple blueprints
        +     * that can signal to the server that this test case is being exercised. Although
        +     * multiple blueprints are specified, only a single blueprint needs to be run to
        +     * signal that the test case was exercised.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Test.Blueprint blueprints = 4; + */ + public Builder removeBlueprints(int index) { + if (blueprintsBuilder_ == null) { + ensureBlueprintsIsMutable(); + blueprints_.remove(index); + onChanged(); + } else { + blueprintsBuilder_.remove(index); + } + return this; + } + + /** + * + * + *
        +     * The blueprints that will satisfy this test. There may be multiple blueprints
        +     * that can signal to the server that this test case is being exercised. Although
        +     * multiple blueprints are specified, only a single blueprint needs to be run to
        +     * signal that the test case was exercised.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Test.Blueprint blueprints = 4; + */ + public com.google.showcase.v1beta1.Test.Blueprint.Builder getBlueprintsBuilder(int index) { + return getBlueprintsFieldBuilder().getBuilder(index); + } + + /** + * + * + *
        +     * The blueprints that will satisfy this test. There may be multiple blueprints
        +     * that can signal to the server that this test case is being exercised. Although
        +     * multiple blueprints are specified, only a single blueprint needs to be run to
        +     * signal that the test case was exercised.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Test.Blueprint blueprints = 4; + */ + public com.google.showcase.v1beta1.Test.BlueprintOrBuilder getBlueprintsOrBuilder(int index) { + if (blueprintsBuilder_ == null) { + return blueprints_.get(index); + } else { + return blueprintsBuilder_.getMessageOrBuilder(index); + } + } + + /** + * + * + *
        +     * The blueprints that will satisfy this test. There may be multiple blueprints
        +     * that can signal to the server that this test case is being exercised. Although
        +     * multiple blueprints are specified, only a single blueprint needs to be run to
        +     * signal that the test case was exercised.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Test.Blueprint blueprints = 4; + */ + public java.util.List + getBlueprintsOrBuilderList() { + if (blueprintsBuilder_ != null) { + return blueprintsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(blueprints_); + } + } + + /** + * + * + *
        +     * The blueprints that will satisfy this test. There may be multiple blueprints
        +     * that can signal to the server that this test case is being exercised. Although
        +     * multiple blueprints are specified, only a single blueprint needs to be run to
        +     * signal that the test case was exercised.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Test.Blueprint blueprints = 4; + */ + public com.google.showcase.v1beta1.Test.Blueprint.Builder addBlueprintsBuilder() { + return getBlueprintsFieldBuilder() + .addBuilder(com.google.showcase.v1beta1.Test.Blueprint.getDefaultInstance()); + } + + /** + * + * + *
        +     * The blueprints that will satisfy this test. There may be multiple blueprints
        +     * that can signal to the server that this test case is being exercised. Although
        +     * multiple blueprints are specified, only a single blueprint needs to be run to
        +     * signal that the test case was exercised.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Test.Blueprint blueprints = 4; + */ + public com.google.showcase.v1beta1.Test.Blueprint.Builder addBlueprintsBuilder(int index) { + return getBlueprintsFieldBuilder() + .addBuilder(index, com.google.showcase.v1beta1.Test.Blueprint.getDefaultInstance()); + } + + /** + * + * + *
        +     * The blueprints that will satisfy this test. There may be multiple blueprints
        +     * that can signal to the server that this test case is being exercised. Although
        +     * multiple blueprints are specified, only a single blueprint needs to be run to
        +     * signal that the test case was exercised.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Test.Blueprint blueprints = 4; + */ + public java.util.List + getBlueprintsBuilderList() { + return getBlueprintsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.showcase.v1beta1.Test.Blueprint, + com.google.showcase.v1beta1.Test.Blueprint.Builder, + com.google.showcase.v1beta1.Test.BlueprintOrBuilder> + getBlueprintsFieldBuilder() { + if (blueprintsBuilder_ == null) { + blueprintsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.showcase.v1beta1.Test.Blueprint, + com.google.showcase.v1beta1.Test.Blueprint.Builder, + com.google.showcase.v1beta1.Test.BlueprintOrBuilder>( + blueprints_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + blueprints_ = null; + } + return blueprintsBuilder_; + } + + @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.showcase.v1beta1.Test) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.Test) + private static final com.google.showcase.v1beta1.Test DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.Test(); + } + + public static com.google.showcase.v1beta1.Test getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Test parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Test(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.showcase.v1beta1.Test getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/TestName.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/TestName.java new file mode 100644 index 0000000000..276698030f --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/TestName.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.showcase.v1beta1; + +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +@Generated("by gapic-generator-java") +public class TestName implements ResourceName { + private static final PathTemplate SESSION_TEST = + PathTemplate.createWithoutUrlEncoding("sessions/{session}/tests/{test}"); + private volatile Map fieldValuesMap; + private final String session; + private final String test; + + @Deprecated + protected TestName() { + session = null; + test = null; + } + + private TestName(Builder builder) { + session = Preconditions.checkNotNull(builder.getSession()); + test = Preconditions.checkNotNull(builder.getTest()); + } + + public String getSession() { + return session; + } + + public String getTest() { + return test; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + public static TestName of(String session, String test) { + return newBuilder().setSession(session).setTest(test).build(); + } + + public static String format(String session, String test) { + return newBuilder().setSession(session).setTest(test).build().toString(); + } + + public static TestName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + SESSION_TEST.validatedMatch( + formattedString, "TestName.parse: formattedString not in valid format"); + return of(matchMap.get("session"), matchMap.get("test")); + } + + 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 (TestName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return SESSION_TEST.matches(formattedString); + } + + @Override + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + if (session != null) { + fieldMapBuilder.put("session", session); + } + if (test != null) { + fieldMapBuilder.put("test", test); + } + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return SESSION_TEST.instantiate("session", session, "test", test); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o != null && getClass() == o.getClass()) { + TestName that = ((TestName) o); + return Objects.equals(this.session, that.session) && Objects.equals(this.test, that.test); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= Objects.hashCode(session); + h *= 1000003; + h ^= Objects.hashCode(test); + return h; + } + + /** Builder for sessions/{session}/tests/{test}. */ + public static class Builder { + private String session; + private String test; + + protected Builder() {} + + public String getSession() { + return session; + } + + public String getTest() { + return test; + } + + public Builder setSession(String session) { + this.session = session; + return this; + } + + public Builder setTest(String test) { + this.test = test; + return this; + } + + private Builder(TestName testName) { + this.session = testName.session; + this.test = testName.test; + } + + public TestName build() { + return new TestName(this); + } + } +} diff --git a/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/TestOrBuilder.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/TestOrBuilder.java new file mode 100644 index 0000000000..a0cc89f870 --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/TestOrBuilder.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: schema/google/showcase/v1beta1/testing.proto + +package com.google.showcase.v1beta1; + +public interface TestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.Test) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
        +   * The name of the test.
        +   * The tests/* portion of the names are hard-coded, and do not change
        +   * from session to session.
        +   * 
        + * + * string name = 1; + * + * @return The name. + */ + java.lang.String getName(); + + /** + * + * + *
        +   * The name of the test.
        +   * The tests/* portion of the names are hard-coded, and do not change
        +   * from session to session.
        +   * 
        + * + * string name = 1; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
        +   * The expectation level for this test.
        +   * 
        + * + * .google.showcase.v1beta1.Test.ExpectationLevel expectation_level = 2; + * + * @return The enum numeric value on the wire for expectationLevel. + */ + int getExpectationLevelValue(); + + /** + * + * + *
        +   * The expectation level for this test.
        +   * 
        + * + * .google.showcase.v1beta1.Test.ExpectationLevel expectation_level = 2; + * + * @return The expectationLevel. + */ + com.google.showcase.v1beta1.Test.ExpectationLevel getExpectationLevel(); + + /** + * + * + *
        +   * A description of the test.
        +   * 
        + * + * string description = 3; + * + * @return The description. + */ + java.lang.String getDescription(); + + /** + * + * + *
        +   * A description of the test.
        +   * 
        + * + * string description = 3; + * + * @return The bytes for description. + */ + com.google.protobuf.ByteString getDescriptionBytes(); + + /** + * + * + *
        +   * The blueprints that will satisfy this test. There may be multiple blueprints
        +   * that can signal to the server that this test case is being exercised. Although
        +   * multiple blueprints are specified, only a single blueprint needs to be run to
        +   * signal that the test case was exercised.
        +   * 
        + * + * repeated .google.showcase.v1beta1.Test.Blueprint blueprints = 4; + */ + java.util.List getBlueprintsList(); + + /** + * + * + *
        +   * The blueprints that will satisfy this test. There may be multiple blueprints
        +   * that can signal to the server that this test case is being exercised. Although
        +   * multiple blueprints are specified, only a single blueprint needs to be run to
        +   * signal that the test case was exercised.
        +   * 
        + * + * repeated .google.showcase.v1beta1.Test.Blueprint blueprints = 4; + */ + com.google.showcase.v1beta1.Test.Blueprint getBlueprints(int index); + + /** + * + * + *
        +   * The blueprints that will satisfy this test. There may be multiple blueprints
        +   * that can signal to the server that this test case is being exercised. Although
        +   * multiple blueprints are specified, only a single blueprint needs to be run to
        +   * signal that the test case was exercised.
        +   * 
        + * + * repeated .google.showcase.v1beta1.Test.Blueprint blueprints = 4; + */ + int getBlueprintsCount(); + + /** + * + * + *
        +   * The blueprints that will satisfy this test. There may be multiple blueprints
        +   * that can signal to the server that this test case is being exercised. Although
        +   * multiple blueprints are specified, only a single blueprint needs to be run to
        +   * signal that the test case was exercised.
        +   * 
        + * + * repeated .google.showcase.v1beta1.Test.Blueprint blueprints = 4; + */ + java.util.List + getBlueprintsOrBuilderList(); + + /** + * + * + *
        +   * The blueprints that will satisfy this test. There may be multiple blueprints
        +   * that can signal to the server that this test case is being exercised. Although
        +   * multiple blueprints are specified, only a single blueprint needs to be run to
        +   * signal that the test case was exercised.
        +   * 
        + * + * repeated .google.showcase.v1beta1.Test.Blueprint blueprints = 4; + */ + com.google.showcase.v1beta1.Test.BlueprintOrBuilder getBlueprintsOrBuilder(int index); +} diff --git a/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/TestRun.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/TestRun.java new file mode 100644 index 0000000000..e130234a14 --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/TestRun.java @@ -0,0 +1,936 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/testing.proto + +package com.google.showcase.v1beta1; + +/** + * + * + *
        + * A TestRun is the result of running a Test.
        + * 
        + * + * Protobuf type {@code google.showcase.v1beta1.TestRun} + */ +public final class TestRun extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.TestRun) + TestRunOrBuilder { + private static final long serialVersionUID = 0L; + + // Use TestRun.newBuilder() to construct. + private TestRun(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private TestRun() { + test_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new TestRun(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private TestRun( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + test_ = s; + break; + } + case 18: + { + com.google.showcase.v1beta1.Issue.Builder subBuilder = null; + if (issue_ != null) { + subBuilder = issue_.toBuilder(); + } + issue_ = + input.readMessage(com.google.showcase.v1beta1.Issue.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(issue_); + issue_ = subBuilder.buildPartial(); + } + + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.TestingOuterClass + .internal_static_google_showcase_v1beta1_TestRun_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.TestingOuterClass + .internal_static_google_showcase_v1beta1_TestRun_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.TestRun.class, + com.google.showcase.v1beta1.TestRun.Builder.class); + } + + public static final int TEST_FIELD_NUMBER = 1; + private volatile java.lang.Object test_; + + /** + * + * + *
        +   * The name of the test.
        +   * The tests/* portion of the names are hard-coded, and do not change
        +   * from session to session.
        +   * 
        + * + * string test = 1 [(.google.api.resource_reference) = { ... } + * + * @return The test. + */ + @java.lang.Override + public java.lang.String getTest() { + java.lang.Object ref = test_; + 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(); + test_ = s; + return s; + } + } + + /** + * + * + *
        +   * The name of the test.
        +   * The tests/* portion of the names are hard-coded, and do not change
        +   * from session to session.
        +   * 
        + * + * string test = 1 [(.google.api.resource_reference) = { ... } + * + * @return The bytes for test. + */ + @java.lang.Override + public com.google.protobuf.ByteString getTestBytes() { + java.lang.Object ref = test_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + test_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int ISSUE_FIELD_NUMBER = 2; + private com.google.showcase.v1beta1.Issue issue_; + + /** + * + * + *
        +   * An issue found with the test run. If empty, this test run was successful.
        +   * 
        + * + * .google.showcase.v1beta1.Issue issue = 2; + * + * @return Whether the issue field is set. + */ + @java.lang.Override + public boolean hasIssue() { + return issue_ != null; + } + + /** + * + * + *
        +   * An issue found with the test run. If empty, this test run was successful.
        +   * 
        + * + * .google.showcase.v1beta1.Issue issue = 2; + * + * @return The issue. + */ + @java.lang.Override + public com.google.showcase.v1beta1.Issue getIssue() { + return issue_ == null ? com.google.showcase.v1beta1.Issue.getDefaultInstance() : issue_; + } + + /** + * + * + *
        +   * An issue found with the test run. If empty, this test run was successful.
        +   * 
        + * + * .google.showcase.v1beta1.Issue issue = 2; + */ + @java.lang.Override + public com.google.showcase.v1beta1.IssueOrBuilder getIssueOrBuilder() { + return getIssue(); + } + + 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(test_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, test_); + } + if (issue_ != null) { + output.writeMessage(2, getIssue()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(test_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, test_); + } + if (issue_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getIssue()); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.showcase.v1beta1.TestRun)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.TestRun other = (com.google.showcase.v1beta1.TestRun) obj; + + if (!getTest().equals(other.getTest())) return false; + if (hasIssue() != other.hasIssue()) return false; + if (hasIssue()) { + if (!getIssue().equals(other.getIssue())) return false; + } + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + TEST_FIELD_NUMBER; + hash = (53 * hash) + getTest().hashCode(); + if (hasIssue()) { + hash = (37 * hash) + ISSUE_FIELD_NUMBER; + hash = (53 * hash) + getIssue().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.showcase.v1beta1.TestRun parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.TestRun parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.TestRun parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.TestRun 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.showcase.v1beta1.TestRun parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.TestRun parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.TestRun parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.TestRun 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.showcase.v1beta1.TestRun parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.TestRun 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.showcase.v1beta1.TestRun parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.TestRun 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.showcase.v1beta1.TestRun prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
        +   * A TestRun is the result of running a Test.
        +   * 
        + * + * Protobuf type {@code google.showcase.v1beta1.TestRun} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.TestRun) + com.google.showcase.v1beta1.TestRunOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.TestingOuterClass + .internal_static_google_showcase_v1beta1_TestRun_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.TestingOuterClass + .internal_static_google_showcase_v1beta1_TestRun_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.TestRun.class, + com.google.showcase.v1beta1.TestRun.Builder.class); + } + + // Construct using com.google.showcase.v1beta1.TestRun.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + test_ = ""; + + if (issueBuilder_ == null) { + issue_ = null; + } else { + issue_ = null; + issueBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.showcase.v1beta1.TestingOuterClass + .internal_static_google_showcase_v1beta1_TestRun_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.TestRun getDefaultInstanceForType() { + return com.google.showcase.v1beta1.TestRun.getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.TestRun build() { + com.google.showcase.v1beta1.TestRun result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.TestRun buildPartial() { + com.google.showcase.v1beta1.TestRun result = new com.google.showcase.v1beta1.TestRun(this); + result.test_ = test_; + if (issueBuilder_ == null) { + result.issue_ = issue_; + } else { + result.issue_ = issueBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.showcase.v1beta1.TestRun) { + return mergeFrom((com.google.showcase.v1beta1.TestRun) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.showcase.v1beta1.TestRun other) { + if (other == com.google.showcase.v1beta1.TestRun.getDefaultInstance()) return this; + if (!other.getTest().isEmpty()) { + test_ = other.test_; + onChanged(); + } + if (other.hasIssue()) { + mergeIssue(other.getIssue()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.showcase.v1beta1.TestRun parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.showcase.v1beta1.TestRun) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object test_ = ""; + + /** + * + * + *
        +     * The name of the test.
        +     * The tests/* portion of the names are hard-coded, and do not change
        +     * from session to session.
        +     * 
        + * + * string test = 1 [(.google.api.resource_reference) = { ... } + * + * @return The test. + */ + public java.lang.String getTest() { + java.lang.Object ref = test_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + test_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
        +     * The name of the test.
        +     * The tests/* portion of the names are hard-coded, and do not change
        +     * from session to session.
        +     * 
        + * + * string test = 1 [(.google.api.resource_reference) = { ... } + * + * @return The bytes for test. + */ + public com.google.protobuf.ByteString getTestBytes() { + java.lang.Object ref = test_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + test_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
        +     * The name of the test.
        +     * The tests/* portion of the names are hard-coded, and do not change
        +     * from session to session.
        +     * 
        + * + * string test = 1 [(.google.api.resource_reference) = { ... } + * + * @param value The test to set. + * @return This builder for chaining. + */ + public Builder setTest(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + test_ = value; + onChanged(); + return this; + } + + /** + * + * + *
        +     * The name of the test.
        +     * The tests/* portion of the names are hard-coded, and do not change
        +     * from session to session.
        +     * 
        + * + * string test = 1 [(.google.api.resource_reference) = { ... } + * + * @return This builder for chaining. + */ + public Builder clearTest() { + + test_ = getDefaultInstance().getTest(); + onChanged(); + return this; + } + + /** + * + * + *
        +     * The name of the test.
        +     * The tests/* portion of the names are hard-coded, and do not change
        +     * from session to session.
        +     * 
        + * + * string test = 1 [(.google.api.resource_reference) = { ... } + * + * @param value The bytes for test to set. + * @return This builder for chaining. + */ + public Builder setTestBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + test_ = value; + onChanged(); + return this; + } + + private com.google.showcase.v1beta1.Issue issue_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.showcase.v1beta1.Issue, + com.google.showcase.v1beta1.Issue.Builder, + com.google.showcase.v1beta1.IssueOrBuilder> + issueBuilder_; + + /** + * + * + *
        +     * An issue found with the test run. If empty, this test run was successful.
        +     * 
        + * + * .google.showcase.v1beta1.Issue issue = 2; + * + * @return Whether the issue field is set. + */ + public boolean hasIssue() { + return issueBuilder_ != null || issue_ != null; + } + + /** + * + * + *
        +     * An issue found with the test run. If empty, this test run was successful.
        +     * 
        + * + * .google.showcase.v1beta1.Issue issue = 2; + * + * @return The issue. + */ + public com.google.showcase.v1beta1.Issue getIssue() { + if (issueBuilder_ == null) { + return issue_ == null ? com.google.showcase.v1beta1.Issue.getDefaultInstance() : issue_; + } else { + return issueBuilder_.getMessage(); + } + } + + /** + * + * + *
        +     * An issue found with the test run. If empty, this test run was successful.
        +     * 
        + * + * .google.showcase.v1beta1.Issue issue = 2; + */ + public Builder setIssue(com.google.showcase.v1beta1.Issue value) { + if (issueBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + issue_ = value; + onChanged(); + } else { + issueBuilder_.setMessage(value); + } + + return this; + } + + /** + * + * + *
        +     * An issue found with the test run. If empty, this test run was successful.
        +     * 
        + * + * .google.showcase.v1beta1.Issue issue = 2; + */ + public Builder setIssue(com.google.showcase.v1beta1.Issue.Builder builderForValue) { + if (issueBuilder_ == null) { + issue_ = builderForValue.build(); + onChanged(); + } else { + issueBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + + /** + * + * + *
        +     * An issue found with the test run. If empty, this test run was successful.
        +     * 
        + * + * .google.showcase.v1beta1.Issue issue = 2; + */ + public Builder mergeIssue(com.google.showcase.v1beta1.Issue value) { + if (issueBuilder_ == null) { + if (issue_ != null) { + issue_ = + com.google.showcase.v1beta1.Issue.newBuilder(issue_).mergeFrom(value).buildPartial(); + } else { + issue_ = value; + } + onChanged(); + } else { + issueBuilder_.mergeFrom(value); + } + + return this; + } + + /** + * + * + *
        +     * An issue found with the test run. If empty, this test run was successful.
        +     * 
        + * + * .google.showcase.v1beta1.Issue issue = 2; + */ + public Builder clearIssue() { + if (issueBuilder_ == null) { + issue_ = null; + onChanged(); + } else { + issue_ = null; + issueBuilder_ = null; + } + + return this; + } + + /** + * + * + *
        +     * An issue found with the test run. If empty, this test run was successful.
        +     * 
        + * + * .google.showcase.v1beta1.Issue issue = 2; + */ + public com.google.showcase.v1beta1.Issue.Builder getIssueBuilder() { + + onChanged(); + return getIssueFieldBuilder().getBuilder(); + } + + /** + * + * + *
        +     * An issue found with the test run. If empty, this test run was successful.
        +     * 
        + * + * .google.showcase.v1beta1.Issue issue = 2; + */ + public com.google.showcase.v1beta1.IssueOrBuilder getIssueOrBuilder() { + if (issueBuilder_ != null) { + return issueBuilder_.getMessageOrBuilder(); + } else { + return issue_ == null ? com.google.showcase.v1beta1.Issue.getDefaultInstance() : issue_; + } + } + + /** + * + * + *
        +     * An issue found with the test run. If empty, this test run was successful.
        +     * 
        + * + * .google.showcase.v1beta1.Issue issue = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.showcase.v1beta1.Issue, + com.google.showcase.v1beta1.Issue.Builder, + com.google.showcase.v1beta1.IssueOrBuilder> + getIssueFieldBuilder() { + if (issueBuilder_ == null) { + issueBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.showcase.v1beta1.Issue, + com.google.showcase.v1beta1.Issue.Builder, + com.google.showcase.v1beta1.IssueOrBuilder>( + getIssue(), getParentForChildren(), isClean()); + issue_ = null; + } + return issueBuilder_; + } + + @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.showcase.v1beta1.TestRun) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.TestRun) + private static final com.google.showcase.v1beta1.TestRun DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.TestRun(); + } + + public static com.google.showcase.v1beta1.TestRun getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public TestRun parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new TestRun(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.showcase.v1beta1.TestRun getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/TestRunOrBuilder.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/TestRunOrBuilder.java new file mode 100644 index 0000000000..ed31c3c1c9 --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/TestRunOrBuilder.java @@ -0,0 +1,92 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/testing.proto + +package com.google.showcase.v1beta1; + +public interface TestRunOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.TestRun) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
        +   * The name of the test.
        +   * The tests/* portion of the names are hard-coded, and do not change
        +   * from session to session.
        +   * 
        + * + * string test = 1 [(.google.api.resource_reference) = { ... } + * + * @return The test. + */ + java.lang.String getTest(); + + /** + * + * + *
        +   * The name of the test.
        +   * The tests/* portion of the names are hard-coded, and do not change
        +   * from session to session.
        +   * 
        + * + * string test = 1 [(.google.api.resource_reference) = { ... } + * + * @return The bytes for test. + */ + com.google.protobuf.ByteString getTestBytes(); + + /** + * + * + *
        +   * An issue found with the test run. If empty, this test run was successful.
        +   * 
        + * + * .google.showcase.v1beta1.Issue issue = 2; + * + * @return Whether the issue field is set. + */ + boolean hasIssue(); + + /** + * + * + *
        +   * An issue found with the test run. If empty, this test run was successful.
        +   * 
        + * + * .google.showcase.v1beta1.Issue issue = 2; + * + * @return The issue. + */ + com.google.showcase.v1beta1.Issue getIssue(); + + /** + * + * + *
        +   * An issue found with the test run. If empty, this test run was successful.
        +   * 
        + * + * .google.showcase.v1beta1.Issue issue = 2; + */ + com.google.showcase.v1beta1.IssueOrBuilder getIssueOrBuilder(); +} diff --git a/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/TestingOuterClass.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/TestingOuterClass.java new file mode 100644 index 0000000000..ac16d6e6ab --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/TestingOuterClass.java @@ -0,0 +1,377 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/testing.proto + +package com.google.showcase.v1beta1; + +public final class TestingOuterClass { + private TestingOuterClass() {} + + 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_showcase_v1beta1_Session_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_showcase_v1beta1_Session_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_showcase_v1beta1_CreateSessionRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_showcase_v1beta1_CreateSessionRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_showcase_v1beta1_GetSessionRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_showcase_v1beta1_GetSessionRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_showcase_v1beta1_ListSessionsRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_showcase_v1beta1_ListSessionsRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_showcase_v1beta1_ListSessionsResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_showcase_v1beta1_ListSessionsResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_showcase_v1beta1_DeleteSessionRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_showcase_v1beta1_DeleteSessionRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_showcase_v1beta1_ReportSessionRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_showcase_v1beta1_ReportSessionRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_showcase_v1beta1_ReportSessionResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_showcase_v1beta1_ReportSessionResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_showcase_v1beta1_Test_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_showcase_v1beta1_Test_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_showcase_v1beta1_Test_Blueprint_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_showcase_v1beta1_Test_Blueprint_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_showcase_v1beta1_Test_Blueprint_Invocation_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_showcase_v1beta1_Test_Blueprint_Invocation_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_showcase_v1beta1_Issue_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_showcase_v1beta1_Issue_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_showcase_v1beta1_ListTestsRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_showcase_v1beta1_ListTestsRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_showcase_v1beta1_ListTestsResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_showcase_v1beta1_ListTestsResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_showcase_v1beta1_TestRun_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_showcase_v1beta1_TestRun_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_showcase_v1beta1_DeleteTestRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_showcase_v1beta1_DeleteTestRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_showcase_v1beta1_VerifyTestRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_showcase_v1beta1_VerifyTestRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_showcase_v1beta1_VerifyTestResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_showcase_v1beta1_VerifyTestResponse_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,schema/google/showcase/v1beta1/testing" + + ".proto\022\027google.showcase.v1beta1\032\034google/" + + "api/annotations.proto\032\027google/api/client" + + ".proto\032\031google/api/resource.proto\032\033googl" + + "e/protobuf/empty.proto\"\311\001\n\007Session\022\014\n\004na" + + "me\030\001 \001(\t\0229\n\007version\030\002 \001(\0162(.google.showc" + + "ase.v1beta1.Session.Version\";\n\007Version\022\027" + + "\n\023VERSION_UNSPECIFIED\020\000\022\r\n\tV1_LATEST\020\001\022\010" + + "\n\004V1_0\020\002:8\352A5\n\037showcase.googleapis.com/S" + + "ession\022\022sessions/{session}\"I\n\024CreateSess" + + "ionRequest\0221\n\007session\030\001 \001(\0132 .google.sho" + + "wcase.v1beta1.Session\"G\n\021GetSessionReque" + + "st\0222\n\004name\030\001 \001(\tB$\372A!\n\037showcase.googleap" + + "is.com/Session\"<\n\023ListSessionsRequest\022\021\n" + + "\tpage_size\030\001 \001(\005\022\022\n\npage_token\030\002 \001(\t\"c\n\024" + + "ListSessionsResponse\0222\n\010sessions\030\001 \003(\0132 " + + ".google.showcase.v1beta1.Session\022\027\n\017next" + + "_page_token\030\002 \001(\t\"J\n\024DeleteSessionReques" + + "t\0222\n\004name\030\001 \001(\tB$\372A!\n\037showcase.googleapi" + + "s.com/Session\"J\n\024ReportSessionRequest\0222\n" + + "\004name\030\001 \001(\tB$\372A!\n\037showcase.googleapis.co" + + "m/Session\"\335\001\n\025ReportSessionResponse\022E\n\006r" + + "esult\030\001 \001(\01625.google.showcase.v1beta1.Re" + + "portSessionResponse.Result\0223\n\ttest_runs\030" + + "\002 \003(\0132 .google.showcase.v1beta1.TestRun\"" + + "H\n\006Result\022\026\n\022RESULT_UNSPECIFIED\020\000\022\n\n\006PAS" + + "SED\020\001\022\n\n\006FAILED\020\002\022\016\n\nINCOMPLETE\020\003\"\272\005\n\004Te" + + "st\022\014\n\004name\030\001 \001(\t\022I\n\021expectation_level\030\002 " + + "\001(\0162..google.showcase.v1beta1.Test.Expec" + + "tationLevel\022\023\n\013description\030\003 \001(\t\022;\n\nblue" + + "prints\030\004 \003(\0132\'.google.showcase.v1beta1.T" + + "est.Blueprint\032\336\002\n\tBlueprint\022\014\n\004name\030\001 \001(" + + "\t\022\023\n\013description\030\002 \001(\t\022C\n\007request\030\003 \001(\0132" + + "2.google.showcase.v1beta1.Test.Blueprint" + + ".Invocation\022O\n\023additional_requests\030\004 \003(\013" + + "22.google.showcase.v1beta1.Test.Blueprin" + + "t.Invocation\0328\n\nInvocation\022\016\n\006method\030\001 \001" + + "(\t\022\032\n\022serialized_request\030\002 \001(\014:^\352A[\n!sho" + + "wcase.googleapis.com/Blueprint\0226sessions" + + "/{session}/tests/{test}/blueprints/{blue" + + "print}\"b\n\020ExpectationLevel\022!\n\035EXPECTATIO" + + "N_LEVEL_UNSPECIFIED\020\000\022\014\n\010REQUIRED\020\001\022\017\n\013R" + + "ECOMMENDED\020\002\022\014\n\010OPTIONAL\020\003:B\352A?\n\034showcas" + + "e.googleapis.com/Test\022\037sessions/{session" + + "}/tests/{test}\"\234\002\n\005Issue\0221\n\004type\030\001 \001(\0162#" + + ".google.showcase.v1beta1.Issue.Type\0229\n\010s" + + "everity\030\002 \001(\0162\'.google.showcase.v1beta1." + + "Issue.Severity\022\023\n\013description\030\003 \001(\t\"R\n\004T" + + "ype\022\024\n\020TYPE_UNSPECIFIED\020\000\022\013\n\007SKIPPED\020\001\022\013" + + "\n\007PENDING\020\002\022\032\n\026INCORRECT_CONFIRMATION\020\003\"" + + "<\n\010Severity\022\030\n\024SEVERITY_UNSPECIFIED\020\000\022\t\n" + + "\005ERROR\020\001\022\013\n\007WARNING\020\002\"o\n\020ListTestsReques" + + "t\0224\n\006parent\030\001 \001(\tB$\372A!\n\037showcase.googlea" + + "pis.com/Session\022\021\n\tpage_size\030\002 \001(\005\022\022\n\npa" + + "ge_token\030\003 \001(\t\"Z\n\021ListTestsResponse\022,\n\005t" + + "ests\030\001 \003(\0132\035.google.showcase.v1beta1.Tes" + + "t\022\027\n\017next_page_token\030\002 \001(\t\"i\n\007TestRun\022/\n" + + "\004test\030\001 \001(\tB!\372A\036\n\034showcase.googleapis.co" + + "m/Test\022-\n\005issue\030\002 \001(\0132\036.google.showcase." + + "v1beta1.Issue\"D\n\021DeleteTestRequest\022/\n\004na" + + "me\030\001 \001(\tB!\372A\036\n\034showcase.googleapis.com/T" + + "est\"e\n\021VerifyTestRequest\022/\n\004name\030\001 \001(\tB!" + + "\372A\036\n\034showcase.googleapis.com/Test\022\016\n\006ans" + + "wer\030\002 \001(\014\022\017\n\007answers\030\003 \003(\014\"C\n\022VerifyTest" + + "Response\022-\n\005issue\030\001 \001(\0132\036.google.showcas" + + "e.v1beta1.Issue2\355\010\n\007Testing\022\204\001\n\rCreateSe" + + "ssion\022-.google.showcase.v1beta1.CreateSe" + + "ssionRequest\032 .google.showcase.v1beta1.S" + + "ession\"\"\202\323\344\223\002\034\"\021/v1beta1/sessions:\007sessi" + + "on\022~\n\nGetSession\022*.google.showcase.v1bet" + + "a1.GetSessionRequest\032 .google.showcase.v" + + "1beta1.Session\"\"\202\323\344\223\002\034\022\032/v1beta1/{name=s" + + "essions/*}\022\206\001\n\014ListSessions\022,.google.sho" + + "wcase.v1beta1.ListSessionsRequest\032-.goog" + + "le.showcase.v1beta1.ListSessionsResponse" + + "\"\031\202\323\344\223\002\023\022\021/v1beta1/sessions\022z\n\rDeleteSes" + + "sion\022-.google.showcase.v1beta1.DeleteSes" + + "sionRequest\032\026.google.protobuf.Empty\"\"\202\323\344" + + "\223\002\034*\032/v1beta1/{name=sessions/*}\022\231\001\n\rRepo" + + "rtSession\022-.google.showcase.v1beta1.Repo" + + "rtSessionRequest\032..google.showcase.v1bet" + + "a1.ReportSessionResponse\")\202\323\344\223\002#\"!/v1bet" + + "a1/{name=sessions/*}:report\022\216\001\n\tListTest" + + "s\022).google.showcase.v1beta1.ListTestsReq" + + "uest\032*.google.showcase.v1beta1.ListTests" + + "Response\"*\202\323\344\223\002$\022\"/v1beta1/{parent=sessi" + + "ons/*}/tests\022|\n\nDeleteTest\022*.google.show" + + "case.v1beta1.DeleteTestRequest\032\026.google." + + "protobuf.Empty\"*\202\323\344\223\002$*\"/v1beta1/{name=s" + + "essions/*/tests/*}\022\227\001\n\nVerifyTest\022*.goog" + + "le.showcase.v1beta1.VerifyTestRequest\032+." + + "google.showcase.v1beta1.VerifyTestRespon" + + "se\"0\202\323\344\223\002*\"(/v1beta1/{name=sessions/*/te" + + "sts/*}:check\032\021\312A\016localhost:7469Bq\n\033com.g" + + "oogle.showcase.v1beta1P\001Z4github.com/goo" + + "gleapis/gapic-showcase/server/genproto\352\002" + + "\031Google::Showcase::V1beta1b\006proto3" + }; + descriptor = + com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( + descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + com.google.api.AnnotationsProto.getDescriptor(), + com.google.api.ClientProto.getDescriptor(), + com.google.api.ResourceProto.getDescriptor(), + com.google.protobuf.EmptyProto.getDescriptor(), + }); + internal_static_google_showcase_v1beta1_Session_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_showcase_v1beta1_Session_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_showcase_v1beta1_Session_descriptor, + new java.lang.String[] { + "Name", "Version", + }); + internal_static_google_showcase_v1beta1_CreateSessionRequest_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_google_showcase_v1beta1_CreateSessionRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_showcase_v1beta1_CreateSessionRequest_descriptor, + new java.lang.String[] { + "Session", + }); + internal_static_google_showcase_v1beta1_GetSessionRequest_descriptor = + getDescriptor().getMessageTypes().get(2); + internal_static_google_showcase_v1beta1_GetSessionRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_showcase_v1beta1_GetSessionRequest_descriptor, + new java.lang.String[] { + "Name", + }); + internal_static_google_showcase_v1beta1_ListSessionsRequest_descriptor = + getDescriptor().getMessageTypes().get(3); + internal_static_google_showcase_v1beta1_ListSessionsRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_showcase_v1beta1_ListSessionsRequest_descriptor, + new java.lang.String[] { + "PageSize", "PageToken", + }); + internal_static_google_showcase_v1beta1_ListSessionsResponse_descriptor = + getDescriptor().getMessageTypes().get(4); + internal_static_google_showcase_v1beta1_ListSessionsResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_showcase_v1beta1_ListSessionsResponse_descriptor, + new java.lang.String[] { + "Sessions", "NextPageToken", + }); + internal_static_google_showcase_v1beta1_DeleteSessionRequest_descriptor = + getDescriptor().getMessageTypes().get(5); + internal_static_google_showcase_v1beta1_DeleteSessionRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_showcase_v1beta1_DeleteSessionRequest_descriptor, + new java.lang.String[] { + "Name", + }); + internal_static_google_showcase_v1beta1_ReportSessionRequest_descriptor = + getDescriptor().getMessageTypes().get(6); + internal_static_google_showcase_v1beta1_ReportSessionRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_showcase_v1beta1_ReportSessionRequest_descriptor, + new java.lang.String[] { + "Name", + }); + internal_static_google_showcase_v1beta1_ReportSessionResponse_descriptor = + getDescriptor().getMessageTypes().get(7); + internal_static_google_showcase_v1beta1_ReportSessionResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_showcase_v1beta1_ReportSessionResponse_descriptor, + new java.lang.String[] { + "Result", "TestRuns", + }); + internal_static_google_showcase_v1beta1_Test_descriptor = + getDescriptor().getMessageTypes().get(8); + internal_static_google_showcase_v1beta1_Test_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_showcase_v1beta1_Test_descriptor, + new java.lang.String[] { + "Name", "ExpectationLevel", "Description", "Blueprints", + }); + internal_static_google_showcase_v1beta1_Test_Blueprint_descriptor = + internal_static_google_showcase_v1beta1_Test_descriptor.getNestedTypes().get(0); + internal_static_google_showcase_v1beta1_Test_Blueprint_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_showcase_v1beta1_Test_Blueprint_descriptor, + new java.lang.String[] { + "Name", "Description", "Request", "AdditionalRequests", + }); + internal_static_google_showcase_v1beta1_Test_Blueprint_Invocation_descriptor = + internal_static_google_showcase_v1beta1_Test_Blueprint_descriptor.getNestedTypes().get(0); + internal_static_google_showcase_v1beta1_Test_Blueprint_Invocation_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_showcase_v1beta1_Test_Blueprint_Invocation_descriptor, + new java.lang.String[] { + "Method", "SerializedRequest", + }); + internal_static_google_showcase_v1beta1_Issue_descriptor = + getDescriptor().getMessageTypes().get(9); + internal_static_google_showcase_v1beta1_Issue_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_showcase_v1beta1_Issue_descriptor, + new java.lang.String[] { + "Type", "Severity", "Description", + }); + internal_static_google_showcase_v1beta1_ListTestsRequest_descriptor = + getDescriptor().getMessageTypes().get(10); + internal_static_google_showcase_v1beta1_ListTestsRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_showcase_v1beta1_ListTestsRequest_descriptor, + new java.lang.String[] { + "Parent", "PageSize", "PageToken", + }); + internal_static_google_showcase_v1beta1_ListTestsResponse_descriptor = + getDescriptor().getMessageTypes().get(11); + internal_static_google_showcase_v1beta1_ListTestsResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_showcase_v1beta1_ListTestsResponse_descriptor, + new java.lang.String[] { + "Tests", "NextPageToken", + }); + internal_static_google_showcase_v1beta1_TestRun_descriptor = + getDescriptor().getMessageTypes().get(12); + internal_static_google_showcase_v1beta1_TestRun_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_showcase_v1beta1_TestRun_descriptor, + new java.lang.String[] { + "Test", "Issue", + }); + internal_static_google_showcase_v1beta1_DeleteTestRequest_descriptor = + getDescriptor().getMessageTypes().get(13); + internal_static_google_showcase_v1beta1_DeleteTestRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_showcase_v1beta1_DeleteTestRequest_descriptor, + new java.lang.String[] { + "Name", + }); + internal_static_google_showcase_v1beta1_VerifyTestRequest_descriptor = + getDescriptor().getMessageTypes().get(14); + internal_static_google_showcase_v1beta1_VerifyTestRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_showcase_v1beta1_VerifyTestRequest_descriptor, + new java.lang.String[] { + "Name", "Answer", "Answers", + }); + internal_static_google_showcase_v1beta1_VerifyTestResponse_descriptor = + getDescriptor().getMessageTypes().get(15); + internal_static_google_showcase_v1beta1_VerifyTestResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_showcase_v1beta1_VerifyTestResponse_descriptor, + new java.lang.String[] { + "Issue", + }); + com.google.protobuf.ExtensionRegistry registry = + com.google.protobuf.ExtensionRegistry.newInstance(); + registry.add(com.google.api.ClientProto.defaultHost); + registry.add(com.google.api.AnnotationsProto.http); + registry.add(com.google.api.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.ResourceProto.getDescriptor(); + com.google.protobuf.EmptyProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/UpdateBlurbRequest.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/UpdateBlurbRequest.java new file mode 100644 index 0000000000..51af718756 --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/UpdateBlurbRequest.java @@ -0,0 +1,1036 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/messaging.proto + +package com.google.showcase.v1beta1; + +/** + * + * + *
        + * The request message for the google.showcase.v1beta1.Messaging\UpdateBlurb
        + * method.
        + * 
        + * + * Protobuf type {@code google.showcase.v1beta1.UpdateBlurbRequest} + */ +public final class UpdateBlurbRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.UpdateBlurbRequest) + UpdateBlurbRequestOrBuilder { + private static final long serialVersionUID = 0L; + + // Use UpdateBlurbRequest.newBuilder() to construct. + private UpdateBlurbRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private UpdateBlurbRequest() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new UpdateBlurbRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private UpdateBlurbRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + com.google.showcase.v1beta1.Blurb.Builder subBuilder = null; + if (blurb_ != null) { + subBuilder = blurb_.toBuilder(); + } + blurb_ = + input.readMessage(com.google.showcase.v1beta1.Blurb.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(blurb_); + blurb_ = subBuilder.buildPartial(); + } + + break; + } + case 18: + { + com.google.protobuf.FieldMask.Builder subBuilder = null; + if (updateMask_ != null) { + subBuilder = updateMask_.toBuilder(); + } + updateMask_ = + input.readMessage(com.google.protobuf.FieldMask.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(updateMask_); + updateMask_ = subBuilder.buildPartial(); + } + + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.MessagingOuterClass + .internal_static_google_showcase_v1beta1_UpdateBlurbRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.MessagingOuterClass + .internal_static_google_showcase_v1beta1_UpdateBlurbRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.UpdateBlurbRequest.class, + com.google.showcase.v1beta1.UpdateBlurbRequest.Builder.class); + } + + public static final int BLURB_FIELD_NUMBER = 1; + private com.google.showcase.v1beta1.Blurb blurb_; + + /** + * + * + *
        +   * The blurb to update.
        +   * 
        + * + * .google.showcase.v1beta1.Blurb blurb = 1; + * + * @return Whether the blurb field is set. + */ + @java.lang.Override + public boolean hasBlurb() { + return blurb_ != null; + } + + /** + * + * + *
        +   * The blurb to update.
        +   * 
        + * + * .google.showcase.v1beta1.Blurb blurb = 1; + * + * @return The blurb. + */ + @java.lang.Override + public com.google.showcase.v1beta1.Blurb getBlurb() { + return blurb_ == null ? com.google.showcase.v1beta1.Blurb.getDefaultInstance() : blurb_; + } + + /** + * + * + *
        +   * The blurb to update.
        +   * 
        + * + * .google.showcase.v1beta1.Blurb blurb = 1; + */ + @java.lang.Override + public com.google.showcase.v1beta1.BlurbOrBuilder getBlurbOrBuilder() { + return getBlurb(); + } + + public static final int UPDATE_MASK_FIELD_NUMBER = 2; + private com.google.protobuf.FieldMask updateMask_; + + /** + * + * + *
        +   * The field mask to determine which fields are to be updated. If empty, the
        +   * server will assume all fields are to be updated.
        +   * 
        + * + * .google.protobuf.FieldMask update_mask = 2; + * + * @return Whether the updateMask field is set. + */ + @java.lang.Override + public boolean hasUpdateMask() { + return updateMask_ != null; + } + + /** + * + * + *
        +   * The field mask to determine which fields are to be updated. If empty, the
        +   * server will assume all fields are to be updated.
        +   * 
        + * + * .google.protobuf.FieldMask update_mask = 2; + * + * @return The updateMask. + */ + @java.lang.Override + public com.google.protobuf.FieldMask getUpdateMask() { + return updateMask_ == null ? com.google.protobuf.FieldMask.getDefaultInstance() : updateMask_; + } + + /** + * + * + *
        +   * The field mask to determine which fields are to be updated. If empty, the
        +   * server will assume all fields are to be updated.
        +   * 
        + * + * .google.protobuf.FieldMask update_mask = 2; + */ + @java.lang.Override + public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { + return getUpdateMask(); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (blurb_ != null) { + output.writeMessage(1, getBlurb()); + } + if (updateMask_ != null) { + output.writeMessage(2, getUpdateMask()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (blurb_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getBlurb()); + } + if (updateMask_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getUpdateMask()); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.showcase.v1beta1.UpdateBlurbRequest)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.UpdateBlurbRequest other = + (com.google.showcase.v1beta1.UpdateBlurbRequest) obj; + + if (hasBlurb() != other.hasBlurb()) return false; + if (hasBlurb()) { + if (!getBlurb().equals(other.getBlurb())) return false; + } + if (hasUpdateMask() != other.hasUpdateMask()) return false; + if (hasUpdateMask()) { + if (!getUpdateMask().equals(other.getUpdateMask())) return false; + } + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasBlurb()) { + hash = (37 * hash) + BLURB_FIELD_NUMBER; + hash = (53 * hash) + getBlurb().hashCode(); + } + if (hasUpdateMask()) { + hash = (37 * hash) + UPDATE_MASK_FIELD_NUMBER; + hash = (53 * hash) + getUpdateMask().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.showcase.v1beta1.UpdateBlurbRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.UpdateBlurbRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.UpdateBlurbRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.UpdateBlurbRequest 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.showcase.v1beta1.UpdateBlurbRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.UpdateBlurbRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.UpdateBlurbRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.UpdateBlurbRequest 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.showcase.v1beta1.UpdateBlurbRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.UpdateBlurbRequest 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.showcase.v1beta1.UpdateBlurbRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.UpdateBlurbRequest 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.showcase.v1beta1.UpdateBlurbRequest 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 request message for the google.showcase.v1beta1.Messaging\UpdateBlurb
        +   * method.
        +   * 
        + * + * Protobuf type {@code google.showcase.v1beta1.UpdateBlurbRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.UpdateBlurbRequest) + com.google.showcase.v1beta1.UpdateBlurbRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.MessagingOuterClass + .internal_static_google_showcase_v1beta1_UpdateBlurbRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.MessagingOuterClass + .internal_static_google_showcase_v1beta1_UpdateBlurbRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.UpdateBlurbRequest.class, + com.google.showcase.v1beta1.UpdateBlurbRequest.Builder.class); + } + + // Construct using com.google.showcase.v1beta1.UpdateBlurbRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (blurbBuilder_ == null) { + blurb_ = null; + } else { + blurb_ = null; + blurbBuilder_ = null; + } + if (updateMaskBuilder_ == null) { + updateMask_ = null; + } else { + updateMask_ = null; + updateMaskBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.showcase.v1beta1.MessagingOuterClass + .internal_static_google_showcase_v1beta1_UpdateBlurbRequest_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.UpdateBlurbRequest getDefaultInstanceForType() { + return com.google.showcase.v1beta1.UpdateBlurbRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.UpdateBlurbRequest build() { + com.google.showcase.v1beta1.UpdateBlurbRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.UpdateBlurbRequest buildPartial() { + com.google.showcase.v1beta1.UpdateBlurbRequest result = + new com.google.showcase.v1beta1.UpdateBlurbRequest(this); + if (blurbBuilder_ == null) { + result.blurb_ = blurb_; + } else { + result.blurb_ = blurbBuilder_.build(); + } + if (updateMaskBuilder_ == null) { + result.updateMask_ = updateMask_; + } else { + result.updateMask_ = updateMaskBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.showcase.v1beta1.UpdateBlurbRequest) { + return mergeFrom((com.google.showcase.v1beta1.UpdateBlurbRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.showcase.v1beta1.UpdateBlurbRequest other) { + if (other == com.google.showcase.v1beta1.UpdateBlurbRequest.getDefaultInstance()) return this; + if (other.hasBlurb()) { + mergeBlurb(other.getBlurb()); + } + if (other.hasUpdateMask()) { + mergeUpdateMask(other.getUpdateMask()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.showcase.v1beta1.UpdateBlurbRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.showcase.v1beta1.UpdateBlurbRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private com.google.showcase.v1beta1.Blurb blurb_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.showcase.v1beta1.Blurb, + com.google.showcase.v1beta1.Blurb.Builder, + com.google.showcase.v1beta1.BlurbOrBuilder> + blurbBuilder_; + + /** + * + * + *
        +     * The blurb to update.
        +     * 
        + * + * .google.showcase.v1beta1.Blurb blurb = 1; + * + * @return Whether the blurb field is set. + */ + public boolean hasBlurb() { + return blurbBuilder_ != null || blurb_ != null; + } + + /** + * + * + *
        +     * The blurb to update.
        +     * 
        + * + * .google.showcase.v1beta1.Blurb blurb = 1; + * + * @return The blurb. + */ + public com.google.showcase.v1beta1.Blurb getBlurb() { + if (blurbBuilder_ == null) { + return blurb_ == null ? com.google.showcase.v1beta1.Blurb.getDefaultInstance() : blurb_; + } else { + return blurbBuilder_.getMessage(); + } + } + + /** + * + * + *
        +     * The blurb to update.
        +     * 
        + * + * .google.showcase.v1beta1.Blurb blurb = 1; + */ + public Builder setBlurb(com.google.showcase.v1beta1.Blurb value) { + if (blurbBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + blurb_ = value; + onChanged(); + } else { + blurbBuilder_.setMessage(value); + } + + return this; + } + + /** + * + * + *
        +     * The blurb to update.
        +     * 
        + * + * .google.showcase.v1beta1.Blurb blurb = 1; + */ + public Builder setBlurb(com.google.showcase.v1beta1.Blurb.Builder builderForValue) { + if (blurbBuilder_ == null) { + blurb_ = builderForValue.build(); + onChanged(); + } else { + blurbBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + + /** + * + * + *
        +     * The blurb to update.
        +     * 
        + * + * .google.showcase.v1beta1.Blurb blurb = 1; + */ + public Builder mergeBlurb(com.google.showcase.v1beta1.Blurb value) { + if (blurbBuilder_ == null) { + if (blurb_ != null) { + blurb_ = + com.google.showcase.v1beta1.Blurb.newBuilder(blurb_).mergeFrom(value).buildPartial(); + } else { + blurb_ = value; + } + onChanged(); + } else { + blurbBuilder_.mergeFrom(value); + } + + return this; + } + + /** + * + * + *
        +     * The blurb to update.
        +     * 
        + * + * .google.showcase.v1beta1.Blurb blurb = 1; + */ + public Builder clearBlurb() { + if (blurbBuilder_ == null) { + blurb_ = null; + onChanged(); + } else { + blurb_ = null; + blurbBuilder_ = null; + } + + return this; + } + + /** + * + * + *
        +     * The blurb to update.
        +     * 
        + * + * .google.showcase.v1beta1.Blurb blurb = 1; + */ + public com.google.showcase.v1beta1.Blurb.Builder getBlurbBuilder() { + + onChanged(); + return getBlurbFieldBuilder().getBuilder(); + } + + /** + * + * + *
        +     * The blurb to update.
        +     * 
        + * + * .google.showcase.v1beta1.Blurb blurb = 1; + */ + public com.google.showcase.v1beta1.BlurbOrBuilder getBlurbOrBuilder() { + if (blurbBuilder_ != null) { + return blurbBuilder_.getMessageOrBuilder(); + } else { + return blurb_ == null ? com.google.showcase.v1beta1.Blurb.getDefaultInstance() : blurb_; + } + } + + /** + * + * + *
        +     * The blurb to update.
        +     * 
        + * + * .google.showcase.v1beta1.Blurb blurb = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.showcase.v1beta1.Blurb, + com.google.showcase.v1beta1.Blurb.Builder, + com.google.showcase.v1beta1.BlurbOrBuilder> + getBlurbFieldBuilder() { + if (blurbBuilder_ == null) { + blurbBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.showcase.v1beta1.Blurb, + com.google.showcase.v1beta1.Blurb.Builder, + com.google.showcase.v1beta1.BlurbOrBuilder>( + getBlurb(), getParentForChildren(), isClean()); + blurb_ = null; + } + return blurbBuilder_; + } + + private com.google.protobuf.FieldMask updateMask_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder> + updateMaskBuilder_; + + /** + * + * + *
        +     * The field mask to determine which fields are to be updated. If empty, the
        +     * server will assume all fields are to be updated.
        +     * 
        + * + * .google.protobuf.FieldMask update_mask = 2; + * + * @return Whether the updateMask field is set. + */ + public boolean hasUpdateMask() { + return updateMaskBuilder_ != null || updateMask_ != null; + } + + /** + * + * + *
        +     * The field mask to determine which fields are to be updated. If empty, the
        +     * server will assume all fields are to be updated.
        +     * 
        + * + * .google.protobuf.FieldMask update_mask = 2; + * + * @return The updateMask. + */ + public com.google.protobuf.FieldMask getUpdateMask() { + if (updateMaskBuilder_ == null) { + return updateMask_ == null + ? com.google.protobuf.FieldMask.getDefaultInstance() + : updateMask_; + } else { + return updateMaskBuilder_.getMessage(); + } + } + + /** + * + * + *
        +     * The field mask to determine which fields are to be updated. If empty, the
        +     * server will assume all fields are to be updated.
        +     * 
        + * + * .google.protobuf.FieldMask update_mask = 2; + */ + public Builder setUpdateMask(com.google.protobuf.FieldMask value) { + if (updateMaskBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + updateMask_ = value; + onChanged(); + } else { + updateMaskBuilder_.setMessage(value); + } + + return this; + } + + /** + * + * + *
        +     * The field mask to determine which fields are to be updated. If empty, the
        +     * server will assume all fields are to be updated.
        +     * 
        + * + * .google.protobuf.FieldMask update_mask = 2; + */ + public Builder setUpdateMask(com.google.protobuf.FieldMask.Builder builderForValue) { + if (updateMaskBuilder_ == null) { + updateMask_ = builderForValue.build(); + onChanged(); + } else { + updateMaskBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + + /** + * + * + *
        +     * The field mask to determine which fields are to be updated. If empty, the
        +     * server will assume all fields are to be updated.
        +     * 
        + * + * .google.protobuf.FieldMask update_mask = 2; + */ + public Builder mergeUpdateMask(com.google.protobuf.FieldMask value) { + if (updateMaskBuilder_ == null) { + if (updateMask_ != null) { + updateMask_ = + com.google.protobuf.FieldMask.newBuilder(updateMask_).mergeFrom(value).buildPartial(); + } else { + updateMask_ = value; + } + onChanged(); + } else { + updateMaskBuilder_.mergeFrom(value); + } + + return this; + } + + /** + * + * + *
        +     * The field mask to determine which fields are to be updated. If empty, the
        +     * server will assume all fields are to be updated.
        +     * 
        + * + * .google.protobuf.FieldMask update_mask = 2; + */ + public Builder clearUpdateMask() { + if (updateMaskBuilder_ == null) { + updateMask_ = null; + onChanged(); + } else { + updateMask_ = null; + updateMaskBuilder_ = null; + } + + return this; + } + + /** + * + * + *
        +     * The field mask to determine which fields are to be updated. If empty, the
        +     * server will assume all fields are to be updated.
        +     * 
        + * + * .google.protobuf.FieldMask update_mask = 2; + */ + public com.google.protobuf.FieldMask.Builder getUpdateMaskBuilder() { + + onChanged(); + return getUpdateMaskFieldBuilder().getBuilder(); + } + + /** + * + * + *
        +     * The field mask to determine which fields are to be updated. If empty, the
        +     * server will assume all fields are to be updated.
        +     * 
        + * + * .google.protobuf.FieldMask update_mask = 2; + */ + public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { + if (updateMaskBuilder_ != null) { + return updateMaskBuilder_.getMessageOrBuilder(); + } else { + return updateMask_ == null + ? com.google.protobuf.FieldMask.getDefaultInstance() + : updateMask_; + } + } + + /** + * + * + *
        +     * The field mask to determine which fields are to be updated. If empty, the
        +     * server will assume all fields are to be updated.
        +     * 
        + * + * .google.protobuf.FieldMask update_mask = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder> + getUpdateMaskFieldBuilder() { + if (updateMaskBuilder_ == null) { + updateMaskBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder>( + getUpdateMask(), getParentForChildren(), isClean()); + updateMask_ = null; + } + return updateMaskBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.showcase.v1beta1.UpdateBlurbRequest) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.UpdateBlurbRequest) + private static final com.google.showcase.v1beta1.UpdateBlurbRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.UpdateBlurbRequest(); + } + + public static com.google.showcase.v1beta1.UpdateBlurbRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public UpdateBlurbRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new UpdateBlurbRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.showcase.v1beta1.UpdateBlurbRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/UpdateBlurbRequestOrBuilder.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/UpdateBlurbRequestOrBuilder.java new file mode 100644 index 0000000000..1569bb6ba6 --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/UpdateBlurbRequestOrBuilder.java @@ -0,0 +1,102 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/messaging.proto + +package com.google.showcase.v1beta1; + +public interface UpdateBlurbRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.UpdateBlurbRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
        +   * The blurb to update.
        +   * 
        + * + * .google.showcase.v1beta1.Blurb blurb = 1; + * + * @return Whether the blurb field is set. + */ + boolean hasBlurb(); + + /** + * + * + *
        +   * The blurb to update.
        +   * 
        + * + * .google.showcase.v1beta1.Blurb blurb = 1; + * + * @return The blurb. + */ + com.google.showcase.v1beta1.Blurb getBlurb(); + + /** + * + * + *
        +   * The blurb to update.
        +   * 
        + * + * .google.showcase.v1beta1.Blurb blurb = 1; + */ + com.google.showcase.v1beta1.BlurbOrBuilder getBlurbOrBuilder(); + + /** + * + * + *
        +   * The field mask to determine which fields are to be updated. If empty, the
        +   * server will assume all fields are to be updated.
        +   * 
        + * + * .google.protobuf.FieldMask update_mask = 2; + * + * @return Whether the updateMask field is set. + */ + boolean hasUpdateMask(); + + /** + * + * + *
        +   * The field mask to determine which fields are to be updated. If empty, the
        +   * server will assume all fields are to be updated.
        +   * 
        + * + * .google.protobuf.FieldMask update_mask = 2; + * + * @return The updateMask. + */ + com.google.protobuf.FieldMask getUpdateMask(); + + /** + * + * + *
        +   * The field mask to determine which fields are to be updated. If empty, the
        +   * server will assume all fields are to be updated.
        +   * 
        + * + * .google.protobuf.FieldMask update_mask = 2; + */ + com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder(); +} diff --git a/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/UpdateRoomRequest.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/UpdateRoomRequest.java new file mode 100644 index 0000000000..0490400d1a --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/UpdateRoomRequest.java @@ -0,0 +1,1036 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/messaging.proto + +package com.google.showcase.v1beta1; + +/** + * + * + *
        + * The request message for the google.showcase.v1beta1.Messaging\UpdateRoom
        + * method.
        + * 
        + * + * Protobuf type {@code google.showcase.v1beta1.UpdateRoomRequest} + */ +public final class UpdateRoomRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.UpdateRoomRequest) + UpdateRoomRequestOrBuilder { + private static final long serialVersionUID = 0L; + + // Use UpdateRoomRequest.newBuilder() to construct. + private UpdateRoomRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private UpdateRoomRequest() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new UpdateRoomRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private UpdateRoomRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + com.google.showcase.v1beta1.Room.Builder subBuilder = null; + if (room_ != null) { + subBuilder = room_.toBuilder(); + } + room_ = + input.readMessage(com.google.showcase.v1beta1.Room.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(room_); + room_ = subBuilder.buildPartial(); + } + + break; + } + case 18: + { + com.google.protobuf.FieldMask.Builder subBuilder = null; + if (updateMask_ != null) { + subBuilder = updateMask_.toBuilder(); + } + updateMask_ = + input.readMessage(com.google.protobuf.FieldMask.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(updateMask_); + updateMask_ = subBuilder.buildPartial(); + } + + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.MessagingOuterClass + .internal_static_google_showcase_v1beta1_UpdateRoomRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.MessagingOuterClass + .internal_static_google_showcase_v1beta1_UpdateRoomRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.UpdateRoomRequest.class, + com.google.showcase.v1beta1.UpdateRoomRequest.Builder.class); + } + + public static final int ROOM_FIELD_NUMBER = 1; + private com.google.showcase.v1beta1.Room room_; + + /** + * + * + *
        +   * The room to update.
        +   * 
        + * + * .google.showcase.v1beta1.Room room = 1; + * + * @return Whether the room field is set. + */ + @java.lang.Override + public boolean hasRoom() { + return room_ != null; + } + + /** + * + * + *
        +   * The room to update.
        +   * 
        + * + * .google.showcase.v1beta1.Room room = 1; + * + * @return The room. + */ + @java.lang.Override + public com.google.showcase.v1beta1.Room getRoom() { + return room_ == null ? com.google.showcase.v1beta1.Room.getDefaultInstance() : room_; + } + + /** + * + * + *
        +   * The room to update.
        +   * 
        + * + * .google.showcase.v1beta1.Room room = 1; + */ + @java.lang.Override + public com.google.showcase.v1beta1.RoomOrBuilder getRoomOrBuilder() { + return getRoom(); + } + + public static final int UPDATE_MASK_FIELD_NUMBER = 2; + private com.google.protobuf.FieldMask updateMask_; + + /** + * + * + *
        +   * The field mask to determine which fields are to be updated. If empty, the
        +   * server will assume all fields are to be updated.
        +   * 
        + * + * .google.protobuf.FieldMask update_mask = 2; + * + * @return Whether the updateMask field is set. + */ + @java.lang.Override + public boolean hasUpdateMask() { + return updateMask_ != null; + } + + /** + * + * + *
        +   * The field mask to determine which fields are to be updated. If empty, the
        +   * server will assume all fields are to be updated.
        +   * 
        + * + * .google.protobuf.FieldMask update_mask = 2; + * + * @return The updateMask. + */ + @java.lang.Override + public com.google.protobuf.FieldMask getUpdateMask() { + return updateMask_ == null ? com.google.protobuf.FieldMask.getDefaultInstance() : updateMask_; + } + + /** + * + * + *
        +   * The field mask to determine which fields are to be updated. If empty, the
        +   * server will assume all fields are to be updated.
        +   * 
        + * + * .google.protobuf.FieldMask update_mask = 2; + */ + @java.lang.Override + public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { + return getUpdateMask(); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (room_ != null) { + output.writeMessage(1, getRoom()); + } + if (updateMask_ != null) { + output.writeMessage(2, getUpdateMask()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (room_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getRoom()); + } + if (updateMask_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getUpdateMask()); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.showcase.v1beta1.UpdateRoomRequest)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.UpdateRoomRequest other = + (com.google.showcase.v1beta1.UpdateRoomRequest) obj; + + if (hasRoom() != other.hasRoom()) return false; + if (hasRoom()) { + if (!getRoom().equals(other.getRoom())) return false; + } + if (hasUpdateMask() != other.hasUpdateMask()) return false; + if (hasUpdateMask()) { + if (!getUpdateMask().equals(other.getUpdateMask())) return false; + } + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasRoom()) { + hash = (37 * hash) + ROOM_FIELD_NUMBER; + hash = (53 * hash) + getRoom().hashCode(); + } + if (hasUpdateMask()) { + hash = (37 * hash) + UPDATE_MASK_FIELD_NUMBER; + hash = (53 * hash) + getUpdateMask().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.showcase.v1beta1.UpdateRoomRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.UpdateRoomRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.UpdateRoomRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.UpdateRoomRequest 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.showcase.v1beta1.UpdateRoomRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.UpdateRoomRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.UpdateRoomRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.UpdateRoomRequest 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.showcase.v1beta1.UpdateRoomRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.UpdateRoomRequest 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.showcase.v1beta1.UpdateRoomRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.UpdateRoomRequest 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.showcase.v1beta1.UpdateRoomRequest 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 request message for the google.showcase.v1beta1.Messaging\UpdateRoom
        +   * method.
        +   * 
        + * + * Protobuf type {@code google.showcase.v1beta1.UpdateRoomRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.UpdateRoomRequest) + com.google.showcase.v1beta1.UpdateRoomRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.MessagingOuterClass + .internal_static_google_showcase_v1beta1_UpdateRoomRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.MessagingOuterClass + .internal_static_google_showcase_v1beta1_UpdateRoomRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.UpdateRoomRequest.class, + com.google.showcase.v1beta1.UpdateRoomRequest.Builder.class); + } + + // Construct using com.google.showcase.v1beta1.UpdateRoomRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (roomBuilder_ == null) { + room_ = null; + } else { + room_ = null; + roomBuilder_ = null; + } + if (updateMaskBuilder_ == null) { + updateMask_ = null; + } else { + updateMask_ = null; + updateMaskBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.showcase.v1beta1.MessagingOuterClass + .internal_static_google_showcase_v1beta1_UpdateRoomRequest_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.UpdateRoomRequest getDefaultInstanceForType() { + return com.google.showcase.v1beta1.UpdateRoomRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.UpdateRoomRequest build() { + com.google.showcase.v1beta1.UpdateRoomRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.UpdateRoomRequest buildPartial() { + com.google.showcase.v1beta1.UpdateRoomRequest result = + new com.google.showcase.v1beta1.UpdateRoomRequest(this); + if (roomBuilder_ == null) { + result.room_ = room_; + } else { + result.room_ = roomBuilder_.build(); + } + if (updateMaskBuilder_ == null) { + result.updateMask_ = updateMask_; + } else { + result.updateMask_ = updateMaskBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.showcase.v1beta1.UpdateRoomRequest) { + return mergeFrom((com.google.showcase.v1beta1.UpdateRoomRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.showcase.v1beta1.UpdateRoomRequest other) { + if (other == com.google.showcase.v1beta1.UpdateRoomRequest.getDefaultInstance()) return this; + if (other.hasRoom()) { + mergeRoom(other.getRoom()); + } + if (other.hasUpdateMask()) { + mergeUpdateMask(other.getUpdateMask()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.showcase.v1beta1.UpdateRoomRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.showcase.v1beta1.UpdateRoomRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private com.google.showcase.v1beta1.Room room_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.showcase.v1beta1.Room, + com.google.showcase.v1beta1.Room.Builder, + com.google.showcase.v1beta1.RoomOrBuilder> + roomBuilder_; + + /** + * + * + *
        +     * The room to update.
        +     * 
        + * + * .google.showcase.v1beta1.Room room = 1; + * + * @return Whether the room field is set. + */ + public boolean hasRoom() { + return roomBuilder_ != null || room_ != null; + } + + /** + * + * + *
        +     * The room to update.
        +     * 
        + * + * .google.showcase.v1beta1.Room room = 1; + * + * @return The room. + */ + public com.google.showcase.v1beta1.Room getRoom() { + if (roomBuilder_ == null) { + return room_ == null ? com.google.showcase.v1beta1.Room.getDefaultInstance() : room_; + } else { + return roomBuilder_.getMessage(); + } + } + + /** + * + * + *
        +     * The room to update.
        +     * 
        + * + * .google.showcase.v1beta1.Room room = 1; + */ + public Builder setRoom(com.google.showcase.v1beta1.Room value) { + if (roomBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + room_ = value; + onChanged(); + } else { + roomBuilder_.setMessage(value); + } + + return this; + } + + /** + * + * + *
        +     * The room to update.
        +     * 
        + * + * .google.showcase.v1beta1.Room room = 1; + */ + public Builder setRoom(com.google.showcase.v1beta1.Room.Builder builderForValue) { + if (roomBuilder_ == null) { + room_ = builderForValue.build(); + onChanged(); + } else { + roomBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + + /** + * + * + *
        +     * The room to update.
        +     * 
        + * + * .google.showcase.v1beta1.Room room = 1; + */ + public Builder mergeRoom(com.google.showcase.v1beta1.Room value) { + if (roomBuilder_ == null) { + if (room_ != null) { + room_ = + com.google.showcase.v1beta1.Room.newBuilder(room_).mergeFrom(value).buildPartial(); + } else { + room_ = value; + } + onChanged(); + } else { + roomBuilder_.mergeFrom(value); + } + + return this; + } + + /** + * + * + *
        +     * The room to update.
        +     * 
        + * + * .google.showcase.v1beta1.Room room = 1; + */ + public Builder clearRoom() { + if (roomBuilder_ == null) { + room_ = null; + onChanged(); + } else { + room_ = null; + roomBuilder_ = null; + } + + return this; + } + + /** + * + * + *
        +     * The room to update.
        +     * 
        + * + * .google.showcase.v1beta1.Room room = 1; + */ + public com.google.showcase.v1beta1.Room.Builder getRoomBuilder() { + + onChanged(); + return getRoomFieldBuilder().getBuilder(); + } + + /** + * + * + *
        +     * The room to update.
        +     * 
        + * + * .google.showcase.v1beta1.Room room = 1; + */ + public com.google.showcase.v1beta1.RoomOrBuilder getRoomOrBuilder() { + if (roomBuilder_ != null) { + return roomBuilder_.getMessageOrBuilder(); + } else { + return room_ == null ? com.google.showcase.v1beta1.Room.getDefaultInstance() : room_; + } + } + + /** + * + * + *
        +     * The room to update.
        +     * 
        + * + * .google.showcase.v1beta1.Room room = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.showcase.v1beta1.Room, + com.google.showcase.v1beta1.Room.Builder, + com.google.showcase.v1beta1.RoomOrBuilder> + getRoomFieldBuilder() { + if (roomBuilder_ == null) { + roomBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.showcase.v1beta1.Room, + com.google.showcase.v1beta1.Room.Builder, + com.google.showcase.v1beta1.RoomOrBuilder>( + getRoom(), getParentForChildren(), isClean()); + room_ = null; + } + return roomBuilder_; + } + + private com.google.protobuf.FieldMask updateMask_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder> + updateMaskBuilder_; + + /** + * + * + *
        +     * The field mask to determine which fields are to be updated. If empty, the
        +     * server will assume all fields are to be updated.
        +     * 
        + * + * .google.protobuf.FieldMask update_mask = 2; + * + * @return Whether the updateMask field is set. + */ + public boolean hasUpdateMask() { + return updateMaskBuilder_ != null || updateMask_ != null; + } + + /** + * + * + *
        +     * The field mask to determine which fields are to be updated. If empty, the
        +     * server will assume all fields are to be updated.
        +     * 
        + * + * .google.protobuf.FieldMask update_mask = 2; + * + * @return The updateMask. + */ + public com.google.protobuf.FieldMask getUpdateMask() { + if (updateMaskBuilder_ == null) { + return updateMask_ == null + ? com.google.protobuf.FieldMask.getDefaultInstance() + : updateMask_; + } else { + return updateMaskBuilder_.getMessage(); + } + } + + /** + * + * + *
        +     * The field mask to determine which fields are to be updated. If empty, the
        +     * server will assume all fields are to be updated.
        +     * 
        + * + * .google.protobuf.FieldMask update_mask = 2; + */ + public Builder setUpdateMask(com.google.protobuf.FieldMask value) { + if (updateMaskBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + updateMask_ = value; + onChanged(); + } else { + updateMaskBuilder_.setMessage(value); + } + + return this; + } + + /** + * + * + *
        +     * The field mask to determine which fields are to be updated. If empty, the
        +     * server will assume all fields are to be updated.
        +     * 
        + * + * .google.protobuf.FieldMask update_mask = 2; + */ + public Builder setUpdateMask(com.google.protobuf.FieldMask.Builder builderForValue) { + if (updateMaskBuilder_ == null) { + updateMask_ = builderForValue.build(); + onChanged(); + } else { + updateMaskBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + + /** + * + * + *
        +     * The field mask to determine which fields are to be updated. If empty, the
        +     * server will assume all fields are to be updated.
        +     * 
        + * + * .google.protobuf.FieldMask update_mask = 2; + */ + public Builder mergeUpdateMask(com.google.protobuf.FieldMask value) { + if (updateMaskBuilder_ == null) { + if (updateMask_ != null) { + updateMask_ = + com.google.protobuf.FieldMask.newBuilder(updateMask_).mergeFrom(value).buildPartial(); + } else { + updateMask_ = value; + } + onChanged(); + } else { + updateMaskBuilder_.mergeFrom(value); + } + + return this; + } + + /** + * + * + *
        +     * The field mask to determine which fields are to be updated. If empty, the
        +     * server will assume all fields are to be updated.
        +     * 
        + * + * .google.protobuf.FieldMask update_mask = 2; + */ + public Builder clearUpdateMask() { + if (updateMaskBuilder_ == null) { + updateMask_ = null; + onChanged(); + } else { + updateMask_ = null; + updateMaskBuilder_ = null; + } + + return this; + } + + /** + * + * + *
        +     * The field mask to determine which fields are to be updated. If empty, the
        +     * server will assume all fields are to be updated.
        +     * 
        + * + * .google.protobuf.FieldMask update_mask = 2; + */ + public com.google.protobuf.FieldMask.Builder getUpdateMaskBuilder() { + + onChanged(); + return getUpdateMaskFieldBuilder().getBuilder(); + } + + /** + * + * + *
        +     * The field mask to determine which fields are to be updated. If empty, the
        +     * server will assume all fields are to be updated.
        +     * 
        + * + * .google.protobuf.FieldMask update_mask = 2; + */ + public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { + if (updateMaskBuilder_ != null) { + return updateMaskBuilder_.getMessageOrBuilder(); + } else { + return updateMask_ == null + ? com.google.protobuf.FieldMask.getDefaultInstance() + : updateMask_; + } + } + + /** + * + * + *
        +     * The field mask to determine which fields are to be updated. If empty, the
        +     * server will assume all fields are to be updated.
        +     * 
        + * + * .google.protobuf.FieldMask update_mask = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder> + getUpdateMaskFieldBuilder() { + if (updateMaskBuilder_ == null) { + updateMaskBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder>( + getUpdateMask(), getParentForChildren(), isClean()); + updateMask_ = null; + } + return updateMaskBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.showcase.v1beta1.UpdateRoomRequest) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.UpdateRoomRequest) + private static final com.google.showcase.v1beta1.UpdateRoomRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.UpdateRoomRequest(); + } + + public static com.google.showcase.v1beta1.UpdateRoomRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public UpdateRoomRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new UpdateRoomRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.showcase.v1beta1.UpdateRoomRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/UpdateRoomRequestOrBuilder.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/UpdateRoomRequestOrBuilder.java new file mode 100644 index 0000000000..8b24d08224 --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/UpdateRoomRequestOrBuilder.java @@ -0,0 +1,102 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/messaging.proto + +package com.google.showcase.v1beta1; + +public interface UpdateRoomRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.UpdateRoomRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
        +   * The room to update.
        +   * 
        + * + * .google.showcase.v1beta1.Room room = 1; + * + * @return Whether the room field is set. + */ + boolean hasRoom(); + + /** + * + * + *
        +   * The room to update.
        +   * 
        + * + * .google.showcase.v1beta1.Room room = 1; + * + * @return The room. + */ + com.google.showcase.v1beta1.Room getRoom(); + + /** + * + * + *
        +   * The room to update.
        +   * 
        + * + * .google.showcase.v1beta1.Room room = 1; + */ + com.google.showcase.v1beta1.RoomOrBuilder getRoomOrBuilder(); + + /** + * + * + *
        +   * The field mask to determine which fields are to be updated. If empty, the
        +   * server will assume all fields are to be updated.
        +   * 
        + * + * .google.protobuf.FieldMask update_mask = 2; + * + * @return Whether the updateMask field is set. + */ + boolean hasUpdateMask(); + + /** + * + * + *
        +   * The field mask to determine which fields are to be updated. If empty, the
        +   * server will assume all fields are to be updated.
        +   * 
        + * + * .google.protobuf.FieldMask update_mask = 2; + * + * @return The updateMask. + */ + com.google.protobuf.FieldMask getUpdateMask(); + + /** + * + * + *
        +   * The field mask to determine which fields are to be updated. If empty, the
        +   * server will assume all fields are to be updated.
        +   * 
        + * + * .google.protobuf.FieldMask update_mask = 2; + */ + com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder(); +} diff --git a/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/UpdateUserRequest.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/UpdateUserRequest.java new file mode 100644 index 0000000000..05cd45fc20 --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/UpdateUserRequest.java @@ -0,0 +1,1036 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/identity.proto + +package com.google.showcase.v1beta1; + +/** + * + * + *
        + * The request message for the google.showcase.v1beta1.Identity\UpdateUser
        + * method.
        + * 
        + * + * Protobuf type {@code google.showcase.v1beta1.UpdateUserRequest} + */ +public final class UpdateUserRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.UpdateUserRequest) + UpdateUserRequestOrBuilder { + private static final long serialVersionUID = 0L; + + // Use UpdateUserRequest.newBuilder() to construct. + private UpdateUserRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private UpdateUserRequest() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new UpdateUserRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private UpdateUserRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + com.google.showcase.v1beta1.User.Builder subBuilder = null; + if (user_ != null) { + subBuilder = user_.toBuilder(); + } + user_ = + input.readMessage(com.google.showcase.v1beta1.User.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(user_); + user_ = subBuilder.buildPartial(); + } + + break; + } + case 18: + { + com.google.protobuf.FieldMask.Builder subBuilder = null; + if (updateMask_ != null) { + subBuilder = updateMask_.toBuilder(); + } + updateMask_ = + input.readMessage(com.google.protobuf.FieldMask.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(updateMask_); + updateMask_ = subBuilder.buildPartial(); + } + + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.IdentityOuterClass + .internal_static_google_showcase_v1beta1_UpdateUserRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.IdentityOuterClass + .internal_static_google_showcase_v1beta1_UpdateUserRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.UpdateUserRequest.class, + com.google.showcase.v1beta1.UpdateUserRequest.Builder.class); + } + + public static final int USER_FIELD_NUMBER = 1; + private com.google.showcase.v1beta1.User user_; + + /** + * + * + *
        +   * The user to update.
        +   * 
        + * + * .google.showcase.v1beta1.User user = 1; + * + * @return Whether the user field is set. + */ + @java.lang.Override + public boolean hasUser() { + return user_ != null; + } + + /** + * + * + *
        +   * The user to update.
        +   * 
        + * + * .google.showcase.v1beta1.User user = 1; + * + * @return The user. + */ + @java.lang.Override + public com.google.showcase.v1beta1.User getUser() { + return user_ == null ? com.google.showcase.v1beta1.User.getDefaultInstance() : user_; + } + + /** + * + * + *
        +   * The user to update.
        +   * 
        + * + * .google.showcase.v1beta1.User user = 1; + */ + @java.lang.Override + public com.google.showcase.v1beta1.UserOrBuilder getUserOrBuilder() { + return getUser(); + } + + public static final int UPDATE_MASK_FIELD_NUMBER = 2; + private com.google.protobuf.FieldMask updateMask_; + + /** + * + * + *
        +   * The field mask to determine which fields are to be updated. If empty, the
        +   * server will assume all fields are to be updated.
        +   * 
        + * + * .google.protobuf.FieldMask update_mask = 2; + * + * @return Whether the updateMask field is set. + */ + @java.lang.Override + public boolean hasUpdateMask() { + return updateMask_ != null; + } + + /** + * + * + *
        +   * The field mask to determine which fields are to be updated. If empty, the
        +   * server will assume all fields are to be updated.
        +   * 
        + * + * .google.protobuf.FieldMask update_mask = 2; + * + * @return The updateMask. + */ + @java.lang.Override + public com.google.protobuf.FieldMask getUpdateMask() { + return updateMask_ == null ? com.google.protobuf.FieldMask.getDefaultInstance() : updateMask_; + } + + /** + * + * + *
        +   * The field mask to determine which fields are to be updated. If empty, the
        +   * server will assume all fields are to be updated.
        +   * 
        + * + * .google.protobuf.FieldMask update_mask = 2; + */ + @java.lang.Override + public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { + return getUpdateMask(); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (user_ != null) { + output.writeMessage(1, getUser()); + } + if (updateMask_ != null) { + output.writeMessage(2, getUpdateMask()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (user_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getUser()); + } + if (updateMask_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getUpdateMask()); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.showcase.v1beta1.UpdateUserRequest)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.UpdateUserRequest other = + (com.google.showcase.v1beta1.UpdateUserRequest) obj; + + if (hasUser() != other.hasUser()) return false; + if (hasUser()) { + if (!getUser().equals(other.getUser())) return false; + } + if (hasUpdateMask() != other.hasUpdateMask()) return false; + if (hasUpdateMask()) { + if (!getUpdateMask().equals(other.getUpdateMask())) return false; + } + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasUser()) { + hash = (37 * hash) + USER_FIELD_NUMBER; + hash = (53 * hash) + getUser().hashCode(); + } + if (hasUpdateMask()) { + hash = (37 * hash) + UPDATE_MASK_FIELD_NUMBER; + hash = (53 * hash) + getUpdateMask().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.showcase.v1beta1.UpdateUserRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.UpdateUserRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.UpdateUserRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.UpdateUserRequest 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.showcase.v1beta1.UpdateUserRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.UpdateUserRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.UpdateUserRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.UpdateUserRequest 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.showcase.v1beta1.UpdateUserRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.UpdateUserRequest 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.showcase.v1beta1.UpdateUserRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.UpdateUserRequest 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.showcase.v1beta1.UpdateUserRequest 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 request message for the google.showcase.v1beta1.Identity\UpdateUser
        +   * method.
        +   * 
        + * + * Protobuf type {@code google.showcase.v1beta1.UpdateUserRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.UpdateUserRequest) + com.google.showcase.v1beta1.UpdateUserRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.IdentityOuterClass + .internal_static_google_showcase_v1beta1_UpdateUserRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.IdentityOuterClass + .internal_static_google_showcase_v1beta1_UpdateUserRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.UpdateUserRequest.class, + com.google.showcase.v1beta1.UpdateUserRequest.Builder.class); + } + + // Construct using com.google.showcase.v1beta1.UpdateUserRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (userBuilder_ == null) { + user_ = null; + } else { + user_ = null; + userBuilder_ = null; + } + if (updateMaskBuilder_ == null) { + updateMask_ = null; + } else { + updateMask_ = null; + updateMaskBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.showcase.v1beta1.IdentityOuterClass + .internal_static_google_showcase_v1beta1_UpdateUserRequest_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.UpdateUserRequest getDefaultInstanceForType() { + return com.google.showcase.v1beta1.UpdateUserRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.UpdateUserRequest build() { + com.google.showcase.v1beta1.UpdateUserRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.UpdateUserRequest buildPartial() { + com.google.showcase.v1beta1.UpdateUserRequest result = + new com.google.showcase.v1beta1.UpdateUserRequest(this); + if (userBuilder_ == null) { + result.user_ = user_; + } else { + result.user_ = userBuilder_.build(); + } + if (updateMaskBuilder_ == null) { + result.updateMask_ = updateMask_; + } else { + result.updateMask_ = updateMaskBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.showcase.v1beta1.UpdateUserRequest) { + return mergeFrom((com.google.showcase.v1beta1.UpdateUserRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.showcase.v1beta1.UpdateUserRequest other) { + if (other == com.google.showcase.v1beta1.UpdateUserRequest.getDefaultInstance()) return this; + if (other.hasUser()) { + mergeUser(other.getUser()); + } + if (other.hasUpdateMask()) { + mergeUpdateMask(other.getUpdateMask()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.showcase.v1beta1.UpdateUserRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.showcase.v1beta1.UpdateUserRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private com.google.showcase.v1beta1.User user_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.showcase.v1beta1.User, + com.google.showcase.v1beta1.User.Builder, + com.google.showcase.v1beta1.UserOrBuilder> + userBuilder_; + + /** + * + * + *
        +     * The user to update.
        +     * 
        + * + * .google.showcase.v1beta1.User user = 1; + * + * @return Whether the user field is set. + */ + public boolean hasUser() { + return userBuilder_ != null || user_ != null; + } + + /** + * + * + *
        +     * The user to update.
        +     * 
        + * + * .google.showcase.v1beta1.User user = 1; + * + * @return The user. + */ + public com.google.showcase.v1beta1.User getUser() { + if (userBuilder_ == null) { + return user_ == null ? com.google.showcase.v1beta1.User.getDefaultInstance() : user_; + } else { + return userBuilder_.getMessage(); + } + } + + /** + * + * + *
        +     * The user to update.
        +     * 
        + * + * .google.showcase.v1beta1.User user = 1; + */ + public Builder setUser(com.google.showcase.v1beta1.User value) { + if (userBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + user_ = value; + onChanged(); + } else { + userBuilder_.setMessage(value); + } + + return this; + } + + /** + * + * + *
        +     * The user to update.
        +     * 
        + * + * .google.showcase.v1beta1.User user = 1; + */ + public Builder setUser(com.google.showcase.v1beta1.User.Builder builderForValue) { + if (userBuilder_ == null) { + user_ = builderForValue.build(); + onChanged(); + } else { + userBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + + /** + * + * + *
        +     * The user to update.
        +     * 
        + * + * .google.showcase.v1beta1.User user = 1; + */ + public Builder mergeUser(com.google.showcase.v1beta1.User value) { + if (userBuilder_ == null) { + if (user_ != null) { + user_ = + com.google.showcase.v1beta1.User.newBuilder(user_).mergeFrom(value).buildPartial(); + } else { + user_ = value; + } + onChanged(); + } else { + userBuilder_.mergeFrom(value); + } + + return this; + } + + /** + * + * + *
        +     * The user to update.
        +     * 
        + * + * .google.showcase.v1beta1.User user = 1; + */ + public Builder clearUser() { + if (userBuilder_ == null) { + user_ = null; + onChanged(); + } else { + user_ = null; + userBuilder_ = null; + } + + return this; + } + + /** + * + * + *
        +     * The user to update.
        +     * 
        + * + * .google.showcase.v1beta1.User user = 1; + */ + public com.google.showcase.v1beta1.User.Builder getUserBuilder() { + + onChanged(); + return getUserFieldBuilder().getBuilder(); + } + + /** + * + * + *
        +     * The user to update.
        +     * 
        + * + * .google.showcase.v1beta1.User user = 1; + */ + public com.google.showcase.v1beta1.UserOrBuilder getUserOrBuilder() { + if (userBuilder_ != null) { + return userBuilder_.getMessageOrBuilder(); + } else { + return user_ == null ? com.google.showcase.v1beta1.User.getDefaultInstance() : user_; + } + } + + /** + * + * + *
        +     * The user to update.
        +     * 
        + * + * .google.showcase.v1beta1.User user = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.showcase.v1beta1.User, + com.google.showcase.v1beta1.User.Builder, + com.google.showcase.v1beta1.UserOrBuilder> + getUserFieldBuilder() { + if (userBuilder_ == null) { + userBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.showcase.v1beta1.User, + com.google.showcase.v1beta1.User.Builder, + com.google.showcase.v1beta1.UserOrBuilder>( + getUser(), getParentForChildren(), isClean()); + user_ = null; + } + return userBuilder_; + } + + private com.google.protobuf.FieldMask updateMask_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder> + updateMaskBuilder_; + + /** + * + * + *
        +     * The field mask to determine which fields are to be updated. If empty, the
        +     * server will assume all fields are to be updated.
        +     * 
        + * + * .google.protobuf.FieldMask update_mask = 2; + * + * @return Whether the updateMask field is set. + */ + public boolean hasUpdateMask() { + return updateMaskBuilder_ != null || updateMask_ != null; + } + + /** + * + * + *
        +     * The field mask to determine which fields are to be updated. If empty, the
        +     * server will assume all fields are to be updated.
        +     * 
        + * + * .google.protobuf.FieldMask update_mask = 2; + * + * @return The updateMask. + */ + public com.google.protobuf.FieldMask getUpdateMask() { + if (updateMaskBuilder_ == null) { + return updateMask_ == null + ? com.google.protobuf.FieldMask.getDefaultInstance() + : updateMask_; + } else { + return updateMaskBuilder_.getMessage(); + } + } + + /** + * + * + *
        +     * The field mask to determine which fields are to be updated. If empty, the
        +     * server will assume all fields are to be updated.
        +     * 
        + * + * .google.protobuf.FieldMask update_mask = 2; + */ + public Builder setUpdateMask(com.google.protobuf.FieldMask value) { + if (updateMaskBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + updateMask_ = value; + onChanged(); + } else { + updateMaskBuilder_.setMessage(value); + } + + return this; + } + + /** + * + * + *
        +     * The field mask to determine which fields are to be updated. If empty, the
        +     * server will assume all fields are to be updated.
        +     * 
        + * + * .google.protobuf.FieldMask update_mask = 2; + */ + public Builder setUpdateMask(com.google.protobuf.FieldMask.Builder builderForValue) { + if (updateMaskBuilder_ == null) { + updateMask_ = builderForValue.build(); + onChanged(); + } else { + updateMaskBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + + /** + * + * + *
        +     * The field mask to determine which fields are to be updated. If empty, the
        +     * server will assume all fields are to be updated.
        +     * 
        + * + * .google.protobuf.FieldMask update_mask = 2; + */ + public Builder mergeUpdateMask(com.google.protobuf.FieldMask value) { + if (updateMaskBuilder_ == null) { + if (updateMask_ != null) { + updateMask_ = + com.google.protobuf.FieldMask.newBuilder(updateMask_).mergeFrom(value).buildPartial(); + } else { + updateMask_ = value; + } + onChanged(); + } else { + updateMaskBuilder_.mergeFrom(value); + } + + return this; + } + + /** + * + * + *
        +     * The field mask to determine which fields are to be updated. If empty, the
        +     * server will assume all fields are to be updated.
        +     * 
        + * + * .google.protobuf.FieldMask update_mask = 2; + */ + public Builder clearUpdateMask() { + if (updateMaskBuilder_ == null) { + updateMask_ = null; + onChanged(); + } else { + updateMask_ = null; + updateMaskBuilder_ = null; + } + + return this; + } + + /** + * + * + *
        +     * The field mask to determine which fields are to be updated. If empty, the
        +     * server will assume all fields are to be updated.
        +     * 
        + * + * .google.protobuf.FieldMask update_mask = 2; + */ + public com.google.protobuf.FieldMask.Builder getUpdateMaskBuilder() { + + onChanged(); + return getUpdateMaskFieldBuilder().getBuilder(); + } + + /** + * + * + *
        +     * The field mask to determine which fields are to be updated. If empty, the
        +     * server will assume all fields are to be updated.
        +     * 
        + * + * .google.protobuf.FieldMask update_mask = 2; + */ + public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { + if (updateMaskBuilder_ != null) { + return updateMaskBuilder_.getMessageOrBuilder(); + } else { + return updateMask_ == null + ? com.google.protobuf.FieldMask.getDefaultInstance() + : updateMask_; + } + } + + /** + * + * + *
        +     * The field mask to determine which fields are to be updated. If empty, the
        +     * server will assume all fields are to be updated.
        +     * 
        + * + * .google.protobuf.FieldMask update_mask = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder> + getUpdateMaskFieldBuilder() { + if (updateMaskBuilder_ == null) { + updateMaskBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder>( + getUpdateMask(), getParentForChildren(), isClean()); + updateMask_ = null; + } + return updateMaskBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.showcase.v1beta1.UpdateUserRequest) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.UpdateUserRequest) + private static final com.google.showcase.v1beta1.UpdateUserRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.UpdateUserRequest(); + } + + public static com.google.showcase.v1beta1.UpdateUserRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public UpdateUserRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new UpdateUserRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.showcase.v1beta1.UpdateUserRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/UpdateUserRequestOrBuilder.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/UpdateUserRequestOrBuilder.java new file mode 100644 index 0000000000..18fb3437d8 --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/UpdateUserRequestOrBuilder.java @@ -0,0 +1,102 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/identity.proto + +package com.google.showcase.v1beta1; + +public interface UpdateUserRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.UpdateUserRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
        +   * The user to update.
        +   * 
        + * + * .google.showcase.v1beta1.User user = 1; + * + * @return Whether the user field is set. + */ + boolean hasUser(); + + /** + * + * + *
        +   * The user to update.
        +   * 
        + * + * .google.showcase.v1beta1.User user = 1; + * + * @return The user. + */ + com.google.showcase.v1beta1.User getUser(); + + /** + * + * + *
        +   * The user to update.
        +   * 
        + * + * .google.showcase.v1beta1.User user = 1; + */ + com.google.showcase.v1beta1.UserOrBuilder getUserOrBuilder(); + + /** + * + * + *
        +   * The field mask to determine which fields are to be updated. If empty, the
        +   * server will assume all fields are to be updated.
        +   * 
        + * + * .google.protobuf.FieldMask update_mask = 2; + * + * @return Whether the updateMask field is set. + */ + boolean hasUpdateMask(); + + /** + * + * + *
        +   * The field mask to determine which fields are to be updated. If empty, the
        +   * server will assume all fields are to be updated.
        +   * 
        + * + * .google.protobuf.FieldMask update_mask = 2; + * + * @return The updateMask. + */ + com.google.protobuf.FieldMask getUpdateMask(); + + /** + * + * + *
        +   * The field mask to determine which fields are to be updated. If empty, the
        +   * server will assume all fields are to be updated.
        +   * 
        + * + * .google.protobuf.FieldMask update_mask = 2; + */ + com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder(); +} diff --git a/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/User.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/User.java new file mode 100644 index 0000000000..4f7a5cbde7 --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/User.java @@ -0,0 +1,2295 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/identity.proto + +package com.google.showcase.v1beta1; + +/** + * + * + *
        + * A user.
        + * 
        + * + * Protobuf type {@code google.showcase.v1beta1.User} + */ +public final class User extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.User) + UserOrBuilder { + private static final long serialVersionUID = 0L; + + // Use User.newBuilder() to construct. + private User(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private User() { + name_ = ""; + displayName_ = ""; + email_ = ""; + nickname_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new User(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private User( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + displayName_ = s; + break; + } + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + + email_ = s; + break; + } + case 34: + { + com.google.protobuf.Timestamp.Builder subBuilder = null; + if (createTime_ != null) { + subBuilder = createTime_.toBuilder(); + } + createTime_ = + input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(createTime_); + createTime_ = subBuilder.buildPartial(); + } + + break; + } + case 42: + { + com.google.protobuf.Timestamp.Builder subBuilder = null; + if (updateTime_ != null) { + subBuilder = updateTime_.toBuilder(); + } + updateTime_ = + input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(updateTime_); + updateTime_ = subBuilder.buildPartial(); + } + + break; + } + case 48: + { + bitField0_ |= 0x00000001; + age_ = input.readInt32(); + break; + } + case 57: + { + bitField0_ |= 0x00000002; + heightFeet_ = input.readDouble(); + break; + } + case 66: + { + java.lang.String s = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + nickname_ = s; + break; + } + case 72: + { + bitField0_ |= 0x00000008; + enableNotifications_ = input.readBool(); + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.IdentityOuterClass + .internal_static_google_showcase_v1beta1_User_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.IdentityOuterClass + .internal_static_google_showcase_v1beta1_User_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.User.class, com.google.showcase.v1beta1.User.Builder.class); + } + + private int bitField0_; + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + + /** + * + * + *
        +   * The resource name of the user.
        +   * 
        + * + * 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 user.
        +   * 
        + * + * 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 DISPLAY_NAME_FIELD_NUMBER = 2; + private volatile java.lang.Object displayName_; + + /** + * + * + *
        +   * The display_name of the user.
        +   * 
        + * + * string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The displayName. + */ + @java.lang.Override + public java.lang.String getDisplayName() { + java.lang.Object ref = displayName_; + 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(); + displayName_ = s; + return s; + } + } + + /** + * + * + *
        +   * The display_name of the user.
        +   * 
        + * + * string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for displayName. + */ + @java.lang.Override + public com.google.protobuf.ByteString getDisplayNameBytes() { + java.lang.Object ref = displayName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + displayName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int EMAIL_FIELD_NUMBER = 3; + private volatile java.lang.Object email_; + + /** + * + * + *
        +   * The email address of the user.
        +   * 
        + * + * string email = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The email. + */ + @java.lang.Override + public java.lang.String getEmail() { + java.lang.Object ref = email_; + 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(); + email_ = s; + return s; + } + } + + /** + * + * + *
        +   * The email address of the user.
        +   * 
        + * + * string email = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for email. + */ + @java.lang.Override + public com.google.protobuf.ByteString getEmailBytes() { + java.lang.Object ref = email_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + email_ = 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_; + + /** + * + * + *
        +   * The timestamp at which the user was created.
        +   * 
        + * + * .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 createTime_ != null; + } + + /** + * + * + *
        +   * The timestamp at which the user was created.
        +   * 
        + * + * .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_; + } + + /** + * + * + *
        +   * The timestamp at which the user was created.
        +   * 
        + * + * .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { + return getCreateTime(); + } + + public static final int UPDATE_TIME_FIELD_NUMBER = 5; + private com.google.protobuf.Timestamp updateTime_; + + /** + * + * + *
        +   * The latest timestamp at which the user was updated.
        +   * 
        + * + * .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the updateTime field is set. + */ + @java.lang.Override + public boolean hasUpdateTime() { + return updateTime_ != null; + } + + /** + * + * + *
        +   * The latest timestamp at which the user was updated.
        +   * 
        + * + * .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The updateTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getUpdateTime() { + return updateTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : updateTime_; + } + + /** + * + * + *
        +   * The latest timestamp at which the user was updated.
        +   * 
        + * + * .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder() { + return getUpdateTime(); + } + + public static final int AGE_FIELD_NUMBER = 6; + private int age_; + + /** + * + * + *
        +   * The age of the user in years.
        +   * 
        + * + * optional int32 age = 6; + * + * @return Whether the age field is set. + */ + @java.lang.Override + public boolean hasAge() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
        +   * The age of the user in years.
        +   * 
        + * + * optional int32 age = 6; + * + * @return The age. + */ + @java.lang.Override + public int getAge() { + return age_; + } + + public static final int HEIGHT_FEET_FIELD_NUMBER = 7; + private double heightFeet_; + + /** + * + * + *
        +   * The height of the user in feet.
        +   * 
        + * + * optional double height_feet = 7; + * + * @return Whether the heightFeet field is set. + */ + @java.lang.Override + public boolean hasHeightFeet() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
        +   * The height of the user in feet.
        +   * 
        + * + * optional double height_feet = 7; + * + * @return The heightFeet. + */ + @java.lang.Override + public double getHeightFeet() { + return heightFeet_; + } + + public static final int NICKNAME_FIELD_NUMBER = 8; + private volatile java.lang.Object nickname_; + + /** + * + * + *
        +   * The nickname of the user.
        +   * (-- aip.dev/not-precedent: An empty string is a valid nickname.
        +   *     Ordinarily, proto3_optional should not be used on a `string` field. --)
        +   * 
        + * + * optional string nickname = 8; + * + * @return Whether the nickname field is set. + */ + @java.lang.Override + public boolean hasNickname() { + return ((bitField0_ & 0x00000004) != 0); + } + + /** + * + * + *
        +   * The nickname of the user.
        +   * (-- aip.dev/not-precedent: An empty string is a valid nickname.
        +   *     Ordinarily, proto3_optional should not be used on a `string` field. --)
        +   * 
        + * + * optional string nickname = 8; + * + * @return The nickname. + */ + @java.lang.Override + public java.lang.String getNickname() { + java.lang.Object ref = nickname_; + 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(); + nickname_ = s; + return s; + } + } + + /** + * + * + *
        +   * The nickname of the user.
        +   * (-- aip.dev/not-precedent: An empty string is a valid nickname.
        +   *     Ordinarily, proto3_optional should not be used on a `string` field. --)
        +   * 
        + * + * optional string nickname = 8; + * + * @return The bytes for nickname. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNicknameBytes() { + java.lang.Object ref = nickname_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + nickname_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int ENABLE_NOTIFICATIONS_FIELD_NUMBER = 9; + private boolean enableNotifications_; + + /** + * + * + *
        +   * Enables the receiving of notifications. The default is true if unset.
        +   * (-- aip.dev/not-precedent: The default for the feature is true.
        +   *     Ordinarily, the default for a `bool` field should be false. --)
        +   * 
        + * + * optional bool enable_notifications = 9; + * + * @return Whether the enableNotifications field is set. + */ + @java.lang.Override + public boolean hasEnableNotifications() { + return ((bitField0_ & 0x00000008) != 0); + } + + /** + * + * + *
        +   * Enables the receiving of notifications. The default is true if unset.
        +   * (-- aip.dev/not-precedent: The default for the feature is true.
        +   *     Ordinarily, the default for a `bool` field should be false. --)
        +   * 
        + * + * optional bool enable_notifications = 9; + * + * @return The enableNotifications. + */ + @java.lang.Override + public boolean getEnableNotifications() { + return enableNotifications_; + } + + 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(displayName_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, displayName_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(email_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, email_); + } + if (createTime_ != null) { + output.writeMessage(4, getCreateTime()); + } + if (updateTime_ != null) { + output.writeMessage(5, getUpdateTime()); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeInt32(6, age_); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeDouble(7, heightFeet_); + } + if (((bitField0_ & 0x00000004) != 0)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 8, nickname_); + } + if (((bitField0_ & 0x00000008) != 0)) { + output.writeBool(9, enableNotifications_); + } + unknownFields.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(displayName_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, displayName_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(email_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, email_); + } + if (createTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, getCreateTime()); + } + if (updateTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(5, getUpdateTime()); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(6, age_); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeDoubleSize(7, heightFeet_); + } + if (((bitField0_ & 0x00000004) != 0)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(8, nickname_); + } + if (((bitField0_ & 0x00000008) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(9, enableNotifications_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.showcase.v1beta1.User)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.User other = (com.google.showcase.v1beta1.User) obj; + + if (!getName().equals(other.getName())) return false; + if (!getDisplayName().equals(other.getDisplayName())) return false; + if (!getEmail().equals(other.getEmail())) 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 (hasAge() != other.hasAge()) return false; + if (hasAge()) { + if (getAge() != other.getAge()) return false; + } + if (hasHeightFeet() != other.hasHeightFeet()) return false; + if (hasHeightFeet()) { + if (java.lang.Double.doubleToLongBits(getHeightFeet()) + != java.lang.Double.doubleToLongBits(other.getHeightFeet())) return false; + } + if (hasNickname() != other.hasNickname()) return false; + if (hasNickname()) { + if (!getNickname().equals(other.getNickname())) return false; + } + if (hasEnableNotifications() != other.hasEnableNotifications()) return false; + if (hasEnableNotifications()) { + if (getEnableNotifications() != other.getEnableNotifications()) return false; + } + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (37 * hash) + DISPLAY_NAME_FIELD_NUMBER; + hash = (53 * hash) + getDisplayName().hashCode(); + hash = (37 * hash) + EMAIL_FIELD_NUMBER; + hash = (53 * hash) + getEmail().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(); + } + if (hasAge()) { + hash = (37 * hash) + AGE_FIELD_NUMBER; + hash = (53 * hash) + getAge(); + } + if (hasHeightFeet()) { + hash = (37 * hash) + HEIGHT_FEET_FIELD_NUMBER; + hash = + (53 * hash) + + com.google.protobuf.Internal.hashLong( + java.lang.Double.doubleToLongBits(getHeightFeet())); + } + if (hasNickname()) { + hash = (37 * hash) + NICKNAME_FIELD_NUMBER; + hash = (53 * hash) + getNickname().hashCode(); + } + if (hasEnableNotifications()) { + hash = (37 * hash) + ENABLE_NOTIFICATIONS_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getEnableNotifications()); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.showcase.v1beta1.User parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.User parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.User parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.User 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.showcase.v1beta1.User parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.User parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.User parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.User 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.showcase.v1beta1.User parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.User 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.showcase.v1beta1.User parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.User 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.showcase.v1beta1.User prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
        +   * A user.
        +   * 
        + * + * Protobuf type {@code google.showcase.v1beta1.User} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.User) + com.google.showcase.v1beta1.UserOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.IdentityOuterClass + .internal_static_google_showcase_v1beta1_User_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.IdentityOuterClass + .internal_static_google_showcase_v1beta1_User_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.User.class, + com.google.showcase.v1beta1.User.Builder.class); + } + + // Construct using com.google.showcase.v1beta1.User.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + displayName_ = ""; + + email_ = ""; + + if (createTimeBuilder_ == null) { + createTime_ = null; + } else { + createTime_ = null; + createTimeBuilder_ = null; + } + if (updateTimeBuilder_ == null) { + updateTime_ = null; + } else { + updateTime_ = null; + updateTimeBuilder_ = null; + } + age_ = 0; + bitField0_ = (bitField0_ & ~0x00000001); + heightFeet_ = 0D; + bitField0_ = (bitField0_ & ~0x00000002); + nickname_ = ""; + bitField0_ = (bitField0_ & ~0x00000004); + enableNotifications_ = false; + bitField0_ = (bitField0_ & ~0x00000008); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.showcase.v1beta1.IdentityOuterClass + .internal_static_google_showcase_v1beta1_User_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.User getDefaultInstanceForType() { + return com.google.showcase.v1beta1.User.getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.User build() { + com.google.showcase.v1beta1.User result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.User buildPartial() { + com.google.showcase.v1beta1.User result = new com.google.showcase.v1beta1.User(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + result.name_ = name_; + result.displayName_ = displayName_; + result.email_ = email_; + if (createTimeBuilder_ == null) { + result.createTime_ = createTime_; + } else { + result.createTime_ = createTimeBuilder_.build(); + } + if (updateTimeBuilder_ == null) { + result.updateTime_ = updateTime_; + } else { + result.updateTime_ = updateTimeBuilder_.build(); + } + if (((from_bitField0_ & 0x00000001) != 0)) { + result.age_ = age_; + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.heightFeet_ = heightFeet_; + to_bitField0_ |= 0x00000002; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + to_bitField0_ |= 0x00000004; + } + result.nickname_ = nickname_; + if (((from_bitField0_ & 0x00000008) != 0)) { + result.enableNotifications_ = enableNotifications_; + to_bitField0_ |= 0x00000008; + } + result.bitField0_ = to_bitField0_; + 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.showcase.v1beta1.User) { + return mergeFrom((com.google.showcase.v1beta1.User) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.showcase.v1beta1.User other) { + if (other == com.google.showcase.v1beta1.User.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + if (!other.getDisplayName().isEmpty()) { + displayName_ = other.displayName_; + onChanged(); + } + if (!other.getEmail().isEmpty()) { + email_ = other.email_; + onChanged(); + } + if (other.hasCreateTime()) { + mergeCreateTime(other.getCreateTime()); + } + if (other.hasUpdateTime()) { + mergeUpdateTime(other.getUpdateTime()); + } + if (other.hasAge()) { + setAge(other.getAge()); + } + if (other.hasHeightFeet()) { + setHeightFeet(other.getHeightFeet()); + } + if (other.hasNickname()) { + bitField0_ |= 0x00000004; + nickname_ = other.nickname_; + onChanged(); + } + if (other.hasEnableNotifications()) { + setEnableNotifications(other.getEnableNotifications()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.showcase.v1beta1.User parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.showcase.v1beta1.User) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + + /** + * + * + *
        +     * The resource name of the user.
        +     * 
        + * + * 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 user.
        +     * 
        + * + * 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 user.
        +     * 
        + * + * string name = 1; + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + + /** + * + * + *
        +     * The resource name of the user.
        +     * 
        + * + * string name = 1; + * + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + + /** + * + * + *
        +     * The resource name of the user.
        +     * 
        + * + * string name = 1; + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + + private java.lang.Object displayName_ = ""; + + /** + * + * + *
        +     * The display_name of the user.
        +     * 
        + * + * string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The displayName. + */ + public java.lang.String getDisplayName() { + java.lang.Object ref = displayName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + displayName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
        +     * The display_name of the user.
        +     * 
        + * + * string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for displayName. + */ + public com.google.protobuf.ByteString getDisplayNameBytes() { + java.lang.Object ref = displayName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + displayName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
        +     * The display_name of the user.
        +     * 
        + * + * string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The displayName to set. + * @return This builder for chaining. + */ + public Builder setDisplayName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + displayName_ = value; + onChanged(); + return this; + } + + /** + * + * + *
        +     * The display_name of the user.
        +     * 
        + * + * string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearDisplayName() { + + displayName_ = getDefaultInstance().getDisplayName(); + onChanged(); + return this; + } + + /** + * + * + *
        +     * The display_name of the user.
        +     * 
        + * + * string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for displayName to set. + * @return This builder for chaining. + */ + public Builder setDisplayNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + displayName_ = value; + onChanged(); + return this; + } + + private java.lang.Object email_ = ""; + + /** + * + * + *
        +     * The email address of the user.
        +     * 
        + * + * string email = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The email. + */ + public java.lang.String getEmail() { + java.lang.Object ref = email_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + email_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
        +     * The email address of the user.
        +     * 
        + * + * string email = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for email. + */ + public com.google.protobuf.ByteString getEmailBytes() { + java.lang.Object ref = email_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + email_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
        +     * The email address of the user.
        +     * 
        + * + * string email = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The email to set. + * @return This builder for chaining. + */ + public Builder setEmail(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + email_ = value; + onChanged(); + return this; + } + + /** + * + * + *
        +     * The email address of the user.
        +     * 
        + * + * string email = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearEmail() { + + email_ = getDefaultInstance().getEmail(); + onChanged(); + return this; + } + + /** + * + * + *
        +     * The email address of the user.
        +     * 
        + * + * string email = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for email to set. + * @return This builder for chaining. + */ + public Builder setEmailBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + email_ = value; + onChanged(); + return this; + } + + private com.google.protobuf.Timestamp createTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + createTimeBuilder_; + + /** + * + * + *
        +     * The timestamp at which the user was created.
        +     * 
        + * + * + * .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the createTime field is set. + */ + public boolean hasCreateTime() { + return createTimeBuilder_ != null || createTime_ != null; + } + + /** + * + * + *
        +     * The timestamp at which the user was created.
        +     * 
        + * + * + * .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(); + } + } + + /** + * + * + *
        +     * The timestamp at which the user was created.
        +     * 
        + * + * + * .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; + onChanged(); + } else { + createTimeBuilder_.setMessage(value); + } + + return this; + } + + /** + * + * + *
        +     * The timestamp at which the user was created.
        +     * 
        + * + * + * .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(); + onChanged(); + } else { + createTimeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + + /** + * + * + *
        +     * The timestamp at which the user was created.
        +     * 
        + * + * + * .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeCreateTime(com.google.protobuf.Timestamp value) { + if (createTimeBuilder_ == null) { + if (createTime_ != null) { + createTime_ = + com.google.protobuf.Timestamp.newBuilder(createTime_).mergeFrom(value).buildPartial(); + } else { + createTime_ = value; + } + onChanged(); + } else { + createTimeBuilder_.mergeFrom(value); + } + + return this; + } + + /** + * + * + *
        +     * The timestamp at which the user was created.
        +     * 
        + * + * + * .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearCreateTime() { + if (createTimeBuilder_ == null) { + createTime_ = null; + onChanged(); + } else { + createTime_ = null; + createTimeBuilder_ = null; + } + + return this; + } + + /** + * + * + *
        +     * The timestamp at which the user was created.
        +     * 
        + * + * + * .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.Timestamp.Builder getCreateTimeBuilder() { + + onChanged(); + return getCreateTimeFieldBuilder().getBuilder(); + } + + /** + * + * + *
        +     * The timestamp at which the user was created.
        +     * 
        + * + * + * .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_; + } + } + + /** + * + * + *
        +     * The timestamp at which the user was created.
        +     * 
        + * + * + * .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_; + + /** + * + * + *
        +     * The latest timestamp at which the user was updated.
        +     * 
        + * + * + * .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the updateTime field is set. + */ + public boolean hasUpdateTime() { + return updateTimeBuilder_ != null || updateTime_ != null; + } + + /** + * + * + *
        +     * The latest timestamp at which the user was updated.
        +     * 
        + * + * + * .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The updateTime. + */ + public com.google.protobuf.Timestamp getUpdateTime() { + if (updateTimeBuilder_ == null) { + return updateTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : updateTime_; + } else { + return updateTimeBuilder_.getMessage(); + } + } + + /** + * + * + *
        +     * The latest timestamp at which the user was updated.
        +     * 
        + * + * + * .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setUpdateTime(com.google.protobuf.Timestamp value) { + if (updateTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + updateTime_ = value; + onChanged(); + } else { + updateTimeBuilder_.setMessage(value); + } + + return this; + } + + /** + * + * + *
        +     * The latest timestamp at which the user was updated.
        +     * 
        + * + * + * .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setUpdateTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (updateTimeBuilder_ == null) { + updateTime_ = builderForValue.build(); + onChanged(); + } else { + updateTimeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + + /** + * + * + *
        +     * The latest timestamp at which the user was updated.
        +     * 
        + * + * + * .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeUpdateTime(com.google.protobuf.Timestamp value) { + if (updateTimeBuilder_ == null) { + if (updateTime_ != null) { + updateTime_ = + com.google.protobuf.Timestamp.newBuilder(updateTime_).mergeFrom(value).buildPartial(); + } else { + updateTime_ = value; + } + onChanged(); + } else { + updateTimeBuilder_.mergeFrom(value); + } + + return this; + } + + /** + * + * + *
        +     * The latest timestamp at which the user was updated.
        +     * 
        + * + * + * .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearUpdateTime() { + if (updateTimeBuilder_ == null) { + updateTime_ = null; + onChanged(); + } else { + updateTime_ = null; + updateTimeBuilder_ = null; + } + + return this; + } + + /** + * + * + *
        +     * The latest timestamp at which the user was updated.
        +     * 
        + * + * + * .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.Timestamp.Builder getUpdateTimeBuilder() { + + onChanged(); + return getUpdateTimeFieldBuilder().getBuilder(); + } + + /** + * + * + *
        +     * The latest timestamp at which the user was updated.
        +     * 
        + * + * + * .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder() { + if (updateTimeBuilder_ != null) { + return updateTimeBuilder_.getMessageOrBuilder(); + } else { + return updateTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : updateTime_; + } + } + + /** + * + * + *
        +     * The latest timestamp at which the user was updated.
        +     * 
        + * + * + * .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getUpdateTimeFieldBuilder() { + if (updateTimeBuilder_ == null) { + updateTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getUpdateTime(), getParentForChildren(), isClean()); + updateTime_ = null; + } + return updateTimeBuilder_; + } + + private int age_; + + /** + * + * + *
        +     * The age of the user in years.
        +     * 
        + * + * optional int32 age = 6; + * + * @return Whether the age field is set. + */ + @java.lang.Override + public boolean hasAge() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
        +     * The age of the user in years.
        +     * 
        + * + * optional int32 age = 6; + * + * @return The age. + */ + @java.lang.Override + public int getAge() { + return age_; + } + + /** + * + * + *
        +     * The age of the user in years.
        +     * 
        + * + * optional int32 age = 6; + * + * @param value The age to set. + * @return This builder for chaining. + */ + public Builder setAge(int value) { + bitField0_ |= 0x00000001; + age_ = value; + onChanged(); + return this; + } + + /** + * + * + *
        +     * The age of the user in years.
        +     * 
        + * + * optional int32 age = 6; + * + * @return This builder for chaining. + */ + public Builder clearAge() { + bitField0_ = (bitField0_ & ~0x00000001); + age_ = 0; + onChanged(); + return this; + } + + private double heightFeet_; + + /** + * + * + *
        +     * The height of the user in feet.
        +     * 
        + * + * optional double height_feet = 7; + * + * @return Whether the heightFeet field is set. + */ + @java.lang.Override + public boolean hasHeightFeet() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
        +     * The height of the user in feet.
        +     * 
        + * + * optional double height_feet = 7; + * + * @return The heightFeet. + */ + @java.lang.Override + public double getHeightFeet() { + return heightFeet_; + } + + /** + * + * + *
        +     * The height of the user in feet.
        +     * 
        + * + * optional double height_feet = 7; + * + * @param value The heightFeet to set. + * @return This builder for chaining. + */ + public Builder setHeightFeet(double value) { + bitField0_ |= 0x00000002; + heightFeet_ = value; + onChanged(); + return this; + } + + /** + * + * + *
        +     * The height of the user in feet.
        +     * 
        + * + * optional double height_feet = 7; + * + * @return This builder for chaining. + */ + public Builder clearHeightFeet() { + bitField0_ = (bitField0_ & ~0x00000002); + heightFeet_ = 0D; + onChanged(); + return this; + } + + private java.lang.Object nickname_ = ""; + + /** + * + * + *
        +     * The nickname of the user.
        +     * (-- aip.dev/not-precedent: An empty string is a valid nickname.
        +     *     Ordinarily, proto3_optional should not be used on a `string` field. --)
        +     * 
        + * + * optional string nickname = 8; + * + * @return Whether the nickname field is set. + */ + public boolean hasNickname() { + return ((bitField0_ & 0x00000004) != 0); + } + + /** + * + * + *
        +     * The nickname of the user.
        +     * (-- aip.dev/not-precedent: An empty string is a valid nickname.
        +     *     Ordinarily, proto3_optional should not be used on a `string` field. --)
        +     * 
        + * + * optional string nickname = 8; + * + * @return The nickname. + */ + public java.lang.String getNickname() { + java.lang.Object ref = nickname_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nickname_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
        +     * The nickname of the user.
        +     * (-- aip.dev/not-precedent: An empty string is a valid nickname.
        +     *     Ordinarily, proto3_optional should not be used on a `string` field. --)
        +     * 
        + * + * optional string nickname = 8; + * + * @return The bytes for nickname. + */ + public com.google.protobuf.ByteString getNicknameBytes() { + java.lang.Object ref = nickname_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + nickname_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
        +     * The nickname of the user.
        +     * (-- aip.dev/not-precedent: An empty string is a valid nickname.
        +     *     Ordinarily, proto3_optional should not be used on a `string` field. --)
        +     * 
        + * + * optional string nickname = 8; + * + * @param value The nickname to set. + * @return This builder for chaining. + */ + public Builder setNickname(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000004; + nickname_ = value; + onChanged(); + return this; + } + + /** + * + * + *
        +     * The nickname of the user.
        +     * (-- aip.dev/not-precedent: An empty string is a valid nickname.
        +     *     Ordinarily, proto3_optional should not be used on a `string` field. --)
        +     * 
        + * + * optional string nickname = 8; + * + * @return This builder for chaining. + */ + public Builder clearNickname() { + bitField0_ = (bitField0_ & ~0x00000004); + nickname_ = getDefaultInstance().getNickname(); + onChanged(); + return this; + } + + /** + * + * + *
        +     * The nickname of the user.
        +     * (-- aip.dev/not-precedent: An empty string is a valid nickname.
        +     *     Ordinarily, proto3_optional should not be used on a `string` field. --)
        +     * 
        + * + * optional string nickname = 8; + * + * @param value The bytes for nickname to set. + * @return This builder for chaining. + */ + public Builder setNicknameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + bitField0_ |= 0x00000004; + nickname_ = value; + onChanged(); + return this; + } + + private boolean enableNotifications_; + + /** + * + * + *
        +     * Enables the receiving of notifications. The default is true if unset.
        +     * (-- aip.dev/not-precedent: The default for the feature is true.
        +     *     Ordinarily, the default for a `bool` field should be false. --)
        +     * 
        + * + * optional bool enable_notifications = 9; + * + * @return Whether the enableNotifications field is set. + */ + @java.lang.Override + public boolean hasEnableNotifications() { + return ((bitField0_ & 0x00000008) != 0); + } + + /** + * + * + *
        +     * Enables the receiving of notifications. The default is true if unset.
        +     * (-- aip.dev/not-precedent: The default for the feature is true.
        +     *     Ordinarily, the default for a `bool` field should be false. --)
        +     * 
        + * + * optional bool enable_notifications = 9; + * + * @return The enableNotifications. + */ + @java.lang.Override + public boolean getEnableNotifications() { + return enableNotifications_; + } + + /** + * + * + *
        +     * Enables the receiving of notifications. The default is true if unset.
        +     * (-- aip.dev/not-precedent: The default for the feature is true.
        +     *     Ordinarily, the default for a `bool` field should be false. --)
        +     * 
        + * + * optional bool enable_notifications = 9; + * + * @param value The enableNotifications to set. + * @return This builder for chaining. + */ + public Builder setEnableNotifications(boolean value) { + bitField0_ |= 0x00000008; + enableNotifications_ = value; + onChanged(); + return this; + } + + /** + * + * + *
        +     * Enables the receiving of notifications. The default is true if unset.
        +     * (-- aip.dev/not-precedent: The default for the feature is true.
        +     *     Ordinarily, the default for a `bool` field should be false. --)
        +     * 
        + * + * optional bool enable_notifications = 9; + * + * @return This builder for chaining. + */ + public Builder clearEnableNotifications() { + bitField0_ = (bitField0_ & ~0x00000008); + enableNotifications_ = 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.showcase.v1beta1.User) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.User) + private static final com.google.showcase.v1beta1.User DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.User(); + } + + public static com.google.showcase.v1beta1.User getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public User parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new User(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.showcase.v1beta1.User getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/UserName.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/UserName.java new file mode 100644 index 0000000000..0195b1062d --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/UserName.java @@ -0,0 +1,166 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1; + +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +@Generated("by gapic-generator-java") +public class UserName implements ResourceName { + private static final PathTemplate USER = PathTemplate.createWithoutUrlEncoding("users/{user}"); + private volatile Map fieldValuesMap; + private final String user; + + @Deprecated + protected UserName() { + user = null; + } + + private UserName(Builder builder) { + user = Preconditions.checkNotNull(builder.getUser()); + } + + public String getUser() { + return user; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + public static UserName of(String user) { + return newBuilder().setUser(user).build(); + } + + public static String format(String user) { + return newBuilder().setUser(user).build().toString(); + } + + public static UserName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + USER.validatedMatch(formattedString, "UserName.parse: formattedString not in valid format"); + return of(matchMap.get("user")); + } + + 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 (UserName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return USER.matches(formattedString); + } + + @Override + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + if (user != null) { + fieldMapBuilder.put("user", user); + } + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return USER.instantiate("user", user); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o != null && getClass() == o.getClass()) { + UserName that = ((UserName) o); + return Objects.equals(this.user, that.user); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= Objects.hashCode(user); + return h; + } + + /** Builder for users/{user}. */ + public static class Builder { + private String user; + + protected Builder() {} + + public String getUser() { + return user; + } + + public Builder setUser(String user) { + this.user = user; + return this; + } + + private Builder(UserName userName) { + this.user = userName.user; + } + + public UserName build() { + return new UserName(this); + } + } +} diff --git a/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/UserOrBuilder.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/UserOrBuilder.java new file mode 100644 index 0000000000..b3efd40700 --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/UserOrBuilder.java @@ -0,0 +1,310 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/identity.proto + +package com.google.showcase.v1beta1; + +public interface UserOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.User) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
        +   * The resource name of the user.
        +   * 
        + * + * string name = 1; + * + * @return The name. + */ + java.lang.String getName(); + + /** + * + * + *
        +   * The resource name of the user.
        +   * 
        + * + * string name = 1; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
        +   * The display_name of the user.
        +   * 
        + * + * string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The displayName. + */ + java.lang.String getDisplayName(); + + /** + * + * + *
        +   * The display_name of the user.
        +   * 
        + * + * string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for displayName. + */ + com.google.protobuf.ByteString getDisplayNameBytes(); + + /** + * + * + *
        +   * The email address of the user.
        +   * 
        + * + * string email = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The email. + */ + java.lang.String getEmail(); + + /** + * + * + *
        +   * The email address of the user.
        +   * 
        + * + * string email = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for email. + */ + com.google.protobuf.ByteString getEmailBytes(); + + /** + * + * + *
        +   * The timestamp at which the user was created.
        +   * 
        + * + * .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the createTime field is set. + */ + boolean hasCreateTime(); + + /** + * + * + *
        +   * The timestamp at which the user was created.
        +   * 
        + * + * .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The createTime. + */ + com.google.protobuf.Timestamp getCreateTime(); + + /** + * + * + *
        +   * The timestamp at which the user was created.
        +   * 
        + * + * .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder(); + + /** + * + * + *
        +   * The latest timestamp at which the user was updated.
        +   * 
        + * + * .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the updateTime field is set. + */ + boolean hasUpdateTime(); + + /** + * + * + *
        +   * The latest timestamp at which the user was updated.
        +   * 
        + * + * .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The updateTime. + */ + com.google.protobuf.Timestamp getUpdateTime(); + + /** + * + * + *
        +   * The latest timestamp at which the user was updated.
        +   * 
        + * + * .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder(); + + /** + * + * + *
        +   * The age of the user in years.
        +   * 
        + * + * optional int32 age = 6; + * + * @return Whether the age field is set. + */ + boolean hasAge(); + + /** + * + * + *
        +   * The age of the user in years.
        +   * 
        + * + * optional int32 age = 6; + * + * @return The age. + */ + int getAge(); + + /** + * + * + *
        +   * The height of the user in feet.
        +   * 
        + * + * optional double height_feet = 7; + * + * @return Whether the heightFeet field is set. + */ + boolean hasHeightFeet(); + + /** + * + * + *
        +   * The height of the user in feet.
        +   * 
        + * + * optional double height_feet = 7; + * + * @return The heightFeet. + */ + double getHeightFeet(); + + /** + * + * + *
        +   * The nickname of the user.
        +   * (-- aip.dev/not-precedent: An empty string is a valid nickname.
        +   *     Ordinarily, proto3_optional should not be used on a `string` field. --)
        +   * 
        + * + * optional string nickname = 8; + * + * @return Whether the nickname field is set. + */ + boolean hasNickname(); + + /** + * + * + *
        +   * The nickname of the user.
        +   * (-- aip.dev/not-precedent: An empty string is a valid nickname.
        +   *     Ordinarily, proto3_optional should not be used on a `string` field. --)
        +   * 
        + * + * optional string nickname = 8; + * + * @return The nickname. + */ + java.lang.String getNickname(); + + /** + * + * + *
        +   * The nickname of the user.
        +   * (-- aip.dev/not-precedent: An empty string is a valid nickname.
        +   *     Ordinarily, proto3_optional should not be used on a `string` field. --)
        +   * 
        + * + * optional string nickname = 8; + * + * @return The bytes for nickname. + */ + com.google.protobuf.ByteString getNicknameBytes(); + + /** + * + * + *
        +   * Enables the receiving of notifications. The default is true if unset.
        +   * (-- aip.dev/not-precedent: The default for the feature is true.
        +   *     Ordinarily, the default for a `bool` field should be false. --)
        +   * 
        + * + * optional bool enable_notifications = 9; + * + * @return Whether the enableNotifications field is set. + */ + boolean hasEnableNotifications(); + + /** + * + * + *
        +   * Enables the receiving of notifications. The default is true if unset.
        +   * (-- aip.dev/not-precedent: The default for the feature is true.
        +   *     Ordinarily, the default for a `bool` field should be false. --)
        +   * 
        + * + * optional bool enable_notifications = 9; + * + * @return The enableNotifications. + */ + boolean getEnableNotifications(); +} diff --git a/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/VerifyTestRequest.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/VerifyTestRequest.java new file mode 100644 index 0000000000..141314a96b --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/VerifyTestRequest.java @@ -0,0 +1,968 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/testing.proto + +package com.google.showcase.v1beta1; + +/** Protobuf type {@code google.showcase.v1beta1.VerifyTestRequest} */ +public final class VerifyTestRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.VerifyTestRequest) + VerifyTestRequestOrBuilder { + private static final long serialVersionUID = 0L; + + // Use VerifyTestRequest.newBuilder() to construct. + private VerifyTestRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private VerifyTestRequest() { + name_ = ""; + answer_ = com.google.protobuf.ByteString.EMPTY; + answers_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new VerifyTestRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private VerifyTestRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + break; + } + case 18: + { + answer_ = input.readBytes(); + break; + } + case 26: + { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + answers_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + answers_.add(input.readBytes()); + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + answers_ = java.util.Collections.unmodifiableList(answers_); // C + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.TestingOuterClass + .internal_static_google_showcase_v1beta1_VerifyTestRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.TestingOuterClass + .internal_static_google_showcase_v1beta1_VerifyTestRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.VerifyTestRequest.class, + com.google.showcase.v1beta1.VerifyTestRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + + /** + * + * + *
        +   * The test to have an answer registered to it.
        +   * 
        + * + * string name = 1 [(.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; + } + } + + /** + * + * + *
        +   * The test to have an answer registered to it.
        +   * 
        + * + * string name = 1 [(.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 ANSWER_FIELD_NUMBER = 2; + private com.google.protobuf.ByteString answer_; + + /** + * + * + *
        +   * The answer from the test.
        +   * 
        + * + * bytes answer = 2; + * + * @return The answer. + */ + @java.lang.Override + public com.google.protobuf.ByteString getAnswer() { + return answer_; + } + + public static final int ANSWERS_FIELD_NUMBER = 3; + private java.util.List answers_; + + /** + * + * + *
        +   * The answers from the test if multiple are to be checked
        +   * 
        + * + * repeated bytes answers = 3; + * + * @return A list containing the answers. + */ + @java.lang.Override + public java.util.List getAnswersList() { + return answers_; + } + + /** + * + * + *
        +   * The answers from the test if multiple are to be checked
        +   * 
        + * + * repeated bytes answers = 3; + * + * @return The count of answers. + */ + public int getAnswersCount() { + return answers_.size(); + } + + /** + * + * + *
        +   * The answers from the test if multiple are to be checked
        +   * 
        + * + * repeated bytes answers = 3; + * + * @param index The index of the element to return. + * @return The answers at the given index. + */ + public com.google.protobuf.ByteString getAnswers(int index) { + return answers_.get(index); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + if (!answer_.isEmpty()) { + output.writeBytes(2, answer_); + } + for (int i = 0; i < answers_.size(); i++) { + output.writeBytes(3, answers_.get(i)); + } + unknownFields.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 (!answer_.isEmpty()) { + size += com.google.protobuf.CodedOutputStream.computeBytesSize(2, answer_); + } + { + int dataSize = 0; + for (int i = 0; i < answers_.size(); i++) { + dataSize += com.google.protobuf.CodedOutputStream.computeBytesSizeNoTag(answers_.get(i)); + } + size += dataSize; + size += 1 * getAnswersList().size(); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.showcase.v1beta1.VerifyTestRequest)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.VerifyTestRequest other = + (com.google.showcase.v1beta1.VerifyTestRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (!getAnswer().equals(other.getAnswer())) return false; + if (!getAnswersList().equals(other.getAnswersList())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (37 * hash) + ANSWER_FIELD_NUMBER; + hash = (53 * hash) + getAnswer().hashCode(); + if (getAnswersCount() > 0) { + hash = (37 * hash) + ANSWERS_FIELD_NUMBER; + hash = (53 * hash) + getAnswersList().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.showcase.v1beta1.VerifyTestRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.VerifyTestRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.VerifyTestRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.VerifyTestRequest 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.showcase.v1beta1.VerifyTestRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.VerifyTestRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.VerifyTestRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.VerifyTestRequest 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.showcase.v1beta1.VerifyTestRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.VerifyTestRequest 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.showcase.v1beta1.VerifyTestRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.VerifyTestRequest 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.showcase.v1beta1.VerifyTestRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** Protobuf type {@code google.showcase.v1beta1.VerifyTestRequest} */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.VerifyTestRequest) + com.google.showcase.v1beta1.VerifyTestRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.TestingOuterClass + .internal_static_google_showcase_v1beta1_VerifyTestRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.TestingOuterClass + .internal_static_google_showcase_v1beta1_VerifyTestRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.VerifyTestRequest.class, + com.google.showcase.v1beta1.VerifyTestRequest.Builder.class); + } + + // Construct using com.google.showcase.v1beta1.VerifyTestRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + answer_ = com.google.protobuf.ByteString.EMPTY; + + answers_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.showcase.v1beta1.TestingOuterClass + .internal_static_google_showcase_v1beta1_VerifyTestRequest_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.VerifyTestRequest getDefaultInstanceForType() { + return com.google.showcase.v1beta1.VerifyTestRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.VerifyTestRequest build() { + com.google.showcase.v1beta1.VerifyTestRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.VerifyTestRequest buildPartial() { + com.google.showcase.v1beta1.VerifyTestRequest result = + new com.google.showcase.v1beta1.VerifyTestRequest(this); + int from_bitField0_ = bitField0_; + result.name_ = name_; + result.answer_ = answer_; + if (((bitField0_ & 0x00000001) != 0)) { + answers_ = java.util.Collections.unmodifiableList(answers_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.answers_ = answers_; + 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.showcase.v1beta1.VerifyTestRequest) { + return mergeFrom((com.google.showcase.v1beta1.VerifyTestRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.showcase.v1beta1.VerifyTestRequest other) { + if (other == com.google.showcase.v1beta1.VerifyTestRequest.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + if (other.getAnswer() != com.google.protobuf.ByteString.EMPTY) { + setAnswer(other.getAnswer()); + } + if (!other.answers_.isEmpty()) { + if (answers_.isEmpty()) { + answers_ = other.answers_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureAnswersIsMutable(); + answers_.addAll(other.answers_); + } + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.showcase.v1beta1.VerifyTestRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.showcase.v1beta1.VerifyTestRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + + /** + * + * + *
        +     * The test to have an answer registered to it.
        +     * 
        + * + * string name = 1 [(.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; + } + } + + /** + * + * + *
        +     * The test to have an answer registered to it.
        +     * 
        + * + * string name = 1 [(.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; + } + } + + /** + * + * + *
        +     * The test to have an answer registered to it.
        +     * 
        + * + * string name = 1 [(.google.api.resource_reference) = { ... } + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + + /** + * + * + *
        +     * The test to have an answer registered to it.
        +     * 
        + * + * string name = 1 [(.google.api.resource_reference) = { ... } + * + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + + /** + * + * + *
        +     * The test to have an answer registered to it.
        +     * 
        + * + * string name = 1 [(.google.api.resource_reference) = { ... } + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + + private com.google.protobuf.ByteString answer_ = com.google.protobuf.ByteString.EMPTY; + + /** + * + * + *
        +     * The answer from the test.
        +     * 
        + * + * bytes answer = 2; + * + * @return The answer. + */ + @java.lang.Override + public com.google.protobuf.ByteString getAnswer() { + return answer_; + } + + /** + * + * + *
        +     * The answer from the test.
        +     * 
        + * + * bytes answer = 2; + * + * @param value The answer to set. + * @return This builder for chaining. + */ + public Builder setAnswer(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + + answer_ = value; + onChanged(); + return this; + } + + /** + * + * + *
        +     * The answer from the test.
        +     * 
        + * + * bytes answer = 2; + * + * @return This builder for chaining. + */ + public Builder clearAnswer() { + + answer_ = getDefaultInstance().getAnswer(); + onChanged(); + return this; + } + + private java.util.List answers_ = + java.util.Collections.emptyList(); + + private void ensureAnswersIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + answers_ = new java.util.ArrayList(answers_); + bitField0_ |= 0x00000001; + } + } + + /** + * + * + *
        +     * The answers from the test if multiple are to be checked
        +     * 
        + * + * repeated bytes answers = 3; + * + * @return A list containing the answers. + */ + public java.util.List getAnswersList() { + return ((bitField0_ & 0x00000001) != 0) + ? java.util.Collections.unmodifiableList(answers_) + : answers_; + } + + /** + * + * + *
        +     * The answers from the test if multiple are to be checked
        +     * 
        + * + * repeated bytes answers = 3; + * + * @return The count of answers. + */ + public int getAnswersCount() { + return answers_.size(); + } + + /** + * + * + *
        +     * The answers from the test if multiple are to be checked
        +     * 
        + * + * repeated bytes answers = 3; + * + * @param index The index of the element to return. + * @return The answers at the given index. + */ + public com.google.protobuf.ByteString getAnswers(int index) { + return answers_.get(index); + } + + /** + * + * + *
        +     * The answers from the test if multiple are to be checked
        +     * 
        + * + * repeated bytes answers = 3; + * + * @param index The index to set the value at. + * @param value The answers to set. + * @return This builder for chaining. + */ + public Builder setAnswers(int index, com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + ensureAnswersIsMutable(); + answers_.set(index, value); + onChanged(); + return this; + } + + /** + * + * + *
        +     * The answers from the test if multiple are to be checked
        +     * 
        + * + * repeated bytes answers = 3; + * + * @param value The answers to add. + * @return This builder for chaining. + */ + public Builder addAnswers(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + ensureAnswersIsMutable(); + answers_.add(value); + onChanged(); + return this; + } + + /** + * + * + *
        +     * The answers from the test if multiple are to be checked
        +     * 
        + * + * repeated bytes answers = 3; + * + * @param values The answers to add. + * @return This builder for chaining. + */ + public Builder addAllAnswers( + java.lang.Iterable values) { + ensureAnswersIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, answers_); + onChanged(); + return this; + } + + /** + * + * + *
        +     * The answers from the test if multiple are to be checked
        +     * 
        + * + * repeated bytes answers = 3; + * + * @return This builder for chaining. + */ + public Builder clearAnswers() { + answers_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.showcase.v1beta1.VerifyTestRequest) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.VerifyTestRequest) + private static final com.google.showcase.v1beta1.VerifyTestRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.VerifyTestRequest(); + } + + public static com.google.showcase.v1beta1.VerifyTestRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public VerifyTestRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new VerifyTestRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.showcase.v1beta1.VerifyTestRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/VerifyTestRequestOrBuilder.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/VerifyTestRequestOrBuilder.java new file mode 100644 index 0000000000..12a4c76ca0 --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/VerifyTestRequestOrBuilder.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: schema/google/showcase/v1beta1/testing.proto + +package com.google.showcase.v1beta1; + +public interface VerifyTestRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.VerifyTestRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
        +   * The test to have an answer registered to it.
        +   * 
        + * + * string name = 1 [(.google.api.resource_reference) = { ... } + * + * @return The name. + */ + java.lang.String getName(); + + /** + * + * + *
        +   * The test to have an answer registered to it.
        +   * 
        + * + * string name = 1 [(.google.api.resource_reference) = { ... } + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
        +   * The answer from the test.
        +   * 
        + * + * bytes answer = 2; + * + * @return The answer. + */ + com.google.protobuf.ByteString getAnswer(); + + /** + * + * + *
        +   * The answers from the test if multiple are to be checked
        +   * 
        + * + * repeated bytes answers = 3; + * + * @return A list containing the answers. + */ + java.util.List getAnswersList(); + + /** + * + * + *
        +   * The answers from the test if multiple are to be checked
        +   * 
        + * + * repeated bytes answers = 3; + * + * @return The count of answers. + */ + int getAnswersCount(); + + /** + * + * + *
        +   * The answers from the test if multiple are to be checked
        +   * 
        + * + * repeated bytes answers = 3; + * + * @param index The index of the element to return. + * @return The answers at the given index. + */ + com.google.protobuf.ByteString getAnswers(int index); +} diff --git a/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/VerifyTestResponse.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/VerifyTestResponse.java new file mode 100644 index 0000000000..38cabe8b19 --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/VerifyTestResponse.java @@ -0,0 +1,722 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/testing.proto + +package com.google.showcase.v1beta1; + +/** Protobuf type {@code google.showcase.v1beta1.VerifyTestResponse} */ +public final class VerifyTestResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.VerifyTestResponse) + VerifyTestResponseOrBuilder { + private static final long serialVersionUID = 0L; + + // Use VerifyTestResponse.newBuilder() to construct. + private VerifyTestResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private VerifyTestResponse() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new VerifyTestResponse(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private VerifyTestResponse( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + com.google.showcase.v1beta1.Issue.Builder subBuilder = null; + if (issue_ != null) { + subBuilder = issue_.toBuilder(); + } + issue_ = + input.readMessage(com.google.showcase.v1beta1.Issue.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(issue_); + issue_ = subBuilder.buildPartial(); + } + + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.TestingOuterClass + .internal_static_google_showcase_v1beta1_VerifyTestResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.TestingOuterClass + .internal_static_google_showcase_v1beta1_VerifyTestResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.VerifyTestResponse.class, + com.google.showcase.v1beta1.VerifyTestResponse.Builder.class); + } + + public static final int ISSUE_FIELD_NUMBER = 1; + private com.google.showcase.v1beta1.Issue issue_; + + /** + * + * + *
        +   * An issue if check answer was unsuccessful. This will be empty if the check answer succeeded.
        +   * 
        + * + * .google.showcase.v1beta1.Issue issue = 1; + * + * @return Whether the issue field is set. + */ + @java.lang.Override + public boolean hasIssue() { + return issue_ != null; + } + + /** + * + * + *
        +   * An issue if check answer was unsuccessful. This will be empty if the check answer succeeded.
        +   * 
        + * + * .google.showcase.v1beta1.Issue issue = 1; + * + * @return The issue. + */ + @java.lang.Override + public com.google.showcase.v1beta1.Issue getIssue() { + return issue_ == null ? com.google.showcase.v1beta1.Issue.getDefaultInstance() : issue_; + } + + /** + * + * + *
        +   * An issue if check answer was unsuccessful. This will be empty if the check answer succeeded.
        +   * 
        + * + * .google.showcase.v1beta1.Issue issue = 1; + */ + @java.lang.Override + public com.google.showcase.v1beta1.IssueOrBuilder getIssueOrBuilder() { + return getIssue(); + } + + 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 (issue_ != null) { + output.writeMessage(1, getIssue()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (issue_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getIssue()); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.showcase.v1beta1.VerifyTestResponse)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.VerifyTestResponse other = + (com.google.showcase.v1beta1.VerifyTestResponse) obj; + + if (hasIssue() != other.hasIssue()) return false; + if (hasIssue()) { + if (!getIssue().equals(other.getIssue())) return false; + } + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasIssue()) { + hash = (37 * hash) + ISSUE_FIELD_NUMBER; + hash = (53 * hash) + getIssue().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.showcase.v1beta1.VerifyTestResponse parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.VerifyTestResponse parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.VerifyTestResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.VerifyTestResponse 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.showcase.v1beta1.VerifyTestResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.VerifyTestResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.VerifyTestResponse parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.VerifyTestResponse 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.showcase.v1beta1.VerifyTestResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.VerifyTestResponse 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.showcase.v1beta1.VerifyTestResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.VerifyTestResponse 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.showcase.v1beta1.VerifyTestResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** Protobuf type {@code google.showcase.v1beta1.VerifyTestResponse} */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.VerifyTestResponse) + com.google.showcase.v1beta1.VerifyTestResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.TestingOuterClass + .internal_static_google_showcase_v1beta1_VerifyTestResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.TestingOuterClass + .internal_static_google_showcase_v1beta1_VerifyTestResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.VerifyTestResponse.class, + com.google.showcase.v1beta1.VerifyTestResponse.Builder.class); + } + + // Construct using com.google.showcase.v1beta1.VerifyTestResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (issueBuilder_ == null) { + issue_ = null; + } else { + issue_ = null; + issueBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.showcase.v1beta1.TestingOuterClass + .internal_static_google_showcase_v1beta1_VerifyTestResponse_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.VerifyTestResponse getDefaultInstanceForType() { + return com.google.showcase.v1beta1.VerifyTestResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.VerifyTestResponse build() { + com.google.showcase.v1beta1.VerifyTestResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.VerifyTestResponse buildPartial() { + com.google.showcase.v1beta1.VerifyTestResponse result = + new com.google.showcase.v1beta1.VerifyTestResponse(this); + if (issueBuilder_ == null) { + result.issue_ = issue_; + } else { + result.issue_ = issueBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.showcase.v1beta1.VerifyTestResponse) { + return mergeFrom((com.google.showcase.v1beta1.VerifyTestResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.showcase.v1beta1.VerifyTestResponse other) { + if (other == com.google.showcase.v1beta1.VerifyTestResponse.getDefaultInstance()) return this; + if (other.hasIssue()) { + mergeIssue(other.getIssue()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.showcase.v1beta1.VerifyTestResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.showcase.v1beta1.VerifyTestResponse) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private com.google.showcase.v1beta1.Issue issue_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.showcase.v1beta1.Issue, + com.google.showcase.v1beta1.Issue.Builder, + com.google.showcase.v1beta1.IssueOrBuilder> + issueBuilder_; + + /** + * + * + *
        +     * An issue if check answer was unsuccessful. This will be empty if the check answer succeeded.
        +     * 
        + * + * .google.showcase.v1beta1.Issue issue = 1; + * + * @return Whether the issue field is set. + */ + public boolean hasIssue() { + return issueBuilder_ != null || issue_ != null; + } + + /** + * + * + *
        +     * An issue if check answer was unsuccessful. This will be empty if the check answer succeeded.
        +     * 
        + * + * .google.showcase.v1beta1.Issue issue = 1; + * + * @return The issue. + */ + public com.google.showcase.v1beta1.Issue getIssue() { + if (issueBuilder_ == null) { + return issue_ == null ? com.google.showcase.v1beta1.Issue.getDefaultInstance() : issue_; + } else { + return issueBuilder_.getMessage(); + } + } + + /** + * + * + *
        +     * An issue if check answer was unsuccessful. This will be empty if the check answer succeeded.
        +     * 
        + * + * .google.showcase.v1beta1.Issue issue = 1; + */ + public Builder setIssue(com.google.showcase.v1beta1.Issue value) { + if (issueBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + issue_ = value; + onChanged(); + } else { + issueBuilder_.setMessage(value); + } + + return this; + } + + /** + * + * + *
        +     * An issue if check answer was unsuccessful. This will be empty if the check answer succeeded.
        +     * 
        + * + * .google.showcase.v1beta1.Issue issue = 1; + */ + public Builder setIssue(com.google.showcase.v1beta1.Issue.Builder builderForValue) { + if (issueBuilder_ == null) { + issue_ = builderForValue.build(); + onChanged(); + } else { + issueBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + + /** + * + * + *
        +     * An issue if check answer was unsuccessful. This will be empty if the check answer succeeded.
        +     * 
        + * + * .google.showcase.v1beta1.Issue issue = 1; + */ + public Builder mergeIssue(com.google.showcase.v1beta1.Issue value) { + if (issueBuilder_ == null) { + if (issue_ != null) { + issue_ = + com.google.showcase.v1beta1.Issue.newBuilder(issue_).mergeFrom(value).buildPartial(); + } else { + issue_ = value; + } + onChanged(); + } else { + issueBuilder_.mergeFrom(value); + } + + return this; + } + + /** + * + * + *
        +     * An issue if check answer was unsuccessful. This will be empty if the check answer succeeded.
        +     * 
        + * + * .google.showcase.v1beta1.Issue issue = 1; + */ + public Builder clearIssue() { + if (issueBuilder_ == null) { + issue_ = null; + onChanged(); + } else { + issue_ = null; + issueBuilder_ = null; + } + + return this; + } + + /** + * + * + *
        +     * An issue if check answer was unsuccessful. This will be empty if the check answer succeeded.
        +     * 
        + * + * .google.showcase.v1beta1.Issue issue = 1; + */ + public com.google.showcase.v1beta1.Issue.Builder getIssueBuilder() { + + onChanged(); + return getIssueFieldBuilder().getBuilder(); + } + + /** + * + * + *
        +     * An issue if check answer was unsuccessful. This will be empty if the check answer succeeded.
        +     * 
        + * + * .google.showcase.v1beta1.Issue issue = 1; + */ + public com.google.showcase.v1beta1.IssueOrBuilder getIssueOrBuilder() { + if (issueBuilder_ != null) { + return issueBuilder_.getMessageOrBuilder(); + } else { + return issue_ == null ? com.google.showcase.v1beta1.Issue.getDefaultInstance() : issue_; + } + } + + /** + * + * + *
        +     * An issue if check answer was unsuccessful. This will be empty if the check answer succeeded.
        +     * 
        + * + * .google.showcase.v1beta1.Issue issue = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.showcase.v1beta1.Issue, + com.google.showcase.v1beta1.Issue.Builder, + com.google.showcase.v1beta1.IssueOrBuilder> + getIssueFieldBuilder() { + if (issueBuilder_ == null) { + issueBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.showcase.v1beta1.Issue, + com.google.showcase.v1beta1.Issue.Builder, + com.google.showcase.v1beta1.IssueOrBuilder>( + getIssue(), getParentForChildren(), isClean()); + issue_ = null; + } + return issueBuilder_; + } + + @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.showcase.v1beta1.VerifyTestResponse) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.VerifyTestResponse) + private static final com.google.showcase.v1beta1.VerifyTestResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.VerifyTestResponse(); + } + + public static com.google.showcase.v1beta1.VerifyTestResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public VerifyTestResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new VerifyTestResponse(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.showcase.v1beta1.VerifyTestResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/VerifyTestResponseOrBuilder.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/VerifyTestResponseOrBuilder.java new file mode 100644 index 0000000000..669a7abcbd --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/VerifyTestResponseOrBuilder.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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/testing.proto + +package com.google.showcase.v1beta1; + +public interface VerifyTestResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.VerifyTestResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
        +   * An issue if check answer was unsuccessful. This will be empty if the check answer succeeded.
        +   * 
        + * + * .google.showcase.v1beta1.Issue issue = 1; + * + * @return Whether the issue field is set. + */ + boolean hasIssue(); + + /** + * + * + *
        +   * An issue if check answer was unsuccessful. This will be empty if the check answer succeeded.
        +   * 
        + * + * .google.showcase.v1beta1.Issue issue = 1; + * + * @return The issue. + */ + com.google.showcase.v1beta1.Issue getIssue(); + + /** + * + * + *
        +   * An issue if check answer was unsuccessful. This will be empty if the check answer succeeded.
        +   * 
        + * + * .google.showcase.v1beta1.Issue issue = 1; + */ + com.google.showcase.v1beta1.IssueOrBuilder getIssueOrBuilder(); +} diff --git a/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/WaitMetadata.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/WaitMetadata.java new file mode 100644 index 0000000000..f319d17f49 --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/WaitMetadata.java @@ -0,0 +1,737 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/echo.proto + +package com.google.showcase.v1beta1; + +/** + * + * + *
        + * The metadata for Wait operation.
        + * 
        + * + * Protobuf type {@code google.showcase.v1beta1.WaitMetadata} + */ +public final class WaitMetadata extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.WaitMetadata) + WaitMetadataOrBuilder { + private static final long serialVersionUID = 0L; + + // Use WaitMetadata.newBuilder() to construct. + private WaitMetadata(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private WaitMetadata() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new WaitMetadata(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private WaitMetadata( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + com.google.protobuf.Timestamp.Builder subBuilder = null; + if (endTime_ != null) { + subBuilder = endTime_.toBuilder(); + } + endTime_ = + input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(endTime_); + endTime_ = subBuilder.buildPartial(); + } + + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.EchoOuterClass + .internal_static_google_showcase_v1beta1_WaitMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.EchoOuterClass + .internal_static_google_showcase_v1beta1_WaitMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.WaitMetadata.class, + com.google.showcase.v1beta1.WaitMetadata.Builder.class); + } + + public static final int END_TIME_FIELD_NUMBER = 1; + private com.google.protobuf.Timestamp endTime_; + + /** + * + * + *
        +   * The time that this operation will complete.
        +   * 
        + * + * .google.protobuf.Timestamp end_time = 1; + * + * @return Whether the endTime field is set. + */ + @java.lang.Override + public boolean hasEndTime() { + return endTime_ != null; + } + + /** + * + * + *
        +   * The time that this operation will complete.
        +   * 
        + * + * .google.protobuf.Timestamp end_time = 1; + * + * @return The endTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getEndTime() { + return endTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : endTime_; + } + + /** + * + * + *
        +   * The time that this operation will complete.
        +   * 
        + * + * .google.protobuf.Timestamp end_time = 1; + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getEndTimeOrBuilder() { + return getEndTime(); + } + + 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 (endTime_ != null) { + output.writeMessage(1, getEndTime()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (endTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getEndTime()); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.showcase.v1beta1.WaitMetadata)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.WaitMetadata other = (com.google.showcase.v1beta1.WaitMetadata) obj; + + if (hasEndTime() != other.hasEndTime()) return false; + if (hasEndTime()) { + if (!getEndTime().equals(other.getEndTime())) return false; + } + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasEndTime()) { + hash = (37 * hash) + END_TIME_FIELD_NUMBER; + hash = (53 * hash) + getEndTime().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.showcase.v1beta1.WaitMetadata parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.WaitMetadata parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.WaitMetadata parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.WaitMetadata 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.showcase.v1beta1.WaitMetadata parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.WaitMetadata parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.WaitMetadata parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.WaitMetadata 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.showcase.v1beta1.WaitMetadata parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.WaitMetadata 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.showcase.v1beta1.WaitMetadata parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.WaitMetadata 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.showcase.v1beta1.WaitMetadata 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 metadata for Wait operation.
        +   * 
        + * + * Protobuf type {@code google.showcase.v1beta1.WaitMetadata} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.WaitMetadata) + com.google.showcase.v1beta1.WaitMetadataOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.EchoOuterClass + .internal_static_google_showcase_v1beta1_WaitMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.EchoOuterClass + .internal_static_google_showcase_v1beta1_WaitMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.WaitMetadata.class, + com.google.showcase.v1beta1.WaitMetadata.Builder.class); + } + + // Construct using com.google.showcase.v1beta1.WaitMetadata.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (endTimeBuilder_ == null) { + endTime_ = null; + } else { + endTime_ = null; + endTimeBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.showcase.v1beta1.EchoOuterClass + .internal_static_google_showcase_v1beta1_WaitMetadata_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.WaitMetadata getDefaultInstanceForType() { + return com.google.showcase.v1beta1.WaitMetadata.getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.WaitMetadata build() { + com.google.showcase.v1beta1.WaitMetadata result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.WaitMetadata buildPartial() { + com.google.showcase.v1beta1.WaitMetadata result = + new com.google.showcase.v1beta1.WaitMetadata(this); + if (endTimeBuilder_ == null) { + result.endTime_ = endTime_; + } else { + result.endTime_ = endTimeBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.showcase.v1beta1.WaitMetadata) { + return mergeFrom((com.google.showcase.v1beta1.WaitMetadata) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.showcase.v1beta1.WaitMetadata other) { + if (other == com.google.showcase.v1beta1.WaitMetadata.getDefaultInstance()) return this; + if (other.hasEndTime()) { + mergeEndTime(other.getEndTime()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.showcase.v1beta1.WaitMetadata parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.showcase.v1beta1.WaitMetadata) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + 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 time that this operation will complete.
        +     * 
        + * + * .google.protobuf.Timestamp end_time = 1; + * + * @return Whether the endTime field is set. + */ + public boolean hasEndTime() { + return endTimeBuilder_ != null || endTime_ != null; + } + + /** + * + * + *
        +     * The time that this operation will complete.
        +     * 
        + * + * .google.protobuf.Timestamp end_time = 1; + * + * @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 time that this operation will complete.
        +     * 
        + * + * .google.protobuf.Timestamp end_time = 1; + */ + public Builder setEndTime(com.google.protobuf.Timestamp value) { + if (endTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + endTime_ = value; + onChanged(); + } else { + endTimeBuilder_.setMessage(value); + } + + return this; + } + + /** + * + * + *
        +     * The time that this operation will complete.
        +     * 
        + * + * .google.protobuf.Timestamp end_time = 1; + */ + public Builder setEndTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (endTimeBuilder_ == null) { + endTime_ = builderForValue.build(); + onChanged(); + } else { + endTimeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + + /** + * + * + *
        +     * The time that this operation will complete.
        +     * 
        + * + * .google.protobuf.Timestamp end_time = 1; + */ + public Builder mergeEndTime(com.google.protobuf.Timestamp value) { + if (endTimeBuilder_ == null) { + if (endTime_ != null) { + endTime_ = + com.google.protobuf.Timestamp.newBuilder(endTime_).mergeFrom(value).buildPartial(); + } else { + endTime_ = value; + } + onChanged(); + } else { + endTimeBuilder_.mergeFrom(value); + } + + return this; + } + + /** + * + * + *
        +     * The time that this operation will complete.
        +     * 
        + * + * .google.protobuf.Timestamp end_time = 1; + */ + public Builder clearEndTime() { + if (endTimeBuilder_ == null) { + endTime_ = null; + onChanged(); + } else { + endTime_ = null; + endTimeBuilder_ = null; + } + + return this; + } + + /** + * + * + *
        +     * The time that this operation will complete.
        +     * 
        + * + * .google.protobuf.Timestamp end_time = 1; + */ + public com.google.protobuf.Timestamp.Builder getEndTimeBuilder() { + + onChanged(); + return getEndTimeFieldBuilder().getBuilder(); + } + + /** + * + * + *
        +     * The time that this operation will complete.
        +     * 
        + * + * .google.protobuf.Timestamp end_time = 1; + */ + public com.google.protobuf.TimestampOrBuilder getEndTimeOrBuilder() { + if (endTimeBuilder_ != null) { + return endTimeBuilder_.getMessageOrBuilder(); + } else { + return endTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : endTime_; + } + } + + /** + * + * + *
        +     * The time that this operation will complete.
        +     * 
        + * + * .google.protobuf.Timestamp end_time = 1; + */ + 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_; + } + + @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.showcase.v1beta1.WaitMetadata) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.WaitMetadata) + private static final com.google.showcase.v1beta1.WaitMetadata DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.WaitMetadata(); + } + + public static com.google.showcase.v1beta1.WaitMetadata getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public WaitMetadata parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new WaitMetadata(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.showcase.v1beta1.WaitMetadata getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/WaitMetadataOrBuilder.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/WaitMetadataOrBuilder.java new file mode 100644 index 0000000000..7c4cbb844c --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/WaitMetadataOrBuilder.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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/echo.proto + +package com.google.showcase.v1beta1; + +public interface WaitMetadataOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.WaitMetadata) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
        +   * The time that this operation will complete.
        +   * 
        + * + * .google.protobuf.Timestamp end_time = 1; + * + * @return Whether the endTime field is set. + */ + boolean hasEndTime(); + + /** + * + * + *
        +   * The time that this operation will complete.
        +   * 
        + * + * .google.protobuf.Timestamp end_time = 1; + * + * @return The endTime. + */ + com.google.protobuf.Timestamp getEndTime(); + + /** + * + * + *
        +   * The time that this operation will complete.
        +   * 
        + * + * .google.protobuf.Timestamp end_time = 1; + */ + com.google.protobuf.TimestampOrBuilder getEndTimeOrBuilder(); +} diff --git a/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/WaitRequest.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/WaitRequest.java new file mode 100644 index 0000000000..ee5df9cb45 --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/WaitRequest.java @@ -0,0 +1,1867 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/echo.proto + +package com.google.showcase.v1beta1; + +/** + * + * + *
        + * The request for Wait method.
        + * 
        + * + * Protobuf type {@code google.showcase.v1beta1.WaitRequest} + */ +public final class WaitRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.WaitRequest) + WaitRequestOrBuilder { + private static final long serialVersionUID = 0L; + + // Use WaitRequest.newBuilder() to construct. + private WaitRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private WaitRequest() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new WaitRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private WaitRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + com.google.protobuf.Timestamp.Builder subBuilder = null; + if (endCase_ == 1) { + subBuilder = ((com.google.protobuf.Timestamp) end_).toBuilder(); + } + end_ = input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom((com.google.protobuf.Timestamp) end_); + end_ = subBuilder.buildPartial(); + } + endCase_ = 1; + break; + } + case 18: + { + com.google.rpc.Status.Builder subBuilder = null; + if (responseCase_ == 2) { + subBuilder = ((com.google.rpc.Status) response_).toBuilder(); + } + response_ = input.readMessage(com.google.rpc.Status.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom((com.google.rpc.Status) response_); + response_ = subBuilder.buildPartial(); + } + responseCase_ = 2; + break; + } + case 26: + { + com.google.showcase.v1beta1.WaitResponse.Builder subBuilder = null; + if (responseCase_ == 3) { + subBuilder = ((com.google.showcase.v1beta1.WaitResponse) response_).toBuilder(); + } + response_ = + input.readMessage( + com.google.showcase.v1beta1.WaitResponse.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom((com.google.showcase.v1beta1.WaitResponse) response_); + response_ = subBuilder.buildPartial(); + } + responseCase_ = 3; + break; + } + case 34: + { + com.google.protobuf.Duration.Builder subBuilder = null; + if (endCase_ == 4) { + subBuilder = ((com.google.protobuf.Duration) end_).toBuilder(); + } + end_ = input.readMessage(com.google.protobuf.Duration.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom((com.google.protobuf.Duration) end_); + end_ = subBuilder.buildPartial(); + } + endCase_ = 4; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.EchoOuterClass + .internal_static_google_showcase_v1beta1_WaitRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.EchoOuterClass + .internal_static_google_showcase_v1beta1_WaitRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.WaitRequest.class, + com.google.showcase.v1beta1.WaitRequest.Builder.class); + } + + private int endCase_ = 0; + private java.lang.Object end_; + + public enum EndCase + implements + com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + END_TIME(1), + TTL(4), + END_NOT_SET(0); + private final int value; + + private EndCase(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 EndCase valueOf(int value) { + return forNumber(value); + } + + public static EndCase forNumber(int value) { + switch (value) { + case 1: + return END_TIME; + case 4: + return TTL; + case 0: + return END_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public EndCase getEndCase() { + return EndCase.forNumber(endCase_); + } + + private int responseCase_ = 0; + private java.lang.Object response_; + + public enum ResponseCase + implements + com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + ERROR(2), + SUCCESS(3), + RESPONSE_NOT_SET(0); + private final int value; + + private ResponseCase(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 ResponseCase valueOf(int value) { + return forNumber(value); + } + + public static ResponseCase forNumber(int value) { + switch (value) { + case 2: + return ERROR; + case 3: + return SUCCESS; + case 0: + return RESPONSE_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public ResponseCase getResponseCase() { + return ResponseCase.forNumber(responseCase_); + } + + public static final int END_TIME_FIELD_NUMBER = 1; + + /** + * + * + *
        +   * The time that this operation will complete.
        +   * 
        + * + * .google.protobuf.Timestamp end_time = 1; + * + * @return Whether the endTime field is set. + */ + @java.lang.Override + public boolean hasEndTime() { + return endCase_ == 1; + } + + /** + * + * + *
        +   * The time that this operation will complete.
        +   * 
        + * + * .google.protobuf.Timestamp end_time = 1; + * + * @return The endTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getEndTime() { + if (endCase_ == 1) { + return (com.google.protobuf.Timestamp) end_; + } + return com.google.protobuf.Timestamp.getDefaultInstance(); + } + + /** + * + * + *
        +   * The time that this operation will complete.
        +   * 
        + * + * .google.protobuf.Timestamp end_time = 1; + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getEndTimeOrBuilder() { + if (endCase_ == 1) { + return (com.google.protobuf.Timestamp) end_; + } + return com.google.protobuf.Timestamp.getDefaultInstance(); + } + + public static final int TTL_FIELD_NUMBER = 4; + + /** + * + * + *
        +   * The duration of this operation.
        +   * 
        + * + * .google.protobuf.Duration ttl = 4; + * + * @return Whether the ttl field is set. + */ + @java.lang.Override + public boolean hasTtl() { + return endCase_ == 4; + } + + /** + * + * + *
        +   * The duration of this operation.
        +   * 
        + * + * .google.protobuf.Duration ttl = 4; + * + * @return The ttl. + */ + @java.lang.Override + public com.google.protobuf.Duration getTtl() { + if (endCase_ == 4) { + return (com.google.protobuf.Duration) end_; + } + return com.google.protobuf.Duration.getDefaultInstance(); + } + + /** + * + * + *
        +   * The duration of this operation.
        +   * 
        + * + * .google.protobuf.Duration ttl = 4; + */ + @java.lang.Override + public com.google.protobuf.DurationOrBuilder getTtlOrBuilder() { + if (endCase_ == 4) { + return (com.google.protobuf.Duration) end_; + } + return com.google.protobuf.Duration.getDefaultInstance(); + } + + public static final int ERROR_FIELD_NUMBER = 2; + + /** + * + * + *
        +   * The error that will be returned by the server. If this code is specified
        +   * to be the OK rpc code, an empty response will be returned.
        +   * 
        + * + * .google.rpc.Status error = 2; + * + * @return Whether the error field is set. + */ + @java.lang.Override + public boolean hasError() { + return responseCase_ == 2; + } + + /** + * + * + *
        +   * The error that will be returned by the server. If this code is specified
        +   * to be the OK rpc code, an empty response will be returned.
        +   * 
        + * + * .google.rpc.Status error = 2; + * + * @return The error. + */ + @java.lang.Override + public com.google.rpc.Status getError() { + if (responseCase_ == 2) { + return (com.google.rpc.Status) response_; + } + return com.google.rpc.Status.getDefaultInstance(); + } + + /** + * + * + *
        +   * The error that will be returned by the server. If this code is specified
        +   * to be the OK rpc code, an empty response will be returned.
        +   * 
        + * + * .google.rpc.Status error = 2; + */ + @java.lang.Override + public com.google.rpc.StatusOrBuilder getErrorOrBuilder() { + if (responseCase_ == 2) { + return (com.google.rpc.Status) response_; + } + return com.google.rpc.Status.getDefaultInstance(); + } + + public static final int SUCCESS_FIELD_NUMBER = 3; + + /** + * + * + *
        +   * The response to be returned on operation completion.
        +   * 
        + * + * .google.showcase.v1beta1.WaitResponse success = 3; + * + * @return Whether the success field is set. + */ + @java.lang.Override + public boolean hasSuccess() { + return responseCase_ == 3; + } + + /** + * + * + *
        +   * The response to be returned on operation completion.
        +   * 
        + * + * .google.showcase.v1beta1.WaitResponse success = 3; + * + * @return The success. + */ + @java.lang.Override + public com.google.showcase.v1beta1.WaitResponse getSuccess() { + if (responseCase_ == 3) { + return (com.google.showcase.v1beta1.WaitResponse) response_; + } + return com.google.showcase.v1beta1.WaitResponse.getDefaultInstance(); + } + + /** + * + * + *
        +   * The response to be returned on operation completion.
        +   * 
        + * + * .google.showcase.v1beta1.WaitResponse success = 3; + */ + @java.lang.Override + public com.google.showcase.v1beta1.WaitResponseOrBuilder getSuccessOrBuilder() { + if (responseCase_ == 3) { + return (com.google.showcase.v1beta1.WaitResponse) response_; + } + return com.google.showcase.v1beta1.WaitResponse.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 (endCase_ == 1) { + output.writeMessage(1, (com.google.protobuf.Timestamp) end_); + } + if (responseCase_ == 2) { + output.writeMessage(2, (com.google.rpc.Status) response_); + } + if (responseCase_ == 3) { + output.writeMessage(3, (com.google.showcase.v1beta1.WaitResponse) response_); + } + if (endCase_ == 4) { + output.writeMessage(4, (com.google.protobuf.Duration) end_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (endCase_ == 1) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 1, (com.google.protobuf.Timestamp) end_); + } + if (responseCase_ == 2) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 2, (com.google.rpc.Status) response_); + } + if (responseCase_ == 3) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 3, (com.google.showcase.v1beta1.WaitResponse) response_); + } + if (endCase_ == 4) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 4, (com.google.protobuf.Duration) end_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.showcase.v1beta1.WaitRequest)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.WaitRequest other = (com.google.showcase.v1beta1.WaitRequest) obj; + + if (!getEndCase().equals(other.getEndCase())) return false; + switch (endCase_) { + case 1: + if (!getEndTime().equals(other.getEndTime())) return false; + break; + case 4: + if (!getTtl().equals(other.getTtl())) return false; + break; + case 0: + default: + } + if (!getResponseCase().equals(other.getResponseCase())) return false; + switch (responseCase_) { + case 2: + if (!getError().equals(other.getError())) return false; + break; + case 3: + if (!getSuccess().equals(other.getSuccess())) return false; + break; + case 0: + default: + } + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + switch (endCase_) { + case 1: + hash = (37 * hash) + END_TIME_FIELD_NUMBER; + hash = (53 * hash) + getEndTime().hashCode(); + break; + case 4: + hash = (37 * hash) + TTL_FIELD_NUMBER; + hash = (53 * hash) + getTtl().hashCode(); + break; + case 0: + default: + } + switch (responseCase_) { + case 2: + hash = (37 * hash) + ERROR_FIELD_NUMBER; + hash = (53 * hash) + getError().hashCode(); + break; + case 3: + hash = (37 * hash) + SUCCESS_FIELD_NUMBER; + hash = (53 * hash) + getSuccess().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.showcase.v1beta1.WaitRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.WaitRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.WaitRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.WaitRequest 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.showcase.v1beta1.WaitRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.WaitRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.WaitRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.WaitRequest 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.showcase.v1beta1.WaitRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.WaitRequest 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.showcase.v1beta1.WaitRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.WaitRequest 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.showcase.v1beta1.WaitRequest 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 request for Wait method.
        +   * 
        + * + * Protobuf type {@code google.showcase.v1beta1.WaitRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.WaitRequest) + com.google.showcase.v1beta1.WaitRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.EchoOuterClass + .internal_static_google_showcase_v1beta1_WaitRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.EchoOuterClass + .internal_static_google_showcase_v1beta1_WaitRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.WaitRequest.class, + com.google.showcase.v1beta1.WaitRequest.Builder.class); + } + + // Construct using com.google.showcase.v1beta1.WaitRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + endCase_ = 0; + end_ = null; + responseCase_ = 0; + response_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.showcase.v1beta1.EchoOuterClass + .internal_static_google_showcase_v1beta1_WaitRequest_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.WaitRequest getDefaultInstanceForType() { + return com.google.showcase.v1beta1.WaitRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.WaitRequest build() { + com.google.showcase.v1beta1.WaitRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.WaitRequest buildPartial() { + com.google.showcase.v1beta1.WaitRequest result = + new com.google.showcase.v1beta1.WaitRequest(this); + if (endCase_ == 1) { + if (endTimeBuilder_ == null) { + result.end_ = end_; + } else { + result.end_ = endTimeBuilder_.build(); + } + } + if (endCase_ == 4) { + if (ttlBuilder_ == null) { + result.end_ = end_; + } else { + result.end_ = ttlBuilder_.build(); + } + } + if (responseCase_ == 2) { + if (errorBuilder_ == null) { + result.response_ = response_; + } else { + result.response_ = errorBuilder_.build(); + } + } + if (responseCase_ == 3) { + if (successBuilder_ == null) { + result.response_ = response_; + } else { + result.response_ = successBuilder_.build(); + } + } + result.endCase_ = endCase_; + result.responseCase_ = responseCase_; + 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.showcase.v1beta1.WaitRequest) { + return mergeFrom((com.google.showcase.v1beta1.WaitRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.showcase.v1beta1.WaitRequest other) { + if (other == com.google.showcase.v1beta1.WaitRequest.getDefaultInstance()) return this; + switch (other.getEndCase()) { + case END_TIME: + { + mergeEndTime(other.getEndTime()); + break; + } + case TTL: + { + mergeTtl(other.getTtl()); + break; + } + case END_NOT_SET: + { + break; + } + } + switch (other.getResponseCase()) { + case ERROR: + { + mergeError(other.getError()); + break; + } + case SUCCESS: + { + mergeSuccess(other.getSuccess()); + break; + } + case RESPONSE_NOT_SET: + { + break; + } + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.showcase.v1beta1.WaitRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.showcase.v1beta1.WaitRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int endCase_ = 0; + private java.lang.Object end_; + + public EndCase getEndCase() { + return EndCase.forNumber(endCase_); + } + + public Builder clearEnd() { + endCase_ = 0; + end_ = null; + onChanged(); + return this; + } + + private int responseCase_ = 0; + private java.lang.Object response_; + + public ResponseCase getResponseCase() { + return ResponseCase.forNumber(responseCase_); + } + + public Builder clearResponse() { + responseCase_ = 0; + response_ = null; + onChanged(); + return this; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + endTimeBuilder_; + + /** + * + * + *
        +     * The time that this operation will complete.
        +     * 
        + * + * .google.protobuf.Timestamp end_time = 1; + * + * @return Whether the endTime field is set. + */ + @java.lang.Override + public boolean hasEndTime() { + return endCase_ == 1; + } + + /** + * + * + *
        +     * The time that this operation will complete.
        +     * 
        + * + * .google.protobuf.Timestamp end_time = 1; + * + * @return The endTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getEndTime() { + if (endTimeBuilder_ == null) { + if (endCase_ == 1) { + return (com.google.protobuf.Timestamp) end_; + } + return com.google.protobuf.Timestamp.getDefaultInstance(); + } else { + if (endCase_ == 1) { + return endTimeBuilder_.getMessage(); + } + return com.google.protobuf.Timestamp.getDefaultInstance(); + } + } + + /** + * + * + *
        +     * The time that this operation will complete.
        +     * 
        + * + * .google.protobuf.Timestamp end_time = 1; + */ + public Builder setEndTime(com.google.protobuf.Timestamp value) { + if (endTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + end_ = value; + onChanged(); + } else { + endTimeBuilder_.setMessage(value); + } + endCase_ = 1; + return this; + } + + /** + * + * + *
        +     * The time that this operation will complete.
        +     * 
        + * + * .google.protobuf.Timestamp end_time = 1; + */ + public Builder setEndTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (endTimeBuilder_ == null) { + end_ = builderForValue.build(); + onChanged(); + } else { + endTimeBuilder_.setMessage(builderForValue.build()); + } + endCase_ = 1; + return this; + } + + /** + * + * + *
        +     * The time that this operation will complete.
        +     * 
        + * + * .google.protobuf.Timestamp end_time = 1; + */ + public Builder mergeEndTime(com.google.protobuf.Timestamp value) { + if (endTimeBuilder_ == null) { + if (endCase_ == 1 && end_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + end_ = + com.google.protobuf.Timestamp.newBuilder((com.google.protobuf.Timestamp) end_) + .mergeFrom(value) + .buildPartial(); + } else { + end_ = value; + } + onChanged(); + } else { + if (endCase_ == 1) { + endTimeBuilder_.mergeFrom(value); + } else { + endTimeBuilder_.setMessage(value); + } + } + endCase_ = 1; + return this; + } + + /** + * + * + *
        +     * The time that this operation will complete.
        +     * 
        + * + * .google.protobuf.Timestamp end_time = 1; + */ + public Builder clearEndTime() { + if (endTimeBuilder_ == null) { + if (endCase_ == 1) { + endCase_ = 0; + end_ = null; + onChanged(); + } + } else { + if (endCase_ == 1) { + endCase_ = 0; + end_ = null; + } + endTimeBuilder_.clear(); + } + return this; + } + + /** + * + * + *
        +     * The time that this operation will complete.
        +     * 
        + * + * .google.protobuf.Timestamp end_time = 1; + */ + public com.google.protobuf.Timestamp.Builder getEndTimeBuilder() { + return getEndTimeFieldBuilder().getBuilder(); + } + + /** + * + * + *
        +     * The time that this operation will complete.
        +     * 
        + * + * .google.protobuf.Timestamp end_time = 1; + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getEndTimeOrBuilder() { + if ((endCase_ == 1) && (endTimeBuilder_ != null)) { + return endTimeBuilder_.getMessageOrBuilder(); + } else { + if (endCase_ == 1) { + return (com.google.protobuf.Timestamp) end_; + } + return com.google.protobuf.Timestamp.getDefaultInstance(); + } + } + + /** + * + * + *
        +     * The time that this operation will complete.
        +     * 
        + * + * .google.protobuf.Timestamp end_time = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getEndTimeFieldBuilder() { + if (endTimeBuilder_ == null) { + if (!(endCase_ == 1)) { + end_ = com.google.protobuf.Timestamp.getDefaultInstance(); + } + endTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + (com.google.protobuf.Timestamp) end_, getParentForChildren(), isClean()); + end_ = null; + } + endCase_ = 1; + onChanged(); + ; + return endTimeBuilder_; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder> + ttlBuilder_; + + /** + * + * + *
        +     * The duration of this operation.
        +     * 
        + * + * .google.protobuf.Duration ttl = 4; + * + * @return Whether the ttl field is set. + */ + @java.lang.Override + public boolean hasTtl() { + return endCase_ == 4; + } + + /** + * + * + *
        +     * The duration of this operation.
        +     * 
        + * + * .google.protobuf.Duration ttl = 4; + * + * @return The ttl. + */ + @java.lang.Override + public com.google.protobuf.Duration getTtl() { + if (ttlBuilder_ == null) { + if (endCase_ == 4) { + return (com.google.protobuf.Duration) end_; + } + return com.google.protobuf.Duration.getDefaultInstance(); + } else { + if (endCase_ == 4) { + return ttlBuilder_.getMessage(); + } + return com.google.protobuf.Duration.getDefaultInstance(); + } + } + + /** + * + * + *
        +     * The duration of this operation.
        +     * 
        + * + * .google.protobuf.Duration ttl = 4; + */ + public Builder setTtl(com.google.protobuf.Duration value) { + if (ttlBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + end_ = value; + onChanged(); + } else { + ttlBuilder_.setMessage(value); + } + endCase_ = 4; + return this; + } + + /** + * + * + *
        +     * The duration of this operation.
        +     * 
        + * + * .google.protobuf.Duration ttl = 4; + */ + public Builder setTtl(com.google.protobuf.Duration.Builder builderForValue) { + if (ttlBuilder_ == null) { + end_ = builderForValue.build(); + onChanged(); + } else { + ttlBuilder_.setMessage(builderForValue.build()); + } + endCase_ = 4; + return this; + } + + /** + * + * + *
        +     * The duration of this operation.
        +     * 
        + * + * .google.protobuf.Duration ttl = 4; + */ + public Builder mergeTtl(com.google.protobuf.Duration value) { + if (ttlBuilder_ == null) { + if (endCase_ == 4 && end_ != com.google.protobuf.Duration.getDefaultInstance()) { + end_ = + com.google.protobuf.Duration.newBuilder((com.google.protobuf.Duration) end_) + .mergeFrom(value) + .buildPartial(); + } else { + end_ = value; + } + onChanged(); + } else { + if (endCase_ == 4) { + ttlBuilder_.mergeFrom(value); + } else { + ttlBuilder_.setMessage(value); + } + } + endCase_ = 4; + return this; + } + + /** + * + * + *
        +     * The duration of this operation.
        +     * 
        + * + * .google.protobuf.Duration ttl = 4; + */ + public Builder clearTtl() { + if (ttlBuilder_ == null) { + if (endCase_ == 4) { + endCase_ = 0; + end_ = null; + onChanged(); + } + } else { + if (endCase_ == 4) { + endCase_ = 0; + end_ = null; + } + ttlBuilder_.clear(); + } + return this; + } + + /** + * + * + *
        +     * The duration of this operation.
        +     * 
        + * + * .google.protobuf.Duration ttl = 4; + */ + public com.google.protobuf.Duration.Builder getTtlBuilder() { + return getTtlFieldBuilder().getBuilder(); + } + + /** + * + * + *
        +     * The duration of this operation.
        +     * 
        + * + * .google.protobuf.Duration ttl = 4; + */ + @java.lang.Override + public com.google.protobuf.DurationOrBuilder getTtlOrBuilder() { + if ((endCase_ == 4) && (ttlBuilder_ != null)) { + return ttlBuilder_.getMessageOrBuilder(); + } else { + if (endCase_ == 4) { + return (com.google.protobuf.Duration) end_; + } + return com.google.protobuf.Duration.getDefaultInstance(); + } + } + + /** + * + * + *
        +     * The duration of this operation.
        +     * 
        + * + * .google.protobuf.Duration ttl = 4; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder> + getTtlFieldBuilder() { + if (ttlBuilder_ == null) { + if (!(endCase_ == 4)) { + end_ = com.google.protobuf.Duration.getDefaultInstance(); + } + ttlBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder>( + (com.google.protobuf.Duration) end_, getParentForChildren(), isClean()); + end_ = null; + } + endCase_ = 4; + onChanged(); + ; + return ttlBuilder_; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.rpc.Status, com.google.rpc.Status.Builder, com.google.rpc.StatusOrBuilder> + errorBuilder_; + + /** + * + * + *
        +     * The error that will be returned by the server. If this code is specified
        +     * to be the OK rpc code, an empty response will be returned.
        +     * 
        + * + * .google.rpc.Status error = 2; + * + * @return Whether the error field is set. + */ + @java.lang.Override + public boolean hasError() { + return responseCase_ == 2; + } + + /** + * + * + *
        +     * The error that will be returned by the server. If this code is specified
        +     * to be the OK rpc code, an empty response will be returned.
        +     * 
        + * + * .google.rpc.Status error = 2; + * + * @return The error. + */ + @java.lang.Override + public com.google.rpc.Status getError() { + if (errorBuilder_ == null) { + if (responseCase_ == 2) { + return (com.google.rpc.Status) response_; + } + return com.google.rpc.Status.getDefaultInstance(); + } else { + if (responseCase_ == 2) { + return errorBuilder_.getMessage(); + } + return com.google.rpc.Status.getDefaultInstance(); + } + } + + /** + * + * + *
        +     * The error that will be returned by the server. If this code is specified
        +     * to be the OK rpc code, an empty response will be returned.
        +     * 
        + * + * .google.rpc.Status error = 2; + */ + public Builder setError(com.google.rpc.Status value) { + if (errorBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + response_ = value; + onChanged(); + } else { + errorBuilder_.setMessage(value); + } + responseCase_ = 2; + return this; + } + + /** + * + * + *
        +     * The error that will be returned by the server. If this code is specified
        +     * to be the OK rpc code, an empty response will be returned.
        +     * 
        + * + * .google.rpc.Status error = 2; + */ + public Builder setError(com.google.rpc.Status.Builder builderForValue) { + if (errorBuilder_ == null) { + response_ = builderForValue.build(); + onChanged(); + } else { + errorBuilder_.setMessage(builderForValue.build()); + } + responseCase_ = 2; + return this; + } + + /** + * + * + *
        +     * The error that will be returned by the server. If this code is specified
        +     * to be the OK rpc code, an empty response will be returned.
        +     * 
        + * + * .google.rpc.Status error = 2; + */ + public Builder mergeError(com.google.rpc.Status value) { + if (errorBuilder_ == null) { + if (responseCase_ == 2 && response_ != com.google.rpc.Status.getDefaultInstance()) { + response_ = + com.google.rpc.Status.newBuilder((com.google.rpc.Status) response_) + .mergeFrom(value) + .buildPartial(); + } else { + response_ = value; + } + onChanged(); + } else { + if (responseCase_ == 2) { + errorBuilder_.mergeFrom(value); + } else { + errorBuilder_.setMessage(value); + } + } + responseCase_ = 2; + return this; + } + + /** + * + * + *
        +     * The error that will be returned by the server. If this code is specified
        +     * to be the OK rpc code, an empty response will be returned.
        +     * 
        + * + * .google.rpc.Status error = 2; + */ + public Builder clearError() { + if (errorBuilder_ == null) { + if (responseCase_ == 2) { + responseCase_ = 0; + response_ = null; + onChanged(); + } + } else { + if (responseCase_ == 2) { + responseCase_ = 0; + response_ = null; + } + errorBuilder_.clear(); + } + return this; + } + + /** + * + * + *
        +     * The error that will be returned by the server. If this code is specified
        +     * to be the OK rpc code, an empty response will be returned.
        +     * 
        + * + * .google.rpc.Status error = 2; + */ + public com.google.rpc.Status.Builder getErrorBuilder() { + return getErrorFieldBuilder().getBuilder(); + } + + /** + * + * + *
        +     * The error that will be returned by the server. If this code is specified
        +     * to be the OK rpc code, an empty response will be returned.
        +     * 
        + * + * .google.rpc.Status error = 2; + */ + @java.lang.Override + public com.google.rpc.StatusOrBuilder getErrorOrBuilder() { + if ((responseCase_ == 2) && (errorBuilder_ != null)) { + return errorBuilder_.getMessageOrBuilder(); + } else { + if (responseCase_ == 2) { + return (com.google.rpc.Status) response_; + } + return com.google.rpc.Status.getDefaultInstance(); + } + } + + /** + * + * + *
        +     * The error that will be returned by the server. If this code is specified
        +     * to be the OK rpc code, an empty response will be returned.
        +     * 
        + * + * .google.rpc.Status error = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.rpc.Status, com.google.rpc.Status.Builder, com.google.rpc.StatusOrBuilder> + getErrorFieldBuilder() { + if (errorBuilder_ == null) { + if (!(responseCase_ == 2)) { + response_ = com.google.rpc.Status.getDefaultInstance(); + } + errorBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.rpc.Status, + com.google.rpc.Status.Builder, + com.google.rpc.StatusOrBuilder>( + (com.google.rpc.Status) response_, getParentForChildren(), isClean()); + response_ = null; + } + responseCase_ = 2; + onChanged(); + ; + return errorBuilder_; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.showcase.v1beta1.WaitResponse, + com.google.showcase.v1beta1.WaitResponse.Builder, + com.google.showcase.v1beta1.WaitResponseOrBuilder> + successBuilder_; + + /** + * + * + *
        +     * The response to be returned on operation completion.
        +     * 
        + * + * .google.showcase.v1beta1.WaitResponse success = 3; + * + * @return Whether the success field is set. + */ + @java.lang.Override + public boolean hasSuccess() { + return responseCase_ == 3; + } + + /** + * + * + *
        +     * The response to be returned on operation completion.
        +     * 
        + * + * .google.showcase.v1beta1.WaitResponse success = 3; + * + * @return The success. + */ + @java.lang.Override + public com.google.showcase.v1beta1.WaitResponse getSuccess() { + if (successBuilder_ == null) { + if (responseCase_ == 3) { + return (com.google.showcase.v1beta1.WaitResponse) response_; + } + return com.google.showcase.v1beta1.WaitResponse.getDefaultInstance(); + } else { + if (responseCase_ == 3) { + return successBuilder_.getMessage(); + } + return com.google.showcase.v1beta1.WaitResponse.getDefaultInstance(); + } + } + + /** + * + * + *
        +     * The response to be returned on operation completion.
        +     * 
        + * + * .google.showcase.v1beta1.WaitResponse success = 3; + */ + public Builder setSuccess(com.google.showcase.v1beta1.WaitResponse value) { + if (successBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + response_ = value; + onChanged(); + } else { + successBuilder_.setMessage(value); + } + responseCase_ = 3; + return this; + } + + /** + * + * + *
        +     * The response to be returned on operation completion.
        +     * 
        + * + * .google.showcase.v1beta1.WaitResponse success = 3; + */ + public Builder setSuccess(com.google.showcase.v1beta1.WaitResponse.Builder builderForValue) { + if (successBuilder_ == null) { + response_ = builderForValue.build(); + onChanged(); + } else { + successBuilder_.setMessage(builderForValue.build()); + } + responseCase_ = 3; + return this; + } + + /** + * + * + *
        +     * The response to be returned on operation completion.
        +     * 
        + * + * .google.showcase.v1beta1.WaitResponse success = 3; + */ + public Builder mergeSuccess(com.google.showcase.v1beta1.WaitResponse value) { + if (successBuilder_ == null) { + if (responseCase_ == 3 + && response_ != com.google.showcase.v1beta1.WaitResponse.getDefaultInstance()) { + response_ = + com.google.showcase.v1beta1.WaitResponse.newBuilder( + (com.google.showcase.v1beta1.WaitResponse) response_) + .mergeFrom(value) + .buildPartial(); + } else { + response_ = value; + } + onChanged(); + } else { + if (responseCase_ == 3) { + successBuilder_.mergeFrom(value); + } else { + successBuilder_.setMessage(value); + } + } + responseCase_ = 3; + return this; + } + + /** + * + * + *
        +     * The response to be returned on operation completion.
        +     * 
        + * + * .google.showcase.v1beta1.WaitResponse success = 3; + */ + public Builder clearSuccess() { + if (successBuilder_ == null) { + if (responseCase_ == 3) { + responseCase_ = 0; + response_ = null; + onChanged(); + } + } else { + if (responseCase_ == 3) { + responseCase_ = 0; + response_ = null; + } + successBuilder_.clear(); + } + return this; + } + + /** + * + * + *
        +     * The response to be returned on operation completion.
        +     * 
        + * + * .google.showcase.v1beta1.WaitResponse success = 3; + */ + public com.google.showcase.v1beta1.WaitResponse.Builder getSuccessBuilder() { + return getSuccessFieldBuilder().getBuilder(); + } + + /** + * + * + *
        +     * The response to be returned on operation completion.
        +     * 
        + * + * .google.showcase.v1beta1.WaitResponse success = 3; + */ + @java.lang.Override + public com.google.showcase.v1beta1.WaitResponseOrBuilder getSuccessOrBuilder() { + if ((responseCase_ == 3) && (successBuilder_ != null)) { + return successBuilder_.getMessageOrBuilder(); + } else { + if (responseCase_ == 3) { + return (com.google.showcase.v1beta1.WaitResponse) response_; + } + return com.google.showcase.v1beta1.WaitResponse.getDefaultInstance(); + } + } + + /** + * + * + *
        +     * The response to be returned on operation completion.
        +     * 
        + * + * .google.showcase.v1beta1.WaitResponse success = 3; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.showcase.v1beta1.WaitResponse, + com.google.showcase.v1beta1.WaitResponse.Builder, + com.google.showcase.v1beta1.WaitResponseOrBuilder> + getSuccessFieldBuilder() { + if (successBuilder_ == null) { + if (!(responseCase_ == 3)) { + response_ = com.google.showcase.v1beta1.WaitResponse.getDefaultInstance(); + } + successBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.showcase.v1beta1.WaitResponse, + com.google.showcase.v1beta1.WaitResponse.Builder, + com.google.showcase.v1beta1.WaitResponseOrBuilder>( + (com.google.showcase.v1beta1.WaitResponse) response_, + getParentForChildren(), + isClean()); + response_ = null; + } + responseCase_ = 3; + onChanged(); + ; + return successBuilder_; + } + + @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.showcase.v1beta1.WaitRequest) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.WaitRequest) + private static final com.google.showcase.v1beta1.WaitRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.WaitRequest(); + } + + public static com.google.showcase.v1beta1.WaitRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public WaitRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new WaitRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.showcase.v1beta1.WaitRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/WaitRequestOrBuilder.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/WaitRequestOrBuilder.java new file mode 100644 index 0000000000..73e72c4ebb --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/WaitRequestOrBuilder.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: schema/google/showcase/v1beta1/echo.proto + +package com.google.showcase.v1beta1; + +public interface WaitRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.WaitRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
        +   * The time that this operation will complete.
        +   * 
        + * + * .google.protobuf.Timestamp end_time = 1; + * + * @return Whether the endTime field is set. + */ + boolean hasEndTime(); + + /** + * + * + *
        +   * The time that this operation will complete.
        +   * 
        + * + * .google.protobuf.Timestamp end_time = 1; + * + * @return The endTime. + */ + com.google.protobuf.Timestamp getEndTime(); + + /** + * + * + *
        +   * The time that this operation will complete.
        +   * 
        + * + * .google.protobuf.Timestamp end_time = 1; + */ + com.google.protobuf.TimestampOrBuilder getEndTimeOrBuilder(); + + /** + * + * + *
        +   * The duration of this operation.
        +   * 
        + * + * .google.protobuf.Duration ttl = 4; + * + * @return Whether the ttl field is set. + */ + boolean hasTtl(); + + /** + * + * + *
        +   * The duration of this operation.
        +   * 
        + * + * .google.protobuf.Duration ttl = 4; + * + * @return The ttl. + */ + com.google.protobuf.Duration getTtl(); + + /** + * + * + *
        +   * The duration of this operation.
        +   * 
        + * + * .google.protobuf.Duration ttl = 4; + */ + com.google.protobuf.DurationOrBuilder getTtlOrBuilder(); + + /** + * + * + *
        +   * The error that will be returned by the server. If this code is specified
        +   * to be the OK rpc code, an empty response will be returned.
        +   * 
        + * + * .google.rpc.Status error = 2; + * + * @return Whether the error field is set. + */ + boolean hasError(); + + /** + * + * + *
        +   * The error that will be returned by the server. If this code is specified
        +   * to be the OK rpc code, an empty response will be returned.
        +   * 
        + * + * .google.rpc.Status error = 2; + * + * @return The error. + */ + com.google.rpc.Status getError(); + + /** + * + * + *
        +   * The error that will be returned by the server. If this code is specified
        +   * to be the OK rpc code, an empty response will be returned.
        +   * 
        + * + * .google.rpc.Status error = 2; + */ + com.google.rpc.StatusOrBuilder getErrorOrBuilder(); + + /** + * + * + *
        +   * The response to be returned on operation completion.
        +   * 
        + * + * .google.showcase.v1beta1.WaitResponse success = 3; + * + * @return Whether the success field is set. + */ + boolean hasSuccess(); + + /** + * + * + *
        +   * The response to be returned on operation completion.
        +   * 
        + * + * .google.showcase.v1beta1.WaitResponse success = 3; + * + * @return The success. + */ + com.google.showcase.v1beta1.WaitResponse getSuccess(); + + /** + * + * + *
        +   * The response to be returned on operation completion.
        +   * 
        + * + * .google.showcase.v1beta1.WaitResponse success = 3; + */ + com.google.showcase.v1beta1.WaitResponseOrBuilder getSuccessOrBuilder(); + + public com.google.showcase.v1beta1.WaitRequest.EndCase getEndCase(); + + public com.google.showcase.v1beta1.WaitRequest.ResponseCase getResponseCase(); +} diff --git a/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/WaitResponse.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/WaitResponse.java new file mode 100644 index 0000000000..a644f0d3af --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/WaitResponse.java @@ -0,0 +1,644 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/echo.proto + +package com.google.showcase.v1beta1; + +/** + * + * + *
        + * The result of the Wait operation.
        + * 
        + * + * Protobuf type {@code google.showcase.v1beta1.WaitResponse} + */ +public final class WaitResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.WaitResponse) + WaitResponseOrBuilder { + private static final long serialVersionUID = 0L; + + // Use WaitResponse.newBuilder() to construct. + private WaitResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private WaitResponse() { + content_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new WaitResponse(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private WaitResponse( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + content_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.EchoOuterClass + .internal_static_google_showcase_v1beta1_WaitResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.EchoOuterClass + .internal_static_google_showcase_v1beta1_WaitResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.WaitResponse.class, + com.google.showcase.v1beta1.WaitResponse.Builder.class); + } + + public static final int CONTENT_FIELD_NUMBER = 1; + private volatile java.lang.Object content_; + + /** + * + * + *
        +   * This content of the result.
        +   * 
        + * + * string content = 1; + * + * @return The content. + */ + @java.lang.Override + public java.lang.String getContent() { + java.lang.Object ref = content_; + 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(); + content_ = s; + return s; + } + } + + /** + * + * + *
        +   * This content of the result.
        +   * 
        + * + * string content = 1; + * + * @return The bytes for content. + */ + @java.lang.Override + public com.google.protobuf.ByteString getContentBytes() { + java.lang.Object ref = content_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + content_ = 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(content_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, content_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(content_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, content_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.showcase.v1beta1.WaitResponse)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.WaitResponse other = (com.google.showcase.v1beta1.WaitResponse) obj; + + if (!getContent().equals(other.getContent())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + CONTENT_FIELD_NUMBER; + hash = (53 * hash) + getContent().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.showcase.v1beta1.WaitResponse parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.WaitResponse parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.WaitResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.WaitResponse 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.showcase.v1beta1.WaitResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.WaitResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.WaitResponse parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.WaitResponse 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.showcase.v1beta1.WaitResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.WaitResponse 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.showcase.v1beta1.WaitResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.WaitResponse 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.showcase.v1beta1.WaitResponse 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 result of the Wait operation.
        +   * 
        + * + * Protobuf type {@code google.showcase.v1beta1.WaitResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.WaitResponse) + com.google.showcase.v1beta1.WaitResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.EchoOuterClass + .internal_static_google_showcase_v1beta1_WaitResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.EchoOuterClass + .internal_static_google_showcase_v1beta1_WaitResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.WaitResponse.class, + com.google.showcase.v1beta1.WaitResponse.Builder.class); + } + + // Construct using com.google.showcase.v1beta1.WaitResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + content_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.showcase.v1beta1.EchoOuterClass + .internal_static_google_showcase_v1beta1_WaitResponse_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.WaitResponse getDefaultInstanceForType() { + return com.google.showcase.v1beta1.WaitResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.WaitResponse build() { + com.google.showcase.v1beta1.WaitResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.WaitResponse buildPartial() { + com.google.showcase.v1beta1.WaitResponse result = + new com.google.showcase.v1beta1.WaitResponse(this); + result.content_ = content_; + 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.showcase.v1beta1.WaitResponse) { + return mergeFrom((com.google.showcase.v1beta1.WaitResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.showcase.v1beta1.WaitResponse other) { + if (other == com.google.showcase.v1beta1.WaitResponse.getDefaultInstance()) return this; + if (!other.getContent().isEmpty()) { + content_ = other.content_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.showcase.v1beta1.WaitResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.showcase.v1beta1.WaitResponse) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object content_ = ""; + + /** + * + * + *
        +     * This content of the result.
        +     * 
        + * + * string content = 1; + * + * @return The content. + */ + public java.lang.String getContent() { + java.lang.Object ref = content_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + content_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
        +     * This content of the result.
        +     * 
        + * + * string content = 1; + * + * @return The bytes for content. + */ + public com.google.protobuf.ByteString getContentBytes() { + java.lang.Object ref = content_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + content_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
        +     * This content of the result.
        +     * 
        + * + * string content = 1; + * + * @param value The content to set. + * @return This builder for chaining. + */ + public Builder setContent(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + content_ = value; + onChanged(); + return this; + } + + /** + * + * + *
        +     * This content of the result.
        +     * 
        + * + * string content = 1; + * + * @return This builder for chaining. + */ + public Builder clearContent() { + + content_ = getDefaultInstance().getContent(); + onChanged(); + return this; + } + + /** + * + * + *
        +     * This content of the result.
        +     * 
        + * + * string content = 1; + * + * @param value The bytes for content to set. + * @return This builder for chaining. + */ + public Builder setContentBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + content_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.showcase.v1beta1.WaitResponse) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.WaitResponse) + private static final com.google.showcase.v1beta1.WaitResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.WaitResponse(); + } + + public static com.google.showcase.v1beta1.WaitResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public WaitResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new WaitResponse(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.showcase.v1beta1.WaitResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/WaitResponseOrBuilder.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/WaitResponseOrBuilder.java new file mode 100644 index 0000000000..afc03cac94 --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/WaitResponseOrBuilder.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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/echo.proto + +package com.google.showcase.v1beta1; + +public interface WaitResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.WaitResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
        +   * This content of the result.
        +   * 
        + * + * string content = 1; + * + * @return The content. + */ + java.lang.String getContent(); + + /** + * + * + *
        +   * This content of the result.
        +   * 
        + * + * string content = 1; + * + * @return The bytes for content. + */ + com.google.protobuf.ByteString getContentBytes(); +} diff --git a/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/proto/schema/google/showcase/v1beta1/compliance.proto b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/proto/schema/google/showcase/v1beta1/compliance.proto new file mode 100644 index 0000000000..4e8cba6b25 --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/proto/schema/google/showcase/v1beta1/compliance.proto @@ -0,0 +1,269 @@ +// 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. + +syntax = "proto3"; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; + +package google.showcase.v1beta1; + +option go_package = "github.com/googleapis/gapic-showcase/server/genproto"; +option java_package = "com.google.showcase.v1beta1"; +option java_multiple_files = true; +option ruby_package = "Google::Showcase::V1beta1"; + +// This service is used to test that GAPICs implement various REST-related features correctly. This mostly means transcoding proto3 requests to REST format +// correctly for various types of HTTP annotations, but it also includes verifying that unknown (numeric) enums received by clients can be round-tripped +// correctly. +service Compliance { + // This service is meant to only run locally on the port 7469 (keypad digits + // for "show"). + option (google.api.default_host) = "localhost:7469"; + + // This method echoes the ComplianceData request. This method exercises + // sending the entire request object in the REST body. + rpc RepeatDataBody(RepeatRequest) returns (RepeatResponse) { + option (google.api.http) = { + post: "/v1beta1/repeat:body" + body: "*" + }; + } + + // This method echoes the ComplianceData request. This method exercises + // sending the a message-type field in the REST body. Per AIP-127, only + // top-level, non-repeated fields can be sent this way. + rpc RepeatDataBodyInfo(RepeatRequest) returns (RepeatResponse) { + option (google.api.http) = { + post: "/v1beta1/repeat:bodyinfo" + body: "info" + }; + } + + // This method echoes the ComplianceData request. This method exercises + // sending all request fields as query parameters. + rpc RepeatDataQuery(RepeatRequest) returns (RepeatResponse) { + option (google.api.http) = { + get: "/v1beta1/repeat:query" + }; + } + + // This method echoes the ComplianceData request. This method exercises + // sending some parameters as "simple" path variables (i.e., of the form + // "/bar/{foo}" rather than "/{foo=bar/*}"), and the rest as query parameters. + rpc RepeatDataSimplePath(RepeatRequest) returns (RepeatResponse) { + option (google.api.http) = { + get: "/v1beta1/repeat/{info.f_string}/{info.f_int32}/{info.f_double}/{info.f_bool}/{info.f_kingdom}:simplepath" + }; + } + + // Same as RepeatDataSimplePath, but with a path resource. + rpc RepeatDataPathResource(RepeatRequest) returns (RepeatResponse) { + option (google.api.http) = { + get: "/v1beta1/repeat/{info.f_string=first/*}/{info.f_child.f_string=second/*}/bool/{info.f_bool}:pathresource" + additional_bindings { + get: "/v1beta1/repeat/{info.f_child.f_string=first/*}/{info.f_string=second/*}/bool/{info.f_bool}:childfirstpathresource" + } + }; + } + + // Same as RepeatDataSimplePath, but with a trailing resource. + rpc RepeatDataPathTrailingResource(RepeatRequest) returns (RepeatResponse) { + option (google.api.http) = { + get: "/v1beta1/repeat/{info.f_string=first/*}/{info.f_child.f_string=second/**}:pathtrailingresource" + }; + } + + // This method echoes the ComplianceData request, using the HTTP PUT method. + rpc RepeatDataBodyPut(RepeatRequest) returns (RepeatResponse) { + option (google.api.http) = { + put: "/v1beta1/repeat:bodyput" + body: "*" + }; + } + + // This method echoes the ComplianceData request, using the HTTP PATCH method. + rpc RepeatDataBodyPatch(RepeatRequest) returns (RepeatResponse) { + option (google.api.http) = { + patch: "/v1beta1/repeat:bodypatch" + body: "*" + }; + } + + // This method requests an enum value from the server. Depending on the contents of EnumRequest, the enum value returned will be a known enum declared in the + // .proto file, or a made-up enum value the is unknown to the client. To verify that clients can round-trip unknown enum values they receive, use the + // response from this RPC as the request to VerifyEnum() + // + // The values of enums sent by the server when a known or unknown value is requested will be the same within a single Showcase server run (this is needed for + // VerifyEnum() to work) but are not guaranteed to be the same across separate Showcase server runs. + rpc GetEnum(EnumRequest) returns (EnumResponse) { + option (google.api.http) = { + get: "/v1beta1/compliance/enum" + }; + } + + // This method is used to verify that clients can round-trip enum values, which is particularly important for unknown enum values over REST. VerifyEnum() + // verifies that its request, which is presumably the response that the client previously got to a GetEnum(), contains the correct data. If so, it responds + // with the same EnumResponse; otherwise, the RPC errors. + // + // This works because the values of enums sent by the server when a known or unknown value is requested will be the same within a single Showcase server run, + // although they are not guaranteed to be the same across separate Showcase server runs. + rpc VerifyEnum(EnumResponse) returns (EnumResponse) { + option (google.api.http) = { + post: "/v1beta1/compliance/enum" + }; + } + +} + +message RepeatRequest { + string name = 1; + ComplianceData info = 2; + + // If true, the server will verify that the received request matches + // the request with the same name in the compliance test suite. + bool server_verify = 3; + + // The URI template this request is expected to be bound to server-side. + optional string intended_binding_uri = 10; + + // Some top level fields, to test that these are encoded correctly + // in query params. + int32 f_int32 = 4; + int64 f_int64 = 5; + double f_double = 6; + + optional int32 p_int32 = 7; + optional int64 p_int64 = 8; + optional double p_double = 9; +} + +message RepeatResponse { + RepeatRequest request = 1; + + // The URI template the request was bound to server-side. + string binding_uri = 2; +} + +// ComplianceSuite contains a set of requests that microgenerators should issue +// over REST to the Compliance service to test their gRPC-to-REST transcoding +// implementation. +message ComplianceSuite { + repeated ComplianceGroup group = 1; +} + +// ComplianceGroups encapsulates a group of RPC requests to the Compliance +// server: one request for each combination of elements of `rpcs` and of +// `requests`. +message ComplianceGroup { + string name = 1; + repeated string rpcs = 2; + repeated RepeatRequest requests = 3; +} + +// ComplianceData is a message used for testing REST transcoding of +// different data types. +message ComplianceData { + enum LifeKingdom { + LIFE_KINGDOM_UNSPECIFIED = 0; + ARCHAEBACTERIA = 1; + EUBACTERIA = 2; + PROTISTA = 3; + FUNGI = 4; + PLANTAE = 5; + ANIMALIA = 6; +} + // scalar types + + string f_string = 1; + + int32 f_int32 = 2; + sint32 f_sint32 = 3; + sfixed32 f_sfixed32 = 4; + + uint32 f_uint32 = 5; + fixed32 f_fixed32 = 6; + + int64 f_int64 = 7; + sint64 f_sint64 = 8; + sfixed64 f_sfixed64 = 9; + + uint64 f_uint64 = 10; + fixed64 f_fixed64 = 11; + + double f_double = 12; + float f_float = 13; + + bool f_bool = 14; + + bytes f_bytes = 15; + + LifeKingdom f_kingdom = 22; + + ComplianceDataChild f_child = 16; + + // optional fields + + optional string p_string = 17; + optional int32 p_int32 = 18; + optional double p_double = 19; + optional bool p_bool = 20; + optional LifeKingdom p_kingdom = 23; + optional ComplianceDataChild p_child = 21; +} + +message ComplianceDataChild { + string f_string = 1; + float f_float = 2; + double f_double = 3; + bool f_bool = 4; + Continent f_continent = 11; + ComplianceDataGrandchild f_child = 5; + + optional string p_string = 6; + optional float p_float = 7; + optional double p_double = 8; + optional bool p_bool = 9; + Continent p_continent = 12; + optional ComplianceDataGrandchild p_child = 10; +} + +message ComplianceDataGrandchild { + string f_string = 1; + double f_double = 2; + bool f_bool = 3; +} + +enum Continent { + CONTINENT_UNSPECIFIED = 0; + AFRICA = 1; + AMERICA = 2; + ANTARTICA = 3; + AUSTRALIA = 4; + EUROPE = 5; +} + + +message EnumRequest { + // Whether the client is requesting a new, unknown enum value or a known enum value already declared in this proto file. + bool unknown_enum = 1; +} + +message EnumResponse { + // The original request for a known or unknown enum from the server. + EnumRequest request = 1; + + // The actual enum the server provided. + Continent continent = 2; +} diff --git a/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/proto/schema/google/showcase/v1beta1/echo.proto b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/proto/schema/google/showcase/v1beta1/echo.proto new file mode 100644 index 0000000000..55b7ab578a --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/proto/schema/google/showcase/v1beta1/echo.proto @@ -0,0 +1,424 @@ +// 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 +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT 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"; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/field_info.proto"; +import "google/api/routing.proto"; +import "google/longrunning/operations.proto"; +import "google/protobuf/any.proto"; +import "google/protobuf/duration.proto"; +import "google/protobuf/timestamp.proto"; +import "google/rpc/status.proto"; + +package google.showcase.v1beta1; + +option go_package = "github.com/googleapis/gapic-showcase/server/genproto"; +option java_package = "com.google.showcase.v1beta1"; +option java_multiple_files = true; +option ruby_package = "Google::Showcase::V1beta1"; + +// This service is used showcase the four main types of rpcs - unary, server +// side streaming, client side streaming, and bidirectional streaming. This +// service also exposes methods that explicitly implement server delay, and +// paginated calls. Set the 'showcase-trailer' metadata key on any method +// to have the values echoed in the response trailers. Set the +// 'x-goog-request-params' metadata key on any method to have the values +// echoed in the response headers. +service Echo { + // This service is meant to only run locally on the port 7469 (keypad digits + // for "show"). + option (google.api.default_host) = "localhost:7469"; + // See https://github.com/aip-dev/google.aip.dev/pull/1331 + option (google.api.api_version) = "v1_20240408"; + + // This method simply echoes the request. This method showcases unary RPCs. + rpc Echo(EchoRequest) returns (EchoResponse) { + option (google.api.http) = { + post: "/v1beta1/echo:echo" + body: "*" + }; + option (google.api.routing) = { + routing_parameters{ + field: "header" + } + routing_parameters{ + field: "header" + path_template: "{routing_id=**}" + } + routing_parameters{ + field: "header" + path_template: "{table_name=regions/*/zones/*/**}" + } + routing_parameters{ + field: "header" + path_template: "{super_id=projects/*}/**" + } + routing_parameters{ + field: "header" + path_template: "{table_name=projects/*/instances/*/**}" + } + routing_parameters{ + field: "header" + path_template: "projects/*/{instance_id=instances/*}/**" + } + routing_parameters{ + field: "other_header" + path_template: "{baz=**}" + } + routing_parameters{ + field: "other_header" + path_template: "{qux=projects/*}/**" + } + }; + } + + // This method returns error details in a repeated "google.protobuf.Any" + // field. This method showcases handling errors thus encoded, particularly + // over REST transport. Note that GAPICs only allow the type + // "google.protobuf.Any" for field paths ending in "error.details", and, at + // run-time, the actual types for these fields must be one of the types in + // google/rpc/error_details.proto. + rpc EchoErrorDetails(EchoErrorDetailsRequest) returns (EchoErrorDetailsResponse) { + option (google.api.http) = { + post: "/v1beta1/echo:error-details" + body: "*" + }; + } + + // This method always fails with a gRPC "Aborted" error status that contains + // multiple error details. These include one instance of each of the standard + // ones in error_details.proto + // (https://github.com/googleapis/googleapis/blob/master/google/rpc/error_details.proto) + // plus a custom, Showcase-defined PoetryError. The intent of this RPC is to + // verify that GAPICs can process these various error details and surface them + // to the user in an idiomatic form. + rpc FailEchoWithDetails(FailEchoWithDetailsRequest) returns (FailEchoWithDetailsResponse) { + option (google.api.http) = { + post: "/v1beta1/echo:failWithDetails" + body: "*" + }; + } + + // This method splits the given content into words and will pass each word back + // through the stream. This method showcases server-side streaming RPCs. + rpc Expand(ExpandRequest) returns (stream EchoResponse) { + option (google.api.http) = { + post: "/v1beta1/echo:expand" + body: "*" + }; + // TODO(landrito): change this to be `fields: ["content", "error"]` once + // github.com/dcodeIO/protobuf.js/issues/1094 has been resolved. + option (google.api.method_signature) = "content,error"; + } + + // This method will collect the words given to it. When the stream is closed + // by the client, this method will return the a concatenation of the strings + // passed to it. This method showcases client-side streaming RPCs. + rpc Collect(stream EchoRequest) returns (EchoResponse) { + option (google.api.http) = { + post: "/v1beta1/echo:collect" + body: "*" + }; + } + + // This method, upon receiving a request on the stream, will pass the same + // content back on the stream. This method showcases bidirectional + // streaming RPCs. + rpc Chat(stream EchoRequest) returns (stream EchoResponse); + + // This is similar to the Expand method but instead of returning a stream of + // expanded words, this method returns a paged list of expanded words. + rpc PagedExpand(PagedExpandRequest) returns (PagedExpandResponse) { + option (google.api.http) = { + post: "/v1beta1/echo:pagedExpand" + body: "*" + }; + } + + // This is similar to the PagedExpand except that it uses + // max_results instead of page_size, as some legacy APIs still + // do. New APIs should NOT use this pattern. + rpc PagedExpandLegacy(PagedExpandLegacyRequest) returns (PagedExpandResponse) { + option (google.api.http) = { + post: "/v1beta1/echo:pagedExpandLegacy" + body: "*" + }; + } + + // This method returns a map containing lists of words that appear in the input, keyed by their + // initial character. The only words returned are the ones included in the current page, + // as determined by page_token and page_size, which both refer to the word indices in the + // input. This paging result consisting of a map of lists is a pattern used by some legacy + // APIs. New APIs should NOT use this pattern. + rpc PagedExpandLegacyMapped(PagedExpandRequest) returns (PagedExpandLegacyMappedResponse) { + option (google.api.http) = { + post: "/v1beta1/echo:pagedExpandLegacyMapped" + body: "*" + }; + } + + // This method will wait for the requested amount of time and then return. + // This method showcases how a client handles a request timeout. + rpc Wait(WaitRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1beta1/echo:wait" + body: "*" + }; + option (google.longrunning.operation_info) = { + response_type: "WaitResponse" + metadata_type: "WaitMetadata" + }; + } + + // This method will block (wait) for the requested amount of time + // and then return the response or error. + // This method showcases how a client handles delays or retries. + rpc Block(BlockRequest) returns (BlockResponse) { + option (google.api.http) = { + post: "/v1beta1/echo:block" + body: "*" + }; + }; +} + +// A severity enum used to test enum capabilities in GAPIC surfaces. +enum Severity { + UNNECESSARY = 0; + NECESSARY = 1; + URGENT = 2; + CRITICAL = 3; +} + + +// The request message used for the Echo, Collect and Chat methods. +// If content or opt are set in this message then the request will succeed. +// If status is set in this message then the status will be returned as an +// error. +message EchoRequest { + oneof response { + // The content to be echoed by the server. + string content = 1; + + // The error to be thrown by the server. + google.rpc.Status error = 2; + } + + // The severity to be echoed by the server. + Severity severity = 3; + + // Optional. This field can be set to test the routing annotation on the Echo method. + string header = 4; + + // Optional. This field can be set to test the routing annotation on the Echo method. + string other_header = 5; + + // To facilitate testing of https://google.aip.dev/client-libraries/4235 + string request_id = 7 [ + (google.api.field_info).format = UUID4 + ]; + + // To facilitate testing of https://google.aip.dev/client-libraries/4235 + optional string other_request_id = 8 [ + (google.api.field_info).format = UUID4 + ]; +} + +// The response message for the Echo methods. +message EchoResponse { + // The content specified in the request. + string content = 1; + + // The severity specified in the request. + Severity severity = 2; + + // The request ID specified or autopopulated in the request. + string request_id = 3; + + // The other request ID specified or autopopulated in the request. + string other_request_id = 4; +} + +// The request message used for the EchoErrorDetails method. +message EchoErrorDetailsRequest { + // Content to return in a singular `*.error.details` field of type + // `google.protobuf.Any` + string single_detail_text = 1; + + // Content to return in a repeated `*.error.details` field of type + // `google.protobuf.Any` + repeated string multi_detail_text = 2; +} + +// The response message used for the EchoErrorDetails method. +message EchoErrorDetailsResponse { + + message SingleDetail { + ErrorWithSingleDetail error = 1; + } + + message MultipleDetails { + ErrorWithMultipleDetails error = 1; + } + + SingleDetail single_detail = 1; + MultipleDetails multiple_details = 2; +} + +message ErrorWithSingleDetail { + google.protobuf.Any details = 1; +} + +message ErrorWithMultipleDetails { + repeated google.protobuf.Any details = 1; +} + +// The custom error detail to be included in the error response from the +// FailEchoWithDetails method. Client libraries should be able to +// surface this custom error detail. +message PoetryError { + string poem = 1; +} + +// The request message used for the FailEchoWithDetails method. +message FailEchoWithDetailsRequest { + // Optional message to echo back in the PoetryError. If empty, a value will be + // provided. + string message = 1; +} + +// The response message declared (but never used) for the FailEchoWithDetails +// method. +message FailEchoWithDetailsResponse {} + +// The request message for the Expand method. +message ExpandRequest { + // The content that will be split into words and returned on the stream. + string content = 1; + + // The error that is thrown after all words are sent on the stream. + google.rpc.Status error = 2; + + //The wait time between each server streaming messages + google.protobuf.Duration stream_wait_time = 3; +} + +// The request for the PagedExpand method. +message PagedExpandRequest { + // The string to expand. + string content = 1 [(google.api.field_behavior) = REQUIRED]; + + // The number of words to returned in each page. + int32 page_size = 2; + + // The position of the page to be returned. + string page_token = 3; +} + +// The request for the PagedExpandLegacy method. This is a pattern used by some legacy APIs. New +// APIs should NOT use this pattern, but rather something like PagedExpandRequest which conforms to +// aip.dev/158. +message PagedExpandLegacyRequest { + // The string to expand. + string content = 1 [(google.api.field_behavior) = REQUIRED]; + + // The number of words to returned in each page. + // (-- aip.dev/not-precedent: This is a legacy, non-standard pattern that + // violates aip.dev/158. Ordinarily, this should be page_size. --) + int32 max_results = 2; + + // The position of the page to be returned. + string page_token = 3; +} + +// The response for the PagedExpand method. +message PagedExpandResponse { + // The words that were expanded. + repeated EchoResponse responses = 1; + + // The next page token. + string next_page_token = 2; +} + +// A list of words. +message PagedExpandResponseList { + repeated string words = 1; +} + +message PagedExpandLegacyMappedResponse { + // The words that were expanded, indexed by their initial character. + // (-- aip.dev/not-precedent: This is a legacy, non-standard pattern that violates + // aip.dev/158. Ordinarily, this should be a `repeated` field, as in PagedExpandResponse. --) + map alphabetized = 1; + + // The next page token. + string next_page_token = 2; +} + +// The request for Wait method. +message WaitRequest { + oneof end { + // The time that this operation will complete. + google.protobuf.Timestamp end_time = 1; + + // The duration of this operation. + google.protobuf.Duration ttl = 4; + } + + oneof response { + // The error that will be returned by the server. If this code is specified + // to be the OK rpc code, an empty response will be returned. + google.rpc.Status error = 2; + + // The response to be returned on operation completion. + WaitResponse success = 3; + } +} + +// The result of the Wait operation. +message WaitResponse { + // This content of the result. + string content = 1; +} + +// The metadata for Wait operation. +message WaitMetadata { + // The time that this operation will complete. + google.protobuf.Timestamp end_time =1; +} + +// The request for Block method. +message BlockRequest { + // The amount of time to block before returning a response. + google.protobuf.Duration response_delay = 1; + + oneof response { + // The error that will be returned by the server. If this code is specified + // to be the OK rpc code, an empty response will be returned. + google.rpc.Status error = 2; + + // The response to be returned that will signify successful method call. + BlockResponse success = 3; + } +} + +// The response for Block method. +message BlockResponse { + // This content can contain anything, the server will not depend on a value + // here. + string content = 1; +} diff --git a/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/proto/schema/google/showcase/v1beta1/identity.proto b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/proto/schema/google/showcase/v1beta1/identity.proto new file mode 100644 index 0000000000..569c604d78 --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/proto/schema/google/showcase/v1beta1/identity.proto @@ -0,0 +1,186 @@ +// 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 +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT 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"; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/protobuf/empty.proto"; +import "google/protobuf/field_mask.proto"; +import "google/protobuf/timestamp.proto"; + +package google.showcase.v1beta1; + +option go_package = "github.com/googleapis/gapic-showcase/server/genproto"; +option java_package = "com.google.showcase.v1beta1"; +option java_multiple_files = true; +option ruby_package = "Google::Showcase::V1beta1"; + +// A simple identity service. +service Identity { + // This service is meant to only run locally on the port 7469 (keypad digits + // for "show"). + option (google.api.default_host) = "localhost:7469"; + + // Creates a user. + rpc CreateUser(CreateUserRequest) returns (User) { + option (google.api.http) = { + post: "/v1beta1/users" + body: "*" + }; + option (google.api.method_signature) = "user.display_name,user.email"; + option (google.api.method_signature) = + "user.display_name,user.email,user.age,user.nickname,user.enable_notifications,user.height_feet"; + } + + // Retrieves the User with the given uri. + rpc GetUser(GetUserRequest) returns (User) { + option (google.api.http) = { + get: "/v1beta1/{name=users/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Updates a user. + rpc UpdateUser(UpdateUserRequest) returns (User) { + option (google.api.http) = { + patch: "/v1beta1/{user.name=users/*}" + body: "user" + }; + } + + // Deletes a user, their profile, and all of their authored messages. + rpc DeleteUser(DeleteUserRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v1beta1/{name=users/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Lists all users. + rpc ListUsers(ListUsersRequest) returns (ListUsersResponse) { + option (google.api.http) = { + get: "/v1beta1/users" + }; + } +} + +// A user. +message User { + option (google.api.resource) = { + type: "showcase.googleapis.com/User" + pattern: "users/{user}" + }; + + // The resource name of the user. + string name = 1; + + // The display_name of the user. + string display_name = 2 [(google.api.field_behavior) = REQUIRED]; + + // The email address of the user. + string email = 3 [(google.api.field_behavior) = REQUIRED]; + + // The timestamp at which the user was created. + google.protobuf.Timestamp create_time = 4 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // The latest timestamp at which the user was updated. + google.protobuf.Timestamp update_time = 5 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // The age of the user in years. + optional int32 age = 6; + + // The height of the user in feet. + optional double height_feet = 7; + + // The nickname of the user. + // + // (-- aip.dev/not-precedent: An empty string is a valid nickname. + // Ordinarily, proto3_optional should not be used on a `string` field. --) + optional string nickname = 8; + + // Enables the receiving of notifications. The default is true if unset. + // + // (-- aip.dev/not-precedent: The default for the feature is true. + // Ordinarily, the default for a `bool` field should be false. --) + optional bool enable_notifications = 9; +} + +// The request message for the google.showcase.v1beta1.Identity\CreateUser +// method. +message CreateUserRequest { + // The user to create. + User user = 1; +} + +// The request message for the google.showcase.v1beta1.Identity\GetUser +// method. +message GetUserRequest { + // The resource name of the requested user. + string name = 1 [ + (google.api.resource_reference).type = "showcase.googleapis.com/User", + (google.api.field_behavior) = REQUIRED + ]; +} + +// The request message for the google.showcase.v1beta1.Identity\UpdateUser +// method. +message UpdateUserRequest { + // The user to update. + User user = 1; + + // The field mask to determine which fields are to be updated. If empty, the + // server will assume all fields are to be updated. + google.protobuf.FieldMask update_mask = 2; +} + +// The request message for the google.showcase.v1beta1.Identity\DeleteUser +// method. +message DeleteUserRequest { + // The resource name of the user to delete. + string name = 1 [ + (google.api.resource_reference).type = "showcase.googleapis.com/User", + (google.api.field_behavior) = REQUIRED + ]; +} + +// The request message for the google.showcase.v1beta1.Identity\ListUsers +// method. +message ListUsersRequest { + // The maximum number of users to return. Server may return fewer users + // than requested. If unspecified, server will pick an appropriate default. + int32 page_size = 1; + + // The value of google.showcase.v1beta1.ListUsersResponse.next_page_token + // returned from the previous call to + // `google.showcase.v1beta1.Identity\ListUsers` method. + string page_token = 2; +} + +// The response message for the google.showcase.v1beta1.Identity\ListUsers +// method. +message ListUsersResponse { + // The list of users. + repeated User users = 1; + + // A token to retrieve next page of results. + // Pass this value in ListUsersRequest.page_token field in the subsequent + // call to `google.showcase.v1beta1.Message\ListUsers` method to retrieve the + // next page of results. + string next_page_token = 2; +} diff --git a/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/proto/schema/google/showcase/v1beta1/messaging.proto b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/proto/schema/google/showcase/v1beta1/messaging.proto new file mode 100644 index 0000000000..330dc8c9e7 --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/proto/schema/google/showcase/v1beta1/messaging.proto @@ -0,0 +1,520 @@ +// 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 +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT 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"; + +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"; +import "google/rpc/error_details.proto"; + +package google.showcase.v1beta1; + +option go_package = "github.com/googleapis/gapic-showcase/server/genproto"; +option java_package = "com.google.showcase.v1beta1"; +option java_multiple_files = true; +option ruby_package = "Google::Showcase::V1beta1"; + +// A simple messaging service that implements chat rooms and profile posts. +// +// This messaging service showcases the features that API clients +// generated by gapic-generators implement. +service Messaging { + // This service is meant to only run locally on the port 7469 (keypad digits + // for "show"). + option (google.api.default_host) = "localhost:7469"; + + // Creates a room. + rpc CreateRoom(CreateRoomRequest) returns (Room) { + option (google.api.http) = { + post: "/v1beta1/rooms" + body: "*" + }; + option (google.api.method_signature) = "room.display_name,room.description"; + } + + // Retrieves the Room with the given resource name. + rpc GetRoom(GetRoomRequest) returns (Room) { + option (google.api.http) = { + get: "/v1beta1/{name=rooms/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Updates a room. + rpc UpdateRoom(UpdateRoomRequest) returns (Room) { + option (google.api.http) = { + patch: "/v1beta1/{room.name=rooms/*}" + body: "room" + }; + } + + // Deletes a room and all of its blurbs. + rpc DeleteRoom(DeleteRoomRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v1beta1/{name=rooms/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Lists all chat rooms. + rpc ListRooms(ListRoomsRequest) returns (ListRoomsResponse) { + option (google.api.http) = { + get: "/v1beta1/rooms" + }; + } + + // Creates a blurb. If the parent is a room, the blurb is understood to be a + // message in that room. If the parent is a profile, the blurb is understood + // to be a post on the profile. + rpc CreateBlurb(CreateBlurbRequest) returns (Blurb) { + option (google.api.http) = { + post: "/v1beta1/{parent=rooms/*}/blurbs" + body: "*" + additional_bindings: { + post: "/v1beta1/{parent=users/*/profile}/blurbs" + body: "*" + } + }; + option (google.api.method_signature) = "parent,blurb.user,blurb.text"; + option (google.api.method_signature) = "parent,blurb.user,blurb.image"; + } + + // Retrieves the Blurb with the given resource name. + rpc GetBlurb(GetBlurbRequest) returns (Blurb) { + option (google.api.http) = { + get: "/v1beta1/{name=rooms/*/blurbs/*}" + additional_bindings: { get: "/v1beta1/{name=users/*/profile/blurbs/*}" } + }; + option (google.api.method_signature) = "name"; + } + + // Updates a blurb. + rpc UpdateBlurb(UpdateBlurbRequest) returns (Blurb) { + option (google.api.http) = { + patch: "/v1beta1/{blurb.name=rooms/*/blurbs/*}" + body: "blurb" + additional_bindings: { + patch: "/v1beta1/{blurb.name=users/*/profile/blurbs/*}" + body: "blurb" + } + }; + } + + // Deletes a blurb. + rpc DeleteBlurb(DeleteBlurbRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v1beta1/{name=rooms/*/blurbs/*}" + additional_bindings: { + delete: "/v1beta1/{name=users/*/profile/blurbs/*}" + } + }; + option (google.api.method_signature) = "name"; + } + + // Lists blurbs for a specific chat room or user profile depending on the + // parent resource name. + rpc ListBlurbs(ListBlurbsRequest) returns (ListBlurbsResponse) { + option (google.api.http) = { + get: "/v1beta1/{parent=rooms/*}/blurbs" + additional_bindings: { get: "/v1beta1/{parent=users/*/profile}/blurbs" } + }; + option (google.api.method_signature) = "parent"; + } + + // This method searches through all blurbs across all rooms and profiles + // for blurbs containing to words found in the query. Only posts that + // contain an exact match of a queried word will be returned. + rpc SearchBlurbs(SearchBlurbsRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1beta1/{parent=rooms/*}/blurbs:search" + body: "*" + additional_bindings: { + post: "/v1beta1/{parent=users/*/profile}/blurbs:search" + } + }; + option (google.longrunning.operation_info) = { + response_type: "SearchBlurbsResponse" + metadata_type: "SearchBlurbsMetadata" + }; + option (google.api.method_signature) = "parent,query"; + } + + // This returns a stream that emits the blurbs that are created for a + // particular chat room or user profile. + rpc StreamBlurbs(StreamBlurbsRequest) returns (stream StreamBlurbsResponse) { + option (google.api.http) = { + post: "/v1beta1/{name=rooms/*}/blurbs:stream" + body: "*" + additional_bindings: { + post: "/v1beta1/{name=users/*/profile}/blurbs:stream" + body: "*" + } + }; + } + + // This is a stream to create multiple blurbs. If an invalid blurb is + // requested to be created, the stream will close with an error. + rpc SendBlurbs(stream CreateBlurbRequest) returns (SendBlurbsResponse) { + option (google.api.http) = { + post: "/v1beta1/{parent=rooms/*}/blurbs:send" + body: "*" + additional_bindings: { + post: "/v1beta1/{parent=users/*/profile}/blurbs:send" + body: "*" + } + }; + } + + // This method starts a bidirectional stream that receives all blurbs that + // are being created after the stream has started and sends requests to create + // blurbs. If an invalid blurb is requested to be created, the stream will + // close with an error. + rpc Connect(stream ConnectRequest) returns (stream StreamBlurbsResponse); +} + +// A chat room. +message Room { + option (google.api.resource) = { + type: "showcase.googleapis.com/Room" + pattern: "rooms/{room}" + }; + + // The resource name of the chat room. + string name = 1; + + // The human readable name of the chat room. + string display_name = 2 [(google.api.field_behavior) = REQUIRED]; + + // The description of the chat room. + string description = 3; + + // The timestamp at which the room was created. + google.protobuf.Timestamp create_time = 4 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // The latest timestamp at which the room was updated. + google.protobuf.Timestamp update_time = 5 + [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// The request message for the google.showcase.v1beta1.Messaging\CreateRoom +// method. +message CreateRoomRequest { + // The room to create. + Room room = 1; +} + +// The request message for the google.showcase.v1beta1.Messaging\GetRoom +// method. +message GetRoomRequest { + // The resource name of the requested room. + string name = 1 [ + (google.api.resource_reference).type = "showcase.googleapis.com/Room", + (google.api.field_behavior) = REQUIRED + ]; +} + +// The request message for the google.showcase.v1beta1.Messaging\UpdateRoom +// method. +message UpdateRoomRequest { + // The room to update. + Room room = 1; + + // The field mask to determine which fields are to be updated. If empty, the + // server will assume all fields are to be updated. + google.protobuf.FieldMask update_mask = 2; +} + +// The request message for the google.showcase.v1beta1.Messaging\DeleteRoom +// method. +message DeleteRoomRequest { + // The resource name of the requested room. + string name = 1 [ + (google.api.resource_reference).type = "showcase.googleapis.com/Room", + (google.api.field_behavior) = REQUIRED + ]; +} + +// The request message for the google.showcase.v1beta1.Messaging\ListRooms +// method. +message ListRoomsRequest { + // The maximum number of rooms return. Server may return fewer rooms + // than requested. If unspecified, server will pick an appropriate default. + int32 page_size = 1; + + // The value of google.showcase.v1beta1.ListRoomsResponse.next_page_token + // returned from the previous call to + // `google.showcase.v1beta1.Messaging\ListRooms` method. + string page_token = 2; +} + +// The response message for the google.showcase.v1beta1.Messaging\ListRooms +// method. +message ListRoomsResponse { + // The list of rooms. + repeated Room rooms = 1; + + // A token to retrieve next page of results. + // Pass this value in ListRoomsRequest.page_token field in the subsequent + // call to `google.showcase.v1beta1.Messaging\ListRooms` method to retrieve + // the next page of results. + string next_page_token = 2; +} + +// This protocol buffer message represents a blurb sent to a chat room or +// posted on a user profile. +message Blurb { + option (google.api.resource) = { + type: "showcase.googleapis.com/Blurb" + pattern: "users/{user}/profile/blurbs/legacy/{legacy_user}~{blurb}" + pattern: "users/{user}/profile/blurbs/{blurb}" + pattern: "rooms/{room}/blurbs/{blurb}" + pattern: "rooms/{room}/blurbs/legacy/{legacy_room}.{blurb}" + }; + + // The resource name of the chat room. + string name = 1; + + // The resource name of the blurb's author. + string user = 2 [ + (google.api.resource_reference).type = "showcase.googleapis.com/User", + (google.api.field_behavior) = REQUIRED + ]; + + oneof content { + // The textual content of this blurb. + string text = 3; + + // The image content of this blurb. + bytes image = 4; + } + + // The timestamp at which the blurb was created. + google.protobuf.Timestamp create_time = 5 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // The latest timestamp at which the blurb was updated. + google.protobuf.Timestamp update_time = 6 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // (-- aip.dev/not-precedent: This is designed for testing non-slash + // resource patterns. Ordinarily, non-slash separators are discouraged. + // --) + oneof legacy_id { + // The legacy id of the room. This field is used to signal + // the use of the compound resource pattern + // `rooms/{room}/blurbs/legacy/{legacy_room}.{blurb}` + string legacy_room_id = 7; + + // The legacy id of the user. This field is used to signal + // the use of the compound resource pattern + // `users/{user}/profile/blurbs/legacy/{legacy_user}~{blurb}` + string legacy_user_id = 8; + } +} + +// The request message for the google.showcase.v1beta1.Messaging\CreateBlurb +// method. +message CreateBlurbRequest { + // The resource name of the chat room or user profile that this blurb will + // be tied to. + string parent = 1 [ + (google.api.resource_reference).child_type = + "showcase.googleapis.com/Blurb", + (google.api.field_behavior) = REQUIRED + ]; + + // The blurb to create. + Blurb blurb = 2; +} + +// The request message for the google.showcase.v1beta1.Messaging\GetBlurb +// method. +message GetBlurbRequest { + // The resource name of the requested blurb. + string name = 1 [ + (google.api.resource_reference).type = "showcase.googleapis.com/Blurb", + (google.api.field_behavior) = REQUIRED + ]; +} + +// The request message for the google.showcase.v1beta1.Messaging\UpdateBlurb +// method. +message UpdateBlurbRequest { + // The blurb to update. + Blurb blurb = 1; + + // The field mask to determine which fields are to be updated. If empty, the + // server will assume all fields are to be updated. + google.protobuf.FieldMask update_mask = 2; +} + +// The request message for the google.showcase.v1beta1.Messaging\DeleteBlurb +// method. +message DeleteBlurbRequest { + // The resource name of the requested blurb. + string name = 1 [ + (google.api.resource_reference).type = "showcase.googleapis.com/Blurb", + (google.api.field_behavior) = REQUIRED + ]; +} + +// The request message for the google.showcase.v1beta1.Messaging\ListBlurbs +// method. +message ListBlurbsRequest { + // The resource name of the requested room or profile who blurbs to list. + string parent = 1 [ + (google.api.resource_reference).child_type = + "showcase.googleapis.com/Blurb", + (google.api.field_behavior) = REQUIRED + ]; + + // The maximum number of blurbs to return. Server may return fewer + // blurbs than requested. If unspecified, server will pick an appropriate + // default. + int32 page_size = 2; + + // The value of google.showcase.v1beta1.ListBlurbsResponse.next_page_token + // returned from the previous call to + // `google.showcase.v1beta1.Messaging\ListBlurbs` method. + string page_token = 3; +} + +// The response message for the google.showcase.v1beta1.Messaging\ListBlurbs +// method. +message ListBlurbsResponse { + // The list of blurbs. + repeated Blurb blurbs = 1; + + // A token to retrieve next page of results. + // Pass this value in ListBlurbsRequest.page_token field in the subsequent + // call to `google.showcase.v1beta1.Blurb\ListBlurbs` method to retrieve + // the next page of results. + string next_page_token = 2; +} + +// The request message for the google.showcase.v1beta1.Messaging\SearchBlurbs +// method. +message SearchBlurbsRequest { + // The query used to search for blurbs containing to words of this string. + // Only posts that contain an exact match of a queried word will be returned. + string query = 1 [(google.api.field_behavior) = REQUIRED]; + + // The rooms or profiles to search. If unset, `SearchBlurbs` will search all + // rooms and all profiles. + string parent = 2 [(google.api.resource_reference).child_type = + "showcase.googleapis.com/Blurb"]; + + // The maximum number of blurbs return. Server may return fewer + // blurbs than requested. If unspecified, server will pick an appropriate + // default. + int32 page_size = 3; + + // The value of + // google.showcase.v1beta1.SearchBlurbsResponse.next_page_token + // returned from the previous call to + // `google.showcase.v1beta1.Messaging\SearchBlurbs` method. + string page_token = 4; +} + +// The operation metadata message for the +// google.showcase.v1beta1.Messaging\SearchBlurbs method. +message SearchBlurbsMetadata { + // This signals to the client when to next poll for response. + google.rpc.RetryInfo retry_info = 1; +} + +// The operation response message for the +// google.showcase.v1beta1.Messaging\SearchBlurbs method. +message SearchBlurbsResponse { + // Blurbs that matched the search query. + repeated Blurb blurbs = 1; + + // A token to retrieve next page of results. + // Pass this value in SearchBlurbsRequest.page_token field in the subsequent + // call to `google.showcase.v1beta1.Blurb\SearchBlurbs` method to + // retrieve the next page of results. + string next_page_token = 2; +} + +// The request message for the google.showcase.v1beta1.Messaging\StreamBlurbs +// method. +message StreamBlurbsRequest { + // The resource name of a chat room or user profile whose blurbs to stream. + string name = 1 [ + (google.api.resource_reference).child_type = + "showcase.googleapis.com/Blurb", + (google.api.field_behavior) = REQUIRED + ]; + + // The time at which this stream will close. + google.protobuf.Timestamp expire_time = 2 + [(google.api.field_behavior) = REQUIRED]; +} + +// The response message for the google.showcase.v1beta1.Messaging\StreamBlurbs +// method. +message StreamBlurbsResponse { + // The blurb that was either created, updated, or deleted. + Blurb blurb = 1; + + // The action that triggered the blurb to be returned. + enum Action { + ACTION_UNSPECIFIED = 0; + + // Specifies that the blurb was created. + CREATE = 1; + + // Specifies that the blurb was updated. + UPDATE = 2; + + // Specifies that the blurb was deleted. + DELETE = 3; + } + + // The action that triggered the blurb to be returned. + Action action = 2; +} + +// The response message for the google.showcase.v1beta1.Messaging\SendBlurbs +// method. +message SendBlurbsResponse { + // The names of successful blurb creations. + repeated string names = 1; +} + +// The request message for the google.showcase.v1beta1.Messaging\Connect +// method. +message ConnectRequest { + message ConnectConfig { + // The room or profile to follow and create messages for. + string parent = 1 [(google.api.resource_reference).child_type = + "showcase.googleapis.com/Blurb"]; + } + + oneof request { + // Provides information that specifies how to process subsequent requests. + // The first `ConnectRequest` message must contain a `config` message. + ConnectConfig config = 1; + + // The blurb to be created. + Blurb blurb = 2; + } +} diff --git a/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/proto/schema/google/showcase/v1beta1/rest_error.proto b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/proto/schema/google/showcase/v1beta1/rest_error.proto new file mode 100644 index 0000000000..0b4e299597 --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/proto/schema/google/showcase/v1beta1/rest_error.proto @@ -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. + +syntax = "proto3"; + +import "google/protobuf/any.proto"; +import "google/rpc/code.proto"; + +package google.showcase.v1beta1; + +option go_package = "github.com/googleapis/gapic-showcase/server/genproto"; +option java_package = "com.google.showcase.v1beta1"; +option java_multiple_files = true; +option ruby_package = "Google::Showcase::V1beta1"; + +// HTTP/JSON error representation as defined in +// https://google.aip.dev/193#http11json-representation, +message RestError { + message Status { + // The HTTP status code that corresponds to `google.rpc.Status.code`. + int32 code = 1; + // This corresponds to `google.rpc.Status.message`. + string message = 2; + // This is the enum version for `google.rpc.Status.code`. + google.rpc.Code status = 4; + // This corresponds to `google.rpc.Status.details`. + repeated google.protobuf.Any details = 5; + } + + Status error = 1; +} diff --git a/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/proto/schema/google/showcase/v1beta1/sequence.proto b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/proto/schema/google/showcase/v1beta1/sequence.proto new file mode 100644 index 0000000000..a4e3ee28f1 --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/proto/schema/google/showcase/v1beta1/sequence.proto @@ -0,0 +1,260 @@ +// Copyright 2020 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/protobuf/duration.proto"; +import "google/protobuf/empty.proto"; +import "google/protobuf/timestamp.proto"; +import "google/rpc/status.proto"; + +package google.showcase.v1beta1; + +option go_package = "github.com/googleapis/gapic-showcase/server/genproto"; +option java_package = "com.google.showcase.v1beta1"; +option java_multiple_files = true; +option ruby_package = "Google::Showcase::V1beta1"; + +service SequenceService { + // This service is meant to only run locally on the port 7469 (keypad digits + // for "show"). + option (google.api.default_host) = "localhost:7469"; + + // Creates a sequence. + rpc CreateSequence(CreateSequenceRequest) returns (Sequence) { + option (google.api.http) = { + post: "/v1beta1/sequences" + body: "sequence" + }; + option (google.api.method_signature) = "sequence"; + }; + + // Creates a sequence. + rpc CreateStreamingSequence(CreateStreamingSequenceRequest) returns (StreamingSequence) { + option (google.api.http) = { + post: "/v1beta1/streamingSequences" + body: "streaming_sequence" + }; + option (google.api.method_signature) = "streaming_sequence"; + }; + + // Retrieves a sequence. + rpc GetSequenceReport(GetSequenceReportRequest) returns (SequenceReport) { + option (google.api.http) = { + get: "/v1beta1/{name=sequences/*/sequenceReport}" + }; + option (google.api.method_signature) = "name"; + }; + + // Retrieves a sequence. + rpc GetStreamingSequenceReport(GetStreamingSequenceReportRequest) returns (StreamingSequenceReport) { + option (google.api.http) = { + get: "/v1beta1/{name=streamingSequences/*/streamingSequenceReport}" + }; + option (google.api.method_signature) = "name"; + }; + + // Attempts a sequence. + rpc AttemptSequence(AttemptSequenceRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + post: "/v1beta1/{name=sequences/*}" + body: "*" + }; + option (google.api.method_signature) = "name"; + }; + + // Attempts a streaming sequence. + // May not function as expected in HTTP mode due to when http statuses are sent + // See https://github.com/googleapis/gapic-showcase/issues/1377 for more details + rpc AttemptStreamingSequence(AttemptStreamingSequenceRequest) returns (stream AttemptStreamingSequenceResponse) { + option (google.api.http) = { + post: "/v1beta1/{name=streamingSequences/*}:stream" + body: "*" + }; + option (google.api.method_signature) = "name"; + }; +} + +message Sequence { + option (google.api.resource) = { + type: "showcase.googleapis.com/Sequence" + pattern: "sequences/{sequence}" + }; + + string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // A server response to an RPC Attempt in a sequence. + message Response { + // The status to return for an individual attempt. + google.rpc.Status status = 1; + + // The amount of time to delay sending the response. + google.protobuf.Duration delay = 2; + } + + // Sequence of responses to return in order for each attempt. If empty, the + // default response is an immediate OK. + repeated Response responses = 2; +} + +message StreamingSequence { + option (google.api.resource) = { + type: "showcase.googleapis.com/StreamingSequence" + pattern: "streamingSequences/{streaming_sequence}" + }; + + string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // The Content that the stream will send + string content = 2; + + // A server response to an RPC Attempt in a sequence. + message Response { + // The status to return for an individual attempt. + google.rpc.Status status = 1; + + // The amount of time to delay sending the response. + google.protobuf.Duration delay = 2; + + // The index that the status should be sent + int32 response_index = 3; + } + + // Sequence of responses to return in order for each attempt. If empty, the + // default response is an immediate OK. + repeated Response responses = 3; +} + + +message StreamingSequenceReport { + option (google.api.resource) = { + type: "showcase.googleapis.com/StreamingSequenceReport" + pattern: "streamingSequences/{streaming_sequence}/streamingSequenceReport" + }; + + string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Contains metrics on individual RPC Attempts in a sequence. + message Attempt { + // The attempt number - starting at 0. + int32 attempt_number = 1; + + // The deadline dictated by the attempt to the server. + google.protobuf.Timestamp attempt_deadline = 2; + + // The time that the server responded to the RPC attempt. Used for + // calculating attempt_delay. + google.protobuf.Timestamp response_time = 3; + + // The server perceived delay between sending the last response and + // receiving this attempt. Used for validating attempt delay backoff. + google.protobuf.Duration attempt_delay = 4; + + // The status returned to the attempt. + google.rpc.Status status = 5; + + } + + // The set of RPC attempts received by the server for a Sequence. + repeated Attempt attempts = 2; +} + +message SequenceReport { + option (google.api.resource) = { + type: "showcase.googleapis.com/SequenceReport" + pattern: "sequences/{sequence}/sequenceReport" + }; + + string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Contains metrics on individual RPC Attempts in a sequence. + message Attempt { + // The attempt number - starting at 0. + int32 attempt_number = 1; + + // The deadline dictated by the attempt to the server. + google.protobuf.Timestamp attempt_deadline = 2; + + // The time that the server responded to the RPC attempt. Used for + // calculating attempt_delay. + google.protobuf.Timestamp response_time = 3; + + // The server perceived delay between sending the last response and + // receiving this attempt. Used for validating attempt delay backoff. + google.protobuf.Duration attempt_delay = 4; + + // The status returned to the attempt. + google.rpc.Status status = 5; + } + + // The set of RPC attempts received by the server for a Sequence. + repeated Attempt attempts = 2; +} + +message CreateSequenceRequest { + Sequence sequence = 1; +} + +message CreateStreamingSequenceRequest { + StreamingSequence streaming_sequence = 1; +} + +message AttemptSequenceRequest { + string name = 1 [ + (google.api.resource_reference).type = "showcase.googleapis.com/Sequence", + (google.api.field_behavior) = REQUIRED + ]; + +} + +message AttemptStreamingSequenceRequest { + string name = 1 [ + (google.api.resource_reference).type = "showcase.googleapis.com/StreamingSequence", + (google.api.field_behavior) = REQUIRED + ]; + + // used to send the index of the last failed message + // in the string "content" of an AttemptStreamingSequenceResponse + // needed for stream resumption logic testing + int32 last_fail_index = 2 [ + (google.api.field_behavior) = OPTIONAL + ]; +} + +// The response message for the Echo methods. +message AttemptStreamingSequenceResponse { + // The content specified in the request. + string content = 1; + +} + +message GetSequenceReportRequest { + string name = 1 [ + (google.api.resource_reference).type = + "showcase.googleapis.com/SequenceReport", + (google.api.field_behavior) = REQUIRED + ]; +} + +message GetStreamingSequenceReportRequest { + string name = 1 [ + (google.api.resource_reference).type = + "showcase.googleapis.com/StreamingSequenceReport", + (google.api.field_behavior) = REQUIRED + ]; +} diff --git a/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/proto/schema/google/showcase/v1beta1/testing.proto b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/proto/schema/google/showcase/v1beta1/testing.proto new file mode 100644 index 0000000000..be66091074 --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/proto/schema/google/showcase/v1beta1/testing.proto @@ -0,0 +1,392 @@ +// 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 +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT 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"; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/resource.proto"; +import "google/protobuf/empty.proto"; + +package google.showcase.v1beta1; + +option go_package = "github.com/googleapis/gapic-showcase/server/genproto"; +option java_package = "com.google.showcase.v1beta1"; +option java_multiple_files = true; +option ruby_package = "Google::Showcase::V1beta1"; + +// A service to facilitate running discrete sets of tests +// against Showcase. +// Adding this comment with special characters for comment formatting tests: +// 1. (abra->kadabra->alakazam) +// 2) [Nonsense][]: `pokemon/*/psychic/*` +service Testing { + // This service is meant to only run locally on the port 7469 (keypad digits + // for "show"). + option (google.api.default_host) = "localhost:7469"; + + // Creates a new testing session. + // Adding this comment with special characters for comment formatting tests: + // 1. (abra->kadabra->alakazam) + // 2) [Nonsense][]: `pokemon/*/psychic/*` + rpc CreateSession(CreateSessionRequest) returns (Session) { + option (google.api.http) = { + post: "/v1beta1/sessions" + body: "session" + }; + } + + // Gets a testing session. + rpc GetSession(GetSessionRequest) returns (Session) { + option (google.api.http) = { + get: "/v1beta1/{name=sessions/*}" + }; + } + + // Lists the current test sessions. + rpc ListSessions(ListSessionsRequest) returns (ListSessionsResponse) { + option (google.api.http) = { + get: "/v1beta1/sessions" + }; + } + + // Delete a test session. + rpc DeleteSession(DeleteSessionRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v1beta1/{name=sessions/*}" + }; + } + + // Report on the status of a session. + // This generates a report detailing which tests have been completed, + // and an overall rollup. + rpc ReportSession(ReportSessionRequest) returns (ReportSessionResponse) { + option (google.api.http) = { + post: "/v1beta1/{name=sessions/*}:report" + }; + } + + // List the tests of a sessesion. + rpc ListTests(ListTestsRequest) returns (ListTestsResponse) { + option (google.api.http) = { + get: "/v1beta1/{parent=sessions/*}/tests" + }; + } + + // Explicitly decline to implement a test. + // + // This removes the test from subsequent `ListTests` calls, and + // attempting to do the test will error. + // + // This method will error if attempting to delete a required test. + rpc DeleteTest(DeleteTestRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v1beta1/{name=sessions/*/tests/*}" + }; + } + + // Register a response to a test. + // + // In cases where a test involves registering a final answer at the + // end of the test, this method provides the means to do so. + rpc VerifyTest(VerifyTestRequest) returns (VerifyTestResponse) { + option (google.api.http) = { + post: "/v1beta1/{name=sessions/*/tests/*}:check" + }; + } +} + +// A session is a suite of tests, generally being made in the context +// of testing code generation. +// +// A session defines tests it may expect, based on which version of the +// code generation spec is in use. +message Session { + option (google.api.resource) = { + type: "showcase.googleapis.com/Session" + pattern: "sessions/{session}" + }; + + // The name of the session. The ID must conform to ^[a-z]+$ + // If this is not provided, Showcase chooses one at random. + string name = 1; + + // The specification versions understood by Showcase. + enum Version { + // Unspecified version. If passed on creation, the session will default + // to using the latest stable release. + VERSION_UNSPECIFIED = 0; + + // The latest v1. Currently, this is v1.0. + V1_LATEST = 1; + + // v1.0. (Until the spec is "GA", this will be a moving target.) + V1_0 = 2; + } + + // Required. The version this session is using. + Version version = 2; +} + +// The request for the CreateSession method. +message CreateSessionRequest { + // The session to be created. + // Sessions are immutable once they are created (although they can + // be deleted). + Session session = 1; +} + +// The request for the GetSession method. +message GetSessionRequest { + // The session to be retrieved. + string name = 1 [ + (google.api.resource_reference).type = "showcase.googleapis.com/Session"]; +} + +// The request for the ListSessions method. +message ListSessionsRequest { + // The maximum number of sessions to return per page. + int32 page_size = 1; + + // The page token, for retrieving subsequent pages. + string page_token = 2; +} + +// Response for the ListSessions method. +message ListSessionsResponse { + // The sessions being returned. + repeated Session sessions = 1; + + // The next page token, if any. + // An empty value here means the last page has been reached. + string next_page_token = 2; +} + +// Request for the DeleteSession method. +message DeleteSessionRequest { + // The session to be deleted. + string name = 1 [ + (google.api.resource_reference).type = "showcase.googleapis.com/Session"]; +} + +// Request message for reporting on a session. +message ReportSessionRequest { + // The session to be reported on. + string name = 1 [ + (google.api.resource_reference).type = "showcase.googleapis.com/Session"]; +} + +// Response message for reporting on a session. +message ReportSessionResponse { + // The topline state of the report. + enum Result { + RESULT_UNSPECIFIED = 0; + + // The session is complete, and everything passed. + PASSED = 1; + + // The session had an explicit failure. + FAILED = 2; + + // The session is incomplete. This is a failure response. + INCOMPLETE = 3; + } + + // The state of the report. + Result result = 1; + + // The test runs of this session. + repeated TestRun test_runs = 2; +} + +message Test { + option (google.api.resource) = { + type: "showcase.googleapis.com/Test" + pattern: "sessions/{session}/tests/{test}" + }; + + // The name of the test. + // The tests/* portion of the names are hard-coded, and do not change + // from session to session. + string name = 1; + + // Whether or not a test is required, recommended, or optional. + enum ExpectationLevel { + EXPECTATION_LEVEL_UNSPECIFIED = 0; + + // This test is strictly required. + REQUIRED = 1; + + // This test is recommended. + // + // If a generator explicitly ignores a recommended test (see `DeleteTest`), + // then the report may still pass, but with a warning. + // + // If a generator skips a recommended test and does not explicitly + // express that intention, the report will fail. + RECOMMENDED = 2; + + // This test is optional. + // + // If a generator explicitly ignores an optional test (see `DeleteTest`), + // then the report may still pass, and no warning will be issued. + // + // If a generator skips an optional test and does not explicitly + // express that intention, the report may still pass, but with a + // warning. + OPTIONAL = 3; + } + + // The expectation level for this test. + ExpectationLevel expectation_level = 2; + + // A description of the test. + string description = 3; + + // A blueprint is an explicit definition of methods and requests that are needed + // to be made to test this specific test case. Ideally this would be represented + // by something more robust like CEL, but as of writing this, I am unsure if CEL + // is ready. + message Blueprint { + option (google.api.resource) = { + type: "showcase.googleapis.com/Blueprint" + pattern: "sessions/{session}/tests/{test}/blueprints/{blueprint}" + }; + + // The name of this blueprint. + string name = 1; + + // A description of this blueprint. + string description = 2; + + // A message representing a method invocation. + message Invocation { + // The fully qualified name of the showcase method to be invoked. + string method = 1; + + // The request to be made if a specific request is necessary. + bytes serialized_request = 2; + } + + // The initial request to trigger this test. + Invocation request = 3; + + // An ordered list of method calls that can be called to trigger this test. + repeated Invocation additional_requests = 4; + } + + // The blueprints that will satisfy this test. There may be multiple blueprints + // that can signal to the server that this test case is being exercised. Although + // multiple blueprints are specified, only a single blueprint needs to be run to + // signal that the test case was exercised. + repeated Blueprint blueprints = 4; +} + +// An issue found in the test. +message Issue { + // The different potential types of issues. + enum Type { + TYPE_UNSPECIFIED = 0; + + // The test was never instrumented. + SKIPPED = 1; + + // The test was started but never confirmed. + PENDING = 2; + + // The test was instrumented, but Showcase got an unexpected + // value when the generator tried to confirm success. + INCORRECT_CONFIRMATION = 3; + } + + // The type of the issue. + Type type = 1; + + // Severity levels. + enum Severity { + SEVERITY_UNSPECIFIED = 0; + + // Errors. + ERROR = 1; + + // Warnings. + WARNING = 2; + } + + // The severity of the issue. + Severity severity = 2; + + // A description of the issue. + string description = 3; +} + +// The request for the ListTests method. +message ListTestsRequest { + // The session. + string parent = 1 [ + (google.api.resource_reference).type = "showcase.googleapis.com/Session"]; + + // The maximum number of tests to return per page. + int32 page_size = 2; + + // The page token, for retrieving subsequent pages. + string page_token = 3; +} + +// The response for the ListTests method. +message ListTestsResponse { + // The tests being returned. + repeated Test tests = 1; + + // The next page token, if any. + // An empty value here means the last page has been reached. + string next_page_token = 2; +} + +// A TestRun is the result of running a Test. +message TestRun { + // The name of the test. + // The tests/* portion of the names are hard-coded, and do not change + // from session to session. + string test = 1 [ + (google.api.resource_reference).type = "showcase.googleapis.com/Test"]; + + + // An issue found with the test run. If empty, this test run was successful. + Issue issue = 2; +} + +// Request message for deleting a test. +message DeleteTestRequest { + // The test to be deleted. + string name = 1 [ + (google.api.resource_reference).type = "showcase.googleapis.com/Test"]; +} + +message VerifyTestRequest { + // The test to have an answer registered to it. + string name = 1 [ + (google.api.resource_reference).type = "showcase.googleapis.com/Test"]; + + // The answer from the test. + bytes answer = 2; + + // The answers from the test if multiple are to be checked + repeated bytes answers = 3; +} + +message VerifyTestResponse { + // An issue if check answer was unsuccessful. This will be empty if the check answer succeeded. + Issue issue = 1; +} diff --git a/java-showcase-3.25.8/README.md b/java-showcase-3.25.8/README.md new file mode 100644 index 0000000000..c112ebf5ad --- /dev/null +++ b/java-showcase-3.25.8/README.md @@ -0,0 +1,2 @@ +This is a copy of [GAPIC Showcase](https://github.com/googleapis/gapic-showcase) with protobuf 3.25.8 gen code. +This is intended to test the compatibility between protobuf-java runtime v4.33.0 and gen code 3.25.8. \ No newline at end of file diff --git a/java-showcase-3.25.8/gapic-showcase/pom.xml b/java-showcase-3.25.8/gapic-showcase/pom.xml new file mode 100644 index 0000000000..cdd0f3d8b7 --- /dev/null +++ b/java-showcase-3.25.8/gapic-showcase/pom.xml @@ -0,0 +1,366 @@ + + + 4.0.0 + com.google.cloud + gapic-showcase + 0.0.1-SNAPSHOT + jar + GAPIC Showcase Client + + GAPIC Showcase is an API that demonstrates Generated API Client (GAPIC) features and common API + patterns used by Google. + + + com.google.cloud + gapic-showcase-parent + 0.0.1-SNAPSHOT + + + + 0.36.2 + + 1.2.13 + 1.5.25 + + + + + + org.jacoco + jacoco-maven-plugin + 0.8.13 + + + report + + report + + + + XML + HTML + + + + + + + com.spotify.fmt + fmt-maven-plugin + 2.25 + + (IT.*\.java)|(.*Test.java)|(TestClientInitializer.java) + + + + com.googlecode.maven-download-plugin + download-maven-plugin + 1.6.8 + + + download-compliance-suite + generate-test-resources + + wget + + + + https://raw.githubusercontent.com/googleapis/gapic-showcase/v${gapic-showcase.version}/server/services/compliance_suite.json + + src/test/resources + + true + + + + + + + + + + io.grpc + grpc-api + + + io.grpc + grpc-stub + + + io.grpc + grpc-protobuf + + + com.google.api + api-common + + + com.google.protobuf + protobuf-java + + + com.google.api.grpc + proto-google-common-protos + + + com.google.api.grpc + grpc-google-common-protos + test + + + com.google.api.grpc + proto-google-iam-v1 + + + com.google.api.grpc + proto-gapic-showcase-v1beta1 + + + com.google.guava + guava + + + com.google.api + gax + + + com.google.api + gax-grpc + + + com.google.api + gax-httpjson + + + + + org.junit.jupiter + junit-jupiter-engine + test + + + org.junit.vintage + junit-vintage-engine + test + + + org.junit.jupiter + junit-jupiter-params + test + + + com.google.truth + truth + 1.4.4 + + + junit + junit + + + test + + + + com.google.api.grpc + grpc-gapic-showcase-v1beta1 + test + + + + com.google.api + gax + test-jar + testlib + test + + + com.google.api + gax-grpc + test-jar + testlib + test + + + com.google.api + gax-httpjson + test-jar + testlib + test + + + com.google.auth + google-auth-library-oauth2-http + test-jar + testlib + test + + + com.google.api.grpc + grpc-google-iam-v1 + test + + + + + io.opentelemetry + opentelemetry-api + test + + + io.opentelemetry + opentelemetry-sdk + test + + + io.opentelemetry + opentelemetry-sdk-testing + test + + + + io.grpc + grpc-opentelemetry + test + + + + + + + + slf4j2_logback + + + + slf4j2_logback + + + + + org.slf4j + slf4j-api + 2.0.16 + test + + + ch.qos.logback + logback-classic + ${slf4j2-logback.version} + test + + + ch.qos.logback + logback-core + ${slf4j2-logback.version} + test + + + + + + org.apache.maven.plugins + maven-compiler-plugin + + + **/com/google/showcase/v1beta1/it/*.java + **/com/google/showcase/v1beta1/it/logging/ITLoggingDisabled.java + **/com/google/showcase/v1beta1/it/logging/ITLogging1x.java + + + + + + + + slf4j1_logback + + + + slf4j1_logback + + + + + org.slf4j + slf4j-api + 1.7.36 + test + + + ch.qos.logback + logback-classic + ${slf4j1-logback.version} + test + + + ch.qos.logback + logback-core + ${slf4j1-logback.version} + test + + + + + + org.apache.maven.plugins + maven-compiler-plugin + + + **/com/google/showcase/v1beta1/it/*.java + **/com/google/showcase/v1beta1/it/logging/ITLoggingDisabled.java + **/com/google/showcase/v1beta1/it/logging/ITLogging.java + + + + + + + + disabledLogging + + + + + disable_logging + + + + + org.slf4j + slf4j-api + 1.7.36 + test + + + ch.qos.logback + logback-classic + ${slf4j1-logback.version} + test + + + ch.qos.logback + logback-core + ${slf4j1-logback.version} + test + + + + + + org.apache.maven.plugins + maven-compiler-plugin + + + **/com/google/showcase/v1beta1/it/*.java + **/com/google/showcase/v1beta1/it/logging/ITLogging1x.java + **/com/google/showcase/v1beta1/it/logging/ITLogging.java + + + + + + + + + diff --git a/java-showcase-3.25.8/gapic-showcase/src/main/java/com/google/showcase/v1beta1/ComplianceClient.java b/java-showcase-3.25.8/gapic-showcase/src/main/java/com/google/showcase/v1beta1/ComplianceClient.java new file mode 100644 index 0000000000..2bd2776fd9 --- /dev/null +++ b/java-showcase-3.25.8/gapic-showcase/src/main/java/com/google/showcase/v1beta1/ComplianceClient.java @@ -0,0 +1,1595 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1; + +import com.google.api.core.ApiFuture; +import com.google.api.core.ApiFutures; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.paging.AbstractFixedSizeCollection; +import com.google.api.gax.paging.AbstractPage; +import com.google.api.gax.paging.AbstractPagedListResponse; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.common.util.concurrent.MoreExecutors; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.showcase.v1beta1.stub.ComplianceStub; +import com.google.showcase.v1beta1.stub.ComplianceStubSettings; +import java.io.IOException; +import java.util.List; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Service Description: This service is used to test that GAPICs implement various REST-related + * features correctly. This mostly means transcoding proto3 requests to REST format correctly for + * various types of HTTP annotations, but it also includes verifying that unknown (numeric) enums + * received by clients can be round-tripped correctly. + * + *

        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 (ComplianceClient complianceClient = ComplianceClient.create()) {
        + *   RepeatRequest request =
        + *       RepeatRequest.newBuilder()
        + *           .setName("name3373707")
        + *           .setInfo(ComplianceData.newBuilder().build())
        + *           .setServerVerify(true)
        + *           .setIntendedBindingUri("intendedBindingUri780142386")
        + *           .setFInt32(-1143775883)
        + *           .setFInt64(-1143775788)
        + *           .setFDouble(-1239459382)
        + *           .setPInt32(-858673665)
        + *           .setPInt64(-858673570)
        + *           .setPDouble(-991225216)
        + *           .build();
        + *   RepeatResponse response = complianceClient.repeatDataBody(request);
        + * }
        + * }
        + * + *

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

        RepeatDataBody

        This method echoes the ComplianceData request. This method exercises sending the entire request object in the REST body.

        + *

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

        + *
          + *
        • repeatDataBody(RepeatRequest request) + *

        + *

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

        + *
          + *
        • repeatDataBodyCallable() + *

        + *

        RepeatDataBodyInfo

        This method echoes the ComplianceData request. This method exercises sending the a message-type field in the REST body. Per AIP-127, only top-level, non-repeated fields can be sent this way.

        + *

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

        + *
          + *
        • repeatDataBodyInfo(RepeatRequest request) + *

        + *

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

        + *
          + *
        • repeatDataBodyInfoCallable() + *

        + *

        RepeatDataQuery

        This method echoes the ComplianceData request. This method exercises sending all request fields as query parameters.

        + *

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

        + *
          + *
        • repeatDataQuery(RepeatRequest request) + *

        + *

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

        + *
          + *
        • repeatDataQueryCallable() + *

        + *

        RepeatDataSimplePath

        This method echoes the ComplianceData request. This method exercises sending some parameters as "simple" path variables (i.e., of the form "/bar/{foo}" rather than "/{foo=bar/*}"), and the rest as query parameters.

        + *

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

        + *
          + *
        • repeatDataSimplePath(RepeatRequest request) + *

        + *

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

        + *
          + *
        • repeatDataSimplePathCallable() + *

        + *

        RepeatDataPathResource

        Same as RepeatDataSimplePath, but with a path resource.

        + *

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

        + *
          + *
        • repeatDataPathResource(RepeatRequest request) + *

        + *

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

        + *
          + *
        • repeatDataPathResourceCallable() + *

        + *

        RepeatDataPathTrailingResource

        Same as RepeatDataSimplePath, but with a trailing resource.

        + *

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

        + *
          + *
        • repeatDataPathTrailingResource(RepeatRequest request) + *

        + *

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

        + *
          + *
        • repeatDataPathTrailingResourceCallable() + *

        + *

        RepeatDataBodyPut

        This method echoes the ComplianceData request, using the HTTP PUT method.

        + *

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

        + *
          + *
        • repeatDataBodyPut(RepeatRequest request) + *

        + *

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

        + *
          + *
        • repeatDataBodyPutCallable() + *

        + *

        RepeatDataBodyPatch

        This method echoes the ComplianceData request, using the HTTP PATCH method.

        + *

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

        + *
          + *
        • repeatDataBodyPatch(RepeatRequest request) + *

        + *

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

        + *
          + *
        • repeatDataBodyPatchCallable() + *

        + *

        GetEnum

        This method requests an enum value from the server. Depending on the contents of EnumRequest, the enum value returned will be a known enum declared in the .proto file, or a made-up enum value the is unknown to the client. To verify that clients can round-trip unknown enum values they receive, use the response from this RPC as the request to VerifyEnum() + *

        The values of enums sent by the server when a known or unknown value is requested will be the same within a single Showcase server run (this is needed for VerifyEnum() to work) but are not guaranteed to be the same across separate Showcase server runs.

        + *

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

        + *
          + *
        • getEnum(EnumRequest request) + *

        + *

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

        + *
          + *
        • getEnumCallable() + *

        + *

        VerifyEnum

        This method is used to verify that clients can round-trip enum values, which is particularly important for unknown enum values over REST. VerifyEnum() verifies that its request, which is presumably the response that the client previously got to a GetEnum(), contains the correct data. If so, it responds with the same EnumResponse; otherwise, the RPC errors. + *

        This works because the values of enums sent by the server when a known or unknown value is requested will be the same within a single Showcase server run, although they are not guaranteed to be the same across separate Showcase server runs.

        + *

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

        + *
          + *
        • verifyEnum(EnumResponse request) + *

        + *

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

        + *
          + *
        • verifyEnumCallable() + *

        + *

        ListLocations

        Lists information about the supported locations for this service.

        + *

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

        + *
          + *
        • listLocations(ListLocationsRequest request) + *

        + *

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

        + *
          + *
        • listLocationsPagedCallable() + *

        • listLocationsCallable() + *

        + *

        GetLocation

        Gets information about a location.

        + *

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

        + *
          + *
        • getLocation(GetLocationRequest request) + *

        + *

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

        + *
          + *
        • getLocationCallable() + *

        + *

        SetIamPolicy

        Sets the access control policy on the specified resource. Replaces any existing policy. + *

        Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED` errors.

        + *

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

        + *
          + *
        • setIamPolicy(SetIamPolicyRequest request) + *

        + *

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

        + *
          + *
        • setIamPolicyCallable() + *

        + *

        GetIamPolicy

        Gets the access control policy for a resource. Returns an empty policy if the resource exists and does not have a policy set.

        + *

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

        + *
          + *
        • getIamPolicy(GetIamPolicyRequest request) + *

        + *

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

        + *
          + *
        • getIamPolicyCallable() + *

        + *

        TestIamPermissions

        Returns permissions that a caller has on the specified resource. If the resource does not exist, this will return an empty set of permissions, not a `NOT_FOUND` error. + *

        Note: This operation is designed to be used for building permission-aware UIs and command-line tools, not for authorization checking. This operation may "fail open" without warning.

        + *

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

        + *
          + *
        • testIamPermissions(TestIamPermissionsRequest request) + *

        + *

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

        + *
          + *
        • testIamPermissionsCallable() + *

        + *
        + * + *

        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 ComplianceSettings 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
        + * ComplianceSettings complianceSettings =
        + *     ComplianceSettings.newBuilder()
        + *         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
        + *         .build();
        + * ComplianceClient complianceClient = ComplianceClient.create(complianceSettings);
        + * }
        + * + *

        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
        + * ComplianceSettings complianceSettings =
        + *     ComplianceSettings.newBuilder().setEndpoint(myEndpoint).build();
        + * ComplianceClient complianceClient = ComplianceClient.create(complianceSettings);
        + * }
        + * + *

        To use REST (HTTP1.1/JSON) transport (instead of gRPC) for sending and receiving requests over + * the wire: + * + *

        {@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
        + * ComplianceSettings complianceSettings = ComplianceSettings.newHttpJsonBuilder().build();
        + * ComplianceClient complianceClient = ComplianceClient.create(complianceSettings);
        + * }
        + * + *

        Please refer to the GitHub repository's samples for more quickstart code snippets. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class ComplianceClient implements BackgroundResource { + private final ComplianceSettings settings; + private final ComplianceStub stub; + + /** Constructs an instance of ComplianceClient with default settings. */ + public static final ComplianceClient create() throws IOException { + return create(ComplianceSettings.newBuilder().build()); + } + + /** + * Constructs an instance of ComplianceClient, 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 ComplianceClient create(ComplianceSettings settings) throws IOException { + return new ComplianceClient(settings); + } + + /** + * Constructs an instance of ComplianceClient, using the given stub for making calls. This is for + * advanced usage - prefer using create(ComplianceSettings). + */ + public static final ComplianceClient create(ComplianceStub stub) { + return new ComplianceClient(stub); + } + + /** + * Constructs an instance of ComplianceClient, 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 ComplianceClient(ComplianceSettings settings) throws IOException { + this.settings = settings; + this.stub = ((ComplianceStubSettings) settings.getStubSettings()).createStub(); + } + + protected ComplianceClient(ComplianceStub stub) { + this.settings = null; + this.stub = stub; + } + + public final ComplianceSettings getSettings() { + return settings; + } + + public ComplianceStub getStub() { + return stub; + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * This method echoes the ComplianceData request. This method exercises sending the entire request + * object in the REST body. + * + *

        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 (ComplianceClient complianceClient = ComplianceClient.create()) {
        +   *   RepeatRequest request =
        +   *       RepeatRequest.newBuilder()
        +   *           .setName("name3373707")
        +   *           .setInfo(ComplianceData.newBuilder().build())
        +   *           .setServerVerify(true)
        +   *           .setIntendedBindingUri("intendedBindingUri780142386")
        +   *           .setFInt32(-1143775883)
        +   *           .setFInt64(-1143775788)
        +   *           .setFDouble(-1239459382)
        +   *           .setPInt32(-858673665)
        +   *           .setPInt64(-858673570)
        +   *           .setPDouble(-991225216)
        +   *           .build();
        +   *   RepeatResponse response = complianceClient.repeatDataBody(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 RepeatResponse repeatDataBody(RepeatRequest request) { + return repeatDataBodyCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * This method echoes the ComplianceData request. This method exercises sending the entire request + * object in the REST body. + * + *

        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 (ComplianceClient complianceClient = ComplianceClient.create()) {
        +   *   RepeatRequest request =
        +   *       RepeatRequest.newBuilder()
        +   *           .setName("name3373707")
        +   *           .setInfo(ComplianceData.newBuilder().build())
        +   *           .setServerVerify(true)
        +   *           .setIntendedBindingUri("intendedBindingUri780142386")
        +   *           .setFInt32(-1143775883)
        +   *           .setFInt64(-1143775788)
        +   *           .setFDouble(-1239459382)
        +   *           .setPInt32(-858673665)
        +   *           .setPInt64(-858673570)
        +   *           .setPDouble(-991225216)
        +   *           .build();
        +   *   ApiFuture future =
        +   *       complianceClient.repeatDataBodyCallable().futureCall(request);
        +   *   // Do something.
        +   *   RepeatResponse response = future.get();
        +   * }
        +   * }
        + */ + public final UnaryCallable repeatDataBodyCallable() { + return stub.repeatDataBodyCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * This method echoes the ComplianceData request. This method exercises sending the a message-type + * field in the REST body. Per AIP-127, only top-level, non-repeated fields can be sent this way. + * + *

        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 (ComplianceClient complianceClient = ComplianceClient.create()) {
        +   *   RepeatRequest request =
        +   *       RepeatRequest.newBuilder()
        +   *           .setName("name3373707")
        +   *           .setInfo(ComplianceData.newBuilder().build())
        +   *           .setServerVerify(true)
        +   *           .setIntendedBindingUri("intendedBindingUri780142386")
        +   *           .setFInt32(-1143775883)
        +   *           .setFInt64(-1143775788)
        +   *           .setFDouble(-1239459382)
        +   *           .setPInt32(-858673665)
        +   *           .setPInt64(-858673570)
        +   *           .setPDouble(-991225216)
        +   *           .build();
        +   *   RepeatResponse response = complianceClient.repeatDataBodyInfo(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 RepeatResponse repeatDataBodyInfo(RepeatRequest request) { + return repeatDataBodyInfoCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * This method echoes the ComplianceData request. This method exercises sending the a message-type + * field in the REST body. Per AIP-127, only top-level, non-repeated fields can be sent this way. + * + *

        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 (ComplianceClient complianceClient = ComplianceClient.create()) {
        +   *   RepeatRequest request =
        +   *       RepeatRequest.newBuilder()
        +   *           .setName("name3373707")
        +   *           .setInfo(ComplianceData.newBuilder().build())
        +   *           .setServerVerify(true)
        +   *           .setIntendedBindingUri("intendedBindingUri780142386")
        +   *           .setFInt32(-1143775883)
        +   *           .setFInt64(-1143775788)
        +   *           .setFDouble(-1239459382)
        +   *           .setPInt32(-858673665)
        +   *           .setPInt64(-858673570)
        +   *           .setPDouble(-991225216)
        +   *           .build();
        +   *   ApiFuture future =
        +   *       complianceClient.repeatDataBodyInfoCallable().futureCall(request);
        +   *   // Do something.
        +   *   RepeatResponse response = future.get();
        +   * }
        +   * }
        + */ + public final UnaryCallable repeatDataBodyInfoCallable() { + return stub.repeatDataBodyInfoCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * This method echoes the ComplianceData request. This method exercises sending all request fields + * as query parameters. + * + *

        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 (ComplianceClient complianceClient = ComplianceClient.create()) {
        +   *   RepeatRequest request =
        +   *       RepeatRequest.newBuilder()
        +   *           .setName("name3373707")
        +   *           .setInfo(ComplianceData.newBuilder().build())
        +   *           .setServerVerify(true)
        +   *           .setIntendedBindingUri("intendedBindingUri780142386")
        +   *           .setFInt32(-1143775883)
        +   *           .setFInt64(-1143775788)
        +   *           .setFDouble(-1239459382)
        +   *           .setPInt32(-858673665)
        +   *           .setPInt64(-858673570)
        +   *           .setPDouble(-991225216)
        +   *           .build();
        +   *   RepeatResponse response = complianceClient.repeatDataQuery(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 RepeatResponse repeatDataQuery(RepeatRequest request) { + return repeatDataQueryCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * This method echoes the ComplianceData request. This method exercises sending all request fields + * as query parameters. + * + *

        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 (ComplianceClient complianceClient = ComplianceClient.create()) {
        +   *   RepeatRequest request =
        +   *       RepeatRequest.newBuilder()
        +   *           .setName("name3373707")
        +   *           .setInfo(ComplianceData.newBuilder().build())
        +   *           .setServerVerify(true)
        +   *           .setIntendedBindingUri("intendedBindingUri780142386")
        +   *           .setFInt32(-1143775883)
        +   *           .setFInt64(-1143775788)
        +   *           .setFDouble(-1239459382)
        +   *           .setPInt32(-858673665)
        +   *           .setPInt64(-858673570)
        +   *           .setPDouble(-991225216)
        +   *           .build();
        +   *   ApiFuture future =
        +   *       complianceClient.repeatDataQueryCallable().futureCall(request);
        +   *   // Do something.
        +   *   RepeatResponse response = future.get();
        +   * }
        +   * }
        + */ + public final UnaryCallable repeatDataQueryCallable() { + return stub.repeatDataQueryCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * This method echoes the ComplianceData request. This method exercises sending some parameters as + * "simple" path variables (i.e., of the form "/bar/{foo}" rather than "/{foo=bar/*}"), and + * the rest as query parameters. + * + *

        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 (ComplianceClient complianceClient = ComplianceClient.create()) {
        +   *   RepeatRequest request =
        +   *       RepeatRequest.newBuilder()
        +   *           .setName("name3373707")
        +   *           .setInfo(ComplianceData.newBuilder().build())
        +   *           .setServerVerify(true)
        +   *           .setIntendedBindingUri("intendedBindingUri780142386")
        +   *           .setFInt32(-1143775883)
        +   *           .setFInt64(-1143775788)
        +   *           .setFDouble(-1239459382)
        +   *           .setPInt32(-858673665)
        +   *           .setPInt64(-858673570)
        +   *           .setPDouble(-991225216)
        +   *           .build();
        +   *   RepeatResponse response = complianceClient.repeatDataSimplePath(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 RepeatResponse repeatDataSimplePath(RepeatRequest request) { + return repeatDataSimplePathCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * This method echoes the ComplianceData request. This method exercises sending some parameters as + * "simple" path variables (i.e., of the form "/bar/{foo}" rather than "/{foo=bar/*}"), and + * the rest as query parameters. + * + *

        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 (ComplianceClient complianceClient = ComplianceClient.create()) {
        +   *   RepeatRequest request =
        +   *       RepeatRequest.newBuilder()
        +   *           .setName("name3373707")
        +   *           .setInfo(ComplianceData.newBuilder().build())
        +   *           .setServerVerify(true)
        +   *           .setIntendedBindingUri("intendedBindingUri780142386")
        +   *           .setFInt32(-1143775883)
        +   *           .setFInt64(-1143775788)
        +   *           .setFDouble(-1239459382)
        +   *           .setPInt32(-858673665)
        +   *           .setPInt64(-858673570)
        +   *           .setPDouble(-991225216)
        +   *           .build();
        +   *   ApiFuture future =
        +   *       complianceClient.repeatDataSimplePathCallable().futureCall(request);
        +   *   // Do something.
        +   *   RepeatResponse response = future.get();
        +   * }
        +   * }
        + */ + public final UnaryCallable repeatDataSimplePathCallable() { + return stub.repeatDataSimplePathCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Same as RepeatDataSimplePath, but with a path 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 (ComplianceClient complianceClient = ComplianceClient.create()) {
        +   *   RepeatRequest request =
        +   *       RepeatRequest.newBuilder()
        +   *           .setName("name3373707")
        +   *           .setInfo(ComplianceData.newBuilder().build())
        +   *           .setServerVerify(true)
        +   *           .setIntendedBindingUri("intendedBindingUri780142386")
        +   *           .setFInt32(-1143775883)
        +   *           .setFInt64(-1143775788)
        +   *           .setFDouble(-1239459382)
        +   *           .setPInt32(-858673665)
        +   *           .setPInt64(-858673570)
        +   *           .setPDouble(-991225216)
        +   *           .build();
        +   *   RepeatResponse response = complianceClient.repeatDataPathResource(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 RepeatResponse repeatDataPathResource(RepeatRequest request) { + return repeatDataPathResourceCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Same as RepeatDataSimplePath, but with a path 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 (ComplianceClient complianceClient = ComplianceClient.create()) {
        +   *   RepeatRequest request =
        +   *       RepeatRequest.newBuilder()
        +   *           .setName("name3373707")
        +   *           .setInfo(ComplianceData.newBuilder().build())
        +   *           .setServerVerify(true)
        +   *           .setIntendedBindingUri("intendedBindingUri780142386")
        +   *           .setFInt32(-1143775883)
        +   *           .setFInt64(-1143775788)
        +   *           .setFDouble(-1239459382)
        +   *           .setPInt32(-858673665)
        +   *           .setPInt64(-858673570)
        +   *           .setPDouble(-991225216)
        +   *           .build();
        +   *   ApiFuture future =
        +   *       complianceClient.repeatDataPathResourceCallable().futureCall(request);
        +   *   // Do something.
        +   *   RepeatResponse response = future.get();
        +   * }
        +   * }
        + */ + public final UnaryCallable repeatDataPathResourceCallable() { + return stub.repeatDataPathResourceCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Same as RepeatDataSimplePath, but with a trailing 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 (ComplianceClient complianceClient = ComplianceClient.create()) {
        +   *   RepeatRequest request =
        +   *       RepeatRequest.newBuilder()
        +   *           .setName("name3373707")
        +   *           .setInfo(ComplianceData.newBuilder().build())
        +   *           .setServerVerify(true)
        +   *           .setIntendedBindingUri("intendedBindingUri780142386")
        +   *           .setFInt32(-1143775883)
        +   *           .setFInt64(-1143775788)
        +   *           .setFDouble(-1239459382)
        +   *           .setPInt32(-858673665)
        +   *           .setPInt64(-858673570)
        +   *           .setPDouble(-991225216)
        +   *           .build();
        +   *   RepeatResponse response = complianceClient.repeatDataPathTrailingResource(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 RepeatResponse repeatDataPathTrailingResource(RepeatRequest request) { + return repeatDataPathTrailingResourceCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Same as RepeatDataSimplePath, but with a trailing 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 (ComplianceClient complianceClient = ComplianceClient.create()) {
        +   *   RepeatRequest request =
        +   *       RepeatRequest.newBuilder()
        +   *           .setName("name3373707")
        +   *           .setInfo(ComplianceData.newBuilder().build())
        +   *           .setServerVerify(true)
        +   *           .setIntendedBindingUri("intendedBindingUri780142386")
        +   *           .setFInt32(-1143775883)
        +   *           .setFInt64(-1143775788)
        +   *           .setFDouble(-1239459382)
        +   *           .setPInt32(-858673665)
        +   *           .setPInt64(-858673570)
        +   *           .setPDouble(-991225216)
        +   *           .build();
        +   *   ApiFuture future =
        +   *       complianceClient.repeatDataPathTrailingResourceCallable().futureCall(request);
        +   *   // Do something.
        +   *   RepeatResponse response = future.get();
        +   * }
        +   * }
        + */ + public final UnaryCallable + repeatDataPathTrailingResourceCallable() { + return stub.repeatDataPathTrailingResourceCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * This method echoes the ComplianceData request, using the HTTP PUT method. + * + *

        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 (ComplianceClient complianceClient = ComplianceClient.create()) {
        +   *   RepeatRequest request =
        +   *       RepeatRequest.newBuilder()
        +   *           .setName("name3373707")
        +   *           .setInfo(ComplianceData.newBuilder().build())
        +   *           .setServerVerify(true)
        +   *           .setIntendedBindingUri("intendedBindingUri780142386")
        +   *           .setFInt32(-1143775883)
        +   *           .setFInt64(-1143775788)
        +   *           .setFDouble(-1239459382)
        +   *           .setPInt32(-858673665)
        +   *           .setPInt64(-858673570)
        +   *           .setPDouble(-991225216)
        +   *           .build();
        +   *   RepeatResponse response = complianceClient.repeatDataBodyPut(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 RepeatResponse repeatDataBodyPut(RepeatRequest request) { + return repeatDataBodyPutCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * This method echoes the ComplianceData request, using the HTTP PUT method. + * + *

        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 (ComplianceClient complianceClient = ComplianceClient.create()) {
        +   *   RepeatRequest request =
        +   *       RepeatRequest.newBuilder()
        +   *           .setName("name3373707")
        +   *           .setInfo(ComplianceData.newBuilder().build())
        +   *           .setServerVerify(true)
        +   *           .setIntendedBindingUri("intendedBindingUri780142386")
        +   *           .setFInt32(-1143775883)
        +   *           .setFInt64(-1143775788)
        +   *           .setFDouble(-1239459382)
        +   *           .setPInt32(-858673665)
        +   *           .setPInt64(-858673570)
        +   *           .setPDouble(-991225216)
        +   *           .build();
        +   *   ApiFuture future =
        +   *       complianceClient.repeatDataBodyPutCallable().futureCall(request);
        +   *   // Do something.
        +   *   RepeatResponse response = future.get();
        +   * }
        +   * }
        + */ + public final UnaryCallable repeatDataBodyPutCallable() { + return stub.repeatDataBodyPutCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * This method echoes the ComplianceData request, using the HTTP PATCH method. + * + *

        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 (ComplianceClient complianceClient = ComplianceClient.create()) {
        +   *   RepeatRequest request =
        +   *       RepeatRequest.newBuilder()
        +   *           .setName("name3373707")
        +   *           .setInfo(ComplianceData.newBuilder().build())
        +   *           .setServerVerify(true)
        +   *           .setIntendedBindingUri("intendedBindingUri780142386")
        +   *           .setFInt32(-1143775883)
        +   *           .setFInt64(-1143775788)
        +   *           .setFDouble(-1239459382)
        +   *           .setPInt32(-858673665)
        +   *           .setPInt64(-858673570)
        +   *           .setPDouble(-991225216)
        +   *           .build();
        +   *   RepeatResponse response = complianceClient.repeatDataBodyPatch(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 RepeatResponse repeatDataBodyPatch(RepeatRequest request) { + return repeatDataBodyPatchCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * This method echoes the ComplianceData request, using the HTTP PATCH method. + * + *

        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 (ComplianceClient complianceClient = ComplianceClient.create()) {
        +   *   RepeatRequest request =
        +   *       RepeatRequest.newBuilder()
        +   *           .setName("name3373707")
        +   *           .setInfo(ComplianceData.newBuilder().build())
        +   *           .setServerVerify(true)
        +   *           .setIntendedBindingUri("intendedBindingUri780142386")
        +   *           .setFInt32(-1143775883)
        +   *           .setFInt64(-1143775788)
        +   *           .setFDouble(-1239459382)
        +   *           .setPInt32(-858673665)
        +   *           .setPInt64(-858673570)
        +   *           .setPDouble(-991225216)
        +   *           .build();
        +   *   ApiFuture future =
        +   *       complianceClient.repeatDataBodyPatchCallable().futureCall(request);
        +   *   // Do something.
        +   *   RepeatResponse response = future.get();
        +   * }
        +   * }
        + */ + public final UnaryCallable repeatDataBodyPatchCallable() { + return stub.repeatDataBodyPatchCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * This method requests an enum value from the server. Depending on the contents of EnumRequest, + * the enum value returned will be a known enum declared in the .proto file, or a made-up enum + * value the is unknown to the client. To verify that clients can round-trip unknown enum values + * they receive, use the response from this RPC as the request to VerifyEnum() + * + *

        The values of enums sent by the server when a known or unknown value is requested will be + * the same within a single Showcase server run (this is needed for VerifyEnum() to work) but are + * not guaranteed to be the same across separate Showcase server runs. + * + *

        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 (ComplianceClient complianceClient = ComplianceClient.create()) {
        +   *   EnumRequest request = EnumRequest.newBuilder().setUnknownEnum(true).build();
        +   *   EnumResponse response = complianceClient.getEnum(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 EnumResponse getEnum(EnumRequest request) { + return getEnumCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * This method requests an enum value from the server. Depending on the contents of EnumRequest, + * the enum value returned will be a known enum declared in the .proto file, or a made-up enum + * value the is unknown to the client. To verify that clients can round-trip unknown enum values + * they receive, use the response from this RPC as the request to VerifyEnum() + * + *

        The values of enums sent by the server when a known or unknown value is requested will be + * the same within a single Showcase server run (this is needed for VerifyEnum() to work) but are + * not guaranteed to be the same across separate Showcase server runs. + * + *

        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 (ComplianceClient complianceClient = ComplianceClient.create()) {
        +   *   EnumRequest request = EnumRequest.newBuilder().setUnknownEnum(true).build();
        +   *   ApiFuture future = complianceClient.getEnumCallable().futureCall(request);
        +   *   // Do something.
        +   *   EnumResponse response = future.get();
        +   * }
        +   * }
        + */ + public final UnaryCallable getEnumCallable() { + return stub.getEnumCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * This method is used to verify that clients can round-trip enum values, which is particularly + * important for unknown enum values over REST. VerifyEnum() verifies that its request, which is + * presumably the response that the client previously got to a GetEnum(), contains the correct + * data. If so, it responds with the same EnumResponse; otherwise, the RPC errors. + * + *

        This works because the values of enums sent by the server when a known or unknown value is + * requested will be the same within a single Showcase server run, although they are not + * guaranteed to be the same across separate Showcase server runs. + * + *

        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 (ComplianceClient complianceClient = ComplianceClient.create()) {
        +   *   EnumResponse request =
        +   *       EnumResponse.newBuilder()
        +   *           .setRequest(EnumRequest.newBuilder().build())
        +   *           .setContinent(Continent.forNumber(0))
        +   *           .build();
        +   *   EnumResponse response = complianceClient.verifyEnum(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 EnumResponse verifyEnum(EnumResponse request) { + return verifyEnumCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * This method is used to verify that clients can round-trip enum values, which is particularly + * important for unknown enum values over REST. VerifyEnum() verifies that its request, which is + * presumably the response that the client previously got to a GetEnum(), contains the correct + * data. If so, it responds with the same EnumResponse; otherwise, the RPC errors. + * + *

        This works because the values of enums sent by the server when a known or unknown value is + * requested will be the same within a single Showcase server run, although they are not + * guaranteed to be the same across separate Showcase server runs. + * + *

        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 (ComplianceClient complianceClient = ComplianceClient.create()) {
        +   *   EnumResponse request =
        +   *       EnumResponse.newBuilder()
        +   *           .setRequest(EnumRequest.newBuilder().build())
        +   *           .setContinent(Continent.forNumber(0))
        +   *           .build();
        +   *   ApiFuture future = complianceClient.verifyEnumCallable().futureCall(request);
        +   *   // Do something.
        +   *   EnumResponse response = future.get();
        +   * }
        +   * }
        + */ + public final UnaryCallable verifyEnumCallable() { + return stub.verifyEnumCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists information about the supported locations for this service. + * + *

        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 (ComplianceClient complianceClient = ComplianceClient.create()) {
        +   *   ListLocationsRequest request =
        +   *       ListLocationsRequest.newBuilder()
        +   *           .setName("name3373707")
        +   *           .setFilter("filter-1274492040")
        +   *           .setPageSize(883849137)
        +   *           .setPageToken("pageToken873572522")
        +   *           .build();
        +   *   for (Location element : complianceClient.listLocations(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 ListLocationsPagedResponse listLocations(ListLocationsRequest request) { + return listLocationsPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists information about the supported locations for this service. + * + *

        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 (ComplianceClient complianceClient = ComplianceClient.create()) {
        +   *   ListLocationsRequest request =
        +   *       ListLocationsRequest.newBuilder()
        +   *           .setName("name3373707")
        +   *           .setFilter("filter-1274492040")
        +   *           .setPageSize(883849137)
        +   *           .setPageToken("pageToken873572522")
        +   *           .build();
        +   *   ApiFuture future =
        +   *       complianceClient.listLocationsPagedCallable().futureCall(request);
        +   *   // Do something.
        +   *   for (Location element : future.get().iterateAll()) {
        +   *     // doThingsWith(element);
        +   *   }
        +   * }
        +   * }
        + */ + public final UnaryCallable + listLocationsPagedCallable() { + return stub.listLocationsPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists information about the supported locations for this service. + * + *

        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 (ComplianceClient complianceClient = ComplianceClient.create()) {
        +   *   ListLocationsRequest request =
        +   *       ListLocationsRequest.newBuilder()
        +   *           .setName("name3373707")
        +   *           .setFilter("filter-1274492040")
        +   *           .setPageSize(883849137)
        +   *           .setPageToken("pageToken873572522")
        +   *           .build();
        +   *   while (true) {
        +   *     ListLocationsResponse response = complianceClient.listLocationsCallable().call(request);
        +   *     for (Location element : response.getLocationsList()) {
        +   *       // doThingsWith(element);
        +   *     }
        +   *     String nextPageToken = response.getNextPageToken();
        +   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
        +   *       request = request.toBuilder().setPageToken(nextPageToken).build();
        +   *     } else {
        +   *       break;
        +   *     }
        +   *   }
        +   * }
        +   * }
        + */ + public final UnaryCallable listLocationsCallable() { + return stub.listLocationsCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets information about a location. + * + *

        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 (ComplianceClient complianceClient = ComplianceClient.create()) {
        +   *   GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build();
        +   *   Location response = complianceClient.getLocation(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 Location getLocation(GetLocationRequest request) { + return getLocationCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets information about a location. + * + *

        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 (ComplianceClient complianceClient = ComplianceClient.create()) {
        +   *   GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build();
        +   *   ApiFuture future = complianceClient.getLocationCallable().futureCall(request);
        +   *   // Do something.
        +   *   Location response = future.get();
        +   * }
        +   * }
        + */ + public final UnaryCallable getLocationCallable() { + return stub.getLocationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Sets the access control policy on the specified resource. Replaces any existing policy. + * + *

        Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED` errors. + * + *

        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 (ComplianceClient complianceClient = ComplianceClient.create()) {
        +   *   SetIamPolicyRequest request =
        +   *       SetIamPolicyRequest.newBuilder()
        +   *           .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString())
        +   *           .setPolicy(Policy.newBuilder().build())
        +   *           .setUpdateMask(FieldMask.newBuilder().build())
        +   *           .build();
        +   *   Policy response = complianceClient.setIamPolicy(request);
        +   * }
        +   * }
        + * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Policy setIamPolicy(SetIamPolicyRequest request) { + return setIamPolicyCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Sets the access control policy on the specified resource. Replaces any existing policy. + * + *

        Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED` errors. + * + *

        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 (ComplianceClient complianceClient = ComplianceClient.create()) {
        +   *   SetIamPolicyRequest request =
        +   *       SetIamPolicyRequest.newBuilder()
        +   *           .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString())
        +   *           .setPolicy(Policy.newBuilder().build())
        +   *           .setUpdateMask(FieldMask.newBuilder().build())
        +   *           .build();
        +   *   ApiFuture future = complianceClient.setIamPolicyCallable().futureCall(request);
        +   *   // Do something.
        +   *   Policy response = future.get();
        +   * }
        +   * }
        + */ + public final UnaryCallable setIamPolicyCallable() { + return stub.setIamPolicyCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets the access control policy for a resource. Returns an empty policy if the resource exists + * and does not have a policy set. + * + *

        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 (ComplianceClient complianceClient = ComplianceClient.create()) {
        +   *   GetIamPolicyRequest request =
        +   *       GetIamPolicyRequest.newBuilder()
        +   *           .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString())
        +   *           .setOptions(GetPolicyOptions.newBuilder().build())
        +   *           .build();
        +   *   Policy response = complianceClient.getIamPolicy(request);
        +   * }
        +   * }
        + * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Policy getIamPolicy(GetIamPolicyRequest request) { + return getIamPolicyCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets the access control policy for a resource. Returns an empty policy if the resource exists + * and does not have a policy set. + * + *

        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 (ComplianceClient complianceClient = ComplianceClient.create()) {
        +   *   GetIamPolicyRequest request =
        +   *       GetIamPolicyRequest.newBuilder()
        +   *           .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString())
        +   *           .setOptions(GetPolicyOptions.newBuilder().build())
        +   *           .build();
        +   *   ApiFuture future = complianceClient.getIamPolicyCallable().futureCall(request);
        +   *   // Do something.
        +   *   Policy response = future.get();
        +   * }
        +   * }
        + */ + public final UnaryCallable getIamPolicyCallable() { + return stub.getIamPolicyCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Returns permissions that a caller has on the specified resource. If the resource does not + * exist, this will return an empty set of permissions, not a `NOT_FOUND` error. + * + *

        Note: This operation is designed to be used for building permission-aware UIs and + * command-line tools, not for authorization checking. This operation may "fail open" without + * warning. + * + *

        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 (ComplianceClient complianceClient = ComplianceClient.create()) {
        +   *   TestIamPermissionsRequest request =
        +   *       TestIamPermissionsRequest.newBuilder()
        +   *           .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString())
        +   *           .addAllPermissions(new ArrayList())
        +   *           .build();
        +   *   TestIamPermissionsResponse response = complianceClient.testIamPermissions(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 TestIamPermissionsResponse testIamPermissions(TestIamPermissionsRequest request) { + return testIamPermissionsCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Returns permissions that a caller has on the specified resource. If the resource does not + * exist, this will return an empty set of permissions, not a `NOT_FOUND` error. + * + *

        Note: This operation is designed to be used for building permission-aware UIs and + * command-line tools, not for authorization checking. This operation may "fail open" without + * warning. + * + *

        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 (ComplianceClient complianceClient = ComplianceClient.create()) {
        +   *   TestIamPermissionsRequest request =
        +   *       TestIamPermissionsRequest.newBuilder()
        +   *           .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString())
        +   *           .addAllPermissions(new ArrayList())
        +   *           .build();
        +   *   ApiFuture future =
        +   *       complianceClient.testIamPermissionsCallable().futureCall(request);
        +   *   // Do something.
        +   *   TestIamPermissionsResponse response = future.get();
        +   * }
        +   * }
        + */ + public final UnaryCallable + testIamPermissionsCallable() { + return stub.testIamPermissionsCallable(); + } + + @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 ListLocationsPagedResponse + extends AbstractPagedListResponse< + ListLocationsRequest, + ListLocationsResponse, + Location, + ListLocationsPage, + ListLocationsFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListLocationsPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + input -> new ListLocationsPagedResponse(input), + MoreExecutors.directExecutor()); + } + + private ListLocationsPagedResponse(ListLocationsPage page) { + super(page, ListLocationsFixedSizeCollection.createEmptyCollection()); + } + } + + public static class ListLocationsPage + extends AbstractPage< + ListLocationsRequest, ListLocationsResponse, Location, ListLocationsPage> { + + private ListLocationsPage( + PageContext context, + ListLocationsResponse response) { + super(context, response); + } + + private static ListLocationsPage createEmptyPage() { + return new ListLocationsPage(null, null); + } + + @Override + protected ListLocationsPage createPage( + PageContext context, + ListLocationsResponse response) { + return new ListLocationsPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class ListLocationsFixedSizeCollection + extends AbstractFixedSizeCollection< + ListLocationsRequest, + ListLocationsResponse, + Location, + ListLocationsPage, + ListLocationsFixedSizeCollection> { + + private ListLocationsFixedSizeCollection(List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListLocationsFixedSizeCollection createEmptyCollection() { + return new ListLocationsFixedSizeCollection(null, 0); + } + + @Override + protected ListLocationsFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListLocationsFixedSizeCollection(pages, collectionSize); + } + } +} diff --git a/java-showcase-3.25.8/gapic-showcase/src/main/java/com/google/showcase/v1beta1/ComplianceSettings.java b/java-showcase-3.25.8/gapic-showcase/src/main/java/com/google/showcase/v1beta1/ComplianceSettings.java new file mode 100644 index 0000000000..b96f3fcdbe --- /dev/null +++ b/java-showcase-3.25.8/gapic-showcase/src/main/java/com/google/showcase/v1beta1/ComplianceSettings.java @@ -0,0 +1,373 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1; + +import static com.google.showcase.v1beta1.ComplianceClient.ListLocationsPagedResponse; + +import com.google.api.core.ApiFunction; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; +import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; +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.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.showcase.v1beta1.stub.ComplianceStubSettings; +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 ComplianceClient}. + * + *

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

          + *
        • The default service address (localhost) and default port (7469) 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 repeatDataBody: + * + *

        {@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
        + * ComplianceSettings.Builder complianceSettingsBuilder = ComplianceSettings.newBuilder();
        + * complianceSettingsBuilder
        + *     .repeatDataBodySettings()
        + *     .setRetrySettings(
        + *         complianceSettingsBuilder
        + *             .repeatDataBodySettings()
        + *             .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());
        + * ComplianceSettings complianceSettings = complianceSettingsBuilder.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. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class ComplianceSettings extends ClientSettings { + + /** Returns the object with the settings used for calls to repeatDataBody. */ + public UnaryCallSettings repeatDataBodySettings() { + return ((ComplianceStubSettings) getStubSettings()).repeatDataBodySettings(); + } + + /** Returns the object with the settings used for calls to repeatDataBodyInfo. */ + public UnaryCallSettings repeatDataBodyInfoSettings() { + return ((ComplianceStubSettings) getStubSettings()).repeatDataBodyInfoSettings(); + } + + /** Returns the object with the settings used for calls to repeatDataQuery. */ + public UnaryCallSettings repeatDataQuerySettings() { + return ((ComplianceStubSettings) getStubSettings()).repeatDataQuerySettings(); + } + + /** Returns the object with the settings used for calls to repeatDataSimplePath. */ + public UnaryCallSettings repeatDataSimplePathSettings() { + return ((ComplianceStubSettings) getStubSettings()).repeatDataSimplePathSettings(); + } + + /** Returns the object with the settings used for calls to repeatDataPathResource. */ + public UnaryCallSettings repeatDataPathResourceSettings() { + return ((ComplianceStubSettings) getStubSettings()).repeatDataPathResourceSettings(); + } + + /** Returns the object with the settings used for calls to repeatDataPathTrailingResource. */ + public UnaryCallSettings repeatDataPathTrailingResourceSettings() { + return ((ComplianceStubSettings) getStubSettings()).repeatDataPathTrailingResourceSettings(); + } + + /** Returns the object with the settings used for calls to repeatDataBodyPut. */ + public UnaryCallSettings repeatDataBodyPutSettings() { + return ((ComplianceStubSettings) getStubSettings()).repeatDataBodyPutSettings(); + } + + /** Returns the object with the settings used for calls to repeatDataBodyPatch. */ + public UnaryCallSettings repeatDataBodyPatchSettings() { + return ((ComplianceStubSettings) getStubSettings()).repeatDataBodyPatchSettings(); + } + + /** Returns the object with the settings used for calls to getEnum. */ + public UnaryCallSettings getEnumSettings() { + return ((ComplianceStubSettings) getStubSettings()).getEnumSettings(); + } + + /** Returns the object with the settings used for calls to verifyEnum. */ + public UnaryCallSettings verifyEnumSettings() { + return ((ComplianceStubSettings) getStubSettings()).verifyEnumSettings(); + } + + /** Returns the object with the settings used for calls to listLocations. */ + public PagedCallSettings + listLocationsSettings() { + return ((ComplianceStubSettings) getStubSettings()).listLocationsSettings(); + } + + /** Returns the object with the settings used for calls to getLocation. */ + public UnaryCallSettings getLocationSettings() { + return ((ComplianceStubSettings) getStubSettings()).getLocationSettings(); + } + + /** Returns the object with the settings used for calls to setIamPolicy. */ + public UnaryCallSettings setIamPolicySettings() { + return ((ComplianceStubSettings) getStubSettings()).setIamPolicySettings(); + } + + /** Returns the object with the settings used for calls to getIamPolicy. */ + public UnaryCallSettings getIamPolicySettings() { + return ((ComplianceStubSettings) getStubSettings()).getIamPolicySettings(); + } + + /** Returns the object with the settings used for calls to testIamPermissions. */ + public UnaryCallSettings + testIamPermissionsSettings() { + return ((ComplianceStubSettings) getStubSettings()).testIamPermissionsSettings(); + } + + public static final ComplianceSettings create(ComplianceStubSettings stub) throws IOException { + return new ComplianceSettings.Builder(stub.toBuilder()).build(); + } + + /** Returns a builder for the default ExecutorProvider for this service. */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return ComplianceStubSettings.defaultExecutorProviderBuilder(); + } + + /** Returns the default service endpoint. */ + public static String getDefaultEndpoint() { + return ComplianceStubSettings.getDefaultEndpoint(); + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return ComplianceStubSettings.getDefaultServiceScopes(); + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return ComplianceStubSettings.defaultCredentialsProviderBuilder(); + } + + /** Returns a builder for the default gRPC ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return ComplianceStubSettings.defaultGrpcTransportProviderBuilder(); + } + + /** Returns a builder for the default REST ChannelProvider for this service. */ + @BetaApi + public static InstantiatingHttpJsonChannelProvider.Builder + defaultHttpJsonTransportProviderBuilder() { + return ComplianceStubSettings.defaultHttpJsonTransportProviderBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return ComplianceStubSettings.defaultTransportChannelProvider(); + } + + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return ComplianceStubSettings.defaultApiClientHeaderProviderBuilder(); + } + + /** Returns a new gRPC builder for this class. */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** Returns a new REST builder for this class. */ + public static Builder newHttpJsonBuilder() { + return Builder.createHttpJsonDefault(); + } + + /** 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 ComplianceSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + } + + /** Builder for ComplianceSettings. */ + public static class Builder extends ClientSettings.Builder { + + protected Builder() throws IOException { + this(((ClientContext) null)); + } + + protected Builder(ClientContext clientContext) { + super(ComplianceStubSettings.newBuilder(clientContext)); + } + + protected Builder(ComplianceSettings settings) { + super(settings.getStubSettings().toBuilder()); + } + + protected Builder(ComplianceStubSettings.Builder stubSettings) { + super(stubSettings); + } + + private static Builder createDefault() { + return new Builder(ComplianceStubSettings.newBuilder()); + } + + private static Builder createHttpJsonDefault() { + return new Builder(ComplianceStubSettings.newHttpJsonBuilder()); + } + + public ComplianceStubSettings.Builder getStubSettingsBuilder() { + return ((ComplianceStubSettings.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 repeatDataBody. */ + public UnaryCallSettings.Builder repeatDataBodySettings() { + return getStubSettingsBuilder().repeatDataBodySettings(); + } + + /** Returns the builder for the settings used for calls to repeatDataBodyInfo. */ + public UnaryCallSettings.Builder repeatDataBodyInfoSettings() { + return getStubSettingsBuilder().repeatDataBodyInfoSettings(); + } + + /** Returns the builder for the settings used for calls to repeatDataQuery. */ + public UnaryCallSettings.Builder repeatDataQuerySettings() { + return getStubSettingsBuilder().repeatDataQuerySettings(); + } + + /** Returns the builder for the settings used for calls to repeatDataSimplePath. */ + public UnaryCallSettings.Builder repeatDataSimplePathSettings() { + return getStubSettingsBuilder().repeatDataSimplePathSettings(); + } + + /** Returns the builder for the settings used for calls to repeatDataPathResource. */ + public UnaryCallSettings.Builder + repeatDataPathResourceSettings() { + return getStubSettingsBuilder().repeatDataPathResourceSettings(); + } + + /** Returns the builder for the settings used for calls to repeatDataPathTrailingResource. */ + public UnaryCallSettings.Builder + repeatDataPathTrailingResourceSettings() { + return getStubSettingsBuilder().repeatDataPathTrailingResourceSettings(); + } + + /** Returns the builder for the settings used for calls to repeatDataBodyPut. */ + public UnaryCallSettings.Builder repeatDataBodyPutSettings() { + return getStubSettingsBuilder().repeatDataBodyPutSettings(); + } + + /** Returns the builder for the settings used for calls to repeatDataBodyPatch. */ + public UnaryCallSettings.Builder repeatDataBodyPatchSettings() { + return getStubSettingsBuilder().repeatDataBodyPatchSettings(); + } + + /** Returns the builder for the settings used for calls to getEnum. */ + public UnaryCallSettings.Builder getEnumSettings() { + return getStubSettingsBuilder().getEnumSettings(); + } + + /** Returns the builder for the settings used for calls to verifyEnum. */ + public UnaryCallSettings.Builder verifyEnumSettings() { + return getStubSettingsBuilder().verifyEnumSettings(); + } + + /** Returns the builder for the settings used for calls to listLocations. */ + public PagedCallSettings.Builder< + ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse> + listLocationsSettings() { + return getStubSettingsBuilder().listLocationsSettings(); + } + + /** Returns the builder for the settings used for calls to getLocation. */ + public UnaryCallSettings.Builder getLocationSettings() { + return getStubSettingsBuilder().getLocationSettings(); + } + + /** Returns the builder for the settings used for calls to setIamPolicy. */ + public UnaryCallSettings.Builder setIamPolicySettings() { + return getStubSettingsBuilder().setIamPolicySettings(); + } + + /** Returns the builder for the settings used for calls to getIamPolicy. */ + public UnaryCallSettings.Builder getIamPolicySettings() { + return getStubSettingsBuilder().getIamPolicySettings(); + } + + /** Returns the builder for the settings used for calls to testIamPermissions. */ + public UnaryCallSettings.Builder + testIamPermissionsSettings() { + return getStubSettingsBuilder().testIamPermissionsSettings(); + } + + @Override + public ComplianceSettings build() throws IOException { + return new ComplianceSettings(this); + } + } +} diff --git a/java-showcase-3.25.8/gapic-showcase/src/main/java/com/google/showcase/v1beta1/EchoClient.java b/java-showcase-3.25.8/gapic-showcase/src/main/java/com/google/showcase/v1beta1/EchoClient.java new file mode 100644 index 0000000000..5f0a0b0a3d --- /dev/null +++ b/java-showcase-3.25.8/gapic-showcase/src/main/java/com/google/showcase/v1beta1/EchoClient.java @@ -0,0 +1,1781 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1; + +import com.google.api.core.ApiFuture; +import com.google.api.core.ApiFutures; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.httpjson.longrunning.OperationsClient; +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.BidiStreamingCallable; +import com.google.api.gax.rpc.ClientStreamingCallable; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.common.util.concurrent.MoreExecutors; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.longrunning.Operation; +import com.google.showcase.v1beta1.stub.EchoStub; +import com.google.showcase.v1beta1.stub.EchoStubSettings; +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: This service is used showcase the four main types of rpcs - unary, server + * side streaming, client side streaming, and bidirectional streaming. This service also exposes + * methods that explicitly implement server delay, and paginated calls. Set the 'showcase-trailer' + * metadata key on any method to have the values echoed in the response trailers. Set the + * 'x-goog-request-params' metadata key on any method to have the values echoed in the response + * headers. + * + *

        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 (EchoClient echoClient = EchoClient.create()) {
        + *   EchoRequest request =
        + *       EchoRequest.newBuilder()
        + *           .setSeverity(Severity.forNumber(0))
        + *           .setHeader("header-1221270899")
        + *           .setOtherHeader("otherHeader-2026585667")
        + *           .setRequestId("requestId693933066")
        + *           .setOtherRequestId("otherRequestId1248995034")
        + *           .build();
        + *   EchoResponse response = echoClient.echo(request);
        + * }
        + * }
        + * + *

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

        Echo

        This method simply echoes the request. This method showcases unary RPCs.

        + *

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

        + *
          + *
        • echo(EchoRequest request) + *

        + *

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

        + *
          + *
        • echoCallable() + *

        + *

        EchoErrorDetails

        This method returns error details in a repeated "google.protobuf.Any" field. This method showcases handling errors thus encoded, particularly over REST transport. Note that GAPICs only allow the type "google.protobuf.Any" for field paths ending in "error.details", and, at run-time, the actual types for these fields must be one of the types in google/rpc/error_details.proto.

        + *

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

        + *
          + *
        • echoErrorDetails(EchoErrorDetailsRequest request) + *

        + *

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

        + *
          + *
        • echoErrorDetailsCallable() + *

        + *

        FailEchoWithDetails

        This method always fails with a gRPC "Aborted" error status that contains multiple error details. These include one instance of each of the standard ones in error_details.proto (https://github.com/googleapis/googleapis/blob/master/google/rpc/error_details.proto) plus a custom, Showcase-defined PoetryError. The intent of this RPC is to verify that GAPICs can process these various error details and surface them to the user in an idiomatic form.

        + *

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

        + *
          + *
        • failEchoWithDetails(FailEchoWithDetailsRequest request) + *

        + *

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

        + *
          + *
        • failEchoWithDetailsCallable() + *

        + *

        Expand

        This method splits the given content into words and will pass each word back through the stream. This method showcases server-side streaming RPCs.

        + *

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

        + *
          + *
        • expandCallable() + *

        + *

        Collect

        This method will collect the words given to it. When the stream is closed by the client, this method will return the a concatenation of the strings passed to it. This method showcases client-side streaming RPCs.

        + *

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

        + *
          + *
        • collectCallable() + *

        + *

        Chat

        This method, upon receiving a request on the stream, will pass the same content back on the stream. This method showcases bidirectional streaming RPCs.

        + *

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

        + *
          + *
        • chatCallable() + *

        + *

        PagedExpand

        This is similar to the Expand method but instead of returning a stream of expanded words, this method returns a paged list of expanded words.

        + *

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

        + *
          + *
        • pagedExpand(PagedExpandRequest request) + *

        + *

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

        + *
          + *
        • pagedExpandPagedCallable() + *

        • pagedExpandCallable() + *

        + *

        PagedExpandLegacy

        This is similar to the PagedExpand except that it uses max_results instead of page_size, as some legacy APIs still do. New APIs should NOT use this pattern.

        + *

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

        + *
          + *
        • pagedExpandLegacy(PagedExpandLegacyRequest request) + *

        + *

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

        + *
          + *
        • pagedExpandLegacyCallable() + *

        + *

        PagedExpandLegacyMapped

        This method returns a map containing lists of words that appear in the input, keyed by their initial character. The only words returned are the ones included in the current page, as determined by page_token and page_size, which both refer to the word indices in the input. This paging result consisting of a map of lists is a pattern used by some legacy APIs. New APIs should NOT use this pattern.

        + *

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

        + *
          + *
        • pagedExpandLegacyMapped(PagedExpandRequest request) + *

        + *

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

        + *
          + *
        • pagedExpandLegacyMappedPagedCallable() + *

        • pagedExpandLegacyMappedCallable() + *

        + *

        Wait

        This method will wait for the requested amount of time and then return. This method showcases how a client handles a request timeout.

        + *

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

        + *
          + *
        • waitAsync(WaitRequest request) + *

        + *

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

        + *
          + *
        • waitOperationCallable() + *

        • waitCallable() + *

        + *

        Block

        This method will block (wait) for the requested amount of time and then return the response or error. This method showcases how a client handles delays or retries.

        + *

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

        + *
          + *
        • block(BlockRequest request) + *

        + *

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

        + *
          + *
        • blockCallable() + *

        + *

        ListLocations

        Lists information about the supported locations for this service.

        + *

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

        + *
          + *
        • listLocations(ListLocationsRequest request) + *

        + *

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

        + *
          + *
        • listLocationsPagedCallable() + *

        • listLocationsCallable() + *

        + *

        GetLocation

        Gets information about a location.

        + *

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

        + *
          + *
        • getLocation(GetLocationRequest request) + *

        + *

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

        + *
          + *
        • getLocationCallable() + *

        + *

        SetIamPolicy

        Sets the access control policy on the specified resource. Replaces any existing policy. + *

        Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED` errors.

        + *

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

        + *
          + *
        • setIamPolicy(SetIamPolicyRequest request) + *

        + *

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

        + *
          + *
        • setIamPolicyCallable() + *

        + *

        GetIamPolicy

        Gets the access control policy for a resource. Returns an empty policy if the resource exists and does not have a policy set.

        + *

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

        + *
          + *
        • getIamPolicy(GetIamPolicyRequest request) + *

        + *

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

        + *
          + *
        • getIamPolicyCallable() + *

        + *

        TestIamPermissions

        Returns permissions that a caller has on the specified resource. If the resource does not exist, this will return an empty set of permissions, not a `NOT_FOUND` error. + *

        Note: This operation is designed to be used for building permission-aware UIs and command-line tools, not for authorization checking. This operation may "fail open" without warning.

        + *

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

        + *
          + *
        • testIamPermissions(TestIamPermissionsRequest request) + *

        + *

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

        + *
          + *
        • testIamPermissionsCallable() + *

        + *
        + * + *

        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 EchoSettings 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
        + * EchoSettings echoSettings =
        + *     EchoSettings.newBuilder()
        + *         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
        + *         .build();
        + * EchoClient echoClient = EchoClient.create(echoSettings);
        + * }
        + * + *

        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
        + * EchoSettings echoSettings = EchoSettings.newBuilder().setEndpoint(myEndpoint).build();
        + * EchoClient echoClient = EchoClient.create(echoSettings);
        + * }
        + * + *

        To use REST (HTTP1.1/JSON) transport (instead of gRPC) for sending and receiving requests over + * the wire: + * + *

        {@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
        + * EchoSettings echoSettings = EchoSettings.newHttpJsonBuilder().build();
        + * EchoClient echoClient = EchoClient.create(echoSettings);
        + * }
        + * + *

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

        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 (EchoClient echoClient = EchoClient.create()) {
        +   *   EchoRequest request =
        +   *       EchoRequest.newBuilder()
        +   *           .setSeverity(Severity.forNumber(0))
        +   *           .setHeader("header-1221270899")
        +   *           .setOtherHeader("otherHeader-2026585667")
        +   *           .setRequestId("requestId693933066")
        +   *           .setOtherRequestId("otherRequestId1248995034")
        +   *           .build();
        +   *   EchoResponse response = echoClient.echo(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 EchoResponse echo(EchoRequest request) { + return echoCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * This method simply echoes the request. This method showcases unary RPCs. + * + *

        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 (EchoClient echoClient = EchoClient.create()) {
        +   *   EchoRequest request =
        +   *       EchoRequest.newBuilder()
        +   *           .setSeverity(Severity.forNumber(0))
        +   *           .setHeader("header-1221270899")
        +   *           .setOtherHeader("otherHeader-2026585667")
        +   *           .setRequestId("requestId693933066")
        +   *           .setOtherRequestId("otherRequestId1248995034")
        +   *           .build();
        +   *   ApiFuture future = echoClient.echoCallable().futureCall(request);
        +   *   // Do something.
        +   *   EchoResponse response = future.get();
        +   * }
        +   * }
        + */ + public final UnaryCallable echoCallable() { + return stub.echoCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * This method returns error details in a repeated "google.protobuf.Any" field. This method + * showcases handling errors thus encoded, particularly over REST transport. Note that GAPICs only + * allow the type "google.protobuf.Any" for field paths ending in "error.details", and, at + * run-time, the actual types for these fields must be one of the types in + * google/rpc/error_details.proto. + * + *

        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 (EchoClient echoClient = EchoClient.create()) {
        +   *   EchoErrorDetailsRequest request =
        +   *       EchoErrorDetailsRequest.newBuilder()
        +   *           .setSingleDetailText("singleDetailText1774380934")
        +   *           .addAllMultiDetailText(new ArrayList())
        +   *           .build();
        +   *   EchoErrorDetailsResponse response = echoClient.echoErrorDetails(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 EchoErrorDetailsResponse echoErrorDetails(EchoErrorDetailsRequest request) { + return echoErrorDetailsCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * This method returns error details in a repeated "google.protobuf.Any" field. This method + * showcases handling errors thus encoded, particularly over REST transport. Note that GAPICs only + * allow the type "google.protobuf.Any" for field paths ending in "error.details", and, at + * run-time, the actual types for these fields must be one of the types in + * google/rpc/error_details.proto. + * + *

        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 (EchoClient echoClient = EchoClient.create()) {
        +   *   EchoErrorDetailsRequest request =
        +   *       EchoErrorDetailsRequest.newBuilder()
        +   *           .setSingleDetailText("singleDetailText1774380934")
        +   *           .addAllMultiDetailText(new ArrayList())
        +   *           .build();
        +   *   ApiFuture future =
        +   *       echoClient.echoErrorDetailsCallable().futureCall(request);
        +   *   // Do something.
        +   *   EchoErrorDetailsResponse response = future.get();
        +   * }
        +   * }
        + */ + public final UnaryCallable + echoErrorDetailsCallable() { + return stub.echoErrorDetailsCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * This method always fails with a gRPC "Aborted" error status that contains multiple error + * details. These include one instance of each of the standard ones in error_details.proto + * (https://github.com/googleapis/googleapis/blob/master/google/rpc/error_details.proto) plus a + * custom, Showcase-defined PoetryError. The intent of this RPC is to verify that GAPICs can + * process these various error details and surface them to the user in an idiomatic form. + * + *

        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 (EchoClient echoClient = EchoClient.create()) {
        +   *   FailEchoWithDetailsRequest request =
        +   *       FailEchoWithDetailsRequest.newBuilder().setMessage("message954925063").build();
        +   *   FailEchoWithDetailsResponse response = echoClient.failEchoWithDetails(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 FailEchoWithDetailsResponse failEchoWithDetails(FailEchoWithDetailsRequest request) { + return failEchoWithDetailsCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * This method always fails with a gRPC "Aborted" error status that contains multiple error + * details. These include one instance of each of the standard ones in error_details.proto + * (https://github.com/googleapis/googleapis/blob/master/google/rpc/error_details.proto) plus a + * custom, Showcase-defined PoetryError. The intent of this RPC is to verify that GAPICs can + * process these various error details and surface them to the user in an idiomatic form. + * + *

        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 (EchoClient echoClient = EchoClient.create()) {
        +   *   FailEchoWithDetailsRequest request =
        +   *       FailEchoWithDetailsRequest.newBuilder().setMessage("message954925063").build();
        +   *   ApiFuture future =
        +   *       echoClient.failEchoWithDetailsCallable().futureCall(request);
        +   *   // Do something.
        +   *   FailEchoWithDetailsResponse response = future.get();
        +   * }
        +   * }
        + */ + public final UnaryCallable + failEchoWithDetailsCallable() { + return stub.failEchoWithDetailsCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * This method splits the given content into words and will pass each word back through the + * stream. This method showcases server-side streaming RPCs. + * + *

        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 (EchoClient echoClient = EchoClient.create()) {
        +   *   ExpandRequest request =
        +   *       ExpandRequest.newBuilder()
        +   *           .setContent("content951530617")
        +   *           .setError(Status.newBuilder().build())
        +   *           .setStreamWaitTime(Duration.newBuilder().build())
        +   *           .build();
        +   *   ServerStream stream = echoClient.expandCallable().call(request);
        +   *   for (EchoResponse response : stream) {
        +   *     // Do something when a response is received.
        +   *   }
        +   * }
        +   * }
        + */ + public final ServerStreamingCallable expandCallable() { + return stub.expandCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * This method will collect the words given to it. When the stream is closed by the client, this + * method will return the a concatenation of the strings passed to it. This method showcases + * client-side streaming RPCs. + * + *

        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 (EchoClient echoClient = EchoClient.create()) {
        +   *   ApiStreamObserver responseObserver =
        +   *       new ApiStreamObserver() {
        +   *         {@literal @}Override
        +   *         public void onNext(EchoResponse response) {
        +   *           // Do something when a response is received.
        +   *         }
        +   *
        +   *         {@literal @}Override
        +   *         public void onError(Throwable t) {
        +   *           // Add error-handling
        +   *         }
        +   *
        +   *         {@literal @}Override
        +   *         public void onCompleted() {
        +   *           // Do something when complete.
        +   *         }
        +   *       };
        +   *   ApiStreamObserver requestObserver =
        +   *       echoClient.collect().clientStreamingCall(responseObserver);
        +   *   EchoRequest request =
        +   *       EchoRequest.newBuilder()
        +   *           .setSeverity(Severity.forNumber(0))
        +   *           .setHeader("header-1221270899")
        +   *           .setOtherHeader("otherHeader-2026585667")
        +   *           .setRequestId("requestId693933066")
        +   *           .setOtherRequestId("otherRequestId1248995034")
        +   *           .build();
        +   *   requestObserver.onNext(request);
        +   * }
        +   * }
        + */ + public final ClientStreamingCallable collectCallable() { + return stub.collectCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * This method, upon receiving a request on the stream, will pass the same content back on the + * stream. This method showcases bidirectional streaming RPCs. + * + *

        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 (EchoClient echoClient = EchoClient.create()) {
        +   *   BidiStream bidiStream = echoClient.chatCallable().call();
        +   *   EchoRequest request =
        +   *       EchoRequest.newBuilder()
        +   *           .setSeverity(Severity.forNumber(0))
        +   *           .setHeader("header-1221270899")
        +   *           .setOtherHeader("otherHeader-2026585667")
        +   *           .setRequestId("requestId693933066")
        +   *           .setOtherRequestId("otherRequestId1248995034")
        +   *           .build();
        +   *   bidiStream.send(request);
        +   *   for (EchoResponse response : bidiStream) {
        +   *     // Do something when a response is received.
        +   *   }
        +   * }
        +   * }
        + */ + public final BidiStreamingCallable chatCallable() { + return stub.chatCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * This is similar to the Expand method but instead of returning a stream of expanded words, this + * method returns a paged list of expanded words. + * + *

        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 (EchoClient echoClient = EchoClient.create()) {
        +   *   PagedExpandRequest request =
        +   *       PagedExpandRequest.newBuilder()
        +   *           .setContent("content951530617")
        +   *           .setPageSize(883849137)
        +   *           .setPageToken("pageToken873572522")
        +   *           .build();
        +   *   for (EchoResponse element : echoClient.pagedExpand(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 PagedExpandPagedResponse pagedExpand(PagedExpandRequest request) { + return pagedExpandPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * This is similar to the Expand method but instead of returning a stream of expanded words, this + * method returns a paged list of expanded words. + * + *

        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 (EchoClient echoClient = EchoClient.create()) {
        +   *   PagedExpandRequest request =
        +   *       PagedExpandRequest.newBuilder()
        +   *           .setContent("content951530617")
        +   *           .setPageSize(883849137)
        +   *           .setPageToken("pageToken873572522")
        +   *           .build();
        +   *   ApiFuture future = echoClient.pagedExpandPagedCallable().futureCall(request);
        +   *   // Do something.
        +   *   for (EchoResponse element : future.get().iterateAll()) {
        +   *     // doThingsWith(element);
        +   *   }
        +   * }
        +   * }
        + */ + public final UnaryCallable + pagedExpandPagedCallable() { + return stub.pagedExpandPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * This is similar to the Expand method but instead of returning a stream of expanded words, this + * method returns a paged list of expanded words. + * + *

        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 (EchoClient echoClient = EchoClient.create()) {
        +   *   PagedExpandRequest request =
        +   *       PagedExpandRequest.newBuilder()
        +   *           .setContent("content951530617")
        +   *           .setPageSize(883849137)
        +   *           .setPageToken("pageToken873572522")
        +   *           .build();
        +   *   while (true) {
        +   *     PagedExpandResponse response = echoClient.pagedExpandCallable().call(request);
        +   *     for (EchoResponse element : response.getResponsesList()) {
        +   *       // doThingsWith(element);
        +   *     }
        +   *     String nextPageToken = response.getNextPageToken();
        +   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
        +   *       request = request.toBuilder().setPageToken(nextPageToken).build();
        +   *     } else {
        +   *       break;
        +   *     }
        +   *   }
        +   * }
        +   * }
        + */ + public final UnaryCallable pagedExpandCallable() { + return stub.pagedExpandCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * This is similar to the PagedExpand except that it uses max_results instead of page_size, as + * some legacy APIs still do. New APIs should NOT use this pattern. + * + *

        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 (EchoClient echoClient = EchoClient.create()) {
        +   *   PagedExpandLegacyRequest request =
        +   *       PagedExpandLegacyRequest.newBuilder()
        +   *           .setContent("content951530617")
        +   *           .setMaxResults(1128457243)
        +   *           .setPageToken("pageToken873572522")
        +   *           .build();
        +   *   PagedExpandResponse response = echoClient.pagedExpandLegacy(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 PagedExpandResponse pagedExpandLegacy(PagedExpandLegacyRequest request) { + return pagedExpandLegacyCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * This is similar to the PagedExpand except that it uses max_results instead of page_size, as + * some legacy APIs still do. New APIs should NOT use this pattern. + * + *

        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 (EchoClient echoClient = EchoClient.create()) {
        +   *   PagedExpandLegacyRequest request =
        +   *       PagedExpandLegacyRequest.newBuilder()
        +   *           .setContent("content951530617")
        +   *           .setMaxResults(1128457243)
        +   *           .setPageToken("pageToken873572522")
        +   *           .build();
        +   *   ApiFuture future =
        +   *       echoClient.pagedExpandLegacyCallable().futureCall(request);
        +   *   // Do something.
        +   *   PagedExpandResponse response = future.get();
        +   * }
        +   * }
        + */ + public final UnaryCallable + pagedExpandLegacyCallable() { + return stub.pagedExpandLegacyCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * This method returns a map containing lists of words that appear in the input, keyed by their + * initial character. The only words returned are the ones included in the current page, as + * determined by page_token and page_size, which both refer to the word indices in the input. This + * paging result consisting of a map of lists is a pattern used by some legacy APIs. New APIs + * should NOT use this pattern. + * + *

        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 (EchoClient echoClient = EchoClient.create()) {
        +   *   PagedExpandRequest request =
        +   *       PagedExpandRequest.newBuilder()
        +   *           .setContent("content951530617")
        +   *           .setPageSize(883849137)
        +   *           .setPageToken("pageToken873572522")
        +   *           .build();
        +   *   for (Map.Entry element :
        +   *       echoClient.pagedExpandLegacyMapped(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 PagedExpandLegacyMappedPagedResponse pagedExpandLegacyMapped( + PagedExpandRequest request) { + return pagedExpandLegacyMappedPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * This method returns a map containing lists of words that appear in the input, keyed by their + * initial character. The only words returned are the ones included in the current page, as + * determined by page_token and page_size, which both refer to the word indices in the input. This + * paging result consisting of a map of lists is a pattern used by some legacy APIs. New APIs + * should NOT use this pattern. + * + *

        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 (EchoClient echoClient = EchoClient.create()) {
        +   *   PagedExpandRequest request =
        +   *       PagedExpandRequest.newBuilder()
        +   *           .setContent("content951530617")
        +   *           .setPageSize(883849137)
        +   *           .setPageToken("pageToken873572522")
        +   *           .build();
        +   *   ApiFuture> future =
        +   *       echoClient.pagedExpandLegacyMappedPagedCallable().futureCall(request);
        +   *   // Do something.
        +   *   for (Map.Entry element : future.get().iterateAll()) {
        +   *     // doThingsWith(element);
        +   *   }
        +   * }
        +   * }
        + */ + public final UnaryCallable + pagedExpandLegacyMappedPagedCallable() { + return stub.pagedExpandLegacyMappedPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * This method returns a map containing lists of words that appear in the input, keyed by their + * initial character. The only words returned are the ones included in the current page, as + * determined by page_token and page_size, which both refer to the word indices in the input. This + * paging result consisting of a map of lists is a pattern used by some legacy APIs. New APIs + * should NOT use this pattern. + * + *

        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 (EchoClient echoClient = EchoClient.create()) {
        +   *   PagedExpandRequest request =
        +   *       PagedExpandRequest.newBuilder()
        +   *           .setContent("content951530617")
        +   *           .setPageSize(883849137)
        +   *           .setPageToken("pageToken873572522")
        +   *           .build();
        +   *   while (true) {
        +   *     PagedExpandLegacyMappedResponse response =
        +   *         echoClient.pagedExpandLegacyMappedCallable().call(request);
        +   *     for (Map.Entry element : response.getAlphabetizedList()) {
        +   *       // doThingsWith(element);
        +   *     }
        +   *     String nextPageToken = response.getNextPageToken();
        +   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
        +   *       request = request.toBuilder().setPageToken(nextPageToken).build();
        +   *     } else {
        +   *       break;
        +   *     }
        +   *   }
        +   * }
        +   * }
        + */ + public final UnaryCallable + pagedExpandLegacyMappedCallable() { + return stub.pagedExpandLegacyMappedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * This method will wait for the requested amount of time and then return. This method showcases + * how a client handles a request timeout. + * + *

        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 (EchoClient echoClient = EchoClient.create()) {
        +   *   WaitRequest request = WaitRequest.newBuilder().build();
        +   *   WaitResponse response = echoClient.waitAsync(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 waitAsync(WaitRequest request) { + return waitOperationCallable().futureCall(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * This method will wait for the requested amount of time and then return. This method showcases + * how a client handles a request timeout. + * + *

        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 (EchoClient echoClient = EchoClient.create()) {
        +   *   WaitRequest request = WaitRequest.newBuilder().build();
        +   *   OperationFuture future =
        +   *       echoClient.waitOperationCallable().futureCall(request);
        +   *   // Do something.
        +   *   WaitResponse response = future.get();
        +   * }
        +   * }
        + */ + public final OperationCallable waitOperationCallable() { + return stub.waitOperationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * This method will wait for the requested amount of time and then return. This method showcases + * how a client handles a request timeout. + * + *

        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 (EchoClient echoClient = EchoClient.create()) {
        +   *   WaitRequest request = WaitRequest.newBuilder().build();
        +   *   ApiFuture future = echoClient.waitCallable().futureCall(request);
        +   *   // Do something.
        +   *   Operation response = future.get();
        +   * }
        +   * }
        + */ + public final UnaryCallable waitCallable() { + return stub.waitCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * This method will block (wait) for the requested amount of time and then return the response or + * error. This method showcases how a client handles delays or retries. + * + *

        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 (EchoClient echoClient = EchoClient.create()) {
        +   *   BlockRequest request =
        +   *       BlockRequest.newBuilder().setResponseDelay(Duration.newBuilder().build()).build();
        +   *   BlockResponse response = echoClient.block(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 BlockResponse block(BlockRequest request) { + return blockCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * This method will block (wait) for the requested amount of time and then return the response or + * error. This method showcases how a client handles delays or retries. + * + *

        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 (EchoClient echoClient = EchoClient.create()) {
        +   *   BlockRequest request =
        +   *       BlockRequest.newBuilder().setResponseDelay(Duration.newBuilder().build()).build();
        +   *   ApiFuture future = echoClient.blockCallable().futureCall(request);
        +   *   // Do something.
        +   *   BlockResponse response = future.get();
        +   * }
        +   * }
        + */ + public final UnaryCallable blockCallable() { + return stub.blockCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists information about the supported locations for this service. + * + *

        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 (EchoClient echoClient = EchoClient.create()) {
        +   *   ListLocationsRequest request =
        +   *       ListLocationsRequest.newBuilder()
        +   *           .setName("name3373707")
        +   *           .setFilter("filter-1274492040")
        +   *           .setPageSize(883849137)
        +   *           .setPageToken("pageToken873572522")
        +   *           .build();
        +   *   for (Location element : echoClient.listLocations(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 ListLocationsPagedResponse listLocations(ListLocationsRequest request) { + return listLocationsPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists information about the supported locations for this service. + * + *

        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 (EchoClient echoClient = EchoClient.create()) {
        +   *   ListLocationsRequest request =
        +   *       ListLocationsRequest.newBuilder()
        +   *           .setName("name3373707")
        +   *           .setFilter("filter-1274492040")
        +   *           .setPageSize(883849137)
        +   *           .setPageToken("pageToken873572522")
        +   *           .build();
        +   *   ApiFuture future = echoClient.listLocationsPagedCallable().futureCall(request);
        +   *   // Do something.
        +   *   for (Location element : future.get().iterateAll()) {
        +   *     // doThingsWith(element);
        +   *   }
        +   * }
        +   * }
        + */ + public final UnaryCallable + listLocationsPagedCallable() { + return stub.listLocationsPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists information about the supported locations for this service. + * + *

        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 (EchoClient echoClient = EchoClient.create()) {
        +   *   ListLocationsRequest request =
        +   *       ListLocationsRequest.newBuilder()
        +   *           .setName("name3373707")
        +   *           .setFilter("filter-1274492040")
        +   *           .setPageSize(883849137)
        +   *           .setPageToken("pageToken873572522")
        +   *           .build();
        +   *   while (true) {
        +   *     ListLocationsResponse response = echoClient.listLocationsCallable().call(request);
        +   *     for (Location element : response.getLocationsList()) {
        +   *       // doThingsWith(element);
        +   *     }
        +   *     String nextPageToken = response.getNextPageToken();
        +   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
        +   *       request = request.toBuilder().setPageToken(nextPageToken).build();
        +   *     } else {
        +   *       break;
        +   *     }
        +   *   }
        +   * }
        +   * }
        + */ + public final UnaryCallable listLocationsCallable() { + return stub.listLocationsCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets information about a location. + * + *

        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 (EchoClient echoClient = EchoClient.create()) {
        +   *   GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build();
        +   *   Location response = echoClient.getLocation(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 Location getLocation(GetLocationRequest request) { + return getLocationCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets information about a location. + * + *

        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 (EchoClient echoClient = EchoClient.create()) {
        +   *   GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build();
        +   *   ApiFuture future = echoClient.getLocationCallable().futureCall(request);
        +   *   // Do something.
        +   *   Location response = future.get();
        +   * }
        +   * }
        + */ + public final UnaryCallable getLocationCallable() { + return stub.getLocationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Sets the access control policy on the specified resource. Replaces any existing policy. + * + *

        Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED` errors. + * + *

        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 (EchoClient echoClient = EchoClient.create()) {
        +   *   SetIamPolicyRequest request =
        +   *       SetIamPolicyRequest.newBuilder()
        +   *           .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString())
        +   *           .setPolicy(Policy.newBuilder().build())
        +   *           .setUpdateMask(FieldMask.newBuilder().build())
        +   *           .build();
        +   *   Policy response = echoClient.setIamPolicy(request);
        +   * }
        +   * }
        + * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Policy setIamPolicy(SetIamPolicyRequest request) { + return setIamPolicyCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Sets the access control policy on the specified resource. Replaces any existing policy. + * + *

        Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED` errors. + * + *

        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 (EchoClient echoClient = EchoClient.create()) {
        +   *   SetIamPolicyRequest request =
        +   *       SetIamPolicyRequest.newBuilder()
        +   *           .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString())
        +   *           .setPolicy(Policy.newBuilder().build())
        +   *           .setUpdateMask(FieldMask.newBuilder().build())
        +   *           .build();
        +   *   ApiFuture future = echoClient.setIamPolicyCallable().futureCall(request);
        +   *   // Do something.
        +   *   Policy response = future.get();
        +   * }
        +   * }
        + */ + public final UnaryCallable setIamPolicyCallable() { + return stub.setIamPolicyCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets the access control policy for a resource. Returns an empty policy if the resource exists + * and does not have a policy set. + * + *

        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 (EchoClient echoClient = EchoClient.create()) {
        +   *   GetIamPolicyRequest request =
        +   *       GetIamPolicyRequest.newBuilder()
        +   *           .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString())
        +   *           .setOptions(GetPolicyOptions.newBuilder().build())
        +   *           .build();
        +   *   Policy response = echoClient.getIamPolicy(request);
        +   * }
        +   * }
        + * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Policy getIamPolicy(GetIamPolicyRequest request) { + return getIamPolicyCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets the access control policy for a resource. Returns an empty policy if the resource exists + * and does not have a policy set. + * + *

        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 (EchoClient echoClient = EchoClient.create()) {
        +   *   GetIamPolicyRequest request =
        +   *       GetIamPolicyRequest.newBuilder()
        +   *           .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString())
        +   *           .setOptions(GetPolicyOptions.newBuilder().build())
        +   *           .build();
        +   *   ApiFuture future = echoClient.getIamPolicyCallable().futureCall(request);
        +   *   // Do something.
        +   *   Policy response = future.get();
        +   * }
        +   * }
        + */ + public final UnaryCallable getIamPolicyCallable() { + return stub.getIamPolicyCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Returns permissions that a caller has on the specified resource. If the resource does not + * exist, this will return an empty set of permissions, not a `NOT_FOUND` error. + * + *

        Note: This operation is designed to be used for building permission-aware UIs and + * command-line tools, not for authorization checking. This operation may "fail open" without + * warning. + * + *

        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 (EchoClient echoClient = EchoClient.create()) {
        +   *   TestIamPermissionsRequest request =
        +   *       TestIamPermissionsRequest.newBuilder()
        +   *           .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString())
        +   *           .addAllPermissions(new ArrayList())
        +   *           .build();
        +   *   TestIamPermissionsResponse response = echoClient.testIamPermissions(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 TestIamPermissionsResponse testIamPermissions(TestIamPermissionsRequest request) { + return testIamPermissionsCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Returns permissions that a caller has on the specified resource. If the resource does not + * exist, this will return an empty set of permissions, not a `NOT_FOUND` error. + * + *

        Note: This operation is designed to be used for building permission-aware UIs and + * command-line tools, not for authorization checking. This operation may "fail open" without + * warning. + * + *

        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 (EchoClient echoClient = EchoClient.create()) {
        +   *   TestIamPermissionsRequest request =
        +   *       TestIamPermissionsRequest.newBuilder()
        +   *           .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString())
        +   *           .addAllPermissions(new ArrayList())
        +   *           .build();
        +   *   ApiFuture future =
        +   *       echoClient.testIamPermissionsCallable().futureCall(request);
        +   *   // Do something.
        +   *   TestIamPermissionsResponse response = future.get();
        +   * }
        +   * }
        + */ + public final UnaryCallable + testIamPermissionsCallable() { + return stub.testIamPermissionsCallable(); + } + + @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 PagedExpandPagedResponse + extends AbstractPagedListResponse< + PagedExpandRequest, + PagedExpandResponse, + EchoResponse, + PagedExpandPage, + PagedExpandFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + PagedExpandPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, input -> new PagedExpandPagedResponse(input), MoreExecutors.directExecutor()); + } + + private PagedExpandPagedResponse(PagedExpandPage page) { + super(page, PagedExpandFixedSizeCollection.createEmptyCollection()); + } + } + + public static class PagedExpandPage + extends AbstractPage { + + private PagedExpandPage( + PageContext context, + PagedExpandResponse response) { + super(context, response); + } + + private static PagedExpandPage createEmptyPage() { + return new PagedExpandPage(null, null); + } + + @Override + protected PagedExpandPage createPage( + PageContext context, + PagedExpandResponse response) { + return new PagedExpandPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class PagedExpandFixedSizeCollection + extends AbstractFixedSizeCollection< + PagedExpandRequest, + PagedExpandResponse, + EchoResponse, + PagedExpandPage, + PagedExpandFixedSizeCollection> { + + private PagedExpandFixedSizeCollection(List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static PagedExpandFixedSizeCollection createEmptyCollection() { + return new PagedExpandFixedSizeCollection(null, 0); + } + + @Override + protected PagedExpandFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new PagedExpandFixedSizeCollection(pages, collectionSize); + } + } + + public static class PagedExpandLegacyMappedPagedResponse + extends AbstractPagedListResponse< + PagedExpandRequest, + PagedExpandLegacyMappedResponse, + Map.Entry, + PagedExpandLegacyMappedPage, + PagedExpandLegacyMappedFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext< + PagedExpandRequest, + PagedExpandLegacyMappedResponse, + Map.Entry> + context, + ApiFuture futureResponse) { + ApiFuture futurePage = + PagedExpandLegacyMappedPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + input -> new PagedExpandLegacyMappedPagedResponse(input), + MoreExecutors.directExecutor()); + } + + private PagedExpandLegacyMappedPagedResponse(PagedExpandLegacyMappedPage page) { + super(page, PagedExpandLegacyMappedFixedSizeCollection.createEmptyCollection()); + } + } + + public static class PagedExpandLegacyMappedPage + extends AbstractPage< + PagedExpandRequest, + PagedExpandLegacyMappedResponse, + Map.Entry, + PagedExpandLegacyMappedPage> { + + private PagedExpandLegacyMappedPage( + PageContext< + PagedExpandRequest, + PagedExpandLegacyMappedResponse, + Map.Entry> + context, + PagedExpandLegacyMappedResponse response) { + super(context, response); + } + + private static PagedExpandLegacyMappedPage createEmptyPage() { + return new PagedExpandLegacyMappedPage(null, null); + } + + @Override + protected PagedExpandLegacyMappedPage createPage( + PageContext< + PagedExpandRequest, + PagedExpandLegacyMappedResponse, + Map.Entry> + context, + PagedExpandLegacyMappedResponse response) { + return new PagedExpandLegacyMappedPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext< + PagedExpandRequest, + PagedExpandLegacyMappedResponse, + Map.Entry> + context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class PagedExpandLegacyMappedFixedSizeCollection + extends AbstractFixedSizeCollection< + PagedExpandRequest, + PagedExpandLegacyMappedResponse, + Map.Entry, + PagedExpandLegacyMappedPage, + PagedExpandLegacyMappedFixedSizeCollection> { + + private PagedExpandLegacyMappedFixedSizeCollection( + List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static PagedExpandLegacyMappedFixedSizeCollection createEmptyCollection() { + return new PagedExpandLegacyMappedFixedSizeCollection(null, 0); + } + + @Override + protected PagedExpandLegacyMappedFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new PagedExpandLegacyMappedFixedSizeCollection(pages, collectionSize); + } + } + + public static class ListLocationsPagedResponse + extends AbstractPagedListResponse< + ListLocationsRequest, + ListLocationsResponse, + Location, + ListLocationsPage, + ListLocationsFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListLocationsPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + input -> new ListLocationsPagedResponse(input), + MoreExecutors.directExecutor()); + } + + private ListLocationsPagedResponse(ListLocationsPage page) { + super(page, ListLocationsFixedSizeCollection.createEmptyCollection()); + } + } + + public static class ListLocationsPage + extends AbstractPage< + ListLocationsRequest, ListLocationsResponse, Location, ListLocationsPage> { + + private ListLocationsPage( + PageContext context, + ListLocationsResponse response) { + super(context, response); + } + + private static ListLocationsPage createEmptyPage() { + return new ListLocationsPage(null, null); + } + + @Override + protected ListLocationsPage createPage( + PageContext context, + ListLocationsResponse response) { + return new ListLocationsPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class ListLocationsFixedSizeCollection + extends AbstractFixedSizeCollection< + ListLocationsRequest, + ListLocationsResponse, + Location, + ListLocationsPage, + ListLocationsFixedSizeCollection> { + + private ListLocationsFixedSizeCollection(List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListLocationsFixedSizeCollection createEmptyCollection() { + return new ListLocationsFixedSizeCollection(null, 0); + } + + @Override + protected ListLocationsFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListLocationsFixedSizeCollection(pages, collectionSize); + } + } +} diff --git a/java-showcase-3.25.8/gapic-showcase/src/main/java/com/google/showcase/v1beta1/EchoSettings.java b/java-showcase-3.25.8/gapic-showcase/src/main/java/com/google/showcase/v1beta1/EchoSettings.java new file mode 100644 index 0000000000..41ab2f8e20 --- /dev/null +++ b/java-showcase-3.25.8/gapic-showcase/src/main/java/com/google/showcase/v1beta1/EchoSettings.java @@ -0,0 +1,438 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1; + +import static com.google.showcase.v1beta1.EchoClient.ListLocationsPagedResponse; +import static com.google.showcase.v1beta1.EchoClient.PagedExpandLegacyMappedPagedResponse; +import static com.google.showcase.v1beta1.EchoClient.PagedExpandPagedResponse; + +import com.google.api.core.ApiFunction; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; +import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; +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.ServerStreamingCallSettings; +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.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.longrunning.Operation; +import com.google.showcase.v1beta1.stub.EchoStubSettings; +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 EchoClient}. + * + *

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

          + *
        • The default service address (localhost) and default port (7469) 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 echo: + * + *

        {@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
        + * EchoSettings.Builder echoSettingsBuilder = EchoSettings.newBuilder();
        + * echoSettingsBuilder
        + *     .echoSettings()
        + *     .setRetrySettings(
        + *         echoSettingsBuilder
        + *             .echoSettings()
        + *             .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());
        + * EchoSettings echoSettings = echoSettingsBuilder.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 wait: + * + *

        {@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
        + * EchoSettings.Builder echoSettingsBuilder = EchoSettings.newBuilder();
        + * TimedRetryAlgorithm timedRetryAlgorithm =
        + *     OperationalTimedPollAlgorithm.create(
        + *         RetrySettings.newBuilder()
        + *             .setInitialRetryDelayDuration(Duration.ofMillis(500))
        + *             .setRetryDelayMultiplier(1.5)
        + *             .setMaxRetryDelayDuration(Duration.ofMillis(5000))
        + *             .setTotalTimeoutDuration(Duration.ofHours(24))
        + *             .build());
        + * echoSettingsBuilder
        + *     .createClusterOperationSettings()
        + *     .setPollingAlgorithm(timedRetryAlgorithm)
        + *     .build();
        + * }
        + */ +@BetaApi +@Generated("by gapic-generator-java") +public class EchoSettings extends ClientSettings { + + /** Returns the object with the settings used for calls to echo. */ + public UnaryCallSettings echoSettings() { + return ((EchoStubSettings) getStubSettings()).echoSettings(); + } + + /** Returns the object with the settings used for calls to echoErrorDetails. */ + public UnaryCallSettings + echoErrorDetailsSettings() { + return ((EchoStubSettings) getStubSettings()).echoErrorDetailsSettings(); + } + + /** Returns the object with the settings used for calls to failEchoWithDetails. */ + public UnaryCallSettings + failEchoWithDetailsSettings() { + return ((EchoStubSettings) getStubSettings()).failEchoWithDetailsSettings(); + } + + /** Returns the object with the settings used for calls to expand. */ + public ServerStreamingCallSettings expandSettings() { + return ((EchoStubSettings) getStubSettings()).expandSettings(); + } + + /** Returns the object with the settings used for calls to collect. */ + public StreamingCallSettings collectSettings() { + return ((EchoStubSettings) getStubSettings()).collectSettings(); + } + + /** Returns the object with the settings used for calls to chat. */ + public StreamingCallSettings chatSettings() { + return ((EchoStubSettings) getStubSettings()).chatSettings(); + } + + /** Returns the object with the settings used for calls to pagedExpand. */ + public PagedCallSettings + pagedExpandSettings() { + return ((EchoStubSettings) getStubSettings()).pagedExpandSettings(); + } + + /** Returns the object with the settings used for calls to pagedExpandLegacy. */ + public UnaryCallSettings + pagedExpandLegacySettings() { + return ((EchoStubSettings) getStubSettings()).pagedExpandLegacySettings(); + } + + /** Returns the object with the settings used for calls to pagedExpandLegacyMapped. */ + public PagedCallSettings< + PagedExpandRequest, PagedExpandLegacyMappedResponse, PagedExpandLegacyMappedPagedResponse> + pagedExpandLegacyMappedSettings() { + return ((EchoStubSettings) getStubSettings()).pagedExpandLegacyMappedSettings(); + } + + /** Returns the object with the settings used for calls to wait. */ + public UnaryCallSettings waitSettings() { + return ((EchoStubSettings) getStubSettings()).waitSettings(); + } + + /** Returns the object with the settings used for calls to wait. */ + public OperationCallSettings waitOperationSettings() { + return ((EchoStubSettings) getStubSettings()).waitOperationSettings(); + } + + /** Returns the object with the settings used for calls to block. */ + public UnaryCallSettings blockSettings() { + return ((EchoStubSettings) getStubSettings()).blockSettings(); + } + + /** Returns the object with the settings used for calls to listLocations. */ + public PagedCallSettings + listLocationsSettings() { + return ((EchoStubSettings) getStubSettings()).listLocationsSettings(); + } + + /** Returns the object with the settings used for calls to getLocation. */ + public UnaryCallSettings getLocationSettings() { + return ((EchoStubSettings) getStubSettings()).getLocationSettings(); + } + + /** Returns the object with the settings used for calls to setIamPolicy. */ + public UnaryCallSettings setIamPolicySettings() { + return ((EchoStubSettings) getStubSettings()).setIamPolicySettings(); + } + + /** Returns the object with the settings used for calls to getIamPolicy. */ + public UnaryCallSettings getIamPolicySettings() { + return ((EchoStubSettings) getStubSettings()).getIamPolicySettings(); + } + + /** Returns the object with the settings used for calls to testIamPermissions. */ + public UnaryCallSettings + testIamPermissionsSettings() { + return ((EchoStubSettings) getStubSettings()).testIamPermissionsSettings(); + } + + public static final EchoSettings create(EchoStubSettings stub) throws IOException { + return new EchoSettings.Builder(stub.toBuilder()).build(); + } + + /** Returns a builder for the default ExecutorProvider for this service. */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return EchoStubSettings.defaultExecutorProviderBuilder(); + } + + /** Returns the default service endpoint. */ + public static String getDefaultEndpoint() { + return EchoStubSettings.getDefaultEndpoint(); + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return EchoStubSettings.getDefaultServiceScopes(); + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return EchoStubSettings.defaultCredentialsProviderBuilder(); + } + + /** Returns a builder for the default gRPC ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return EchoStubSettings.defaultGrpcTransportProviderBuilder(); + } + + /** Returns a builder for the default REST ChannelProvider for this service. */ + @BetaApi + public static InstantiatingHttpJsonChannelProvider.Builder + defaultHttpJsonTransportProviderBuilder() { + return EchoStubSettings.defaultHttpJsonTransportProviderBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return EchoStubSettings.defaultTransportChannelProvider(); + } + + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return EchoStubSettings.defaultApiClientHeaderProviderBuilder(); + } + + /** Returns a new gRPC builder for this class. */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** Returns a new REST builder for this class. */ + public static Builder newHttpJsonBuilder() { + return Builder.createHttpJsonDefault(); + } + + /** 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 EchoSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + } + + /** Builder for EchoSettings. */ + public static class Builder extends ClientSettings.Builder { + + protected Builder() throws IOException { + this(((ClientContext) null)); + } + + protected Builder(ClientContext clientContext) { + super(EchoStubSettings.newBuilder(clientContext)); + } + + protected Builder(EchoSettings settings) { + super(settings.getStubSettings().toBuilder()); + } + + protected Builder(EchoStubSettings.Builder stubSettings) { + super(stubSettings); + } + + private static Builder createDefault() { + return new Builder(EchoStubSettings.newBuilder()); + } + + private static Builder createHttpJsonDefault() { + return new Builder(EchoStubSettings.newHttpJsonBuilder()); + } + + public EchoStubSettings.Builder getStubSettingsBuilder() { + return ((EchoStubSettings.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 echo. */ + public UnaryCallSettings.Builder echoSettings() { + return getStubSettingsBuilder().echoSettings(); + } + + /** Returns the builder for the settings used for calls to echoErrorDetails. */ + public UnaryCallSettings.Builder + echoErrorDetailsSettings() { + return getStubSettingsBuilder().echoErrorDetailsSettings(); + } + + /** Returns the builder for the settings used for calls to failEchoWithDetails. */ + public UnaryCallSettings.Builder + failEchoWithDetailsSettings() { + return getStubSettingsBuilder().failEchoWithDetailsSettings(); + } + + /** Returns the builder for the settings used for calls to expand. */ + public ServerStreamingCallSettings.Builder expandSettings() { + return getStubSettingsBuilder().expandSettings(); + } + + /** Returns the builder for the settings used for calls to collect. */ + public StreamingCallSettings.Builder collectSettings() { + return getStubSettingsBuilder().collectSettings(); + } + + /** Returns the builder for the settings used for calls to chat. */ + public StreamingCallSettings.Builder chatSettings() { + return getStubSettingsBuilder().chatSettings(); + } + + /** Returns the builder for the settings used for calls to pagedExpand. */ + public PagedCallSettings.Builder< + PagedExpandRequest, PagedExpandResponse, PagedExpandPagedResponse> + pagedExpandSettings() { + return getStubSettingsBuilder().pagedExpandSettings(); + } + + /** Returns the builder for the settings used for calls to pagedExpandLegacy. */ + public UnaryCallSettings.Builder + pagedExpandLegacySettings() { + return getStubSettingsBuilder().pagedExpandLegacySettings(); + } + + /** Returns the builder for the settings used for calls to pagedExpandLegacyMapped. */ + public PagedCallSettings.Builder< + PagedExpandRequest, + PagedExpandLegacyMappedResponse, + PagedExpandLegacyMappedPagedResponse> + pagedExpandLegacyMappedSettings() { + return getStubSettingsBuilder().pagedExpandLegacyMappedSettings(); + } + + /** Returns the builder for the settings used for calls to wait. */ + public UnaryCallSettings.Builder waitSettings() { + return getStubSettingsBuilder().waitSettings(); + } + + /** Returns the builder for the settings used for calls to wait. */ + public OperationCallSettings.Builder + waitOperationSettings() { + return getStubSettingsBuilder().waitOperationSettings(); + } + + /** Returns the builder for the settings used for calls to block. */ + public UnaryCallSettings.Builder blockSettings() { + return getStubSettingsBuilder().blockSettings(); + } + + /** Returns the builder for the settings used for calls to listLocations. */ + public PagedCallSettings.Builder< + ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse> + listLocationsSettings() { + return getStubSettingsBuilder().listLocationsSettings(); + } + + /** Returns the builder for the settings used for calls to getLocation. */ + public UnaryCallSettings.Builder getLocationSettings() { + return getStubSettingsBuilder().getLocationSettings(); + } + + /** Returns the builder for the settings used for calls to setIamPolicy. */ + public UnaryCallSettings.Builder setIamPolicySettings() { + return getStubSettingsBuilder().setIamPolicySettings(); + } + + /** Returns the builder for the settings used for calls to getIamPolicy. */ + public UnaryCallSettings.Builder getIamPolicySettings() { + return getStubSettingsBuilder().getIamPolicySettings(); + } + + /** Returns the builder for the settings used for calls to testIamPermissions. */ + public UnaryCallSettings.Builder + testIamPermissionsSettings() { + return getStubSettingsBuilder().testIamPermissionsSettings(); + } + + @Override + public EchoSettings build() throws IOException { + return new EchoSettings(this); + } + } +} diff --git a/java-showcase-3.25.8/gapic-showcase/src/main/java/com/google/showcase/v1beta1/IdentityClient.java b/java-showcase-3.25.8/gapic-showcase/src/main/java/com/google/showcase/v1beta1/IdentityClient.java new file mode 100644 index 0000000000..fbf33c1089 --- /dev/null +++ b/java-showcase-3.25.8/gapic-showcase/src/main/java/com/google/showcase/v1beta1/IdentityClient.java @@ -0,0 +1,1358 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1; + +import com.google.api.core.ApiFuture; +import com.google.api.core.ApiFutures; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.paging.AbstractFixedSizeCollection; +import com.google.api.gax.paging.AbstractPage; +import com.google.api.gax.paging.AbstractPagedListResponse; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.common.util.concurrent.MoreExecutors; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.protobuf.Empty; +import com.google.showcase.v1beta1.stub.IdentityStub; +import com.google.showcase.v1beta1.stub.IdentityStubSettings; +import java.io.IOException; +import java.util.List; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Service Description: A simple identity service. + * + *

        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 (IdentityClient identityClient = IdentityClient.create()) {
        + *   String displayName = "displayName1714148973";
        + *   String email = "email96619420";
        + *   User response = identityClient.createUser(displayName, email);
        + * }
        + * }
        + * + *

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

        CreateUser

        Creates a user.

        + *

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

        + *
          + *
        • createUser(CreateUserRequest request) + *

        + *

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

        + *
          + *
        • createUser(String displayName, String email) + *

        • createUser(String displayName, String email, int age, String nickname, boolean enableNotifications, double heightFeet) + *

        + *

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

        + *
          + *
        • createUserCallable() + *

        + *

        GetUser

        Retrieves the User with the given uri.

        + *

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

        + *
          + *
        • getUser(GetUserRequest request) + *

        + *

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

        + *
          + *
        • getUser(UserName name) + *

        • getUser(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.

        + *
          + *
        • getUserCallable() + *

        + *

        UpdateUser

        Updates a user.

        + *

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

        + *
          + *
        • updateUser(UpdateUserRequest request) + *

        + *

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

        + *
          + *
        • updateUserCallable() + *

        + *

        DeleteUser

        Deletes a user, their profile, and all of their authored messages.

        + *

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

        + *
          + *
        • deleteUser(DeleteUserRequest request) + *

        + *

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

        + *
          + *
        • deleteUser(UserName name) + *

        • deleteUser(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.

        + *
          + *
        • deleteUserCallable() + *

        + *

        ListUsers

        Lists all users.

        + *

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

        + *
          + *
        • listUsers(ListUsersRequest request) + *

        + *

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

        + *
          + *
        • listUsersPagedCallable() + *

        • listUsersCallable() + *

        + *

        ListLocations

        Lists information about the supported locations for this service.

        + *

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

        + *
          + *
        • listLocations(ListLocationsRequest request) + *

        + *

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

        + *
          + *
        • listLocationsPagedCallable() + *

        • listLocationsCallable() + *

        + *

        GetLocation

        Gets information about a location.

        + *

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

        + *
          + *
        • getLocation(GetLocationRequest request) + *

        + *

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

        + *
          + *
        • getLocationCallable() + *

        + *

        SetIamPolicy

        Sets the access control policy on the specified resource. Replaces any existing policy. + *

        Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED` errors.

        + *

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

        + *
          + *
        • setIamPolicy(SetIamPolicyRequest request) + *

        + *

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

        + *
          + *
        • setIamPolicyCallable() + *

        + *

        GetIamPolicy

        Gets the access control policy for a resource. Returns an empty policy if the resource exists and does not have a policy set.

        + *

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

        + *
          + *
        • getIamPolicy(GetIamPolicyRequest request) + *

        + *

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

        + *
          + *
        • getIamPolicyCallable() + *

        + *

        TestIamPermissions

        Returns permissions that a caller has on the specified resource. If the resource does not exist, this will return an empty set of permissions, not a `NOT_FOUND` error. + *

        Note: This operation is designed to be used for building permission-aware UIs and command-line tools, not for authorization checking. This operation may "fail open" without warning.

        + *

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

        + *
          + *
        • testIamPermissions(TestIamPermissionsRequest request) + *

        + *

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

        + *
          + *
        • testIamPermissionsCallable() + *

        + *
        + * + *

        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 IdentitySettings 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
        + * IdentitySettings identitySettings =
        + *     IdentitySettings.newBuilder()
        + *         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
        + *         .build();
        + * IdentityClient identityClient = IdentityClient.create(identitySettings);
        + * }
        + * + *

        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
        + * IdentitySettings identitySettings =
        + *     IdentitySettings.newBuilder().setEndpoint(myEndpoint).build();
        + * IdentityClient identityClient = IdentityClient.create(identitySettings);
        + * }
        + * + *

        To use REST (HTTP1.1/JSON) transport (instead of gRPC) for sending and receiving requests over + * the wire: + * + *

        {@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
        + * IdentitySettings identitySettings = IdentitySettings.newHttpJsonBuilder().build();
        + * IdentityClient identityClient = IdentityClient.create(identitySettings);
        + * }
        + * + *

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

        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 (IdentityClient identityClient = IdentityClient.create()) {
        +   *   String displayName = "displayName1714148973";
        +   *   String email = "email96619420";
        +   *   User response = identityClient.createUser(displayName, email);
        +   * }
        +   * }
        + * + * @param displayName The display_name of the user. + * @param email The email address of the user. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final User createUser(String displayName, String email) { + CreateUserRequest request = + CreateUserRequest.newBuilder() + .setUser(User.newBuilder().setDisplayName(displayName).setEmail(email).build()) + .build(); + return createUser(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a user. + * + *

        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 (IdentityClient identityClient = IdentityClient.create()) {
        +   *   String displayName = "displayName1714148973";
        +   *   String email = "email96619420";
        +   *   int age = 96511;
        +   *   String nickname = "nickname70690926";
        +   *   boolean enableNotifications = true;
        +   *   double heightFeet = -1032737338;
        +   *   User response =
        +   *       identityClient.createUser(
        +   *           displayName, email, age, nickname, enableNotifications, heightFeet);
        +   * }
        +   * }
        + * + * @param displayName The display_name of the user. + * @param email The email address of the user. + * @param age The age of the user in years. + * @param nickname The nickname of the user. + *

        (-- aip.dev/not-precedent: An empty string is a valid nickname. Ordinarily, + * proto3_optional should not be used on a `string` field. --) + * @param enableNotifications Enables the receiving of notifications. The default is true if + * unset. + *

        (-- aip.dev/not-precedent: The default for the feature is true. Ordinarily, the default + * for a `bool` field should be false. --) + * @param heightFeet The height of the user in feet. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final User createUser( + String displayName, + String email, + int age, + String nickname, + boolean enableNotifications, + double heightFeet) { + CreateUserRequest request = + CreateUserRequest.newBuilder() + .setUser( + User.newBuilder() + .setDisplayName(displayName) + .setEmail(email) + .setAge(age) + .setNickname(nickname) + .setEnableNotifications(enableNotifications) + .setHeightFeet(heightFeet) + .build()) + .build(); + return createUser(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a user. + * + *

        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 (IdentityClient identityClient = IdentityClient.create()) {
        +   *   CreateUserRequest request =
        +   *       CreateUserRequest.newBuilder().setUser(User.newBuilder().build()).build();
        +   *   User response = identityClient.createUser(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 User createUser(CreateUserRequest request) { + return createUserCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a user. + * + *

        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 (IdentityClient identityClient = IdentityClient.create()) {
        +   *   CreateUserRequest request =
        +   *       CreateUserRequest.newBuilder().setUser(User.newBuilder().build()).build();
        +   *   ApiFuture future = identityClient.createUserCallable().futureCall(request);
        +   *   // Do something.
        +   *   User response = future.get();
        +   * }
        +   * }
        + */ + public final UnaryCallable createUserCallable() { + return stub.createUserCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Retrieves the User with the given uri. + * + *

        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 (IdentityClient identityClient = IdentityClient.create()) {
        +   *   UserName name = UserName.of("[USER]");
        +   *   User response = identityClient.getUser(name);
        +   * }
        +   * }
        + * + * @param name The resource name of the requested user. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final User getUser(UserName name) { + GetUserRequest request = + GetUserRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + return getUser(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Retrieves the User with the given uri. + * + *

        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 (IdentityClient identityClient = IdentityClient.create()) {
        +   *   String name = UserName.of("[USER]").toString();
        +   *   User response = identityClient.getUser(name);
        +   * }
        +   * }
        + * + * @param name The resource name of the requested user. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final User getUser(String name) { + GetUserRequest request = GetUserRequest.newBuilder().setName(name).build(); + return getUser(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Retrieves the User with the given uri. + * + *

        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 (IdentityClient identityClient = IdentityClient.create()) {
        +   *   GetUserRequest request =
        +   *       GetUserRequest.newBuilder().setName(UserName.of("[USER]").toString()).build();
        +   *   User response = identityClient.getUser(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 User getUser(GetUserRequest request) { + return getUserCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Retrieves the User with the given uri. + * + *

        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 (IdentityClient identityClient = IdentityClient.create()) {
        +   *   GetUserRequest request =
        +   *       GetUserRequest.newBuilder().setName(UserName.of("[USER]").toString()).build();
        +   *   ApiFuture future = identityClient.getUserCallable().futureCall(request);
        +   *   // Do something.
        +   *   User response = future.get();
        +   * }
        +   * }
        + */ + public final UnaryCallable getUserCallable() { + return stub.getUserCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates a user. + * + *

        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 (IdentityClient identityClient = IdentityClient.create()) {
        +   *   UpdateUserRequest request =
        +   *       UpdateUserRequest.newBuilder()
        +   *           .setUser(User.newBuilder().build())
        +   *           .setUpdateMask(FieldMask.newBuilder().build())
        +   *           .build();
        +   *   User response = identityClient.updateUser(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 User updateUser(UpdateUserRequest request) { + return updateUserCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates a user. + * + *

        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 (IdentityClient identityClient = IdentityClient.create()) {
        +   *   UpdateUserRequest request =
        +   *       UpdateUserRequest.newBuilder()
        +   *           .setUser(User.newBuilder().build())
        +   *           .setUpdateMask(FieldMask.newBuilder().build())
        +   *           .build();
        +   *   ApiFuture future = identityClient.updateUserCallable().futureCall(request);
        +   *   // Do something.
        +   *   User response = future.get();
        +   * }
        +   * }
        + */ + public final UnaryCallable updateUserCallable() { + return stub.updateUserCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a user, their profile, and all of their authored messages. + * + *

        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 (IdentityClient identityClient = IdentityClient.create()) {
        +   *   UserName name = UserName.of("[USER]");
        +   *   identityClient.deleteUser(name);
        +   * }
        +   * }
        + * + * @param name The resource name of the user to delete. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final void deleteUser(UserName name) { + DeleteUserRequest request = + DeleteUserRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + deleteUser(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a user, their profile, and all of their authored messages. + * + *

        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 (IdentityClient identityClient = IdentityClient.create()) {
        +   *   String name = UserName.of("[USER]").toString();
        +   *   identityClient.deleteUser(name);
        +   * }
        +   * }
        + * + * @param name The resource name of the user to delete. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final void deleteUser(String name) { + DeleteUserRequest request = DeleteUserRequest.newBuilder().setName(name).build(); + deleteUser(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a user, their profile, and all of their authored messages. + * + *

        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 (IdentityClient identityClient = IdentityClient.create()) {
        +   *   DeleteUserRequest request =
        +   *       DeleteUserRequest.newBuilder().setName(UserName.of("[USER]").toString()).build();
        +   *   identityClient.deleteUser(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 deleteUser(DeleteUserRequest request) { + deleteUserCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a user, their profile, and all of their authored messages. + * + *

        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 (IdentityClient identityClient = IdentityClient.create()) {
        +   *   DeleteUserRequest request =
        +   *       DeleteUserRequest.newBuilder().setName(UserName.of("[USER]").toString()).build();
        +   *   ApiFuture future = identityClient.deleteUserCallable().futureCall(request);
        +   *   // Do something.
        +   *   future.get();
        +   * }
        +   * }
        + */ + public final UnaryCallable deleteUserCallable() { + return stub.deleteUserCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists all users. + * + *

        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 (IdentityClient identityClient = IdentityClient.create()) {
        +   *   ListUsersRequest request =
        +   *       ListUsersRequest.newBuilder()
        +   *           .setPageSize(883849137)
        +   *           .setPageToken("pageToken873572522")
        +   *           .build();
        +   *   for (User element : identityClient.listUsers(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 ListUsersPagedResponse listUsers(ListUsersRequest request) { + return listUsersPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists all users. + * + *

        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 (IdentityClient identityClient = IdentityClient.create()) {
        +   *   ListUsersRequest request =
        +   *       ListUsersRequest.newBuilder()
        +   *           .setPageSize(883849137)
        +   *           .setPageToken("pageToken873572522")
        +   *           .build();
        +   *   ApiFuture future = identityClient.listUsersPagedCallable().futureCall(request);
        +   *   // Do something.
        +   *   for (User element : future.get().iterateAll()) {
        +   *     // doThingsWith(element);
        +   *   }
        +   * }
        +   * }
        + */ + public final UnaryCallable listUsersPagedCallable() { + return stub.listUsersPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists all users. + * + *

        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 (IdentityClient identityClient = IdentityClient.create()) {
        +   *   ListUsersRequest request =
        +   *       ListUsersRequest.newBuilder()
        +   *           .setPageSize(883849137)
        +   *           .setPageToken("pageToken873572522")
        +   *           .build();
        +   *   while (true) {
        +   *     ListUsersResponse response = identityClient.listUsersCallable().call(request);
        +   *     for (User element : response.getUsersList()) {
        +   *       // doThingsWith(element);
        +   *     }
        +   *     String nextPageToken = response.getNextPageToken();
        +   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
        +   *       request = request.toBuilder().setPageToken(nextPageToken).build();
        +   *     } else {
        +   *       break;
        +   *     }
        +   *   }
        +   * }
        +   * }
        + */ + public final UnaryCallable listUsersCallable() { + return stub.listUsersCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists information about the supported locations for this service. + * + *

        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 (IdentityClient identityClient = IdentityClient.create()) {
        +   *   ListLocationsRequest request =
        +   *       ListLocationsRequest.newBuilder()
        +   *           .setName("name3373707")
        +   *           .setFilter("filter-1274492040")
        +   *           .setPageSize(883849137)
        +   *           .setPageToken("pageToken873572522")
        +   *           .build();
        +   *   for (Location element : identityClient.listLocations(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 ListLocationsPagedResponse listLocations(ListLocationsRequest request) { + return listLocationsPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists information about the supported locations for this service. + * + *

        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 (IdentityClient identityClient = IdentityClient.create()) {
        +   *   ListLocationsRequest request =
        +   *       ListLocationsRequest.newBuilder()
        +   *           .setName("name3373707")
        +   *           .setFilter("filter-1274492040")
        +   *           .setPageSize(883849137)
        +   *           .setPageToken("pageToken873572522")
        +   *           .build();
        +   *   ApiFuture future = identityClient.listLocationsPagedCallable().futureCall(request);
        +   *   // Do something.
        +   *   for (Location element : future.get().iterateAll()) {
        +   *     // doThingsWith(element);
        +   *   }
        +   * }
        +   * }
        + */ + public final UnaryCallable + listLocationsPagedCallable() { + return stub.listLocationsPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists information about the supported locations for this service. + * + *

        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 (IdentityClient identityClient = IdentityClient.create()) {
        +   *   ListLocationsRequest request =
        +   *       ListLocationsRequest.newBuilder()
        +   *           .setName("name3373707")
        +   *           .setFilter("filter-1274492040")
        +   *           .setPageSize(883849137)
        +   *           .setPageToken("pageToken873572522")
        +   *           .build();
        +   *   while (true) {
        +   *     ListLocationsResponse response = identityClient.listLocationsCallable().call(request);
        +   *     for (Location element : response.getLocationsList()) {
        +   *       // doThingsWith(element);
        +   *     }
        +   *     String nextPageToken = response.getNextPageToken();
        +   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
        +   *       request = request.toBuilder().setPageToken(nextPageToken).build();
        +   *     } else {
        +   *       break;
        +   *     }
        +   *   }
        +   * }
        +   * }
        + */ + public final UnaryCallable listLocationsCallable() { + return stub.listLocationsCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets information about a location. + * + *

        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 (IdentityClient identityClient = IdentityClient.create()) {
        +   *   GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build();
        +   *   Location response = identityClient.getLocation(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 Location getLocation(GetLocationRequest request) { + return getLocationCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets information about a location. + * + *

        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 (IdentityClient identityClient = IdentityClient.create()) {
        +   *   GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build();
        +   *   ApiFuture future = identityClient.getLocationCallable().futureCall(request);
        +   *   // Do something.
        +   *   Location response = future.get();
        +   * }
        +   * }
        + */ + public final UnaryCallable getLocationCallable() { + return stub.getLocationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Sets the access control policy on the specified resource. Replaces any existing policy. + * + *

        Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED` errors. + * + *

        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 (IdentityClient identityClient = IdentityClient.create()) {
        +   *   SetIamPolicyRequest request =
        +   *       SetIamPolicyRequest.newBuilder()
        +   *           .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString())
        +   *           .setPolicy(Policy.newBuilder().build())
        +   *           .setUpdateMask(FieldMask.newBuilder().build())
        +   *           .build();
        +   *   Policy response = identityClient.setIamPolicy(request);
        +   * }
        +   * }
        + * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Policy setIamPolicy(SetIamPolicyRequest request) { + return setIamPolicyCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Sets the access control policy on the specified resource. Replaces any existing policy. + * + *

        Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED` errors. + * + *

        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 (IdentityClient identityClient = IdentityClient.create()) {
        +   *   SetIamPolicyRequest request =
        +   *       SetIamPolicyRequest.newBuilder()
        +   *           .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString())
        +   *           .setPolicy(Policy.newBuilder().build())
        +   *           .setUpdateMask(FieldMask.newBuilder().build())
        +   *           .build();
        +   *   ApiFuture future = identityClient.setIamPolicyCallable().futureCall(request);
        +   *   // Do something.
        +   *   Policy response = future.get();
        +   * }
        +   * }
        + */ + public final UnaryCallable setIamPolicyCallable() { + return stub.setIamPolicyCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets the access control policy for a resource. Returns an empty policy if the resource exists + * and does not have a policy set. + * + *

        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 (IdentityClient identityClient = IdentityClient.create()) {
        +   *   GetIamPolicyRequest request =
        +   *       GetIamPolicyRequest.newBuilder()
        +   *           .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString())
        +   *           .setOptions(GetPolicyOptions.newBuilder().build())
        +   *           .build();
        +   *   Policy response = identityClient.getIamPolicy(request);
        +   * }
        +   * }
        + * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Policy getIamPolicy(GetIamPolicyRequest request) { + return getIamPolicyCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets the access control policy for a resource. Returns an empty policy if the resource exists + * and does not have a policy set. + * + *

        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 (IdentityClient identityClient = IdentityClient.create()) {
        +   *   GetIamPolicyRequest request =
        +   *       GetIamPolicyRequest.newBuilder()
        +   *           .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString())
        +   *           .setOptions(GetPolicyOptions.newBuilder().build())
        +   *           .build();
        +   *   ApiFuture future = identityClient.getIamPolicyCallable().futureCall(request);
        +   *   // Do something.
        +   *   Policy response = future.get();
        +   * }
        +   * }
        + */ + public final UnaryCallable getIamPolicyCallable() { + return stub.getIamPolicyCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Returns permissions that a caller has on the specified resource. If the resource does not + * exist, this will return an empty set of permissions, not a `NOT_FOUND` error. + * + *

        Note: This operation is designed to be used for building permission-aware UIs and + * command-line tools, not for authorization checking. This operation may "fail open" without + * warning. + * + *

        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 (IdentityClient identityClient = IdentityClient.create()) {
        +   *   TestIamPermissionsRequest request =
        +   *       TestIamPermissionsRequest.newBuilder()
        +   *           .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString())
        +   *           .addAllPermissions(new ArrayList())
        +   *           .build();
        +   *   TestIamPermissionsResponse response = identityClient.testIamPermissions(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 TestIamPermissionsResponse testIamPermissions(TestIamPermissionsRequest request) { + return testIamPermissionsCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Returns permissions that a caller has on the specified resource. If the resource does not + * exist, this will return an empty set of permissions, not a `NOT_FOUND` error. + * + *

        Note: This operation is designed to be used for building permission-aware UIs and + * command-line tools, not for authorization checking. This operation may "fail open" without + * warning. + * + *

        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 (IdentityClient identityClient = IdentityClient.create()) {
        +   *   TestIamPermissionsRequest request =
        +   *       TestIamPermissionsRequest.newBuilder()
        +   *           .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString())
        +   *           .addAllPermissions(new ArrayList())
        +   *           .build();
        +   *   ApiFuture future =
        +   *       identityClient.testIamPermissionsCallable().futureCall(request);
        +   *   // Do something.
        +   *   TestIamPermissionsResponse response = future.get();
        +   * }
        +   * }
        + */ + public final UnaryCallable + testIamPermissionsCallable() { + return stub.testIamPermissionsCallable(); + } + + @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 ListUsersPagedResponse + extends AbstractPagedListResponse< + ListUsersRequest, ListUsersResponse, User, ListUsersPage, ListUsersFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListUsersPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, input -> new ListUsersPagedResponse(input), MoreExecutors.directExecutor()); + } + + private ListUsersPagedResponse(ListUsersPage page) { + super(page, ListUsersFixedSizeCollection.createEmptyCollection()); + } + } + + public static class ListUsersPage + extends AbstractPage { + + private ListUsersPage( + PageContext context, + ListUsersResponse response) { + super(context, response); + } + + private static ListUsersPage createEmptyPage() { + return new ListUsersPage(null, null); + } + + @Override + protected ListUsersPage createPage( + PageContext context, + ListUsersResponse response) { + return new ListUsersPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class ListUsersFixedSizeCollection + extends AbstractFixedSizeCollection< + ListUsersRequest, ListUsersResponse, User, ListUsersPage, ListUsersFixedSizeCollection> { + + private ListUsersFixedSizeCollection(List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListUsersFixedSizeCollection createEmptyCollection() { + return new ListUsersFixedSizeCollection(null, 0); + } + + @Override + protected ListUsersFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListUsersFixedSizeCollection(pages, collectionSize); + } + } + + public static class ListLocationsPagedResponse + extends AbstractPagedListResponse< + ListLocationsRequest, + ListLocationsResponse, + Location, + ListLocationsPage, + ListLocationsFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListLocationsPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + input -> new ListLocationsPagedResponse(input), + MoreExecutors.directExecutor()); + } + + private ListLocationsPagedResponse(ListLocationsPage page) { + super(page, ListLocationsFixedSizeCollection.createEmptyCollection()); + } + } + + public static class ListLocationsPage + extends AbstractPage< + ListLocationsRequest, ListLocationsResponse, Location, ListLocationsPage> { + + private ListLocationsPage( + PageContext context, + ListLocationsResponse response) { + super(context, response); + } + + private static ListLocationsPage createEmptyPage() { + return new ListLocationsPage(null, null); + } + + @Override + protected ListLocationsPage createPage( + PageContext context, + ListLocationsResponse response) { + return new ListLocationsPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class ListLocationsFixedSizeCollection + extends AbstractFixedSizeCollection< + ListLocationsRequest, + ListLocationsResponse, + Location, + ListLocationsPage, + ListLocationsFixedSizeCollection> { + + private ListLocationsFixedSizeCollection(List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListLocationsFixedSizeCollection createEmptyCollection() { + return new ListLocationsFixedSizeCollection(null, 0); + } + + @Override + protected ListLocationsFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListLocationsFixedSizeCollection(pages, collectionSize); + } + } +} diff --git a/java-showcase-3.25.8/gapic-showcase/src/main/java/com/google/showcase/v1beta1/IdentitySettings.java b/java-showcase-3.25.8/gapic-showcase/src/main/java/com/google/showcase/v1beta1/IdentitySettings.java new file mode 100644 index 0000000000..eb2dae0ce1 --- /dev/null +++ b/java-showcase-3.25.8/gapic-showcase/src/main/java/com/google/showcase/v1beta1/IdentitySettings.java @@ -0,0 +1,325 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1; + +import static com.google.showcase.v1beta1.IdentityClient.ListLocationsPagedResponse; +import static com.google.showcase.v1beta1.IdentityClient.ListUsersPagedResponse; + +import com.google.api.core.ApiFunction; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; +import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; +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.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.protobuf.Empty; +import com.google.showcase.v1beta1.stub.IdentityStubSettings; +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 IdentityClient}. + * + *

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

          + *
        • The default service address (localhost) and default port (7469) 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 createUser: + * + *

        {@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
        + * IdentitySettings.Builder identitySettingsBuilder = IdentitySettings.newBuilder();
        + * identitySettingsBuilder
        + *     .createUserSettings()
        + *     .setRetrySettings(
        + *         identitySettingsBuilder
        + *             .createUserSettings()
        + *             .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());
        + * IdentitySettings identitySettings = identitySettingsBuilder.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. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class IdentitySettings extends ClientSettings { + + /** Returns the object with the settings used for calls to createUser. */ + public UnaryCallSettings createUserSettings() { + return ((IdentityStubSettings) getStubSettings()).createUserSettings(); + } + + /** Returns the object with the settings used for calls to getUser. */ + public UnaryCallSettings getUserSettings() { + return ((IdentityStubSettings) getStubSettings()).getUserSettings(); + } + + /** Returns the object with the settings used for calls to updateUser. */ + public UnaryCallSettings updateUserSettings() { + return ((IdentityStubSettings) getStubSettings()).updateUserSettings(); + } + + /** Returns the object with the settings used for calls to deleteUser. */ + public UnaryCallSettings deleteUserSettings() { + return ((IdentityStubSettings) getStubSettings()).deleteUserSettings(); + } + + /** Returns the object with the settings used for calls to listUsers. */ + public PagedCallSettings + listUsersSettings() { + return ((IdentityStubSettings) getStubSettings()).listUsersSettings(); + } + + /** Returns the object with the settings used for calls to listLocations. */ + public PagedCallSettings + listLocationsSettings() { + return ((IdentityStubSettings) getStubSettings()).listLocationsSettings(); + } + + /** Returns the object with the settings used for calls to getLocation. */ + public UnaryCallSettings getLocationSettings() { + return ((IdentityStubSettings) getStubSettings()).getLocationSettings(); + } + + /** Returns the object with the settings used for calls to setIamPolicy. */ + public UnaryCallSettings setIamPolicySettings() { + return ((IdentityStubSettings) getStubSettings()).setIamPolicySettings(); + } + + /** Returns the object with the settings used for calls to getIamPolicy. */ + public UnaryCallSettings getIamPolicySettings() { + return ((IdentityStubSettings) getStubSettings()).getIamPolicySettings(); + } + + /** Returns the object with the settings used for calls to testIamPermissions. */ + public UnaryCallSettings + testIamPermissionsSettings() { + return ((IdentityStubSettings) getStubSettings()).testIamPermissionsSettings(); + } + + public static final IdentitySettings create(IdentityStubSettings stub) throws IOException { + return new IdentitySettings.Builder(stub.toBuilder()).build(); + } + + /** Returns a builder for the default ExecutorProvider for this service. */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return IdentityStubSettings.defaultExecutorProviderBuilder(); + } + + /** Returns the default service endpoint. */ + public static String getDefaultEndpoint() { + return IdentityStubSettings.getDefaultEndpoint(); + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return IdentityStubSettings.getDefaultServiceScopes(); + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return IdentityStubSettings.defaultCredentialsProviderBuilder(); + } + + /** Returns a builder for the default gRPC ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return IdentityStubSettings.defaultGrpcTransportProviderBuilder(); + } + + /** Returns a builder for the default REST ChannelProvider for this service. */ + @BetaApi + public static InstantiatingHttpJsonChannelProvider.Builder + defaultHttpJsonTransportProviderBuilder() { + return IdentityStubSettings.defaultHttpJsonTransportProviderBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return IdentityStubSettings.defaultTransportChannelProvider(); + } + + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return IdentityStubSettings.defaultApiClientHeaderProviderBuilder(); + } + + /** Returns a new gRPC builder for this class. */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** Returns a new REST builder for this class. */ + public static Builder newHttpJsonBuilder() { + return Builder.createHttpJsonDefault(); + } + + /** 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 IdentitySettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + } + + /** Builder for IdentitySettings. */ + public static class Builder extends ClientSettings.Builder { + + protected Builder() throws IOException { + this(((ClientContext) null)); + } + + protected Builder(ClientContext clientContext) { + super(IdentityStubSettings.newBuilder(clientContext)); + } + + protected Builder(IdentitySettings settings) { + super(settings.getStubSettings().toBuilder()); + } + + protected Builder(IdentityStubSettings.Builder stubSettings) { + super(stubSettings); + } + + private static Builder createDefault() { + return new Builder(IdentityStubSettings.newBuilder()); + } + + private static Builder createHttpJsonDefault() { + return new Builder(IdentityStubSettings.newHttpJsonBuilder()); + } + + public IdentityStubSettings.Builder getStubSettingsBuilder() { + return ((IdentityStubSettings.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 createUser. */ + public UnaryCallSettings.Builder createUserSettings() { + return getStubSettingsBuilder().createUserSettings(); + } + + /** Returns the builder for the settings used for calls to getUser. */ + public UnaryCallSettings.Builder getUserSettings() { + return getStubSettingsBuilder().getUserSettings(); + } + + /** Returns the builder for the settings used for calls to updateUser. */ + public UnaryCallSettings.Builder updateUserSettings() { + return getStubSettingsBuilder().updateUserSettings(); + } + + /** Returns the builder for the settings used for calls to deleteUser. */ + public UnaryCallSettings.Builder deleteUserSettings() { + return getStubSettingsBuilder().deleteUserSettings(); + } + + /** Returns the builder for the settings used for calls to listUsers. */ + public PagedCallSettings.Builder + listUsersSettings() { + return getStubSettingsBuilder().listUsersSettings(); + } + + /** Returns the builder for the settings used for calls to listLocations. */ + public PagedCallSettings.Builder< + ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse> + listLocationsSettings() { + return getStubSettingsBuilder().listLocationsSettings(); + } + + /** Returns the builder for the settings used for calls to getLocation. */ + public UnaryCallSettings.Builder getLocationSettings() { + return getStubSettingsBuilder().getLocationSettings(); + } + + /** Returns the builder for the settings used for calls to setIamPolicy. */ + public UnaryCallSettings.Builder setIamPolicySettings() { + return getStubSettingsBuilder().setIamPolicySettings(); + } + + /** Returns the builder for the settings used for calls to getIamPolicy. */ + public UnaryCallSettings.Builder getIamPolicySettings() { + return getStubSettingsBuilder().getIamPolicySettings(); + } + + /** Returns the builder for the settings used for calls to testIamPermissions. */ + public UnaryCallSettings.Builder + testIamPermissionsSettings() { + return getStubSettingsBuilder().testIamPermissionsSettings(); + } + + @Override + public IdentitySettings build() throws IOException { + return new IdentitySettings(this); + } + } +} diff --git a/java-showcase-3.25.8/gapic-showcase/src/main/java/com/google/showcase/v1beta1/MessagingClient.java b/java-showcase-3.25.8/gapic-showcase/src/main/java/com/google/showcase/v1beta1/MessagingClient.java new file mode 100644 index 0000000000..b5bfc0bb2a --- /dev/null +++ b/java-showcase-3.25.8/gapic-showcase/src/main/java/com/google/showcase/v1beta1/MessagingClient.java @@ -0,0 +1,2853 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1; + +import com.google.api.core.ApiFuture; +import com.google.api.core.ApiFutures; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.httpjson.longrunning.OperationsClient; +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.BidiStreamingCallable; +import com.google.api.gax.rpc.ClientStreamingCallable; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.common.util.concurrent.MoreExecutors; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.longrunning.Operation; +import com.google.protobuf.ByteString; +import com.google.protobuf.Empty; +import com.google.showcase.v1beta1.stub.MessagingStub; +import com.google.showcase.v1beta1.stub.MessagingStubSettings; +import java.io.IOException; +import java.util.List; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Service Description: A simple messaging service that implements chat rooms and profile posts. + * + *

        This messaging service showcases the features that API clients generated by gapic-generators + * implement. + * + *

        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 (MessagingClient messagingClient = MessagingClient.create()) {
        + *   String displayName = "displayName1714148973";
        + *   String description = "description-1724546052";
        + *   Room response = messagingClient.createRoom(displayName, description);
        + * }
        + * }
        + * + *

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

        CreateRoom

        Creates a room.

        + *

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

        + *
          + *
        • createRoom(CreateRoomRequest request) + *

        + *

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

        + *
          + *
        • createRoom(String displayName, String description) + *

        + *

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

        + *
          + *
        • createRoomCallable() + *

        + *

        GetRoom

        Retrieves the Room with the given resource name.

        + *

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

        + *
          + *
        • getRoom(GetRoomRequest request) + *

        + *

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

        + *
          + *
        • getRoom(RoomName name) + *

        • getRoom(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.

        + *
          + *
        • getRoomCallable() + *

        + *

        UpdateRoom

        Updates a room.

        + *

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

        + *
          + *
        • updateRoom(UpdateRoomRequest request) + *

        + *

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

        + *
          + *
        • updateRoomCallable() + *

        + *

        DeleteRoom

        Deletes a room and all of its blurbs.

        + *

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

        + *
          + *
        • deleteRoom(DeleteRoomRequest request) + *

        + *

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

        + *
          + *
        • deleteRoom(RoomName name) + *

        • deleteRoom(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.

        + *
          + *
        • deleteRoomCallable() + *

        + *

        ListRooms

        Lists all chat rooms.

        + *

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

        + *
          + *
        • listRooms(ListRoomsRequest request) + *

        + *

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

        + *
          + *
        • listRoomsPagedCallable() + *

        • listRoomsCallable() + *

        + *

        CreateBlurb

        Creates a blurb. If the parent is a room, the blurb is understood to be a message in that room. If the parent is a profile, the blurb is understood to be a post on the profile.

        + *

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

        + *
          + *
        • createBlurb(CreateBlurbRequest request) + *

        + *

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

        + *
          + *
        • createBlurb(ProfileName parent, UserName user, ByteString image) + *

        • createBlurb(ProfileName parent, UserName user, String text) + *

        • createBlurb(ProfileName parent, String user, ByteString image) + *

        • createBlurb(ProfileName parent, String user, String text) + *

        • createBlurb(RoomName parent, UserName user, ByteString image) + *

        • createBlurb(RoomName parent, UserName user, String text) + *

        • createBlurb(RoomName parent, String user, ByteString image) + *

        • createBlurb(RoomName parent, String user, String text) + *

        • createBlurb(String parent, UserName user, ByteString image) + *

        • createBlurb(String parent, UserName user, String text) + *

        • createBlurb(String parent, String user, ByteString image) + *

        • createBlurb(String parent, String user, String text) + *

        + *

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

        + *
          + *
        • createBlurbCallable() + *

        + *

        GetBlurb

        Retrieves the Blurb with the given resource name.

        + *

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

        + *
          + *
        • getBlurb(GetBlurbRequest request) + *

        + *

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

        + *
          + *
        • getBlurb(BlurbName name) + *

        • getBlurb(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.

        + *
          + *
        • getBlurbCallable() + *

        + *

        UpdateBlurb

        Updates a blurb.

        + *

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

        + *
          + *
        • updateBlurb(UpdateBlurbRequest request) + *

        + *

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

        + *
          + *
        • updateBlurbCallable() + *

        + *

        DeleteBlurb

        Deletes a blurb.

        + *

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

        + *
          + *
        • deleteBlurb(DeleteBlurbRequest request) + *

        + *

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

        + *
          + *
        • deleteBlurb(BlurbName name) + *

        • deleteBlurb(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.

        + *
          + *
        • deleteBlurbCallable() + *

        + *

        ListBlurbs

        Lists blurbs for a specific chat room or user profile depending on the parent resource name.

        + *

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

        + *
          + *
        • listBlurbs(ListBlurbsRequest request) + *

        + *

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

        + *
          + *
        • listBlurbs(ProfileName parent) + *

        • listBlurbs(RoomName parent) + *

        • listBlurbs(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.

        + *
          + *
        • listBlurbsPagedCallable() + *

        • listBlurbsCallable() + *

        + *

        SearchBlurbs

        This method searches through all blurbs across all rooms and profiles for blurbs containing to words found in the query. Only posts that contain an exact match of a queried word will be returned.

        + *

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

        + *
          + *
        • searchBlurbsAsync(SearchBlurbsRequest request) + *

        + *

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

        + *
          + *
        • searchBlurbsAsync(ProfileName parent, String query) + *

        • searchBlurbsAsync(RoomName parent, String query) + *

        • searchBlurbsAsync(String parent, String query) + *

        + *

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

        + *
          + *
        • searchBlurbsOperationCallable() + *

        • searchBlurbsCallable() + *

        + *

        StreamBlurbs

        This returns a stream that emits the blurbs that are created for a particular chat room or user profile.

        + *

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

        + *
          + *
        • streamBlurbsCallable() + *

        + *

        SendBlurbs

        This is a stream to create multiple blurbs. If an invalid blurb is requested to be created, the stream will close with an error.

        + *

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

        + *
          + *
        • sendBlurbsCallable() + *

        + *

        Connect

        This method starts a bidirectional stream that receives all blurbs that are being created after the stream has started and sends requests to create blurbs. If an invalid blurb is requested to be created, the stream will close with an error.

        + *

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

        + *
          + *
        • connectCallable() + *

        + *

        ListLocations

        Lists information about the supported locations for this service.

        + *

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

        + *
          + *
        • listLocations(ListLocationsRequest request) + *

        + *

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

        + *
          + *
        • listLocationsPagedCallable() + *

        • listLocationsCallable() + *

        + *

        GetLocation

        Gets information about a location.

        + *

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

        + *
          + *
        • getLocation(GetLocationRequest request) + *

        + *

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

        + *
          + *
        • getLocationCallable() + *

        + *

        SetIamPolicy

        Sets the access control policy on the specified resource. Replaces any existing policy. + *

        Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED` errors.

        + *

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

        + *
          + *
        • setIamPolicy(SetIamPolicyRequest request) + *

        + *

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

        + *
          + *
        • setIamPolicyCallable() + *

        + *

        GetIamPolicy

        Gets the access control policy for a resource. Returns an empty policy if the resource exists and does not have a policy set.

        + *

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

        + *
          + *
        • getIamPolicy(GetIamPolicyRequest request) + *

        + *

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

        + *
          + *
        • getIamPolicyCallable() + *

        + *

        TestIamPermissions

        Returns permissions that a caller has on the specified resource. If the resource does not exist, this will return an empty set of permissions, not a `NOT_FOUND` error. + *

        Note: This operation is designed to be used for building permission-aware UIs and command-line tools, not for authorization checking. This operation may "fail open" without warning.

        + *

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

        + *
          + *
        • testIamPermissions(TestIamPermissionsRequest request) + *

        + *

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

        + *
          + *
        • testIamPermissionsCallable() + *

        + *
        + * + *

        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 MessagingSettings 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
        + * MessagingSettings messagingSettings =
        + *     MessagingSettings.newBuilder()
        + *         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
        + *         .build();
        + * MessagingClient messagingClient = MessagingClient.create(messagingSettings);
        + * }
        + * + *

        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
        + * MessagingSettings messagingSettings =
        + *     MessagingSettings.newBuilder().setEndpoint(myEndpoint).build();
        + * MessagingClient messagingClient = MessagingClient.create(messagingSettings);
        + * }
        + * + *

        To use REST (HTTP1.1/JSON) transport (instead of gRPC) for sending and receiving requests over + * the wire: + * + *

        {@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
        + * MessagingSettings messagingSettings = MessagingSettings.newHttpJsonBuilder().build();
        + * MessagingClient messagingClient = MessagingClient.create(messagingSettings);
        + * }
        + * + *

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

        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 (MessagingClient messagingClient = MessagingClient.create()) {
        +   *   String displayName = "displayName1714148973";
        +   *   String description = "description-1724546052";
        +   *   Room response = messagingClient.createRoom(displayName, description);
        +   * }
        +   * }
        + * + * @param displayName The human readable name of the chat room. + * @param description The description of the chat room. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Room createRoom(String displayName, String description) { + CreateRoomRequest request = + CreateRoomRequest.newBuilder() + .setRoom( + Room.newBuilder().setDisplayName(displayName).setDescription(description).build()) + .build(); + return createRoom(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a room. + * + *

        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 (MessagingClient messagingClient = MessagingClient.create()) {
        +   *   CreateRoomRequest request =
        +   *       CreateRoomRequest.newBuilder().setRoom(Room.newBuilder().build()).build();
        +   *   Room response = messagingClient.createRoom(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 Room createRoom(CreateRoomRequest request) { + return createRoomCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a room. + * + *

        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 (MessagingClient messagingClient = MessagingClient.create()) {
        +   *   CreateRoomRequest request =
        +   *       CreateRoomRequest.newBuilder().setRoom(Room.newBuilder().build()).build();
        +   *   ApiFuture future = messagingClient.createRoomCallable().futureCall(request);
        +   *   // Do something.
        +   *   Room response = future.get();
        +   * }
        +   * }
        + */ + public final UnaryCallable createRoomCallable() { + return stub.createRoomCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Retrieves the Room with the given resource name. + * + *

        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 (MessagingClient messagingClient = MessagingClient.create()) {
        +   *   RoomName name = RoomName.of("[ROOM]");
        +   *   Room response = messagingClient.getRoom(name);
        +   * }
        +   * }
        + * + * @param name The resource name of the requested room. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Room getRoom(RoomName name) { + GetRoomRequest request = + GetRoomRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + return getRoom(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Retrieves the Room with the given resource name. + * + *

        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 (MessagingClient messagingClient = MessagingClient.create()) {
        +   *   String name = RoomName.of("[ROOM]").toString();
        +   *   Room response = messagingClient.getRoom(name);
        +   * }
        +   * }
        + * + * @param name The resource name of the requested room. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Room getRoom(String name) { + GetRoomRequest request = GetRoomRequest.newBuilder().setName(name).build(); + return getRoom(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Retrieves the Room with the given resource name. + * + *

        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 (MessagingClient messagingClient = MessagingClient.create()) {
        +   *   GetRoomRequest request =
        +   *       GetRoomRequest.newBuilder().setName(RoomName.of("[ROOM]").toString()).build();
        +   *   Room response = messagingClient.getRoom(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 Room getRoom(GetRoomRequest request) { + return getRoomCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Retrieves the Room with the given resource name. + * + *

        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 (MessagingClient messagingClient = MessagingClient.create()) {
        +   *   GetRoomRequest request =
        +   *       GetRoomRequest.newBuilder().setName(RoomName.of("[ROOM]").toString()).build();
        +   *   ApiFuture future = messagingClient.getRoomCallable().futureCall(request);
        +   *   // Do something.
        +   *   Room response = future.get();
        +   * }
        +   * }
        + */ + public final UnaryCallable getRoomCallable() { + return stub.getRoomCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates a room. + * + *

        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 (MessagingClient messagingClient = MessagingClient.create()) {
        +   *   UpdateRoomRequest request =
        +   *       UpdateRoomRequest.newBuilder()
        +   *           .setRoom(Room.newBuilder().build())
        +   *           .setUpdateMask(FieldMask.newBuilder().build())
        +   *           .build();
        +   *   Room response = messagingClient.updateRoom(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 Room updateRoom(UpdateRoomRequest request) { + return updateRoomCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates a room. + * + *

        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 (MessagingClient messagingClient = MessagingClient.create()) {
        +   *   UpdateRoomRequest request =
        +   *       UpdateRoomRequest.newBuilder()
        +   *           .setRoom(Room.newBuilder().build())
        +   *           .setUpdateMask(FieldMask.newBuilder().build())
        +   *           .build();
        +   *   ApiFuture future = messagingClient.updateRoomCallable().futureCall(request);
        +   *   // Do something.
        +   *   Room response = future.get();
        +   * }
        +   * }
        + */ + public final UnaryCallable updateRoomCallable() { + return stub.updateRoomCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a room and all of its blurbs. + * + *

        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 (MessagingClient messagingClient = MessagingClient.create()) {
        +   *   RoomName name = RoomName.of("[ROOM]");
        +   *   messagingClient.deleteRoom(name);
        +   * }
        +   * }
        + * + * @param name The resource name of the requested room. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final void deleteRoom(RoomName name) { + DeleteRoomRequest request = + DeleteRoomRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + deleteRoom(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a room and all of its blurbs. + * + *

        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 (MessagingClient messagingClient = MessagingClient.create()) {
        +   *   String name = RoomName.of("[ROOM]").toString();
        +   *   messagingClient.deleteRoom(name);
        +   * }
        +   * }
        + * + * @param name The resource name of the requested room. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final void deleteRoom(String name) { + DeleteRoomRequest request = DeleteRoomRequest.newBuilder().setName(name).build(); + deleteRoom(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a room and all of its blurbs. + * + *

        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 (MessagingClient messagingClient = MessagingClient.create()) {
        +   *   DeleteRoomRequest request =
        +   *       DeleteRoomRequest.newBuilder().setName(RoomName.of("[ROOM]").toString()).build();
        +   *   messagingClient.deleteRoom(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 deleteRoom(DeleteRoomRequest request) { + deleteRoomCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a room and all of its blurbs. + * + *

        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 (MessagingClient messagingClient = MessagingClient.create()) {
        +   *   DeleteRoomRequest request =
        +   *       DeleteRoomRequest.newBuilder().setName(RoomName.of("[ROOM]").toString()).build();
        +   *   ApiFuture future = messagingClient.deleteRoomCallable().futureCall(request);
        +   *   // Do something.
        +   *   future.get();
        +   * }
        +   * }
        + */ + public final UnaryCallable deleteRoomCallable() { + return stub.deleteRoomCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists all chat rooms. + * + *

        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 (MessagingClient messagingClient = MessagingClient.create()) {
        +   *   ListRoomsRequest request =
        +   *       ListRoomsRequest.newBuilder()
        +   *           .setPageSize(883849137)
        +   *           .setPageToken("pageToken873572522")
        +   *           .build();
        +   *   for (Room element : messagingClient.listRooms(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 ListRoomsPagedResponse listRooms(ListRoomsRequest request) { + return listRoomsPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists all chat rooms. + * + *

        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 (MessagingClient messagingClient = MessagingClient.create()) {
        +   *   ListRoomsRequest request =
        +   *       ListRoomsRequest.newBuilder()
        +   *           .setPageSize(883849137)
        +   *           .setPageToken("pageToken873572522")
        +   *           .build();
        +   *   ApiFuture future = messagingClient.listRoomsPagedCallable().futureCall(request);
        +   *   // Do something.
        +   *   for (Room element : future.get().iterateAll()) {
        +   *     // doThingsWith(element);
        +   *   }
        +   * }
        +   * }
        + */ + public final UnaryCallable listRoomsPagedCallable() { + return stub.listRoomsPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists all chat rooms. + * + *

        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 (MessagingClient messagingClient = MessagingClient.create()) {
        +   *   ListRoomsRequest request =
        +   *       ListRoomsRequest.newBuilder()
        +   *           .setPageSize(883849137)
        +   *           .setPageToken("pageToken873572522")
        +   *           .build();
        +   *   while (true) {
        +   *     ListRoomsResponse response = messagingClient.listRoomsCallable().call(request);
        +   *     for (Room element : response.getRoomsList()) {
        +   *       // doThingsWith(element);
        +   *     }
        +   *     String nextPageToken = response.getNextPageToken();
        +   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
        +   *       request = request.toBuilder().setPageToken(nextPageToken).build();
        +   *     } else {
        +   *       break;
        +   *     }
        +   *   }
        +   * }
        +   * }
        + */ + public final UnaryCallable listRoomsCallable() { + return stub.listRoomsCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a blurb. If the parent is a room, the blurb is understood to be a message in that room. + * If the parent is a profile, the blurb is understood to be a post on the profile. + * + *

        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 (MessagingClient messagingClient = MessagingClient.create()) {
        +   *   ProfileName parent = ProfileName.of("[USER]");
        +   *   UserName user = UserName.of("[USER]");
        +   *   ByteString image = ByteString.EMPTY;
        +   *   Blurb response = messagingClient.createBlurb(parent, user, image);
        +   * }
        +   * }
        + * + * @param parent The resource name of the chat room or user profile that this blurb will be tied + * to. + * @param user The resource name of the blurb's author. + * @param image The image content of this blurb. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Blurb createBlurb(ProfileName parent, UserName user, ByteString image) { + CreateBlurbRequest request = + CreateBlurbRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .setBlurb( + Blurb.newBuilder() + .setUser(user == null ? null : user.toString()) + .setImage(image) + .build()) + .build(); + return createBlurb(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a blurb. If the parent is a room, the blurb is understood to be a message in that room. + * If the parent is a profile, the blurb is understood to be a post on the profile. + * + *

        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 (MessagingClient messagingClient = MessagingClient.create()) {
        +   *   ProfileName parent = ProfileName.of("[USER]");
        +   *   UserName user = UserName.of("[USER]");
        +   *   String text = "text3556653";
        +   *   Blurb response = messagingClient.createBlurb(parent, user, text);
        +   * }
        +   * }
        + * + * @param parent The resource name of the chat room or user profile that this blurb will be tied + * to. + * @param user The resource name of the blurb's author. + * @param text The textual content of this blurb. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Blurb createBlurb(ProfileName parent, UserName user, String text) { + CreateBlurbRequest request = + CreateBlurbRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .setBlurb( + Blurb.newBuilder() + .setUser(user == null ? null : user.toString()) + .setText(text) + .build()) + .build(); + return createBlurb(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a blurb. If the parent is a room, the blurb is understood to be a message in that room. + * If the parent is a profile, the blurb is understood to be a post on the profile. + * + *

        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 (MessagingClient messagingClient = MessagingClient.create()) {
        +   *   ProfileName parent = ProfileName.of("[USER]");
        +   *   String user = UserName.of("[USER]").toString();
        +   *   ByteString image = ByteString.EMPTY;
        +   *   Blurb response = messagingClient.createBlurb(parent, user, image);
        +   * }
        +   * }
        + * + * @param parent The resource name of the chat room or user profile that this blurb will be tied + * to. + * @param user The resource name of the blurb's author. + * @param image The image content of this blurb. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Blurb createBlurb(ProfileName parent, String user, ByteString image) { + CreateBlurbRequest request = + CreateBlurbRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .setBlurb(Blurb.newBuilder().setUser(user).setImage(image).build()) + .build(); + return createBlurb(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a blurb. If the parent is a room, the blurb is understood to be a message in that room. + * If the parent is a profile, the blurb is understood to be a post on the profile. + * + *

        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 (MessagingClient messagingClient = MessagingClient.create()) {
        +   *   ProfileName parent = ProfileName.of("[USER]");
        +   *   String user = UserName.of("[USER]").toString();
        +   *   String text = "text3556653";
        +   *   Blurb response = messagingClient.createBlurb(parent, user, text);
        +   * }
        +   * }
        + * + * @param parent The resource name of the chat room or user profile that this blurb will be tied + * to. + * @param user The resource name of the blurb's author. + * @param text The textual content of this blurb. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Blurb createBlurb(ProfileName parent, String user, String text) { + CreateBlurbRequest request = + CreateBlurbRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .setBlurb(Blurb.newBuilder().setUser(user).setText(text).build()) + .build(); + return createBlurb(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a blurb. If the parent is a room, the blurb is understood to be a message in that room. + * If the parent is a profile, the blurb is understood to be a post on the profile. + * + *

        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 (MessagingClient messagingClient = MessagingClient.create()) {
        +   *   RoomName parent = RoomName.of("[ROOM]");
        +   *   UserName user = UserName.of("[USER]");
        +   *   ByteString image = ByteString.EMPTY;
        +   *   Blurb response = messagingClient.createBlurb(parent, user, image);
        +   * }
        +   * }
        + * + * @param parent The resource name of the chat room or user profile that this blurb will be tied + * to. + * @param user The resource name of the blurb's author. + * @param image The image content of this blurb. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Blurb createBlurb(RoomName parent, UserName user, ByteString image) { + CreateBlurbRequest request = + CreateBlurbRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .setBlurb( + Blurb.newBuilder() + .setUser(user == null ? null : user.toString()) + .setImage(image) + .build()) + .build(); + return createBlurb(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a blurb. If the parent is a room, the blurb is understood to be a message in that room. + * If the parent is a profile, the blurb is understood to be a post on the profile. + * + *

        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 (MessagingClient messagingClient = MessagingClient.create()) {
        +   *   RoomName parent = RoomName.of("[ROOM]");
        +   *   UserName user = UserName.of("[USER]");
        +   *   String text = "text3556653";
        +   *   Blurb response = messagingClient.createBlurb(parent, user, text);
        +   * }
        +   * }
        + * + * @param parent The resource name of the chat room or user profile that this blurb will be tied + * to. + * @param user The resource name of the blurb's author. + * @param text The textual content of this blurb. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Blurb createBlurb(RoomName parent, UserName user, String text) { + CreateBlurbRequest request = + CreateBlurbRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .setBlurb( + Blurb.newBuilder() + .setUser(user == null ? null : user.toString()) + .setText(text) + .build()) + .build(); + return createBlurb(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a blurb. If the parent is a room, the blurb is understood to be a message in that room. + * If the parent is a profile, the blurb is understood to be a post on the profile. + * + *

        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 (MessagingClient messagingClient = MessagingClient.create()) {
        +   *   RoomName parent = RoomName.of("[ROOM]");
        +   *   String user = UserName.of("[USER]").toString();
        +   *   ByteString image = ByteString.EMPTY;
        +   *   Blurb response = messagingClient.createBlurb(parent, user, image);
        +   * }
        +   * }
        + * + * @param parent The resource name of the chat room or user profile that this blurb will be tied + * to. + * @param user The resource name of the blurb's author. + * @param image The image content of this blurb. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Blurb createBlurb(RoomName parent, String user, ByteString image) { + CreateBlurbRequest request = + CreateBlurbRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .setBlurb(Blurb.newBuilder().setUser(user).setImage(image).build()) + .build(); + return createBlurb(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a blurb. If the parent is a room, the blurb is understood to be a message in that room. + * If the parent is a profile, the blurb is understood to be a post on the profile. + * + *

        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 (MessagingClient messagingClient = MessagingClient.create()) {
        +   *   RoomName parent = RoomName.of("[ROOM]");
        +   *   String user = UserName.of("[USER]").toString();
        +   *   String text = "text3556653";
        +   *   Blurb response = messagingClient.createBlurb(parent, user, text);
        +   * }
        +   * }
        + * + * @param parent The resource name of the chat room or user profile that this blurb will be tied + * to. + * @param user The resource name of the blurb's author. + * @param text The textual content of this blurb. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Blurb createBlurb(RoomName parent, String user, String text) { + CreateBlurbRequest request = + CreateBlurbRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .setBlurb(Blurb.newBuilder().setUser(user).setText(text).build()) + .build(); + return createBlurb(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a blurb. If the parent is a room, the blurb is understood to be a message in that room. + * If the parent is a profile, the blurb is understood to be a post on the profile. + * + *

        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 (MessagingClient messagingClient = MessagingClient.create()) {
        +   *   String parent = ProfileName.of("[USER]").toString();
        +   *   UserName user = UserName.of("[USER]");
        +   *   ByteString image = ByteString.EMPTY;
        +   *   Blurb response = messagingClient.createBlurb(parent, user, image);
        +   * }
        +   * }
        + * + * @param parent The resource name of the chat room or user profile that this blurb will be tied + * to. + * @param user The resource name of the blurb's author. + * @param image The image content of this blurb. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Blurb createBlurb(String parent, UserName user, ByteString image) { + CreateBlurbRequest request = + CreateBlurbRequest.newBuilder() + .setParent(parent) + .setBlurb( + Blurb.newBuilder() + .setUser(user == null ? null : user.toString()) + .setImage(image) + .build()) + .build(); + return createBlurb(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a blurb. If the parent is a room, the blurb is understood to be a message in that room. + * If the parent is a profile, the blurb is understood to be a post on the profile. + * + *

        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 (MessagingClient messagingClient = MessagingClient.create()) {
        +   *   String parent = ProfileName.of("[USER]").toString();
        +   *   UserName user = UserName.of("[USER]");
        +   *   String text = "text3556653";
        +   *   Blurb response = messagingClient.createBlurb(parent, user, text);
        +   * }
        +   * }
        + * + * @param parent The resource name of the chat room or user profile that this blurb will be tied + * to. + * @param user The resource name of the blurb's author. + * @param text The textual content of this blurb. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Blurb createBlurb(String parent, UserName user, String text) { + CreateBlurbRequest request = + CreateBlurbRequest.newBuilder() + .setParent(parent) + .setBlurb( + Blurb.newBuilder() + .setUser(user == null ? null : user.toString()) + .setText(text) + .build()) + .build(); + return createBlurb(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a blurb. If the parent is a room, the blurb is understood to be a message in that room. + * If the parent is a profile, the blurb is understood to be a post on the profile. + * + *

        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 (MessagingClient messagingClient = MessagingClient.create()) {
        +   *   String parent = ProfileName.of("[USER]").toString();
        +   *   String user = UserName.of("[USER]").toString();
        +   *   ByteString image = ByteString.EMPTY;
        +   *   Blurb response = messagingClient.createBlurb(parent, user, image);
        +   * }
        +   * }
        + * + * @param parent The resource name of the chat room or user profile that this blurb will be tied + * to. + * @param user The resource name of the blurb's author. + * @param image The image content of this blurb. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Blurb createBlurb(String parent, String user, ByteString image) { + CreateBlurbRequest request = + CreateBlurbRequest.newBuilder() + .setParent(parent) + .setBlurb(Blurb.newBuilder().setUser(user).setImage(image).build()) + .build(); + return createBlurb(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a blurb. If the parent is a room, the blurb is understood to be a message in that room. + * If the parent is a profile, the blurb is understood to be a post on the profile. + * + *

        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 (MessagingClient messagingClient = MessagingClient.create()) {
        +   *   String parent = ProfileName.of("[USER]").toString();
        +   *   String user = UserName.of("[USER]").toString();
        +   *   String text = "text3556653";
        +   *   Blurb response = messagingClient.createBlurb(parent, user, text);
        +   * }
        +   * }
        + * + * @param parent The resource name of the chat room or user profile that this blurb will be tied + * to. + * @param user The resource name of the blurb's author. + * @param text The textual content of this blurb. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Blurb createBlurb(String parent, String user, String text) { + CreateBlurbRequest request = + CreateBlurbRequest.newBuilder() + .setParent(parent) + .setBlurb(Blurb.newBuilder().setUser(user).setText(text).build()) + .build(); + return createBlurb(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a blurb. If the parent is a room, the blurb is understood to be a message in that room. + * If the parent is a profile, the blurb is understood to be a post on the profile. + * + *

        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 (MessagingClient messagingClient = MessagingClient.create()) {
        +   *   CreateBlurbRequest request =
        +   *       CreateBlurbRequest.newBuilder()
        +   *           .setParent(ProfileName.of("[USER]").toString())
        +   *           .setBlurb(Blurb.newBuilder().build())
        +   *           .build();
        +   *   Blurb response = messagingClient.createBlurb(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 Blurb createBlurb(CreateBlurbRequest request) { + return createBlurbCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a blurb. If the parent is a room, the blurb is understood to be a message in that room. + * If the parent is a profile, the blurb is understood to be a post on the profile. + * + *

        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 (MessagingClient messagingClient = MessagingClient.create()) {
        +   *   CreateBlurbRequest request =
        +   *       CreateBlurbRequest.newBuilder()
        +   *           .setParent(ProfileName.of("[USER]").toString())
        +   *           .setBlurb(Blurb.newBuilder().build())
        +   *           .build();
        +   *   ApiFuture future = messagingClient.createBlurbCallable().futureCall(request);
        +   *   // Do something.
        +   *   Blurb response = future.get();
        +   * }
        +   * }
        + */ + public final UnaryCallable createBlurbCallable() { + return stub.createBlurbCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Retrieves the Blurb with the given resource name. + * + *

        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 (MessagingClient messagingClient = MessagingClient.create()) {
        +   *   BlurbName name = BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]");
        +   *   Blurb response = messagingClient.getBlurb(name);
        +   * }
        +   * }
        + * + * @param name The resource name of the requested blurb. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Blurb getBlurb(BlurbName name) { + GetBlurbRequest request = + GetBlurbRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + return getBlurb(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Retrieves the Blurb with the given resource name. + * + *

        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 (MessagingClient messagingClient = MessagingClient.create()) {
        +   *   String name =
        +   *       BlurbName.ofUserLegacyUserBlurbName("[USER]", "[LEGACY_USER]", "[BLURB]").toString();
        +   *   Blurb response = messagingClient.getBlurb(name);
        +   * }
        +   * }
        + * + * @param name The resource name of the requested blurb. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Blurb getBlurb(String name) { + GetBlurbRequest request = GetBlurbRequest.newBuilder().setName(name).build(); + return getBlurb(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Retrieves the Blurb with the given resource name. + * + *

        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 (MessagingClient messagingClient = MessagingClient.create()) {
        +   *   GetBlurbRequest request =
        +   *       GetBlurbRequest.newBuilder()
        +   *           .setName(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString())
        +   *           .build();
        +   *   Blurb response = messagingClient.getBlurb(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 Blurb getBlurb(GetBlurbRequest request) { + return getBlurbCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Retrieves the Blurb with the given resource name. + * + *

        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 (MessagingClient messagingClient = MessagingClient.create()) {
        +   *   GetBlurbRequest request =
        +   *       GetBlurbRequest.newBuilder()
        +   *           .setName(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString())
        +   *           .build();
        +   *   ApiFuture future = messagingClient.getBlurbCallable().futureCall(request);
        +   *   // Do something.
        +   *   Blurb response = future.get();
        +   * }
        +   * }
        + */ + public final UnaryCallable getBlurbCallable() { + return stub.getBlurbCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates a blurb. + * + *

        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 (MessagingClient messagingClient = MessagingClient.create()) {
        +   *   UpdateBlurbRequest request =
        +   *       UpdateBlurbRequest.newBuilder()
        +   *           .setBlurb(Blurb.newBuilder().build())
        +   *           .setUpdateMask(FieldMask.newBuilder().build())
        +   *           .build();
        +   *   Blurb response = messagingClient.updateBlurb(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 Blurb updateBlurb(UpdateBlurbRequest request) { + return updateBlurbCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates a blurb. + * + *

        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 (MessagingClient messagingClient = MessagingClient.create()) {
        +   *   UpdateBlurbRequest request =
        +   *       UpdateBlurbRequest.newBuilder()
        +   *           .setBlurb(Blurb.newBuilder().build())
        +   *           .setUpdateMask(FieldMask.newBuilder().build())
        +   *           .build();
        +   *   ApiFuture future = messagingClient.updateBlurbCallable().futureCall(request);
        +   *   // Do something.
        +   *   Blurb response = future.get();
        +   * }
        +   * }
        + */ + public final UnaryCallable updateBlurbCallable() { + return stub.updateBlurbCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a blurb. + * + *

        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 (MessagingClient messagingClient = MessagingClient.create()) {
        +   *   BlurbName name = BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]");
        +   *   messagingClient.deleteBlurb(name);
        +   * }
        +   * }
        + * + * @param name The resource name of the requested blurb. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final void deleteBlurb(BlurbName name) { + DeleteBlurbRequest request = + DeleteBlurbRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + deleteBlurb(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a blurb. + * + *

        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 (MessagingClient messagingClient = MessagingClient.create()) {
        +   *   String name =
        +   *       BlurbName.ofUserLegacyUserBlurbName("[USER]", "[LEGACY_USER]", "[BLURB]").toString();
        +   *   messagingClient.deleteBlurb(name);
        +   * }
        +   * }
        + * + * @param name The resource name of the requested blurb. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final void deleteBlurb(String name) { + DeleteBlurbRequest request = DeleteBlurbRequest.newBuilder().setName(name).build(); + deleteBlurb(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a blurb. + * + *

        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 (MessagingClient messagingClient = MessagingClient.create()) {
        +   *   DeleteBlurbRequest request =
        +   *       DeleteBlurbRequest.newBuilder()
        +   *           .setName(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString())
        +   *           .build();
        +   *   messagingClient.deleteBlurb(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 deleteBlurb(DeleteBlurbRequest request) { + deleteBlurbCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a blurb. + * + *

        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 (MessagingClient messagingClient = MessagingClient.create()) {
        +   *   DeleteBlurbRequest request =
        +   *       DeleteBlurbRequest.newBuilder()
        +   *           .setName(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString())
        +   *           .build();
        +   *   ApiFuture future = messagingClient.deleteBlurbCallable().futureCall(request);
        +   *   // Do something.
        +   *   future.get();
        +   * }
        +   * }
        + */ + public final UnaryCallable deleteBlurbCallable() { + return stub.deleteBlurbCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists blurbs for a specific chat room or user profile depending on the parent resource name. + * + *

        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 (MessagingClient messagingClient = MessagingClient.create()) {
        +   *   ProfileName parent = ProfileName.of("[USER]");
        +   *   for (Blurb element : messagingClient.listBlurbs(parent).iterateAll()) {
        +   *     // doThingsWith(element);
        +   *   }
        +   * }
        +   * }
        + * + * @param parent The resource name of the requested room or profile who blurbs to list. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListBlurbsPagedResponse listBlurbs(ProfileName parent) { + ListBlurbsRequest request = + ListBlurbsRequest.newBuilder().setParent(parent == null ? null : parent.toString()).build(); + return listBlurbs(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists blurbs for a specific chat room or user profile depending on the parent resource name. + * + *

        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 (MessagingClient messagingClient = MessagingClient.create()) {
        +   *   RoomName parent = RoomName.of("[ROOM]");
        +   *   for (Blurb element : messagingClient.listBlurbs(parent).iterateAll()) {
        +   *     // doThingsWith(element);
        +   *   }
        +   * }
        +   * }
        + * + * @param parent The resource name of the requested room or profile who blurbs to list. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListBlurbsPagedResponse listBlurbs(RoomName parent) { + ListBlurbsRequest request = + ListBlurbsRequest.newBuilder().setParent(parent == null ? null : parent.toString()).build(); + return listBlurbs(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists blurbs for a specific chat room or user profile depending on the parent resource name. + * + *

        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 (MessagingClient messagingClient = MessagingClient.create()) {
        +   *   String parent = ProfileName.of("[USER]").toString();
        +   *   for (Blurb element : messagingClient.listBlurbs(parent).iterateAll()) {
        +   *     // doThingsWith(element);
        +   *   }
        +   * }
        +   * }
        + * + * @param parent The resource name of the requested room or profile who blurbs to list. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListBlurbsPagedResponse listBlurbs(String parent) { + ListBlurbsRequest request = ListBlurbsRequest.newBuilder().setParent(parent).build(); + return listBlurbs(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists blurbs for a specific chat room or user profile depending on the parent resource name. + * + *

        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 (MessagingClient messagingClient = MessagingClient.create()) {
        +   *   ListBlurbsRequest request =
        +   *       ListBlurbsRequest.newBuilder()
        +   *           .setParent(ProfileName.of("[USER]").toString())
        +   *           .setPageSize(883849137)
        +   *           .setPageToken("pageToken873572522")
        +   *           .build();
        +   *   for (Blurb element : messagingClient.listBlurbs(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 ListBlurbsPagedResponse listBlurbs(ListBlurbsRequest request) { + return listBlurbsPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists blurbs for a specific chat room or user profile depending on the parent resource name. + * + *

        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 (MessagingClient messagingClient = MessagingClient.create()) {
        +   *   ListBlurbsRequest request =
        +   *       ListBlurbsRequest.newBuilder()
        +   *           .setParent(ProfileName.of("[USER]").toString())
        +   *           .setPageSize(883849137)
        +   *           .setPageToken("pageToken873572522")
        +   *           .build();
        +   *   ApiFuture future = messagingClient.listBlurbsPagedCallable().futureCall(request);
        +   *   // Do something.
        +   *   for (Blurb element : future.get().iterateAll()) {
        +   *     // doThingsWith(element);
        +   *   }
        +   * }
        +   * }
        + */ + public final UnaryCallable listBlurbsPagedCallable() { + return stub.listBlurbsPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists blurbs for a specific chat room or user profile depending on the parent resource name. + * + *

        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 (MessagingClient messagingClient = MessagingClient.create()) {
        +   *   ListBlurbsRequest request =
        +   *       ListBlurbsRequest.newBuilder()
        +   *           .setParent(ProfileName.of("[USER]").toString())
        +   *           .setPageSize(883849137)
        +   *           .setPageToken("pageToken873572522")
        +   *           .build();
        +   *   while (true) {
        +   *     ListBlurbsResponse response = messagingClient.listBlurbsCallable().call(request);
        +   *     for (Blurb element : response.getBlurbsList()) {
        +   *       // doThingsWith(element);
        +   *     }
        +   *     String nextPageToken = response.getNextPageToken();
        +   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
        +   *       request = request.toBuilder().setPageToken(nextPageToken).build();
        +   *     } else {
        +   *       break;
        +   *     }
        +   *   }
        +   * }
        +   * }
        + */ + public final UnaryCallable listBlurbsCallable() { + return stub.listBlurbsCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * This method searches through all blurbs across all rooms and profiles for blurbs containing to + * words found in the query. Only posts that contain an exact match of a queried word will be + * returned. + * + *

        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 (MessagingClient messagingClient = MessagingClient.create()) {
        +   *   ProfileName parent = ProfileName.of("[USER]");
        +   *   String query = "query107944136";
        +   *   SearchBlurbsResponse response = messagingClient.searchBlurbsAsync(parent, query).get();
        +   * }
        +   * }
        + * + * @param parent The rooms or profiles to search. If unset, `SearchBlurbs` will search all rooms + * and all profiles. + * @param query The query used to search for blurbs containing to words of this string. Only posts + * that contain an exact match of a queried word will be returned. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture searchBlurbsAsync( + ProfileName parent, String query) { + SearchBlurbsRequest request = + SearchBlurbsRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .setQuery(query) + .build(); + return searchBlurbsAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * This method searches through all blurbs across all rooms and profiles for blurbs containing to + * words found in the query. Only posts that contain an exact match of a queried word will be + * returned. + * + *

        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 (MessagingClient messagingClient = MessagingClient.create()) {
        +   *   RoomName parent = RoomName.of("[ROOM]");
        +   *   String query = "query107944136";
        +   *   SearchBlurbsResponse response = messagingClient.searchBlurbsAsync(parent, query).get();
        +   * }
        +   * }
        + * + * @param parent The rooms or profiles to search. If unset, `SearchBlurbs` will search all rooms + * and all profiles. + * @param query The query used to search for blurbs containing to words of this string. Only posts + * that contain an exact match of a queried word will be returned. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture searchBlurbsAsync( + RoomName parent, String query) { + SearchBlurbsRequest request = + SearchBlurbsRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .setQuery(query) + .build(); + return searchBlurbsAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * This method searches through all blurbs across all rooms and profiles for blurbs containing to + * words found in the query. Only posts that contain an exact match of a queried word will be + * returned. + * + *

        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 (MessagingClient messagingClient = MessagingClient.create()) {
        +   *   String parent = ProfileName.of("[USER]").toString();
        +   *   String query = "query107944136";
        +   *   SearchBlurbsResponse response = messagingClient.searchBlurbsAsync(parent, query).get();
        +   * }
        +   * }
        + * + * @param parent The rooms or profiles to search. If unset, `SearchBlurbs` will search all rooms + * and all profiles. + * @param query The query used to search for blurbs containing to words of this string. Only posts + * that contain an exact match of a queried word will be returned. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture searchBlurbsAsync( + String parent, String query) { + SearchBlurbsRequest request = + SearchBlurbsRequest.newBuilder().setParent(parent).setQuery(query).build(); + return searchBlurbsAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * This method searches through all blurbs across all rooms and profiles for blurbs containing to + * words found in the query. Only posts that contain an exact match of a queried word will be + * returned. + * + *

        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 (MessagingClient messagingClient = MessagingClient.create()) {
        +   *   SearchBlurbsRequest request =
        +   *       SearchBlurbsRequest.newBuilder()
        +   *           .setQuery("query107944136")
        +   *           .setParent(ProfileName.of("[USER]").toString())
        +   *           .setPageSize(883849137)
        +   *           .setPageToken("pageToken873572522")
        +   *           .build();
        +   *   SearchBlurbsResponse response = messagingClient.searchBlurbsAsync(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 searchBlurbsAsync( + SearchBlurbsRequest request) { + return searchBlurbsOperationCallable().futureCall(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * This method searches through all blurbs across all rooms and profiles for blurbs containing to + * words found in the query. Only posts that contain an exact match of a queried word will be + * returned. + * + *

        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 (MessagingClient messagingClient = MessagingClient.create()) {
        +   *   SearchBlurbsRequest request =
        +   *       SearchBlurbsRequest.newBuilder()
        +   *           .setQuery("query107944136")
        +   *           .setParent(ProfileName.of("[USER]").toString())
        +   *           .setPageSize(883849137)
        +   *           .setPageToken("pageToken873572522")
        +   *           .build();
        +   *   OperationFuture future =
        +   *       messagingClient.searchBlurbsOperationCallable().futureCall(request);
        +   *   // Do something.
        +   *   SearchBlurbsResponse response = future.get();
        +   * }
        +   * }
        + */ + public final OperationCallable + searchBlurbsOperationCallable() { + return stub.searchBlurbsOperationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * This method searches through all blurbs across all rooms and profiles for blurbs containing to + * words found in the query. Only posts that contain an exact match of a queried word will be + * returned. + * + *

        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 (MessagingClient messagingClient = MessagingClient.create()) {
        +   *   SearchBlurbsRequest request =
        +   *       SearchBlurbsRequest.newBuilder()
        +   *           .setQuery("query107944136")
        +   *           .setParent(ProfileName.of("[USER]").toString())
        +   *           .setPageSize(883849137)
        +   *           .setPageToken("pageToken873572522")
        +   *           .build();
        +   *   ApiFuture future = messagingClient.searchBlurbsCallable().futureCall(request);
        +   *   // Do something.
        +   *   Operation response = future.get();
        +   * }
        +   * }
        + */ + public final UnaryCallable searchBlurbsCallable() { + return stub.searchBlurbsCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * This returns a stream that emits the blurbs that are created for a particular chat room or user + * profile. + * + *

        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 (MessagingClient messagingClient = MessagingClient.create()) {
        +   *   StreamBlurbsRequest request =
        +   *       StreamBlurbsRequest.newBuilder()
        +   *           .setName(ProfileName.of("[USER]").toString())
        +   *           .setExpireTime(Timestamp.newBuilder().build())
        +   *           .build();
        +   *   ServerStream stream =
        +   *       messagingClient.streamBlurbsCallable().call(request);
        +   *   for (StreamBlurbsResponse response : stream) {
        +   *     // Do something when a response is received.
        +   *   }
        +   * }
        +   * }
        + */ + public final ServerStreamingCallable + streamBlurbsCallable() { + return stub.streamBlurbsCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * This is a stream to create multiple blurbs. If an invalid blurb is requested to be created, the + * stream will close with an error. + * + *

        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 (MessagingClient messagingClient = MessagingClient.create()) {
        +   *   ApiStreamObserver responseObserver =
        +   *       new ApiStreamObserver() {
        +   *         {@literal @}Override
        +   *         public void onNext(SendBlurbsResponse response) {
        +   *           // Do something when a response is received.
        +   *         }
        +   *
        +   *         {@literal @}Override
        +   *         public void onError(Throwable t) {
        +   *           // Add error-handling
        +   *         }
        +   *
        +   *         {@literal @}Override
        +   *         public void onCompleted() {
        +   *           // Do something when complete.
        +   *         }
        +   *       };
        +   *   ApiStreamObserver requestObserver =
        +   *       messagingClient.sendBlurbs().clientStreamingCall(responseObserver);
        +   *   CreateBlurbRequest request =
        +   *       CreateBlurbRequest.newBuilder()
        +   *           .setParent(ProfileName.of("[USER]").toString())
        +   *           .setBlurb(Blurb.newBuilder().build())
        +   *           .build();
        +   *   requestObserver.onNext(request);
        +   * }
        +   * }
        + */ + public final ClientStreamingCallable + sendBlurbsCallable() { + return stub.sendBlurbsCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * This method starts a bidirectional stream that receives all blurbs that are being created after + * the stream has started and sends requests to create blurbs. If an invalid blurb is requested to + * be created, the stream will close with an error. + * + *

        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 (MessagingClient messagingClient = MessagingClient.create()) {
        +   *   BidiStream bidiStream =
        +   *       messagingClient.connectCallable().call();
        +   *   ConnectRequest request = ConnectRequest.newBuilder().build();
        +   *   bidiStream.send(request);
        +   *   for (StreamBlurbsResponse response : bidiStream) {
        +   *     // Do something when a response is received.
        +   *   }
        +   * }
        +   * }
        + */ + public final BidiStreamingCallable connectCallable() { + return stub.connectCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists information about the supported locations for this service. + * + *

        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 (MessagingClient messagingClient = MessagingClient.create()) {
        +   *   ListLocationsRequest request =
        +   *       ListLocationsRequest.newBuilder()
        +   *           .setName("name3373707")
        +   *           .setFilter("filter-1274492040")
        +   *           .setPageSize(883849137)
        +   *           .setPageToken("pageToken873572522")
        +   *           .build();
        +   *   for (Location element : messagingClient.listLocations(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 ListLocationsPagedResponse listLocations(ListLocationsRequest request) { + return listLocationsPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists information about the supported locations for this service. + * + *

        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 (MessagingClient messagingClient = MessagingClient.create()) {
        +   *   ListLocationsRequest request =
        +   *       ListLocationsRequest.newBuilder()
        +   *           .setName("name3373707")
        +   *           .setFilter("filter-1274492040")
        +   *           .setPageSize(883849137)
        +   *           .setPageToken("pageToken873572522")
        +   *           .build();
        +   *   ApiFuture future = messagingClient.listLocationsPagedCallable().futureCall(request);
        +   *   // Do something.
        +   *   for (Location element : future.get().iterateAll()) {
        +   *     // doThingsWith(element);
        +   *   }
        +   * }
        +   * }
        + */ + public final UnaryCallable + listLocationsPagedCallable() { + return stub.listLocationsPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists information about the supported locations for this service. + * + *

        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 (MessagingClient messagingClient = MessagingClient.create()) {
        +   *   ListLocationsRequest request =
        +   *       ListLocationsRequest.newBuilder()
        +   *           .setName("name3373707")
        +   *           .setFilter("filter-1274492040")
        +   *           .setPageSize(883849137)
        +   *           .setPageToken("pageToken873572522")
        +   *           .build();
        +   *   while (true) {
        +   *     ListLocationsResponse response = messagingClient.listLocationsCallable().call(request);
        +   *     for (Location element : response.getLocationsList()) {
        +   *       // doThingsWith(element);
        +   *     }
        +   *     String nextPageToken = response.getNextPageToken();
        +   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
        +   *       request = request.toBuilder().setPageToken(nextPageToken).build();
        +   *     } else {
        +   *       break;
        +   *     }
        +   *   }
        +   * }
        +   * }
        + */ + public final UnaryCallable listLocationsCallable() { + return stub.listLocationsCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets information about a location. + * + *

        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 (MessagingClient messagingClient = MessagingClient.create()) {
        +   *   GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build();
        +   *   Location response = messagingClient.getLocation(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 Location getLocation(GetLocationRequest request) { + return getLocationCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets information about a location. + * + *

        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 (MessagingClient messagingClient = MessagingClient.create()) {
        +   *   GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build();
        +   *   ApiFuture future = messagingClient.getLocationCallable().futureCall(request);
        +   *   // Do something.
        +   *   Location response = future.get();
        +   * }
        +   * }
        + */ + public final UnaryCallable getLocationCallable() { + return stub.getLocationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Sets the access control policy on the specified resource. Replaces any existing policy. + * + *

        Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED` errors. + * + *

        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 (MessagingClient messagingClient = MessagingClient.create()) {
        +   *   SetIamPolicyRequest request =
        +   *       SetIamPolicyRequest.newBuilder()
        +   *           .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString())
        +   *           .setPolicy(Policy.newBuilder().build())
        +   *           .setUpdateMask(FieldMask.newBuilder().build())
        +   *           .build();
        +   *   Policy response = messagingClient.setIamPolicy(request);
        +   * }
        +   * }
        + * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Policy setIamPolicy(SetIamPolicyRequest request) { + return setIamPolicyCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Sets the access control policy on the specified resource. Replaces any existing policy. + * + *

        Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED` errors. + * + *

        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 (MessagingClient messagingClient = MessagingClient.create()) {
        +   *   SetIamPolicyRequest request =
        +   *       SetIamPolicyRequest.newBuilder()
        +   *           .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString())
        +   *           .setPolicy(Policy.newBuilder().build())
        +   *           .setUpdateMask(FieldMask.newBuilder().build())
        +   *           .build();
        +   *   ApiFuture future = messagingClient.setIamPolicyCallable().futureCall(request);
        +   *   // Do something.
        +   *   Policy response = future.get();
        +   * }
        +   * }
        + */ + public final UnaryCallable setIamPolicyCallable() { + return stub.setIamPolicyCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets the access control policy for a resource. Returns an empty policy if the resource exists + * and does not have a policy set. + * + *

        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 (MessagingClient messagingClient = MessagingClient.create()) {
        +   *   GetIamPolicyRequest request =
        +   *       GetIamPolicyRequest.newBuilder()
        +   *           .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString())
        +   *           .setOptions(GetPolicyOptions.newBuilder().build())
        +   *           .build();
        +   *   Policy response = messagingClient.getIamPolicy(request);
        +   * }
        +   * }
        + * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Policy getIamPolicy(GetIamPolicyRequest request) { + return getIamPolicyCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets the access control policy for a resource. Returns an empty policy if the resource exists + * and does not have a policy set. + * + *

        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 (MessagingClient messagingClient = MessagingClient.create()) {
        +   *   GetIamPolicyRequest request =
        +   *       GetIamPolicyRequest.newBuilder()
        +   *           .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString())
        +   *           .setOptions(GetPolicyOptions.newBuilder().build())
        +   *           .build();
        +   *   ApiFuture future = messagingClient.getIamPolicyCallable().futureCall(request);
        +   *   // Do something.
        +   *   Policy response = future.get();
        +   * }
        +   * }
        + */ + public final UnaryCallable getIamPolicyCallable() { + return stub.getIamPolicyCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Returns permissions that a caller has on the specified resource. If the resource does not + * exist, this will return an empty set of permissions, not a `NOT_FOUND` error. + * + *

        Note: This operation is designed to be used for building permission-aware UIs and + * command-line tools, not for authorization checking. This operation may "fail open" without + * warning. + * + *

        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 (MessagingClient messagingClient = MessagingClient.create()) {
        +   *   TestIamPermissionsRequest request =
        +   *       TestIamPermissionsRequest.newBuilder()
        +   *           .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString())
        +   *           .addAllPermissions(new ArrayList())
        +   *           .build();
        +   *   TestIamPermissionsResponse response = messagingClient.testIamPermissions(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 TestIamPermissionsResponse testIamPermissions(TestIamPermissionsRequest request) { + return testIamPermissionsCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Returns permissions that a caller has on the specified resource. If the resource does not + * exist, this will return an empty set of permissions, not a `NOT_FOUND` error. + * + *

        Note: This operation is designed to be used for building permission-aware UIs and + * command-line tools, not for authorization checking. This operation may "fail open" without + * warning. + * + *

        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 (MessagingClient messagingClient = MessagingClient.create()) {
        +   *   TestIamPermissionsRequest request =
        +   *       TestIamPermissionsRequest.newBuilder()
        +   *           .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString())
        +   *           .addAllPermissions(new ArrayList())
        +   *           .build();
        +   *   ApiFuture future =
        +   *       messagingClient.testIamPermissionsCallable().futureCall(request);
        +   *   // Do something.
        +   *   TestIamPermissionsResponse response = future.get();
        +   * }
        +   * }
        + */ + public final UnaryCallable + testIamPermissionsCallable() { + return stub.testIamPermissionsCallable(); + } + + @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 ListRoomsPagedResponse + extends AbstractPagedListResponse< + ListRoomsRequest, ListRoomsResponse, Room, ListRoomsPage, ListRoomsFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListRoomsPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, input -> new ListRoomsPagedResponse(input), MoreExecutors.directExecutor()); + } + + private ListRoomsPagedResponse(ListRoomsPage page) { + super(page, ListRoomsFixedSizeCollection.createEmptyCollection()); + } + } + + public static class ListRoomsPage + extends AbstractPage { + + private ListRoomsPage( + PageContext context, + ListRoomsResponse response) { + super(context, response); + } + + private static ListRoomsPage createEmptyPage() { + return new ListRoomsPage(null, null); + } + + @Override + protected ListRoomsPage createPage( + PageContext context, + ListRoomsResponse response) { + return new ListRoomsPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class ListRoomsFixedSizeCollection + extends AbstractFixedSizeCollection< + ListRoomsRequest, ListRoomsResponse, Room, ListRoomsPage, ListRoomsFixedSizeCollection> { + + private ListRoomsFixedSizeCollection(List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListRoomsFixedSizeCollection createEmptyCollection() { + return new ListRoomsFixedSizeCollection(null, 0); + } + + @Override + protected ListRoomsFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListRoomsFixedSizeCollection(pages, collectionSize); + } + } + + public static class ListBlurbsPagedResponse + extends AbstractPagedListResponse< + ListBlurbsRequest, + ListBlurbsResponse, + Blurb, + ListBlurbsPage, + ListBlurbsFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListBlurbsPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, input -> new ListBlurbsPagedResponse(input), MoreExecutors.directExecutor()); + } + + private ListBlurbsPagedResponse(ListBlurbsPage page) { + super(page, ListBlurbsFixedSizeCollection.createEmptyCollection()); + } + } + + public static class ListBlurbsPage + extends AbstractPage { + + private ListBlurbsPage( + PageContext context, + ListBlurbsResponse response) { + super(context, response); + } + + private static ListBlurbsPage createEmptyPage() { + return new ListBlurbsPage(null, null); + } + + @Override + protected ListBlurbsPage createPage( + PageContext context, + ListBlurbsResponse response) { + return new ListBlurbsPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class ListBlurbsFixedSizeCollection + extends AbstractFixedSizeCollection< + ListBlurbsRequest, + ListBlurbsResponse, + Blurb, + ListBlurbsPage, + ListBlurbsFixedSizeCollection> { + + private ListBlurbsFixedSizeCollection(List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListBlurbsFixedSizeCollection createEmptyCollection() { + return new ListBlurbsFixedSizeCollection(null, 0); + } + + @Override + protected ListBlurbsFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListBlurbsFixedSizeCollection(pages, collectionSize); + } + } + + public static class ListLocationsPagedResponse + extends AbstractPagedListResponse< + ListLocationsRequest, + ListLocationsResponse, + Location, + ListLocationsPage, + ListLocationsFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListLocationsPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + input -> new ListLocationsPagedResponse(input), + MoreExecutors.directExecutor()); + } + + private ListLocationsPagedResponse(ListLocationsPage page) { + super(page, ListLocationsFixedSizeCollection.createEmptyCollection()); + } + } + + public static class ListLocationsPage + extends AbstractPage< + ListLocationsRequest, ListLocationsResponse, Location, ListLocationsPage> { + + private ListLocationsPage( + PageContext context, + ListLocationsResponse response) { + super(context, response); + } + + private static ListLocationsPage createEmptyPage() { + return new ListLocationsPage(null, null); + } + + @Override + protected ListLocationsPage createPage( + PageContext context, + ListLocationsResponse response) { + return new ListLocationsPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class ListLocationsFixedSizeCollection + extends AbstractFixedSizeCollection< + ListLocationsRequest, + ListLocationsResponse, + Location, + ListLocationsPage, + ListLocationsFixedSizeCollection> { + + private ListLocationsFixedSizeCollection(List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListLocationsFixedSizeCollection createEmptyCollection() { + return new ListLocationsFixedSizeCollection(null, 0); + } + + @Override + protected ListLocationsFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListLocationsFixedSizeCollection(pages, collectionSize); + } + } +} diff --git a/java-showcase-3.25.8/gapic-showcase/src/main/java/com/google/showcase/v1beta1/MessagingSettings.java b/java-showcase-3.25.8/gapic-showcase/src/main/java/com/google/showcase/v1beta1/MessagingSettings.java new file mode 100644 index 0000000000..377a43a4c4 --- /dev/null +++ b/java-showcase-3.25.8/gapic-showcase/src/main/java/com/google/showcase/v1beta1/MessagingSettings.java @@ -0,0 +1,463 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1; + +import static com.google.showcase.v1beta1.MessagingClient.ListBlurbsPagedResponse; +import static com.google.showcase.v1beta1.MessagingClient.ListLocationsPagedResponse; +import static com.google.showcase.v1beta1.MessagingClient.ListRoomsPagedResponse; + +import com.google.api.core.ApiFunction; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; +import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; +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.ServerStreamingCallSettings; +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.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.longrunning.Operation; +import com.google.protobuf.Empty; +import com.google.showcase.v1beta1.stub.MessagingStubSettings; +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 MessagingClient}. + * + *

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

          + *
        • The default service address (localhost) and default port (7469) 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 createRoom: + * + *

        {@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
        + * MessagingSettings.Builder messagingSettingsBuilder = MessagingSettings.newBuilder();
        + * messagingSettingsBuilder
        + *     .createRoomSettings()
        + *     .setRetrySettings(
        + *         messagingSettingsBuilder
        + *             .createRoomSettings()
        + *             .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());
        + * MessagingSettings messagingSettings = messagingSettingsBuilder.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 searchBlurbs: + * + *

        {@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
        + * MessagingSettings.Builder messagingSettingsBuilder = MessagingSettings.newBuilder();
        + * TimedRetryAlgorithm timedRetryAlgorithm =
        + *     OperationalTimedPollAlgorithm.create(
        + *         RetrySettings.newBuilder()
        + *             .setInitialRetryDelayDuration(Duration.ofMillis(500))
        + *             .setRetryDelayMultiplier(1.5)
        + *             .setMaxRetryDelayDuration(Duration.ofMillis(5000))
        + *             .setTotalTimeoutDuration(Duration.ofHours(24))
        + *             .build());
        + * messagingSettingsBuilder
        + *     .createClusterOperationSettings()
        + *     .setPollingAlgorithm(timedRetryAlgorithm)
        + *     .build();
        + * }
        + */ +@BetaApi +@Generated("by gapic-generator-java") +public class MessagingSettings extends ClientSettings { + + /** Returns the object with the settings used for calls to createRoom. */ + public UnaryCallSettings createRoomSettings() { + return ((MessagingStubSettings) getStubSettings()).createRoomSettings(); + } + + /** Returns the object with the settings used for calls to getRoom. */ + public UnaryCallSettings getRoomSettings() { + return ((MessagingStubSettings) getStubSettings()).getRoomSettings(); + } + + /** Returns the object with the settings used for calls to updateRoom. */ + public UnaryCallSettings updateRoomSettings() { + return ((MessagingStubSettings) getStubSettings()).updateRoomSettings(); + } + + /** Returns the object with the settings used for calls to deleteRoom. */ + public UnaryCallSettings deleteRoomSettings() { + return ((MessagingStubSettings) getStubSettings()).deleteRoomSettings(); + } + + /** Returns the object with the settings used for calls to listRooms. */ + public PagedCallSettings + listRoomsSettings() { + return ((MessagingStubSettings) getStubSettings()).listRoomsSettings(); + } + + /** Returns the object with the settings used for calls to createBlurb. */ + public UnaryCallSettings createBlurbSettings() { + return ((MessagingStubSettings) getStubSettings()).createBlurbSettings(); + } + + /** Returns the object with the settings used for calls to getBlurb. */ + public UnaryCallSettings getBlurbSettings() { + return ((MessagingStubSettings) getStubSettings()).getBlurbSettings(); + } + + /** Returns the object with the settings used for calls to updateBlurb. */ + public UnaryCallSettings updateBlurbSettings() { + return ((MessagingStubSettings) getStubSettings()).updateBlurbSettings(); + } + + /** Returns the object with the settings used for calls to deleteBlurb. */ + public UnaryCallSettings deleteBlurbSettings() { + return ((MessagingStubSettings) getStubSettings()).deleteBlurbSettings(); + } + + /** Returns the object with the settings used for calls to listBlurbs. */ + public PagedCallSettings + listBlurbsSettings() { + return ((MessagingStubSettings) getStubSettings()).listBlurbsSettings(); + } + + /** Returns the object with the settings used for calls to searchBlurbs. */ + public UnaryCallSettings searchBlurbsSettings() { + return ((MessagingStubSettings) getStubSettings()).searchBlurbsSettings(); + } + + /** Returns the object with the settings used for calls to searchBlurbs. */ + public OperationCallSettings + searchBlurbsOperationSettings() { + return ((MessagingStubSettings) getStubSettings()).searchBlurbsOperationSettings(); + } + + /** Returns the object with the settings used for calls to streamBlurbs. */ + public ServerStreamingCallSettings + streamBlurbsSettings() { + return ((MessagingStubSettings) getStubSettings()).streamBlurbsSettings(); + } + + /** Returns the object with the settings used for calls to sendBlurbs. */ + public StreamingCallSettings sendBlurbsSettings() { + return ((MessagingStubSettings) getStubSettings()).sendBlurbsSettings(); + } + + /** Returns the object with the settings used for calls to connect. */ + public StreamingCallSettings connectSettings() { + return ((MessagingStubSettings) getStubSettings()).connectSettings(); + } + + /** Returns the object with the settings used for calls to listLocations. */ + public PagedCallSettings + listLocationsSettings() { + return ((MessagingStubSettings) getStubSettings()).listLocationsSettings(); + } + + /** Returns the object with the settings used for calls to getLocation. */ + public UnaryCallSettings getLocationSettings() { + return ((MessagingStubSettings) getStubSettings()).getLocationSettings(); + } + + /** Returns the object with the settings used for calls to setIamPolicy. */ + public UnaryCallSettings setIamPolicySettings() { + return ((MessagingStubSettings) getStubSettings()).setIamPolicySettings(); + } + + /** Returns the object with the settings used for calls to getIamPolicy. */ + public UnaryCallSettings getIamPolicySettings() { + return ((MessagingStubSettings) getStubSettings()).getIamPolicySettings(); + } + + /** Returns the object with the settings used for calls to testIamPermissions. */ + public UnaryCallSettings + testIamPermissionsSettings() { + return ((MessagingStubSettings) getStubSettings()).testIamPermissionsSettings(); + } + + public static final MessagingSettings create(MessagingStubSettings stub) throws IOException { + return new MessagingSettings.Builder(stub.toBuilder()).build(); + } + + /** Returns a builder for the default ExecutorProvider for this service. */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return MessagingStubSettings.defaultExecutorProviderBuilder(); + } + + /** Returns the default service endpoint. */ + public static String getDefaultEndpoint() { + return MessagingStubSettings.getDefaultEndpoint(); + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return MessagingStubSettings.getDefaultServiceScopes(); + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return MessagingStubSettings.defaultCredentialsProviderBuilder(); + } + + /** Returns a builder for the default gRPC ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return MessagingStubSettings.defaultGrpcTransportProviderBuilder(); + } + + /** Returns a builder for the default REST ChannelProvider for this service. */ + @BetaApi + public static InstantiatingHttpJsonChannelProvider.Builder + defaultHttpJsonTransportProviderBuilder() { + return MessagingStubSettings.defaultHttpJsonTransportProviderBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return MessagingStubSettings.defaultTransportChannelProvider(); + } + + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return MessagingStubSettings.defaultApiClientHeaderProviderBuilder(); + } + + /** Returns a new gRPC builder for this class. */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** Returns a new REST builder for this class. */ + public static Builder newHttpJsonBuilder() { + return Builder.createHttpJsonDefault(); + } + + /** 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 MessagingSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + } + + /** Builder for MessagingSettings. */ + public static class Builder extends ClientSettings.Builder { + + protected Builder() throws IOException { + this(((ClientContext) null)); + } + + protected Builder(ClientContext clientContext) { + super(MessagingStubSettings.newBuilder(clientContext)); + } + + protected Builder(MessagingSettings settings) { + super(settings.getStubSettings().toBuilder()); + } + + protected Builder(MessagingStubSettings.Builder stubSettings) { + super(stubSettings); + } + + private static Builder createDefault() { + return new Builder(MessagingStubSettings.newBuilder()); + } + + private static Builder createHttpJsonDefault() { + return new Builder(MessagingStubSettings.newHttpJsonBuilder()); + } + + public MessagingStubSettings.Builder getStubSettingsBuilder() { + return ((MessagingStubSettings.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 createRoom. */ + public UnaryCallSettings.Builder createRoomSettings() { + return getStubSettingsBuilder().createRoomSettings(); + } + + /** Returns the builder for the settings used for calls to getRoom. */ + public UnaryCallSettings.Builder getRoomSettings() { + return getStubSettingsBuilder().getRoomSettings(); + } + + /** Returns the builder for the settings used for calls to updateRoom. */ + public UnaryCallSettings.Builder updateRoomSettings() { + return getStubSettingsBuilder().updateRoomSettings(); + } + + /** Returns the builder for the settings used for calls to deleteRoom. */ + public UnaryCallSettings.Builder deleteRoomSettings() { + return getStubSettingsBuilder().deleteRoomSettings(); + } + + /** Returns the builder for the settings used for calls to listRooms. */ + public PagedCallSettings.Builder + listRoomsSettings() { + return getStubSettingsBuilder().listRoomsSettings(); + } + + /** Returns the builder for the settings used for calls to createBlurb. */ + public UnaryCallSettings.Builder createBlurbSettings() { + return getStubSettingsBuilder().createBlurbSettings(); + } + + /** Returns the builder for the settings used for calls to getBlurb. */ + public UnaryCallSettings.Builder getBlurbSettings() { + return getStubSettingsBuilder().getBlurbSettings(); + } + + /** Returns the builder for the settings used for calls to updateBlurb. */ + public UnaryCallSettings.Builder updateBlurbSettings() { + return getStubSettingsBuilder().updateBlurbSettings(); + } + + /** Returns the builder for the settings used for calls to deleteBlurb. */ + public UnaryCallSettings.Builder deleteBlurbSettings() { + return getStubSettingsBuilder().deleteBlurbSettings(); + } + + /** Returns the builder for the settings used for calls to listBlurbs. */ + public PagedCallSettings.Builder + listBlurbsSettings() { + return getStubSettingsBuilder().listBlurbsSettings(); + } + + /** Returns the builder for the settings used for calls to searchBlurbs. */ + public UnaryCallSettings.Builder searchBlurbsSettings() { + return getStubSettingsBuilder().searchBlurbsSettings(); + } + + /** Returns the builder for the settings used for calls to searchBlurbs. */ + public OperationCallSettings.Builder< + SearchBlurbsRequest, SearchBlurbsResponse, SearchBlurbsMetadata> + searchBlurbsOperationSettings() { + return getStubSettingsBuilder().searchBlurbsOperationSettings(); + } + + /** Returns the builder for the settings used for calls to streamBlurbs. */ + public ServerStreamingCallSettings.Builder + streamBlurbsSettings() { + return getStubSettingsBuilder().streamBlurbsSettings(); + } + + /** Returns the builder for the settings used for calls to sendBlurbs. */ + public StreamingCallSettings.Builder + sendBlurbsSettings() { + return getStubSettingsBuilder().sendBlurbsSettings(); + } + + /** Returns the builder for the settings used for calls to connect. */ + public StreamingCallSettings.Builder connectSettings() { + return getStubSettingsBuilder().connectSettings(); + } + + /** Returns the builder for the settings used for calls to listLocations. */ + public PagedCallSettings.Builder< + ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse> + listLocationsSettings() { + return getStubSettingsBuilder().listLocationsSettings(); + } + + /** Returns the builder for the settings used for calls to getLocation. */ + public UnaryCallSettings.Builder getLocationSettings() { + return getStubSettingsBuilder().getLocationSettings(); + } + + /** Returns the builder for the settings used for calls to setIamPolicy. */ + public UnaryCallSettings.Builder setIamPolicySettings() { + return getStubSettingsBuilder().setIamPolicySettings(); + } + + /** Returns the builder for the settings used for calls to getIamPolicy. */ + public UnaryCallSettings.Builder getIamPolicySettings() { + return getStubSettingsBuilder().getIamPolicySettings(); + } + + /** Returns the builder for the settings used for calls to testIamPermissions. */ + public UnaryCallSettings.Builder + testIamPermissionsSettings() { + return getStubSettingsBuilder().testIamPermissionsSettings(); + } + + @Override + public MessagingSettings build() throws IOException { + return new MessagingSettings(this); + } + } +} diff --git a/java-showcase-3.25.8/gapic-showcase/src/main/java/com/google/showcase/v1beta1/SequenceServiceClient.java b/java-showcase-3.25.8/gapic-showcase/src/main/java/com/google/showcase/v1beta1/SequenceServiceClient.java new file mode 100644 index 0000000000..76ac609f2d --- /dev/null +++ b/java-showcase-3.25.8/gapic-showcase/src/main/java/com/google/showcase/v1beta1/SequenceServiceClient.java @@ -0,0 +1,1342 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1; + +import com.google.api.core.ApiFuture; +import com.google.api.core.ApiFutures; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.paging.AbstractFixedSizeCollection; +import com.google.api.gax.paging.AbstractPage; +import com.google.api.gax.paging.AbstractPagedListResponse; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.common.util.concurrent.MoreExecutors; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.protobuf.Empty; +import com.google.showcase.v1beta1.stub.SequenceServiceStub; +import com.google.showcase.v1beta1.stub.SequenceServiceStubSettings; +import java.io.IOException; +import java.util.List; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * 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 (SequenceServiceClient sequenceServiceClient = SequenceServiceClient.create()) {
        + *   Sequence sequence = Sequence.newBuilder().build();
        + *   Sequence response = sequenceServiceClient.createSequence(sequence);
        + * }
        + * }
        + * + *

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

        CreateSequence

        Creates a sequence.

        + *

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

        + *
          + *
        • createSequence(CreateSequenceRequest request) + *

        + *

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

        + *
          + *
        • createSequence(Sequence sequence) + *

        + *

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

        + *
          + *
        • createSequenceCallable() + *

        + *

        CreateStreamingSequence

        Creates a sequence.

        + *

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

        + *
          + *
        • createStreamingSequence(CreateStreamingSequenceRequest request) + *

        + *

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

        + *
          + *
        • createStreamingSequence(StreamingSequence streamingSequence) + *

        + *

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

        + *
          + *
        • createStreamingSequenceCallable() + *

        + *

        GetSequenceReport

        Retrieves a sequence.

        + *

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

        + *
          + *
        • getSequenceReport(GetSequenceReportRequest request) + *

        + *

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

        + *
          + *
        • getSequenceReport(SequenceReportName name) + *

        • getSequenceReport(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.

        + *
          + *
        • getSequenceReportCallable() + *

        + *

        GetStreamingSequenceReport

        Retrieves a sequence.

        + *

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

        + *
          + *
        • getStreamingSequenceReport(GetStreamingSequenceReportRequest request) + *

        + *

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

        + *
          + *
        • getStreamingSequenceReport(StreamingSequenceReportName name) + *

        • getStreamingSequenceReport(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.

        + *
          + *
        • getStreamingSequenceReportCallable() + *

        + *

        AttemptSequence

        Attempts a sequence.

        + *

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

        + *
          + *
        • attemptSequence(AttemptSequenceRequest request) + *

        + *

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

        + *
          + *
        • attemptSequence(SequenceName name) + *

        • attemptSequence(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.

        + *
          + *
        • attemptSequenceCallable() + *

        + *

        AttemptStreamingSequence

        Attempts a streaming sequence. May not function as expected in HTTP mode due to when http statuses are sent See https://github.com/googleapis/gapic-showcase/issues/1377 for more details

        + *

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

        + *
          + *
        • attemptStreamingSequenceCallable() + *

        + *

        ListLocations

        Lists information about the supported locations for this service.

        + *

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

        + *
          + *
        • listLocations(ListLocationsRequest request) + *

        + *

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

        + *
          + *
        • listLocationsPagedCallable() + *

        • listLocationsCallable() + *

        + *

        GetLocation

        Gets information about a location.

        + *

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

        + *
          + *
        • getLocation(GetLocationRequest request) + *

        + *

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

        + *
          + *
        • getLocationCallable() + *

        + *

        SetIamPolicy

        Sets the access control policy on the specified resource. Replaces any existing policy. + *

        Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED` errors.

        + *

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

        + *
          + *
        • setIamPolicy(SetIamPolicyRequest request) + *

        + *

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

        + *
          + *
        • setIamPolicyCallable() + *

        + *

        GetIamPolicy

        Gets the access control policy for a resource. Returns an empty policy if the resource exists and does not have a policy set.

        + *

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

        + *
          + *
        • getIamPolicy(GetIamPolicyRequest request) + *

        + *

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

        + *
          + *
        • getIamPolicyCallable() + *

        + *

        TestIamPermissions

        Returns permissions that a caller has on the specified resource. If the resource does not exist, this will return an empty set of permissions, not a `NOT_FOUND` error. + *

        Note: This operation is designed to be used for building permission-aware UIs and command-line tools, not for authorization checking. This operation may "fail open" without warning.

        + *

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

        + *
          + *
        • testIamPermissions(TestIamPermissionsRequest request) + *

        + *

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

        + *
          + *
        • testIamPermissionsCallable() + *

        + *
        + * + *

        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 SequenceServiceSettings 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
        + * SequenceServiceSettings sequenceServiceSettings =
        + *     SequenceServiceSettings.newBuilder()
        + *         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
        + *         .build();
        + * SequenceServiceClient sequenceServiceClient =
        + *     SequenceServiceClient.create(sequenceServiceSettings);
        + * }
        + * + *

        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
        + * SequenceServiceSettings sequenceServiceSettings =
        + *     SequenceServiceSettings.newBuilder().setEndpoint(myEndpoint).build();
        + * SequenceServiceClient sequenceServiceClient =
        + *     SequenceServiceClient.create(sequenceServiceSettings);
        + * }
        + * + *

        To use REST (HTTP1.1/JSON) transport (instead of gRPC) for sending and receiving requests over + * the wire: + * + *

        {@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
        + * SequenceServiceSettings sequenceServiceSettings =
        + *     SequenceServiceSettings.newHttpJsonBuilder().build();
        + * SequenceServiceClient sequenceServiceClient =
        + *     SequenceServiceClient.create(sequenceServiceSettings);
        + * }
        + * + *

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

        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 (SequenceServiceClient sequenceServiceClient = SequenceServiceClient.create()) {
        +   *   Sequence sequence = Sequence.newBuilder().build();
        +   *   Sequence response = sequenceServiceClient.createSequence(sequence);
        +   * }
        +   * }
        + * + * @param sequence + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Sequence createSequence(Sequence sequence) { + CreateSequenceRequest request = + CreateSequenceRequest.newBuilder().setSequence(sequence).build(); + return createSequence(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a sequence. + * + *

        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 (SequenceServiceClient sequenceServiceClient = SequenceServiceClient.create()) {
        +   *   CreateSequenceRequest request =
        +   *       CreateSequenceRequest.newBuilder().setSequence(Sequence.newBuilder().build()).build();
        +   *   Sequence response = sequenceServiceClient.createSequence(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 Sequence createSequence(CreateSequenceRequest request) { + return createSequenceCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a sequence. + * + *

        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 (SequenceServiceClient sequenceServiceClient = SequenceServiceClient.create()) {
        +   *   CreateSequenceRequest request =
        +   *       CreateSequenceRequest.newBuilder().setSequence(Sequence.newBuilder().build()).build();
        +   *   ApiFuture future =
        +   *       sequenceServiceClient.createSequenceCallable().futureCall(request);
        +   *   // Do something.
        +   *   Sequence response = future.get();
        +   * }
        +   * }
        + */ + public final UnaryCallable createSequenceCallable() { + return stub.createSequenceCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a sequence. + * + *

        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 (SequenceServiceClient sequenceServiceClient = SequenceServiceClient.create()) {
        +   *   StreamingSequence streamingSequence = StreamingSequence.newBuilder().build();
        +   *   StreamingSequence response = sequenceServiceClient.createStreamingSequence(streamingSequence);
        +   * }
        +   * }
        + * + * @param streamingSequence + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final StreamingSequence createStreamingSequence(StreamingSequence streamingSequence) { + CreateStreamingSequenceRequest request = + CreateStreamingSequenceRequest.newBuilder().setStreamingSequence(streamingSequence).build(); + return createStreamingSequence(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a sequence. + * + *

        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 (SequenceServiceClient sequenceServiceClient = SequenceServiceClient.create()) {
        +   *   CreateStreamingSequenceRequest request =
        +   *       CreateStreamingSequenceRequest.newBuilder()
        +   *           .setStreamingSequence(StreamingSequence.newBuilder().build())
        +   *           .build();
        +   *   StreamingSequence response = sequenceServiceClient.createStreamingSequence(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 StreamingSequence createStreamingSequence(CreateStreamingSequenceRequest request) { + return createStreamingSequenceCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a sequence. + * + *

        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 (SequenceServiceClient sequenceServiceClient = SequenceServiceClient.create()) {
        +   *   CreateStreamingSequenceRequest request =
        +   *       CreateStreamingSequenceRequest.newBuilder()
        +   *           .setStreamingSequence(StreamingSequence.newBuilder().build())
        +   *           .build();
        +   *   ApiFuture future =
        +   *       sequenceServiceClient.createStreamingSequenceCallable().futureCall(request);
        +   *   // Do something.
        +   *   StreamingSequence response = future.get();
        +   * }
        +   * }
        + */ + public final UnaryCallable + createStreamingSequenceCallable() { + return stub.createStreamingSequenceCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Retrieves a sequence. + * + *

        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 (SequenceServiceClient sequenceServiceClient = SequenceServiceClient.create()) {
        +   *   SequenceReportName name = SequenceReportName.of("[SEQUENCE]");
        +   *   SequenceReport response = sequenceServiceClient.getSequenceReport(name);
        +   * }
        +   * }
        + * + * @param name + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final SequenceReport getSequenceReport(SequenceReportName name) { + GetSequenceReportRequest request = + GetSequenceReportRequest.newBuilder() + .setName(name == null ? null : name.toString()) + .build(); + return getSequenceReport(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Retrieves a sequence. + * + *

        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 (SequenceServiceClient sequenceServiceClient = SequenceServiceClient.create()) {
        +   *   String name = SequenceReportName.of("[SEQUENCE]").toString();
        +   *   SequenceReport response = sequenceServiceClient.getSequenceReport(name);
        +   * }
        +   * }
        + * + * @param name + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final SequenceReport getSequenceReport(String name) { + GetSequenceReportRequest request = GetSequenceReportRequest.newBuilder().setName(name).build(); + return getSequenceReport(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Retrieves a sequence. + * + *

        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 (SequenceServiceClient sequenceServiceClient = SequenceServiceClient.create()) {
        +   *   GetSequenceReportRequest request =
        +   *       GetSequenceReportRequest.newBuilder()
        +   *           .setName(SequenceReportName.of("[SEQUENCE]").toString())
        +   *           .build();
        +   *   SequenceReport response = sequenceServiceClient.getSequenceReport(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 SequenceReport getSequenceReport(GetSequenceReportRequest request) { + return getSequenceReportCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Retrieves a sequence. + * + *

        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 (SequenceServiceClient sequenceServiceClient = SequenceServiceClient.create()) {
        +   *   GetSequenceReportRequest request =
        +   *       GetSequenceReportRequest.newBuilder()
        +   *           .setName(SequenceReportName.of("[SEQUENCE]").toString())
        +   *           .build();
        +   *   ApiFuture future =
        +   *       sequenceServiceClient.getSequenceReportCallable().futureCall(request);
        +   *   // Do something.
        +   *   SequenceReport response = future.get();
        +   * }
        +   * }
        + */ + public final UnaryCallable getSequenceReportCallable() { + return stub.getSequenceReportCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Retrieves a sequence. + * + *

        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 (SequenceServiceClient sequenceServiceClient = SequenceServiceClient.create()) {
        +   *   StreamingSequenceReportName name = StreamingSequenceReportName.of("[STREAMING_SEQUENCE]");
        +   *   StreamingSequenceReport response = sequenceServiceClient.getStreamingSequenceReport(name);
        +   * }
        +   * }
        + * + * @param name + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final StreamingSequenceReport getStreamingSequenceReport( + StreamingSequenceReportName name) { + GetStreamingSequenceReportRequest request = + GetStreamingSequenceReportRequest.newBuilder() + .setName(name == null ? null : name.toString()) + .build(); + return getStreamingSequenceReport(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Retrieves a sequence. + * + *

        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 (SequenceServiceClient sequenceServiceClient = SequenceServiceClient.create()) {
        +   *   String name = StreamingSequenceReportName.of("[STREAMING_SEQUENCE]").toString();
        +   *   StreamingSequenceReport response = sequenceServiceClient.getStreamingSequenceReport(name);
        +   * }
        +   * }
        + * + * @param name + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final StreamingSequenceReport getStreamingSequenceReport(String name) { + GetStreamingSequenceReportRequest request = + GetStreamingSequenceReportRequest.newBuilder().setName(name).build(); + return getStreamingSequenceReport(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Retrieves a sequence. + * + *

        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 (SequenceServiceClient sequenceServiceClient = SequenceServiceClient.create()) {
        +   *   GetStreamingSequenceReportRequest request =
        +   *       GetStreamingSequenceReportRequest.newBuilder()
        +   *           .setName(StreamingSequenceReportName.of("[STREAMING_SEQUENCE]").toString())
        +   *           .build();
        +   *   StreamingSequenceReport response = sequenceServiceClient.getStreamingSequenceReport(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 StreamingSequenceReport getStreamingSequenceReport( + GetStreamingSequenceReportRequest request) { + return getStreamingSequenceReportCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Retrieves a sequence. + * + *

        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 (SequenceServiceClient sequenceServiceClient = SequenceServiceClient.create()) {
        +   *   GetStreamingSequenceReportRequest request =
        +   *       GetStreamingSequenceReportRequest.newBuilder()
        +   *           .setName(StreamingSequenceReportName.of("[STREAMING_SEQUENCE]").toString())
        +   *           .build();
        +   *   ApiFuture future =
        +   *       sequenceServiceClient.getStreamingSequenceReportCallable().futureCall(request);
        +   *   // Do something.
        +   *   StreamingSequenceReport response = future.get();
        +   * }
        +   * }
        + */ + public final UnaryCallable + getStreamingSequenceReportCallable() { + return stub.getStreamingSequenceReportCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Attempts a sequence. + * + *

        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 (SequenceServiceClient sequenceServiceClient = SequenceServiceClient.create()) {
        +   *   SequenceName name = SequenceName.of("[SEQUENCE]");
        +   *   sequenceServiceClient.attemptSequence(name);
        +   * }
        +   * }
        + * + * @param name + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final void attemptSequence(SequenceName name) { + AttemptSequenceRequest request = + AttemptSequenceRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + attemptSequence(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Attempts a sequence. + * + *

        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 (SequenceServiceClient sequenceServiceClient = SequenceServiceClient.create()) {
        +   *   String name = SequenceName.of("[SEQUENCE]").toString();
        +   *   sequenceServiceClient.attemptSequence(name);
        +   * }
        +   * }
        + * + * @param name + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final void attemptSequence(String name) { + AttemptSequenceRequest request = AttemptSequenceRequest.newBuilder().setName(name).build(); + attemptSequence(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Attempts a sequence. + * + *

        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 (SequenceServiceClient sequenceServiceClient = SequenceServiceClient.create()) {
        +   *   AttemptSequenceRequest request =
        +   *       AttemptSequenceRequest.newBuilder()
        +   *           .setName(SequenceName.of("[SEQUENCE]").toString())
        +   *           .build();
        +   *   sequenceServiceClient.attemptSequence(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 attemptSequence(AttemptSequenceRequest request) { + attemptSequenceCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Attempts a sequence. + * + *

        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 (SequenceServiceClient sequenceServiceClient = SequenceServiceClient.create()) {
        +   *   AttemptSequenceRequest request =
        +   *       AttemptSequenceRequest.newBuilder()
        +   *           .setName(SequenceName.of("[SEQUENCE]").toString())
        +   *           .build();
        +   *   ApiFuture future = sequenceServiceClient.attemptSequenceCallable().futureCall(request);
        +   *   // Do something.
        +   *   future.get();
        +   * }
        +   * }
        + */ + public final UnaryCallable attemptSequenceCallable() { + return stub.attemptSequenceCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Attempts a streaming sequence. May not function as expected in HTTP mode due to when http + * statuses are sent See https://github.com/googleapis/gapic-showcase/issues/1377 for more details + * + *

        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 (SequenceServiceClient sequenceServiceClient = SequenceServiceClient.create()) {
        +   *   AttemptStreamingSequenceRequest request =
        +   *       AttemptStreamingSequenceRequest.newBuilder()
        +   *           .setName(StreamingSequenceName.of("[STREAMING_SEQUENCE]").toString())
        +   *           .setLastFailIndex(2006482362)
        +   *           .build();
        +   *   ServerStream stream =
        +   *       sequenceServiceClient.attemptStreamingSequenceCallable().call(request);
        +   *   for (AttemptStreamingSequenceResponse response : stream) {
        +   *     // Do something when a response is received.
        +   *   }
        +   * }
        +   * }
        + */ + public final ServerStreamingCallable< + AttemptStreamingSequenceRequest, AttemptStreamingSequenceResponse> + attemptStreamingSequenceCallable() { + return stub.attemptStreamingSequenceCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists information about the supported locations for this service. + * + *

        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 (SequenceServiceClient sequenceServiceClient = SequenceServiceClient.create()) {
        +   *   ListLocationsRequest request =
        +   *       ListLocationsRequest.newBuilder()
        +   *           .setName("name3373707")
        +   *           .setFilter("filter-1274492040")
        +   *           .setPageSize(883849137)
        +   *           .setPageToken("pageToken873572522")
        +   *           .build();
        +   *   for (Location element : sequenceServiceClient.listLocations(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 ListLocationsPagedResponse listLocations(ListLocationsRequest request) { + return listLocationsPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists information about the supported locations for this service. + * + *

        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 (SequenceServiceClient sequenceServiceClient = SequenceServiceClient.create()) {
        +   *   ListLocationsRequest request =
        +   *       ListLocationsRequest.newBuilder()
        +   *           .setName("name3373707")
        +   *           .setFilter("filter-1274492040")
        +   *           .setPageSize(883849137)
        +   *           .setPageToken("pageToken873572522")
        +   *           .build();
        +   *   ApiFuture future =
        +   *       sequenceServiceClient.listLocationsPagedCallable().futureCall(request);
        +   *   // Do something.
        +   *   for (Location element : future.get().iterateAll()) {
        +   *     // doThingsWith(element);
        +   *   }
        +   * }
        +   * }
        + */ + public final UnaryCallable + listLocationsPagedCallable() { + return stub.listLocationsPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists information about the supported locations for this service. + * + *

        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 (SequenceServiceClient sequenceServiceClient = SequenceServiceClient.create()) {
        +   *   ListLocationsRequest request =
        +   *       ListLocationsRequest.newBuilder()
        +   *           .setName("name3373707")
        +   *           .setFilter("filter-1274492040")
        +   *           .setPageSize(883849137)
        +   *           .setPageToken("pageToken873572522")
        +   *           .build();
        +   *   while (true) {
        +   *     ListLocationsResponse response =
        +   *         sequenceServiceClient.listLocationsCallable().call(request);
        +   *     for (Location element : response.getLocationsList()) {
        +   *       // doThingsWith(element);
        +   *     }
        +   *     String nextPageToken = response.getNextPageToken();
        +   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
        +   *       request = request.toBuilder().setPageToken(nextPageToken).build();
        +   *     } else {
        +   *       break;
        +   *     }
        +   *   }
        +   * }
        +   * }
        + */ + public final UnaryCallable listLocationsCallable() { + return stub.listLocationsCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets information about a location. + * + *

        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 (SequenceServiceClient sequenceServiceClient = SequenceServiceClient.create()) {
        +   *   GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build();
        +   *   Location response = sequenceServiceClient.getLocation(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 Location getLocation(GetLocationRequest request) { + return getLocationCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets information about a location. + * + *

        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 (SequenceServiceClient sequenceServiceClient = SequenceServiceClient.create()) {
        +   *   GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build();
        +   *   ApiFuture future = sequenceServiceClient.getLocationCallable().futureCall(request);
        +   *   // Do something.
        +   *   Location response = future.get();
        +   * }
        +   * }
        + */ + public final UnaryCallable getLocationCallable() { + return stub.getLocationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Sets the access control policy on the specified resource. Replaces any existing policy. + * + *

        Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED` errors. + * + *

        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 (SequenceServiceClient sequenceServiceClient = SequenceServiceClient.create()) {
        +   *   SetIamPolicyRequest request =
        +   *       SetIamPolicyRequest.newBuilder()
        +   *           .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString())
        +   *           .setPolicy(Policy.newBuilder().build())
        +   *           .setUpdateMask(FieldMask.newBuilder().build())
        +   *           .build();
        +   *   Policy response = sequenceServiceClient.setIamPolicy(request);
        +   * }
        +   * }
        + * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Policy setIamPolicy(SetIamPolicyRequest request) { + return setIamPolicyCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Sets the access control policy on the specified resource. Replaces any existing policy. + * + *

        Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED` errors. + * + *

        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 (SequenceServiceClient sequenceServiceClient = SequenceServiceClient.create()) {
        +   *   SetIamPolicyRequest request =
        +   *       SetIamPolicyRequest.newBuilder()
        +   *           .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString())
        +   *           .setPolicy(Policy.newBuilder().build())
        +   *           .setUpdateMask(FieldMask.newBuilder().build())
        +   *           .build();
        +   *   ApiFuture future = sequenceServiceClient.setIamPolicyCallable().futureCall(request);
        +   *   // Do something.
        +   *   Policy response = future.get();
        +   * }
        +   * }
        + */ + public final UnaryCallable setIamPolicyCallable() { + return stub.setIamPolicyCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets the access control policy for a resource. Returns an empty policy if the resource exists + * and does not have a policy set. + * + *

        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 (SequenceServiceClient sequenceServiceClient = SequenceServiceClient.create()) {
        +   *   GetIamPolicyRequest request =
        +   *       GetIamPolicyRequest.newBuilder()
        +   *           .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString())
        +   *           .setOptions(GetPolicyOptions.newBuilder().build())
        +   *           .build();
        +   *   Policy response = sequenceServiceClient.getIamPolicy(request);
        +   * }
        +   * }
        + * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Policy getIamPolicy(GetIamPolicyRequest request) { + return getIamPolicyCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets the access control policy for a resource. Returns an empty policy if the resource exists + * and does not have a policy set. + * + *

        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 (SequenceServiceClient sequenceServiceClient = SequenceServiceClient.create()) {
        +   *   GetIamPolicyRequest request =
        +   *       GetIamPolicyRequest.newBuilder()
        +   *           .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString())
        +   *           .setOptions(GetPolicyOptions.newBuilder().build())
        +   *           .build();
        +   *   ApiFuture future = sequenceServiceClient.getIamPolicyCallable().futureCall(request);
        +   *   // Do something.
        +   *   Policy response = future.get();
        +   * }
        +   * }
        + */ + public final UnaryCallable getIamPolicyCallable() { + return stub.getIamPolicyCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Returns permissions that a caller has on the specified resource. If the resource does not + * exist, this will return an empty set of permissions, not a `NOT_FOUND` error. + * + *

        Note: This operation is designed to be used for building permission-aware UIs and + * command-line tools, not for authorization checking. This operation may "fail open" without + * warning. + * + *

        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 (SequenceServiceClient sequenceServiceClient = SequenceServiceClient.create()) {
        +   *   TestIamPermissionsRequest request =
        +   *       TestIamPermissionsRequest.newBuilder()
        +   *           .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString())
        +   *           .addAllPermissions(new ArrayList())
        +   *           .build();
        +   *   TestIamPermissionsResponse response = sequenceServiceClient.testIamPermissions(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 TestIamPermissionsResponse testIamPermissions(TestIamPermissionsRequest request) { + return testIamPermissionsCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Returns permissions that a caller has on the specified resource. If the resource does not + * exist, this will return an empty set of permissions, not a `NOT_FOUND` error. + * + *

        Note: This operation is designed to be used for building permission-aware UIs and + * command-line tools, not for authorization checking. This operation may "fail open" without + * warning. + * + *

        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 (SequenceServiceClient sequenceServiceClient = SequenceServiceClient.create()) {
        +   *   TestIamPermissionsRequest request =
        +   *       TestIamPermissionsRequest.newBuilder()
        +   *           .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString())
        +   *           .addAllPermissions(new ArrayList())
        +   *           .build();
        +   *   ApiFuture future =
        +   *       sequenceServiceClient.testIamPermissionsCallable().futureCall(request);
        +   *   // Do something.
        +   *   TestIamPermissionsResponse response = future.get();
        +   * }
        +   * }
        + */ + public final UnaryCallable + testIamPermissionsCallable() { + return stub.testIamPermissionsCallable(); + } + + @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 ListLocationsPagedResponse + extends AbstractPagedListResponse< + ListLocationsRequest, + ListLocationsResponse, + Location, + ListLocationsPage, + ListLocationsFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListLocationsPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + input -> new ListLocationsPagedResponse(input), + MoreExecutors.directExecutor()); + } + + private ListLocationsPagedResponse(ListLocationsPage page) { + super(page, ListLocationsFixedSizeCollection.createEmptyCollection()); + } + } + + public static class ListLocationsPage + extends AbstractPage< + ListLocationsRequest, ListLocationsResponse, Location, ListLocationsPage> { + + private ListLocationsPage( + PageContext context, + ListLocationsResponse response) { + super(context, response); + } + + private static ListLocationsPage createEmptyPage() { + return new ListLocationsPage(null, null); + } + + @Override + protected ListLocationsPage createPage( + PageContext context, + ListLocationsResponse response) { + return new ListLocationsPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class ListLocationsFixedSizeCollection + extends AbstractFixedSizeCollection< + ListLocationsRequest, + ListLocationsResponse, + Location, + ListLocationsPage, + ListLocationsFixedSizeCollection> { + + private ListLocationsFixedSizeCollection(List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListLocationsFixedSizeCollection createEmptyCollection() { + return new ListLocationsFixedSizeCollection(null, 0); + } + + @Override + protected ListLocationsFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListLocationsFixedSizeCollection(pages, collectionSize); + } + } +} diff --git a/java-showcase-3.25.8/gapic-showcase/src/main/java/com/google/showcase/v1beta1/SequenceServiceSettings.java b/java-showcase-3.25.8/gapic-showcase/src/main/java/com/google/showcase/v1beta1/SequenceServiceSettings.java new file mode 100644 index 0000000000..67eefab806 --- /dev/null +++ b/java-showcase-3.25.8/gapic-showcase/src/main/java/com/google/showcase/v1beta1/SequenceServiceSettings.java @@ -0,0 +1,344 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1; + +import static com.google.showcase.v1beta1.SequenceServiceClient.ListLocationsPagedResponse; + +import com.google.api.core.ApiFunction; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; +import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; +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.ServerStreamingCallSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.protobuf.Empty; +import com.google.showcase.v1beta1.stub.SequenceServiceStubSettings; +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 SequenceServiceClient}. + * + *

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

          + *
        • The default service address (localhost) and default port (7469) 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 createSequence: + * + *

        {@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
        + * SequenceServiceSettings.Builder sequenceServiceSettingsBuilder =
        + *     SequenceServiceSettings.newBuilder();
        + * sequenceServiceSettingsBuilder
        + *     .createSequenceSettings()
        + *     .setRetrySettings(
        + *         sequenceServiceSettingsBuilder
        + *             .createSequenceSettings()
        + *             .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());
        + * SequenceServiceSettings sequenceServiceSettings = sequenceServiceSettingsBuilder.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. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class SequenceServiceSettings extends ClientSettings { + + /** Returns the object with the settings used for calls to createSequence. */ + public UnaryCallSettings createSequenceSettings() { + return ((SequenceServiceStubSettings) getStubSettings()).createSequenceSettings(); + } + + /** Returns the object with the settings used for calls to createStreamingSequence. */ + public UnaryCallSettings + createStreamingSequenceSettings() { + return ((SequenceServiceStubSettings) getStubSettings()).createStreamingSequenceSettings(); + } + + /** Returns the object with the settings used for calls to getSequenceReport. */ + public UnaryCallSettings getSequenceReportSettings() { + return ((SequenceServiceStubSettings) getStubSettings()).getSequenceReportSettings(); + } + + /** Returns the object with the settings used for calls to getStreamingSequenceReport. */ + public UnaryCallSettings + getStreamingSequenceReportSettings() { + return ((SequenceServiceStubSettings) getStubSettings()).getStreamingSequenceReportSettings(); + } + + /** Returns the object with the settings used for calls to attemptSequence. */ + public UnaryCallSettings attemptSequenceSettings() { + return ((SequenceServiceStubSettings) getStubSettings()).attemptSequenceSettings(); + } + + /** Returns the object with the settings used for calls to attemptStreamingSequence. */ + public ServerStreamingCallSettings< + AttemptStreamingSequenceRequest, AttemptStreamingSequenceResponse> + attemptStreamingSequenceSettings() { + return ((SequenceServiceStubSettings) getStubSettings()).attemptStreamingSequenceSettings(); + } + + /** Returns the object with the settings used for calls to listLocations. */ + public PagedCallSettings + listLocationsSettings() { + return ((SequenceServiceStubSettings) getStubSettings()).listLocationsSettings(); + } + + /** Returns the object with the settings used for calls to getLocation. */ + public UnaryCallSettings getLocationSettings() { + return ((SequenceServiceStubSettings) getStubSettings()).getLocationSettings(); + } + + /** Returns the object with the settings used for calls to setIamPolicy. */ + public UnaryCallSettings setIamPolicySettings() { + return ((SequenceServiceStubSettings) getStubSettings()).setIamPolicySettings(); + } + + /** Returns the object with the settings used for calls to getIamPolicy. */ + public UnaryCallSettings getIamPolicySettings() { + return ((SequenceServiceStubSettings) getStubSettings()).getIamPolicySettings(); + } + + /** Returns the object with the settings used for calls to testIamPermissions. */ + public UnaryCallSettings + testIamPermissionsSettings() { + return ((SequenceServiceStubSettings) getStubSettings()).testIamPermissionsSettings(); + } + + public static final SequenceServiceSettings create(SequenceServiceStubSettings stub) + throws IOException { + return new SequenceServiceSettings.Builder(stub.toBuilder()).build(); + } + + /** Returns a builder for the default ExecutorProvider for this service. */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return SequenceServiceStubSettings.defaultExecutorProviderBuilder(); + } + + /** Returns the default service endpoint. */ + public static String getDefaultEndpoint() { + return SequenceServiceStubSettings.getDefaultEndpoint(); + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return SequenceServiceStubSettings.getDefaultServiceScopes(); + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return SequenceServiceStubSettings.defaultCredentialsProviderBuilder(); + } + + /** Returns a builder for the default gRPC ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return SequenceServiceStubSettings.defaultGrpcTransportProviderBuilder(); + } + + /** Returns a builder for the default REST ChannelProvider for this service. */ + @BetaApi + public static InstantiatingHttpJsonChannelProvider.Builder + defaultHttpJsonTransportProviderBuilder() { + return SequenceServiceStubSettings.defaultHttpJsonTransportProviderBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return SequenceServiceStubSettings.defaultTransportChannelProvider(); + } + + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return SequenceServiceStubSettings.defaultApiClientHeaderProviderBuilder(); + } + + /** Returns a new gRPC builder for this class. */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** Returns a new REST builder for this class. */ + public static Builder newHttpJsonBuilder() { + return Builder.createHttpJsonDefault(); + } + + /** 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 SequenceServiceSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + } + + /** Builder for SequenceServiceSettings. */ + public static class Builder extends ClientSettings.Builder { + + protected Builder() throws IOException { + this(((ClientContext) null)); + } + + protected Builder(ClientContext clientContext) { + super(SequenceServiceStubSettings.newBuilder(clientContext)); + } + + protected Builder(SequenceServiceSettings settings) { + super(settings.getStubSettings().toBuilder()); + } + + protected Builder(SequenceServiceStubSettings.Builder stubSettings) { + super(stubSettings); + } + + private static Builder createDefault() { + return new Builder(SequenceServiceStubSettings.newBuilder()); + } + + private static Builder createHttpJsonDefault() { + return new Builder(SequenceServiceStubSettings.newHttpJsonBuilder()); + } + + public SequenceServiceStubSettings.Builder getStubSettingsBuilder() { + return ((SequenceServiceStubSettings.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 createSequence. */ + public UnaryCallSettings.Builder createSequenceSettings() { + return getStubSettingsBuilder().createSequenceSettings(); + } + + /** Returns the builder for the settings used for calls to createStreamingSequence. */ + public UnaryCallSettings.Builder + createStreamingSequenceSettings() { + return getStubSettingsBuilder().createStreamingSequenceSettings(); + } + + /** Returns the builder for the settings used for calls to getSequenceReport. */ + public UnaryCallSettings.Builder + getSequenceReportSettings() { + return getStubSettingsBuilder().getSequenceReportSettings(); + } + + /** Returns the builder for the settings used for calls to getStreamingSequenceReport. */ + public UnaryCallSettings.Builder + getStreamingSequenceReportSettings() { + return getStubSettingsBuilder().getStreamingSequenceReportSettings(); + } + + /** Returns the builder for the settings used for calls to attemptSequence. */ + public UnaryCallSettings.Builder attemptSequenceSettings() { + return getStubSettingsBuilder().attemptSequenceSettings(); + } + + /** Returns the builder for the settings used for calls to attemptStreamingSequence. */ + public ServerStreamingCallSettings.Builder< + AttemptStreamingSequenceRequest, AttemptStreamingSequenceResponse> + attemptStreamingSequenceSettings() { + return getStubSettingsBuilder().attemptStreamingSequenceSettings(); + } + + /** Returns the builder for the settings used for calls to listLocations. */ + public PagedCallSettings.Builder< + ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse> + listLocationsSettings() { + return getStubSettingsBuilder().listLocationsSettings(); + } + + /** Returns the builder for the settings used for calls to getLocation. */ + public UnaryCallSettings.Builder getLocationSettings() { + return getStubSettingsBuilder().getLocationSettings(); + } + + /** Returns the builder for the settings used for calls to setIamPolicy. */ + public UnaryCallSettings.Builder setIamPolicySettings() { + return getStubSettingsBuilder().setIamPolicySettings(); + } + + /** Returns the builder for the settings used for calls to getIamPolicy. */ + public UnaryCallSettings.Builder getIamPolicySettings() { + return getStubSettingsBuilder().getIamPolicySettings(); + } + + /** Returns the builder for the settings used for calls to testIamPermissions. */ + public UnaryCallSettings.Builder + testIamPermissionsSettings() { + return getStubSettingsBuilder().testIamPermissionsSettings(); + } + + @Override + public SequenceServiceSettings build() throws IOException { + return new SequenceServiceSettings(this); + } + } +} diff --git a/java-showcase-3.25.8/gapic-showcase/src/main/java/com/google/showcase/v1beta1/TestingClient.java b/java-showcase-3.25.8/gapic-showcase/src/main/java/com/google/showcase/v1beta1/TestingClient.java new file mode 100644 index 0000000000..517fd7f7d3 --- /dev/null +++ b/java-showcase-3.25.8/gapic-showcase/src/main/java/com/google/showcase/v1beta1/TestingClient.java @@ -0,0 +1,1501 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1; + +import com.google.api.core.ApiFuture; +import com.google.api.core.ApiFutures; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.paging.AbstractFixedSizeCollection; +import com.google.api.gax.paging.AbstractPage; +import com.google.api.gax.paging.AbstractPagedListResponse; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.common.util.concurrent.MoreExecutors; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.protobuf.Empty; +import com.google.showcase.v1beta1.stub.TestingStub; +import com.google.showcase.v1beta1.stub.TestingStubSettings; +import java.io.IOException; +import java.util.List; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Service Description: A service to facilitate running discrete sets of tests against Showcase. + * Adding this comment with special characters for comment formatting tests: 1. + * (abra->kadabra->alakazam) 2) [Nonsense][]: `pokemon/*/psychic/*` + * + *

        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 (TestingClient testingClient = TestingClient.create()) {
        + *   CreateSessionRequest request =
        + *       CreateSessionRequest.newBuilder().setSession(Session.newBuilder().build()).build();
        + *   Session response = testingClient.createSession(request);
        + * }
        + * }
        + * + *

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

        CreateSession

        Creates a new testing session. Adding this comment with special characters for comment formatting tests: 1. (abra->kadabra->alakazam) 2) [Nonsense][]: `pokemon/*/psychic/*`

        + *

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

        + *
          + *
        • createSession(CreateSessionRequest request) + *

        + *

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

        + *
          + *
        • createSessionCallable() + *

        + *

        GetSession

        Gets a testing session.

        + *

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

        + *
          + *
        • getSession(GetSessionRequest request) + *

        + *

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

        + *
          + *
        • getSessionCallable() + *

        + *

        ListSessions

        Lists the current test sessions.

        + *

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

        + *
          + *
        • listSessions(ListSessionsRequest request) + *

        + *

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

        + *
          + *
        • listSessionsPagedCallable() + *

        • listSessionsCallable() + *

        + *

        DeleteSession

        Delete a test session.

        + *

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

        + *
          + *
        • deleteSession(DeleteSessionRequest request) + *

        + *

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

        + *
          + *
        • deleteSessionCallable() + *

        + *

        ReportSession

        Report on the status of a session. This generates a report detailing which tests have been completed, and an overall rollup.

        + *

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

        + *
          + *
        • reportSession(ReportSessionRequest request) + *

        + *

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

        + *
          + *
        • reportSessionCallable() + *

        + *

        ListTests

        List the tests of a sessesion.

        + *

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

        + *
          + *
        • listTests(ListTestsRequest request) + *

        + *

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

        + *
          + *
        • listTestsPagedCallable() + *

        • listTestsCallable() + *

        + *

        DeleteTest

        Explicitly decline to implement a test. + *

        This removes the test from subsequent `ListTests` calls, and attempting to do the test will error. + *

        This method will error if attempting to delete a required test.

        + *

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

        + *
          + *
        • deleteTest(DeleteTestRequest request) + *

        + *

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

        + *
          + *
        • deleteTestCallable() + *

        + *

        VerifyTest

        Register a response to a test. + *

        In cases where a test involves registering a final answer at the end of the test, this method provides the means to do so.

        + *

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

        + *
          + *
        • verifyTest(VerifyTestRequest request) + *

        + *

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

        + *
          + *
        • verifyTestCallable() + *

        + *

        ListLocations

        Lists information about the supported locations for this service.

        + *

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

        + *
          + *
        • listLocations(ListLocationsRequest request) + *

        + *

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

        + *
          + *
        • listLocationsPagedCallable() + *

        • listLocationsCallable() + *

        + *

        GetLocation

        Gets information about a location.

        + *

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

        + *
          + *
        • getLocation(GetLocationRequest request) + *

        + *

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

        + *
          + *
        • getLocationCallable() + *

        + *

        SetIamPolicy

        Sets the access control policy on the specified resource. Replaces any existing policy. + *

        Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED` errors.

        + *

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

        + *
          + *
        • setIamPolicy(SetIamPolicyRequest request) + *

        + *

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

        + *
          + *
        • setIamPolicyCallable() + *

        + *

        GetIamPolicy

        Gets the access control policy for a resource. Returns an empty policy if the resource exists and does not have a policy set.

        + *

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

        + *
          + *
        • getIamPolicy(GetIamPolicyRequest request) + *

        + *

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

        + *
          + *
        • getIamPolicyCallable() + *

        + *

        TestIamPermissions

        Returns permissions that a caller has on the specified resource. If the resource does not exist, this will return an empty set of permissions, not a `NOT_FOUND` error. + *

        Note: This operation is designed to be used for building permission-aware UIs and command-line tools, not for authorization checking. This operation may "fail open" without warning.

        + *

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

        + *
          + *
        • testIamPermissions(TestIamPermissionsRequest request) + *

        + *

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

        + *
          + *
        • testIamPermissionsCallable() + *

        + *
        + * + *

        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 TestingSettings 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
        + * TestingSettings testingSettings =
        + *     TestingSettings.newBuilder()
        + *         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
        + *         .build();
        + * TestingClient testingClient = TestingClient.create(testingSettings);
        + * }
        + * + *

        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
        + * TestingSettings testingSettings = TestingSettings.newBuilder().setEndpoint(myEndpoint).build();
        + * TestingClient testingClient = TestingClient.create(testingSettings);
        + * }
        + * + *

        To use REST (HTTP1.1/JSON) transport (instead of gRPC) for sending and receiving requests over + * the wire: + * + *

        {@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
        + * TestingSettings testingSettings = TestingSettings.newHttpJsonBuilder().build();
        + * TestingClient testingClient = TestingClient.create(testingSettings);
        + * }
        + * + *

        Please refer to the GitHub repository's samples for more quickstart code snippets. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class TestingClient implements BackgroundResource { + private final TestingSettings settings; + private final TestingStub stub; + + /** Constructs an instance of TestingClient with default settings. */ + public static final TestingClient create() throws IOException { + return create(TestingSettings.newBuilder().build()); + } + + /** + * Constructs an instance of TestingClient, 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 TestingClient create(TestingSettings settings) throws IOException { + return new TestingClient(settings); + } + + /** + * Constructs an instance of TestingClient, using the given stub for making calls. This is for + * advanced usage - prefer using create(TestingSettings). + */ + public static final TestingClient create(TestingStub stub) { + return new TestingClient(stub); + } + + /** + * Constructs an instance of TestingClient, 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 TestingClient(TestingSettings settings) throws IOException { + this.settings = settings; + this.stub = ((TestingStubSettings) settings.getStubSettings()).createStub(); + } + + protected TestingClient(TestingStub stub) { + this.settings = null; + this.stub = stub; + } + + public final TestingSettings getSettings() { + return settings; + } + + public TestingStub getStub() { + return stub; + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a new testing session. Adding this comment with special characters for comment + * formatting tests: 1. (abra->kadabra->alakazam) 2) [Nonsense][]: + * `pokemon/*/psychic/*` + * + *

        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 (TestingClient testingClient = TestingClient.create()) {
        +   *   CreateSessionRequest request =
        +   *       CreateSessionRequest.newBuilder().setSession(Session.newBuilder().build()).build();
        +   *   Session response = testingClient.createSession(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 Session createSession(CreateSessionRequest request) { + return createSessionCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a new testing session. Adding this comment with special characters for comment + * formatting tests: 1. (abra->kadabra->alakazam) 2) [Nonsense][]: + * `pokemon/*/psychic/*` + * + *

        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 (TestingClient testingClient = TestingClient.create()) {
        +   *   CreateSessionRequest request =
        +   *       CreateSessionRequest.newBuilder().setSession(Session.newBuilder().build()).build();
        +   *   ApiFuture future = testingClient.createSessionCallable().futureCall(request);
        +   *   // Do something.
        +   *   Session response = future.get();
        +   * }
        +   * }
        + */ + public final UnaryCallable createSessionCallable() { + return stub.createSessionCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets a testing session. + * + *

        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 (TestingClient testingClient = TestingClient.create()) {
        +   *   GetSessionRequest request =
        +   *       GetSessionRequest.newBuilder().setName(SessionName.of("[SESSION]").toString()).build();
        +   *   Session response = testingClient.getSession(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 Session getSession(GetSessionRequest request) { + return getSessionCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets a testing session. + * + *

        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 (TestingClient testingClient = TestingClient.create()) {
        +   *   GetSessionRequest request =
        +   *       GetSessionRequest.newBuilder().setName(SessionName.of("[SESSION]").toString()).build();
        +   *   ApiFuture future = testingClient.getSessionCallable().futureCall(request);
        +   *   // Do something.
        +   *   Session response = future.get();
        +   * }
        +   * }
        + */ + public final UnaryCallable getSessionCallable() { + return stub.getSessionCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists the current test sessions. + * + *

        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 (TestingClient testingClient = TestingClient.create()) {
        +   *   ListSessionsRequest request =
        +   *       ListSessionsRequest.newBuilder()
        +   *           .setPageSize(883849137)
        +   *           .setPageToken("pageToken873572522")
        +   *           .build();
        +   *   for (Session element : testingClient.listSessions(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 ListSessionsPagedResponse listSessions(ListSessionsRequest request) { + return listSessionsPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists the current test sessions. + * + *

        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 (TestingClient testingClient = TestingClient.create()) {
        +   *   ListSessionsRequest request =
        +   *       ListSessionsRequest.newBuilder()
        +   *           .setPageSize(883849137)
        +   *           .setPageToken("pageToken873572522")
        +   *           .build();
        +   *   ApiFuture future = testingClient.listSessionsPagedCallable().futureCall(request);
        +   *   // Do something.
        +   *   for (Session element : future.get().iterateAll()) {
        +   *     // doThingsWith(element);
        +   *   }
        +   * }
        +   * }
        + */ + public final UnaryCallable + listSessionsPagedCallable() { + return stub.listSessionsPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists the current test sessions. + * + *

        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 (TestingClient testingClient = TestingClient.create()) {
        +   *   ListSessionsRequest request =
        +   *       ListSessionsRequest.newBuilder()
        +   *           .setPageSize(883849137)
        +   *           .setPageToken("pageToken873572522")
        +   *           .build();
        +   *   while (true) {
        +   *     ListSessionsResponse response = testingClient.listSessionsCallable().call(request);
        +   *     for (Session element : response.getSessionsList()) {
        +   *       // doThingsWith(element);
        +   *     }
        +   *     String nextPageToken = response.getNextPageToken();
        +   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
        +   *       request = request.toBuilder().setPageToken(nextPageToken).build();
        +   *     } else {
        +   *       break;
        +   *     }
        +   *   }
        +   * }
        +   * }
        + */ + public final UnaryCallable listSessionsCallable() { + return stub.listSessionsCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Delete a test session. + * + *

        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 (TestingClient testingClient = TestingClient.create()) {
        +   *   DeleteSessionRequest request =
        +   *       DeleteSessionRequest.newBuilder().setName(SessionName.of("[SESSION]").toString()).build();
        +   *   testingClient.deleteSession(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 deleteSession(DeleteSessionRequest request) { + deleteSessionCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Delete a test session. + * + *

        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 (TestingClient testingClient = TestingClient.create()) {
        +   *   DeleteSessionRequest request =
        +   *       DeleteSessionRequest.newBuilder().setName(SessionName.of("[SESSION]").toString()).build();
        +   *   ApiFuture future = testingClient.deleteSessionCallable().futureCall(request);
        +   *   // Do something.
        +   *   future.get();
        +   * }
        +   * }
        + */ + public final UnaryCallable deleteSessionCallable() { + return stub.deleteSessionCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Report on the status of a session. This generates a report detailing which tests have been + * completed, and an overall rollup. + * + *

        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 (TestingClient testingClient = TestingClient.create()) {
        +   *   ReportSessionRequest request =
        +   *       ReportSessionRequest.newBuilder().setName(SessionName.of("[SESSION]").toString()).build();
        +   *   ReportSessionResponse response = testingClient.reportSession(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 ReportSessionResponse reportSession(ReportSessionRequest request) { + return reportSessionCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Report on the status of a session. This generates a report detailing which tests have been + * completed, and an overall rollup. + * + *

        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 (TestingClient testingClient = TestingClient.create()) {
        +   *   ReportSessionRequest request =
        +   *       ReportSessionRequest.newBuilder().setName(SessionName.of("[SESSION]").toString()).build();
        +   *   ApiFuture future =
        +   *       testingClient.reportSessionCallable().futureCall(request);
        +   *   // Do something.
        +   *   ReportSessionResponse response = future.get();
        +   * }
        +   * }
        + */ + public final UnaryCallable reportSessionCallable() { + return stub.reportSessionCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * List the tests of a sessesion. + * + *

        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 (TestingClient testingClient = TestingClient.create()) {
        +   *   ListTestsRequest request =
        +   *       ListTestsRequest.newBuilder()
        +   *           .setParent(SessionName.of("[SESSION]").toString())
        +   *           .setPageSize(883849137)
        +   *           .setPageToken("pageToken873572522")
        +   *           .build();
        +   *   for (Test element : testingClient.listTests(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 ListTestsPagedResponse listTests(ListTestsRequest request) { + return listTestsPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * List the tests of a sessesion. + * + *

        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 (TestingClient testingClient = TestingClient.create()) {
        +   *   ListTestsRequest request =
        +   *       ListTestsRequest.newBuilder()
        +   *           .setParent(SessionName.of("[SESSION]").toString())
        +   *           .setPageSize(883849137)
        +   *           .setPageToken("pageToken873572522")
        +   *           .build();
        +   *   ApiFuture future = testingClient.listTestsPagedCallable().futureCall(request);
        +   *   // Do something.
        +   *   for (Test element : future.get().iterateAll()) {
        +   *     // doThingsWith(element);
        +   *   }
        +   * }
        +   * }
        + */ + public final UnaryCallable listTestsPagedCallable() { + return stub.listTestsPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * List the tests of a sessesion. + * + *

        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 (TestingClient testingClient = TestingClient.create()) {
        +   *   ListTestsRequest request =
        +   *       ListTestsRequest.newBuilder()
        +   *           .setParent(SessionName.of("[SESSION]").toString())
        +   *           .setPageSize(883849137)
        +   *           .setPageToken("pageToken873572522")
        +   *           .build();
        +   *   while (true) {
        +   *     ListTestsResponse response = testingClient.listTestsCallable().call(request);
        +   *     for (Test element : response.getTestsList()) {
        +   *       // doThingsWith(element);
        +   *     }
        +   *     String nextPageToken = response.getNextPageToken();
        +   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
        +   *       request = request.toBuilder().setPageToken(nextPageToken).build();
        +   *     } else {
        +   *       break;
        +   *     }
        +   *   }
        +   * }
        +   * }
        + */ + public final UnaryCallable listTestsCallable() { + return stub.listTestsCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Explicitly decline to implement a test. + * + *

        This removes the test from subsequent `ListTests` calls, and attempting to do the test will + * error. + * + *

        This method will error if attempting to delete a required test. + * + *

        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 (TestingClient testingClient = TestingClient.create()) {
        +   *   DeleteTestRequest request =
        +   *       DeleteTestRequest.newBuilder()
        +   *           .setName(TestName.of("[SESSION]", "[TEST]").toString())
        +   *           .build();
        +   *   testingClient.deleteTest(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 deleteTest(DeleteTestRequest request) { + deleteTestCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Explicitly decline to implement a test. + * + *

        This removes the test from subsequent `ListTests` calls, and attempting to do the test will + * error. + * + *

        This method will error if attempting to delete a required test. + * + *

        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 (TestingClient testingClient = TestingClient.create()) {
        +   *   DeleteTestRequest request =
        +   *       DeleteTestRequest.newBuilder()
        +   *           .setName(TestName.of("[SESSION]", "[TEST]").toString())
        +   *           .build();
        +   *   ApiFuture future = testingClient.deleteTestCallable().futureCall(request);
        +   *   // Do something.
        +   *   future.get();
        +   * }
        +   * }
        + */ + public final UnaryCallable deleteTestCallable() { + return stub.deleteTestCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Register a response to a test. + * + *

        In cases where a test involves registering a final answer at the end of the test, this + * method provides the means to do so. + * + *

        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 (TestingClient testingClient = TestingClient.create()) {
        +   *   VerifyTestRequest request =
        +   *       VerifyTestRequest.newBuilder()
        +   *           .setName(TestName.of("[SESSION]", "[TEST]").toString())
        +   *           .setAnswer(ByteString.EMPTY)
        +   *           .addAllAnswers(new ArrayList())
        +   *           .build();
        +   *   VerifyTestResponse response = testingClient.verifyTest(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 VerifyTestResponse verifyTest(VerifyTestRequest request) { + return verifyTestCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Register a response to a test. + * + *

        In cases where a test involves registering a final answer at the end of the test, this + * method provides the means to do so. + * + *

        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 (TestingClient testingClient = TestingClient.create()) {
        +   *   VerifyTestRequest request =
        +   *       VerifyTestRequest.newBuilder()
        +   *           .setName(TestName.of("[SESSION]", "[TEST]").toString())
        +   *           .setAnswer(ByteString.EMPTY)
        +   *           .addAllAnswers(new ArrayList())
        +   *           .build();
        +   *   ApiFuture future = testingClient.verifyTestCallable().futureCall(request);
        +   *   // Do something.
        +   *   VerifyTestResponse response = future.get();
        +   * }
        +   * }
        + */ + public final UnaryCallable verifyTestCallable() { + return stub.verifyTestCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists information about the supported locations for this service. + * + *

        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 (TestingClient testingClient = TestingClient.create()) {
        +   *   ListLocationsRequest request =
        +   *       ListLocationsRequest.newBuilder()
        +   *           .setName("name3373707")
        +   *           .setFilter("filter-1274492040")
        +   *           .setPageSize(883849137)
        +   *           .setPageToken("pageToken873572522")
        +   *           .build();
        +   *   for (Location element : testingClient.listLocations(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 ListLocationsPagedResponse listLocations(ListLocationsRequest request) { + return listLocationsPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists information about the supported locations for this service. + * + *

        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 (TestingClient testingClient = TestingClient.create()) {
        +   *   ListLocationsRequest request =
        +   *       ListLocationsRequest.newBuilder()
        +   *           .setName("name3373707")
        +   *           .setFilter("filter-1274492040")
        +   *           .setPageSize(883849137)
        +   *           .setPageToken("pageToken873572522")
        +   *           .build();
        +   *   ApiFuture future = testingClient.listLocationsPagedCallable().futureCall(request);
        +   *   // Do something.
        +   *   for (Location element : future.get().iterateAll()) {
        +   *     // doThingsWith(element);
        +   *   }
        +   * }
        +   * }
        + */ + public final UnaryCallable + listLocationsPagedCallable() { + return stub.listLocationsPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists information about the supported locations for this service. + * + *

        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 (TestingClient testingClient = TestingClient.create()) {
        +   *   ListLocationsRequest request =
        +   *       ListLocationsRequest.newBuilder()
        +   *           .setName("name3373707")
        +   *           .setFilter("filter-1274492040")
        +   *           .setPageSize(883849137)
        +   *           .setPageToken("pageToken873572522")
        +   *           .build();
        +   *   while (true) {
        +   *     ListLocationsResponse response = testingClient.listLocationsCallable().call(request);
        +   *     for (Location element : response.getLocationsList()) {
        +   *       // doThingsWith(element);
        +   *     }
        +   *     String nextPageToken = response.getNextPageToken();
        +   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
        +   *       request = request.toBuilder().setPageToken(nextPageToken).build();
        +   *     } else {
        +   *       break;
        +   *     }
        +   *   }
        +   * }
        +   * }
        + */ + public final UnaryCallable listLocationsCallable() { + return stub.listLocationsCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets information about a location. + * + *

        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 (TestingClient testingClient = TestingClient.create()) {
        +   *   GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build();
        +   *   Location response = testingClient.getLocation(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 Location getLocation(GetLocationRequest request) { + return getLocationCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets information about a location. + * + *

        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 (TestingClient testingClient = TestingClient.create()) {
        +   *   GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build();
        +   *   ApiFuture future = testingClient.getLocationCallable().futureCall(request);
        +   *   // Do something.
        +   *   Location response = future.get();
        +   * }
        +   * }
        + */ + public final UnaryCallable getLocationCallable() { + return stub.getLocationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Sets the access control policy on the specified resource. Replaces any existing policy. + * + *

        Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED` errors. + * + *

        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 (TestingClient testingClient = TestingClient.create()) {
        +   *   SetIamPolicyRequest request =
        +   *       SetIamPolicyRequest.newBuilder()
        +   *           .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString())
        +   *           .setPolicy(Policy.newBuilder().build())
        +   *           .setUpdateMask(FieldMask.newBuilder().build())
        +   *           .build();
        +   *   Policy response = testingClient.setIamPolicy(request);
        +   * }
        +   * }
        + * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Policy setIamPolicy(SetIamPolicyRequest request) { + return setIamPolicyCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Sets the access control policy on the specified resource. Replaces any existing policy. + * + *

        Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED` errors. + * + *

        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 (TestingClient testingClient = TestingClient.create()) {
        +   *   SetIamPolicyRequest request =
        +   *       SetIamPolicyRequest.newBuilder()
        +   *           .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString())
        +   *           .setPolicy(Policy.newBuilder().build())
        +   *           .setUpdateMask(FieldMask.newBuilder().build())
        +   *           .build();
        +   *   ApiFuture future = testingClient.setIamPolicyCallable().futureCall(request);
        +   *   // Do something.
        +   *   Policy response = future.get();
        +   * }
        +   * }
        + */ + public final UnaryCallable setIamPolicyCallable() { + return stub.setIamPolicyCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets the access control policy for a resource. Returns an empty policy if the resource exists + * and does not have a policy set. + * + *

        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 (TestingClient testingClient = TestingClient.create()) {
        +   *   GetIamPolicyRequest request =
        +   *       GetIamPolicyRequest.newBuilder()
        +   *           .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString())
        +   *           .setOptions(GetPolicyOptions.newBuilder().build())
        +   *           .build();
        +   *   Policy response = testingClient.getIamPolicy(request);
        +   * }
        +   * }
        + * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Policy getIamPolicy(GetIamPolicyRequest request) { + return getIamPolicyCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets the access control policy for a resource. Returns an empty policy if the resource exists + * and does not have a policy set. + * + *

        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 (TestingClient testingClient = TestingClient.create()) {
        +   *   GetIamPolicyRequest request =
        +   *       GetIamPolicyRequest.newBuilder()
        +   *           .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString())
        +   *           .setOptions(GetPolicyOptions.newBuilder().build())
        +   *           .build();
        +   *   ApiFuture future = testingClient.getIamPolicyCallable().futureCall(request);
        +   *   // Do something.
        +   *   Policy response = future.get();
        +   * }
        +   * }
        + */ + public final UnaryCallable getIamPolicyCallable() { + return stub.getIamPolicyCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Returns permissions that a caller has on the specified resource. If the resource does not + * exist, this will return an empty set of permissions, not a `NOT_FOUND` error. + * + *

        Note: This operation is designed to be used for building permission-aware UIs and + * command-line tools, not for authorization checking. This operation may "fail open" without + * warning. + * + *

        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 (TestingClient testingClient = TestingClient.create()) {
        +   *   TestIamPermissionsRequest request =
        +   *       TestIamPermissionsRequest.newBuilder()
        +   *           .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString())
        +   *           .addAllPermissions(new ArrayList())
        +   *           .build();
        +   *   TestIamPermissionsResponse response = testingClient.testIamPermissions(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 TestIamPermissionsResponse testIamPermissions(TestIamPermissionsRequest request) { + return testIamPermissionsCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Returns permissions that a caller has on the specified resource. If the resource does not + * exist, this will return an empty set of permissions, not a `NOT_FOUND` error. + * + *

        Note: This operation is designed to be used for building permission-aware UIs and + * command-line tools, not for authorization checking. This operation may "fail open" without + * warning. + * + *

        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 (TestingClient testingClient = TestingClient.create()) {
        +   *   TestIamPermissionsRequest request =
        +   *       TestIamPermissionsRequest.newBuilder()
        +   *           .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString())
        +   *           .addAllPermissions(new ArrayList())
        +   *           .build();
        +   *   ApiFuture future =
        +   *       testingClient.testIamPermissionsCallable().futureCall(request);
        +   *   // Do something.
        +   *   TestIamPermissionsResponse response = future.get();
        +   * }
        +   * }
        + */ + public final UnaryCallable + testIamPermissionsCallable() { + return stub.testIamPermissionsCallable(); + } + + @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 ListSessionsPagedResponse + extends AbstractPagedListResponse< + ListSessionsRequest, + ListSessionsResponse, + Session, + ListSessionsPage, + ListSessionsFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListSessionsPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + input -> new ListSessionsPagedResponse(input), + MoreExecutors.directExecutor()); + } + + private ListSessionsPagedResponse(ListSessionsPage page) { + super(page, ListSessionsFixedSizeCollection.createEmptyCollection()); + } + } + + public static class ListSessionsPage + extends AbstractPage { + + private ListSessionsPage( + PageContext context, + ListSessionsResponse response) { + super(context, response); + } + + private static ListSessionsPage createEmptyPage() { + return new ListSessionsPage(null, null); + } + + @Override + protected ListSessionsPage createPage( + PageContext context, + ListSessionsResponse response) { + return new ListSessionsPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class ListSessionsFixedSizeCollection + extends AbstractFixedSizeCollection< + ListSessionsRequest, + ListSessionsResponse, + Session, + ListSessionsPage, + ListSessionsFixedSizeCollection> { + + private ListSessionsFixedSizeCollection(List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListSessionsFixedSizeCollection createEmptyCollection() { + return new ListSessionsFixedSizeCollection(null, 0); + } + + @Override + protected ListSessionsFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListSessionsFixedSizeCollection(pages, collectionSize); + } + } + + public static class ListTestsPagedResponse + extends AbstractPagedListResponse< + ListTestsRequest, ListTestsResponse, Test, ListTestsPage, ListTestsFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListTestsPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, input -> new ListTestsPagedResponse(input), MoreExecutors.directExecutor()); + } + + private ListTestsPagedResponse(ListTestsPage page) { + super(page, ListTestsFixedSizeCollection.createEmptyCollection()); + } + } + + public static class ListTestsPage + extends AbstractPage { + + private ListTestsPage( + PageContext context, + ListTestsResponse response) { + super(context, response); + } + + private static ListTestsPage createEmptyPage() { + return new ListTestsPage(null, null); + } + + @Override + protected ListTestsPage createPage( + PageContext context, + ListTestsResponse response) { + return new ListTestsPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class ListTestsFixedSizeCollection + extends AbstractFixedSizeCollection< + ListTestsRequest, ListTestsResponse, Test, ListTestsPage, ListTestsFixedSizeCollection> { + + private ListTestsFixedSizeCollection(List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListTestsFixedSizeCollection createEmptyCollection() { + return new ListTestsFixedSizeCollection(null, 0); + } + + @Override + protected ListTestsFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListTestsFixedSizeCollection(pages, collectionSize); + } + } + + public static class ListLocationsPagedResponse + extends AbstractPagedListResponse< + ListLocationsRequest, + ListLocationsResponse, + Location, + ListLocationsPage, + ListLocationsFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListLocationsPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + input -> new ListLocationsPagedResponse(input), + MoreExecutors.directExecutor()); + } + + private ListLocationsPagedResponse(ListLocationsPage page) { + super(page, ListLocationsFixedSizeCollection.createEmptyCollection()); + } + } + + public static class ListLocationsPage + extends AbstractPage< + ListLocationsRequest, ListLocationsResponse, Location, ListLocationsPage> { + + private ListLocationsPage( + PageContext context, + ListLocationsResponse response) { + super(context, response); + } + + private static ListLocationsPage createEmptyPage() { + return new ListLocationsPage(null, null); + } + + @Override + protected ListLocationsPage createPage( + PageContext context, + ListLocationsResponse response) { + return new ListLocationsPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class ListLocationsFixedSizeCollection + extends AbstractFixedSizeCollection< + ListLocationsRequest, + ListLocationsResponse, + Location, + ListLocationsPage, + ListLocationsFixedSizeCollection> { + + private ListLocationsFixedSizeCollection(List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListLocationsFixedSizeCollection createEmptyCollection() { + return new ListLocationsFixedSizeCollection(null, 0); + } + + @Override + protected ListLocationsFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListLocationsFixedSizeCollection(pages, collectionSize); + } + } +} diff --git a/java-showcase-3.25.8/gapic-showcase/src/main/java/com/google/showcase/v1beta1/TestingSettings.java b/java-showcase-3.25.8/gapic-showcase/src/main/java/com/google/showcase/v1beta1/TestingSettings.java new file mode 100644 index 0000000000..df199941fe --- /dev/null +++ b/java-showcase-3.25.8/gapic-showcase/src/main/java/com/google/showcase/v1beta1/TestingSettings.java @@ -0,0 +1,360 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1; + +import static com.google.showcase.v1beta1.TestingClient.ListLocationsPagedResponse; +import static com.google.showcase.v1beta1.TestingClient.ListSessionsPagedResponse; +import static com.google.showcase.v1beta1.TestingClient.ListTestsPagedResponse; + +import com.google.api.core.ApiFunction; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; +import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; +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.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.protobuf.Empty; +import com.google.showcase.v1beta1.stub.TestingStubSettings; +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 TestingClient}. + * + *

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

          + *
        • The default service address (localhost) and default port (7469) 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 createSession: + * + *

        {@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
        + * TestingSettings.Builder testingSettingsBuilder = TestingSettings.newBuilder();
        + * testingSettingsBuilder
        + *     .createSessionSettings()
        + *     .setRetrySettings(
        + *         testingSettingsBuilder
        + *             .createSessionSettings()
        + *             .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());
        + * TestingSettings testingSettings = testingSettingsBuilder.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. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class TestingSettings extends ClientSettings { + + /** Returns the object with the settings used for calls to createSession. */ + public UnaryCallSettings createSessionSettings() { + return ((TestingStubSettings) getStubSettings()).createSessionSettings(); + } + + /** Returns the object with the settings used for calls to getSession. */ + public UnaryCallSettings getSessionSettings() { + return ((TestingStubSettings) getStubSettings()).getSessionSettings(); + } + + /** Returns the object with the settings used for calls to listSessions. */ + public PagedCallSettings + listSessionsSettings() { + return ((TestingStubSettings) getStubSettings()).listSessionsSettings(); + } + + /** Returns the object with the settings used for calls to deleteSession. */ + public UnaryCallSettings deleteSessionSettings() { + return ((TestingStubSettings) getStubSettings()).deleteSessionSettings(); + } + + /** Returns the object with the settings used for calls to reportSession. */ + public UnaryCallSettings reportSessionSettings() { + return ((TestingStubSettings) getStubSettings()).reportSessionSettings(); + } + + /** Returns the object with the settings used for calls to listTests. */ + public PagedCallSettings + listTestsSettings() { + return ((TestingStubSettings) getStubSettings()).listTestsSettings(); + } + + /** Returns the object with the settings used for calls to deleteTest. */ + public UnaryCallSettings deleteTestSettings() { + return ((TestingStubSettings) getStubSettings()).deleteTestSettings(); + } + + /** Returns the object with the settings used for calls to verifyTest. */ + public UnaryCallSettings verifyTestSettings() { + return ((TestingStubSettings) getStubSettings()).verifyTestSettings(); + } + + /** Returns the object with the settings used for calls to listLocations. */ + public PagedCallSettings + listLocationsSettings() { + return ((TestingStubSettings) getStubSettings()).listLocationsSettings(); + } + + /** Returns the object with the settings used for calls to getLocation. */ + public UnaryCallSettings getLocationSettings() { + return ((TestingStubSettings) getStubSettings()).getLocationSettings(); + } + + /** Returns the object with the settings used for calls to setIamPolicy. */ + public UnaryCallSettings setIamPolicySettings() { + return ((TestingStubSettings) getStubSettings()).setIamPolicySettings(); + } + + /** Returns the object with the settings used for calls to getIamPolicy. */ + public UnaryCallSettings getIamPolicySettings() { + return ((TestingStubSettings) getStubSettings()).getIamPolicySettings(); + } + + /** Returns the object with the settings used for calls to testIamPermissions. */ + public UnaryCallSettings + testIamPermissionsSettings() { + return ((TestingStubSettings) getStubSettings()).testIamPermissionsSettings(); + } + + public static final TestingSettings create(TestingStubSettings stub) throws IOException { + return new TestingSettings.Builder(stub.toBuilder()).build(); + } + + /** Returns a builder for the default ExecutorProvider for this service. */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return TestingStubSettings.defaultExecutorProviderBuilder(); + } + + /** Returns the default service endpoint. */ + public static String getDefaultEndpoint() { + return TestingStubSettings.getDefaultEndpoint(); + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return TestingStubSettings.getDefaultServiceScopes(); + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return TestingStubSettings.defaultCredentialsProviderBuilder(); + } + + /** Returns a builder for the default gRPC ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return TestingStubSettings.defaultGrpcTransportProviderBuilder(); + } + + /** Returns a builder for the default REST ChannelProvider for this service. */ + @BetaApi + public static InstantiatingHttpJsonChannelProvider.Builder + defaultHttpJsonTransportProviderBuilder() { + return TestingStubSettings.defaultHttpJsonTransportProviderBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return TestingStubSettings.defaultTransportChannelProvider(); + } + + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return TestingStubSettings.defaultApiClientHeaderProviderBuilder(); + } + + /** Returns a new gRPC builder for this class. */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** Returns a new REST builder for this class. */ + public static Builder newHttpJsonBuilder() { + return Builder.createHttpJsonDefault(); + } + + /** 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 TestingSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + } + + /** Builder for TestingSettings. */ + public static class Builder extends ClientSettings.Builder { + + protected Builder() throws IOException { + this(((ClientContext) null)); + } + + protected Builder(ClientContext clientContext) { + super(TestingStubSettings.newBuilder(clientContext)); + } + + protected Builder(TestingSettings settings) { + super(settings.getStubSettings().toBuilder()); + } + + protected Builder(TestingStubSettings.Builder stubSettings) { + super(stubSettings); + } + + private static Builder createDefault() { + return new Builder(TestingStubSettings.newBuilder()); + } + + private static Builder createHttpJsonDefault() { + return new Builder(TestingStubSettings.newHttpJsonBuilder()); + } + + public TestingStubSettings.Builder getStubSettingsBuilder() { + return ((TestingStubSettings.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 createSession. */ + public UnaryCallSettings.Builder createSessionSettings() { + return getStubSettingsBuilder().createSessionSettings(); + } + + /** Returns the builder for the settings used for calls to getSession. */ + public UnaryCallSettings.Builder getSessionSettings() { + return getStubSettingsBuilder().getSessionSettings(); + } + + /** Returns the builder for the settings used for calls to listSessions. */ + public PagedCallSettings.Builder< + ListSessionsRequest, ListSessionsResponse, ListSessionsPagedResponse> + listSessionsSettings() { + return getStubSettingsBuilder().listSessionsSettings(); + } + + /** Returns the builder for the settings used for calls to deleteSession. */ + public UnaryCallSettings.Builder deleteSessionSettings() { + return getStubSettingsBuilder().deleteSessionSettings(); + } + + /** Returns the builder for the settings used for calls to reportSession. */ + public UnaryCallSettings.Builder + reportSessionSettings() { + return getStubSettingsBuilder().reportSessionSettings(); + } + + /** Returns the builder for the settings used for calls to listTests. */ + public PagedCallSettings.Builder + listTestsSettings() { + return getStubSettingsBuilder().listTestsSettings(); + } + + /** Returns the builder for the settings used for calls to deleteTest. */ + public UnaryCallSettings.Builder deleteTestSettings() { + return getStubSettingsBuilder().deleteTestSettings(); + } + + /** Returns the builder for the settings used for calls to verifyTest. */ + public UnaryCallSettings.Builder verifyTestSettings() { + return getStubSettingsBuilder().verifyTestSettings(); + } + + /** Returns the builder for the settings used for calls to listLocations. */ + public PagedCallSettings.Builder< + ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse> + listLocationsSettings() { + return getStubSettingsBuilder().listLocationsSettings(); + } + + /** Returns the builder for the settings used for calls to getLocation. */ + public UnaryCallSettings.Builder getLocationSettings() { + return getStubSettingsBuilder().getLocationSettings(); + } + + /** Returns the builder for the settings used for calls to setIamPolicy. */ + public UnaryCallSettings.Builder setIamPolicySettings() { + return getStubSettingsBuilder().setIamPolicySettings(); + } + + /** Returns the builder for the settings used for calls to getIamPolicy. */ + public UnaryCallSettings.Builder getIamPolicySettings() { + return getStubSettingsBuilder().getIamPolicySettings(); + } + + /** Returns the builder for the settings used for calls to testIamPermissions. */ + public UnaryCallSettings.Builder + testIamPermissionsSettings() { + return getStubSettingsBuilder().testIamPermissionsSettings(); + } + + @Override + public TestingSettings build() throws IOException { + return new TestingSettings(this); + } + } +} diff --git a/java-showcase-3.25.8/gapic-showcase/src/main/java/com/google/showcase/v1beta1/gapic_metadata.json b/java-showcase-3.25.8/gapic-showcase/src/main/java/com/google/showcase/v1beta1/gapic_metadata.json new file mode 100644 index 0000000000..4d11ed39b9 --- /dev/null +++ b/java-showcase-3.25.8/gapic-showcase/src/main/java/com/google/showcase/v1beta1/gapic_metadata.json @@ -0,0 +1,316 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "java", + "protoPackage": "google.showcase.v1beta1", + "libraryPackage": "com.google.showcase.v1beta1", + "services": { + "Compliance": { + "clients": { + "grpc": { + "libraryClient": "ComplianceClient", + "rpcs": { + "GetEnum": { + "methods": ["getEnum", "getEnumCallable"] + }, + "GetIamPolicy": { + "methods": ["getIamPolicy", "getIamPolicyCallable"] + }, + "GetLocation": { + "methods": ["getLocation", "getLocationCallable"] + }, + "ListLocations": { + "methods": ["listLocations", "listLocationsPagedCallable", "listLocationsCallable"] + }, + "RepeatDataBody": { + "methods": ["repeatDataBody", "repeatDataBodyCallable"] + }, + "RepeatDataBodyInfo": { + "methods": ["repeatDataBodyInfo", "repeatDataBodyInfoCallable"] + }, + "RepeatDataBodyPatch": { + "methods": ["repeatDataBodyPatch", "repeatDataBodyPatchCallable"] + }, + "RepeatDataBodyPut": { + "methods": ["repeatDataBodyPut", "repeatDataBodyPutCallable"] + }, + "RepeatDataPathResource": { + "methods": ["repeatDataPathResource", "repeatDataPathResourceCallable"] + }, + "RepeatDataPathTrailingResource": { + "methods": ["repeatDataPathTrailingResource", "repeatDataPathTrailingResourceCallable"] + }, + "RepeatDataQuery": { + "methods": ["repeatDataQuery", "repeatDataQueryCallable"] + }, + "RepeatDataSimplePath": { + "methods": ["repeatDataSimplePath", "repeatDataSimplePathCallable"] + }, + "SetIamPolicy": { + "methods": ["setIamPolicy", "setIamPolicyCallable"] + }, + "TestIamPermissions": { + "methods": ["testIamPermissions", "testIamPermissionsCallable"] + }, + "VerifyEnum": { + "methods": ["verifyEnum", "verifyEnumCallable"] + } + } + } + } + }, + "Echo": { + "clients": { + "grpc": { + "libraryClient": "EchoClient", + "rpcs": { + "Block": { + "methods": ["block", "blockCallable"] + }, + "Chat": { + "methods": ["chatCallable"] + }, + "Collect": { + "methods": ["collectCallable"] + }, + "Echo": { + "methods": ["echo", "echoCallable"] + }, + "EchoErrorDetails": { + "methods": ["echoErrorDetails", "echoErrorDetailsCallable"] + }, + "Expand": { + "methods": ["expandCallable"] + }, + "FailEchoWithDetails": { + "methods": ["failEchoWithDetails", "failEchoWithDetailsCallable"] + }, + "GetIamPolicy": { + "methods": ["getIamPolicy", "getIamPolicyCallable"] + }, + "GetLocation": { + "methods": ["getLocation", "getLocationCallable"] + }, + "ListLocations": { + "methods": ["listLocations", "listLocationsPagedCallable", "listLocationsCallable"] + }, + "PagedExpand": { + "methods": ["pagedExpand", "pagedExpandPagedCallable", "pagedExpandCallable"] + }, + "PagedExpandLegacy": { + "methods": ["pagedExpandLegacy", "pagedExpandLegacyCallable"] + }, + "PagedExpandLegacyMapped": { + "methods": ["pagedExpandLegacyMapped", "pagedExpandLegacyMappedPagedCallable", "pagedExpandLegacyMappedCallable"] + }, + "SetIamPolicy": { + "methods": ["setIamPolicy", "setIamPolicyCallable"] + }, + "TestIamPermissions": { + "methods": ["testIamPermissions", "testIamPermissionsCallable"] + }, + "Wait": { + "methods": ["waitAsync", "waitOperationCallable", "waitCallable"] + } + } + } + }, + "apiVersion": "v1_20240408" + }, + "Identity": { + "clients": { + "grpc": { + "libraryClient": "IdentityClient", + "rpcs": { + "CreateUser": { + "methods": ["createUser", "createUser", "createUser", "createUserCallable"] + }, + "DeleteUser": { + "methods": ["deleteUser", "deleteUser", "deleteUser", "deleteUserCallable"] + }, + "GetIamPolicy": { + "methods": ["getIamPolicy", "getIamPolicyCallable"] + }, + "GetLocation": { + "methods": ["getLocation", "getLocationCallable"] + }, + "GetUser": { + "methods": ["getUser", "getUser", "getUser", "getUserCallable"] + }, + "ListLocations": { + "methods": ["listLocations", "listLocationsPagedCallable", "listLocationsCallable"] + }, + "ListUsers": { + "methods": ["listUsers", "listUsersPagedCallable", "listUsersCallable"] + }, + "SetIamPolicy": { + "methods": ["setIamPolicy", "setIamPolicyCallable"] + }, + "TestIamPermissions": { + "methods": ["testIamPermissions", "testIamPermissionsCallable"] + }, + "UpdateUser": { + "methods": ["updateUser", "updateUserCallable"] + } + } + } + } + }, + "Messaging": { + "clients": { + "grpc": { + "libraryClient": "MessagingClient", + "rpcs": { + "Connect": { + "methods": ["connectCallable"] + }, + "CreateBlurb": { + "methods": ["createBlurb", "createBlurb", "createBlurb", "createBlurb", "createBlurb", "createBlurb", "createBlurb", "createBlurb", "createBlurb", "createBlurb", "createBlurb", "createBlurb", "createBlurb", "createBlurbCallable"] + }, + "CreateRoom": { + "methods": ["createRoom", "createRoom", "createRoomCallable"] + }, + "DeleteBlurb": { + "methods": ["deleteBlurb", "deleteBlurb", "deleteBlurb", "deleteBlurbCallable"] + }, + "DeleteRoom": { + "methods": ["deleteRoom", "deleteRoom", "deleteRoom", "deleteRoomCallable"] + }, + "GetBlurb": { + "methods": ["getBlurb", "getBlurb", "getBlurb", "getBlurbCallable"] + }, + "GetIamPolicy": { + "methods": ["getIamPolicy", "getIamPolicyCallable"] + }, + "GetLocation": { + "methods": ["getLocation", "getLocationCallable"] + }, + "GetRoom": { + "methods": ["getRoom", "getRoom", "getRoom", "getRoomCallable"] + }, + "ListBlurbs": { + "methods": ["listBlurbs", "listBlurbs", "listBlurbs", "listBlurbs", "listBlurbsPagedCallable", "listBlurbsCallable"] + }, + "ListLocations": { + "methods": ["listLocations", "listLocationsPagedCallable", "listLocationsCallable"] + }, + "ListRooms": { + "methods": ["listRooms", "listRoomsPagedCallable", "listRoomsCallable"] + }, + "SearchBlurbs": { + "methods": ["searchBlurbsAsync", "searchBlurbsAsync", "searchBlurbsAsync", "searchBlurbsAsync", "searchBlurbsOperationCallable", "searchBlurbsCallable"] + }, + "SendBlurbs": { + "methods": ["sendBlurbsCallable"] + }, + "SetIamPolicy": { + "methods": ["setIamPolicy", "setIamPolicyCallable"] + }, + "StreamBlurbs": { + "methods": ["streamBlurbsCallable"] + }, + "TestIamPermissions": { + "methods": ["testIamPermissions", "testIamPermissionsCallable"] + }, + "UpdateBlurb": { + "methods": ["updateBlurb", "updateBlurbCallable"] + }, + "UpdateRoom": { + "methods": ["updateRoom", "updateRoomCallable"] + } + } + } + } + }, + "SequenceService": { + "clients": { + "grpc": { + "libraryClient": "SequenceServiceClient", + "rpcs": { + "AttemptSequence": { + "methods": ["attemptSequence", "attemptSequence", "attemptSequence", "attemptSequenceCallable"] + }, + "AttemptStreamingSequence": { + "methods": ["attemptStreamingSequenceCallable"] + }, + "CreateSequence": { + "methods": ["createSequence", "createSequence", "createSequenceCallable"] + }, + "CreateStreamingSequence": { + "methods": ["createStreamingSequence", "createStreamingSequence", "createStreamingSequenceCallable"] + }, + "GetIamPolicy": { + "methods": ["getIamPolicy", "getIamPolicyCallable"] + }, + "GetLocation": { + "methods": ["getLocation", "getLocationCallable"] + }, + "GetSequenceReport": { + "methods": ["getSequenceReport", "getSequenceReport", "getSequenceReport", "getSequenceReportCallable"] + }, + "GetStreamingSequenceReport": { + "methods": ["getStreamingSequenceReport", "getStreamingSequenceReport", "getStreamingSequenceReport", "getStreamingSequenceReportCallable"] + }, + "ListLocations": { + "methods": ["listLocations", "listLocationsPagedCallable", "listLocationsCallable"] + }, + "SetIamPolicy": { + "methods": ["setIamPolicy", "setIamPolicyCallable"] + }, + "TestIamPermissions": { + "methods": ["testIamPermissions", "testIamPermissionsCallable"] + } + } + } + } + }, + "Testing": { + "clients": { + "grpc": { + "libraryClient": "TestingClient", + "rpcs": { + "CreateSession": { + "methods": ["createSession", "createSessionCallable"] + }, + "DeleteSession": { + "methods": ["deleteSession", "deleteSessionCallable"] + }, + "DeleteTest": { + "methods": ["deleteTest", "deleteTestCallable"] + }, + "GetIamPolicy": { + "methods": ["getIamPolicy", "getIamPolicyCallable"] + }, + "GetLocation": { + "methods": ["getLocation", "getLocationCallable"] + }, + "GetSession": { + "methods": ["getSession", "getSessionCallable"] + }, + "ListLocations": { + "methods": ["listLocations", "listLocationsPagedCallable", "listLocationsCallable"] + }, + "ListSessions": { + "methods": ["listSessions", "listSessionsPagedCallable", "listSessionsCallable"] + }, + "ListTests": { + "methods": ["listTests", "listTestsPagedCallable", "listTestsCallable"] + }, + "ReportSession": { + "methods": ["reportSession", "reportSessionCallable"] + }, + "SetIamPolicy": { + "methods": ["setIamPolicy", "setIamPolicyCallable"] + }, + "TestIamPermissions": { + "methods": ["testIamPermissions", "testIamPermissionsCallable"] + }, + "VerifyTest": { + "methods": ["verifyTest", "verifyTestCallable"] + } + } + } + } + } + } +} \ No newline at end of file diff --git a/java-showcase-3.25.8/gapic-showcase/src/main/java/com/google/showcase/v1beta1/package-info.java b/java-showcase-3.25.8/gapic-showcase/src/main/java/com/google/showcase/v1beta1/package-info.java new file mode 100644 index 0000000000..56f2990a66 --- /dev/null +++ b/java-showcase-3.25.8/gapic-showcase/src/main/java/com/google/showcase/v1beta1/package-info.java @@ -0,0 +1,166 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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 Client Libraries Showcase API + * + *

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

        ======================= ComplianceClient ======================= + * + *

        Service Description: This service is used to test that GAPICs implement various REST-related + * features correctly. This mostly means transcoding proto3 requests to REST format correctly for + * various types of HTTP annotations, but it also includes verifying that unknown (numeric) enums + * received by clients can be round-tripped correctly. + * + *

        Sample for ComplianceClient: + * + *

        {@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 (ComplianceClient complianceClient = ComplianceClient.create()) {
        + *   RepeatRequest request =
        + *       RepeatRequest.newBuilder()
        + *           .setName("name3373707")
        + *           .setInfo(ComplianceData.newBuilder().build())
        + *           .setServerVerify(true)
        + *           .setIntendedBindingUri("intendedBindingUri780142386")
        + *           .setFInt32(-1143775883)
        + *           .setFInt64(-1143775788)
        + *           .setFDouble(-1239459382)
        + *           .setPInt32(-858673665)
        + *           .setPInt64(-858673570)
        + *           .setPDouble(-991225216)
        + *           .build();
        + *   RepeatResponse response = complianceClient.repeatDataBody(request);
        + * }
        + * }
        + * + *

        ======================= EchoClient ======================= + * + *

        Service Description: This service is used showcase the four main types of rpcs - unary, server + * side streaming, client side streaming, and bidirectional streaming. This service also exposes + * methods that explicitly implement server delay, and paginated calls. Set the 'showcase-trailer' + * metadata key on any method to have the values echoed in the response trailers. Set the + * 'x-goog-request-params' metadata key on any method to have the values echoed in the response + * headers. + * + *

        Sample for EchoClient: + * + *

        {@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 (EchoClient echoClient = EchoClient.create()) {
        + *   EchoRequest request =
        + *       EchoRequest.newBuilder()
        + *           .setSeverity(Severity.forNumber(0))
        + *           .setHeader("header-1221270899")
        + *           .setOtherHeader("otherHeader-2026585667")
        + *           .setRequestId("requestId693933066")
        + *           .setOtherRequestId("otherRequestId1248995034")
        + *           .build();
        + *   EchoResponse response = echoClient.echo(request);
        + * }
        + * }
        + * + *

        ======================= IdentityClient ======================= + * + *

        Service Description: A simple identity service. + * + *

        Sample for IdentityClient: + * + *

        {@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 (IdentityClient identityClient = IdentityClient.create()) {
        + *   String displayName = "displayName1714148973";
        + *   String email = "email96619420";
        + *   User response = identityClient.createUser(displayName, email);
        + * }
        + * }
        + * + *

        ======================= MessagingClient ======================= + * + *

        Service Description: A simple messaging service that implements chat rooms and profile posts. + * + *

        This messaging service showcases the features that API clients generated by gapic-generators + * implement. + * + *

        Sample for MessagingClient: + * + *

        {@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 (MessagingClient messagingClient = MessagingClient.create()) {
        + *   String displayName = "displayName1714148973";
        + *   String description = "description-1724546052";
        + *   Room response = messagingClient.createRoom(displayName, description);
        + * }
        + * }
        + * + *

        ======================= SequenceServiceClient ======================= + * + *

        Sample for SequenceServiceClient: + * + *

        {@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 (SequenceServiceClient sequenceServiceClient = SequenceServiceClient.create()) {
        + *   Sequence sequence = Sequence.newBuilder().build();
        + *   Sequence response = sequenceServiceClient.createSequence(sequence);
        + * }
        + * }
        + * + *

        ======================= TestingClient ======================= + * + *

        Service Description: A service to facilitate running discrete sets of tests against Showcase. + * Adding this comment with special characters for comment formatting tests: 1. + * (abra->kadabra->alakazam) 2) [Nonsense][]: `pokemon/*/psychic/*` + * + *

        Sample for TestingClient: + * + *

        {@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 (TestingClient testingClient = TestingClient.create()) {
        + *   CreateSessionRequest request =
        + *       CreateSessionRequest.newBuilder().setSession(Session.newBuilder().build()).build();
        + *   Session response = testingClient.createSession(request);
        + * }
        + * }
        + */ +@Generated("by gapic-generator-java") +package com.google.showcase.v1beta1; + +import javax.annotation.Generated; diff --git a/java-showcase-3.25.8/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/ComplianceStub.java b/java-showcase-3.25.8/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/ComplianceStub.java new file mode 100644 index 0000000000..3597a8d360 --- /dev/null +++ b/java-showcase-3.25.8/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/ComplianceStub.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. + */ + +package com.google.showcase.v1beta1.stub; + +import static com.google.showcase.v1beta1.ComplianceClient.ListLocationsPagedResponse; + +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.showcase.v1beta1.EnumRequest; +import com.google.showcase.v1beta1.EnumResponse; +import com.google.showcase.v1beta1.RepeatRequest; +import com.google.showcase.v1beta1.RepeatResponse; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Base stub class for the Compliance service API. + * + *

        This class is for advanced usage and reflects the underlying API directly. + */ +@BetaApi +@Generated("by gapic-generator-java") +public abstract class ComplianceStub implements BackgroundResource { + + public UnaryCallable repeatDataBodyCallable() { + throw new UnsupportedOperationException("Not implemented: repeatDataBodyCallable()"); + } + + public UnaryCallable repeatDataBodyInfoCallable() { + throw new UnsupportedOperationException("Not implemented: repeatDataBodyInfoCallable()"); + } + + public UnaryCallable repeatDataQueryCallable() { + throw new UnsupportedOperationException("Not implemented: repeatDataQueryCallable()"); + } + + public UnaryCallable repeatDataSimplePathCallable() { + throw new UnsupportedOperationException("Not implemented: repeatDataSimplePathCallable()"); + } + + public UnaryCallable repeatDataPathResourceCallable() { + throw new UnsupportedOperationException("Not implemented: repeatDataPathResourceCallable()"); + } + + public UnaryCallable repeatDataPathTrailingResourceCallable() { + throw new UnsupportedOperationException( + "Not implemented: repeatDataPathTrailingResourceCallable()"); + } + + public UnaryCallable repeatDataBodyPutCallable() { + throw new UnsupportedOperationException("Not implemented: repeatDataBodyPutCallable()"); + } + + public UnaryCallable repeatDataBodyPatchCallable() { + throw new UnsupportedOperationException("Not implemented: repeatDataBodyPatchCallable()"); + } + + public UnaryCallable getEnumCallable() { + throw new UnsupportedOperationException("Not implemented: getEnumCallable()"); + } + + public UnaryCallable verifyEnumCallable() { + throw new UnsupportedOperationException("Not implemented: verifyEnumCallable()"); + } + + public UnaryCallable + listLocationsPagedCallable() { + throw new UnsupportedOperationException("Not implemented: listLocationsPagedCallable()"); + } + + public UnaryCallable listLocationsCallable() { + throw new UnsupportedOperationException("Not implemented: listLocationsCallable()"); + } + + public UnaryCallable getLocationCallable() { + throw new UnsupportedOperationException("Not implemented: getLocationCallable()"); + } + + public UnaryCallable setIamPolicyCallable() { + throw new UnsupportedOperationException("Not implemented: setIamPolicyCallable()"); + } + + public UnaryCallable getIamPolicyCallable() { + throw new UnsupportedOperationException("Not implemented: getIamPolicyCallable()"); + } + + public UnaryCallable + testIamPermissionsCallable() { + throw new UnsupportedOperationException("Not implemented: testIamPermissionsCallable()"); + } + + @Override + public abstract void close(); +} diff --git a/java-showcase-3.25.8/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/ComplianceStubSettings.java b/java-showcase-3.25.8/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/ComplianceStubSettings.java new file mode 100644 index 0000000000..ad7ae867bf --- /dev/null +++ b/java-showcase-3.25.8/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/ComplianceStubSettings.java @@ -0,0 +1,727 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.stub; + +import static com.google.showcase.v1beta1.ComplianceClient.ListLocationsPagedResponse; + +import com.google.api.core.ApiFunction; +import com.google.api.core.ApiFuture; +import com.google.api.core.BetaApi; +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.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.HttpJsonTransportChannel; +import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; +import com.google.api.gax.retrying.RetrySettings; +import com.google.api.gax.rpc.ApiCallContext; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.PagedListDescriptor; +import com.google.api.gax.rpc.PagedListResponseFactory; +import com.google.api.gax.rpc.StatusCode; +import com.google.api.gax.rpc.StubSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +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.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.showcase.v1beta1.EnumRequest; +import com.google.showcase.v1beta1.EnumResponse; +import com.google.showcase.v1beta1.RepeatRequest; +import com.google.showcase.v1beta1.RepeatResponse; +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 ComplianceStub}. + * + *

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

          + *
        • The default service address (localhost) and default port (7469) 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 repeatDataBody: + * + *

        {@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
        + * ComplianceStubSettings.Builder complianceSettingsBuilder = ComplianceStubSettings.newBuilder();
        + * complianceSettingsBuilder
        + *     .repeatDataBodySettings()
        + *     .setRetrySettings(
        + *         complianceSettingsBuilder
        + *             .repeatDataBodySettings()
        + *             .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());
        + * ComplianceStubSettings complianceSettings = complianceSettingsBuilder.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. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class ComplianceStubSettings extends StubSettings { + /** The default scopes of the service. */ + private static final ImmutableList DEFAULT_SERVICE_SCOPES = + ImmutableList.builder().build(); + + private final UnaryCallSettings repeatDataBodySettings; + private final UnaryCallSettings repeatDataBodyInfoSettings; + private final UnaryCallSettings repeatDataQuerySettings; + private final UnaryCallSettings repeatDataSimplePathSettings; + private final UnaryCallSettings repeatDataPathResourceSettings; + private final UnaryCallSettings + repeatDataPathTrailingResourceSettings; + private final UnaryCallSettings repeatDataBodyPutSettings; + private final UnaryCallSettings repeatDataBodyPatchSettings; + private final UnaryCallSettings getEnumSettings; + private final UnaryCallSettings verifyEnumSettings; + private final PagedCallSettings< + ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse> + listLocationsSettings; + private final UnaryCallSettings getLocationSettings; + private final UnaryCallSettings setIamPolicySettings; + private final UnaryCallSettings getIamPolicySettings; + private final UnaryCallSettings + testIamPermissionsSettings; + + private static final PagedListDescriptor + LIST_LOCATIONS_PAGE_STR_DESC = + new PagedListDescriptor() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public ListLocationsRequest injectToken(ListLocationsRequest payload, String token) { + return ListLocationsRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public ListLocationsRequest injectPageSize(ListLocationsRequest payload, int pageSize) { + return ListLocationsRequest.newBuilder(payload).setPageSize(pageSize).build(); + } + + @Override + public Integer extractPageSize(ListLocationsRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(ListLocationsResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources(ListLocationsResponse payload) { + return payload.getLocationsList(); + } + }; + + private static final PagedListResponseFactory< + ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse> + LIST_LOCATIONS_PAGE_STR_FACT = + new PagedListResponseFactory< + ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListLocationsRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext pageContext = + PageContext.create(callable, LIST_LOCATIONS_PAGE_STR_DESC, request, context); + return ListLocationsPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + /** Returns the object with the settings used for calls to repeatDataBody. */ + public UnaryCallSettings repeatDataBodySettings() { + return repeatDataBodySettings; + } + + /** Returns the object with the settings used for calls to repeatDataBodyInfo. */ + public UnaryCallSettings repeatDataBodyInfoSettings() { + return repeatDataBodyInfoSettings; + } + + /** Returns the object with the settings used for calls to repeatDataQuery. */ + public UnaryCallSettings repeatDataQuerySettings() { + return repeatDataQuerySettings; + } + + /** Returns the object with the settings used for calls to repeatDataSimplePath. */ + public UnaryCallSettings repeatDataSimplePathSettings() { + return repeatDataSimplePathSettings; + } + + /** Returns the object with the settings used for calls to repeatDataPathResource. */ + public UnaryCallSettings repeatDataPathResourceSettings() { + return repeatDataPathResourceSettings; + } + + /** Returns the object with the settings used for calls to repeatDataPathTrailingResource. */ + public UnaryCallSettings repeatDataPathTrailingResourceSettings() { + return repeatDataPathTrailingResourceSettings; + } + + /** Returns the object with the settings used for calls to repeatDataBodyPut. */ + public UnaryCallSettings repeatDataBodyPutSettings() { + return repeatDataBodyPutSettings; + } + + /** Returns the object with the settings used for calls to repeatDataBodyPatch. */ + public UnaryCallSettings repeatDataBodyPatchSettings() { + return repeatDataBodyPatchSettings; + } + + /** Returns the object with the settings used for calls to getEnum. */ + public UnaryCallSettings getEnumSettings() { + return getEnumSettings; + } + + /** Returns the object with the settings used for calls to verifyEnum. */ + public UnaryCallSettings verifyEnumSettings() { + return verifyEnumSettings; + } + + /** Returns the object with the settings used for calls to listLocations. */ + public PagedCallSettings + listLocationsSettings() { + return listLocationsSettings; + } + + /** Returns the object with the settings used for calls to getLocation. */ + public UnaryCallSettings getLocationSettings() { + return getLocationSettings; + } + + /** Returns the object with the settings used for calls to setIamPolicy. */ + public UnaryCallSettings setIamPolicySettings() { + return setIamPolicySettings; + } + + /** Returns the object with the settings used for calls to getIamPolicy. */ + public UnaryCallSettings getIamPolicySettings() { + return getIamPolicySettings; + } + + /** Returns the object with the settings used for calls to testIamPermissions. */ + public UnaryCallSettings + testIamPermissionsSettings() { + return testIamPermissionsSettings; + } + + public ComplianceStub createStub() throws IOException { + if (getTransportChannelProvider() + .getTransportName() + .equals(GrpcTransportChannel.getGrpcTransportName())) { + return GrpcComplianceStub.create(this); + } + if (getTransportChannelProvider() + .getTransportName() + .equals(HttpJsonTransportChannel.getHttpJsonTransportName())) { + return HttpJsonComplianceStub.create(this); + } + throw new UnsupportedOperationException( + String.format( + "Transport not supported: %s", getTransportChannelProvider().getTransportName())); + } + + /** Returns a builder for the default ExecutorProvider for this service. */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return InstantiatingExecutorProvider.newBuilder(); + } + + /** Returns the default service endpoint. */ + @ObsoleteApi("Use getEndpoint() instead") + public static String getDefaultEndpoint() { + return "localhost:7469"; + } + + /** Returns the default mTLS service endpoint. */ + public static String getDefaultMtlsEndpoint() { + return "localhost:7469"; + } + + /** 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 gRPC ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return InstantiatingGrpcChannelProvider.newBuilder() + .setMaxInboundMessageSize(Integer.MAX_VALUE); + } + + /** Returns a builder for the default REST ChannelProvider for this service. */ + @BetaApi + public static InstantiatingHttpJsonChannelProvider.Builder + defaultHttpJsonTransportProviderBuilder() { + return InstantiatingHttpJsonChannelProvider.newBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return defaultGrpcTransportProviderBuilder().build(); + } + + public static ApiClientHeaderProvider.Builder defaultGrpcApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken( + "gapic", GaxProperties.getLibraryVersion(ComplianceStubSettings.class)) + .setTransportToken( + GaxGrpcProperties.getGrpcTokenName(), GaxGrpcProperties.getGrpcVersion()); + } + + public static ApiClientHeaderProvider.Builder defaultHttpJsonApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken( + "gapic", GaxProperties.getLibraryVersion(ComplianceStubSettings.class)) + .setTransportToken( + GaxHttpJsonProperties.getHttpJsonTokenName(), + GaxHttpJsonProperties.getHttpJsonVersion()); + } + + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return ComplianceStubSettings.defaultGrpcApiClientHeaderProviderBuilder(); + } + + /** Returns a new gRPC builder for this class. */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** Returns a new REST builder for this class. */ + public static Builder newHttpJsonBuilder() { + return Builder.createHttpJsonDefault(); + } + + /** 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 ComplianceStubSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + + repeatDataBodySettings = settingsBuilder.repeatDataBodySettings().build(); + repeatDataBodyInfoSettings = settingsBuilder.repeatDataBodyInfoSettings().build(); + repeatDataQuerySettings = settingsBuilder.repeatDataQuerySettings().build(); + repeatDataSimplePathSettings = settingsBuilder.repeatDataSimplePathSettings().build(); + repeatDataPathResourceSettings = settingsBuilder.repeatDataPathResourceSettings().build(); + repeatDataPathTrailingResourceSettings = + settingsBuilder.repeatDataPathTrailingResourceSettings().build(); + repeatDataBodyPutSettings = settingsBuilder.repeatDataBodyPutSettings().build(); + repeatDataBodyPatchSettings = settingsBuilder.repeatDataBodyPatchSettings().build(); + getEnumSettings = settingsBuilder.getEnumSettings().build(); + verifyEnumSettings = settingsBuilder.verifyEnumSettings().build(); + listLocationsSettings = settingsBuilder.listLocationsSettings().build(); + getLocationSettings = settingsBuilder.getLocationSettings().build(); + setIamPolicySettings = settingsBuilder.setIamPolicySettings().build(); + getIamPolicySettings = settingsBuilder.getIamPolicySettings().build(); + testIamPermissionsSettings = settingsBuilder.testIamPermissionsSettings().build(); + } + + /** Builder for ComplianceStubSettings. */ + public static class Builder extends StubSettings.Builder { + private final ImmutableList> unaryMethodSettingsBuilders; + private final UnaryCallSettings.Builder repeatDataBodySettings; + private final UnaryCallSettings.Builder + repeatDataBodyInfoSettings; + private final UnaryCallSettings.Builder repeatDataQuerySettings; + private final UnaryCallSettings.Builder + repeatDataSimplePathSettings; + private final UnaryCallSettings.Builder + repeatDataPathResourceSettings; + private final UnaryCallSettings.Builder + repeatDataPathTrailingResourceSettings; + private final UnaryCallSettings.Builder + repeatDataBodyPutSettings; + private final UnaryCallSettings.Builder + repeatDataBodyPatchSettings; + private final UnaryCallSettings.Builder getEnumSettings; + private final UnaryCallSettings.Builder verifyEnumSettings; + private final PagedCallSettings.Builder< + ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse> + listLocationsSettings; + private final UnaryCallSettings.Builder getLocationSettings; + private final UnaryCallSettings.Builder setIamPolicySettings; + private final UnaryCallSettings.Builder getIamPolicySettings; + private final UnaryCallSettings.Builder + testIamPermissionsSettings; + private static final ImmutableMap> + RETRYABLE_CODE_DEFINITIONS; + + static { + ImmutableMap.Builder> definitions = + ImmutableMap.builder(); + definitions.put("no_retry_codes", ImmutableSet.copyOf(Lists.newArrayList())); + RETRYABLE_CODE_DEFINITIONS = definitions.build(); + } + + private static final ImmutableMap RETRY_PARAM_DEFINITIONS; + + static { + ImmutableMap.Builder definitions = ImmutableMap.builder(); + RetrySettings settings = null; + settings = RetrySettings.newBuilder().setRpcTimeoutMultiplier(1.0).build(); + definitions.put("no_retry_params", settings); + RETRY_PARAM_DEFINITIONS = definitions.build(); + } + + protected Builder() { + this(((ClientContext) null)); + } + + protected Builder(ClientContext clientContext) { + super(clientContext); + + repeatDataBodySettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + repeatDataBodyInfoSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + repeatDataQuerySettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + repeatDataSimplePathSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + repeatDataPathResourceSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + repeatDataPathTrailingResourceSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + repeatDataBodyPutSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + repeatDataBodyPatchSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + getEnumSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + verifyEnumSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + listLocationsSettings = PagedCallSettings.newBuilder(LIST_LOCATIONS_PAGE_STR_FACT); + getLocationSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + setIamPolicySettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + getIamPolicySettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + testIamPermissionsSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + repeatDataBodySettings, + repeatDataBodyInfoSettings, + repeatDataQuerySettings, + repeatDataSimplePathSettings, + repeatDataPathResourceSettings, + repeatDataPathTrailingResourceSettings, + repeatDataBodyPutSettings, + repeatDataBodyPatchSettings, + getEnumSettings, + verifyEnumSettings, + listLocationsSettings, + getLocationSettings, + setIamPolicySettings, + getIamPolicySettings, + testIamPermissionsSettings); + initDefaults(this); + } + + protected Builder(ComplianceStubSettings settings) { + super(settings); + + repeatDataBodySettings = settings.repeatDataBodySettings.toBuilder(); + repeatDataBodyInfoSettings = settings.repeatDataBodyInfoSettings.toBuilder(); + repeatDataQuerySettings = settings.repeatDataQuerySettings.toBuilder(); + repeatDataSimplePathSettings = settings.repeatDataSimplePathSettings.toBuilder(); + repeatDataPathResourceSettings = settings.repeatDataPathResourceSettings.toBuilder(); + repeatDataPathTrailingResourceSettings = + settings.repeatDataPathTrailingResourceSettings.toBuilder(); + repeatDataBodyPutSettings = settings.repeatDataBodyPutSettings.toBuilder(); + repeatDataBodyPatchSettings = settings.repeatDataBodyPatchSettings.toBuilder(); + getEnumSettings = settings.getEnumSettings.toBuilder(); + verifyEnumSettings = settings.verifyEnumSettings.toBuilder(); + listLocationsSettings = settings.listLocationsSettings.toBuilder(); + getLocationSettings = settings.getLocationSettings.toBuilder(); + setIamPolicySettings = settings.setIamPolicySettings.toBuilder(); + getIamPolicySettings = settings.getIamPolicySettings.toBuilder(); + testIamPermissionsSettings = settings.testIamPermissionsSettings.toBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + repeatDataBodySettings, + repeatDataBodyInfoSettings, + repeatDataQuerySettings, + repeatDataSimplePathSettings, + repeatDataPathResourceSettings, + repeatDataPathTrailingResourceSettings, + repeatDataBodyPutSettings, + repeatDataBodyPatchSettings, + getEnumSettings, + verifyEnumSettings, + listLocationsSettings, + getLocationSettings, + setIamPolicySettings, + getIamPolicySettings, + testIamPermissionsSettings); + } + + 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 createHttpJsonDefault() { + Builder builder = new Builder(((ClientContext) null)); + + builder.setTransportChannelProvider(defaultHttpJsonTransportProviderBuilder().build()); + builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); + builder.setInternalHeaderProvider(defaultHttpJsonApiClientHeaderProviderBuilder().build()); + builder.setMtlsEndpoint(getDefaultMtlsEndpoint()); + builder.setSwitchToMtlsEndpointAllowed(true); + + return initDefaults(builder); + } + + private static Builder initDefaults(Builder builder) { + builder + .repeatDataBodySettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .repeatDataBodyInfoSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .repeatDataQuerySettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .repeatDataSimplePathSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .repeatDataPathResourceSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .repeatDataPathTrailingResourceSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .repeatDataBodyPutSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .repeatDataBodyPatchSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .getEnumSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .verifyEnumSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .listLocationsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .getLocationSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .setIamPolicySettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .getIamPolicySettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .testIamPermissionsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_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 repeatDataBody. */ + public UnaryCallSettings.Builder repeatDataBodySettings() { + return repeatDataBodySettings; + } + + /** Returns the builder for the settings used for calls to repeatDataBodyInfo. */ + public UnaryCallSettings.Builder repeatDataBodyInfoSettings() { + return repeatDataBodyInfoSettings; + } + + /** Returns the builder for the settings used for calls to repeatDataQuery. */ + public UnaryCallSettings.Builder repeatDataQuerySettings() { + return repeatDataQuerySettings; + } + + /** Returns the builder for the settings used for calls to repeatDataSimplePath. */ + public UnaryCallSettings.Builder repeatDataSimplePathSettings() { + return repeatDataSimplePathSettings; + } + + /** Returns the builder for the settings used for calls to repeatDataPathResource. */ + public UnaryCallSettings.Builder + repeatDataPathResourceSettings() { + return repeatDataPathResourceSettings; + } + + /** Returns the builder for the settings used for calls to repeatDataPathTrailingResource. */ + public UnaryCallSettings.Builder + repeatDataPathTrailingResourceSettings() { + return repeatDataPathTrailingResourceSettings; + } + + /** Returns the builder for the settings used for calls to repeatDataBodyPut. */ + public UnaryCallSettings.Builder repeatDataBodyPutSettings() { + return repeatDataBodyPutSettings; + } + + /** Returns the builder for the settings used for calls to repeatDataBodyPatch. */ + public UnaryCallSettings.Builder repeatDataBodyPatchSettings() { + return repeatDataBodyPatchSettings; + } + + /** Returns the builder for the settings used for calls to getEnum. */ + public UnaryCallSettings.Builder getEnumSettings() { + return getEnumSettings; + } + + /** Returns the builder for the settings used for calls to verifyEnum. */ + public UnaryCallSettings.Builder verifyEnumSettings() { + return verifyEnumSettings; + } + + /** Returns the builder for the settings used for calls to listLocations. */ + public PagedCallSettings.Builder< + ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse> + listLocationsSettings() { + return listLocationsSettings; + } + + /** Returns the builder for the settings used for calls to getLocation. */ + public UnaryCallSettings.Builder getLocationSettings() { + return getLocationSettings; + } + + /** Returns the builder for the settings used for calls to setIamPolicy. */ + public UnaryCallSettings.Builder setIamPolicySettings() { + return setIamPolicySettings; + } + + /** Returns the builder for the settings used for calls to getIamPolicy. */ + public UnaryCallSettings.Builder getIamPolicySettings() { + return getIamPolicySettings; + } + + /** Returns the builder for the settings used for calls to testIamPermissions. */ + public UnaryCallSettings.Builder + testIamPermissionsSettings() { + return testIamPermissionsSettings; + } + + @Override + public ComplianceStubSettings build() throws IOException { + return new ComplianceStubSettings(this); + } + } +} diff --git a/java-showcase-3.25.8/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/EchoStub.java b/java-showcase-3.25.8/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/EchoStub.java new file mode 100644 index 0000000000..fd0fe7d6b3 --- /dev/null +++ b/java-showcase-3.25.8/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/EchoStub.java @@ -0,0 +1,166 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.stub; + +import static com.google.showcase.v1beta1.EchoClient.ListLocationsPagedResponse; +import static com.google.showcase.v1beta1.EchoClient.PagedExpandLegacyMappedPagedResponse; +import static com.google.showcase.v1beta1.EchoClient.PagedExpandPagedResponse; + +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.rpc.BidiStreamingCallable; +import com.google.api.gax.rpc.ClientStreamingCallable; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.longrunning.Operation; +import com.google.longrunning.stub.OperationsStub; +import com.google.showcase.v1beta1.BlockRequest; +import com.google.showcase.v1beta1.BlockResponse; +import com.google.showcase.v1beta1.EchoErrorDetailsRequest; +import com.google.showcase.v1beta1.EchoErrorDetailsResponse; +import com.google.showcase.v1beta1.EchoRequest; +import com.google.showcase.v1beta1.EchoResponse; +import com.google.showcase.v1beta1.ExpandRequest; +import com.google.showcase.v1beta1.FailEchoWithDetailsRequest; +import com.google.showcase.v1beta1.FailEchoWithDetailsResponse; +import com.google.showcase.v1beta1.PagedExpandLegacyMappedResponse; +import com.google.showcase.v1beta1.PagedExpandLegacyRequest; +import com.google.showcase.v1beta1.PagedExpandRequest; +import com.google.showcase.v1beta1.PagedExpandResponse; +import com.google.showcase.v1beta1.WaitMetadata; +import com.google.showcase.v1beta1.WaitRequest; +import com.google.showcase.v1beta1.WaitResponse; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Base stub class for the Echo service API. + * + *

        This class is for advanced usage and reflects the underlying API directly. + */ +@BetaApi +@Generated("by gapic-generator-java") +public abstract class EchoStub implements BackgroundResource { + + public OperationsStub getOperationsStub() { + return null; + } + + public com.google.api.gax.httpjson.longrunning.stub.OperationsStub getHttpJsonOperationsStub() { + return null; + } + + public UnaryCallable echoCallable() { + throw new UnsupportedOperationException("Not implemented: echoCallable()"); + } + + public UnaryCallable + echoErrorDetailsCallable() { + throw new UnsupportedOperationException("Not implemented: echoErrorDetailsCallable()"); + } + + public UnaryCallable + failEchoWithDetailsCallable() { + throw new UnsupportedOperationException("Not implemented: failEchoWithDetailsCallable()"); + } + + public ServerStreamingCallable expandCallable() { + throw new UnsupportedOperationException("Not implemented: expandCallable()"); + } + + public ClientStreamingCallable collectCallable() { + throw new UnsupportedOperationException("Not implemented: collectCallable()"); + } + + public BidiStreamingCallable chatCallable() { + throw new UnsupportedOperationException("Not implemented: chatCallable()"); + } + + public UnaryCallable pagedExpandPagedCallable() { + throw new UnsupportedOperationException("Not implemented: pagedExpandPagedCallable()"); + } + + public UnaryCallable pagedExpandCallable() { + throw new UnsupportedOperationException("Not implemented: pagedExpandCallable()"); + } + + public UnaryCallable pagedExpandLegacyCallable() { + throw new UnsupportedOperationException("Not implemented: pagedExpandLegacyCallable()"); + } + + public UnaryCallable + pagedExpandLegacyMappedPagedCallable() { + throw new UnsupportedOperationException( + "Not implemented: pagedExpandLegacyMappedPagedCallable()"); + } + + public UnaryCallable + pagedExpandLegacyMappedCallable() { + throw new UnsupportedOperationException("Not implemented: pagedExpandLegacyMappedCallable()"); + } + + public OperationCallable waitOperationCallable() { + throw new UnsupportedOperationException("Not implemented: waitOperationCallable()"); + } + + public UnaryCallable waitCallable() { + throw new UnsupportedOperationException("Not implemented: waitCallable()"); + } + + public UnaryCallable blockCallable() { + throw new UnsupportedOperationException("Not implemented: blockCallable()"); + } + + public UnaryCallable + listLocationsPagedCallable() { + throw new UnsupportedOperationException("Not implemented: listLocationsPagedCallable()"); + } + + public UnaryCallable listLocationsCallable() { + throw new UnsupportedOperationException("Not implemented: listLocationsCallable()"); + } + + public UnaryCallable getLocationCallable() { + throw new UnsupportedOperationException("Not implemented: getLocationCallable()"); + } + + public UnaryCallable setIamPolicyCallable() { + throw new UnsupportedOperationException("Not implemented: setIamPolicyCallable()"); + } + + public UnaryCallable getIamPolicyCallable() { + throw new UnsupportedOperationException("Not implemented: getIamPolicyCallable()"); + } + + public UnaryCallable + testIamPermissionsCallable() { + throw new UnsupportedOperationException("Not implemented: testIamPermissionsCallable()"); + } + + @Override + public abstract void close(); +} diff --git a/java-showcase-3.25.8/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/EchoStubSettings.java b/java-showcase-3.25.8/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/EchoStubSettings.java new file mode 100644 index 0000000000..4ca4053954 --- /dev/null +++ b/java-showcase-3.25.8/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/EchoStubSettings.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. + */ + +package com.google.showcase.v1beta1.stub; + +import static com.google.showcase.v1beta1.EchoClient.ListLocationsPagedResponse; +import static com.google.showcase.v1beta1.EchoClient.PagedExpandLegacyMappedPagedResponse; +import static com.google.showcase.v1beta1.EchoClient.PagedExpandPagedResponse; + +import com.google.api.core.ApiFunction; +import com.google.api.core.ApiFuture; +import com.google.api.core.BetaApi; +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.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.HttpJsonTransportChannel; +import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; +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.ServerStreamingCallSettings; +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.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +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.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.longrunning.Operation; +import com.google.showcase.v1beta1.BlockRequest; +import com.google.showcase.v1beta1.BlockResponse; +import com.google.showcase.v1beta1.EchoErrorDetailsRequest; +import com.google.showcase.v1beta1.EchoErrorDetailsResponse; +import com.google.showcase.v1beta1.EchoRequest; +import com.google.showcase.v1beta1.EchoResponse; +import com.google.showcase.v1beta1.ExpandRequest; +import com.google.showcase.v1beta1.FailEchoWithDetailsRequest; +import com.google.showcase.v1beta1.FailEchoWithDetailsResponse; +import com.google.showcase.v1beta1.PagedExpandLegacyMappedResponse; +import com.google.showcase.v1beta1.PagedExpandLegacyRequest; +import com.google.showcase.v1beta1.PagedExpandRequest; +import com.google.showcase.v1beta1.PagedExpandResponse; +import com.google.showcase.v1beta1.PagedExpandResponseList; +import com.google.showcase.v1beta1.WaitMetadata; +import com.google.showcase.v1beta1.WaitRequest; +import com.google.showcase.v1beta1.WaitResponse; +import java.io.IOException; +import java.time.Duration; +import java.util.List; +import java.util.Map; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Settings class to configure an instance of {@link EchoStub}. + * + *

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

          + *
        • The default service address (localhost) and default port (7469) 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 echo: + * + *

        {@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
        + * EchoStubSettings.Builder echoSettingsBuilder = EchoStubSettings.newBuilder();
        + * echoSettingsBuilder
        + *     .echoSettings()
        + *     .setRetrySettings(
        + *         echoSettingsBuilder
        + *             .echoSettings()
        + *             .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());
        + * EchoStubSettings echoSettings = echoSettingsBuilder.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 wait: + * + *

        {@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
        + * EchoStubSettings.Builder echoSettingsBuilder = EchoStubSettings.newBuilder();
        + * TimedRetryAlgorithm timedRetryAlgorithm =
        + *     OperationalTimedPollAlgorithm.create(
        + *         RetrySettings.newBuilder()
        + *             .setInitialRetryDelayDuration(Duration.ofMillis(500))
        + *             .setRetryDelayMultiplier(1.5)
        + *             .setMaxRetryDelayDuration(Duration.ofMillis(5000))
        + *             .setTotalTimeoutDuration(Duration.ofHours(24))
        + *             .build());
        + * echoSettingsBuilder
        + *     .createClusterOperationSettings()
        + *     .setPollingAlgorithm(timedRetryAlgorithm)
        + *     .build();
        + * }
        + */ +@BetaApi +@Generated("by gapic-generator-java") +public class EchoStubSettings extends StubSettings { + /** The default scopes of the service. */ + private static final ImmutableList DEFAULT_SERVICE_SCOPES = + ImmutableList.builder().build(); + + private final UnaryCallSettings echoSettings; + private final UnaryCallSettings + echoErrorDetailsSettings; + private final UnaryCallSettings + failEchoWithDetailsSettings; + private final ServerStreamingCallSettings expandSettings; + private final StreamingCallSettings collectSettings; + private final StreamingCallSettings chatSettings; + private final PagedCallSettings + pagedExpandSettings; + private final UnaryCallSettings + pagedExpandLegacySettings; + private final PagedCallSettings< + PagedExpandRequest, PagedExpandLegacyMappedResponse, PagedExpandLegacyMappedPagedResponse> + pagedExpandLegacyMappedSettings; + private final UnaryCallSettings waitSettings; + private final OperationCallSettings + waitOperationSettings; + private final UnaryCallSettings blockSettings; + private final PagedCallSettings< + ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse> + listLocationsSettings; + private final UnaryCallSettings getLocationSettings; + private final UnaryCallSettings setIamPolicySettings; + private final UnaryCallSettings getIamPolicySettings; + private final UnaryCallSettings + testIamPermissionsSettings; + + private static final PagedListDescriptor + PAGED_EXPAND_PAGE_STR_DESC = + new PagedListDescriptor() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public PagedExpandRequest injectToken(PagedExpandRequest payload, String token) { + return PagedExpandRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public PagedExpandRequest injectPageSize(PagedExpandRequest payload, int pageSize) { + return PagedExpandRequest.newBuilder(payload).setPageSize(pageSize).build(); + } + + @Override + public Integer extractPageSize(PagedExpandRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(PagedExpandResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources(PagedExpandResponse payload) { + return payload.getResponsesList(); + } + }; + + private static final PagedListDescriptor< + PagedExpandRequest, + PagedExpandLegacyMappedResponse, + Map.Entry> + PAGED_EXPAND_LEGACY_MAPPED_PAGE_STR_DESC = + new PagedListDescriptor< + PagedExpandRequest, + PagedExpandLegacyMappedResponse, + Map.Entry>() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public PagedExpandRequest injectToken(PagedExpandRequest payload, String token) { + return PagedExpandRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public PagedExpandRequest injectPageSize(PagedExpandRequest payload, int pageSize) { + return PagedExpandRequest.newBuilder(payload).setPageSize(pageSize).build(); + } + + @Override + public Integer extractPageSize(PagedExpandRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(PagedExpandLegacyMappedResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable> extractResources( + PagedExpandLegacyMappedResponse payload) { + return payload.getAlphabetizedMap().entrySet(); + } + }; + + private static final PagedListDescriptor + LIST_LOCATIONS_PAGE_STR_DESC = + new PagedListDescriptor() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public ListLocationsRequest injectToken(ListLocationsRequest payload, String token) { + return ListLocationsRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public ListLocationsRequest injectPageSize(ListLocationsRequest payload, int pageSize) { + return ListLocationsRequest.newBuilder(payload).setPageSize(pageSize).build(); + } + + @Override + public Integer extractPageSize(ListLocationsRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(ListLocationsResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources(ListLocationsResponse payload) { + return payload.getLocationsList(); + } + }; + + private static final PagedListResponseFactory< + PagedExpandRequest, PagedExpandResponse, PagedExpandPagedResponse> + PAGED_EXPAND_PAGE_STR_FACT = + new PagedListResponseFactory< + PagedExpandRequest, PagedExpandResponse, PagedExpandPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + PagedExpandRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext pageContext = + PageContext.create(callable, PAGED_EXPAND_PAGE_STR_DESC, request, context); + return PagedExpandPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + private static final PagedListResponseFactory< + PagedExpandRequest, PagedExpandLegacyMappedResponse, PagedExpandLegacyMappedPagedResponse> + PAGED_EXPAND_LEGACY_MAPPED_PAGE_STR_FACT = + new PagedListResponseFactory< + PagedExpandRequest, + PagedExpandLegacyMappedResponse, + PagedExpandLegacyMappedPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + PagedExpandRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext< + PagedExpandRequest, + PagedExpandLegacyMappedResponse, + Map.Entry> + pageContext = + PageContext.create( + callable, PAGED_EXPAND_LEGACY_MAPPED_PAGE_STR_DESC, request, context); + return PagedExpandLegacyMappedPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + private static final PagedListResponseFactory< + ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse> + LIST_LOCATIONS_PAGE_STR_FACT = + new PagedListResponseFactory< + ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListLocationsRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext pageContext = + PageContext.create(callable, LIST_LOCATIONS_PAGE_STR_DESC, request, context); + return ListLocationsPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + /** Returns the object with the settings used for calls to echo. */ + public UnaryCallSettings echoSettings() { + return echoSettings; + } + + /** Returns the object with the settings used for calls to echoErrorDetails. */ + public UnaryCallSettings + echoErrorDetailsSettings() { + return echoErrorDetailsSettings; + } + + /** Returns the object with the settings used for calls to failEchoWithDetails. */ + public UnaryCallSettings + failEchoWithDetailsSettings() { + return failEchoWithDetailsSettings; + } + + /** Returns the object with the settings used for calls to expand. */ + public ServerStreamingCallSettings expandSettings() { + return expandSettings; + } + + /** Returns the object with the settings used for calls to collect. */ + public StreamingCallSettings collectSettings() { + return collectSettings; + } + + /** Returns the object with the settings used for calls to chat. */ + public StreamingCallSettings chatSettings() { + return chatSettings; + } + + /** Returns the object with the settings used for calls to pagedExpand. */ + public PagedCallSettings + pagedExpandSettings() { + return pagedExpandSettings; + } + + /** Returns the object with the settings used for calls to pagedExpandLegacy. */ + public UnaryCallSettings + pagedExpandLegacySettings() { + return pagedExpandLegacySettings; + } + + /** Returns the object with the settings used for calls to pagedExpandLegacyMapped. */ + public PagedCallSettings< + PagedExpandRequest, PagedExpandLegacyMappedResponse, PagedExpandLegacyMappedPagedResponse> + pagedExpandLegacyMappedSettings() { + return pagedExpandLegacyMappedSettings; + } + + /** Returns the object with the settings used for calls to wait. */ + public UnaryCallSettings waitSettings() { + return waitSettings; + } + + /** Returns the object with the settings used for calls to wait. */ + public OperationCallSettings waitOperationSettings() { + return waitOperationSettings; + } + + /** Returns the object with the settings used for calls to block. */ + public UnaryCallSettings blockSettings() { + return blockSettings; + } + + /** Returns the object with the settings used for calls to listLocations. */ + public PagedCallSettings + listLocationsSettings() { + return listLocationsSettings; + } + + /** Returns the object with the settings used for calls to getLocation. */ + public UnaryCallSettings getLocationSettings() { + return getLocationSettings; + } + + /** Returns the object with the settings used for calls to setIamPolicy. */ + public UnaryCallSettings setIamPolicySettings() { + return setIamPolicySettings; + } + + /** Returns the object with the settings used for calls to getIamPolicy. */ + public UnaryCallSettings getIamPolicySettings() { + return getIamPolicySettings; + } + + /** Returns the object with the settings used for calls to testIamPermissions. */ + public UnaryCallSettings + testIamPermissionsSettings() { + return testIamPermissionsSettings; + } + + public EchoStub createStub() throws IOException { + if (getTransportChannelProvider() + .getTransportName() + .equals(GrpcTransportChannel.getGrpcTransportName())) { + return GrpcEchoStub.create(this); + } + if (getTransportChannelProvider() + .getTransportName() + .equals(HttpJsonTransportChannel.getHttpJsonTransportName())) { + return HttpJsonEchoStub.create(this); + } + throw new UnsupportedOperationException( + String.format( + "Transport not supported: %s", getTransportChannelProvider().getTransportName())); + } + + /** Returns a builder for the default ExecutorProvider for this service. */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return InstantiatingExecutorProvider.newBuilder(); + } + + /** Returns the default service endpoint. */ + @ObsoleteApi("Use getEndpoint() instead") + public static String getDefaultEndpoint() { + return "localhost:7469"; + } + + /** Returns the default mTLS service endpoint. */ + public static String getDefaultMtlsEndpoint() { + return "localhost:7469"; + } + + /** 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 gRPC ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return InstantiatingGrpcChannelProvider.newBuilder() + .setMaxInboundMessageSize(Integer.MAX_VALUE); + } + + /** Returns a builder for the default REST ChannelProvider for this service. */ + @BetaApi + public static InstantiatingHttpJsonChannelProvider.Builder + defaultHttpJsonTransportProviderBuilder() { + return InstantiatingHttpJsonChannelProvider.newBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return defaultGrpcTransportProviderBuilder().build(); + } + + public static ApiClientHeaderProvider.Builder defaultGrpcApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken("gapic", GaxProperties.getLibraryVersion(EchoStubSettings.class)) + .setTransportToken(GaxGrpcProperties.getGrpcTokenName(), GaxGrpcProperties.getGrpcVersion()) + .setApiVersionToken("v1_20240408"); + } + + public static ApiClientHeaderProvider.Builder defaultHttpJsonApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken("gapic", GaxProperties.getLibraryVersion(EchoStubSettings.class)) + .setTransportToken( + GaxHttpJsonProperties.getHttpJsonTokenName(), + GaxHttpJsonProperties.getHttpJsonVersion()) + .setApiVersionToken("v1_20240408"); + } + + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return EchoStubSettings.defaultGrpcApiClientHeaderProviderBuilder(); + } + + /** Returns a new gRPC builder for this class. */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** Returns a new REST builder for this class. */ + public static Builder newHttpJsonBuilder() { + return Builder.createHttpJsonDefault(); + } + + /** 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 EchoStubSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + + echoSettings = settingsBuilder.echoSettings().build(); + echoErrorDetailsSettings = settingsBuilder.echoErrorDetailsSettings().build(); + failEchoWithDetailsSettings = settingsBuilder.failEchoWithDetailsSettings().build(); + expandSettings = settingsBuilder.expandSettings().build(); + collectSettings = settingsBuilder.collectSettings().build(); + chatSettings = settingsBuilder.chatSettings().build(); + pagedExpandSettings = settingsBuilder.pagedExpandSettings().build(); + pagedExpandLegacySettings = settingsBuilder.pagedExpandLegacySettings().build(); + pagedExpandLegacyMappedSettings = settingsBuilder.pagedExpandLegacyMappedSettings().build(); + waitSettings = settingsBuilder.waitSettings().build(); + waitOperationSettings = settingsBuilder.waitOperationSettings().build(); + blockSettings = settingsBuilder.blockSettings().build(); + listLocationsSettings = settingsBuilder.listLocationsSettings().build(); + getLocationSettings = settingsBuilder.getLocationSettings().build(); + setIamPolicySettings = settingsBuilder.setIamPolicySettings().build(); + getIamPolicySettings = settingsBuilder.getIamPolicySettings().build(); + testIamPermissionsSettings = settingsBuilder.testIamPermissionsSettings().build(); + } + + /** Builder for EchoStubSettings. */ + public static class Builder extends StubSettings.Builder { + private final ImmutableList> unaryMethodSettingsBuilders; + private final UnaryCallSettings.Builder echoSettings; + private final UnaryCallSettings.Builder + echoErrorDetailsSettings; + private final UnaryCallSettings.Builder + failEchoWithDetailsSettings; + private final ServerStreamingCallSettings.Builder expandSettings; + private final StreamingCallSettings.Builder collectSettings; + private final StreamingCallSettings.Builder chatSettings; + private final PagedCallSettings.Builder< + PagedExpandRequest, PagedExpandResponse, PagedExpandPagedResponse> + pagedExpandSettings; + private final UnaryCallSettings.Builder + pagedExpandLegacySettings; + private final PagedCallSettings.Builder< + PagedExpandRequest, + PagedExpandLegacyMappedResponse, + PagedExpandLegacyMappedPagedResponse> + pagedExpandLegacyMappedSettings; + private final UnaryCallSettings.Builder waitSettings; + private final OperationCallSettings.Builder + waitOperationSettings; + private final UnaryCallSettings.Builder blockSettings; + private final PagedCallSettings.Builder< + ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse> + listLocationsSettings; + private final UnaryCallSettings.Builder getLocationSettings; + private final UnaryCallSettings.Builder setIamPolicySettings; + private final UnaryCallSettings.Builder getIamPolicySettings; + private final UnaryCallSettings.Builder + testIamPermissionsSettings; + 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.UNAVAILABLE, StatusCode.Code.UNKNOWN))); + 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(2.0) + .setMaxRetryDelayDuration(Duration.ofMillis(3000L)) + .setInitialRpcTimeoutDuration(Duration.ofMillis(10000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeoutDuration(Duration.ofMillis(10000L)) + .setTotalTimeoutDuration(Duration.ofMillis(10000L)) + .build(); + definitions.put("retry_policy_1_params", settings); + settings = + RetrySettings.newBuilder() + .setInitialRpcTimeoutDuration(Duration.ofMillis(5000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeoutDuration(Duration.ofMillis(5000L)) + .setTotalTimeoutDuration(Duration.ofMillis(5000L)) + .build(); + definitions.put("no_retry_0_params", settings); + RETRY_PARAM_DEFINITIONS = definitions.build(); + } + + protected Builder() { + this(((ClientContext) null)); + } + + protected Builder(ClientContext clientContext) { + super(clientContext); + + echoSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + echoErrorDetailsSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + failEchoWithDetailsSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + expandSettings = ServerStreamingCallSettings.newBuilder(); + collectSettings = StreamingCallSettings.newBuilder(); + chatSettings = StreamingCallSettings.newBuilder(); + pagedExpandSettings = PagedCallSettings.newBuilder(PAGED_EXPAND_PAGE_STR_FACT); + pagedExpandLegacySettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + pagedExpandLegacyMappedSettings = + PagedCallSettings.newBuilder(PAGED_EXPAND_LEGACY_MAPPED_PAGE_STR_FACT); + waitSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + waitOperationSettings = OperationCallSettings.newBuilder(); + blockSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + listLocationsSettings = PagedCallSettings.newBuilder(LIST_LOCATIONS_PAGE_STR_FACT); + getLocationSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + setIamPolicySettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + getIamPolicySettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + testIamPermissionsSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + echoSettings, + echoErrorDetailsSettings, + failEchoWithDetailsSettings, + pagedExpandSettings, + pagedExpandLegacySettings, + pagedExpandLegacyMappedSettings, + waitSettings, + blockSettings, + listLocationsSettings, + getLocationSettings, + setIamPolicySettings, + getIamPolicySettings, + testIamPermissionsSettings); + initDefaults(this); + } + + protected Builder(EchoStubSettings settings) { + super(settings); + + echoSettings = settings.echoSettings.toBuilder(); + echoErrorDetailsSettings = settings.echoErrorDetailsSettings.toBuilder(); + failEchoWithDetailsSettings = settings.failEchoWithDetailsSettings.toBuilder(); + expandSettings = settings.expandSettings.toBuilder(); + collectSettings = settings.collectSettings.toBuilder(); + chatSettings = settings.chatSettings.toBuilder(); + pagedExpandSettings = settings.pagedExpandSettings.toBuilder(); + pagedExpandLegacySettings = settings.pagedExpandLegacySettings.toBuilder(); + pagedExpandLegacyMappedSettings = settings.pagedExpandLegacyMappedSettings.toBuilder(); + waitSettings = settings.waitSettings.toBuilder(); + waitOperationSettings = settings.waitOperationSettings.toBuilder(); + blockSettings = settings.blockSettings.toBuilder(); + listLocationsSettings = settings.listLocationsSettings.toBuilder(); + getLocationSettings = settings.getLocationSettings.toBuilder(); + setIamPolicySettings = settings.setIamPolicySettings.toBuilder(); + getIamPolicySettings = settings.getIamPolicySettings.toBuilder(); + testIamPermissionsSettings = settings.testIamPermissionsSettings.toBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + echoSettings, + echoErrorDetailsSettings, + failEchoWithDetailsSettings, + pagedExpandSettings, + pagedExpandLegacySettings, + pagedExpandLegacyMappedSettings, + waitSettings, + blockSettings, + listLocationsSettings, + getLocationSettings, + setIamPolicySettings, + getIamPolicySettings, + testIamPermissionsSettings); + } + + 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 createHttpJsonDefault() { + Builder builder = new Builder(((ClientContext) null)); + + builder.setTransportChannelProvider(defaultHttpJsonTransportProviderBuilder().build()); + builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); + builder.setInternalHeaderProvider(defaultHttpJsonApiClientHeaderProviderBuilder().build()); + builder.setMtlsEndpoint(getDefaultMtlsEndpoint()); + builder.setSwitchToMtlsEndpointAllowed(true); + + return initDefaults(builder); + } + + private static Builder initDefaults(Builder builder) { + builder + .echoSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")); + + builder + .echoErrorDetailsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + + builder + .failEchoWithDetailsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + + builder + .expandSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")); + + builder + .pagedExpandSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")); + + builder + .pagedExpandLegacySettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + + builder + .pagedExpandLegacyMappedSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + + builder + .waitSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + + builder + .blockSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + + builder + .listLocationsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + + builder + .getLocationSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + + builder + .setIamPolicySettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + + builder + .getIamPolicySettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + + builder + .testIamPermissionsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + + builder + .waitOperationSettings() + .setInitialCallSettings( + UnaryCallSettings.newUnaryCallSettingsBuilder() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")) + .build()) + .setResponseTransformer( + ProtoOperationTransformers.ResponseTransformer.create(WaitResponse.class)) + .setMetadataTransformer( + ProtoOperationTransformers.MetadataTransformer.create(WaitMetadata.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 echo. */ + public UnaryCallSettings.Builder echoSettings() { + return echoSettings; + } + + /** Returns the builder for the settings used for calls to echoErrorDetails. */ + public UnaryCallSettings.Builder + echoErrorDetailsSettings() { + return echoErrorDetailsSettings; + } + + /** Returns the builder for the settings used for calls to failEchoWithDetails. */ + public UnaryCallSettings.Builder + failEchoWithDetailsSettings() { + return failEchoWithDetailsSettings; + } + + /** Returns the builder for the settings used for calls to expand. */ + public ServerStreamingCallSettings.Builder expandSettings() { + return expandSettings; + } + + /** Returns the builder for the settings used for calls to collect. */ + public StreamingCallSettings.Builder collectSettings() { + return collectSettings; + } + + /** Returns the builder for the settings used for calls to chat. */ + public StreamingCallSettings.Builder chatSettings() { + return chatSettings; + } + + /** Returns the builder for the settings used for calls to pagedExpand. */ + public PagedCallSettings.Builder< + PagedExpandRequest, PagedExpandResponse, PagedExpandPagedResponse> + pagedExpandSettings() { + return pagedExpandSettings; + } + + /** Returns the builder for the settings used for calls to pagedExpandLegacy. */ + public UnaryCallSettings.Builder + pagedExpandLegacySettings() { + return pagedExpandLegacySettings; + } + + /** Returns the builder for the settings used for calls to pagedExpandLegacyMapped. */ + public PagedCallSettings.Builder< + PagedExpandRequest, + PagedExpandLegacyMappedResponse, + PagedExpandLegacyMappedPagedResponse> + pagedExpandLegacyMappedSettings() { + return pagedExpandLegacyMappedSettings; + } + + /** Returns the builder for the settings used for calls to wait. */ + public UnaryCallSettings.Builder waitSettings() { + return waitSettings; + } + + /** Returns the builder for the settings used for calls to wait. */ + public OperationCallSettings.Builder + waitOperationSettings() { + return waitOperationSettings; + } + + /** Returns the builder for the settings used for calls to block. */ + public UnaryCallSettings.Builder blockSettings() { + return blockSettings; + } + + /** Returns the builder for the settings used for calls to listLocations. */ + public PagedCallSettings.Builder< + ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse> + listLocationsSettings() { + return listLocationsSettings; + } + + /** Returns the builder for the settings used for calls to getLocation. */ + public UnaryCallSettings.Builder getLocationSettings() { + return getLocationSettings; + } + + /** Returns the builder for the settings used for calls to setIamPolicy. */ + public UnaryCallSettings.Builder setIamPolicySettings() { + return setIamPolicySettings; + } + + /** Returns the builder for the settings used for calls to getIamPolicy. */ + public UnaryCallSettings.Builder getIamPolicySettings() { + return getIamPolicySettings; + } + + /** Returns the builder for the settings used for calls to testIamPermissions. */ + public UnaryCallSettings.Builder + testIamPermissionsSettings() { + return testIamPermissionsSettings; + } + + @Override + public EchoStubSettings build() throws IOException { + return new EchoStubSettings(this); + } + } +} diff --git a/java-showcase-3.25.8/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/GrpcComplianceCallableFactory.java b/java-showcase-3.25.8/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/GrpcComplianceCallableFactory.java new file mode 100644 index 0000000000..6d1dad969b --- /dev/null +++ b/java-showcase-3.25.8/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/GrpcComplianceCallableFactory.java @@ -0,0 +1,115 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.stub; + +import com.google.api.core.BetaApi; +import com.google.api.gax.grpc.GrpcCallSettings; +import com.google.api.gax.grpc.GrpcCallableFactory; +import com.google.api.gax.grpc.GrpcStubCallableFactory; +import com.google.api.gax.rpc.BatchingCallSettings; +import com.google.api.gax.rpc.BidiStreamingCallable; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientStreamingCallable; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.api.gax.rpc.StreamingCallSettings; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.longrunning.Operation; +import com.google.longrunning.stub.OperationsStub; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * gRPC callable factory implementation for the Compliance service API. + * + *

        This class is for advanced usage. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class GrpcComplianceCallableFactory 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-showcase-3.25.8/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/GrpcComplianceStub.java b/java-showcase-3.25.8/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/GrpcComplianceStub.java new file mode 100644 index 0000000000..1b4ff86061 --- /dev/null +++ b/java-showcase-3.25.8/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/GrpcComplianceStub.java @@ -0,0 +1,580 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.stub; + +import static com.google.showcase.v1beta1.ComplianceClient.ListLocationsPagedResponse; + +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.grpc.GrpcCallSettings; +import com.google.api.gax.grpc.GrpcStubCallableFactory; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.RequestParamsBuilder; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.longrunning.stub.GrpcOperationsStub; +import com.google.showcase.v1beta1.EnumRequest; +import com.google.showcase.v1beta1.EnumResponse; +import com.google.showcase.v1beta1.RepeatRequest; +import com.google.showcase.v1beta1.RepeatResponse; +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 Compliance service API. + * + *

        This class is for advanced usage and reflects the underlying API directly. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class GrpcComplianceStub extends ComplianceStub { + private static final MethodDescriptor + repeatDataBodyMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.showcase.v1beta1.Compliance/RepeatDataBody") + .setRequestMarshaller(ProtoUtils.marshaller(RepeatRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(RepeatResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor + repeatDataBodyInfoMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.showcase.v1beta1.Compliance/RepeatDataBodyInfo") + .setRequestMarshaller(ProtoUtils.marshaller(RepeatRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(RepeatResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor + repeatDataQueryMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.showcase.v1beta1.Compliance/RepeatDataQuery") + .setRequestMarshaller(ProtoUtils.marshaller(RepeatRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(RepeatResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor + repeatDataSimplePathMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.showcase.v1beta1.Compliance/RepeatDataSimplePath") + .setRequestMarshaller(ProtoUtils.marshaller(RepeatRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(RepeatResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor + repeatDataPathResourceMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.showcase.v1beta1.Compliance/RepeatDataPathResource") + .setRequestMarshaller(ProtoUtils.marshaller(RepeatRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(RepeatResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor + repeatDataPathTrailingResourceMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.showcase.v1beta1.Compliance/RepeatDataPathTrailingResource") + .setRequestMarshaller(ProtoUtils.marshaller(RepeatRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(RepeatResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor + repeatDataBodyPutMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.showcase.v1beta1.Compliance/RepeatDataBodyPut") + .setRequestMarshaller(ProtoUtils.marshaller(RepeatRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(RepeatResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor + repeatDataBodyPatchMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.showcase.v1beta1.Compliance/RepeatDataBodyPatch") + .setRequestMarshaller(ProtoUtils.marshaller(RepeatRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(RepeatResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor getEnumMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.showcase.v1beta1.Compliance/GetEnum") + .setRequestMarshaller(ProtoUtils.marshaller(EnumRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(EnumResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor verifyEnumMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.showcase.v1beta1.Compliance/VerifyEnum") + .setRequestMarshaller(ProtoUtils.marshaller(EnumResponse.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(EnumResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor + listLocationsMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.location.Locations/ListLocations") + .setRequestMarshaller( + ProtoUtils.marshaller(ListLocationsRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(ListLocationsResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor getLocationMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.location.Locations/GetLocation") + .setRequestMarshaller(ProtoUtils.marshaller(GetLocationRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Location.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor setIamPolicyMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.iam.v1.IAMPolicy/SetIamPolicy") + .setRequestMarshaller(ProtoUtils.marshaller(SetIamPolicyRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Policy.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor getIamPolicyMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.iam.v1.IAMPolicy/GetIamPolicy") + .setRequestMarshaller(ProtoUtils.marshaller(GetIamPolicyRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Policy.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor + testIamPermissionsMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.iam.v1.IAMPolicy/TestIamPermissions") + .setRequestMarshaller( + ProtoUtils.marshaller(TestIamPermissionsRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(TestIamPermissionsResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private final UnaryCallable repeatDataBodyCallable; + private final UnaryCallable repeatDataBodyInfoCallable; + private final UnaryCallable repeatDataQueryCallable; + private final UnaryCallable repeatDataSimplePathCallable; + private final UnaryCallable repeatDataPathResourceCallable; + private final UnaryCallable repeatDataPathTrailingResourceCallable; + private final UnaryCallable repeatDataBodyPutCallable; + private final UnaryCallable repeatDataBodyPatchCallable; + private final UnaryCallable getEnumCallable; + private final UnaryCallable verifyEnumCallable; + private final UnaryCallable listLocationsCallable; + private final UnaryCallable + listLocationsPagedCallable; + private final UnaryCallable getLocationCallable; + private final UnaryCallable setIamPolicyCallable; + private final UnaryCallable getIamPolicyCallable; + private final UnaryCallable + testIamPermissionsCallable; + + private final BackgroundResource backgroundResources; + private final GrpcOperationsStub operationsStub; + private final GrpcStubCallableFactory callableFactory; + + public static final GrpcComplianceStub create(ComplianceStubSettings settings) + throws IOException { + return new GrpcComplianceStub(settings, ClientContext.create(settings)); + } + + public static final GrpcComplianceStub create(ClientContext clientContext) throws IOException { + return new GrpcComplianceStub(ComplianceStubSettings.newBuilder().build(), clientContext); + } + + public static final GrpcComplianceStub create( + ClientContext clientContext, GrpcStubCallableFactory callableFactory) throws IOException { + return new GrpcComplianceStub( + ComplianceStubSettings.newBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of GrpcComplianceStub, 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 GrpcComplianceStub(ComplianceStubSettings settings, ClientContext clientContext) + throws IOException { + this(settings, clientContext, new GrpcComplianceCallableFactory()); + } + + /** + * Constructs an instance of GrpcComplianceStub, 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 GrpcComplianceStub( + ComplianceStubSettings settings, + ClientContext clientContext, + GrpcStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + this.operationsStub = GrpcOperationsStub.create(clientContext, callableFactory); + + GrpcCallSettings repeatDataBodyTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(repeatDataBodyMethodDescriptor) + .build(); + GrpcCallSettings repeatDataBodyInfoTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(repeatDataBodyInfoMethodDescriptor) + .build(); + GrpcCallSettings repeatDataQueryTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(repeatDataQueryMethodDescriptor) + .build(); + GrpcCallSettings repeatDataSimplePathTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(repeatDataSimplePathMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("info.f_bool", String.valueOf(request.getInfo().getFBool())); + builder.add("info.f_double", String.valueOf(request.getInfo().getFDouble())); + builder.add("info.f_int32", String.valueOf(request.getInfo().getFInt32())); + builder.add( + "info.f_kingdom", String.valueOf(request.getInfo().getFKingdomValue())); + builder.add("info.f_string", String.valueOf(request.getInfo().getFString())); + return builder.build(); + }) + .build(); + GrpcCallSettings repeatDataPathResourceTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(repeatDataPathResourceMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("info.f_bool", String.valueOf(request.getInfo().getFBool())); + builder.add( + "info.f_child.f_string", + String.valueOf(request.getInfo().getFChild().getFString())); + builder.add("info.f_string", String.valueOf(request.getInfo().getFString())); + return builder.build(); + }) + .build(); + GrpcCallSettings + repeatDataPathTrailingResourceTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(repeatDataPathTrailingResourceMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add( + "info.f_child.f_string", + String.valueOf(request.getInfo().getFChild().getFString())); + builder.add("info.f_string", String.valueOf(request.getInfo().getFString())); + return builder.build(); + }) + .build(); + GrpcCallSettings repeatDataBodyPutTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(repeatDataBodyPutMethodDescriptor) + .build(); + GrpcCallSettings repeatDataBodyPatchTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(repeatDataBodyPatchMethodDescriptor) + .build(); + GrpcCallSettings getEnumTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getEnumMethodDescriptor) + .build(); + GrpcCallSettings verifyEnumTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(verifyEnumMethodDescriptor) + .build(); + GrpcCallSettings listLocationsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(listLocationsMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + GrpcCallSettings getLocationTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getLocationMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + GrpcCallSettings setIamPolicyTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(setIamPolicyMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("resource", String.valueOf(request.getResource())); + return builder.build(); + }) + .build(); + GrpcCallSettings getIamPolicyTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getIamPolicyMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("resource", String.valueOf(request.getResource())); + return builder.build(); + }) + .build(); + GrpcCallSettings + testIamPermissionsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(testIamPermissionsMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("resource", String.valueOf(request.getResource())); + return builder.build(); + }) + .build(); + + this.repeatDataBodyCallable = + callableFactory.createUnaryCallable( + repeatDataBodyTransportSettings, settings.repeatDataBodySettings(), clientContext); + this.repeatDataBodyInfoCallable = + callableFactory.createUnaryCallable( + repeatDataBodyInfoTransportSettings, + settings.repeatDataBodyInfoSettings(), + clientContext); + this.repeatDataQueryCallable = + callableFactory.createUnaryCallable( + repeatDataQueryTransportSettings, settings.repeatDataQuerySettings(), clientContext); + this.repeatDataSimplePathCallable = + callableFactory.createUnaryCallable( + repeatDataSimplePathTransportSettings, + settings.repeatDataSimplePathSettings(), + clientContext); + this.repeatDataPathResourceCallable = + callableFactory.createUnaryCallable( + repeatDataPathResourceTransportSettings, + settings.repeatDataPathResourceSettings(), + clientContext); + this.repeatDataPathTrailingResourceCallable = + callableFactory.createUnaryCallable( + repeatDataPathTrailingResourceTransportSettings, + settings.repeatDataPathTrailingResourceSettings(), + clientContext); + this.repeatDataBodyPutCallable = + callableFactory.createUnaryCallable( + repeatDataBodyPutTransportSettings, + settings.repeatDataBodyPutSettings(), + clientContext); + this.repeatDataBodyPatchCallable = + callableFactory.createUnaryCallable( + repeatDataBodyPatchTransportSettings, + settings.repeatDataBodyPatchSettings(), + clientContext); + this.getEnumCallable = + callableFactory.createUnaryCallable( + getEnumTransportSettings, settings.getEnumSettings(), clientContext); + this.verifyEnumCallable = + callableFactory.createUnaryCallable( + verifyEnumTransportSettings, settings.verifyEnumSettings(), clientContext); + this.listLocationsCallable = + callableFactory.createUnaryCallable( + listLocationsTransportSettings, settings.listLocationsSettings(), clientContext); + this.listLocationsPagedCallable = + callableFactory.createPagedCallable( + listLocationsTransportSettings, settings.listLocationsSettings(), clientContext); + this.getLocationCallable = + callableFactory.createUnaryCallable( + getLocationTransportSettings, settings.getLocationSettings(), clientContext); + this.setIamPolicyCallable = + callableFactory.createUnaryCallable( + setIamPolicyTransportSettings, settings.setIamPolicySettings(), clientContext); + this.getIamPolicyCallable = + callableFactory.createUnaryCallable( + getIamPolicyTransportSettings, settings.getIamPolicySettings(), clientContext); + this.testIamPermissionsCallable = + callableFactory.createUnaryCallable( + testIamPermissionsTransportSettings, + settings.testIamPermissionsSettings(), + clientContext); + + this.backgroundResources = + new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + public GrpcOperationsStub getOperationsStub() { + return operationsStub; + } + + @Override + public UnaryCallable repeatDataBodyCallable() { + return repeatDataBodyCallable; + } + + @Override + public UnaryCallable repeatDataBodyInfoCallable() { + return repeatDataBodyInfoCallable; + } + + @Override + public UnaryCallable repeatDataQueryCallable() { + return repeatDataQueryCallable; + } + + @Override + public UnaryCallable repeatDataSimplePathCallable() { + return repeatDataSimplePathCallable; + } + + @Override + public UnaryCallable repeatDataPathResourceCallable() { + return repeatDataPathResourceCallable; + } + + @Override + public UnaryCallable repeatDataPathTrailingResourceCallable() { + return repeatDataPathTrailingResourceCallable; + } + + @Override + public UnaryCallable repeatDataBodyPutCallable() { + return repeatDataBodyPutCallable; + } + + @Override + public UnaryCallable repeatDataBodyPatchCallable() { + return repeatDataBodyPatchCallable; + } + + @Override + public UnaryCallable getEnumCallable() { + return getEnumCallable; + } + + @Override + public UnaryCallable verifyEnumCallable() { + return verifyEnumCallable; + } + + @Override + public UnaryCallable listLocationsCallable() { + return listLocationsCallable; + } + + @Override + public UnaryCallable + listLocationsPagedCallable() { + return listLocationsPagedCallable; + } + + @Override + public UnaryCallable getLocationCallable() { + return getLocationCallable; + } + + @Override + public UnaryCallable setIamPolicyCallable() { + return setIamPolicyCallable; + } + + @Override + public UnaryCallable getIamPolicyCallable() { + return getIamPolicyCallable; + } + + @Override + public UnaryCallable + testIamPermissionsCallable() { + return testIamPermissionsCallable; + } + + @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-showcase-3.25.8/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/GrpcEchoCallableFactory.java b/java-showcase-3.25.8/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/GrpcEchoCallableFactory.java new file mode 100644 index 0000000000..f22d1faaa4 --- /dev/null +++ b/java-showcase-3.25.8/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/GrpcEchoCallableFactory.java @@ -0,0 +1,115 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.stub; + +import com.google.api.core.BetaApi; +import com.google.api.gax.grpc.GrpcCallSettings; +import com.google.api.gax.grpc.GrpcCallableFactory; +import com.google.api.gax.grpc.GrpcStubCallableFactory; +import com.google.api.gax.rpc.BatchingCallSettings; +import com.google.api.gax.rpc.BidiStreamingCallable; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientStreamingCallable; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.api.gax.rpc.StreamingCallSettings; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.longrunning.Operation; +import com.google.longrunning.stub.OperationsStub; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * gRPC callable factory implementation for the Echo service API. + * + *

        This class is for advanced usage. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class GrpcEchoCallableFactory 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-showcase-3.25.8/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/GrpcEchoStub.java b/java-showcase-3.25.8/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/GrpcEchoStub.java new file mode 100644 index 0000000000..4a2d9820af --- /dev/null +++ b/java-showcase-3.25.8/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/GrpcEchoStub.java @@ -0,0 +1,668 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.stub; + +import static com.google.showcase.v1beta1.EchoClient.ListLocationsPagedResponse; +import static com.google.showcase.v1beta1.EchoClient.PagedExpandLegacyMappedPagedResponse; +import static com.google.showcase.v1beta1.EchoClient.PagedExpandPagedResponse; + +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.grpc.GrpcCallSettings; +import com.google.api.gax.grpc.GrpcStubCallableFactory; +import com.google.api.gax.rpc.BidiStreamingCallable; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientStreamingCallable; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.RequestParamsBuilder; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.api.pathtemplate.PathTemplate; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.common.base.Strings; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.longrunning.Operation; +import com.google.longrunning.stub.GrpcOperationsStub; +import com.google.showcase.v1beta1.BlockRequest; +import com.google.showcase.v1beta1.BlockResponse; +import com.google.showcase.v1beta1.EchoErrorDetailsRequest; +import com.google.showcase.v1beta1.EchoErrorDetailsResponse; +import com.google.showcase.v1beta1.EchoRequest; +import com.google.showcase.v1beta1.EchoResponse; +import com.google.showcase.v1beta1.ExpandRequest; +import com.google.showcase.v1beta1.FailEchoWithDetailsRequest; +import com.google.showcase.v1beta1.FailEchoWithDetailsResponse; +import com.google.showcase.v1beta1.PagedExpandLegacyMappedResponse; +import com.google.showcase.v1beta1.PagedExpandLegacyRequest; +import com.google.showcase.v1beta1.PagedExpandRequest; +import com.google.showcase.v1beta1.PagedExpandResponse; +import com.google.showcase.v1beta1.WaitMetadata; +import com.google.showcase.v1beta1.WaitRequest; +import com.google.showcase.v1beta1.WaitResponse; +import io.grpc.MethodDescriptor; +import io.grpc.protobuf.ProtoUtils; +import java.io.IOException; +import java.util.UUID; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * gRPC stub implementation for the Echo service API. + * + *

        This class is for advanced usage and reflects the underlying API directly. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class GrpcEchoStub extends EchoStub { + private static final MethodDescriptor echoMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.showcase.v1beta1.Echo/Echo") + .setRequestMarshaller(ProtoUtils.marshaller(EchoRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(EchoResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor + echoErrorDetailsMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.showcase.v1beta1.Echo/EchoErrorDetails") + .setRequestMarshaller( + ProtoUtils.marshaller(EchoErrorDetailsRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(EchoErrorDetailsResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor + failEchoWithDetailsMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.showcase.v1beta1.Echo/FailEchoWithDetails") + .setRequestMarshaller( + ProtoUtils.marshaller(FailEchoWithDetailsRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(FailEchoWithDetailsResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor expandMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.SERVER_STREAMING) + .setFullMethodName("google.showcase.v1beta1.Echo/Expand") + .setRequestMarshaller(ProtoUtils.marshaller(ExpandRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(EchoResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor collectMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.CLIENT_STREAMING) + .setFullMethodName("google.showcase.v1beta1.Echo/Collect") + .setRequestMarshaller(ProtoUtils.marshaller(EchoRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(EchoResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor chatMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.BIDI_STREAMING) + .setFullMethodName("google.showcase.v1beta1.Echo/Chat") + .setRequestMarshaller(ProtoUtils.marshaller(EchoRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(EchoResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor + pagedExpandMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.showcase.v1beta1.Echo/PagedExpand") + .setRequestMarshaller(ProtoUtils.marshaller(PagedExpandRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(PagedExpandResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor + pagedExpandLegacyMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.showcase.v1beta1.Echo/PagedExpandLegacy") + .setRequestMarshaller( + ProtoUtils.marshaller(PagedExpandLegacyRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(PagedExpandResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor + pagedExpandLegacyMappedMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.showcase.v1beta1.Echo/PagedExpandLegacyMapped") + .setRequestMarshaller(ProtoUtils.marshaller(PagedExpandRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(PagedExpandLegacyMappedResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor waitMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.showcase.v1beta1.Echo/Wait") + .setRequestMarshaller(ProtoUtils.marshaller(WaitRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor blockMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.showcase.v1beta1.Echo/Block") + .setRequestMarshaller(ProtoUtils.marshaller(BlockRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(BlockResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor + listLocationsMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.location.Locations/ListLocations") + .setRequestMarshaller( + ProtoUtils.marshaller(ListLocationsRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(ListLocationsResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor getLocationMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.location.Locations/GetLocation") + .setRequestMarshaller(ProtoUtils.marshaller(GetLocationRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Location.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor setIamPolicyMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.iam.v1.IAMPolicy/SetIamPolicy") + .setRequestMarshaller(ProtoUtils.marshaller(SetIamPolicyRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Policy.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor getIamPolicyMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.iam.v1.IAMPolicy/GetIamPolicy") + .setRequestMarshaller(ProtoUtils.marshaller(GetIamPolicyRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Policy.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor + testIamPermissionsMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.iam.v1.IAMPolicy/TestIamPermissions") + .setRequestMarshaller( + ProtoUtils.marshaller(TestIamPermissionsRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(TestIamPermissionsResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private final UnaryCallable echoCallable; + private final UnaryCallable + echoErrorDetailsCallable; + private final UnaryCallable + failEchoWithDetailsCallable; + private final ServerStreamingCallable expandCallable; + private final ClientStreamingCallable collectCallable; + private final BidiStreamingCallable chatCallable; + private final UnaryCallable pagedExpandCallable; + private final UnaryCallable + pagedExpandPagedCallable; + private final UnaryCallable + pagedExpandLegacyCallable; + private final UnaryCallable + pagedExpandLegacyMappedCallable; + private final UnaryCallable + pagedExpandLegacyMappedPagedCallable; + private final UnaryCallable waitCallable; + private final OperationCallable waitOperationCallable; + private final UnaryCallable blockCallable; + private final UnaryCallable listLocationsCallable; + private final UnaryCallable + listLocationsPagedCallable; + private final UnaryCallable getLocationCallable; + private final UnaryCallable setIamPolicyCallable; + private final UnaryCallable getIamPolicyCallable; + private final UnaryCallable + testIamPermissionsCallable; + + private final BackgroundResource backgroundResources; + private final GrpcOperationsStub operationsStub; + private final GrpcStubCallableFactory callableFactory; + + private static final PathTemplate ECHO_0_PATH_TEMPLATE = PathTemplate.create("{header=**}"); + private static final PathTemplate ECHO_1_PATH_TEMPLATE = PathTemplate.create("{routing_id=**}"); + private static final PathTemplate ECHO_2_PATH_TEMPLATE = + PathTemplate.create("{table_name=regions/*/zones/*/**}"); + private static final PathTemplate ECHO_3_PATH_TEMPLATE = + PathTemplate.create("{super_id=projects/*}/**"); + private static final PathTemplate ECHO_4_PATH_TEMPLATE = + PathTemplate.create("{table_name=projects/*/instances/*/**}"); + private static final PathTemplate ECHO_5_PATH_TEMPLATE = + PathTemplate.create("projects/*/{instance_id=instances/*}/**"); + private static final PathTemplate ECHO_6_PATH_TEMPLATE = PathTemplate.create("{baz=**}"); + private static final PathTemplate ECHO_7_PATH_TEMPLATE = + PathTemplate.create("{qux=projects/*}/**"); + + public static final GrpcEchoStub create(EchoStubSettings settings) throws IOException { + return new GrpcEchoStub(settings, ClientContext.create(settings)); + } + + public static final GrpcEchoStub create(ClientContext clientContext) throws IOException { + return new GrpcEchoStub(EchoStubSettings.newBuilder().build(), clientContext); + } + + public static final GrpcEchoStub create( + ClientContext clientContext, GrpcStubCallableFactory callableFactory) throws IOException { + return new GrpcEchoStub(EchoStubSettings.newBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of GrpcEchoStub, 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 GrpcEchoStub(EchoStubSettings settings, ClientContext clientContext) + throws IOException { + this(settings, clientContext, new GrpcEchoCallableFactory()); + } + + /** + * Constructs an instance of GrpcEchoStub, 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 GrpcEchoStub( + EchoStubSettings settings, + ClientContext clientContext, + GrpcStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + this.operationsStub = GrpcOperationsStub.create(clientContext, callableFactory); + + GrpcCallSettings echoTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(echoMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add(request.getHeader(), "header", ECHO_0_PATH_TEMPLATE); + builder.add(request.getHeader(), "routing_id", ECHO_1_PATH_TEMPLATE); + builder.add(request.getHeader(), "table_name", ECHO_2_PATH_TEMPLATE); + builder.add(request.getHeader(), "super_id", ECHO_3_PATH_TEMPLATE); + builder.add(request.getHeader(), "table_name", ECHO_4_PATH_TEMPLATE); + builder.add(request.getHeader(), "instance_id", ECHO_5_PATH_TEMPLATE); + builder.add(request.getOtherHeader(), "baz", ECHO_6_PATH_TEMPLATE); + builder.add(request.getOtherHeader(), "qux", ECHO_7_PATH_TEMPLATE); + return builder.build(); + }) + .setRequestMutator( + request -> { + EchoRequest.Builder requestBuilder = request.toBuilder(); + if (Strings.isNullOrEmpty(request.getRequestId())) { + requestBuilder.setRequestId(UUID.randomUUID().toString()); + } + if (Strings.isNullOrEmpty(request.getOtherRequestId())) { + requestBuilder.setOtherRequestId(UUID.randomUUID().toString()); + } + return requestBuilder.build(); + }) + .build(); + GrpcCallSettings + echoErrorDetailsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(echoErrorDetailsMethodDescriptor) + .build(); + GrpcCallSettings + failEchoWithDetailsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(failEchoWithDetailsMethodDescriptor) + .build(); + GrpcCallSettings expandTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(expandMethodDescriptor) + .build(); + GrpcCallSettings collectTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(collectMethodDescriptor) + .build(); + GrpcCallSettings chatTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(chatMethodDescriptor) + .build(); + GrpcCallSettings pagedExpandTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(pagedExpandMethodDescriptor) + .build(); + GrpcCallSettings + pagedExpandLegacyTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(pagedExpandLegacyMethodDescriptor) + .build(); + GrpcCallSettings + pagedExpandLegacyMappedTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(pagedExpandLegacyMappedMethodDescriptor) + .build(); + GrpcCallSettings waitTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(waitMethodDescriptor) + .build(); + GrpcCallSettings blockTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(blockMethodDescriptor) + .build(); + GrpcCallSettings listLocationsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(listLocationsMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + GrpcCallSettings getLocationTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getLocationMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + GrpcCallSettings setIamPolicyTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(setIamPolicyMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("resource", String.valueOf(request.getResource())); + return builder.build(); + }) + .build(); + GrpcCallSettings getIamPolicyTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getIamPolicyMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("resource", String.valueOf(request.getResource())); + return builder.build(); + }) + .build(); + GrpcCallSettings + testIamPermissionsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(testIamPermissionsMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("resource", String.valueOf(request.getResource())); + return builder.build(); + }) + .build(); + + this.echoCallable = + callableFactory.createUnaryCallable( + echoTransportSettings, settings.echoSettings(), clientContext); + this.echoErrorDetailsCallable = + callableFactory.createUnaryCallable( + echoErrorDetailsTransportSettings, settings.echoErrorDetailsSettings(), clientContext); + this.failEchoWithDetailsCallable = + callableFactory.createUnaryCallable( + failEchoWithDetailsTransportSettings, + settings.failEchoWithDetailsSettings(), + clientContext); + this.expandCallable = + callableFactory.createServerStreamingCallable( + expandTransportSettings, settings.expandSettings(), clientContext); + this.collectCallable = + callableFactory.createClientStreamingCallable( + collectTransportSettings, settings.collectSettings(), clientContext); + this.chatCallable = + callableFactory.createBidiStreamingCallable( + chatTransportSettings, settings.chatSettings(), clientContext); + this.pagedExpandCallable = + callableFactory.createUnaryCallable( + pagedExpandTransportSettings, settings.pagedExpandSettings(), clientContext); + this.pagedExpandPagedCallable = + callableFactory.createPagedCallable( + pagedExpandTransportSettings, settings.pagedExpandSettings(), clientContext); + this.pagedExpandLegacyCallable = + callableFactory.createUnaryCallable( + pagedExpandLegacyTransportSettings, + settings.pagedExpandLegacySettings(), + clientContext); + this.pagedExpandLegacyMappedCallable = + callableFactory.createUnaryCallable( + pagedExpandLegacyMappedTransportSettings, + settings.pagedExpandLegacyMappedSettings(), + clientContext); + this.pagedExpandLegacyMappedPagedCallable = + callableFactory.createPagedCallable( + pagedExpandLegacyMappedTransportSettings, + settings.pagedExpandLegacyMappedSettings(), + clientContext); + this.waitCallable = + callableFactory.createUnaryCallable( + waitTransportSettings, settings.waitSettings(), clientContext); + this.waitOperationCallable = + callableFactory.createOperationCallable( + waitTransportSettings, settings.waitOperationSettings(), clientContext, operationsStub); + this.blockCallable = + callableFactory.createUnaryCallable( + blockTransportSettings, settings.blockSettings(), clientContext); + this.listLocationsCallable = + callableFactory.createUnaryCallable( + listLocationsTransportSettings, settings.listLocationsSettings(), clientContext); + this.listLocationsPagedCallable = + callableFactory.createPagedCallable( + listLocationsTransportSettings, settings.listLocationsSettings(), clientContext); + this.getLocationCallable = + callableFactory.createUnaryCallable( + getLocationTransportSettings, settings.getLocationSettings(), clientContext); + this.setIamPolicyCallable = + callableFactory.createUnaryCallable( + setIamPolicyTransportSettings, settings.setIamPolicySettings(), clientContext); + this.getIamPolicyCallable = + callableFactory.createUnaryCallable( + getIamPolicyTransportSettings, settings.getIamPolicySettings(), clientContext); + this.testIamPermissionsCallable = + callableFactory.createUnaryCallable( + testIamPermissionsTransportSettings, + settings.testIamPermissionsSettings(), + clientContext); + + this.backgroundResources = + new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + public GrpcOperationsStub getOperationsStub() { + return operationsStub; + } + + @Override + public UnaryCallable echoCallable() { + return echoCallable; + } + + @Override + public UnaryCallable + echoErrorDetailsCallable() { + return echoErrorDetailsCallable; + } + + @Override + public UnaryCallable + failEchoWithDetailsCallable() { + return failEchoWithDetailsCallable; + } + + @Override + public ServerStreamingCallable expandCallable() { + return expandCallable; + } + + @Override + public ClientStreamingCallable collectCallable() { + return collectCallable; + } + + @Override + public BidiStreamingCallable chatCallable() { + return chatCallable; + } + + @Override + public UnaryCallable pagedExpandCallable() { + return pagedExpandCallable; + } + + @Override + public UnaryCallable pagedExpandPagedCallable() { + return pagedExpandPagedCallable; + } + + @Override + public UnaryCallable pagedExpandLegacyCallable() { + return pagedExpandLegacyCallable; + } + + @Override + public UnaryCallable + pagedExpandLegacyMappedCallable() { + return pagedExpandLegacyMappedCallable; + } + + @Override + public UnaryCallable + pagedExpandLegacyMappedPagedCallable() { + return pagedExpandLegacyMappedPagedCallable; + } + + @Override + public UnaryCallable waitCallable() { + return waitCallable; + } + + @Override + public OperationCallable waitOperationCallable() { + return waitOperationCallable; + } + + @Override + public UnaryCallable blockCallable() { + return blockCallable; + } + + @Override + public UnaryCallable listLocationsCallable() { + return listLocationsCallable; + } + + @Override + public UnaryCallable + listLocationsPagedCallable() { + return listLocationsPagedCallable; + } + + @Override + public UnaryCallable getLocationCallable() { + return getLocationCallable; + } + + @Override + public UnaryCallable setIamPolicyCallable() { + return setIamPolicyCallable; + } + + @Override + public UnaryCallable getIamPolicyCallable() { + return getIamPolicyCallable; + } + + @Override + public UnaryCallable + testIamPermissionsCallable() { + return testIamPermissionsCallable; + } + + @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-showcase-3.25.8/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/GrpcIdentityCallableFactory.java b/java-showcase-3.25.8/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/GrpcIdentityCallableFactory.java new file mode 100644 index 0000000000..0b24326bf3 --- /dev/null +++ b/java-showcase-3.25.8/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/GrpcIdentityCallableFactory.java @@ -0,0 +1,115 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.stub; + +import com.google.api.core.BetaApi; +import com.google.api.gax.grpc.GrpcCallSettings; +import com.google.api.gax.grpc.GrpcCallableFactory; +import com.google.api.gax.grpc.GrpcStubCallableFactory; +import com.google.api.gax.rpc.BatchingCallSettings; +import com.google.api.gax.rpc.BidiStreamingCallable; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientStreamingCallable; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.api.gax.rpc.StreamingCallSettings; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.longrunning.Operation; +import com.google.longrunning.stub.OperationsStub; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * gRPC callable factory implementation for the Identity service API. + * + *

        This class is for advanced usage. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class GrpcIdentityCallableFactory 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-showcase-3.25.8/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/GrpcIdentityStub.java b/java-showcase-3.25.8/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/GrpcIdentityStub.java new file mode 100644 index 0000000000..5260967a52 --- /dev/null +++ b/java-showcase-3.25.8/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/GrpcIdentityStub.java @@ -0,0 +1,448 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.stub; + +import static com.google.showcase.v1beta1.IdentityClient.ListLocationsPagedResponse; +import static com.google.showcase.v1beta1.IdentityClient.ListUsersPagedResponse; + +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.grpc.GrpcCallSettings; +import com.google.api.gax.grpc.GrpcStubCallableFactory; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.RequestParamsBuilder; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.longrunning.stub.GrpcOperationsStub; +import com.google.protobuf.Empty; +import com.google.showcase.v1beta1.CreateUserRequest; +import com.google.showcase.v1beta1.DeleteUserRequest; +import com.google.showcase.v1beta1.GetUserRequest; +import com.google.showcase.v1beta1.ListUsersRequest; +import com.google.showcase.v1beta1.ListUsersResponse; +import com.google.showcase.v1beta1.UpdateUserRequest; +import com.google.showcase.v1beta1.User; +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 Identity service API. + * + *

        This class is for advanced usage and reflects the underlying API directly. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class GrpcIdentityStub extends IdentityStub { + private static final MethodDescriptor createUserMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.showcase.v1beta1.Identity/CreateUser") + .setRequestMarshaller(ProtoUtils.marshaller(CreateUserRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(User.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor getUserMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.showcase.v1beta1.Identity/GetUser") + .setRequestMarshaller(ProtoUtils.marshaller(GetUserRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(User.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor updateUserMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.showcase.v1beta1.Identity/UpdateUser") + .setRequestMarshaller(ProtoUtils.marshaller(UpdateUserRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(User.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor deleteUserMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.showcase.v1beta1.Identity/DeleteUser") + .setRequestMarshaller(ProtoUtils.marshaller(DeleteUserRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Empty.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor + listUsersMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.showcase.v1beta1.Identity/ListUsers") + .setRequestMarshaller(ProtoUtils.marshaller(ListUsersRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(ListUsersResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor + listLocationsMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.location.Locations/ListLocations") + .setRequestMarshaller( + ProtoUtils.marshaller(ListLocationsRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(ListLocationsResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor getLocationMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.location.Locations/GetLocation") + .setRequestMarshaller(ProtoUtils.marshaller(GetLocationRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Location.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor setIamPolicyMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.iam.v1.IAMPolicy/SetIamPolicy") + .setRequestMarshaller(ProtoUtils.marshaller(SetIamPolicyRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Policy.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor getIamPolicyMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.iam.v1.IAMPolicy/GetIamPolicy") + .setRequestMarshaller(ProtoUtils.marshaller(GetIamPolicyRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Policy.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor + testIamPermissionsMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.iam.v1.IAMPolicy/TestIamPermissions") + .setRequestMarshaller( + ProtoUtils.marshaller(TestIamPermissionsRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(TestIamPermissionsResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private final UnaryCallable createUserCallable; + private final UnaryCallable getUserCallable; + private final UnaryCallable updateUserCallable; + private final UnaryCallable deleteUserCallable; + private final UnaryCallable listUsersCallable; + private final UnaryCallable listUsersPagedCallable; + private final UnaryCallable listLocationsCallable; + private final UnaryCallable + listLocationsPagedCallable; + private final UnaryCallable getLocationCallable; + private final UnaryCallable setIamPolicyCallable; + private final UnaryCallable getIamPolicyCallable; + private final UnaryCallable + testIamPermissionsCallable; + + private final BackgroundResource backgroundResources; + private final GrpcOperationsStub operationsStub; + private final GrpcStubCallableFactory callableFactory; + + public static final GrpcIdentityStub create(IdentityStubSettings settings) throws IOException { + return new GrpcIdentityStub(settings, ClientContext.create(settings)); + } + + public static final GrpcIdentityStub create(ClientContext clientContext) throws IOException { + return new GrpcIdentityStub(IdentityStubSettings.newBuilder().build(), clientContext); + } + + public static final GrpcIdentityStub create( + ClientContext clientContext, GrpcStubCallableFactory callableFactory) throws IOException { + return new GrpcIdentityStub( + IdentityStubSettings.newBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of GrpcIdentityStub, 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 GrpcIdentityStub(IdentityStubSettings settings, ClientContext clientContext) + throws IOException { + this(settings, clientContext, new GrpcIdentityCallableFactory()); + } + + /** + * Constructs an instance of GrpcIdentityStub, 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 GrpcIdentityStub( + IdentityStubSettings settings, + ClientContext clientContext, + GrpcStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + this.operationsStub = GrpcOperationsStub.create(clientContext, callableFactory); + + GrpcCallSettings createUserTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(createUserMethodDescriptor) + .build(); + GrpcCallSettings getUserTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getUserMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + GrpcCallSettings updateUserTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(updateUserMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("user.name", String.valueOf(request.getUser().getName())); + return builder.build(); + }) + .build(); + GrpcCallSettings deleteUserTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(deleteUserMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + GrpcCallSettings listUsersTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(listUsersMethodDescriptor) + .build(); + GrpcCallSettings listLocationsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(listLocationsMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + GrpcCallSettings getLocationTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getLocationMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + GrpcCallSettings setIamPolicyTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(setIamPolicyMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("resource", String.valueOf(request.getResource())); + return builder.build(); + }) + .build(); + GrpcCallSettings getIamPolicyTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getIamPolicyMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("resource", String.valueOf(request.getResource())); + return builder.build(); + }) + .build(); + GrpcCallSettings + testIamPermissionsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(testIamPermissionsMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("resource", String.valueOf(request.getResource())); + return builder.build(); + }) + .build(); + + this.createUserCallable = + callableFactory.createUnaryCallable( + createUserTransportSettings, settings.createUserSettings(), clientContext); + this.getUserCallable = + callableFactory.createUnaryCallable( + getUserTransportSettings, settings.getUserSettings(), clientContext); + this.updateUserCallable = + callableFactory.createUnaryCallable( + updateUserTransportSettings, settings.updateUserSettings(), clientContext); + this.deleteUserCallable = + callableFactory.createUnaryCallable( + deleteUserTransportSettings, settings.deleteUserSettings(), clientContext); + this.listUsersCallable = + callableFactory.createUnaryCallable( + listUsersTransportSettings, settings.listUsersSettings(), clientContext); + this.listUsersPagedCallable = + callableFactory.createPagedCallable( + listUsersTransportSettings, settings.listUsersSettings(), clientContext); + this.listLocationsCallable = + callableFactory.createUnaryCallable( + listLocationsTransportSettings, settings.listLocationsSettings(), clientContext); + this.listLocationsPagedCallable = + callableFactory.createPagedCallable( + listLocationsTransportSettings, settings.listLocationsSettings(), clientContext); + this.getLocationCallable = + callableFactory.createUnaryCallable( + getLocationTransportSettings, settings.getLocationSettings(), clientContext); + this.setIamPolicyCallable = + callableFactory.createUnaryCallable( + setIamPolicyTransportSettings, settings.setIamPolicySettings(), clientContext); + this.getIamPolicyCallable = + callableFactory.createUnaryCallable( + getIamPolicyTransportSettings, settings.getIamPolicySettings(), clientContext); + this.testIamPermissionsCallable = + callableFactory.createUnaryCallable( + testIamPermissionsTransportSettings, + settings.testIamPermissionsSettings(), + clientContext); + + this.backgroundResources = + new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + public GrpcOperationsStub getOperationsStub() { + return operationsStub; + } + + @Override + public UnaryCallable createUserCallable() { + return createUserCallable; + } + + @Override + public UnaryCallable getUserCallable() { + return getUserCallable; + } + + @Override + public UnaryCallable updateUserCallable() { + return updateUserCallable; + } + + @Override + public UnaryCallable deleteUserCallable() { + return deleteUserCallable; + } + + @Override + public UnaryCallable listUsersCallable() { + return listUsersCallable; + } + + @Override + public UnaryCallable listUsersPagedCallable() { + return listUsersPagedCallable; + } + + @Override + public UnaryCallable listLocationsCallable() { + return listLocationsCallable; + } + + @Override + public UnaryCallable + listLocationsPagedCallable() { + return listLocationsPagedCallable; + } + + @Override + public UnaryCallable getLocationCallable() { + return getLocationCallable; + } + + @Override + public UnaryCallable setIamPolicyCallable() { + return setIamPolicyCallable; + } + + @Override + public UnaryCallable getIamPolicyCallable() { + return getIamPolicyCallable; + } + + @Override + public UnaryCallable + testIamPermissionsCallable() { + return testIamPermissionsCallable; + } + + @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-showcase-3.25.8/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/GrpcMessagingCallableFactory.java b/java-showcase-3.25.8/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/GrpcMessagingCallableFactory.java new file mode 100644 index 0000000000..b1410c4288 --- /dev/null +++ b/java-showcase-3.25.8/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/GrpcMessagingCallableFactory.java @@ -0,0 +1,115 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.stub; + +import com.google.api.core.BetaApi; +import com.google.api.gax.grpc.GrpcCallSettings; +import com.google.api.gax.grpc.GrpcCallableFactory; +import com.google.api.gax.grpc.GrpcStubCallableFactory; +import com.google.api.gax.rpc.BatchingCallSettings; +import com.google.api.gax.rpc.BidiStreamingCallable; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientStreamingCallable; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.api.gax.rpc.StreamingCallSettings; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.longrunning.Operation; +import com.google.longrunning.stub.OperationsStub; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * gRPC callable factory implementation for the Messaging service API. + * + *

        This class is for advanced usage. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class GrpcMessagingCallableFactory 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-showcase-3.25.8/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/GrpcMessagingStub.java b/java-showcase-3.25.8/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/GrpcMessagingStub.java new file mode 100644 index 0000000000..2eb932b344 --- /dev/null +++ b/java-showcase-3.25.8/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/GrpcMessagingStub.java @@ -0,0 +1,747 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.stub; + +import static com.google.showcase.v1beta1.MessagingClient.ListBlurbsPagedResponse; +import static com.google.showcase.v1beta1.MessagingClient.ListLocationsPagedResponse; +import static com.google.showcase.v1beta1.MessagingClient.ListRoomsPagedResponse; + +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.grpc.GrpcCallSettings; +import com.google.api.gax.grpc.GrpcStubCallableFactory; +import com.google.api.gax.rpc.BidiStreamingCallable; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientStreamingCallable; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.RequestParamsBuilder; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.longrunning.Operation; +import com.google.longrunning.stub.GrpcOperationsStub; +import com.google.protobuf.Empty; +import com.google.showcase.v1beta1.Blurb; +import com.google.showcase.v1beta1.ConnectRequest; +import com.google.showcase.v1beta1.CreateBlurbRequest; +import com.google.showcase.v1beta1.CreateRoomRequest; +import com.google.showcase.v1beta1.DeleteBlurbRequest; +import com.google.showcase.v1beta1.DeleteRoomRequest; +import com.google.showcase.v1beta1.GetBlurbRequest; +import com.google.showcase.v1beta1.GetRoomRequest; +import com.google.showcase.v1beta1.ListBlurbsRequest; +import com.google.showcase.v1beta1.ListBlurbsResponse; +import com.google.showcase.v1beta1.ListRoomsRequest; +import com.google.showcase.v1beta1.ListRoomsResponse; +import com.google.showcase.v1beta1.Room; +import com.google.showcase.v1beta1.SearchBlurbsMetadata; +import com.google.showcase.v1beta1.SearchBlurbsRequest; +import com.google.showcase.v1beta1.SearchBlurbsResponse; +import com.google.showcase.v1beta1.SendBlurbsResponse; +import com.google.showcase.v1beta1.StreamBlurbsRequest; +import com.google.showcase.v1beta1.StreamBlurbsResponse; +import com.google.showcase.v1beta1.UpdateBlurbRequest; +import com.google.showcase.v1beta1.UpdateRoomRequest; +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 Messaging service API. + * + *

        This class is for advanced usage and reflects the underlying API directly. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class GrpcMessagingStub extends MessagingStub { + private static final MethodDescriptor createRoomMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.showcase.v1beta1.Messaging/CreateRoom") + .setRequestMarshaller(ProtoUtils.marshaller(CreateRoomRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Room.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor getRoomMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.showcase.v1beta1.Messaging/GetRoom") + .setRequestMarshaller(ProtoUtils.marshaller(GetRoomRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Room.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor updateRoomMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.showcase.v1beta1.Messaging/UpdateRoom") + .setRequestMarshaller(ProtoUtils.marshaller(UpdateRoomRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Room.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor deleteRoomMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.showcase.v1beta1.Messaging/DeleteRoom") + .setRequestMarshaller(ProtoUtils.marshaller(DeleteRoomRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Empty.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor + listRoomsMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.showcase.v1beta1.Messaging/ListRooms") + .setRequestMarshaller(ProtoUtils.marshaller(ListRoomsRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(ListRoomsResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor createBlurbMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.showcase.v1beta1.Messaging/CreateBlurb") + .setRequestMarshaller(ProtoUtils.marshaller(CreateBlurbRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Blurb.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor getBlurbMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.showcase.v1beta1.Messaging/GetBlurb") + .setRequestMarshaller(ProtoUtils.marshaller(GetBlurbRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Blurb.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor updateBlurbMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.showcase.v1beta1.Messaging/UpdateBlurb") + .setRequestMarshaller(ProtoUtils.marshaller(UpdateBlurbRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Blurb.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor deleteBlurbMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.showcase.v1beta1.Messaging/DeleteBlurb") + .setRequestMarshaller(ProtoUtils.marshaller(DeleteBlurbRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Empty.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor + listBlurbsMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.showcase.v1beta1.Messaging/ListBlurbs") + .setRequestMarshaller(ProtoUtils.marshaller(ListBlurbsRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(ListBlurbsResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor + searchBlurbsMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.showcase.v1beta1.Messaging/SearchBlurbs") + .setRequestMarshaller(ProtoUtils.marshaller(SearchBlurbsRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor + streamBlurbsMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.SERVER_STREAMING) + .setFullMethodName("google.showcase.v1beta1.Messaging/StreamBlurbs") + .setRequestMarshaller(ProtoUtils.marshaller(StreamBlurbsRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(StreamBlurbsResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor + sendBlurbsMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.CLIENT_STREAMING) + .setFullMethodName("google.showcase.v1beta1.Messaging/SendBlurbs") + .setRequestMarshaller(ProtoUtils.marshaller(CreateBlurbRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(SendBlurbsResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor + connectMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.BIDI_STREAMING) + .setFullMethodName("google.showcase.v1beta1.Messaging/Connect") + .setRequestMarshaller(ProtoUtils.marshaller(ConnectRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(StreamBlurbsResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor + listLocationsMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.location.Locations/ListLocations") + .setRequestMarshaller( + ProtoUtils.marshaller(ListLocationsRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(ListLocationsResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor getLocationMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.location.Locations/GetLocation") + .setRequestMarshaller(ProtoUtils.marshaller(GetLocationRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Location.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor setIamPolicyMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.iam.v1.IAMPolicy/SetIamPolicy") + .setRequestMarshaller(ProtoUtils.marshaller(SetIamPolicyRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Policy.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor getIamPolicyMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.iam.v1.IAMPolicy/GetIamPolicy") + .setRequestMarshaller(ProtoUtils.marshaller(GetIamPolicyRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Policy.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor + testIamPermissionsMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.iam.v1.IAMPolicy/TestIamPermissions") + .setRequestMarshaller( + ProtoUtils.marshaller(TestIamPermissionsRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(TestIamPermissionsResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private final UnaryCallable createRoomCallable; + private final UnaryCallable getRoomCallable; + private final UnaryCallable updateRoomCallable; + private final UnaryCallable deleteRoomCallable; + private final UnaryCallable listRoomsCallable; + private final UnaryCallable listRoomsPagedCallable; + private final UnaryCallable createBlurbCallable; + private final UnaryCallable getBlurbCallable; + private final UnaryCallable updateBlurbCallable; + private final UnaryCallable deleteBlurbCallable; + private final UnaryCallable listBlurbsCallable; + private final UnaryCallable listBlurbsPagedCallable; + private final UnaryCallable searchBlurbsCallable; + private final OperationCallable + searchBlurbsOperationCallable; + private final ServerStreamingCallable + streamBlurbsCallable; + private final ClientStreamingCallable sendBlurbsCallable; + private final BidiStreamingCallable connectCallable; + private final UnaryCallable listLocationsCallable; + private final UnaryCallable + listLocationsPagedCallable; + private final UnaryCallable getLocationCallable; + private final UnaryCallable setIamPolicyCallable; + private final UnaryCallable getIamPolicyCallable; + private final UnaryCallable + testIamPermissionsCallable; + + private final BackgroundResource backgroundResources; + private final GrpcOperationsStub operationsStub; + private final GrpcStubCallableFactory callableFactory; + + public static final GrpcMessagingStub create(MessagingStubSettings settings) throws IOException { + return new GrpcMessagingStub(settings, ClientContext.create(settings)); + } + + public static final GrpcMessagingStub create(ClientContext clientContext) throws IOException { + return new GrpcMessagingStub(MessagingStubSettings.newBuilder().build(), clientContext); + } + + public static final GrpcMessagingStub create( + ClientContext clientContext, GrpcStubCallableFactory callableFactory) throws IOException { + return new GrpcMessagingStub( + MessagingStubSettings.newBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of GrpcMessagingStub, 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 GrpcMessagingStub(MessagingStubSettings settings, ClientContext clientContext) + throws IOException { + this(settings, clientContext, new GrpcMessagingCallableFactory()); + } + + /** + * Constructs an instance of GrpcMessagingStub, 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 GrpcMessagingStub( + MessagingStubSettings settings, + ClientContext clientContext, + GrpcStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + this.operationsStub = GrpcOperationsStub.create(clientContext, callableFactory); + + GrpcCallSettings createRoomTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(createRoomMethodDescriptor) + .build(); + GrpcCallSettings getRoomTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getRoomMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + GrpcCallSettings updateRoomTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(updateRoomMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("room.name", String.valueOf(request.getRoom().getName())); + return builder.build(); + }) + .build(); + GrpcCallSettings deleteRoomTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(deleteRoomMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + GrpcCallSettings listRoomsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(listRoomsMethodDescriptor) + .build(); + GrpcCallSettings createBlurbTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(createBlurbMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .build(); + GrpcCallSettings getBlurbTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getBlurbMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + GrpcCallSettings updateBlurbTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(updateBlurbMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("blurb.name", String.valueOf(request.getBlurb().getName())); + return builder.build(); + }) + .build(); + GrpcCallSettings deleteBlurbTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(deleteBlurbMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + GrpcCallSettings listBlurbsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(listBlurbsMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .build(); + GrpcCallSettings searchBlurbsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(searchBlurbsMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .build(); + GrpcCallSettings streamBlurbsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(streamBlurbsMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + GrpcCallSettings sendBlurbsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(sendBlurbsMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .build(); + GrpcCallSettings connectTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(connectMethodDescriptor) + .build(); + GrpcCallSettings listLocationsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(listLocationsMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + GrpcCallSettings getLocationTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getLocationMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + GrpcCallSettings setIamPolicyTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(setIamPolicyMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("resource", String.valueOf(request.getResource())); + return builder.build(); + }) + .build(); + GrpcCallSettings getIamPolicyTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getIamPolicyMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("resource", String.valueOf(request.getResource())); + return builder.build(); + }) + .build(); + GrpcCallSettings + testIamPermissionsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(testIamPermissionsMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("resource", String.valueOf(request.getResource())); + return builder.build(); + }) + .build(); + + this.createRoomCallable = + callableFactory.createUnaryCallable( + createRoomTransportSettings, settings.createRoomSettings(), clientContext); + this.getRoomCallable = + callableFactory.createUnaryCallable( + getRoomTransportSettings, settings.getRoomSettings(), clientContext); + this.updateRoomCallable = + callableFactory.createUnaryCallable( + updateRoomTransportSettings, settings.updateRoomSettings(), clientContext); + this.deleteRoomCallable = + callableFactory.createUnaryCallable( + deleteRoomTransportSettings, settings.deleteRoomSettings(), clientContext); + this.listRoomsCallable = + callableFactory.createUnaryCallable( + listRoomsTransportSettings, settings.listRoomsSettings(), clientContext); + this.listRoomsPagedCallable = + callableFactory.createPagedCallable( + listRoomsTransportSettings, settings.listRoomsSettings(), clientContext); + this.createBlurbCallable = + callableFactory.createUnaryCallable( + createBlurbTransportSettings, settings.createBlurbSettings(), clientContext); + this.getBlurbCallable = + callableFactory.createUnaryCallable( + getBlurbTransportSettings, settings.getBlurbSettings(), clientContext); + this.updateBlurbCallable = + callableFactory.createUnaryCallable( + updateBlurbTransportSettings, settings.updateBlurbSettings(), clientContext); + this.deleteBlurbCallable = + callableFactory.createUnaryCallable( + deleteBlurbTransportSettings, settings.deleteBlurbSettings(), clientContext); + this.listBlurbsCallable = + callableFactory.createUnaryCallable( + listBlurbsTransportSettings, settings.listBlurbsSettings(), clientContext); + this.listBlurbsPagedCallable = + callableFactory.createPagedCallable( + listBlurbsTransportSettings, settings.listBlurbsSettings(), clientContext); + this.searchBlurbsCallable = + callableFactory.createUnaryCallable( + searchBlurbsTransportSettings, settings.searchBlurbsSettings(), clientContext); + this.searchBlurbsOperationCallable = + callableFactory.createOperationCallable( + searchBlurbsTransportSettings, + settings.searchBlurbsOperationSettings(), + clientContext, + operationsStub); + this.streamBlurbsCallable = + callableFactory.createServerStreamingCallable( + streamBlurbsTransportSettings, settings.streamBlurbsSettings(), clientContext); + this.sendBlurbsCallable = + callableFactory.createClientStreamingCallable( + sendBlurbsTransportSettings, settings.sendBlurbsSettings(), clientContext); + this.connectCallable = + callableFactory.createBidiStreamingCallable( + connectTransportSettings, settings.connectSettings(), clientContext); + this.listLocationsCallable = + callableFactory.createUnaryCallable( + listLocationsTransportSettings, settings.listLocationsSettings(), clientContext); + this.listLocationsPagedCallable = + callableFactory.createPagedCallable( + listLocationsTransportSettings, settings.listLocationsSettings(), clientContext); + this.getLocationCallable = + callableFactory.createUnaryCallable( + getLocationTransportSettings, settings.getLocationSettings(), clientContext); + this.setIamPolicyCallable = + callableFactory.createUnaryCallable( + setIamPolicyTransportSettings, settings.setIamPolicySettings(), clientContext); + this.getIamPolicyCallable = + callableFactory.createUnaryCallable( + getIamPolicyTransportSettings, settings.getIamPolicySettings(), clientContext); + this.testIamPermissionsCallable = + callableFactory.createUnaryCallable( + testIamPermissionsTransportSettings, + settings.testIamPermissionsSettings(), + clientContext); + + this.backgroundResources = + new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + public GrpcOperationsStub getOperationsStub() { + return operationsStub; + } + + @Override + public UnaryCallable createRoomCallable() { + return createRoomCallable; + } + + @Override + public UnaryCallable getRoomCallable() { + return getRoomCallable; + } + + @Override + public UnaryCallable updateRoomCallable() { + return updateRoomCallable; + } + + @Override + public UnaryCallable deleteRoomCallable() { + return deleteRoomCallable; + } + + @Override + public UnaryCallable listRoomsCallable() { + return listRoomsCallable; + } + + @Override + public UnaryCallable listRoomsPagedCallable() { + return listRoomsPagedCallable; + } + + @Override + public UnaryCallable createBlurbCallable() { + return createBlurbCallable; + } + + @Override + public UnaryCallable getBlurbCallable() { + return getBlurbCallable; + } + + @Override + public UnaryCallable updateBlurbCallable() { + return updateBlurbCallable; + } + + @Override + public UnaryCallable deleteBlurbCallable() { + return deleteBlurbCallable; + } + + @Override + public UnaryCallable listBlurbsCallable() { + return listBlurbsCallable; + } + + @Override + public UnaryCallable listBlurbsPagedCallable() { + return listBlurbsPagedCallable; + } + + @Override + public UnaryCallable searchBlurbsCallable() { + return searchBlurbsCallable; + } + + @Override + public OperationCallable + searchBlurbsOperationCallable() { + return searchBlurbsOperationCallable; + } + + @Override + public ServerStreamingCallable streamBlurbsCallable() { + return streamBlurbsCallable; + } + + @Override + public ClientStreamingCallable sendBlurbsCallable() { + return sendBlurbsCallable; + } + + @Override + public BidiStreamingCallable connectCallable() { + return connectCallable; + } + + @Override + public UnaryCallable listLocationsCallable() { + return listLocationsCallable; + } + + @Override + public UnaryCallable + listLocationsPagedCallable() { + return listLocationsPagedCallable; + } + + @Override + public UnaryCallable getLocationCallable() { + return getLocationCallable; + } + + @Override + public UnaryCallable setIamPolicyCallable() { + return setIamPolicyCallable; + } + + @Override + public UnaryCallable getIamPolicyCallable() { + return getIamPolicyCallable; + } + + @Override + public UnaryCallable + testIamPermissionsCallable() { + return testIamPermissionsCallable; + } + + @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-showcase-3.25.8/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/GrpcSequenceServiceCallableFactory.java b/java-showcase-3.25.8/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/GrpcSequenceServiceCallableFactory.java new file mode 100644 index 0000000000..a6aaad6597 --- /dev/null +++ b/java-showcase-3.25.8/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/GrpcSequenceServiceCallableFactory.java @@ -0,0 +1,115 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.stub; + +import com.google.api.core.BetaApi; +import com.google.api.gax.grpc.GrpcCallSettings; +import com.google.api.gax.grpc.GrpcCallableFactory; +import com.google.api.gax.grpc.GrpcStubCallableFactory; +import com.google.api.gax.rpc.BatchingCallSettings; +import com.google.api.gax.rpc.BidiStreamingCallable; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientStreamingCallable; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.api.gax.rpc.StreamingCallSettings; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.longrunning.Operation; +import com.google.longrunning.stub.OperationsStub; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * gRPC callable factory implementation for the SequenceService service API. + * + *

        This class is for advanced usage. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class GrpcSequenceServiceCallableFactory 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-showcase-3.25.8/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/GrpcSequenceServiceStub.java b/java-showcase-3.25.8/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/GrpcSequenceServiceStub.java new file mode 100644 index 0000000000..90a06a2ea1 --- /dev/null +++ b/java-showcase-3.25.8/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/GrpcSequenceServiceStub.java @@ -0,0 +1,512 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.stub; + +import static com.google.showcase.v1beta1.SequenceServiceClient.ListLocationsPagedResponse; + +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.grpc.GrpcCallSettings; +import com.google.api.gax.grpc.GrpcStubCallableFactory; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.RequestParamsBuilder; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.longrunning.stub.GrpcOperationsStub; +import com.google.protobuf.Empty; +import com.google.showcase.v1beta1.AttemptSequenceRequest; +import com.google.showcase.v1beta1.AttemptStreamingSequenceRequest; +import com.google.showcase.v1beta1.AttemptStreamingSequenceResponse; +import com.google.showcase.v1beta1.CreateSequenceRequest; +import com.google.showcase.v1beta1.CreateStreamingSequenceRequest; +import com.google.showcase.v1beta1.GetSequenceReportRequest; +import com.google.showcase.v1beta1.GetStreamingSequenceReportRequest; +import com.google.showcase.v1beta1.Sequence; +import com.google.showcase.v1beta1.SequenceReport; +import com.google.showcase.v1beta1.StreamingSequence; +import com.google.showcase.v1beta1.StreamingSequenceReport; +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 SequenceService service API. + * + *

        This class is for advanced usage and reflects the underlying API directly. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class GrpcSequenceServiceStub extends SequenceServiceStub { + private static final MethodDescriptor + createSequenceMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.showcase.v1beta1.SequenceService/CreateSequence") + .setRequestMarshaller( + ProtoUtils.marshaller(CreateSequenceRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Sequence.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor + createStreamingSequenceMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.showcase.v1beta1.SequenceService/CreateStreamingSequence") + .setRequestMarshaller( + ProtoUtils.marshaller(CreateStreamingSequenceRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(StreamingSequence.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor + getSequenceReportMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.showcase.v1beta1.SequenceService/GetSequenceReport") + .setRequestMarshaller( + ProtoUtils.marshaller(GetSequenceReportRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(SequenceReport.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor + getStreamingSequenceReportMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.showcase.v1beta1.SequenceService/GetStreamingSequenceReport") + .setRequestMarshaller( + ProtoUtils.marshaller(GetStreamingSequenceReportRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(StreamingSequenceReport.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor + attemptSequenceMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.showcase.v1beta1.SequenceService/AttemptSequence") + .setRequestMarshaller( + ProtoUtils.marshaller(AttemptSequenceRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Empty.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor< + AttemptStreamingSequenceRequest, AttemptStreamingSequenceResponse> + attemptStreamingSequenceMethodDescriptor = + MethodDescriptor + .newBuilder() + .setType(MethodDescriptor.MethodType.SERVER_STREAMING) + .setFullMethodName("google.showcase.v1beta1.SequenceService/AttemptStreamingSequence") + .setRequestMarshaller( + ProtoUtils.marshaller(AttemptStreamingSequenceRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(AttemptStreamingSequenceResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor + listLocationsMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.location.Locations/ListLocations") + .setRequestMarshaller( + ProtoUtils.marshaller(ListLocationsRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(ListLocationsResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor getLocationMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.location.Locations/GetLocation") + .setRequestMarshaller(ProtoUtils.marshaller(GetLocationRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Location.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor setIamPolicyMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.iam.v1.IAMPolicy/SetIamPolicy") + .setRequestMarshaller(ProtoUtils.marshaller(SetIamPolicyRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Policy.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor getIamPolicyMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.iam.v1.IAMPolicy/GetIamPolicy") + .setRequestMarshaller(ProtoUtils.marshaller(GetIamPolicyRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Policy.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor + testIamPermissionsMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.iam.v1.IAMPolicy/TestIamPermissions") + .setRequestMarshaller( + ProtoUtils.marshaller(TestIamPermissionsRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(TestIamPermissionsResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private final UnaryCallable createSequenceCallable; + private final UnaryCallable + createStreamingSequenceCallable; + private final UnaryCallable getSequenceReportCallable; + private final UnaryCallable + getStreamingSequenceReportCallable; + private final UnaryCallable attemptSequenceCallable; + private final ServerStreamingCallable< + AttemptStreamingSequenceRequest, AttemptStreamingSequenceResponse> + attemptStreamingSequenceCallable; + private final UnaryCallable listLocationsCallable; + private final UnaryCallable + listLocationsPagedCallable; + private final UnaryCallable getLocationCallable; + private final UnaryCallable setIamPolicyCallable; + private final UnaryCallable getIamPolicyCallable; + private final UnaryCallable + testIamPermissionsCallable; + + private final BackgroundResource backgroundResources; + private final GrpcOperationsStub operationsStub; + private final GrpcStubCallableFactory callableFactory; + + public static final GrpcSequenceServiceStub create(SequenceServiceStubSettings settings) + throws IOException { + return new GrpcSequenceServiceStub(settings, ClientContext.create(settings)); + } + + public static final GrpcSequenceServiceStub create(ClientContext clientContext) + throws IOException { + return new GrpcSequenceServiceStub( + SequenceServiceStubSettings.newBuilder().build(), clientContext); + } + + public static final GrpcSequenceServiceStub create( + ClientContext clientContext, GrpcStubCallableFactory callableFactory) throws IOException { + return new GrpcSequenceServiceStub( + SequenceServiceStubSettings.newBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of GrpcSequenceServiceStub, 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 GrpcSequenceServiceStub( + SequenceServiceStubSettings settings, ClientContext clientContext) throws IOException { + this(settings, clientContext, new GrpcSequenceServiceCallableFactory()); + } + + /** + * Constructs an instance of GrpcSequenceServiceStub, 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 GrpcSequenceServiceStub( + SequenceServiceStubSettings settings, + ClientContext clientContext, + GrpcStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + this.operationsStub = GrpcOperationsStub.create(clientContext, callableFactory); + + GrpcCallSettings createSequenceTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(createSequenceMethodDescriptor) + .build(); + GrpcCallSettings + createStreamingSequenceTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(createStreamingSequenceMethodDescriptor) + .build(); + GrpcCallSettings getSequenceReportTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getSequenceReportMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + GrpcCallSettings + getStreamingSequenceReportTransportSettings = + GrpcCallSettings + .newBuilder() + .setMethodDescriptor(getStreamingSequenceReportMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + GrpcCallSettings attemptSequenceTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(attemptSequenceMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + GrpcCallSettings + attemptStreamingSequenceTransportSettings = + GrpcCallSettings + .newBuilder() + .setMethodDescriptor(attemptStreamingSequenceMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + GrpcCallSettings listLocationsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(listLocationsMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + GrpcCallSettings getLocationTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getLocationMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + GrpcCallSettings setIamPolicyTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(setIamPolicyMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("resource", String.valueOf(request.getResource())); + return builder.build(); + }) + .build(); + GrpcCallSettings getIamPolicyTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getIamPolicyMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("resource", String.valueOf(request.getResource())); + return builder.build(); + }) + .build(); + GrpcCallSettings + testIamPermissionsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(testIamPermissionsMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("resource", String.valueOf(request.getResource())); + return builder.build(); + }) + .build(); + + this.createSequenceCallable = + callableFactory.createUnaryCallable( + createSequenceTransportSettings, settings.createSequenceSettings(), clientContext); + this.createStreamingSequenceCallable = + callableFactory.createUnaryCallable( + createStreamingSequenceTransportSettings, + settings.createStreamingSequenceSettings(), + clientContext); + this.getSequenceReportCallable = + callableFactory.createUnaryCallable( + getSequenceReportTransportSettings, + settings.getSequenceReportSettings(), + clientContext); + this.getStreamingSequenceReportCallable = + callableFactory.createUnaryCallable( + getStreamingSequenceReportTransportSettings, + settings.getStreamingSequenceReportSettings(), + clientContext); + this.attemptSequenceCallable = + callableFactory.createUnaryCallable( + attemptSequenceTransportSettings, settings.attemptSequenceSettings(), clientContext); + this.attemptStreamingSequenceCallable = + callableFactory.createServerStreamingCallable( + attemptStreamingSequenceTransportSettings, + settings.attemptStreamingSequenceSettings(), + clientContext); + this.listLocationsCallable = + callableFactory.createUnaryCallable( + listLocationsTransportSettings, settings.listLocationsSettings(), clientContext); + this.listLocationsPagedCallable = + callableFactory.createPagedCallable( + listLocationsTransportSettings, settings.listLocationsSettings(), clientContext); + this.getLocationCallable = + callableFactory.createUnaryCallable( + getLocationTransportSettings, settings.getLocationSettings(), clientContext); + this.setIamPolicyCallable = + callableFactory.createUnaryCallable( + setIamPolicyTransportSettings, settings.setIamPolicySettings(), clientContext); + this.getIamPolicyCallable = + callableFactory.createUnaryCallable( + getIamPolicyTransportSettings, settings.getIamPolicySettings(), clientContext); + this.testIamPermissionsCallable = + callableFactory.createUnaryCallable( + testIamPermissionsTransportSettings, + settings.testIamPermissionsSettings(), + clientContext); + + this.backgroundResources = + new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + public GrpcOperationsStub getOperationsStub() { + return operationsStub; + } + + @Override + public UnaryCallable createSequenceCallable() { + return createSequenceCallable; + } + + @Override + public UnaryCallable + createStreamingSequenceCallable() { + return createStreamingSequenceCallable; + } + + @Override + public UnaryCallable getSequenceReportCallable() { + return getSequenceReportCallable; + } + + @Override + public UnaryCallable + getStreamingSequenceReportCallable() { + return getStreamingSequenceReportCallable; + } + + @Override + public UnaryCallable attemptSequenceCallable() { + return attemptSequenceCallable; + } + + @Override + public ServerStreamingCallable + attemptStreamingSequenceCallable() { + return attemptStreamingSequenceCallable; + } + + @Override + public UnaryCallable listLocationsCallable() { + return listLocationsCallable; + } + + @Override + public UnaryCallable + listLocationsPagedCallable() { + return listLocationsPagedCallable; + } + + @Override + public UnaryCallable getLocationCallable() { + return getLocationCallable; + } + + @Override + public UnaryCallable setIamPolicyCallable() { + return setIamPolicyCallable; + } + + @Override + public UnaryCallable getIamPolicyCallable() { + return getIamPolicyCallable; + } + + @Override + public UnaryCallable + testIamPermissionsCallable() { + return testIamPermissionsCallable; + } + + @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-showcase-3.25.8/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/GrpcTestingCallableFactory.java b/java-showcase-3.25.8/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/GrpcTestingCallableFactory.java new file mode 100644 index 0000000000..adbfa10f91 --- /dev/null +++ b/java-showcase-3.25.8/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/GrpcTestingCallableFactory.java @@ -0,0 +1,115 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.stub; + +import com.google.api.core.BetaApi; +import com.google.api.gax.grpc.GrpcCallSettings; +import com.google.api.gax.grpc.GrpcCallableFactory; +import com.google.api.gax.grpc.GrpcStubCallableFactory; +import com.google.api.gax.rpc.BatchingCallSettings; +import com.google.api.gax.rpc.BidiStreamingCallable; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientStreamingCallable; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.api.gax.rpc.StreamingCallSettings; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.longrunning.Operation; +import com.google.longrunning.stub.OperationsStub; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * gRPC callable factory implementation for the Testing service API. + * + *

        This class is for advanced usage. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class GrpcTestingCallableFactory 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-showcase-3.25.8/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/GrpcTestingStub.java b/java-showcase-3.25.8/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/GrpcTestingStub.java new file mode 100644 index 0000000000..b485b9f36d --- /dev/null +++ b/java-showcase-3.25.8/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/GrpcTestingStub.java @@ -0,0 +1,557 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.stub; + +import static com.google.showcase.v1beta1.TestingClient.ListLocationsPagedResponse; +import static com.google.showcase.v1beta1.TestingClient.ListSessionsPagedResponse; +import static com.google.showcase.v1beta1.TestingClient.ListTestsPagedResponse; + +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.grpc.GrpcCallSettings; +import com.google.api.gax.grpc.GrpcStubCallableFactory; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.RequestParamsBuilder; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.longrunning.stub.GrpcOperationsStub; +import com.google.protobuf.Empty; +import com.google.showcase.v1beta1.CreateSessionRequest; +import com.google.showcase.v1beta1.DeleteSessionRequest; +import com.google.showcase.v1beta1.DeleteTestRequest; +import com.google.showcase.v1beta1.GetSessionRequest; +import com.google.showcase.v1beta1.ListSessionsRequest; +import com.google.showcase.v1beta1.ListSessionsResponse; +import com.google.showcase.v1beta1.ListTestsRequest; +import com.google.showcase.v1beta1.ListTestsResponse; +import com.google.showcase.v1beta1.ReportSessionRequest; +import com.google.showcase.v1beta1.ReportSessionResponse; +import com.google.showcase.v1beta1.Session; +import com.google.showcase.v1beta1.VerifyTestRequest; +import com.google.showcase.v1beta1.VerifyTestResponse; +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 Testing service API. + * + *

        This class is for advanced usage and reflects the underlying API directly. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class GrpcTestingStub extends TestingStub { + private static final MethodDescriptor + createSessionMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.showcase.v1beta1.Testing/CreateSession") + .setRequestMarshaller( + ProtoUtils.marshaller(CreateSessionRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Session.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor getSessionMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.showcase.v1beta1.Testing/GetSession") + .setRequestMarshaller(ProtoUtils.marshaller(GetSessionRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Session.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor + listSessionsMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.showcase.v1beta1.Testing/ListSessions") + .setRequestMarshaller(ProtoUtils.marshaller(ListSessionsRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(ListSessionsResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor deleteSessionMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.showcase.v1beta1.Testing/DeleteSession") + .setRequestMarshaller(ProtoUtils.marshaller(DeleteSessionRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Empty.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor + reportSessionMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.showcase.v1beta1.Testing/ReportSession") + .setRequestMarshaller( + ProtoUtils.marshaller(ReportSessionRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(ReportSessionResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor + listTestsMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.showcase.v1beta1.Testing/ListTests") + .setRequestMarshaller(ProtoUtils.marshaller(ListTestsRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(ListTestsResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor deleteTestMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.showcase.v1beta1.Testing/DeleteTest") + .setRequestMarshaller(ProtoUtils.marshaller(DeleteTestRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Empty.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor + verifyTestMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.showcase.v1beta1.Testing/VerifyTest") + .setRequestMarshaller(ProtoUtils.marshaller(VerifyTestRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(VerifyTestResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor + listLocationsMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.location.Locations/ListLocations") + .setRequestMarshaller( + ProtoUtils.marshaller(ListLocationsRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(ListLocationsResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor getLocationMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.location.Locations/GetLocation") + .setRequestMarshaller(ProtoUtils.marshaller(GetLocationRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Location.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor setIamPolicyMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.iam.v1.IAMPolicy/SetIamPolicy") + .setRequestMarshaller(ProtoUtils.marshaller(SetIamPolicyRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Policy.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor getIamPolicyMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.iam.v1.IAMPolicy/GetIamPolicy") + .setRequestMarshaller(ProtoUtils.marshaller(GetIamPolicyRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Policy.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor + testIamPermissionsMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.iam.v1.IAMPolicy/TestIamPermissions") + .setRequestMarshaller( + ProtoUtils.marshaller(TestIamPermissionsRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(TestIamPermissionsResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private final UnaryCallable createSessionCallable; + private final UnaryCallable getSessionCallable; + private final UnaryCallable listSessionsCallable; + private final UnaryCallable + listSessionsPagedCallable; + private final UnaryCallable deleteSessionCallable; + private final UnaryCallable reportSessionCallable; + private final UnaryCallable listTestsCallable; + private final UnaryCallable listTestsPagedCallable; + private final UnaryCallable deleteTestCallable; + private final UnaryCallable verifyTestCallable; + private final UnaryCallable listLocationsCallable; + private final UnaryCallable + listLocationsPagedCallable; + private final UnaryCallable getLocationCallable; + private final UnaryCallable setIamPolicyCallable; + private final UnaryCallable getIamPolicyCallable; + private final UnaryCallable + testIamPermissionsCallable; + + private final BackgroundResource backgroundResources; + private final GrpcOperationsStub operationsStub; + private final GrpcStubCallableFactory callableFactory; + + public static final GrpcTestingStub create(TestingStubSettings settings) throws IOException { + return new GrpcTestingStub(settings, ClientContext.create(settings)); + } + + public static final GrpcTestingStub create(ClientContext clientContext) throws IOException { + return new GrpcTestingStub(TestingStubSettings.newBuilder().build(), clientContext); + } + + public static final GrpcTestingStub create( + ClientContext clientContext, GrpcStubCallableFactory callableFactory) throws IOException { + return new GrpcTestingStub( + TestingStubSettings.newBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of GrpcTestingStub, 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 GrpcTestingStub(TestingStubSettings settings, ClientContext clientContext) + throws IOException { + this(settings, clientContext, new GrpcTestingCallableFactory()); + } + + /** + * Constructs an instance of GrpcTestingStub, 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 GrpcTestingStub( + TestingStubSettings settings, + ClientContext clientContext, + GrpcStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + this.operationsStub = GrpcOperationsStub.create(clientContext, callableFactory); + + GrpcCallSettings createSessionTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(createSessionMethodDescriptor) + .build(); + GrpcCallSettings getSessionTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getSessionMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + GrpcCallSettings listSessionsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(listSessionsMethodDescriptor) + .build(); + GrpcCallSettings deleteSessionTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(deleteSessionMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + GrpcCallSettings reportSessionTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(reportSessionMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + GrpcCallSettings listTestsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(listTestsMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .build(); + GrpcCallSettings deleteTestTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(deleteTestMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + GrpcCallSettings verifyTestTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(verifyTestMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + GrpcCallSettings listLocationsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(listLocationsMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + GrpcCallSettings getLocationTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getLocationMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + GrpcCallSettings setIamPolicyTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(setIamPolicyMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("resource", String.valueOf(request.getResource())); + return builder.build(); + }) + .build(); + GrpcCallSettings getIamPolicyTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getIamPolicyMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("resource", String.valueOf(request.getResource())); + return builder.build(); + }) + .build(); + GrpcCallSettings + testIamPermissionsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(testIamPermissionsMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("resource", String.valueOf(request.getResource())); + return builder.build(); + }) + .build(); + + this.createSessionCallable = + callableFactory.createUnaryCallable( + createSessionTransportSettings, settings.createSessionSettings(), clientContext); + this.getSessionCallable = + callableFactory.createUnaryCallable( + getSessionTransportSettings, settings.getSessionSettings(), clientContext); + this.listSessionsCallable = + callableFactory.createUnaryCallable( + listSessionsTransportSettings, settings.listSessionsSettings(), clientContext); + this.listSessionsPagedCallable = + callableFactory.createPagedCallable( + listSessionsTransportSettings, settings.listSessionsSettings(), clientContext); + this.deleteSessionCallable = + callableFactory.createUnaryCallable( + deleteSessionTransportSettings, settings.deleteSessionSettings(), clientContext); + this.reportSessionCallable = + callableFactory.createUnaryCallable( + reportSessionTransportSettings, settings.reportSessionSettings(), clientContext); + this.listTestsCallable = + callableFactory.createUnaryCallable( + listTestsTransportSettings, settings.listTestsSettings(), clientContext); + this.listTestsPagedCallable = + callableFactory.createPagedCallable( + listTestsTransportSettings, settings.listTestsSettings(), clientContext); + this.deleteTestCallable = + callableFactory.createUnaryCallable( + deleteTestTransportSettings, settings.deleteTestSettings(), clientContext); + this.verifyTestCallable = + callableFactory.createUnaryCallable( + verifyTestTransportSettings, settings.verifyTestSettings(), clientContext); + this.listLocationsCallable = + callableFactory.createUnaryCallable( + listLocationsTransportSettings, settings.listLocationsSettings(), clientContext); + this.listLocationsPagedCallable = + callableFactory.createPagedCallable( + listLocationsTransportSettings, settings.listLocationsSettings(), clientContext); + this.getLocationCallable = + callableFactory.createUnaryCallable( + getLocationTransportSettings, settings.getLocationSettings(), clientContext); + this.setIamPolicyCallable = + callableFactory.createUnaryCallable( + setIamPolicyTransportSettings, settings.setIamPolicySettings(), clientContext); + this.getIamPolicyCallable = + callableFactory.createUnaryCallable( + getIamPolicyTransportSettings, settings.getIamPolicySettings(), clientContext); + this.testIamPermissionsCallable = + callableFactory.createUnaryCallable( + testIamPermissionsTransportSettings, + settings.testIamPermissionsSettings(), + clientContext); + + this.backgroundResources = + new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + public GrpcOperationsStub getOperationsStub() { + return operationsStub; + } + + @Override + public UnaryCallable createSessionCallable() { + return createSessionCallable; + } + + @Override + public UnaryCallable getSessionCallable() { + return getSessionCallable; + } + + @Override + public UnaryCallable listSessionsCallable() { + return listSessionsCallable; + } + + @Override + public UnaryCallable listSessionsPagedCallable() { + return listSessionsPagedCallable; + } + + @Override + public UnaryCallable deleteSessionCallable() { + return deleteSessionCallable; + } + + @Override + public UnaryCallable reportSessionCallable() { + return reportSessionCallable; + } + + @Override + public UnaryCallable listTestsCallable() { + return listTestsCallable; + } + + @Override + public UnaryCallable listTestsPagedCallable() { + return listTestsPagedCallable; + } + + @Override + public UnaryCallable deleteTestCallable() { + return deleteTestCallable; + } + + @Override + public UnaryCallable verifyTestCallable() { + return verifyTestCallable; + } + + @Override + public UnaryCallable listLocationsCallable() { + return listLocationsCallable; + } + + @Override + public UnaryCallable + listLocationsPagedCallable() { + return listLocationsPagedCallable; + } + + @Override + public UnaryCallable getLocationCallable() { + return getLocationCallable; + } + + @Override + public UnaryCallable setIamPolicyCallable() { + return setIamPolicyCallable; + } + + @Override + public UnaryCallable getIamPolicyCallable() { + return getIamPolicyCallable; + } + + @Override + public UnaryCallable + testIamPermissionsCallable() { + return testIamPermissionsCallable; + } + + @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-showcase-3.25.8/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/HttpJsonComplianceCallableFactory.java b/java-showcase-3.25.8/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/HttpJsonComplianceCallableFactory.java new file mode 100644 index 0000000000..a862d01764 --- /dev/null +++ b/java-showcase-3.25.8/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/HttpJsonComplianceCallableFactory.java @@ -0,0 +1,103 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.stub; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.HttpJsonCallSettings; +import com.google.api.gax.httpjson.HttpJsonCallableFactory; +import com.google.api.gax.httpjson.HttpJsonOperationSnapshotCallable; +import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; +import com.google.api.gax.httpjson.longrunning.stub.OperationsStub; +import com.google.api.gax.rpc.BatchingCallSettings; +import com.google.api.gax.rpc.ClientContext; +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.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.longrunning.Operation; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * REST callable factory implementation for the Compliance service API. + * + *

        This class is for advanced usage. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class HttpJsonComplianceCallableFactory + implements HttpJsonStubCallableFactory { + + @Override + public UnaryCallable createUnaryCallable( + HttpJsonCallSettings httpJsonCallSettings, + UnaryCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createUnaryCallable( + httpJsonCallSettings, callSettings, clientContext); + } + + @Override + public + UnaryCallable createPagedCallable( + HttpJsonCallSettings httpJsonCallSettings, + PagedCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createPagedCallable( + httpJsonCallSettings, callSettings, clientContext); + } + + @Override + public UnaryCallable createBatchingCallable( + HttpJsonCallSettings httpJsonCallSettings, + BatchingCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createBatchingCallable( + httpJsonCallSettings, callSettings, clientContext); + } + + @Override + public + OperationCallable createOperationCallable( + HttpJsonCallSettings httpJsonCallSettings, + OperationCallSettings callSettings, + ClientContext clientContext, + OperationsStub operationsStub) { + UnaryCallable innerCallable = + HttpJsonCallableFactory.createBaseUnaryCallable( + httpJsonCallSettings, callSettings.getInitialCallSettings(), clientContext); + HttpJsonOperationSnapshotCallable initialCallable = + new HttpJsonOperationSnapshotCallable( + innerCallable, + httpJsonCallSettings.getMethodDescriptor().getOperationSnapshotFactory()); + return HttpJsonCallableFactory.createOperationCallable( + callSettings, clientContext, operationsStub.longRunningClient(), initialCallable); + } + + @Override + public + ServerStreamingCallable createServerStreamingCallable( + HttpJsonCallSettings httpJsonCallSettings, + ServerStreamingCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createServerStreamingCallable( + httpJsonCallSettings, callSettings, clientContext); + } +} diff --git a/java-showcase-3.25.8/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/HttpJsonComplianceStub.java b/java-showcase-3.25.8/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/HttpJsonComplianceStub.java new file mode 100644 index 0000000000..5bcc7c6fe1 --- /dev/null +++ b/java-showcase-3.25.8/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/HttpJsonComplianceStub.java @@ -0,0 +1,1109 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.stub; + +import static com.google.showcase.v1beta1.ComplianceClient.ListLocationsPagedResponse; + +import com.google.api.core.BetaApi; +import com.google.api.core.InternalApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.httpjson.ApiMethodDescriptor; +import com.google.api.gax.httpjson.HttpJsonCallSettings; +import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; +import com.google.api.gax.httpjson.ProtoMessageRequestFormatter; +import com.google.api.gax.httpjson.ProtoMessageResponseParser; +import com.google.api.gax.httpjson.ProtoRestSerializer; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.RequestParamsBuilder; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.protobuf.TypeRegistry; +import com.google.showcase.v1beta1.EnumRequest; +import com.google.showcase.v1beta1.EnumResponse; +import com.google.showcase.v1beta1.RepeatRequest; +import com.google.showcase.v1beta1.RepeatResponse; +import java.io.IOException; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * REST stub implementation for the Compliance service API. + * + *

        This class is for advanced usage and reflects the underlying API directly. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class HttpJsonComplianceStub extends ComplianceStub { + private static final TypeRegistry typeRegistry = TypeRegistry.newBuilder().build(); + + private static final ApiMethodDescriptor + repeatDataBodyMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.showcase.v1beta1.Compliance/RepeatDataBody") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/repeat:body", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("*", request.toBuilder().build(), false)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(RepeatResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + repeatDataBodyInfoMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.showcase.v1beta1.Compliance/RepeatDataBodyInfo") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/repeat:bodyinfo", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "fDouble", request.getFDouble()); + serializer.putQueryParam(fields, "fInt32", request.getFInt32()); + serializer.putQueryParam(fields, "fInt64", request.getFInt64()); + if (request.hasIntendedBindingUri()) { + serializer.putQueryParam( + fields, "intendedBindingUri", request.getIntendedBindingUri()); + } + serializer.putQueryParam(fields, "name", request.getName()); + if (request.hasPDouble()) { + serializer.putQueryParam(fields, "pDouble", request.getPDouble()); + } + if (request.hasPInt32()) { + serializer.putQueryParam(fields, "pInt32", request.getPInt32()); + } + if (request.hasPInt64()) { + serializer.putQueryParam(fields, "pInt64", request.getPInt64()); + } + serializer.putQueryParam( + fields, "serverVerify", request.getServerVerify()); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create().toBody("info", request.getInfo(), false)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(RepeatResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + repeatDataQueryMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.showcase.v1beta1.Compliance/RepeatDataQuery") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/repeat:query", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "fDouble", request.getFDouble()); + serializer.putQueryParam(fields, "fInt32", request.getFInt32()); + serializer.putQueryParam(fields, "fInt64", request.getFInt64()); + serializer.putQueryParam(fields, "info", request.getInfo()); + if (request.hasIntendedBindingUri()) { + serializer.putQueryParam( + fields, "intendedBindingUri", request.getIntendedBindingUri()); + } + serializer.putQueryParam(fields, "name", request.getName()); + if (request.hasPDouble()) { + serializer.putQueryParam(fields, "pDouble", request.getPDouble()); + } + if (request.hasPInt32()) { + serializer.putQueryParam(fields, "pInt32", request.getPInt32()); + } + if (request.hasPInt64()) { + serializer.putQueryParam(fields, "pInt64", request.getPInt64()); + } + serializer.putQueryParam( + fields, "serverVerify", request.getServerVerify()); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(RepeatResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + repeatDataSimplePathMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.showcase.v1beta1.Compliance/RepeatDataSimplePath") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/repeat/{info.fString}/{info.fInt32}/{info.fDouble}/{info.fBool}/{info.fKingdom}:simplepath", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam( + fields, "info.fBool", request.getInfo().getFBool()); + serializer.putPathParam( + fields, "info.fDouble", request.getInfo().getFDouble()); + serializer.putPathParam( + fields, "info.fInt32", request.getInfo().getFInt32()); + serializer.putPathParam( + fields, "info.fKingdom", request.getInfo().getFKingdomValue()); + serializer.putPathParam( + fields, "info.fString", request.getInfo().getFString()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "fDouble", request.getFDouble()); + serializer.putQueryParam(fields, "fInt32", request.getFInt32()); + serializer.putQueryParam(fields, "fInt64", request.getFInt64()); + serializer.putQueryParam(fields, "info", request.getInfo()); + if (request.hasIntendedBindingUri()) { + serializer.putQueryParam( + fields, "intendedBindingUri", request.getIntendedBindingUri()); + } + serializer.putQueryParam(fields, "name", request.getName()); + if (request.hasPDouble()) { + serializer.putQueryParam(fields, "pDouble", request.getPDouble()); + } + if (request.hasPInt32()) { + serializer.putQueryParam(fields, "pInt32", request.getPInt32()); + } + if (request.hasPInt64()) { + serializer.putQueryParam(fields, "pInt64", request.getPInt64()); + } + serializer.putQueryParam( + fields, "serverVerify", request.getServerVerify()); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(RepeatResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + repeatDataPathResourceMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.showcase.v1beta1.Compliance/RepeatDataPathResource") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/repeat/{info.fString=first/*}/{info.fChild.fString=second/*}/bool/{info.fBool}:pathresource", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam( + fields, "info.fBool", request.getInfo().getFBool()); + serializer.putPathParam( + fields, + "info.fChild.fString", + request.getInfo().getFChild().getFString()); + serializer.putPathParam( + fields, "info.fString", request.getInfo().getFString()); + return fields; + }) + .setAdditionalPaths( + "/v1beta1/repeat/{info.fChild.fString=first/*}/{info.fString=second/*}/bool/{info.fBool}:childfirstpathresource") + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "fDouble", request.getFDouble()); + serializer.putQueryParam(fields, "fInt32", request.getFInt32()); + serializer.putQueryParam(fields, "fInt64", request.getFInt64()); + serializer.putQueryParam(fields, "info", request.getInfo()); + if (request.hasIntendedBindingUri()) { + serializer.putQueryParam( + fields, "intendedBindingUri", request.getIntendedBindingUri()); + } + serializer.putQueryParam(fields, "name", request.getName()); + if (request.hasPDouble()) { + serializer.putQueryParam(fields, "pDouble", request.getPDouble()); + } + if (request.hasPInt32()) { + serializer.putQueryParam(fields, "pInt32", request.getPInt32()); + } + if (request.hasPInt64()) { + serializer.putQueryParam(fields, "pInt64", request.getPInt64()); + } + serializer.putQueryParam( + fields, "serverVerify", request.getServerVerify()); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(RepeatResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + repeatDataPathTrailingResourceMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName( + "google.showcase.v1beta1.Compliance/RepeatDataPathTrailingResource") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/repeat/{info.fString=first/*}/{info.fChild.fString=second/**}:pathtrailingresource", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam( + fields, + "info.fChild.fString", + request.getInfo().getFChild().getFString()); + serializer.putPathParam( + fields, "info.fString", request.getInfo().getFString()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "fDouble", request.getFDouble()); + serializer.putQueryParam(fields, "fInt32", request.getFInt32()); + serializer.putQueryParam(fields, "fInt64", request.getFInt64()); + serializer.putQueryParam(fields, "info", request.getInfo()); + if (request.hasIntendedBindingUri()) { + serializer.putQueryParam( + fields, "intendedBindingUri", request.getIntendedBindingUri()); + } + serializer.putQueryParam(fields, "name", request.getName()); + if (request.hasPDouble()) { + serializer.putQueryParam(fields, "pDouble", request.getPDouble()); + } + if (request.hasPInt32()) { + serializer.putQueryParam(fields, "pInt32", request.getPInt32()); + } + if (request.hasPInt64()) { + serializer.putQueryParam(fields, "pInt64", request.getPInt64()); + } + serializer.putQueryParam( + fields, "serverVerify", request.getServerVerify()); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(RepeatResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + repeatDataBodyPutMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.showcase.v1beta1.Compliance/RepeatDataBodyPut") + .setHttpMethod("PUT") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/repeat:bodyput", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("*", request.toBuilder().build(), false)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(RepeatResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + repeatDataBodyPatchMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.showcase.v1beta1.Compliance/RepeatDataBodyPatch") + .setHttpMethod("PATCH") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/repeat:bodypatch", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("*", request.toBuilder().build(), false)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(RepeatResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor getEnumMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.showcase.v1beta1.Compliance/GetEnum") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/compliance/enum", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = ProtoRestSerializer.create(); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "unknownEnum", request.getUnknownEnum()); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(EnumResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor verifyEnumMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.showcase.v1beta1.Compliance/VerifyEnum") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/compliance/enum", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = ProtoRestSerializer.create(); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "continent", request.getContinentValue()); + serializer.putQueryParam(fields, "request", request.getRequest()); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(EnumResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + listLocationsMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.location.Locations/ListLocations") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/{name=projects/*}/locations", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(ListLocationsResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + getLocationMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.location.Locations/GetLocation") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/{name=projects/*/locations/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Location.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + setIamPolicyMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.iam.v1.IAMPolicy/SetIamPolicy") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/{resource=users/*}:setIamPolicy", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "resource", request.getResource()); + return fields; + }) + .setAdditionalPaths( + "/v1beta1/{resource=rooms/*}:setIamPolicy", + "/v1beta1/{resource=rooms/*/blurbs/*}:setIamPolicy", + "/v1beta1/{resource=sequences/*}:setIamPolicy") + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("*", request.toBuilder().clearResource().build(), false)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Policy.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + getIamPolicyMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.iam.v1.IAMPolicy/GetIamPolicy") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/{resource=users/*}:getIamPolicy", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "resource", request.getResource()); + return fields; + }) + .setAdditionalPaths( + "/v1beta1/{resource=rooms/*}:getIamPolicy", + "/v1beta1/{resource=rooms/*/blurbs/*}:getIamPolicy", + "/v1beta1/{resource=sequences/*}:getIamPolicy") + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Policy.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + testIamPermissionsMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.iam.v1.IAMPolicy/TestIamPermissions") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/{resource=users/*}:testIamPermissions", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "resource", request.getResource()); + return fields; + }) + .setAdditionalPaths( + "/v1beta1/{resource=rooms/*}:testIamPermissions", + "/v1beta1/{resource=rooms/*/blurbs/*}:testIamPermissions", + "/v1beta1/{resource=sequences/*}:testIamPermissions") + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("*", request.toBuilder().clearResource().build(), false)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(TestIamPermissionsResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private final UnaryCallable repeatDataBodyCallable; + private final UnaryCallable repeatDataBodyInfoCallable; + private final UnaryCallable repeatDataQueryCallable; + private final UnaryCallable repeatDataSimplePathCallable; + private final UnaryCallable repeatDataPathResourceCallable; + private final UnaryCallable repeatDataPathTrailingResourceCallable; + private final UnaryCallable repeatDataBodyPutCallable; + private final UnaryCallable repeatDataBodyPatchCallable; + private final UnaryCallable getEnumCallable; + private final UnaryCallable verifyEnumCallable; + private final UnaryCallable listLocationsCallable; + private final UnaryCallable + listLocationsPagedCallable; + private final UnaryCallable getLocationCallable; + private final UnaryCallable setIamPolicyCallable; + private final UnaryCallable getIamPolicyCallable; + private final UnaryCallable + testIamPermissionsCallable; + + private final BackgroundResource backgroundResources; + private final HttpJsonStubCallableFactory callableFactory; + + public static final HttpJsonComplianceStub create(ComplianceStubSettings settings) + throws IOException { + return new HttpJsonComplianceStub(settings, ClientContext.create(settings)); + } + + public static final HttpJsonComplianceStub create(ClientContext clientContext) + throws IOException { + return new HttpJsonComplianceStub( + ComplianceStubSettings.newHttpJsonBuilder().build(), clientContext); + } + + public static final HttpJsonComplianceStub create( + ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { + return new HttpJsonComplianceStub( + ComplianceStubSettings.newHttpJsonBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of HttpJsonComplianceStub, 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 HttpJsonComplianceStub(ComplianceStubSettings settings, ClientContext clientContext) + throws IOException { + this(settings, clientContext, new HttpJsonComplianceCallableFactory()); + } + + /** + * Constructs an instance of HttpJsonComplianceStub, 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 HttpJsonComplianceStub( + ComplianceStubSettings settings, + ClientContext clientContext, + HttpJsonStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + + HttpJsonCallSettings repeatDataBodyTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(repeatDataBodyMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings repeatDataBodyInfoTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(repeatDataBodyInfoMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings repeatDataQueryTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(repeatDataQueryMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings repeatDataSimplePathTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(repeatDataSimplePathMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("info.f_bool", String.valueOf(request.getInfo().getFBool())); + builder.add("info.f_double", String.valueOf(request.getInfo().getFDouble())); + builder.add("info.f_int32", String.valueOf(request.getInfo().getFInt32())); + builder.add( + "info.f_kingdom", String.valueOf(request.getInfo().getFKingdomValue())); + builder.add("info.f_string", String.valueOf(request.getInfo().getFString())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings repeatDataPathResourceTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(repeatDataPathResourceMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("info.f_bool", String.valueOf(request.getInfo().getFBool())); + builder.add( + "info.f_child.f_string", + String.valueOf(request.getInfo().getFChild().getFString())); + builder.add("info.f_string", String.valueOf(request.getInfo().getFString())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings + repeatDataPathTrailingResourceTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(repeatDataPathTrailingResourceMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add( + "info.f_child.f_string", + String.valueOf(request.getInfo().getFChild().getFString())); + builder.add("info.f_string", String.valueOf(request.getInfo().getFString())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings repeatDataBodyPutTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(repeatDataBodyPutMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings repeatDataBodyPatchTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(repeatDataBodyPatchMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings getEnumTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getEnumMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings verifyEnumTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(verifyEnumMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings + listLocationsTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(listLocationsMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings getLocationTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getLocationMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings setIamPolicyTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(setIamPolicyMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("resource", String.valueOf(request.getResource())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings getIamPolicyTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getIamPolicyMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("resource", String.valueOf(request.getResource())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings + testIamPermissionsTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(testIamPermissionsMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("resource", String.valueOf(request.getResource())); + return builder.build(); + }) + .build(); + + this.repeatDataBodyCallable = + callableFactory.createUnaryCallable( + repeatDataBodyTransportSettings, settings.repeatDataBodySettings(), clientContext); + this.repeatDataBodyInfoCallable = + callableFactory.createUnaryCallable( + repeatDataBodyInfoTransportSettings, + settings.repeatDataBodyInfoSettings(), + clientContext); + this.repeatDataQueryCallable = + callableFactory.createUnaryCallable( + repeatDataQueryTransportSettings, settings.repeatDataQuerySettings(), clientContext); + this.repeatDataSimplePathCallable = + callableFactory.createUnaryCallable( + repeatDataSimplePathTransportSettings, + settings.repeatDataSimplePathSettings(), + clientContext); + this.repeatDataPathResourceCallable = + callableFactory.createUnaryCallable( + repeatDataPathResourceTransportSettings, + settings.repeatDataPathResourceSettings(), + clientContext); + this.repeatDataPathTrailingResourceCallable = + callableFactory.createUnaryCallable( + repeatDataPathTrailingResourceTransportSettings, + settings.repeatDataPathTrailingResourceSettings(), + clientContext); + this.repeatDataBodyPutCallable = + callableFactory.createUnaryCallable( + repeatDataBodyPutTransportSettings, + settings.repeatDataBodyPutSettings(), + clientContext); + this.repeatDataBodyPatchCallable = + callableFactory.createUnaryCallable( + repeatDataBodyPatchTransportSettings, + settings.repeatDataBodyPatchSettings(), + clientContext); + this.getEnumCallable = + callableFactory.createUnaryCallable( + getEnumTransportSettings, settings.getEnumSettings(), clientContext); + this.verifyEnumCallable = + callableFactory.createUnaryCallable( + verifyEnumTransportSettings, settings.verifyEnumSettings(), clientContext); + this.listLocationsCallable = + callableFactory.createUnaryCallable( + listLocationsTransportSettings, settings.listLocationsSettings(), clientContext); + this.listLocationsPagedCallable = + callableFactory.createPagedCallable( + listLocationsTransportSettings, settings.listLocationsSettings(), clientContext); + this.getLocationCallable = + callableFactory.createUnaryCallable( + getLocationTransportSettings, settings.getLocationSettings(), clientContext); + this.setIamPolicyCallable = + callableFactory.createUnaryCallable( + setIamPolicyTransportSettings, settings.setIamPolicySettings(), clientContext); + this.getIamPolicyCallable = + callableFactory.createUnaryCallable( + getIamPolicyTransportSettings, settings.getIamPolicySettings(), clientContext); + this.testIamPermissionsCallable = + callableFactory.createUnaryCallable( + testIamPermissionsTransportSettings, + settings.testIamPermissionsSettings(), + clientContext); + + this.backgroundResources = + new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + @InternalApi + public static List getMethodDescriptors() { + List methodDescriptors = new ArrayList<>(); + methodDescriptors.add(repeatDataBodyMethodDescriptor); + methodDescriptors.add(repeatDataBodyInfoMethodDescriptor); + methodDescriptors.add(repeatDataQueryMethodDescriptor); + methodDescriptors.add(repeatDataSimplePathMethodDescriptor); + methodDescriptors.add(repeatDataPathResourceMethodDescriptor); + methodDescriptors.add(repeatDataPathTrailingResourceMethodDescriptor); + methodDescriptors.add(repeatDataBodyPutMethodDescriptor); + methodDescriptors.add(repeatDataBodyPatchMethodDescriptor); + methodDescriptors.add(getEnumMethodDescriptor); + methodDescriptors.add(verifyEnumMethodDescriptor); + methodDescriptors.add(listLocationsMethodDescriptor); + methodDescriptors.add(getLocationMethodDescriptor); + methodDescriptors.add(setIamPolicyMethodDescriptor); + methodDescriptors.add(getIamPolicyMethodDescriptor); + methodDescriptors.add(testIamPermissionsMethodDescriptor); + return methodDescriptors; + } + + @Override + public UnaryCallable repeatDataBodyCallable() { + return repeatDataBodyCallable; + } + + @Override + public UnaryCallable repeatDataBodyInfoCallable() { + return repeatDataBodyInfoCallable; + } + + @Override + public UnaryCallable repeatDataQueryCallable() { + return repeatDataQueryCallable; + } + + @Override + public UnaryCallable repeatDataSimplePathCallable() { + return repeatDataSimplePathCallable; + } + + @Override + public UnaryCallable repeatDataPathResourceCallable() { + return repeatDataPathResourceCallable; + } + + @Override + public UnaryCallable repeatDataPathTrailingResourceCallable() { + return repeatDataPathTrailingResourceCallable; + } + + @Override + public UnaryCallable repeatDataBodyPutCallable() { + return repeatDataBodyPutCallable; + } + + @Override + public UnaryCallable repeatDataBodyPatchCallable() { + return repeatDataBodyPatchCallable; + } + + @Override + public UnaryCallable getEnumCallable() { + return getEnumCallable; + } + + @Override + public UnaryCallable verifyEnumCallable() { + return verifyEnumCallable; + } + + @Override + public UnaryCallable listLocationsCallable() { + return listLocationsCallable; + } + + @Override + public UnaryCallable + listLocationsPagedCallable() { + return listLocationsPagedCallable; + } + + @Override + public UnaryCallable getLocationCallable() { + return getLocationCallable; + } + + @Override + public UnaryCallable setIamPolicyCallable() { + return setIamPolicyCallable; + } + + @Override + public UnaryCallable getIamPolicyCallable() { + return getIamPolicyCallable; + } + + @Override + public UnaryCallable + testIamPermissionsCallable() { + return testIamPermissionsCallable; + } + + @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-showcase-3.25.8/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/HttpJsonEchoCallableFactory.java b/java-showcase-3.25.8/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/HttpJsonEchoCallableFactory.java new file mode 100644 index 0000000000..ff4dcba729 --- /dev/null +++ b/java-showcase-3.25.8/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/HttpJsonEchoCallableFactory.java @@ -0,0 +1,103 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.stub; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.HttpJsonCallSettings; +import com.google.api.gax.httpjson.HttpJsonCallableFactory; +import com.google.api.gax.httpjson.HttpJsonOperationSnapshotCallable; +import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; +import com.google.api.gax.httpjson.longrunning.stub.OperationsStub; +import com.google.api.gax.rpc.BatchingCallSettings; +import com.google.api.gax.rpc.ClientContext; +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.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.longrunning.Operation; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * REST callable factory implementation for the Echo service API. + * + *

        This class is for advanced usage. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class HttpJsonEchoCallableFactory + implements HttpJsonStubCallableFactory { + + @Override + public UnaryCallable createUnaryCallable( + HttpJsonCallSettings httpJsonCallSettings, + UnaryCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createUnaryCallable( + httpJsonCallSettings, callSettings, clientContext); + } + + @Override + public + UnaryCallable createPagedCallable( + HttpJsonCallSettings httpJsonCallSettings, + PagedCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createPagedCallable( + httpJsonCallSettings, callSettings, clientContext); + } + + @Override + public UnaryCallable createBatchingCallable( + HttpJsonCallSettings httpJsonCallSettings, + BatchingCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createBatchingCallable( + httpJsonCallSettings, callSettings, clientContext); + } + + @Override + public + OperationCallable createOperationCallable( + HttpJsonCallSettings httpJsonCallSettings, + OperationCallSettings callSettings, + ClientContext clientContext, + OperationsStub operationsStub) { + UnaryCallable innerCallable = + HttpJsonCallableFactory.createBaseUnaryCallable( + httpJsonCallSettings, callSettings.getInitialCallSettings(), clientContext); + HttpJsonOperationSnapshotCallable initialCallable = + new HttpJsonOperationSnapshotCallable( + innerCallable, + httpJsonCallSettings.getMethodDescriptor().getOperationSnapshotFactory()); + return HttpJsonCallableFactory.createOperationCallable( + callSettings, clientContext, operationsStub.longRunningClient(), initialCallable); + } + + @Override + public + ServerStreamingCallable createServerStreamingCallable( + HttpJsonCallSettings httpJsonCallSettings, + ServerStreamingCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createServerStreamingCallable( + httpJsonCallSettings, callSettings, clientContext); + } +} diff --git a/java-showcase-3.25.8/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/HttpJsonEchoStub.java b/java-showcase-3.25.8/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/HttpJsonEchoStub.java new file mode 100644 index 0000000000..1a7f5e5cc4 --- /dev/null +++ b/java-showcase-3.25.8/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/HttpJsonEchoStub.java @@ -0,0 +1,1058 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.stub; + +import static com.google.showcase.v1beta1.EchoClient.ListLocationsPagedResponse; +import static com.google.showcase.v1beta1.EchoClient.PagedExpandLegacyMappedPagedResponse; +import static com.google.showcase.v1beta1.EchoClient.PagedExpandPagedResponse; + +import com.google.api.HttpRule; +import com.google.api.core.BetaApi; +import com.google.api.core.InternalApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.httpjson.ApiMethodDescriptor; +import com.google.api.gax.httpjson.HttpJsonCallSettings; +import com.google.api.gax.httpjson.HttpJsonOperationSnapshot; +import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; +import com.google.api.gax.httpjson.ProtoMessageRequestFormatter; +import com.google.api.gax.httpjson.ProtoMessageResponseParser; +import com.google.api.gax.httpjson.ProtoRestSerializer; +import com.google.api.gax.httpjson.longrunning.stub.HttpJsonOperationsStub; +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.OperationCallable; +import com.google.api.gax.rpc.RequestParamsBuilder; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.api.pathtemplate.PathTemplate; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.common.base.Strings; +import com.google.common.collect.ImmutableMap; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.longrunning.Operation; +import com.google.protobuf.TypeRegistry; +import com.google.showcase.v1beta1.BlockRequest; +import com.google.showcase.v1beta1.BlockResponse; +import com.google.showcase.v1beta1.EchoErrorDetailsRequest; +import com.google.showcase.v1beta1.EchoErrorDetailsResponse; +import com.google.showcase.v1beta1.EchoRequest; +import com.google.showcase.v1beta1.EchoResponse; +import com.google.showcase.v1beta1.ExpandRequest; +import com.google.showcase.v1beta1.FailEchoWithDetailsRequest; +import com.google.showcase.v1beta1.FailEchoWithDetailsResponse; +import com.google.showcase.v1beta1.PagedExpandLegacyMappedResponse; +import com.google.showcase.v1beta1.PagedExpandLegacyRequest; +import com.google.showcase.v1beta1.PagedExpandRequest; +import com.google.showcase.v1beta1.PagedExpandResponse; +import com.google.showcase.v1beta1.WaitMetadata; +import com.google.showcase.v1beta1.WaitRequest; +import com.google.showcase.v1beta1.WaitResponse; +import java.io.IOException; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.UUID; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * REST stub implementation for the Echo service API. + * + *

        This class is for advanced usage and reflects the underlying API directly. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class HttpJsonEchoStub extends EchoStub { + private static final TypeRegistry typeRegistry = + TypeRegistry.newBuilder() + .add(WaitResponse.getDescriptor()) + .add(WaitMetadata.getDescriptor()) + .build(); + + private static final ApiMethodDescriptor echoMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.showcase.v1beta1.Echo/Echo") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/echo:echo", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = ProtoRestSerializer.create(); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("*", request.toBuilder().build(), false)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(EchoResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + echoErrorDetailsMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.showcase.v1beta1.Echo/EchoErrorDetails") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/echo:error-details", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("*", request.toBuilder().build(), false)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(EchoErrorDetailsResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + failEchoWithDetailsMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.showcase.v1beta1.Echo/FailEchoWithDetails") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/echo:failWithDetails", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("*", request.toBuilder().build(), false)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(FailEchoWithDetailsResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor expandMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.showcase.v1beta1.Echo/Expand") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.SERVER_STREAMING) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/echo:expand", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("*", request.toBuilder().build(), false)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(EchoResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + pagedExpandMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.showcase.v1beta1.Echo/PagedExpand") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/echo:pagedExpand", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("*", request.toBuilder().build(), false)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(PagedExpandResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + pagedExpandLegacyMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.showcase.v1beta1.Echo/PagedExpandLegacy") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/echo:pagedExpandLegacy", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("*", request.toBuilder().build(), false)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(PagedExpandResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + pagedExpandLegacyMappedMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.showcase.v1beta1.Echo/PagedExpandLegacyMapped") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/echo:pagedExpandLegacyMapped", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("*", request.toBuilder().build(), false)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(PagedExpandLegacyMappedResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor waitMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.showcase.v1beta1.Echo/Wait") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/echo:wait", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = ProtoRestSerializer.create(); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("*", request.toBuilder().build(), false)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Operation.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .setOperationSnapshotFactory( + (WaitRequest request, Operation response) -> + HttpJsonOperationSnapshot.create(response)) + .build(); + + private static final ApiMethodDescriptor blockMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.showcase.v1beta1.Echo/Block") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/echo:block", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = ProtoRestSerializer.create(); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("*", request.toBuilder().build(), false)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(BlockResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + listLocationsMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.location.Locations/ListLocations") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/{name=projects/*}/locations", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(ListLocationsResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + getLocationMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.location.Locations/GetLocation") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/{name=projects/*/locations/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Location.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + setIamPolicyMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.iam.v1.IAMPolicy/SetIamPolicy") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/{resource=users/*}:setIamPolicy", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "resource", request.getResource()); + return fields; + }) + .setAdditionalPaths( + "/v1beta1/{resource=rooms/*}:setIamPolicy", + "/v1beta1/{resource=rooms/*/blurbs/*}:setIamPolicy", + "/v1beta1/{resource=sequences/*}:setIamPolicy") + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("*", request.toBuilder().clearResource().build(), false)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Policy.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + getIamPolicyMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.iam.v1.IAMPolicy/GetIamPolicy") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/{resource=users/*}:getIamPolicy", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "resource", request.getResource()); + return fields; + }) + .setAdditionalPaths( + "/v1beta1/{resource=rooms/*}:getIamPolicy", + "/v1beta1/{resource=rooms/*/blurbs/*}:getIamPolicy", + "/v1beta1/{resource=sequences/*}:getIamPolicy") + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Policy.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + testIamPermissionsMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.iam.v1.IAMPolicy/TestIamPermissions") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/{resource=users/*}:testIamPermissions", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "resource", request.getResource()); + return fields; + }) + .setAdditionalPaths( + "/v1beta1/{resource=rooms/*}:testIamPermissions", + "/v1beta1/{resource=rooms/*/blurbs/*}:testIamPermissions", + "/v1beta1/{resource=sequences/*}:testIamPermissions") + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("*", request.toBuilder().clearResource().build(), false)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(TestIamPermissionsResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private final UnaryCallable echoCallable; + private final UnaryCallable + echoErrorDetailsCallable; + private final UnaryCallable + failEchoWithDetailsCallable; + private final ServerStreamingCallable expandCallable; + private final UnaryCallable pagedExpandCallable; + private final UnaryCallable + pagedExpandPagedCallable; + private final UnaryCallable + pagedExpandLegacyCallable; + private final UnaryCallable + pagedExpandLegacyMappedCallable; + private final UnaryCallable + pagedExpandLegacyMappedPagedCallable; + private final UnaryCallable waitCallable; + private final OperationCallable waitOperationCallable; + private final UnaryCallable blockCallable; + private final UnaryCallable listLocationsCallable; + private final UnaryCallable + listLocationsPagedCallable; + private final UnaryCallable getLocationCallable; + private final UnaryCallable setIamPolicyCallable; + private final UnaryCallable getIamPolicyCallable; + private final UnaryCallable + testIamPermissionsCallable; + + private final BackgroundResource backgroundResources; + private final HttpJsonOperationsStub httpJsonOperationsStub; + private final HttpJsonStubCallableFactory callableFactory; + + private static final PathTemplate ECHO_0_PATH_TEMPLATE = PathTemplate.create("{header=**}"); + private static final PathTemplate ECHO_1_PATH_TEMPLATE = PathTemplate.create("{routing_id=**}"); + private static final PathTemplate ECHO_2_PATH_TEMPLATE = + PathTemplate.create("{table_name=regions/*/zones/*/**}"); + private static final PathTemplate ECHO_3_PATH_TEMPLATE = + PathTemplate.create("{super_id=projects/*}/**"); + private static final PathTemplate ECHO_4_PATH_TEMPLATE = + PathTemplate.create("{table_name=projects/*/instances/*/**}"); + private static final PathTemplate ECHO_5_PATH_TEMPLATE = + PathTemplate.create("projects/*/{instance_id=instances/*}/**"); + private static final PathTemplate ECHO_6_PATH_TEMPLATE = PathTemplate.create("{baz=**}"); + private static final PathTemplate ECHO_7_PATH_TEMPLATE = + PathTemplate.create("{qux=projects/*}/**"); + + public static final HttpJsonEchoStub create(EchoStubSettings settings) throws IOException { + return new HttpJsonEchoStub(settings, ClientContext.create(settings)); + } + + public static final HttpJsonEchoStub create(ClientContext clientContext) throws IOException { + return new HttpJsonEchoStub(EchoStubSettings.newHttpJsonBuilder().build(), clientContext); + } + + public static final HttpJsonEchoStub create( + ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { + return new HttpJsonEchoStub( + EchoStubSettings.newHttpJsonBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of HttpJsonEchoStub, 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 HttpJsonEchoStub(EchoStubSettings settings, ClientContext clientContext) + throws IOException { + this(settings, clientContext, new HttpJsonEchoCallableFactory()); + } + + /** + * Constructs an instance of HttpJsonEchoStub, 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 HttpJsonEchoStub( + EchoStubSettings settings, + ClientContext clientContext, + HttpJsonStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + this.httpJsonOperationsStub = + HttpJsonOperationsStub.create( + clientContext, + callableFactory, + typeRegistry, + ImmutableMap.builder() + .put( + "google.longrunning.Operations.CancelOperation", + HttpRule.newBuilder().setPost("/v1beta1/{name=operations/**}:cancel").build()) + .put( + "google.longrunning.Operations.DeleteOperation", + HttpRule.newBuilder().setDelete("/v1beta1/{name=operations/**}").build()) + .put( + "google.longrunning.Operations.GetOperation", + HttpRule.newBuilder().setGet("/v1beta1/{name=operations/**}").build()) + .put( + "google.longrunning.Operations.ListOperations", + HttpRule.newBuilder().setGet("/v1beta1/operations").build()) + .build()); + + HttpJsonCallSettings echoTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(echoMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add(request.getHeader(), "header", ECHO_0_PATH_TEMPLATE); + builder.add(request.getHeader(), "routing_id", ECHO_1_PATH_TEMPLATE); + builder.add(request.getHeader(), "table_name", ECHO_2_PATH_TEMPLATE); + builder.add(request.getHeader(), "super_id", ECHO_3_PATH_TEMPLATE); + builder.add(request.getHeader(), "table_name", ECHO_4_PATH_TEMPLATE); + builder.add(request.getHeader(), "instance_id", ECHO_5_PATH_TEMPLATE); + builder.add(request.getOtherHeader(), "baz", ECHO_6_PATH_TEMPLATE); + builder.add(request.getOtherHeader(), "qux", ECHO_7_PATH_TEMPLATE); + return builder.build(); + }) + .setRequestMutator( + request -> { + EchoRequest.Builder requestBuilder = request.toBuilder(); + if (Strings.isNullOrEmpty(request.getRequestId())) { + requestBuilder.setRequestId(UUID.randomUUID().toString()); + } + if (Strings.isNullOrEmpty(request.getOtherRequestId())) { + requestBuilder.setOtherRequestId(UUID.randomUUID().toString()); + } + return requestBuilder.build(); + }) + .build(); + HttpJsonCallSettings + echoErrorDetailsTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(echoErrorDetailsMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings + failEchoWithDetailsTransportSettings = + HttpJsonCallSettings + .newBuilder() + .setMethodDescriptor(failEchoWithDetailsMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings expandTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(expandMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings pagedExpandTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(pagedExpandMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings + pagedExpandLegacyTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(pagedExpandLegacyMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings + pagedExpandLegacyMappedTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(pagedExpandLegacyMappedMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings waitTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(waitMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings blockTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(blockMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings + listLocationsTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(listLocationsMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings getLocationTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getLocationMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings setIamPolicyTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(setIamPolicyMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("resource", String.valueOf(request.getResource())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings getIamPolicyTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getIamPolicyMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("resource", String.valueOf(request.getResource())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings + testIamPermissionsTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(testIamPermissionsMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("resource", String.valueOf(request.getResource())); + return builder.build(); + }) + .build(); + + this.echoCallable = + callableFactory.createUnaryCallable( + echoTransportSettings, settings.echoSettings(), clientContext); + this.echoErrorDetailsCallable = + callableFactory.createUnaryCallable( + echoErrorDetailsTransportSettings, settings.echoErrorDetailsSettings(), clientContext); + this.failEchoWithDetailsCallable = + callableFactory.createUnaryCallable( + failEchoWithDetailsTransportSettings, + settings.failEchoWithDetailsSettings(), + clientContext); + this.expandCallable = + callableFactory.createServerStreamingCallable( + expandTransportSettings, settings.expandSettings(), clientContext); + this.pagedExpandCallable = + callableFactory.createUnaryCallable( + pagedExpandTransportSettings, settings.pagedExpandSettings(), clientContext); + this.pagedExpandPagedCallable = + callableFactory.createPagedCallable( + pagedExpandTransportSettings, settings.pagedExpandSettings(), clientContext); + this.pagedExpandLegacyCallable = + callableFactory.createUnaryCallable( + pagedExpandLegacyTransportSettings, + settings.pagedExpandLegacySettings(), + clientContext); + this.pagedExpandLegacyMappedCallable = + callableFactory.createUnaryCallable( + pagedExpandLegacyMappedTransportSettings, + settings.pagedExpandLegacyMappedSettings(), + clientContext); + this.pagedExpandLegacyMappedPagedCallable = + callableFactory.createPagedCallable( + pagedExpandLegacyMappedTransportSettings, + settings.pagedExpandLegacyMappedSettings(), + clientContext); + this.waitCallable = + callableFactory.createUnaryCallable( + waitTransportSettings, settings.waitSettings(), clientContext); + this.waitOperationCallable = + callableFactory.createOperationCallable( + waitTransportSettings, + settings.waitOperationSettings(), + clientContext, + httpJsonOperationsStub); + this.blockCallable = + callableFactory.createUnaryCallable( + blockTransportSettings, settings.blockSettings(), clientContext); + this.listLocationsCallable = + callableFactory.createUnaryCallable( + listLocationsTransportSettings, settings.listLocationsSettings(), clientContext); + this.listLocationsPagedCallable = + callableFactory.createPagedCallable( + listLocationsTransportSettings, settings.listLocationsSettings(), clientContext); + this.getLocationCallable = + callableFactory.createUnaryCallable( + getLocationTransportSettings, settings.getLocationSettings(), clientContext); + this.setIamPolicyCallable = + callableFactory.createUnaryCallable( + setIamPolicyTransportSettings, settings.setIamPolicySettings(), clientContext); + this.getIamPolicyCallable = + callableFactory.createUnaryCallable( + getIamPolicyTransportSettings, settings.getIamPolicySettings(), clientContext); + this.testIamPermissionsCallable = + callableFactory.createUnaryCallable( + testIamPermissionsTransportSettings, + settings.testIamPermissionsSettings(), + clientContext); + + this.backgroundResources = + new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + @InternalApi + public static List getMethodDescriptors() { + List methodDescriptors = new ArrayList<>(); + methodDescriptors.add(echoMethodDescriptor); + methodDescriptors.add(echoErrorDetailsMethodDescriptor); + methodDescriptors.add(failEchoWithDetailsMethodDescriptor); + methodDescriptors.add(expandMethodDescriptor); + methodDescriptors.add(pagedExpandMethodDescriptor); + methodDescriptors.add(pagedExpandLegacyMethodDescriptor); + methodDescriptors.add(pagedExpandLegacyMappedMethodDescriptor); + methodDescriptors.add(waitMethodDescriptor); + methodDescriptors.add(blockMethodDescriptor); + methodDescriptors.add(listLocationsMethodDescriptor); + methodDescriptors.add(getLocationMethodDescriptor); + methodDescriptors.add(setIamPolicyMethodDescriptor); + methodDescriptors.add(getIamPolicyMethodDescriptor); + methodDescriptors.add(testIamPermissionsMethodDescriptor); + return methodDescriptors; + } + + public HttpJsonOperationsStub getHttpJsonOperationsStub() { + return httpJsonOperationsStub; + } + + @Override + public UnaryCallable echoCallable() { + return echoCallable; + } + + @Override + public UnaryCallable + echoErrorDetailsCallable() { + return echoErrorDetailsCallable; + } + + @Override + public UnaryCallable + failEchoWithDetailsCallable() { + return failEchoWithDetailsCallable; + } + + @Override + public ServerStreamingCallable expandCallable() { + return expandCallable; + } + + @Override + public UnaryCallable pagedExpandCallable() { + return pagedExpandCallable; + } + + @Override + public UnaryCallable pagedExpandPagedCallable() { + return pagedExpandPagedCallable; + } + + @Override + public UnaryCallable pagedExpandLegacyCallable() { + return pagedExpandLegacyCallable; + } + + @Override + public UnaryCallable + pagedExpandLegacyMappedCallable() { + return pagedExpandLegacyMappedCallable; + } + + @Override + public UnaryCallable + pagedExpandLegacyMappedPagedCallable() { + return pagedExpandLegacyMappedPagedCallable; + } + + @Override + public UnaryCallable waitCallable() { + return waitCallable; + } + + @Override + public OperationCallable waitOperationCallable() { + return waitOperationCallable; + } + + @Override + public UnaryCallable blockCallable() { + return blockCallable; + } + + @Override + public UnaryCallable listLocationsCallable() { + return listLocationsCallable; + } + + @Override + public UnaryCallable + listLocationsPagedCallable() { + return listLocationsPagedCallable; + } + + @Override + public UnaryCallable getLocationCallable() { + return getLocationCallable; + } + + @Override + public UnaryCallable setIamPolicyCallable() { + return setIamPolicyCallable; + } + + @Override + public UnaryCallable getIamPolicyCallable() { + return getIamPolicyCallable; + } + + @Override + public UnaryCallable + testIamPermissionsCallable() { + return testIamPermissionsCallable; + } + + @Override + public ClientStreamingCallable collectCallable() { + throw new UnsupportedOperationException( + "Not implemented: collectCallable(). REST transport is not implemented for this method" + + " yet."); + } + + @Override + public BidiStreamingCallable chatCallable() { + throw new UnsupportedOperationException( + "Not implemented: chatCallable(). REST transport is not implemented for this method yet."); + } + + @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-showcase-3.25.8/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/HttpJsonIdentityCallableFactory.java b/java-showcase-3.25.8/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/HttpJsonIdentityCallableFactory.java new file mode 100644 index 0000000000..19b5dfa5a7 --- /dev/null +++ b/java-showcase-3.25.8/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/HttpJsonIdentityCallableFactory.java @@ -0,0 +1,103 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.stub; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.HttpJsonCallSettings; +import com.google.api.gax.httpjson.HttpJsonCallableFactory; +import com.google.api.gax.httpjson.HttpJsonOperationSnapshotCallable; +import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; +import com.google.api.gax.httpjson.longrunning.stub.OperationsStub; +import com.google.api.gax.rpc.BatchingCallSettings; +import com.google.api.gax.rpc.ClientContext; +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.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.longrunning.Operation; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * REST callable factory implementation for the Identity service API. + * + *

        This class is for advanced usage. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class HttpJsonIdentityCallableFactory + implements HttpJsonStubCallableFactory { + + @Override + public UnaryCallable createUnaryCallable( + HttpJsonCallSettings httpJsonCallSettings, + UnaryCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createUnaryCallable( + httpJsonCallSettings, callSettings, clientContext); + } + + @Override + public + UnaryCallable createPagedCallable( + HttpJsonCallSettings httpJsonCallSettings, + PagedCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createPagedCallable( + httpJsonCallSettings, callSettings, clientContext); + } + + @Override + public UnaryCallable createBatchingCallable( + HttpJsonCallSettings httpJsonCallSettings, + BatchingCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createBatchingCallable( + httpJsonCallSettings, callSettings, clientContext); + } + + @Override + public + OperationCallable createOperationCallable( + HttpJsonCallSettings httpJsonCallSettings, + OperationCallSettings callSettings, + ClientContext clientContext, + OperationsStub operationsStub) { + UnaryCallable innerCallable = + HttpJsonCallableFactory.createBaseUnaryCallable( + httpJsonCallSettings, callSettings.getInitialCallSettings(), clientContext); + HttpJsonOperationSnapshotCallable initialCallable = + new HttpJsonOperationSnapshotCallable( + innerCallable, + httpJsonCallSettings.getMethodDescriptor().getOperationSnapshotFactory()); + return HttpJsonCallableFactory.createOperationCallable( + callSettings, clientContext, operationsStub.longRunningClient(), initialCallable); + } + + @Override + public + ServerStreamingCallable createServerStreamingCallable( + HttpJsonCallSettings httpJsonCallSettings, + ServerStreamingCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createServerStreamingCallable( + httpJsonCallSettings, callSettings, clientContext); + } +} diff --git a/java-showcase-3.25.8/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/HttpJsonIdentityStub.java b/java-showcase-3.25.8/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/HttpJsonIdentityStub.java new file mode 100644 index 0000000000..53a2149e7c --- /dev/null +++ b/java-showcase-3.25.8/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/HttpJsonIdentityStub.java @@ -0,0 +1,735 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.stub; + +import static com.google.showcase.v1beta1.IdentityClient.ListLocationsPagedResponse; +import static com.google.showcase.v1beta1.IdentityClient.ListUsersPagedResponse; + +import com.google.api.core.BetaApi; +import com.google.api.core.InternalApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.httpjson.ApiMethodDescriptor; +import com.google.api.gax.httpjson.HttpJsonCallSettings; +import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; +import com.google.api.gax.httpjson.ProtoMessageRequestFormatter; +import com.google.api.gax.httpjson.ProtoMessageResponseParser; +import com.google.api.gax.httpjson.ProtoRestSerializer; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.RequestParamsBuilder; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.protobuf.Empty; +import com.google.protobuf.TypeRegistry; +import com.google.showcase.v1beta1.CreateUserRequest; +import com.google.showcase.v1beta1.DeleteUserRequest; +import com.google.showcase.v1beta1.GetUserRequest; +import com.google.showcase.v1beta1.ListUsersRequest; +import com.google.showcase.v1beta1.ListUsersResponse; +import com.google.showcase.v1beta1.UpdateUserRequest; +import com.google.showcase.v1beta1.User; +import java.io.IOException; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * REST stub implementation for the Identity service API. + * + *

        This class is for advanced usage and reflects the underlying API directly. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class HttpJsonIdentityStub extends IdentityStub { + private static final TypeRegistry typeRegistry = TypeRegistry.newBuilder().build(); + + private static final ApiMethodDescriptor createUserMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.showcase.v1beta1.Identity/CreateUser") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/users", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("*", request.toBuilder().build(), false)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(User.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor getUserMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.showcase.v1beta1.Identity/GetUser") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/{name=users/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(User.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor updateUserMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.showcase.v1beta1.Identity/UpdateUser") + .setHttpMethod("PATCH") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/{user.name=users/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "user.name", request.getUser().getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "updateMask", request.getUpdateMask()); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create().toBody("user", request.getUser(), false)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(User.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor deleteUserMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.showcase.v1beta1.Identity/DeleteUser") + .setHttpMethod("DELETE") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/{name=users/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Empty.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + listUsersMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.showcase.v1beta1.Identity/ListUsers") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/users", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "pageSize", request.getPageSize()); + serializer.putQueryParam(fields, "pageToken", request.getPageToken()); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(ListUsersResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + listLocationsMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.location.Locations/ListLocations") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/{name=projects/*}/locations", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(ListLocationsResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + getLocationMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.location.Locations/GetLocation") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/{name=projects/*/locations/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Location.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + setIamPolicyMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.iam.v1.IAMPolicy/SetIamPolicy") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/{resource=users/*}:setIamPolicy", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "resource", request.getResource()); + return fields; + }) + .setAdditionalPaths( + "/v1beta1/{resource=rooms/*}:setIamPolicy", + "/v1beta1/{resource=rooms/*/blurbs/*}:setIamPolicy", + "/v1beta1/{resource=sequences/*}:setIamPolicy") + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("*", request.toBuilder().clearResource().build(), false)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Policy.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + getIamPolicyMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.iam.v1.IAMPolicy/GetIamPolicy") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/{resource=users/*}:getIamPolicy", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "resource", request.getResource()); + return fields; + }) + .setAdditionalPaths( + "/v1beta1/{resource=rooms/*}:getIamPolicy", + "/v1beta1/{resource=rooms/*/blurbs/*}:getIamPolicy", + "/v1beta1/{resource=sequences/*}:getIamPolicy") + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Policy.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + testIamPermissionsMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.iam.v1.IAMPolicy/TestIamPermissions") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/{resource=users/*}:testIamPermissions", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "resource", request.getResource()); + return fields; + }) + .setAdditionalPaths( + "/v1beta1/{resource=rooms/*}:testIamPermissions", + "/v1beta1/{resource=rooms/*/blurbs/*}:testIamPermissions", + "/v1beta1/{resource=sequences/*}:testIamPermissions") + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("*", request.toBuilder().clearResource().build(), false)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(TestIamPermissionsResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private final UnaryCallable createUserCallable; + private final UnaryCallable getUserCallable; + private final UnaryCallable updateUserCallable; + private final UnaryCallable deleteUserCallable; + private final UnaryCallable listUsersCallable; + private final UnaryCallable listUsersPagedCallable; + private final UnaryCallable listLocationsCallable; + private final UnaryCallable + listLocationsPagedCallable; + private final UnaryCallable getLocationCallable; + private final UnaryCallable setIamPolicyCallable; + private final UnaryCallable getIamPolicyCallable; + private final UnaryCallable + testIamPermissionsCallable; + + private final BackgroundResource backgroundResources; + private final HttpJsonStubCallableFactory callableFactory; + + public static final HttpJsonIdentityStub create(IdentityStubSettings settings) + throws IOException { + return new HttpJsonIdentityStub(settings, ClientContext.create(settings)); + } + + public static final HttpJsonIdentityStub create(ClientContext clientContext) throws IOException { + return new HttpJsonIdentityStub( + IdentityStubSettings.newHttpJsonBuilder().build(), clientContext); + } + + public static final HttpJsonIdentityStub create( + ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { + return new HttpJsonIdentityStub( + IdentityStubSettings.newHttpJsonBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of HttpJsonIdentityStub, 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 HttpJsonIdentityStub(IdentityStubSettings settings, ClientContext clientContext) + throws IOException { + this(settings, clientContext, new HttpJsonIdentityCallableFactory()); + } + + /** + * Constructs an instance of HttpJsonIdentityStub, 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 HttpJsonIdentityStub( + IdentityStubSettings settings, + ClientContext clientContext, + HttpJsonStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + + HttpJsonCallSettings createUserTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(createUserMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings getUserTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getUserMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings updateUserTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(updateUserMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("user.name", String.valueOf(request.getUser().getName())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings deleteUserTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(deleteUserMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings listUsersTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(listUsersMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings + listLocationsTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(listLocationsMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings getLocationTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getLocationMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings setIamPolicyTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(setIamPolicyMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("resource", String.valueOf(request.getResource())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings getIamPolicyTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getIamPolicyMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("resource", String.valueOf(request.getResource())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings + testIamPermissionsTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(testIamPermissionsMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("resource", String.valueOf(request.getResource())); + return builder.build(); + }) + .build(); + + this.createUserCallable = + callableFactory.createUnaryCallable( + createUserTransportSettings, settings.createUserSettings(), clientContext); + this.getUserCallable = + callableFactory.createUnaryCallable( + getUserTransportSettings, settings.getUserSettings(), clientContext); + this.updateUserCallable = + callableFactory.createUnaryCallable( + updateUserTransportSettings, settings.updateUserSettings(), clientContext); + this.deleteUserCallable = + callableFactory.createUnaryCallable( + deleteUserTransportSettings, settings.deleteUserSettings(), clientContext); + this.listUsersCallable = + callableFactory.createUnaryCallable( + listUsersTransportSettings, settings.listUsersSettings(), clientContext); + this.listUsersPagedCallable = + callableFactory.createPagedCallable( + listUsersTransportSettings, settings.listUsersSettings(), clientContext); + this.listLocationsCallable = + callableFactory.createUnaryCallable( + listLocationsTransportSettings, settings.listLocationsSettings(), clientContext); + this.listLocationsPagedCallable = + callableFactory.createPagedCallable( + listLocationsTransportSettings, settings.listLocationsSettings(), clientContext); + this.getLocationCallable = + callableFactory.createUnaryCallable( + getLocationTransportSettings, settings.getLocationSettings(), clientContext); + this.setIamPolicyCallable = + callableFactory.createUnaryCallable( + setIamPolicyTransportSettings, settings.setIamPolicySettings(), clientContext); + this.getIamPolicyCallable = + callableFactory.createUnaryCallable( + getIamPolicyTransportSettings, settings.getIamPolicySettings(), clientContext); + this.testIamPermissionsCallable = + callableFactory.createUnaryCallable( + testIamPermissionsTransportSettings, + settings.testIamPermissionsSettings(), + clientContext); + + this.backgroundResources = + new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + @InternalApi + public static List getMethodDescriptors() { + List methodDescriptors = new ArrayList<>(); + methodDescriptors.add(createUserMethodDescriptor); + methodDescriptors.add(getUserMethodDescriptor); + methodDescriptors.add(updateUserMethodDescriptor); + methodDescriptors.add(deleteUserMethodDescriptor); + methodDescriptors.add(listUsersMethodDescriptor); + methodDescriptors.add(listLocationsMethodDescriptor); + methodDescriptors.add(getLocationMethodDescriptor); + methodDescriptors.add(setIamPolicyMethodDescriptor); + methodDescriptors.add(getIamPolicyMethodDescriptor); + methodDescriptors.add(testIamPermissionsMethodDescriptor); + return methodDescriptors; + } + + @Override + public UnaryCallable createUserCallable() { + return createUserCallable; + } + + @Override + public UnaryCallable getUserCallable() { + return getUserCallable; + } + + @Override + public UnaryCallable updateUserCallable() { + return updateUserCallable; + } + + @Override + public UnaryCallable deleteUserCallable() { + return deleteUserCallable; + } + + @Override + public UnaryCallable listUsersCallable() { + return listUsersCallable; + } + + @Override + public UnaryCallable listUsersPagedCallable() { + return listUsersPagedCallable; + } + + @Override + public UnaryCallable listLocationsCallable() { + return listLocationsCallable; + } + + @Override + public UnaryCallable + listLocationsPagedCallable() { + return listLocationsPagedCallable; + } + + @Override + public UnaryCallable getLocationCallable() { + return getLocationCallable; + } + + @Override + public UnaryCallable setIamPolicyCallable() { + return setIamPolicyCallable; + } + + @Override + public UnaryCallable getIamPolicyCallable() { + return getIamPolicyCallable; + } + + @Override + public UnaryCallable + testIamPermissionsCallable() { + return testIamPermissionsCallable; + } + + @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-showcase-3.25.8/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/HttpJsonMessagingCallableFactory.java b/java-showcase-3.25.8/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/HttpJsonMessagingCallableFactory.java new file mode 100644 index 0000000000..666726fc52 --- /dev/null +++ b/java-showcase-3.25.8/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/HttpJsonMessagingCallableFactory.java @@ -0,0 +1,103 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.stub; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.HttpJsonCallSettings; +import com.google.api.gax.httpjson.HttpJsonCallableFactory; +import com.google.api.gax.httpjson.HttpJsonOperationSnapshotCallable; +import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; +import com.google.api.gax.httpjson.longrunning.stub.OperationsStub; +import com.google.api.gax.rpc.BatchingCallSettings; +import com.google.api.gax.rpc.ClientContext; +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.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.longrunning.Operation; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * REST callable factory implementation for the Messaging service API. + * + *

        This class is for advanced usage. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class HttpJsonMessagingCallableFactory + implements HttpJsonStubCallableFactory { + + @Override + public UnaryCallable createUnaryCallable( + HttpJsonCallSettings httpJsonCallSettings, + UnaryCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createUnaryCallable( + httpJsonCallSettings, callSettings, clientContext); + } + + @Override + public + UnaryCallable createPagedCallable( + HttpJsonCallSettings httpJsonCallSettings, + PagedCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createPagedCallable( + httpJsonCallSettings, callSettings, clientContext); + } + + @Override + public UnaryCallable createBatchingCallable( + HttpJsonCallSettings httpJsonCallSettings, + BatchingCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createBatchingCallable( + httpJsonCallSettings, callSettings, clientContext); + } + + @Override + public + OperationCallable createOperationCallable( + HttpJsonCallSettings httpJsonCallSettings, + OperationCallSettings callSettings, + ClientContext clientContext, + OperationsStub operationsStub) { + UnaryCallable innerCallable = + HttpJsonCallableFactory.createBaseUnaryCallable( + httpJsonCallSettings, callSettings.getInitialCallSettings(), clientContext); + HttpJsonOperationSnapshotCallable initialCallable = + new HttpJsonOperationSnapshotCallable( + innerCallable, + httpJsonCallSettings.getMethodDescriptor().getOperationSnapshotFactory()); + return HttpJsonCallableFactory.createOperationCallable( + callSettings, clientContext, operationsStub.longRunningClient(), initialCallable); + } + + @Override + public + ServerStreamingCallable createServerStreamingCallable( + HttpJsonCallSettings httpJsonCallSettings, + ServerStreamingCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createServerStreamingCallable( + httpJsonCallSettings, callSettings, clientContext); + } +} diff --git a/java-showcase-3.25.8/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/HttpJsonMessagingStub.java b/java-showcase-3.25.8/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/HttpJsonMessagingStub.java new file mode 100644 index 0000000000..af225c30d7 --- /dev/null +++ b/java-showcase-3.25.8/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/HttpJsonMessagingStub.java @@ -0,0 +1,1223 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.stub; + +import static com.google.showcase.v1beta1.MessagingClient.ListBlurbsPagedResponse; +import static com.google.showcase.v1beta1.MessagingClient.ListLocationsPagedResponse; +import static com.google.showcase.v1beta1.MessagingClient.ListRoomsPagedResponse; + +import com.google.api.HttpRule; +import com.google.api.core.BetaApi; +import com.google.api.core.InternalApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.httpjson.ApiMethodDescriptor; +import com.google.api.gax.httpjson.HttpJsonCallSettings; +import com.google.api.gax.httpjson.HttpJsonOperationSnapshot; +import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; +import com.google.api.gax.httpjson.ProtoMessageRequestFormatter; +import com.google.api.gax.httpjson.ProtoMessageResponseParser; +import com.google.api.gax.httpjson.ProtoRestSerializer; +import com.google.api.gax.httpjson.longrunning.stub.HttpJsonOperationsStub; +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.OperationCallable; +import com.google.api.gax.rpc.RequestParamsBuilder; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.common.collect.ImmutableMap; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.longrunning.Operation; +import com.google.protobuf.Empty; +import com.google.protobuf.TypeRegistry; +import com.google.showcase.v1beta1.Blurb; +import com.google.showcase.v1beta1.ConnectRequest; +import com.google.showcase.v1beta1.CreateBlurbRequest; +import com.google.showcase.v1beta1.CreateRoomRequest; +import com.google.showcase.v1beta1.DeleteBlurbRequest; +import com.google.showcase.v1beta1.DeleteRoomRequest; +import com.google.showcase.v1beta1.GetBlurbRequest; +import com.google.showcase.v1beta1.GetRoomRequest; +import com.google.showcase.v1beta1.ListBlurbsRequest; +import com.google.showcase.v1beta1.ListBlurbsResponse; +import com.google.showcase.v1beta1.ListRoomsRequest; +import com.google.showcase.v1beta1.ListRoomsResponse; +import com.google.showcase.v1beta1.Room; +import com.google.showcase.v1beta1.SearchBlurbsMetadata; +import com.google.showcase.v1beta1.SearchBlurbsRequest; +import com.google.showcase.v1beta1.SearchBlurbsResponse; +import com.google.showcase.v1beta1.SendBlurbsResponse; +import com.google.showcase.v1beta1.StreamBlurbsRequest; +import com.google.showcase.v1beta1.StreamBlurbsResponse; +import com.google.showcase.v1beta1.UpdateBlurbRequest; +import com.google.showcase.v1beta1.UpdateRoomRequest; +import java.io.IOException; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * REST stub implementation for the Messaging service API. + * + *

        This class is for advanced usage and reflects the underlying API directly. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class HttpJsonMessagingStub extends MessagingStub { + private static final TypeRegistry typeRegistry = + TypeRegistry.newBuilder() + .add(SearchBlurbsResponse.getDescriptor()) + .add(SearchBlurbsMetadata.getDescriptor()) + .build(); + + private static final ApiMethodDescriptor createRoomMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.showcase.v1beta1.Messaging/CreateRoom") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/rooms", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("*", request.toBuilder().build(), false)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Room.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor getRoomMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.showcase.v1beta1.Messaging/GetRoom") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/{name=rooms/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Room.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor updateRoomMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.showcase.v1beta1.Messaging/UpdateRoom") + .setHttpMethod("PATCH") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/{room.name=rooms/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "room.name", request.getRoom().getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "updateMask", request.getUpdateMask()); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create().toBody("room", request.getRoom(), false)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Room.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor deleteRoomMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.showcase.v1beta1.Messaging/DeleteRoom") + .setHttpMethod("DELETE") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/{name=rooms/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Empty.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + listRoomsMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.showcase.v1beta1.Messaging/ListRooms") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/rooms", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "pageSize", request.getPageSize()); + serializer.putQueryParam(fields, "pageToken", request.getPageToken()); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(ListRoomsResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor createBlurbMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.showcase.v1beta1.Messaging/CreateBlurb") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/{parent=rooms/*}/blurbs", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "parent", request.getParent()); + return fields; + }) + .setAdditionalPaths("/v1beta1/{parent=users/*/profile}/blurbs") + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("*", request.toBuilder().clearParent().build(), false)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Blurb.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor getBlurbMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.showcase.v1beta1.Messaging/GetBlurb") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/{name=rooms/*/blurbs/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setAdditionalPaths("/v1beta1/{name=users/*/profile/blurbs/*}") + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Blurb.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor updateBlurbMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.showcase.v1beta1.Messaging/UpdateBlurb") + .setHttpMethod("PATCH") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/{blurb.name=rooms/*/blurbs/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "blurb.name", request.getBlurb().getName()); + return fields; + }) + .setAdditionalPaths("/v1beta1/{blurb.name=users/*/profile/blurbs/*}") + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "updateMask", request.getUpdateMask()); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create().toBody("blurb", request.getBlurb(), false)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Blurb.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor deleteBlurbMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.showcase.v1beta1.Messaging/DeleteBlurb") + .setHttpMethod("DELETE") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/{name=rooms/*/blurbs/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setAdditionalPaths("/v1beta1/{name=users/*/profile/blurbs/*}") + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Empty.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + listBlurbsMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.showcase.v1beta1.Messaging/ListBlurbs") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/{parent=rooms/*}/blurbs", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "parent", request.getParent()); + return fields; + }) + .setAdditionalPaths("/v1beta1/{parent=users/*/profile}/blurbs") + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "pageSize", request.getPageSize()); + serializer.putQueryParam(fields, "pageToken", request.getPageToken()); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(ListBlurbsResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + searchBlurbsMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.showcase.v1beta1.Messaging/SearchBlurbs") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/{parent=rooms/*}/blurbs:search", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "parent", request.getParent()); + return fields; + }) + .setAdditionalPaths("/v1beta1/{parent=users/*/profile}/blurbs:search") + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("*", request.toBuilder().clearParent().build(), false)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Operation.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .setOperationSnapshotFactory( + (SearchBlurbsRequest request, Operation response) -> + HttpJsonOperationSnapshot.create(response)) + .build(); + + private static final ApiMethodDescriptor + streamBlurbsMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.showcase.v1beta1.Messaging/StreamBlurbs") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.SERVER_STREAMING) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/{name=rooms/*}/blurbs:stream", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setAdditionalPaths("/v1beta1/{name=users/*/profile}/blurbs:stream") + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("*", request.toBuilder().clearName().build(), false)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(StreamBlurbsResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + listLocationsMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.location.Locations/ListLocations") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/{name=projects/*}/locations", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(ListLocationsResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + getLocationMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.location.Locations/GetLocation") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/{name=projects/*/locations/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Location.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + setIamPolicyMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.iam.v1.IAMPolicy/SetIamPolicy") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/{resource=users/*}:setIamPolicy", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "resource", request.getResource()); + return fields; + }) + .setAdditionalPaths( + "/v1beta1/{resource=rooms/*}:setIamPolicy", + "/v1beta1/{resource=rooms/*/blurbs/*}:setIamPolicy", + "/v1beta1/{resource=sequences/*}:setIamPolicy") + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("*", request.toBuilder().clearResource().build(), false)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Policy.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + getIamPolicyMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.iam.v1.IAMPolicy/GetIamPolicy") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/{resource=users/*}:getIamPolicy", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "resource", request.getResource()); + return fields; + }) + .setAdditionalPaths( + "/v1beta1/{resource=rooms/*}:getIamPolicy", + "/v1beta1/{resource=rooms/*/blurbs/*}:getIamPolicy", + "/v1beta1/{resource=sequences/*}:getIamPolicy") + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Policy.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + testIamPermissionsMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.iam.v1.IAMPolicy/TestIamPermissions") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/{resource=users/*}:testIamPermissions", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "resource", request.getResource()); + return fields; + }) + .setAdditionalPaths( + "/v1beta1/{resource=rooms/*}:testIamPermissions", + "/v1beta1/{resource=rooms/*/blurbs/*}:testIamPermissions", + "/v1beta1/{resource=sequences/*}:testIamPermissions") + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("*", request.toBuilder().clearResource().build(), false)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(TestIamPermissionsResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private final UnaryCallable createRoomCallable; + private final UnaryCallable getRoomCallable; + private final UnaryCallable updateRoomCallable; + private final UnaryCallable deleteRoomCallable; + private final UnaryCallable listRoomsCallable; + private final UnaryCallable listRoomsPagedCallable; + private final UnaryCallable createBlurbCallable; + private final UnaryCallable getBlurbCallable; + private final UnaryCallable updateBlurbCallable; + private final UnaryCallable deleteBlurbCallable; + private final UnaryCallable listBlurbsCallable; + private final UnaryCallable listBlurbsPagedCallable; + private final UnaryCallable searchBlurbsCallable; + private final OperationCallable + searchBlurbsOperationCallable; + private final ServerStreamingCallable + streamBlurbsCallable; + private final UnaryCallable listLocationsCallable; + private final UnaryCallable + listLocationsPagedCallable; + private final UnaryCallable getLocationCallable; + private final UnaryCallable setIamPolicyCallable; + private final UnaryCallable getIamPolicyCallable; + private final UnaryCallable + testIamPermissionsCallable; + + private final BackgroundResource backgroundResources; + private final HttpJsonOperationsStub httpJsonOperationsStub; + private final HttpJsonStubCallableFactory callableFactory; + + public static final HttpJsonMessagingStub create(MessagingStubSettings settings) + throws IOException { + return new HttpJsonMessagingStub(settings, ClientContext.create(settings)); + } + + public static final HttpJsonMessagingStub create(ClientContext clientContext) throws IOException { + return new HttpJsonMessagingStub( + MessagingStubSettings.newHttpJsonBuilder().build(), clientContext); + } + + public static final HttpJsonMessagingStub create( + ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { + return new HttpJsonMessagingStub( + MessagingStubSettings.newHttpJsonBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of HttpJsonMessagingStub, 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 HttpJsonMessagingStub(MessagingStubSettings settings, ClientContext clientContext) + throws IOException { + this(settings, clientContext, new HttpJsonMessagingCallableFactory()); + } + + /** + * Constructs an instance of HttpJsonMessagingStub, 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 HttpJsonMessagingStub( + MessagingStubSettings settings, + ClientContext clientContext, + HttpJsonStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + this.httpJsonOperationsStub = + HttpJsonOperationsStub.create( + clientContext, + callableFactory, + typeRegistry, + ImmutableMap.builder() + .put( + "google.longrunning.Operations.CancelOperation", + HttpRule.newBuilder().setPost("/v1beta1/{name=operations/**}:cancel").build()) + .put( + "google.longrunning.Operations.DeleteOperation", + HttpRule.newBuilder().setDelete("/v1beta1/{name=operations/**}").build()) + .put( + "google.longrunning.Operations.GetOperation", + HttpRule.newBuilder().setGet("/v1beta1/{name=operations/**}").build()) + .put( + "google.longrunning.Operations.ListOperations", + HttpRule.newBuilder().setGet("/v1beta1/operations").build()) + .build()); + + HttpJsonCallSettings createRoomTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(createRoomMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings getRoomTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getRoomMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings updateRoomTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(updateRoomMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("room.name", String.valueOf(request.getRoom().getName())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings deleteRoomTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(deleteRoomMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings listRoomsTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(listRoomsMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings createBlurbTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(createBlurbMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings getBlurbTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getBlurbMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings updateBlurbTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(updateBlurbMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("blurb.name", String.valueOf(request.getBlurb().getName())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings deleteBlurbTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(deleteBlurbMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings listBlurbsTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(listBlurbsMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings searchBlurbsTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(searchBlurbsMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings streamBlurbsTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(streamBlurbsMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings + listLocationsTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(listLocationsMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings getLocationTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getLocationMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings setIamPolicyTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(setIamPolicyMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("resource", String.valueOf(request.getResource())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings getIamPolicyTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getIamPolicyMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("resource", String.valueOf(request.getResource())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings + testIamPermissionsTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(testIamPermissionsMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("resource", String.valueOf(request.getResource())); + return builder.build(); + }) + .build(); + + this.createRoomCallable = + callableFactory.createUnaryCallable( + createRoomTransportSettings, settings.createRoomSettings(), clientContext); + this.getRoomCallable = + callableFactory.createUnaryCallable( + getRoomTransportSettings, settings.getRoomSettings(), clientContext); + this.updateRoomCallable = + callableFactory.createUnaryCallable( + updateRoomTransportSettings, settings.updateRoomSettings(), clientContext); + this.deleteRoomCallable = + callableFactory.createUnaryCallable( + deleteRoomTransportSettings, settings.deleteRoomSettings(), clientContext); + this.listRoomsCallable = + callableFactory.createUnaryCallable( + listRoomsTransportSettings, settings.listRoomsSettings(), clientContext); + this.listRoomsPagedCallable = + callableFactory.createPagedCallable( + listRoomsTransportSettings, settings.listRoomsSettings(), clientContext); + this.createBlurbCallable = + callableFactory.createUnaryCallable( + createBlurbTransportSettings, settings.createBlurbSettings(), clientContext); + this.getBlurbCallable = + callableFactory.createUnaryCallable( + getBlurbTransportSettings, settings.getBlurbSettings(), clientContext); + this.updateBlurbCallable = + callableFactory.createUnaryCallable( + updateBlurbTransportSettings, settings.updateBlurbSettings(), clientContext); + this.deleteBlurbCallable = + callableFactory.createUnaryCallable( + deleteBlurbTransportSettings, settings.deleteBlurbSettings(), clientContext); + this.listBlurbsCallable = + callableFactory.createUnaryCallable( + listBlurbsTransportSettings, settings.listBlurbsSettings(), clientContext); + this.listBlurbsPagedCallable = + callableFactory.createPagedCallable( + listBlurbsTransportSettings, settings.listBlurbsSettings(), clientContext); + this.searchBlurbsCallable = + callableFactory.createUnaryCallable( + searchBlurbsTransportSettings, settings.searchBlurbsSettings(), clientContext); + this.searchBlurbsOperationCallable = + callableFactory.createOperationCallable( + searchBlurbsTransportSettings, + settings.searchBlurbsOperationSettings(), + clientContext, + httpJsonOperationsStub); + this.streamBlurbsCallable = + callableFactory.createServerStreamingCallable( + streamBlurbsTransportSettings, settings.streamBlurbsSettings(), clientContext); + this.listLocationsCallable = + callableFactory.createUnaryCallable( + listLocationsTransportSettings, settings.listLocationsSettings(), clientContext); + this.listLocationsPagedCallable = + callableFactory.createPagedCallable( + listLocationsTransportSettings, settings.listLocationsSettings(), clientContext); + this.getLocationCallable = + callableFactory.createUnaryCallable( + getLocationTransportSettings, settings.getLocationSettings(), clientContext); + this.setIamPolicyCallable = + callableFactory.createUnaryCallable( + setIamPolicyTransportSettings, settings.setIamPolicySettings(), clientContext); + this.getIamPolicyCallable = + callableFactory.createUnaryCallable( + getIamPolicyTransportSettings, settings.getIamPolicySettings(), clientContext); + this.testIamPermissionsCallable = + callableFactory.createUnaryCallable( + testIamPermissionsTransportSettings, + settings.testIamPermissionsSettings(), + clientContext); + + this.backgroundResources = + new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + @InternalApi + public static List getMethodDescriptors() { + List methodDescriptors = new ArrayList<>(); + methodDescriptors.add(createRoomMethodDescriptor); + methodDescriptors.add(getRoomMethodDescriptor); + methodDescriptors.add(updateRoomMethodDescriptor); + methodDescriptors.add(deleteRoomMethodDescriptor); + methodDescriptors.add(listRoomsMethodDescriptor); + methodDescriptors.add(createBlurbMethodDescriptor); + methodDescriptors.add(getBlurbMethodDescriptor); + methodDescriptors.add(updateBlurbMethodDescriptor); + methodDescriptors.add(deleteBlurbMethodDescriptor); + methodDescriptors.add(listBlurbsMethodDescriptor); + methodDescriptors.add(searchBlurbsMethodDescriptor); + methodDescriptors.add(streamBlurbsMethodDescriptor); + methodDescriptors.add(listLocationsMethodDescriptor); + methodDescriptors.add(getLocationMethodDescriptor); + methodDescriptors.add(setIamPolicyMethodDescriptor); + methodDescriptors.add(getIamPolicyMethodDescriptor); + methodDescriptors.add(testIamPermissionsMethodDescriptor); + return methodDescriptors; + } + + public HttpJsonOperationsStub getHttpJsonOperationsStub() { + return httpJsonOperationsStub; + } + + @Override + public UnaryCallable createRoomCallable() { + return createRoomCallable; + } + + @Override + public UnaryCallable getRoomCallable() { + return getRoomCallable; + } + + @Override + public UnaryCallable updateRoomCallable() { + return updateRoomCallable; + } + + @Override + public UnaryCallable deleteRoomCallable() { + return deleteRoomCallable; + } + + @Override + public UnaryCallable listRoomsCallable() { + return listRoomsCallable; + } + + @Override + public UnaryCallable listRoomsPagedCallable() { + return listRoomsPagedCallable; + } + + @Override + public UnaryCallable createBlurbCallable() { + return createBlurbCallable; + } + + @Override + public UnaryCallable getBlurbCallable() { + return getBlurbCallable; + } + + @Override + public UnaryCallable updateBlurbCallable() { + return updateBlurbCallable; + } + + @Override + public UnaryCallable deleteBlurbCallable() { + return deleteBlurbCallable; + } + + @Override + public UnaryCallable listBlurbsCallable() { + return listBlurbsCallable; + } + + @Override + public UnaryCallable listBlurbsPagedCallable() { + return listBlurbsPagedCallable; + } + + @Override + public UnaryCallable searchBlurbsCallable() { + return searchBlurbsCallable; + } + + @Override + public OperationCallable + searchBlurbsOperationCallable() { + return searchBlurbsOperationCallable; + } + + @Override + public ServerStreamingCallable streamBlurbsCallable() { + return streamBlurbsCallable; + } + + @Override + public UnaryCallable listLocationsCallable() { + return listLocationsCallable; + } + + @Override + public UnaryCallable + listLocationsPagedCallable() { + return listLocationsPagedCallable; + } + + @Override + public UnaryCallable getLocationCallable() { + return getLocationCallable; + } + + @Override + public UnaryCallable setIamPolicyCallable() { + return setIamPolicyCallable; + } + + @Override + public UnaryCallable getIamPolicyCallable() { + return getIamPolicyCallable; + } + + @Override + public UnaryCallable + testIamPermissionsCallable() { + return testIamPermissionsCallable; + } + + @Override + public ClientStreamingCallable sendBlurbsCallable() { + throw new UnsupportedOperationException( + "Not implemented: sendBlurbsCallable(). REST transport is not implemented for this method" + + " yet."); + } + + @Override + public BidiStreamingCallable connectCallable() { + throw new UnsupportedOperationException( + "Not implemented: connectCallable(). REST transport is not implemented for this method" + + " yet."); + } + + @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-showcase-3.25.8/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/HttpJsonSequenceServiceCallableFactory.java b/java-showcase-3.25.8/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/HttpJsonSequenceServiceCallableFactory.java new file mode 100644 index 0000000000..9f2c729229 --- /dev/null +++ b/java-showcase-3.25.8/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/HttpJsonSequenceServiceCallableFactory.java @@ -0,0 +1,103 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.stub; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.HttpJsonCallSettings; +import com.google.api.gax.httpjson.HttpJsonCallableFactory; +import com.google.api.gax.httpjson.HttpJsonOperationSnapshotCallable; +import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; +import com.google.api.gax.httpjson.longrunning.stub.OperationsStub; +import com.google.api.gax.rpc.BatchingCallSettings; +import com.google.api.gax.rpc.ClientContext; +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.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.longrunning.Operation; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * REST callable factory implementation for the SequenceService service API. + * + *

        This class is for advanced usage. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class HttpJsonSequenceServiceCallableFactory + implements HttpJsonStubCallableFactory { + + @Override + public UnaryCallable createUnaryCallable( + HttpJsonCallSettings httpJsonCallSettings, + UnaryCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createUnaryCallable( + httpJsonCallSettings, callSettings, clientContext); + } + + @Override + public + UnaryCallable createPagedCallable( + HttpJsonCallSettings httpJsonCallSettings, + PagedCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createPagedCallable( + httpJsonCallSettings, callSettings, clientContext); + } + + @Override + public UnaryCallable createBatchingCallable( + HttpJsonCallSettings httpJsonCallSettings, + BatchingCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createBatchingCallable( + httpJsonCallSettings, callSettings, clientContext); + } + + @Override + public + OperationCallable createOperationCallable( + HttpJsonCallSettings httpJsonCallSettings, + OperationCallSettings callSettings, + ClientContext clientContext, + OperationsStub operationsStub) { + UnaryCallable innerCallable = + HttpJsonCallableFactory.createBaseUnaryCallable( + httpJsonCallSettings, callSettings.getInitialCallSettings(), clientContext); + HttpJsonOperationSnapshotCallable initialCallable = + new HttpJsonOperationSnapshotCallable( + innerCallable, + httpJsonCallSettings.getMethodDescriptor().getOperationSnapshotFactory()); + return HttpJsonCallableFactory.createOperationCallable( + callSettings, clientContext, operationsStub.longRunningClient(), initialCallable); + } + + @Override + public + ServerStreamingCallable createServerStreamingCallable( + HttpJsonCallSettings httpJsonCallSettings, + ServerStreamingCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createServerStreamingCallable( + httpJsonCallSettings, callSettings, clientContext); + } +} diff --git a/java-showcase-3.25.8/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/HttpJsonSequenceServiceStub.java b/java-showcase-3.25.8/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/HttpJsonSequenceServiceStub.java new file mode 100644 index 0000000000..2c7a3b5e26 --- /dev/null +++ b/java-showcase-3.25.8/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/HttpJsonSequenceServiceStub.java @@ -0,0 +1,820 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.stub; + +import static com.google.showcase.v1beta1.SequenceServiceClient.ListLocationsPagedResponse; + +import com.google.api.core.BetaApi; +import com.google.api.core.InternalApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.httpjson.ApiMethodDescriptor; +import com.google.api.gax.httpjson.HttpJsonCallSettings; +import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; +import com.google.api.gax.httpjson.ProtoMessageRequestFormatter; +import com.google.api.gax.httpjson.ProtoMessageResponseParser; +import com.google.api.gax.httpjson.ProtoRestSerializer; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.RequestParamsBuilder; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.protobuf.Empty; +import com.google.protobuf.TypeRegistry; +import com.google.showcase.v1beta1.AttemptSequenceRequest; +import com.google.showcase.v1beta1.AttemptStreamingSequenceRequest; +import com.google.showcase.v1beta1.AttemptStreamingSequenceResponse; +import com.google.showcase.v1beta1.CreateSequenceRequest; +import com.google.showcase.v1beta1.CreateStreamingSequenceRequest; +import com.google.showcase.v1beta1.GetSequenceReportRequest; +import com.google.showcase.v1beta1.GetStreamingSequenceReportRequest; +import com.google.showcase.v1beta1.Sequence; +import com.google.showcase.v1beta1.SequenceReport; +import com.google.showcase.v1beta1.StreamingSequence; +import com.google.showcase.v1beta1.StreamingSequenceReport; +import java.io.IOException; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * REST stub implementation for the SequenceService service API. + * + *

        This class is for advanced usage and reflects the underlying API directly. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class HttpJsonSequenceServiceStub extends SequenceServiceStub { + private static final TypeRegistry typeRegistry = TypeRegistry.newBuilder().build(); + + private static final ApiMethodDescriptor + createSequenceMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.showcase.v1beta1.SequenceService/CreateSequence") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/sequences", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("sequence", request.getSequence(), false)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Sequence.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + createStreamingSequenceMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.showcase.v1beta1.SequenceService/CreateStreamingSequence") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/streamingSequences", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody( + "streamingSequence", request.getStreamingSequence(), false)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(StreamingSequence.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + getSequenceReportMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.showcase.v1beta1.SequenceService/GetSequenceReport") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/{name=sequences/*/sequenceReport}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(SequenceReport.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor< + GetStreamingSequenceReportRequest, StreamingSequenceReport> + getStreamingSequenceReportMethodDescriptor = + ApiMethodDescriptor + .newBuilder() + .setFullMethodName( + "google.showcase.v1beta1.SequenceService/GetStreamingSequenceReport") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/{name=streamingSequences/*/streamingSequenceReport}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(StreamingSequenceReport.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + attemptSequenceMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.showcase.v1beta1.SequenceService/AttemptSequence") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/{name=sequences/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("*", request.toBuilder().clearName().build(), false)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Empty.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor< + AttemptStreamingSequenceRequest, AttemptStreamingSequenceResponse> + attemptStreamingSequenceMethodDescriptor = + ApiMethodDescriptor + .newBuilder() + .setFullMethodName("google.showcase.v1beta1.SequenceService/AttemptStreamingSequence") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.SERVER_STREAMING) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/{name=streamingSequences/*}:stream", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("*", request.toBuilder().clearName().build(), false)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(AttemptStreamingSequenceResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + listLocationsMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.location.Locations/ListLocations") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/{name=projects/*}/locations", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(ListLocationsResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + getLocationMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.location.Locations/GetLocation") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/{name=projects/*/locations/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Location.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + setIamPolicyMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.iam.v1.IAMPolicy/SetIamPolicy") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/{resource=users/*}:setIamPolicy", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "resource", request.getResource()); + return fields; + }) + .setAdditionalPaths( + "/v1beta1/{resource=rooms/*}:setIamPolicy", + "/v1beta1/{resource=rooms/*/blurbs/*}:setIamPolicy", + "/v1beta1/{resource=sequences/*}:setIamPolicy") + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("*", request.toBuilder().clearResource().build(), false)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Policy.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + getIamPolicyMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.iam.v1.IAMPolicy/GetIamPolicy") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/{resource=users/*}:getIamPolicy", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "resource", request.getResource()); + return fields; + }) + .setAdditionalPaths( + "/v1beta1/{resource=rooms/*}:getIamPolicy", + "/v1beta1/{resource=rooms/*/blurbs/*}:getIamPolicy", + "/v1beta1/{resource=sequences/*}:getIamPolicy") + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Policy.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + testIamPermissionsMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.iam.v1.IAMPolicy/TestIamPermissions") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/{resource=users/*}:testIamPermissions", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "resource", request.getResource()); + return fields; + }) + .setAdditionalPaths( + "/v1beta1/{resource=rooms/*}:testIamPermissions", + "/v1beta1/{resource=rooms/*/blurbs/*}:testIamPermissions", + "/v1beta1/{resource=sequences/*}:testIamPermissions") + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("*", request.toBuilder().clearResource().build(), false)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(TestIamPermissionsResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private final UnaryCallable createSequenceCallable; + private final UnaryCallable + createStreamingSequenceCallable; + private final UnaryCallable getSequenceReportCallable; + private final UnaryCallable + getStreamingSequenceReportCallable; + private final UnaryCallable attemptSequenceCallable; + private final ServerStreamingCallable< + AttemptStreamingSequenceRequest, AttemptStreamingSequenceResponse> + attemptStreamingSequenceCallable; + private final UnaryCallable listLocationsCallable; + private final UnaryCallable + listLocationsPagedCallable; + private final UnaryCallable getLocationCallable; + private final UnaryCallable setIamPolicyCallable; + private final UnaryCallable getIamPolicyCallable; + private final UnaryCallable + testIamPermissionsCallable; + + private final BackgroundResource backgroundResources; + private final HttpJsonStubCallableFactory callableFactory; + + public static final HttpJsonSequenceServiceStub create(SequenceServiceStubSettings settings) + throws IOException { + return new HttpJsonSequenceServiceStub(settings, ClientContext.create(settings)); + } + + public static final HttpJsonSequenceServiceStub create(ClientContext clientContext) + throws IOException { + return new HttpJsonSequenceServiceStub( + SequenceServiceStubSettings.newHttpJsonBuilder().build(), clientContext); + } + + public static final HttpJsonSequenceServiceStub create( + ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { + return new HttpJsonSequenceServiceStub( + SequenceServiceStubSettings.newHttpJsonBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of HttpJsonSequenceServiceStub, 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 HttpJsonSequenceServiceStub( + SequenceServiceStubSettings settings, ClientContext clientContext) throws IOException { + this(settings, clientContext, new HttpJsonSequenceServiceCallableFactory()); + } + + /** + * Constructs an instance of HttpJsonSequenceServiceStub, 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 HttpJsonSequenceServiceStub( + SequenceServiceStubSettings settings, + ClientContext clientContext, + HttpJsonStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + + HttpJsonCallSettings createSequenceTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(createSequenceMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings + createStreamingSequenceTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(createStreamingSequenceMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings + getSequenceReportTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getSequenceReportMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings + getStreamingSequenceReportTransportSettings = + HttpJsonCallSettings + .newBuilder() + .setMethodDescriptor(getStreamingSequenceReportMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings attemptSequenceTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(attemptSequenceMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings + attemptStreamingSequenceTransportSettings = + HttpJsonCallSettings + .newBuilder() + .setMethodDescriptor(attemptStreamingSequenceMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings + listLocationsTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(listLocationsMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings getLocationTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getLocationMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings setIamPolicyTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(setIamPolicyMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("resource", String.valueOf(request.getResource())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings getIamPolicyTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getIamPolicyMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("resource", String.valueOf(request.getResource())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings + testIamPermissionsTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(testIamPermissionsMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("resource", String.valueOf(request.getResource())); + return builder.build(); + }) + .build(); + + this.createSequenceCallable = + callableFactory.createUnaryCallable( + createSequenceTransportSettings, settings.createSequenceSettings(), clientContext); + this.createStreamingSequenceCallable = + callableFactory.createUnaryCallable( + createStreamingSequenceTransportSettings, + settings.createStreamingSequenceSettings(), + clientContext); + this.getSequenceReportCallable = + callableFactory.createUnaryCallable( + getSequenceReportTransportSettings, + settings.getSequenceReportSettings(), + clientContext); + this.getStreamingSequenceReportCallable = + callableFactory.createUnaryCallable( + getStreamingSequenceReportTransportSettings, + settings.getStreamingSequenceReportSettings(), + clientContext); + this.attemptSequenceCallable = + callableFactory.createUnaryCallable( + attemptSequenceTransportSettings, settings.attemptSequenceSettings(), clientContext); + this.attemptStreamingSequenceCallable = + callableFactory.createServerStreamingCallable( + attemptStreamingSequenceTransportSettings, + settings.attemptStreamingSequenceSettings(), + clientContext); + this.listLocationsCallable = + callableFactory.createUnaryCallable( + listLocationsTransportSettings, settings.listLocationsSettings(), clientContext); + this.listLocationsPagedCallable = + callableFactory.createPagedCallable( + listLocationsTransportSettings, settings.listLocationsSettings(), clientContext); + this.getLocationCallable = + callableFactory.createUnaryCallable( + getLocationTransportSettings, settings.getLocationSettings(), clientContext); + this.setIamPolicyCallable = + callableFactory.createUnaryCallable( + setIamPolicyTransportSettings, settings.setIamPolicySettings(), clientContext); + this.getIamPolicyCallable = + callableFactory.createUnaryCallable( + getIamPolicyTransportSettings, settings.getIamPolicySettings(), clientContext); + this.testIamPermissionsCallable = + callableFactory.createUnaryCallable( + testIamPermissionsTransportSettings, + settings.testIamPermissionsSettings(), + clientContext); + + this.backgroundResources = + new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + @InternalApi + public static List getMethodDescriptors() { + List methodDescriptors = new ArrayList<>(); + methodDescriptors.add(createSequenceMethodDescriptor); + methodDescriptors.add(createStreamingSequenceMethodDescriptor); + methodDescriptors.add(getSequenceReportMethodDescriptor); + methodDescriptors.add(getStreamingSequenceReportMethodDescriptor); + methodDescriptors.add(attemptSequenceMethodDescriptor); + methodDescriptors.add(attemptStreamingSequenceMethodDescriptor); + methodDescriptors.add(listLocationsMethodDescriptor); + methodDescriptors.add(getLocationMethodDescriptor); + methodDescriptors.add(setIamPolicyMethodDescriptor); + methodDescriptors.add(getIamPolicyMethodDescriptor); + methodDescriptors.add(testIamPermissionsMethodDescriptor); + return methodDescriptors; + } + + @Override + public UnaryCallable createSequenceCallable() { + return createSequenceCallable; + } + + @Override + public UnaryCallable + createStreamingSequenceCallable() { + return createStreamingSequenceCallable; + } + + @Override + public UnaryCallable getSequenceReportCallable() { + return getSequenceReportCallable; + } + + @Override + public UnaryCallable + getStreamingSequenceReportCallable() { + return getStreamingSequenceReportCallable; + } + + @Override + public UnaryCallable attemptSequenceCallable() { + return attemptSequenceCallable; + } + + @Override + public ServerStreamingCallable + attemptStreamingSequenceCallable() { + return attemptStreamingSequenceCallable; + } + + @Override + public UnaryCallable listLocationsCallable() { + return listLocationsCallable; + } + + @Override + public UnaryCallable + listLocationsPagedCallable() { + return listLocationsPagedCallable; + } + + @Override + public UnaryCallable getLocationCallable() { + return getLocationCallable; + } + + @Override + public UnaryCallable setIamPolicyCallable() { + return setIamPolicyCallable; + } + + @Override + public UnaryCallable getIamPolicyCallable() { + return getIamPolicyCallable; + } + + @Override + public UnaryCallable + testIamPermissionsCallable() { + return testIamPermissionsCallable; + } + + @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-showcase-3.25.8/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/HttpJsonTestingCallableFactory.java b/java-showcase-3.25.8/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/HttpJsonTestingCallableFactory.java new file mode 100644 index 0000000000..fc3e0297b0 --- /dev/null +++ b/java-showcase-3.25.8/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/HttpJsonTestingCallableFactory.java @@ -0,0 +1,103 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.stub; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.HttpJsonCallSettings; +import com.google.api.gax.httpjson.HttpJsonCallableFactory; +import com.google.api.gax.httpjson.HttpJsonOperationSnapshotCallable; +import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; +import com.google.api.gax.httpjson.longrunning.stub.OperationsStub; +import com.google.api.gax.rpc.BatchingCallSettings; +import com.google.api.gax.rpc.ClientContext; +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.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.longrunning.Operation; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * REST callable factory implementation for the Testing service API. + * + *

        This class is for advanced usage. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class HttpJsonTestingCallableFactory + implements HttpJsonStubCallableFactory { + + @Override + public UnaryCallable createUnaryCallable( + HttpJsonCallSettings httpJsonCallSettings, + UnaryCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createUnaryCallable( + httpJsonCallSettings, callSettings, clientContext); + } + + @Override + public + UnaryCallable createPagedCallable( + HttpJsonCallSettings httpJsonCallSettings, + PagedCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createPagedCallable( + httpJsonCallSettings, callSettings, clientContext); + } + + @Override + public UnaryCallable createBatchingCallable( + HttpJsonCallSettings httpJsonCallSettings, + BatchingCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createBatchingCallable( + httpJsonCallSettings, callSettings, clientContext); + } + + @Override + public + OperationCallable createOperationCallable( + HttpJsonCallSettings httpJsonCallSettings, + OperationCallSettings callSettings, + ClientContext clientContext, + OperationsStub operationsStub) { + UnaryCallable innerCallable = + HttpJsonCallableFactory.createBaseUnaryCallable( + httpJsonCallSettings, callSettings.getInitialCallSettings(), clientContext); + HttpJsonOperationSnapshotCallable initialCallable = + new HttpJsonOperationSnapshotCallable( + innerCallable, + httpJsonCallSettings.getMethodDescriptor().getOperationSnapshotFactory()); + return HttpJsonCallableFactory.createOperationCallable( + callSettings, clientContext, operationsStub.longRunningClient(), initialCallable); + } + + @Override + public + ServerStreamingCallable createServerStreamingCallable( + HttpJsonCallSettings httpJsonCallSettings, + ServerStreamingCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createServerStreamingCallable( + httpJsonCallSettings, callSettings, clientContext); + } +} diff --git a/java-showcase-3.25.8/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/HttpJsonTestingStub.java b/java-showcase-3.25.8/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/HttpJsonTestingStub.java new file mode 100644 index 0000000000..11d87107de --- /dev/null +++ b/java-showcase-3.25.8/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/HttpJsonTestingStub.java @@ -0,0 +1,916 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.stub; + +import static com.google.showcase.v1beta1.TestingClient.ListLocationsPagedResponse; +import static com.google.showcase.v1beta1.TestingClient.ListSessionsPagedResponse; +import static com.google.showcase.v1beta1.TestingClient.ListTestsPagedResponse; + +import com.google.api.core.BetaApi; +import com.google.api.core.InternalApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.httpjson.ApiMethodDescriptor; +import com.google.api.gax.httpjson.HttpJsonCallSettings; +import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; +import com.google.api.gax.httpjson.ProtoMessageRequestFormatter; +import com.google.api.gax.httpjson.ProtoMessageResponseParser; +import com.google.api.gax.httpjson.ProtoRestSerializer; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.RequestParamsBuilder; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.protobuf.Empty; +import com.google.protobuf.TypeRegistry; +import com.google.showcase.v1beta1.CreateSessionRequest; +import com.google.showcase.v1beta1.DeleteSessionRequest; +import com.google.showcase.v1beta1.DeleteTestRequest; +import com.google.showcase.v1beta1.GetSessionRequest; +import com.google.showcase.v1beta1.ListSessionsRequest; +import com.google.showcase.v1beta1.ListSessionsResponse; +import com.google.showcase.v1beta1.ListTestsRequest; +import com.google.showcase.v1beta1.ListTestsResponse; +import com.google.showcase.v1beta1.ReportSessionRequest; +import com.google.showcase.v1beta1.ReportSessionResponse; +import com.google.showcase.v1beta1.Session; +import com.google.showcase.v1beta1.VerifyTestRequest; +import com.google.showcase.v1beta1.VerifyTestResponse; +import java.io.IOException; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * REST stub implementation for the Testing service API. + * + *

        This class is for advanced usage and reflects the underlying API directly. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class HttpJsonTestingStub extends TestingStub { + private static final TypeRegistry typeRegistry = TypeRegistry.newBuilder().build(); + + private static final ApiMethodDescriptor + createSessionMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.showcase.v1beta1.Testing/CreateSession") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/sessions", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("session", request.getSession(), false)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Session.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor getSessionMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.showcase.v1beta1.Testing/GetSession") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/{name=sessions/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Session.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + listSessionsMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.showcase.v1beta1.Testing/ListSessions") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/sessions", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "pageSize", request.getPageSize()); + serializer.putQueryParam(fields, "pageToken", request.getPageToken()); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(ListSessionsResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + deleteSessionMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.showcase.v1beta1.Testing/DeleteSession") + .setHttpMethod("DELETE") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/{name=sessions/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Empty.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + reportSessionMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.showcase.v1beta1.Testing/ReportSession") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/{name=sessions/*}:report", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(ReportSessionResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + listTestsMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.showcase.v1beta1.Testing/ListTests") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/{parent=sessions/*}/tests", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "parent", request.getParent()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "pageSize", request.getPageSize()); + serializer.putQueryParam(fields, "pageToken", request.getPageToken()); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(ListTestsResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor deleteTestMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.showcase.v1beta1.Testing/DeleteTest") + .setHttpMethod("DELETE") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/{name=sessions/*/tests/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Empty.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + verifyTestMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.showcase.v1beta1.Testing/VerifyTest") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/{name=sessions/*/tests/*}:check", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "answer", request.getAnswer()); + serializer.putQueryParam(fields, "answers", request.getAnswersList()); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(VerifyTestResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + listLocationsMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.location.Locations/ListLocations") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/{name=projects/*}/locations", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(ListLocationsResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + getLocationMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.location.Locations/GetLocation") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/{name=projects/*/locations/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Location.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + setIamPolicyMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.iam.v1.IAMPolicy/SetIamPolicy") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/{resource=users/*}:setIamPolicy", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "resource", request.getResource()); + return fields; + }) + .setAdditionalPaths( + "/v1beta1/{resource=rooms/*}:setIamPolicy", + "/v1beta1/{resource=rooms/*/blurbs/*}:setIamPolicy", + "/v1beta1/{resource=sequences/*}:setIamPolicy") + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("*", request.toBuilder().clearResource().build(), false)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Policy.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + getIamPolicyMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.iam.v1.IAMPolicy/GetIamPolicy") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/{resource=users/*}:getIamPolicy", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "resource", request.getResource()); + return fields; + }) + .setAdditionalPaths( + "/v1beta1/{resource=rooms/*}:getIamPolicy", + "/v1beta1/{resource=rooms/*/blurbs/*}:getIamPolicy", + "/v1beta1/{resource=sequences/*}:getIamPolicy") + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Policy.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + testIamPermissionsMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.iam.v1.IAMPolicy/TestIamPermissions") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/{resource=users/*}:testIamPermissions", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "resource", request.getResource()); + return fields; + }) + .setAdditionalPaths( + "/v1beta1/{resource=rooms/*}:testIamPermissions", + "/v1beta1/{resource=rooms/*/blurbs/*}:testIamPermissions", + "/v1beta1/{resource=sequences/*}:testIamPermissions") + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("*", request.toBuilder().clearResource().build(), false)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(TestIamPermissionsResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private final UnaryCallable createSessionCallable; + private final UnaryCallable getSessionCallable; + private final UnaryCallable listSessionsCallable; + private final UnaryCallable + listSessionsPagedCallable; + private final UnaryCallable deleteSessionCallable; + private final UnaryCallable reportSessionCallable; + private final UnaryCallable listTestsCallable; + private final UnaryCallable listTestsPagedCallable; + private final UnaryCallable deleteTestCallable; + private final UnaryCallable verifyTestCallable; + private final UnaryCallable listLocationsCallable; + private final UnaryCallable + listLocationsPagedCallable; + private final UnaryCallable getLocationCallable; + private final UnaryCallable setIamPolicyCallable; + private final UnaryCallable getIamPolicyCallable; + private final UnaryCallable + testIamPermissionsCallable; + + private final BackgroundResource backgroundResources; + private final HttpJsonStubCallableFactory callableFactory; + + public static final HttpJsonTestingStub create(TestingStubSettings settings) throws IOException { + return new HttpJsonTestingStub(settings, ClientContext.create(settings)); + } + + public static final HttpJsonTestingStub create(ClientContext clientContext) throws IOException { + return new HttpJsonTestingStub(TestingStubSettings.newHttpJsonBuilder().build(), clientContext); + } + + public static final HttpJsonTestingStub create( + ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { + return new HttpJsonTestingStub( + TestingStubSettings.newHttpJsonBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of HttpJsonTestingStub, 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 HttpJsonTestingStub(TestingStubSettings settings, ClientContext clientContext) + throws IOException { + this(settings, clientContext, new HttpJsonTestingCallableFactory()); + } + + /** + * Constructs an instance of HttpJsonTestingStub, 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 HttpJsonTestingStub( + TestingStubSettings settings, + ClientContext clientContext, + HttpJsonStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + + HttpJsonCallSettings createSessionTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(createSessionMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings getSessionTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getSessionMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings listSessionsTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(listSessionsMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings deleteSessionTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(deleteSessionMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings + reportSessionTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(reportSessionMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings listTestsTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(listTestsMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings deleteTestTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(deleteTestMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings verifyTestTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(verifyTestMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings + listLocationsTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(listLocationsMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings getLocationTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getLocationMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings setIamPolicyTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(setIamPolicyMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("resource", String.valueOf(request.getResource())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings getIamPolicyTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getIamPolicyMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("resource", String.valueOf(request.getResource())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings + testIamPermissionsTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(testIamPermissionsMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("resource", String.valueOf(request.getResource())); + return builder.build(); + }) + .build(); + + this.createSessionCallable = + callableFactory.createUnaryCallable( + createSessionTransportSettings, settings.createSessionSettings(), clientContext); + this.getSessionCallable = + callableFactory.createUnaryCallable( + getSessionTransportSettings, settings.getSessionSettings(), clientContext); + this.listSessionsCallable = + callableFactory.createUnaryCallable( + listSessionsTransportSettings, settings.listSessionsSettings(), clientContext); + this.listSessionsPagedCallable = + callableFactory.createPagedCallable( + listSessionsTransportSettings, settings.listSessionsSettings(), clientContext); + this.deleteSessionCallable = + callableFactory.createUnaryCallable( + deleteSessionTransportSettings, settings.deleteSessionSettings(), clientContext); + this.reportSessionCallable = + callableFactory.createUnaryCallable( + reportSessionTransportSettings, settings.reportSessionSettings(), clientContext); + this.listTestsCallable = + callableFactory.createUnaryCallable( + listTestsTransportSettings, settings.listTestsSettings(), clientContext); + this.listTestsPagedCallable = + callableFactory.createPagedCallable( + listTestsTransportSettings, settings.listTestsSettings(), clientContext); + this.deleteTestCallable = + callableFactory.createUnaryCallable( + deleteTestTransportSettings, settings.deleteTestSettings(), clientContext); + this.verifyTestCallable = + callableFactory.createUnaryCallable( + verifyTestTransportSettings, settings.verifyTestSettings(), clientContext); + this.listLocationsCallable = + callableFactory.createUnaryCallable( + listLocationsTransportSettings, settings.listLocationsSettings(), clientContext); + this.listLocationsPagedCallable = + callableFactory.createPagedCallable( + listLocationsTransportSettings, settings.listLocationsSettings(), clientContext); + this.getLocationCallable = + callableFactory.createUnaryCallable( + getLocationTransportSettings, settings.getLocationSettings(), clientContext); + this.setIamPolicyCallable = + callableFactory.createUnaryCallable( + setIamPolicyTransportSettings, settings.setIamPolicySettings(), clientContext); + this.getIamPolicyCallable = + callableFactory.createUnaryCallable( + getIamPolicyTransportSettings, settings.getIamPolicySettings(), clientContext); + this.testIamPermissionsCallable = + callableFactory.createUnaryCallable( + testIamPermissionsTransportSettings, + settings.testIamPermissionsSettings(), + clientContext); + + this.backgroundResources = + new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + @InternalApi + public static List getMethodDescriptors() { + List methodDescriptors = new ArrayList<>(); + methodDescriptors.add(createSessionMethodDescriptor); + methodDescriptors.add(getSessionMethodDescriptor); + methodDescriptors.add(listSessionsMethodDescriptor); + methodDescriptors.add(deleteSessionMethodDescriptor); + methodDescriptors.add(reportSessionMethodDescriptor); + methodDescriptors.add(listTestsMethodDescriptor); + methodDescriptors.add(deleteTestMethodDescriptor); + methodDescriptors.add(verifyTestMethodDescriptor); + methodDescriptors.add(listLocationsMethodDescriptor); + methodDescriptors.add(getLocationMethodDescriptor); + methodDescriptors.add(setIamPolicyMethodDescriptor); + methodDescriptors.add(getIamPolicyMethodDescriptor); + methodDescriptors.add(testIamPermissionsMethodDescriptor); + return methodDescriptors; + } + + @Override + public UnaryCallable createSessionCallable() { + return createSessionCallable; + } + + @Override + public UnaryCallable getSessionCallable() { + return getSessionCallable; + } + + @Override + public UnaryCallable listSessionsCallable() { + return listSessionsCallable; + } + + @Override + public UnaryCallable listSessionsPagedCallable() { + return listSessionsPagedCallable; + } + + @Override + public UnaryCallable deleteSessionCallable() { + return deleteSessionCallable; + } + + @Override + public UnaryCallable reportSessionCallable() { + return reportSessionCallable; + } + + @Override + public UnaryCallable listTestsCallable() { + return listTestsCallable; + } + + @Override + public UnaryCallable listTestsPagedCallable() { + return listTestsPagedCallable; + } + + @Override + public UnaryCallable deleteTestCallable() { + return deleteTestCallable; + } + + @Override + public UnaryCallable verifyTestCallable() { + return verifyTestCallable; + } + + @Override + public UnaryCallable listLocationsCallable() { + return listLocationsCallable; + } + + @Override + public UnaryCallable + listLocationsPagedCallable() { + return listLocationsPagedCallable; + } + + @Override + public UnaryCallable getLocationCallable() { + return getLocationCallable; + } + + @Override + public UnaryCallable setIamPolicyCallable() { + return setIamPolicyCallable; + } + + @Override + public UnaryCallable getIamPolicyCallable() { + return getIamPolicyCallable; + } + + @Override + public UnaryCallable + testIamPermissionsCallable() { + return testIamPermissionsCallable; + } + + @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-showcase-3.25.8/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/IdentityStub.java b/java-showcase-3.25.8/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/IdentityStub.java new file mode 100644 index 0000000000..0993f240a7 --- /dev/null +++ b/java-showcase-3.25.8/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/IdentityStub.java @@ -0,0 +1,106 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.stub; + +import static com.google.showcase.v1beta1.IdentityClient.ListLocationsPagedResponse; +import static com.google.showcase.v1beta1.IdentityClient.ListUsersPagedResponse; + +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.protobuf.Empty; +import com.google.showcase.v1beta1.CreateUserRequest; +import com.google.showcase.v1beta1.DeleteUserRequest; +import com.google.showcase.v1beta1.GetUserRequest; +import com.google.showcase.v1beta1.ListUsersRequest; +import com.google.showcase.v1beta1.ListUsersResponse; +import com.google.showcase.v1beta1.UpdateUserRequest; +import com.google.showcase.v1beta1.User; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Base stub class for the Identity service API. + * + *

        This class is for advanced usage and reflects the underlying API directly. + */ +@BetaApi +@Generated("by gapic-generator-java") +public abstract class IdentityStub implements BackgroundResource { + + public UnaryCallable createUserCallable() { + throw new UnsupportedOperationException("Not implemented: createUserCallable()"); + } + + public UnaryCallable getUserCallable() { + throw new UnsupportedOperationException("Not implemented: getUserCallable()"); + } + + public UnaryCallable updateUserCallable() { + throw new UnsupportedOperationException("Not implemented: updateUserCallable()"); + } + + public UnaryCallable deleteUserCallable() { + throw new UnsupportedOperationException("Not implemented: deleteUserCallable()"); + } + + public UnaryCallable listUsersPagedCallable() { + throw new UnsupportedOperationException("Not implemented: listUsersPagedCallable()"); + } + + public UnaryCallable listUsersCallable() { + throw new UnsupportedOperationException("Not implemented: listUsersCallable()"); + } + + public UnaryCallable + listLocationsPagedCallable() { + throw new UnsupportedOperationException("Not implemented: listLocationsPagedCallable()"); + } + + public UnaryCallable listLocationsCallable() { + throw new UnsupportedOperationException("Not implemented: listLocationsCallable()"); + } + + public UnaryCallable getLocationCallable() { + throw new UnsupportedOperationException("Not implemented: getLocationCallable()"); + } + + public UnaryCallable setIamPolicyCallable() { + throw new UnsupportedOperationException("Not implemented: setIamPolicyCallable()"); + } + + public UnaryCallable getIamPolicyCallable() { + throw new UnsupportedOperationException("Not implemented: getIamPolicyCallable()"); + } + + public UnaryCallable + testIamPermissionsCallable() { + throw new UnsupportedOperationException("Not implemented: testIamPermissionsCallable()"); + } + + @Override + public abstract void close(); +} diff --git a/java-showcase-3.25.8/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/IdentityStubSettings.java b/java-showcase-3.25.8/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/IdentityStubSettings.java new file mode 100644 index 0000000000..3415264909 --- /dev/null +++ b/java-showcase-3.25.8/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/IdentityStubSettings.java @@ -0,0 +1,682 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.stub; + +import static com.google.showcase.v1beta1.IdentityClient.ListLocationsPagedResponse; +import static com.google.showcase.v1beta1.IdentityClient.ListUsersPagedResponse; + +import com.google.api.core.ApiFunction; +import com.google.api.core.ApiFuture; +import com.google.api.core.BetaApi; +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.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.HttpJsonTransportChannel; +import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; +import com.google.api.gax.retrying.RetrySettings; +import com.google.api.gax.rpc.ApiCallContext; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.PagedListDescriptor; +import com.google.api.gax.rpc.PagedListResponseFactory; +import com.google.api.gax.rpc.StatusCode; +import com.google.api.gax.rpc.StubSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +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.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.protobuf.Empty; +import com.google.showcase.v1beta1.CreateUserRequest; +import com.google.showcase.v1beta1.DeleteUserRequest; +import com.google.showcase.v1beta1.GetUserRequest; +import com.google.showcase.v1beta1.ListUsersRequest; +import com.google.showcase.v1beta1.ListUsersResponse; +import com.google.showcase.v1beta1.UpdateUserRequest; +import com.google.showcase.v1beta1.User; +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 IdentityStub}. + * + *

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

          + *
        • The default service address (localhost) and default port (7469) 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 createUser: + * + *

        {@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
        + * IdentityStubSettings.Builder identitySettingsBuilder = IdentityStubSettings.newBuilder();
        + * identitySettingsBuilder
        + *     .createUserSettings()
        + *     .setRetrySettings(
        + *         identitySettingsBuilder
        + *             .createUserSettings()
        + *             .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());
        + * IdentityStubSettings identitySettings = identitySettingsBuilder.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. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class IdentityStubSettings extends StubSettings { + /** The default scopes of the service. */ + private static final ImmutableList DEFAULT_SERVICE_SCOPES = + ImmutableList.builder().build(); + + private final UnaryCallSettings createUserSettings; + private final UnaryCallSettings getUserSettings; + private final UnaryCallSettings updateUserSettings; + private final UnaryCallSettings deleteUserSettings; + private final PagedCallSettings + listUsersSettings; + private final PagedCallSettings< + ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse> + listLocationsSettings; + private final UnaryCallSettings getLocationSettings; + private final UnaryCallSettings setIamPolicySettings; + private final UnaryCallSettings getIamPolicySettings; + private final UnaryCallSettings + testIamPermissionsSettings; + + private static final PagedListDescriptor + LIST_USERS_PAGE_STR_DESC = + new PagedListDescriptor() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public ListUsersRequest injectToken(ListUsersRequest payload, String token) { + return ListUsersRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public ListUsersRequest injectPageSize(ListUsersRequest payload, int pageSize) { + return ListUsersRequest.newBuilder(payload).setPageSize(pageSize).build(); + } + + @Override + public Integer extractPageSize(ListUsersRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(ListUsersResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources(ListUsersResponse payload) { + return payload.getUsersList(); + } + }; + + private static final PagedListDescriptor + LIST_LOCATIONS_PAGE_STR_DESC = + new PagedListDescriptor() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public ListLocationsRequest injectToken(ListLocationsRequest payload, String token) { + return ListLocationsRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public ListLocationsRequest injectPageSize(ListLocationsRequest payload, int pageSize) { + return ListLocationsRequest.newBuilder(payload).setPageSize(pageSize).build(); + } + + @Override + public Integer extractPageSize(ListLocationsRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(ListLocationsResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources(ListLocationsResponse payload) { + return payload.getLocationsList(); + } + }; + + private static final PagedListResponseFactory< + ListUsersRequest, ListUsersResponse, ListUsersPagedResponse> + LIST_USERS_PAGE_STR_FACT = + new PagedListResponseFactory< + ListUsersRequest, ListUsersResponse, ListUsersPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListUsersRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext pageContext = + PageContext.create(callable, LIST_USERS_PAGE_STR_DESC, request, context); + return ListUsersPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + private static final PagedListResponseFactory< + ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse> + LIST_LOCATIONS_PAGE_STR_FACT = + new PagedListResponseFactory< + ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListLocationsRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext pageContext = + PageContext.create(callable, LIST_LOCATIONS_PAGE_STR_DESC, request, context); + return ListLocationsPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + /** Returns the object with the settings used for calls to createUser. */ + public UnaryCallSettings createUserSettings() { + return createUserSettings; + } + + /** Returns the object with the settings used for calls to getUser. */ + public UnaryCallSettings getUserSettings() { + return getUserSettings; + } + + /** Returns the object with the settings used for calls to updateUser. */ + public UnaryCallSettings updateUserSettings() { + return updateUserSettings; + } + + /** Returns the object with the settings used for calls to deleteUser. */ + public UnaryCallSettings deleteUserSettings() { + return deleteUserSettings; + } + + /** Returns the object with the settings used for calls to listUsers. */ + public PagedCallSettings + listUsersSettings() { + return listUsersSettings; + } + + /** Returns the object with the settings used for calls to listLocations. */ + public PagedCallSettings + listLocationsSettings() { + return listLocationsSettings; + } + + /** Returns the object with the settings used for calls to getLocation. */ + public UnaryCallSettings getLocationSettings() { + return getLocationSettings; + } + + /** Returns the object with the settings used for calls to setIamPolicy. */ + public UnaryCallSettings setIamPolicySettings() { + return setIamPolicySettings; + } + + /** Returns the object with the settings used for calls to getIamPolicy. */ + public UnaryCallSettings getIamPolicySettings() { + return getIamPolicySettings; + } + + /** Returns the object with the settings used for calls to testIamPermissions. */ + public UnaryCallSettings + testIamPermissionsSettings() { + return testIamPermissionsSettings; + } + + public IdentityStub createStub() throws IOException { + if (getTransportChannelProvider() + .getTransportName() + .equals(GrpcTransportChannel.getGrpcTransportName())) { + return GrpcIdentityStub.create(this); + } + if (getTransportChannelProvider() + .getTransportName() + .equals(HttpJsonTransportChannel.getHttpJsonTransportName())) { + return HttpJsonIdentityStub.create(this); + } + throw new UnsupportedOperationException( + String.format( + "Transport not supported: %s", getTransportChannelProvider().getTransportName())); + } + + /** Returns a builder for the default ExecutorProvider for this service. */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return InstantiatingExecutorProvider.newBuilder(); + } + + /** Returns the default service endpoint. */ + @ObsoleteApi("Use getEndpoint() instead") + public static String getDefaultEndpoint() { + return "localhost:7469"; + } + + /** Returns the default mTLS service endpoint. */ + public static String getDefaultMtlsEndpoint() { + return "localhost:7469"; + } + + /** 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 gRPC ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return InstantiatingGrpcChannelProvider.newBuilder() + .setMaxInboundMessageSize(Integer.MAX_VALUE); + } + + /** Returns a builder for the default REST ChannelProvider for this service. */ + @BetaApi + public static InstantiatingHttpJsonChannelProvider.Builder + defaultHttpJsonTransportProviderBuilder() { + return InstantiatingHttpJsonChannelProvider.newBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return defaultGrpcTransportProviderBuilder().build(); + } + + public static ApiClientHeaderProvider.Builder defaultGrpcApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken("gapic", GaxProperties.getLibraryVersion(IdentityStubSettings.class)) + .setTransportToken( + GaxGrpcProperties.getGrpcTokenName(), GaxGrpcProperties.getGrpcVersion()); + } + + public static ApiClientHeaderProvider.Builder defaultHttpJsonApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken("gapic", GaxProperties.getLibraryVersion(IdentityStubSettings.class)) + .setTransportToken( + GaxHttpJsonProperties.getHttpJsonTokenName(), + GaxHttpJsonProperties.getHttpJsonVersion()); + } + + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return IdentityStubSettings.defaultGrpcApiClientHeaderProviderBuilder(); + } + + /** Returns a new gRPC builder for this class. */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** Returns a new REST builder for this class. */ + public static Builder newHttpJsonBuilder() { + return Builder.createHttpJsonDefault(); + } + + /** 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 IdentityStubSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + + createUserSettings = settingsBuilder.createUserSettings().build(); + getUserSettings = settingsBuilder.getUserSettings().build(); + updateUserSettings = settingsBuilder.updateUserSettings().build(); + deleteUserSettings = settingsBuilder.deleteUserSettings().build(); + listUsersSettings = settingsBuilder.listUsersSettings().build(); + listLocationsSettings = settingsBuilder.listLocationsSettings().build(); + getLocationSettings = settingsBuilder.getLocationSettings().build(); + setIamPolicySettings = settingsBuilder.setIamPolicySettings().build(); + getIamPolicySettings = settingsBuilder.getIamPolicySettings().build(); + testIamPermissionsSettings = settingsBuilder.testIamPermissionsSettings().build(); + } + + /** Builder for IdentityStubSettings. */ + public static class Builder extends StubSettings.Builder { + private final ImmutableList> unaryMethodSettingsBuilders; + private final UnaryCallSettings.Builder createUserSettings; + private final UnaryCallSettings.Builder getUserSettings; + private final UnaryCallSettings.Builder updateUserSettings; + private final UnaryCallSettings.Builder deleteUserSettings; + private final PagedCallSettings.Builder< + ListUsersRequest, ListUsersResponse, ListUsersPagedResponse> + listUsersSettings; + private final PagedCallSettings.Builder< + ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse> + listLocationsSettings; + private final UnaryCallSettings.Builder getLocationSettings; + private final UnaryCallSettings.Builder setIamPolicySettings; + private final UnaryCallSettings.Builder getIamPolicySettings; + private final UnaryCallSettings.Builder + testIamPermissionsSettings; + 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_2_codes", + ImmutableSet.copyOf( + Lists.newArrayList( + StatusCode.Code.UNAVAILABLE, StatusCode.Code.UNKNOWN))); + 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(200L)) + .setRetryDelayMultiplier(2.0) + .setMaxRetryDelayDuration(Duration.ofMillis(3000L)) + .setInitialRpcTimeoutDuration(Duration.ofMillis(5000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeoutDuration(Duration.ofMillis(5000L)) + .setTotalTimeoutDuration(Duration.ofMillis(5000L)) + .build(); + definitions.put("retry_policy_2_params", settings); + RETRY_PARAM_DEFINITIONS = definitions.build(); + } + + protected Builder() { + this(((ClientContext) null)); + } + + protected Builder(ClientContext clientContext) { + super(clientContext); + + createUserSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + getUserSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + updateUserSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + deleteUserSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + listUsersSettings = PagedCallSettings.newBuilder(LIST_USERS_PAGE_STR_FACT); + listLocationsSettings = PagedCallSettings.newBuilder(LIST_LOCATIONS_PAGE_STR_FACT); + getLocationSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + setIamPolicySettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + getIamPolicySettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + testIamPermissionsSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + createUserSettings, + getUserSettings, + updateUserSettings, + deleteUserSettings, + listUsersSettings, + listLocationsSettings, + getLocationSettings, + setIamPolicySettings, + getIamPolicySettings, + testIamPermissionsSettings); + initDefaults(this); + } + + protected Builder(IdentityStubSettings settings) { + super(settings); + + createUserSettings = settings.createUserSettings.toBuilder(); + getUserSettings = settings.getUserSettings.toBuilder(); + updateUserSettings = settings.updateUserSettings.toBuilder(); + deleteUserSettings = settings.deleteUserSettings.toBuilder(); + listUsersSettings = settings.listUsersSettings.toBuilder(); + listLocationsSettings = settings.listLocationsSettings.toBuilder(); + getLocationSettings = settings.getLocationSettings.toBuilder(); + setIamPolicySettings = settings.setIamPolicySettings.toBuilder(); + getIamPolicySettings = settings.getIamPolicySettings.toBuilder(); + testIamPermissionsSettings = settings.testIamPermissionsSettings.toBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + createUserSettings, + getUserSettings, + updateUserSettings, + deleteUserSettings, + listUsersSettings, + listLocationsSettings, + getLocationSettings, + setIamPolicySettings, + getIamPolicySettings, + testIamPermissionsSettings); + } + + 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 createHttpJsonDefault() { + Builder builder = new Builder(((ClientContext) null)); + + builder.setTransportChannelProvider(defaultHttpJsonTransportProviderBuilder().build()); + builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); + builder.setInternalHeaderProvider(defaultHttpJsonApiClientHeaderProviderBuilder().build()); + builder.setMtlsEndpoint(getDefaultMtlsEndpoint()); + builder.setSwitchToMtlsEndpointAllowed(true); + + return initDefaults(builder); + } + + private static Builder initDefaults(Builder builder) { + builder + .createUserSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .getUserSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_2_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_2_params")); + + builder + .updateUserSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .deleteUserSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .listUsersSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_2_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_2_params")); + + builder + .listLocationsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .getLocationSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .setIamPolicySettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .getIamPolicySettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .testIamPermissionsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_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 createUser. */ + public UnaryCallSettings.Builder createUserSettings() { + return createUserSettings; + } + + /** Returns the builder for the settings used for calls to getUser. */ + public UnaryCallSettings.Builder getUserSettings() { + return getUserSettings; + } + + /** Returns the builder for the settings used for calls to updateUser. */ + public UnaryCallSettings.Builder updateUserSettings() { + return updateUserSettings; + } + + /** Returns the builder for the settings used for calls to deleteUser. */ + public UnaryCallSettings.Builder deleteUserSettings() { + return deleteUserSettings; + } + + /** Returns the builder for the settings used for calls to listUsers. */ + public PagedCallSettings.Builder + listUsersSettings() { + return listUsersSettings; + } + + /** Returns the builder for the settings used for calls to listLocations. */ + public PagedCallSettings.Builder< + ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse> + listLocationsSettings() { + return listLocationsSettings; + } + + /** Returns the builder for the settings used for calls to getLocation. */ + public UnaryCallSettings.Builder getLocationSettings() { + return getLocationSettings; + } + + /** Returns the builder for the settings used for calls to setIamPolicy. */ + public UnaryCallSettings.Builder setIamPolicySettings() { + return setIamPolicySettings; + } + + /** Returns the builder for the settings used for calls to getIamPolicy. */ + public UnaryCallSettings.Builder getIamPolicySettings() { + return getIamPolicySettings; + } + + /** Returns the builder for the settings used for calls to testIamPermissions. */ + public UnaryCallSettings.Builder + testIamPermissionsSettings() { + return testIamPermissionsSettings; + } + + @Override + public IdentityStubSettings build() throws IOException { + return new IdentityStubSettings(this); + } + } +} diff --git a/java-showcase-3.25.8/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/MessagingStub.java b/java-showcase-3.25.8/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/MessagingStub.java new file mode 100644 index 0000000000..45f38d5e07 --- /dev/null +++ b/java-showcase-3.25.8/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/MessagingStub.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. + */ + +package com.google.showcase.v1beta1.stub; + +import static com.google.showcase.v1beta1.MessagingClient.ListBlurbsPagedResponse; +import static com.google.showcase.v1beta1.MessagingClient.ListLocationsPagedResponse; +import static com.google.showcase.v1beta1.MessagingClient.ListRoomsPagedResponse; + +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.rpc.BidiStreamingCallable; +import com.google.api.gax.rpc.ClientStreamingCallable; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.longrunning.Operation; +import com.google.longrunning.stub.OperationsStub; +import com.google.protobuf.Empty; +import com.google.showcase.v1beta1.Blurb; +import com.google.showcase.v1beta1.ConnectRequest; +import com.google.showcase.v1beta1.CreateBlurbRequest; +import com.google.showcase.v1beta1.CreateRoomRequest; +import com.google.showcase.v1beta1.DeleteBlurbRequest; +import com.google.showcase.v1beta1.DeleteRoomRequest; +import com.google.showcase.v1beta1.GetBlurbRequest; +import com.google.showcase.v1beta1.GetRoomRequest; +import com.google.showcase.v1beta1.ListBlurbsRequest; +import com.google.showcase.v1beta1.ListBlurbsResponse; +import com.google.showcase.v1beta1.ListRoomsRequest; +import com.google.showcase.v1beta1.ListRoomsResponse; +import com.google.showcase.v1beta1.Room; +import com.google.showcase.v1beta1.SearchBlurbsMetadata; +import com.google.showcase.v1beta1.SearchBlurbsRequest; +import com.google.showcase.v1beta1.SearchBlurbsResponse; +import com.google.showcase.v1beta1.SendBlurbsResponse; +import com.google.showcase.v1beta1.StreamBlurbsRequest; +import com.google.showcase.v1beta1.StreamBlurbsResponse; +import com.google.showcase.v1beta1.UpdateBlurbRequest; +import com.google.showcase.v1beta1.UpdateRoomRequest; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Base stub class for the Messaging service API. + * + *

        This class is for advanced usage and reflects the underlying API directly. + */ +@BetaApi +@Generated("by gapic-generator-java") +public abstract class MessagingStub implements BackgroundResource { + + public OperationsStub getOperationsStub() { + return null; + } + + public com.google.api.gax.httpjson.longrunning.stub.OperationsStub getHttpJsonOperationsStub() { + return null; + } + + public UnaryCallable createRoomCallable() { + throw new UnsupportedOperationException("Not implemented: createRoomCallable()"); + } + + public UnaryCallable getRoomCallable() { + throw new UnsupportedOperationException("Not implemented: getRoomCallable()"); + } + + public UnaryCallable updateRoomCallable() { + throw new UnsupportedOperationException("Not implemented: updateRoomCallable()"); + } + + public UnaryCallable deleteRoomCallable() { + throw new UnsupportedOperationException("Not implemented: deleteRoomCallable()"); + } + + public UnaryCallable listRoomsPagedCallable() { + throw new UnsupportedOperationException("Not implemented: listRoomsPagedCallable()"); + } + + public UnaryCallable listRoomsCallable() { + throw new UnsupportedOperationException("Not implemented: listRoomsCallable()"); + } + + public UnaryCallable createBlurbCallable() { + throw new UnsupportedOperationException("Not implemented: createBlurbCallable()"); + } + + public UnaryCallable getBlurbCallable() { + throw new UnsupportedOperationException("Not implemented: getBlurbCallable()"); + } + + public UnaryCallable updateBlurbCallable() { + throw new UnsupportedOperationException("Not implemented: updateBlurbCallable()"); + } + + public UnaryCallable deleteBlurbCallable() { + throw new UnsupportedOperationException("Not implemented: deleteBlurbCallable()"); + } + + public UnaryCallable listBlurbsPagedCallable() { + throw new UnsupportedOperationException("Not implemented: listBlurbsPagedCallable()"); + } + + public UnaryCallable listBlurbsCallable() { + throw new UnsupportedOperationException("Not implemented: listBlurbsCallable()"); + } + + public OperationCallable + searchBlurbsOperationCallable() { + throw new UnsupportedOperationException("Not implemented: searchBlurbsOperationCallable()"); + } + + public UnaryCallable searchBlurbsCallable() { + throw new UnsupportedOperationException("Not implemented: searchBlurbsCallable()"); + } + + public ServerStreamingCallable streamBlurbsCallable() { + throw new UnsupportedOperationException("Not implemented: streamBlurbsCallable()"); + } + + public ClientStreamingCallable sendBlurbsCallable() { + throw new UnsupportedOperationException("Not implemented: sendBlurbsCallable()"); + } + + public BidiStreamingCallable connectCallable() { + throw new UnsupportedOperationException("Not implemented: connectCallable()"); + } + + public UnaryCallable + listLocationsPagedCallable() { + throw new UnsupportedOperationException("Not implemented: listLocationsPagedCallable()"); + } + + public UnaryCallable listLocationsCallable() { + throw new UnsupportedOperationException("Not implemented: listLocationsCallable()"); + } + + public UnaryCallable getLocationCallable() { + throw new UnsupportedOperationException("Not implemented: getLocationCallable()"); + } + + public UnaryCallable setIamPolicyCallable() { + throw new UnsupportedOperationException("Not implemented: setIamPolicyCallable()"); + } + + public UnaryCallable getIamPolicyCallable() { + throw new UnsupportedOperationException("Not implemented: getIamPolicyCallable()"); + } + + public UnaryCallable + testIamPermissionsCallable() { + throw new UnsupportedOperationException("Not implemented: testIamPermissionsCallable()"); + } + + @Override + public abstract void close(); +} diff --git a/java-showcase-3.25.8/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/MessagingStubSettings.java b/java-showcase-3.25.8/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/MessagingStubSettings.java new file mode 100644 index 0000000000..84828250d7 --- /dev/null +++ b/java-showcase-3.25.8/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/MessagingStubSettings.java @@ -0,0 +1,1027 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.stub; + +import static com.google.showcase.v1beta1.MessagingClient.ListBlurbsPagedResponse; +import static com.google.showcase.v1beta1.MessagingClient.ListLocationsPagedResponse; +import static com.google.showcase.v1beta1.MessagingClient.ListRoomsPagedResponse; + +import com.google.api.core.ApiFunction; +import com.google.api.core.ApiFuture; +import com.google.api.core.BetaApi; +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.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.HttpJsonTransportChannel; +import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; +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.ServerStreamingCallSettings; +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.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +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.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.longrunning.Operation; +import com.google.protobuf.Empty; +import com.google.showcase.v1beta1.Blurb; +import com.google.showcase.v1beta1.ConnectRequest; +import com.google.showcase.v1beta1.CreateBlurbRequest; +import com.google.showcase.v1beta1.CreateRoomRequest; +import com.google.showcase.v1beta1.DeleteBlurbRequest; +import com.google.showcase.v1beta1.DeleteRoomRequest; +import com.google.showcase.v1beta1.GetBlurbRequest; +import com.google.showcase.v1beta1.GetRoomRequest; +import com.google.showcase.v1beta1.ListBlurbsRequest; +import com.google.showcase.v1beta1.ListBlurbsResponse; +import com.google.showcase.v1beta1.ListRoomsRequest; +import com.google.showcase.v1beta1.ListRoomsResponse; +import com.google.showcase.v1beta1.Room; +import com.google.showcase.v1beta1.SearchBlurbsMetadata; +import com.google.showcase.v1beta1.SearchBlurbsRequest; +import com.google.showcase.v1beta1.SearchBlurbsResponse; +import com.google.showcase.v1beta1.SendBlurbsResponse; +import com.google.showcase.v1beta1.StreamBlurbsRequest; +import com.google.showcase.v1beta1.StreamBlurbsResponse; +import com.google.showcase.v1beta1.UpdateBlurbRequest; +import com.google.showcase.v1beta1.UpdateRoomRequest; +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 MessagingStub}. + * + *

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

          + *
        • The default service address (localhost) and default port (7469) 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 createRoom: + * + *

        {@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
        + * MessagingStubSettings.Builder messagingSettingsBuilder = MessagingStubSettings.newBuilder();
        + * messagingSettingsBuilder
        + *     .createRoomSettings()
        + *     .setRetrySettings(
        + *         messagingSettingsBuilder
        + *             .createRoomSettings()
        + *             .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());
        + * MessagingStubSettings messagingSettings = messagingSettingsBuilder.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 searchBlurbs: + * + *

        {@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
        + * MessagingStubSettings.Builder messagingSettingsBuilder = MessagingStubSettings.newBuilder();
        + * TimedRetryAlgorithm timedRetryAlgorithm =
        + *     OperationalTimedPollAlgorithm.create(
        + *         RetrySettings.newBuilder()
        + *             .setInitialRetryDelayDuration(Duration.ofMillis(500))
        + *             .setRetryDelayMultiplier(1.5)
        + *             .setMaxRetryDelayDuration(Duration.ofMillis(5000))
        + *             .setTotalTimeoutDuration(Duration.ofHours(24))
        + *             .build());
        + * messagingSettingsBuilder
        + *     .createClusterOperationSettings()
        + *     .setPollingAlgorithm(timedRetryAlgorithm)
        + *     .build();
        + * }
        + */ +@BetaApi +@Generated("by gapic-generator-java") +public class MessagingStubSettings extends StubSettings { + /** The default scopes of the service. */ + private static final ImmutableList DEFAULT_SERVICE_SCOPES = + ImmutableList.builder().build(); + + private final UnaryCallSettings createRoomSettings; + private final UnaryCallSettings getRoomSettings; + private final UnaryCallSettings updateRoomSettings; + private final UnaryCallSettings deleteRoomSettings; + private final PagedCallSettings + listRoomsSettings; + private final UnaryCallSettings createBlurbSettings; + private final UnaryCallSettings getBlurbSettings; + private final UnaryCallSettings updateBlurbSettings; + private final UnaryCallSettings deleteBlurbSettings; + private final PagedCallSettings + listBlurbsSettings; + private final UnaryCallSettings searchBlurbsSettings; + private final OperationCallSettings< + SearchBlurbsRequest, SearchBlurbsResponse, SearchBlurbsMetadata> + searchBlurbsOperationSettings; + private final ServerStreamingCallSettings + streamBlurbsSettings; + private final StreamingCallSettings sendBlurbsSettings; + private final StreamingCallSettings connectSettings; + private final PagedCallSettings< + ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse> + listLocationsSettings; + private final UnaryCallSettings getLocationSettings; + private final UnaryCallSettings setIamPolicySettings; + private final UnaryCallSettings getIamPolicySettings; + private final UnaryCallSettings + testIamPermissionsSettings; + + private static final PagedListDescriptor + LIST_ROOMS_PAGE_STR_DESC = + new PagedListDescriptor() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public ListRoomsRequest injectToken(ListRoomsRequest payload, String token) { + return ListRoomsRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public ListRoomsRequest injectPageSize(ListRoomsRequest payload, int pageSize) { + return ListRoomsRequest.newBuilder(payload).setPageSize(pageSize).build(); + } + + @Override + public Integer extractPageSize(ListRoomsRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(ListRoomsResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources(ListRoomsResponse payload) { + return payload.getRoomsList(); + } + }; + + private static final PagedListDescriptor + LIST_BLURBS_PAGE_STR_DESC = + new PagedListDescriptor() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public ListBlurbsRequest injectToken(ListBlurbsRequest payload, String token) { + return ListBlurbsRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public ListBlurbsRequest injectPageSize(ListBlurbsRequest payload, int pageSize) { + return ListBlurbsRequest.newBuilder(payload).setPageSize(pageSize).build(); + } + + @Override + public Integer extractPageSize(ListBlurbsRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(ListBlurbsResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources(ListBlurbsResponse payload) { + return payload.getBlurbsList(); + } + }; + + private static final PagedListDescriptor + LIST_LOCATIONS_PAGE_STR_DESC = + new PagedListDescriptor() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public ListLocationsRequest injectToken(ListLocationsRequest payload, String token) { + return ListLocationsRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public ListLocationsRequest injectPageSize(ListLocationsRequest payload, int pageSize) { + return ListLocationsRequest.newBuilder(payload).setPageSize(pageSize).build(); + } + + @Override + public Integer extractPageSize(ListLocationsRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(ListLocationsResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources(ListLocationsResponse payload) { + return payload.getLocationsList(); + } + }; + + private static final PagedListResponseFactory< + ListRoomsRequest, ListRoomsResponse, ListRoomsPagedResponse> + LIST_ROOMS_PAGE_STR_FACT = + new PagedListResponseFactory< + ListRoomsRequest, ListRoomsResponse, ListRoomsPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListRoomsRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext pageContext = + PageContext.create(callable, LIST_ROOMS_PAGE_STR_DESC, request, context); + return ListRoomsPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + private static final PagedListResponseFactory< + ListBlurbsRequest, ListBlurbsResponse, ListBlurbsPagedResponse> + LIST_BLURBS_PAGE_STR_FACT = + new PagedListResponseFactory< + ListBlurbsRequest, ListBlurbsResponse, ListBlurbsPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListBlurbsRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext pageContext = + PageContext.create(callable, LIST_BLURBS_PAGE_STR_DESC, request, context); + return ListBlurbsPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + private static final PagedListResponseFactory< + ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse> + LIST_LOCATIONS_PAGE_STR_FACT = + new PagedListResponseFactory< + ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListLocationsRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext pageContext = + PageContext.create(callable, LIST_LOCATIONS_PAGE_STR_DESC, request, context); + return ListLocationsPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + /** Returns the object with the settings used for calls to createRoom. */ + public UnaryCallSettings createRoomSettings() { + return createRoomSettings; + } + + /** Returns the object with the settings used for calls to getRoom. */ + public UnaryCallSettings getRoomSettings() { + return getRoomSettings; + } + + /** Returns the object with the settings used for calls to updateRoom. */ + public UnaryCallSettings updateRoomSettings() { + return updateRoomSettings; + } + + /** Returns the object with the settings used for calls to deleteRoom. */ + public UnaryCallSettings deleteRoomSettings() { + return deleteRoomSettings; + } + + /** Returns the object with the settings used for calls to listRooms. */ + public PagedCallSettings + listRoomsSettings() { + return listRoomsSettings; + } + + /** Returns the object with the settings used for calls to createBlurb. */ + public UnaryCallSettings createBlurbSettings() { + return createBlurbSettings; + } + + /** Returns the object with the settings used for calls to getBlurb. */ + public UnaryCallSettings getBlurbSettings() { + return getBlurbSettings; + } + + /** Returns the object with the settings used for calls to updateBlurb. */ + public UnaryCallSettings updateBlurbSettings() { + return updateBlurbSettings; + } + + /** Returns the object with the settings used for calls to deleteBlurb. */ + public UnaryCallSettings deleteBlurbSettings() { + return deleteBlurbSettings; + } + + /** Returns the object with the settings used for calls to listBlurbs. */ + public PagedCallSettings + listBlurbsSettings() { + return listBlurbsSettings; + } + + /** Returns the object with the settings used for calls to searchBlurbs. */ + public UnaryCallSettings searchBlurbsSettings() { + return searchBlurbsSettings; + } + + /** Returns the object with the settings used for calls to searchBlurbs. */ + public OperationCallSettings + searchBlurbsOperationSettings() { + return searchBlurbsOperationSettings; + } + + /** Returns the object with the settings used for calls to streamBlurbs. */ + public ServerStreamingCallSettings + streamBlurbsSettings() { + return streamBlurbsSettings; + } + + /** Returns the object with the settings used for calls to sendBlurbs. */ + public StreamingCallSettings sendBlurbsSettings() { + return sendBlurbsSettings; + } + + /** Returns the object with the settings used for calls to connect. */ + public StreamingCallSettings connectSettings() { + return connectSettings; + } + + /** Returns the object with the settings used for calls to listLocations. */ + public PagedCallSettings + listLocationsSettings() { + return listLocationsSettings; + } + + /** Returns the object with the settings used for calls to getLocation. */ + public UnaryCallSettings getLocationSettings() { + return getLocationSettings; + } + + /** Returns the object with the settings used for calls to setIamPolicy. */ + public UnaryCallSettings setIamPolicySettings() { + return setIamPolicySettings; + } + + /** Returns the object with the settings used for calls to getIamPolicy. */ + public UnaryCallSettings getIamPolicySettings() { + return getIamPolicySettings; + } + + /** Returns the object with the settings used for calls to testIamPermissions. */ + public UnaryCallSettings + testIamPermissionsSettings() { + return testIamPermissionsSettings; + } + + public MessagingStub createStub() throws IOException { + if (getTransportChannelProvider() + .getTransportName() + .equals(GrpcTransportChannel.getGrpcTransportName())) { + return GrpcMessagingStub.create(this); + } + if (getTransportChannelProvider() + .getTransportName() + .equals(HttpJsonTransportChannel.getHttpJsonTransportName())) { + return HttpJsonMessagingStub.create(this); + } + throw new UnsupportedOperationException( + String.format( + "Transport not supported: %s", getTransportChannelProvider().getTransportName())); + } + + /** Returns a builder for the default ExecutorProvider for this service. */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return InstantiatingExecutorProvider.newBuilder(); + } + + /** Returns the default service endpoint. */ + @ObsoleteApi("Use getEndpoint() instead") + public static String getDefaultEndpoint() { + return "localhost:7469"; + } + + /** Returns the default mTLS service endpoint. */ + public static String getDefaultMtlsEndpoint() { + return "localhost:7469"; + } + + /** 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 gRPC ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return InstantiatingGrpcChannelProvider.newBuilder() + .setMaxInboundMessageSize(Integer.MAX_VALUE); + } + + /** Returns a builder for the default REST ChannelProvider for this service. */ + @BetaApi + public static InstantiatingHttpJsonChannelProvider.Builder + defaultHttpJsonTransportProviderBuilder() { + return InstantiatingHttpJsonChannelProvider.newBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return defaultGrpcTransportProviderBuilder().build(); + } + + public static ApiClientHeaderProvider.Builder defaultGrpcApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken("gapic", GaxProperties.getLibraryVersion(MessagingStubSettings.class)) + .setTransportToken( + GaxGrpcProperties.getGrpcTokenName(), GaxGrpcProperties.getGrpcVersion()); + } + + public static ApiClientHeaderProvider.Builder defaultHttpJsonApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken("gapic", GaxProperties.getLibraryVersion(MessagingStubSettings.class)) + .setTransportToken( + GaxHttpJsonProperties.getHttpJsonTokenName(), + GaxHttpJsonProperties.getHttpJsonVersion()); + } + + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return MessagingStubSettings.defaultGrpcApiClientHeaderProviderBuilder(); + } + + /** Returns a new gRPC builder for this class. */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** Returns a new REST builder for this class. */ + public static Builder newHttpJsonBuilder() { + return Builder.createHttpJsonDefault(); + } + + /** 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 MessagingStubSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + + createRoomSettings = settingsBuilder.createRoomSettings().build(); + getRoomSettings = settingsBuilder.getRoomSettings().build(); + updateRoomSettings = settingsBuilder.updateRoomSettings().build(); + deleteRoomSettings = settingsBuilder.deleteRoomSettings().build(); + listRoomsSettings = settingsBuilder.listRoomsSettings().build(); + createBlurbSettings = settingsBuilder.createBlurbSettings().build(); + getBlurbSettings = settingsBuilder.getBlurbSettings().build(); + updateBlurbSettings = settingsBuilder.updateBlurbSettings().build(); + deleteBlurbSettings = settingsBuilder.deleteBlurbSettings().build(); + listBlurbsSettings = settingsBuilder.listBlurbsSettings().build(); + searchBlurbsSettings = settingsBuilder.searchBlurbsSettings().build(); + searchBlurbsOperationSettings = settingsBuilder.searchBlurbsOperationSettings().build(); + streamBlurbsSettings = settingsBuilder.streamBlurbsSettings().build(); + sendBlurbsSettings = settingsBuilder.sendBlurbsSettings().build(); + connectSettings = settingsBuilder.connectSettings().build(); + listLocationsSettings = settingsBuilder.listLocationsSettings().build(); + getLocationSettings = settingsBuilder.getLocationSettings().build(); + setIamPolicySettings = settingsBuilder.setIamPolicySettings().build(); + getIamPolicySettings = settingsBuilder.getIamPolicySettings().build(); + testIamPermissionsSettings = settingsBuilder.testIamPermissionsSettings().build(); + } + + /** Builder for MessagingStubSettings. */ + public static class Builder extends StubSettings.Builder { + private final ImmutableList> unaryMethodSettingsBuilders; + private final UnaryCallSettings.Builder createRoomSettings; + private final UnaryCallSettings.Builder getRoomSettings; + private final UnaryCallSettings.Builder updateRoomSettings; + private final UnaryCallSettings.Builder deleteRoomSettings; + private final PagedCallSettings.Builder< + ListRoomsRequest, ListRoomsResponse, ListRoomsPagedResponse> + listRoomsSettings; + private final UnaryCallSettings.Builder createBlurbSettings; + private final UnaryCallSettings.Builder getBlurbSettings; + private final UnaryCallSettings.Builder updateBlurbSettings; + private final UnaryCallSettings.Builder deleteBlurbSettings; + private final PagedCallSettings.Builder< + ListBlurbsRequest, ListBlurbsResponse, ListBlurbsPagedResponse> + listBlurbsSettings; + private final UnaryCallSettings.Builder searchBlurbsSettings; + private final OperationCallSettings.Builder< + SearchBlurbsRequest, SearchBlurbsResponse, SearchBlurbsMetadata> + searchBlurbsOperationSettings; + private final ServerStreamingCallSettings.Builder + streamBlurbsSettings; + private final StreamingCallSettings.Builder + sendBlurbsSettings; + private final StreamingCallSettings.Builder + connectSettings; + private final PagedCallSettings.Builder< + ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse> + listLocationsSettings; + private final UnaryCallSettings.Builder getLocationSettings; + private final UnaryCallSettings.Builder setIamPolicySettings; + private final UnaryCallSettings.Builder getIamPolicySettings; + private final UnaryCallSettings.Builder + testIamPermissionsSettings; + private static final ImmutableMap> + RETRYABLE_CODE_DEFINITIONS; + + static { + ImmutableMap.Builder> definitions = + ImmutableMap.builder(); + definitions.put( + "no_retry_0_codes", ImmutableSet.copyOf(Lists.newArrayList())); + definitions.put( + "retry_policy_1_codes", + ImmutableSet.copyOf( + Lists.newArrayList( + StatusCode.Code.UNAVAILABLE, StatusCode.Code.UNKNOWN))); + RETRYABLE_CODE_DEFINITIONS = definitions.build(); + } + + private static final ImmutableMap RETRY_PARAM_DEFINITIONS; + + static { + ImmutableMap.Builder definitions = ImmutableMap.builder(); + RetrySettings settings = null; + settings = + RetrySettings.newBuilder() + .setInitialRpcTimeoutDuration(Duration.ofMillis(5000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeoutDuration(Duration.ofMillis(5000L)) + .setTotalTimeoutDuration(Duration.ofMillis(5000L)) + .build(); + definitions.put("no_retry_0_params", settings); + settings = + RetrySettings.newBuilder() + .setInitialRetryDelayDuration(Duration.ofMillis(100L)) + .setRetryDelayMultiplier(2.0) + .setMaxRetryDelayDuration(Duration.ofMillis(3000L)) + .setInitialRpcTimeoutDuration(Duration.ofMillis(10000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeoutDuration(Duration.ofMillis(10000L)) + .setTotalTimeoutDuration(Duration.ofMillis(10000L)) + .build(); + definitions.put("retry_policy_1_params", settings); + RETRY_PARAM_DEFINITIONS = definitions.build(); + } + + protected Builder() { + this(((ClientContext) null)); + } + + protected Builder(ClientContext clientContext) { + super(clientContext); + + createRoomSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + getRoomSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + updateRoomSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + deleteRoomSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + listRoomsSettings = PagedCallSettings.newBuilder(LIST_ROOMS_PAGE_STR_FACT); + createBlurbSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + getBlurbSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + updateBlurbSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + deleteBlurbSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + listBlurbsSettings = PagedCallSettings.newBuilder(LIST_BLURBS_PAGE_STR_FACT); + searchBlurbsSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + searchBlurbsOperationSettings = OperationCallSettings.newBuilder(); + streamBlurbsSettings = ServerStreamingCallSettings.newBuilder(); + sendBlurbsSettings = StreamingCallSettings.newBuilder(); + connectSettings = StreamingCallSettings.newBuilder(); + listLocationsSettings = PagedCallSettings.newBuilder(LIST_LOCATIONS_PAGE_STR_FACT); + getLocationSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + setIamPolicySettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + getIamPolicySettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + testIamPermissionsSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + createRoomSettings, + getRoomSettings, + updateRoomSettings, + deleteRoomSettings, + listRoomsSettings, + createBlurbSettings, + getBlurbSettings, + updateBlurbSettings, + deleteBlurbSettings, + listBlurbsSettings, + searchBlurbsSettings, + listLocationsSettings, + getLocationSettings, + setIamPolicySettings, + getIamPolicySettings, + testIamPermissionsSettings); + initDefaults(this); + } + + protected Builder(MessagingStubSettings settings) { + super(settings); + + createRoomSettings = settings.createRoomSettings.toBuilder(); + getRoomSettings = settings.getRoomSettings.toBuilder(); + updateRoomSettings = settings.updateRoomSettings.toBuilder(); + deleteRoomSettings = settings.deleteRoomSettings.toBuilder(); + listRoomsSettings = settings.listRoomsSettings.toBuilder(); + createBlurbSettings = settings.createBlurbSettings.toBuilder(); + getBlurbSettings = settings.getBlurbSettings.toBuilder(); + updateBlurbSettings = settings.updateBlurbSettings.toBuilder(); + deleteBlurbSettings = settings.deleteBlurbSettings.toBuilder(); + listBlurbsSettings = settings.listBlurbsSettings.toBuilder(); + searchBlurbsSettings = settings.searchBlurbsSettings.toBuilder(); + searchBlurbsOperationSettings = settings.searchBlurbsOperationSettings.toBuilder(); + streamBlurbsSettings = settings.streamBlurbsSettings.toBuilder(); + sendBlurbsSettings = settings.sendBlurbsSettings.toBuilder(); + connectSettings = settings.connectSettings.toBuilder(); + listLocationsSettings = settings.listLocationsSettings.toBuilder(); + getLocationSettings = settings.getLocationSettings.toBuilder(); + setIamPolicySettings = settings.setIamPolicySettings.toBuilder(); + getIamPolicySettings = settings.getIamPolicySettings.toBuilder(); + testIamPermissionsSettings = settings.testIamPermissionsSettings.toBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + createRoomSettings, + getRoomSettings, + updateRoomSettings, + deleteRoomSettings, + listRoomsSettings, + createBlurbSettings, + getBlurbSettings, + updateBlurbSettings, + deleteBlurbSettings, + listBlurbsSettings, + searchBlurbsSettings, + listLocationsSettings, + getLocationSettings, + setIamPolicySettings, + getIamPolicySettings, + testIamPermissionsSettings); + } + + 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 createHttpJsonDefault() { + Builder builder = new Builder(((ClientContext) null)); + + builder.setTransportChannelProvider(defaultHttpJsonTransportProviderBuilder().build()); + builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); + builder.setInternalHeaderProvider(defaultHttpJsonApiClientHeaderProviderBuilder().build()); + builder.setMtlsEndpoint(getDefaultMtlsEndpoint()); + builder.setSwitchToMtlsEndpointAllowed(true); + + return initDefaults(builder); + } + + private static Builder initDefaults(Builder builder) { + builder + .createRoomSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + + builder + .getRoomSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")); + + builder + .updateRoomSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + + builder + .deleteRoomSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + + builder + .listRoomsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")); + + builder + .createBlurbSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + + builder + .getBlurbSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")); + + builder + .updateBlurbSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + + builder + .deleteBlurbSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + + builder + .listBlurbsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")); + + builder + .searchBlurbsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")); + + builder + .streamBlurbsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + + builder + .listLocationsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + + builder + .getLocationSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + + builder + .setIamPolicySettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + + builder + .getIamPolicySettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + + builder + .testIamPermissionsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + + builder + .searchBlurbsOperationSettings() + .setInitialCallSettings( + UnaryCallSettings + .newUnaryCallSettingsBuilder() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")) + .build()) + .setResponseTransformer( + ProtoOperationTransformers.ResponseTransformer.create(SearchBlurbsResponse.class)) + .setMetadataTransformer( + ProtoOperationTransformers.MetadataTransformer.create(SearchBlurbsMetadata.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 createRoom. */ + public UnaryCallSettings.Builder createRoomSettings() { + return createRoomSettings; + } + + /** Returns the builder for the settings used for calls to getRoom. */ + public UnaryCallSettings.Builder getRoomSettings() { + return getRoomSettings; + } + + /** Returns the builder for the settings used for calls to updateRoom. */ + public UnaryCallSettings.Builder updateRoomSettings() { + return updateRoomSettings; + } + + /** Returns the builder for the settings used for calls to deleteRoom. */ + public UnaryCallSettings.Builder deleteRoomSettings() { + return deleteRoomSettings; + } + + /** Returns the builder for the settings used for calls to listRooms. */ + public PagedCallSettings.Builder + listRoomsSettings() { + return listRoomsSettings; + } + + /** Returns the builder for the settings used for calls to createBlurb. */ + public UnaryCallSettings.Builder createBlurbSettings() { + return createBlurbSettings; + } + + /** Returns the builder for the settings used for calls to getBlurb. */ + public UnaryCallSettings.Builder getBlurbSettings() { + return getBlurbSettings; + } + + /** Returns the builder for the settings used for calls to updateBlurb. */ + public UnaryCallSettings.Builder updateBlurbSettings() { + return updateBlurbSettings; + } + + /** Returns the builder for the settings used for calls to deleteBlurb. */ + public UnaryCallSettings.Builder deleteBlurbSettings() { + return deleteBlurbSettings; + } + + /** Returns the builder for the settings used for calls to listBlurbs. */ + public PagedCallSettings.Builder + listBlurbsSettings() { + return listBlurbsSettings; + } + + /** Returns the builder for the settings used for calls to searchBlurbs. */ + public UnaryCallSettings.Builder searchBlurbsSettings() { + return searchBlurbsSettings; + } + + /** Returns the builder for the settings used for calls to searchBlurbs. */ + public OperationCallSettings.Builder< + SearchBlurbsRequest, SearchBlurbsResponse, SearchBlurbsMetadata> + searchBlurbsOperationSettings() { + return searchBlurbsOperationSettings; + } + + /** Returns the builder for the settings used for calls to streamBlurbs. */ + public ServerStreamingCallSettings.Builder + streamBlurbsSettings() { + return streamBlurbsSettings; + } + + /** Returns the builder for the settings used for calls to sendBlurbs. */ + public StreamingCallSettings.Builder + sendBlurbsSettings() { + return sendBlurbsSettings; + } + + /** Returns the builder for the settings used for calls to connect. */ + public StreamingCallSettings.Builder connectSettings() { + return connectSettings; + } + + /** Returns the builder for the settings used for calls to listLocations. */ + public PagedCallSettings.Builder< + ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse> + listLocationsSettings() { + return listLocationsSettings; + } + + /** Returns the builder for the settings used for calls to getLocation. */ + public UnaryCallSettings.Builder getLocationSettings() { + return getLocationSettings; + } + + /** Returns the builder for the settings used for calls to setIamPolicy. */ + public UnaryCallSettings.Builder setIamPolicySettings() { + return setIamPolicySettings; + } + + /** Returns the builder for the settings used for calls to getIamPolicy. */ + public UnaryCallSettings.Builder getIamPolicySettings() { + return getIamPolicySettings; + } + + /** Returns the builder for the settings used for calls to testIamPermissions. */ + public UnaryCallSettings.Builder + testIamPermissionsSettings() { + return testIamPermissionsSettings; + } + + @Override + public MessagingStubSettings build() throws IOException { + return new MessagingStubSettings(this); + } + } +} diff --git a/java-showcase-3.25.8/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/SequenceServiceStub.java b/java-showcase-3.25.8/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/SequenceServiceStub.java new file mode 100644 index 0000000000..10ffc4271d --- /dev/null +++ b/java-showcase-3.25.8/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/SequenceServiceStub.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. + */ + +package com.google.showcase.v1beta1.stub; + +import static com.google.showcase.v1beta1.SequenceServiceClient.ListLocationsPagedResponse; + +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.protobuf.Empty; +import com.google.showcase.v1beta1.AttemptSequenceRequest; +import com.google.showcase.v1beta1.AttemptStreamingSequenceRequest; +import com.google.showcase.v1beta1.AttemptStreamingSequenceResponse; +import com.google.showcase.v1beta1.CreateSequenceRequest; +import com.google.showcase.v1beta1.CreateStreamingSequenceRequest; +import com.google.showcase.v1beta1.GetSequenceReportRequest; +import com.google.showcase.v1beta1.GetStreamingSequenceReportRequest; +import com.google.showcase.v1beta1.Sequence; +import com.google.showcase.v1beta1.SequenceReport; +import com.google.showcase.v1beta1.StreamingSequence; +import com.google.showcase.v1beta1.StreamingSequenceReport; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Base stub class for the SequenceService service API. + * + *

        This class is for advanced usage and reflects the underlying API directly. + */ +@BetaApi +@Generated("by gapic-generator-java") +public abstract class SequenceServiceStub implements BackgroundResource { + + public UnaryCallable createSequenceCallable() { + throw new UnsupportedOperationException("Not implemented: createSequenceCallable()"); + } + + public UnaryCallable + createStreamingSequenceCallable() { + throw new UnsupportedOperationException("Not implemented: createStreamingSequenceCallable()"); + } + + public UnaryCallable getSequenceReportCallable() { + throw new UnsupportedOperationException("Not implemented: getSequenceReportCallable()"); + } + + public UnaryCallable + getStreamingSequenceReportCallable() { + throw new UnsupportedOperationException( + "Not implemented: getStreamingSequenceReportCallable()"); + } + + public UnaryCallable attemptSequenceCallable() { + throw new UnsupportedOperationException("Not implemented: attemptSequenceCallable()"); + } + + public ServerStreamingCallable + attemptStreamingSequenceCallable() { + throw new UnsupportedOperationException("Not implemented: attemptStreamingSequenceCallable()"); + } + + public UnaryCallable + listLocationsPagedCallable() { + throw new UnsupportedOperationException("Not implemented: listLocationsPagedCallable()"); + } + + public UnaryCallable listLocationsCallable() { + throw new UnsupportedOperationException("Not implemented: listLocationsCallable()"); + } + + public UnaryCallable getLocationCallable() { + throw new UnsupportedOperationException("Not implemented: getLocationCallable()"); + } + + public UnaryCallable setIamPolicyCallable() { + throw new UnsupportedOperationException("Not implemented: setIamPolicyCallable()"); + } + + public UnaryCallable getIamPolicyCallable() { + throw new UnsupportedOperationException("Not implemented: getIamPolicyCallable()"); + } + + public UnaryCallable + testIamPermissionsCallable() { + throw new UnsupportedOperationException("Not implemented: testIamPermissionsCallable()"); + } + + @Override + public abstract void close(); +} diff --git a/java-showcase-3.25.8/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/SequenceServiceStubSettings.java b/java-showcase-3.25.8/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/SequenceServiceStubSettings.java new file mode 100644 index 0000000000..00bc19a4c0 --- /dev/null +++ b/java-showcase-3.25.8/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/SequenceServiceStubSettings.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. + */ + +package com.google.showcase.v1beta1.stub; + +import static com.google.showcase.v1beta1.SequenceServiceClient.ListLocationsPagedResponse; + +import com.google.api.core.ApiFunction; +import com.google.api.core.ApiFuture; +import com.google.api.core.BetaApi; +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.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.HttpJsonTransportChannel; +import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; +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.ServerStreamingCallSettings; +import com.google.api.gax.rpc.StatusCode; +import com.google.api.gax.rpc.StubSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +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.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.protobuf.Empty; +import com.google.showcase.v1beta1.AttemptSequenceRequest; +import com.google.showcase.v1beta1.AttemptStreamingSequenceRequest; +import com.google.showcase.v1beta1.AttemptStreamingSequenceResponse; +import com.google.showcase.v1beta1.CreateSequenceRequest; +import com.google.showcase.v1beta1.CreateStreamingSequenceRequest; +import com.google.showcase.v1beta1.GetSequenceReportRequest; +import com.google.showcase.v1beta1.GetStreamingSequenceReportRequest; +import com.google.showcase.v1beta1.Sequence; +import com.google.showcase.v1beta1.SequenceReport; +import com.google.showcase.v1beta1.StreamingSequence; +import com.google.showcase.v1beta1.StreamingSequenceReport; +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 SequenceServiceStub}. + * + *

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

          + *
        • The default service address (localhost) and default port (7469) 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 createSequence: + * + *

        {@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
        + * SequenceServiceStubSettings.Builder sequenceServiceSettingsBuilder =
        + *     SequenceServiceStubSettings.newBuilder();
        + * sequenceServiceSettingsBuilder
        + *     .createSequenceSettings()
        + *     .setRetrySettings(
        + *         sequenceServiceSettingsBuilder
        + *             .createSequenceSettings()
        + *             .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());
        + * SequenceServiceStubSettings sequenceServiceSettings = sequenceServiceSettingsBuilder.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. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class SequenceServiceStubSettings extends StubSettings { + /** The default scopes of the service. */ + private static final ImmutableList DEFAULT_SERVICE_SCOPES = + ImmutableList.builder().build(); + + private final UnaryCallSettings createSequenceSettings; + private final UnaryCallSettings + createStreamingSequenceSettings; + private final UnaryCallSettings + getSequenceReportSettings; + private final UnaryCallSettings + getStreamingSequenceReportSettings; + private final UnaryCallSettings attemptSequenceSettings; + private final ServerStreamingCallSettings< + AttemptStreamingSequenceRequest, AttemptStreamingSequenceResponse> + attemptStreamingSequenceSettings; + private final PagedCallSettings< + ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse> + listLocationsSettings; + private final UnaryCallSettings getLocationSettings; + private final UnaryCallSettings setIamPolicySettings; + private final UnaryCallSettings getIamPolicySettings; + private final UnaryCallSettings + testIamPermissionsSettings; + + private static final PagedListDescriptor + LIST_LOCATIONS_PAGE_STR_DESC = + new PagedListDescriptor() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public ListLocationsRequest injectToken(ListLocationsRequest payload, String token) { + return ListLocationsRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public ListLocationsRequest injectPageSize(ListLocationsRequest payload, int pageSize) { + return ListLocationsRequest.newBuilder(payload).setPageSize(pageSize).build(); + } + + @Override + public Integer extractPageSize(ListLocationsRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(ListLocationsResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources(ListLocationsResponse payload) { + return payload.getLocationsList(); + } + }; + + private static final PagedListResponseFactory< + ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse> + LIST_LOCATIONS_PAGE_STR_FACT = + new PagedListResponseFactory< + ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListLocationsRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext pageContext = + PageContext.create(callable, LIST_LOCATIONS_PAGE_STR_DESC, request, context); + return ListLocationsPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + /** Returns the object with the settings used for calls to createSequence. */ + public UnaryCallSettings createSequenceSettings() { + return createSequenceSettings; + } + + /** Returns the object with the settings used for calls to createStreamingSequence. */ + public UnaryCallSettings + createStreamingSequenceSettings() { + return createStreamingSequenceSettings; + } + + /** Returns the object with the settings used for calls to getSequenceReport. */ + public UnaryCallSettings getSequenceReportSettings() { + return getSequenceReportSettings; + } + + /** Returns the object with the settings used for calls to getStreamingSequenceReport. */ + public UnaryCallSettings + getStreamingSequenceReportSettings() { + return getStreamingSequenceReportSettings; + } + + /** Returns the object with the settings used for calls to attemptSequence. */ + public UnaryCallSettings attemptSequenceSettings() { + return attemptSequenceSettings; + } + + /** Returns the object with the settings used for calls to attemptStreamingSequence. */ + public ServerStreamingCallSettings< + AttemptStreamingSequenceRequest, AttemptStreamingSequenceResponse> + attemptStreamingSequenceSettings() { + return attemptStreamingSequenceSettings; + } + + /** Returns the object with the settings used for calls to listLocations. */ + public PagedCallSettings + listLocationsSettings() { + return listLocationsSettings; + } + + /** Returns the object with the settings used for calls to getLocation. */ + public UnaryCallSettings getLocationSettings() { + return getLocationSettings; + } + + /** Returns the object with the settings used for calls to setIamPolicy. */ + public UnaryCallSettings setIamPolicySettings() { + return setIamPolicySettings; + } + + /** Returns the object with the settings used for calls to getIamPolicy. */ + public UnaryCallSettings getIamPolicySettings() { + return getIamPolicySettings; + } + + /** Returns the object with the settings used for calls to testIamPermissions. */ + public UnaryCallSettings + testIamPermissionsSettings() { + return testIamPermissionsSettings; + } + + public SequenceServiceStub createStub() throws IOException { + if (getTransportChannelProvider() + .getTransportName() + .equals(GrpcTransportChannel.getGrpcTransportName())) { + return GrpcSequenceServiceStub.create(this); + } + if (getTransportChannelProvider() + .getTransportName() + .equals(HttpJsonTransportChannel.getHttpJsonTransportName())) { + return HttpJsonSequenceServiceStub.create(this); + } + throw new UnsupportedOperationException( + String.format( + "Transport not supported: %s", getTransportChannelProvider().getTransportName())); + } + + /** Returns a builder for the default ExecutorProvider for this service. */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return InstantiatingExecutorProvider.newBuilder(); + } + + /** Returns the default service endpoint. */ + @ObsoleteApi("Use getEndpoint() instead") + public static String getDefaultEndpoint() { + return "localhost:7469"; + } + + /** Returns the default mTLS service endpoint. */ + public static String getDefaultMtlsEndpoint() { + return "localhost:7469"; + } + + /** 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 gRPC ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return InstantiatingGrpcChannelProvider.newBuilder() + .setMaxInboundMessageSize(Integer.MAX_VALUE); + } + + /** Returns a builder for the default REST ChannelProvider for this service. */ + @BetaApi + public static InstantiatingHttpJsonChannelProvider.Builder + defaultHttpJsonTransportProviderBuilder() { + return InstantiatingHttpJsonChannelProvider.newBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return defaultGrpcTransportProviderBuilder().build(); + } + + public static ApiClientHeaderProvider.Builder defaultGrpcApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken( + "gapic", GaxProperties.getLibraryVersion(SequenceServiceStubSettings.class)) + .setTransportToken( + GaxGrpcProperties.getGrpcTokenName(), GaxGrpcProperties.getGrpcVersion()); + } + + public static ApiClientHeaderProvider.Builder defaultHttpJsonApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken( + "gapic", GaxProperties.getLibraryVersion(SequenceServiceStubSettings.class)) + .setTransportToken( + GaxHttpJsonProperties.getHttpJsonTokenName(), + GaxHttpJsonProperties.getHttpJsonVersion()); + } + + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return SequenceServiceStubSettings.defaultGrpcApiClientHeaderProviderBuilder(); + } + + /** Returns a new gRPC builder for this class. */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** Returns a new REST builder for this class. */ + public static Builder newHttpJsonBuilder() { + return Builder.createHttpJsonDefault(); + } + + /** 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 SequenceServiceStubSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + + createSequenceSettings = settingsBuilder.createSequenceSettings().build(); + createStreamingSequenceSettings = settingsBuilder.createStreamingSequenceSettings().build(); + getSequenceReportSettings = settingsBuilder.getSequenceReportSettings().build(); + getStreamingSequenceReportSettings = + settingsBuilder.getStreamingSequenceReportSettings().build(); + attemptSequenceSettings = settingsBuilder.attemptSequenceSettings().build(); + attemptStreamingSequenceSettings = settingsBuilder.attemptStreamingSequenceSettings().build(); + listLocationsSettings = settingsBuilder.listLocationsSettings().build(); + getLocationSettings = settingsBuilder.getLocationSettings().build(); + setIamPolicySettings = settingsBuilder.setIamPolicySettings().build(); + getIamPolicySettings = settingsBuilder.getIamPolicySettings().build(); + testIamPermissionsSettings = settingsBuilder.testIamPermissionsSettings().build(); + } + + /** Builder for SequenceServiceStubSettings. */ + public static class Builder extends StubSettings.Builder { + private final ImmutableList> unaryMethodSettingsBuilders; + private final UnaryCallSettings.Builder createSequenceSettings; + private final UnaryCallSettings.Builder + createStreamingSequenceSettings; + private final UnaryCallSettings.Builder + getSequenceReportSettings; + private final UnaryCallSettings.Builder< + GetStreamingSequenceReportRequest, StreamingSequenceReport> + getStreamingSequenceReportSettings; + private final UnaryCallSettings.Builder attemptSequenceSettings; + private final ServerStreamingCallSettings.Builder< + AttemptStreamingSequenceRequest, AttemptStreamingSequenceResponse> + attemptStreamingSequenceSettings; + private final PagedCallSettings.Builder< + ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse> + listLocationsSettings; + private final UnaryCallSettings.Builder getLocationSettings; + private final UnaryCallSettings.Builder setIamPolicySettings; + private final UnaryCallSettings.Builder getIamPolicySettings; + private final UnaryCallSettings.Builder + testIamPermissionsSettings; + private static final ImmutableMap> + RETRYABLE_CODE_DEFINITIONS; + + static { + ImmutableMap.Builder> definitions = + ImmutableMap.builder(); + definitions.put( + "no_retry_0_codes", ImmutableSet.copyOf(Lists.newArrayList())); + definitions.put( + "retry_policy_1_codes", + ImmutableSet.copyOf( + Lists.newArrayList( + StatusCode.Code.UNAVAILABLE, StatusCode.Code.UNKNOWN))); + RETRYABLE_CODE_DEFINITIONS = definitions.build(); + } + + private static final ImmutableMap RETRY_PARAM_DEFINITIONS; + + static { + ImmutableMap.Builder definitions = ImmutableMap.builder(); + RetrySettings settings = null; + settings = + RetrySettings.newBuilder() + .setInitialRpcTimeoutDuration(Duration.ofMillis(5000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeoutDuration(Duration.ofMillis(5000L)) + .setTotalTimeoutDuration(Duration.ofMillis(5000L)) + .build(); + definitions.put("no_retry_0_params", settings); + settings = + RetrySettings.newBuilder() + .setInitialRetryDelayDuration(Duration.ofMillis(100L)) + .setRetryDelayMultiplier(2.0) + .setMaxRetryDelayDuration(Duration.ofMillis(3000L)) + .setInitialRpcTimeoutDuration(Duration.ofMillis(10000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeoutDuration(Duration.ofMillis(10000L)) + .setTotalTimeoutDuration(Duration.ofMillis(10000L)) + .build(); + definitions.put("retry_policy_1_params", settings); + RETRY_PARAM_DEFINITIONS = definitions.build(); + } + + protected Builder() { + this(((ClientContext) null)); + } + + protected Builder(ClientContext clientContext) { + super(clientContext); + + createSequenceSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + createStreamingSequenceSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + getSequenceReportSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + getStreamingSequenceReportSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + attemptSequenceSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + attemptStreamingSequenceSettings = ServerStreamingCallSettings.newBuilder(); + listLocationsSettings = PagedCallSettings.newBuilder(LIST_LOCATIONS_PAGE_STR_FACT); + getLocationSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + setIamPolicySettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + getIamPolicySettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + testIamPermissionsSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + createSequenceSettings, + createStreamingSequenceSettings, + getSequenceReportSettings, + getStreamingSequenceReportSettings, + attemptSequenceSettings, + listLocationsSettings, + getLocationSettings, + setIamPolicySettings, + getIamPolicySettings, + testIamPermissionsSettings); + initDefaults(this); + } + + protected Builder(SequenceServiceStubSettings settings) { + super(settings); + + createSequenceSettings = settings.createSequenceSettings.toBuilder(); + createStreamingSequenceSettings = settings.createStreamingSequenceSettings.toBuilder(); + getSequenceReportSettings = settings.getSequenceReportSettings.toBuilder(); + getStreamingSequenceReportSettings = settings.getStreamingSequenceReportSettings.toBuilder(); + attemptSequenceSettings = settings.attemptSequenceSettings.toBuilder(); + attemptStreamingSequenceSettings = settings.attemptStreamingSequenceSettings.toBuilder(); + listLocationsSettings = settings.listLocationsSettings.toBuilder(); + getLocationSettings = settings.getLocationSettings.toBuilder(); + setIamPolicySettings = settings.setIamPolicySettings.toBuilder(); + getIamPolicySettings = settings.getIamPolicySettings.toBuilder(); + testIamPermissionsSettings = settings.testIamPermissionsSettings.toBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + createSequenceSettings, + createStreamingSequenceSettings, + getSequenceReportSettings, + getStreamingSequenceReportSettings, + attemptSequenceSettings, + listLocationsSettings, + getLocationSettings, + setIamPolicySettings, + getIamPolicySettings, + testIamPermissionsSettings); + } + + 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 createHttpJsonDefault() { + Builder builder = new Builder(((ClientContext) null)); + + builder.setTransportChannelProvider(defaultHttpJsonTransportProviderBuilder().build()); + builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); + builder.setInternalHeaderProvider(defaultHttpJsonApiClientHeaderProviderBuilder().build()); + builder.setMtlsEndpoint(getDefaultMtlsEndpoint()); + builder.setSwitchToMtlsEndpointAllowed(true); + + return initDefaults(builder); + } + + private static Builder initDefaults(Builder builder) { + builder + .createSequenceSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + + builder + .createStreamingSequenceSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + + builder + .getSequenceReportSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + + builder + .getStreamingSequenceReportSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + + builder + .attemptSequenceSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")); + + builder + .attemptStreamingSequenceSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + + builder + .listLocationsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + + builder + .getLocationSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + + builder + .setIamPolicySettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + + builder + .getIamPolicySettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + + builder + .testIamPermissionsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + + return builder; + } + + /** + * Applies the given settings updater function to all of the unary API methods in this service. + * + *

        Note: This method does not support applying settings to streaming methods. + */ + public Builder applyToAllUnaryMethods( + ApiFunction, Void> settingsUpdater) { + super.applyToAllUnaryMethods(unaryMethodSettingsBuilders, settingsUpdater); + return this; + } + + public ImmutableList> unaryMethodSettingsBuilders() { + return unaryMethodSettingsBuilders; + } + + /** Returns the builder for the settings used for calls to createSequence. */ + public UnaryCallSettings.Builder createSequenceSettings() { + return createSequenceSettings; + } + + /** Returns the builder for the settings used for calls to createStreamingSequence. */ + public UnaryCallSettings.Builder + createStreamingSequenceSettings() { + return createStreamingSequenceSettings; + } + + /** Returns the builder for the settings used for calls to getSequenceReport. */ + public UnaryCallSettings.Builder + getSequenceReportSettings() { + return getSequenceReportSettings; + } + + /** Returns the builder for the settings used for calls to getStreamingSequenceReport. */ + public UnaryCallSettings.Builder + getStreamingSequenceReportSettings() { + return getStreamingSequenceReportSettings; + } + + /** Returns the builder for the settings used for calls to attemptSequence. */ + public UnaryCallSettings.Builder attemptSequenceSettings() { + return attemptSequenceSettings; + } + + /** Returns the builder for the settings used for calls to attemptStreamingSequence. */ + public ServerStreamingCallSettings.Builder< + AttemptStreamingSequenceRequest, AttemptStreamingSequenceResponse> + attemptStreamingSequenceSettings() { + return attemptStreamingSequenceSettings; + } + + /** Returns the builder for the settings used for calls to listLocations. */ + public PagedCallSettings.Builder< + ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse> + listLocationsSettings() { + return listLocationsSettings; + } + + /** Returns the builder for the settings used for calls to getLocation. */ + public UnaryCallSettings.Builder getLocationSettings() { + return getLocationSettings; + } + + /** Returns the builder for the settings used for calls to setIamPolicy. */ + public UnaryCallSettings.Builder setIamPolicySettings() { + return setIamPolicySettings; + } + + /** Returns the builder for the settings used for calls to getIamPolicy. */ + public UnaryCallSettings.Builder getIamPolicySettings() { + return getIamPolicySettings; + } + + /** Returns the builder for the settings used for calls to testIamPermissions. */ + public UnaryCallSettings.Builder + testIamPermissionsSettings() { + return testIamPermissionsSettings; + } + + @Override + public SequenceServiceStubSettings build() throws IOException { + return new SequenceServiceStubSettings(this); + } + } +} diff --git a/java-showcase-3.25.8/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/TestingStub.java b/java-showcase-3.25.8/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/TestingStub.java new file mode 100644 index 0000000000..fba2d4fa93 --- /dev/null +++ b/java-showcase-3.25.8/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/TestingStub.java @@ -0,0 +1,129 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.stub; + +import static com.google.showcase.v1beta1.TestingClient.ListLocationsPagedResponse; +import static com.google.showcase.v1beta1.TestingClient.ListSessionsPagedResponse; +import static com.google.showcase.v1beta1.TestingClient.ListTestsPagedResponse; + +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.protobuf.Empty; +import com.google.showcase.v1beta1.CreateSessionRequest; +import com.google.showcase.v1beta1.DeleteSessionRequest; +import com.google.showcase.v1beta1.DeleteTestRequest; +import com.google.showcase.v1beta1.GetSessionRequest; +import com.google.showcase.v1beta1.ListSessionsRequest; +import com.google.showcase.v1beta1.ListSessionsResponse; +import com.google.showcase.v1beta1.ListTestsRequest; +import com.google.showcase.v1beta1.ListTestsResponse; +import com.google.showcase.v1beta1.ReportSessionRequest; +import com.google.showcase.v1beta1.ReportSessionResponse; +import com.google.showcase.v1beta1.Session; +import com.google.showcase.v1beta1.VerifyTestRequest; +import com.google.showcase.v1beta1.VerifyTestResponse; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Base stub class for the Testing service API. + * + *

        This class is for advanced usage and reflects the underlying API directly. + */ +@BetaApi +@Generated("by gapic-generator-java") +public abstract class TestingStub implements BackgroundResource { + + public UnaryCallable createSessionCallable() { + throw new UnsupportedOperationException("Not implemented: createSessionCallable()"); + } + + public UnaryCallable getSessionCallable() { + throw new UnsupportedOperationException("Not implemented: getSessionCallable()"); + } + + public UnaryCallable listSessionsPagedCallable() { + throw new UnsupportedOperationException("Not implemented: listSessionsPagedCallable()"); + } + + public UnaryCallable listSessionsCallable() { + throw new UnsupportedOperationException("Not implemented: listSessionsCallable()"); + } + + public UnaryCallable deleteSessionCallable() { + throw new UnsupportedOperationException("Not implemented: deleteSessionCallable()"); + } + + public UnaryCallable reportSessionCallable() { + throw new UnsupportedOperationException("Not implemented: reportSessionCallable()"); + } + + public UnaryCallable listTestsPagedCallable() { + throw new UnsupportedOperationException("Not implemented: listTestsPagedCallable()"); + } + + public UnaryCallable listTestsCallable() { + throw new UnsupportedOperationException("Not implemented: listTestsCallable()"); + } + + public UnaryCallable deleteTestCallable() { + throw new UnsupportedOperationException("Not implemented: deleteTestCallable()"); + } + + public UnaryCallable verifyTestCallable() { + throw new UnsupportedOperationException("Not implemented: verifyTestCallable()"); + } + + public UnaryCallable + listLocationsPagedCallable() { + throw new UnsupportedOperationException("Not implemented: listLocationsPagedCallable()"); + } + + public UnaryCallable listLocationsCallable() { + throw new UnsupportedOperationException("Not implemented: listLocationsCallable()"); + } + + public UnaryCallable getLocationCallable() { + throw new UnsupportedOperationException("Not implemented: getLocationCallable()"); + } + + public UnaryCallable setIamPolicyCallable() { + throw new UnsupportedOperationException("Not implemented: setIamPolicyCallable()"); + } + + public UnaryCallable getIamPolicyCallable() { + throw new UnsupportedOperationException("Not implemented: getIamPolicyCallable()"); + } + + public UnaryCallable + testIamPermissionsCallable() { + throw new UnsupportedOperationException("Not implemented: testIamPermissionsCallable()"); + } + + @Override + public abstract void close(); +} diff --git a/java-showcase-3.25.8/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/TestingStubSettings.java b/java-showcase-3.25.8/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/TestingStubSettings.java new file mode 100644 index 0000000000..0f1fa4ad5b --- /dev/null +++ b/java-showcase-3.25.8/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/TestingStubSettings.java @@ -0,0 +1,801 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.stub; + +import static com.google.showcase.v1beta1.TestingClient.ListLocationsPagedResponse; +import static com.google.showcase.v1beta1.TestingClient.ListSessionsPagedResponse; +import static com.google.showcase.v1beta1.TestingClient.ListTestsPagedResponse; + +import com.google.api.core.ApiFunction; +import com.google.api.core.ApiFuture; +import com.google.api.core.BetaApi; +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.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.HttpJsonTransportChannel; +import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; +import com.google.api.gax.retrying.RetrySettings; +import com.google.api.gax.rpc.ApiCallContext; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.PagedListDescriptor; +import com.google.api.gax.rpc.PagedListResponseFactory; +import com.google.api.gax.rpc.StatusCode; +import com.google.api.gax.rpc.StubSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +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.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.protobuf.Empty; +import com.google.showcase.v1beta1.CreateSessionRequest; +import com.google.showcase.v1beta1.DeleteSessionRequest; +import com.google.showcase.v1beta1.DeleteTestRequest; +import com.google.showcase.v1beta1.GetSessionRequest; +import com.google.showcase.v1beta1.ListSessionsRequest; +import com.google.showcase.v1beta1.ListSessionsResponse; +import com.google.showcase.v1beta1.ListTestsRequest; +import com.google.showcase.v1beta1.ListTestsResponse; +import com.google.showcase.v1beta1.ReportSessionRequest; +import com.google.showcase.v1beta1.ReportSessionResponse; +import com.google.showcase.v1beta1.Session; +import com.google.showcase.v1beta1.Test; +import com.google.showcase.v1beta1.VerifyTestRequest; +import com.google.showcase.v1beta1.VerifyTestResponse; +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 TestingStub}. + * + *

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

          + *
        • The default service address (localhost) and default port (7469) 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 createSession: + * + *

        {@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
        + * TestingStubSettings.Builder testingSettingsBuilder = TestingStubSettings.newBuilder();
        + * testingSettingsBuilder
        + *     .createSessionSettings()
        + *     .setRetrySettings(
        + *         testingSettingsBuilder
        + *             .createSessionSettings()
        + *             .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());
        + * TestingStubSettings testingSettings = testingSettingsBuilder.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. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class TestingStubSettings extends StubSettings { + /** The default scopes of the service. */ + private static final ImmutableList DEFAULT_SERVICE_SCOPES = + ImmutableList.builder().build(); + + private final UnaryCallSettings createSessionSettings; + private final UnaryCallSettings getSessionSettings; + private final PagedCallSettings< + ListSessionsRequest, ListSessionsResponse, ListSessionsPagedResponse> + listSessionsSettings; + private final UnaryCallSettings deleteSessionSettings; + private final UnaryCallSettings + reportSessionSettings; + private final PagedCallSettings + listTestsSettings; + private final UnaryCallSettings deleteTestSettings; + private final UnaryCallSettings verifyTestSettings; + private final PagedCallSettings< + ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse> + listLocationsSettings; + private final UnaryCallSettings getLocationSettings; + private final UnaryCallSettings setIamPolicySettings; + private final UnaryCallSettings getIamPolicySettings; + private final UnaryCallSettings + testIamPermissionsSettings; + + private static final PagedListDescriptor + LIST_SESSIONS_PAGE_STR_DESC = + new PagedListDescriptor() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public ListSessionsRequest injectToken(ListSessionsRequest payload, String token) { + return ListSessionsRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public ListSessionsRequest injectPageSize(ListSessionsRequest payload, int pageSize) { + return ListSessionsRequest.newBuilder(payload).setPageSize(pageSize).build(); + } + + @Override + public Integer extractPageSize(ListSessionsRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(ListSessionsResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources(ListSessionsResponse payload) { + return payload.getSessionsList(); + } + }; + + private static final PagedListDescriptor + LIST_TESTS_PAGE_STR_DESC = + new PagedListDescriptor() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public ListTestsRequest injectToken(ListTestsRequest payload, String token) { + return ListTestsRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public ListTestsRequest injectPageSize(ListTestsRequest payload, int pageSize) { + return ListTestsRequest.newBuilder(payload).setPageSize(pageSize).build(); + } + + @Override + public Integer extractPageSize(ListTestsRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(ListTestsResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources(ListTestsResponse payload) { + return payload.getTestsList(); + } + }; + + private static final PagedListDescriptor + LIST_LOCATIONS_PAGE_STR_DESC = + new PagedListDescriptor() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public ListLocationsRequest injectToken(ListLocationsRequest payload, String token) { + return ListLocationsRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public ListLocationsRequest injectPageSize(ListLocationsRequest payload, int pageSize) { + return ListLocationsRequest.newBuilder(payload).setPageSize(pageSize).build(); + } + + @Override + public Integer extractPageSize(ListLocationsRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(ListLocationsResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources(ListLocationsResponse payload) { + return payload.getLocationsList(); + } + }; + + private static final PagedListResponseFactory< + ListSessionsRequest, ListSessionsResponse, ListSessionsPagedResponse> + LIST_SESSIONS_PAGE_STR_FACT = + new PagedListResponseFactory< + ListSessionsRequest, ListSessionsResponse, ListSessionsPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListSessionsRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext pageContext = + PageContext.create(callable, LIST_SESSIONS_PAGE_STR_DESC, request, context); + return ListSessionsPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + private static final PagedListResponseFactory< + ListTestsRequest, ListTestsResponse, ListTestsPagedResponse> + LIST_TESTS_PAGE_STR_FACT = + new PagedListResponseFactory< + ListTestsRequest, ListTestsResponse, ListTestsPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListTestsRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext pageContext = + PageContext.create(callable, LIST_TESTS_PAGE_STR_DESC, request, context); + return ListTestsPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + private static final PagedListResponseFactory< + ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse> + LIST_LOCATIONS_PAGE_STR_FACT = + new PagedListResponseFactory< + ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListLocationsRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext pageContext = + PageContext.create(callable, LIST_LOCATIONS_PAGE_STR_DESC, request, context); + return ListLocationsPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + /** Returns the object with the settings used for calls to createSession. */ + public UnaryCallSettings createSessionSettings() { + return createSessionSettings; + } + + /** Returns the object with the settings used for calls to getSession. */ + public UnaryCallSettings getSessionSettings() { + return getSessionSettings; + } + + /** Returns the object with the settings used for calls to listSessions. */ + public PagedCallSettings + listSessionsSettings() { + return listSessionsSettings; + } + + /** Returns the object with the settings used for calls to deleteSession. */ + public UnaryCallSettings deleteSessionSettings() { + return deleteSessionSettings; + } + + /** Returns the object with the settings used for calls to reportSession. */ + public UnaryCallSettings reportSessionSettings() { + return reportSessionSettings; + } + + /** Returns the object with the settings used for calls to listTests. */ + public PagedCallSettings + listTestsSettings() { + return listTestsSettings; + } + + /** Returns the object with the settings used for calls to deleteTest. */ + public UnaryCallSettings deleteTestSettings() { + return deleteTestSettings; + } + + /** Returns the object with the settings used for calls to verifyTest. */ + public UnaryCallSettings verifyTestSettings() { + return verifyTestSettings; + } + + /** Returns the object with the settings used for calls to listLocations. */ + public PagedCallSettings + listLocationsSettings() { + return listLocationsSettings; + } + + /** Returns the object with the settings used for calls to getLocation. */ + public UnaryCallSettings getLocationSettings() { + return getLocationSettings; + } + + /** Returns the object with the settings used for calls to setIamPolicy. */ + public UnaryCallSettings setIamPolicySettings() { + return setIamPolicySettings; + } + + /** Returns the object with the settings used for calls to getIamPolicy. */ + public UnaryCallSettings getIamPolicySettings() { + return getIamPolicySettings; + } + + /** Returns the object with the settings used for calls to testIamPermissions. */ + public UnaryCallSettings + testIamPermissionsSettings() { + return testIamPermissionsSettings; + } + + public TestingStub createStub() throws IOException { + if (getTransportChannelProvider() + .getTransportName() + .equals(GrpcTransportChannel.getGrpcTransportName())) { + return GrpcTestingStub.create(this); + } + if (getTransportChannelProvider() + .getTransportName() + .equals(HttpJsonTransportChannel.getHttpJsonTransportName())) { + return HttpJsonTestingStub.create(this); + } + throw new UnsupportedOperationException( + String.format( + "Transport not supported: %s", getTransportChannelProvider().getTransportName())); + } + + /** Returns a builder for the default ExecutorProvider for this service. */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return InstantiatingExecutorProvider.newBuilder(); + } + + /** Returns the default service endpoint. */ + @ObsoleteApi("Use getEndpoint() instead") + public static String getDefaultEndpoint() { + return "localhost:7469"; + } + + /** Returns the default mTLS service endpoint. */ + public static String getDefaultMtlsEndpoint() { + return "localhost:7469"; + } + + /** 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 gRPC ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return InstantiatingGrpcChannelProvider.newBuilder() + .setMaxInboundMessageSize(Integer.MAX_VALUE); + } + + /** Returns a builder for the default REST ChannelProvider for this service. */ + @BetaApi + public static InstantiatingHttpJsonChannelProvider.Builder + defaultHttpJsonTransportProviderBuilder() { + return InstantiatingHttpJsonChannelProvider.newBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return defaultGrpcTransportProviderBuilder().build(); + } + + public static ApiClientHeaderProvider.Builder defaultGrpcApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken("gapic", GaxProperties.getLibraryVersion(TestingStubSettings.class)) + .setTransportToken( + GaxGrpcProperties.getGrpcTokenName(), GaxGrpcProperties.getGrpcVersion()); + } + + public static ApiClientHeaderProvider.Builder defaultHttpJsonApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken("gapic", GaxProperties.getLibraryVersion(TestingStubSettings.class)) + .setTransportToken( + GaxHttpJsonProperties.getHttpJsonTokenName(), + GaxHttpJsonProperties.getHttpJsonVersion()); + } + + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return TestingStubSettings.defaultGrpcApiClientHeaderProviderBuilder(); + } + + /** Returns a new gRPC builder for this class. */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** Returns a new REST builder for this class. */ + public static Builder newHttpJsonBuilder() { + return Builder.createHttpJsonDefault(); + } + + /** 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 TestingStubSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + + createSessionSettings = settingsBuilder.createSessionSettings().build(); + getSessionSettings = settingsBuilder.getSessionSettings().build(); + listSessionsSettings = settingsBuilder.listSessionsSettings().build(); + deleteSessionSettings = settingsBuilder.deleteSessionSettings().build(); + reportSessionSettings = settingsBuilder.reportSessionSettings().build(); + listTestsSettings = settingsBuilder.listTestsSettings().build(); + deleteTestSettings = settingsBuilder.deleteTestSettings().build(); + verifyTestSettings = settingsBuilder.verifyTestSettings().build(); + listLocationsSettings = settingsBuilder.listLocationsSettings().build(); + getLocationSettings = settingsBuilder.getLocationSettings().build(); + setIamPolicySettings = settingsBuilder.setIamPolicySettings().build(); + getIamPolicySettings = settingsBuilder.getIamPolicySettings().build(); + testIamPermissionsSettings = settingsBuilder.testIamPermissionsSettings().build(); + } + + /** Builder for TestingStubSettings. */ + public static class Builder extends StubSettings.Builder { + private final ImmutableList> unaryMethodSettingsBuilders; + private final UnaryCallSettings.Builder createSessionSettings; + private final UnaryCallSettings.Builder getSessionSettings; + private final PagedCallSettings.Builder< + ListSessionsRequest, ListSessionsResponse, ListSessionsPagedResponse> + listSessionsSettings; + private final UnaryCallSettings.Builder deleteSessionSettings; + private final UnaryCallSettings.Builder + reportSessionSettings; + private final PagedCallSettings.Builder< + ListTestsRequest, ListTestsResponse, ListTestsPagedResponse> + listTestsSettings; + private final UnaryCallSettings.Builder deleteTestSettings; + private final UnaryCallSettings.Builder + verifyTestSettings; + private final PagedCallSettings.Builder< + ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse> + listLocationsSettings; + private final UnaryCallSettings.Builder getLocationSettings; + private final UnaryCallSettings.Builder setIamPolicySettings; + private final UnaryCallSettings.Builder getIamPolicySettings; + private final UnaryCallSettings.Builder + testIamPermissionsSettings; + private static final ImmutableMap> + RETRYABLE_CODE_DEFINITIONS; + + static { + ImmutableMap.Builder> definitions = + ImmutableMap.builder(); + definitions.put("no_retry_codes", ImmutableSet.copyOf(Lists.newArrayList())); + RETRYABLE_CODE_DEFINITIONS = definitions.build(); + } + + private static final ImmutableMap RETRY_PARAM_DEFINITIONS; + + static { + ImmutableMap.Builder definitions = ImmutableMap.builder(); + RetrySettings settings = null; + settings = RetrySettings.newBuilder().setRpcTimeoutMultiplier(1.0).build(); + definitions.put("no_retry_params", settings); + RETRY_PARAM_DEFINITIONS = definitions.build(); + } + + protected Builder() { + this(((ClientContext) null)); + } + + protected Builder(ClientContext clientContext) { + super(clientContext); + + createSessionSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + getSessionSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + listSessionsSettings = PagedCallSettings.newBuilder(LIST_SESSIONS_PAGE_STR_FACT); + deleteSessionSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + reportSessionSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + listTestsSettings = PagedCallSettings.newBuilder(LIST_TESTS_PAGE_STR_FACT); + deleteTestSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + verifyTestSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + listLocationsSettings = PagedCallSettings.newBuilder(LIST_LOCATIONS_PAGE_STR_FACT); + getLocationSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + setIamPolicySettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + getIamPolicySettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + testIamPermissionsSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + createSessionSettings, + getSessionSettings, + listSessionsSettings, + deleteSessionSettings, + reportSessionSettings, + listTestsSettings, + deleteTestSettings, + verifyTestSettings, + listLocationsSettings, + getLocationSettings, + setIamPolicySettings, + getIamPolicySettings, + testIamPermissionsSettings); + initDefaults(this); + } + + protected Builder(TestingStubSettings settings) { + super(settings); + + createSessionSettings = settings.createSessionSettings.toBuilder(); + getSessionSettings = settings.getSessionSettings.toBuilder(); + listSessionsSettings = settings.listSessionsSettings.toBuilder(); + deleteSessionSettings = settings.deleteSessionSettings.toBuilder(); + reportSessionSettings = settings.reportSessionSettings.toBuilder(); + listTestsSettings = settings.listTestsSettings.toBuilder(); + deleteTestSettings = settings.deleteTestSettings.toBuilder(); + verifyTestSettings = settings.verifyTestSettings.toBuilder(); + listLocationsSettings = settings.listLocationsSettings.toBuilder(); + getLocationSettings = settings.getLocationSettings.toBuilder(); + setIamPolicySettings = settings.setIamPolicySettings.toBuilder(); + getIamPolicySettings = settings.getIamPolicySettings.toBuilder(); + testIamPermissionsSettings = settings.testIamPermissionsSettings.toBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + createSessionSettings, + getSessionSettings, + listSessionsSettings, + deleteSessionSettings, + reportSessionSettings, + listTestsSettings, + deleteTestSettings, + verifyTestSettings, + listLocationsSettings, + getLocationSettings, + setIamPolicySettings, + getIamPolicySettings, + testIamPermissionsSettings); + } + + 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 createHttpJsonDefault() { + Builder builder = new Builder(((ClientContext) null)); + + builder.setTransportChannelProvider(defaultHttpJsonTransportProviderBuilder().build()); + builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); + builder.setInternalHeaderProvider(defaultHttpJsonApiClientHeaderProviderBuilder().build()); + builder.setMtlsEndpoint(getDefaultMtlsEndpoint()); + builder.setSwitchToMtlsEndpointAllowed(true); + + return initDefaults(builder); + } + + private static Builder initDefaults(Builder builder) { + builder + .createSessionSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .getSessionSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .listSessionsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .deleteSessionSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .reportSessionSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .listTestsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .deleteTestSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .verifyTestSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .listLocationsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .getLocationSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .setIamPolicySettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .getIamPolicySettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .testIamPermissionsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_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 createSession. */ + public UnaryCallSettings.Builder createSessionSettings() { + return createSessionSettings; + } + + /** Returns the builder for the settings used for calls to getSession. */ + public UnaryCallSettings.Builder getSessionSettings() { + return getSessionSettings; + } + + /** Returns the builder for the settings used for calls to listSessions. */ + public PagedCallSettings.Builder< + ListSessionsRequest, ListSessionsResponse, ListSessionsPagedResponse> + listSessionsSettings() { + return listSessionsSettings; + } + + /** Returns the builder for the settings used for calls to deleteSession. */ + public UnaryCallSettings.Builder deleteSessionSettings() { + return deleteSessionSettings; + } + + /** Returns the builder for the settings used for calls to reportSession. */ + public UnaryCallSettings.Builder + reportSessionSettings() { + return reportSessionSettings; + } + + /** Returns the builder for the settings used for calls to listTests. */ + public PagedCallSettings.Builder + listTestsSettings() { + return listTestsSettings; + } + + /** Returns the builder for the settings used for calls to deleteTest. */ + public UnaryCallSettings.Builder deleteTestSettings() { + return deleteTestSettings; + } + + /** Returns the builder for the settings used for calls to verifyTest. */ + public UnaryCallSettings.Builder verifyTestSettings() { + return verifyTestSettings; + } + + /** Returns the builder for the settings used for calls to listLocations. */ + public PagedCallSettings.Builder< + ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse> + listLocationsSettings() { + return listLocationsSettings; + } + + /** Returns the builder for the settings used for calls to getLocation. */ + public UnaryCallSettings.Builder getLocationSettings() { + return getLocationSettings; + } + + /** Returns the builder for the settings used for calls to setIamPolicy. */ + public UnaryCallSettings.Builder setIamPolicySettings() { + return setIamPolicySettings; + } + + /** Returns the builder for the settings used for calls to getIamPolicy. */ + public UnaryCallSettings.Builder getIamPolicySettings() { + return getIamPolicySettings; + } + + /** Returns the builder for the settings used for calls to testIamPermissions. */ + public UnaryCallSettings.Builder + testIamPermissionsSettings() { + return testIamPermissionsSettings; + } + + @Override + public TestingStubSettings build() throws IOException { + return new TestingStubSettings(this); + } + } +} diff --git a/java-showcase-3.25.8/gapic-showcase/src/main/resources/META-INF/native-image/com.google.showcase.v1beta1/reflect-config.json b/java-showcase-3.25.8/gapic-showcase/src/main/resources/META-INF/native-image/com.google.showcase.v1beta1/reflect-config.json new file mode 100644 index 0000000000..328fa8f9db --- /dev/null +++ b/java-showcase-3.25.8/gapic-showcase/src/main/resources/META-INF/native-image/com.google.showcase.v1beta1/reflect-config.json @@ -0,0 +1,3863 @@ +[ + { + "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.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.FieldInfo", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.FieldInfo$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.FieldInfo$Format", + "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.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.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.RoutingParameter", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.RoutingParameter$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.RoutingRule", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.RoutingRule$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.api.TypeReference", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.TypeReference$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.location.GetLocationRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.location.GetLocationRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.location.ListLocationsRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.location.ListLocationsRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.location.ListLocationsResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.location.ListLocationsResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.location.Location", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.location.Location$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.iam.v1.AuditConfig", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.iam.v1.AuditConfig$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.iam.v1.AuditConfigDelta", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.iam.v1.AuditConfigDelta$Action", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.iam.v1.AuditConfigDelta$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.iam.v1.AuditLogConfig", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.iam.v1.AuditLogConfig$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.iam.v1.AuditLogConfig$LogType", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.iam.v1.Binding", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.iam.v1.Binding$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.iam.v1.BindingDelta", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.iam.v1.BindingDelta$Action", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.iam.v1.BindingDelta$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.iam.v1.GetIamPolicyRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.iam.v1.GetIamPolicyRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.iam.v1.GetPolicyOptions", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.iam.v1.GetPolicyOptions$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.iam.v1.Policy", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.iam.v1.Policy$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.iam.v1.PolicyDelta", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.iam.v1.PolicyDelta$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.iam.v1.SetIamPolicyRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.iam.v1.SetIamPolicyRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.iam.v1.TestIamPermissionsRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.iam.v1.TestIamPermissionsRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.iam.v1.TestIamPermissionsResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.iam.v1.TestIamPermissionsResponse$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.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.rpc.BadRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.rpc.BadRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.rpc.BadRequest$FieldViolation", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.rpc.BadRequest$FieldViolation$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.rpc.Code", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.rpc.DebugInfo", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.rpc.DebugInfo$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.rpc.ErrorInfo", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.rpc.ErrorInfo$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.rpc.Help", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.rpc.Help$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.rpc.Help$Link", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.rpc.Help$Link$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.rpc.LocalizedMessage", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.rpc.LocalizedMessage$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.rpc.PreconditionFailure", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.rpc.PreconditionFailure$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.rpc.PreconditionFailure$Violation", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.rpc.PreconditionFailure$Violation$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.rpc.QuotaFailure", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.rpc.QuotaFailure$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.rpc.QuotaFailure$Violation", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.rpc.QuotaFailure$Violation$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.rpc.RequestInfo", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.rpc.RequestInfo$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.rpc.ResourceInfo", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.rpc.ResourceInfo$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.rpc.RetryInfo", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.rpc.RetryInfo$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 + }, + { + "name": "com.google.showcase.v1beta1.AttemptSequenceRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.AttemptSequenceRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.AttemptStreamingSequenceRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.AttemptStreamingSequenceRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.AttemptStreamingSequenceResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.AttemptStreamingSequenceResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.BlockRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.BlockRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.BlockResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.BlockResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.Blurb", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.Blurb$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.ComplianceData", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.ComplianceData$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.ComplianceData$LifeKingdom", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.ComplianceDataChild", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.ComplianceDataChild$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.ComplianceDataGrandchild", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.ComplianceDataGrandchild$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.ComplianceGroup", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.ComplianceGroup$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.ComplianceSuite", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.ComplianceSuite$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.ConnectRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.ConnectRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.ConnectRequest$ConnectConfig", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.ConnectRequest$ConnectConfig$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.Continent", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.CreateBlurbRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.CreateBlurbRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.CreateRoomRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.CreateRoomRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.CreateSequenceRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.CreateSequenceRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.CreateSessionRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.CreateSessionRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.CreateStreamingSequenceRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.CreateStreamingSequenceRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.CreateUserRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.CreateUserRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.DeleteBlurbRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.DeleteBlurbRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.DeleteRoomRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.DeleteRoomRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.DeleteSessionRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.DeleteSessionRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.DeleteTestRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.DeleteTestRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.DeleteUserRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.DeleteUserRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.EchoErrorDetailsRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.EchoErrorDetailsRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.EchoErrorDetailsResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.EchoErrorDetailsResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.EchoErrorDetailsResponse$MultipleDetails", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.EchoErrorDetailsResponse$MultipleDetails$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.EchoErrorDetailsResponse$SingleDetail", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.EchoErrorDetailsResponse$SingleDetail$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.EchoRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.EchoRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.EchoResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.EchoResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.EnumRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.EnumRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.EnumResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.EnumResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.ErrorWithMultipleDetails", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.ErrorWithMultipleDetails$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.ErrorWithSingleDetail", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.ErrorWithSingleDetail$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.ExpandRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.ExpandRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.FailEchoWithDetailsRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.FailEchoWithDetailsRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.FailEchoWithDetailsResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.FailEchoWithDetailsResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.GetBlurbRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.GetBlurbRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.GetRoomRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.GetRoomRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.GetSequenceReportRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.GetSequenceReportRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.GetSessionRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.GetSessionRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.GetStreamingSequenceReportRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.GetStreamingSequenceReportRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.GetUserRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.GetUserRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.Issue", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.Issue$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.Issue$Severity", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.Issue$Type", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.ListBlurbsRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.ListBlurbsRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.ListBlurbsResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.ListBlurbsResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.ListRoomsRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.ListRoomsRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.ListRoomsResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.ListRoomsResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.ListSessionsRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.ListSessionsRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.ListSessionsResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.ListSessionsResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.ListTestsRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.ListTestsRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.ListTestsResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.ListTestsResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.ListUsersRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.ListUsersRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.ListUsersResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.ListUsersResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.PagedExpandLegacyMappedResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.PagedExpandLegacyMappedResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.PagedExpandLegacyRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.PagedExpandLegacyRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.PagedExpandRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.PagedExpandRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.PagedExpandResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.PagedExpandResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.PagedExpandResponseList", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.PagedExpandResponseList$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.PoetryError", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.PoetryError$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.RepeatRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.RepeatRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.RepeatResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.RepeatResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.ReportSessionRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.ReportSessionRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.ReportSessionResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.ReportSessionResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.ReportSessionResponse$Result", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.RestError", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.RestError$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.RestError$Status", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.RestError$Status$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.Room", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.Room$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.SearchBlurbsMetadata", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.SearchBlurbsMetadata$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.SearchBlurbsRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.SearchBlurbsRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.SearchBlurbsResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.SearchBlurbsResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.SendBlurbsResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.SendBlurbsResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.Sequence", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.Sequence$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.Sequence$Response", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.Sequence$Response$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.SequenceReport", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.SequenceReport$Attempt", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.SequenceReport$Attempt$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.SequenceReport$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.Session", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.Session$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.Session$Version", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.Severity", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.StreamBlurbsRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.StreamBlurbsRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.StreamBlurbsResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.StreamBlurbsResponse$Action", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.StreamBlurbsResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.StreamingSequence", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.StreamingSequence$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.StreamingSequence$Response", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.StreamingSequence$Response$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.StreamingSequenceReport", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.StreamingSequenceReport$Attempt", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.StreamingSequenceReport$Attempt$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.StreamingSequenceReport$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.Test", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.Test$Blueprint", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.Test$Blueprint$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.Test$Blueprint$Invocation", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.Test$Blueprint$Invocation$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.Test$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.Test$ExpectationLevel", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.TestRun", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.TestRun$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.UpdateBlurbRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.UpdateBlurbRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.UpdateRoomRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.UpdateRoomRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.UpdateUserRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.UpdateUserRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.User", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.User$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.VerifyTestRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.VerifyTestRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.VerifyTestResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.VerifyTestResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.WaitMetadata", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.WaitMetadata$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.WaitRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.WaitRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.WaitResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.WaitResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.type.Expr", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.type.Expr$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + } +] \ No newline at end of file diff --git a/java-showcase-3.25.8/gapic-showcase/src/test/java/com/google/showcase/v1beta1/ComplianceClientHttpJsonTest.java b/java-showcase-3.25.8/gapic-showcase/src/test/java/com/google/showcase/v1beta1/ComplianceClientHttpJsonTest.java new file mode 100644 index 0000000000..345817b5e5 --- /dev/null +++ b/java-showcase-3.25.8/gapic-showcase/src/test/java/com/google/showcase/v1beta1/ComplianceClientHttpJsonTest.java @@ -0,0 +1,1215 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1; + +import static com.google.showcase.v1beta1.ComplianceClient.ListLocationsPagedResponse; + +import com.google.api.gax.core.NoCredentialsProvider; +import com.google.api.gax.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.testing.MockHttpService; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ApiException; +import com.google.api.gax.rpc.ApiExceptionFactory; +import com.google.api.gax.rpc.InvalidArgumentException; +import com.google.api.gax.rpc.StatusCode; +import com.google.api.gax.rpc.testing.FakeStatusCode; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.common.collect.Lists; +import com.google.iam.v1.AuditConfig; +import com.google.iam.v1.Binding; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.GetPolicyOptions; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.protobuf.Any; +import com.google.protobuf.ByteString; +import com.google.protobuf.FieldMask; +import com.google.showcase.v1beta1.stub.HttpJsonComplianceStub; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +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 ComplianceClientHttpJsonTest { + private static MockHttpService mockService; + private static ComplianceClient client; + + @BeforeClass + public static void startStaticServer() throws IOException { + mockService = + new MockHttpService( + HttpJsonComplianceStub.getMethodDescriptors(), ComplianceSettings.getDefaultEndpoint()); + ComplianceSettings settings = + ComplianceSettings.newHttpJsonBuilder() + .setTransportChannelProvider( + ComplianceSettings.defaultHttpJsonTransportProviderBuilder() + .setHttpTransport(mockService) + .build()) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = ComplianceClient.create(settings); + } + + @AfterClass + public static void stopServer() { + client.close(); + } + + @Before + public void setUp() {} + + @After + public void tearDown() throws Exception { + mockService.reset(); + } + + @Test + public void repeatDataBodyTest() throws Exception { + RepeatResponse expectedResponse = + RepeatResponse.newBuilder() + .setRequest(RepeatRequest.newBuilder().build()) + .setBindingUri("bindingUri1514820775") + .build(); + mockService.addResponse(expectedResponse); + + RepeatRequest request = + RepeatRequest.newBuilder() + .setName("name3373707") + .setInfo(ComplianceData.newBuilder().build()) + .setServerVerify(true) + .setIntendedBindingUri("intendedBindingUri780142386") + .setFInt32(-1143775883) + .setFInt64(-1143775788) + .setFDouble(-1239459382) + .setPInt32(-858673665) + .setPInt64(-858673570) + .setPDouble(-991225216) + .build(); + + RepeatResponse actualResponse = client.repeatDataBody(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void repeatDataBodyExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + RepeatRequest request = + RepeatRequest.newBuilder() + .setName("name3373707") + .setInfo(ComplianceData.newBuilder().build()) + .setServerVerify(true) + .setIntendedBindingUri("intendedBindingUri780142386") + .setFInt32(-1143775883) + .setFInt64(-1143775788) + .setFDouble(-1239459382) + .setPInt32(-858673665) + .setPInt64(-858673570) + .setPDouble(-991225216) + .build(); + client.repeatDataBody(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void repeatDataBodyInfoTest() throws Exception { + RepeatResponse expectedResponse = + RepeatResponse.newBuilder() + .setRequest(RepeatRequest.newBuilder().build()) + .setBindingUri("bindingUri1514820775") + .build(); + mockService.addResponse(expectedResponse); + + RepeatRequest request = + RepeatRequest.newBuilder() + .setName("name3373707") + .setInfo(ComplianceData.newBuilder().build()) + .setServerVerify(true) + .setIntendedBindingUri("intendedBindingUri780142386") + .setFInt32(-1143775883) + .setFInt64(-1143775788) + .setFDouble(-1239459382) + .setPInt32(-858673665) + .setPInt64(-858673570) + .setPDouble(-991225216) + .build(); + + RepeatResponse actualResponse = client.repeatDataBodyInfo(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void repeatDataBodyInfoExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + RepeatRequest request = + RepeatRequest.newBuilder() + .setName("name3373707") + .setInfo(ComplianceData.newBuilder().build()) + .setServerVerify(true) + .setIntendedBindingUri("intendedBindingUri780142386") + .setFInt32(-1143775883) + .setFInt64(-1143775788) + .setFDouble(-1239459382) + .setPInt32(-858673665) + .setPInt64(-858673570) + .setPDouble(-991225216) + .build(); + client.repeatDataBodyInfo(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void repeatDataQueryTest() throws Exception { + RepeatResponse expectedResponse = + RepeatResponse.newBuilder() + .setRequest(RepeatRequest.newBuilder().build()) + .setBindingUri("bindingUri1514820775") + .build(); + mockService.addResponse(expectedResponse); + + RepeatRequest request = + RepeatRequest.newBuilder() + .setName("name3373707") + .setInfo(ComplianceData.newBuilder().build()) + .setServerVerify(true) + .setIntendedBindingUri("intendedBindingUri780142386") + .setFInt32(-1143775883) + .setFInt64(-1143775788) + .setFDouble(-1239459382) + .setPInt32(-858673665) + .setPInt64(-858673570) + .setPDouble(-991225216) + .build(); + + RepeatResponse actualResponse = client.repeatDataQuery(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void repeatDataQueryExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + RepeatRequest request = + RepeatRequest.newBuilder() + .setName("name3373707") + .setInfo(ComplianceData.newBuilder().build()) + .setServerVerify(true) + .setIntendedBindingUri("intendedBindingUri780142386") + .setFInt32(-1143775883) + .setFInt64(-1143775788) + .setFDouble(-1239459382) + .setPInt32(-858673665) + .setPInt64(-858673570) + .setPDouble(-991225216) + .build(); + client.repeatDataQuery(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void repeatDataSimplePathTest() throws Exception { + RepeatResponse expectedResponse = + RepeatResponse.newBuilder() + .setRequest(RepeatRequest.newBuilder().build()) + .setBindingUri("bindingUri1514820775") + .build(); + mockService.addResponse(expectedResponse); + + RepeatRequest request = + RepeatRequest.newBuilder() + .setName("name3373707") + .setInfo( + ComplianceData.newBuilder() + .setFString("fString-9139") + .setFInt32(-1143775883) + .setFSint32(-815756300) + .setFSfixed32(-763212615) + .setFUint32(-758497998) + .setFFixed32(1837548026) + .setFInt64(-1143775788) + .setFSint64(-815756205) + .setFSfixed64(-763212520) + .setFUint64(-758497903) + .setFFixed64(1837548121) + .setFDouble(-1239459382) + .setFFloat(-1146609341) + .setFBool(true) + .setFBytes(ByteString.EMPTY) + .setFChild(ComplianceDataChild.newBuilder().build()) + .setPString("pString-1191954271") + .setPInt32(-858673665) + .setPDouble(-991225216) + .setPBool(true) + .setPChild(ComplianceDataChild.newBuilder().build()) + .build()) + .setServerVerify(true) + .setIntendedBindingUri("intendedBindingUri780142386") + .setFInt32(-1143775883) + .setFInt64(-1143775788) + .setFDouble(-1239459382) + .setPInt32(-858673665) + .setPInt64(-858673570) + .setPDouble(-991225216) + .build(); + + RepeatResponse actualResponse = client.repeatDataSimplePath(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void repeatDataSimplePathExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + RepeatRequest request = + RepeatRequest.newBuilder() + .setName("name3373707") + .setInfo( + ComplianceData.newBuilder() + .setFString("fString-9139") + .setFInt32(-1143775883) + .setFSint32(-815756300) + .setFSfixed32(-763212615) + .setFUint32(-758497998) + .setFFixed32(1837548026) + .setFInt64(-1143775788) + .setFSint64(-815756205) + .setFSfixed64(-763212520) + .setFUint64(-758497903) + .setFFixed64(1837548121) + .setFDouble(-1239459382) + .setFFloat(-1146609341) + .setFBool(true) + .setFBytes(ByteString.EMPTY) + .setFChild(ComplianceDataChild.newBuilder().build()) + .setPString("pString-1191954271") + .setPInt32(-858673665) + .setPDouble(-991225216) + .setPBool(true) + .setPChild(ComplianceDataChild.newBuilder().build()) + .build()) + .setServerVerify(true) + .setIntendedBindingUri("intendedBindingUri780142386") + .setFInt32(-1143775883) + .setFInt64(-1143775788) + .setFDouble(-1239459382) + .setPInt32(-858673665) + .setPInt64(-858673570) + .setPDouble(-991225216) + .build(); + client.repeatDataSimplePath(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void repeatDataPathResourceTest() throws Exception { + RepeatResponse expectedResponse = + RepeatResponse.newBuilder() + .setRequest(RepeatRequest.newBuilder().build()) + .setBindingUri("bindingUri1514820775") + .build(); + mockService.addResponse(expectedResponse); + + RepeatRequest request = + RepeatRequest.newBuilder() + .setName("name3373707") + .setInfo( + ComplianceData.newBuilder() + .setFString("first/firs-9148") + .setFInt32(-1143775883) + .setFSint32(-815756300) + .setFSfixed32(-763212615) + .setFUint32(-758497998) + .setFFixed32(1837548026) + .setFInt64(-1143775788) + .setFSint64(-815756205) + .setFSfixed64(-763212520) + .setFUint64(-758497903) + .setFFixed64(1837548121) + .setFDouble(-1239459382) + .setFFloat(-1146609341) + .setFBool(true) + .setFBytes(ByteString.EMPTY) + .setFChild( + ComplianceDataChild.newBuilder() + .setFString("second/secon-5446") + .setFFloat(-1146609341) + .setFDouble(-1239459382) + .setFBool(true) + .setFContinent(Continent.forNumber(0)) + .setFChild(ComplianceDataGrandchild.newBuilder().build()) + .setPString("pString-1191954271") + .setPFloat(-861507123) + .setPDouble(-991225216) + .setPBool(true) + .setPContinent(Continent.forNumber(0)) + .setPChild(ComplianceDataGrandchild.newBuilder().build()) + .build()) + .setPString("pString-1191954271") + .setPInt32(-858673665) + .setPDouble(-991225216) + .setPBool(true) + .setPChild(ComplianceDataChild.newBuilder().build()) + .build()) + .setServerVerify(true) + .setIntendedBindingUri("intendedBindingUri780142386") + .setFInt32(-1143775883) + .setFInt64(-1143775788) + .setFDouble(-1239459382) + .setPInt32(-858673665) + .setPInt64(-858673570) + .setPDouble(-991225216) + .build(); + + RepeatResponse actualResponse = client.repeatDataPathResource(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void repeatDataPathResourceExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + RepeatRequest request = + RepeatRequest.newBuilder() + .setName("name3373707") + .setInfo( + ComplianceData.newBuilder() + .setFString("first/firs-9148") + .setFInt32(-1143775883) + .setFSint32(-815756300) + .setFSfixed32(-763212615) + .setFUint32(-758497998) + .setFFixed32(1837548026) + .setFInt64(-1143775788) + .setFSint64(-815756205) + .setFSfixed64(-763212520) + .setFUint64(-758497903) + .setFFixed64(1837548121) + .setFDouble(-1239459382) + .setFFloat(-1146609341) + .setFBool(true) + .setFBytes(ByteString.EMPTY) + .setFChild( + ComplianceDataChild.newBuilder() + .setFString("second/secon-5446") + .setFFloat(-1146609341) + .setFDouble(-1239459382) + .setFBool(true) + .setFContinent(Continent.forNumber(0)) + .setFChild(ComplianceDataGrandchild.newBuilder().build()) + .setPString("pString-1191954271") + .setPFloat(-861507123) + .setPDouble(-991225216) + .setPBool(true) + .setPContinent(Continent.forNumber(0)) + .setPChild(ComplianceDataGrandchild.newBuilder().build()) + .build()) + .setPString("pString-1191954271") + .setPInt32(-858673665) + .setPDouble(-991225216) + .setPBool(true) + .setPChild(ComplianceDataChild.newBuilder().build()) + .build()) + .setServerVerify(true) + .setIntendedBindingUri("intendedBindingUri780142386") + .setFInt32(-1143775883) + .setFInt64(-1143775788) + .setFDouble(-1239459382) + .setPInt32(-858673665) + .setPInt64(-858673570) + .setPDouble(-991225216) + .build(); + client.repeatDataPathResource(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void repeatDataPathTrailingResourceTest() throws Exception { + RepeatResponse expectedResponse = + RepeatResponse.newBuilder() + .setRequest(RepeatRequest.newBuilder().build()) + .setBindingUri("bindingUri1514820775") + .build(); + mockService.addResponse(expectedResponse); + + RepeatRequest request = + RepeatRequest.newBuilder() + .setName("name3373707") + .setInfo( + ComplianceData.newBuilder() + .setFString("first/firs-9148") + .setFInt32(-1143775883) + .setFSint32(-815756300) + .setFSfixed32(-763212615) + .setFUint32(-758497998) + .setFFixed32(1837548026) + .setFInt64(-1143775788) + .setFSint64(-815756205) + .setFSfixed64(-763212520) + .setFUint64(-758497903) + .setFFixed64(1837548121) + .setFDouble(-1239459382) + .setFFloat(-1146609341) + .setFBool(true) + .setFBytes(ByteString.EMPTY) + .setFChild( + ComplianceDataChild.newBuilder() + .setFString("second/secon-3276") + .setFFloat(-1146609341) + .setFDouble(-1239459382) + .setFBool(true) + .setFContinent(Continent.forNumber(0)) + .setFChild(ComplianceDataGrandchild.newBuilder().build()) + .setPString("pString-1191954271") + .setPFloat(-861507123) + .setPDouble(-991225216) + .setPBool(true) + .setPContinent(Continent.forNumber(0)) + .setPChild(ComplianceDataGrandchild.newBuilder().build()) + .build()) + .setPString("pString-1191954271") + .setPInt32(-858673665) + .setPDouble(-991225216) + .setPBool(true) + .setPChild(ComplianceDataChild.newBuilder().build()) + .build()) + .setServerVerify(true) + .setIntendedBindingUri("intendedBindingUri780142386") + .setFInt32(-1143775883) + .setFInt64(-1143775788) + .setFDouble(-1239459382) + .setPInt32(-858673665) + .setPInt64(-858673570) + .setPDouble(-991225216) + .build(); + + RepeatResponse actualResponse = client.repeatDataPathTrailingResource(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void repeatDataPathTrailingResourceExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + RepeatRequest request = + RepeatRequest.newBuilder() + .setName("name3373707") + .setInfo( + ComplianceData.newBuilder() + .setFString("first/firs-9148") + .setFInt32(-1143775883) + .setFSint32(-815756300) + .setFSfixed32(-763212615) + .setFUint32(-758497998) + .setFFixed32(1837548026) + .setFInt64(-1143775788) + .setFSint64(-815756205) + .setFSfixed64(-763212520) + .setFUint64(-758497903) + .setFFixed64(1837548121) + .setFDouble(-1239459382) + .setFFloat(-1146609341) + .setFBool(true) + .setFBytes(ByteString.EMPTY) + .setFChild( + ComplianceDataChild.newBuilder() + .setFString("second/secon-3276") + .setFFloat(-1146609341) + .setFDouble(-1239459382) + .setFBool(true) + .setFContinent(Continent.forNumber(0)) + .setFChild(ComplianceDataGrandchild.newBuilder().build()) + .setPString("pString-1191954271") + .setPFloat(-861507123) + .setPDouble(-991225216) + .setPBool(true) + .setPContinent(Continent.forNumber(0)) + .setPChild(ComplianceDataGrandchild.newBuilder().build()) + .build()) + .setPString("pString-1191954271") + .setPInt32(-858673665) + .setPDouble(-991225216) + .setPBool(true) + .setPChild(ComplianceDataChild.newBuilder().build()) + .build()) + .setServerVerify(true) + .setIntendedBindingUri("intendedBindingUri780142386") + .setFInt32(-1143775883) + .setFInt64(-1143775788) + .setFDouble(-1239459382) + .setPInt32(-858673665) + .setPInt64(-858673570) + .setPDouble(-991225216) + .build(); + client.repeatDataPathTrailingResource(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void repeatDataBodyPutTest() throws Exception { + RepeatResponse expectedResponse = + RepeatResponse.newBuilder() + .setRequest(RepeatRequest.newBuilder().build()) + .setBindingUri("bindingUri1514820775") + .build(); + mockService.addResponse(expectedResponse); + + RepeatRequest request = + RepeatRequest.newBuilder() + .setName("name3373707") + .setInfo(ComplianceData.newBuilder().build()) + .setServerVerify(true) + .setIntendedBindingUri("intendedBindingUri780142386") + .setFInt32(-1143775883) + .setFInt64(-1143775788) + .setFDouble(-1239459382) + .setPInt32(-858673665) + .setPInt64(-858673570) + .setPDouble(-991225216) + .build(); + + RepeatResponse actualResponse = client.repeatDataBodyPut(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void repeatDataBodyPutExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + RepeatRequest request = + RepeatRequest.newBuilder() + .setName("name3373707") + .setInfo(ComplianceData.newBuilder().build()) + .setServerVerify(true) + .setIntendedBindingUri("intendedBindingUri780142386") + .setFInt32(-1143775883) + .setFInt64(-1143775788) + .setFDouble(-1239459382) + .setPInt32(-858673665) + .setPInt64(-858673570) + .setPDouble(-991225216) + .build(); + client.repeatDataBodyPut(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void repeatDataBodyPatchTest() throws Exception { + RepeatResponse expectedResponse = + RepeatResponse.newBuilder() + .setRequest(RepeatRequest.newBuilder().build()) + .setBindingUri("bindingUri1514820775") + .build(); + mockService.addResponse(expectedResponse); + + RepeatRequest request = + RepeatRequest.newBuilder() + .setName("name3373707") + .setInfo(ComplianceData.newBuilder().build()) + .setServerVerify(true) + .setIntendedBindingUri("intendedBindingUri780142386") + .setFInt32(-1143775883) + .setFInt64(-1143775788) + .setFDouble(-1239459382) + .setPInt32(-858673665) + .setPInt64(-858673570) + .setPDouble(-991225216) + .build(); + + RepeatResponse actualResponse = client.repeatDataBodyPatch(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void repeatDataBodyPatchExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + RepeatRequest request = + RepeatRequest.newBuilder() + .setName("name3373707") + .setInfo(ComplianceData.newBuilder().build()) + .setServerVerify(true) + .setIntendedBindingUri("intendedBindingUri780142386") + .setFInt32(-1143775883) + .setFInt64(-1143775788) + .setFDouble(-1239459382) + .setPInt32(-858673665) + .setPInt64(-858673570) + .setPDouble(-991225216) + .build(); + client.repeatDataBodyPatch(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getEnumTest() throws Exception { + EnumResponse expectedResponse = + EnumResponse.newBuilder() + .setRequest(EnumRequest.newBuilder().build()) + .setContinent(Continent.forNumber(0)) + .build(); + mockService.addResponse(expectedResponse); + + EnumRequest request = EnumRequest.newBuilder().setUnknownEnum(true).build(); + + EnumResponse actualResponse = client.getEnum(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void getEnumExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + EnumRequest request = EnumRequest.newBuilder().setUnknownEnum(true).build(); + client.getEnum(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void verifyEnumTest() throws Exception { + EnumResponse expectedResponse = + EnumResponse.newBuilder() + .setRequest(EnumRequest.newBuilder().build()) + .setContinent(Continent.forNumber(0)) + .build(); + mockService.addResponse(expectedResponse); + + EnumResponse request = + EnumResponse.newBuilder() + .setRequest(EnumRequest.newBuilder().build()) + .setContinent(Continent.forNumber(0)) + .build(); + + EnumResponse actualResponse = client.verifyEnum(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void verifyEnumExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + EnumResponse request = + EnumResponse.newBuilder() + .setRequest(EnumRequest.newBuilder().build()) + .setContinent(Continent.forNumber(0)) + .build(); + client.verifyEnum(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listLocationsTest() throws Exception { + Location responsesElement = Location.newBuilder().build(); + ListLocationsResponse expectedResponse = + ListLocationsResponse.newBuilder() + .setNextPageToken("") + .addAllLocations(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + ListLocationsRequest request = + ListLocationsRequest.newBuilder() + .setName("projects/project-3664") + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + + ListLocationsPagedResponse pagedListResponse = client.listLocations(request); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getLocationsList().get(0), resources.get(0)); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void listLocationsExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ListLocationsRequest request = + ListLocationsRequest.newBuilder() + .setName("projects/project-3664") + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + client.listLocations(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getLocationTest() throws Exception { + Location expectedResponse = + Location.newBuilder() + .setName("name3373707") + .setLocationId("locationId1541836720") + .setDisplayName("displayName1714148973") + .putAllLabels(new HashMap()) + .setMetadata(Any.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + GetLocationRequest request = + GetLocationRequest.newBuilder() + .setName("projects/project-9062/locations/location-9062") + .build(); + + Location actualResponse = client.getLocation(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void getLocationExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + GetLocationRequest request = + GetLocationRequest.newBuilder() + .setName("projects/project-9062/locations/location-9062") + .build(); + client.getLocation(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void setIamPolicyTest() throws Exception { + Policy expectedResponse = + Policy.newBuilder() + .setVersion(351608024) + .addAllBindings(new ArrayList()) + .addAllAuditConfigs(new ArrayList()) + .setEtag(ByteString.EMPTY) + .build(); + mockService.addResponse(expectedResponse); + + SetIamPolicyRequest request = + SetIamPolicyRequest.newBuilder() + .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString()) + .setPolicy(Policy.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .build(); + + Policy actualResponse = client.setIamPolicy(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void setIamPolicyExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + SetIamPolicyRequest request = + SetIamPolicyRequest.newBuilder() + .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString()) + .setPolicy(Policy.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .build(); + client.setIamPolicy(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getIamPolicyTest() throws Exception { + Policy expectedResponse = + Policy.newBuilder() + .setVersion(351608024) + .addAllBindings(new ArrayList()) + .addAllAuditConfigs(new ArrayList()) + .setEtag(ByteString.EMPTY) + .build(); + mockService.addResponse(expectedResponse); + + GetIamPolicyRequest request = + GetIamPolicyRequest.newBuilder() + .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString()) + .setOptions(GetPolicyOptions.newBuilder().build()) + .build(); + + Policy actualResponse = client.getIamPolicy(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void getIamPolicyExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + GetIamPolicyRequest request = + GetIamPolicyRequest.newBuilder() + .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString()) + .setOptions(GetPolicyOptions.newBuilder().build()) + .build(); + client.getIamPolicy(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void testIamPermissionsTest() throws Exception { + TestIamPermissionsResponse expectedResponse = + TestIamPermissionsResponse.newBuilder().addAllPermissions(new ArrayList()).build(); + mockService.addResponse(expectedResponse); + + TestIamPermissionsRequest request = + TestIamPermissionsRequest.newBuilder() + .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString()) + .addAllPermissions(new ArrayList()) + .build(); + + TestIamPermissionsResponse actualResponse = client.testIamPermissions(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void testIamPermissionsExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + TestIamPermissionsRequest request = + TestIamPermissionsRequest.newBuilder() + .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString()) + .addAllPermissions(new ArrayList()) + .build(); + client.testIamPermissions(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } +} diff --git a/java-showcase-3.25.8/gapic-showcase/src/test/java/com/google/showcase/v1beta1/ComplianceClientTest.java b/java-showcase-3.25.8/gapic-showcase/src/test/java/com/google/showcase/v1beta1/ComplianceClientTest.java new file mode 100644 index 0000000000..8f76905d59 --- /dev/null +++ b/java-showcase-3.25.8/gapic-showcase/src/test/java/com/google/showcase/v1beta1/ComplianceClientTest.java @@ -0,0 +1,1014 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1; + +import static com.google.showcase.v1beta1.ComplianceClient.ListLocationsPagedResponse; + +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.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.common.collect.Lists; +import com.google.iam.v1.AuditConfig; +import com.google.iam.v1.Binding; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.GetPolicyOptions; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.protobuf.AbstractMessage; +import com.google.protobuf.Any; +import com.google.protobuf.ByteString; +import com.google.protobuf.FieldMask; +import io.grpc.StatusRuntimeException; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.UUID; +import javax.annotation.Generated; +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Assert; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; + +@Generated("by gapic-generator-java") +public class ComplianceClientTest { + private static MockCompliance mockCompliance; + private static MockIAMPolicy mockIAMPolicy; + private static MockLocations mockLocations; + private static MockServiceHelper mockServiceHelper; + private LocalChannelProvider channelProvider; + private ComplianceClient client; + + @BeforeClass + public static void startStaticServer() { + mockCompliance = new MockCompliance(); + mockLocations = new MockLocations(); + mockIAMPolicy = new MockIAMPolicy(); + mockServiceHelper = + new MockServiceHelper( + UUID.randomUUID().toString(), + Arrays.asList(mockCompliance, mockLocations, mockIAMPolicy)); + mockServiceHelper.start(); + } + + @AfterClass + public static void stopServer() { + mockServiceHelper.stop(); + } + + @Before + public void setUp() throws IOException { + mockServiceHelper.reset(); + channelProvider = mockServiceHelper.createChannelProvider(); + ComplianceSettings settings = + ComplianceSettings.newBuilder() + .setTransportChannelProvider(channelProvider) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = ComplianceClient.create(settings); + } + + @After + public void tearDown() throws Exception { + client.close(); + } + + @Test + public void repeatDataBodyTest() throws Exception { + RepeatResponse expectedResponse = + RepeatResponse.newBuilder() + .setRequest(RepeatRequest.newBuilder().build()) + .setBindingUri("bindingUri1514820775") + .build(); + mockCompliance.addResponse(expectedResponse); + + RepeatRequest request = + RepeatRequest.newBuilder() + .setName("name3373707") + .setInfo(ComplianceData.newBuilder().build()) + .setServerVerify(true) + .setIntendedBindingUri("intendedBindingUri780142386") + .setFInt32(-1143775883) + .setFInt64(-1143775788) + .setFDouble(-1239459382) + .setPInt32(-858673665) + .setPInt64(-858673570) + .setPDouble(-991225216) + .build(); + + RepeatResponse actualResponse = client.repeatDataBody(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockCompliance.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + RepeatRequest actualRequest = ((RepeatRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getName(), actualRequest.getName()); + Assert.assertEquals(request.getInfo(), actualRequest.getInfo()); + Assert.assertEquals(request.getServerVerify(), actualRequest.getServerVerify()); + Assert.assertEquals(request.getIntendedBindingUri(), actualRequest.getIntendedBindingUri()); + Assert.assertEquals(request.getFInt32(), actualRequest.getFInt32()); + Assert.assertEquals(request.getFInt64(), actualRequest.getFInt64()); + Assert.assertEquals(request.getFDouble(), actualRequest.getFDouble(), 0.0001); + Assert.assertEquals(request.getPInt32(), actualRequest.getPInt32()); + Assert.assertEquals(request.getPInt64(), actualRequest.getPInt64()); + Assert.assertEquals(request.getPDouble(), actualRequest.getPDouble(), 0.0001); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void repeatDataBodyExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockCompliance.addException(exception); + + try { + RepeatRequest request = + RepeatRequest.newBuilder() + .setName("name3373707") + .setInfo(ComplianceData.newBuilder().build()) + .setServerVerify(true) + .setIntendedBindingUri("intendedBindingUri780142386") + .setFInt32(-1143775883) + .setFInt64(-1143775788) + .setFDouble(-1239459382) + .setPInt32(-858673665) + .setPInt64(-858673570) + .setPDouble(-991225216) + .build(); + client.repeatDataBody(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void repeatDataBodyInfoTest() throws Exception { + RepeatResponse expectedResponse = + RepeatResponse.newBuilder() + .setRequest(RepeatRequest.newBuilder().build()) + .setBindingUri("bindingUri1514820775") + .build(); + mockCompliance.addResponse(expectedResponse); + + RepeatRequest request = + RepeatRequest.newBuilder() + .setName("name3373707") + .setInfo(ComplianceData.newBuilder().build()) + .setServerVerify(true) + .setIntendedBindingUri("intendedBindingUri780142386") + .setFInt32(-1143775883) + .setFInt64(-1143775788) + .setFDouble(-1239459382) + .setPInt32(-858673665) + .setPInt64(-858673570) + .setPDouble(-991225216) + .build(); + + RepeatResponse actualResponse = client.repeatDataBodyInfo(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockCompliance.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + RepeatRequest actualRequest = ((RepeatRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getName(), actualRequest.getName()); + Assert.assertEquals(request.getInfo(), actualRequest.getInfo()); + Assert.assertEquals(request.getServerVerify(), actualRequest.getServerVerify()); + Assert.assertEquals(request.getIntendedBindingUri(), actualRequest.getIntendedBindingUri()); + Assert.assertEquals(request.getFInt32(), actualRequest.getFInt32()); + Assert.assertEquals(request.getFInt64(), actualRequest.getFInt64()); + Assert.assertEquals(request.getFDouble(), actualRequest.getFDouble(), 0.0001); + Assert.assertEquals(request.getPInt32(), actualRequest.getPInt32()); + Assert.assertEquals(request.getPInt64(), actualRequest.getPInt64()); + Assert.assertEquals(request.getPDouble(), actualRequest.getPDouble(), 0.0001); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void repeatDataBodyInfoExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockCompliance.addException(exception); + + try { + RepeatRequest request = + RepeatRequest.newBuilder() + .setName("name3373707") + .setInfo(ComplianceData.newBuilder().build()) + .setServerVerify(true) + .setIntendedBindingUri("intendedBindingUri780142386") + .setFInt32(-1143775883) + .setFInt64(-1143775788) + .setFDouble(-1239459382) + .setPInt32(-858673665) + .setPInt64(-858673570) + .setPDouble(-991225216) + .build(); + client.repeatDataBodyInfo(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void repeatDataQueryTest() throws Exception { + RepeatResponse expectedResponse = + RepeatResponse.newBuilder() + .setRequest(RepeatRequest.newBuilder().build()) + .setBindingUri("bindingUri1514820775") + .build(); + mockCompliance.addResponse(expectedResponse); + + RepeatRequest request = + RepeatRequest.newBuilder() + .setName("name3373707") + .setInfo(ComplianceData.newBuilder().build()) + .setServerVerify(true) + .setIntendedBindingUri("intendedBindingUri780142386") + .setFInt32(-1143775883) + .setFInt64(-1143775788) + .setFDouble(-1239459382) + .setPInt32(-858673665) + .setPInt64(-858673570) + .setPDouble(-991225216) + .build(); + + RepeatResponse actualResponse = client.repeatDataQuery(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockCompliance.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + RepeatRequest actualRequest = ((RepeatRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getName(), actualRequest.getName()); + Assert.assertEquals(request.getInfo(), actualRequest.getInfo()); + Assert.assertEquals(request.getServerVerify(), actualRequest.getServerVerify()); + Assert.assertEquals(request.getIntendedBindingUri(), actualRequest.getIntendedBindingUri()); + Assert.assertEquals(request.getFInt32(), actualRequest.getFInt32()); + Assert.assertEquals(request.getFInt64(), actualRequest.getFInt64()); + Assert.assertEquals(request.getFDouble(), actualRequest.getFDouble(), 0.0001); + Assert.assertEquals(request.getPInt32(), actualRequest.getPInt32()); + Assert.assertEquals(request.getPInt64(), actualRequest.getPInt64()); + Assert.assertEquals(request.getPDouble(), actualRequest.getPDouble(), 0.0001); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void repeatDataQueryExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockCompliance.addException(exception); + + try { + RepeatRequest request = + RepeatRequest.newBuilder() + .setName("name3373707") + .setInfo(ComplianceData.newBuilder().build()) + .setServerVerify(true) + .setIntendedBindingUri("intendedBindingUri780142386") + .setFInt32(-1143775883) + .setFInt64(-1143775788) + .setFDouble(-1239459382) + .setPInt32(-858673665) + .setPInt64(-858673570) + .setPDouble(-991225216) + .build(); + client.repeatDataQuery(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void repeatDataSimplePathTest() throws Exception { + RepeatResponse expectedResponse = + RepeatResponse.newBuilder() + .setRequest(RepeatRequest.newBuilder().build()) + .setBindingUri("bindingUri1514820775") + .build(); + mockCompliance.addResponse(expectedResponse); + + RepeatRequest request = + RepeatRequest.newBuilder() + .setName("name3373707") + .setInfo(ComplianceData.newBuilder().build()) + .setServerVerify(true) + .setIntendedBindingUri("intendedBindingUri780142386") + .setFInt32(-1143775883) + .setFInt64(-1143775788) + .setFDouble(-1239459382) + .setPInt32(-858673665) + .setPInt64(-858673570) + .setPDouble(-991225216) + .build(); + + RepeatResponse actualResponse = client.repeatDataSimplePath(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockCompliance.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + RepeatRequest actualRequest = ((RepeatRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getName(), actualRequest.getName()); + Assert.assertEquals(request.getInfo(), actualRequest.getInfo()); + Assert.assertEquals(request.getServerVerify(), actualRequest.getServerVerify()); + Assert.assertEquals(request.getIntendedBindingUri(), actualRequest.getIntendedBindingUri()); + Assert.assertEquals(request.getFInt32(), actualRequest.getFInt32()); + Assert.assertEquals(request.getFInt64(), actualRequest.getFInt64()); + Assert.assertEquals(request.getFDouble(), actualRequest.getFDouble(), 0.0001); + Assert.assertEquals(request.getPInt32(), actualRequest.getPInt32()); + Assert.assertEquals(request.getPInt64(), actualRequest.getPInt64()); + Assert.assertEquals(request.getPDouble(), actualRequest.getPDouble(), 0.0001); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void repeatDataSimplePathExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockCompliance.addException(exception); + + try { + RepeatRequest request = + RepeatRequest.newBuilder() + .setName("name3373707") + .setInfo(ComplianceData.newBuilder().build()) + .setServerVerify(true) + .setIntendedBindingUri("intendedBindingUri780142386") + .setFInt32(-1143775883) + .setFInt64(-1143775788) + .setFDouble(-1239459382) + .setPInt32(-858673665) + .setPInt64(-858673570) + .setPDouble(-991225216) + .build(); + client.repeatDataSimplePath(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void repeatDataPathResourceTest() throws Exception { + RepeatResponse expectedResponse = + RepeatResponse.newBuilder() + .setRequest(RepeatRequest.newBuilder().build()) + .setBindingUri("bindingUri1514820775") + .build(); + mockCompliance.addResponse(expectedResponse); + + RepeatRequest request = + RepeatRequest.newBuilder() + .setName("name3373707") + .setInfo(ComplianceData.newBuilder().build()) + .setServerVerify(true) + .setIntendedBindingUri("intendedBindingUri780142386") + .setFInt32(-1143775883) + .setFInt64(-1143775788) + .setFDouble(-1239459382) + .setPInt32(-858673665) + .setPInt64(-858673570) + .setPDouble(-991225216) + .build(); + + RepeatResponse actualResponse = client.repeatDataPathResource(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockCompliance.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + RepeatRequest actualRequest = ((RepeatRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getName(), actualRequest.getName()); + Assert.assertEquals(request.getInfo(), actualRequest.getInfo()); + Assert.assertEquals(request.getServerVerify(), actualRequest.getServerVerify()); + Assert.assertEquals(request.getIntendedBindingUri(), actualRequest.getIntendedBindingUri()); + Assert.assertEquals(request.getFInt32(), actualRequest.getFInt32()); + Assert.assertEquals(request.getFInt64(), actualRequest.getFInt64()); + Assert.assertEquals(request.getFDouble(), actualRequest.getFDouble(), 0.0001); + Assert.assertEquals(request.getPInt32(), actualRequest.getPInt32()); + Assert.assertEquals(request.getPInt64(), actualRequest.getPInt64()); + Assert.assertEquals(request.getPDouble(), actualRequest.getPDouble(), 0.0001); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void repeatDataPathResourceExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockCompliance.addException(exception); + + try { + RepeatRequest request = + RepeatRequest.newBuilder() + .setName("name3373707") + .setInfo(ComplianceData.newBuilder().build()) + .setServerVerify(true) + .setIntendedBindingUri("intendedBindingUri780142386") + .setFInt32(-1143775883) + .setFInt64(-1143775788) + .setFDouble(-1239459382) + .setPInt32(-858673665) + .setPInt64(-858673570) + .setPDouble(-991225216) + .build(); + client.repeatDataPathResource(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void repeatDataPathTrailingResourceTest() throws Exception { + RepeatResponse expectedResponse = + RepeatResponse.newBuilder() + .setRequest(RepeatRequest.newBuilder().build()) + .setBindingUri("bindingUri1514820775") + .build(); + mockCompliance.addResponse(expectedResponse); + + RepeatRequest request = + RepeatRequest.newBuilder() + .setName("name3373707") + .setInfo(ComplianceData.newBuilder().build()) + .setServerVerify(true) + .setIntendedBindingUri("intendedBindingUri780142386") + .setFInt32(-1143775883) + .setFInt64(-1143775788) + .setFDouble(-1239459382) + .setPInt32(-858673665) + .setPInt64(-858673570) + .setPDouble(-991225216) + .build(); + + RepeatResponse actualResponse = client.repeatDataPathTrailingResource(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockCompliance.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + RepeatRequest actualRequest = ((RepeatRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getName(), actualRequest.getName()); + Assert.assertEquals(request.getInfo(), actualRequest.getInfo()); + Assert.assertEquals(request.getServerVerify(), actualRequest.getServerVerify()); + Assert.assertEquals(request.getIntendedBindingUri(), actualRequest.getIntendedBindingUri()); + Assert.assertEquals(request.getFInt32(), actualRequest.getFInt32()); + Assert.assertEquals(request.getFInt64(), actualRequest.getFInt64()); + Assert.assertEquals(request.getFDouble(), actualRequest.getFDouble(), 0.0001); + Assert.assertEquals(request.getPInt32(), actualRequest.getPInt32()); + Assert.assertEquals(request.getPInt64(), actualRequest.getPInt64()); + Assert.assertEquals(request.getPDouble(), actualRequest.getPDouble(), 0.0001); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void repeatDataPathTrailingResourceExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockCompliance.addException(exception); + + try { + RepeatRequest request = + RepeatRequest.newBuilder() + .setName("name3373707") + .setInfo(ComplianceData.newBuilder().build()) + .setServerVerify(true) + .setIntendedBindingUri("intendedBindingUri780142386") + .setFInt32(-1143775883) + .setFInt64(-1143775788) + .setFDouble(-1239459382) + .setPInt32(-858673665) + .setPInt64(-858673570) + .setPDouble(-991225216) + .build(); + client.repeatDataPathTrailingResource(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void repeatDataBodyPutTest() throws Exception { + RepeatResponse expectedResponse = + RepeatResponse.newBuilder() + .setRequest(RepeatRequest.newBuilder().build()) + .setBindingUri("bindingUri1514820775") + .build(); + mockCompliance.addResponse(expectedResponse); + + RepeatRequest request = + RepeatRequest.newBuilder() + .setName("name3373707") + .setInfo(ComplianceData.newBuilder().build()) + .setServerVerify(true) + .setIntendedBindingUri("intendedBindingUri780142386") + .setFInt32(-1143775883) + .setFInt64(-1143775788) + .setFDouble(-1239459382) + .setPInt32(-858673665) + .setPInt64(-858673570) + .setPDouble(-991225216) + .build(); + + RepeatResponse actualResponse = client.repeatDataBodyPut(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockCompliance.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + RepeatRequest actualRequest = ((RepeatRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getName(), actualRequest.getName()); + Assert.assertEquals(request.getInfo(), actualRequest.getInfo()); + Assert.assertEquals(request.getServerVerify(), actualRequest.getServerVerify()); + Assert.assertEquals(request.getIntendedBindingUri(), actualRequest.getIntendedBindingUri()); + Assert.assertEquals(request.getFInt32(), actualRequest.getFInt32()); + Assert.assertEquals(request.getFInt64(), actualRequest.getFInt64()); + Assert.assertEquals(request.getFDouble(), actualRequest.getFDouble(), 0.0001); + Assert.assertEquals(request.getPInt32(), actualRequest.getPInt32()); + Assert.assertEquals(request.getPInt64(), actualRequest.getPInt64()); + Assert.assertEquals(request.getPDouble(), actualRequest.getPDouble(), 0.0001); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void repeatDataBodyPutExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockCompliance.addException(exception); + + try { + RepeatRequest request = + RepeatRequest.newBuilder() + .setName("name3373707") + .setInfo(ComplianceData.newBuilder().build()) + .setServerVerify(true) + .setIntendedBindingUri("intendedBindingUri780142386") + .setFInt32(-1143775883) + .setFInt64(-1143775788) + .setFDouble(-1239459382) + .setPInt32(-858673665) + .setPInt64(-858673570) + .setPDouble(-991225216) + .build(); + client.repeatDataBodyPut(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void repeatDataBodyPatchTest() throws Exception { + RepeatResponse expectedResponse = + RepeatResponse.newBuilder() + .setRequest(RepeatRequest.newBuilder().build()) + .setBindingUri("bindingUri1514820775") + .build(); + mockCompliance.addResponse(expectedResponse); + + RepeatRequest request = + RepeatRequest.newBuilder() + .setName("name3373707") + .setInfo(ComplianceData.newBuilder().build()) + .setServerVerify(true) + .setIntendedBindingUri("intendedBindingUri780142386") + .setFInt32(-1143775883) + .setFInt64(-1143775788) + .setFDouble(-1239459382) + .setPInt32(-858673665) + .setPInt64(-858673570) + .setPDouble(-991225216) + .build(); + + RepeatResponse actualResponse = client.repeatDataBodyPatch(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockCompliance.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + RepeatRequest actualRequest = ((RepeatRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getName(), actualRequest.getName()); + Assert.assertEquals(request.getInfo(), actualRequest.getInfo()); + Assert.assertEquals(request.getServerVerify(), actualRequest.getServerVerify()); + Assert.assertEquals(request.getIntendedBindingUri(), actualRequest.getIntendedBindingUri()); + Assert.assertEquals(request.getFInt32(), actualRequest.getFInt32()); + Assert.assertEquals(request.getFInt64(), actualRequest.getFInt64()); + Assert.assertEquals(request.getFDouble(), actualRequest.getFDouble(), 0.0001); + Assert.assertEquals(request.getPInt32(), actualRequest.getPInt32()); + Assert.assertEquals(request.getPInt64(), actualRequest.getPInt64()); + Assert.assertEquals(request.getPDouble(), actualRequest.getPDouble(), 0.0001); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void repeatDataBodyPatchExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockCompliance.addException(exception); + + try { + RepeatRequest request = + RepeatRequest.newBuilder() + .setName("name3373707") + .setInfo(ComplianceData.newBuilder().build()) + .setServerVerify(true) + .setIntendedBindingUri("intendedBindingUri780142386") + .setFInt32(-1143775883) + .setFInt64(-1143775788) + .setFDouble(-1239459382) + .setPInt32(-858673665) + .setPInt64(-858673570) + .setPDouble(-991225216) + .build(); + client.repeatDataBodyPatch(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getEnumTest() throws Exception { + EnumResponse expectedResponse = + EnumResponse.newBuilder() + .setRequest(EnumRequest.newBuilder().build()) + .setContinent(Continent.forNumber(0)) + .build(); + mockCompliance.addResponse(expectedResponse); + + EnumRequest request = EnumRequest.newBuilder().setUnknownEnum(true).build(); + + EnumResponse actualResponse = client.getEnum(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockCompliance.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + EnumRequest actualRequest = ((EnumRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getUnknownEnum(), actualRequest.getUnknownEnum()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getEnumExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockCompliance.addException(exception); + + try { + EnumRequest request = EnumRequest.newBuilder().setUnknownEnum(true).build(); + client.getEnum(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void verifyEnumTest() throws Exception { + EnumResponse expectedResponse = + EnumResponse.newBuilder() + .setRequest(EnumRequest.newBuilder().build()) + .setContinent(Continent.forNumber(0)) + .build(); + mockCompliance.addResponse(expectedResponse); + + EnumResponse request = + EnumResponse.newBuilder() + .setRequest(EnumRequest.newBuilder().build()) + .setContinent(Continent.forNumber(0)) + .build(); + + EnumResponse actualResponse = client.verifyEnum(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockCompliance.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + EnumResponse actualRequest = ((EnumResponse) actualRequests.get(0)); + + Assert.assertEquals(request.getRequest(), actualRequest.getRequest()); + Assert.assertEquals(request.getContinent(), actualRequest.getContinent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void verifyEnumExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockCompliance.addException(exception); + + try { + EnumResponse request = + EnumResponse.newBuilder() + .setRequest(EnumRequest.newBuilder().build()) + .setContinent(Continent.forNumber(0)) + .build(); + client.verifyEnum(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listLocationsTest() throws Exception { + Location responsesElement = Location.newBuilder().build(); + ListLocationsResponse expectedResponse = + ListLocationsResponse.newBuilder() + .setNextPageToken("") + .addAllLocations(Arrays.asList(responsesElement)) + .build(); + mockLocations.addResponse(expectedResponse); + + ListLocationsRequest request = + ListLocationsRequest.newBuilder() + .setName("name3373707") + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + + ListLocationsPagedResponse pagedListResponse = client.listLocations(request); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getLocationsList().get(0), resources.get(0)); + + List actualRequests = mockLocations.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListLocationsRequest actualRequest = ((ListLocationsRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getName(), actualRequest.getName()); + Assert.assertEquals(request.getFilter(), actualRequest.getFilter()); + Assert.assertEquals(request.getPageSize(), actualRequest.getPageSize()); + Assert.assertEquals(request.getPageToken(), actualRequest.getPageToken()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listLocationsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockLocations.addException(exception); + + try { + ListLocationsRequest request = + ListLocationsRequest.newBuilder() + .setName("name3373707") + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + client.listLocations(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getLocationTest() throws Exception { + Location expectedResponse = + Location.newBuilder() + .setName("name3373707") + .setLocationId("locationId1541836720") + .setDisplayName("displayName1714148973") + .putAllLabels(new HashMap()) + .setMetadata(Any.newBuilder().build()) + .build(); + mockLocations.addResponse(expectedResponse); + + GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build(); + + Location actualResponse = client.getLocation(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockLocations.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetLocationRequest actualRequest = ((GetLocationRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getName(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getLocationExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockLocations.addException(exception); + + try { + GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build(); + client.getLocation(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void setIamPolicyTest() throws Exception { + Policy expectedResponse = + Policy.newBuilder() + .setVersion(351608024) + .addAllBindings(new ArrayList()) + .addAllAuditConfigs(new ArrayList()) + .setEtag(ByteString.EMPTY) + .build(); + mockIAMPolicy.addResponse(expectedResponse); + + SetIamPolicyRequest request = + SetIamPolicyRequest.newBuilder() + .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString()) + .setPolicy(Policy.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .build(); + + Policy actualResponse = client.setIamPolicy(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockIAMPolicy.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + SetIamPolicyRequest actualRequest = ((SetIamPolicyRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getResource(), actualRequest.getResource()); + Assert.assertEquals(request.getPolicy(), actualRequest.getPolicy()); + Assert.assertEquals(request.getUpdateMask(), actualRequest.getUpdateMask()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void setIamPolicyExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockIAMPolicy.addException(exception); + + try { + SetIamPolicyRequest request = + SetIamPolicyRequest.newBuilder() + .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString()) + .setPolicy(Policy.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .build(); + client.setIamPolicy(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getIamPolicyTest() throws Exception { + Policy expectedResponse = + Policy.newBuilder() + .setVersion(351608024) + .addAllBindings(new ArrayList()) + .addAllAuditConfigs(new ArrayList()) + .setEtag(ByteString.EMPTY) + .build(); + mockIAMPolicy.addResponse(expectedResponse); + + GetIamPolicyRequest request = + GetIamPolicyRequest.newBuilder() + .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString()) + .setOptions(GetPolicyOptions.newBuilder().build()) + .build(); + + Policy actualResponse = client.getIamPolicy(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockIAMPolicy.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetIamPolicyRequest actualRequest = ((GetIamPolicyRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getResource(), actualRequest.getResource()); + Assert.assertEquals(request.getOptions(), actualRequest.getOptions()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getIamPolicyExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockIAMPolicy.addException(exception); + + try { + GetIamPolicyRequest request = + GetIamPolicyRequest.newBuilder() + .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString()) + .setOptions(GetPolicyOptions.newBuilder().build()) + .build(); + client.getIamPolicy(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void testIamPermissionsTest() throws Exception { + TestIamPermissionsResponse expectedResponse = + TestIamPermissionsResponse.newBuilder().addAllPermissions(new ArrayList()).build(); + mockIAMPolicy.addResponse(expectedResponse); + + TestIamPermissionsRequest request = + TestIamPermissionsRequest.newBuilder() + .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString()) + .addAllPermissions(new ArrayList()) + .build(); + + TestIamPermissionsResponse actualResponse = client.testIamPermissions(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockIAMPolicy.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + TestIamPermissionsRequest actualRequest = ((TestIamPermissionsRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getResource(), actualRequest.getResource()); + Assert.assertEquals(request.getPermissionsList(), actualRequest.getPermissionsList()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void testIamPermissionsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockIAMPolicy.addException(exception); + + try { + TestIamPermissionsRequest request = + TestIamPermissionsRequest.newBuilder() + .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString()) + .addAllPermissions(new ArrayList()) + .build(); + client.testIamPermissions(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } +} diff --git a/java-showcase-3.25.8/gapic-showcase/src/test/java/com/google/showcase/v1beta1/EchoClientHttpJsonTest.java b/java-showcase-3.25.8/gapic-showcase/src/test/java/com/google/showcase/v1beta1/EchoClientHttpJsonTest.java new file mode 100644 index 0000000000..a558473f2f --- /dev/null +++ b/java-showcase-3.25.8/gapic-showcase/src/test/java/com/google/showcase/v1beta1/EchoClientHttpJsonTest.java @@ -0,0 +1,827 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1; + +import static com.google.showcase.v1beta1.EchoClient.ListLocationsPagedResponse; +import static com.google.showcase.v1beta1.EchoClient.PagedExpandLegacyMappedPagedResponse; +import static com.google.showcase.v1beta1.EchoClient.PagedExpandPagedResponse; + +import com.google.api.gax.core.NoCredentialsProvider; +import com.google.api.gax.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.testing.MockHttpService; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ApiException; +import com.google.api.gax.rpc.ApiExceptionFactory; +import com.google.api.gax.rpc.InvalidArgumentException; +import com.google.api.gax.rpc.StatusCode; +import com.google.api.gax.rpc.testing.FakeStatusCode; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.common.collect.Lists; +import com.google.iam.v1.AuditConfig; +import com.google.iam.v1.Binding; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.GetPolicyOptions; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.longrunning.Operation; +import com.google.protobuf.Any; +import com.google.protobuf.ByteString; +import com.google.protobuf.Duration; +import com.google.protobuf.FieldMask; +import com.google.showcase.v1beta1.stub.HttpJsonEchoStub; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +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 EchoClientHttpJsonTest { + private static MockHttpService mockService; + private static EchoClient client; + + @BeforeClass + public static void startStaticServer() throws IOException { + mockService = + new MockHttpService( + HttpJsonEchoStub.getMethodDescriptors(), EchoSettings.getDefaultEndpoint()); + EchoSettings settings = + EchoSettings.newHttpJsonBuilder() + .setTransportChannelProvider( + EchoSettings.defaultHttpJsonTransportProviderBuilder() + .setHttpTransport(mockService) + .build()) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = EchoClient.create(settings); + } + + @AfterClass + public static void stopServer() { + client.close(); + } + + @Before + public void setUp() {} + + @After + public void tearDown() throws Exception { + mockService.reset(); + } + + @Test + public void echoTest() throws Exception { + EchoResponse expectedResponse = + EchoResponse.newBuilder() + .setContent("content951530617") + .setSeverity(Severity.forNumber(0)) + .setRequestId("requestId693933066") + .setOtherRequestId("otherRequestId1248995034") + .build(); + mockService.addResponse(expectedResponse); + + EchoRequest request = + EchoRequest.newBuilder() + .setSeverity(Severity.forNumber(0)) + .setHeader("header-1221270899") + .setOtherHeader("otherHeader-2026585667") + .setRequestId("requestId693933066") + .setOtherRequestId("otherRequestId1248995034") + .build(); + + EchoResponse actualResponse = client.echo(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void echoExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + EchoRequest request = + EchoRequest.newBuilder() + .setSeverity(Severity.forNumber(0)) + .setHeader("header-1221270899") + .setOtherHeader("otherHeader-2026585667") + .setRequestId("requestId693933066") + .setOtherRequestId("otherRequestId1248995034") + .build(); + client.echo(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void echoErrorDetailsTest() throws Exception { + EchoErrorDetailsResponse expectedResponse = + EchoErrorDetailsResponse.newBuilder() + .setSingleDetail(EchoErrorDetailsResponse.SingleDetail.newBuilder().build()) + .setMultipleDetails(EchoErrorDetailsResponse.MultipleDetails.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + EchoErrorDetailsRequest request = + EchoErrorDetailsRequest.newBuilder() + .setSingleDetailText("singleDetailText1774380934") + .addAllMultiDetailText(new ArrayList()) + .build(); + + EchoErrorDetailsResponse actualResponse = client.echoErrorDetails(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void echoErrorDetailsExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + EchoErrorDetailsRequest request = + EchoErrorDetailsRequest.newBuilder() + .setSingleDetailText("singleDetailText1774380934") + .addAllMultiDetailText(new ArrayList()) + .build(); + client.echoErrorDetails(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void failEchoWithDetailsTest() throws Exception { + FailEchoWithDetailsResponse expectedResponse = FailEchoWithDetailsResponse.newBuilder().build(); + mockService.addResponse(expectedResponse); + + FailEchoWithDetailsRequest request = + FailEchoWithDetailsRequest.newBuilder().setMessage("message954925063").build(); + + FailEchoWithDetailsResponse actualResponse = client.failEchoWithDetails(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void failEchoWithDetailsExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + FailEchoWithDetailsRequest request = + FailEchoWithDetailsRequest.newBuilder().setMessage("message954925063").build(); + client.failEchoWithDetails(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void expandTest() throws Exception {} + + @Test + public void expandExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + } + + @Test + public void collectUnsupportedMethodTest() throws Exception { + // The collect() method is not supported in REST transport. + // This empty test is generated for technical reasons. + } + + @Test + public void chatUnsupportedMethodTest() throws Exception { + // The chat() method is not supported in REST transport. + // This empty test is generated for technical reasons. + } + + @Test + public void pagedExpandTest() throws Exception { + EchoResponse responsesElement = EchoResponse.newBuilder().build(); + PagedExpandResponse expectedResponse = + PagedExpandResponse.newBuilder() + .setNextPageToken("") + .addAllResponses(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + PagedExpandRequest request = + PagedExpandRequest.newBuilder() + .setContent("content951530617") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + + PagedExpandPagedResponse pagedListResponse = client.pagedExpand(request); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getResponsesList().get(0), resources.get(0)); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void pagedExpandExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + PagedExpandRequest request = + PagedExpandRequest.newBuilder() + .setContent("content951530617") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + client.pagedExpand(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void pagedExpandLegacyTest() throws Exception { + PagedExpandResponse expectedResponse = + PagedExpandResponse.newBuilder() + .addAllResponses(new ArrayList()) + .setNextPageToken("nextPageToken-1386094857") + .build(); + mockService.addResponse(expectedResponse); + + PagedExpandLegacyRequest request = + PagedExpandLegacyRequest.newBuilder() + .setContent("content951530617") + .setMaxResults(1128457243) + .setPageToken("pageToken873572522") + .build(); + + PagedExpandResponse actualResponse = client.pagedExpandLegacy(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void pagedExpandLegacyExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + PagedExpandLegacyRequest request = + PagedExpandLegacyRequest.newBuilder() + .setContent("content951530617") + .setMaxResults(1128457243) + .setPageToken("pageToken873572522") + .build(); + client.pagedExpandLegacy(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void pagedExpandLegacyMappedTest() throws Exception { + PagedExpandResponseList responsesElement = PagedExpandResponseList.newBuilder().build(); + PagedExpandLegacyMappedResponse expectedResponse = + PagedExpandLegacyMappedResponse.newBuilder() + .setNextPageToken("") + .putAllAlphabetized(Collections.singletonMap("alphabetized", responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + PagedExpandRequest request = + PagedExpandRequest.newBuilder() + .setContent("content951530617") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + + PagedExpandLegacyMappedPagedResponse pagedListResponse = + client.pagedExpandLegacyMapped(request); + + List> resources = + Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals( + expectedResponse.getAlphabetizedMap().entrySet().iterator().next(), resources.get(0)); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void pagedExpandLegacyMappedExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + PagedExpandRequest request = + PagedExpandRequest.newBuilder() + .setContent("content951530617") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + client.pagedExpandLegacyMapped(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void waitTest() throws Exception { + WaitResponse expectedResponse = + WaitResponse.newBuilder().setContent("content951530617").build(); + Operation resultOperation = + Operation.newBuilder() + .setName("waitTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockService.addResponse(resultOperation); + + WaitRequest request = WaitRequest.newBuilder().build(); + + WaitResponse actualResponse = client.waitAsync(request).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void waitExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + WaitRequest request = WaitRequest.newBuilder().build(); + client.waitAsync(request).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + } + } + + @Test + public void blockTest() throws Exception { + BlockResponse expectedResponse = + BlockResponse.newBuilder().setContent("content951530617").build(); + mockService.addResponse(expectedResponse); + + BlockRequest request = + BlockRequest.newBuilder().setResponseDelay(Duration.newBuilder().build()).build(); + + BlockResponse actualResponse = client.block(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void blockExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + BlockRequest request = + BlockRequest.newBuilder().setResponseDelay(Duration.newBuilder().build()).build(); + client.block(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listLocationsTest() throws Exception { + Location responsesElement = Location.newBuilder().build(); + ListLocationsResponse expectedResponse = + ListLocationsResponse.newBuilder() + .setNextPageToken("") + .addAllLocations(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + ListLocationsRequest request = + ListLocationsRequest.newBuilder() + .setName("projects/project-3664") + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + + ListLocationsPagedResponse pagedListResponse = client.listLocations(request); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getLocationsList().get(0), resources.get(0)); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void listLocationsExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ListLocationsRequest request = + ListLocationsRequest.newBuilder() + .setName("projects/project-3664") + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + client.listLocations(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getLocationTest() throws Exception { + Location expectedResponse = + Location.newBuilder() + .setName("name3373707") + .setLocationId("locationId1541836720") + .setDisplayName("displayName1714148973") + .putAllLabels(new HashMap()) + .setMetadata(Any.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + GetLocationRequest request = + GetLocationRequest.newBuilder() + .setName("projects/project-9062/locations/location-9062") + .build(); + + Location actualResponse = client.getLocation(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void getLocationExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + GetLocationRequest request = + GetLocationRequest.newBuilder() + .setName("projects/project-9062/locations/location-9062") + .build(); + client.getLocation(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void setIamPolicyTest() throws Exception { + Policy expectedResponse = + Policy.newBuilder() + .setVersion(351608024) + .addAllBindings(new ArrayList()) + .addAllAuditConfigs(new ArrayList()) + .setEtag(ByteString.EMPTY) + .build(); + mockService.addResponse(expectedResponse); + + SetIamPolicyRequest request = + SetIamPolicyRequest.newBuilder() + .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString()) + .setPolicy(Policy.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .build(); + + Policy actualResponse = client.setIamPolicy(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void setIamPolicyExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + SetIamPolicyRequest request = + SetIamPolicyRequest.newBuilder() + .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString()) + .setPolicy(Policy.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .build(); + client.setIamPolicy(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getIamPolicyTest() throws Exception { + Policy expectedResponse = + Policy.newBuilder() + .setVersion(351608024) + .addAllBindings(new ArrayList()) + .addAllAuditConfigs(new ArrayList()) + .setEtag(ByteString.EMPTY) + .build(); + mockService.addResponse(expectedResponse); + + GetIamPolicyRequest request = + GetIamPolicyRequest.newBuilder() + .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString()) + .setOptions(GetPolicyOptions.newBuilder().build()) + .build(); + + Policy actualResponse = client.getIamPolicy(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void getIamPolicyExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + GetIamPolicyRequest request = + GetIamPolicyRequest.newBuilder() + .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString()) + .setOptions(GetPolicyOptions.newBuilder().build()) + .build(); + client.getIamPolicy(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void testIamPermissionsTest() throws Exception { + TestIamPermissionsResponse expectedResponse = + TestIamPermissionsResponse.newBuilder().addAllPermissions(new ArrayList()).build(); + mockService.addResponse(expectedResponse); + + TestIamPermissionsRequest request = + TestIamPermissionsRequest.newBuilder() + .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString()) + .addAllPermissions(new ArrayList()) + .build(); + + TestIamPermissionsResponse actualResponse = client.testIamPermissions(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void testIamPermissionsExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + TestIamPermissionsRequest request = + TestIamPermissionsRequest.newBuilder() + .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString()) + .addAllPermissions(new ArrayList()) + .build(); + client.testIamPermissions(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } +} diff --git a/java-showcase-3.25.8/gapic-showcase/src/test/java/com/google/showcase/v1beta1/EchoClientTest.java b/java-showcase-3.25.8/gapic-showcase/src/test/java/com/google/showcase/v1beta1/EchoClientTest.java new file mode 100644 index 0000000000..44ce3dff79 --- /dev/null +++ b/java-showcase-3.25.8/gapic-showcase/src/test/java/com/google/showcase/v1beta1/EchoClientTest.java @@ -0,0 +1,941 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1; + +import static com.google.showcase.v1beta1.EchoClient.ListLocationsPagedResponse; +import static com.google.showcase.v1beta1.EchoClient.PagedExpandLegacyMappedPagedResponse; +import static com.google.showcase.v1beta1.EchoClient.PagedExpandPagedResponse; + +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.ClientStreamingCallable; +import com.google.api.gax.rpc.InvalidArgumentException; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.api.gax.rpc.StatusCode; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.common.collect.Lists; +import com.google.iam.v1.AuditConfig; +import com.google.iam.v1.Binding; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.GetPolicyOptions; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.longrunning.Operation; +import com.google.protobuf.AbstractMessage; +import com.google.protobuf.Any; +import com.google.protobuf.ByteString; +import com.google.protobuf.Duration; +import com.google.protobuf.FieldMask; +import com.google.rpc.Status; +import io.grpc.StatusRuntimeException; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collections; +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 EchoClientTest { + private static MockEcho mockEcho; + private static MockIAMPolicy mockIAMPolicy; + private static MockLocations mockLocations; + private static MockServiceHelper mockServiceHelper; + private LocalChannelProvider channelProvider; + private EchoClient client; + + @BeforeClass + public static void startStaticServer() { + mockEcho = new MockEcho(); + mockLocations = new MockLocations(); + mockIAMPolicy = new MockIAMPolicy(); + mockServiceHelper = + new MockServiceHelper( + UUID.randomUUID().toString(), + Arrays.asList(mockEcho, mockLocations, mockIAMPolicy)); + mockServiceHelper.start(); + } + + @AfterClass + public static void stopServer() { + mockServiceHelper.stop(); + } + + @Before + public void setUp() throws IOException { + mockServiceHelper.reset(); + channelProvider = mockServiceHelper.createChannelProvider(); + EchoSettings settings = + EchoSettings.newBuilder() + .setTransportChannelProvider(channelProvider) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = EchoClient.create(settings); + } + + @After + public void tearDown() throws Exception { + client.close(); + } + + @Test + public void echoTest() throws Exception { + EchoResponse expectedResponse = + EchoResponse.newBuilder() + .setContent("content951530617") + .setSeverity(Severity.forNumber(0)) + .setRequestId("requestId693933066") + .setOtherRequestId("otherRequestId1248995034") + .build(); + mockEcho.addResponse(expectedResponse); + + EchoRequest request = + EchoRequest.newBuilder() + .setSeverity(Severity.forNumber(0)) + .setHeader("header-1221270899") + .setOtherHeader("otherHeader-2026585667") + .setRequestId("requestId693933066") + .setOtherRequestId("otherRequestId1248995034") + .build(); + + EchoResponse actualResponse = client.echo(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockEcho.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + EchoRequest actualRequest = ((EchoRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getContent(), actualRequest.getContent()); + Assert.assertEquals(request.getError(), actualRequest.getError()); + Assert.assertEquals(request.getSeverity(), actualRequest.getSeverity()); + Assert.assertEquals(request.getHeader(), actualRequest.getHeader()); + Assert.assertEquals(request.getOtherHeader(), actualRequest.getOtherHeader()); + Assert.assertEquals(request.getRequestId(), actualRequest.getRequestId()); + Assert.assertEquals(request.getOtherRequestId(), actualRequest.getOtherRequestId()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void echoExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockEcho.addException(exception); + + try { + EchoRequest request = + EchoRequest.newBuilder() + .setSeverity(Severity.forNumber(0)) + .setHeader("header-1221270899") + .setOtherHeader("otherHeader-2026585667") + .setRequestId("requestId693933066") + .setOtherRequestId("otherRequestId1248995034") + .build(); + client.echo(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void echoErrorDetailsTest() throws Exception { + EchoErrorDetailsResponse expectedResponse = + EchoErrorDetailsResponse.newBuilder() + .setSingleDetail(EchoErrorDetailsResponse.SingleDetail.newBuilder().build()) + .setMultipleDetails(EchoErrorDetailsResponse.MultipleDetails.newBuilder().build()) + .build(); + mockEcho.addResponse(expectedResponse); + + EchoErrorDetailsRequest request = + EchoErrorDetailsRequest.newBuilder() + .setSingleDetailText("singleDetailText1774380934") + .addAllMultiDetailText(new ArrayList()) + .build(); + + EchoErrorDetailsResponse actualResponse = client.echoErrorDetails(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockEcho.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + EchoErrorDetailsRequest actualRequest = ((EchoErrorDetailsRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getSingleDetailText(), actualRequest.getSingleDetailText()); + Assert.assertEquals(request.getMultiDetailTextList(), actualRequest.getMultiDetailTextList()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void echoErrorDetailsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockEcho.addException(exception); + + try { + EchoErrorDetailsRequest request = + EchoErrorDetailsRequest.newBuilder() + .setSingleDetailText("singleDetailText1774380934") + .addAllMultiDetailText(new ArrayList()) + .build(); + client.echoErrorDetails(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void failEchoWithDetailsTest() throws Exception { + FailEchoWithDetailsResponse expectedResponse = FailEchoWithDetailsResponse.newBuilder().build(); + mockEcho.addResponse(expectedResponse); + + FailEchoWithDetailsRequest request = + FailEchoWithDetailsRequest.newBuilder().setMessage("message954925063").build(); + + FailEchoWithDetailsResponse actualResponse = client.failEchoWithDetails(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockEcho.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + FailEchoWithDetailsRequest actualRequest = ((FailEchoWithDetailsRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getMessage(), actualRequest.getMessage()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void failEchoWithDetailsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockEcho.addException(exception); + + try { + FailEchoWithDetailsRequest request = + FailEchoWithDetailsRequest.newBuilder().setMessage("message954925063").build(); + client.failEchoWithDetails(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void expandTest() throws Exception { + EchoResponse expectedResponse = + EchoResponse.newBuilder() + .setContent("content951530617") + .setSeverity(Severity.forNumber(0)) + .setRequestId("requestId693933066") + .setOtherRequestId("otherRequestId1248995034") + .build(); + mockEcho.addResponse(expectedResponse); + ExpandRequest request = + ExpandRequest.newBuilder() + .setContent("content951530617") + .setError(Status.newBuilder().build()) + .setStreamWaitTime(Duration.newBuilder().build()) + .build(); + + MockStreamObserver responseObserver = new MockStreamObserver<>(); + + ServerStreamingCallable callable = client.expandCallable(); + callable.serverStreamingCall(request, responseObserver); + + List actualResponses = responseObserver.future().get(); + Assert.assertEquals(1, actualResponses.size()); + Assert.assertEquals(expectedResponse, actualResponses.get(0)); + } + + @Test + public void expandExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockEcho.addException(exception); + ExpandRequest request = + ExpandRequest.newBuilder() + .setContent("content951530617") + .setError(Status.newBuilder().build()) + .setStreamWaitTime(Duration.newBuilder().build()) + .build(); + + MockStreamObserver responseObserver = new MockStreamObserver<>(); + + ServerStreamingCallable callable = client.expandCallable(); + callable.serverStreamingCall(request, responseObserver); + + 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()); + } + } + + @Test + public void collectTest() throws Exception { + EchoResponse expectedResponse = + EchoResponse.newBuilder() + .setContent("content951530617") + .setSeverity(Severity.forNumber(0)) + .setRequestId("requestId693933066") + .setOtherRequestId("otherRequestId1248995034") + .build(); + mockEcho.addResponse(expectedResponse); + EchoRequest request = + EchoRequest.newBuilder() + .setSeverity(Severity.forNumber(0)) + .setHeader("header-1221270899") + .setOtherHeader("otherHeader-2026585667") + .setRequestId("requestId693933066") + .setOtherRequestId("otherRequestId1248995034") + .build(); + + MockStreamObserver responseObserver = new MockStreamObserver<>(); + + ClientStreamingCallable callable = client.collectCallable(); + ApiStreamObserver requestObserver = callable.clientStreamingCall(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 collectExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockEcho.addException(exception); + EchoRequest request = + EchoRequest.newBuilder() + .setSeverity(Severity.forNumber(0)) + .setHeader("header-1221270899") + .setOtherHeader("otherHeader-2026585667") + .setRequestId("requestId693933066") + .setOtherRequestId("otherRequestId1248995034") + .build(); + + MockStreamObserver responseObserver = new MockStreamObserver<>(); + + ClientStreamingCallable callable = client.collectCallable(); + ApiStreamObserver requestObserver = callable.clientStreamingCall(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()); + } + } + + @Test + public void chatTest() throws Exception { + EchoResponse expectedResponse = + EchoResponse.newBuilder() + .setContent("content951530617") + .setSeverity(Severity.forNumber(0)) + .setRequestId("requestId693933066") + .setOtherRequestId("otherRequestId1248995034") + .build(); + mockEcho.addResponse(expectedResponse); + EchoRequest request = + EchoRequest.newBuilder() + .setSeverity(Severity.forNumber(0)) + .setHeader("header-1221270899") + .setOtherHeader("otherHeader-2026585667") + .setRequestId("requestId693933066") + .setOtherRequestId("otherRequestId1248995034") + .build(); + + MockStreamObserver responseObserver = new MockStreamObserver<>(); + + BidiStreamingCallable callable = client.chatCallable(); + 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 chatExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockEcho.addException(exception); + EchoRequest request = + EchoRequest.newBuilder() + .setSeverity(Severity.forNumber(0)) + .setHeader("header-1221270899") + .setOtherHeader("otherHeader-2026585667") + .setRequestId("requestId693933066") + .setOtherRequestId("otherRequestId1248995034") + .build(); + + MockStreamObserver responseObserver = new MockStreamObserver<>(); + + BidiStreamingCallable callable = client.chatCallable(); + 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()); + } + } + + @Test + public void pagedExpandTest() throws Exception { + EchoResponse responsesElement = EchoResponse.newBuilder().build(); + PagedExpandResponse expectedResponse = + PagedExpandResponse.newBuilder() + .setNextPageToken("") + .addAllResponses(Arrays.asList(responsesElement)) + .build(); + mockEcho.addResponse(expectedResponse); + + PagedExpandRequest request = + PagedExpandRequest.newBuilder() + .setContent("content951530617") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + + PagedExpandPagedResponse pagedListResponse = client.pagedExpand(request); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getResponsesList().get(0), resources.get(0)); + + List actualRequests = mockEcho.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + PagedExpandRequest actualRequest = ((PagedExpandRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getContent(), actualRequest.getContent()); + Assert.assertEquals(request.getPageSize(), actualRequest.getPageSize()); + Assert.assertEquals(request.getPageToken(), actualRequest.getPageToken()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void pagedExpandExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockEcho.addException(exception); + + try { + PagedExpandRequest request = + PagedExpandRequest.newBuilder() + .setContent("content951530617") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + client.pagedExpand(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void pagedExpandLegacyTest() throws Exception { + PagedExpandResponse expectedResponse = + PagedExpandResponse.newBuilder() + .addAllResponses(new ArrayList()) + .setNextPageToken("nextPageToken-1386094857") + .build(); + mockEcho.addResponse(expectedResponse); + + PagedExpandLegacyRequest request = + PagedExpandLegacyRequest.newBuilder() + .setContent("content951530617") + .setMaxResults(1128457243) + .setPageToken("pageToken873572522") + .build(); + + PagedExpandResponse actualResponse = client.pagedExpandLegacy(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockEcho.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + PagedExpandLegacyRequest actualRequest = ((PagedExpandLegacyRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getContent(), actualRequest.getContent()); + Assert.assertEquals(request.getMaxResults(), actualRequest.getMaxResults()); + Assert.assertEquals(request.getPageToken(), actualRequest.getPageToken()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void pagedExpandLegacyExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockEcho.addException(exception); + + try { + PagedExpandLegacyRequest request = + PagedExpandLegacyRequest.newBuilder() + .setContent("content951530617") + .setMaxResults(1128457243) + .setPageToken("pageToken873572522") + .build(); + client.pagedExpandLegacy(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void pagedExpandLegacyMappedTest() throws Exception { + PagedExpandResponseList responsesElement = PagedExpandResponseList.newBuilder().build(); + PagedExpandLegacyMappedResponse expectedResponse = + PagedExpandLegacyMappedResponse.newBuilder() + .setNextPageToken("") + .putAllAlphabetized(Collections.singletonMap("alphabetized", responsesElement)) + .build(); + mockEcho.addResponse(expectedResponse); + + PagedExpandRequest request = + PagedExpandRequest.newBuilder() + .setContent("content951530617") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + + PagedExpandLegacyMappedPagedResponse pagedListResponse = + client.pagedExpandLegacyMapped(request); + + List> resources = + Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals( + expectedResponse.getAlphabetizedMap().entrySet().iterator().next(), resources.get(0)); + + List actualRequests = mockEcho.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + PagedExpandRequest actualRequest = ((PagedExpandRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getContent(), actualRequest.getContent()); + Assert.assertEquals(request.getPageSize(), actualRequest.getPageSize()); + Assert.assertEquals(request.getPageToken(), actualRequest.getPageToken()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void pagedExpandLegacyMappedExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockEcho.addException(exception); + + try { + PagedExpandRequest request = + PagedExpandRequest.newBuilder() + .setContent("content951530617") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + client.pagedExpandLegacyMapped(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void waitTest() throws Exception { + WaitResponse expectedResponse = + WaitResponse.newBuilder().setContent("content951530617").build(); + Operation resultOperation = + Operation.newBuilder() + .setName("waitTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockEcho.addResponse(resultOperation); + + WaitRequest request = WaitRequest.newBuilder().build(); + + WaitResponse actualResponse = client.waitAsync(request).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockEcho.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + WaitRequest actualRequest = ((WaitRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getEndTime(), actualRequest.getEndTime()); + Assert.assertEquals(request.getTtl(), actualRequest.getTtl()); + Assert.assertEquals(request.getError(), actualRequest.getError()); + Assert.assertEquals(request.getSuccess(), actualRequest.getSuccess()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void waitExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockEcho.addException(exception); + + try { + WaitRequest request = WaitRequest.newBuilder().build(); + client.waitAsync(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 blockTest() throws Exception { + BlockResponse expectedResponse = + BlockResponse.newBuilder().setContent("content951530617").build(); + mockEcho.addResponse(expectedResponse); + + BlockRequest request = + BlockRequest.newBuilder().setResponseDelay(Duration.newBuilder().build()).build(); + + BlockResponse actualResponse = client.block(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockEcho.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + BlockRequest actualRequest = ((BlockRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getResponseDelay(), actualRequest.getResponseDelay()); + Assert.assertEquals(request.getError(), actualRequest.getError()); + Assert.assertEquals(request.getSuccess(), actualRequest.getSuccess()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void blockExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockEcho.addException(exception); + + try { + BlockRequest request = + BlockRequest.newBuilder().setResponseDelay(Duration.newBuilder().build()).build(); + client.block(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listLocationsTest() throws Exception { + Location responsesElement = Location.newBuilder().build(); + ListLocationsResponse expectedResponse = + ListLocationsResponse.newBuilder() + .setNextPageToken("") + .addAllLocations(Arrays.asList(responsesElement)) + .build(); + mockLocations.addResponse(expectedResponse); + + ListLocationsRequest request = + ListLocationsRequest.newBuilder() + .setName("name3373707") + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + + ListLocationsPagedResponse pagedListResponse = client.listLocations(request); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getLocationsList().get(0), resources.get(0)); + + List actualRequests = mockLocations.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListLocationsRequest actualRequest = ((ListLocationsRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getName(), actualRequest.getName()); + Assert.assertEquals(request.getFilter(), actualRequest.getFilter()); + Assert.assertEquals(request.getPageSize(), actualRequest.getPageSize()); + Assert.assertEquals(request.getPageToken(), actualRequest.getPageToken()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listLocationsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockLocations.addException(exception); + + try { + ListLocationsRequest request = + ListLocationsRequest.newBuilder() + .setName("name3373707") + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + client.listLocations(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getLocationTest() throws Exception { + Location expectedResponse = + Location.newBuilder() + .setName("name3373707") + .setLocationId("locationId1541836720") + .setDisplayName("displayName1714148973") + .putAllLabels(new HashMap()) + .setMetadata(Any.newBuilder().build()) + .build(); + mockLocations.addResponse(expectedResponse); + + GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build(); + + Location actualResponse = client.getLocation(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockLocations.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetLocationRequest actualRequest = ((GetLocationRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getName(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getLocationExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockLocations.addException(exception); + + try { + GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build(); + client.getLocation(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void setIamPolicyTest() throws Exception { + Policy expectedResponse = + Policy.newBuilder() + .setVersion(351608024) + .addAllBindings(new ArrayList()) + .addAllAuditConfigs(new ArrayList()) + .setEtag(ByteString.EMPTY) + .build(); + mockIAMPolicy.addResponse(expectedResponse); + + SetIamPolicyRequest request = + SetIamPolicyRequest.newBuilder() + .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString()) + .setPolicy(Policy.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .build(); + + Policy actualResponse = client.setIamPolicy(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockIAMPolicy.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + SetIamPolicyRequest actualRequest = ((SetIamPolicyRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getResource(), actualRequest.getResource()); + Assert.assertEquals(request.getPolicy(), actualRequest.getPolicy()); + Assert.assertEquals(request.getUpdateMask(), actualRequest.getUpdateMask()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void setIamPolicyExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockIAMPolicy.addException(exception); + + try { + SetIamPolicyRequest request = + SetIamPolicyRequest.newBuilder() + .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString()) + .setPolicy(Policy.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .build(); + client.setIamPolicy(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getIamPolicyTest() throws Exception { + Policy expectedResponse = + Policy.newBuilder() + .setVersion(351608024) + .addAllBindings(new ArrayList()) + .addAllAuditConfigs(new ArrayList()) + .setEtag(ByteString.EMPTY) + .build(); + mockIAMPolicy.addResponse(expectedResponse); + + GetIamPolicyRequest request = + GetIamPolicyRequest.newBuilder() + .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString()) + .setOptions(GetPolicyOptions.newBuilder().build()) + .build(); + + Policy actualResponse = client.getIamPolicy(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockIAMPolicy.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetIamPolicyRequest actualRequest = ((GetIamPolicyRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getResource(), actualRequest.getResource()); + Assert.assertEquals(request.getOptions(), actualRequest.getOptions()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getIamPolicyExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockIAMPolicy.addException(exception); + + try { + GetIamPolicyRequest request = + GetIamPolicyRequest.newBuilder() + .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString()) + .setOptions(GetPolicyOptions.newBuilder().build()) + .build(); + client.getIamPolicy(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void testIamPermissionsTest() throws Exception { + TestIamPermissionsResponse expectedResponse = + TestIamPermissionsResponse.newBuilder().addAllPermissions(new ArrayList()).build(); + mockIAMPolicy.addResponse(expectedResponse); + + TestIamPermissionsRequest request = + TestIamPermissionsRequest.newBuilder() + .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString()) + .addAllPermissions(new ArrayList()) + .build(); + + TestIamPermissionsResponse actualResponse = client.testIamPermissions(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockIAMPolicy.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + TestIamPermissionsRequest actualRequest = ((TestIamPermissionsRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getResource(), actualRequest.getResource()); + Assert.assertEquals(request.getPermissionsList(), actualRequest.getPermissionsList()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void testIamPermissionsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockIAMPolicy.addException(exception); + + try { + TestIamPermissionsRequest request = + TestIamPermissionsRequest.newBuilder() + .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString()) + .addAllPermissions(new ArrayList()) + .build(); + client.testIamPermissions(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } +} diff --git a/java-showcase-3.25.8/gapic-showcase/src/test/java/com/google/showcase/v1beta1/IdentityClientHttpJsonTest.java b/java-showcase-3.25.8/gapic-showcase/src/test/java/com/google/showcase/v1beta1/IdentityClientHttpJsonTest.java new file mode 100644 index 0000000000..fb43faeb39 --- /dev/null +++ b/java-showcase-3.25.8/gapic-showcase/src/test/java/com/google/showcase/v1beta1/IdentityClientHttpJsonTest.java @@ -0,0 +1,815 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1; + +import static com.google.showcase.v1beta1.IdentityClient.ListLocationsPagedResponse; +import static com.google.showcase.v1beta1.IdentityClient.ListUsersPagedResponse; + +import com.google.api.gax.core.NoCredentialsProvider; +import com.google.api.gax.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.testing.MockHttpService; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ApiException; +import com.google.api.gax.rpc.ApiExceptionFactory; +import com.google.api.gax.rpc.InvalidArgumentException; +import com.google.api.gax.rpc.StatusCode; +import com.google.api.gax.rpc.testing.FakeStatusCode; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.common.collect.Lists; +import com.google.iam.v1.AuditConfig; +import com.google.iam.v1.Binding; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.GetPolicyOptions; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.protobuf.Any; +import com.google.protobuf.ByteString; +import com.google.protobuf.Empty; +import com.google.protobuf.FieldMask; +import com.google.protobuf.Timestamp; +import com.google.showcase.v1beta1.stub.HttpJsonIdentityStub; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +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 IdentityClientHttpJsonTest { + private static MockHttpService mockService; + private static IdentityClient client; + + @BeforeClass + public static void startStaticServer() throws IOException { + mockService = + new MockHttpService( + HttpJsonIdentityStub.getMethodDescriptors(), IdentitySettings.getDefaultEndpoint()); + IdentitySettings settings = + IdentitySettings.newHttpJsonBuilder() + .setTransportChannelProvider( + IdentitySettings.defaultHttpJsonTransportProviderBuilder() + .setHttpTransport(mockService) + .build()) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = IdentityClient.create(settings); + } + + @AfterClass + public static void stopServer() { + client.close(); + } + + @Before + public void setUp() {} + + @After + public void tearDown() throws Exception { + mockService.reset(); + } + + @Test + public void createUserTest() throws Exception { + User expectedResponse = + User.newBuilder() + .setName(UserName.of("[USER]").toString()) + .setDisplayName("displayName1714148973") + .setEmail("email96619420") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setAge(96511) + .setHeightFeet(-1032737338) + .setNickname("nickname70690926") + .setEnableNotifications(true) + .build(); + mockService.addResponse(expectedResponse); + + String displayName = "displayName1714148973"; + String email = "email96619420"; + + User actualResponse = client.createUser(displayName, email); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void createUserExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String displayName = "displayName1714148973"; + String email = "email96619420"; + client.createUser(displayName, email); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createUserTest2() throws Exception { + User expectedResponse = + User.newBuilder() + .setName(UserName.of("[USER]").toString()) + .setDisplayName("displayName1714148973") + .setEmail("email96619420") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setAge(96511) + .setHeightFeet(-1032737338) + .setNickname("nickname70690926") + .setEnableNotifications(true) + .build(); + mockService.addResponse(expectedResponse); + + String displayName = "displayName1714148973"; + String email = "email96619420"; + int age = 96511; + String nickname = "nickname70690926"; + boolean enableNotifications = true; + double heightFeet = -1032737338; + + User actualResponse = + client.createUser(displayName, email, age, nickname, enableNotifications, heightFeet); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void createUserExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String displayName = "displayName1714148973"; + String email = "email96619420"; + int age = 96511; + String nickname = "nickname70690926"; + boolean enableNotifications = true; + double heightFeet = -1032737338; + client.createUser(displayName, email, age, nickname, enableNotifications, heightFeet); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getUserTest() throws Exception { + User expectedResponse = + User.newBuilder() + .setName(UserName.of("[USER]").toString()) + .setDisplayName("displayName1714148973") + .setEmail("email96619420") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setAge(96511) + .setHeightFeet(-1032737338) + .setNickname("nickname70690926") + .setEnableNotifications(true) + .build(); + mockService.addResponse(expectedResponse); + + UserName name = UserName.of("[USER]"); + + User actualResponse = client.getUser(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void getUserExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + UserName name = UserName.of("[USER]"); + client.getUser(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getUserTest2() throws Exception { + User expectedResponse = + User.newBuilder() + .setName(UserName.of("[USER]").toString()) + .setDisplayName("displayName1714148973") + .setEmail("email96619420") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setAge(96511) + .setHeightFeet(-1032737338) + .setNickname("nickname70690926") + .setEnableNotifications(true) + .build(); + mockService.addResponse(expectedResponse); + + String name = "users/user-6376"; + + User actualResponse = client.getUser(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void getUserExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String name = "users/user-6376"; + client.getUser(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void updateUserTest() throws Exception { + User expectedResponse = + User.newBuilder() + .setName(UserName.of("[USER]").toString()) + .setDisplayName("displayName1714148973") + .setEmail("email96619420") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setAge(96511) + .setHeightFeet(-1032737338) + .setNickname("nickname70690926") + .setEnableNotifications(true) + .build(); + mockService.addResponse(expectedResponse); + + UpdateUserRequest request = + UpdateUserRequest.newBuilder() + .setUser( + User.newBuilder() + .setName(UserName.of("[USER]").toString()) + .setDisplayName("displayName1714148973") + .setEmail("email96619420") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setAge(96511) + .setHeightFeet(-1032737338) + .setNickname("nickname70690926") + .setEnableNotifications(true) + .build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .build(); + + User actualResponse = client.updateUser(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void updateUserExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + UpdateUserRequest request = + UpdateUserRequest.newBuilder() + .setUser( + User.newBuilder() + .setName(UserName.of("[USER]").toString()) + .setDisplayName("displayName1714148973") + .setEmail("email96619420") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setAge(96511) + .setHeightFeet(-1032737338) + .setNickname("nickname70690926") + .setEnableNotifications(true) + .build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .build(); + client.updateUser(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void deleteUserTest() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockService.addResponse(expectedResponse); + + UserName name = UserName.of("[USER]"); + + client.deleteUser(name); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void deleteUserExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + UserName name = UserName.of("[USER]"); + client.deleteUser(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void deleteUserTest2() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockService.addResponse(expectedResponse); + + String name = "users/user-6376"; + + client.deleteUser(name); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void deleteUserExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String name = "users/user-6376"; + client.deleteUser(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listUsersTest() throws Exception { + User responsesElement = User.newBuilder().build(); + ListUsersResponse expectedResponse = + ListUsersResponse.newBuilder() + .setNextPageToken("") + .addAllUsers(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + ListUsersRequest request = + ListUsersRequest.newBuilder() + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + + ListUsersPagedResponse pagedListResponse = client.listUsers(request); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getUsersList().get(0), resources.get(0)); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void listUsersExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ListUsersRequest request = + ListUsersRequest.newBuilder() + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + client.listUsers(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listLocationsTest() throws Exception { + Location responsesElement = Location.newBuilder().build(); + ListLocationsResponse expectedResponse = + ListLocationsResponse.newBuilder() + .setNextPageToken("") + .addAllLocations(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + ListLocationsRequest request = + ListLocationsRequest.newBuilder() + .setName("projects/project-3664") + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + + ListLocationsPagedResponse pagedListResponse = client.listLocations(request); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getLocationsList().get(0), resources.get(0)); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void listLocationsExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ListLocationsRequest request = + ListLocationsRequest.newBuilder() + .setName("projects/project-3664") + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + client.listLocations(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getLocationTest() throws Exception { + Location expectedResponse = + Location.newBuilder() + .setName("name3373707") + .setLocationId("locationId1541836720") + .setDisplayName("displayName1714148973") + .putAllLabels(new HashMap()) + .setMetadata(Any.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + GetLocationRequest request = + GetLocationRequest.newBuilder() + .setName("projects/project-9062/locations/location-9062") + .build(); + + Location actualResponse = client.getLocation(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void getLocationExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + GetLocationRequest request = + GetLocationRequest.newBuilder() + .setName("projects/project-9062/locations/location-9062") + .build(); + client.getLocation(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void setIamPolicyTest() throws Exception { + Policy expectedResponse = + Policy.newBuilder() + .setVersion(351608024) + .addAllBindings(new ArrayList()) + .addAllAuditConfigs(new ArrayList()) + .setEtag(ByteString.EMPTY) + .build(); + mockService.addResponse(expectedResponse); + + SetIamPolicyRequest request = + SetIamPolicyRequest.newBuilder() + .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString()) + .setPolicy(Policy.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .build(); + + Policy actualResponse = client.setIamPolicy(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void setIamPolicyExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + SetIamPolicyRequest request = + SetIamPolicyRequest.newBuilder() + .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString()) + .setPolicy(Policy.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .build(); + client.setIamPolicy(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getIamPolicyTest() throws Exception { + Policy expectedResponse = + Policy.newBuilder() + .setVersion(351608024) + .addAllBindings(new ArrayList()) + .addAllAuditConfigs(new ArrayList()) + .setEtag(ByteString.EMPTY) + .build(); + mockService.addResponse(expectedResponse); + + GetIamPolicyRequest request = + GetIamPolicyRequest.newBuilder() + .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString()) + .setOptions(GetPolicyOptions.newBuilder().build()) + .build(); + + Policy actualResponse = client.getIamPolicy(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void getIamPolicyExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + GetIamPolicyRequest request = + GetIamPolicyRequest.newBuilder() + .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString()) + .setOptions(GetPolicyOptions.newBuilder().build()) + .build(); + client.getIamPolicy(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void testIamPermissionsTest() throws Exception { + TestIamPermissionsResponse expectedResponse = + TestIamPermissionsResponse.newBuilder().addAllPermissions(new ArrayList()).build(); + mockService.addResponse(expectedResponse); + + TestIamPermissionsRequest request = + TestIamPermissionsRequest.newBuilder() + .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString()) + .addAllPermissions(new ArrayList()) + .build(); + + TestIamPermissionsResponse actualResponse = client.testIamPermissions(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void testIamPermissionsExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + TestIamPermissionsRequest request = + TestIamPermissionsRequest.newBuilder() + .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString()) + .addAllPermissions(new ArrayList()) + .build(); + client.testIamPermissions(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } +} diff --git a/java-showcase-3.25.8/gapic-showcase/src/test/java/com/google/showcase/v1beta1/IdentityClientTest.java b/java-showcase-3.25.8/gapic-showcase/src/test/java/com/google/showcase/v1beta1/IdentityClientTest.java new file mode 100644 index 0000000000..a799116534 --- /dev/null +++ b/java-showcase-3.25.8/gapic-showcase/src/test/java/com/google/showcase/v1beta1/IdentityClientTest.java @@ -0,0 +1,733 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1; + +import static com.google.showcase.v1beta1.IdentityClient.ListLocationsPagedResponse; +import static com.google.showcase.v1beta1.IdentityClient.ListUsersPagedResponse; + +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.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.common.collect.Lists; +import com.google.iam.v1.AuditConfig; +import com.google.iam.v1.Binding; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.GetPolicyOptions; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.protobuf.AbstractMessage; +import com.google.protobuf.Any; +import com.google.protobuf.ByteString; +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.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 IdentityClientTest { + private static MockIAMPolicy mockIAMPolicy; + private static MockIdentity mockIdentity; + private static MockLocations mockLocations; + private static MockServiceHelper mockServiceHelper; + private LocalChannelProvider channelProvider; + private IdentityClient client; + + @BeforeClass + public static void startStaticServer() { + mockIdentity = new MockIdentity(); + mockLocations = new MockLocations(); + mockIAMPolicy = new MockIAMPolicy(); + mockServiceHelper = + new MockServiceHelper( + UUID.randomUUID().toString(), + Arrays.asList(mockIdentity, mockLocations, mockIAMPolicy)); + mockServiceHelper.start(); + } + + @AfterClass + public static void stopServer() { + mockServiceHelper.stop(); + } + + @Before + public void setUp() throws IOException { + mockServiceHelper.reset(); + channelProvider = mockServiceHelper.createChannelProvider(); + IdentitySettings settings = + IdentitySettings.newBuilder() + .setTransportChannelProvider(channelProvider) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = IdentityClient.create(settings); + } + + @After + public void tearDown() throws Exception { + client.close(); + } + + @Test + public void createUserTest() throws Exception { + User expectedResponse = + User.newBuilder() + .setName(UserName.of("[USER]").toString()) + .setDisplayName("displayName1714148973") + .setEmail("email96619420") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setAge(96511) + .setHeightFeet(-1032737338) + .setNickname("nickname70690926") + .setEnableNotifications(true) + .build(); + mockIdentity.addResponse(expectedResponse); + + String displayName = "displayName1714148973"; + String email = "email96619420"; + + User actualResponse = client.createUser(displayName, email); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockIdentity.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateUserRequest actualRequest = ((CreateUserRequest) actualRequests.get(0)); + + Assert.assertEquals(displayName, actualRequest.getUser().getDisplayName()); + Assert.assertEquals(email, actualRequest.getUser().getEmail()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void createUserExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockIdentity.addException(exception); + + try { + String displayName = "displayName1714148973"; + String email = "email96619420"; + client.createUser(displayName, email); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createUserTest2() throws Exception { + User expectedResponse = + User.newBuilder() + .setName(UserName.of("[USER]").toString()) + .setDisplayName("displayName1714148973") + .setEmail("email96619420") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setAge(96511) + .setHeightFeet(-1032737338) + .setNickname("nickname70690926") + .setEnableNotifications(true) + .build(); + mockIdentity.addResponse(expectedResponse); + + String displayName = "displayName1714148973"; + String email = "email96619420"; + int age = 96511; + String nickname = "nickname70690926"; + boolean enableNotifications = true; + double heightFeet = -1032737338; + + User actualResponse = + client.createUser(displayName, email, age, nickname, enableNotifications, heightFeet); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockIdentity.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateUserRequest actualRequest = ((CreateUserRequest) actualRequests.get(0)); + + Assert.assertEquals(displayName, actualRequest.getUser().getDisplayName()); + Assert.assertEquals(email, actualRequest.getUser().getEmail()); + Assert.assertEquals(age, actualRequest.getUser().getAge()); + Assert.assertEquals(nickname, actualRequest.getUser().getNickname()); + Assert.assertEquals(enableNotifications, actualRequest.getUser().getEnableNotifications()); + Assert.assertEquals(heightFeet, actualRequest.getUser().getHeightFeet(), 0.0001); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void createUserExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockIdentity.addException(exception); + + try { + String displayName = "displayName1714148973"; + String email = "email96619420"; + int age = 96511; + String nickname = "nickname70690926"; + boolean enableNotifications = true; + double heightFeet = -1032737338; + client.createUser(displayName, email, age, nickname, enableNotifications, heightFeet); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getUserTest() throws Exception { + User expectedResponse = + User.newBuilder() + .setName(UserName.of("[USER]").toString()) + .setDisplayName("displayName1714148973") + .setEmail("email96619420") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setAge(96511) + .setHeightFeet(-1032737338) + .setNickname("nickname70690926") + .setEnableNotifications(true) + .build(); + mockIdentity.addResponse(expectedResponse); + + UserName name = UserName.of("[USER]"); + + User actualResponse = client.getUser(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockIdentity.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetUserRequest actualRequest = ((GetUserRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getUserExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockIdentity.addException(exception); + + try { + UserName name = UserName.of("[USER]"); + client.getUser(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getUserTest2() throws Exception { + User expectedResponse = + User.newBuilder() + .setName(UserName.of("[USER]").toString()) + .setDisplayName("displayName1714148973") + .setEmail("email96619420") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setAge(96511) + .setHeightFeet(-1032737338) + .setNickname("nickname70690926") + .setEnableNotifications(true) + .build(); + mockIdentity.addResponse(expectedResponse); + + String name = "name3373707"; + + User actualResponse = client.getUser(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockIdentity.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetUserRequest actualRequest = ((GetUserRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getUserExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockIdentity.addException(exception); + + try { + String name = "name3373707"; + client.getUser(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void updateUserTest() throws Exception { + User expectedResponse = + User.newBuilder() + .setName(UserName.of("[USER]").toString()) + .setDisplayName("displayName1714148973") + .setEmail("email96619420") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setAge(96511) + .setHeightFeet(-1032737338) + .setNickname("nickname70690926") + .setEnableNotifications(true) + .build(); + mockIdentity.addResponse(expectedResponse); + + UpdateUserRequest request = + UpdateUserRequest.newBuilder() + .setUser(User.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .build(); + + User actualResponse = client.updateUser(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockIdentity.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + UpdateUserRequest actualRequest = ((UpdateUserRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getUser(), actualRequest.getUser()); + Assert.assertEquals(request.getUpdateMask(), actualRequest.getUpdateMask()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void updateUserExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockIdentity.addException(exception); + + try { + UpdateUserRequest request = + UpdateUserRequest.newBuilder() + .setUser(User.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .build(); + client.updateUser(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void deleteUserTest() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockIdentity.addResponse(expectedResponse); + + UserName name = UserName.of("[USER]"); + + client.deleteUser(name); + + List actualRequests = mockIdentity.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeleteUserRequest actualRequest = ((DeleteUserRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void deleteUserExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockIdentity.addException(exception); + + try { + UserName name = UserName.of("[USER]"); + client.deleteUser(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void deleteUserTest2() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockIdentity.addResponse(expectedResponse); + + String name = "name3373707"; + + client.deleteUser(name); + + List actualRequests = mockIdentity.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeleteUserRequest actualRequest = ((DeleteUserRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void deleteUserExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockIdentity.addException(exception); + + try { + String name = "name3373707"; + client.deleteUser(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listUsersTest() throws Exception { + User responsesElement = User.newBuilder().build(); + ListUsersResponse expectedResponse = + ListUsersResponse.newBuilder() + .setNextPageToken("") + .addAllUsers(Arrays.asList(responsesElement)) + .build(); + mockIdentity.addResponse(expectedResponse); + + ListUsersRequest request = + ListUsersRequest.newBuilder() + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + + ListUsersPagedResponse pagedListResponse = client.listUsers(request); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getUsersList().get(0), resources.get(0)); + + List actualRequests = mockIdentity.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListUsersRequest actualRequest = ((ListUsersRequest) 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 listUsersExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockIdentity.addException(exception); + + try { + ListUsersRequest request = + ListUsersRequest.newBuilder() + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + client.listUsers(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listLocationsTest() throws Exception { + Location responsesElement = Location.newBuilder().build(); + ListLocationsResponse expectedResponse = + ListLocationsResponse.newBuilder() + .setNextPageToken("") + .addAllLocations(Arrays.asList(responsesElement)) + .build(); + mockLocations.addResponse(expectedResponse); + + ListLocationsRequest request = + ListLocationsRequest.newBuilder() + .setName("name3373707") + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + + ListLocationsPagedResponse pagedListResponse = client.listLocations(request); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getLocationsList().get(0), resources.get(0)); + + List actualRequests = mockLocations.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListLocationsRequest actualRequest = ((ListLocationsRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getName(), actualRequest.getName()); + Assert.assertEquals(request.getFilter(), actualRequest.getFilter()); + Assert.assertEquals(request.getPageSize(), actualRequest.getPageSize()); + Assert.assertEquals(request.getPageToken(), actualRequest.getPageToken()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listLocationsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockLocations.addException(exception); + + try { + ListLocationsRequest request = + ListLocationsRequest.newBuilder() + .setName("name3373707") + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + client.listLocations(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getLocationTest() throws Exception { + Location expectedResponse = + Location.newBuilder() + .setName("name3373707") + .setLocationId("locationId1541836720") + .setDisplayName("displayName1714148973") + .putAllLabels(new HashMap()) + .setMetadata(Any.newBuilder().build()) + .build(); + mockLocations.addResponse(expectedResponse); + + GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build(); + + Location actualResponse = client.getLocation(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockLocations.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetLocationRequest actualRequest = ((GetLocationRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getName(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getLocationExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockLocations.addException(exception); + + try { + GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build(); + client.getLocation(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void setIamPolicyTest() throws Exception { + Policy expectedResponse = + Policy.newBuilder() + .setVersion(351608024) + .addAllBindings(new ArrayList()) + .addAllAuditConfigs(new ArrayList()) + .setEtag(ByteString.EMPTY) + .build(); + mockIAMPolicy.addResponse(expectedResponse); + + SetIamPolicyRequest request = + SetIamPolicyRequest.newBuilder() + .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString()) + .setPolicy(Policy.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .build(); + + Policy actualResponse = client.setIamPolicy(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockIAMPolicy.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + SetIamPolicyRequest actualRequest = ((SetIamPolicyRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getResource(), actualRequest.getResource()); + Assert.assertEquals(request.getPolicy(), actualRequest.getPolicy()); + Assert.assertEquals(request.getUpdateMask(), actualRequest.getUpdateMask()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void setIamPolicyExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockIAMPolicy.addException(exception); + + try { + SetIamPolicyRequest request = + SetIamPolicyRequest.newBuilder() + .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString()) + .setPolicy(Policy.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .build(); + client.setIamPolicy(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getIamPolicyTest() throws Exception { + Policy expectedResponse = + Policy.newBuilder() + .setVersion(351608024) + .addAllBindings(new ArrayList()) + .addAllAuditConfigs(new ArrayList()) + .setEtag(ByteString.EMPTY) + .build(); + mockIAMPolicy.addResponse(expectedResponse); + + GetIamPolicyRequest request = + GetIamPolicyRequest.newBuilder() + .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString()) + .setOptions(GetPolicyOptions.newBuilder().build()) + .build(); + + Policy actualResponse = client.getIamPolicy(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockIAMPolicy.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetIamPolicyRequest actualRequest = ((GetIamPolicyRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getResource(), actualRequest.getResource()); + Assert.assertEquals(request.getOptions(), actualRequest.getOptions()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getIamPolicyExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockIAMPolicy.addException(exception); + + try { + GetIamPolicyRequest request = + GetIamPolicyRequest.newBuilder() + .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString()) + .setOptions(GetPolicyOptions.newBuilder().build()) + .build(); + client.getIamPolicy(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void testIamPermissionsTest() throws Exception { + TestIamPermissionsResponse expectedResponse = + TestIamPermissionsResponse.newBuilder().addAllPermissions(new ArrayList()).build(); + mockIAMPolicy.addResponse(expectedResponse); + + TestIamPermissionsRequest request = + TestIamPermissionsRequest.newBuilder() + .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString()) + .addAllPermissions(new ArrayList()) + .build(); + + TestIamPermissionsResponse actualResponse = client.testIamPermissions(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockIAMPolicy.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + TestIamPermissionsRequest actualRequest = ((TestIamPermissionsRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getResource(), actualRequest.getResource()); + Assert.assertEquals(request.getPermissionsList(), actualRequest.getPermissionsList()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void testIamPermissionsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockIAMPolicy.addException(exception); + + try { + TestIamPermissionsRequest request = + TestIamPermissionsRequest.newBuilder() + .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString()) + .addAllPermissions(new ArrayList()) + .build(); + client.testIamPermissions(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } +} diff --git a/java-showcase-3.25.8/gapic-showcase/src/test/java/com/google/showcase/v1beta1/MessagingClientHttpJsonTest.java b/java-showcase-3.25.8/gapic-showcase/src/test/java/com/google/showcase/v1beta1/MessagingClientHttpJsonTest.java new file mode 100644 index 0000000000..bdeb1df2f5 --- /dev/null +++ b/java-showcase-3.25.8/gapic-showcase/src/test/java/com/google/showcase/v1beta1/MessagingClientHttpJsonTest.java @@ -0,0 +1,1937 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1; + +import static com.google.showcase.v1beta1.MessagingClient.ListBlurbsPagedResponse; +import static com.google.showcase.v1beta1.MessagingClient.ListLocationsPagedResponse; +import static com.google.showcase.v1beta1.MessagingClient.ListRoomsPagedResponse; + +import com.google.api.gax.core.NoCredentialsProvider; +import com.google.api.gax.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.testing.MockHttpService; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ApiException; +import com.google.api.gax.rpc.ApiExceptionFactory; +import com.google.api.gax.rpc.InvalidArgumentException; +import com.google.api.gax.rpc.StatusCode; +import com.google.api.gax.rpc.testing.FakeStatusCode; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.common.collect.Lists; +import com.google.iam.v1.AuditConfig; +import com.google.iam.v1.Binding; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.GetPolicyOptions; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.longrunning.Operation; +import com.google.protobuf.Any; +import com.google.protobuf.ByteString; +import com.google.protobuf.Empty; +import com.google.protobuf.FieldMask; +import com.google.protobuf.Timestamp; +import com.google.showcase.v1beta1.stub.HttpJsonMessagingStub; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +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 MessagingClientHttpJsonTest { + private static MockHttpService mockService; + private static MessagingClient client; + + @BeforeClass + public static void startStaticServer() throws IOException { + mockService = + new MockHttpService( + HttpJsonMessagingStub.getMethodDescriptors(), MessagingSettings.getDefaultEndpoint()); + MessagingSettings settings = + MessagingSettings.newHttpJsonBuilder() + .setTransportChannelProvider( + MessagingSettings.defaultHttpJsonTransportProviderBuilder() + .setHttpTransport(mockService) + .build()) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = MessagingClient.create(settings); + } + + @AfterClass + public static void stopServer() { + client.close(); + } + + @Before + public void setUp() {} + + @After + public void tearDown() throws Exception { + mockService.reset(); + } + + @Test + public void createRoomTest() throws Exception { + Room expectedResponse = + Room.newBuilder() + .setName(RoomName.of("[ROOM]").toString()) + .setDisplayName("displayName1714148973") + .setDescription("description-1724546052") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + String displayName = "displayName1714148973"; + String description = "description-1724546052"; + + Room actualResponse = client.createRoom(displayName, description); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void createRoomExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String displayName = "displayName1714148973"; + String description = "description-1724546052"; + client.createRoom(displayName, description); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getRoomTest() throws Exception { + Room expectedResponse = + Room.newBuilder() + .setName(RoomName.of("[ROOM]").toString()) + .setDisplayName("displayName1714148973") + .setDescription("description-1724546052") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + RoomName name = RoomName.of("[ROOM]"); + + Room actualResponse = client.getRoom(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void getRoomExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + RoomName name = RoomName.of("[ROOM]"); + client.getRoom(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getRoomTest2() throws Exception { + Room expectedResponse = + Room.newBuilder() + .setName(RoomName.of("[ROOM]").toString()) + .setDisplayName("displayName1714148973") + .setDescription("description-1724546052") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + String name = "rooms/room-472"; + + Room actualResponse = client.getRoom(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void getRoomExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String name = "rooms/room-472"; + client.getRoom(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void updateRoomTest() throws Exception { + Room expectedResponse = + Room.newBuilder() + .setName(RoomName.of("[ROOM]").toString()) + .setDisplayName("displayName1714148973") + .setDescription("description-1724546052") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + UpdateRoomRequest request = + UpdateRoomRequest.newBuilder() + .setRoom( + Room.newBuilder() + .setName(RoomName.of("[ROOM]").toString()) + .setDisplayName("displayName1714148973") + .setDescription("description-1724546052") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .build(); + + Room actualResponse = client.updateRoom(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void updateRoomExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + UpdateRoomRequest request = + UpdateRoomRequest.newBuilder() + .setRoom( + Room.newBuilder() + .setName(RoomName.of("[ROOM]").toString()) + .setDisplayName("displayName1714148973") + .setDescription("description-1724546052") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .build(); + client.updateRoom(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void deleteRoomTest() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockService.addResponse(expectedResponse); + + RoomName name = RoomName.of("[ROOM]"); + + client.deleteRoom(name); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void deleteRoomExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + RoomName name = RoomName.of("[ROOM]"); + client.deleteRoom(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void deleteRoomTest2() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockService.addResponse(expectedResponse); + + String name = "rooms/room-472"; + + client.deleteRoom(name); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void deleteRoomExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String name = "rooms/room-472"; + client.deleteRoom(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listRoomsTest() throws Exception { + Room responsesElement = Room.newBuilder().build(); + ListRoomsResponse expectedResponse = + ListRoomsResponse.newBuilder() + .setNextPageToken("") + .addAllRooms(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + ListRoomsRequest request = + ListRoomsRequest.newBuilder() + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + + ListRoomsPagedResponse pagedListResponse = client.listRooms(request); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getRoomsList().get(0), resources.get(0)); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void listRoomsExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ListRoomsRequest request = + ListRoomsRequest.newBuilder() + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + client.listRooms(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createBlurbTest() throws Exception { + Blurb expectedResponse = + Blurb.newBuilder() + .setName( + BlurbName.ofUserLegacyUserBlurbName("[USER]", "[LEGACY_USER]", "[BLURB]") + .toString()) + .setUser(UserName.of("[USER]").toString()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + ProfileName parent = ProfileName.of("[USER]"); + UserName user = UserName.of("[USER]"); + ByteString image = ByteString.EMPTY; + + Blurb actualResponse = client.createBlurb(parent, user, image); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void createBlurbExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ProfileName parent = ProfileName.of("[USER]"); + UserName user = UserName.of("[USER]"); + ByteString image = ByteString.EMPTY; + client.createBlurb(parent, user, image); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createBlurbTest2() throws Exception { + Blurb expectedResponse = + Blurb.newBuilder() + .setName( + BlurbName.ofUserLegacyUserBlurbName("[USER]", "[LEGACY_USER]", "[BLURB]") + .toString()) + .setUser(UserName.of("[USER]").toString()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + ProfileName parent = ProfileName.of("[USER]"); + UserName user = UserName.of("[USER]"); + String text = "text3556653"; + + Blurb actualResponse = client.createBlurb(parent, user, text); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void createBlurbExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ProfileName parent = ProfileName.of("[USER]"); + UserName user = UserName.of("[USER]"); + String text = "text3556653"; + client.createBlurb(parent, user, text); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createBlurbTest3() throws Exception { + Blurb expectedResponse = + Blurb.newBuilder() + .setName( + BlurbName.ofUserLegacyUserBlurbName("[USER]", "[LEGACY_USER]", "[BLURB]") + .toString()) + .setUser(UserName.of("[USER]").toString()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + ProfileName parent = ProfileName.of("[USER]"); + String user = "user3599307"; + ByteString image = ByteString.EMPTY; + + Blurb actualResponse = client.createBlurb(parent, user, image); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void createBlurbExceptionTest3() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ProfileName parent = ProfileName.of("[USER]"); + String user = "user3599307"; + ByteString image = ByteString.EMPTY; + client.createBlurb(parent, user, image); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createBlurbTest4() throws Exception { + Blurb expectedResponse = + Blurb.newBuilder() + .setName( + BlurbName.ofUserLegacyUserBlurbName("[USER]", "[LEGACY_USER]", "[BLURB]") + .toString()) + .setUser(UserName.of("[USER]").toString()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + ProfileName parent = ProfileName.of("[USER]"); + String user = "user3599307"; + String text = "text3556653"; + + Blurb actualResponse = client.createBlurb(parent, user, text); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void createBlurbExceptionTest4() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ProfileName parent = ProfileName.of("[USER]"); + String user = "user3599307"; + String text = "text3556653"; + client.createBlurb(parent, user, text); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createBlurbTest5() throws Exception { + Blurb expectedResponse = + Blurb.newBuilder() + .setName( + BlurbName.ofUserLegacyUserBlurbName("[USER]", "[LEGACY_USER]", "[BLURB]") + .toString()) + .setUser(UserName.of("[USER]").toString()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + RoomName parent = RoomName.of("[ROOM]"); + UserName user = UserName.of("[USER]"); + ByteString image = ByteString.EMPTY; + + Blurb actualResponse = client.createBlurb(parent, user, image); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void createBlurbExceptionTest5() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + RoomName parent = RoomName.of("[ROOM]"); + UserName user = UserName.of("[USER]"); + ByteString image = ByteString.EMPTY; + client.createBlurb(parent, user, image); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createBlurbTest6() throws Exception { + Blurb expectedResponse = + Blurb.newBuilder() + .setName( + BlurbName.ofUserLegacyUserBlurbName("[USER]", "[LEGACY_USER]", "[BLURB]") + .toString()) + .setUser(UserName.of("[USER]").toString()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + RoomName parent = RoomName.of("[ROOM]"); + UserName user = UserName.of("[USER]"); + String text = "text3556653"; + + Blurb actualResponse = client.createBlurb(parent, user, text); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void createBlurbExceptionTest6() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + RoomName parent = RoomName.of("[ROOM]"); + UserName user = UserName.of("[USER]"); + String text = "text3556653"; + client.createBlurb(parent, user, text); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createBlurbTest7() throws Exception { + Blurb expectedResponse = + Blurb.newBuilder() + .setName( + BlurbName.ofUserLegacyUserBlurbName("[USER]", "[LEGACY_USER]", "[BLURB]") + .toString()) + .setUser(UserName.of("[USER]").toString()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + RoomName parent = RoomName.of("[ROOM]"); + String user = "user3599307"; + ByteString image = ByteString.EMPTY; + + Blurb actualResponse = client.createBlurb(parent, user, image); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void createBlurbExceptionTest7() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + RoomName parent = RoomName.of("[ROOM]"); + String user = "user3599307"; + ByteString image = ByteString.EMPTY; + client.createBlurb(parent, user, image); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createBlurbTest8() throws Exception { + Blurb expectedResponse = + Blurb.newBuilder() + .setName( + BlurbName.ofUserLegacyUserBlurbName("[USER]", "[LEGACY_USER]", "[BLURB]") + .toString()) + .setUser(UserName.of("[USER]").toString()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + RoomName parent = RoomName.of("[ROOM]"); + String user = "user3599307"; + String text = "text3556653"; + + Blurb actualResponse = client.createBlurb(parent, user, text); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void createBlurbExceptionTest8() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + RoomName parent = RoomName.of("[ROOM]"); + String user = "user3599307"; + String text = "text3556653"; + client.createBlurb(parent, user, text); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createBlurbTest9() throws Exception { + Blurb expectedResponse = + Blurb.newBuilder() + .setName( + BlurbName.ofUserLegacyUserBlurbName("[USER]", "[LEGACY_USER]", "[BLURB]") + .toString()) + .setUser(UserName.of("[USER]").toString()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + String parent = "rooms/room-4889"; + UserName user = UserName.of("[USER]"); + ByteString image = ByteString.EMPTY; + + Blurb actualResponse = client.createBlurb(parent, user, image); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void createBlurbExceptionTest9() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String parent = "rooms/room-4889"; + UserName user = UserName.of("[USER]"); + ByteString image = ByteString.EMPTY; + client.createBlurb(parent, user, image); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createBlurbTest10() throws Exception { + Blurb expectedResponse = + Blurb.newBuilder() + .setName( + BlurbName.ofUserLegacyUserBlurbName("[USER]", "[LEGACY_USER]", "[BLURB]") + .toString()) + .setUser(UserName.of("[USER]").toString()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + String parent = "rooms/room-4889"; + UserName user = UserName.of("[USER]"); + String text = "text3556653"; + + Blurb actualResponse = client.createBlurb(parent, user, text); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void createBlurbExceptionTest10() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String parent = "rooms/room-4889"; + UserName user = UserName.of("[USER]"); + String text = "text3556653"; + client.createBlurb(parent, user, text); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createBlurbTest11() throws Exception { + Blurb expectedResponse = + Blurb.newBuilder() + .setName( + BlurbName.ofUserLegacyUserBlurbName("[USER]", "[LEGACY_USER]", "[BLURB]") + .toString()) + .setUser(UserName.of("[USER]").toString()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + String parent = "rooms/room-4889"; + String user = "user3599307"; + ByteString image = ByteString.EMPTY; + + Blurb actualResponse = client.createBlurb(parent, user, image); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void createBlurbExceptionTest11() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String parent = "rooms/room-4889"; + String user = "user3599307"; + ByteString image = ByteString.EMPTY; + client.createBlurb(parent, user, image); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createBlurbTest12() throws Exception { + Blurb expectedResponse = + Blurb.newBuilder() + .setName( + BlurbName.ofUserLegacyUserBlurbName("[USER]", "[LEGACY_USER]", "[BLURB]") + .toString()) + .setUser(UserName.of("[USER]").toString()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + String parent = "rooms/room-4889"; + String user = "user3599307"; + String text = "text3556653"; + + Blurb actualResponse = client.createBlurb(parent, user, text); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void createBlurbExceptionTest12() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String parent = "rooms/room-4889"; + String user = "user3599307"; + String text = "text3556653"; + client.createBlurb(parent, user, text); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getBlurbTest() throws Exception { + Blurb expectedResponse = + Blurb.newBuilder() + .setName(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString()) + .setUser(UserName.of("[USER]").toString()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + BlurbName name = BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]"); + + Blurb actualResponse = client.getBlurb(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void getBlurbExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + BlurbName name = BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]"); + client.getBlurb(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getBlurbTest2() throws Exception { + Blurb expectedResponse = + Blurb.newBuilder() + .setName(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString()) + .setUser(UserName.of("[USER]").toString()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + String name = "rooms/room-9094/blurbs/blurb-9094"; + + Blurb actualResponse = client.getBlurb(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void getBlurbExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String name = "rooms/room-9094/blurbs/blurb-9094"; + client.getBlurb(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void updateBlurbTest() throws Exception { + Blurb expectedResponse = + Blurb.newBuilder() + .setName(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString()) + .setUser(UserName.of("[USER]").toString()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + UpdateBlurbRequest request = + UpdateBlurbRequest.newBuilder() + .setBlurb( + Blurb.newBuilder() + .setName(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString()) + .setUser(UserName.of("[USER]").toString()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .build(); + + Blurb actualResponse = client.updateBlurb(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void updateBlurbExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + UpdateBlurbRequest request = + UpdateBlurbRequest.newBuilder() + .setBlurb( + Blurb.newBuilder() + .setName(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString()) + .setUser(UserName.of("[USER]").toString()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .build(); + client.updateBlurb(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void deleteBlurbTest() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockService.addResponse(expectedResponse); + + BlurbName name = BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]"); + + client.deleteBlurb(name); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void deleteBlurbExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + BlurbName name = BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]"); + client.deleteBlurb(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void deleteBlurbTest2() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockService.addResponse(expectedResponse); + + String name = "rooms/room-9094/blurbs/blurb-9094"; + + client.deleteBlurb(name); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void deleteBlurbExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String name = "rooms/room-9094/blurbs/blurb-9094"; + client.deleteBlurb(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listBlurbsTest() throws Exception { + Blurb responsesElement = Blurb.newBuilder().build(); + ListBlurbsResponse expectedResponse = + ListBlurbsResponse.newBuilder() + .setNextPageToken("") + .addAllBlurbs(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + ProfileName parent = ProfileName.of("[USER]"); + + ListBlurbsPagedResponse pagedListResponse = client.listBlurbs(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getBlurbsList().get(0), resources.get(0)); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void listBlurbsExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ProfileName parent = ProfileName.of("[USER]"); + client.listBlurbs(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listBlurbsTest2() throws Exception { + Blurb responsesElement = Blurb.newBuilder().build(); + ListBlurbsResponse expectedResponse = + ListBlurbsResponse.newBuilder() + .setNextPageToken("") + .addAllBlurbs(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + RoomName parent = RoomName.of("[ROOM]"); + + ListBlurbsPagedResponse pagedListResponse = client.listBlurbs(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getBlurbsList().get(0), resources.get(0)); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void listBlurbsExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + RoomName parent = RoomName.of("[ROOM]"); + client.listBlurbs(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listBlurbsTest3() throws Exception { + Blurb responsesElement = Blurb.newBuilder().build(); + ListBlurbsResponse expectedResponse = + ListBlurbsResponse.newBuilder() + .setNextPageToken("") + .addAllBlurbs(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + String parent = "rooms/room-4889"; + + ListBlurbsPagedResponse pagedListResponse = client.listBlurbs(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getBlurbsList().get(0), resources.get(0)); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void listBlurbsExceptionTest3() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String parent = "rooms/room-4889"; + client.listBlurbs(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void searchBlurbsTest() throws Exception { + SearchBlurbsResponse expectedResponse = + SearchBlurbsResponse.newBuilder() + .addAllBlurbs(new ArrayList()) + .setNextPageToken("nextPageToken-1386094857") + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("searchBlurbsTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockService.addResponse(resultOperation); + + ProfileName parent = ProfileName.of("[USER]"); + String query = "query107944136"; + + SearchBlurbsResponse actualResponse = client.searchBlurbsAsync(parent, query).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void searchBlurbsExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ProfileName parent = ProfileName.of("[USER]"); + String query = "query107944136"; + client.searchBlurbsAsync(parent, query).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + } + } + + @Test + public void searchBlurbsTest2() throws Exception { + SearchBlurbsResponse expectedResponse = + SearchBlurbsResponse.newBuilder() + .addAllBlurbs(new ArrayList()) + .setNextPageToken("nextPageToken-1386094857") + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("searchBlurbsTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockService.addResponse(resultOperation); + + RoomName parent = RoomName.of("[ROOM]"); + String query = "query107944136"; + + SearchBlurbsResponse actualResponse = client.searchBlurbsAsync(parent, query).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void searchBlurbsExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + RoomName parent = RoomName.of("[ROOM]"); + String query = "query107944136"; + client.searchBlurbsAsync(parent, query).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + } + } + + @Test + public void searchBlurbsTest3() throws Exception { + SearchBlurbsResponse expectedResponse = + SearchBlurbsResponse.newBuilder() + .addAllBlurbs(new ArrayList()) + .setNextPageToken("nextPageToken-1386094857") + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("searchBlurbsTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockService.addResponse(resultOperation); + + String parent = "rooms/room-4889"; + String query = "query107944136"; + + SearchBlurbsResponse actualResponse = client.searchBlurbsAsync(parent, query).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void searchBlurbsExceptionTest3() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String parent = "rooms/room-4889"; + String query = "query107944136"; + client.searchBlurbsAsync(parent, query).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + } + } + + @Test + public void streamBlurbsTest() throws Exception {} + + @Test + public void streamBlurbsExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + } + + @Test + public void sendBlurbsUnsupportedMethodTest() throws Exception { + // The sendBlurbs() method is not supported in REST transport. + // This empty test is generated for technical reasons. + } + + @Test + public void connectUnsupportedMethodTest() throws Exception { + // The connect() method is not supported in REST transport. + // This empty test is generated for technical reasons. + } + + @Test + public void listLocationsTest() throws Exception { + Location responsesElement = Location.newBuilder().build(); + ListLocationsResponse expectedResponse = + ListLocationsResponse.newBuilder() + .setNextPageToken("") + .addAllLocations(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + ListLocationsRequest request = + ListLocationsRequest.newBuilder() + .setName("projects/project-3664") + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + + ListLocationsPagedResponse pagedListResponse = client.listLocations(request); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getLocationsList().get(0), resources.get(0)); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void listLocationsExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ListLocationsRequest request = + ListLocationsRequest.newBuilder() + .setName("projects/project-3664") + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + client.listLocations(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getLocationTest() throws Exception { + Location expectedResponse = + Location.newBuilder() + .setName("name3373707") + .setLocationId("locationId1541836720") + .setDisplayName("displayName1714148973") + .putAllLabels(new HashMap()) + .setMetadata(Any.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + GetLocationRequest request = + GetLocationRequest.newBuilder() + .setName("projects/project-9062/locations/location-9062") + .build(); + + Location actualResponse = client.getLocation(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void getLocationExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + GetLocationRequest request = + GetLocationRequest.newBuilder() + .setName("projects/project-9062/locations/location-9062") + .build(); + client.getLocation(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void setIamPolicyTest() throws Exception { + Policy expectedResponse = + Policy.newBuilder() + .setVersion(351608024) + .addAllBindings(new ArrayList()) + .addAllAuditConfigs(new ArrayList()) + .setEtag(ByteString.EMPTY) + .build(); + mockService.addResponse(expectedResponse); + + SetIamPolicyRequest request = + SetIamPolicyRequest.newBuilder() + .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString()) + .setPolicy(Policy.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .build(); + + Policy actualResponse = client.setIamPolicy(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void setIamPolicyExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + SetIamPolicyRequest request = + SetIamPolicyRequest.newBuilder() + .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString()) + .setPolicy(Policy.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .build(); + client.setIamPolicy(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getIamPolicyTest() throws Exception { + Policy expectedResponse = + Policy.newBuilder() + .setVersion(351608024) + .addAllBindings(new ArrayList()) + .addAllAuditConfigs(new ArrayList()) + .setEtag(ByteString.EMPTY) + .build(); + mockService.addResponse(expectedResponse); + + GetIamPolicyRequest request = + GetIamPolicyRequest.newBuilder() + .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString()) + .setOptions(GetPolicyOptions.newBuilder().build()) + .build(); + + Policy actualResponse = client.getIamPolicy(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void getIamPolicyExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + GetIamPolicyRequest request = + GetIamPolicyRequest.newBuilder() + .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString()) + .setOptions(GetPolicyOptions.newBuilder().build()) + .build(); + client.getIamPolicy(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void testIamPermissionsTest() throws Exception { + TestIamPermissionsResponse expectedResponse = + TestIamPermissionsResponse.newBuilder().addAllPermissions(new ArrayList()).build(); + mockService.addResponse(expectedResponse); + + TestIamPermissionsRequest request = + TestIamPermissionsRequest.newBuilder() + .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString()) + .addAllPermissions(new ArrayList()) + .build(); + + TestIamPermissionsResponse actualResponse = client.testIamPermissions(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void testIamPermissionsExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + TestIamPermissionsRequest request = + TestIamPermissionsRequest.newBuilder() + .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString()) + .addAllPermissions(new ArrayList()) + .build(); + client.testIamPermissions(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } +} diff --git a/java-showcase-3.25.8/gapic-showcase/src/test/java/com/google/showcase/v1beta1/MessagingClientTest.java b/java-showcase-3.25.8/gapic-showcase/src/test/java/com/google/showcase/v1beta1/MessagingClientTest.java new file mode 100644 index 0000000000..65b8248d12 --- /dev/null +++ b/java-showcase-3.25.8/gapic-showcase/src/test/java/com/google/showcase/v1beta1/MessagingClientTest.java @@ -0,0 +1,1882 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1; + +import static com.google.showcase.v1beta1.MessagingClient.ListBlurbsPagedResponse; +import static com.google.showcase.v1beta1.MessagingClient.ListLocationsPagedResponse; +import static com.google.showcase.v1beta1.MessagingClient.ListRoomsPagedResponse; + +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.ClientStreamingCallable; +import com.google.api.gax.rpc.InvalidArgumentException; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.api.gax.rpc.StatusCode; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.common.collect.Lists; +import com.google.iam.v1.AuditConfig; +import com.google.iam.v1.Binding; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.GetPolicyOptions; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.longrunning.Operation; +import com.google.protobuf.AbstractMessage; +import com.google.protobuf.Any; +import com.google.protobuf.ByteString; +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.HashMap; +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 MessagingClientTest { + private static MockIAMPolicy mockIAMPolicy; + private static MockLocations mockLocations; + private static MockMessaging mockMessaging; + private static MockServiceHelper mockServiceHelper; + private LocalChannelProvider channelProvider; + private MessagingClient client; + + @BeforeClass + public static void startStaticServer() { + mockMessaging = new MockMessaging(); + mockLocations = new MockLocations(); + mockIAMPolicy = new MockIAMPolicy(); + mockServiceHelper = + new MockServiceHelper( + UUID.randomUUID().toString(), + Arrays.asList(mockMessaging, mockLocations, mockIAMPolicy)); + mockServiceHelper.start(); + } + + @AfterClass + public static void stopServer() { + mockServiceHelper.stop(); + } + + @Before + public void setUp() throws IOException { + mockServiceHelper.reset(); + channelProvider = mockServiceHelper.createChannelProvider(); + MessagingSettings settings = + MessagingSettings.newBuilder() + .setTransportChannelProvider(channelProvider) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = MessagingClient.create(settings); + } + + @After + public void tearDown() throws Exception { + client.close(); + } + + @Test + public void createRoomTest() throws Exception { + Room expectedResponse = + Room.newBuilder() + .setName(RoomName.of("[ROOM]").toString()) + .setDisplayName("displayName1714148973") + .setDescription("description-1724546052") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .build(); + mockMessaging.addResponse(expectedResponse); + + String displayName = "displayName1714148973"; + String description = "description-1724546052"; + + Room actualResponse = client.createRoom(displayName, description); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockMessaging.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateRoomRequest actualRequest = ((CreateRoomRequest) actualRequests.get(0)); + + Assert.assertEquals(displayName, actualRequest.getRoom().getDisplayName()); + Assert.assertEquals(description, actualRequest.getRoom().getDescription()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void createRoomExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockMessaging.addException(exception); + + try { + String displayName = "displayName1714148973"; + String description = "description-1724546052"; + client.createRoom(displayName, description); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getRoomTest() throws Exception { + Room expectedResponse = + Room.newBuilder() + .setName(RoomName.of("[ROOM]").toString()) + .setDisplayName("displayName1714148973") + .setDescription("description-1724546052") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .build(); + mockMessaging.addResponse(expectedResponse); + + RoomName name = RoomName.of("[ROOM]"); + + Room actualResponse = client.getRoom(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockMessaging.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetRoomRequest actualRequest = ((GetRoomRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getRoomExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockMessaging.addException(exception); + + try { + RoomName name = RoomName.of("[ROOM]"); + client.getRoom(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getRoomTest2() throws Exception { + Room expectedResponse = + Room.newBuilder() + .setName(RoomName.of("[ROOM]").toString()) + .setDisplayName("displayName1714148973") + .setDescription("description-1724546052") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .build(); + mockMessaging.addResponse(expectedResponse); + + String name = "name3373707"; + + Room actualResponse = client.getRoom(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockMessaging.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetRoomRequest actualRequest = ((GetRoomRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getRoomExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockMessaging.addException(exception); + + try { + String name = "name3373707"; + client.getRoom(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void updateRoomTest() throws Exception { + Room expectedResponse = + Room.newBuilder() + .setName(RoomName.of("[ROOM]").toString()) + .setDisplayName("displayName1714148973") + .setDescription("description-1724546052") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .build(); + mockMessaging.addResponse(expectedResponse); + + UpdateRoomRequest request = + UpdateRoomRequest.newBuilder() + .setRoom(Room.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .build(); + + Room actualResponse = client.updateRoom(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockMessaging.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + UpdateRoomRequest actualRequest = ((UpdateRoomRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getRoom(), actualRequest.getRoom()); + Assert.assertEquals(request.getUpdateMask(), actualRequest.getUpdateMask()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void updateRoomExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockMessaging.addException(exception); + + try { + UpdateRoomRequest request = + UpdateRoomRequest.newBuilder() + .setRoom(Room.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .build(); + client.updateRoom(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void deleteRoomTest() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockMessaging.addResponse(expectedResponse); + + RoomName name = RoomName.of("[ROOM]"); + + client.deleteRoom(name); + + List actualRequests = mockMessaging.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeleteRoomRequest actualRequest = ((DeleteRoomRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void deleteRoomExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockMessaging.addException(exception); + + try { + RoomName name = RoomName.of("[ROOM]"); + client.deleteRoom(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void deleteRoomTest2() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockMessaging.addResponse(expectedResponse); + + String name = "name3373707"; + + client.deleteRoom(name); + + List actualRequests = mockMessaging.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeleteRoomRequest actualRequest = ((DeleteRoomRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void deleteRoomExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockMessaging.addException(exception); + + try { + String name = "name3373707"; + client.deleteRoom(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listRoomsTest() throws Exception { + Room responsesElement = Room.newBuilder().build(); + ListRoomsResponse expectedResponse = + ListRoomsResponse.newBuilder() + .setNextPageToken("") + .addAllRooms(Arrays.asList(responsesElement)) + .build(); + mockMessaging.addResponse(expectedResponse); + + ListRoomsRequest request = + ListRoomsRequest.newBuilder() + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + + ListRoomsPagedResponse pagedListResponse = client.listRooms(request); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getRoomsList().get(0), resources.get(0)); + + List actualRequests = mockMessaging.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListRoomsRequest actualRequest = ((ListRoomsRequest) 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 listRoomsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockMessaging.addException(exception); + + try { + ListRoomsRequest request = + ListRoomsRequest.newBuilder() + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + client.listRooms(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createBlurbTest() throws Exception { + Blurb expectedResponse = + Blurb.newBuilder() + .setName( + BlurbName.ofUserLegacyUserBlurbName("[USER]", "[LEGACY_USER]", "[BLURB]") + .toString()) + .setUser(UserName.of("[USER]").toString()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .build(); + mockMessaging.addResponse(expectedResponse); + + ProfileName parent = ProfileName.of("[USER]"); + UserName user = UserName.of("[USER]"); + ByteString image = ByteString.EMPTY; + + Blurb actualResponse = client.createBlurb(parent, user, image); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockMessaging.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateBlurbRequest actualRequest = ((CreateBlurbRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertEquals(user.toString(), actualRequest.getBlurb().getUser()); + Assert.assertEquals(image, actualRequest.getBlurb().getImage()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void createBlurbExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockMessaging.addException(exception); + + try { + ProfileName parent = ProfileName.of("[USER]"); + UserName user = UserName.of("[USER]"); + ByteString image = ByteString.EMPTY; + client.createBlurb(parent, user, image); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createBlurbTest2() throws Exception { + Blurb expectedResponse = + Blurb.newBuilder() + .setName( + BlurbName.ofUserLegacyUserBlurbName("[USER]", "[LEGACY_USER]", "[BLURB]") + .toString()) + .setUser(UserName.of("[USER]").toString()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .build(); + mockMessaging.addResponse(expectedResponse); + + ProfileName parent = ProfileName.of("[USER]"); + UserName user = UserName.of("[USER]"); + String text = "text3556653"; + + Blurb actualResponse = client.createBlurb(parent, user, text); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockMessaging.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateBlurbRequest actualRequest = ((CreateBlurbRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertEquals(user.toString(), actualRequest.getBlurb().getUser()); + Assert.assertEquals(text, actualRequest.getBlurb().getText()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void createBlurbExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockMessaging.addException(exception); + + try { + ProfileName parent = ProfileName.of("[USER]"); + UserName user = UserName.of("[USER]"); + String text = "text3556653"; + client.createBlurb(parent, user, text); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createBlurbTest3() throws Exception { + Blurb expectedResponse = + Blurb.newBuilder() + .setName( + BlurbName.ofUserLegacyUserBlurbName("[USER]", "[LEGACY_USER]", "[BLURB]") + .toString()) + .setUser(UserName.of("[USER]").toString()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .build(); + mockMessaging.addResponse(expectedResponse); + + ProfileName parent = ProfileName.of("[USER]"); + String user = "user3599307"; + ByteString image = ByteString.EMPTY; + + Blurb actualResponse = client.createBlurb(parent, user, image); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockMessaging.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateBlurbRequest actualRequest = ((CreateBlurbRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertEquals(user, actualRequest.getBlurb().getUser()); + Assert.assertEquals(image, actualRequest.getBlurb().getImage()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void createBlurbExceptionTest3() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockMessaging.addException(exception); + + try { + ProfileName parent = ProfileName.of("[USER]"); + String user = "user3599307"; + ByteString image = ByteString.EMPTY; + client.createBlurb(parent, user, image); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createBlurbTest4() throws Exception { + Blurb expectedResponse = + Blurb.newBuilder() + .setName( + BlurbName.ofUserLegacyUserBlurbName("[USER]", "[LEGACY_USER]", "[BLURB]") + .toString()) + .setUser(UserName.of("[USER]").toString()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .build(); + mockMessaging.addResponse(expectedResponse); + + ProfileName parent = ProfileName.of("[USER]"); + String user = "user3599307"; + String text = "text3556653"; + + Blurb actualResponse = client.createBlurb(parent, user, text); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockMessaging.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateBlurbRequest actualRequest = ((CreateBlurbRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertEquals(user, actualRequest.getBlurb().getUser()); + Assert.assertEquals(text, actualRequest.getBlurb().getText()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void createBlurbExceptionTest4() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockMessaging.addException(exception); + + try { + ProfileName parent = ProfileName.of("[USER]"); + String user = "user3599307"; + String text = "text3556653"; + client.createBlurb(parent, user, text); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createBlurbTest5() throws Exception { + Blurb expectedResponse = + Blurb.newBuilder() + .setName( + BlurbName.ofUserLegacyUserBlurbName("[USER]", "[LEGACY_USER]", "[BLURB]") + .toString()) + .setUser(UserName.of("[USER]").toString()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .build(); + mockMessaging.addResponse(expectedResponse); + + RoomName parent = RoomName.of("[ROOM]"); + UserName user = UserName.of("[USER]"); + ByteString image = ByteString.EMPTY; + + Blurb actualResponse = client.createBlurb(parent, user, image); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockMessaging.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateBlurbRequest actualRequest = ((CreateBlurbRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertEquals(user.toString(), actualRequest.getBlurb().getUser()); + Assert.assertEquals(image, actualRequest.getBlurb().getImage()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void createBlurbExceptionTest5() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockMessaging.addException(exception); + + try { + RoomName parent = RoomName.of("[ROOM]"); + UserName user = UserName.of("[USER]"); + ByteString image = ByteString.EMPTY; + client.createBlurb(parent, user, image); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createBlurbTest6() throws Exception { + Blurb expectedResponse = + Blurb.newBuilder() + .setName( + BlurbName.ofUserLegacyUserBlurbName("[USER]", "[LEGACY_USER]", "[BLURB]") + .toString()) + .setUser(UserName.of("[USER]").toString()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .build(); + mockMessaging.addResponse(expectedResponse); + + RoomName parent = RoomName.of("[ROOM]"); + UserName user = UserName.of("[USER]"); + String text = "text3556653"; + + Blurb actualResponse = client.createBlurb(parent, user, text); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockMessaging.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateBlurbRequest actualRequest = ((CreateBlurbRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertEquals(user.toString(), actualRequest.getBlurb().getUser()); + Assert.assertEquals(text, actualRequest.getBlurb().getText()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void createBlurbExceptionTest6() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockMessaging.addException(exception); + + try { + RoomName parent = RoomName.of("[ROOM]"); + UserName user = UserName.of("[USER]"); + String text = "text3556653"; + client.createBlurb(parent, user, text); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createBlurbTest7() throws Exception { + Blurb expectedResponse = + Blurb.newBuilder() + .setName( + BlurbName.ofUserLegacyUserBlurbName("[USER]", "[LEGACY_USER]", "[BLURB]") + .toString()) + .setUser(UserName.of("[USER]").toString()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .build(); + mockMessaging.addResponse(expectedResponse); + + RoomName parent = RoomName.of("[ROOM]"); + String user = "user3599307"; + ByteString image = ByteString.EMPTY; + + Blurb actualResponse = client.createBlurb(parent, user, image); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockMessaging.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateBlurbRequest actualRequest = ((CreateBlurbRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertEquals(user, actualRequest.getBlurb().getUser()); + Assert.assertEquals(image, actualRequest.getBlurb().getImage()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void createBlurbExceptionTest7() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockMessaging.addException(exception); + + try { + RoomName parent = RoomName.of("[ROOM]"); + String user = "user3599307"; + ByteString image = ByteString.EMPTY; + client.createBlurb(parent, user, image); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createBlurbTest8() throws Exception { + Blurb expectedResponse = + Blurb.newBuilder() + .setName( + BlurbName.ofUserLegacyUserBlurbName("[USER]", "[LEGACY_USER]", "[BLURB]") + .toString()) + .setUser(UserName.of("[USER]").toString()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .build(); + mockMessaging.addResponse(expectedResponse); + + RoomName parent = RoomName.of("[ROOM]"); + String user = "user3599307"; + String text = "text3556653"; + + Blurb actualResponse = client.createBlurb(parent, user, text); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockMessaging.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateBlurbRequest actualRequest = ((CreateBlurbRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertEquals(user, actualRequest.getBlurb().getUser()); + Assert.assertEquals(text, actualRequest.getBlurb().getText()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void createBlurbExceptionTest8() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockMessaging.addException(exception); + + try { + RoomName parent = RoomName.of("[ROOM]"); + String user = "user3599307"; + String text = "text3556653"; + client.createBlurb(parent, user, text); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createBlurbTest9() throws Exception { + Blurb expectedResponse = + Blurb.newBuilder() + .setName( + BlurbName.ofUserLegacyUserBlurbName("[USER]", "[LEGACY_USER]", "[BLURB]") + .toString()) + .setUser(UserName.of("[USER]").toString()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .build(); + mockMessaging.addResponse(expectedResponse); + + String parent = "parent-995424086"; + UserName user = UserName.of("[USER]"); + ByteString image = ByteString.EMPTY; + + Blurb actualResponse = client.createBlurb(parent, user, image); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockMessaging.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateBlurbRequest actualRequest = ((CreateBlurbRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertEquals(user.toString(), actualRequest.getBlurb().getUser()); + Assert.assertEquals(image, actualRequest.getBlurb().getImage()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void createBlurbExceptionTest9() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockMessaging.addException(exception); + + try { + String parent = "parent-995424086"; + UserName user = UserName.of("[USER]"); + ByteString image = ByteString.EMPTY; + client.createBlurb(parent, user, image); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createBlurbTest10() throws Exception { + Blurb expectedResponse = + Blurb.newBuilder() + .setName( + BlurbName.ofUserLegacyUserBlurbName("[USER]", "[LEGACY_USER]", "[BLURB]") + .toString()) + .setUser(UserName.of("[USER]").toString()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .build(); + mockMessaging.addResponse(expectedResponse); + + String parent = "parent-995424086"; + UserName user = UserName.of("[USER]"); + String text = "text3556653"; + + Blurb actualResponse = client.createBlurb(parent, user, text); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockMessaging.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateBlurbRequest actualRequest = ((CreateBlurbRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertEquals(user.toString(), actualRequest.getBlurb().getUser()); + Assert.assertEquals(text, actualRequest.getBlurb().getText()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void createBlurbExceptionTest10() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockMessaging.addException(exception); + + try { + String parent = "parent-995424086"; + UserName user = UserName.of("[USER]"); + String text = "text3556653"; + client.createBlurb(parent, user, text); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createBlurbTest11() throws Exception { + Blurb expectedResponse = + Blurb.newBuilder() + .setName( + BlurbName.ofUserLegacyUserBlurbName("[USER]", "[LEGACY_USER]", "[BLURB]") + .toString()) + .setUser(UserName.of("[USER]").toString()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .build(); + mockMessaging.addResponse(expectedResponse); + + String parent = "parent-995424086"; + String user = "user3599307"; + ByteString image = ByteString.EMPTY; + + Blurb actualResponse = client.createBlurb(parent, user, image); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockMessaging.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateBlurbRequest actualRequest = ((CreateBlurbRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertEquals(user, actualRequest.getBlurb().getUser()); + Assert.assertEquals(image, actualRequest.getBlurb().getImage()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void createBlurbExceptionTest11() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockMessaging.addException(exception); + + try { + String parent = "parent-995424086"; + String user = "user3599307"; + ByteString image = ByteString.EMPTY; + client.createBlurb(parent, user, image); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createBlurbTest12() throws Exception { + Blurb expectedResponse = + Blurb.newBuilder() + .setName( + BlurbName.ofUserLegacyUserBlurbName("[USER]", "[LEGACY_USER]", "[BLURB]") + .toString()) + .setUser(UserName.of("[USER]").toString()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .build(); + mockMessaging.addResponse(expectedResponse); + + String parent = "parent-995424086"; + String user = "user3599307"; + String text = "text3556653"; + + Blurb actualResponse = client.createBlurb(parent, user, text); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockMessaging.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateBlurbRequest actualRequest = ((CreateBlurbRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertEquals(user, actualRequest.getBlurb().getUser()); + Assert.assertEquals(text, actualRequest.getBlurb().getText()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void createBlurbExceptionTest12() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockMessaging.addException(exception); + + try { + String parent = "parent-995424086"; + String user = "user3599307"; + String text = "text3556653"; + client.createBlurb(parent, user, text); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getBlurbTest() throws Exception { + Blurb expectedResponse = + Blurb.newBuilder() + .setName(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString()) + .setUser(UserName.of("[USER]").toString()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .build(); + mockMessaging.addResponse(expectedResponse); + + BlurbName name = BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]"); + + Blurb actualResponse = client.getBlurb(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockMessaging.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetBlurbRequest actualRequest = ((GetBlurbRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getBlurbExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockMessaging.addException(exception); + + try { + BlurbName name = BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]"); + client.getBlurb(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getBlurbTest2() throws Exception { + Blurb expectedResponse = + Blurb.newBuilder() + .setName(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString()) + .setUser(UserName.of("[USER]").toString()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .build(); + mockMessaging.addResponse(expectedResponse); + + String name = "name3373707"; + + Blurb actualResponse = client.getBlurb(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockMessaging.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetBlurbRequest actualRequest = ((GetBlurbRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getBlurbExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockMessaging.addException(exception); + + try { + String name = "name3373707"; + client.getBlurb(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void updateBlurbTest() throws Exception { + Blurb expectedResponse = + Blurb.newBuilder() + .setName(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString()) + .setUser(UserName.of("[USER]").toString()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .build(); + mockMessaging.addResponse(expectedResponse); + + UpdateBlurbRequest request = + UpdateBlurbRequest.newBuilder() + .setBlurb(Blurb.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .build(); + + Blurb actualResponse = client.updateBlurb(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockMessaging.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + UpdateBlurbRequest actualRequest = ((UpdateBlurbRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getBlurb(), actualRequest.getBlurb()); + Assert.assertEquals(request.getUpdateMask(), actualRequest.getUpdateMask()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void updateBlurbExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockMessaging.addException(exception); + + try { + UpdateBlurbRequest request = + UpdateBlurbRequest.newBuilder() + .setBlurb(Blurb.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .build(); + client.updateBlurb(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void deleteBlurbTest() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockMessaging.addResponse(expectedResponse); + + BlurbName name = BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]"); + + client.deleteBlurb(name); + + List actualRequests = mockMessaging.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeleteBlurbRequest actualRequest = ((DeleteBlurbRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void deleteBlurbExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockMessaging.addException(exception); + + try { + BlurbName name = BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]"); + client.deleteBlurb(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void deleteBlurbTest2() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockMessaging.addResponse(expectedResponse); + + String name = "name3373707"; + + client.deleteBlurb(name); + + List actualRequests = mockMessaging.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeleteBlurbRequest actualRequest = ((DeleteBlurbRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void deleteBlurbExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockMessaging.addException(exception); + + try { + String name = "name3373707"; + client.deleteBlurb(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listBlurbsTest() throws Exception { + Blurb responsesElement = Blurb.newBuilder().build(); + ListBlurbsResponse expectedResponse = + ListBlurbsResponse.newBuilder() + .setNextPageToken("") + .addAllBlurbs(Arrays.asList(responsesElement)) + .build(); + mockMessaging.addResponse(expectedResponse); + + ProfileName parent = ProfileName.of("[USER]"); + + ListBlurbsPagedResponse pagedListResponse = client.listBlurbs(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getBlurbsList().get(0), resources.get(0)); + + List actualRequests = mockMessaging.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListBlurbsRequest actualRequest = ((ListBlurbsRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listBlurbsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockMessaging.addException(exception); + + try { + ProfileName parent = ProfileName.of("[USER]"); + client.listBlurbs(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listBlurbsTest2() throws Exception { + Blurb responsesElement = Blurb.newBuilder().build(); + ListBlurbsResponse expectedResponse = + ListBlurbsResponse.newBuilder() + .setNextPageToken("") + .addAllBlurbs(Arrays.asList(responsesElement)) + .build(); + mockMessaging.addResponse(expectedResponse); + + RoomName parent = RoomName.of("[ROOM]"); + + ListBlurbsPagedResponse pagedListResponse = client.listBlurbs(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getBlurbsList().get(0), resources.get(0)); + + List actualRequests = mockMessaging.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListBlurbsRequest actualRequest = ((ListBlurbsRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listBlurbsExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockMessaging.addException(exception); + + try { + RoomName parent = RoomName.of("[ROOM]"); + client.listBlurbs(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listBlurbsTest3() throws Exception { + Blurb responsesElement = Blurb.newBuilder().build(); + ListBlurbsResponse expectedResponse = + ListBlurbsResponse.newBuilder() + .setNextPageToken("") + .addAllBlurbs(Arrays.asList(responsesElement)) + .build(); + mockMessaging.addResponse(expectedResponse); + + String parent = "parent-995424086"; + + ListBlurbsPagedResponse pagedListResponse = client.listBlurbs(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getBlurbsList().get(0), resources.get(0)); + + List actualRequests = mockMessaging.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListBlurbsRequest actualRequest = ((ListBlurbsRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listBlurbsExceptionTest3() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockMessaging.addException(exception); + + try { + String parent = "parent-995424086"; + client.listBlurbs(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void searchBlurbsTest() throws Exception { + SearchBlurbsResponse expectedResponse = + SearchBlurbsResponse.newBuilder() + .addAllBlurbs(new ArrayList()) + .setNextPageToken("nextPageToken-1386094857") + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("searchBlurbsTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockMessaging.addResponse(resultOperation); + + ProfileName parent = ProfileName.of("[USER]"); + String query = "query107944136"; + + SearchBlurbsResponse actualResponse = client.searchBlurbsAsync(parent, query).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockMessaging.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + SearchBlurbsRequest actualRequest = ((SearchBlurbsRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertEquals(query, actualRequest.getQuery()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void searchBlurbsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockMessaging.addException(exception); + + try { + ProfileName parent = ProfileName.of("[USER]"); + String query = "query107944136"; + client.searchBlurbsAsync(parent, query).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 searchBlurbsTest2() throws Exception { + SearchBlurbsResponse expectedResponse = + SearchBlurbsResponse.newBuilder() + .addAllBlurbs(new ArrayList()) + .setNextPageToken("nextPageToken-1386094857") + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("searchBlurbsTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockMessaging.addResponse(resultOperation); + + RoomName parent = RoomName.of("[ROOM]"); + String query = "query107944136"; + + SearchBlurbsResponse actualResponse = client.searchBlurbsAsync(parent, query).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockMessaging.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + SearchBlurbsRequest actualRequest = ((SearchBlurbsRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertEquals(query, actualRequest.getQuery()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void searchBlurbsExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockMessaging.addException(exception); + + try { + RoomName parent = RoomName.of("[ROOM]"); + String query = "query107944136"; + client.searchBlurbsAsync(parent, query).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 searchBlurbsTest3() throws Exception { + SearchBlurbsResponse expectedResponse = + SearchBlurbsResponse.newBuilder() + .addAllBlurbs(new ArrayList()) + .setNextPageToken("nextPageToken-1386094857") + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("searchBlurbsTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockMessaging.addResponse(resultOperation); + + String parent = "parent-995424086"; + String query = "query107944136"; + + SearchBlurbsResponse actualResponse = client.searchBlurbsAsync(parent, query).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockMessaging.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + SearchBlurbsRequest actualRequest = ((SearchBlurbsRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertEquals(query, actualRequest.getQuery()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void searchBlurbsExceptionTest3() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockMessaging.addException(exception); + + try { + String parent = "parent-995424086"; + String query = "query107944136"; + client.searchBlurbsAsync(parent, query).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 streamBlurbsTest() throws Exception { + StreamBlurbsResponse expectedResponse = + StreamBlurbsResponse.newBuilder().setBlurb(Blurb.newBuilder().build()).build(); + mockMessaging.addResponse(expectedResponse); + StreamBlurbsRequest request = + StreamBlurbsRequest.newBuilder() + .setName(ProfileName.of("[USER]").toString()) + .setExpireTime(Timestamp.newBuilder().build()) + .build(); + + MockStreamObserver responseObserver = new MockStreamObserver<>(); + + ServerStreamingCallable callable = + client.streamBlurbsCallable(); + callable.serverStreamingCall(request, responseObserver); + + List actualResponses = responseObserver.future().get(); + Assert.assertEquals(1, actualResponses.size()); + Assert.assertEquals(expectedResponse, actualResponses.get(0)); + } + + @Test + public void streamBlurbsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockMessaging.addException(exception); + StreamBlurbsRequest request = + StreamBlurbsRequest.newBuilder() + .setName(ProfileName.of("[USER]").toString()) + .setExpireTime(Timestamp.newBuilder().build()) + .build(); + + MockStreamObserver responseObserver = new MockStreamObserver<>(); + + ServerStreamingCallable callable = + client.streamBlurbsCallable(); + callable.serverStreamingCall(request, responseObserver); + + 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()); + } + } + + @Test + public void sendBlurbsTest() throws Exception { + SendBlurbsResponse expectedResponse = + SendBlurbsResponse.newBuilder().addAllNames(new ArrayList()).build(); + mockMessaging.addResponse(expectedResponse); + CreateBlurbRequest request = + CreateBlurbRequest.newBuilder() + .setParent(ProfileName.of("[USER]").toString()) + .setBlurb(Blurb.newBuilder().build()) + .build(); + + MockStreamObserver responseObserver = new MockStreamObserver<>(); + + ClientStreamingCallable callable = + client.sendBlurbsCallable(); + ApiStreamObserver requestObserver = + callable.clientStreamingCall(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 sendBlurbsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockMessaging.addException(exception); + CreateBlurbRequest request = + CreateBlurbRequest.newBuilder() + .setParent(ProfileName.of("[USER]").toString()) + .setBlurb(Blurb.newBuilder().build()) + .build(); + + MockStreamObserver responseObserver = new MockStreamObserver<>(); + + ClientStreamingCallable callable = + client.sendBlurbsCallable(); + ApiStreamObserver requestObserver = + callable.clientStreamingCall(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()); + } + } + + @Test + public void connectTest() throws Exception { + StreamBlurbsResponse expectedResponse = + StreamBlurbsResponse.newBuilder().setBlurb(Blurb.newBuilder().build()).build(); + mockMessaging.addResponse(expectedResponse); + ConnectRequest request = ConnectRequest.newBuilder().build(); + + MockStreamObserver responseObserver = new MockStreamObserver<>(); + + BidiStreamingCallable callable = client.connectCallable(); + 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 connectExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockMessaging.addException(exception); + ConnectRequest request = ConnectRequest.newBuilder().build(); + + MockStreamObserver responseObserver = new MockStreamObserver<>(); + + BidiStreamingCallable callable = client.connectCallable(); + 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()); + } + } + + @Test + public void listLocationsTest() throws Exception { + Location responsesElement = Location.newBuilder().build(); + ListLocationsResponse expectedResponse = + ListLocationsResponse.newBuilder() + .setNextPageToken("") + .addAllLocations(Arrays.asList(responsesElement)) + .build(); + mockLocations.addResponse(expectedResponse); + + ListLocationsRequest request = + ListLocationsRequest.newBuilder() + .setName("name3373707") + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + + ListLocationsPagedResponse pagedListResponse = client.listLocations(request); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getLocationsList().get(0), resources.get(0)); + + List actualRequests = mockLocations.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListLocationsRequest actualRequest = ((ListLocationsRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getName(), actualRequest.getName()); + Assert.assertEquals(request.getFilter(), actualRequest.getFilter()); + Assert.assertEquals(request.getPageSize(), actualRequest.getPageSize()); + Assert.assertEquals(request.getPageToken(), actualRequest.getPageToken()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listLocationsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockLocations.addException(exception); + + try { + ListLocationsRequest request = + ListLocationsRequest.newBuilder() + .setName("name3373707") + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + client.listLocations(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getLocationTest() throws Exception { + Location expectedResponse = + Location.newBuilder() + .setName("name3373707") + .setLocationId("locationId1541836720") + .setDisplayName("displayName1714148973") + .putAllLabels(new HashMap()) + .setMetadata(Any.newBuilder().build()) + .build(); + mockLocations.addResponse(expectedResponse); + + GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build(); + + Location actualResponse = client.getLocation(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockLocations.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetLocationRequest actualRequest = ((GetLocationRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getName(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getLocationExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockLocations.addException(exception); + + try { + GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build(); + client.getLocation(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void setIamPolicyTest() throws Exception { + Policy expectedResponse = + Policy.newBuilder() + .setVersion(351608024) + .addAllBindings(new ArrayList()) + .addAllAuditConfigs(new ArrayList()) + .setEtag(ByteString.EMPTY) + .build(); + mockIAMPolicy.addResponse(expectedResponse); + + SetIamPolicyRequest request = + SetIamPolicyRequest.newBuilder() + .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString()) + .setPolicy(Policy.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .build(); + + Policy actualResponse = client.setIamPolicy(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockIAMPolicy.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + SetIamPolicyRequest actualRequest = ((SetIamPolicyRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getResource(), actualRequest.getResource()); + Assert.assertEquals(request.getPolicy(), actualRequest.getPolicy()); + Assert.assertEquals(request.getUpdateMask(), actualRequest.getUpdateMask()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void setIamPolicyExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockIAMPolicy.addException(exception); + + try { + SetIamPolicyRequest request = + SetIamPolicyRequest.newBuilder() + .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString()) + .setPolicy(Policy.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .build(); + client.setIamPolicy(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getIamPolicyTest() throws Exception { + Policy expectedResponse = + Policy.newBuilder() + .setVersion(351608024) + .addAllBindings(new ArrayList()) + .addAllAuditConfigs(new ArrayList()) + .setEtag(ByteString.EMPTY) + .build(); + mockIAMPolicy.addResponse(expectedResponse); + + GetIamPolicyRequest request = + GetIamPolicyRequest.newBuilder() + .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString()) + .setOptions(GetPolicyOptions.newBuilder().build()) + .build(); + + Policy actualResponse = client.getIamPolicy(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockIAMPolicy.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetIamPolicyRequest actualRequest = ((GetIamPolicyRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getResource(), actualRequest.getResource()); + Assert.assertEquals(request.getOptions(), actualRequest.getOptions()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getIamPolicyExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockIAMPolicy.addException(exception); + + try { + GetIamPolicyRequest request = + GetIamPolicyRequest.newBuilder() + .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString()) + .setOptions(GetPolicyOptions.newBuilder().build()) + .build(); + client.getIamPolicy(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void testIamPermissionsTest() throws Exception { + TestIamPermissionsResponse expectedResponse = + TestIamPermissionsResponse.newBuilder().addAllPermissions(new ArrayList()).build(); + mockIAMPolicy.addResponse(expectedResponse); + + TestIamPermissionsRequest request = + TestIamPermissionsRequest.newBuilder() + .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString()) + .addAllPermissions(new ArrayList()) + .build(); + + TestIamPermissionsResponse actualResponse = client.testIamPermissions(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockIAMPolicy.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + TestIamPermissionsRequest actualRequest = ((TestIamPermissionsRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getResource(), actualRequest.getResource()); + Assert.assertEquals(request.getPermissionsList(), actualRequest.getPermissionsList()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void testIamPermissionsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockIAMPolicy.addException(exception); + + try { + TestIamPermissionsRequest request = + TestIamPermissionsRequest.newBuilder() + .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString()) + .addAllPermissions(new ArrayList()) + .build(); + client.testIamPermissions(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } +} diff --git a/java-showcase-3.25.8/gapic-showcase/src/test/java/com/google/showcase/v1beta1/MockCompliance.java b/java-showcase-3.25.8/gapic-showcase/src/test/java/com/google/showcase/v1beta1/MockCompliance.java new file mode 100644 index 0000000000..dbf0d0e821 --- /dev/null +++ b/java-showcase-3.25.8/gapic-showcase/src/test/java/com/google/showcase/v1beta1/MockCompliance.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.showcase.v1beta1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.grpc.testing.MockGrpcService; +import com.google.protobuf.AbstractMessage; +import io.grpc.ServerServiceDefinition; +import java.util.List; +import javax.annotation.Generated; + +@BetaApi +@Generated("by gapic-generator-java") +public class MockCompliance implements MockGrpcService { + private final MockComplianceImpl serviceImpl; + + public MockCompliance() { + serviceImpl = new MockComplianceImpl(); + } + + @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-showcase-3.25.8/gapic-showcase/src/test/java/com/google/showcase/v1beta1/MockComplianceImpl.java b/java-showcase-3.25.8/gapic-showcase/src/test/java/com/google/showcase/v1beta1/MockComplianceImpl.java new file mode 100644 index 0000000000..935a0a8532 --- /dev/null +++ b/java-showcase-3.25.8/gapic-showcase/src/test/java/com/google/showcase/v1beta1/MockComplianceImpl.java @@ -0,0 +1,271 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1; + +import com.google.api.core.BetaApi; +import com.google.protobuf.AbstractMessage; +import com.google.showcase.v1beta1.ComplianceGrpc.ComplianceImplBase; +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 MockComplianceImpl extends ComplianceImplBase { + private List requests; + private Queue responses; + + public MockComplianceImpl() { + 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 repeatDataBody( + RepeatRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof RepeatResponse) { + requests.add(request); + responseObserver.onNext(((RepeatResponse) 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 RepeatDataBody, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + RepeatResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void repeatDataBodyInfo( + RepeatRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof RepeatResponse) { + requests.add(request); + responseObserver.onNext(((RepeatResponse) 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 RepeatDataBodyInfo, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + RepeatResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void repeatDataQuery( + RepeatRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof RepeatResponse) { + requests.add(request); + responseObserver.onNext(((RepeatResponse) 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 RepeatDataQuery, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + RepeatResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void repeatDataSimplePath( + RepeatRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof RepeatResponse) { + requests.add(request); + responseObserver.onNext(((RepeatResponse) 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 RepeatDataSimplePath, expected %s or" + + " %s", + response == null ? "null" : response.getClass().getName(), + RepeatResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void repeatDataPathResource( + RepeatRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof RepeatResponse) { + requests.add(request); + responseObserver.onNext(((RepeatResponse) 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 RepeatDataPathResource, expected %s or" + + " %s", + response == null ? "null" : response.getClass().getName(), + RepeatResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void repeatDataPathTrailingResource( + RepeatRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof RepeatResponse) { + requests.add(request); + responseObserver.onNext(((RepeatResponse) 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 RepeatDataPathTrailingResource," + + " expected %s or %s", + response == null ? "null" : response.getClass().getName(), + RepeatResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void repeatDataBodyPut( + RepeatRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof RepeatResponse) { + requests.add(request); + responseObserver.onNext(((RepeatResponse) 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 RepeatDataBodyPut, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + RepeatResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void repeatDataBodyPatch( + RepeatRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof RepeatResponse) { + requests.add(request); + responseObserver.onNext(((RepeatResponse) 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 RepeatDataBodyPatch, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + RepeatResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void getEnum(EnumRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof EnumResponse) { + requests.add(request); + responseObserver.onNext(((EnumResponse) 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 GetEnum, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + EnumResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void verifyEnum(EnumResponse request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof EnumResponse) { + requests.add(request); + responseObserver.onNext(((EnumResponse) 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 VerifyEnum, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + EnumResponse.class.getName(), + Exception.class.getName()))); + } + } +} diff --git a/java-showcase-3.25.8/gapic-showcase/src/test/java/com/google/showcase/v1beta1/MockEcho.java b/java-showcase-3.25.8/gapic-showcase/src/test/java/com/google/showcase/v1beta1/MockEcho.java new file mode 100644 index 0000000000..fc9db96a3e --- /dev/null +++ b/java-showcase-3.25.8/gapic-showcase/src/test/java/com/google/showcase/v1beta1/MockEcho.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.showcase.v1beta1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.grpc.testing.MockGrpcService; +import com.google.protobuf.AbstractMessage; +import io.grpc.ServerServiceDefinition; +import java.util.List; +import javax.annotation.Generated; + +@BetaApi +@Generated("by gapic-generator-java") +public class MockEcho implements MockGrpcService { + private final MockEchoImpl serviceImpl; + + public MockEcho() { + serviceImpl = new MockEchoImpl(); + } + + @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-showcase-3.25.8/gapic-showcase/src/test/java/com/google/showcase/v1beta1/MockEchoImpl.java b/java-showcase-3.25.8/gapic-showcase/src/test/java/com/google/showcase/v1beta1/MockEchoImpl.java new file mode 100644 index 0000000000..f505bb9ad9 --- /dev/null +++ b/java-showcase-3.25.8/gapic-showcase/src/test/java/com/google/showcase/v1beta1/MockEchoImpl.java @@ -0,0 +1,321 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1; + +import com.google.api.core.BetaApi; +import com.google.longrunning.Operation; +import com.google.protobuf.AbstractMessage; +import com.google.showcase.v1beta1.EchoGrpc.EchoImplBase; +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 MockEchoImpl extends EchoImplBase { + private List requests; + private Queue responses; + + public MockEchoImpl() { + 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 echo(EchoRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof EchoResponse) { + requests.add(request); + responseObserver.onNext(((EchoResponse) 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 Echo, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + EchoResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void echoErrorDetails( + EchoErrorDetailsRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof EchoErrorDetailsResponse) { + requests.add(request); + responseObserver.onNext(((EchoErrorDetailsResponse) 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 EchoErrorDetails, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + EchoErrorDetailsResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void failEchoWithDetails( + FailEchoWithDetailsRequest request, + StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof FailEchoWithDetailsResponse) { + requests.add(request); + responseObserver.onNext(((FailEchoWithDetailsResponse) 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 FailEchoWithDetails, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + FailEchoWithDetailsResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void expand(ExpandRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof EchoResponse) { + requests.add(request); + responseObserver.onNext(((EchoResponse) 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 Expand, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + EchoResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public StreamObserver collect(final StreamObserver responseObserver) { + StreamObserver requestObserver = + new StreamObserver() { + @Override + public void onNext(EchoRequest value) { + requests.add(value); + final Object response = responses.remove(); + if (response instanceof EchoResponse) { + responseObserver.onNext(((EchoResponse) response)); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method Collect, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + EchoResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void onError(Throwable t) { + responseObserver.onError(t); + } + + @Override + public void onCompleted() { + responseObserver.onCompleted(); + } + }; + return requestObserver; + } + + @Override + public StreamObserver chat(final StreamObserver responseObserver) { + StreamObserver requestObserver = + new StreamObserver() { + @Override + public void onNext(EchoRequest value) { + requests.add(value); + final Object response = responses.remove(); + if (response instanceof EchoResponse) { + responseObserver.onNext(((EchoResponse) response)); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method Chat, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + EchoResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void onError(Throwable t) { + responseObserver.onError(t); + } + + @Override + public void onCompleted() { + responseObserver.onCompleted(); + } + }; + return requestObserver; + } + + @Override + public void pagedExpand( + PagedExpandRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof PagedExpandResponse) { + requests.add(request); + responseObserver.onNext(((PagedExpandResponse) 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 PagedExpand, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + PagedExpandResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void pagedExpandLegacy( + PagedExpandLegacyRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof PagedExpandResponse) { + requests.add(request); + responseObserver.onNext(((PagedExpandResponse) 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 PagedExpandLegacy, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + PagedExpandResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void pagedExpandLegacyMapped( + PagedExpandRequest request, + StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof PagedExpandLegacyMappedResponse) { + requests.add(request); + responseObserver.onNext(((PagedExpandLegacyMappedResponse) 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 PagedExpandLegacyMapped, expected %s or" + + " %s", + response == null ? "null" : response.getClass().getName(), + PagedExpandLegacyMappedResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void wait(WaitRequest 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 Wait, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void block(BlockRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof BlockResponse) { + requests.add(request); + responseObserver.onNext(((BlockResponse) 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 Block, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + BlockResponse.class.getName(), + Exception.class.getName()))); + } + } +} diff --git a/java-showcase-3.25.8/gapic-showcase/src/test/java/com/google/showcase/v1beta1/MockIAMPolicy.java b/java-showcase-3.25.8/gapic-showcase/src/test/java/com/google/showcase/v1beta1/MockIAMPolicy.java new file mode 100644 index 0000000000..ef37c3d404 --- /dev/null +++ b/java-showcase-3.25.8/gapic-showcase/src/test/java/com/google/showcase/v1beta1/MockIAMPolicy.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.showcase.v1beta1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.grpc.testing.MockGrpcService; +import com.google.protobuf.AbstractMessage; +import io.grpc.ServerServiceDefinition; +import java.util.List; +import javax.annotation.Generated; + +@BetaApi +@Generated("by gapic-generator-java") +public class MockIAMPolicy implements MockGrpcService { + private final MockIAMPolicyImpl serviceImpl; + + public MockIAMPolicy() { + serviceImpl = new MockIAMPolicyImpl(); + } + + @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-showcase-3.25.8/gapic-showcase/src/test/java/com/google/showcase/v1beta1/MockIAMPolicyImpl.java b/java-showcase-3.25.8/gapic-showcase/src/test/java/com/google/showcase/v1beta1/MockIAMPolicyImpl.java new file mode 100644 index 0000000000..3c9b26728b --- /dev/null +++ b/java-showcase-3.25.8/gapic-showcase/src/test/java/com/google/showcase/v1beta1/MockIAMPolicyImpl.java @@ -0,0 +1,127 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1; + +import com.google.api.core.BetaApi; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.IAMPolicyGrpc.IAMPolicyImplBase; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.protobuf.AbstractMessage; +import io.grpc.stub.StreamObserver; +import java.util.ArrayList; +import java.util.LinkedList; +import java.util.List; +import java.util.Queue; +import javax.annotation.Generated; + +@BetaApi +@Generated("by gapic-generator-java") +public class MockIAMPolicyImpl extends IAMPolicyImplBase { + private List requests; + private Queue responses; + + public MockIAMPolicyImpl() { + 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 testIamPermissions( + TestIamPermissionsRequest request, + StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof TestIamPermissionsResponse) { + requests.add(request); + responseObserver.onNext(((TestIamPermissionsResponse) 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 TestIamPermissions, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + TestIamPermissionsResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void setIamPolicy(SetIamPolicyRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Policy) { + requests.add(request); + responseObserver.onNext(((Policy) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method SetIamPolicy, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Policy.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void getIamPolicy(GetIamPolicyRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Policy) { + requests.add(request); + responseObserver.onNext(((Policy) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method GetIamPolicy, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Policy.class.getName(), + Exception.class.getName()))); + } + } +} diff --git a/java-showcase-3.25.8/gapic-showcase/src/test/java/com/google/showcase/v1beta1/MockIdentity.java b/java-showcase-3.25.8/gapic-showcase/src/test/java/com/google/showcase/v1beta1/MockIdentity.java new file mode 100644 index 0000000000..e6b7dd1c46 --- /dev/null +++ b/java-showcase-3.25.8/gapic-showcase/src/test/java/com/google/showcase/v1beta1/MockIdentity.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.showcase.v1beta1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.grpc.testing.MockGrpcService; +import com.google.protobuf.AbstractMessage; +import io.grpc.ServerServiceDefinition; +import java.util.List; +import javax.annotation.Generated; + +@BetaApi +@Generated("by gapic-generator-java") +public class MockIdentity implements MockGrpcService { + private final MockIdentityImpl serviceImpl; + + public MockIdentity() { + serviceImpl = new MockIdentityImpl(); + } + + @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-showcase-3.25.8/gapic-showcase/src/test/java/com/google/showcase/v1beta1/MockIdentityImpl.java b/java-showcase-3.25.8/gapic-showcase/src/test/java/com/google/showcase/v1beta1/MockIdentityImpl.java new file mode 100644 index 0000000000..31b7602e49 --- /dev/null +++ b/java-showcase-3.25.8/gapic-showcase/src/test/java/com/google/showcase/v1beta1/MockIdentityImpl.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. + */ + +package com.google.showcase.v1beta1; + +import com.google.api.core.BetaApi; +import com.google.protobuf.AbstractMessage; +import com.google.protobuf.Empty; +import com.google.showcase.v1beta1.IdentityGrpc.IdentityImplBase; +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 MockIdentityImpl extends IdentityImplBase { + private List requests; + private Queue responses; + + public MockIdentityImpl() { + 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 createUser(CreateUserRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof User) { + requests.add(request); + responseObserver.onNext(((User) 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 CreateUser, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + User.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void getUser(GetUserRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof User) { + requests.add(request); + responseObserver.onNext(((User) 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 GetUser, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + User.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void updateUser(UpdateUserRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof User) { + requests.add(request); + responseObserver.onNext(((User) 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 UpdateUser, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + User.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void deleteUser(DeleteUserRequest 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 DeleteUser, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Empty.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void listUsers( + ListUsersRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof ListUsersResponse) { + requests.add(request); + responseObserver.onNext(((ListUsersResponse) 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 ListUsers, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + ListUsersResponse.class.getName(), + Exception.class.getName()))); + } + } +} diff --git a/java-showcase-3.25.8/gapic-showcase/src/test/java/com/google/showcase/v1beta1/MockLocations.java b/java-showcase-3.25.8/gapic-showcase/src/test/java/com/google/showcase/v1beta1/MockLocations.java new file mode 100644 index 0000000000..43855bd7e0 --- /dev/null +++ b/java-showcase-3.25.8/gapic-showcase/src/test/java/com/google/showcase/v1beta1/MockLocations.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.showcase.v1beta1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.grpc.testing.MockGrpcService; +import com.google.protobuf.AbstractMessage; +import io.grpc.ServerServiceDefinition; +import java.util.List; +import javax.annotation.Generated; + +@BetaApi +@Generated("by gapic-generator-java") +public class MockLocations implements MockGrpcService { + private final MockLocationsImpl serviceImpl; + + public MockLocations() { + serviceImpl = new MockLocationsImpl(); + } + + @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-showcase-3.25.8/gapic-showcase/src/test/java/com/google/showcase/v1beta1/MockLocationsImpl.java b/java-showcase-3.25.8/gapic-showcase/src/test/java/com/google/showcase/v1beta1/MockLocationsImpl.java new file mode 100644 index 0000000000..59502a268d --- /dev/null +++ b/java-showcase-3.25.8/gapic-showcase/src/test/java/com/google/showcase/v1beta1/MockLocationsImpl.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. + */ + +package com.google.showcase.v1beta1; + +import com.google.api.core.BetaApi; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.cloud.location.LocationsGrpc.LocationsImplBase; +import com.google.protobuf.AbstractMessage; +import io.grpc.stub.StreamObserver; +import java.util.ArrayList; +import java.util.LinkedList; +import java.util.List; +import java.util.Queue; +import javax.annotation.Generated; + +@BetaApi +@Generated("by gapic-generator-java") +public class MockLocationsImpl extends LocationsImplBase { + private List requests; + private Queue responses; + + public MockLocationsImpl() { + 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 listLocations( + ListLocationsRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof ListLocationsResponse) { + requests.add(request); + responseObserver.onNext(((ListLocationsResponse) 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 ListLocations, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + ListLocationsResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void getLocation(GetLocationRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Location) { + requests.add(request); + responseObserver.onNext(((Location) 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 GetLocation, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Location.class.getName(), + Exception.class.getName()))); + } + } +} diff --git a/java-showcase-3.25.8/gapic-showcase/src/test/java/com/google/showcase/v1beta1/MockMessaging.java b/java-showcase-3.25.8/gapic-showcase/src/test/java/com/google/showcase/v1beta1/MockMessaging.java new file mode 100644 index 0000000000..b9517576ed --- /dev/null +++ b/java-showcase-3.25.8/gapic-showcase/src/test/java/com/google/showcase/v1beta1/MockMessaging.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.showcase.v1beta1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.grpc.testing.MockGrpcService; +import com.google.protobuf.AbstractMessage; +import io.grpc.ServerServiceDefinition; +import java.util.List; +import javax.annotation.Generated; + +@BetaApi +@Generated("by gapic-generator-java") +public class MockMessaging implements MockGrpcService { + private final MockMessagingImpl serviceImpl; + + public MockMessaging() { + serviceImpl = new MockMessagingImpl(); + } + + @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-showcase-3.25.8/gapic-showcase/src/test/java/com/google/showcase/v1beta1/MockMessagingImpl.java b/java-showcase-3.25.8/gapic-showcase/src/test/java/com/google/showcase/v1beta1/MockMessagingImpl.java new file mode 100644 index 0000000000..2a36840c7c --- /dev/null +++ b/java-showcase-3.25.8/gapic-showcase/src/test/java/com/google/showcase/v1beta1/MockMessagingImpl.java @@ -0,0 +1,380 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1; + +import com.google.api.core.BetaApi; +import com.google.longrunning.Operation; +import com.google.protobuf.AbstractMessage; +import com.google.protobuf.Empty; +import com.google.showcase.v1beta1.MessagingGrpc.MessagingImplBase; +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 MockMessagingImpl extends MessagingImplBase { + private List requests; + private Queue responses; + + public MockMessagingImpl() { + 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 createRoom(CreateRoomRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Room) { + requests.add(request); + responseObserver.onNext(((Room) 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 CreateRoom, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Room.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void getRoom(GetRoomRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Room) { + requests.add(request); + responseObserver.onNext(((Room) 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 GetRoom, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Room.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void updateRoom(UpdateRoomRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Room) { + requests.add(request); + responseObserver.onNext(((Room) 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 UpdateRoom, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Room.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void deleteRoom(DeleteRoomRequest 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 DeleteRoom, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Empty.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void listRooms( + ListRoomsRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof ListRoomsResponse) { + requests.add(request); + responseObserver.onNext(((ListRoomsResponse) 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 ListRooms, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + ListRoomsResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void createBlurb(CreateBlurbRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Blurb) { + requests.add(request); + responseObserver.onNext(((Blurb) 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 CreateBlurb, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Blurb.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void getBlurb(GetBlurbRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Blurb) { + requests.add(request); + responseObserver.onNext(((Blurb) 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 GetBlurb, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Blurb.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void updateBlurb(UpdateBlurbRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Blurb) { + requests.add(request); + responseObserver.onNext(((Blurb) 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 UpdateBlurb, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Blurb.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void deleteBlurb(DeleteBlurbRequest 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 DeleteBlurb, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Empty.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void listBlurbs( + ListBlurbsRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof ListBlurbsResponse) { + requests.add(request); + responseObserver.onNext(((ListBlurbsResponse) 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 ListBlurbs, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + ListBlurbsResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void searchBlurbs( + SearchBlurbsRequest 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 SearchBlurbs, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void streamBlurbs( + StreamBlurbsRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof StreamBlurbsResponse) { + requests.add(request); + responseObserver.onNext(((StreamBlurbsResponse) 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 StreamBlurbs, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + StreamBlurbsResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public StreamObserver sendBlurbs( + final StreamObserver responseObserver) { + StreamObserver requestObserver = + new StreamObserver() { + @Override + public void onNext(CreateBlurbRequest value) { + requests.add(value); + final Object response = responses.remove(); + if (response instanceof SendBlurbsResponse) { + responseObserver.onNext(((SendBlurbsResponse) response)); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method SendBlurbs, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + SendBlurbsResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void onError(Throwable t) { + responseObserver.onError(t); + } + + @Override + public void onCompleted() { + responseObserver.onCompleted(); + } + }; + return requestObserver; + } + + @Override + public StreamObserver connect( + final StreamObserver responseObserver) { + StreamObserver requestObserver = + new StreamObserver() { + @Override + public void onNext(ConnectRequest value) { + requests.add(value); + final Object response = responses.remove(); + if (response instanceof StreamBlurbsResponse) { + responseObserver.onNext(((StreamBlurbsResponse) response)); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method Connect, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + StreamBlurbsResponse.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-showcase-3.25.8/gapic-showcase/src/test/java/com/google/showcase/v1beta1/MockSequenceService.java b/java-showcase-3.25.8/gapic-showcase/src/test/java/com/google/showcase/v1beta1/MockSequenceService.java new file mode 100644 index 0000000000..606571e14d --- /dev/null +++ b/java-showcase-3.25.8/gapic-showcase/src/test/java/com/google/showcase/v1beta1/MockSequenceService.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.showcase.v1beta1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.grpc.testing.MockGrpcService; +import com.google.protobuf.AbstractMessage; +import io.grpc.ServerServiceDefinition; +import java.util.List; +import javax.annotation.Generated; + +@BetaApi +@Generated("by gapic-generator-java") +public class MockSequenceService implements MockGrpcService { + private final MockSequenceServiceImpl serviceImpl; + + public MockSequenceService() { + serviceImpl = new MockSequenceServiceImpl(); + } + + @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-showcase-3.25.8/gapic-showcase/src/test/java/com/google/showcase/v1beta1/MockSequenceServiceImpl.java b/java-showcase-3.25.8/gapic-showcase/src/test/java/com/google/showcase/v1beta1/MockSequenceServiceImpl.java new file mode 100644 index 0000000000..92e5fb15c8 --- /dev/null +++ b/java-showcase-3.25.8/gapic-showcase/src/test/java/com/google/showcase/v1beta1/MockSequenceServiceImpl.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.showcase.v1beta1; + +import com.google.api.core.BetaApi; +import com.google.protobuf.AbstractMessage; +import com.google.protobuf.Empty; +import com.google.showcase.v1beta1.SequenceServiceGrpc.SequenceServiceImplBase; +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 MockSequenceServiceImpl extends SequenceServiceImplBase { + private List requests; + private Queue responses; + + public MockSequenceServiceImpl() { + 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 createSequence( + CreateSequenceRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Sequence) { + requests.add(request); + responseObserver.onNext(((Sequence) 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 CreateSequence, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Sequence.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void createStreamingSequence( + CreateStreamingSequenceRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof StreamingSequence) { + requests.add(request); + responseObserver.onNext(((StreamingSequence) 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 CreateStreamingSequence, expected %s or" + + " %s", + response == null ? "null" : response.getClass().getName(), + StreamingSequence.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void getSequenceReport( + GetSequenceReportRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof SequenceReport) { + requests.add(request); + responseObserver.onNext(((SequenceReport) 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 GetSequenceReport, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + SequenceReport.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void getStreamingSequenceReport( + GetStreamingSequenceReportRequest request, + StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof StreamingSequenceReport) { + requests.add(request); + responseObserver.onNext(((StreamingSequenceReport) 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 GetStreamingSequenceReport, expected %s" + + " or %s", + response == null ? "null" : response.getClass().getName(), + StreamingSequenceReport.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void attemptSequence( + AttemptSequenceRequest 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 AttemptSequence, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Empty.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void attemptStreamingSequence( + AttemptStreamingSequenceRequest request, + StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof AttemptStreamingSequenceResponse) { + requests.add(request); + responseObserver.onNext(((AttemptStreamingSequenceResponse) 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 AttemptStreamingSequence, expected %s" + + " or %s", + response == null ? "null" : response.getClass().getName(), + AttemptStreamingSequenceResponse.class.getName(), + Exception.class.getName()))); + } + } +} diff --git a/java-showcase-3.25.8/gapic-showcase/src/test/java/com/google/showcase/v1beta1/MockTesting.java b/java-showcase-3.25.8/gapic-showcase/src/test/java/com/google/showcase/v1beta1/MockTesting.java new file mode 100644 index 0000000000..c03ddbbe4a --- /dev/null +++ b/java-showcase-3.25.8/gapic-showcase/src/test/java/com/google/showcase/v1beta1/MockTesting.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.showcase.v1beta1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.grpc.testing.MockGrpcService; +import com.google.protobuf.AbstractMessage; +import io.grpc.ServerServiceDefinition; +import java.util.List; +import javax.annotation.Generated; + +@BetaApi +@Generated("by gapic-generator-java") +public class MockTesting implements MockGrpcService { + private final MockTestingImpl serviceImpl; + + public MockTesting() { + serviceImpl = new MockTestingImpl(); + } + + @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-showcase-3.25.8/gapic-showcase/src/test/java/com/google/showcase/v1beta1/MockTestingImpl.java b/java-showcase-3.25.8/gapic-showcase/src/test/java/com/google/showcase/v1beta1/MockTestingImpl.java new file mode 100644 index 0000000000..a73afd59a3 --- /dev/null +++ b/java-showcase-3.25.8/gapic-showcase/src/test/java/com/google/showcase/v1beta1/MockTestingImpl.java @@ -0,0 +1,226 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1; + +import com.google.api.core.BetaApi; +import com.google.protobuf.AbstractMessage; +import com.google.protobuf.Empty; +import com.google.showcase.v1beta1.TestingGrpc.TestingImplBase; +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 MockTestingImpl extends TestingImplBase { + private List requests; + private Queue responses; + + public MockTestingImpl() { + 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 createSession( + CreateSessionRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Session) { + requests.add(request); + responseObserver.onNext(((Session) 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 CreateSession, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Session.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void getSession(GetSessionRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Session) { + requests.add(request); + responseObserver.onNext(((Session) 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 GetSession, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Session.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void listSessions( + ListSessionsRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof ListSessionsResponse) { + requests.add(request); + responseObserver.onNext(((ListSessionsResponse) 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 ListSessions, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + ListSessionsResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void deleteSession(DeleteSessionRequest 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 DeleteSession, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Empty.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void reportSession( + ReportSessionRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof ReportSessionResponse) { + requests.add(request); + responseObserver.onNext(((ReportSessionResponse) 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 ReportSession, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + ReportSessionResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void listTests( + ListTestsRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof ListTestsResponse) { + requests.add(request); + responseObserver.onNext(((ListTestsResponse) 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 ListTests, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + ListTestsResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void deleteTest(DeleteTestRequest 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 DeleteTest, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Empty.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void verifyTest( + VerifyTestRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof VerifyTestResponse) { + requests.add(request); + responseObserver.onNext(((VerifyTestResponse) 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 VerifyTest, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + VerifyTestResponse.class.getName(), + Exception.class.getName()))); + } + } +} diff --git a/java-showcase-3.25.8/gapic-showcase/src/test/java/com/google/showcase/v1beta1/SequenceServiceClientHttpJsonTest.java b/java-showcase-3.25.8/gapic-showcase/src/test/java/com/google/showcase/v1beta1/SequenceServiceClientHttpJsonTest.java new file mode 100644 index 0000000000..6dc92ad8b4 --- /dev/null +++ b/java-showcase-3.25.8/gapic-showcase/src/test/java/com/google/showcase/v1beta1/SequenceServiceClientHttpJsonTest.java @@ -0,0 +1,735 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1; + +import static com.google.showcase.v1beta1.SequenceServiceClient.ListLocationsPagedResponse; + +import com.google.api.gax.core.NoCredentialsProvider; +import com.google.api.gax.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.testing.MockHttpService; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ApiException; +import com.google.api.gax.rpc.ApiExceptionFactory; +import com.google.api.gax.rpc.InvalidArgumentException; +import com.google.api.gax.rpc.StatusCode; +import com.google.api.gax.rpc.testing.FakeStatusCode; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.common.collect.Lists; +import com.google.iam.v1.AuditConfig; +import com.google.iam.v1.Binding; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.GetPolicyOptions; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.protobuf.Any; +import com.google.protobuf.ByteString; +import com.google.protobuf.Empty; +import com.google.protobuf.FieldMask; +import com.google.showcase.v1beta1.stub.HttpJsonSequenceServiceStub; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +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 SequenceServiceClientHttpJsonTest { + private static MockHttpService mockService; + private static SequenceServiceClient client; + + @BeforeClass + public static void startStaticServer() throws IOException { + mockService = + new MockHttpService( + HttpJsonSequenceServiceStub.getMethodDescriptors(), + SequenceServiceSettings.getDefaultEndpoint()); + SequenceServiceSettings settings = + SequenceServiceSettings.newHttpJsonBuilder() + .setTransportChannelProvider( + SequenceServiceSettings.defaultHttpJsonTransportProviderBuilder() + .setHttpTransport(mockService) + .build()) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = SequenceServiceClient.create(settings); + } + + @AfterClass + public static void stopServer() { + client.close(); + } + + @Before + public void setUp() {} + + @After + public void tearDown() throws Exception { + mockService.reset(); + } + + @Test + public void createSequenceTest() throws Exception { + Sequence expectedResponse = + Sequence.newBuilder() + .setName(SequenceName.of("[SEQUENCE]").toString()) + .addAllResponses(new ArrayList()) + .build(); + mockService.addResponse(expectedResponse); + + Sequence sequence = Sequence.newBuilder().build(); + + Sequence actualResponse = client.createSequence(sequence); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void createSequenceExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + Sequence sequence = Sequence.newBuilder().build(); + client.createSequence(sequence); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createStreamingSequenceTest() throws Exception { + StreamingSequence expectedResponse = + StreamingSequence.newBuilder() + .setName(StreamingSequenceName.of("[STREAMING_SEQUENCE]").toString()) + .setContent("content951530617") + .addAllResponses(new ArrayList()) + .build(); + mockService.addResponse(expectedResponse); + + StreamingSequence streamingSequence = StreamingSequence.newBuilder().build(); + + StreamingSequence actualResponse = client.createStreamingSequence(streamingSequence); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void createStreamingSequenceExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + StreamingSequence streamingSequence = StreamingSequence.newBuilder().build(); + client.createStreamingSequence(streamingSequence); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getSequenceReportTest() throws Exception { + SequenceReport expectedResponse = + SequenceReport.newBuilder() + .setName(SequenceReportName.of("[SEQUENCE]").toString()) + .addAllAttempts(new ArrayList()) + .build(); + mockService.addResponse(expectedResponse); + + SequenceReportName name = SequenceReportName.of("[SEQUENCE]"); + + SequenceReport actualResponse = client.getSequenceReport(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void getSequenceReportExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + SequenceReportName name = SequenceReportName.of("[SEQUENCE]"); + client.getSequenceReport(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getSequenceReportTest2() throws Exception { + SequenceReport expectedResponse = + SequenceReport.newBuilder() + .setName(SequenceReportName.of("[SEQUENCE]").toString()) + .addAllAttempts(new ArrayList()) + .build(); + mockService.addResponse(expectedResponse); + + String name = "sequences/sequence-5566/sequenceReport"; + + SequenceReport actualResponse = client.getSequenceReport(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void getSequenceReportExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String name = "sequences/sequence-5566/sequenceReport"; + client.getSequenceReport(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getStreamingSequenceReportTest() throws Exception { + StreamingSequenceReport expectedResponse = + StreamingSequenceReport.newBuilder() + .setName(StreamingSequenceReportName.of("[STREAMING_SEQUENCE]").toString()) + .addAllAttempts(new ArrayList()) + .build(); + mockService.addResponse(expectedResponse); + + StreamingSequenceReportName name = StreamingSequenceReportName.of("[STREAMING_SEQUENCE]"); + + StreamingSequenceReport actualResponse = client.getStreamingSequenceReport(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void getStreamingSequenceReportExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + StreamingSequenceReportName name = StreamingSequenceReportName.of("[STREAMING_SEQUENCE]"); + client.getStreamingSequenceReport(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getStreamingSequenceReportTest2() throws Exception { + StreamingSequenceReport expectedResponse = + StreamingSequenceReport.newBuilder() + .setName(StreamingSequenceReportName.of("[STREAMING_SEQUENCE]").toString()) + .addAllAttempts(new ArrayList()) + .build(); + mockService.addResponse(expectedResponse); + + String name = "streamingSequences/streamingSequence-962/streamingSequenceReport"; + + StreamingSequenceReport actualResponse = client.getStreamingSequenceReport(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void getStreamingSequenceReportExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String name = "streamingSequences/streamingSequence-962/streamingSequenceReport"; + client.getStreamingSequenceReport(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void attemptSequenceTest() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockService.addResponse(expectedResponse); + + SequenceName name = SequenceName.of("[SEQUENCE]"); + + client.attemptSequence(name); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void attemptSequenceExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + SequenceName name = SequenceName.of("[SEQUENCE]"); + client.attemptSequence(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void attemptSequenceTest2() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockService.addResponse(expectedResponse); + + String name = "sequences/sequence-9950"; + + client.attemptSequence(name); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void attemptSequenceExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String name = "sequences/sequence-9950"; + client.attemptSequence(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void attemptStreamingSequenceTest() throws Exception {} + + @Test + public void attemptStreamingSequenceExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + } + + @Test + public void listLocationsTest() throws Exception { + Location responsesElement = Location.newBuilder().build(); + ListLocationsResponse expectedResponse = + ListLocationsResponse.newBuilder() + .setNextPageToken("") + .addAllLocations(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + ListLocationsRequest request = + ListLocationsRequest.newBuilder() + .setName("projects/project-3664") + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + + ListLocationsPagedResponse pagedListResponse = client.listLocations(request); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getLocationsList().get(0), resources.get(0)); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void listLocationsExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ListLocationsRequest request = + ListLocationsRequest.newBuilder() + .setName("projects/project-3664") + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + client.listLocations(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getLocationTest() throws Exception { + Location expectedResponse = + Location.newBuilder() + .setName("name3373707") + .setLocationId("locationId1541836720") + .setDisplayName("displayName1714148973") + .putAllLabels(new HashMap()) + .setMetadata(Any.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + GetLocationRequest request = + GetLocationRequest.newBuilder() + .setName("projects/project-9062/locations/location-9062") + .build(); + + Location actualResponse = client.getLocation(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void getLocationExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + GetLocationRequest request = + GetLocationRequest.newBuilder() + .setName("projects/project-9062/locations/location-9062") + .build(); + client.getLocation(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void setIamPolicyTest() throws Exception { + Policy expectedResponse = + Policy.newBuilder() + .setVersion(351608024) + .addAllBindings(new ArrayList()) + .addAllAuditConfigs(new ArrayList()) + .setEtag(ByteString.EMPTY) + .build(); + mockService.addResponse(expectedResponse); + + SetIamPolicyRequest request = + SetIamPolicyRequest.newBuilder() + .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString()) + .setPolicy(Policy.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .build(); + + Policy actualResponse = client.setIamPolicy(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void setIamPolicyExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + SetIamPolicyRequest request = + SetIamPolicyRequest.newBuilder() + .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString()) + .setPolicy(Policy.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .build(); + client.setIamPolicy(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getIamPolicyTest() throws Exception { + Policy expectedResponse = + Policy.newBuilder() + .setVersion(351608024) + .addAllBindings(new ArrayList()) + .addAllAuditConfigs(new ArrayList()) + .setEtag(ByteString.EMPTY) + .build(); + mockService.addResponse(expectedResponse); + + GetIamPolicyRequest request = + GetIamPolicyRequest.newBuilder() + .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString()) + .setOptions(GetPolicyOptions.newBuilder().build()) + .build(); + + Policy actualResponse = client.getIamPolicy(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void getIamPolicyExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + GetIamPolicyRequest request = + GetIamPolicyRequest.newBuilder() + .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString()) + .setOptions(GetPolicyOptions.newBuilder().build()) + .build(); + client.getIamPolicy(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void testIamPermissionsTest() throws Exception { + TestIamPermissionsResponse expectedResponse = + TestIamPermissionsResponse.newBuilder().addAllPermissions(new ArrayList()).build(); + mockService.addResponse(expectedResponse); + + TestIamPermissionsRequest request = + TestIamPermissionsRequest.newBuilder() + .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString()) + .addAllPermissions(new ArrayList()) + .build(); + + TestIamPermissionsResponse actualResponse = client.testIamPermissions(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void testIamPermissionsExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + TestIamPermissionsRequest request = + TestIamPermissionsRequest.newBuilder() + .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString()) + .addAllPermissions(new ArrayList()) + .build(); + client.testIamPermissions(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } +} diff --git a/java-showcase-3.25.8/gapic-showcase/src/test/java/com/google/showcase/v1beta1/SequenceServiceClientTest.java b/java-showcase-3.25.8/gapic-showcase/src/test/java/com/google/showcase/v1beta1/SequenceServiceClientTest.java new file mode 100644 index 0000000000..43d36555c0 --- /dev/null +++ b/java-showcase-3.25.8/gapic-showcase/src/test/java/com/google/showcase/v1beta1/SequenceServiceClientTest.java @@ -0,0 +1,712 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1; + +import static com.google.showcase.v1beta1.SequenceServiceClient.ListLocationsPagedResponse; + +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.InvalidArgumentException; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.api.gax.rpc.StatusCode; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.common.collect.Lists; +import com.google.iam.v1.AuditConfig; +import com.google.iam.v1.Binding; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.GetPolicyOptions; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.protobuf.AbstractMessage; +import com.google.protobuf.Any; +import com.google.protobuf.ByteString; +import com.google.protobuf.Empty; +import com.google.protobuf.FieldMask; +import io.grpc.StatusRuntimeException; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.UUID; +import 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 SequenceServiceClientTest { + private static MockIAMPolicy mockIAMPolicy; + private static MockLocations mockLocations; + private static MockSequenceService mockSequenceService; + private static MockServiceHelper mockServiceHelper; + private LocalChannelProvider channelProvider; + private SequenceServiceClient client; + + @BeforeClass + public static void startStaticServer() { + mockSequenceService = new MockSequenceService(); + mockLocations = new MockLocations(); + mockIAMPolicy = new MockIAMPolicy(); + mockServiceHelper = + new MockServiceHelper( + UUID.randomUUID().toString(), + Arrays.asList(mockSequenceService, mockLocations, mockIAMPolicy)); + mockServiceHelper.start(); + } + + @AfterClass + public static void stopServer() { + mockServiceHelper.stop(); + } + + @Before + public void setUp() throws IOException { + mockServiceHelper.reset(); + channelProvider = mockServiceHelper.createChannelProvider(); + SequenceServiceSettings settings = + SequenceServiceSettings.newBuilder() + .setTransportChannelProvider(channelProvider) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = SequenceServiceClient.create(settings); + } + + @After + public void tearDown() throws Exception { + client.close(); + } + + @Test + public void createSequenceTest() throws Exception { + Sequence expectedResponse = + Sequence.newBuilder() + .setName(SequenceName.of("[SEQUENCE]").toString()) + .addAllResponses(new ArrayList()) + .build(); + mockSequenceService.addResponse(expectedResponse); + + Sequence sequence = Sequence.newBuilder().build(); + + Sequence actualResponse = client.createSequence(sequence); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockSequenceService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateSequenceRequest actualRequest = ((CreateSequenceRequest) actualRequests.get(0)); + + Assert.assertEquals(sequence, actualRequest.getSequence()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void createSequenceExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockSequenceService.addException(exception); + + try { + Sequence sequence = Sequence.newBuilder().build(); + client.createSequence(sequence); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createStreamingSequenceTest() throws Exception { + StreamingSequence expectedResponse = + StreamingSequence.newBuilder() + .setName(StreamingSequenceName.of("[STREAMING_SEQUENCE]").toString()) + .setContent("content951530617") + .addAllResponses(new ArrayList()) + .build(); + mockSequenceService.addResponse(expectedResponse); + + StreamingSequence streamingSequence = StreamingSequence.newBuilder().build(); + + StreamingSequence actualResponse = client.createStreamingSequence(streamingSequence); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockSequenceService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateStreamingSequenceRequest actualRequest = + ((CreateStreamingSequenceRequest) actualRequests.get(0)); + + Assert.assertEquals(streamingSequence, actualRequest.getStreamingSequence()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void createStreamingSequenceExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockSequenceService.addException(exception); + + try { + StreamingSequence streamingSequence = StreamingSequence.newBuilder().build(); + client.createStreamingSequence(streamingSequence); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getSequenceReportTest() throws Exception { + SequenceReport expectedResponse = + SequenceReport.newBuilder() + .setName(SequenceReportName.of("[SEQUENCE]").toString()) + .addAllAttempts(new ArrayList()) + .build(); + mockSequenceService.addResponse(expectedResponse); + + SequenceReportName name = SequenceReportName.of("[SEQUENCE]"); + + SequenceReport actualResponse = client.getSequenceReport(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockSequenceService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetSequenceReportRequest actualRequest = ((GetSequenceReportRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getSequenceReportExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockSequenceService.addException(exception); + + try { + SequenceReportName name = SequenceReportName.of("[SEQUENCE]"); + client.getSequenceReport(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getSequenceReportTest2() throws Exception { + SequenceReport expectedResponse = + SequenceReport.newBuilder() + .setName(SequenceReportName.of("[SEQUENCE]").toString()) + .addAllAttempts(new ArrayList()) + .build(); + mockSequenceService.addResponse(expectedResponse); + + String name = "name3373707"; + + SequenceReport actualResponse = client.getSequenceReport(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockSequenceService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetSequenceReportRequest actualRequest = ((GetSequenceReportRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getSequenceReportExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockSequenceService.addException(exception); + + try { + String name = "name3373707"; + client.getSequenceReport(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getStreamingSequenceReportTest() throws Exception { + StreamingSequenceReport expectedResponse = + StreamingSequenceReport.newBuilder() + .setName(StreamingSequenceReportName.of("[STREAMING_SEQUENCE]").toString()) + .addAllAttempts(new ArrayList()) + .build(); + mockSequenceService.addResponse(expectedResponse); + + StreamingSequenceReportName name = StreamingSequenceReportName.of("[STREAMING_SEQUENCE]"); + + StreamingSequenceReport actualResponse = client.getStreamingSequenceReport(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockSequenceService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetStreamingSequenceReportRequest actualRequest = + ((GetStreamingSequenceReportRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getStreamingSequenceReportExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockSequenceService.addException(exception); + + try { + StreamingSequenceReportName name = StreamingSequenceReportName.of("[STREAMING_SEQUENCE]"); + client.getStreamingSequenceReport(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getStreamingSequenceReportTest2() throws Exception { + StreamingSequenceReport expectedResponse = + StreamingSequenceReport.newBuilder() + .setName(StreamingSequenceReportName.of("[STREAMING_SEQUENCE]").toString()) + .addAllAttempts(new ArrayList()) + .build(); + mockSequenceService.addResponse(expectedResponse); + + String name = "name3373707"; + + StreamingSequenceReport actualResponse = client.getStreamingSequenceReport(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockSequenceService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetStreamingSequenceReportRequest actualRequest = + ((GetStreamingSequenceReportRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getStreamingSequenceReportExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockSequenceService.addException(exception); + + try { + String name = "name3373707"; + client.getStreamingSequenceReport(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void attemptSequenceTest() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockSequenceService.addResponse(expectedResponse); + + SequenceName name = SequenceName.of("[SEQUENCE]"); + + client.attemptSequence(name); + + List actualRequests = mockSequenceService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + AttemptSequenceRequest actualRequest = ((AttemptSequenceRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void attemptSequenceExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockSequenceService.addException(exception); + + try { + SequenceName name = SequenceName.of("[SEQUENCE]"); + client.attemptSequence(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void attemptSequenceTest2() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockSequenceService.addResponse(expectedResponse); + + String name = "name3373707"; + + client.attemptSequence(name); + + List actualRequests = mockSequenceService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + AttemptSequenceRequest actualRequest = ((AttemptSequenceRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void attemptSequenceExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockSequenceService.addException(exception); + + try { + String name = "name3373707"; + client.attemptSequence(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void attemptStreamingSequenceTest() throws Exception { + AttemptStreamingSequenceResponse expectedResponse = + AttemptStreamingSequenceResponse.newBuilder().setContent("content951530617").build(); + mockSequenceService.addResponse(expectedResponse); + AttemptStreamingSequenceRequest request = + AttemptStreamingSequenceRequest.newBuilder() + .setName(StreamingSequenceName.of("[STREAMING_SEQUENCE]").toString()) + .setLastFailIndex(2006482362) + .build(); + + MockStreamObserver responseObserver = + new MockStreamObserver<>(); + + ServerStreamingCallable + callable = client.attemptStreamingSequenceCallable(); + callable.serverStreamingCall(request, responseObserver); + + List actualResponses = responseObserver.future().get(); + Assert.assertEquals(1, actualResponses.size()); + Assert.assertEquals(expectedResponse, actualResponses.get(0)); + } + + @Test + public void attemptStreamingSequenceExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockSequenceService.addException(exception); + AttemptStreamingSequenceRequest request = + AttemptStreamingSequenceRequest.newBuilder() + .setName(StreamingSequenceName.of("[STREAMING_SEQUENCE]").toString()) + .setLastFailIndex(2006482362) + .build(); + + MockStreamObserver responseObserver = + new MockStreamObserver<>(); + + ServerStreamingCallable + callable = client.attemptStreamingSequenceCallable(); + callable.serverStreamingCall(request, responseObserver); + + 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()); + } + } + + @Test + public void listLocationsTest() throws Exception { + Location responsesElement = Location.newBuilder().build(); + ListLocationsResponse expectedResponse = + ListLocationsResponse.newBuilder() + .setNextPageToken("") + .addAllLocations(Arrays.asList(responsesElement)) + .build(); + mockLocations.addResponse(expectedResponse); + + ListLocationsRequest request = + ListLocationsRequest.newBuilder() + .setName("name3373707") + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + + ListLocationsPagedResponse pagedListResponse = client.listLocations(request); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getLocationsList().get(0), resources.get(0)); + + List actualRequests = mockLocations.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListLocationsRequest actualRequest = ((ListLocationsRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getName(), actualRequest.getName()); + Assert.assertEquals(request.getFilter(), actualRequest.getFilter()); + Assert.assertEquals(request.getPageSize(), actualRequest.getPageSize()); + Assert.assertEquals(request.getPageToken(), actualRequest.getPageToken()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listLocationsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockLocations.addException(exception); + + try { + ListLocationsRequest request = + ListLocationsRequest.newBuilder() + .setName("name3373707") + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + client.listLocations(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getLocationTest() throws Exception { + Location expectedResponse = + Location.newBuilder() + .setName("name3373707") + .setLocationId("locationId1541836720") + .setDisplayName("displayName1714148973") + .putAllLabels(new HashMap()) + .setMetadata(Any.newBuilder().build()) + .build(); + mockLocations.addResponse(expectedResponse); + + GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build(); + + Location actualResponse = client.getLocation(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockLocations.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetLocationRequest actualRequest = ((GetLocationRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getName(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getLocationExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockLocations.addException(exception); + + try { + GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build(); + client.getLocation(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void setIamPolicyTest() throws Exception { + Policy expectedResponse = + Policy.newBuilder() + .setVersion(351608024) + .addAllBindings(new ArrayList()) + .addAllAuditConfigs(new ArrayList()) + .setEtag(ByteString.EMPTY) + .build(); + mockIAMPolicy.addResponse(expectedResponse); + + SetIamPolicyRequest request = + SetIamPolicyRequest.newBuilder() + .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString()) + .setPolicy(Policy.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .build(); + + Policy actualResponse = client.setIamPolicy(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockIAMPolicy.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + SetIamPolicyRequest actualRequest = ((SetIamPolicyRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getResource(), actualRequest.getResource()); + Assert.assertEquals(request.getPolicy(), actualRequest.getPolicy()); + Assert.assertEquals(request.getUpdateMask(), actualRequest.getUpdateMask()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void setIamPolicyExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockIAMPolicy.addException(exception); + + try { + SetIamPolicyRequest request = + SetIamPolicyRequest.newBuilder() + .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString()) + .setPolicy(Policy.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .build(); + client.setIamPolicy(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getIamPolicyTest() throws Exception { + Policy expectedResponse = + Policy.newBuilder() + .setVersion(351608024) + .addAllBindings(new ArrayList()) + .addAllAuditConfigs(new ArrayList()) + .setEtag(ByteString.EMPTY) + .build(); + mockIAMPolicy.addResponse(expectedResponse); + + GetIamPolicyRequest request = + GetIamPolicyRequest.newBuilder() + .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString()) + .setOptions(GetPolicyOptions.newBuilder().build()) + .build(); + + Policy actualResponse = client.getIamPolicy(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockIAMPolicy.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetIamPolicyRequest actualRequest = ((GetIamPolicyRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getResource(), actualRequest.getResource()); + Assert.assertEquals(request.getOptions(), actualRequest.getOptions()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getIamPolicyExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockIAMPolicy.addException(exception); + + try { + GetIamPolicyRequest request = + GetIamPolicyRequest.newBuilder() + .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString()) + .setOptions(GetPolicyOptions.newBuilder().build()) + .build(); + client.getIamPolicy(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void testIamPermissionsTest() throws Exception { + TestIamPermissionsResponse expectedResponse = + TestIamPermissionsResponse.newBuilder().addAllPermissions(new ArrayList()).build(); + mockIAMPolicy.addResponse(expectedResponse); + + TestIamPermissionsRequest request = + TestIamPermissionsRequest.newBuilder() + .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString()) + .addAllPermissions(new ArrayList()) + .build(); + + TestIamPermissionsResponse actualResponse = client.testIamPermissions(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockIAMPolicy.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + TestIamPermissionsRequest actualRequest = ((TestIamPermissionsRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getResource(), actualRequest.getResource()); + Assert.assertEquals(request.getPermissionsList(), actualRequest.getPermissionsList()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void testIamPermissionsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockIAMPolicy.addException(exception); + + try { + TestIamPermissionsRequest request = + TestIamPermissionsRequest.newBuilder() + .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString()) + .addAllPermissions(new ArrayList()) + .build(); + client.testIamPermissions(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } +} diff --git a/java-showcase-3.25.8/gapic-showcase/src/test/java/com/google/showcase/v1beta1/TestingClientHttpJsonTest.java b/java-showcase-3.25.8/gapic-showcase/src/test/java/com/google/showcase/v1beta1/TestingClientHttpJsonTest.java new file mode 100644 index 0000000000..5a6df6a7ee --- /dev/null +++ b/java-showcase-3.25.8/gapic-showcase/src/test/java/com/google/showcase/v1beta1/TestingClientHttpJsonTest.java @@ -0,0 +1,766 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1; + +import static com.google.showcase.v1beta1.TestingClient.ListLocationsPagedResponse; +import static com.google.showcase.v1beta1.TestingClient.ListSessionsPagedResponse; +import static com.google.showcase.v1beta1.TestingClient.ListTestsPagedResponse; + +import com.google.api.gax.core.NoCredentialsProvider; +import com.google.api.gax.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.testing.MockHttpService; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ApiException; +import com.google.api.gax.rpc.ApiExceptionFactory; +import com.google.api.gax.rpc.InvalidArgumentException; +import com.google.api.gax.rpc.StatusCode; +import com.google.api.gax.rpc.testing.FakeStatusCode; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.common.collect.Lists; +import com.google.iam.v1.AuditConfig; +import com.google.iam.v1.Binding; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.GetPolicyOptions; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.protobuf.Any; +import com.google.protobuf.ByteString; +import com.google.protobuf.Empty; +import com.google.protobuf.FieldMask; +import com.google.showcase.v1beta1.stub.HttpJsonTestingStub; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +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 TestingClientHttpJsonTest { + private static MockHttpService mockService; + private static TestingClient client; + + @BeforeClass + public static void startStaticServer() throws IOException { + mockService = + new MockHttpService( + HttpJsonTestingStub.getMethodDescriptors(), TestingSettings.getDefaultEndpoint()); + TestingSettings settings = + TestingSettings.newHttpJsonBuilder() + .setTransportChannelProvider( + TestingSettings.defaultHttpJsonTransportProviderBuilder() + .setHttpTransport(mockService) + .build()) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = TestingClient.create(settings); + } + + @AfterClass + public static void stopServer() { + client.close(); + } + + @Before + public void setUp() {} + + @After + public void tearDown() throws Exception { + mockService.reset(); + } + + @Test + public void createSessionTest() throws Exception { + Session expectedResponse = + Session.newBuilder().setName(SessionName.of("[SESSION]").toString()).build(); + mockService.addResponse(expectedResponse); + + CreateSessionRequest request = + CreateSessionRequest.newBuilder().setSession(Session.newBuilder().build()).build(); + + Session actualResponse = client.createSession(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void createSessionExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + CreateSessionRequest request = + CreateSessionRequest.newBuilder().setSession(Session.newBuilder().build()).build(); + client.createSession(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getSessionTest() throws Exception { + Session expectedResponse = + Session.newBuilder().setName(SessionName.of("[SESSION]").toString()).build(); + mockService.addResponse(expectedResponse); + + GetSessionRequest request = + GetSessionRequest.newBuilder().setName(SessionName.of("[SESSION]").toString()).build(); + + Session actualResponse = client.getSession(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void getSessionExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + GetSessionRequest request = + GetSessionRequest.newBuilder().setName(SessionName.of("[SESSION]").toString()).build(); + client.getSession(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listSessionsTest() throws Exception { + Session responsesElement = Session.newBuilder().build(); + ListSessionsResponse expectedResponse = + ListSessionsResponse.newBuilder() + .setNextPageToken("") + .addAllSessions(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + ListSessionsRequest request = + ListSessionsRequest.newBuilder() + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + + ListSessionsPagedResponse pagedListResponse = client.listSessions(request); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getSessionsList().get(0), resources.get(0)); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void listSessionsExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ListSessionsRequest request = + ListSessionsRequest.newBuilder() + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + client.listSessions(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void deleteSessionTest() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockService.addResponse(expectedResponse); + + DeleteSessionRequest request = + DeleteSessionRequest.newBuilder().setName(SessionName.of("[SESSION]").toString()).build(); + + client.deleteSession(request); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void deleteSessionExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + DeleteSessionRequest request = + DeleteSessionRequest.newBuilder().setName(SessionName.of("[SESSION]").toString()).build(); + client.deleteSession(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void reportSessionTest() throws Exception { + ReportSessionResponse expectedResponse = + ReportSessionResponse.newBuilder().addAllTestRuns(new ArrayList()).build(); + mockService.addResponse(expectedResponse); + + ReportSessionRequest request = + ReportSessionRequest.newBuilder().setName(SessionName.of("[SESSION]").toString()).build(); + + ReportSessionResponse actualResponse = client.reportSession(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void reportSessionExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ReportSessionRequest request = + ReportSessionRequest.newBuilder().setName(SessionName.of("[SESSION]").toString()).build(); + client.reportSession(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listTestsTest() throws Exception { + com.google.showcase.v1beta1.Test responsesElement = + com.google.showcase.v1beta1.Test.newBuilder().build(); + ListTestsResponse expectedResponse = + ListTestsResponse.newBuilder() + .setNextPageToken("") + .addAllTests(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + ListTestsRequest request = + ListTestsRequest.newBuilder() + .setParent(SessionName.of("[SESSION]").toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + + ListTestsPagedResponse pagedListResponse = client.listTests(request); + + List resources = + Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getTestsList().get(0), resources.get(0)); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void listTestsExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ListTestsRequest request = + ListTestsRequest.newBuilder() + .setParent(SessionName.of("[SESSION]").toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + client.listTests(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void deleteTestTest() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockService.addResponse(expectedResponse); + + DeleteTestRequest request = + DeleteTestRequest.newBuilder() + .setName(TestName.of("[SESSION]", "[TEST]").toString()) + .build(); + + client.deleteTest(request); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void deleteTestExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + DeleteTestRequest request = + DeleteTestRequest.newBuilder() + .setName(TestName.of("[SESSION]", "[TEST]").toString()) + .build(); + client.deleteTest(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void verifyTestTest() throws Exception { + VerifyTestResponse expectedResponse = + VerifyTestResponse.newBuilder().setIssue(Issue.newBuilder().build()).build(); + mockService.addResponse(expectedResponse); + + VerifyTestRequest request = + VerifyTestRequest.newBuilder() + .setName(TestName.of("[SESSION]", "[TEST]").toString()) + .setAnswer(ByteString.EMPTY) + .addAllAnswers(new ArrayList()) + .build(); + + VerifyTestResponse actualResponse = client.verifyTest(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void verifyTestExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + VerifyTestRequest request = + VerifyTestRequest.newBuilder() + .setName(TestName.of("[SESSION]", "[TEST]").toString()) + .setAnswer(ByteString.EMPTY) + .addAllAnswers(new ArrayList()) + .build(); + client.verifyTest(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listLocationsTest() throws Exception { + Location responsesElement = Location.newBuilder().build(); + ListLocationsResponse expectedResponse = + ListLocationsResponse.newBuilder() + .setNextPageToken("") + .addAllLocations(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + ListLocationsRequest request = + ListLocationsRequest.newBuilder() + .setName("projects/project-3664") + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + + ListLocationsPagedResponse pagedListResponse = client.listLocations(request); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getLocationsList().get(0), resources.get(0)); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void listLocationsExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ListLocationsRequest request = + ListLocationsRequest.newBuilder() + .setName("projects/project-3664") + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + client.listLocations(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getLocationTest() throws Exception { + Location expectedResponse = + Location.newBuilder() + .setName("name3373707") + .setLocationId("locationId1541836720") + .setDisplayName("displayName1714148973") + .putAllLabels(new HashMap()) + .setMetadata(Any.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + GetLocationRequest request = + GetLocationRequest.newBuilder() + .setName("projects/project-9062/locations/location-9062") + .build(); + + Location actualResponse = client.getLocation(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void getLocationExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + GetLocationRequest request = + GetLocationRequest.newBuilder() + .setName("projects/project-9062/locations/location-9062") + .build(); + client.getLocation(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void setIamPolicyTest() throws Exception { + Policy expectedResponse = + Policy.newBuilder() + .setVersion(351608024) + .addAllBindings(new ArrayList()) + .addAllAuditConfigs(new ArrayList()) + .setEtag(ByteString.EMPTY) + .build(); + mockService.addResponse(expectedResponse); + + SetIamPolicyRequest request = + SetIamPolicyRequest.newBuilder() + .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString()) + .setPolicy(Policy.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .build(); + + Policy actualResponse = client.setIamPolicy(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void setIamPolicyExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + SetIamPolicyRequest request = + SetIamPolicyRequest.newBuilder() + .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString()) + .setPolicy(Policy.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .build(); + client.setIamPolicy(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getIamPolicyTest() throws Exception { + Policy expectedResponse = + Policy.newBuilder() + .setVersion(351608024) + .addAllBindings(new ArrayList()) + .addAllAuditConfigs(new ArrayList()) + .setEtag(ByteString.EMPTY) + .build(); + mockService.addResponse(expectedResponse); + + GetIamPolicyRequest request = + GetIamPolicyRequest.newBuilder() + .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString()) + .setOptions(GetPolicyOptions.newBuilder().build()) + .build(); + + Policy actualResponse = client.getIamPolicy(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void getIamPolicyExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + GetIamPolicyRequest request = + GetIamPolicyRequest.newBuilder() + .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString()) + .setOptions(GetPolicyOptions.newBuilder().build()) + .build(); + client.getIamPolicy(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void testIamPermissionsTest() throws Exception { + TestIamPermissionsResponse expectedResponse = + TestIamPermissionsResponse.newBuilder().addAllPermissions(new ArrayList()).build(); + mockService.addResponse(expectedResponse); + + TestIamPermissionsRequest request = + TestIamPermissionsRequest.newBuilder() + .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString()) + .addAllPermissions(new ArrayList()) + .build(); + + TestIamPermissionsResponse actualResponse = client.testIamPermissions(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void testIamPermissionsExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + TestIamPermissionsRequest request = + TestIamPermissionsRequest.newBuilder() + .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString()) + .addAllPermissions(new ArrayList()) + .build(); + client.testIamPermissions(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } +} diff --git a/java-showcase-3.25.8/gapic-showcase/src/test/java/com/google/showcase/v1beta1/TestingClientTest.java b/java-showcase-3.25.8/gapic-showcase/src/test/java/com/google/showcase/v1beta1/TestingClientTest.java new file mode 100644 index 0000000000..1d6280165d --- /dev/null +++ b/java-showcase-3.25.8/gapic-showcase/src/test/java/com/google/showcase/v1beta1/TestingClientTest.java @@ -0,0 +1,703 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1; + +import static com.google.showcase.v1beta1.TestingClient.ListLocationsPagedResponse; +import static com.google.showcase.v1beta1.TestingClient.ListSessionsPagedResponse; +import static com.google.showcase.v1beta1.TestingClient.ListTestsPagedResponse; + +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.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.common.collect.Lists; +import com.google.iam.v1.AuditConfig; +import com.google.iam.v1.Binding; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.GetPolicyOptions; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.protobuf.AbstractMessage; +import com.google.protobuf.Any; +import com.google.protobuf.ByteString; +import com.google.protobuf.Empty; +import com.google.protobuf.FieldMask; +import io.grpc.StatusRuntimeException; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.UUID; +import javax.annotation.Generated; +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Assert; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; + +@Generated("by gapic-generator-java") +public class TestingClientTest { + private static MockIAMPolicy mockIAMPolicy; + private static MockLocations mockLocations; + private static MockServiceHelper mockServiceHelper; + private static MockTesting mockTesting; + private LocalChannelProvider channelProvider; + private TestingClient client; + + @BeforeClass + public static void startStaticServer() { + mockTesting = new MockTesting(); + mockLocations = new MockLocations(); + mockIAMPolicy = new MockIAMPolicy(); + mockServiceHelper = + new MockServiceHelper( + UUID.randomUUID().toString(), + Arrays.asList(mockTesting, mockLocations, mockIAMPolicy)); + mockServiceHelper.start(); + } + + @AfterClass + public static void stopServer() { + mockServiceHelper.stop(); + } + + @Before + public void setUp() throws IOException { + mockServiceHelper.reset(); + channelProvider = mockServiceHelper.createChannelProvider(); + TestingSettings settings = + TestingSettings.newBuilder() + .setTransportChannelProvider(channelProvider) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = TestingClient.create(settings); + } + + @After + public void tearDown() throws Exception { + client.close(); + } + + @Test + public void createSessionTest() throws Exception { + Session expectedResponse = + Session.newBuilder().setName(SessionName.of("[SESSION]").toString()).build(); + mockTesting.addResponse(expectedResponse); + + CreateSessionRequest request = + CreateSessionRequest.newBuilder().setSession(Session.newBuilder().build()).build(); + + Session actualResponse = client.createSession(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockTesting.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateSessionRequest actualRequest = ((CreateSessionRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getSession(), actualRequest.getSession()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void createSessionExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockTesting.addException(exception); + + try { + CreateSessionRequest request = + CreateSessionRequest.newBuilder().setSession(Session.newBuilder().build()).build(); + client.createSession(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getSessionTest() throws Exception { + Session expectedResponse = + Session.newBuilder().setName(SessionName.of("[SESSION]").toString()).build(); + mockTesting.addResponse(expectedResponse); + + GetSessionRequest request = + GetSessionRequest.newBuilder().setName(SessionName.of("[SESSION]").toString()).build(); + + Session actualResponse = client.getSession(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockTesting.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetSessionRequest actualRequest = ((GetSessionRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getName(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getSessionExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockTesting.addException(exception); + + try { + GetSessionRequest request = + GetSessionRequest.newBuilder().setName(SessionName.of("[SESSION]").toString()).build(); + client.getSession(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listSessionsTest() throws Exception { + Session responsesElement = Session.newBuilder().build(); + ListSessionsResponse expectedResponse = + ListSessionsResponse.newBuilder() + .setNextPageToken("") + .addAllSessions(Arrays.asList(responsesElement)) + .build(); + mockTesting.addResponse(expectedResponse); + + ListSessionsRequest request = + ListSessionsRequest.newBuilder() + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + + ListSessionsPagedResponse pagedListResponse = client.listSessions(request); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getSessionsList().get(0), resources.get(0)); + + List actualRequests = mockTesting.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListSessionsRequest actualRequest = ((ListSessionsRequest) 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 listSessionsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockTesting.addException(exception); + + try { + ListSessionsRequest request = + ListSessionsRequest.newBuilder() + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + client.listSessions(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void deleteSessionTest() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockTesting.addResponse(expectedResponse); + + DeleteSessionRequest request = + DeleteSessionRequest.newBuilder().setName(SessionName.of("[SESSION]").toString()).build(); + + client.deleteSession(request); + + List actualRequests = mockTesting.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeleteSessionRequest actualRequest = ((DeleteSessionRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getName(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void deleteSessionExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockTesting.addException(exception); + + try { + DeleteSessionRequest request = + DeleteSessionRequest.newBuilder().setName(SessionName.of("[SESSION]").toString()).build(); + client.deleteSession(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void reportSessionTest() throws Exception { + ReportSessionResponse expectedResponse = + ReportSessionResponse.newBuilder().addAllTestRuns(new ArrayList()).build(); + mockTesting.addResponse(expectedResponse); + + ReportSessionRequest request = + ReportSessionRequest.newBuilder().setName(SessionName.of("[SESSION]").toString()).build(); + + ReportSessionResponse actualResponse = client.reportSession(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockTesting.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ReportSessionRequest actualRequest = ((ReportSessionRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getName(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void reportSessionExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockTesting.addException(exception); + + try { + ReportSessionRequest request = + ReportSessionRequest.newBuilder().setName(SessionName.of("[SESSION]").toString()).build(); + client.reportSession(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listTestsTest() throws Exception { + com.google.showcase.v1beta1.Test responsesElement = + com.google.showcase.v1beta1.Test.newBuilder().build(); + ListTestsResponse expectedResponse = + ListTestsResponse.newBuilder() + .setNextPageToken("") + .addAllTests(Arrays.asList(responsesElement)) + .build(); + mockTesting.addResponse(expectedResponse); + + ListTestsRequest request = + ListTestsRequest.newBuilder() + .setParent(SessionName.of("[SESSION]").toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + + ListTestsPagedResponse pagedListResponse = client.listTests(request); + + List resources = + Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getTestsList().get(0), resources.get(0)); + + List actualRequests = mockTesting.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListTestsRequest actualRequest = ((ListTestsRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getParent(), actualRequest.getParent()); + Assert.assertEquals(request.getPageSize(), actualRequest.getPageSize()); + Assert.assertEquals(request.getPageToken(), actualRequest.getPageToken()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listTestsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockTesting.addException(exception); + + try { + ListTestsRequest request = + ListTestsRequest.newBuilder() + .setParent(SessionName.of("[SESSION]").toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + client.listTests(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void deleteTestTest() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockTesting.addResponse(expectedResponse); + + DeleteTestRequest request = + DeleteTestRequest.newBuilder() + .setName(TestName.of("[SESSION]", "[TEST]").toString()) + .build(); + + client.deleteTest(request); + + List actualRequests = mockTesting.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeleteTestRequest actualRequest = ((DeleteTestRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getName(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void deleteTestExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockTesting.addException(exception); + + try { + DeleteTestRequest request = + DeleteTestRequest.newBuilder() + .setName(TestName.of("[SESSION]", "[TEST]").toString()) + .build(); + client.deleteTest(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void verifyTestTest() throws Exception { + VerifyTestResponse expectedResponse = + VerifyTestResponse.newBuilder().setIssue(Issue.newBuilder().build()).build(); + mockTesting.addResponse(expectedResponse); + + VerifyTestRequest request = + VerifyTestRequest.newBuilder() + .setName(TestName.of("[SESSION]", "[TEST]").toString()) + .setAnswer(ByteString.EMPTY) + .addAllAnswers(new ArrayList()) + .build(); + + VerifyTestResponse actualResponse = client.verifyTest(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockTesting.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + VerifyTestRequest actualRequest = ((VerifyTestRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getName(), actualRequest.getName()); + Assert.assertEquals(request.getAnswer(), actualRequest.getAnswer()); + Assert.assertEquals(request.getAnswersList(), actualRequest.getAnswersList()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void verifyTestExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockTesting.addException(exception); + + try { + VerifyTestRequest request = + VerifyTestRequest.newBuilder() + .setName(TestName.of("[SESSION]", "[TEST]").toString()) + .setAnswer(ByteString.EMPTY) + .addAllAnswers(new ArrayList()) + .build(); + client.verifyTest(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listLocationsTest() throws Exception { + Location responsesElement = Location.newBuilder().build(); + ListLocationsResponse expectedResponse = + ListLocationsResponse.newBuilder() + .setNextPageToken("") + .addAllLocations(Arrays.asList(responsesElement)) + .build(); + mockLocations.addResponse(expectedResponse); + + ListLocationsRequest request = + ListLocationsRequest.newBuilder() + .setName("name3373707") + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + + ListLocationsPagedResponse pagedListResponse = client.listLocations(request); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getLocationsList().get(0), resources.get(0)); + + List actualRequests = mockLocations.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListLocationsRequest actualRequest = ((ListLocationsRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getName(), actualRequest.getName()); + Assert.assertEquals(request.getFilter(), actualRequest.getFilter()); + Assert.assertEquals(request.getPageSize(), actualRequest.getPageSize()); + Assert.assertEquals(request.getPageToken(), actualRequest.getPageToken()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listLocationsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockLocations.addException(exception); + + try { + ListLocationsRequest request = + ListLocationsRequest.newBuilder() + .setName("name3373707") + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + client.listLocations(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getLocationTest() throws Exception { + Location expectedResponse = + Location.newBuilder() + .setName("name3373707") + .setLocationId("locationId1541836720") + .setDisplayName("displayName1714148973") + .putAllLabels(new HashMap()) + .setMetadata(Any.newBuilder().build()) + .build(); + mockLocations.addResponse(expectedResponse); + + GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build(); + + Location actualResponse = client.getLocation(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockLocations.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetLocationRequest actualRequest = ((GetLocationRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getName(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getLocationExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockLocations.addException(exception); + + try { + GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build(); + client.getLocation(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void setIamPolicyTest() throws Exception { + Policy expectedResponse = + Policy.newBuilder() + .setVersion(351608024) + .addAllBindings(new ArrayList()) + .addAllAuditConfigs(new ArrayList()) + .setEtag(ByteString.EMPTY) + .build(); + mockIAMPolicy.addResponse(expectedResponse); + + SetIamPolicyRequest request = + SetIamPolicyRequest.newBuilder() + .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString()) + .setPolicy(Policy.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .build(); + + Policy actualResponse = client.setIamPolicy(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockIAMPolicy.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + SetIamPolicyRequest actualRequest = ((SetIamPolicyRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getResource(), actualRequest.getResource()); + Assert.assertEquals(request.getPolicy(), actualRequest.getPolicy()); + Assert.assertEquals(request.getUpdateMask(), actualRequest.getUpdateMask()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void setIamPolicyExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockIAMPolicy.addException(exception); + + try { + SetIamPolicyRequest request = + SetIamPolicyRequest.newBuilder() + .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString()) + .setPolicy(Policy.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .build(); + client.setIamPolicy(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getIamPolicyTest() throws Exception { + Policy expectedResponse = + Policy.newBuilder() + .setVersion(351608024) + .addAllBindings(new ArrayList()) + .addAllAuditConfigs(new ArrayList()) + .setEtag(ByteString.EMPTY) + .build(); + mockIAMPolicy.addResponse(expectedResponse); + + GetIamPolicyRequest request = + GetIamPolicyRequest.newBuilder() + .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString()) + .setOptions(GetPolicyOptions.newBuilder().build()) + .build(); + + Policy actualResponse = client.getIamPolicy(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockIAMPolicy.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetIamPolicyRequest actualRequest = ((GetIamPolicyRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getResource(), actualRequest.getResource()); + Assert.assertEquals(request.getOptions(), actualRequest.getOptions()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getIamPolicyExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockIAMPolicy.addException(exception); + + try { + GetIamPolicyRequest request = + GetIamPolicyRequest.newBuilder() + .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString()) + .setOptions(GetPolicyOptions.newBuilder().build()) + .build(); + client.getIamPolicy(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void testIamPermissionsTest() throws Exception { + TestIamPermissionsResponse expectedResponse = + TestIamPermissionsResponse.newBuilder().addAllPermissions(new ArrayList()).build(); + mockIAMPolicy.addResponse(expectedResponse); + + TestIamPermissionsRequest request = + TestIamPermissionsRequest.newBuilder() + .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString()) + .addAllPermissions(new ArrayList()) + .build(); + + TestIamPermissionsResponse actualResponse = client.testIamPermissions(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockIAMPolicy.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + TestIamPermissionsRequest actualRequest = ((TestIamPermissionsRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getResource(), actualRequest.getResource()); + Assert.assertEquals(request.getPermissionsList(), actualRequest.getPermissionsList()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void testIamPermissionsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockIAMPolicy.addException(exception); + + try { + TestIamPermissionsRequest request = + TestIamPermissionsRequest.newBuilder() + .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString()) + .addAllPermissions(new ArrayList()) + .build(); + client.testIamPermissions(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } +} diff --git a/java-showcase-3.25.8/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/ITApiKeyCredentials.java b/java-showcase-3.25.8/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/ITApiKeyCredentials.java new file mode 100644 index 0000000000..5867bcfea9 --- /dev/null +++ b/java-showcase-3.25.8/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/ITApiKeyCredentials.java @@ -0,0 +1,219 @@ +/* + * 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 + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.it; + +import static com.google.common.truth.Truth.assertThat; + +import com.google.api.client.http.javanet.NetHttpTransport; +import com.google.api.gax.rpc.FixedHeaderProvider; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.auth.http.AuthHttpConstants; +import com.google.common.collect.ImmutableList; +import com.google.showcase.v1beta1.EchoClient; +import com.google.showcase.v1beta1.EchoRequest; +import com.google.showcase.v1beta1.EchoSettings; +import com.google.showcase.v1beta1.it.util.GrpcCapturingClientInterceptor; +import com.google.showcase.v1beta1.it.util.HttpJsonCapturingClientInterceptor; +import com.google.showcase.v1beta1.it.util.TestClientInitializer; +import io.grpc.ManagedChannelBuilder; +import io.grpc.Metadata; +import java.io.IOException; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.concurrent.TimeUnit; +import java.util.stream.Collectors; +import java.util.stream.StreamSupport; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; + +/** + * Test suite to confirm a client can be instantiated with API key credentials and correct + * authorization sent via headers to back end + */ +class ITApiKeyCredentials { + + private static final String API_KEY = "fake_api_key"; + private static final String API_KEY_AUTH_HEADER = "x-goog-api-key"; + private static final String HTTP_RESPONSE_HEADER_STRING = + "x-showcase-request-" + API_KEY_AUTH_HEADER; + private static final String GRPC_ENDPOINT = "localhost:7469"; + private static final String HTTP_ENDPOINT = "http://localhost:7469"; + + private static HttpJsonCapturingClientInterceptor httpJsonInterceptor; + private static EchoClient grpcClient; + private static EchoClient httpJsonClient; + private static GrpcCapturingClientInterceptor grpcInterceptor; + + @BeforeEach + void setup() throws IOException { + grpcInterceptor = new GrpcCapturingClientInterceptor(); + httpJsonInterceptor = new HttpJsonCapturingClientInterceptor(); + } + + @AfterEach + void tearDown() throws InterruptedException { + if (httpJsonClient != null) { + httpJsonClient.close(); + httpJsonClient.awaitTermination( + TestClientInitializer.AWAIT_TERMINATION_SECONDS, TimeUnit.SECONDS); + } + if (grpcClient != null) { + grpcClient.close(); + grpcClient.awaitTermination( + TestClientInitializer.AWAIT_TERMINATION_SECONDS, TimeUnit.SECONDS); + } + } + + @Test + void testCreateGrpcClient_withApiKey_sendsApiHeaderToServer() throws IOException { + Metadata.Key apiKeyAuthHeader = + Metadata.Key.of(API_KEY_AUTH_HEADER, Metadata.ASCII_STRING_MARSHALLER); + Metadata.Key defaultAuthorizationHeader = + Metadata.Key.of(AuthHttpConstants.AUTHORIZATION, Metadata.ASCII_STRING_MARSHALLER); + EchoSettings.Builder echoBuilder = + EchoSettings.newBuilder() + .setApiKey(API_KEY) + .setEndpoint(GRPC_ENDPOINT) + .setTransportChannelProvider( + EchoSettings.defaultGrpcTransportProviderBuilder() + .setChannelConfigurator(ManagedChannelBuilder::usePlaintext) + .setInterceptorProvider(() -> ImmutableList.of(grpcInterceptor)) + .build()); + EchoSettings settings = echoBuilder.build(); + grpcClient = EchoClient.create(settings); + + grpcClient.echo(EchoRequest.newBuilder().build()); + + assertThat(echoBuilder.getApiKey()).isEqualTo(API_KEY); + assertThat(settings.getApiKey()).isEqualTo(API_KEY); + String headerValue = grpcInterceptor.metadata.get(apiKeyAuthHeader); + assertThat(headerValue).isEqualTo(API_KEY); + String defaultAuthorizationHeaderValue = + grpcInterceptor.metadata.get(defaultAuthorizationHeader); + assertThat(defaultAuthorizationHeaderValue).isNull(); + } + + @Test + void testCreateGrpcClient_withApiKeySetViaSetterAndHeader_dedupsHeader() throws IOException { + String apiHeaderKey = "fake_api_key_2"; + Metadata.Key apiKeyAuthHeader = + Metadata.Key.of(API_KEY_AUTH_HEADER, Metadata.ASCII_STRING_MARSHALLER); + Metadata.Key defaultAuthorizationHeader = + Metadata.Key.of(AuthHttpConstants.AUTHORIZATION, Metadata.ASCII_STRING_MARSHALLER); + Map header = + new HashMap() { + { + put(API_KEY_AUTH_HEADER, apiHeaderKey); + } + }; + FixedHeaderProvider headerProvider = FixedHeaderProvider.create(header); + + TransportChannelProvider transportChannelProvider = + EchoSettings.defaultGrpcTransportProviderBuilder() + .setHeaderProvider(headerProvider) + .setChannelConfigurator(ManagedChannelBuilder::usePlaintext) + .setInterceptorProvider(() -> ImmutableList.of(grpcInterceptor)) + .build(); + EchoSettings settings = + EchoSettings.newBuilder() + .setApiKey(API_KEY) + .setEndpoint(GRPC_ENDPOINT) + .setTransportChannelProvider(transportChannelProvider) + .build(); + grpcClient = EchoClient.create(settings); + + grpcClient.echo(EchoRequest.newBuilder().build()); + + Iterable matchingHeaders = grpcInterceptor.metadata.getAll(apiKeyAuthHeader); + List matchingHeadersList = + StreamSupport.stream(matchingHeaders.spliterator(), false).collect(Collectors.toList()); + + String headerValue = matchingHeadersList.get(0); + assertThat(headerValue).isEqualTo(API_KEY); + assertThat(matchingHeadersList.size()).isEqualTo(1); + } + + @Test + void testCreateHttpClient_withApiKey_sendsApiHeaderToServer() throws Exception { + EchoSettings httpJsonEchoSettings = + EchoSettings.newHttpJsonBuilder() + .setApiKey(API_KEY) + .setTransportChannelProvider( + EchoSettings.defaultHttpJsonTransportProviderBuilder() + .setHttpTransport( + new NetHttpTransport.Builder().doNotValidateCertificate().build()) + .setEndpoint(HTTP_ENDPOINT) + .setInterceptorProvider(() -> ImmutableList.of(httpJsonInterceptor)) + .build()) + .build(); + httpJsonClient = EchoClient.create(httpJsonEchoSettings); + + httpJsonClient.echo(EchoRequest.newBuilder().build()); + + ArrayList headerValues = + (ArrayList) + httpJsonInterceptor.metadata.getHeaders().get(HTTP_RESPONSE_HEADER_STRING); + String headerValue = headerValues.get(0); + assertThat(headerValue).isEqualTo(API_KEY); + } + + @Test + void testCreateHttpClient_withApiKeySetViaSetterAndHeader_dedupsHeader() throws Exception { + String apiHeaderKey = "fake_api_key_2"; + Metadata.Key apiKeyAuthHeader = + Metadata.Key.of(API_KEY_AUTH_HEADER, Metadata.ASCII_STRING_MARSHALLER); + Metadata.Key defaultAuthorizationHeader = + Metadata.Key.of(AuthHttpConstants.AUTHORIZATION, Metadata.ASCII_STRING_MARSHALLER); + Map header = + new HashMap() { + { + put(API_KEY_AUTH_HEADER, apiHeaderKey); + } + }; + FixedHeaderProvider headerProvider = FixedHeaderProvider.create(header); + + TransportChannelProvider transportChannelProvider = + EchoSettings.defaultHttpJsonTransportProviderBuilder() + .setHeaderProvider(headerProvider) + .setInterceptorProvider(() -> ImmutableList.of(httpJsonInterceptor)) + .build(); + EchoSettings httpJsonEchoSettings = + EchoSettings.newHttpJsonBuilder() + .setApiKey(API_KEY) + .setTransportChannelProvider( + EchoSettings.defaultHttpJsonTransportProviderBuilder() + .setHttpTransport( + new NetHttpTransport.Builder().doNotValidateCertificate().build()) + .setEndpoint(HTTP_ENDPOINT) + .setInterceptorProvider(() -> ImmutableList.of(httpJsonInterceptor)) + .build()) + .build(); + httpJsonClient = EchoClient.create(httpJsonEchoSettings); + + httpJsonClient.echo(EchoRequest.newBuilder().build()); + + ArrayList headerValues = + (ArrayList) + httpJsonInterceptor.metadata.getHeaders().get(HTTP_RESPONSE_HEADER_STRING); + String headerValue = headerValues.get(0); + assertThat(headerValue).isEqualTo(API_KEY); + assertThat(headerValues.size()).isEqualTo(1); + } +} diff --git a/java-showcase-3.25.8/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/ITAutoPopulatedFields.java b/java-showcase-3.25.8/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/ITAutoPopulatedFields.java new file mode 100644 index 0000000000..f73b6b3c7d --- /dev/null +++ b/java-showcase-3.25.8/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/ITAutoPopulatedFields.java @@ -0,0 +1,379 @@ +/* + * 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 + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.showcase.v1beta1.it; + +import static org.junit.jupiter.api.Assertions.assertThrows; + +import com.google.api.gax.httpjson.ApiMethodDescriptor; +import com.google.api.gax.httpjson.ForwardingHttpJsonClientCall; +import com.google.api.gax.httpjson.HttpJsonCallOptions; +import com.google.api.gax.httpjson.HttpJsonChannel; +import com.google.api.gax.httpjson.HttpJsonClientCall; +import com.google.api.gax.httpjson.HttpJsonClientInterceptor; +import com.google.api.gax.retrying.RetrySettings; +import com.google.api.gax.retrying.RetryingFuture; +import com.google.api.gax.rpc.StatusCode.Code; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableSet; +import com.google.common.truth.Truth; +import com.google.rpc.Status; +import com.google.showcase.v1beta1.EchoClient; +import com.google.showcase.v1beta1.EchoRequest; +import com.google.showcase.v1beta1.EchoResponse; +import com.google.showcase.v1beta1.it.util.TestClientInitializer; +import io.grpc.CallOptions; +import io.grpc.Channel; +import io.grpc.ClientCall; +import io.grpc.ClientInterceptor; +import io.grpc.ForwardingClientCall; +import io.grpc.MethodDescriptor; +import java.util.ArrayList; +import java.util.List; +import java.util.Set; +import java.util.UUID; +import java.util.concurrent.ExecutionException; +import java.util.concurrent.TimeUnit; +import java.util.function.Consumer; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.threeten.bp.Duration; + +class ITAutoPopulatedFields { + + private static class HttpJsonInterceptor implements HttpJsonClientInterceptor { + private Consumer onRequestIntercepted; + + private HttpJsonInterceptor() {} + + private void setOnRequestIntercepted(Consumer onRequestIntercepted) { + this.onRequestIntercepted = onRequestIntercepted; + } + + @Override + public HttpJsonClientCall interceptCall( + ApiMethodDescriptor method, + HttpJsonCallOptions callOptions, + HttpJsonChannel next) { + HttpJsonClientCall call = next.newCall(method, callOptions); + + return new ForwardingHttpJsonClientCall.SimpleForwardingHttpJsonClientCall( + call) { + @Override + public void sendMessage(ReqT message) { + // Capture the request message + if (onRequestIntercepted != null) { + onRequestIntercepted.accept(message); + } + super.sendMessage(message); + } + }; + } + } + + // Implement a request interceptor to retrieve the request ID being sent on the request. + private static class GRPCInterceptor implements ClientInterceptor { + private Consumer onRequestIntercepted; + + private GRPCInterceptor() {} + + private void setOnRequestIntercepted(Consumer onRequestIntercepted) { + this.onRequestIntercepted = onRequestIntercepted; + } + + @Override + public ClientCall interceptCall( + MethodDescriptor method, CallOptions callOptions, Channel next) { + + return new ForwardingClientCall.SimpleForwardingClientCall( + next.newCall(method, callOptions)) { + @Override + public void sendMessage(ReqT message) { + // Capture the request message + if (onRequestIntercepted != null) { + onRequestIntercepted.accept(message); + } + super.sendMessage(message); + } + }; + } + } + + private GRPCInterceptor grpcRequestInterceptor; + private HttpJsonInterceptor httpJsonInterceptor; + private EchoClient grpcClientWithoutRetries; + private EchoClient grpcClientWithRetries; + + private EchoClient httpJsonClient; + private EchoClient httpJsonClientWithRetries; + + @BeforeEach + void createClients() throws Exception { + RetrySettings defaultRetrySettings = + RetrySettings.newBuilder() + .setInitialRpcTimeout(Duration.ofMillis(5000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ofMillis(5000L)) + .setTotalTimeout(Duration.ofMillis(5000L)) + // Cap retries at 5 + .setMaxAttempts(5) + .build(); + + // Adding `Code.INTERNAL` is necessary because for httpJson requests, the httpJson status code + // is mapped here: + // https://github.com/googleapis/sdk-platform-java/blob/acdde47445916dd306ce8b91489fab45c9c2ef50/gax-java/gax-httpjson/src/main/java/com/google/api/gax/httpjson/HttpJsonStatusCode.java#L96-L133 + // Therefore, just setting the error code to `Code.UNKNOWN` for httpJson will get translated + // instead to `Code.INTERNAL`. + Set retryableCodes = ImmutableSet.of(Code.UNKNOWN, Code.INTERNAL); + + // Create gRPC Interceptor and Client + grpcRequestInterceptor = new ITAutoPopulatedFields.GRPCInterceptor(); + grpcClientWithoutRetries = + TestClientInitializer.createGrpcEchoClient(ImmutableList.of(grpcRequestInterceptor)); + grpcClientWithRetries = + TestClientInitializer.createGrpcEchoClientWithRetrySettings( + defaultRetrySettings, retryableCodes, ImmutableList.of(grpcRequestInterceptor)); + + // Create HttpJson Interceptor and Client + httpJsonInterceptor = new ITAutoPopulatedFields.HttpJsonInterceptor(); + httpJsonClient = + TestClientInitializer.createHttpJsonEchoClient(ImmutableList.of(httpJsonInterceptor)); + httpJsonClientWithRetries = + TestClientInitializer.createHttpJsonEchoClientWithRetrySettings( + defaultRetrySettings, retryableCodes, ImmutableList.of(httpJsonInterceptor)); + } + + @AfterEach + void destroyClient() throws InterruptedException { + grpcClientWithoutRetries.close(); + grpcClientWithRetries.close(); + httpJsonClient.close(); + + grpcClientWithoutRetries.awaitTermination( + TestClientInitializer.AWAIT_TERMINATION_SECONDS, TimeUnit.SECONDS); + grpcClientWithRetries.awaitTermination( + TestClientInitializer.AWAIT_TERMINATION_SECONDS, TimeUnit.SECONDS); + httpJsonClient.awaitTermination( + TestClientInitializer.AWAIT_TERMINATION_SECONDS, TimeUnit.SECONDS); + } + + @Test + void testGrpc_autoPopulateRequestIdWhenAttemptedOnceSuccessfully() { + List capturedRequestIds = new ArrayList<>(); + grpcRequestInterceptor.setOnRequestIntercepted( + request -> { + if (request instanceof EchoRequest) { + EchoRequest echoRequest = (EchoRequest) request; + capturedRequestIds.add(echoRequest.getRequestId()); + } + }); + grpcClientWithoutRetries.echo(EchoRequest.newBuilder().build()); + Truth.assertThat(capturedRequestIds).isNotEmpty(); + // Autopopulation of UUID is currently only configured for format UUID4. + Integer UUIDVersion = 4; + Truth.assertThat(UUID.fromString(capturedRequestIds.get(0)).version()).isEqualTo(UUIDVersion); + } + + @Test + void testGrpc_shouldNotAutoPopulateRequestIdIfSetInRequest() { + List capturedRequestIds = new ArrayList<>(); + grpcRequestInterceptor.setOnRequestIntercepted( + request -> { + if (request instanceof EchoRequest) { + EchoRequest echoRequest = (EchoRequest) request; + capturedRequestIds.add(echoRequest.getRequestId()); + } + }); + String UUIDsent = UUID.randomUUID().toString(); + grpcClientWithoutRetries.echo(EchoRequest.newBuilder().setRequestId(UUIDsent).build()); + Truth.assertThat(capturedRequestIds).isNotEmpty(); + Truth.assertThat(capturedRequestIds).contains(UUIDsent); + } + + @Test + void testHttpJson_autoPopulateRequestIdWhenAttemptedOnceSuccessfully() { + List capturedRequestIds = new ArrayList<>(); + httpJsonInterceptor.setOnRequestIntercepted( + request -> { + if (request instanceof EchoRequest) { + EchoRequest echoRequest = (EchoRequest) request; + capturedRequestIds.add(echoRequest.getRequestId()); + } + }); + httpJsonClient.echo(EchoRequest.newBuilder().build()); + Truth.assertThat(capturedRequestIds).isNotEmpty(); + // Autopopulation of UUID is currently only configured for format UUID4. + Integer UUIDVersion = 4; + Truth.assertThat(UUID.fromString(capturedRequestIds.get(0)).version()).isEqualTo(UUIDVersion); + } + + @Test + void testHttpJson_shouldNotAutoPopulateRequestIdIfSetInRequest() { + String UUIDsent = UUID.randomUUID().toString(); + List capturedRequestIds = new ArrayList<>(); + httpJsonInterceptor.setOnRequestIntercepted( + request -> { + if (request instanceof EchoRequest) { + EchoRequest echoRequest = (EchoRequest) request; + capturedRequestIds.add(echoRequest.getRequestId()); + } + }); + httpJsonClient.echo(EchoRequest.newBuilder().setRequestId(UUIDsent).build()); + Truth.assertThat(capturedRequestIds).isNotEmpty(); + Truth.assertThat(capturedRequestIds).contains(UUIDsent); + } + + @Test + void testGRPC_setsSameRequestIdIfSetInRequestWhenRequestsAreRetried() throws Exception { + List capturedRequestIds = new ArrayList<>(); + grpcRequestInterceptor.setOnRequestIntercepted( + request -> { + if (request instanceof EchoRequest) { + EchoRequest echoRequest = (EchoRequest) request; + capturedRequestIds.add(echoRequest.getRequestId()); + } + }); + String UUIDsent = UUID.randomUUID().toString(); + EchoRequest requestSent = + EchoRequest.newBuilder() + .setRequestId(UUIDsent) + .setError(Status.newBuilder().setCode(Code.UNKNOWN.ordinal()).build()) + .build(); + + try { + RetryingFuture retryingFuture = + (RetryingFuture) + grpcClientWithRetries.echoCallable().futureCall(requestSent); + assertThrows(ExecutionException.class, () -> retryingFuture.get(10, TimeUnit.SECONDS)); + // assert that the number of request IDs is equal to the max attempt + Truth.assertThat(capturedRequestIds).hasSize(5); + // assert that each request ID sent is the same as the UUIDSent + Truth.assertThat(capturedRequestIds) + .containsExactly(UUIDsent, UUIDsent, UUIDsent, UUIDsent, UUIDsent); + } finally { + grpcClientWithRetries.close(); + grpcClientWithRetries.awaitTermination( + TestClientInitializer.AWAIT_TERMINATION_SECONDS, TimeUnit.SECONDS); + } + } + + @Test + void testGRPC_setsSameAutoPopulatedRequestIdWhenRequestsAreRetried() throws Exception { + List capturedRequestIds = new ArrayList<>(); + grpcRequestInterceptor.setOnRequestIntercepted( + request -> { + if (request instanceof EchoRequest) { + EchoRequest echoRequest = (EchoRequest) request; + capturedRequestIds.add(echoRequest.getRequestId()); + } + }); + + EchoRequest requestSent = + EchoRequest.newBuilder() + .setError(Status.newBuilder().setCode(Code.UNKNOWN.ordinal()).build()) + .build(); + + try { + RetryingFuture retryingFuture = + (RetryingFuture) + grpcClientWithRetries.echoCallable().futureCall(requestSent); + assertThrows(ExecutionException.class, () -> retryingFuture.get(10, TimeUnit.SECONDS)); + // assert that the number of request IDs is equal to the max attempt + Truth.assertThat(capturedRequestIds).hasSize(5); + // assert that each request ID sent is the same + Truth.assertThat(capturedRequestIds) + .containsExactly( + capturedRequestIds.get(0), + capturedRequestIds.get(0), + capturedRequestIds.get(0), + capturedRequestIds.get(0), + capturedRequestIds.get(0)); + } finally { + grpcClientWithRetries.close(); + grpcClientWithRetries.awaitTermination( + TestClientInitializer.AWAIT_TERMINATION_SECONDS, TimeUnit.SECONDS); + } + } + + @Test + void testHttpJson_setsSameRequestIdIfSetInRequestWhenRequestsAreRetried() throws Exception { + List capturedRequestIds = new ArrayList<>(); + httpJsonInterceptor.setOnRequestIntercepted( + request -> { + if (request instanceof EchoRequest) { + EchoRequest echoRequest = (EchoRequest) request; + capturedRequestIds.add(echoRequest.getRequestId()); + } + }); + String UUIDsent = UUID.randomUUID().toString(); + EchoRequest requestSent = + EchoRequest.newBuilder() + .setRequestId(UUIDsent) + .setError(Status.newBuilder().setCode(Code.UNKNOWN.getHttpStatusCode()).build()) + .build(); + try { + RetryingFuture retryingFuture = + (RetryingFuture) + httpJsonClientWithRetries.echoCallable().futureCall(requestSent); + assertThrows(ExecutionException.class, () -> retryingFuture.get(10, TimeUnit.SECONDS)); + // assert that the number of request IDs is equal to the max attempt + Truth.assertThat(capturedRequestIds).hasSize(5); + // assert that each request ID sent is the same as the UUIDSent + Truth.assertThat(capturedRequestIds) + .containsExactly(UUIDsent, UUIDsent, UUIDsent, UUIDsent, UUIDsent); + } finally { + httpJsonClientWithRetries.close(); + httpJsonClientWithRetries.awaitTermination( + TestClientInitializer.AWAIT_TERMINATION_SECONDS, TimeUnit.SECONDS); + } + } + + @Test + void testHttpJson_setsSameAutoPopulatedRequestIdWhenRequestsAreRetried() throws Exception { + List capturedRequestIds = new ArrayList<>(); + httpJsonInterceptor.setOnRequestIntercepted( + request -> { + if (request instanceof EchoRequest) { + EchoRequest echoRequest = (EchoRequest) request; + capturedRequestIds.add(echoRequest.getRequestId()); + } + }); + EchoRequest requestSent = + EchoRequest.newBuilder() + .setError(Status.newBuilder().setCode(Code.UNKNOWN.getHttpStatusCode()).build()) + .build(); + try { + RetryingFuture retryingFuture = + (RetryingFuture) + httpJsonClientWithRetries.echoCallable().futureCall(requestSent); + assertThrows(ExecutionException.class, () -> retryingFuture.get(10, TimeUnit.SECONDS)); + // assert that the number of request IDs is equal to the max attempt + Truth.assertThat(capturedRequestIds).hasSize(5); + // assert that each request ID sent is the same + Truth.assertThat(capturedRequestIds) + .containsExactly( + capturedRequestIds.get(0), + capturedRequestIds.get(0), + capturedRequestIds.get(0), + capturedRequestIds.get(0), + capturedRequestIds.get(0)); + } finally { + httpJsonClientWithRetries.close(); + httpJsonClientWithRetries.awaitTermination( + TestClientInitializer.AWAIT_TERMINATION_SECONDS, TimeUnit.SECONDS); + } + } +} diff --git a/java-showcase-3.25.8/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/ITBidiStreaming.java b/java-showcase-3.25.8/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/ITBidiStreaming.java new file mode 100644 index 0000000000..72b8f1b0de --- /dev/null +++ b/java-showcase-3.25.8/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/ITBidiStreaming.java @@ -0,0 +1,107 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.it; + +import static com.google.common.truth.Truth.assertThat; + +import com.google.api.core.SettableApiFuture; +import com.google.api.gax.rpc.ClientStream; +import com.google.api.gax.rpc.ResponseObserver; +import com.google.api.gax.rpc.StreamController; +import com.google.showcase.v1beta1.EchoClient; +import com.google.showcase.v1beta1.EchoRequest; +import com.google.showcase.v1beta1.EchoResponse; +import com.google.showcase.v1beta1.it.util.TestClientInitializer; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.util.concurrent.TimeUnit; +import org.junit.jupiter.api.AfterAll; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Test; + +class ITBidiStreaming { + + private static EchoClient grpcClient; + + @BeforeAll + static void createClients() throws Exception { + // Create gRPC Echo Client + grpcClient = TestClientInitializer.createGrpcEchoClient(); + } + + @AfterAll + static void destroyClients() throws Exception { + grpcClient.close(); + grpcClient.awaitTermination(TestClientInitializer.AWAIT_TERMINATION_SECONDS, TimeUnit.SECONDS); + } + + // The current implementation of BIDI streaming on Echo showcase server is that it would echo the + // request content back on every request, so this test verifies that the response content is + // exactly the same as request content. + // Ideally we should make the BIDI streaming server more generic, e.g. only respond when there are + // three requests, respond twice for every request etc. If that happens, the response content may + // not be exactly the same as request content. + @Test + void testGrpc_splitCall_shouldListensToResponse() throws Exception { + // given + List expected = Arrays.asList("The rain in Spain stays mainly on the plain".split(" ")); + TestResponseObserver responseObserver = new TestResponseObserver(); + + // when + ClientStream clientStream = grpcClient.chatCallable().splitCall(responseObserver); + expected.forEach( + requestContent -> { + EchoRequest request = EchoRequest.newBuilder().setContent(requestContent).build(); + clientStream.send(request); + }); + clientStream.closeSend(); + + // then + List actual = responseObserver.getFuture().get(); + assertThat(actual).containsExactlyElementsIn(expected).inOrder(); + } + + private static class TestResponseObserver implements ResponseObserver { + private final List responses = new ArrayList<>(); + private final SettableApiFuture> future = SettableApiFuture.create(); + + @Override + public void onStart(StreamController controller) { + // no-op + } + + @Override + public void onResponse(EchoResponse response) { + responses.add(response.getContent()); + } + + @Override + public void onError(Throwable t) { + // no-op + } + + @Override + public void onComplete() { + future.set(responses); + } + + public SettableApiFuture> getFuture() { + return future; + } + } +} diff --git a/java-showcase-3.25.8/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/ITClientShutdown.java b/java-showcase-3.25.8/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/ITClientShutdown.java new file mode 100644 index 0000000000..e55ee8d1ed --- /dev/null +++ b/java-showcase-3.25.8/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/ITClientShutdown.java @@ -0,0 +1,163 @@ +/* + * 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 + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.showcase.v1beta1.it; + +import com.google.api.gax.retrying.RetrySettings; +import com.google.api.gax.rpc.StatusCode; +import com.google.common.collect.ImmutableSet; +import com.google.common.truth.Truth; +import com.google.showcase.v1beta1.BlockRequest; +import com.google.showcase.v1beta1.BlockResponse; +import com.google.showcase.v1beta1.EchoClient; +import com.google.showcase.v1beta1.EchoRequest; +import com.google.showcase.v1beta1.it.util.TestClientInitializer; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.Timeout; +import org.threeten.bp.Duration; + +class ITClientShutdown { + + private static final long DEFAULT_RPC_TIMEOUT_MS = 15000L; + private static final long DEFAULT_CLIENT_TERMINATION_MS = 5000L; + + // Test to ensure the client can close + terminate properly + @Test + @Timeout(15) + void testGrpc_closeClient() throws Exception { + EchoClient grpcClient = TestClientInitializer.createGrpcEchoClient(); + assertClientTerminated(grpcClient); + } + + // Test to ensure the client can close + terminate properly + @Test + @Timeout(15) + void testHttpJson_closeClient() throws Exception { + EchoClient httpjsonClient = TestClientInitializer.createHttpJsonEchoClient(); + assertClientTerminated(httpjsonClient); + } + + // Test to ensure the client can close + terminate after a quick RPC invocation + @Test + @Timeout(15) + void testGrpc_rpcInvoked_closeClient() throws Exception { + EchoClient grpcClient = TestClientInitializer.createGrpcEchoClient(); + // Response is ignored for this test + grpcClient.echo(EchoRequest.newBuilder().setContent("Test").build()); + assertClientTerminated(grpcClient); + } + + // Test to ensure the client can close + terminate after a quick RPC invocation + @Test + @Timeout(15) + void testHttpJson_rpcInvoked_closeClient() throws Exception { + EchoClient httpjsonClient = TestClientInitializer.createHttpJsonEchoClient(); + // Response is ignored for this test + httpjsonClient.echo(EchoRequest.newBuilder().setContent("Test").build()); + assertClientTerminated(httpjsonClient); + } + + // This test is to ensure that the client is able to close + terminate any resources + // once a response has been received. Set a max test duration of 15s to ensure that + // the test does not continue on forever. + @Test + @Timeout(15) + void testGrpc_rpcInvokedWithLargeTimeout_closeClientOnceResponseReceived() throws Exception { + // Set the maxAttempts to 1 to ensure there are no retries scheduled. The single RPC + // invocation should time out in 15s, but the client will receive a response in 2s. + // Any outstanding tasks (timeout tasks) should be cancelled once a response has been + // received so the client can properly terminate. + RetrySettings defaultRetrySettings = + RetrySettings.newBuilder() + .setInitialRpcTimeout(Duration.ofMillis(DEFAULT_RPC_TIMEOUT_MS)) + .setMaxRpcTimeout(Duration.ofMillis(DEFAULT_RPC_TIMEOUT_MS)) + .setTotalTimeout(Duration.ofMillis(DEFAULT_RPC_TIMEOUT_MS)) + .setMaxAttempts(1) + .build(); + EchoClient grpcClient = + TestClientInitializer.createGrpcEchoClientCustomBlockSettings( + defaultRetrySettings, ImmutableSet.of(StatusCode.Code.DEADLINE_EXCEEDED)); + + BlockRequest blockRequest = + BlockRequest.newBuilder() + .setSuccess(BlockResponse.newBuilder().setContent("gRPCBlockContent_2sDelay")) + .setResponseDelay(com.google.protobuf.Duration.newBuilder().setSeconds(2).build()) + .build(); + + // Response is ignored for this test + grpcClient.block(blockRequest); + + assertClientTerminated(grpcClient); + } + + // This test is to ensure that the client is able to close + terminate any resources + // once a response has been received. Set a max test duration of 15s to ensure that + // the test does not continue on forever. + @Test + @Timeout(15) + void testHttpJson_rpcInvokedWithLargeTimeout_closeClientOnceResponseReceived() throws Exception { + // Set the maxAttempts to 1 to ensure there are no retries scheduled. The single RPC + // invocation should time out in 15s, but the client will receive a response in 2s. + // Any outstanding tasks (timeout tasks) should be cancelled once a response has been + // received so the client can properly terminate. + RetrySettings defaultRetrySettings = + RetrySettings.newBuilder() + .setInitialRpcTimeout(Duration.ofMillis(DEFAULT_RPC_TIMEOUT_MS)) + .setMaxRpcTimeout(Duration.ofMillis(DEFAULT_RPC_TIMEOUT_MS)) + .setTotalTimeout(Duration.ofMillis(DEFAULT_RPC_TIMEOUT_MS)) + .setMaxAttempts(1) + .build(); + EchoClient httpjsonClient = + TestClientInitializer.createHttpJsonEchoClientCustomBlockSettings( + defaultRetrySettings, ImmutableSet.of(StatusCode.Code.DEADLINE_EXCEEDED)); + + BlockRequest blockRequest = + BlockRequest.newBuilder() + .setSuccess(BlockResponse.newBuilder().setContent("httpjsonBlockContent_2sDelay")) + .setResponseDelay(com.google.protobuf.Duration.newBuilder().setSeconds(2).build()) + .build(); + + // Response is ignored for this test + httpjsonClient.block(blockRequest); + + assertClientTerminated(httpjsonClient); + } + + // This helper method asserts that the client is able to terminate within + // `AWAIT_TERMINATION_SECONDS` + private void assertClientTerminated(EchoClient echoClient) throws InterruptedException { + long start = System.currentTimeMillis(); + // Intentionally do not run echoClient.awaitTermination(...) as this test will + // check that everything is properly terminated after close() is called. + echoClient.close(); + + // Loop until the client has terminated successfully. For tests that use this, + // try to ensure there is a timeout associated, otherwise this may run forever. + // Future enhancement: Use awaitility instead of busy waiting + while (!echoClient.isTerminated()) { + Thread.sleep(500L); + } + // The busy-wait time won't be accurate, so account for a bit of buffer + long end = System.currentTimeMillis(); + + Truth.assertThat(echoClient.isShutdown()).isTrue(); + + // Check the termination time. If all the tasks/ resources are closed successfully, + // the termination time should only occur shortly after `close()` was invoked. The + // `DEFAULT_TERMINATION_MS` value should include a bit of buffer. + long terminationTime = end - start; + Truth.assertThat(terminationTime).isLessThan(DEFAULT_CLIENT_TERMINATION_MS); + } +} diff --git a/java-showcase-3.25.8/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/ITClientSideStreaming.java b/java-showcase-3.25.8/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/ITClientSideStreaming.java new file mode 100644 index 0000000000..61b507f49a --- /dev/null +++ b/java-showcase-3.25.8/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/ITClientSideStreaming.java @@ -0,0 +1,123 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.it; + +import static com.google.common.truth.Truth.assertThat; +import static org.junit.jupiter.api.Assertions.assertThrows; + +import com.google.api.core.SettableApiFuture; +import com.google.api.gax.rpc.ApiStreamObserver; +import com.google.api.gax.rpc.CancelledException; +import com.google.api.gax.rpc.StatusCode; +import com.google.rpc.Status; +import com.google.showcase.v1beta1.EchoClient; +import com.google.showcase.v1beta1.EchoRequest; +import com.google.showcase.v1beta1.EchoResponse; +import com.google.showcase.v1beta1.it.util.TestClientInitializer; +import java.util.ArrayList; +import java.util.List; +import java.util.concurrent.ExecutionException; +import java.util.concurrent.TimeUnit; +import org.junit.jupiter.api.AfterAll; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Test; + +class ITClientSideStreaming { + + private static EchoClient grpcClient; + + @BeforeAll + static void createClients() throws Exception { + // Create gRPC Echo Client + grpcClient = TestClientInitializer.createGrpcEchoClient(); + } + + @AfterAll + static void destroyClients() throws InterruptedException { + grpcClient.close(); + grpcClient.awaitTermination(TestClientInitializer.AWAIT_TERMINATION_SECONDS, TimeUnit.SECONDS); + } + + @Test + void testGrpc_sendStreamedContent_receiveConcatenatedResponse() + throws ExecutionException, InterruptedException { + CollectStreamObserver responseObserver = new CollectStreamObserver<>(); + ApiStreamObserver requestObserver = + grpcClient.collectCallable().clientStreamingCall(responseObserver); + String content = "The rain in Spain stays mainly on the plain"; + for (String message : content.split("\\s")) { + requestObserver.onNext(EchoRequest.newBuilder().setContent(message).build()); + } + requestObserver.onCompleted(); + + List serverResponse = responseObserver.future().get(); + assertThat(serverResponse).hasSize(1); + assertThat(serverResponse.get(0).getContent()) + .isEqualTo("The rain in Spain stays mainly on the plain"); + } + + @Test + void testGrpc_sendStreamedContent_handleServerError() { + CollectStreamObserver responseObserver = new CollectStreamObserver<>(); + ApiStreamObserver requestObserver = + grpcClient.collectCallable().clientStreamingCall(responseObserver); + String content = "The rain in Spain stays mainly on the plain"; + for (String message : content.split("\\s")) { + requestObserver.onNext(EchoRequest.newBuilder().setContent(message).build()); + } + Status cancelledStatus = + Status.newBuilder().setCode(StatusCode.Code.CANCELLED.ordinal()).build(); + requestObserver.onNext(EchoRequest.newBuilder().setError(cancelledStatus).build()); + requestObserver.onCompleted(); + + ExecutionException exception = + assertThrows(ExecutionException.class, () -> responseObserver.future().get()); + assertThat(exception.getCause()).isInstanceOf(CancelledException.class); + CancelledException cancelledException = (CancelledException) exception.getCause(); + assertThat(cancelledException.getStatusCode().getCode()).isEqualTo(StatusCode.Code.CANCELLED); + } + + /** + * Implementation of {@link ApiStreamObserver} to accumulate streamed content. + * + * @param + */ + private class CollectStreamObserver implements ApiStreamObserver { + + private final SettableApiFuture> future = SettableApiFuture.create(); + private final List messages = new ArrayList<>(); + + @Override + public void onNext(T message) { + this.messages.add(message); + } + + @Override + public void onError(Throwable throwable) { + this.future.setException(throwable); + } + + @Override + public void onCompleted() { + future.set(this.messages); + } + + public SettableApiFuture> future() { + return this.future; + } + } +} diff --git a/java-showcase-3.25.8/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/ITCommonServiceMixins.java b/java-showcase-3.25.8/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/ITCommonServiceMixins.java new file mode 100644 index 0000000000..a64f95a258 --- /dev/null +++ b/java-showcase-3.25.8/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/ITCommonServiceMixins.java @@ -0,0 +1,133 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.it; + +import static com.google.common.truth.Truth.assertThat; + +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.Location; +import com.google.common.collect.ImmutableList; +import com.google.showcase.v1beta1.EchoClient; +import com.google.showcase.v1beta1.it.util.TestClientInitializer; +import java.util.ArrayList; +import java.util.List; +import java.util.concurrent.TimeUnit; +import org.junit.jupiter.api.AfterAll; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Test; + +class ITCommonServiceMixins { + + // The showcase server always returns a fixed list of locations. See + // https://github.com/googleapis/gapic-showcase/blob/main/server/services/locations_service.go + private static final List EXPECTED_LOCATIONS = + ImmutableList.of( + Location.newBuilder() + .setName("projects/showcase/locations/us-north") + .setDisplayName("us-north") + .build(), + Location.newBuilder() + .setName("projects/showcase/locations/us-south") + .setDisplayName("us-south") + .build(), + Location.newBuilder() + .setName("projects/showcase/locations/us-east") + .setDisplayName("us-east") + .build(), + Location.newBuilder() + .setName("projects/showcase/locations/us-west") + .setDisplayName("us-west") + .build()); + private static EchoClient grpcClient; + private static EchoClient httpjsonClient; + + @BeforeAll + static void createClients() throws Exception { + // Create gRPC Echo Client + grpcClient = TestClientInitializer.createGrpcEchoClient(); + + // Create HttpJson Echo Client + httpjsonClient = TestClientInitializer.createHttpJsonEchoClient(); + } + + @AfterAll + static void destroyClients() throws InterruptedException { + grpcClient.close(); + httpjsonClient.close(); + + grpcClient.awaitTermination(TestClientInitializer.AWAIT_TERMINATION_SECONDS, TimeUnit.SECONDS); + httpjsonClient.awaitTermination( + TestClientInitializer.AWAIT_TERMINATION_SECONDS, TimeUnit.SECONDS); + } + + @Test + void testGrpc_getLocation() { + GetLocationRequest request = + GetLocationRequest.newBuilder().setName("projects/showcase/location/us-central1").build(); + Location location = grpcClient.getLocation(request); + assertThat(location) + .isEqualTo( + Location.newBuilder() + .setName("projects/showcase/location/us-central1") + .setDisplayName("us-central1") + .build()); + } + + @Test + void testGrpc_listLocations() { + ListLocationsRequest request = + ListLocationsRequest.newBuilder().setName("projects/showcase").build(); + EchoClient.ListLocationsPagedResponse locationsPagedResponse = + grpcClient.listLocations(request); + + List actualLocations = new ArrayList<>(); + for (Location location : locationsPagedResponse.iterateAll()) { + actualLocations.add(location); + } + + assertThat(actualLocations).containsExactlyElementsIn(EXPECTED_LOCATIONS).inOrder(); + } + + @Test + void testHttpJson_getLocation() { + GetLocationRequest request = + GetLocationRequest.newBuilder().setName("projects/showcase/locations/us-central1").build(); + Location location = httpjsonClient.getLocation(request); + assertThat(location) + .isEqualTo( + Location.newBuilder() + .setName("projects/showcase/locations/us-central1") + .setDisplayName("us-central1") + .build()); + } + + @Test + void testHttpJson_listLocations() { + ListLocationsRequest request = + ListLocationsRequest.newBuilder().setName("projects/showcase").build(); + EchoClient.ListLocationsPagedResponse locationsPagedResponse = + httpjsonClient.listLocations(request); + + List actualLocations = new ArrayList<>(); + for (Location location : locationsPagedResponse.iterateAll()) { + actualLocations.add(location); + } + + assertThat(actualLocations).containsExactlyElementsIn(EXPECTED_LOCATIONS).inOrder(); + } +} diff --git a/java-showcase-3.25.8/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/ITCrud.java b/java-showcase-3.25.8/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/ITCrud.java new file mode 100644 index 0000000000..bfb9e335e5 --- /dev/null +++ b/java-showcase-3.25.8/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/ITCrud.java @@ -0,0 +1,189 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.showcase.v1beta1.it; + +import static com.google.common.truth.Truth.assertThat; + +import com.google.common.collect.ImmutableList; +import com.google.protobuf.FieldMask; +import com.google.showcase.v1beta1.CreateUserRequest; +import com.google.showcase.v1beta1.DeleteUserRequest; +import com.google.showcase.v1beta1.IdentityClient; +import com.google.showcase.v1beta1.ListUsersRequest; +import com.google.showcase.v1beta1.ListUsersResponse; +import com.google.showcase.v1beta1.UpdateUserRequest; +import com.google.showcase.v1beta1.User; +import com.google.showcase.v1beta1.it.util.TestClientInitializer; +import java.util.Arrays; +import java.util.List; +import java.util.concurrent.TimeUnit; +import org.junit.jupiter.api.AfterAll; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; + +class ITCrud { + + private static final User DEFAULT_USER = + User.newBuilder() + .setDisplayName("Jane Doe") + .setEmail("janedoe@example.com") + .setNickname("Doe") + .setHeightFeet(5) + .setAge(25) + .build(); + + private static IdentityClient grpcClient; + private static IdentityClient httpjsonClient; + + @BeforeAll + public static void createClients() throws Exception { + // Create gRPC IdentityClient + grpcClient = TestClientInitializer.createGrpcIdentityClient(); + // Create HttpJson IdentityClient + httpjsonClient = TestClientInitializer.createHttpJsonIdentityClient(); + } + + @AfterAll + public static void destroyClients() throws InterruptedException { + grpcClient.close(); + httpjsonClient.close(); + + grpcClient.awaitTermination(TestClientInitializer.AWAIT_TERMINATION_SECONDS, TimeUnit.SECONDS); + httpjsonClient.awaitTermination( + TestClientInitializer.AWAIT_TERMINATION_SECONDS, TimeUnit.SECONDS); + } + + @BeforeEach + void cleanupData() { + IdentityClient.ListUsersPagedResponse pagedResponse = + grpcClient.listUsers(ListUsersRequest.newBuilder().setPageSize(5).build()); + for (IdentityClient.ListUsersPage listUsersPage : pagedResponse.iteratePages()) { + for (User user : listUsersPage.getResponse().getUsersList()) { + grpcClient.deleteUser(user.getName()); + } + } + pagedResponse = httpjsonClient.listUsers(ListUsersRequest.newBuilder().setPageSize(5).build()); + assertThat(pagedResponse.getPage().getResponse().getUsersList().size()).isEqualTo(0); + } + + @Test + void testHttpJson_Create() { + User userResponse = createDefaultUser(); + + // These properties should be the same + assertThat(userResponse.getDisplayName()).isEqualTo(DEFAULT_USER.getDisplayName()); + assertThat(userResponse.getEmail()).isEqualTo(DEFAULT_USER.getEmail()); + assertThat(userResponse.getNickname()).isEqualTo(DEFAULT_USER.getNickname()); + assertThat(userResponse.getHeightFeet()).isEqualTo(DEFAULT_USER.getHeightFeet()); + assertThat(userResponse.getAge()).isEqualTo(DEFAULT_USER.getAge()); + + // Assert that the server populates these fields + assertThat(userResponse.getName()).isNotEmpty(); + assertThat(userResponse.getCreateTime()).isNotNull(); + assertThat(userResponse.getUpdateTime()).isNotNull(); + assertThat(userResponse.getEnableNotifications()).isNotNull(); + } + + @Test + void testHttpJson_Read() { + List expectedUsersList = + ImmutableList.of( + createDefaultUser(), + createUser( + DEFAULT_USER.toBuilder() + .setNickname("John Smith") + .setEmail("johnsmith@example.com") + .build())); + // Assert that only one User exists + IdentityClient.ListUsersPagedResponse listUsersPagedResponse = + httpjsonClient.listUsers(ListUsersRequest.newBuilder().setPageSize(5).build()); + ListUsersResponse listUsersResponse = listUsersPagedResponse.getPage().getResponse(); + assertThat(listUsersResponse.getUsersList().size()).isEqualTo(2); + + // Check that the response from both List (pagination) and Get + // List Users + assertThat(listUsersResponse.getUsersList()).containsExactlyElementsIn(expectedUsersList); + + // Get User + User defaultUser = expectedUsersList.get(0); + User getUserResponse = httpjsonClient.getUser(defaultUser.getName()); + assertThat(getUserResponse).isEqualTo(defaultUser); + } + + @Test + void testHttpJson_Update() { + User userResponse = createDefaultUser(); + // Update multiple fields in the User. Age + Nickname are not included in the FieldMask + // userResponse's enableNotifications field is populated from the server + User updateUser = + userResponse.toBuilder() + .setAge(50) + .setNickname("Smith") + .setEmail("janedoe@jane.com") + .setHeightFeet(6.0) + .setEnableNotifications(true) + .build(); + User updateUserResponse = + httpjsonClient.updateUser( + UpdateUserRequest.newBuilder() + .setUser(updateUser) + .setUpdateMask( + FieldMask.newBuilder() + .addAllPaths(Arrays.asList("email", "height_feet", "enable_notifications")) + .build()) + .build()); + + // Assert that only the fields in the FieldMask are updated correctly + assertThat(updateUserResponse).isNotEqualTo(userResponse); + assertThat(updateUserResponse.getAge()).isEqualTo(userResponse.getAge()); + assertThat(updateUserResponse.getNickname()).isEqualTo(userResponse.getNickname()); + + assertThat(updateUserResponse.getEmail()).isEqualTo(updateUser.getEmail()); + assertThat(updateUserResponse.getHeightFeet()).isEqualTo(updateUser.getHeightFeet()); + assertThat(updateUserResponse.getEnableNotifications()) + .isEqualTo(updateUser.getEnableNotifications()); + } + + @Test + void testHttpJson_Delete() { + User userResponse = createDefaultUser(); + + httpjsonClient.deleteUser( + DeleteUserRequest.newBuilder().setName(userResponse.getName()).build()); + + IdentityClient.ListUsersPagedResponse listUsersPagedResponse = + httpjsonClient.listUsers(ListUsersRequest.newBuilder().setPageSize(5).build()); + assertThat(listUsersPagedResponse.getPage().getResponse().getUsersList().size()).isEqualTo(0); + } + + private User createDefaultUser() { + return createUser(DEFAULT_USER); + } + + /** + * Helper method to create a user with the DEFAULT_USER configs. Server returns a generated name + * (not username) that is used to identify the individual user and each test uses the name for the + * RPC. Server also populates a few additional fields (Create Time, Updated Time, and Enable + * Notifications). + * + * @param user User to be created + * @return newly created user + */ + private User createUser(User user) { + return httpjsonClient.createUser(CreateUserRequest.newBuilder().setUser(user).build()); + } +} diff --git a/java-showcase-3.25.8/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/ITDynamicRoutingHeaders.java b/java-showcase-3.25.8/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/ITDynamicRoutingHeaders.java new file mode 100644 index 0000000000..7828da8b53 --- /dev/null +++ b/java-showcase-3.25.8/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/ITDynamicRoutingHeaders.java @@ -0,0 +1,400 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.showcase.v1beta1.it; + +import static com.google.api.gax.rpc.internal.Headers.DYNAMIC_ROUTING_HEADER_KEY; +import static com.google.common.truth.Truth.assertThat; + +import com.google.api.gax.httpjson.ApiMethodDescriptor; +import com.google.api.gax.httpjson.ForwardingHttpJsonClientCall; +import com.google.api.gax.httpjson.ForwardingHttpJsonClientCallListener; +import com.google.api.gax.httpjson.HttpJsonCallOptions; +import com.google.api.gax.httpjson.HttpJsonChannel; +import com.google.api.gax.httpjson.HttpJsonClientCall; +import com.google.api.gax.httpjson.HttpJsonClientInterceptor; +import com.google.api.gax.httpjson.HttpJsonMetadata; +import com.google.common.collect.ImmutableList; +import com.google.showcase.v1beta1.ComplianceClient; +import com.google.showcase.v1beta1.ComplianceData; +import com.google.showcase.v1beta1.EchoClient; +import com.google.showcase.v1beta1.EchoRequest; +import com.google.showcase.v1beta1.RepeatRequest; +import com.google.showcase.v1beta1.RepeatResponse; +import com.google.showcase.v1beta1.it.util.TestClientInitializer; +import io.grpc.CallOptions; +import io.grpc.Channel; +import io.grpc.ClientCall; +import io.grpc.ClientInterceptor; +import io.grpc.ForwardingClientCall; +import io.grpc.Metadata; +import io.grpc.MethodDescriptor; +import java.util.Arrays; +import java.util.List; +import java.util.concurrent.TimeUnit; +import java.util.stream.Collectors; +import org.junit.jupiter.api.AfterAll; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; + +class ITDynamicRoutingHeaders { + private static final String SPLIT_TOKEN = "&"; + private static final Metadata.Key REQUEST_PARAMS_HEADER_KEY = + Metadata.Key.of(DYNAMIC_ROUTING_HEADER_KEY, Metadata.ASCII_STRING_MARSHALLER); + + // Implement a request interceptor to retrieve the headers being sent on the request. + // The headers being set are part of the Metadata + private static class GrpcCapturingClientInterceptor implements ClientInterceptor { + private Metadata metadata; + + @Override + public ClientCall interceptCall( + MethodDescriptor method, final CallOptions callOptions, Channel next) { + ClientCall call = next.newCall(method, callOptions); + return new ForwardingClientCall.SimpleForwardingClientCall(call) { + @Override + public void start(ClientCall.Listener responseListener, Metadata headers) { + metadata = headers; + super.start(responseListener, headers); + } + }; + } + } + + // Implement a request interceptor to retrieve the headers being sent on the request + // The headers being set are part of the CallOptions + private static class HttpJsonCapturingClientInterceptor implements HttpJsonClientInterceptor { + private String requestParam; + + @Override + public HttpJsonClientCall interceptCall( + ApiMethodDescriptor method, + HttpJsonCallOptions callOptions, + HttpJsonChannel next) { + HttpJsonClientCall call = next.newCall(method, callOptions); + return new ForwardingHttpJsonClientCall.SimpleForwardingHttpJsonClientCall< + RequestT, ResponseT>(call) { + @Override + public void start(Listener responseListener, HttpJsonMetadata requestHeaders) { + Listener forwardingResponseListener = + new ForwardingHttpJsonClientCallListener.SimpleForwardingHttpJsonClientCallListener< + ResponseT>(responseListener) { + @Override + public void onHeaders(HttpJsonMetadata responseHeaders) { + super.onHeaders(responseHeaders); + } + + @Override + public void onMessage(ResponseT message) { + super.onMessage(message); + } + + @Override + public void onClose(int statusCode, HttpJsonMetadata trailers) { + super.onClose(statusCode, trailers); + } + }; + + super.start(forwardingResponseListener, requestHeaders); + if (requestHeaders.getHeaders().containsKey(DYNAMIC_ROUTING_HEADER_KEY)) { + requestParam = + String.valueOf(requestHeaders.getHeaders().get(DYNAMIC_ROUTING_HEADER_KEY)); + } + } + }; + } + } + + private static HttpJsonCapturingClientInterceptor httpJsonInterceptor; + private static HttpJsonCapturingClientInterceptor httpJsonComplianceInterceptor; + private static GrpcCapturingClientInterceptor grpcInterceptor; + private static GrpcCapturingClientInterceptor grpcComplianceInterceptor; + + private static EchoClient grpcClient; + private static EchoClient httpJsonClient; + private static ComplianceClient grpcComplianceClient; + private static ComplianceClient httpJsonComplianceClient; + + @BeforeAll + static void createClients() throws Exception { + // Create gRPC Interceptor and Client + grpcInterceptor = new GrpcCapturingClientInterceptor(); + grpcClient = TestClientInitializer.createGrpcEchoClient(ImmutableList.of(grpcInterceptor)); + + // Create gRPC ComplianceClient and Interceptor + // Creating a compliance client because echo client doesn't have an implicit enum routing test + // case + grpcComplianceInterceptor = new GrpcCapturingClientInterceptor(); + grpcComplianceClient = + TestClientInitializer.createGrpcComplianceClient( + ImmutableList.of(grpcComplianceInterceptor)); + + // Create HttpJson ComplianceClient and Interceptor + httpJsonComplianceInterceptor = new HttpJsonCapturingClientInterceptor(); + httpJsonComplianceClient = + TestClientInitializer.createHttpJsonComplianceClient( + ImmutableList.of(httpJsonComplianceInterceptor)); + + // Create HttpJson Interceptor and Client + httpJsonInterceptor = new HttpJsonCapturingClientInterceptor(); + httpJsonClient = + TestClientInitializer.createHttpJsonEchoClient(ImmutableList.of(httpJsonInterceptor)); + } + + @BeforeEach + void cleanUpParams() { + grpcInterceptor.metadata = null; + grpcComplianceInterceptor.metadata = null; + httpJsonInterceptor.requestParam = null; + httpJsonComplianceInterceptor.requestParam = null; + } + + @AfterAll + static void destroyClient() throws InterruptedException { + grpcClient.close(); + grpcComplianceClient.close(); + + httpJsonClient.close(); + httpJsonComplianceClient.close(); + + grpcClient.awaitTermination(TestClientInitializer.AWAIT_TERMINATION_SECONDS, TimeUnit.SECONDS); + grpcComplianceClient.awaitTermination( + TestClientInitializer.AWAIT_TERMINATION_SECONDS, TimeUnit.SECONDS); + + httpJsonClient.awaitTermination( + TestClientInitializer.AWAIT_TERMINATION_SECONDS, TimeUnit.SECONDS); + httpJsonComplianceClient.awaitTermination( + TestClientInitializer.AWAIT_TERMINATION_SECONDS, TimeUnit.SECONDS); + } + + @Test + void testGrpc_noRoutingHeaderUsed() { + grpcClient.echo(EchoRequest.newBuilder().build()); + String headerValue = grpcInterceptor.metadata.get(REQUEST_PARAMS_HEADER_KEY); + assertThat(headerValue).isNull(); + } + + @Test + void testHttpJson_noRoutingHeaderUsed() { + httpJsonClient.echo(EchoRequest.newBuilder().build()); + String headerValue = httpJsonInterceptor.requestParam; + assertThat(headerValue).isNull(); + } + + @Test + void testGrpc_emptyHeader() { + grpcClient.echo(EchoRequest.newBuilder().setHeader("").build()); + String headerValue = grpcInterceptor.metadata.get(REQUEST_PARAMS_HEADER_KEY); + assertThat(headerValue).isNull(); + } + + @Test + void testHttpJson_emptyHeader() { + httpJsonClient.echo(EchoRequest.newBuilder().setHeader("").build()); + String headerValue = httpJsonInterceptor.requestParam; + assertThat(headerValue).isNull(); + } + + @Test + void testGrpc_matchesHeaderName() { + grpcClient.echo(EchoRequest.newBuilder().setHeader("potato").build()); + String headerValue = grpcInterceptor.metadata.get(REQUEST_PARAMS_HEADER_KEY); + assertThat(headerValue).isNotNull(); + List requestHeaders = + Arrays.stream(headerValue.split(SPLIT_TOKEN)).collect(Collectors.toList()); + List expectedHeaders = ImmutableList.of("header=potato", "routing_id=potato"); + assertThat(requestHeaders).containsExactlyElementsIn(expectedHeaders); + } + + @Test + void testGrpc_implicitHeaders_enumsEncodedasInt() { + RepeatRequest request = + RepeatRequest.newBuilder().setInfo(ComplianceData.newBuilder().setFKingdomValue(5)).build(); + RepeatResponse actualResponse = grpcComplianceClient.repeatDataSimplePath(request); + String headerValue = grpcComplianceInterceptor.metadata.get(REQUEST_PARAMS_HEADER_KEY); + assertThat(headerValue).isNotNull(); + List requestHeaders = + Arrays.stream(headerValue.split(SPLIT_TOKEN)).collect(Collectors.toList()); + // fields beside "info.f_kingdom" are default values (false, 0.0, 0) since we are not setting + // them in the request message. + List expectedHeaders = + ImmutableList.of( + "info.f_bool=false", "info.f_double=0.0", "info.f_int32=0", "info.f_kingdom=5"); + assertThat(requestHeaders).containsExactlyElementsIn(expectedHeaders); + } + + @Test + void testHttpJson_implicitHeaders_enumsEncodedasInt() { + RepeatRequest request = + RepeatRequest.newBuilder() + .setInfo( + ComplianceData.newBuilder() + .setFString("test") + .setFInt32(1) + .setFDouble(2) + .setFBool(true) + .setFKingdomValue(3)) + .build(); + RepeatResponse actualResponse = httpJsonComplianceClient.repeatDataSimplePath(request); + String headerValue = httpJsonComplianceInterceptor.requestParam; + assertThat(headerValue).isNotNull(); + List requestHeaders = + Arrays.stream(headerValue.split(SPLIT_TOKEN)).collect(Collectors.toList()); + // In this case, we are setting the values explicitly. + List expectedHeaders = + ImmutableList.of( + "info.f_bool=true", + "info.f_double=2.0", + "info.f_int32=1", + "info.f_kingdom=3", + "info.f_string=test"); + assertThat(requestHeaders).containsExactlyElementsIn(expectedHeaders); + } + + @Test + void testHttpJson_matchesHeaderName() { + httpJsonClient.echo(EchoRequest.newBuilder().setHeader("potato").build()); + String headerValue = httpJsonInterceptor.requestParam; + assertThat(headerValue).isNotNull(); + List requestHeaders = + Arrays.stream(headerValue.split(SPLIT_TOKEN)).collect(Collectors.toList()); + List expectedHeaders = ImmutableList.of("header=potato", "routing_id=potato"); + assertThat(requestHeaders).containsExactlyElementsIn(expectedHeaders); + } + + @Test + void testGrpc_matchesOtherHeaderName() { + grpcClient.echo(EchoRequest.newBuilder().setOtherHeader("instances/456").build()); + String headerValue = grpcInterceptor.metadata.get(REQUEST_PARAMS_HEADER_KEY); + assertThat(headerValue).isNotNull(); + List requestHeaders = + Arrays.stream(headerValue.split(SPLIT_TOKEN)).collect(Collectors.toList()); + List expectedHeaders = ImmutableList.of("baz=instances%2F456"); + assertThat(requestHeaders).containsExactlyElementsIn(expectedHeaders); + } + + @Test + void testHttpJson_matchesOtherHeaderName() { + httpJsonClient.echo(EchoRequest.newBuilder().setOtherHeader("instances/456").build()); + String headerValue = httpJsonInterceptor.requestParam; + assertThat(headerValue).isNotNull(); + List requestHeaders = + Arrays.stream(headerValue.split(SPLIT_TOKEN)).collect(Collectors.toList()); + List expectedHeaders = ImmutableList.of("baz=instances%2F456"); + assertThat(requestHeaders).containsExactlyElementsIn(expectedHeaders); + } + + @Test + void testGrpc_matchesMultipleOfSameRoutingHeader_usesHeader() { + grpcClient.echo(EchoRequest.newBuilder().setHeader("projects/123/instances/456").build()); + String headerValue = grpcInterceptor.metadata.get(REQUEST_PARAMS_HEADER_KEY); + assertThat(headerValue).isNotNull(); + List requestHeaders = + Arrays.stream(headerValue.split(SPLIT_TOKEN)).collect(Collectors.toList()); + List expectedHeaders = + ImmutableList.of( + "header=projects%2F123%2Finstances%2F456", + "routing_id=projects%2F123%2Finstances%2F456", + "super_id=projects%2F123", + "table_name=projects%2F123%2Finstances%2F456", + "instance_id=instances%2F456"); + assertThat(requestHeaders).containsExactlyElementsIn(expectedHeaders); + } + + @Test + void testHttpJson_matchesMultipleOfSameRoutingHeader_usesHeader() { + httpJsonClient.echo(EchoRequest.newBuilder().setHeader("projects/123/instances/456").build()); + String headerValue = httpJsonInterceptor.requestParam; + assertThat(headerValue).isNotNull(); + List requestHeaders = + Arrays.stream(headerValue.split(SPLIT_TOKEN)).collect(Collectors.toList()); + List expectedHeaders = + ImmutableList.of( + "header=projects%2F123%2Finstances%2F456", + "routing_id=projects%2F123%2Finstances%2F456", + "super_id=projects%2F123", + "table_name=projects%2F123%2Finstances%2F456", + "instance_id=instances%2F456"); + assertThat(requestHeaders).containsExactlyElementsIn(expectedHeaders).inOrder(); + } + + @Test + void testGrpc_matchesMultipleOfSameRoutingHeader_usesOtherHeader() { + grpcClient.echo(EchoRequest.newBuilder().setOtherHeader("projects/123/instances/456").build()); + String headerValue = grpcInterceptor.metadata.get(REQUEST_PARAMS_HEADER_KEY); + assertThat(headerValue).isNotNull(); + List requestHeaders = + Arrays.stream(headerValue.split(SPLIT_TOKEN)).collect(Collectors.toList()); + List expectedHeaders = + ImmutableList.of("baz=projects%2F123%2Finstances%2F456", "qux=projects%2F123"); + assertThat(requestHeaders).containsExactlyElementsIn(expectedHeaders); + } + + @Test + void testHttpJson_matchesMultipleOfSameRoutingHeader_usesOtherHeader() { + httpJsonClient.echo( + EchoRequest.newBuilder().setOtherHeader("projects/123/instances/456").build()); + String headerValue = httpJsonInterceptor.requestParam; + assertThat(headerValue).isNotNull(); + List requestHeaders = + Arrays.stream(headerValue.split(SPLIT_TOKEN)).collect(Collectors.toList()); + List expectedHeaders = + ImmutableList.of("baz=projects%2F123%2Finstances%2F456", "qux=projects%2F123"); + assertThat(requestHeaders).containsExactlyElementsIn(expectedHeaders); + } + + @Test + void testGrpc_matchesMultipleRoutingHeaders() { + grpcClient.echo( + EchoRequest.newBuilder() + .setHeader("regions/123/zones/456") + .setOtherHeader("projects/123/instances/456") + .build()); + String headerValue = grpcInterceptor.metadata.get(REQUEST_PARAMS_HEADER_KEY); + assertThat(headerValue).isNotNull(); + List requestHeaders = + Arrays.stream(headerValue.split(SPLIT_TOKEN)).collect(Collectors.toList()); + List expectedHeaders = + ImmutableList.of( + "baz=projects%2F123%2Finstances%2F456", + "qux=projects%2F123", + "table_name=regions%2F123%2Fzones%2F456", + "header=regions%2F123%2Fzones%2F456", + "routing_id=regions%2F123%2Fzones%2F456"); + assertThat(requestHeaders).containsExactlyElementsIn(expectedHeaders); + } + + @Test + void testHttpJson_matchesMultipleRoutingHeaders() { + httpJsonClient.echo( + EchoRequest.newBuilder() + .setHeader("regions/123/zones/456") + .setOtherHeader("projects/123/instances/456") + .build()); + String headerValue = httpJsonInterceptor.requestParam; + assertThat(headerValue).isNotNull(); + List requestHeaders = + Arrays.stream(headerValue.split(SPLIT_TOKEN)).collect(Collectors.toList()); + List expectedHeaders = + ImmutableList.of( + "baz=projects%2F123%2Finstances%2F456", + "qux=projects%2F123", + "table_name=regions%2F123%2Fzones%2F456", + "header=regions%2F123%2Fzones%2F456", + "routing_id=regions%2F123%2Fzones%2F456"); + assertThat(requestHeaders).containsExactlyElementsIn(expectedHeaders); + } +} diff --git a/java-showcase-3.25.8/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/ITEndpointContext.java b/java-showcase-3.25.8/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/ITEndpointContext.java new file mode 100644 index 0000000000..0f50051b68 --- /dev/null +++ b/java-showcase-3.25.8/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/ITEndpointContext.java @@ -0,0 +1,469 @@ +package com.google.showcase.v1beta1.it; + +import static org.junit.jupiter.api.Assertions.assertThrows; + +import com.google.api.gax.core.CredentialsProvider; +import com.google.api.gax.core.NoCredentialsProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.UnauthenticatedException; +import com.google.auth.Credentials; +import com.google.auth.oauth2.GoogleCredentials; +import com.google.common.truth.Truth; +import com.google.showcase.v1beta1.EchoClient; +import com.google.showcase.v1beta1.EchoRequest; +import com.google.showcase.v1beta1.EchoSettings; +import com.google.showcase.v1beta1.it.util.TestClientInitializer; +import com.google.showcase.v1beta1.stub.EchoStub; +import com.google.showcase.v1beta1.stub.EchoStubSettings; +import io.grpc.ManagedChannelBuilder; +import java.io.IOException; +import java.net.URI; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.concurrent.TimeUnit; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.Test; + +/** + * This IT tests the different user configurations allowed and their effects on endpoint and + * universe domain resolution. + * + *

        In these tests, the client is not initialized with the default configuration: + * `EchoClient.create()`. For showcase tests run in CI, the client must be supplied explicitly + * supplied with a Credentials value. The tests use a wrapped Credentials and Credentials Provider + * (UniverseDomainCredentials and UniverseDomainCredentialsProvider) which allow for testing this. + * + *

        Endpoint resolution has the same behavior for both gRPC and HttpJson. The showcase tests below + * only use the gRPC transport for testing. HttpJson functionality exists inside the wrapper + * classes, but is not being used. + */ +class ITEndpointContext { + /** + * Inside the test cases below, we must explicitly configure serviceName. Normally this should not + * be configured at all, but showcase clients do not have a serviceName. The ExtendStubSettings + * wrapper return the serviceName by overriding the `getServiceName()` result. + */ + private static class ExtendedEchoStubSettings extends EchoStubSettings { + + private static final String DUMMY_MTLS_ENDPOINT = "mtls.googleapis.com:443"; + + protected ExtendedEchoStubSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + } + + @Override + public String getServiceName() { + return "test"; + } + + public static ExtendedEchoStubSettings.Builder newBuilder() { + return ExtendedEchoStubSettings.Builder.createDefault(); + } + + public static ExtendedEchoStubSettings.Builder newHttpJsonBuilder() { + return ExtendedEchoStubSettings.Builder.createHttpJsonDefault(); + } + + public static class Builder extends EchoStubSettings.Builder { + + protected Builder(ClientContext clientContext) { + super(clientContext); + } + + private static ExtendedEchoStubSettings.Builder createDefault() { + Builder builder = new Builder(((ClientContext) null)); + builder.setTransportChannelProvider(defaultTransportChannelProvider()); + builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); + builder.setInternalHeaderProvider(defaultApiClientHeaderProviderBuilder().build()); + builder.setMtlsEndpoint(DUMMY_MTLS_ENDPOINT); + builder.setSwitchToMtlsEndpointAllowed(true); + return builder; + } + + private static ExtendedEchoStubSettings.Builder createHttpJsonDefault() { + Builder builder = new Builder(((ClientContext) null)); + builder.setTransportChannelProvider(defaultHttpJsonTransportProviderBuilder().build()); + builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); + builder.setInternalHeaderProvider(defaultApiClientHeaderProviderBuilder().build()); + builder.setMtlsEndpoint(DUMMY_MTLS_ENDPOINT); + builder.setSwitchToMtlsEndpointAllowed(true); + return builder; + } + + @Override + public ExtendedEchoStubSettings build() throws IOException { + return new ExtendedEchoStubSettings(this); + } + } + } + + /** + * Without this ClientSettings wrapper, we must expose a serviceName setter to + * (Client|Stub)Settings and pass the StubSettings to the client. However, this will result in a + * null ClientSettings (See {@link EchoClient#create(EchoStub)}). Passing the stub to the Client + * will result in a NPE when doing `Client.getSettings().get(Endpoint|UniverseDomain)` as the + * ClientSettings is stored as null. + */ + private static class ExtendedEchoSettings extends EchoSettings { + + protected ExtendedEchoSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + } + + public static EchoSettings.Builder newBuilder() { + return ExtendedEchoSettings.Builder.createDefault(); + } + + public static EchoSettings.Builder newHttpJsonBuilder() { + return ExtendedEchoSettings.Builder.createHttpJsonDefault(); + } + + public static class Builder extends EchoSettings.Builder { + protected Builder() throws IOException {} + + private static ExtendedEchoSettings.Builder createDefault() { + return new ExtendedEchoSettings.Builder(ExtendedEchoStubSettings.newBuilder()); + } + + private static ExtendedEchoSettings.Builder createHttpJsonDefault() { + return new ExtendedEchoSettings.Builder(ExtendedEchoStubSettings.newHttpJsonBuilder()); + } + + protected Builder(ClientContext clientContext) { + super(clientContext); + } + + protected Builder(EchoSettings settings) { + super(settings); + } + + protected Builder(ExtendedEchoStubSettings.Builder stubSettings) { + super(stubSettings); + } + } + } + + /** + * Credentials Wrapper for showcase testing which is used to override the Universe Domain value. + * + *

        For the tests below, it will act as a valid Credentials and is used to test the flows where + * the user passes in a Credentials (i.e. ServiceAccount, AccessToken, Oauth, etc.) + */ + private static class UniverseDomainCredentials extends Credentials { + + private final String universeDomain; + + private UniverseDomainCredentials(String universeDomain) { + this.universeDomain = universeDomain; + } + + @Override + public String getAuthenticationType() { + return null; + } + + @Override + public Map> getRequestMetadata(URI uri) { + return new HashMap<>(); + } + + @Override + public boolean hasRequestMetadata() { + return false; + } + + @Override + public boolean hasRequestMetadataOnly() { + return false; + } + + @Override + public void refresh() { + // no-op + } + + @Override + public String getUniverseDomain() { + return universeDomain; + } + } + + /** + * CredentialsProvider wrapper to return the wrapped Universe Domain Credentials. This will return + * the custom Universe Domain value. + */ + private static class UniverseDomainCredentialsProvider implements CredentialsProvider { + + private final String universeDomain; + + public UniverseDomainCredentialsProvider(String universeDomain) { + this.universeDomain = universeDomain; + } + + public static UniverseDomainCredentialsProvider create() { + return new UniverseDomainCredentialsProvider(GoogleCredentials.GOOGLE_DEFAULT_UNIVERSE); + } + + public static UniverseDomainCredentialsProvider create(String universeDomain) { + return new UniverseDomainCredentialsProvider(universeDomain); + } + + @Override + public Credentials getCredentials() { + return new UniverseDomainCredentials(universeDomain); + } + } + + private static final String DEFAULT_ENDPOINT = "test.googleapis.com:443"; + private static final EchoRequest DEFAULT_REQUEST = + EchoRequest.newBuilder().setContent("echo").build(); + + private EchoClient echoClient; + + @AfterEach + void cleanup() throws InterruptedException { + if (echoClient != null) { + echoClient.close(); + echoClient.awaitTermination( + TestClientInitializer.AWAIT_TERMINATION_SECONDS, TimeUnit.SECONDS); + } + } + + // Default (no configuration) + @Test + void endpointResolution_default() throws IOException { + EchoSettings echoSettings = + ExtendedEchoSettings.newBuilder() + .setCredentialsProvider(UniverseDomainCredentialsProvider.create()) + .build(); + echoClient = EchoClient.create(echoSettings); + Truth.assertThat(echoClient.getSettings().getEndpoint()).isEqualTo(DEFAULT_ENDPOINT); + Truth.assertThat(echoClient.getSettings().getUniverseDomain()) + .isEqualTo(GoogleCredentials.GOOGLE_DEFAULT_UNIVERSE); + } + + // User configuration + @Test + void endpointResolution_userSetEndpoint() throws IOException { + String customEndpoint = "test.com:123"; + EchoSettings echoSettings = + ExtendedEchoSettings.newBuilder() + .setCredentialsProvider(UniverseDomainCredentialsProvider.create()) + .setEndpoint(customEndpoint) + .build(); + echoClient = EchoClient.create(echoSettings); + Truth.assertThat(echoClient.getSettings().getEndpoint()).isEqualTo(customEndpoint); + Truth.assertThat(echoClient.getSettings().getUniverseDomain()) + .isEqualTo(GoogleCredentials.GOOGLE_DEFAULT_UNIVERSE); + } + + @Test + void endpointResolution_userSetUniverseDomainAndNoUserSetEndpoint() throws IOException { + String customUniverseDomain = "random.com"; + EchoSettings echoSettings = + ExtendedEchoSettings.newBuilder() + .setCredentialsProvider(UniverseDomainCredentialsProvider.create()) + .setUniverseDomain(customUniverseDomain) + .build(); + echoClient = EchoClient.create(echoSettings); + // If user configured the universe domain, the endpoint is constructed from it + Truth.assertThat(echoClient.getSettings().getEndpoint()).isEqualTo("test.random.com:443"); + Truth.assertThat(echoClient.getSettings().getUniverseDomain()).isEqualTo(customUniverseDomain); + } + + @Test + void endpointResolution_userSetEndpointAndUniverseDomain() throws IOException { + String customEndpoint = "custom.endpoint.com:443"; + String customUniverseDomain = "random.com"; + EchoSettings echoSettings = + ExtendedEchoSettings.newBuilder() + .setCredentialsProvider(UniverseDomainCredentialsProvider.create()) + .setEndpoint(customEndpoint) + .setUniverseDomain(customUniverseDomain) + .build(); + echoClient = EchoClient.create(echoSettings); + // Custom Endpoint sets the endpoint for the client to use + Truth.assertThat(echoClient.getSettings().getEndpoint()).isEqualTo(customEndpoint); + // The universe domain doesn't match the endpoint. The call will fail validation when RPC is + // called. + Truth.assertThat(echoClient.getSettings().getUniverseDomain()).isEqualTo(customUniverseDomain); + } + + @Test + void universeDomainValidation_credentialsGDU_noUserConfiguration() throws IOException { + EchoSettings echoSettings = + ExtendedEchoSettings.newBuilder() + .setCredentialsProvider(UniverseDomainCredentialsProvider.create()) + .setEndpoint(TestClientInitializer.DEFAULT_GRPC_ENDPOINT) + .setTransportChannelProvider( + EchoSettings.defaultGrpcTransportProviderBuilder() + .setChannelConfigurator(ManagedChannelBuilder::usePlaintext) + .build()) + .build(); + echoClient = EchoClient.create(echoSettings); + + // Does not throw an error + echoClient.echo(DEFAULT_REQUEST); + } + + @Test + void universeDomainValidation_credentialsNonGDU_noUserConfiguration() throws IOException { + EchoSettings echoSettings = + ExtendedEchoSettings.newBuilder() + .setCredentialsProvider(UniverseDomainCredentialsProvider.create("random.com")) + .setEndpoint(TestClientInitializer.DEFAULT_GRPC_ENDPOINT) + .setTransportChannelProvider( + EchoSettings.defaultGrpcTransportProviderBuilder() + .setChannelConfigurator(ManagedChannelBuilder::usePlaintext) + .build()) + .build(); + echoClient = EchoClient.create(echoSettings); + + UnauthenticatedException exception = + assertThrows(UnauthenticatedException.class, () -> echoClient.echo(DEFAULT_REQUEST)); + Truth.assertThat(exception.getMessage()) + .contains( + "The configured universe domain (googleapis.com) does not match the universe domain" + + " found in the credentials (random.com)."); + } + + @Test + void universeDomainValidation_credentialsNonGDUMatchesUserConfiguration() throws IOException { + String universeDomain = "random.com"; + EchoSettings echoSettings = + ExtendedEchoSettings.newBuilder() + .setCredentialsProvider(UniverseDomainCredentialsProvider.create(universeDomain)) + .setEndpoint(TestClientInitializer.DEFAULT_GRPC_ENDPOINT) + .setUniverseDomain(universeDomain) + .setTransportChannelProvider( + EchoSettings.defaultGrpcTransportProviderBuilder() + .setChannelConfigurator(ManagedChannelBuilder::usePlaintext) + .build()) + .build(); + echoClient = EchoClient.create(echoSettings); + + // Does not throw an error + echoClient.echo(DEFAULT_REQUEST); + } + + @Test + void universeDomainValidation_credentialsNonGDUDoesNotMatchUserConfiguration() + throws IOException { + String universeDomain = "random.com"; + String userConfigurationUniverseDomain = "test.com"; + EchoSettings echoSettings = + ExtendedEchoSettings.newBuilder() + .setCredentialsProvider(UniverseDomainCredentialsProvider.create(universeDomain)) + .setEndpoint(TestClientInitializer.DEFAULT_GRPC_ENDPOINT) + .setUniverseDomain(userConfigurationUniverseDomain) + .setTransportChannelProvider( + EchoSettings.defaultGrpcTransportProviderBuilder() + .setChannelConfigurator(ManagedChannelBuilder::usePlaintext) + .build()) + .build(); + echoClient = EchoClient.create(echoSettings); + + UnauthenticatedException exception = + assertThrows(UnauthenticatedException.class, () -> echoClient.echo(DEFAULT_REQUEST)); + Truth.assertThat(exception.getMessage()) + .contains( + "The configured universe domain (test.com) does not match the universe domain found in" + + " the credentials (random.com)."); + } + + // This test uses NoCredentialsProvider (will default to GDU) + @Test + void universeDomainValidation_noCredentials_noUserSetUniverseDomain() throws IOException { + EchoSettings echoSettings = + ExtendedEchoSettings.newBuilder() + .setCredentialsProvider(NoCredentialsProvider.create()) + .setEndpoint(TestClientInitializer.DEFAULT_GRPC_ENDPOINT) + .setTransportChannelProvider( + EchoSettings.defaultGrpcTransportProviderBuilder() + .setChannelConfigurator(ManagedChannelBuilder::usePlaintext) + .build()) + .build(); + echoClient = EchoClient.create(echoSettings); + + // Does not throw an error + echoClient.echo(DEFAULT_REQUEST); + } + + // This test uses NoCredentialsProvider (will default to GDU) + @Test + void universeDomainValidation_noCredentials_userSetUniverseDomain() throws IOException { + String universeDomain = "random.com"; + EchoSettings echoSettings = + ExtendedEchoSettings.newBuilder() + .setCredentialsProvider(NoCredentialsProvider.create()) + .setEndpoint(TestClientInitializer.DEFAULT_GRPC_ENDPOINT) + .setUniverseDomain(universeDomain) + .setTransportChannelProvider( + EchoSettings.defaultGrpcTransportProviderBuilder() + .setChannelConfigurator(ManagedChannelBuilder::usePlaintext) + .build()) + .build(); + echoClient = EchoClient.create(echoSettings); + + UnauthenticatedException exception = + assertThrows(UnauthenticatedException.class, () -> echoClient.echo(DEFAULT_REQUEST)); + Truth.assertThat(exception.getMessage()) + .contains( + "The configured universe domain (random.com) does not match the universe domain found" + + " in the credentials (googleapis.com)."); + } + + // Default in Builder (no configuration) + @Test + void endpointResolution_defaultViaBuilder() { + EchoSettings.Builder echoSettingsBuilder = EchoSettings.newBuilder(); + // `StubSettings.newBuilder()` will return the clientSettingsEndpoint + Truth.assertThat(echoSettingsBuilder.getEndpoint()).isEqualTo(null); + } + + // User configuration in Builder + @Test + void endpointResolution_userConfigurationViaBuilder() { + EchoSettings.Builder echoSettingsBuilder = + EchoSettings.newBuilder().setEndpoint("test.com:123"); + // `StubSettings.newBuilder()` will return the clientSettingsEndpoint + Truth.assertThat(echoSettingsBuilder.getEndpoint()).isEqualTo("test.com:123"); + } + + @Test + void endpointResolution_builderBuilderBackToBuilder() throws IOException { + String customEndpoint = "test.com:123"; + EchoStubSettings.Builder echoStubSettingsBuilder = + EchoStubSettings.newBuilder().setEndpoint(customEndpoint); + // `StubSettings.newBuilder()` will return the clientSettingsEndpoint + Truth.assertThat(echoStubSettingsBuilder.getEndpoint()).isEqualTo(customEndpoint); + + // EndpointContext is recomputed when the Builder is re-built + EchoStubSettings echoStubSettings = echoStubSettingsBuilder.build(); + Truth.assertThat(echoStubSettings.getEndpoint()).isEqualTo(customEndpoint); + + // Calling toBuilder on StubSettings keeps the configurations the same + echoStubSettingsBuilder = echoStubSettings.toBuilder(); + Truth.assertThat(echoStubSettingsBuilder.getEndpoint()).isEqualTo(customEndpoint); + } + + @Test + void universeDomainValidation_quotaProjectId_credentialsNonGDUMatchesUserConfiguration() + throws IOException { + String universeDomain = "random.com"; + EchoSettings echoSettings = + ExtendedEchoSettings.newBuilder() + .setQuotaProjectId("exampleProject") + .setCredentialsProvider(UniverseDomainCredentialsProvider.create(universeDomain)) + .setEndpoint(TestClientInitializer.DEFAULT_GRPC_ENDPOINT) + .setUniverseDomain(universeDomain) + .setTransportChannelProvider( + EchoSettings.defaultGrpcTransportProviderBuilder() + .setChannelConfigurator(ManagedChannelBuilder::usePlaintext) + .build()) + .build(); + echoClient = EchoClient.create(echoSettings); + Truth.assertThat(echoClient.echo(DEFAULT_REQUEST).getContent()).isEqualTo("echo"); + } +} diff --git a/java-showcase-3.25.8/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/ITGdch.java b/java-showcase-3.25.8/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/ITGdch.java new file mode 100644 index 0000000000..f043d45cfc --- /dev/null +++ b/java-showcase-3.25.8/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/ITGdch.java @@ -0,0 +1,224 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.it; + +import static com.google.common.truth.Truth.assertThat; +import static com.google.common.truth.Truth.assertWithMessage; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotSame; +import static org.junit.jupiter.api.Assertions.assertThrows; +import static org.junit.jupiter.api.Assertions.assertTrue; + +import com.google.api.client.json.GenericJson; +import com.google.api.client.json.JsonFactory; +import com.google.api.client.json.gson.GsonFactory; +import com.google.api.gax.core.FixedCredentialsProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.auth.Credentials; +import com.google.auth.oauth2.GdchCredentials; +import com.google.auth.oauth2.GdchCredentialsTestUtil; +import com.google.showcase.v1beta1.EchoClient; +import com.google.showcase.v1beta1.EchoSettings; +import com.google.showcase.v1beta1.it.util.InterceptingMockTokenServerTransportFactory; +import com.google.showcase.v1beta1.it.util.TestClientInitializer; +import com.google.showcase.v1beta1.stub.EchoStubSettings; +import java.io.File; +import java.io.FileWriter; +import java.io.IOException; +import java.io.InputStream; +import java.net.URI; +import java.nio.file.Files; +import java.nio.file.Path; +import java.nio.file.StandardCopyOption; +import java.util.concurrent.TimeUnit; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.io.TempDir; + +/** + * Test suite to confirm a client can be instantiated with GDCH credentials. No calls are made since + * it is not feasible to test against real GDCH servers (or replicate an environment) + */ +class ITGdch { + + private static final String CA_CERT_FILENAME = "fake_cert.pem"; + private static final String CA_CERT_RESOURCE_PATH = "/" + CA_CERT_FILENAME; + private static final String CA_CERT_JSON_KEY = "ca_cert_path"; + private static final String GDCH_CREDENTIAL_FILENAME = "test_gdch_credential.json"; + private static final String GDCH_CREDENTIAL_RESOURCE_PATH = "/" + GDCH_CREDENTIAL_FILENAME; + private static final String GDCH_TOKEN_STRING = "1/MkSJoj1xsli0AccessToken_NKPY2"; + private static final String SID_NAME = "service-identity-name"; + + private EchoClient client; + private EchoSettings settings; + private EchoStubSettings stubSettings; + private Credentials initialCredentials; + private ClientContext context; + private InterceptingMockTokenServerTransportFactory transportFactory; + private String projectId; + private URI tokenUri; + + @BeforeEach + void setup(@TempDir Path tempDir) throws IOException { + transportFactory = new InterceptingMockTokenServerTransportFactory(); + prepareCredentials(tempDir); + settings = + EchoSettings.newBuilder() + .setCredentialsProvider(FixedCredentialsProvider.create(initialCredentials)) + .build(); + } + + @AfterEach + void tearDown() throws InterruptedException { + if (client != null) { + client.close(); + client.awaitTermination(TestClientInitializer.AWAIT_TERMINATION_SECONDS, TimeUnit.SECONDS); + } + } + + private void prepareCredentials(Path tempDir) throws IOException { + // Copy file so it can be referenced by Path even in native-image builds + File caCertFile = new File(tempDir.toFile(), CA_CERT_FILENAME); + try (InputStream inputStream = getClass().getResourceAsStream(CA_CERT_RESOURCE_PATH)) { + assertThat(inputStream).isNotNull(); + Files.copy(inputStream, caCertFile.toPath(), StandardCopyOption.REPLACE_EXISTING); + } + assertWithMessage(caCertFile.toPath() + " should exist").that(caCertFile.exists()).isTrue(); + + // open gdch credential json (still needs its "ca_cert_path" to point to the CA certificate + // obtained from above) + JsonFactory factory = new GsonFactory(); + GenericJson converted = + factory.fromInputStream( + getClass().getResourceAsStream(GDCH_CREDENTIAL_RESOURCE_PATH), GenericJson.class); + + // modify and save to a temporary folder + converted.set(CA_CERT_JSON_KEY, caCertFile.toPath().toAbsolutePath().toString()); + projectId = converted.get("project").toString(); + tokenUri = URI.create(converted.get("token_uri").toString()); + + File tempGdchCredentialFile = new File(tempDir.toFile(), GDCH_CREDENTIAL_FILENAME); + try (FileWriter fileWriter = new FileWriter(tempGdchCredentialFile)) { + String preparedJson = converted.toPrettyString(); + fileWriter.write(preparedJson); + } + + // use temp location to instantiate credentials + initialCredentials = GdchCredentialsTestUtil.fromJson(converted, transportFactory); + } + + /** + * {@link com.google.api.gax.rpc.ClientContext} will create a new {@link GdchCredentials} with an + * audience defaulted to the endpoint if the audience is not manually passed. This test confirms + * that a new credential is created from the context and can be refreshed + * + * @throws IOException + */ + @Test + void testCreateClient_withGdchCredentialAndNoAudience_defaultsToEndpointBasedAudience() + throws IOException { + + // we create the client as usual - no audience passed + String testEndpoint = "custom-endpoint:123"; + settings = settings.toBuilder().setEndpoint(testEndpoint).build(); + context = ClientContext.create(settings); + stubSettings = EchoStubSettings.newBuilder(context).build(); + client = EchoClient.create(stubSettings.createStub()); + + // We retrieve from context and from client + // the client has only access to creds provider, which may differ from the actual credentials + // used in the Context + Credentials fromContext = context.getCredentials(); + Credentials fromClient = initialCredentials; + + // Since ClientContext.create() uses a modified version of GdchCredentials + // via GdchCredentials.createWithGdchAudience(), they should be different objects + assertNotSame(fromContext, fromClient); + + // When credentials don't have an audience (such as the ones we passed to client creation and + // now stored in the + // provider) they will throw if we try to refresh them + NullPointerException expectedEx = + assertThrows(NullPointerException.class, () -> initialCredentials.refresh()); + assertTrue( + expectedEx.getMessage().contains("Audience are not configured for GDCH service account")); + + // However, the credentials prepared in ClientContext should be able to refresh since the + // audience would be + // internally defaulted the endpoint of the StubSettings + registerCredential(fromContext); + ((GdchCredentials) fromContext).refreshAccessToken(); + String usedAudience = transportFactory.transport.getLastAudienceSent(); + assertEquals(testEndpoint, usedAudience); + } + + /** + * Confirms creating a client with a valid audience is successful. We cannot confirm which + * audience is chosen (our passed audience or the endpoint) but this is confirmed in the unit + * tests. + * + * @throws IOException + */ + @Test + void testCreateClient_withGdchCredentialWithValidAudience_usesCredentialWithPassedAudience() + throws IOException { + + // Similar to the previous test, create a client as usual but this time we pass a explicit + // audience. It should + // be created without issues + String testAudience = "valid-audience"; + settings = + settings.toBuilder().setGdchApiAudience(testAudience).setEndpoint("localhost:7469").build(); + context = ClientContext.create(settings); + stubSettings = EchoStubSettings.newBuilder(context).build(); + client = EchoClient.create(stubSettings.createStub()); + + // We retrieve both creds from the creds provider and the ones prepared in the context (which + // should have been + // re-created using GdchCredentials.createWithAudience("valid-audience")) + Credentials fromContext = context.getCredentials(); + assertNotSame(fromContext, initialCredentials); + + // Again, since the initial credentials don't have an audience, we should not be able to refresh + // them + NullPointerException thrownByClientCreds = + assertThrows(NullPointerException.class, () -> initialCredentials.refresh()); + assertTrue( + thrownByClientCreds + .getMessage() + .contains("Audience are not configured for GDCH service account")); + + // But the credentials prepared in ClientContext should be able to refresh since the audience + // would be internally + // set to the one passed in stub settings + registerCredential(fromContext); + ((GdchCredentials) fromContext).refreshAccessToken(); + String usedAudience = transportFactory.transport.getLastAudienceSent(); + assertEquals(testAudience, usedAudience); + } + + private void registerCredential(Credentials fromContext) { + GdchCredentialsTestUtil.registerGdchCredentialWithMockTransport( + (GdchCredentials) fromContext, + transportFactory.transport, + projectId, + SID_NAME, + GDCH_TOKEN_STRING, + tokenUri); + } +} diff --git a/java-showcase-3.25.8/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/ITHttpAnnotation.java b/java-showcase-3.25.8/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/ITHttpAnnotation.java new file mode 100644 index 0000000000..0daf858d14 --- /dev/null +++ b/java-showcase-3.25.8/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/ITHttpAnnotation.java @@ -0,0 +1,145 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.showcase.v1beta1.it; + +import static com.google.common.truth.Truth.assertThat; + +import com.google.api.client.http.javanet.NetHttpTransport; +import com.google.api.gax.core.NoCredentialsProvider; +import com.google.common.collect.ImmutableMap; +import com.google.protobuf.util.JsonFormat; +import com.google.showcase.v1beta1.ComplianceClient; +import com.google.showcase.v1beta1.ComplianceData; +import com.google.showcase.v1beta1.ComplianceGroup; +import com.google.showcase.v1beta1.ComplianceSettings; +import com.google.showcase.v1beta1.ComplianceSuite; +import com.google.showcase.v1beta1.RepeatRequest; +import com.google.showcase.v1beta1.RepeatResponse; +import com.google.showcase.v1beta1.it.util.TestClientInitializer; +import java.io.IOException; +import java.io.InputStreamReader; +import java.nio.charset.StandardCharsets; +import java.security.GeneralSecurityException; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import java.util.concurrent.TimeUnit; +import java.util.function.Function; +import java.util.stream.Collectors; +import java.util.stream.Stream; +import org.junit.jupiter.api.AfterAll; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.Arguments; +import org.junit.jupiter.params.provider.MethodSource; + +// This test runs from the parameters in the compliance_suite.json file +// The file is downloaded from the gapic-showcase repo. Each compliance +// group is a set of HttpJson behaviors we want to test for. Each group +// tests the product of the rpc list and requests list. +class ITHttpAnnotation { + + static Stream data() { + return Stream.of( + Arguments.of("Fully working conversions, resources"), + Arguments.of("Binding selection testing"), + Arguments.of("Cases that apply to non-path requests"), + Arguments.of("Fully working conversions, no resources")); + } + + private static ComplianceClient httpjsonClient; + private static ComplianceSuite complianceSuite; + private static Map> validComplianceRpcMap; + + @BeforeAll + static void createClients() throws IOException, GeneralSecurityException { + ComplianceSuite.Builder builder = ComplianceSuite.newBuilder(); + JsonFormat.parser() + .merge( + new InputStreamReader( + Objects.requireNonNull( + ITHttpAnnotation.class + .getClassLoader() + .getResourceAsStream("compliance_suite.json")), + StandardCharsets.UTF_8), + builder); + complianceSuite = builder.build(); + + ComplianceSettings httpjsonComplianceSettings = + ComplianceSettings.newHttpJsonBuilder() + .setCredentialsProvider(NoCredentialsProvider.create()) + .setTransportChannelProvider( + ComplianceSettings.defaultHttpJsonTransportProviderBuilder() + .setHttpTransport( + new NetHttpTransport.Builder().doNotValidateCertificate().build()) + .setEndpoint("http://localhost:7469") + .build()) + .build(); + httpjsonClient = ComplianceClient.create(httpjsonComplianceSettings); + + // Mapping of Compliance Suite file RPC Names to ComplianceClient methods + validComplianceRpcMap = + ImmutableMap.of( + "Compliance.RepeatDataBody", + httpjsonClient::repeatDataBody, + "Compliance.RepeatDataBodyInfo", + httpjsonClient::repeatDataBodyInfo, + "Compliance.RepeatDataQuery", + httpjsonClient::repeatDataQuery, + "Compliance.RepeatDataSimplePath", + httpjsonClient::repeatDataSimplePath, + "Compliance.RepeatDataBodyPut", + httpjsonClient::repeatDataBodyPut, + "Compliance.RepeatDataBodyPatch", + httpjsonClient::repeatDataBodyPatch, + "Compliance.RepeatDataPathResource", + httpjsonClient::repeatDataPathResource); + } + + @AfterAll + static void destroyClients() throws InterruptedException { + httpjsonClient.close(); + httpjsonClient.awaitTermination( + TestClientInitializer.AWAIT_TERMINATION_SECONDS, TimeUnit.SECONDS); + } + + // Verify that the input's info is the same as the response's info + // This ensures that the entire group's behavior over HttpJson + // works as intended + @ParameterizedTest + @MethodSource("data") + void testComplianceGroup(String groupName) { + Optional complianceGroupOptional = + complianceSuite.getGroupList().stream() + .filter(x -> x.getName().equals(groupName)) + .findFirst(); + assertThat(complianceGroupOptional.isPresent()).isTrue(); + ComplianceGroup complianceGroup = complianceGroupOptional.get(); + List validRpcList = + complianceGroup.getRpcsList().stream() + .filter(validComplianceRpcMap::containsKey) + .collect(Collectors.toList()); + for (String rpcName : validRpcList) { + Function rpc = validComplianceRpcMap.get(rpcName); + for (RepeatRequest repeatRequest : complianceGroup.getRequestsList()) { + ComplianceData expectedData = repeatRequest.getInfo(); + RepeatResponse response = rpc.apply(repeatRequest); + assertThat(response.getRequest().getInfo()).isEqualTo(expectedData); + } + } + } +} diff --git a/java-showcase-3.25.8/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/ITIam.java b/java-showcase-3.25.8/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/ITIam.java new file mode 100644 index 0000000000..893eeb2679 --- /dev/null +++ b/java-showcase-3.25.8/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/ITIam.java @@ -0,0 +1,180 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.showcase.v1beta1.it; + +import static com.google.common.truth.Truth.assertThat; +import static org.junit.jupiter.api.Assertions.assertThrows; + +import com.google.api.gax.rpc.InvalidArgumentException; +import com.google.common.collect.ImmutableList; +import com.google.iam.v1.Binding; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.showcase.v1beta1.IdentityClient; +import com.google.showcase.v1beta1.it.util.TestClientInitializer; +import java.util.List; +import java.util.UUID; +import java.util.concurrent.TimeUnit; +import org.junit.jupiter.api.AfterAll; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; + +class ITIam { + private static final Policy DEFAULT_POLICY = + Policy.newBuilder() + .addBindings(Binding.newBuilder().setRole("foo.editor").addMembers("allUsers")) + .build(); + private static IdentityClient grpcClient; + private static IdentityClient httpjsonClient; + private String resourceName; + + @BeforeAll + static void createClients() throws Exception { + grpcClient = TestClientInitializer.createGrpcIdentityClient(); + httpjsonClient = TestClientInitializer.createHttpJsonIdentityClient(); + } + + @BeforeEach + void setupTests() { + resourceName = "users/" + UUID.randomUUID().toString().substring(0, 8); + } + + @AfterAll + public static void destroyClients() throws InterruptedException { + grpcClient.close(); + httpjsonClient.close(); + + grpcClient.awaitTermination(TestClientInitializer.AWAIT_TERMINATION_SECONDS, TimeUnit.SECONDS); + httpjsonClient.awaitTermination( + TestClientInitializer.AWAIT_TERMINATION_SECONDS, TimeUnit.SECONDS); + } + + @Test + void testGrpc_setIamPolicy() { + SetIamPolicyRequest policyRequest = + SetIamPolicyRequest.newBuilder() + .setPolicy(DEFAULT_POLICY) + .setResource(resourceName) + .build(); + Policy policy = grpcClient.setIamPolicy(policyRequest); + assertThat(policy).isEqualTo(DEFAULT_POLICY); + } + + @Test + void testHttpJson_setIamPolicy() { + SetIamPolicyRequest policyRequest = + SetIamPolicyRequest.newBuilder() + .setPolicy(DEFAULT_POLICY) + .setResource(resourceName) + .build(); + Policy policy = httpjsonClient.setIamPolicy(policyRequest); + assertThat(policy).isEqualTo(DEFAULT_POLICY); + } + + @Test + void testGrpc_getIamPolicy() { + SetIamPolicyRequest policyRequest = + SetIamPolicyRequest.newBuilder() + .setPolicy(DEFAULT_POLICY) + .setResource(resourceName) + .build(); + grpcClient.setIamPolicy(policyRequest); + + Policy policy = + grpcClient.getIamPolicy( + GetIamPolicyRequest.newBuilder().setResource(policyRequest.getResource()).build()); + assertThat(policy).isEqualTo(DEFAULT_POLICY); + } + + @Test + void testHttpJson_getIamPolicy() { + SetIamPolicyRequest policyRequest = + SetIamPolicyRequest.newBuilder() + .setPolicy(DEFAULT_POLICY) + .setResource(resourceName) + .build(); + httpjsonClient.setIamPolicy(policyRequest); + + Policy policy = + httpjsonClient.getIamPolicy( + GetIamPolicyRequest.newBuilder().setResource(policyRequest.getResource()).build()); + assertThat(policy).isEqualTo(DEFAULT_POLICY); + } + + @Test + void testGrpc_testIamPermissions() { + SetIamPolicyRequest policyRequest = + SetIamPolicyRequest.newBuilder() + .setPolicy(DEFAULT_POLICY) + .setResource(resourceName) + .build(); + grpcClient.setIamPolicy(policyRequest); + List permissions = ImmutableList.of("foo.create", "foo.write"); + TestIamPermissionsResponse testIamPermissionsResponse = + grpcClient.testIamPermissions( + TestIamPermissionsRequest.newBuilder() + .setResource(policyRequest.getResource()) + .addAllPermissions(permissions) + .build()); + // Showcase server will simply echo the request's Permissions List back + // if the resource exists and contains a policy + assertThat(testIamPermissionsResponse.getPermissionsList()) + .containsExactlyElementsIn(permissions); + } + + @Test + void testHttpJson_testIamPermissions() { + SetIamPolicyRequest policyRequest = + SetIamPolicyRequest.newBuilder() + .setPolicy(DEFAULT_POLICY) + .setResource(resourceName) + .build(); + httpjsonClient.setIamPolicy(policyRequest); + List permissions = ImmutableList.of("foo.create", "foo.write"); + TestIamPermissionsResponse testIamPermissionsResponse = + httpjsonClient.testIamPermissions( + TestIamPermissionsRequest.newBuilder() + .setResource(policyRequest.getResource()) + .addAllPermissions(permissions) + .build()); + // Showcase server will simply echo the request's Permissions List back + // if the resource exists and contains a policy + assertThat(testIamPermissionsResponse.getPermissionsList()) + .containsExactlyElementsIn(permissions); + } + + // The tests below simply assert that an exception is being thrown for an invalid request + // in both transports. Showcase's IAM backend service will throw a few exceptions for a few + // cases, and we simply assert that an exception has been thrown for a single case with a single + // RPC (No resource in the request for SetIamPolicy's RPC). + @Test + void testGrpc_iamThrowsException() { + SetIamPolicyRequest setIamPolicyRequest = SetIamPolicyRequest.newBuilder().build(); + assertThrows( + InvalidArgumentException.class, () -> grpcClient.setIamPolicy(setIamPolicyRequest)); + } + + @Test + void testHttpJson_iamThrowsException() { + SetIamPolicyRequest setIamPolicyRequest = SetIamPolicyRequest.newBuilder().build(); + assertThrows( + InvalidArgumentException.class, () -> httpjsonClient.setIamPolicy(setIamPolicyRequest)); + } +} diff --git a/java-showcase-3.25.8/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/ITLongRunningOperation.java b/java-showcase-3.25.8/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/ITLongRunningOperation.java new file mode 100644 index 0000000000..09208861ba --- /dev/null +++ b/java-showcase-3.25.8/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/ITLongRunningOperation.java @@ -0,0 +1,196 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.showcase.v1beta1.it; + +import static com.google.common.truth.Truth.assertThat; +import static org.junit.jupiter.api.Assertions.assertThrows; + +import com.google.api.gax.longrunning.OperationFuture; +import com.google.api.gax.retrying.RetrySettings; +import com.google.protobuf.Timestamp; +import com.google.showcase.v1beta1.EchoClient; +import com.google.showcase.v1beta1.WaitMetadata; +import com.google.showcase.v1beta1.WaitRequest; +import com.google.showcase.v1beta1.WaitResponse; +import com.google.showcase.v1beta1.it.util.TestClientInitializer; +import java.util.concurrent.CancellationException; +import java.util.concurrent.TimeUnit; +import org.junit.jupiter.api.Test; +import org.threeten.bp.Duration; +import org.threeten.bp.Instant; +import org.threeten.bp.temporal.ChronoUnit; + +/** + * For this test, we test a combination of various LRO RetrySettings and try to ensure that the + * calls are polling correctly. Each test attempts to test the number of attempts done in each call. + */ +class ITLongRunningOperation { + + @Test + void testGRPC_LROSuccessfulResponse_doesNotExceedTotalTimeout() throws Exception { + RetrySettings initialUnaryRetrySettings = + RetrySettings.newBuilder() + .setInitialRpcTimeout(Duration.ofMillis(3000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ofMillis(3000L)) + .setTotalTimeout(Duration.ofMillis(3000L)) + .build(); + RetrySettings pollingRetrySettings = + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(3000L)) + .setRetryDelayMultiplier(2.0) + .setMaxRetryDelay(Duration.ofMillis(5000L)) + .setTotalTimeout(Duration.ofMillis(10000L)) + .build(); + EchoClient grpcClient = + TestClientInitializer.createGrpcEchoClientCustomWaitSettings( + initialUnaryRetrySettings, pollingRetrySettings); + try { + long epochSecondsInFuture = Instant.now().plus(5, ChronoUnit.SECONDS).getEpochSecond(); + WaitRequest waitRequest = + WaitRequest.newBuilder() + .setSuccess(WaitResponse.newBuilder().setContent("gRPCWaitContent_5sDelay_noRetry")) + .setEndTime(Timestamp.newBuilder().setSeconds(epochSecondsInFuture).build()) + .build(); + OperationFuture operationFuture = + grpcClient.waitOperationCallable().futureCall(waitRequest); + WaitResponse waitResponse = operationFuture.get(); + assertThat(waitResponse.getContent()).isEqualTo("gRPCWaitContent_5sDelay_noRetry"); + int attemptCount = operationFuture.getPollingFuture().getAttemptSettings().getAttemptCount(); + assertThat(attemptCount).isAtLeast(2); + } finally { + grpcClient.close(); + grpcClient.awaitTermination( + TestClientInitializer.AWAIT_TERMINATION_SECONDS, TimeUnit.SECONDS); + } + } + + @Test + void testHttpJson_LROSuccessfulResponse_doesNotExceedTotalTimeout() throws Exception { + RetrySettings initialUnaryRetrySettings = + RetrySettings.newBuilder() + .setInitialRpcTimeout(Duration.ofMillis(3000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ofMillis(3000L)) + .setTotalTimeout(Duration.ofMillis(3000L)) + .build(); + RetrySettings pollingRetrySettings = + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(3000L)) + .setRetryDelayMultiplier(2.0) + .setMaxRetryDelay(Duration.ofMillis(5000L)) + .setTotalTimeout(Duration.ofMillis(10000L)) + .build(); + EchoClient httpjsonClient = + TestClientInitializer.createHttpJsonEchoClientCustomWaitSettings( + initialUnaryRetrySettings, pollingRetrySettings); + try { + long epochSecondsInFuture = Instant.now().plus(5, ChronoUnit.SECONDS).getEpochSecond(); + WaitRequest waitRequest = + WaitRequest.newBuilder() + .setSuccess( + WaitResponse.newBuilder().setContent("httpjsonWaitContent_5sDelay_noRetry")) + .setEndTime(Timestamp.newBuilder().setSeconds(epochSecondsInFuture).build()) + .build(); + OperationFuture operationFuture = + httpjsonClient.waitOperationCallable().futureCall(waitRequest); + WaitResponse waitResponse = operationFuture.get(); + assertThat(waitResponse.getContent()).isEqualTo("httpjsonWaitContent_5sDelay_noRetry"); + int attemptCount = operationFuture.getPollingFuture().getAttemptSettings().getAttemptCount(); + assertThat(attemptCount).isAtLeast(2); + } finally { + httpjsonClient.close(); + httpjsonClient.awaitTermination( + TestClientInitializer.AWAIT_TERMINATION_SECONDS, TimeUnit.SECONDS); + } + } + + @Test + void testGRPC_LROUnsuccessfulResponse_exceedsTotalTimeout_throwsDeadlineExceededException() + throws Exception { + RetrySettings initialUnaryRetrySettings = + RetrySettings.newBuilder() + .setInitialRpcTimeout(Duration.ofMillis(5000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ofMillis(5000L)) + .setTotalTimeout(Duration.ofMillis(5000L)) + .build(); + RetrySettings pollingRetrySettings = + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(1000L)) + .setRetryDelayMultiplier(2.0) + .setMaxRetryDelay(Duration.ofMillis(3000L)) + .setTotalTimeout(Duration.ofMillis(5000L)) + .build(); + EchoClient grpcClient = + TestClientInitializer.createGrpcEchoClientCustomWaitSettings( + initialUnaryRetrySettings, pollingRetrySettings); + try { + WaitRequest waitRequest = + WaitRequest.newBuilder() + .setSuccess(WaitResponse.newBuilder().setContent("httpjsonWaitContent_10sDelay")) + .setTtl(com.google.protobuf.Duration.newBuilder().setSeconds(10)) + .build(); + OperationFuture operationFuture = + grpcClient.waitOperationCallable().futureCall(waitRequest); + assertThrows(CancellationException.class, operationFuture::get); + int attemptCount = operationFuture.getPollingFuture().getAttemptSettings().getAttemptCount(); + assertThat(attemptCount).isGreaterThan(1); + } finally { + grpcClient.close(); + grpcClient.awaitTermination( + TestClientInitializer.AWAIT_TERMINATION_SECONDS, TimeUnit.SECONDS); + } + } + + @Test + void testHttpJson_LROUnsuccessfulResponse_exceedsTotalTimeout_throwsDeadlineExceededException() + throws Exception { + RetrySettings initialUnaryRetrySettings = + RetrySettings.newBuilder() + .setInitialRpcTimeout(Duration.ofMillis(500L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ofMillis(500L)) + .setTotalTimeout(Duration.ofMillis(500L)) + .build(); + RetrySettings pollingRetrySettings = + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(100L)) + .setRetryDelayMultiplier(2.0) + .setMaxRetryDelay(Duration.ofMillis(500L)) + .setTotalTimeout(Duration.ofMillis(1000L)) + .build(); + EchoClient httpjsonClient = + TestClientInitializer.createHttpJsonEchoClientCustomWaitSettings( + initialUnaryRetrySettings, pollingRetrySettings); + try { + WaitRequest waitRequest = + WaitRequest.newBuilder() + .setSuccess(WaitResponse.newBuilder().setContent("httpjsonWaitContent_10sDelay")) + .setTtl(com.google.protobuf.Duration.newBuilder().setSeconds(10)) + .build(); + OperationFuture operationFuture = + httpjsonClient.waitOperationCallable().futureCall(waitRequest); + assertThrows(CancellationException.class, operationFuture::get); + int attemptCount = operationFuture.getPollingFuture().getAttemptSettings().getAttemptCount(); + assertThat(attemptCount).isGreaterThan(1); + } finally { + httpjsonClient.close(); + httpjsonClient.awaitTermination( + TestClientInitializer.AWAIT_TERMINATION_SECONDS, TimeUnit.SECONDS); + } + } +} diff --git a/java-showcase-3.25.8/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/ITNumericEnums.java b/java-showcase-3.25.8/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/ITNumericEnums.java new file mode 100644 index 0000000000..76c54a803c --- /dev/null +++ b/java-showcase-3.25.8/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/ITNumericEnums.java @@ -0,0 +1,67 @@ +/* + * 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 + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.it; + +import static org.junit.jupiter.api.Assertions.assertEquals; + +import com.google.api.client.http.javanet.NetHttpTransport; +import com.google.api.gax.core.NoCredentialsProvider; +import com.google.showcase.v1beta1.ComplianceClient; +import com.google.showcase.v1beta1.ComplianceSettings; +import com.google.showcase.v1beta1.EnumRequest; +import com.google.showcase.v1beta1.EnumResponse; +import com.google.showcase.v1beta1.it.util.TestClientInitializer; +import java.io.IOException; +import java.security.GeneralSecurityException; +import java.util.concurrent.TimeUnit; +import org.junit.jupiter.api.AfterAll; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Test; + +class ITNumericEnums { + + private static ComplianceClient httpjsonClient; + + @BeforeAll + static void createClients() throws GeneralSecurityException, IOException { + ComplianceSettings complianceSettings = + ComplianceSettings.newHttpJsonBuilder() + .setCredentialsProvider(NoCredentialsProvider.create()) + .setTransportChannelProvider( + ComplianceSettings.defaultHttpJsonTransportProviderBuilder() + .setHttpTransport( + new NetHttpTransport.Builder().doNotValidateCertificate().build()) + .setEndpoint("http://localhost:7469") + .build()) + .build(); + httpjsonClient = ComplianceClient.create(complianceSettings); + } + + @AfterAll + static void destroyClients() throws InterruptedException { + httpjsonClient.close(); + httpjsonClient.awaitTermination( + TestClientInitializer.AWAIT_TERMINATION_SECONDS, TimeUnit.SECONDS); + } + + @Test + void verifyEnums() { + EnumRequest request = EnumRequest.newBuilder().setUnknownEnum(true).build(); + EnumResponse initialResponse = httpjsonClient.getEnum(request); + assertEquals(initialResponse, httpjsonClient.verifyEnum(initialResponse)); + } +} diff --git a/java-showcase-3.25.8/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/ITOtelMetrics.java b/java-showcase-3.25.8/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/ITOtelMetrics.java new file mode 100644 index 0000000000..ad973e4137 --- /dev/null +++ b/java-showcase-3.25.8/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/ITOtelMetrics.java @@ -0,0 +1,922 @@ +/* + * Copyright 2024 Google LLC + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Google LLC nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +package com.google.showcase.v1beta1.it; + +import static org.junit.Assert.assertThrows; + +import com.google.api.client.http.javanet.NetHttpTransport; +import com.google.api.core.ApiFunction; +import com.google.api.core.ApiFuture; +import com.google.api.gax.core.NoCredentialsProvider; +import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; +import com.google.api.gax.retrying.RetrySettings; +import com.google.api.gax.rpc.InvalidArgumentException; +import com.google.api.gax.rpc.StatusCode.Code; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.api.gax.rpc.UnavailableException; +import com.google.api.gax.tracing.MetricsTracer; +import com.google.api.gax.tracing.MetricsTracerFactory; +import com.google.api.gax.tracing.OpenTelemetryMetricsRecorder; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.ImmutableSet; +import com.google.common.truth.Truth; +import com.google.protobuf.Duration; +import com.google.rpc.Status; +import com.google.showcase.v1beta1.BlockRequest; +import com.google.showcase.v1beta1.BlockResponse; +import com.google.showcase.v1beta1.EchoClient; +import com.google.showcase.v1beta1.EchoRequest; +import com.google.showcase.v1beta1.EchoSettings; +import com.google.showcase.v1beta1.it.util.TestClientInitializer; +import com.google.showcase.v1beta1.stub.EchoStub; +import com.google.showcase.v1beta1.stub.EchoStubSettings; +import io.grpc.ManagedChannelBuilder; +import io.grpc.opentelemetry.GrpcOpenTelemetry; +import io.opentelemetry.api.OpenTelemetry; +import io.opentelemetry.api.common.AttributeKey; +import io.opentelemetry.api.common.Attributes; +import io.opentelemetry.sdk.OpenTelemetrySdk; +import io.opentelemetry.sdk.metrics.SdkMeterProvider; +import io.opentelemetry.sdk.metrics.data.Data; +import io.opentelemetry.sdk.metrics.data.HistogramPointData; +import io.opentelemetry.sdk.metrics.data.LongPointData; +import io.opentelemetry.sdk.metrics.data.MetricData; +import io.opentelemetry.sdk.metrics.data.PointData; +import io.opentelemetry.sdk.testing.exporter.InMemoryMetricReader; +import java.io.IOException; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Optional; +import java.util.Set; +import java.util.concurrent.ExecutionException; +import java.util.concurrent.TimeUnit; +import java.util.function.Predicate; +import java.util.stream.Collectors; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; + +/** + * Showcase Test to confirm that metrics are being collected and that the correct metrics are being + * recorded. Utilizes an in-memory metric reader to collect the data. + * + *

        Every test flows through the same way and runs through the same assertions. First, all th + * metrics are pulled in via {@link #getMetricDataList()} which are polled until all the metrics are + * collected. Then the test will attempt check that reader collected the correct number of data + * points in {@link #verifyPointDataSum(List, int)}. Then, check that the attributes to be collected + * via {@link #verifyStatusAttribute(List, List)}. Finally, check that the status for each attempt + * is correct. + */ +class ITOtelMetrics { + private static final int DEFAULT_OPERATION_COUNT = 1; + private static final String SERVICE_NAME = "ShowcaseTest"; + private static final String ATTEMPT_COUNT = SERVICE_NAME + "/attempt_count"; + private static final String OPERATION_COUNT = SERVICE_NAME + "/operation_count"; + private static final String ATTEMPT_LATENCY = SERVICE_NAME + "/attempt_latency"; + private static final String OPERATION_LATENCY = SERVICE_NAME + "/operation_latency"; + private static final Set GAX_METRICS = + ImmutableSet.of(ATTEMPT_COUNT, OPERATION_COUNT, ATTEMPT_LATENCY, OPERATION_LATENCY); + + // Gax provides four metrics by default. This number may change as new metrics are added. + private static final int NUM_GAX_OTEL_METRICS = 4; + private static final int NUM_DEFAULT_FLUSH_ATTEMPTS = 10; + + private InMemoryMetricReader inMemoryMetricReader; + private EchoClient grpcClient; + private EchoClient httpClient; + + /** + * Internal class in the Otel Showcases test used to assert that number of status codes recorded. + */ + private static class StatusCount { + private final Code statusCode; + private final int count; + + public StatusCount(Code statusCode) { + this(statusCode, 1); + } + + public StatusCount(Code statusCode, int count) { + this.statusCode = statusCode; + this.count = count; + } + + public Code getStatusCode() { + return statusCode; + } + + public int getCount() { + return count; + } + } + + private OpenTelemetryMetricsRecorder createOtelMetricsRecorder( + InMemoryMetricReader inMemoryMetricReader) { + SdkMeterProvider sdkMeterProvider = + SdkMeterProvider.builder().registerMetricReader(inMemoryMetricReader).build(); + + OpenTelemetry openTelemetry = + OpenTelemetrySdk.builder().setMeterProvider(sdkMeterProvider).build(); + return new OpenTelemetryMetricsRecorder(openTelemetry, SERVICE_NAME); + } + + @BeforeEach + void setup() throws Exception { + inMemoryMetricReader = InMemoryMetricReader.create(); + OpenTelemetryMetricsRecorder otelMetricsRecorder = + createOtelMetricsRecorder(inMemoryMetricReader); + grpcClient = + TestClientInitializer.createGrpcEchoClientOpentelemetry( + new MetricsTracerFactory(otelMetricsRecorder)); + httpClient = + TestClientInitializer.createHttpJsonEchoClientOpentelemetry( + new MetricsTracerFactory(otelMetricsRecorder)); + } + + @AfterEach + void cleanup() throws InterruptedException, IOException { + inMemoryMetricReader.close(); + inMemoryMetricReader.shutdown(); + + grpcClient.close(); + httpClient.close(); + + grpcClient.awaitTermination(TestClientInitializer.AWAIT_TERMINATION_SECONDS, TimeUnit.SECONDS); + httpClient.awaitTermination(TestClientInitializer.AWAIT_TERMINATION_SECONDS, TimeUnit.SECONDS); + } + + /** + * Iterate through all MetricData elements and check that the number of PointData values matches + * the expected value. A PointData element may have multiple values/ counts inside, so this + * extracts the value/ count from the PointData before summing. + * + *

        The expected sum for an operation is `1`. Expected sum for an attempt may be 1+. + */ + private void verifyPointDataSum(List metricDataList, int attemptCount) { + for (MetricData metricData : metricDataList) { + Data data = metricData.getData(); + List points = new ArrayList<>(data.getPoints()); + switch (metricData.getName()) { + case OPERATION_COUNT: + long operationCountSum = + points.stream().map(x -> ((LongPointData) x).getValue()).reduce(0L, Long::sum); + Truth.assertThat(operationCountSum).isEqualTo(DEFAULT_OPERATION_COUNT); + break; + case ATTEMPT_COUNT: + long attemptCountSum = + points.stream().map(x -> ((LongPointData) x).getValue()).reduce(0L, Long::sum); + Truth.assertThat(attemptCountSum).isEqualTo(attemptCount); + break; + case OPERATION_LATENCY: + long operationLatencyCountSum = + points.stream().map(x -> ((HistogramPointData) x).getCount()).reduce(0L, Long::sum); + // It is difficult to verify the actual latency values (operation or attempt) + // without flaky behavior. Test that the number of data points recorded matches. + Truth.assertThat(operationLatencyCountSum).isEqualTo(DEFAULT_OPERATION_COUNT); + break; + case ATTEMPT_LATENCY: + long attemptLatencyCountSum = + points.stream().map(x -> ((HistogramPointData) x).getCount()).reduce(0L, Long::sum); + // It is difficult to verify the actual latency values (operation or attempt) + // without flaky behavior. Test that the number of data points recorded matches. + Truth.assertThat(attemptLatencyCountSum).isEqualTo(attemptCount); + break; + default: + break; + } + } + } + + /** + * Extract the attributes from MetricData and ensures that default attributes are recorded. Uses + * the `OPERATION_COUNT` MetricData to test the attributes. The `OPERATION_COUNT` is only recorded + * once and should only have one element of PointData. + * + *

        Although the Status attribute is recorded by default on every operation, this helper method + * does not verify it. This is because every individual attempt (retry) may have a different + * status. {@link #verifyStatusAttribute(List, List)} is used to verify the statuses for every + * attempt. + */ + private void verifyDefaultMetricsAttributes( + List metricDataList, Map defaultAttributeMapping) { + Optional metricDataOptional = + metricDataList.stream().filter(x -> x.getName().equals(OPERATION_COUNT)).findAny(); + Truth.assertThat(metricDataOptional.isPresent()).isTrue(); + MetricData operationCountMetricData = metricDataOptional.get(); + + List pointDataList = new ArrayList<>(operationCountMetricData.getData().getPoints()); + // Operation Metrics should only have a 1 data point + Truth.assertThat(pointDataList.size()).isEqualTo(1); + Attributes recordedAttributes = pointDataList.get(0).getAttributes(); + Map, Object> recordedAttributesMap = recordedAttributes.asMap(); + for (Map.Entry entrySet : defaultAttributeMapping.entrySet()) { + String key = entrySet.getKey(); + String value = entrySet.getValue(); + AttributeKey stringAttributeKey = AttributeKey.stringKey(key); + Truth.assertThat(recordedAttributesMap.containsKey(stringAttributeKey)).isTrue(); + Truth.assertThat(recordedAttributesMap.get(stringAttributeKey)).isEqualTo(value); + } + } + + /** + * Extract the attributes from MetricData and ensures that default attributes are recorded. Uses + * the `ATTEMPT_COUNT` MetricData to test the attributes. The `ATTEMPT_COUNT` is recorded for + * every retry attempt and should record the status received that each attempt made. + */ + private void verifyStatusAttribute( + List metricDataList, List statusCountList) { + Optional metricDataOptional = + metricDataList.stream().filter(x -> x.getName().equals(ATTEMPT_COUNT)).findAny(); + Truth.assertThat(metricDataOptional.isPresent()).isTrue(); + MetricData attemptCountMetricData = metricDataOptional.get(); + + List pointDataList = new ArrayList<>(attemptCountMetricData.getData().getPoints()); + Truth.assertThat(pointDataList.size()).isEqualTo(statusCountList.size()); + + // The data for attempt count may not be ordered (i.e. the last data point recorded may be the + // first element in the PointData list). Search for the expected StatusCode from the + // statusCountList + // and match with the data inside the pointDataList + for (StatusCount statusCount : statusCountList) { + Code statusCode = statusCount.getStatusCode(); + Predicate pointDataPredicate = + x -> + x.getAttributes() + .get(AttributeKey.stringKey(MetricsTracer.STATUS_ATTRIBUTE)) + .equals(statusCode.toString()); + Optional pointDataOptional = + pointDataList.stream().filter(pointDataPredicate).findFirst(); + Truth.assertThat(pointDataOptional.isPresent()).isTrue(); + LongPointData longPointData = (LongPointData) pointDataOptional.get(); + Truth.assertThat(longPointData.getValue()).isEqualTo(statusCount.getCount()); + } + } + + /** Uses the default InMemoryMetricReader configured for showcase tests. */ + private List getMetricDataList() throws InterruptedException { + return getMetricDataList(inMemoryMetricReader); + } + + /** + * Attempts to retrieve the metrics from a custom InMemoryMetricsReader. Sleep every second for at + * most 10s to try and retrieve all the metrics available. If it is unable to retrieve all the + * metrics, fail the test. + */ + private List getMetricDataList(InMemoryMetricReader metricReader) + throws InterruptedException { + for (int i = 0; i < NUM_DEFAULT_FLUSH_ATTEMPTS; i++) { + Thread.sleep(1000L); + List metricData = new ArrayList<>(metricReader.collectAllMetrics()); + // Depending on the OpenTelemetry instance (i.e. OpenTelemetry, GrpcOpenTelemetry, etc.) + // there may be additional metrics recorded. Only check to ensure the Gax Metrics + // are recorded properly. Any additional metrics are fine to be passed. + if (metricData.size() >= NUM_GAX_OTEL_METRICS && areAllGaxMetricsRecorded(metricData)) { + return metricData; + } + } + Assertions.fail("Unable to collect all the GAX metrics required for the test"); + return new ArrayList<>(); + } + + private boolean areAllGaxMetricsRecorded(List metricData) { + return metricData.stream().filter(data -> GAX_METRICS.contains(data.getName())).count() + == NUM_GAX_OTEL_METRICS; + } + + @Test + void testGrpc_operationSucceeded_recordsMetrics() throws InterruptedException { + int attemptCount = 1; + EchoRequest echoRequest = + EchoRequest.newBuilder().setContent("test_grpc_operation_succeeded").build(); + grpcClient.echo(echoRequest); + + List actualMetricDataList = getMetricDataList(); + verifyPointDataSum(actualMetricDataList, attemptCount); + + Map expectedAttributes = + ImmutableMap.of( + MetricsTracer.METHOD_ATTRIBUTE, + "Echo.Echo", + MetricsTracer.LANGUAGE_ATTRIBUTE, + MetricsTracer.DEFAULT_LANGUAGE); + verifyDefaultMetricsAttributes(actualMetricDataList, expectedAttributes); + + List statusCountList = ImmutableList.of(new StatusCount(Code.OK)); + verifyStatusAttribute(actualMetricDataList, statusCountList); + } + + @Test + void testHttpJson_operationSucceeded_recordsMetrics() throws InterruptedException { + int attemptCount = 1; + EchoRequest echoRequest = EchoRequest.newBuilder().setContent("content").build(); + httpClient.echo(echoRequest); + + List actualMetricDataList = getMetricDataList(); + verifyPointDataSum(actualMetricDataList, attemptCount); + + Map expectedAttributes = + ImmutableMap.of( + MetricsTracer.METHOD_ATTRIBUTE, + "Echo.Echo", + MetricsTracer.LANGUAGE_ATTRIBUTE, + MetricsTracer.DEFAULT_LANGUAGE); + verifyDefaultMetricsAttributes(actualMetricDataList, expectedAttributes); + + List statusCountList = ImmutableList.of(new StatusCount(Code.OK)); + verifyStatusAttribute(actualMetricDataList, statusCountList); + } + + @Test + void testGrpc_operationCancelled_recordsMetrics() throws Exception { + int attemptCount = 1; + BlockRequest blockRequest = + BlockRequest.newBuilder() + .setResponseDelay(Duration.newBuilder().setSeconds(5)) + .setSuccess(BlockResponse.newBuilder().setContent("grpc_operationCancelled")) + .build(); + + UnaryCallable blockCallable = grpcClient.blockCallable(); + ApiFuture blockResponseApiFuture = blockCallable.futureCall(blockRequest); + // Sleep 1s before cancelling to let the request go through + Thread.sleep(1000); + blockResponseApiFuture.cancel(true); + + List actualMetricDataList = getMetricDataList(); + verifyPointDataSum(actualMetricDataList, attemptCount); + + Map expectedAttributes = + ImmutableMap.of( + MetricsTracer.METHOD_ATTRIBUTE, + "Echo.Block", + MetricsTracer.LANGUAGE_ATTRIBUTE, + MetricsTracer.DEFAULT_LANGUAGE); + verifyDefaultMetricsAttributes(actualMetricDataList, expectedAttributes); + + List statusCountList = ImmutableList.of(new StatusCount(Code.CANCELLED)); + verifyStatusAttribute(actualMetricDataList, statusCountList); + } + + @Test + void testHttpJson_operationCancelled_recordsMetrics() throws Exception { + int attemptCount = 1; + BlockRequest blockRequest = + BlockRequest.newBuilder().setResponseDelay(Duration.newBuilder().setSeconds(5)).build(); + + UnaryCallable blockCallable = httpClient.blockCallable(); + ApiFuture blockResponseApiFuture = blockCallable.futureCall(blockRequest); + // Sleep 1s before cancelling to let the request go through + Thread.sleep(1000); + blockResponseApiFuture.cancel(true); + + List actualMetricDataList = getMetricDataList(); + verifyPointDataSum(actualMetricDataList, attemptCount); + + Map expectedAttributes = + ImmutableMap.of( + MetricsTracer.METHOD_ATTRIBUTE, + "Echo.Block", + MetricsTracer.LANGUAGE_ATTRIBUTE, + MetricsTracer.DEFAULT_LANGUAGE); + verifyDefaultMetricsAttributes(actualMetricDataList, expectedAttributes); + + List statusCountList = ImmutableList.of(new StatusCount(Code.CANCELLED)); + verifyStatusAttribute(actualMetricDataList, statusCountList); + } + + @Test + void testGrpc_operationFailed_recordsMetrics() throws InterruptedException { + int attemptCount = 1; + Code statusCode = Code.INVALID_ARGUMENT; + BlockRequest blockRequest = + BlockRequest.newBuilder() + .setResponseDelay(Duration.newBuilder().setSeconds(2)) + .setError(Status.newBuilder().setCode(statusCode.ordinal())) + .build(); + + UnaryCallable blockCallable = grpcClient.blockCallable(); + ApiFuture blockResponseApiFuture = blockCallable.futureCall(blockRequest); + assertThrows(ExecutionException.class, blockResponseApiFuture::get); + + List actualMetricDataList = getMetricDataList(); + verifyPointDataSum(actualMetricDataList, attemptCount); + + Map expectedAttributes = + ImmutableMap.of( + MetricsTracer.METHOD_ATTRIBUTE, + "Echo.Block", + MetricsTracer.LANGUAGE_ATTRIBUTE, + MetricsTracer.DEFAULT_LANGUAGE); + verifyDefaultMetricsAttributes(actualMetricDataList, expectedAttributes); + + List statusCountList = ImmutableList.of(new StatusCount(statusCode)); + verifyStatusAttribute(actualMetricDataList, statusCountList); + } + + @Test + void testHttpJson_operationFailed_recordsMetrics() throws InterruptedException { + int attemptCount = 1; + Code statusCode = Code.INVALID_ARGUMENT; + BlockRequest blockRequest = + BlockRequest.newBuilder() + .setResponseDelay(Duration.newBuilder().setSeconds(2)) + .setError(Status.newBuilder().setCode(statusCode.ordinal())) + .build(); + + UnaryCallable blockCallable = httpClient.blockCallable(); + ApiFuture blockResponseApiFuture = blockCallable.futureCall(blockRequest); + assertThrows(ExecutionException.class, blockResponseApiFuture::get); + + List actualMetricDataList = getMetricDataList(); + verifyPointDataSum(actualMetricDataList, attemptCount); + + Map expectedAttributes = + ImmutableMap.of( + MetricsTracer.METHOD_ATTRIBUTE, + "Echo.Block", + MetricsTracer.LANGUAGE_ATTRIBUTE, + MetricsTracer.DEFAULT_LANGUAGE); + verifyDefaultMetricsAttributes(actualMetricDataList, expectedAttributes); + + List statusCountList = ImmutableList.of(new StatusCount(statusCode)); + verifyStatusAttribute(actualMetricDataList, statusCountList); + } + + @Test + void testGrpc_attemptFailedRetriesExhausted_recordsMetrics() throws Exception { + int attemptCount = 3; + Code statusCode = Code.UNAVAILABLE; + // A custom EchoClient is used in this test because retries have jitter, and we cannot + // predict the number of attempts that are scheduled for an RPC invocation otherwise. + // The custom retrySettings limit to a set number of attempts before the call gives up. + RetrySettings retrySettings = + RetrySettings.newBuilder() + .setTotalTimeout(org.threeten.bp.Duration.ofMillis(5000L)) + .setMaxAttempts(3) + .build(); + + EchoStubSettings.Builder grpcEchoSettingsBuilder = EchoStubSettings.newBuilder(); + grpcEchoSettingsBuilder + .echoSettings() + .setRetrySettings(retrySettings) + .setRetryableCodes(ImmutableSet.of(statusCode)); + EchoSettings grpcEchoSettings = EchoSettings.create(grpcEchoSettingsBuilder.build()); + grpcEchoSettings = + grpcEchoSettings.toBuilder() + .setCredentialsProvider(NoCredentialsProvider.create()) + .setTransportChannelProvider( + EchoSettings.defaultGrpcTransportProviderBuilder() + .setChannelConfigurator(ManagedChannelBuilder::usePlaintext) + .build()) + .setEndpoint("localhost:7469") + .build(); + + EchoStubSettings echoStubSettings = + (EchoStubSettings) + grpcEchoSettings.getStubSettings().toBuilder() + .setTracerFactory( + new MetricsTracerFactory(createOtelMetricsRecorder(inMemoryMetricReader))) + .build(); + EchoStub stub = echoStubSettings.createStub(); + EchoClient grpcClient = EchoClient.create(stub); + + EchoRequest echoRequest = + EchoRequest.newBuilder() + .setError(Status.newBuilder().setCode(statusCode.ordinal()).build()) + .build(); + + assertThrows(UnavailableException.class, () -> grpcClient.echo(echoRequest)); + + List actualMetricDataList = getMetricDataList(); + verifyPointDataSum(actualMetricDataList, attemptCount); + + Map expectedAttributes = + ImmutableMap.of( + MetricsTracer.METHOD_ATTRIBUTE, + "Echo.Echo", + MetricsTracer.LANGUAGE_ATTRIBUTE, + MetricsTracer.DEFAULT_LANGUAGE); + verifyDefaultMetricsAttributes(actualMetricDataList, expectedAttributes); + + List statusCountList = ImmutableList.of(new StatusCount(statusCode, 3)); + verifyStatusAttribute(actualMetricDataList, statusCountList); + + grpcClient.close(); + grpcClient.awaitTermination(TestClientInitializer.AWAIT_TERMINATION_SECONDS, TimeUnit.SECONDS); + } + + @Test + void testHttpJson_attemptFailedRetriesExhausted_recordsMetrics() throws Exception { + int attemptCount = 3; + Code statusCode = Code.UNAVAILABLE; + // A custom EchoClient is used in this test because retries have jitter, and we cannot + // predict the number of attempts that are scheduled for an RPC invocation otherwise. + // The custom retrySettings limit to a set number of attempts before the call gives up. + RetrySettings retrySettings = + RetrySettings.newBuilder() + .setTotalTimeout(org.threeten.bp.Duration.ofMillis(5000L)) + .setMaxAttempts(3) + .build(); + + EchoStubSettings.Builder httpJsonEchoSettingsBuilder = EchoStubSettings.newHttpJsonBuilder(); + httpJsonEchoSettingsBuilder + .echoSettings() + .setRetrySettings(retrySettings) + .setRetryableCodes(ImmutableSet.of(statusCode)); + EchoSettings httpJsonEchoSettings = EchoSettings.create(httpJsonEchoSettingsBuilder.build()); + httpJsonEchoSettings = + httpJsonEchoSettings.toBuilder() + .setCredentialsProvider(NoCredentialsProvider.create()) + .setTransportChannelProvider( + EchoSettings.defaultHttpJsonTransportProviderBuilder() + .setHttpTransport( + new NetHttpTransport.Builder().doNotValidateCertificate().build()) + .setEndpoint("http://localhost:7469") + .build()) + .build(); + + EchoStubSettings echoStubSettings = + (EchoStubSettings) + httpJsonEchoSettings.getStubSettings().toBuilder() + .setTracerFactory( + new MetricsTracerFactory(createOtelMetricsRecorder(inMemoryMetricReader))) + .build(); + EchoStub stub = echoStubSettings.createStub(); + EchoClient httpClient = EchoClient.create(stub); + + EchoRequest echoRequest = + EchoRequest.newBuilder() + .setError(Status.newBuilder().setCode(statusCode.ordinal()).build()) + .build(); + + assertThrows(UnavailableException.class, () -> httpClient.echo(echoRequest)); + + List actualMetricDataList = getMetricDataList(); + verifyPointDataSum(actualMetricDataList, attemptCount); + + Map expectedAttributes = + ImmutableMap.of( + MetricsTracer.METHOD_ATTRIBUTE, + "Echo.Echo", + MetricsTracer.LANGUAGE_ATTRIBUTE, + MetricsTracer.DEFAULT_LANGUAGE); + verifyDefaultMetricsAttributes(actualMetricDataList, expectedAttributes); + + List statusCountList = ImmutableList.of(new StatusCount(statusCode, 3)); + verifyStatusAttribute(actualMetricDataList, statusCountList); + + httpClient.close(); + httpClient.awaitTermination(TestClientInitializer.AWAIT_TERMINATION_SECONDS, TimeUnit.SECONDS); + } + + @Test + void testGrpc_attemptPermanentFailure_recordsMetrics() throws InterruptedException { + int attemptCount = 1; + Code statusCode = Code.INVALID_ARGUMENT; + BlockRequest blockRequest = + BlockRequest.newBuilder() + .setResponseDelay(Duration.newBuilder().setSeconds(2).build()) + .setError(Status.newBuilder().setCode(statusCode.ordinal()).build()) + .build(); + + assertThrows(InvalidArgumentException.class, () -> grpcClient.block(blockRequest)); + + List actualMetricDataList = getMetricDataList(); + verifyPointDataSum(actualMetricDataList, attemptCount); + + Map expectedAttributes = + ImmutableMap.of( + MetricsTracer.METHOD_ATTRIBUTE, + "Echo.Block", + MetricsTracer.LANGUAGE_ATTRIBUTE, + MetricsTracer.DEFAULT_LANGUAGE); + verifyDefaultMetricsAttributes(actualMetricDataList, expectedAttributes); + + List statusCountList = ImmutableList.of(new StatusCount(statusCode)); + verifyStatusAttribute(actualMetricDataList, statusCountList); + } + + @Test + void testHttpJson_attemptPermanentFailure_recordsMetrics() throws InterruptedException { + int attemptCount = 1; + Code statusCode = Code.INVALID_ARGUMENT; + BlockRequest blockRequest = + BlockRequest.newBuilder() + .setResponseDelay(Duration.newBuilder().setSeconds(2).build()) + .setError(Status.newBuilder().setCode(statusCode.ordinal()).build()) + .build(); + + assertThrows(InvalidArgumentException.class, () -> httpClient.block(blockRequest)); + + List actualMetricDataList = getMetricDataList(); + verifyPointDataSum(actualMetricDataList, attemptCount); + + Map expectedAttributes = + ImmutableMap.of( + MetricsTracer.METHOD_ATTRIBUTE, + "Echo.Block", + MetricsTracer.LANGUAGE_ATTRIBUTE, + MetricsTracer.DEFAULT_LANGUAGE); + verifyDefaultMetricsAttributes(actualMetricDataList, expectedAttributes); + + List statusCountList = ImmutableList.of(new StatusCount(statusCode)); + verifyStatusAttribute(actualMetricDataList, statusCountList); + } + + @Test + void testGrpc_multipleFailedAttempts_successfulOperation() throws Exception { + int attemptCount = 3; + // Disable Jitter on this test to try and ensure that the there are 3 attempts made + // for test. The first two calls should result in a DEADLINE_EXCEEDED exception as + // 0.5s and 1s are too short for the 1s blocking call (1s still requires time for + // the showcase server to respond back to the client). The 3rd and final call (2s) + // should result in an OK Status Code. + RetrySettings retrySettings = + RetrySettings.newBuilder() + .setInitialRpcTimeout(org.threeten.bp.Duration.ofMillis(500L)) + .setRpcTimeoutMultiplier(2.0) + .setMaxRpcTimeout(org.threeten.bp.Duration.ofMillis(2000L)) + .setTotalTimeout(org.threeten.bp.Duration.ofMillis(6000L)) + .setJittered(false) + .build(); + + EchoStubSettings.Builder grpcEchoSettingsBuilder = EchoStubSettings.newBuilder(); + grpcEchoSettingsBuilder + .blockSettings() + .setRetrySettings(retrySettings) + .setRetryableCodes(ImmutableSet.of(Code.DEADLINE_EXCEEDED)); + EchoSettings grpcEchoSettings = EchoSettings.create(grpcEchoSettingsBuilder.build()); + grpcEchoSettings = + grpcEchoSettings.toBuilder() + .setCredentialsProvider(NoCredentialsProvider.create()) + .setTransportChannelProvider( + EchoSettings.defaultGrpcTransportProviderBuilder() + .setChannelConfigurator(ManagedChannelBuilder::usePlaintext) + .build()) + .setEndpoint("localhost:7469") + .build(); + + EchoStubSettings echoStubSettings = + (EchoStubSettings) + grpcEchoSettings.getStubSettings().toBuilder() + .setTracerFactory( + new MetricsTracerFactory(createOtelMetricsRecorder(inMemoryMetricReader))) + .build(); + EchoStub stub = echoStubSettings.createStub(); + + EchoClient grpcClient = EchoClient.create(stub); + + BlockRequest blockRequest = + BlockRequest.newBuilder() + .setResponseDelay(Duration.newBuilder().setSeconds(1)) + .setSuccess(BlockResponse.newBuilder().setContent("grpcBlockResponse")) + .build(); + + grpcClient.block(blockRequest); + + List actualMetricDataList = getMetricDataList(); + verifyPointDataSum(actualMetricDataList, attemptCount); + + Map expectedAttributes = + ImmutableMap.of( + MetricsTracer.METHOD_ATTRIBUTE, + "Echo.Block", + MetricsTracer.LANGUAGE_ATTRIBUTE, + MetricsTracer.DEFAULT_LANGUAGE); + verifyDefaultMetricsAttributes(actualMetricDataList, expectedAttributes); + + List statusCountList = + ImmutableList.of(new StatusCount(Code.DEADLINE_EXCEEDED, 2), new StatusCount(Code.OK)); + verifyStatusAttribute(actualMetricDataList, statusCountList); + + grpcClient.close(); + grpcClient.awaitTermination(TestClientInitializer.AWAIT_TERMINATION_SECONDS, TimeUnit.SECONDS); + } + + @Test + void testHttpJson_multipleFailedAttempts_successfulOperation() throws Exception { + int attemptCount = 3; + RetrySettings retrySettings = + RetrySettings.newBuilder() + .setInitialRpcTimeout(org.threeten.bp.Duration.ofMillis(500L)) + .setRpcTimeoutMultiplier(2.0) + .setMaxRpcTimeout(org.threeten.bp.Duration.ofMillis(2000L)) + .setTotalTimeout(org.threeten.bp.Duration.ofMillis(6000L)) + .setJittered(false) + .build(); + + EchoStubSettings.Builder httpJsonEchoSettingsBuilder = EchoStubSettings.newHttpJsonBuilder(); + httpJsonEchoSettingsBuilder + .blockSettings() + .setRetrySettings(retrySettings) + .setRetryableCodes(ImmutableSet.of(Code.DEADLINE_EXCEEDED)); + EchoSettings httpJsonEchoSettings = EchoSettings.create(httpJsonEchoSettingsBuilder.build()); + httpJsonEchoSettings = + httpJsonEchoSettings.toBuilder() + .setCredentialsProvider(NoCredentialsProvider.create()) + .setTransportChannelProvider( + EchoSettings.defaultHttpJsonTransportProviderBuilder() + .setHttpTransport( + new NetHttpTransport.Builder().doNotValidateCertificate().build()) + .setEndpoint("http://localhost:7469") + .build()) + .build(); + + EchoStubSettings echoStubSettings = + (EchoStubSettings) + httpJsonEchoSettings.getStubSettings().toBuilder() + .setTracerFactory( + new MetricsTracerFactory(createOtelMetricsRecorder(inMemoryMetricReader))) + .build(); + EchoStub stub = echoStubSettings.createStub(); + + EchoClient httpClient = EchoClient.create(stub); + + BlockRequest blockRequest = + BlockRequest.newBuilder() + .setResponseDelay(Duration.newBuilder().setSeconds(1)) + .setSuccess(BlockResponse.newBuilder().setContent("httpjsonBlockResponse")) + .build(); + + httpClient.block(blockRequest); + + List actualMetricDataList = getMetricDataList(); + verifyPointDataSum(actualMetricDataList, attemptCount); + + Map expectedAttributes = + ImmutableMap.of( + MetricsTracer.METHOD_ATTRIBUTE, + "Echo.Block", + MetricsTracer.LANGUAGE_ATTRIBUTE, + MetricsTracer.DEFAULT_LANGUAGE); + verifyDefaultMetricsAttributes(actualMetricDataList, expectedAttributes); + + httpClient.close(); + httpClient.awaitTermination(TestClientInitializer.AWAIT_TERMINATION_SECONDS, TimeUnit.SECONDS); + } + + @Test + void recordsCustomAttributes() throws InterruptedException, IOException { + InstantiatingGrpcChannelProvider channelProvider = + EchoSettings.defaultGrpcTransportProviderBuilder() + .setChannelConfigurator(ManagedChannelBuilder::usePlaintext) + .setAttemptDirectPathXds() + .build(); + + // Add custom attributes to be added as client level attributes + Map customAttributes = new HashMap<>(); + String directpathEnabled = "directpath_enabled"; + customAttributes.put(directpathEnabled, String.valueOf(channelProvider.canUseDirectPath())); + String directpathXdsEnabled = "directpathxds_enabled"; + customAttributes.put( + directpathXdsEnabled, String.valueOf(channelProvider.isDirectPathXdsEnabled())); + String randomAttributeKey1 = "testing"; + String randomAttributeValue1 = "showcase"; + String randomAttributeKey2 = "hello"; + String randomAttributeValue2 = "world"; + customAttributes.put(randomAttributeKey1, randomAttributeValue1); + customAttributes.put(randomAttributeKey2, randomAttributeValue2); + + InMemoryMetricReader inMemoryMetricReader = InMemoryMetricReader.create(); + OpenTelemetryMetricsRecorder otelMetricsRecorder = + createOtelMetricsRecorder(inMemoryMetricReader); + MetricsTracerFactory metricsTracerFactory = + new MetricsTracerFactory(otelMetricsRecorder, customAttributes); + + EchoSettings grpcEchoSettings = + EchoSettings.newBuilder() + .setCredentialsProvider(NoCredentialsProvider.create()) + .setTransportChannelProvider(channelProvider) + .setEndpoint(TestClientInitializer.DEFAULT_GRPC_ENDPOINT) + .build(); + + EchoStubSettings echoStubSettings = + (EchoStubSettings) + grpcEchoSettings.getStubSettings().toBuilder() + .setTracerFactory(metricsTracerFactory) + .build(); + EchoStub stub = echoStubSettings.createStub(); + EchoClient grpcClient = EchoClient.create(stub); + + EchoRequest echoRequest = EchoRequest.newBuilder().setContent("content").build(); + grpcClient.echo(echoRequest); + + List actualMetricDataList = getMetricDataList(inMemoryMetricReader); + Map expectedAttributes = + ImmutableMap.of( + MetricsTracer.METHOD_ATTRIBUTE, + "Echo.Echo", + MetricsTracer.LANGUAGE_ATTRIBUTE, + MetricsTracer.DEFAULT_LANGUAGE, + directpathEnabled, + "false", + directpathXdsEnabled, + "true", + randomAttributeKey1, + randomAttributeValue1, + randomAttributeKey2, + randomAttributeValue2); + verifyDefaultMetricsAttributes(actualMetricDataList, expectedAttributes); + } + + // This test case uses GrpcOpenTelemetry from grpc-java and includes additional grpc-java specific + // metrics. This test case ensures that the `setSampledToLocalTracing` set to true will ensure + // that + // the gRPC full method name in the stub is recorded (not recorded as `other`). + @Test + void grpcOpenTelemetryImplementation_setSampledToLocalTracing_methodFullNameIsRecorded() + throws Exception { + SdkMeterProvider sdkMeterProvider = + SdkMeterProvider.builder().registerMetricReader(inMemoryMetricReader).build(); + + OpenTelemetry openTelemetry = + OpenTelemetrySdk.builder().setMeterProvider(sdkMeterProvider).build(); + + GrpcOpenTelemetry grpcOpenTelemetry = GrpcOpenTelemetry.newBuilder().sdk(openTelemetry).build(); + + // Java-Spanner configures the InstantiatingGrpcChannelProvider with gRPCOpenTelemetry + // This setup below is copied from their implementation + InstantiatingGrpcChannelProvider.Builder builder = + EchoSettings.defaultGrpcTransportProviderBuilder(); + ApiFunction channelConfigurator = + builder.getChannelConfigurator(); + builder.setChannelConfigurator( + b -> { + b.usePlaintext(); + grpcOpenTelemetry.configureChannelBuilder(b); + if (channelConfigurator != null) { + return channelConfigurator.apply(b); + } + return b; + }); + + OpenTelemetryMetricsRecorder otelMetricsRecorder = + new OpenTelemetryMetricsRecorder(openTelemetry, SERVICE_NAME); + + // Create a custom EchoClient that is different from what is created by default in setup() + EchoClient echoClient = + TestClientInitializer.createGrpcEchoClientOpentelemetry( + new MetricsTracerFactory(otelMetricsRecorder), builder.build()); + + EchoRequest echoRequest = + EchoRequest.newBuilder().setContent("test_grpc_request_succeeded").build(); + echoClient.echo(echoRequest); + + List metricDataList = getMetricDataList(); + + String gRPCMetricNamePrefix = "grpc."; + String gRPCMethodNameAttributeKey = "grpc.method"; + + List grpcMetricDataList = + metricDataList.stream() + .filter(x -> x.getName().startsWith(gRPCMetricNamePrefix)) + .collect(Collectors.toList()); + Truth.assertThat(grpcMetricDataList).isNotEmpty(); + for (MetricData grpcMetricData : grpcMetricDataList) { + List pointDataList = new ArrayList<>(grpcMetricData.getData().getPoints()); + + for (PointData pointData : pointDataList) { + String methodName = + pointData.getAttributes().get(AttributeKey.stringKey(gRPCMethodNameAttributeKey)); + + // All the attributes in the gRPC metrics should have the full method name + Truth.assertThat(methodName).doesNotMatch("other"); + Truth.assertThat(methodName).matches("^google.showcase.v1beta1.Echo/.*$"); + } + } + + echoClient.close(); + echoClient.awaitTermination(TestClientInitializer.AWAIT_TERMINATION_SECONDS, TimeUnit.SECONDS); + } +} diff --git a/java-showcase-3.25.8/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/ITPagination.java b/java-showcase-3.25.8/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/ITPagination.java new file mode 100644 index 0000000000..ebcabeab9e --- /dev/null +++ b/java-showcase-3.25.8/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/ITPagination.java @@ -0,0 +1,147 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.it; + +import static com.google.common.truth.Truth.assertThat; + +import com.google.showcase.v1beta1.EchoClient; +import com.google.showcase.v1beta1.EchoResponse; +import com.google.showcase.v1beta1.PagedExpandRequest; +import com.google.showcase.v1beta1.it.util.TestClientInitializer; +import java.util.concurrent.TimeUnit; +import org.junit.jupiter.api.AfterAll; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Test; + +class ITPagination { + + private static EchoClient grpcClient; + private static EchoClient httpjsonClient; + + @BeforeAll + static void createClients() throws Exception { + // Create gRPC Echo Client + grpcClient = TestClientInitializer.createGrpcEchoClient(); + // Create Http JSON Echo Client + httpjsonClient = TestClientInitializer.createHttpJsonEchoClient(); + } + + @AfterAll + static void destroyClients() throws InterruptedException { + grpcClient.close(); + httpjsonClient.close(); + + grpcClient.awaitTermination(TestClientInitializer.AWAIT_TERMINATION_SECONDS, TimeUnit.SECONDS); + httpjsonClient.awaitTermination( + TestClientInitializer.AWAIT_TERMINATION_SECONDS, TimeUnit.SECONDS); + } + + // This tests that pagination returns the correct number of pages + responses and that + // the content is correct. + // + // The pageToken is where the streaming responses come back from and the page size denotes + // how many of the responses come back together (in a page). i.e for PageSize = 2 and + // PageToken = 3, see below: + // | A | Series | Of | Words | That | Will | Be | Sent | Back | One | By | One + // Page # | - | - | - | 1 | 1 | 2 | 2 | 3 | 3 | 4 | 4 | 5 + // Token # | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 + @Test + void testPagedExpandWithTokenGrpc() { + int pageSize = 2; + int pageToken = 3; + String content = "A series of words that will be sent back one by one"; + int contentLength = content.split(" ").length; + + EchoClient.PagedExpandPagedResponse pagedExpandPagedResponse = + grpcClient.pagedExpand( + PagedExpandRequest.newBuilder() + .setContent(content) + .setPageSize(pageSize) + .setPageToken(String.valueOf(pageToken)) + .build()); + + String[] expected = content.split(" "); + int numExpectedPages = ((contentLength - pageToken) / pageSize); + // If the responses can't be evenly split into pages, then the extra responses + // will go to an additional page + if ((contentLength - pageToken) % pageSize != 0) { + numExpectedPages++; + } + int numExpectedResponses = contentLength - pageToken; + + validatePagedResponses( + pagedExpandPagedResponse, expected, pageToken, numExpectedResponses, numExpectedPages); + } + + // This tests that pagination returns the correct number of pages + responses and that + // the content is correct. + // + // The pageToken is where the streaming responses come back from and the page size denotes + // how many of the responses come back together (in a page). i.e for PageSize = 2 and + // PageToken = 3, see below: + // | A | Series | Of | Words | That | Will | Be | Sent | Back | One | By | One + // Page # | - | - | - | 1 | 1 | 2 | 2 | 3 | 3 | 4 | 4 | 5 + // Token # | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 + @Test + void testPagedExpandWithTokenHttpJson() { + int pageSize = 2; + int pageToken = 3; + String content = "A series of words that will be sent back one by one"; + int contentLength = content.split(" ").length; + + EchoClient.PagedExpandPagedResponse pagedExpandPagedResponse = + httpjsonClient.pagedExpand( + PagedExpandRequest.newBuilder() + .setContent(content) + .setPageSize(pageSize) + .setPageToken(String.valueOf(pageToken)) + .build()); + + String[] expected = content.split(" "); + int numExpectedPages = ((contentLength - pageToken) / pageSize); + // If the responses can't be evenly split into pages, then the extra responses + // will go to an additional page + if ((contentLength - pageToken) % pageSize != 0) { + numExpectedPages++; + } + int numExpectedResponses = contentLength - pageToken; + + validatePagedResponses( + pagedExpandPagedResponse, expected, pageToken, numExpectedResponses, numExpectedPages); + } + + private void validatePagedResponses( + EchoClient.PagedExpandPagedResponse pagedExpandPagedResponse, + String[] expected, + int pageToken, + int numExpectedResponses, + int numExpectedPages) { + int numResponses = 0; + int numPages = 0; + for (EchoClient.PagedExpandPage page : pagedExpandPagedResponse.iteratePages()) { + for (EchoResponse echoResponse : page.getValues()) { + // Add pageToken as offset to the expected array to start indexing at the pageToken + assertThat(echoResponse.getContent()).isEqualTo(expected[numResponses + pageToken]); + numResponses++; + } + numPages++; + } + + assertThat(numPages).isEqualTo(numExpectedPages); + assertThat(numResponses).isEqualTo(numExpectedResponses); + } +} diff --git a/java-showcase-3.25.8/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/ITServerSideStreaming.java b/java-showcase-3.25.8/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/ITServerSideStreaming.java new file mode 100644 index 0000000000..9d9ccba39e --- /dev/null +++ b/java-showcase-3.25.8/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/ITServerSideStreaming.java @@ -0,0 +1,201 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.it; + +import static com.google.common.truth.Truth.assertThat; +import static org.junit.jupiter.api.Assertions.assertThrows; + +import com.google.api.gax.core.NoCredentialsProvider; +import com.google.api.gax.rpc.CancelledException; +import com.google.api.gax.rpc.ServerStream; +import com.google.api.gax.rpc.StatusCode; +import com.google.api.gax.rpc.WatchdogTimeoutException; +import com.google.common.collect.ImmutableList; +import com.google.rpc.Status; +import com.google.showcase.v1beta1.EchoClient; +import com.google.showcase.v1beta1.EchoResponse; +import com.google.showcase.v1beta1.EchoSettings; +import com.google.showcase.v1beta1.ExpandRequest; +import com.google.showcase.v1beta1.it.util.TestClientInitializer; +import io.grpc.ManagedChannelBuilder; +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; +import java.util.concurrent.TimeUnit; +import java.util.stream.Collectors; +import org.junit.jupiter.api.AfterAll; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; +import org.threeten.bp.Duration; + +class ITServerSideStreaming { + + private static EchoClient grpcClient; + private static EchoClient httpjsonClient; + + @BeforeAll + static void createClients() throws Exception { + // Create gRPC Echo Client + grpcClient = TestClientInitializer.createGrpcEchoClient(); + // Create Http JSON Echo Client + httpjsonClient = TestClientInitializer.createHttpJsonEchoClient(); + } + + @AfterAll + static void destroyClients() throws InterruptedException { + grpcClient.close(); + httpjsonClient.close(); + + grpcClient.awaitTermination(TestClientInitializer.AWAIT_TERMINATION_SECONDS, TimeUnit.SECONDS); + httpjsonClient.awaitTermination( + TestClientInitializer.AWAIT_TERMINATION_SECONDS, TimeUnit.SECONDS); + } + + @Test + void testGrpc_receiveStreamedContent() { + String content = "The rain in Spain stays mainly on the plain!"; + ServerStream responseStream = + grpcClient.expandCallable().call(ExpandRequest.newBuilder().setContent(content).build()); + ArrayList responses = new ArrayList<>(); + for (EchoResponse response : responseStream) { + responses.add(response.getContent()); + } + + assertThat(responses) + .containsExactlyElementsIn( + ImmutableList.of( + "The", "rain", "in", "Spain", "stays", "mainly", "on", "the", "plain!")) + .inOrder(); + } + + @Test + void testGrpc_receiveStreamedContentStreamAPI() { + String content = "The rain in Spain stays mainly on the plain!"; + ServerStream responseStream = + grpcClient.expandCallable().call(ExpandRequest.newBuilder().setContent(content).build()); + assertThat(responseStream.stream().map(EchoResponse::getContent).collect(Collectors.toList())) + .containsExactlyElementsIn( + ImmutableList.of( + "The", "rain", "in", "Spain", "stays", "mainly", "on", "the", "plain!")) + .inOrder(); + } + + @Test + void testGrpc_serverError_receiveErrorAfterLastWordInStream() { + String content = "The rain in Spain"; + Status cancelledStatus = + Status.newBuilder().setCode(StatusCode.Code.CANCELLED.ordinal()).build(); + ServerStream responseStream = + grpcClient + .expandCallable() + .call(ExpandRequest.newBuilder().setContent(content).setError(cancelledStatus).build()); + Iterator echoResponseIterator = responseStream.iterator(); + + assertThat(echoResponseIterator.next().getContent()).isEqualTo("The"); + assertThat(echoResponseIterator.next().getContent()).isEqualTo("rain"); + assertThat(echoResponseIterator.next().getContent()).isEqualTo("in"); + assertThat(echoResponseIterator.next().getContent()).isEqualTo("Spain"); + CancelledException cancelledException = + assertThrows(CancelledException.class, echoResponseIterator::next); + assertThat(cancelledException.getStatusCode().getCode()).isEqualTo(StatusCode.Code.CANCELLED); + } + + @Test + void testGrpc_serverWaitTimeout_watchdogCancelsStream() throws Exception { + EchoSettings.Builder settings = + EchoSettings.newBuilder() + .setCredentialsProvider(NoCredentialsProvider.create()) + .setTransportChannelProvider( + EchoSettings.defaultGrpcTransportProviderBuilder() + .setChannelConfigurator(ManagedChannelBuilder::usePlaintext) + .build()) + .setEndpoint("localhost:7469"); + + settings + .expandSettings() + .setIdleTimeout(Duration.ofMillis(100)) + .setWaitTimeout(Duration.ofMillis(100)); + + settings.getStubSettingsBuilder().setStreamWatchdogCheckInterval(Duration.ofMillis(50)); + + EchoClient echoClient = EchoClient.create(settings.build()); + + String content = "The rain in Spain stays mainly on the plain!"; + ServerStream responseStream = + echoClient + .expandCallable() + .call( + ExpandRequest.newBuilder() + .setContent(content) + // Configure server interval for returning the next response + .setStreamWaitTime( + com.google.protobuf.Duration.newBuilder().setSeconds(1).build()) + .build()); + List responses = new ArrayList<>(); + WatchdogTimeoutException exception = + assertThrows( + WatchdogTimeoutException.class, + () -> responseStream.forEach(x -> responses.add(x.getContent()))); + assertThat(exception) + .hasMessageThat() + .contains("Canceled due to timeout waiting for next response"); + echoClient.close(); + echoClient.awaitTermination(TestClientInitializer.AWAIT_TERMINATION_SECONDS, TimeUnit.SECONDS); + } + + @Test + void testHttpJson_receiveStreamedContent() { + String content = "The rain in Spain stays mainly on the plain!"; + ServerStream responseStream = + httpjsonClient + .expandCallable() + .call(ExpandRequest.newBuilder().setContent(content).build()); + ArrayList responses = new ArrayList<>(); + for (EchoResponse response : responseStream) { + responses.add(response.getContent()); + } + + assertThat(responses) + .containsExactlyElementsIn( + ImmutableList.of( + "The", "rain", "in", "Spain", "stays", "mainly", "on", "the", "plain!")) + .inOrder(); + } + + @Disabled( + value = "Ignore until https://github.com/googleapis/gapic-showcase/issues/1286 is resolved") + @Test + void testHttpJson_serverError_receiveErrorAfterLastWordInStream() { + String content = "The rain in Spain"; + Status cancelledStatus = + Status.newBuilder().setCode(StatusCode.Code.CANCELLED.ordinal()).build(); + ServerStream responseStream = + httpjsonClient + .expandCallable() + .call(ExpandRequest.newBuilder().setContent(content).setError(cancelledStatus).build()); + Iterator echoResponseIterator = responseStream.iterator(); + + assertThat(echoResponseIterator.next().getContent()).isEqualTo("The"); + assertThat(echoResponseIterator.next().getContent()).isEqualTo("rain"); + assertThat(echoResponseIterator.next().getContent()).isEqualTo("in"); + assertThat(echoResponseIterator.next().getContent()).isEqualTo("Spain"); + CancelledException cancelledException = + assertThrows(CancelledException.class, echoResponseIterator::next); + assertThat(cancelledException.getStatusCode().getCode()).isEqualTo(StatusCode.Code.CANCELLED); + } +} diff --git a/java-showcase-3.25.8/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/ITTimeObjectsPropagationTest.java b/java-showcase-3.25.8/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/ITTimeObjectsPropagationTest.java new file mode 100644 index 0000000000..f7f801f627 --- /dev/null +++ b/java-showcase-3.25.8/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/ITTimeObjectsPropagationTest.java @@ -0,0 +1,64 @@ +package com.google.showcase.v1beta1.it; + +import static org.junit.Assert.assertEquals; + +import com.google.api.gax.retrying.RetrySettings; +import org.junit.Test; + +/** + * Tests to confirm that usage of retry settings can be done regardless of whether threeten or + * java.time is being used + */ +public class ITTimeObjectsPropagationTest { + @Test + public void testRetrySettings_fromJavaTimeHasEquivalentThreetenValues() { + java.time.Duration javaTimeCommonValue = java.time.Duration.ofMillis(123l); + org.threeten.bp.Duration threetenConvertedValue = + org.threeten.bp.Duration.ofMillis(javaTimeCommonValue.toMillis()); + RetrySettings javaTimeRetrySettings = + RetrySettings.newBuilder() + .setInitialRetryDelayDuration(javaTimeCommonValue) + .setMaxRetryDelayDuration(javaTimeCommonValue) + .setInitialRpcTimeoutDuration(javaTimeCommonValue) + .setMaxRpcTimeoutDuration(javaTimeCommonValue) + .setTotalTimeoutDuration(javaTimeCommonValue) + .build(); + + assertEquals( + threetenConvertedValue.toMillis(), javaTimeRetrySettings.getInitialRetryDelay().toMillis()); + assertEquals( + threetenConvertedValue.toMillis(), javaTimeRetrySettings.getMaxRetryDelay().toMillis()); + assertEquals( + threetenConvertedValue.toMillis(), javaTimeRetrySettings.getInitialRpcTimeout().toMillis()); + assertEquals( + threetenConvertedValue.toMillis(), javaTimeRetrySettings.getMaxRpcTimeout().toMillis()); + assertEquals( + threetenConvertedValue.toMillis(), javaTimeRetrySettings.getTotalTimeout().toMillis()); + } + + @Test + public void testRetrySettings_fromThreetenHasEquivalentJavaTimeValues() { + org.threeten.bp.Duration threetenCommonValue = org.threeten.bp.Duration.ofMillis(123l); + java.time.Duration javaTimeConvertedValue = + java.time.Duration.ofMillis(threetenCommonValue.toMillis()); + RetrySettings threetenRetrySettings = + RetrySettings.newBuilder() + .setInitialRetryDelay(threetenCommonValue) + .setMaxRetryDelay(threetenCommonValue) + .setInitialRpcTimeout(threetenCommonValue) + .setMaxRpcTimeout(threetenCommonValue) + .setTotalTimeout(threetenCommonValue) + .build(); + + assertEquals( + javaTimeConvertedValue.toMillis(), threetenRetrySettings.getInitialRetryDelay().toMillis()); + assertEquals( + javaTimeConvertedValue.toMillis(), threetenRetrySettings.getMaxRetryDelay().toMillis()); + assertEquals( + javaTimeConvertedValue.toMillis(), threetenRetrySettings.getInitialRpcTimeout().toMillis()); + assertEquals( + javaTimeConvertedValue.toMillis(), threetenRetrySettings.getMaxRpcTimeout().toMillis()); + assertEquals( + javaTimeConvertedValue.toMillis(), threetenRetrySettings.getTotalTimeout().toMillis()); + } +} diff --git a/java-showcase-3.25.8/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/ITUnaryCallable.java b/java-showcase-3.25.8/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/ITUnaryCallable.java new file mode 100644 index 0000000000..4d6018f6fc --- /dev/null +++ b/java-showcase-3.25.8/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/ITUnaryCallable.java @@ -0,0 +1,101 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.it; + +import static com.google.common.truth.Truth.assertThat; +import static org.junit.jupiter.api.Assertions.assertThrows; + +import com.google.api.gax.grpc.GrpcStatusCode; +import com.google.api.gax.rpc.CancelledException; +import com.google.api.gax.rpc.StatusCode; +import com.google.rpc.Status; +import com.google.showcase.v1beta1.EchoClient; +import com.google.showcase.v1beta1.EchoRequest; +import com.google.showcase.v1beta1.EchoResponse; +import com.google.showcase.v1beta1.it.util.TestClientInitializer; +import java.util.concurrent.TimeUnit; +import org.junit.jupiter.api.AfterAll; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Test; + +class ITUnaryCallable { + + private static EchoClient grpcClient; + + private static EchoClient httpjsonClient; + + @BeforeAll + static void createClients() throws Exception { + // Create gRPC Echo Client + grpcClient = TestClientInitializer.createGrpcEchoClient(); + // Create Http JSON Echo Client + httpjsonClient = TestClientInitializer.createHttpJsonEchoClient(); + } + + @AfterAll + static void destroyClients() throws InterruptedException { + grpcClient.close(); + httpjsonClient.close(); + + grpcClient.awaitTermination(TestClientInitializer.AWAIT_TERMINATION_SECONDS, TimeUnit.SECONDS); + httpjsonClient.awaitTermination( + TestClientInitializer.AWAIT_TERMINATION_SECONDS, TimeUnit.SECONDS); + } + + @Test + void testGrpc_receiveContent() { + assertThat(echoGrpc("grpc-echo?")).isEqualTo("grpc-echo?"); + assertThat(echoGrpc("grpc-echo!")).isEqualTo("grpc-echo!"); + } + + @Test + void testGrpc_serverResponseError_throwsException() { + Status cancelledStatus = + Status.newBuilder().setCode(StatusCode.Code.CANCELLED.ordinal()).build(); + EchoRequest requestWithServerError = EchoRequest.newBuilder().setError(cancelledStatus).build(); + CancelledException exception = + assertThrows(CancelledException.class, () -> grpcClient.echo(requestWithServerError)); + assertThat(exception.getStatusCode().getCode()).isEqualTo(GrpcStatusCode.Code.CANCELLED); + } + + @Test + void testHttpJson_receiveContent() { + assertThat(echoHttpJson("http-echo?")).isEqualTo("http-echo?"); + assertThat(echoHttpJson("http-echo!")).isEqualTo("http-echo!"); + } + + @Test + void testHttpJson_serverResponseError_throwsException() { + EchoRequest requestWithServerError = + EchoRequest.newBuilder() + .setError(Status.newBuilder().setCode(StatusCode.Code.CANCELLED.ordinal()).build()) + .build(); + CancelledException exception = + assertThrows(CancelledException.class, () -> httpjsonClient.echo(requestWithServerError)); + assertThat(exception.getStatusCode().getCode()).isEqualTo(StatusCode.Code.CANCELLED); + } + + private String echoGrpc(String value) { + EchoResponse response = grpcClient.echo(EchoRequest.newBuilder().setContent(value).build()); + return response.getContent(); + } + + private String echoHttpJson(String value) { + EchoResponse response = httpjsonClient.echo(EchoRequest.newBuilder().setContent(value).build()); + return response.getContent(); + } +} diff --git a/java-showcase-3.25.8/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/ITUnaryDeadline.java b/java-showcase-3.25.8/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/ITUnaryDeadline.java new file mode 100644 index 0000000000..984598bc9e --- /dev/null +++ b/java-showcase-3.25.8/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/ITUnaryDeadline.java @@ -0,0 +1,368 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.showcase.v1beta1.it; + +import static com.google.common.truth.Truth.assertThat; +import static org.junit.jupiter.api.Assertions.assertThrows; + +import com.google.api.gax.retrying.RetrySettings; +import com.google.api.gax.retrying.RetryingFuture; +import com.google.api.gax.rpc.DeadlineExceededException; +import com.google.api.gax.rpc.StatusCode; +import com.google.common.collect.ImmutableSet; +import com.google.showcase.v1beta1.BlockRequest; +import com.google.showcase.v1beta1.BlockResponse; +import com.google.showcase.v1beta1.EchoClient; +import com.google.showcase.v1beta1.it.util.TestClientInitializer; +import java.util.concurrent.ExecutionException; +import java.util.concurrent.TimeUnit; +import org.junit.jupiter.api.Test; +import org.threeten.bp.Duration; + +/** + * For this test, we test a combination of various RetrySettings to try and ensure that the timeouts + * set by the customer are cancelled when timeouts have exceeded their limits + * + *

        Each test attempts to get the number of attempts done in each call. The attemptCount is + * incremented by 1 as the first attempt is zero indexed. + */ +class ITUnaryDeadline { + + @Test + void testGRPC_unarySuccessfulResponse_doesNotExceedTotalTimeout() throws Exception { + RetrySettings defaultNoRetrySettings = + RetrySettings.newBuilder() + .setInitialRpcTimeout(Duration.ofMillis(5000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ofMillis(5000L)) + .setTotalTimeout(Duration.ofMillis(5000L)) + // Explicitly set retries as disabled (maxAttempts == 1) + .setMaxAttempts(1) + .build(); + EchoClient grpcClient = + TestClientInitializer.createGrpcEchoClientCustomBlockSettings( + defaultNoRetrySettings, ImmutableSet.of(StatusCode.Code.DEADLINE_EXCEEDED)); + try { + BlockRequest blockRequest = + BlockRequest.newBuilder() + .setSuccess(BlockResponse.newBuilder().setContent("gRPCBlockContent_3sDelay_noRetry")) + .setResponseDelay(com.google.protobuf.Duration.newBuilder().setSeconds(3).build()) + .build(); + RetryingFuture retryingFuture = + (RetryingFuture) grpcClient.blockCallable().futureCall(blockRequest); + BlockResponse blockResponse = retryingFuture.get(10, TimeUnit.SECONDS); + assertThat(blockResponse.getContent()).isEqualTo("gRPCBlockContent_3sDelay_noRetry"); + // Guarantee that this only runs once + int attemptCount = retryingFuture.getAttemptSettings().getAttemptCount() + 1; + assertThat(attemptCount).isEqualTo(1); + } finally { + grpcClient.close(); + grpcClient.awaitTermination( + TestClientInitializer.AWAIT_TERMINATION_SECONDS, TimeUnit.SECONDS); + } + } + + @Test + void testHttpJson_unarySuccessfulResponse_doesNotExceedTotalTimeout() throws Exception { + RetrySettings defaultNoRetrySettings = + RetrySettings.newBuilder() + .setInitialRpcTimeout(Duration.ofMillis(5000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ofMillis(5000L)) + .setTotalTimeout(Duration.ofMillis(5000L)) + // Explicitly set retries as disabled (maxAttempts == 1) + .setMaxAttempts(1) + .build(); + EchoClient httpjsonClient = + TestClientInitializer.createHttpJsonEchoClientCustomBlockSettings( + defaultNoRetrySettings, ImmutableSet.of(StatusCode.Code.DEADLINE_EXCEEDED)); + try { + BlockRequest blockRequest = + BlockRequest.newBuilder() + .setSuccess( + BlockResponse.newBuilder().setContent("httpjsonBlockContent_3sDelay_noRetry")) + .setResponseDelay(com.google.protobuf.Duration.newBuilder().setSeconds(3).build()) + .build(); + RetryingFuture retryingFuture = + (RetryingFuture) httpjsonClient.blockCallable().futureCall(blockRequest); + BlockResponse blockResponse = retryingFuture.get(10, TimeUnit.SECONDS); + assertThat(blockResponse.getContent()).isEqualTo("httpjsonBlockContent_3sDelay_noRetry"); + // Guarantee that this only runs once + int attemptCount = retryingFuture.getAttemptSettings().getAttemptCount() + 1; + assertThat(attemptCount).isEqualTo(1); + } finally { + httpjsonClient.close(); + httpjsonClient.awaitTermination( + TestClientInitializer.AWAIT_TERMINATION_SECONDS, TimeUnit.SECONDS); + } + } + + // Retry is configured by setting the initial RPC timeout (1.5s) to be less than + // the RPC delay (2s). The next RPC timeout (3s) will wait long enough for the delay. + @Test + void testGRPC_unarySuccessfulResponse_exceedsRPCDeadlineButWithinTotalTimeout() throws Exception { + RetrySettings defaultRetrySettings = + RetrySettings.newBuilder() + .setInitialRpcTimeout(Duration.ofMillis(1500L)) + .setRpcTimeoutMultiplier(2.0) + .setMaxRpcTimeout(Duration.ofMillis(3000L)) + .setTotalTimeout(Duration.ofMillis(5000L)) + .build(); + EchoClient grpcClient = + TestClientInitializer.createGrpcEchoClientCustomBlockSettings( + defaultRetrySettings, ImmutableSet.of(StatusCode.Code.DEADLINE_EXCEEDED)); + try { + BlockRequest blockRequest = + BlockRequest.newBuilder() + .setSuccess(BlockResponse.newBuilder().setContent("gRPCBlockContent_2sDelay_Retry")) + .setResponseDelay(com.google.protobuf.Duration.newBuilder().setSeconds(2).build()) + .build(); + RetryingFuture retryingFuture = + (RetryingFuture) grpcClient.blockCallable().futureCall(blockRequest); + BlockResponse blockResponse = retryingFuture.get(10, TimeUnit.SECONDS); + assertThat(blockResponse.getContent()).isEqualTo("gRPCBlockContent_2sDelay_Retry"); + // Guarantee that this only runs twice + int attemptCount = retryingFuture.getAttemptSettings().getAttemptCount() + 1; + assertThat(attemptCount).isEqualTo(2); + } finally { + grpcClient.close(); + grpcClient.awaitTermination( + TestClientInitializer.AWAIT_TERMINATION_SECONDS, TimeUnit.SECONDS); + } + } + + // Retry is configured by setting the initial RPC timeout (1.5s) to be less than + // the RPC delay (2s). The next RPC timeout (3s) will wait long enough for the delay. + @Test + void testHttpJson_unarySuccessfulResponse_exceedsRPCDeadlineButWithinTotalTimeout() + throws Exception { + RetrySettings defaultRetrySettings = + RetrySettings.newBuilder() + .setInitialRpcTimeout(Duration.ofMillis(1500L)) + .setRpcTimeoutMultiplier(2.0) + .setMaxRpcTimeout(Duration.ofMillis(3000L)) + .setTotalTimeout(Duration.ofMillis(5000L)) + .build(); + EchoClient httpjsonClient = + TestClientInitializer.createHttpJsonEchoClientCustomBlockSettings( + defaultRetrySettings, ImmutableSet.of(StatusCode.Code.DEADLINE_EXCEEDED)); + try { + BlockRequest blockRequest = + BlockRequest.newBuilder() + .setSuccess( + BlockResponse.newBuilder().setContent("httpjsonBlockContent_2sDelay_Retry")) + .setResponseDelay(com.google.protobuf.Duration.newBuilder().setSeconds(2).build()) + .build(); + RetryingFuture retryingFuture = + (RetryingFuture) httpjsonClient.blockCallable().futureCall(blockRequest); + BlockResponse blockResponse = retryingFuture.get(10, TimeUnit.SECONDS); + assertThat(blockResponse.getContent()).isEqualTo("httpjsonBlockContent_2sDelay_Retry"); + // Guarantee that this only runs twice + int attemptCount = retryingFuture.getAttemptSettings().getAttemptCount() + 1; + assertThat(attemptCount).isEqualTo(2); + } finally { + httpjsonClient.close(); + httpjsonClient.awaitTermination( + TestClientInitializer.AWAIT_TERMINATION_SECONDS, TimeUnit.SECONDS); + } + } + + // Request is set to block for 6 seconds to allow the RPC to timeout. If retries are + // disabled, the RPC timeout is set to be the totalTimeout (5s). + @Test + void + testGRPC_unaryUnsuccessfulResponse_exceedsRPCTimeoutAndTotalTimeout_throwsDeadlineExceededException() + throws Exception { + RetrySettings defaultNoRetrySettings = + RetrySettings.newBuilder() + .setInitialRpcTimeout(Duration.ofMillis(5000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ofMillis(5000L)) + .setTotalTimeout(Duration.ofMillis(5000L)) + // Explicitly set retries as disabled (maxAttempts == 1) + .setMaxAttempts(1) + .build(); + EchoClient grpcClient = + TestClientInitializer.createGrpcEchoClientCustomBlockSettings( + defaultNoRetrySettings, ImmutableSet.of(StatusCode.Code.DEADLINE_EXCEEDED)); + try { + BlockRequest blockRequest = + BlockRequest.newBuilder() + .setSuccess(BlockResponse.newBuilder().setContent("gRPCBlockContent_6sDelay_noRetry")) + .setResponseDelay(com.google.protobuf.Duration.newBuilder().setSeconds(6).build()) + .build(); + RetryingFuture retryingFuture = + (RetryingFuture) grpcClient.blockCallable().futureCall(blockRequest); + ExecutionException exception = + assertThrows(ExecutionException.class, () -> retryingFuture.get(10, TimeUnit.SECONDS)); + assertThat(exception.getCause()).isInstanceOf(DeadlineExceededException.class); + DeadlineExceededException deadlineExceededException = + (DeadlineExceededException) exception.getCause(); + assertThat(deadlineExceededException.getStatusCode().getCode()) + .isEqualTo(StatusCode.Code.DEADLINE_EXCEEDED); + // We can guarantee that this only runs once + int attemptCount = retryingFuture.getAttemptSettings().getAttemptCount() + 1; + assertThat(attemptCount).isEqualTo(1); + } finally { + grpcClient.close(); + grpcClient.awaitTermination( + TestClientInitializer.AWAIT_TERMINATION_SECONDS, TimeUnit.SECONDS); + } + } + + // Request is set to block for 6 seconds to allow the RPC to timeout. If retries are + // disabled, the RPC timeout is set to be the totalTimeout (5s). + @Test + void + testHttpJson_unaryUnsuccessfulResponse_exceedsRPCTimeoutAndTotalTimeout_throwsDeadlineExceededException() + throws Exception { + RetrySettings defaultNoRetrySettings = + RetrySettings.newBuilder() + .setInitialRpcTimeout(Duration.ofMillis(5000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ofMillis(5000L)) + .setTotalTimeout(Duration.ofMillis(5000L)) + // Explicitly set retries as disabled (maxAttempts == 1) + .setMaxAttempts(1) + .build(); + EchoClient httpjsonClient = + TestClientInitializer.createHttpJsonEchoClientCustomBlockSettings( + defaultNoRetrySettings, ImmutableSet.of(StatusCode.Code.DEADLINE_EXCEEDED)); + try { + BlockRequest blockRequest = + BlockRequest.newBuilder() + .setSuccess( + BlockResponse.newBuilder().setContent("httpjsonBlockContent_6sDelay_noRetry")) + .setResponseDelay(com.google.protobuf.Duration.newBuilder().setSeconds(6).build()) + .build(); + RetryingFuture retryingFuture = + (RetryingFuture) httpjsonClient.blockCallable().futureCall(blockRequest); + ExecutionException exception = + assertThrows(ExecutionException.class, () -> retryingFuture.get(10, TimeUnit.SECONDS)); + assertThat(exception.getCause()).isInstanceOf(DeadlineExceededException.class); + DeadlineExceededException deadlineExceededException = + (DeadlineExceededException) exception.getCause(); + assertThat(deadlineExceededException.getStatusCode().getCode()) + .isEqualTo(StatusCode.Code.DEADLINE_EXCEEDED); + // We can guarantee that this only runs once + int attemptCount = retryingFuture.getAttemptSettings().getAttemptCount() + 1; + assertThat(attemptCount).isEqualTo(1); + } finally { + httpjsonClient.close(); + httpjsonClient.awaitTermination( + TestClientInitializer.AWAIT_TERMINATION_SECONDS, TimeUnit.SECONDS); + } + } + + // The purpose of this test is to ensure that the deadlineScheduleExecutor is able + // to properly cancel the HttpRequest for each retry attempt. This test attempts to + // make a call every 100ms for 1 second. If the requestRunnable blocks until we + // receive a response from the server (200ms) regardless of it was cancelled, then + // we would expect at most 50 responses. + @Test + void testGRPC_unaryCallableRetry_deadlineExecutorTimesOutRequest_throwsDeadlineExceededException() + throws Exception { + RetrySettings defaultRetrySettings = + RetrySettings.newBuilder() + .setInitialRpcTimeout(Duration.ofMillis(100L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ofMillis(100L)) + .setTotalTimeout(Duration.ofMillis(1000L)) + .build(); + EchoClient grpcClient = + TestClientInitializer.createGrpcEchoClientCustomBlockSettings( + defaultRetrySettings, ImmutableSet.of(StatusCode.Code.DEADLINE_EXCEEDED)); + try { + BlockRequest blockRequest = + BlockRequest.newBuilder() + .setSuccess( + BlockResponse.newBuilder().setContent("gRPCBlockContent_200msDelay_Retry")) + // Set the timeout to be longer than the RPC timeout + .setResponseDelay( + com.google.protobuf.Duration.newBuilder().setNanos(200000000).build()) + .build(); + RetryingFuture retryingFuture = + (RetryingFuture) grpcClient.blockCallable().futureCall(blockRequest); + ExecutionException exception = + assertThrows(ExecutionException.class, () -> retryingFuture.get(10, TimeUnit.SECONDS)); + assertThat(exception.getCause()).isInstanceOf(DeadlineExceededException.class); + DeadlineExceededException deadlineExceededException = + (DeadlineExceededException) exception.getCause(); + assertThat(deadlineExceededException.getStatusCode().getCode()) + .isEqualTo(StatusCode.Code.DEADLINE_EXCEEDED); + // We cannot guarantee the number of attempts. The RetrySettings should be configured + // such that there is no delay between the attempts, but the execution takes time + // to run. Theoretically this should run exactly 100 times. + int attemptCount = retryingFuture.getAttemptSettings().getAttemptCount() + 1; + assertThat(attemptCount).isGreaterThan(5); + assertThat(attemptCount).isAtMost(10); + } finally { + grpcClient.close(); + grpcClient.awaitTermination( + TestClientInitializer.AWAIT_TERMINATION_SECONDS, TimeUnit.SECONDS); + } + } + + // The purpose of this test is to ensure that the deadlineScheduleExecutor is able + // to properly cancel the HttpRequest for each retry attempt. This test attempts to + // make a call every 100ms for 1 second. If the requestRunnable blocks until we + // receive a response from the server (200ms) regardless of it was cancelled, then + // we would expect at most 50 responses. + @Test + void + testHttpJson_unaryCallableRetry_deadlineExecutorTimesOutRequest_throwsDeadlineExceededException() + throws Exception { + RetrySettings defaultRetrySettings = + RetrySettings.newBuilder() + .setInitialRpcTimeout(Duration.ofMillis(100L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ofMillis(100L)) + .setTotalTimeout(Duration.ofMillis(10000L)) + .build(); + EchoClient httpjsonClient = + TestClientInitializer.createHttpJsonEchoClientCustomBlockSettings( + defaultRetrySettings, ImmutableSet.of(StatusCode.Code.DEADLINE_EXCEEDED)); + try { + BlockRequest blockRequest = + BlockRequest.newBuilder() + .setSuccess( + BlockResponse.newBuilder().setContent("httpjsonBlockContent_200msDelay_Retry")) + // Set the timeout to be longer than the RPC timeout + .setResponseDelay( + com.google.protobuf.Duration.newBuilder().setNanos(200000000).build()) + .build(); + RetryingFuture retryingFuture = + (RetryingFuture) httpjsonClient.blockCallable().futureCall(blockRequest); + ExecutionException exception = + assertThrows(ExecutionException.class, () -> retryingFuture.get(15, TimeUnit.SECONDS)); + assertThat(exception.getCause()).isInstanceOf(DeadlineExceededException.class); + DeadlineExceededException deadlineExceededException = + (DeadlineExceededException) exception.getCause(); + assertThat(deadlineExceededException.getStatusCode().getCode()) + .isEqualTo(StatusCode.Code.DEADLINE_EXCEEDED); + // We cannot guarantee the number of attempts. The RetrySettings should be configured + // such that there is no delay between the attempts, but the execution takes time + // to run. Theoretically this should run exactly 100 times. + int attemptCount = retryingFuture.getAttemptSettings().getAttemptCount() + 1; + assertThat(attemptCount).isGreaterThan(80); + assertThat(attemptCount).isAtMost(100); + } finally { + httpjsonClient.close(); + httpjsonClient.awaitTermination( + TestClientInitializer.AWAIT_TERMINATION_SECONDS, TimeUnit.SECONDS); + } + } +} diff --git a/java-showcase-3.25.8/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/ITVersionHeaders.java b/java-showcase-3.25.8/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/ITVersionHeaders.java new file mode 100644 index 0000000000..1cf9f0f577 --- /dev/null +++ b/java-showcase-3.25.8/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/ITVersionHeaders.java @@ -0,0 +1,249 @@ +/* + * 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 + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.showcase.v1beta1.it; + +import static com.google.common.truth.Truth.assertThat; +import static org.junit.jupiter.api.Assertions.assertThrows; +import static org.junit.jupiter.api.Assertions.assertTrue; + +import com.google.api.gax.httpjson.*; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.FixedHeaderProvider; +import com.google.api.gax.rpc.StubSettings; +import com.google.common.collect.ImmutableList; +import com.google.showcase.v1beta1.*; +import com.google.showcase.v1beta1.it.util.GrpcCapturingClientInterceptor; +import com.google.showcase.v1beta1.it.util.HttpJsonCapturingClientInterceptor; +import com.google.showcase.v1beta1.it.util.TestClientInitializer; +import com.google.showcase.v1beta1.stub.ComplianceStubSettings; +import com.google.showcase.v1beta1.stub.EchoStubSettings; +import io.grpc.*; +import java.io.IOException; +import java.util.ArrayList; +import java.util.concurrent.TimeUnit; +import java.util.regex.Pattern; +import org.junit.jupiter.api.AfterAll; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Test; + +// TODO: add testing on error responses once feat is implemented in showcase. +// https://github.com/googleapis/gapic-showcase/pull/1456 +// TODO: watch for showcase gRPC trailer changes suggested in +// https://github.com/googleapis/gapic-showcase/pull/1509#issuecomment-2089147103 +class ITVersionHeaders { + private static final String HTTP_RESPONSE_HEADER_STRING = + "x-showcase-request-" + ApiClientHeaderProvider.API_VERSION_HEADER_KEY; + private static final String HTTP_CLIENT_API_HEADER_KEY = + "x-showcase-request-" + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(); + private static final Metadata.Key API_VERSION_HEADER_KEY = + Metadata.Key.of( + ApiClientHeaderProvider.API_VERSION_HEADER_KEY, Metadata.ASCII_STRING_MARSHALLER); + + private static final Metadata.Key API_CLIENT_HEADER_KEY = + Metadata.Key.of( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), Metadata.ASCII_STRING_MARSHALLER); + + private static final String EXPECTED_ECHO_API_VERSION = "v1_20240408"; + private static final String CUSTOM_API_VERSION = "user-supplied-version"; + private static final String EXPECTED_EXCEPTION_MESSAGE = + "Header provider can't override the header: " + + ApiClientHeaderProvider.API_VERSION_HEADER_KEY; + + private static HttpJsonCapturingClientInterceptor httpJsonInterceptor; + private static GrpcCapturingClientInterceptor grpcInterceptor; + private static HttpJsonCapturingClientInterceptor httpJsonComplianceInterceptor; + private static GrpcCapturingClientInterceptor grpcComplianceInterceptor; + private static EchoClient grpcClient; + private static EchoClient httpJsonClient; + private static ComplianceClient grpcComplianceClient; + private static ComplianceClient httpJsonComplianceClient; + + @BeforeAll + static void createClients() throws Exception { + // Create gRPC Interceptor and Client + grpcInterceptor = new GrpcCapturingClientInterceptor(); + grpcClient = TestClientInitializer.createGrpcEchoClient(ImmutableList.of(grpcInterceptor)); + + // Create HttpJson Interceptor and Client + httpJsonInterceptor = new HttpJsonCapturingClientInterceptor(); + httpJsonClient = + TestClientInitializer.createHttpJsonEchoClient(ImmutableList.of(httpJsonInterceptor)); + + // Create gRPC ComplianceClient and Interceptor + // Creating a compliance client to test case where api version is not set + grpcComplianceInterceptor = new GrpcCapturingClientInterceptor(); + grpcComplianceClient = + TestClientInitializer.createGrpcComplianceClient( + ImmutableList.of(grpcComplianceInterceptor)); + + // Create HttpJson ComplianceClient and Interceptor + httpJsonComplianceInterceptor = new HttpJsonCapturingClientInterceptor(); + httpJsonComplianceClient = + TestClientInitializer.createHttpJsonComplianceClient( + ImmutableList.of(httpJsonComplianceInterceptor)); + } + + @AfterAll + static void destroyClient() throws InterruptedException { + grpcClient.close(); + httpJsonClient.close(); + grpcComplianceClient.close(); + httpJsonComplianceClient.close(); + + grpcClient.awaitTermination(TestClientInitializer.AWAIT_TERMINATION_SECONDS, TimeUnit.SECONDS); + httpJsonClient.awaitTermination( + TestClientInitializer.AWAIT_TERMINATION_SECONDS, TimeUnit.SECONDS); + grpcComplianceClient.awaitTermination( + TestClientInitializer.AWAIT_TERMINATION_SECONDS, TimeUnit.SECONDS); + httpJsonComplianceClient.awaitTermination( + TestClientInitializer.AWAIT_TERMINATION_SECONDS, TimeUnit.SECONDS); + } + + @Test + void testGrpc_matchesApiVersion() { + grpcClient.echo(EchoRequest.newBuilder().build()); + String headerValue = grpcInterceptor.metadata.get(API_VERSION_HEADER_KEY); + assertThat(headerValue).isEqualTo(EXPECTED_ECHO_API_VERSION); + } + + @Test + void testHttpJson_matchesHeaderName() { + httpJsonClient.echo(EchoRequest.newBuilder().build()); + ArrayList headerValues = + (ArrayList) httpJsonInterceptor.metadata.getHeaders().get(HTTP_RESPONSE_HEADER_STRING); + String headerValue = (String) headerValues.get(0); + assertThat(headerValue).isEqualTo(EXPECTED_ECHO_API_VERSION); + } + + @Test + void testGrpc_noApiVersion() { + RepeatRequest request = + RepeatRequest.newBuilder().setInfo(ComplianceData.newBuilder().setFString("test")).build(); + grpcComplianceClient.repeatDataSimplePath(request); + assertThat(API_VERSION_HEADER_KEY).isNotIn(grpcComplianceInterceptor.metadata.keys()); + } + + @Test + void testHttpJson_noApiVersion() { + RepeatRequest request = + RepeatRequest.newBuilder().setInfo(ComplianceData.newBuilder().setFString("test")).build(); + httpJsonComplianceClient.repeatDataSimplePath(request); + assertThat(API_VERSION_HEADER_KEY) + .isNotIn(httpJsonComplianceInterceptor.metadata.getHeaders().keySet()); + } + + @Test + void testGrpcEcho_userApiVersionThrowsException() throws IOException { + StubSettings stubSettings = + grpcClient.getSettings().getStubSettings().toBuilder() + .setHeaderProvider( + FixedHeaderProvider.create( + ApiClientHeaderProvider.API_VERSION_HEADER_KEY, CUSTOM_API_VERSION)) + .build(); + + IllegalArgumentException exception = + assertThrows( + IllegalArgumentException.class, + () -> EchoClient.create(EchoSettings.create((EchoStubSettings) stubSettings))); + assertThat(exception.getMessage()).isEqualTo(EXPECTED_EXCEPTION_MESSAGE); + } + + @Test + void testHttpJsonEcho_userApiVersionThrowsException() throws IOException { + StubSettings stubSettings = + httpJsonClient.getSettings().getStubSettings().toBuilder() + .setHeaderProvider( + FixedHeaderProvider.create( + ApiClientHeaderProvider.API_VERSION_HEADER_KEY, CUSTOM_API_VERSION)) + .build(); + + IllegalArgumentException exception = + assertThrows( + IllegalArgumentException.class, + () -> EchoClient.create(EchoSettings.create((EchoStubSettings) stubSettings))); + assertThat(exception.getMessage()).isEqualTo(EXPECTED_EXCEPTION_MESSAGE); + } + + @Test + void testGrpcCompliance_userApiVersionSetSuccess() throws IOException { + StubSettings stubSettingsWithApiVersionHeader = + grpcComplianceClient.getSettings().getStubSettings().toBuilder() + .setHeaderProvider( + FixedHeaderProvider.create( + ApiClientHeaderProvider.API_VERSION_HEADER_KEY, CUSTOM_API_VERSION)) + .build(); + try (ComplianceClient customComplianceClient = + ComplianceClient.create( + ComplianceSettings.create((ComplianceStubSettings) stubSettingsWithApiVersionHeader))) { + + RepeatRequest request = + RepeatRequest.newBuilder() + .setInfo(ComplianceData.newBuilder().setFString("test")) + .build(); + customComplianceClient.repeatDataSimplePath(request); + String headerValue = grpcComplianceInterceptor.metadata.get(API_VERSION_HEADER_KEY); + assertThat(headerValue).isEqualTo(CUSTOM_API_VERSION); + } + } + + @Test + void testHttpJsonCompliance_userApiVersionSetSuccess() throws IOException { + StubSettings httpJsonStubSettingsWithApiVersionHeader = + httpJsonComplianceClient.getSettings().getStubSettings().toBuilder() + .setHeaderProvider( + FixedHeaderProvider.create( + ApiClientHeaderProvider.API_VERSION_HEADER_KEY, CUSTOM_API_VERSION)) + .build(); + try (ComplianceClient customComplianceClient = + ComplianceClient.create( + ComplianceSettings.create( + (ComplianceStubSettings) httpJsonStubSettingsWithApiVersionHeader))) { + + RepeatRequest request = + RepeatRequest.newBuilder() + .setInfo(ComplianceData.newBuilder().setFString("test")) + .build(); + customComplianceClient.repeatDataSimplePath(request); + + ArrayList headerValues = + (ArrayList) + httpJsonComplianceInterceptor.metadata.getHeaders().get(HTTP_RESPONSE_HEADER_STRING); + String headerValue = (String) headerValues.get(0); + assertThat(headerValue).isEqualTo(CUSTOM_API_VERSION); + } + } + + @Test + void testGrpcCall_sendsCorrectApiClientHeader() { + Pattern defautlGrpcHeaderPattern = + Pattern.compile("gl-java/.* gapic/.*?--protobuf-\\d.* gax/.* grpc/.* protobuf/\\d.*"); + grpcClient.echo(EchoRequest.newBuilder().build()); + String headerValue = grpcInterceptor.metadata.get(API_CLIENT_HEADER_KEY); + assertTrue(defautlGrpcHeaderPattern.matcher(headerValue).matches()); + } + + @Test + void testHttpJson_sendsCorrectApiClientHeader() { + Pattern defautlHttpHeaderPattern = + Pattern.compile("gl-java/.* gapic/.*?--protobuf-\\d.* gax/.* rest/ protobuf/\\d.*"); + httpJsonClient.echo(EchoRequest.newBuilder().build()); + ArrayList headerValues = + (ArrayList) + httpJsonInterceptor.metadata.getHeaders().get(HTTP_CLIENT_API_HEADER_KEY); + String headerValue = headerValues.get(0); + assertTrue(defautlHttpHeaderPattern.matcher(headerValue).matches()); + } +} diff --git a/java-showcase-3.25.8/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/logging/ITLogging.java b/java-showcase-3.25.8/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/logging/ITLogging.java new file mode 100644 index 0000000000..5979b88c41 --- /dev/null +++ b/java-showcase-3.25.8/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/logging/ITLogging.java @@ -0,0 +1,257 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.it.logging; + +import static com.google.common.truth.Truth.assertThat; + +import ch.qos.logback.classic.Level; +import ch.qos.logback.classic.spi.ILoggingEvent; +import com.google.api.gax.grpc.GrpcLoggingInterceptor; +import com.google.api.gax.httpjson.HttpJsonLoggingInterceptor; +import com.google.common.collect.ImmutableMap; +import com.google.showcase.v1beta1.EchoClient; +import com.google.showcase.v1beta1.EchoRequest; +import com.google.showcase.v1beta1.EchoResponse; +import com.google.showcase.v1beta1.it.util.TestClientInitializer; +import java.util.List; +import java.util.Map; +import java.util.concurrent.TimeUnit; +import org.junit.jupiter.api.AfterAll; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Test; +import org.slf4j.LoggerFactory; +import org.slf4j.event.KeyValuePair; + +// This test needs to run with GOOGLE_SDK_JAVA_LOGGING=true +// mvn clean verify -P '!showcase,enable-integration-tests,loggingTestBase,slf4j2_logback' +public class ITLogging { + private static EchoClient grpcClient; + + private static EchoClient httpjsonClient; + + private static final KeyValuePair SERVICE_NAME_KEY_VALUE_PAIR = + new KeyValuePair("serviceName", "google.showcase.v1beta1.Echo"); + private static final KeyValuePair RPC_NAME_KEY_VALUE_PAIR = + new KeyValuePair("rpcName", "google.showcase.v1beta1.Echo/Echo"); + private static final KeyValuePair RESPONSE_STATUS_KEY_VALUE_PAIR = + new KeyValuePair("response.status", "OK"); + private static final KeyValuePair RESPONSE_STATUS_KEY_VALUE_PAIR_HTTP = + new KeyValuePair("response.status", "200"); + private static final KeyValuePair REQUEST_URL_KEY_VALUE_PAIR = + new KeyValuePair("request.url", "http://localhost:7469"); + + private static final KeyValuePair RESPONSE_HEADERS_KEY_VALUE_PAIR = + new KeyValuePair("response.headers", ImmutableMap.of("content-type", "application/grpc")); + + private static final String SENDING_REQUEST_MESSAGE = "Sending request"; + private static final String RECEIVING_RESPONSE_MESSAGE = "Received response"; + private static final String ECHO_STRING = "echo?"; + + private TestAppender setupTestLogger(Class clazz, Level level) { + TestAppender testAppender = new TestAppender(); + testAppender.start(); + org.slf4j.Logger logger = LoggerFactory.getLogger(clazz); + ((ch.qos.logback.classic.Logger) logger).setLevel(level); + ((ch.qos.logback.classic.Logger) logger).addAppender(testAppender); + return testAppender; + } + + @BeforeAll + static void createClients() throws Exception { + // Create gRPC Echo Client + grpcClient = TestClientInitializer.createGrpcEchoClient(); + // Create Http JSON Echo Client + httpjsonClient = TestClientInitializer.createHttpJsonEchoClient(); + } + + @AfterAll + static void destroyClients() throws InterruptedException { + grpcClient.close(); + httpjsonClient.close(); + + grpcClient.awaitTermination(TestClientInitializer.AWAIT_TERMINATION_SECONDS, TimeUnit.SECONDS); + httpjsonClient.awaitTermination( + TestClientInitializer.AWAIT_TERMINATION_SECONDS, TimeUnit.SECONDS); + } + + @Test + void testGrpc_receiveContent_logDebug() { + TestAppender testAppender = setupTestLogger(GrpcLoggingInterceptor.class, Level.DEBUG); + assertThat(echoGrpc(ECHO_STRING)).isEqualTo(ECHO_STRING); + + assertThat(testAppender.events.size()).isEqualTo(2); + // logging event for request + ILoggingEvent loggingEvent1 = testAppender.events.get(0); + assertThat(loggingEvent1.getMessage()).isEqualTo(SENDING_REQUEST_MESSAGE); + assertThat(loggingEvent1.getLevel()).isEqualTo(Level.DEBUG); + List keyValuePairs = loggingEvent1.getKeyValuePairs(); + assertThat(keyValuePairs.size()).isEqualTo(4); + assertThat(keyValuePairs).containsAtLeast(SERVICE_NAME_KEY_VALUE_PAIR, RPC_NAME_KEY_VALUE_PAIR); + + for (KeyValuePair kvp : keyValuePairs) { + if (kvp.key.equals("request.payload")) { + Map payload = (Map) kvp.value; + assertThat(payload.get("content")).isEqualTo(ECHO_STRING); + assertThat(payload.get("requestId")).isNotNull(); + assertThat(payload.get("otherRequestId")).isNotNull(); + } + if (kvp.key.equals("request.headers")) { + Map headers = (Map) kvp.value; + assertThat(headers).containsKey("x-goog-api-version"); + assertThat(headers).containsKey("x-goog-api-client"); + } + } + + // logging event for response + ILoggingEvent loggingEvent2 = testAppender.events.get(1); + assertThat(loggingEvent2.getMessage()).isEqualTo(RECEIVING_RESPONSE_MESSAGE); + + assertThat(loggingEvent2.getLevel()).isEqualTo(Level.DEBUG); + List keyValuePairs2 = loggingEvent2.getKeyValuePairs(); + assertThat(keyValuePairs2.size()).isEqualTo(5); + assertThat(keyValuePairs2) + .containsAtLeast( + RESPONSE_STATUS_KEY_VALUE_PAIR, + RESPONSE_HEADERS_KEY_VALUE_PAIR, + SERVICE_NAME_KEY_VALUE_PAIR, + RPC_NAME_KEY_VALUE_PAIR); + for (KeyValuePair kvp : keyValuePairs2) { + if (kvp.key.equals("response.payload")) { + Map payload = (Map) kvp.value; + assertThat(payload.get("content")).isEqualTo(ECHO_STRING); + assertThat(payload.get("requestId")).isNotNull(); + assertThat(payload.get("otherRequestId")).isNotNull(); + } + } + testAppender.stop(); + } + + @Test + void testGrpc_receiveContent_logInfo() { + TestAppender testAppender = setupTestLogger(GrpcLoggingInterceptor.class, Level.INFO); + assertThat(echoGrpc(ECHO_STRING)).isEqualTo(ECHO_STRING); + + assertThat(testAppender.events.size()).isEqualTo(2); + // logging event for request + ILoggingEvent loggingEvent1 = testAppender.events.get(0); + assertThat(loggingEvent1.getMessage()).isEqualTo(SENDING_REQUEST_MESSAGE); + assertThat(loggingEvent1.getLevel()).isEqualTo(Level.INFO); + List keyValuePairs = loggingEvent1.getKeyValuePairs(); + assertThat(keyValuePairs.size()).isEqualTo(2); + assertThat(keyValuePairs).containsAtLeast(SERVICE_NAME_KEY_VALUE_PAIR, RPC_NAME_KEY_VALUE_PAIR); + + // logging event for response + ILoggingEvent loggingEvent2 = testAppender.events.get(1); + assertThat(loggingEvent2.getMessage()).isEqualTo(RECEIVING_RESPONSE_MESSAGE); + + assertThat(loggingEvent2.getLevel()).isEqualTo(Level.INFO); + List keyValuePairs2 = loggingEvent2.getKeyValuePairs(); + assertThat(keyValuePairs2.size()).isEqualTo(3); + assertThat(keyValuePairs2) + .containsAtLeast( + RESPONSE_STATUS_KEY_VALUE_PAIR, SERVICE_NAME_KEY_VALUE_PAIR, RPC_NAME_KEY_VALUE_PAIR); + testAppender.stop(); + } + + @Test + void testHttpJson_receiveContent_logDebug() { + TestAppender testAppender = setupTestLogger(HttpJsonLoggingInterceptor.class, Level.DEBUG); + assertThat(echoHttpJson(ECHO_STRING)).isEqualTo(ECHO_STRING); + assertThat(testAppender.events.size()).isEqualTo(2); + // logging event for request + ILoggingEvent loggingEvent1 = testAppender.events.get(0); + assertThat(loggingEvent1.getMessage()).isEqualTo(SENDING_REQUEST_MESSAGE); + assertThat(loggingEvent1.getLevel()).isEqualTo(Level.DEBUG); + List keyValuePairs = loggingEvent1.getKeyValuePairs(); + assertThat(keyValuePairs.size()).isEqualTo(4); + assertThat(keyValuePairs).contains(RPC_NAME_KEY_VALUE_PAIR); + assertThat(keyValuePairs).contains(REQUEST_URL_KEY_VALUE_PAIR); + + for (KeyValuePair kvp : keyValuePairs) { + if (kvp.key.equals("request.payload")) { + Map payload = (Map) kvp.value; + assertThat(payload.get("content")).isEqualTo(ECHO_STRING); + assertThat(payload.get("requestId")).isNotNull(); + assertThat(payload.get("otherRequestId")).isNotNull(); + } + if (kvp.key.equals("request.headers")) { + Map headers = (Map) kvp.value; + assertThat(headers).containsKey("x-goog-api-version"); + assertThat(headers).containsKey("x-goog-api-client"); + } + } + + // logging event for response + ILoggingEvent loggingEvent2 = testAppender.events.get(1); + assertThat(loggingEvent2.getMessage()).isEqualTo(RECEIVING_RESPONSE_MESSAGE); + + assertThat(loggingEvent2.getLevel()).isEqualTo(Level.DEBUG); + List keyValuePairs2 = loggingEvent2.getKeyValuePairs(); + assertThat(keyValuePairs2.size()).isEqualTo(4); + assertThat(keyValuePairs2) + .containsAtLeast(RESPONSE_STATUS_KEY_VALUE_PAIR_HTTP, RPC_NAME_KEY_VALUE_PAIR); + for (KeyValuePair kvp : keyValuePairs2) { + if (kvp.key.equals("response.payload")) { + Map payload = (Map) kvp.value; + assertThat(payload.get("content")).isEqualTo(ECHO_STRING); + assertThat(payload.get("requestId")).isNotNull(); + assertThat(payload.get("otherRequestId")).isNotNull(); + } + if (kvp.key.equals("response.headers")) { + Map headers = (Map) kvp.value; + assertThat(headers.size()).isEqualTo(11); + } + } + testAppender.stop(); + } + + @Test + void testHttpJson_receiveContent_logInfo() { + TestAppender testAppender = setupTestLogger(HttpJsonLoggingInterceptor.class, Level.INFO); + assertThat(echoHttpJson(ECHO_STRING)).isEqualTo(ECHO_STRING); + assertThat(testAppender.events.size()).isEqualTo(2); + // logging event for request + ILoggingEvent loggingEvent1 = testAppender.events.get(0); + assertThat(loggingEvent1.getMessage()).isEqualTo(SENDING_REQUEST_MESSAGE); + assertThat(loggingEvent1.getLevel()).isEqualTo(Level.INFO); + List keyValuePairs = loggingEvent1.getKeyValuePairs(); + assertThat(keyValuePairs.size()).isEqualTo(2); + assertThat(keyValuePairs).contains(RPC_NAME_KEY_VALUE_PAIR); + assertThat(keyValuePairs).contains(REQUEST_URL_KEY_VALUE_PAIR); + + // logging event for response + ILoggingEvent loggingEvent2 = testAppender.events.get(1); + assertThat(loggingEvent2.getMessage()).isEqualTo(RECEIVING_RESPONSE_MESSAGE); + + assertThat(loggingEvent2.getLevel()).isEqualTo(Level.INFO); + List keyValuePairs2 = loggingEvent2.getKeyValuePairs(); + assertThat(keyValuePairs2.size()).isEqualTo(2); + assertThat(keyValuePairs2) + .containsAtLeast(RESPONSE_STATUS_KEY_VALUE_PAIR_HTTP, RPC_NAME_KEY_VALUE_PAIR); + testAppender.stop(); + } + + private String echoGrpc(String value) { + EchoResponse response = grpcClient.echo(EchoRequest.newBuilder().setContent(value).build()); + return response.getContent(); + } + + private String echoHttpJson(String value) { + EchoResponse response = httpjsonClient.echo(EchoRequest.newBuilder().setContent(value).build()); + return response.getContent(); + } +} diff --git a/java-showcase-3.25.8/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/logging/ITLogging1x.java b/java-showcase-3.25.8/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/logging/ITLogging1x.java new file mode 100644 index 0000000000..d0dec4b80d --- /dev/null +++ b/java-showcase-3.25.8/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/logging/ITLogging1x.java @@ -0,0 +1,217 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.it.logging; + +import static com.google.common.truth.Truth.assertThat; + +import ch.qos.logback.classic.Level; +import ch.qos.logback.classic.spi.ILoggingEvent; +import com.google.api.gax.grpc.GrpcLoggingInterceptor; +import com.google.api.gax.httpjson.HttpJsonLoggingInterceptor; +import com.google.common.collect.ImmutableMap; +import com.google.showcase.v1beta1.EchoClient; +import com.google.showcase.v1beta1.EchoRequest; +import com.google.showcase.v1beta1.EchoResponse; +import com.google.showcase.v1beta1.it.util.TestClientInitializer; +import java.util.Map; +import java.util.concurrent.TimeUnit; +import org.junit.jupiter.api.AfterAll; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Test; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +// This test needs to run with GOOGLE_SDK_JAVA_LOGGING=true +// mvn verify -P +// '!showcase,enable-integration-tests,loggingTestBase,slf4j1_logback ' +public class ITLogging1x { + private static EchoClient grpcClient; + + private static EchoClient httpjsonClient; + + private static final String ECHO_STRING = "echo?"; + private static final String SERVICE_NAME = "google.showcase.v1beta1.Echo"; + private static final String RPC_NAME = "google.showcase.v1beta1.Echo/Echo"; + private static final String ENDPOINT = "http://localhost:7469"; + private static final String SENDING_REQUEST_MESSAGE = "Sending request"; + private static final String RECEIVING_RESPONSE_MESSAGE = "Received response"; + + private static Logger logger = LoggerFactory.getLogger(ITLogging1x.class); + + private TestAppender setupTestLogger(Class clazz, Level level) { + TestAppender testAppender = new TestAppender(); + testAppender.start(); + Logger logger = LoggerFactory.getLogger(clazz); + ((ch.qos.logback.classic.Logger) logger).setLevel(level); + ((ch.qos.logback.classic.Logger) logger).addAppender(testAppender); + return testAppender; + } + + @BeforeAll + static void createClients() throws Exception { + // Create gRPC Echo Client + grpcClient = TestClientInitializer.createGrpcEchoClient(); + // Create Http JSON Echo Client + httpjsonClient = TestClientInitializer.createHttpJsonEchoClient(); + } + + @AfterAll + static void destroyClients() throws InterruptedException { + grpcClient.close(); + httpjsonClient.close(); + + grpcClient.awaitTermination(TestClientInitializer.AWAIT_TERMINATION_SECONDS, TimeUnit.SECONDS); + httpjsonClient.awaitTermination( + TestClientInitializer.AWAIT_TERMINATION_SECONDS, TimeUnit.SECONDS); + } + + @Test + void test() { + assertThat(logger.isInfoEnabled()).isTrue(); + assertThat(logger.isDebugEnabled()).isTrue(); + } + + @Test + void testGrpc_receiveContent_logDebug() { + TestAppender testAppender = setupTestLogger(GrpcLoggingInterceptor.class, Level.DEBUG); + assertThat(echoGrpc(ECHO_STRING)).isEqualTo(ECHO_STRING); + + assertThat(testAppender.events.size()).isEqualTo(2); + // logging event for request + ILoggingEvent loggingEvent1 = testAppender.events.get(0); + assertThat(loggingEvent1.getMessage()).isEqualTo(SENDING_REQUEST_MESSAGE); + assertThat(loggingEvent1.getLevel()).isEqualTo(Level.DEBUG); + Map mdcPropertyMap = loggingEvent1.getMDCPropertyMap(); + assertThat(mdcPropertyMap) + .containsAtLeastEntriesIn( + ImmutableMap.of("serviceName", SERVICE_NAME, "rpcName", RPC_NAME)); + assertThat(mdcPropertyMap).containsKey("request.headers"); + assertThat(mdcPropertyMap.get("request.headers")).startsWith("{\"x-goog-api-"); + + assertThat(mdcPropertyMap).containsKey("request.payload"); + assertThat(mdcPropertyMap.get("request.payload")) + .startsWith("{\"content\":\"echo?\",\"requestId\":"); + + // logging event for response + ILoggingEvent loggingEvent2 = testAppender.events.get(1); + assertThat(loggingEvent2.getMessage()).isEqualTo(RECEIVING_RESPONSE_MESSAGE); + assertThat(loggingEvent2.getLevel()).isEqualTo(Level.DEBUG); + Map responseMdcPropertyMap = loggingEvent2.getMDCPropertyMap(); + assertThat(responseMdcPropertyMap) + .containsAtLeastEntriesIn( + ImmutableMap.of( + "serviceName", SERVICE_NAME, "rpcName", RPC_NAME, "response.status", "OK")); + assertThat(responseMdcPropertyMap).containsKey("response.payload"); + assertThat(responseMdcPropertyMap).containsKey("response.headers"); + + testAppender.stop(); + } + + @Test + void testGrpc_receiveContent_logInfo() { + TestAppender testAppender = setupTestLogger(GrpcLoggingInterceptor.class, Level.INFO); + assertThat(echoGrpc(ECHO_STRING)).isEqualTo(ECHO_STRING); + + assertThat(testAppender.events.size()).isEqualTo(2); + // logging event for request + ILoggingEvent loggingEvent1 = testAppender.events.get(0); + assertThat(loggingEvent1.getMessage()).isEqualTo(SENDING_REQUEST_MESSAGE); + assertThat(loggingEvent1.getLevel()).isEqualTo(Level.INFO); + Map mdcPropertyMap = loggingEvent1.getMDCPropertyMap(); + assertThat(mdcPropertyMap) + .containsExactlyEntriesIn( + ImmutableMap.of("serviceName", SERVICE_NAME, "rpcName", RPC_NAME)); + + // logging event for response + ILoggingEvent loggingEvent2 = testAppender.events.get(1); + assertThat(loggingEvent2.getMessage()).isEqualTo(RECEIVING_RESPONSE_MESSAGE); + assertThat(loggingEvent2.getLevel()).isEqualTo(Level.INFO); + Map responseMdcPropertyMap = loggingEvent2.getMDCPropertyMap(); + assertThat(responseMdcPropertyMap) + .containsExactlyEntriesIn( + ImmutableMap.of( + "serviceName", SERVICE_NAME, "rpcName", RPC_NAME, "response.status", "OK")); + + testAppender.stop(); + } + + @Test + void testHttpJson_receiveContent_logDebug() { + TestAppender testAppender = setupTestLogger(HttpJsonLoggingInterceptor.class, Level.DEBUG); + assertThat(echoHttpJson(ECHO_STRING)).isEqualTo(ECHO_STRING); + assertThat(testAppender.events.size()).isEqualTo(2); + // logging event for request + ILoggingEvent loggingEvent1 = testAppender.events.get(0); + assertThat(loggingEvent1.getMessage()).isEqualTo(SENDING_REQUEST_MESSAGE); + assertThat(loggingEvent1.getLevel()).isEqualTo(Level.DEBUG); + Map mdcPropertyMap = loggingEvent1.getMDCPropertyMap(); + assertThat(mdcPropertyMap).containsEntry("rpcName", RPC_NAME); + assertThat(mdcPropertyMap).containsEntry("request.url", ENDPOINT); + assertThat(mdcPropertyMap).containsKey("request.headers"); + assertThat(mdcPropertyMap.get("request.headers")).startsWith("{\"x-goog-api-"); + assertThat(mdcPropertyMap).containsKey("request.payload"); + assertThat(mdcPropertyMap.get("request.payload")) + .startsWith("{\"content\":\"echo?\",\"requestId\":"); + + // logging event for response + ILoggingEvent loggingEvent2 = testAppender.events.get(1); + assertThat(loggingEvent2.getMessage()).isEqualTo(RECEIVING_RESPONSE_MESSAGE); + assertThat(loggingEvent2.getLevel()).isEqualTo(Level.DEBUG); + Map responseMdcPropertyMap = loggingEvent2.getMDCPropertyMap(); + assertThat(responseMdcPropertyMap) + .containsAtLeastEntriesIn(ImmutableMap.of("rpcName", RPC_NAME, "response.status", "200")); + assertThat(responseMdcPropertyMap).containsKey("response.payload"); + assertThat(responseMdcPropertyMap).containsKey("response.headers"); + testAppender.stop(); + } + + @Test + void testHttpJson_receiveContent_logInfo() { + TestAppender testAppender = setupTestLogger(HttpJsonLoggingInterceptor.class, Level.INFO); + assertThat(echoHttpJson(ECHO_STRING)).isEqualTo(ECHO_STRING); + assertThat(testAppender.events.size()).isEqualTo(2); + // logging event for request + ILoggingEvent loggingEvent1 = testAppender.events.get(0); + assertThat(loggingEvent1.getMessage()).isEqualTo(SENDING_REQUEST_MESSAGE); + assertThat(loggingEvent1.getLevel()).isEqualTo(Level.INFO); + Map mdcPropertyMap = loggingEvent1.getMDCPropertyMap(); + assertThat(mdcPropertyMap) + .containsExactlyEntriesIn( + ImmutableMap.of( + "rpcName", RPC_NAME, + "request.url", ENDPOINT)); + + // logging event for response + ILoggingEvent loggingEvent2 = testAppender.events.get(1); + assertThat(loggingEvent2.getMessage()).isEqualTo(RECEIVING_RESPONSE_MESSAGE); + assertThat(loggingEvent2.getLevel()).isEqualTo(Level.INFO); + Map responseMdcPropertyMap = loggingEvent2.getMDCPropertyMap(); + assertThat(responseMdcPropertyMap) + .containsExactlyEntriesIn(ImmutableMap.of("rpcName", RPC_NAME, "response.status", "200")); + testAppender.stop(); + } + + private String echoGrpc(String value) { + EchoResponse response = grpcClient.echo(EchoRequest.newBuilder().setContent(value).build()); + return response.getContent(); + } + + private String echoHttpJson(String value) { + EchoResponse response = httpjsonClient.echo(EchoRequest.newBuilder().setContent(value).build()); + return response.getContent(); + } +} diff --git a/java-showcase-3.25.8/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/logging/ITLoggingDisabled.java b/java-showcase-3.25.8/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/logging/ITLoggingDisabled.java new file mode 100644 index 0000000000..16c6acb0a6 --- /dev/null +++ b/java-showcase-3.25.8/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/logging/ITLoggingDisabled.java @@ -0,0 +1,78 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.it.logging; + +import static com.google.common.truth.Truth.assertThat; + +import ch.qos.logback.classic.Level; +import ch.qos.logback.classic.spi.ILoggingEvent; +import ch.qos.logback.core.read.ListAppender; +import com.google.api.gax.grpc.GrpcLoggingInterceptor; +import com.google.showcase.v1beta1.EchoClient; +import com.google.showcase.v1beta1.EchoRequest; +import com.google.showcase.v1beta1.EchoResponse; +import com.google.showcase.v1beta1.it.util.TestClientInitializer; +import java.util.concurrent.TimeUnit; +import org.junit.jupiter.api.AfterAll; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Test; +import org.slf4j.LoggerFactory; + +// mvn verify -P '!showcase,enable-integration-tests,loggingTestBase,disabledLogging' +public class ITLoggingDisabled { + + private static EchoClient grpcClient; + private static final String ECHO_STRING = "echo?"; + + private TestAppender setupTestLogger(Class clazz) { + TestAppender testAppender = new TestAppender(); + testAppender.start(); + ListAppender listAppender = new ListAppender<>(); + listAppender.start(); + org.slf4j.Logger logger = LoggerFactory.getLogger(clazz); + ((ch.qos.logback.classic.Logger) logger).setLevel(Level.DEBUG); + ((ch.qos.logback.classic.Logger) logger).addAppender(testAppender); + return testAppender; + } + + @BeforeAll + static void createClients() throws Exception { + // Create gRPC Echo Client + grpcClient = TestClientInitializer.createGrpcEchoClient(); + } + + @AfterAll + static void destroyClients() throws InterruptedException { + grpcClient.close(); + + grpcClient.awaitTermination(TestClientInitializer.AWAIT_TERMINATION_SECONDS, TimeUnit.SECONDS); + } + + // only run when GOOGLE_SDK_JAVA_LOGGING!=true + @Test + void testloggingDisabled() { + TestAppender testAppender = setupTestLogger(GrpcLoggingInterceptor.class); + assertThat(echoGrpc(ECHO_STRING)).isEqualTo(ECHO_STRING); + + assertThat(testAppender.events.size()).isEqualTo(0); + } + + private String echoGrpc(String value) { + EchoResponse response = grpcClient.echo(EchoRequest.newBuilder().setContent(value).build()); + return response.getContent(); + } +} diff --git a/java-showcase-3.25.8/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/logging/TestAppender.java b/java-showcase-3.25.8/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/logging/TestAppender.java new file mode 100644 index 0000000000..92a6996936 --- /dev/null +++ b/java-showcase-3.25.8/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/logging/TestAppender.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.showcase.v1beta1.it.logging; + +import ch.qos.logback.classic.spi.ILoggingEvent; +import ch.qos.logback.core.AppenderBase; +import java.util.ArrayList; +import java.util.List; + +/** Logback appender used to set up tests. */ +public class TestAppender extends AppenderBase { + public List events = new ArrayList<>(); + + @Override + protected void append(ILoggingEvent eventObject) { + // triggering Logback to capture the current MDC context and store it with the log event + // the default ListAppender does not capture MDC contents + eventObject.getMDCPropertyMap(); + + events.add(eventObject); + } + + public void clearEvents() { + events.clear(); + } +} diff --git a/java-showcase-3.25.8/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/util/GrpcCapturingClientInterceptor.java b/java-showcase-3.25.8/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/util/GrpcCapturingClientInterceptor.java new file mode 100644 index 0000000000..e7d2a01f56 --- /dev/null +++ b/java-showcase-3.25.8/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/util/GrpcCapturingClientInterceptor.java @@ -0,0 +1,83 @@ +/* + * 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 + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.it.util; + +import io.grpc.CallOptions; +import io.grpc.Channel; +import io.grpc.ClientCall; +import io.grpc.ClientInterceptor; +import io.grpc.ForwardingClientCall; +import io.grpc.Metadata; +import io.grpc.MethodDescriptor; +import io.grpc.Status; + +/** Implements a client interceptor to retrieve the metadata from a GRPC client request. */ +public class GrpcCapturingClientInterceptor implements ClientInterceptor { + public Metadata metadata; + + @Override + public ClientCall interceptCall( + MethodDescriptor method, final CallOptions callOptions, Channel next) { + ClientCall call = next.newCall(method, callOptions); + return new ForwardingClientCall.SimpleForwardingClientCall(call) { + @Override + public void start(Listener responseListener, Metadata headers) { + Listener wrappedListener = + new SimpleForwardingClientCallListener(responseListener) { + @Override + public void onClose(Status status, Metadata trailers) { + if (status.isOk()) { + metadata = trailers; + } + super.onClose(status, trailers); + } + }; + + super.start(wrappedListener, headers); + } + }; + } + + private static class SimpleForwardingClientCallListener + extends ClientCall.Listener { + private final ClientCall.Listener delegate; + + SimpleForwardingClientCallListener(ClientCall.Listener delegate) { + this.delegate = delegate; + } + + @Override + public void onHeaders(Metadata headers) { + delegate.onHeaders(headers); + } + + @Override + public void onMessage(RespT message) { + delegate.onMessage(message); + } + + @Override + public void onClose(Status status, Metadata trailers) { + delegate.onClose(status, trailers); + } + + @Override + public void onReady() { + delegate.onReady(); + } + } +} diff --git a/java-showcase-3.25.8/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/util/HttpJsonCapturingClientInterceptor.java b/java-showcase-3.25.8/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/util/HttpJsonCapturingClientInterceptor.java new file mode 100644 index 0000000000..ec9b9da9cb --- /dev/null +++ b/java-showcase-3.25.8/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/util/HttpJsonCapturingClientInterceptor.java @@ -0,0 +1,66 @@ +/* + * 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 + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.it.util; + +import com.google.api.gax.httpjson.ApiMethodDescriptor; +import com.google.api.gax.httpjson.ForwardingHttpJsonClientCall; +import com.google.api.gax.httpjson.ForwardingHttpJsonClientCallListener; +import com.google.api.gax.httpjson.HttpJsonCallOptions; +import com.google.api.gax.httpjson.HttpJsonChannel; +import com.google.api.gax.httpjson.HttpJsonClientCall; +import com.google.api.gax.httpjson.HttpJsonClientInterceptor; +import com.google.api.gax.httpjson.HttpJsonMetadata; + +/** Implements a client interceptor to retrieve the response headers from a HTTP client request. */ +public class HttpJsonCapturingClientInterceptor implements HttpJsonClientInterceptor { + public HttpJsonMetadata metadata; + + @Override + public HttpJsonClientCall interceptCall( + ApiMethodDescriptor method, + HttpJsonCallOptions callOptions, + HttpJsonChannel next) { + HttpJsonClientCall call = next.newCall(method, callOptions); + return new ForwardingHttpJsonClientCall.SimpleForwardingHttpJsonClientCall( + call) { + @Override + public void start(Listener responseListener, HttpJsonMetadata requestHeaders) { + Listener forwardingResponseListener = + new ForwardingHttpJsonClientCallListener.SimpleForwardingHttpJsonClientCallListener< + ResponseT>(responseListener) { + @Override + public void onHeaders(HttpJsonMetadata responseHeaders) { + metadata = responseHeaders; + super.onHeaders(responseHeaders); + } + + @Override + public void onMessage(ResponseT message) { + super.onMessage(message); + } + + @Override + public void onClose(int statusCode, HttpJsonMetadata trailers) { + super.onClose(statusCode, trailers); + } + }; + + super.start(forwardingResponseListener, requestHeaders); + } + }; + } +} diff --git a/java-showcase-3.25.8/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/util/InterceptingMockTokenServerTransport.java b/java-showcase-3.25.8/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/util/InterceptingMockTokenServerTransport.java new file mode 100644 index 0000000000..4545d87f20 --- /dev/null +++ b/java-showcase-3.25.8/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/util/InterceptingMockTokenServerTransport.java @@ -0,0 +1,48 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.it.util; + +import com.google.api.client.http.LowLevelHttpRequest; +import com.google.api.client.json.JsonFactory; +import com.google.api.client.json.gson.GsonFactory; +import com.google.api.client.json.webtoken.JsonWebSignature; +import com.google.api.client.testing.http.MockLowLevelHttpRequest; +import com.google.auth.TestUtils; +import com.google.auth.oauth2.MockTokenServerTransport; +import java.io.IOException; +import java.util.Map; + +public class InterceptingMockTokenServerTransport extends MockTokenServerTransport { + private MockLowLevelHttpRequest lastRequest; + private static final JsonFactory JSON_FACTORY = new GsonFactory(); + + @Override + public LowLevelHttpRequest buildRequest(String method, String url) throws IOException { + MockLowLevelHttpRequest baseRequest = (MockLowLevelHttpRequest) super.buildRequest(method, url); + lastRequest = baseRequest; + return baseRequest; + } + + public String getLastAudienceSent() throws IOException { + String contentString = lastRequest.getContentAsString(); + Map query = TestUtils.parseQuery(contentString); + String assertion = query.get("assertion"); + JsonWebSignature signature = JsonWebSignature.parse(JSON_FACTORY, assertion); + String foundTargetAudience = (String) signature.getPayload().get("api_audience"); + return foundTargetAudience; + } +} diff --git a/java-showcase-3.25.8/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/util/InterceptingMockTokenServerTransportFactory.java b/java-showcase-3.25.8/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/util/InterceptingMockTokenServerTransportFactory.java new file mode 100644 index 0000000000..ffb1e04132 --- /dev/null +++ b/java-showcase-3.25.8/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/util/InterceptingMockTokenServerTransportFactory.java @@ -0,0 +1,31 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.it.util; + +import com.google.api.client.http.HttpTransport; +import com.google.auth.oauth2.MockTokenServerTransportFactory; + +public class InterceptingMockTokenServerTransportFactory extends MockTokenServerTransportFactory { + + public InterceptingMockTokenServerTransport transport = + new InterceptingMockTokenServerTransport(); + + @Override + public HttpTransport create() { + return transport; + } +} diff --git a/java-showcase-3.25.8/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/util/TestClientInitializer.java b/java-showcase-3.25.8/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/util/TestClientInitializer.java new file mode 100644 index 0000000000..a3db1a00e3 --- /dev/null +++ b/java-showcase-3.25.8/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/util/TestClientInitializer.java @@ -0,0 +1,343 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.it.util; + +import com.google.api.client.http.javanet.NetHttpTransport; +import com.google.api.gax.core.NoCredentialsProvider; +import com.google.api.gax.httpjson.HttpJsonClientInterceptor; +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.StatusCode; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.tracing.ApiTracerFactory; +import com.google.common.collect.ImmutableList; +import com.google.showcase.v1beta1.ComplianceClient; +import com.google.showcase.v1beta1.ComplianceSettings; +import com.google.showcase.v1beta1.EchoClient; +import com.google.showcase.v1beta1.EchoSettings; +import com.google.showcase.v1beta1.IdentityClient; +import com.google.showcase.v1beta1.IdentitySettings; +import com.google.showcase.v1beta1.WaitRequest; +import com.google.showcase.v1beta1.stub.EchoStub; +import com.google.showcase.v1beta1.stub.EchoStubSettings; +import io.grpc.ClientInterceptor; +import io.grpc.ManagedChannelBuilder; +import java.util.List; +import java.util.Set; + +public class TestClientInitializer { + + public static final int AWAIT_TERMINATION_SECONDS = 10; + + // gRPC's endpoint must follow the format of {host}:{port} + public static final String DEFAULT_GRPC_ENDPOINT = "localhost:7469"; + // httpjson's endpoint uses `https://` by default if the scheme is not specified + // local test requires `http://` as not SSL/TLS has been set up for showcase + public static final String DEFAULT_HTTPJSON_ENDPOINT = "http://localhost:7469"; + + public static EchoClient createGrpcEchoClient() throws Exception { + return createGrpcEchoClient(ImmutableList.of()); + } + + public static EchoClient createGrpcEchoClient(List interceptorList) + throws Exception { + EchoSettings grpcEchoSettings = + EchoSettings.newBuilder() + .setCredentialsProvider(NoCredentialsProvider.create()) + .setTransportChannelProvider( + EchoSettings.defaultGrpcTransportProviderBuilder() + .setChannelConfigurator(ManagedChannelBuilder::usePlaintext) + .setInterceptorProvider(() -> interceptorList) + .build()) + .setEndpoint(DEFAULT_GRPC_ENDPOINT) + .build(); + return EchoClient.create(grpcEchoSettings); + } + + public static EchoClient createGrpcEchoClientWithRetrySettings( + RetrySettings retrySettings, + Set retryableCodes, + List interceptorList) + throws Exception { + EchoStubSettings.Builder grpcEchoSettingsBuilder = EchoStubSettings.newBuilder(); + grpcEchoSettingsBuilder + .echoSettings() + .setRetrySettings(retrySettings) + .setRetryableCodes(retryableCodes); + EchoSettings grpcEchoSettings = EchoSettings.create(grpcEchoSettingsBuilder.build()); + grpcEchoSettings = + grpcEchoSettings.toBuilder() + .setCredentialsProvider(NoCredentialsProvider.create()) + .setTransportChannelProvider( + EchoSettings.defaultGrpcTransportProviderBuilder() + .setChannelConfigurator(ManagedChannelBuilder::usePlaintext) + .setInterceptorProvider(() -> interceptorList) + .build()) + .setEndpoint(DEFAULT_GRPC_ENDPOINT) + .build(); + return EchoClient.create(grpcEchoSettings); + } + + public static EchoClient createHttpJsonEchoClient() throws Exception { + return createHttpJsonEchoClient(ImmutableList.of()); + } + + public static EchoClient createHttpJsonEchoClient(List interceptorList) + throws Exception { + EchoSettings httpJsonEchoSettings = + EchoSettings.newHttpJsonBuilder() + .setCredentialsProvider(NoCredentialsProvider.create()) + .setTransportChannelProvider( + EchoSettings.defaultHttpJsonTransportProviderBuilder() + .setHttpTransport( + new NetHttpTransport.Builder().doNotValidateCertificate().build()) + .setEndpoint(DEFAULT_HTTPJSON_ENDPOINT) + .setInterceptorProvider(() -> interceptorList) + .build()) + .build(); + return EchoClient.create(httpJsonEchoSettings); + } + + public static EchoClient createHttpJsonEchoClientWithRetrySettings( + RetrySettings retrySettings, + Set retryableCodes, + List interceptorList) + throws Exception { + EchoStubSettings.Builder httpJsonEchoSettingsBuilder = EchoStubSettings.newHttpJsonBuilder(); + httpJsonEchoSettingsBuilder + .echoSettings() + .setRetrySettings(retrySettings) + .setRetryableCodes(retryableCodes); + EchoSettings httpJsonEchoSettings = EchoSettings.create(httpJsonEchoSettingsBuilder.build()); + httpJsonEchoSettings = + httpJsonEchoSettings.toBuilder() + .setCredentialsProvider(NoCredentialsProvider.create()) + .setTransportChannelProvider( + EchoSettings.defaultHttpJsonTransportProviderBuilder() + .setHttpTransport( + new NetHttpTransport.Builder().doNotValidateCertificate().build()) + .setInterceptorProvider(() -> interceptorList) + .setEndpoint(DEFAULT_HTTPJSON_ENDPOINT) + .build()) + .build(); + return EchoClient.create(httpJsonEchoSettings); + } + + public static EchoClient createGrpcEchoClientCustomBlockSettings( + RetrySettings retrySettings, Set retryableCodes) throws Exception { + EchoStubSettings.Builder grpcEchoSettingsBuilder = EchoStubSettings.newBuilder(); + grpcEchoSettingsBuilder + .blockSettings() + .setRetrySettings(retrySettings) + .setRetryableCodes(retryableCodes); + EchoSettings grpcEchoSettings = EchoSettings.create(grpcEchoSettingsBuilder.build()); + grpcEchoSettings = + grpcEchoSettings.toBuilder() + .setCredentialsProvider(NoCredentialsProvider.create()) + .setTransportChannelProvider( + EchoSettings.defaultGrpcTransportProviderBuilder() + .setChannelConfigurator(ManagedChannelBuilder::usePlaintext) + .build()) + .setEndpoint(DEFAULT_GRPC_ENDPOINT) + .build(); + return EchoClient.create(grpcEchoSettings); + } + + public static EchoClient createHttpJsonEchoClientCustomBlockSettings( + RetrySettings retrySettings, Set retryableCodes) throws Exception { + EchoStubSettings.Builder httpJsonEchoSettingsBuilder = EchoStubSettings.newHttpJsonBuilder(); + httpJsonEchoSettingsBuilder + .blockSettings() + .setRetrySettings(retrySettings) + .setRetryableCodes(retryableCodes); + EchoSettings httpJsonEchoSettings = EchoSettings.create(httpJsonEchoSettingsBuilder.build()); + httpJsonEchoSettings = + httpJsonEchoSettings.toBuilder() + .setCredentialsProvider(NoCredentialsProvider.create()) + .setTransportChannelProvider( + EchoSettings.defaultHttpJsonTransportProviderBuilder() + .setHttpTransport( + new NetHttpTransport.Builder().doNotValidateCertificate().build()) + .setEndpoint(DEFAULT_HTTPJSON_ENDPOINT) + .build()) + .build(); + return EchoClient.create(httpJsonEchoSettings); + } + + public static EchoClient createGrpcEchoClientCustomWaitSettings( + RetrySettings initialUnaryRetrySettings, RetrySettings pollingRetrySettings) + throws Exception { + EchoStubSettings.Builder grpcEchoSettingsBuilder = EchoStubSettings.newBuilder(); + grpcEchoSettingsBuilder + .waitOperationSettings() + .setInitialCallSettings( + UnaryCallSettings.newUnaryCallSettingsBuilder() + .setRetrySettings(initialUnaryRetrySettings) + .build()) + .setPollingAlgorithm(OperationTimedPollAlgorithm.create(pollingRetrySettings)); + EchoSettings grpcEchoSettings = EchoSettings.create(grpcEchoSettingsBuilder.build()); + grpcEchoSettings = + grpcEchoSettings.toBuilder() + .setCredentialsProvider(NoCredentialsProvider.create()) + .setTransportChannelProvider( + EchoSettings.defaultGrpcTransportProviderBuilder() + .setChannelConfigurator(ManagedChannelBuilder::usePlaintext) + .build()) + .setEndpoint(DEFAULT_GRPC_ENDPOINT) + .build(); + return EchoClient.create(grpcEchoSettings); + } + + public static EchoClient createHttpJsonEchoClientCustomWaitSettings( + RetrySettings initialUnaryRetrySettings, RetrySettings pollingRetrySettings) + throws Exception { + EchoStubSettings.Builder httpJsonEchoSettingsBuilder = EchoStubSettings.newHttpJsonBuilder(); + httpJsonEchoSettingsBuilder + .waitOperationSettings() + .setInitialCallSettings( + UnaryCallSettings.newUnaryCallSettingsBuilder() + .setRetrySettings(initialUnaryRetrySettings) + .build()) + .setPollingAlgorithm(OperationTimedPollAlgorithm.create(pollingRetrySettings)); + EchoSettings httpJsonEchoSettings = EchoSettings.create(httpJsonEchoSettingsBuilder.build()); + httpJsonEchoSettings = + httpJsonEchoSettings.toBuilder() + .setCredentialsProvider(NoCredentialsProvider.create()) + .setTransportChannelProvider( + EchoSettings.defaultHttpJsonTransportProviderBuilder() + .setHttpTransport( + new NetHttpTransport.Builder().doNotValidateCertificate().build()) + .setEndpoint(DEFAULT_HTTPJSON_ENDPOINT) + .build()) + .build(); + return EchoClient.create(httpJsonEchoSettings); + } + + public static IdentityClient createGrpcIdentityClient() throws Exception { + IdentitySettings grpcIdentitySettings = + IdentitySettings.newHttpJsonBuilder() + .setCredentialsProvider(NoCredentialsProvider.create()) + .setTransportChannelProvider( + IdentitySettings.defaultGrpcTransportProviderBuilder() + .setChannelConfigurator(ManagedChannelBuilder::usePlaintext) + .build()) + .setEndpoint(DEFAULT_GRPC_ENDPOINT) + .build(); + return IdentityClient.create(grpcIdentitySettings); + } + + public static IdentityClient createHttpJsonIdentityClient() throws Exception { + IdentitySettings httpjsonIdentitySettings = + IdentitySettings.newHttpJsonBuilder() + .setCredentialsProvider(NoCredentialsProvider.create()) + .setTransportChannelProvider( + EchoSettings.defaultHttpJsonTransportProviderBuilder() + .setHttpTransport( + new NetHttpTransport.Builder().doNotValidateCertificate().build()) + .setEndpoint(DEFAULT_HTTPJSON_ENDPOINT) + .build()) + .build(); + return IdentityClient.create(httpjsonIdentitySettings); + } + + // Create grpcComplianceClient with Interceptor + public static ComplianceClient createGrpcComplianceClient(List interceptorList) + throws Exception { + ComplianceSettings grpcComplianceSettings = + ComplianceSettings.newBuilder() + .setCredentialsProvider(NoCredentialsProvider.create()) + .setTransportChannelProvider( + ComplianceSettings.defaultGrpcTransportProviderBuilder() + .setChannelConfigurator(ManagedChannelBuilder::usePlaintext) + .setInterceptorProvider(() -> interceptorList) + .build()) + .setEndpoint(DEFAULT_GRPC_ENDPOINT) + .build(); + return ComplianceClient.create(grpcComplianceSettings); + } + + public static ComplianceClient createHttpJsonComplianceClient( + List interceptorList) throws Exception { + ComplianceSettings httpJsonComplianceSettings = + ComplianceSettings.newHttpJsonBuilder() + .setCredentialsProvider(NoCredentialsProvider.create()) + .setTransportChannelProvider( + EchoSettings.defaultHttpJsonTransportProviderBuilder() + .setHttpTransport( + new NetHttpTransport.Builder().doNotValidateCertificate().build()) + .setEndpoint(DEFAULT_HTTPJSON_ENDPOINT) + .setInterceptorProvider(() -> interceptorList) + .build()) + .build(); + return ComplianceClient.create(httpJsonComplianceSettings); + } + + public static EchoClient createGrpcEchoClientOpentelemetry(ApiTracerFactory metricsTracerFactory) + throws Exception { + return createGrpcEchoClientOpentelemetry( + metricsTracerFactory, + EchoSettings.defaultGrpcTransportProviderBuilder() + .setChannelConfigurator(ManagedChannelBuilder::usePlaintext) + .build()); + } + + public static EchoClient createGrpcEchoClientOpentelemetry( + ApiTracerFactory metricsTracerFactory, TransportChannelProvider transportChannelProvider) + throws Exception { + EchoSettings grpcEchoSettings = + EchoSettings.newBuilder() + .setCredentialsProvider(NoCredentialsProvider.create()) + .setTransportChannelProvider(transportChannelProvider) + .setEndpoint(DEFAULT_GRPC_ENDPOINT) + .build(); + + EchoStubSettings echoStubSettings = + (EchoStubSettings) + grpcEchoSettings.getStubSettings().toBuilder() + .setTracerFactory(metricsTracerFactory) + .build(); + EchoStub stub = echoStubSettings.createStub(); + + return EchoClient.create(stub); + } + + public static EchoClient createHttpJsonEchoClientOpentelemetry( + ApiTracerFactory metricsTracerFactory) throws Exception { + + EchoSettings httpJsonEchoSettings = + EchoSettings.newHttpJsonBuilder() + .setCredentialsProvider(NoCredentialsProvider.create()) + .setTransportChannelProvider( + EchoSettings.defaultHttpJsonTransportProviderBuilder() + .setHttpTransport( + new NetHttpTransport.Builder().doNotValidateCertificate().build()) + .setEndpoint(DEFAULT_HTTPJSON_ENDPOINT) + .build()) + .build(); + + EchoStubSettings echoStubSettings = + (EchoStubSettings) + httpJsonEchoSettings.getStubSettings().toBuilder() + .setTracerFactory(metricsTracerFactory) + .build(); + EchoStub stub = echoStubSettings.createStub(); + + return EchoClient.create(stub); + } +} diff --git a/java-showcase-3.25.8/gapic-showcase/src/test/resources/META-INF/native-image/resource-config.json b/java-showcase-3.25.8/gapic-showcase/src/test/resources/META-INF/native-image/resource-config.json new file mode 100644 index 0000000000..bfa2659f0a --- /dev/null +++ b/java-showcase-3.25.8/gapic-showcase/src/test/resources/META-INF/native-image/resource-config.json @@ -0,0 +1,6 @@ +{ + "resources": [ + { "pattern": ".*.json" }, + { "pattern": ".*.pem" } + ] +} \ No newline at end of file diff --git a/java-showcase-3.25.8/gapic-showcase/src/test/resources/compliance_suite.json b/java-showcase-3.25.8/gapic-showcase/src/test/resources/compliance_suite.json new file mode 100644 index 0000000000..a458819b35 --- /dev/null +++ b/java-showcase-3.25.8/gapic-showcase/src/test/resources/compliance_suite.json @@ -0,0 +1,240 @@ +{ + "group": [ + { + "name": "Fully working conversions, no resources", + "rpcs": ["Compliance.RepeatDataBody", "Compliance.RepeatDataBodyPut", "Compliance.RepeatDataBodyPatch", "Compliance.RepeatDataQuery", "Compliance.RepeatDataSimplePath", "Compliance.RepeatDataBodyInfo"], + "requests": [ + { + "name": "Basic data types", + "serverVerify": true, + "info": { + "fString": "Hello", + "fInt32": -1, + "fSint32" : -2, + "fSfixed32": -3, + "fUint32": 5, + "fFixed32": 7, + "fInt64": -11, + "fSint64": -13, + "fSfixed64": -17, + "fUint64": 19, + "fFixed64":23, + "fDouble": -29e4, + "fFloat": -31, + "fBool": true, + "fKingdom": "ANIMALIA", + + "pString": "Goodbye", + "pInt32": -37, + "pDouble": -41.43, + "pBool": true, + "pKingdom": "PLANTAE", + + "fChild": { + "fString": "second/bool/salutation" + } + }, + "fInt32": -10, + "fInt64": -110, + "fDouble": -54e4, + + "pInt32": -47, + "pInt64": -477, + "pDouble": -61.73 + }, + { + "name": "Basic types, no optional fields", + "serverVerify": true, + "info": { + "fString": "Hello", + "fInt32": -1, + "fSint32" : -2, + "fSfixed32": -3, + "fUint32": 5, + "fFixed32": 7, + "fInt64": -11, + "fSint64": -13, + "fSfixed64": -17, + "fUint64": 19, + "fFixed64":23, + "fDouble": -29e4, + "fFloat": -31, + "fBool": true, + "fKingdom": "ANIMALIA", + + "fChild": { + "fString": "second/bool/salutation" + } + } + }, + + { + "name": "Zero values for non-string fields", + "serverVerify": true, + "info": { + "fString": "Hello", + "fInt32": 0, + "fSint32" : 0, + "fSfixed32": 0, + "fUint32": 0, + "fFixed32": 0, + "fInt64": 0, + "fSint64": 0, + "fSfixed64": 0, + "fUint64": 0, + "fFixed64": 0, + "fDouble": 0, + "fFloat": 0, + "fBool": false, + "fKingdom": "LIFE_KINGDOM_UNSPECIFIED", + + "pString": "Goodbye", + "pInt32": 0, + "pDouble": 0, + "pBool": false, + "pKingdom": "LIFE_KINGDOM_UNSPECIFIED" + } + }, + { + "name": "Extreme values", + "serverVerify": true, + "info": { + "fString": "non-ASCII+non-printable string ☺ → ← \"\\\/\b\f\r\t\u1234 works, not newlines yet", + "fInt32": 2147483647, + "fSint32" : 2147483647, + "fSfixed32": 2147483647, + "fUint32": 4294967295, + "fFixed32": 4294967295, + "fInt64": "9223372036854775807", + "fSint64": "9223372036854775807", + "fSfixed64": "9223372036854775807", + "fUint64": "18446744073709551615", + "fFixed64": "18446744073709551615", + "fDouble": 1.797693134862315708145274237317043567981e+308, + "fFloat": 3.40282346638528859811704183484516925440e+38, + "fBool": false, + + "pString": "Goodbye", + "pInt32": 2147483647, + "pDouble": 1.797693134862315708145274237317043567981e+308, + "pBool": false + } + }, + { + "name": "Strings with spaces", + "serverVerify": true, + "info": { + "fString": "Hello there" + } + }, + { + "name": "Strings with quotes", + "serverVerify": true, + "info": { + "fString": "Hello \"You\"" + } + }, + { + "name": "Strings with percents", + "serverVerify": true, + "info": { + "fString": "Hello 100%" + } + } + ] + }, + { + "name": "Fully working conversions, resources", + "rpcs": ["Compliance.RepeatDataBody", "Compliance.RepeatDataBodyPut", "Compliance.RepeatDataBodyPatch", "Compliance.RepeatDataQuery"], + "requests": [ + { + "name": "Strings with slashes and values that resemble subsequent resource templates", + "serverVerify": true, + "info": { + "fString": "first/hello/second/greetings", + "pBool": true, + + "fChild": { + "fString": "second/zzz/bool/true" + } + } + } + ] + }, + { + "name": "Binding selection testing", + "rpcs": ["Compliance.RepeatDataPathResource"], + "requests": [ + { + "name": "Binding testing baseline no Uri verification", + "serverVerify": true, + "info": { + "fString": "first/hello", + "pBool": true, + + "fChild": { + "fString": "second/greetings" + } + } + }, + { + "name": "Binding testing first binding", + "serverVerify": true, + "info": { + "fString": "first/hello", + "pBool": true, + + "fChild": { + "fString": "second/greetings" + } + }, + "intendedBindingUri": "/v1beta1/repeat/{info.f_string=first/*}/{info.f_child.f_string=second/*}/bool/{info.f_bool}:pathresource" + }, + { + "name": "Binding testing additional binding", + "serverVerify": true, + "info": { + "fString": "second/greetings", + "pBool": true, + + "fChild": { + "fString": "first/hello" + } + }, + "intendedBindingUri": "/v1beta1/repeat/{info.f_child.f_string=first/*}/{info.f_string=second/*}/bool/{info.f_bool}:childfirstpathresource" + } + ] + }, + { + "name": "Cases that apply to non-path requests", + "rpcs": ["Compliance.RepeatDataBody", "Compliance.RepeatDataBodyPut", "Compliance.RepeatDataBodyPatch", "Compliance.RepeatDataQuery"], + "requests": [ + { + "name": "Zero values for all fields", + "serverVerify": true, + "info": { + "fString": "", + "fInt32": 0, + "fSint32" : 0, + "fSfixed32": 0, + "fUint32": 0, + "fFixed32": 0, + "fInt64": 0, + "fSint64": 0, + "fSfixed64": 0, + "fUint64": 0, + "fFixed64":20, + "fDouble": 0, + "fFloat": 0, + "fBool": false, + + "pString": "", + "pInt32": 0, + "pDouble": 0, + "pBool": false + } + } + ] + } + ] +} diff --git a/java-showcase-3.25.8/gapic-showcase/src/test/resources/fake_cert.pem b/java-showcase-3.25.8/gapic-showcase/src/test/resources/fake_cert.pem new file mode 100644 index 0000000000..03febfd3ae --- /dev/null +++ b/java-showcase-3.25.8/gapic-showcase/src/test/resources/fake_cert.pem @@ -0,0 +1,15 @@ +-----BEGIN CERTIFICATE----- +MIICUTCCAfugAwIBAgIBADANBgkqhkiG9w0BAQQFADBXMQswCQYDVQQGEwJDTjEL +MAkGA1UECBMCUE4xCzAJBgNVBAcTAkNOMQswCQYDVQQKEwJPTjELMAkGA1UECxMC +VU4xFDASBgNVBAMTC0hlcm9uZyBZYW5nMB4XDTA1MDcxNTIxMTk0N1oXDTA1MDgx +NDIxMTk0N1owVzELMAkGA1UEBhMCQ04xCzAJBgNVBAgTAlBOMQswCQYDVQQHEwJD +TjELMAkGA1UEChMCT04xCzAJBgNVBAsTAlVOMRQwEgYDVQQDEwtIZXJvbmcgWWFu +ZzBcMA0GCSqGSIb3DQEBAQUAA0sAMEgCQQCp5hnG7ogBhtlynpOS21cBewKE/B7j +V14qeyslnr26xZUsSVko36ZnhiaO/zbMOoRcKK9vEcgMtcLFuQTWDl3RAgMBAAGj +gbEwga4wHQYDVR0OBBYEFFXI70krXeQDxZgbaCQoR4jUDncEMH8GA1UdIwR4MHaA +FFXI70krXeQDxZgbaCQoR4jUDncEoVukWTBXMQswCQYDVQQGEwJDTjELMAkGA1UE +CBMCUE4xCzAJBgNVBAcTAkNOMQswCQYDVQQKEwJPTjELMAkGA1UECxMCVU4xFDAS +BgNVBAMTC0hlcm9uZyBZYW5nggEAMAwGA1UdEwQFMAMBAf8wDQYJKoZIhvcNAQEE +BQADQQA/ugzBrjjK9jcWnDVfGHlk3icNRq0oV7Ri32z/+HQX67aRfgZu7KWdI+Ju +Wm7DCfrPNGVwFWUQOmsPue9rZBgO +-----END CERTIFICATE----- diff --git a/java-showcase-3.25.8/gapic-showcase/src/test/resources/test_gdch_credential.json b/java-showcase-3.25.8/gapic-showcase/src/test/resources/test_gdch_credential.json new file mode 100644 index 0000000000..16c2582cdc --- /dev/null +++ b/java-showcase-3.25.8/gapic-showcase/src/test/resources/test_gdch_credential.json @@ -0,0 +1,10 @@ +{ + "type": "gdch_service_account", + "format_version": "1", + "project": "project-id", + "private_key_id": "d84a4fefcf50791d4a90f2d7af17469d6282df9d", + "private_key": "-----BEGIN PRIVATE KEY-----\nMIICdgIBADANBgkqhkiG9w0BAQEFAASCAmAwggJcAgEAAoGBALX0PQoe1igW12i\nkv1bN/r9lN749y2ijmbc/mFHPyS3hNTyOCjDvBbXYbDhQJzWVUikh4mvGBA07qTj79Xc3yBDfKP2IeyYQIFe0t0\nzkd7R9Zdn98Y2rIQC47aAbDfubtkU1U72t4zL11kHvoa0/RuFZjncvlr42X7be7lYh4p3NAgMBAAECgYASk5wDw\n4Az2ZkmeuN6Fk/y9H+Lcb2pskJIXjrL533vrDWGOC48LrsThMQPv8cxBky8HFSEklPpkfTF95tpD43iVwJRB/Gr\nCtGTw65IfJ4/tI09h6zGc4yqvIo1cHX/LQ+SxKLGyir/dQM925rGt/VojxY5ryJR7GLbCzxPnJm/oQJBANwOCO6\nD2hy1LQYJhXh7O+RLtA/tSnT1xyMQsGT+uUCMiKS2bSKx2wxo9k7h3OegNJIu1q6nZ6AbxDK8H3+d0dUCQQDTrP\nSXagBxzp8PecbaCHjzNRSQE2in81qYnrAFNB4o3DpHyMMY6s5ALLeHKscEWnqP8Ur6X4PvzZecCWU9BKAZAkAut\nLPknAuxSCsUOvUfS1i87ex77Ot+w6POp34pEX+UWb+u5iFn2cQacDTHLV1LtE80L8jVLSbrbrlH43H0DjU5AkEA\ngidhycxS86dxpEljnOMCw8CKoUBd5I880IUahEiUltk7OLJYS/Ts1wbn3kPOVX3wyJs8WBDtBkFrDHW2ezth2QJ\nADj3e1YhMVdjJW5jqwlD/VNddGjgzyunmiZg0uOXsHXbytYmsA545S8KRQFaJKFXYYFo2kOjqOiC1T2cAzMDjCQ\n==\n-----END PRIVATE KEY-----\n", + "name": "service-identity-name", + "ca_cert_path": "fake-cert-path", + "token_uri": "https://service-identity.fake-domain/authenticate" +} diff --git a/java-showcase-3.25.8/grpc-gapic-showcase-v1beta1/clirr-ignored-differences.xml b/java-showcase-3.25.8/grpc-gapic-showcase-v1beta1/clirr-ignored-differences.xml new file mode 100644 index 0000000000..731f7543e2 --- /dev/null +++ b/java-showcase-3.25.8/grpc-gapic-showcase-v1beta1/clirr-ignored-differences.xml @@ -0,0 +1,8 @@ + + + + 7012 + com/google/showcase/v1beta1/EchoGrpc$AsyncService + *failEchoWithDetails(*) + + diff --git a/java-showcase-3.25.8/grpc-gapic-showcase-v1beta1/pom.xml b/java-showcase-3.25.8/grpc-gapic-showcase-v1beta1/pom.xml new file mode 100644 index 0000000000..9fce31015f --- /dev/null +++ b/java-showcase-3.25.8/grpc-gapic-showcase-v1beta1/pom.xml @@ -0,0 +1,65 @@ + + 4.0.0 + com.google.api.grpc + grpc-gapic-showcase-v1beta1 + 0.0.1-SNAPSHOT + grpc-gapic-showcase-v1beta1 + GRPC library for grpc-google-cloud-iot-v1 + + com.google.cloud + gapic-showcase-parent + 0.0.1-SNAPSHOT + + + + true + + + + + io.grpc + grpc-api + + + io.grpc + grpc-stub + + + io.grpc + grpc-protobuf + + + com.google.protobuf + protobuf-java + + + com.google.api.grpc + proto-gapic-showcase-v1beta1 + + + com.google.api.grpc + proto-google-iam-v1 + + + com.google.guava + guava + + + + + + + showcase-sonar-analysis + + + enableShowcaseTestCoverage + + + + true + + + + diff --git a/java-showcase-3.25.8/grpc-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ComplianceGrpc.java b/java-showcase-3.25.8/grpc-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ComplianceGrpc.java new file mode 100644 index 0000000000..5c42138987 --- /dev/null +++ b/java-showcase-3.25.8/grpc-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ComplianceGrpc.java @@ -0,0 +1,1638 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.showcase.v1beta1; + +import static io.grpc.MethodDescriptor.generateFullMethodName; + +/** + * + * + *

        + * This service is used to test that GAPICs implement various REST-related features correctly. This mostly means transcoding proto3 requests to REST format
        + * correctly for various types of HTTP annotations, but it also includes verifying that unknown (numeric) enums received by clients can be round-tripped
        + * correctly.
        + * 
        + */ +@io.grpc.stub.annotations.GrpcGenerated +public final class ComplianceGrpc { + + private ComplianceGrpc() {} + + public static final java.lang.String SERVICE_NAME = "google.showcase.v1beta1.Compliance"; + + // Static method descriptors that strictly reflect the proto. + private static volatile io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.RepeatRequest, com.google.showcase.v1beta1.RepeatResponse> + getRepeatDataBodyMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "RepeatDataBody", + requestType = com.google.showcase.v1beta1.RepeatRequest.class, + responseType = com.google.showcase.v1beta1.RepeatResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.RepeatRequest, com.google.showcase.v1beta1.RepeatResponse> + getRepeatDataBodyMethod() { + io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.RepeatRequest, com.google.showcase.v1beta1.RepeatResponse> + getRepeatDataBodyMethod; + if ((getRepeatDataBodyMethod = ComplianceGrpc.getRepeatDataBodyMethod) == null) { + synchronized (ComplianceGrpc.class) { + if ((getRepeatDataBodyMethod = ComplianceGrpc.getRepeatDataBodyMethod) == null) { + ComplianceGrpc.getRepeatDataBodyMethod = + getRepeatDataBodyMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "RepeatDataBody")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.RepeatRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.RepeatResponse.getDefaultInstance())) + .setSchemaDescriptor(new ComplianceMethodDescriptorSupplier("RepeatDataBody")) + .build(); + } + } + } + return getRepeatDataBodyMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.RepeatRequest, com.google.showcase.v1beta1.RepeatResponse> + getRepeatDataBodyInfoMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "RepeatDataBodyInfo", + requestType = com.google.showcase.v1beta1.RepeatRequest.class, + responseType = com.google.showcase.v1beta1.RepeatResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.RepeatRequest, com.google.showcase.v1beta1.RepeatResponse> + getRepeatDataBodyInfoMethod() { + io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.RepeatRequest, com.google.showcase.v1beta1.RepeatResponse> + getRepeatDataBodyInfoMethod; + if ((getRepeatDataBodyInfoMethod = ComplianceGrpc.getRepeatDataBodyInfoMethod) == null) { + synchronized (ComplianceGrpc.class) { + if ((getRepeatDataBodyInfoMethod = ComplianceGrpc.getRepeatDataBodyInfoMethod) == null) { + ComplianceGrpc.getRepeatDataBodyInfoMethod = + getRepeatDataBodyInfoMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "RepeatDataBodyInfo")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.RepeatRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.RepeatResponse.getDefaultInstance())) + .setSchemaDescriptor( + new ComplianceMethodDescriptorSupplier("RepeatDataBodyInfo")) + .build(); + } + } + } + return getRepeatDataBodyInfoMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.RepeatRequest, com.google.showcase.v1beta1.RepeatResponse> + getRepeatDataQueryMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "RepeatDataQuery", + requestType = com.google.showcase.v1beta1.RepeatRequest.class, + responseType = com.google.showcase.v1beta1.RepeatResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.RepeatRequest, com.google.showcase.v1beta1.RepeatResponse> + getRepeatDataQueryMethod() { + io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.RepeatRequest, com.google.showcase.v1beta1.RepeatResponse> + getRepeatDataQueryMethod; + if ((getRepeatDataQueryMethod = ComplianceGrpc.getRepeatDataQueryMethod) == null) { + synchronized (ComplianceGrpc.class) { + if ((getRepeatDataQueryMethod = ComplianceGrpc.getRepeatDataQueryMethod) == null) { + ComplianceGrpc.getRepeatDataQueryMethod = + getRepeatDataQueryMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "RepeatDataQuery")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.RepeatRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.RepeatResponse.getDefaultInstance())) + .setSchemaDescriptor( + new ComplianceMethodDescriptorSupplier("RepeatDataQuery")) + .build(); + } + } + } + return getRepeatDataQueryMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.RepeatRequest, com.google.showcase.v1beta1.RepeatResponse> + getRepeatDataSimplePathMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "RepeatDataSimplePath", + requestType = com.google.showcase.v1beta1.RepeatRequest.class, + responseType = com.google.showcase.v1beta1.RepeatResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.RepeatRequest, com.google.showcase.v1beta1.RepeatResponse> + getRepeatDataSimplePathMethod() { + io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.RepeatRequest, com.google.showcase.v1beta1.RepeatResponse> + getRepeatDataSimplePathMethod; + if ((getRepeatDataSimplePathMethod = ComplianceGrpc.getRepeatDataSimplePathMethod) == null) { + synchronized (ComplianceGrpc.class) { + if ((getRepeatDataSimplePathMethod = ComplianceGrpc.getRepeatDataSimplePathMethod) + == null) { + ComplianceGrpc.getRepeatDataSimplePathMethod = + getRepeatDataSimplePathMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName(SERVICE_NAME, "RepeatDataSimplePath")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.RepeatRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.RepeatResponse.getDefaultInstance())) + .setSchemaDescriptor( + new ComplianceMethodDescriptorSupplier("RepeatDataSimplePath")) + .build(); + } + } + } + return getRepeatDataSimplePathMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.RepeatRequest, com.google.showcase.v1beta1.RepeatResponse> + getRepeatDataPathResourceMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "RepeatDataPathResource", + requestType = com.google.showcase.v1beta1.RepeatRequest.class, + responseType = com.google.showcase.v1beta1.RepeatResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.RepeatRequest, com.google.showcase.v1beta1.RepeatResponse> + getRepeatDataPathResourceMethod() { + io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.RepeatRequest, com.google.showcase.v1beta1.RepeatResponse> + getRepeatDataPathResourceMethod; + if ((getRepeatDataPathResourceMethod = ComplianceGrpc.getRepeatDataPathResourceMethod) + == null) { + synchronized (ComplianceGrpc.class) { + if ((getRepeatDataPathResourceMethod = ComplianceGrpc.getRepeatDataPathResourceMethod) + == null) { + ComplianceGrpc.getRepeatDataPathResourceMethod = + getRepeatDataPathResourceMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName(SERVICE_NAME, "RepeatDataPathResource")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.RepeatRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.RepeatResponse.getDefaultInstance())) + .setSchemaDescriptor( + new ComplianceMethodDescriptorSupplier("RepeatDataPathResource")) + .build(); + } + } + } + return getRepeatDataPathResourceMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.RepeatRequest, com.google.showcase.v1beta1.RepeatResponse> + getRepeatDataPathTrailingResourceMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "RepeatDataPathTrailingResource", + requestType = com.google.showcase.v1beta1.RepeatRequest.class, + responseType = com.google.showcase.v1beta1.RepeatResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.RepeatRequest, com.google.showcase.v1beta1.RepeatResponse> + getRepeatDataPathTrailingResourceMethod() { + io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.RepeatRequest, com.google.showcase.v1beta1.RepeatResponse> + getRepeatDataPathTrailingResourceMethod; + if ((getRepeatDataPathTrailingResourceMethod = + ComplianceGrpc.getRepeatDataPathTrailingResourceMethod) + == null) { + synchronized (ComplianceGrpc.class) { + if ((getRepeatDataPathTrailingResourceMethod = + ComplianceGrpc.getRepeatDataPathTrailingResourceMethod) + == null) { + ComplianceGrpc.getRepeatDataPathTrailingResourceMethod = + getRepeatDataPathTrailingResourceMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName(SERVICE_NAME, "RepeatDataPathTrailingResource")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.RepeatRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.RepeatResponse.getDefaultInstance())) + .setSchemaDescriptor( + new ComplianceMethodDescriptorSupplier("RepeatDataPathTrailingResource")) + .build(); + } + } + } + return getRepeatDataPathTrailingResourceMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.RepeatRequest, com.google.showcase.v1beta1.RepeatResponse> + getRepeatDataBodyPutMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "RepeatDataBodyPut", + requestType = com.google.showcase.v1beta1.RepeatRequest.class, + responseType = com.google.showcase.v1beta1.RepeatResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.RepeatRequest, com.google.showcase.v1beta1.RepeatResponse> + getRepeatDataBodyPutMethod() { + io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.RepeatRequest, com.google.showcase.v1beta1.RepeatResponse> + getRepeatDataBodyPutMethod; + if ((getRepeatDataBodyPutMethod = ComplianceGrpc.getRepeatDataBodyPutMethod) == null) { + synchronized (ComplianceGrpc.class) { + if ((getRepeatDataBodyPutMethod = ComplianceGrpc.getRepeatDataBodyPutMethod) == null) { + ComplianceGrpc.getRepeatDataBodyPutMethod = + getRepeatDataBodyPutMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "RepeatDataBodyPut")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.RepeatRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.RepeatResponse.getDefaultInstance())) + .setSchemaDescriptor( + new ComplianceMethodDescriptorSupplier("RepeatDataBodyPut")) + .build(); + } + } + } + return getRepeatDataBodyPutMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.RepeatRequest, com.google.showcase.v1beta1.RepeatResponse> + getRepeatDataBodyPatchMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "RepeatDataBodyPatch", + requestType = com.google.showcase.v1beta1.RepeatRequest.class, + responseType = com.google.showcase.v1beta1.RepeatResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.RepeatRequest, com.google.showcase.v1beta1.RepeatResponse> + getRepeatDataBodyPatchMethod() { + io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.RepeatRequest, com.google.showcase.v1beta1.RepeatResponse> + getRepeatDataBodyPatchMethod; + if ((getRepeatDataBodyPatchMethod = ComplianceGrpc.getRepeatDataBodyPatchMethod) == null) { + synchronized (ComplianceGrpc.class) { + if ((getRepeatDataBodyPatchMethod = ComplianceGrpc.getRepeatDataBodyPatchMethod) == null) { + ComplianceGrpc.getRepeatDataBodyPatchMethod = + getRepeatDataBodyPatchMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName(SERVICE_NAME, "RepeatDataBodyPatch")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.RepeatRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.RepeatResponse.getDefaultInstance())) + .setSchemaDescriptor( + new ComplianceMethodDescriptorSupplier("RepeatDataBodyPatch")) + .build(); + } + } + } + return getRepeatDataBodyPatchMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.EnumRequest, com.google.showcase.v1beta1.EnumResponse> + getGetEnumMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "GetEnum", + requestType = com.google.showcase.v1beta1.EnumRequest.class, + responseType = com.google.showcase.v1beta1.EnumResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.EnumRequest, com.google.showcase.v1beta1.EnumResponse> + getGetEnumMethod() { + io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.EnumRequest, com.google.showcase.v1beta1.EnumResponse> + getGetEnumMethod; + if ((getGetEnumMethod = ComplianceGrpc.getGetEnumMethod) == null) { + synchronized (ComplianceGrpc.class) { + if ((getGetEnumMethod = ComplianceGrpc.getGetEnumMethod) == null) { + ComplianceGrpc.getGetEnumMethod = + getGetEnumMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetEnum")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.EnumRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.EnumResponse.getDefaultInstance())) + .setSchemaDescriptor(new ComplianceMethodDescriptorSupplier("GetEnum")) + .build(); + } + } + } + return getGetEnumMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.EnumResponse, com.google.showcase.v1beta1.EnumResponse> + getVerifyEnumMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "VerifyEnum", + requestType = com.google.showcase.v1beta1.EnumResponse.class, + responseType = com.google.showcase.v1beta1.EnumResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.EnumResponse, com.google.showcase.v1beta1.EnumResponse> + getVerifyEnumMethod() { + io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.EnumResponse, com.google.showcase.v1beta1.EnumResponse> + getVerifyEnumMethod; + if ((getVerifyEnumMethod = ComplianceGrpc.getVerifyEnumMethod) == null) { + synchronized (ComplianceGrpc.class) { + if ((getVerifyEnumMethod = ComplianceGrpc.getVerifyEnumMethod) == null) { + ComplianceGrpc.getVerifyEnumMethod = + getVerifyEnumMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "VerifyEnum")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.EnumResponse.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.EnumResponse.getDefaultInstance())) + .setSchemaDescriptor(new ComplianceMethodDescriptorSupplier("VerifyEnum")) + .build(); + } + } + } + return getVerifyEnumMethod; + } + + /** Creates a new async stub that supports all call types for the service */ + public static ComplianceStub newStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public ComplianceStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new ComplianceStub(channel, callOptions); + } + }; + return ComplianceStub.newStub(factory, channel); + } + + /** Creates a new blocking-style stub that supports all types of calls on the service */ + public static ComplianceBlockingV2Stub newBlockingV2Stub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public ComplianceBlockingV2Stub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new ComplianceBlockingV2Stub(channel, callOptions); + } + }; + return ComplianceBlockingV2Stub.newStub(factory, channel); + } + + /** + * Creates a new blocking-style stub that supports unary and streaming output calls on the service + */ + public static ComplianceBlockingStub newBlockingStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public ComplianceBlockingStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new ComplianceBlockingStub(channel, callOptions); + } + }; + return ComplianceBlockingStub.newStub(factory, channel); + } + + /** Creates a new ListenableFuture-style stub that supports unary calls on the service */ + public static ComplianceFutureStub newFutureStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public ComplianceFutureStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new ComplianceFutureStub(channel, callOptions); + } + }; + return ComplianceFutureStub.newStub(factory, channel); + } + + /** + * + * + *
        +   * This service is used to test that GAPICs implement various REST-related features correctly. This mostly means transcoding proto3 requests to REST format
        +   * correctly for various types of HTTP annotations, but it also includes verifying that unknown (numeric) enums received by clients can be round-tripped
        +   * correctly.
        +   * 
        + */ + public interface AsyncService { + + /** + * + * + *
        +     * This method echoes the ComplianceData request. This method exercises
        +     * sending the entire request object in the REST body.
        +     * 
        + */ + default void repeatDataBody( + com.google.showcase.v1beta1.RepeatRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getRepeatDataBodyMethod(), responseObserver); + } + + /** + * + * + *
        +     * This method echoes the ComplianceData request. This method exercises
        +     * sending the a message-type field in the REST body. Per AIP-127, only
        +     * top-level, non-repeated fields can be sent this way.
        +     * 
        + */ + default void repeatDataBodyInfo( + com.google.showcase.v1beta1.RepeatRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getRepeatDataBodyInfoMethod(), responseObserver); + } + + /** + * + * + *
        +     * This method echoes the ComplianceData request. This method exercises
        +     * sending all request fields as query parameters.
        +     * 
        + */ + default void repeatDataQuery( + com.google.showcase.v1beta1.RepeatRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getRepeatDataQueryMethod(), responseObserver); + } + + /** + * + * + *
        +     * This method echoes the ComplianceData request. This method exercises
        +     * sending some parameters as "simple" path variables (i.e., of the form
        +     * "/bar/{foo}" rather than "/{foo=bar/*}"), and the rest as query parameters.
        +     * 
        + */ + default void repeatDataSimplePath( + com.google.showcase.v1beta1.RepeatRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getRepeatDataSimplePathMethod(), responseObserver); + } + + /** + * + * + *
        +     * Same as RepeatDataSimplePath, but with a path resource.
        +     * 
        + */ + default void repeatDataPathResource( + com.google.showcase.v1beta1.RepeatRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getRepeatDataPathResourceMethod(), responseObserver); + } + + /** + * + * + *
        +     * Same as RepeatDataSimplePath, but with a trailing resource.
        +     * 
        + */ + default void repeatDataPathTrailingResource( + com.google.showcase.v1beta1.RepeatRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getRepeatDataPathTrailingResourceMethod(), responseObserver); + } + + /** + * + * + *
        +     * This method echoes the ComplianceData request, using the HTTP PUT method.
        +     * 
        + */ + default void repeatDataBodyPut( + com.google.showcase.v1beta1.RepeatRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getRepeatDataBodyPutMethod(), responseObserver); + } + + /** + * + * + *
        +     * This method echoes the ComplianceData request, using the HTTP PATCH method.
        +     * 
        + */ + default void repeatDataBodyPatch( + com.google.showcase.v1beta1.RepeatRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getRepeatDataBodyPatchMethod(), responseObserver); + } + + /** + * + * + *
        +     * This method requests an enum value from the server. Depending on the contents of EnumRequest, the enum value returned will be a known enum declared in the
        +     * .proto file, or a made-up enum value the is unknown to the client. To verify that clients can round-trip unknown enum values they receive, use the
        +     * response from this RPC as the request to VerifyEnum()
        +     * The values of enums sent by the server when a known or unknown value is requested will be the same within a single Showcase server run (this is needed for
        +     * VerifyEnum() to work) but are not guaranteed to be the same across separate Showcase server runs.
        +     * 
        + */ + default void getEnum( + com.google.showcase.v1beta1.EnumRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getGetEnumMethod(), responseObserver); + } + + /** + * + * + *
        +     * This method is used to verify that clients can round-trip enum values, which is particularly important for unknown enum values over REST. VerifyEnum()
        +     * verifies that its request, which is presumably the response that the client previously got to a GetEnum(), contains the correct data. If so, it responds
        +     * with the same EnumResponse; otherwise, the RPC errors.
        +     * This works because the values of enums sent by the server when a known or unknown value is requested will be the same within a single Showcase server run,
        +     * although they are not guaranteed to be the same across separate Showcase server runs.
        +     * 
        + */ + default void verifyEnum( + com.google.showcase.v1beta1.EnumResponse request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getVerifyEnumMethod(), responseObserver); + } + } + + /** + * Base class for the server implementation of the service Compliance. + * + *
        +   * This service is used to test that GAPICs implement various REST-related features correctly. This mostly means transcoding proto3 requests to REST format
        +   * correctly for various types of HTTP annotations, but it also includes verifying that unknown (numeric) enums received by clients can be round-tripped
        +   * correctly.
        +   * 
        + */ + public abstract static class ComplianceImplBase implements io.grpc.BindableService, AsyncService { + + @java.lang.Override + public final io.grpc.ServerServiceDefinition bindService() { + return ComplianceGrpc.bindService(this); + } + } + + /** + * A stub to allow clients to do asynchronous rpc calls to service Compliance. + * + *
        +   * This service is used to test that GAPICs implement various REST-related features correctly. This mostly means transcoding proto3 requests to REST format
        +   * correctly for various types of HTTP annotations, but it also includes verifying that unknown (numeric) enums received by clients can be round-tripped
        +   * correctly.
        +   * 
        + */ + public static final class ComplianceStub extends io.grpc.stub.AbstractAsyncStub { + private ComplianceStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected ComplianceStub build(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new ComplianceStub(channel, callOptions); + } + + /** + * + * + *
        +     * This method echoes the ComplianceData request. This method exercises
        +     * sending the entire request object in the REST body.
        +     * 
        + */ + public void repeatDataBody( + com.google.showcase.v1beta1.RepeatRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getRepeatDataBodyMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
        +     * This method echoes the ComplianceData request. This method exercises
        +     * sending the a message-type field in the REST body. Per AIP-127, only
        +     * top-level, non-repeated fields can be sent this way.
        +     * 
        + */ + public void repeatDataBodyInfo( + com.google.showcase.v1beta1.RepeatRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getRepeatDataBodyInfoMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
        +     * This method echoes the ComplianceData request. This method exercises
        +     * sending all request fields as query parameters.
        +     * 
        + */ + public void repeatDataQuery( + com.google.showcase.v1beta1.RepeatRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getRepeatDataQueryMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
        +     * This method echoes the ComplianceData request. This method exercises
        +     * sending some parameters as "simple" path variables (i.e., of the form
        +     * "/bar/{foo}" rather than "/{foo=bar/*}"), and the rest as query parameters.
        +     * 
        + */ + public void repeatDataSimplePath( + com.google.showcase.v1beta1.RepeatRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getRepeatDataSimplePathMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
        +     * Same as RepeatDataSimplePath, but with a path resource.
        +     * 
        + */ + public void repeatDataPathResource( + com.google.showcase.v1beta1.RepeatRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getRepeatDataPathResourceMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
        +     * Same as RepeatDataSimplePath, but with a trailing resource.
        +     * 
        + */ + public void repeatDataPathTrailingResource( + com.google.showcase.v1beta1.RepeatRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getRepeatDataPathTrailingResourceMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
        +     * This method echoes the ComplianceData request, using the HTTP PUT method.
        +     * 
        + */ + public void repeatDataBodyPut( + com.google.showcase.v1beta1.RepeatRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getRepeatDataBodyPutMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
        +     * This method echoes the ComplianceData request, using the HTTP PATCH method.
        +     * 
        + */ + public void repeatDataBodyPatch( + com.google.showcase.v1beta1.RepeatRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getRepeatDataBodyPatchMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
        +     * This method requests an enum value from the server. Depending on the contents of EnumRequest, the enum value returned will be a known enum declared in the
        +     * .proto file, or a made-up enum value the is unknown to the client. To verify that clients can round-trip unknown enum values they receive, use the
        +     * response from this RPC as the request to VerifyEnum()
        +     * The values of enums sent by the server when a known or unknown value is requested will be the same within a single Showcase server run (this is needed for
        +     * VerifyEnum() to work) but are not guaranteed to be the same across separate Showcase server runs.
        +     * 
        + */ + public void getEnum( + com.google.showcase.v1beta1.EnumRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getGetEnumMethod(), getCallOptions()), request, responseObserver); + } + + /** + * + * + *
        +     * This method is used to verify that clients can round-trip enum values, which is particularly important for unknown enum values over REST. VerifyEnum()
        +     * verifies that its request, which is presumably the response that the client previously got to a GetEnum(), contains the correct data. If so, it responds
        +     * with the same EnumResponse; otherwise, the RPC errors.
        +     * This works because the values of enums sent by the server when a known or unknown value is requested will be the same within a single Showcase server run,
        +     * although they are not guaranteed to be the same across separate Showcase server runs.
        +     * 
        + */ + public void verifyEnum( + com.google.showcase.v1beta1.EnumResponse request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getVerifyEnumMethod(), getCallOptions()), request, responseObserver); + } + } + + /** + * A stub to allow clients to do synchronous rpc calls to service Compliance. + * + *
        +   * This service is used to test that GAPICs implement various REST-related features correctly. This mostly means transcoding proto3 requests to REST format
        +   * correctly for various types of HTTP annotations, but it also includes verifying that unknown (numeric) enums received by clients can be round-tripped
        +   * correctly.
        +   * 
        + */ + public static final class ComplianceBlockingV2Stub + extends io.grpc.stub.AbstractBlockingStub { + private ComplianceBlockingV2Stub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected ComplianceBlockingV2Stub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new ComplianceBlockingV2Stub(channel, callOptions); + } + + /** + * + * + *
        +     * This method echoes the ComplianceData request. This method exercises
        +     * sending the entire request object in the REST body.
        +     * 
        + */ + public com.google.showcase.v1beta1.RepeatResponse repeatDataBody( + com.google.showcase.v1beta1.RepeatRequest request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getRepeatDataBodyMethod(), getCallOptions(), request); + } + + /** + * + * + *
        +     * This method echoes the ComplianceData request. This method exercises
        +     * sending the a message-type field in the REST body. Per AIP-127, only
        +     * top-level, non-repeated fields can be sent this way.
        +     * 
        + */ + public com.google.showcase.v1beta1.RepeatResponse repeatDataBodyInfo( + com.google.showcase.v1beta1.RepeatRequest request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getRepeatDataBodyInfoMethod(), getCallOptions(), request); + } + + /** + * + * + *
        +     * This method echoes the ComplianceData request. This method exercises
        +     * sending all request fields as query parameters.
        +     * 
        + */ + public com.google.showcase.v1beta1.RepeatResponse repeatDataQuery( + com.google.showcase.v1beta1.RepeatRequest request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getRepeatDataQueryMethod(), getCallOptions(), request); + } + + /** + * + * + *
        +     * This method echoes the ComplianceData request. This method exercises
        +     * sending some parameters as "simple" path variables (i.e., of the form
        +     * "/bar/{foo}" rather than "/{foo=bar/*}"), and the rest as query parameters.
        +     * 
        + */ + public com.google.showcase.v1beta1.RepeatResponse repeatDataSimplePath( + com.google.showcase.v1beta1.RepeatRequest request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getRepeatDataSimplePathMethod(), getCallOptions(), request); + } + + /** + * + * + *
        +     * Same as RepeatDataSimplePath, but with a path resource.
        +     * 
        + */ + public com.google.showcase.v1beta1.RepeatResponse repeatDataPathResource( + com.google.showcase.v1beta1.RepeatRequest request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getRepeatDataPathResourceMethod(), getCallOptions(), request); + } + + /** + * + * + *
        +     * Same as RepeatDataSimplePath, but with a trailing resource.
        +     * 
        + */ + public com.google.showcase.v1beta1.RepeatResponse repeatDataPathTrailingResource( + com.google.showcase.v1beta1.RepeatRequest request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getRepeatDataPathTrailingResourceMethod(), getCallOptions(), request); + } + + /** + * + * + *
        +     * This method echoes the ComplianceData request, using the HTTP PUT method.
        +     * 
        + */ + public com.google.showcase.v1beta1.RepeatResponse repeatDataBodyPut( + com.google.showcase.v1beta1.RepeatRequest request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getRepeatDataBodyPutMethod(), getCallOptions(), request); + } + + /** + * + * + *
        +     * This method echoes the ComplianceData request, using the HTTP PATCH method.
        +     * 
        + */ + public com.google.showcase.v1beta1.RepeatResponse repeatDataBodyPatch( + com.google.showcase.v1beta1.RepeatRequest request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getRepeatDataBodyPatchMethod(), getCallOptions(), request); + } + + /** + * + * + *
        +     * This method requests an enum value from the server. Depending on the contents of EnumRequest, the enum value returned will be a known enum declared in the
        +     * .proto file, or a made-up enum value the is unknown to the client. To verify that clients can round-trip unknown enum values they receive, use the
        +     * response from this RPC as the request to VerifyEnum()
        +     * The values of enums sent by the server when a known or unknown value is requested will be the same within a single Showcase server run (this is needed for
        +     * VerifyEnum() to work) but are not guaranteed to be the same across separate Showcase server runs.
        +     * 
        + */ + public com.google.showcase.v1beta1.EnumResponse getEnum( + com.google.showcase.v1beta1.EnumRequest request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getGetEnumMethod(), getCallOptions(), request); + } + + /** + * + * + *
        +     * This method is used to verify that clients can round-trip enum values, which is particularly important for unknown enum values over REST. VerifyEnum()
        +     * verifies that its request, which is presumably the response that the client previously got to a GetEnum(), contains the correct data. If so, it responds
        +     * with the same EnumResponse; otherwise, the RPC errors.
        +     * This works because the values of enums sent by the server when a known or unknown value is requested will be the same within a single Showcase server run,
        +     * although they are not guaranteed to be the same across separate Showcase server runs.
        +     * 
        + */ + public com.google.showcase.v1beta1.EnumResponse verifyEnum( + com.google.showcase.v1beta1.EnumResponse request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getVerifyEnumMethod(), getCallOptions(), request); + } + } + + /** + * A stub to allow clients to do limited synchronous rpc calls to service Compliance. + * + *
        +   * This service is used to test that GAPICs implement various REST-related features correctly. This mostly means transcoding proto3 requests to REST format
        +   * correctly for various types of HTTP annotations, but it also includes verifying that unknown (numeric) enums received by clients can be round-tripped
        +   * correctly.
        +   * 
        + */ + public static final class ComplianceBlockingStub + extends io.grpc.stub.AbstractBlockingStub { + private ComplianceBlockingStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected ComplianceBlockingStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new ComplianceBlockingStub(channel, callOptions); + } + + /** + * + * + *
        +     * This method echoes the ComplianceData request. This method exercises
        +     * sending the entire request object in the REST body.
        +     * 
        + */ + public com.google.showcase.v1beta1.RepeatResponse repeatDataBody( + com.google.showcase.v1beta1.RepeatRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getRepeatDataBodyMethod(), getCallOptions(), request); + } + + /** + * + * + *
        +     * This method echoes the ComplianceData request. This method exercises
        +     * sending the a message-type field in the REST body. Per AIP-127, only
        +     * top-level, non-repeated fields can be sent this way.
        +     * 
        + */ + public com.google.showcase.v1beta1.RepeatResponse repeatDataBodyInfo( + com.google.showcase.v1beta1.RepeatRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getRepeatDataBodyInfoMethod(), getCallOptions(), request); + } + + /** + * + * + *
        +     * This method echoes the ComplianceData request. This method exercises
        +     * sending all request fields as query parameters.
        +     * 
        + */ + public com.google.showcase.v1beta1.RepeatResponse repeatDataQuery( + com.google.showcase.v1beta1.RepeatRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getRepeatDataQueryMethod(), getCallOptions(), request); + } + + /** + * + * + *
        +     * This method echoes the ComplianceData request. This method exercises
        +     * sending some parameters as "simple" path variables (i.e., of the form
        +     * "/bar/{foo}" rather than "/{foo=bar/*}"), and the rest as query parameters.
        +     * 
        + */ + public com.google.showcase.v1beta1.RepeatResponse repeatDataSimplePath( + com.google.showcase.v1beta1.RepeatRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getRepeatDataSimplePathMethod(), getCallOptions(), request); + } + + /** + * + * + *
        +     * Same as RepeatDataSimplePath, but with a path resource.
        +     * 
        + */ + public com.google.showcase.v1beta1.RepeatResponse repeatDataPathResource( + com.google.showcase.v1beta1.RepeatRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getRepeatDataPathResourceMethod(), getCallOptions(), request); + } + + /** + * + * + *
        +     * Same as RepeatDataSimplePath, but with a trailing resource.
        +     * 
        + */ + public com.google.showcase.v1beta1.RepeatResponse repeatDataPathTrailingResource( + com.google.showcase.v1beta1.RepeatRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getRepeatDataPathTrailingResourceMethod(), getCallOptions(), request); + } + + /** + * + * + *
        +     * This method echoes the ComplianceData request, using the HTTP PUT method.
        +     * 
        + */ + public com.google.showcase.v1beta1.RepeatResponse repeatDataBodyPut( + com.google.showcase.v1beta1.RepeatRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getRepeatDataBodyPutMethod(), getCallOptions(), request); + } + + /** + * + * + *
        +     * This method echoes the ComplianceData request, using the HTTP PATCH method.
        +     * 
        + */ + public com.google.showcase.v1beta1.RepeatResponse repeatDataBodyPatch( + com.google.showcase.v1beta1.RepeatRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getRepeatDataBodyPatchMethod(), getCallOptions(), request); + } + + /** + * + * + *
        +     * This method requests an enum value from the server. Depending on the contents of EnumRequest, the enum value returned will be a known enum declared in the
        +     * .proto file, or a made-up enum value the is unknown to the client. To verify that clients can round-trip unknown enum values they receive, use the
        +     * response from this RPC as the request to VerifyEnum()
        +     * The values of enums sent by the server when a known or unknown value is requested will be the same within a single Showcase server run (this is needed for
        +     * VerifyEnum() to work) but are not guaranteed to be the same across separate Showcase server runs.
        +     * 
        + */ + public com.google.showcase.v1beta1.EnumResponse getEnum( + com.google.showcase.v1beta1.EnumRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getGetEnumMethod(), getCallOptions(), request); + } + + /** + * + * + *
        +     * This method is used to verify that clients can round-trip enum values, which is particularly important for unknown enum values over REST. VerifyEnum()
        +     * verifies that its request, which is presumably the response that the client previously got to a GetEnum(), contains the correct data. If so, it responds
        +     * with the same EnumResponse; otherwise, the RPC errors.
        +     * This works because the values of enums sent by the server when a known or unknown value is requested will be the same within a single Showcase server run,
        +     * although they are not guaranteed to be the same across separate Showcase server runs.
        +     * 
        + */ + public com.google.showcase.v1beta1.EnumResponse verifyEnum( + com.google.showcase.v1beta1.EnumResponse request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getVerifyEnumMethod(), getCallOptions(), request); + } + } + + /** + * A stub to allow clients to do ListenableFuture-style rpc calls to service Compliance. + * + *
        +   * This service is used to test that GAPICs implement various REST-related features correctly. This mostly means transcoding proto3 requests to REST format
        +   * correctly for various types of HTTP annotations, but it also includes verifying that unknown (numeric) enums received by clients can be round-tripped
        +   * correctly.
        +   * 
        + */ + public static final class ComplianceFutureStub + extends io.grpc.stub.AbstractFutureStub { + private ComplianceFutureStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected ComplianceFutureStub build(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new ComplianceFutureStub(channel, callOptions); + } + + /** + * + * + *
        +     * This method echoes the ComplianceData request. This method exercises
        +     * sending the entire request object in the REST body.
        +     * 
        + */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.showcase.v1beta1.RepeatResponse> + repeatDataBody(com.google.showcase.v1beta1.RepeatRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getRepeatDataBodyMethod(), getCallOptions()), request); + } + + /** + * + * + *
        +     * This method echoes the ComplianceData request. This method exercises
        +     * sending the a message-type field in the REST body. Per AIP-127, only
        +     * top-level, non-repeated fields can be sent this way.
        +     * 
        + */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.showcase.v1beta1.RepeatResponse> + repeatDataBodyInfo(com.google.showcase.v1beta1.RepeatRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getRepeatDataBodyInfoMethod(), getCallOptions()), request); + } + + /** + * + * + *
        +     * This method echoes the ComplianceData request. This method exercises
        +     * sending all request fields as query parameters.
        +     * 
        + */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.showcase.v1beta1.RepeatResponse> + repeatDataQuery(com.google.showcase.v1beta1.RepeatRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getRepeatDataQueryMethod(), getCallOptions()), request); + } + + /** + * + * + *
        +     * This method echoes the ComplianceData request. This method exercises
        +     * sending some parameters as "simple" path variables (i.e., of the form
        +     * "/bar/{foo}" rather than "/{foo=bar/*}"), and the rest as query parameters.
        +     * 
        + */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.showcase.v1beta1.RepeatResponse> + repeatDataSimplePath(com.google.showcase.v1beta1.RepeatRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getRepeatDataSimplePathMethod(), getCallOptions()), request); + } + + /** + * + * + *
        +     * Same as RepeatDataSimplePath, but with a path resource.
        +     * 
        + */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.showcase.v1beta1.RepeatResponse> + repeatDataPathResource(com.google.showcase.v1beta1.RepeatRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getRepeatDataPathResourceMethod(), getCallOptions()), request); + } + + /** + * + * + *
        +     * Same as RepeatDataSimplePath, but with a trailing resource.
        +     * 
        + */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.showcase.v1beta1.RepeatResponse> + repeatDataPathTrailingResource(com.google.showcase.v1beta1.RepeatRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getRepeatDataPathTrailingResourceMethod(), getCallOptions()), + request); + } + + /** + * + * + *
        +     * This method echoes the ComplianceData request, using the HTTP PUT method.
        +     * 
        + */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.showcase.v1beta1.RepeatResponse> + repeatDataBodyPut(com.google.showcase.v1beta1.RepeatRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getRepeatDataBodyPutMethod(), getCallOptions()), request); + } + + /** + * + * + *
        +     * This method echoes the ComplianceData request, using the HTTP PATCH method.
        +     * 
        + */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.showcase.v1beta1.RepeatResponse> + repeatDataBodyPatch(com.google.showcase.v1beta1.RepeatRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getRepeatDataBodyPatchMethod(), getCallOptions()), request); + } + + /** + * + * + *
        +     * This method requests an enum value from the server. Depending on the contents of EnumRequest, the enum value returned will be a known enum declared in the
        +     * .proto file, or a made-up enum value the is unknown to the client. To verify that clients can round-trip unknown enum values they receive, use the
        +     * response from this RPC as the request to VerifyEnum()
        +     * The values of enums sent by the server when a known or unknown value is requested will be the same within a single Showcase server run (this is needed for
        +     * VerifyEnum() to work) but are not guaranteed to be the same across separate Showcase server runs.
        +     * 
        + */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.showcase.v1beta1.EnumResponse> + getEnum(com.google.showcase.v1beta1.EnumRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getGetEnumMethod(), getCallOptions()), request); + } + + /** + * + * + *
        +     * This method is used to verify that clients can round-trip enum values, which is particularly important for unknown enum values over REST. VerifyEnum()
        +     * verifies that its request, which is presumably the response that the client previously got to a GetEnum(), contains the correct data. If so, it responds
        +     * with the same EnumResponse; otherwise, the RPC errors.
        +     * This works because the values of enums sent by the server when a known or unknown value is requested will be the same within a single Showcase server run,
        +     * although they are not guaranteed to be the same across separate Showcase server runs.
        +     * 
        + */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.showcase.v1beta1.EnumResponse> + verifyEnum(com.google.showcase.v1beta1.EnumResponse request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getVerifyEnumMethod(), getCallOptions()), request); + } + } + + private static final int METHODID_REPEAT_DATA_BODY = 0; + private static final int METHODID_REPEAT_DATA_BODY_INFO = 1; + private static final int METHODID_REPEAT_DATA_QUERY = 2; + private static final int METHODID_REPEAT_DATA_SIMPLE_PATH = 3; + private static final int METHODID_REPEAT_DATA_PATH_RESOURCE = 4; + private static final int METHODID_REPEAT_DATA_PATH_TRAILING_RESOURCE = 5; + private static final int METHODID_REPEAT_DATA_BODY_PUT = 6; + private static final int METHODID_REPEAT_DATA_BODY_PATCH = 7; + private static final int METHODID_GET_ENUM = 8; + private static final int METHODID_VERIFY_ENUM = 9; + + 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_REPEAT_DATA_BODY: + serviceImpl.repeatDataBody( + (com.google.showcase.v1beta1.RepeatRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_REPEAT_DATA_BODY_INFO: + serviceImpl.repeatDataBodyInfo( + (com.google.showcase.v1beta1.RepeatRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_REPEAT_DATA_QUERY: + serviceImpl.repeatDataQuery( + (com.google.showcase.v1beta1.RepeatRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_REPEAT_DATA_SIMPLE_PATH: + serviceImpl.repeatDataSimplePath( + (com.google.showcase.v1beta1.RepeatRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_REPEAT_DATA_PATH_RESOURCE: + serviceImpl.repeatDataPathResource( + (com.google.showcase.v1beta1.RepeatRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_REPEAT_DATA_PATH_TRAILING_RESOURCE: + serviceImpl.repeatDataPathTrailingResource( + (com.google.showcase.v1beta1.RepeatRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_REPEAT_DATA_BODY_PUT: + serviceImpl.repeatDataBodyPut( + (com.google.showcase.v1beta1.RepeatRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_REPEAT_DATA_BODY_PATCH: + serviceImpl.repeatDataBodyPatch( + (com.google.showcase.v1beta1.RepeatRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_GET_ENUM: + serviceImpl.getEnum( + (com.google.showcase.v1beta1.EnumRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_VERIFY_ENUM: + serviceImpl.verifyEnum( + (com.google.showcase.v1beta1.EnumResponse) 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( + getRepeatDataBodyMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.showcase.v1beta1.RepeatRequest, + com.google.showcase.v1beta1.RepeatResponse>( + service, METHODID_REPEAT_DATA_BODY))) + .addMethod( + getRepeatDataBodyInfoMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.showcase.v1beta1.RepeatRequest, + com.google.showcase.v1beta1.RepeatResponse>( + service, METHODID_REPEAT_DATA_BODY_INFO))) + .addMethod( + getRepeatDataQueryMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.showcase.v1beta1.RepeatRequest, + com.google.showcase.v1beta1.RepeatResponse>( + service, METHODID_REPEAT_DATA_QUERY))) + .addMethod( + getRepeatDataSimplePathMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.showcase.v1beta1.RepeatRequest, + com.google.showcase.v1beta1.RepeatResponse>( + service, METHODID_REPEAT_DATA_SIMPLE_PATH))) + .addMethod( + getRepeatDataPathResourceMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.showcase.v1beta1.RepeatRequest, + com.google.showcase.v1beta1.RepeatResponse>( + service, METHODID_REPEAT_DATA_PATH_RESOURCE))) + .addMethod( + getRepeatDataPathTrailingResourceMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.showcase.v1beta1.RepeatRequest, + com.google.showcase.v1beta1.RepeatResponse>( + service, METHODID_REPEAT_DATA_PATH_TRAILING_RESOURCE))) + .addMethod( + getRepeatDataBodyPutMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.showcase.v1beta1.RepeatRequest, + com.google.showcase.v1beta1.RepeatResponse>( + service, METHODID_REPEAT_DATA_BODY_PUT))) + .addMethod( + getRepeatDataBodyPatchMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.showcase.v1beta1.RepeatRequest, + com.google.showcase.v1beta1.RepeatResponse>( + service, METHODID_REPEAT_DATA_BODY_PATCH))) + .addMethod( + getGetEnumMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.showcase.v1beta1.EnumRequest, + com.google.showcase.v1beta1.EnumResponse>(service, METHODID_GET_ENUM))) + .addMethod( + getVerifyEnumMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.showcase.v1beta1.EnumResponse, + com.google.showcase.v1beta1.EnumResponse>(service, METHODID_VERIFY_ENUM))) + .build(); + } + + private abstract static class ComplianceBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoFileDescriptorSupplier, + io.grpc.protobuf.ProtoServiceDescriptorSupplier { + ComplianceBaseDescriptorSupplier() {} + + @java.lang.Override + public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() { + return com.google.showcase.v1beta1.ComplianceOuterClass.getDescriptor(); + } + + @java.lang.Override + public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() { + return getFileDescriptor().findServiceByName("Compliance"); + } + } + + private static final class ComplianceFileDescriptorSupplier + extends ComplianceBaseDescriptorSupplier { + ComplianceFileDescriptorSupplier() {} + } + + private static final class ComplianceMethodDescriptorSupplier + extends ComplianceBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoMethodDescriptorSupplier { + private final java.lang.String methodName; + + ComplianceMethodDescriptorSupplier(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 (ComplianceGrpc.class) { + result = serviceDescriptor; + if (result == null) { + serviceDescriptor = + result = + io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME) + .setSchemaDescriptor(new ComplianceFileDescriptorSupplier()) + .addMethod(getRepeatDataBodyMethod()) + .addMethod(getRepeatDataBodyInfoMethod()) + .addMethod(getRepeatDataQueryMethod()) + .addMethod(getRepeatDataSimplePathMethod()) + .addMethod(getRepeatDataPathResourceMethod()) + .addMethod(getRepeatDataPathTrailingResourceMethod()) + .addMethod(getRepeatDataBodyPutMethod()) + .addMethod(getRepeatDataBodyPatchMethod()) + .addMethod(getGetEnumMethod()) + .addMethod(getVerifyEnumMethod()) + .build(); + } + } + } + return result; + } +} diff --git a/java-showcase-3.25.8/grpc-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/EchoGrpc.java b/java-showcase-3.25.8/grpc-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/EchoGrpc.java new file mode 100644 index 0000000000..0d30b3d3e2 --- /dev/null +++ b/java-showcase-3.25.8/grpc-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/EchoGrpc.java @@ -0,0 +1,1770 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.showcase.v1beta1; + +import static io.grpc.MethodDescriptor.generateFullMethodName; + +/** + * + * + *
        + * This service is used showcase the four main types of rpcs - unary, server
        + * side streaming, client side streaming, and bidirectional streaming. This
        + * service also exposes methods that explicitly implement server delay, and
        + * paginated calls. Set the 'showcase-trailer' metadata key on any method
        + * to have the values echoed in the response trailers. Set the
        + * 'x-goog-request-params' metadata key on any method to have the values
        + * echoed in the response headers.
        + * 
        + */ +@io.grpc.stub.annotations.GrpcGenerated +public final class EchoGrpc { + + private EchoGrpc() {} + + public static final java.lang.String SERVICE_NAME = "google.showcase.v1beta1.Echo"; + + // Static method descriptors that strictly reflect the proto. + private static volatile io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.EchoRequest, com.google.showcase.v1beta1.EchoResponse> + getEchoMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "Echo", + requestType = com.google.showcase.v1beta1.EchoRequest.class, + responseType = com.google.showcase.v1beta1.EchoResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.EchoRequest, com.google.showcase.v1beta1.EchoResponse> + getEchoMethod() { + io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.EchoRequest, com.google.showcase.v1beta1.EchoResponse> + getEchoMethod; + if ((getEchoMethod = EchoGrpc.getEchoMethod) == null) { + synchronized (EchoGrpc.class) { + if ((getEchoMethod = EchoGrpc.getEchoMethod) == null) { + EchoGrpc.getEchoMethod = + getEchoMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "Echo")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.EchoRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.EchoResponse.getDefaultInstance())) + .setSchemaDescriptor(new EchoMethodDescriptorSupplier("Echo")) + .build(); + } + } + } + return getEchoMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.EchoErrorDetailsRequest, + com.google.showcase.v1beta1.EchoErrorDetailsResponse> + getEchoErrorDetailsMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "EchoErrorDetails", + requestType = com.google.showcase.v1beta1.EchoErrorDetailsRequest.class, + responseType = com.google.showcase.v1beta1.EchoErrorDetailsResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.EchoErrorDetailsRequest, + com.google.showcase.v1beta1.EchoErrorDetailsResponse> + getEchoErrorDetailsMethod() { + io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.EchoErrorDetailsRequest, + com.google.showcase.v1beta1.EchoErrorDetailsResponse> + getEchoErrorDetailsMethod; + if ((getEchoErrorDetailsMethod = EchoGrpc.getEchoErrorDetailsMethod) == null) { + synchronized (EchoGrpc.class) { + if ((getEchoErrorDetailsMethod = EchoGrpc.getEchoErrorDetailsMethod) == null) { + EchoGrpc.getEchoErrorDetailsMethod = + getEchoErrorDetailsMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "EchoErrorDetails")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.EchoErrorDetailsRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.EchoErrorDetailsResponse + .getDefaultInstance())) + .setSchemaDescriptor(new EchoMethodDescriptorSupplier("EchoErrorDetails")) + .build(); + } + } + } + return getEchoErrorDetailsMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.FailEchoWithDetailsRequest, + com.google.showcase.v1beta1.FailEchoWithDetailsResponse> + getFailEchoWithDetailsMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "FailEchoWithDetails", + requestType = com.google.showcase.v1beta1.FailEchoWithDetailsRequest.class, + responseType = com.google.showcase.v1beta1.FailEchoWithDetailsResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.FailEchoWithDetailsRequest, + com.google.showcase.v1beta1.FailEchoWithDetailsResponse> + getFailEchoWithDetailsMethod() { + io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.FailEchoWithDetailsRequest, + com.google.showcase.v1beta1.FailEchoWithDetailsResponse> + getFailEchoWithDetailsMethod; + if ((getFailEchoWithDetailsMethod = EchoGrpc.getFailEchoWithDetailsMethod) == null) { + synchronized (EchoGrpc.class) { + if ((getFailEchoWithDetailsMethod = EchoGrpc.getFailEchoWithDetailsMethod) == null) { + EchoGrpc.getFailEchoWithDetailsMethod = + getFailEchoWithDetailsMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName(SERVICE_NAME, "FailEchoWithDetails")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.FailEchoWithDetailsRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.FailEchoWithDetailsResponse + .getDefaultInstance())) + .setSchemaDescriptor(new EchoMethodDescriptorSupplier("FailEchoWithDetails")) + .build(); + } + } + } + return getFailEchoWithDetailsMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.ExpandRequest, com.google.showcase.v1beta1.EchoResponse> + getExpandMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "Expand", + requestType = com.google.showcase.v1beta1.ExpandRequest.class, + responseType = com.google.showcase.v1beta1.EchoResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.SERVER_STREAMING) + public static io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.ExpandRequest, com.google.showcase.v1beta1.EchoResponse> + getExpandMethod() { + io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.ExpandRequest, com.google.showcase.v1beta1.EchoResponse> + getExpandMethod; + if ((getExpandMethod = EchoGrpc.getExpandMethod) == null) { + synchronized (EchoGrpc.class) { + if ((getExpandMethod = EchoGrpc.getExpandMethod) == null) { + EchoGrpc.getExpandMethod = + getExpandMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.SERVER_STREAMING) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "Expand")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.ExpandRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.EchoResponse.getDefaultInstance())) + .setSchemaDescriptor(new EchoMethodDescriptorSupplier("Expand")) + .build(); + } + } + } + return getExpandMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.EchoRequest, com.google.showcase.v1beta1.EchoResponse> + getCollectMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "Collect", + requestType = com.google.showcase.v1beta1.EchoRequest.class, + responseType = com.google.showcase.v1beta1.EchoResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.CLIENT_STREAMING) + public static io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.EchoRequest, com.google.showcase.v1beta1.EchoResponse> + getCollectMethod() { + io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.EchoRequest, com.google.showcase.v1beta1.EchoResponse> + getCollectMethod; + if ((getCollectMethod = EchoGrpc.getCollectMethod) == null) { + synchronized (EchoGrpc.class) { + if ((getCollectMethod = EchoGrpc.getCollectMethod) == null) { + EchoGrpc.getCollectMethod = + getCollectMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.CLIENT_STREAMING) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "Collect")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.EchoRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.EchoResponse.getDefaultInstance())) + .setSchemaDescriptor(new EchoMethodDescriptorSupplier("Collect")) + .build(); + } + } + } + return getCollectMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.EchoRequest, com.google.showcase.v1beta1.EchoResponse> + getChatMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "Chat", + requestType = com.google.showcase.v1beta1.EchoRequest.class, + responseType = com.google.showcase.v1beta1.EchoResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.BIDI_STREAMING) + public static io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.EchoRequest, com.google.showcase.v1beta1.EchoResponse> + getChatMethod() { + io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.EchoRequest, com.google.showcase.v1beta1.EchoResponse> + getChatMethod; + if ((getChatMethod = EchoGrpc.getChatMethod) == null) { + synchronized (EchoGrpc.class) { + if ((getChatMethod = EchoGrpc.getChatMethod) == null) { + EchoGrpc.getChatMethod = + getChatMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.BIDI_STREAMING) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "Chat")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.EchoRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.EchoResponse.getDefaultInstance())) + .setSchemaDescriptor(new EchoMethodDescriptorSupplier("Chat")) + .build(); + } + } + } + return getChatMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.PagedExpandRequest, + com.google.showcase.v1beta1.PagedExpandResponse> + getPagedExpandMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "PagedExpand", + requestType = com.google.showcase.v1beta1.PagedExpandRequest.class, + responseType = com.google.showcase.v1beta1.PagedExpandResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.PagedExpandRequest, + com.google.showcase.v1beta1.PagedExpandResponse> + getPagedExpandMethod() { + io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.PagedExpandRequest, + com.google.showcase.v1beta1.PagedExpandResponse> + getPagedExpandMethod; + if ((getPagedExpandMethod = EchoGrpc.getPagedExpandMethod) == null) { + synchronized (EchoGrpc.class) { + if ((getPagedExpandMethod = EchoGrpc.getPagedExpandMethod) == null) { + EchoGrpc.getPagedExpandMethod = + getPagedExpandMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "PagedExpand")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.PagedExpandRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.PagedExpandResponse.getDefaultInstance())) + .setSchemaDescriptor(new EchoMethodDescriptorSupplier("PagedExpand")) + .build(); + } + } + } + return getPagedExpandMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.PagedExpandLegacyRequest, + com.google.showcase.v1beta1.PagedExpandResponse> + getPagedExpandLegacyMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "PagedExpandLegacy", + requestType = com.google.showcase.v1beta1.PagedExpandLegacyRequest.class, + responseType = com.google.showcase.v1beta1.PagedExpandResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.PagedExpandLegacyRequest, + com.google.showcase.v1beta1.PagedExpandResponse> + getPagedExpandLegacyMethod() { + io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.PagedExpandLegacyRequest, + com.google.showcase.v1beta1.PagedExpandResponse> + getPagedExpandLegacyMethod; + if ((getPagedExpandLegacyMethod = EchoGrpc.getPagedExpandLegacyMethod) == null) { + synchronized (EchoGrpc.class) { + if ((getPagedExpandLegacyMethod = EchoGrpc.getPagedExpandLegacyMethod) == null) { + EchoGrpc.getPagedExpandLegacyMethod = + getPagedExpandLegacyMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "PagedExpandLegacy")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.PagedExpandLegacyRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.PagedExpandResponse.getDefaultInstance())) + .setSchemaDescriptor(new EchoMethodDescriptorSupplier("PagedExpandLegacy")) + .build(); + } + } + } + return getPagedExpandLegacyMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.PagedExpandRequest, + com.google.showcase.v1beta1.PagedExpandLegacyMappedResponse> + getPagedExpandLegacyMappedMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "PagedExpandLegacyMapped", + requestType = com.google.showcase.v1beta1.PagedExpandRequest.class, + responseType = com.google.showcase.v1beta1.PagedExpandLegacyMappedResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.PagedExpandRequest, + com.google.showcase.v1beta1.PagedExpandLegacyMappedResponse> + getPagedExpandLegacyMappedMethod() { + io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.PagedExpandRequest, + com.google.showcase.v1beta1.PagedExpandLegacyMappedResponse> + getPagedExpandLegacyMappedMethod; + if ((getPagedExpandLegacyMappedMethod = EchoGrpc.getPagedExpandLegacyMappedMethod) == null) { + synchronized (EchoGrpc.class) { + if ((getPagedExpandLegacyMappedMethod = EchoGrpc.getPagedExpandLegacyMappedMethod) + == null) { + EchoGrpc.getPagedExpandLegacyMappedMethod = + getPagedExpandLegacyMappedMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName(SERVICE_NAME, "PagedExpandLegacyMapped")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.PagedExpandRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.PagedExpandLegacyMappedResponse + .getDefaultInstance())) + .setSchemaDescriptor( + new EchoMethodDescriptorSupplier("PagedExpandLegacyMapped")) + .build(); + } + } + } + return getPagedExpandLegacyMappedMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.WaitRequest, com.google.longrunning.Operation> + getWaitMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "Wait", + requestType = com.google.showcase.v1beta1.WaitRequest.class, + responseType = com.google.longrunning.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.WaitRequest, com.google.longrunning.Operation> + getWaitMethod() { + io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.WaitRequest, com.google.longrunning.Operation> + getWaitMethod; + if ((getWaitMethod = EchoGrpc.getWaitMethod) == null) { + synchronized (EchoGrpc.class) { + if ((getWaitMethod = EchoGrpc.getWaitMethod) == null) { + EchoGrpc.getWaitMethod = + getWaitMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "Wait")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.WaitRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor(new EchoMethodDescriptorSupplier("Wait")) + .build(); + } + } + } + return getWaitMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.BlockRequest, com.google.showcase.v1beta1.BlockResponse> + getBlockMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "Block", + requestType = com.google.showcase.v1beta1.BlockRequest.class, + responseType = com.google.showcase.v1beta1.BlockResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.BlockRequest, com.google.showcase.v1beta1.BlockResponse> + getBlockMethod() { + io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.BlockRequest, com.google.showcase.v1beta1.BlockResponse> + getBlockMethod; + if ((getBlockMethod = EchoGrpc.getBlockMethod) == null) { + synchronized (EchoGrpc.class) { + if ((getBlockMethod = EchoGrpc.getBlockMethod) == null) { + EchoGrpc.getBlockMethod = + getBlockMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "Block")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.BlockRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.BlockResponse.getDefaultInstance())) + .setSchemaDescriptor(new EchoMethodDescriptorSupplier("Block")) + .build(); + } + } + } + return getBlockMethod; + } + + /** Creates a new async stub that supports all call types for the service */ + public static EchoStub newStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public EchoStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new EchoStub(channel, callOptions); + } + }; + return EchoStub.newStub(factory, channel); + } + + /** Creates a new blocking-style stub that supports all types of calls on the service */ + public static EchoBlockingV2Stub newBlockingV2Stub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public EchoBlockingV2Stub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new EchoBlockingV2Stub(channel, callOptions); + } + }; + return EchoBlockingV2Stub.newStub(factory, channel); + } + + /** + * Creates a new blocking-style stub that supports unary and streaming output calls on the service + */ + public static EchoBlockingStub newBlockingStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public EchoBlockingStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new EchoBlockingStub(channel, callOptions); + } + }; + return EchoBlockingStub.newStub(factory, channel); + } + + /** Creates a new ListenableFuture-style stub that supports unary calls on the service */ + public static EchoFutureStub newFutureStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public EchoFutureStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new EchoFutureStub(channel, callOptions); + } + }; + return EchoFutureStub.newStub(factory, channel); + } + + /** + * + * + *
        +   * This service is used showcase the four main types of rpcs - unary, server
        +   * side streaming, client side streaming, and bidirectional streaming. This
        +   * service also exposes methods that explicitly implement server delay, and
        +   * paginated calls. Set the 'showcase-trailer' metadata key on any method
        +   * to have the values echoed in the response trailers. Set the
        +   * 'x-goog-request-params' metadata key on any method to have the values
        +   * echoed in the response headers.
        +   * 
        + */ + public interface AsyncService { + + /** + * + * + *
        +     * This method simply echoes the request. This method showcases unary RPCs.
        +     * 
        + */ + default void echo( + com.google.showcase.v1beta1.EchoRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getEchoMethod(), responseObserver); + } + + /** + * + * + *
        +     * This method returns error details in a repeated "google.protobuf.Any"
        +     * field. This method showcases handling errors thus encoded, particularly
        +     * over REST transport. Note that GAPICs only allow the type
        +     * "google.protobuf.Any" for field paths ending in "error.details", and, at
        +     * run-time, the actual types for these fields must be one of the types in
        +     * google/rpc/error_details.proto.
        +     * 
        + */ + default void echoErrorDetails( + com.google.showcase.v1beta1.EchoErrorDetailsRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getEchoErrorDetailsMethod(), responseObserver); + } + + /** + * + * + *
        +     * This method always fails with a gRPC "Aborted" error status that contains
        +     * multiple error details.  These include one instance of each of the standard
        +     * ones in error_details.proto
        +     * (https://github.com/googleapis/googleapis/blob/master/google/rpc/error_details.proto)
        +     * plus a custom, Showcase-defined PoetryError. The intent of this RPC is to
        +     * verify that GAPICs can process these various error details and surface them
        +     * to the user in an idiomatic form.
        +     * 
        + */ + default void failEchoWithDetails( + com.google.showcase.v1beta1.FailEchoWithDetailsRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getFailEchoWithDetailsMethod(), responseObserver); + } + + /** + * + * + *
        +     * This method splits the given content into words and will pass each word back
        +     * through the stream. This method showcases server-side streaming RPCs.
        +     * 
        + */ + default void expand( + com.google.showcase.v1beta1.ExpandRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getExpandMethod(), responseObserver); + } + + /** + * + * + *
        +     * This method will collect the words given to it. When the stream is closed
        +     * by the client, this method will return the a concatenation of the strings
        +     * passed to it. This method showcases client-side streaming RPCs.
        +     * 
        + */ + default io.grpc.stub.StreamObserver collect( + io.grpc.stub.StreamObserver responseObserver) { + return io.grpc.stub.ServerCalls.asyncUnimplementedStreamingCall( + getCollectMethod(), responseObserver); + } + + /** + * + * + *
        +     * This method, upon receiving a request on the stream, will pass the same
        +     * content back on the stream. This method showcases bidirectional
        +     * streaming RPCs.
        +     * 
        + */ + default io.grpc.stub.StreamObserver chat( + io.grpc.stub.StreamObserver responseObserver) { + return io.grpc.stub.ServerCalls.asyncUnimplementedStreamingCall( + getChatMethod(), responseObserver); + } + + /** + * + * + *
        +     * This is similar to the Expand method but instead of returning a stream of
        +     * expanded words, this method returns a paged list of expanded words.
        +     * 
        + */ + default void pagedExpand( + com.google.showcase.v1beta1.PagedExpandRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getPagedExpandMethod(), responseObserver); + } + + /** + * + * + *
        +     * This is similar to the PagedExpand except that it uses
        +     * max_results instead of page_size, as some legacy APIs still
        +     * do. New APIs should NOT use this pattern.
        +     * 
        + */ + default void pagedExpandLegacy( + com.google.showcase.v1beta1.PagedExpandLegacyRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getPagedExpandLegacyMethod(), responseObserver); + } + + /** + * + * + *
        +     * This method returns a map containing lists of words that appear in the input, keyed by their
        +     * initial character. The only words returned are the ones included in the current page,
        +     * as determined by page_token and page_size, which both refer to the word indices in the
        +     * input. This paging result consisting of a map of lists is a pattern used by some legacy
        +     * APIs. New APIs should NOT use this pattern.
        +     * 
        + */ + default void pagedExpandLegacyMapped( + com.google.showcase.v1beta1.PagedExpandRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getPagedExpandLegacyMappedMethod(), responseObserver); + } + + /** + * + * + *
        +     * This method will wait for the requested amount of time and then return.
        +     * This method showcases how a client handles a request timeout.
        +     * 
        + */ + default void wait( + com.google.showcase.v1beta1.WaitRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getWaitMethod(), responseObserver); + } + + /** + * + * + *
        +     * This method will block (wait) for the requested amount of time
        +     * and then return the response or error.
        +     * This method showcases how a client handles delays or retries.
        +     * 
        + */ + default void block( + com.google.showcase.v1beta1.BlockRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getBlockMethod(), responseObserver); + } + } + + /** + * Base class for the server implementation of the service Echo. + * + *
        +   * This service is used showcase the four main types of rpcs - unary, server
        +   * side streaming, client side streaming, and bidirectional streaming. This
        +   * service also exposes methods that explicitly implement server delay, and
        +   * paginated calls. Set the 'showcase-trailer' metadata key on any method
        +   * to have the values echoed in the response trailers. Set the
        +   * 'x-goog-request-params' metadata key on any method to have the values
        +   * echoed in the response headers.
        +   * 
        + */ + public abstract static class EchoImplBase implements io.grpc.BindableService, AsyncService { + + @java.lang.Override + public final io.grpc.ServerServiceDefinition bindService() { + return EchoGrpc.bindService(this); + } + } + + /** + * A stub to allow clients to do asynchronous rpc calls to service Echo. + * + *
        +   * This service is used showcase the four main types of rpcs - unary, server
        +   * side streaming, client side streaming, and bidirectional streaming. This
        +   * service also exposes methods that explicitly implement server delay, and
        +   * paginated calls. Set the 'showcase-trailer' metadata key on any method
        +   * to have the values echoed in the response trailers. Set the
        +   * 'x-goog-request-params' metadata key on any method to have the values
        +   * echoed in the response headers.
        +   * 
        + */ + public static final class EchoStub extends io.grpc.stub.AbstractAsyncStub { + private EchoStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected EchoStub build(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new EchoStub(channel, callOptions); + } + + /** + * + * + *
        +     * This method simply echoes the request. This method showcases unary RPCs.
        +     * 
        + */ + public void echo( + com.google.showcase.v1beta1.EchoRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getEchoMethod(), getCallOptions()), request, responseObserver); + } + + /** + * + * + *
        +     * This method returns error details in a repeated "google.protobuf.Any"
        +     * field. This method showcases handling errors thus encoded, particularly
        +     * over REST transport. Note that GAPICs only allow the type
        +     * "google.protobuf.Any" for field paths ending in "error.details", and, at
        +     * run-time, the actual types for these fields must be one of the types in
        +     * google/rpc/error_details.proto.
        +     * 
        + */ + public void echoErrorDetails( + com.google.showcase.v1beta1.EchoErrorDetailsRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getEchoErrorDetailsMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
        +     * This method always fails with a gRPC "Aborted" error status that contains
        +     * multiple error details.  These include one instance of each of the standard
        +     * ones in error_details.proto
        +     * (https://github.com/googleapis/googleapis/blob/master/google/rpc/error_details.proto)
        +     * plus a custom, Showcase-defined PoetryError. The intent of this RPC is to
        +     * verify that GAPICs can process these various error details and surface them
        +     * to the user in an idiomatic form.
        +     * 
        + */ + public void failEchoWithDetails( + com.google.showcase.v1beta1.FailEchoWithDetailsRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getFailEchoWithDetailsMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
        +     * This method splits the given content into words and will pass each word back
        +     * through the stream. This method showcases server-side streaming RPCs.
        +     * 
        + */ + public void expand( + com.google.showcase.v1beta1.ExpandRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncServerStreamingCall( + getChannel().newCall(getExpandMethod(), getCallOptions()), request, responseObserver); + } + + /** + * + * + *
        +     * This method will collect the words given to it. When the stream is closed
        +     * by the client, this method will return the a concatenation of the strings
        +     * passed to it. This method showcases client-side streaming RPCs.
        +     * 
        + */ + public io.grpc.stub.StreamObserver collect( + io.grpc.stub.StreamObserver responseObserver) { + return io.grpc.stub.ClientCalls.asyncClientStreamingCall( + getChannel().newCall(getCollectMethod(), getCallOptions()), responseObserver); + } + + /** + * + * + *
        +     * This method, upon receiving a request on the stream, will pass the same
        +     * content back on the stream. This method showcases bidirectional
        +     * streaming RPCs.
        +     * 
        + */ + public io.grpc.stub.StreamObserver chat( + io.grpc.stub.StreamObserver responseObserver) { + return io.grpc.stub.ClientCalls.asyncBidiStreamingCall( + getChannel().newCall(getChatMethod(), getCallOptions()), responseObserver); + } + + /** + * + * + *
        +     * This is similar to the Expand method but instead of returning a stream of
        +     * expanded words, this method returns a paged list of expanded words.
        +     * 
        + */ + public void pagedExpand( + com.google.showcase.v1beta1.PagedExpandRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getPagedExpandMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
        +     * This is similar to the PagedExpand except that it uses
        +     * max_results instead of page_size, as some legacy APIs still
        +     * do. New APIs should NOT use this pattern.
        +     * 
        + */ + public void pagedExpandLegacy( + com.google.showcase.v1beta1.PagedExpandLegacyRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getPagedExpandLegacyMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
        +     * This method returns a map containing lists of words that appear in the input, keyed by their
        +     * initial character. The only words returned are the ones included in the current page,
        +     * as determined by page_token and page_size, which both refer to the word indices in the
        +     * input. This paging result consisting of a map of lists is a pattern used by some legacy
        +     * APIs. New APIs should NOT use this pattern.
        +     * 
        + */ + public void pagedExpandLegacyMapped( + com.google.showcase.v1beta1.PagedExpandRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getPagedExpandLegacyMappedMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
        +     * This method will wait for the requested amount of time and then return.
        +     * This method showcases how a client handles a request timeout.
        +     * 
        + */ + public void wait( + com.google.showcase.v1beta1.WaitRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getWaitMethod(), getCallOptions()), request, responseObserver); + } + + /** + * + * + *
        +     * This method will block (wait) for the requested amount of time
        +     * and then return the response or error.
        +     * This method showcases how a client handles delays or retries.
        +     * 
        + */ + public void block( + com.google.showcase.v1beta1.BlockRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getBlockMethod(), getCallOptions()), request, responseObserver); + } + } + + /** + * A stub to allow clients to do synchronous rpc calls to service Echo. + * + *
        +   * This service is used showcase the four main types of rpcs - unary, server
        +   * side streaming, client side streaming, and bidirectional streaming. This
        +   * service also exposes methods that explicitly implement server delay, and
        +   * paginated calls. Set the 'showcase-trailer' metadata key on any method
        +   * to have the values echoed in the response trailers. Set the
        +   * 'x-goog-request-params' metadata key on any method to have the values
        +   * echoed in the response headers.
        +   * 
        + */ + public static final class EchoBlockingV2Stub + extends io.grpc.stub.AbstractBlockingStub { + private EchoBlockingV2Stub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected EchoBlockingV2Stub build(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new EchoBlockingV2Stub(channel, callOptions); + } + + /** + * + * + *
        +     * This method simply echoes the request. This method showcases unary RPCs.
        +     * 
        + */ + public com.google.showcase.v1beta1.EchoResponse echo( + com.google.showcase.v1beta1.EchoRequest request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getEchoMethod(), getCallOptions(), request); + } + + /** + * + * + *
        +     * This method returns error details in a repeated "google.protobuf.Any"
        +     * field. This method showcases handling errors thus encoded, particularly
        +     * over REST transport. Note that GAPICs only allow the type
        +     * "google.protobuf.Any" for field paths ending in "error.details", and, at
        +     * run-time, the actual types for these fields must be one of the types in
        +     * google/rpc/error_details.proto.
        +     * 
        + */ + public com.google.showcase.v1beta1.EchoErrorDetailsResponse echoErrorDetails( + com.google.showcase.v1beta1.EchoErrorDetailsRequest request) + throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getEchoErrorDetailsMethod(), getCallOptions(), request); + } + + /** + * + * + *
        +     * This method always fails with a gRPC "Aborted" error status that contains
        +     * multiple error details.  These include one instance of each of the standard
        +     * ones in error_details.proto
        +     * (https://github.com/googleapis/googleapis/blob/master/google/rpc/error_details.proto)
        +     * plus a custom, Showcase-defined PoetryError. The intent of this RPC is to
        +     * verify that GAPICs can process these various error details and surface them
        +     * to the user in an idiomatic form.
        +     * 
        + */ + public com.google.showcase.v1beta1.FailEchoWithDetailsResponse failEchoWithDetails( + com.google.showcase.v1beta1.FailEchoWithDetailsRequest request) + throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getFailEchoWithDetailsMethod(), getCallOptions(), request); + } + + /** + * + * + *
        +     * This method splits the given content into words and will pass each word back
        +     * through the stream. This method showcases server-side streaming RPCs.
        +     * 
        + */ + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/10918") + public io.grpc.stub.BlockingClientCall expand( + com.google.showcase.v1beta1.ExpandRequest request) { + return io.grpc.stub.ClientCalls.blockingV2ServerStreamingCall( + getChannel(), getExpandMethod(), getCallOptions(), request); + } + + /** + * + * + *
        +     * This method will collect the words given to it. When the stream is closed
        +     * by the client, this method will return the a concatenation of the strings
        +     * passed to it. This method showcases client-side streaming RPCs.
        +     * 
        + */ + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/10918") + public io.grpc.stub.BlockingClientCall< + com.google.showcase.v1beta1.EchoRequest, com.google.showcase.v1beta1.EchoResponse> + collect() { + return io.grpc.stub.ClientCalls.blockingClientStreamingCall( + getChannel(), getCollectMethod(), getCallOptions()); + } + + /** + * + * + *
        +     * This method, upon receiving a request on the stream, will pass the same
        +     * content back on the stream. This method showcases bidirectional
        +     * streaming RPCs.
        +     * 
        + */ + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/10918") + public io.grpc.stub.BlockingClientCall< + com.google.showcase.v1beta1.EchoRequest, com.google.showcase.v1beta1.EchoResponse> + chat() { + return io.grpc.stub.ClientCalls.blockingBidiStreamingCall( + getChannel(), getChatMethod(), getCallOptions()); + } + + /** + * + * + *
        +     * This is similar to the Expand method but instead of returning a stream of
        +     * expanded words, this method returns a paged list of expanded words.
        +     * 
        + */ + public com.google.showcase.v1beta1.PagedExpandResponse pagedExpand( + com.google.showcase.v1beta1.PagedExpandRequest request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getPagedExpandMethod(), getCallOptions(), request); + } + + /** + * + * + *
        +     * This is similar to the PagedExpand except that it uses
        +     * max_results instead of page_size, as some legacy APIs still
        +     * do. New APIs should NOT use this pattern.
        +     * 
        + */ + public com.google.showcase.v1beta1.PagedExpandResponse pagedExpandLegacy( + com.google.showcase.v1beta1.PagedExpandLegacyRequest request) + throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getPagedExpandLegacyMethod(), getCallOptions(), request); + } + + /** + * + * + *
        +     * This method returns a map containing lists of words that appear in the input, keyed by their
        +     * initial character. The only words returned are the ones included in the current page,
        +     * as determined by page_token and page_size, which both refer to the word indices in the
        +     * input. This paging result consisting of a map of lists is a pattern used by some legacy
        +     * APIs. New APIs should NOT use this pattern.
        +     * 
        + */ + public com.google.showcase.v1beta1.PagedExpandLegacyMappedResponse pagedExpandLegacyMapped( + com.google.showcase.v1beta1.PagedExpandRequest request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getPagedExpandLegacyMappedMethod(), getCallOptions(), request); + } + + /** + * + * + *
        +     * This method will wait for the requested amount of time and then return.
        +     * This method showcases how a client handles a request timeout.
        +     * 
        + */ + public com.google.longrunning.Operation wait(com.google.showcase.v1beta1.WaitRequest request) + throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getWaitMethod(), getCallOptions(), request); + } + + /** + * + * + *
        +     * This method will block (wait) for the requested amount of time
        +     * and then return the response or error.
        +     * This method showcases how a client handles delays or retries.
        +     * 
        + */ + public com.google.showcase.v1beta1.BlockResponse block( + com.google.showcase.v1beta1.BlockRequest request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getBlockMethod(), getCallOptions(), request); + } + } + + /** + * A stub to allow clients to do limited synchronous rpc calls to service Echo. + * + *
        +   * This service is used showcase the four main types of rpcs - unary, server
        +   * side streaming, client side streaming, and bidirectional streaming. This
        +   * service also exposes methods that explicitly implement server delay, and
        +   * paginated calls. Set the 'showcase-trailer' metadata key on any method
        +   * to have the values echoed in the response trailers. Set the
        +   * 'x-goog-request-params' metadata key on any method to have the values
        +   * echoed in the response headers.
        +   * 
        + */ + public static final class EchoBlockingStub + extends io.grpc.stub.AbstractBlockingStub { + private EchoBlockingStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected EchoBlockingStub build(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new EchoBlockingStub(channel, callOptions); + } + + /** + * + * + *
        +     * This method simply echoes the request. This method showcases unary RPCs.
        +     * 
        + */ + public com.google.showcase.v1beta1.EchoResponse echo( + com.google.showcase.v1beta1.EchoRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getEchoMethod(), getCallOptions(), request); + } + + /** + * + * + *
        +     * This method returns error details in a repeated "google.protobuf.Any"
        +     * field. This method showcases handling errors thus encoded, particularly
        +     * over REST transport. Note that GAPICs only allow the type
        +     * "google.protobuf.Any" for field paths ending in "error.details", and, at
        +     * run-time, the actual types for these fields must be one of the types in
        +     * google/rpc/error_details.proto.
        +     * 
        + */ + public com.google.showcase.v1beta1.EchoErrorDetailsResponse echoErrorDetails( + com.google.showcase.v1beta1.EchoErrorDetailsRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getEchoErrorDetailsMethod(), getCallOptions(), request); + } + + /** + * + * + *
        +     * This method always fails with a gRPC "Aborted" error status that contains
        +     * multiple error details.  These include one instance of each of the standard
        +     * ones in error_details.proto
        +     * (https://github.com/googleapis/googleapis/blob/master/google/rpc/error_details.proto)
        +     * plus a custom, Showcase-defined PoetryError. The intent of this RPC is to
        +     * verify that GAPICs can process these various error details and surface them
        +     * to the user in an idiomatic form.
        +     * 
        + */ + public com.google.showcase.v1beta1.FailEchoWithDetailsResponse failEchoWithDetails( + com.google.showcase.v1beta1.FailEchoWithDetailsRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getFailEchoWithDetailsMethod(), getCallOptions(), request); + } + + /** + * + * + *
        +     * This method splits the given content into words and will pass each word back
        +     * through the stream. This method showcases server-side streaming RPCs.
        +     * 
        + */ + public java.util.Iterator expand( + com.google.showcase.v1beta1.ExpandRequest request) { + return io.grpc.stub.ClientCalls.blockingServerStreamingCall( + getChannel(), getExpandMethod(), getCallOptions(), request); + } + + /** + * + * + *
        +     * This is similar to the Expand method but instead of returning a stream of
        +     * expanded words, this method returns a paged list of expanded words.
        +     * 
        + */ + public com.google.showcase.v1beta1.PagedExpandResponse pagedExpand( + com.google.showcase.v1beta1.PagedExpandRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getPagedExpandMethod(), getCallOptions(), request); + } + + /** + * + * + *
        +     * This is similar to the PagedExpand except that it uses
        +     * max_results instead of page_size, as some legacy APIs still
        +     * do. New APIs should NOT use this pattern.
        +     * 
        + */ + public com.google.showcase.v1beta1.PagedExpandResponse pagedExpandLegacy( + com.google.showcase.v1beta1.PagedExpandLegacyRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getPagedExpandLegacyMethod(), getCallOptions(), request); + } + + /** + * + * + *
        +     * This method returns a map containing lists of words that appear in the input, keyed by their
        +     * initial character. The only words returned are the ones included in the current page,
        +     * as determined by page_token and page_size, which both refer to the word indices in the
        +     * input. This paging result consisting of a map of lists is a pattern used by some legacy
        +     * APIs. New APIs should NOT use this pattern.
        +     * 
        + */ + public com.google.showcase.v1beta1.PagedExpandLegacyMappedResponse pagedExpandLegacyMapped( + com.google.showcase.v1beta1.PagedExpandRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getPagedExpandLegacyMappedMethod(), getCallOptions(), request); + } + + /** + * + * + *
        +     * This method will wait for the requested amount of time and then return.
        +     * This method showcases how a client handles a request timeout.
        +     * 
        + */ + public com.google.longrunning.Operation wait(com.google.showcase.v1beta1.WaitRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getWaitMethod(), getCallOptions(), request); + } + + /** + * + * + *
        +     * This method will block (wait) for the requested amount of time
        +     * and then return the response or error.
        +     * This method showcases how a client handles delays or retries.
        +     * 
        + */ + public com.google.showcase.v1beta1.BlockResponse block( + com.google.showcase.v1beta1.BlockRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getBlockMethod(), getCallOptions(), request); + } + } + + /** + * A stub to allow clients to do ListenableFuture-style rpc calls to service Echo. + * + *
        +   * This service is used showcase the four main types of rpcs - unary, server
        +   * side streaming, client side streaming, and bidirectional streaming. This
        +   * service also exposes methods that explicitly implement server delay, and
        +   * paginated calls. Set the 'showcase-trailer' metadata key on any method
        +   * to have the values echoed in the response trailers. Set the
        +   * 'x-goog-request-params' metadata key on any method to have the values
        +   * echoed in the response headers.
        +   * 
        + */ + public static final class EchoFutureStub extends io.grpc.stub.AbstractFutureStub { + private EchoFutureStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected EchoFutureStub build(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new EchoFutureStub(channel, callOptions); + } + + /** + * + * + *
        +     * This method simply echoes the request. This method showcases unary RPCs.
        +     * 
        + */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.showcase.v1beta1.EchoResponse> + echo(com.google.showcase.v1beta1.EchoRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getEchoMethod(), getCallOptions()), request); + } + + /** + * + * + *
        +     * This method returns error details in a repeated "google.protobuf.Any"
        +     * field. This method showcases handling errors thus encoded, particularly
        +     * over REST transport. Note that GAPICs only allow the type
        +     * "google.protobuf.Any" for field paths ending in "error.details", and, at
        +     * run-time, the actual types for these fields must be one of the types in
        +     * google/rpc/error_details.proto.
        +     * 
        + */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.showcase.v1beta1.EchoErrorDetailsResponse> + echoErrorDetails(com.google.showcase.v1beta1.EchoErrorDetailsRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getEchoErrorDetailsMethod(), getCallOptions()), request); + } + + /** + * + * + *
        +     * This method always fails with a gRPC "Aborted" error status that contains
        +     * multiple error details.  These include one instance of each of the standard
        +     * ones in error_details.proto
        +     * (https://github.com/googleapis/googleapis/blob/master/google/rpc/error_details.proto)
        +     * plus a custom, Showcase-defined PoetryError. The intent of this RPC is to
        +     * verify that GAPICs can process these various error details and surface them
        +     * to the user in an idiomatic form.
        +     * 
        + */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.showcase.v1beta1.FailEchoWithDetailsResponse> + failEchoWithDetails(com.google.showcase.v1beta1.FailEchoWithDetailsRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getFailEchoWithDetailsMethod(), getCallOptions()), request); + } + + /** + * + * + *
        +     * This is similar to the Expand method but instead of returning a stream of
        +     * expanded words, this method returns a paged list of expanded words.
        +     * 
        + */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.showcase.v1beta1.PagedExpandResponse> + pagedExpand(com.google.showcase.v1beta1.PagedExpandRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getPagedExpandMethod(), getCallOptions()), request); + } + + /** + * + * + *
        +     * This is similar to the PagedExpand except that it uses
        +     * max_results instead of page_size, as some legacy APIs still
        +     * do. New APIs should NOT use this pattern.
        +     * 
        + */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.showcase.v1beta1.PagedExpandResponse> + pagedExpandLegacy(com.google.showcase.v1beta1.PagedExpandLegacyRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getPagedExpandLegacyMethod(), getCallOptions()), request); + } + + /** + * + * + *
        +     * This method returns a map containing lists of words that appear in the input, keyed by their
        +     * initial character. The only words returned are the ones included in the current page,
        +     * as determined by page_token and page_size, which both refer to the word indices in the
        +     * input. This paging result consisting of a map of lists is a pattern used by some legacy
        +     * APIs. New APIs should NOT use this pattern.
        +     * 
        + */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.showcase.v1beta1.PagedExpandLegacyMappedResponse> + pagedExpandLegacyMapped(com.google.showcase.v1beta1.PagedExpandRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getPagedExpandLegacyMappedMethod(), getCallOptions()), request); + } + + /** + * + * + *
        +     * This method will wait for the requested amount of time and then return.
        +     * This method showcases how a client handles a request timeout.
        +     * 
        + */ + public com.google.common.util.concurrent.ListenableFuture + wait(com.google.showcase.v1beta1.WaitRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getWaitMethod(), getCallOptions()), request); + } + + /** + * + * + *
        +     * This method will block (wait) for the requested amount of time
        +     * and then return the response or error.
        +     * This method showcases how a client handles delays or retries.
        +     * 
        + */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.showcase.v1beta1.BlockResponse> + block(com.google.showcase.v1beta1.BlockRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getBlockMethod(), getCallOptions()), request); + } + } + + private static final int METHODID_ECHO = 0; + private static final int METHODID_ECHO_ERROR_DETAILS = 1; + private static final int METHODID_FAIL_ECHO_WITH_DETAILS = 2; + private static final int METHODID_EXPAND = 3; + private static final int METHODID_PAGED_EXPAND = 4; + private static final int METHODID_PAGED_EXPAND_LEGACY = 5; + private static final int METHODID_PAGED_EXPAND_LEGACY_MAPPED = 6; + private static final int METHODID_WAIT = 7; + private static final int METHODID_BLOCK = 8; + private static final int METHODID_COLLECT = 9; + private static final int METHODID_CHAT = 10; + + 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_ECHO: + serviceImpl.echo( + (com.google.showcase.v1beta1.EchoRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_ECHO_ERROR_DETAILS: + serviceImpl.echoErrorDetails( + (com.google.showcase.v1beta1.EchoErrorDetailsRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_FAIL_ECHO_WITH_DETAILS: + serviceImpl.failEchoWithDetails( + (com.google.showcase.v1beta1.FailEchoWithDetailsRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_EXPAND: + serviceImpl.expand( + (com.google.showcase.v1beta1.ExpandRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_PAGED_EXPAND: + serviceImpl.pagedExpand( + (com.google.showcase.v1beta1.PagedExpandRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_PAGED_EXPAND_LEGACY: + serviceImpl.pagedExpandLegacy( + (com.google.showcase.v1beta1.PagedExpandLegacyRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_PAGED_EXPAND_LEGACY_MAPPED: + serviceImpl.pagedExpandLegacyMapped( + (com.google.showcase.v1beta1.PagedExpandRequest) request, + (io.grpc.stub.StreamObserver< + com.google.showcase.v1beta1.PagedExpandLegacyMappedResponse>) + responseObserver); + break; + case METHODID_WAIT: + serviceImpl.wait( + (com.google.showcase.v1beta1.WaitRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_BLOCK: + serviceImpl.block( + (com.google.showcase.v1beta1.BlockRequest) 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_COLLECT: + return (io.grpc.stub.StreamObserver) + serviceImpl.collect( + (io.grpc.stub.StreamObserver) + responseObserver); + case METHODID_CHAT: + return (io.grpc.stub.StreamObserver) + serviceImpl.chat( + (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( + getEchoMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.showcase.v1beta1.EchoRequest, + com.google.showcase.v1beta1.EchoResponse>(service, METHODID_ECHO))) + .addMethod( + getEchoErrorDetailsMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.showcase.v1beta1.EchoErrorDetailsRequest, + com.google.showcase.v1beta1.EchoErrorDetailsResponse>( + service, METHODID_ECHO_ERROR_DETAILS))) + .addMethod( + getFailEchoWithDetailsMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.showcase.v1beta1.FailEchoWithDetailsRequest, + com.google.showcase.v1beta1.FailEchoWithDetailsResponse>( + service, METHODID_FAIL_ECHO_WITH_DETAILS))) + .addMethod( + getExpandMethod(), + io.grpc.stub.ServerCalls.asyncServerStreamingCall( + new MethodHandlers< + com.google.showcase.v1beta1.ExpandRequest, + com.google.showcase.v1beta1.EchoResponse>(service, METHODID_EXPAND))) + .addMethod( + getCollectMethod(), + io.grpc.stub.ServerCalls.asyncClientStreamingCall( + new MethodHandlers< + com.google.showcase.v1beta1.EchoRequest, + com.google.showcase.v1beta1.EchoResponse>(service, METHODID_COLLECT))) + .addMethod( + getChatMethod(), + io.grpc.stub.ServerCalls.asyncBidiStreamingCall( + new MethodHandlers< + com.google.showcase.v1beta1.EchoRequest, + com.google.showcase.v1beta1.EchoResponse>(service, METHODID_CHAT))) + .addMethod( + getPagedExpandMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.showcase.v1beta1.PagedExpandRequest, + com.google.showcase.v1beta1.PagedExpandResponse>( + service, METHODID_PAGED_EXPAND))) + .addMethod( + getPagedExpandLegacyMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.showcase.v1beta1.PagedExpandLegacyRequest, + com.google.showcase.v1beta1.PagedExpandResponse>( + service, METHODID_PAGED_EXPAND_LEGACY))) + .addMethod( + getPagedExpandLegacyMappedMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.showcase.v1beta1.PagedExpandRequest, + com.google.showcase.v1beta1.PagedExpandLegacyMappedResponse>( + service, METHODID_PAGED_EXPAND_LEGACY_MAPPED))) + .addMethod( + getWaitMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.showcase.v1beta1.WaitRequest, com.google.longrunning.Operation>( + service, METHODID_WAIT))) + .addMethod( + getBlockMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.showcase.v1beta1.BlockRequest, + com.google.showcase.v1beta1.BlockResponse>(service, METHODID_BLOCK))) + .build(); + } + + private abstract static class EchoBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoFileDescriptorSupplier, + io.grpc.protobuf.ProtoServiceDescriptorSupplier { + EchoBaseDescriptorSupplier() {} + + @java.lang.Override + public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() { + return com.google.showcase.v1beta1.EchoOuterClass.getDescriptor(); + } + + @java.lang.Override + public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() { + return getFileDescriptor().findServiceByName("Echo"); + } + } + + private static final class EchoFileDescriptorSupplier extends EchoBaseDescriptorSupplier { + EchoFileDescriptorSupplier() {} + } + + private static final class EchoMethodDescriptorSupplier extends EchoBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoMethodDescriptorSupplier { + private final java.lang.String methodName; + + EchoMethodDescriptorSupplier(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 (EchoGrpc.class) { + result = serviceDescriptor; + if (result == null) { + serviceDescriptor = + result = + io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME) + .setSchemaDescriptor(new EchoFileDescriptorSupplier()) + .addMethod(getEchoMethod()) + .addMethod(getEchoErrorDetailsMethod()) + .addMethod(getFailEchoWithDetailsMethod()) + .addMethod(getExpandMethod()) + .addMethod(getCollectMethod()) + .addMethod(getChatMethod()) + .addMethod(getPagedExpandMethod()) + .addMethod(getPagedExpandLegacyMethod()) + .addMethod(getPagedExpandLegacyMappedMethod()) + .addMethod(getWaitMethod()) + .addMethod(getBlockMethod()) + .build(); + } + } + } + return result; + } +} diff --git a/java-showcase-3.25.8/grpc-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/IdentityGrpc.java b/java-showcase-3.25.8/grpc-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/IdentityGrpc.java new file mode 100644 index 0000000000..bc0f6987e3 --- /dev/null +++ b/java-showcase-3.25.8/grpc-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/IdentityGrpc.java @@ -0,0 +1,886 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.showcase.v1beta1; + +import static io.grpc.MethodDescriptor.generateFullMethodName; + +/** + * + * + *
        + * A simple identity service.
        + * 
        + */ +@io.grpc.stub.annotations.GrpcGenerated +public final class IdentityGrpc { + + private IdentityGrpc() {} + + public static final java.lang.String SERVICE_NAME = "google.showcase.v1beta1.Identity"; + + // Static method descriptors that strictly reflect the proto. + private static volatile io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.CreateUserRequest, com.google.showcase.v1beta1.User> + getCreateUserMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "CreateUser", + requestType = com.google.showcase.v1beta1.CreateUserRequest.class, + responseType = com.google.showcase.v1beta1.User.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.CreateUserRequest, com.google.showcase.v1beta1.User> + getCreateUserMethod() { + io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.CreateUserRequest, com.google.showcase.v1beta1.User> + getCreateUserMethod; + if ((getCreateUserMethod = IdentityGrpc.getCreateUserMethod) == null) { + synchronized (IdentityGrpc.class) { + if ((getCreateUserMethod = IdentityGrpc.getCreateUserMethod) == null) { + IdentityGrpc.getCreateUserMethod = + getCreateUserMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "CreateUser")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.CreateUserRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.User.getDefaultInstance())) + .setSchemaDescriptor(new IdentityMethodDescriptorSupplier("CreateUser")) + .build(); + } + } + } + return getCreateUserMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.GetUserRequest, com.google.showcase.v1beta1.User> + getGetUserMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "GetUser", + requestType = com.google.showcase.v1beta1.GetUserRequest.class, + responseType = com.google.showcase.v1beta1.User.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.GetUserRequest, com.google.showcase.v1beta1.User> + getGetUserMethod() { + io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.GetUserRequest, com.google.showcase.v1beta1.User> + getGetUserMethod; + if ((getGetUserMethod = IdentityGrpc.getGetUserMethod) == null) { + synchronized (IdentityGrpc.class) { + if ((getGetUserMethod = IdentityGrpc.getGetUserMethod) == null) { + IdentityGrpc.getGetUserMethod = + getGetUserMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetUser")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.GetUserRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.User.getDefaultInstance())) + .setSchemaDescriptor(new IdentityMethodDescriptorSupplier("GetUser")) + .build(); + } + } + } + return getGetUserMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.UpdateUserRequest, com.google.showcase.v1beta1.User> + getUpdateUserMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "UpdateUser", + requestType = com.google.showcase.v1beta1.UpdateUserRequest.class, + responseType = com.google.showcase.v1beta1.User.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.UpdateUserRequest, com.google.showcase.v1beta1.User> + getUpdateUserMethod() { + io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.UpdateUserRequest, com.google.showcase.v1beta1.User> + getUpdateUserMethod; + if ((getUpdateUserMethod = IdentityGrpc.getUpdateUserMethod) == null) { + synchronized (IdentityGrpc.class) { + if ((getUpdateUserMethod = IdentityGrpc.getUpdateUserMethod) == null) { + IdentityGrpc.getUpdateUserMethod = + getUpdateUserMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "UpdateUser")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.UpdateUserRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.User.getDefaultInstance())) + .setSchemaDescriptor(new IdentityMethodDescriptorSupplier("UpdateUser")) + .build(); + } + } + } + return getUpdateUserMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.DeleteUserRequest, com.google.protobuf.Empty> + getDeleteUserMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "DeleteUser", + requestType = com.google.showcase.v1beta1.DeleteUserRequest.class, + responseType = com.google.protobuf.Empty.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.DeleteUserRequest, com.google.protobuf.Empty> + getDeleteUserMethod() { + io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.DeleteUserRequest, com.google.protobuf.Empty> + getDeleteUserMethod; + if ((getDeleteUserMethod = IdentityGrpc.getDeleteUserMethod) == null) { + synchronized (IdentityGrpc.class) { + if ((getDeleteUserMethod = IdentityGrpc.getDeleteUserMethod) == null) { + IdentityGrpc.getDeleteUserMethod = + getDeleteUserMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "DeleteUser")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.DeleteUserRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.protobuf.Empty.getDefaultInstance())) + .setSchemaDescriptor(new IdentityMethodDescriptorSupplier("DeleteUser")) + .build(); + } + } + } + return getDeleteUserMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.ListUsersRequest, + com.google.showcase.v1beta1.ListUsersResponse> + getListUsersMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "ListUsers", + requestType = com.google.showcase.v1beta1.ListUsersRequest.class, + responseType = com.google.showcase.v1beta1.ListUsersResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.ListUsersRequest, + com.google.showcase.v1beta1.ListUsersResponse> + getListUsersMethod() { + io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.ListUsersRequest, + com.google.showcase.v1beta1.ListUsersResponse> + getListUsersMethod; + if ((getListUsersMethod = IdentityGrpc.getListUsersMethod) == null) { + synchronized (IdentityGrpc.class) { + if ((getListUsersMethod = IdentityGrpc.getListUsersMethod) == null) { + IdentityGrpc.getListUsersMethod = + getListUsersMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "ListUsers")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.ListUsersRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.ListUsersResponse.getDefaultInstance())) + .setSchemaDescriptor(new IdentityMethodDescriptorSupplier("ListUsers")) + .build(); + } + } + } + return getListUsersMethod; + } + + /** Creates a new async stub that supports all call types for the service */ + public static IdentityStub newStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public IdentityStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new IdentityStub(channel, callOptions); + } + }; + return IdentityStub.newStub(factory, channel); + } + + /** Creates a new blocking-style stub that supports all types of calls on the service */ + public static IdentityBlockingV2Stub newBlockingV2Stub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public IdentityBlockingV2Stub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new IdentityBlockingV2Stub(channel, callOptions); + } + }; + return IdentityBlockingV2Stub.newStub(factory, channel); + } + + /** + * Creates a new blocking-style stub that supports unary and streaming output calls on the service + */ + public static IdentityBlockingStub newBlockingStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public IdentityBlockingStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new IdentityBlockingStub(channel, callOptions); + } + }; + return IdentityBlockingStub.newStub(factory, channel); + } + + /** Creates a new ListenableFuture-style stub that supports unary calls on the service */ + public static IdentityFutureStub newFutureStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public IdentityFutureStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new IdentityFutureStub(channel, callOptions); + } + }; + return IdentityFutureStub.newStub(factory, channel); + } + + /** + * + * + *
        +   * A simple identity service.
        +   * 
        + */ + public interface AsyncService { + + /** + * + * + *
        +     * Creates a user.
        +     * 
        + */ + default void createUser( + com.google.showcase.v1beta1.CreateUserRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getCreateUserMethod(), responseObserver); + } + + /** + * + * + *
        +     * Retrieves the User with the given uri.
        +     * 
        + */ + default void getUser( + com.google.showcase.v1beta1.GetUserRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getGetUserMethod(), responseObserver); + } + + /** + * + * + *
        +     * Updates a user.
        +     * 
        + */ + default void updateUser( + com.google.showcase.v1beta1.UpdateUserRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getUpdateUserMethod(), responseObserver); + } + + /** + * + * + *
        +     * Deletes a user, their profile, and all of their authored messages.
        +     * 
        + */ + default void deleteUser( + com.google.showcase.v1beta1.DeleteUserRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getDeleteUserMethod(), responseObserver); + } + + /** + * + * + *
        +     * Lists all users.
        +     * 
        + */ + default void listUsers( + com.google.showcase.v1beta1.ListUsersRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getListUsersMethod(), responseObserver); + } + } + + /** + * Base class for the server implementation of the service Identity. + * + *
        +   * A simple identity service.
        +   * 
        + */ + public abstract static class IdentityImplBase implements io.grpc.BindableService, AsyncService { + + @java.lang.Override + public final io.grpc.ServerServiceDefinition bindService() { + return IdentityGrpc.bindService(this); + } + } + + /** + * A stub to allow clients to do asynchronous rpc calls to service Identity. + * + *
        +   * A simple identity service.
        +   * 
        + */ + public static final class IdentityStub extends io.grpc.stub.AbstractAsyncStub { + private IdentityStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected IdentityStub build(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new IdentityStub(channel, callOptions); + } + + /** + * + * + *
        +     * Creates a user.
        +     * 
        + */ + public void createUser( + com.google.showcase.v1beta1.CreateUserRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getCreateUserMethod(), getCallOptions()), request, responseObserver); + } + + /** + * + * + *
        +     * Retrieves the User with the given uri.
        +     * 
        + */ + public void getUser( + com.google.showcase.v1beta1.GetUserRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getGetUserMethod(), getCallOptions()), request, responseObserver); + } + + /** + * + * + *
        +     * Updates a user.
        +     * 
        + */ + public void updateUser( + com.google.showcase.v1beta1.UpdateUserRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getUpdateUserMethod(), getCallOptions()), request, responseObserver); + } + + /** + * + * + *
        +     * Deletes a user, their profile, and all of their authored messages.
        +     * 
        + */ + public void deleteUser( + com.google.showcase.v1beta1.DeleteUserRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getDeleteUserMethod(), getCallOptions()), request, responseObserver); + } + + /** + * + * + *
        +     * Lists all users.
        +     * 
        + */ + public void listUsers( + com.google.showcase.v1beta1.ListUsersRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getListUsersMethod(), getCallOptions()), request, responseObserver); + } + } + + /** + * A stub to allow clients to do synchronous rpc calls to service Identity. + * + *
        +   * A simple identity service.
        +   * 
        + */ + public static final class IdentityBlockingV2Stub + extends io.grpc.stub.AbstractBlockingStub { + private IdentityBlockingV2Stub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected IdentityBlockingV2Stub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new IdentityBlockingV2Stub(channel, callOptions); + } + + /** + * + * + *
        +     * Creates a user.
        +     * 
        + */ + public com.google.showcase.v1beta1.User createUser( + com.google.showcase.v1beta1.CreateUserRequest request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getCreateUserMethod(), getCallOptions(), request); + } + + /** + * + * + *
        +     * Retrieves the User with the given uri.
        +     * 
        + */ + public com.google.showcase.v1beta1.User getUser( + com.google.showcase.v1beta1.GetUserRequest request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getGetUserMethod(), getCallOptions(), request); + } + + /** + * + * + *
        +     * Updates a user.
        +     * 
        + */ + public com.google.showcase.v1beta1.User updateUser( + com.google.showcase.v1beta1.UpdateUserRequest request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getUpdateUserMethod(), getCallOptions(), request); + } + + /** + * + * + *
        +     * Deletes a user, their profile, and all of their authored messages.
        +     * 
        + */ + public com.google.protobuf.Empty deleteUser( + com.google.showcase.v1beta1.DeleteUserRequest request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getDeleteUserMethod(), getCallOptions(), request); + } + + /** + * + * + *
        +     * Lists all users.
        +     * 
        + */ + public com.google.showcase.v1beta1.ListUsersResponse listUsers( + com.google.showcase.v1beta1.ListUsersRequest request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getListUsersMethod(), getCallOptions(), request); + } + } + + /** + * A stub to allow clients to do limited synchronous rpc calls to service Identity. + * + *
        +   * A simple identity service.
        +   * 
        + */ + public static final class IdentityBlockingStub + extends io.grpc.stub.AbstractBlockingStub { + private IdentityBlockingStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected IdentityBlockingStub build(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new IdentityBlockingStub(channel, callOptions); + } + + /** + * + * + *
        +     * Creates a user.
        +     * 
        + */ + public com.google.showcase.v1beta1.User createUser( + com.google.showcase.v1beta1.CreateUserRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getCreateUserMethod(), getCallOptions(), request); + } + + /** + * + * + *
        +     * Retrieves the User with the given uri.
        +     * 
        + */ + public com.google.showcase.v1beta1.User getUser( + com.google.showcase.v1beta1.GetUserRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getGetUserMethod(), getCallOptions(), request); + } + + /** + * + * + *
        +     * Updates a user.
        +     * 
        + */ + public com.google.showcase.v1beta1.User updateUser( + com.google.showcase.v1beta1.UpdateUserRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getUpdateUserMethod(), getCallOptions(), request); + } + + /** + * + * + *
        +     * Deletes a user, their profile, and all of their authored messages.
        +     * 
        + */ + public com.google.protobuf.Empty deleteUser( + com.google.showcase.v1beta1.DeleteUserRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getDeleteUserMethod(), getCallOptions(), request); + } + + /** + * + * + *
        +     * Lists all users.
        +     * 
        + */ + public com.google.showcase.v1beta1.ListUsersResponse listUsers( + com.google.showcase.v1beta1.ListUsersRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getListUsersMethod(), getCallOptions(), request); + } + } + + /** + * A stub to allow clients to do ListenableFuture-style rpc calls to service Identity. + * + *
        +   * A simple identity service.
        +   * 
        + */ + public static final class IdentityFutureStub + extends io.grpc.stub.AbstractFutureStub { + private IdentityFutureStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected IdentityFutureStub build(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new IdentityFutureStub(channel, callOptions); + } + + /** + * + * + *
        +     * Creates a user.
        +     * 
        + */ + public com.google.common.util.concurrent.ListenableFuture + createUser(com.google.showcase.v1beta1.CreateUserRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getCreateUserMethod(), getCallOptions()), request); + } + + /** + * + * + *
        +     * Retrieves the User with the given uri.
        +     * 
        + */ + public com.google.common.util.concurrent.ListenableFuture + getUser(com.google.showcase.v1beta1.GetUserRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getGetUserMethod(), getCallOptions()), request); + } + + /** + * + * + *
        +     * Updates a user.
        +     * 
        + */ + public com.google.common.util.concurrent.ListenableFuture + updateUser(com.google.showcase.v1beta1.UpdateUserRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getUpdateUserMethod(), getCallOptions()), request); + } + + /** + * + * + *
        +     * Deletes a user, their profile, and all of their authored messages.
        +     * 
        + */ + public com.google.common.util.concurrent.ListenableFuture deleteUser( + com.google.showcase.v1beta1.DeleteUserRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getDeleteUserMethod(), getCallOptions()), request); + } + + /** + * + * + *
        +     * Lists all users.
        +     * 
        + */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.showcase.v1beta1.ListUsersResponse> + listUsers(com.google.showcase.v1beta1.ListUsersRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getListUsersMethod(), getCallOptions()), request); + } + } + + private static final int METHODID_CREATE_USER = 0; + private static final int METHODID_GET_USER = 1; + private static final int METHODID_UPDATE_USER = 2; + private static final int METHODID_DELETE_USER = 3; + private static final int METHODID_LIST_USERS = 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_CREATE_USER: + serviceImpl.createUser( + (com.google.showcase.v1beta1.CreateUserRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_GET_USER: + serviceImpl.getUser( + (com.google.showcase.v1beta1.GetUserRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_UPDATE_USER: + serviceImpl.updateUser( + (com.google.showcase.v1beta1.UpdateUserRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_DELETE_USER: + serviceImpl.deleteUser( + (com.google.showcase.v1beta1.DeleteUserRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_LIST_USERS: + serviceImpl.listUsers( + (com.google.showcase.v1beta1.ListUsersRequest) 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( + getCreateUserMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.showcase.v1beta1.CreateUserRequest, + com.google.showcase.v1beta1.User>(service, METHODID_CREATE_USER))) + .addMethod( + getGetUserMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.showcase.v1beta1.GetUserRequest, com.google.showcase.v1beta1.User>( + service, METHODID_GET_USER))) + .addMethod( + getUpdateUserMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.showcase.v1beta1.UpdateUserRequest, + com.google.showcase.v1beta1.User>(service, METHODID_UPDATE_USER))) + .addMethod( + getDeleteUserMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.showcase.v1beta1.DeleteUserRequest, com.google.protobuf.Empty>( + service, METHODID_DELETE_USER))) + .addMethod( + getListUsersMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.showcase.v1beta1.ListUsersRequest, + com.google.showcase.v1beta1.ListUsersResponse>(service, METHODID_LIST_USERS))) + .build(); + } + + private abstract static class IdentityBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoFileDescriptorSupplier, + io.grpc.protobuf.ProtoServiceDescriptorSupplier { + IdentityBaseDescriptorSupplier() {} + + @java.lang.Override + public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() { + return com.google.showcase.v1beta1.IdentityOuterClass.getDescriptor(); + } + + @java.lang.Override + public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() { + return getFileDescriptor().findServiceByName("Identity"); + } + } + + private static final class IdentityFileDescriptorSupplier extends IdentityBaseDescriptorSupplier { + IdentityFileDescriptorSupplier() {} + } + + private static final class IdentityMethodDescriptorSupplier extends IdentityBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoMethodDescriptorSupplier { + private final java.lang.String methodName; + + IdentityMethodDescriptorSupplier(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 (IdentityGrpc.class) { + result = serviceDescriptor; + if (result == null) { + serviceDescriptor = + result = + io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME) + .setSchemaDescriptor(new IdentityFileDescriptorSupplier()) + .addMethod(getCreateUserMethod()) + .addMethod(getGetUserMethod()) + .addMethod(getUpdateUserMethod()) + .addMethod(getDeleteUserMethod()) + .addMethod(getListUsersMethod()) + .build(); + } + } + } + return result; + } +} diff --git a/java-showcase-3.25.8/grpc-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/MessagingGrpc.java b/java-showcase-3.25.8/grpc-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/MessagingGrpc.java new file mode 100644 index 0000000000..48b744397b --- /dev/null +++ b/java-showcase-3.25.8/grpc-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/MessagingGrpc.java @@ -0,0 +1,2004 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.showcase.v1beta1; + +import static io.grpc.MethodDescriptor.generateFullMethodName; + +/** + * + * + *
        + * A simple messaging service that implements chat rooms and profile posts.
        + * This messaging service showcases the features that API clients
        + * generated by gapic-generators implement.
        + * 
        + */ +@io.grpc.stub.annotations.GrpcGenerated +public final class MessagingGrpc { + + private MessagingGrpc() {} + + public static final java.lang.String SERVICE_NAME = "google.showcase.v1beta1.Messaging"; + + // Static method descriptors that strictly reflect the proto. + private static volatile io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.CreateRoomRequest, com.google.showcase.v1beta1.Room> + getCreateRoomMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "CreateRoom", + requestType = com.google.showcase.v1beta1.CreateRoomRequest.class, + responseType = com.google.showcase.v1beta1.Room.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.CreateRoomRequest, com.google.showcase.v1beta1.Room> + getCreateRoomMethod() { + io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.CreateRoomRequest, com.google.showcase.v1beta1.Room> + getCreateRoomMethod; + if ((getCreateRoomMethod = MessagingGrpc.getCreateRoomMethod) == null) { + synchronized (MessagingGrpc.class) { + if ((getCreateRoomMethod = MessagingGrpc.getCreateRoomMethod) == null) { + MessagingGrpc.getCreateRoomMethod = + getCreateRoomMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "CreateRoom")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.CreateRoomRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.Room.getDefaultInstance())) + .setSchemaDescriptor(new MessagingMethodDescriptorSupplier("CreateRoom")) + .build(); + } + } + } + return getCreateRoomMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.GetRoomRequest, com.google.showcase.v1beta1.Room> + getGetRoomMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "GetRoom", + requestType = com.google.showcase.v1beta1.GetRoomRequest.class, + responseType = com.google.showcase.v1beta1.Room.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.GetRoomRequest, com.google.showcase.v1beta1.Room> + getGetRoomMethod() { + io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.GetRoomRequest, com.google.showcase.v1beta1.Room> + getGetRoomMethod; + if ((getGetRoomMethod = MessagingGrpc.getGetRoomMethod) == null) { + synchronized (MessagingGrpc.class) { + if ((getGetRoomMethod = MessagingGrpc.getGetRoomMethod) == null) { + MessagingGrpc.getGetRoomMethod = + getGetRoomMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetRoom")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.GetRoomRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.Room.getDefaultInstance())) + .setSchemaDescriptor(new MessagingMethodDescriptorSupplier("GetRoom")) + .build(); + } + } + } + return getGetRoomMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.UpdateRoomRequest, com.google.showcase.v1beta1.Room> + getUpdateRoomMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "UpdateRoom", + requestType = com.google.showcase.v1beta1.UpdateRoomRequest.class, + responseType = com.google.showcase.v1beta1.Room.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.UpdateRoomRequest, com.google.showcase.v1beta1.Room> + getUpdateRoomMethod() { + io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.UpdateRoomRequest, com.google.showcase.v1beta1.Room> + getUpdateRoomMethod; + if ((getUpdateRoomMethod = MessagingGrpc.getUpdateRoomMethod) == null) { + synchronized (MessagingGrpc.class) { + if ((getUpdateRoomMethod = MessagingGrpc.getUpdateRoomMethod) == null) { + MessagingGrpc.getUpdateRoomMethod = + getUpdateRoomMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "UpdateRoom")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.UpdateRoomRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.Room.getDefaultInstance())) + .setSchemaDescriptor(new MessagingMethodDescriptorSupplier("UpdateRoom")) + .build(); + } + } + } + return getUpdateRoomMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.DeleteRoomRequest, com.google.protobuf.Empty> + getDeleteRoomMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "DeleteRoom", + requestType = com.google.showcase.v1beta1.DeleteRoomRequest.class, + responseType = com.google.protobuf.Empty.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.DeleteRoomRequest, com.google.protobuf.Empty> + getDeleteRoomMethod() { + io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.DeleteRoomRequest, com.google.protobuf.Empty> + getDeleteRoomMethod; + if ((getDeleteRoomMethod = MessagingGrpc.getDeleteRoomMethod) == null) { + synchronized (MessagingGrpc.class) { + if ((getDeleteRoomMethod = MessagingGrpc.getDeleteRoomMethod) == null) { + MessagingGrpc.getDeleteRoomMethod = + getDeleteRoomMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "DeleteRoom")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.DeleteRoomRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.protobuf.Empty.getDefaultInstance())) + .setSchemaDescriptor(new MessagingMethodDescriptorSupplier("DeleteRoom")) + .build(); + } + } + } + return getDeleteRoomMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.ListRoomsRequest, + com.google.showcase.v1beta1.ListRoomsResponse> + getListRoomsMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "ListRooms", + requestType = com.google.showcase.v1beta1.ListRoomsRequest.class, + responseType = com.google.showcase.v1beta1.ListRoomsResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.ListRoomsRequest, + com.google.showcase.v1beta1.ListRoomsResponse> + getListRoomsMethod() { + io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.ListRoomsRequest, + com.google.showcase.v1beta1.ListRoomsResponse> + getListRoomsMethod; + if ((getListRoomsMethod = MessagingGrpc.getListRoomsMethod) == null) { + synchronized (MessagingGrpc.class) { + if ((getListRoomsMethod = MessagingGrpc.getListRoomsMethod) == null) { + MessagingGrpc.getListRoomsMethod = + getListRoomsMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "ListRooms")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.ListRoomsRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.ListRoomsResponse.getDefaultInstance())) + .setSchemaDescriptor(new MessagingMethodDescriptorSupplier("ListRooms")) + .build(); + } + } + } + return getListRoomsMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.CreateBlurbRequest, com.google.showcase.v1beta1.Blurb> + getCreateBlurbMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "CreateBlurb", + requestType = com.google.showcase.v1beta1.CreateBlurbRequest.class, + responseType = com.google.showcase.v1beta1.Blurb.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.CreateBlurbRequest, com.google.showcase.v1beta1.Blurb> + getCreateBlurbMethod() { + io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.CreateBlurbRequest, com.google.showcase.v1beta1.Blurb> + getCreateBlurbMethod; + if ((getCreateBlurbMethod = MessagingGrpc.getCreateBlurbMethod) == null) { + synchronized (MessagingGrpc.class) { + if ((getCreateBlurbMethod = MessagingGrpc.getCreateBlurbMethod) == null) { + MessagingGrpc.getCreateBlurbMethod = + getCreateBlurbMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "CreateBlurb")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.CreateBlurbRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.Blurb.getDefaultInstance())) + .setSchemaDescriptor(new MessagingMethodDescriptorSupplier("CreateBlurb")) + .build(); + } + } + } + return getCreateBlurbMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.GetBlurbRequest, com.google.showcase.v1beta1.Blurb> + getGetBlurbMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "GetBlurb", + requestType = com.google.showcase.v1beta1.GetBlurbRequest.class, + responseType = com.google.showcase.v1beta1.Blurb.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.GetBlurbRequest, com.google.showcase.v1beta1.Blurb> + getGetBlurbMethod() { + io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.GetBlurbRequest, com.google.showcase.v1beta1.Blurb> + getGetBlurbMethod; + if ((getGetBlurbMethod = MessagingGrpc.getGetBlurbMethod) == null) { + synchronized (MessagingGrpc.class) { + if ((getGetBlurbMethod = MessagingGrpc.getGetBlurbMethod) == null) { + MessagingGrpc.getGetBlurbMethod = + getGetBlurbMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetBlurb")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.GetBlurbRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.Blurb.getDefaultInstance())) + .setSchemaDescriptor(new MessagingMethodDescriptorSupplier("GetBlurb")) + .build(); + } + } + } + return getGetBlurbMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.UpdateBlurbRequest, com.google.showcase.v1beta1.Blurb> + getUpdateBlurbMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "UpdateBlurb", + requestType = com.google.showcase.v1beta1.UpdateBlurbRequest.class, + responseType = com.google.showcase.v1beta1.Blurb.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.UpdateBlurbRequest, com.google.showcase.v1beta1.Blurb> + getUpdateBlurbMethod() { + io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.UpdateBlurbRequest, com.google.showcase.v1beta1.Blurb> + getUpdateBlurbMethod; + if ((getUpdateBlurbMethod = MessagingGrpc.getUpdateBlurbMethod) == null) { + synchronized (MessagingGrpc.class) { + if ((getUpdateBlurbMethod = MessagingGrpc.getUpdateBlurbMethod) == null) { + MessagingGrpc.getUpdateBlurbMethod = + getUpdateBlurbMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "UpdateBlurb")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.UpdateBlurbRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.Blurb.getDefaultInstance())) + .setSchemaDescriptor(new MessagingMethodDescriptorSupplier("UpdateBlurb")) + .build(); + } + } + } + return getUpdateBlurbMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.DeleteBlurbRequest, com.google.protobuf.Empty> + getDeleteBlurbMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "DeleteBlurb", + requestType = com.google.showcase.v1beta1.DeleteBlurbRequest.class, + responseType = com.google.protobuf.Empty.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.DeleteBlurbRequest, com.google.protobuf.Empty> + getDeleteBlurbMethod() { + io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.DeleteBlurbRequest, com.google.protobuf.Empty> + getDeleteBlurbMethod; + if ((getDeleteBlurbMethod = MessagingGrpc.getDeleteBlurbMethod) == null) { + synchronized (MessagingGrpc.class) { + if ((getDeleteBlurbMethod = MessagingGrpc.getDeleteBlurbMethod) == null) { + MessagingGrpc.getDeleteBlurbMethod = + getDeleteBlurbMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "DeleteBlurb")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.DeleteBlurbRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.protobuf.Empty.getDefaultInstance())) + .setSchemaDescriptor(new MessagingMethodDescriptorSupplier("DeleteBlurb")) + .build(); + } + } + } + return getDeleteBlurbMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.ListBlurbsRequest, + com.google.showcase.v1beta1.ListBlurbsResponse> + getListBlurbsMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "ListBlurbs", + requestType = com.google.showcase.v1beta1.ListBlurbsRequest.class, + responseType = com.google.showcase.v1beta1.ListBlurbsResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.ListBlurbsRequest, + com.google.showcase.v1beta1.ListBlurbsResponse> + getListBlurbsMethod() { + io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.ListBlurbsRequest, + com.google.showcase.v1beta1.ListBlurbsResponse> + getListBlurbsMethod; + if ((getListBlurbsMethod = MessagingGrpc.getListBlurbsMethod) == null) { + synchronized (MessagingGrpc.class) { + if ((getListBlurbsMethod = MessagingGrpc.getListBlurbsMethod) == null) { + MessagingGrpc.getListBlurbsMethod = + getListBlurbsMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "ListBlurbs")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.ListBlurbsRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.ListBlurbsResponse.getDefaultInstance())) + .setSchemaDescriptor(new MessagingMethodDescriptorSupplier("ListBlurbs")) + .build(); + } + } + } + return getListBlurbsMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.SearchBlurbsRequest, com.google.longrunning.Operation> + getSearchBlurbsMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "SearchBlurbs", + requestType = com.google.showcase.v1beta1.SearchBlurbsRequest.class, + responseType = com.google.longrunning.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.SearchBlurbsRequest, com.google.longrunning.Operation> + getSearchBlurbsMethod() { + io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.SearchBlurbsRequest, com.google.longrunning.Operation> + getSearchBlurbsMethod; + if ((getSearchBlurbsMethod = MessagingGrpc.getSearchBlurbsMethod) == null) { + synchronized (MessagingGrpc.class) { + if ((getSearchBlurbsMethod = MessagingGrpc.getSearchBlurbsMethod) == null) { + MessagingGrpc.getSearchBlurbsMethod = + getSearchBlurbsMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "SearchBlurbs")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.SearchBlurbsRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor(new MessagingMethodDescriptorSupplier("SearchBlurbs")) + .build(); + } + } + } + return getSearchBlurbsMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.StreamBlurbsRequest, + com.google.showcase.v1beta1.StreamBlurbsResponse> + getStreamBlurbsMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "StreamBlurbs", + requestType = com.google.showcase.v1beta1.StreamBlurbsRequest.class, + responseType = com.google.showcase.v1beta1.StreamBlurbsResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.SERVER_STREAMING) + public static io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.StreamBlurbsRequest, + com.google.showcase.v1beta1.StreamBlurbsResponse> + getStreamBlurbsMethod() { + io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.StreamBlurbsRequest, + com.google.showcase.v1beta1.StreamBlurbsResponse> + getStreamBlurbsMethod; + if ((getStreamBlurbsMethod = MessagingGrpc.getStreamBlurbsMethod) == null) { + synchronized (MessagingGrpc.class) { + if ((getStreamBlurbsMethod = MessagingGrpc.getStreamBlurbsMethod) == null) { + MessagingGrpc.getStreamBlurbsMethod = + getStreamBlurbsMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.SERVER_STREAMING) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "StreamBlurbs")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.StreamBlurbsRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.StreamBlurbsResponse + .getDefaultInstance())) + .setSchemaDescriptor(new MessagingMethodDescriptorSupplier("StreamBlurbs")) + .build(); + } + } + } + return getStreamBlurbsMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.CreateBlurbRequest, + com.google.showcase.v1beta1.SendBlurbsResponse> + getSendBlurbsMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "SendBlurbs", + requestType = com.google.showcase.v1beta1.CreateBlurbRequest.class, + responseType = com.google.showcase.v1beta1.SendBlurbsResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.CLIENT_STREAMING) + public static io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.CreateBlurbRequest, + com.google.showcase.v1beta1.SendBlurbsResponse> + getSendBlurbsMethod() { + io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.CreateBlurbRequest, + com.google.showcase.v1beta1.SendBlurbsResponse> + getSendBlurbsMethod; + if ((getSendBlurbsMethod = MessagingGrpc.getSendBlurbsMethod) == null) { + synchronized (MessagingGrpc.class) { + if ((getSendBlurbsMethod = MessagingGrpc.getSendBlurbsMethod) == null) { + MessagingGrpc.getSendBlurbsMethod = + getSendBlurbsMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.CLIENT_STREAMING) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "SendBlurbs")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.CreateBlurbRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.SendBlurbsResponse.getDefaultInstance())) + .setSchemaDescriptor(new MessagingMethodDescriptorSupplier("SendBlurbs")) + .build(); + } + } + } + return getSendBlurbsMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.ConnectRequest, + com.google.showcase.v1beta1.StreamBlurbsResponse> + getConnectMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "Connect", + requestType = com.google.showcase.v1beta1.ConnectRequest.class, + responseType = com.google.showcase.v1beta1.StreamBlurbsResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.BIDI_STREAMING) + public static io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.ConnectRequest, + com.google.showcase.v1beta1.StreamBlurbsResponse> + getConnectMethod() { + io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.ConnectRequest, + com.google.showcase.v1beta1.StreamBlurbsResponse> + getConnectMethod; + if ((getConnectMethod = MessagingGrpc.getConnectMethod) == null) { + synchronized (MessagingGrpc.class) { + if ((getConnectMethod = MessagingGrpc.getConnectMethod) == null) { + MessagingGrpc.getConnectMethod = + getConnectMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.BIDI_STREAMING) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "Connect")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.ConnectRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.StreamBlurbsResponse + .getDefaultInstance())) + .setSchemaDescriptor(new MessagingMethodDescriptorSupplier("Connect")) + .build(); + } + } + } + return getConnectMethod; + } + + /** Creates a new async stub that supports all call types for the service */ + public static MessagingStub newStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public MessagingStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new MessagingStub(channel, callOptions); + } + }; + return MessagingStub.newStub(factory, channel); + } + + /** Creates a new blocking-style stub that supports all types of calls on the service */ + public static MessagingBlockingV2Stub newBlockingV2Stub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public MessagingBlockingV2Stub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new MessagingBlockingV2Stub(channel, callOptions); + } + }; + return MessagingBlockingV2Stub.newStub(factory, channel); + } + + /** + * Creates a new blocking-style stub that supports unary and streaming output calls on the service + */ + public static MessagingBlockingStub newBlockingStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public MessagingBlockingStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new MessagingBlockingStub(channel, callOptions); + } + }; + return MessagingBlockingStub.newStub(factory, channel); + } + + /** Creates a new ListenableFuture-style stub that supports unary calls on the service */ + public static MessagingFutureStub newFutureStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public MessagingFutureStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new MessagingFutureStub(channel, callOptions); + } + }; + return MessagingFutureStub.newStub(factory, channel); + } + + /** + * + * + *
        +   * A simple messaging service that implements chat rooms and profile posts.
        +   * This messaging service showcases the features that API clients
        +   * generated by gapic-generators implement.
        +   * 
        + */ + public interface AsyncService { + + /** + * + * + *
        +     * Creates a room.
        +     * 
        + */ + default void createRoom( + com.google.showcase.v1beta1.CreateRoomRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getCreateRoomMethod(), responseObserver); + } + + /** + * + * + *
        +     * Retrieves the Room with the given resource name.
        +     * 
        + */ + default void getRoom( + com.google.showcase.v1beta1.GetRoomRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getGetRoomMethod(), responseObserver); + } + + /** + * + * + *
        +     * Updates a room.
        +     * 
        + */ + default void updateRoom( + com.google.showcase.v1beta1.UpdateRoomRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getUpdateRoomMethod(), responseObserver); + } + + /** + * + * + *
        +     * Deletes a room and all of its blurbs.
        +     * 
        + */ + default void deleteRoom( + com.google.showcase.v1beta1.DeleteRoomRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getDeleteRoomMethod(), responseObserver); + } + + /** + * + * + *
        +     * Lists all chat rooms.
        +     * 
        + */ + default void listRooms( + com.google.showcase.v1beta1.ListRoomsRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getListRoomsMethod(), responseObserver); + } + + /** + * + * + *
        +     * Creates a blurb. If the parent is a room, the blurb is understood to be a
        +     * message in that room. If the parent is a profile, the blurb is understood
        +     * to be a post on the profile.
        +     * 
        + */ + default void createBlurb( + com.google.showcase.v1beta1.CreateBlurbRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getCreateBlurbMethod(), responseObserver); + } + + /** + * + * + *
        +     * Retrieves the Blurb with the given resource name.
        +     * 
        + */ + default void getBlurb( + com.google.showcase.v1beta1.GetBlurbRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getGetBlurbMethod(), responseObserver); + } + + /** + * + * + *
        +     * Updates a blurb.
        +     * 
        + */ + default void updateBlurb( + com.google.showcase.v1beta1.UpdateBlurbRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getUpdateBlurbMethod(), responseObserver); + } + + /** + * + * + *
        +     * Deletes a blurb.
        +     * 
        + */ + default void deleteBlurb( + com.google.showcase.v1beta1.DeleteBlurbRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getDeleteBlurbMethod(), responseObserver); + } + + /** + * + * + *
        +     * Lists blurbs for a specific chat room or user profile depending on the
        +     * parent resource name.
        +     * 
        + */ + default void listBlurbs( + com.google.showcase.v1beta1.ListBlurbsRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getListBlurbsMethod(), responseObserver); + } + + /** + * + * + *
        +     * This method searches through all blurbs across all rooms and profiles
        +     * for blurbs containing to words found in the query. Only posts that
        +     * contain an exact match of a queried word will be returned.
        +     * 
        + */ + default void searchBlurbs( + com.google.showcase.v1beta1.SearchBlurbsRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getSearchBlurbsMethod(), responseObserver); + } + + /** + * + * + *
        +     * This returns a stream that emits the blurbs that are created for a
        +     * particular chat room or user profile.
        +     * 
        + */ + default void streamBlurbs( + com.google.showcase.v1beta1.StreamBlurbsRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getStreamBlurbsMethod(), responseObserver); + } + + /** + * + * + *
        +     * This is a stream to create multiple blurbs. If an invalid blurb is
        +     * requested to be created, the stream will close with an error.
        +     * 
        + */ + default io.grpc.stub.StreamObserver sendBlurbs( + io.grpc.stub.StreamObserver + responseObserver) { + return io.grpc.stub.ServerCalls.asyncUnimplementedStreamingCall( + getSendBlurbsMethod(), responseObserver); + } + + /** + * + * + *
        +     * This method starts a bidirectional stream that receives all blurbs that
        +     * are being created after the stream has started and sends requests to create
        +     * blurbs. If an invalid blurb is requested to be created, the stream will
        +     * close with an error.
        +     * 
        + */ + default io.grpc.stub.StreamObserver connect( + io.grpc.stub.StreamObserver + responseObserver) { + return io.grpc.stub.ServerCalls.asyncUnimplementedStreamingCall( + getConnectMethod(), responseObserver); + } + } + + /** + * Base class for the server implementation of the service Messaging. + * + *
        +   * A simple messaging service that implements chat rooms and profile posts.
        +   * This messaging service showcases the features that API clients
        +   * generated by gapic-generators implement.
        +   * 
        + */ + public abstract static class MessagingImplBase implements io.grpc.BindableService, AsyncService { + + @java.lang.Override + public final io.grpc.ServerServiceDefinition bindService() { + return MessagingGrpc.bindService(this); + } + } + + /** + * A stub to allow clients to do asynchronous rpc calls to service Messaging. + * + *
        +   * A simple messaging service that implements chat rooms and profile posts.
        +   * This messaging service showcases the features that API clients
        +   * generated by gapic-generators implement.
        +   * 
        + */ + public static final class MessagingStub extends io.grpc.stub.AbstractAsyncStub { + private MessagingStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected MessagingStub build(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new MessagingStub(channel, callOptions); + } + + /** + * + * + *
        +     * Creates a room.
        +     * 
        + */ + public void createRoom( + com.google.showcase.v1beta1.CreateRoomRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getCreateRoomMethod(), getCallOptions()), request, responseObserver); + } + + /** + * + * + *
        +     * Retrieves the Room with the given resource name.
        +     * 
        + */ + public void getRoom( + com.google.showcase.v1beta1.GetRoomRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getGetRoomMethod(), getCallOptions()), request, responseObserver); + } + + /** + * + * + *
        +     * Updates a room.
        +     * 
        + */ + public void updateRoom( + com.google.showcase.v1beta1.UpdateRoomRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getUpdateRoomMethod(), getCallOptions()), request, responseObserver); + } + + /** + * + * + *
        +     * Deletes a room and all of its blurbs.
        +     * 
        + */ + public void deleteRoom( + com.google.showcase.v1beta1.DeleteRoomRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getDeleteRoomMethod(), getCallOptions()), request, responseObserver); + } + + /** + * + * + *
        +     * Lists all chat rooms.
        +     * 
        + */ + public void listRooms( + com.google.showcase.v1beta1.ListRoomsRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getListRoomsMethod(), getCallOptions()), request, responseObserver); + } + + /** + * + * + *
        +     * Creates a blurb. If the parent is a room, the blurb is understood to be a
        +     * message in that room. If the parent is a profile, the blurb is understood
        +     * to be a post on the profile.
        +     * 
        + */ + public void createBlurb( + com.google.showcase.v1beta1.CreateBlurbRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getCreateBlurbMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
        +     * Retrieves the Blurb with the given resource name.
        +     * 
        + */ + public void getBlurb( + com.google.showcase.v1beta1.GetBlurbRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getGetBlurbMethod(), getCallOptions()), request, responseObserver); + } + + /** + * + * + *
        +     * Updates a blurb.
        +     * 
        + */ + public void updateBlurb( + com.google.showcase.v1beta1.UpdateBlurbRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getUpdateBlurbMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
        +     * Deletes a blurb.
        +     * 
        + */ + public void deleteBlurb( + com.google.showcase.v1beta1.DeleteBlurbRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getDeleteBlurbMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
        +     * Lists blurbs for a specific chat room or user profile depending on the
        +     * parent resource name.
        +     * 
        + */ + public void listBlurbs( + com.google.showcase.v1beta1.ListBlurbsRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getListBlurbsMethod(), getCallOptions()), request, responseObserver); + } + + /** + * + * + *
        +     * This method searches through all blurbs across all rooms and profiles
        +     * for blurbs containing to words found in the query. Only posts that
        +     * contain an exact match of a queried word will be returned.
        +     * 
        + */ + public void searchBlurbs( + com.google.showcase.v1beta1.SearchBlurbsRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getSearchBlurbsMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
        +     * This returns a stream that emits the blurbs that are created for a
        +     * particular chat room or user profile.
        +     * 
        + */ + public void streamBlurbs( + com.google.showcase.v1beta1.StreamBlurbsRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncServerStreamingCall( + getChannel().newCall(getStreamBlurbsMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
        +     * This is a stream to create multiple blurbs. If an invalid blurb is
        +     * requested to be created, the stream will close with an error.
        +     * 
        + */ + public io.grpc.stub.StreamObserver sendBlurbs( + io.grpc.stub.StreamObserver + responseObserver) { + return io.grpc.stub.ClientCalls.asyncClientStreamingCall( + getChannel().newCall(getSendBlurbsMethod(), getCallOptions()), responseObserver); + } + + /** + * + * + *
        +     * This method starts a bidirectional stream that receives all blurbs that
        +     * are being created after the stream has started and sends requests to create
        +     * blurbs. If an invalid blurb is requested to be created, the stream will
        +     * close with an error.
        +     * 
        + */ + public io.grpc.stub.StreamObserver connect( + io.grpc.stub.StreamObserver + responseObserver) { + return io.grpc.stub.ClientCalls.asyncBidiStreamingCall( + getChannel().newCall(getConnectMethod(), getCallOptions()), responseObserver); + } + } + + /** + * A stub to allow clients to do synchronous rpc calls to service Messaging. + * + *
        +   * A simple messaging service that implements chat rooms and profile posts.
        +   * This messaging service showcases the features that API clients
        +   * generated by gapic-generators implement.
        +   * 
        + */ + public static final class MessagingBlockingV2Stub + extends io.grpc.stub.AbstractBlockingStub { + private MessagingBlockingV2Stub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected MessagingBlockingV2Stub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new MessagingBlockingV2Stub(channel, callOptions); + } + + /** + * + * + *
        +     * Creates a room.
        +     * 
        + */ + public com.google.showcase.v1beta1.Room createRoom( + com.google.showcase.v1beta1.CreateRoomRequest request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getCreateRoomMethod(), getCallOptions(), request); + } + + /** + * + * + *
        +     * Retrieves the Room with the given resource name.
        +     * 
        + */ + public com.google.showcase.v1beta1.Room getRoom( + com.google.showcase.v1beta1.GetRoomRequest request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getGetRoomMethod(), getCallOptions(), request); + } + + /** + * + * + *
        +     * Updates a room.
        +     * 
        + */ + public com.google.showcase.v1beta1.Room updateRoom( + com.google.showcase.v1beta1.UpdateRoomRequest request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getUpdateRoomMethod(), getCallOptions(), request); + } + + /** + * + * + *
        +     * Deletes a room and all of its blurbs.
        +     * 
        + */ + public com.google.protobuf.Empty deleteRoom( + com.google.showcase.v1beta1.DeleteRoomRequest request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getDeleteRoomMethod(), getCallOptions(), request); + } + + /** + * + * + *
        +     * Lists all chat rooms.
        +     * 
        + */ + public com.google.showcase.v1beta1.ListRoomsResponse listRooms( + com.google.showcase.v1beta1.ListRoomsRequest request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getListRoomsMethod(), getCallOptions(), request); + } + + /** + * + * + *
        +     * Creates a blurb. If the parent is a room, the blurb is understood to be a
        +     * message in that room. If the parent is a profile, the blurb is understood
        +     * to be a post on the profile.
        +     * 
        + */ + public com.google.showcase.v1beta1.Blurb createBlurb( + com.google.showcase.v1beta1.CreateBlurbRequest request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getCreateBlurbMethod(), getCallOptions(), request); + } + + /** + * + * + *
        +     * Retrieves the Blurb with the given resource name.
        +     * 
        + */ + public com.google.showcase.v1beta1.Blurb getBlurb( + com.google.showcase.v1beta1.GetBlurbRequest request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getGetBlurbMethod(), getCallOptions(), request); + } + + /** + * + * + *
        +     * Updates a blurb.
        +     * 
        + */ + public com.google.showcase.v1beta1.Blurb updateBlurb( + com.google.showcase.v1beta1.UpdateBlurbRequest request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getUpdateBlurbMethod(), getCallOptions(), request); + } + + /** + * + * + *
        +     * Deletes a blurb.
        +     * 
        + */ + public com.google.protobuf.Empty deleteBlurb( + com.google.showcase.v1beta1.DeleteBlurbRequest request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getDeleteBlurbMethod(), getCallOptions(), request); + } + + /** + * + * + *
        +     * Lists blurbs for a specific chat room or user profile depending on the
        +     * parent resource name.
        +     * 
        + */ + public com.google.showcase.v1beta1.ListBlurbsResponse listBlurbs( + com.google.showcase.v1beta1.ListBlurbsRequest request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getListBlurbsMethod(), getCallOptions(), request); + } + + /** + * + * + *
        +     * This method searches through all blurbs across all rooms and profiles
        +     * for blurbs containing to words found in the query. Only posts that
        +     * contain an exact match of a queried word will be returned.
        +     * 
        + */ + public com.google.longrunning.Operation searchBlurbs( + com.google.showcase.v1beta1.SearchBlurbsRequest request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getSearchBlurbsMethod(), getCallOptions(), request); + } + + /** + * + * + *
        +     * This returns a stream that emits the blurbs that are created for a
        +     * particular chat room or user profile.
        +     * 
        + */ + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/10918") + public io.grpc.stub.BlockingClientCall + streamBlurbs(com.google.showcase.v1beta1.StreamBlurbsRequest request) { + return io.grpc.stub.ClientCalls.blockingV2ServerStreamingCall( + getChannel(), getStreamBlurbsMethod(), getCallOptions(), request); + } + + /** + * + * + *
        +     * This is a stream to create multiple blurbs. If an invalid blurb is
        +     * requested to be created, the stream will close with an error.
        +     * 
        + */ + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/10918") + public io.grpc.stub.BlockingClientCall< + com.google.showcase.v1beta1.CreateBlurbRequest, + com.google.showcase.v1beta1.SendBlurbsResponse> + sendBlurbs() { + return io.grpc.stub.ClientCalls.blockingClientStreamingCall( + getChannel(), getSendBlurbsMethod(), getCallOptions()); + } + + /** + * + * + *
        +     * This method starts a bidirectional stream that receives all blurbs that
        +     * are being created after the stream has started and sends requests to create
        +     * blurbs. If an invalid blurb is requested to be created, the stream will
        +     * close with an error.
        +     * 
        + */ + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/10918") + public io.grpc.stub.BlockingClientCall< + com.google.showcase.v1beta1.ConnectRequest, + com.google.showcase.v1beta1.StreamBlurbsResponse> + connect() { + return io.grpc.stub.ClientCalls.blockingBidiStreamingCall( + getChannel(), getConnectMethod(), getCallOptions()); + } + } + + /** + * A stub to allow clients to do limited synchronous rpc calls to service Messaging. + * + *
        +   * A simple messaging service that implements chat rooms and profile posts.
        +   * This messaging service showcases the features that API clients
        +   * generated by gapic-generators implement.
        +   * 
        + */ + public static final class MessagingBlockingStub + extends io.grpc.stub.AbstractBlockingStub { + private MessagingBlockingStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected MessagingBlockingStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new MessagingBlockingStub(channel, callOptions); + } + + /** + * + * + *
        +     * Creates a room.
        +     * 
        + */ + public com.google.showcase.v1beta1.Room createRoom( + com.google.showcase.v1beta1.CreateRoomRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getCreateRoomMethod(), getCallOptions(), request); + } + + /** + * + * + *
        +     * Retrieves the Room with the given resource name.
        +     * 
        + */ + public com.google.showcase.v1beta1.Room getRoom( + com.google.showcase.v1beta1.GetRoomRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getGetRoomMethod(), getCallOptions(), request); + } + + /** + * + * + *
        +     * Updates a room.
        +     * 
        + */ + public com.google.showcase.v1beta1.Room updateRoom( + com.google.showcase.v1beta1.UpdateRoomRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getUpdateRoomMethod(), getCallOptions(), request); + } + + /** + * + * + *
        +     * Deletes a room and all of its blurbs.
        +     * 
        + */ + public com.google.protobuf.Empty deleteRoom( + com.google.showcase.v1beta1.DeleteRoomRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getDeleteRoomMethod(), getCallOptions(), request); + } + + /** + * + * + *
        +     * Lists all chat rooms.
        +     * 
        + */ + public com.google.showcase.v1beta1.ListRoomsResponse listRooms( + com.google.showcase.v1beta1.ListRoomsRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getListRoomsMethod(), getCallOptions(), request); + } + + /** + * + * + *
        +     * Creates a blurb. If the parent is a room, the blurb is understood to be a
        +     * message in that room. If the parent is a profile, the blurb is understood
        +     * to be a post on the profile.
        +     * 
        + */ + public com.google.showcase.v1beta1.Blurb createBlurb( + com.google.showcase.v1beta1.CreateBlurbRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getCreateBlurbMethod(), getCallOptions(), request); + } + + /** + * + * + *
        +     * Retrieves the Blurb with the given resource name.
        +     * 
        + */ + public com.google.showcase.v1beta1.Blurb getBlurb( + com.google.showcase.v1beta1.GetBlurbRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getGetBlurbMethod(), getCallOptions(), request); + } + + /** + * + * + *
        +     * Updates a blurb.
        +     * 
        + */ + public com.google.showcase.v1beta1.Blurb updateBlurb( + com.google.showcase.v1beta1.UpdateBlurbRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getUpdateBlurbMethod(), getCallOptions(), request); + } + + /** + * + * + *
        +     * Deletes a blurb.
        +     * 
        + */ + public com.google.protobuf.Empty deleteBlurb( + com.google.showcase.v1beta1.DeleteBlurbRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getDeleteBlurbMethod(), getCallOptions(), request); + } + + /** + * + * + *
        +     * Lists blurbs for a specific chat room or user profile depending on the
        +     * parent resource name.
        +     * 
        + */ + public com.google.showcase.v1beta1.ListBlurbsResponse listBlurbs( + com.google.showcase.v1beta1.ListBlurbsRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getListBlurbsMethod(), getCallOptions(), request); + } + + /** + * + * + *
        +     * This method searches through all blurbs across all rooms and profiles
        +     * for blurbs containing to words found in the query. Only posts that
        +     * contain an exact match of a queried word will be returned.
        +     * 
        + */ + public com.google.longrunning.Operation searchBlurbs( + com.google.showcase.v1beta1.SearchBlurbsRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getSearchBlurbsMethod(), getCallOptions(), request); + } + + /** + * + * + *
        +     * This returns a stream that emits the blurbs that are created for a
        +     * particular chat room or user profile.
        +     * 
        + */ + public java.util.Iterator streamBlurbs( + com.google.showcase.v1beta1.StreamBlurbsRequest request) { + return io.grpc.stub.ClientCalls.blockingServerStreamingCall( + getChannel(), getStreamBlurbsMethod(), getCallOptions(), request); + } + } + + /** + * A stub to allow clients to do ListenableFuture-style rpc calls to service Messaging. + * + *
        +   * A simple messaging service that implements chat rooms and profile posts.
        +   * This messaging service showcases the features that API clients
        +   * generated by gapic-generators implement.
        +   * 
        + */ + public static final class MessagingFutureStub + extends io.grpc.stub.AbstractFutureStub { + private MessagingFutureStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected MessagingFutureStub build(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new MessagingFutureStub(channel, callOptions); + } + + /** + * + * + *
        +     * Creates a room.
        +     * 
        + */ + public com.google.common.util.concurrent.ListenableFuture + createRoom(com.google.showcase.v1beta1.CreateRoomRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getCreateRoomMethod(), getCallOptions()), request); + } + + /** + * + * + *
        +     * Retrieves the Room with the given resource name.
        +     * 
        + */ + public com.google.common.util.concurrent.ListenableFuture + getRoom(com.google.showcase.v1beta1.GetRoomRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getGetRoomMethod(), getCallOptions()), request); + } + + /** + * + * + *
        +     * Updates a room.
        +     * 
        + */ + public com.google.common.util.concurrent.ListenableFuture + updateRoom(com.google.showcase.v1beta1.UpdateRoomRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getUpdateRoomMethod(), getCallOptions()), request); + } + + /** + * + * + *
        +     * Deletes a room and all of its blurbs.
        +     * 
        + */ + public com.google.common.util.concurrent.ListenableFuture deleteRoom( + com.google.showcase.v1beta1.DeleteRoomRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getDeleteRoomMethod(), getCallOptions()), request); + } + + /** + * + * + *
        +     * Lists all chat rooms.
        +     * 
        + */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.showcase.v1beta1.ListRoomsResponse> + listRooms(com.google.showcase.v1beta1.ListRoomsRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getListRoomsMethod(), getCallOptions()), request); + } + + /** + * + * + *
        +     * Creates a blurb. If the parent is a room, the blurb is understood to be a
        +     * message in that room. If the parent is a profile, the blurb is understood
        +     * to be a post on the profile.
        +     * 
        + */ + public com.google.common.util.concurrent.ListenableFuture + createBlurb(com.google.showcase.v1beta1.CreateBlurbRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getCreateBlurbMethod(), getCallOptions()), request); + } + + /** + * + * + *
        +     * Retrieves the Blurb with the given resource name.
        +     * 
        + */ + public com.google.common.util.concurrent.ListenableFuture + getBlurb(com.google.showcase.v1beta1.GetBlurbRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getGetBlurbMethod(), getCallOptions()), request); + } + + /** + * + * + *
        +     * Updates a blurb.
        +     * 
        + */ + public com.google.common.util.concurrent.ListenableFuture + updateBlurb(com.google.showcase.v1beta1.UpdateBlurbRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getUpdateBlurbMethod(), getCallOptions()), request); + } + + /** + * + * + *
        +     * Deletes a blurb.
        +     * 
        + */ + public com.google.common.util.concurrent.ListenableFuture + deleteBlurb(com.google.showcase.v1beta1.DeleteBlurbRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getDeleteBlurbMethod(), getCallOptions()), request); + } + + /** + * + * + *
        +     * Lists blurbs for a specific chat room or user profile depending on the
        +     * parent resource name.
        +     * 
        + */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.showcase.v1beta1.ListBlurbsResponse> + listBlurbs(com.google.showcase.v1beta1.ListBlurbsRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getListBlurbsMethod(), getCallOptions()), request); + } + + /** + * + * + *
        +     * This method searches through all blurbs across all rooms and profiles
        +     * for blurbs containing to words found in the query. Only posts that
        +     * contain an exact match of a queried word will be returned.
        +     * 
        + */ + public com.google.common.util.concurrent.ListenableFuture + searchBlurbs(com.google.showcase.v1beta1.SearchBlurbsRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getSearchBlurbsMethod(), getCallOptions()), request); + } + } + + private static final int METHODID_CREATE_ROOM = 0; + private static final int METHODID_GET_ROOM = 1; + private static final int METHODID_UPDATE_ROOM = 2; + private static final int METHODID_DELETE_ROOM = 3; + private static final int METHODID_LIST_ROOMS = 4; + private static final int METHODID_CREATE_BLURB = 5; + private static final int METHODID_GET_BLURB = 6; + private static final int METHODID_UPDATE_BLURB = 7; + private static final int METHODID_DELETE_BLURB = 8; + private static final int METHODID_LIST_BLURBS = 9; + private static final int METHODID_SEARCH_BLURBS = 10; + private static final int METHODID_STREAM_BLURBS = 11; + private static final int METHODID_SEND_BLURBS = 12; + private static final int METHODID_CONNECT = 13; + + 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_CREATE_ROOM: + serviceImpl.createRoom( + (com.google.showcase.v1beta1.CreateRoomRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_GET_ROOM: + serviceImpl.getRoom( + (com.google.showcase.v1beta1.GetRoomRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_UPDATE_ROOM: + serviceImpl.updateRoom( + (com.google.showcase.v1beta1.UpdateRoomRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_DELETE_ROOM: + serviceImpl.deleteRoom( + (com.google.showcase.v1beta1.DeleteRoomRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_LIST_ROOMS: + serviceImpl.listRooms( + (com.google.showcase.v1beta1.ListRoomsRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_CREATE_BLURB: + serviceImpl.createBlurb( + (com.google.showcase.v1beta1.CreateBlurbRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_GET_BLURB: + serviceImpl.getBlurb( + (com.google.showcase.v1beta1.GetBlurbRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_UPDATE_BLURB: + serviceImpl.updateBlurb( + (com.google.showcase.v1beta1.UpdateBlurbRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_DELETE_BLURB: + serviceImpl.deleteBlurb( + (com.google.showcase.v1beta1.DeleteBlurbRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_LIST_BLURBS: + serviceImpl.listBlurbs( + (com.google.showcase.v1beta1.ListBlurbsRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_SEARCH_BLURBS: + serviceImpl.searchBlurbs( + (com.google.showcase.v1beta1.SearchBlurbsRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_STREAM_BLURBS: + serviceImpl.streamBlurbs( + (com.google.showcase.v1beta1.StreamBlurbsRequest) 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_SEND_BLURBS: + return (io.grpc.stub.StreamObserver) + serviceImpl.sendBlurbs( + (io.grpc.stub.StreamObserver) + responseObserver); + case METHODID_CONNECT: + return (io.grpc.stub.StreamObserver) + serviceImpl.connect( + (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( + getCreateRoomMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.showcase.v1beta1.CreateRoomRequest, + com.google.showcase.v1beta1.Room>(service, METHODID_CREATE_ROOM))) + .addMethod( + getGetRoomMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.showcase.v1beta1.GetRoomRequest, com.google.showcase.v1beta1.Room>( + service, METHODID_GET_ROOM))) + .addMethod( + getUpdateRoomMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.showcase.v1beta1.UpdateRoomRequest, + com.google.showcase.v1beta1.Room>(service, METHODID_UPDATE_ROOM))) + .addMethod( + getDeleteRoomMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.showcase.v1beta1.DeleteRoomRequest, com.google.protobuf.Empty>( + service, METHODID_DELETE_ROOM))) + .addMethod( + getListRoomsMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.showcase.v1beta1.ListRoomsRequest, + com.google.showcase.v1beta1.ListRoomsResponse>(service, METHODID_LIST_ROOMS))) + .addMethod( + getCreateBlurbMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.showcase.v1beta1.CreateBlurbRequest, + com.google.showcase.v1beta1.Blurb>(service, METHODID_CREATE_BLURB))) + .addMethod( + getGetBlurbMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.showcase.v1beta1.GetBlurbRequest, com.google.showcase.v1beta1.Blurb>( + service, METHODID_GET_BLURB))) + .addMethod( + getUpdateBlurbMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.showcase.v1beta1.UpdateBlurbRequest, + com.google.showcase.v1beta1.Blurb>(service, METHODID_UPDATE_BLURB))) + .addMethod( + getDeleteBlurbMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.showcase.v1beta1.DeleteBlurbRequest, com.google.protobuf.Empty>( + service, METHODID_DELETE_BLURB))) + .addMethod( + getListBlurbsMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.showcase.v1beta1.ListBlurbsRequest, + com.google.showcase.v1beta1.ListBlurbsResponse>(service, METHODID_LIST_BLURBS))) + .addMethod( + getSearchBlurbsMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.showcase.v1beta1.SearchBlurbsRequest, + com.google.longrunning.Operation>(service, METHODID_SEARCH_BLURBS))) + .addMethod( + getStreamBlurbsMethod(), + io.grpc.stub.ServerCalls.asyncServerStreamingCall( + new MethodHandlers< + com.google.showcase.v1beta1.StreamBlurbsRequest, + com.google.showcase.v1beta1.StreamBlurbsResponse>( + service, METHODID_STREAM_BLURBS))) + .addMethod( + getSendBlurbsMethod(), + io.grpc.stub.ServerCalls.asyncClientStreamingCall( + new MethodHandlers< + com.google.showcase.v1beta1.CreateBlurbRequest, + com.google.showcase.v1beta1.SendBlurbsResponse>(service, METHODID_SEND_BLURBS))) + .addMethod( + getConnectMethod(), + io.grpc.stub.ServerCalls.asyncBidiStreamingCall( + new MethodHandlers< + com.google.showcase.v1beta1.ConnectRequest, + com.google.showcase.v1beta1.StreamBlurbsResponse>(service, METHODID_CONNECT))) + .build(); + } + + private abstract static class MessagingBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoFileDescriptorSupplier, + io.grpc.protobuf.ProtoServiceDescriptorSupplier { + MessagingBaseDescriptorSupplier() {} + + @java.lang.Override + public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() { + return com.google.showcase.v1beta1.MessagingOuterClass.getDescriptor(); + } + + @java.lang.Override + public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() { + return getFileDescriptor().findServiceByName("Messaging"); + } + } + + private static final class MessagingFileDescriptorSupplier + extends MessagingBaseDescriptorSupplier { + MessagingFileDescriptorSupplier() {} + } + + private static final class MessagingMethodDescriptorSupplier + extends MessagingBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoMethodDescriptorSupplier { + private final java.lang.String methodName; + + MessagingMethodDescriptorSupplier(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 (MessagingGrpc.class) { + result = serviceDescriptor; + if (result == null) { + serviceDescriptor = + result = + io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME) + .setSchemaDescriptor(new MessagingFileDescriptorSupplier()) + .addMethod(getCreateRoomMethod()) + .addMethod(getGetRoomMethod()) + .addMethod(getUpdateRoomMethod()) + .addMethod(getDeleteRoomMethod()) + .addMethod(getListRoomsMethod()) + .addMethod(getCreateBlurbMethod()) + .addMethod(getGetBlurbMethod()) + .addMethod(getUpdateBlurbMethod()) + .addMethod(getDeleteBlurbMethod()) + .addMethod(getListBlurbsMethod()) + .addMethod(getSearchBlurbsMethod()) + .addMethod(getStreamBlurbsMethod()) + .addMethod(getSendBlurbsMethod()) + .addMethod(getConnectMethod()) + .build(); + } + } + } + return result; + } +} diff --git a/java-showcase-3.25.8/grpc-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/SequenceServiceGrpc.java b/java-showcase-3.25.8/grpc-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/SequenceServiceGrpc.java new file mode 100644 index 0000000000..7172cf958f --- /dev/null +++ b/java-showcase-3.25.8/grpc-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/SequenceServiceGrpc.java @@ -0,0 +1,1045 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.showcase.v1beta1; + +import static io.grpc.MethodDescriptor.generateFullMethodName; + +/** */ +@io.grpc.stub.annotations.GrpcGenerated +public final class SequenceServiceGrpc { + + private SequenceServiceGrpc() {} + + public static final java.lang.String SERVICE_NAME = "google.showcase.v1beta1.SequenceService"; + + // Static method descriptors that strictly reflect the proto. + private static volatile io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.CreateSequenceRequest, com.google.showcase.v1beta1.Sequence> + getCreateSequenceMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "CreateSequence", + requestType = com.google.showcase.v1beta1.CreateSequenceRequest.class, + responseType = com.google.showcase.v1beta1.Sequence.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.CreateSequenceRequest, com.google.showcase.v1beta1.Sequence> + getCreateSequenceMethod() { + io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.CreateSequenceRequest, com.google.showcase.v1beta1.Sequence> + getCreateSequenceMethod; + if ((getCreateSequenceMethod = SequenceServiceGrpc.getCreateSequenceMethod) == null) { + synchronized (SequenceServiceGrpc.class) { + if ((getCreateSequenceMethod = SequenceServiceGrpc.getCreateSequenceMethod) == null) { + SequenceServiceGrpc.getCreateSequenceMethod = + getCreateSequenceMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "CreateSequence")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.CreateSequenceRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.Sequence.getDefaultInstance())) + .setSchemaDescriptor( + new SequenceServiceMethodDescriptorSupplier("CreateSequence")) + .build(); + } + } + } + return getCreateSequenceMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.CreateStreamingSequenceRequest, + com.google.showcase.v1beta1.StreamingSequence> + getCreateStreamingSequenceMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "CreateStreamingSequence", + requestType = com.google.showcase.v1beta1.CreateStreamingSequenceRequest.class, + responseType = com.google.showcase.v1beta1.StreamingSequence.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.CreateStreamingSequenceRequest, + com.google.showcase.v1beta1.StreamingSequence> + getCreateStreamingSequenceMethod() { + io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.CreateStreamingSequenceRequest, + com.google.showcase.v1beta1.StreamingSequence> + getCreateStreamingSequenceMethod; + if ((getCreateStreamingSequenceMethod = SequenceServiceGrpc.getCreateStreamingSequenceMethod) + == null) { + synchronized (SequenceServiceGrpc.class) { + if ((getCreateStreamingSequenceMethod = + SequenceServiceGrpc.getCreateStreamingSequenceMethod) + == null) { + SequenceServiceGrpc.getCreateStreamingSequenceMethod = + getCreateStreamingSequenceMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName(SERVICE_NAME, "CreateStreamingSequence")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.CreateStreamingSequenceRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.StreamingSequence.getDefaultInstance())) + .setSchemaDescriptor( + new SequenceServiceMethodDescriptorSupplier("CreateStreamingSequence")) + .build(); + } + } + } + return getCreateStreamingSequenceMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.GetSequenceReportRequest, + com.google.showcase.v1beta1.SequenceReport> + getGetSequenceReportMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "GetSequenceReport", + requestType = com.google.showcase.v1beta1.GetSequenceReportRequest.class, + responseType = com.google.showcase.v1beta1.SequenceReport.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.GetSequenceReportRequest, + com.google.showcase.v1beta1.SequenceReport> + getGetSequenceReportMethod() { + io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.GetSequenceReportRequest, + com.google.showcase.v1beta1.SequenceReport> + getGetSequenceReportMethod; + if ((getGetSequenceReportMethod = SequenceServiceGrpc.getGetSequenceReportMethod) == null) { + synchronized (SequenceServiceGrpc.class) { + if ((getGetSequenceReportMethod = SequenceServiceGrpc.getGetSequenceReportMethod) == null) { + SequenceServiceGrpc.getGetSequenceReportMethod = + getGetSequenceReportMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetSequenceReport")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.GetSequenceReportRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.SequenceReport.getDefaultInstance())) + .setSchemaDescriptor( + new SequenceServiceMethodDescriptorSupplier("GetSequenceReport")) + .build(); + } + } + } + return getGetSequenceReportMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.GetStreamingSequenceReportRequest, + com.google.showcase.v1beta1.StreamingSequenceReport> + getGetStreamingSequenceReportMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "GetStreamingSequenceReport", + requestType = com.google.showcase.v1beta1.GetStreamingSequenceReportRequest.class, + responseType = com.google.showcase.v1beta1.StreamingSequenceReport.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.GetStreamingSequenceReportRequest, + com.google.showcase.v1beta1.StreamingSequenceReport> + getGetStreamingSequenceReportMethod() { + io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.GetStreamingSequenceReportRequest, + com.google.showcase.v1beta1.StreamingSequenceReport> + getGetStreamingSequenceReportMethod; + if ((getGetStreamingSequenceReportMethod = + SequenceServiceGrpc.getGetStreamingSequenceReportMethod) + == null) { + synchronized (SequenceServiceGrpc.class) { + if ((getGetStreamingSequenceReportMethod = + SequenceServiceGrpc.getGetStreamingSequenceReportMethod) + == null) { + SequenceServiceGrpc.getGetStreamingSequenceReportMethod = + getGetStreamingSequenceReportMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName(SERVICE_NAME, "GetStreamingSequenceReport")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.GetStreamingSequenceReportRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.StreamingSequenceReport + .getDefaultInstance())) + .setSchemaDescriptor( + new SequenceServiceMethodDescriptorSupplier("GetStreamingSequenceReport")) + .build(); + } + } + } + return getGetStreamingSequenceReportMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.AttemptSequenceRequest, com.google.protobuf.Empty> + getAttemptSequenceMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "AttemptSequence", + requestType = com.google.showcase.v1beta1.AttemptSequenceRequest.class, + responseType = com.google.protobuf.Empty.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.AttemptSequenceRequest, com.google.protobuf.Empty> + getAttemptSequenceMethod() { + io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.AttemptSequenceRequest, com.google.protobuf.Empty> + getAttemptSequenceMethod; + if ((getAttemptSequenceMethod = SequenceServiceGrpc.getAttemptSequenceMethod) == null) { + synchronized (SequenceServiceGrpc.class) { + if ((getAttemptSequenceMethod = SequenceServiceGrpc.getAttemptSequenceMethod) == null) { + SequenceServiceGrpc.getAttemptSequenceMethod = + getAttemptSequenceMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "AttemptSequence")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.AttemptSequenceRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.protobuf.Empty.getDefaultInstance())) + .setSchemaDescriptor( + new SequenceServiceMethodDescriptorSupplier("AttemptSequence")) + .build(); + } + } + } + return getAttemptSequenceMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.AttemptStreamingSequenceRequest, + com.google.showcase.v1beta1.AttemptStreamingSequenceResponse> + getAttemptStreamingSequenceMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "AttemptStreamingSequence", + requestType = com.google.showcase.v1beta1.AttemptStreamingSequenceRequest.class, + responseType = com.google.showcase.v1beta1.AttemptStreamingSequenceResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.SERVER_STREAMING) + public static io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.AttemptStreamingSequenceRequest, + com.google.showcase.v1beta1.AttemptStreamingSequenceResponse> + getAttemptStreamingSequenceMethod() { + io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.AttemptStreamingSequenceRequest, + com.google.showcase.v1beta1.AttemptStreamingSequenceResponse> + getAttemptStreamingSequenceMethod; + if ((getAttemptStreamingSequenceMethod = SequenceServiceGrpc.getAttemptStreamingSequenceMethod) + == null) { + synchronized (SequenceServiceGrpc.class) { + if ((getAttemptStreamingSequenceMethod = + SequenceServiceGrpc.getAttemptStreamingSequenceMethod) + == null) { + SequenceServiceGrpc.getAttemptStreamingSequenceMethod = + getAttemptStreamingSequenceMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.SERVER_STREAMING) + .setFullMethodName( + generateFullMethodName(SERVICE_NAME, "AttemptStreamingSequence")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.AttemptStreamingSequenceRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.AttemptStreamingSequenceResponse + .getDefaultInstance())) + .setSchemaDescriptor( + new SequenceServiceMethodDescriptorSupplier("AttemptStreamingSequence")) + .build(); + } + } + } + return getAttemptStreamingSequenceMethod; + } + + /** Creates a new async stub that supports all call types for the service */ + public static SequenceServiceStub newStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public SequenceServiceStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new SequenceServiceStub(channel, callOptions); + } + }; + return SequenceServiceStub.newStub(factory, channel); + } + + /** Creates a new blocking-style stub that supports all types of calls on the service */ + public static SequenceServiceBlockingV2Stub newBlockingV2Stub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public SequenceServiceBlockingV2Stub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new SequenceServiceBlockingV2Stub(channel, callOptions); + } + }; + return SequenceServiceBlockingV2Stub.newStub(factory, channel); + } + + /** + * Creates a new blocking-style stub that supports unary and streaming output calls on the service + */ + public static SequenceServiceBlockingStub newBlockingStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public SequenceServiceBlockingStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new SequenceServiceBlockingStub(channel, callOptions); + } + }; + return SequenceServiceBlockingStub.newStub(factory, channel); + } + + /** Creates a new ListenableFuture-style stub that supports unary calls on the service */ + public static SequenceServiceFutureStub newFutureStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public SequenceServiceFutureStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new SequenceServiceFutureStub(channel, callOptions); + } + }; + return SequenceServiceFutureStub.newStub(factory, channel); + } + + /** */ + public interface AsyncService { + + /** + * + * + *
        +     * Creates a sequence.
        +     * 
        + */ + default void createSequence( + com.google.showcase.v1beta1.CreateSequenceRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getCreateSequenceMethod(), responseObserver); + } + + /** + * + * + *
        +     * Creates a sequence.
        +     * 
        + */ + default void createStreamingSequence( + com.google.showcase.v1beta1.CreateStreamingSequenceRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getCreateStreamingSequenceMethod(), responseObserver); + } + + /** + * + * + *
        +     * Retrieves a sequence.
        +     * 
        + */ + default void getSequenceReport( + com.google.showcase.v1beta1.GetSequenceReportRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getGetSequenceReportMethod(), responseObserver); + } + + /** + * + * + *
        +     * Retrieves a sequence.
        +     * 
        + */ + default void getStreamingSequenceReport( + com.google.showcase.v1beta1.GetStreamingSequenceReportRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getGetStreamingSequenceReportMethod(), responseObserver); + } + + /** + * + * + *
        +     * Attempts a sequence.
        +     * 
        + */ + default void attemptSequence( + com.google.showcase.v1beta1.AttemptSequenceRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getAttemptSequenceMethod(), responseObserver); + } + + /** + * + * + *
        +     * Attempts a streaming sequence.
        +     * May not function as expected in HTTP mode due to when http statuses are sent
        +     * See https://github.com/googleapis/gapic-showcase/issues/1377 for more details
        +     * 
        + */ + default void attemptStreamingSequence( + com.google.showcase.v1beta1.AttemptStreamingSequenceRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getAttemptStreamingSequenceMethod(), responseObserver); + } + } + + /** Base class for the server implementation of the service SequenceService. */ + public abstract static class SequenceServiceImplBase + implements io.grpc.BindableService, AsyncService { + + @java.lang.Override + public final io.grpc.ServerServiceDefinition bindService() { + return SequenceServiceGrpc.bindService(this); + } + } + + /** A stub to allow clients to do asynchronous rpc calls to service SequenceService. */ + public static final class SequenceServiceStub + extends io.grpc.stub.AbstractAsyncStub { + private SequenceServiceStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected SequenceServiceStub build(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new SequenceServiceStub(channel, callOptions); + } + + /** + * + * + *
        +     * Creates a sequence.
        +     * 
        + */ + public void createSequence( + com.google.showcase.v1beta1.CreateSequenceRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getCreateSequenceMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
        +     * Creates a sequence.
        +     * 
        + */ + public void createStreamingSequence( + com.google.showcase.v1beta1.CreateStreamingSequenceRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getCreateStreamingSequenceMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
        +     * Retrieves a sequence.
        +     * 
        + */ + public void getSequenceReport( + com.google.showcase.v1beta1.GetSequenceReportRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getGetSequenceReportMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
        +     * Retrieves a sequence.
        +     * 
        + */ + public void getStreamingSequenceReport( + com.google.showcase.v1beta1.GetStreamingSequenceReportRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getGetStreamingSequenceReportMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
        +     * Attempts a sequence.
        +     * 
        + */ + public void attemptSequence( + com.google.showcase.v1beta1.AttemptSequenceRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getAttemptSequenceMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
        +     * Attempts a streaming sequence.
        +     * May not function as expected in HTTP mode due to when http statuses are sent
        +     * See https://github.com/googleapis/gapic-showcase/issues/1377 for more details
        +     * 
        + */ + public void attemptStreamingSequence( + com.google.showcase.v1beta1.AttemptStreamingSequenceRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncServerStreamingCall( + getChannel().newCall(getAttemptStreamingSequenceMethod(), getCallOptions()), + request, + responseObserver); + } + } + + /** A stub to allow clients to do synchronous rpc calls to service SequenceService. */ + public static final class SequenceServiceBlockingV2Stub + extends io.grpc.stub.AbstractBlockingStub { + private SequenceServiceBlockingV2Stub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected SequenceServiceBlockingV2Stub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new SequenceServiceBlockingV2Stub(channel, callOptions); + } + + /** + * + * + *
        +     * Creates a sequence.
        +     * 
        + */ + public com.google.showcase.v1beta1.Sequence createSequence( + com.google.showcase.v1beta1.CreateSequenceRequest request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getCreateSequenceMethod(), getCallOptions(), request); + } + + /** + * + * + *
        +     * Creates a sequence.
        +     * 
        + */ + public com.google.showcase.v1beta1.StreamingSequence createStreamingSequence( + com.google.showcase.v1beta1.CreateStreamingSequenceRequest request) + throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getCreateStreamingSequenceMethod(), getCallOptions(), request); + } + + /** + * + * + *
        +     * Retrieves a sequence.
        +     * 
        + */ + public com.google.showcase.v1beta1.SequenceReport getSequenceReport( + com.google.showcase.v1beta1.GetSequenceReportRequest request) + throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getGetSequenceReportMethod(), getCallOptions(), request); + } + + /** + * + * + *
        +     * Retrieves a sequence.
        +     * 
        + */ + public com.google.showcase.v1beta1.StreamingSequenceReport getStreamingSequenceReport( + com.google.showcase.v1beta1.GetStreamingSequenceReportRequest request) + throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getGetStreamingSequenceReportMethod(), getCallOptions(), request); + } + + /** + * + * + *
        +     * Attempts a sequence.
        +     * 
        + */ + public com.google.protobuf.Empty attemptSequence( + com.google.showcase.v1beta1.AttemptSequenceRequest request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getAttemptSequenceMethod(), getCallOptions(), request); + } + + /** + * + * + *
        +     * Attempts a streaming sequence.
        +     * May not function as expected in HTTP mode due to when http statuses are sent
        +     * See https://github.com/googleapis/gapic-showcase/issues/1377 for more details
        +     * 
        + */ + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/10918") + public io.grpc.stub.BlockingClientCall< + ?, com.google.showcase.v1beta1.AttemptStreamingSequenceResponse> + attemptStreamingSequence( + com.google.showcase.v1beta1.AttemptStreamingSequenceRequest request) { + return io.grpc.stub.ClientCalls.blockingV2ServerStreamingCall( + getChannel(), getAttemptStreamingSequenceMethod(), getCallOptions(), request); + } + } + + /** A stub to allow clients to do limited synchronous rpc calls to service SequenceService. */ + public static final class SequenceServiceBlockingStub + extends io.grpc.stub.AbstractBlockingStub { + private SequenceServiceBlockingStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected SequenceServiceBlockingStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new SequenceServiceBlockingStub(channel, callOptions); + } + + /** + * + * + *
        +     * Creates a sequence.
        +     * 
        + */ + public com.google.showcase.v1beta1.Sequence createSequence( + com.google.showcase.v1beta1.CreateSequenceRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getCreateSequenceMethod(), getCallOptions(), request); + } + + /** + * + * + *
        +     * Creates a sequence.
        +     * 
        + */ + public com.google.showcase.v1beta1.StreamingSequence createStreamingSequence( + com.google.showcase.v1beta1.CreateStreamingSequenceRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getCreateStreamingSequenceMethod(), getCallOptions(), request); + } + + /** + * + * + *
        +     * Retrieves a sequence.
        +     * 
        + */ + public com.google.showcase.v1beta1.SequenceReport getSequenceReport( + com.google.showcase.v1beta1.GetSequenceReportRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getGetSequenceReportMethod(), getCallOptions(), request); + } + + /** + * + * + *
        +     * Retrieves a sequence.
        +     * 
        + */ + public com.google.showcase.v1beta1.StreamingSequenceReport getStreamingSequenceReport( + com.google.showcase.v1beta1.GetStreamingSequenceReportRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getGetStreamingSequenceReportMethod(), getCallOptions(), request); + } + + /** + * + * + *
        +     * Attempts a sequence.
        +     * 
        + */ + public com.google.protobuf.Empty attemptSequence( + com.google.showcase.v1beta1.AttemptSequenceRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getAttemptSequenceMethod(), getCallOptions(), request); + } + + /** + * + * + *
        +     * Attempts a streaming sequence.
        +     * May not function as expected in HTTP mode due to when http statuses are sent
        +     * See https://github.com/googleapis/gapic-showcase/issues/1377 for more details
        +     * 
        + */ + public java.util.Iterator + attemptStreamingSequence( + com.google.showcase.v1beta1.AttemptStreamingSequenceRequest request) { + return io.grpc.stub.ClientCalls.blockingServerStreamingCall( + getChannel(), getAttemptStreamingSequenceMethod(), getCallOptions(), request); + } + } + + /** A stub to allow clients to do ListenableFuture-style rpc calls to service SequenceService. */ + public static final class SequenceServiceFutureStub + extends io.grpc.stub.AbstractFutureStub { + private SequenceServiceFutureStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected SequenceServiceFutureStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new SequenceServiceFutureStub(channel, callOptions); + } + + /** + * + * + *
        +     * Creates a sequence.
        +     * 
        + */ + public com.google.common.util.concurrent.ListenableFuture + createSequence(com.google.showcase.v1beta1.CreateSequenceRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getCreateSequenceMethod(), getCallOptions()), request); + } + + /** + * + * + *
        +     * Creates a sequence.
        +     * 
        + */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.showcase.v1beta1.StreamingSequence> + createStreamingSequence( + com.google.showcase.v1beta1.CreateStreamingSequenceRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getCreateStreamingSequenceMethod(), getCallOptions()), request); + } + + /** + * + * + *
        +     * Retrieves a sequence.
        +     * 
        + */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.showcase.v1beta1.SequenceReport> + getSequenceReport(com.google.showcase.v1beta1.GetSequenceReportRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getGetSequenceReportMethod(), getCallOptions()), request); + } + + /** + * + * + *
        +     * Retrieves a sequence.
        +     * 
        + */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.showcase.v1beta1.StreamingSequenceReport> + getStreamingSequenceReport( + com.google.showcase.v1beta1.GetStreamingSequenceReportRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getGetStreamingSequenceReportMethod(), getCallOptions()), request); + } + + /** + * + * + *
        +     * Attempts a sequence.
        +     * 
        + */ + public com.google.common.util.concurrent.ListenableFuture + attemptSequence(com.google.showcase.v1beta1.AttemptSequenceRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getAttemptSequenceMethod(), getCallOptions()), request); + } + } + + private static final int METHODID_CREATE_SEQUENCE = 0; + private static final int METHODID_CREATE_STREAMING_SEQUENCE = 1; + private static final int METHODID_GET_SEQUENCE_REPORT = 2; + private static final int METHODID_GET_STREAMING_SEQUENCE_REPORT = 3; + private static final int METHODID_ATTEMPT_SEQUENCE = 4; + private static final int METHODID_ATTEMPT_STREAMING_SEQUENCE = 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_CREATE_SEQUENCE: + serviceImpl.createSequence( + (com.google.showcase.v1beta1.CreateSequenceRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_CREATE_STREAMING_SEQUENCE: + serviceImpl.createStreamingSequence( + (com.google.showcase.v1beta1.CreateStreamingSequenceRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_GET_SEQUENCE_REPORT: + serviceImpl.getSequenceReport( + (com.google.showcase.v1beta1.GetSequenceReportRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_GET_STREAMING_SEQUENCE_REPORT: + serviceImpl.getStreamingSequenceReport( + (com.google.showcase.v1beta1.GetStreamingSequenceReportRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_ATTEMPT_SEQUENCE: + serviceImpl.attemptSequence( + (com.google.showcase.v1beta1.AttemptSequenceRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_ATTEMPT_STREAMING_SEQUENCE: + serviceImpl.attemptStreamingSequence( + (com.google.showcase.v1beta1.AttemptStreamingSequenceRequest) request, + (io.grpc.stub.StreamObserver< + com.google.showcase.v1beta1.AttemptStreamingSequenceResponse>) + 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( + getCreateSequenceMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.showcase.v1beta1.CreateSequenceRequest, + com.google.showcase.v1beta1.Sequence>(service, METHODID_CREATE_SEQUENCE))) + .addMethod( + getCreateStreamingSequenceMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.showcase.v1beta1.CreateStreamingSequenceRequest, + com.google.showcase.v1beta1.StreamingSequence>( + service, METHODID_CREATE_STREAMING_SEQUENCE))) + .addMethod( + getGetSequenceReportMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.showcase.v1beta1.GetSequenceReportRequest, + com.google.showcase.v1beta1.SequenceReport>( + service, METHODID_GET_SEQUENCE_REPORT))) + .addMethod( + getGetStreamingSequenceReportMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.showcase.v1beta1.GetStreamingSequenceReportRequest, + com.google.showcase.v1beta1.StreamingSequenceReport>( + service, METHODID_GET_STREAMING_SEQUENCE_REPORT))) + .addMethod( + getAttemptSequenceMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.showcase.v1beta1.AttemptSequenceRequest, com.google.protobuf.Empty>( + service, METHODID_ATTEMPT_SEQUENCE))) + .addMethod( + getAttemptStreamingSequenceMethod(), + io.grpc.stub.ServerCalls.asyncServerStreamingCall( + new MethodHandlers< + com.google.showcase.v1beta1.AttemptStreamingSequenceRequest, + com.google.showcase.v1beta1.AttemptStreamingSequenceResponse>( + service, METHODID_ATTEMPT_STREAMING_SEQUENCE))) + .build(); + } + + private abstract static class SequenceServiceBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoFileDescriptorSupplier, + io.grpc.protobuf.ProtoServiceDescriptorSupplier { + SequenceServiceBaseDescriptorSupplier() {} + + @java.lang.Override + public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() { + return com.google.showcase.v1beta1.SequenceOuterClass.getDescriptor(); + } + + @java.lang.Override + public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() { + return getFileDescriptor().findServiceByName("SequenceService"); + } + } + + private static final class SequenceServiceFileDescriptorSupplier + extends SequenceServiceBaseDescriptorSupplier { + SequenceServiceFileDescriptorSupplier() {} + } + + private static final class SequenceServiceMethodDescriptorSupplier + extends SequenceServiceBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoMethodDescriptorSupplier { + private final java.lang.String methodName; + + SequenceServiceMethodDescriptorSupplier(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 (SequenceServiceGrpc.class) { + result = serviceDescriptor; + if (result == null) { + serviceDescriptor = + result = + io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME) + .setSchemaDescriptor(new SequenceServiceFileDescriptorSupplier()) + .addMethod(getCreateSequenceMethod()) + .addMethod(getCreateStreamingSequenceMethod()) + .addMethod(getGetSequenceReportMethod()) + .addMethod(getGetStreamingSequenceReportMethod()) + .addMethod(getAttemptSequenceMethod()) + .addMethod(getAttemptStreamingSequenceMethod()) + .build(); + } + } + } + return result; + } +} diff --git a/java-showcase-3.25.8/grpc-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/TestingGrpc.java b/java-showcase-3.25.8/grpc-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/TestingGrpc.java new file mode 100644 index 0000000000..36f60a584b --- /dev/null +++ b/java-showcase-3.25.8/grpc-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/TestingGrpc.java @@ -0,0 +1,1363 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.showcase.v1beta1; + +import static io.grpc.MethodDescriptor.generateFullMethodName; + +/** + * + * + *
        + * A service to facilitate running discrete sets of tests
        + * against Showcase.
        + * Adding this comment with special characters for comment formatting tests:
        + * 1. (abra->kadabra->alakazam)
        + * 2) [Nonsense][]: `pokemon/*/psychic/*`
        + * 
        + */ +@io.grpc.stub.annotations.GrpcGenerated +public final class TestingGrpc { + + private TestingGrpc() {} + + public static final java.lang.String SERVICE_NAME = "google.showcase.v1beta1.Testing"; + + // Static method descriptors that strictly reflect the proto. + private static volatile io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.CreateSessionRequest, com.google.showcase.v1beta1.Session> + getCreateSessionMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "CreateSession", + requestType = com.google.showcase.v1beta1.CreateSessionRequest.class, + responseType = com.google.showcase.v1beta1.Session.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.CreateSessionRequest, com.google.showcase.v1beta1.Session> + getCreateSessionMethod() { + io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.CreateSessionRequest, com.google.showcase.v1beta1.Session> + getCreateSessionMethod; + if ((getCreateSessionMethod = TestingGrpc.getCreateSessionMethod) == null) { + synchronized (TestingGrpc.class) { + if ((getCreateSessionMethod = TestingGrpc.getCreateSessionMethod) == null) { + TestingGrpc.getCreateSessionMethod = + getCreateSessionMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "CreateSession")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.CreateSessionRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.Session.getDefaultInstance())) + .setSchemaDescriptor(new TestingMethodDescriptorSupplier("CreateSession")) + .build(); + } + } + } + return getCreateSessionMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.GetSessionRequest, com.google.showcase.v1beta1.Session> + getGetSessionMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "GetSession", + requestType = com.google.showcase.v1beta1.GetSessionRequest.class, + responseType = com.google.showcase.v1beta1.Session.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.GetSessionRequest, com.google.showcase.v1beta1.Session> + getGetSessionMethod() { + io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.GetSessionRequest, com.google.showcase.v1beta1.Session> + getGetSessionMethod; + if ((getGetSessionMethod = TestingGrpc.getGetSessionMethod) == null) { + synchronized (TestingGrpc.class) { + if ((getGetSessionMethod = TestingGrpc.getGetSessionMethod) == null) { + TestingGrpc.getGetSessionMethod = + getGetSessionMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetSession")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.GetSessionRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.Session.getDefaultInstance())) + .setSchemaDescriptor(new TestingMethodDescriptorSupplier("GetSession")) + .build(); + } + } + } + return getGetSessionMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.ListSessionsRequest, + com.google.showcase.v1beta1.ListSessionsResponse> + getListSessionsMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "ListSessions", + requestType = com.google.showcase.v1beta1.ListSessionsRequest.class, + responseType = com.google.showcase.v1beta1.ListSessionsResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.ListSessionsRequest, + com.google.showcase.v1beta1.ListSessionsResponse> + getListSessionsMethod() { + io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.ListSessionsRequest, + com.google.showcase.v1beta1.ListSessionsResponse> + getListSessionsMethod; + if ((getListSessionsMethod = TestingGrpc.getListSessionsMethod) == null) { + synchronized (TestingGrpc.class) { + if ((getListSessionsMethod = TestingGrpc.getListSessionsMethod) == null) { + TestingGrpc.getListSessionsMethod = + getListSessionsMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "ListSessions")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.ListSessionsRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.ListSessionsResponse + .getDefaultInstance())) + .setSchemaDescriptor(new TestingMethodDescriptorSupplier("ListSessions")) + .build(); + } + } + } + return getListSessionsMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.DeleteSessionRequest, com.google.protobuf.Empty> + getDeleteSessionMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "DeleteSession", + requestType = com.google.showcase.v1beta1.DeleteSessionRequest.class, + responseType = com.google.protobuf.Empty.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.DeleteSessionRequest, com.google.protobuf.Empty> + getDeleteSessionMethod() { + io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.DeleteSessionRequest, com.google.protobuf.Empty> + getDeleteSessionMethod; + if ((getDeleteSessionMethod = TestingGrpc.getDeleteSessionMethod) == null) { + synchronized (TestingGrpc.class) { + if ((getDeleteSessionMethod = TestingGrpc.getDeleteSessionMethod) == null) { + TestingGrpc.getDeleteSessionMethod = + getDeleteSessionMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "DeleteSession")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.DeleteSessionRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.protobuf.Empty.getDefaultInstance())) + .setSchemaDescriptor(new TestingMethodDescriptorSupplier("DeleteSession")) + .build(); + } + } + } + return getDeleteSessionMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.ReportSessionRequest, + com.google.showcase.v1beta1.ReportSessionResponse> + getReportSessionMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "ReportSession", + requestType = com.google.showcase.v1beta1.ReportSessionRequest.class, + responseType = com.google.showcase.v1beta1.ReportSessionResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.ReportSessionRequest, + com.google.showcase.v1beta1.ReportSessionResponse> + getReportSessionMethod() { + io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.ReportSessionRequest, + com.google.showcase.v1beta1.ReportSessionResponse> + getReportSessionMethod; + if ((getReportSessionMethod = TestingGrpc.getReportSessionMethod) == null) { + synchronized (TestingGrpc.class) { + if ((getReportSessionMethod = TestingGrpc.getReportSessionMethod) == null) { + TestingGrpc.getReportSessionMethod = + getReportSessionMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "ReportSession")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.ReportSessionRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.ReportSessionResponse + .getDefaultInstance())) + .setSchemaDescriptor(new TestingMethodDescriptorSupplier("ReportSession")) + .build(); + } + } + } + return getReportSessionMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.ListTestsRequest, + com.google.showcase.v1beta1.ListTestsResponse> + getListTestsMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "ListTests", + requestType = com.google.showcase.v1beta1.ListTestsRequest.class, + responseType = com.google.showcase.v1beta1.ListTestsResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.ListTestsRequest, + com.google.showcase.v1beta1.ListTestsResponse> + getListTestsMethod() { + io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.ListTestsRequest, + com.google.showcase.v1beta1.ListTestsResponse> + getListTestsMethod; + if ((getListTestsMethod = TestingGrpc.getListTestsMethod) == null) { + synchronized (TestingGrpc.class) { + if ((getListTestsMethod = TestingGrpc.getListTestsMethod) == null) { + TestingGrpc.getListTestsMethod = + getListTestsMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "ListTests")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.ListTestsRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.ListTestsResponse.getDefaultInstance())) + .setSchemaDescriptor(new TestingMethodDescriptorSupplier("ListTests")) + .build(); + } + } + } + return getListTestsMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.DeleteTestRequest, com.google.protobuf.Empty> + getDeleteTestMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "DeleteTest", + requestType = com.google.showcase.v1beta1.DeleteTestRequest.class, + responseType = com.google.protobuf.Empty.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.DeleteTestRequest, com.google.protobuf.Empty> + getDeleteTestMethod() { + io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.DeleteTestRequest, com.google.protobuf.Empty> + getDeleteTestMethod; + if ((getDeleteTestMethod = TestingGrpc.getDeleteTestMethod) == null) { + synchronized (TestingGrpc.class) { + if ((getDeleteTestMethod = TestingGrpc.getDeleteTestMethod) == null) { + TestingGrpc.getDeleteTestMethod = + getDeleteTestMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "DeleteTest")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.DeleteTestRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.protobuf.Empty.getDefaultInstance())) + .setSchemaDescriptor(new TestingMethodDescriptorSupplier("DeleteTest")) + .build(); + } + } + } + return getDeleteTestMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.VerifyTestRequest, + com.google.showcase.v1beta1.VerifyTestResponse> + getVerifyTestMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "VerifyTest", + requestType = com.google.showcase.v1beta1.VerifyTestRequest.class, + responseType = com.google.showcase.v1beta1.VerifyTestResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.VerifyTestRequest, + com.google.showcase.v1beta1.VerifyTestResponse> + getVerifyTestMethod() { + io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.VerifyTestRequest, + com.google.showcase.v1beta1.VerifyTestResponse> + getVerifyTestMethod; + if ((getVerifyTestMethod = TestingGrpc.getVerifyTestMethod) == null) { + synchronized (TestingGrpc.class) { + if ((getVerifyTestMethod = TestingGrpc.getVerifyTestMethod) == null) { + TestingGrpc.getVerifyTestMethod = + getVerifyTestMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "VerifyTest")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.VerifyTestRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.VerifyTestResponse.getDefaultInstance())) + .setSchemaDescriptor(new TestingMethodDescriptorSupplier("VerifyTest")) + .build(); + } + } + } + return getVerifyTestMethod; + } + + /** Creates a new async stub that supports all call types for the service */ + public static TestingStub newStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public TestingStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new TestingStub(channel, callOptions); + } + }; + return TestingStub.newStub(factory, channel); + } + + /** Creates a new blocking-style stub that supports all types of calls on the service */ + public static TestingBlockingV2Stub newBlockingV2Stub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public TestingBlockingV2Stub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new TestingBlockingV2Stub(channel, callOptions); + } + }; + return TestingBlockingV2Stub.newStub(factory, channel); + } + + /** + * Creates a new blocking-style stub that supports unary and streaming output calls on the service + */ + public static TestingBlockingStub newBlockingStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public TestingBlockingStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new TestingBlockingStub(channel, callOptions); + } + }; + return TestingBlockingStub.newStub(factory, channel); + } + + /** Creates a new ListenableFuture-style stub that supports unary calls on the service */ + public static TestingFutureStub newFutureStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public TestingFutureStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new TestingFutureStub(channel, callOptions); + } + }; + return TestingFutureStub.newStub(factory, channel); + } + + /** + * + * + *
        +   * A service to facilitate running discrete sets of tests
        +   * against Showcase.
        +   * Adding this comment with special characters for comment formatting tests:
        +   * 1. (abra->kadabra->alakazam)
        +   * 2) [Nonsense][]: `pokemon/*/psychic/*`
        +   * 
        + */ + public interface AsyncService { + + /** + * + * + *
        +     * Creates a new testing session.
        +     * Adding this comment with special characters for comment formatting tests:
        +     * 1. (abra->kadabra->alakazam)
        +     * 2) [Nonsense][]: `pokemon/*/psychic/*`
        +     * 
        + */ + default void createSession( + com.google.showcase.v1beta1.CreateSessionRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getCreateSessionMethod(), responseObserver); + } + + /** + * + * + *
        +     * Gets a testing session.
        +     * 
        + */ + default void getSession( + com.google.showcase.v1beta1.GetSessionRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getGetSessionMethod(), responseObserver); + } + + /** + * + * + *
        +     * Lists the current test sessions.
        +     * 
        + */ + default void listSessions( + com.google.showcase.v1beta1.ListSessionsRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getListSessionsMethod(), responseObserver); + } + + /** + * + * + *
        +     * Delete a test session.
        +     * 
        + */ + default void deleteSession( + com.google.showcase.v1beta1.DeleteSessionRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getDeleteSessionMethod(), responseObserver); + } + + /** + * + * + *
        +     * Report on the status of a session.
        +     * This generates a report detailing which tests have been completed,
        +     * and an overall rollup.
        +     * 
        + */ + default void reportSession( + com.google.showcase.v1beta1.ReportSessionRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getReportSessionMethod(), responseObserver); + } + + /** + * + * + *
        +     * List the tests of a sessesion.
        +     * 
        + */ + default void listTests( + com.google.showcase.v1beta1.ListTestsRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getListTestsMethod(), responseObserver); + } + + /** + * + * + *
        +     * Explicitly decline to implement a test.
        +     * This removes the test from subsequent `ListTests` calls, and
        +     * attempting to do the test will error.
        +     * This method will error if attempting to delete a required test.
        +     * 
        + */ + default void deleteTest( + com.google.showcase.v1beta1.DeleteTestRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getDeleteTestMethod(), responseObserver); + } + + /** + * + * + *
        +     * Register a response to a test.
        +     * In cases where a test involves registering a final answer at the
        +     * end of the test, this method provides the means to do so.
        +     * 
        + */ + default void verifyTest( + com.google.showcase.v1beta1.VerifyTestRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getVerifyTestMethod(), responseObserver); + } + } + + /** + * Base class for the server implementation of the service Testing. + * + *
        +   * A service to facilitate running discrete sets of tests
        +   * against Showcase.
        +   * Adding this comment with special characters for comment formatting tests:
        +   * 1. (abra->kadabra->alakazam)
        +   * 2) [Nonsense][]: `pokemon/*/psychic/*`
        +   * 
        + */ + public abstract static class TestingImplBase implements io.grpc.BindableService, AsyncService { + + @java.lang.Override + public final io.grpc.ServerServiceDefinition bindService() { + return TestingGrpc.bindService(this); + } + } + + /** + * A stub to allow clients to do asynchronous rpc calls to service Testing. + * + *
        +   * A service to facilitate running discrete sets of tests
        +   * against Showcase.
        +   * Adding this comment with special characters for comment formatting tests:
        +   * 1. (abra->kadabra->alakazam)
        +   * 2) [Nonsense][]: `pokemon/*/psychic/*`
        +   * 
        + */ + public static final class TestingStub extends io.grpc.stub.AbstractAsyncStub { + private TestingStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected TestingStub build(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new TestingStub(channel, callOptions); + } + + /** + * + * + *
        +     * Creates a new testing session.
        +     * Adding this comment with special characters for comment formatting tests:
        +     * 1. (abra->kadabra->alakazam)
        +     * 2) [Nonsense][]: `pokemon/*/psychic/*`
        +     * 
        + */ + public void createSession( + com.google.showcase.v1beta1.CreateSessionRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getCreateSessionMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
        +     * Gets a testing session.
        +     * 
        + */ + public void getSession( + com.google.showcase.v1beta1.GetSessionRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getGetSessionMethod(), getCallOptions()), request, responseObserver); + } + + /** + * + * + *
        +     * Lists the current test sessions.
        +     * 
        + */ + public void listSessions( + com.google.showcase.v1beta1.ListSessionsRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getListSessionsMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
        +     * Delete a test session.
        +     * 
        + */ + public void deleteSession( + com.google.showcase.v1beta1.DeleteSessionRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getDeleteSessionMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
        +     * Report on the status of a session.
        +     * This generates a report detailing which tests have been completed,
        +     * and an overall rollup.
        +     * 
        + */ + public void reportSession( + com.google.showcase.v1beta1.ReportSessionRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getReportSessionMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
        +     * List the tests of a sessesion.
        +     * 
        + */ + public void listTests( + com.google.showcase.v1beta1.ListTestsRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getListTestsMethod(), getCallOptions()), request, responseObserver); + } + + /** + * + * + *
        +     * Explicitly decline to implement a test.
        +     * This removes the test from subsequent `ListTests` calls, and
        +     * attempting to do the test will error.
        +     * This method will error if attempting to delete a required test.
        +     * 
        + */ + public void deleteTest( + com.google.showcase.v1beta1.DeleteTestRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getDeleteTestMethod(), getCallOptions()), request, responseObserver); + } + + /** + * + * + *
        +     * Register a response to a test.
        +     * In cases where a test involves registering a final answer at the
        +     * end of the test, this method provides the means to do so.
        +     * 
        + */ + public void verifyTest( + com.google.showcase.v1beta1.VerifyTestRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getVerifyTestMethod(), getCallOptions()), request, responseObserver); + } + } + + /** + * A stub to allow clients to do synchronous rpc calls to service Testing. + * + *
        +   * A service to facilitate running discrete sets of tests
        +   * against Showcase.
        +   * Adding this comment with special characters for comment formatting tests:
        +   * 1. (abra->kadabra->alakazam)
        +   * 2) [Nonsense][]: `pokemon/*/psychic/*`
        +   * 
        + */ + public static final class TestingBlockingV2Stub + extends io.grpc.stub.AbstractBlockingStub { + private TestingBlockingV2Stub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected TestingBlockingV2Stub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new TestingBlockingV2Stub(channel, callOptions); + } + + /** + * + * + *
        +     * Creates a new testing session.
        +     * Adding this comment with special characters for comment formatting tests:
        +     * 1. (abra->kadabra->alakazam)
        +     * 2) [Nonsense][]: `pokemon/*/psychic/*`
        +     * 
        + */ + public com.google.showcase.v1beta1.Session createSession( + com.google.showcase.v1beta1.CreateSessionRequest request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getCreateSessionMethod(), getCallOptions(), request); + } + + /** + * + * + *
        +     * Gets a testing session.
        +     * 
        + */ + public com.google.showcase.v1beta1.Session getSession( + com.google.showcase.v1beta1.GetSessionRequest request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getGetSessionMethod(), getCallOptions(), request); + } + + /** + * + * + *
        +     * Lists the current test sessions.
        +     * 
        + */ + public com.google.showcase.v1beta1.ListSessionsResponse listSessions( + com.google.showcase.v1beta1.ListSessionsRequest request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getListSessionsMethod(), getCallOptions(), request); + } + + /** + * + * + *
        +     * Delete a test session.
        +     * 
        + */ + public com.google.protobuf.Empty deleteSession( + com.google.showcase.v1beta1.DeleteSessionRequest request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getDeleteSessionMethod(), getCallOptions(), request); + } + + /** + * + * + *
        +     * Report on the status of a session.
        +     * This generates a report detailing which tests have been completed,
        +     * and an overall rollup.
        +     * 
        + */ + public com.google.showcase.v1beta1.ReportSessionResponse reportSession( + com.google.showcase.v1beta1.ReportSessionRequest request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getReportSessionMethod(), getCallOptions(), request); + } + + /** + * + * + *
        +     * List the tests of a sessesion.
        +     * 
        + */ + public com.google.showcase.v1beta1.ListTestsResponse listTests( + com.google.showcase.v1beta1.ListTestsRequest request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getListTestsMethod(), getCallOptions(), request); + } + + /** + * + * + *
        +     * Explicitly decline to implement a test.
        +     * This removes the test from subsequent `ListTests` calls, and
        +     * attempting to do the test will error.
        +     * This method will error if attempting to delete a required test.
        +     * 
        + */ + public com.google.protobuf.Empty deleteTest( + com.google.showcase.v1beta1.DeleteTestRequest request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getDeleteTestMethod(), getCallOptions(), request); + } + + /** + * + * + *
        +     * Register a response to a test.
        +     * In cases where a test involves registering a final answer at the
        +     * end of the test, this method provides the means to do so.
        +     * 
        + */ + public com.google.showcase.v1beta1.VerifyTestResponse verifyTest( + com.google.showcase.v1beta1.VerifyTestRequest request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getVerifyTestMethod(), getCallOptions(), request); + } + } + + /** + * A stub to allow clients to do limited synchronous rpc calls to service Testing. + * + *
        +   * A service to facilitate running discrete sets of tests
        +   * against Showcase.
        +   * Adding this comment with special characters for comment formatting tests:
        +   * 1. (abra->kadabra->alakazam)
        +   * 2) [Nonsense][]: `pokemon/*/psychic/*`
        +   * 
        + */ + public static final class TestingBlockingStub + extends io.grpc.stub.AbstractBlockingStub { + private TestingBlockingStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected TestingBlockingStub build(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new TestingBlockingStub(channel, callOptions); + } + + /** + * + * + *
        +     * Creates a new testing session.
        +     * Adding this comment with special characters for comment formatting tests:
        +     * 1. (abra->kadabra->alakazam)
        +     * 2) [Nonsense][]: `pokemon/*/psychic/*`
        +     * 
        + */ + public com.google.showcase.v1beta1.Session createSession( + com.google.showcase.v1beta1.CreateSessionRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getCreateSessionMethod(), getCallOptions(), request); + } + + /** + * + * + *
        +     * Gets a testing session.
        +     * 
        + */ + public com.google.showcase.v1beta1.Session getSession( + com.google.showcase.v1beta1.GetSessionRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getGetSessionMethod(), getCallOptions(), request); + } + + /** + * + * + *
        +     * Lists the current test sessions.
        +     * 
        + */ + public com.google.showcase.v1beta1.ListSessionsResponse listSessions( + com.google.showcase.v1beta1.ListSessionsRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getListSessionsMethod(), getCallOptions(), request); + } + + /** + * + * + *
        +     * Delete a test session.
        +     * 
        + */ + public com.google.protobuf.Empty deleteSession( + com.google.showcase.v1beta1.DeleteSessionRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getDeleteSessionMethod(), getCallOptions(), request); + } + + /** + * + * + *
        +     * Report on the status of a session.
        +     * This generates a report detailing which tests have been completed,
        +     * and an overall rollup.
        +     * 
        + */ + public com.google.showcase.v1beta1.ReportSessionResponse reportSession( + com.google.showcase.v1beta1.ReportSessionRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getReportSessionMethod(), getCallOptions(), request); + } + + /** + * + * + *
        +     * List the tests of a sessesion.
        +     * 
        + */ + public com.google.showcase.v1beta1.ListTestsResponse listTests( + com.google.showcase.v1beta1.ListTestsRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getListTestsMethod(), getCallOptions(), request); + } + + /** + * + * + *
        +     * Explicitly decline to implement a test.
        +     * This removes the test from subsequent `ListTests` calls, and
        +     * attempting to do the test will error.
        +     * This method will error if attempting to delete a required test.
        +     * 
        + */ + public com.google.protobuf.Empty deleteTest( + com.google.showcase.v1beta1.DeleteTestRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getDeleteTestMethod(), getCallOptions(), request); + } + + /** + * + * + *
        +     * Register a response to a test.
        +     * In cases where a test involves registering a final answer at the
        +     * end of the test, this method provides the means to do so.
        +     * 
        + */ + public com.google.showcase.v1beta1.VerifyTestResponse verifyTest( + com.google.showcase.v1beta1.VerifyTestRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getVerifyTestMethod(), getCallOptions(), request); + } + } + + /** + * A stub to allow clients to do ListenableFuture-style rpc calls to service Testing. + * + *
        +   * A service to facilitate running discrete sets of tests
        +   * against Showcase.
        +   * Adding this comment with special characters for comment formatting tests:
        +   * 1. (abra->kadabra->alakazam)
        +   * 2) [Nonsense][]: `pokemon/*/psychic/*`
        +   * 
        + */ + public static final class TestingFutureStub + extends io.grpc.stub.AbstractFutureStub { + private TestingFutureStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected TestingFutureStub build(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new TestingFutureStub(channel, callOptions); + } + + /** + * + * + *
        +     * Creates a new testing session.
        +     * Adding this comment with special characters for comment formatting tests:
        +     * 1. (abra->kadabra->alakazam)
        +     * 2) [Nonsense][]: `pokemon/*/psychic/*`
        +     * 
        + */ + public com.google.common.util.concurrent.ListenableFuture + createSession(com.google.showcase.v1beta1.CreateSessionRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getCreateSessionMethod(), getCallOptions()), request); + } + + /** + * + * + *
        +     * Gets a testing session.
        +     * 
        + */ + public com.google.common.util.concurrent.ListenableFuture + getSession(com.google.showcase.v1beta1.GetSessionRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getGetSessionMethod(), getCallOptions()), request); + } + + /** + * + * + *
        +     * Lists the current test sessions.
        +     * 
        + */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.showcase.v1beta1.ListSessionsResponse> + listSessions(com.google.showcase.v1beta1.ListSessionsRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getListSessionsMethod(), getCallOptions()), request); + } + + /** + * + * + *
        +     * Delete a test session.
        +     * 
        + */ + public com.google.common.util.concurrent.ListenableFuture + deleteSession(com.google.showcase.v1beta1.DeleteSessionRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getDeleteSessionMethod(), getCallOptions()), request); + } + + /** + * + * + *
        +     * Report on the status of a session.
        +     * This generates a report detailing which tests have been completed,
        +     * and an overall rollup.
        +     * 
        + */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.showcase.v1beta1.ReportSessionResponse> + reportSession(com.google.showcase.v1beta1.ReportSessionRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getReportSessionMethod(), getCallOptions()), request); + } + + /** + * + * + *
        +     * List the tests of a sessesion.
        +     * 
        + */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.showcase.v1beta1.ListTestsResponse> + listTests(com.google.showcase.v1beta1.ListTestsRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getListTestsMethod(), getCallOptions()), request); + } + + /** + * + * + *
        +     * Explicitly decline to implement a test.
        +     * This removes the test from subsequent `ListTests` calls, and
        +     * attempting to do the test will error.
        +     * This method will error if attempting to delete a required test.
        +     * 
        + */ + public com.google.common.util.concurrent.ListenableFuture deleteTest( + com.google.showcase.v1beta1.DeleteTestRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getDeleteTestMethod(), getCallOptions()), request); + } + + /** + * + * + *
        +     * Register a response to a test.
        +     * In cases where a test involves registering a final answer at the
        +     * end of the test, this method provides the means to do so.
        +     * 
        + */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.showcase.v1beta1.VerifyTestResponse> + verifyTest(com.google.showcase.v1beta1.VerifyTestRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getVerifyTestMethod(), getCallOptions()), request); + } + } + + private static final int METHODID_CREATE_SESSION = 0; + private static final int METHODID_GET_SESSION = 1; + private static final int METHODID_LIST_SESSIONS = 2; + private static final int METHODID_DELETE_SESSION = 3; + private static final int METHODID_REPORT_SESSION = 4; + private static final int METHODID_LIST_TESTS = 5; + private static final int METHODID_DELETE_TEST = 6; + private static final int METHODID_VERIFY_TEST = 7; + + 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_CREATE_SESSION: + serviceImpl.createSession( + (com.google.showcase.v1beta1.CreateSessionRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_GET_SESSION: + serviceImpl.getSession( + (com.google.showcase.v1beta1.GetSessionRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_LIST_SESSIONS: + serviceImpl.listSessions( + (com.google.showcase.v1beta1.ListSessionsRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_DELETE_SESSION: + serviceImpl.deleteSession( + (com.google.showcase.v1beta1.DeleteSessionRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_REPORT_SESSION: + serviceImpl.reportSession( + (com.google.showcase.v1beta1.ReportSessionRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_LIST_TESTS: + serviceImpl.listTests( + (com.google.showcase.v1beta1.ListTestsRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_DELETE_TEST: + serviceImpl.deleteTest( + (com.google.showcase.v1beta1.DeleteTestRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_VERIFY_TEST: + serviceImpl.verifyTest( + (com.google.showcase.v1beta1.VerifyTestRequest) 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( + getCreateSessionMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.showcase.v1beta1.CreateSessionRequest, + com.google.showcase.v1beta1.Session>(service, METHODID_CREATE_SESSION))) + .addMethod( + getGetSessionMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.showcase.v1beta1.GetSessionRequest, + com.google.showcase.v1beta1.Session>(service, METHODID_GET_SESSION))) + .addMethod( + getListSessionsMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.showcase.v1beta1.ListSessionsRequest, + com.google.showcase.v1beta1.ListSessionsResponse>( + service, METHODID_LIST_SESSIONS))) + .addMethod( + getDeleteSessionMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.showcase.v1beta1.DeleteSessionRequest, com.google.protobuf.Empty>( + service, METHODID_DELETE_SESSION))) + .addMethod( + getReportSessionMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.showcase.v1beta1.ReportSessionRequest, + com.google.showcase.v1beta1.ReportSessionResponse>( + service, METHODID_REPORT_SESSION))) + .addMethod( + getListTestsMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.showcase.v1beta1.ListTestsRequest, + com.google.showcase.v1beta1.ListTestsResponse>(service, METHODID_LIST_TESTS))) + .addMethod( + getDeleteTestMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.showcase.v1beta1.DeleteTestRequest, com.google.protobuf.Empty>( + service, METHODID_DELETE_TEST))) + .addMethod( + getVerifyTestMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.showcase.v1beta1.VerifyTestRequest, + com.google.showcase.v1beta1.VerifyTestResponse>(service, METHODID_VERIFY_TEST))) + .build(); + } + + private abstract static class TestingBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoFileDescriptorSupplier, + io.grpc.protobuf.ProtoServiceDescriptorSupplier { + TestingBaseDescriptorSupplier() {} + + @java.lang.Override + public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() { + return com.google.showcase.v1beta1.TestingOuterClass.getDescriptor(); + } + + @java.lang.Override + public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() { + return getFileDescriptor().findServiceByName("Testing"); + } + } + + private static final class TestingFileDescriptorSupplier extends TestingBaseDescriptorSupplier { + TestingFileDescriptorSupplier() {} + } + + private static final class TestingMethodDescriptorSupplier extends TestingBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoMethodDescriptorSupplier { + private final java.lang.String methodName; + + TestingMethodDescriptorSupplier(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 (TestingGrpc.class) { + result = serviceDescriptor; + if (result == null) { + serviceDescriptor = + result = + io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME) + .setSchemaDescriptor(new TestingFileDescriptorSupplier()) + .addMethod(getCreateSessionMethod()) + .addMethod(getGetSessionMethod()) + .addMethod(getListSessionsMethod()) + .addMethod(getDeleteSessionMethod()) + .addMethod(getReportSessionMethod()) + .addMethod(getListTestsMethod()) + .addMethod(getDeleteTestMethod()) + .addMethod(getVerifyTestMethod()) + .build(); + } + } + } + return result; + } +} diff --git a/java-showcase-3.25.8/pom.xml b/java-showcase-3.25.8/pom.xml new file mode 100644 index 0000000000..70ae97a21f --- /dev/null +++ b/java-showcase-3.25.8/pom.xml @@ -0,0 +1,259 @@ + + + 4.0.0 + com.google.cloud + gapic-showcase-parent + pom + 0.0.1-SNAPSHOT + GAPIC Showcase Client Core Parent + + Java idiomatic client for Google Cloud Platform services. + + + + com.google.cloud + google-cloud-shared-config + 1.17.0 + + + + + UTF-8 + UTF-8 + github + google-cloud-showcase-parent + true + true + true + + + + + + com.google.cloud + google-cloud-shared-dependencies + 3.58.1-SNAPSHOT + pom + import + + + com.google.api.grpc + proto-gapic-showcase-v1beta1 + 0.0.1-SNAPSHOT + + + com.google.api.grpc + grpc-gapic-showcase-v1beta1 + 0.0.1-SNAPSHOT + + + com.google.cloud + gapic-showcase + 0.0.1-SNAPSHOT + + + org.junit + junit-bom + 5.11.4 + pom + import + + + + + + gapic-showcase + grpc-gapic-showcase-v1beta1 + proto-gapic-showcase-v1beta1 + + + + + native + + + + org.apache.maven.plugins + maven-compiler-plugin + + + + **/com/google/showcase/v1beta1/it/logging/*.java + + + + + org.graalvm.buildtools + native-maven-plugin + true + + + test-native + + test + + test + + + + + --no-fallback + --no-server + --verbose + + + + + + + + showcase + + true + + + + + org.apache.maven.plugins + maven-compiler-plugin + + + + **/com/google/showcase/v1beta1/it/logging/*.java + + + + + org.apache.maven.plugins + maven-surefire-plugin + 3.5.2 + + sponge_log + ${skipUnitTests} + + + + org.apache.maven.plugins + maven-failsafe-plugin + + + + + org.apache.maven.surefire + surefire-junit-platform + ${surefire.version} + + + + + org.codehaus.mojo + flatten-maven-plugin + + + + + + + loggingTestBase + + + + + org.apache.maven.plugins + maven-surefire-plugin + 3.5.2 + + sponge_log + ${skipUnitTests} + + + + org.apache.maven.plugins + maven-failsafe-plugin + + + + + org.apache.maven.surefire + surefire-junit-platform + ${surefire.version} + + + + + org.codehaus.mojo + flatten-maven-plugin + + + + + + enable-golden-tests + + + + org.apache.maven.plugins + maven-compiler-plugin + + + + **/com/google/showcase/v1beta1/it/logging/*.java + + + + + org.codehaus.mojo + exec-maven-plugin + 3.5.0 + false + + + verify-showcase + + exec + + test + + bash + + scripts/verify.sh + + + + + + + + + + update + + + + org.codehaus.mojo + exec-maven-plugin + 3.5.0 + false + + + verify-showcase + + exec + + generate-sources + + bash + + scripts/generate_showcase.sh + --replace + true + + + + + + + + + + diff --git a/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/pom.xml b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/pom.xml new file mode 100644 index 0000000000..cef41f54ff --- /dev/null +++ b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/pom.xml @@ -0,0 +1,57 @@ + + 4.0.0 + com.google.api.grpc + proto-gapic-showcase-v1beta1 + 0.0.1-SNAPSHOT + proto-gapic-showcase-v1beta1 + PROTO library for proto-gapic-showcase-v1beta1 + + com.google.cloud + gapic-showcase-parent + 0.0.1-SNAPSHOT + + + + true + + + + + com.google.protobuf + protobuf-java + + + com.google.api.grpc + proto-google-common-protos + + + com.google.api.grpc + proto-google-iam-v1 + + + com.google.api + api-common + + + com.google.guava + guava + + + + + + + showcase-sonar-analysis + + + enableShowcaseTestCoverage + + + + true + + + + diff --git a/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/AttemptSequenceRequest.java b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/AttemptSequenceRequest.java new file mode 100644 index 0000000000..51dce8b55e --- /dev/null +++ b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/AttemptSequenceRequest.java @@ -0,0 +1,590 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/sequence.proto + +// Protobuf Java Version: 3.25.8 +package com.google.showcase.v1beta1; + +/** Protobuf type {@code google.showcase.v1beta1.AttemptSequenceRequest} */ +public final class AttemptSequenceRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.AttemptSequenceRequest) + AttemptSequenceRequestOrBuilder { + private static final long serialVersionUID = 0L; + + // Use AttemptSequenceRequest.newBuilder() to construct. + private AttemptSequenceRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private AttemptSequenceRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new AttemptSequenceRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.SequenceOuterClass + .internal_static_google_showcase_v1beta1_AttemptSequenceRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.SequenceOuterClass + .internal_static_google_showcase_v1beta1_AttemptSequenceRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.AttemptSequenceRequest.class, + com.google.showcase.v1beta1.AttemptSequenceRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + + /** + * + * 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; + } + } + + /** + * + * 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.showcase.v1beta1.AttemptSequenceRequest)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.AttemptSequenceRequest other = + (com.google.showcase.v1beta1.AttemptSequenceRequest) 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.showcase.v1beta1.AttemptSequenceRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.AttemptSequenceRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.AttemptSequenceRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.AttemptSequenceRequest 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.showcase.v1beta1.AttemptSequenceRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.AttemptSequenceRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.AttemptSequenceRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.AttemptSequenceRequest 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.showcase.v1beta1.AttemptSequenceRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.AttemptSequenceRequest 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.showcase.v1beta1.AttemptSequenceRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.AttemptSequenceRequest 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.showcase.v1beta1.AttemptSequenceRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** Protobuf type {@code google.showcase.v1beta1.AttemptSequenceRequest} */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.AttemptSequenceRequest) + com.google.showcase.v1beta1.AttemptSequenceRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.SequenceOuterClass + .internal_static_google_showcase_v1beta1_AttemptSequenceRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.SequenceOuterClass + .internal_static_google_showcase_v1beta1_AttemptSequenceRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.AttemptSequenceRequest.class, + com.google.showcase.v1beta1.AttemptSequenceRequest.Builder.class); + } + + // Construct using com.google.showcase.v1beta1.AttemptSequenceRequest.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.showcase.v1beta1.SequenceOuterClass + .internal_static_google_showcase_v1beta1_AttemptSequenceRequest_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.AttemptSequenceRequest getDefaultInstanceForType() { + return com.google.showcase.v1beta1.AttemptSequenceRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.AttemptSequenceRequest build() { + com.google.showcase.v1beta1.AttemptSequenceRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.AttemptSequenceRequest buildPartial() { + com.google.showcase.v1beta1.AttemptSequenceRequest result = + new com.google.showcase.v1beta1.AttemptSequenceRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.showcase.v1beta1.AttemptSequenceRequest 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.showcase.v1beta1.AttemptSequenceRequest) { + return mergeFrom((com.google.showcase.v1beta1.AttemptSequenceRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.showcase.v1beta1.AttemptSequenceRequest other) { + if (other == com.google.showcase.v1beta1.AttemptSequenceRequest.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_ = ""; + + /** + * + * 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; + } + } + + /** + * + * 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; + } + } + + /** + * + * 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; + } + + /** + * + * 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; + } + + /** + * + * 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.showcase.v1beta1.AttemptSequenceRequest) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.AttemptSequenceRequest) + private static final com.google.showcase.v1beta1.AttemptSequenceRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.AttemptSequenceRequest(); + } + + public static com.google.showcase.v1beta1.AttemptSequenceRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public AttemptSequenceRequest 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.showcase.v1beta1.AttemptSequenceRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/AttemptSequenceRequestOrBuilder.java b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/AttemptSequenceRequestOrBuilder.java new file mode 100644 index 0000000000..6522ace9d4 --- /dev/null +++ b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/AttemptSequenceRequestOrBuilder.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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/sequence.proto + +// Protobuf Java Version: 3.25.8 +package com.google.showcase.v1beta1; + +public interface AttemptSequenceRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.AttemptSequenceRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + + /** + * + * 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-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/AttemptStreamingSequenceRequest.java b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/AttemptStreamingSequenceRequest.java new file mode 100644 index 0000000000..c1572e275e --- /dev/null +++ b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/AttemptStreamingSequenceRequest.java @@ -0,0 +1,697 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/sequence.proto + +// Protobuf Java Version: 3.25.8 +package com.google.showcase.v1beta1; + +/** Protobuf type {@code google.showcase.v1beta1.AttemptStreamingSequenceRequest} */ +public final class AttemptStreamingSequenceRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.AttemptStreamingSequenceRequest) + AttemptStreamingSequenceRequestOrBuilder { + private static final long serialVersionUID = 0L; + + // Use AttemptStreamingSequenceRequest.newBuilder() to construct. + private AttemptStreamingSequenceRequest( + com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private AttemptStreamingSequenceRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new AttemptStreamingSequenceRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.SequenceOuterClass + .internal_static_google_showcase_v1beta1_AttemptStreamingSequenceRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.SequenceOuterClass + .internal_static_google_showcase_v1beta1_AttemptStreamingSequenceRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.AttemptStreamingSequenceRequest.class, + com.google.showcase.v1beta1.AttemptStreamingSequenceRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + + /** + * + * 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; + } + } + + /** + * + * 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 LAST_FAIL_INDEX_FIELD_NUMBER = 2; + private int lastFailIndex_ = 0; + + /** + * + * + *
        +   * used to send the index of the last failed message
        +   * in the string "content" of an AttemptStreamingSequenceResponse
        +   * needed for stream resumption logic testing
        +   * 
        + * + * int32 last_fail_index = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The lastFailIndex. + */ + @java.lang.Override + public int getLastFailIndex() { + return lastFailIndex_; + } + + 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 (lastFailIndex_ != 0) { + output.writeInt32(2, lastFailIndex_); + } + 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 (lastFailIndex_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(2, lastFailIndex_); + } + 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.showcase.v1beta1.AttemptStreamingSequenceRequest)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.AttemptStreamingSequenceRequest other = + (com.google.showcase.v1beta1.AttemptStreamingSequenceRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (getLastFailIndex() != other.getLastFailIndex()) 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) + LAST_FAIL_INDEX_FIELD_NUMBER; + hash = (53 * hash) + getLastFailIndex(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.showcase.v1beta1.AttemptStreamingSequenceRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.AttemptStreamingSequenceRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.AttemptStreamingSequenceRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.AttemptStreamingSequenceRequest 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.showcase.v1beta1.AttemptStreamingSequenceRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.AttemptStreamingSequenceRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.AttemptStreamingSequenceRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.AttemptStreamingSequenceRequest 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.showcase.v1beta1.AttemptStreamingSequenceRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.AttemptStreamingSequenceRequest 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.showcase.v1beta1.AttemptStreamingSequenceRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.AttemptStreamingSequenceRequest 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.showcase.v1beta1.AttemptStreamingSequenceRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** Protobuf type {@code google.showcase.v1beta1.AttemptStreamingSequenceRequest} */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.AttemptStreamingSequenceRequest) + com.google.showcase.v1beta1.AttemptStreamingSequenceRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.SequenceOuterClass + .internal_static_google_showcase_v1beta1_AttemptStreamingSequenceRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.SequenceOuterClass + .internal_static_google_showcase_v1beta1_AttemptStreamingSequenceRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.AttemptStreamingSequenceRequest.class, + com.google.showcase.v1beta1.AttemptStreamingSequenceRequest.Builder.class); + } + + // Construct using com.google.showcase.v1beta1.AttemptStreamingSequenceRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + lastFailIndex_ = 0; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.showcase.v1beta1.SequenceOuterClass + .internal_static_google_showcase_v1beta1_AttemptStreamingSequenceRequest_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.AttemptStreamingSequenceRequest getDefaultInstanceForType() { + return com.google.showcase.v1beta1.AttemptStreamingSequenceRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.AttemptStreamingSequenceRequest build() { + com.google.showcase.v1beta1.AttemptStreamingSequenceRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.AttemptStreamingSequenceRequest buildPartial() { + com.google.showcase.v1beta1.AttemptStreamingSequenceRequest result = + new com.google.showcase.v1beta1.AttemptStreamingSequenceRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.showcase.v1beta1.AttemptStreamingSequenceRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.lastFailIndex_ = lastFailIndex_; + } + } + + @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.showcase.v1beta1.AttemptStreamingSequenceRequest) { + return mergeFrom((com.google.showcase.v1beta1.AttemptStreamingSequenceRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.showcase.v1beta1.AttemptStreamingSequenceRequest other) { + if (other == com.google.showcase.v1beta1.AttemptStreamingSequenceRequest.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.getLastFailIndex() != 0) { + setLastFailIndex(other.getLastFailIndex()); + } + 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 16: + { + lastFailIndex_ = 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 java.lang.Object name_ = ""; + + /** + * + * 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; + } + } + + /** + * + * 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; + } + } + + /** + * + * 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; + } + + /** + * + * 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; + } + + /** + * + * 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 int lastFailIndex_; + + /** + * + * + *
        +     * used to send the index of the last failed message
        +     * in the string "content" of an AttemptStreamingSequenceResponse
        +     * needed for stream resumption logic testing
        +     * 
        + * + * int32 last_fail_index = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The lastFailIndex. + */ + @java.lang.Override + public int getLastFailIndex() { + return lastFailIndex_; + } + + /** + * + * + *
        +     * used to send the index of the last failed message
        +     * in the string "content" of an AttemptStreamingSequenceResponse
        +     * needed for stream resumption logic testing
        +     * 
        + * + * int32 last_fail_index = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The lastFailIndex to set. + * @return This builder for chaining. + */ + public Builder setLastFailIndex(int value) { + + lastFailIndex_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
        +     * used to send the index of the last failed message
        +     * in the string "content" of an AttemptStreamingSequenceResponse
        +     * needed for stream resumption logic testing
        +     * 
        + * + * int32 last_fail_index = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearLastFailIndex() { + bitField0_ = (bitField0_ & ~0x00000002); + lastFailIndex_ = 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.showcase.v1beta1.AttemptStreamingSequenceRequest) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.AttemptStreamingSequenceRequest) + private static final com.google.showcase.v1beta1.AttemptStreamingSequenceRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.AttemptStreamingSequenceRequest(); + } + + public static com.google.showcase.v1beta1.AttemptStreamingSequenceRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public AttemptStreamingSequenceRequest 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.showcase.v1beta1.AttemptStreamingSequenceRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/AttemptStreamingSequenceRequestOrBuilder.java b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/AttemptStreamingSequenceRequestOrBuilder.java new file mode 100644 index 0000000000..698ffd7aa3 --- /dev/null +++ b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/AttemptStreamingSequenceRequestOrBuilder.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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/sequence.proto + +// Protobuf Java Version: 3.25.8 +package com.google.showcase.v1beta1; + +public interface AttemptStreamingSequenceRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.AttemptStreamingSequenceRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + + /** + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
        +   * used to send the index of the last failed message
        +   * in the string "content" of an AttemptStreamingSequenceResponse
        +   * needed for stream resumption logic testing
        +   * 
        + * + * int32 last_fail_index = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The lastFailIndex. + */ + int getLastFailIndex(); +} diff --git a/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/AttemptStreamingSequenceResponse.java b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/AttemptStreamingSequenceResponse.java new file mode 100644 index 0000000000..798a2328c8 --- /dev/null +++ b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/AttemptStreamingSequenceResponse.java @@ -0,0 +1,640 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/sequence.proto + +// Protobuf Java Version: 3.25.8 +package com.google.showcase.v1beta1; + +/** + * + * + *
        + * The response message for the Echo methods.
        + * 
        + * + * Protobuf type {@code google.showcase.v1beta1.AttemptStreamingSequenceResponse} + */ +public final class AttemptStreamingSequenceResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.AttemptStreamingSequenceResponse) + AttemptStreamingSequenceResponseOrBuilder { + private static final long serialVersionUID = 0L; + + // Use AttemptStreamingSequenceResponse.newBuilder() to construct. + private AttemptStreamingSequenceResponse( + com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private AttemptStreamingSequenceResponse() { + content_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new AttemptStreamingSequenceResponse(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.SequenceOuterClass + .internal_static_google_showcase_v1beta1_AttemptStreamingSequenceResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.SequenceOuterClass + .internal_static_google_showcase_v1beta1_AttemptStreamingSequenceResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.AttemptStreamingSequenceResponse.class, + com.google.showcase.v1beta1.AttemptStreamingSequenceResponse.Builder.class); + } + + public static final int CONTENT_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object content_ = ""; + + /** + * + * + *
        +   * The content specified in the request.
        +   * 
        + * + * string content = 1; + * + * @return The content. + */ + @java.lang.Override + public java.lang.String getContent() { + java.lang.Object ref = content_; + 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(); + content_ = s; + return s; + } + } + + /** + * + * + *
        +   * The content specified in the request.
        +   * 
        + * + * string content = 1; + * + * @return The bytes for content. + */ + @java.lang.Override + public com.google.protobuf.ByteString getContentBytes() { + java.lang.Object ref = content_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + content_ = 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(content_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, content_); + } + 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(content_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, content_); + } + 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.showcase.v1beta1.AttemptStreamingSequenceResponse)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.AttemptStreamingSequenceResponse other = + (com.google.showcase.v1beta1.AttemptStreamingSequenceResponse) obj; + + if (!getContent().equals(other.getContent())) 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) + CONTENT_FIELD_NUMBER; + hash = (53 * hash) + getContent().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.showcase.v1beta1.AttemptStreamingSequenceResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.AttemptStreamingSequenceResponse parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.AttemptStreamingSequenceResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.AttemptStreamingSequenceResponse 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.showcase.v1beta1.AttemptStreamingSequenceResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.AttemptStreamingSequenceResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.AttemptStreamingSequenceResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.AttemptStreamingSequenceResponse 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.showcase.v1beta1.AttemptStreamingSequenceResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.AttemptStreamingSequenceResponse 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.showcase.v1beta1.AttemptStreamingSequenceResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.AttemptStreamingSequenceResponse 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.showcase.v1beta1.AttemptStreamingSequenceResponse 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 message for the Echo methods.
        +   * 
        + * + * Protobuf type {@code google.showcase.v1beta1.AttemptStreamingSequenceResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.AttemptStreamingSequenceResponse) + com.google.showcase.v1beta1.AttemptStreamingSequenceResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.SequenceOuterClass + .internal_static_google_showcase_v1beta1_AttemptStreamingSequenceResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.SequenceOuterClass + .internal_static_google_showcase_v1beta1_AttemptStreamingSequenceResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.AttemptStreamingSequenceResponse.class, + com.google.showcase.v1beta1.AttemptStreamingSequenceResponse.Builder.class); + } + + // Construct using com.google.showcase.v1beta1.AttemptStreamingSequenceResponse.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + content_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.showcase.v1beta1.SequenceOuterClass + .internal_static_google_showcase_v1beta1_AttemptStreamingSequenceResponse_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.AttemptStreamingSequenceResponse + getDefaultInstanceForType() { + return com.google.showcase.v1beta1.AttemptStreamingSequenceResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.AttemptStreamingSequenceResponse build() { + com.google.showcase.v1beta1.AttemptStreamingSequenceResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.AttemptStreamingSequenceResponse buildPartial() { + com.google.showcase.v1beta1.AttemptStreamingSequenceResponse result = + new com.google.showcase.v1beta1.AttemptStreamingSequenceResponse(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.showcase.v1beta1.AttemptStreamingSequenceResponse result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.content_ = content_; + } + } + + @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.showcase.v1beta1.AttemptStreamingSequenceResponse) { + return mergeFrom((com.google.showcase.v1beta1.AttemptStreamingSequenceResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.showcase.v1beta1.AttemptStreamingSequenceResponse other) { + if (other + == com.google.showcase.v1beta1.AttemptStreamingSequenceResponse.getDefaultInstance()) + return this; + if (!other.getContent().isEmpty()) { + content_ = other.content_; + 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: + { + content_ = 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 content_ = ""; + + /** + * + * + *
        +     * The content specified in the request.
        +     * 
        + * + * string content = 1; + * + * @return The content. + */ + public java.lang.String getContent() { + java.lang.Object ref = content_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + content_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
        +     * The content specified in the request.
        +     * 
        + * + * string content = 1; + * + * @return The bytes for content. + */ + public com.google.protobuf.ByteString getContentBytes() { + java.lang.Object ref = content_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + content_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
        +     * The content specified in the request.
        +     * 
        + * + * string content = 1; + * + * @param value The content to set. + * @return This builder for chaining. + */ + public Builder setContent(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + content_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
        +     * The content specified in the request.
        +     * 
        + * + * string content = 1; + * + * @return This builder for chaining. + */ + public Builder clearContent() { + content_ = getDefaultInstance().getContent(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
        +     * The content specified in the request.
        +     * 
        + * + * string content = 1; + * + * @param value The bytes for content to set. + * @return This builder for chaining. + */ + public Builder setContentBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + content_ = 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.showcase.v1beta1.AttemptStreamingSequenceResponse) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.AttemptStreamingSequenceResponse) + private static final com.google.showcase.v1beta1.AttemptStreamingSequenceResponse + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.AttemptStreamingSequenceResponse(); + } + + public static com.google.showcase.v1beta1.AttemptStreamingSequenceResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public AttemptStreamingSequenceResponse 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.showcase.v1beta1.AttemptStreamingSequenceResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/AttemptStreamingSequenceResponseOrBuilder.java b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/AttemptStreamingSequenceResponseOrBuilder.java new file mode 100644 index 0000000000..ed9302cc52 --- /dev/null +++ b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/AttemptStreamingSequenceResponseOrBuilder.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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/sequence.proto + +// Protobuf Java Version: 3.25.8 +package com.google.showcase.v1beta1; + +public interface AttemptStreamingSequenceResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.AttemptStreamingSequenceResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
        +   * The content specified in the request.
        +   * 
        + * + * string content = 1; + * + * @return The content. + */ + java.lang.String getContent(); + + /** + * + * + *
        +   * The content specified in the request.
        +   * 
        + * + * string content = 1; + * + * @return The bytes for content. + */ + com.google.protobuf.ByteString getContentBytes(); +} diff --git a/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/BlockRequest.java b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/BlockRequest.java new file mode 100644 index 0000000000..413b9a852c --- /dev/null +++ b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/BlockRequest.java @@ -0,0 +1,1431 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/echo.proto + +// Protobuf Java Version: 3.25.8 +package com.google.showcase.v1beta1; + +/** + * + * + *
        + * The request for Block method.
        + * 
        + * + * Protobuf type {@code google.showcase.v1beta1.BlockRequest} + */ +public final class BlockRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.BlockRequest) + BlockRequestOrBuilder { + private static final long serialVersionUID = 0L; + + // Use BlockRequest.newBuilder() to construct. + private BlockRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private BlockRequest() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new BlockRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.EchoOuterClass + .internal_static_google_showcase_v1beta1_BlockRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.EchoOuterClass + .internal_static_google_showcase_v1beta1_BlockRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.BlockRequest.class, + com.google.showcase.v1beta1.BlockRequest.Builder.class); + } + + private int bitField0_; + private int responseCase_ = 0; + + @SuppressWarnings("serial") + private java.lang.Object response_; + + public enum ResponseCase + implements + com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + ERROR(2), + SUCCESS(3), + RESPONSE_NOT_SET(0); + private final int value; + + private ResponseCase(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 ResponseCase valueOf(int value) { + return forNumber(value); + } + + public static ResponseCase forNumber(int value) { + switch (value) { + case 2: + return ERROR; + case 3: + return SUCCESS; + case 0: + return RESPONSE_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public ResponseCase getResponseCase() { + return ResponseCase.forNumber(responseCase_); + } + + public static final int RESPONSE_DELAY_FIELD_NUMBER = 1; + private com.google.protobuf.Duration responseDelay_; + + /** + * + * + *
        +   * The amount of time to block before returning a response.
        +   * 
        + * + * .google.protobuf.Duration response_delay = 1; + * + * @return Whether the responseDelay field is set. + */ + @java.lang.Override + public boolean hasResponseDelay() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
        +   * The amount of time to block before returning a response.
        +   * 
        + * + * .google.protobuf.Duration response_delay = 1; + * + * @return The responseDelay. + */ + @java.lang.Override + public com.google.protobuf.Duration getResponseDelay() { + return responseDelay_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : responseDelay_; + } + + /** + * + * + *
        +   * The amount of time to block before returning a response.
        +   * 
        + * + * .google.protobuf.Duration response_delay = 1; + */ + @java.lang.Override + public com.google.protobuf.DurationOrBuilder getResponseDelayOrBuilder() { + return responseDelay_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : responseDelay_; + } + + public static final int ERROR_FIELD_NUMBER = 2; + + /** + * + * + *
        +   * The error that will be returned by the server. If this code is specified
        +   * to be the OK rpc code, an empty response will be returned.
        +   * 
        + * + * .google.rpc.Status error = 2; + * + * @return Whether the error field is set. + */ + @java.lang.Override + public boolean hasError() { + return responseCase_ == 2; + } + + /** + * + * + *
        +   * The error that will be returned by the server. If this code is specified
        +   * to be the OK rpc code, an empty response will be returned.
        +   * 
        + * + * .google.rpc.Status error = 2; + * + * @return The error. + */ + @java.lang.Override + public com.google.rpc.Status getError() { + if (responseCase_ == 2) { + return (com.google.rpc.Status) response_; + } + return com.google.rpc.Status.getDefaultInstance(); + } + + /** + * + * + *
        +   * The error that will be returned by the server. If this code is specified
        +   * to be the OK rpc code, an empty response will be returned.
        +   * 
        + * + * .google.rpc.Status error = 2; + */ + @java.lang.Override + public com.google.rpc.StatusOrBuilder getErrorOrBuilder() { + if (responseCase_ == 2) { + return (com.google.rpc.Status) response_; + } + return com.google.rpc.Status.getDefaultInstance(); + } + + public static final int SUCCESS_FIELD_NUMBER = 3; + + /** + * + * + *
        +   * The response to be returned that will signify successful method call.
        +   * 
        + * + * .google.showcase.v1beta1.BlockResponse success = 3; + * + * @return Whether the success field is set. + */ + @java.lang.Override + public boolean hasSuccess() { + return responseCase_ == 3; + } + + /** + * + * + *
        +   * The response to be returned that will signify successful method call.
        +   * 
        + * + * .google.showcase.v1beta1.BlockResponse success = 3; + * + * @return The success. + */ + @java.lang.Override + public com.google.showcase.v1beta1.BlockResponse getSuccess() { + if (responseCase_ == 3) { + return (com.google.showcase.v1beta1.BlockResponse) response_; + } + return com.google.showcase.v1beta1.BlockResponse.getDefaultInstance(); + } + + /** + * + * + *
        +   * The response to be returned that will signify successful method call.
        +   * 
        + * + * .google.showcase.v1beta1.BlockResponse success = 3; + */ + @java.lang.Override + public com.google.showcase.v1beta1.BlockResponseOrBuilder getSuccessOrBuilder() { + if (responseCase_ == 3) { + return (com.google.showcase.v1beta1.BlockResponse) response_; + } + return com.google.showcase.v1beta1.BlockResponse.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, getResponseDelay()); + } + if (responseCase_ == 2) { + output.writeMessage(2, (com.google.rpc.Status) response_); + } + if (responseCase_ == 3) { + output.writeMessage(3, (com.google.showcase.v1beta1.BlockResponse) response_); + } + 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, getResponseDelay()); + } + if (responseCase_ == 2) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 2, (com.google.rpc.Status) response_); + } + if (responseCase_ == 3) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 3, (com.google.showcase.v1beta1.BlockResponse) response_); + } + 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.showcase.v1beta1.BlockRequest)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.BlockRequest other = (com.google.showcase.v1beta1.BlockRequest) obj; + + if (hasResponseDelay() != other.hasResponseDelay()) return false; + if (hasResponseDelay()) { + if (!getResponseDelay().equals(other.getResponseDelay())) return false; + } + if (!getResponseCase().equals(other.getResponseCase())) return false; + switch (responseCase_) { + case 2: + if (!getError().equals(other.getError())) return false; + break; + case 3: + if (!getSuccess().equals(other.getSuccess())) 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 (hasResponseDelay()) { + hash = (37 * hash) + RESPONSE_DELAY_FIELD_NUMBER; + hash = (53 * hash) + getResponseDelay().hashCode(); + } + switch (responseCase_) { + case 2: + hash = (37 * hash) + ERROR_FIELD_NUMBER; + hash = (53 * hash) + getError().hashCode(); + break; + case 3: + hash = (37 * hash) + SUCCESS_FIELD_NUMBER; + hash = (53 * hash) + getSuccess().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.showcase.v1beta1.BlockRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.BlockRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.BlockRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.BlockRequest 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.showcase.v1beta1.BlockRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.BlockRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.BlockRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.BlockRequest 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.showcase.v1beta1.BlockRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.BlockRequest 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.showcase.v1beta1.BlockRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.BlockRequest 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.showcase.v1beta1.BlockRequest 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 request for Block method.
        +   * 
        + * + * Protobuf type {@code google.showcase.v1beta1.BlockRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.BlockRequest) + com.google.showcase.v1beta1.BlockRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.EchoOuterClass + .internal_static_google_showcase_v1beta1_BlockRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.EchoOuterClass + .internal_static_google_showcase_v1beta1_BlockRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.BlockRequest.class, + com.google.showcase.v1beta1.BlockRequest.Builder.class); + } + + // Construct using com.google.showcase.v1beta1.BlockRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getResponseDelayFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + responseDelay_ = null; + if (responseDelayBuilder_ != null) { + responseDelayBuilder_.dispose(); + responseDelayBuilder_ = null; + } + if (errorBuilder_ != null) { + errorBuilder_.clear(); + } + if (successBuilder_ != null) { + successBuilder_.clear(); + } + responseCase_ = 0; + response_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.showcase.v1beta1.EchoOuterClass + .internal_static_google_showcase_v1beta1_BlockRequest_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.BlockRequest getDefaultInstanceForType() { + return com.google.showcase.v1beta1.BlockRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.BlockRequest build() { + com.google.showcase.v1beta1.BlockRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.BlockRequest buildPartial() { + com.google.showcase.v1beta1.BlockRequest result = + new com.google.showcase.v1beta1.BlockRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + buildPartialOneofs(result); + onBuilt(); + return result; + } + + private void buildPartial0(com.google.showcase.v1beta1.BlockRequest result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.responseDelay_ = + responseDelayBuilder_ == null ? responseDelay_ : responseDelayBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + result.bitField0_ |= to_bitField0_; + } + + private void buildPartialOneofs(com.google.showcase.v1beta1.BlockRequest result) { + result.responseCase_ = responseCase_; + result.response_ = this.response_; + if (responseCase_ == 2 && errorBuilder_ != null) { + result.response_ = errorBuilder_.build(); + } + if (responseCase_ == 3 && successBuilder_ != null) { + result.response_ = successBuilder_.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.showcase.v1beta1.BlockRequest) { + return mergeFrom((com.google.showcase.v1beta1.BlockRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.showcase.v1beta1.BlockRequest other) { + if (other == com.google.showcase.v1beta1.BlockRequest.getDefaultInstance()) return this; + if (other.hasResponseDelay()) { + mergeResponseDelay(other.getResponseDelay()); + } + switch (other.getResponseCase()) { + case ERROR: + { + mergeError(other.getError()); + break; + } + case SUCCESS: + { + mergeSuccess(other.getSuccess()); + break; + } + case RESPONSE_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(getResponseDelayFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + input.readMessage(getErrorFieldBuilder().getBuilder(), extensionRegistry); + responseCase_ = 2; + break; + } // case 18 + case 26: + { + input.readMessage(getSuccessFieldBuilder().getBuilder(), extensionRegistry); + responseCase_ = 3; + 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 responseCase_ = 0; + private java.lang.Object response_; + + public ResponseCase getResponseCase() { + return ResponseCase.forNumber(responseCase_); + } + + public Builder clearResponse() { + responseCase_ = 0; + response_ = null; + onChanged(); + return this; + } + + private int bitField0_; + + private com.google.protobuf.Duration responseDelay_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder> + responseDelayBuilder_; + + /** + * + * + *
        +     * The amount of time to block before returning a response.
        +     * 
        + * + * .google.protobuf.Duration response_delay = 1; + * + * @return Whether the responseDelay field is set. + */ + public boolean hasResponseDelay() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
        +     * The amount of time to block before returning a response.
        +     * 
        + * + * .google.protobuf.Duration response_delay = 1; + * + * @return The responseDelay. + */ + public com.google.protobuf.Duration getResponseDelay() { + if (responseDelayBuilder_ == null) { + return responseDelay_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : responseDelay_; + } else { + return responseDelayBuilder_.getMessage(); + } + } + + /** + * + * + *
        +     * The amount of time to block before returning a response.
        +     * 
        + * + * .google.protobuf.Duration response_delay = 1; + */ + public Builder setResponseDelay(com.google.protobuf.Duration value) { + if (responseDelayBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + responseDelay_ = value; + } else { + responseDelayBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
        +     * The amount of time to block before returning a response.
        +     * 
        + * + * .google.protobuf.Duration response_delay = 1; + */ + public Builder setResponseDelay(com.google.protobuf.Duration.Builder builderForValue) { + if (responseDelayBuilder_ == null) { + responseDelay_ = builderForValue.build(); + } else { + responseDelayBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
        +     * The amount of time to block before returning a response.
        +     * 
        + * + * .google.protobuf.Duration response_delay = 1; + */ + public Builder mergeResponseDelay(com.google.protobuf.Duration value) { + if (responseDelayBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) + && responseDelay_ != null + && responseDelay_ != com.google.protobuf.Duration.getDefaultInstance()) { + getResponseDelayBuilder().mergeFrom(value); + } else { + responseDelay_ = value; + } + } else { + responseDelayBuilder_.mergeFrom(value); + } + if (responseDelay_ != null) { + bitField0_ |= 0x00000001; + onChanged(); + } + return this; + } + + /** + * + * + *
        +     * The amount of time to block before returning a response.
        +     * 
        + * + * .google.protobuf.Duration response_delay = 1; + */ + public Builder clearResponseDelay() { + bitField0_ = (bitField0_ & ~0x00000001); + responseDelay_ = null; + if (responseDelayBuilder_ != null) { + responseDelayBuilder_.dispose(); + responseDelayBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
        +     * The amount of time to block before returning a response.
        +     * 
        + * + * .google.protobuf.Duration response_delay = 1; + */ + public com.google.protobuf.Duration.Builder getResponseDelayBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return getResponseDelayFieldBuilder().getBuilder(); + } + + /** + * + * + *
        +     * The amount of time to block before returning a response.
        +     * 
        + * + * .google.protobuf.Duration response_delay = 1; + */ + public com.google.protobuf.DurationOrBuilder getResponseDelayOrBuilder() { + if (responseDelayBuilder_ != null) { + return responseDelayBuilder_.getMessageOrBuilder(); + } else { + return responseDelay_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : responseDelay_; + } + } + + /** + * + * + *
        +     * The amount of time to block before returning a response.
        +     * 
        + * + * .google.protobuf.Duration response_delay = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder> + getResponseDelayFieldBuilder() { + if (responseDelayBuilder_ == null) { + responseDelayBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder>( + getResponseDelay(), getParentForChildren(), isClean()); + responseDelay_ = null; + } + return responseDelayBuilder_; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.rpc.Status, com.google.rpc.Status.Builder, com.google.rpc.StatusOrBuilder> + errorBuilder_; + + /** + * + * + *
        +     * The error that will be returned by the server. If this code is specified
        +     * to be the OK rpc code, an empty response will be returned.
        +     * 
        + * + * .google.rpc.Status error = 2; + * + * @return Whether the error field is set. + */ + @java.lang.Override + public boolean hasError() { + return responseCase_ == 2; + } + + /** + * + * + *
        +     * The error that will be returned by the server. If this code is specified
        +     * to be the OK rpc code, an empty response will be returned.
        +     * 
        + * + * .google.rpc.Status error = 2; + * + * @return The error. + */ + @java.lang.Override + public com.google.rpc.Status getError() { + if (errorBuilder_ == null) { + if (responseCase_ == 2) { + return (com.google.rpc.Status) response_; + } + return com.google.rpc.Status.getDefaultInstance(); + } else { + if (responseCase_ == 2) { + return errorBuilder_.getMessage(); + } + return com.google.rpc.Status.getDefaultInstance(); + } + } + + /** + * + * + *
        +     * The error that will be returned by the server. If this code is specified
        +     * to be the OK rpc code, an empty response will be returned.
        +     * 
        + * + * .google.rpc.Status error = 2; + */ + public Builder setError(com.google.rpc.Status value) { + if (errorBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + response_ = value; + onChanged(); + } else { + errorBuilder_.setMessage(value); + } + responseCase_ = 2; + return this; + } + + /** + * + * + *
        +     * The error that will be returned by the server. If this code is specified
        +     * to be the OK rpc code, an empty response will be returned.
        +     * 
        + * + * .google.rpc.Status error = 2; + */ + public Builder setError(com.google.rpc.Status.Builder builderForValue) { + if (errorBuilder_ == null) { + response_ = builderForValue.build(); + onChanged(); + } else { + errorBuilder_.setMessage(builderForValue.build()); + } + responseCase_ = 2; + return this; + } + + /** + * + * + *
        +     * The error that will be returned by the server. If this code is specified
        +     * to be the OK rpc code, an empty response will be returned.
        +     * 
        + * + * .google.rpc.Status error = 2; + */ + public Builder mergeError(com.google.rpc.Status value) { + if (errorBuilder_ == null) { + if (responseCase_ == 2 && response_ != com.google.rpc.Status.getDefaultInstance()) { + response_ = + com.google.rpc.Status.newBuilder((com.google.rpc.Status) response_) + .mergeFrom(value) + .buildPartial(); + } else { + response_ = value; + } + onChanged(); + } else { + if (responseCase_ == 2) { + errorBuilder_.mergeFrom(value); + } else { + errorBuilder_.setMessage(value); + } + } + responseCase_ = 2; + return this; + } + + /** + * + * + *
        +     * The error that will be returned by the server. If this code is specified
        +     * to be the OK rpc code, an empty response will be returned.
        +     * 
        + * + * .google.rpc.Status error = 2; + */ + public Builder clearError() { + if (errorBuilder_ == null) { + if (responseCase_ == 2) { + responseCase_ = 0; + response_ = null; + onChanged(); + } + } else { + if (responseCase_ == 2) { + responseCase_ = 0; + response_ = null; + } + errorBuilder_.clear(); + } + return this; + } + + /** + * + * + *
        +     * The error that will be returned by the server. If this code is specified
        +     * to be the OK rpc code, an empty response will be returned.
        +     * 
        + * + * .google.rpc.Status error = 2; + */ + public com.google.rpc.Status.Builder getErrorBuilder() { + return getErrorFieldBuilder().getBuilder(); + } + + /** + * + * + *
        +     * The error that will be returned by the server. If this code is specified
        +     * to be the OK rpc code, an empty response will be returned.
        +     * 
        + * + * .google.rpc.Status error = 2; + */ + @java.lang.Override + public com.google.rpc.StatusOrBuilder getErrorOrBuilder() { + if ((responseCase_ == 2) && (errorBuilder_ != null)) { + return errorBuilder_.getMessageOrBuilder(); + } else { + if (responseCase_ == 2) { + return (com.google.rpc.Status) response_; + } + return com.google.rpc.Status.getDefaultInstance(); + } + } + + /** + * + * + *
        +     * The error that will be returned by the server. If this code is specified
        +     * to be the OK rpc code, an empty response will be returned.
        +     * 
        + * + * .google.rpc.Status error = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.rpc.Status, com.google.rpc.Status.Builder, com.google.rpc.StatusOrBuilder> + getErrorFieldBuilder() { + if (errorBuilder_ == null) { + if (!(responseCase_ == 2)) { + response_ = com.google.rpc.Status.getDefaultInstance(); + } + errorBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.rpc.Status, + com.google.rpc.Status.Builder, + com.google.rpc.StatusOrBuilder>( + (com.google.rpc.Status) response_, getParentForChildren(), isClean()); + response_ = null; + } + responseCase_ = 2; + onChanged(); + return errorBuilder_; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.showcase.v1beta1.BlockResponse, + com.google.showcase.v1beta1.BlockResponse.Builder, + com.google.showcase.v1beta1.BlockResponseOrBuilder> + successBuilder_; + + /** + * + * + *
        +     * The response to be returned that will signify successful method call.
        +     * 
        + * + * .google.showcase.v1beta1.BlockResponse success = 3; + * + * @return Whether the success field is set. + */ + @java.lang.Override + public boolean hasSuccess() { + return responseCase_ == 3; + } + + /** + * + * + *
        +     * The response to be returned that will signify successful method call.
        +     * 
        + * + * .google.showcase.v1beta1.BlockResponse success = 3; + * + * @return The success. + */ + @java.lang.Override + public com.google.showcase.v1beta1.BlockResponse getSuccess() { + if (successBuilder_ == null) { + if (responseCase_ == 3) { + return (com.google.showcase.v1beta1.BlockResponse) response_; + } + return com.google.showcase.v1beta1.BlockResponse.getDefaultInstance(); + } else { + if (responseCase_ == 3) { + return successBuilder_.getMessage(); + } + return com.google.showcase.v1beta1.BlockResponse.getDefaultInstance(); + } + } + + /** + * + * + *
        +     * The response to be returned that will signify successful method call.
        +     * 
        + * + * .google.showcase.v1beta1.BlockResponse success = 3; + */ + public Builder setSuccess(com.google.showcase.v1beta1.BlockResponse value) { + if (successBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + response_ = value; + onChanged(); + } else { + successBuilder_.setMessage(value); + } + responseCase_ = 3; + return this; + } + + /** + * + * + *
        +     * The response to be returned that will signify successful method call.
        +     * 
        + * + * .google.showcase.v1beta1.BlockResponse success = 3; + */ + public Builder setSuccess(com.google.showcase.v1beta1.BlockResponse.Builder builderForValue) { + if (successBuilder_ == null) { + response_ = builderForValue.build(); + onChanged(); + } else { + successBuilder_.setMessage(builderForValue.build()); + } + responseCase_ = 3; + return this; + } + + /** + * + * + *
        +     * The response to be returned that will signify successful method call.
        +     * 
        + * + * .google.showcase.v1beta1.BlockResponse success = 3; + */ + public Builder mergeSuccess(com.google.showcase.v1beta1.BlockResponse value) { + if (successBuilder_ == null) { + if (responseCase_ == 3 + && response_ != com.google.showcase.v1beta1.BlockResponse.getDefaultInstance()) { + response_ = + com.google.showcase.v1beta1.BlockResponse.newBuilder( + (com.google.showcase.v1beta1.BlockResponse) response_) + .mergeFrom(value) + .buildPartial(); + } else { + response_ = value; + } + onChanged(); + } else { + if (responseCase_ == 3) { + successBuilder_.mergeFrom(value); + } else { + successBuilder_.setMessage(value); + } + } + responseCase_ = 3; + return this; + } + + /** + * + * + *
        +     * The response to be returned that will signify successful method call.
        +     * 
        + * + * .google.showcase.v1beta1.BlockResponse success = 3; + */ + public Builder clearSuccess() { + if (successBuilder_ == null) { + if (responseCase_ == 3) { + responseCase_ = 0; + response_ = null; + onChanged(); + } + } else { + if (responseCase_ == 3) { + responseCase_ = 0; + response_ = null; + } + successBuilder_.clear(); + } + return this; + } + + /** + * + * + *
        +     * The response to be returned that will signify successful method call.
        +     * 
        + * + * .google.showcase.v1beta1.BlockResponse success = 3; + */ + public com.google.showcase.v1beta1.BlockResponse.Builder getSuccessBuilder() { + return getSuccessFieldBuilder().getBuilder(); + } + + /** + * + * + *
        +     * The response to be returned that will signify successful method call.
        +     * 
        + * + * .google.showcase.v1beta1.BlockResponse success = 3; + */ + @java.lang.Override + public com.google.showcase.v1beta1.BlockResponseOrBuilder getSuccessOrBuilder() { + if ((responseCase_ == 3) && (successBuilder_ != null)) { + return successBuilder_.getMessageOrBuilder(); + } else { + if (responseCase_ == 3) { + return (com.google.showcase.v1beta1.BlockResponse) response_; + } + return com.google.showcase.v1beta1.BlockResponse.getDefaultInstance(); + } + } + + /** + * + * + *
        +     * The response to be returned that will signify successful method call.
        +     * 
        + * + * .google.showcase.v1beta1.BlockResponse success = 3; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.showcase.v1beta1.BlockResponse, + com.google.showcase.v1beta1.BlockResponse.Builder, + com.google.showcase.v1beta1.BlockResponseOrBuilder> + getSuccessFieldBuilder() { + if (successBuilder_ == null) { + if (!(responseCase_ == 3)) { + response_ = com.google.showcase.v1beta1.BlockResponse.getDefaultInstance(); + } + successBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.showcase.v1beta1.BlockResponse, + com.google.showcase.v1beta1.BlockResponse.Builder, + com.google.showcase.v1beta1.BlockResponseOrBuilder>( + (com.google.showcase.v1beta1.BlockResponse) response_, + getParentForChildren(), + isClean()); + response_ = null; + } + responseCase_ = 3; + onChanged(); + return successBuilder_; + } + + @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.showcase.v1beta1.BlockRequest) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.BlockRequest) + private static final com.google.showcase.v1beta1.BlockRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.BlockRequest(); + } + + public static com.google.showcase.v1beta1.BlockRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public BlockRequest 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.showcase.v1beta1.BlockRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/BlockRequestOrBuilder.java b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/BlockRequestOrBuilder.java new file mode 100644 index 0000000000..6c1bff9b58 --- /dev/null +++ b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/BlockRequestOrBuilder.java @@ -0,0 +1,142 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/echo.proto + +// Protobuf Java Version: 3.25.8 +package com.google.showcase.v1beta1; + +public interface BlockRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.BlockRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
        +   * The amount of time to block before returning a response.
        +   * 
        + * + * .google.protobuf.Duration response_delay = 1; + * + * @return Whether the responseDelay field is set. + */ + boolean hasResponseDelay(); + + /** + * + * + *
        +   * The amount of time to block before returning a response.
        +   * 
        + * + * .google.protobuf.Duration response_delay = 1; + * + * @return The responseDelay. + */ + com.google.protobuf.Duration getResponseDelay(); + + /** + * + * + *
        +   * The amount of time to block before returning a response.
        +   * 
        + * + * .google.protobuf.Duration response_delay = 1; + */ + com.google.protobuf.DurationOrBuilder getResponseDelayOrBuilder(); + + /** + * + * + *
        +   * The error that will be returned by the server. If this code is specified
        +   * to be the OK rpc code, an empty response will be returned.
        +   * 
        + * + * .google.rpc.Status error = 2; + * + * @return Whether the error field is set. + */ + boolean hasError(); + + /** + * + * + *
        +   * The error that will be returned by the server. If this code is specified
        +   * to be the OK rpc code, an empty response will be returned.
        +   * 
        + * + * .google.rpc.Status error = 2; + * + * @return The error. + */ + com.google.rpc.Status getError(); + + /** + * + * + *
        +   * The error that will be returned by the server. If this code is specified
        +   * to be the OK rpc code, an empty response will be returned.
        +   * 
        + * + * .google.rpc.Status error = 2; + */ + com.google.rpc.StatusOrBuilder getErrorOrBuilder(); + + /** + * + * + *
        +   * The response to be returned that will signify successful method call.
        +   * 
        + * + * .google.showcase.v1beta1.BlockResponse success = 3; + * + * @return Whether the success field is set. + */ + boolean hasSuccess(); + + /** + * + * + *
        +   * The response to be returned that will signify successful method call.
        +   * 
        + * + * .google.showcase.v1beta1.BlockResponse success = 3; + * + * @return The success. + */ + com.google.showcase.v1beta1.BlockResponse getSuccess(); + + /** + * + * + *
        +   * The response to be returned that will signify successful method call.
        +   * 
        + * + * .google.showcase.v1beta1.BlockResponse success = 3; + */ + com.google.showcase.v1beta1.BlockResponseOrBuilder getSuccessOrBuilder(); + + com.google.showcase.v1beta1.BlockRequest.ResponseCase getResponseCase(); +} diff --git a/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/BlockResponse.java b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/BlockResponse.java new file mode 100644 index 0000000000..81744f9463 --- /dev/null +++ b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/BlockResponse.java @@ -0,0 +1,640 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/echo.proto + +// Protobuf Java Version: 3.25.8 +package com.google.showcase.v1beta1; + +/** + * + * + *
        + * The response for Block method.
        + * 
        + * + * Protobuf type {@code google.showcase.v1beta1.BlockResponse} + */ +public final class BlockResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.BlockResponse) + BlockResponseOrBuilder { + private static final long serialVersionUID = 0L; + + // Use BlockResponse.newBuilder() to construct. + private BlockResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private BlockResponse() { + content_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new BlockResponse(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.EchoOuterClass + .internal_static_google_showcase_v1beta1_BlockResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.EchoOuterClass + .internal_static_google_showcase_v1beta1_BlockResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.BlockResponse.class, + com.google.showcase.v1beta1.BlockResponse.Builder.class); + } + + public static final int CONTENT_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object content_ = ""; + + /** + * + * + *
        +   * This content can contain anything, the server will not depend on a value
        +   * here.
        +   * 
        + * + * string content = 1; + * + * @return The content. + */ + @java.lang.Override + public java.lang.String getContent() { + java.lang.Object ref = content_; + 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(); + content_ = s; + return s; + } + } + + /** + * + * + *
        +   * This content can contain anything, the server will not depend on a value
        +   * here.
        +   * 
        + * + * string content = 1; + * + * @return The bytes for content. + */ + @java.lang.Override + public com.google.protobuf.ByteString getContentBytes() { + java.lang.Object ref = content_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + content_ = 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(content_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, content_); + } + 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(content_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, content_); + } + 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.showcase.v1beta1.BlockResponse)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.BlockResponse other = + (com.google.showcase.v1beta1.BlockResponse) obj; + + if (!getContent().equals(other.getContent())) 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) + CONTENT_FIELD_NUMBER; + hash = (53 * hash) + getContent().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.showcase.v1beta1.BlockResponse parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.BlockResponse parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.BlockResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.BlockResponse 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.showcase.v1beta1.BlockResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.BlockResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.BlockResponse parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.BlockResponse 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.showcase.v1beta1.BlockResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.BlockResponse 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.showcase.v1beta1.BlockResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.BlockResponse 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.showcase.v1beta1.BlockResponse 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 for Block method.
        +   * 
        + * + * Protobuf type {@code google.showcase.v1beta1.BlockResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.BlockResponse) + com.google.showcase.v1beta1.BlockResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.EchoOuterClass + .internal_static_google_showcase_v1beta1_BlockResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.EchoOuterClass + .internal_static_google_showcase_v1beta1_BlockResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.BlockResponse.class, + com.google.showcase.v1beta1.BlockResponse.Builder.class); + } + + // Construct using com.google.showcase.v1beta1.BlockResponse.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + content_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.showcase.v1beta1.EchoOuterClass + .internal_static_google_showcase_v1beta1_BlockResponse_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.BlockResponse getDefaultInstanceForType() { + return com.google.showcase.v1beta1.BlockResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.BlockResponse build() { + com.google.showcase.v1beta1.BlockResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.BlockResponse buildPartial() { + com.google.showcase.v1beta1.BlockResponse result = + new com.google.showcase.v1beta1.BlockResponse(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.showcase.v1beta1.BlockResponse result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.content_ = content_; + } + } + + @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.showcase.v1beta1.BlockResponse) { + return mergeFrom((com.google.showcase.v1beta1.BlockResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.showcase.v1beta1.BlockResponse other) { + if (other == com.google.showcase.v1beta1.BlockResponse.getDefaultInstance()) return this; + if (!other.getContent().isEmpty()) { + content_ = other.content_; + 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: + { + content_ = 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 content_ = ""; + + /** + * + * + *
        +     * This content can contain anything, the server will not depend on a value
        +     * here.
        +     * 
        + * + * string content = 1; + * + * @return The content. + */ + public java.lang.String getContent() { + java.lang.Object ref = content_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + content_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
        +     * This content can contain anything, the server will not depend on a value
        +     * here.
        +     * 
        + * + * string content = 1; + * + * @return The bytes for content. + */ + public com.google.protobuf.ByteString getContentBytes() { + java.lang.Object ref = content_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + content_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
        +     * This content can contain anything, the server will not depend on a value
        +     * here.
        +     * 
        + * + * string content = 1; + * + * @param value The content to set. + * @return This builder for chaining. + */ + public Builder setContent(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + content_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
        +     * This content can contain anything, the server will not depend on a value
        +     * here.
        +     * 
        + * + * string content = 1; + * + * @return This builder for chaining. + */ + public Builder clearContent() { + content_ = getDefaultInstance().getContent(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
        +     * This content can contain anything, the server will not depend on a value
        +     * here.
        +     * 
        + * + * string content = 1; + * + * @param value The bytes for content to set. + * @return This builder for chaining. + */ + public Builder setContentBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + content_ = 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.showcase.v1beta1.BlockResponse) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.BlockResponse) + private static final com.google.showcase.v1beta1.BlockResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.BlockResponse(); + } + + public static com.google.showcase.v1beta1.BlockResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public BlockResponse 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.showcase.v1beta1.BlockResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/BlockResponseOrBuilder.java b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/BlockResponseOrBuilder.java new file mode 100644 index 0000000000..52243d9131 --- /dev/null +++ b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/BlockResponseOrBuilder.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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/echo.proto + +// Protobuf Java Version: 3.25.8 +package com.google.showcase.v1beta1; + +public interface BlockResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.BlockResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
        +   * This content can contain anything, the server will not depend on a value
        +   * here.
        +   * 
        + * + * string content = 1; + * + * @return The content. + */ + java.lang.String getContent(); + + /** + * + * + *
        +   * This content can contain anything, the server will not depend on a value
        +   * here.
        +   * 
        + * + * string content = 1; + * + * @return The bytes for content. + */ + com.google.protobuf.ByteString getContentBytes(); +} diff --git a/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/Blurb.java b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/Blurb.java new file mode 100644 index 0000000000..ba46d1aaf4 --- /dev/null +++ b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/Blurb.java @@ -0,0 +1,2501 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/messaging.proto + +// Protobuf Java Version: 3.25.8 +package com.google.showcase.v1beta1; + +/** + * + * + *
        + * This protocol buffer message represents a blurb sent to a chat room or
        + * posted on a user profile.
        + * 
        + * + * Protobuf type {@code google.showcase.v1beta1.Blurb} + */ +public final class Blurb extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.Blurb) + BlurbOrBuilder { + private static final long serialVersionUID = 0L; + + // Use Blurb.newBuilder() to construct. + private Blurb(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Blurb() { + name_ = ""; + user_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Blurb(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.MessagingOuterClass + .internal_static_google_showcase_v1beta1_Blurb_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.MessagingOuterClass + .internal_static_google_showcase_v1beta1_Blurb_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.Blurb.class, + com.google.showcase.v1beta1.Blurb.Builder.class); + } + + private int bitField0_; + private int contentCase_ = 0; + + @SuppressWarnings("serial") + private java.lang.Object content_; + + public enum ContentCase + implements + com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + TEXT(3), + IMAGE(4), + CONTENT_NOT_SET(0); + private final int value; + + private ContentCase(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 ContentCase valueOf(int value) { + return forNumber(value); + } + + public static ContentCase forNumber(int value) { + switch (value) { + case 3: + return TEXT; + case 4: + return IMAGE; + case 0: + return CONTENT_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public ContentCase getContentCase() { + return ContentCase.forNumber(contentCase_); + } + + private int legacyIdCase_ = 0; + + @SuppressWarnings("serial") + private java.lang.Object legacyId_; + + public enum LegacyIdCase + implements + com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + LEGACY_ROOM_ID(7), + LEGACY_USER_ID(8), + LEGACYID_NOT_SET(0); + private final int value; + + private LegacyIdCase(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 LegacyIdCase valueOf(int value) { + return forNumber(value); + } + + public static LegacyIdCase forNumber(int value) { + switch (value) { + case 7: + return LEGACY_ROOM_ID; + case 8: + return LEGACY_USER_ID; + case 0: + return LEGACYID_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public LegacyIdCase getLegacyIdCase() { + return LegacyIdCase.forNumber(legacyIdCase_); + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + + /** + * + * + *
        +   * The resource name of the chat room.
        +   * 
        + * + * 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 chat room.
        +   * 
        + * + * 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 USER_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object user_ = ""; + + /** + * + * + *
        +   * The resource name of the blurb's author.
        +   * 
        + * + * + * string user = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The user. + */ + @java.lang.Override + public java.lang.String getUser() { + java.lang.Object ref = user_; + 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(); + user_ = s; + return s; + } + } + + /** + * + * + *
        +   * The resource name of the blurb's author.
        +   * 
        + * + * + * string user = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for user. + */ + @java.lang.Override + public com.google.protobuf.ByteString getUserBytes() { + java.lang.Object ref = user_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + user_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int TEXT_FIELD_NUMBER = 3; + + /** + * + * + *
        +   * The textual content of this blurb.
        +   * 
        + * + * string text = 3; + * + * @return Whether the text field is set. + */ + public boolean hasText() { + return contentCase_ == 3; + } + + /** + * + * + *
        +   * The textual content of this blurb.
        +   * 
        + * + * string text = 3; + * + * @return The text. + */ + public java.lang.String getText() { + java.lang.Object ref = ""; + if (contentCase_ == 3) { + ref = content_; + } + 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 (contentCase_ == 3) { + content_ = s; + } + return s; + } + } + + /** + * + * + *
        +   * The textual content of this blurb.
        +   * 
        + * + * string text = 3; + * + * @return The bytes for text. + */ + public com.google.protobuf.ByteString getTextBytes() { + java.lang.Object ref = ""; + if (contentCase_ == 3) { + ref = content_; + } + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + if (contentCase_ == 3) { + content_ = b; + } + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int IMAGE_FIELD_NUMBER = 4; + + /** + * + * + *
        +   * The image content of this blurb.
        +   * 
        + * + * bytes image = 4; + * + * @return Whether the image field is set. + */ + @java.lang.Override + public boolean hasImage() { + return contentCase_ == 4; + } + + /** + * + * + *
        +   * The image content of this blurb.
        +   * 
        + * + * bytes image = 4; + * + * @return The image. + */ + @java.lang.Override + public com.google.protobuf.ByteString getImage() { + if (contentCase_ == 4) { + return (com.google.protobuf.ByteString) content_; + } + return com.google.protobuf.ByteString.EMPTY; + } + + public static final int CREATE_TIME_FIELD_NUMBER = 5; + private com.google.protobuf.Timestamp createTime_; + + /** + * + * + *
        +   * The timestamp at which the blurb was created.
        +   * 
        + * + * .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); + } + + /** + * + * + *
        +   * The timestamp at which the blurb was created.
        +   * 
        + * + * .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_; + } + + /** + * + * + *
        +   * The timestamp at which the blurb was created.
        +   * 
        + * + * .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_; + + /** + * + * + *
        +   * The latest timestamp at which the blurb was updated.
        +   * 
        + * + * .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); + } + + /** + * + * + *
        +   * The latest timestamp at which the blurb was updated.
        +   * 
        + * + * .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_; + } + + /** + * + * + *
        +   * The latest timestamp at which the blurb was updated.
        +   * 
        + * + * .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_; + } + + public static final int LEGACY_ROOM_ID_FIELD_NUMBER = 7; + + /** + * + * + *
        +   * The legacy id of the room. This field is used to signal
        +   * the use of the compound resource pattern
        +   * `rooms/{room}/blurbs/legacy/{legacy_room}.{blurb}`
        +   * 
        + * + * string legacy_room_id = 7; + * + * @return Whether the legacyRoomId field is set. + */ + public boolean hasLegacyRoomId() { + return legacyIdCase_ == 7; + } + + /** + * + * + *
        +   * The legacy id of the room. This field is used to signal
        +   * the use of the compound resource pattern
        +   * `rooms/{room}/blurbs/legacy/{legacy_room}.{blurb}`
        +   * 
        + * + * string legacy_room_id = 7; + * + * @return The legacyRoomId. + */ + public java.lang.String getLegacyRoomId() { + java.lang.Object ref = ""; + if (legacyIdCase_ == 7) { + ref = legacyId_; + } + 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 (legacyIdCase_ == 7) { + legacyId_ = s; + } + return s; + } + } + + /** + * + * + *
        +   * The legacy id of the room. This field is used to signal
        +   * the use of the compound resource pattern
        +   * `rooms/{room}/blurbs/legacy/{legacy_room}.{blurb}`
        +   * 
        + * + * string legacy_room_id = 7; + * + * @return The bytes for legacyRoomId. + */ + public com.google.protobuf.ByteString getLegacyRoomIdBytes() { + java.lang.Object ref = ""; + if (legacyIdCase_ == 7) { + ref = legacyId_; + } + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + if (legacyIdCase_ == 7) { + legacyId_ = b; + } + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int LEGACY_USER_ID_FIELD_NUMBER = 8; + + /** + * + * + *
        +   * The legacy id of the user. This field is used to signal
        +   * the use of the compound resource pattern
        +   * `users/{user}/profile/blurbs/legacy/{legacy_user}~{blurb}`
        +   * 
        + * + * string legacy_user_id = 8; + * + * @return Whether the legacyUserId field is set. + */ + public boolean hasLegacyUserId() { + return legacyIdCase_ == 8; + } + + /** + * + * + *
        +   * The legacy id of the user. This field is used to signal
        +   * the use of the compound resource pattern
        +   * `users/{user}/profile/blurbs/legacy/{legacy_user}~{blurb}`
        +   * 
        + * + * string legacy_user_id = 8; + * + * @return The legacyUserId. + */ + public java.lang.String getLegacyUserId() { + java.lang.Object ref = ""; + if (legacyIdCase_ == 8) { + ref = legacyId_; + } + 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 (legacyIdCase_ == 8) { + legacyId_ = s; + } + return s; + } + } + + /** + * + * + *
        +   * The legacy id of the user. This field is used to signal
        +   * the use of the compound resource pattern
        +   * `users/{user}/profile/blurbs/legacy/{legacy_user}~{blurb}`
        +   * 
        + * + * string legacy_user_id = 8; + * + * @return The bytes for legacyUserId. + */ + public com.google.protobuf.ByteString getLegacyUserIdBytes() { + java.lang.Object ref = ""; + if (legacyIdCase_ == 8) { + ref = legacyId_; + } + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + if (legacyIdCase_ == 8) { + legacyId_ = 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(user_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, user_); + } + if (contentCase_ == 3) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, content_); + } + if (contentCase_ == 4) { + output.writeBytes(4, (com.google.protobuf.ByteString) content_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(5, getCreateTime()); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeMessage(6, getUpdateTime()); + } + if (legacyIdCase_ == 7) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 7, legacyId_); + } + if (legacyIdCase_ == 8) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 8, legacyId_); + } + 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(user_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, user_); + } + if (contentCase_ == 3) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, content_); + } + if (contentCase_ == 4) { + size += + com.google.protobuf.CodedOutputStream.computeBytesSize( + 4, (com.google.protobuf.ByteString) content_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(5, getCreateTime()); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(6, getUpdateTime()); + } + if (legacyIdCase_ == 7) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(7, legacyId_); + } + if (legacyIdCase_ == 8) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(8, legacyId_); + } + 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.showcase.v1beta1.Blurb)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.Blurb other = (com.google.showcase.v1beta1.Blurb) obj; + + if (!getName().equals(other.getName())) return false; + if (!getUser().equals(other.getUser())) 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 (!getContentCase().equals(other.getContentCase())) return false; + switch (contentCase_) { + case 3: + if (!getText().equals(other.getText())) return false; + break; + case 4: + if (!getImage().equals(other.getImage())) return false; + break; + case 0: + default: + } + if (!getLegacyIdCase().equals(other.getLegacyIdCase())) return false; + switch (legacyIdCase_) { + case 7: + if (!getLegacyRoomId().equals(other.getLegacyRoomId())) return false; + break; + case 8: + if (!getLegacyUserId().equals(other.getLegacyUserId())) 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) + USER_FIELD_NUMBER; + hash = (53 * hash) + getUser().hashCode(); + if (hasCreateTime()) { + hash = (37 * hash) + CREATE_TIME_FIELD_NUMBER; + hash = (53 * hash) + getCreateTime().hashCode(); + } + if (hasUpdateTime()) { + hash = (37 * hash) + UPDATE_TIME_FIELD_NUMBER; + hash = (53 * hash) + getUpdateTime().hashCode(); + } + switch (contentCase_) { + case 3: + hash = (37 * hash) + TEXT_FIELD_NUMBER; + hash = (53 * hash) + getText().hashCode(); + break; + case 4: + hash = (37 * hash) + IMAGE_FIELD_NUMBER; + hash = (53 * hash) + getImage().hashCode(); + break; + case 0: + default: + } + switch (legacyIdCase_) { + case 7: + hash = (37 * hash) + LEGACY_ROOM_ID_FIELD_NUMBER; + hash = (53 * hash) + getLegacyRoomId().hashCode(); + break; + case 8: + hash = (37 * hash) + LEGACY_USER_ID_FIELD_NUMBER; + hash = (53 * hash) + getLegacyUserId().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.showcase.v1beta1.Blurb parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.Blurb parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.Blurb parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.Blurb 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.showcase.v1beta1.Blurb parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.Blurb parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.Blurb parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.Blurb 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.showcase.v1beta1.Blurb parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.Blurb 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.showcase.v1beta1.Blurb parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.Blurb 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.showcase.v1beta1.Blurb 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; + } + + /** + * + * + *
        +   * This protocol buffer message represents a blurb sent to a chat room or
        +   * posted on a user profile.
        +   * 
        + * + * Protobuf type {@code google.showcase.v1beta1.Blurb} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.Blurb) + com.google.showcase.v1beta1.BlurbOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.MessagingOuterClass + .internal_static_google_showcase_v1beta1_Blurb_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.MessagingOuterClass + .internal_static_google_showcase_v1beta1_Blurb_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.Blurb.class, + com.google.showcase.v1beta1.Blurb.Builder.class); + } + + // Construct using com.google.showcase.v1beta1.Blurb.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_ = ""; + user_ = ""; + createTime_ = null; + if (createTimeBuilder_ != null) { + createTimeBuilder_.dispose(); + createTimeBuilder_ = null; + } + updateTime_ = null; + if (updateTimeBuilder_ != null) { + updateTimeBuilder_.dispose(); + updateTimeBuilder_ = null; + } + contentCase_ = 0; + content_ = null; + legacyIdCase_ = 0; + legacyId_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.showcase.v1beta1.MessagingOuterClass + .internal_static_google_showcase_v1beta1_Blurb_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.Blurb getDefaultInstanceForType() { + return com.google.showcase.v1beta1.Blurb.getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.Blurb build() { + com.google.showcase.v1beta1.Blurb result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.Blurb buildPartial() { + com.google.showcase.v1beta1.Blurb result = new com.google.showcase.v1beta1.Blurb(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + buildPartialOneofs(result); + onBuilt(); + return result; + } + + private void buildPartial0(com.google.showcase.v1beta1.Blurb result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.user_ = user_; + } + 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_; + } + + private void buildPartialOneofs(com.google.showcase.v1beta1.Blurb result) { + result.contentCase_ = contentCase_; + result.content_ = this.content_; + result.legacyIdCase_ = legacyIdCase_; + result.legacyId_ = this.legacyId_; + } + + @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.showcase.v1beta1.Blurb) { + return mergeFrom((com.google.showcase.v1beta1.Blurb) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.showcase.v1beta1.Blurb other) { + if (other == com.google.showcase.v1beta1.Blurb.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getUser().isEmpty()) { + user_ = other.user_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (other.hasCreateTime()) { + mergeCreateTime(other.getCreateTime()); + } + if (other.hasUpdateTime()) { + mergeUpdateTime(other.getUpdateTime()); + } + switch (other.getContentCase()) { + case TEXT: + { + contentCase_ = 3; + content_ = other.content_; + onChanged(); + break; + } + case IMAGE: + { + setImage(other.getImage()); + break; + } + case CONTENT_NOT_SET: + { + break; + } + } + switch (other.getLegacyIdCase()) { + case LEGACY_ROOM_ID: + { + legacyIdCase_ = 7; + legacyId_ = other.legacyId_; + onChanged(); + break; + } + case LEGACY_USER_ID: + { + legacyIdCase_ = 8; + legacyId_ = other.legacyId_; + onChanged(); + break; + } + case LEGACYID_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 18: + { + user_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + contentCase_ = 3; + content_ = s; + break; + } // case 26 + case 34: + { + content_ = input.readBytes(); + contentCase_ = 4; + break; + } // case 34 + case 42: + { + input.readMessage(getCreateTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000010; + break; + } // case 42 + case 50: + { + input.readMessage(getUpdateTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000020; + break; + } // case 50 + case 58: + { + java.lang.String s = input.readStringRequireUtf8(); + legacyIdCase_ = 7; + legacyId_ = s; + break; + } // case 58 + case 66: + { + java.lang.String s = input.readStringRequireUtf8(); + legacyIdCase_ = 8; + legacyId_ = 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 contentCase_ = 0; + private java.lang.Object content_; + + public ContentCase getContentCase() { + return ContentCase.forNumber(contentCase_); + } + + public Builder clearContent() { + contentCase_ = 0; + content_ = null; + onChanged(); + return this; + } + + private int legacyIdCase_ = 0; + private java.lang.Object legacyId_; + + public LegacyIdCase getLegacyIdCase() { + return LegacyIdCase.forNumber(legacyIdCase_); + } + + public Builder clearLegacyId() { + legacyIdCase_ = 0; + legacyId_ = null; + onChanged(); + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + + /** + * + * + *
        +     * The resource name of the chat room.
        +     * 
        + * + * 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 chat room.
        +     * 
        + * + * 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 chat room.
        +     * 
        + * + * 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 chat room.
        +     * 
        + * + * 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 chat room.
        +     * 
        + * + * 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 user_ = ""; + + /** + * + * + *
        +     * The resource name of the blurb's author.
        +     * 
        + * + * + * string user = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The user. + */ + public java.lang.String getUser() { + java.lang.Object ref = user_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + user_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
        +     * The resource name of the blurb's author.
        +     * 
        + * + * + * string user = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for user. + */ + public com.google.protobuf.ByteString getUserBytes() { + java.lang.Object ref = user_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + user_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
        +     * The resource name of the blurb's author.
        +     * 
        + * + * + * string user = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The user to set. + * @return This builder for chaining. + */ + public Builder setUser(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + user_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
        +     * The resource name of the blurb's author.
        +     * 
        + * + * + * string user = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearUser() { + user_ = getDefaultInstance().getUser(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
        +     * The resource name of the blurb's author.
        +     * 
        + * + * + * string user = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for user to set. + * @return This builder for chaining. + */ + public Builder setUserBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + user_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
        +     * The textual content of this blurb.
        +     * 
        + * + * string text = 3; + * + * @return Whether the text field is set. + */ + @java.lang.Override + public boolean hasText() { + return contentCase_ == 3; + } + + /** + * + * + *
        +     * The textual content of this blurb.
        +     * 
        + * + * string text = 3; + * + * @return The text. + */ + @java.lang.Override + public java.lang.String getText() { + java.lang.Object ref = ""; + if (contentCase_ == 3) { + ref = content_; + } + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (contentCase_ == 3) { + content_ = s; + } + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
        +     * The textual content of this blurb.
        +     * 
        + * + * string text = 3; + * + * @return The bytes for text. + */ + @java.lang.Override + public com.google.protobuf.ByteString getTextBytes() { + java.lang.Object ref = ""; + if (contentCase_ == 3) { + ref = content_; + } + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + if (contentCase_ == 3) { + content_ = b; + } + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
        +     * The textual content of this blurb.
        +     * 
        + * + * string text = 3; + * + * @param value The text to set. + * @return This builder for chaining. + */ + public Builder setText(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + contentCase_ = 3; + content_ = value; + onChanged(); + return this; + } + + /** + * + * + *
        +     * The textual content of this blurb.
        +     * 
        + * + * string text = 3; + * + * @return This builder for chaining. + */ + public Builder clearText() { + if (contentCase_ == 3) { + contentCase_ = 0; + content_ = null; + onChanged(); + } + return this; + } + + /** + * + * + *
        +     * The textual content of this blurb.
        +     * 
        + * + * string text = 3; + * + * @param value The bytes for text to set. + * @return This builder for chaining. + */ + public Builder setTextBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + contentCase_ = 3; + content_ = value; + onChanged(); + return this; + } + + /** + * + * + *
        +     * The image content of this blurb.
        +     * 
        + * + * bytes image = 4; + * + * @return Whether the image field is set. + */ + public boolean hasImage() { + return contentCase_ == 4; + } + + /** + * + * + *
        +     * The image content of this blurb.
        +     * 
        + * + * bytes image = 4; + * + * @return The image. + */ + public com.google.protobuf.ByteString getImage() { + if (contentCase_ == 4) { + return (com.google.protobuf.ByteString) content_; + } + return com.google.protobuf.ByteString.EMPTY; + } + + /** + * + * + *
        +     * The image content of this blurb.
        +     * 
        + * + * bytes image = 4; + * + * @param value The image to set. + * @return This builder for chaining. + */ + public Builder setImage(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + contentCase_ = 4; + content_ = value; + onChanged(); + return this; + } + + /** + * + * + *
        +     * The image content of this blurb.
        +     * 
        + * + * bytes image = 4; + * + * @return This builder for chaining. + */ + public Builder clearImage() { + if (contentCase_ == 4) { + contentCase_ = 0; + content_ = null; + 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_; + + /** + * + * + *
        +     * The timestamp at which the blurb was created.
        +     * 
        + * + * + * .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); + } + + /** + * + * + *
        +     * The timestamp at which the blurb was created.
        +     * 
        + * + * + * .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(); + } + } + + /** + * + * + *
        +     * The timestamp at which the blurb was created.
        +     * 
        + * + * + * .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; + } + + /** + * + * + *
        +     * The timestamp at which the blurb was created.
        +     * 
        + * + * + * .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; + } + + /** + * + * + *
        +     * The timestamp at which the blurb was created.
        +     * 
        + * + * + * .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; + } + + /** + * + * + *
        +     * The timestamp at which the blurb was created.
        +     * 
        + * + * + * .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; + } + + /** + * + * + *
        +     * The timestamp at which the blurb was created.
        +     * 
        + * + * + * .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(); + } + + /** + * + * + *
        +     * The timestamp at which the blurb was created.
        +     * 
        + * + * + * .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_; + } + } + + /** + * + * + *
        +     * The timestamp at which the blurb was created.
        +     * 
        + * + * + * .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_; + + /** + * + * + *
        +     * The latest timestamp at which the blurb was updated.
        +     * 
        + * + * + * .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); + } + + /** + * + * + *
        +     * The latest timestamp at which the blurb was updated.
        +     * 
        + * + * + * .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(); + } + } + + /** + * + * + *
        +     * The latest timestamp at which the blurb was updated.
        +     * 
        + * + * + * .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; + } + + /** + * + * + *
        +     * The latest timestamp at which the blurb was updated.
        +     * 
        + * + * + * .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; + } + + /** + * + * + *
        +     * The latest timestamp at which the blurb was updated.
        +     * 
        + * + * + * .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; + } + + /** + * + * + *
        +     * The latest timestamp at which the blurb was updated.
        +     * 
        + * + * + * .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; + } + + /** + * + * + *
        +     * The latest timestamp at which the blurb was updated.
        +     * 
        + * + * + * .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(); + } + + /** + * + * + *
        +     * The latest timestamp at which the blurb was updated.
        +     * 
        + * + * + * .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_; + } + } + + /** + * + * + *
        +     * The latest timestamp at which the blurb was updated.
        +     * 
        + * + * + * .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_; + } + + /** + * + * + *
        +     * The legacy id of the room. This field is used to signal
        +     * the use of the compound resource pattern
        +     * `rooms/{room}/blurbs/legacy/{legacy_room}.{blurb}`
        +     * 
        + * + * string legacy_room_id = 7; + * + * @return Whether the legacyRoomId field is set. + */ + @java.lang.Override + public boolean hasLegacyRoomId() { + return legacyIdCase_ == 7; + } + + /** + * + * + *
        +     * The legacy id of the room. This field is used to signal
        +     * the use of the compound resource pattern
        +     * `rooms/{room}/blurbs/legacy/{legacy_room}.{blurb}`
        +     * 
        + * + * string legacy_room_id = 7; + * + * @return The legacyRoomId. + */ + @java.lang.Override + public java.lang.String getLegacyRoomId() { + java.lang.Object ref = ""; + if (legacyIdCase_ == 7) { + ref = legacyId_; + } + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (legacyIdCase_ == 7) { + legacyId_ = s; + } + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
        +     * The legacy id of the room. This field is used to signal
        +     * the use of the compound resource pattern
        +     * `rooms/{room}/blurbs/legacy/{legacy_room}.{blurb}`
        +     * 
        + * + * string legacy_room_id = 7; + * + * @return The bytes for legacyRoomId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getLegacyRoomIdBytes() { + java.lang.Object ref = ""; + if (legacyIdCase_ == 7) { + ref = legacyId_; + } + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + if (legacyIdCase_ == 7) { + legacyId_ = b; + } + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
        +     * The legacy id of the room. This field is used to signal
        +     * the use of the compound resource pattern
        +     * `rooms/{room}/blurbs/legacy/{legacy_room}.{blurb}`
        +     * 
        + * + * string legacy_room_id = 7; + * + * @param value The legacyRoomId to set. + * @return This builder for chaining. + */ + public Builder setLegacyRoomId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + legacyIdCase_ = 7; + legacyId_ = value; + onChanged(); + return this; + } + + /** + * + * + *
        +     * The legacy id of the room. This field is used to signal
        +     * the use of the compound resource pattern
        +     * `rooms/{room}/blurbs/legacy/{legacy_room}.{blurb}`
        +     * 
        + * + * string legacy_room_id = 7; + * + * @return This builder for chaining. + */ + public Builder clearLegacyRoomId() { + if (legacyIdCase_ == 7) { + legacyIdCase_ = 0; + legacyId_ = null; + onChanged(); + } + return this; + } + + /** + * + * + *
        +     * The legacy id of the room. This field is used to signal
        +     * the use of the compound resource pattern
        +     * `rooms/{room}/blurbs/legacy/{legacy_room}.{blurb}`
        +     * 
        + * + * string legacy_room_id = 7; + * + * @param value The bytes for legacyRoomId to set. + * @return This builder for chaining. + */ + public Builder setLegacyRoomIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + legacyIdCase_ = 7; + legacyId_ = value; + onChanged(); + return this; + } + + /** + * + * + *
        +     * The legacy id of the user. This field is used to signal
        +     * the use of the compound resource pattern
        +     * `users/{user}/profile/blurbs/legacy/{legacy_user}~{blurb}`
        +     * 
        + * + * string legacy_user_id = 8; + * + * @return Whether the legacyUserId field is set. + */ + @java.lang.Override + public boolean hasLegacyUserId() { + return legacyIdCase_ == 8; + } + + /** + * + * + *
        +     * The legacy id of the user. This field is used to signal
        +     * the use of the compound resource pattern
        +     * `users/{user}/profile/blurbs/legacy/{legacy_user}~{blurb}`
        +     * 
        + * + * string legacy_user_id = 8; + * + * @return The legacyUserId. + */ + @java.lang.Override + public java.lang.String getLegacyUserId() { + java.lang.Object ref = ""; + if (legacyIdCase_ == 8) { + ref = legacyId_; + } + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (legacyIdCase_ == 8) { + legacyId_ = s; + } + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
        +     * The legacy id of the user. This field is used to signal
        +     * the use of the compound resource pattern
        +     * `users/{user}/profile/blurbs/legacy/{legacy_user}~{blurb}`
        +     * 
        + * + * string legacy_user_id = 8; + * + * @return The bytes for legacyUserId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getLegacyUserIdBytes() { + java.lang.Object ref = ""; + if (legacyIdCase_ == 8) { + ref = legacyId_; + } + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + if (legacyIdCase_ == 8) { + legacyId_ = b; + } + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
        +     * The legacy id of the user. This field is used to signal
        +     * the use of the compound resource pattern
        +     * `users/{user}/profile/blurbs/legacy/{legacy_user}~{blurb}`
        +     * 
        + * + * string legacy_user_id = 8; + * + * @param value The legacyUserId to set. + * @return This builder for chaining. + */ + public Builder setLegacyUserId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + legacyIdCase_ = 8; + legacyId_ = value; + onChanged(); + return this; + } + + /** + * + * + *
        +     * The legacy id of the user. This field is used to signal
        +     * the use of the compound resource pattern
        +     * `users/{user}/profile/blurbs/legacy/{legacy_user}~{blurb}`
        +     * 
        + * + * string legacy_user_id = 8; + * + * @return This builder for chaining. + */ + public Builder clearLegacyUserId() { + if (legacyIdCase_ == 8) { + legacyIdCase_ = 0; + legacyId_ = null; + onChanged(); + } + return this; + } + + /** + * + * + *
        +     * The legacy id of the user. This field is used to signal
        +     * the use of the compound resource pattern
        +     * `users/{user}/profile/blurbs/legacy/{legacy_user}~{blurb}`
        +     * 
        + * + * string legacy_user_id = 8; + * + * @param value The bytes for legacyUserId to set. + * @return This builder for chaining. + */ + public Builder setLegacyUserIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + legacyIdCase_ = 8; + legacyId_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.showcase.v1beta1.Blurb) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.Blurb) + private static final com.google.showcase.v1beta1.Blurb DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.Blurb(); + } + + public static com.google.showcase.v1beta1.Blurb getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Blurb 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.showcase.v1beta1.Blurb getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/BlurbName.java b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/BlurbName.java new file mode 100644 index 0000000000..cd7fed2a8a --- /dev/null +++ b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/BlurbName.java @@ -0,0 +1,458 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1; + +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 BlurbName implements ResourceName { + private static final PathTemplate USER_LEGACY_USER_BLURB = + PathTemplate.createWithoutUrlEncoding( + "users/{user}/profile/blurbs/legacy/{legacy_user}~{blurb}"); + private static final PathTemplate USER_BLURB = + PathTemplate.createWithoutUrlEncoding("users/{user}/profile/blurbs/{blurb}"); + private static final PathTemplate ROOM_BLURB = + PathTemplate.createWithoutUrlEncoding("rooms/{room}/blurbs/{blurb}"); + private static final PathTemplate ROOM_LEGACY_ROOM_BLURB = + PathTemplate.createWithoutUrlEncoding("rooms/{room}/blurbs/legacy/{legacy_room}.{blurb}"); + private volatile Map fieldValuesMap; + private PathTemplate pathTemplate; + private String fixedValue; + private final String user; + private final String legacyUser; + private final String blurb; + private final String room; + private final String legacyRoom; + + @Deprecated + protected BlurbName() { + user = null; + legacyUser = null; + blurb = null; + room = null; + legacyRoom = null; + } + + private BlurbName(Builder builder) { + user = Preconditions.checkNotNull(builder.getUser()); + legacyUser = Preconditions.checkNotNull(builder.getLegacyUser()); + blurb = Preconditions.checkNotNull(builder.getBlurb()); + room = null; + legacyRoom = null; + pathTemplate = USER_LEGACY_USER_BLURB; + } + + private BlurbName(UserBlurbBuilder builder) { + user = Preconditions.checkNotNull(builder.getUser()); + blurb = Preconditions.checkNotNull(builder.getBlurb()); + legacyUser = null; + room = null; + legacyRoom = null; + pathTemplate = USER_BLURB; + } + + private BlurbName(RoomBlurbBuilder builder) { + room = Preconditions.checkNotNull(builder.getRoom()); + blurb = Preconditions.checkNotNull(builder.getBlurb()); + user = null; + legacyUser = null; + legacyRoom = null; + pathTemplate = ROOM_BLURB; + } + + private BlurbName(RoomLegacyRoomBlurbBuilder builder) { + room = Preconditions.checkNotNull(builder.getRoom()); + legacyRoom = Preconditions.checkNotNull(builder.getLegacyRoom()); + blurb = Preconditions.checkNotNull(builder.getBlurb()); + user = null; + legacyUser = null; + pathTemplate = ROOM_LEGACY_ROOM_BLURB; + } + + public String getUser() { + return user; + } + + public String getLegacyUser() { + return legacyUser; + } + + public String getBlurb() { + return blurb; + } + + public String getRoom() { + return room; + } + + public String getLegacyRoom() { + return legacyRoom; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public static Builder newUserLegacyUserBlurbBuilder() { + return new Builder(); + } + + public static UserBlurbBuilder newUserBlurbBuilder() { + return new UserBlurbBuilder(); + } + + public static RoomBlurbBuilder newRoomBlurbBuilder() { + return new RoomBlurbBuilder(); + } + + public static RoomLegacyRoomBlurbBuilder newRoomLegacyRoomBlurbBuilder() { + return new RoomLegacyRoomBlurbBuilder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + public static BlurbName of(String user, String legacyUser, String blurb) { + return newBuilder().setUser(user).setLegacyUser(legacyUser).setBlurb(blurb).build(); + } + + public static BlurbName ofUserLegacyUserBlurbName(String user, String legacyUser, String blurb) { + return newBuilder().setUser(user).setLegacyUser(legacyUser).setBlurb(blurb).build(); + } + + public static BlurbName ofUserBlurbName(String user, String blurb) { + return newUserBlurbBuilder().setUser(user).setBlurb(blurb).build(); + } + + public static BlurbName ofRoomBlurbName(String room, String blurb) { + return newRoomBlurbBuilder().setRoom(room).setBlurb(blurb).build(); + } + + public static BlurbName ofRoomLegacyRoomBlurbName(String room, String legacyRoom, String blurb) { + return newRoomLegacyRoomBlurbBuilder() + .setRoom(room) + .setLegacyRoom(legacyRoom) + .setBlurb(blurb) + .build(); + } + + public static String format(String user, String legacyUser, String blurb) { + return newBuilder().setUser(user).setLegacyUser(legacyUser).setBlurb(blurb).build().toString(); + } + + public static String formatUserLegacyUserBlurbName(String user, String legacyUser, String blurb) { + return newBuilder().setUser(user).setLegacyUser(legacyUser).setBlurb(blurb).build().toString(); + } + + public static String formatUserBlurbName(String user, String blurb) { + return newUserBlurbBuilder().setUser(user).setBlurb(blurb).build().toString(); + } + + public static String formatRoomBlurbName(String room, String blurb) { + return newRoomBlurbBuilder().setRoom(room).setBlurb(blurb).build().toString(); + } + + public static String formatRoomLegacyRoomBlurbName(String room, String legacyRoom, String blurb) { + return newRoomLegacyRoomBlurbBuilder() + .setRoom(room) + .setLegacyRoom(legacyRoom) + .setBlurb(blurb) + .build() + .toString(); + } + + public static BlurbName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + if (USER_LEGACY_USER_BLURB.matches(formattedString)) { + Map matchMap = USER_LEGACY_USER_BLURB.match(formattedString); + return ofUserLegacyUserBlurbName( + matchMap.get("user"), matchMap.get("legacy_user"), matchMap.get("blurb")); + } else if (USER_BLURB.matches(formattedString)) { + Map matchMap = USER_BLURB.match(formattedString); + return ofUserBlurbName(matchMap.get("user"), matchMap.get("blurb")); + } else if (ROOM_BLURB.matches(formattedString)) { + Map matchMap = ROOM_BLURB.match(formattedString); + return ofRoomBlurbName(matchMap.get("room"), matchMap.get("blurb")); + } else if (ROOM_LEGACY_ROOM_BLURB.matches(formattedString)) { + Map matchMap = ROOM_LEGACY_ROOM_BLURB.match(formattedString); + return ofRoomLegacyRoomBlurbName( + matchMap.get("room"), matchMap.get("legacy_room"), matchMap.get("blurb")); + } + throw new ValidationException("BlurbName.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 (BlurbName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return USER_LEGACY_USER_BLURB.matches(formattedString) + || USER_BLURB.matches(formattedString) + || ROOM_BLURB.matches(formattedString) + || ROOM_LEGACY_ROOM_BLURB.matches(formattedString); + } + + @Override + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + if (user != null) { + fieldMapBuilder.put("user", user); + } + if (legacyUser != null) { + fieldMapBuilder.put("legacy_user", legacyUser); + } + if (blurb != null) { + fieldMapBuilder.put("blurb", blurb); + } + if (room != null) { + fieldMapBuilder.put("room", room); + } + if (legacyRoom != null) { + fieldMapBuilder.put("legacy_room", legacyRoom); + } + 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()) { + BlurbName that = ((BlurbName) o); + return Objects.equals(this.user, that.user) + && Objects.equals(this.legacyUser, that.legacyUser) + && Objects.equals(this.blurb, that.blurb) + && Objects.equals(this.room, that.room) + && Objects.equals(this.legacyRoom, that.legacyRoom); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= Objects.hashCode(fixedValue); + h *= 1000003; + h ^= Objects.hashCode(user); + h *= 1000003; + h ^= Objects.hashCode(legacyUser); + h *= 1000003; + h ^= Objects.hashCode(blurb); + h *= 1000003; + h ^= Objects.hashCode(room); + h *= 1000003; + h ^= Objects.hashCode(legacyRoom); + return h; + } + + /** Builder for users/{user}/profile/blurbs/legacy/{legacy_user}~{blurb}. */ + public static class Builder { + private String user; + private String legacyUser; + private String blurb; + + protected Builder() {} + + public String getUser() { + return user; + } + + public String getLegacyUser() { + return legacyUser; + } + + public String getBlurb() { + return blurb; + } + + public Builder setUser(String user) { + this.user = user; + return this; + } + + public Builder setLegacyUser(String legacyUser) { + this.legacyUser = legacyUser; + return this; + } + + public Builder setBlurb(String blurb) { + this.blurb = blurb; + return this; + } + + private Builder(BlurbName blurbName) { + Preconditions.checkArgument( + Objects.equals(blurbName.pathTemplate, USER_LEGACY_USER_BLURB), + "toBuilder is only supported when BlurbName has the pattern of" + + " users/{user}/profile/blurbs/legacy/{legacy_user}~{blurb}"); + this.user = blurbName.user; + this.legacyUser = blurbName.legacyUser; + this.blurb = blurbName.blurb; + } + + public BlurbName build() { + return new BlurbName(this); + } + } + + /** Builder for users/{user}/profile/blurbs/{blurb}. */ + public static class UserBlurbBuilder { + private String user; + private String blurb; + + protected UserBlurbBuilder() {} + + public String getUser() { + return user; + } + + public String getBlurb() { + return blurb; + } + + public UserBlurbBuilder setUser(String user) { + this.user = user; + return this; + } + + public UserBlurbBuilder setBlurb(String blurb) { + this.blurb = blurb; + return this; + } + + public BlurbName build() { + return new BlurbName(this); + } + } + + /** Builder for rooms/{room}/blurbs/{blurb}. */ + public static class RoomBlurbBuilder { + private String room; + private String blurb; + + protected RoomBlurbBuilder() {} + + public String getRoom() { + return room; + } + + public String getBlurb() { + return blurb; + } + + public RoomBlurbBuilder setRoom(String room) { + this.room = room; + return this; + } + + public RoomBlurbBuilder setBlurb(String blurb) { + this.blurb = blurb; + return this; + } + + public BlurbName build() { + return new BlurbName(this); + } + } + + /** Builder for rooms/{room}/blurbs/legacy/{legacy_room}.{blurb}. */ + public static class RoomLegacyRoomBlurbBuilder { + private String room; + private String legacyRoom; + private String blurb; + + protected RoomLegacyRoomBlurbBuilder() {} + + public String getRoom() { + return room; + } + + public String getLegacyRoom() { + return legacyRoom; + } + + public String getBlurb() { + return blurb; + } + + public RoomLegacyRoomBlurbBuilder setRoom(String room) { + this.room = room; + return this; + } + + public RoomLegacyRoomBlurbBuilder setLegacyRoom(String legacyRoom) { + this.legacyRoom = legacyRoom; + return this; + } + + public RoomLegacyRoomBlurbBuilder setBlurb(String blurb) { + this.blurb = blurb; + return this; + } + + public BlurbName build() { + return new BlurbName(this); + } + } +} diff --git a/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/BlurbOrBuilder.java b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/BlurbOrBuilder.java new file mode 100644 index 0000000000..d24cf1f7fc --- /dev/null +++ b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/BlurbOrBuilder.java @@ -0,0 +1,321 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/messaging.proto + +// Protobuf Java Version: 3.25.8 +package com.google.showcase.v1beta1; + +public interface BlurbOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.Blurb) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
        +   * The resource name of the chat room.
        +   * 
        + * + * string name = 1; + * + * @return The name. + */ + java.lang.String getName(); + + /** + * + * + *
        +   * The resource name of the chat room.
        +   * 
        + * + * string name = 1; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
        +   * The resource name of the blurb's author.
        +   * 
        + * + * + * string user = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The user. + */ + java.lang.String getUser(); + + /** + * + * + *
        +   * The resource name of the blurb's author.
        +   * 
        + * + * + * string user = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for user. + */ + com.google.protobuf.ByteString getUserBytes(); + + /** + * + * + *
        +   * The textual content of this blurb.
        +   * 
        + * + * string text = 3; + * + * @return Whether the text field is set. + */ + boolean hasText(); + + /** + * + * + *
        +   * The textual content of this blurb.
        +   * 
        + * + * string text = 3; + * + * @return The text. + */ + java.lang.String getText(); + + /** + * + * + *
        +   * The textual content of this blurb.
        +   * 
        + * + * string text = 3; + * + * @return The bytes for text. + */ + com.google.protobuf.ByteString getTextBytes(); + + /** + * + * + *
        +   * The image content of this blurb.
        +   * 
        + * + * bytes image = 4; + * + * @return Whether the image field is set. + */ + boolean hasImage(); + + /** + * + * + *
        +   * The image content of this blurb.
        +   * 
        + * + * bytes image = 4; + * + * @return The image. + */ + com.google.protobuf.ByteString getImage(); + + /** + * + * + *
        +   * The timestamp at which the blurb was created.
        +   * 
        + * + * .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the createTime field is set. + */ + boolean hasCreateTime(); + + /** + * + * + *
        +   * The timestamp at which the blurb was created.
        +   * 
        + * + * .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The createTime. + */ + com.google.protobuf.Timestamp getCreateTime(); + + /** + * + * + *
        +   * The timestamp at which the blurb was created.
        +   * 
        + * + * .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder(); + + /** + * + * + *
        +   * The latest timestamp at which the blurb was updated.
        +   * 
        + * + * .google.protobuf.Timestamp update_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the updateTime field is set. + */ + boolean hasUpdateTime(); + + /** + * + * + *
        +   * The latest timestamp at which the blurb was updated.
        +   * 
        + * + * .google.protobuf.Timestamp update_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The updateTime. + */ + com.google.protobuf.Timestamp getUpdateTime(); + + /** + * + * + *
        +   * The latest timestamp at which the blurb was updated.
        +   * 
        + * + * .google.protobuf.Timestamp update_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder(); + + /** + * + * + *
        +   * The legacy id of the room. This field is used to signal
        +   * the use of the compound resource pattern
        +   * `rooms/{room}/blurbs/legacy/{legacy_room}.{blurb}`
        +   * 
        + * + * string legacy_room_id = 7; + * + * @return Whether the legacyRoomId field is set. + */ + boolean hasLegacyRoomId(); + + /** + * + * + *
        +   * The legacy id of the room. This field is used to signal
        +   * the use of the compound resource pattern
        +   * `rooms/{room}/blurbs/legacy/{legacy_room}.{blurb}`
        +   * 
        + * + * string legacy_room_id = 7; + * + * @return The legacyRoomId. + */ + java.lang.String getLegacyRoomId(); + + /** + * + * + *
        +   * The legacy id of the room. This field is used to signal
        +   * the use of the compound resource pattern
        +   * `rooms/{room}/blurbs/legacy/{legacy_room}.{blurb}`
        +   * 
        + * + * string legacy_room_id = 7; + * + * @return The bytes for legacyRoomId. + */ + com.google.protobuf.ByteString getLegacyRoomIdBytes(); + + /** + * + * + *
        +   * The legacy id of the user. This field is used to signal
        +   * the use of the compound resource pattern
        +   * `users/{user}/profile/blurbs/legacy/{legacy_user}~{blurb}`
        +   * 
        + * + * string legacy_user_id = 8; + * + * @return Whether the legacyUserId field is set. + */ + boolean hasLegacyUserId(); + + /** + * + * + *
        +   * The legacy id of the user. This field is used to signal
        +   * the use of the compound resource pattern
        +   * `users/{user}/profile/blurbs/legacy/{legacy_user}~{blurb}`
        +   * 
        + * + * string legacy_user_id = 8; + * + * @return The legacyUserId. + */ + java.lang.String getLegacyUserId(); + + /** + * + * + *
        +   * The legacy id of the user. This field is used to signal
        +   * the use of the compound resource pattern
        +   * `users/{user}/profile/blurbs/legacy/{legacy_user}~{blurb}`
        +   * 
        + * + * string legacy_user_id = 8; + * + * @return The bytes for legacyUserId. + */ + com.google.protobuf.ByteString getLegacyUserIdBytes(); + + com.google.showcase.v1beta1.Blurb.ContentCase getContentCase(); + + com.google.showcase.v1beta1.Blurb.LegacyIdCase getLegacyIdCase(); +} diff --git a/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ComplianceData.java b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ComplianceData.java new file mode 100644 index 0000000000..9b3990d7b1 --- /dev/null +++ b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ComplianceData.java @@ -0,0 +1,2888 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/compliance.proto + +// Protobuf Java Version: 3.25.8 +package com.google.showcase.v1beta1; + +/** + * + * + *
        + * ComplianceData is a message used for testing REST transcoding of
        + * different data types.
        + * 
        + * + * Protobuf type {@code google.showcase.v1beta1.ComplianceData} + */ +public final class ComplianceData extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.ComplianceData) + ComplianceDataOrBuilder { + private static final long serialVersionUID = 0L; + + // Use ComplianceData.newBuilder() to construct. + private ComplianceData(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ComplianceData() { + fString_ = ""; + fBytes_ = com.google.protobuf.ByteString.EMPTY; + fKingdom_ = 0; + pString_ = ""; + pKingdom_ = 0; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ComplianceData(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.ComplianceOuterClass + .internal_static_google_showcase_v1beta1_ComplianceData_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.ComplianceOuterClass + .internal_static_google_showcase_v1beta1_ComplianceData_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.ComplianceData.class, + com.google.showcase.v1beta1.ComplianceData.Builder.class); + } + + /** Protobuf enum {@code google.showcase.v1beta1.ComplianceData.LifeKingdom} */ + public enum LifeKingdom implements com.google.protobuf.ProtocolMessageEnum { + /** LIFE_KINGDOM_UNSPECIFIED = 0; */ + LIFE_KINGDOM_UNSPECIFIED(0), + /** ARCHAEBACTERIA = 1; */ + ARCHAEBACTERIA(1), + /** EUBACTERIA = 2; */ + EUBACTERIA(2), + /** PROTISTA = 3; */ + PROTISTA(3), + /** FUNGI = 4; */ + FUNGI(4), + /** PLANTAE = 5; */ + PLANTAE(5), + /** ANIMALIA = 6; */ + ANIMALIA(6), + UNRECOGNIZED(-1), + ; + + /** LIFE_KINGDOM_UNSPECIFIED = 0; */ + public static final int LIFE_KINGDOM_UNSPECIFIED_VALUE = 0; + + /** ARCHAEBACTERIA = 1; */ + public static final int ARCHAEBACTERIA_VALUE = 1; + + /** EUBACTERIA = 2; */ + public static final int EUBACTERIA_VALUE = 2; + + /** PROTISTA = 3; */ + public static final int PROTISTA_VALUE = 3; + + /** FUNGI = 4; */ + public static final int FUNGI_VALUE = 4; + + /** PLANTAE = 5; */ + public static final int PLANTAE_VALUE = 5; + + /** ANIMALIA = 6; */ + public static final int ANIMALIA_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 LifeKingdom 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 LifeKingdom forNumber(int value) { + switch (value) { + case 0: + return LIFE_KINGDOM_UNSPECIFIED; + case 1: + return ARCHAEBACTERIA; + case 2: + return EUBACTERIA; + case 3: + return PROTISTA; + case 4: + return FUNGI; + case 5: + return PLANTAE; + case 6: + return ANIMALIA; + 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 LifeKingdom findValueByNumber(int number) { + return LifeKingdom.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.showcase.v1beta1.ComplianceData.getDescriptor().getEnumTypes().get(0); + } + + private static final LifeKingdom[] VALUES = values(); + + public static LifeKingdom 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 LifeKingdom(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.showcase.v1beta1.ComplianceData.LifeKingdom) + } + + private int bitField0_; + public static final int F_STRING_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object fString_ = ""; + + /** + * string f_string = 1; + * + * @return The fString. + */ + @java.lang.Override + public java.lang.String getFString() { + java.lang.Object ref = fString_; + 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(); + fString_ = s; + return s; + } + } + + /** + * string f_string = 1; + * + * @return The bytes for fString. + */ + @java.lang.Override + public com.google.protobuf.ByteString getFStringBytes() { + java.lang.Object ref = fString_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + fString_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int F_INT32_FIELD_NUMBER = 2; + private int fInt32_ = 0; + + /** + * int32 f_int32 = 2; + * + * @return The fInt32. + */ + @java.lang.Override + public int getFInt32() { + return fInt32_; + } + + public static final int F_SINT32_FIELD_NUMBER = 3; + private int fSint32_ = 0; + + /** + * sint32 f_sint32 = 3; + * + * @return The fSint32. + */ + @java.lang.Override + public int getFSint32() { + return fSint32_; + } + + public static final int F_SFIXED32_FIELD_NUMBER = 4; + private int fSfixed32_ = 0; + + /** + * sfixed32 f_sfixed32 = 4; + * + * @return The fSfixed32. + */ + @java.lang.Override + public int getFSfixed32() { + return fSfixed32_; + } + + public static final int F_UINT32_FIELD_NUMBER = 5; + private int fUint32_ = 0; + + /** + * uint32 f_uint32 = 5; + * + * @return The fUint32. + */ + @java.lang.Override + public int getFUint32() { + return fUint32_; + } + + public static final int F_FIXED32_FIELD_NUMBER = 6; + private int fFixed32_ = 0; + + /** + * fixed32 f_fixed32 = 6; + * + * @return The fFixed32. + */ + @java.lang.Override + public int getFFixed32() { + return fFixed32_; + } + + public static final int F_INT64_FIELD_NUMBER = 7; + private long fInt64_ = 0L; + + /** + * int64 f_int64 = 7; + * + * @return The fInt64. + */ + @java.lang.Override + public long getFInt64() { + return fInt64_; + } + + public static final int F_SINT64_FIELD_NUMBER = 8; + private long fSint64_ = 0L; + + /** + * sint64 f_sint64 = 8; + * + * @return The fSint64. + */ + @java.lang.Override + public long getFSint64() { + return fSint64_; + } + + public static final int F_SFIXED64_FIELD_NUMBER = 9; + private long fSfixed64_ = 0L; + + /** + * sfixed64 f_sfixed64 = 9; + * + * @return The fSfixed64. + */ + @java.lang.Override + public long getFSfixed64() { + return fSfixed64_; + } + + public static final int F_UINT64_FIELD_NUMBER = 10; + private long fUint64_ = 0L; + + /** + * uint64 f_uint64 = 10; + * + * @return The fUint64. + */ + @java.lang.Override + public long getFUint64() { + return fUint64_; + } + + public static final int F_FIXED64_FIELD_NUMBER = 11; + private long fFixed64_ = 0L; + + /** + * fixed64 f_fixed64 = 11; + * + * @return The fFixed64. + */ + @java.lang.Override + public long getFFixed64() { + return fFixed64_; + } + + public static final int F_DOUBLE_FIELD_NUMBER = 12; + private double fDouble_ = 0D; + + /** + * double f_double = 12; + * + * @return The fDouble. + */ + @java.lang.Override + public double getFDouble() { + return fDouble_; + } + + public static final int F_FLOAT_FIELD_NUMBER = 13; + private float fFloat_ = 0F; + + /** + * float f_float = 13; + * + * @return The fFloat. + */ + @java.lang.Override + public float getFFloat() { + return fFloat_; + } + + public static final int F_BOOL_FIELD_NUMBER = 14; + private boolean fBool_ = false; + + /** + * bool f_bool = 14; + * + * @return The fBool. + */ + @java.lang.Override + public boolean getFBool() { + return fBool_; + } + + public static final int F_BYTES_FIELD_NUMBER = 15; + private com.google.protobuf.ByteString fBytes_ = com.google.protobuf.ByteString.EMPTY; + + /** + * bytes f_bytes = 15; + * + * @return The fBytes. + */ + @java.lang.Override + public com.google.protobuf.ByteString getFBytes() { + return fBytes_; + } + + public static final int F_KINGDOM_FIELD_NUMBER = 22; + private int fKingdom_ = 0; + + /** + * .google.showcase.v1beta1.ComplianceData.LifeKingdom f_kingdom = 22; + * + * @return The enum numeric value on the wire for fKingdom. + */ + @java.lang.Override + public int getFKingdomValue() { + return fKingdom_; + } + + /** + * .google.showcase.v1beta1.ComplianceData.LifeKingdom f_kingdom = 22; + * + * @return The fKingdom. + */ + @java.lang.Override + public com.google.showcase.v1beta1.ComplianceData.LifeKingdom getFKingdom() { + com.google.showcase.v1beta1.ComplianceData.LifeKingdom result = + com.google.showcase.v1beta1.ComplianceData.LifeKingdom.forNumber(fKingdom_); + return result == null + ? com.google.showcase.v1beta1.ComplianceData.LifeKingdom.UNRECOGNIZED + : result; + } + + public static final int F_CHILD_FIELD_NUMBER = 16; + private com.google.showcase.v1beta1.ComplianceDataChild fChild_; + + /** + * .google.showcase.v1beta1.ComplianceDataChild f_child = 16; + * + * @return Whether the fChild field is set. + */ + @java.lang.Override + public boolean hasFChild() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * .google.showcase.v1beta1.ComplianceDataChild f_child = 16; + * + * @return The fChild. + */ + @java.lang.Override + public com.google.showcase.v1beta1.ComplianceDataChild getFChild() { + return fChild_ == null + ? com.google.showcase.v1beta1.ComplianceDataChild.getDefaultInstance() + : fChild_; + } + + /** .google.showcase.v1beta1.ComplianceDataChild f_child = 16; */ + @java.lang.Override + public com.google.showcase.v1beta1.ComplianceDataChildOrBuilder getFChildOrBuilder() { + return fChild_ == null + ? com.google.showcase.v1beta1.ComplianceDataChild.getDefaultInstance() + : fChild_; + } + + public static final int P_STRING_FIELD_NUMBER = 17; + + @SuppressWarnings("serial") + private volatile java.lang.Object pString_ = ""; + + /** + * optional string p_string = 17; + * + * @return Whether the pString field is set. + */ + @java.lang.Override + public boolean hasPString() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * optional string p_string = 17; + * + * @return The pString. + */ + @java.lang.Override + public java.lang.String getPString() { + java.lang.Object ref = pString_; + 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(); + pString_ = s; + return s; + } + } + + /** + * optional string p_string = 17; + * + * @return The bytes for pString. + */ + @java.lang.Override + public com.google.protobuf.ByteString getPStringBytes() { + java.lang.Object ref = pString_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pString_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int P_INT32_FIELD_NUMBER = 18; + private int pInt32_ = 0; + + /** + * optional int32 p_int32 = 18; + * + * @return Whether the pInt32 field is set. + */ + @java.lang.Override + public boolean hasPInt32() { + return ((bitField0_ & 0x00000004) != 0); + } + + /** + * optional int32 p_int32 = 18; + * + * @return The pInt32. + */ + @java.lang.Override + public int getPInt32() { + return pInt32_; + } + + public static final int P_DOUBLE_FIELD_NUMBER = 19; + private double pDouble_ = 0D; + + /** + * optional double p_double = 19; + * + * @return Whether the pDouble field is set. + */ + @java.lang.Override + public boolean hasPDouble() { + return ((bitField0_ & 0x00000008) != 0); + } + + /** + * optional double p_double = 19; + * + * @return The pDouble. + */ + @java.lang.Override + public double getPDouble() { + return pDouble_; + } + + public static final int P_BOOL_FIELD_NUMBER = 20; + private boolean pBool_ = false; + + /** + * optional bool p_bool = 20; + * + * @return Whether the pBool field is set. + */ + @java.lang.Override + public boolean hasPBool() { + return ((bitField0_ & 0x00000010) != 0); + } + + /** + * optional bool p_bool = 20; + * + * @return The pBool. + */ + @java.lang.Override + public boolean getPBool() { + return pBool_; + } + + public static final int P_KINGDOM_FIELD_NUMBER = 23; + private int pKingdom_ = 0; + + /** + * optional .google.showcase.v1beta1.ComplianceData.LifeKingdom p_kingdom = 23; + * + * @return Whether the pKingdom field is set. + */ + @java.lang.Override + public boolean hasPKingdom() { + return ((bitField0_ & 0x00000020) != 0); + } + + /** + * optional .google.showcase.v1beta1.ComplianceData.LifeKingdom p_kingdom = 23; + * + * @return The enum numeric value on the wire for pKingdom. + */ + @java.lang.Override + public int getPKingdomValue() { + return pKingdom_; + } + + /** + * optional .google.showcase.v1beta1.ComplianceData.LifeKingdom p_kingdom = 23; + * + * @return The pKingdom. + */ + @java.lang.Override + public com.google.showcase.v1beta1.ComplianceData.LifeKingdom getPKingdom() { + com.google.showcase.v1beta1.ComplianceData.LifeKingdom result = + com.google.showcase.v1beta1.ComplianceData.LifeKingdom.forNumber(pKingdom_); + return result == null + ? com.google.showcase.v1beta1.ComplianceData.LifeKingdom.UNRECOGNIZED + : result; + } + + public static final int P_CHILD_FIELD_NUMBER = 21; + private com.google.showcase.v1beta1.ComplianceDataChild pChild_; + + /** + * optional .google.showcase.v1beta1.ComplianceDataChild p_child = 21; + * + * @return Whether the pChild field is set. + */ + @java.lang.Override + public boolean hasPChild() { + return ((bitField0_ & 0x00000040) != 0); + } + + /** + * optional .google.showcase.v1beta1.ComplianceDataChild p_child = 21; + * + * @return The pChild. + */ + @java.lang.Override + public com.google.showcase.v1beta1.ComplianceDataChild getPChild() { + return pChild_ == null + ? com.google.showcase.v1beta1.ComplianceDataChild.getDefaultInstance() + : pChild_; + } + + /** optional .google.showcase.v1beta1.ComplianceDataChild p_child = 21; */ + @java.lang.Override + public com.google.showcase.v1beta1.ComplianceDataChildOrBuilder getPChildOrBuilder() { + return pChild_ == null + ? com.google.showcase.v1beta1.ComplianceDataChild.getDefaultInstance() + : pChild_; + } + + 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(fString_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, fString_); + } + if (fInt32_ != 0) { + output.writeInt32(2, fInt32_); + } + if (fSint32_ != 0) { + output.writeSInt32(3, fSint32_); + } + if (fSfixed32_ != 0) { + output.writeSFixed32(4, fSfixed32_); + } + if (fUint32_ != 0) { + output.writeUInt32(5, fUint32_); + } + if (fFixed32_ != 0) { + output.writeFixed32(6, fFixed32_); + } + if (fInt64_ != 0L) { + output.writeInt64(7, fInt64_); + } + if (fSint64_ != 0L) { + output.writeSInt64(8, fSint64_); + } + if (fSfixed64_ != 0L) { + output.writeSFixed64(9, fSfixed64_); + } + if (fUint64_ != 0L) { + output.writeUInt64(10, fUint64_); + } + if (fFixed64_ != 0L) { + output.writeFixed64(11, fFixed64_); + } + if (java.lang.Double.doubleToRawLongBits(fDouble_) != 0) { + output.writeDouble(12, fDouble_); + } + if (java.lang.Float.floatToRawIntBits(fFloat_) != 0) { + output.writeFloat(13, fFloat_); + } + if (fBool_ != false) { + output.writeBool(14, fBool_); + } + if (!fBytes_.isEmpty()) { + output.writeBytes(15, fBytes_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(16, getFChild()); + } + if (((bitField0_ & 0x00000002) != 0)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 17, pString_); + } + if (((bitField0_ & 0x00000004) != 0)) { + output.writeInt32(18, pInt32_); + } + if (((bitField0_ & 0x00000008) != 0)) { + output.writeDouble(19, pDouble_); + } + if (((bitField0_ & 0x00000010) != 0)) { + output.writeBool(20, pBool_); + } + if (((bitField0_ & 0x00000040) != 0)) { + output.writeMessage(21, getPChild()); + } + if (fKingdom_ + != com.google.showcase.v1beta1.ComplianceData.LifeKingdom.LIFE_KINGDOM_UNSPECIFIED + .getNumber()) { + output.writeEnum(22, fKingdom_); + } + if (((bitField0_ & 0x00000020) != 0)) { + output.writeEnum(23, pKingdom_); + } + 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(fString_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, fString_); + } + if (fInt32_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(2, fInt32_); + } + if (fSint32_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeSInt32Size(3, fSint32_); + } + if (fSfixed32_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeSFixed32Size(4, fSfixed32_); + } + if (fUint32_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeUInt32Size(5, fUint32_); + } + if (fFixed32_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeFixed32Size(6, fFixed32_); + } + if (fInt64_ != 0L) { + size += com.google.protobuf.CodedOutputStream.computeInt64Size(7, fInt64_); + } + if (fSint64_ != 0L) { + size += com.google.protobuf.CodedOutputStream.computeSInt64Size(8, fSint64_); + } + if (fSfixed64_ != 0L) { + size += com.google.protobuf.CodedOutputStream.computeSFixed64Size(9, fSfixed64_); + } + if (fUint64_ != 0L) { + size += com.google.protobuf.CodedOutputStream.computeUInt64Size(10, fUint64_); + } + if (fFixed64_ != 0L) { + size += com.google.protobuf.CodedOutputStream.computeFixed64Size(11, fFixed64_); + } + if (java.lang.Double.doubleToRawLongBits(fDouble_) != 0) { + size += com.google.protobuf.CodedOutputStream.computeDoubleSize(12, fDouble_); + } + if (java.lang.Float.floatToRawIntBits(fFloat_) != 0) { + size += com.google.protobuf.CodedOutputStream.computeFloatSize(13, fFloat_); + } + if (fBool_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(14, fBool_); + } + if (!fBytes_.isEmpty()) { + size += com.google.protobuf.CodedOutputStream.computeBytesSize(15, fBytes_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(16, getFChild()); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(17, pString_); + } + if (((bitField0_ & 0x00000004) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(18, pInt32_); + } + if (((bitField0_ & 0x00000008) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeDoubleSize(19, pDouble_); + } + if (((bitField0_ & 0x00000010) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(20, pBool_); + } + if (((bitField0_ & 0x00000040) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(21, getPChild()); + } + if (fKingdom_ + != com.google.showcase.v1beta1.ComplianceData.LifeKingdom.LIFE_KINGDOM_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(22, fKingdom_); + } + if (((bitField0_ & 0x00000020) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(23, pKingdom_); + } + 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.showcase.v1beta1.ComplianceData)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.ComplianceData other = + (com.google.showcase.v1beta1.ComplianceData) obj; + + if (!getFString().equals(other.getFString())) return false; + if (getFInt32() != other.getFInt32()) return false; + if (getFSint32() != other.getFSint32()) return false; + if (getFSfixed32() != other.getFSfixed32()) return false; + if (getFUint32() != other.getFUint32()) return false; + if (getFFixed32() != other.getFFixed32()) return false; + if (getFInt64() != other.getFInt64()) return false; + if (getFSint64() != other.getFSint64()) return false; + if (getFSfixed64() != other.getFSfixed64()) return false; + if (getFUint64() != other.getFUint64()) return false; + if (getFFixed64() != other.getFFixed64()) return false; + if (java.lang.Double.doubleToLongBits(getFDouble()) + != java.lang.Double.doubleToLongBits(other.getFDouble())) return false; + if (java.lang.Float.floatToIntBits(getFFloat()) + != java.lang.Float.floatToIntBits(other.getFFloat())) return false; + if (getFBool() != other.getFBool()) return false; + if (!getFBytes().equals(other.getFBytes())) return false; + if (fKingdom_ != other.fKingdom_) return false; + if (hasFChild() != other.hasFChild()) return false; + if (hasFChild()) { + if (!getFChild().equals(other.getFChild())) return false; + } + if (hasPString() != other.hasPString()) return false; + if (hasPString()) { + if (!getPString().equals(other.getPString())) return false; + } + if (hasPInt32() != other.hasPInt32()) return false; + if (hasPInt32()) { + if (getPInt32() != other.getPInt32()) return false; + } + if (hasPDouble() != other.hasPDouble()) return false; + if (hasPDouble()) { + if (java.lang.Double.doubleToLongBits(getPDouble()) + != java.lang.Double.doubleToLongBits(other.getPDouble())) return false; + } + if (hasPBool() != other.hasPBool()) return false; + if (hasPBool()) { + if (getPBool() != other.getPBool()) return false; + } + if (hasPKingdom() != other.hasPKingdom()) return false; + if (hasPKingdom()) { + if (pKingdom_ != other.pKingdom_) return false; + } + if (hasPChild() != other.hasPChild()) return false; + if (hasPChild()) { + if (!getPChild().equals(other.getPChild())) 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) + F_STRING_FIELD_NUMBER; + hash = (53 * hash) + getFString().hashCode(); + hash = (37 * hash) + F_INT32_FIELD_NUMBER; + hash = (53 * hash) + getFInt32(); + hash = (37 * hash) + F_SINT32_FIELD_NUMBER; + hash = (53 * hash) + getFSint32(); + hash = (37 * hash) + F_SFIXED32_FIELD_NUMBER; + hash = (53 * hash) + getFSfixed32(); + hash = (37 * hash) + F_UINT32_FIELD_NUMBER; + hash = (53 * hash) + getFUint32(); + hash = (37 * hash) + F_FIXED32_FIELD_NUMBER; + hash = (53 * hash) + getFFixed32(); + hash = (37 * hash) + F_INT64_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getFInt64()); + hash = (37 * hash) + F_SINT64_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getFSint64()); + hash = (37 * hash) + F_SFIXED64_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getFSfixed64()); + hash = (37 * hash) + F_UINT64_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getFUint64()); + hash = (37 * hash) + F_FIXED64_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getFFixed64()); + hash = (37 * hash) + F_DOUBLE_FIELD_NUMBER; + hash = + (53 * hash) + + com.google.protobuf.Internal.hashLong( + java.lang.Double.doubleToLongBits(getFDouble())); + hash = (37 * hash) + F_FLOAT_FIELD_NUMBER; + hash = (53 * hash) + java.lang.Float.floatToIntBits(getFFloat()); + hash = (37 * hash) + F_BOOL_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getFBool()); + hash = (37 * hash) + F_BYTES_FIELD_NUMBER; + hash = (53 * hash) + getFBytes().hashCode(); + hash = (37 * hash) + F_KINGDOM_FIELD_NUMBER; + hash = (53 * hash) + fKingdom_; + if (hasFChild()) { + hash = (37 * hash) + F_CHILD_FIELD_NUMBER; + hash = (53 * hash) + getFChild().hashCode(); + } + if (hasPString()) { + hash = (37 * hash) + P_STRING_FIELD_NUMBER; + hash = (53 * hash) + getPString().hashCode(); + } + if (hasPInt32()) { + hash = (37 * hash) + P_INT32_FIELD_NUMBER; + hash = (53 * hash) + getPInt32(); + } + if (hasPDouble()) { + hash = (37 * hash) + P_DOUBLE_FIELD_NUMBER; + hash = + (53 * hash) + + com.google.protobuf.Internal.hashLong( + java.lang.Double.doubleToLongBits(getPDouble())); + } + if (hasPBool()) { + hash = (37 * hash) + P_BOOL_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getPBool()); + } + if (hasPKingdom()) { + hash = (37 * hash) + P_KINGDOM_FIELD_NUMBER; + hash = (53 * hash) + pKingdom_; + } + if (hasPChild()) { + hash = (37 * hash) + P_CHILD_FIELD_NUMBER; + hash = (53 * hash) + getPChild().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.showcase.v1beta1.ComplianceData parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.ComplianceData parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.ComplianceData parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.ComplianceData 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.showcase.v1beta1.ComplianceData parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.ComplianceData parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.ComplianceData parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.ComplianceData 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.showcase.v1beta1.ComplianceData parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.ComplianceData 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.showcase.v1beta1.ComplianceData parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.ComplianceData 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.showcase.v1beta1.ComplianceData 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; + } + + /** + * + * + *
        +   * ComplianceData is a message used for testing REST transcoding of
        +   * different data types.
        +   * 
        + * + * Protobuf type {@code google.showcase.v1beta1.ComplianceData} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.ComplianceData) + com.google.showcase.v1beta1.ComplianceDataOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.ComplianceOuterClass + .internal_static_google_showcase_v1beta1_ComplianceData_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.ComplianceOuterClass + .internal_static_google_showcase_v1beta1_ComplianceData_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.ComplianceData.class, + com.google.showcase.v1beta1.ComplianceData.Builder.class); + } + + // Construct using com.google.showcase.v1beta1.ComplianceData.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getFChildFieldBuilder(); + getPChildFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + fString_ = ""; + fInt32_ = 0; + fSint32_ = 0; + fSfixed32_ = 0; + fUint32_ = 0; + fFixed32_ = 0; + fInt64_ = 0L; + fSint64_ = 0L; + fSfixed64_ = 0L; + fUint64_ = 0L; + fFixed64_ = 0L; + fDouble_ = 0D; + fFloat_ = 0F; + fBool_ = false; + fBytes_ = com.google.protobuf.ByteString.EMPTY; + fKingdom_ = 0; + fChild_ = null; + if (fChildBuilder_ != null) { + fChildBuilder_.dispose(); + fChildBuilder_ = null; + } + pString_ = ""; + pInt32_ = 0; + pDouble_ = 0D; + pBool_ = false; + pKingdom_ = 0; + pChild_ = null; + if (pChildBuilder_ != null) { + pChildBuilder_.dispose(); + pChildBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.showcase.v1beta1.ComplianceOuterClass + .internal_static_google_showcase_v1beta1_ComplianceData_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.ComplianceData getDefaultInstanceForType() { + return com.google.showcase.v1beta1.ComplianceData.getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.ComplianceData build() { + com.google.showcase.v1beta1.ComplianceData result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.ComplianceData buildPartial() { + com.google.showcase.v1beta1.ComplianceData result = + new com.google.showcase.v1beta1.ComplianceData(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.showcase.v1beta1.ComplianceData result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.fString_ = fString_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.fInt32_ = fInt32_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.fSint32_ = fSint32_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.fSfixed32_ = fSfixed32_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.fUint32_ = fUint32_; + } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.fFixed32_ = fFixed32_; + } + if (((from_bitField0_ & 0x00000040) != 0)) { + result.fInt64_ = fInt64_; + } + if (((from_bitField0_ & 0x00000080) != 0)) { + result.fSint64_ = fSint64_; + } + if (((from_bitField0_ & 0x00000100) != 0)) { + result.fSfixed64_ = fSfixed64_; + } + if (((from_bitField0_ & 0x00000200) != 0)) { + result.fUint64_ = fUint64_; + } + if (((from_bitField0_ & 0x00000400) != 0)) { + result.fFixed64_ = fFixed64_; + } + if (((from_bitField0_ & 0x00000800) != 0)) { + result.fDouble_ = fDouble_; + } + if (((from_bitField0_ & 0x00001000) != 0)) { + result.fFloat_ = fFloat_; + } + if (((from_bitField0_ & 0x00002000) != 0)) { + result.fBool_ = fBool_; + } + if (((from_bitField0_ & 0x00004000) != 0)) { + result.fBytes_ = fBytes_; + } + if (((from_bitField0_ & 0x00008000) != 0)) { + result.fKingdom_ = fKingdom_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00010000) != 0)) { + result.fChild_ = fChildBuilder_ == null ? fChild_ : fChildBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00020000) != 0)) { + result.pString_ = pString_; + to_bitField0_ |= 0x00000002; + } + if (((from_bitField0_ & 0x00040000) != 0)) { + result.pInt32_ = pInt32_; + to_bitField0_ |= 0x00000004; + } + if (((from_bitField0_ & 0x00080000) != 0)) { + result.pDouble_ = pDouble_; + to_bitField0_ |= 0x00000008; + } + if (((from_bitField0_ & 0x00100000) != 0)) { + result.pBool_ = pBool_; + to_bitField0_ |= 0x00000010; + } + if (((from_bitField0_ & 0x00200000) != 0)) { + result.pKingdom_ = pKingdom_; + to_bitField0_ |= 0x00000020; + } + if (((from_bitField0_ & 0x00400000) != 0)) { + result.pChild_ = pChildBuilder_ == null ? pChild_ : pChildBuilder_.build(); + to_bitField0_ |= 0x00000040; + } + 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.showcase.v1beta1.ComplianceData) { + return mergeFrom((com.google.showcase.v1beta1.ComplianceData) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.showcase.v1beta1.ComplianceData other) { + if (other == com.google.showcase.v1beta1.ComplianceData.getDefaultInstance()) return this; + if (!other.getFString().isEmpty()) { + fString_ = other.fString_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.getFInt32() != 0) { + setFInt32(other.getFInt32()); + } + if (other.getFSint32() != 0) { + setFSint32(other.getFSint32()); + } + if (other.getFSfixed32() != 0) { + setFSfixed32(other.getFSfixed32()); + } + if (other.getFUint32() != 0) { + setFUint32(other.getFUint32()); + } + if (other.getFFixed32() != 0) { + setFFixed32(other.getFFixed32()); + } + if (other.getFInt64() != 0L) { + setFInt64(other.getFInt64()); + } + if (other.getFSint64() != 0L) { + setFSint64(other.getFSint64()); + } + if (other.getFSfixed64() != 0L) { + setFSfixed64(other.getFSfixed64()); + } + if (other.getFUint64() != 0L) { + setFUint64(other.getFUint64()); + } + if (other.getFFixed64() != 0L) { + setFFixed64(other.getFFixed64()); + } + if (other.getFDouble() != 0D) { + setFDouble(other.getFDouble()); + } + if (other.getFFloat() != 0F) { + setFFloat(other.getFFloat()); + } + if (other.getFBool() != false) { + setFBool(other.getFBool()); + } + if (other.getFBytes() != com.google.protobuf.ByteString.EMPTY) { + setFBytes(other.getFBytes()); + } + if (other.fKingdom_ != 0) { + setFKingdomValue(other.getFKingdomValue()); + } + if (other.hasFChild()) { + mergeFChild(other.getFChild()); + } + if (other.hasPString()) { + pString_ = other.pString_; + bitField0_ |= 0x00020000; + onChanged(); + } + if (other.hasPInt32()) { + setPInt32(other.getPInt32()); + } + if (other.hasPDouble()) { + setPDouble(other.getPDouble()); + } + if (other.hasPBool()) { + setPBool(other.getPBool()); + } + if (other.hasPKingdom()) { + setPKingdom(other.getPKingdom()); + } + if (other.hasPChild()) { + mergePChild(other.getPChild()); + } + 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: + { + fString_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 16: + { + fInt32_ = input.readInt32(); + bitField0_ |= 0x00000002; + break; + } // case 16 + case 24: + { + fSint32_ = input.readSInt32(); + bitField0_ |= 0x00000004; + break; + } // case 24 + case 37: + { + fSfixed32_ = input.readSFixed32(); + bitField0_ |= 0x00000008; + break; + } // case 37 + case 40: + { + fUint32_ = input.readUInt32(); + bitField0_ |= 0x00000010; + break; + } // case 40 + case 53: + { + fFixed32_ = input.readFixed32(); + bitField0_ |= 0x00000020; + break; + } // case 53 + case 56: + { + fInt64_ = input.readInt64(); + bitField0_ |= 0x00000040; + break; + } // case 56 + case 64: + { + fSint64_ = input.readSInt64(); + bitField0_ |= 0x00000080; + break; + } // case 64 + case 73: + { + fSfixed64_ = input.readSFixed64(); + bitField0_ |= 0x00000100; + break; + } // case 73 + case 80: + { + fUint64_ = input.readUInt64(); + bitField0_ |= 0x00000200; + break; + } // case 80 + case 89: + { + fFixed64_ = input.readFixed64(); + bitField0_ |= 0x00000400; + break; + } // case 89 + case 97: + { + fDouble_ = input.readDouble(); + bitField0_ |= 0x00000800; + break; + } // case 97 + case 109: + { + fFloat_ = input.readFloat(); + bitField0_ |= 0x00001000; + break; + } // case 109 + case 112: + { + fBool_ = input.readBool(); + bitField0_ |= 0x00002000; + break; + } // case 112 + case 122: + { + fBytes_ = input.readBytes(); + bitField0_ |= 0x00004000; + break; + } // case 122 + case 130: + { + input.readMessage(getFChildFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00010000; + break; + } // case 130 + case 138: + { + pString_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00020000; + break; + } // case 138 + case 144: + { + pInt32_ = input.readInt32(); + bitField0_ |= 0x00040000; + break; + } // case 144 + case 153: + { + pDouble_ = input.readDouble(); + bitField0_ |= 0x00080000; + break; + } // case 153 + case 160: + { + pBool_ = input.readBool(); + bitField0_ |= 0x00100000; + break; + } // case 160 + case 170: + { + input.readMessage(getPChildFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00400000; + break; + } // case 170 + case 176: + { + fKingdom_ = input.readEnum(); + bitField0_ |= 0x00008000; + break; + } // case 176 + case 184: + { + pKingdom_ = input.readEnum(); + bitField0_ |= 0x00200000; + break; + } // case 184 + 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 fString_ = ""; + + /** + * string f_string = 1; + * + * @return The fString. + */ + public java.lang.String getFString() { + java.lang.Object ref = fString_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + fString_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * string f_string = 1; + * + * @return The bytes for fString. + */ + public com.google.protobuf.ByteString getFStringBytes() { + java.lang.Object ref = fString_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + fString_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * string f_string = 1; + * + * @param value The fString to set. + * @return This builder for chaining. + */ + public Builder setFString(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + fString_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * string f_string = 1; + * + * @return This builder for chaining. + */ + public Builder clearFString() { + fString_ = getDefaultInstance().getFString(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * string f_string = 1; + * + * @param value The bytes for fString to set. + * @return This builder for chaining. + */ + public Builder setFStringBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + fString_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private int fInt32_; + + /** + * int32 f_int32 = 2; + * + * @return The fInt32. + */ + @java.lang.Override + public int getFInt32() { + return fInt32_; + } + + /** + * int32 f_int32 = 2; + * + * @param value The fInt32 to set. + * @return This builder for chaining. + */ + public Builder setFInt32(int value) { + + fInt32_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * int32 f_int32 = 2; + * + * @return This builder for chaining. + */ + public Builder clearFInt32() { + bitField0_ = (bitField0_ & ~0x00000002); + fInt32_ = 0; + onChanged(); + return this; + } + + private int fSint32_; + + /** + * sint32 f_sint32 = 3; + * + * @return The fSint32. + */ + @java.lang.Override + public int getFSint32() { + return fSint32_; + } + + /** + * sint32 f_sint32 = 3; + * + * @param value The fSint32 to set. + * @return This builder for chaining. + */ + public Builder setFSint32(int value) { + + fSint32_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * sint32 f_sint32 = 3; + * + * @return This builder for chaining. + */ + public Builder clearFSint32() { + bitField0_ = (bitField0_ & ~0x00000004); + fSint32_ = 0; + onChanged(); + return this; + } + + private int fSfixed32_; + + /** + * sfixed32 f_sfixed32 = 4; + * + * @return The fSfixed32. + */ + @java.lang.Override + public int getFSfixed32() { + return fSfixed32_; + } + + /** + * sfixed32 f_sfixed32 = 4; + * + * @param value The fSfixed32 to set. + * @return This builder for chaining. + */ + public Builder setFSfixed32(int value) { + + fSfixed32_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + /** + * sfixed32 f_sfixed32 = 4; + * + * @return This builder for chaining. + */ + public Builder clearFSfixed32() { + bitField0_ = (bitField0_ & ~0x00000008); + fSfixed32_ = 0; + onChanged(); + return this; + } + + private int fUint32_; + + /** + * uint32 f_uint32 = 5; + * + * @return The fUint32. + */ + @java.lang.Override + public int getFUint32() { + return fUint32_; + } + + /** + * uint32 f_uint32 = 5; + * + * @param value The fUint32 to set. + * @return This builder for chaining. + */ + public Builder setFUint32(int value) { + + fUint32_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + /** + * uint32 f_uint32 = 5; + * + * @return This builder for chaining. + */ + public Builder clearFUint32() { + bitField0_ = (bitField0_ & ~0x00000010); + fUint32_ = 0; + onChanged(); + return this; + } + + private int fFixed32_; + + /** + * fixed32 f_fixed32 = 6; + * + * @return The fFixed32. + */ + @java.lang.Override + public int getFFixed32() { + return fFixed32_; + } + + /** + * fixed32 f_fixed32 = 6; + * + * @param value The fFixed32 to set. + * @return This builder for chaining. + */ + public Builder setFFixed32(int value) { + + fFixed32_ = value; + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + + /** + * fixed32 f_fixed32 = 6; + * + * @return This builder for chaining. + */ + public Builder clearFFixed32() { + bitField0_ = (bitField0_ & ~0x00000020); + fFixed32_ = 0; + onChanged(); + return this; + } + + private long fInt64_; + + /** + * int64 f_int64 = 7; + * + * @return The fInt64. + */ + @java.lang.Override + public long getFInt64() { + return fInt64_; + } + + /** + * int64 f_int64 = 7; + * + * @param value The fInt64 to set. + * @return This builder for chaining. + */ + public Builder setFInt64(long value) { + + fInt64_ = value; + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + + /** + * int64 f_int64 = 7; + * + * @return This builder for chaining. + */ + public Builder clearFInt64() { + bitField0_ = (bitField0_ & ~0x00000040); + fInt64_ = 0L; + onChanged(); + return this; + } + + private long fSint64_; + + /** + * sint64 f_sint64 = 8; + * + * @return The fSint64. + */ + @java.lang.Override + public long getFSint64() { + return fSint64_; + } + + /** + * sint64 f_sint64 = 8; + * + * @param value The fSint64 to set. + * @return This builder for chaining. + */ + public Builder setFSint64(long value) { + + fSint64_ = value; + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + + /** + * sint64 f_sint64 = 8; + * + * @return This builder for chaining. + */ + public Builder clearFSint64() { + bitField0_ = (bitField0_ & ~0x00000080); + fSint64_ = 0L; + onChanged(); + return this; + } + + private long fSfixed64_; + + /** + * sfixed64 f_sfixed64 = 9; + * + * @return The fSfixed64. + */ + @java.lang.Override + public long getFSfixed64() { + return fSfixed64_; + } + + /** + * sfixed64 f_sfixed64 = 9; + * + * @param value The fSfixed64 to set. + * @return This builder for chaining. + */ + public Builder setFSfixed64(long value) { + + fSfixed64_ = value; + bitField0_ |= 0x00000100; + onChanged(); + return this; + } + + /** + * sfixed64 f_sfixed64 = 9; + * + * @return This builder for chaining. + */ + public Builder clearFSfixed64() { + bitField0_ = (bitField0_ & ~0x00000100); + fSfixed64_ = 0L; + onChanged(); + return this; + } + + private long fUint64_; + + /** + * uint64 f_uint64 = 10; + * + * @return The fUint64. + */ + @java.lang.Override + public long getFUint64() { + return fUint64_; + } + + /** + * uint64 f_uint64 = 10; + * + * @param value The fUint64 to set. + * @return This builder for chaining. + */ + public Builder setFUint64(long value) { + + fUint64_ = value; + bitField0_ |= 0x00000200; + onChanged(); + return this; + } + + /** + * uint64 f_uint64 = 10; + * + * @return This builder for chaining. + */ + public Builder clearFUint64() { + bitField0_ = (bitField0_ & ~0x00000200); + fUint64_ = 0L; + onChanged(); + return this; + } + + private long fFixed64_; + + /** + * fixed64 f_fixed64 = 11; + * + * @return The fFixed64. + */ + @java.lang.Override + public long getFFixed64() { + return fFixed64_; + } + + /** + * fixed64 f_fixed64 = 11; + * + * @param value The fFixed64 to set. + * @return This builder for chaining. + */ + public Builder setFFixed64(long value) { + + fFixed64_ = value; + bitField0_ |= 0x00000400; + onChanged(); + return this; + } + + /** + * fixed64 f_fixed64 = 11; + * + * @return This builder for chaining. + */ + public Builder clearFFixed64() { + bitField0_ = (bitField0_ & ~0x00000400); + fFixed64_ = 0L; + onChanged(); + return this; + } + + private double fDouble_; + + /** + * double f_double = 12; + * + * @return The fDouble. + */ + @java.lang.Override + public double getFDouble() { + return fDouble_; + } + + /** + * double f_double = 12; + * + * @param value The fDouble to set. + * @return This builder for chaining. + */ + public Builder setFDouble(double value) { + + fDouble_ = value; + bitField0_ |= 0x00000800; + onChanged(); + return this; + } + + /** + * double f_double = 12; + * + * @return This builder for chaining. + */ + public Builder clearFDouble() { + bitField0_ = (bitField0_ & ~0x00000800); + fDouble_ = 0D; + onChanged(); + return this; + } + + private float fFloat_; + + /** + * float f_float = 13; + * + * @return The fFloat. + */ + @java.lang.Override + public float getFFloat() { + return fFloat_; + } + + /** + * float f_float = 13; + * + * @param value The fFloat to set. + * @return This builder for chaining. + */ + public Builder setFFloat(float value) { + + fFloat_ = value; + bitField0_ |= 0x00001000; + onChanged(); + return this; + } + + /** + * float f_float = 13; + * + * @return This builder for chaining. + */ + public Builder clearFFloat() { + bitField0_ = (bitField0_ & ~0x00001000); + fFloat_ = 0F; + onChanged(); + return this; + } + + private boolean fBool_; + + /** + * bool f_bool = 14; + * + * @return The fBool. + */ + @java.lang.Override + public boolean getFBool() { + return fBool_; + } + + /** + * bool f_bool = 14; + * + * @param value The fBool to set. + * @return This builder for chaining. + */ + public Builder setFBool(boolean value) { + + fBool_ = value; + bitField0_ |= 0x00002000; + onChanged(); + return this; + } + + /** + * bool f_bool = 14; + * + * @return This builder for chaining. + */ + public Builder clearFBool() { + bitField0_ = (bitField0_ & ~0x00002000); + fBool_ = false; + onChanged(); + return this; + } + + private com.google.protobuf.ByteString fBytes_ = com.google.protobuf.ByteString.EMPTY; + + /** + * bytes f_bytes = 15; + * + * @return The fBytes. + */ + @java.lang.Override + public com.google.protobuf.ByteString getFBytes() { + return fBytes_; + } + + /** + * bytes f_bytes = 15; + * + * @param value The fBytes to set. + * @return This builder for chaining. + */ + public Builder setFBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + fBytes_ = value; + bitField0_ |= 0x00004000; + onChanged(); + return this; + } + + /** + * bytes f_bytes = 15; + * + * @return This builder for chaining. + */ + public Builder clearFBytes() { + bitField0_ = (bitField0_ & ~0x00004000); + fBytes_ = getDefaultInstance().getFBytes(); + onChanged(); + return this; + } + + private int fKingdom_ = 0; + + /** + * .google.showcase.v1beta1.ComplianceData.LifeKingdom f_kingdom = 22; + * + * @return The enum numeric value on the wire for fKingdom. + */ + @java.lang.Override + public int getFKingdomValue() { + return fKingdom_; + } + + /** + * .google.showcase.v1beta1.ComplianceData.LifeKingdom f_kingdom = 22; + * + * @param value The enum numeric value on the wire for fKingdom to set. + * @return This builder for chaining. + */ + public Builder setFKingdomValue(int value) { + fKingdom_ = value; + bitField0_ |= 0x00008000; + onChanged(); + return this; + } + + /** + * .google.showcase.v1beta1.ComplianceData.LifeKingdom f_kingdom = 22; + * + * @return The fKingdom. + */ + @java.lang.Override + public com.google.showcase.v1beta1.ComplianceData.LifeKingdom getFKingdom() { + com.google.showcase.v1beta1.ComplianceData.LifeKingdom result = + com.google.showcase.v1beta1.ComplianceData.LifeKingdom.forNumber(fKingdom_); + return result == null + ? com.google.showcase.v1beta1.ComplianceData.LifeKingdom.UNRECOGNIZED + : result; + } + + /** + * .google.showcase.v1beta1.ComplianceData.LifeKingdom f_kingdom = 22; + * + * @param value The fKingdom to set. + * @return This builder for chaining. + */ + public Builder setFKingdom(com.google.showcase.v1beta1.ComplianceData.LifeKingdom value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00008000; + fKingdom_ = value.getNumber(); + onChanged(); + return this; + } + + /** + * .google.showcase.v1beta1.ComplianceData.LifeKingdom f_kingdom = 22; + * + * @return This builder for chaining. + */ + public Builder clearFKingdom() { + bitField0_ = (bitField0_ & ~0x00008000); + fKingdom_ = 0; + onChanged(); + return this; + } + + private com.google.showcase.v1beta1.ComplianceDataChild fChild_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.showcase.v1beta1.ComplianceDataChild, + com.google.showcase.v1beta1.ComplianceDataChild.Builder, + com.google.showcase.v1beta1.ComplianceDataChildOrBuilder> + fChildBuilder_; + + /** + * .google.showcase.v1beta1.ComplianceDataChild f_child = 16; + * + * @return Whether the fChild field is set. + */ + public boolean hasFChild() { + return ((bitField0_ & 0x00010000) != 0); + } + + /** + * .google.showcase.v1beta1.ComplianceDataChild f_child = 16; + * + * @return The fChild. + */ + public com.google.showcase.v1beta1.ComplianceDataChild getFChild() { + if (fChildBuilder_ == null) { + return fChild_ == null + ? com.google.showcase.v1beta1.ComplianceDataChild.getDefaultInstance() + : fChild_; + } else { + return fChildBuilder_.getMessage(); + } + } + + /** .google.showcase.v1beta1.ComplianceDataChild f_child = 16; */ + public Builder setFChild(com.google.showcase.v1beta1.ComplianceDataChild value) { + if (fChildBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + fChild_ = value; + } else { + fChildBuilder_.setMessage(value); + } + bitField0_ |= 0x00010000; + onChanged(); + return this; + } + + /** .google.showcase.v1beta1.ComplianceDataChild f_child = 16; */ + public Builder setFChild( + com.google.showcase.v1beta1.ComplianceDataChild.Builder builderForValue) { + if (fChildBuilder_ == null) { + fChild_ = builderForValue.build(); + } else { + fChildBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00010000; + onChanged(); + return this; + } + + /** .google.showcase.v1beta1.ComplianceDataChild f_child = 16; */ + public Builder mergeFChild(com.google.showcase.v1beta1.ComplianceDataChild value) { + if (fChildBuilder_ == null) { + if (((bitField0_ & 0x00010000) != 0) + && fChild_ != null + && fChild_ != com.google.showcase.v1beta1.ComplianceDataChild.getDefaultInstance()) { + getFChildBuilder().mergeFrom(value); + } else { + fChild_ = value; + } + } else { + fChildBuilder_.mergeFrom(value); + } + if (fChild_ != null) { + bitField0_ |= 0x00010000; + onChanged(); + } + return this; + } + + /** .google.showcase.v1beta1.ComplianceDataChild f_child = 16; */ + public Builder clearFChild() { + bitField0_ = (bitField0_ & ~0x00010000); + fChild_ = null; + if (fChildBuilder_ != null) { + fChildBuilder_.dispose(); + fChildBuilder_ = null; + } + onChanged(); + return this; + } + + /** .google.showcase.v1beta1.ComplianceDataChild f_child = 16; */ + public com.google.showcase.v1beta1.ComplianceDataChild.Builder getFChildBuilder() { + bitField0_ |= 0x00010000; + onChanged(); + return getFChildFieldBuilder().getBuilder(); + } + + /** .google.showcase.v1beta1.ComplianceDataChild f_child = 16; */ + public com.google.showcase.v1beta1.ComplianceDataChildOrBuilder getFChildOrBuilder() { + if (fChildBuilder_ != null) { + return fChildBuilder_.getMessageOrBuilder(); + } else { + return fChild_ == null + ? com.google.showcase.v1beta1.ComplianceDataChild.getDefaultInstance() + : fChild_; + } + } + + /** .google.showcase.v1beta1.ComplianceDataChild f_child = 16; */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.showcase.v1beta1.ComplianceDataChild, + com.google.showcase.v1beta1.ComplianceDataChild.Builder, + com.google.showcase.v1beta1.ComplianceDataChildOrBuilder> + getFChildFieldBuilder() { + if (fChildBuilder_ == null) { + fChildBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.showcase.v1beta1.ComplianceDataChild, + com.google.showcase.v1beta1.ComplianceDataChild.Builder, + com.google.showcase.v1beta1.ComplianceDataChildOrBuilder>( + getFChild(), getParentForChildren(), isClean()); + fChild_ = null; + } + return fChildBuilder_; + } + + private java.lang.Object pString_ = ""; + + /** + * optional string p_string = 17; + * + * @return Whether the pString field is set. + */ + public boolean hasPString() { + return ((bitField0_ & 0x00020000) != 0); + } + + /** + * optional string p_string = 17; + * + * @return The pString. + */ + public java.lang.String getPString() { + java.lang.Object ref = pString_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pString_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * optional string p_string = 17; + * + * @return The bytes for pString. + */ + public com.google.protobuf.ByteString getPStringBytes() { + java.lang.Object ref = pString_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pString_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * optional string p_string = 17; + * + * @param value The pString to set. + * @return This builder for chaining. + */ + public Builder setPString(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + pString_ = value; + bitField0_ |= 0x00020000; + onChanged(); + return this; + } + + /** + * optional string p_string = 17; + * + * @return This builder for chaining. + */ + public Builder clearPString() { + pString_ = getDefaultInstance().getPString(); + bitField0_ = (bitField0_ & ~0x00020000); + onChanged(); + return this; + } + + /** + * optional string p_string = 17; + * + * @param value The bytes for pString to set. + * @return This builder for chaining. + */ + public Builder setPStringBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + pString_ = value; + bitField0_ |= 0x00020000; + onChanged(); + return this; + } + + private int pInt32_; + + /** + * optional int32 p_int32 = 18; + * + * @return Whether the pInt32 field is set. + */ + @java.lang.Override + public boolean hasPInt32() { + return ((bitField0_ & 0x00040000) != 0); + } + + /** + * optional int32 p_int32 = 18; + * + * @return The pInt32. + */ + @java.lang.Override + public int getPInt32() { + return pInt32_; + } + + /** + * optional int32 p_int32 = 18; + * + * @param value The pInt32 to set. + * @return This builder for chaining. + */ + public Builder setPInt32(int value) { + + pInt32_ = value; + bitField0_ |= 0x00040000; + onChanged(); + return this; + } + + /** + * optional int32 p_int32 = 18; + * + * @return This builder for chaining. + */ + public Builder clearPInt32() { + bitField0_ = (bitField0_ & ~0x00040000); + pInt32_ = 0; + onChanged(); + return this; + } + + private double pDouble_; + + /** + * optional double p_double = 19; + * + * @return Whether the pDouble field is set. + */ + @java.lang.Override + public boolean hasPDouble() { + return ((bitField0_ & 0x00080000) != 0); + } + + /** + * optional double p_double = 19; + * + * @return The pDouble. + */ + @java.lang.Override + public double getPDouble() { + return pDouble_; + } + + /** + * optional double p_double = 19; + * + * @param value The pDouble to set. + * @return This builder for chaining. + */ + public Builder setPDouble(double value) { + + pDouble_ = value; + bitField0_ |= 0x00080000; + onChanged(); + return this; + } + + /** + * optional double p_double = 19; + * + * @return This builder for chaining. + */ + public Builder clearPDouble() { + bitField0_ = (bitField0_ & ~0x00080000); + pDouble_ = 0D; + onChanged(); + return this; + } + + private boolean pBool_; + + /** + * optional bool p_bool = 20; + * + * @return Whether the pBool field is set. + */ + @java.lang.Override + public boolean hasPBool() { + return ((bitField0_ & 0x00100000) != 0); + } + + /** + * optional bool p_bool = 20; + * + * @return The pBool. + */ + @java.lang.Override + public boolean getPBool() { + return pBool_; + } + + /** + * optional bool p_bool = 20; + * + * @param value The pBool to set. + * @return This builder for chaining. + */ + public Builder setPBool(boolean value) { + + pBool_ = value; + bitField0_ |= 0x00100000; + onChanged(); + return this; + } + + /** + * optional bool p_bool = 20; + * + * @return This builder for chaining. + */ + public Builder clearPBool() { + bitField0_ = (bitField0_ & ~0x00100000); + pBool_ = false; + onChanged(); + return this; + } + + private int pKingdom_ = 0; + + /** + * optional .google.showcase.v1beta1.ComplianceData.LifeKingdom p_kingdom = 23; + * + * @return Whether the pKingdom field is set. + */ + @java.lang.Override + public boolean hasPKingdom() { + return ((bitField0_ & 0x00200000) != 0); + } + + /** + * optional .google.showcase.v1beta1.ComplianceData.LifeKingdom p_kingdom = 23; + * + * @return The enum numeric value on the wire for pKingdom. + */ + @java.lang.Override + public int getPKingdomValue() { + return pKingdom_; + } + + /** + * optional .google.showcase.v1beta1.ComplianceData.LifeKingdom p_kingdom = 23; + * + * @param value The enum numeric value on the wire for pKingdom to set. + * @return This builder for chaining. + */ + public Builder setPKingdomValue(int value) { + pKingdom_ = value; + bitField0_ |= 0x00200000; + onChanged(); + return this; + } + + /** + * optional .google.showcase.v1beta1.ComplianceData.LifeKingdom p_kingdom = 23; + * + * @return The pKingdom. + */ + @java.lang.Override + public com.google.showcase.v1beta1.ComplianceData.LifeKingdom getPKingdom() { + com.google.showcase.v1beta1.ComplianceData.LifeKingdom result = + com.google.showcase.v1beta1.ComplianceData.LifeKingdom.forNumber(pKingdom_); + return result == null + ? com.google.showcase.v1beta1.ComplianceData.LifeKingdom.UNRECOGNIZED + : result; + } + + /** + * optional .google.showcase.v1beta1.ComplianceData.LifeKingdom p_kingdom = 23; + * + * @param value The pKingdom to set. + * @return This builder for chaining. + */ + public Builder setPKingdom(com.google.showcase.v1beta1.ComplianceData.LifeKingdom value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00200000; + pKingdom_ = value.getNumber(); + onChanged(); + return this; + } + + /** + * optional .google.showcase.v1beta1.ComplianceData.LifeKingdom p_kingdom = 23; + * + * @return This builder for chaining. + */ + public Builder clearPKingdom() { + bitField0_ = (bitField0_ & ~0x00200000); + pKingdom_ = 0; + onChanged(); + return this; + } + + private com.google.showcase.v1beta1.ComplianceDataChild pChild_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.showcase.v1beta1.ComplianceDataChild, + com.google.showcase.v1beta1.ComplianceDataChild.Builder, + com.google.showcase.v1beta1.ComplianceDataChildOrBuilder> + pChildBuilder_; + + /** + * optional .google.showcase.v1beta1.ComplianceDataChild p_child = 21; + * + * @return Whether the pChild field is set. + */ + public boolean hasPChild() { + return ((bitField0_ & 0x00400000) != 0); + } + + /** + * optional .google.showcase.v1beta1.ComplianceDataChild p_child = 21; + * + * @return The pChild. + */ + public com.google.showcase.v1beta1.ComplianceDataChild getPChild() { + if (pChildBuilder_ == null) { + return pChild_ == null + ? com.google.showcase.v1beta1.ComplianceDataChild.getDefaultInstance() + : pChild_; + } else { + return pChildBuilder_.getMessage(); + } + } + + /** optional .google.showcase.v1beta1.ComplianceDataChild p_child = 21; */ + public Builder setPChild(com.google.showcase.v1beta1.ComplianceDataChild value) { + if (pChildBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + pChild_ = value; + } else { + pChildBuilder_.setMessage(value); + } + bitField0_ |= 0x00400000; + onChanged(); + return this; + } + + /** optional .google.showcase.v1beta1.ComplianceDataChild p_child = 21; */ + public Builder setPChild( + com.google.showcase.v1beta1.ComplianceDataChild.Builder builderForValue) { + if (pChildBuilder_ == null) { + pChild_ = builderForValue.build(); + } else { + pChildBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00400000; + onChanged(); + return this; + } + + /** optional .google.showcase.v1beta1.ComplianceDataChild p_child = 21; */ + public Builder mergePChild(com.google.showcase.v1beta1.ComplianceDataChild value) { + if (pChildBuilder_ == null) { + if (((bitField0_ & 0x00400000) != 0) + && pChild_ != null + && pChild_ != com.google.showcase.v1beta1.ComplianceDataChild.getDefaultInstance()) { + getPChildBuilder().mergeFrom(value); + } else { + pChild_ = value; + } + } else { + pChildBuilder_.mergeFrom(value); + } + if (pChild_ != null) { + bitField0_ |= 0x00400000; + onChanged(); + } + return this; + } + + /** optional .google.showcase.v1beta1.ComplianceDataChild p_child = 21; */ + public Builder clearPChild() { + bitField0_ = (bitField0_ & ~0x00400000); + pChild_ = null; + if (pChildBuilder_ != null) { + pChildBuilder_.dispose(); + pChildBuilder_ = null; + } + onChanged(); + return this; + } + + /** optional .google.showcase.v1beta1.ComplianceDataChild p_child = 21; */ + public com.google.showcase.v1beta1.ComplianceDataChild.Builder getPChildBuilder() { + bitField0_ |= 0x00400000; + onChanged(); + return getPChildFieldBuilder().getBuilder(); + } + + /** optional .google.showcase.v1beta1.ComplianceDataChild p_child = 21; */ + public com.google.showcase.v1beta1.ComplianceDataChildOrBuilder getPChildOrBuilder() { + if (pChildBuilder_ != null) { + return pChildBuilder_.getMessageOrBuilder(); + } else { + return pChild_ == null + ? com.google.showcase.v1beta1.ComplianceDataChild.getDefaultInstance() + : pChild_; + } + } + + /** optional .google.showcase.v1beta1.ComplianceDataChild p_child = 21; */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.showcase.v1beta1.ComplianceDataChild, + com.google.showcase.v1beta1.ComplianceDataChild.Builder, + com.google.showcase.v1beta1.ComplianceDataChildOrBuilder> + getPChildFieldBuilder() { + if (pChildBuilder_ == null) { + pChildBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.showcase.v1beta1.ComplianceDataChild, + com.google.showcase.v1beta1.ComplianceDataChild.Builder, + com.google.showcase.v1beta1.ComplianceDataChildOrBuilder>( + getPChild(), getParentForChildren(), isClean()); + pChild_ = null; + } + return pChildBuilder_; + } + + @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.showcase.v1beta1.ComplianceData) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.ComplianceData) + private static final com.google.showcase.v1beta1.ComplianceData DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.ComplianceData(); + } + + public static com.google.showcase.v1beta1.ComplianceData getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ComplianceData 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.showcase.v1beta1.ComplianceData getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ComplianceDataChild.java b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ComplianceDataChild.java new file mode 100644 index 0000000000..8b910818b5 --- /dev/null +++ b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ComplianceDataChild.java @@ -0,0 +1,1899 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/compliance.proto + +// Protobuf Java Version: 3.25.8 +package com.google.showcase.v1beta1; + +/** Protobuf type {@code google.showcase.v1beta1.ComplianceDataChild} */ +public final class ComplianceDataChild extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.ComplianceDataChild) + ComplianceDataChildOrBuilder { + private static final long serialVersionUID = 0L; + + // Use ComplianceDataChild.newBuilder() to construct. + private ComplianceDataChild(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ComplianceDataChild() { + fString_ = ""; + fContinent_ = 0; + pString_ = ""; + pContinent_ = 0; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ComplianceDataChild(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.ComplianceOuterClass + .internal_static_google_showcase_v1beta1_ComplianceDataChild_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.ComplianceOuterClass + .internal_static_google_showcase_v1beta1_ComplianceDataChild_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.ComplianceDataChild.class, + com.google.showcase.v1beta1.ComplianceDataChild.Builder.class); + } + + private int bitField0_; + public static final int F_STRING_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object fString_ = ""; + + /** + * string f_string = 1; + * + * @return The fString. + */ + @java.lang.Override + public java.lang.String getFString() { + java.lang.Object ref = fString_; + 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(); + fString_ = s; + return s; + } + } + + /** + * string f_string = 1; + * + * @return The bytes for fString. + */ + @java.lang.Override + public com.google.protobuf.ByteString getFStringBytes() { + java.lang.Object ref = fString_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + fString_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int F_FLOAT_FIELD_NUMBER = 2; + private float fFloat_ = 0F; + + /** + * float f_float = 2; + * + * @return The fFloat. + */ + @java.lang.Override + public float getFFloat() { + return fFloat_; + } + + public static final int F_DOUBLE_FIELD_NUMBER = 3; + private double fDouble_ = 0D; + + /** + * double f_double = 3; + * + * @return The fDouble. + */ + @java.lang.Override + public double getFDouble() { + return fDouble_; + } + + public static final int F_BOOL_FIELD_NUMBER = 4; + private boolean fBool_ = false; + + /** + * bool f_bool = 4; + * + * @return The fBool. + */ + @java.lang.Override + public boolean getFBool() { + return fBool_; + } + + public static final int F_CONTINENT_FIELD_NUMBER = 11; + private int fContinent_ = 0; + + /** + * .google.showcase.v1beta1.Continent f_continent = 11; + * + * @return The enum numeric value on the wire for fContinent. + */ + @java.lang.Override + public int getFContinentValue() { + return fContinent_; + } + + /** + * .google.showcase.v1beta1.Continent f_continent = 11; + * + * @return The fContinent. + */ + @java.lang.Override + public com.google.showcase.v1beta1.Continent getFContinent() { + com.google.showcase.v1beta1.Continent result = + com.google.showcase.v1beta1.Continent.forNumber(fContinent_); + return result == null ? com.google.showcase.v1beta1.Continent.UNRECOGNIZED : result; + } + + public static final int F_CHILD_FIELD_NUMBER = 5; + private com.google.showcase.v1beta1.ComplianceDataGrandchild fChild_; + + /** + * .google.showcase.v1beta1.ComplianceDataGrandchild f_child = 5; + * + * @return Whether the fChild field is set. + */ + @java.lang.Override + public boolean hasFChild() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * .google.showcase.v1beta1.ComplianceDataGrandchild f_child = 5; + * + * @return The fChild. + */ + @java.lang.Override + public com.google.showcase.v1beta1.ComplianceDataGrandchild getFChild() { + return fChild_ == null + ? com.google.showcase.v1beta1.ComplianceDataGrandchild.getDefaultInstance() + : fChild_; + } + + /** .google.showcase.v1beta1.ComplianceDataGrandchild f_child = 5; */ + @java.lang.Override + public com.google.showcase.v1beta1.ComplianceDataGrandchildOrBuilder getFChildOrBuilder() { + return fChild_ == null + ? com.google.showcase.v1beta1.ComplianceDataGrandchild.getDefaultInstance() + : fChild_; + } + + public static final int P_STRING_FIELD_NUMBER = 6; + + @SuppressWarnings("serial") + private volatile java.lang.Object pString_ = ""; + + /** + * optional string p_string = 6; + * + * @return Whether the pString field is set. + */ + @java.lang.Override + public boolean hasPString() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * optional string p_string = 6; + * + * @return The pString. + */ + @java.lang.Override + public java.lang.String getPString() { + java.lang.Object ref = pString_; + 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(); + pString_ = s; + return s; + } + } + + /** + * optional string p_string = 6; + * + * @return The bytes for pString. + */ + @java.lang.Override + public com.google.protobuf.ByteString getPStringBytes() { + java.lang.Object ref = pString_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pString_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int P_FLOAT_FIELD_NUMBER = 7; + private float pFloat_ = 0F; + + /** + * optional float p_float = 7; + * + * @return Whether the pFloat field is set. + */ + @java.lang.Override + public boolean hasPFloat() { + return ((bitField0_ & 0x00000004) != 0); + } + + /** + * optional float p_float = 7; + * + * @return The pFloat. + */ + @java.lang.Override + public float getPFloat() { + return pFloat_; + } + + public static final int P_DOUBLE_FIELD_NUMBER = 8; + private double pDouble_ = 0D; + + /** + * optional double p_double = 8; + * + * @return Whether the pDouble field is set. + */ + @java.lang.Override + public boolean hasPDouble() { + return ((bitField0_ & 0x00000008) != 0); + } + + /** + * optional double p_double = 8; + * + * @return The pDouble. + */ + @java.lang.Override + public double getPDouble() { + return pDouble_; + } + + public static final int P_BOOL_FIELD_NUMBER = 9; + private boolean pBool_ = false; + + /** + * optional bool p_bool = 9; + * + * @return Whether the pBool field is set. + */ + @java.lang.Override + public boolean hasPBool() { + return ((bitField0_ & 0x00000010) != 0); + } + + /** + * optional bool p_bool = 9; + * + * @return The pBool. + */ + @java.lang.Override + public boolean getPBool() { + return pBool_; + } + + public static final int P_CONTINENT_FIELD_NUMBER = 12; + private int pContinent_ = 0; + + /** + * .google.showcase.v1beta1.Continent p_continent = 12; + * + * @return The enum numeric value on the wire for pContinent. + */ + @java.lang.Override + public int getPContinentValue() { + return pContinent_; + } + + /** + * .google.showcase.v1beta1.Continent p_continent = 12; + * + * @return The pContinent. + */ + @java.lang.Override + public com.google.showcase.v1beta1.Continent getPContinent() { + com.google.showcase.v1beta1.Continent result = + com.google.showcase.v1beta1.Continent.forNumber(pContinent_); + return result == null ? com.google.showcase.v1beta1.Continent.UNRECOGNIZED : result; + } + + public static final int P_CHILD_FIELD_NUMBER = 10; + private com.google.showcase.v1beta1.ComplianceDataGrandchild pChild_; + + /** + * optional .google.showcase.v1beta1.ComplianceDataGrandchild p_child = 10; + * + * @return Whether the pChild field is set. + */ + @java.lang.Override + public boolean hasPChild() { + return ((bitField0_ & 0x00000020) != 0); + } + + /** + * optional .google.showcase.v1beta1.ComplianceDataGrandchild p_child = 10; + * + * @return The pChild. + */ + @java.lang.Override + public com.google.showcase.v1beta1.ComplianceDataGrandchild getPChild() { + return pChild_ == null + ? com.google.showcase.v1beta1.ComplianceDataGrandchild.getDefaultInstance() + : pChild_; + } + + /** optional .google.showcase.v1beta1.ComplianceDataGrandchild p_child = 10; */ + @java.lang.Override + public com.google.showcase.v1beta1.ComplianceDataGrandchildOrBuilder getPChildOrBuilder() { + return pChild_ == null + ? com.google.showcase.v1beta1.ComplianceDataGrandchild.getDefaultInstance() + : pChild_; + } + + 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(fString_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, fString_); + } + if (java.lang.Float.floatToRawIntBits(fFloat_) != 0) { + output.writeFloat(2, fFloat_); + } + if (java.lang.Double.doubleToRawLongBits(fDouble_) != 0) { + output.writeDouble(3, fDouble_); + } + if (fBool_ != false) { + output.writeBool(4, fBool_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(5, getFChild()); + } + if (((bitField0_ & 0x00000002) != 0)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 6, pString_); + } + if (((bitField0_ & 0x00000004) != 0)) { + output.writeFloat(7, pFloat_); + } + if (((bitField0_ & 0x00000008) != 0)) { + output.writeDouble(8, pDouble_); + } + if (((bitField0_ & 0x00000010) != 0)) { + output.writeBool(9, pBool_); + } + if (((bitField0_ & 0x00000020) != 0)) { + output.writeMessage(10, getPChild()); + } + if (fContinent_ != com.google.showcase.v1beta1.Continent.CONTINENT_UNSPECIFIED.getNumber()) { + output.writeEnum(11, fContinent_); + } + if (pContinent_ != com.google.showcase.v1beta1.Continent.CONTINENT_UNSPECIFIED.getNumber()) { + output.writeEnum(12, pContinent_); + } + 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(fString_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, fString_); + } + if (java.lang.Float.floatToRawIntBits(fFloat_) != 0) { + size += com.google.protobuf.CodedOutputStream.computeFloatSize(2, fFloat_); + } + if (java.lang.Double.doubleToRawLongBits(fDouble_) != 0) { + size += com.google.protobuf.CodedOutputStream.computeDoubleSize(3, fDouble_); + } + if (fBool_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(4, fBool_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(5, getFChild()); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(6, pString_); + } + if (((bitField0_ & 0x00000004) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeFloatSize(7, pFloat_); + } + if (((bitField0_ & 0x00000008) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeDoubleSize(8, pDouble_); + } + if (((bitField0_ & 0x00000010) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(9, pBool_); + } + if (((bitField0_ & 0x00000020) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(10, getPChild()); + } + if (fContinent_ != com.google.showcase.v1beta1.Continent.CONTINENT_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(11, fContinent_); + } + if (pContinent_ != com.google.showcase.v1beta1.Continent.CONTINENT_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(12, pContinent_); + } + 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.showcase.v1beta1.ComplianceDataChild)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.ComplianceDataChild other = + (com.google.showcase.v1beta1.ComplianceDataChild) obj; + + if (!getFString().equals(other.getFString())) return false; + if (java.lang.Float.floatToIntBits(getFFloat()) + != java.lang.Float.floatToIntBits(other.getFFloat())) return false; + if (java.lang.Double.doubleToLongBits(getFDouble()) + != java.lang.Double.doubleToLongBits(other.getFDouble())) return false; + if (getFBool() != other.getFBool()) return false; + if (fContinent_ != other.fContinent_) return false; + if (hasFChild() != other.hasFChild()) return false; + if (hasFChild()) { + if (!getFChild().equals(other.getFChild())) return false; + } + if (hasPString() != other.hasPString()) return false; + if (hasPString()) { + if (!getPString().equals(other.getPString())) return false; + } + if (hasPFloat() != other.hasPFloat()) return false; + if (hasPFloat()) { + if (java.lang.Float.floatToIntBits(getPFloat()) + != java.lang.Float.floatToIntBits(other.getPFloat())) return false; + } + if (hasPDouble() != other.hasPDouble()) return false; + if (hasPDouble()) { + if (java.lang.Double.doubleToLongBits(getPDouble()) + != java.lang.Double.doubleToLongBits(other.getPDouble())) return false; + } + if (hasPBool() != other.hasPBool()) return false; + if (hasPBool()) { + if (getPBool() != other.getPBool()) return false; + } + if (pContinent_ != other.pContinent_) return false; + if (hasPChild() != other.hasPChild()) return false; + if (hasPChild()) { + if (!getPChild().equals(other.getPChild())) 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) + F_STRING_FIELD_NUMBER; + hash = (53 * hash) + getFString().hashCode(); + hash = (37 * hash) + F_FLOAT_FIELD_NUMBER; + hash = (53 * hash) + java.lang.Float.floatToIntBits(getFFloat()); + hash = (37 * hash) + F_DOUBLE_FIELD_NUMBER; + hash = + (53 * hash) + + com.google.protobuf.Internal.hashLong( + java.lang.Double.doubleToLongBits(getFDouble())); + hash = (37 * hash) + F_BOOL_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getFBool()); + hash = (37 * hash) + F_CONTINENT_FIELD_NUMBER; + hash = (53 * hash) + fContinent_; + if (hasFChild()) { + hash = (37 * hash) + F_CHILD_FIELD_NUMBER; + hash = (53 * hash) + getFChild().hashCode(); + } + if (hasPString()) { + hash = (37 * hash) + P_STRING_FIELD_NUMBER; + hash = (53 * hash) + getPString().hashCode(); + } + if (hasPFloat()) { + hash = (37 * hash) + P_FLOAT_FIELD_NUMBER; + hash = (53 * hash) + java.lang.Float.floatToIntBits(getPFloat()); + } + if (hasPDouble()) { + hash = (37 * hash) + P_DOUBLE_FIELD_NUMBER; + hash = + (53 * hash) + + com.google.protobuf.Internal.hashLong( + java.lang.Double.doubleToLongBits(getPDouble())); + } + if (hasPBool()) { + hash = (37 * hash) + P_BOOL_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getPBool()); + } + hash = (37 * hash) + P_CONTINENT_FIELD_NUMBER; + hash = (53 * hash) + pContinent_; + if (hasPChild()) { + hash = (37 * hash) + P_CHILD_FIELD_NUMBER; + hash = (53 * hash) + getPChild().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.showcase.v1beta1.ComplianceDataChild parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.ComplianceDataChild parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.ComplianceDataChild parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.ComplianceDataChild 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.showcase.v1beta1.ComplianceDataChild parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.ComplianceDataChild parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.ComplianceDataChild parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.ComplianceDataChild 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.showcase.v1beta1.ComplianceDataChild parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.ComplianceDataChild 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.showcase.v1beta1.ComplianceDataChild parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.ComplianceDataChild 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.showcase.v1beta1.ComplianceDataChild prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** Protobuf type {@code google.showcase.v1beta1.ComplianceDataChild} */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.ComplianceDataChild) + com.google.showcase.v1beta1.ComplianceDataChildOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.ComplianceOuterClass + .internal_static_google_showcase_v1beta1_ComplianceDataChild_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.ComplianceOuterClass + .internal_static_google_showcase_v1beta1_ComplianceDataChild_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.ComplianceDataChild.class, + com.google.showcase.v1beta1.ComplianceDataChild.Builder.class); + } + + // Construct using com.google.showcase.v1beta1.ComplianceDataChild.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getFChildFieldBuilder(); + getPChildFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + fString_ = ""; + fFloat_ = 0F; + fDouble_ = 0D; + fBool_ = false; + fContinent_ = 0; + fChild_ = null; + if (fChildBuilder_ != null) { + fChildBuilder_.dispose(); + fChildBuilder_ = null; + } + pString_ = ""; + pFloat_ = 0F; + pDouble_ = 0D; + pBool_ = false; + pContinent_ = 0; + pChild_ = null; + if (pChildBuilder_ != null) { + pChildBuilder_.dispose(); + pChildBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.showcase.v1beta1.ComplianceOuterClass + .internal_static_google_showcase_v1beta1_ComplianceDataChild_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.ComplianceDataChild getDefaultInstanceForType() { + return com.google.showcase.v1beta1.ComplianceDataChild.getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.ComplianceDataChild build() { + com.google.showcase.v1beta1.ComplianceDataChild result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.ComplianceDataChild buildPartial() { + com.google.showcase.v1beta1.ComplianceDataChild result = + new com.google.showcase.v1beta1.ComplianceDataChild(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.showcase.v1beta1.ComplianceDataChild result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.fString_ = fString_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.fFloat_ = fFloat_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.fDouble_ = fDouble_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.fBool_ = fBool_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.fContinent_ = fContinent_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000020) != 0)) { + result.fChild_ = fChildBuilder_ == null ? fChild_ : fChildBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000040) != 0)) { + result.pString_ = pString_; + to_bitField0_ |= 0x00000002; + } + if (((from_bitField0_ & 0x00000080) != 0)) { + result.pFloat_ = pFloat_; + to_bitField0_ |= 0x00000004; + } + if (((from_bitField0_ & 0x00000100) != 0)) { + result.pDouble_ = pDouble_; + to_bitField0_ |= 0x00000008; + } + if (((from_bitField0_ & 0x00000200) != 0)) { + result.pBool_ = pBool_; + to_bitField0_ |= 0x00000010; + } + if (((from_bitField0_ & 0x00000400) != 0)) { + result.pContinent_ = pContinent_; + } + if (((from_bitField0_ & 0x00000800) != 0)) { + result.pChild_ = pChildBuilder_ == null ? pChild_ : pChildBuilder_.build(); + to_bitField0_ |= 0x00000020; + } + 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.showcase.v1beta1.ComplianceDataChild) { + return mergeFrom((com.google.showcase.v1beta1.ComplianceDataChild) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.showcase.v1beta1.ComplianceDataChild other) { + if (other == com.google.showcase.v1beta1.ComplianceDataChild.getDefaultInstance()) + return this; + if (!other.getFString().isEmpty()) { + fString_ = other.fString_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.getFFloat() != 0F) { + setFFloat(other.getFFloat()); + } + if (other.getFDouble() != 0D) { + setFDouble(other.getFDouble()); + } + if (other.getFBool() != false) { + setFBool(other.getFBool()); + } + if (other.fContinent_ != 0) { + setFContinentValue(other.getFContinentValue()); + } + if (other.hasFChild()) { + mergeFChild(other.getFChild()); + } + if (other.hasPString()) { + pString_ = other.pString_; + bitField0_ |= 0x00000040; + onChanged(); + } + if (other.hasPFloat()) { + setPFloat(other.getPFloat()); + } + if (other.hasPDouble()) { + setPDouble(other.getPDouble()); + } + if (other.hasPBool()) { + setPBool(other.getPBool()); + } + if (other.pContinent_ != 0) { + setPContinentValue(other.getPContinentValue()); + } + if (other.hasPChild()) { + mergePChild(other.getPChild()); + } + 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: + { + fString_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 21: + { + fFloat_ = input.readFloat(); + bitField0_ |= 0x00000002; + break; + } // case 21 + case 25: + { + fDouble_ = input.readDouble(); + bitField0_ |= 0x00000004; + break; + } // case 25 + case 32: + { + fBool_ = input.readBool(); + bitField0_ |= 0x00000008; + break; + } // case 32 + case 42: + { + input.readMessage(getFChildFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000020; + break; + } // case 42 + case 50: + { + pString_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000040; + break; + } // case 50 + case 61: + { + pFloat_ = input.readFloat(); + bitField0_ |= 0x00000080; + break; + } // case 61 + case 65: + { + pDouble_ = input.readDouble(); + bitField0_ |= 0x00000100; + break; + } // case 65 + case 72: + { + pBool_ = input.readBool(); + bitField0_ |= 0x00000200; + break; + } // case 72 + case 82: + { + input.readMessage(getPChildFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000800; + break; + } // case 82 + case 88: + { + fContinent_ = input.readEnum(); + bitField0_ |= 0x00000010; + break; + } // case 88 + case 96: + { + pContinent_ = input.readEnum(); + bitField0_ |= 0x00000400; + break; + } // case 96 + 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 fString_ = ""; + + /** + * string f_string = 1; + * + * @return The fString. + */ + public java.lang.String getFString() { + java.lang.Object ref = fString_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + fString_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * string f_string = 1; + * + * @return The bytes for fString. + */ + public com.google.protobuf.ByteString getFStringBytes() { + java.lang.Object ref = fString_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + fString_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * string f_string = 1; + * + * @param value The fString to set. + * @return This builder for chaining. + */ + public Builder setFString(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + fString_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * string f_string = 1; + * + * @return This builder for chaining. + */ + public Builder clearFString() { + fString_ = getDefaultInstance().getFString(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * string f_string = 1; + * + * @param value The bytes for fString to set. + * @return This builder for chaining. + */ + public Builder setFStringBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + fString_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private float fFloat_; + + /** + * float f_float = 2; + * + * @return The fFloat. + */ + @java.lang.Override + public float getFFloat() { + return fFloat_; + } + + /** + * float f_float = 2; + * + * @param value The fFloat to set. + * @return This builder for chaining. + */ + public Builder setFFloat(float value) { + + fFloat_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * float f_float = 2; + * + * @return This builder for chaining. + */ + public Builder clearFFloat() { + bitField0_ = (bitField0_ & ~0x00000002); + fFloat_ = 0F; + onChanged(); + return this; + } + + private double fDouble_; + + /** + * double f_double = 3; + * + * @return The fDouble. + */ + @java.lang.Override + public double getFDouble() { + return fDouble_; + } + + /** + * double f_double = 3; + * + * @param value The fDouble to set. + * @return This builder for chaining. + */ + public Builder setFDouble(double value) { + + fDouble_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * double f_double = 3; + * + * @return This builder for chaining. + */ + public Builder clearFDouble() { + bitField0_ = (bitField0_ & ~0x00000004); + fDouble_ = 0D; + onChanged(); + return this; + } + + private boolean fBool_; + + /** + * bool f_bool = 4; + * + * @return The fBool. + */ + @java.lang.Override + public boolean getFBool() { + return fBool_; + } + + /** + * bool f_bool = 4; + * + * @param value The fBool to set. + * @return This builder for chaining. + */ + public Builder setFBool(boolean value) { + + fBool_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + /** + * bool f_bool = 4; + * + * @return This builder for chaining. + */ + public Builder clearFBool() { + bitField0_ = (bitField0_ & ~0x00000008); + fBool_ = false; + onChanged(); + return this; + } + + private int fContinent_ = 0; + + /** + * .google.showcase.v1beta1.Continent f_continent = 11; + * + * @return The enum numeric value on the wire for fContinent. + */ + @java.lang.Override + public int getFContinentValue() { + return fContinent_; + } + + /** + * .google.showcase.v1beta1.Continent f_continent = 11; + * + * @param value The enum numeric value on the wire for fContinent to set. + * @return This builder for chaining. + */ + public Builder setFContinentValue(int value) { + fContinent_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + /** + * .google.showcase.v1beta1.Continent f_continent = 11; + * + * @return The fContinent. + */ + @java.lang.Override + public com.google.showcase.v1beta1.Continent getFContinent() { + com.google.showcase.v1beta1.Continent result = + com.google.showcase.v1beta1.Continent.forNumber(fContinent_); + return result == null ? com.google.showcase.v1beta1.Continent.UNRECOGNIZED : result; + } + + /** + * .google.showcase.v1beta1.Continent f_continent = 11; + * + * @param value The fContinent to set. + * @return This builder for chaining. + */ + public Builder setFContinent(com.google.showcase.v1beta1.Continent value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000010; + fContinent_ = value.getNumber(); + onChanged(); + return this; + } + + /** + * .google.showcase.v1beta1.Continent f_continent = 11; + * + * @return This builder for chaining. + */ + public Builder clearFContinent() { + bitField0_ = (bitField0_ & ~0x00000010); + fContinent_ = 0; + onChanged(); + return this; + } + + private com.google.showcase.v1beta1.ComplianceDataGrandchild fChild_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.showcase.v1beta1.ComplianceDataGrandchild, + com.google.showcase.v1beta1.ComplianceDataGrandchild.Builder, + com.google.showcase.v1beta1.ComplianceDataGrandchildOrBuilder> + fChildBuilder_; + + /** + * .google.showcase.v1beta1.ComplianceDataGrandchild f_child = 5; + * + * @return Whether the fChild field is set. + */ + public boolean hasFChild() { + return ((bitField0_ & 0x00000020) != 0); + } + + /** + * .google.showcase.v1beta1.ComplianceDataGrandchild f_child = 5; + * + * @return The fChild. + */ + public com.google.showcase.v1beta1.ComplianceDataGrandchild getFChild() { + if (fChildBuilder_ == null) { + return fChild_ == null + ? com.google.showcase.v1beta1.ComplianceDataGrandchild.getDefaultInstance() + : fChild_; + } else { + return fChildBuilder_.getMessage(); + } + } + + /** .google.showcase.v1beta1.ComplianceDataGrandchild f_child = 5; */ + public Builder setFChild(com.google.showcase.v1beta1.ComplianceDataGrandchild value) { + if (fChildBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + fChild_ = value; + } else { + fChildBuilder_.setMessage(value); + } + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + + /** .google.showcase.v1beta1.ComplianceDataGrandchild f_child = 5; */ + public Builder setFChild( + com.google.showcase.v1beta1.ComplianceDataGrandchild.Builder builderForValue) { + if (fChildBuilder_ == null) { + fChild_ = builderForValue.build(); + } else { + fChildBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + + /** .google.showcase.v1beta1.ComplianceDataGrandchild f_child = 5; */ + public Builder mergeFChild(com.google.showcase.v1beta1.ComplianceDataGrandchild value) { + if (fChildBuilder_ == null) { + if (((bitField0_ & 0x00000020) != 0) + && fChild_ != null + && fChild_ + != com.google.showcase.v1beta1.ComplianceDataGrandchild.getDefaultInstance()) { + getFChildBuilder().mergeFrom(value); + } else { + fChild_ = value; + } + } else { + fChildBuilder_.mergeFrom(value); + } + if (fChild_ != null) { + bitField0_ |= 0x00000020; + onChanged(); + } + return this; + } + + /** .google.showcase.v1beta1.ComplianceDataGrandchild f_child = 5; */ + public Builder clearFChild() { + bitField0_ = (bitField0_ & ~0x00000020); + fChild_ = null; + if (fChildBuilder_ != null) { + fChildBuilder_.dispose(); + fChildBuilder_ = null; + } + onChanged(); + return this; + } + + /** .google.showcase.v1beta1.ComplianceDataGrandchild f_child = 5; */ + public com.google.showcase.v1beta1.ComplianceDataGrandchild.Builder getFChildBuilder() { + bitField0_ |= 0x00000020; + onChanged(); + return getFChildFieldBuilder().getBuilder(); + } + + /** .google.showcase.v1beta1.ComplianceDataGrandchild f_child = 5; */ + public com.google.showcase.v1beta1.ComplianceDataGrandchildOrBuilder getFChildOrBuilder() { + if (fChildBuilder_ != null) { + return fChildBuilder_.getMessageOrBuilder(); + } else { + return fChild_ == null + ? com.google.showcase.v1beta1.ComplianceDataGrandchild.getDefaultInstance() + : fChild_; + } + } + + /** .google.showcase.v1beta1.ComplianceDataGrandchild f_child = 5; */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.showcase.v1beta1.ComplianceDataGrandchild, + com.google.showcase.v1beta1.ComplianceDataGrandchild.Builder, + com.google.showcase.v1beta1.ComplianceDataGrandchildOrBuilder> + getFChildFieldBuilder() { + if (fChildBuilder_ == null) { + fChildBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.showcase.v1beta1.ComplianceDataGrandchild, + com.google.showcase.v1beta1.ComplianceDataGrandchild.Builder, + com.google.showcase.v1beta1.ComplianceDataGrandchildOrBuilder>( + getFChild(), getParentForChildren(), isClean()); + fChild_ = null; + } + return fChildBuilder_; + } + + private java.lang.Object pString_ = ""; + + /** + * optional string p_string = 6; + * + * @return Whether the pString field is set. + */ + public boolean hasPString() { + return ((bitField0_ & 0x00000040) != 0); + } + + /** + * optional string p_string = 6; + * + * @return The pString. + */ + public java.lang.String getPString() { + java.lang.Object ref = pString_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pString_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * optional string p_string = 6; + * + * @return The bytes for pString. + */ + public com.google.protobuf.ByteString getPStringBytes() { + java.lang.Object ref = pString_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pString_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * optional string p_string = 6; + * + * @param value The pString to set. + * @return This builder for chaining. + */ + public Builder setPString(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + pString_ = value; + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + + /** + * optional string p_string = 6; + * + * @return This builder for chaining. + */ + public Builder clearPString() { + pString_ = getDefaultInstance().getPString(); + bitField0_ = (bitField0_ & ~0x00000040); + onChanged(); + return this; + } + + /** + * optional string p_string = 6; + * + * @param value The bytes for pString to set. + * @return This builder for chaining. + */ + public Builder setPStringBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + pString_ = value; + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + + private float pFloat_; + + /** + * optional float p_float = 7; + * + * @return Whether the pFloat field is set. + */ + @java.lang.Override + public boolean hasPFloat() { + return ((bitField0_ & 0x00000080) != 0); + } + + /** + * optional float p_float = 7; + * + * @return The pFloat. + */ + @java.lang.Override + public float getPFloat() { + return pFloat_; + } + + /** + * optional float p_float = 7; + * + * @param value The pFloat to set. + * @return This builder for chaining. + */ + public Builder setPFloat(float value) { + + pFloat_ = value; + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + + /** + * optional float p_float = 7; + * + * @return This builder for chaining. + */ + public Builder clearPFloat() { + bitField0_ = (bitField0_ & ~0x00000080); + pFloat_ = 0F; + onChanged(); + return this; + } + + private double pDouble_; + + /** + * optional double p_double = 8; + * + * @return Whether the pDouble field is set. + */ + @java.lang.Override + public boolean hasPDouble() { + return ((bitField0_ & 0x00000100) != 0); + } + + /** + * optional double p_double = 8; + * + * @return The pDouble. + */ + @java.lang.Override + public double getPDouble() { + return pDouble_; + } + + /** + * optional double p_double = 8; + * + * @param value The pDouble to set. + * @return This builder for chaining. + */ + public Builder setPDouble(double value) { + + pDouble_ = value; + bitField0_ |= 0x00000100; + onChanged(); + return this; + } + + /** + * optional double p_double = 8; + * + * @return This builder for chaining. + */ + public Builder clearPDouble() { + bitField0_ = (bitField0_ & ~0x00000100); + pDouble_ = 0D; + onChanged(); + return this; + } + + private boolean pBool_; + + /** + * optional bool p_bool = 9; + * + * @return Whether the pBool field is set. + */ + @java.lang.Override + public boolean hasPBool() { + return ((bitField0_ & 0x00000200) != 0); + } + + /** + * optional bool p_bool = 9; + * + * @return The pBool. + */ + @java.lang.Override + public boolean getPBool() { + return pBool_; + } + + /** + * optional bool p_bool = 9; + * + * @param value The pBool to set. + * @return This builder for chaining. + */ + public Builder setPBool(boolean value) { + + pBool_ = value; + bitField0_ |= 0x00000200; + onChanged(); + return this; + } + + /** + * optional bool p_bool = 9; + * + * @return This builder for chaining. + */ + public Builder clearPBool() { + bitField0_ = (bitField0_ & ~0x00000200); + pBool_ = false; + onChanged(); + return this; + } + + private int pContinent_ = 0; + + /** + * .google.showcase.v1beta1.Continent p_continent = 12; + * + * @return The enum numeric value on the wire for pContinent. + */ + @java.lang.Override + public int getPContinentValue() { + return pContinent_; + } + + /** + * .google.showcase.v1beta1.Continent p_continent = 12; + * + * @param value The enum numeric value on the wire for pContinent to set. + * @return This builder for chaining. + */ + public Builder setPContinentValue(int value) { + pContinent_ = value; + bitField0_ |= 0x00000400; + onChanged(); + return this; + } + + /** + * .google.showcase.v1beta1.Continent p_continent = 12; + * + * @return The pContinent. + */ + @java.lang.Override + public com.google.showcase.v1beta1.Continent getPContinent() { + com.google.showcase.v1beta1.Continent result = + com.google.showcase.v1beta1.Continent.forNumber(pContinent_); + return result == null ? com.google.showcase.v1beta1.Continent.UNRECOGNIZED : result; + } + + /** + * .google.showcase.v1beta1.Continent p_continent = 12; + * + * @param value The pContinent to set. + * @return This builder for chaining. + */ + public Builder setPContinent(com.google.showcase.v1beta1.Continent value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000400; + pContinent_ = value.getNumber(); + onChanged(); + return this; + } + + /** + * .google.showcase.v1beta1.Continent p_continent = 12; + * + * @return This builder for chaining. + */ + public Builder clearPContinent() { + bitField0_ = (bitField0_ & ~0x00000400); + pContinent_ = 0; + onChanged(); + return this; + } + + private com.google.showcase.v1beta1.ComplianceDataGrandchild pChild_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.showcase.v1beta1.ComplianceDataGrandchild, + com.google.showcase.v1beta1.ComplianceDataGrandchild.Builder, + com.google.showcase.v1beta1.ComplianceDataGrandchildOrBuilder> + pChildBuilder_; + + /** + * optional .google.showcase.v1beta1.ComplianceDataGrandchild p_child = 10; + * + * @return Whether the pChild field is set. + */ + public boolean hasPChild() { + return ((bitField0_ & 0x00000800) != 0); + } + + /** + * optional .google.showcase.v1beta1.ComplianceDataGrandchild p_child = 10; + * + * @return The pChild. + */ + public com.google.showcase.v1beta1.ComplianceDataGrandchild getPChild() { + if (pChildBuilder_ == null) { + return pChild_ == null + ? com.google.showcase.v1beta1.ComplianceDataGrandchild.getDefaultInstance() + : pChild_; + } else { + return pChildBuilder_.getMessage(); + } + } + + /** optional .google.showcase.v1beta1.ComplianceDataGrandchild p_child = 10; */ + public Builder setPChild(com.google.showcase.v1beta1.ComplianceDataGrandchild value) { + if (pChildBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + pChild_ = value; + } else { + pChildBuilder_.setMessage(value); + } + bitField0_ |= 0x00000800; + onChanged(); + return this; + } + + /** optional .google.showcase.v1beta1.ComplianceDataGrandchild p_child = 10; */ + public Builder setPChild( + com.google.showcase.v1beta1.ComplianceDataGrandchild.Builder builderForValue) { + if (pChildBuilder_ == null) { + pChild_ = builderForValue.build(); + } else { + pChildBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000800; + onChanged(); + return this; + } + + /** optional .google.showcase.v1beta1.ComplianceDataGrandchild p_child = 10; */ + public Builder mergePChild(com.google.showcase.v1beta1.ComplianceDataGrandchild value) { + if (pChildBuilder_ == null) { + if (((bitField0_ & 0x00000800) != 0) + && pChild_ != null + && pChild_ + != com.google.showcase.v1beta1.ComplianceDataGrandchild.getDefaultInstance()) { + getPChildBuilder().mergeFrom(value); + } else { + pChild_ = value; + } + } else { + pChildBuilder_.mergeFrom(value); + } + if (pChild_ != null) { + bitField0_ |= 0x00000800; + onChanged(); + } + return this; + } + + /** optional .google.showcase.v1beta1.ComplianceDataGrandchild p_child = 10; */ + public Builder clearPChild() { + bitField0_ = (bitField0_ & ~0x00000800); + pChild_ = null; + if (pChildBuilder_ != null) { + pChildBuilder_.dispose(); + pChildBuilder_ = null; + } + onChanged(); + return this; + } + + /** optional .google.showcase.v1beta1.ComplianceDataGrandchild p_child = 10; */ + public com.google.showcase.v1beta1.ComplianceDataGrandchild.Builder getPChildBuilder() { + bitField0_ |= 0x00000800; + onChanged(); + return getPChildFieldBuilder().getBuilder(); + } + + /** optional .google.showcase.v1beta1.ComplianceDataGrandchild p_child = 10; */ + public com.google.showcase.v1beta1.ComplianceDataGrandchildOrBuilder getPChildOrBuilder() { + if (pChildBuilder_ != null) { + return pChildBuilder_.getMessageOrBuilder(); + } else { + return pChild_ == null + ? com.google.showcase.v1beta1.ComplianceDataGrandchild.getDefaultInstance() + : pChild_; + } + } + + /** optional .google.showcase.v1beta1.ComplianceDataGrandchild p_child = 10; */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.showcase.v1beta1.ComplianceDataGrandchild, + com.google.showcase.v1beta1.ComplianceDataGrandchild.Builder, + com.google.showcase.v1beta1.ComplianceDataGrandchildOrBuilder> + getPChildFieldBuilder() { + if (pChildBuilder_ == null) { + pChildBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.showcase.v1beta1.ComplianceDataGrandchild, + com.google.showcase.v1beta1.ComplianceDataGrandchild.Builder, + com.google.showcase.v1beta1.ComplianceDataGrandchildOrBuilder>( + getPChild(), getParentForChildren(), isClean()); + pChild_ = null; + } + return pChildBuilder_; + } + + @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.showcase.v1beta1.ComplianceDataChild) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.ComplianceDataChild) + private static final com.google.showcase.v1beta1.ComplianceDataChild DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.ComplianceDataChild(); + } + + public static com.google.showcase.v1beta1.ComplianceDataChild getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ComplianceDataChild 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.showcase.v1beta1.ComplianceDataChild getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ComplianceDataChildOrBuilder.java b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ComplianceDataChildOrBuilder.java new file mode 100644 index 0000000000..c895edd6d2 --- /dev/null +++ b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ComplianceDataChildOrBuilder.java @@ -0,0 +1,186 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/compliance.proto + +// Protobuf Java Version: 3.25.8 +package com.google.showcase.v1beta1; + +public interface ComplianceDataChildOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.ComplianceDataChild) + com.google.protobuf.MessageOrBuilder { + + /** + * string f_string = 1; + * + * @return The fString. + */ + java.lang.String getFString(); + + /** + * string f_string = 1; + * + * @return The bytes for fString. + */ + com.google.protobuf.ByteString getFStringBytes(); + + /** + * float f_float = 2; + * + * @return The fFloat. + */ + float getFFloat(); + + /** + * double f_double = 3; + * + * @return The fDouble. + */ + double getFDouble(); + + /** + * bool f_bool = 4; + * + * @return The fBool. + */ + boolean getFBool(); + + /** + * .google.showcase.v1beta1.Continent f_continent = 11; + * + * @return The enum numeric value on the wire for fContinent. + */ + int getFContinentValue(); + + /** + * .google.showcase.v1beta1.Continent f_continent = 11; + * + * @return The fContinent. + */ + com.google.showcase.v1beta1.Continent getFContinent(); + + /** + * .google.showcase.v1beta1.ComplianceDataGrandchild f_child = 5; + * + * @return Whether the fChild field is set. + */ + boolean hasFChild(); + + /** + * .google.showcase.v1beta1.ComplianceDataGrandchild f_child = 5; + * + * @return The fChild. + */ + com.google.showcase.v1beta1.ComplianceDataGrandchild getFChild(); + + /** .google.showcase.v1beta1.ComplianceDataGrandchild f_child = 5; */ + com.google.showcase.v1beta1.ComplianceDataGrandchildOrBuilder getFChildOrBuilder(); + + /** + * optional string p_string = 6; + * + * @return Whether the pString field is set. + */ + boolean hasPString(); + + /** + * optional string p_string = 6; + * + * @return The pString. + */ + java.lang.String getPString(); + + /** + * optional string p_string = 6; + * + * @return The bytes for pString. + */ + com.google.protobuf.ByteString getPStringBytes(); + + /** + * optional float p_float = 7; + * + * @return Whether the pFloat field is set. + */ + boolean hasPFloat(); + + /** + * optional float p_float = 7; + * + * @return The pFloat. + */ + float getPFloat(); + + /** + * optional double p_double = 8; + * + * @return Whether the pDouble field is set. + */ + boolean hasPDouble(); + + /** + * optional double p_double = 8; + * + * @return The pDouble. + */ + double getPDouble(); + + /** + * optional bool p_bool = 9; + * + * @return Whether the pBool field is set. + */ + boolean hasPBool(); + + /** + * optional bool p_bool = 9; + * + * @return The pBool. + */ + boolean getPBool(); + + /** + * .google.showcase.v1beta1.Continent p_continent = 12; + * + * @return The enum numeric value on the wire for pContinent. + */ + int getPContinentValue(); + + /** + * .google.showcase.v1beta1.Continent p_continent = 12; + * + * @return The pContinent. + */ + com.google.showcase.v1beta1.Continent getPContinent(); + + /** + * optional .google.showcase.v1beta1.ComplianceDataGrandchild p_child = 10; + * + * @return Whether the pChild field is set. + */ + boolean hasPChild(); + + /** + * optional .google.showcase.v1beta1.ComplianceDataGrandchild p_child = 10; + * + * @return The pChild. + */ + com.google.showcase.v1beta1.ComplianceDataGrandchild getPChild(); + + /** optional .google.showcase.v1beta1.ComplianceDataGrandchild p_child = 10; */ + com.google.showcase.v1beta1.ComplianceDataGrandchildOrBuilder getPChildOrBuilder(); +} diff --git a/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ComplianceDataGrandchild.java b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ComplianceDataGrandchild.java new file mode 100644 index 0000000000..8f55edf836 --- /dev/null +++ b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ComplianceDataGrandchild.java @@ -0,0 +1,726 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/compliance.proto + +// Protobuf Java Version: 3.25.8 +package com.google.showcase.v1beta1; + +/** Protobuf type {@code google.showcase.v1beta1.ComplianceDataGrandchild} */ +public final class ComplianceDataGrandchild extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.ComplianceDataGrandchild) + ComplianceDataGrandchildOrBuilder { + private static final long serialVersionUID = 0L; + + // Use ComplianceDataGrandchild.newBuilder() to construct. + private ComplianceDataGrandchild(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ComplianceDataGrandchild() { + fString_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ComplianceDataGrandchild(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.ComplianceOuterClass + .internal_static_google_showcase_v1beta1_ComplianceDataGrandchild_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.ComplianceOuterClass + .internal_static_google_showcase_v1beta1_ComplianceDataGrandchild_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.ComplianceDataGrandchild.class, + com.google.showcase.v1beta1.ComplianceDataGrandchild.Builder.class); + } + + public static final int F_STRING_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object fString_ = ""; + + /** + * string f_string = 1; + * + * @return The fString. + */ + @java.lang.Override + public java.lang.String getFString() { + java.lang.Object ref = fString_; + 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(); + fString_ = s; + return s; + } + } + + /** + * string f_string = 1; + * + * @return The bytes for fString. + */ + @java.lang.Override + public com.google.protobuf.ByteString getFStringBytes() { + java.lang.Object ref = fString_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + fString_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int F_DOUBLE_FIELD_NUMBER = 2; + private double fDouble_ = 0D; + + /** + * double f_double = 2; + * + * @return The fDouble. + */ + @java.lang.Override + public double getFDouble() { + return fDouble_; + } + + public static final int F_BOOL_FIELD_NUMBER = 3; + private boolean fBool_ = false; + + /** + * bool f_bool = 3; + * + * @return The fBool. + */ + @java.lang.Override + public boolean getFBool() { + return fBool_; + } + + 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(fString_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, fString_); + } + if (java.lang.Double.doubleToRawLongBits(fDouble_) != 0) { + output.writeDouble(2, fDouble_); + } + if (fBool_ != false) { + output.writeBool(3, fBool_); + } + 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(fString_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, fString_); + } + if (java.lang.Double.doubleToRawLongBits(fDouble_) != 0) { + size += com.google.protobuf.CodedOutputStream.computeDoubleSize(2, fDouble_); + } + if (fBool_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(3, fBool_); + } + 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.showcase.v1beta1.ComplianceDataGrandchild)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.ComplianceDataGrandchild other = + (com.google.showcase.v1beta1.ComplianceDataGrandchild) obj; + + if (!getFString().equals(other.getFString())) return false; + if (java.lang.Double.doubleToLongBits(getFDouble()) + != java.lang.Double.doubleToLongBits(other.getFDouble())) return false; + if (getFBool() != other.getFBool()) 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) + F_STRING_FIELD_NUMBER; + hash = (53 * hash) + getFString().hashCode(); + hash = (37 * hash) + F_DOUBLE_FIELD_NUMBER; + hash = + (53 * hash) + + com.google.protobuf.Internal.hashLong( + java.lang.Double.doubleToLongBits(getFDouble())); + hash = (37 * hash) + F_BOOL_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getFBool()); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.showcase.v1beta1.ComplianceDataGrandchild parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.ComplianceDataGrandchild parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.ComplianceDataGrandchild parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.ComplianceDataGrandchild 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.showcase.v1beta1.ComplianceDataGrandchild parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.ComplianceDataGrandchild parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.ComplianceDataGrandchild parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.ComplianceDataGrandchild 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.showcase.v1beta1.ComplianceDataGrandchild parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.ComplianceDataGrandchild 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.showcase.v1beta1.ComplianceDataGrandchild parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.ComplianceDataGrandchild 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.showcase.v1beta1.ComplianceDataGrandchild prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** Protobuf type {@code google.showcase.v1beta1.ComplianceDataGrandchild} */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.ComplianceDataGrandchild) + com.google.showcase.v1beta1.ComplianceDataGrandchildOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.ComplianceOuterClass + .internal_static_google_showcase_v1beta1_ComplianceDataGrandchild_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.ComplianceOuterClass + .internal_static_google_showcase_v1beta1_ComplianceDataGrandchild_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.ComplianceDataGrandchild.class, + com.google.showcase.v1beta1.ComplianceDataGrandchild.Builder.class); + } + + // Construct using com.google.showcase.v1beta1.ComplianceDataGrandchild.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + fString_ = ""; + fDouble_ = 0D; + fBool_ = false; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.showcase.v1beta1.ComplianceOuterClass + .internal_static_google_showcase_v1beta1_ComplianceDataGrandchild_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.ComplianceDataGrandchild getDefaultInstanceForType() { + return com.google.showcase.v1beta1.ComplianceDataGrandchild.getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.ComplianceDataGrandchild build() { + com.google.showcase.v1beta1.ComplianceDataGrandchild result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.ComplianceDataGrandchild buildPartial() { + com.google.showcase.v1beta1.ComplianceDataGrandchild result = + new com.google.showcase.v1beta1.ComplianceDataGrandchild(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.showcase.v1beta1.ComplianceDataGrandchild result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.fString_ = fString_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.fDouble_ = fDouble_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.fBool_ = fBool_; + } + } + + @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.showcase.v1beta1.ComplianceDataGrandchild) { + return mergeFrom((com.google.showcase.v1beta1.ComplianceDataGrandchild) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.showcase.v1beta1.ComplianceDataGrandchild other) { + if (other == com.google.showcase.v1beta1.ComplianceDataGrandchild.getDefaultInstance()) + return this; + if (!other.getFString().isEmpty()) { + fString_ = other.fString_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.getFDouble() != 0D) { + setFDouble(other.getFDouble()); + } + if (other.getFBool() != false) { + setFBool(other.getFBool()); + } + 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: + { + fString_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 17: + { + fDouble_ = input.readDouble(); + bitField0_ |= 0x00000002; + break; + } // case 17 + case 24: + { + fBool_ = 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 fString_ = ""; + + /** + * string f_string = 1; + * + * @return The fString. + */ + public java.lang.String getFString() { + java.lang.Object ref = fString_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + fString_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * string f_string = 1; + * + * @return The bytes for fString. + */ + public com.google.protobuf.ByteString getFStringBytes() { + java.lang.Object ref = fString_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + fString_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * string f_string = 1; + * + * @param value The fString to set. + * @return This builder for chaining. + */ + public Builder setFString(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + fString_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * string f_string = 1; + * + * @return This builder for chaining. + */ + public Builder clearFString() { + fString_ = getDefaultInstance().getFString(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * string f_string = 1; + * + * @param value The bytes for fString to set. + * @return This builder for chaining. + */ + public Builder setFStringBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + fString_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private double fDouble_; + + /** + * double f_double = 2; + * + * @return The fDouble. + */ + @java.lang.Override + public double getFDouble() { + return fDouble_; + } + + /** + * double f_double = 2; + * + * @param value The fDouble to set. + * @return This builder for chaining. + */ + public Builder setFDouble(double value) { + + fDouble_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * double f_double = 2; + * + * @return This builder for chaining. + */ + public Builder clearFDouble() { + bitField0_ = (bitField0_ & ~0x00000002); + fDouble_ = 0D; + onChanged(); + return this; + } + + private boolean fBool_; + + /** + * bool f_bool = 3; + * + * @return The fBool. + */ + @java.lang.Override + public boolean getFBool() { + return fBool_; + } + + /** + * bool f_bool = 3; + * + * @param value The fBool to set. + * @return This builder for chaining. + */ + public Builder setFBool(boolean value) { + + fBool_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * bool f_bool = 3; + * + * @return This builder for chaining. + */ + public Builder clearFBool() { + bitField0_ = (bitField0_ & ~0x00000004); + fBool_ = 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.showcase.v1beta1.ComplianceDataGrandchild) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.ComplianceDataGrandchild) + private static final com.google.showcase.v1beta1.ComplianceDataGrandchild DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.ComplianceDataGrandchild(); + } + + public static com.google.showcase.v1beta1.ComplianceDataGrandchild getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ComplianceDataGrandchild 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.showcase.v1beta1.ComplianceDataGrandchild getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ComplianceDataGrandchildOrBuilder.java b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ComplianceDataGrandchildOrBuilder.java new file mode 100644 index 0000000000..724101ad4a --- /dev/null +++ b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ComplianceDataGrandchildOrBuilder.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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/compliance.proto + +// Protobuf Java Version: 3.25.8 +package com.google.showcase.v1beta1; + +public interface ComplianceDataGrandchildOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.ComplianceDataGrandchild) + com.google.protobuf.MessageOrBuilder { + + /** + * string f_string = 1; + * + * @return The fString. + */ + java.lang.String getFString(); + + /** + * string f_string = 1; + * + * @return The bytes for fString. + */ + com.google.protobuf.ByteString getFStringBytes(); + + /** + * double f_double = 2; + * + * @return The fDouble. + */ + double getFDouble(); + + /** + * bool f_bool = 3; + * + * @return The fBool. + */ + boolean getFBool(); +} diff --git a/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ComplianceDataOrBuilder.java b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ComplianceDataOrBuilder.java new file mode 100644 index 0000000000..9836733ed5 --- /dev/null +++ b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ComplianceDataOrBuilder.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: schema/google/showcase/v1beta1/compliance.proto + +// Protobuf Java Version: 3.25.8 +package com.google.showcase.v1beta1; + +public interface ComplianceDataOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.ComplianceData) + com.google.protobuf.MessageOrBuilder { + + /** + * string f_string = 1; + * + * @return The fString. + */ + java.lang.String getFString(); + + /** + * string f_string = 1; + * + * @return The bytes for fString. + */ + com.google.protobuf.ByteString getFStringBytes(); + + /** + * int32 f_int32 = 2; + * + * @return The fInt32. + */ + int getFInt32(); + + /** + * sint32 f_sint32 = 3; + * + * @return The fSint32. + */ + int getFSint32(); + + /** + * sfixed32 f_sfixed32 = 4; + * + * @return The fSfixed32. + */ + int getFSfixed32(); + + /** + * uint32 f_uint32 = 5; + * + * @return The fUint32. + */ + int getFUint32(); + + /** + * fixed32 f_fixed32 = 6; + * + * @return The fFixed32. + */ + int getFFixed32(); + + /** + * int64 f_int64 = 7; + * + * @return The fInt64. + */ + long getFInt64(); + + /** + * sint64 f_sint64 = 8; + * + * @return The fSint64. + */ + long getFSint64(); + + /** + * sfixed64 f_sfixed64 = 9; + * + * @return The fSfixed64. + */ + long getFSfixed64(); + + /** + * uint64 f_uint64 = 10; + * + * @return The fUint64. + */ + long getFUint64(); + + /** + * fixed64 f_fixed64 = 11; + * + * @return The fFixed64. + */ + long getFFixed64(); + + /** + * double f_double = 12; + * + * @return The fDouble. + */ + double getFDouble(); + + /** + * float f_float = 13; + * + * @return The fFloat. + */ + float getFFloat(); + + /** + * bool f_bool = 14; + * + * @return The fBool. + */ + boolean getFBool(); + + /** + * bytes f_bytes = 15; + * + * @return The fBytes. + */ + com.google.protobuf.ByteString getFBytes(); + + /** + * .google.showcase.v1beta1.ComplianceData.LifeKingdom f_kingdom = 22; + * + * @return The enum numeric value on the wire for fKingdom. + */ + int getFKingdomValue(); + + /** + * .google.showcase.v1beta1.ComplianceData.LifeKingdom f_kingdom = 22; + * + * @return The fKingdom. + */ + com.google.showcase.v1beta1.ComplianceData.LifeKingdom getFKingdom(); + + /** + * .google.showcase.v1beta1.ComplianceDataChild f_child = 16; + * + * @return Whether the fChild field is set. + */ + boolean hasFChild(); + + /** + * .google.showcase.v1beta1.ComplianceDataChild f_child = 16; + * + * @return The fChild. + */ + com.google.showcase.v1beta1.ComplianceDataChild getFChild(); + + /** .google.showcase.v1beta1.ComplianceDataChild f_child = 16; */ + com.google.showcase.v1beta1.ComplianceDataChildOrBuilder getFChildOrBuilder(); + + /** + * optional string p_string = 17; + * + * @return Whether the pString field is set. + */ + boolean hasPString(); + + /** + * optional string p_string = 17; + * + * @return The pString. + */ + java.lang.String getPString(); + + /** + * optional string p_string = 17; + * + * @return The bytes for pString. + */ + com.google.protobuf.ByteString getPStringBytes(); + + /** + * optional int32 p_int32 = 18; + * + * @return Whether the pInt32 field is set. + */ + boolean hasPInt32(); + + /** + * optional int32 p_int32 = 18; + * + * @return The pInt32. + */ + int getPInt32(); + + /** + * optional double p_double = 19; + * + * @return Whether the pDouble field is set. + */ + boolean hasPDouble(); + + /** + * optional double p_double = 19; + * + * @return The pDouble. + */ + double getPDouble(); + + /** + * optional bool p_bool = 20; + * + * @return Whether the pBool field is set. + */ + boolean hasPBool(); + + /** + * optional bool p_bool = 20; + * + * @return The pBool. + */ + boolean getPBool(); + + /** + * optional .google.showcase.v1beta1.ComplianceData.LifeKingdom p_kingdom = 23; + * + * @return Whether the pKingdom field is set. + */ + boolean hasPKingdom(); + + /** + * optional .google.showcase.v1beta1.ComplianceData.LifeKingdom p_kingdom = 23; + * + * @return The enum numeric value on the wire for pKingdom. + */ + int getPKingdomValue(); + + /** + * optional .google.showcase.v1beta1.ComplianceData.LifeKingdom p_kingdom = 23; + * + * @return The pKingdom. + */ + com.google.showcase.v1beta1.ComplianceData.LifeKingdom getPKingdom(); + + /** + * optional .google.showcase.v1beta1.ComplianceDataChild p_child = 21; + * + * @return Whether the pChild field is set. + */ + boolean hasPChild(); + + /** + * optional .google.showcase.v1beta1.ComplianceDataChild p_child = 21; + * + * @return The pChild. + */ + com.google.showcase.v1beta1.ComplianceDataChild getPChild(); + + /** optional .google.showcase.v1beta1.ComplianceDataChild p_child = 21; */ + com.google.showcase.v1beta1.ComplianceDataChildOrBuilder getPChildOrBuilder(); +} diff --git a/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ComplianceGroup.java b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ComplianceGroup.java new file mode 100644 index 0000000000..80acba6175 --- /dev/null +++ b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ComplianceGroup.java @@ -0,0 +1,1137 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/compliance.proto + +// Protobuf Java Version: 3.25.8 +package com.google.showcase.v1beta1; + +/** + * + * + *
        + * ComplianceGroups encapsulates a group of RPC requests to the Compliance
        + * server: one request for each combination of elements of `rpcs` and of
        + * `requests`.
        + * 
        + * + * Protobuf type {@code google.showcase.v1beta1.ComplianceGroup} + */ +public final class ComplianceGroup extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.ComplianceGroup) + ComplianceGroupOrBuilder { + private static final long serialVersionUID = 0L; + + // Use ComplianceGroup.newBuilder() to construct. + private ComplianceGroup(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ComplianceGroup() { + name_ = ""; + rpcs_ = com.google.protobuf.LazyStringArrayList.emptyList(); + requests_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ComplianceGroup(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.ComplianceOuterClass + .internal_static_google_showcase_v1beta1_ComplianceGroup_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.ComplianceOuterClass + .internal_static_google_showcase_v1beta1_ComplianceGroup_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.ComplianceGroup.class, + com.google.showcase.v1beta1.ComplianceGroup.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + + /** + * 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; + } + } + + /** + * 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 RPCS_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private com.google.protobuf.LazyStringArrayList rpcs_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + + /** + * repeated string rpcs = 2; + * + * @return A list containing the rpcs. + */ + public com.google.protobuf.ProtocolStringList getRpcsList() { + return rpcs_; + } + + /** + * repeated string rpcs = 2; + * + * @return The count of rpcs. + */ + public int getRpcsCount() { + return rpcs_.size(); + } + + /** + * repeated string rpcs = 2; + * + * @param index The index of the element to return. + * @return The rpcs at the given index. + */ + public java.lang.String getRpcs(int index) { + return rpcs_.get(index); + } + + /** + * repeated string rpcs = 2; + * + * @param index The index of the value to return. + * @return The bytes of the rpcs at the given index. + */ + public com.google.protobuf.ByteString getRpcsBytes(int index) { + return rpcs_.getByteString(index); + } + + public static final int REQUESTS_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private java.util.List requests_; + + /** repeated .google.showcase.v1beta1.RepeatRequest requests = 3; */ + @java.lang.Override + public java.util.List getRequestsList() { + return requests_; + } + + /** repeated .google.showcase.v1beta1.RepeatRequest requests = 3; */ + @java.lang.Override + public java.util.List + getRequestsOrBuilderList() { + return requests_; + } + + /** repeated .google.showcase.v1beta1.RepeatRequest requests = 3; */ + @java.lang.Override + public int getRequestsCount() { + return requests_.size(); + } + + /** repeated .google.showcase.v1beta1.RepeatRequest requests = 3; */ + @java.lang.Override + public com.google.showcase.v1beta1.RepeatRequest getRequests(int index) { + return requests_.get(index); + } + + /** repeated .google.showcase.v1beta1.RepeatRequest requests = 3; */ + @java.lang.Override + public com.google.showcase.v1beta1.RepeatRequestOrBuilder getRequestsOrBuilder(int index) { + return requests_.get(index); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + for (int i = 0; i < rpcs_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, rpcs_.getRaw(i)); + } + for (int i = 0; i < requests_.size(); i++) { + output.writeMessage(3, requests_.get(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(name_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + { + int dataSize = 0; + for (int i = 0; i < rpcs_.size(); i++) { + dataSize += computeStringSizeNoTag(rpcs_.getRaw(i)); + } + size += dataSize; + size += 1 * getRpcsList().size(); + } + for (int i = 0; i < requests_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, requests_.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.showcase.v1beta1.ComplianceGroup)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.ComplianceGroup other = + (com.google.showcase.v1beta1.ComplianceGroup) obj; + + if (!getName().equals(other.getName())) return false; + if (!getRpcsList().equals(other.getRpcsList())) return false; + if (!getRequestsList().equals(other.getRequestsList())) 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 (getRpcsCount() > 0) { + hash = (37 * hash) + RPCS_FIELD_NUMBER; + hash = (53 * hash) + getRpcsList().hashCode(); + } + if (getRequestsCount() > 0) { + hash = (37 * hash) + REQUESTS_FIELD_NUMBER; + hash = (53 * hash) + getRequestsList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.showcase.v1beta1.ComplianceGroup parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.ComplianceGroup parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.ComplianceGroup parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.ComplianceGroup 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.showcase.v1beta1.ComplianceGroup parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.ComplianceGroup parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.ComplianceGroup parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.ComplianceGroup 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.showcase.v1beta1.ComplianceGroup parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.ComplianceGroup 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.showcase.v1beta1.ComplianceGroup parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.ComplianceGroup 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.showcase.v1beta1.ComplianceGroup 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; + } + + /** + * + * + *
        +   * ComplianceGroups encapsulates a group of RPC requests to the Compliance
        +   * server: one request for each combination of elements of `rpcs` and of
        +   * `requests`.
        +   * 
        + * + * Protobuf type {@code google.showcase.v1beta1.ComplianceGroup} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.ComplianceGroup) + com.google.showcase.v1beta1.ComplianceGroupOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.ComplianceOuterClass + .internal_static_google_showcase_v1beta1_ComplianceGroup_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.ComplianceOuterClass + .internal_static_google_showcase_v1beta1_ComplianceGroup_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.ComplianceGroup.class, + com.google.showcase.v1beta1.ComplianceGroup.Builder.class); + } + + // Construct using com.google.showcase.v1beta1.ComplianceGroup.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + rpcs_ = com.google.protobuf.LazyStringArrayList.emptyList(); + if (requestsBuilder_ == null) { + requests_ = java.util.Collections.emptyList(); + } else { + requests_ = null; + requestsBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000004); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.showcase.v1beta1.ComplianceOuterClass + .internal_static_google_showcase_v1beta1_ComplianceGroup_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.ComplianceGroup getDefaultInstanceForType() { + return com.google.showcase.v1beta1.ComplianceGroup.getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.ComplianceGroup build() { + com.google.showcase.v1beta1.ComplianceGroup result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.ComplianceGroup buildPartial() { + com.google.showcase.v1beta1.ComplianceGroup result = + new com.google.showcase.v1beta1.ComplianceGroup(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields(com.google.showcase.v1beta1.ComplianceGroup result) { + if (requestsBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0)) { + requests_ = java.util.Collections.unmodifiableList(requests_); + bitField0_ = (bitField0_ & ~0x00000004); + } + result.requests_ = requests_; + } else { + result.requests_ = requestsBuilder_.build(); + } + } + + private void buildPartial0(com.google.showcase.v1beta1.ComplianceGroup result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + rpcs_.makeImmutable(); + result.rpcs_ = rpcs_; + } + } + + @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.showcase.v1beta1.ComplianceGroup) { + return mergeFrom((com.google.showcase.v1beta1.ComplianceGroup) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.showcase.v1beta1.ComplianceGroup other) { + if (other == com.google.showcase.v1beta1.ComplianceGroup.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.rpcs_.isEmpty()) { + if (rpcs_.isEmpty()) { + rpcs_ = other.rpcs_; + bitField0_ |= 0x00000002; + } else { + ensureRpcsIsMutable(); + rpcs_.addAll(other.rpcs_); + } + onChanged(); + } + if (requestsBuilder_ == null) { + if (!other.requests_.isEmpty()) { + if (requests_.isEmpty()) { + requests_ = other.requests_; + bitField0_ = (bitField0_ & ~0x00000004); + } else { + ensureRequestsIsMutable(); + requests_.addAll(other.requests_); + } + onChanged(); + } + } else { + if (!other.requests_.isEmpty()) { + if (requestsBuilder_.isEmpty()) { + requestsBuilder_.dispose(); + requestsBuilder_ = null; + requests_ = other.requests_; + bitField0_ = (bitField0_ & ~0x00000004); + requestsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getRequestsFieldBuilder() + : null; + } else { + requestsBuilder_.addAllMessages(other.requests_); + } + } + } + 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: + { + java.lang.String s = input.readStringRequireUtf8(); + ensureRpcsIsMutable(); + rpcs_.add(s); + break; + } // case 18 + case 26: + { + com.google.showcase.v1beta1.RepeatRequest m = + input.readMessage( + com.google.showcase.v1beta1.RepeatRequest.parser(), extensionRegistry); + if (requestsBuilder_ == null) { + ensureRequestsIsMutable(); + requests_.add(m); + } else { + requestsBuilder_.addMessage(m); + } + 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_ = ""; + + /** + * 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; + } + } + + /** + * 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; + } + } + + /** + * 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; + } + + /** + * string name = 1; + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * 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 com.google.protobuf.LazyStringArrayList rpcs_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + + private void ensureRpcsIsMutable() { + if (!rpcs_.isModifiable()) { + rpcs_ = new com.google.protobuf.LazyStringArrayList(rpcs_); + } + bitField0_ |= 0x00000002; + } + + /** + * repeated string rpcs = 2; + * + * @return A list containing the rpcs. + */ + public com.google.protobuf.ProtocolStringList getRpcsList() { + rpcs_.makeImmutable(); + return rpcs_; + } + + /** + * repeated string rpcs = 2; + * + * @return The count of rpcs. + */ + public int getRpcsCount() { + return rpcs_.size(); + } + + /** + * repeated string rpcs = 2; + * + * @param index The index of the element to return. + * @return The rpcs at the given index. + */ + public java.lang.String getRpcs(int index) { + return rpcs_.get(index); + } + + /** + * repeated string rpcs = 2; + * + * @param index The index of the value to return. + * @return The bytes of the rpcs at the given index. + */ + public com.google.protobuf.ByteString getRpcsBytes(int index) { + return rpcs_.getByteString(index); + } + + /** + * repeated string rpcs = 2; + * + * @param index The index to set the value at. + * @param value The rpcs to set. + * @return This builder for chaining. + */ + public Builder setRpcs(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureRpcsIsMutable(); + rpcs_.set(index, value); + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * repeated string rpcs = 2; + * + * @param value The rpcs to add. + * @return This builder for chaining. + */ + public Builder addRpcs(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureRpcsIsMutable(); + rpcs_.add(value); + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * repeated string rpcs = 2; + * + * @param values The rpcs to add. + * @return This builder for chaining. + */ + public Builder addAllRpcs(java.lang.Iterable values) { + ensureRpcsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, rpcs_); + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * repeated string rpcs = 2; + * + * @return This builder for chaining. + */ + public Builder clearRpcs() { + rpcs_ = com.google.protobuf.LazyStringArrayList.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + ; + onChanged(); + return this; + } + + /** + * repeated string rpcs = 2; + * + * @param value The bytes of the rpcs to add. + * @return This builder for chaining. + */ + public Builder addRpcsBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureRpcsIsMutable(); + rpcs_.add(value); + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private java.util.List requests_ = + java.util.Collections.emptyList(); + + private void ensureRequestsIsMutable() { + if (!((bitField0_ & 0x00000004) != 0)) { + requests_ = new java.util.ArrayList(requests_); + bitField0_ |= 0x00000004; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.showcase.v1beta1.RepeatRequest, + com.google.showcase.v1beta1.RepeatRequest.Builder, + com.google.showcase.v1beta1.RepeatRequestOrBuilder> + requestsBuilder_; + + /** repeated .google.showcase.v1beta1.RepeatRequest requests = 3; */ + public java.util.List getRequestsList() { + if (requestsBuilder_ == null) { + return java.util.Collections.unmodifiableList(requests_); + } else { + return requestsBuilder_.getMessageList(); + } + } + + /** repeated .google.showcase.v1beta1.RepeatRequest requests = 3; */ + public int getRequestsCount() { + if (requestsBuilder_ == null) { + return requests_.size(); + } else { + return requestsBuilder_.getCount(); + } + } + + /** repeated .google.showcase.v1beta1.RepeatRequest requests = 3; */ + public com.google.showcase.v1beta1.RepeatRequest getRequests(int index) { + if (requestsBuilder_ == null) { + return requests_.get(index); + } else { + return requestsBuilder_.getMessage(index); + } + } + + /** repeated .google.showcase.v1beta1.RepeatRequest requests = 3; */ + public Builder setRequests(int index, com.google.showcase.v1beta1.RepeatRequest value) { + if (requestsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureRequestsIsMutable(); + requests_.set(index, value); + onChanged(); + } else { + requestsBuilder_.setMessage(index, value); + } + return this; + } + + /** repeated .google.showcase.v1beta1.RepeatRequest requests = 3; */ + public Builder setRequests( + int index, com.google.showcase.v1beta1.RepeatRequest.Builder builderForValue) { + if (requestsBuilder_ == null) { + ensureRequestsIsMutable(); + requests_.set(index, builderForValue.build()); + onChanged(); + } else { + requestsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + + /** repeated .google.showcase.v1beta1.RepeatRequest requests = 3; */ + public Builder addRequests(com.google.showcase.v1beta1.RepeatRequest value) { + if (requestsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureRequestsIsMutable(); + requests_.add(value); + onChanged(); + } else { + requestsBuilder_.addMessage(value); + } + return this; + } + + /** repeated .google.showcase.v1beta1.RepeatRequest requests = 3; */ + public Builder addRequests(int index, com.google.showcase.v1beta1.RepeatRequest value) { + if (requestsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureRequestsIsMutable(); + requests_.add(index, value); + onChanged(); + } else { + requestsBuilder_.addMessage(index, value); + } + return this; + } + + /** repeated .google.showcase.v1beta1.RepeatRequest requests = 3; */ + public Builder addRequests(com.google.showcase.v1beta1.RepeatRequest.Builder builderForValue) { + if (requestsBuilder_ == null) { + ensureRequestsIsMutable(); + requests_.add(builderForValue.build()); + onChanged(); + } else { + requestsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + + /** repeated .google.showcase.v1beta1.RepeatRequest requests = 3; */ + public Builder addRequests( + int index, com.google.showcase.v1beta1.RepeatRequest.Builder builderForValue) { + if (requestsBuilder_ == null) { + ensureRequestsIsMutable(); + requests_.add(index, builderForValue.build()); + onChanged(); + } else { + requestsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + + /** repeated .google.showcase.v1beta1.RepeatRequest requests = 3; */ + public Builder addAllRequests( + java.lang.Iterable values) { + if (requestsBuilder_ == null) { + ensureRequestsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, requests_); + onChanged(); + } else { + requestsBuilder_.addAllMessages(values); + } + return this; + } + + /** repeated .google.showcase.v1beta1.RepeatRequest requests = 3; */ + public Builder clearRequests() { + if (requestsBuilder_ == null) { + requests_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + } else { + requestsBuilder_.clear(); + } + return this; + } + + /** repeated .google.showcase.v1beta1.RepeatRequest requests = 3; */ + public Builder removeRequests(int index) { + if (requestsBuilder_ == null) { + ensureRequestsIsMutable(); + requests_.remove(index); + onChanged(); + } else { + requestsBuilder_.remove(index); + } + return this; + } + + /** repeated .google.showcase.v1beta1.RepeatRequest requests = 3; */ + public com.google.showcase.v1beta1.RepeatRequest.Builder getRequestsBuilder(int index) { + return getRequestsFieldBuilder().getBuilder(index); + } + + /** repeated .google.showcase.v1beta1.RepeatRequest requests = 3; */ + public com.google.showcase.v1beta1.RepeatRequestOrBuilder getRequestsOrBuilder(int index) { + if (requestsBuilder_ == null) { + return requests_.get(index); + } else { + return requestsBuilder_.getMessageOrBuilder(index); + } + } + + /** repeated .google.showcase.v1beta1.RepeatRequest requests = 3; */ + public java.util.List + getRequestsOrBuilderList() { + if (requestsBuilder_ != null) { + return requestsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(requests_); + } + } + + /** repeated .google.showcase.v1beta1.RepeatRequest requests = 3; */ + public com.google.showcase.v1beta1.RepeatRequest.Builder addRequestsBuilder() { + return getRequestsFieldBuilder() + .addBuilder(com.google.showcase.v1beta1.RepeatRequest.getDefaultInstance()); + } + + /** repeated .google.showcase.v1beta1.RepeatRequest requests = 3; */ + public com.google.showcase.v1beta1.RepeatRequest.Builder addRequestsBuilder(int index) { + return getRequestsFieldBuilder() + .addBuilder(index, com.google.showcase.v1beta1.RepeatRequest.getDefaultInstance()); + } + + /** repeated .google.showcase.v1beta1.RepeatRequest requests = 3; */ + public java.util.List + getRequestsBuilderList() { + return getRequestsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.showcase.v1beta1.RepeatRequest, + com.google.showcase.v1beta1.RepeatRequest.Builder, + com.google.showcase.v1beta1.RepeatRequestOrBuilder> + getRequestsFieldBuilder() { + if (requestsBuilder_ == null) { + requestsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.showcase.v1beta1.RepeatRequest, + com.google.showcase.v1beta1.RepeatRequest.Builder, + com.google.showcase.v1beta1.RepeatRequestOrBuilder>( + requests_, ((bitField0_ & 0x00000004) != 0), getParentForChildren(), isClean()); + requests_ = null; + } + return requestsBuilder_; + } + + @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.showcase.v1beta1.ComplianceGroup) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.ComplianceGroup) + private static final com.google.showcase.v1beta1.ComplianceGroup DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.ComplianceGroup(); + } + + public static com.google.showcase.v1beta1.ComplianceGroup getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ComplianceGroup 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.showcase.v1beta1.ComplianceGroup getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ComplianceGroupOrBuilder.java b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ComplianceGroupOrBuilder.java new file mode 100644 index 0000000000..87f6eb29ee --- /dev/null +++ b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ComplianceGroupOrBuilder.java @@ -0,0 +1,86 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/compliance.proto + +// Protobuf Java Version: 3.25.8 +package com.google.showcase.v1beta1; + +public interface ComplianceGroupOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.ComplianceGroup) + com.google.protobuf.MessageOrBuilder { + + /** + * string name = 1; + * + * @return The name. + */ + java.lang.String getName(); + + /** + * string name = 1; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * repeated string rpcs = 2; + * + * @return A list containing the rpcs. + */ + java.util.List getRpcsList(); + + /** + * repeated string rpcs = 2; + * + * @return The count of rpcs. + */ + int getRpcsCount(); + + /** + * repeated string rpcs = 2; + * + * @param index The index of the element to return. + * @return The rpcs at the given index. + */ + java.lang.String getRpcs(int index); + + /** + * repeated string rpcs = 2; + * + * @param index The index of the value to return. + * @return The bytes of the rpcs at the given index. + */ + com.google.protobuf.ByteString getRpcsBytes(int index); + + /** repeated .google.showcase.v1beta1.RepeatRequest requests = 3; */ + java.util.List getRequestsList(); + + /** repeated .google.showcase.v1beta1.RepeatRequest requests = 3; */ + com.google.showcase.v1beta1.RepeatRequest getRequests(int index); + + /** repeated .google.showcase.v1beta1.RepeatRequest requests = 3; */ + int getRequestsCount(); + + /** repeated .google.showcase.v1beta1.RepeatRequest requests = 3; */ + java.util.List + getRequestsOrBuilderList(); + + /** repeated .google.showcase.v1beta1.RepeatRequest requests = 3; */ + com.google.showcase.v1beta1.RepeatRequestOrBuilder getRequestsOrBuilder(int index); +} diff --git a/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ComplianceOuterClass.java b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ComplianceOuterClass.java new file mode 100644 index 0000000000..78e6a3d834 --- /dev/null +++ b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ComplianceOuterClass.java @@ -0,0 +1,356 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/compliance.proto + +// Protobuf Java Version: 3.25.8 +package com.google.showcase.v1beta1; + +public final class ComplianceOuterClass { + private ComplianceOuterClass() {} + + 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_showcase_v1beta1_RepeatRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_showcase_v1beta1_RepeatRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_showcase_v1beta1_RepeatResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_showcase_v1beta1_RepeatResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_showcase_v1beta1_ComplianceSuite_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_showcase_v1beta1_ComplianceSuite_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_showcase_v1beta1_ComplianceGroup_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_showcase_v1beta1_ComplianceGroup_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_showcase_v1beta1_ComplianceData_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_showcase_v1beta1_ComplianceData_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_showcase_v1beta1_ComplianceDataChild_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_showcase_v1beta1_ComplianceDataChild_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_showcase_v1beta1_ComplianceDataGrandchild_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_showcase_v1beta1_ComplianceDataGrandchild_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_showcase_v1beta1_EnumRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_showcase_v1beta1_EnumRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_showcase_v1beta1_EnumResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_showcase_v1beta1_EnumResponse_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" + + "/schema/google/showcase/v1beta1/complia" + + "nce.proto\022\027google.showcase.v1beta1\032\034goog" + + "le/api/annotations.proto\032\027google/api/client.proto\"\303\002\n\r" + + "RepeatRequest\022\014\n" + + "\004name\030\001 \001(\t\0225\n" + + "\004info\030\002 \001(\0132\'.google.showcase.v1beta1.ComplianceData\022\025\n\r" + + "server_verify\030\003 \001(\010\022!\n" + + "\024intended_binding_uri\030\n" + + " \001(\tH\000\210\001\001\022\017\n" + + "\007f_int32\030\004 \001(\005\022\017\n" + + "\007f_int64\030\005 \001(\003\022\020\n" + + "\010f_double\030\006 \001(\001\022\024\n" + + "\007p_int32\030\007 \001(\005H\001\210\001\001\022\024\n" + + "\007p_int64\030\010 \001(\003H\002\210\001\001\022\025\n" + + "\010p_double\030\t \001(\001H\003\210\001\001B\027\n" + + "\025_intended_binding_uriB\n\n" + + "\010_p_int32B\n\n" + + "\010_p_int64B\013\n" + + "\t_p_double\"^\n" + + "\016RepeatResponse\0227\n" + + "\007request\030\001 \001(\0132&.google.showcase.v1beta1.RepeatRequest\022\023\n" + + "\013binding_uri\030\002 \001(\t\"J\n" + + "\017ComplianceSuite\0227\n" + + "\005group\030\001 \003(\0132(.google.showcase.v1beta1.ComplianceGroup\"g\n" + + "\017ComplianceGroup\022\014\n" + + "\004name\030\001 \001(\t\022\014\n" + + "\004rpcs\030\002 \003(\t\0228\n" + + "\010requests\030\003 \003(\0132&.google.showcase.v1beta1.RepeatRequest\"\340\006\n" + + "\016ComplianceData\022\020\n" + + "\010f_string\030\001 \001(\t\022\017\n" + + "\007f_int32\030\002 \001(\005\022\020\n" + + "\010f_sint32\030\003 \001(\021\022\022\n\n" + + "f_sfixed32\030\004 \001(\017\022\020\n" + + "\010f_uint32\030\005 \001(\r" + + "\022\021\n" + + "\tf_fixed32\030\006 \001(\007\022\017\n" + + "\007f_int64\030\007 \001(\003\022\020\n" + + "\010f_sint64\030\010 \001(\022\022\022\n\n" + + "f_sfixed64\030\t \001(\020\022\020\n" + + "\010f_uint64\030\n" + + " \001(\004\022\021\n" + + "\tf_fixed64\030\013 \001(\006\022\020\n" + + "\010f_double\030\014 \001(\001\022\017\n" + + "\007f_float\030\r" + + " \001(\002\022\016\n" + + "\006f_bool\030\016 \001(\010\022\017\n" + + "\007f_bytes\030\017 \001(\014\022F\n" + + "\tf_kingdom\030\026 \001(\016" + + "23.google.showcase.v1beta1.ComplianceData.LifeKingdom\022=\n" + + "\007f_child\030\020 \001(\0132,.google.showcase.v1beta1.ComplianceDataChild\022\025\n" + + "\010p_string\030\021 \001(\tH\000\210\001\001\022\024\n" + + "\007p_int32\030\022 \001(\005H\001\210\001\001\022\025\n" + + "\010p_double\030\023 \001(\001H\002\210\001\001\022\023\n" + + "\006p_bool\030\024 \001(\010H\003\210\001\001\022K\n" + + "\tp_kingdom\030\027 \001(\01623.google.showca" + + "se.v1beta1.ComplianceData.LifeKingdomH\004\210\001\001\022B\n" + + "\007p_child\030\025" + + " \001(\0132,.google.showcase.v1beta1.ComplianceDataChildH\005\210\001\001\"\203\001\n" + + "\013LifeKingdom\022\034\n" + + "\030LIFE_KINGDOM_UNSPECIFIED\020\000\022\022\n" + + "\016ARCHAEBACTERIA\020\001\022\016\n\n" + + "EUBACTERIA\020\002\022\014\n" + + "\010PROTISTA\020\003\022\t\n" + + "\005FUNGI\020\004\022\013\n" + + "\007PLANTAE\020\005\022\014\n" + + "\010ANIMALIA\020\006B\013\n" + + "\t_p_stringB\n\n" + + "\010_p_int32B\013\n" + + "\t_p_doubleB\t\n" + + "\007_p_boolB\014\n\n" + + "_p_kingdomB\n\n" + + "\010_p_child\"\357\003\n" + + "\023ComplianceDataChild\022\020\n" + + "\010f_string\030\001 \001(\t\022\017\n" + + "\007f_float\030\002 \001(\002\022\020\n" + + "\010f_double\030\003 \001(\001\022\016\n" + + "\006f_bool\030\004 \001(\010\0227\n" + + "\013f_continent\030\013 \001(\0162\".google.showcase.v1beta1.Continent\022B\n" + + "\007f_child\030\005" + + " \001(\01321.google.showcase.v1beta1.ComplianceDataGrandchild\022\025\n" + + "\010p_string\030\006 \001(\tH\000\210\001\001\022\024\n" + + "\007p_float\030\007 \001(\002H\001\210\001\001\022\025\n" + + "\010p_double\030\010 \001(\001H\002\210\001\001\022\023\n" + + "\006p_bool\030\t \001(\010H\003\210\001\001\0227\n" + + "\013p_continent\030\014 \001(\0162\".google.showcase.v1beta1.Continent\022G\n" + + "\007p_child\030\n" + + " \001(\01321.google.showcase.v1beta1.ComplianceDataGrandchildH\004\210\001\001B\013\n" + + "\t_p_stringB\n\n" + + "\010_p_floatB\013\n" + + "\t_p_doubleB\t\n" + + "\007_p_boolB\n\n" + + "\010_p_child\"N\n" + + "\030ComplianceDataGrandchild\022\020\n" + + "\010f_string\030\001 \001(\t\022\020\n" + + "\010f_double\030\002 \001(\001\022\016\n" + + "\006f_bool\030\003 \001(\010\"#\n" + + "\013EnumRequest\022\024\n" + + "\014unknown_enum\030\001 \001(\010\"|\n" + + "\014EnumResponse\0225\n" + + "\007request\030\001 \001(\0132$.google.showcase.v1beta1.EnumRequest\0225\n" + + "\tcontinent\030\002 \001(\0162\".google.showcase.v1beta1.Continent*i\n" + + "\tContinent\022\031\n" + + "\025CONTINENT_UNSPECIFIED\020\000\022\n\n" + + "\006AFRICA\020\001\022\013\n" + + "\007AMERICA\020\002\022\r\n" + + "\tANTARTICA\020\003\022\r\n" + + "\tAUSTRALIA\020\004\022\n\n" + + "\006EUROPE\020\0052\330\r\n\n" + + "Compliance\022\202\001\n" + + "\016RepeatDataBody\022&.google.showcase.v1beta1.RepeatReques" + + "t\032\'.google.showcase.v1beta1.RepeatResponse\"\037\202\323\344\223\002\031\"\024/v1beta1/repeat:body:\001*\022\215\001\n" + + "\022RepeatDataBodyInfo\022&.google.showcase.v1b" + + "eta1.RepeatRequest\032\'.google.showcase.v1beta1.RepeatResponse\"&\202\323\344\223\002" + + " \"\030/v1beta1/repeat:bodyinfo:\004info\022\201\001\n" + + "\017RepeatDataQuery\022&.google.showcase.v1beta1.RepeatRequest\032" + + "\'.google.showcase.v1beta1.RepeatResponse\"\035\202\323\344\223\002\027\022\025/v1beta1/repeat:query\022\331\001\n" + + "\024RepeatDataSimplePath\022&.google.showcase.v1bet" + + "a1.RepeatRequest\032\'.google.showcase.v1bet" + + "a1.RepeatResponse\"p\202\323\344\223\002j\022h/v1beta1/repe" + + "at/{info.f_string}/{info.f_int32}/{info." + + "f_double}/{info.f_bool}/{info.f_kingdom}:simplepath\022\323\002\n" + + "\026RepeatDataPathResource\022&.google.showcase.v1beta1.RepeatRequest\032\'" + + ".google.showcase.v1beta1.RepeatResponse\"" + + "\347\001\202\323\344\223\002\340\001\022h/v1beta1/repeat/{info.f_strin" + + "g=first/*}/{info.f_child.f_string=second/*}/bool/{info.f_bool}:pathresourceZt\022r/" + + "v1beta1/repeat/{info.f_child.f_string=fi" + + "rst/*}/{info.f_string=second/*}/bool/{info.f_bool}:childfirstpathresource\022\331\001\n" + + "\036RepeatDataPathTrailingResource\022&.google.sh" + + "owcase.v1beta1.RepeatRequest\032\'.google.sh" + + "owcase.v1beta1.RepeatResponse\"f\202\323\344\223\002`\022^/" + + "v1beta1/repeat/{info.f_string=first/*}/{" + + "info.f_child.f_string=second/**}:pathtrailingresource\022\210\001\n" + + "\021RepeatDataBodyPut\022&.google.showcase.v1beta1.RepeatRequest\032\'.go" + + "ogle.showcase.v1beta1.RepeatResponse\"\"\202\323\344\223\002\034\032\027/v1beta1/repeat:bodyput:\001*\022\214\001\n" + + "\023RepeatDataBodyPatch\022&.google.showcase.v1bet" + + "a1.RepeatRequest\032\'.google.showcase.v1bet" + + "a1.RepeatResponse\"$\202\323\344\223\002\0362\031/v1beta1/repeat:bodypatch:\001*\022x\n" + + "\007GetEnum\022$.google.show" + + "case.v1beta1.EnumRequest\032%.google.showcase.v1beta1.EnumResponse\"" + + " \202\323\344\223\002\032\022\030/v1beta1/compliance/enum\022|\n\n" + + "VerifyEnum\022%.google" + + ".showcase.v1beta1.EnumResponse\032%.google.showcase.v1beta1.EnumResponse\"" + + " \202\323\344\223\002\032\"\030/" + + "v1beta1/compliance/enum\032\021\312A\016localhost:7469Bq\n" + + "\033com.google.showcase.v1beta1P\001Z4github.com/googleapis/gapic-showcase/server" + + "/genproto\352\002\031Google::Showcase::V1beta1b\006proto3" + }; + descriptor = + com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( + descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + com.google.api.AnnotationsProto.getDescriptor(), + com.google.api.ClientProto.getDescriptor(), + }); + internal_static_google_showcase_v1beta1_RepeatRequest_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_showcase_v1beta1_RepeatRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_showcase_v1beta1_RepeatRequest_descriptor, + new java.lang.String[] { + "Name", + "Info", + "ServerVerify", + "IntendedBindingUri", + "FInt32", + "FInt64", + "FDouble", + "PInt32", + "PInt64", + "PDouble", + }); + internal_static_google_showcase_v1beta1_RepeatResponse_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_google_showcase_v1beta1_RepeatResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_showcase_v1beta1_RepeatResponse_descriptor, + new java.lang.String[] { + "Request", "BindingUri", + }); + internal_static_google_showcase_v1beta1_ComplianceSuite_descriptor = + getDescriptor().getMessageTypes().get(2); + internal_static_google_showcase_v1beta1_ComplianceSuite_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_showcase_v1beta1_ComplianceSuite_descriptor, + new java.lang.String[] { + "Group", + }); + internal_static_google_showcase_v1beta1_ComplianceGroup_descriptor = + getDescriptor().getMessageTypes().get(3); + internal_static_google_showcase_v1beta1_ComplianceGroup_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_showcase_v1beta1_ComplianceGroup_descriptor, + new java.lang.String[] { + "Name", "Rpcs", "Requests", + }); + internal_static_google_showcase_v1beta1_ComplianceData_descriptor = + getDescriptor().getMessageTypes().get(4); + internal_static_google_showcase_v1beta1_ComplianceData_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_showcase_v1beta1_ComplianceData_descriptor, + new java.lang.String[] { + "FString", + "FInt32", + "FSint32", + "FSfixed32", + "FUint32", + "FFixed32", + "FInt64", + "FSint64", + "FSfixed64", + "FUint64", + "FFixed64", + "FDouble", + "FFloat", + "FBool", + "FBytes", + "FKingdom", + "FChild", + "PString", + "PInt32", + "PDouble", + "PBool", + "PKingdom", + "PChild", + }); + internal_static_google_showcase_v1beta1_ComplianceDataChild_descriptor = + getDescriptor().getMessageTypes().get(5); + internal_static_google_showcase_v1beta1_ComplianceDataChild_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_showcase_v1beta1_ComplianceDataChild_descriptor, + new java.lang.String[] { + "FString", + "FFloat", + "FDouble", + "FBool", + "FContinent", + "FChild", + "PString", + "PFloat", + "PDouble", + "PBool", + "PContinent", + "PChild", + }); + internal_static_google_showcase_v1beta1_ComplianceDataGrandchild_descriptor = + getDescriptor().getMessageTypes().get(6); + internal_static_google_showcase_v1beta1_ComplianceDataGrandchild_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_showcase_v1beta1_ComplianceDataGrandchild_descriptor, + new java.lang.String[] { + "FString", "FDouble", "FBool", + }); + internal_static_google_showcase_v1beta1_EnumRequest_descriptor = + getDescriptor().getMessageTypes().get(7); + internal_static_google_showcase_v1beta1_EnumRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_showcase_v1beta1_EnumRequest_descriptor, + new java.lang.String[] { + "UnknownEnum", + }); + internal_static_google_showcase_v1beta1_EnumResponse_descriptor = + getDescriptor().getMessageTypes().get(8); + internal_static_google_showcase_v1beta1_EnumResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_showcase_v1beta1_EnumResponse_descriptor, + new java.lang.String[] { + "Request", "Continent", + }); + com.google.protobuf.ExtensionRegistry registry = + com.google.protobuf.ExtensionRegistry.newInstance(); + registry.add(com.google.api.ClientProto.defaultHost); + registry.add(com.google.api.AnnotationsProto.http); + com.google.protobuf.Descriptors.FileDescriptor.internalUpdateFileDescriptor( + descriptor, registry); + com.google.api.AnnotationsProto.getDescriptor(); + com.google.api.ClientProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ComplianceSuite.java b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ComplianceSuite.java new file mode 100644 index 0000000000..f0298221ae --- /dev/null +++ b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ComplianceSuite.java @@ -0,0 +1,778 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/compliance.proto + +// Protobuf Java Version: 3.25.8 +package com.google.showcase.v1beta1; + +/** + * + * + *
        + * ComplianceSuite contains a set of requests that microgenerators should issue
        + * over REST to the Compliance service to test their gRPC-to-REST transcoding
        + * implementation.
        + * 
        + * + * Protobuf type {@code google.showcase.v1beta1.ComplianceSuite} + */ +public final class ComplianceSuite extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.ComplianceSuite) + ComplianceSuiteOrBuilder { + private static final long serialVersionUID = 0L; + + // Use ComplianceSuite.newBuilder() to construct. + private ComplianceSuite(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ComplianceSuite() { + group_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ComplianceSuite(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.ComplianceOuterClass + .internal_static_google_showcase_v1beta1_ComplianceSuite_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.ComplianceOuterClass + .internal_static_google_showcase_v1beta1_ComplianceSuite_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.ComplianceSuite.class, + com.google.showcase.v1beta1.ComplianceSuite.Builder.class); + } + + public static final int GROUP_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private java.util.List group_; + + /** repeated .google.showcase.v1beta1.ComplianceGroup group = 1; */ + @java.lang.Override + public java.util.List getGroupList() { + return group_; + } + + /** repeated .google.showcase.v1beta1.ComplianceGroup group = 1; */ + @java.lang.Override + public java.util.List + getGroupOrBuilderList() { + return group_; + } + + /** repeated .google.showcase.v1beta1.ComplianceGroup group = 1; */ + @java.lang.Override + public int getGroupCount() { + return group_.size(); + } + + /** repeated .google.showcase.v1beta1.ComplianceGroup group = 1; */ + @java.lang.Override + public com.google.showcase.v1beta1.ComplianceGroup getGroup(int index) { + return group_.get(index); + } + + /** repeated .google.showcase.v1beta1.ComplianceGroup group = 1; */ + @java.lang.Override + public com.google.showcase.v1beta1.ComplianceGroupOrBuilder getGroupOrBuilder(int index) { + return group_.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 < group_.size(); i++) { + output.writeMessage(1, group_.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 < group_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, group_.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.showcase.v1beta1.ComplianceSuite)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.ComplianceSuite other = + (com.google.showcase.v1beta1.ComplianceSuite) obj; + + if (!getGroupList().equals(other.getGroupList())) 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 (getGroupCount() > 0) { + hash = (37 * hash) + GROUP_FIELD_NUMBER; + hash = (53 * hash) + getGroupList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.showcase.v1beta1.ComplianceSuite parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.ComplianceSuite parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.ComplianceSuite parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.ComplianceSuite 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.showcase.v1beta1.ComplianceSuite parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.ComplianceSuite parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.ComplianceSuite parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.ComplianceSuite 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.showcase.v1beta1.ComplianceSuite parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.ComplianceSuite 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.showcase.v1beta1.ComplianceSuite parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.ComplianceSuite 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.showcase.v1beta1.ComplianceSuite 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; + } + + /** + * + * + *
        +   * ComplianceSuite contains a set of requests that microgenerators should issue
        +   * over REST to the Compliance service to test their gRPC-to-REST transcoding
        +   * implementation.
        +   * 
        + * + * Protobuf type {@code google.showcase.v1beta1.ComplianceSuite} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.ComplianceSuite) + com.google.showcase.v1beta1.ComplianceSuiteOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.ComplianceOuterClass + .internal_static_google_showcase_v1beta1_ComplianceSuite_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.ComplianceOuterClass + .internal_static_google_showcase_v1beta1_ComplianceSuite_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.ComplianceSuite.class, + com.google.showcase.v1beta1.ComplianceSuite.Builder.class); + } + + // Construct using com.google.showcase.v1beta1.ComplianceSuite.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (groupBuilder_ == null) { + group_ = java.util.Collections.emptyList(); + } else { + group_ = null; + groupBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.showcase.v1beta1.ComplianceOuterClass + .internal_static_google_showcase_v1beta1_ComplianceSuite_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.ComplianceSuite getDefaultInstanceForType() { + return com.google.showcase.v1beta1.ComplianceSuite.getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.ComplianceSuite build() { + com.google.showcase.v1beta1.ComplianceSuite result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.ComplianceSuite buildPartial() { + com.google.showcase.v1beta1.ComplianceSuite result = + new com.google.showcase.v1beta1.ComplianceSuite(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields(com.google.showcase.v1beta1.ComplianceSuite result) { + if (groupBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + group_ = java.util.Collections.unmodifiableList(group_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.group_ = group_; + } else { + result.group_ = groupBuilder_.build(); + } + } + + private void buildPartial0(com.google.showcase.v1beta1.ComplianceSuite 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.showcase.v1beta1.ComplianceSuite) { + return mergeFrom((com.google.showcase.v1beta1.ComplianceSuite) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.showcase.v1beta1.ComplianceSuite other) { + if (other == com.google.showcase.v1beta1.ComplianceSuite.getDefaultInstance()) return this; + if (groupBuilder_ == null) { + if (!other.group_.isEmpty()) { + if (group_.isEmpty()) { + group_ = other.group_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureGroupIsMutable(); + group_.addAll(other.group_); + } + onChanged(); + } + } else { + if (!other.group_.isEmpty()) { + if (groupBuilder_.isEmpty()) { + groupBuilder_.dispose(); + groupBuilder_ = null; + group_ = other.group_; + bitField0_ = (bitField0_ & ~0x00000001); + groupBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getGroupFieldBuilder() + : null; + } else { + groupBuilder_.addAllMessages(other.group_); + } + } + } + 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.showcase.v1beta1.ComplianceGroup m = + input.readMessage( + com.google.showcase.v1beta1.ComplianceGroup.parser(), extensionRegistry); + if (groupBuilder_ == null) { + ensureGroupIsMutable(); + group_.add(m); + } else { + groupBuilder_.addMessage(m); + } + 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.util.List group_ = + java.util.Collections.emptyList(); + + private void ensureGroupIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + group_ = new java.util.ArrayList(group_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.showcase.v1beta1.ComplianceGroup, + com.google.showcase.v1beta1.ComplianceGroup.Builder, + com.google.showcase.v1beta1.ComplianceGroupOrBuilder> + groupBuilder_; + + /** repeated .google.showcase.v1beta1.ComplianceGroup group = 1; */ + public java.util.List getGroupList() { + if (groupBuilder_ == null) { + return java.util.Collections.unmodifiableList(group_); + } else { + return groupBuilder_.getMessageList(); + } + } + + /** repeated .google.showcase.v1beta1.ComplianceGroup group = 1; */ + public int getGroupCount() { + if (groupBuilder_ == null) { + return group_.size(); + } else { + return groupBuilder_.getCount(); + } + } + + /** repeated .google.showcase.v1beta1.ComplianceGroup group = 1; */ + public com.google.showcase.v1beta1.ComplianceGroup getGroup(int index) { + if (groupBuilder_ == null) { + return group_.get(index); + } else { + return groupBuilder_.getMessage(index); + } + } + + /** repeated .google.showcase.v1beta1.ComplianceGroup group = 1; */ + public Builder setGroup(int index, com.google.showcase.v1beta1.ComplianceGroup value) { + if (groupBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureGroupIsMutable(); + group_.set(index, value); + onChanged(); + } else { + groupBuilder_.setMessage(index, value); + } + return this; + } + + /** repeated .google.showcase.v1beta1.ComplianceGroup group = 1; */ + public Builder setGroup( + int index, com.google.showcase.v1beta1.ComplianceGroup.Builder builderForValue) { + if (groupBuilder_ == null) { + ensureGroupIsMutable(); + group_.set(index, builderForValue.build()); + onChanged(); + } else { + groupBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + + /** repeated .google.showcase.v1beta1.ComplianceGroup group = 1; */ + public Builder addGroup(com.google.showcase.v1beta1.ComplianceGroup value) { + if (groupBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureGroupIsMutable(); + group_.add(value); + onChanged(); + } else { + groupBuilder_.addMessage(value); + } + return this; + } + + /** repeated .google.showcase.v1beta1.ComplianceGroup group = 1; */ + public Builder addGroup(int index, com.google.showcase.v1beta1.ComplianceGroup value) { + if (groupBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureGroupIsMutable(); + group_.add(index, value); + onChanged(); + } else { + groupBuilder_.addMessage(index, value); + } + return this; + } + + /** repeated .google.showcase.v1beta1.ComplianceGroup group = 1; */ + public Builder addGroup(com.google.showcase.v1beta1.ComplianceGroup.Builder builderForValue) { + if (groupBuilder_ == null) { + ensureGroupIsMutable(); + group_.add(builderForValue.build()); + onChanged(); + } else { + groupBuilder_.addMessage(builderForValue.build()); + } + return this; + } + + /** repeated .google.showcase.v1beta1.ComplianceGroup group = 1; */ + public Builder addGroup( + int index, com.google.showcase.v1beta1.ComplianceGroup.Builder builderForValue) { + if (groupBuilder_ == null) { + ensureGroupIsMutable(); + group_.add(index, builderForValue.build()); + onChanged(); + } else { + groupBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + + /** repeated .google.showcase.v1beta1.ComplianceGroup group = 1; */ + public Builder addAllGroup( + java.lang.Iterable values) { + if (groupBuilder_ == null) { + ensureGroupIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, group_); + onChanged(); + } else { + groupBuilder_.addAllMessages(values); + } + return this; + } + + /** repeated .google.showcase.v1beta1.ComplianceGroup group = 1; */ + public Builder clearGroup() { + if (groupBuilder_ == null) { + group_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + groupBuilder_.clear(); + } + return this; + } + + /** repeated .google.showcase.v1beta1.ComplianceGroup group = 1; */ + public Builder removeGroup(int index) { + if (groupBuilder_ == null) { + ensureGroupIsMutable(); + group_.remove(index); + onChanged(); + } else { + groupBuilder_.remove(index); + } + return this; + } + + /** repeated .google.showcase.v1beta1.ComplianceGroup group = 1; */ + public com.google.showcase.v1beta1.ComplianceGroup.Builder getGroupBuilder(int index) { + return getGroupFieldBuilder().getBuilder(index); + } + + /** repeated .google.showcase.v1beta1.ComplianceGroup group = 1; */ + public com.google.showcase.v1beta1.ComplianceGroupOrBuilder getGroupOrBuilder(int index) { + if (groupBuilder_ == null) { + return group_.get(index); + } else { + return groupBuilder_.getMessageOrBuilder(index); + } + } + + /** repeated .google.showcase.v1beta1.ComplianceGroup group = 1; */ + public java.util.List + getGroupOrBuilderList() { + if (groupBuilder_ != null) { + return groupBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(group_); + } + } + + /** repeated .google.showcase.v1beta1.ComplianceGroup group = 1; */ + public com.google.showcase.v1beta1.ComplianceGroup.Builder addGroupBuilder() { + return getGroupFieldBuilder() + .addBuilder(com.google.showcase.v1beta1.ComplianceGroup.getDefaultInstance()); + } + + /** repeated .google.showcase.v1beta1.ComplianceGroup group = 1; */ + public com.google.showcase.v1beta1.ComplianceGroup.Builder addGroupBuilder(int index) { + return getGroupFieldBuilder() + .addBuilder(index, com.google.showcase.v1beta1.ComplianceGroup.getDefaultInstance()); + } + + /** repeated .google.showcase.v1beta1.ComplianceGroup group = 1; */ + public java.util.List + getGroupBuilderList() { + return getGroupFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.showcase.v1beta1.ComplianceGroup, + com.google.showcase.v1beta1.ComplianceGroup.Builder, + com.google.showcase.v1beta1.ComplianceGroupOrBuilder> + getGroupFieldBuilder() { + if (groupBuilder_ == null) { + groupBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.showcase.v1beta1.ComplianceGroup, + com.google.showcase.v1beta1.ComplianceGroup.Builder, + com.google.showcase.v1beta1.ComplianceGroupOrBuilder>( + group_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + group_ = null; + } + return groupBuilder_; + } + + @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.showcase.v1beta1.ComplianceSuite) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.ComplianceSuite) + private static final com.google.showcase.v1beta1.ComplianceSuite DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.ComplianceSuite(); + } + + public static com.google.showcase.v1beta1.ComplianceSuite getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ComplianceSuite 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.showcase.v1beta1.ComplianceSuite getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ComplianceSuiteOrBuilder.java b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ComplianceSuiteOrBuilder.java new file mode 100644 index 0000000000..6c6dfdaf30 --- /dev/null +++ b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ComplianceSuiteOrBuilder.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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/compliance.proto + +// Protobuf Java Version: 3.25.8 +package com.google.showcase.v1beta1; + +public interface ComplianceSuiteOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.ComplianceSuite) + com.google.protobuf.MessageOrBuilder { + + /** repeated .google.showcase.v1beta1.ComplianceGroup group = 1; */ + java.util.List getGroupList(); + + /** repeated .google.showcase.v1beta1.ComplianceGroup group = 1; */ + com.google.showcase.v1beta1.ComplianceGroup getGroup(int index); + + /** repeated .google.showcase.v1beta1.ComplianceGroup group = 1; */ + int getGroupCount(); + + /** repeated .google.showcase.v1beta1.ComplianceGroup group = 1; */ + java.util.List + getGroupOrBuilderList(); + + /** repeated .google.showcase.v1beta1.ComplianceGroup group = 1; */ + com.google.showcase.v1beta1.ComplianceGroupOrBuilder getGroupOrBuilder(int index); +} diff --git a/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ConnectRequest.java b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ConnectRequest.java new file mode 100644 index 0000000000..171579a2db --- /dev/null +++ b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ConnectRequest.java @@ -0,0 +1,1787 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/messaging.proto + +// Protobuf Java Version: 3.25.8 +package com.google.showcase.v1beta1; + +/** + * + * + *
        + * The request message for the google.showcase.v1beta1.Messaging\Connect
        + * method.
        + * 
        + * + * Protobuf type {@code google.showcase.v1beta1.ConnectRequest} + */ +public final class ConnectRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.ConnectRequest) + ConnectRequestOrBuilder { + private static final long serialVersionUID = 0L; + + // Use ConnectRequest.newBuilder() to construct. + private ConnectRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ConnectRequest() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ConnectRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.MessagingOuterClass + .internal_static_google_showcase_v1beta1_ConnectRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.MessagingOuterClass + .internal_static_google_showcase_v1beta1_ConnectRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.ConnectRequest.class, + com.google.showcase.v1beta1.ConnectRequest.Builder.class); + } + + public interface ConnectConfigOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.ConnectRequest.ConnectConfig) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
        +     * The room or profile to follow and create messages for.
        +     * 
        + * + * string parent = 1 [(.google.api.resource_reference) = { ... } + * + * @return The parent. + */ + java.lang.String getParent(); + + /** + * + * + *
        +     * The room or profile to follow and create messages for.
        +     * 
        + * + * string parent = 1 [(.google.api.resource_reference) = { ... } + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + } + + /** Protobuf type {@code google.showcase.v1beta1.ConnectRequest.ConnectConfig} */ + public static final class ConnectConfig extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.ConnectRequest.ConnectConfig) + ConnectConfigOrBuilder { + private static final long serialVersionUID = 0L; + + // Use ConnectConfig.newBuilder() to construct. + private ConnectConfig(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ConnectConfig() { + parent_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ConnectConfig(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.MessagingOuterClass + .internal_static_google_showcase_v1beta1_ConnectRequest_ConnectConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.MessagingOuterClass + .internal_static_google_showcase_v1beta1_ConnectRequest_ConnectConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.ConnectRequest.ConnectConfig.class, + com.google.showcase.v1beta1.ConnectRequest.ConnectConfig.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object parent_ = ""; + + /** + * + * + *
        +     * The room or profile to follow and create messages for.
        +     * 
        + * + * string parent = 1 [(.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; + } + } + + /** + * + * + *
        +     * The room or profile to follow and create messages for.
        +     * 
        + * + * string parent = 1 [(.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; + } + } + + 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_); + } + 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_); + } + 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.showcase.v1beta1.ConnectRequest.ConnectConfig)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.ConnectRequest.ConnectConfig other = + (com.google.showcase.v1beta1.ConnectRequest.ConnectConfig) obj; + + if (!getParent().equals(other.getParent())) 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 = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.showcase.v1beta1.ConnectRequest.ConnectConfig parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.ConnectRequest.ConnectConfig parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.ConnectRequest.ConnectConfig parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.ConnectRequest.ConnectConfig 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.showcase.v1beta1.ConnectRequest.ConnectConfig parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.ConnectRequest.ConnectConfig parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.ConnectRequest.ConnectConfig parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.ConnectRequest.ConnectConfig 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.showcase.v1beta1.ConnectRequest.ConnectConfig parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.ConnectRequest.ConnectConfig 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.showcase.v1beta1.ConnectRequest.ConnectConfig parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.ConnectRequest.ConnectConfig 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.showcase.v1beta1.ConnectRequest.ConnectConfig prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** Protobuf type {@code google.showcase.v1beta1.ConnectRequest.ConnectConfig} */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.ConnectRequest.ConnectConfig) + com.google.showcase.v1beta1.ConnectRequest.ConnectConfigOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.MessagingOuterClass + .internal_static_google_showcase_v1beta1_ConnectRequest_ConnectConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.MessagingOuterClass + .internal_static_google_showcase_v1beta1_ConnectRequest_ConnectConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.ConnectRequest.ConnectConfig.class, + com.google.showcase.v1beta1.ConnectRequest.ConnectConfig.Builder.class); + } + + // Construct using com.google.showcase.v1beta1.ConnectRequest.ConnectConfig.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + parent_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.showcase.v1beta1.MessagingOuterClass + .internal_static_google_showcase_v1beta1_ConnectRequest_ConnectConfig_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.ConnectRequest.ConnectConfig getDefaultInstanceForType() { + return com.google.showcase.v1beta1.ConnectRequest.ConnectConfig.getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.ConnectRequest.ConnectConfig build() { + com.google.showcase.v1beta1.ConnectRequest.ConnectConfig result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.ConnectRequest.ConnectConfig buildPartial() { + com.google.showcase.v1beta1.ConnectRequest.ConnectConfig result = + new com.google.showcase.v1beta1.ConnectRequest.ConnectConfig(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.showcase.v1beta1.ConnectRequest.ConnectConfig result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.parent_ = parent_; + } + } + + @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.showcase.v1beta1.ConnectRequest.ConnectConfig) { + return mergeFrom((com.google.showcase.v1beta1.ConnectRequest.ConnectConfig) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.showcase.v1beta1.ConnectRequest.ConnectConfig other) { + if (other == com.google.showcase.v1beta1.ConnectRequest.ConnectConfig.getDefaultInstance()) + return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + 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: + { + parent_ = 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 parent_ = ""; + + /** + * + * + *
        +       * The room or profile to follow and create messages for.
        +       * 
        + * + * string parent = 1 [(.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; + } + } + + /** + * + * + *
        +       * The room or profile to follow and create messages for.
        +       * 
        + * + * string parent = 1 [(.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; + } + } + + /** + * + * + *
        +       * The room or profile to follow and create messages for.
        +       * 
        + * + * string parent = 1 [(.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; + } + + /** + * + * + *
        +       * The room or profile to follow and create messages for.
        +       * 
        + * + * string parent = 1 [(.google.api.resource_reference) = { ... } + * + * @return This builder for chaining. + */ + public Builder clearParent() { + parent_ = getDefaultInstance().getParent(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
        +       * The room or profile to follow and create messages for.
        +       * 
        + * + * string parent = 1 [(.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; + } + + @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.showcase.v1beta1.ConnectRequest.ConnectConfig) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.ConnectRequest.ConnectConfig) + private static final com.google.showcase.v1beta1.ConnectRequest.ConnectConfig DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.ConnectRequest.ConnectConfig(); + } + + public static com.google.showcase.v1beta1.ConnectRequest.ConnectConfig getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ConnectConfig 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.showcase.v1beta1.ConnectRequest.ConnectConfig getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + 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 { + CONFIG(1), + BLURB(2), + 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 1: + return CONFIG; + case 2: + return BLURB; + 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 CONFIG_FIELD_NUMBER = 1; + + /** + * + * + *
        +   * Provides information that specifies how to process subsequent requests.
        +   * The first `ConnectRequest` message must contain a `config`  message.
        +   * 
        + * + * .google.showcase.v1beta1.ConnectRequest.ConnectConfig config = 1; + * + * @return Whether the config field is set. + */ + @java.lang.Override + public boolean hasConfig() { + return requestCase_ == 1; + } + + /** + * + * + *
        +   * Provides information that specifies how to process subsequent requests.
        +   * The first `ConnectRequest` message must contain a `config`  message.
        +   * 
        + * + * .google.showcase.v1beta1.ConnectRequest.ConnectConfig config = 1; + * + * @return The config. + */ + @java.lang.Override + public com.google.showcase.v1beta1.ConnectRequest.ConnectConfig getConfig() { + if (requestCase_ == 1) { + return (com.google.showcase.v1beta1.ConnectRequest.ConnectConfig) request_; + } + return com.google.showcase.v1beta1.ConnectRequest.ConnectConfig.getDefaultInstance(); + } + + /** + * + * + *
        +   * Provides information that specifies how to process subsequent requests.
        +   * The first `ConnectRequest` message must contain a `config`  message.
        +   * 
        + * + * .google.showcase.v1beta1.ConnectRequest.ConnectConfig config = 1; + */ + @java.lang.Override + public com.google.showcase.v1beta1.ConnectRequest.ConnectConfigOrBuilder getConfigOrBuilder() { + if (requestCase_ == 1) { + return (com.google.showcase.v1beta1.ConnectRequest.ConnectConfig) request_; + } + return com.google.showcase.v1beta1.ConnectRequest.ConnectConfig.getDefaultInstance(); + } + + public static final int BLURB_FIELD_NUMBER = 2; + + /** + * + * + *
        +   * The blurb to be created.
        +   * 
        + * + * .google.showcase.v1beta1.Blurb blurb = 2; + * + * @return Whether the blurb field is set. + */ + @java.lang.Override + public boolean hasBlurb() { + return requestCase_ == 2; + } + + /** + * + * + *
        +   * The blurb to be created.
        +   * 
        + * + * .google.showcase.v1beta1.Blurb blurb = 2; + * + * @return The blurb. + */ + @java.lang.Override + public com.google.showcase.v1beta1.Blurb getBlurb() { + if (requestCase_ == 2) { + return (com.google.showcase.v1beta1.Blurb) request_; + } + return com.google.showcase.v1beta1.Blurb.getDefaultInstance(); + } + + /** + * + * + *
        +   * The blurb to be created.
        +   * 
        + * + * .google.showcase.v1beta1.Blurb blurb = 2; + */ + @java.lang.Override + public com.google.showcase.v1beta1.BlurbOrBuilder getBlurbOrBuilder() { + if (requestCase_ == 2) { + return (com.google.showcase.v1beta1.Blurb) request_; + } + return com.google.showcase.v1beta1.Blurb.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 (requestCase_ == 1) { + output.writeMessage(1, (com.google.showcase.v1beta1.ConnectRequest.ConnectConfig) request_); + } + if (requestCase_ == 2) { + output.writeMessage(2, (com.google.showcase.v1beta1.Blurb) request_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (requestCase_ == 1) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 1, (com.google.showcase.v1beta1.ConnectRequest.ConnectConfig) request_); + } + if (requestCase_ == 2) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 2, (com.google.showcase.v1beta1.Blurb) 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.showcase.v1beta1.ConnectRequest)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.ConnectRequest other = + (com.google.showcase.v1beta1.ConnectRequest) obj; + + if (!getRequestCase().equals(other.getRequestCase())) return false; + switch (requestCase_) { + case 1: + if (!getConfig().equals(other.getConfig())) return false; + break; + case 2: + if (!getBlurb().equals(other.getBlurb())) 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(); + switch (requestCase_) { + case 1: + hash = (37 * hash) + CONFIG_FIELD_NUMBER; + hash = (53 * hash) + getConfig().hashCode(); + break; + case 2: + hash = (37 * hash) + BLURB_FIELD_NUMBER; + hash = (53 * hash) + getBlurb().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.showcase.v1beta1.ConnectRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.ConnectRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.ConnectRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.ConnectRequest 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.showcase.v1beta1.ConnectRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.ConnectRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.ConnectRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.ConnectRequest 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.showcase.v1beta1.ConnectRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.ConnectRequest 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.showcase.v1beta1.ConnectRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.ConnectRequest 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.showcase.v1beta1.ConnectRequest 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 request message for the google.showcase.v1beta1.Messaging\Connect
        +   * method.
        +   * 
        + * + * Protobuf type {@code google.showcase.v1beta1.ConnectRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.ConnectRequest) + com.google.showcase.v1beta1.ConnectRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.MessagingOuterClass + .internal_static_google_showcase_v1beta1_ConnectRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.MessagingOuterClass + .internal_static_google_showcase_v1beta1_ConnectRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.ConnectRequest.class, + com.google.showcase.v1beta1.ConnectRequest.Builder.class); + } + + // Construct using com.google.showcase.v1beta1.ConnectRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (configBuilder_ != null) { + configBuilder_.clear(); + } + if (blurbBuilder_ != null) { + blurbBuilder_.clear(); + } + requestCase_ = 0; + request_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.showcase.v1beta1.MessagingOuterClass + .internal_static_google_showcase_v1beta1_ConnectRequest_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.ConnectRequest getDefaultInstanceForType() { + return com.google.showcase.v1beta1.ConnectRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.ConnectRequest build() { + com.google.showcase.v1beta1.ConnectRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.ConnectRequest buildPartial() { + com.google.showcase.v1beta1.ConnectRequest result = + new com.google.showcase.v1beta1.ConnectRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + buildPartialOneofs(result); + onBuilt(); + return result; + } + + private void buildPartial0(com.google.showcase.v1beta1.ConnectRequest result) { + int from_bitField0_ = bitField0_; + } + + private void buildPartialOneofs(com.google.showcase.v1beta1.ConnectRequest result) { + result.requestCase_ = requestCase_; + result.request_ = this.request_; + if (requestCase_ == 1 && configBuilder_ != null) { + result.request_ = configBuilder_.build(); + } + if (requestCase_ == 2 && blurbBuilder_ != null) { + result.request_ = blurbBuilder_.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.showcase.v1beta1.ConnectRequest) { + return mergeFrom((com.google.showcase.v1beta1.ConnectRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.showcase.v1beta1.ConnectRequest other) { + if (other == com.google.showcase.v1beta1.ConnectRequest.getDefaultInstance()) return this; + switch (other.getRequestCase()) { + case CONFIG: + { + mergeConfig(other.getConfig()); + break; + } + case BLURB: + { + mergeBlurb(other.getBlurb()); + 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(getConfigFieldBuilder().getBuilder(), extensionRegistry); + requestCase_ = 1; + break; + } // case 10 + case 18: + { + input.readMessage(getBlurbFieldBuilder().getBuilder(), extensionRegistry); + requestCase_ = 2; + 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 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.SingleFieldBuilderV3< + com.google.showcase.v1beta1.ConnectRequest.ConnectConfig, + com.google.showcase.v1beta1.ConnectRequest.ConnectConfig.Builder, + com.google.showcase.v1beta1.ConnectRequest.ConnectConfigOrBuilder> + configBuilder_; + + /** + * + * + *
        +     * Provides information that specifies how to process subsequent requests.
        +     * The first `ConnectRequest` message must contain a `config`  message.
        +     * 
        + * + * .google.showcase.v1beta1.ConnectRequest.ConnectConfig config = 1; + * + * @return Whether the config field is set. + */ + @java.lang.Override + public boolean hasConfig() { + return requestCase_ == 1; + } + + /** + * + * + *
        +     * Provides information that specifies how to process subsequent requests.
        +     * The first `ConnectRequest` message must contain a `config`  message.
        +     * 
        + * + * .google.showcase.v1beta1.ConnectRequest.ConnectConfig config = 1; + * + * @return The config. + */ + @java.lang.Override + public com.google.showcase.v1beta1.ConnectRequest.ConnectConfig getConfig() { + if (configBuilder_ == null) { + if (requestCase_ == 1) { + return (com.google.showcase.v1beta1.ConnectRequest.ConnectConfig) request_; + } + return com.google.showcase.v1beta1.ConnectRequest.ConnectConfig.getDefaultInstance(); + } else { + if (requestCase_ == 1) { + return configBuilder_.getMessage(); + } + return com.google.showcase.v1beta1.ConnectRequest.ConnectConfig.getDefaultInstance(); + } + } + + /** + * + * + *
        +     * Provides information that specifies how to process subsequent requests.
        +     * The first `ConnectRequest` message must contain a `config`  message.
        +     * 
        + * + * .google.showcase.v1beta1.ConnectRequest.ConnectConfig config = 1; + */ + public Builder setConfig(com.google.showcase.v1beta1.ConnectRequest.ConnectConfig value) { + if (configBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + request_ = value; + onChanged(); + } else { + configBuilder_.setMessage(value); + } + requestCase_ = 1; + return this; + } + + /** + * + * + *
        +     * Provides information that specifies how to process subsequent requests.
        +     * The first `ConnectRequest` message must contain a `config`  message.
        +     * 
        + * + * .google.showcase.v1beta1.ConnectRequest.ConnectConfig config = 1; + */ + public Builder setConfig( + com.google.showcase.v1beta1.ConnectRequest.ConnectConfig.Builder builderForValue) { + if (configBuilder_ == null) { + request_ = builderForValue.build(); + onChanged(); + } else { + configBuilder_.setMessage(builderForValue.build()); + } + requestCase_ = 1; + return this; + } + + /** + * + * + *
        +     * Provides information that specifies how to process subsequent requests.
        +     * The first `ConnectRequest` message must contain a `config`  message.
        +     * 
        + * + * .google.showcase.v1beta1.ConnectRequest.ConnectConfig config = 1; + */ + public Builder mergeConfig(com.google.showcase.v1beta1.ConnectRequest.ConnectConfig value) { + if (configBuilder_ == null) { + if (requestCase_ == 1 + && request_ + != com.google.showcase.v1beta1.ConnectRequest.ConnectConfig.getDefaultInstance()) { + request_ = + com.google.showcase.v1beta1.ConnectRequest.ConnectConfig.newBuilder( + (com.google.showcase.v1beta1.ConnectRequest.ConnectConfig) request_) + .mergeFrom(value) + .buildPartial(); + } else { + request_ = value; + } + onChanged(); + } else { + if (requestCase_ == 1) { + configBuilder_.mergeFrom(value); + } else { + configBuilder_.setMessage(value); + } + } + requestCase_ = 1; + return this; + } + + /** + * + * + *
        +     * Provides information that specifies how to process subsequent requests.
        +     * The first `ConnectRequest` message must contain a `config`  message.
        +     * 
        + * + * .google.showcase.v1beta1.ConnectRequest.ConnectConfig config = 1; + */ + public Builder clearConfig() { + if (configBuilder_ == null) { + if (requestCase_ == 1) { + requestCase_ = 0; + request_ = null; + onChanged(); + } + } else { + if (requestCase_ == 1) { + requestCase_ = 0; + request_ = null; + } + configBuilder_.clear(); + } + return this; + } + + /** + * + * + *
        +     * Provides information that specifies how to process subsequent requests.
        +     * The first `ConnectRequest` message must contain a `config`  message.
        +     * 
        + * + * .google.showcase.v1beta1.ConnectRequest.ConnectConfig config = 1; + */ + public com.google.showcase.v1beta1.ConnectRequest.ConnectConfig.Builder getConfigBuilder() { + return getConfigFieldBuilder().getBuilder(); + } + + /** + * + * + *
        +     * Provides information that specifies how to process subsequent requests.
        +     * The first `ConnectRequest` message must contain a `config`  message.
        +     * 
        + * + * .google.showcase.v1beta1.ConnectRequest.ConnectConfig config = 1; + */ + @java.lang.Override + public com.google.showcase.v1beta1.ConnectRequest.ConnectConfigOrBuilder getConfigOrBuilder() { + if ((requestCase_ == 1) && (configBuilder_ != null)) { + return configBuilder_.getMessageOrBuilder(); + } else { + if (requestCase_ == 1) { + return (com.google.showcase.v1beta1.ConnectRequest.ConnectConfig) request_; + } + return com.google.showcase.v1beta1.ConnectRequest.ConnectConfig.getDefaultInstance(); + } + } + + /** + * + * + *
        +     * Provides information that specifies how to process subsequent requests.
        +     * The first `ConnectRequest` message must contain a `config`  message.
        +     * 
        + * + * .google.showcase.v1beta1.ConnectRequest.ConnectConfig config = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.showcase.v1beta1.ConnectRequest.ConnectConfig, + com.google.showcase.v1beta1.ConnectRequest.ConnectConfig.Builder, + com.google.showcase.v1beta1.ConnectRequest.ConnectConfigOrBuilder> + getConfigFieldBuilder() { + if (configBuilder_ == null) { + if (!(requestCase_ == 1)) { + request_ = com.google.showcase.v1beta1.ConnectRequest.ConnectConfig.getDefaultInstance(); + } + configBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.showcase.v1beta1.ConnectRequest.ConnectConfig, + com.google.showcase.v1beta1.ConnectRequest.ConnectConfig.Builder, + com.google.showcase.v1beta1.ConnectRequest.ConnectConfigOrBuilder>( + (com.google.showcase.v1beta1.ConnectRequest.ConnectConfig) request_, + getParentForChildren(), + isClean()); + request_ = null; + } + requestCase_ = 1; + onChanged(); + return configBuilder_; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.showcase.v1beta1.Blurb, + com.google.showcase.v1beta1.Blurb.Builder, + com.google.showcase.v1beta1.BlurbOrBuilder> + blurbBuilder_; + + /** + * + * + *
        +     * The blurb to be created.
        +     * 
        + * + * .google.showcase.v1beta1.Blurb blurb = 2; + * + * @return Whether the blurb field is set. + */ + @java.lang.Override + public boolean hasBlurb() { + return requestCase_ == 2; + } + + /** + * + * + *
        +     * The blurb to be created.
        +     * 
        + * + * .google.showcase.v1beta1.Blurb blurb = 2; + * + * @return The blurb. + */ + @java.lang.Override + public com.google.showcase.v1beta1.Blurb getBlurb() { + if (blurbBuilder_ == null) { + if (requestCase_ == 2) { + return (com.google.showcase.v1beta1.Blurb) request_; + } + return com.google.showcase.v1beta1.Blurb.getDefaultInstance(); + } else { + if (requestCase_ == 2) { + return blurbBuilder_.getMessage(); + } + return com.google.showcase.v1beta1.Blurb.getDefaultInstance(); + } + } + + /** + * + * + *
        +     * The blurb to be created.
        +     * 
        + * + * .google.showcase.v1beta1.Blurb blurb = 2; + */ + public Builder setBlurb(com.google.showcase.v1beta1.Blurb value) { + if (blurbBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + request_ = value; + onChanged(); + } else { + blurbBuilder_.setMessage(value); + } + requestCase_ = 2; + return this; + } + + /** + * + * + *
        +     * The blurb to be created.
        +     * 
        + * + * .google.showcase.v1beta1.Blurb blurb = 2; + */ + public Builder setBlurb(com.google.showcase.v1beta1.Blurb.Builder builderForValue) { + if (blurbBuilder_ == null) { + request_ = builderForValue.build(); + onChanged(); + } else { + blurbBuilder_.setMessage(builderForValue.build()); + } + requestCase_ = 2; + return this; + } + + /** + * + * + *
        +     * The blurb to be created.
        +     * 
        + * + * .google.showcase.v1beta1.Blurb blurb = 2; + */ + public Builder mergeBlurb(com.google.showcase.v1beta1.Blurb value) { + if (blurbBuilder_ == null) { + if (requestCase_ == 2 + && request_ != com.google.showcase.v1beta1.Blurb.getDefaultInstance()) { + request_ = + com.google.showcase.v1beta1.Blurb.newBuilder( + (com.google.showcase.v1beta1.Blurb) request_) + .mergeFrom(value) + .buildPartial(); + } else { + request_ = value; + } + onChanged(); + } else { + if (requestCase_ == 2) { + blurbBuilder_.mergeFrom(value); + } else { + blurbBuilder_.setMessage(value); + } + } + requestCase_ = 2; + return this; + } + + /** + * + * + *
        +     * The blurb to be created.
        +     * 
        + * + * .google.showcase.v1beta1.Blurb blurb = 2; + */ + public Builder clearBlurb() { + if (blurbBuilder_ == null) { + if (requestCase_ == 2) { + requestCase_ = 0; + request_ = null; + onChanged(); + } + } else { + if (requestCase_ == 2) { + requestCase_ = 0; + request_ = null; + } + blurbBuilder_.clear(); + } + return this; + } + + /** + * + * + *
        +     * The blurb to be created.
        +     * 
        + * + * .google.showcase.v1beta1.Blurb blurb = 2; + */ + public com.google.showcase.v1beta1.Blurb.Builder getBlurbBuilder() { + return getBlurbFieldBuilder().getBuilder(); + } + + /** + * + * + *
        +     * The blurb to be created.
        +     * 
        + * + * .google.showcase.v1beta1.Blurb blurb = 2; + */ + @java.lang.Override + public com.google.showcase.v1beta1.BlurbOrBuilder getBlurbOrBuilder() { + if ((requestCase_ == 2) && (blurbBuilder_ != null)) { + return blurbBuilder_.getMessageOrBuilder(); + } else { + if (requestCase_ == 2) { + return (com.google.showcase.v1beta1.Blurb) request_; + } + return com.google.showcase.v1beta1.Blurb.getDefaultInstance(); + } + } + + /** + * + * + *
        +     * The blurb to be created.
        +     * 
        + * + * .google.showcase.v1beta1.Blurb blurb = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.showcase.v1beta1.Blurb, + com.google.showcase.v1beta1.Blurb.Builder, + com.google.showcase.v1beta1.BlurbOrBuilder> + getBlurbFieldBuilder() { + if (blurbBuilder_ == null) { + if (!(requestCase_ == 2)) { + request_ = com.google.showcase.v1beta1.Blurb.getDefaultInstance(); + } + blurbBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.showcase.v1beta1.Blurb, + com.google.showcase.v1beta1.Blurb.Builder, + com.google.showcase.v1beta1.BlurbOrBuilder>( + (com.google.showcase.v1beta1.Blurb) request_, getParentForChildren(), isClean()); + request_ = null; + } + requestCase_ = 2; + onChanged(); + return blurbBuilder_; + } + + @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.showcase.v1beta1.ConnectRequest) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.ConnectRequest) + private static final com.google.showcase.v1beta1.ConnectRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.ConnectRequest(); + } + + public static com.google.showcase.v1beta1.ConnectRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ConnectRequest 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.showcase.v1beta1.ConnectRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ConnectRequestOrBuilder.java b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ConnectRequestOrBuilder.java new file mode 100644 index 0000000000..1ae50be2b6 --- /dev/null +++ b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ConnectRequestOrBuilder.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: schema/google/showcase/v1beta1/messaging.proto + +// Protobuf Java Version: 3.25.8 +package com.google.showcase.v1beta1; + +public interface ConnectRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.ConnectRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
        +   * Provides information that specifies how to process subsequent requests.
        +   * The first `ConnectRequest` message must contain a `config`  message.
        +   * 
        + * + * .google.showcase.v1beta1.ConnectRequest.ConnectConfig config = 1; + * + * @return Whether the config field is set. + */ + boolean hasConfig(); + + /** + * + * + *
        +   * Provides information that specifies how to process subsequent requests.
        +   * The first `ConnectRequest` message must contain a `config`  message.
        +   * 
        + * + * .google.showcase.v1beta1.ConnectRequest.ConnectConfig config = 1; + * + * @return The config. + */ + com.google.showcase.v1beta1.ConnectRequest.ConnectConfig getConfig(); + + /** + * + * + *
        +   * Provides information that specifies how to process subsequent requests.
        +   * The first `ConnectRequest` message must contain a `config`  message.
        +   * 
        + * + * .google.showcase.v1beta1.ConnectRequest.ConnectConfig config = 1; + */ + com.google.showcase.v1beta1.ConnectRequest.ConnectConfigOrBuilder getConfigOrBuilder(); + + /** + * + * + *
        +   * The blurb to be created.
        +   * 
        + * + * .google.showcase.v1beta1.Blurb blurb = 2; + * + * @return Whether the blurb field is set. + */ + boolean hasBlurb(); + + /** + * + * + *
        +   * The blurb to be created.
        +   * 
        + * + * .google.showcase.v1beta1.Blurb blurb = 2; + * + * @return The blurb. + */ + com.google.showcase.v1beta1.Blurb getBlurb(); + + /** + * + * + *
        +   * The blurb to be created.
        +   * 
        + * + * .google.showcase.v1beta1.Blurb blurb = 2; + */ + com.google.showcase.v1beta1.BlurbOrBuilder getBlurbOrBuilder(); + + com.google.showcase.v1beta1.ConnectRequest.RequestCase getRequestCase(); +} diff --git a/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/Continent.java b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/Continent.java new file mode 100644 index 0000000000..9482df1340 --- /dev/null +++ b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/Continent.java @@ -0,0 +1,144 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/compliance.proto + +// Protobuf Java Version: 3.25.8 +package com.google.showcase.v1beta1; + +/** Protobuf enum {@code google.showcase.v1beta1.Continent} */ +public enum Continent implements com.google.protobuf.ProtocolMessageEnum { + /** CONTINENT_UNSPECIFIED = 0; */ + CONTINENT_UNSPECIFIED(0), + /** AFRICA = 1; */ + AFRICA(1), + /** AMERICA = 2; */ + AMERICA(2), + /** ANTARTICA = 3; */ + ANTARTICA(3), + /** AUSTRALIA = 4; */ + AUSTRALIA(4), + /** EUROPE = 5; */ + EUROPE(5), + UNRECOGNIZED(-1), + ; + + /** CONTINENT_UNSPECIFIED = 0; */ + public static final int CONTINENT_UNSPECIFIED_VALUE = 0; + + /** AFRICA = 1; */ + public static final int AFRICA_VALUE = 1; + + /** AMERICA = 2; */ + public static final int AMERICA_VALUE = 2; + + /** ANTARTICA = 3; */ + public static final int ANTARTICA_VALUE = 3; + + /** AUSTRALIA = 4; */ + public static final int AUSTRALIA_VALUE = 4; + + /** EUROPE = 5; */ + public static final int EUROPE_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 Continent 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 Continent forNumber(int value) { + switch (value) { + case 0: + return CONTINENT_UNSPECIFIED; + case 1: + return AFRICA; + case 2: + return AMERICA; + case 3: + return ANTARTICA; + case 4: + return AUSTRALIA; + case 5: + return EUROPE; + 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 Continent findValueByNumber(int number) { + return Continent.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.showcase.v1beta1.ComplianceOuterClass.getDescriptor().getEnumTypes().get(0); + } + + private static final Continent[] VALUES = values(); + + public static Continent 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 Continent(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.showcase.v1beta1.Continent) +} diff --git a/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/CreateBlurbRequest.java b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/CreateBlurbRequest.java new file mode 100644 index 0000000000..5fd72c1dbd --- /dev/null +++ b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/CreateBlurbRequest.java @@ -0,0 +1,939 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/messaging.proto + +// Protobuf Java Version: 3.25.8 +package com.google.showcase.v1beta1; + +/** + * + * + *
        + * The request message for the google.showcase.v1beta1.Messaging\CreateBlurb
        + * method.
        + * 
        + * + * Protobuf type {@code google.showcase.v1beta1.CreateBlurbRequest} + */ +public final class CreateBlurbRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.CreateBlurbRequest) + CreateBlurbRequestOrBuilder { + private static final long serialVersionUID = 0L; + + // Use CreateBlurbRequest.newBuilder() to construct. + private CreateBlurbRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private CreateBlurbRequest() { + parent_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new CreateBlurbRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.MessagingOuterClass + .internal_static_google_showcase_v1beta1_CreateBlurbRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.MessagingOuterClass + .internal_static_google_showcase_v1beta1_CreateBlurbRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.CreateBlurbRequest.class, + com.google.showcase.v1beta1.CreateBlurbRequest.Builder.class); + } + + private int bitField0_; + public static final int PARENT_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object parent_ = ""; + + /** + * + * + *
        +   * The resource name of the chat room or user profile that this blurb will
        +   * be tied to.
        +   * 
        + * + * + * 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; + } + } + + /** + * + * + *
        +   * The resource name of the chat room or user profile that this blurb will
        +   * be tied to.
        +   * 
        + * + * + * 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 BLURB_FIELD_NUMBER = 2; + private com.google.showcase.v1beta1.Blurb blurb_; + + /** + * + * + *
        +   * The blurb to create.
        +   * 
        + * + * .google.showcase.v1beta1.Blurb blurb = 2; + * + * @return Whether the blurb field is set. + */ + @java.lang.Override + public boolean hasBlurb() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
        +   * The blurb to create.
        +   * 
        + * + * .google.showcase.v1beta1.Blurb blurb = 2; + * + * @return The blurb. + */ + @java.lang.Override + public com.google.showcase.v1beta1.Blurb getBlurb() { + return blurb_ == null ? com.google.showcase.v1beta1.Blurb.getDefaultInstance() : blurb_; + } + + /** + * + * + *
        +   * The blurb to create.
        +   * 
        + * + * .google.showcase.v1beta1.Blurb blurb = 2; + */ + @java.lang.Override + public com.google.showcase.v1beta1.BlurbOrBuilder getBlurbOrBuilder() { + return blurb_ == null ? com.google.showcase.v1beta1.Blurb.getDefaultInstance() : blurb_; + } + + 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, getBlurb()); + } + 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, getBlurb()); + } + 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.showcase.v1beta1.CreateBlurbRequest)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.CreateBlurbRequest other = + (com.google.showcase.v1beta1.CreateBlurbRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (hasBlurb() != other.hasBlurb()) return false; + if (hasBlurb()) { + if (!getBlurb().equals(other.getBlurb())) 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 (hasBlurb()) { + hash = (37 * hash) + BLURB_FIELD_NUMBER; + hash = (53 * hash) + getBlurb().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.showcase.v1beta1.CreateBlurbRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.CreateBlurbRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.CreateBlurbRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.CreateBlurbRequest 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.showcase.v1beta1.CreateBlurbRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.CreateBlurbRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.CreateBlurbRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.CreateBlurbRequest 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.showcase.v1beta1.CreateBlurbRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.CreateBlurbRequest 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.showcase.v1beta1.CreateBlurbRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.CreateBlurbRequest 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.showcase.v1beta1.CreateBlurbRequest 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 request message for the google.showcase.v1beta1.Messaging\CreateBlurb
        +   * method.
        +   * 
        + * + * Protobuf type {@code google.showcase.v1beta1.CreateBlurbRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.CreateBlurbRequest) + com.google.showcase.v1beta1.CreateBlurbRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.MessagingOuterClass + .internal_static_google_showcase_v1beta1_CreateBlurbRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.MessagingOuterClass + .internal_static_google_showcase_v1beta1_CreateBlurbRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.CreateBlurbRequest.class, + com.google.showcase.v1beta1.CreateBlurbRequest.Builder.class); + } + + // Construct using com.google.showcase.v1beta1.CreateBlurbRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getBlurbFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + parent_ = ""; + blurb_ = null; + if (blurbBuilder_ != null) { + blurbBuilder_.dispose(); + blurbBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.showcase.v1beta1.MessagingOuterClass + .internal_static_google_showcase_v1beta1_CreateBlurbRequest_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.CreateBlurbRequest getDefaultInstanceForType() { + return com.google.showcase.v1beta1.CreateBlurbRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.CreateBlurbRequest build() { + com.google.showcase.v1beta1.CreateBlurbRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.CreateBlurbRequest buildPartial() { + com.google.showcase.v1beta1.CreateBlurbRequest result = + new com.google.showcase.v1beta1.CreateBlurbRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.showcase.v1beta1.CreateBlurbRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.parent_ = parent_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.blurb_ = blurbBuilder_ == null ? blurb_ : blurbBuilder_.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.showcase.v1beta1.CreateBlurbRequest) { + return mergeFrom((com.google.showcase.v1beta1.CreateBlurbRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.showcase.v1beta1.CreateBlurbRequest other) { + if (other == com.google.showcase.v1beta1.CreateBlurbRequest.getDefaultInstance()) return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.hasBlurb()) { + mergeBlurb(other.getBlurb()); + } + 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(getBlurbFieldBuilder().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_ = ""; + + /** + * + * + *
        +     * The resource name of the chat room or user profile that this blurb will
        +     * be tied to.
        +     * 
        + * + * + * 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; + } + } + + /** + * + * + *
        +     * The resource name of the chat room or user profile that this blurb will
        +     * be tied to.
        +     * 
        + * + * + * 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; + } + } + + /** + * + * + *
        +     * The resource name of the chat room or user profile that this blurb will
        +     * be tied to.
        +     * 
        + * + * + * 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; + } + + /** + * + * + *
        +     * The resource name of the chat room or user profile that this blurb will
        +     * be tied to.
        +     * 
        + * + * + * 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; + } + + /** + * + * + *
        +     * The resource name of the chat room or user profile that this blurb will
        +     * be tied to.
        +     * 
        + * + * + * 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.showcase.v1beta1.Blurb blurb_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.showcase.v1beta1.Blurb, + com.google.showcase.v1beta1.Blurb.Builder, + com.google.showcase.v1beta1.BlurbOrBuilder> + blurbBuilder_; + + /** + * + * + *
        +     * The blurb to create.
        +     * 
        + * + * .google.showcase.v1beta1.Blurb blurb = 2; + * + * @return Whether the blurb field is set. + */ + public boolean hasBlurb() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
        +     * The blurb to create.
        +     * 
        + * + * .google.showcase.v1beta1.Blurb blurb = 2; + * + * @return The blurb. + */ + public com.google.showcase.v1beta1.Blurb getBlurb() { + if (blurbBuilder_ == null) { + return blurb_ == null ? com.google.showcase.v1beta1.Blurb.getDefaultInstance() : blurb_; + } else { + return blurbBuilder_.getMessage(); + } + } + + /** + * + * + *
        +     * The blurb to create.
        +     * 
        + * + * .google.showcase.v1beta1.Blurb blurb = 2; + */ + public Builder setBlurb(com.google.showcase.v1beta1.Blurb value) { + if (blurbBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + blurb_ = value; + } else { + blurbBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
        +     * The blurb to create.
        +     * 
        + * + * .google.showcase.v1beta1.Blurb blurb = 2; + */ + public Builder setBlurb(com.google.showcase.v1beta1.Blurb.Builder builderForValue) { + if (blurbBuilder_ == null) { + blurb_ = builderForValue.build(); + } else { + blurbBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
        +     * The blurb to create.
        +     * 
        + * + * .google.showcase.v1beta1.Blurb blurb = 2; + */ + public Builder mergeBlurb(com.google.showcase.v1beta1.Blurb value) { + if (blurbBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && blurb_ != null + && blurb_ != com.google.showcase.v1beta1.Blurb.getDefaultInstance()) { + getBlurbBuilder().mergeFrom(value); + } else { + blurb_ = value; + } + } else { + blurbBuilder_.mergeFrom(value); + } + if (blurb_ != null) { + bitField0_ |= 0x00000002; + onChanged(); + } + return this; + } + + /** + * + * + *
        +     * The blurb to create.
        +     * 
        + * + * .google.showcase.v1beta1.Blurb blurb = 2; + */ + public Builder clearBlurb() { + bitField0_ = (bitField0_ & ~0x00000002); + blurb_ = null; + if (blurbBuilder_ != null) { + blurbBuilder_.dispose(); + blurbBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
        +     * The blurb to create.
        +     * 
        + * + * .google.showcase.v1beta1.Blurb blurb = 2; + */ + public com.google.showcase.v1beta1.Blurb.Builder getBlurbBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return getBlurbFieldBuilder().getBuilder(); + } + + /** + * + * + *
        +     * The blurb to create.
        +     * 
        + * + * .google.showcase.v1beta1.Blurb blurb = 2; + */ + public com.google.showcase.v1beta1.BlurbOrBuilder getBlurbOrBuilder() { + if (blurbBuilder_ != null) { + return blurbBuilder_.getMessageOrBuilder(); + } else { + return blurb_ == null ? com.google.showcase.v1beta1.Blurb.getDefaultInstance() : blurb_; + } + } + + /** + * + * + *
        +     * The blurb to create.
        +     * 
        + * + * .google.showcase.v1beta1.Blurb blurb = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.showcase.v1beta1.Blurb, + com.google.showcase.v1beta1.Blurb.Builder, + com.google.showcase.v1beta1.BlurbOrBuilder> + getBlurbFieldBuilder() { + if (blurbBuilder_ == null) { + blurbBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.showcase.v1beta1.Blurb, + com.google.showcase.v1beta1.Blurb.Builder, + com.google.showcase.v1beta1.BlurbOrBuilder>( + getBlurb(), getParentForChildren(), isClean()); + blurb_ = null; + } + return blurbBuilder_; + } + + @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.showcase.v1beta1.CreateBlurbRequest) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.CreateBlurbRequest) + private static final com.google.showcase.v1beta1.CreateBlurbRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.CreateBlurbRequest(); + } + + public static com.google.showcase.v1beta1.CreateBlurbRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CreateBlurbRequest 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.showcase.v1beta1.CreateBlurbRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/CreateBlurbRequestOrBuilder.java b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/CreateBlurbRequestOrBuilder.java new file mode 100644 index 0000000000..e93bc3d7a6 --- /dev/null +++ b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/CreateBlurbRequestOrBuilder.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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/messaging.proto + +// Protobuf Java Version: 3.25.8 +package com.google.showcase.v1beta1; + +public interface CreateBlurbRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.CreateBlurbRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
        +   * The resource name of the chat room or user profile that this blurb will
        +   * be tied to.
        +   * 
        + * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + + /** + * + * + *
        +   * The resource name of the chat room or user profile that this blurb will
        +   * be tied to.
        +   * 
        + * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
        +   * The blurb to create.
        +   * 
        + * + * .google.showcase.v1beta1.Blurb blurb = 2; + * + * @return Whether the blurb field is set. + */ + boolean hasBlurb(); + + /** + * + * + *
        +   * The blurb to create.
        +   * 
        + * + * .google.showcase.v1beta1.Blurb blurb = 2; + * + * @return The blurb. + */ + com.google.showcase.v1beta1.Blurb getBlurb(); + + /** + * + * + *
        +   * The blurb to create.
        +   * 
        + * + * .google.showcase.v1beta1.Blurb blurb = 2; + */ + com.google.showcase.v1beta1.BlurbOrBuilder getBlurbOrBuilder(); +} diff --git a/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/CreateRoomRequest.java b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/CreateRoomRequest.java new file mode 100644 index 0000000000..4ca4189680 --- /dev/null +++ b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/CreateRoomRequest.java @@ -0,0 +1,728 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/messaging.proto + +// Protobuf Java Version: 3.25.8 +package com.google.showcase.v1beta1; + +/** + * + * + *
        + * The request message for the google.showcase.v1beta1.Messaging\CreateRoom
        + * method.
        + * 
        + * + * Protobuf type {@code google.showcase.v1beta1.CreateRoomRequest} + */ +public final class CreateRoomRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.CreateRoomRequest) + CreateRoomRequestOrBuilder { + private static final long serialVersionUID = 0L; + + // Use CreateRoomRequest.newBuilder() to construct. + private CreateRoomRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private CreateRoomRequest() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new CreateRoomRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.MessagingOuterClass + .internal_static_google_showcase_v1beta1_CreateRoomRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.MessagingOuterClass + .internal_static_google_showcase_v1beta1_CreateRoomRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.CreateRoomRequest.class, + com.google.showcase.v1beta1.CreateRoomRequest.Builder.class); + } + + private int bitField0_; + public static final int ROOM_FIELD_NUMBER = 1; + private com.google.showcase.v1beta1.Room room_; + + /** + * + * + *
        +   * The room to create.
        +   * 
        + * + * .google.showcase.v1beta1.Room room = 1; + * + * @return Whether the room field is set. + */ + @java.lang.Override + public boolean hasRoom() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
        +   * The room to create.
        +   * 
        + * + * .google.showcase.v1beta1.Room room = 1; + * + * @return The room. + */ + @java.lang.Override + public com.google.showcase.v1beta1.Room getRoom() { + return room_ == null ? com.google.showcase.v1beta1.Room.getDefaultInstance() : room_; + } + + /** + * + * + *
        +   * The room to create.
        +   * 
        + * + * .google.showcase.v1beta1.Room room = 1; + */ + @java.lang.Override + public com.google.showcase.v1beta1.RoomOrBuilder getRoomOrBuilder() { + return room_ == null ? com.google.showcase.v1beta1.Room.getDefaultInstance() : room_; + } + + 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, getRoom()); + } + 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, getRoom()); + } + 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.showcase.v1beta1.CreateRoomRequest)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.CreateRoomRequest other = + (com.google.showcase.v1beta1.CreateRoomRequest) obj; + + if (hasRoom() != other.hasRoom()) return false; + if (hasRoom()) { + if (!getRoom().equals(other.getRoom())) 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 (hasRoom()) { + hash = (37 * hash) + ROOM_FIELD_NUMBER; + hash = (53 * hash) + getRoom().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.showcase.v1beta1.CreateRoomRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.CreateRoomRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.CreateRoomRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.CreateRoomRequest 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.showcase.v1beta1.CreateRoomRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.CreateRoomRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.CreateRoomRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.CreateRoomRequest 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.showcase.v1beta1.CreateRoomRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.CreateRoomRequest 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.showcase.v1beta1.CreateRoomRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.CreateRoomRequest 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.showcase.v1beta1.CreateRoomRequest 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 request message for the google.showcase.v1beta1.Messaging\CreateRoom
        +   * method.
        +   * 
        + * + * Protobuf type {@code google.showcase.v1beta1.CreateRoomRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.CreateRoomRequest) + com.google.showcase.v1beta1.CreateRoomRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.MessagingOuterClass + .internal_static_google_showcase_v1beta1_CreateRoomRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.MessagingOuterClass + .internal_static_google_showcase_v1beta1_CreateRoomRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.CreateRoomRequest.class, + com.google.showcase.v1beta1.CreateRoomRequest.Builder.class); + } + + // Construct using com.google.showcase.v1beta1.CreateRoomRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getRoomFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + room_ = null; + if (roomBuilder_ != null) { + roomBuilder_.dispose(); + roomBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.showcase.v1beta1.MessagingOuterClass + .internal_static_google_showcase_v1beta1_CreateRoomRequest_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.CreateRoomRequest getDefaultInstanceForType() { + return com.google.showcase.v1beta1.CreateRoomRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.CreateRoomRequest build() { + com.google.showcase.v1beta1.CreateRoomRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.CreateRoomRequest buildPartial() { + com.google.showcase.v1beta1.CreateRoomRequest result = + new com.google.showcase.v1beta1.CreateRoomRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.showcase.v1beta1.CreateRoomRequest result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.room_ = roomBuilder_ == null ? room_ : roomBuilder_.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.showcase.v1beta1.CreateRoomRequest) { + return mergeFrom((com.google.showcase.v1beta1.CreateRoomRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.showcase.v1beta1.CreateRoomRequest other) { + if (other == com.google.showcase.v1beta1.CreateRoomRequest.getDefaultInstance()) return this; + if (other.hasRoom()) { + mergeRoom(other.getRoom()); + } + 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(getRoomFieldBuilder().getBuilder(), extensionRegistry); + 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 com.google.showcase.v1beta1.Room room_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.showcase.v1beta1.Room, + com.google.showcase.v1beta1.Room.Builder, + com.google.showcase.v1beta1.RoomOrBuilder> + roomBuilder_; + + /** + * + * + *
        +     * The room to create.
        +     * 
        + * + * .google.showcase.v1beta1.Room room = 1; + * + * @return Whether the room field is set. + */ + public boolean hasRoom() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
        +     * The room to create.
        +     * 
        + * + * .google.showcase.v1beta1.Room room = 1; + * + * @return The room. + */ + public com.google.showcase.v1beta1.Room getRoom() { + if (roomBuilder_ == null) { + return room_ == null ? com.google.showcase.v1beta1.Room.getDefaultInstance() : room_; + } else { + return roomBuilder_.getMessage(); + } + } + + /** + * + * + *
        +     * The room to create.
        +     * 
        + * + * .google.showcase.v1beta1.Room room = 1; + */ + public Builder setRoom(com.google.showcase.v1beta1.Room value) { + if (roomBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + room_ = value; + } else { + roomBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
        +     * The room to create.
        +     * 
        + * + * .google.showcase.v1beta1.Room room = 1; + */ + public Builder setRoom(com.google.showcase.v1beta1.Room.Builder builderForValue) { + if (roomBuilder_ == null) { + room_ = builderForValue.build(); + } else { + roomBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
        +     * The room to create.
        +     * 
        + * + * .google.showcase.v1beta1.Room room = 1; + */ + public Builder mergeRoom(com.google.showcase.v1beta1.Room value) { + if (roomBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) + && room_ != null + && room_ != com.google.showcase.v1beta1.Room.getDefaultInstance()) { + getRoomBuilder().mergeFrom(value); + } else { + room_ = value; + } + } else { + roomBuilder_.mergeFrom(value); + } + if (room_ != null) { + bitField0_ |= 0x00000001; + onChanged(); + } + return this; + } + + /** + * + * + *
        +     * The room to create.
        +     * 
        + * + * .google.showcase.v1beta1.Room room = 1; + */ + public Builder clearRoom() { + bitField0_ = (bitField0_ & ~0x00000001); + room_ = null; + if (roomBuilder_ != null) { + roomBuilder_.dispose(); + roomBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
        +     * The room to create.
        +     * 
        + * + * .google.showcase.v1beta1.Room room = 1; + */ + public com.google.showcase.v1beta1.Room.Builder getRoomBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return getRoomFieldBuilder().getBuilder(); + } + + /** + * + * + *
        +     * The room to create.
        +     * 
        + * + * .google.showcase.v1beta1.Room room = 1; + */ + public com.google.showcase.v1beta1.RoomOrBuilder getRoomOrBuilder() { + if (roomBuilder_ != null) { + return roomBuilder_.getMessageOrBuilder(); + } else { + return room_ == null ? com.google.showcase.v1beta1.Room.getDefaultInstance() : room_; + } + } + + /** + * + * + *
        +     * The room to create.
        +     * 
        + * + * .google.showcase.v1beta1.Room room = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.showcase.v1beta1.Room, + com.google.showcase.v1beta1.Room.Builder, + com.google.showcase.v1beta1.RoomOrBuilder> + getRoomFieldBuilder() { + if (roomBuilder_ == null) { + roomBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.showcase.v1beta1.Room, + com.google.showcase.v1beta1.Room.Builder, + com.google.showcase.v1beta1.RoomOrBuilder>( + getRoom(), getParentForChildren(), isClean()); + room_ = null; + } + return roomBuilder_; + } + + @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.showcase.v1beta1.CreateRoomRequest) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.CreateRoomRequest) + private static final com.google.showcase.v1beta1.CreateRoomRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.CreateRoomRequest(); + } + + public static com.google.showcase.v1beta1.CreateRoomRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CreateRoomRequest 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.showcase.v1beta1.CreateRoomRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/CreateRoomRequestOrBuilder.java b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/CreateRoomRequestOrBuilder.java new file mode 100644 index 0000000000..7558fee0e1 --- /dev/null +++ b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/CreateRoomRequestOrBuilder.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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/messaging.proto + +// Protobuf Java Version: 3.25.8 +package com.google.showcase.v1beta1; + +public interface CreateRoomRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.CreateRoomRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
        +   * The room to create.
        +   * 
        + * + * .google.showcase.v1beta1.Room room = 1; + * + * @return Whether the room field is set. + */ + boolean hasRoom(); + + /** + * + * + *
        +   * The room to create.
        +   * 
        + * + * .google.showcase.v1beta1.Room room = 1; + * + * @return The room. + */ + com.google.showcase.v1beta1.Room getRoom(); + + /** + * + * + *
        +   * The room to create.
        +   * 
        + * + * .google.showcase.v1beta1.Room room = 1; + */ + com.google.showcase.v1beta1.RoomOrBuilder getRoomOrBuilder(); +} diff --git a/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/CreateSequenceRequest.java b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/CreateSequenceRequest.java new file mode 100644 index 0000000000..fd1fccbc11 --- /dev/null +++ b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/CreateSequenceRequest.java @@ -0,0 +1,631 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/sequence.proto + +// Protobuf Java Version: 3.25.8 +package com.google.showcase.v1beta1; + +/** Protobuf type {@code google.showcase.v1beta1.CreateSequenceRequest} */ +public final class CreateSequenceRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.CreateSequenceRequest) + CreateSequenceRequestOrBuilder { + private static final long serialVersionUID = 0L; + + // Use CreateSequenceRequest.newBuilder() to construct. + private CreateSequenceRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private CreateSequenceRequest() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new CreateSequenceRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.SequenceOuterClass + .internal_static_google_showcase_v1beta1_CreateSequenceRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.SequenceOuterClass + .internal_static_google_showcase_v1beta1_CreateSequenceRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.CreateSequenceRequest.class, + com.google.showcase.v1beta1.CreateSequenceRequest.Builder.class); + } + + private int bitField0_; + public static final int SEQUENCE_FIELD_NUMBER = 1; + private com.google.showcase.v1beta1.Sequence sequence_; + + /** + * .google.showcase.v1beta1.Sequence sequence = 1; + * + * @return Whether the sequence field is set. + */ + @java.lang.Override + public boolean hasSequence() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * .google.showcase.v1beta1.Sequence sequence = 1; + * + * @return The sequence. + */ + @java.lang.Override + public com.google.showcase.v1beta1.Sequence getSequence() { + return sequence_ == null + ? com.google.showcase.v1beta1.Sequence.getDefaultInstance() + : sequence_; + } + + /** .google.showcase.v1beta1.Sequence sequence = 1; */ + @java.lang.Override + public com.google.showcase.v1beta1.SequenceOrBuilder getSequenceOrBuilder() { + return sequence_ == null + ? com.google.showcase.v1beta1.Sequence.getDefaultInstance() + : sequence_; + } + + 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, getSequence()); + } + 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, getSequence()); + } + 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.showcase.v1beta1.CreateSequenceRequest)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.CreateSequenceRequest other = + (com.google.showcase.v1beta1.CreateSequenceRequest) obj; + + if (hasSequence() != other.hasSequence()) return false; + if (hasSequence()) { + if (!getSequence().equals(other.getSequence())) 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 (hasSequence()) { + hash = (37 * hash) + SEQUENCE_FIELD_NUMBER; + hash = (53 * hash) + getSequence().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.showcase.v1beta1.CreateSequenceRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.CreateSequenceRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.CreateSequenceRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.CreateSequenceRequest 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.showcase.v1beta1.CreateSequenceRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.CreateSequenceRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.CreateSequenceRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.CreateSequenceRequest 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.showcase.v1beta1.CreateSequenceRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.CreateSequenceRequest 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.showcase.v1beta1.CreateSequenceRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.CreateSequenceRequest 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.showcase.v1beta1.CreateSequenceRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** Protobuf type {@code google.showcase.v1beta1.CreateSequenceRequest} */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.CreateSequenceRequest) + com.google.showcase.v1beta1.CreateSequenceRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.SequenceOuterClass + .internal_static_google_showcase_v1beta1_CreateSequenceRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.SequenceOuterClass + .internal_static_google_showcase_v1beta1_CreateSequenceRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.CreateSequenceRequest.class, + com.google.showcase.v1beta1.CreateSequenceRequest.Builder.class); + } + + // Construct using com.google.showcase.v1beta1.CreateSequenceRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getSequenceFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + sequence_ = null; + if (sequenceBuilder_ != null) { + sequenceBuilder_.dispose(); + sequenceBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.showcase.v1beta1.SequenceOuterClass + .internal_static_google_showcase_v1beta1_CreateSequenceRequest_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.CreateSequenceRequest getDefaultInstanceForType() { + return com.google.showcase.v1beta1.CreateSequenceRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.CreateSequenceRequest build() { + com.google.showcase.v1beta1.CreateSequenceRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.CreateSequenceRequest buildPartial() { + com.google.showcase.v1beta1.CreateSequenceRequest result = + new com.google.showcase.v1beta1.CreateSequenceRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.showcase.v1beta1.CreateSequenceRequest result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.sequence_ = sequenceBuilder_ == null ? sequence_ : sequenceBuilder_.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.showcase.v1beta1.CreateSequenceRequest) { + return mergeFrom((com.google.showcase.v1beta1.CreateSequenceRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.showcase.v1beta1.CreateSequenceRequest other) { + if (other == com.google.showcase.v1beta1.CreateSequenceRequest.getDefaultInstance()) + return this; + if (other.hasSequence()) { + mergeSequence(other.getSequence()); + } + 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(getSequenceFieldBuilder().getBuilder(), extensionRegistry); + 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 com.google.showcase.v1beta1.Sequence sequence_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.showcase.v1beta1.Sequence, + com.google.showcase.v1beta1.Sequence.Builder, + com.google.showcase.v1beta1.SequenceOrBuilder> + sequenceBuilder_; + + /** + * .google.showcase.v1beta1.Sequence sequence = 1; + * + * @return Whether the sequence field is set. + */ + public boolean hasSequence() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * .google.showcase.v1beta1.Sequence sequence = 1; + * + * @return The sequence. + */ + public com.google.showcase.v1beta1.Sequence getSequence() { + if (sequenceBuilder_ == null) { + return sequence_ == null + ? com.google.showcase.v1beta1.Sequence.getDefaultInstance() + : sequence_; + } else { + return sequenceBuilder_.getMessage(); + } + } + + /** .google.showcase.v1beta1.Sequence sequence = 1; */ + public Builder setSequence(com.google.showcase.v1beta1.Sequence value) { + if (sequenceBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + sequence_ = value; + } else { + sequenceBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** .google.showcase.v1beta1.Sequence sequence = 1; */ + public Builder setSequence(com.google.showcase.v1beta1.Sequence.Builder builderForValue) { + if (sequenceBuilder_ == null) { + sequence_ = builderForValue.build(); + } else { + sequenceBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** .google.showcase.v1beta1.Sequence sequence = 1; */ + public Builder mergeSequence(com.google.showcase.v1beta1.Sequence value) { + if (sequenceBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) + && sequence_ != null + && sequence_ != com.google.showcase.v1beta1.Sequence.getDefaultInstance()) { + getSequenceBuilder().mergeFrom(value); + } else { + sequence_ = value; + } + } else { + sequenceBuilder_.mergeFrom(value); + } + if (sequence_ != null) { + bitField0_ |= 0x00000001; + onChanged(); + } + return this; + } + + /** .google.showcase.v1beta1.Sequence sequence = 1; */ + public Builder clearSequence() { + bitField0_ = (bitField0_ & ~0x00000001); + sequence_ = null; + if (sequenceBuilder_ != null) { + sequenceBuilder_.dispose(); + sequenceBuilder_ = null; + } + onChanged(); + return this; + } + + /** .google.showcase.v1beta1.Sequence sequence = 1; */ + public com.google.showcase.v1beta1.Sequence.Builder getSequenceBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return getSequenceFieldBuilder().getBuilder(); + } + + /** .google.showcase.v1beta1.Sequence sequence = 1; */ + public com.google.showcase.v1beta1.SequenceOrBuilder getSequenceOrBuilder() { + if (sequenceBuilder_ != null) { + return sequenceBuilder_.getMessageOrBuilder(); + } else { + return sequence_ == null + ? com.google.showcase.v1beta1.Sequence.getDefaultInstance() + : sequence_; + } + } + + /** .google.showcase.v1beta1.Sequence sequence = 1; */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.showcase.v1beta1.Sequence, + com.google.showcase.v1beta1.Sequence.Builder, + com.google.showcase.v1beta1.SequenceOrBuilder> + getSequenceFieldBuilder() { + if (sequenceBuilder_ == null) { + sequenceBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.showcase.v1beta1.Sequence, + com.google.showcase.v1beta1.Sequence.Builder, + com.google.showcase.v1beta1.SequenceOrBuilder>( + getSequence(), getParentForChildren(), isClean()); + sequence_ = null; + } + return sequenceBuilder_; + } + + @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.showcase.v1beta1.CreateSequenceRequest) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.CreateSequenceRequest) + private static final com.google.showcase.v1beta1.CreateSequenceRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.CreateSequenceRequest(); + } + + public static com.google.showcase.v1beta1.CreateSequenceRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CreateSequenceRequest 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.showcase.v1beta1.CreateSequenceRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/CreateSequenceRequestOrBuilder.java b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/CreateSequenceRequestOrBuilder.java new file mode 100644 index 0000000000..5882aee416 --- /dev/null +++ b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/CreateSequenceRequestOrBuilder.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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/sequence.proto + +// Protobuf Java Version: 3.25.8 +package com.google.showcase.v1beta1; + +public interface CreateSequenceRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.CreateSequenceRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * .google.showcase.v1beta1.Sequence sequence = 1; + * + * @return Whether the sequence field is set. + */ + boolean hasSequence(); + + /** + * .google.showcase.v1beta1.Sequence sequence = 1; + * + * @return The sequence. + */ + com.google.showcase.v1beta1.Sequence getSequence(); + + /** .google.showcase.v1beta1.Sequence sequence = 1; */ + com.google.showcase.v1beta1.SequenceOrBuilder getSequenceOrBuilder(); +} diff --git a/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/CreateSessionRequest.java b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/CreateSessionRequest.java new file mode 100644 index 0000000000..1b7b0e7706 --- /dev/null +++ b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/CreateSessionRequest.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: schema/google/showcase/v1beta1/testing.proto + +// Protobuf Java Version: 3.25.8 +package com.google.showcase.v1beta1; + +/** + * + * + *
        + * The request for the CreateSession method.
        + * 
        + * + * Protobuf type {@code google.showcase.v1beta1.CreateSessionRequest} + */ +public final class CreateSessionRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.CreateSessionRequest) + CreateSessionRequestOrBuilder { + private static final long serialVersionUID = 0L; + + // Use CreateSessionRequest.newBuilder() to construct. + private CreateSessionRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private CreateSessionRequest() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new CreateSessionRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.TestingOuterClass + .internal_static_google_showcase_v1beta1_CreateSessionRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.TestingOuterClass + .internal_static_google_showcase_v1beta1_CreateSessionRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.CreateSessionRequest.class, + com.google.showcase.v1beta1.CreateSessionRequest.Builder.class); + } + + private int bitField0_; + public static final int SESSION_FIELD_NUMBER = 1; + private com.google.showcase.v1beta1.Session session_; + + /** + * + * + *
        +   * The session to be created.
        +   * Sessions are immutable once they are created (although they can
        +   * be deleted).
        +   * 
        + * + * .google.showcase.v1beta1.Session session = 1; + * + * @return Whether the session field is set. + */ + @java.lang.Override + public boolean hasSession() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
        +   * The session to be created.
        +   * Sessions are immutable once they are created (although they can
        +   * be deleted).
        +   * 
        + * + * .google.showcase.v1beta1.Session session = 1; + * + * @return The session. + */ + @java.lang.Override + public com.google.showcase.v1beta1.Session getSession() { + return session_ == null ? com.google.showcase.v1beta1.Session.getDefaultInstance() : session_; + } + + /** + * + * + *
        +   * The session to be created.
        +   * Sessions are immutable once they are created (although they can
        +   * be deleted).
        +   * 
        + * + * .google.showcase.v1beta1.Session session = 1; + */ + @java.lang.Override + public com.google.showcase.v1beta1.SessionOrBuilder getSessionOrBuilder() { + return session_ == null ? com.google.showcase.v1beta1.Session.getDefaultInstance() : session_; + } + + 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, getSession()); + } + 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, getSession()); + } + 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.showcase.v1beta1.CreateSessionRequest)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.CreateSessionRequest other = + (com.google.showcase.v1beta1.CreateSessionRequest) obj; + + if (hasSession() != other.hasSession()) return false; + if (hasSession()) { + if (!getSession().equals(other.getSession())) 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 (hasSession()) { + hash = (37 * hash) + SESSION_FIELD_NUMBER; + hash = (53 * hash) + getSession().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.showcase.v1beta1.CreateSessionRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.CreateSessionRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.CreateSessionRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.CreateSessionRequest 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.showcase.v1beta1.CreateSessionRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.CreateSessionRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.CreateSessionRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.CreateSessionRequest 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.showcase.v1beta1.CreateSessionRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.CreateSessionRequest 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.showcase.v1beta1.CreateSessionRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.CreateSessionRequest 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.showcase.v1beta1.CreateSessionRequest 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 request for the CreateSession method.
        +   * 
        + * + * Protobuf type {@code google.showcase.v1beta1.CreateSessionRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.CreateSessionRequest) + com.google.showcase.v1beta1.CreateSessionRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.TestingOuterClass + .internal_static_google_showcase_v1beta1_CreateSessionRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.TestingOuterClass + .internal_static_google_showcase_v1beta1_CreateSessionRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.CreateSessionRequest.class, + com.google.showcase.v1beta1.CreateSessionRequest.Builder.class); + } + + // Construct using com.google.showcase.v1beta1.CreateSessionRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getSessionFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + session_ = null; + if (sessionBuilder_ != null) { + sessionBuilder_.dispose(); + sessionBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.showcase.v1beta1.TestingOuterClass + .internal_static_google_showcase_v1beta1_CreateSessionRequest_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.CreateSessionRequest getDefaultInstanceForType() { + return com.google.showcase.v1beta1.CreateSessionRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.CreateSessionRequest build() { + com.google.showcase.v1beta1.CreateSessionRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.CreateSessionRequest buildPartial() { + com.google.showcase.v1beta1.CreateSessionRequest result = + new com.google.showcase.v1beta1.CreateSessionRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.showcase.v1beta1.CreateSessionRequest result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.session_ = sessionBuilder_ == null ? session_ : sessionBuilder_.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.showcase.v1beta1.CreateSessionRequest) { + return mergeFrom((com.google.showcase.v1beta1.CreateSessionRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.showcase.v1beta1.CreateSessionRequest other) { + if (other == com.google.showcase.v1beta1.CreateSessionRequest.getDefaultInstance()) + return this; + if (other.hasSession()) { + mergeSession(other.getSession()); + } + 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(getSessionFieldBuilder().getBuilder(), extensionRegistry); + 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 com.google.showcase.v1beta1.Session session_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.showcase.v1beta1.Session, + com.google.showcase.v1beta1.Session.Builder, + com.google.showcase.v1beta1.SessionOrBuilder> + sessionBuilder_; + + /** + * + * + *
        +     * The session to be created.
        +     * Sessions are immutable once they are created (although they can
        +     * be deleted).
        +     * 
        + * + * .google.showcase.v1beta1.Session session = 1; + * + * @return Whether the session field is set. + */ + public boolean hasSession() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
        +     * The session to be created.
        +     * Sessions are immutable once they are created (although they can
        +     * be deleted).
        +     * 
        + * + * .google.showcase.v1beta1.Session session = 1; + * + * @return The session. + */ + public com.google.showcase.v1beta1.Session getSession() { + if (sessionBuilder_ == null) { + return session_ == null + ? com.google.showcase.v1beta1.Session.getDefaultInstance() + : session_; + } else { + return sessionBuilder_.getMessage(); + } + } + + /** + * + * + *
        +     * The session to be created.
        +     * Sessions are immutable once they are created (although they can
        +     * be deleted).
        +     * 
        + * + * .google.showcase.v1beta1.Session session = 1; + */ + public Builder setSession(com.google.showcase.v1beta1.Session value) { + if (sessionBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + session_ = value; + } else { + sessionBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
        +     * The session to be created.
        +     * Sessions are immutable once they are created (although they can
        +     * be deleted).
        +     * 
        + * + * .google.showcase.v1beta1.Session session = 1; + */ + public Builder setSession(com.google.showcase.v1beta1.Session.Builder builderForValue) { + if (sessionBuilder_ == null) { + session_ = builderForValue.build(); + } else { + sessionBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
        +     * The session to be created.
        +     * Sessions are immutable once they are created (although they can
        +     * be deleted).
        +     * 
        + * + * .google.showcase.v1beta1.Session session = 1; + */ + public Builder mergeSession(com.google.showcase.v1beta1.Session value) { + if (sessionBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) + && session_ != null + && session_ != com.google.showcase.v1beta1.Session.getDefaultInstance()) { + getSessionBuilder().mergeFrom(value); + } else { + session_ = value; + } + } else { + sessionBuilder_.mergeFrom(value); + } + if (session_ != null) { + bitField0_ |= 0x00000001; + onChanged(); + } + return this; + } + + /** + * + * + *
        +     * The session to be created.
        +     * Sessions are immutable once they are created (although they can
        +     * be deleted).
        +     * 
        + * + * .google.showcase.v1beta1.Session session = 1; + */ + public Builder clearSession() { + bitField0_ = (bitField0_ & ~0x00000001); + session_ = null; + if (sessionBuilder_ != null) { + sessionBuilder_.dispose(); + sessionBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
        +     * The session to be created.
        +     * Sessions are immutable once they are created (although they can
        +     * be deleted).
        +     * 
        + * + * .google.showcase.v1beta1.Session session = 1; + */ + public com.google.showcase.v1beta1.Session.Builder getSessionBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return getSessionFieldBuilder().getBuilder(); + } + + /** + * + * + *
        +     * The session to be created.
        +     * Sessions are immutable once they are created (although they can
        +     * be deleted).
        +     * 
        + * + * .google.showcase.v1beta1.Session session = 1; + */ + public com.google.showcase.v1beta1.SessionOrBuilder getSessionOrBuilder() { + if (sessionBuilder_ != null) { + return sessionBuilder_.getMessageOrBuilder(); + } else { + return session_ == null + ? com.google.showcase.v1beta1.Session.getDefaultInstance() + : session_; + } + } + + /** + * + * + *
        +     * The session to be created.
        +     * Sessions are immutable once they are created (although they can
        +     * be deleted).
        +     * 
        + * + * .google.showcase.v1beta1.Session session = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.showcase.v1beta1.Session, + com.google.showcase.v1beta1.Session.Builder, + com.google.showcase.v1beta1.SessionOrBuilder> + getSessionFieldBuilder() { + if (sessionBuilder_ == null) { + sessionBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.showcase.v1beta1.Session, + com.google.showcase.v1beta1.Session.Builder, + com.google.showcase.v1beta1.SessionOrBuilder>( + getSession(), getParentForChildren(), isClean()); + session_ = null; + } + return sessionBuilder_; + } + + @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.showcase.v1beta1.CreateSessionRequest) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.CreateSessionRequest) + private static final com.google.showcase.v1beta1.CreateSessionRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.CreateSessionRequest(); + } + + public static com.google.showcase.v1beta1.CreateSessionRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CreateSessionRequest 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.showcase.v1beta1.CreateSessionRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/CreateSessionRequestOrBuilder.java b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/CreateSessionRequestOrBuilder.java new file mode 100644 index 0000000000..355167d8d4 --- /dev/null +++ b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/CreateSessionRequestOrBuilder.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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/testing.proto + +// Protobuf Java Version: 3.25.8 +package com.google.showcase.v1beta1; + +public interface CreateSessionRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.CreateSessionRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
        +   * The session to be created.
        +   * Sessions are immutable once they are created (although they can
        +   * be deleted).
        +   * 
        + * + * .google.showcase.v1beta1.Session session = 1; + * + * @return Whether the session field is set. + */ + boolean hasSession(); + + /** + * + * + *
        +   * The session to be created.
        +   * Sessions are immutable once they are created (although they can
        +   * be deleted).
        +   * 
        + * + * .google.showcase.v1beta1.Session session = 1; + * + * @return The session. + */ + com.google.showcase.v1beta1.Session getSession(); + + /** + * + * + *
        +   * The session to be created.
        +   * Sessions are immutable once they are created (although they can
        +   * be deleted).
        +   * 
        + * + * .google.showcase.v1beta1.Session session = 1; + */ + com.google.showcase.v1beta1.SessionOrBuilder getSessionOrBuilder(); +} diff --git a/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/CreateStreamingSequenceRequest.java b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/CreateStreamingSequenceRequest.java new file mode 100644 index 0000000000..2b0b57efea --- /dev/null +++ b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/CreateStreamingSequenceRequest.java @@ -0,0 +1,639 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/sequence.proto + +// Protobuf Java Version: 3.25.8 +package com.google.showcase.v1beta1; + +/** Protobuf type {@code google.showcase.v1beta1.CreateStreamingSequenceRequest} */ +public final class CreateStreamingSequenceRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.CreateStreamingSequenceRequest) + CreateStreamingSequenceRequestOrBuilder { + private static final long serialVersionUID = 0L; + + // Use CreateStreamingSequenceRequest.newBuilder() to construct. + private CreateStreamingSequenceRequest( + com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private CreateStreamingSequenceRequest() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new CreateStreamingSequenceRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.SequenceOuterClass + .internal_static_google_showcase_v1beta1_CreateStreamingSequenceRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.SequenceOuterClass + .internal_static_google_showcase_v1beta1_CreateStreamingSequenceRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.CreateStreamingSequenceRequest.class, + com.google.showcase.v1beta1.CreateStreamingSequenceRequest.Builder.class); + } + + private int bitField0_; + public static final int STREAMING_SEQUENCE_FIELD_NUMBER = 1; + private com.google.showcase.v1beta1.StreamingSequence streamingSequence_; + + /** + * .google.showcase.v1beta1.StreamingSequence streaming_sequence = 1; + * + * @return Whether the streamingSequence field is set. + */ + @java.lang.Override + public boolean hasStreamingSequence() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * .google.showcase.v1beta1.StreamingSequence streaming_sequence = 1; + * + * @return The streamingSequence. + */ + @java.lang.Override + public com.google.showcase.v1beta1.StreamingSequence getStreamingSequence() { + return streamingSequence_ == null + ? com.google.showcase.v1beta1.StreamingSequence.getDefaultInstance() + : streamingSequence_; + } + + /** .google.showcase.v1beta1.StreamingSequence streaming_sequence = 1; */ + @java.lang.Override + public com.google.showcase.v1beta1.StreamingSequenceOrBuilder getStreamingSequenceOrBuilder() { + return streamingSequence_ == null + ? com.google.showcase.v1beta1.StreamingSequence.getDefaultInstance() + : streamingSequence_; + } + + 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, getStreamingSequence()); + } + 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, getStreamingSequence()); + } + 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.showcase.v1beta1.CreateStreamingSequenceRequest)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.CreateStreamingSequenceRequest other = + (com.google.showcase.v1beta1.CreateStreamingSequenceRequest) obj; + + if (hasStreamingSequence() != other.hasStreamingSequence()) return false; + if (hasStreamingSequence()) { + if (!getStreamingSequence().equals(other.getStreamingSequence())) 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 (hasStreamingSequence()) { + hash = (37 * hash) + STREAMING_SEQUENCE_FIELD_NUMBER; + hash = (53 * hash) + getStreamingSequence().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.showcase.v1beta1.CreateStreamingSequenceRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.CreateStreamingSequenceRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.CreateStreamingSequenceRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.CreateStreamingSequenceRequest 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.showcase.v1beta1.CreateStreamingSequenceRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.CreateStreamingSequenceRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.CreateStreamingSequenceRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.CreateStreamingSequenceRequest 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.showcase.v1beta1.CreateStreamingSequenceRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.CreateStreamingSequenceRequest 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.showcase.v1beta1.CreateStreamingSequenceRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.CreateStreamingSequenceRequest 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.showcase.v1beta1.CreateStreamingSequenceRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** Protobuf type {@code google.showcase.v1beta1.CreateStreamingSequenceRequest} */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.CreateStreamingSequenceRequest) + com.google.showcase.v1beta1.CreateStreamingSequenceRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.SequenceOuterClass + .internal_static_google_showcase_v1beta1_CreateStreamingSequenceRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.SequenceOuterClass + .internal_static_google_showcase_v1beta1_CreateStreamingSequenceRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.CreateStreamingSequenceRequest.class, + com.google.showcase.v1beta1.CreateStreamingSequenceRequest.Builder.class); + } + + // Construct using com.google.showcase.v1beta1.CreateStreamingSequenceRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getStreamingSequenceFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + streamingSequence_ = null; + if (streamingSequenceBuilder_ != null) { + streamingSequenceBuilder_.dispose(); + streamingSequenceBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.showcase.v1beta1.SequenceOuterClass + .internal_static_google_showcase_v1beta1_CreateStreamingSequenceRequest_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.CreateStreamingSequenceRequest getDefaultInstanceForType() { + return com.google.showcase.v1beta1.CreateStreamingSequenceRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.CreateStreamingSequenceRequest build() { + com.google.showcase.v1beta1.CreateStreamingSequenceRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.CreateStreamingSequenceRequest buildPartial() { + com.google.showcase.v1beta1.CreateStreamingSequenceRequest result = + new com.google.showcase.v1beta1.CreateStreamingSequenceRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.showcase.v1beta1.CreateStreamingSequenceRequest result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.streamingSequence_ = + streamingSequenceBuilder_ == null + ? streamingSequence_ + : streamingSequenceBuilder_.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.showcase.v1beta1.CreateStreamingSequenceRequest) { + return mergeFrom((com.google.showcase.v1beta1.CreateStreamingSequenceRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.showcase.v1beta1.CreateStreamingSequenceRequest other) { + if (other == com.google.showcase.v1beta1.CreateStreamingSequenceRequest.getDefaultInstance()) + return this; + if (other.hasStreamingSequence()) { + mergeStreamingSequence(other.getStreamingSequence()); + } + 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( + getStreamingSequenceFieldBuilder().getBuilder(), extensionRegistry); + 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 com.google.showcase.v1beta1.StreamingSequence streamingSequence_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.showcase.v1beta1.StreamingSequence, + com.google.showcase.v1beta1.StreamingSequence.Builder, + com.google.showcase.v1beta1.StreamingSequenceOrBuilder> + streamingSequenceBuilder_; + + /** + * .google.showcase.v1beta1.StreamingSequence streaming_sequence = 1; + * + * @return Whether the streamingSequence field is set. + */ + public boolean hasStreamingSequence() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * .google.showcase.v1beta1.StreamingSequence streaming_sequence = 1; + * + * @return The streamingSequence. + */ + public com.google.showcase.v1beta1.StreamingSequence getStreamingSequence() { + if (streamingSequenceBuilder_ == null) { + return streamingSequence_ == null + ? com.google.showcase.v1beta1.StreamingSequence.getDefaultInstance() + : streamingSequence_; + } else { + return streamingSequenceBuilder_.getMessage(); + } + } + + /** .google.showcase.v1beta1.StreamingSequence streaming_sequence = 1; */ + public Builder setStreamingSequence(com.google.showcase.v1beta1.StreamingSequence value) { + if (streamingSequenceBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + streamingSequence_ = value; + } else { + streamingSequenceBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** .google.showcase.v1beta1.StreamingSequence streaming_sequence = 1; */ + public Builder setStreamingSequence( + com.google.showcase.v1beta1.StreamingSequence.Builder builderForValue) { + if (streamingSequenceBuilder_ == null) { + streamingSequence_ = builderForValue.build(); + } else { + streamingSequenceBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** .google.showcase.v1beta1.StreamingSequence streaming_sequence = 1; */ + public Builder mergeStreamingSequence(com.google.showcase.v1beta1.StreamingSequence value) { + if (streamingSequenceBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) + && streamingSequence_ != null + && streamingSequence_ + != com.google.showcase.v1beta1.StreamingSequence.getDefaultInstance()) { + getStreamingSequenceBuilder().mergeFrom(value); + } else { + streamingSequence_ = value; + } + } else { + streamingSequenceBuilder_.mergeFrom(value); + } + if (streamingSequence_ != null) { + bitField0_ |= 0x00000001; + onChanged(); + } + return this; + } + + /** .google.showcase.v1beta1.StreamingSequence streaming_sequence = 1; */ + public Builder clearStreamingSequence() { + bitField0_ = (bitField0_ & ~0x00000001); + streamingSequence_ = null; + if (streamingSequenceBuilder_ != null) { + streamingSequenceBuilder_.dispose(); + streamingSequenceBuilder_ = null; + } + onChanged(); + return this; + } + + /** .google.showcase.v1beta1.StreamingSequence streaming_sequence = 1; */ + public com.google.showcase.v1beta1.StreamingSequence.Builder getStreamingSequenceBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return getStreamingSequenceFieldBuilder().getBuilder(); + } + + /** .google.showcase.v1beta1.StreamingSequence streaming_sequence = 1; */ + public com.google.showcase.v1beta1.StreamingSequenceOrBuilder getStreamingSequenceOrBuilder() { + if (streamingSequenceBuilder_ != null) { + return streamingSequenceBuilder_.getMessageOrBuilder(); + } else { + return streamingSequence_ == null + ? com.google.showcase.v1beta1.StreamingSequence.getDefaultInstance() + : streamingSequence_; + } + } + + /** .google.showcase.v1beta1.StreamingSequence streaming_sequence = 1; */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.showcase.v1beta1.StreamingSequence, + com.google.showcase.v1beta1.StreamingSequence.Builder, + com.google.showcase.v1beta1.StreamingSequenceOrBuilder> + getStreamingSequenceFieldBuilder() { + if (streamingSequenceBuilder_ == null) { + streamingSequenceBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.showcase.v1beta1.StreamingSequence, + com.google.showcase.v1beta1.StreamingSequence.Builder, + com.google.showcase.v1beta1.StreamingSequenceOrBuilder>( + getStreamingSequence(), getParentForChildren(), isClean()); + streamingSequence_ = null; + } + return streamingSequenceBuilder_; + } + + @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.showcase.v1beta1.CreateStreamingSequenceRequest) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.CreateStreamingSequenceRequest) + private static final com.google.showcase.v1beta1.CreateStreamingSequenceRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.CreateStreamingSequenceRequest(); + } + + public static com.google.showcase.v1beta1.CreateStreamingSequenceRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CreateStreamingSequenceRequest 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.showcase.v1beta1.CreateStreamingSequenceRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/CreateStreamingSequenceRequestOrBuilder.java b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/CreateStreamingSequenceRequestOrBuilder.java new file mode 100644 index 0000000000..d14de74f4b --- /dev/null +++ b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/CreateStreamingSequenceRequestOrBuilder.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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/sequence.proto + +// Protobuf Java Version: 3.25.8 +package com.google.showcase.v1beta1; + +public interface CreateStreamingSequenceRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.CreateStreamingSequenceRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * .google.showcase.v1beta1.StreamingSequence streaming_sequence = 1; + * + * @return Whether the streamingSequence field is set. + */ + boolean hasStreamingSequence(); + + /** + * .google.showcase.v1beta1.StreamingSequence streaming_sequence = 1; + * + * @return The streamingSequence. + */ + com.google.showcase.v1beta1.StreamingSequence getStreamingSequence(); + + /** .google.showcase.v1beta1.StreamingSequence streaming_sequence = 1; */ + com.google.showcase.v1beta1.StreamingSequenceOrBuilder getStreamingSequenceOrBuilder(); +} diff --git a/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/CreateUserRequest.java b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/CreateUserRequest.java new file mode 100644 index 0000000000..34477e14d0 --- /dev/null +++ b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/CreateUserRequest.java @@ -0,0 +1,728 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/identity.proto + +// Protobuf Java Version: 3.25.8 +package com.google.showcase.v1beta1; + +/** + * + * + *
        + * The request message for the google.showcase.v1beta1.Identity\CreateUser
        + * method.
        + * 
        + * + * Protobuf type {@code google.showcase.v1beta1.CreateUserRequest} + */ +public final class CreateUserRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.CreateUserRequest) + CreateUserRequestOrBuilder { + private static final long serialVersionUID = 0L; + + // Use CreateUserRequest.newBuilder() to construct. + private CreateUserRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private CreateUserRequest() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new CreateUserRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.IdentityOuterClass + .internal_static_google_showcase_v1beta1_CreateUserRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.IdentityOuterClass + .internal_static_google_showcase_v1beta1_CreateUserRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.CreateUserRequest.class, + com.google.showcase.v1beta1.CreateUserRequest.Builder.class); + } + + private int bitField0_; + public static final int USER_FIELD_NUMBER = 1; + private com.google.showcase.v1beta1.User user_; + + /** + * + * + *
        +   * The user to create.
        +   * 
        + * + * .google.showcase.v1beta1.User user = 1; + * + * @return Whether the user field is set. + */ + @java.lang.Override + public boolean hasUser() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
        +   * The user to create.
        +   * 
        + * + * .google.showcase.v1beta1.User user = 1; + * + * @return The user. + */ + @java.lang.Override + public com.google.showcase.v1beta1.User getUser() { + return user_ == null ? com.google.showcase.v1beta1.User.getDefaultInstance() : user_; + } + + /** + * + * + *
        +   * The user to create.
        +   * 
        + * + * .google.showcase.v1beta1.User user = 1; + */ + @java.lang.Override + public com.google.showcase.v1beta1.UserOrBuilder getUserOrBuilder() { + return user_ == null ? com.google.showcase.v1beta1.User.getDefaultInstance() : user_; + } + + 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, getUser()); + } + 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, getUser()); + } + 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.showcase.v1beta1.CreateUserRequest)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.CreateUserRequest other = + (com.google.showcase.v1beta1.CreateUserRequest) obj; + + if (hasUser() != other.hasUser()) return false; + if (hasUser()) { + if (!getUser().equals(other.getUser())) 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 (hasUser()) { + hash = (37 * hash) + USER_FIELD_NUMBER; + hash = (53 * hash) + getUser().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.showcase.v1beta1.CreateUserRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.CreateUserRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.CreateUserRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.CreateUserRequest 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.showcase.v1beta1.CreateUserRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.CreateUserRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.CreateUserRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.CreateUserRequest 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.showcase.v1beta1.CreateUserRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.CreateUserRequest 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.showcase.v1beta1.CreateUserRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.CreateUserRequest 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.showcase.v1beta1.CreateUserRequest 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 request message for the google.showcase.v1beta1.Identity\CreateUser
        +   * method.
        +   * 
        + * + * Protobuf type {@code google.showcase.v1beta1.CreateUserRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.CreateUserRequest) + com.google.showcase.v1beta1.CreateUserRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.IdentityOuterClass + .internal_static_google_showcase_v1beta1_CreateUserRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.IdentityOuterClass + .internal_static_google_showcase_v1beta1_CreateUserRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.CreateUserRequest.class, + com.google.showcase.v1beta1.CreateUserRequest.Builder.class); + } + + // Construct using com.google.showcase.v1beta1.CreateUserRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getUserFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + user_ = null; + if (userBuilder_ != null) { + userBuilder_.dispose(); + userBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.showcase.v1beta1.IdentityOuterClass + .internal_static_google_showcase_v1beta1_CreateUserRequest_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.CreateUserRequest getDefaultInstanceForType() { + return com.google.showcase.v1beta1.CreateUserRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.CreateUserRequest build() { + com.google.showcase.v1beta1.CreateUserRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.CreateUserRequest buildPartial() { + com.google.showcase.v1beta1.CreateUserRequest result = + new com.google.showcase.v1beta1.CreateUserRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.showcase.v1beta1.CreateUserRequest result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.user_ = userBuilder_ == null ? user_ : userBuilder_.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.showcase.v1beta1.CreateUserRequest) { + return mergeFrom((com.google.showcase.v1beta1.CreateUserRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.showcase.v1beta1.CreateUserRequest other) { + if (other == com.google.showcase.v1beta1.CreateUserRequest.getDefaultInstance()) return this; + if (other.hasUser()) { + mergeUser(other.getUser()); + } + 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(getUserFieldBuilder().getBuilder(), extensionRegistry); + 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 com.google.showcase.v1beta1.User user_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.showcase.v1beta1.User, + com.google.showcase.v1beta1.User.Builder, + com.google.showcase.v1beta1.UserOrBuilder> + userBuilder_; + + /** + * + * + *
        +     * The user to create.
        +     * 
        + * + * .google.showcase.v1beta1.User user = 1; + * + * @return Whether the user field is set. + */ + public boolean hasUser() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
        +     * The user to create.
        +     * 
        + * + * .google.showcase.v1beta1.User user = 1; + * + * @return The user. + */ + public com.google.showcase.v1beta1.User getUser() { + if (userBuilder_ == null) { + return user_ == null ? com.google.showcase.v1beta1.User.getDefaultInstance() : user_; + } else { + return userBuilder_.getMessage(); + } + } + + /** + * + * + *
        +     * The user to create.
        +     * 
        + * + * .google.showcase.v1beta1.User user = 1; + */ + public Builder setUser(com.google.showcase.v1beta1.User value) { + if (userBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + user_ = value; + } else { + userBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
        +     * The user to create.
        +     * 
        + * + * .google.showcase.v1beta1.User user = 1; + */ + public Builder setUser(com.google.showcase.v1beta1.User.Builder builderForValue) { + if (userBuilder_ == null) { + user_ = builderForValue.build(); + } else { + userBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
        +     * The user to create.
        +     * 
        + * + * .google.showcase.v1beta1.User user = 1; + */ + public Builder mergeUser(com.google.showcase.v1beta1.User value) { + if (userBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) + && user_ != null + && user_ != com.google.showcase.v1beta1.User.getDefaultInstance()) { + getUserBuilder().mergeFrom(value); + } else { + user_ = value; + } + } else { + userBuilder_.mergeFrom(value); + } + if (user_ != null) { + bitField0_ |= 0x00000001; + onChanged(); + } + return this; + } + + /** + * + * + *
        +     * The user to create.
        +     * 
        + * + * .google.showcase.v1beta1.User user = 1; + */ + public Builder clearUser() { + bitField0_ = (bitField0_ & ~0x00000001); + user_ = null; + if (userBuilder_ != null) { + userBuilder_.dispose(); + userBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
        +     * The user to create.
        +     * 
        + * + * .google.showcase.v1beta1.User user = 1; + */ + public com.google.showcase.v1beta1.User.Builder getUserBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return getUserFieldBuilder().getBuilder(); + } + + /** + * + * + *
        +     * The user to create.
        +     * 
        + * + * .google.showcase.v1beta1.User user = 1; + */ + public com.google.showcase.v1beta1.UserOrBuilder getUserOrBuilder() { + if (userBuilder_ != null) { + return userBuilder_.getMessageOrBuilder(); + } else { + return user_ == null ? com.google.showcase.v1beta1.User.getDefaultInstance() : user_; + } + } + + /** + * + * + *
        +     * The user to create.
        +     * 
        + * + * .google.showcase.v1beta1.User user = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.showcase.v1beta1.User, + com.google.showcase.v1beta1.User.Builder, + com.google.showcase.v1beta1.UserOrBuilder> + getUserFieldBuilder() { + if (userBuilder_ == null) { + userBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.showcase.v1beta1.User, + com.google.showcase.v1beta1.User.Builder, + com.google.showcase.v1beta1.UserOrBuilder>( + getUser(), getParentForChildren(), isClean()); + user_ = null; + } + return userBuilder_; + } + + @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.showcase.v1beta1.CreateUserRequest) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.CreateUserRequest) + private static final com.google.showcase.v1beta1.CreateUserRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.CreateUserRequest(); + } + + public static com.google.showcase.v1beta1.CreateUserRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CreateUserRequest 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.showcase.v1beta1.CreateUserRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/CreateUserRequestOrBuilder.java b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/CreateUserRequestOrBuilder.java new file mode 100644 index 0000000000..25204de6d6 --- /dev/null +++ b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/CreateUserRequestOrBuilder.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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/identity.proto + +// Protobuf Java Version: 3.25.8 +package com.google.showcase.v1beta1; + +public interface CreateUserRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.CreateUserRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
        +   * The user to create.
        +   * 
        + * + * .google.showcase.v1beta1.User user = 1; + * + * @return Whether the user field is set. + */ + boolean hasUser(); + + /** + * + * + *
        +   * The user to create.
        +   * 
        + * + * .google.showcase.v1beta1.User user = 1; + * + * @return The user. + */ + com.google.showcase.v1beta1.User getUser(); + + /** + * + * + *
        +   * The user to create.
        +   * 
        + * + * .google.showcase.v1beta1.User user = 1; + */ + com.google.showcase.v1beta1.UserOrBuilder getUserOrBuilder(); +} diff --git a/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/DeleteBlurbRequest.java b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/DeleteBlurbRequest.java new file mode 100644 index 0000000000..ac57bd215d --- /dev/null +++ b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/DeleteBlurbRequest.java @@ -0,0 +1,649 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/messaging.proto + +// Protobuf Java Version: 3.25.8 +package com.google.showcase.v1beta1; + +/** + * + * + *
        + * The request message for the google.showcase.v1beta1.Messaging\DeleteBlurb
        + * method.
        + * 
        + * + * Protobuf type {@code google.showcase.v1beta1.DeleteBlurbRequest} + */ +public final class DeleteBlurbRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.DeleteBlurbRequest) + DeleteBlurbRequestOrBuilder { + private static final long serialVersionUID = 0L; + + // Use DeleteBlurbRequest.newBuilder() to construct. + private DeleteBlurbRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private DeleteBlurbRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new DeleteBlurbRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.MessagingOuterClass + .internal_static_google_showcase_v1beta1_DeleteBlurbRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.MessagingOuterClass + .internal_static_google_showcase_v1beta1_DeleteBlurbRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.DeleteBlurbRequest.class, + com.google.showcase.v1beta1.DeleteBlurbRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + + /** + * + * + *
        +   * The resource name of the requested blurb.
        +   * 
        + * + * + * 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; + } + } + + /** + * + * + *
        +   * The resource name of the requested blurb.
        +   * 
        + * + * + * 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.showcase.v1beta1.DeleteBlurbRequest)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.DeleteBlurbRequest other = + (com.google.showcase.v1beta1.DeleteBlurbRequest) 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.showcase.v1beta1.DeleteBlurbRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.DeleteBlurbRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.DeleteBlurbRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.DeleteBlurbRequest 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.showcase.v1beta1.DeleteBlurbRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.DeleteBlurbRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.DeleteBlurbRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.DeleteBlurbRequest 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.showcase.v1beta1.DeleteBlurbRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.DeleteBlurbRequest 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.showcase.v1beta1.DeleteBlurbRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.DeleteBlurbRequest 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.showcase.v1beta1.DeleteBlurbRequest 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 request message for the google.showcase.v1beta1.Messaging\DeleteBlurb
        +   * method.
        +   * 
        + * + * Protobuf type {@code google.showcase.v1beta1.DeleteBlurbRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.DeleteBlurbRequest) + com.google.showcase.v1beta1.DeleteBlurbRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.MessagingOuterClass + .internal_static_google_showcase_v1beta1_DeleteBlurbRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.MessagingOuterClass + .internal_static_google_showcase_v1beta1_DeleteBlurbRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.DeleteBlurbRequest.class, + com.google.showcase.v1beta1.DeleteBlurbRequest.Builder.class); + } + + // Construct using com.google.showcase.v1beta1.DeleteBlurbRequest.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.showcase.v1beta1.MessagingOuterClass + .internal_static_google_showcase_v1beta1_DeleteBlurbRequest_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.DeleteBlurbRequest getDefaultInstanceForType() { + return com.google.showcase.v1beta1.DeleteBlurbRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.DeleteBlurbRequest build() { + com.google.showcase.v1beta1.DeleteBlurbRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.DeleteBlurbRequest buildPartial() { + com.google.showcase.v1beta1.DeleteBlurbRequest result = + new com.google.showcase.v1beta1.DeleteBlurbRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.showcase.v1beta1.DeleteBlurbRequest 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.showcase.v1beta1.DeleteBlurbRequest) { + return mergeFrom((com.google.showcase.v1beta1.DeleteBlurbRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.showcase.v1beta1.DeleteBlurbRequest other) { + if (other == com.google.showcase.v1beta1.DeleteBlurbRequest.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_ = ""; + + /** + * + * + *
        +     * The resource name of the requested blurb.
        +     * 
        + * + * + * 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; + } + } + + /** + * + * + *
        +     * The resource name of the requested blurb.
        +     * 
        + * + * + * 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; + } + } + + /** + * + * + *
        +     * The resource name of the requested blurb.
        +     * 
        + * + * + * 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; + } + + /** + * + * + *
        +     * The resource name of the requested blurb.
        +     * 
        + * + * + * 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; + } + + /** + * + * + *
        +     * The resource name of the requested blurb.
        +     * 
        + * + * + * 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.showcase.v1beta1.DeleteBlurbRequest) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.DeleteBlurbRequest) + private static final com.google.showcase.v1beta1.DeleteBlurbRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.DeleteBlurbRequest(); + } + + public static com.google.showcase.v1beta1.DeleteBlurbRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DeleteBlurbRequest 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.showcase.v1beta1.DeleteBlurbRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/DeleteBlurbRequestOrBuilder.java b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/DeleteBlurbRequestOrBuilder.java new file mode 100644 index 0000000000..0bb6f36f11 --- /dev/null +++ b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/DeleteBlurbRequestOrBuilder.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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/messaging.proto + +// Protobuf Java Version: 3.25.8 +package com.google.showcase.v1beta1; + +public interface DeleteBlurbRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.DeleteBlurbRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
        +   * The resource name of the requested blurb.
        +   * 
        + * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + + /** + * + * + *
        +   * The resource name of the requested blurb.
        +   * 
        + * + * + * 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-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/DeleteRoomRequest.java b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/DeleteRoomRequest.java new file mode 100644 index 0000000000..dfb51e4823 --- /dev/null +++ b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/DeleteRoomRequest.java @@ -0,0 +1,649 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/messaging.proto + +// Protobuf Java Version: 3.25.8 +package com.google.showcase.v1beta1; + +/** + * + * + *
        + * The request message for the google.showcase.v1beta1.Messaging\DeleteRoom
        + * method.
        + * 
        + * + * Protobuf type {@code google.showcase.v1beta1.DeleteRoomRequest} + */ +public final class DeleteRoomRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.DeleteRoomRequest) + DeleteRoomRequestOrBuilder { + private static final long serialVersionUID = 0L; + + // Use DeleteRoomRequest.newBuilder() to construct. + private DeleteRoomRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private DeleteRoomRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new DeleteRoomRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.MessagingOuterClass + .internal_static_google_showcase_v1beta1_DeleteRoomRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.MessagingOuterClass + .internal_static_google_showcase_v1beta1_DeleteRoomRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.DeleteRoomRequest.class, + com.google.showcase.v1beta1.DeleteRoomRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + + /** + * + * + *
        +   * The resource name of the requested room.
        +   * 
        + * + * + * 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; + } + } + + /** + * + * + *
        +   * The resource name of the requested room.
        +   * 
        + * + * + * 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.showcase.v1beta1.DeleteRoomRequest)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.DeleteRoomRequest other = + (com.google.showcase.v1beta1.DeleteRoomRequest) 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.showcase.v1beta1.DeleteRoomRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.DeleteRoomRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.DeleteRoomRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.DeleteRoomRequest 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.showcase.v1beta1.DeleteRoomRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.DeleteRoomRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.DeleteRoomRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.DeleteRoomRequest 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.showcase.v1beta1.DeleteRoomRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.DeleteRoomRequest 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.showcase.v1beta1.DeleteRoomRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.DeleteRoomRequest 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.showcase.v1beta1.DeleteRoomRequest 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 request message for the google.showcase.v1beta1.Messaging\DeleteRoom
        +   * method.
        +   * 
        + * + * Protobuf type {@code google.showcase.v1beta1.DeleteRoomRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.DeleteRoomRequest) + com.google.showcase.v1beta1.DeleteRoomRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.MessagingOuterClass + .internal_static_google_showcase_v1beta1_DeleteRoomRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.MessagingOuterClass + .internal_static_google_showcase_v1beta1_DeleteRoomRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.DeleteRoomRequest.class, + com.google.showcase.v1beta1.DeleteRoomRequest.Builder.class); + } + + // Construct using com.google.showcase.v1beta1.DeleteRoomRequest.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.showcase.v1beta1.MessagingOuterClass + .internal_static_google_showcase_v1beta1_DeleteRoomRequest_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.DeleteRoomRequest getDefaultInstanceForType() { + return com.google.showcase.v1beta1.DeleteRoomRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.DeleteRoomRequest build() { + com.google.showcase.v1beta1.DeleteRoomRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.DeleteRoomRequest buildPartial() { + com.google.showcase.v1beta1.DeleteRoomRequest result = + new com.google.showcase.v1beta1.DeleteRoomRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.showcase.v1beta1.DeleteRoomRequest 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.showcase.v1beta1.DeleteRoomRequest) { + return mergeFrom((com.google.showcase.v1beta1.DeleteRoomRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.showcase.v1beta1.DeleteRoomRequest other) { + if (other == com.google.showcase.v1beta1.DeleteRoomRequest.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_ = ""; + + /** + * + * + *
        +     * The resource name of the requested room.
        +     * 
        + * + * + * 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; + } + } + + /** + * + * + *
        +     * The resource name of the requested room.
        +     * 
        + * + * + * 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; + } + } + + /** + * + * + *
        +     * The resource name of the requested room.
        +     * 
        + * + * + * 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; + } + + /** + * + * + *
        +     * The resource name of the requested room.
        +     * 
        + * + * + * 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; + } + + /** + * + * + *
        +     * The resource name of the requested room.
        +     * 
        + * + * + * 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.showcase.v1beta1.DeleteRoomRequest) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.DeleteRoomRequest) + private static final com.google.showcase.v1beta1.DeleteRoomRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.DeleteRoomRequest(); + } + + public static com.google.showcase.v1beta1.DeleteRoomRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DeleteRoomRequest 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.showcase.v1beta1.DeleteRoomRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/DeleteRoomRequestOrBuilder.java b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/DeleteRoomRequestOrBuilder.java new file mode 100644 index 0000000000..5d7141aee6 --- /dev/null +++ b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/DeleteRoomRequestOrBuilder.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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/messaging.proto + +// Protobuf Java Version: 3.25.8 +package com.google.showcase.v1beta1; + +public interface DeleteRoomRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.DeleteRoomRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
        +   * The resource name of the requested room.
        +   * 
        + * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + + /** + * + * + *
        +   * The resource name of the requested room.
        +   * 
        + * + * + * 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-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/DeleteSessionRequest.java b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/DeleteSessionRequest.java new file mode 100644 index 0000000000..1055ae788c --- /dev/null +++ b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/DeleteSessionRequest.java @@ -0,0 +1,634 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/testing.proto + +// Protobuf Java Version: 3.25.8 +package com.google.showcase.v1beta1; + +/** + * + * + *
        + * Request for the DeleteSession method.
        + * 
        + * + * Protobuf type {@code google.showcase.v1beta1.DeleteSessionRequest} + */ +public final class DeleteSessionRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.DeleteSessionRequest) + DeleteSessionRequestOrBuilder { + private static final long serialVersionUID = 0L; + + // Use DeleteSessionRequest.newBuilder() to construct. + private DeleteSessionRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private DeleteSessionRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new DeleteSessionRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.TestingOuterClass + .internal_static_google_showcase_v1beta1_DeleteSessionRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.TestingOuterClass + .internal_static_google_showcase_v1beta1_DeleteSessionRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.DeleteSessionRequest.class, + com.google.showcase.v1beta1.DeleteSessionRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + + /** + * + * + *
        +   * The session to be deleted.
        +   * 
        + * + * string name = 1 [(.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; + } + } + + /** + * + * + *
        +   * The session to be deleted.
        +   * 
        + * + * string name = 1 [(.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.showcase.v1beta1.DeleteSessionRequest)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.DeleteSessionRequest other = + (com.google.showcase.v1beta1.DeleteSessionRequest) 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.showcase.v1beta1.DeleteSessionRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.DeleteSessionRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.DeleteSessionRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.DeleteSessionRequest 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.showcase.v1beta1.DeleteSessionRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.DeleteSessionRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.DeleteSessionRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.DeleteSessionRequest 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.showcase.v1beta1.DeleteSessionRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.DeleteSessionRequest 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.showcase.v1beta1.DeleteSessionRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.DeleteSessionRequest 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.showcase.v1beta1.DeleteSessionRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
        +   * Request for the DeleteSession method.
        +   * 
        + * + * Protobuf type {@code google.showcase.v1beta1.DeleteSessionRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.DeleteSessionRequest) + com.google.showcase.v1beta1.DeleteSessionRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.TestingOuterClass + .internal_static_google_showcase_v1beta1_DeleteSessionRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.TestingOuterClass + .internal_static_google_showcase_v1beta1_DeleteSessionRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.DeleteSessionRequest.class, + com.google.showcase.v1beta1.DeleteSessionRequest.Builder.class); + } + + // Construct using com.google.showcase.v1beta1.DeleteSessionRequest.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.showcase.v1beta1.TestingOuterClass + .internal_static_google_showcase_v1beta1_DeleteSessionRequest_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.DeleteSessionRequest getDefaultInstanceForType() { + return com.google.showcase.v1beta1.DeleteSessionRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.DeleteSessionRequest build() { + com.google.showcase.v1beta1.DeleteSessionRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.DeleteSessionRequest buildPartial() { + com.google.showcase.v1beta1.DeleteSessionRequest result = + new com.google.showcase.v1beta1.DeleteSessionRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.showcase.v1beta1.DeleteSessionRequest 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.showcase.v1beta1.DeleteSessionRequest) { + return mergeFrom((com.google.showcase.v1beta1.DeleteSessionRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.showcase.v1beta1.DeleteSessionRequest other) { + if (other == com.google.showcase.v1beta1.DeleteSessionRequest.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_ = ""; + + /** + * + * + *
        +     * The session to be deleted.
        +     * 
        + * + * string name = 1 [(.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; + } + } + + /** + * + * + *
        +     * The session to be deleted.
        +     * 
        + * + * string name = 1 [(.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; + } + } + + /** + * + * + *
        +     * The session to be deleted.
        +     * 
        + * + * string name = 1 [(.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; + } + + /** + * + * + *
        +     * The session to be deleted.
        +     * 
        + * + * string name = 1 [(.google.api.resource_reference) = { ... } + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
        +     * The session to be deleted.
        +     * 
        + * + * string name = 1 [(.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.showcase.v1beta1.DeleteSessionRequest) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.DeleteSessionRequest) + private static final com.google.showcase.v1beta1.DeleteSessionRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.DeleteSessionRequest(); + } + + public static com.google.showcase.v1beta1.DeleteSessionRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DeleteSessionRequest 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.showcase.v1beta1.DeleteSessionRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/DeleteSessionRequestOrBuilder.java b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/DeleteSessionRequestOrBuilder.java new file mode 100644 index 0000000000..a23deec0dc --- /dev/null +++ b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/DeleteSessionRequestOrBuilder.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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/testing.proto + +// Protobuf Java Version: 3.25.8 +package com.google.showcase.v1beta1; + +public interface DeleteSessionRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.DeleteSessionRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
        +   * The session to be deleted.
        +   * 
        + * + * string name = 1 [(.google.api.resource_reference) = { ... } + * + * @return The name. + */ + java.lang.String getName(); + + /** + * + * + *
        +   * The session to be deleted.
        +   * 
        + * + * string name = 1 [(.google.api.resource_reference) = { ... } + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); +} diff --git a/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/DeleteTestRequest.java b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/DeleteTestRequest.java new file mode 100644 index 0000000000..e392430a8d --- /dev/null +++ b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/DeleteTestRequest.java @@ -0,0 +1,633 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/testing.proto + +// Protobuf Java Version: 3.25.8 +package com.google.showcase.v1beta1; + +/** + * + * + *
        + * Request message for deleting a test.
        + * 
        + * + * Protobuf type {@code google.showcase.v1beta1.DeleteTestRequest} + */ +public final class DeleteTestRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.DeleteTestRequest) + DeleteTestRequestOrBuilder { + private static final long serialVersionUID = 0L; + + // Use DeleteTestRequest.newBuilder() to construct. + private DeleteTestRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private DeleteTestRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new DeleteTestRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.TestingOuterClass + .internal_static_google_showcase_v1beta1_DeleteTestRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.TestingOuterClass + .internal_static_google_showcase_v1beta1_DeleteTestRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.DeleteTestRequest.class, + com.google.showcase.v1beta1.DeleteTestRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + + /** + * + * + *
        +   * The test to be deleted.
        +   * 
        + * + * string name = 1 [(.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; + } + } + + /** + * + * + *
        +   * The test to be deleted.
        +   * 
        + * + * string name = 1 [(.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.showcase.v1beta1.DeleteTestRequest)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.DeleteTestRequest other = + (com.google.showcase.v1beta1.DeleteTestRequest) 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.showcase.v1beta1.DeleteTestRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.DeleteTestRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.DeleteTestRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.DeleteTestRequest 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.showcase.v1beta1.DeleteTestRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.DeleteTestRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.DeleteTestRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.DeleteTestRequest 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.showcase.v1beta1.DeleteTestRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.DeleteTestRequest 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.showcase.v1beta1.DeleteTestRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.DeleteTestRequest 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.showcase.v1beta1.DeleteTestRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
        +   * Request message for deleting a test.
        +   * 
        + * + * Protobuf type {@code google.showcase.v1beta1.DeleteTestRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.DeleteTestRequest) + com.google.showcase.v1beta1.DeleteTestRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.TestingOuterClass + .internal_static_google_showcase_v1beta1_DeleteTestRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.TestingOuterClass + .internal_static_google_showcase_v1beta1_DeleteTestRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.DeleteTestRequest.class, + com.google.showcase.v1beta1.DeleteTestRequest.Builder.class); + } + + // Construct using com.google.showcase.v1beta1.DeleteTestRequest.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.showcase.v1beta1.TestingOuterClass + .internal_static_google_showcase_v1beta1_DeleteTestRequest_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.DeleteTestRequest getDefaultInstanceForType() { + return com.google.showcase.v1beta1.DeleteTestRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.DeleteTestRequest build() { + com.google.showcase.v1beta1.DeleteTestRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.DeleteTestRequest buildPartial() { + com.google.showcase.v1beta1.DeleteTestRequest result = + new com.google.showcase.v1beta1.DeleteTestRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.showcase.v1beta1.DeleteTestRequest 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.showcase.v1beta1.DeleteTestRequest) { + return mergeFrom((com.google.showcase.v1beta1.DeleteTestRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.showcase.v1beta1.DeleteTestRequest other) { + if (other == com.google.showcase.v1beta1.DeleteTestRequest.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_ = ""; + + /** + * + * + *
        +     * The test to be deleted.
        +     * 
        + * + * string name = 1 [(.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; + } + } + + /** + * + * + *
        +     * The test to be deleted.
        +     * 
        + * + * string name = 1 [(.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; + } + } + + /** + * + * + *
        +     * The test to be deleted.
        +     * 
        + * + * string name = 1 [(.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; + } + + /** + * + * + *
        +     * The test to be deleted.
        +     * 
        + * + * string name = 1 [(.google.api.resource_reference) = { ... } + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
        +     * The test to be deleted.
        +     * 
        + * + * string name = 1 [(.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.showcase.v1beta1.DeleteTestRequest) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.DeleteTestRequest) + private static final com.google.showcase.v1beta1.DeleteTestRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.DeleteTestRequest(); + } + + public static com.google.showcase.v1beta1.DeleteTestRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DeleteTestRequest 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.showcase.v1beta1.DeleteTestRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/DeleteTestRequestOrBuilder.java b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/DeleteTestRequestOrBuilder.java new file mode 100644 index 0000000000..bf453814de --- /dev/null +++ b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/DeleteTestRequestOrBuilder.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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/testing.proto + +// Protobuf Java Version: 3.25.8 +package com.google.showcase.v1beta1; + +public interface DeleteTestRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.DeleteTestRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
        +   * The test to be deleted.
        +   * 
        + * + * string name = 1 [(.google.api.resource_reference) = { ... } + * + * @return The name. + */ + java.lang.String getName(); + + /** + * + * + *
        +   * The test to be deleted.
        +   * 
        + * + * string name = 1 [(.google.api.resource_reference) = { ... } + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); +} diff --git a/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/DeleteUserRequest.java b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/DeleteUserRequest.java new file mode 100644 index 0000000000..d5b54ee8bb --- /dev/null +++ b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/DeleteUserRequest.java @@ -0,0 +1,649 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/identity.proto + +// Protobuf Java Version: 3.25.8 +package com.google.showcase.v1beta1; + +/** + * + * + *
        + * The request message for the google.showcase.v1beta1.Identity\DeleteUser
        + * method.
        + * 
        + * + * Protobuf type {@code google.showcase.v1beta1.DeleteUserRequest} + */ +public final class DeleteUserRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.DeleteUserRequest) + DeleteUserRequestOrBuilder { + private static final long serialVersionUID = 0L; + + // Use DeleteUserRequest.newBuilder() to construct. + private DeleteUserRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private DeleteUserRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new DeleteUserRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.IdentityOuterClass + .internal_static_google_showcase_v1beta1_DeleteUserRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.IdentityOuterClass + .internal_static_google_showcase_v1beta1_DeleteUserRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.DeleteUserRequest.class, + com.google.showcase.v1beta1.DeleteUserRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + + /** + * + * + *
        +   * The resource name of the user to delete.
        +   * 
        + * + * + * 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; + } + } + + /** + * + * + *
        +   * The resource name of the user to delete.
        +   * 
        + * + * + * 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.showcase.v1beta1.DeleteUserRequest)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.DeleteUserRequest other = + (com.google.showcase.v1beta1.DeleteUserRequest) 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.showcase.v1beta1.DeleteUserRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.DeleteUserRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.DeleteUserRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.DeleteUserRequest 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.showcase.v1beta1.DeleteUserRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.DeleteUserRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.DeleteUserRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.DeleteUserRequest 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.showcase.v1beta1.DeleteUserRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.DeleteUserRequest 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.showcase.v1beta1.DeleteUserRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.DeleteUserRequest 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.showcase.v1beta1.DeleteUserRequest 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 request message for the google.showcase.v1beta1.Identity\DeleteUser
        +   * method.
        +   * 
        + * + * Protobuf type {@code google.showcase.v1beta1.DeleteUserRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.DeleteUserRequest) + com.google.showcase.v1beta1.DeleteUserRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.IdentityOuterClass + .internal_static_google_showcase_v1beta1_DeleteUserRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.IdentityOuterClass + .internal_static_google_showcase_v1beta1_DeleteUserRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.DeleteUserRequest.class, + com.google.showcase.v1beta1.DeleteUserRequest.Builder.class); + } + + // Construct using com.google.showcase.v1beta1.DeleteUserRequest.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.showcase.v1beta1.IdentityOuterClass + .internal_static_google_showcase_v1beta1_DeleteUserRequest_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.DeleteUserRequest getDefaultInstanceForType() { + return com.google.showcase.v1beta1.DeleteUserRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.DeleteUserRequest build() { + com.google.showcase.v1beta1.DeleteUserRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.DeleteUserRequest buildPartial() { + com.google.showcase.v1beta1.DeleteUserRequest result = + new com.google.showcase.v1beta1.DeleteUserRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.showcase.v1beta1.DeleteUserRequest 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.showcase.v1beta1.DeleteUserRequest) { + return mergeFrom((com.google.showcase.v1beta1.DeleteUserRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.showcase.v1beta1.DeleteUserRequest other) { + if (other == com.google.showcase.v1beta1.DeleteUserRequest.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_ = ""; + + /** + * + * + *
        +     * The resource name of the user to delete.
        +     * 
        + * + * + * 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; + } + } + + /** + * + * + *
        +     * The resource name of the user to delete.
        +     * 
        + * + * + * 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; + } + } + + /** + * + * + *
        +     * The resource name of the user to delete.
        +     * 
        + * + * + * 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; + } + + /** + * + * + *
        +     * The resource name of the user to delete.
        +     * 
        + * + * + * 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; + } + + /** + * + * + *
        +     * The resource name of the user to delete.
        +     * 
        + * + * + * 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.showcase.v1beta1.DeleteUserRequest) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.DeleteUserRequest) + private static final com.google.showcase.v1beta1.DeleteUserRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.DeleteUserRequest(); + } + + public static com.google.showcase.v1beta1.DeleteUserRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DeleteUserRequest 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.showcase.v1beta1.DeleteUserRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/DeleteUserRequestOrBuilder.java b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/DeleteUserRequestOrBuilder.java new file mode 100644 index 0000000000..eac216503e --- /dev/null +++ b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/DeleteUserRequestOrBuilder.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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/identity.proto + +// Protobuf Java Version: 3.25.8 +package com.google.showcase.v1beta1; + +public interface DeleteUserRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.DeleteUserRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
        +   * The resource name of the user to delete.
        +   * 
        + * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + + /** + * + * + *
        +   * The resource name of the user to delete.
        +   * 
        + * + * + * 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-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/EchoErrorDetailsRequest.java b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/EchoErrorDetailsRequest.java new file mode 100644 index 0000000000..fde232b556 --- /dev/null +++ b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/EchoErrorDetailsRequest.java @@ -0,0 +1,944 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/echo.proto + +// Protobuf Java Version: 3.25.8 +package com.google.showcase.v1beta1; + +/** + * + * + *
        + * The request message used for the EchoErrorDetails method.
        + * 
        + * + * Protobuf type {@code google.showcase.v1beta1.EchoErrorDetailsRequest} + */ +public final class EchoErrorDetailsRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.EchoErrorDetailsRequest) + EchoErrorDetailsRequestOrBuilder { + private static final long serialVersionUID = 0L; + + // Use EchoErrorDetailsRequest.newBuilder() to construct. + private EchoErrorDetailsRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private EchoErrorDetailsRequest() { + singleDetailText_ = ""; + multiDetailText_ = com.google.protobuf.LazyStringArrayList.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new EchoErrorDetailsRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.EchoOuterClass + .internal_static_google_showcase_v1beta1_EchoErrorDetailsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.EchoOuterClass + .internal_static_google_showcase_v1beta1_EchoErrorDetailsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.EchoErrorDetailsRequest.class, + com.google.showcase.v1beta1.EchoErrorDetailsRequest.Builder.class); + } + + public static final int SINGLE_DETAIL_TEXT_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object singleDetailText_ = ""; + + /** + * + * + *
        +   * Content to return in a singular `*.error.details` field of type
        +   * `google.protobuf.Any`
        +   * 
        + * + * string single_detail_text = 1; + * + * @return The singleDetailText. + */ + @java.lang.Override + public java.lang.String getSingleDetailText() { + java.lang.Object ref = singleDetailText_; + 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(); + singleDetailText_ = s; + return s; + } + } + + /** + * + * + *
        +   * Content to return in a singular `*.error.details` field of type
        +   * `google.protobuf.Any`
        +   * 
        + * + * string single_detail_text = 1; + * + * @return The bytes for singleDetailText. + */ + @java.lang.Override + public com.google.protobuf.ByteString getSingleDetailTextBytes() { + java.lang.Object ref = singleDetailText_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + singleDetailText_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int MULTI_DETAIL_TEXT_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private com.google.protobuf.LazyStringArrayList multiDetailText_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + + /** + * + * + *
        +   * Content to return in a repeated `*.error.details` field of type
        +   * `google.protobuf.Any`
        +   * 
        + * + * repeated string multi_detail_text = 2; + * + * @return A list containing the multiDetailText. + */ + public com.google.protobuf.ProtocolStringList getMultiDetailTextList() { + return multiDetailText_; + } + + /** + * + * + *
        +   * Content to return in a repeated `*.error.details` field of type
        +   * `google.protobuf.Any`
        +   * 
        + * + * repeated string multi_detail_text = 2; + * + * @return The count of multiDetailText. + */ + public int getMultiDetailTextCount() { + return multiDetailText_.size(); + } + + /** + * + * + *
        +   * Content to return in a repeated `*.error.details` field of type
        +   * `google.protobuf.Any`
        +   * 
        + * + * repeated string multi_detail_text = 2; + * + * @param index The index of the element to return. + * @return The multiDetailText at the given index. + */ + public java.lang.String getMultiDetailText(int index) { + return multiDetailText_.get(index); + } + + /** + * + * + *
        +   * Content to return in a repeated `*.error.details` field of type
        +   * `google.protobuf.Any`
        +   * 
        + * + * repeated string multi_detail_text = 2; + * + * @param index The index of the value to return. + * @return The bytes of the multiDetailText at the given index. + */ + public com.google.protobuf.ByteString getMultiDetailTextBytes(int index) { + return multiDetailText_.getByteString(index); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(singleDetailText_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, singleDetailText_); + } + for (int i = 0; i < multiDetailText_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, multiDetailText_.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(singleDetailText_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, singleDetailText_); + } + { + int dataSize = 0; + for (int i = 0; i < multiDetailText_.size(); i++) { + dataSize += computeStringSizeNoTag(multiDetailText_.getRaw(i)); + } + size += dataSize; + size += 1 * getMultiDetailTextList().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.showcase.v1beta1.EchoErrorDetailsRequest)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.EchoErrorDetailsRequest other = + (com.google.showcase.v1beta1.EchoErrorDetailsRequest) obj; + + if (!getSingleDetailText().equals(other.getSingleDetailText())) return false; + if (!getMultiDetailTextList().equals(other.getMultiDetailTextList())) 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) + SINGLE_DETAIL_TEXT_FIELD_NUMBER; + hash = (53 * hash) + getSingleDetailText().hashCode(); + if (getMultiDetailTextCount() > 0) { + hash = (37 * hash) + MULTI_DETAIL_TEXT_FIELD_NUMBER; + hash = (53 * hash) + getMultiDetailTextList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.showcase.v1beta1.EchoErrorDetailsRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.EchoErrorDetailsRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.EchoErrorDetailsRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.EchoErrorDetailsRequest 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.showcase.v1beta1.EchoErrorDetailsRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.EchoErrorDetailsRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.EchoErrorDetailsRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.EchoErrorDetailsRequest 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.showcase.v1beta1.EchoErrorDetailsRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.EchoErrorDetailsRequest 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.showcase.v1beta1.EchoErrorDetailsRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.EchoErrorDetailsRequest 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.showcase.v1beta1.EchoErrorDetailsRequest 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 request message used for the EchoErrorDetails method.
        +   * 
        + * + * Protobuf type {@code google.showcase.v1beta1.EchoErrorDetailsRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.EchoErrorDetailsRequest) + com.google.showcase.v1beta1.EchoErrorDetailsRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.EchoOuterClass + .internal_static_google_showcase_v1beta1_EchoErrorDetailsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.EchoOuterClass + .internal_static_google_showcase_v1beta1_EchoErrorDetailsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.EchoErrorDetailsRequest.class, + com.google.showcase.v1beta1.EchoErrorDetailsRequest.Builder.class); + } + + // Construct using com.google.showcase.v1beta1.EchoErrorDetailsRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + singleDetailText_ = ""; + multiDetailText_ = com.google.protobuf.LazyStringArrayList.emptyList(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.showcase.v1beta1.EchoOuterClass + .internal_static_google_showcase_v1beta1_EchoErrorDetailsRequest_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.EchoErrorDetailsRequest getDefaultInstanceForType() { + return com.google.showcase.v1beta1.EchoErrorDetailsRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.EchoErrorDetailsRequest build() { + com.google.showcase.v1beta1.EchoErrorDetailsRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.EchoErrorDetailsRequest buildPartial() { + com.google.showcase.v1beta1.EchoErrorDetailsRequest result = + new com.google.showcase.v1beta1.EchoErrorDetailsRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.showcase.v1beta1.EchoErrorDetailsRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.singleDetailText_ = singleDetailText_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + multiDetailText_.makeImmutable(); + result.multiDetailText_ = multiDetailText_; + } + } + + @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.showcase.v1beta1.EchoErrorDetailsRequest) { + return mergeFrom((com.google.showcase.v1beta1.EchoErrorDetailsRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.showcase.v1beta1.EchoErrorDetailsRequest other) { + if (other == com.google.showcase.v1beta1.EchoErrorDetailsRequest.getDefaultInstance()) + return this; + if (!other.getSingleDetailText().isEmpty()) { + singleDetailText_ = other.singleDetailText_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.multiDetailText_.isEmpty()) { + if (multiDetailText_.isEmpty()) { + multiDetailText_ = other.multiDetailText_; + bitField0_ |= 0x00000002; + } else { + ensureMultiDetailTextIsMutable(); + multiDetailText_.addAll(other.multiDetailText_); + } + 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: + { + singleDetailText_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + ensureMultiDetailTextIsMutable(); + multiDetailText_.add(s); + 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 singleDetailText_ = ""; + + /** + * + * + *
        +     * Content to return in a singular `*.error.details` field of type
        +     * `google.protobuf.Any`
        +     * 
        + * + * string single_detail_text = 1; + * + * @return The singleDetailText. + */ + public java.lang.String getSingleDetailText() { + java.lang.Object ref = singleDetailText_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + singleDetailText_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
        +     * Content to return in a singular `*.error.details` field of type
        +     * `google.protobuf.Any`
        +     * 
        + * + * string single_detail_text = 1; + * + * @return The bytes for singleDetailText. + */ + public com.google.protobuf.ByteString getSingleDetailTextBytes() { + java.lang.Object ref = singleDetailText_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + singleDetailText_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
        +     * Content to return in a singular `*.error.details` field of type
        +     * `google.protobuf.Any`
        +     * 
        + * + * string single_detail_text = 1; + * + * @param value The singleDetailText to set. + * @return This builder for chaining. + */ + public Builder setSingleDetailText(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + singleDetailText_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
        +     * Content to return in a singular `*.error.details` field of type
        +     * `google.protobuf.Any`
        +     * 
        + * + * string single_detail_text = 1; + * + * @return This builder for chaining. + */ + public Builder clearSingleDetailText() { + singleDetailText_ = getDefaultInstance().getSingleDetailText(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
        +     * Content to return in a singular `*.error.details` field of type
        +     * `google.protobuf.Any`
        +     * 
        + * + * string single_detail_text = 1; + * + * @param value The bytes for singleDetailText to set. + * @return This builder for chaining. + */ + public Builder setSingleDetailTextBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + singleDetailText_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private com.google.protobuf.LazyStringArrayList multiDetailText_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + + private void ensureMultiDetailTextIsMutable() { + if (!multiDetailText_.isModifiable()) { + multiDetailText_ = new com.google.protobuf.LazyStringArrayList(multiDetailText_); + } + bitField0_ |= 0x00000002; + } + + /** + * + * + *
        +     * Content to return in a repeated `*.error.details` field of type
        +     * `google.protobuf.Any`
        +     * 
        + * + * repeated string multi_detail_text = 2; + * + * @return A list containing the multiDetailText. + */ + public com.google.protobuf.ProtocolStringList getMultiDetailTextList() { + multiDetailText_.makeImmutable(); + return multiDetailText_; + } + + /** + * + * + *
        +     * Content to return in a repeated `*.error.details` field of type
        +     * `google.protobuf.Any`
        +     * 
        + * + * repeated string multi_detail_text = 2; + * + * @return The count of multiDetailText. + */ + public int getMultiDetailTextCount() { + return multiDetailText_.size(); + } + + /** + * + * + *
        +     * Content to return in a repeated `*.error.details` field of type
        +     * `google.protobuf.Any`
        +     * 
        + * + * repeated string multi_detail_text = 2; + * + * @param index The index of the element to return. + * @return The multiDetailText at the given index. + */ + public java.lang.String getMultiDetailText(int index) { + return multiDetailText_.get(index); + } + + /** + * + * + *
        +     * Content to return in a repeated `*.error.details` field of type
        +     * `google.protobuf.Any`
        +     * 
        + * + * repeated string multi_detail_text = 2; + * + * @param index The index of the value to return. + * @return The bytes of the multiDetailText at the given index. + */ + public com.google.protobuf.ByteString getMultiDetailTextBytes(int index) { + return multiDetailText_.getByteString(index); + } + + /** + * + * + *
        +     * Content to return in a repeated `*.error.details` field of type
        +     * `google.protobuf.Any`
        +     * 
        + * + * repeated string multi_detail_text = 2; + * + * @param index The index to set the value at. + * @param value The multiDetailText to set. + * @return This builder for chaining. + */ + public Builder setMultiDetailText(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureMultiDetailTextIsMutable(); + multiDetailText_.set(index, value); + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
        +     * Content to return in a repeated `*.error.details` field of type
        +     * `google.protobuf.Any`
        +     * 
        + * + * repeated string multi_detail_text = 2; + * + * @param value The multiDetailText to add. + * @return This builder for chaining. + */ + public Builder addMultiDetailText(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureMultiDetailTextIsMutable(); + multiDetailText_.add(value); + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
        +     * Content to return in a repeated `*.error.details` field of type
        +     * `google.protobuf.Any`
        +     * 
        + * + * repeated string multi_detail_text = 2; + * + * @param values The multiDetailText to add. + * @return This builder for chaining. + */ + public Builder addAllMultiDetailText(java.lang.Iterable values) { + ensureMultiDetailTextIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, multiDetailText_); + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
        +     * Content to return in a repeated `*.error.details` field of type
        +     * `google.protobuf.Any`
        +     * 
        + * + * repeated string multi_detail_text = 2; + * + * @return This builder for chaining. + */ + public Builder clearMultiDetailText() { + multiDetailText_ = com.google.protobuf.LazyStringArrayList.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + ; + onChanged(); + return this; + } + + /** + * + * + *
        +     * Content to return in a repeated `*.error.details` field of type
        +     * `google.protobuf.Any`
        +     * 
        + * + * repeated string multi_detail_text = 2; + * + * @param value The bytes of the multiDetailText to add. + * @return This builder for chaining. + */ + public Builder addMultiDetailTextBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureMultiDetailTextIsMutable(); + multiDetailText_.add(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.showcase.v1beta1.EchoErrorDetailsRequest) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.EchoErrorDetailsRequest) + private static final com.google.showcase.v1beta1.EchoErrorDetailsRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.EchoErrorDetailsRequest(); + } + + public static com.google.showcase.v1beta1.EchoErrorDetailsRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public EchoErrorDetailsRequest 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.showcase.v1beta1.EchoErrorDetailsRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/EchoErrorDetailsRequestOrBuilder.java b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/EchoErrorDetailsRequestOrBuilder.java new file mode 100644 index 0000000000..c5c374ea56 --- /dev/null +++ b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/EchoErrorDetailsRequestOrBuilder.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: schema/google/showcase/v1beta1/echo.proto + +// Protobuf Java Version: 3.25.8 +package com.google.showcase.v1beta1; + +public interface EchoErrorDetailsRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.EchoErrorDetailsRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
        +   * Content to return in a singular `*.error.details` field of type
        +   * `google.protobuf.Any`
        +   * 
        + * + * string single_detail_text = 1; + * + * @return The singleDetailText. + */ + java.lang.String getSingleDetailText(); + + /** + * + * + *
        +   * Content to return in a singular `*.error.details` field of type
        +   * `google.protobuf.Any`
        +   * 
        + * + * string single_detail_text = 1; + * + * @return The bytes for singleDetailText. + */ + com.google.protobuf.ByteString getSingleDetailTextBytes(); + + /** + * + * + *
        +   * Content to return in a repeated `*.error.details` field of type
        +   * `google.protobuf.Any`
        +   * 
        + * + * repeated string multi_detail_text = 2; + * + * @return A list containing the multiDetailText. + */ + java.util.List getMultiDetailTextList(); + + /** + * + * + *
        +   * Content to return in a repeated `*.error.details` field of type
        +   * `google.protobuf.Any`
        +   * 
        + * + * repeated string multi_detail_text = 2; + * + * @return The count of multiDetailText. + */ + int getMultiDetailTextCount(); + + /** + * + * + *
        +   * Content to return in a repeated `*.error.details` field of type
        +   * `google.protobuf.Any`
        +   * 
        + * + * repeated string multi_detail_text = 2; + * + * @param index The index of the element to return. + * @return The multiDetailText at the given index. + */ + java.lang.String getMultiDetailText(int index); + + /** + * + * + *
        +   * Content to return in a repeated `*.error.details` field of type
        +   * `google.protobuf.Any`
        +   * 
        + * + * repeated string multi_detail_text = 2; + * + * @param index The index of the value to return. + * @return The bytes of the multiDetailText at the given index. + */ + com.google.protobuf.ByteString getMultiDetailTextBytes(int index); +} diff --git a/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/EchoErrorDetailsResponse.java b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/EchoErrorDetailsResponse.java new file mode 100644 index 0000000000..40561fcb60 --- /dev/null +++ b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/EchoErrorDetailsResponse.java @@ -0,0 +1,2222 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/echo.proto + +// Protobuf Java Version: 3.25.8 +package com.google.showcase.v1beta1; + +/** + * + * + *
        + * The response message used for the EchoErrorDetails method.
        + * 
        + * + * Protobuf type {@code google.showcase.v1beta1.EchoErrorDetailsResponse} + */ +public final class EchoErrorDetailsResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.EchoErrorDetailsResponse) + EchoErrorDetailsResponseOrBuilder { + private static final long serialVersionUID = 0L; + + // Use EchoErrorDetailsResponse.newBuilder() to construct. + private EchoErrorDetailsResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private EchoErrorDetailsResponse() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new EchoErrorDetailsResponse(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.EchoOuterClass + .internal_static_google_showcase_v1beta1_EchoErrorDetailsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.EchoOuterClass + .internal_static_google_showcase_v1beta1_EchoErrorDetailsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.EchoErrorDetailsResponse.class, + com.google.showcase.v1beta1.EchoErrorDetailsResponse.Builder.class); + } + + public interface SingleDetailOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.EchoErrorDetailsResponse.SingleDetail) + com.google.protobuf.MessageOrBuilder { + + /** + * .google.showcase.v1beta1.ErrorWithSingleDetail error = 1; + * + * @return Whether the error field is set. + */ + boolean hasError(); + + /** + * .google.showcase.v1beta1.ErrorWithSingleDetail error = 1; + * + * @return The error. + */ + com.google.showcase.v1beta1.ErrorWithSingleDetail getError(); + + /** .google.showcase.v1beta1.ErrorWithSingleDetail error = 1; */ + com.google.showcase.v1beta1.ErrorWithSingleDetailOrBuilder getErrorOrBuilder(); + } + + /** Protobuf type {@code google.showcase.v1beta1.EchoErrorDetailsResponse.SingleDetail} */ + public static final class SingleDetail extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.EchoErrorDetailsResponse.SingleDetail) + SingleDetailOrBuilder { + private static final long serialVersionUID = 0L; + + // Use SingleDetail.newBuilder() to construct. + private SingleDetail(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private SingleDetail() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new SingleDetail(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.EchoOuterClass + .internal_static_google_showcase_v1beta1_EchoErrorDetailsResponse_SingleDetail_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.EchoOuterClass + .internal_static_google_showcase_v1beta1_EchoErrorDetailsResponse_SingleDetail_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.EchoErrorDetailsResponse.SingleDetail.class, + com.google.showcase.v1beta1.EchoErrorDetailsResponse.SingleDetail.Builder.class); + } + + private int bitField0_; + public static final int ERROR_FIELD_NUMBER = 1; + private com.google.showcase.v1beta1.ErrorWithSingleDetail error_; + + /** + * .google.showcase.v1beta1.ErrorWithSingleDetail error = 1; + * + * @return Whether the error field is set. + */ + @java.lang.Override + public boolean hasError() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * .google.showcase.v1beta1.ErrorWithSingleDetail error = 1; + * + * @return The error. + */ + @java.lang.Override + public com.google.showcase.v1beta1.ErrorWithSingleDetail getError() { + return error_ == null + ? com.google.showcase.v1beta1.ErrorWithSingleDetail.getDefaultInstance() + : error_; + } + + /** .google.showcase.v1beta1.ErrorWithSingleDetail error = 1; */ + @java.lang.Override + public com.google.showcase.v1beta1.ErrorWithSingleDetailOrBuilder getErrorOrBuilder() { + return error_ == null + ? com.google.showcase.v1beta1.ErrorWithSingleDetail.getDefaultInstance() + : error_; + } + + 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, getError()); + } + 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, getError()); + } + 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.showcase.v1beta1.EchoErrorDetailsResponse.SingleDetail)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.EchoErrorDetailsResponse.SingleDetail other = + (com.google.showcase.v1beta1.EchoErrorDetailsResponse.SingleDetail) obj; + + if (hasError() != other.hasError()) return false; + if (hasError()) { + if (!getError().equals(other.getError())) 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 (hasError()) { + hash = (37 * hash) + ERROR_FIELD_NUMBER; + hash = (53 * hash) + getError().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.showcase.v1beta1.EchoErrorDetailsResponse.SingleDetail parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.EchoErrorDetailsResponse.SingleDetail parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.EchoErrorDetailsResponse.SingleDetail parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.EchoErrorDetailsResponse.SingleDetail 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.showcase.v1beta1.EchoErrorDetailsResponse.SingleDetail parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.EchoErrorDetailsResponse.SingleDetail parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.EchoErrorDetailsResponse.SingleDetail parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.EchoErrorDetailsResponse.SingleDetail 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.showcase.v1beta1.EchoErrorDetailsResponse.SingleDetail + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.EchoErrorDetailsResponse.SingleDetail + 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.showcase.v1beta1.EchoErrorDetailsResponse.SingleDetail parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.EchoErrorDetailsResponse.SingleDetail 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.showcase.v1beta1.EchoErrorDetailsResponse.SingleDetail prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** Protobuf type {@code google.showcase.v1beta1.EchoErrorDetailsResponse.SingleDetail} */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.EchoErrorDetailsResponse.SingleDetail) + com.google.showcase.v1beta1.EchoErrorDetailsResponse.SingleDetailOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.EchoOuterClass + .internal_static_google_showcase_v1beta1_EchoErrorDetailsResponse_SingleDetail_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.EchoOuterClass + .internal_static_google_showcase_v1beta1_EchoErrorDetailsResponse_SingleDetail_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.EchoErrorDetailsResponse.SingleDetail.class, + com.google.showcase.v1beta1.EchoErrorDetailsResponse.SingleDetail.Builder.class); + } + + // Construct using + // com.google.showcase.v1beta1.EchoErrorDetailsResponse.SingleDetail.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getErrorFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + error_ = null; + if (errorBuilder_ != null) { + errorBuilder_.dispose(); + errorBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.showcase.v1beta1.EchoOuterClass + .internal_static_google_showcase_v1beta1_EchoErrorDetailsResponse_SingleDetail_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.EchoErrorDetailsResponse.SingleDetail + getDefaultInstanceForType() { + return com.google.showcase.v1beta1.EchoErrorDetailsResponse.SingleDetail + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.EchoErrorDetailsResponse.SingleDetail build() { + com.google.showcase.v1beta1.EchoErrorDetailsResponse.SingleDetail result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.EchoErrorDetailsResponse.SingleDetail buildPartial() { + com.google.showcase.v1beta1.EchoErrorDetailsResponse.SingleDetail result = + new com.google.showcase.v1beta1.EchoErrorDetailsResponse.SingleDetail(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.showcase.v1beta1.EchoErrorDetailsResponse.SingleDetail result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.error_ = errorBuilder_ == null ? error_ : errorBuilder_.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.showcase.v1beta1.EchoErrorDetailsResponse.SingleDetail) { + return mergeFrom( + (com.google.showcase.v1beta1.EchoErrorDetailsResponse.SingleDetail) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.showcase.v1beta1.EchoErrorDetailsResponse.SingleDetail other) { + if (other + == com.google.showcase.v1beta1.EchoErrorDetailsResponse.SingleDetail + .getDefaultInstance()) return this; + if (other.hasError()) { + mergeError(other.getError()); + } + 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(getErrorFieldBuilder().getBuilder(), extensionRegistry); + 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 com.google.showcase.v1beta1.ErrorWithSingleDetail error_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.showcase.v1beta1.ErrorWithSingleDetail, + com.google.showcase.v1beta1.ErrorWithSingleDetail.Builder, + com.google.showcase.v1beta1.ErrorWithSingleDetailOrBuilder> + errorBuilder_; + + /** + * .google.showcase.v1beta1.ErrorWithSingleDetail error = 1; + * + * @return Whether the error field is set. + */ + public boolean hasError() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * .google.showcase.v1beta1.ErrorWithSingleDetail error = 1; + * + * @return The error. + */ + public com.google.showcase.v1beta1.ErrorWithSingleDetail getError() { + if (errorBuilder_ == null) { + return error_ == null + ? com.google.showcase.v1beta1.ErrorWithSingleDetail.getDefaultInstance() + : error_; + } else { + return errorBuilder_.getMessage(); + } + } + + /** .google.showcase.v1beta1.ErrorWithSingleDetail error = 1; */ + public Builder setError(com.google.showcase.v1beta1.ErrorWithSingleDetail value) { + if (errorBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + error_ = value; + } else { + errorBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** .google.showcase.v1beta1.ErrorWithSingleDetail error = 1; */ + public Builder setError( + com.google.showcase.v1beta1.ErrorWithSingleDetail.Builder builderForValue) { + if (errorBuilder_ == null) { + error_ = builderForValue.build(); + } else { + errorBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** .google.showcase.v1beta1.ErrorWithSingleDetail error = 1; */ + public Builder mergeError(com.google.showcase.v1beta1.ErrorWithSingleDetail value) { + if (errorBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) + && error_ != null + && error_ != com.google.showcase.v1beta1.ErrorWithSingleDetail.getDefaultInstance()) { + getErrorBuilder().mergeFrom(value); + } else { + error_ = value; + } + } else { + errorBuilder_.mergeFrom(value); + } + if (error_ != null) { + bitField0_ |= 0x00000001; + onChanged(); + } + return this; + } + + /** .google.showcase.v1beta1.ErrorWithSingleDetail error = 1; */ + public Builder clearError() { + bitField0_ = (bitField0_ & ~0x00000001); + error_ = null; + if (errorBuilder_ != null) { + errorBuilder_.dispose(); + errorBuilder_ = null; + } + onChanged(); + return this; + } + + /** .google.showcase.v1beta1.ErrorWithSingleDetail error = 1; */ + public com.google.showcase.v1beta1.ErrorWithSingleDetail.Builder getErrorBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return getErrorFieldBuilder().getBuilder(); + } + + /** .google.showcase.v1beta1.ErrorWithSingleDetail error = 1; */ + public com.google.showcase.v1beta1.ErrorWithSingleDetailOrBuilder getErrorOrBuilder() { + if (errorBuilder_ != null) { + return errorBuilder_.getMessageOrBuilder(); + } else { + return error_ == null + ? com.google.showcase.v1beta1.ErrorWithSingleDetail.getDefaultInstance() + : error_; + } + } + + /** .google.showcase.v1beta1.ErrorWithSingleDetail error = 1; */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.showcase.v1beta1.ErrorWithSingleDetail, + com.google.showcase.v1beta1.ErrorWithSingleDetail.Builder, + com.google.showcase.v1beta1.ErrorWithSingleDetailOrBuilder> + getErrorFieldBuilder() { + if (errorBuilder_ == null) { + errorBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.showcase.v1beta1.ErrorWithSingleDetail, + com.google.showcase.v1beta1.ErrorWithSingleDetail.Builder, + com.google.showcase.v1beta1.ErrorWithSingleDetailOrBuilder>( + getError(), getParentForChildren(), isClean()); + error_ = null; + } + return errorBuilder_; + } + + @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.showcase.v1beta1.EchoErrorDetailsResponse.SingleDetail) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.EchoErrorDetailsResponse.SingleDetail) + private static final com.google.showcase.v1beta1.EchoErrorDetailsResponse.SingleDetail + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.EchoErrorDetailsResponse.SingleDetail(); + } + + public static com.google.showcase.v1beta1.EchoErrorDetailsResponse.SingleDetail + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SingleDetail 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.showcase.v1beta1.EchoErrorDetailsResponse.SingleDetail + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface MultipleDetailsOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.EchoErrorDetailsResponse.MultipleDetails) + com.google.protobuf.MessageOrBuilder { + + /** + * .google.showcase.v1beta1.ErrorWithMultipleDetails error = 1; + * + * @return Whether the error field is set. + */ + boolean hasError(); + + /** + * .google.showcase.v1beta1.ErrorWithMultipleDetails error = 1; + * + * @return The error. + */ + com.google.showcase.v1beta1.ErrorWithMultipleDetails getError(); + + /** .google.showcase.v1beta1.ErrorWithMultipleDetails error = 1; */ + com.google.showcase.v1beta1.ErrorWithMultipleDetailsOrBuilder getErrorOrBuilder(); + } + + /** Protobuf type {@code google.showcase.v1beta1.EchoErrorDetailsResponse.MultipleDetails} */ + public static final class MultipleDetails extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.EchoErrorDetailsResponse.MultipleDetails) + MultipleDetailsOrBuilder { + private static final long serialVersionUID = 0L; + + // Use MultipleDetails.newBuilder() to construct. + private MultipleDetails(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private MultipleDetails() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new MultipleDetails(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.EchoOuterClass + .internal_static_google_showcase_v1beta1_EchoErrorDetailsResponse_MultipleDetails_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.EchoOuterClass + .internal_static_google_showcase_v1beta1_EchoErrorDetailsResponse_MultipleDetails_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.EchoErrorDetailsResponse.MultipleDetails.class, + com.google.showcase.v1beta1.EchoErrorDetailsResponse.MultipleDetails.Builder.class); + } + + private int bitField0_; + public static final int ERROR_FIELD_NUMBER = 1; + private com.google.showcase.v1beta1.ErrorWithMultipleDetails error_; + + /** + * .google.showcase.v1beta1.ErrorWithMultipleDetails error = 1; + * + * @return Whether the error field is set. + */ + @java.lang.Override + public boolean hasError() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * .google.showcase.v1beta1.ErrorWithMultipleDetails error = 1; + * + * @return The error. + */ + @java.lang.Override + public com.google.showcase.v1beta1.ErrorWithMultipleDetails getError() { + return error_ == null + ? com.google.showcase.v1beta1.ErrorWithMultipleDetails.getDefaultInstance() + : error_; + } + + /** .google.showcase.v1beta1.ErrorWithMultipleDetails error = 1; */ + @java.lang.Override + public com.google.showcase.v1beta1.ErrorWithMultipleDetailsOrBuilder getErrorOrBuilder() { + return error_ == null + ? com.google.showcase.v1beta1.ErrorWithMultipleDetails.getDefaultInstance() + : error_; + } + + 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, getError()); + } + 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, getError()); + } + 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.showcase.v1beta1.EchoErrorDetailsResponse.MultipleDetails)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.EchoErrorDetailsResponse.MultipleDetails other = + (com.google.showcase.v1beta1.EchoErrorDetailsResponse.MultipleDetails) obj; + + if (hasError() != other.hasError()) return false; + if (hasError()) { + if (!getError().equals(other.getError())) 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 (hasError()) { + hash = (37 * hash) + ERROR_FIELD_NUMBER; + hash = (53 * hash) + getError().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.showcase.v1beta1.EchoErrorDetailsResponse.MultipleDetails parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.EchoErrorDetailsResponse.MultipleDetails parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.EchoErrorDetailsResponse.MultipleDetails parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.EchoErrorDetailsResponse.MultipleDetails 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.showcase.v1beta1.EchoErrorDetailsResponse.MultipleDetails parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.EchoErrorDetailsResponse.MultipleDetails parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.EchoErrorDetailsResponse.MultipleDetails parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.EchoErrorDetailsResponse.MultipleDetails 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.showcase.v1beta1.EchoErrorDetailsResponse.MultipleDetails + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.EchoErrorDetailsResponse.MultipleDetails + 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.showcase.v1beta1.EchoErrorDetailsResponse.MultipleDetails parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.EchoErrorDetailsResponse.MultipleDetails 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.showcase.v1beta1.EchoErrorDetailsResponse.MultipleDetails prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** Protobuf type {@code google.showcase.v1beta1.EchoErrorDetailsResponse.MultipleDetails} */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.EchoErrorDetailsResponse.MultipleDetails) + com.google.showcase.v1beta1.EchoErrorDetailsResponse.MultipleDetailsOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.EchoOuterClass + .internal_static_google_showcase_v1beta1_EchoErrorDetailsResponse_MultipleDetails_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.EchoOuterClass + .internal_static_google_showcase_v1beta1_EchoErrorDetailsResponse_MultipleDetails_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.EchoErrorDetailsResponse.MultipleDetails.class, + com.google.showcase.v1beta1.EchoErrorDetailsResponse.MultipleDetails.Builder.class); + } + + // Construct using + // com.google.showcase.v1beta1.EchoErrorDetailsResponse.MultipleDetails.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getErrorFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + error_ = null; + if (errorBuilder_ != null) { + errorBuilder_.dispose(); + errorBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.showcase.v1beta1.EchoOuterClass + .internal_static_google_showcase_v1beta1_EchoErrorDetailsResponse_MultipleDetails_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.EchoErrorDetailsResponse.MultipleDetails + getDefaultInstanceForType() { + return com.google.showcase.v1beta1.EchoErrorDetailsResponse.MultipleDetails + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.EchoErrorDetailsResponse.MultipleDetails build() { + com.google.showcase.v1beta1.EchoErrorDetailsResponse.MultipleDetails result = + buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.EchoErrorDetailsResponse.MultipleDetails buildPartial() { + com.google.showcase.v1beta1.EchoErrorDetailsResponse.MultipleDetails result = + new com.google.showcase.v1beta1.EchoErrorDetailsResponse.MultipleDetails(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.showcase.v1beta1.EchoErrorDetailsResponse.MultipleDetails result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.error_ = errorBuilder_ == null ? error_ : errorBuilder_.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.showcase.v1beta1.EchoErrorDetailsResponse.MultipleDetails) { + return mergeFrom( + (com.google.showcase.v1beta1.EchoErrorDetailsResponse.MultipleDetails) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.showcase.v1beta1.EchoErrorDetailsResponse.MultipleDetails other) { + if (other + == com.google.showcase.v1beta1.EchoErrorDetailsResponse.MultipleDetails + .getDefaultInstance()) return this; + if (other.hasError()) { + mergeError(other.getError()); + } + 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(getErrorFieldBuilder().getBuilder(), extensionRegistry); + 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 com.google.showcase.v1beta1.ErrorWithMultipleDetails error_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.showcase.v1beta1.ErrorWithMultipleDetails, + com.google.showcase.v1beta1.ErrorWithMultipleDetails.Builder, + com.google.showcase.v1beta1.ErrorWithMultipleDetailsOrBuilder> + errorBuilder_; + + /** + * .google.showcase.v1beta1.ErrorWithMultipleDetails error = 1; + * + * @return Whether the error field is set. + */ + public boolean hasError() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * .google.showcase.v1beta1.ErrorWithMultipleDetails error = 1; + * + * @return The error. + */ + public com.google.showcase.v1beta1.ErrorWithMultipleDetails getError() { + if (errorBuilder_ == null) { + return error_ == null + ? com.google.showcase.v1beta1.ErrorWithMultipleDetails.getDefaultInstance() + : error_; + } else { + return errorBuilder_.getMessage(); + } + } + + /** .google.showcase.v1beta1.ErrorWithMultipleDetails error = 1; */ + public Builder setError(com.google.showcase.v1beta1.ErrorWithMultipleDetails value) { + if (errorBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + error_ = value; + } else { + errorBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** .google.showcase.v1beta1.ErrorWithMultipleDetails error = 1; */ + public Builder setError( + com.google.showcase.v1beta1.ErrorWithMultipleDetails.Builder builderForValue) { + if (errorBuilder_ == null) { + error_ = builderForValue.build(); + } else { + errorBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** .google.showcase.v1beta1.ErrorWithMultipleDetails error = 1; */ + public Builder mergeError(com.google.showcase.v1beta1.ErrorWithMultipleDetails value) { + if (errorBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) + && error_ != null + && error_ + != com.google.showcase.v1beta1.ErrorWithMultipleDetails.getDefaultInstance()) { + getErrorBuilder().mergeFrom(value); + } else { + error_ = value; + } + } else { + errorBuilder_.mergeFrom(value); + } + if (error_ != null) { + bitField0_ |= 0x00000001; + onChanged(); + } + return this; + } + + /** .google.showcase.v1beta1.ErrorWithMultipleDetails error = 1; */ + public Builder clearError() { + bitField0_ = (bitField0_ & ~0x00000001); + error_ = null; + if (errorBuilder_ != null) { + errorBuilder_.dispose(); + errorBuilder_ = null; + } + onChanged(); + return this; + } + + /** .google.showcase.v1beta1.ErrorWithMultipleDetails error = 1; */ + public com.google.showcase.v1beta1.ErrorWithMultipleDetails.Builder getErrorBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return getErrorFieldBuilder().getBuilder(); + } + + /** .google.showcase.v1beta1.ErrorWithMultipleDetails error = 1; */ + public com.google.showcase.v1beta1.ErrorWithMultipleDetailsOrBuilder getErrorOrBuilder() { + if (errorBuilder_ != null) { + return errorBuilder_.getMessageOrBuilder(); + } else { + return error_ == null + ? com.google.showcase.v1beta1.ErrorWithMultipleDetails.getDefaultInstance() + : error_; + } + } + + /** .google.showcase.v1beta1.ErrorWithMultipleDetails error = 1; */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.showcase.v1beta1.ErrorWithMultipleDetails, + com.google.showcase.v1beta1.ErrorWithMultipleDetails.Builder, + com.google.showcase.v1beta1.ErrorWithMultipleDetailsOrBuilder> + getErrorFieldBuilder() { + if (errorBuilder_ == null) { + errorBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.showcase.v1beta1.ErrorWithMultipleDetails, + com.google.showcase.v1beta1.ErrorWithMultipleDetails.Builder, + com.google.showcase.v1beta1.ErrorWithMultipleDetailsOrBuilder>( + getError(), getParentForChildren(), isClean()); + error_ = null; + } + return errorBuilder_; + } + + @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.showcase.v1beta1.EchoErrorDetailsResponse.MultipleDetails) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.EchoErrorDetailsResponse.MultipleDetails) + private static final com.google.showcase.v1beta1.EchoErrorDetailsResponse.MultipleDetails + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.EchoErrorDetailsResponse.MultipleDetails(); + } + + public static com.google.showcase.v1beta1.EchoErrorDetailsResponse.MultipleDetails + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public MultipleDetails 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.showcase.v1beta1.EchoErrorDetailsResponse.MultipleDetails + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + private int bitField0_; + public static final int SINGLE_DETAIL_FIELD_NUMBER = 1; + private com.google.showcase.v1beta1.EchoErrorDetailsResponse.SingleDetail singleDetail_; + + /** + * .google.showcase.v1beta1.EchoErrorDetailsResponse.SingleDetail single_detail = 1; + * + * @return Whether the singleDetail field is set. + */ + @java.lang.Override + public boolean hasSingleDetail() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * .google.showcase.v1beta1.EchoErrorDetailsResponse.SingleDetail single_detail = 1; + * + * @return The singleDetail. + */ + @java.lang.Override + public com.google.showcase.v1beta1.EchoErrorDetailsResponse.SingleDetail getSingleDetail() { + return singleDetail_ == null + ? com.google.showcase.v1beta1.EchoErrorDetailsResponse.SingleDetail.getDefaultInstance() + : singleDetail_; + } + + /** + * .google.showcase.v1beta1.EchoErrorDetailsResponse.SingleDetail single_detail = 1; + */ + @java.lang.Override + public com.google.showcase.v1beta1.EchoErrorDetailsResponse.SingleDetailOrBuilder + getSingleDetailOrBuilder() { + return singleDetail_ == null + ? com.google.showcase.v1beta1.EchoErrorDetailsResponse.SingleDetail.getDefaultInstance() + : singleDetail_; + } + + public static final int MULTIPLE_DETAILS_FIELD_NUMBER = 2; + private com.google.showcase.v1beta1.EchoErrorDetailsResponse.MultipleDetails multipleDetails_; + + /** + * .google.showcase.v1beta1.EchoErrorDetailsResponse.MultipleDetails multiple_details = 2; + * + * + * @return Whether the multipleDetails field is set. + */ + @java.lang.Override + public boolean hasMultipleDetails() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * .google.showcase.v1beta1.EchoErrorDetailsResponse.MultipleDetails multiple_details = 2; + * + * + * @return The multipleDetails. + */ + @java.lang.Override + public com.google.showcase.v1beta1.EchoErrorDetailsResponse.MultipleDetails getMultipleDetails() { + return multipleDetails_ == null + ? com.google.showcase.v1beta1.EchoErrorDetailsResponse.MultipleDetails.getDefaultInstance() + : multipleDetails_; + } + + /** + * .google.showcase.v1beta1.EchoErrorDetailsResponse.MultipleDetails multiple_details = 2; + * + */ + @java.lang.Override + public com.google.showcase.v1beta1.EchoErrorDetailsResponse.MultipleDetailsOrBuilder + getMultipleDetailsOrBuilder() { + return multipleDetails_ == null + ? com.google.showcase.v1beta1.EchoErrorDetailsResponse.MultipleDetails.getDefaultInstance() + : multipleDetails_; + } + + 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, getSingleDetail()); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeMessage(2, getMultipleDetails()); + } + 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, getSingleDetail()); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getMultipleDetails()); + } + 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.showcase.v1beta1.EchoErrorDetailsResponse)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.EchoErrorDetailsResponse other = + (com.google.showcase.v1beta1.EchoErrorDetailsResponse) obj; + + if (hasSingleDetail() != other.hasSingleDetail()) return false; + if (hasSingleDetail()) { + if (!getSingleDetail().equals(other.getSingleDetail())) return false; + } + if (hasMultipleDetails() != other.hasMultipleDetails()) return false; + if (hasMultipleDetails()) { + if (!getMultipleDetails().equals(other.getMultipleDetails())) 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 (hasSingleDetail()) { + hash = (37 * hash) + SINGLE_DETAIL_FIELD_NUMBER; + hash = (53 * hash) + getSingleDetail().hashCode(); + } + if (hasMultipleDetails()) { + hash = (37 * hash) + MULTIPLE_DETAILS_FIELD_NUMBER; + hash = (53 * hash) + getMultipleDetails().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.showcase.v1beta1.EchoErrorDetailsResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.EchoErrorDetailsResponse parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.EchoErrorDetailsResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.EchoErrorDetailsResponse 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.showcase.v1beta1.EchoErrorDetailsResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.EchoErrorDetailsResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.EchoErrorDetailsResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.EchoErrorDetailsResponse 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.showcase.v1beta1.EchoErrorDetailsResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.EchoErrorDetailsResponse 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.showcase.v1beta1.EchoErrorDetailsResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.EchoErrorDetailsResponse 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.showcase.v1beta1.EchoErrorDetailsResponse 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 message used for the EchoErrorDetails method.
        +   * 
        + * + * Protobuf type {@code google.showcase.v1beta1.EchoErrorDetailsResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.EchoErrorDetailsResponse) + com.google.showcase.v1beta1.EchoErrorDetailsResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.EchoOuterClass + .internal_static_google_showcase_v1beta1_EchoErrorDetailsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.EchoOuterClass + .internal_static_google_showcase_v1beta1_EchoErrorDetailsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.EchoErrorDetailsResponse.class, + com.google.showcase.v1beta1.EchoErrorDetailsResponse.Builder.class); + } + + // Construct using com.google.showcase.v1beta1.EchoErrorDetailsResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getSingleDetailFieldBuilder(); + getMultipleDetailsFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + singleDetail_ = null; + if (singleDetailBuilder_ != null) { + singleDetailBuilder_.dispose(); + singleDetailBuilder_ = null; + } + multipleDetails_ = null; + if (multipleDetailsBuilder_ != null) { + multipleDetailsBuilder_.dispose(); + multipleDetailsBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.showcase.v1beta1.EchoOuterClass + .internal_static_google_showcase_v1beta1_EchoErrorDetailsResponse_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.EchoErrorDetailsResponse getDefaultInstanceForType() { + return com.google.showcase.v1beta1.EchoErrorDetailsResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.EchoErrorDetailsResponse build() { + com.google.showcase.v1beta1.EchoErrorDetailsResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.EchoErrorDetailsResponse buildPartial() { + com.google.showcase.v1beta1.EchoErrorDetailsResponse result = + new com.google.showcase.v1beta1.EchoErrorDetailsResponse(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.showcase.v1beta1.EchoErrorDetailsResponse result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.singleDetail_ = + singleDetailBuilder_ == null ? singleDetail_ : singleDetailBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.multipleDetails_ = + multipleDetailsBuilder_ == null ? multipleDetails_ : multipleDetailsBuilder_.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.showcase.v1beta1.EchoErrorDetailsResponse) { + return mergeFrom((com.google.showcase.v1beta1.EchoErrorDetailsResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.showcase.v1beta1.EchoErrorDetailsResponse other) { + if (other == com.google.showcase.v1beta1.EchoErrorDetailsResponse.getDefaultInstance()) + return this; + if (other.hasSingleDetail()) { + mergeSingleDetail(other.getSingleDetail()); + } + if (other.hasMultipleDetails()) { + mergeMultipleDetails(other.getMultipleDetails()); + } + 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(getSingleDetailFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + input.readMessage(getMultipleDetailsFieldBuilder().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 com.google.showcase.v1beta1.EchoErrorDetailsResponse.SingleDetail singleDetail_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.showcase.v1beta1.EchoErrorDetailsResponse.SingleDetail, + com.google.showcase.v1beta1.EchoErrorDetailsResponse.SingleDetail.Builder, + com.google.showcase.v1beta1.EchoErrorDetailsResponse.SingleDetailOrBuilder> + singleDetailBuilder_; + + /** + * .google.showcase.v1beta1.EchoErrorDetailsResponse.SingleDetail single_detail = 1; + * + * + * @return Whether the singleDetail field is set. + */ + public boolean hasSingleDetail() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * .google.showcase.v1beta1.EchoErrorDetailsResponse.SingleDetail single_detail = 1; + * + * + * @return The singleDetail. + */ + public com.google.showcase.v1beta1.EchoErrorDetailsResponse.SingleDetail getSingleDetail() { + if (singleDetailBuilder_ == null) { + return singleDetail_ == null + ? com.google.showcase.v1beta1.EchoErrorDetailsResponse.SingleDetail.getDefaultInstance() + : singleDetail_; + } else { + return singleDetailBuilder_.getMessage(); + } + } + + /** + * .google.showcase.v1beta1.EchoErrorDetailsResponse.SingleDetail single_detail = 1; + * + */ + public Builder setSingleDetail( + com.google.showcase.v1beta1.EchoErrorDetailsResponse.SingleDetail value) { + if (singleDetailBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + singleDetail_ = value; + } else { + singleDetailBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * .google.showcase.v1beta1.EchoErrorDetailsResponse.SingleDetail single_detail = 1; + * + */ + public Builder setSingleDetail( + com.google.showcase.v1beta1.EchoErrorDetailsResponse.SingleDetail.Builder builderForValue) { + if (singleDetailBuilder_ == null) { + singleDetail_ = builderForValue.build(); + } else { + singleDetailBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * .google.showcase.v1beta1.EchoErrorDetailsResponse.SingleDetail single_detail = 1; + * + */ + public Builder mergeSingleDetail( + com.google.showcase.v1beta1.EchoErrorDetailsResponse.SingleDetail value) { + if (singleDetailBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) + && singleDetail_ != null + && singleDetail_ + != com.google.showcase.v1beta1.EchoErrorDetailsResponse.SingleDetail + .getDefaultInstance()) { + getSingleDetailBuilder().mergeFrom(value); + } else { + singleDetail_ = value; + } + } else { + singleDetailBuilder_.mergeFrom(value); + } + if (singleDetail_ != null) { + bitField0_ |= 0x00000001; + onChanged(); + } + return this; + } + + /** + * .google.showcase.v1beta1.EchoErrorDetailsResponse.SingleDetail single_detail = 1; + * + */ + public Builder clearSingleDetail() { + bitField0_ = (bitField0_ & ~0x00000001); + singleDetail_ = null; + if (singleDetailBuilder_ != null) { + singleDetailBuilder_.dispose(); + singleDetailBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * .google.showcase.v1beta1.EchoErrorDetailsResponse.SingleDetail single_detail = 1; + * + */ + public com.google.showcase.v1beta1.EchoErrorDetailsResponse.SingleDetail.Builder + getSingleDetailBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return getSingleDetailFieldBuilder().getBuilder(); + } + + /** + * .google.showcase.v1beta1.EchoErrorDetailsResponse.SingleDetail single_detail = 1; + * + */ + public com.google.showcase.v1beta1.EchoErrorDetailsResponse.SingleDetailOrBuilder + getSingleDetailOrBuilder() { + if (singleDetailBuilder_ != null) { + return singleDetailBuilder_.getMessageOrBuilder(); + } else { + return singleDetail_ == null + ? com.google.showcase.v1beta1.EchoErrorDetailsResponse.SingleDetail.getDefaultInstance() + : singleDetail_; + } + } + + /** + * .google.showcase.v1beta1.EchoErrorDetailsResponse.SingleDetail single_detail = 1; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.showcase.v1beta1.EchoErrorDetailsResponse.SingleDetail, + com.google.showcase.v1beta1.EchoErrorDetailsResponse.SingleDetail.Builder, + com.google.showcase.v1beta1.EchoErrorDetailsResponse.SingleDetailOrBuilder> + getSingleDetailFieldBuilder() { + if (singleDetailBuilder_ == null) { + singleDetailBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.showcase.v1beta1.EchoErrorDetailsResponse.SingleDetail, + com.google.showcase.v1beta1.EchoErrorDetailsResponse.SingleDetail.Builder, + com.google.showcase.v1beta1.EchoErrorDetailsResponse.SingleDetailOrBuilder>( + getSingleDetail(), getParentForChildren(), isClean()); + singleDetail_ = null; + } + return singleDetailBuilder_; + } + + private com.google.showcase.v1beta1.EchoErrorDetailsResponse.MultipleDetails multipleDetails_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.showcase.v1beta1.EchoErrorDetailsResponse.MultipleDetails, + com.google.showcase.v1beta1.EchoErrorDetailsResponse.MultipleDetails.Builder, + com.google.showcase.v1beta1.EchoErrorDetailsResponse.MultipleDetailsOrBuilder> + multipleDetailsBuilder_; + + /** + * .google.showcase.v1beta1.EchoErrorDetailsResponse.MultipleDetails multiple_details = 2; + * + * + * @return Whether the multipleDetails field is set. + */ + public boolean hasMultipleDetails() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * .google.showcase.v1beta1.EchoErrorDetailsResponse.MultipleDetails multiple_details = 2; + * + * + * @return The multipleDetails. + */ + public com.google.showcase.v1beta1.EchoErrorDetailsResponse.MultipleDetails + getMultipleDetails() { + if (multipleDetailsBuilder_ == null) { + return multipleDetails_ == null + ? com.google.showcase.v1beta1.EchoErrorDetailsResponse.MultipleDetails + .getDefaultInstance() + : multipleDetails_; + } else { + return multipleDetailsBuilder_.getMessage(); + } + } + + /** + * .google.showcase.v1beta1.EchoErrorDetailsResponse.MultipleDetails multiple_details = 2; + * + */ + public Builder setMultipleDetails( + com.google.showcase.v1beta1.EchoErrorDetailsResponse.MultipleDetails value) { + if (multipleDetailsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + multipleDetails_ = value; + } else { + multipleDetailsBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * .google.showcase.v1beta1.EchoErrorDetailsResponse.MultipleDetails multiple_details = 2; + * + */ + public Builder setMultipleDetails( + com.google.showcase.v1beta1.EchoErrorDetailsResponse.MultipleDetails.Builder + builderForValue) { + if (multipleDetailsBuilder_ == null) { + multipleDetails_ = builderForValue.build(); + } else { + multipleDetailsBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * .google.showcase.v1beta1.EchoErrorDetailsResponse.MultipleDetails multiple_details = 2; + * + */ + public Builder mergeMultipleDetails( + com.google.showcase.v1beta1.EchoErrorDetailsResponse.MultipleDetails value) { + if (multipleDetailsBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && multipleDetails_ != null + && multipleDetails_ + != com.google.showcase.v1beta1.EchoErrorDetailsResponse.MultipleDetails + .getDefaultInstance()) { + getMultipleDetailsBuilder().mergeFrom(value); + } else { + multipleDetails_ = value; + } + } else { + multipleDetailsBuilder_.mergeFrom(value); + } + if (multipleDetails_ != null) { + bitField0_ |= 0x00000002; + onChanged(); + } + return this; + } + + /** + * .google.showcase.v1beta1.EchoErrorDetailsResponse.MultipleDetails multiple_details = 2; + * + */ + public Builder clearMultipleDetails() { + bitField0_ = (bitField0_ & ~0x00000002); + multipleDetails_ = null; + if (multipleDetailsBuilder_ != null) { + multipleDetailsBuilder_.dispose(); + multipleDetailsBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * .google.showcase.v1beta1.EchoErrorDetailsResponse.MultipleDetails multiple_details = 2; + * + */ + public com.google.showcase.v1beta1.EchoErrorDetailsResponse.MultipleDetails.Builder + getMultipleDetailsBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return getMultipleDetailsFieldBuilder().getBuilder(); + } + + /** + * .google.showcase.v1beta1.EchoErrorDetailsResponse.MultipleDetails multiple_details = 2; + * + */ + public com.google.showcase.v1beta1.EchoErrorDetailsResponse.MultipleDetailsOrBuilder + getMultipleDetailsOrBuilder() { + if (multipleDetailsBuilder_ != null) { + return multipleDetailsBuilder_.getMessageOrBuilder(); + } else { + return multipleDetails_ == null + ? com.google.showcase.v1beta1.EchoErrorDetailsResponse.MultipleDetails + .getDefaultInstance() + : multipleDetails_; + } + } + + /** + * .google.showcase.v1beta1.EchoErrorDetailsResponse.MultipleDetails multiple_details = 2; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.showcase.v1beta1.EchoErrorDetailsResponse.MultipleDetails, + com.google.showcase.v1beta1.EchoErrorDetailsResponse.MultipleDetails.Builder, + com.google.showcase.v1beta1.EchoErrorDetailsResponse.MultipleDetailsOrBuilder> + getMultipleDetailsFieldBuilder() { + if (multipleDetailsBuilder_ == null) { + multipleDetailsBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.showcase.v1beta1.EchoErrorDetailsResponse.MultipleDetails, + com.google.showcase.v1beta1.EchoErrorDetailsResponse.MultipleDetails.Builder, + com.google.showcase.v1beta1.EchoErrorDetailsResponse.MultipleDetailsOrBuilder>( + getMultipleDetails(), getParentForChildren(), isClean()); + multipleDetails_ = null; + } + return multipleDetailsBuilder_; + } + + @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.showcase.v1beta1.EchoErrorDetailsResponse) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.EchoErrorDetailsResponse) + private static final com.google.showcase.v1beta1.EchoErrorDetailsResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.EchoErrorDetailsResponse(); + } + + public static com.google.showcase.v1beta1.EchoErrorDetailsResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public EchoErrorDetailsResponse 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.showcase.v1beta1.EchoErrorDetailsResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/EchoErrorDetailsResponseOrBuilder.java b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/EchoErrorDetailsResponseOrBuilder.java new file mode 100644 index 0000000000..f7d1dc0eef --- /dev/null +++ b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/EchoErrorDetailsResponseOrBuilder.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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/echo.proto + +// Protobuf Java Version: 3.25.8 +package com.google.showcase.v1beta1; + +public interface EchoErrorDetailsResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.EchoErrorDetailsResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * .google.showcase.v1beta1.EchoErrorDetailsResponse.SingleDetail single_detail = 1; + * + * @return Whether the singleDetail field is set. + */ + boolean hasSingleDetail(); + + /** + * .google.showcase.v1beta1.EchoErrorDetailsResponse.SingleDetail single_detail = 1; + * + * @return The singleDetail. + */ + com.google.showcase.v1beta1.EchoErrorDetailsResponse.SingleDetail getSingleDetail(); + + /** + * .google.showcase.v1beta1.EchoErrorDetailsResponse.SingleDetail single_detail = 1; + */ + com.google.showcase.v1beta1.EchoErrorDetailsResponse.SingleDetailOrBuilder + getSingleDetailOrBuilder(); + + /** + * .google.showcase.v1beta1.EchoErrorDetailsResponse.MultipleDetails multiple_details = 2; + * + * + * @return Whether the multipleDetails field is set. + */ + boolean hasMultipleDetails(); + + /** + * .google.showcase.v1beta1.EchoErrorDetailsResponse.MultipleDetails multiple_details = 2; + * + * + * @return The multipleDetails. + */ + com.google.showcase.v1beta1.EchoErrorDetailsResponse.MultipleDetails getMultipleDetails(); + + /** + * .google.showcase.v1beta1.EchoErrorDetailsResponse.MultipleDetails multiple_details = 2; + * + */ + com.google.showcase.v1beta1.EchoErrorDetailsResponse.MultipleDetailsOrBuilder + getMultipleDetailsOrBuilder(); +} diff --git a/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/EchoOuterClass.java b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/EchoOuterClass.java new file mode 100644 index 0000000000..82e0ab50fc --- /dev/null +++ b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/EchoOuterClass.java @@ -0,0 +1,507 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/echo.proto + +// Protobuf Java Version: 3.25.8 +package com.google.showcase.v1beta1; + +public final class EchoOuterClass { + private EchoOuterClass() {} + + 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_showcase_v1beta1_EchoRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_showcase_v1beta1_EchoRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_showcase_v1beta1_EchoResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_showcase_v1beta1_EchoResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_showcase_v1beta1_EchoErrorDetailsRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_showcase_v1beta1_EchoErrorDetailsRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_showcase_v1beta1_EchoErrorDetailsResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_showcase_v1beta1_EchoErrorDetailsResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_showcase_v1beta1_EchoErrorDetailsResponse_SingleDetail_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_showcase_v1beta1_EchoErrorDetailsResponse_SingleDetail_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_showcase_v1beta1_EchoErrorDetailsResponse_MultipleDetails_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_showcase_v1beta1_EchoErrorDetailsResponse_MultipleDetails_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_showcase_v1beta1_ErrorWithSingleDetail_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_showcase_v1beta1_ErrorWithSingleDetail_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_showcase_v1beta1_ErrorWithMultipleDetails_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_showcase_v1beta1_ErrorWithMultipleDetails_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_showcase_v1beta1_PoetryError_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_showcase_v1beta1_PoetryError_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_showcase_v1beta1_FailEchoWithDetailsRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_showcase_v1beta1_FailEchoWithDetailsRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_showcase_v1beta1_FailEchoWithDetailsResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_showcase_v1beta1_FailEchoWithDetailsResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_showcase_v1beta1_ExpandRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_showcase_v1beta1_ExpandRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_showcase_v1beta1_PagedExpandRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_showcase_v1beta1_PagedExpandRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_showcase_v1beta1_PagedExpandLegacyRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_showcase_v1beta1_PagedExpandLegacyRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_showcase_v1beta1_PagedExpandResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_showcase_v1beta1_PagedExpandResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_showcase_v1beta1_PagedExpandResponseList_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_showcase_v1beta1_PagedExpandResponseList_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_showcase_v1beta1_PagedExpandLegacyMappedResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_showcase_v1beta1_PagedExpandLegacyMappedResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_showcase_v1beta1_PagedExpandLegacyMappedResponse_AlphabetizedEntry_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_showcase_v1beta1_PagedExpandLegacyMappedResponse_AlphabetizedEntry_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_showcase_v1beta1_WaitRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_showcase_v1beta1_WaitRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_showcase_v1beta1_WaitResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_showcase_v1beta1_WaitResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_showcase_v1beta1_WaitMetadata_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_showcase_v1beta1_WaitMetadata_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_showcase_v1beta1_BlockRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_showcase_v1beta1_BlockRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_showcase_v1beta1_BlockResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_showcase_v1beta1_BlockResponse_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" + + ")schema/google/showcase/v1beta1/echo.pr" + + "oto\022\027google.showcase.v1beta1\032\034google/api" + + "/annotations.proto\032\027google/api/client.pr" + + "oto\032\037google/api/field_behavior.proto\032\033go" + + "ogle/api/field_info.proto\032\030google/api/ro" + + "uting.proto\032#google/longrunning/operatio" + + "ns.proto\032\031google/protobuf/any.proto\032\036goo" + + "gle/protobuf/duration.proto\032\037google/prot" + + "obuf/timestamp.proto\032\027google/rpc/status.proto\"\210\002\n" + + "\013EchoRequest\022\021\n" + + "\007content\030\001 \001(\tH\000\022#\n" + + "\005error\030\002 \001(\0132\022.google.rpc.StatusH\000\0223\n" + + "\010severity\030\003 \001(\0162!.google.showcase.v1beta1.Severity\022\016\n" + + "\006header\030\004 \001(\t\022\024\n" + + "\014other_header\030\005 \001(\t\022\034\n\n" + + "request_id\030\007 \001(\tB\010\342\214\317\327\010\002\010\001\022\'\n" + + "\020other_request_id\030\010 \001(" + + "\tB\010\342\214\317\327\010\002\010\001H\001\210\001\001B\n\n" + + "\010responseB\023\n" + + "\021_other_request_id\"\202\001\n" + + "\014EchoResponse\022\017\n" + + "\007content\030\001 \001(\t\0223\n" + + "\010severity\030\002 \001(\0162!.google.showcase.v1beta1.Severity\022\022\n\n" + + "request_id\030\003 \001(\t\022\030\n" + + "\020other_request_id\030\004 \001(\t\"P\n" + + "\027EchoErrorDetailsRequest\022\032\n" + + "\022single_detail_text\030\001 \001(\t\022\031\n" + + "\021multi_detail_text\030\002 \003(\t\"\362\002\n" + + "\030EchoErrorDetailsResponse\022U\n\r" + + "single_detail\030\001 \001(\0132>.google.showcase.v1" + + "beta1.EchoErrorDetailsResponse.SingleDetail\022[\n" + + "\020multiple_details\030\002 \001(\0132A.google.s" + + "howcase.v1beta1.EchoErrorDetailsResponse.MultipleDetails\032M\n" + + "\014SingleDetail\022=\n" + + "\005error\030\001 \001(\0132..google.showcase.v1beta1.ErrorWithSingleDetail\032S\n" + + "\017MultipleDetails\022@\n" + + "\005error\030\001 \001(\01321.google.showcase.v1beta1.ErrorWithMultipleDetails\">\n" + + "\025ErrorWithSingleDetail\022%\n" + + "\007details\030\001 \001(\0132\024.google.protobuf.Any\"A\n" + + "\030ErrorWithMultipleDetails\022%\n" + + "\007details\030\001 \003(\0132\024.google.protobuf.Any\"\033\n" + + "\013PoetryError\022\014\n" + + "\004poem\030\001 \001(\t\"-\n" + + "\032FailEchoWithDetailsRequest\022\017\n" + + "\007message\030\001 \001(\t\"\035\n" + + "\033FailEchoWithDetailsResponse\"x\n\r" + + "ExpandRequest\022\017\n" + + "\007content\030\001 \001(\t\022!\n" + + "\005error\030\002 \001(\0132\022.google.rpc.Status\0223\n" + + "\020stream_wait_time\030\003 \001(\0132\031.google.protobuf.Duration\"Q\n" + + "\022PagedExpandRequest\022\024\n" + + "\007content\030\001 \001(\tB\003\340A\002\022\021\n" + + "\tpage_size\030\002 \001(\005\022\022\n\n" + + "page_token\030\003 \001(\t\"Y\n" + + "\030PagedExpandLegacyRequest\022\024\n" + + "\007content\030\001 \001(\tB\003\340A\002\022\023\n" + + "\013max_results\030\002 \001(\005\022\022\n\n" + + "page_token\030\003 \001(\t\"h\n" + + "\023PagedExpandResponse\0228\n" + + "\tresponses\030\001 \003(\0132%.google.showcase.v1beta1.EchoResponse\022\027\n" + + "\017next_page_token\030\002 \001(\t\"(\n" + + "\027PagedExpandResponseList\022\r\n" + + "\005words\030\001 \003(\t\"\203\002\n" + + "\037PagedExpandLegacyMappedResponse\022`\n" + + "\014alphabetized\030\001 \003(\013" + + "2J.google.showcase.v1beta1.PagedExpandLegacyMappedResponse.AlphabetizedEntry\022\027\n" + + "\017next_page_token\030\002 \001(\t\032e\n" + + "\021AlphabetizedEntry\022\013\n" + + "\003key\030\001 \001(\t\022?\n" + + "\005value\030\002 \001(\01320.google." + + "showcase.v1beta1.PagedExpandResponseList:\0028\001\"\331\001\n" + + "\013WaitRequest\022.\n" + + "\010end_time\030\001 \001(\0132\032.google.protobuf.TimestampH\000\022(\n" + + "\003ttl\030\004 \001(\0132\031.google.protobuf.DurationH\000\022#\n" + + "\005error\030\002 \001(\0132\022.google.rpc.StatusH\001\0228\n" + + "\007success\030\003 \001(\0132%.google.showcase.v1beta1.WaitResponseH\001B\005\n" + + "\003endB\n\n" + + "\010response\"\037\n" + + "\014WaitResponse\022\017\n" + + "\007content\030\001 \001(\t\"<\n" + + "\014WaitMetadata\022,\n" + + "\010end_time\030\001 \001(\0132\032.google.protobuf.Timestamp\"\255\001\n" + + "\014BlockRequest\0221\n" + + "\016response_delay\030\001 \001(\0132\031.google.protobuf.Duration\022#\n" + + "\005error\030\002 \001(\0132\022.google.rpc.StatusH\000\0229\n" + + "\007success\030\003 \001(\0132&.google.showcase.v1beta1.BlockResponseH\000B\n\n" + + "\010response\" \n\r" + + "BlockResponse\022\017\n" + + "\007content\030\001 \001(\t*D\n" + + "\010Severity\022\017\n" + + "\013UNNECESSARY\020\000\022\r" + + "\n" + + "\tNECESSARY\020\001\022\n\n" + + "\006URGENT\020\002\022\014\n" + + "\010CRITICAL\020\0032\337\016\n" + + "\004Echo\022\224\003\n" + + "\004Echo\022$.google.showcase.v1beta1.EchoRequest\032%.google.showcase.v1beta" + + "1.EchoResponse\"\276\002\202\323\344\223\002\027\"\022/v1beta1/echo:echo:\001*\212\323\344\223\002\232\002\022\010\n" + + "\006header\022\031\n" + + "\006header\022\017{routing_id=**}\022+\n" + + "\006header\022!{table_name=regions/*/zones/*/**}\022\"\n" + + "\006header\022\030{super_id=projects/*}/**\0220\n" + + "\006header\022&{table_name=projects/*/instances/*/**}\0221\n" + + "\006header\022\'projects/*/{instance_id=instances/*}/**\022\030\n" + + "\014other_header\022\010{baz=**}\022#\n" + + "\014other_header\022\023{qux=projects/*}/**\022\237\001\n" + + "\020EchoErrorDetails\0220.google.showcase.v1beta1.EchoErrorDetailsR" + + "equest\0321.google.showcase.v1beta1.EchoErrorDetailsResponse\"&\202\323\344\223\002" + + " \"\033/v1beta1/echo:error-details:\001*\022\252\001\n" + + "\023FailEchoWithDetails\0223.google.showcase.v1beta1.FailEchoWith" + + "DetailsRequest\0324.google.showcase.v1beta1" + + ".FailEchoWithDetailsResponse\"(\202\323\344\223\002\"\"\035/v1beta1/echo:failWithDetails:\001*\022\212\001\n" + + "\006Expand\022&.google.showcase.v1beta1.ExpandReques" + + "t\032%.google.showcase.v1beta1.EchoResponse\"/\332A\r" + + "content,error\202\323\344\223\002\031\"\024/v1beta1/echo:expand:\001*0\001\022z\n" + + "\007Collect\022$.google.showcase" + + ".v1beta1.EchoRequest\032%.google.showcase.v1beta1.EchoResponse\"" + + " \202\323\344\223\002\032\"\025/v1beta1/echo:collect:\001*(\001\022W\n" + + "\004Chat\022$.google.showcas" + + "e.v1beta1.EchoRequest\032%.google.showcase.v1beta1.EchoResponse(\0010\001\022\216\001\n" + + "\013PagedExpand\022+.google.showcase.v1beta1.PagedExpandRe" + + "quest\032,.google.showcase.v1beta1.PagedExp" + + "andResponse\"$\202\323\344\223\002\036\"\031/v1beta1/echo:pagedExpand:\001*\022\240\001\n" + + "\021PagedExpandLegacy\0221.google.showcase.v1beta1.PagedExpandLegacyReque" + + "st\032,.google.showcase.v1beta1.PagedExpand" + + "Response\"*\202\323\344\223\002$\"\037/v1beta1/echo:pagedExpandLegacy:\001*\022\262\001\n" + + "\027PagedExpandLegacyMapped\022+.google.showcase.v1beta1.PagedExpandRe" + + "quest\0328.google.showcase.v1beta1.PagedExp" + + "andLegacyMappedResponse\"0\202\323\344\223\002*\"%/v1beta1/echo:pagedExpandLegacyMapped:\001*\022\211\001\n" + + "\004Wa" + + "it\022$.google.showcase.v1beta1.WaitRequest\032\035.google.longrunning.Operation\"<\312A\034\n" + + "\014Wa" + + "itResponse\022\014WaitMetadata\202\323\344\223\002\027\"\022/v1beta1/echo:wait:\001*\022v\n" + + "\005Block\022%.google.showcase.v1beta1.BlockRequest\032&.google.showcase." + + "v1beta1.BlockResponse\"\036\202\323\344\223\002\030\"\023/v1beta1/" + + "echo:block:\001*\032\"\312A\016localhost:7469\212\324\333\322\017\013v1_20240408Bq\n" + + "\033com.google.showcase.v1beta1P\001Z4github.com/googleapis/gapic-showcase" + + "/server/genproto\352\002\031Google::Showcase::V1beta1b\006proto3" + }; + descriptor = + com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( + descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + com.google.api.AnnotationsProto.getDescriptor(), + com.google.api.ClientProto.getDescriptor(), + com.google.api.FieldBehaviorProto.getDescriptor(), + com.google.api.FieldInfoProto.getDescriptor(), + com.google.api.RoutingProto.getDescriptor(), + com.google.longrunning.OperationsProto.getDescriptor(), + com.google.protobuf.AnyProto.getDescriptor(), + com.google.protobuf.DurationProto.getDescriptor(), + com.google.protobuf.TimestampProto.getDescriptor(), + com.google.rpc.StatusProto.getDescriptor(), + }); + internal_static_google_showcase_v1beta1_EchoRequest_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_showcase_v1beta1_EchoRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_showcase_v1beta1_EchoRequest_descriptor, + new java.lang.String[] { + "Content", + "Error", + "Severity", + "Header", + "OtherHeader", + "RequestId", + "OtherRequestId", + "Response", + }); + internal_static_google_showcase_v1beta1_EchoResponse_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_google_showcase_v1beta1_EchoResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_showcase_v1beta1_EchoResponse_descriptor, + new java.lang.String[] { + "Content", "Severity", "RequestId", "OtherRequestId", + }); + internal_static_google_showcase_v1beta1_EchoErrorDetailsRequest_descriptor = + getDescriptor().getMessageTypes().get(2); + internal_static_google_showcase_v1beta1_EchoErrorDetailsRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_showcase_v1beta1_EchoErrorDetailsRequest_descriptor, + new java.lang.String[] { + "SingleDetailText", "MultiDetailText", + }); + internal_static_google_showcase_v1beta1_EchoErrorDetailsResponse_descriptor = + getDescriptor().getMessageTypes().get(3); + internal_static_google_showcase_v1beta1_EchoErrorDetailsResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_showcase_v1beta1_EchoErrorDetailsResponse_descriptor, + new java.lang.String[] { + "SingleDetail", "MultipleDetails", + }); + internal_static_google_showcase_v1beta1_EchoErrorDetailsResponse_SingleDetail_descriptor = + internal_static_google_showcase_v1beta1_EchoErrorDetailsResponse_descriptor + .getNestedTypes() + .get(0); + internal_static_google_showcase_v1beta1_EchoErrorDetailsResponse_SingleDetail_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_showcase_v1beta1_EchoErrorDetailsResponse_SingleDetail_descriptor, + new java.lang.String[] { + "Error", + }); + internal_static_google_showcase_v1beta1_EchoErrorDetailsResponse_MultipleDetails_descriptor = + internal_static_google_showcase_v1beta1_EchoErrorDetailsResponse_descriptor + .getNestedTypes() + .get(1); + internal_static_google_showcase_v1beta1_EchoErrorDetailsResponse_MultipleDetails_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_showcase_v1beta1_EchoErrorDetailsResponse_MultipleDetails_descriptor, + new java.lang.String[] { + "Error", + }); + internal_static_google_showcase_v1beta1_ErrorWithSingleDetail_descriptor = + getDescriptor().getMessageTypes().get(4); + internal_static_google_showcase_v1beta1_ErrorWithSingleDetail_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_showcase_v1beta1_ErrorWithSingleDetail_descriptor, + new java.lang.String[] { + "Details", + }); + internal_static_google_showcase_v1beta1_ErrorWithMultipleDetails_descriptor = + getDescriptor().getMessageTypes().get(5); + internal_static_google_showcase_v1beta1_ErrorWithMultipleDetails_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_showcase_v1beta1_ErrorWithMultipleDetails_descriptor, + new java.lang.String[] { + "Details", + }); + internal_static_google_showcase_v1beta1_PoetryError_descriptor = + getDescriptor().getMessageTypes().get(6); + internal_static_google_showcase_v1beta1_PoetryError_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_showcase_v1beta1_PoetryError_descriptor, + new java.lang.String[] { + "Poem", + }); + internal_static_google_showcase_v1beta1_FailEchoWithDetailsRequest_descriptor = + getDescriptor().getMessageTypes().get(7); + internal_static_google_showcase_v1beta1_FailEchoWithDetailsRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_showcase_v1beta1_FailEchoWithDetailsRequest_descriptor, + new java.lang.String[] { + "Message", + }); + internal_static_google_showcase_v1beta1_FailEchoWithDetailsResponse_descriptor = + getDescriptor().getMessageTypes().get(8); + internal_static_google_showcase_v1beta1_FailEchoWithDetailsResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_showcase_v1beta1_FailEchoWithDetailsResponse_descriptor, + new java.lang.String[] {}); + internal_static_google_showcase_v1beta1_ExpandRequest_descriptor = + getDescriptor().getMessageTypes().get(9); + internal_static_google_showcase_v1beta1_ExpandRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_showcase_v1beta1_ExpandRequest_descriptor, + new java.lang.String[] { + "Content", "Error", "StreamWaitTime", + }); + internal_static_google_showcase_v1beta1_PagedExpandRequest_descriptor = + getDescriptor().getMessageTypes().get(10); + internal_static_google_showcase_v1beta1_PagedExpandRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_showcase_v1beta1_PagedExpandRequest_descriptor, + new java.lang.String[] { + "Content", "PageSize", "PageToken", + }); + internal_static_google_showcase_v1beta1_PagedExpandLegacyRequest_descriptor = + getDescriptor().getMessageTypes().get(11); + internal_static_google_showcase_v1beta1_PagedExpandLegacyRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_showcase_v1beta1_PagedExpandLegacyRequest_descriptor, + new java.lang.String[] { + "Content", "MaxResults", "PageToken", + }); + internal_static_google_showcase_v1beta1_PagedExpandResponse_descriptor = + getDescriptor().getMessageTypes().get(12); + internal_static_google_showcase_v1beta1_PagedExpandResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_showcase_v1beta1_PagedExpandResponse_descriptor, + new java.lang.String[] { + "Responses", "NextPageToken", + }); + internal_static_google_showcase_v1beta1_PagedExpandResponseList_descriptor = + getDescriptor().getMessageTypes().get(13); + internal_static_google_showcase_v1beta1_PagedExpandResponseList_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_showcase_v1beta1_PagedExpandResponseList_descriptor, + new java.lang.String[] { + "Words", + }); + internal_static_google_showcase_v1beta1_PagedExpandLegacyMappedResponse_descriptor = + getDescriptor().getMessageTypes().get(14); + internal_static_google_showcase_v1beta1_PagedExpandLegacyMappedResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_showcase_v1beta1_PagedExpandLegacyMappedResponse_descriptor, + new java.lang.String[] { + "Alphabetized", "NextPageToken", + }); + internal_static_google_showcase_v1beta1_PagedExpandLegacyMappedResponse_AlphabetizedEntry_descriptor = + internal_static_google_showcase_v1beta1_PagedExpandLegacyMappedResponse_descriptor + .getNestedTypes() + .get(0); + internal_static_google_showcase_v1beta1_PagedExpandLegacyMappedResponse_AlphabetizedEntry_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_showcase_v1beta1_PagedExpandLegacyMappedResponse_AlphabetizedEntry_descriptor, + new java.lang.String[] { + "Key", "Value", + }); + internal_static_google_showcase_v1beta1_WaitRequest_descriptor = + getDescriptor().getMessageTypes().get(15); + internal_static_google_showcase_v1beta1_WaitRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_showcase_v1beta1_WaitRequest_descriptor, + new java.lang.String[] { + "EndTime", "Ttl", "Error", "Success", "End", "Response", + }); + internal_static_google_showcase_v1beta1_WaitResponse_descriptor = + getDescriptor().getMessageTypes().get(16); + internal_static_google_showcase_v1beta1_WaitResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_showcase_v1beta1_WaitResponse_descriptor, + new java.lang.String[] { + "Content", + }); + internal_static_google_showcase_v1beta1_WaitMetadata_descriptor = + getDescriptor().getMessageTypes().get(17); + internal_static_google_showcase_v1beta1_WaitMetadata_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_showcase_v1beta1_WaitMetadata_descriptor, + new java.lang.String[] { + "EndTime", + }); + internal_static_google_showcase_v1beta1_BlockRequest_descriptor = + getDescriptor().getMessageTypes().get(18); + internal_static_google_showcase_v1beta1_BlockRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_showcase_v1beta1_BlockRequest_descriptor, + new java.lang.String[] { + "ResponseDelay", "Error", "Success", "Response", + }); + internal_static_google_showcase_v1beta1_BlockResponse_descriptor = + getDescriptor().getMessageTypes().get(19); + internal_static_google_showcase_v1beta1_BlockResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_showcase_v1beta1_BlockResponse_descriptor, + new java.lang.String[] { + "Content", + }); + com.google.protobuf.ExtensionRegistry registry = + com.google.protobuf.ExtensionRegistry.newInstance(); + registry.add(com.google.api.ClientProto.apiVersion); + registry.add(com.google.api.ClientProto.defaultHost); + registry.add(com.google.api.FieldBehaviorProto.fieldBehavior); + registry.add(com.google.api.FieldInfoProto.fieldInfo); + registry.add(com.google.api.AnnotationsProto.http); + registry.add(com.google.api.ClientProto.methodSignature); + registry.add(com.google.api.RoutingProto.routing); + 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.FieldInfoProto.getDescriptor(); + com.google.api.RoutingProto.getDescriptor(); + com.google.longrunning.OperationsProto.getDescriptor(); + com.google.protobuf.AnyProto.getDescriptor(); + com.google.protobuf.DurationProto.getDescriptor(); + com.google.protobuf.TimestampProto.getDescriptor(); + com.google.rpc.StatusProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/EchoRequest.java b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/EchoRequest.java new file mode 100644 index 0000000000..48854d9a4e --- /dev/null +++ b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/EchoRequest.java @@ -0,0 +1,2021 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/echo.proto + +// Protobuf Java Version: 3.25.8 +package com.google.showcase.v1beta1; + +/** + * + * + *
        + * The request message used for the Echo, Collect and Chat methods.
        + * If content or opt are set in this message then the request will succeed.
        + * If status is set in this message then the status will be returned as an
        + * error.
        + * 
        + * + * Protobuf type {@code google.showcase.v1beta1.EchoRequest} + */ +public final class EchoRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.EchoRequest) + EchoRequestOrBuilder { + private static final long serialVersionUID = 0L; + + // Use EchoRequest.newBuilder() to construct. + private EchoRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private EchoRequest() { + severity_ = 0; + header_ = ""; + otherHeader_ = ""; + requestId_ = ""; + otherRequestId_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new EchoRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.EchoOuterClass + .internal_static_google_showcase_v1beta1_EchoRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.EchoOuterClass + .internal_static_google_showcase_v1beta1_EchoRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.EchoRequest.class, + com.google.showcase.v1beta1.EchoRequest.Builder.class); + } + + private int bitField0_; + private int responseCase_ = 0; + + @SuppressWarnings("serial") + private java.lang.Object response_; + + public enum ResponseCase + implements + com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + CONTENT(1), + ERROR(2), + RESPONSE_NOT_SET(0); + private final int value; + + private ResponseCase(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 ResponseCase valueOf(int value) { + return forNumber(value); + } + + public static ResponseCase forNumber(int value) { + switch (value) { + case 1: + return CONTENT; + case 2: + return ERROR; + case 0: + return RESPONSE_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public ResponseCase getResponseCase() { + return ResponseCase.forNumber(responseCase_); + } + + public static final int CONTENT_FIELD_NUMBER = 1; + + /** + * + * + *
        +   * The content to be echoed by the server.
        +   * 
        + * + * string content = 1; + * + * @return Whether the content field is set. + */ + public boolean hasContent() { + return responseCase_ == 1; + } + + /** + * + * + *
        +   * The content to be echoed by the server.
        +   * 
        + * + * string content = 1; + * + * @return The content. + */ + public java.lang.String getContent() { + java.lang.Object ref = ""; + if (responseCase_ == 1) { + ref = response_; + } + 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 (responseCase_ == 1) { + response_ = s; + } + return s; + } + } + + /** + * + * + *
        +   * The content to be echoed by the server.
        +   * 
        + * + * string content = 1; + * + * @return The bytes for content. + */ + public com.google.protobuf.ByteString getContentBytes() { + java.lang.Object ref = ""; + if (responseCase_ == 1) { + ref = response_; + } + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + if (responseCase_ == 1) { + response_ = b; + } + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int ERROR_FIELD_NUMBER = 2; + + /** + * + * + *
        +   * The error to be thrown by the server.
        +   * 
        + * + * .google.rpc.Status error = 2; + * + * @return Whether the error field is set. + */ + @java.lang.Override + public boolean hasError() { + return responseCase_ == 2; + } + + /** + * + * + *
        +   * The error to be thrown by the server.
        +   * 
        + * + * .google.rpc.Status error = 2; + * + * @return The error. + */ + @java.lang.Override + public com.google.rpc.Status getError() { + if (responseCase_ == 2) { + return (com.google.rpc.Status) response_; + } + return com.google.rpc.Status.getDefaultInstance(); + } + + /** + * + * + *
        +   * The error to be thrown by the server.
        +   * 
        + * + * .google.rpc.Status error = 2; + */ + @java.lang.Override + public com.google.rpc.StatusOrBuilder getErrorOrBuilder() { + if (responseCase_ == 2) { + return (com.google.rpc.Status) response_; + } + return com.google.rpc.Status.getDefaultInstance(); + } + + public static final int SEVERITY_FIELD_NUMBER = 3; + private int severity_ = 0; + + /** + * + * + *
        +   * The severity to be echoed by the server.
        +   * 
        + * + * .google.showcase.v1beta1.Severity severity = 3; + * + * @return The enum numeric value on the wire for severity. + */ + @java.lang.Override + public int getSeverityValue() { + return severity_; + } + + /** + * + * + *
        +   * The severity to be echoed by the server.
        +   * 
        + * + * .google.showcase.v1beta1.Severity severity = 3; + * + * @return The severity. + */ + @java.lang.Override + public com.google.showcase.v1beta1.Severity getSeverity() { + com.google.showcase.v1beta1.Severity result = + com.google.showcase.v1beta1.Severity.forNumber(severity_); + return result == null ? com.google.showcase.v1beta1.Severity.UNRECOGNIZED : result; + } + + public static final int HEADER_FIELD_NUMBER = 4; + + @SuppressWarnings("serial") + private volatile java.lang.Object header_ = ""; + + /** + * + * + *
        +   * Optional. This field can be set to test the routing annotation on the Echo method.
        +   * 
        + * + * string header = 4; + * + * @return The header. + */ + @java.lang.Override + public java.lang.String getHeader() { + java.lang.Object ref = header_; + 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(); + header_ = s; + return s; + } + } + + /** + * + * + *
        +   * Optional. This field can be set to test the routing annotation on the Echo method.
        +   * 
        + * + * string header = 4; + * + * @return The bytes for header. + */ + @java.lang.Override + public com.google.protobuf.ByteString getHeaderBytes() { + java.lang.Object ref = header_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + header_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int OTHER_HEADER_FIELD_NUMBER = 5; + + @SuppressWarnings("serial") + private volatile java.lang.Object otherHeader_ = ""; + + /** + * + * + *
        +   * Optional. This field can be set to test the routing annotation on the Echo method.
        +   * 
        + * + * string other_header = 5; + * + * @return The otherHeader. + */ + @java.lang.Override + public java.lang.String getOtherHeader() { + java.lang.Object ref = otherHeader_; + 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(); + otherHeader_ = s; + return s; + } + } + + /** + * + * + *
        +   * Optional. This field can be set to test the routing annotation on the Echo method.
        +   * 
        + * + * string other_header = 5; + * + * @return The bytes for otherHeader. + */ + @java.lang.Override + public com.google.protobuf.ByteString getOtherHeaderBytes() { + java.lang.Object ref = otherHeader_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + otherHeader_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int REQUEST_ID_FIELD_NUMBER = 7; + + @SuppressWarnings("serial") + private volatile java.lang.Object requestId_ = ""; + + /** + * + * + *
        +   * To facilitate testing of https://google.aip.dev/client-libraries/4235
        +   * 
        + * + * string request_id = 7 [(.google.api.field_info) = { ... } + * + * @return The requestId. + */ + @java.lang.Override + public java.lang.String getRequestId() { + java.lang.Object ref = requestId_; + 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(); + requestId_ = s; + return s; + } + } + + /** + * + * + *
        +   * To facilitate testing of https://google.aip.dev/client-libraries/4235
        +   * 
        + * + * string request_id = 7 [(.google.api.field_info) = { ... } + * + * @return The bytes for requestId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getRequestIdBytes() { + java.lang.Object ref = requestId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + requestId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int OTHER_REQUEST_ID_FIELD_NUMBER = 8; + + @SuppressWarnings("serial") + private volatile java.lang.Object otherRequestId_ = ""; + + /** + * + * + *
        +   * To facilitate testing of https://google.aip.dev/client-libraries/4235
        +   * 
        + * + * optional string other_request_id = 8 [(.google.api.field_info) = { ... } + * + * @return Whether the otherRequestId field is set. + */ + @java.lang.Override + public boolean hasOtherRequestId() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
        +   * To facilitate testing of https://google.aip.dev/client-libraries/4235
        +   * 
        + * + * optional string other_request_id = 8 [(.google.api.field_info) = { ... } + * + * @return The otherRequestId. + */ + @java.lang.Override + public java.lang.String getOtherRequestId() { + java.lang.Object ref = otherRequestId_; + 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(); + otherRequestId_ = s; + return s; + } + } + + /** + * + * + *
        +   * To facilitate testing of https://google.aip.dev/client-libraries/4235
        +   * 
        + * + * optional string other_request_id = 8 [(.google.api.field_info) = { ... } + * + * @return The bytes for otherRequestId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getOtherRequestIdBytes() { + java.lang.Object ref = otherRequestId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + otherRequestId_ = 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 (responseCase_ == 1) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, response_); + } + if (responseCase_ == 2) { + output.writeMessage(2, (com.google.rpc.Status) response_); + } + if (severity_ != com.google.showcase.v1beta1.Severity.UNNECESSARY.getNumber()) { + output.writeEnum(3, severity_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(header_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, header_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(otherHeader_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 5, otherHeader_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(requestId_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 7, requestId_); + } + if (((bitField0_ & 0x00000001) != 0)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 8, otherRequestId_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (responseCase_ == 1) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, response_); + } + if (responseCase_ == 2) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 2, (com.google.rpc.Status) response_); + } + if (severity_ != com.google.showcase.v1beta1.Severity.UNNECESSARY.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(3, severity_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(header_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, header_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(otherHeader_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, otherHeader_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(requestId_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(7, requestId_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(8, otherRequestId_); + } + 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.showcase.v1beta1.EchoRequest)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.EchoRequest other = (com.google.showcase.v1beta1.EchoRequest) obj; + + if (severity_ != other.severity_) return false; + if (!getHeader().equals(other.getHeader())) return false; + if (!getOtherHeader().equals(other.getOtherHeader())) return false; + if (!getRequestId().equals(other.getRequestId())) return false; + if (hasOtherRequestId() != other.hasOtherRequestId()) return false; + if (hasOtherRequestId()) { + if (!getOtherRequestId().equals(other.getOtherRequestId())) return false; + } + if (!getResponseCase().equals(other.getResponseCase())) return false; + switch (responseCase_) { + case 1: + if (!getContent().equals(other.getContent())) return false; + break; + case 2: + if (!getError().equals(other.getError())) 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) + SEVERITY_FIELD_NUMBER; + hash = (53 * hash) + severity_; + hash = (37 * hash) + HEADER_FIELD_NUMBER; + hash = (53 * hash) + getHeader().hashCode(); + hash = (37 * hash) + OTHER_HEADER_FIELD_NUMBER; + hash = (53 * hash) + getOtherHeader().hashCode(); + hash = (37 * hash) + REQUEST_ID_FIELD_NUMBER; + hash = (53 * hash) + getRequestId().hashCode(); + if (hasOtherRequestId()) { + hash = (37 * hash) + OTHER_REQUEST_ID_FIELD_NUMBER; + hash = (53 * hash) + getOtherRequestId().hashCode(); + } + switch (responseCase_) { + case 1: + hash = (37 * hash) + CONTENT_FIELD_NUMBER; + hash = (53 * hash) + getContent().hashCode(); + break; + case 2: + hash = (37 * hash) + ERROR_FIELD_NUMBER; + hash = (53 * hash) + getError().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.showcase.v1beta1.EchoRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.EchoRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.EchoRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.EchoRequest 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.showcase.v1beta1.EchoRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.EchoRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.EchoRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.EchoRequest 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.showcase.v1beta1.EchoRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.EchoRequest 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.showcase.v1beta1.EchoRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.EchoRequest 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.showcase.v1beta1.EchoRequest 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 request message used for the Echo, Collect and Chat methods.
        +   * If content or opt are set in this message then the request will succeed.
        +   * If status is set in this message then the status will be returned as an
        +   * error.
        +   * 
        + * + * Protobuf type {@code google.showcase.v1beta1.EchoRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.EchoRequest) + com.google.showcase.v1beta1.EchoRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.EchoOuterClass + .internal_static_google_showcase_v1beta1_EchoRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.EchoOuterClass + .internal_static_google_showcase_v1beta1_EchoRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.EchoRequest.class, + com.google.showcase.v1beta1.EchoRequest.Builder.class); + } + + // Construct using com.google.showcase.v1beta1.EchoRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (errorBuilder_ != null) { + errorBuilder_.clear(); + } + severity_ = 0; + header_ = ""; + otherHeader_ = ""; + requestId_ = ""; + otherRequestId_ = ""; + responseCase_ = 0; + response_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.showcase.v1beta1.EchoOuterClass + .internal_static_google_showcase_v1beta1_EchoRequest_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.EchoRequest getDefaultInstanceForType() { + return com.google.showcase.v1beta1.EchoRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.EchoRequest build() { + com.google.showcase.v1beta1.EchoRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.EchoRequest buildPartial() { + com.google.showcase.v1beta1.EchoRequest result = + new com.google.showcase.v1beta1.EchoRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + buildPartialOneofs(result); + onBuilt(); + return result; + } + + private void buildPartial0(com.google.showcase.v1beta1.EchoRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000004) != 0)) { + result.severity_ = severity_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.header_ = header_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.otherHeader_ = otherHeader_; + } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.requestId_ = requestId_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000040) != 0)) { + result.otherRequestId_ = otherRequestId_; + to_bitField0_ |= 0x00000001; + } + result.bitField0_ |= to_bitField0_; + } + + private void buildPartialOneofs(com.google.showcase.v1beta1.EchoRequest result) { + result.responseCase_ = responseCase_; + result.response_ = this.response_; + if (responseCase_ == 2 && errorBuilder_ != null) { + result.response_ = errorBuilder_.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.showcase.v1beta1.EchoRequest) { + return mergeFrom((com.google.showcase.v1beta1.EchoRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.showcase.v1beta1.EchoRequest other) { + if (other == com.google.showcase.v1beta1.EchoRequest.getDefaultInstance()) return this; + if (other.severity_ != 0) { + setSeverityValue(other.getSeverityValue()); + } + if (!other.getHeader().isEmpty()) { + header_ = other.header_; + bitField0_ |= 0x00000008; + onChanged(); + } + if (!other.getOtherHeader().isEmpty()) { + otherHeader_ = other.otherHeader_; + bitField0_ |= 0x00000010; + onChanged(); + } + if (!other.getRequestId().isEmpty()) { + requestId_ = other.requestId_; + bitField0_ |= 0x00000020; + onChanged(); + } + if (other.hasOtherRequestId()) { + otherRequestId_ = other.otherRequestId_; + bitField0_ |= 0x00000040; + onChanged(); + } + switch (other.getResponseCase()) { + case CONTENT: + { + responseCase_ = 1; + response_ = other.response_; + onChanged(); + break; + } + case ERROR: + { + mergeError(other.getError()); + break; + } + case RESPONSE_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: + { + java.lang.String s = input.readStringRequireUtf8(); + responseCase_ = 1; + response_ = s; + break; + } // case 10 + case 18: + { + input.readMessage(getErrorFieldBuilder().getBuilder(), extensionRegistry); + responseCase_ = 2; + break; + } // case 18 + case 24: + { + severity_ = input.readEnum(); + bitField0_ |= 0x00000004; + break; + } // case 24 + case 34: + { + header_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000008; + break; + } // case 34 + case 42: + { + otherHeader_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000010; + break; + } // case 42 + case 58: + { + requestId_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000020; + break; + } // case 58 + case 66: + { + otherRequestId_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000040; + 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 responseCase_ = 0; + private java.lang.Object response_; + + public ResponseCase getResponseCase() { + return ResponseCase.forNumber(responseCase_); + } + + public Builder clearResponse() { + responseCase_ = 0; + response_ = null; + onChanged(); + return this; + } + + private int bitField0_; + + /** + * + * + *
        +     * The content to be echoed by the server.
        +     * 
        + * + * string content = 1; + * + * @return Whether the content field is set. + */ + @java.lang.Override + public boolean hasContent() { + return responseCase_ == 1; + } + + /** + * + * + *
        +     * The content to be echoed by the server.
        +     * 
        + * + * string content = 1; + * + * @return The content. + */ + @java.lang.Override + public java.lang.String getContent() { + java.lang.Object ref = ""; + if (responseCase_ == 1) { + ref = response_; + } + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (responseCase_ == 1) { + response_ = s; + } + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
        +     * The content to be echoed by the server.
        +     * 
        + * + * string content = 1; + * + * @return The bytes for content. + */ + @java.lang.Override + public com.google.protobuf.ByteString getContentBytes() { + java.lang.Object ref = ""; + if (responseCase_ == 1) { + ref = response_; + } + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + if (responseCase_ == 1) { + response_ = b; + } + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
        +     * The content to be echoed by the server.
        +     * 
        + * + * string content = 1; + * + * @param value The content to set. + * @return This builder for chaining. + */ + public Builder setContent(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + responseCase_ = 1; + response_ = value; + onChanged(); + return this; + } + + /** + * + * + *
        +     * The content to be echoed by the server.
        +     * 
        + * + * string content = 1; + * + * @return This builder for chaining. + */ + public Builder clearContent() { + if (responseCase_ == 1) { + responseCase_ = 0; + response_ = null; + onChanged(); + } + return this; + } + + /** + * + * + *
        +     * The content to be echoed by the server.
        +     * 
        + * + * string content = 1; + * + * @param value The bytes for content to set. + * @return This builder for chaining. + */ + public Builder setContentBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + responseCase_ = 1; + response_ = value; + onChanged(); + return this; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.rpc.Status, com.google.rpc.Status.Builder, com.google.rpc.StatusOrBuilder> + errorBuilder_; + + /** + * + * + *
        +     * The error to be thrown by the server.
        +     * 
        + * + * .google.rpc.Status error = 2; + * + * @return Whether the error field is set. + */ + @java.lang.Override + public boolean hasError() { + return responseCase_ == 2; + } + + /** + * + * + *
        +     * The error to be thrown by the server.
        +     * 
        + * + * .google.rpc.Status error = 2; + * + * @return The error. + */ + @java.lang.Override + public com.google.rpc.Status getError() { + if (errorBuilder_ == null) { + if (responseCase_ == 2) { + return (com.google.rpc.Status) response_; + } + return com.google.rpc.Status.getDefaultInstance(); + } else { + if (responseCase_ == 2) { + return errorBuilder_.getMessage(); + } + return com.google.rpc.Status.getDefaultInstance(); + } + } + + /** + * + * + *
        +     * The error to be thrown by the server.
        +     * 
        + * + * .google.rpc.Status error = 2; + */ + public Builder setError(com.google.rpc.Status value) { + if (errorBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + response_ = value; + onChanged(); + } else { + errorBuilder_.setMessage(value); + } + responseCase_ = 2; + return this; + } + + /** + * + * + *
        +     * The error to be thrown by the server.
        +     * 
        + * + * .google.rpc.Status error = 2; + */ + public Builder setError(com.google.rpc.Status.Builder builderForValue) { + if (errorBuilder_ == null) { + response_ = builderForValue.build(); + onChanged(); + } else { + errorBuilder_.setMessage(builderForValue.build()); + } + responseCase_ = 2; + return this; + } + + /** + * + * + *
        +     * The error to be thrown by the server.
        +     * 
        + * + * .google.rpc.Status error = 2; + */ + public Builder mergeError(com.google.rpc.Status value) { + if (errorBuilder_ == null) { + if (responseCase_ == 2 && response_ != com.google.rpc.Status.getDefaultInstance()) { + response_ = + com.google.rpc.Status.newBuilder((com.google.rpc.Status) response_) + .mergeFrom(value) + .buildPartial(); + } else { + response_ = value; + } + onChanged(); + } else { + if (responseCase_ == 2) { + errorBuilder_.mergeFrom(value); + } else { + errorBuilder_.setMessage(value); + } + } + responseCase_ = 2; + return this; + } + + /** + * + * + *
        +     * The error to be thrown by the server.
        +     * 
        + * + * .google.rpc.Status error = 2; + */ + public Builder clearError() { + if (errorBuilder_ == null) { + if (responseCase_ == 2) { + responseCase_ = 0; + response_ = null; + onChanged(); + } + } else { + if (responseCase_ == 2) { + responseCase_ = 0; + response_ = null; + } + errorBuilder_.clear(); + } + return this; + } + + /** + * + * + *
        +     * The error to be thrown by the server.
        +     * 
        + * + * .google.rpc.Status error = 2; + */ + public com.google.rpc.Status.Builder getErrorBuilder() { + return getErrorFieldBuilder().getBuilder(); + } + + /** + * + * + *
        +     * The error to be thrown by the server.
        +     * 
        + * + * .google.rpc.Status error = 2; + */ + @java.lang.Override + public com.google.rpc.StatusOrBuilder getErrorOrBuilder() { + if ((responseCase_ == 2) && (errorBuilder_ != null)) { + return errorBuilder_.getMessageOrBuilder(); + } else { + if (responseCase_ == 2) { + return (com.google.rpc.Status) response_; + } + return com.google.rpc.Status.getDefaultInstance(); + } + } + + /** + * + * + *
        +     * The error to be thrown by the server.
        +     * 
        + * + * .google.rpc.Status error = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.rpc.Status, com.google.rpc.Status.Builder, com.google.rpc.StatusOrBuilder> + getErrorFieldBuilder() { + if (errorBuilder_ == null) { + if (!(responseCase_ == 2)) { + response_ = com.google.rpc.Status.getDefaultInstance(); + } + errorBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.rpc.Status, + com.google.rpc.Status.Builder, + com.google.rpc.StatusOrBuilder>( + (com.google.rpc.Status) response_, getParentForChildren(), isClean()); + response_ = null; + } + responseCase_ = 2; + onChanged(); + return errorBuilder_; + } + + private int severity_ = 0; + + /** + * + * + *
        +     * The severity to be echoed by the server.
        +     * 
        + * + * .google.showcase.v1beta1.Severity severity = 3; + * + * @return The enum numeric value on the wire for severity. + */ + @java.lang.Override + public int getSeverityValue() { + return severity_; + } + + /** + * + * + *
        +     * The severity to be echoed by the server.
        +     * 
        + * + * .google.showcase.v1beta1.Severity severity = 3; + * + * @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_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
        +     * The severity to be echoed by the server.
        +     * 
        + * + * .google.showcase.v1beta1.Severity severity = 3; + * + * @return The severity. + */ + @java.lang.Override + public com.google.showcase.v1beta1.Severity getSeverity() { + com.google.showcase.v1beta1.Severity result = + com.google.showcase.v1beta1.Severity.forNumber(severity_); + return result == null ? com.google.showcase.v1beta1.Severity.UNRECOGNIZED : result; + } + + /** + * + * + *
        +     * The severity to be echoed by the server.
        +     * 
        + * + * .google.showcase.v1beta1.Severity severity = 3; + * + * @param value The severity to set. + * @return This builder for chaining. + */ + public Builder setSeverity(com.google.showcase.v1beta1.Severity value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000004; + severity_ = value.getNumber(); + onChanged(); + return this; + } + + /** + * + * + *
        +     * The severity to be echoed by the server.
        +     * 
        + * + * .google.showcase.v1beta1.Severity severity = 3; + * + * @return This builder for chaining. + */ + public Builder clearSeverity() { + bitField0_ = (bitField0_ & ~0x00000004); + severity_ = 0; + onChanged(); + return this; + } + + private java.lang.Object header_ = ""; + + /** + * + * + *
        +     * Optional. This field can be set to test the routing annotation on the Echo method.
        +     * 
        + * + * string header = 4; + * + * @return The header. + */ + public java.lang.String getHeader() { + java.lang.Object ref = header_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + header_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
        +     * Optional. This field can be set to test the routing annotation on the Echo method.
        +     * 
        + * + * string header = 4; + * + * @return The bytes for header. + */ + public com.google.protobuf.ByteString getHeaderBytes() { + java.lang.Object ref = header_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + header_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
        +     * Optional. This field can be set to test the routing annotation on the Echo method.
        +     * 
        + * + * string header = 4; + * + * @param value The header to set. + * @return This builder for chaining. + */ + public Builder setHeader(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + header_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + /** + * + * + *
        +     * Optional. This field can be set to test the routing annotation on the Echo method.
        +     * 
        + * + * string header = 4; + * + * @return This builder for chaining. + */ + public Builder clearHeader() { + header_ = getDefaultInstance().getHeader(); + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + return this; + } + + /** + * + * + *
        +     * Optional. This field can be set to test the routing annotation on the Echo method.
        +     * 
        + * + * string header = 4; + * + * @param value The bytes for header to set. + * @return This builder for chaining. + */ + public Builder setHeaderBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + header_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + private java.lang.Object otherHeader_ = ""; + + /** + * + * + *
        +     * Optional. This field can be set to test the routing annotation on the Echo method.
        +     * 
        + * + * string other_header = 5; + * + * @return The otherHeader. + */ + public java.lang.String getOtherHeader() { + java.lang.Object ref = otherHeader_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + otherHeader_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
        +     * Optional. This field can be set to test the routing annotation on the Echo method.
        +     * 
        + * + * string other_header = 5; + * + * @return The bytes for otherHeader. + */ + public com.google.protobuf.ByteString getOtherHeaderBytes() { + java.lang.Object ref = otherHeader_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + otherHeader_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
        +     * Optional. This field can be set to test the routing annotation on the Echo method.
        +     * 
        + * + * string other_header = 5; + * + * @param value The otherHeader to set. + * @return This builder for chaining. + */ + public Builder setOtherHeader(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + otherHeader_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + /** + * + * + *
        +     * Optional. This field can be set to test the routing annotation on the Echo method.
        +     * 
        + * + * string other_header = 5; + * + * @return This builder for chaining. + */ + public Builder clearOtherHeader() { + otherHeader_ = getDefaultInstance().getOtherHeader(); + bitField0_ = (bitField0_ & ~0x00000010); + onChanged(); + return this; + } + + /** + * + * + *
        +     * Optional. This field can be set to test the routing annotation on the Echo method.
        +     * 
        + * + * string other_header = 5; + * + * @param value The bytes for otherHeader to set. + * @return This builder for chaining. + */ + public Builder setOtherHeaderBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + otherHeader_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + private java.lang.Object requestId_ = ""; + + /** + * + * + *
        +     * To facilitate testing of https://google.aip.dev/client-libraries/4235
        +     * 
        + * + * string request_id = 7 [(.google.api.field_info) = { ... } + * + * @return The requestId. + */ + public java.lang.String getRequestId() { + java.lang.Object ref = requestId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + requestId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
        +     * To facilitate testing of https://google.aip.dev/client-libraries/4235
        +     * 
        + * + * string request_id = 7 [(.google.api.field_info) = { ... } + * + * @return The bytes for requestId. + */ + public com.google.protobuf.ByteString getRequestIdBytes() { + java.lang.Object ref = requestId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + requestId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
        +     * To facilitate testing of https://google.aip.dev/client-libraries/4235
        +     * 
        + * + * string request_id = 7 [(.google.api.field_info) = { ... } + * + * @param value The requestId to set. + * @return This builder for chaining. + */ + public Builder setRequestId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + requestId_ = value; + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + + /** + * + * + *
        +     * To facilitate testing of https://google.aip.dev/client-libraries/4235
        +     * 
        + * + * string request_id = 7 [(.google.api.field_info) = { ... } + * + * @return This builder for chaining. + */ + public Builder clearRequestId() { + requestId_ = getDefaultInstance().getRequestId(); + bitField0_ = (bitField0_ & ~0x00000020); + onChanged(); + return this; + } + + /** + * + * + *
        +     * To facilitate testing of https://google.aip.dev/client-libraries/4235
        +     * 
        + * + * string request_id = 7 [(.google.api.field_info) = { ... } + * + * @param value The bytes for requestId to set. + * @return This builder for chaining. + */ + public Builder setRequestIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + requestId_ = value; + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + + private java.lang.Object otherRequestId_ = ""; + + /** + * + * + *
        +     * To facilitate testing of https://google.aip.dev/client-libraries/4235
        +     * 
        + * + * optional string other_request_id = 8 [(.google.api.field_info) = { ... } + * + * @return Whether the otherRequestId field is set. + */ + public boolean hasOtherRequestId() { + return ((bitField0_ & 0x00000040) != 0); + } + + /** + * + * + *
        +     * To facilitate testing of https://google.aip.dev/client-libraries/4235
        +     * 
        + * + * optional string other_request_id = 8 [(.google.api.field_info) = { ... } + * + * @return The otherRequestId. + */ + public java.lang.String getOtherRequestId() { + java.lang.Object ref = otherRequestId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + otherRequestId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
        +     * To facilitate testing of https://google.aip.dev/client-libraries/4235
        +     * 
        + * + * optional string other_request_id = 8 [(.google.api.field_info) = { ... } + * + * @return The bytes for otherRequestId. + */ + public com.google.protobuf.ByteString getOtherRequestIdBytes() { + java.lang.Object ref = otherRequestId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + otherRequestId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
        +     * To facilitate testing of https://google.aip.dev/client-libraries/4235
        +     * 
        + * + * optional string other_request_id = 8 [(.google.api.field_info) = { ... } + * + * @param value The otherRequestId to set. + * @return This builder for chaining. + */ + public Builder setOtherRequestId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + otherRequestId_ = value; + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + + /** + * + * + *
        +     * To facilitate testing of https://google.aip.dev/client-libraries/4235
        +     * 
        + * + * optional string other_request_id = 8 [(.google.api.field_info) = { ... } + * + * @return This builder for chaining. + */ + public Builder clearOtherRequestId() { + otherRequestId_ = getDefaultInstance().getOtherRequestId(); + bitField0_ = (bitField0_ & ~0x00000040); + onChanged(); + return this; + } + + /** + * + * + *
        +     * To facilitate testing of https://google.aip.dev/client-libraries/4235
        +     * 
        + * + * optional string other_request_id = 8 [(.google.api.field_info) = { ... } + * + * @param value The bytes for otherRequestId to set. + * @return This builder for chaining. + */ + public Builder setOtherRequestIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + otherRequestId_ = 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.showcase.v1beta1.EchoRequest) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.EchoRequest) + private static final com.google.showcase.v1beta1.EchoRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.EchoRequest(); + } + + public static com.google.showcase.v1beta1.EchoRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public EchoRequest 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.showcase.v1beta1.EchoRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/EchoRequestOrBuilder.java b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/EchoRequestOrBuilder.java new file mode 100644 index 0000000000..798280c899 --- /dev/null +++ b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/EchoRequestOrBuilder.java @@ -0,0 +1,247 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/echo.proto + +// Protobuf Java Version: 3.25.8 +package com.google.showcase.v1beta1; + +public interface EchoRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.EchoRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
        +   * The content to be echoed by the server.
        +   * 
        + * + * string content = 1; + * + * @return Whether the content field is set. + */ + boolean hasContent(); + + /** + * + * + *
        +   * The content to be echoed by the server.
        +   * 
        + * + * string content = 1; + * + * @return The content. + */ + java.lang.String getContent(); + + /** + * + * + *
        +   * The content to be echoed by the server.
        +   * 
        + * + * string content = 1; + * + * @return The bytes for content. + */ + com.google.protobuf.ByteString getContentBytes(); + + /** + * + * + *
        +   * The error to be thrown by the server.
        +   * 
        + * + * .google.rpc.Status error = 2; + * + * @return Whether the error field is set. + */ + boolean hasError(); + + /** + * + * + *
        +   * The error to be thrown by the server.
        +   * 
        + * + * .google.rpc.Status error = 2; + * + * @return The error. + */ + com.google.rpc.Status getError(); + + /** + * + * + *
        +   * The error to be thrown by the server.
        +   * 
        + * + * .google.rpc.Status error = 2; + */ + com.google.rpc.StatusOrBuilder getErrorOrBuilder(); + + /** + * + * + *
        +   * The severity to be echoed by the server.
        +   * 
        + * + * .google.showcase.v1beta1.Severity severity = 3; + * + * @return The enum numeric value on the wire for severity. + */ + int getSeverityValue(); + + /** + * + * + *
        +   * The severity to be echoed by the server.
        +   * 
        + * + * .google.showcase.v1beta1.Severity severity = 3; + * + * @return The severity. + */ + com.google.showcase.v1beta1.Severity getSeverity(); + + /** + * + * + *
        +   * Optional. This field can be set to test the routing annotation on the Echo method.
        +   * 
        + * + * string header = 4; + * + * @return The header. + */ + java.lang.String getHeader(); + + /** + * + * + *
        +   * Optional. This field can be set to test the routing annotation on the Echo method.
        +   * 
        + * + * string header = 4; + * + * @return The bytes for header. + */ + com.google.protobuf.ByteString getHeaderBytes(); + + /** + * + * + *
        +   * Optional. This field can be set to test the routing annotation on the Echo method.
        +   * 
        + * + * string other_header = 5; + * + * @return The otherHeader. + */ + java.lang.String getOtherHeader(); + + /** + * + * + *
        +   * Optional. This field can be set to test the routing annotation on the Echo method.
        +   * 
        + * + * string other_header = 5; + * + * @return The bytes for otherHeader. + */ + com.google.protobuf.ByteString getOtherHeaderBytes(); + + /** + * + * + *
        +   * To facilitate testing of https://google.aip.dev/client-libraries/4235
        +   * 
        + * + * string request_id = 7 [(.google.api.field_info) = { ... } + * + * @return The requestId. + */ + java.lang.String getRequestId(); + + /** + * + * + *
        +   * To facilitate testing of https://google.aip.dev/client-libraries/4235
        +   * 
        + * + * string request_id = 7 [(.google.api.field_info) = { ... } + * + * @return The bytes for requestId. + */ + com.google.protobuf.ByteString getRequestIdBytes(); + + /** + * + * + *
        +   * To facilitate testing of https://google.aip.dev/client-libraries/4235
        +   * 
        + * + * optional string other_request_id = 8 [(.google.api.field_info) = { ... } + * + * @return Whether the otherRequestId field is set. + */ + boolean hasOtherRequestId(); + + /** + * + * + *
        +   * To facilitate testing of https://google.aip.dev/client-libraries/4235
        +   * 
        + * + * optional string other_request_id = 8 [(.google.api.field_info) = { ... } + * + * @return The otherRequestId. + */ + java.lang.String getOtherRequestId(); + + /** + * + * + *
        +   * To facilitate testing of https://google.aip.dev/client-libraries/4235
        +   * 
        + * + * optional string other_request_id = 8 [(.google.api.field_info) = { ... } + * + * @return The bytes for otherRequestId. + */ + com.google.protobuf.ByteString getOtherRequestIdBytes(); + + com.google.showcase.v1beta1.EchoRequest.ResponseCase getResponseCase(); +} diff --git a/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/EchoResponse.java b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/EchoResponse.java new file mode 100644 index 0000000000..a9567a558d --- /dev/null +++ b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/EchoResponse.java @@ -0,0 +1,1165 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/echo.proto + +// Protobuf Java Version: 3.25.8 +package com.google.showcase.v1beta1; + +/** + * + * + *
        + * The response message for the Echo methods.
        + * 
        + * + * Protobuf type {@code google.showcase.v1beta1.EchoResponse} + */ +public final class EchoResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.EchoResponse) + EchoResponseOrBuilder { + private static final long serialVersionUID = 0L; + + // Use EchoResponse.newBuilder() to construct. + private EchoResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private EchoResponse() { + content_ = ""; + severity_ = 0; + requestId_ = ""; + otherRequestId_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new EchoResponse(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.EchoOuterClass + .internal_static_google_showcase_v1beta1_EchoResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.EchoOuterClass + .internal_static_google_showcase_v1beta1_EchoResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.EchoResponse.class, + com.google.showcase.v1beta1.EchoResponse.Builder.class); + } + + public static final int CONTENT_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object content_ = ""; + + /** + * + * + *
        +   * The content specified in the request.
        +   * 
        + * + * string content = 1; + * + * @return The content. + */ + @java.lang.Override + public java.lang.String getContent() { + java.lang.Object ref = content_; + 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(); + content_ = s; + return s; + } + } + + /** + * + * + *
        +   * The content specified in the request.
        +   * 
        + * + * string content = 1; + * + * @return The bytes for content. + */ + @java.lang.Override + public com.google.protobuf.ByteString getContentBytes() { + java.lang.Object ref = content_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + content_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int SEVERITY_FIELD_NUMBER = 2; + private int severity_ = 0; + + /** + * + * + *
        +   * The severity specified in the request.
        +   * 
        + * + * .google.showcase.v1beta1.Severity severity = 2; + * + * @return The enum numeric value on the wire for severity. + */ + @java.lang.Override + public int getSeverityValue() { + return severity_; + } + + /** + * + * + *
        +   * The severity specified in the request.
        +   * 
        + * + * .google.showcase.v1beta1.Severity severity = 2; + * + * @return The severity. + */ + @java.lang.Override + public com.google.showcase.v1beta1.Severity getSeverity() { + com.google.showcase.v1beta1.Severity result = + com.google.showcase.v1beta1.Severity.forNumber(severity_); + return result == null ? com.google.showcase.v1beta1.Severity.UNRECOGNIZED : result; + } + + public static final int REQUEST_ID_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object requestId_ = ""; + + /** + * + * + *
        +   * The request ID specified or autopopulated in the request.
        +   * 
        + * + * string request_id = 3; + * + * @return The requestId. + */ + @java.lang.Override + public java.lang.String getRequestId() { + java.lang.Object ref = requestId_; + 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(); + requestId_ = s; + return s; + } + } + + /** + * + * + *
        +   * The request ID specified or autopopulated in the request.
        +   * 
        + * + * string request_id = 3; + * + * @return The bytes for requestId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getRequestIdBytes() { + java.lang.Object ref = requestId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + requestId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int OTHER_REQUEST_ID_FIELD_NUMBER = 4; + + @SuppressWarnings("serial") + private volatile java.lang.Object otherRequestId_ = ""; + + /** + * + * + *
        +   * The other request ID specified or autopopulated in the request.
        +   * 
        + * + * string other_request_id = 4; + * + * @return The otherRequestId. + */ + @java.lang.Override + public java.lang.String getOtherRequestId() { + java.lang.Object ref = otherRequestId_; + 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(); + otherRequestId_ = s; + return s; + } + } + + /** + * + * + *
        +   * The other request ID specified or autopopulated in the request.
        +   * 
        + * + * string other_request_id = 4; + * + * @return The bytes for otherRequestId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getOtherRequestIdBytes() { + java.lang.Object ref = otherRequestId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + otherRequestId_ = 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(content_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, content_); + } + if (severity_ != com.google.showcase.v1beta1.Severity.UNNECESSARY.getNumber()) { + output.writeEnum(2, severity_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(requestId_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, requestId_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(otherRequestId_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, otherRequestId_); + } + 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(content_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, content_); + } + if (severity_ != com.google.showcase.v1beta1.Severity.UNNECESSARY.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(2, severity_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(requestId_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, requestId_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(otherRequestId_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, otherRequestId_); + } + 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.showcase.v1beta1.EchoResponse)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.EchoResponse other = (com.google.showcase.v1beta1.EchoResponse) obj; + + if (!getContent().equals(other.getContent())) return false; + if (severity_ != other.severity_) return false; + if (!getRequestId().equals(other.getRequestId())) return false; + if (!getOtherRequestId().equals(other.getOtherRequestId())) 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) + CONTENT_FIELD_NUMBER; + hash = (53 * hash) + getContent().hashCode(); + hash = (37 * hash) + SEVERITY_FIELD_NUMBER; + hash = (53 * hash) + severity_; + hash = (37 * hash) + REQUEST_ID_FIELD_NUMBER; + hash = (53 * hash) + getRequestId().hashCode(); + hash = (37 * hash) + OTHER_REQUEST_ID_FIELD_NUMBER; + hash = (53 * hash) + getOtherRequestId().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.showcase.v1beta1.EchoResponse parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.EchoResponse parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.EchoResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.EchoResponse 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.showcase.v1beta1.EchoResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.EchoResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.EchoResponse parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.EchoResponse 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.showcase.v1beta1.EchoResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.EchoResponse 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.showcase.v1beta1.EchoResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.EchoResponse 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.showcase.v1beta1.EchoResponse 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 message for the Echo methods.
        +   * 
        + * + * Protobuf type {@code google.showcase.v1beta1.EchoResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.EchoResponse) + com.google.showcase.v1beta1.EchoResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.EchoOuterClass + .internal_static_google_showcase_v1beta1_EchoResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.EchoOuterClass + .internal_static_google_showcase_v1beta1_EchoResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.EchoResponse.class, + com.google.showcase.v1beta1.EchoResponse.Builder.class); + } + + // Construct using com.google.showcase.v1beta1.EchoResponse.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + content_ = ""; + severity_ = 0; + requestId_ = ""; + otherRequestId_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.showcase.v1beta1.EchoOuterClass + .internal_static_google_showcase_v1beta1_EchoResponse_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.EchoResponse getDefaultInstanceForType() { + return com.google.showcase.v1beta1.EchoResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.EchoResponse build() { + com.google.showcase.v1beta1.EchoResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.EchoResponse buildPartial() { + com.google.showcase.v1beta1.EchoResponse result = + new com.google.showcase.v1beta1.EchoResponse(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.showcase.v1beta1.EchoResponse result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.content_ = content_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.severity_ = severity_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.requestId_ = requestId_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.otherRequestId_ = otherRequestId_; + } + } + + @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.showcase.v1beta1.EchoResponse) { + return mergeFrom((com.google.showcase.v1beta1.EchoResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.showcase.v1beta1.EchoResponse other) { + if (other == com.google.showcase.v1beta1.EchoResponse.getDefaultInstance()) return this; + if (!other.getContent().isEmpty()) { + content_ = other.content_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.severity_ != 0) { + setSeverityValue(other.getSeverityValue()); + } + if (!other.getRequestId().isEmpty()) { + requestId_ = other.requestId_; + bitField0_ |= 0x00000004; + onChanged(); + } + if (!other.getOtherRequestId().isEmpty()) { + otherRequestId_ = other.otherRequestId_; + 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: + { + content_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 16: + { + severity_ = input.readEnum(); + bitField0_ |= 0x00000002; + break; + } // case 16 + case 26: + { + requestId_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 34: + { + otherRequestId_ = input.readStringRequireUtf8(); + 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 content_ = ""; + + /** + * + * + *
        +     * The content specified in the request.
        +     * 
        + * + * string content = 1; + * + * @return The content. + */ + public java.lang.String getContent() { + java.lang.Object ref = content_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + content_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
        +     * The content specified in the request.
        +     * 
        + * + * string content = 1; + * + * @return The bytes for content. + */ + public com.google.protobuf.ByteString getContentBytes() { + java.lang.Object ref = content_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + content_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
        +     * The content specified in the request.
        +     * 
        + * + * string content = 1; + * + * @param value The content to set. + * @return This builder for chaining. + */ + public Builder setContent(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + content_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
        +     * The content specified in the request.
        +     * 
        + * + * string content = 1; + * + * @return This builder for chaining. + */ + public Builder clearContent() { + content_ = getDefaultInstance().getContent(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
        +     * The content specified in the request.
        +     * 
        + * + * string content = 1; + * + * @param value The bytes for content to set. + * @return This builder for chaining. + */ + public Builder setContentBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + content_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private int severity_ = 0; + + /** + * + * + *
        +     * The severity specified in the request.
        +     * 
        + * + * .google.showcase.v1beta1.Severity severity = 2; + * + * @return The enum numeric value on the wire for severity. + */ + @java.lang.Override + public int getSeverityValue() { + return severity_; + } + + /** + * + * + *
        +     * The severity specified in the request.
        +     * 
        + * + * .google.showcase.v1beta1.Severity severity = 2; + * + * @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_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
        +     * The severity specified in the request.
        +     * 
        + * + * .google.showcase.v1beta1.Severity severity = 2; + * + * @return The severity. + */ + @java.lang.Override + public com.google.showcase.v1beta1.Severity getSeverity() { + com.google.showcase.v1beta1.Severity result = + com.google.showcase.v1beta1.Severity.forNumber(severity_); + return result == null ? com.google.showcase.v1beta1.Severity.UNRECOGNIZED : result; + } + + /** + * + * + *
        +     * The severity specified in the request.
        +     * 
        + * + * .google.showcase.v1beta1.Severity severity = 2; + * + * @param value The severity to set. + * @return This builder for chaining. + */ + public Builder setSeverity(com.google.showcase.v1beta1.Severity value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000002; + severity_ = value.getNumber(); + onChanged(); + return this; + } + + /** + * + * + *
        +     * The severity specified in the request.
        +     * 
        + * + * .google.showcase.v1beta1.Severity severity = 2; + * + * @return This builder for chaining. + */ + public Builder clearSeverity() { + bitField0_ = (bitField0_ & ~0x00000002); + severity_ = 0; + onChanged(); + return this; + } + + private java.lang.Object requestId_ = ""; + + /** + * + * + *
        +     * The request ID specified or autopopulated in the request.
        +     * 
        + * + * string request_id = 3; + * + * @return The requestId. + */ + public java.lang.String getRequestId() { + java.lang.Object ref = requestId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + requestId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
        +     * The request ID specified or autopopulated in the request.
        +     * 
        + * + * string request_id = 3; + * + * @return The bytes for requestId. + */ + public com.google.protobuf.ByteString getRequestIdBytes() { + java.lang.Object ref = requestId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + requestId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
        +     * The request ID specified or autopopulated in the request.
        +     * 
        + * + * string request_id = 3; + * + * @param value The requestId to set. + * @return This builder for chaining. + */ + public Builder setRequestId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + requestId_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
        +     * The request ID specified or autopopulated in the request.
        +     * 
        + * + * string request_id = 3; + * + * @return This builder for chaining. + */ + public Builder clearRequestId() { + requestId_ = getDefaultInstance().getRequestId(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + + /** + * + * + *
        +     * The request ID specified or autopopulated in the request.
        +     * 
        + * + * string request_id = 3; + * + * @param value The bytes for requestId to set. + * @return This builder for chaining. + */ + public Builder setRequestIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + requestId_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + private java.lang.Object otherRequestId_ = ""; + + /** + * + * + *
        +     * The other request ID specified or autopopulated in the request.
        +     * 
        + * + * string other_request_id = 4; + * + * @return The otherRequestId. + */ + public java.lang.String getOtherRequestId() { + java.lang.Object ref = otherRequestId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + otherRequestId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
        +     * The other request ID specified or autopopulated in the request.
        +     * 
        + * + * string other_request_id = 4; + * + * @return The bytes for otherRequestId. + */ + public com.google.protobuf.ByteString getOtherRequestIdBytes() { + java.lang.Object ref = otherRequestId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + otherRequestId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
        +     * The other request ID specified or autopopulated in the request.
        +     * 
        + * + * string other_request_id = 4; + * + * @param value The otherRequestId to set. + * @return This builder for chaining. + */ + public Builder setOtherRequestId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + otherRequestId_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + /** + * + * + *
        +     * The other request ID specified or autopopulated in the request.
        +     * 
        + * + * string other_request_id = 4; + * + * @return This builder for chaining. + */ + public Builder clearOtherRequestId() { + otherRequestId_ = getDefaultInstance().getOtherRequestId(); + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + return this; + } + + /** + * + * + *
        +     * The other request ID specified or autopopulated in the request.
        +     * 
        + * + * string other_request_id = 4; + * + * @param value The bytes for otherRequestId to set. + * @return This builder for chaining. + */ + public Builder setOtherRequestIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + otherRequestId_ = 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.showcase.v1beta1.EchoResponse) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.EchoResponse) + private static final com.google.showcase.v1beta1.EchoResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.EchoResponse(); + } + + public static com.google.showcase.v1beta1.EchoResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public EchoResponse 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.showcase.v1beta1.EchoResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/EchoResponseOrBuilder.java b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/EchoResponseOrBuilder.java new file mode 100644 index 0000000000..74bddf13ca --- /dev/null +++ b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/EchoResponseOrBuilder.java @@ -0,0 +1,130 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/echo.proto + +// Protobuf Java Version: 3.25.8 +package com.google.showcase.v1beta1; + +public interface EchoResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.EchoResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
        +   * The content specified in the request.
        +   * 
        + * + * string content = 1; + * + * @return The content. + */ + java.lang.String getContent(); + + /** + * + * + *
        +   * The content specified in the request.
        +   * 
        + * + * string content = 1; + * + * @return The bytes for content. + */ + com.google.protobuf.ByteString getContentBytes(); + + /** + * + * + *
        +   * The severity specified in the request.
        +   * 
        + * + * .google.showcase.v1beta1.Severity severity = 2; + * + * @return The enum numeric value on the wire for severity. + */ + int getSeverityValue(); + + /** + * + * + *
        +   * The severity specified in the request.
        +   * 
        + * + * .google.showcase.v1beta1.Severity severity = 2; + * + * @return The severity. + */ + com.google.showcase.v1beta1.Severity getSeverity(); + + /** + * + * + *
        +   * The request ID specified or autopopulated in the request.
        +   * 
        + * + * string request_id = 3; + * + * @return The requestId. + */ + java.lang.String getRequestId(); + + /** + * + * + *
        +   * The request ID specified or autopopulated in the request.
        +   * 
        + * + * string request_id = 3; + * + * @return The bytes for requestId. + */ + com.google.protobuf.ByteString getRequestIdBytes(); + + /** + * + * + *
        +   * The other request ID specified or autopopulated in the request.
        +   * 
        + * + * string other_request_id = 4; + * + * @return The otherRequestId. + */ + java.lang.String getOtherRequestId(); + + /** + * + * + *
        +   * The other request ID specified or autopopulated in the request.
        +   * 
        + * + * string other_request_id = 4; + * + * @return The bytes for otherRequestId. + */ + com.google.protobuf.ByteString getOtherRequestIdBytes(); +} diff --git a/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/EnumRequest.java b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/EnumRequest.java new file mode 100644 index 0000000000..97837ea842 --- /dev/null +++ b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/EnumRequest.java @@ -0,0 +1,523 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/compliance.proto + +// Protobuf Java Version: 3.25.8 +package com.google.showcase.v1beta1; + +/** Protobuf type {@code google.showcase.v1beta1.EnumRequest} */ +public final class EnumRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.EnumRequest) + EnumRequestOrBuilder { + private static final long serialVersionUID = 0L; + + // Use EnumRequest.newBuilder() to construct. + private EnumRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private EnumRequest() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new EnumRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.ComplianceOuterClass + .internal_static_google_showcase_v1beta1_EnumRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.ComplianceOuterClass + .internal_static_google_showcase_v1beta1_EnumRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.EnumRequest.class, + com.google.showcase.v1beta1.EnumRequest.Builder.class); + } + + public static final int UNKNOWN_ENUM_FIELD_NUMBER = 1; + private boolean unknownEnum_ = false; + + /** + * + * + *
        +   * Whether the client is requesting a new, unknown enum value or a known enum value already declared in this proto file.
        +   * 
        + * + * bool unknown_enum = 1; + * + * @return The unknownEnum. + */ + @java.lang.Override + public boolean getUnknownEnum() { + return unknownEnum_; + } + + 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 (unknownEnum_ != false) { + output.writeBool(1, unknownEnum_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (unknownEnum_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(1, unknownEnum_); + } + 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.showcase.v1beta1.EnumRequest)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.EnumRequest other = (com.google.showcase.v1beta1.EnumRequest) obj; + + if (getUnknownEnum() != other.getUnknownEnum()) 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) + UNKNOWN_ENUM_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getUnknownEnum()); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.showcase.v1beta1.EnumRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.EnumRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.EnumRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.EnumRequest 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.showcase.v1beta1.EnumRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.EnumRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.EnumRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.EnumRequest 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.showcase.v1beta1.EnumRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.EnumRequest 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.showcase.v1beta1.EnumRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.EnumRequest 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.showcase.v1beta1.EnumRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** Protobuf type {@code google.showcase.v1beta1.EnumRequest} */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.EnumRequest) + com.google.showcase.v1beta1.EnumRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.ComplianceOuterClass + .internal_static_google_showcase_v1beta1_EnumRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.ComplianceOuterClass + .internal_static_google_showcase_v1beta1_EnumRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.EnumRequest.class, + com.google.showcase.v1beta1.EnumRequest.Builder.class); + } + + // Construct using com.google.showcase.v1beta1.EnumRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + unknownEnum_ = false; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.showcase.v1beta1.ComplianceOuterClass + .internal_static_google_showcase_v1beta1_EnumRequest_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.EnumRequest getDefaultInstanceForType() { + return com.google.showcase.v1beta1.EnumRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.EnumRequest build() { + com.google.showcase.v1beta1.EnumRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.EnumRequest buildPartial() { + com.google.showcase.v1beta1.EnumRequest result = + new com.google.showcase.v1beta1.EnumRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.showcase.v1beta1.EnumRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.unknownEnum_ = unknownEnum_; + } + } + + @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.showcase.v1beta1.EnumRequest) { + return mergeFrom((com.google.showcase.v1beta1.EnumRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.showcase.v1beta1.EnumRequest other) { + if (other == com.google.showcase.v1beta1.EnumRequest.getDefaultInstance()) return this; + if (other.getUnknownEnum() != false) { + setUnknownEnum(other.getUnknownEnum()); + } + 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: + { + unknownEnum_ = 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 unknownEnum_; + + /** + * + * + *
        +     * Whether the client is requesting a new, unknown enum value or a known enum value already declared in this proto file.
        +     * 
        + * + * bool unknown_enum = 1; + * + * @return The unknownEnum. + */ + @java.lang.Override + public boolean getUnknownEnum() { + return unknownEnum_; + } + + /** + * + * + *
        +     * Whether the client is requesting a new, unknown enum value or a known enum value already declared in this proto file.
        +     * 
        + * + * bool unknown_enum = 1; + * + * @param value The unknownEnum to set. + * @return This builder for chaining. + */ + public Builder setUnknownEnum(boolean value) { + + unknownEnum_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
        +     * Whether the client is requesting a new, unknown enum value or a known enum value already declared in this proto file.
        +     * 
        + * + * bool unknown_enum = 1; + * + * @return This builder for chaining. + */ + public Builder clearUnknownEnum() { + bitField0_ = (bitField0_ & ~0x00000001); + unknownEnum_ = 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.showcase.v1beta1.EnumRequest) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.EnumRequest) + private static final com.google.showcase.v1beta1.EnumRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.EnumRequest(); + } + + public static com.google.showcase.v1beta1.EnumRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public EnumRequest 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.showcase.v1beta1.EnumRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/EnumRequestOrBuilder.java b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/EnumRequestOrBuilder.java new file mode 100644 index 0000000000..6d39e99175 --- /dev/null +++ b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/EnumRequestOrBuilder.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: schema/google/showcase/v1beta1/compliance.proto + +// Protobuf Java Version: 3.25.8 +package com.google.showcase.v1beta1; + +public interface EnumRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.EnumRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
        +   * Whether the client is requesting a new, unknown enum value or a known enum value already declared in this proto file.
        +   * 
        + * + * bool unknown_enum = 1; + * + * @return The unknownEnum. + */ + boolean getUnknownEnum(); +} diff --git a/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/EnumResponse.java b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/EnumResponse.java new file mode 100644 index 0000000000..7c9ac5901d --- /dev/null +++ b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/EnumResponse.java @@ -0,0 +1,873 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/compliance.proto + +// Protobuf Java Version: 3.25.8 +package com.google.showcase.v1beta1; + +/** Protobuf type {@code google.showcase.v1beta1.EnumResponse} */ +public final class EnumResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.EnumResponse) + EnumResponseOrBuilder { + private static final long serialVersionUID = 0L; + + // Use EnumResponse.newBuilder() to construct. + private EnumResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private EnumResponse() { + continent_ = 0; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new EnumResponse(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.ComplianceOuterClass + .internal_static_google_showcase_v1beta1_EnumResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.ComplianceOuterClass + .internal_static_google_showcase_v1beta1_EnumResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.EnumResponse.class, + com.google.showcase.v1beta1.EnumResponse.Builder.class); + } + + private int bitField0_; + public static final int REQUEST_FIELD_NUMBER = 1; + private com.google.showcase.v1beta1.EnumRequest request_; + + /** + * + * + *
        +   * The original request for a known or unknown enum from the server.
        +   * 
        + * + * .google.showcase.v1beta1.EnumRequest request = 1; + * + * @return Whether the request field is set. + */ + @java.lang.Override + public boolean hasRequest() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
        +   * The original request for a known or unknown enum from the server.
        +   * 
        + * + * .google.showcase.v1beta1.EnumRequest request = 1; + * + * @return The request. + */ + @java.lang.Override + public com.google.showcase.v1beta1.EnumRequest getRequest() { + return request_ == null + ? com.google.showcase.v1beta1.EnumRequest.getDefaultInstance() + : request_; + } + + /** + * + * + *
        +   * The original request for a known or unknown enum from the server.
        +   * 
        + * + * .google.showcase.v1beta1.EnumRequest request = 1; + */ + @java.lang.Override + public com.google.showcase.v1beta1.EnumRequestOrBuilder getRequestOrBuilder() { + return request_ == null + ? com.google.showcase.v1beta1.EnumRequest.getDefaultInstance() + : request_; + } + + public static final int CONTINENT_FIELD_NUMBER = 2; + private int continent_ = 0; + + /** + * + * + *
        +   * The actual enum the server provided.
        +   * 
        + * + * .google.showcase.v1beta1.Continent continent = 2; + * + * @return The enum numeric value on the wire for continent. + */ + @java.lang.Override + public int getContinentValue() { + return continent_; + } + + /** + * + * + *
        +   * The actual enum the server provided.
        +   * 
        + * + * .google.showcase.v1beta1.Continent continent = 2; + * + * @return The continent. + */ + @java.lang.Override + public com.google.showcase.v1beta1.Continent getContinent() { + com.google.showcase.v1beta1.Continent result = + com.google.showcase.v1beta1.Continent.forNumber(continent_); + return result == null ? com.google.showcase.v1beta1.Continent.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 (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(1, getRequest()); + } + if (continent_ != com.google.showcase.v1beta1.Continent.CONTINENT_UNSPECIFIED.getNumber()) { + output.writeEnum(2, continent_); + } + 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, getRequest()); + } + if (continent_ != com.google.showcase.v1beta1.Continent.CONTINENT_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(2, continent_); + } + 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.showcase.v1beta1.EnumResponse)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.EnumResponse other = (com.google.showcase.v1beta1.EnumResponse) obj; + + if (hasRequest() != other.hasRequest()) return false; + if (hasRequest()) { + if (!getRequest().equals(other.getRequest())) return false; + } + if (continent_ != other.continent_) 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 (hasRequest()) { + hash = (37 * hash) + REQUEST_FIELD_NUMBER; + hash = (53 * hash) + getRequest().hashCode(); + } + hash = (37 * hash) + CONTINENT_FIELD_NUMBER; + hash = (53 * hash) + continent_; + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.showcase.v1beta1.EnumResponse parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.EnumResponse parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.EnumResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.EnumResponse 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.showcase.v1beta1.EnumResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.EnumResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.EnumResponse parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.EnumResponse 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.showcase.v1beta1.EnumResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.EnumResponse 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.showcase.v1beta1.EnumResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.EnumResponse 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.showcase.v1beta1.EnumResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** Protobuf type {@code google.showcase.v1beta1.EnumResponse} */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.EnumResponse) + com.google.showcase.v1beta1.EnumResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.ComplianceOuterClass + .internal_static_google_showcase_v1beta1_EnumResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.ComplianceOuterClass + .internal_static_google_showcase_v1beta1_EnumResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.EnumResponse.class, + com.google.showcase.v1beta1.EnumResponse.Builder.class); + } + + // Construct using com.google.showcase.v1beta1.EnumResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getRequestFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + request_ = null; + if (requestBuilder_ != null) { + requestBuilder_.dispose(); + requestBuilder_ = null; + } + continent_ = 0; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.showcase.v1beta1.ComplianceOuterClass + .internal_static_google_showcase_v1beta1_EnumResponse_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.EnumResponse getDefaultInstanceForType() { + return com.google.showcase.v1beta1.EnumResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.EnumResponse build() { + com.google.showcase.v1beta1.EnumResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.EnumResponse buildPartial() { + com.google.showcase.v1beta1.EnumResponse result = + new com.google.showcase.v1beta1.EnumResponse(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.showcase.v1beta1.EnumResponse result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.request_ = requestBuilder_ == null ? request_ : requestBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.continent_ = continent_; + } + 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.showcase.v1beta1.EnumResponse) { + return mergeFrom((com.google.showcase.v1beta1.EnumResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.showcase.v1beta1.EnumResponse other) { + if (other == com.google.showcase.v1beta1.EnumResponse.getDefaultInstance()) return this; + if (other.hasRequest()) { + mergeRequest(other.getRequest()); + } + if (other.continent_ != 0) { + setContinentValue(other.getContinentValue()); + } + 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(getRequestFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 16: + { + continent_ = input.readEnum(); + 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 com.google.showcase.v1beta1.EnumRequest request_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.showcase.v1beta1.EnumRequest, + com.google.showcase.v1beta1.EnumRequest.Builder, + com.google.showcase.v1beta1.EnumRequestOrBuilder> + requestBuilder_; + + /** + * + * + *
        +     * The original request for a known or unknown enum from the server.
        +     * 
        + * + * .google.showcase.v1beta1.EnumRequest request = 1; + * + * @return Whether the request field is set. + */ + public boolean hasRequest() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
        +     * The original request for a known or unknown enum from the server.
        +     * 
        + * + * .google.showcase.v1beta1.EnumRequest request = 1; + * + * @return The request. + */ + public com.google.showcase.v1beta1.EnumRequest getRequest() { + if (requestBuilder_ == null) { + return request_ == null + ? com.google.showcase.v1beta1.EnumRequest.getDefaultInstance() + : request_; + } else { + return requestBuilder_.getMessage(); + } + } + + /** + * + * + *
        +     * The original request for a known or unknown enum from the server.
        +     * 
        + * + * .google.showcase.v1beta1.EnumRequest request = 1; + */ + public Builder setRequest(com.google.showcase.v1beta1.EnumRequest value) { + if (requestBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + request_ = value; + } else { + requestBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
        +     * The original request for a known or unknown enum from the server.
        +     * 
        + * + * .google.showcase.v1beta1.EnumRequest request = 1; + */ + public Builder setRequest(com.google.showcase.v1beta1.EnumRequest.Builder builderForValue) { + if (requestBuilder_ == null) { + request_ = builderForValue.build(); + } else { + requestBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
        +     * The original request for a known or unknown enum from the server.
        +     * 
        + * + * .google.showcase.v1beta1.EnumRequest request = 1; + */ + public Builder mergeRequest(com.google.showcase.v1beta1.EnumRequest value) { + if (requestBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) + && request_ != null + && request_ != com.google.showcase.v1beta1.EnumRequest.getDefaultInstance()) { + getRequestBuilder().mergeFrom(value); + } else { + request_ = value; + } + } else { + requestBuilder_.mergeFrom(value); + } + if (request_ != null) { + bitField0_ |= 0x00000001; + onChanged(); + } + return this; + } + + /** + * + * + *
        +     * The original request for a known or unknown enum from the server.
        +     * 
        + * + * .google.showcase.v1beta1.EnumRequest request = 1; + */ + public Builder clearRequest() { + bitField0_ = (bitField0_ & ~0x00000001); + request_ = null; + if (requestBuilder_ != null) { + requestBuilder_.dispose(); + requestBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
        +     * The original request for a known or unknown enum from the server.
        +     * 
        + * + * .google.showcase.v1beta1.EnumRequest request = 1; + */ + public com.google.showcase.v1beta1.EnumRequest.Builder getRequestBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return getRequestFieldBuilder().getBuilder(); + } + + /** + * + * + *
        +     * The original request for a known or unknown enum from the server.
        +     * 
        + * + * .google.showcase.v1beta1.EnumRequest request = 1; + */ + public com.google.showcase.v1beta1.EnumRequestOrBuilder getRequestOrBuilder() { + if (requestBuilder_ != null) { + return requestBuilder_.getMessageOrBuilder(); + } else { + return request_ == null + ? com.google.showcase.v1beta1.EnumRequest.getDefaultInstance() + : request_; + } + } + + /** + * + * + *
        +     * The original request for a known or unknown enum from the server.
        +     * 
        + * + * .google.showcase.v1beta1.EnumRequest request = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.showcase.v1beta1.EnumRequest, + com.google.showcase.v1beta1.EnumRequest.Builder, + com.google.showcase.v1beta1.EnumRequestOrBuilder> + getRequestFieldBuilder() { + if (requestBuilder_ == null) { + requestBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.showcase.v1beta1.EnumRequest, + com.google.showcase.v1beta1.EnumRequest.Builder, + com.google.showcase.v1beta1.EnumRequestOrBuilder>( + getRequest(), getParentForChildren(), isClean()); + request_ = null; + } + return requestBuilder_; + } + + private int continent_ = 0; + + /** + * + * + *
        +     * The actual enum the server provided.
        +     * 
        + * + * .google.showcase.v1beta1.Continent continent = 2; + * + * @return The enum numeric value on the wire for continent. + */ + @java.lang.Override + public int getContinentValue() { + return continent_; + } + + /** + * + * + *
        +     * The actual enum the server provided.
        +     * 
        + * + * .google.showcase.v1beta1.Continent continent = 2; + * + * @param value The enum numeric value on the wire for continent to set. + * @return This builder for chaining. + */ + public Builder setContinentValue(int value) { + continent_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
        +     * The actual enum the server provided.
        +     * 
        + * + * .google.showcase.v1beta1.Continent continent = 2; + * + * @return The continent. + */ + @java.lang.Override + public com.google.showcase.v1beta1.Continent getContinent() { + com.google.showcase.v1beta1.Continent result = + com.google.showcase.v1beta1.Continent.forNumber(continent_); + return result == null ? com.google.showcase.v1beta1.Continent.UNRECOGNIZED : result; + } + + /** + * + * + *
        +     * The actual enum the server provided.
        +     * 
        + * + * .google.showcase.v1beta1.Continent continent = 2; + * + * @param value The continent to set. + * @return This builder for chaining. + */ + public Builder setContinent(com.google.showcase.v1beta1.Continent value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000002; + continent_ = value.getNumber(); + onChanged(); + return this; + } + + /** + * + * + *
        +     * The actual enum the server provided.
        +     * 
        + * + * .google.showcase.v1beta1.Continent continent = 2; + * + * @return This builder for chaining. + */ + public Builder clearContinent() { + bitField0_ = (bitField0_ & ~0x00000002); + continent_ = 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.showcase.v1beta1.EnumResponse) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.EnumResponse) + private static final com.google.showcase.v1beta1.EnumResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.EnumResponse(); + } + + public static com.google.showcase.v1beta1.EnumResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public EnumResponse 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.showcase.v1beta1.EnumResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/EnumResponseOrBuilder.java b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/EnumResponseOrBuilder.java new file mode 100644 index 0000000000..613ac68126 --- /dev/null +++ b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/EnumResponseOrBuilder.java @@ -0,0 +1,89 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/compliance.proto + +// Protobuf Java Version: 3.25.8 +package com.google.showcase.v1beta1; + +public interface EnumResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.EnumResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
        +   * The original request for a known or unknown enum from the server.
        +   * 
        + * + * .google.showcase.v1beta1.EnumRequest request = 1; + * + * @return Whether the request field is set. + */ + boolean hasRequest(); + + /** + * + * + *
        +   * The original request for a known or unknown enum from the server.
        +   * 
        + * + * .google.showcase.v1beta1.EnumRequest request = 1; + * + * @return The request. + */ + com.google.showcase.v1beta1.EnumRequest getRequest(); + + /** + * + * + *
        +   * The original request for a known or unknown enum from the server.
        +   * 
        + * + * .google.showcase.v1beta1.EnumRequest request = 1; + */ + com.google.showcase.v1beta1.EnumRequestOrBuilder getRequestOrBuilder(); + + /** + * + * + *
        +   * The actual enum the server provided.
        +   * 
        + * + * .google.showcase.v1beta1.Continent continent = 2; + * + * @return The enum numeric value on the wire for continent. + */ + int getContinentValue(); + + /** + * + * + *
        +   * The actual enum the server provided.
        +   * 
        + * + * .google.showcase.v1beta1.Continent continent = 2; + * + * @return The continent. + */ + com.google.showcase.v1beta1.Continent getContinent(); +} diff --git a/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ErrorWithMultipleDetails.java b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ErrorWithMultipleDetails.java new file mode 100644 index 0000000000..aafc4cec91 --- /dev/null +++ b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ErrorWithMultipleDetails.java @@ -0,0 +1,751 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/echo.proto + +// Protobuf Java Version: 3.25.8 +package com.google.showcase.v1beta1; + +/** Protobuf type {@code google.showcase.v1beta1.ErrorWithMultipleDetails} */ +public final class ErrorWithMultipleDetails extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.ErrorWithMultipleDetails) + ErrorWithMultipleDetailsOrBuilder { + private static final long serialVersionUID = 0L; + + // Use ErrorWithMultipleDetails.newBuilder() to construct. + private ErrorWithMultipleDetails(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ErrorWithMultipleDetails() { + details_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ErrorWithMultipleDetails(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.EchoOuterClass + .internal_static_google_showcase_v1beta1_ErrorWithMultipleDetails_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.EchoOuterClass + .internal_static_google_showcase_v1beta1_ErrorWithMultipleDetails_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.ErrorWithMultipleDetails.class, + com.google.showcase.v1beta1.ErrorWithMultipleDetails.Builder.class); + } + + public static final int DETAILS_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private java.util.List details_; + + /** repeated .google.protobuf.Any details = 1; */ + @java.lang.Override + public java.util.List getDetailsList() { + return details_; + } + + /** repeated .google.protobuf.Any details = 1; */ + @java.lang.Override + public java.util.List getDetailsOrBuilderList() { + return details_; + } + + /** repeated .google.protobuf.Any details = 1; */ + @java.lang.Override + public int getDetailsCount() { + return details_.size(); + } + + /** repeated .google.protobuf.Any details = 1; */ + @java.lang.Override + public com.google.protobuf.Any getDetails(int index) { + return details_.get(index); + } + + /** repeated .google.protobuf.Any details = 1; */ + @java.lang.Override + public com.google.protobuf.AnyOrBuilder getDetailsOrBuilder(int index) { + return details_.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 < details_.size(); i++) { + output.writeMessage(1, details_.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 < details_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, details_.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.showcase.v1beta1.ErrorWithMultipleDetails)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.ErrorWithMultipleDetails other = + (com.google.showcase.v1beta1.ErrorWithMultipleDetails) obj; + + if (!getDetailsList().equals(other.getDetailsList())) 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 (getDetailsCount() > 0) { + hash = (37 * hash) + DETAILS_FIELD_NUMBER; + hash = (53 * hash) + getDetailsList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.showcase.v1beta1.ErrorWithMultipleDetails parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.ErrorWithMultipleDetails parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.ErrorWithMultipleDetails parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.ErrorWithMultipleDetails 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.showcase.v1beta1.ErrorWithMultipleDetails parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.ErrorWithMultipleDetails parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.ErrorWithMultipleDetails parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.ErrorWithMultipleDetails 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.showcase.v1beta1.ErrorWithMultipleDetails parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.ErrorWithMultipleDetails 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.showcase.v1beta1.ErrorWithMultipleDetails parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.ErrorWithMultipleDetails 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.showcase.v1beta1.ErrorWithMultipleDetails prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** Protobuf type {@code google.showcase.v1beta1.ErrorWithMultipleDetails} */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.ErrorWithMultipleDetails) + com.google.showcase.v1beta1.ErrorWithMultipleDetailsOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.EchoOuterClass + .internal_static_google_showcase_v1beta1_ErrorWithMultipleDetails_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.EchoOuterClass + .internal_static_google_showcase_v1beta1_ErrorWithMultipleDetails_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.ErrorWithMultipleDetails.class, + com.google.showcase.v1beta1.ErrorWithMultipleDetails.Builder.class); + } + + // Construct using com.google.showcase.v1beta1.ErrorWithMultipleDetails.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (detailsBuilder_ == null) { + details_ = java.util.Collections.emptyList(); + } else { + details_ = null; + detailsBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.showcase.v1beta1.EchoOuterClass + .internal_static_google_showcase_v1beta1_ErrorWithMultipleDetails_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.ErrorWithMultipleDetails getDefaultInstanceForType() { + return com.google.showcase.v1beta1.ErrorWithMultipleDetails.getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.ErrorWithMultipleDetails build() { + com.google.showcase.v1beta1.ErrorWithMultipleDetails result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.ErrorWithMultipleDetails buildPartial() { + com.google.showcase.v1beta1.ErrorWithMultipleDetails result = + new com.google.showcase.v1beta1.ErrorWithMultipleDetails(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields( + com.google.showcase.v1beta1.ErrorWithMultipleDetails result) { + if (detailsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + details_ = java.util.Collections.unmodifiableList(details_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.details_ = details_; + } else { + result.details_ = detailsBuilder_.build(); + } + } + + private void buildPartial0(com.google.showcase.v1beta1.ErrorWithMultipleDetails 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.showcase.v1beta1.ErrorWithMultipleDetails) { + return mergeFrom((com.google.showcase.v1beta1.ErrorWithMultipleDetails) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.showcase.v1beta1.ErrorWithMultipleDetails other) { + if (other == com.google.showcase.v1beta1.ErrorWithMultipleDetails.getDefaultInstance()) + return this; + if (detailsBuilder_ == null) { + if (!other.details_.isEmpty()) { + if (details_.isEmpty()) { + details_ = other.details_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureDetailsIsMutable(); + details_.addAll(other.details_); + } + onChanged(); + } + } else { + if (!other.details_.isEmpty()) { + if (detailsBuilder_.isEmpty()) { + detailsBuilder_.dispose(); + detailsBuilder_ = null; + details_ = other.details_; + bitField0_ = (bitField0_ & ~0x00000001); + detailsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getDetailsFieldBuilder() + : null; + } else { + detailsBuilder_.addAllMessages(other.details_); + } + } + } + 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.Any m = + input.readMessage(com.google.protobuf.Any.parser(), extensionRegistry); + if (detailsBuilder_ == null) { + ensureDetailsIsMutable(); + details_.add(m); + } else { + detailsBuilder_.addMessage(m); + } + 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.util.List details_ = java.util.Collections.emptyList(); + + private void ensureDetailsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + details_ = new java.util.ArrayList(details_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.protobuf.Any, + com.google.protobuf.Any.Builder, + com.google.protobuf.AnyOrBuilder> + detailsBuilder_; + + /** repeated .google.protobuf.Any details = 1; */ + public java.util.List getDetailsList() { + if (detailsBuilder_ == null) { + return java.util.Collections.unmodifiableList(details_); + } else { + return detailsBuilder_.getMessageList(); + } + } + + /** repeated .google.protobuf.Any details = 1; */ + public int getDetailsCount() { + if (detailsBuilder_ == null) { + return details_.size(); + } else { + return detailsBuilder_.getCount(); + } + } + + /** repeated .google.protobuf.Any details = 1; */ + public com.google.protobuf.Any getDetails(int index) { + if (detailsBuilder_ == null) { + return details_.get(index); + } else { + return detailsBuilder_.getMessage(index); + } + } + + /** repeated .google.protobuf.Any details = 1; */ + public Builder setDetails(int index, com.google.protobuf.Any value) { + if (detailsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureDetailsIsMutable(); + details_.set(index, value); + onChanged(); + } else { + detailsBuilder_.setMessage(index, value); + } + return this; + } + + /** repeated .google.protobuf.Any details = 1; */ + public Builder setDetails(int index, com.google.protobuf.Any.Builder builderForValue) { + if (detailsBuilder_ == null) { + ensureDetailsIsMutable(); + details_.set(index, builderForValue.build()); + onChanged(); + } else { + detailsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + + /** repeated .google.protobuf.Any details = 1; */ + public Builder addDetails(com.google.protobuf.Any value) { + if (detailsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureDetailsIsMutable(); + details_.add(value); + onChanged(); + } else { + detailsBuilder_.addMessage(value); + } + return this; + } + + /** repeated .google.protobuf.Any details = 1; */ + public Builder addDetails(int index, com.google.protobuf.Any value) { + if (detailsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureDetailsIsMutable(); + details_.add(index, value); + onChanged(); + } else { + detailsBuilder_.addMessage(index, value); + } + return this; + } + + /** repeated .google.protobuf.Any details = 1; */ + public Builder addDetails(com.google.protobuf.Any.Builder builderForValue) { + if (detailsBuilder_ == null) { + ensureDetailsIsMutable(); + details_.add(builderForValue.build()); + onChanged(); + } else { + detailsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + + /** repeated .google.protobuf.Any details = 1; */ + public Builder addDetails(int index, com.google.protobuf.Any.Builder builderForValue) { + if (detailsBuilder_ == null) { + ensureDetailsIsMutable(); + details_.add(index, builderForValue.build()); + onChanged(); + } else { + detailsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + + /** repeated .google.protobuf.Any details = 1; */ + public Builder addAllDetails(java.lang.Iterable values) { + if (detailsBuilder_ == null) { + ensureDetailsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, details_); + onChanged(); + } else { + detailsBuilder_.addAllMessages(values); + } + return this; + } + + /** repeated .google.protobuf.Any details = 1; */ + public Builder clearDetails() { + if (detailsBuilder_ == null) { + details_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + detailsBuilder_.clear(); + } + return this; + } + + /** repeated .google.protobuf.Any details = 1; */ + public Builder removeDetails(int index) { + if (detailsBuilder_ == null) { + ensureDetailsIsMutable(); + details_.remove(index); + onChanged(); + } else { + detailsBuilder_.remove(index); + } + return this; + } + + /** repeated .google.protobuf.Any details = 1; */ + public com.google.protobuf.Any.Builder getDetailsBuilder(int index) { + return getDetailsFieldBuilder().getBuilder(index); + } + + /** repeated .google.protobuf.Any details = 1; */ + public com.google.protobuf.AnyOrBuilder getDetailsOrBuilder(int index) { + if (detailsBuilder_ == null) { + return details_.get(index); + } else { + return detailsBuilder_.getMessageOrBuilder(index); + } + } + + /** repeated .google.protobuf.Any details = 1; */ + public java.util.List getDetailsOrBuilderList() { + if (detailsBuilder_ != null) { + return detailsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(details_); + } + } + + /** repeated .google.protobuf.Any details = 1; */ + public com.google.protobuf.Any.Builder addDetailsBuilder() { + return getDetailsFieldBuilder().addBuilder(com.google.protobuf.Any.getDefaultInstance()); + } + + /** repeated .google.protobuf.Any details = 1; */ + public com.google.protobuf.Any.Builder addDetailsBuilder(int index) { + return getDetailsFieldBuilder() + .addBuilder(index, com.google.protobuf.Any.getDefaultInstance()); + } + + /** repeated .google.protobuf.Any details = 1; */ + public java.util.List getDetailsBuilderList() { + return getDetailsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.protobuf.Any, + com.google.protobuf.Any.Builder, + com.google.protobuf.AnyOrBuilder> + getDetailsFieldBuilder() { + if (detailsBuilder_ == null) { + detailsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.protobuf.Any, + com.google.protobuf.Any.Builder, + com.google.protobuf.AnyOrBuilder>( + details_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + details_ = null; + } + return detailsBuilder_; + } + + @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.showcase.v1beta1.ErrorWithMultipleDetails) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.ErrorWithMultipleDetails) + private static final com.google.showcase.v1beta1.ErrorWithMultipleDetails DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.ErrorWithMultipleDetails(); + } + + public static com.google.showcase.v1beta1.ErrorWithMultipleDetails getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ErrorWithMultipleDetails 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.showcase.v1beta1.ErrorWithMultipleDetails getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ErrorWithMultipleDetailsOrBuilder.java b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ErrorWithMultipleDetailsOrBuilder.java new file mode 100644 index 0000000000..e10993a139 --- /dev/null +++ b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ErrorWithMultipleDetailsOrBuilder.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 + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/echo.proto + +// Protobuf Java Version: 3.25.8 +package com.google.showcase.v1beta1; + +public interface ErrorWithMultipleDetailsOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.ErrorWithMultipleDetails) + com.google.protobuf.MessageOrBuilder { + + /** repeated .google.protobuf.Any details = 1; */ + java.util.List getDetailsList(); + + /** repeated .google.protobuf.Any details = 1; */ + com.google.protobuf.Any getDetails(int index); + + /** repeated .google.protobuf.Any details = 1; */ + int getDetailsCount(); + + /** repeated .google.protobuf.Any details = 1; */ + java.util.List getDetailsOrBuilderList(); + + /** repeated .google.protobuf.Any details = 1; */ + com.google.protobuf.AnyOrBuilder getDetailsOrBuilder(int index); +} diff --git a/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ErrorWithSingleDetail.java b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ErrorWithSingleDetail.java new file mode 100644 index 0000000000..74fca10806 --- /dev/null +++ b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ErrorWithSingleDetail.java @@ -0,0 +1,622 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/echo.proto + +// Protobuf Java Version: 3.25.8 +package com.google.showcase.v1beta1; + +/** Protobuf type {@code google.showcase.v1beta1.ErrorWithSingleDetail} */ +public final class ErrorWithSingleDetail extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.ErrorWithSingleDetail) + ErrorWithSingleDetailOrBuilder { + private static final long serialVersionUID = 0L; + + // Use ErrorWithSingleDetail.newBuilder() to construct. + private ErrorWithSingleDetail(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ErrorWithSingleDetail() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ErrorWithSingleDetail(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.EchoOuterClass + .internal_static_google_showcase_v1beta1_ErrorWithSingleDetail_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.EchoOuterClass + .internal_static_google_showcase_v1beta1_ErrorWithSingleDetail_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.ErrorWithSingleDetail.class, + com.google.showcase.v1beta1.ErrorWithSingleDetail.Builder.class); + } + + private int bitField0_; + public static final int DETAILS_FIELD_NUMBER = 1; + private com.google.protobuf.Any details_; + + /** + * .google.protobuf.Any details = 1; + * + * @return Whether the details field is set. + */ + @java.lang.Override + public boolean hasDetails() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * .google.protobuf.Any details = 1; + * + * @return The details. + */ + @java.lang.Override + public com.google.protobuf.Any getDetails() { + return details_ == null ? com.google.protobuf.Any.getDefaultInstance() : details_; + } + + /** .google.protobuf.Any details = 1; */ + @java.lang.Override + public com.google.protobuf.AnyOrBuilder getDetailsOrBuilder() { + return details_ == null ? com.google.protobuf.Any.getDefaultInstance() : details_; + } + + 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, getDetails()); + } + 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, getDetails()); + } + 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.showcase.v1beta1.ErrorWithSingleDetail)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.ErrorWithSingleDetail other = + (com.google.showcase.v1beta1.ErrorWithSingleDetail) obj; + + if (hasDetails() != other.hasDetails()) return false; + if (hasDetails()) { + if (!getDetails().equals(other.getDetails())) 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 (hasDetails()) { + hash = (37 * hash) + DETAILS_FIELD_NUMBER; + hash = (53 * hash) + getDetails().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.showcase.v1beta1.ErrorWithSingleDetail parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.ErrorWithSingleDetail parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.ErrorWithSingleDetail parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.ErrorWithSingleDetail 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.showcase.v1beta1.ErrorWithSingleDetail parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.ErrorWithSingleDetail parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.ErrorWithSingleDetail parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.ErrorWithSingleDetail 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.showcase.v1beta1.ErrorWithSingleDetail parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.ErrorWithSingleDetail 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.showcase.v1beta1.ErrorWithSingleDetail parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.ErrorWithSingleDetail 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.showcase.v1beta1.ErrorWithSingleDetail prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** Protobuf type {@code google.showcase.v1beta1.ErrorWithSingleDetail} */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.ErrorWithSingleDetail) + com.google.showcase.v1beta1.ErrorWithSingleDetailOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.EchoOuterClass + .internal_static_google_showcase_v1beta1_ErrorWithSingleDetail_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.EchoOuterClass + .internal_static_google_showcase_v1beta1_ErrorWithSingleDetail_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.ErrorWithSingleDetail.class, + com.google.showcase.v1beta1.ErrorWithSingleDetail.Builder.class); + } + + // Construct using com.google.showcase.v1beta1.ErrorWithSingleDetail.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getDetailsFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + details_ = null; + if (detailsBuilder_ != null) { + detailsBuilder_.dispose(); + detailsBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.showcase.v1beta1.EchoOuterClass + .internal_static_google_showcase_v1beta1_ErrorWithSingleDetail_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.ErrorWithSingleDetail getDefaultInstanceForType() { + return com.google.showcase.v1beta1.ErrorWithSingleDetail.getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.ErrorWithSingleDetail build() { + com.google.showcase.v1beta1.ErrorWithSingleDetail result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.ErrorWithSingleDetail buildPartial() { + com.google.showcase.v1beta1.ErrorWithSingleDetail result = + new com.google.showcase.v1beta1.ErrorWithSingleDetail(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.showcase.v1beta1.ErrorWithSingleDetail result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.details_ = detailsBuilder_ == null ? details_ : detailsBuilder_.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.showcase.v1beta1.ErrorWithSingleDetail) { + return mergeFrom((com.google.showcase.v1beta1.ErrorWithSingleDetail) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.showcase.v1beta1.ErrorWithSingleDetail other) { + if (other == com.google.showcase.v1beta1.ErrorWithSingleDetail.getDefaultInstance()) + return this; + if (other.hasDetails()) { + mergeDetails(other.getDetails()); + } + 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(getDetailsFieldBuilder().getBuilder(), extensionRegistry); + 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 com.google.protobuf.Any details_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Any, + com.google.protobuf.Any.Builder, + com.google.protobuf.AnyOrBuilder> + detailsBuilder_; + + /** + * .google.protobuf.Any details = 1; + * + * @return Whether the details field is set. + */ + public boolean hasDetails() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * .google.protobuf.Any details = 1; + * + * @return The details. + */ + public com.google.protobuf.Any getDetails() { + if (detailsBuilder_ == null) { + return details_ == null ? com.google.protobuf.Any.getDefaultInstance() : details_; + } else { + return detailsBuilder_.getMessage(); + } + } + + /** .google.protobuf.Any details = 1; */ + public Builder setDetails(com.google.protobuf.Any value) { + if (detailsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + details_ = value; + } else { + detailsBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** .google.protobuf.Any details = 1; */ + public Builder setDetails(com.google.protobuf.Any.Builder builderForValue) { + if (detailsBuilder_ == null) { + details_ = builderForValue.build(); + } else { + detailsBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** .google.protobuf.Any details = 1; */ + public Builder mergeDetails(com.google.protobuf.Any value) { + if (detailsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) + && details_ != null + && details_ != com.google.protobuf.Any.getDefaultInstance()) { + getDetailsBuilder().mergeFrom(value); + } else { + details_ = value; + } + } else { + detailsBuilder_.mergeFrom(value); + } + if (details_ != null) { + bitField0_ |= 0x00000001; + onChanged(); + } + return this; + } + + /** .google.protobuf.Any details = 1; */ + public Builder clearDetails() { + bitField0_ = (bitField0_ & ~0x00000001); + details_ = null; + if (detailsBuilder_ != null) { + detailsBuilder_.dispose(); + detailsBuilder_ = null; + } + onChanged(); + return this; + } + + /** .google.protobuf.Any details = 1; */ + public com.google.protobuf.Any.Builder getDetailsBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return getDetailsFieldBuilder().getBuilder(); + } + + /** .google.protobuf.Any details = 1; */ + public com.google.protobuf.AnyOrBuilder getDetailsOrBuilder() { + if (detailsBuilder_ != null) { + return detailsBuilder_.getMessageOrBuilder(); + } else { + return details_ == null ? com.google.protobuf.Any.getDefaultInstance() : details_; + } + } + + /** .google.protobuf.Any details = 1; */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Any, + com.google.protobuf.Any.Builder, + com.google.protobuf.AnyOrBuilder> + getDetailsFieldBuilder() { + if (detailsBuilder_ == null) { + detailsBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Any, + com.google.protobuf.Any.Builder, + com.google.protobuf.AnyOrBuilder>(getDetails(), getParentForChildren(), isClean()); + details_ = null; + } + return detailsBuilder_; + } + + @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.showcase.v1beta1.ErrorWithSingleDetail) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.ErrorWithSingleDetail) + private static final com.google.showcase.v1beta1.ErrorWithSingleDetail DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.ErrorWithSingleDetail(); + } + + public static com.google.showcase.v1beta1.ErrorWithSingleDetail getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ErrorWithSingleDetail 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.showcase.v1beta1.ErrorWithSingleDetail getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ErrorWithSingleDetailOrBuilder.java b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ErrorWithSingleDetailOrBuilder.java new file mode 100644 index 0000000000..2a5a74d974 --- /dev/null +++ b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ErrorWithSingleDetailOrBuilder.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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/echo.proto + +// Protobuf Java Version: 3.25.8 +package com.google.showcase.v1beta1; + +public interface ErrorWithSingleDetailOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.ErrorWithSingleDetail) + com.google.protobuf.MessageOrBuilder { + + /** + * .google.protobuf.Any details = 1; + * + * @return Whether the details field is set. + */ + boolean hasDetails(); + + /** + * .google.protobuf.Any details = 1; + * + * @return The details. + */ + com.google.protobuf.Any getDetails(); + + /** .google.protobuf.Any details = 1; */ + com.google.protobuf.AnyOrBuilder getDetailsOrBuilder(); +} diff --git a/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ExpandRequest.java b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ExpandRequest.java new file mode 100644 index 0000000000..a839f866f6 --- /dev/null +++ b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ExpandRequest.java @@ -0,0 +1,1192 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/echo.proto + +// Protobuf Java Version: 3.25.8 +package com.google.showcase.v1beta1; + +/** + * + * + *
        + * The request message for the Expand method.
        + * 
        + * + * Protobuf type {@code google.showcase.v1beta1.ExpandRequest} + */ +public final class ExpandRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.ExpandRequest) + ExpandRequestOrBuilder { + private static final long serialVersionUID = 0L; + + // Use ExpandRequest.newBuilder() to construct. + private ExpandRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ExpandRequest() { + content_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ExpandRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.EchoOuterClass + .internal_static_google_showcase_v1beta1_ExpandRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.EchoOuterClass + .internal_static_google_showcase_v1beta1_ExpandRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.ExpandRequest.class, + com.google.showcase.v1beta1.ExpandRequest.Builder.class); + } + + private int bitField0_; + public static final int CONTENT_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object content_ = ""; + + /** + * + * + *
        +   * The content that will be split into words and returned on the stream.
        +   * 
        + * + * string content = 1; + * + * @return The content. + */ + @java.lang.Override + public java.lang.String getContent() { + java.lang.Object ref = content_; + 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(); + content_ = s; + return s; + } + } + + /** + * + * + *
        +   * The content that will be split into words and returned on the stream.
        +   * 
        + * + * string content = 1; + * + * @return The bytes for content. + */ + @java.lang.Override + public com.google.protobuf.ByteString getContentBytes() { + java.lang.Object ref = content_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + content_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int ERROR_FIELD_NUMBER = 2; + private com.google.rpc.Status error_; + + /** + * + * + *
        +   * The error that is thrown after all words are sent on the stream.
        +   * 
        + * + * .google.rpc.Status error = 2; + * + * @return Whether the error field is set. + */ + @java.lang.Override + public boolean hasError() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
        +   * The error that is thrown after all words are sent on the stream.
        +   * 
        + * + * .google.rpc.Status error = 2; + * + * @return The error. + */ + @java.lang.Override + public com.google.rpc.Status getError() { + return error_ == null ? com.google.rpc.Status.getDefaultInstance() : error_; + } + + /** + * + * + *
        +   * The error that is thrown after all words are sent on the stream.
        +   * 
        + * + * .google.rpc.Status error = 2; + */ + @java.lang.Override + public com.google.rpc.StatusOrBuilder getErrorOrBuilder() { + return error_ == null ? com.google.rpc.Status.getDefaultInstance() : error_; + } + + public static final int STREAM_WAIT_TIME_FIELD_NUMBER = 3; + private com.google.protobuf.Duration streamWaitTime_; + + /** + * + * + *
        +   * The wait time between each server streaming messages
        +   * 
        + * + * .google.protobuf.Duration stream_wait_time = 3; + * + * @return Whether the streamWaitTime field is set. + */ + @java.lang.Override + public boolean hasStreamWaitTime() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
        +   * The wait time between each server streaming messages
        +   * 
        + * + * .google.protobuf.Duration stream_wait_time = 3; + * + * @return The streamWaitTime. + */ + @java.lang.Override + public com.google.protobuf.Duration getStreamWaitTime() { + return streamWaitTime_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : streamWaitTime_; + } + + /** + * + * + *
        +   * The wait time between each server streaming messages
        +   * 
        + * + * .google.protobuf.Duration stream_wait_time = 3; + */ + @java.lang.Override + public com.google.protobuf.DurationOrBuilder getStreamWaitTimeOrBuilder() { + return streamWaitTime_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : streamWaitTime_; + } + + 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(content_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, content_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(2, getError()); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeMessage(3, getStreamWaitTime()); + } + 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(content_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, content_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getError()); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getStreamWaitTime()); + } + 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.showcase.v1beta1.ExpandRequest)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.ExpandRequest other = + (com.google.showcase.v1beta1.ExpandRequest) obj; + + if (!getContent().equals(other.getContent())) return false; + if (hasError() != other.hasError()) return false; + if (hasError()) { + if (!getError().equals(other.getError())) return false; + } + if (hasStreamWaitTime() != other.hasStreamWaitTime()) return false; + if (hasStreamWaitTime()) { + if (!getStreamWaitTime().equals(other.getStreamWaitTime())) 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) + CONTENT_FIELD_NUMBER; + hash = (53 * hash) + getContent().hashCode(); + if (hasError()) { + hash = (37 * hash) + ERROR_FIELD_NUMBER; + hash = (53 * hash) + getError().hashCode(); + } + if (hasStreamWaitTime()) { + hash = (37 * hash) + STREAM_WAIT_TIME_FIELD_NUMBER; + hash = (53 * hash) + getStreamWaitTime().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.showcase.v1beta1.ExpandRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.ExpandRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.ExpandRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.ExpandRequest 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.showcase.v1beta1.ExpandRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.ExpandRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.ExpandRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.ExpandRequest 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.showcase.v1beta1.ExpandRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.ExpandRequest 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.showcase.v1beta1.ExpandRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.ExpandRequest 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.showcase.v1beta1.ExpandRequest 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 request message for the Expand method.
        +   * 
        + * + * Protobuf type {@code google.showcase.v1beta1.ExpandRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.ExpandRequest) + com.google.showcase.v1beta1.ExpandRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.EchoOuterClass + .internal_static_google_showcase_v1beta1_ExpandRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.EchoOuterClass + .internal_static_google_showcase_v1beta1_ExpandRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.ExpandRequest.class, + com.google.showcase.v1beta1.ExpandRequest.Builder.class); + } + + // Construct using com.google.showcase.v1beta1.ExpandRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getErrorFieldBuilder(); + getStreamWaitTimeFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + content_ = ""; + error_ = null; + if (errorBuilder_ != null) { + errorBuilder_.dispose(); + errorBuilder_ = null; + } + streamWaitTime_ = null; + if (streamWaitTimeBuilder_ != null) { + streamWaitTimeBuilder_.dispose(); + streamWaitTimeBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.showcase.v1beta1.EchoOuterClass + .internal_static_google_showcase_v1beta1_ExpandRequest_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.ExpandRequest getDefaultInstanceForType() { + return com.google.showcase.v1beta1.ExpandRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.ExpandRequest build() { + com.google.showcase.v1beta1.ExpandRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.ExpandRequest buildPartial() { + com.google.showcase.v1beta1.ExpandRequest result = + new com.google.showcase.v1beta1.ExpandRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.showcase.v1beta1.ExpandRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.content_ = content_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.error_ = errorBuilder_ == null ? error_ : errorBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.streamWaitTime_ = + streamWaitTimeBuilder_ == null ? streamWaitTime_ : streamWaitTimeBuilder_.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.showcase.v1beta1.ExpandRequest) { + return mergeFrom((com.google.showcase.v1beta1.ExpandRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.showcase.v1beta1.ExpandRequest other) { + if (other == com.google.showcase.v1beta1.ExpandRequest.getDefaultInstance()) return this; + if (!other.getContent().isEmpty()) { + content_ = other.content_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.hasError()) { + mergeError(other.getError()); + } + if (other.hasStreamWaitTime()) { + mergeStreamWaitTime(other.getStreamWaitTime()); + } + 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: + { + content_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + input.readMessage(getErrorFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + input.readMessage(getStreamWaitTimeFieldBuilder().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 content_ = ""; + + /** + * + * + *
        +     * The content that will be split into words and returned on the stream.
        +     * 
        + * + * string content = 1; + * + * @return The content. + */ + public java.lang.String getContent() { + java.lang.Object ref = content_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + content_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
        +     * The content that will be split into words and returned on the stream.
        +     * 
        + * + * string content = 1; + * + * @return The bytes for content. + */ + public com.google.protobuf.ByteString getContentBytes() { + java.lang.Object ref = content_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + content_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
        +     * The content that will be split into words and returned on the stream.
        +     * 
        + * + * string content = 1; + * + * @param value The content to set. + * @return This builder for chaining. + */ + public Builder setContent(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + content_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
        +     * The content that will be split into words and returned on the stream.
        +     * 
        + * + * string content = 1; + * + * @return This builder for chaining. + */ + public Builder clearContent() { + content_ = getDefaultInstance().getContent(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
        +     * The content that will be split into words and returned on the stream.
        +     * 
        + * + * string content = 1; + * + * @param value The bytes for content to set. + * @return This builder for chaining. + */ + public Builder setContentBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + content_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private com.google.rpc.Status error_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.rpc.Status, com.google.rpc.Status.Builder, com.google.rpc.StatusOrBuilder> + errorBuilder_; + + /** + * + * + *
        +     * The error that is thrown after all words are sent on the stream.
        +     * 
        + * + * .google.rpc.Status error = 2; + * + * @return Whether the error field is set. + */ + public boolean hasError() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
        +     * The error that is thrown after all words are sent on the stream.
        +     * 
        + * + * .google.rpc.Status error = 2; + * + * @return The error. + */ + public com.google.rpc.Status getError() { + if (errorBuilder_ == null) { + return error_ == null ? com.google.rpc.Status.getDefaultInstance() : error_; + } else { + return errorBuilder_.getMessage(); + } + } + + /** + * + * + *
        +     * The error that is thrown after all words are sent on the stream.
        +     * 
        + * + * .google.rpc.Status error = 2; + */ + public Builder setError(com.google.rpc.Status value) { + if (errorBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + error_ = value; + } else { + errorBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
        +     * The error that is thrown after all words are sent on the stream.
        +     * 
        + * + * .google.rpc.Status error = 2; + */ + public Builder setError(com.google.rpc.Status.Builder builderForValue) { + if (errorBuilder_ == null) { + error_ = builderForValue.build(); + } else { + errorBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
        +     * The error that is thrown after all words are sent on the stream.
        +     * 
        + * + * .google.rpc.Status error = 2; + */ + public Builder mergeError(com.google.rpc.Status value) { + if (errorBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && error_ != null + && error_ != com.google.rpc.Status.getDefaultInstance()) { + getErrorBuilder().mergeFrom(value); + } else { + error_ = value; + } + } else { + errorBuilder_.mergeFrom(value); + } + if (error_ != null) { + bitField0_ |= 0x00000002; + onChanged(); + } + return this; + } + + /** + * + * + *
        +     * The error that is thrown after all words are sent on the stream.
        +     * 
        + * + * .google.rpc.Status error = 2; + */ + public Builder clearError() { + bitField0_ = (bitField0_ & ~0x00000002); + error_ = null; + if (errorBuilder_ != null) { + errorBuilder_.dispose(); + errorBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
        +     * The error that is thrown after all words are sent on the stream.
        +     * 
        + * + * .google.rpc.Status error = 2; + */ + public com.google.rpc.Status.Builder getErrorBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return getErrorFieldBuilder().getBuilder(); + } + + /** + * + * + *
        +     * The error that is thrown after all words are sent on the stream.
        +     * 
        + * + * .google.rpc.Status error = 2; + */ + public com.google.rpc.StatusOrBuilder getErrorOrBuilder() { + if (errorBuilder_ != null) { + return errorBuilder_.getMessageOrBuilder(); + } else { + return error_ == null ? com.google.rpc.Status.getDefaultInstance() : error_; + } + } + + /** + * + * + *
        +     * The error that is thrown after all words are sent on the stream.
        +     * 
        + * + * .google.rpc.Status error = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.rpc.Status, com.google.rpc.Status.Builder, com.google.rpc.StatusOrBuilder> + getErrorFieldBuilder() { + if (errorBuilder_ == null) { + errorBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.rpc.Status, + com.google.rpc.Status.Builder, + com.google.rpc.StatusOrBuilder>(getError(), getParentForChildren(), isClean()); + error_ = null; + } + return errorBuilder_; + } + + private com.google.protobuf.Duration streamWaitTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder> + streamWaitTimeBuilder_; + + /** + * + * + *
        +     * The wait time between each server streaming messages
        +     * 
        + * + * .google.protobuf.Duration stream_wait_time = 3; + * + * @return Whether the streamWaitTime field is set. + */ + public boolean hasStreamWaitTime() { + return ((bitField0_ & 0x00000004) != 0); + } + + /** + * + * + *
        +     * The wait time between each server streaming messages
        +     * 
        + * + * .google.protobuf.Duration stream_wait_time = 3; + * + * @return The streamWaitTime. + */ + public com.google.protobuf.Duration getStreamWaitTime() { + if (streamWaitTimeBuilder_ == null) { + return streamWaitTime_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : streamWaitTime_; + } else { + return streamWaitTimeBuilder_.getMessage(); + } + } + + /** + * + * + *
        +     * The wait time between each server streaming messages
        +     * 
        + * + * .google.protobuf.Duration stream_wait_time = 3; + */ + public Builder setStreamWaitTime(com.google.protobuf.Duration value) { + if (streamWaitTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + streamWaitTime_ = value; + } else { + streamWaitTimeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
        +     * The wait time between each server streaming messages
        +     * 
        + * + * .google.protobuf.Duration stream_wait_time = 3; + */ + public Builder setStreamWaitTime(com.google.protobuf.Duration.Builder builderForValue) { + if (streamWaitTimeBuilder_ == null) { + streamWaitTime_ = builderForValue.build(); + } else { + streamWaitTimeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
        +     * The wait time between each server streaming messages
        +     * 
        + * + * .google.protobuf.Duration stream_wait_time = 3; + */ + public Builder mergeStreamWaitTime(com.google.protobuf.Duration value) { + if (streamWaitTimeBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0) + && streamWaitTime_ != null + && streamWaitTime_ != com.google.protobuf.Duration.getDefaultInstance()) { + getStreamWaitTimeBuilder().mergeFrom(value); + } else { + streamWaitTime_ = value; + } + } else { + streamWaitTimeBuilder_.mergeFrom(value); + } + if (streamWaitTime_ != null) { + bitField0_ |= 0x00000004; + onChanged(); + } + return this; + } + + /** + * + * + *
        +     * The wait time between each server streaming messages
        +     * 
        + * + * .google.protobuf.Duration stream_wait_time = 3; + */ + public Builder clearStreamWaitTime() { + bitField0_ = (bitField0_ & ~0x00000004); + streamWaitTime_ = null; + if (streamWaitTimeBuilder_ != null) { + streamWaitTimeBuilder_.dispose(); + streamWaitTimeBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
        +     * The wait time between each server streaming messages
        +     * 
        + * + * .google.protobuf.Duration stream_wait_time = 3; + */ + public com.google.protobuf.Duration.Builder getStreamWaitTimeBuilder() { + bitField0_ |= 0x00000004; + onChanged(); + return getStreamWaitTimeFieldBuilder().getBuilder(); + } + + /** + * + * + *
        +     * The wait time between each server streaming messages
        +     * 
        + * + * .google.protobuf.Duration stream_wait_time = 3; + */ + public com.google.protobuf.DurationOrBuilder getStreamWaitTimeOrBuilder() { + if (streamWaitTimeBuilder_ != null) { + return streamWaitTimeBuilder_.getMessageOrBuilder(); + } else { + return streamWaitTime_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : streamWaitTime_; + } + } + + /** + * + * + *
        +     * The wait time between each server streaming messages
        +     * 
        + * + * .google.protobuf.Duration stream_wait_time = 3; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder> + getStreamWaitTimeFieldBuilder() { + if (streamWaitTimeBuilder_ == null) { + streamWaitTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder>( + getStreamWaitTime(), getParentForChildren(), isClean()); + streamWaitTime_ = null; + } + return streamWaitTimeBuilder_; + } + + @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.showcase.v1beta1.ExpandRequest) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.ExpandRequest) + private static final com.google.showcase.v1beta1.ExpandRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.ExpandRequest(); + } + + public static com.google.showcase.v1beta1.ExpandRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ExpandRequest 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.showcase.v1beta1.ExpandRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ExpandRequestOrBuilder.java b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ExpandRequestOrBuilder.java new file mode 100644 index 0000000000..d10d9fe568 --- /dev/null +++ b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ExpandRequestOrBuilder.java @@ -0,0 +1,126 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/echo.proto + +// Protobuf Java Version: 3.25.8 +package com.google.showcase.v1beta1; + +public interface ExpandRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.ExpandRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
        +   * The content that will be split into words and returned on the stream.
        +   * 
        + * + * string content = 1; + * + * @return The content. + */ + java.lang.String getContent(); + + /** + * + * + *
        +   * The content that will be split into words and returned on the stream.
        +   * 
        + * + * string content = 1; + * + * @return The bytes for content. + */ + com.google.protobuf.ByteString getContentBytes(); + + /** + * + * + *
        +   * The error that is thrown after all words are sent on the stream.
        +   * 
        + * + * .google.rpc.Status error = 2; + * + * @return Whether the error field is set. + */ + boolean hasError(); + + /** + * + * + *
        +   * The error that is thrown after all words are sent on the stream.
        +   * 
        + * + * .google.rpc.Status error = 2; + * + * @return The error. + */ + com.google.rpc.Status getError(); + + /** + * + * + *
        +   * The error that is thrown after all words are sent on the stream.
        +   * 
        + * + * .google.rpc.Status error = 2; + */ + com.google.rpc.StatusOrBuilder getErrorOrBuilder(); + + /** + * + * + *
        +   * The wait time between each server streaming messages
        +   * 
        + * + * .google.protobuf.Duration stream_wait_time = 3; + * + * @return Whether the streamWaitTime field is set. + */ + boolean hasStreamWaitTime(); + + /** + * + * + *
        +   * The wait time between each server streaming messages
        +   * 
        + * + * .google.protobuf.Duration stream_wait_time = 3; + * + * @return The streamWaitTime. + */ + com.google.protobuf.Duration getStreamWaitTime(); + + /** + * + * + *
        +   * The wait time between each server streaming messages
        +   * 
        + * + * .google.protobuf.Duration stream_wait_time = 3; + */ + com.google.protobuf.DurationOrBuilder getStreamWaitTimeOrBuilder(); +} diff --git a/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/FailEchoWithDetailsRequest.java b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/FailEchoWithDetailsRequest.java new file mode 100644 index 0000000000..d38eeda56a --- /dev/null +++ b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/FailEchoWithDetailsRequest.java @@ -0,0 +1,642 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/echo.proto + +// Protobuf Java Version: 3.25.8 +package com.google.showcase.v1beta1; + +/** + * + * + *
        + * The request message used for the FailEchoWithDetails method.
        + * 
        + * + * Protobuf type {@code google.showcase.v1beta1.FailEchoWithDetailsRequest} + */ +public final class FailEchoWithDetailsRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.FailEchoWithDetailsRequest) + FailEchoWithDetailsRequestOrBuilder { + private static final long serialVersionUID = 0L; + + // Use FailEchoWithDetailsRequest.newBuilder() to construct. + private FailEchoWithDetailsRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private FailEchoWithDetailsRequest() { + message_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new FailEchoWithDetailsRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.EchoOuterClass + .internal_static_google_showcase_v1beta1_FailEchoWithDetailsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.EchoOuterClass + .internal_static_google_showcase_v1beta1_FailEchoWithDetailsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.FailEchoWithDetailsRequest.class, + com.google.showcase.v1beta1.FailEchoWithDetailsRequest.Builder.class); + } + + public static final int MESSAGE_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object message_ = ""; + + /** + * + * + *
        +   * Optional message to echo back in the PoetryError. If empty, a value will be
        +   * provided.
        +   * 
        + * + * string message = 1; + * + * @return The message. + */ + @java.lang.Override + public java.lang.String getMessage() { + java.lang.Object ref = message_; + 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(); + message_ = s; + return s; + } + } + + /** + * + * + *
        +   * Optional message to echo back in the PoetryError. If empty, a value will be
        +   * provided.
        +   * 
        + * + * string message = 1; + * + * @return The bytes for message. + */ + @java.lang.Override + public com.google.protobuf.ByteString getMessageBytes() { + java.lang.Object ref = message_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + message_ = 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(message_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, message_); + } + 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(message_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, message_); + } + 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.showcase.v1beta1.FailEchoWithDetailsRequest)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.FailEchoWithDetailsRequest other = + (com.google.showcase.v1beta1.FailEchoWithDetailsRequest) obj; + + if (!getMessage().equals(other.getMessage())) 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) + MESSAGE_FIELD_NUMBER; + hash = (53 * hash) + getMessage().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.showcase.v1beta1.FailEchoWithDetailsRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.FailEchoWithDetailsRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.FailEchoWithDetailsRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.FailEchoWithDetailsRequest 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.showcase.v1beta1.FailEchoWithDetailsRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.FailEchoWithDetailsRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.FailEchoWithDetailsRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.FailEchoWithDetailsRequest 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.showcase.v1beta1.FailEchoWithDetailsRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.FailEchoWithDetailsRequest 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.showcase.v1beta1.FailEchoWithDetailsRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.FailEchoWithDetailsRequest 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.showcase.v1beta1.FailEchoWithDetailsRequest 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 request message used for the FailEchoWithDetails method.
        +   * 
        + * + * Protobuf type {@code google.showcase.v1beta1.FailEchoWithDetailsRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.FailEchoWithDetailsRequest) + com.google.showcase.v1beta1.FailEchoWithDetailsRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.EchoOuterClass + .internal_static_google_showcase_v1beta1_FailEchoWithDetailsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.EchoOuterClass + .internal_static_google_showcase_v1beta1_FailEchoWithDetailsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.FailEchoWithDetailsRequest.class, + com.google.showcase.v1beta1.FailEchoWithDetailsRequest.Builder.class); + } + + // Construct using com.google.showcase.v1beta1.FailEchoWithDetailsRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + message_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.showcase.v1beta1.EchoOuterClass + .internal_static_google_showcase_v1beta1_FailEchoWithDetailsRequest_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.FailEchoWithDetailsRequest getDefaultInstanceForType() { + return com.google.showcase.v1beta1.FailEchoWithDetailsRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.FailEchoWithDetailsRequest build() { + com.google.showcase.v1beta1.FailEchoWithDetailsRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.FailEchoWithDetailsRequest buildPartial() { + com.google.showcase.v1beta1.FailEchoWithDetailsRequest result = + new com.google.showcase.v1beta1.FailEchoWithDetailsRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.showcase.v1beta1.FailEchoWithDetailsRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.message_ = message_; + } + } + + @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.showcase.v1beta1.FailEchoWithDetailsRequest) { + return mergeFrom((com.google.showcase.v1beta1.FailEchoWithDetailsRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.showcase.v1beta1.FailEchoWithDetailsRequest other) { + if (other == com.google.showcase.v1beta1.FailEchoWithDetailsRequest.getDefaultInstance()) + return this; + if (!other.getMessage().isEmpty()) { + message_ = other.message_; + 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: + { + message_ = 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 message_ = ""; + + /** + * + * + *
        +     * Optional message to echo back in the PoetryError. If empty, a value will be
        +     * provided.
        +     * 
        + * + * string message = 1; + * + * @return The message. + */ + public java.lang.String getMessage() { + java.lang.Object ref = message_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + message_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
        +     * Optional message to echo back in the PoetryError. If empty, a value will be
        +     * provided.
        +     * 
        + * + * string message = 1; + * + * @return The bytes for message. + */ + public com.google.protobuf.ByteString getMessageBytes() { + java.lang.Object ref = message_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + message_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
        +     * Optional message to echo back in the PoetryError. If empty, a value will be
        +     * provided.
        +     * 
        + * + * string message = 1; + * + * @param value The message to set. + * @return This builder for chaining. + */ + public Builder setMessage(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + message_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
        +     * Optional message to echo back in the PoetryError. If empty, a value will be
        +     * provided.
        +     * 
        + * + * string message = 1; + * + * @return This builder for chaining. + */ + public Builder clearMessage() { + message_ = getDefaultInstance().getMessage(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
        +     * Optional message to echo back in the PoetryError. If empty, a value will be
        +     * provided.
        +     * 
        + * + * string message = 1; + * + * @param value The bytes for message to set. + * @return This builder for chaining. + */ + public Builder setMessageBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + message_ = 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.showcase.v1beta1.FailEchoWithDetailsRequest) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.FailEchoWithDetailsRequest) + private static final com.google.showcase.v1beta1.FailEchoWithDetailsRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.FailEchoWithDetailsRequest(); + } + + public static com.google.showcase.v1beta1.FailEchoWithDetailsRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public FailEchoWithDetailsRequest 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.showcase.v1beta1.FailEchoWithDetailsRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/FailEchoWithDetailsRequestOrBuilder.java b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/FailEchoWithDetailsRequestOrBuilder.java new file mode 100644 index 0000000000..e54336c404 --- /dev/null +++ b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/FailEchoWithDetailsRequestOrBuilder.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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/echo.proto + +// Protobuf Java Version: 3.25.8 +package com.google.showcase.v1beta1; + +public interface FailEchoWithDetailsRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.FailEchoWithDetailsRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
        +   * Optional message to echo back in the PoetryError. If empty, a value will be
        +   * provided.
        +   * 
        + * + * string message = 1; + * + * @return The message. + */ + java.lang.String getMessage(); + + /** + * + * + *
        +   * Optional message to echo back in the PoetryError. If empty, a value will be
        +   * provided.
        +   * 
        + * + * string message = 1; + * + * @return The bytes for message. + */ + com.google.protobuf.ByteString getMessageBytes(); +} diff --git a/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/FailEchoWithDetailsResponse.java b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/FailEchoWithDetailsResponse.java new file mode 100644 index 0000000000..3f89f9ae61 --- /dev/null +++ b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/FailEchoWithDetailsResponse.java @@ -0,0 +1,437 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/echo.proto + +// Protobuf Java Version: 3.25.8 +package com.google.showcase.v1beta1; + +/** + * + * + *
        + * The response message declared (but never used) for the FailEchoWithDetails
        + * method.
        + * 
        + * + * Protobuf type {@code google.showcase.v1beta1.FailEchoWithDetailsResponse} + */ +public final class FailEchoWithDetailsResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.FailEchoWithDetailsResponse) + FailEchoWithDetailsResponseOrBuilder { + private static final long serialVersionUID = 0L; + + // Use FailEchoWithDetailsResponse.newBuilder() to construct. + private FailEchoWithDetailsResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private FailEchoWithDetailsResponse() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new FailEchoWithDetailsResponse(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.EchoOuterClass + .internal_static_google_showcase_v1beta1_FailEchoWithDetailsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.EchoOuterClass + .internal_static_google_showcase_v1beta1_FailEchoWithDetailsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.FailEchoWithDetailsResponse.class, + com.google.showcase.v1beta1.FailEchoWithDetailsResponse.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.showcase.v1beta1.FailEchoWithDetailsResponse)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.FailEchoWithDetailsResponse other = + (com.google.showcase.v1beta1.FailEchoWithDetailsResponse) 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.showcase.v1beta1.FailEchoWithDetailsResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.FailEchoWithDetailsResponse parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.FailEchoWithDetailsResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.FailEchoWithDetailsResponse 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.showcase.v1beta1.FailEchoWithDetailsResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.FailEchoWithDetailsResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.FailEchoWithDetailsResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.FailEchoWithDetailsResponse 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.showcase.v1beta1.FailEchoWithDetailsResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.FailEchoWithDetailsResponse 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.showcase.v1beta1.FailEchoWithDetailsResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.FailEchoWithDetailsResponse 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.showcase.v1beta1.FailEchoWithDetailsResponse 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 message declared (but never used) for the FailEchoWithDetails
        +   * method.
        +   * 
        + * + * Protobuf type {@code google.showcase.v1beta1.FailEchoWithDetailsResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.FailEchoWithDetailsResponse) + com.google.showcase.v1beta1.FailEchoWithDetailsResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.EchoOuterClass + .internal_static_google_showcase_v1beta1_FailEchoWithDetailsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.EchoOuterClass + .internal_static_google_showcase_v1beta1_FailEchoWithDetailsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.FailEchoWithDetailsResponse.class, + com.google.showcase.v1beta1.FailEchoWithDetailsResponse.Builder.class); + } + + // Construct using com.google.showcase.v1beta1.FailEchoWithDetailsResponse.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.showcase.v1beta1.EchoOuterClass + .internal_static_google_showcase_v1beta1_FailEchoWithDetailsResponse_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.FailEchoWithDetailsResponse getDefaultInstanceForType() { + return com.google.showcase.v1beta1.FailEchoWithDetailsResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.FailEchoWithDetailsResponse build() { + com.google.showcase.v1beta1.FailEchoWithDetailsResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.FailEchoWithDetailsResponse buildPartial() { + com.google.showcase.v1beta1.FailEchoWithDetailsResponse result = + new com.google.showcase.v1beta1.FailEchoWithDetailsResponse(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.showcase.v1beta1.FailEchoWithDetailsResponse) { + return mergeFrom((com.google.showcase.v1beta1.FailEchoWithDetailsResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.showcase.v1beta1.FailEchoWithDetailsResponse other) { + if (other == com.google.showcase.v1beta1.FailEchoWithDetailsResponse.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.showcase.v1beta1.FailEchoWithDetailsResponse) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.FailEchoWithDetailsResponse) + private static final com.google.showcase.v1beta1.FailEchoWithDetailsResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.FailEchoWithDetailsResponse(); + } + + public static com.google.showcase.v1beta1.FailEchoWithDetailsResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public FailEchoWithDetailsResponse 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.showcase.v1beta1.FailEchoWithDetailsResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/FailEchoWithDetailsResponseOrBuilder.java b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/FailEchoWithDetailsResponseOrBuilder.java new file mode 100644 index 0000000000..ed0ede7c1b --- /dev/null +++ b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/FailEchoWithDetailsResponseOrBuilder.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: schema/google/showcase/v1beta1/echo.proto + +// Protobuf Java Version: 3.25.8 +package com.google.showcase.v1beta1; + +public interface FailEchoWithDetailsResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.FailEchoWithDetailsResponse) + com.google.protobuf.MessageOrBuilder {} diff --git a/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/GetBlurbRequest.java b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/GetBlurbRequest.java new file mode 100644 index 0000000000..c15dece9ee --- /dev/null +++ b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/GetBlurbRequest.java @@ -0,0 +1,649 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/messaging.proto + +// Protobuf Java Version: 3.25.8 +package com.google.showcase.v1beta1; + +/** + * + * + *
        + * The request message for the google.showcase.v1beta1.Messaging\GetBlurb
        + * method.
        + * 
        + * + * Protobuf type {@code google.showcase.v1beta1.GetBlurbRequest} + */ +public final class GetBlurbRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.GetBlurbRequest) + GetBlurbRequestOrBuilder { + private static final long serialVersionUID = 0L; + + // Use GetBlurbRequest.newBuilder() to construct. + private GetBlurbRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private GetBlurbRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new GetBlurbRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.MessagingOuterClass + .internal_static_google_showcase_v1beta1_GetBlurbRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.MessagingOuterClass + .internal_static_google_showcase_v1beta1_GetBlurbRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.GetBlurbRequest.class, + com.google.showcase.v1beta1.GetBlurbRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + + /** + * + * + *
        +   * The resource name of the requested blurb.
        +   * 
        + * + * + * 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; + } + } + + /** + * + * + *
        +   * The resource name of the requested blurb.
        +   * 
        + * + * + * 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.showcase.v1beta1.GetBlurbRequest)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.GetBlurbRequest other = + (com.google.showcase.v1beta1.GetBlurbRequest) 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.showcase.v1beta1.GetBlurbRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.GetBlurbRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.GetBlurbRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.GetBlurbRequest 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.showcase.v1beta1.GetBlurbRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.GetBlurbRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.GetBlurbRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.GetBlurbRequest 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.showcase.v1beta1.GetBlurbRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.GetBlurbRequest 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.showcase.v1beta1.GetBlurbRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.GetBlurbRequest 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.showcase.v1beta1.GetBlurbRequest 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 request message for the google.showcase.v1beta1.Messaging\GetBlurb
        +   * method.
        +   * 
        + * + * Protobuf type {@code google.showcase.v1beta1.GetBlurbRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.GetBlurbRequest) + com.google.showcase.v1beta1.GetBlurbRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.MessagingOuterClass + .internal_static_google_showcase_v1beta1_GetBlurbRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.MessagingOuterClass + .internal_static_google_showcase_v1beta1_GetBlurbRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.GetBlurbRequest.class, + com.google.showcase.v1beta1.GetBlurbRequest.Builder.class); + } + + // Construct using com.google.showcase.v1beta1.GetBlurbRequest.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.showcase.v1beta1.MessagingOuterClass + .internal_static_google_showcase_v1beta1_GetBlurbRequest_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.GetBlurbRequest getDefaultInstanceForType() { + return com.google.showcase.v1beta1.GetBlurbRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.GetBlurbRequest build() { + com.google.showcase.v1beta1.GetBlurbRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.GetBlurbRequest buildPartial() { + com.google.showcase.v1beta1.GetBlurbRequest result = + new com.google.showcase.v1beta1.GetBlurbRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.showcase.v1beta1.GetBlurbRequest 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.showcase.v1beta1.GetBlurbRequest) { + return mergeFrom((com.google.showcase.v1beta1.GetBlurbRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.showcase.v1beta1.GetBlurbRequest other) { + if (other == com.google.showcase.v1beta1.GetBlurbRequest.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_ = ""; + + /** + * + * + *
        +     * The resource name of the requested blurb.
        +     * 
        + * + * + * 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; + } + } + + /** + * + * + *
        +     * The resource name of the requested blurb.
        +     * 
        + * + * + * 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; + } + } + + /** + * + * + *
        +     * The resource name of the requested blurb.
        +     * 
        + * + * + * 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; + } + + /** + * + * + *
        +     * The resource name of the requested blurb.
        +     * 
        + * + * + * 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; + } + + /** + * + * + *
        +     * The resource name of the requested blurb.
        +     * 
        + * + * + * 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.showcase.v1beta1.GetBlurbRequest) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.GetBlurbRequest) + private static final com.google.showcase.v1beta1.GetBlurbRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.GetBlurbRequest(); + } + + public static com.google.showcase.v1beta1.GetBlurbRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GetBlurbRequest 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.showcase.v1beta1.GetBlurbRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/GetBlurbRequestOrBuilder.java b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/GetBlurbRequestOrBuilder.java new file mode 100644 index 0000000000..32ab48f1fa --- /dev/null +++ b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/GetBlurbRequestOrBuilder.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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/messaging.proto + +// Protobuf Java Version: 3.25.8 +package com.google.showcase.v1beta1; + +public interface GetBlurbRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.GetBlurbRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
        +   * The resource name of the requested blurb.
        +   * 
        + * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + + /** + * + * + *
        +   * The resource name of the requested blurb.
        +   * 
        + * + * + * 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-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/GetRoomRequest.java b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/GetRoomRequest.java new file mode 100644 index 0000000000..256d8c2fc4 --- /dev/null +++ b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/GetRoomRequest.java @@ -0,0 +1,649 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/messaging.proto + +// Protobuf Java Version: 3.25.8 +package com.google.showcase.v1beta1; + +/** + * + * + *
        + * The request message for the google.showcase.v1beta1.Messaging\GetRoom
        + * method.
        + * 
        + * + * Protobuf type {@code google.showcase.v1beta1.GetRoomRequest} + */ +public final class GetRoomRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.GetRoomRequest) + GetRoomRequestOrBuilder { + private static final long serialVersionUID = 0L; + + // Use GetRoomRequest.newBuilder() to construct. + private GetRoomRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private GetRoomRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new GetRoomRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.MessagingOuterClass + .internal_static_google_showcase_v1beta1_GetRoomRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.MessagingOuterClass + .internal_static_google_showcase_v1beta1_GetRoomRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.GetRoomRequest.class, + com.google.showcase.v1beta1.GetRoomRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + + /** + * + * + *
        +   * The resource name of the requested room.
        +   * 
        + * + * + * 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; + } + } + + /** + * + * + *
        +   * The resource name of the requested room.
        +   * 
        + * + * + * 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.showcase.v1beta1.GetRoomRequest)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.GetRoomRequest other = + (com.google.showcase.v1beta1.GetRoomRequest) 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.showcase.v1beta1.GetRoomRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.GetRoomRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.GetRoomRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.GetRoomRequest 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.showcase.v1beta1.GetRoomRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.GetRoomRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.GetRoomRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.GetRoomRequest 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.showcase.v1beta1.GetRoomRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.GetRoomRequest 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.showcase.v1beta1.GetRoomRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.GetRoomRequest 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.showcase.v1beta1.GetRoomRequest 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 request message for the google.showcase.v1beta1.Messaging\GetRoom
        +   * method.
        +   * 
        + * + * Protobuf type {@code google.showcase.v1beta1.GetRoomRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.GetRoomRequest) + com.google.showcase.v1beta1.GetRoomRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.MessagingOuterClass + .internal_static_google_showcase_v1beta1_GetRoomRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.MessagingOuterClass + .internal_static_google_showcase_v1beta1_GetRoomRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.GetRoomRequest.class, + com.google.showcase.v1beta1.GetRoomRequest.Builder.class); + } + + // Construct using com.google.showcase.v1beta1.GetRoomRequest.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.showcase.v1beta1.MessagingOuterClass + .internal_static_google_showcase_v1beta1_GetRoomRequest_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.GetRoomRequest getDefaultInstanceForType() { + return com.google.showcase.v1beta1.GetRoomRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.GetRoomRequest build() { + com.google.showcase.v1beta1.GetRoomRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.GetRoomRequest buildPartial() { + com.google.showcase.v1beta1.GetRoomRequest result = + new com.google.showcase.v1beta1.GetRoomRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.showcase.v1beta1.GetRoomRequest 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.showcase.v1beta1.GetRoomRequest) { + return mergeFrom((com.google.showcase.v1beta1.GetRoomRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.showcase.v1beta1.GetRoomRequest other) { + if (other == com.google.showcase.v1beta1.GetRoomRequest.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_ = ""; + + /** + * + * + *
        +     * The resource name of the requested room.
        +     * 
        + * + * + * 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; + } + } + + /** + * + * + *
        +     * The resource name of the requested room.
        +     * 
        + * + * + * 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; + } + } + + /** + * + * + *
        +     * The resource name of the requested room.
        +     * 
        + * + * + * 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; + } + + /** + * + * + *
        +     * The resource name of the requested room.
        +     * 
        + * + * + * 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; + } + + /** + * + * + *
        +     * The resource name of the requested room.
        +     * 
        + * + * + * 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.showcase.v1beta1.GetRoomRequest) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.GetRoomRequest) + private static final com.google.showcase.v1beta1.GetRoomRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.GetRoomRequest(); + } + + public static com.google.showcase.v1beta1.GetRoomRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GetRoomRequest 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.showcase.v1beta1.GetRoomRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/GetRoomRequestOrBuilder.java b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/GetRoomRequestOrBuilder.java new file mode 100644 index 0000000000..0ad069cfcd --- /dev/null +++ b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/GetRoomRequestOrBuilder.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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/messaging.proto + +// Protobuf Java Version: 3.25.8 +package com.google.showcase.v1beta1; + +public interface GetRoomRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.GetRoomRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
        +   * The resource name of the requested room.
        +   * 
        + * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + + /** + * + * + *
        +   * The resource name of the requested room.
        +   * 
        + * + * + * 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-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/GetSequenceReportRequest.java b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/GetSequenceReportRequest.java new file mode 100644 index 0000000000..1d3e341ce9 --- /dev/null +++ b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/GetSequenceReportRequest.java @@ -0,0 +1,590 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/sequence.proto + +// Protobuf Java Version: 3.25.8 +package com.google.showcase.v1beta1; + +/** Protobuf type {@code google.showcase.v1beta1.GetSequenceReportRequest} */ +public final class GetSequenceReportRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.GetSequenceReportRequest) + GetSequenceReportRequestOrBuilder { + private static final long serialVersionUID = 0L; + + // Use GetSequenceReportRequest.newBuilder() to construct. + private GetSequenceReportRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private GetSequenceReportRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new GetSequenceReportRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.SequenceOuterClass + .internal_static_google_showcase_v1beta1_GetSequenceReportRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.SequenceOuterClass + .internal_static_google_showcase_v1beta1_GetSequenceReportRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.GetSequenceReportRequest.class, + com.google.showcase.v1beta1.GetSequenceReportRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + + /** + * + * 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; + } + } + + /** + * + * 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.showcase.v1beta1.GetSequenceReportRequest)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.GetSequenceReportRequest other = + (com.google.showcase.v1beta1.GetSequenceReportRequest) 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.showcase.v1beta1.GetSequenceReportRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.GetSequenceReportRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.GetSequenceReportRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.GetSequenceReportRequest 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.showcase.v1beta1.GetSequenceReportRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.GetSequenceReportRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.GetSequenceReportRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.GetSequenceReportRequest 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.showcase.v1beta1.GetSequenceReportRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.GetSequenceReportRequest 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.showcase.v1beta1.GetSequenceReportRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.GetSequenceReportRequest 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.showcase.v1beta1.GetSequenceReportRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** Protobuf type {@code google.showcase.v1beta1.GetSequenceReportRequest} */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.GetSequenceReportRequest) + com.google.showcase.v1beta1.GetSequenceReportRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.SequenceOuterClass + .internal_static_google_showcase_v1beta1_GetSequenceReportRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.SequenceOuterClass + .internal_static_google_showcase_v1beta1_GetSequenceReportRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.GetSequenceReportRequest.class, + com.google.showcase.v1beta1.GetSequenceReportRequest.Builder.class); + } + + // Construct using com.google.showcase.v1beta1.GetSequenceReportRequest.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.showcase.v1beta1.SequenceOuterClass + .internal_static_google_showcase_v1beta1_GetSequenceReportRequest_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.GetSequenceReportRequest getDefaultInstanceForType() { + return com.google.showcase.v1beta1.GetSequenceReportRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.GetSequenceReportRequest build() { + com.google.showcase.v1beta1.GetSequenceReportRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.GetSequenceReportRequest buildPartial() { + com.google.showcase.v1beta1.GetSequenceReportRequest result = + new com.google.showcase.v1beta1.GetSequenceReportRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.showcase.v1beta1.GetSequenceReportRequest 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.showcase.v1beta1.GetSequenceReportRequest) { + return mergeFrom((com.google.showcase.v1beta1.GetSequenceReportRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.showcase.v1beta1.GetSequenceReportRequest other) { + if (other == com.google.showcase.v1beta1.GetSequenceReportRequest.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_ = ""; + + /** + * + * 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; + } + } + + /** + * + * 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; + } + } + + /** + * + * 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; + } + + /** + * + * 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; + } + + /** + * + * 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.showcase.v1beta1.GetSequenceReportRequest) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.GetSequenceReportRequest) + private static final com.google.showcase.v1beta1.GetSequenceReportRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.GetSequenceReportRequest(); + } + + public static com.google.showcase.v1beta1.GetSequenceReportRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GetSequenceReportRequest 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.showcase.v1beta1.GetSequenceReportRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/GetSequenceReportRequestOrBuilder.java b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/GetSequenceReportRequestOrBuilder.java new file mode 100644 index 0000000000..57fb66085b --- /dev/null +++ b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/GetSequenceReportRequestOrBuilder.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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/sequence.proto + +// Protobuf Java Version: 3.25.8 +package com.google.showcase.v1beta1; + +public interface GetSequenceReportRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.GetSequenceReportRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + + /** + * + * 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-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/GetSessionRequest.java b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/GetSessionRequest.java new file mode 100644 index 0000000000..e9b129957f --- /dev/null +++ b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/GetSessionRequest.java @@ -0,0 +1,633 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/testing.proto + +// Protobuf Java Version: 3.25.8 +package com.google.showcase.v1beta1; + +/** + * + * + *
        + * The request for the GetSession method.
        + * 
        + * + * Protobuf type {@code google.showcase.v1beta1.GetSessionRequest} + */ +public final class GetSessionRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.GetSessionRequest) + GetSessionRequestOrBuilder { + private static final long serialVersionUID = 0L; + + // Use GetSessionRequest.newBuilder() to construct. + private GetSessionRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private GetSessionRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new GetSessionRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.TestingOuterClass + .internal_static_google_showcase_v1beta1_GetSessionRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.TestingOuterClass + .internal_static_google_showcase_v1beta1_GetSessionRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.GetSessionRequest.class, + com.google.showcase.v1beta1.GetSessionRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + + /** + * + * + *
        +   * The session to be retrieved.
        +   * 
        + * + * string name = 1 [(.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; + } + } + + /** + * + * + *
        +   * The session to be retrieved.
        +   * 
        + * + * string name = 1 [(.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.showcase.v1beta1.GetSessionRequest)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.GetSessionRequest other = + (com.google.showcase.v1beta1.GetSessionRequest) 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.showcase.v1beta1.GetSessionRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.GetSessionRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.GetSessionRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.GetSessionRequest 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.showcase.v1beta1.GetSessionRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.GetSessionRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.GetSessionRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.GetSessionRequest 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.showcase.v1beta1.GetSessionRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.GetSessionRequest 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.showcase.v1beta1.GetSessionRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.GetSessionRequest 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.showcase.v1beta1.GetSessionRequest 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 request for the GetSession method.
        +   * 
        + * + * Protobuf type {@code google.showcase.v1beta1.GetSessionRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.GetSessionRequest) + com.google.showcase.v1beta1.GetSessionRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.TestingOuterClass + .internal_static_google_showcase_v1beta1_GetSessionRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.TestingOuterClass + .internal_static_google_showcase_v1beta1_GetSessionRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.GetSessionRequest.class, + com.google.showcase.v1beta1.GetSessionRequest.Builder.class); + } + + // Construct using com.google.showcase.v1beta1.GetSessionRequest.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.showcase.v1beta1.TestingOuterClass + .internal_static_google_showcase_v1beta1_GetSessionRequest_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.GetSessionRequest getDefaultInstanceForType() { + return com.google.showcase.v1beta1.GetSessionRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.GetSessionRequest build() { + com.google.showcase.v1beta1.GetSessionRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.GetSessionRequest buildPartial() { + com.google.showcase.v1beta1.GetSessionRequest result = + new com.google.showcase.v1beta1.GetSessionRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.showcase.v1beta1.GetSessionRequest 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.showcase.v1beta1.GetSessionRequest) { + return mergeFrom((com.google.showcase.v1beta1.GetSessionRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.showcase.v1beta1.GetSessionRequest other) { + if (other == com.google.showcase.v1beta1.GetSessionRequest.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_ = ""; + + /** + * + * + *
        +     * The session to be retrieved.
        +     * 
        + * + * string name = 1 [(.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; + } + } + + /** + * + * + *
        +     * The session to be retrieved.
        +     * 
        + * + * string name = 1 [(.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; + } + } + + /** + * + * + *
        +     * The session to be retrieved.
        +     * 
        + * + * string name = 1 [(.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; + } + + /** + * + * + *
        +     * The session to be retrieved.
        +     * 
        + * + * string name = 1 [(.google.api.resource_reference) = { ... } + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
        +     * The session to be retrieved.
        +     * 
        + * + * string name = 1 [(.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.showcase.v1beta1.GetSessionRequest) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.GetSessionRequest) + private static final com.google.showcase.v1beta1.GetSessionRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.GetSessionRequest(); + } + + public static com.google.showcase.v1beta1.GetSessionRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GetSessionRequest 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.showcase.v1beta1.GetSessionRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/GetSessionRequestOrBuilder.java b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/GetSessionRequestOrBuilder.java new file mode 100644 index 0000000000..ea181b79f4 --- /dev/null +++ b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/GetSessionRequestOrBuilder.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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/testing.proto + +// Protobuf Java Version: 3.25.8 +package com.google.showcase.v1beta1; + +public interface GetSessionRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.GetSessionRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
        +   * The session to be retrieved.
        +   * 
        + * + * string name = 1 [(.google.api.resource_reference) = { ... } + * + * @return The name. + */ + java.lang.String getName(); + + /** + * + * + *
        +   * The session to be retrieved.
        +   * 
        + * + * string name = 1 [(.google.api.resource_reference) = { ... } + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); +} diff --git a/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/GetStreamingSequenceReportRequest.java b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/GetStreamingSequenceReportRequest.java new file mode 100644 index 0000000000..186fa175e5 --- /dev/null +++ b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/GetStreamingSequenceReportRequest.java @@ -0,0 +1,596 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/sequence.proto + +// Protobuf Java Version: 3.25.8 +package com.google.showcase.v1beta1; + +/** Protobuf type {@code google.showcase.v1beta1.GetStreamingSequenceReportRequest} */ +public final class GetStreamingSequenceReportRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.GetStreamingSequenceReportRequest) + GetStreamingSequenceReportRequestOrBuilder { + private static final long serialVersionUID = 0L; + + // Use GetStreamingSequenceReportRequest.newBuilder() to construct. + private GetStreamingSequenceReportRequest( + com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private GetStreamingSequenceReportRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new GetStreamingSequenceReportRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.SequenceOuterClass + .internal_static_google_showcase_v1beta1_GetStreamingSequenceReportRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.SequenceOuterClass + .internal_static_google_showcase_v1beta1_GetStreamingSequenceReportRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.GetStreamingSequenceReportRequest.class, + com.google.showcase.v1beta1.GetStreamingSequenceReportRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + + /** + * + * 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; + } + } + + /** + * + * 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.showcase.v1beta1.GetStreamingSequenceReportRequest)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.GetStreamingSequenceReportRequest other = + (com.google.showcase.v1beta1.GetStreamingSequenceReportRequest) 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.showcase.v1beta1.GetStreamingSequenceReportRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.GetStreamingSequenceReportRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.GetStreamingSequenceReportRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.GetStreamingSequenceReportRequest 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.showcase.v1beta1.GetStreamingSequenceReportRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.GetStreamingSequenceReportRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.GetStreamingSequenceReportRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.GetStreamingSequenceReportRequest 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.showcase.v1beta1.GetStreamingSequenceReportRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.GetStreamingSequenceReportRequest 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.showcase.v1beta1.GetStreamingSequenceReportRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.GetStreamingSequenceReportRequest 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.showcase.v1beta1.GetStreamingSequenceReportRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** Protobuf type {@code google.showcase.v1beta1.GetStreamingSequenceReportRequest} */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.GetStreamingSequenceReportRequest) + com.google.showcase.v1beta1.GetStreamingSequenceReportRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.SequenceOuterClass + .internal_static_google_showcase_v1beta1_GetStreamingSequenceReportRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.SequenceOuterClass + .internal_static_google_showcase_v1beta1_GetStreamingSequenceReportRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.GetStreamingSequenceReportRequest.class, + com.google.showcase.v1beta1.GetStreamingSequenceReportRequest.Builder.class); + } + + // Construct using com.google.showcase.v1beta1.GetStreamingSequenceReportRequest.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.showcase.v1beta1.SequenceOuterClass + .internal_static_google_showcase_v1beta1_GetStreamingSequenceReportRequest_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.GetStreamingSequenceReportRequest + getDefaultInstanceForType() { + return com.google.showcase.v1beta1.GetStreamingSequenceReportRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.GetStreamingSequenceReportRequest build() { + com.google.showcase.v1beta1.GetStreamingSequenceReportRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.GetStreamingSequenceReportRequest buildPartial() { + com.google.showcase.v1beta1.GetStreamingSequenceReportRequest result = + new com.google.showcase.v1beta1.GetStreamingSequenceReportRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.showcase.v1beta1.GetStreamingSequenceReportRequest 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.showcase.v1beta1.GetStreamingSequenceReportRequest) { + return mergeFrom((com.google.showcase.v1beta1.GetStreamingSequenceReportRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.showcase.v1beta1.GetStreamingSequenceReportRequest other) { + if (other + == com.google.showcase.v1beta1.GetStreamingSequenceReportRequest.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_ = ""; + + /** + * + * 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; + } + } + + /** + * + * 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; + } + } + + /** + * + * 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; + } + + /** + * + * 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; + } + + /** + * + * 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.showcase.v1beta1.GetStreamingSequenceReportRequest) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.GetStreamingSequenceReportRequest) + private static final com.google.showcase.v1beta1.GetStreamingSequenceReportRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.GetStreamingSequenceReportRequest(); + } + + public static com.google.showcase.v1beta1.GetStreamingSequenceReportRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GetStreamingSequenceReportRequest 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.showcase.v1beta1.GetStreamingSequenceReportRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/GetStreamingSequenceReportRequestOrBuilder.java b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/GetStreamingSequenceReportRequestOrBuilder.java new file mode 100644 index 0000000000..5085814753 --- /dev/null +++ b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/GetStreamingSequenceReportRequestOrBuilder.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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/sequence.proto + +// Protobuf Java Version: 3.25.8 +package com.google.showcase.v1beta1; + +public interface GetStreamingSequenceReportRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.GetStreamingSequenceReportRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + + /** + * + * 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-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/GetUserRequest.java b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/GetUserRequest.java new file mode 100644 index 0000000000..6bb4597385 --- /dev/null +++ b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/GetUserRequest.java @@ -0,0 +1,649 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/identity.proto + +// Protobuf Java Version: 3.25.8 +package com.google.showcase.v1beta1; + +/** + * + * + *
        + * The request message for the google.showcase.v1beta1.Identity\GetUser
        + * method.
        + * 
        + * + * Protobuf type {@code google.showcase.v1beta1.GetUserRequest} + */ +public final class GetUserRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.GetUserRequest) + GetUserRequestOrBuilder { + private static final long serialVersionUID = 0L; + + // Use GetUserRequest.newBuilder() to construct. + private GetUserRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private GetUserRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new GetUserRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.IdentityOuterClass + .internal_static_google_showcase_v1beta1_GetUserRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.IdentityOuterClass + .internal_static_google_showcase_v1beta1_GetUserRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.GetUserRequest.class, + com.google.showcase.v1beta1.GetUserRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + + /** + * + * + *
        +   * The resource name of the requested user.
        +   * 
        + * + * + * 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; + } + } + + /** + * + * + *
        +   * The resource name of the requested user.
        +   * 
        + * + * + * 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.showcase.v1beta1.GetUserRequest)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.GetUserRequest other = + (com.google.showcase.v1beta1.GetUserRequest) 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.showcase.v1beta1.GetUserRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.GetUserRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.GetUserRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.GetUserRequest 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.showcase.v1beta1.GetUserRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.GetUserRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.GetUserRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.GetUserRequest 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.showcase.v1beta1.GetUserRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.GetUserRequest 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.showcase.v1beta1.GetUserRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.GetUserRequest 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.showcase.v1beta1.GetUserRequest 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 request message for the google.showcase.v1beta1.Identity\GetUser
        +   * method.
        +   * 
        + * + * Protobuf type {@code google.showcase.v1beta1.GetUserRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.GetUserRequest) + com.google.showcase.v1beta1.GetUserRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.IdentityOuterClass + .internal_static_google_showcase_v1beta1_GetUserRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.IdentityOuterClass + .internal_static_google_showcase_v1beta1_GetUserRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.GetUserRequest.class, + com.google.showcase.v1beta1.GetUserRequest.Builder.class); + } + + // Construct using com.google.showcase.v1beta1.GetUserRequest.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.showcase.v1beta1.IdentityOuterClass + .internal_static_google_showcase_v1beta1_GetUserRequest_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.GetUserRequest getDefaultInstanceForType() { + return com.google.showcase.v1beta1.GetUserRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.GetUserRequest build() { + com.google.showcase.v1beta1.GetUserRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.GetUserRequest buildPartial() { + com.google.showcase.v1beta1.GetUserRequest result = + new com.google.showcase.v1beta1.GetUserRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.showcase.v1beta1.GetUserRequest 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.showcase.v1beta1.GetUserRequest) { + return mergeFrom((com.google.showcase.v1beta1.GetUserRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.showcase.v1beta1.GetUserRequest other) { + if (other == com.google.showcase.v1beta1.GetUserRequest.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_ = ""; + + /** + * + * + *
        +     * The resource name of the requested user.
        +     * 
        + * + * + * 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; + } + } + + /** + * + * + *
        +     * The resource name of the requested user.
        +     * 
        + * + * + * 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; + } + } + + /** + * + * + *
        +     * The resource name of the requested user.
        +     * 
        + * + * + * 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; + } + + /** + * + * + *
        +     * The resource name of the requested user.
        +     * 
        + * + * + * 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; + } + + /** + * + * + *
        +     * The resource name of the requested user.
        +     * 
        + * + * + * 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.showcase.v1beta1.GetUserRequest) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.GetUserRequest) + private static final com.google.showcase.v1beta1.GetUserRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.GetUserRequest(); + } + + public static com.google.showcase.v1beta1.GetUserRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GetUserRequest 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.showcase.v1beta1.GetUserRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/GetUserRequestOrBuilder.java b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/GetUserRequestOrBuilder.java new file mode 100644 index 0000000000..110fe7d134 --- /dev/null +++ b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/GetUserRequestOrBuilder.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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/identity.proto + +// Protobuf Java Version: 3.25.8 +package com.google.showcase.v1beta1; + +public interface GetUserRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.GetUserRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
        +   * The resource name of the requested user.
        +   * 
        + * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + + /** + * + * + *
        +   * The resource name of the requested user.
        +   * 
        + * + * + * 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-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/IdentityOuterClass.java b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/IdentityOuterClass.java new file mode 100644 index 0000000000..6fa69e2fb2 --- /dev/null +++ b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/IdentityOuterClass.java @@ -0,0 +1,222 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/identity.proto + +// Protobuf Java Version: 3.25.8 +package com.google.showcase.v1beta1; + +public final class IdentityOuterClass { + private IdentityOuterClass() {} + + 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_showcase_v1beta1_User_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_showcase_v1beta1_User_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_showcase_v1beta1_CreateUserRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_showcase_v1beta1_CreateUserRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_showcase_v1beta1_GetUserRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_showcase_v1beta1_GetUserRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_showcase_v1beta1_UpdateUserRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_showcase_v1beta1_UpdateUserRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_showcase_v1beta1_DeleteUserRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_showcase_v1beta1_DeleteUserRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_showcase_v1beta1_ListUsersRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_showcase_v1beta1_ListUsersRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_showcase_v1beta1_ListUsersResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_showcase_v1beta1_ListUsersResponse_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" + + "-schema/google/showcase/v1beta1/identit" + + "y.proto\022\027google.showcase.v1beta1\032\034google" + + "/api/annotations.proto\032\027google/api/clien" + + "t.proto\032\037google/api/field_behavior.proto" + + "\032\031google/api/resource.proto\032\033google/protobuf/empty.proto\032" + + " google/protobuf/field_mask.proto\032\037google/protobuf/timestamp.proto\"\204\003\n" + + "\004User\022\014\n" + + "\004name\030\001 \001(\t\022\031\n" + + "\014display_name\030\002 \001(\tB\003\340A\002\022\022\n" + + "\005email\030\003 \001(\tB\003\340A\002\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\020\n" + + "\003age\030\006 \001(\005H\000\210\001\001\022\030\n" + + "\013height_feet\030\007 \001(\001H\001\210\001\001\022\025\n" + + "\010nickname\030\010 \001(\tH\002\210\001\001\022!\n" + + "\024enable_notifications\030\t \001(\010H\003\210\001\001:/\352A,\n" + + "\034showcase.googleapis.com/User\022\014users/{user}B\006\n" + + "\004_ageB\016\n" + + "\014_height_feetB\013\n" + + "\t_nicknameB\027\n" + + "\025_enable_notifications\"@\n" + + "\021CreateUserRequest\022+\n" + + "\004user\030\001 \001(\0132\035.google.showcase.v1beta1.User\"D\n" + + "\016GetUserRequest\0222\n" + + "\004name\030\001 \001(\tB$\340A\002\372A\036\n" + + "\034showcase.googleapis.com/User\"q\n" + + "\021UpdateUserRequest\022+\n" + + "\004user\030\001 \001(\0132\035.google.showcase.v1beta1.User\022/\n" + + "\013update_mask\030\002 \001(\0132\032.google.protobuf.FieldMask\"G\n" + + "\021DeleteUserRequest\0222\n" + + "\004name\030\001 \001(\tB$\340A\002\372A\036\n" + + "\034showcase.googleapis.com/User\"9\n" + + "\020ListUsersRequest\022\021\n" + + "\tpage_size\030\001 \001(\005\022\022\n" + + "\n" + + "page_token\030\002 \001(\t\"Z\n" + + "\021ListUsersResponse\022,\n" + + "\005users\030\001 \003(\0132\035.google.showcase.v1beta1.User\022\027\n" + + "\017next_page_token\030\002 \001(\t2\212\006\n" + + "\010Identity\022\363\001\n\n" + + "CreateUser\022*.google.showcase.v1beta1.CreateUserRequest\032\035.google.showcase." + + "v1beta1.User\"\231\001\332A\034user.display_name,user" + + ".email\332A^user.display_name,user.email,user.age,user.nickname,user.enable_notific" + + "ations,user.height_feet\202\323\344\223\002\023\"\016/v1beta1/users:\001*\022y\n" + + "\007GetUser\022\'.google.showcase.v1beta1.GetUserRequest\032\035.google.showcase.v" + + "1beta1.User\"&\332A\004name\202\323\344\223\002\031\022\027/v1beta1/{name=users/*}\022\203\001\n\n" + + "UpdateUser\022*.google.showcase.v1beta1.UpdateUserRequest\032\035.google." + + "showcase.v1beta1.User\"*\202\323\344\223\002$2\034/v1beta1/{user.name=users/*}:\004user\022x\n\n" + + "DeleteUser\022*.google.showcase.v1beta1.DeleteUserRequ" + + "est\032\026.google.protobuf.Empty\"&\332A\004name\202\323\344\223\002\031*\027/v1beta1/{name=users/*}\022z\n" + + "\tListUsers\022).google.showcase.v1beta1.ListUsersRequ" + + "est\032*.google.showcase.v1beta1.ListUsersR" + + "esponse\"\026\202\323\344\223\002\020\022\016/v1beta1/users\032\021\312A\016localhost:7469Bq\n" + + "\033com.google.showcase.v1beta1P\001Z4github.com/googleapis/gapic-showcas" + + "e/server/genproto\352\002\031Google::Showcase::V1beta1b\006proto3" + }; + descriptor = + com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( + descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + com.google.api.AnnotationsProto.getDescriptor(), + com.google.api.ClientProto.getDescriptor(), + com.google.api.FieldBehaviorProto.getDescriptor(), + com.google.api.ResourceProto.getDescriptor(), + com.google.protobuf.EmptyProto.getDescriptor(), + com.google.protobuf.FieldMaskProto.getDescriptor(), + com.google.protobuf.TimestampProto.getDescriptor(), + }); + internal_static_google_showcase_v1beta1_User_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_showcase_v1beta1_User_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_showcase_v1beta1_User_descriptor, + new java.lang.String[] { + "Name", + "DisplayName", + "Email", + "CreateTime", + "UpdateTime", + "Age", + "HeightFeet", + "Nickname", + "EnableNotifications", + }); + internal_static_google_showcase_v1beta1_CreateUserRequest_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_google_showcase_v1beta1_CreateUserRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_showcase_v1beta1_CreateUserRequest_descriptor, + new java.lang.String[] { + "User", + }); + internal_static_google_showcase_v1beta1_GetUserRequest_descriptor = + getDescriptor().getMessageTypes().get(2); + internal_static_google_showcase_v1beta1_GetUserRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_showcase_v1beta1_GetUserRequest_descriptor, + new java.lang.String[] { + "Name", + }); + internal_static_google_showcase_v1beta1_UpdateUserRequest_descriptor = + getDescriptor().getMessageTypes().get(3); + internal_static_google_showcase_v1beta1_UpdateUserRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_showcase_v1beta1_UpdateUserRequest_descriptor, + new java.lang.String[] { + "User", "UpdateMask", + }); + internal_static_google_showcase_v1beta1_DeleteUserRequest_descriptor = + getDescriptor().getMessageTypes().get(4); + internal_static_google_showcase_v1beta1_DeleteUserRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_showcase_v1beta1_DeleteUserRequest_descriptor, + new java.lang.String[] { + "Name", + }); + internal_static_google_showcase_v1beta1_ListUsersRequest_descriptor = + getDescriptor().getMessageTypes().get(5); + internal_static_google_showcase_v1beta1_ListUsersRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_showcase_v1beta1_ListUsersRequest_descriptor, + new java.lang.String[] { + "PageSize", "PageToken", + }); + internal_static_google_showcase_v1beta1_ListUsersResponse_descriptor = + getDescriptor().getMessageTypes().get(6); + internal_static_google_showcase_v1beta1_ListUsersResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_showcase_v1beta1_ListUsersResponse_descriptor, + new java.lang.String[] { + "Users", "NextPageToken", + }); + 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.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.FieldBehaviorProto.getDescriptor(); + com.google.api.ResourceProto.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-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/Issue.java b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/Issue.java new file mode 100644 index 0000000000..3c74da2a82 --- /dev/null +++ b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/Issue.java @@ -0,0 +1,1251 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/testing.proto + +// Protobuf Java Version: 3.25.8 +package com.google.showcase.v1beta1; + +/** + * + * + *
        + * An issue found in the test.
        + * 
        + * + * Protobuf type {@code google.showcase.v1beta1.Issue} + */ +public final class Issue extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.Issue) + IssueOrBuilder { + private static final long serialVersionUID = 0L; + + // Use Issue.newBuilder() to construct. + private Issue(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Issue() { + type_ = 0; + severity_ = 0; + description_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Issue(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.TestingOuterClass + .internal_static_google_showcase_v1beta1_Issue_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.TestingOuterClass + .internal_static_google_showcase_v1beta1_Issue_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.Issue.class, + com.google.showcase.v1beta1.Issue.Builder.class); + } + + /** + * + * + *
        +   * The different potential types of issues.
        +   * 
        + * + * Protobuf enum {@code google.showcase.v1beta1.Issue.Type} + */ + public enum Type implements com.google.protobuf.ProtocolMessageEnum { + /** TYPE_UNSPECIFIED = 0; */ + TYPE_UNSPECIFIED(0), + /** + * + * + *
        +     * The test was never instrumented.
        +     * 
        + * + * SKIPPED = 1; + */ + SKIPPED(1), + /** + * + * + *
        +     * The test was started but never confirmed.
        +     * 
        + * + * PENDING = 2; + */ + PENDING(2), + /** + * + * + *
        +     * The test was instrumented, but Showcase got an unexpected
        +     * value when the generator tried to confirm success.
        +     * 
        + * + * INCORRECT_CONFIRMATION = 3; + */ + INCORRECT_CONFIRMATION(3), + UNRECOGNIZED(-1), + ; + + /** TYPE_UNSPECIFIED = 0; */ + public static final int TYPE_UNSPECIFIED_VALUE = 0; + + /** + * + * + *
        +     * The test was never instrumented.
        +     * 
        + * + * SKIPPED = 1; + */ + public static final int SKIPPED_VALUE = 1; + + /** + * + * + *
        +     * The test was started but never confirmed.
        +     * 
        + * + * PENDING = 2; + */ + public static final int PENDING_VALUE = 2; + + /** + * + * + *
        +     * The test was instrumented, but Showcase got an unexpected
        +     * value when the generator tried to confirm success.
        +     * 
        + * + * INCORRECT_CONFIRMATION = 3; + */ + public static final int INCORRECT_CONFIRMATION_VALUE = 3; + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static Type valueOf(int value) { + return forNumber(value); + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + */ + public static Type forNumber(int value) { + switch (value) { + case 0: + return TYPE_UNSPECIFIED; + case 1: + return SKIPPED; + case 2: + return PENDING; + case 3: + return INCORRECT_CONFIRMATION; + default: + return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap internalGetValueMap() { + return internalValueMap; + } + + private static final com.google.protobuf.Internal.EnumLiteMap internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public Type findValueByNumber(int number) { + return Type.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { + 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.showcase.v1beta1.Issue.getDescriptor().getEnumTypes().get(0); + } + + private static final Type[] VALUES = values(); + + public static Type valueOf(com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException("EnumValueDescriptor is not for this type."); + } + if (desc.getIndex() == -1) { + return UNRECOGNIZED; + } + return VALUES[desc.getIndex()]; + } + + private final int value; + + private Type(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.showcase.v1beta1.Issue.Type) + } + + /** + * + * + *
        +   * Severity levels.
        +   * 
        + * + * Protobuf enum {@code google.showcase.v1beta1.Issue.Severity} + */ + public enum Severity implements com.google.protobuf.ProtocolMessageEnum { + /** SEVERITY_UNSPECIFIED = 0; */ + SEVERITY_UNSPECIFIED(0), + /** + * + * + *
        +     * Errors.
        +     * 
        + * + * ERROR = 1; + */ + ERROR(1), + /** + * + * + *
        +     * Warnings.
        +     * 
        + * + * WARNING = 2; + */ + WARNING(2), + UNRECOGNIZED(-1), + ; + + /** SEVERITY_UNSPECIFIED = 0; */ + public static final int SEVERITY_UNSPECIFIED_VALUE = 0; + + /** + * + * + *
        +     * Errors.
        +     * 
        + * + * ERROR = 1; + */ + public static final int ERROR_VALUE = 1; + + /** + * + * + *
        +     * Warnings.
        +     * 
        + * + * WARNING = 2; + */ + public static final int WARNING_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 Severity 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 Severity forNumber(int value) { + switch (value) { + case 0: + return SEVERITY_UNSPECIFIED; + case 1: + return ERROR; + case 2: + return WARNING; + 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 Severity findValueByNumber(int number) { + return Severity.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.showcase.v1beta1.Issue.getDescriptor().getEnumTypes().get(1); + } + + private static final Severity[] VALUES = values(); + + public static Severity 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 Severity(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.showcase.v1beta1.Issue.Severity) + } + + public static final int TYPE_FIELD_NUMBER = 1; + private int type_ = 0; + + /** + * + * + *
        +   * The type of the issue.
        +   * 
        + * + * .google.showcase.v1beta1.Issue.Type type = 1; + * + * @return The enum numeric value on the wire for type. + */ + @java.lang.Override + public int getTypeValue() { + return type_; + } + + /** + * + * + *
        +   * The type of the issue.
        +   * 
        + * + * .google.showcase.v1beta1.Issue.Type type = 1; + * + * @return The type. + */ + @java.lang.Override + public com.google.showcase.v1beta1.Issue.Type getType() { + com.google.showcase.v1beta1.Issue.Type result = + com.google.showcase.v1beta1.Issue.Type.forNumber(type_); + return result == null ? com.google.showcase.v1beta1.Issue.Type.UNRECOGNIZED : result; + } + + public static final int SEVERITY_FIELD_NUMBER = 2; + private int severity_ = 0; + + /** + * + * + *
        +   * The severity of the issue.
        +   * 
        + * + * .google.showcase.v1beta1.Issue.Severity severity = 2; + * + * @return The enum numeric value on the wire for severity. + */ + @java.lang.Override + public int getSeverityValue() { + return severity_; + } + + /** + * + * + *
        +   * The severity of the issue.
        +   * 
        + * + * .google.showcase.v1beta1.Issue.Severity severity = 2; + * + * @return The severity. + */ + @java.lang.Override + public com.google.showcase.v1beta1.Issue.Severity getSeverity() { + com.google.showcase.v1beta1.Issue.Severity result = + com.google.showcase.v1beta1.Issue.Severity.forNumber(severity_); + return result == null ? com.google.showcase.v1beta1.Issue.Severity.UNRECOGNIZED : result; + } + + public static final int DESCRIPTION_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object description_ = ""; + + /** + * + * + *
        +   * A description of the issue.
        +   * 
        + * + * 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; + } + } + + /** + * + * + *
        +   * A description of the issue.
        +   * 
        + * + * string description = 3; + * + * @return The bytes for description. + */ + @java.lang.Override + public com.google.protobuf.ByteString getDescriptionBytes() { + java.lang.Object ref = description_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + description_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (type_ != com.google.showcase.v1beta1.Issue.Type.TYPE_UNSPECIFIED.getNumber()) { + output.writeEnum(1, type_); + } + if (severity_ != com.google.showcase.v1beta1.Issue.Severity.SEVERITY_UNSPECIFIED.getNumber()) { + output.writeEnum(2, severity_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(description_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, description_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (type_ != com.google.showcase.v1beta1.Issue.Type.TYPE_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(1, type_); + } + if (severity_ != com.google.showcase.v1beta1.Issue.Severity.SEVERITY_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(2, severity_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(description_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, description_); + } + 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.showcase.v1beta1.Issue)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.Issue other = (com.google.showcase.v1beta1.Issue) obj; + + if (type_ != other.type_) return false; + if (severity_ != other.severity_) return false; + if (!getDescription().equals(other.getDescription())) 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) + TYPE_FIELD_NUMBER; + hash = (53 * hash) + type_; + hash = (37 * hash) + SEVERITY_FIELD_NUMBER; + hash = (53 * hash) + severity_; + hash = (37 * hash) + DESCRIPTION_FIELD_NUMBER; + hash = (53 * hash) + getDescription().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.showcase.v1beta1.Issue parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.Issue parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.Issue parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.Issue 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.showcase.v1beta1.Issue parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.Issue parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.Issue parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.Issue 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.showcase.v1beta1.Issue parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.Issue 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.showcase.v1beta1.Issue parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.Issue 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.showcase.v1beta1.Issue 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 issue found in the test.
        +   * 
        + * + * Protobuf type {@code google.showcase.v1beta1.Issue} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.Issue) + com.google.showcase.v1beta1.IssueOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.TestingOuterClass + .internal_static_google_showcase_v1beta1_Issue_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.TestingOuterClass + .internal_static_google_showcase_v1beta1_Issue_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.Issue.class, + com.google.showcase.v1beta1.Issue.Builder.class); + } + + // Construct using com.google.showcase.v1beta1.Issue.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + type_ = 0; + severity_ = 0; + description_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.showcase.v1beta1.TestingOuterClass + .internal_static_google_showcase_v1beta1_Issue_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.Issue getDefaultInstanceForType() { + return com.google.showcase.v1beta1.Issue.getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.Issue build() { + com.google.showcase.v1beta1.Issue result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.Issue buildPartial() { + com.google.showcase.v1beta1.Issue result = new com.google.showcase.v1beta1.Issue(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.showcase.v1beta1.Issue result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.type_ = type_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.severity_ = severity_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.description_ = description_; + } + } + + @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.showcase.v1beta1.Issue) { + return mergeFrom((com.google.showcase.v1beta1.Issue) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.showcase.v1beta1.Issue other) { + if (other == com.google.showcase.v1beta1.Issue.getDefaultInstance()) return this; + if (other.type_ != 0) { + setTypeValue(other.getTypeValue()); + } + if (other.severity_ != 0) { + setSeverityValue(other.getSeverityValue()); + } + if (!other.getDescription().isEmpty()) { + description_ = other.description_; + 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 8: + { + type_ = input.readEnum(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 16: + { + severity_ = input.readEnum(); + bitField0_ |= 0x00000002; + break; + } // case 16 + case 26: + { + description_ = 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 int type_ = 0; + + /** + * + * + *
        +     * The type of the issue.
        +     * 
        + * + * .google.showcase.v1beta1.Issue.Type type = 1; + * + * @return The enum numeric value on the wire for type. + */ + @java.lang.Override + public int getTypeValue() { + return type_; + } + + /** + * + * + *
        +     * The type of the issue.
        +     * 
        + * + * .google.showcase.v1beta1.Issue.Type type = 1; + * + * @param value The enum numeric value on the wire for type to set. + * @return This builder for chaining. + */ + public Builder setTypeValue(int value) { + type_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
        +     * The type of the issue.
        +     * 
        + * + * .google.showcase.v1beta1.Issue.Type type = 1; + * + * @return The type. + */ + @java.lang.Override + public com.google.showcase.v1beta1.Issue.Type getType() { + com.google.showcase.v1beta1.Issue.Type result = + com.google.showcase.v1beta1.Issue.Type.forNumber(type_); + return result == null ? com.google.showcase.v1beta1.Issue.Type.UNRECOGNIZED : result; + } + + /** + * + * + *
        +     * The type of the issue.
        +     * 
        + * + * .google.showcase.v1beta1.Issue.Type type = 1; + * + * @param value The type to set. + * @return This builder for chaining. + */ + public Builder setType(com.google.showcase.v1beta1.Issue.Type value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000001; + type_ = value.getNumber(); + onChanged(); + return this; + } + + /** + * + * + *
        +     * The type of the issue.
        +     * 
        + * + * .google.showcase.v1beta1.Issue.Type type = 1; + * + * @return This builder for chaining. + */ + public Builder clearType() { + bitField0_ = (bitField0_ & ~0x00000001); + type_ = 0; + onChanged(); + return this; + } + + private int severity_ = 0; + + /** + * + * + *
        +     * The severity of the issue.
        +     * 
        + * + * .google.showcase.v1beta1.Issue.Severity severity = 2; + * + * @return The enum numeric value on the wire for severity. + */ + @java.lang.Override + public int getSeverityValue() { + return severity_; + } + + /** + * + * + *
        +     * The severity of the issue.
        +     * 
        + * + * .google.showcase.v1beta1.Issue.Severity severity = 2; + * + * @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_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
        +     * The severity of the issue.
        +     * 
        + * + * .google.showcase.v1beta1.Issue.Severity severity = 2; + * + * @return The severity. + */ + @java.lang.Override + public com.google.showcase.v1beta1.Issue.Severity getSeverity() { + com.google.showcase.v1beta1.Issue.Severity result = + com.google.showcase.v1beta1.Issue.Severity.forNumber(severity_); + return result == null ? com.google.showcase.v1beta1.Issue.Severity.UNRECOGNIZED : result; + } + + /** + * + * + *
        +     * The severity of the issue.
        +     * 
        + * + * .google.showcase.v1beta1.Issue.Severity severity = 2; + * + * @param value The severity to set. + * @return This builder for chaining. + */ + public Builder setSeverity(com.google.showcase.v1beta1.Issue.Severity value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000002; + severity_ = value.getNumber(); + onChanged(); + return this; + } + + /** + * + * + *
        +     * The severity of the issue.
        +     * 
        + * + * .google.showcase.v1beta1.Issue.Severity severity = 2; + * + * @return This builder for chaining. + */ + public Builder clearSeverity() { + bitField0_ = (bitField0_ & ~0x00000002); + severity_ = 0; + onChanged(); + return this; + } + + private java.lang.Object description_ = ""; + + /** + * + * + *
        +     * A description of the issue.
        +     * 
        + * + * 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; + } + } + + /** + * + * + *
        +     * A description of the issue.
        +     * 
        + * + * 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; + } + } + + /** + * + * + *
        +     * A description of the issue.
        +     * 
        + * + * 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_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
        +     * A description of the issue.
        +     * 
        + * + * string description = 3; + * + * @return This builder for chaining. + */ + public Builder clearDescription() { + description_ = getDefaultInstance().getDescription(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + + /** + * + * + *
        +     * A description of the issue.
        +     * 
        + * + * 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_ |= 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.showcase.v1beta1.Issue) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.Issue) + private static final com.google.showcase.v1beta1.Issue DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.Issue(); + } + + public static com.google.showcase.v1beta1.Issue getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Issue 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.showcase.v1beta1.Issue getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/IssueOrBuilder.java b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/IssueOrBuilder.java new file mode 100644 index 0000000000..a99fa83994 --- /dev/null +++ b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/IssueOrBuilder.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: schema/google/showcase/v1beta1/testing.proto + +// Protobuf Java Version: 3.25.8 +package com.google.showcase.v1beta1; + +public interface IssueOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.Issue) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
        +   * The type of the issue.
        +   * 
        + * + * .google.showcase.v1beta1.Issue.Type type = 1; + * + * @return The enum numeric value on the wire for type. + */ + int getTypeValue(); + + /** + * + * + *
        +   * The type of the issue.
        +   * 
        + * + * .google.showcase.v1beta1.Issue.Type type = 1; + * + * @return The type. + */ + com.google.showcase.v1beta1.Issue.Type getType(); + + /** + * + * + *
        +   * The severity of the issue.
        +   * 
        + * + * .google.showcase.v1beta1.Issue.Severity severity = 2; + * + * @return The enum numeric value on the wire for severity. + */ + int getSeverityValue(); + + /** + * + * + *
        +   * The severity of the issue.
        +   * 
        + * + * .google.showcase.v1beta1.Issue.Severity severity = 2; + * + * @return The severity. + */ + com.google.showcase.v1beta1.Issue.Severity getSeverity(); + + /** + * + * + *
        +   * A description of the issue.
        +   * 
        + * + * string description = 3; + * + * @return The description. + */ + java.lang.String getDescription(); + + /** + * + * + *
        +   * A description of the issue.
        +   * 
        + * + * string description = 3; + * + * @return The bytes for description. + */ + com.google.protobuf.ByteString getDescriptionBytes(); +} diff --git a/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListBlurbsRequest.java b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListBlurbsRequest.java new file mode 100644 index 0000000000..893ae6442e --- /dev/null +++ b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListBlurbsRequest.java @@ -0,0 +1,957 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/messaging.proto + +// Protobuf Java Version: 3.25.8 +package com.google.showcase.v1beta1; + +/** + * + * + *
        + * The request message for the google.showcase.v1beta1.Messaging\ListBlurbs
        + * method.
        + * 
        + * + * Protobuf type {@code google.showcase.v1beta1.ListBlurbsRequest} + */ +public final class ListBlurbsRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.ListBlurbsRequest) + ListBlurbsRequestOrBuilder { + private static final long serialVersionUID = 0L; + + // Use ListBlurbsRequest.newBuilder() to construct. + private ListBlurbsRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListBlurbsRequest() { + parent_ = ""; + pageToken_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListBlurbsRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.MessagingOuterClass + .internal_static_google_showcase_v1beta1_ListBlurbsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.MessagingOuterClass + .internal_static_google_showcase_v1beta1_ListBlurbsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.ListBlurbsRequest.class, + com.google.showcase.v1beta1.ListBlurbsRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object parent_ = ""; + + /** + * + * + *
        +   * The resource name of the requested room or profile who blurbs to list.
        +   * 
        + * + * + * 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; + } + } + + /** + * + * + *
        +   * The resource name of the requested room or profile who blurbs to list.
        +   * 
        + * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + @java.lang.Override + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PAGE_SIZE_FIELD_NUMBER = 2; + private int pageSize_ = 0; + + /** + * + * + *
        +   * The maximum number of blurbs to return. Server may return fewer
        +   * blurbs than requested. If unspecified, server will pick an appropriate
        +   * default.
        +   * 
        + * + * int32 page_size = 2; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + + public static final int PAGE_TOKEN_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object pageToken_ = ""; + + /** + * + * + *
        +   * The value of google.showcase.v1beta1.ListBlurbsResponse.next_page_token
        +   * returned from the previous call to
        +   * `google.showcase.v1beta1.Messaging\ListBlurbs` method.
        +   * 
        + * + * string page_token = 3; + * + * @return The pageToken. + */ + @java.lang.Override + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; + } + } + + /** + * + * + *
        +   * The value of google.showcase.v1beta1.ListBlurbsResponse.next_page_token
        +   * returned from the previous call to
        +   * `google.showcase.v1beta1.Messaging\ListBlurbs` method.
        +   * 
        + * + * string page_token = 3; + * + * @return The bytes for pageToken. + */ + @java.lang.Override + public com.google.protobuf.ByteString getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!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_); + } + 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_); + } + 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.showcase.v1beta1.ListBlurbsRequest)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.ListBlurbsRequest other = + (com.google.showcase.v1beta1.ListBlurbsRequest) obj; + + if (!getParent().equals(other.getParent())) 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(); + 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.showcase.v1beta1.ListBlurbsRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.ListBlurbsRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.ListBlurbsRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.ListBlurbsRequest 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.showcase.v1beta1.ListBlurbsRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.ListBlurbsRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.ListBlurbsRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.ListBlurbsRequest 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.showcase.v1beta1.ListBlurbsRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.ListBlurbsRequest 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.showcase.v1beta1.ListBlurbsRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.ListBlurbsRequest 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.showcase.v1beta1.ListBlurbsRequest 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 request message for the google.showcase.v1beta1.Messaging\ListBlurbs
        +   * method.
        +   * 
        + * + * Protobuf type {@code google.showcase.v1beta1.ListBlurbsRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.ListBlurbsRequest) + com.google.showcase.v1beta1.ListBlurbsRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.MessagingOuterClass + .internal_static_google_showcase_v1beta1_ListBlurbsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.MessagingOuterClass + .internal_static_google_showcase_v1beta1_ListBlurbsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.ListBlurbsRequest.class, + com.google.showcase.v1beta1.ListBlurbsRequest.Builder.class); + } + + // Construct using com.google.showcase.v1beta1.ListBlurbsRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + parent_ = ""; + pageSize_ = 0; + pageToken_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.showcase.v1beta1.MessagingOuterClass + .internal_static_google_showcase_v1beta1_ListBlurbsRequest_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.ListBlurbsRequest getDefaultInstanceForType() { + return com.google.showcase.v1beta1.ListBlurbsRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.ListBlurbsRequest build() { + com.google.showcase.v1beta1.ListBlurbsRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.ListBlurbsRequest buildPartial() { + com.google.showcase.v1beta1.ListBlurbsRequest result = + new com.google.showcase.v1beta1.ListBlurbsRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.showcase.v1beta1.ListBlurbsRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.parent_ = parent_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.pageSize_ = pageSize_; + } + if (((from_bitField0_ & 0x00000004) != 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.showcase.v1beta1.ListBlurbsRequest) { + return mergeFrom((com.google.showcase.v1beta1.ListBlurbsRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.showcase.v1beta1.ListBlurbsRequest other) { + if (other == com.google.showcase.v1beta1.ListBlurbsRequest.getDefaultInstance()) return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.getPageSize() != 0) { + setPageSize(other.getPageSize()); + } + if (!other.getPageToken().isEmpty()) { + pageToken_ = other.pageToken_; + 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 16: + { + pageSize_ = input.readInt32(); + bitField0_ |= 0x00000002; + break; + } // case 16 + case 26: + { + pageToken_ = 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_ = ""; + + /** + * + * + *
        +     * The resource name of the requested room or profile who blurbs to list.
        +     * 
        + * + * + * 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; + } + } + + /** + * + * + *
        +     * The resource name of the requested room or profile who blurbs to list.
        +     * 
        + * + * + * 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; + } + } + + /** + * + * + *
        +     * The resource name of the requested room or profile who blurbs to list.
        +     * 
        + * + * + * 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; + } + + /** + * + * + *
        +     * The resource name of the requested room or profile who blurbs to list.
        +     * 
        + * + * + * 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; + } + + /** + * + * + *
        +     * The resource name of the requested room or profile who blurbs to list.
        +     * 
        + * + * + * 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 int pageSize_; + + /** + * + * + *
        +     * The maximum number of blurbs to return. Server may return fewer
        +     * blurbs than requested. If unspecified, server will pick an appropriate
        +     * default.
        +     * 
        + * + * int32 page_size = 2; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + + /** + * + * + *
        +     * The maximum number of blurbs to return. Server may return fewer
        +     * blurbs than requested. If unspecified, server will pick an appropriate
        +     * default.
        +     * 
        + * + * int32 page_size = 2; + * + * @param value The pageSize to set. + * @return This builder for chaining. + */ + public Builder setPageSize(int value) { + + pageSize_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
        +     * The maximum number of blurbs to return. Server may return fewer
        +     * blurbs than requested. If unspecified, server will pick an appropriate
        +     * default.
        +     * 
        + * + * int32 page_size = 2; + * + * @return This builder for chaining. + */ + public Builder clearPageSize() { + bitField0_ = (bitField0_ & ~0x00000002); + pageSize_ = 0; + onChanged(); + return this; + } + + private java.lang.Object pageToken_ = ""; + + /** + * + * + *
        +     * The value of google.showcase.v1beta1.ListBlurbsResponse.next_page_token
        +     * returned from the previous call to
        +     * `google.showcase.v1beta1.Messaging\ListBlurbs` method.
        +     * 
        + * + * string page_token = 3; + * + * @return The pageToken. + */ + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
        +     * The value of google.showcase.v1beta1.ListBlurbsResponse.next_page_token
        +     * returned from the previous call to
        +     * `google.showcase.v1beta1.Messaging\ListBlurbs` method.
        +     * 
        + * + * string page_token = 3; + * + * @return The bytes for pageToken. + */ + public com.google.protobuf.ByteString getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
        +     * The value of google.showcase.v1beta1.ListBlurbsResponse.next_page_token
        +     * returned from the previous call to
        +     * `google.showcase.v1beta1.Messaging\ListBlurbs` method.
        +     * 
        + * + * string page_token = 3; + * + * @param value The pageToken to set. + * @return This builder for chaining. + */ + public Builder setPageToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + pageToken_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
        +     * The value of google.showcase.v1beta1.ListBlurbsResponse.next_page_token
        +     * returned from the previous call to
        +     * `google.showcase.v1beta1.Messaging\ListBlurbs` method.
        +     * 
        + * + * string page_token = 3; + * + * @return This builder for chaining. + */ + public Builder clearPageToken() { + pageToken_ = getDefaultInstance().getPageToken(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + + /** + * + * + *
        +     * The value of google.showcase.v1beta1.ListBlurbsResponse.next_page_token
        +     * returned from the previous call to
        +     * `google.showcase.v1beta1.Messaging\ListBlurbs` method.
        +     * 
        + * + * string page_token = 3; + * + * @param value The bytes for pageToken to set. + * @return This builder for chaining. + */ + public Builder setPageTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + pageToken_ = value; + 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.showcase.v1beta1.ListBlurbsRequest) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.ListBlurbsRequest) + private static final com.google.showcase.v1beta1.ListBlurbsRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.ListBlurbsRequest(); + } + + public static com.google.showcase.v1beta1.ListBlurbsRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListBlurbsRequest 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.showcase.v1beta1.ListBlurbsRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListBlurbsRequestOrBuilder.java b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListBlurbsRequestOrBuilder.java new file mode 100644 index 0000000000..d251a72871 --- /dev/null +++ b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListBlurbsRequestOrBuilder.java @@ -0,0 +1,101 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/messaging.proto + +// Protobuf Java Version: 3.25.8 +package com.google.showcase.v1beta1; + +public interface ListBlurbsRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.ListBlurbsRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
        +   * The resource name of the requested room or profile who blurbs to list.
        +   * 
        + * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + + /** + * + * + *
        +   * The resource name of the requested room or profile who blurbs to list.
        +   * 
        + * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
        +   * The maximum number of blurbs to return. Server may return fewer
        +   * blurbs than requested. If unspecified, server will pick an appropriate
        +   * default.
        +   * 
        + * + * int32 page_size = 2; + * + * @return The pageSize. + */ + int getPageSize(); + + /** + * + * + *
        +   * The value of google.showcase.v1beta1.ListBlurbsResponse.next_page_token
        +   * returned from the previous call to
        +   * `google.showcase.v1beta1.Messaging\ListBlurbs` method.
        +   * 
        + * + * string page_token = 3; + * + * @return The pageToken. + */ + java.lang.String getPageToken(); + + /** + * + * + *
        +   * The value of google.showcase.v1beta1.ListBlurbsResponse.next_page_token
        +   * returned from the previous call to
        +   * `google.showcase.v1beta1.Messaging\ListBlurbs` method.
        +   * 
        + * + * string page_token = 3; + * + * @return The bytes for pageToken. + */ + com.google.protobuf.ByteString getPageTokenBytes(); +} diff --git a/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListBlurbsResponse.java b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListBlurbsResponse.java new file mode 100644 index 0000000000..5e4ffa969b --- /dev/null +++ b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListBlurbsResponse.java @@ -0,0 +1,1167 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/messaging.proto + +// Protobuf Java Version: 3.25.8 +package com.google.showcase.v1beta1; + +/** + * + * + *
        + * The response message for the google.showcase.v1beta1.Messaging\ListBlurbs
        + * method.
        + * 
        + * + * Protobuf type {@code google.showcase.v1beta1.ListBlurbsResponse} + */ +public final class ListBlurbsResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.ListBlurbsResponse) + ListBlurbsResponseOrBuilder { + private static final long serialVersionUID = 0L; + + // Use ListBlurbsResponse.newBuilder() to construct. + private ListBlurbsResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListBlurbsResponse() { + blurbs_ = java.util.Collections.emptyList(); + nextPageToken_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListBlurbsResponse(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.MessagingOuterClass + .internal_static_google_showcase_v1beta1_ListBlurbsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.MessagingOuterClass + .internal_static_google_showcase_v1beta1_ListBlurbsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.ListBlurbsResponse.class, + com.google.showcase.v1beta1.ListBlurbsResponse.Builder.class); + } + + public static final int BLURBS_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private java.util.List blurbs_; + + /** + * + * + *
        +   * The list of blurbs.
        +   * 
        + * + * repeated .google.showcase.v1beta1.Blurb blurbs = 1; + */ + @java.lang.Override + public java.util.List getBlurbsList() { + return blurbs_; + } + + /** + * + * + *
        +   * The list of blurbs.
        +   * 
        + * + * repeated .google.showcase.v1beta1.Blurb blurbs = 1; + */ + @java.lang.Override + public java.util.List + getBlurbsOrBuilderList() { + return blurbs_; + } + + /** + * + * + *
        +   * The list of blurbs.
        +   * 
        + * + * repeated .google.showcase.v1beta1.Blurb blurbs = 1; + */ + @java.lang.Override + public int getBlurbsCount() { + return blurbs_.size(); + } + + /** + * + * + *
        +   * The list of blurbs.
        +   * 
        + * + * repeated .google.showcase.v1beta1.Blurb blurbs = 1; + */ + @java.lang.Override + public com.google.showcase.v1beta1.Blurb getBlurbs(int index) { + return blurbs_.get(index); + } + + /** + * + * + *
        +   * The list of blurbs.
        +   * 
        + * + * repeated .google.showcase.v1beta1.Blurb blurbs = 1; + */ + @java.lang.Override + public com.google.showcase.v1beta1.BlurbOrBuilder getBlurbsOrBuilder(int index) { + return blurbs_.get(index); + } + + public static final int NEXT_PAGE_TOKEN_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object nextPageToken_ = ""; + + /** + * + * + *
        +   * A token to retrieve next page of results.
        +   * Pass this value in ListBlurbsRequest.page_token field in the subsequent
        +   * call to `google.showcase.v1beta1.Blurb\ListBlurbs` method to retrieve
        +   * the next page of results.
        +   * 
        + * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + @java.lang.Override + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nextPageToken_ = s; + return s; + } + } + + /** + * + * + *
        +   * A token to retrieve next page of results.
        +   * Pass this value in ListBlurbsRequest.page_token field in the subsequent
        +   * call to `google.showcase.v1beta1.Blurb\ListBlurbs` method to retrieve
        +   * the next page of results.
        +   * 
        + * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + nextPageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + for (int i = 0; i < blurbs_.size(); i++) { + output.writeMessage(1, blurbs_.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 < blurbs_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, blurbs_.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.showcase.v1beta1.ListBlurbsResponse)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.ListBlurbsResponse other = + (com.google.showcase.v1beta1.ListBlurbsResponse) obj; + + if (!getBlurbsList().equals(other.getBlurbsList())) 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 (getBlurbsCount() > 0) { + hash = (37 * hash) + BLURBS_FIELD_NUMBER; + hash = (53 * hash) + getBlurbsList().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.showcase.v1beta1.ListBlurbsResponse parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.ListBlurbsResponse parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.ListBlurbsResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.ListBlurbsResponse 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.showcase.v1beta1.ListBlurbsResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.ListBlurbsResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.ListBlurbsResponse parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.ListBlurbsResponse 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.showcase.v1beta1.ListBlurbsResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.ListBlurbsResponse 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.showcase.v1beta1.ListBlurbsResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.ListBlurbsResponse 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.showcase.v1beta1.ListBlurbsResponse 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 message for the google.showcase.v1beta1.Messaging\ListBlurbs
        +   * method.
        +   * 
        + * + * Protobuf type {@code google.showcase.v1beta1.ListBlurbsResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.ListBlurbsResponse) + com.google.showcase.v1beta1.ListBlurbsResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.MessagingOuterClass + .internal_static_google_showcase_v1beta1_ListBlurbsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.MessagingOuterClass + .internal_static_google_showcase_v1beta1_ListBlurbsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.ListBlurbsResponse.class, + com.google.showcase.v1beta1.ListBlurbsResponse.Builder.class); + } + + // Construct using com.google.showcase.v1beta1.ListBlurbsResponse.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (blurbsBuilder_ == null) { + blurbs_ = java.util.Collections.emptyList(); + } else { + blurbs_ = null; + blurbsBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + nextPageToken_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.showcase.v1beta1.MessagingOuterClass + .internal_static_google_showcase_v1beta1_ListBlurbsResponse_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.ListBlurbsResponse getDefaultInstanceForType() { + return com.google.showcase.v1beta1.ListBlurbsResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.ListBlurbsResponse build() { + com.google.showcase.v1beta1.ListBlurbsResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.ListBlurbsResponse buildPartial() { + com.google.showcase.v1beta1.ListBlurbsResponse result = + new com.google.showcase.v1beta1.ListBlurbsResponse(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields(com.google.showcase.v1beta1.ListBlurbsResponse result) { + if (blurbsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + blurbs_ = java.util.Collections.unmodifiableList(blurbs_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.blurbs_ = blurbs_; + } else { + result.blurbs_ = blurbsBuilder_.build(); + } + } + + private void buildPartial0(com.google.showcase.v1beta1.ListBlurbsResponse 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.showcase.v1beta1.ListBlurbsResponse) { + return mergeFrom((com.google.showcase.v1beta1.ListBlurbsResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.showcase.v1beta1.ListBlurbsResponse other) { + if (other == com.google.showcase.v1beta1.ListBlurbsResponse.getDefaultInstance()) return this; + if (blurbsBuilder_ == null) { + if (!other.blurbs_.isEmpty()) { + if (blurbs_.isEmpty()) { + blurbs_ = other.blurbs_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureBlurbsIsMutable(); + blurbs_.addAll(other.blurbs_); + } + onChanged(); + } + } else { + if (!other.blurbs_.isEmpty()) { + if (blurbsBuilder_.isEmpty()) { + blurbsBuilder_.dispose(); + blurbsBuilder_ = null; + blurbs_ = other.blurbs_; + bitField0_ = (bitField0_ & ~0x00000001); + blurbsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getBlurbsFieldBuilder() + : null; + } else { + blurbsBuilder_.addAllMessages(other.blurbs_); + } + } + } + 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.showcase.v1beta1.Blurb m = + input.readMessage( + com.google.showcase.v1beta1.Blurb.parser(), extensionRegistry); + if (blurbsBuilder_ == null) { + ensureBlurbsIsMutable(); + blurbs_.add(m); + } else { + blurbsBuilder_.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 blurbs_ = + java.util.Collections.emptyList(); + + private void ensureBlurbsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + blurbs_ = new java.util.ArrayList(blurbs_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.showcase.v1beta1.Blurb, + com.google.showcase.v1beta1.Blurb.Builder, + com.google.showcase.v1beta1.BlurbOrBuilder> + blurbsBuilder_; + + /** + * + * + *
        +     * The list of blurbs.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Blurb blurbs = 1; + */ + public java.util.List getBlurbsList() { + if (blurbsBuilder_ == null) { + return java.util.Collections.unmodifiableList(blurbs_); + } else { + return blurbsBuilder_.getMessageList(); + } + } + + /** + * + * + *
        +     * The list of blurbs.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Blurb blurbs = 1; + */ + public int getBlurbsCount() { + if (blurbsBuilder_ == null) { + return blurbs_.size(); + } else { + return blurbsBuilder_.getCount(); + } + } + + /** + * + * + *
        +     * The list of blurbs.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Blurb blurbs = 1; + */ + public com.google.showcase.v1beta1.Blurb getBlurbs(int index) { + if (blurbsBuilder_ == null) { + return blurbs_.get(index); + } else { + return blurbsBuilder_.getMessage(index); + } + } + + /** + * + * + *
        +     * The list of blurbs.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Blurb blurbs = 1; + */ + public Builder setBlurbs(int index, com.google.showcase.v1beta1.Blurb value) { + if (blurbsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureBlurbsIsMutable(); + blurbs_.set(index, value); + onChanged(); + } else { + blurbsBuilder_.setMessage(index, value); + } + return this; + } + + /** + * + * + *
        +     * The list of blurbs.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Blurb blurbs = 1; + */ + public Builder setBlurbs(int index, com.google.showcase.v1beta1.Blurb.Builder builderForValue) { + if (blurbsBuilder_ == null) { + ensureBlurbsIsMutable(); + blurbs_.set(index, builderForValue.build()); + onChanged(); + } else { + blurbsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
        +     * The list of blurbs.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Blurb blurbs = 1; + */ + public Builder addBlurbs(com.google.showcase.v1beta1.Blurb value) { + if (blurbsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureBlurbsIsMutable(); + blurbs_.add(value); + onChanged(); + } else { + blurbsBuilder_.addMessage(value); + } + return this; + } + + /** + * + * + *
        +     * The list of blurbs.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Blurb blurbs = 1; + */ + public Builder addBlurbs(int index, com.google.showcase.v1beta1.Blurb value) { + if (blurbsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureBlurbsIsMutable(); + blurbs_.add(index, value); + onChanged(); + } else { + blurbsBuilder_.addMessage(index, value); + } + return this; + } + + /** + * + * + *
        +     * The list of blurbs.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Blurb blurbs = 1; + */ + public Builder addBlurbs(com.google.showcase.v1beta1.Blurb.Builder builderForValue) { + if (blurbsBuilder_ == null) { + ensureBlurbsIsMutable(); + blurbs_.add(builderForValue.build()); + onChanged(); + } else { + blurbsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + + /** + * + * + *
        +     * The list of blurbs.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Blurb blurbs = 1; + */ + public Builder addBlurbs(int index, com.google.showcase.v1beta1.Blurb.Builder builderForValue) { + if (blurbsBuilder_ == null) { + ensureBlurbsIsMutable(); + blurbs_.add(index, builderForValue.build()); + onChanged(); + } else { + blurbsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
        +     * The list of blurbs.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Blurb blurbs = 1; + */ + public Builder addAllBlurbs( + java.lang.Iterable values) { + if (blurbsBuilder_ == null) { + ensureBlurbsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, blurbs_); + onChanged(); + } else { + blurbsBuilder_.addAllMessages(values); + } + return this; + } + + /** + * + * + *
        +     * The list of blurbs.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Blurb blurbs = 1; + */ + public Builder clearBlurbs() { + if (blurbsBuilder_ == null) { + blurbs_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + blurbsBuilder_.clear(); + } + return this; + } + + /** + * + * + *
        +     * The list of blurbs.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Blurb blurbs = 1; + */ + public Builder removeBlurbs(int index) { + if (blurbsBuilder_ == null) { + ensureBlurbsIsMutable(); + blurbs_.remove(index); + onChanged(); + } else { + blurbsBuilder_.remove(index); + } + return this; + } + + /** + * + * + *
        +     * The list of blurbs.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Blurb blurbs = 1; + */ + public com.google.showcase.v1beta1.Blurb.Builder getBlurbsBuilder(int index) { + return getBlurbsFieldBuilder().getBuilder(index); + } + + /** + * + * + *
        +     * The list of blurbs.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Blurb blurbs = 1; + */ + public com.google.showcase.v1beta1.BlurbOrBuilder getBlurbsOrBuilder(int index) { + if (blurbsBuilder_ == null) { + return blurbs_.get(index); + } else { + return blurbsBuilder_.getMessageOrBuilder(index); + } + } + + /** + * + * + *
        +     * The list of blurbs.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Blurb blurbs = 1; + */ + public java.util.List + getBlurbsOrBuilderList() { + if (blurbsBuilder_ != null) { + return blurbsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(blurbs_); + } + } + + /** + * + * + *
        +     * The list of blurbs.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Blurb blurbs = 1; + */ + public com.google.showcase.v1beta1.Blurb.Builder addBlurbsBuilder() { + return getBlurbsFieldBuilder() + .addBuilder(com.google.showcase.v1beta1.Blurb.getDefaultInstance()); + } + + /** + * + * + *
        +     * The list of blurbs.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Blurb blurbs = 1; + */ + public com.google.showcase.v1beta1.Blurb.Builder addBlurbsBuilder(int index) { + return getBlurbsFieldBuilder() + .addBuilder(index, com.google.showcase.v1beta1.Blurb.getDefaultInstance()); + } + + /** + * + * + *
        +     * The list of blurbs.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Blurb blurbs = 1; + */ + public java.util.List getBlurbsBuilderList() { + return getBlurbsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.showcase.v1beta1.Blurb, + com.google.showcase.v1beta1.Blurb.Builder, + com.google.showcase.v1beta1.BlurbOrBuilder> + getBlurbsFieldBuilder() { + if (blurbsBuilder_ == null) { + blurbsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.showcase.v1beta1.Blurb, + com.google.showcase.v1beta1.Blurb.Builder, + com.google.showcase.v1beta1.BlurbOrBuilder>( + blurbs_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + blurbs_ = null; + } + return blurbsBuilder_; + } + + private java.lang.Object nextPageToken_ = ""; + + /** + * + * + *
        +     * A token to retrieve next page of results.
        +     * Pass this value in ListBlurbsRequest.page_token field in the subsequent
        +     * call to `google.showcase.v1beta1.Blurb\ListBlurbs` method to retrieve
        +     * the next page of results.
        +     * 
        + * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nextPageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
        +     * A token to retrieve next page of results.
        +     * Pass this value in ListBlurbsRequest.page_token field in the subsequent
        +     * call to `google.showcase.v1beta1.Blurb\ListBlurbs` method to retrieve
        +     * the next page of results.
        +     * 
        + * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + public com.google.protobuf.ByteString getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + nextPageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
        +     * A token to retrieve next page of results.
        +     * Pass this value in ListBlurbsRequest.page_token field in the subsequent
        +     * call to `google.showcase.v1beta1.Blurb\ListBlurbs` method to retrieve
        +     * the next page of results.
        +     * 
        + * + * string next_page_token = 2; + * + * @param value The nextPageToken to set. + * @return This builder for chaining. + */ + public Builder setNextPageToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + nextPageToken_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
        +     * A token to retrieve next page of results.
        +     * Pass this value in ListBlurbsRequest.page_token field in the subsequent
        +     * call to `google.showcase.v1beta1.Blurb\ListBlurbs` method to retrieve
        +     * the next page of results.
        +     * 
        + * + * string next_page_token = 2; + * + * @return This builder for chaining. + */ + public Builder clearNextPageToken() { + nextPageToken_ = getDefaultInstance().getNextPageToken(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
        +     * A token to retrieve next page of results.
        +     * Pass this value in ListBlurbsRequest.page_token field in the subsequent
        +     * call to `google.showcase.v1beta1.Blurb\ListBlurbs` method to retrieve
        +     * the next page of results.
        +     * 
        + * + * string next_page_token = 2; + * + * @param value The bytes for nextPageToken to set. + * @return This builder for chaining. + */ + public Builder setNextPageTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + nextPageToken_ = value; + 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.showcase.v1beta1.ListBlurbsResponse) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.ListBlurbsResponse) + private static final com.google.showcase.v1beta1.ListBlurbsResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.ListBlurbsResponse(); + } + + public static com.google.showcase.v1beta1.ListBlurbsResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListBlurbsResponse 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.showcase.v1beta1.ListBlurbsResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListBlurbsResponseOrBuilder.java b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListBlurbsResponseOrBuilder.java new file mode 100644 index 0000000000..62d3fa9263 --- /dev/null +++ b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListBlurbsResponseOrBuilder.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: schema/google/showcase/v1beta1/messaging.proto + +// Protobuf Java Version: 3.25.8 +package com.google.showcase.v1beta1; + +public interface ListBlurbsResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.ListBlurbsResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
        +   * The list of blurbs.
        +   * 
        + * + * repeated .google.showcase.v1beta1.Blurb blurbs = 1; + */ + java.util.List getBlurbsList(); + + /** + * + * + *
        +   * The list of blurbs.
        +   * 
        + * + * repeated .google.showcase.v1beta1.Blurb blurbs = 1; + */ + com.google.showcase.v1beta1.Blurb getBlurbs(int index); + + /** + * + * + *
        +   * The list of blurbs.
        +   * 
        + * + * repeated .google.showcase.v1beta1.Blurb blurbs = 1; + */ + int getBlurbsCount(); + + /** + * + * + *
        +   * The list of blurbs.
        +   * 
        + * + * repeated .google.showcase.v1beta1.Blurb blurbs = 1; + */ + java.util.List getBlurbsOrBuilderList(); + + /** + * + * + *
        +   * The list of blurbs.
        +   * 
        + * + * repeated .google.showcase.v1beta1.Blurb blurbs = 1; + */ + com.google.showcase.v1beta1.BlurbOrBuilder getBlurbsOrBuilder(int index); + + /** + * + * + *
        +   * A token to retrieve next page of results.
        +   * Pass this value in ListBlurbsRequest.page_token field in the subsequent
        +   * call to `google.showcase.v1beta1.Blurb\ListBlurbs` method to retrieve
        +   * the next page of results.
        +   * 
        + * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + java.lang.String getNextPageToken(); + + /** + * + * + *
        +   * A token to retrieve next page of results.
        +   * Pass this value in ListBlurbsRequest.page_token field in the subsequent
        +   * call to `google.showcase.v1beta1.Blurb\ListBlurbs` method to retrieve
        +   * the next page of results.
        +   * 
        + * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + com.google.protobuf.ByteString getNextPageTokenBytes(); +} diff --git a/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListRoomsRequest.java b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListRoomsRequest.java new file mode 100644 index 0000000000..d0aa8ba945 --- /dev/null +++ b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListRoomsRequest.java @@ -0,0 +1,750 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/messaging.proto + +// Protobuf Java Version: 3.25.8 +package com.google.showcase.v1beta1; + +/** + * + * + *
        + * The request message for the google.showcase.v1beta1.Messaging\ListRooms
        + * method.
        + * 
        + * + * Protobuf type {@code google.showcase.v1beta1.ListRoomsRequest} + */ +public final class ListRoomsRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.ListRoomsRequest) + ListRoomsRequestOrBuilder { + private static final long serialVersionUID = 0L; + + // Use ListRoomsRequest.newBuilder() to construct. + private ListRoomsRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListRoomsRequest() { + pageToken_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListRoomsRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.MessagingOuterClass + .internal_static_google_showcase_v1beta1_ListRoomsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.MessagingOuterClass + .internal_static_google_showcase_v1beta1_ListRoomsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.ListRoomsRequest.class, + com.google.showcase.v1beta1.ListRoomsRequest.Builder.class); + } + + public static final int PAGE_SIZE_FIELD_NUMBER = 1; + private int pageSize_ = 0; + + /** + * + * + *
        +   * The maximum number of rooms return. Server may return fewer rooms
        +   * than requested. If unspecified, server will pick an appropriate default.
        +   * 
        + * + * int32 page_size = 1; + * + * @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_ = ""; + + /** + * + * + *
        +   * The value of google.showcase.v1beta1.ListRoomsResponse.next_page_token
        +   * returned from the previous call to
        +   * `google.showcase.v1beta1.Messaging\ListRooms` method.
        +   * 
        + * + * string page_token = 2; + * + * @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; + } + } + + /** + * + * + *
        +   * The value of google.showcase.v1beta1.ListRoomsResponse.next_page_token
        +   * returned from the previous call to
        +   * `google.showcase.v1beta1.Messaging\ListRooms` method.
        +   * 
        + * + * string page_token = 2; + * + * @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.showcase.v1beta1.ListRoomsRequest)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.ListRoomsRequest other = + (com.google.showcase.v1beta1.ListRoomsRequest) 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.showcase.v1beta1.ListRoomsRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.ListRoomsRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.ListRoomsRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.ListRoomsRequest 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.showcase.v1beta1.ListRoomsRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.ListRoomsRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.ListRoomsRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.ListRoomsRequest 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.showcase.v1beta1.ListRoomsRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.ListRoomsRequest 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.showcase.v1beta1.ListRoomsRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.ListRoomsRequest 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.showcase.v1beta1.ListRoomsRequest 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 request message for the google.showcase.v1beta1.Messaging\ListRooms
        +   * method.
        +   * 
        + * + * Protobuf type {@code google.showcase.v1beta1.ListRoomsRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.ListRoomsRequest) + com.google.showcase.v1beta1.ListRoomsRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.MessagingOuterClass + .internal_static_google_showcase_v1beta1_ListRoomsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.MessagingOuterClass + .internal_static_google_showcase_v1beta1_ListRoomsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.ListRoomsRequest.class, + com.google.showcase.v1beta1.ListRoomsRequest.Builder.class); + } + + // Construct using com.google.showcase.v1beta1.ListRoomsRequest.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.showcase.v1beta1.MessagingOuterClass + .internal_static_google_showcase_v1beta1_ListRoomsRequest_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.ListRoomsRequest getDefaultInstanceForType() { + return com.google.showcase.v1beta1.ListRoomsRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.ListRoomsRequest build() { + com.google.showcase.v1beta1.ListRoomsRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.ListRoomsRequest buildPartial() { + com.google.showcase.v1beta1.ListRoomsRequest result = + new com.google.showcase.v1beta1.ListRoomsRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.showcase.v1beta1.ListRoomsRequest 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.showcase.v1beta1.ListRoomsRequest) { + return mergeFrom((com.google.showcase.v1beta1.ListRoomsRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.showcase.v1beta1.ListRoomsRequest other) { + if (other == com.google.showcase.v1beta1.ListRoomsRequest.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_; + + /** + * + * + *
        +     * The maximum number of rooms return. Server may return fewer rooms
        +     * than requested. If unspecified, server will pick an appropriate default.
        +     * 
        + * + * int32 page_size = 1; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + + /** + * + * + *
        +     * The maximum number of rooms return. Server may return fewer rooms
        +     * than requested. If unspecified, server will pick an appropriate default.
        +     * 
        + * + * int32 page_size = 1; + * + * @param value The pageSize to set. + * @return This builder for chaining. + */ + public Builder setPageSize(int value) { + + pageSize_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
        +     * The maximum number of rooms return. Server may return fewer rooms
        +     * than requested. If unspecified, server will pick an appropriate default.
        +     * 
        + * + * int32 page_size = 1; + * + * @return This builder for chaining. + */ + public Builder clearPageSize() { + bitField0_ = (bitField0_ & ~0x00000001); + pageSize_ = 0; + onChanged(); + return this; + } + + private java.lang.Object pageToken_ = ""; + + /** + * + * + *
        +     * The value of google.showcase.v1beta1.ListRoomsResponse.next_page_token
        +     * returned from the previous call to
        +     * `google.showcase.v1beta1.Messaging\ListRooms` method.
        +     * 
        + * + * string page_token = 2; + * + * @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; + } + } + + /** + * + * + *
        +     * The value of google.showcase.v1beta1.ListRoomsResponse.next_page_token
        +     * returned from the previous call to
        +     * `google.showcase.v1beta1.Messaging\ListRooms` method.
        +     * 
        + * + * string page_token = 2; + * + * @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; + } + } + + /** + * + * + *
        +     * The value of google.showcase.v1beta1.ListRoomsResponse.next_page_token
        +     * returned from the previous call to
        +     * `google.showcase.v1beta1.Messaging\ListRooms` method.
        +     * 
        + * + * string page_token = 2; + * + * @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; + } + + /** + * + * + *
        +     * The value of google.showcase.v1beta1.ListRoomsResponse.next_page_token
        +     * returned from the previous call to
        +     * `google.showcase.v1beta1.Messaging\ListRooms` method.
        +     * 
        + * + * string page_token = 2; + * + * @return This builder for chaining. + */ + public Builder clearPageToken() { + pageToken_ = getDefaultInstance().getPageToken(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
        +     * The value of google.showcase.v1beta1.ListRoomsResponse.next_page_token
        +     * returned from the previous call to
        +     * `google.showcase.v1beta1.Messaging\ListRooms` method.
        +     * 
        + * + * string page_token = 2; + * + * @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.showcase.v1beta1.ListRoomsRequest) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.ListRoomsRequest) + private static final com.google.showcase.v1beta1.ListRoomsRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.ListRoomsRequest(); + } + + public static com.google.showcase.v1beta1.ListRoomsRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListRoomsRequest 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.showcase.v1beta1.ListRoomsRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListRoomsRequestOrBuilder.java b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListRoomsRequestOrBuilder.java new file mode 100644 index 0000000000..9ef021df4e --- /dev/null +++ b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListRoomsRequestOrBuilder.java @@ -0,0 +1,70 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/messaging.proto + +// Protobuf Java Version: 3.25.8 +package com.google.showcase.v1beta1; + +public interface ListRoomsRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.ListRoomsRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
        +   * The maximum number of rooms return. Server may return fewer rooms
        +   * than requested. If unspecified, server will pick an appropriate default.
        +   * 
        + * + * int32 page_size = 1; + * + * @return The pageSize. + */ + int getPageSize(); + + /** + * + * + *
        +   * The value of google.showcase.v1beta1.ListRoomsResponse.next_page_token
        +   * returned from the previous call to
        +   * `google.showcase.v1beta1.Messaging\ListRooms` method.
        +   * 
        + * + * string page_token = 2; + * + * @return The pageToken. + */ + java.lang.String getPageToken(); + + /** + * + * + *
        +   * The value of google.showcase.v1beta1.ListRoomsResponse.next_page_token
        +   * returned from the previous call to
        +   * `google.showcase.v1beta1.Messaging\ListRooms` method.
        +   * 
        + * + * string page_token = 2; + * + * @return The bytes for pageToken. + */ + com.google.protobuf.ByteString getPageTokenBytes(); +} diff --git a/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListRoomsResponse.java b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListRoomsResponse.java new file mode 100644 index 0000000000..106fda7881 --- /dev/null +++ b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListRoomsResponse.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: schema/google/showcase/v1beta1/messaging.proto + +// Protobuf Java Version: 3.25.8 +package com.google.showcase.v1beta1; + +/** + * + * + *
        + * The response message for the google.showcase.v1beta1.Messaging\ListRooms
        + * method.
        + * 
        + * + * Protobuf type {@code google.showcase.v1beta1.ListRoomsResponse} + */ +public final class ListRoomsResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.ListRoomsResponse) + ListRoomsResponseOrBuilder { + private static final long serialVersionUID = 0L; + + // Use ListRoomsResponse.newBuilder() to construct. + private ListRoomsResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListRoomsResponse() { + rooms_ = java.util.Collections.emptyList(); + nextPageToken_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListRoomsResponse(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.MessagingOuterClass + .internal_static_google_showcase_v1beta1_ListRoomsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.MessagingOuterClass + .internal_static_google_showcase_v1beta1_ListRoomsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.ListRoomsResponse.class, + com.google.showcase.v1beta1.ListRoomsResponse.Builder.class); + } + + public static final int ROOMS_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private java.util.List rooms_; + + /** + * + * + *
        +   * The list of rooms.
        +   * 
        + * + * repeated .google.showcase.v1beta1.Room rooms = 1; + */ + @java.lang.Override + public java.util.List getRoomsList() { + return rooms_; + } + + /** + * + * + *
        +   * The list of rooms.
        +   * 
        + * + * repeated .google.showcase.v1beta1.Room rooms = 1; + */ + @java.lang.Override + public java.util.List + getRoomsOrBuilderList() { + return rooms_; + } + + /** + * + * + *
        +   * The list of rooms.
        +   * 
        + * + * repeated .google.showcase.v1beta1.Room rooms = 1; + */ + @java.lang.Override + public int getRoomsCount() { + return rooms_.size(); + } + + /** + * + * + *
        +   * The list of rooms.
        +   * 
        + * + * repeated .google.showcase.v1beta1.Room rooms = 1; + */ + @java.lang.Override + public com.google.showcase.v1beta1.Room getRooms(int index) { + return rooms_.get(index); + } + + /** + * + * + *
        +   * The list of rooms.
        +   * 
        + * + * repeated .google.showcase.v1beta1.Room rooms = 1; + */ + @java.lang.Override + public com.google.showcase.v1beta1.RoomOrBuilder getRoomsOrBuilder(int index) { + return rooms_.get(index); + } + + public static final int NEXT_PAGE_TOKEN_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object nextPageToken_ = ""; + + /** + * + * + *
        +   * A token to retrieve next page of results.
        +   * Pass this value in ListRoomsRequest.page_token field in the subsequent
        +   * call to `google.showcase.v1beta1.Messaging\ListRooms` method to retrieve
        +   * the next page of results.
        +   * 
        + * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + @java.lang.Override + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nextPageToken_ = s; + return s; + } + } + + /** + * + * + *
        +   * A token to retrieve next page of results.
        +   * Pass this value in ListRoomsRequest.page_token field in the subsequent
        +   * call to `google.showcase.v1beta1.Messaging\ListRooms` method to retrieve
        +   * the next page of results.
        +   * 
        + * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + nextPageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + for (int i = 0; i < rooms_.size(); i++) { + output.writeMessage(1, rooms_.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 < rooms_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, rooms_.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.showcase.v1beta1.ListRoomsResponse)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.ListRoomsResponse other = + (com.google.showcase.v1beta1.ListRoomsResponse) obj; + + if (!getRoomsList().equals(other.getRoomsList())) 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 (getRoomsCount() > 0) { + hash = (37 * hash) + ROOMS_FIELD_NUMBER; + hash = (53 * hash) + getRoomsList().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.showcase.v1beta1.ListRoomsResponse parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.ListRoomsResponse parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.ListRoomsResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.ListRoomsResponse 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.showcase.v1beta1.ListRoomsResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.ListRoomsResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.ListRoomsResponse parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.ListRoomsResponse 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.showcase.v1beta1.ListRoomsResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.ListRoomsResponse 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.showcase.v1beta1.ListRoomsResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.ListRoomsResponse 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.showcase.v1beta1.ListRoomsResponse 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 message for the google.showcase.v1beta1.Messaging\ListRooms
        +   * method.
        +   * 
        + * + * Protobuf type {@code google.showcase.v1beta1.ListRoomsResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.ListRoomsResponse) + com.google.showcase.v1beta1.ListRoomsResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.MessagingOuterClass + .internal_static_google_showcase_v1beta1_ListRoomsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.MessagingOuterClass + .internal_static_google_showcase_v1beta1_ListRoomsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.ListRoomsResponse.class, + com.google.showcase.v1beta1.ListRoomsResponse.Builder.class); + } + + // Construct using com.google.showcase.v1beta1.ListRoomsResponse.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (roomsBuilder_ == null) { + rooms_ = java.util.Collections.emptyList(); + } else { + rooms_ = null; + roomsBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + nextPageToken_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.showcase.v1beta1.MessagingOuterClass + .internal_static_google_showcase_v1beta1_ListRoomsResponse_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.ListRoomsResponse getDefaultInstanceForType() { + return com.google.showcase.v1beta1.ListRoomsResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.ListRoomsResponse build() { + com.google.showcase.v1beta1.ListRoomsResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.ListRoomsResponse buildPartial() { + com.google.showcase.v1beta1.ListRoomsResponse result = + new com.google.showcase.v1beta1.ListRoomsResponse(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields(com.google.showcase.v1beta1.ListRoomsResponse result) { + if (roomsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + rooms_ = java.util.Collections.unmodifiableList(rooms_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.rooms_ = rooms_; + } else { + result.rooms_ = roomsBuilder_.build(); + } + } + + private void buildPartial0(com.google.showcase.v1beta1.ListRoomsResponse 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.showcase.v1beta1.ListRoomsResponse) { + return mergeFrom((com.google.showcase.v1beta1.ListRoomsResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.showcase.v1beta1.ListRoomsResponse other) { + if (other == com.google.showcase.v1beta1.ListRoomsResponse.getDefaultInstance()) return this; + if (roomsBuilder_ == null) { + if (!other.rooms_.isEmpty()) { + if (rooms_.isEmpty()) { + rooms_ = other.rooms_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureRoomsIsMutable(); + rooms_.addAll(other.rooms_); + } + onChanged(); + } + } else { + if (!other.rooms_.isEmpty()) { + if (roomsBuilder_.isEmpty()) { + roomsBuilder_.dispose(); + roomsBuilder_ = null; + rooms_ = other.rooms_; + bitField0_ = (bitField0_ & ~0x00000001); + roomsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getRoomsFieldBuilder() + : null; + } else { + roomsBuilder_.addAllMessages(other.rooms_); + } + } + } + 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.showcase.v1beta1.Room m = + input.readMessage(com.google.showcase.v1beta1.Room.parser(), extensionRegistry); + if (roomsBuilder_ == null) { + ensureRoomsIsMutable(); + rooms_.add(m); + } else { + roomsBuilder_.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 rooms_ = + java.util.Collections.emptyList(); + + private void ensureRoomsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + rooms_ = new java.util.ArrayList(rooms_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.showcase.v1beta1.Room, + com.google.showcase.v1beta1.Room.Builder, + com.google.showcase.v1beta1.RoomOrBuilder> + roomsBuilder_; + + /** + * + * + *
        +     * The list of rooms.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Room rooms = 1; + */ + public java.util.List getRoomsList() { + if (roomsBuilder_ == null) { + return java.util.Collections.unmodifiableList(rooms_); + } else { + return roomsBuilder_.getMessageList(); + } + } + + /** + * + * + *
        +     * The list of rooms.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Room rooms = 1; + */ + public int getRoomsCount() { + if (roomsBuilder_ == null) { + return rooms_.size(); + } else { + return roomsBuilder_.getCount(); + } + } + + /** + * + * + *
        +     * The list of rooms.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Room rooms = 1; + */ + public com.google.showcase.v1beta1.Room getRooms(int index) { + if (roomsBuilder_ == null) { + return rooms_.get(index); + } else { + return roomsBuilder_.getMessage(index); + } + } + + /** + * + * + *
        +     * The list of rooms.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Room rooms = 1; + */ + public Builder setRooms(int index, com.google.showcase.v1beta1.Room value) { + if (roomsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureRoomsIsMutable(); + rooms_.set(index, value); + onChanged(); + } else { + roomsBuilder_.setMessage(index, value); + } + return this; + } + + /** + * + * + *
        +     * The list of rooms.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Room rooms = 1; + */ + public Builder setRooms(int index, com.google.showcase.v1beta1.Room.Builder builderForValue) { + if (roomsBuilder_ == null) { + ensureRoomsIsMutable(); + rooms_.set(index, builderForValue.build()); + onChanged(); + } else { + roomsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
        +     * The list of rooms.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Room rooms = 1; + */ + public Builder addRooms(com.google.showcase.v1beta1.Room value) { + if (roomsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureRoomsIsMutable(); + rooms_.add(value); + onChanged(); + } else { + roomsBuilder_.addMessage(value); + } + return this; + } + + /** + * + * + *
        +     * The list of rooms.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Room rooms = 1; + */ + public Builder addRooms(int index, com.google.showcase.v1beta1.Room value) { + if (roomsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureRoomsIsMutable(); + rooms_.add(index, value); + onChanged(); + } else { + roomsBuilder_.addMessage(index, value); + } + return this; + } + + /** + * + * + *
        +     * The list of rooms.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Room rooms = 1; + */ + public Builder addRooms(com.google.showcase.v1beta1.Room.Builder builderForValue) { + if (roomsBuilder_ == null) { + ensureRoomsIsMutable(); + rooms_.add(builderForValue.build()); + onChanged(); + } else { + roomsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + + /** + * + * + *
        +     * The list of rooms.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Room rooms = 1; + */ + public Builder addRooms(int index, com.google.showcase.v1beta1.Room.Builder builderForValue) { + if (roomsBuilder_ == null) { + ensureRoomsIsMutable(); + rooms_.add(index, builderForValue.build()); + onChanged(); + } else { + roomsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
        +     * The list of rooms.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Room rooms = 1; + */ + public Builder addAllRooms( + java.lang.Iterable values) { + if (roomsBuilder_ == null) { + ensureRoomsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, rooms_); + onChanged(); + } else { + roomsBuilder_.addAllMessages(values); + } + return this; + } + + /** + * + * + *
        +     * The list of rooms.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Room rooms = 1; + */ + public Builder clearRooms() { + if (roomsBuilder_ == null) { + rooms_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + roomsBuilder_.clear(); + } + return this; + } + + /** + * + * + *
        +     * The list of rooms.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Room rooms = 1; + */ + public Builder removeRooms(int index) { + if (roomsBuilder_ == null) { + ensureRoomsIsMutable(); + rooms_.remove(index); + onChanged(); + } else { + roomsBuilder_.remove(index); + } + return this; + } + + /** + * + * + *
        +     * The list of rooms.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Room rooms = 1; + */ + public com.google.showcase.v1beta1.Room.Builder getRoomsBuilder(int index) { + return getRoomsFieldBuilder().getBuilder(index); + } + + /** + * + * + *
        +     * The list of rooms.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Room rooms = 1; + */ + public com.google.showcase.v1beta1.RoomOrBuilder getRoomsOrBuilder(int index) { + if (roomsBuilder_ == null) { + return rooms_.get(index); + } else { + return roomsBuilder_.getMessageOrBuilder(index); + } + } + + /** + * + * + *
        +     * The list of rooms.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Room rooms = 1; + */ + public java.util.List + getRoomsOrBuilderList() { + if (roomsBuilder_ != null) { + return roomsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(rooms_); + } + } + + /** + * + * + *
        +     * The list of rooms.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Room rooms = 1; + */ + public com.google.showcase.v1beta1.Room.Builder addRoomsBuilder() { + return getRoomsFieldBuilder() + .addBuilder(com.google.showcase.v1beta1.Room.getDefaultInstance()); + } + + /** + * + * + *
        +     * The list of rooms.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Room rooms = 1; + */ + public com.google.showcase.v1beta1.Room.Builder addRoomsBuilder(int index) { + return getRoomsFieldBuilder() + .addBuilder(index, com.google.showcase.v1beta1.Room.getDefaultInstance()); + } + + /** + * + * + *
        +     * The list of rooms.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Room rooms = 1; + */ + public java.util.List getRoomsBuilderList() { + return getRoomsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.showcase.v1beta1.Room, + com.google.showcase.v1beta1.Room.Builder, + com.google.showcase.v1beta1.RoomOrBuilder> + getRoomsFieldBuilder() { + if (roomsBuilder_ == null) { + roomsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.showcase.v1beta1.Room, + com.google.showcase.v1beta1.Room.Builder, + com.google.showcase.v1beta1.RoomOrBuilder>( + rooms_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + rooms_ = null; + } + return roomsBuilder_; + } + + private java.lang.Object nextPageToken_ = ""; + + /** + * + * + *
        +     * A token to retrieve next page of results.
        +     * Pass this value in ListRoomsRequest.page_token field in the subsequent
        +     * call to `google.showcase.v1beta1.Messaging\ListRooms` method to retrieve
        +     * the next page of results.
        +     * 
        + * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nextPageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
        +     * A token to retrieve next page of results.
        +     * Pass this value in ListRoomsRequest.page_token field in the subsequent
        +     * call to `google.showcase.v1beta1.Messaging\ListRooms` method to retrieve
        +     * the next page of results.
        +     * 
        + * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + public com.google.protobuf.ByteString getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + nextPageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
        +     * A token to retrieve next page of results.
        +     * Pass this value in ListRoomsRequest.page_token field in the subsequent
        +     * call to `google.showcase.v1beta1.Messaging\ListRooms` method to retrieve
        +     * the next page of results.
        +     * 
        + * + * string next_page_token = 2; + * + * @param value The nextPageToken to set. + * @return This builder for chaining. + */ + public Builder setNextPageToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + nextPageToken_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
        +     * A token to retrieve next page of results.
        +     * Pass this value in ListRoomsRequest.page_token field in the subsequent
        +     * call to `google.showcase.v1beta1.Messaging\ListRooms` method to retrieve
        +     * the next page of results.
        +     * 
        + * + * string next_page_token = 2; + * + * @return This builder for chaining. + */ + public Builder clearNextPageToken() { + nextPageToken_ = getDefaultInstance().getNextPageToken(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
        +     * A token to retrieve next page of results.
        +     * Pass this value in ListRoomsRequest.page_token field in the subsequent
        +     * call to `google.showcase.v1beta1.Messaging\ListRooms` method to retrieve
        +     * the next page of results.
        +     * 
        + * + * string next_page_token = 2; + * + * @param value The bytes for nextPageToken to set. + * @return This builder for chaining. + */ + public Builder setNextPageTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + nextPageToken_ = value; + 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.showcase.v1beta1.ListRoomsResponse) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.ListRoomsResponse) + private static final com.google.showcase.v1beta1.ListRoomsResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.ListRoomsResponse(); + } + + public static com.google.showcase.v1beta1.ListRoomsResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListRoomsResponse 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.showcase.v1beta1.ListRoomsResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListRoomsResponseOrBuilder.java b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListRoomsResponseOrBuilder.java new file mode 100644 index 0000000000..867cb0e8c7 --- /dev/null +++ b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListRoomsResponseOrBuilder.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: schema/google/showcase/v1beta1/messaging.proto + +// Protobuf Java Version: 3.25.8 +package com.google.showcase.v1beta1; + +public interface ListRoomsResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.ListRoomsResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
        +   * The list of rooms.
        +   * 
        + * + * repeated .google.showcase.v1beta1.Room rooms = 1; + */ + java.util.List getRoomsList(); + + /** + * + * + *
        +   * The list of rooms.
        +   * 
        + * + * repeated .google.showcase.v1beta1.Room rooms = 1; + */ + com.google.showcase.v1beta1.Room getRooms(int index); + + /** + * + * + *
        +   * The list of rooms.
        +   * 
        + * + * repeated .google.showcase.v1beta1.Room rooms = 1; + */ + int getRoomsCount(); + + /** + * + * + *
        +   * The list of rooms.
        +   * 
        + * + * repeated .google.showcase.v1beta1.Room rooms = 1; + */ + java.util.List getRoomsOrBuilderList(); + + /** + * + * + *
        +   * The list of rooms.
        +   * 
        + * + * repeated .google.showcase.v1beta1.Room rooms = 1; + */ + com.google.showcase.v1beta1.RoomOrBuilder getRoomsOrBuilder(int index); + + /** + * + * + *
        +   * A token to retrieve next page of results.
        +   * Pass this value in ListRoomsRequest.page_token field in the subsequent
        +   * call to `google.showcase.v1beta1.Messaging\ListRooms` method to retrieve
        +   * the next page of results.
        +   * 
        + * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + java.lang.String getNextPageToken(); + + /** + * + * + *
        +   * A token to retrieve next page of results.
        +   * Pass this value in ListRoomsRequest.page_token field in the subsequent
        +   * call to `google.showcase.v1beta1.Messaging\ListRooms` method to retrieve
        +   * the next page of results.
        +   * 
        + * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + com.google.protobuf.ByteString getNextPageTokenBytes(); +} diff --git a/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListSessionsRequest.java b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListSessionsRequest.java new file mode 100644 index 0000000000..098eb7bdfa --- /dev/null +++ b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListSessionsRequest.java @@ -0,0 +1,731 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/testing.proto + +// Protobuf Java Version: 3.25.8 +package com.google.showcase.v1beta1; + +/** + * + * + *
        + * The request for the ListSessions method.
        + * 
        + * + * Protobuf type {@code google.showcase.v1beta1.ListSessionsRequest} + */ +public final class ListSessionsRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.ListSessionsRequest) + ListSessionsRequestOrBuilder { + private static final long serialVersionUID = 0L; + + // Use ListSessionsRequest.newBuilder() to construct. + private ListSessionsRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListSessionsRequest() { + pageToken_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListSessionsRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.TestingOuterClass + .internal_static_google_showcase_v1beta1_ListSessionsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.TestingOuterClass + .internal_static_google_showcase_v1beta1_ListSessionsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.ListSessionsRequest.class, + com.google.showcase.v1beta1.ListSessionsRequest.Builder.class); + } + + public static final int PAGE_SIZE_FIELD_NUMBER = 1; + private int pageSize_ = 0; + + /** + * + * + *
        +   * The maximum number of sessions to return per page.
        +   * 
        + * + * int32 page_size = 1; + * + * @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_ = ""; + + /** + * + * + *
        +   * The page token, for retrieving subsequent pages.
        +   * 
        + * + * string page_token = 2; + * + * @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; + } + } + + /** + * + * + *
        +   * The page token, for retrieving subsequent pages.
        +   * 
        + * + * string page_token = 2; + * + * @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.showcase.v1beta1.ListSessionsRequest)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.ListSessionsRequest other = + (com.google.showcase.v1beta1.ListSessionsRequest) 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.showcase.v1beta1.ListSessionsRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.ListSessionsRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.ListSessionsRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.ListSessionsRequest 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.showcase.v1beta1.ListSessionsRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.ListSessionsRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.ListSessionsRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.ListSessionsRequest 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.showcase.v1beta1.ListSessionsRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.ListSessionsRequest 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.showcase.v1beta1.ListSessionsRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.ListSessionsRequest 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.showcase.v1beta1.ListSessionsRequest 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 request for the ListSessions method.
        +   * 
        + * + * Protobuf type {@code google.showcase.v1beta1.ListSessionsRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.ListSessionsRequest) + com.google.showcase.v1beta1.ListSessionsRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.TestingOuterClass + .internal_static_google_showcase_v1beta1_ListSessionsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.TestingOuterClass + .internal_static_google_showcase_v1beta1_ListSessionsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.ListSessionsRequest.class, + com.google.showcase.v1beta1.ListSessionsRequest.Builder.class); + } + + // Construct using com.google.showcase.v1beta1.ListSessionsRequest.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.showcase.v1beta1.TestingOuterClass + .internal_static_google_showcase_v1beta1_ListSessionsRequest_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.ListSessionsRequest getDefaultInstanceForType() { + return com.google.showcase.v1beta1.ListSessionsRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.ListSessionsRequest build() { + com.google.showcase.v1beta1.ListSessionsRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.ListSessionsRequest buildPartial() { + com.google.showcase.v1beta1.ListSessionsRequest result = + new com.google.showcase.v1beta1.ListSessionsRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.showcase.v1beta1.ListSessionsRequest 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.showcase.v1beta1.ListSessionsRequest) { + return mergeFrom((com.google.showcase.v1beta1.ListSessionsRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.showcase.v1beta1.ListSessionsRequest other) { + if (other == com.google.showcase.v1beta1.ListSessionsRequest.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_; + + /** + * + * + *
        +     * The maximum number of sessions to return per page.
        +     * 
        + * + * int32 page_size = 1; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + + /** + * + * + *
        +     * The maximum number of sessions to return per page.
        +     * 
        + * + * int32 page_size = 1; + * + * @param value The pageSize to set. + * @return This builder for chaining. + */ + public Builder setPageSize(int value) { + + pageSize_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
        +     * The maximum number of sessions to return per page.
        +     * 
        + * + * int32 page_size = 1; + * + * @return This builder for chaining. + */ + public Builder clearPageSize() { + bitField0_ = (bitField0_ & ~0x00000001); + pageSize_ = 0; + onChanged(); + return this; + } + + private java.lang.Object pageToken_ = ""; + + /** + * + * + *
        +     * The page token, for retrieving subsequent pages.
        +     * 
        + * + * string page_token = 2; + * + * @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; + } + } + + /** + * + * + *
        +     * The page token, for retrieving subsequent pages.
        +     * 
        + * + * string page_token = 2; + * + * @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; + } + } + + /** + * + * + *
        +     * The page token, for retrieving subsequent pages.
        +     * 
        + * + * string page_token = 2; + * + * @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; + } + + /** + * + * + *
        +     * The page token, for retrieving subsequent pages.
        +     * 
        + * + * string page_token = 2; + * + * @return This builder for chaining. + */ + public Builder clearPageToken() { + pageToken_ = getDefaultInstance().getPageToken(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
        +     * The page token, for retrieving subsequent pages.
        +     * 
        + * + * string page_token = 2; + * + * @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.showcase.v1beta1.ListSessionsRequest) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.ListSessionsRequest) + private static final com.google.showcase.v1beta1.ListSessionsRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.ListSessionsRequest(); + } + + public static com.google.showcase.v1beta1.ListSessionsRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListSessionsRequest 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.showcase.v1beta1.ListSessionsRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListSessionsRequestOrBuilder.java b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListSessionsRequestOrBuilder.java new file mode 100644 index 0000000000..d114ead66a --- /dev/null +++ b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListSessionsRequestOrBuilder.java @@ -0,0 +1,65 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/testing.proto + +// Protobuf Java Version: 3.25.8 +package com.google.showcase.v1beta1; + +public interface ListSessionsRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.ListSessionsRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
        +   * The maximum number of sessions to return per page.
        +   * 
        + * + * int32 page_size = 1; + * + * @return The pageSize. + */ + int getPageSize(); + + /** + * + * + *
        +   * The page token, for retrieving subsequent pages.
        +   * 
        + * + * string page_token = 2; + * + * @return The pageToken. + */ + java.lang.String getPageToken(); + + /** + * + * + *
        +   * The page token, for retrieving subsequent pages.
        +   * 
        + * + * string page_token = 2; + * + * @return The bytes for pageToken. + */ + com.google.protobuf.ByteString getPageTokenBytes(); +} diff --git a/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListSessionsResponse.java b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListSessionsResponse.java new file mode 100644 index 0000000000..e946bee02b --- /dev/null +++ b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListSessionsResponse.java @@ -0,0 +1,1155 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/testing.proto + +// Protobuf Java Version: 3.25.8 +package com.google.showcase.v1beta1; + +/** + * + * + *
        + * Response for the ListSessions method.
        + * 
        + * + * Protobuf type {@code google.showcase.v1beta1.ListSessionsResponse} + */ +public final class ListSessionsResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.ListSessionsResponse) + ListSessionsResponseOrBuilder { + private static final long serialVersionUID = 0L; + + // Use ListSessionsResponse.newBuilder() to construct. + private ListSessionsResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListSessionsResponse() { + sessions_ = java.util.Collections.emptyList(); + nextPageToken_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListSessionsResponse(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.TestingOuterClass + .internal_static_google_showcase_v1beta1_ListSessionsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.TestingOuterClass + .internal_static_google_showcase_v1beta1_ListSessionsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.ListSessionsResponse.class, + com.google.showcase.v1beta1.ListSessionsResponse.Builder.class); + } + + public static final int SESSIONS_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private java.util.List sessions_; + + /** + * + * + *
        +   * The sessions being returned.
        +   * 
        + * + * repeated .google.showcase.v1beta1.Session sessions = 1; + */ + @java.lang.Override + public java.util.List getSessionsList() { + return sessions_; + } + + /** + * + * + *
        +   * The sessions being returned.
        +   * 
        + * + * repeated .google.showcase.v1beta1.Session sessions = 1; + */ + @java.lang.Override + public java.util.List + getSessionsOrBuilderList() { + return sessions_; + } + + /** + * + * + *
        +   * The sessions being returned.
        +   * 
        + * + * repeated .google.showcase.v1beta1.Session sessions = 1; + */ + @java.lang.Override + public int getSessionsCount() { + return sessions_.size(); + } + + /** + * + * + *
        +   * The sessions being returned.
        +   * 
        + * + * repeated .google.showcase.v1beta1.Session sessions = 1; + */ + @java.lang.Override + public com.google.showcase.v1beta1.Session getSessions(int index) { + return sessions_.get(index); + } + + /** + * + * + *
        +   * The sessions being returned.
        +   * 
        + * + * repeated .google.showcase.v1beta1.Session sessions = 1; + */ + @java.lang.Override + public com.google.showcase.v1beta1.SessionOrBuilder getSessionsOrBuilder(int index) { + return sessions_.get(index); + } + + public static final int NEXT_PAGE_TOKEN_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object nextPageToken_ = ""; + + /** + * + * + *
        +   * The next page token, if any.
        +   * An empty value here means the last page has been reached.
        +   * 
        + * + * 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; + } + } + + /** + * + * + *
        +   * The next page token, if any.
        +   * An empty value here means the last page has been reached.
        +   * 
        + * + * 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 < sessions_.size(); i++) { + output.writeMessage(1, sessions_.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 < sessions_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, sessions_.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.showcase.v1beta1.ListSessionsResponse)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.ListSessionsResponse other = + (com.google.showcase.v1beta1.ListSessionsResponse) obj; + + if (!getSessionsList().equals(other.getSessionsList())) 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 (getSessionsCount() > 0) { + hash = (37 * hash) + SESSIONS_FIELD_NUMBER; + hash = (53 * hash) + getSessionsList().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.showcase.v1beta1.ListSessionsResponse parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.ListSessionsResponse parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.ListSessionsResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.ListSessionsResponse 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.showcase.v1beta1.ListSessionsResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.ListSessionsResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.ListSessionsResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.ListSessionsResponse 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.showcase.v1beta1.ListSessionsResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.ListSessionsResponse 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.showcase.v1beta1.ListSessionsResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.ListSessionsResponse 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.showcase.v1beta1.ListSessionsResponse 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 for the ListSessions method.
        +   * 
        + * + * Protobuf type {@code google.showcase.v1beta1.ListSessionsResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.ListSessionsResponse) + com.google.showcase.v1beta1.ListSessionsResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.TestingOuterClass + .internal_static_google_showcase_v1beta1_ListSessionsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.TestingOuterClass + .internal_static_google_showcase_v1beta1_ListSessionsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.ListSessionsResponse.class, + com.google.showcase.v1beta1.ListSessionsResponse.Builder.class); + } + + // Construct using com.google.showcase.v1beta1.ListSessionsResponse.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (sessionsBuilder_ == null) { + sessions_ = java.util.Collections.emptyList(); + } else { + sessions_ = null; + sessionsBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + nextPageToken_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.showcase.v1beta1.TestingOuterClass + .internal_static_google_showcase_v1beta1_ListSessionsResponse_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.ListSessionsResponse getDefaultInstanceForType() { + return com.google.showcase.v1beta1.ListSessionsResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.ListSessionsResponse build() { + com.google.showcase.v1beta1.ListSessionsResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.ListSessionsResponse buildPartial() { + com.google.showcase.v1beta1.ListSessionsResponse result = + new com.google.showcase.v1beta1.ListSessionsResponse(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields( + com.google.showcase.v1beta1.ListSessionsResponse result) { + if (sessionsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + sessions_ = java.util.Collections.unmodifiableList(sessions_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.sessions_ = sessions_; + } else { + result.sessions_ = sessionsBuilder_.build(); + } + } + + private void buildPartial0(com.google.showcase.v1beta1.ListSessionsResponse 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.showcase.v1beta1.ListSessionsResponse) { + return mergeFrom((com.google.showcase.v1beta1.ListSessionsResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.showcase.v1beta1.ListSessionsResponse other) { + if (other == com.google.showcase.v1beta1.ListSessionsResponse.getDefaultInstance()) + return this; + if (sessionsBuilder_ == null) { + if (!other.sessions_.isEmpty()) { + if (sessions_.isEmpty()) { + sessions_ = other.sessions_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureSessionsIsMutable(); + sessions_.addAll(other.sessions_); + } + onChanged(); + } + } else { + if (!other.sessions_.isEmpty()) { + if (sessionsBuilder_.isEmpty()) { + sessionsBuilder_.dispose(); + sessionsBuilder_ = null; + sessions_ = other.sessions_; + bitField0_ = (bitField0_ & ~0x00000001); + sessionsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getSessionsFieldBuilder() + : null; + } else { + sessionsBuilder_.addAllMessages(other.sessions_); + } + } + } + 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.showcase.v1beta1.Session m = + input.readMessage( + com.google.showcase.v1beta1.Session.parser(), extensionRegistry); + if (sessionsBuilder_ == null) { + ensureSessionsIsMutable(); + sessions_.add(m); + } else { + sessionsBuilder_.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 sessions_ = + java.util.Collections.emptyList(); + + private void ensureSessionsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + sessions_ = new java.util.ArrayList(sessions_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.showcase.v1beta1.Session, + com.google.showcase.v1beta1.Session.Builder, + com.google.showcase.v1beta1.SessionOrBuilder> + sessionsBuilder_; + + /** + * + * + *
        +     * The sessions being returned.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Session sessions = 1; + */ + public java.util.List getSessionsList() { + if (sessionsBuilder_ == null) { + return java.util.Collections.unmodifiableList(sessions_); + } else { + return sessionsBuilder_.getMessageList(); + } + } + + /** + * + * + *
        +     * The sessions being returned.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Session sessions = 1; + */ + public int getSessionsCount() { + if (sessionsBuilder_ == null) { + return sessions_.size(); + } else { + return sessionsBuilder_.getCount(); + } + } + + /** + * + * + *
        +     * The sessions being returned.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Session sessions = 1; + */ + public com.google.showcase.v1beta1.Session getSessions(int index) { + if (sessionsBuilder_ == null) { + return sessions_.get(index); + } else { + return sessionsBuilder_.getMessage(index); + } + } + + /** + * + * + *
        +     * The sessions being returned.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Session sessions = 1; + */ + public Builder setSessions(int index, com.google.showcase.v1beta1.Session value) { + if (sessionsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureSessionsIsMutable(); + sessions_.set(index, value); + onChanged(); + } else { + sessionsBuilder_.setMessage(index, value); + } + return this; + } + + /** + * + * + *
        +     * The sessions being returned.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Session sessions = 1; + */ + public Builder setSessions( + int index, com.google.showcase.v1beta1.Session.Builder builderForValue) { + if (sessionsBuilder_ == null) { + ensureSessionsIsMutable(); + sessions_.set(index, builderForValue.build()); + onChanged(); + } else { + sessionsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
        +     * The sessions being returned.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Session sessions = 1; + */ + public Builder addSessions(com.google.showcase.v1beta1.Session value) { + if (sessionsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureSessionsIsMutable(); + sessions_.add(value); + onChanged(); + } else { + sessionsBuilder_.addMessage(value); + } + return this; + } + + /** + * + * + *
        +     * The sessions being returned.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Session sessions = 1; + */ + public Builder addSessions(int index, com.google.showcase.v1beta1.Session value) { + if (sessionsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureSessionsIsMutable(); + sessions_.add(index, value); + onChanged(); + } else { + sessionsBuilder_.addMessage(index, value); + } + return this; + } + + /** + * + * + *
        +     * The sessions being returned.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Session sessions = 1; + */ + public Builder addSessions(com.google.showcase.v1beta1.Session.Builder builderForValue) { + if (sessionsBuilder_ == null) { + ensureSessionsIsMutable(); + sessions_.add(builderForValue.build()); + onChanged(); + } else { + sessionsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + + /** + * + * + *
        +     * The sessions being returned.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Session sessions = 1; + */ + public Builder addSessions( + int index, com.google.showcase.v1beta1.Session.Builder builderForValue) { + if (sessionsBuilder_ == null) { + ensureSessionsIsMutable(); + sessions_.add(index, builderForValue.build()); + onChanged(); + } else { + sessionsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
        +     * The sessions being returned.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Session sessions = 1; + */ + public Builder addAllSessions( + java.lang.Iterable values) { + if (sessionsBuilder_ == null) { + ensureSessionsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, sessions_); + onChanged(); + } else { + sessionsBuilder_.addAllMessages(values); + } + return this; + } + + /** + * + * + *
        +     * The sessions being returned.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Session sessions = 1; + */ + public Builder clearSessions() { + if (sessionsBuilder_ == null) { + sessions_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + sessionsBuilder_.clear(); + } + return this; + } + + /** + * + * + *
        +     * The sessions being returned.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Session sessions = 1; + */ + public Builder removeSessions(int index) { + if (sessionsBuilder_ == null) { + ensureSessionsIsMutable(); + sessions_.remove(index); + onChanged(); + } else { + sessionsBuilder_.remove(index); + } + return this; + } + + /** + * + * + *
        +     * The sessions being returned.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Session sessions = 1; + */ + public com.google.showcase.v1beta1.Session.Builder getSessionsBuilder(int index) { + return getSessionsFieldBuilder().getBuilder(index); + } + + /** + * + * + *
        +     * The sessions being returned.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Session sessions = 1; + */ + public com.google.showcase.v1beta1.SessionOrBuilder getSessionsOrBuilder(int index) { + if (sessionsBuilder_ == null) { + return sessions_.get(index); + } else { + return sessionsBuilder_.getMessageOrBuilder(index); + } + } + + /** + * + * + *
        +     * The sessions being returned.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Session sessions = 1; + */ + public java.util.List + getSessionsOrBuilderList() { + if (sessionsBuilder_ != null) { + return sessionsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(sessions_); + } + } + + /** + * + * + *
        +     * The sessions being returned.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Session sessions = 1; + */ + public com.google.showcase.v1beta1.Session.Builder addSessionsBuilder() { + return getSessionsFieldBuilder() + .addBuilder(com.google.showcase.v1beta1.Session.getDefaultInstance()); + } + + /** + * + * + *
        +     * The sessions being returned.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Session sessions = 1; + */ + public com.google.showcase.v1beta1.Session.Builder addSessionsBuilder(int index) { + return getSessionsFieldBuilder() + .addBuilder(index, com.google.showcase.v1beta1.Session.getDefaultInstance()); + } + + /** + * + * + *
        +     * The sessions being returned.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Session sessions = 1; + */ + public java.util.List getSessionsBuilderList() { + return getSessionsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.showcase.v1beta1.Session, + com.google.showcase.v1beta1.Session.Builder, + com.google.showcase.v1beta1.SessionOrBuilder> + getSessionsFieldBuilder() { + if (sessionsBuilder_ == null) { + sessionsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.showcase.v1beta1.Session, + com.google.showcase.v1beta1.Session.Builder, + com.google.showcase.v1beta1.SessionOrBuilder>( + sessions_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + sessions_ = null; + } + return sessionsBuilder_; + } + + private java.lang.Object nextPageToken_ = ""; + + /** + * + * + *
        +     * The next page token, if any.
        +     * An empty value here means the last page has been reached.
        +     * 
        + * + * 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; + } + } + + /** + * + * + *
        +     * The next page token, if any.
        +     * An empty value here means the last page has been reached.
        +     * 
        + * + * 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; + } + } + + /** + * + * + *
        +     * The next page token, if any.
        +     * An empty value here means the last page has been reached.
        +     * 
        + * + * 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; + } + + /** + * + * + *
        +     * The next page token, if any.
        +     * An empty value here means the last page has been reached.
        +     * 
        + * + * string next_page_token = 2; + * + * @return This builder for chaining. + */ + public Builder clearNextPageToken() { + nextPageToken_ = getDefaultInstance().getNextPageToken(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
        +     * The next page token, if any.
        +     * An empty value here means the last page has been reached.
        +     * 
        + * + * 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.showcase.v1beta1.ListSessionsResponse) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.ListSessionsResponse) + private static final com.google.showcase.v1beta1.ListSessionsResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.ListSessionsResponse(); + } + + public static com.google.showcase.v1beta1.ListSessionsResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListSessionsResponse 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.showcase.v1beta1.ListSessionsResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListSessionsResponseOrBuilder.java b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListSessionsResponseOrBuilder.java new file mode 100644 index 0000000000..ade0075795 --- /dev/null +++ b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListSessionsResponseOrBuilder.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: schema/google/showcase/v1beta1/testing.proto + +// Protobuf Java Version: 3.25.8 +package com.google.showcase.v1beta1; + +public interface ListSessionsResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.ListSessionsResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
        +   * The sessions being returned.
        +   * 
        + * + * repeated .google.showcase.v1beta1.Session sessions = 1; + */ + java.util.List getSessionsList(); + + /** + * + * + *
        +   * The sessions being returned.
        +   * 
        + * + * repeated .google.showcase.v1beta1.Session sessions = 1; + */ + com.google.showcase.v1beta1.Session getSessions(int index); + + /** + * + * + *
        +   * The sessions being returned.
        +   * 
        + * + * repeated .google.showcase.v1beta1.Session sessions = 1; + */ + int getSessionsCount(); + + /** + * + * + *
        +   * The sessions being returned.
        +   * 
        + * + * repeated .google.showcase.v1beta1.Session sessions = 1; + */ + java.util.List getSessionsOrBuilderList(); + + /** + * + * + *
        +   * The sessions being returned.
        +   * 
        + * + * repeated .google.showcase.v1beta1.Session sessions = 1; + */ + com.google.showcase.v1beta1.SessionOrBuilder getSessionsOrBuilder(int index); + + /** + * + * + *
        +   * The next page token, if any.
        +   * An empty value here means the last page has been reached.
        +   * 
        + * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + java.lang.String getNextPageToken(); + + /** + * + * + *
        +   * The next page token, if any.
        +   * An empty value here means the last page has been reached.
        +   * 
        + * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + com.google.protobuf.ByteString getNextPageTokenBytes(); +} diff --git a/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListTestsRequest.java b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListTestsRequest.java new file mode 100644 index 0000000000..172ae39f15 --- /dev/null +++ b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListTestsRequest.java @@ -0,0 +1,919 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/testing.proto + +// Protobuf Java Version: 3.25.8 +package com.google.showcase.v1beta1; + +/** + * + * + *
        + * The request for the ListTests method.
        + * 
        + * + * Protobuf type {@code google.showcase.v1beta1.ListTestsRequest} + */ +public final class ListTestsRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.ListTestsRequest) + ListTestsRequestOrBuilder { + private static final long serialVersionUID = 0L; + + // Use ListTestsRequest.newBuilder() to construct. + private ListTestsRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListTestsRequest() { + parent_ = ""; + pageToken_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListTestsRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.TestingOuterClass + .internal_static_google_showcase_v1beta1_ListTestsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.TestingOuterClass + .internal_static_google_showcase_v1beta1_ListTestsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.ListTestsRequest.class, + com.google.showcase.v1beta1.ListTestsRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object parent_ = ""; + + /** + * + * + *
        +   * The session.
        +   * 
        + * + * string parent = 1 [(.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; + } + } + + /** + * + * + *
        +   * The session.
        +   * 
        + * + * string parent = 1 [(.google.api.resource_reference) = { ... } + * + * @return The bytes for parent. + */ + @java.lang.Override + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PAGE_SIZE_FIELD_NUMBER = 2; + private int pageSize_ = 0; + + /** + * + * + *
        +   * The maximum number of tests to return per page.
        +   * 
        + * + * int32 page_size = 2; + * + * @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_ = ""; + + /** + * + * + *
        +   * The page token, for retrieving subsequent pages.
        +   * 
        + * + * string page_token = 3; + * + * @return The pageToken. + */ + @java.lang.Override + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; + } + } + + /** + * + * + *
        +   * The page token, for retrieving subsequent pages.
        +   * 
        + * + * string page_token = 3; + * + * @return The bytes for pageToken. + */ + @java.lang.Override + public com.google.protobuf.ByteString getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!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_); + } + 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_); + } + 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.showcase.v1beta1.ListTestsRequest)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.ListTestsRequest other = + (com.google.showcase.v1beta1.ListTestsRequest) obj; + + if (!getParent().equals(other.getParent())) 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(); + 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.showcase.v1beta1.ListTestsRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.ListTestsRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.ListTestsRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.ListTestsRequest 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.showcase.v1beta1.ListTestsRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.ListTestsRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.ListTestsRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.ListTestsRequest 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.showcase.v1beta1.ListTestsRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.ListTestsRequest 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.showcase.v1beta1.ListTestsRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.ListTestsRequest 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.showcase.v1beta1.ListTestsRequest 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 request for the ListTests method.
        +   * 
        + * + * Protobuf type {@code google.showcase.v1beta1.ListTestsRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.ListTestsRequest) + com.google.showcase.v1beta1.ListTestsRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.TestingOuterClass + .internal_static_google_showcase_v1beta1_ListTestsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.TestingOuterClass + .internal_static_google_showcase_v1beta1_ListTestsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.ListTestsRequest.class, + com.google.showcase.v1beta1.ListTestsRequest.Builder.class); + } + + // Construct using com.google.showcase.v1beta1.ListTestsRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + parent_ = ""; + pageSize_ = 0; + pageToken_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.showcase.v1beta1.TestingOuterClass + .internal_static_google_showcase_v1beta1_ListTestsRequest_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.ListTestsRequest getDefaultInstanceForType() { + return com.google.showcase.v1beta1.ListTestsRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.ListTestsRequest build() { + com.google.showcase.v1beta1.ListTestsRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.ListTestsRequest buildPartial() { + com.google.showcase.v1beta1.ListTestsRequest result = + new com.google.showcase.v1beta1.ListTestsRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.showcase.v1beta1.ListTestsRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.parent_ = parent_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.pageSize_ = pageSize_; + } + if (((from_bitField0_ & 0x00000004) != 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.showcase.v1beta1.ListTestsRequest) { + return mergeFrom((com.google.showcase.v1beta1.ListTestsRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.showcase.v1beta1.ListTestsRequest other) { + if (other == com.google.showcase.v1beta1.ListTestsRequest.getDefaultInstance()) return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.getPageSize() != 0) { + setPageSize(other.getPageSize()); + } + if (!other.getPageToken().isEmpty()) { + pageToken_ = other.pageToken_; + 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 16: + { + pageSize_ = input.readInt32(); + bitField0_ |= 0x00000002; + break; + } // case 16 + case 26: + { + pageToken_ = 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_ = ""; + + /** + * + * + *
        +     * The session.
        +     * 
        + * + * string parent = 1 [(.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; + } + } + + /** + * + * + *
        +     * The session.
        +     * 
        + * + * string parent = 1 [(.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; + } + } + + /** + * + * + *
        +     * The session.
        +     * 
        + * + * string parent = 1 [(.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; + } + + /** + * + * + *
        +     * The session.
        +     * 
        + * + * string parent = 1 [(.google.api.resource_reference) = { ... } + * + * @return This builder for chaining. + */ + public Builder clearParent() { + parent_ = getDefaultInstance().getParent(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
        +     * The session.
        +     * 
        + * + * string parent = 1 [(.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 int pageSize_; + + /** + * + * + *
        +     * The maximum number of tests to return per page.
        +     * 
        + * + * int32 page_size = 2; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + + /** + * + * + *
        +     * The maximum number of tests to return per page.
        +     * 
        + * + * int32 page_size = 2; + * + * @param value The pageSize to set. + * @return This builder for chaining. + */ + public Builder setPageSize(int value) { + + pageSize_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
        +     * The maximum number of tests to return per page.
        +     * 
        + * + * int32 page_size = 2; + * + * @return This builder for chaining. + */ + public Builder clearPageSize() { + bitField0_ = (bitField0_ & ~0x00000002); + pageSize_ = 0; + onChanged(); + return this; + } + + private java.lang.Object pageToken_ = ""; + + /** + * + * + *
        +     * The page token, for retrieving subsequent pages.
        +     * 
        + * + * string page_token = 3; + * + * @return The pageToken. + */ + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
        +     * The page token, for retrieving subsequent pages.
        +     * 
        + * + * string page_token = 3; + * + * @return The bytes for pageToken. + */ + public com.google.protobuf.ByteString getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
        +     * The page token, for retrieving subsequent pages.
        +     * 
        + * + * string page_token = 3; + * + * @param value The pageToken to set. + * @return This builder for chaining. + */ + public Builder setPageToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + pageToken_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
        +     * The page token, for retrieving subsequent pages.
        +     * 
        + * + * string page_token = 3; + * + * @return This builder for chaining. + */ + public Builder clearPageToken() { + pageToken_ = getDefaultInstance().getPageToken(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + + /** + * + * + *
        +     * The page token, for retrieving subsequent pages.
        +     * 
        + * + * string page_token = 3; + * + * @param value The bytes for pageToken to set. + * @return This builder for chaining. + */ + public Builder setPageTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + pageToken_ = value; + 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.showcase.v1beta1.ListTestsRequest) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.ListTestsRequest) + private static final com.google.showcase.v1beta1.ListTestsRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.ListTestsRequest(); + } + + public static com.google.showcase.v1beta1.ListTestsRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListTestsRequest 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.showcase.v1beta1.ListTestsRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListTestsRequestOrBuilder.java b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListTestsRequestOrBuilder.java new file mode 100644 index 0000000000..aa2b97a854 --- /dev/null +++ b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListTestsRequestOrBuilder.java @@ -0,0 +1,91 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/testing.proto + +// Protobuf Java Version: 3.25.8 +package com.google.showcase.v1beta1; + +public interface ListTestsRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.ListTestsRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
        +   * The session.
        +   * 
        + * + * string parent = 1 [(.google.api.resource_reference) = { ... } + * + * @return The parent. + */ + java.lang.String getParent(); + + /** + * + * + *
        +   * The session.
        +   * 
        + * + * string parent = 1 [(.google.api.resource_reference) = { ... } + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
        +   * The maximum number of tests to return per page.
        +   * 
        + * + * int32 page_size = 2; + * + * @return The pageSize. + */ + int getPageSize(); + + /** + * + * + *
        +   * The page token, for retrieving subsequent pages.
        +   * 
        + * + * string page_token = 3; + * + * @return The pageToken. + */ + java.lang.String getPageToken(); + + /** + * + * + *
        +   * The page token, for retrieving subsequent pages.
        +   * 
        + * + * string page_token = 3; + * + * @return The bytes for pageToken. + */ + com.google.protobuf.ByteString getPageTokenBytes(); +} diff --git a/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListTestsResponse.java b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListTestsResponse.java new file mode 100644 index 0000000000..93807bd61b --- /dev/null +++ b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListTestsResponse.java @@ -0,0 +1,1150 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/testing.proto + +// Protobuf Java Version: 3.25.8 +package com.google.showcase.v1beta1; + +/** + * + * + *
        + * The response for the ListTests method.
        + * 
        + * + * Protobuf type {@code google.showcase.v1beta1.ListTestsResponse} + */ +public final class ListTestsResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.ListTestsResponse) + ListTestsResponseOrBuilder { + private static final long serialVersionUID = 0L; + + // Use ListTestsResponse.newBuilder() to construct. + private ListTestsResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListTestsResponse() { + tests_ = java.util.Collections.emptyList(); + nextPageToken_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListTestsResponse(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.TestingOuterClass + .internal_static_google_showcase_v1beta1_ListTestsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.TestingOuterClass + .internal_static_google_showcase_v1beta1_ListTestsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.ListTestsResponse.class, + com.google.showcase.v1beta1.ListTestsResponse.Builder.class); + } + + public static final int TESTS_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private java.util.List tests_; + + /** + * + * + *
        +   * The tests being returned.
        +   * 
        + * + * repeated .google.showcase.v1beta1.Test tests = 1; + */ + @java.lang.Override + public java.util.List getTestsList() { + return tests_; + } + + /** + * + * + *
        +   * The tests being returned.
        +   * 
        + * + * repeated .google.showcase.v1beta1.Test tests = 1; + */ + @java.lang.Override + public java.util.List + getTestsOrBuilderList() { + return tests_; + } + + /** + * + * + *
        +   * The tests being returned.
        +   * 
        + * + * repeated .google.showcase.v1beta1.Test tests = 1; + */ + @java.lang.Override + public int getTestsCount() { + return tests_.size(); + } + + /** + * + * + *
        +   * The tests being returned.
        +   * 
        + * + * repeated .google.showcase.v1beta1.Test tests = 1; + */ + @java.lang.Override + public com.google.showcase.v1beta1.Test getTests(int index) { + return tests_.get(index); + } + + /** + * + * + *
        +   * The tests being returned.
        +   * 
        + * + * repeated .google.showcase.v1beta1.Test tests = 1; + */ + @java.lang.Override + public com.google.showcase.v1beta1.TestOrBuilder getTestsOrBuilder(int index) { + return tests_.get(index); + } + + public static final int NEXT_PAGE_TOKEN_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object nextPageToken_ = ""; + + /** + * + * + *
        +   * The next page token, if any.
        +   * An empty value here means the last page has been reached.
        +   * 
        + * + * 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; + } + } + + /** + * + * + *
        +   * The next page token, if any.
        +   * An empty value here means the last page has been reached.
        +   * 
        + * + * 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 < tests_.size(); i++) { + output.writeMessage(1, tests_.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 < tests_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, tests_.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.showcase.v1beta1.ListTestsResponse)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.ListTestsResponse other = + (com.google.showcase.v1beta1.ListTestsResponse) obj; + + if (!getTestsList().equals(other.getTestsList())) 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 (getTestsCount() > 0) { + hash = (37 * hash) + TESTS_FIELD_NUMBER; + hash = (53 * hash) + getTestsList().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.showcase.v1beta1.ListTestsResponse parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.ListTestsResponse parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.ListTestsResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.ListTestsResponse 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.showcase.v1beta1.ListTestsResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.ListTestsResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.ListTestsResponse parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.ListTestsResponse 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.showcase.v1beta1.ListTestsResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.ListTestsResponse 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.showcase.v1beta1.ListTestsResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.ListTestsResponse 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.showcase.v1beta1.ListTestsResponse 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 for the ListTests method.
        +   * 
        + * + * Protobuf type {@code google.showcase.v1beta1.ListTestsResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.ListTestsResponse) + com.google.showcase.v1beta1.ListTestsResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.TestingOuterClass + .internal_static_google_showcase_v1beta1_ListTestsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.TestingOuterClass + .internal_static_google_showcase_v1beta1_ListTestsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.ListTestsResponse.class, + com.google.showcase.v1beta1.ListTestsResponse.Builder.class); + } + + // Construct using com.google.showcase.v1beta1.ListTestsResponse.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (testsBuilder_ == null) { + tests_ = java.util.Collections.emptyList(); + } else { + tests_ = null; + testsBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + nextPageToken_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.showcase.v1beta1.TestingOuterClass + .internal_static_google_showcase_v1beta1_ListTestsResponse_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.ListTestsResponse getDefaultInstanceForType() { + return com.google.showcase.v1beta1.ListTestsResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.ListTestsResponse build() { + com.google.showcase.v1beta1.ListTestsResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.ListTestsResponse buildPartial() { + com.google.showcase.v1beta1.ListTestsResponse result = + new com.google.showcase.v1beta1.ListTestsResponse(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields(com.google.showcase.v1beta1.ListTestsResponse result) { + if (testsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + tests_ = java.util.Collections.unmodifiableList(tests_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.tests_ = tests_; + } else { + result.tests_ = testsBuilder_.build(); + } + } + + private void buildPartial0(com.google.showcase.v1beta1.ListTestsResponse 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.showcase.v1beta1.ListTestsResponse) { + return mergeFrom((com.google.showcase.v1beta1.ListTestsResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.showcase.v1beta1.ListTestsResponse other) { + if (other == com.google.showcase.v1beta1.ListTestsResponse.getDefaultInstance()) return this; + if (testsBuilder_ == null) { + if (!other.tests_.isEmpty()) { + if (tests_.isEmpty()) { + tests_ = other.tests_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureTestsIsMutable(); + tests_.addAll(other.tests_); + } + onChanged(); + } + } else { + if (!other.tests_.isEmpty()) { + if (testsBuilder_.isEmpty()) { + testsBuilder_.dispose(); + testsBuilder_ = null; + tests_ = other.tests_; + bitField0_ = (bitField0_ & ~0x00000001); + testsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getTestsFieldBuilder() + : null; + } else { + testsBuilder_.addAllMessages(other.tests_); + } + } + } + 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.showcase.v1beta1.Test m = + input.readMessage(com.google.showcase.v1beta1.Test.parser(), extensionRegistry); + if (testsBuilder_ == null) { + ensureTestsIsMutable(); + tests_.add(m); + } else { + testsBuilder_.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 tests_ = + java.util.Collections.emptyList(); + + private void ensureTestsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + tests_ = new java.util.ArrayList(tests_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.showcase.v1beta1.Test, + com.google.showcase.v1beta1.Test.Builder, + com.google.showcase.v1beta1.TestOrBuilder> + testsBuilder_; + + /** + * + * + *
        +     * The tests being returned.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Test tests = 1; + */ + public java.util.List getTestsList() { + if (testsBuilder_ == null) { + return java.util.Collections.unmodifiableList(tests_); + } else { + return testsBuilder_.getMessageList(); + } + } + + /** + * + * + *
        +     * The tests being returned.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Test tests = 1; + */ + public int getTestsCount() { + if (testsBuilder_ == null) { + return tests_.size(); + } else { + return testsBuilder_.getCount(); + } + } + + /** + * + * + *
        +     * The tests being returned.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Test tests = 1; + */ + public com.google.showcase.v1beta1.Test getTests(int index) { + if (testsBuilder_ == null) { + return tests_.get(index); + } else { + return testsBuilder_.getMessage(index); + } + } + + /** + * + * + *
        +     * The tests being returned.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Test tests = 1; + */ + public Builder setTests(int index, com.google.showcase.v1beta1.Test value) { + if (testsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureTestsIsMutable(); + tests_.set(index, value); + onChanged(); + } else { + testsBuilder_.setMessage(index, value); + } + return this; + } + + /** + * + * + *
        +     * The tests being returned.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Test tests = 1; + */ + public Builder setTests(int index, com.google.showcase.v1beta1.Test.Builder builderForValue) { + if (testsBuilder_ == null) { + ensureTestsIsMutable(); + tests_.set(index, builderForValue.build()); + onChanged(); + } else { + testsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
        +     * The tests being returned.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Test tests = 1; + */ + public Builder addTests(com.google.showcase.v1beta1.Test value) { + if (testsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureTestsIsMutable(); + tests_.add(value); + onChanged(); + } else { + testsBuilder_.addMessage(value); + } + return this; + } + + /** + * + * + *
        +     * The tests being returned.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Test tests = 1; + */ + public Builder addTests(int index, com.google.showcase.v1beta1.Test value) { + if (testsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureTestsIsMutable(); + tests_.add(index, value); + onChanged(); + } else { + testsBuilder_.addMessage(index, value); + } + return this; + } + + /** + * + * + *
        +     * The tests being returned.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Test tests = 1; + */ + public Builder addTests(com.google.showcase.v1beta1.Test.Builder builderForValue) { + if (testsBuilder_ == null) { + ensureTestsIsMutable(); + tests_.add(builderForValue.build()); + onChanged(); + } else { + testsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + + /** + * + * + *
        +     * The tests being returned.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Test tests = 1; + */ + public Builder addTests(int index, com.google.showcase.v1beta1.Test.Builder builderForValue) { + if (testsBuilder_ == null) { + ensureTestsIsMutable(); + tests_.add(index, builderForValue.build()); + onChanged(); + } else { + testsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
        +     * The tests being returned.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Test tests = 1; + */ + public Builder addAllTests( + java.lang.Iterable values) { + if (testsBuilder_ == null) { + ensureTestsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, tests_); + onChanged(); + } else { + testsBuilder_.addAllMessages(values); + } + return this; + } + + /** + * + * + *
        +     * The tests being returned.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Test tests = 1; + */ + public Builder clearTests() { + if (testsBuilder_ == null) { + tests_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + testsBuilder_.clear(); + } + return this; + } + + /** + * + * + *
        +     * The tests being returned.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Test tests = 1; + */ + public Builder removeTests(int index) { + if (testsBuilder_ == null) { + ensureTestsIsMutable(); + tests_.remove(index); + onChanged(); + } else { + testsBuilder_.remove(index); + } + return this; + } + + /** + * + * + *
        +     * The tests being returned.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Test tests = 1; + */ + public com.google.showcase.v1beta1.Test.Builder getTestsBuilder(int index) { + return getTestsFieldBuilder().getBuilder(index); + } + + /** + * + * + *
        +     * The tests being returned.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Test tests = 1; + */ + public com.google.showcase.v1beta1.TestOrBuilder getTestsOrBuilder(int index) { + if (testsBuilder_ == null) { + return tests_.get(index); + } else { + return testsBuilder_.getMessageOrBuilder(index); + } + } + + /** + * + * + *
        +     * The tests being returned.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Test tests = 1; + */ + public java.util.List + getTestsOrBuilderList() { + if (testsBuilder_ != null) { + return testsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(tests_); + } + } + + /** + * + * + *
        +     * The tests being returned.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Test tests = 1; + */ + public com.google.showcase.v1beta1.Test.Builder addTestsBuilder() { + return getTestsFieldBuilder() + .addBuilder(com.google.showcase.v1beta1.Test.getDefaultInstance()); + } + + /** + * + * + *
        +     * The tests being returned.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Test tests = 1; + */ + public com.google.showcase.v1beta1.Test.Builder addTestsBuilder(int index) { + return getTestsFieldBuilder() + .addBuilder(index, com.google.showcase.v1beta1.Test.getDefaultInstance()); + } + + /** + * + * + *
        +     * The tests being returned.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Test tests = 1; + */ + public java.util.List getTestsBuilderList() { + return getTestsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.showcase.v1beta1.Test, + com.google.showcase.v1beta1.Test.Builder, + com.google.showcase.v1beta1.TestOrBuilder> + getTestsFieldBuilder() { + if (testsBuilder_ == null) { + testsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.showcase.v1beta1.Test, + com.google.showcase.v1beta1.Test.Builder, + com.google.showcase.v1beta1.TestOrBuilder>( + tests_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + tests_ = null; + } + return testsBuilder_; + } + + private java.lang.Object nextPageToken_ = ""; + + /** + * + * + *
        +     * The next page token, if any.
        +     * An empty value here means the last page has been reached.
        +     * 
        + * + * 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; + } + } + + /** + * + * + *
        +     * The next page token, if any.
        +     * An empty value here means the last page has been reached.
        +     * 
        + * + * 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; + } + } + + /** + * + * + *
        +     * The next page token, if any.
        +     * An empty value here means the last page has been reached.
        +     * 
        + * + * 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; + } + + /** + * + * + *
        +     * The next page token, if any.
        +     * An empty value here means the last page has been reached.
        +     * 
        + * + * string next_page_token = 2; + * + * @return This builder for chaining. + */ + public Builder clearNextPageToken() { + nextPageToken_ = getDefaultInstance().getNextPageToken(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
        +     * The next page token, if any.
        +     * An empty value here means the last page has been reached.
        +     * 
        + * + * 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.showcase.v1beta1.ListTestsResponse) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.ListTestsResponse) + private static final com.google.showcase.v1beta1.ListTestsResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.ListTestsResponse(); + } + + public static com.google.showcase.v1beta1.ListTestsResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListTestsResponse 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.showcase.v1beta1.ListTestsResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListTestsResponseOrBuilder.java b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListTestsResponseOrBuilder.java new file mode 100644 index 0000000000..e9154035ac --- /dev/null +++ b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListTestsResponseOrBuilder.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: schema/google/showcase/v1beta1/testing.proto + +// Protobuf Java Version: 3.25.8 +package com.google.showcase.v1beta1; + +public interface ListTestsResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.ListTestsResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
        +   * The tests being returned.
        +   * 
        + * + * repeated .google.showcase.v1beta1.Test tests = 1; + */ + java.util.List getTestsList(); + + /** + * + * + *
        +   * The tests being returned.
        +   * 
        + * + * repeated .google.showcase.v1beta1.Test tests = 1; + */ + com.google.showcase.v1beta1.Test getTests(int index); + + /** + * + * + *
        +   * The tests being returned.
        +   * 
        + * + * repeated .google.showcase.v1beta1.Test tests = 1; + */ + int getTestsCount(); + + /** + * + * + *
        +   * The tests being returned.
        +   * 
        + * + * repeated .google.showcase.v1beta1.Test tests = 1; + */ + java.util.List getTestsOrBuilderList(); + + /** + * + * + *
        +   * The tests being returned.
        +   * 
        + * + * repeated .google.showcase.v1beta1.Test tests = 1; + */ + com.google.showcase.v1beta1.TestOrBuilder getTestsOrBuilder(int index); + + /** + * + * + *
        +   * The next page token, if any.
        +   * An empty value here means the last page has been reached.
        +   * 
        + * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + java.lang.String getNextPageToken(); + + /** + * + * + *
        +   * The next page token, if any.
        +   * An empty value here means the last page has been reached.
        +   * 
        + * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + com.google.protobuf.ByteString getNextPageTokenBytes(); +} diff --git a/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListUsersRequest.java b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListUsersRequest.java new file mode 100644 index 0000000000..fac31b4e41 --- /dev/null +++ b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListUsersRequest.java @@ -0,0 +1,750 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/identity.proto + +// Protobuf Java Version: 3.25.8 +package com.google.showcase.v1beta1; + +/** + * + * + *
        + * The request message for the google.showcase.v1beta1.Identity\ListUsers
        + * method.
        + * 
        + * + * Protobuf type {@code google.showcase.v1beta1.ListUsersRequest} + */ +public final class ListUsersRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.ListUsersRequest) + ListUsersRequestOrBuilder { + private static final long serialVersionUID = 0L; + + // Use ListUsersRequest.newBuilder() to construct. + private ListUsersRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListUsersRequest() { + pageToken_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListUsersRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.IdentityOuterClass + .internal_static_google_showcase_v1beta1_ListUsersRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.IdentityOuterClass + .internal_static_google_showcase_v1beta1_ListUsersRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.ListUsersRequest.class, + com.google.showcase.v1beta1.ListUsersRequest.Builder.class); + } + + public static final int PAGE_SIZE_FIELD_NUMBER = 1; + private int pageSize_ = 0; + + /** + * + * + *
        +   * The maximum number of users to return. Server may return fewer users
        +   * than requested. If unspecified, server will pick an appropriate default.
        +   * 
        + * + * int32 page_size = 1; + * + * @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_ = ""; + + /** + * + * + *
        +   * The value of google.showcase.v1beta1.ListUsersResponse.next_page_token
        +   * returned from the previous call to
        +   * `google.showcase.v1beta1.Identity\ListUsers` method.
        +   * 
        + * + * string page_token = 2; + * + * @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; + } + } + + /** + * + * + *
        +   * The value of google.showcase.v1beta1.ListUsersResponse.next_page_token
        +   * returned from the previous call to
        +   * `google.showcase.v1beta1.Identity\ListUsers` method.
        +   * 
        + * + * string page_token = 2; + * + * @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.showcase.v1beta1.ListUsersRequest)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.ListUsersRequest other = + (com.google.showcase.v1beta1.ListUsersRequest) 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.showcase.v1beta1.ListUsersRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.ListUsersRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.ListUsersRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.ListUsersRequest 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.showcase.v1beta1.ListUsersRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.ListUsersRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.ListUsersRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.ListUsersRequest 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.showcase.v1beta1.ListUsersRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.ListUsersRequest 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.showcase.v1beta1.ListUsersRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.ListUsersRequest 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.showcase.v1beta1.ListUsersRequest 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 request message for the google.showcase.v1beta1.Identity\ListUsers
        +   * method.
        +   * 
        + * + * Protobuf type {@code google.showcase.v1beta1.ListUsersRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.ListUsersRequest) + com.google.showcase.v1beta1.ListUsersRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.IdentityOuterClass + .internal_static_google_showcase_v1beta1_ListUsersRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.IdentityOuterClass + .internal_static_google_showcase_v1beta1_ListUsersRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.ListUsersRequest.class, + com.google.showcase.v1beta1.ListUsersRequest.Builder.class); + } + + // Construct using com.google.showcase.v1beta1.ListUsersRequest.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.showcase.v1beta1.IdentityOuterClass + .internal_static_google_showcase_v1beta1_ListUsersRequest_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.ListUsersRequest getDefaultInstanceForType() { + return com.google.showcase.v1beta1.ListUsersRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.ListUsersRequest build() { + com.google.showcase.v1beta1.ListUsersRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.ListUsersRequest buildPartial() { + com.google.showcase.v1beta1.ListUsersRequest result = + new com.google.showcase.v1beta1.ListUsersRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.showcase.v1beta1.ListUsersRequest 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.showcase.v1beta1.ListUsersRequest) { + return mergeFrom((com.google.showcase.v1beta1.ListUsersRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.showcase.v1beta1.ListUsersRequest other) { + if (other == com.google.showcase.v1beta1.ListUsersRequest.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_; + + /** + * + * + *
        +     * The maximum number of users to return. Server may return fewer users
        +     * than requested. If unspecified, server will pick an appropriate default.
        +     * 
        + * + * int32 page_size = 1; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + + /** + * + * + *
        +     * The maximum number of users to return. Server may return fewer users
        +     * than requested. If unspecified, server will pick an appropriate default.
        +     * 
        + * + * int32 page_size = 1; + * + * @param value The pageSize to set. + * @return This builder for chaining. + */ + public Builder setPageSize(int value) { + + pageSize_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
        +     * The maximum number of users to return. Server may return fewer users
        +     * than requested. If unspecified, server will pick an appropriate default.
        +     * 
        + * + * int32 page_size = 1; + * + * @return This builder for chaining. + */ + public Builder clearPageSize() { + bitField0_ = (bitField0_ & ~0x00000001); + pageSize_ = 0; + onChanged(); + return this; + } + + private java.lang.Object pageToken_ = ""; + + /** + * + * + *
        +     * The value of google.showcase.v1beta1.ListUsersResponse.next_page_token
        +     * returned from the previous call to
        +     * `google.showcase.v1beta1.Identity\ListUsers` method.
        +     * 
        + * + * string page_token = 2; + * + * @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; + } + } + + /** + * + * + *
        +     * The value of google.showcase.v1beta1.ListUsersResponse.next_page_token
        +     * returned from the previous call to
        +     * `google.showcase.v1beta1.Identity\ListUsers` method.
        +     * 
        + * + * string page_token = 2; + * + * @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; + } + } + + /** + * + * + *
        +     * The value of google.showcase.v1beta1.ListUsersResponse.next_page_token
        +     * returned from the previous call to
        +     * `google.showcase.v1beta1.Identity\ListUsers` method.
        +     * 
        + * + * string page_token = 2; + * + * @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; + } + + /** + * + * + *
        +     * The value of google.showcase.v1beta1.ListUsersResponse.next_page_token
        +     * returned from the previous call to
        +     * `google.showcase.v1beta1.Identity\ListUsers` method.
        +     * 
        + * + * string page_token = 2; + * + * @return This builder for chaining. + */ + public Builder clearPageToken() { + pageToken_ = getDefaultInstance().getPageToken(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
        +     * The value of google.showcase.v1beta1.ListUsersResponse.next_page_token
        +     * returned from the previous call to
        +     * `google.showcase.v1beta1.Identity\ListUsers` method.
        +     * 
        + * + * string page_token = 2; + * + * @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.showcase.v1beta1.ListUsersRequest) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.ListUsersRequest) + private static final com.google.showcase.v1beta1.ListUsersRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.ListUsersRequest(); + } + + public static com.google.showcase.v1beta1.ListUsersRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListUsersRequest 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.showcase.v1beta1.ListUsersRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListUsersRequestOrBuilder.java b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListUsersRequestOrBuilder.java new file mode 100644 index 0000000000..fe02965f96 --- /dev/null +++ b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListUsersRequestOrBuilder.java @@ -0,0 +1,70 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/identity.proto + +// Protobuf Java Version: 3.25.8 +package com.google.showcase.v1beta1; + +public interface ListUsersRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.ListUsersRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
        +   * The maximum number of users to return. Server may return fewer users
        +   * than requested. If unspecified, server will pick an appropriate default.
        +   * 
        + * + * int32 page_size = 1; + * + * @return The pageSize. + */ + int getPageSize(); + + /** + * + * + *
        +   * The value of google.showcase.v1beta1.ListUsersResponse.next_page_token
        +   * returned from the previous call to
        +   * `google.showcase.v1beta1.Identity\ListUsers` method.
        +   * 
        + * + * string page_token = 2; + * + * @return The pageToken. + */ + java.lang.String getPageToken(); + + /** + * + * + *
        +   * The value of google.showcase.v1beta1.ListUsersResponse.next_page_token
        +   * returned from the previous call to
        +   * `google.showcase.v1beta1.Identity\ListUsers` method.
        +   * 
        + * + * string page_token = 2; + * + * @return The bytes for pageToken. + */ + com.google.protobuf.ByteString getPageTokenBytes(); +} diff --git a/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListUsersResponse.java b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListUsersResponse.java new file mode 100644 index 0000000000..9301a6b454 --- /dev/null +++ b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListUsersResponse.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: schema/google/showcase/v1beta1/identity.proto + +// Protobuf Java Version: 3.25.8 +package com.google.showcase.v1beta1; + +/** + * + * + *
        + * The response message for the google.showcase.v1beta1.Identity\ListUsers
        + * method.
        + * 
        + * + * Protobuf type {@code google.showcase.v1beta1.ListUsersResponse} + */ +public final class ListUsersResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.ListUsersResponse) + ListUsersResponseOrBuilder { + private static final long serialVersionUID = 0L; + + // Use ListUsersResponse.newBuilder() to construct. + private ListUsersResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListUsersResponse() { + users_ = java.util.Collections.emptyList(); + nextPageToken_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListUsersResponse(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.IdentityOuterClass + .internal_static_google_showcase_v1beta1_ListUsersResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.IdentityOuterClass + .internal_static_google_showcase_v1beta1_ListUsersResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.ListUsersResponse.class, + com.google.showcase.v1beta1.ListUsersResponse.Builder.class); + } + + public static final int USERS_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private java.util.List users_; + + /** + * + * + *
        +   * The list of users.
        +   * 
        + * + * repeated .google.showcase.v1beta1.User users = 1; + */ + @java.lang.Override + public java.util.List getUsersList() { + return users_; + } + + /** + * + * + *
        +   * The list of users.
        +   * 
        + * + * repeated .google.showcase.v1beta1.User users = 1; + */ + @java.lang.Override + public java.util.List + getUsersOrBuilderList() { + return users_; + } + + /** + * + * + *
        +   * The list of users.
        +   * 
        + * + * repeated .google.showcase.v1beta1.User users = 1; + */ + @java.lang.Override + public int getUsersCount() { + return users_.size(); + } + + /** + * + * + *
        +   * The list of users.
        +   * 
        + * + * repeated .google.showcase.v1beta1.User users = 1; + */ + @java.lang.Override + public com.google.showcase.v1beta1.User getUsers(int index) { + return users_.get(index); + } + + /** + * + * + *
        +   * The list of users.
        +   * 
        + * + * repeated .google.showcase.v1beta1.User users = 1; + */ + @java.lang.Override + public com.google.showcase.v1beta1.UserOrBuilder getUsersOrBuilder(int index) { + return users_.get(index); + } + + public static final int NEXT_PAGE_TOKEN_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object nextPageToken_ = ""; + + /** + * + * + *
        +   * A token to retrieve next page of results.
        +   * Pass this value in ListUsersRequest.page_token field in the subsequent
        +   * call to `google.showcase.v1beta1.Message\ListUsers` method to retrieve the
        +   * next page of results.
        +   * 
        + * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + @java.lang.Override + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nextPageToken_ = s; + return s; + } + } + + /** + * + * + *
        +   * A token to retrieve next page of results.
        +   * Pass this value in ListUsersRequest.page_token field in the subsequent
        +   * call to `google.showcase.v1beta1.Message\ListUsers` method to retrieve the
        +   * next page of results.
        +   * 
        + * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + nextPageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + for (int i = 0; i < users_.size(); i++) { + output.writeMessage(1, users_.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 < users_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, users_.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.showcase.v1beta1.ListUsersResponse)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.ListUsersResponse other = + (com.google.showcase.v1beta1.ListUsersResponse) obj; + + if (!getUsersList().equals(other.getUsersList())) 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 (getUsersCount() > 0) { + hash = (37 * hash) + USERS_FIELD_NUMBER; + hash = (53 * hash) + getUsersList().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.showcase.v1beta1.ListUsersResponse parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.ListUsersResponse parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.ListUsersResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.ListUsersResponse 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.showcase.v1beta1.ListUsersResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.ListUsersResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.ListUsersResponse parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.ListUsersResponse 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.showcase.v1beta1.ListUsersResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.ListUsersResponse 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.showcase.v1beta1.ListUsersResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.ListUsersResponse 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.showcase.v1beta1.ListUsersResponse 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 message for the google.showcase.v1beta1.Identity\ListUsers
        +   * method.
        +   * 
        + * + * Protobuf type {@code google.showcase.v1beta1.ListUsersResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.ListUsersResponse) + com.google.showcase.v1beta1.ListUsersResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.IdentityOuterClass + .internal_static_google_showcase_v1beta1_ListUsersResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.IdentityOuterClass + .internal_static_google_showcase_v1beta1_ListUsersResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.ListUsersResponse.class, + com.google.showcase.v1beta1.ListUsersResponse.Builder.class); + } + + // Construct using com.google.showcase.v1beta1.ListUsersResponse.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (usersBuilder_ == null) { + users_ = java.util.Collections.emptyList(); + } else { + users_ = null; + usersBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + nextPageToken_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.showcase.v1beta1.IdentityOuterClass + .internal_static_google_showcase_v1beta1_ListUsersResponse_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.ListUsersResponse getDefaultInstanceForType() { + return com.google.showcase.v1beta1.ListUsersResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.ListUsersResponse build() { + com.google.showcase.v1beta1.ListUsersResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.ListUsersResponse buildPartial() { + com.google.showcase.v1beta1.ListUsersResponse result = + new com.google.showcase.v1beta1.ListUsersResponse(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields(com.google.showcase.v1beta1.ListUsersResponse result) { + if (usersBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + users_ = java.util.Collections.unmodifiableList(users_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.users_ = users_; + } else { + result.users_ = usersBuilder_.build(); + } + } + + private void buildPartial0(com.google.showcase.v1beta1.ListUsersResponse 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.showcase.v1beta1.ListUsersResponse) { + return mergeFrom((com.google.showcase.v1beta1.ListUsersResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.showcase.v1beta1.ListUsersResponse other) { + if (other == com.google.showcase.v1beta1.ListUsersResponse.getDefaultInstance()) return this; + if (usersBuilder_ == null) { + if (!other.users_.isEmpty()) { + if (users_.isEmpty()) { + users_ = other.users_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureUsersIsMutable(); + users_.addAll(other.users_); + } + onChanged(); + } + } else { + if (!other.users_.isEmpty()) { + if (usersBuilder_.isEmpty()) { + usersBuilder_.dispose(); + usersBuilder_ = null; + users_ = other.users_; + bitField0_ = (bitField0_ & ~0x00000001); + usersBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getUsersFieldBuilder() + : null; + } else { + usersBuilder_.addAllMessages(other.users_); + } + } + } + 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.showcase.v1beta1.User m = + input.readMessage(com.google.showcase.v1beta1.User.parser(), extensionRegistry); + if (usersBuilder_ == null) { + ensureUsersIsMutable(); + users_.add(m); + } else { + usersBuilder_.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 users_ = + java.util.Collections.emptyList(); + + private void ensureUsersIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + users_ = new java.util.ArrayList(users_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.showcase.v1beta1.User, + com.google.showcase.v1beta1.User.Builder, + com.google.showcase.v1beta1.UserOrBuilder> + usersBuilder_; + + /** + * + * + *
        +     * The list of users.
        +     * 
        + * + * repeated .google.showcase.v1beta1.User users = 1; + */ + public java.util.List getUsersList() { + if (usersBuilder_ == null) { + return java.util.Collections.unmodifiableList(users_); + } else { + return usersBuilder_.getMessageList(); + } + } + + /** + * + * + *
        +     * The list of users.
        +     * 
        + * + * repeated .google.showcase.v1beta1.User users = 1; + */ + public int getUsersCount() { + if (usersBuilder_ == null) { + return users_.size(); + } else { + return usersBuilder_.getCount(); + } + } + + /** + * + * + *
        +     * The list of users.
        +     * 
        + * + * repeated .google.showcase.v1beta1.User users = 1; + */ + public com.google.showcase.v1beta1.User getUsers(int index) { + if (usersBuilder_ == null) { + return users_.get(index); + } else { + return usersBuilder_.getMessage(index); + } + } + + /** + * + * + *
        +     * The list of users.
        +     * 
        + * + * repeated .google.showcase.v1beta1.User users = 1; + */ + public Builder setUsers(int index, com.google.showcase.v1beta1.User value) { + if (usersBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureUsersIsMutable(); + users_.set(index, value); + onChanged(); + } else { + usersBuilder_.setMessage(index, value); + } + return this; + } + + /** + * + * + *
        +     * The list of users.
        +     * 
        + * + * repeated .google.showcase.v1beta1.User users = 1; + */ + public Builder setUsers(int index, com.google.showcase.v1beta1.User.Builder builderForValue) { + if (usersBuilder_ == null) { + ensureUsersIsMutable(); + users_.set(index, builderForValue.build()); + onChanged(); + } else { + usersBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
        +     * The list of users.
        +     * 
        + * + * repeated .google.showcase.v1beta1.User users = 1; + */ + public Builder addUsers(com.google.showcase.v1beta1.User value) { + if (usersBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureUsersIsMutable(); + users_.add(value); + onChanged(); + } else { + usersBuilder_.addMessage(value); + } + return this; + } + + /** + * + * + *
        +     * The list of users.
        +     * 
        + * + * repeated .google.showcase.v1beta1.User users = 1; + */ + public Builder addUsers(int index, com.google.showcase.v1beta1.User value) { + if (usersBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureUsersIsMutable(); + users_.add(index, value); + onChanged(); + } else { + usersBuilder_.addMessage(index, value); + } + return this; + } + + /** + * + * + *
        +     * The list of users.
        +     * 
        + * + * repeated .google.showcase.v1beta1.User users = 1; + */ + public Builder addUsers(com.google.showcase.v1beta1.User.Builder builderForValue) { + if (usersBuilder_ == null) { + ensureUsersIsMutable(); + users_.add(builderForValue.build()); + onChanged(); + } else { + usersBuilder_.addMessage(builderForValue.build()); + } + return this; + } + + /** + * + * + *
        +     * The list of users.
        +     * 
        + * + * repeated .google.showcase.v1beta1.User users = 1; + */ + public Builder addUsers(int index, com.google.showcase.v1beta1.User.Builder builderForValue) { + if (usersBuilder_ == null) { + ensureUsersIsMutable(); + users_.add(index, builderForValue.build()); + onChanged(); + } else { + usersBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
        +     * The list of users.
        +     * 
        + * + * repeated .google.showcase.v1beta1.User users = 1; + */ + public Builder addAllUsers( + java.lang.Iterable values) { + if (usersBuilder_ == null) { + ensureUsersIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, users_); + onChanged(); + } else { + usersBuilder_.addAllMessages(values); + } + return this; + } + + /** + * + * + *
        +     * The list of users.
        +     * 
        + * + * repeated .google.showcase.v1beta1.User users = 1; + */ + public Builder clearUsers() { + if (usersBuilder_ == null) { + users_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + usersBuilder_.clear(); + } + return this; + } + + /** + * + * + *
        +     * The list of users.
        +     * 
        + * + * repeated .google.showcase.v1beta1.User users = 1; + */ + public Builder removeUsers(int index) { + if (usersBuilder_ == null) { + ensureUsersIsMutable(); + users_.remove(index); + onChanged(); + } else { + usersBuilder_.remove(index); + } + return this; + } + + /** + * + * + *
        +     * The list of users.
        +     * 
        + * + * repeated .google.showcase.v1beta1.User users = 1; + */ + public com.google.showcase.v1beta1.User.Builder getUsersBuilder(int index) { + return getUsersFieldBuilder().getBuilder(index); + } + + /** + * + * + *
        +     * The list of users.
        +     * 
        + * + * repeated .google.showcase.v1beta1.User users = 1; + */ + public com.google.showcase.v1beta1.UserOrBuilder getUsersOrBuilder(int index) { + if (usersBuilder_ == null) { + return users_.get(index); + } else { + return usersBuilder_.getMessageOrBuilder(index); + } + } + + /** + * + * + *
        +     * The list of users.
        +     * 
        + * + * repeated .google.showcase.v1beta1.User users = 1; + */ + public java.util.List + getUsersOrBuilderList() { + if (usersBuilder_ != null) { + return usersBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(users_); + } + } + + /** + * + * + *
        +     * The list of users.
        +     * 
        + * + * repeated .google.showcase.v1beta1.User users = 1; + */ + public com.google.showcase.v1beta1.User.Builder addUsersBuilder() { + return getUsersFieldBuilder() + .addBuilder(com.google.showcase.v1beta1.User.getDefaultInstance()); + } + + /** + * + * + *
        +     * The list of users.
        +     * 
        + * + * repeated .google.showcase.v1beta1.User users = 1; + */ + public com.google.showcase.v1beta1.User.Builder addUsersBuilder(int index) { + return getUsersFieldBuilder() + .addBuilder(index, com.google.showcase.v1beta1.User.getDefaultInstance()); + } + + /** + * + * + *
        +     * The list of users.
        +     * 
        + * + * repeated .google.showcase.v1beta1.User users = 1; + */ + public java.util.List getUsersBuilderList() { + return getUsersFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.showcase.v1beta1.User, + com.google.showcase.v1beta1.User.Builder, + com.google.showcase.v1beta1.UserOrBuilder> + getUsersFieldBuilder() { + if (usersBuilder_ == null) { + usersBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.showcase.v1beta1.User, + com.google.showcase.v1beta1.User.Builder, + com.google.showcase.v1beta1.UserOrBuilder>( + users_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + users_ = null; + } + return usersBuilder_; + } + + private java.lang.Object nextPageToken_ = ""; + + /** + * + * + *
        +     * A token to retrieve next page of results.
        +     * Pass this value in ListUsersRequest.page_token field in the subsequent
        +     * call to `google.showcase.v1beta1.Message\ListUsers` method to retrieve the
        +     * next page of results.
        +     * 
        + * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nextPageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
        +     * A token to retrieve next page of results.
        +     * Pass this value in ListUsersRequest.page_token field in the subsequent
        +     * call to `google.showcase.v1beta1.Message\ListUsers` method to retrieve the
        +     * next page of results.
        +     * 
        + * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + public com.google.protobuf.ByteString getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + nextPageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
        +     * A token to retrieve next page of results.
        +     * Pass this value in ListUsersRequest.page_token field in the subsequent
        +     * call to `google.showcase.v1beta1.Message\ListUsers` method to retrieve the
        +     * next page of results.
        +     * 
        + * + * string next_page_token = 2; + * + * @param value The nextPageToken to set. + * @return This builder for chaining. + */ + public Builder setNextPageToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + nextPageToken_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
        +     * A token to retrieve next page of results.
        +     * Pass this value in ListUsersRequest.page_token field in the subsequent
        +     * call to `google.showcase.v1beta1.Message\ListUsers` method to retrieve the
        +     * next page of results.
        +     * 
        + * + * string next_page_token = 2; + * + * @return This builder for chaining. + */ + public Builder clearNextPageToken() { + nextPageToken_ = getDefaultInstance().getNextPageToken(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
        +     * A token to retrieve next page of results.
        +     * Pass this value in ListUsersRequest.page_token field in the subsequent
        +     * call to `google.showcase.v1beta1.Message\ListUsers` method to retrieve the
        +     * next page of results.
        +     * 
        + * + * string next_page_token = 2; + * + * @param value The bytes for nextPageToken to set. + * @return This builder for chaining. + */ + public Builder setNextPageTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + nextPageToken_ = value; + 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.showcase.v1beta1.ListUsersResponse) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.ListUsersResponse) + private static final com.google.showcase.v1beta1.ListUsersResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.ListUsersResponse(); + } + + public static com.google.showcase.v1beta1.ListUsersResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListUsersResponse 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.showcase.v1beta1.ListUsersResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListUsersResponseOrBuilder.java b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListUsersResponseOrBuilder.java new file mode 100644 index 0000000000..fc6f4a98bb --- /dev/null +++ b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListUsersResponseOrBuilder.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: schema/google/showcase/v1beta1/identity.proto + +// Protobuf Java Version: 3.25.8 +package com.google.showcase.v1beta1; + +public interface ListUsersResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.ListUsersResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
        +   * The list of users.
        +   * 
        + * + * repeated .google.showcase.v1beta1.User users = 1; + */ + java.util.List getUsersList(); + + /** + * + * + *
        +   * The list of users.
        +   * 
        + * + * repeated .google.showcase.v1beta1.User users = 1; + */ + com.google.showcase.v1beta1.User getUsers(int index); + + /** + * + * + *
        +   * The list of users.
        +   * 
        + * + * repeated .google.showcase.v1beta1.User users = 1; + */ + int getUsersCount(); + + /** + * + * + *
        +   * The list of users.
        +   * 
        + * + * repeated .google.showcase.v1beta1.User users = 1; + */ + java.util.List getUsersOrBuilderList(); + + /** + * + * + *
        +   * The list of users.
        +   * 
        + * + * repeated .google.showcase.v1beta1.User users = 1; + */ + com.google.showcase.v1beta1.UserOrBuilder getUsersOrBuilder(int index); + + /** + * + * + *
        +   * A token to retrieve next page of results.
        +   * Pass this value in ListUsersRequest.page_token field in the subsequent
        +   * call to `google.showcase.v1beta1.Message\ListUsers` method to retrieve the
        +   * next page of results.
        +   * 
        + * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + java.lang.String getNextPageToken(); + + /** + * + * + *
        +   * A token to retrieve next page of results.
        +   * Pass this value in ListUsersRequest.page_token field in the subsequent
        +   * call to `google.showcase.v1beta1.Message\ListUsers` method to retrieve the
        +   * next page of results.
        +   * 
        + * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + com.google.protobuf.ByteString getNextPageTokenBytes(); +} diff --git a/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/MessagingOuterClass.java b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/MessagingOuterClass.java new file mode 100644 index 0000000000..f35843ca3f --- /dev/null +++ b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/MessagingOuterClass.java @@ -0,0 +1,493 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/messaging.proto + +// Protobuf Java Version: 3.25.8 +package com.google.showcase.v1beta1; + +public final class MessagingOuterClass { + private MessagingOuterClass() {} + + 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_showcase_v1beta1_Room_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_showcase_v1beta1_Room_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_showcase_v1beta1_CreateRoomRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_showcase_v1beta1_CreateRoomRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_showcase_v1beta1_GetRoomRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_showcase_v1beta1_GetRoomRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_showcase_v1beta1_UpdateRoomRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_showcase_v1beta1_UpdateRoomRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_showcase_v1beta1_DeleteRoomRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_showcase_v1beta1_DeleteRoomRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_showcase_v1beta1_ListRoomsRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_showcase_v1beta1_ListRoomsRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_showcase_v1beta1_ListRoomsResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_showcase_v1beta1_ListRoomsResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_showcase_v1beta1_Blurb_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_showcase_v1beta1_Blurb_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_showcase_v1beta1_CreateBlurbRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_showcase_v1beta1_CreateBlurbRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_showcase_v1beta1_GetBlurbRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_showcase_v1beta1_GetBlurbRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_showcase_v1beta1_UpdateBlurbRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_showcase_v1beta1_UpdateBlurbRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_showcase_v1beta1_DeleteBlurbRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_showcase_v1beta1_DeleteBlurbRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_showcase_v1beta1_ListBlurbsRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_showcase_v1beta1_ListBlurbsRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_showcase_v1beta1_ListBlurbsResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_showcase_v1beta1_ListBlurbsResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_showcase_v1beta1_SearchBlurbsRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_showcase_v1beta1_SearchBlurbsRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_showcase_v1beta1_SearchBlurbsMetadata_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_showcase_v1beta1_SearchBlurbsMetadata_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_showcase_v1beta1_SearchBlurbsResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_showcase_v1beta1_SearchBlurbsResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_showcase_v1beta1_StreamBlurbsRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_showcase_v1beta1_StreamBlurbsRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_showcase_v1beta1_StreamBlurbsResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_showcase_v1beta1_StreamBlurbsResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_showcase_v1beta1_SendBlurbsResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_showcase_v1beta1_SendBlurbsResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_showcase_v1beta1_ConnectRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_showcase_v1beta1_ConnectRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_showcase_v1beta1_ConnectRequest_ConnectConfig_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_showcase_v1beta1_ConnectRequest_ConnectConfig_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.schema/google/showcase/v1beta1/messagi" + + "ng.proto\022\027google.showcase.v1beta1\032\034googl" + + "e/api/annotations.proto\032\027google/api/clie" + + "nt.proto\032\037google/api/field_behavior.prot" + + "o\032\031google/api/resource.proto\032#google/lon" + + "grunning/operations.proto\032\033google/protob" + + "uf/empty.proto\032 google/protobuf/field_ma" + + "sk.proto\032\037google/protobuf/timestamp.prot" + + "o\032\036google/rpc/error_details.proto\"\341\001\n\004Ro" + + "om\022\014\n\004name\030\001 \001(\t\022\031\n\014display_name\030\002 \001(\tB\003" + + "\340A\002\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.Ti" + + "mestampB\003\340A\003:/\352A,\n\034showcase.googleapis.c" + + "om/Room\022\014rooms/{room}\"@\n\021CreateRoomReque" + + "st\022+\n\004room\030\001 \001(\0132\035.google.showcase.v1bet" + + "a1.Room\"D\n\016GetRoomRequest\0222\n\004name\030\001 \001(\tB" + + "$\340A\002\372A\036\n\034showcase.googleapis.com/Room\"q\n" + + "\021UpdateRoomRequest\022+\n\004room\030\001 \001(\0132\035.googl" + + "e.showcase.v1beta1.Room\022/\n\013update_mask\030\002" + + " \001(\0132\032.google.protobuf.FieldMask\"G\n\021Dele" + + "teRoomRequest\0222\n\004name\030\001 \001(\tB$\340A\002\372A\036\n\034sho" + + "wcase.googleapis.com/Room\"9\n\020ListRoomsRe" + + "quest\022\021\n\tpage_size\030\001 \001(\005\022\022\n\npage_token\030\002" + + " \001(\t\"Z\n\021ListRoomsResponse\022,\n\005rooms\030\001 \003(\013" + + "2\035.google.showcase.v1beta1.Room\022\027\n\017next_" + + "page_token\030\002 \001(\t\"\366\003\n\005Blurb\022\014\n\004name\030\001 \001(\t" + + "\0222\n\004user\030\002 \001(\tB$\340A\002\372A\036\n\034showcase.googlea" + + "pis.com/User\022\016\n\004text\030\003 \001(\tH\000\022\017\n\005image\030\004 " + + "\001(\014H\000\0224\n\013create_time\030\005 \001(\0132\032.google.prot" + + "obuf.TimestampB\003\340A\003\0224\n\013update_time\030\006 \001(\013" + + "2\032.google.protobuf.TimestampB\003\340A\003\022\030\n\016leg" + + "acy_room_id\030\007 \001(\tH\001\022\030\n\016legacy_user_id\030\010 " + + "\001(\tH\001:\321\001\352A\315\001\n\035showcase.googleapis.com/Bl" + + "urb\0228users/{user}/profile/blurbs/legacy/" + + "{legacy_user}~{blurb}\022#users/{user}/prof" + + "ile/blurbs/{blurb}\022\033rooms/{room}/blurbs/" + + "{blurb}\0220rooms/{room}/blurbs/legacy/{leg" + + "acy_room}.{blurb}B\t\n\007contentB\013\n\tlegacy_i" + + "d\"z\n\022CreateBlurbRequest\0225\n\006parent\030\001 \001(\tB" + + "%\340A\002\372A\037\022\035showcase.googleapis.com/Blurb\022-" + + "\n\005blurb\030\002 \001(\0132\036.google.showcase.v1beta1." + + "Blurb\"F\n\017GetBlurbRequest\0223\n\004name\030\001 \001(\tB%" + + "\340A\002\372A\037\n\035showcase.googleapis.com/Blurb\"t\n" + + "\022UpdateBlurbRequest\022-\n\005blurb\030\001 \001(\0132\036.goo" + + "gle.showcase.v1beta1.Blurb\022/\n\013update_mas" + + "k\030\002 \001(\0132\032.google.protobuf.FieldMask\"I\n\022D" + + "eleteBlurbRequest\0223\n\004name\030\001 \001(\tB%\340A\002\372A\037\n" + + "\035showcase.googleapis.com/Blurb\"q\n\021ListBl" + + "urbsRequest\0225\n\006parent\030\001 \001(\tB%\340A\002\372A\037\022\035sho" + + "wcase.googleapis.com/Blurb\022\021\n\tpage_size\030" + + "\002 \001(\005\022\022\n\npage_token\030\003 \001(\t\"]\n\022ListBlurbsR" + + "esponse\022.\n\006blurbs\030\001 \003(\0132\036.google.showcas" + + "e.v1beta1.Blurb\022\027\n\017next_page_token\030\002 \001(\t" + + "\"\204\001\n\023SearchBlurbsRequest\022\022\n\005query\030\001 \001(\tB" + + "\003\340A\002\0222\n\006parent\030\002 \001(\tB\"\372A\037\022\035showcase.goog" + + "leapis.com/Blurb\022\021\n\tpage_size\030\003 \001(\005\022\022\n\np" + + "age_token\030\004 \001(\t\"A\n\024SearchBlurbsMetadata\022" + + ")\n\nretry_info\030\001 \001(\0132\025.google.rpc.RetryIn" + + "fo\"_\n\024SearchBlurbsResponse\022.\n\006blurbs\030\001 \003" + + "(\0132\036.google.showcase.v1beta1.Blurb\022\027\n\017ne" + + "xt_page_token\030\002 \001(\t\"\200\001\n\023StreamBlurbsRequ" + + "est\0223\n\004name\030\001 \001(\tB%\340A\002\372A\037\022\035showcase.goog" + + "leapis.com/Blurb\0224\n\013expire_time\030\002 \001(\0132\032." + + "google.protobuf.TimestampB\003\340A\002\"\321\001\n\024Strea" + + "mBlurbsResponse\022-\n\005blurb\030\001 \001(\0132\036.google." + + "showcase.v1beta1.Blurb\022D\n\006action\030\002 \001(\01624" + + ".google.showcase.v1beta1.StreamBlurbsRes" + + "ponse.Action\"D\n\006Action\022\026\n\022ACTION_UNSPECI" + + "FIED\020\000\022\n\n\006CREATE\020\001\022\n\n\006UPDATE\020\002\022\n\n\006DELETE" + + "\020\003\"#\n\022SendBlurbsResponse\022\r\n\005names\030\001 \003(\t\"" + + "\332\001\n\016ConnectRequest\022G\n\006config\030\001 \001(\01325.goo" + + "gle.showcase.v1beta1.ConnectRequest.Conn" + + "ectConfigH\000\022/\n\005blurb\030\002 \001(\0132\036.google.show" + + "case.v1beta1.BlurbH\000\032C\n\rConnectConfig\0222\n" + + "\006parent\030\001 \001(\tB\"\372A\037\022\035showcase.googleapis." + + "com/BlurbB\t\n\007request2\264\023\n\tMessaging\022\227\001\n\nC" + + "reateRoom\022*.google.showcase.v1beta1.Crea" + + "teRoomRequest\032\035.google.showcase.v1beta1." + + "Room\">\332A\"room.display_name,room.descript" + + "ion\202\323\344\223\002\023\"\016/v1beta1/rooms:\001*\022y\n\007GetRoom\022" + + "\'.google.showcase.v1beta1.GetRoomRequest" + + "\032\035.google.showcase.v1beta1.Room\"&\332A\004name" + + "\202\323\344\223\002\031\022\027/v1beta1/{name=rooms/*}\022\203\001\n\nUpda" + + "teRoom\022*.google.showcase.v1beta1.UpdateR" + + "oomRequest\032\035.google.showcase.v1beta1.Roo" + + "m\"*\202\323\344\223\002$2\034/v1beta1/{room.name=rooms/*}:" + + "\004room\022x\n\nDeleteRoom\022*.google.showcase.v1" + + "beta1.DeleteRoomRequest\032\026.google.protobu" + + "f.Empty\"&\332A\004name\202\323\344\223\002\031*\027/v1beta1/{name=r" + + "ooms/*}\022z\n\tListRooms\022).google.showcase.v" + + "1beta1.ListRoomsRequest\032*.google.showcas" + + "e.v1beta1.ListRoomsResponse\"\026\202\323\344\223\002\020\022\016/v1" + + "beta1/rooms\022\366\001\n\013CreateBlurb\022+.google.sho" + + "wcase.v1beta1.CreateBlurbRequest\032\036.googl" + + "e.showcase.v1beta1.Blurb\"\231\001\332A\034parent,blu" + + "rb.user,blurb.text\332A\035parent,blurb.user,b" + + "lurb.image\202\323\344\223\002T\" /v1beta1/{parent=rooms" + + "/*}/blurbs:\001*Z-\"(/v1beta1/{parent=users/" + + "*/profile}/blurbs:\001*\022\261\001\n\010GetBlurb\022(.goog" + + "le.showcase.v1beta1.GetBlurbRequest\032\036.go" + + "ogle.showcase.v1beta1.Blurb\"[\332A\004name\202\323\344\223" + + "\002N\022 /v1beta1/{name=rooms/*/blurbs/*}Z*\022(" + + "/v1beta1/{name=users/*/profile/blurbs/*}" + + "\022\312\001\n\013UpdateBlurb\022+.google.showcase.v1bet" + + "a1.UpdateBlurbRequest\032\036.google.showcase." + + "v1beta1.Blurb\"n\202\323\344\223\002h2&/v1beta1/{blurb.n" + + "ame=rooms/*/blurbs/*}:\005blurbZ72./v1beta1" + + "/{blurb.name=users/*/profile/blurbs/*}:\005" + + "blurb\022\257\001\n\013DeleteBlurb\022+.google.showcase." + + "v1beta1.DeleteBlurbRequest\032\026.google.prot" + + "obuf.Empty\"[\332A\004name\202\323\344\223\002N* /v1beta1/{nam" + + "e=rooms/*/blurbs/*}Z**(/v1beta1/{name=us" + + "ers/*/profile/blurbs/*}\022\304\001\n\nListBlurbs\022*" + + ".google.showcase.v1beta1.ListBlurbsReque" + + "st\032+.google.showcase.v1beta1.ListBlurbsR" + + "esponse\"]\332A\006parent\202\323\344\223\002N\022 /v1beta1/{pare" + + "nt=rooms/*}/blurbsZ*\022(/v1beta1/{parent=u" + + "sers/*/profile}/blurbs\022\201\002\n\014SearchBlurbs\022" + + ",.google.showcase.v1beta1.SearchBlurbsRe" + + "quest\032\035.google.longrunning.Operation\"\243\001\312" + + "A,\n\024SearchBlurbsResponse\022\024SearchBlurbsMe" + + "tadata\332A\014parent,query\202\323\344\223\002_\"\'/v1beta1/{p" + + "arent=rooms/*}/blurbs:search:\001*Z1\"//v1be" + + "ta1/{parent=users/*/profile}/blurbs:sear" + + "ch\022\323\001\n\014StreamBlurbs\022,.google.showcase.v1" + + "beta1.StreamBlurbsRequest\032-.google.showc" + + "ase.v1beta1.StreamBlurbsResponse\"d\202\323\344\223\002^" + + "\"%/v1beta1/{name=rooms/*}/blurbs:stream:" + + "\001*Z2\"-/v1beta1/{name=users/*/profile}/bl" + + "urbs:stream:\001*0\001\022\316\001\n\nSendBlurbs\022+.google" + + ".showcase.v1beta1.CreateBlurbRequest\032+.g" + + "oogle.showcase.v1beta1.SendBlurbsRespons" + + "e\"d\202\323\344\223\002^\"%/v1beta1/{parent=rooms/*}/blu" + + "rbs:send:\001*Z2\"-/v1beta1/{parent=users/*/" + + "profile}/blurbs:send:\001*(\001\022e\n\007Connect\022\'.g" + + "oogle.showcase.v1beta1.ConnectRequest\032-." + + "google.showcase.v1beta1.StreamBlurbsResp" + + "onse(\0010\001\032\021\312A\016localhost:7469Bq\n\033com.googl" + + "e.showcase.v1beta1P\001Z4github.com/googlea" + + "pis/gapic-showcase/server/genproto\352\002\031Goo" + + "gle::Showcase::V1beta1b\006proto3" + }; + descriptor = + com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( + descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + com.google.api.AnnotationsProto.getDescriptor(), + com.google.api.ClientProto.getDescriptor(), + com.google.api.FieldBehaviorProto.getDescriptor(), + com.google.api.ResourceProto.getDescriptor(), + com.google.longrunning.OperationsProto.getDescriptor(), + com.google.protobuf.EmptyProto.getDescriptor(), + com.google.protobuf.FieldMaskProto.getDescriptor(), + com.google.protobuf.TimestampProto.getDescriptor(), + com.google.rpc.ErrorDetailsProto.getDescriptor(), + }); + internal_static_google_showcase_v1beta1_Room_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_showcase_v1beta1_Room_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_showcase_v1beta1_Room_descriptor, + new java.lang.String[] { + "Name", "DisplayName", "Description", "CreateTime", "UpdateTime", + }); + internal_static_google_showcase_v1beta1_CreateRoomRequest_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_google_showcase_v1beta1_CreateRoomRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_showcase_v1beta1_CreateRoomRequest_descriptor, + new java.lang.String[] { + "Room", + }); + internal_static_google_showcase_v1beta1_GetRoomRequest_descriptor = + getDescriptor().getMessageTypes().get(2); + internal_static_google_showcase_v1beta1_GetRoomRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_showcase_v1beta1_GetRoomRequest_descriptor, + new java.lang.String[] { + "Name", + }); + internal_static_google_showcase_v1beta1_UpdateRoomRequest_descriptor = + getDescriptor().getMessageTypes().get(3); + internal_static_google_showcase_v1beta1_UpdateRoomRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_showcase_v1beta1_UpdateRoomRequest_descriptor, + new java.lang.String[] { + "Room", "UpdateMask", + }); + internal_static_google_showcase_v1beta1_DeleteRoomRequest_descriptor = + getDescriptor().getMessageTypes().get(4); + internal_static_google_showcase_v1beta1_DeleteRoomRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_showcase_v1beta1_DeleteRoomRequest_descriptor, + new java.lang.String[] { + "Name", + }); + internal_static_google_showcase_v1beta1_ListRoomsRequest_descriptor = + getDescriptor().getMessageTypes().get(5); + internal_static_google_showcase_v1beta1_ListRoomsRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_showcase_v1beta1_ListRoomsRequest_descriptor, + new java.lang.String[] { + "PageSize", "PageToken", + }); + internal_static_google_showcase_v1beta1_ListRoomsResponse_descriptor = + getDescriptor().getMessageTypes().get(6); + internal_static_google_showcase_v1beta1_ListRoomsResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_showcase_v1beta1_ListRoomsResponse_descriptor, + new java.lang.String[] { + "Rooms", "NextPageToken", + }); + internal_static_google_showcase_v1beta1_Blurb_descriptor = + getDescriptor().getMessageTypes().get(7); + internal_static_google_showcase_v1beta1_Blurb_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_showcase_v1beta1_Blurb_descriptor, + new java.lang.String[] { + "Name", + "User", + "Text", + "Image", + "CreateTime", + "UpdateTime", + "LegacyRoomId", + "LegacyUserId", + "Content", + "LegacyId", + }); + internal_static_google_showcase_v1beta1_CreateBlurbRequest_descriptor = + getDescriptor().getMessageTypes().get(8); + internal_static_google_showcase_v1beta1_CreateBlurbRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_showcase_v1beta1_CreateBlurbRequest_descriptor, + new java.lang.String[] { + "Parent", "Blurb", + }); + internal_static_google_showcase_v1beta1_GetBlurbRequest_descriptor = + getDescriptor().getMessageTypes().get(9); + internal_static_google_showcase_v1beta1_GetBlurbRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_showcase_v1beta1_GetBlurbRequest_descriptor, + new java.lang.String[] { + "Name", + }); + internal_static_google_showcase_v1beta1_UpdateBlurbRequest_descriptor = + getDescriptor().getMessageTypes().get(10); + internal_static_google_showcase_v1beta1_UpdateBlurbRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_showcase_v1beta1_UpdateBlurbRequest_descriptor, + new java.lang.String[] { + "Blurb", "UpdateMask", + }); + internal_static_google_showcase_v1beta1_DeleteBlurbRequest_descriptor = + getDescriptor().getMessageTypes().get(11); + internal_static_google_showcase_v1beta1_DeleteBlurbRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_showcase_v1beta1_DeleteBlurbRequest_descriptor, + new java.lang.String[] { + "Name", + }); + internal_static_google_showcase_v1beta1_ListBlurbsRequest_descriptor = + getDescriptor().getMessageTypes().get(12); + internal_static_google_showcase_v1beta1_ListBlurbsRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_showcase_v1beta1_ListBlurbsRequest_descriptor, + new java.lang.String[] { + "Parent", "PageSize", "PageToken", + }); + internal_static_google_showcase_v1beta1_ListBlurbsResponse_descriptor = + getDescriptor().getMessageTypes().get(13); + internal_static_google_showcase_v1beta1_ListBlurbsResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_showcase_v1beta1_ListBlurbsResponse_descriptor, + new java.lang.String[] { + "Blurbs", "NextPageToken", + }); + internal_static_google_showcase_v1beta1_SearchBlurbsRequest_descriptor = + getDescriptor().getMessageTypes().get(14); + internal_static_google_showcase_v1beta1_SearchBlurbsRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_showcase_v1beta1_SearchBlurbsRequest_descriptor, + new java.lang.String[] { + "Query", "Parent", "PageSize", "PageToken", + }); + internal_static_google_showcase_v1beta1_SearchBlurbsMetadata_descriptor = + getDescriptor().getMessageTypes().get(15); + internal_static_google_showcase_v1beta1_SearchBlurbsMetadata_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_showcase_v1beta1_SearchBlurbsMetadata_descriptor, + new java.lang.String[] { + "RetryInfo", + }); + internal_static_google_showcase_v1beta1_SearchBlurbsResponse_descriptor = + getDescriptor().getMessageTypes().get(16); + internal_static_google_showcase_v1beta1_SearchBlurbsResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_showcase_v1beta1_SearchBlurbsResponse_descriptor, + new java.lang.String[] { + "Blurbs", "NextPageToken", + }); + internal_static_google_showcase_v1beta1_StreamBlurbsRequest_descriptor = + getDescriptor().getMessageTypes().get(17); + internal_static_google_showcase_v1beta1_StreamBlurbsRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_showcase_v1beta1_StreamBlurbsRequest_descriptor, + new java.lang.String[] { + "Name", "ExpireTime", + }); + internal_static_google_showcase_v1beta1_StreamBlurbsResponse_descriptor = + getDescriptor().getMessageTypes().get(18); + internal_static_google_showcase_v1beta1_StreamBlurbsResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_showcase_v1beta1_StreamBlurbsResponse_descriptor, + new java.lang.String[] { + "Blurb", "Action", + }); + internal_static_google_showcase_v1beta1_SendBlurbsResponse_descriptor = + getDescriptor().getMessageTypes().get(19); + internal_static_google_showcase_v1beta1_SendBlurbsResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_showcase_v1beta1_SendBlurbsResponse_descriptor, + new java.lang.String[] { + "Names", + }); + internal_static_google_showcase_v1beta1_ConnectRequest_descriptor = + getDescriptor().getMessageTypes().get(20); + internal_static_google_showcase_v1beta1_ConnectRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_showcase_v1beta1_ConnectRequest_descriptor, + new java.lang.String[] { + "Config", "Blurb", "Request", + }); + internal_static_google_showcase_v1beta1_ConnectRequest_ConnectConfig_descriptor = + internal_static_google_showcase_v1beta1_ConnectRequest_descriptor.getNestedTypes().get(0); + internal_static_google_showcase_v1beta1_ConnectRequest_ConnectConfig_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_showcase_v1beta1_ConnectRequest_ConnectConfig_descriptor, + new java.lang.String[] { + "Parent", + }); + 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.ResourceProto.resource); + 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(); + com.google.rpc.ErrorDetailsProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/PagedExpandLegacyMappedResponse.java b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/PagedExpandLegacyMappedResponse.java new file mode 100644 index 0000000000..23872056c1 --- /dev/null +++ b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/PagedExpandLegacyMappedResponse.java @@ -0,0 +1,1102 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/echo.proto + +// Protobuf Java Version: 3.25.8 +package com.google.showcase.v1beta1; + +/** Protobuf type {@code google.showcase.v1beta1.PagedExpandLegacyMappedResponse} */ +public final class PagedExpandLegacyMappedResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.PagedExpandLegacyMappedResponse) + PagedExpandLegacyMappedResponseOrBuilder { + private static final long serialVersionUID = 0L; + + // Use PagedExpandLegacyMappedResponse.newBuilder() to construct. + private PagedExpandLegacyMappedResponse( + com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private PagedExpandLegacyMappedResponse() { + nextPageToken_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new PagedExpandLegacyMappedResponse(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.EchoOuterClass + .internal_static_google_showcase_v1beta1_PagedExpandLegacyMappedResponse_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + @java.lang.Override + protected com.google.protobuf.MapFieldReflectionAccessor internalGetMapFieldReflection( + int number) { + switch (number) { + case 1: + return internalGetAlphabetized(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.EchoOuterClass + .internal_static_google_showcase_v1beta1_PagedExpandLegacyMappedResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.PagedExpandLegacyMappedResponse.class, + com.google.showcase.v1beta1.PagedExpandLegacyMappedResponse.Builder.class); + } + + public static final int ALPHABETIZED_FIELD_NUMBER = 1; + + private static final class AlphabetizedDefaultEntryHolder { + static final com.google.protobuf.MapEntry< + java.lang.String, com.google.showcase.v1beta1.PagedExpandResponseList> + defaultEntry = + com.google.protobuf.MapEntry + . + newDefaultInstance( + com.google.showcase.v1beta1.EchoOuterClass + .internal_static_google_showcase_v1beta1_PagedExpandLegacyMappedResponse_AlphabetizedEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.MESSAGE, + com.google.showcase.v1beta1.PagedExpandResponseList.getDefaultInstance()); + } + + @SuppressWarnings("serial") + private com.google.protobuf.MapField< + java.lang.String, com.google.showcase.v1beta1.PagedExpandResponseList> + alphabetized_; + + private com.google.protobuf.MapField< + java.lang.String, com.google.showcase.v1beta1.PagedExpandResponseList> + internalGetAlphabetized() { + if (alphabetized_ == null) { + return com.google.protobuf.MapField.emptyMapField( + AlphabetizedDefaultEntryHolder.defaultEntry); + } + return alphabetized_; + } + + public int getAlphabetizedCount() { + return internalGetAlphabetized().getMap().size(); + } + + /** + * + * + *
        +   * The words that were expanded, indexed by their initial character.
        +   * (-- aip.dev/not-precedent: This is a legacy, non-standard pattern that violates
        +   *     aip.dev/158. Ordinarily, this should be a `repeated` field, as in PagedExpandResponse. --)
        +   * 
        + * + * map<string, .google.showcase.v1beta1.PagedExpandResponseList> alphabetized = 1; + * + */ + @java.lang.Override + public boolean containsAlphabetized(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + return internalGetAlphabetized().getMap().containsKey(key); + } + + /** Use {@link #getAlphabetizedMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map + getAlphabetized() { + return getAlphabetizedMap(); + } + + /** + * + * + *
        +   * The words that were expanded, indexed by their initial character.
        +   * (-- aip.dev/not-precedent: This is a legacy, non-standard pattern that violates
        +   *     aip.dev/158. Ordinarily, this should be a `repeated` field, as in PagedExpandResponse. --)
        +   * 
        + * + * map<string, .google.showcase.v1beta1.PagedExpandResponseList> alphabetized = 1; + * + */ + @java.lang.Override + public java.util.Map + getAlphabetizedMap() { + return internalGetAlphabetized().getMap(); + } + + /** + * + * + *
        +   * The words that were expanded, indexed by their initial character.
        +   * (-- aip.dev/not-precedent: This is a legacy, non-standard pattern that violates
        +   *     aip.dev/158. Ordinarily, this should be a `repeated` field, as in PagedExpandResponse. --)
        +   * 
        + * + * map<string, .google.showcase.v1beta1.PagedExpandResponseList> alphabetized = 1; + * + */ + @java.lang.Override + public /* nullable */ com.google.showcase.v1beta1.PagedExpandResponseList + getAlphabetizedOrDefault( + java.lang.String key, + /* nullable */ + com.google.showcase.v1beta1.PagedExpandResponseList defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = + internalGetAlphabetized().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + + /** + * + * + *
        +   * The words that were expanded, indexed by their initial character.
        +   * (-- aip.dev/not-precedent: This is a legacy, non-standard pattern that violates
        +   *     aip.dev/158. Ordinarily, this should be a `repeated` field, as in PagedExpandResponse. --)
        +   * 
        + * + * map<string, .google.showcase.v1beta1.PagedExpandResponseList> alphabetized = 1; + * + */ + @java.lang.Override + public com.google.showcase.v1beta1.PagedExpandResponseList getAlphabetizedOrThrow( + java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = + internalGetAlphabetized().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public static final int NEXT_PAGE_TOKEN_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object nextPageToken_ = ""; + + /** + * + * + *
        +   * The next page token.
        +   * 
        + * + * 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; + } + } + + /** + * + * + *
        +   * The next page token.
        +   * 
        + * + * 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 { + com.google.protobuf.GeneratedMessageV3.serializeStringMapTo( + output, internalGetAlphabetized(), AlphabetizedDefaultEntryHolder.defaultEntry, 1); + 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 (java.util.Map.Entry + entry : internalGetAlphabetized().getMap().entrySet()) { + com.google.protobuf.MapEntry< + java.lang.String, com.google.showcase.v1beta1.PagedExpandResponseList> + alphabetized__ = + AlphabetizedDefaultEntryHolder.defaultEntry + .newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, alphabetized__); + } + 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.showcase.v1beta1.PagedExpandLegacyMappedResponse)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.PagedExpandLegacyMappedResponse other = + (com.google.showcase.v1beta1.PagedExpandLegacyMappedResponse) obj; + + if (!internalGetAlphabetized().equals(other.internalGetAlphabetized())) 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 (!internalGetAlphabetized().getMap().isEmpty()) { + hash = (37 * hash) + ALPHABETIZED_FIELD_NUMBER; + hash = (53 * hash) + internalGetAlphabetized().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.showcase.v1beta1.PagedExpandLegacyMappedResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.PagedExpandLegacyMappedResponse parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.PagedExpandLegacyMappedResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.PagedExpandLegacyMappedResponse 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.showcase.v1beta1.PagedExpandLegacyMappedResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.PagedExpandLegacyMappedResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.PagedExpandLegacyMappedResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.PagedExpandLegacyMappedResponse 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.showcase.v1beta1.PagedExpandLegacyMappedResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.PagedExpandLegacyMappedResponse 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.showcase.v1beta1.PagedExpandLegacyMappedResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.PagedExpandLegacyMappedResponse 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.showcase.v1beta1.PagedExpandLegacyMappedResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** Protobuf type {@code google.showcase.v1beta1.PagedExpandLegacyMappedResponse} */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.PagedExpandLegacyMappedResponse) + com.google.showcase.v1beta1.PagedExpandLegacyMappedResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.EchoOuterClass + .internal_static_google_showcase_v1beta1_PagedExpandLegacyMappedResponse_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapFieldReflectionAccessor internalGetMapFieldReflection( + int number) { + switch (number) { + case 1: + return internalGetAlphabetized(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapFieldReflectionAccessor internalGetMutableMapFieldReflection( + int number) { + switch (number) { + case 1: + return internalGetMutableAlphabetized(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.EchoOuterClass + .internal_static_google_showcase_v1beta1_PagedExpandLegacyMappedResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.PagedExpandLegacyMappedResponse.class, + com.google.showcase.v1beta1.PagedExpandLegacyMappedResponse.Builder.class); + } + + // Construct using com.google.showcase.v1beta1.PagedExpandLegacyMappedResponse.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + internalGetMutableAlphabetized().clear(); + nextPageToken_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.showcase.v1beta1.EchoOuterClass + .internal_static_google_showcase_v1beta1_PagedExpandLegacyMappedResponse_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.PagedExpandLegacyMappedResponse getDefaultInstanceForType() { + return com.google.showcase.v1beta1.PagedExpandLegacyMappedResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.PagedExpandLegacyMappedResponse build() { + com.google.showcase.v1beta1.PagedExpandLegacyMappedResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.PagedExpandLegacyMappedResponse buildPartial() { + com.google.showcase.v1beta1.PagedExpandLegacyMappedResponse result = + new com.google.showcase.v1beta1.PagedExpandLegacyMappedResponse(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.showcase.v1beta1.PagedExpandLegacyMappedResponse result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.alphabetized_ = + internalGetAlphabetized().build(AlphabetizedDefaultEntryHolder.defaultEntry); + } + 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.showcase.v1beta1.PagedExpandLegacyMappedResponse) { + return mergeFrom((com.google.showcase.v1beta1.PagedExpandLegacyMappedResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.showcase.v1beta1.PagedExpandLegacyMappedResponse other) { + if (other == com.google.showcase.v1beta1.PagedExpandLegacyMappedResponse.getDefaultInstance()) + return this; + internalGetMutableAlphabetized().mergeFrom(other.internalGetAlphabetized()); + bitField0_ |= 0x00000001; + 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.protobuf.MapEntry< + java.lang.String, com.google.showcase.v1beta1.PagedExpandResponseList> + alphabetized__ = + input.readMessage( + AlphabetizedDefaultEntryHolder.defaultEntry.getParserForType(), + extensionRegistry); + internalGetMutableAlphabetized() + .ensureBuilderMap() + .put(alphabetized__.getKey(), alphabetized__.getValue()); + bitField0_ |= 0x00000001; + 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 static final class AlphabetizedConverter + implements com.google.protobuf.MapFieldBuilder.Converter< + java.lang.String, + com.google.showcase.v1beta1.PagedExpandResponseListOrBuilder, + com.google.showcase.v1beta1.PagedExpandResponseList> { + @java.lang.Override + public com.google.showcase.v1beta1.PagedExpandResponseList build( + com.google.showcase.v1beta1.PagedExpandResponseListOrBuilder val) { + if (val instanceof com.google.showcase.v1beta1.PagedExpandResponseList) { + return (com.google.showcase.v1beta1.PagedExpandResponseList) val; + } + return ((com.google.showcase.v1beta1.PagedExpandResponseList.Builder) val).build(); + } + + @java.lang.Override + public com.google.protobuf.MapEntry< + java.lang.String, com.google.showcase.v1beta1.PagedExpandResponseList> + defaultEntry() { + return AlphabetizedDefaultEntryHolder.defaultEntry; + } + } + ; + + private static final AlphabetizedConverter alphabetizedConverter = new AlphabetizedConverter(); + + private com.google.protobuf.MapFieldBuilder< + java.lang.String, + com.google.showcase.v1beta1.PagedExpandResponseListOrBuilder, + com.google.showcase.v1beta1.PagedExpandResponseList, + com.google.showcase.v1beta1.PagedExpandResponseList.Builder> + alphabetized_; + + private com.google.protobuf.MapFieldBuilder< + java.lang.String, + com.google.showcase.v1beta1.PagedExpandResponseListOrBuilder, + com.google.showcase.v1beta1.PagedExpandResponseList, + com.google.showcase.v1beta1.PagedExpandResponseList.Builder> + internalGetAlphabetized() { + if (alphabetized_ == null) { + return new com.google.protobuf.MapFieldBuilder<>(alphabetizedConverter); + } + return alphabetized_; + } + + private com.google.protobuf.MapFieldBuilder< + java.lang.String, + com.google.showcase.v1beta1.PagedExpandResponseListOrBuilder, + com.google.showcase.v1beta1.PagedExpandResponseList, + com.google.showcase.v1beta1.PagedExpandResponseList.Builder> + internalGetMutableAlphabetized() { + if (alphabetized_ == null) { + alphabetized_ = new com.google.protobuf.MapFieldBuilder<>(alphabetizedConverter); + } + bitField0_ |= 0x00000001; + onChanged(); + return alphabetized_; + } + + public int getAlphabetizedCount() { + return internalGetAlphabetized().ensureBuilderMap().size(); + } + + /** + * + * + *
        +     * The words that were expanded, indexed by their initial character.
        +     * (-- aip.dev/not-precedent: This is a legacy, non-standard pattern that violates
        +     *     aip.dev/158. Ordinarily, this should be a `repeated` field, as in PagedExpandResponse. --)
        +     * 
        + * + * map<string, .google.showcase.v1beta1.PagedExpandResponseList> alphabetized = 1; + * + */ + @java.lang.Override + public boolean containsAlphabetized(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + return internalGetAlphabetized().ensureBuilderMap().containsKey(key); + } + + /** Use {@link #getAlphabetizedMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map + getAlphabetized() { + return getAlphabetizedMap(); + } + + /** + * + * + *
        +     * The words that were expanded, indexed by their initial character.
        +     * (-- aip.dev/not-precedent: This is a legacy, non-standard pattern that violates
        +     *     aip.dev/158. Ordinarily, this should be a `repeated` field, as in PagedExpandResponse. --)
        +     * 
        + * + * map<string, .google.showcase.v1beta1.PagedExpandResponseList> alphabetized = 1; + * + */ + @java.lang.Override + public java.util.Map + getAlphabetizedMap() { + return internalGetAlphabetized().getImmutableMap(); + } + + /** + * + * + *
        +     * The words that were expanded, indexed by their initial character.
        +     * (-- aip.dev/not-precedent: This is a legacy, non-standard pattern that violates
        +     *     aip.dev/158. Ordinarily, this should be a `repeated` field, as in PagedExpandResponse. --)
        +     * 
        + * + * map<string, .google.showcase.v1beta1.PagedExpandResponseList> alphabetized = 1; + * + */ + @java.lang.Override + public /* nullable */ com.google.showcase.v1beta1.PagedExpandResponseList + getAlphabetizedOrDefault( + java.lang.String key, + /* nullable */ + com.google.showcase.v1beta1.PagedExpandResponseList defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map + map = internalGetMutableAlphabetized().ensureBuilderMap(); + return map.containsKey(key) ? alphabetizedConverter.build(map.get(key)) : defaultValue; + } + + /** + * + * + *
        +     * The words that were expanded, indexed by their initial character.
        +     * (-- aip.dev/not-precedent: This is a legacy, non-standard pattern that violates
        +     *     aip.dev/158. Ordinarily, this should be a `repeated` field, as in PagedExpandResponse. --)
        +     * 
        + * + * map<string, .google.showcase.v1beta1.PagedExpandResponseList> alphabetized = 1; + * + */ + @java.lang.Override + public com.google.showcase.v1beta1.PagedExpandResponseList getAlphabetizedOrThrow( + java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map + map = internalGetMutableAlphabetized().ensureBuilderMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return alphabetizedConverter.build(map.get(key)); + } + + public Builder clearAlphabetized() { + bitField0_ = (bitField0_ & ~0x00000001); + internalGetMutableAlphabetized().clear(); + return this; + } + + /** + * + * + *
        +     * The words that were expanded, indexed by their initial character.
        +     * (-- aip.dev/not-precedent: This is a legacy, non-standard pattern that violates
        +     *     aip.dev/158. Ordinarily, this should be a `repeated` field, as in PagedExpandResponse. --)
        +     * 
        + * + * map<string, .google.showcase.v1beta1.PagedExpandResponseList> alphabetized = 1; + * + */ + public Builder removeAlphabetized(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + internalGetMutableAlphabetized().ensureBuilderMap().remove(key); + return this; + } + + /** Use alternate mutation accessors instead. */ + @java.lang.Deprecated + public java.util.Map + getMutableAlphabetized() { + bitField0_ |= 0x00000001; + return internalGetMutableAlphabetized().ensureMessageMap(); + } + + /** + * + * + *
        +     * The words that were expanded, indexed by their initial character.
        +     * (-- aip.dev/not-precedent: This is a legacy, non-standard pattern that violates
        +     *     aip.dev/158. Ordinarily, this should be a `repeated` field, as in PagedExpandResponse. --)
        +     * 
        + * + * map<string, .google.showcase.v1beta1.PagedExpandResponseList> alphabetized = 1; + * + */ + public Builder putAlphabetized( + java.lang.String key, com.google.showcase.v1beta1.PagedExpandResponseList value) { + if (key == null) { + throw new NullPointerException("map key"); + } + if (value == null) { + throw new NullPointerException("map value"); + } + internalGetMutableAlphabetized().ensureBuilderMap().put(key, value); + bitField0_ |= 0x00000001; + return this; + } + + /** + * + * + *
        +     * The words that were expanded, indexed by their initial character.
        +     * (-- aip.dev/not-precedent: This is a legacy, non-standard pattern that violates
        +     *     aip.dev/158. Ordinarily, this should be a `repeated` field, as in PagedExpandResponse. --)
        +     * 
        + * + * map<string, .google.showcase.v1beta1.PagedExpandResponseList> alphabetized = 1; + * + */ + public Builder putAllAlphabetized( + java.util.Map + values) { + for (java.util.Map.Entry< + java.lang.String, com.google.showcase.v1beta1.PagedExpandResponseList> + e : values.entrySet()) { + if (e.getKey() == null || e.getValue() == null) { + throw new NullPointerException(); + } + } + internalGetMutableAlphabetized().ensureBuilderMap().putAll(values); + bitField0_ |= 0x00000001; + return this; + } + + /** + * + * + *
        +     * The words that were expanded, indexed by their initial character.
        +     * (-- aip.dev/not-precedent: This is a legacy, non-standard pattern that violates
        +     *     aip.dev/158. Ordinarily, this should be a `repeated` field, as in PagedExpandResponse. --)
        +     * 
        + * + * map<string, .google.showcase.v1beta1.PagedExpandResponseList> alphabetized = 1; + * + */ + public com.google.showcase.v1beta1.PagedExpandResponseList.Builder + putAlphabetizedBuilderIfAbsent(java.lang.String key) { + java.util.Map + builderMap = internalGetMutableAlphabetized().ensureBuilderMap(); + com.google.showcase.v1beta1.PagedExpandResponseListOrBuilder entry = builderMap.get(key); + if (entry == null) { + entry = com.google.showcase.v1beta1.PagedExpandResponseList.newBuilder(); + builderMap.put(key, entry); + } + if (entry instanceof com.google.showcase.v1beta1.PagedExpandResponseList) { + entry = ((com.google.showcase.v1beta1.PagedExpandResponseList) entry).toBuilder(); + builderMap.put(key, entry); + } + return (com.google.showcase.v1beta1.PagedExpandResponseList.Builder) entry; + } + + private java.lang.Object nextPageToken_ = ""; + + /** + * + * + *
        +     * The next page token.
        +     * 
        + * + * 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; + } + } + + /** + * + * + *
        +     * The next page token.
        +     * 
        + * + * 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; + } + } + + /** + * + * + *
        +     * The next page token.
        +     * 
        + * + * 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; + } + + /** + * + * + *
        +     * The next page token.
        +     * 
        + * + * string next_page_token = 2; + * + * @return This builder for chaining. + */ + public Builder clearNextPageToken() { + nextPageToken_ = getDefaultInstance().getNextPageToken(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
        +     * The next page token.
        +     * 
        + * + * 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.showcase.v1beta1.PagedExpandLegacyMappedResponse) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.PagedExpandLegacyMappedResponse) + private static final com.google.showcase.v1beta1.PagedExpandLegacyMappedResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.PagedExpandLegacyMappedResponse(); + } + + public static com.google.showcase.v1beta1.PagedExpandLegacyMappedResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public PagedExpandLegacyMappedResponse 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.showcase.v1beta1.PagedExpandLegacyMappedResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/PagedExpandLegacyMappedResponseOrBuilder.java b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/PagedExpandLegacyMappedResponseOrBuilder.java new file mode 100644 index 0000000000..718d2a5c8d --- /dev/null +++ b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/PagedExpandLegacyMappedResponseOrBuilder.java @@ -0,0 +1,132 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/echo.proto + +// Protobuf Java Version: 3.25.8 +package com.google.showcase.v1beta1; + +public interface PagedExpandLegacyMappedResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.PagedExpandLegacyMappedResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
        +   * The words that were expanded, indexed by their initial character.
        +   * (-- aip.dev/not-precedent: This is a legacy, non-standard pattern that violates
        +   *     aip.dev/158. Ordinarily, this should be a `repeated` field, as in PagedExpandResponse. --)
        +   * 
        + * + * map<string, .google.showcase.v1beta1.PagedExpandResponseList> alphabetized = 1; + * + */ + int getAlphabetizedCount(); + + /** + * + * + *
        +   * The words that were expanded, indexed by their initial character.
        +   * (-- aip.dev/not-precedent: This is a legacy, non-standard pattern that violates
        +   *     aip.dev/158. Ordinarily, this should be a `repeated` field, as in PagedExpandResponse. --)
        +   * 
        + * + * map<string, .google.showcase.v1beta1.PagedExpandResponseList> alphabetized = 1; + * + */ + boolean containsAlphabetized(java.lang.String key); + + /** Use {@link #getAlphabetizedMap()} instead. */ + @java.lang.Deprecated + java.util.Map + getAlphabetized(); + + /** + * + * + *
        +   * The words that were expanded, indexed by their initial character.
        +   * (-- aip.dev/not-precedent: This is a legacy, non-standard pattern that violates
        +   *     aip.dev/158. Ordinarily, this should be a `repeated` field, as in PagedExpandResponse. --)
        +   * 
        + * + * map<string, .google.showcase.v1beta1.PagedExpandResponseList> alphabetized = 1; + * + */ + java.util.Map + getAlphabetizedMap(); + + /** + * + * + *
        +   * The words that were expanded, indexed by their initial character.
        +   * (-- aip.dev/not-precedent: This is a legacy, non-standard pattern that violates
        +   *     aip.dev/158. Ordinarily, this should be a `repeated` field, as in PagedExpandResponse. --)
        +   * 
        + * + * map<string, .google.showcase.v1beta1.PagedExpandResponseList> alphabetized = 1; + * + */ + /* nullable */ + com.google.showcase.v1beta1.PagedExpandResponseList getAlphabetizedOrDefault( + java.lang.String key, + /* nullable */ + com.google.showcase.v1beta1.PagedExpandResponseList defaultValue); + + /** + * + * + *
        +   * The words that were expanded, indexed by their initial character.
        +   * (-- aip.dev/not-precedent: This is a legacy, non-standard pattern that violates
        +   *     aip.dev/158. Ordinarily, this should be a `repeated` field, as in PagedExpandResponse. --)
        +   * 
        + * + * map<string, .google.showcase.v1beta1.PagedExpandResponseList> alphabetized = 1; + * + */ + com.google.showcase.v1beta1.PagedExpandResponseList getAlphabetizedOrThrow(java.lang.String key); + + /** + * + * + *
        +   * The next page token.
        +   * 
        + * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + java.lang.String getNextPageToken(); + + /** + * + * + *
        +   * The next page token.
        +   * 
        + * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + com.google.protobuf.ByteString getNextPageTokenBytes(); +} diff --git a/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/PagedExpandLegacyRequest.java b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/PagedExpandLegacyRequest.java new file mode 100644 index 0000000000..21f8094725 --- /dev/null +++ b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/PagedExpandLegacyRequest.java @@ -0,0 +1,932 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/echo.proto + +// Protobuf Java Version: 3.25.8 +package com.google.showcase.v1beta1; + +/** + * + * + *
        + * The request for the PagedExpandLegacy method.  This is a pattern used by some legacy APIs. New
        + * APIs should NOT use this pattern, but rather something like PagedExpandRequest which conforms to
        + * aip.dev/158.
        + * 
        + * + * Protobuf type {@code google.showcase.v1beta1.PagedExpandLegacyRequest} + */ +public final class PagedExpandLegacyRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.PagedExpandLegacyRequest) + PagedExpandLegacyRequestOrBuilder { + private static final long serialVersionUID = 0L; + + // Use PagedExpandLegacyRequest.newBuilder() to construct. + private PagedExpandLegacyRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private PagedExpandLegacyRequest() { + content_ = ""; + pageToken_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new PagedExpandLegacyRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.EchoOuterClass + .internal_static_google_showcase_v1beta1_PagedExpandLegacyRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.EchoOuterClass + .internal_static_google_showcase_v1beta1_PagedExpandLegacyRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.PagedExpandLegacyRequest.class, + com.google.showcase.v1beta1.PagedExpandLegacyRequest.Builder.class); + } + + public static final int CONTENT_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object content_ = ""; + + /** + * + * + *
        +   * The string to expand.
        +   * 
        + * + * string content = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The content. + */ + @java.lang.Override + public java.lang.String getContent() { + java.lang.Object ref = content_; + 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(); + content_ = s; + return s; + } + } + + /** + * + * + *
        +   * The string to expand.
        +   * 
        + * + * string content = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for content. + */ + @java.lang.Override + public com.google.protobuf.ByteString getContentBytes() { + java.lang.Object ref = content_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + content_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int MAX_RESULTS_FIELD_NUMBER = 2; + private int maxResults_ = 0; + + /** + * + * + *
        +   * The number of words to returned in each page.
        +   * (-- aip.dev/not-precedent: This is a legacy, non-standard pattern that
        +   *     violates aip.dev/158. Ordinarily, this should be page_size. --)
        +   * 
        + * + * int32 max_results = 2; + * + * @return The maxResults. + */ + @java.lang.Override + public int getMaxResults() { + return maxResults_; + } + + public static final int PAGE_TOKEN_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object pageToken_ = ""; + + /** + * + * + *
        +   * The position of the page to be returned.
        +   * 
        + * + * string page_token = 3; + * + * @return The pageToken. + */ + @java.lang.Override + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; + } + } + + /** + * + * + *
        +   * The position of the page to be returned.
        +   * 
        + * + * string page_token = 3; + * + * @return The bytes for pageToken. + */ + @java.lang.Override + public com.google.protobuf.ByteString getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(content_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, content_); + } + if (maxResults_ != 0) { + output.writeInt32(2, maxResults_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(pageToken_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, pageToken_); + } + 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(content_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, content_); + } + if (maxResults_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(2, maxResults_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(pageToken_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, 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.showcase.v1beta1.PagedExpandLegacyRequest)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.PagedExpandLegacyRequest other = + (com.google.showcase.v1beta1.PagedExpandLegacyRequest) obj; + + if (!getContent().equals(other.getContent())) return false; + if (getMaxResults() != other.getMaxResults()) 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) + CONTENT_FIELD_NUMBER; + hash = (53 * hash) + getContent().hashCode(); + hash = (37 * hash) + MAX_RESULTS_FIELD_NUMBER; + hash = (53 * hash) + getMaxResults(); + 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.showcase.v1beta1.PagedExpandLegacyRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.PagedExpandLegacyRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.PagedExpandLegacyRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.PagedExpandLegacyRequest 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.showcase.v1beta1.PagedExpandLegacyRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.PagedExpandLegacyRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.PagedExpandLegacyRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.PagedExpandLegacyRequest 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.showcase.v1beta1.PagedExpandLegacyRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.PagedExpandLegacyRequest 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.showcase.v1beta1.PagedExpandLegacyRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.PagedExpandLegacyRequest 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.showcase.v1beta1.PagedExpandLegacyRequest 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 request for the PagedExpandLegacy method.  This is a pattern used by some legacy APIs. New
        +   * APIs should NOT use this pattern, but rather something like PagedExpandRequest which conforms to
        +   * aip.dev/158.
        +   * 
        + * + * Protobuf type {@code google.showcase.v1beta1.PagedExpandLegacyRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.PagedExpandLegacyRequest) + com.google.showcase.v1beta1.PagedExpandLegacyRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.EchoOuterClass + .internal_static_google_showcase_v1beta1_PagedExpandLegacyRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.EchoOuterClass + .internal_static_google_showcase_v1beta1_PagedExpandLegacyRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.PagedExpandLegacyRequest.class, + com.google.showcase.v1beta1.PagedExpandLegacyRequest.Builder.class); + } + + // Construct using com.google.showcase.v1beta1.PagedExpandLegacyRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + content_ = ""; + maxResults_ = 0; + pageToken_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.showcase.v1beta1.EchoOuterClass + .internal_static_google_showcase_v1beta1_PagedExpandLegacyRequest_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.PagedExpandLegacyRequest getDefaultInstanceForType() { + return com.google.showcase.v1beta1.PagedExpandLegacyRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.PagedExpandLegacyRequest build() { + com.google.showcase.v1beta1.PagedExpandLegacyRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.PagedExpandLegacyRequest buildPartial() { + com.google.showcase.v1beta1.PagedExpandLegacyRequest result = + new com.google.showcase.v1beta1.PagedExpandLegacyRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.showcase.v1beta1.PagedExpandLegacyRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.content_ = content_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.maxResults_ = maxResults_; + } + if (((from_bitField0_ & 0x00000004) != 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.showcase.v1beta1.PagedExpandLegacyRequest) { + return mergeFrom((com.google.showcase.v1beta1.PagedExpandLegacyRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.showcase.v1beta1.PagedExpandLegacyRequest other) { + if (other == com.google.showcase.v1beta1.PagedExpandLegacyRequest.getDefaultInstance()) + return this; + if (!other.getContent().isEmpty()) { + content_ = other.content_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.getMaxResults() != 0) { + setMaxResults(other.getMaxResults()); + } + if (!other.getPageToken().isEmpty()) { + pageToken_ = other.pageToken_; + 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: + { + content_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 16: + { + maxResults_ = input.readInt32(); + bitField0_ |= 0x00000002; + break; + } // case 16 + case 26: + { + pageToken_ = 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 content_ = ""; + + /** + * + * + *
        +     * The string to expand.
        +     * 
        + * + * string content = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The content. + */ + public java.lang.String getContent() { + java.lang.Object ref = content_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + content_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
        +     * The string to expand.
        +     * 
        + * + * string content = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for content. + */ + public com.google.protobuf.ByteString getContentBytes() { + java.lang.Object ref = content_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + content_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
        +     * The string to expand.
        +     * 
        + * + * string content = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The content to set. + * @return This builder for chaining. + */ + public Builder setContent(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + content_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
        +     * The string to expand.
        +     * 
        + * + * string content = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearContent() { + content_ = getDefaultInstance().getContent(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
        +     * The string to expand.
        +     * 
        + * + * string content = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for content to set. + * @return This builder for chaining. + */ + public Builder setContentBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + content_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private int maxResults_; + + /** + * + * + *
        +     * The number of words to returned in each page.
        +     * (-- aip.dev/not-precedent: This is a legacy, non-standard pattern that
        +     *     violates aip.dev/158. Ordinarily, this should be page_size. --)
        +     * 
        + * + * int32 max_results = 2; + * + * @return The maxResults. + */ + @java.lang.Override + public int getMaxResults() { + return maxResults_; + } + + /** + * + * + *
        +     * The number of words to returned in each page.
        +     * (-- aip.dev/not-precedent: This is a legacy, non-standard pattern that
        +     *     violates aip.dev/158. Ordinarily, this should be page_size. --)
        +     * 
        + * + * int32 max_results = 2; + * + * @param value The maxResults to set. + * @return This builder for chaining. + */ + public Builder setMaxResults(int value) { + + maxResults_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
        +     * The number of words to returned in each page.
        +     * (-- aip.dev/not-precedent: This is a legacy, non-standard pattern that
        +     *     violates aip.dev/158. Ordinarily, this should be page_size. --)
        +     * 
        + * + * int32 max_results = 2; + * + * @return This builder for chaining. + */ + public Builder clearMaxResults() { + bitField0_ = (bitField0_ & ~0x00000002); + maxResults_ = 0; + onChanged(); + return this; + } + + private java.lang.Object pageToken_ = ""; + + /** + * + * + *
        +     * The position of the page to be returned.
        +     * 
        + * + * string page_token = 3; + * + * @return The pageToken. + */ + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
        +     * The position of the page to be returned.
        +     * 
        + * + * string page_token = 3; + * + * @return The bytes for pageToken. + */ + public com.google.protobuf.ByteString getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
        +     * The position of the page to be returned.
        +     * 
        + * + * string page_token = 3; + * + * @param value The pageToken to set. + * @return This builder for chaining. + */ + public Builder setPageToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + pageToken_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
        +     * The position of the page to be returned.
        +     * 
        + * + * string page_token = 3; + * + * @return This builder for chaining. + */ + public Builder clearPageToken() { + pageToken_ = getDefaultInstance().getPageToken(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + + /** + * + * + *
        +     * The position of the page to be returned.
        +     * 
        + * + * string page_token = 3; + * + * @param value The bytes for pageToken to set. + * @return This builder for chaining. + */ + public Builder setPageTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + pageToken_ = value; + 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.showcase.v1beta1.PagedExpandLegacyRequest) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.PagedExpandLegacyRequest) + private static final com.google.showcase.v1beta1.PagedExpandLegacyRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.PagedExpandLegacyRequest(); + } + + public static com.google.showcase.v1beta1.PagedExpandLegacyRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public PagedExpandLegacyRequest 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.showcase.v1beta1.PagedExpandLegacyRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/PagedExpandLegacyRequestOrBuilder.java b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/PagedExpandLegacyRequestOrBuilder.java new file mode 100644 index 0000000000..f9069c5c2a --- /dev/null +++ b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/PagedExpandLegacyRequestOrBuilder.java @@ -0,0 +1,93 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/echo.proto + +// Protobuf Java Version: 3.25.8 +package com.google.showcase.v1beta1; + +public interface PagedExpandLegacyRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.PagedExpandLegacyRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
        +   * The string to expand.
        +   * 
        + * + * string content = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The content. + */ + java.lang.String getContent(); + + /** + * + * + *
        +   * The string to expand.
        +   * 
        + * + * string content = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for content. + */ + com.google.protobuf.ByteString getContentBytes(); + + /** + * + * + *
        +   * The number of words to returned in each page.
        +   * (-- aip.dev/not-precedent: This is a legacy, non-standard pattern that
        +   *     violates aip.dev/158. Ordinarily, this should be page_size. --)
        +   * 
        + * + * int32 max_results = 2; + * + * @return The maxResults. + */ + int getMaxResults(); + + /** + * + * + *
        +   * The position of the page to be returned.
        +   * 
        + * + * string page_token = 3; + * + * @return The pageToken. + */ + java.lang.String getPageToken(); + + /** + * + * + *
        +   * The position of the page to be returned.
        +   * 
        + * + * string page_token = 3; + * + * @return The bytes for pageToken. + */ + com.google.protobuf.ByteString getPageTokenBytes(); +} diff --git a/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/PagedExpandRequest.java b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/PagedExpandRequest.java new file mode 100644 index 0000000000..8a03a7bd2e --- /dev/null +++ b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/PagedExpandRequest.java @@ -0,0 +1,919 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/echo.proto + +// Protobuf Java Version: 3.25.8 +package com.google.showcase.v1beta1; + +/** + * + * + *
        + * The request for the PagedExpand method.
        + * 
        + * + * Protobuf type {@code google.showcase.v1beta1.PagedExpandRequest} + */ +public final class PagedExpandRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.PagedExpandRequest) + PagedExpandRequestOrBuilder { + private static final long serialVersionUID = 0L; + + // Use PagedExpandRequest.newBuilder() to construct. + private PagedExpandRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private PagedExpandRequest() { + content_ = ""; + pageToken_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new PagedExpandRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.EchoOuterClass + .internal_static_google_showcase_v1beta1_PagedExpandRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.EchoOuterClass + .internal_static_google_showcase_v1beta1_PagedExpandRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.PagedExpandRequest.class, + com.google.showcase.v1beta1.PagedExpandRequest.Builder.class); + } + + public static final int CONTENT_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object content_ = ""; + + /** + * + * + *
        +   * The string to expand.
        +   * 
        + * + * string content = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The content. + */ + @java.lang.Override + public java.lang.String getContent() { + java.lang.Object ref = content_; + 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(); + content_ = s; + return s; + } + } + + /** + * + * + *
        +   * The string to expand.
        +   * 
        + * + * string content = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for content. + */ + @java.lang.Override + public com.google.protobuf.ByteString getContentBytes() { + java.lang.Object ref = content_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + content_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PAGE_SIZE_FIELD_NUMBER = 2; + private int pageSize_ = 0; + + /** + * + * + *
        +   * The number of words to returned in each page.
        +   * 
        + * + * int32 page_size = 2; + * + * @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_ = ""; + + /** + * + * + *
        +   * The position of the page to be returned.
        +   * 
        + * + * string page_token = 3; + * + * @return The pageToken. + */ + @java.lang.Override + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; + } + } + + /** + * + * + *
        +   * The position of the page to be returned.
        +   * 
        + * + * string page_token = 3; + * + * @return The bytes for pageToken. + */ + @java.lang.Override + public com.google.protobuf.ByteString getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(content_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, content_); + } + if (pageSize_ != 0) { + output.writeInt32(2, pageSize_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(pageToken_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, pageToken_); + } + 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(content_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, content_); + } + 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_); + } + 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.showcase.v1beta1.PagedExpandRequest)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.PagedExpandRequest other = + (com.google.showcase.v1beta1.PagedExpandRequest) obj; + + if (!getContent().equals(other.getContent())) 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) + CONTENT_FIELD_NUMBER; + hash = (53 * hash) + getContent().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.showcase.v1beta1.PagedExpandRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.PagedExpandRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.PagedExpandRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.PagedExpandRequest 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.showcase.v1beta1.PagedExpandRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.PagedExpandRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.PagedExpandRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.PagedExpandRequest 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.showcase.v1beta1.PagedExpandRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.PagedExpandRequest 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.showcase.v1beta1.PagedExpandRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.PagedExpandRequest 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.showcase.v1beta1.PagedExpandRequest 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 request for the PagedExpand method.
        +   * 
        + * + * Protobuf type {@code google.showcase.v1beta1.PagedExpandRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.PagedExpandRequest) + com.google.showcase.v1beta1.PagedExpandRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.EchoOuterClass + .internal_static_google_showcase_v1beta1_PagedExpandRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.EchoOuterClass + .internal_static_google_showcase_v1beta1_PagedExpandRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.PagedExpandRequest.class, + com.google.showcase.v1beta1.PagedExpandRequest.Builder.class); + } + + // Construct using com.google.showcase.v1beta1.PagedExpandRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + content_ = ""; + pageSize_ = 0; + pageToken_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.showcase.v1beta1.EchoOuterClass + .internal_static_google_showcase_v1beta1_PagedExpandRequest_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.PagedExpandRequest getDefaultInstanceForType() { + return com.google.showcase.v1beta1.PagedExpandRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.PagedExpandRequest build() { + com.google.showcase.v1beta1.PagedExpandRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.PagedExpandRequest buildPartial() { + com.google.showcase.v1beta1.PagedExpandRequest result = + new com.google.showcase.v1beta1.PagedExpandRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.showcase.v1beta1.PagedExpandRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.content_ = content_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.pageSize_ = pageSize_; + } + if (((from_bitField0_ & 0x00000004) != 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.showcase.v1beta1.PagedExpandRequest) { + return mergeFrom((com.google.showcase.v1beta1.PagedExpandRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.showcase.v1beta1.PagedExpandRequest other) { + if (other == com.google.showcase.v1beta1.PagedExpandRequest.getDefaultInstance()) return this; + if (!other.getContent().isEmpty()) { + content_ = other.content_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.getPageSize() != 0) { + setPageSize(other.getPageSize()); + } + if (!other.getPageToken().isEmpty()) { + pageToken_ = other.pageToken_; + 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: + { + content_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 16: + { + pageSize_ = input.readInt32(); + bitField0_ |= 0x00000002; + break; + } // case 16 + case 26: + { + pageToken_ = 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 content_ = ""; + + /** + * + * + *
        +     * The string to expand.
        +     * 
        + * + * string content = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The content. + */ + public java.lang.String getContent() { + java.lang.Object ref = content_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + content_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
        +     * The string to expand.
        +     * 
        + * + * string content = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for content. + */ + public com.google.protobuf.ByteString getContentBytes() { + java.lang.Object ref = content_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + content_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
        +     * The string to expand.
        +     * 
        + * + * string content = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The content to set. + * @return This builder for chaining. + */ + public Builder setContent(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + content_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
        +     * The string to expand.
        +     * 
        + * + * string content = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearContent() { + content_ = getDefaultInstance().getContent(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
        +     * The string to expand.
        +     * 
        + * + * string content = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for content to set. + * @return This builder for chaining. + */ + public Builder setContentBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + content_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private int pageSize_; + + /** + * + * + *
        +     * The number of words to returned in each page.
        +     * 
        + * + * int32 page_size = 2; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + + /** + * + * + *
        +     * The number of words to returned in each page.
        +     * 
        + * + * int32 page_size = 2; + * + * @param value The pageSize to set. + * @return This builder for chaining. + */ + public Builder setPageSize(int value) { + + pageSize_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
        +     * The number of words to returned in each page.
        +     * 
        + * + * int32 page_size = 2; + * + * @return This builder for chaining. + */ + public Builder clearPageSize() { + bitField0_ = (bitField0_ & ~0x00000002); + pageSize_ = 0; + onChanged(); + return this; + } + + private java.lang.Object pageToken_ = ""; + + /** + * + * + *
        +     * The position of the page to be returned.
        +     * 
        + * + * string page_token = 3; + * + * @return The pageToken. + */ + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
        +     * The position of the page to be returned.
        +     * 
        + * + * string page_token = 3; + * + * @return The bytes for pageToken. + */ + public com.google.protobuf.ByteString getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
        +     * The position of the page to be returned.
        +     * 
        + * + * string page_token = 3; + * + * @param value The pageToken to set. + * @return This builder for chaining. + */ + public Builder setPageToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + pageToken_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
        +     * The position of the page to be returned.
        +     * 
        + * + * string page_token = 3; + * + * @return This builder for chaining. + */ + public Builder clearPageToken() { + pageToken_ = getDefaultInstance().getPageToken(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + + /** + * + * + *
        +     * The position of the page to be returned.
        +     * 
        + * + * string page_token = 3; + * + * @param value The bytes for pageToken to set. + * @return This builder for chaining. + */ + public Builder setPageTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + pageToken_ = value; + 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.showcase.v1beta1.PagedExpandRequest) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.PagedExpandRequest) + private static final com.google.showcase.v1beta1.PagedExpandRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.PagedExpandRequest(); + } + + public static com.google.showcase.v1beta1.PagedExpandRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public PagedExpandRequest 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.showcase.v1beta1.PagedExpandRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/PagedExpandRequestOrBuilder.java b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/PagedExpandRequestOrBuilder.java new file mode 100644 index 0000000000..0f48fc0565 --- /dev/null +++ b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/PagedExpandRequestOrBuilder.java @@ -0,0 +1,91 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/echo.proto + +// Protobuf Java Version: 3.25.8 +package com.google.showcase.v1beta1; + +public interface PagedExpandRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.PagedExpandRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
        +   * The string to expand.
        +   * 
        + * + * string content = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The content. + */ + java.lang.String getContent(); + + /** + * + * + *
        +   * The string to expand.
        +   * 
        + * + * string content = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for content. + */ + com.google.protobuf.ByteString getContentBytes(); + + /** + * + * + *
        +   * The number of words to returned in each page.
        +   * 
        + * + * int32 page_size = 2; + * + * @return The pageSize. + */ + int getPageSize(); + + /** + * + * + *
        +   * The position of the page to be returned.
        +   * 
        + * + * string page_token = 3; + * + * @return The pageToken. + */ + java.lang.String getPageToken(); + + /** + * + * + *
        +   * The position of the page to be returned.
        +   * 
        + * + * string page_token = 3; + * + * @return The bytes for pageToken. + */ + com.google.protobuf.ByteString getPageTokenBytes(); +} diff --git a/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/PagedExpandResponse.java b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/PagedExpandResponse.java new file mode 100644 index 0000000000..1b24f5adaf --- /dev/null +++ b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/PagedExpandResponse.java @@ -0,0 +1,1149 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/echo.proto + +// Protobuf Java Version: 3.25.8 +package com.google.showcase.v1beta1; + +/** + * + * + *
        + * The response for the PagedExpand method.
        + * 
        + * + * Protobuf type {@code google.showcase.v1beta1.PagedExpandResponse} + */ +public final class PagedExpandResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.PagedExpandResponse) + PagedExpandResponseOrBuilder { + private static final long serialVersionUID = 0L; + + // Use PagedExpandResponse.newBuilder() to construct. + private PagedExpandResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private PagedExpandResponse() { + responses_ = java.util.Collections.emptyList(); + nextPageToken_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new PagedExpandResponse(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.EchoOuterClass + .internal_static_google_showcase_v1beta1_PagedExpandResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.EchoOuterClass + .internal_static_google_showcase_v1beta1_PagedExpandResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.PagedExpandResponse.class, + com.google.showcase.v1beta1.PagedExpandResponse.Builder.class); + } + + public static final int RESPONSES_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private java.util.List responses_; + + /** + * + * + *
        +   * The words that were expanded.
        +   * 
        + * + * repeated .google.showcase.v1beta1.EchoResponse responses = 1; + */ + @java.lang.Override + public java.util.List getResponsesList() { + return responses_; + } + + /** + * + * + *
        +   * The words that were expanded.
        +   * 
        + * + * repeated .google.showcase.v1beta1.EchoResponse responses = 1; + */ + @java.lang.Override + public java.util.List + getResponsesOrBuilderList() { + return responses_; + } + + /** + * + * + *
        +   * The words that were expanded.
        +   * 
        + * + * repeated .google.showcase.v1beta1.EchoResponse responses = 1; + */ + @java.lang.Override + public int getResponsesCount() { + return responses_.size(); + } + + /** + * + * + *
        +   * The words that were expanded.
        +   * 
        + * + * repeated .google.showcase.v1beta1.EchoResponse responses = 1; + */ + @java.lang.Override + public com.google.showcase.v1beta1.EchoResponse getResponses(int index) { + return responses_.get(index); + } + + /** + * + * + *
        +   * The words that were expanded.
        +   * 
        + * + * repeated .google.showcase.v1beta1.EchoResponse responses = 1; + */ + @java.lang.Override + public com.google.showcase.v1beta1.EchoResponseOrBuilder getResponsesOrBuilder(int index) { + return responses_.get(index); + } + + public static final int NEXT_PAGE_TOKEN_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object nextPageToken_ = ""; + + /** + * + * + *
        +   * The next page token.
        +   * 
        + * + * 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; + } + } + + /** + * + * + *
        +   * The next page token.
        +   * 
        + * + * 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 < responses_.size(); i++) { + output.writeMessage(1, responses_.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 < responses_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, responses_.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.showcase.v1beta1.PagedExpandResponse)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.PagedExpandResponse other = + (com.google.showcase.v1beta1.PagedExpandResponse) obj; + + if (!getResponsesList().equals(other.getResponsesList())) 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 (getResponsesCount() > 0) { + hash = (37 * hash) + RESPONSES_FIELD_NUMBER; + hash = (53 * hash) + getResponsesList().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.showcase.v1beta1.PagedExpandResponse parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.PagedExpandResponse parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.PagedExpandResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.PagedExpandResponse 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.showcase.v1beta1.PagedExpandResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.PagedExpandResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.PagedExpandResponse parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.PagedExpandResponse 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.showcase.v1beta1.PagedExpandResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.PagedExpandResponse 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.showcase.v1beta1.PagedExpandResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.PagedExpandResponse 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.showcase.v1beta1.PagedExpandResponse 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 for the PagedExpand method.
        +   * 
        + * + * Protobuf type {@code google.showcase.v1beta1.PagedExpandResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.PagedExpandResponse) + com.google.showcase.v1beta1.PagedExpandResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.EchoOuterClass + .internal_static_google_showcase_v1beta1_PagedExpandResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.EchoOuterClass + .internal_static_google_showcase_v1beta1_PagedExpandResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.PagedExpandResponse.class, + com.google.showcase.v1beta1.PagedExpandResponse.Builder.class); + } + + // Construct using com.google.showcase.v1beta1.PagedExpandResponse.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (responsesBuilder_ == null) { + responses_ = java.util.Collections.emptyList(); + } else { + responses_ = null; + responsesBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + nextPageToken_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.showcase.v1beta1.EchoOuterClass + .internal_static_google_showcase_v1beta1_PagedExpandResponse_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.PagedExpandResponse getDefaultInstanceForType() { + return com.google.showcase.v1beta1.PagedExpandResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.PagedExpandResponse build() { + com.google.showcase.v1beta1.PagedExpandResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.PagedExpandResponse buildPartial() { + com.google.showcase.v1beta1.PagedExpandResponse result = + new com.google.showcase.v1beta1.PagedExpandResponse(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields( + com.google.showcase.v1beta1.PagedExpandResponse result) { + if (responsesBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + responses_ = java.util.Collections.unmodifiableList(responses_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.responses_ = responses_; + } else { + result.responses_ = responsesBuilder_.build(); + } + } + + private void buildPartial0(com.google.showcase.v1beta1.PagedExpandResponse 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.showcase.v1beta1.PagedExpandResponse) { + return mergeFrom((com.google.showcase.v1beta1.PagedExpandResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.showcase.v1beta1.PagedExpandResponse other) { + if (other == com.google.showcase.v1beta1.PagedExpandResponse.getDefaultInstance()) + return this; + if (responsesBuilder_ == null) { + if (!other.responses_.isEmpty()) { + if (responses_.isEmpty()) { + responses_ = other.responses_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureResponsesIsMutable(); + responses_.addAll(other.responses_); + } + onChanged(); + } + } else { + if (!other.responses_.isEmpty()) { + if (responsesBuilder_.isEmpty()) { + responsesBuilder_.dispose(); + responsesBuilder_ = null; + responses_ = other.responses_; + bitField0_ = (bitField0_ & ~0x00000001); + responsesBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getResponsesFieldBuilder() + : null; + } else { + responsesBuilder_.addAllMessages(other.responses_); + } + } + } + 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.showcase.v1beta1.EchoResponse m = + input.readMessage( + com.google.showcase.v1beta1.EchoResponse.parser(), extensionRegistry); + if (responsesBuilder_ == null) { + ensureResponsesIsMutable(); + responses_.add(m); + } else { + responsesBuilder_.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 responses_ = + java.util.Collections.emptyList(); + + private void ensureResponsesIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + responses_ = new java.util.ArrayList(responses_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.showcase.v1beta1.EchoResponse, + com.google.showcase.v1beta1.EchoResponse.Builder, + com.google.showcase.v1beta1.EchoResponseOrBuilder> + responsesBuilder_; + + /** + * + * + *
        +     * The words that were expanded.
        +     * 
        + * + * repeated .google.showcase.v1beta1.EchoResponse responses = 1; + */ + public java.util.List getResponsesList() { + if (responsesBuilder_ == null) { + return java.util.Collections.unmodifiableList(responses_); + } else { + return responsesBuilder_.getMessageList(); + } + } + + /** + * + * + *
        +     * The words that were expanded.
        +     * 
        + * + * repeated .google.showcase.v1beta1.EchoResponse responses = 1; + */ + public int getResponsesCount() { + if (responsesBuilder_ == null) { + return responses_.size(); + } else { + return responsesBuilder_.getCount(); + } + } + + /** + * + * + *
        +     * The words that were expanded.
        +     * 
        + * + * repeated .google.showcase.v1beta1.EchoResponse responses = 1; + */ + public com.google.showcase.v1beta1.EchoResponse getResponses(int index) { + if (responsesBuilder_ == null) { + return responses_.get(index); + } else { + return responsesBuilder_.getMessage(index); + } + } + + /** + * + * + *
        +     * The words that were expanded.
        +     * 
        + * + * repeated .google.showcase.v1beta1.EchoResponse responses = 1; + */ + public Builder setResponses(int index, com.google.showcase.v1beta1.EchoResponse value) { + if (responsesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureResponsesIsMutable(); + responses_.set(index, value); + onChanged(); + } else { + responsesBuilder_.setMessage(index, value); + } + return this; + } + + /** + * + * + *
        +     * The words that were expanded.
        +     * 
        + * + * repeated .google.showcase.v1beta1.EchoResponse responses = 1; + */ + public Builder setResponses( + int index, com.google.showcase.v1beta1.EchoResponse.Builder builderForValue) { + if (responsesBuilder_ == null) { + ensureResponsesIsMutable(); + responses_.set(index, builderForValue.build()); + onChanged(); + } else { + responsesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
        +     * The words that were expanded.
        +     * 
        + * + * repeated .google.showcase.v1beta1.EchoResponse responses = 1; + */ + public Builder addResponses(com.google.showcase.v1beta1.EchoResponse value) { + if (responsesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureResponsesIsMutable(); + responses_.add(value); + onChanged(); + } else { + responsesBuilder_.addMessage(value); + } + return this; + } + + /** + * + * + *
        +     * The words that were expanded.
        +     * 
        + * + * repeated .google.showcase.v1beta1.EchoResponse responses = 1; + */ + public Builder addResponses(int index, com.google.showcase.v1beta1.EchoResponse value) { + if (responsesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureResponsesIsMutable(); + responses_.add(index, value); + onChanged(); + } else { + responsesBuilder_.addMessage(index, value); + } + return this; + } + + /** + * + * + *
        +     * The words that were expanded.
        +     * 
        + * + * repeated .google.showcase.v1beta1.EchoResponse responses = 1; + */ + public Builder addResponses(com.google.showcase.v1beta1.EchoResponse.Builder builderForValue) { + if (responsesBuilder_ == null) { + ensureResponsesIsMutable(); + responses_.add(builderForValue.build()); + onChanged(); + } else { + responsesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + + /** + * + * + *
        +     * The words that were expanded.
        +     * 
        + * + * repeated .google.showcase.v1beta1.EchoResponse responses = 1; + */ + public Builder addResponses( + int index, com.google.showcase.v1beta1.EchoResponse.Builder builderForValue) { + if (responsesBuilder_ == null) { + ensureResponsesIsMutable(); + responses_.add(index, builderForValue.build()); + onChanged(); + } else { + responsesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
        +     * The words that were expanded.
        +     * 
        + * + * repeated .google.showcase.v1beta1.EchoResponse responses = 1; + */ + public Builder addAllResponses( + java.lang.Iterable values) { + if (responsesBuilder_ == null) { + ensureResponsesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, responses_); + onChanged(); + } else { + responsesBuilder_.addAllMessages(values); + } + return this; + } + + /** + * + * + *
        +     * The words that were expanded.
        +     * 
        + * + * repeated .google.showcase.v1beta1.EchoResponse responses = 1; + */ + public Builder clearResponses() { + if (responsesBuilder_ == null) { + responses_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + responsesBuilder_.clear(); + } + return this; + } + + /** + * + * + *
        +     * The words that were expanded.
        +     * 
        + * + * repeated .google.showcase.v1beta1.EchoResponse responses = 1; + */ + public Builder removeResponses(int index) { + if (responsesBuilder_ == null) { + ensureResponsesIsMutable(); + responses_.remove(index); + onChanged(); + } else { + responsesBuilder_.remove(index); + } + return this; + } + + /** + * + * + *
        +     * The words that were expanded.
        +     * 
        + * + * repeated .google.showcase.v1beta1.EchoResponse responses = 1; + */ + public com.google.showcase.v1beta1.EchoResponse.Builder getResponsesBuilder(int index) { + return getResponsesFieldBuilder().getBuilder(index); + } + + /** + * + * + *
        +     * The words that were expanded.
        +     * 
        + * + * repeated .google.showcase.v1beta1.EchoResponse responses = 1; + */ + public com.google.showcase.v1beta1.EchoResponseOrBuilder getResponsesOrBuilder(int index) { + if (responsesBuilder_ == null) { + return responses_.get(index); + } else { + return responsesBuilder_.getMessageOrBuilder(index); + } + } + + /** + * + * + *
        +     * The words that were expanded.
        +     * 
        + * + * repeated .google.showcase.v1beta1.EchoResponse responses = 1; + */ + public java.util.List + getResponsesOrBuilderList() { + if (responsesBuilder_ != null) { + return responsesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(responses_); + } + } + + /** + * + * + *
        +     * The words that were expanded.
        +     * 
        + * + * repeated .google.showcase.v1beta1.EchoResponse responses = 1; + */ + public com.google.showcase.v1beta1.EchoResponse.Builder addResponsesBuilder() { + return getResponsesFieldBuilder() + .addBuilder(com.google.showcase.v1beta1.EchoResponse.getDefaultInstance()); + } + + /** + * + * + *
        +     * The words that were expanded.
        +     * 
        + * + * repeated .google.showcase.v1beta1.EchoResponse responses = 1; + */ + public com.google.showcase.v1beta1.EchoResponse.Builder addResponsesBuilder(int index) { + return getResponsesFieldBuilder() + .addBuilder(index, com.google.showcase.v1beta1.EchoResponse.getDefaultInstance()); + } + + /** + * + * + *
        +     * The words that were expanded.
        +     * 
        + * + * repeated .google.showcase.v1beta1.EchoResponse responses = 1; + */ + public java.util.List + getResponsesBuilderList() { + return getResponsesFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.showcase.v1beta1.EchoResponse, + com.google.showcase.v1beta1.EchoResponse.Builder, + com.google.showcase.v1beta1.EchoResponseOrBuilder> + getResponsesFieldBuilder() { + if (responsesBuilder_ == null) { + responsesBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.showcase.v1beta1.EchoResponse, + com.google.showcase.v1beta1.EchoResponse.Builder, + com.google.showcase.v1beta1.EchoResponseOrBuilder>( + responses_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + responses_ = null; + } + return responsesBuilder_; + } + + private java.lang.Object nextPageToken_ = ""; + + /** + * + * + *
        +     * The next page token.
        +     * 
        + * + * 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; + } + } + + /** + * + * + *
        +     * The next page token.
        +     * 
        + * + * 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; + } + } + + /** + * + * + *
        +     * The next page token.
        +     * 
        + * + * 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; + } + + /** + * + * + *
        +     * The next page token.
        +     * 
        + * + * string next_page_token = 2; + * + * @return This builder for chaining. + */ + public Builder clearNextPageToken() { + nextPageToken_ = getDefaultInstance().getNextPageToken(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
        +     * The next page token.
        +     * 
        + * + * 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.showcase.v1beta1.PagedExpandResponse) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.PagedExpandResponse) + private static final com.google.showcase.v1beta1.PagedExpandResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.PagedExpandResponse(); + } + + public static com.google.showcase.v1beta1.PagedExpandResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public PagedExpandResponse 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.showcase.v1beta1.PagedExpandResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/PagedExpandResponseList.java b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/PagedExpandResponseList.java new file mode 100644 index 0000000000..daf42853ef --- /dev/null +++ b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/PagedExpandResponseList.java @@ -0,0 +1,657 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/echo.proto + +// Protobuf Java Version: 3.25.8 +package com.google.showcase.v1beta1; + +/** + * + * + *
        + * A list of words.
        + * 
        + * + * Protobuf type {@code google.showcase.v1beta1.PagedExpandResponseList} + */ +public final class PagedExpandResponseList extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.PagedExpandResponseList) + PagedExpandResponseListOrBuilder { + private static final long serialVersionUID = 0L; + + // Use PagedExpandResponseList.newBuilder() to construct. + private PagedExpandResponseList(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private PagedExpandResponseList() { + words_ = com.google.protobuf.LazyStringArrayList.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new PagedExpandResponseList(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.EchoOuterClass + .internal_static_google_showcase_v1beta1_PagedExpandResponseList_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.EchoOuterClass + .internal_static_google_showcase_v1beta1_PagedExpandResponseList_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.PagedExpandResponseList.class, + com.google.showcase.v1beta1.PagedExpandResponseList.Builder.class); + } + + public static final int WORDS_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private com.google.protobuf.LazyStringArrayList words_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + + /** + * repeated string words = 1; + * + * @return A list containing the words. + */ + public com.google.protobuf.ProtocolStringList getWordsList() { + return words_; + } + + /** + * repeated string words = 1; + * + * @return The count of words. + */ + public int getWordsCount() { + return words_.size(); + } + + /** + * repeated string words = 1; + * + * @param index The index of the element to return. + * @return The words at the given index. + */ + public java.lang.String getWords(int index) { + return words_.get(index); + } + + /** + * repeated string words = 1; + * + * @param index The index of the value to return. + * @return The bytes of the words at the given index. + */ + public com.google.protobuf.ByteString getWordsBytes(int index) { + return words_.getByteString(index); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + for (int i = 0; i < words_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, words_.getRaw(i)); + } + 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 < words_.size(); i++) { + dataSize += computeStringSizeNoTag(words_.getRaw(i)); + } + size += dataSize; + size += 1 * getWordsList().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.showcase.v1beta1.PagedExpandResponseList)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.PagedExpandResponseList other = + (com.google.showcase.v1beta1.PagedExpandResponseList) obj; + + if (!getWordsList().equals(other.getWordsList())) 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 (getWordsCount() > 0) { + hash = (37 * hash) + WORDS_FIELD_NUMBER; + hash = (53 * hash) + getWordsList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.showcase.v1beta1.PagedExpandResponseList parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.PagedExpandResponseList parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.PagedExpandResponseList parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.PagedExpandResponseList 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.showcase.v1beta1.PagedExpandResponseList parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.PagedExpandResponseList parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.PagedExpandResponseList parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.PagedExpandResponseList 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.showcase.v1beta1.PagedExpandResponseList parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.PagedExpandResponseList 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.showcase.v1beta1.PagedExpandResponseList parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.PagedExpandResponseList 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.showcase.v1beta1.PagedExpandResponseList prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
        +   * A list of words.
        +   * 
        + * + * Protobuf type {@code google.showcase.v1beta1.PagedExpandResponseList} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.PagedExpandResponseList) + com.google.showcase.v1beta1.PagedExpandResponseListOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.EchoOuterClass + .internal_static_google_showcase_v1beta1_PagedExpandResponseList_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.EchoOuterClass + .internal_static_google_showcase_v1beta1_PagedExpandResponseList_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.PagedExpandResponseList.class, + com.google.showcase.v1beta1.PagedExpandResponseList.Builder.class); + } + + // Construct using com.google.showcase.v1beta1.PagedExpandResponseList.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + words_ = com.google.protobuf.LazyStringArrayList.emptyList(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.showcase.v1beta1.EchoOuterClass + .internal_static_google_showcase_v1beta1_PagedExpandResponseList_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.PagedExpandResponseList getDefaultInstanceForType() { + return com.google.showcase.v1beta1.PagedExpandResponseList.getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.PagedExpandResponseList build() { + com.google.showcase.v1beta1.PagedExpandResponseList result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.PagedExpandResponseList buildPartial() { + com.google.showcase.v1beta1.PagedExpandResponseList result = + new com.google.showcase.v1beta1.PagedExpandResponseList(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.showcase.v1beta1.PagedExpandResponseList result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + words_.makeImmutable(); + result.words_ = words_; + } + } + + @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.showcase.v1beta1.PagedExpandResponseList) { + return mergeFrom((com.google.showcase.v1beta1.PagedExpandResponseList) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.showcase.v1beta1.PagedExpandResponseList other) { + if (other == com.google.showcase.v1beta1.PagedExpandResponseList.getDefaultInstance()) + return this; + if (!other.words_.isEmpty()) { + if (words_.isEmpty()) { + words_ = other.words_; + bitField0_ |= 0x00000001; + } else { + ensureWordsIsMutable(); + words_.addAll(other.words_); + } + 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: + { + java.lang.String s = input.readStringRequireUtf8(); + ensureWordsIsMutable(); + words_.add(s); + 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 com.google.protobuf.LazyStringArrayList words_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + + private void ensureWordsIsMutable() { + if (!words_.isModifiable()) { + words_ = new com.google.protobuf.LazyStringArrayList(words_); + } + bitField0_ |= 0x00000001; + } + + /** + * repeated string words = 1; + * + * @return A list containing the words. + */ + public com.google.protobuf.ProtocolStringList getWordsList() { + words_.makeImmutable(); + return words_; + } + + /** + * repeated string words = 1; + * + * @return The count of words. + */ + public int getWordsCount() { + return words_.size(); + } + + /** + * repeated string words = 1; + * + * @param index The index of the element to return. + * @return The words at the given index. + */ + public java.lang.String getWords(int index) { + return words_.get(index); + } + + /** + * repeated string words = 1; + * + * @param index The index of the value to return. + * @return The bytes of the words at the given index. + */ + public com.google.protobuf.ByteString getWordsBytes(int index) { + return words_.getByteString(index); + } + + /** + * repeated string words = 1; + * + * @param index The index to set the value at. + * @param value The words to set. + * @return This builder for chaining. + */ + public Builder setWords(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureWordsIsMutable(); + words_.set(index, value); + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * repeated string words = 1; + * + * @param value The words to add. + * @return This builder for chaining. + */ + public Builder addWords(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureWordsIsMutable(); + words_.add(value); + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * repeated string words = 1; + * + * @param values The words to add. + * @return This builder for chaining. + */ + public Builder addAllWords(java.lang.Iterable values) { + ensureWordsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, words_); + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * repeated string words = 1; + * + * @return This builder for chaining. + */ + public Builder clearWords() { + words_ = com.google.protobuf.LazyStringArrayList.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + ; + onChanged(); + return this; + } + + /** + * repeated string words = 1; + * + * @param value The bytes of the words to add. + * @return This builder for chaining. + */ + public Builder addWordsBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureWordsIsMutable(); + words_.add(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.showcase.v1beta1.PagedExpandResponseList) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.PagedExpandResponseList) + private static final com.google.showcase.v1beta1.PagedExpandResponseList DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.PagedExpandResponseList(); + } + + public static com.google.showcase.v1beta1.PagedExpandResponseList getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public PagedExpandResponseList 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.showcase.v1beta1.PagedExpandResponseList getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/PagedExpandResponseListOrBuilder.java b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/PagedExpandResponseListOrBuilder.java new file mode 100644 index 0000000000..7e0c5fc85c --- /dev/null +++ b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/PagedExpandResponseListOrBuilder.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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/echo.proto + +// Protobuf Java Version: 3.25.8 +package com.google.showcase.v1beta1; + +public interface PagedExpandResponseListOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.PagedExpandResponseList) + com.google.protobuf.MessageOrBuilder { + + /** + * repeated string words = 1; + * + * @return A list containing the words. + */ + java.util.List getWordsList(); + + /** + * repeated string words = 1; + * + * @return The count of words. + */ + int getWordsCount(); + + /** + * repeated string words = 1; + * + * @param index The index of the element to return. + * @return The words at the given index. + */ + java.lang.String getWords(int index); + + /** + * repeated string words = 1; + * + * @param index The index of the value to return. + * @return The bytes of the words at the given index. + */ + com.google.protobuf.ByteString getWordsBytes(int index); +} diff --git a/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/PagedExpandResponseOrBuilder.java b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/PagedExpandResponseOrBuilder.java new file mode 100644 index 0000000000..398878774d --- /dev/null +++ b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/PagedExpandResponseOrBuilder.java @@ -0,0 +1,108 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/echo.proto + +// Protobuf Java Version: 3.25.8 +package com.google.showcase.v1beta1; + +public interface PagedExpandResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.PagedExpandResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
        +   * The words that were expanded.
        +   * 
        + * + * repeated .google.showcase.v1beta1.EchoResponse responses = 1; + */ + java.util.List getResponsesList(); + + /** + * + * + *
        +   * The words that were expanded.
        +   * 
        + * + * repeated .google.showcase.v1beta1.EchoResponse responses = 1; + */ + com.google.showcase.v1beta1.EchoResponse getResponses(int index); + + /** + * + * + *
        +   * The words that were expanded.
        +   * 
        + * + * repeated .google.showcase.v1beta1.EchoResponse responses = 1; + */ + int getResponsesCount(); + + /** + * + * + *
        +   * The words that were expanded.
        +   * 
        + * + * repeated .google.showcase.v1beta1.EchoResponse responses = 1; + */ + java.util.List + getResponsesOrBuilderList(); + + /** + * + * + *
        +   * The words that were expanded.
        +   * 
        + * + * repeated .google.showcase.v1beta1.EchoResponse responses = 1; + */ + com.google.showcase.v1beta1.EchoResponseOrBuilder getResponsesOrBuilder(int index); + + /** + * + * + *
        +   * The next page token.
        +   * 
        + * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + java.lang.String getNextPageToken(); + + /** + * + * + *
        +   * The next page token.
        +   * 
        + * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + com.google.protobuf.ByteString getNextPageTokenBytes(); +} diff --git a/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/PoetryError.java b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/PoetryError.java new file mode 100644 index 0000000000..3e59901f48 --- /dev/null +++ b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/PoetryError.java @@ -0,0 +1,594 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/echo.proto + +// Protobuf Java Version: 3.25.8 +package com.google.showcase.v1beta1; + +/** + * + * + *
        + * The custom error detail to be included in the error response from the
        + * FailEchoWithDetails method. Client libraries should be able to
        + * surface this custom error detail.
        + * 
        + * + * Protobuf type {@code google.showcase.v1beta1.PoetryError} + */ +public final class PoetryError extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.PoetryError) + PoetryErrorOrBuilder { + private static final long serialVersionUID = 0L; + + // Use PoetryError.newBuilder() to construct. + private PoetryError(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private PoetryError() { + poem_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new PoetryError(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.EchoOuterClass + .internal_static_google_showcase_v1beta1_PoetryError_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.EchoOuterClass + .internal_static_google_showcase_v1beta1_PoetryError_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.PoetryError.class, + com.google.showcase.v1beta1.PoetryError.Builder.class); + } + + public static final int POEM_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object poem_ = ""; + + /** + * string poem = 1; + * + * @return The poem. + */ + @java.lang.Override + public java.lang.String getPoem() { + java.lang.Object ref = poem_; + 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(); + poem_ = s; + return s; + } + } + + /** + * string poem = 1; + * + * @return The bytes for poem. + */ + @java.lang.Override + public com.google.protobuf.ByteString getPoemBytes() { + java.lang.Object ref = poem_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + poem_ = 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(poem_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, poem_); + } + 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(poem_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, poem_); + } + 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.showcase.v1beta1.PoetryError)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.PoetryError other = (com.google.showcase.v1beta1.PoetryError) obj; + + if (!getPoem().equals(other.getPoem())) 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) + POEM_FIELD_NUMBER; + hash = (53 * hash) + getPoem().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.showcase.v1beta1.PoetryError parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.PoetryError parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.PoetryError parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.PoetryError 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.showcase.v1beta1.PoetryError parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.PoetryError parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.PoetryError parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.PoetryError 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.showcase.v1beta1.PoetryError parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.PoetryError 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.showcase.v1beta1.PoetryError parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.PoetryError 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.showcase.v1beta1.PoetryError 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 custom error detail to be included in the error response from the
        +   * FailEchoWithDetails method. Client libraries should be able to
        +   * surface this custom error detail.
        +   * 
        + * + * Protobuf type {@code google.showcase.v1beta1.PoetryError} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.PoetryError) + com.google.showcase.v1beta1.PoetryErrorOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.EchoOuterClass + .internal_static_google_showcase_v1beta1_PoetryError_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.EchoOuterClass + .internal_static_google_showcase_v1beta1_PoetryError_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.PoetryError.class, + com.google.showcase.v1beta1.PoetryError.Builder.class); + } + + // Construct using com.google.showcase.v1beta1.PoetryError.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + poem_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.showcase.v1beta1.EchoOuterClass + .internal_static_google_showcase_v1beta1_PoetryError_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.PoetryError getDefaultInstanceForType() { + return com.google.showcase.v1beta1.PoetryError.getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.PoetryError build() { + com.google.showcase.v1beta1.PoetryError result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.PoetryError buildPartial() { + com.google.showcase.v1beta1.PoetryError result = + new com.google.showcase.v1beta1.PoetryError(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.showcase.v1beta1.PoetryError result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.poem_ = poem_; + } + } + + @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.showcase.v1beta1.PoetryError) { + return mergeFrom((com.google.showcase.v1beta1.PoetryError) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.showcase.v1beta1.PoetryError other) { + if (other == com.google.showcase.v1beta1.PoetryError.getDefaultInstance()) return this; + if (!other.getPoem().isEmpty()) { + poem_ = other.poem_; + 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: + { + poem_ = 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 poem_ = ""; + + /** + * string poem = 1; + * + * @return The poem. + */ + public java.lang.String getPoem() { + java.lang.Object ref = poem_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + poem_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * string poem = 1; + * + * @return The bytes for poem. + */ + public com.google.protobuf.ByteString getPoemBytes() { + java.lang.Object ref = poem_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + poem_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * string poem = 1; + * + * @param value The poem to set. + * @return This builder for chaining. + */ + public Builder setPoem(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + poem_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * string poem = 1; + * + * @return This builder for chaining. + */ + public Builder clearPoem() { + poem_ = getDefaultInstance().getPoem(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * string poem = 1; + * + * @param value The bytes for poem to set. + * @return This builder for chaining. + */ + public Builder setPoemBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + poem_ = 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.showcase.v1beta1.PoetryError) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.PoetryError) + private static final com.google.showcase.v1beta1.PoetryError DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.PoetryError(); + } + + public static com.google.showcase.v1beta1.PoetryError getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public PoetryError 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.showcase.v1beta1.PoetryError getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/PoetryErrorOrBuilder.java b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/PoetryErrorOrBuilder.java new file mode 100644 index 0000000000..eda8651105 --- /dev/null +++ b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/PoetryErrorOrBuilder.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: schema/google/showcase/v1beta1/echo.proto + +// Protobuf Java Version: 3.25.8 +package com.google.showcase.v1beta1; + +public interface PoetryErrorOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.PoetryError) + com.google.protobuf.MessageOrBuilder { + + /** + * string poem = 1; + * + * @return The poem. + */ + java.lang.String getPoem(); + + /** + * string poem = 1; + * + * @return The bytes for poem. + */ + com.google.protobuf.ByteString getPoemBytes(); +} diff --git a/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ProfileName.java b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ProfileName.java new file mode 100644 index 0000000000..86d11a20a2 --- /dev/null +++ b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ProfileName.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.showcase.v1beta1; + +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +@Generated("by gapic-generator-java") +public class ProfileName implements ResourceName { + private static final PathTemplate USER = + PathTemplate.createWithoutUrlEncoding("users/{user}/profile/blurbs"); + private volatile Map fieldValuesMap; + private final String user; + + @Deprecated + protected ProfileName() { + user = null; + } + + private ProfileName(Builder builder) { + user = Preconditions.checkNotNull(builder.getUser()); + } + + public String getUser() { + return user; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + public static ProfileName of(String user) { + return newBuilder().setUser(user).build(); + } + + public static String format(String user) { + return newBuilder().setUser(user).build().toString(); + } + + public static ProfileName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + USER.validatedMatch( + formattedString, "ProfileName.parse: formattedString not in valid format"); + return of(matchMap.get("user")); + } + + 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 (ProfileName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return USER.matches(formattedString); + } + + @Override + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + if (user != null) { + fieldMapBuilder.put("user", user); + } + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return USER.instantiate("user", user); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o != null && getClass() == o.getClass()) { + ProfileName that = ((ProfileName) o); + return Objects.equals(this.user, that.user); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= Objects.hashCode(user); + return h; + } + + /** Builder for users/{user}/profile/blurbs. */ + public static class Builder { + private String user; + + protected Builder() {} + + public String getUser() { + return user; + } + + public Builder setUser(String user) { + this.user = user; + return this; + } + + private Builder(ProfileName profileName) { + this.user = profileName.user; + } + + public ProfileName build() { + return new ProfileName(this); + } + } +} diff --git a/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/RepeatRequest.java b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/RepeatRequest.java new file mode 100644 index 0000000000..a757c870c5 --- /dev/null +++ b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/RepeatRequest.java @@ -0,0 +1,1653 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/compliance.proto + +// Protobuf Java Version: 3.25.8 +package com.google.showcase.v1beta1; + +/** Protobuf type {@code google.showcase.v1beta1.RepeatRequest} */ +public final class RepeatRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.RepeatRequest) + RepeatRequestOrBuilder { + private static final long serialVersionUID = 0L; + + // Use RepeatRequest.newBuilder() to construct. + private RepeatRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private RepeatRequest() { + name_ = ""; + intendedBindingUri_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new RepeatRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.ComplianceOuterClass + .internal_static_google_showcase_v1beta1_RepeatRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.ComplianceOuterClass + .internal_static_google_showcase_v1beta1_RepeatRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.RepeatRequest.class, + com.google.showcase.v1beta1.RepeatRequest.Builder.class); + } + + private int bitField0_; + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + + /** + * 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; + } + } + + /** + * 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 INFO_FIELD_NUMBER = 2; + private com.google.showcase.v1beta1.ComplianceData info_; + + /** + * .google.showcase.v1beta1.ComplianceData info = 2; + * + * @return Whether the info field is set. + */ + @java.lang.Override + public boolean hasInfo() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * .google.showcase.v1beta1.ComplianceData info = 2; + * + * @return The info. + */ + @java.lang.Override + public com.google.showcase.v1beta1.ComplianceData getInfo() { + return info_ == null ? com.google.showcase.v1beta1.ComplianceData.getDefaultInstance() : info_; + } + + /** .google.showcase.v1beta1.ComplianceData info = 2; */ + @java.lang.Override + public com.google.showcase.v1beta1.ComplianceDataOrBuilder getInfoOrBuilder() { + return info_ == null ? com.google.showcase.v1beta1.ComplianceData.getDefaultInstance() : info_; + } + + public static final int SERVER_VERIFY_FIELD_NUMBER = 3; + private boolean serverVerify_ = false; + + /** + * + * + *
        +   * If true, the server will verify that the received request matches
        +   * the request with the same name in the compliance test suite.
        +   * 
        + * + * bool server_verify = 3; + * + * @return The serverVerify. + */ + @java.lang.Override + public boolean getServerVerify() { + return serverVerify_; + } + + public static final int INTENDED_BINDING_URI_FIELD_NUMBER = 10; + + @SuppressWarnings("serial") + private volatile java.lang.Object intendedBindingUri_ = ""; + + /** + * + * + *
        +   * The URI template this request is expected to be bound to server-side.
        +   * 
        + * + * optional string intended_binding_uri = 10; + * + * @return Whether the intendedBindingUri field is set. + */ + @java.lang.Override + public boolean hasIntendedBindingUri() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
        +   * The URI template this request is expected to be bound to server-side.
        +   * 
        + * + * optional string intended_binding_uri = 10; + * + * @return The intendedBindingUri. + */ + @java.lang.Override + public java.lang.String getIntendedBindingUri() { + java.lang.Object ref = intendedBindingUri_; + 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(); + intendedBindingUri_ = s; + return s; + } + } + + /** + * + * + *
        +   * The URI template this request is expected to be bound to server-side.
        +   * 
        + * + * optional string intended_binding_uri = 10; + * + * @return The bytes for intendedBindingUri. + */ + @java.lang.Override + public com.google.protobuf.ByteString getIntendedBindingUriBytes() { + java.lang.Object ref = intendedBindingUri_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + intendedBindingUri_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int F_INT32_FIELD_NUMBER = 4; + private int fInt32_ = 0; + + /** + * + * + *
        +   * Some top level fields, to test that these are encoded correctly
        +   * in query params.
        +   * 
        + * + * int32 f_int32 = 4; + * + * @return The fInt32. + */ + @java.lang.Override + public int getFInt32() { + return fInt32_; + } + + public static final int F_INT64_FIELD_NUMBER = 5; + private long fInt64_ = 0L; + + /** + * int64 f_int64 = 5; + * + * @return The fInt64. + */ + @java.lang.Override + public long getFInt64() { + return fInt64_; + } + + public static final int F_DOUBLE_FIELD_NUMBER = 6; + private double fDouble_ = 0D; + + /** + * double f_double = 6; + * + * @return The fDouble. + */ + @java.lang.Override + public double getFDouble() { + return fDouble_; + } + + public static final int P_INT32_FIELD_NUMBER = 7; + private int pInt32_ = 0; + + /** + * optional int32 p_int32 = 7; + * + * @return Whether the pInt32 field is set. + */ + @java.lang.Override + public boolean hasPInt32() { + return ((bitField0_ & 0x00000004) != 0); + } + + /** + * optional int32 p_int32 = 7; + * + * @return The pInt32. + */ + @java.lang.Override + public int getPInt32() { + return pInt32_; + } + + public static final int P_INT64_FIELD_NUMBER = 8; + private long pInt64_ = 0L; + + /** + * optional int64 p_int64 = 8; + * + * @return Whether the pInt64 field is set. + */ + @java.lang.Override + public boolean hasPInt64() { + return ((bitField0_ & 0x00000008) != 0); + } + + /** + * optional int64 p_int64 = 8; + * + * @return The pInt64. + */ + @java.lang.Override + public long getPInt64() { + return pInt64_; + } + + public static final int P_DOUBLE_FIELD_NUMBER = 9; + private double pDouble_ = 0D; + + /** + * optional double p_double = 9; + * + * @return Whether the pDouble field is set. + */ + @java.lang.Override + public boolean hasPDouble() { + return ((bitField0_ & 0x00000010) != 0); + } + + /** + * optional double p_double = 9; + * + * @return The pDouble. + */ + @java.lang.Override + public double getPDouble() { + return pDouble_; + } + + 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, getInfo()); + } + if (serverVerify_ != false) { + output.writeBool(3, serverVerify_); + } + if (fInt32_ != 0) { + output.writeInt32(4, fInt32_); + } + if (fInt64_ != 0L) { + output.writeInt64(5, fInt64_); + } + if (java.lang.Double.doubleToRawLongBits(fDouble_) != 0) { + output.writeDouble(6, fDouble_); + } + if (((bitField0_ & 0x00000004) != 0)) { + output.writeInt32(7, pInt32_); + } + if (((bitField0_ & 0x00000008) != 0)) { + output.writeInt64(8, pInt64_); + } + if (((bitField0_ & 0x00000010) != 0)) { + output.writeDouble(9, pDouble_); + } + if (((bitField0_ & 0x00000002) != 0)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 10, intendedBindingUri_); + } + 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, getInfo()); + } + if (serverVerify_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(3, serverVerify_); + } + if (fInt32_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(4, fInt32_); + } + if (fInt64_ != 0L) { + size += com.google.protobuf.CodedOutputStream.computeInt64Size(5, fInt64_); + } + if (java.lang.Double.doubleToRawLongBits(fDouble_) != 0) { + size += com.google.protobuf.CodedOutputStream.computeDoubleSize(6, fDouble_); + } + if (((bitField0_ & 0x00000004) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(7, pInt32_); + } + if (((bitField0_ & 0x00000008) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeInt64Size(8, pInt64_); + } + if (((bitField0_ & 0x00000010) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeDoubleSize(9, pDouble_); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(10, intendedBindingUri_); + } + 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.showcase.v1beta1.RepeatRequest)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.RepeatRequest other = + (com.google.showcase.v1beta1.RepeatRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (hasInfo() != other.hasInfo()) return false; + if (hasInfo()) { + if (!getInfo().equals(other.getInfo())) return false; + } + if (getServerVerify() != other.getServerVerify()) return false; + if (hasIntendedBindingUri() != other.hasIntendedBindingUri()) return false; + if (hasIntendedBindingUri()) { + if (!getIntendedBindingUri().equals(other.getIntendedBindingUri())) return false; + } + if (getFInt32() != other.getFInt32()) return false; + if (getFInt64() != other.getFInt64()) return false; + if (java.lang.Double.doubleToLongBits(getFDouble()) + != java.lang.Double.doubleToLongBits(other.getFDouble())) return false; + if (hasPInt32() != other.hasPInt32()) return false; + if (hasPInt32()) { + if (getPInt32() != other.getPInt32()) return false; + } + if (hasPInt64() != other.hasPInt64()) return false; + if (hasPInt64()) { + if (getPInt64() != other.getPInt64()) return false; + } + if (hasPDouble() != other.hasPDouble()) return false; + if (hasPDouble()) { + if (java.lang.Double.doubleToLongBits(getPDouble()) + != java.lang.Double.doubleToLongBits(other.getPDouble())) 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 (hasInfo()) { + hash = (37 * hash) + INFO_FIELD_NUMBER; + hash = (53 * hash) + getInfo().hashCode(); + } + hash = (37 * hash) + SERVER_VERIFY_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getServerVerify()); + if (hasIntendedBindingUri()) { + hash = (37 * hash) + INTENDED_BINDING_URI_FIELD_NUMBER; + hash = (53 * hash) + getIntendedBindingUri().hashCode(); + } + hash = (37 * hash) + F_INT32_FIELD_NUMBER; + hash = (53 * hash) + getFInt32(); + hash = (37 * hash) + F_INT64_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getFInt64()); + hash = (37 * hash) + F_DOUBLE_FIELD_NUMBER; + hash = + (53 * hash) + + com.google.protobuf.Internal.hashLong( + java.lang.Double.doubleToLongBits(getFDouble())); + if (hasPInt32()) { + hash = (37 * hash) + P_INT32_FIELD_NUMBER; + hash = (53 * hash) + getPInt32(); + } + if (hasPInt64()) { + hash = (37 * hash) + P_INT64_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getPInt64()); + } + if (hasPDouble()) { + hash = (37 * hash) + P_DOUBLE_FIELD_NUMBER; + hash = + (53 * hash) + + com.google.protobuf.Internal.hashLong( + java.lang.Double.doubleToLongBits(getPDouble())); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.showcase.v1beta1.RepeatRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.RepeatRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.RepeatRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.RepeatRequest 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.showcase.v1beta1.RepeatRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.RepeatRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.RepeatRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.RepeatRequest 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.showcase.v1beta1.RepeatRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.RepeatRequest 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.showcase.v1beta1.RepeatRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.RepeatRequest 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.showcase.v1beta1.RepeatRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** Protobuf type {@code google.showcase.v1beta1.RepeatRequest} */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.RepeatRequest) + com.google.showcase.v1beta1.RepeatRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.ComplianceOuterClass + .internal_static_google_showcase_v1beta1_RepeatRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.ComplianceOuterClass + .internal_static_google_showcase_v1beta1_RepeatRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.RepeatRequest.class, + com.google.showcase.v1beta1.RepeatRequest.Builder.class); + } + + // Construct using com.google.showcase.v1beta1.RepeatRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getInfoFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + info_ = null; + if (infoBuilder_ != null) { + infoBuilder_.dispose(); + infoBuilder_ = null; + } + serverVerify_ = false; + intendedBindingUri_ = ""; + fInt32_ = 0; + fInt64_ = 0L; + fDouble_ = 0D; + pInt32_ = 0; + pInt64_ = 0L; + pDouble_ = 0D; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.showcase.v1beta1.ComplianceOuterClass + .internal_static_google_showcase_v1beta1_RepeatRequest_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.RepeatRequest getDefaultInstanceForType() { + return com.google.showcase.v1beta1.RepeatRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.RepeatRequest build() { + com.google.showcase.v1beta1.RepeatRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.RepeatRequest buildPartial() { + com.google.showcase.v1beta1.RepeatRequest result = + new com.google.showcase.v1beta1.RepeatRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.showcase.v1beta1.RepeatRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.info_ = infoBuilder_ == null ? info_ : infoBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.serverVerify_ = serverVerify_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.intendedBindingUri_ = intendedBindingUri_; + to_bitField0_ |= 0x00000002; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.fInt32_ = fInt32_; + } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.fInt64_ = fInt64_; + } + if (((from_bitField0_ & 0x00000040) != 0)) { + result.fDouble_ = fDouble_; + } + if (((from_bitField0_ & 0x00000080) != 0)) { + result.pInt32_ = pInt32_; + to_bitField0_ |= 0x00000004; + } + if (((from_bitField0_ & 0x00000100) != 0)) { + result.pInt64_ = pInt64_; + to_bitField0_ |= 0x00000008; + } + if (((from_bitField0_ & 0x00000200) != 0)) { + result.pDouble_ = pDouble_; + to_bitField0_ |= 0x00000010; + } + 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.showcase.v1beta1.RepeatRequest) { + return mergeFrom((com.google.showcase.v1beta1.RepeatRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.showcase.v1beta1.RepeatRequest other) { + if (other == com.google.showcase.v1beta1.RepeatRequest.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.hasInfo()) { + mergeInfo(other.getInfo()); + } + if (other.getServerVerify() != false) { + setServerVerify(other.getServerVerify()); + } + if (other.hasIntendedBindingUri()) { + intendedBindingUri_ = other.intendedBindingUri_; + bitField0_ |= 0x00000008; + onChanged(); + } + if (other.getFInt32() != 0) { + setFInt32(other.getFInt32()); + } + if (other.getFInt64() != 0L) { + setFInt64(other.getFInt64()); + } + if (other.getFDouble() != 0D) { + setFDouble(other.getFDouble()); + } + if (other.hasPInt32()) { + setPInt32(other.getPInt32()); + } + if (other.hasPInt64()) { + setPInt64(other.getPInt64()); + } + if (other.hasPDouble()) { + setPDouble(other.getPDouble()); + } + 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(getInfoFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 24: + { + serverVerify_ = input.readBool(); + bitField0_ |= 0x00000004; + break; + } // case 24 + case 32: + { + fInt32_ = input.readInt32(); + bitField0_ |= 0x00000010; + break; + } // case 32 + case 40: + { + fInt64_ = input.readInt64(); + bitField0_ |= 0x00000020; + break; + } // case 40 + case 49: + { + fDouble_ = input.readDouble(); + bitField0_ |= 0x00000040; + break; + } // case 49 + case 56: + { + pInt32_ = input.readInt32(); + bitField0_ |= 0x00000080; + break; + } // case 56 + case 64: + { + pInt64_ = input.readInt64(); + bitField0_ |= 0x00000100; + break; + } // case 64 + case 73: + { + pDouble_ = input.readDouble(); + bitField0_ |= 0x00000200; + break; + } // case 73 + case 82: + { + intendedBindingUri_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000008; + break; + } // case 82 + 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_ = ""; + + /** + * 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; + } + } + + /** + * 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; + } + } + + /** + * 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; + } + + /** + * string name = 1; + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * 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 com.google.showcase.v1beta1.ComplianceData info_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.showcase.v1beta1.ComplianceData, + com.google.showcase.v1beta1.ComplianceData.Builder, + com.google.showcase.v1beta1.ComplianceDataOrBuilder> + infoBuilder_; + + /** + * .google.showcase.v1beta1.ComplianceData info = 2; + * + * @return Whether the info field is set. + */ + public boolean hasInfo() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * .google.showcase.v1beta1.ComplianceData info = 2; + * + * @return The info. + */ + public com.google.showcase.v1beta1.ComplianceData getInfo() { + if (infoBuilder_ == null) { + return info_ == null + ? com.google.showcase.v1beta1.ComplianceData.getDefaultInstance() + : info_; + } else { + return infoBuilder_.getMessage(); + } + } + + /** .google.showcase.v1beta1.ComplianceData info = 2; */ + public Builder setInfo(com.google.showcase.v1beta1.ComplianceData value) { + if (infoBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + info_ = value; + } else { + infoBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** .google.showcase.v1beta1.ComplianceData info = 2; */ + public Builder setInfo(com.google.showcase.v1beta1.ComplianceData.Builder builderForValue) { + if (infoBuilder_ == null) { + info_ = builderForValue.build(); + } else { + infoBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** .google.showcase.v1beta1.ComplianceData info = 2; */ + public Builder mergeInfo(com.google.showcase.v1beta1.ComplianceData value) { + if (infoBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && info_ != null + && info_ != com.google.showcase.v1beta1.ComplianceData.getDefaultInstance()) { + getInfoBuilder().mergeFrom(value); + } else { + info_ = value; + } + } else { + infoBuilder_.mergeFrom(value); + } + if (info_ != null) { + bitField0_ |= 0x00000002; + onChanged(); + } + return this; + } + + /** .google.showcase.v1beta1.ComplianceData info = 2; */ + public Builder clearInfo() { + bitField0_ = (bitField0_ & ~0x00000002); + info_ = null; + if (infoBuilder_ != null) { + infoBuilder_.dispose(); + infoBuilder_ = null; + } + onChanged(); + return this; + } + + /** .google.showcase.v1beta1.ComplianceData info = 2; */ + public com.google.showcase.v1beta1.ComplianceData.Builder getInfoBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return getInfoFieldBuilder().getBuilder(); + } + + /** .google.showcase.v1beta1.ComplianceData info = 2; */ + public com.google.showcase.v1beta1.ComplianceDataOrBuilder getInfoOrBuilder() { + if (infoBuilder_ != null) { + return infoBuilder_.getMessageOrBuilder(); + } else { + return info_ == null + ? com.google.showcase.v1beta1.ComplianceData.getDefaultInstance() + : info_; + } + } + + /** .google.showcase.v1beta1.ComplianceData info = 2; */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.showcase.v1beta1.ComplianceData, + com.google.showcase.v1beta1.ComplianceData.Builder, + com.google.showcase.v1beta1.ComplianceDataOrBuilder> + getInfoFieldBuilder() { + if (infoBuilder_ == null) { + infoBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.showcase.v1beta1.ComplianceData, + com.google.showcase.v1beta1.ComplianceData.Builder, + com.google.showcase.v1beta1.ComplianceDataOrBuilder>( + getInfo(), getParentForChildren(), isClean()); + info_ = null; + } + return infoBuilder_; + } + + private boolean serverVerify_; + + /** + * + * + *
        +     * If true, the server will verify that the received request matches
        +     * the request with the same name in the compliance test suite.
        +     * 
        + * + * bool server_verify = 3; + * + * @return The serverVerify. + */ + @java.lang.Override + public boolean getServerVerify() { + return serverVerify_; + } + + /** + * + * + *
        +     * If true, the server will verify that the received request matches
        +     * the request with the same name in the compliance test suite.
        +     * 
        + * + * bool server_verify = 3; + * + * @param value The serverVerify to set. + * @return This builder for chaining. + */ + public Builder setServerVerify(boolean value) { + + serverVerify_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
        +     * If true, the server will verify that the received request matches
        +     * the request with the same name in the compliance test suite.
        +     * 
        + * + * bool server_verify = 3; + * + * @return This builder for chaining. + */ + public Builder clearServerVerify() { + bitField0_ = (bitField0_ & ~0x00000004); + serverVerify_ = false; + onChanged(); + return this; + } + + private java.lang.Object intendedBindingUri_ = ""; + + /** + * + * + *
        +     * The URI template this request is expected to be bound to server-side.
        +     * 
        + * + * optional string intended_binding_uri = 10; + * + * @return Whether the intendedBindingUri field is set. + */ + public boolean hasIntendedBindingUri() { + return ((bitField0_ & 0x00000008) != 0); + } + + /** + * + * + *
        +     * The URI template this request is expected to be bound to server-side.
        +     * 
        + * + * optional string intended_binding_uri = 10; + * + * @return The intendedBindingUri. + */ + public java.lang.String getIntendedBindingUri() { + java.lang.Object ref = intendedBindingUri_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + intendedBindingUri_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
        +     * The URI template this request is expected to be bound to server-side.
        +     * 
        + * + * optional string intended_binding_uri = 10; + * + * @return The bytes for intendedBindingUri. + */ + public com.google.protobuf.ByteString getIntendedBindingUriBytes() { + java.lang.Object ref = intendedBindingUri_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + intendedBindingUri_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
        +     * The URI template this request is expected to be bound to server-side.
        +     * 
        + * + * optional string intended_binding_uri = 10; + * + * @param value The intendedBindingUri to set. + * @return This builder for chaining. + */ + public Builder setIntendedBindingUri(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + intendedBindingUri_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + /** + * + * + *
        +     * The URI template this request is expected to be bound to server-side.
        +     * 
        + * + * optional string intended_binding_uri = 10; + * + * @return This builder for chaining. + */ + public Builder clearIntendedBindingUri() { + intendedBindingUri_ = getDefaultInstance().getIntendedBindingUri(); + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + return this; + } + + /** + * + * + *
        +     * The URI template this request is expected to be bound to server-side.
        +     * 
        + * + * optional string intended_binding_uri = 10; + * + * @param value The bytes for intendedBindingUri to set. + * @return This builder for chaining. + */ + public Builder setIntendedBindingUriBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + intendedBindingUri_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + private int fInt32_; + + /** + * + * + *
        +     * Some top level fields, to test that these are encoded correctly
        +     * in query params.
        +     * 
        + * + * int32 f_int32 = 4; + * + * @return The fInt32. + */ + @java.lang.Override + public int getFInt32() { + return fInt32_; + } + + /** + * + * + *
        +     * Some top level fields, to test that these are encoded correctly
        +     * in query params.
        +     * 
        + * + * int32 f_int32 = 4; + * + * @param value The fInt32 to set. + * @return This builder for chaining. + */ + public Builder setFInt32(int value) { + + fInt32_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + /** + * + * + *
        +     * Some top level fields, to test that these are encoded correctly
        +     * in query params.
        +     * 
        + * + * int32 f_int32 = 4; + * + * @return This builder for chaining. + */ + public Builder clearFInt32() { + bitField0_ = (bitField0_ & ~0x00000010); + fInt32_ = 0; + onChanged(); + return this; + } + + private long fInt64_; + + /** + * int64 f_int64 = 5; + * + * @return The fInt64. + */ + @java.lang.Override + public long getFInt64() { + return fInt64_; + } + + /** + * int64 f_int64 = 5; + * + * @param value The fInt64 to set. + * @return This builder for chaining. + */ + public Builder setFInt64(long value) { + + fInt64_ = value; + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + + /** + * int64 f_int64 = 5; + * + * @return This builder for chaining. + */ + public Builder clearFInt64() { + bitField0_ = (bitField0_ & ~0x00000020); + fInt64_ = 0L; + onChanged(); + return this; + } + + private double fDouble_; + + /** + * double f_double = 6; + * + * @return The fDouble. + */ + @java.lang.Override + public double getFDouble() { + return fDouble_; + } + + /** + * double f_double = 6; + * + * @param value The fDouble to set. + * @return This builder for chaining. + */ + public Builder setFDouble(double value) { + + fDouble_ = value; + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + + /** + * double f_double = 6; + * + * @return This builder for chaining. + */ + public Builder clearFDouble() { + bitField0_ = (bitField0_ & ~0x00000040); + fDouble_ = 0D; + onChanged(); + return this; + } + + private int pInt32_; + + /** + * optional int32 p_int32 = 7; + * + * @return Whether the pInt32 field is set. + */ + @java.lang.Override + public boolean hasPInt32() { + return ((bitField0_ & 0x00000080) != 0); + } + + /** + * optional int32 p_int32 = 7; + * + * @return The pInt32. + */ + @java.lang.Override + public int getPInt32() { + return pInt32_; + } + + /** + * optional int32 p_int32 = 7; + * + * @param value The pInt32 to set. + * @return This builder for chaining. + */ + public Builder setPInt32(int value) { + + pInt32_ = value; + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + + /** + * optional int32 p_int32 = 7; + * + * @return This builder for chaining. + */ + public Builder clearPInt32() { + bitField0_ = (bitField0_ & ~0x00000080); + pInt32_ = 0; + onChanged(); + return this; + } + + private long pInt64_; + + /** + * optional int64 p_int64 = 8; + * + * @return Whether the pInt64 field is set. + */ + @java.lang.Override + public boolean hasPInt64() { + return ((bitField0_ & 0x00000100) != 0); + } + + /** + * optional int64 p_int64 = 8; + * + * @return The pInt64. + */ + @java.lang.Override + public long getPInt64() { + return pInt64_; + } + + /** + * optional int64 p_int64 = 8; + * + * @param value The pInt64 to set. + * @return This builder for chaining. + */ + public Builder setPInt64(long value) { + + pInt64_ = value; + bitField0_ |= 0x00000100; + onChanged(); + return this; + } + + /** + * optional int64 p_int64 = 8; + * + * @return This builder for chaining. + */ + public Builder clearPInt64() { + bitField0_ = (bitField0_ & ~0x00000100); + pInt64_ = 0L; + onChanged(); + return this; + } + + private double pDouble_; + + /** + * optional double p_double = 9; + * + * @return Whether the pDouble field is set. + */ + @java.lang.Override + public boolean hasPDouble() { + return ((bitField0_ & 0x00000200) != 0); + } + + /** + * optional double p_double = 9; + * + * @return The pDouble. + */ + @java.lang.Override + public double getPDouble() { + return pDouble_; + } + + /** + * optional double p_double = 9; + * + * @param value The pDouble to set. + * @return This builder for chaining. + */ + public Builder setPDouble(double value) { + + pDouble_ = value; + bitField0_ |= 0x00000200; + onChanged(); + return this; + } + + /** + * optional double p_double = 9; + * + * @return This builder for chaining. + */ + public Builder clearPDouble() { + bitField0_ = (bitField0_ & ~0x00000200); + pDouble_ = 0D; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.showcase.v1beta1.RepeatRequest) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.RepeatRequest) + private static final com.google.showcase.v1beta1.RepeatRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.RepeatRequest(); + } + + public static com.google.showcase.v1beta1.RepeatRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public RepeatRequest 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.showcase.v1beta1.RepeatRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/RepeatRequestOrBuilder.java b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/RepeatRequestOrBuilder.java new file mode 100644 index 0000000000..77bde23495 --- /dev/null +++ b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/RepeatRequestOrBuilder.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: schema/google/showcase/v1beta1/compliance.proto + +// Protobuf Java Version: 3.25.8 +package com.google.showcase.v1beta1; + +public interface RepeatRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.RepeatRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * string name = 1; + * + * @return The name. + */ + java.lang.String getName(); + + /** + * string name = 1; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * .google.showcase.v1beta1.ComplianceData info = 2; + * + * @return Whether the info field is set. + */ + boolean hasInfo(); + + /** + * .google.showcase.v1beta1.ComplianceData info = 2; + * + * @return The info. + */ + com.google.showcase.v1beta1.ComplianceData getInfo(); + + /** .google.showcase.v1beta1.ComplianceData info = 2; */ + com.google.showcase.v1beta1.ComplianceDataOrBuilder getInfoOrBuilder(); + + /** + * + * + *
        +   * If true, the server will verify that the received request matches
        +   * the request with the same name in the compliance test suite.
        +   * 
        + * + * bool server_verify = 3; + * + * @return The serverVerify. + */ + boolean getServerVerify(); + + /** + * + * + *
        +   * The URI template this request is expected to be bound to server-side.
        +   * 
        + * + * optional string intended_binding_uri = 10; + * + * @return Whether the intendedBindingUri field is set. + */ + boolean hasIntendedBindingUri(); + + /** + * + * + *
        +   * The URI template this request is expected to be bound to server-side.
        +   * 
        + * + * optional string intended_binding_uri = 10; + * + * @return The intendedBindingUri. + */ + java.lang.String getIntendedBindingUri(); + + /** + * + * + *
        +   * The URI template this request is expected to be bound to server-side.
        +   * 
        + * + * optional string intended_binding_uri = 10; + * + * @return The bytes for intendedBindingUri. + */ + com.google.protobuf.ByteString getIntendedBindingUriBytes(); + + /** + * + * + *
        +   * Some top level fields, to test that these are encoded correctly
        +   * in query params.
        +   * 
        + * + * int32 f_int32 = 4; + * + * @return The fInt32. + */ + int getFInt32(); + + /** + * int64 f_int64 = 5; + * + * @return The fInt64. + */ + long getFInt64(); + + /** + * double f_double = 6; + * + * @return The fDouble. + */ + double getFDouble(); + + /** + * optional int32 p_int32 = 7; + * + * @return Whether the pInt32 field is set. + */ + boolean hasPInt32(); + + /** + * optional int32 p_int32 = 7; + * + * @return The pInt32. + */ + int getPInt32(); + + /** + * optional int64 p_int64 = 8; + * + * @return Whether the pInt64 field is set. + */ + boolean hasPInt64(); + + /** + * optional int64 p_int64 = 8; + * + * @return The pInt64. + */ + long getPInt64(); + + /** + * optional double p_double = 9; + * + * @return Whether the pDouble field is set. + */ + boolean hasPDouble(); + + /** + * optional double p_double = 9; + * + * @return The pDouble. + */ + double getPDouble(); +} diff --git a/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/RepeatResponse.java b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/RepeatResponse.java new file mode 100644 index 0000000000..f84b5e2fb2 --- /dev/null +++ b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/RepeatResponse.java @@ -0,0 +1,820 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/compliance.proto + +// Protobuf Java Version: 3.25.8 +package com.google.showcase.v1beta1; + +/** Protobuf type {@code google.showcase.v1beta1.RepeatResponse} */ +public final class RepeatResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.RepeatResponse) + RepeatResponseOrBuilder { + private static final long serialVersionUID = 0L; + + // Use RepeatResponse.newBuilder() to construct. + private RepeatResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private RepeatResponse() { + bindingUri_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new RepeatResponse(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.ComplianceOuterClass + .internal_static_google_showcase_v1beta1_RepeatResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.ComplianceOuterClass + .internal_static_google_showcase_v1beta1_RepeatResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.RepeatResponse.class, + com.google.showcase.v1beta1.RepeatResponse.Builder.class); + } + + private int bitField0_; + public static final int REQUEST_FIELD_NUMBER = 1; + private com.google.showcase.v1beta1.RepeatRequest request_; + + /** + * .google.showcase.v1beta1.RepeatRequest request = 1; + * + * @return Whether the request field is set. + */ + @java.lang.Override + public boolean hasRequest() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * .google.showcase.v1beta1.RepeatRequest request = 1; + * + * @return The request. + */ + @java.lang.Override + public com.google.showcase.v1beta1.RepeatRequest getRequest() { + return request_ == null + ? com.google.showcase.v1beta1.RepeatRequest.getDefaultInstance() + : request_; + } + + /** .google.showcase.v1beta1.RepeatRequest request = 1; */ + @java.lang.Override + public com.google.showcase.v1beta1.RepeatRequestOrBuilder getRequestOrBuilder() { + return request_ == null + ? com.google.showcase.v1beta1.RepeatRequest.getDefaultInstance() + : request_; + } + + public static final int BINDING_URI_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object bindingUri_ = ""; + + /** + * + * + *
        +   * The URI template the request was bound to server-side.
        +   * 
        + * + * string binding_uri = 2; + * + * @return The bindingUri. + */ + @java.lang.Override + public java.lang.String getBindingUri() { + java.lang.Object ref = bindingUri_; + 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(); + bindingUri_ = s; + return s; + } + } + + /** + * + * + *
        +   * The URI template the request was bound to server-side.
        +   * 
        + * + * string binding_uri = 2; + * + * @return The bytes for bindingUri. + */ + @java.lang.Override + public com.google.protobuf.ByteString getBindingUriBytes() { + java.lang.Object ref = bindingUri_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + bindingUri_ = 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, getRequest()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(bindingUri_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, bindingUri_); + } + 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, getRequest()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(bindingUri_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, bindingUri_); + } + 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.showcase.v1beta1.RepeatResponse)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.RepeatResponse other = + (com.google.showcase.v1beta1.RepeatResponse) obj; + + if (hasRequest() != other.hasRequest()) return false; + if (hasRequest()) { + if (!getRequest().equals(other.getRequest())) return false; + } + if (!getBindingUri().equals(other.getBindingUri())) 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 (hasRequest()) { + hash = (37 * hash) + REQUEST_FIELD_NUMBER; + hash = (53 * hash) + getRequest().hashCode(); + } + hash = (37 * hash) + BINDING_URI_FIELD_NUMBER; + hash = (53 * hash) + getBindingUri().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.showcase.v1beta1.RepeatResponse parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.RepeatResponse parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.RepeatResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.RepeatResponse 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.showcase.v1beta1.RepeatResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.RepeatResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.RepeatResponse parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.RepeatResponse 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.showcase.v1beta1.RepeatResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.RepeatResponse 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.showcase.v1beta1.RepeatResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.RepeatResponse 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.showcase.v1beta1.RepeatResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** Protobuf type {@code google.showcase.v1beta1.RepeatResponse} */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.RepeatResponse) + com.google.showcase.v1beta1.RepeatResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.ComplianceOuterClass + .internal_static_google_showcase_v1beta1_RepeatResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.ComplianceOuterClass + .internal_static_google_showcase_v1beta1_RepeatResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.RepeatResponse.class, + com.google.showcase.v1beta1.RepeatResponse.Builder.class); + } + + // Construct using com.google.showcase.v1beta1.RepeatResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getRequestFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + request_ = null; + if (requestBuilder_ != null) { + requestBuilder_.dispose(); + requestBuilder_ = null; + } + bindingUri_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.showcase.v1beta1.ComplianceOuterClass + .internal_static_google_showcase_v1beta1_RepeatResponse_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.RepeatResponse getDefaultInstanceForType() { + return com.google.showcase.v1beta1.RepeatResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.RepeatResponse build() { + com.google.showcase.v1beta1.RepeatResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.RepeatResponse buildPartial() { + com.google.showcase.v1beta1.RepeatResponse result = + new com.google.showcase.v1beta1.RepeatResponse(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.showcase.v1beta1.RepeatResponse result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.request_ = requestBuilder_ == null ? request_ : requestBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.bindingUri_ = bindingUri_; + } + 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.showcase.v1beta1.RepeatResponse) { + return mergeFrom((com.google.showcase.v1beta1.RepeatResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.showcase.v1beta1.RepeatResponse other) { + if (other == com.google.showcase.v1beta1.RepeatResponse.getDefaultInstance()) return this; + if (other.hasRequest()) { + mergeRequest(other.getRequest()); + } + if (!other.getBindingUri().isEmpty()) { + bindingUri_ = other.bindingUri_; + 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: + { + input.readMessage(getRequestFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + bindingUri_ = 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 com.google.showcase.v1beta1.RepeatRequest request_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.showcase.v1beta1.RepeatRequest, + com.google.showcase.v1beta1.RepeatRequest.Builder, + com.google.showcase.v1beta1.RepeatRequestOrBuilder> + requestBuilder_; + + /** + * .google.showcase.v1beta1.RepeatRequest request = 1; + * + * @return Whether the request field is set. + */ + public boolean hasRequest() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * .google.showcase.v1beta1.RepeatRequest request = 1; + * + * @return The request. + */ + public com.google.showcase.v1beta1.RepeatRequest getRequest() { + if (requestBuilder_ == null) { + return request_ == null + ? com.google.showcase.v1beta1.RepeatRequest.getDefaultInstance() + : request_; + } else { + return requestBuilder_.getMessage(); + } + } + + /** .google.showcase.v1beta1.RepeatRequest request = 1; */ + public Builder setRequest(com.google.showcase.v1beta1.RepeatRequest value) { + if (requestBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + request_ = value; + } else { + requestBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** .google.showcase.v1beta1.RepeatRequest request = 1; */ + public Builder setRequest(com.google.showcase.v1beta1.RepeatRequest.Builder builderForValue) { + if (requestBuilder_ == null) { + request_ = builderForValue.build(); + } else { + requestBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** .google.showcase.v1beta1.RepeatRequest request = 1; */ + public Builder mergeRequest(com.google.showcase.v1beta1.RepeatRequest value) { + if (requestBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) + && request_ != null + && request_ != com.google.showcase.v1beta1.RepeatRequest.getDefaultInstance()) { + getRequestBuilder().mergeFrom(value); + } else { + request_ = value; + } + } else { + requestBuilder_.mergeFrom(value); + } + if (request_ != null) { + bitField0_ |= 0x00000001; + onChanged(); + } + return this; + } + + /** .google.showcase.v1beta1.RepeatRequest request = 1; */ + public Builder clearRequest() { + bitField0_ = (bitField0_ & ~0x00000001); + request_ = null; + if (requestBuilder_ != null) { + requestBuilder_.dispose(); + requestBuilder_ = null; + } + onChanged(); + return this; + } + + /** .google.showcase.v1beta1.RepeatRequest request = 1; */ + public com.google.showcase.v1beta1.RepeatRequest.Builder getRequestBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return getRequestFieldBuilder().getBuilder(); + } + + /** .google.showcase.v1beta1.RepeatRequest request = 1; */ + public com.google.showcase.v1beta1.RepeatRequestOrBuilder getRequestOrBuilder() { + if (requestBuilder_ != null) { + return requestBuilder_.getMessageOrBuilder(); + } else { + return request_ == null + ? com.google.showcase.v1beta1.RepeatRequest.getDefaultInstance() + : request_; + } + } + + /** .google.showcase.v1beta1.RepeatRequest request = 1; */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.showcase.v1beta1.RepeatRequest, + com.google.showcase.v1beta1.RepeatRequest.Builder, + com.google.showcase.v1beta1.RepeatRequestOrBuilder> + getRequestFieldBuilder() { + if (requestBuilder_ == null) { + requestBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.showcase.v1beta1.RepeatRequest, + com.google.showcase.v1beta1.RepeatRequest.Builder, + com.google.showcase.v1beta1.RepeatRequestOrBuilder>( + getRequest(), getParentForChildren(), isClean()); + request_ = null; + } + return requestBuilder_; + } + + private java.lang.Object bindingUri_ = ""; + + /** + * + * + *
        +     * The URI template the request was bound to server-side.
        +     * 
        + * + * string binding_uri = 2; + * + * @return The bindingUri. + */ + public java.lang.String getBindingUri() { + java.lang.Object ref = bindingUri_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + bindingUri_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
        +     * The URI template the request was bound to server-side.
        +     * 
        + * + * string binding_uri = 2; + * + * @return The bytes for bindingUri. + */ + public com.google.protobuf.ByteString getBindingUriBytes() { + java.lang.Object ref = bindingUri_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + bindingUri_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
        +     * The URI template the request was bound to server-side.
        +     * 
        + * + * string binding_uri = 2; + * + * @param value The bindingUri to set. + * @return This builder for chaining. + */ + public Builder setBindingUri(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + bindingUri_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
        +     * The URI template the request was bound to server-side.
        +     * 
        + * + * string binding_uri = 2; + * + * @return This builder for chaining. + */ + public Builder clearBindingUri() { + bindingUri_ = getDefaultInstance().getBindingUri(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
        +     * The URI template the request was bound to server-side.
        +     * 
        + * + * string binding_uri = 2; + * + * @param value The bytes for bindingUri to set. + * @return This builder for chaining. + */ + public Builder setBindingUriBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + bindingUri_ = 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.showcase.v1beta1.RepeatResponse) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.RepeatResponse) + private static final com.google.showcase.v1beta1.RepeatResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.RepeatResponse(); + } + + public static com.google.showcase.v1beta1.RepeatResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public RepeatResponse 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.showcase.v1beta1.RepeatResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/RepeatResponseOrBuilder.java b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/RepeatResponseOrBuilder.java new file mode 100644 index 0000000000..91566806cf --- /dev/null +++ b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/RepeatResponseOrBuilder.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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/compliance.proto + +// Protobuf Java Version: 3.25.8 +package com.google.showcase.v1beta1; + +public interface RepeatResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.RepeatResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * .google.showcase.v1beta1.RepeatRequest request = 1; + * + * @return Whether the request field is set. + */ + boolean hasRequest(); + + /** + * .google.showcase.v1beta1.RepeatRequest request = 1; + * + * @return The request. + */ + com.google.showcase.v1beta1.RepeatRequest getRequest(); + + /** .google.showcase.v1beta1.RepeatRequest request = 1; */ + com.google.showcase.v1beta1.RepeatRequestOrBuilder getRequestOrBuilder(); + + /** + * + * + *
        +   * The URI template the request was bound to server-side.
        +   * 
        + * + * string binding_uri = 2; + * + * @return The bindingUri. + */ + java.lang.String getBindingUri(); + + /** + * + * + *
        +   * The URI template the request was bound to server-side.
        +   * 
        + * + * string binding_uri = 2; + * + * @return The bytes for bindingUri. + */ + com.google.protobuf.ByteString getBindingUriBytes(); +} diff --git a/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ReportSessionRequest.java b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ReportSessionRequest.java new file mode 100644 index 0000000000..85557289e1 --- /dev/null +++ b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ReportSessionRequest.java @@ -0,0 +1,634 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/testing.proto + +// Protobuf Java Version: 3.25.8 +package com.google.showcase.v1beta1; + +/** + * + * + *
        + * Request message for reporting on a session.
        + * 
        + * + * Protobuf type {@code google.showcase.v1beta1.ReportSessionRequest} + */ +public final class ReportSessionRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.ReportSessionRequest) + ReportSessionRequestOrBuilder { + private static final long serialVersionUID = 0L; + + // Use ReportSessionRequest.newBuilder() to construct. + private ReportSessionRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ReportSessionRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ReportSessionRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.TestingOuterClass + .internal_static_google_showcase_v1beta1_ReportSessionRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.TestingOuterClass + .internal_static_google_showcase_v1beta1_ReportSessionRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.ReportSessionRequest.class, + com.google.showcase.v1beta1.ReportSessionRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + + /** + * + * + *
        +   * The session to be reported on.
        +   * 
        + * + * string name = 1 [(.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; + } + } + + /** + * + * + *
        +   * The session to be reported on.
        +   * 
        + * + * string name = 1 [(.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.showcase.v1beta1.ReportSessionRequest)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.ReportSessionRequest other = + (com.google.showcase.v1beta1.ReportSessionRequest) 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.showcase.v1beta1.ReportSessionRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.ReportSessionRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.ReportSessionRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.ReportSessionRequest 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.showcase.v1beta1.ReportSessionRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.ReportSessionRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.ReportSessionRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.ReportSessionRequest 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.showcase.v1beta1.ReportSessionRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.ReportSessionRequest 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.showcase.v1beta1.ReportSessionRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.ReportSessionRequest 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.showcase.v1beta1.ReportSessionRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
        +   * Request message for reporting on a session.
        +   * 
        + * + * Protobuf type {@code google.showcase.v1beta1.ReportSessionRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.ReportSessionRequest) + com.google.showcase.v1beta1.ReportSessionRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.TestingOuterClass + .internal_static_google_showcase_v1beta1_ReportSessionRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.TestingOuterClass + .internal_static_google_showcase_v1beta1_ReportSessionRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.ReportSessionRequest.class, + com.google.showcase.v1beta1.ReportSessionRequest.Builder.class); + } + + // Construct using com.google.showcase.v1beta1.ReportSessionRequest.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.showcase.v1beta1.TestingOuterClass + .internal_static_google_showcase_v1beta1_ReportSessionRequest_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.ReportSessionRequest getDefaultInstanceForType() { + return com.google.showcase.v1beta1.ReportSessionRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.ReportSessionRequest build() { + com.google.showcase.v1beta1.ReportSessionRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.ReportSessionRequest buildPartial() { + com.google.showcase.v1beta1.ReportSessionRequest result = + new com.google.showcase.v1beta1.ReportSessionRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.showcase.v1beta1.ReportSessionRequest 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.showcase.v1beta1.ReportSessionRequest) { + return mergeFrom((com.google.showcase.v1beta1.ReportSessionRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.showcase.v1beta1.ReportSessionRequest other) { + if (other == com.google.showcase.v1beta1.ReportSessionRequest.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_ = ""; + + /** + * + * + *
        +     * The session to be reported on.
        +     * 
        + * + * string name = 1 [(.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; + } + } + + /** + * + * + *
        +     * The session to be reported on.
        +     * 
        + * + * string name = 1 [(.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; + } + } + + /** + * + * + *
        +     * The session to be reported on.
        +     * 
        + * + * string name = 1 [(.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; + } + + /** + * + * + *
        +     * The session to be reported on.
        +     * 
        + * + * string name = 1 [(.google.api.resource_reference) = { ... } + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
        +     * The session to be reported on.
        +     * 
        + * + * string name = 1 [(.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.showcase.v1beta1.ReportSessionRequest) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.ReportSessionRequest) + private static final com.google.showcase.v1beta1.ReportSessionRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.ReportSessionRequest(); + } + + public static com.google.showcase.v1beta1.ReportSessionRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ReportSessionRequest 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.showcase.v1beta1.ReportSessionRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ReportSessionRequestOrBuilder.java b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ReportSessionRequestOrBuilder.java new file mode 100644 index 0000000000..b5407ccf05 --- /dev/null +++ b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ReportSessionRequestOrBuilder.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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/testing.proto + +// Protobuf Java Version: 3.25.8 +package com.google.showcase.v1beta1; + +public interface ReportSessionRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.ReportSessionRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
        +   * The session to be reported on.
        +   * 
        + * + * string name = 1 [(.google.api.resource_reference) = { ... } + * + * @return The name. + */ + java.lang.String getName(); + + /** + * + * + *
        +   * The session to be reported on.
        +   * 
        + * + * string name = 1 [(.google.api.resource_reference) = { ... } + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); +} diff --git a/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ReportSessionResponse.java b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ReportSessionResponse.java new file mode 100644 index 0000000000..afb092d408 --- /dev/null +++ b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ReportSessionResponse.java @@ -0,0 +1,1290 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/testing.proto + +// Protobuf Java Version: 3.25.8 +package com.google.showcase.v1beta1; + +/** + * + * + *
        + * Response message for reporting on a session.
        + * 
        + * + * Protobuf type {@code google.showcase.v1beta1.ReportSessionResponse} + */ +public final class ReportSessionResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.ReportSessionResponse) + ReportSessionResponseOrBuilder { + private static final long serialVersionUID = 0L; + + // Use ReportSessionResponse.newBuilder() to construct. + private ReportSessionResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ReportSessionResponse() { + result_ = 0; + testRuns_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ReportSessionResponse(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.TestingOuterClass + .internal_static_google_showcase_v1beta1_ReportSessionResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.TestingOuterClass + .internal_static_google_showcase_v1beta1_ReportSessionResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.ReportSessionResponse.class, + com.google.showcase.v1beta1.ReportSessionResponse.Builder.class); + } + + /** + * + * + *
        +   * The topline state of the report.
        +   * 
        + * + * Protobuf enum {@code google.showcase.v1beta1.ReportSessionResponse.Result} + */ + public enum Result implements com.google.protobuf.ProtocolMessageEnum { + /** RESULT_UNSPECIFIED = 0; */ + RESULT_UNSPECIFIED(0), + /** + * + * + *
        +     * The session is complete, and everything passed.
        +     * 
        + * + * PASSED = 1; + */ + PASSED(1), + /** + * + * + *
        +     * The session had an explicit failure.
        +     * 
        + * + * FAILED = 2; + */ + FAILED(2), + /** + * + * + *
        +     * The session is incomplete. This is a failure response.
        +     * 
        + * + * INCOMPLETE = 3; + */ + INCOMPLETE(3), + UNRECOGNIZED(-1), + ; + + /** RESULT_UNSPECIFIED = 0; */ + public static final int RESULT_UNSPECIFIED_VALUE = 0; + + /** + * + * + *
        +     * The session is complete, and everything passed.
        +     * 
        + * + * PASSED = 1; + */ + public static final int PASSED_VALUE = 1; + + /** + * + * + *
        +     * The session had an explicit failure.
        +     * 
        + * + * FAILED = 2; + */ + public static final int FAILED_VALUE = 2; + + /** + * + * + *
        +     * The session is incomplete. This is a failure response.
        +     * 
        + * + * INCOMPLETE = 3; + */ + public static final int INCOMPLETE_VALUE = 3; + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static Result 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 Result forNumber(int value) { + switch (value) { + case 0: + return RESULT_UNSPECIFIED; + case 1: + return PASSED; + case 2: + return FAILED; + case 3: + return INCOMPLETE; + 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 Result findValueByNumber(int number) { + return Result.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.showcase.v1beta1.ReportSessionResponse.getDescriptor() + .getEnumTypes() + .get(0); + } + + private static final Result[] VALUES = values(); + + public static Result 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 Result(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.showcase.v1beta1.ReportSessionResponse.Result) + } + + public static final int RESULT_FIELD_NUMBER = 1; + private int result_ = 0; + + /** + * + * + *
        +   * The state of the report.
        +   * 
        + * + * .google.showcase.v1beta1.ReportSessionResponse.Result result = 1; + * + * @return The enum numeric value on the wire for result. + */ + @java.lang.Override + public int getResultValue() { + return result_; + } + + /** + * + * + *
        +   * The state of the report.
        +   * 
        + * + * .google.showcase.v1beta1.ReportSessionResponse.Result result = 1; + * + * @return The result. + */ + @java.lang.Override + public com.google.showcase.v1beta1.ReportSessionResponse.Result getResult() { + com.google.showcase.v1beta1.ReportSessionResponse.Result result = + com.google.showcase.v1beta1.ReportSessionResponse.Result.forNumber(result_); + return result == null + ? com.google.showcase.v1beta1.ReportSessionResponse.Result.UNRECOGNIZED + : result; + } + + public static final int TEST_RUNS_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private java.util.List testRuns_; + + /** + * + * + *
        +   * The test runs of this session.
        +   * 
        + * + * repeated .google.showcase.v1beta1.TestRun test_runs = 2; + */ + @java.lang.Override + public java.util.List getTestRunsList() { + return testRuns_; + } + + /** + * + * + *
        +   * The test runs of this session.
        +   * 
        + * + * repeated .google.showcase.v1beta1.TestRun test_runs = 2; + */ + @java.lang.Override + public java.util.List + getTestRunsOrBuilderList() { + return testRuns_; + } + + /** + * + * + *
        +   * The test runs of this session.
        +   * 
        + * + * repeated .google.showcase.v1beta1.TestRun test_runs = 2; + */ + @java.lang.Override + public int getTestRunsCount() { + return testRuns_.size(); + } + + /** + * + * + *
        +   * The test runs of this session.
        +   * 
        + * + * repeated .google.showcase.v1beta1.TestRun test_runs = 2; + */ + @java.lang.Override + public com.google.showcase.v1beta1.TestRun getTestRuns(int index) { + return testRuns_.get(index); + } + + /** + * + * + *
        +   * The test runs of this session.
        +   * 
        + * + * repeated .google.showcase.v1beta1.TestRun test_runs = 2; + */ + @java.lang.Override + public com.google.showcase.v1beta1.TestRunOrBuilder getTestRunsOrBuilder(int index) { + return testRuns_.get(index); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (result_ + != com.google.showcase.v1beta1.ReportSessionResponse.Result.RESULT_UNSPECIFIED + .getNumber()) { + output.writeEnum(1, result_); + } + for (int i = 0; i < testRuns_.size(); i++) { + output.writeMessage(2, testRuns_.get(i)); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (result_ + != com.google.showcase.v1beta1.ReportSessionResponse.Result.RESULT_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(1, result_); + } + for (int i = 0; i < testRuns_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, testRuns_.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.showcase.v1beta1.ReportSessionResponse)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.ReportSessionResponse other = + (com.google.showcase.v1beta1.ReportSessionResponse) obj; + + if (result_ != other.result_) return false; + if (!getTestRunsList().equals(other.getTestRunsList())) 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) + RESULT_FIELD_NUMBER; + hash = (53 * hash) + result_; + if (getTestRunsCount() > 0) { + hash = (37 * hash) + TEST_RUNS_FIELD_NUMBER; + hash = (53 * hash) + getTestRunsList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.showcase.v1beta1.ReportSessionResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.ReportSessionResponse parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.ReportSessionResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.ReportSessionResponse 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.showcase.v1beta1.ReportSessionResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.ReportSessionResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.ReportSessionResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.ReportSessionResponse 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.showcase.v1beta1.ReportSessionResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.ReportSessionResponse 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.showcase.v1beta1.ReportSessionResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.ReportSessionResponse 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.showcase.v1beta1.ReportSessionResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
        +   * Response message for reporting on a session.
        +   * 
        + * + * Protobuf type {@code google.showcase.v1beta1.ReportSessionResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.ReportSessionResponse) + com.google.showcase.v1beta1.ReportSessionResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.TestingOuterClass + .internal_static_google_showcase_v1beta1_ReportSessionResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.TestingOuterClass + .internal_static_google_showcase_v1beta1_ReportSessionResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.ReportSessionResponse.class, + com.google.showcase.v1beta1.ReportSessionResponse.Builder.class); + } + + // Construct using com.google.showcase.v1beta1.ReportSessionResponse.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + result_ = 0; + if (testRunsBuilder_ == null) { + testRuns_ = java.util.Collections.emptyList(); + } else { + testRuns_ = null; + testRunsBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000002); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.showcase.v1beta1.TestingOuterClass + .internal_static_google_showcase_v1beta1_ReportSessionResponse_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.ReportSessionResponse getDefaultInstanceForType() { + return com.google.showcase.v1beta1.ReportSessionResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.ReportSessionResponse build() { + com.google.showcase.v1beta1.ReportSessionResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.ReportSessionResponse buildPartial() { + com.google.showcase.v1beta1.ReportSessionResponse result = + new com.google.showcase.v1beta1.ReportSessionResponse(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields( + com.google.showcase.v1beta1.ReportSessionResponse result) { + if (testRunsBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0)) { + testRuns_ = java.util.Collections.unmodifiableList(testRuns_); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.testRuns_ = testRuns_; + } else { + result.testRuns_ = testRunsBuilder_.build(); + } + } + + private void buildPartial0(com.google.showcase.v1beta1.ReportSessionResponse result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.result_ = 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.showcase.v1beta1.ReportSessionResponse) { + return mergeFrom((com.google.showcase.v1beta1.ReportSessionResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.showcase.v1beta1.ReportSessionResponse other) { + if (other == com.google.showcase.v1beta1.ReportSessionResponse.getDefaultInstance()) + return this; + if (other.result_ != 0) { + setResultValue(other.getResultValue()); + } + if (testRunsBuilder_ == null) { + if (!other.testRuns_.isEmpty()) { + if (testRuns_.isEmpty()) { + testRuns_ = other.testRuns_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureTestRunsIsMutable(); + testRuns_.addAll(other.testRuns_); + } + onChanged(); + } + } else { + if (!other.testRuns_.isEmpty()) { + if (testRunsBuilder_.isEmpty()) { + testRunsBuilder_.dispose(); + testRunsBuilder_ = null; + testRuns_ = other.testRuns_; + bitField0_ = (bitField0_ & ~0x00000002); + testRunsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getTestRunsFieldBuilder() + : null; + } else { + testRunsBuilder_.addAllMessages(other.testRuns_); + } + } + } + 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: + { + result_ = input.readEnum(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 18: + { + com.google.showcase.v1beta1.TestRun m = + input.readMessage( + com.google.showcase.v1beta1.TestRun.parser(), extensionRegistry); + if (testRunsBuilder_ == null) { + ensureTestRunsIsMutable(); + testRuns_.add(m); + } else { + testRunsBuilder_.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 int result_ = 0; + + /** + * + * + *
        +     * The state of the report.
        +     * 
        + * + * .google.showcase.v1beta1.ReportSessionResponse.Result result = 1; + * + * @return The enum numeric value on the wire for result. + */ + @java.lang.Override + public int getResultValue() { + return result_; + } + + /** + * + * + *
        +     * The state of the report.
        +     * 
        + * + * .google.showcase.v1beta1.ReportSessionResponse.Result result = 1; + * + * @param value The enum numeric value on the wire for result to set. + * @return This builder for chaining. + */ + public Builder setResultValue(int value) { + result_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
        +     * The state of the report.
        +     * 
        + * + * .google.showcase.v1beta1.ReportSessionResponse.Result result = 1; + * + * @return The result. + */ + @java.lang.Override + public com.google.showcase.v1beta1.ReportSessionResponse.Result getResult() { + com.google.showcase.v1beta1.ReportSessionResponse.Result result = + com.google.showcase.v1beta1.ReportSessionResponse.Result.forNumber(result_); + return result == null + ? com.google.showcase.v1beta1.ReportSessionResponse.Result.UNRECOGNIZED + : result; + } + + /** + * + * + *
        +     * The state of the report.
        +     * 
        + * + * .google.showcase.v1beta1.ReportSessionResponse.Result result = 1; + * + * @param value The result to set. + * @return This builder for chaining. + */ + public Builder setResult(com.google.showcase.v1beta1.ReportSessionResponse.Result value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000001; + result_ = value.getNumber(); + onChanged(); + return this; + } + + /** + * + * + *
        +     * The state of the report.
        +     * 
        + * + * .google.showcase.v1beta1.ReportSessionResponse.Result result = 1; + * + * @return This builder for chaining. + */ + public Builder clearResult() { + bitField0_ = (bitField0_ & ~0x00000001); + result_ = 0; + onChanged(); + return this; + } + + private java.util.List testRuns_ = + java.util.Collections.emptyList(); + + private void ensureTestRunsIsMutable() { + if (!((bitField0_ & 0x00000002) != 0)) { + testRuns_ = new java.util.ArrayList(testRuns_); + bitField0_ |= 0x00000002; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.showcase.v1beta1.TestRun, + com.google.showcase.v1beta1.TestRun.Builder, + com.google.showcase.v1beta1.TestRunOrBuilder> + testRunsBuilder_; + + /** + * + * + *
        +     * The test runs of this session.
        +     * 
        + * + * repeated .google.showcase.v1beta1.TestRun test_runs = 2; + */ + public java.util.List getTestRunsList() { + if (testRunsBuilder_ == null) { + return java.util.Collections.unmodifiableList(testRuns_); + } else { + return testRunsBuilder_.getMessageList(); + } + } + + /** + * + * + *
        +     * The test runs of this session.
        +     * 
        + * + * repeated .google.showcase.v1beta1.TestRun test_runs = 2; + */ + public int getTestRunsCount() { + if (testRunsBuilder_ == null) { + return testRuns_.size(); + } else { + return testRunsBuilder_.getCount(); + } + } + + /** + * + * + *
        +     * The test runs of this session.
        +     * 
        + * + * repeated .google.showcase.v1beta1.TestRun test_runs = 2; + */ + public com.google.showcase.v1beta1.TestRun getTestRuns(int index) { + if (testRunsBuilder_ == null) { + return testRuns_.get(index); + } else { + return testRunsBuilder_.getMessage(index); + } + } + + /** + * + * + *
        +     * The test runs of this session.
        +     * 
        + * + * repeated .google.showcase.v1beta1.TestRun test_runs = 2; + */ + public Builder setTestRuns(int index, com.google.showcase.v1beta1.TestRun value) { + if (testRunsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureTestRunsIsMutable(); + testRuns_.set(index, value); + onChanged(); + } else { + testRunsBuilder_.setMessage(index, value); + } + return this; + } + + /** + * + * + *
        +     * The test runs of this session.
        +     * 
        + * + * repeated .google.showcase.v1beta1.TestRun test_runs = 2; + */ + public Builder setTestRuns( + int index, com.google.showcase.v1beta1.TestRun.Builder builderForValue) { + if (testRunsBuilder_ == null) { + ensureTestRunsIsMutable(); + testRuns_.set(index, builderForValue.build()); + onChanged(); + } else { + testRunsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
        +     * The test runs of this session.
        +     * 
        + * + * repeated .google.showcase.v1beta1.TestRun test_runs = 2; + */ + public Builder addTestRuns(com.google.showcase.v1beta1.TestRun value) { + if (testRunsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureTestRunsIsMutable(); + testRuns_.add(value); + onChanged(); + } else { + testRunsBuilder_.addMessage(value); + } + return this; + } + + /** + * + * + *
        +     * The test runs of this session.
        +     * 
        + * + * repeated .google.showcase.v1beta1.TestRun test_runs = 2; + */ + public Builder addTestRuns(int index, com.google.showcase.v1beta1.TestRun value) { + if (testRunsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureTestRunsIsMutable(); + testRuns_.add(index, value); + onChanged(); + } else { + testRunsBuilder_.addMessage(index, value); + } + return this; + } + + /** + * + * + *
        +     * The test runs of this session.
        +     * 
        + * + * repeated .google.showcase.v1beta1.TestRun test_runs = 2; + */ + public Builder addTestRuns(com.google.showcase.v1beta1.TestRun.Builder builderForValue) { + if (testRunsBuilder_ == null) { + ensureTestRunsIsMutable(); + testRuns_.add(builderForValue.build()); + onChanged(); + } else { + testRunsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + + /** + * + * + *
        +     * The test runs of this session.
        +     * 
        + * + * repeated .google.showcase.v1beta1.TestRun test_runs = 2; + */ + public Builder addTestRuns( + int index, com.google.showcase.v1beta1.TestRun.Builder builderForValue) { + if (testRunsBuilder_ == null) { + ensureTestRunsIsMutable(); + testRuns_.add(index, builderForValue.build()); + onChanged(); + } else { + testRunsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
        +     * The test runs of this session.
        +     * 
        + * + * repeated .google.showcase.v1beta1.TestRun test_runs = 2; + */ + public Builder addAllTestRuns( + java.lang.Iterable values) { + if (testRunsBuilder_ == null) { + ensureTestRunsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, testRuns_); + onChanged(); + } else { + testRunsBuilder_.addAllMessages(values); + } + return this; + } + + /** + * + * + *
        +     * The test runs of this session.
        +     * 
        + * + * repeated .google.showcase.v1beta1.TestRun test_runs = 2; + */ + public Builder clearTestRuns() { + if (testRunsBuilder_ == null) { + testRuns_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + } else { + testRunsBuilder_.clear(); + } + return this; + } + + /** + * + * + *
        +     * The test runs of this session.
        +     * 
        + * + * repeated .google.showcase.v1beta1.TestRun test_runs = 2; + */ + public Builder removeTestRuns(int index) { + if (testRunsBuilder_ == null) { + ensureTestRunsIsMutable(); + testRuns_.remove(index); + onChanged(); + } else { + testRunsBuilder_.remove(index); + } + return this; + } + + /** + * + * + *
        +     * The test runs of this session.
        +     * 
        + * + * repeated .google.showcase.v1beta1.TestRun test_runs = 2; + */ + public com.google.showcase.v1beta1.TestRun.Builder getTestRunsBuilder(int index) { + return getTestRunsFieldBuilder().getBuilder(index); + } + + /** + * + * + *
        +     * The test runs of this session.
        +     * 
        + * + * repeated .google.showcase.v1beta1.TestRun test_runs = 2; + */ + public com.google.showcase.v1beta1.TestRunOrBuilder getTestRunsOrBuilder(int index) { + if (testRunsBuilder_ == null) { + return testRuns_.get(index); + } else { + return testRunsBuilder_.getMessageOrBuilder(index); + } + } + + /** + * + * + *
        +     * The test runs of this session.
        +     * 
        + * + * repeated .google.showcase.v1beta1.TestRun test_runs = 2; + */ + public java.util.List + getTestRunsOrBuilderList() { + if (testRunsBuilder_ != null) { + return testRunsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(testRuns_); + } + } + + /** + * + * + *
        +     * The test runs of this session.
        +     * 
        + * + * repeated .google.showcase.v1beta1.TestRun test_runs = 2; + */ + public com.google.showcase.v1beta1.TestRun.Builder addTestRunsBuilder() { + return getTestRunsFieldBuilder() + .addBuilder(com.google.showcase.v1beta1.TestRun.getDefaultInstance()); + } + + /** + * + * + *
        +     * The test runs of this session.
        +     * 
        + * + * repeated .google.showcase.v1beta1.TestRun test_runs = 2; + */ + public com.google.showcase.v1beta1.TestRun.Builder addTestRunsBuilder(int index) { + return getTestRunsFieldBuilder() + .addBuilder(index, com.google.showcase.v1beta1.TestRun.getDefaultInstance()); + } + + /** + * + * + *
        +     * The test runs of this session.
        +     * 
        + * + * repeated .google.showcase.v1beta1.TestRun test_runs = 2; + */ + public java.util.List getTestRunsBuilderList() { + return getTestRunsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.showcase.v1beta1.TestRun, + com.google.showcase.v1beta1.TestRun.Builder, + com.google.showcase.v1beta1.TestRunOrBuilder> + getTestRunsFieldBuilder() { + if (testRunsBuilder_ == null) { + testRunsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.showcase.v1beta1.TestRun, + com.google.showcase.v1beta1.TestRun.Builder, + com.google.showcase.v1beta1.TestRunOrBuilder>( + testRuns_, ((bitField0_ & 0x00000002) != 0), getParentForChildren(), isClean()); + testRuns_ = null; + } + return testRunsBuilder_; + } + + @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.showcase.v1beta1.ReportSessionResponse) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.ReportSessionResponse) + private static final com.google.showcase.v1beta1.ReportSessionResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.ReportSessionResponse(); + } + + public static com.google.showcase.v1beta1.ReportSessionResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ReportSessionResponse 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.showcase.v1beta1.ReportSessionResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ReportSessionResponseOrBuilder.java b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ReportSessionResponseOrBuilder.java new file mode 100644 index 0000000000..55a54e50b9 --- /dev/null +++ b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ReportSessionResponseOrBuilder.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: schema/google/showcase/v1beta1/testing.proto + +// Protobuf Java Version: 3.25.8 +package com.google.showcase.v1beta1; + +public interface ReportSessionResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.ReportSessionResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
        +   * The state of the report.
        +   * 
        + * + * .google.showcase.v1beta1.ReportSessionResponse.Result result = 1; + * + * @return The enum numeric value on the wire for result. + */ + int getResultValue(); + + /** + * + * + *
        +   * The state of the report.
        +   * 
        + * + * .google.showcase.v1beta1.ReportSessionResponse.Result result = 1; + * + * @return The result. + */ + com.google.showcase.v1beta1.ReportSessionResponse.Result getResult(); + + /** + * + * + *
        +   * The test runs of this session.
        +   * 
        + * + * repeated .google.showcase.v1beta1.TestRun test_runs = 2; + */ + java.util.List getTestRunsList(); + + /** + * + * + *
        +   * The test runs of this session.
        +   * 
        + * + * repeated .google.showcase.v1beta1.TestRun test_runs = 2; + */ + com.google.showcase.v1beta1.TestRun getTestRuns(int index); + + /** + * + * + *
        +   * The test runs of this session.
        +   * 
        + * + * repeated .google.showcase.v1beta1.TestRun test_runs = 2; + */ + int getTestRunsCount(); + + /** + * + * + *
        +   * The test runs of this session.
        +   * 
        + * + * repeated .google.showcase.v1beta1.TestRun test_runs = 2; + */ + java.util.List getTestRunsOrBuilderList(); + + /** + * + * + *
        +   * The test runs of this session.
        +   * 
        + * + * repeated .google.showcase.v1beta1.TestRun test_runs = 2; + */ + com.google.showcase.v1beta1.TestRunOrBuilder getTestRunsOrBuilder(int index); +} diff --git a/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/RestError.java b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/RestError.java new file mode 100644 index 0000000000..86c92d1566 --- /dev/null +++ b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/RestError.java @@ -0,0 +1,2130 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/rest_error.proto + +// Protobuf Java Version: 3.25.8 +package com.google.showcase.v1beta1; + +/** + * + * + *
        + * HTTP/JSON error representation as defined in
        + * https://google.aip.dev/193#http11json-representation,
        + * 
        + * + * Protobuf type {@code google.showcase.v1beta1.RestError} + */ +public final class RestError extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.RestError) + RestErrorOrBuilder { + private static final long serialVersionUID = 0L; + + // Use RestError.newBuilder() to construct. + private RestError(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private RestError() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new RestError(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.RestErrorOuterClass + .internal_static_google_showcase_v1beta1_RestError_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.RestErrorOuterClass + .internal_static_google_showcase_v1beta1_RestError_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.RestError.class, + com.google.showcase.v1beta1.RestError.Builder.class); + } + + public interface StatusOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.RestError.Status) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
        +     * The HTTP status code that corresponds to `google.rpc.Status.code`.
        +     * 
        + * + * int32 code = 1; + * + * @return The code. + */ + int getCode(); + + /** + * + * + *
        +     * This corresponds to `google.rpc.Status.message`.
        +     * 
        + * + * string message = 2; + * + * @return The message. + */ + java.lang.String getMessage(); + + /** + * + * + *
        +     * This corresponds to `google.rpc.Status.message`.
        +     * 
        + * + * string message = 2; + * + * @return The bytes for message. + */ + com.google.protobuf.ByteString getMessageBytes(); + + /** + * + * + *
        +     * This is the enum version for `google.rpc.Status.code`.
        +     * 
        + * + * .google.rpc.Code status = 4; + * + * @return The enum numeric value on the wire for status. + */ + int getStatusValue(); + + /** + * + * + *
        +     * This is the enum version for `google.rpc.Status.code`.
        +     * 
        + * + * .google.rpc.Code status = 4; + * + * @return The status. + */ + com.google.rpc.Code getStatus(); + + /** + * + * + *
        +     * This corresponds to `google.rpc.Status.details`.
        +     * 
        + * + * repeated .google.protobuf.Any details = 5; + */ + java.util.List getDetailsList(); + + /** + * + * + *
        +     * This corresponds to `google.rpc.Status.details`.
        +     * 
        + * + * repeated .google.protobuf.Any details = 5; + */ + com.google.protobuf.Any getDetails(int index); + + /** + * + * + *
        +     * This corresponds to `google.rpc.Status.details`.
        +     * 
        + * + * repeated .google.protobuf.Any details = 5; + */ + int getDetailsCount(); + + /** + * + * + *
        +     * This corresponds to `google.rpc.Status.details`.
        +     * 
        + * + * repeated .google.protobuf.Any details = 5; + */ + java.util.List getDetailsOrBuilderList(); + + /** + * + * + *
        +     * This corresponds to `google.rpc.Status.details`.
        +     * 
        + * + * repeated .google.protobuf.Any details = 5; + */ + com.google.protobuf.AnyOrBuilder getDetailsOrBuilder(int index); + } + + /** Protobuf type {@code google.showcase.v1beta1.RestError.Status} */ + public static final class Status extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.RestError.Status) + StatusOrBuilder { + private static final long serialVersionUID = 0L; + + // Use Status.newBuilder() to construct. + private Status(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Status() { + message_ = ""; + status_ = 0; + details_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Status(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.RestErrorOuterClass + .internal_static_google_showcase_v1beta1_RestError_Status_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.RestErrorOuterClass + .internal_static_google_showcase_v1beta1_RestError_Status_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.RestError.Status.class, + com.google.showcase.v1beta1.RestError.Status.Builder.class); + } + + public static final int CODE_FIELD_NUMBER = 1; + private int code_ = 0; + + /** + * + * + *
        +     * The HTTP status code that corresponds to `google.rpc.Status.code`.
        +     * 
        + * + * int32 code = 1; + * + * @return The code. + */ + @java.lang.Override + public int getCode() { + return code_; + } + + public static final int MESSAGE_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object message_ = ""; + + /** + * + * + *
        +     * This corresponds to `google.rpc.Status.message`.
        +     * 
        + * + * string message = 2; + * + * @return The message. + */ + @java.lang.Override + public java.lang.String getMessage() { + java.lang.Object ref = message_; + 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(); + message_ = s; + return s; + } + } + + /** + * + * + *
        +     * This corresponds to `google.rpc.Status.message`.
        +     * 
        + * + * string message = 2; + * + * @return The bytes for message. + */ + @java.lang.Override + public com.google.protobuf.ByteString getMessageBytes() { + java.lang.Object ref = message_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + message_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int STATUS_FIELD_NUMBER = 4; + private int status_ = 0; + + /** + * + * + *
        +     * This is the enum version for `google.rpc.Status.code`.
        +     * 
        + * + * .google.rpc.Code status = 4; + * + * @return The enum numeric value on the wire for status. + */ + @java.lang.Override + public int getStatusValue() { + return status_; + } + + /** + * + * + *
        +     * This is the enum version for `google.rpc.Status.code`.
        +     * 
        + * + * .google.rpc.Code status = 4; + * + * @return The status. + */ + @java.lang.Override + public com.google.rpc.Code getStatus() { + com.google.rpc.Code result = com.google.rpc.Code.forNumber(status_); + return result == null ? com.google.rpc.Code.UNRECOGNIZED : result; + } + + public static final int DETAILS_FIELD_NUMBER = 5; + + @SuppressWarnings("serial") + private java.util.List details_; + + /** + * + * + *
        +     * This corresponds to `google.rpc.Status.details`.
        +     * 
        + * + * repeated .google.protobuf.Any details = 5; + */ + @java.lang.Override + public java.util.List getDetailsList() { + return details_; + } + + /** + * + * + *
        +     * This corresponds to `google.rpc.Status.details`.
        +     * 
        + * + * repeated .google.protobuf.Any details = 5; + */ + @java.lang.Override + public java.util.List getDetailsOrBuilderList() { + return details_; + } + + /** + * + * + *
        +     * This corresponds to `google.rpc.Status.details`.
        +     * 
        + * + * repeated .google.protobuf.Any details = 5; + */ + @java.lang.Override + public int getDetailsCount() { + return details_.size(); + } + + /** + * + * + *
        +     * This corresponds to `google.rpc.Status.details`.
        +     * 
        + * + * repeated .google.protobuf.Any details = 5; + */ + @java.lang.Override + public com.google.protobuf.Any getDetails(int index) { + return details_.get(index); + } + + /** + * + * + *
        +     * This corresponds to `google.rpc.Status.details`.
        +     * 
        + * + * repeated .google.protobuf.Any details = 5; + */ + @java.lang.Override + public com.google.protobuf.AnyOrBuilder getDetailsOrBuilder(int index) { + return details_.get(index); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (code_ != 0) { + output.writeInt32(1, code_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(message_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, message_); + } + if (status_ != com.google.rpc.Code.OK.getNumber()) { + output.writeEnum(4, status_); + } + for (int i = 0; i < details_.size(); i++) { + output.writeMessage(5, details_.get(i)); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (code_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(1, code_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(message_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, message_); + } + if (status_ != com.google.rpc.Code.OK.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(4, status_); + } + for (int i = 0; i < details_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(5, details_.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.showcase.v1beta1.RestError.Status)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.RestError.Status other = + (com.google.showcase.v1beta1.RestError.Status) obj; + + if (getCode() != other.getCode()) return false; + if (!getMessage().equals(other.getMessage())) return false; + if (status_ != other.status_) return false; + if (!getDetailsList().equals(other.getDetailsList())) 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) + CODE_FIELD_NUMBER; + hash = (53 * hash) + getCode(); + hash = (37 * hash) + MESSAGE_FIELD_NUMBER; + hash = (53 * hash) + getMessage().hashCode(); + hash = (37 * hash) + STATUS_FIELD_NUMBER; + hash = (53 * hash) + status_; + if (getDetailsCount() > 0) { + hash = (37 * hash) + DETAILS_FIELD_NUMBER; + hash = (53 * hash) + getDetailsList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.showcase.v1beta1.RestError.Status parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.RestError.Status parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.RestError.Status parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.RestError.Status 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.showcase.v1beta1.RestError.Status parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.RestError.Status parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.RestError.Status parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.RestError.Status 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.showcase.v1beta1.RestError.Status parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.RestError.Status 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.showcase.v1beta1.RestError.Status parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.RestError.Status 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.showcase.v1beta1.RestError.Status prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** Protobuf type {@code google.showcase.v1beta1.RestError.Status} */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.RestError.Status) + com.google.showcase.v1beta1.RestError.StatusOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.RestErrorOuterClass + .internal_static_google_showcase_v1beta1_RestError_Status_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.RestErrorOuterClass + .internal_static_google_showcase_v1beta1_RestError_Status_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.RestError.Status.class, + com.google.showcase.v1beta1.RestError.Status.Builder.class); + } + + // Construct using com.google.showcase.v1beta1.RestError.Status.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + code_ = 0; + message_ = ""; + status_ = 0; + if (detailsBuilder_ == null) { + details_ = java.util.Collections.emptyList(); + } else { + details_ = null; + detailsBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000008); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.showcase.v1beta1.RestErrorOuterClass + .internal_static_google_showcase_v1beta1_RestError_Status_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.RestError.Status getDefaultInstanceForType() { + return com.google.showcase.v1beta1.RestError.Status.getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.RestError.Status build() { + com.google.showcase.v1beta1.RestError.Status result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.RestError.Status buildPartial() { + com.google.showcase.v1beta1.RestError.Status result = + new com.google.showcase.v1beta1.RestError.Status(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields(com.google.showcase.v1beta1.RestError.Status result) { + if (detailsBuilder_ == null) { + if (((bitField0_ & 0x00000008) != 0)) { + details_ = java.util.Collections.unmodifiableList(details_); + bitField0_ = (bitField0_ & ~0x00000008); + } + result.details_ = details_; + } else { + result.details_ = detailsBuilder_.build(); + } + } + + private void buildPartial0(com.google.showcase.v1beta1.RestError.Status result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.code_ = code_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.message_ = message_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.status_ = status_; + } + } + + @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.showcase.v1beta1.RestError.Status) { + return mergeFrom((com.google.showcase.v1beta1.RestError.Status) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.showcase.v1beta1.RestError.Status other) { + if (other == com.google.showcase.v1beta1.RestError.Status.getDefaultInstance()) return this; + if (other.getCode() != 0) { + setCode(other.getCode()); + } + if (!other.getMessage().isEmpty()) { + message_ = other.message_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (other.status_ != 0) { + setStatusValue(other.getStatusValue()); + } + if (detailsBuilder_ == null) { + if (!other.details_.isEmpty()) { + if (details_.isEmpty()) { + details_ = other.details_; + bitField0_ = (bitField0_ & ~0x00000008); + } else { + ensureDetailsIsMutable(); + details_.addAll(other.details_); + } + onChanged(); + } + } else { + if (!other.details_.isEmpty()) { + if (detailsBuilder_.isEmpty()) { + detailsBuilder_.dispose(); + detailsBuilder_ = null; + details_ = other.details_; + bitField0_ = (bitField0_ & ~0x00000008); + detailsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getDetailsFieldBuilder() + : null; + } else { + detailsBuilder_.addAllMessages(other.details_); + } + } + } + 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: + { + code_ = input.readInt32(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 18: + { + message_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 32: + { + status_ = input.readEnum(); + bitField0_ |= 0x00000004; + break; + } // case 32 + case 42: + { + com.google.protobuf.Any m = + input.readMessage(com.google.protobuf.Any.parser(), extensionRegistry); + if (detailsBuilder_ == null) { + ensureDetailsIsMutable(); + details_.add(m); + } else { + detailsBuilder_.addMessage(m); + } + 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 int code_; + + /** + * + * + *
        +       * The HTTP status code that corresponds to `google.rpc.Status.code`.
        +       * 
        + * + * int32 code = 1; + * + * @return The code. + */ + @java.lang.Override + public int getCode() { + return code_; + } + + /** + * + * + *
        +       * The HTTP status code that corresponds to `google.rpc.Status.code`.
        +       * 
        + * + * int32 code = 1; + * + * @param value The code to set. + * @return This builder for chaining. + */ + public Builder setCode(int value) { + + code_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
        +       * The HTTP status code that corresponds to `google.rpc.Status.code`.
        +       * 
        + * + * int32 code = 1; + * + * @return This builder for chaining. + */ + public Builder clearCode() { + bitField0_ = (bitField0_ & ~0x00000001); + code_ = 0; + onChanged(); + return this; + } + + private java.lang.Object message_ = ""; + + /** + * + * + *
        +       * This corresponds to `google.rpc.Status.message`.
        +       * 
        + * + * string message = 2; + * + * @return The message. + */ + public java.lang.String getMessage() { + java.lang.Object ref = message_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + message_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
        +       * This corresponds to `google.rpc.Status.message`.
        +       * 
        + * + * string message = 2; + * + * @return The bytes for message. + */ + public com.google.protobuf.ByteString getMessageBytes() { + java.lang.Object ref = message_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + message_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
        +       * This corresponds to `google.rpc.Status.message`.
        +       * 
        + * + * string message = 2; + * + * @param value The message to set. + * @return This builder for chaining. + */ + public Builder setMessage(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + message_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
        +       * This corresponds to `google.rpc.Status.message`.
        +       * 
        + * + * string message = 2; + * + * @return This builder for chaining. + */ + public Builder clearMessage() { + message_ = getDefaultInstance().getMessage(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
        +       * This corresponds to `google.rpc.Status.message`.
        +       * 
        + * + * string message = 2; + * + * @param value The bytes for message to set. + * @return This builder for chaining. + */ + public Builder setMessageBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + message_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private int status_ = 0; + + /** + * + * + *
        +       * This is the enum version for `google.rpc.Status.code`.
        +       * 
        + * + * .google.rpc.Code status = 4; + * + * @return The enum numeric value on the wire for status. + */ + @java.lang.Override + public int getStatusValue() { + return status_; + } + + /** + * + * + *
        +       * This is the enum version for `google.rpc.Status.code`.
        +       * 
        + * + * .google.rpc.Code status = 4; + * + * @param value The enum numeric value on the wire for status to set. + * @return This builder for chaining. + */ + public Builder setStatusValue(int value) { + status_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
        +       * This is the enum version for `google.rpc.Status.code`.
        +       * 
        + * + * .google.rpc.Code status = 4; + * + * @return The status. + */ + @java.lang.Override + public com.google.rpc.Code getStatus() { + com.google.rpc.Code result = com.google.rpc.Code.forNumber(status_); + return result == null ? com.google.rpc.Code.UNRECOGNIZED : result; + } + + /** + * + * + *
        +       * This is the enum version for `google.rpc.Status.code`.
        +       * 
        + * + * .google.rpc.Code status = 4; + * + * @param value The status to set. + * @return This builder for chaining. + */ + public Builder setStatus(com.google.rpc.Code value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000004; + status_ = value.getNumber(); + onChanged(); + return this; + } + + /** + * + * + *
        +       * This is the enum version for `google.rpc.Status.code`.
        +       * 
        + * + * .google.rpc.Code status = 4; + * + * @return This builder for chaining. + */ + public Builder clearStatus() { + bitField0_ = (bitField0_ & ~0x00000004); + status_ = 0; + onChanged(); + return this; + } + + private java.util.List details_ = java.util.Collections.emptyList(); + + private void ensureDetailsIsMutable() { + if (!((bitField0_ & 0x00000008) != 0)) { + details_ = new java.util.ArrayList(details_); + bitField0_ |= 0x00000008; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.protobuf.Any, + com.google.protobuf.Any.Builder, + com.google.protobuf.AnyOrBuilder> + detailsBuilder_; + + /** + * + * + *
        +       * This corresponds to `google.rpc.Status.details`.
        +       * 
        + * + * repeated .google.protobuf.Any details = 5; + */ + public java.util.List getDetailsList() { + if (detailsBuilder_ == null) { + return java.util.Collections.unmodifiableList(details_); + } else { + return detailsBuilder_.getMessageList(); + } + } + + /** + * + * + *
        +       * This corresponds to `google.rpc.Status.details`.
        +       * 
        + * + * repeated .google.protobuf.Any details = 5; + */ + public int getDetailsCount() { + if (detailsBuilder_ == null) { + return details_.size(); + } else { + return detailsBuilder_.getCount(); + } + } + + /** + * + * + *
        +       * This corresponds to `google.rpc.Status.details`.
        +       * 
        + * + * repeated .google.protobuf.Any details = 5; + */ + public com.google.protobuf.Any getDetails(int index) { + if (detailsBuilder_ == null) { + return details_.get(index); + } else { + return detailsBuilder_.getMessage(index); + } + } + + /** + * + * + *
        +       * This corresponds to `google.rpc.Status.details`.
        +       * 
        + * + * repeated .google.protobuf.Any details = 5; + */ + public Builder setDetails(int index, com.google.protobuf.Any value) { + if (detailsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureDetailsIsMutable(); + details_.set(index, value); + onChanged(); + } else { + detailsBuilder_.setMessage(index, value); + } + return this; + } + + /** + * + * + *
        +       * This corresponds to `google.rpc.Status.details`.
        +       * 
        + * + * repeated .google.protobuf.Any details = 5; + */ + public Builder setDetails(int index, com.google.protobuf.Any.Builder builderForValue) { + if (detailsBuilder_ == null) { + ensureDetailsIsMutable(); + details_.set(index, builderForValue.build()); + onChanged(); + } else { + detailsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
        +       * This corresponds to `google.rpc.Status.details`.
        +       * 
        + * + * repeated .google.protobuf.Any details = 5; + */ + public Builder addDetails(com.google.protobuf.Any value) { + if (detailsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureDetailsIsMutable(); + details_.add(value); + onChanged(); + } else { + detailsBuilder_.addMessage(value); + } + return this; + } + + /** + * + * + *
        +       * This corresponds to `google.rpc.Status.details`.
        +       * 
        + * + * repeated .google.protobuf.Any details = 5; + */ + public Builder addDetails(int index, com.google.protobuf.Any value) { + if (detailsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureDetailsIsMutable(); + details_.add(index, value); + onChanged(); + } else { + detailsBuilder_.addMessage(index, value); + } + return this; + } + + /** + * + * + *
        +       * This corresponds to `google.rpc.Status.details`.
        +       * 
        + * + * repeated .google.protobuf.Any details = 5; + */ + public Builder addDetails(com.google.protobuf.Any.Builder builderForValue) { + if (detailsBuilder_ == null) { + ensureDetailsIsMutable(); + details_.add(builderForValue.build()); + onChanged(); + } else { + detailsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + + /** + * + * + *
        +       * This corresponds to `google.rpc.Status.details`.
        +       * 
        + * + * repeated .google.protobuf.Any details = 5; + */ + public Builder addDetails(int index, com.google.protobuf.Any.Builder builderForValue) { + if (detailsBuilder_ == null) { + ensureDetailsIsMutable(); + details_.add(index, builderForValue.build()); + onChanged(); + } else { + detailsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
        +       * This corresponds to `google.rpc.Status.details`.
        +       * 
        + * + * repeated .google.protobuf.Any details = 5; + */ + public Builder addAllDetails(java.lang.Iterable values) { + if (detailsBuilder_ == null) { + ensureDetailsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, details_); + onChanged(); + } else { + detailsBuilder_.addAllMessages(values); + } + return this; + } + + /** + * + * + *
        +       * This corresponds to `google.rpc.Status.details`.
        +       * 
        + * + * repeated .google.protobuf.Any details = 5; + */ + public Builder clearDetails() { + if (detailsBuilder_ == null) { + details_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + } else { + detailsBuilder_.clear(); + } + return this; + } + + /** + * + * + *
        +       * This corresponds to `google.rpc.Status.details`.
        +       * 
        + * + * repeated .google.protobuf.Any details = 5; + */ + public Builder removeDetails(int index) { + if (detailsBuilder_ == null) { + ensureDetailsIsMutable(); + details_.remove(index); + onChanged(); + } else { + detailsBuilder_.remove(index); + } + return this; + } + + /** + * + * + *
        +       * This corresponds to `google.rpc.Status.details`.
        +       * 
        + * + * repeated .google.protobuf.Any details = 5; + */ + public com.google.protobuf.Any.Builder getDetailsBuilder(int index) { + return getDetailsFieldBuilder().getBuilder(index); + } + + /** + * + * + *
        +       * This corresponds to `google.rpc.Status.details`.
        +       * 
        + * + * repeated .google.protobuf.Any details = 5; + */ + public com.google.protobuf.AnyOrBuilder getDetailsOrBuilder(int index) { + if (detailsBuilder_ == null) { + return details_.get(index); + } else { + return detailsBuilder_.getMessageOrBuilder(index); + } + } + + /** + * + * + *
        +       * This corresponds to `google.rpc.Status.details`.
        +       * 
        + * + * repeated .google.protobuf.Any details = 5; + */ + public java.util.List getDetailsOrBuilderList() { + if (detailsBuilder_ != null) { + return detailsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(details_); + } + } + + /** + * + * + *
        +       * This corresponds to `google.rpc.Status.details`.
        +       * 
        + * + * repeated .google.protobuf.Any details = 5; + */ + public com.google.protobuf.Any.Builder addDetailsBuilder() { + return getDetailsFieldBuilder().addBuilder(com.google.protobuf.Any.getDefaultInstance()); + } + + /** + * + * + *
        +       * This corresponds to `google.rpc.Status.details`.
        +       * 
        + * + * repeated .google.protobuf.Any details = 5; + */ + public com.google.protobuf.Any.Builder addDetailsBuilder(int index) { + return getDetailsFieldBuilder() + .addBuilder(index, com.google.protobuf.Any.getDefaultInstance()); + } + + /** + * + * + *
        +       * This corresponds to `google.rpc.Status.details`.
        +       * 
        + * + * repeated .google.protobuf.Any details = 5; + */ + public java.util.List getDetailsBuilderList() { + return getDetailsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.protobuf.Any, + com.google.protobuf.Any.Builder, + com.google.protobuf.AnyOrBuilder> + getDetailsFieldBuilder() { + if (detailsBuilder_ == null) { + detailsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.protobuf.Any, + com.google.protobuf.Any.Builder, + com.google.protobuf.AnyOrBuilder>( + details_, ((bitField0_ & 0x00000008) != 0), getParentForChildren(), isClean()); + details_ = null; + } + return detailsBuilder_; + } + + @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.showcase.v1beta1.RestError.Status) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.RestError.Status) + private static final com.google.showcase.v1beta1.RestError.Status DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.RestError.Status(); + } + + public static com.google.showcase.v1beta1.RestError.Status getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Status 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.showcase.v1beta1.RestError.Status getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + private int bitField0_; + public static final int ERROR_FIELD_NUMBER = 1; + private com.google.showcase.v1beta1.RestError.Status error_; + + /** + * .google.showcase.v1beta1.RestError.Status error = 1; + * + * @return Whether the error field is set. + */ + @java.lang.Override + public boolean hasError() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * .google.showcase.v1beta1.RestError.Status error = 1; + * + * @return The error. + */ + @java.lang.Override + public com.google.showcase.v1beta1.RestError.Status getError() { + return error_ == null + ? com.google.showcase.v1beta1.RestError.Status.getDefaultInstance() + : error_; + } + + /** .google.showcase.v1beta1.RestError.Status error = 1; */ + @java.lang.Override + public com.google.showcase.v1beta1.RestError.StatusOrBuilder getErrorOrBuilder() { + return error_ == null + ? com.google.showcase.v1beta1.RestError.Status.getDefaultInstance() + : error_; + } + + 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, getError()); + } + 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, getError()); + } + 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.showcase.v1beta1.RestError)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.RestError other = (com.google.showcase.v1beta1.RestError) obj; + + if (hasError() != other.hasError()) return false; + if (hasError()) { + if (!getError().equals(other.getError())) 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 (hasError()) { + hash = (37 * hash) + ERROR_FIELD_NUMBER; + hash = (53 * hash) + getError().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.showcase.v1beta1.RestError parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.RestError parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.RestError parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.RestError 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.showcase.v1beta1.RestError parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.RestError parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.RestError parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.RestError 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.showcase.v1beta1.RestError parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.RestError 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.showcase.v1beta1.RestError parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.RestError 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.showcase.v1beta1.RestError 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; + } + + /** + * + * + *
        +   * HTTP/JSON error representation as defined in
        +   * https://google.aip.dev/193#http11json-representation,
        +   * 
        + * + * Protobuf type {@code google.showcase.v1beta1.RestError} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.RestError) + com.google.showcase.v1beta1.RestErrorOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.RestErrorOuterClass + .internal_static_google_showcase_v1beta1_RestError_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.RestErrorOuterClass + .internal_static_google_showcase_v1beta1_RestError_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.RestError.class, + com.google.showcase.v1beta1.RestError.Builder.class); + } + + // Construct using com.google.showcase.v1beta1.RestError.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getErrorFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + error_ = null; + if (errorBuilder_ != null) { + errorBuilder_.dispose(); + errorBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.showcase.v1beta1.RestErrorOuterClass + .internal_static_google_showcase_v1beta1_RestError_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.RestError getDefaultInstanceForType() { + return com.google.showcase.v1beta1.RestError.getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.RestError build() { + com.google.showcase.v1beta1.RestError result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.RestError buildPartial() { + com.google.showcase.v1beta1.RestError result = + new com.google.showcase.v1beta1.RestError(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.showcase.v1beta1.RestError result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.error_ = errorBuilder_ == null ? error_ : errorBuilder_.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.showcase.v1beta1.RestError) { + return mergeFrom((com.google.showcase.v1beta1.RestError) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.showcase.v1beta1.RestError other) { + if (other == com.google.showcase.v1beta1.RestError.getDefaultInstance()) return this; + if (other.hasError()) { + mergeError(other.getError()); + } + 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(getErrorFieldBuilder().getBuilder(), extensionRegistry); + 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 com.google.showcase.v1beta1.RestError.Status error_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.showcase.v1beta1.RestError.Status, + com.google.showcase.v1beta1.RestError.Status.Builder, + com.google.showcase.v1beta1.RestError.StatusOrBuilder> + errorBuilder_; + + /** + * .google.showcase.v1beta1.RestError.Status error = 1; + * + * @return Whether the error field is set. + */ + public boolean hasError() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * .google.showcase.v1beta1.RestError.Status error = 1; + * + * @return The error. + */ + public com.google.showcase.v1beta1.RestError.Status getError() { + if (errorBuilder_ == null) { + return error_ == null + ? com.google.showcase.v1beta1.RestError.Status.getDefaultInstance() + : error_; + } else { + return errorBuilder_.getMessage(); + } + } + + /** .google.showcase.v1beta1.RestError.Status error = 1; */ + public Builder setError(com.google.showcase.v1beta1.RestError.Status value) { + if (errorBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + error_ = value; + } else { + errorBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** .google.showcase.v1beta1.RestError.Status error = 1; */ + public Builder setError(com.google.showcase.v1beta1.RestError.Status.Builder builderForValue) { + if (errorBuilder_ == null) { + error_ = builderForValue.build(); + } else { + errorBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** .google.showcase.v1beta1.RestError.Status error = 1; */ + public Builder mergeError(com.google.showcase.v1beta1.RestError.Status value) { + if (errorBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) + && error_ != null + && error_ != com.google.showcase.v1beta1.RestError.Status.getDefaultInstance()) { + getErrorBuilder().mergeFrom(value); + } else { + error_ = value; + } + } else { + errorBuilder_.mergeFrom(value); + } + if (error_ != null) { + bitField0_ |= 0x00000001; + onChanged(); + } + return this; + } + + /** .google.showcase.v1beta1.RestError.Status error = 1; */ + public Builder clearError() { + bitField0_ = (bitField0_ & ~0x00000001); + error_ = null; + if (errorBuilder_ != null) { + errorBuilder_.dispose(); + errorBuilder_ = null; + } + onChanged(); + return this; + } + + /** .google.showcase.v1beta1.RestError.Status error = 1; */ + public com.google.showcase.v1beta1.RestError.Status.Builder getErrorBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return getErrorFieldBuilder().getBuilder(); + } + + /** .google.showcase.v1beta1.RestError.Status error = 1; */ + public com.google.showcase.v1beta1.RestError.StatusOrBuilder getErrorOrBuilder() { + if (errorBuilder_ != null) { + return errorBuilder_.getMessageOrBuilder(); + } else { + return error_ == null + ? com.google.showcase.v1beta1.RestError.Status.getDefaultInstance() + : error_; + } + } + + /** .google.showcase.v1beta1.RestError.Status error = 1; */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.showcase.v1beta1.RestError.Status, + com.google.showcase.v1beta1.RestError.Status.Builder, + com.google.showcase.v1beta1.RestError.StatusOrBuilder> + getErrorFieldBuilder() { + if (errorBuilder_ == null) { + errorBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.showcase.v1beta1.RestError.Status, + com.google.showcase.v1beta1.RestError.Status.Builder, + com.google.showcase.v1beta1.RestError.StatusOrBuilder>( + getError(), getParentForChildren(), isClean()); + error_ = null; + } + return errorBuilder_; + } + + @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.showcase.v1beta1.RestError) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.RestError) + private static final com.google.showcase.v1beta1.RestError DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.RestError(); + } + + public static com.google.showcase.v1beta1.RestError getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public RestError 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.showcase.v1beta1.RestError getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/RestErrorOrBuilder.java b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/RestErrorOrBuilder.java new file mode 100644 index 0000000000..da9e058e83 --- /dev/null +++ b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/RestErrorOrBuilder.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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/rest_error.proto + +// Protobuf Java Version: 3.25.8 +package com.google.showcase.v1beta1; + +public interface RestErrorOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.RestError) + com.google.protobuf.MessageOrBuilder { + + /** + * .google.showcase.v1beta1.RestError.Status error = 1; + * + * @return Whether the error field is set. + */ + boolean hasError(); + + /** + * .google.showcase.v1beta1.RestError.Status error = 1; + * + * @return The error. + */ + com.google.showcase.v1beta1.RestError.Status getError(); + + /** .google.showcase.v1beta1.RestError.Status error = 1; */ + com.google.showcase.v1beta1.RestError.StatusOrBuilder getErrorOrBuilder(); +} diff --git a/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/RestErrorOuterClass.java b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/RestErrorOuterClass.java new file mode 100644 index 0000000000..72659abca9 --- /dev/null +++ b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/RestErrorOuterClass.java @@ -0,0 +1,88 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/rest_error.proto + +// Protobuf Java Version: 3.25.8 +package com.google.showcase.v1beta1; + +public final class RestErrorOuterClass { + private RestErrorOuterClass() {} + + 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_showcase_v1beta1_RestError_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_showcase_v1beta1_RestError_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_showcase_v1beta1_RestError_Status_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_showcase_v1beta1_RestError_Status_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/schema/google/showcase/v1beta1/rest_er" + + "ror.proto\022\027google.showcase.v1beta1\032\031goog" + + "le/protobuf/any.proto\032\025google/rpc/code.p" + + "roto\"\267\001\n\tRestError\0228\n\005error\030\001 \001(\0132).goog" + + "le.showcase.v1beta1.RestError.Status\032p\n\006" + + "Status\022\014\n\004code\030\001 \001(\005\022\017\n\007message\030\002 \001(\t\022 \n" + + "\006status\030\004 \001(\0162\020.google.rpc.Code\022%\n\007detai" + + "ls\030\005 \003(\0132\024.google.protobuf.AnyBq\n\033com.go" + + "ogle.showcase.v1beta1P\001Z4github.com/goog" + + "leapis/gapic-showcase/server/genproto\352\002\031" + + "Google::Showcase::V1beta1b\006proto3" + }; + descriptor = + com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( + descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + com.google.protobuf.AnyProto.getDescriptor(), + com.google.rpc.CodeProto.getDescriptor(), + }); + internal_static_google_showcase_v1beta1_RestError_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_showcase_v1beta1_RestError_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_showcase_v1beta1_RestError_descriptor, + new java.lang.String[] { + "Error", + }); + internal_static_google_showcase_v1beta1_RestError_Status_descriptor = + internal_static_google_showcase_v1beta1_RestError_descriptor.getNestedTypes().get(0); + internal_static_google_showcase_v1beta1_RestError_Status_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_showcase_v1beta1_RestError_Status_descriptor, + new java.lang.String[] { + "Code", "Message", "Status", "Details", + }); + com.google.protobuf.AnyProto.getDescriptor(); + com.google.rpc.CodeProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/Room.java b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/Room.java new file mode 100644 index 0000000000..2717e4ee26 --- /dev/null +++ b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/Room.java @@ -0,0 +1,1612 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/messaging.proto + +// Protobuf Java Version: 3.25.8 +package com.google.showcase.v1beta1; + +/** + * + * + *
        + * A chat room.
        + * 
        + * + * Protobuf type {@code google.showcase.v1beta1.Room} + */ +public final class Room extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.Room) + RoomOrBuilder { + private static final long serialVersionUID = 0L; + + // Use Room.newBuilder() to construct. + private Room(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Room() { + name_ = ""; + displayName_ = ""; + description_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Room(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.MessagingOuterClass + .internal_static_google_showcase_v1beta1_Room_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.MessagingOuterClass + .internal_static_google_showcase_v1beta1_Room_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.Room.class, com.google.showcase.v1beta1.Room.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 chat room.
        +   * 
        + * + * 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 chat room.
        +   * 
        + * + * 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 DISPLAY_NAME_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object displayName_ = ""; + + /** + * + * + *
        +   * The human readable name of the chat room.
        +   * 
        + * + * string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The displayName. + */ + @java.lang.Override + public java.lang.String getDisplayName() { + java.lang.Object ref = displayName_; + 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(); + displayName_ = s; + return s; + } + } + + /** + * + * + *
        +   * The human readable name of the chat room.
        +   * 
        + * + * string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for displayName. + */ + @java.lang.Override + public com.google.protobuf.ByteString getDisplayNameBytes() { + java.lang.Object ref = displayName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + displayName_ = 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_ = ""; + + /** + * + * + *
        +   * The description of the chat room.
        +   * 
        + * + * 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; + } + } + + /** + * + * + *
        +   * The description of the chat room.
        +   * 
        + * + * 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_; + + /** + * + * + *
        +   * The timestamp at which the room was created.
        +   * 
        + * + * .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); + } + + /** + * + * + *
        +   * The timestamp at which the room was created.
        +   * 
        + * + * .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_; + } + + /** + * + * + *
        +   * The timestamp at which the room was created.
        +   * 
        + * + * .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_; + + /** + * + * + *
        +   * The latest timestamp at which the room was updated.
        +   * 
        + * + * .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the updateTime field is set. + */ + @java.lang.Override + public boolean hasUpdateTime() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
        +   * The latest timestamp at which the room was updated.
        +   * 
        + * + * .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The updateTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getUpdateTime() { + return updateTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : updateTime_; + } + + /** + * + * + *
        +   * The latest timestamp at which the room was updated.
        +   * 
        + * + * .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_; + } + + 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(displayName_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, displayName_); + } + 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()); + } + 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(displayName_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, displayName_); + } + 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()); + } + 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.showcase.v1beta1.Room)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.Room other = (com.google.showcase.v1beta1.Room) obj; + + if (!getName().equals(other.getName())) return false; + if (!getDisplayName().equals(other.getDisplayName())) 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 (!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) + DISPLAY_NAME_FIELD_NUMBER; + hash = (53 * hash) + getDisplayName().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 = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.showcase.v1beta1.Room parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.Room parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.Room parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.Room 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.showcase.v1beta1.Room parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.Room parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.Room parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.Room 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.showcase.v1beta1.Room parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.Room 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.showcase.v1beta1.Room parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.Room 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.showcase.v1beta1.Room prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
        +   * A chat room.
        +   * 
        + * + * Protobuf type {@code google.showcase.v1beta1.Room} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.Room) + com.google.showcase.v1beta1.RoomOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.MessagingOuterClass + .internal_static_google_showcase_v1beta1_Room_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.MessagingOuterClass + .internal_static_google_showcase_v1beta1_Room_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.Room.class, + com.google.showcase.v1beta1.Room.Builder.class); + } + + // Construct using com.google.showcase.v1beta1.Room.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_ = ""; + displayName_ = ""; + description_ = ""; + 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.showcase.v1beta1.MessagingOuterClass + .internal_static_google_showcase_v1beta1_Room_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.Room getDefaultInstanceForType() { + return com.google.showcase.v1beta1.Room.getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.Room build() { + com.google.showcase.v1beta1.Room result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.Room buildPartial() { + com.google.showcase.v1beta1.Room result = new com.google.showcase.v1beta1.Room(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.showcase.v1beta1.Room result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.displayName_ = displayName_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.description_ = description_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000008) != 0)) { + result.createTime_ = createTimeBuilder_ == null ? createTime_ : createTimeBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000010) != 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.showcase.v1beta1.Room) { + return mergeFrom((com.google.showcase.v1beta1.Room) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.showcase.v1beta1.Room other) { + if (other == com.google.showcase.v1beta1.Room.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getDisplayName().isEmpty()) { + displayName_ = other.displayName_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (!other.getDescription().isEmpty()) { + description_ = other.description_; + bitField0_ |= 0x00000004; + onChanged(); + } + 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: + { + displayName_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + description_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 34: + { + input.readMessage(getCreateTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000008; + break; + } // case 34 + case 42: + { + input.readMessage(getUpdateTimeFieldBuilder().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 chat room.
        +     * 
        + * + * 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 chat room.
        +     * 
        + * + * 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 chat room.
        +     * 
        + * + * 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 chat room.
        +     * 
        + * + * 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 chat room.
        +     * 
        + * + * 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 displayName_ = ""; + + /** + * + * + *
        +     * The human readable name of the chat room.
        +     * 
        + * + * string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The displayName. + */ + public java.lang.String getDisplayName() { + java.lang.Object ref = displayName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + displayName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
        +     * The human readable name of the chat room.
        +     * 
        + * + * string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for displayName. + */ + public com.google.protobuf.ByteString getDisplayNameBytes() { + java.lang.Object ref = displayName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + displayName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
        +     * The human readable name of the chat room.
        +     * 
        + * + * string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The displayName to set. + * @return This builder for chaining. + */ + public Builder setDisplayName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + displayName_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
        +     * The human readable name of the chat room.
        +     * 
        + * + * string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearDisplayName() { + displayName_ = getDefaultInstance().getDisplayName(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
        +     * The human readable name of the chat room.
        +     * 
        + * + * string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for displayName to set. + * @return This builder for chaining. + */ + public Builder setDisplayNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + displayName_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private java.lang.Object description_ = ""; + + /** + * + * + *
        +     * The description of the chat room.
        +     * 
        + * + * 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; + } + } + + /** + * + * + *
        +     * The description of the chat room.
        +     * 
        + * + * 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; + } + } + + /** + * + * + *
        +     * The description of the chat room.
        +     * 
        + * + * 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_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
        +     * The description of the chat room.
        +     * 
        + * + * string description = 3; + * + * @return This builder for chaining. + */ + public Builder clearDescription() { + description_ = getDefaultInstance().getDescription(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + + /** + * + * + *
        +     * The description of the chat room.
        +     * 
        + * + * 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_ |= 0x00000004; + 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_; + + /** + * + * + *
        +     * The timestamp at which the room was created.
        +     * 
        + * + * + * .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the createTime field is set. + */ + public boolean hasCreateTime() { + return ((bitField0_ & 0x00000008) != 0); + } + + /** + * + * + *
        +     * The timestamp at which the room was created.
        +     * 
        + * + * + * .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(); + } + } + + /** + * + * + *
        +     * The timestamp at which the room was created.
        +     * 
        + * + * + * .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_ |= 0x00000008; + onChanged(); + return this; + } + + /** + * + * + *
        +     * The timestamp at which the room was created.
        +     * 
        + * + * + * .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_ |= 0x00000008; + onChanged(); + return this; + } + + /** + * + * + *
        +     * The timestamp at which the room was created.
        +     * 
        + * + * + * .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_ & 0x00000008) != 0) + && createTime_ != null + && createTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getCreateTimeBuilder().mergeFrom(value); + } else { + createTime_ = value; + } + } else { + createTimeBuilder_.mergeFrom(value); + } + if (createTime_ != null) { + bitField0_ |= 0x00000008; + onChanged(); + } + return this; + } + + /** + * + * + *
        +     * The timestamp at which the room was created.
        +     * 
        + * + * + * .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearCreateTime() { + bitField0_ = (bitField0_ & ~0x00000008); + createTime_ = null; + if (createTimeBuilder_ != null) { + createTimeBuilder_.dispose(); + createTimeBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
        +     * The timestamp at which the room was created.
        +     * 
        + * + * + * .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.Timestamp.Builder getCreateTimeBuilder() { + bitField0_ |= 0x00000008; + onChanged(); + return getCreateTimeFieldBuilder().getBuilder(); + } + + /** + * + * + *
        +     * The timestamp at which the room was created.
        +     * 
        + * + * + * .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_; + } + } + + /** + * + * + *
        +     * The timestamp at which the room was created.
        +     * 
        + * + * + * .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_; + + /** + * + * + *
        +     * The latest timestamp at which the room was updated.
        +     * 
        + * + * + * .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the updateTime field is set. + */ + public boolean hasUpdateTime() { + return ((bitField0_ & 0x00000010) != 0); + } + + /** + * + * + *
        +     * The latest timestamp at which the room was updated.
        +     * 
        + * + * + * .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The updateTime. + */ + public com.google.protobuf.Timestamp getUpdateTime() { + if (updateTimeBuilder_ == null) { + return updateTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : updateTime_; + } else { + return updateTimeBuilder_.getMessage(); + } + } + + /** + * + * + *
        +     * The latest timestamp at which the room was updated.
        +     * 
        + * + * + * .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setUpdateTime(com.google.protobuf.Timestamp value) { + if (updateTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + updateTime_ = value; + } else { + updateTimeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + /** + * + * + *
        +     * The latest timestamp at which the room was updated.
        +     * 
        + * + * + * .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setUpdateTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (updateTimeBuilder_ == null) { + updateTime_ = builderForValue.build(); + } else { + updateTimeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + /** + * + * + *
        +     * The latest timestamp at which the room was updated.
        +     * 
        + * + * + * .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeUpdateTime(com.google.protobuf.Timestamp value) { + if (updateTimeBuilder_ == null) { + if (((bitField0_ & 0x00000010) != 0) + && updateTime_ != null + && updateTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getUpdateTimeBuilder().mergeFrom(value); + } else { + updateTime_ = value; + } + } else { + updateTimeBuilder_.mergeFrom(value); + } + if (updateTime_ != null) { + bitField0_ |= 0x00000010; + onChanged(); + } + return this; + } + + /** + * + * + *
        +     * The latest timestamp at which the room was updated.
        +     * 
        + * + * + * .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearUpdateTime() { + bitField0_ = (bitField0_ & ~0x00000010); + updateTime_ = null; + if (updateTimeBuilder_ != null) { + updateTimeBuilder_.dispose(); + updateTimeBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
        +     * The latest timestamp at which the room was updated.
        +     * 
        + * + * + * .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.Timestamp.Builder getUpdateTimeBuilder() { + bitField0_ |= 0x00000010; + onChanged(); + return getUpdateTimeFieldBuilder().getBuilder(); + } + + /** + * + * + *
        +     * The latest timestamp at which the room was updated.
        +     * 
        + * + * + * .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder() { + if (updateTimeBuilder_ != null) { + return updateTimeBuilder_.getMessageOrBuilder(); + } else { + return updateTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : updateTime_; + } + } + + /** + * + * + *
        +     * The latest timestamp at which the room was updated.
        +     * 
        + * + * + * .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getUpdateTimeFieldBuilder() { + if (updateTimeBuilder_ == null) { + updateTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getUpdateTime(), getParentForChildren(), isClean()); + updateTime_ = null; + } + return updateTimeBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.showcase.v1beta1.Room) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.Room) + private static final com.google.showcase.v1beta1.Room DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.Room(); + } + + public static com.google.showcase.v1beta1.Room getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Room 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.showcase.v1beta1.Room getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/RoomName.java b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/RoomName.java new file mode 100644 index 0000000000..a3c3707242 --- /dev/null +++ b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/RoomName.java @@ -0,0 +1,166 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1; + +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +@Generated("by gapic-generator-java") +public class RoomName implements ResourceName { + private static final PathTemplate ROOM = PathTemplate.createWithoutUrlEncoding("rooms/{room}"); + private volatile Map fieldValuesMap; + private final String room; + + @Deprecated + protected RoomName() { + room = null; + } + + private RoomName(Builder builder) { + room = Preconditions.checkNotNull(builder.getRoom()); + } + + public String getRoom() { + return room; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + public static RoomName of(String room) { + return newBuilder().setRoom(room).build(); + } + + public static String format(String room) { + return newBuilder().setRoom(room).build().toString(); + } + + public static RoomName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + ROOM.validatedMatch(formattedString, "RoomName.parse: formattedString not in valid format"); + return of(matchMap.get("room")); + } + + 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 (RoomName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return ROOM.matches(formattedString); + } + + @Override + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + if (room != null) { + fieldMapBuilder.put("room", room); + } + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return ROOM.instantiate("room", room); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o != null && getClass() == o.getClass()) { + RoomName that = ((RoomName) o); + return Objects.equals(this.room, that.room); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= Objects.hashCode(room); + return h; + } + + /** Builder for rooms/{room}. */ + public static class Builder { + private String room; + + protected Builder() {} + + public String getRoom() { + return room; + } + + public Builder setRoom(String room) { + this.room = room; + return this; + } + + private Builder(RoomName roomName) { + this.room = roomName.room; + } + + public RoomName build() { + return new RoomName(this); + } + } +} diff --git a/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/RoomOrBuilder.java b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/RoomOrBuilder.java new file mode 100644 index 0000000000..486d7cbfa6 --- /dev/null +++ b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/RoomOrBuilder.java @@ -0,0 +1,184 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/messaging.proto + +// Protobuf Java Version: 3.25.8 +package com.google.showcase.v1beta1; + +public interface RoomOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.Room) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
        +   * The resource name of the chat room.
        +   * 
        + * + * string name = 1; + * + * @return The name. + */ + java.lang.String getName(); + + /** + * + * + *
        +   * The resource name of the chat room.
        +   * 
        + * + * string name = 1; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
        +   * The human readable name of the chat room.
        +   * 
        + * + * string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The displayName. + */ + java.lang.String getDisplayName(); + + /** + * + * + *
        +   * The human readable name of the chat room.
        +   * 
        + * + * string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for displayName. + */ + com.google.protobuf.ByteString getDisplayNameBytes(); + + /** + * + * + *
        +   * The description of the chat room.
        +   * 
        + * + * string description = 3; + * + * @return The description. + */ + java.lang.String getDescription(); + + /** + * + * + *
        +   * The description of the chat room.
        +   * 
        + * + * string description = 3; + * + * @return The bytes for description. + */ + com.google.protobuf.ByteString getDescriptionBytes(); + + /** + * + * + *
        +   * The timestamp at which the room was created.
        +   * 
        + * + * .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the createTime field is set. + */ + boolean hasCreateTime(); + + /** + * + * + *
        +   * The timestamp at which the room was created.
        +   * 
        + * + * .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The createTime. + */ + com.google.protobuf.Timestamp getCreateTime(); + + /** + * + * + *
        +   * The timestamp at which the room was created.
        +   * 
        + * + * .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder(); + + /** + * + * + *
        +   * The latest timestamp at which the room was updated.
        +   * 
        + * + * .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the updateTime field is set. + */ + boolean hasUpdateTime(); + + /** + * + * + *
        +   * The latest timestamp at which the room was updated.
        +   * 
        + * + * .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The updateTime. + */ + com.google.protobuf.Timestamp getUpdateTime(); + + /** + * + * + *
        +   * The latest timestamp at which the room was updated.
        +   * 
        + * + * .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder(); +} diff --git a/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/SearchBlurbsMetadata.java b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/SearchBlurbsMetadata.java new file mode 100644 index 0000000000..ca42f14761 --- /dev/null +++ b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/SearchBlurbsMetadata.java @@ -0,0 +1,729 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/messaging.proto + +// Protobuf Java Version: 3.25.8 +package com.google.showcase.v1beta1; + +/** + * + * + *
        + * The operation metadata message for the
        + * google.showcase.v1beta1.Messaging\SearchBlurbs method.
        + * 
        + * + * Protobuf type {@code google.showcase.v1beta1.SearchBlurbsMetadata} + */ +public final class SearchBlurbsMetadata extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.SearchBlurbsMetadata) + SearchBlurbsMetadataOrBuilder { + private static final long serialVersionUID = 0L; + + // Use SearchBlurbsMetadata.newBuilder() to construct. + private SearchBlurbsMetadata(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private SearchBlurbsMetadata() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new SearchBlurbsMetadata(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.MessagingOuterClass + .internal_static_google_showcase_v1beta1_SearchBlurbsMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.MessagingOuterClass + .internal_static_google_showcase_v1beta1_SearchBlurbsMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.SearchBlurbsMetadata.class, + com.google.showcase.v1beta1.SearchBlurbsMetadata.Builder.class); + } + + private int bitField0_; + public static final int RETRY_INFO_FIELD_NUMBER = 1; + private com.google.rpc.RetryInfo retryInfo_; + + /** + * + * + *
        +   * This signals to the client when to next poll for response.
        +   * 
        + * + * .google.rpc.RetryInfo retry_info = 1; + * + * @return Whether the retryInfo field is set. + */ + @java.lang.Override + public boolean hasRetryInfo() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
        +   * This signals to the client when to next poll for response.
        +   * 
        + * + * .google.rpc.RetryInfo retry_info = 1; + * + * @return The retryInfo. + */ + @java.lang.Override + public com.google.rpc.RetryInfo getRetryInfo() { + return retryInfo_ == null ? com.google.rpc.RetryInfo.getDefaultInstance() : retryInfo_; + } + + /** + * + * + *
        +   * This signals to the client when to next poll for response.
        +   * 
        + * + * .google.rpc.RetryInfo retry_info = 1; + */ + @java.lang.Override + public com.google.rpc.RetryInfoOrBuilder getRetryInfoOrBuilder() { + return retryInfo_ == null ? com.google.rpc.RetryInfo.getDefaultInstance() : retryInfo_; + } + + 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, getRetryInfo()); + } + 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, getRetryInfo()); + } + 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.showcase.v1beta1.SearchBlurbsMetadata)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.SearchBlurbsMetadata other = + (com.google.showcase.v1beta1.SearchBlurbsMetadata) obj; + + if (hasRetryInfo() != other.hasRetryInfo()) return false; + if (hasRetryInfo()) { + if (!getRetryInfo().equals(other.getRetryInfo())) 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 (hasRetryInfo()) { + hash = (37 * hash) + RETRY_INFO_FIELD_NUMBER; + hash = (53 * hash) + getRetryInfo().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.showcase.v1beta1.SearchBlurbsMetadata parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.SearchBlurbsMetadata parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.SearchBlurbsMetadata parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.SearchBlurbsMetadata 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.showcase.v1beta1.SearchBlurbsMetadata parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.SearchBlurbsMetadata parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.SearchBlurbsMetadata parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.SearchBlurbsMetadata 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.showcase.v1beta1.SearchBlurbsMetadata parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.SearchBlurbsMetadata 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.showcase.v1beta1.SearchBlurbsMetadata parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.SearchBlurbsMetadata 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.showcase.v1beta1.SearchBlurbsMetadata 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 operation metadata message for the
        +   * google.showcase.v1beta1.Messaging\SearchBlurbs method.
        +   * 
        + * + * Protobuf type {@code google.showcase.v1beta1.SearchBlurbsMetadata} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.SearchBlurbsMetadata) + com.google.showcase.v1beta1.SearchBlurbsMetadataOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.MessagingOuterClass + .internal_static_google_showcase_v1beta1_SearchBlurbsMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.MessagingOuterClass + .internal_static_google_showcase_v1beta1_SearchBlurbsMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.SearchBlurbsMetadata.class, + com.google.showcase.v1beta1.SearchBlurbsMetadata.Builder.class); + } + + // Construct using com.google.showcase.v1beta1.SearchBlurbsMetadata.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getRetryInfoFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + retryInfo_ = null; + if (retryInfoBuilder_ != null) { + retryInfoBuilder_.dispose(); + retryInfoBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.showcase.v1beta1.MessagingOuterClass + .internal_static_google_showcase_v1beta1_SearchBlurbsMetadata_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.SearchBlurbsMetadata getDefaultInstanceForType() { + return com.google.showcase.v1beta1.SearchBlurbsMetadata.getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.SearchBlurbsMetadata build() { + com.google.showcase.v1beta1.SearchBlurbsMetadata result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.SearchBlurbsMetadata buildPartial() { + com.google.showcase.v1beta1.SearchBlurbsMetadata result = + new com.google.showcase.v1beta1.SearchBlurbsMetadata(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.showcase.v1beta1.SearchBlurbsMetadata result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.retryInfo_ = retryInfoBuilder_ == null ? retryInfo_ : retryInfoBuilder_.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.showcase.v1beta1.SearchBlurbsMetadata) { + return mergeFrom((com.google.showcase.v1beta1.SearchBlurbsMetadata) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.showcase.v1beta1.SearchBlurbsMetadata other) { + if (other == com.google.showcase.v1beta1.SearchBlurbsMetadata.getDefaultInstance()) + return this; + if (other.hasRetryInfo()) { + mergeRetryInfo(other.getRetryInfo()); + } + 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(getRetryInfoFieldBuilder().getBuilder(), extensionRegistry); + 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 com.google.rpc.RetryInfo retryInfo_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.rpc.RetryInfo, + com.google.rpc.RetryInfo.Builder, + com.google.rpc.RetryInfoOrBuilder> + retryInfoBuilder_; + + /** + * + * + *
        +     * This signals to the client when to next poll for response.
        +     * 
        + * + * .google.rpc.RetryInfo retry_info = 1; + * + * @return Whether the retryInfo field is set. + */ + public boolean hasRetryInfo() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
        +     * This signals to the client when to next poll for response.
        +     * 
        + * + * .google.rpc.RetryInfo retry_info = 1; + * + * @return The retryInfo. + */ + public com.google.rpc.RetryInfo getRetryInfo() { + if (retryInfoBuilder_ == null) { + return retryInfo_ == null ? com.google.rpc.RetryInfo.getDefaultInstance() : retryInfo_; + } else { + return retryInfoBuilder_.getMessage(); + } + } + + /** + * + * + *
        +     * This signals to the client when to next poll for response.
        +     * 
        + * + * .google.rpc.RetryInfo retry_info = 1; + */ + public Builder setRetryInfo(com.google.rpc.RetryInfo value) { + if (retryInfoBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + retryInfo_ = value; + } else { + retryInfoBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
        +     * This signals to the client when to next poll for response.
        +     * 
        + * + * .google.rpc.RetryInfo retry_info = 1; + */ + public Builder setRetryInfo(com.google.rpc.RetryInfo.Builder builderForValue) { + if (retryInfoBuilder_ == null) { + retryInfo_ = builderForValue.build(); + } else { + retryInfoBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
        +     * This signals to the client when to next poll for response.
        +     * 
        + * + * .google.rpc.RetryInfo retry_info = 1; + */ + public Builder mergeRetryInfo(com.google.rpc.RetryInfo value) { + if (retryInfoBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) + && retryInfo_ != null + && retryInfo_ != com.google.rpc.RetryInfo.getDefaultInstance()) { + getRetryInfoBuilder().mergeFrom(value); + } else { + retryInfo_ = value; + } + } else { + retryInfoBuilder_.mergeFrom(value); + } + if (retryInfo_ != null) { + bitField0_ |= 0x00000001; + onChanged(); + } + return this; + } + + /** + * + * + *
        +     * This signals to the client when to next poll for response.
        +     * 
        + * + * .google.rpc.RetryInfo retry_info = 1; + */ + public Builder clearRetryInfo() { + bitField0_ = (bitField0_ & ~0x00000001); + retryInfo_ = null; + if (retryInfoBuilder_ != null) { + retryInfoBuilder_.dispose(); + retryInfoBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
        +     * This signals to the client when to next poll for response.
        +     * 
        + * + * .google.rpc.RetryInfo retry_info = 1; + */ + public com.google.rpc.RetryInfo.Builder getRetryInfoBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return getRetryInfoFieldBuilder().getBuilder(); + } + + /** + * + * + *
        +     * This signals to the client when to next poll for response.
        +     * 
        + * + * .google.rpc.RetryInfo retry_info = 1; + */ + public com.google.rpc.RetryInfoOrBuilder getRetryInfoOrBuilder() { + if (retryInfoBuilder_ != null) { + return retryInfoBuilder_.getMessageOrBuilder(); + } else { + return retryInfo_ == null ? com.google.rpc.RetryInfo.getDefaultInstance() : retryInfo_; + } + } + + /** + * + * + *
        +     * This signals to the client when to next poll for response.
        +     * 
        + * + * .google.rpc.RetryInfo retry_info = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.rpc.RetryInfo, + com.google.rpc.RetryInfo.Builder, + com.google.rpc.RetryInfoOrBuilder> + getRetryInfoFieldBuilder() { + if (retryInfoBuilder_ == null) { + retryInfoBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.rpc.RetryInfo, + com.google.rpc.RetryInfo.Builder, + com.google.rpc.RetryInfoOrBuilder>( + getRetryInfo(), getParentForChildren(), isClean()); + retryInfo_ = null; + } + return retryInfoBuilder_; + } + + @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.showcase.v1beta1.SearchBlurbsMetadata) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.SearchBlurbsMetadata) + private static final com.google.showcase.v1beta1.SearchBlurbsMetadata DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.SearchBlurbsMetadata(); + } + + public static com.google.showcase.v1beta1.SearchBlurbsMetadata getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SearchBlurbsMetadata 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.showcase.v1beta1.SearchBlurbsMetadata getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/SearchBlurbsMetadataOrBuilder.java b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/SearchBlurbsMetadataOrBuilder.java new file mode 100644 index 0000000000..0ba92ceba3 --- /dev/null +++ b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/SearchBlurbsMetadataOrBuilder.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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/messaging.proto + +// Protobuf Java Version: 3.25.8 +package com.google.showcase.v1beta1; + +public interface SearchBlurbsMetadataOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.SearchBlurbsMetadata) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
        +   * This signals to the client when to next poll for response.
        +   * 
        + * + * .google.rpc.RetryInfo retry_info = 1; + * + * @return Whether the retryInfo field is set. + */ + boolean hasRetryInfo(); + + /** + * + * + *
        +   * This signals to the client when to next poll for response.
        +   * 
        + * + * .google.rpc.RetryInfo retry_info = 1; + * + * @return The retryInfo. + */ + com.google.rpc.RetryInfo getRetryInfo(); + + /** + * + * + *
        +   * This signals to the client when to next poll for response.
        +   * 
        + * + * .google.rpc.RetryInfo retry_info = 1; + */ + com.google.rpc.RetryInfoOrBuilder getRetryInfoOrBuilder(); +} diff --git a/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/SearchBlurbsRequest.java b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/SearchBlurbsRequest.java new file mode 100644 index 0000000000..9da8cb9aef --- /dev/null +++ b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/SearchBlurbsRequest.java @@ -0,0 +1,1154 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/messaging.proto + +// Protobuf Java Version: 3.25.8 +package com.google.showcase.v1beta1; + +/** + * + * + *
        + * The request message for the google.showcase.v1beta1.Messaging\SearchBlurbs
        + * method.
        + * 
        + * + * Protobuf type {@code google.showcase.v1beta1.SearchBlurbsRequest} + */ +public final class SearchBlurbsRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.SearchBlurbsRequest) + SearchBlurbsRequestOrBuilder { + private static final long serialVersionUID = 0L; + + // Use SearchBlurbsRequest.newBuilder() to construct. + private SearchBlurbsRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private SearchBlurbsRequest() { + query_ = ""; + parent_ = ""; + pageToken_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new SearchBlurbsRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.MessagingOuterClass + .internal_static_google_showcase_v1beta1_SearchBlurbsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.MessagingOuterClass + .internal_static_google_showcase_v1beta1_SearchBlurbsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.SearchBlurbsRequest.class, + com.google.showcase.v1beta1.SearchBlurbsRequest.Builder.class); + } + + public static final int QUERY_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object query_ = ""; + + /** + * + * + *
        +   * The query used to search for blurbs containing to words of this string.
        +   * Only posts that contain an exact match of a queried word will be returned.
        +   * 
        + * + * string query = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The query. + */ + @java.lang.Override + public java.lang.String getQuery() { + java.lang.Object ref = query_; + 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(); + query_ = s; + return s; + } + } + + /** + * + * + *
        +   * The query used to search for blurbs containing to words of this string.
        +   * Only posts that contain an exact match of a queried word will be returned.
        +   * 
        + * + * string query = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for query. + */ + @java.lang.Override + public com.google.protobuf.ByteString getQueryBytes() { + java.lang.Object ref = query_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + query_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PARENT_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object parent_ = ""; + + /** + * + * + *
        +   * The rooms or profiles to search. If unset, `SearchBlurbs` will search all
        +   * rooms and all profiles.
        +   * 
        + * + * string parent = 2 [(.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; + } + } + + /** + * + * + *
        +   * The rooms or profiles to search. If unset, `SearchBlurbs` will search all
        +   * rooms and all profiles.
        +   * 
        + * + * string parent = 2 [(.google.api.resource_reference) = { ... } + * + * @return The bytes for parent. + */ + @java.lang.Override + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PAGE_SIZE_FIELD_NUMBER = 3; + private int pageSize_ = 0; + + /** + * + * + *
        +   * The maximum number of blurbs return. Server may return fewer
        +   * blurbs than requested. If unspecified, server will pick an appropriate
        +   * default.
        +   * 
        + * + * int32 page_size = 3; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + + public static final int PAGE_TOKEN_FIELD_NUMBER = 4; + + @SuppressWarnings("serial") + private volatile java.lang.Object pageToken_ = ""; + + /** + * + * + *
        +   * The value of
        +   * google.showcase.v1beta1.SearchBlurbsResponse.next_page_token
        +   * returned from the previous call to
        +   * `google.showcase.v1beta1.Messaging\SearchBlurbs` method.
        +   * 
        + * + * string page_token = 4; + * + * @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; + } + } + + /** + * + * + *
        +   * The value of
        +   * google.showcase.v1beta1.SearchBlurbsResponse.next_page_token
        +   * returned from the previous call to
        +   * `google.showcase.v1beta1.Messaging\SearchBlurbs` method.
        +   * 
        + * + * string page_token = 4; + * + * @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(query_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, query_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, parent_); + } + if (pageSize_ != 0) { + output.writeInt32(3, pageSize_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(pageToken_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, pageToken_); + } + 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(query_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, query_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, parent_); + } + if (pageSize_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(3, pageSize_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(pageToken_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, 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.showcase.v1beta1.SearchBlurbsRequest)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.SearchBlurbsRequest other = + (com.google.showcase.v1beta1.SearchBlurbsRequest) obj; + + if (!getQuery().equals(other.getQuery())) return false; + if (!getParent().equals(other.getParent())) 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) + QUERY_FIELD_NUMBER; + hash = (53 * hash) + getQuery().hashCode(); + hash = (37 * hash) + PARENT_FIELD_NUMBER; + hash = (53 * hash) + getParent().hashCode(); + hash = (37 * hash) + PAGE_SIZE_FIELD_NUMBER; + hash = (53 * hash) + getPageSize(); + hash = (37 * hash) + PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getPageToken().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.showcase.v1beta1.SearchBlurbsRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.SearchBlurbsRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.SearchBlurbsRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.SearchBlurbsRequest 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.showcase.v1beta1.SearchBlurbsRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.SearchBlurbsRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.SearchBlurbsRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.SearchBlurbsRequest 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.showcase.v1beta1.SearchBlurbsRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.SearchBlurbsRequest 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.showcase.v1beta1.SearchBlurbsRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.SearchBlurbsRequest 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.showcase.v1beta1.SearchBlurbsRequest 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 request message for the google.showcase.v1beta1.Messaging\SearchBlurbs
        +   * method.
        +   * 
        + * + * Protobuf type {@code google.showcase.v1beta1.SearchBlurbsRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.SearchBlurbsRequest) + com.google.showcase.v1beta1.SearchBlurbsRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.MessagingOuterClass + .internal_static_google_showcase_v1beta1_SearchBlurbsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.MessagingOuterClass + .internal_static_google_showcase_v1beta1_SearchBlurbsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.SearchBlurbsRequest.class, + com.google.showcase.v1beta1.SearchBlurbsRequest.Builder.class); + } + + // Construct using com.google.showcase.v1beta1.SearchBlurbsRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + query_ = ""; + parent_ = ""; + pageSize_ = 0; + pageToken_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.showcase.v1beta1.MessagingOuterClass + .internal_static_google_showcase_v1beta1_SearchBlurbsRequest_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.SearchBlurbsRequest getDefaultInstanceForType() { + return com.google.showcase.v1beta1.SearchBlurbsRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.SearchBlurbsRequest build() { + com.google.showcase.v1beta1.SearchBlurbsRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.SearchBlurbsRequest buildPartial() { + com.google.showcase.v1beta1.SearchBlurbsRequest result = + new com.google.showcase.v1beta1.SearchBlurbsRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.showcase.v1beta1.SearchBlurbsRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.query_ = query_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.parent_ = parent_; + } + 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.showcase.v1beta1.SearchBlurbsRequest) { + return mergeFrom((com.google.showcase.v1beta1.SearchBlurbsRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.showcase.v1beta1.SearchBlurbsRequest other) { + if (other == com.google.showcase.v1beta1.SearchBlurbsRequest.getDefaultInstance()) + return this; + if (!other.getQuery().isEmpty()) { + query_ = other.query_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + bitField0_ |= 0x00000002; + 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: + { + query_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + parent_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 24: + { + pageSize_ = input.readInt32(); + bitField0_ |= 0x00000004; + break; + } // case 24 + case 34: + { + pageToken_ = input.readStringRequireUtf8(); + 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 query_ = ""; + + /** + * + * + *
        +     * The query used to search for blurbs containing to words of this string.
        +     * Only posts that contain an exact match of a queried word will be returned.
        +     * 
        + * + * string query = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The query. + */ + public java.lang.String getQuery() { + java.lang.Object ref = query_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + query_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
        +     * The query used to search for blurbs containing to words of this string.
        +     * Only posts that contain an exact match of a queried word will be returned.
        +     * 
        + * + * string query = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for query. + */ + public com.google.protobuf.ByteString getQueryBytes() { + java.lang.Object ref = query_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + query_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
        +     * The query used to search for blurbs containing to words of this string.
        +     * Only posts that contain an exact match of a queried word will be returned.
        +     * 
        + * + * string query = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The query to set. + * @return This builder for chaining. + */ + public Builder setQuery(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + query_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
        +     * The query used to search for blurbs containing to words of this string.
        +     * Only posts that contain an exact match of a queried word will be returned.
        +     * 
        + * + * string query = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearQuery() { + query_ = getDefaultInstance().getQuery(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
        +     * The query used to search for blurbs containing to words of this string.
        +     * Only posts that contain an exact match of a queried word will be returned.
        +     * 
        + * + * string query = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for query to set. + * @return This builder for chaining. + */ + public Builder setQueryBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + query_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object parent_ = ""; + + /** + * + * + *
        +     * The rooms or profiles to search. If unset, `SearchBlurbs` will search all
        +     * rooms and all profiles.
        +     * 
        + * + * string parent = 2 [(.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; + } + } + + /** + * + * + *
        +     * The rooms or profiles to search. If unset, `SearchBlurbs` will search all
        +     * rooms and all profiles.
        +     * 
        + * + * string parent = 2 [(.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; + } + } + + /** + * + * + *
        +     * The rooms or profiles to search. If unset, `SearchBlurbs` will search all
        +     * rooms and all profiles.
        +     * 
        + * + * string parent = 2 [(.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_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
        +     * The rooms or profiles to search. If unset, `SearchBlurbs` will search all
        +     * rooms and all profiles.
        +     * 
        + * + * string parent = 2 [(.google.api.resource_reference) = { ... } + * + * @return This builder for chaining. + */ + public Builder clearParent() { + parent_ = getDefaultInstance().getParent(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
        +     * The rooms or profiles to search. If unset, `SearchBlurbs` will search all
        +     * rooms and all profiles.
        +     * 
        + * + * string parent = 2 [(.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_ |= 0x00000002; + onChanged(); + return this; + } + + private int pageSize_; + + /** + * + * + *
        +     * The maximum number of blurbs return. Server may return fewer
        +     * blurbs than requested. If unspecified, server will pick an appropriate
        +     * default.
        +     * 
        + * + * int32 page_size = 3; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + + /** + * + * + *
        +     * The maximum number of blurbs return. Server may return fewer
        +     * blurbs than requested. If unspecified, server will pick an appropriate
        +     * default.
        +     * 
        + * + * int32 page_size = 3; + * + * @param value The pageSize to set. + * @return This builder for chaining. + */ + public Builder setPageSize(int value) { + + pageSize_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
        +     * The maximum number of blurbs return. Server may return fewer
        +     * blurbs than requested. If unspecified, server will pick an appropriate
        +     * default.
        +     * 
        + * + * int32 page_size = 3; + * + * @return This builder for chaining. + */ + public Builder clearPageSize() { + bitField0_ = (bitField0_ & ~0x00000004); + pageSize_ = 0; + onChanged(); + return this; + } + + private java.lang.Object pageToken_ = ""; + + /** + * + * + *
        +     * The value of
        +     * google.showcase.v1beta1.SearchBlurbsResponse.next_page_token
        +     * returned from the previous call to
        +     * `google.showcase.v1beta1.Messaging\SearchBlurbs` method.
        +     * 
        + * + * string page_token = 4; + * + * @return The pageToken. + */ + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
        +     * The value of
        +     * google.showcase.v1beta1.SearchBlurbsResponse.next_page_token
        +     * returned from the previous call to
        +     * `google.showcase.v1beta1.Messaging\SearchBlurbs` method.
        +     * 
        + * + * string page_token = 4; + * + * @return The bytes for pageToken. + */ + public com.google.protobuf.ByteString getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
        +     * The value of
        +     * google.showcase.v1beta1.SearchBlurbsResponse.next_page_token
        +     * returned from the previous call to
        +     * `google.showcase.v1beta1.Messaging\SearchBlurbs` method.
        +     * 
        + * + * string page_token = 4; + * + * @param value The pageToken to set. + * @return This builder for chaining. + */ + public Builder setPageToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + pageToken_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + /** + * + * + *
        +     * The value of
        +     * google.showcase.v1beta1.SearchBlurbsResponse.next_page_token
        +     * returned from the previous call to
        +     * `google.showcase.v1beta1.Messaging\SearchBlurbs` method.
        +     * 
        + * + * string page_token = 4; + * + * @return This builder for chaining. + */ + public Builder clearPageToken() { + pageToken_ = getDefaultInstance().getPageToken(); + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + return this; + } + + /** + * + * + *
        +     * The value of
        +     * google.showcase.v1beta1.SearchBlurbsResponse.next_page_token
        +     * returned from the previous call to
        +     * `google.showcase.v1beta1.Messaging\SearchBlurbs` method.
        +     * 
        + * + * string page_token = 4; + * + * @param value The bytes for pageToken to set. + * @return This builder for chaining. + */ + public Builder setPageTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + pageToken_ = value; + 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.showcase.v1beta1.SearchBlurbsRequest) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.SearchBlurbsRequest) + private static final com.google.showcase.v1beta1.SearchBlurbsRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.SearchBlurbsRequest(); + } + + public static com.google.showcase.v1beta1.SearchBlurbsRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SearchBlurbsRequest 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.showcase.v1beta1.SearchBlurbsRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/SearchBlurbsRequestOrBuilder.java b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/SearchBlurbsRequestOrBuilder.java new file mode 100644 index 0000000000..f06817323a --- /dev/null +++ b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/SearchBlurbsRequestOrBuilder.java @@ -0,0 +1,129 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/messaging.proto + +// Protobuf Java Version: 3.25.8 +package com.google.showcase.v1beta1; + +public interface SearchBlurbsRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.SearchBlurbsRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
        +   * The query used to search for blurbs containing to words of this string.
        +   * Only posts that contain an exact match of a queried word will be returned.
        +   * 
        + * + * string query = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The query. + */ + java.lang.String getQuery(); + + /** + * + * + *
        +   * The query used to search for blurbs containing to words of this string.
        +   * Only posts that contain an exact match of a queried word will be returned.
        +   * 
        + * + * string query = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for query. + */ + com.google.protobuf.ByteString getQueryBytes(); + + /** + * + * + *
        +   * The rooms or profiles to search. If unset, `SearchBlurbs` will search all
        +   * rooms and all profiles.
        +   * 
        + * + * string parent = 2 [(.google.api.resource_reference) = { ... } + * + * @return The parent. + */ + java.lang.String getParent(); + + /** + * + * + *
        +   * The rooms or profiles to search. If unset, `SearchBlurbs` will search all
        +   * rooms and all profiles.
        +   * 
        + * + * string parent = 2 [(.google.api.resource_reference) = { ... } + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
        +   * The maximum number of blurbs return. Server may return fewer
        +   * blurbs than requested. If unspecified, server will pick an appropriate
        +   * default.
        +   * 
        + * + * int32 page_size = 3; + * + * @return The pageSize. + */ + int getPageSize(); + + /** + * + * + *
        +   * The value of
        +   * google.showcase.v1beta1.SearchBlurbsResponse.next_page_token
        +   * returned from the previous call to
        +   * `google.showcase.v1beta1.Messaging\SearchBlurbs` method.
        +   * 
        + * + * string page_token = 4; + * + * @return The pageToken. + */ + java.lang.String getPageToken(); + + /** + * + * + *
        +   * The value of
        +   * google.showcase.v1beta1.SearchBlurbsResponse.next_page_token
        +   * returned from the previous call to
        +   * `google.showcase.v1beta1.Messaging\SearchBlurbs` method.
        +   * 
        + * + * string page_token = 4; + * + * @return The bytes for pageToken. + */ + com.google.protobuf.ByteString getPageTokenBytes(); +} diff --git a/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/SearchBlurbsResponse.java b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/SearchBlurbsResponse.java new file mode 100644 index 0000000000..cbd0a1c7e8 --- /dev/null +++ b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/SearchBlurbsResponse.java @@ -0,0 +1,1169 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/messaging.proto + +// Protobuf Java Version: 3.25.8 +package com.google.showcase.v1beta1; + +/** + * + * + *
        + * The operation response message for the
        + * google.showcase.v1beta1.Messaging\SearchBlurbs method.
        + * 
        + * + * Protobuf type {@code google.showcase.v1beta1.SearchBlurbsResponse} + */ +public final class SearchBlurbsResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.SearchBlurbsResponse) + SearchBlurbsResponseOrBuilder { + private static final long serialVersionUID = 0L; + + // Use SearchBlurbsResponse.newBuilder() to construct. + private SearchBlurbsResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private SearchBlurbsResponse() { + blurbs_ = java.util.Collections.emptyList(); + nextPageToken_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new SearchBlurbsResponse(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.MessagingOuterClass + .internal_static_google_showcase_v1beta1_SearchBlurbsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.MessagingOuterClass + .internal_static_google_showcase_v1beta1_SearchBlurbsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.SearchBlurbsResponse.class, + com.google.showcase.v1beta1.SearchBlurbsResponse.Builder.class); + } + + public static final int BLURBS_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private java.util.List blurbs_; + + /** + * + * + *
        +   * Blurbs that matched the search query.
        +   * 
        + * + * repeated .google.showcase.v1beta1.Blurb blurbs = 1; + */ + @java.lang.Override + public java.util.List getBlurbsList() { + return blurbs_; + } + + /** + * + * + *
        +   * Blurbs that matched the search query.
        +   * 
        + * + * repeated .google.showcase.v1beta1.Blurb blurbs = 1; + */ + @java.lang.Override + public java.util.List + getBlurbsOrBuilderList() { + return blurbs_; + } + + /** + * + * + *
        +   * Blurbs that matched the search query.
        +   * 
        + * + * repeated .google.showcase.v1beta1.Blurb blurbs = 1; + */ + @java.lang.Override + public int getBlurbsCount() { + return blurbs_.size(); + } + + /** + * + * + *
        +   * Blurbs that matched the search query.
        +   * 
        + * + * repeated .google.showcase.v1beta1.Blurb blurbs = 1; + */ + @java.lang.Override + public com.google.showcase.v1beta1.Blurb getBlurbs(int index) { + return blurbs_.get(index); + } + + /** + * + * + *
        +   * Blurbs that matched the search query.
        +   * 
        + * + * repeated .google.showcase.v1beta1.Blurb blurbs = 1; + */ + @java.lang.Override + public com.google.showcase.v1beta1.BlurbOrBuilder getBlurbsOrBuilder(int index) { + return blurbs_.get(index); + } + + public static final int NEXT_PAGE_TOKEN_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object nextPageToken_ = ""; + + /** + * + * + *
        +   * A token to retrieve next page of results.
        +   * Pass this value in SearchBlurbsRequest.page_token field in the subsequent
        +   * call to `google.showcase.v1beta1.Blurb\SearchBlurbs` method to
        +   * retrieve the next page of results.
        +   * 
        + * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + @java.lang.Override + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nextPageToken_ = s; + return s; + } + } + + /** + * + * + *
        +   * A token to retrieve next page of results.
        +   * Pass this value in SearchBlurbsRequest.page_token field in the subsequent
        +   * call to `google.showcase.v1beta1.Blurb\SearchBlurbs` method to
        +   * retrieve the next page of results.
        +   * 
        + * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + nextPageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + for (int i = 0; i < blurbs_.size(); i++) { + output.writeMessage(1, blurbs_.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 < blurbs_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, blurbs_.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.showcase.v1beta1.SearchBlurbsResponse)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.SearchBlurbsResponse other = + (com.google.showcase.v1beta1.SearchBlurbsResponse) obj; + + if (!getBlurbsList().equals(other.getBlurbsList())) 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 (getBlurbsCount() > 0) { + hash = (37 * hash) + BLURBS_FIELD_NUMBER; + hash = (53 * hash) + getBlurbsList().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.showcase.v1beta1.SearchBlurbsResponse parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.SearchBlurbsResponse parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.SearchBlurbsResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.SearchBlurbsResponse 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.showcase.v1beta1.SearchBlurbsResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.SearchBlurbsResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.SearchBlurbsResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.SearchBlurbsResponse 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.showcase.v1beta1.SearchBlurbsResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.SearchBlurbsResponse 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.showcase.v1beta1.SearchBlurbsResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.SearchBlurbsResponse 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.showcase.v1beta1.SearchBlurbsResponse 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 operation response message for the
        +   * google.showcase.v1beta1.Messaging\SearchBlurbs method.
        +   * 
        + * + * Protobuf type {@code google.showcase.v1beta1.SearchBlurbsResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.SearchBlurbsResponse) + com.google.showcase.v1beta1.SearchBlurbsResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.MessagingOuterClass + .internal_static_google_showcase_v1beta1_SearchBlurbsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.MessagingOuterClass + .internal_static_google_showcase_v1beta1_SearchBlurbsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.SearchBlurbsResponse.class, + com.google.showcase.v1beta1.SearchBlurbsResponse.Builder.class); + } + + // Construct using com.google.showcase.v1beta1.SearchBlurbsResponse.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (blurbsBuilder_ == null) { + blurbs_ = java.util.Collections.emptyList(); + } else { + blurbs_ = null; + blurbsBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + nextPageToken_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.showcase.v1beta1.MessagingOuterClass + .internal_static_google_showcase_v1beta1_SearchBlurbsResponse_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.SearchBlurbsResponse getDefaultInstanceForType() { + return com.google.showcase.v1beta1.SearchBlurbsResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.SearchBlurbsResponse build() { + com.google.showcase.v1beta1.SearchBlurbsResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.SearchBlurbsResponse buildPartial() { + com.google.showcase.v1beta1.SearchBlurbsResponse result = + new com.google.showcase.v1beta1.SearchBlurbsResponse(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields( + com.google.showcase.v1beta1.SearchBlurbsResponse result) { + if (blurbsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + blurbs_ = java.util.Collections.unmodifiableList(blurbs_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.blurbs_ = blurbs_; + } else { + result.blurbs_ = blurbsBuilder_.build(); + } + } + + private void buildPartial0(com.google.showcase.v1beta1.SearchBlurbsResponse 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.showcase.v1beta1.SearchBlurbsResponse) { + return mergeFrom((com.google.showcase.v1beta1.SearchBlurbsResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.showcase.v1beta1.SearchBlurbsResponse other) { + if (other == com.google.showcase.v1beta1.SearchBlurbsResponse.getDefaultInstance()) + return this; + if (blurbsBuilder_ == null) { + if (!other.blurbs_.isEmpty()) { + if (blurbs_.isEmpty()) { + blurbs_ = other.blurbs_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureBlurbsIsMutable(); + blurbs_.addAll(other.blurbs_); + } + onChanged(); + } + } else { + if (!other.blurbs_.isEmpty()) { + if (blurbsBuilder_.isEmpty()) { + blurbsBuilder_.dispose(); + blurbsBuilder_ = null; + blurbs_ = other.blurbs_; + bitField0_ = (bitField0_ & ~0x00000001); + blurbsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getBlurbsFieldBuilder() + : null; + } else { + blurbsBuilder_.addAllMessages(other.blurbs_); + } + } + } + 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.showcase.v1beta1.Blurb m = + input.readMessage( + com.google.showcase.v1beta1.Blurb.parser(), extensionRegistry); + if (blurbsBuilder_ == null) { + ensureBlurbsIsMutable(); + blurbs_.add(m); + } else { + blurbsBuilder_.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 blurbs_ = + java.util.Collections.emptyList(); + + private void ensureBlurbsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + blurbs_ = new java.util.ArrayList(blurbs_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.showcase.v1beta1.Blurb, + com.google.showcase.v1beta1.Blurb.Builder, + com.google.showcase.v1beta1.BlurbOrBuilder> + blurbsBuilder_; + + /** + * + * + *
        +     * Blurbs that matched the search query.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Blurb blurbs = 1; + */ + public java.util.List getBlurbsList() { + if (blurbsBuilder_ == null) { + return java.util.Collections.unmodifiableList(blurbs_); + } else { + return blurbsBuilder_.getMessageList(); + } + } + + /** + * + * + *
        +     * Blurbs that matched the search query.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Blurb blurbs = 1; + */ + public int getBlurbsCount() { + if (blurbsBuilder_ == null) { + return blurbs_.size(); + } else { + return blurbsBuilder_.getCount(); + } + } + + /** + * + * + *
        +     * Blurbs that matched the search query.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Blurb blurbs = 1; + */ + public com.google.showcase.v1beta1.Blurb getBlurbs(int index) { + if (blurbsBuilder_ == null) { + return blurbs_.get(index); + } else { + return blurbsBuilder_.getMessage(index); + } + } + + /** + * + * + *
        +     * Blurbs that matched the search query.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Blurb blurbs = 1; + */ + public Builder setBlurbs(int index, com.google.showcase.v1beta1.Blurb value) { + if (blurbsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureBlurbsIsMutable(); + blurbs_.set(index, value); + onChanged(); + } else { + blurbsBuilder_.setMessage(index, value); + } + return this; + } + + /** + * + * + *
        +     * Blurbs that matched the search query.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Blurb blurbs = 1; + */ + public Builder setBlurbs(int index, com.google.showcase.v1beta1.Blurb.Builder builderForValue) { + if (blurbsBuilder_ == null) { + ensureBlurbsIsMutable(); + blurbs_.set(index, builderForValue.build()); + onChanged(); + } else { + blurbsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
        +     * Blurbs that matched the search query.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Blurb blurbs = 1; + */ + public Builder addBlurbs(com.google.showcase.v1beta1.Blurb value) { + if (blurbsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureBlurbsIsMutable(); + blurbs_.add(value); + onChanged(); + } else { + blurbsBuilder_.addMessage(value); + } + return this; + } + + /** + * + * + *
        +     * Blurbs that matched the search query.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Blurb blurbs = 1; + */ + public Builder addBlurbs(int index, com.google.showcase.v1beta1.Blurb value) { + if (blurbsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureBlurbsIsMutable(); + blurbs_.add(index, value); + onChanged(); + } else { + blurbsBuilder_.addMessage(index, value); + } + return this; + } + + /** + * + * + *
        +     * Blurbs that matched the search query.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Blurb blurbs = 1; + */ + public Builder addBlurbs(com.google.showcase.v1beta1.Blurb.Builder builderForValue) { + if (blurbsBuilder_ == null) { + ensureBlurbsIsMutable(); + blurbs_.add(builderForValue.build()); + onChanged(); + } else { + blurbsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + + /** + * + * + *
        +     * Blurbs that matched the search query.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Blurb blurbs = 1; + */ + public Builder addBlurbs(int index, com.google.showcase.v1beta1.Blurb.Builder builderForValue) { + if (blurbsBuilder_ == null) { + ensureBlurbsIsMutable(); + blurbs_.add(index, builderForValue.build()); + onChanged(); + } else { + blurbsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
        +     * Blurbs that matched the search query.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Blurb blurbs = 1; + */ + public Builder addAllBlurbs( + java.lang.Iterable values) { + if (blurbsBuilder_ == null) { + ensureBlurbsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, blurbs_); + onChanged(); + } else { + blurbsBuilder_.addAllMessages(values); + } + return this; + } + + /** + * + * + *
        +     * Blurbs that matched the search query.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Blurb blurbs = 1; + */ + public Builder clearBlurbs() { + if (blurbsBuilder_ == null) { + blurbs_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + blurbsBuilder_.clear(); + } + return this; + } + + /** + * + * + *
        +     * Blurbs that matched the search query.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Blurb blurbs = 1; + */ + public Builder removeBlurbs(int index) { + if (blurbsBuilder_ == null) { + ensureBlurbsIsMutable(); + blurbs_.remove(index); + onChanged(); + } else { + blurbsBuilder_.remove(index); + } + return this; + } + + /** + * + * + *
        +     * Blurbs that matched the search query.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Blurb blurbs = 1; + */ + public com.google.showcase.v1beta1.Blurb.Builder getBlurbsBuilder(int index) { + return getBlurbsFieldBuilder().getBuilder(index); + } + + /** + * + * + *
        +     * Blurbs that matched the search query.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Blurb blurbs = 1; + */ + public com.google.showcase.v1beta1.BlurbOrBuilder getBlurbsOrBuilder(int index) { + if (blurbsBuilder_ == null) { + return blurbs_.get(index); + } else { + return blurbsBuilder_.getMessageOrBuilder(index); + } + } + + /** + * + * + *
        +     * Blurbs that matched the search query.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Blurb blurbs = 1; + */ + public java.util.List + getBlurbsOrBuilderList() { + if (blurbsBuilder_ != null) { + return blurbsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(blurbs_); + } + } + + /** + * + * + *
        +     * Blurbs that matched the search query.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Blurb blurbs = 1; + */ + public com.google.showcase.v1beta1.Blurb.Builder addBlurbsBuilder() { + return getBlurbsFieldBuilder() + .addBuilder(com.google.showcase.v1beta1.Blurb.getDefaultInstance()); + } + + /** + * + * + *
        +     * Blurbs that matched the search query.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Blurb blurbs = 1; + */ + public com.google.showcase.v1beta1.Blurb.Builder addBlurbsBuilder(int index) { + return getBlurbsFieldBuilder() + .addBuilder(index, com.google.showcase.v1beta1.Blurb.getDefaultInstance()); + } + + /** + * + * + *
        +     * Blurbs that matched the search query.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Blurb blurbs = 1; + */ + public java.util.List getBlurbsBuilderList() { + return getBlurbsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.showcase.v1beta1.Blurb, + com.google.showcase.v1beta1.Blurb.Builder, + com.google.showcase.v1beta1.BlurbOrBuilder> + getBlurbsFieldBuilder() { + if (blurbsBuilder_ == null) { + blurbsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.showcase.v1beta1.Blurb, + com.google.showcase.v1beta1.Blurb.Builder, + com.google.showcase.v1beta1.BlurbOrBuilder>( + blurbs_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + blurbs_ = null; + } + return blurbsBuilder_; + } + + private java.lang.Object nextPageToken_ = ""; + + /** + * + * + *
        +     * A token to retrieve next page of results.
        +     * Pass this value in SearchBlurbsRequest.page_token field in the subsequent
        +     * call to `google.showcase.v1beta1.Blurb\SearchBlurbs` method to
        +     * retrieve the next page of results.
        +     * 
        + * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nextPageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
        +     * A token to retrieve next page of results.
        +     * Pass this value in SearchBlurbsRequest.page_token field in the subsequent
        +     * call to `google.showcase.v1beta1.Blurb\SearchBlurbs` method to
        +     * retrieve the next page of results.
        +     * 
        + * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + public com.google.protobuf.ByteString getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + nextPageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
        +     * A token to retrieve next page of results.
        +     * Pass this value in SearchBlurbsRequest.page_token field in the subsequent
        +     * call to `google.showcase.v1beta1.Blurb\SearchBlurbs` method to
        +     * retrieve the next page of results.
        +     * 
        + * + * string next_page_token = 2; + * + * @param value The nextPageToken to set. + * @return This builder for chaining. + */ + public Builder setNextPageToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + nextPageToken_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
        +     * A token to retrieve next page of results.
        +     * Pass this value in SearchBlurbsRequest.page_token field in the subsequent
        +     * call to `google.showcase.v1beta1.Blurb\SearchBlurbs` method to
        +     * retrieve the next page of results.
        +     * 
        + * + * string next_page_token = 2; + * + * @return This builder for chaining. + */ + public Builder clearNextPageToken() { + nextPageToken_ = getDefaultInstance().getNextPageToken(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
        +     * A token to retrieve next page of results.
        +     * Pass this value in SearchBlurbsRequest.page_token field in the subsequent
        +     * call to `google.showcase.v1beta1.Blurb\SearchBlurbs` method to
        +     * retrieve the next page of results.
        +     * 
        + * + * string next_page_token = 2; + * + * @param value The bytes for nextPageToken to set. + * @return This builder for chaining. + */ + public Builder setNextPageTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + nextPageToken_ = value; + 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.showcase.v1beta1.SearchBlurbsResponse) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.SearchBlurbsResponse) + private static final com.google.showcase.v1beta1.SearchBlurbsResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.SearchBlurbsResponse(); + } + + public static com.google.showcase.v1beta1.SearchBlurbsResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SearchBlurbsResponse 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.showcase.v1beta1.SearchBlurbsResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/SearchBlurbsResponseOrBuilder.java b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/SearchBlurbsResponseOrBuilder.java new file mode 100644 index 0000000000..d0c6cc0798 --- /dev/null +++ b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/SearchBlurbsResponseOrBuilder.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: schema/google/showcase/v1beta1/messaging.proto + +// Protobuf Java Version: 3.25.8 +package com.google.showcase.v1beta1; + +public interface SearchBlurbsResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.SearchBlurbsResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
        +   * Blurbs that matched the search query.
        +   * 
        + * + * repeated .google.showcase.v1beta1.Blurb blurbs = 1; + */ + java.util.List getBlurbsList(); + + /** + * + * + *
        +   * Blurbs that matched the search query.
        +   * 
        + * + * repeated .google.showcase.v1beta1.Blurb blurbs = 1; + */ + com.google.showcase.v1beta1.Blurb getBlurbs(int index); + + /** + * + * + *
        +   * Blurbs that matched the search query.
        +   * 
        + * + * repeated .google.showcase.v1beta1.Blurb blurbs = 1; + */ + int getBlurbsCount(); + + /** + * + * + *
        +   * Blurbs that matched the search query.
        +   * 
        + * + * repeated .google.showcase.v1beta1.Blurb blurbs = 1; + */ + java.util.List getBlurbsOrBuilderList(); + + /** + * + * + *
        +   * Blurbs that matched the search query.
        +   * 
        + * + * repeated .google.showcase.v1beta1.Blurb blurbs = 1; + */ + com.google.showcase.v1beta1.BlurbOrBuilder getBlurbsOrBuilder(int index); + + /** + * + * + *
        +   * A token to retrieve next page of results.
        +   * Pass this value in SearchBlurbsRequest.page_token field in the subsequent
        +   * call to `google.showcase.v1beta1.Blurb\SearchBlurbs` method to
        +   * retrieve the next page of results.
        +   * 
        + * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + java.lang.String getNextPageToken(); + + /** + * + * + *
        +   * A token to retrieve next page of results.
        +   * Pass this value in SearchBlurbsRequest.page_token field in the subsequent
        +   * call to `google.showcase.v1beta1.Blurb\SearchBlurbs` method to
        +   * retrieve the next page of results.
        +   * 
        + * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + com.google.protobuf.ByteString getNextPageTokenBytes(); +} diff --git a/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/SendBlurbsResponse.java b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/SendBlurbsResponse.java new file mode 100644 index 0000000000..a65386b9b6 --- /dev/null +++ b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/SendBlurbsResponse.java @@ -0,0 +1,736 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/messaging.proto + +// Protobuf Java Version: 3.25.8 +package com.google.showcase.v1beta1; + +/** + * + * + *
        + * The response message for the google.showcase.v1beta1.Messaging\SendBlurbs
        + * method.
        + * 
        + * + * Protobuf type {@code google.showcase.v1beta1.SendBlurbsResponse} + */ +public final class SendBlurbsResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.SendBlurbsResponse) + SendBlurbsResponseOrBuilder { + private static final long serialVersionUID = 0L; + + // Use SendBlurbsResponse.newBuilder() to construct. + private SendBlurbsResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private SendBlurbsResponse() { + names_ = com.google.protobuf.LazyStringArrayList.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new SendBlurbsResponse(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.MessagingOuterClass + .internal_static_google_showcase_v1beta1_SendBlurbsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.MessagingOuterClass + .internal_static_google_showcase_v1beta1_SendBlurbsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.SendBlurbsResponse.class, + com.google.showcase.v1beta1.SendBlurbsResponse.Builder.class); + } + + public static final int NAMES_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private com.google.protobuf.LazyStringArrayList names_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + + /** + * + * + *
        +   * The names of successful blurb creations.
        +   * 
        + * + * repeated string names = 1; + * + * @return A list containing the names. + */ + public com.google.protobuf.ProtocolStringList getNamesList() { + return names_; + } + + /** + * + * + *
        +   * The names of successful blurb creations.
        +   * 
        + * + * repeated string names = 1; + * + * @return The count of names. + */ + public int getNamesCount() { + return names_.size(); + } + + /** + * + * + *
        +   * The names of successful blurb creations.
        +   * 
        + * + * repeated string names = 1; + * + * @param index The index of the element to return. + * @return The names at the given index. + */ + public java.lang.String getNames(int index) { + return names_.get(index); + } + + /** + * + * + *
        +   * The names of successful blurb creations.
        +   * 
        + * + * repeated string names = 1; + * + * @param index The index of the value to return. + * @return The bytes of the names at the given index. + */ + public com.google.protobuf.ByteString getNamesBytes(int index) { + return names_.getByteString(index); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + for (int i = 0; i < names_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, names_.getRaw(i)); + } + 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 < names_.size(); i++) { + dataSize += computeStringSizeNoTag(names_.getRaw(i)); + } + size += dataSize; + size += 1 * getNamesList().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.showcase.v1beta1.SendBlurbsResponse)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.SendBlurbsResponse other = + (com.google.showcase.v1beta1.SendBlurbsResponse) obj; + + if (!getNamesList().equals(other.getNamesList())) 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 (getNamesCount() > 0) { + hash = (37 * hash) + NAMES_FIELD_NUMBER; + hash = (53 * hash) + getNamesList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.showcase.v1beta1.SendBlurbsResponse parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.SendBlurbsResponse parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.SendBlurbsResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.SendBlurbsResponse 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.showcase.v1beta1.SendBlurbsResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.SendBlurbsResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.SendBlurbsResponse parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.SendBlurbsResponse 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.showcase.v1beta1.SendBlurbsResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.SendBlurbsResponse 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.showcase.v1beta1.SendBlurbsResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.SendBlurbsResponse 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.showcase.v1beta1.SendBlurbsResponse 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 message for the google.showcase.v1beta1.Messaging\SendBlurbs
        +   * method.
        +   * 
        + * + * Protobuf type {@code google.showcase.v1beta1.SendBlurbsResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.SendBlurbsResponse) + com.google.showcase.v1beta1.SendBlurbsResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.MessagingOuterClass + .internal_static_google_showcase_v1beta1_SendBlurbsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.MessagingOuterClass + .internal_static_google_showcase_v1beta1_SendBlurbsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.SendBlurbsResponse.class, + com.google.showcase.v1beta1.SendBlurbsResponse.Builder.class); + } + + // Construct using com.google.showcase.v1beta1.SendBlurbsResponse.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + names_ = com.google.protobuf.LazyStringArrayList.emptyList(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.showcase.v1beta1.MessagingOuterClass + .internal_static_google_showcase_v1beta1_SendBlurbsResponse_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.SendBlurbsResponse getDefaultInstanceForType() { + return com.google.showcase.v1beta1.SendBlurbsResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.SendBlurbsResponse build() { + com.google.showcase.v1beta1.SendBlurbsResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.SendBlurbsResponse buildPartial() { + com.google.showcase.v1beta1.SendBlurbsResponse result = + new com.google.showcase.v1beta1.SendBlurbsResponse(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.showcase.v1beta1.SendBlurbsResponse result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + names_.makeImmutable(); + result.names_ = names_; + } + } + + @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.showcase.v1beta1.SendBlurbsResponse) { + return mergeFrom((com.google.showcase.v1beta1.SendBlurbsResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.showcase.v1beta1.SendBlurbsResponse other) { + if (other == com.google.showcase.v1beta1.SendBlurbsResponse.getDefaultInstance()) return this; + if (!other.names_.isEmpty()) { + if (names_.isEmpty()) { + names_ = other.names_; + bitField0_ |= 0x00000001; + } else { + ensureNamesIsMutable(); + names_.addAll(other.names_); + } + 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: + { + java.lang.String s = input.readStringRequireUtf8(); + ensureNamesIsMutable(); + names_.add(s); + 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 com.google.protobuf.LazyStringArrayList names_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + + private void ensureNamesIsMutable() { + if (!names_.isModifiable()) { + names_ = new com.google.protobuf.LazyStringArrayList(names_); + } + bitField0_ |= 0x00000001; + } + + /** + * + * + *
        +     * The names of successful blurb creations.
        +     * 
        + * + * repeated string names = 1; + * + * @return A list containing the names. + */ + public com.google.protobuf.ProtocolStringList getNamesList() { + names_.makeImmutable(); + return names_; + } + + /** + * + * + *
        +     * The names of successful blurb creations.
        +     * 
        + * + * repeated string names = 1; + * + * @return The count of names. + */ + public int getNamesCount() { + return names_.size(); + } + + /** + * + * + *
        +     * The names of successful blurb creations.
        +     * 
        + * + * repeated string names = 1; + * + * @param index The index of the element to return. + * @return The names at the given index. + */ + public java.lang.String getNames(int index) { + return names_.get(index); + } + + /** + * + * + *
        +     * The names of successful blurb creations.
        +     * 
        + * + * repeated string names = 1; + * + * @param index The index of the value to return. + * @return The bytes of the names at the given index. + */ + public com.google.protobuf.ByteString getNamesBytes(int index) { + return names_.getByteString(index); + } + + /** + * + * + *
        +     * The names of successful blurb creations.
        +     * 
        + * + * repeated string names = 1; + * + * @param index The index to set the value at. + * @param value The names to set. + * @return This builder for chaining. + */ + public Builder setNames(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureNamesIsMutable(); + names_.set(index, value); + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
        +     * The names of successful blurb creations.
        +     * 
        + * + * repeated string names = 1; + * + * @param value The names to add. + * @return This builder for chaining. + */ + public Builder addNames(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureNamesIsMutable(); + names_.add(value); + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
        +     * The names of successful blurb creations.
        +     * 
        + * + * repeated string names = 1; + * + * @param values The names to add. + * @return This builder for chaining. + */ + public Builder addAllNames(java.lang.Iterable values) { + ensureNamesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, names_); + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
        +     * The names of successful blurb creations.
        +     * 
        + * + * repeated string names = 1; + * + * @return This builder for chaining. + */ + public Builder clearNames() { + names_ = com.google.protobuf.LazyStringArrayList.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + ; + onChanged(); + return this; + } + + /** + * + * + *
        +     * The names of successful blurb creations.
        +     * 
        + * + * repeated string names = 1; + * + * @param value The bytes of the names to add. + * @return This builder for chaining. + */ + public Builder addNamesBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureNamesIsMutable(); + names_.add(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.showcase.v1beta1.SendBlurbsResponse) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.SendBlurbsResponse) + private static final com.google.showcase.v1beta1.SendBlurbsResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.SendBlurbsResponse(); + } + + public static com.google.showcase.v1beta1.SendBlurbsResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SendBlurbsResponse 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.showcase.v1beta1.SendBlurbsResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/SendBlurbsResponseOrBuilder.java b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/SendBlurbsResponseOrBuilder.java new file mode 100644 index 0000000000..2160e86809 --- /dev/null +++ b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/SendBlurbsResponseOrBuilder.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: schema/google/showcase/v1beta1/messaging.proto + +// Protobuf Java Version: 3.25.8 +package com.google.showcase.v1beta1; + +public interface SendBlurbsResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.SendBlurbsResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
        +   * The names of successful blurb creations.
        +   * 
        + * + * repeated string names = 1; + * + * @return A list containing the names. + */ + java.util.List getNamesList(); + + /** + * + * + *
        +   * The names of successful blurb creations.
        +   * 
        + * + * repeated string names = 1; + * + * @return The count of names. + */ + int getNamesCount(); + + /** + * + * + *
        +   * The names of successful blurb creations.
        +   * 
        + * + * repeated string names = 1; + * + * @param index The index of the element to return. + * @return The names at the given index. + */ + java.lang.String getNames(int index); + + /** + * + * + *
        +   * The names of successful blurb creations.
        +   * 
        + * + * repeated string names = 1; + * + * @param index The index of the value to return. + * @return The bytes of the names at the given index. + */ + com.google.protobuf.ByteString getNamesBytes(int index); +} diff --git a/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/Sequence.java b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/Sequence.java new file mode 100644 index 0000000000..ab361d6200 --- /dev/null +++ b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/Sequence.java @@ -0,0 +1,2171 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/sequence.proto + +// Protobuf Java Version: 3.25.8 +package com.google.showcase.v1beta1; + +/** Protobuf type {@code google.showcase.v1beta1.Sequence} */ +public final class Sequence extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.Sequence) + SequenceOrBuilder { + private static final long serialVersionUID = 0L; + + // Use Sequence.newBuilder() to construct. + private Sequence(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Sequence() { + name_ = ""; + responses_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Sequence(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.SequenceOuterClass + .internal_static_google_showcase_v1beta1_Sequence_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.SequenceOuterClass + .internal_static_google_showcase_v1beta1_Sequence_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.Sequence.class, + com.google.showcase.v1beta1.Sequence.Builder.class); + } + + public interface ResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.Sequence.Response) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
        +     * The status to return for an individual attempt.
        +     * 
        + * + * .google.rpc.Status status = 1; + * + * @return Whether the status field is set. + */ + boolean hasStatus(); + + /** + * + * + *
        +     * The status to return for an individual attempt.
        +     * 
        + * + * .google.rpc.Status status = 1; + * + * @return The status. + */ + com.google.rpc.Status getStatus(); + + /** + * + * + *
        +     * The status to return for an individual attempt.
        +     * 
        + * + * .google.rpc.Status status = 1; + */ + com.google.rpc.StatusOrBuilder getStatusOrBuilder(); + + /** + * + * + *
        +     * The amount of time to delay sending the response.
        +     * 
        + * + * .google.protobuf.Duration delay = 2; + * + * @return Whether the delay field is set. + */ + boolean hasDelay(); + + /** + * + * + *
        +     * The amount of time to delay sending the response.
        +     * 
        + * + * .google.protobuf.Duration delay = 2; + * + * @return The delay. + */ + com.google.protobuf.Duration getDelay(); + + /** + * + * + *
        +     * The amount of time to delay sending the response.
        +     * 
        + * + * .google.protobuf.Duration delay = 2; + */ + com.google.protobuf.DurationOrBuilder getDelayOrBuilder(); + } + + /** + * + * + *
        +   * A server response to an RPC Attempt in a sequence.
        +   * 
        + * + * Protobuf type {@code google.showcase.v1beta1.Sequence.Response} + */ + public static final class Response extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.Sequence.Response) + ResponseOrBuilder { + private static final long serialVersionUID = 0L; + + // Use Response.newBuilder() to construct. + private Response(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Response() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Response(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.SequenceOuterClass + .internal_static_google_showcase_v1beta1_Sequence_Response_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.SequenceOuterClass + .internal_static_google_showcase_v1beta1_Sequence_Response_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.Sequence.Response.class, + com.google.showcase.v1beta1.Sequence.Response.Builder.class); + } + + private int bitField0_; + public static final int STATUS_FIELD_NUMBER = 1; + private com.google.rpc.Status status_; + + /** + * + * + *
        +     * The status to return for an individual attempt.
        +     * 
        + * + * .google.rpc.Status status = 1; + * + * @return Whether the status field is set. + */ + @java.lang.Override + public boolean hasStatus() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
        +     * The status to return for an individual attempt.
        +     * 
        + * + * .google.rpc.Status status = 1; + * + * @return The status. + */ + @java.lang.Override + public com.google.rpc.Status getStatus() { + return status_ == null ? com.google.rpc.Status.getDefaultInstance() : status_; + } + + /** + * + * + *
        +     * The status to return for an individual attempt.
        +     * 
        + * + * .google.rpc.Status status = 1; + */ + @java.lang.Override + public com.google.rpc.StatusOrBuilder getStatusOrBuilder() { + return status_ == null ? com.google.rpc.Status.getDefaultInstance() : status_; + } + + public static final int DELAY_FIELD_NUMBER = 2; + private com.google.protobuf.Duration delay_; + + /** + * + * + *
        +     * The amount of time to delay sending the response.
        +     * 
        + * + * .google.protobuf.Duration delay = 2; + * + * @return Whether the delay field is set. + */ + @java.lang.Override + public boolean hasDelay() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
        +     * The amount of time to delay sending the response.
        +     * 
        + * + * .google.protobuf.Duration delay = 2; + * + * @return The delay. + */ + @java.lang.Override + public com.google.protobuf.Duration getDelay() { + return delay_ == null ? com.google.protobuf.Duration.getDefaultInstance() : delay_; + } + + /** + * + * + *
        +     * The amount of time to delay sending the response.
        +     * 
        + * + * .google.protobuf.Duration delay = 2; + */ + @java.lang.Override + public com.google.protobuf.DurationOrBuilder getDelayOrBuilder() { + return delay_ == null ? com.google.protobuf.Duration.getDefaultInstance() : delay_; + } + + 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, getStatus()); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeMessage(2, getDelay()); + } + 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, getStatus()); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getDelay()); + } + 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.showcase.v1beta1.Sequence.Response)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.Sequence.Response other = + (com.google.showcase.v1beta1.Sequence.Response) obj; + + if (hasStatus() != other.hasStatus()) return false; + if (hasStatus()) { + if (!getStatus().equals(other.getStatus())) return false; + } + if (hasDelay() != other.hasDelay()) return false; + if (hasDelay()) { + if (!getDelay().equals(other.getDelay())) 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 (hasStatus()) { + hash = (37 * hash) + STATUS_FIELD_NUMBER; + hash = (53 * hash) + getStatus().hashCode(); + } + if (hasDelay()) { + hash = (37 * hash) + DELAY_FIELD_NUMBER; + hash = (53 * hash) + getDelay().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.showcase.v1beta1.Sequence.Response parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.Sequence.Response parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.Sequence.Response parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.Sequence.Response 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.showcase.v1beta1.Sequence.Response parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.Sequence.Response parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.Sequence.Response parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.Sequence.Response 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.showcase.v1beta1.Sequence.Response parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.Sequence.Response 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.showcase.v1beta1.Sequence.Response parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.Sequence.Response 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.showcase.v1beta1.Sequence.Response prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
        +     * A server response to an RPC Attempt in a sequence.
        +     * 
        + * + * Protobuf type {@code google.showcase.v1beta1.Sequence.Response} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.Sequence.Response) + com.google.showcase.v1beta1.Sequence.ResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.SequenceOuterClass + .internal_static_google_showcase_v1beta1_Sequence_Response_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.SequenceOuterClass + .internal_static_google_showcase_v1beta1_Sequence_Response_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.Sequence.Response.class, + com.google.showcase.v1beta1.Sequence.Response.Builder.class); + } + + // Construct using com.google.showcase.v1beta1.Sequence.Response.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getStatusFieldBuilder(); + getDelayFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + status_ = null; + if (statusBuilder_ != null) { + statusBuilder_.dispose(); + statusBuilder_ = null; + } + delay_ = null; + if (delayBuilder_ != null) { + delayBuilder_.dispose(); + delayBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.showcase.v1beta1.SequenceOuterClass + .internal_static_google_showcase_v1beta1_Sequence_Response_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.Sequence.Response getDefaultInstanceForType() { + return com.google.showcase.v1beta1.Sequence.Response.getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.Sequence.Response build() { + com.google.showcase.v1beta1.Sequence.Response result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.Sequence.Response buildPartial() { + com.google.showcase.v1beta1.Sequence.Response result = + new com.google.showcase.v1beta1.Sequence.Response(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.showcase.v1beta1.Sequence.Response result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.status_ = statusBuilder_ == null ? status_ : statusBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.delay_ = delayBuilder_ == null ? delay_ : delayBuilder_.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.showcase.v1beta1.Sequence.Response) { + return mergeFrom((com.google.showcase.v1beta1.Sequence.Response) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.showcase.v1beta1.Sequence.Response other) { + if (other == com.google.showcase.v1beta1.Sequence.Response.getDefaultInstance()) + return this; + if (other.hasStatus()) { + mergeStatus(other.getStatus()); + } + if (other.hasDelay()) { + mergeDelay(other.getDelay()); + } + 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(getStatusFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + input.readMessage(getDelayFieldBuilder().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 com.google.rpc.Status status_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.rpc.Status, com.google.rpc.Status.Builder, com.google.rpc.StatusOrBuilder> + statusBuilder_; + + /** + * + * + *
        +       * The status to return for an individual attempt.
        +       * 
        + * + * .google.rpc.Status status = 1; + * + * @return Whether the status field is set. + */ + public boolean hasStatus() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
        +       * The status to return for an individual attempt.
        +       * 
        + * + * .google.rpc.Status status = 1; + * + * @return The status. + */ + public com.google.rpc.Status getStatus() { + if (statusBuilder_ == null) { + return status_ == null ? com.google.rpc.Status.getDefaultInstance() : status_; + } else { + return statusBuilder_.getMessage(); + } + } + + /** + * + * + *
        +       * The status to return for an individual attempt.
        +       * 
        + * + * .google.rpc.Status status = 1; + */ + public Builder setStatus(com.google.rpc.Status value) { + if (statusBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + status_ = value; + } else { + statusBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
        +       * The status to return for an individual attempt.
        +       * 
        + * + * .google.rpc.Status status = 1; + */ + public Builder setStatus(com.google.rpc.Status.Builder builderForValue) { + if (statusBuilder_ == null) { + status_ = builderForValue.build(); + } else { + statusBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
        +       * The status to return for an individual attempt.
        +       * 
        + * + * .google.rpc.Status status = 1; + */ + public Builder mergeStatus(com.google.rpc.Status value) { + if (statusBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) + && status_ != null + && status_ != com.google.rpc.Status.getDefaultInstance()) { + getStatusBuilder().mergeFrom(value); + } else { + status_ = value; + } + } else { + statusBuilder_.mergeFrom(value); + } + if (status_ != null) { + bitField0_ |= 0x00000001; + onChanged(); + } + return this; + } + + /** + * + * + *
        +       * The status to return for an individual attempt.
        +       * 
        + * + * .google.rpc.Status status = 1; + */ + public Builder clearStatus() { + bitField0_ = (bitField0_ & ~0x00000001); + status_ = null; + if (statusBuilder_ != null) { + statusBuilder_.dispose(); + statusBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
        +       * The status to return for an individual attempt.
        +       * 
        + * + * .google.rpc.Status status = 1; + */ + public com.google.rpc.Status.Builder getStatusBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return getStatusFieldBuilder().getBuilder(); + } + + /** + * + * + *
        +       * The status to return for an individual attempt.
        +       * 
        + * + * .google.rpc.Status status = 1; + */ + public com.google.rpc.StatusOrBuilder getStatusOrBuilder() { + if (statusBuilder_ != null) { + return statusBuilder_.getMessageOrBuilder(); + } else { + return status_ == null ? com.google.rpc.Status.getDefaultInstance() : status_; + } + } + + /** + * + * + *
        +       * The status to return for an individual attempt.
        +       * 
        + * + * .google.rpc.Status status = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.rpc.Status, com.google.rpc.Status.Builder, com.google.rpc.StatusOrBuilder> + getStatusFieldBuilder() { + if (statusBuilder_ == null) { + statusBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.rpc.Status, + com.google.rpc.Status.Builder, + com.google.rpc.StatusOrBuilder>(getStatus(), getParentForChildren(), isClean()); + status_ = null; + } + return statusBuilder_; + } + + private com.google.protobuf.Duration delay_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder> + delayBuilder_; + + /** + * + * + *
        +       * The amount of time to delay sending the response.
        +       * 
        + * + * .google.protobuf.Duration delay = 2; + * + * @return Whether the delay field is set. + */ + public boolean hasDelay() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
        +       * The amount of time to delay sending the response.
        +       * 
        + * + * .google.protobuf.Duration delay = 2; + * + * @return The delay. + */ + public com.google.protobuf.Duration getDelay() { + if (delayBuilder_ == null) { + return delay_ == null ? com.google.protobuf.Duration.getDefaultInstance() : delay_; + } else { + return delayBuilder_.getMessage(); + } + } + + /** + * + * + *
        +       * The amount of time to delay sending the response.
        +       * 
        + * + * .google.protobuf.Duration delay = 2; + */ + public Builder setDelay(com.google.protobuf.Duration value) { + if (delayBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + delay_ = value; + } else { + delayBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
        +       * The amount of time to delay sending the response.
        +       * 
        + * + * .google.protobuf.Duration delay = 2; + */ + public Builder setDelay(com.google.protobuf.Duration.Builder builderForValue) { + if (delayBuilder_ == null) { + delay_ = builderForValue.build(); + } else { + delayBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
        +       * The amount of time to delay sending the response.
        +       * 
        + * + * .google.protobuf.Duration delay = 2; + */ + public Builder mergeDelay(com.google.protobuf.Duration value) { + if (delayBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && delay_ != null + && delay_ != com.google.protobuf.Duration.getDefaultInstance()) { + getDelayBuilder().mergeFrom(value); + } else { + delay_ = value; + } + } else { + delayBuilder_.mergeFrom(value); + } + if (delay_ != null) { + bitField0_ |= 0x00000002; + onChanged(); + } + return this; + } + + /** + * + * + *
        +       * The amount of time to delay sending the response.
        +       * 
        + * + * .google.protobuf.Duration delay = 2; + */ + public Builder clearDelay() { + bitField0_ = (bitField0_ & ~0x00000002); + delay_ = null; + if (delayBuilder_ != null) { + delayBuilder_.dispose(); + delayBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
        +       * The amount of time to delay sending the response.
        +       * 
        + * + * .google.protobuf.Duration delay = 2; + */ + public com.google.protobuf.Duration.Builder getDelayBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return getDelayFieldBuilder().getBuilder(); + } + + /** + * + * + *
        +       * The amount of time to delay sending the response.
        +       * 
        + * + * .google.protobuf.Duration delay = 2; + */ + public com.google.protobuf.DurationOrBuilder getDelayOrBuilder() { + if (delayBuilder_ != null) { + return delayBuilder_.getMessageOrBuilder(); + } else { + return delay_ == null ? com.google.protobuf.Duration.getDefaultInstance() : delay_; + } + } + + /** + * + * + *
        +       * The amount of time to delay sending the response.
        +       * 
        + * + * .google.protobuf.Duration delay = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder> + getDelayFieldBuilder() { + if (delayBuilder_ == null) { + delayBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder>( + getDelay(), getParentForChildren(), isClean()); + delay_ = null; + } + return delayBuilder_; + } + + @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.showcase.v1beta1.Sequence.Response) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.Sequence.Response) + private static final com.google.showcase.v1beta1.Sequence.Response DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.Sequence.Response(); + } + + public static com.google.showcase.v1beta1.Sequence.Response getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Response 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.showcase.v1beta1.Sequence.Response getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + + /** + * 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; + } + } + + /** + * 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 RESPONSES_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private java.util.List responses_; + + /** + * + * + *
        +   * Sequence of responses to return in order for each attempt. If empty, the
        +   * default response is an immediate OK.
        +   * 
        + * + * repeated .google.showcase.v1beta1.Sequence.Response responses = 2; + */ + @java.lang.Override + public java.util.List getResponsesList() { + return responses_; + } + + /** + * + * + *
        +   * Sequence of responses to return in order for each attempt. If empty, the
        +   * default response is an immediate OK.
        +   * 
        + * + * repeated .google.showcase.v1beta1.Sequence.Response responses = 2; + */ + @java.lang.Override + public java.util.List + getResponsesOrBuilderList() { + return responses_; + } + + /** + * + * + *
        +   * Sequence of responses to return in order for each attempt. If empty, the
        +   * default response is an immediate OK.
        +   * 
        + * + * repeated .google.showcase.v1beta1.Sequence.Response responses = 2; + */ + @java.lang.Override + public int getResponsesCount() { + return responses_.size(); + } + + /** + * + * + *
        +   * Sequence of responses to return in order for each attempt. If empty, the
        +   * default response is an immediate OK.
        +   * 
        + * + * repeated .google.showcase.v1beta1.Sequence.Response responses = 2; + */ + @java.lang.Override + public com.google.showcase.v1beta1.Sequence.Response getResponses(int index) { + return responses_.get(index); + } + + /** + * + * + *
        +   * Sequence of responses to return in order for each attempt. If empty, the
        +   * default response is an immediate OK.
        +   * 
        + * + * repeated .google.showcase.v1beta1.Sequence.Response responses = 2; + */ + @java.lang.Override + public com.google.showcase.v1beta1.Sequence.ResponseOrBuilder getResponsesOrBuilder(int index) { + return responses_.get(index); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + for (int i = 0; i < responses_.size(); i++) { + output.writeMessage(2, responses_.get(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(name_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + for (int i = 0; i < responses_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, responses_.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.showcase.v1beta1.Sequence)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.Sequence other = (com.google.showcase.v1beta1.Sequence) obj; + + if (!getName().equals(other.getName())) return false; + if (!getResponsesList().equals(other.getResponsesList())) 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 (getResponsesCount() > 0) { + hash = (37 * hash) + RESPONSES_FIELD_NUMBER; + hash = (53 * hash) + getResponsesList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.showcase.v1beta1.Sequence parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.Sequence parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.Sequence parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.Sequence 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.showcase.v1beta1.Sequence parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.Sequence parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.Sequence parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.Sequence 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.showcase.v1beta1.Sequence parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.Sequence 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.showcase.v1beta1.Sequence parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.Sequence 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.showcase.v1beta1.Sequence prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** Protobuf type {@code google.showcase.v1beta1.Sequence} */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.Sequence) + com.google.showcase.v1beta1.SequenceOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.SequenceOuterClass + .internal_static_google_showcase_v1beta1_Sequence_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.SequenceOuterClass + .internal_static_google_showcase_v1beta1_Sequence_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.Sequence.class, + com.google.showcase.v1beta1.Sequence.Builder.class); + } + + // Construct using com.google.showcase.v1beta1.Sequence.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + if (responsesBuilder_ == null) { + responses_ = java.util.Collections.emptyList(); + } else { + responses_ = null; + responsesBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000002); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.showcase.v1beta1.SequenceOuterClass + .internal_static_google_showcase_v1beta1_Sequence_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.Sequence getDefaultInstanceForType() { + return com.google.showcase.v1beta1.Sequence.getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.Sequence build() { + com.google.showcase.v1beta1.Sequence result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.Sequence buildPartial() { + com.google.showcase.v1beta1.Sequence result = new com.google.showcase.v1beta1.Sequence(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields(com.google.showcase.v1beta1.Sequence result) { + if (responsesBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0)) { + responses_ = java.util.Collections.unmodifiableList(responses_); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.responses_ = responses_; + } else { + result.responses_ = responsesBuilder_.build(); + } + } + + private void buildPartial0(com.google.showcase.v1beta1.Sequence 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.showcase.v1beta1.Sequence) { + return mergeFrom((com.google.showcase.v1beta1.Sequence) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.showcase.v1beta1.Sequence other) { + if (other == com.google.showcase.v1beta1.Sequence.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (responsesBuilder_ == null) { + if (!other.responses_.isEmpty()) { + if (responses_.isEmpty()) { + responses_ = other.responses_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureResponsesIsMutable(); + responses_.addAll(other.responses_); + } + onChanged(); + } + } else { + if (!other.responses_.isEmpty()) { + if (responsesBuilder_.isEmpty()) { + responsesBuilder_.dispose(); + responsesBuilder_ = null; + responses_ = other.responses_; + bitField0_ = (bitField0_ & ~0x00000002); + responsesBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getResponsesFieldBuilder() + : null; + } else { + responsesBuilder_.addAllMessages(other.responses_); + } + } + } + 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: + { + com.google.showcase.v1beta1.Sequence.Response m = + input.readMessage( + com.google.showcase.v1beta1.Sequence.Response.parser(), extensionRegistry); + if (responsesBuilder_ == null) { + ensureResponsesIsMutable(); + responses_.add(m); + } else { + responsesBuilder_.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.lang.Object name_ = ""; + + /** + * 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; + } + } + + /** + * 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; + } + } + + /** + * 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; + } + + /** + * 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; + } + + /** + * 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.util.List responses_ = + java.util.Collections.emptyList(); + + private void ensureResponsesIsMutable() { + if (!((bitField0_ & 0x00000002) != 0)) { + responses_ = + new java.util.ArrayList(responses_); + bitField0_ |= 0x00000002; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.showcase.v1beta1.Sequence.Response, + com.google.showcase.v1beta1.Sequence.Response.Builder, + com.google.showcase.v1beta1.Sequence.ResponseOrBuilder> + responsesBuilder_; + + /** + * + * + *
        +     * Sequence of responses to return in order for each attempt. If empty, the
        +     * default response is an immediate OK.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Sequence.Response responses = 2; + */ + public java.util.List getResponsesList() { + if (responsesBuilder_ == null) { + return java.util.Collections.unmodifiableList(responses_); + } else { + return responsesBuilder_.getMessageList(); + } + } + + /** + * + * + *
        +     * Sequence of responses to return in order for each attempt. If empty, the
        +     * default response is an immediate OK.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Sequence.Response responses = 2; + */ + public int getResponsesCount() { + if (responsesBuilder_ == null) { + return responses_.size(); + } else { + return responsesBuilder_.getCount(); + } + } + + /** + * + * + *
        +     * Sequence of responses to return in order for each attempt. If empty, the
        +     * default response is an immediate OK.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Sequence.Response responses = 2; + */ + public com.google.showcase.v1beta1.Sequence.Response getResponses(int index) { + if (responsesBuilder_ == null) { + return responses_.get(index); + } else { + return responsesBuilder_.getMessage(index); + } + } + + /** + * + * + *
        +     * Sequence of responses to return in order for each attempt. If empty, the
        +     * default response is an immediate OK.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Sequence.Response responses = 2; + */ + public Builder setResponses(int index, com.google.showcase.v1beta1.Sequence.Response value) { + if (responsesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureResponsesIsMutable(); + responses_.set(index, value); + onChanged(); + } else { + responsesBuilder_.setMessage(index, value); + } + return this; + } + + /** + * + * + *
        +     * Sequence of responses to return in order for each attempt. If empty, the
        +     * default response is an immediate OK.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Sequence.Response responses = 2; + */ + public Builder setResponses( + int index, com.google.showcase.v1beta1.Sequence.Response.Builder builderForValue) { + if (responsesBuilder_ == null) { + ensureResponsesIsMutable(); + responses_.set(index, builderForValue.build()); + onChanged(); + } else { + responsesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
        +     * Sequence of responses to return in order for each attempt. If empty, the
        +     * default response is an immediate OK.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Sequence.Response responses = 2; + */ + public Builder addResponses(com.google.showcase.v1beta1.Sequence.Response value) { + if (responsesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureResponsesIsMutable(); + responses_.add(value); + onChanged(); + } else { + responsesBuilder_.addMessage(value); + } + return this; + } + + /** + * + * + *
        +     * Sequence of responses to return in order for each attempt. If empty, the
        +     * default response is an immediate OK.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Sequence.Response responses = 2; + */ + public Builder addResponses(int index, com.google.showcase.v1beta1.Sequence.Response value) { + if (responsesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureResponsesIsMutable(); + responses_.add(index, value); + onChanged(); + } else { + responsesBuilder_.addMessage(index, value); + } + return this; + } + + /** + * + * + *
        +     * Sequence of responses to return in order for each attempt. If empty, the
        +     * default response is an immediate OK.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Sequence.Response responses = 2; + */ + public Builder addResponses( + com.google.showcase.v1beta1.Sequence.Response.Builder builderForValue) { + if (responsesBuilder_ == null) { + ensureResponsesIsMutable(); + responses_.add(builderForValue.build()); + onChanged(); + } else { + responsesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + + /** + * + * + *
        +     * Sequence of responses to return in order for each attempt. If empty, the
        +     * default response is an immediate OK.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Sequence.Response responses = 2; + */ + public Builder addResponses( + int index, com.google.showcase.v1beta1.Sequence.Response.Builder builderForValue) { + if (responsesBuilder_ == null) { + ensureResponsesIsMutable(); + responses_.add(index, builderForValue.build()); + onChanged(); + } else { + responsesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
        +     * Sequence of responses to return in order for each attempt. If empty, the
        +     * default response is an immediate OK.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Sequence.Response responses = 2; + */ + public Builder addAllResponses( + java.lang.Iterable values) { + if (responsesBuilder_ == null) { + ensureResponsesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, responses_); + onChanged(); + } else { + responsesBuilder_.addAllMessages(values); + } + return this; + } + + /** + * + * + *
        +     * Sequence of responses to return in order for each attempt. If empty, the
        +     * default response is an immediate OK.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Sequence.Response responses = 2; + */ + public Builder clearResponses() { + if (responsesBuilder_ == null) { + responses_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + } else { + responsesBuilder_.clear(); + } + return this; + } + + /** + * + * + *
        +     * Sequence of responses to return in order for each attempt. If empty, the
        +     * default response is an immediate OK.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Sequence.Response responses = 2; + */ + public Builder removeResponses(int index) { + if (responsesBuilder_ == null) { + ensureResponsesIsMutable(); + responses_.remove(index); + onChanged(); + } else { + responsesBuilder_.remove(index); + } + return this; + } + + /** + * + * + *
        +     * Sequence of responses to return in order for each attempt. If empty, the
        +     * default response is an immediate OK.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Sequence.Response responses = 2; + */ + public com.google.showcase.v1beta1.Sequence.Response.Builder getResponsesBuilder(int index) { + return getResponsesFieldBuilder().getBuilder(index); + } + + /** + * + * + *
        +     * Sequence of responses to return in order for each attempt. If empty, the
        +     * default response is an immediate OK.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Sequence.Response responses = 2; + */ + public com.google.showcase.v1beta1.Sequence.ResponseOrBuilder getResponsesOrBuilder(int index) { + if (responsesBuilder_ == null) { + return responses_.get(index); + } else { + return responsesBuilder_.getMessageOrBuilder(index); + } + } + + /** + * + * + *
        +     * Sequence of responses to return in order for each attempt. If empty, the
        +     * default response is an immediate OK.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Sequence.Response responses = 2; + */ + public java.util.List + getResponsesOrBuilderList() { + if (responsesBuilder_ != null) { + return responsesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(responses_); + } + } + + /** + * + * + *
        +     * Sequence of responses to return in order for each attempt. If empty, the
        +     * default response is an immediate OK.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Sequence.Response responses = 2; + */ + public com.google.showcase.v1beta1.Sequence.Response.Builder addResponsesBuilder() { + return getResponsesFieldBuilder() + .addBuilder(com.google.showcase.v1beta1.Sequence.Response.getDefaultInstance()); + } + + /** + * + * + *
        +     * Sequence of responses to return in order for each attempt. If empty, the
        +     * default response is an immediate OK.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Sequence.Response responses = 2; + */ + public com.google.showcase.v1beta1.Sequence.Response.Builder addResponsesBuilder(int index) { + return getResponsesFieldBuilder() + .addBuilder(index, com.google.showcase.v1beta1.Sequence.Response.getDefaultInstance()); + } + + /** + * + * + *
        +     * Sequence of responses to return in order for each attempt. If empty, the
        +     * default response is an immediate OK.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Sequence.Response responses = 2; + */ + public java.util.List + getResponsesBuilderList() { + return getResponsesFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.showcase.v1beta1.Sequence.Response, + com.google.showcase.v1beta1.Sequence.Response.Builder, + com.google.showcase.v1beta1.Sequence.ResponseOrBuilder> + getResponsesFieldBuilder() { + if (responsesBuilder_ == null) { + responsesBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.showcase.v1beta1.Sequence.Response, + com.google.showcase.v1beta1.Sequence.Response.Builder, + com.google.showcase.v1beta1.Sequence.ResponseOrBuilder>( + responses_, ((bitField0_ & 0x00000002) != 0), getParentForChildren(), isClean()); + responses_ = null; + } + return responsesBuilder_; + } + + @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.showcase.v1beta1.Sequence) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.Sequence) + private static final com.google.showcase.v1beta1.Sequence DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.Sequence(); + } + + public static com.google.showcase.v1beta1.Sequence getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Sequence 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.showcase.v1beta1.Sequence getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/SequenceName.java b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/SequenceName.java new file mode 100644 index 0000000000..a5317c10c4 --- /dev/null +++ b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/SequenceName.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.showcase.v1beta1; + +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +@Generated("by gapic-generator-java") +public class SequenceName implements ResourceName { + private static final PathTemplate SEQUENCE = + PathTemplate.createWithoutUrlEncoding("sequences/{sequence}"); + private volatile Map fieldValuesMap; + private final String sequence; + + @Deprecated + protected SequenceName() { + sequence = null; + } + + private SequenceName(Builder builder) { + sequence = Preconditions.checkNotNull(builder.getSequence()); + } + + public String getSequence() { + return sequence; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + public static SequenceName of(String sequence) { + return newBuilder().setSequence(sequence).build(); + } + + public static String format(String sequence) { + return newBuilder().setSequence(sequence).build().toString(); + } + + public static SequenceName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + SEQUENCE.validatedMatch( + formattedString, "SequenceName.parse: formattedString not in valid format"); + return of(matchMap.get("sequence")); + } + + 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 (SequenceName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return SEQUENCE.matches(formattedString); + } + + @Override + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + if (sequence != null) { + fieldMapBuilder.put("sequence", sequence); + } + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return SEQUENCE.instantiate("sequence", sequence); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o != null && getClass() == o.getClass()) { + SequenceName that = ((SequenceName) o); + return Objects.equals(this.sequence, that.sequence); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= Objects.hashCode(sequence); + return h; + } + + /** Builder for sequences/{sequence}. */ + public static class Builder { + private String sequence; + + protected Builder() {} + + public String getSequence() { + return sequence; + } + + public Builder setSequence(String sequence) { + this.sequence = sequence; + return this; + } + + private Builder(SequenceName sequenceName) { + this.sequence = sequenceName.sequence; + } + + public SequenceName build() { + return new SequenceName(this); + } + } +} diff --git a/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/SequenceOrBuilder.java b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/SequenceOrBuilder.java new file mode 100644 index 0000000000..132a9d9e0b --- /dev/null +++ b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/SequenceOrBuilder.java @@ -0,0 +1,101 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/sequence.proto + +// Protobuf Java Version: 3.25.8 +package com.google.showcase.v1beta1; + +public interface SequenceOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.Sequence) + com.google.protobuf.MessageOrBuilder { + + /** + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The name. + */ + java.lang.String getName(); + + /** + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
        +   * Sequence of responses to return in order for each attempt. If empty, the
        +   * default response is an immediate OK.
        +   * 
        + * + * repeated .google.showcase.v1beta1.Sequence.Response responses = 2; + */ + java.util.List getResponsesList(); + + /** + * + * + *
        +   * Sequence of responses to return in order for each attempt. If empty, the
        +   * default response is an immediate OK.
        +   * 
        + * + * repeated .google.showcase.v1beta1.Sequence.Response responses = 2; + */ + com.google.showcase.v1beta1.Sequence.Response getResponses(int index); + + /** + * + * + *
        +   * Sequence of responses to return in order for each attempt. If empty, the
        +   * default response is an immediate OK.
        +   * 
        + * + * repeated .google.showcase.v1beta1.Sequence.Response responses = 2; + */ + int getResponsesCount(); + + /** + * + * + *
        +   * Sequence of responses to return in order for each attempt. If empty, the
        +   * default response is an immediate OK.
        +   * 
        + * + * repeated .google.showcase.v1beta1.Sequence.Response responses = 2; + */ + java.util.List + getResponsesOrBuilderList(); + + /** + * + * + *
        +   * Sequence of responses to return in order for each attempt. If empty, the
        +   * default response is an immediate OK.
        +   * 
        + * + * repeated .google.showcase.v1beta1.Sequence.Response responses = 2; + */ + com.google.showcase.v1beta1.Sequence.ResponseOrBuilder getResponsesOrBuilder(int index); +} diff --git a/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/SequenceOuterClass.java b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/SequenceOuterClass.java new file mode 100644 index 0000000000..b16125befb --- /dev/null +++ b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/SequenceOuterClass.java @@ -0,0 +1,351 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/sequence.proto + +// Protobuf Java Version: 3.25.8 +package com.google.showcase.v1beta1; + +public final class SequenceOuterClass { + private SequenceOuterClass() {} + + 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_showcase_v1beta1_Sequence_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_showcase_v1beta1_Sequence_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_showcase_v1beta1_Sequence_Response_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_showcase_v1beta1_Sequence_Response_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_showcase_v1beta1_StreamingSequence_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_showcase_v1beta1_StreamingSequence_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_showcase_v1beta1_StreamingSequence_Response_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_showcase_v1beta1_StreamingSequence_Response_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_showcase_v1beta1_StreamingSequenceReport_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_showcase_v1beta1_StreamingSequenceReport_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_showcase_v1beta1_StreamingSequenceReport_Attempt_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_showcase_v1beta1_StreamingSequenceReport_Attempt_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_showcase_v1beta1_SequenceReport_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_showcase_v1beta1_SequenceReport_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_showcase_v1beta1_SequenceReport_Attempt_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_showcase_v1beta1_SequenceReport_Attempt_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_showcase_v1beta1_CreateSequenceRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_showcase_v1beta1_CreateSequenceRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_showcase_v1beta1_CreateStreamingSequenceRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_showcase_v1beta1_CreateStreamingSequenceRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_showcase_v1beta1_AttemptSequenceRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_showcase_v1beta1_AttemptSequenceRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_showcase_v1beta1_AttemptStreamingSequenceRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_showcase_v1beta1_AttemptStreamingSequenceRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_showcase_v1beta1_AttemptStreamingSequenceResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_showcase_v1beta1_AttemptStreamingSequenceResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_showcase_v1beta1_GetSequenceReportRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_showcase_v1beta1_GetSequenceReportRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_showcase_v1beta1_GetStreamingSequenceReportRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_showcase_v1beta1_GetStreamingSequenceReportRequest_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-schema/google/showcase/v1beta1/sequenc" + + "e.proto\022\027google.showcase.v1beta1\032\034google" + + "/api/annotations.proto\032\027google/api/clien" + + "t.proto\032\037google/api/field_behavior.proto" + + "\032\031google/api/resource.proto\032\036google/prot" + + "obuf/duration.proto\032\033google/protobuf/emp" + + "ty.proto\032\037google/protobuf/timestamp.prot" + + "o\032\027google/rpc/status.proto\"\363\001\n\010Sequence\022" + + "\021\n\004name\030\001 \001(\tB\003\340A\003\022=\n\tresponses\030\002 \003(\0132*." + + "google.showcase.v1beta1.Sequence.Respons" + + "e\032X\n\010Response\022\"\n\006status\030\001 \001(\0132\022.google.r" + + "pc.Status\022(\n\005delay\030\002 \001(\0132\031.google.protob" + + "uf.Duration:;\352A8\n showcase.googleapis.co" + + "m/Sequence\022\024sequences/{sequence}\"\312\002\n\021Str" + + "eamingSequence\022\021\n\004name\030\001 \001(\tB\003\340A\003\022\017\n\007con" + + "tent\030\002 \001(\t\022F\n\tresponses\030\003 \003(\01323.google.s" + + "howcase.v1beta1.StreamingSequence.Respon" + + "se\032p\n\010Response\022\"\n\006status\030\001 \001(\0132\022.google." + + "rpc.Status\022(\n\005delay\030\002 \001(\0132\031.google.proto" + + "buf.Duration\022\026\n\016response_index\030\003 \001(\005:W\352A" + + "T\n)showcase.googleapis.com/StreamingSequ" + + "ence\022\'streamingSequences/{streaming_sequ" + + "ence}\"\322\003\n\027StreamingSequenceReport\022\021\n\004nam" + + "e\030\001 \001(\tB\003\340A\003\022J\n\010attempts\030\002 \003(\01328.google." + + "showcase.v1beta1.StreamingSequenceReport" + + ".Attempt\032\340\001\n\007Attempt\022\026\n\016attempt_number\030\001" + + " \001(\005\0224\n\020attempt_deadline\030\002 \001(\0132\032.google." + + "protobuf.Timestamp\0221\n\rresponse_time\030\003 \001(" + + "\0132\032.google.protobuf.Timestamp\0220\n\rattempt" + + "_delay\030\004 \001(\0132\031.google.protobuf.Duration\022" + + "\"\n\006status\030\005 \001(\0132\022.google.rpc.Status:u\352Ar" + + "\n/showcase.googleapis.com/StreamingSeque" + + "nceReport\022?streamingSequences/{streaming" + + "_sequence}/streamingSequenceReport\"\233\003\n\016S" + + "equenceReport\022\021\n\004name\030\001 \001(\tB\003\340A\003\022A\n\010atte" + + "mpts\030\002 \003(\0132/.google.showcase.v1beta1.Seq" + + "uenceReport.Attempt\032\340\001\n\007Attempt\022\026\n\016attem" + + "pt_number\030\001 \001(\005\0224\n\020attempt_deadline\030\002 \001(" + + "\0132\032.google.protobuf.Timestamp\0221\n\rrespons" + + "e_time\030\003 \001(\0132\032.google.protobuf.Timestamp" + + "\0220\n\rattempt_delay\030\004 \001(\0132\031.google.protobu" + + "f.Duration\022\"\n\006status\030\005 \001(\0132\022.google.rpc." + + "Status:P\352AM\n&showcase.googleapis.com/Seq" + + "uenceReport\022#sequences/{sequence}/sequen" + + "ceReport\"L\n\025CreateSequenceRequest\0223\n\010seq" + + "uence\030\001 \001(\0132!.google.showcase.v1beta1.Se" + + "quence\"h\n\036CreateStreamingSequenceRequest" + + "\022F\n\022streaming_sequence\030\001 \001(\0132*.google.sh" + + "owcase.v1beta1.StreamingSequence\"P\n\026Atte" + + "mptSequenceRequest\0226\n\004name\030\001 \001(\tB(\340A\002\372A\"" + + "\n showcase.googleapis.com/Sequence\"\200\001\n\037A" + + "ttemptStreamingSequenceRequest\022?\n\004name\030\001" + + " \001(\tB1\340A\002\372A+\n)showcase.googleapis.com/St" + + "reamingSequence\022\034\n\017last_fail_index\030\002 \001(\005" + + "B\003\340A\001\"3\n AttemptStreamingSequenceRespons" + + "e\022\017\n\007content\030\001 \001(\t\"X\n\030GetSequenceReportR" + + "equest\022<\n\004name\030\001 \001(\tB.\340A\002\372A(\n&showcase.g" + + "oogleapis.com/SequenceReport\"j\n!GetStrea" + + "mingSequenceReportRequest\022E\n\004name\030\001 \001(\tB" + + "7\340A\002\372A1\n/showcase.googleapis.com/Streami" + + "ngSequenceReport2\360\010\n\017SequenceService\022\224\001\n" + + "\016CreateSequence\022..google.showcase.v1beta" + + "1.CreateSequenceRequest\032!.google.showcas" + + "e.v1beta1.Sequence\"/\332A\010sequence\202\323\344\223\002\036\"\022/" + + "v1beta1/sequences:\010sequence\022\314\001\n\027CreateSt" + + "reamingSequence\0227.google.showcase.v1beta" + + "1.CreateStreamingSequenceRequest\032*.googl" + + "e.showcase.v1beta1.StreamingSequence\"L\332A" + + "\022streaming_sequence\202\323\344\223\0021\"\033/v1beta1/stre" + + "amingSequences:\022streaming_sequence\022\252\001\n\021G" + + "etSequenceReport\0221.google.showcase.v1bet" + + "a1.GetSequenceReportRequest\032\'.google.sho" + + "wcase.v1beta1.SequenceReport\"9\332A\004name\202\323\344" + + "\223\002,\022*/v1beta1/{name=sequences/*/sequence" + + "Report}\022\327\001\n\032GetStreamingSequenceReport\022:" + + ".google.showcase.v1beta1.GetStreamingSeq" + + "uenceReportRequest\0320.google.showcase.v1b" + + "eta1.StreamingSequenceReport\"K\332A\004name\202\323\344" + + "\223\002>\022 builder) { + super(builder); + } + + private SequenceReport() { + name_ = ""; + attempts_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new SequenceReport(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.SequenceOuterClass + .internal_static_google_showcase_v1beta1_SequenceReport_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.SequenceOuterClass + .internal_static_google_showcase_v1beta1_SequenceReport_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.SequenceReport.class, + com.google.showcase.v1beta1.SequenceReport.Builder.class); + } + + public interface AttemptOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.SequenceReport.Attempt) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
        +     * The attempt number - starting at 0.
        +     * 
        + * + * int32 attempt_number = 1; + * + * @return The attemptNumber. + */ + int getAttemptNumber(); + + /** + * + * + *
        +     * The deadline dictated by the attempt to the server.
        +     * 
        + * + * .google.protobuf.Timestamp attempt_deadline = 2; + * + * @return Whether the attemptDeadline field is set. + */ + boolean hasAttemptDeadline(); + + /** + * + * + *
        +     * The deadline dictated by the attempt to the server.
        +     * 
        + * + * .google.protobuf.Timestamp attempt_deadline = 2; + * + * @return The attemptDeadline. + */ + com.google.protobuf.Timestamp getAttemptDeadline(); + + /** + * + * + *
        +     * The deadline dictated by the attempt to the server.
        +     * 
        + * + * .google.protobuf.Timestamp attempt_deadline = 2; + */ + com.google.protobuf.TimestampOrBuilder getAttemptDeadlineOrBuilder(); + + /** + * + * + *
        +     * The time that the server responded to the RPC attempt. Used for
        +     * calculating attempt_delay.
        +     * 
        + * + * .google.protobuf.Timestamp response_time = 3; + * + * @return Whether the responseTime field is set. + */ + boolean hasResponseTime(); + + /** + * + * + *
        +     * The time that the server responded to the RPC attempt. Used for
        +     * calculating attempt_delay.
        +     * 
        + * + * .google.protobuf.Timestamp response_time = 3; + * + * @return The responseTime. + */ + com.google.protobuf.Timestamp getResponseTime(); + + /** + * + * + *
        +     * The time that the server responded to the RPC attempt. Used for
        +     * calculating attempt_delay.
        +     * 
        + * + * .google.protobuf.Timestamp response_time = 3; + */ + com.google.protobuf.TimestampOrBuilder getResponseTimeOrBuilder(); + + /** + * + * + *
        +     * The server perceived delay between sending the last response and
        +     * receiving this attempt. Used for validating attempt delay backoff.
        +     * 
        + * + * .google.protobuf.Duration attempt_delay = 4; + * + * @return Whether the attemptDelay field is set. + */ + boolean hasAttemptDelay(); + + /** + * + * + *
        +     * The server perceived delay between sending the last response and
        +     * receiving this attempt. Used for validating attempt delay backoff.
        +     * 
        + * + * .google.protobuf.Duration attempt_delay = 4; + * + * @return The attemptDelay. + */ + com.google.protobuf.Duration getAttemptDelay(); + + /** + * + * + *
        +     * The server perceived delay between sending the last response and
        +     * receiving this attempt. Used for validating attempt delay backoff.
        +     * 
        + * + * .google.protobuf.Duration attempt_delay = 4; + */ + com.google.protobuf.DurationOrBuilder getAttemptDelayOrBuilder(); + + /** + * + * + *
        +     * The status returned to the attempt.
        +     * 
        + * + * .google.rpc.Status status = 5; + * + * @return Whether the status field is set. + */ + boolean hasStatus(); + + /** + * + * + *
        +     * The status returned to the attempt.
        +     * 
        + * + * .google.rpc.Status status = 5; + * + * @return The status. + */ + com.google.rpc.Status getStatus(); + + /** + * + * + *
        +     * The status returned to the attempt.
        +     * 
        + * + * .google.rpc.Status status = 5; + */ + com.google.rpc.StatusOrBuilder getStatusOrBuilder(); + } + + /** + * + * + *
        +   * Contains metrics on individual RPC Attempts in a sequence.
        +   * 
        + * + * Protobuf type {@code google.showcase.v1beta1.SequenceReport.Attempt} + */ + public static final class Attempt extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.SequenceReport.Attempt) + AttemptOrBuilder { + private static final long serialVersionUID = 0L; + + // Use Attempt.newBuilder() to construct. + private Attempt(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Attempt() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Attempt(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.SequenceOuterClass + .internal_static_google_showcase_v1beta1_SequenceReport_Attempt_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.SequenceOuterClass + .internal_static_google_showcase_v1beta1_SequenceReport_Attempt_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.SequenceReport.Attempt.class, + com.google.showcase.v1beta1.SequenceReport.Attempt.Builder.class); + } + + private int bitField0_; + public static final int ATTEMPT_NUMBER_FIELD_NUMBER = 1; + private int attemptNumber_ = 0; + + /** + * + * + *
        +     * The attempt number - starting at 0.
        +     * 
        + * + * int32 attempt_number = 1; + * + * @return The attemptNumber. + */ + @java.lang.Override + public int getAttemptNumber() { + return attemptNumber_; + } + + public static final int ATTEMPT_DEADLINE_FIELD_NUMBER = 2; + private com.google.protobuf.Timestamp attemptDeadline_; + + /** + * + * + *
        +     * The deadline dictated by the attempt to the server.
        +     * 
        + * + * .google.protobuf.Timestamp attempt_deadline = 2; + * + * @return Whether the attemptDeadline field is set. + */ + @java.lang.Override + public boolean hasAttemptDeadline() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
        +     * The deadline dictated by the attempt to the server.
        +     * 
        + * + * .google.protobuf.Timestamp attempt_deadline = 2; + * + * @return The attemptDeadline. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getAttemptDeadline() { + return attemptDeadline_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : attemptDeadline_; + } + + /** + * + * + *
        +     * The deadline dictated by the attempt to the server.
        +     * 
        + * + * .google.protobuf.Timestamp attempt_deadline = 2; + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getAttemptDeadlineOrBuilder() { + return attemptDeadline_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : attemptDeadline_; + } + + public static final int RESPONSE_TIME_FIELD_NUMBER = 3; + private com.google.protobuf.Timestamp responseTime_; + + /** + * + * + *
        +     * The time that the server responded to the RPC attempt. Used for
        +     * calculating attempt_delay.
        +     * 
        + * + * .google.protobuf.Timestamp response_time = 3; + * + * @return Whether the responseTime field is set. + */ + @java.lang.Override + public boolean hasResponseTime() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
        +     * The time that the server responded to the RPC attempt. Used for
        +     * calculating attempt_delay.
        +     * 
        + * + * .google.protobuf.Timestamp response_time = 3; + * + * @return The responseTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getResponseTime() { + return responseTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : responseTime_; + } + + /** + * + * + *
        +     * The time that the server responded to the RPC attempt. Used for
        +     * calculating attempt_delay.
        +     * 
        + * + * .google.protobuf.Timestamp response_time = 3; + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getResponseTimeOrBuilder() { + return responseTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : responseTime_; + } + + public static final int ATTEMPT_DELAY_FIELD_NUMBER = 4; + private com.google.protobuf.Duration attemptDelay_; + + /** + * + * + *
        +     * The server perceived delay between sending the last response and
        +     * receiving this attempt. Used for validating attempt delay backoff.
        +     * 
        + * + * .google.protobuf.Duration attempt_delay = 4; + * + * @return Whether the attemptDelay field is set. + */ + @java.lang.Override + public boolean hasAttemptDelay() { + return ((bitField0_ & 0x00000004) != 0); + } + + /** + * + * + *
        +     * The server perceived delay between sending the last response and
        +     * receiving this attempt. Used for validating attempt delay backoff.
        +     * 
        + * + * .google.protobuf.Duration attempt_delay = 4; + * + * @return The attemptDelay. + */ + @java.lang.Override + public com.google.protobuf.Duration getAttemptDelay() { + return attemptDelay_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : attemptDelay_; + } + + /** + * + * + *
        +     * The server perceived delay between sending the last response and
        +     * receiving this attempt. Used for validating attempt delay backoff.
        +     * 
        + * + * .google.protobuf.Duration attempt_delay = 4; + */ + @java.lang.Override + public com.google.protobuf.DurationOrBuilder getAttemptDelayOrBuilder() { + return attemptDelay_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : attemptDelay_; + } + + public static final int STATUS_FIELD_NUMBER = 5; + private com.google.rpc.Status status_; + + /** + * + * + *
        +     * The status returned to the attempt.
        +     * 
        + * + * .google.rpc.Status status = 5; + * + * @return Whether the status field is set. + */ + @java.lang.Override + public boolean hasStatus() { + return ((bitField0_ & 0x00000008) != 0); + } + + /** + * + * + *
        +     * The status returned to the attempt.
        +     * 
        + * + * .google.rpc.Status status = 5; + * + * @return The status. + */ + @java.lang.Override + public com.google.rpc.Status getStatus() { + return status_ == null ? com.google.rpc.Status.getDefaultInstance() : status_; + } + + /** + * + * + *
        +     * The status returned to the attempt.
        +     * 
        + * + * .google.rpc.Status status = 5; + */ + @java.lang.Override + public com.google.rpc.StatusOrBuilder getStatusOrBuilder() { + return status_ == null ? com.google.rpc.Status.getDefaultInstance() : status_; + } + + 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 (attemptNumber_ != 0) { + output.writeInt32(1, attemptNumber_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(2, getAttemptDeadline()); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeMessage(3, getResponseTime()); + } + if (((bitField0_ & 0x00000004) != 0)) { + output.writeMessage(4, getAttemptDelay()); + } + if (((bitField0_ & 0x00000008) != 0)) { + output.writeMessage(5, getStatus()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (attemptNumber_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(1, attemptNumber_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getAttemptDeadline()); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getResponseTime()); + } + if (((bitField0_ & 0x00000004) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, getAttemptDelay()); + } + if (((bitField0_ & 0x00000008) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(5, getStatus()); + } + 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.showcase.v1beta1.SequenceReport.Attempt)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.SequenceReport.Attempt other = + (com.google.showcase.v1beta1.SequenceReport.Attempt) obj; + + if (getAttemptNumber() != other.getAttemptNumber()) return false; + if (hasAttemptDeadline() != other.hasAttemptDeadline()) return false; + if (hasAttemptDeadline()) { + if (!getAttemptDeadline().equals(other.getAttemptDeadline())) return false; + } + if (hasResponseTime() != other.hasResponseTime()) return false; + if (hasResponseTime()) { + if (!getResponseTime().equals(other.getResponseTime())) return false; + } + if (hasAttemptDelay() != other.hasAttemptDelay()) return false; + if (hasAttemptDelay()) { + if (!getAttemptDelay().equals(other.getAttemptDelay())) return false; + } + if (hasStatus() != other.hasStatus()) return false; + if (hasStatus()) { + if (!getStatus().equals(other.getStatus())) 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) + ATTEMPT_NUMBER_FIELD_NUMBER; + hash = (53 * hash) + getAttemptNumber(); + if (hasAttemptDeadline()) { + hash = (37 * hash) + ATTEMPT_DEADLINE_FIELD_NUMBER; + hash = (53 * hash) + getAttemptDeadline().hashCode(); + } + if (hasResponseTime()) { + hash = (37 * hash) + RESPONSE_TIME_FIELD_NUMBER; + hash = (53 * hash) + getResponseTime().hashCode(); + } + if (hasAttemptDelay()) { + hash = (37 * hash) + ATTEMPT_DELAY_FIELD_NUMBER; + hash = (53 * hash) + getAttemptDelay().hashCode(); + } + if (hasStatus()) { + hash = (37 * hash) + STATUS_FIELD_NUMBER; + hash = (53 * hash) + getStatus().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.showcase.v1beta1.SequenceReport.Attempt parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.SequenceReport.Attempt parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.SequenceReport.Attempt parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.SequenceReport.Attempt 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.showcase.v1beta1.SequenceReport.Attempt parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.SequenceReport.Attempt parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.SequenceReport.Attempt parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.SequenceReport.Attempt 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.showcase.v1beta1.SequenceReport.Attempt parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.SequenceReport.Attempt 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.showcase.v1beta1.SequenceReport.Attempt parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.SequenceReport.Attempt 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.showcase.v1beta1.SequenceReport.Attempt prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
        +     * Contains metrics on individual RPC Attempts in a sequence.
        +     * 
        + * + * Protobuf type {@code google.showcase.v1beta1.SequenceReport.Attempt} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.SequenceReport.Attempt) + com.google.showcase.v1beta1.SequenceReport.AttemptOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.SequenceOuterClass + .internal_static_google_showcase_v1beta1_SequenceReport_Attempt_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.SequenceOuterClass + .internal_static_google_showcase_v1beta1_SequenceReport_Attempt_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.SequenceReport.Attempt.class, + com.google.showcase.v1beta1.SequenceReport.Attempt.Builder.class); + } + + // Construct using com.google.showcase.v1beta1.SequenceReport.Attempt.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getAttemptDeadlineFieldBuilder(); + getResponseTimeFieldBuilder(); + getAttemptDelayFieldBuilder(); + getStatusFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + attemptNumber_ = 0; + attemptDeadline_ = null; + if (attemptDeadlineBuilder_ != null) { + attemptDeadlineBuilder_.dispose(); + attemptDeadlineBuilder_ = null; + } + responseTime_ = null; + if (responseTimeBuilder_ != null) { + responseTimeBuilder_.dispose(); + responseTimeBuilder_ = null; + } + attemptDelay_ = null; + if (attemptDelayBuilder_ != null) { + attemptDelayBuilder_.dispose(); + attemptDelayBuilder_ = null; + } + status_ = null; + if (statusBuilder_ != null) { + statusBuilder_.dispose(); + statusBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.showcase.v1beta1.SequenceOuterClass + .internal_static_google_showcase_v1beta1_SequenceReport_Attempt_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.SequenceReport.Attempt getDefaultInstanceForType() { + return com.google.showcase.v1beta1.SequenceReport.Attempt.getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.SequenceReport.Attempt build() { + com.google.showcase.v1beta1.SequenceReport.Attempt result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.SequenceReport.Attempt buildPartial() { + com.google.showcase.v1beta1.SequenceReport.Attempt result = + new com.google.showcase.v1beta1.SequenceReport.Attempt(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.showcase.v1beta1.SequenceReport.Attempt result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.attemptNumber_ = attemptNumber_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.attemptDeadline_ = + attemptDeadlineBuilder_ == null ? attemptDeadline_ : attemptDeadlineBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.responseTime_ = + responseTimeBuilder_ == null ? responseTime_ : responseTimeBuilder_.build(); + to_bitField0_ |= 0x00000002; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.attemptDelay_ = + attemptDelayBuilder_ == null ? attemptDelay_ : attemptDelayBuilder_.build(); + to_bitField0_ |= 0x00000004; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.status_ = statusBuilder_ == null ? status_ : statusBuilder_.build(); + to_bitField0_ |= 0x00000008; + } + 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.showcase.v1beta1.SequenceReport.Attempt) { + return mergeFrom((com.google.showcase.v1beta1.SequenceReport.Attempt) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.showcase.v1beta1.SequenceReport.Attempt other) { + if (other == com.google.showcase.v1beta1.SequenceReport.Attempt.getDefaultInstance()) + return this; + if (other.getAttemptNumber() != 0) { + setAttemptNumber(other.getAttemptNumber()); + } + if (other.hasAttemptDeadline()) { + mergeAttemptDeadline(other.getAttemptDeadline()); + } + if (other.hasResponseTime()) { + mergeResponseTime(other.getResponseTime()); + } + if (other.hasAttemptDelay()) { + mergeAttemptDelay(other.getAttemptDelay()); + } + if (other.hasStatus()) { + mergeStatus(other.getStatus()); + } + 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: + { + attemptNumber_ = input.readInt32(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 18: + { + input.readMessage( + getAttemptDeadlineFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + input.readMessage(getResponseTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 34: + { + input.readMessage(getAttemptDelayFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000008; + break; + } // case 34 + case 42: + { + input.readMessage(getStatusFieldBuilder().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 int attemptNumber_; + + /** + * + * + *
        +       * The attempt number - starting at 0.
        +       * 
        + * + * int32 attempt_number = 1; + * + * @return The attemptNumber. + */ + @java.lang.Override + public int getAttemptNumber() { + return attemptNumber_; + } + + /** + * + * + *
        +       * The attempt number - starting at 0.
        +       * 
        + * + * int32 attempt_number = 1; + * + * @param value The attemptNumber to set. + * @return This builder for chaining. + */ + public Builder setAttemptNumber(int value) { + + attemptNumber_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
        +       * The attempt number - starting at 0.
        +       * 
        + * + * int32 attempt_number = 1; + * + * @return This builder for chaining. + */ + public Builder clearAttemptNumber() { + bitField0_ = (bitField0_ & ~0x00000001); + attemptNumber_ = 0; + onChanged(); + return this; + } + + private com.google.protobuf.Timestamp attemptDeadline_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + attemptDeadlineBuilder_; + + /** + * + * + *
        +       * The deadline dictated by the attempt to the server.
        +       * 
        + * + * .google.protobuf.Timestamp attempt_deadline = 2; + * + * @return Whether the attemptDeadline field is set. + */ + public boolean hasAttemptDeadline() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
        +       * The deadline dictated by the attempt to the server.
        +       * 
        + * + * .google.protobuf.Timestamp attempt_deadline = 2; + * + * @return The attemptDeadline. + */ + public com.google.protobuf.Timestamp getAttemptDeadline() { + if (attemptDeadlineBuilder_ == null) { + return attemptDeadline_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : attemptDeadline_; + } else { + return attemptDeadlineBuilder_.getMessage(); + } + } + + /** + * + * + *
        +       * The deadline dictated by the attempt to the server.
        +       * 
        + * + * .google.protobuf.Timestamp attempt_deadline = 2; + */ + public Builder setAttemptDeadline(com.google.protobuf.Timestamp value) { + if (attemptDeadlineBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + attemptDeadline_ = value; + } else { + attemptDeadlineBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
        +       * The deadline dictated by the attempt to the server.
        +       * 
        + * + * .google.protobuf.Timestamp attempt_deadline = 2; + */ + public Builder setAttemptDeadline(com.google.protobuf.Timestamp.Builder builderForValue) { + if (attemptDeadlineBuilder_ == null) { + attemptDeadline_ = builderForValue.build(); + } else { + attemptDeadlineBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
        +       * The deadline dictated by the attempt to the server.
        +       * 
        + * + * .google.protobuf.Timestamp attempt_deadline = 2; + */ + public Builder mergeAttemptDeadline(com.google.protobuf.Timestamp value) { + if (attemptDeadlineBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && attemptDeadline_ != null + && attemptDeadline_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getAttemptDeadlineBuilder().mergeFrom(value); + } else { + attemptDeadline_ = value; + } + } else { + attemptDeadlineBuilder_.mergeFrom(value); + } + if (attemptDeadline_ != null) { + bitField0_ |= 0x00000002; + onChanged(); + } + return this; + } + + /** + * + * + *
        +       * The deadline dictated by the attempt to the server.
        +       * 
        + * + * .google.protobuf.Timestamp attempt_deadline = 2; + */ + public Builder clearAttemptDeadline() { + bitField0_ = (bitField0_ & ~0x00000002); + attemptDeadline_ = null; + if (attemptDeadlineBuilder_ != null) { + attemptDeadlineBuilder_.dispose(); + attemptDeadlineBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
        +       * The deadline dictated by the attempt to the server.
        +       * 
        + * + * .google.protobuf.Timestamp attempt_deadline = 2; + */ + public com.google.protobuf.Timestamp.Builder getAttemptDeadlineBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return getAttemptDeadlineFieldBuilder().getBuilder(); + } + + /** + * + * + *
        +       * The deadline dictated by the attempt to the server.
        +       * 
        + * + * .google.protobuf.Timestamp attempt_deadline = 2; + */ + public com.google.protobuf.TimestampOrBuilder getAttemptDeadlineOrBuilder() { + if (attemptDeadlineBuilder_ != null) { + return attemptDeadlineBuilder_.getMessageOrBuilder(); + } else { + return attemptDeadline_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : attemptDeadline_; + } + } + + /** + * + * + *
        +       * The deadline dictated by the attempt to the server.
        +       * 
        + * + * .google.protobuf.Timestamp attempt_deadline = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getAttemptDeadlineFieldBuilder() { + if (attemptDeadlineBuilder_ == null) { + attemptDeadlineBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getAttemptDeadline(), getParentForChildren(), isClean()); + attemptDeadline_ = null; + } + return attemptDeadlineBuilder_; + } + + private com.google.protobuf.Timestamp responseTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + responseTimeBuilder_; + + /** + * + * + *
        +       * The time that the server responded to the RPC attempt. Used for
        +       * calculating attempt_delay.
        +       * 
        + * + * .google.protobuf.Timestamp response_time = 3; + * + * @return Whether the responseTime field is set. + */ + public boolean hasResponseTime() { + return ((bitField0_ & 0x00000004) != 0); + } + + /** + * + * + *
        +       * The time that the server responded to the RPC attempt. Used for
        +       * calculating attempt_delay.
        +       * 
        + * + * .google.protobuf.Timestamp response_time = 3; + * + * @return The responseTime. + */ + public com.google.protobuf.Timestamp getResponseTime() { + if (responseTimeBuilder_ == null) { + return responseTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : responseTime_; + } else { + return responseTimeBuilder_.getMessage(); + } + } + + /** + * + * + *
        +       * The time that the server responded to the RPC attempt. Used for
        +       * calculating attempt_delay.
        +       * 
        + * + * .google.protobuf.Timestamp response_time = 3; + */ + public Builder setResponseTime(com.google.protobuf.Timestamp value) { + if (responseTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + responseTime_ = value; + } else { + responseTimeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
        +       * The time that the server responded to the RPC attempt. Used for
        +       * calculating attempt_delay.
        +       * 
        + * + * .google.protobuf.Timestamp response_time = 3; + */ + public Builder setResponseTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (responseTimeBuilder_ == null) { + responseTime_ = builderForValue.build(); + } else { + responseTimeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
        +       * The time that the server responded to the RPC attempt. Used for
        +       * calculating attempt_delay.
        +       * 
        + * + * .google.protobuf.Timestamp response_time = 3; + */ + public Builder mergeResponseTime(com.google.protobuf.Timestamp value) { + if (responseTimeBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0) + && responseTime_ != null + && responseTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getResponseTimeBuilder().mergeFrom(value); + } else { + responseTime_ = value; + } + } else { + responseTimeBuilder_.mergeFrom(value); + } + if (responseTime_ != null) { + bitField0_ |= 0x00000004; + onChanged(); + } + return this; + } + + /** + * + * + *
        +       * The time that the server responded to the RPC attempt. Used for
        +       * calculating attempt_delay.
        +       * 
        + * + * .google.protobuf.Timestamp response_time = 3; + */ + public Builder clearResponseTime() { + bitField0_ = (bitField0_ & ~0x00000004); + responseTime_ = null; + if (responseTimeBuilder_ != null) { + responseTimeBuilder_.dispose(); + responseTimeBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
        +       * The time that the server responded to the RPC attempt. Used for
        +       * calculating attempt_delay.
        +       * 
        + * + * .google.protobuf.Timestamp response_time = 3; + */ + public com.google.protobuf.Timestamp.Builder getResponseTimeBuilder() { + bitField0_ |= 0x00000004; + onChanged(); + return getResponseTimeFieldBuilder().getBuilder(); + } + + /** + * + * + *
        +       * The time that the server responded to the RPC attempt. Used for
        +       * calculating attempt_delay.
        +       * 
        + * + * .google.protobuf.Timestamp response_time = 3; + */ + public com.google.protobuf.TimestampOrBuilder getResponseTimeOrBuilder() { + if (responseTimeBuilder_ != null) { + return responseTimeBuilder_.getMessageOrBuilder(); + } else { + return responseTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : responseTime_; + } + } + + /** + * + * + *
        +       * The time that the server responded to the RPC attempt. Used for
        +       * calculating attempt_delay.
        +       * 
        + * + * .google.protobuf.Timestamp response_time = 3; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getResponseTimeFieldBuilder() { + if (responseTimeBuilder_ == null) { + responseTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getResponseTime(), getParentForChildren(), isClean()); + responseTime_ = null; + } + return responseTimeBuilder_; + } + + private com.google.protobuf.Duration attemptDelay_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder> + attemptDelayBuilder_; + + /** + * + * + *
        +       * The server perceived delay between sending the last response and
        +       * receiving this attempt. Used for validating attempt delay backoff.
        +       * 
        + * + * .google.protobuf.Duration attempt_delay = 4; + * + * @return Whether the attemptDelay field is set. + */ + public boolean hasAttemptDelay() { + return ((bitField0_ & 0x00000008) != 0); + } + + /** + * + * + *
        +       * The server perceived delay between sending the last response and
        +       * receiving this attempt. Used for validating attempt delay backoff.
        +       * 
        + * + * .google.protobuf.Duration attempt_delay = 4; + * + * @return The attemptDelay. + */ + public com.google.protobuf.Duration getAttemptDelay() { + if (attemptDelayBuilder_ == null) { + return attemptDelay_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : attemptDelay_; + } else { + return attemptDelayBuilder_.getMessage(); + } + } + + /** + * + * + *
        +       * The server perceived delay between sending the last response and
        +       * receiving this attempt. Used for validating attempt delay backoff.
        +       * 
        + * + * .google.protobuf.Duration attempt_delay = 4; + */ + public Builder setAttemptDelay(com.google.protobuf.Duration value) { + if (attemptDelayBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + attemptDelay_ = value; + } else { + attemptDelayBuilder_.setMessage(value); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + /** + * + * + *
        +       * The server perceived delay between sending the last response and
        +       * receiving this attempt. Used for validating attempt delay backoff.
        +       * 
        + * + * .google.protobuf.Duration attempt_delay = 4; + */ + public Builder setAttemptDelay(com.google.protobuf.Duration.Builder builderForValue) { + if (attemptDelayBuilder_ == null) { + attemptDelay_ = builderForValue.build(); + } else { + attemptDelayBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + /** + * + * + *
        +       * The server perceived delay between sending the last response and
        +       * receiving this attempt. Used for validating attempt delay backoff.
        +       * 
        + * + * .google.protobuf.Duration attempt_delay = 4; + */ + public Builder mergeAttemptDelay(com.google.protobuf.Duration value) { + if (attemptDelayBuilder_ == null) { + if (((bitField0_ & 0x00000008) != 0) + && attemptDelay_ != null + && attemptDelay_ != com.google.protobuf.Duration.getDefaultInstance()) { + getAttemptDelayBuilder().mergeFrom(value); + } else { + attemptDelay_ = value; + } + } else { + attemptDelayBuilder_.mergeFrom(value); + } + if (attemptDelay_ != null) { + bitField0_ |= 0x00000008; + onChanged(); + } + return this; + } + + /** + * + * + *
        +       * The server perceived delay between sending the last response and
        +       * receiving this attempt. Used for validating attempt delay backoff.
        +       * 
        + * + * .google.protobuf.Duration attempt_delay = 4; + */ + public Builder clearAttemptDelay() { + bitField0_ = (bitField0_ & ~0x00000008); + attemptDelay_ = null; + if (attemptDelayBuilder_ != null) { + attemptDelayBuilder_.dispose(); + attemptDelayBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
        +       * The server perceived delay between sending the last response and
        +       * receiving this attempt. Used for validating attempt delay backoff.
        +       * 
        + * + * .google.protobuf.Duration attempt_delay = 4; + */ + public com.google.protobuf.Duration.Builder getAttemptDelayBuilder() { + bitField0_ |= 0x00000008; + onChanged(); + return getAttemptDelayFieldBuilder().getBuilder(); + } + + /** + * + * + *
        +       * The server perceived delay between sending the last response and
        +       * receiving this attempt. Used for validating attempt delay backoff.
        +       * 
        + * + * .google.protobuf.Duration attempt_delay = 4; + */ + public com.google.protobuf.DurationOrBuilder getAttemptDelayOrBuilder() { + if (attemptDelayBuilder_ != null) { + return attemptDelayBuilder_.getMessageOrBuilder(); + } else { + return attemptDelay_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : attemptDelay_; + } + } + + /** + * + * + *
        +       * The server perceived delay between sending the last response and
        +       * receiving this attempt. Used for validating attempt delay backoff.
        +       * 
        + * + * .google.protobuf.Duration attempt_delay = 4; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder> + getAttemptDelayFieldBuilder() { + if (attemptDelayBuilder_ == null) { + attemptDelayBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder>( + getAttemptDelay(), getParentForChildren(), isClean()); + attemptDelay_ = null; + } + return attemptDelayBuilder_; + } + + private com.google.rpc.Status status_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.rpc.Status, com.google.rpc.Status.Builder, com.google.rpc.StatusOrBuilder> + statusBuilder_; + + /** + * + * + *
        +       * The status returned to the attempt.
        +       * 
        + * + * .google.rpc.Status status = 5; + * + * @return Whether the status field is set. + */ + public boolean hasStatus() { + return ((bitField0_ & 0x00000010) != 0); + } + + /** + * + * + *
        +       * The status returned to the attempt.
        +       * 
        + * + * .google.rpc.Status status = 5; + * + * @return The status. + */ + public com.google.rpc.Status getStatus() { + if (statusBuilder_ == null) { + return status_ == null ? com.google.rpc.Status.getDefaultInstance() : status_; + } else { + return statusBuilder_.getMessage(); + } + } + + /** + * + * + *
        +       * The status returned to the attempt.
        +       * 
        + * + * .google.rpc.Status status = 5; + */ + public Builder setStatus(com.google.rpc.Status value) { + if (statusBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + status_ = value; + } else { + statusBuilder_.setMessage(value); + } + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + /** + * + * + *
        +       * The status returned to the attempt.
        +       * 
        + * + * .google.rpc.Status status = 5; + */ + public Builder setStatus(com.google.rpc.Status.Builder builderForValue) { + if (statusBuilder_ == null) { + status_ = builderForValue.build(); + } else { + statusBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + /** + * + * + *
        +       * The status returned to the attempt.
        +       * 
        + * + * .google.rpc.Status status = 5; + */ + public Builder mergeStatus(com.google.rpc.Status value) { + if (statusBuilder_ == null) { + if (((bitField0_ & 0x00000010) != 0) + && status_ != null + && status_ != com.google.rpc.Status.getDefaultInstance()) { + getStatusBuilder().mergeFrom(value); + } else { + status_ = value; + } + } else { + statusBuilder_.mergeFrom(value); + } + if (status_ != null) { + bitField0_ |= 0x00000010; + onChanged(); + } + return this; + } + + /** + * + * + *
        +       * The status returned to the attempt.
        +       * 
        + * + * .google.rpc.Status status = 5; + */ + public Builder clearStatus() { + bitField0_ = (bitField0_ & ~0x00000010); + status_ = null; + if (statusBuilder_ != null) { + statusBuilder_.dispose(); + statusBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
        +       * The status returned to the attempt.
        +       * 
        + * + * .google.rpc.Status status = 5; + */ + public com.google.rpc.Status.Builder getStatusBuilder() { + bitField0_ |= 0x00000010; + onChanged(); + return getStatusFieldBuilder().getBuilder(); + } + + /** + * + * + *
        +       * The status returned to the attempt.
        +       * 
        + * + * .google.rpc.Status status = 5; + */ + public com.google.rpc.StatusOrBuilder getStatusOrBuilder() { + if (statusBuilder_ != null) { + return statusBuilder_.getMessageOrBuilder(); + } else { + return status_ == null ? com.google.rpc.Status.getDefaultInstance() : status_; + } + } + + /** + * + * + *
        +       * The status returned to the attempt.
        +       * 
        + * + * .google.rpc.Status status = 5; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.rpc.Status, com.google.rpc.Status.Builder, com.google.rpc.StatusOrBuilder> + getStatusFieldBuilder() { + if (statusBuilder_ == null) { + statusBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.rpc.Status, + com.google.rpc.Status.Builder, + com.google.rpc.StatusOrBuilder>(getStatus(), getParentForChildren(), isClean()); + status_ = null; + } + return statusBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.showcase.v1beta1.SequenceReport.Attempt) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.SequenceReport.Attempt) + private static final com.google.showcase.v1beta1.SequenceReport.Attempt DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.SequenceReport.Attempt(); + } + + public static com.google.showcase.v1beta1.SequenceReport.Attempt getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Attempt 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.showcase.v1beta1.SequenceReport.Attempt getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + + /** + * 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; + } + } + + /** + * 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 ATTEMPTS_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private java.util.List attempts_; + + /** + * + * + *
        +   * The set of RPC attempts received by the server for a Sequence.
        +   * 
        + * + * repeated .google.showcase.v1beta1.SequenceReport.Attempt attempts = 2; + */ + @java.lang.Override + public java.util.List getAttemptsList() { + return attempts_; + } + + /** + * + * + *
        +   * The set of RPC attempts received by the server for a Sequence.
        +   * 
        + * + * repeated .google.showcase.v1beta1.SequenceReport.Attempt attempts = 2; + */ + @java.lang.Override + public java.util.List + getAttemptsOrBuilderList() { + return attempts_; + } + + /** + * + * + *
        +   * The set of RPC attempts received by the server for a Sequence.
        +   * 
        + * + * repeated .google.showcase.v1beta1.SequenceReport.Attempt attempts = 2; + */ + @java.lang.Override + public int getAttemptsCount() { + return attempts_.size(); + } + + /** + * + * + *
        +   * The set of RPC attempts received by the server for a Sequence.
        +   * 
        + * + * repeated .google.showcase.v1beta1.SequenceReport.Attempt attempts = 2; + */ + @java.lang.Override + public com.google.showcase.v1beta1.SequenceReport.Attempt getAttempts(int index) { + return attempts_.get(index); + } + + /** + * + * + *
        +   * The set of RPC attempts received by the server for a Sequence.
        +   * 
        + * + * repeated .google.showcase.v1beta1.SequenceReport.Attempt attempts = 2; + */ + @java.lang.Override + public com.google.showcase.v1beta1.SequenceReport.AttemptOrBuilder getAttemptsOrBuilder( + int index) { + return attempts_.get(index); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + for (int i = 0; i < attempts_.size(); i++) { + output.writeMessage(2, attempts_.get(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(name_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + for (int i = 0; i < attempts_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, attempts_.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.showcase.v1beta1.SequenceReport)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.SequenceReport other = + (com.google.showcase.v1beta1.SequenceReport) obj; + + if (!getName().equals(other.getName())) return false; + if (!getAttemptsList().equals(other.getAttemptsList())) 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 (getAttemptsCount() > 0) { + hash = (37 * hash) + ATTEMPTS_FIELD_NUMBER; + hash = (53 * hash) + getAttemptsList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.showcase.v1beta1.SequenceReport parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.SequenceReport parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.SequenceReport parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.SequenceReport 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.showcase.v1beta1.SequenceReport parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.SequenceReport parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.SequenceReport parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.SequenceReport 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.showcase.v1beta1.SequenceReport parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.SequenceReport 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.showcase.v1beta1.SequenceReport parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.SequenceReport 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.showcase.v1beta1.SequenceReport prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** Protobuf type {@code google.showcase.v1beta1.SequenceReport} */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.SequenceReport) + com.google.showcase.v1beta1.SequenceReportOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.SequenceOuterClass + .internal_static_google_showcase_v1beta1_SequenceReport_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.SequenceOuterClass + .internal_static_google_showcase_v1beta1_SequenceReport_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.SequenceReport.class, + com.google.showcase.v1beta1.SequenceReport.Builder.class); + } + + // Construct using com.google.showcase.v1beta1.SequenceReport.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + if (attemptsBuilder_ == null) { + attempts_ = java.util.Collections.emptyList(); + } else { + attempts_ = null; + attemptsBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000002); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.showcase.v1beta1.SequenceOuterClass + .internal_static_google_showcase_v1beta1_SequenceReport_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.SequenceReport getDefaultInstanceForType() { + return com.google.showcase.v1beta1.SequenceReport.getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.SequenceReport build() { + com.google.showcase.v1beta1.SequenceReport result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.SequenceReport buildPartial() { + com.google.showcase.v1beta1.SequenceReport result = + new com.google.showcase.v1beta1.SequenceReport(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields(com.google.showcase.v1beta1.SequenceReport result) { + if (attemptsBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0)) { + attempts_ = java.util.Collections.unmodifiableList(attempts_); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.attempts_ = attempts_; + } else { + result.attempts_ = attemptsBuilder_.build(); + } + } + + private void buildPartial0(com.google.showcase.v1beta1.SequenceReport 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.showcase.v1beta1.SequenceReport) { + return mergeFrom((com.google.showcase.v1beta1.SequenceReport) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.showcase.v1beta1.SequenceReport other) { + if (other == com.google.showcase.v1beta1.SequenceReport.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (attemptsBuilder_ == null) { + if (!other.attempts_.isEmpty()) { + if (attempts_.isEmpty()) { + attempts_ = other.attempts_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureAttemptsIsMutable(); + attempts_.addAll(other.attempts_); + } + onChanged(); + } + } else { + if (!other.attempts_.isEmpty()) { + if (attemptsBuilder_.isEmpty()) { + attemptsBuilder_.dispose(); + attemptsBuilder_ = null; + attempts_ = other.attempts_; + bitField0_ = (bitField0_ & ~0x00000002); + attemptsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getAttemptsFieldBuilder() + : null; + } else { + attemptsBuilder_.addAllMessages(other.attempts_); + } + } + } + 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: + { + com.google.showcase.v1beta1.SequenceReport.Attempt m = + input.readMessage( + com.google.showcase.v1beta1.SequenceReport.Attempt.parser(), + extensionRegistry); + if (attemptsBuilder_ == null) { + ensureAttemptsIsMutable(); + attempts_.add(m); + } else { + attemptsBuilder_.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.lang.Object name_ = ""; + + /** + * 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; + } + } + + /** + * 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; + } + } + + /** + * 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; + } + + /** + * 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; + } + + /** + * 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.util.List attempts_ = + java.util.Collections.emptyList(); + + private void ensureAttemptsIsMutable() { + if (!((bitField0_ & 0x00000002) != 0)) { + attempts_ = + new java.util.ArrayList(attempts_); + bitField0_ |= 0x00000002; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.showcase.v1beta1.SequenceReport.Attempt, + com.google.showcase.v1beta1.SequenceReport.Attempt.Builder, + com.google.showcase.v1beta1.SequenceReport.AttemptOrBuilder> + attemptsBuilder_; + + /** + * + * + *
        +     * The set of RPC attempts received by the server for a Sequence.
        +     * 
        + * + * repeated .google.showcase.v1beta1.SequenceReport.Attempt attempts = 2; + */ + public java.util.List getAttemptsList() { + if (attemptsBuilder_ == null) { + return java.util.Collections.unmodifiableList(attempts_); + } else { + return attemptsBuilder_.getMessageList(); + } + } + + /** + * + * + *
        +     * The set of RPC attempts received by the server for a Sequence.
        +     * 
        + * + * repeated .google.showcase.v1beta1.SequenceReport.Attempt attempts = 2; + */ + public int getAttemptsCount() { + if (attemptsBuilder_ == null) { + return attempts_.size(); + } else { + return attemptsBuilder_.getCount(); + } + } + + /** + * + * + *
        +     * The set of RPC attempts received by the server for a Sequence.
        +     * 
        + * + * repeated .google.showcase.v1beta1.SequenceReport.Attempt attempts = 2; + */ + public com.google.showcase.v1beta1.SequenceReport.Attempt getAttempts(int index) { + if (attemptsBuilder_ == null) { + return attempts_.get(index); + } else { + return attemptsBuilder_.getMessage(index); + } + } + + /** + * + * + *
        +     * The set of RPC attempts received by the server for a Sequence.
        +     * 
        + * + * repeated .google.showcase.v1beta1.SequenceReport.Attempt attempts = 2; + */ + public Builder setAttempts( + int index, com.google.showcase.v1beta1.SequenceReport.Attempt value) { + if (attemptsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureAttemptsIsMutable(); + attempts_.set(index, value); + onChanged(); + } else { + attemptsBuilder_.setMessage(index, value); + } + return this; + } + + /** + * + * + *
        +     * The set of RPC attempts received by the server for a Sequence.
        +     * 
        + * + * repeated .google.showcase.v1beta1.SequenceReport.Attempt attempts = 2; + */ + public Builder setAttempts( + int index, com.google.showcase.v1beta1.SequenceReport.Attempt.Builder builderForValue) { + if (attemptsBuilder_ == null) { + ensureAttemptsIsMutable(); + attempts_.set(index, builderForValue.build()); + onChanged(); + } else { + attemptsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
        +     * The set of RPC attempts received by the server for a Sequence.
        +     * 
        + * + * repeated .google.showcase.v1beta1.SequenceReport.Attempt attempts = 2; + */ + public Builder addAttempts(com.google.showcase.v1beta1.SequenceReport.Attempt value) { + if (attemptsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureAttemptsIsMutable(); + attempts_.add(value); + onChanged(); + } else { + attemptsBuilder_.addMessage(value); + } + return this; + } + + /** + * + * + *
        +     * The set of RPC attempts received by the server for a Sequence.
        +     * 
        + * + * repeated .google.showcase.v1beta1.SequenceReport.Attempt attempts = 2; + */ + public Builder addAttempts( + int index, com.google.showcase.v1beta1.SequenceReport.Attempt value) { + if (attemptsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureAttemptsIsMutable(); + attempts_.add(index, value); + onChanged(); + } else { + attemptsBuilder_.addMessage(index, value); + } + return this; + } + + /** + * + * + *
        +     * The set of RPC attempts received by the server for a Sequence.
        +     * 
        + * + * repeated .google.showcase.v1beta1.SequenceReport.Attempt attempts = 2; + */ + public Builder addAttempts( + com.google.showcase.v1beta1.SequenceReport.Attempt.Builder builderForValue) { + if (attemptsBuilder_ == null) { + ensureAttemptsIsMutable(); + attempts_.add(builderForValue.build()); + onChanged(); + } else { + attemptsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + + /** + * + * + *
        +     * The set of RPC attempts received by the server for a Sequence.
        +     * 
        + * + * repeated .google.showcase.v1beta1.SequenceReport.Attempt attempts = 2; + */ + public Builder addAttempts( + int index, com.google.showcase.v1beta1.SequenceReport.Attempt.Builder builderForValue) { + if (attemptsBuilder_ == null) { + ensureAttemptsIsMutable(); + attempts_.add(index, builderForValue.build()); + onChanged(); + } else { + attemptsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
        +     * The set of RPC attempts received by the server for a Sequence.
        +     * 
        + * + * repeated .google.showcase.v1beta1.SequenceReport.Attempt attempts = 2; + */ + public Builder addAllAttempts( + java.lang.Iterable values) { + if (attemptsBuilder_ == null) { + ensureAttemptsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, attempts_); + onChanged(); + } else { + attemptsBuilder_.addAllMessages(values); + } + return this; + } + + /** + * + * + *
        +     * The set of RPC attempts received by the server for a Sequence.
        +     * 
        + * + * repeated .google.showcase.v1beta1.SequenceReport.Attempt attempts = 2; + */ + public Builder clearAttempts() { + if (attemptsBuilder_ == null) { + attempts_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + } else { + attemptsBuilder_.clear(); + } + return this; + } + + /** + * + * + *
        +     * The set of RPC attempts received by the server for a Sequence.
        +     * 
        + * + * repeated .google.showcase.v1beta1.SequenceReport.Attempt attempts = 2; + */ + public Builder removeAttempts(int index) { + if (attemptsBuilder_ == null) { + ensureAttemptsIsMutable(); + attempts_.remove(index); + onChanged(); + } else { + attemptsBuilder_.remove(index); + } + return this; + } + + /** + * + * + *
        +     * The set of RPC attempts received by the server for a Sequence.
        +     * 
        + * + * repeated .google.showcase.v1beta1.SequenceReport.Attempt attempts = 2; + */ + public com.google.showcase.v1beta1.SequenceReport.Attempt.Builder getAttemptsBuilder( + int index) { + return getAttemptsFieldBuilder().getBuilder(index); + } + + /** + * + * + *
        +     * The set of RPC attempts received by the server for a Sequence.
        +     * 
        + * + * repeated .google.showcase.v1beta1.SequenceReport.Attempt attempts = 2; + */ + public com.google.showcase.v1beta1.SequenceReport.AttemptOrBuilder getAttemptsOrBuilder( + int index) { + if (attemptsBuilder_ == null) { + return attempts_.get(index); + } else { + return attemptsBuilder_.getMessageOrBuilder(index); + } + } + + /** + * + * + *
        +     * The set of RPC attempts received by the server for a Sequence.
        +     * 
        + * + * repeated .google.showcase.v1beta1.SequenceReport.Attempt attempts = 2; + */ + public java.util.List + getAttemptsOrBuilderList() { + if (attemptsBuilder_ != null) { + return attemptsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(attempts_); + } + } + + /** + * + * + *
        +     * The set of RPC attempts received by the server for a Sequence.
        +     * 
        + * + * repeated .google.showcase.v1beta1.SequenceReport.Attempt attempts = 2; + */ + public com.google.showcase.v1beta1.SequenceReport.Attempt.Builder addAttemptsBuilder() { + return getAttemptsFieldBuilder() + .addBuilder(com.google.showcase.v1beta1.SequenceReport.Attempt.getDefaultInstance()); + } + + /** + * + * + *
        +     * The set of RPC attempts received by the server for a Sequence.
        +     * 
        + * + * repeated .google.showcase.v1beta1.SequenceReport.Attempt attempts = 2; + */ + public com.google.showcase.v1beta1.SequenceReport.Attempt.Builder addAttemptsBuilder( + int index) { + return getAttemptsFieldBuilder() + .addBuilder( + index, com.google.showcase.v1beta1.SequenceReport.Attempt.getDefaultInstance()); + } + + /** + * + * + *
        +     * The set of RPC attempts received by the server for a Sequence.
        +     * 
        + * + * repeated .google.showcase.v1beta1.SequenceReport.Attempt attempts = 2; + */ + public java.util.List + getAttemptsBuilderList() { + return getAttemptsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.showcase.v1beta1.SequenceReport.Attempt, + com.google.showcase.v1beta1.SequenceReport.Attempt.Builder, + com.google.showcase.v1beta1.SequenceReport.AttemptOrBuilder> + getAttemptsFieldBuilder() { + if (attemptsBuilder_ == null) { + attemptsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.showcase.v1beta1.SequenceReport.Attempt, + com.google.showcase.v1beta1.SequenceReport.Attempt.Builder, + com.google.showcase.v1beta1.SequenceReport.AttemptOrBuilder>( + attempts_, ((bitField0_ & 0x00000002) != 0), getParentForChildren(), isClean()); + attempts_ = null; + } + return attemptsBuilder_; + } + + @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.showcase.v1beta1.SequenceReport) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.SequenceReport) + private static final com.google.showcase.v1beta1.SequenceReport DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.SequenceReport(); + } + + public static com.google.showcase.v1beta1.SequenceReport getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SequenceReport 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.showcase.v1beta1.SequenceReport getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/SequenceReportName.java b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/SequenceReportName.java new file mode 100644 index 0000000000..8099990181 --- /dev/null +++ b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/SequenceReportName.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.showcase.v1beta1; + +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +@Generated("by gapic-generator-java") +public class SequenceReportName implements ResourceName { + private static final PathTemplate SEQUENCE = + PathTemplate.createWithoutUrlEncoding("sequences/{sequence}/sequenceReport"); + private volatile Map fieldValuesMap; + private final String sequence; + + @Deprecated + protected SequenceReportName() { + sequence = null; + } + + private SequenceReportName(Builder builder) { + sequence = Preconditions.checkNotNull(builder.getSequence()); + } + + public String getSequence() { + return sequence; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + public static SequenceReportName of(String sequence) { + return newBuilder().setSequence(sequence).build(); + } + + public static String format(String sequence) { + return newBuilder().setSequence(sequence).build().toString(); + } + + public static SequenceReportName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + SEQUENCE.validatedMatch( + formattedString, "SequenceReportName.parse: formattedString not in valid format"); + return of(matchMap.get("sequence")); + } + + 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 (SequenceReportName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return SEQUENCE.matches(formattedString); + } + + @Override + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + if (sequence != null) { + fieldMapBuilder.put("sequence", sequence); + } + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return SEQUENCE.instantiate("sequence", sequence); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o != null && getClass() == o.getClass()) { + SequenceReportName that = ((SequenceReportName) o); + return Objects.equals(this.sequence, that.sequence); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= Objects.hashCode(sequence); + return h; + } + + /** Builder for sequences/{sequence}/sequenceReport. */ + public static class Builder { + private String sequence; + + protected Builder() {} + + public String getSequence() { + return sequence; + } + + public Builder setSequence(String sequence) { + this.sequence = sequence; + return this; + } + + private Builder(SequenceReportName sequenceReportName) { + this.sequence = sequenceReportName.sequence; + } + + public SequenceReportName build() { + return new SequenceReportName(this); + } + } +} diff --git a/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/SequenceReportOrBuilder.java b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/SequenceReportOrBuilder.java new file mode 100644 index 0000000000..4f7ead5745 --- /dev/null +++ b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/SequenceReportOrBuilder.java @@ -0,0 +1,96 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/sequence.proto + +// Protobuf Java Version: 3.25.8 +package com.google.showcase.v1beta1; + +public interface SequenceReportOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.SequenceReport) + com.google.protobuf.MessageOrBuilder { + + /** + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The name. + */ + java.lang.String getName(); + + /** + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
        +   * The set of RPC attempts received by the server for a Sequence.
        +   * 
        + * + * repeated .google.showcase.v1beta1.SequenceReport.Attempt attempts = 2; + */ + java.util.List getAttemptsList(); + + /** + * + * + *
        +   * The set of RPC attempts received by the server for a Sequence.
        +   * 
        + * + * repeated .google.showcase.v1beta1.SequenceReport.Attempt attempts = 2; + */ + com.google.showcase.v1beta1.SequenceReport.Attempt getAttempts(int index); + + /** + * + * + *
        +   * The set of RPC attempts received by the server for a Sequence.
        +   * 
        + * + * repeated .google.showcase.v1beta1.SequenceReport.Attempt attempts = 2; + */ + int getAttemptsCount(); + + /** + * + * + *
        +   * The set of RPC attempts received by the server for a Sequence.
        +   * 
        + * + * repeated .google.showcase.v1beta1.SequenceReport.Attempt attempts = 2; + */ + java.util.List + getAttemptsOrBuilderList(); + + /** + * + * + *
        +   * The set of RPC attempts received by the server for a Sequence.
        +   * 
        + * + * repeated .google.showcase.v1beta1.SequenceReport.Attempt attempts = 2; + */ + com.google.showcase.v1beta1.SequenceReport.AttemptOrBuilder getAttemptsOrBuilder(int index); +} diff --git a/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/Session.java b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/Session.java new file mode 100644 index 0000000000..7da9b8081c --- /dev/null +++ b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/Session.java @@ -0,0 +1,961 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/testing.proto + +// Protobuf Java Version: 3.25.8 +package com.google.showcase.v1beta1; + +/** + * + * + *
        + * A session is a suite of tests, generally being made in the context
        + * of testing code generation.
        + *
        + * A session defines tests it may expect, based on which version of the
        + * code generation spec is in use.
        + * 
        + * + * Protobuf type {@code google.showcase.v1beta1.Session} + */ +public final class Session extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.Session) + SessionOrBuilder { + private static final long serialVersionUID = 0L; + + // Use Session.newBuilder() to construct. + private Session(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Session() { + name_ = ""; + version_ = 0; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Session(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.TestingOuterClass + .internal_static_google_showcase_v1beta1_Session_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.TestingOuterClass + .internal_static_google_showcase_v1beta1_Session_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.Session.class, + com.google.showcase.v1beta1.Session.Builder.class); + } + + /** + * + * + *
        +   * The specification versions understood by Showcase.
        +   * 
        + * + * Protobuf enum {@code google.showcase.v1beta1.Session.Version} + */ + public enum Version implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
        +     * Unspecified version. If passed on creation, the session will default
        +     * to using the latest stable release.
        +     * 
        + * + * VERSION_UNSPECIFIED = 0; + */ + VERSION_UNSPECIFIED(0), + /** + * + * + *
        +     * The latest v1. Currently, this is v1.0.
        +     * 
        + * + * V1_LATEST = 1; + */ + V1_LATEST(1), + /** + * + * + *
        +     * v1.0. (Until the spec is "GA", this will be a moving target.)
        +     * 
        + * + * V1_0 = 2; + */ + V1_0(2), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
        +     * Unspecified version. If passed on creation, the session will default
        +     * to using the latest stable release.
        +     * 
        + * + * VERSION_UNSPECIFIED = 0; + */ + public static final int VERSION_UNSPECIFIED_VALUE = 0; + + /** + * + * + *
        +     * The latest v1. Currently, this is v1.0.
        +     * 
        + * + * V1_LATEST = 1; + */ + public static final int V1_LATEST_VALUE = 1; + + /** + * + * + *
        +     * v1.0. (Until the spec is "GA", this will be a moving target.)
        +     * 
        + * + * V1_0 = 2; + */ + public static final int V1_0_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 Version 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 Version forNumber(int value) { + switch (value) { + case 0: + return VERSION_UNSPECIFIED; + case 1: + return V1_LATEST; + case 2: + return V1_0; + 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 Version findValueByNumber(int number) { + return Version.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.showcase.v1beta1.Session.getDescriptor().getEnumTypes().get(0); + } + + private static final Version[] VALUES = values(); + + public static Version 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 Version(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.showcase.v1beta1.Session.Version) + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + + /** + * + * + *
        +   * The name of the session. The ID must conform to ^[a-z]+$
        +   * If this is not provided, Showcase chooses one at random.
        +   * 
        + * + * 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 name of the session. The ID must conform to ^[a-z]+$
        +   * If this is not provided, Showcase chooses one at random.
        +   * 
        + * + * 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 VERSION_FIELD_NUMBER = 2; + private int version_ = 0; + + /** + * + * + *
        +   * Required. The version this session is using.
        +   * 
        + * + * .google.showcase.v1beta1.Session.Version version = 2; + * + * @return The enum numeric value on the wire for version. + */ + @java.lang.Override + public int getVersionValue() { + return version_; + } + + /** + * + * + *
        +   * Required. The version this session is using.
        +   * 
        + * + * .google.showcase.v1beta1.Session.Version version = 2; + * + * @return The version. + */ + @java.lang.Override + public com.google.showcase.v1beta1.Session.Version getVersion() { + com.google.showcase.v1beta1.Session.Version result = + com.google.showcase.v1beta1.Session.Version.forNumber(version_); + return result == null ? com.google.showcase.v1beta1.Session.Version.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 (version_ != com.google.showcase.v1beta1.Session.Version.VERSION_UNSPECIFIED.getNumber()) { + output.writeEnum(2, version_); + } + 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 (version_ != com.google.showcase.v1beta1.Session.Version.VERSION_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(2, version_); + } + 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.showcase.v1beta1.Session)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.Session other = (com.google.showcase.v1beta1.Session) obj; + + if (!getName().equals(other.getName())) 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) + VERSION_FIELD_NUMBER; + hash = (53 * hash) + version_; + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.showcase.v1beta1.Session parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.Session parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.Session parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.Session 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.showcase.v1beta1.Session parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.Session parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.Session parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.Session 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.showcase.v1beta1.Session parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.Session 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.showcase.v1beta1.Session parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.Session 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.showcase.v1beta1.Session prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
        +   * A session is a suite of tests, generally being made in the context
        +   * of testing code generation.
        +   *
        +   * A session defines tests it may expect, based on which version of the
        +   * code generation spec is in use.
        +   * 
        + * + * Protobuf type {@code google.showcase.v1beta1.Session} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.Session) + com.google.showcase.v1beta1.SessionOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.TestingOuterClass + .internal_static_google_showcase_v1beta1_Session_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.TestingOuterClass + .internal_static_google_showcase_v1beta1_Session_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.Session.class, + com.google.showcase.v1beta1.Session.Builder.class); + } + + // Construct using com.google.showcase.v1beta1.Session.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + version_ = 0; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.showcase.v1beta1.TestingOuterClass + .internal_static_google_showcase_v1beta1_Session_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.Session getDefaultInstanceForType() { + return com.google.showcase.v1beta1.Session.getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.Session build() { + com.google.showcase.v1beta1.Session result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.Session buildPartial() { + com.google.showcase.v1beta1.Session result = new com.google.showcase.v1beta1.Session(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.showcase.v1beta1.Session result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.version_ = version_; + } + } + + @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.showcase.v1beta1.Session) { + return mergeFrom((com.google.showcase.v1beta1.Session) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.showcase.v1beta1.Session other) { + if (other == com.google.showcase.v1beta1.Session.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + 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 16: + { + version_ = input.readEnum(); + 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 java.lang.Object name_ = ""; + + /** + * + * + *
        +     * The name of the session. The ID must conform to ^[a-z]+$
        +     * If this is not provided, Showcase chooses one at random.
        +     * 
        + * + * 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 name of the session. The ID must conform to ^[a-z]+$
        +     * If this is not provided, Showcase chooses one at random.
        +     * 
        + * + * 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 name of the session. The ID must conform to ^[a-z]+$
        +     * If this is not provided, Showcase chooses one at random.
        +     * 
        + * + * 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 name of the session. The ID must conform to ^[a-z]+$
        +     * If this is not provided, Showcase chooses one at random.
        +     * 
        + * + * string name = 1; + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
        +     * The name of the session. The ID must conform to ^[a-z]+$
        +     * If this is not provided, Showcase chooses one at random.
        +     * 
        + * + * 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 int version_ = 0; + + /** + * + * + *
        +     * Required. The version this session is using.
        +     * 
        + * + * .google.showcase.v1beta1.Session.Version version = 2; + * + * @return The enum numeric value on the wire for version. + */ + @java.lang.Override + public int getVersionValue() { + return version_; + } + + /** + * + * + *
        +     * Required. The version this session is using.
        +     * 
        + * + * .google.showcase.v1beta1.Session.Version version = 2; + * + * @param value The enum numeric value on the wire for version to set. + * @return This builder for chaining. + */ + public Builder setVersionValue(int value) { + version_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
        +     * Required. The version this session is using.
        +     * 
        + * + * .google.showcase.v1beta1.Session.Version version = 2; + * + * @return The version. + */ + @java.lang.Override + public com.google.showcase.v1beta1.Session.Version getVersion() { + com.google.showcase.v1beta1.Session.Version result = + com.google.showcase.v1beta1.Session.Version.forNumber(version_); + return result == null ? com.google.showcase.v1beta1.Session.Version.UNRECOGNIZED : result; + } + + /** + * + * + *
        +     * Required. The version this session is using.
        +     * 
        + * + * .google.showcase.v1beta1.Session.Version version = 2; + * + * @param value The version to set. + * @return This builder for chaining. + */ + public Builder setVersion(com.google.showcase.v1beta1.Session.Version value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000002; + version_ = value.getNumber(); + onChanged(); + return this; + } + + /** + * + * + *
        +     * Required. The version this session is using.
        +     * 
        + * + * .google.showcase.v1beta1.Session.Version version = 2; + * + * @return This builder for chaining. + */ + public Builder clearVersion() { + bitField0_ = (bitField0_ & ~0x00000002); + 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.showcase.v1beta1.Session) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.Session) + private static final com.google.showcase.v1beta1.Session DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.Session(); + } + + public static com.google.showcase.v1beta1.Session getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Session 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.showcase.v1beta1.Session getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/SessionName.java b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/SessionName.java new file mode 100644 index 0000000000..b081a0cbfc --- /dev/null +++ b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/SessionName.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.showcase.v1beta1; + +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +@Generated("by gapic-generator-java") +public class SessionName implements ResourceName { + private static final PathTemplate SESSION = + PathTemplate.createWithoutUrlEncoding("sessions/{session}"); + private volatile Map fieldValuesMap; + private final String session; + + @Deprecated + protected SessionName() { + session = null; + } + + private SessionName(Builder builder) { + session = Preconditions.checkNotNull(builder.getSession()); + } + + public String getSession() { + return session; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + public static SessionName of(String session) { + return newBuilder().setSession(session).build(); + } + + public static String format(String session) { + return newBuilder().setSession(session).build().toString(); + } + + public static SessionName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + SESSION.validatedMatch( + formattedString, "SessionName.parse: formattedString not in valid format"); + return of(matchMap.get("session")); + } + + 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 (SessionName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return SESSION.matches(formattedString); + } + + @Override + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + if (session != null) { + fieldMapBuilder.put("session", session); + } + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return SESSION.instantiate("session", session); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o != null && getClass() == o.getClass()) { + SessionName that = ((SessionName) o); + return Objects.equals(this.session, that.session); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= Objects.hashCode(session); + return h; + } + + /** Builder for sessions/{session}. */ + public static class Builder { + private String session; + + protected Builder() {} + + public String getSession() { + return session; + } + + public Builder setSession(String session) { + this.session = session; + return this; + } + + private Builder(SessionName sessionName) { + this.session = sessionName.session; + } + + public SessionName build() { + return new SessionName(this); + } + } +} diff --git a/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/SessionOrBuilder.java b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/SessionOrBuilder.java new file mode 100644 index 0000000000..09b18bf4f1 --- /dev/null +++ b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/SessionOrBuilder.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: schema/google/showcase/v1beta1/testing.proto + +// Protobuf Java Version: 3.25.8 +package com.google.showcase.v1beta1; + +public interface SessionOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.Session) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
        +   * The name of the session. The ID must conform to ^[a-z]+$
        +   * If this is not provided, Showcase chooses one at random.
        +   * 
        + * + * string name = 1; + * + * @return The name. + */ + java.lang.String getName(); + + /** + * + * + *
        +   * The name of the session. The ID must conform to ^[a-z]+$
        +   * If this is not provided, Showcase chooses one at random.
        +   * 
        + * + * string name = 1; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
        +   * Required. The version this session is using.
        +   * 
        + * + * .google.showcase.v1beta1.Session.Version version = 2; + * + * @return The enum numeric value on the wire for version. + */ + int getVersionValue(); + + /** + * + * + *
        +   * Required. The version this session is using.
        +   * 
        + * + * .google.showcase.v1beta1.Session.Version version = 2; + * + * @return The version. + */ + com.google.showcase.v1beta1.Session.Version getVersion(); +} diff --git a/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/Severity.java b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/Severity.java new file mode 100644 index 0000000000..7359ba44d2 --- /dev/null +++ b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/Severity.java @@ -0,0 +1,138 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/echo.proto + +// Protobuf Java Version: 3.25.8 +package com.google.showcase.v1beta1; + +/** + * + * + *
        + * A severity enum used to test enum capabilities in GAPIC surfaces.
        + * 
        + * + * Protobuf enum {@code google.showcase.v1beta1.Severity} + */ +public enum Severity implements com.google.protobuf.ProtocolMessageEnum { + /** UNNECESSARY = 0; */ + UNNECESSARY(0), + /** NECESSARY = 1; */ + NECESSARY(1), + /** URGENT = 2; */ + URGENT(2), + /** CRITICAL = 3; */ + CRITICAL(3), + UNRECOGNIZED(-1), + ; + + /** UNNECESSARY = 0; */ + public static final int UNNECESSARY_VALUE = 0; + + /** NECESSARY = 1; */ + public static final int NECESSARY_VALUE = 1; + + /** URGENT = 2; */ + public static final int URGENT_VALUE = 2; + + /** CRITICAL = 3; */ + public static final int CRITICAL_VALUE = 3; + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static Severity 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 Severity forNumber(int value) { + switch (value) { + case 0: + return UNNECESSARY; + case 1: + return NECESSARY; + case 2: + return URGENT; + case 3: + return CRITICAL; + 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 Severity findValueByNumber(int number) { + return Severity.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.showcase.v1beta1.EchoOuterClass.getDescriptor().getEnumTypes().get(0); + } + + private static final Severity[] VALUES = values(); + + public static Severity 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 Severity(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.showcase.v1beta1.Severity) +} diff --git a/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/StreamBlurbsRequest.java b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/StreamBlurbsRequest.java new file mode 100644 index 0000000000..5a6148d001 --- /dev/null +++ b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/StreamBlurbsRequest.java @@ -0,0 +1,949 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/messaging.proto + +// Protobuf Java Version: 3.25.8 +package com.google.showcase.v1beta1; + +/** + * + * + *
        + * The request message for the google.showcase.v1beta1.Messaging\StreamBlurbs
        + * method.
        + * 
        + * + * Protobuf type {@code google.showcase.v1beta1.StreamBlurbsRequest} + */ +public final class StreamBlurbsRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.StreamBlurbsRequest) + StreamBlurbsRequestOrBuilder { + private static final long serialVersionUID = 0L; + + // Use StreamBlurbsRequest.newBuilder() to construct. + private StreamBlurbsRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private StreamBlurbsRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new StreamBlurbsRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.MessagingOuterClass + .internal_static_google_showcase_v1beta1_StreamBlurbsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.MessagingOuterClass + .internal_static_google_showcase_v1beta1_StreamBlurbsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.StreamBlurbsRequest.class, + com.google.showcase.v1beta1.StreamBlurbsRequest.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 a chat room or user profile whose blurbs to stream.
        +   * 
        + * + * + * 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; + } + } + + /** + * + * + *
        +   * The resource name of a chat room or user profile whose blurbs to stream.
        +   * 
        + * + * + * 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 EXPIRE_TIME_FIELD_NUMBER = 2; + private com.google.protobuf.Timestamp expireTime_; + + /** + * + * + *
        +   * The time at which this stream will close.
        +   * 
        + * + * .google.protobuf.Timestamp expire_time = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the expireTime field is set. + */ + @java.lang.Override + public boolean hasExpireTime() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
        +   * The time at which this stream will close.
        +   * 
        + * + * .google.protobuf.Timestamp expire_time = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The expireTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getExpireTime() { + return expireTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : expireTime_; + } + + /** + * + * + *
        +   * The time at which this stream will close.
        +   * 
        + * + * .google.protobuf.Timestamp expire_time = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getExpireTimeOrBuilder() { + return expireTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : expireTime_; + } + + 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, getExpireTime()); + } + 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, getExpireTime()); + } + 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.showcase.v1beta1.StreamBlurbsRequest)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.StreamBlurbsRequest other = + (com.google.showcase.v1beta1.StreamBlurbsRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (hasExpireTime() != other.hasExpireTime()) return false; + if (hasExpireTime()) { + if (!getExpireTime().equals(other.getExpireTime())) 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 (hasExpireTime()) { + hash = (37 * hash) + EXPIRE_TIME_FIELD_NUMBER; + hash = (53 * hash) + getExpireTime().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.showcase.v1beta1.StreamBlurbsRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.StreamBlurbsRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.StreamBlurbsRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.StreamBlurbsRequest 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.showcase.v1beta1.StreamBlurbsRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.StreamBlurbsRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.StreamBlurbsRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.StreamBlurbsRequest 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.showcase.v1beta1.StreamBlurbsRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.StreamBlurbsRequest 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.showcase.v1beta1.StreamBlurbsRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.StreamBlurbsRequest 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.showcase.v1beta1.StreamBlurbsRequest 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 request message for the google.showcase.v1beta1.Messaging\StreamBlurbs
        +   * method.
        +   * 
        + * + * Protobuf type {@code google.showcase.v1beta1.StreamBlurbsRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.StreamBlurbsRequest) + com.google.showcase.v1beta1.StreamBlurbsRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.MessagingOuterClass + .internal_static_google_showcase_v1beta1_StreamBlurbsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.MessagingOuterClass + .internal_static_google_showcase_v1beta1_StreamBlurbsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.StreamBlurbsRequest.class, + com.google.showcase.v1beta1.StreamBlurbsRequest.Builder.class); + } + + // Construct using com.google.showcase.v1beta1.StreamBlurbsRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getExpireTimeFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + expireTime_ = null; + if (expireTimeBuilder_ != null) { + expireTimeBuilder_.dispose(); + expireTimeBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.showcase.v1beta1.MessagingOuterClass + .internal_static_google_showcase_v1beta1_StreamBlurbsRequest_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.StreamBlurbsRequest getDefaultInstanceForType() { + return com.google.showcase.v1beta1.StreamBlurbsRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.StreamBlurbsRequest build() { + com.google.showcase.v1beta1.StreamBlurbsRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.StreamBlurbsRequest buildPartial() { + com.google.showcase.v1beta1.StreamBlurbsRequest result = + new com.google.showcase.v1beta1.StreamBlurbsRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.showcase.v1beta1.StreamBlurbsRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.expireTime_ = expireTimeBuilder_ == null ? expireTime_ : expireTimeBuilder_.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.showcase.v1beta1.StreamBlurbsRequest) { + return mergeFrom((com.google.showcase.v1beta1.StreamBlurbsRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.showcase.v1beta1.StreamBlurbsRequest other) { + if (other == com.google.showcase.v1beta1.StreamBlurbsRequest.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.hasExpireTime()) { + mergeExpireTime(other.getExpireTime()); + } + 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(getExpireTimeFieldBuilder().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 name_ = ""; + + /** + * + * + *
        +     * The resource name of a chat room or user profile whose blurbs to stream.
        +     * 
        + * + * + * 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; + } + } + + /** + * + * + *
        +     * The resource name of a chat room or user profile whose blurbs to stream.
        +     * 
        + * + * + * 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; + } + } + + /** + * + * + *
        +     * The resource name of a chat room or user profile whose blurbs to stream.
        +     * 
        + * + * + * 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; + } + + /** + * + * + *
        +     * The resource name of a chat room or user profile whose blurbs to stream.
        +     * 
        + * + * + * 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; + } + + /** + * + * + *
        +     * The resource name of a chat room or user profile whose blurbs to stream.
        +     * 
        + * + * + * 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.protobuf.Timestamp expireTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + expireTimeBuilder_; + + /** + * + * + *
        +     * The time at which this stream will close.
        +     * 
        + * + * .google.protobuf.Timestamp expire_time = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the expireTime field is set. + */ + public boolean hasExpireTime() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
        +     * The time at which this stream will close.
        +     * 
        + * + * .google.protobuf.Timestamp expire_time = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The expireTime. + */ + public com.google.protobuf.Timestamp getExpireTime() { + if (expireTimeBuilder_ == null) { + return expireTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : expireTime_; + } else { + return expireTimeBuilder_.getMessage(); + } + } + + /** + * + * + *
        +     * The time at which this stream will close.
        +     * 
        + * + * .google.protobuf.Timestamp expire_time = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setExpireTime(com.google.protobuf.Timestamp value) { + if (expireTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + expireTime_ = value; + } else { + expireTimeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
        +     * The time at which this stream will close.
        +     * 
        + * + * .google.protobuf.Timestamp expire_time = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setExpireTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (expireTimeBuilder_ == null) { + expireTime_ = builderForValue.build(); + } else { + expireTimeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
        +     * The time at which this stream will close.
        +     * 
        + * + * .google.protobuf.Timestamp expire_time = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeExpireTime(com.google.protobuf.Timestamp value) { + if (expireTimeBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && expireTime_ != null + && expireTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getExpireTimeBuilder().mergeFrom(value); + } else { + expireTime_ = value; + } + } else { + expireTimeBuilder_.mergeFrom(value); + } + if (expireTime_ != null) { + bitField0_ |= 0x00000002; + onChanged(); + } + return this; + } + + /** + * + * + *
        +     * The time at which this stream will close.
        +     * 
        + * + * .google.protobuf.Timestamp expire_time = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearExpireTime() { + bitField0_ = (bitField0_ & ~0x00000002); + expireTime_ = null; + if (expireTimeBuilder_ != null) { + expireTimeBuilder_.dispose(); + expireTimeBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
        +     * The time at which this stream will close.
        +     * 
        + * + * .google.protobuf.Timestamp expire_time = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.protobuf.Timestamp.Builder getExpireTimeBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return getExpireTimeFieldBuilder().getBuilder(); + } + + /** + * + * + *
        +     * The time at which this stream will close.
        +     * 
        + * + * .google.protobuf.Timestamp expire_time = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.protobuf.TimestampOrBuilder getExpireTimeOrBuilder() { + if (expireTimeBuilder_ != null) { + return expireTimeBuilder_.getMessageOrBuilder(); + } else { + return expireTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : expireTime_; + } + } + + /** + * + * + *
        +     * The time at which this stream will close.
        +     * 
        + * + * .google.protobuf.Timestamp expire_time = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getExpireTimeFieldBuilder() { + if (expireTimeBuilder_ == null) { + expireTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getExpireTime(), getParentForChildren(), isClean()); + expireTime_ = null; + } + return expireTimeBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.showcase.v1beta1.StreamBlurbsRequest) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.StreamBlurbsRequest) + private static final com.google.showcase.v1beta1.StreamBlurbsRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.StreamBlurbsRequest(); + } + + public static com.google.showcase.v1beta1.StreamBlurbsRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public StreamBlurbsRequest 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.showcase.v1beta1.StreamBlurbsRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/StreamBlurbsRequestOrBuilder.java b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/StreamBlurbsRequestOrBuilder.java new file mode 100644 index 0000000000..099900af6b --- /dev/null +++ b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/StreamBlurbsRequestOrBuilder.java @@ -0,0 +1,96 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/messaging.proto + +// Protobuf Java Version: 3.25.8 +package com.google.showcase.v1beta1; + +public interface StreamBlurbsRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.StreamBlurbsRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
        +   * The resource name of a chat room or user profile whose blurbs to stream.
        +   * 
        + * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + + /** + * + * + *
        +   * The resource name of a chat room or user profile whose blurbs to stream.
        +   * 
        + * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
        +   * The time at which this stream will close.
        +   * 
        + * + * .google.protobuf.Timestamp expire_time = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the expireTime field is set. + */ + boolean hasExpireTime(); + + /** + * + * + *
        +   * The time at which this stream will close.
        +   * 
        + * + * .google.protobuf.Timestamp expire_time = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The expireTime. + */ + com.google.protobuf.Timestamp getExpireTime(); + + /** + * + * + *
        +   * The time at which this stream will close.
        +   * 
        + * + * .google.protobuf.Timestamp expire_time = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.protobuf.TimestampOrBuilder getExpireTimeOrBuilder(); +} diff --git a/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/StreamBlurbsResponse.java b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/StreamBlurbsResponse.java new file mode 100644 index 0000000000..d080cfc08a --- /dev/null +++ b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/StreamBlurbsResponse.java @@ -0,0 +1,1057 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/messaging.proto + +// Protobuf Java Version: 3.25.8 +package com.google.showcase.v1beta1; + +/** + * + * + *
        + * The response message for the google.showcase.v1beta1.Messaging\StreamBlurbs
        + * method.
        + * 
        + * + * Protobuf type {@code google.showcase.v1beta1.StreamBlurbsResponse} + */ +public final class StreamBlurbsResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.StreamBlurbsResponse) + StreamBlurbsResponseOrBuilder { + private static final long serialVersionUID = 0L; + + // Use StreamBlurbsResponse.newBuilder() to construct. + private StreamBlurbsResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private StreamBlurbsResponse() { + action_ = 0; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new StreamBlurbsResponse(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.MessagingOuterClass + .internal_static_google_showcase_v1beta1_StreamBlurbsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.MessagingOuterClass + .internal_static_google_showcase_v1beta1_StreamBlurbsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.StreamBlurbsResponse.class, + com.google.showcase.v1beta1.StreamBlurbsResponse.Builder.class); + } + + /** + * + * + *
        +   * The action that triggered the blurb to be returned.
        +   * 
        + * + * Protobuf enum {@code google.showcase.v1beta1.StreamBlurbsResponse.Action} + */ + public enum Action implements com.google.protobuf.ProtocolMessageEnum { + /** ACTION_UNSPECIFIED = 0; */ + ACTION_UNSPECIFIED(0), + /** + * + * + *
        +     * Specifies that the blurb was created.
        +     * 
        + * + * CREATE = 1; + */ + CREATE(1), + /** + * + * + *
        +     * Specifies that the blurb was updated.
        +     * 
        + * + * UPDATE = 2; + */ + UPDATE(2), + /** + * + * + *
        +     * Specifies that the blurb was deleted.
        +     * 
        + * + * DELETE = 3; + */ + DELETE(3), + UNRECOGNIZED(-1), + ; + + /** ACTION_UNSPECIFIED = 0; */ + public static final int ACTION_UNSPECIFIED_VALUE = 0; + + /** + * + * + *
        +     * Specifies that the blurb was created.
        +     * 
        + * + * CREATE = 1; + */ + public static final int CREATE_VALUE = 1; + + /** + * + * + *
        +     * Specifies that the blurb was updated.
        +     * 
        + * + * UPDATE = 2; + */ + public static final int UPDATE_VALUE = 2; + + /** + * + * + *
        +     * Specifies that the blurb was deleted.
        +     * 
        + * + * DELETE = 3; + */ + public static final int DELETE_VALUE = 3; + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static Action 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 Action forNumber(int value) { + switch (value) { + case 0: + return ACTION_UNSPECIFIED; + case 1: + return CREATE; + case 2: + return UPDATE; + case 3: + return DELETE; + 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 Action findValueByNumber(int number) { + return Action.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.showcase.v1beta1.StreamBlurbsResponse.getDescriptor().getEnumTypes().get(0); + } + + private static final Action[] VALUES = values(); + + public static Action 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 Action(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.showcase.v1beta1.StreamBlurbsResponse.Action) + } + + private int bitField0_; + public static final int BLURB_FIELD_NUMBER = 1; + private com.google.showcase.v1beta1.Blurb blurb_; + + /** + * + * + *
        +   * The blurb that was either created, updated, or deleted.
        +   * 
        + * + * .google.showcase.v1beta1.Blurb blurb = 1; + * + * @return Whether the blurb field is set. + */ + @java.lang.Override + public boolean hasBlurb() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
        +   * The blurb that was either created, updated, or deleted.
        +   * 
        + * + * .google.showcase.v1beta1.Blurb blurb = 1; + * + * @return The blurb. + */ + @java.lang.Override + public com.google.showcase.v1beta1.Blurb getBlurb() { + return blurb_ == null ? com.google.showcase.v1beta1.Blurb.getDefaultInstance() : blurb_; + } + + /** + * + * + *
        +   * The blurb that was either created, updated, or deleted.
        +   * 
        + * + * .google.showcase.v1beta1.Blurb blurb = 1; + */ + @java.lang.Override + public com.google.showcase.v1beta1.BlurbOrBuilder getBlurbOrBuilder() { + return blurb_ == null ? com.google.showcase.v1beta1.Blurb.getDefaultInstance() : blurb_; + } + + public static final int ACTION_FIELD_NUMBER = 2; + private int action_ = 0; + + /** + * + * + *
        +   * The action that triggered the blurb to be returned.
        +   * 
        + * + * .google.showcase.v1beta1.StreamBlurbsResponse.Action action = 2; + * + * @return The enum numeric value on the wire for action. + */ + @java.lang.Override + public int getActionValue() { + return action_; + } + + /** + * + * + *
        +   * The action that triggered the blurb to be returned.
        +   * 
        + * + * .google.showcase.v1beta1.StreamBlurbsResponse.Action action = 2; + * + * @return The action. + */ + @java.lang.Override + public com.google.showcase.v1beta1.StreamBlurbsResponse.Action getAction() { + com.google.showcase.v1beta1.StreamBlurbsResponse.Action result = + com.google.showcase.v1beta1.StreamBlurbsResponse.Action.forNumber(action_); + return result == null + ? com.google.showcase.v1beta1.StreamBlurbsResponse.Action.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 (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(1, getBlurb()); + } + if (action_ + != com.google.showcase.v1beta1.StreamBlurbsResponse.Action.ACTION_UNSPECIFIED.getNumber()) { + output.writeEnum(2, action_); + } + 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, getBlurb()); + } + if (action_ + != com.google.showcase.v1beta1.StreamBlurbsResponse.Action.ACTION_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(2, action_); + } + 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.showcase.v1beta1.StreamBlurbsResponse)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.StreamBlurbsResponse other = + (com.google.showcase.v1beta1.StreamBlurbsResponse) obj; + + if (hasBlurb() != other.hasBlurb()) return false; + if (hasBlurb()) { + if (!getBlurb().equals(other.getBlurb())) return false; + } + if (action_ != other.action_) 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 (hasBlurb()) { + hash = (37 * hash) + BLURB_FIELD_NUMBER; + hash = (53 * hash) + getBlurb().hashCode(); + } + hash = (37 * hash) + ACTION_FIELD_NUMBER; + hash = (53 * hash) + action_; + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.showcase.v1beta1.StreamBlurbsResponse parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.StreamBlurbsResponse parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.StreamBlurbsResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.StreamBlurbsResponse 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.showcase.v1beta1.StreamBlurbsResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.StreamBlurbsResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.StreamBlurbsResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.StreamBlurbsResponse 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.showcase.v1beta1.StreamBlurbsResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.StreamBlurbsResponse 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.showcase.v1beta1.StreamBlurbsResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.StreamBlurbsResponse 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.showcase.v1beta1.StreamBlurbsResponse 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 message for the google.showcase.v1beta1.Messaging\StreamBlurbs
        +   * method.
        +   * 
        + * + * Protobuf type {@code google.showcase.v1beta1.StreamBlurbsResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.StreamBlurbsResponse) + com.google.showcase.v1beta1.StreamBlurbsResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.MessagingOuterClass + .internal_static_google_showcase_v1beta1_StreamBlurbsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.MessagingOuterClass + .internal_static_google_showcase_v1beta1_StreamBlurbsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.StreamBlurbsResponse.class, + com.google.showcase.v1beta1.StreamBlurbsResponse.Builder.class); + } + + // Construct using com.google.showcase.v1beta1.StreamBlurbsResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getBlurbFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + blurb_ = null; + if (blurbBuilder_ != null) { + blurbBuilder_.dispose(); + blurbBuilder_ = null; + } + action_ = 0; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.showcase.v1beta1.MessagingOuterClass + .internal_static_google_showcase_v1beta1_StreamBlurbsResponse_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.StreamBlurbsResponse getDefaultInstanceForType() { + return com.google.showcase.v1beta1.StreamBlurbsResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.StreamBlurbsResponse build() { + com.google.showcase.v1beta1.StreamBlurbsResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.StreamBlurbsResponse buildPartial() { + com.google.showcase.v1beta1.StreamBlurbsResponse result = + new com.google.showcase.v1beta1.StreamBlurbsResponse(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.showcase.v1beta1.StreamBlurbsResponse result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.blurb_ = blurbBuilder_ == null ? blurb_ : blurbBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.action_ = action_; + } + 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.showcase.v1beta1.StreamBlurbsResponse) { + return mergeFrom((com.google.showcase.v1beta1.StreamBlurbsResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.showcase.v1beta1.StreamBlurbsResponse other) { + if (other == com.google.showcase.v1beta1.StreamBlurbsResponse.getDefaultInstance()) + return this; + if (other.hasBlurb()) { + mergeBlurb(other.getBlurb()); + } + if (other.action_ != 0) { + setActionValue(other.getActionValue()); + } + 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(getBlurbFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 16: + { + action_ = input.readEnum(); + 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 com.google.showcase.v1beta1.Blurb blurb_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.showcase.v1beta1.Blurb, + com.google.showcase.v1beta1.Blurb.Builder, + com.google.showcase.v1beta1.BlurbOrBuilder> + blurbBuilder_; + + /** + * + * + *
        +     * The blurb that was either created, updated, or deleted.
        +     * 
        + * + * .google.showcase.v1beta1.Blurb blurb = 1; + * + * @return Whether the blurb field is set. + */ + public boolean hasBlurb() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
        +     * The blurb that was either created, updated, or deleted.
        +     * 
        + * + * .google.showcase.v1beta1.Blurb blurb = 1; + * + * @return The blurb. + */ + public com.google.showcase.v1beta1.Blurb getBlurb() { + if (blurbBuilder_ == null) { + return blurb_ == null ? com.google.showcase.v1beta1.Blurb.getDefaultInstance() : blurb_; + } else { + return blurbBuilder_.getMessage(); + } + } + + /** + * + * + *
        +     * The blurb that was either created, updated, or deleted.
        +     * 
        + * + * .google.showcase.v1beta1.Blurb blurb = 1; + */ + public Builder setBlurb(com.google.showcase.v1beta1.Blurb value) { + if (blurbBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + blurb_ = value; + } else { + blurbBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
        +     * The blurb that was either created, updated, or deleted.
        +     * 
        + * + * .google.showcase.v1beta1.Blurb blurb = 1; + */ + public Builder setBlurb(com.google.showcase.v1beta1.Blurb.Builder builderForValue) { + if (blurbBuilder_ == null) { + blurb_ = builderForValue.build(); + } else { + blurbBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
        +     * The blurb that was either created, updated, or deleted.
        +     * 
        + * + * .google.showcase.v1beta1.Blurb blurb = 1; + */ + public Builder mergeBlurb(com.google.showcase.v1beta1.Blurb value) { + if (blurbBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) + && blurb_ != null + && blurb_ != com.google.showcase.v1beta1.Blurb.getDefaultInstance()) { + getBlurbBuilder().mergeFrom(value); + } else { + blurb_ = value; + } + } else { + blurbBuilder_.mergeFrom(value); + } + if (blurb_ != null) { + bitField0_ |= 0x00000001; + onChanged(); + } + return this; + } + + /** + * + * + *
        +     * The blurb that was either created, updated, or deleted.
        +     * 
        + * + * .google.showcase.v1beta1.Blurb blurb = 1; + */ + public Builder clearBlurb() { + bitField0_ = (bitField0_ & ~0x00000001); + blurb_ = null; + if (blurbBuilder_ != null) { + blurbBuilder_.dispose(); + blurbBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
        +     * The blurb that was either created, updated, or deleted.
        +     * 
        + * + * .google.showcase.v1beta1.Blurb blurb = 1; + */ + public com.google.showcase.v1beta1.Blurb.Builder getBlurbBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return getBlurbFieldBuilder().getBuilder(); + } + + /** + * + * + *
        +     * The blurb that was either created, updated, or deleted.
        +     * 
        + * + * .google.showcase.v1beta1.Blurb blurb = 1; + */ + public com.google.showcase.v1beta1.BlurbOrBuilder getBlurbOrBuilder() { + if (blurbBuilder_ != null) { + return blurbBuilder_.getMessageOrBuilder(); + } else { + return blurb_ == null ? com.google.showcase.v1beta1.Blurb.getDefaultInstance() : blurb_; + } + } + + /** + * + * + *
        +     * The blurb that was either created, updated, or deleted.
        +     * 
        + * + * .google.showcase.v1beta1.Blurb blurb = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.showcase.v1beta1.Blurb, + com.google.showcase.v1beta1.Blurb.Builder, + com.google.showcase.v1beta1.BlurbOrBuilder> + getBlurbFieldBuilder() { + if (blurbBuilder_ == null) { + blurbBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.showcase.v1beta1.Blurb, + com.google.showcase.v1beta1.Blurb.Builder, + com.google.showcase.v1beta1.BlurbOrBuilder>( + getBlurb(), getParentForChildren(), isClean()); + blurb_ = null; + } + return blurbBuilder_; + } + + private int action_ = 0; + + /** + * + * + *
        +     * The action that triggered the blurb to be returned.
        +     * 
        + * + * .google.showcase.v1beta1.StreamBlurbsResponse.Action action = 2; + * + * @return The enum numeric value on the wire for action. + */ + @java.lang.Override + public int getActionValue() { + return action_; + } + + /** + * + * + *
        +     * The action that triggered the blurb to be returned.
        +     * 
        + * + * .google.showcase.v1beta1.StreamBlurbsResponse.Action action = 2; + * + * @param value The enum numeric value on the wire for action to set. + * @return This builder for chaining. + */ + public Builder setActionValue(int value) { + action_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
        +     * The action that triggered the blurb to be returned.
        +     * 
        + * + * .google.showcase.v1beta1.StreamBlurbsResponse.Action action = 2; + * + * @return The action. + */ + @java.lang.Override + public com.google.showcase.v1beta1.StreamBlurbsResponse.Action getAction() { + com.google.showcase.v1beta1.StreamBlurbsResponse.Action result = + com.google.showcase.v1beta1.StreamBlurbsResponse.Action.forNumber(action_); + return result == null + ? com.google.showcase.v1beta1.StreamBlurbsResponse.Action.UNRECOGNIZED + : result; + } + + /** + * + * + *
        +     * The action that triggered the blurb to be returned.
        +     * 
        + * + * .google.showcase.v1beta1.StreamBlurbsResponse.Action action = 2; + * + * @param value The action to set. + * @return This builder for chaining. + */ + public Builder setAction(com.google.showcase.v1beta1.StreamBlurbsResponse.Action value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000002; + action_ = value.getNumber(); + onChanged(); + return this; + } + + /** + * + * + *
        +     * The action that triggered the blurb to be returned.
        +     * 
        + * + * .google.showcase.v1beta1.StreamBlurbsResponse.Action action = 2; + * + * @return This builder for chaining. + */ + public Builder clearAction() { + bitField0_ = (bitField0_ & ~0x00000002); + action_ = 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.showcase.v1beta1.StreamBlurbsResponse) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.StreamBlurbsResponse) + private static final com.google.showcase.v1beta1.StreamBlurbsResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.StreamBlurbsResponse(); + } + + public static com.google.showcase.v1beta1.StreamBlurbsResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public StreamBlurbsResponse 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.showcase.v1beta1.StreamBlurbsResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/StreamBlurbsResponseOrBuilder.java b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/StreamBlurbsResponseOrBuilder.java new file mode 100644 index 0000000000..fae6d5c28f --- /dev/null +++ b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/StreamBlurbsResponseOrBuilder.java @@ -0,0 +1,89 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/messaging.proto + +// Protobuf Java Version: 3.25.8 +package com.google.showcase.v1beta1; + +public interface StreamBlurbsResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.StreamBlurbsResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
        +   * The blurb that was either created, updated, or deleted.
        +   * 
        + * + * .google.showcase.v1beta1.Blurb blurb = 1; + * + * @return Whether the blurb field is set. + */ + boolean hasBlurb(); + + /** + * + * + *
        +   * The blurb that was either created, updated, or deleted.
        +   * 
        + * + * .google.showcase.v1beta1.Blurb blurb = 1; + * + * @return The blurb. + */ + com.google.showcase.v1beta1.Blurb getBlurb(); + + /** + * + * + *
        +   * The blurb that was either created, updated, or deleted.
        +   * 
        + * + * .google.showcase.v1beta1.Blurb blurb = 1; + */ + com.google.showcase.v1beta1.BlurbOrBuilder getBlurbOrBuilder(); + + /** + * + * + *
        +   * The action that triggered the blurb to be returned.
        +   * 
        + * + * .google.showcase.v1beta1.StreamBlurbsResponse.Action action = 2; + * + * @return The enum numeric value on the wire for action. + */ + int getActionValue(); + + /** + * + * + *
        +   * The action that triggered the blurb to be returned.
        +   * 
        + * + * .google.showcase.v1beta1.StreamBlurbsResponse.Action action = 2; + * + * @return The action. + */ + com.google.showcase.v1beta1.StreamBlurbsResponse.Action getAction(); +} diff --git a/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/StreamingSequence.java b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/StreamingSequence.java new file mode 100644 index 0000000000..8156ad63af --- /dev/null +++ b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/StreamingSequence.java @@ -0,0 +1,2485 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/sequence.proto + +// Protobuf Java Version: 3.25.8 +package com.google.showcase.v1beta1; + +/** Protobuf type {@code google.showcase.v1beta1.StreamingSequence} */ +public final class StreamingSequence extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.StreamingSequence) + StreamingSequenceOrBuilder { + private static final long serialVersionUID = 0L; + + // Use StreamingSequence.newBuilder() to construct. + private StreamingSequence(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private StreamingSequence() { + name_ = ""; + content_ = ""; + responses_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new StreamingSequence(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.SequenceOuterClass + .internal_static_google_showcase_v1beta1_StreamingSequence_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.SequenceOuterClass + .internal_static_google_showcase_v1beta1_StreamingSequence_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.StreamingSequence.class, + com.google.showcase.v1beta1.StreamingSequence.Builder.class); + } + + public interface ResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.StreamingSequence.Response) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
        +     * The status to return for an individual attempt.
        +     * 
        + * + * .google.rpc.Status status = 1; + * + * @return Whether the status field is set. + */ + boolean hasStatus(); + + /** + * + * + *
        +     * The status to return for an individual attempt.
        +     * 
        + * + * .google.rpc.Status status = 1; + * + * @return The status. + */ + com.google.rpc.Status getStatus(); + + /** + * + * + *
        +     * The status to return for an individual attempt.
        +     * 
        + * + * .google.rpc.Status status = 1; + */ + com.google.rpc.StatusOrBuilder getStatusOrBuilder(); + + /** + * + * + *
        +     * The amount of time to delay sending the response.
        +     * 
        + * + * .google.protobuf.Duration delay = 2; + * + * @return Whether the delay field is set. + */ + boolean hasDelay(); + + /** + * + * + *
        +     * The amount of time to delay sending the response.
        +     * 
        + * + * .google.protobuf.Duration delay = 2; + * + * @return The delay. + */ + com.google.protobuf.Duration getDelay(); + + /** + * + * + *
        +     * The amount of time to delay sending the response.
        +     * 
        + * + * .google.protobuf.Duration delay = 2; + */ + com.google.protobuf.DurationOrBuilder getDelayOrBuilder(); + + /** + * + * + *
        +     * The index that the status should be sent
        +     * 
        + * + * int32 response_index = 3; + * + * @return The responseIndex. + */ + int getResponseIndex(); + } + + /** + * + * + *
        +   * A server response to an RPC Attempt in a sequence.
        +   * 
        + * + * Protobuf type {@code google.showcase.v1beta1.StreamingSequence.Response} + */ + public static final class Response extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.StreamingSequence.Response) + ResponseOrBuilder { + private static final long serialVersionUID = 0L; + + // Use Response.newBuilder() to construct. + private Response(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Response() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Response(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.SequenceOuterClass + .internal_static_google_showcase_v1beta1_StreamingSequence_Response_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.SequenceOuterClass + .internal_static_google_showcase_v1beta1_StreamingSequence_Response_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.StreamingSequence.Response.class, + com.google.showcase.v1beta1.StreamingSequence.Response.Builder.class); + } + + private int bitField0_; + public static final int STATUS_FIELD_NUMBER = 1; + private com.google.rpc.Status status_; + + /** + * + * + *
        +     * The status to return for an individual attempt.
        +     * 
        + * + * .google.rpc.Status status = 1; + * + * @return Whether the status field is set. + */ + @java.lang.Override + public boolean hasStatus() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
        +     * The status to return for an individual attempt.
        +     * 
        + * + * .google.rpc.Status status = 1; + * + * @return The status. + */ + @java.lang.Override + public com.google.rpc.Status getStatus() { + return status_ == null ? com.google.rpc.Status.getDefaultInstance() : status_; + } + + /** + * + * + *
        +     * The status to return for an individual attempt.
        +     * 
        + * + * .google.rpc.Status status = 1; + */ + @java.lang.Override + public com.google.rpc.StatusOrBuilder getStatusOrBuilder() { + return status_ == null ? com.google.rpc.Status.getDefaultInstance() : status_; + } + + public static final int DELAY_FIELD_NUMBER = 2; + private com.google.protobuf.Duration delay_; + + /** + * + * + *
        +     * The amount of time to delay sending the response.
        +     * 
        + * + * .google.protobuf.Duration delay = 2; + * + * @return Whether the delay field is set. + */ + @java.lang.Override + public boolean hasDelay() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
        +     * The amount of time to delay sending the response.
        +     * 
        + * + * .google.protobuf.Duration delay = 2; + * + * @return The delay. + */ + @java.lang.Override + public com.google.protobuf.Duration getDelay() { + return delay_ == null ? com.google.protobuf.Duration.getDefaultInstance() : delay_; + } + + /** + * + * + *
        +     * The amount of time to delay sending the response.
        +     * 
        + * + * .google.protobuf.Duration delay = 2; + */ + @java.lang.Override + public com.google.protobuf.DurationOrBuilder getDelayOrBuilder() { + return delay_ == null ? com.google.protobuf.Duration.getDefaultInstance() : delay_; + } + + public static final int RESPONSE_INDEX_FIELD_NUMBER = 3; + private int responseIndex_ = 0; + + /** + * + * + *
        +     * The index that the status should be sent
        +     * 
        + * + * int32 response_index = 3; + * + * @return The responseIndex. + */ + @java.lang.Override + public int getResponseIndex() { + return responseIndex_; + } + + 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, getStatus()); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeMessage(2, getDelay()); + } + if (responseIndex_ != 0) { + output.writeInt32(3, responseIndex_); + } + 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, getStatus()); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getDelay()); + } + if (responseIndex_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(3, responseIndex_); + } + 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.showcase.v1beta1.StreamingSequence.Response)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.StreamingSequence.Response other = + (com.google.showcase.v1beta1.StreamingSequence.Response) obj; + + if (hasStatus() != other.hasStatus()) return false; + if (hasStatus()) { + if (!getStatus().equals(other.getStatus())) return false; + } + if (hasDelay() != other.hasDelay()) return false; + if (hasDelay()) { + if (!getDelay().equals(other.getDelay())) return false; + } + if (getResponseIndex() != other.getResponseIndex()) 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 (hasStatus()) { + hash = (37 * hash) + STATUS_FIELD_NUMBER; + hash = (53 * hash) + getStatus().hashCode(); + } + if (hasDelay()) { + hash = (37 * hash) + DELAY_FIELD_NUMBER; + hash = (53 * hash) + getDelay().hashCode(); + } + hash = (37 * hash) + RESPONSE_INDEX_FIELD_NUMBER; + hash = (53 * hash) + getResponseIndex(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.showcase.v1beta1.StreamingSequence.Response parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.StreamingSequence.Response parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.StreamingSequence.Response parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.StreamingSequence.Response 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.showcase.v1beta1.StreamingSequence.Response parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.StreamingSequence.Response parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.StreamingSequence.Response parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.StreamingSequence.Response 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.showcase.v1beta1.StreamingSequence.Response parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.StreamingSequence.Response 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.showcase.v1beta1.StreamingSequence.Response parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.StreamingSequence.Response 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.showcase.v1beta1.StreamingSequence.Response prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
        +     * A server response to an RPC Attempt in a sequence.
        +     * 
        + * + * Protobuf type {@code google.showcase.v1beta1.StreamingSequence.Response} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.StreamingSequence.Response) + com.google.showcase.v1beta1.StreamingSequence.ResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.SequenceOuterClass + .internal_static_google_showcase_v1beta1_StreamingSequence_Response_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.SequenceOuterClass + .internal_static_google_showcase_v1beta1_StreamingSequence_Response_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.StreamingSequence.Response.class, + com.google.showcase.v1beta1.StreamingSequence.Response.Builder.class); + } + + // Construct using com.google.showcase.v1beta1.StreamingSequence.Response.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getStatusFieldBuilder(); + getDelayFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + status_ = null; + if (statusBuilder_ != null) { + statusBuilder_.dispose(); + statusBuilder_ = null; + } + delay_ = null; + if (delayBuilder_ != null) { + delayBuilder_.dispose(); + delayBuilder_ = null; + } + responseIndex_ = 0; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.showcase.v1beta1.SequenceOuterClass + .internal_static_google_showcase_v1beta1_StreamingSequence_Response_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.StreamingSequence.Response getDefaultInstanceForType() { + return com.google.showcase.v1beta1.StreamingSequence.Response.getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.StreamingSequence.Response build() { + com.google.showcase.v1beta1.StreamingSequence.Response result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.StreamingSequence.Response buildPartial() { + com.google.showcase.v1beta1.StreamingSequence.Response result = + new com.google.showcase.v1beta1.StreamingSequence.Response(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.showcase.v1beta1.StreamingSequence.Response result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.status_ = statusBuilder_ == null ? status_ : statusBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.delay_ = delayBuilder_ == null ? delay_ : delayBuilder_.build(); + to_bitField0_ |= 0x00000002; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.responseIndex_ = responseIndex_; + } + 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.showcase.v1beta1.StreamingSequence.Response) { + return mergeFrom((com.google.showcase.v1beta1.StreamingSequence.Response) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.showcase.v1beta1.StreamingSequence.Response other) { + if (other == com.google.showcase.v1beta1.StreamingSequence.Response.getDefaultInstance()) + return this; + if (other.hasStatus()) { + mergeStatus(other.getStatus()); + } + if (other.hasDelay()) { + mergeDelay(other.getDelay()); + } + if (other.getResponseIndex() != 0) { + setResponseIndex(other.getResponseIndex()); + } + 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(getStatusFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + input.readMessage(getDelayFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 24: + { + responseIndex_ = 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 com.google.rpc.Status status_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.rpc.Status, com.google.rpc.Status.Builder, com.google.rpc.StatusOrBuilder> + statusBuilder_; + + /** + * + * + *
        +       * The status to return for an individual attempt.
        +       * 
        + * + * .google.rpc.Status status = 1; + * + * @return Whether the status field is set. + */ + public boolean hasStatus() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
        +       * The status to return for an individual attempt.
        +       * 
        + * + * .google.rpc.Status status = 1; + * + * @return The status. + */ + public com.google.rpc.Status getStatus() { + if (statusBuilder_ == null) { + return status_ == null ? com.google.rpc.Status.getDefaultInstance() : status_; + } else { + return statusBuilder_.getMessage(); + } + } + + /** + * + * + *
        +       * The status to return for an individual attempt.
        +       * 
        + * + * .google.rpc.Status status = 1; + */ + public Builder setStatus(com.google.rpc.Status value) { + if (statusBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + status_ = value; + } else { + statusBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
        +       * The status to return for an individual attempt.
        +       * 
        + * + * .google.rpc.Status status = 1; + */ + public Builder setStatus(com.google.rpc.Status.Builder builderForValue) { + if (statusBuilder_ == null) { + status_ = builderForValue.build(); + } else { + statusBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
        +       * The status to return for an individual attempt.
        +       * 
        + * + * .google.rpc.Status status = 1; + */ + public Builder mergeStatus(com.google.rpc.Status value) { + if (statusBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) + && status_ != null + && status_ != com.google.rpc.Status.getDefaultInstance()) { + getStatusBuilder().mergeFrom(value); + } else { + status_ = value; + } + } else { + statusBuilder_.mergeFrom(value); + } + if (status_ != null) { + bitField0_ |= 0x00000001; + onChanged(); + } + return this; + } + + /** + * + * + *
        +       * The status to return for an individual attempt.
        +       * 
        + * + * .google.rpc.Status status = 1; + */ + public Builder clearStatus() { + bitField0_ = (bitField0_ & ~0x00000001); + status_ = null; + if (statusBuilder_ != null) { + statusBuilder_.dispose(); + statusBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
        +       * The status to return for an individual attempt.
        +       * 
        + * + * .google.rpc.Status status = 1; + */ + public com.google.rpc.Status.Builder getStatusBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return getStatusFieldBuilder().getBuilder(); + } + + /** + * + * + *
        +       * The status to return for an individual attempt.
        +       * 
        + * + * .google.rpc.Status status = 1; + */ + public com.google.rpc.StatusOrBuilder getStatusOrBuilder() { + if (statusBuilder_ != null) { + return statusBuilder_.getMessageOrBuilder(); + } else { + return status_ == null ? com.google.rpc.Status.getDefaultInstance() : status_; + } + } + + /** + * + * + *
        +       * The status to return for an individual attempt.
        +       * 
        + * + * .google.rpc.Status status = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.rpc.Status, com.google.rpc.Status.Builder, com.google.rpc.StatusOrBuilder> + getStatusFieldBuilder() { + if (statusBuilder_ == null) { + statusBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.rpc.Status, + com.google.rpc.Status.Builder, + com.google.rpc.StatusOrBuilder>(getStatus(), getParentForChildren(), isClean()); + status_ = null; + } + return statusBuilder_; + } + + private com.google.protobuf.Duration delay_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder> + delayBuilder_; + + /** + * + * + *
        +       * The amount of time to delay sending the response.
        +       * 
        + * + * .google.protobuf.Duration delay = 2; + * + * @return Whether the delay field is set. + */ + public boolean hasDelay() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
        +       * The amount of time to delay sending the response.
        +       * 
        + * + * .google.protobuf.Duration delay = 2; + * + * @return The delay. + */ + public com.google.protobuf.Duration getDelay() { + if (delayBuilder_ == null) { + return delay_ == null ? com.google.protobuf.Duration.getDefaultInstance() : delay_; + } else { + return delayBuilder_.getMessage(); + } + } + + /** + * + * + *
        +       * The amount of time to delay sending the response.
        +       * 
        + * + * .google.protobuf.Duration delay = 2; + */ + public Builder setDelay(com.google.protobuf.Duration value) { + if (delayBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + delay_ = value; + } else { + delayBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
        +       * The amount of time to delay sending the response.
        +       * 
        + * + * .google.protobuf.Duration delay = 2; + */ + public Builder setDelay(com.google.protobuf.Duration.Builder builderForValue) { + if (delayBuilder_ == null) { + delay_ = builderForValue.build(); + } else { + delayBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
        +       * The amount of time to delay sending the response.
        +       * 
        + * + * .google.protobuf.Duration delay = 2; + */ + public Builder mergeDelay(com.google.protobuf.Duration value) { + if (delayBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && delay_ != null + && delay_ != com.google.protobuf.Duration.getDefaultInstance()) { + getDelayBuilder().mergeFrom(value); + } else { + delay_ = value; + } + } else { + delayBuilder_.mergeFrom(value); + } + if (delay_ != null) { + bitField0_ |= 0x00000002; + onChanged(); + } + return this; + } + + /** + * + * + *
        +       * The amount of time to delay sending the response.
        +       * 
        + * + * .google.protobuf.Duration delay = 2; + */ + public Builder clearDelay() { + bitField0_ = (bitField0_ & ~0x00000002); + delay_ = null; + if (delayBuilder_ != null) { + delayBuilder_.dispose(); + delayBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
        +       * The amount of time to delay sending the response.
        +       * 
        + * + * .google.protobuf.Duration delay = 2; + */ + public com.google.protobuf.Duration.Builder getDelayBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return getDelayFieldBuilder().getBuilder(); + } + + /** + * + * + *
        +       * The amount of time to delay sending the response.
        +       * 
        + * + * .google.protobuf.Duration delay = 2; + */ + public com.google.protobuf.DurationOrBuilder getDelayOrBuilder() { + if (delayBuilder_ != null) { + return delayBuilder_.getMessageOrBuilder(); + } else { + return delay_ == null ? com.google.protobuf.Duration.getDefaultInstance() : delay_; + } + } + + /** + * + * + *
        +       * The amount of time to delay sending the response.
        +       * 
        + * + * .google.protobuf.Duration delay = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder> + getDelayFieldBuilder() { + if (delayBuilder_ == null) { + delayBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder>( + getDelay(), getParentForChildren(), isClean()); + delay_ = null; + } + return delayBuilder_; + } + + private int responseIndex_; + + /** + * + * + *
        +       * The index that the status should be sent
        +       * 
        + * + * int32 response_index = 3; + * + * @return The responseIndex. + */ + @java.lang.Override + public int getResponseIndex() { + return responseIndex_; + } + + /** + * + * + *
        +       * The index that the status should be sent
        +       * 
        + * + * int32 response_index = 3; + * + * @param value The responseIndex to set. + * @return This builder for chaining. + */ + public Builder setResponseIndex(int value) { + + responseIndex_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
        +       * The index that the status should be sent
        +       * 
        + * + * int32 response_index = 3; + * + * @return This builder for chaining. + */ + public Builder clearResponseIndex() { + bitField0_ = (bitField0_ & ~0x00000004); + responseIndex_ = 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.showcase.v1beta1.StreamingSequence.Response) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.StreamingSequence.Response) + private static final com.google.showcase.v1beta1.StreamingSequence.Response DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.StreamingSequence.Response(); + } + + public static com.google.showcase.v1beta1.StreamingSequence.Response getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Response 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.showcase.v1beta1.StreamingSequence.Response getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + + /** + * 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; + } + } + + /** + * 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 CONTENT_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object content_ = ""; + + /** + * + * + *
        +   * The Content that the stream will send
        +   * 
        + * + * string content = 2; + * + * @return The content. + */ + @java.lang.Override + public java.lang.String getContent() { + java.lang.Object ref = content_; + 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(); + content_ = s; + return s; + } + } + + /** + * + * + *
        +   * The Content that the stream will send
        +   * 
        + * + * string content = 2; + * + * @return The bytes for content. + */ + @java.lang.Override + public com.google.protobuf.ByteString getContentBytes() { + java.lang.Object ref = content_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + content_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int RESPONSES_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private java.util.List responses_; + + /** + * + * + *
        +   * Sequence of responses to return in order for each attempt. If empty, the
        +   * default response is an immediate OK.
        +   * 
        + * + * repeated .google.showcase.v1beta1.StreamingSequence.Response responses = 3; + */ + @java.lang.Override + public java.util.List getResponsesList() { + return responses_; + } + + /** + * + * + *
        +   * Sequence of responses to return in order for each attempt. If empty, the
        +   * default response is an immediate OK.
        +   * 
        + * + * repeated .google.showcase.v1beta1.StreamingSequence.Response responses = 3; + */ + @java.lang.Override + public java.util.List + getResponsesOrBuilderList() { + return responses_; + } + + /** + * + * + *
        +   * Sequence of responses to return in order for each attempt. If empty, the
        +   * default response is an immediate OK.
        +   * 
        + * + * repeated .google.showcase.v1beta1.StreamingSequence.Response responses = 3; + */ + @java.lang.Override + public int getResponsesCount() { + return responses_.size(); + } + + /** + * + * + *
        +   * Sequence of responses to return in order for each attempt. If empty, the
        +   * default response is an immediate OK.
        +   * 
        + * + * repeated .google.showcase.v1beta1.StreamingSequence.Response responses = 3; + */ + @java.lang.Override + public com.google.showcase.v1beta1.StreamingSequence.Response getResponses(int index) { + return responses_.get(index); + } + + /** + * + * + *
        +   * Sequence of responses to return in order for each attempt. If empty, the
        +   * default response is an immediate OK.
        +   * 
        + * + * repeated .google.showcase.v1beta1.StreamingSequence.Response responses = 3; + */ + @java.lang.Override + public com.google.showcase.v1beta1.StreamingSequence.ResponseOrBuilder getResponsesOrBuilder( + int index) { + return responses_.get(index); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(content_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, content_); + } + for (int i = 0; i < responses_.size(); i++) { + output.writeMessage(3, responses_.get(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(name_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(content_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, content_); + } + for (int i = 0; i < responses_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, responses_.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.showcase.v1beta1.StreamingSequence)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.StreamingSequence other = + (com.google.showcase.v1beta1.StreamingSequence) obj; + + if (!getName().equals(other.getName())) return false; + if (!getContent().equals(other.getContent())) return false; + if (!getResponsesList().equals(other.getResponsesList())) 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) + CONTENT_FIELD_NUMBER; + hash = (53 * hash) + getContent().hashCode(); + if (getResponsesCount() > 0) { + hash = (37 * hash) + RESPONSES_FIELD_NUMBER; + hash = (53 * hash) + getResponsesList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.showcase.v1beta1.StreamingSequence parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.StreamingSequence parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.StreamingSequence parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.StreamingSequence 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.showcase.v1beta1.StreamingSequence parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.StreamingSequence parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.StreamingSequence parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.StreamingSequence 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.showcase.v1beta1.StreamingSequence parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.StreamingSequence 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.showcase.v1beta1.StreamingSequence parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.StreamingSequence 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.showcase.v1beta1.StreamingSequence prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** Protobuf type {@code google.showcase.v1beta1.StreamingSequence} */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.StreamingSequence) + com.google.showcase.v1beta1.StreamingSequenceOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.SequenceOuterClass + .internal_static_google_showcase_v1beta1_StreamingSequence_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.SequenceOuterClass + .internal_static_google_showcase_v1beta1_StreamingSequence_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.StreamingSequence.class, + com.google.showcase.v1beta1.StreamingSequence.Builder.class); + } + + // Construct using com.google.showcase.v1beta1.StreamingSequence.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + content_ = ""; + if (responsesBuilder_ == null) { + responses_ = java.util.Collections.emptyList(); + } else { + responses_ = null; + responsesBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000004); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.showcase.v1beta1.SequenceOuterClass + .internal_static_google_showcase_v1beta1_StreamingSequence_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.StreamingSequence getDefaultInstanceForType() { + return com.google.showcase.v1beta1.StreamingSequence.getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.StreamingSequence build() { + com.google.showcase.v1beta1.StreamingSequence result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.StreamingSequence buildPartial() { + com.google.showcase.v1beta1.StreamingSequence result = + new com.google.showcase.v1beta1.StreamingSequence(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields(com.google.showcase.v1beta1.StreamingSequence result) { + if (responsesBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0)) { + responses_ = java.util.Collections.unmodifiableList(responses_); + bitField0_ = (bitField0_ & ~0x00000004); + } + result.responses_ = responses_; + } else { + result.responses_ = responsesBuilder_.build(); + } + } + + private void buildPartial0(com.google.showcase.v1beta1.StreamingSequence result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.content_ = content_; + } + } + + @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.showcase.v1beta1.StreamingSequence) { + return mergeFrom((com.google.showcase.v1beta1.StreamingSequence) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.showcase.v1beta1.StreamingSequence other) { + if (other == com.google.showcase.v1beta1.StreamingSequence.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getContent().isEmpty()) { + content_ = other.content_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (responsesBuilder_ == null) { + if (!other.responses_.isEmpty()) { + if (responses_.isEmpty()) { + responses_ = other.responses_; + bitField0_ = (bitField0_ & ~0x00000004); + } else { + ensureResponsesIsMutable(); + responses_.addAll(other.responses_); + } + onChanged(); + } + } else { + if (!other.responses_.isEmpty()) { + if (responsesBuilder_.isEmpty()) { + responsesBuilder_.dispose(); + responsesBuilder_ = null; + responses_ = other.responses_; + bitField0_ = (bitField0_ & ~0x00000004); + responsesBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getResponsesFieldBuilder() + : null; + } else { + responsesBuilder_.addAllMessages(other.responses_); + } + } + } + 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: + { + content_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + com.google.showcase.v1beta1.StreamingSequence.Response m = + input.readMessage( + com.google.showcase.v1beta1.StreamingSequence.Response.parser(), + extensionRegistry); + if (responsesBuilder_ == null) { + ensureResponsesIsMutable(); + responses_.add(m); + } else { + responsesBuilder_.addMessage(m); + } + 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_ = ""; + + /** + * 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; + } + } + + /** + * 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; + } + } + + /** + * 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; + } + + /** + * 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; + } + + /** + * 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 content_ = ""; + + /** + * + * + *
        +     * The Content that the stream will send
        +     * 
        + * + * string content = 2; + * + * @return The content. + */ + public java.lang.String getContent() { + java.lang.Object ref = content_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + content_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
        +     * The Content that the stream will send
        +     * 
        + * + * string content = 2; + * + * @return The bytes for content. + */ + public com.google.protobuf.ByteString getContentBytes() { + java.lang.Object ref = content_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + content_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
        +     * The Content that the stream will send
        +     * 
        + * + * string content = 2; + * + * @param value The content to set. + * @return This builder for chaining. + */ + public Builder setContent(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + content_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
        +     * The Content that the stream will send
        +     * 
        + * + * string content = 2; + * + * @return This builder for chaining. + */ + public Builder clearContent() { + content_ = getDefaultInstance().getContent(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
        +     * The Content that the stream will send
        +     * 
        + * + * string content = 2; + * + * @param value The bytes for content to set. + * @return This builder for chaining. + */ + public Builder setContentBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + content_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private java.util.List responses_ = + java.util.Collections.emptyList(); + + private void ensureResponsesIsMutable() { + if (!((bitField0_ & 0x00000004) != 0)) { + responses_ = + new java.util.ArrayList( + responses_); + bitField0_ |= 0x00000004; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.showcase.v1beta1.StreamingSequence.Response, + com.google.showcase.v1beta1.StreamingSequence.Response.Builder, + com.google.showcase.v1beta1.StreamingSequence.ResponseOrBuilder> + responsesBuilder_; + + /** + * + * + *
        +     * Sequence of responses to return in order for each attempt. If empty, the
        +     * default response is an immediate OK.
        +     * 
        + * + * repeated .google.showcase.v1beta1.StreamingSequence.Response responses = 3; + */ + public java.util.List + getResponsesList() { + if (responsesBuilder_ == null) { + return java.util.Collections.unmodifiableList(responses_); + } else { + return responsesBuilder_.getMessageList(); + } + } + + /** + * + * + *
        +     * Sequence of responses to return in order for each attempt. If empty, the
        +     * default response is an immediate OK.
        +     * 
        + * + * repeated .google.showcase.v1beta1.StreamingSequence.Response responses = 3; + */ + public int getResponsesCount() { + if (responsesBuilder_ == null) { + return responses_.size(); + } else { + return responsesBuilder_.getCount(); + } + } + + /** + * + * + *
        +     * Sequence of responses to return in order for each attempt. If empty, the
        +     * default response is an immediate OK.
        +     * 
        + * + * repeated .google.showcase.v1beta1.StreamingSequence.Response responses = 3; + */ + public com.google.showcase.v1beta1.StreamingSequence.Response getResponses(int index) { + if (responsesBuilder_ == null) { + return responses_.get(index); + } else { + return responsesBuilder_.getMessage(index); + } + } + + /** + * + * + *
        +     * Sequence of responses to return in order for each attempt. If empty, the
        +     * default response is an immediate OK.
        +     * 
        + * + * repeated .google.showcase.v1beta1.StreamingSequence.Response responses = 3; + */ + public Builder setResponses( + int index, com.google.showcase.v1beta1.StreamingSequence.Response value) { + if (responsesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureResponsesIsMutable(); + responses_.set(index, value); + onChanged(); + } else { + responsesBuilder_.setMessage(index, value); + } + return this; + } + + /** + * + * + *
        +     * Sequence of responses to return in order for each attempt. If empty, the
        +     * default response is an immediate OK.
        +     * 
        + * + * repeated .google.showcase.v1beta1.StreamingSequence.Response responses = 3; + */ + public Builder setResponses( + int index, com.google.showcase.v1beta1.StreamingSequence.Response.Builder builderForValue) { + if (responsesBuilder_ == null) { + ensureResponsesIsMutable(); + responses_.set(index, builderForValue.build()); + onChanged(); + } else { + responsesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
        +     * Sequence of responses to return in order for each attempt. If empty, the
        +     * default response is an immediate OK.
        +     * 
        + * + * repeated .google.showcase.v1beta1.StreamingSequence.Response responses = 3; + */ + public Builder addResponses(com.google.showcase.v1beta1.StreamingSequence.Response value) { + if (responsesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureResponsesIsMutable(); + responses_.add(value); + onChanged(); + } else { + responsesBuilder_.addMessage(value); + } + return this; + } + + /** + * + * + *
        +     * Sequence of responses to return in order for each attempt. If empty, the
        +     * default response is an immediate OK.
        +     * 
        + * + * repeated .google.showcase.v1beta1.StreamingSequence.Response responses = 3; + */ + public Builder addResponses( + int index, com.google.showcase.v1beta1.StreamingSequence.Response value) { + if (responsesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureResponsesIsMutable(); + responses_.add(index, value); + onChanged(); + } else { + responsesBuilder_.addMessage(index, value); + } + return this; + } + + /** + * + * + *
        +     * Sequence of responses to return in order for each attempt. If empty, the
        +     * default response is an immediate OK.
        +     * 
        + * + * repeated .google.showcase.v1beta1.StreamingSequence.Response responses = 3; + */ + public Builder addResponses( + com.google.showcase.v1beta1.StreamingSequence.Response.Builder builderForValue) { + if (responsesBuilder_ == null) { + ensureResponsesIsMutable(); + responses_.add(builderForValue.build()); + onChanged(); + } else { + responsesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + + /** + * + * + *
        +     * Sequence of responses to return in order for each attempt. If empty, the
        +     * default response is an immediate OK.
        +     * 
        + * + * repeated .google.showcase.v1beta1.StreamingSequence.Response responses = 3; + */ + public Builder addResponses( + int index, com.google.showcase.v1beta1.StreamingSequence.Response.Builder builderForValue) { + if (responsesBuilder_ == null) { + ensureResponsesIsMutable(); + responses_.add(index, builderForValue.build()); + onChanged(); + } else { + responsesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
        +     * Sequence of responses to return in order for each attempt. If empty, the
        +     * default response is an immediate OK.
        +     * 
        + * + * repeated .google.showcase.v1beta1.StreamingSequence.Response responses = 3; + */ + public Builder addAllResponses( + java.lang.Iterable + values) { + if (responsesBuilder_ == null) { + ensureResponsesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, responses_); + onChanged(); + } else { + responsesBuilder_.addAllMessages(values); + } + return this; + } + + /** + * + * + *
        +     * Sequence of responses to return in order for each attempt. If empty, the
        +     * default response is an immediate OK.
        +     * 
        + * + * repeated .google.showcase.v1beta1.StreamingSequence.Response responses = 3; + */ + public Builder clearResponses() { + if (responsesBuilder_ == null) { + responses_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + } else { + responsesBuilder_.clear(); + } + return this; + } + + /** + * + * + *
        +     * Sequence of responses to return in order for each attempt. If empty, the
        +     * default response is an immediate OK.
        +     * 
        + * + * repeated .google.showcase.v1beta1.StreamingSequence.Response responses = 3; + */ + public Builder removeResponses(int index) { + if (responsesBuilder_ == null) { + ensureResponsesIsMutable(); + responses_.remove(index); + onChanged(); + } else { + responsesBuilder_.remove(index); + } + return this; + } + + /** + * + * + *
        +     * Sequence of responses to return in order for each attempt. If empty, the
        +     * default response is an immediate OK.
        +     * 
        + * + * repeated .google.showcase.v1beta1.StreamingSequence.Response responses = 3; + */ + public com.google.showcase.v1beta1.StreamingSequence.Response.Builder getResponsesBuilder( + int index) { + return getResponsesFieldBuilder().getBuilder(index); + } + + /** + * + * + *
        +     * Sequence of responses to return in order for each attempt. If empty, the
        +     * default response is an immediate OK.
        +     * 
        + * + * repeated .google.showcase.v1beta1.StreamingSequence.Response responses = 3; + */ + public com.google.showcase.v1beta1.StreamingSequence.ResponseOrBuilder getResponsesOrBuilder( + int index) { + if (responsesBuilder_ == null) { + return responses_.get(index); + } else { + return responsesBuilder_.getMessageOrBuilder(index); + } + } + + /** + * + * + *
        +     * Sequence of responses to return in order for each attempt. If empty, the
        +     * default response is an immediate OK.
        +     * 
        + * + * repeated .google.showcase.v1beta1.StreamingSequence.Response responses = 3; + */ + public java.util.List + getResponsesOrBuilderList() { + if (responsesBuilder_ != null) { + return responsesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(responses_); + } + } + + /** + * + * + *
        +     * Sequence of responses to return in order for each attempt. If empty, the
        +     * default response is an immediate OK.
        +     * 
        + * + * repeated .google.showcase.v1beta1.StreamingSequence.Response responses = 3; + */ + public com.google.showcase.v1beta1.StreamingSequence.Response.Builder addResponsesBuilder() { + return getResponsesFieldBuilder() + .addBuilder(com.google.showcase.v1beta1.StreamingSequence.Response.getDefaultInstance()); + } + + /** + * + * + *
        +     * Sequence of responses to return in order for each attempt. If empty, the
        +     * default response is an immediate OK.
        +     * 
        + * + * repeated .google.showcase.v1beta1.StreamingSequence.Response responses = 3; + */ + public com.google.showcase.v1beta1.StreamingSequence.Response.Builder addResponsesBuilder( + int index) { + return getResponsesFieldBuilder() + .addBuilder( + index, com.google.showcase.v1beta1.StreamingSequence.Response.getDefaultInstance()); + } + + /** + * + * + *
        +     * Sequence of responses to return in order for each attempt. If empty, the
        +     * default response is an immediate OK.
        +     * 
        + * + * repeated .google.showcase.v1beta1.StreamingSequence.Response responses = 3; + */ + public java.util.List + getResponsesBuilderList() { + return getResponsesFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.showcase.v1beta1.StreamingSequence.Response, + com.google.showcase.v1beta1.StreamingSequence.Response.Builder, + com.google.showcase.v1beta1.StreamingSequence.ResponseOrBuilder> + getResponsesFieldBuilder() { + if (responsesBuilder_ == null) { + responsesBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.showcase.v1beta1.StreamingSequence.Response, + com.google.showcase.v1beta1.StreamingSequence.Response.Builder, + com.google.showcase.v1beta1.StreamingSequence.ResponseOrBuilder>( + responses_, ((bitField0_ & 0x00000004) != 0), getParentForChildren(), isClean()); + responses_ = null; + } + return responsesBuilder_; + } + + @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.showcase.v1beta1.StreamingSequence) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.StreamingSequence) + private static final com.google.showcase.v1beta1.StreamingSequence DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.StreamingSequence(); + } + + public static com.google.showcase.v1beta1.StreamingSequence getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public StreamingSequence 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.showcase.v1beta1.StreamingSequence getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/StreamingSequenceName.java b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/StreamingSequenceName.java new file mode 100644 index 0000000000..ee58f2349c --- /dev/null +++ b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/StreamingSequenceName.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.showcase.v1beta1; + +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +@Generated("by gapic-generator-java") +public class StreamingSequenceName implements ResourceName { + private static final PathTemplate STREAMING_SEQUENCE = + PathTemplate.createWithoutUrlEncoding("streamingSequences/{streaming_sequence}"); + private volatile Map fieldValuesMap; + private final String streamingSequence; + + @Deprecated + protected StreamingSequenceName() { + streamingSequence = null; + } + + private StreamingSequenceName(Builder builder) { + streamingSequence = Preconditions.checkNotNull(builder.getStreamingSequence()); + } + + public String getStreamingSequence() { + return streamingSequence; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + public static StreamingSequenceName of(String streamingSequence) { + return newBuilder().setStreamingSequence(streamingSequence).build(); + } + + public static String format(String streamingSequence) { + return newBuilder().setStreamingSequence(streamingSequence).build().toString(); + } + + public static StreamingSequenceName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + STREAMING_SEQUENCE.validatedMatch( + formattedString, "StreamingSequenceName.parse: formattedString not in valid format"); + return of(matchMap.get("streaming_sequence")); + } + + 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 (StreamingSequenceName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return STREAMING_SEQUENCE.matches(formattedString); + } + + @Override + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + if (streamingSequence != null) { + fieldMapBuilder.put("streaming_sequence", streamingSequence); + } + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return STREAMING_SEQUENCE.instantiate("streaming_sequence", streamingSequence); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o != null && getClass() == o.getClass()) { + StreamingSequenceName that = ((StreamingSequenceName) o); + return Objects.equals(this.streamingSequence, that.streamingSequence); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= Objects.hashCode(streamingSequence); + return h; + } + + /** Builder for streamingSequences/{streaming_sequence}. */ + public static class Builder { + private String streamingSequence; + + protected Builder() {} + + public String getStreamingSequence() { + return streamingSequence; + } + + public Builder setStreamingSequence(String streamingSequence) { + this.streamingSequence = streamingSequence; + return this; + } + + private Builder(StreamingSequenceName streamingSequenceName) { + this.streamingSequence = streamingSequenceName.streamingSequence; + } + + public StreamingSequenceName build() { + return new StreamingSequenceName(this); + } + } +} diff --git a/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/StreamingSequenceOrBuilder.java b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/StreamingSequenceOrBuilder.java new file mode 100644 index 0000000000..17fa8c3a57 --- /dev/null +++ b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/StreamingSequenceOrBuilder.java @@ -0,0 +1,127 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/sequence.proto + +// Protobuf Java Version: 3.25.8 +package com.google.showcase.v1beta1; + +public interface StreamingSequenceOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.StreamingSequence) + com.google.protobuf.MessageOrBuilder { + + /** + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The name. + */ + java.lang.String getName(); + + /** + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
        +   * The Content that the stream will send
        +   * 
        + * + * string content = 2; + * + * @return The content. + */ + java.lang.String getContent(); + + /** + * + * + *
        +   * The Content that the stream will send
        +   * 
        + * + * string content = 2; + * + * @return The bytes for content. + */ + com.google.protobuf.ByteString getContentBytes(); + + /** + * + * + *
        +   * Sequence of responses to return in order for each attempt. If empty, the
        +   * default response is an immediate OK.
        +   * 
        + * + * repeated .google.showcase.v1beta1.StreamingSequence.Response responses = 3; + */ + java.util.List getResponsesList(); + + /** + * + * + *
        +   * Sequence of responses to return in order for each attempt. If empty, the
        +   * default response is an immediate OK.
        +   * 
        + * + * repeated .google.showcase.v1beta1.StreamingSequence.Response responses = 3; + */ + com.google.showcase.v1beta1.StreamingSequence.Response getResponses(int index); + + /** + * + * + *
        +   * Sequence of responses to return in order for each attempt. If empty, the
        +   * default response is an immediate OK.
        +   * 
        + * + * repeated .google.showcase.v1beta1.StreamingSequence.Response responses = 3; + */ + int getResponsesCount(); + + /** + * + * + *
        +   * Sequence of responses to return in order for each attempt. If empty, the
        +   * default response is an immediate OK.
        +   * 
        + * + * repeated .google.showcase.v1beta1.StreamingSequence.Response responses = 3; + */ + java.util.List + getResponsesOrBuilderList(); + + /** + * + * + *
        +   * Sequence of responses to return in order for each attempt. If empty, the
        +   * default response is an immediate OK.
        +   * 
        + * + * repeated .google.showcase.v1beta1.StreamingSequence.Response responses = 3; + */ + com.google.showcase.v1beta1.StreamingSequence.ResponseOrBuilder getResponsesOrBuilder(int index); +} diff --git a/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/StreamingSequenceReport.java b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/StreamingSequenceReport.java new file mode 100644 index 0000000000..ca3ca8ff34 --- /dev/null +++ b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/StreamingSequenceReport.java @@ -0,0 +1,2963 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/sequence.proto + +// Protobuf Java Version: 3.25.8 +package com.google.showcase.v1beta1; + +/** Protobuf type {@code google.showcase.v1beta1.StreamingSequenceReport} */ +public final class StreamingSequenceReport extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.StreamingSequenceReport) + StreamingSequenceReportOrBuilder { + private static final long serialVersionUID = 0L; + + // Use StreamingSequenceReport.newBuilder() to construct. + private StreamingSequenceReport(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private StreamingSequenceReport() { + name_ = ""; + attempts_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new StreamingSequenceReport(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.SequenceOuterClass + .internal_static_google_showcase_v1beta1_StreamingSequenceReport_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.SequenceOuterClass + .internal_static_google_showcase_v1beta1_StreamingSequenceReport_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.StreamingSequenceReport.class, + com.google.showcase.v1beta1.StreamingSequenceReport.Builder.class); + } + + public interface AttemptOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.StreamingSequenceReport.Attempt) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
        +     * The attempt number - starting at 0.
        +     * 
        + * + * int32 attempt_number = 1; + * + * @return The attemptNumber. + */ + int getAttemptNumber(); + + /** + * + * + *
        +     * The deadline dictated by the attempt to the server.
        +     * 
        + * + * .google.protobuf.Timestamp attempt_deadline = 2; + * + * @return Whether the attemptDeadline field is set. + */ + boolean hasAttemptDeadline(); + + /** + * + * + *
        +     * The deadline dictated by the attempt to the server.
        +     * 
        + * + * .google.protobuf.Timestamp attempt_deadline = 2; + * + * @return The attemptDeadline. + */ + com.google.protobuf.Timestamp getAttemptDeadline(); + + /** + * + * + *
        +     * The deadline dictated by the attempt to the server.
        +     * 
        + * + * .google.protobuf.Timestamp attempt_deadline = 2; + */ + com.google.protobuf.TimestampOrBuilder getAttemptDeadlineOrBuilder(); + + /** + * + * + *
        +     * The time that the server responded to the RPC attempt. Used for
        +     * calculating attempt_delay.
        +     * 
        + * + * .google.protobuf.Timestamp response_time = 3; + * + * @return Whether the responseTime field is set. + */ + boolean hasResponseTime(); + + /** + * + * + *
        +     * The time that the server responded to the RPC attempt. Used for
        +     * calculating attempt_delay.
        +     * 
        + * + * .google.protobuf.Timestamp response_time = 3; + * + * @return The responseTime. + */ + com.google.protobuf.Timestamp getResponseTime(); + + /** + * + * + *
        +     * The time that the server responded to the RPC attempt. Used for
        +     * calculating attempt_delay.
        +     * 
        + * + * .google.protobuf.Timestamp response_time = 3; + */ + com.google.protobuf.TimestampOrBuilder getResponseTimeOrBuilder(); + + /** + * + * + *
        +     * The server perceived delay between sending the last response and
        +     * receiving this attempt. Used for validating attempt delay backoff.
        +     * 
        + * + * .google.protobuf.Duration attempt_delay = 4; + * + * @return Whether the attemptDelay field is set. + */ + boolean hasAttemptDelay(); + + /** + * + * + *
        +     * The server perceived delay between sending the last response and
        +     * receiving this attempt. Used for validating attempt delay backoff.
        +     * 
        + * + * .google.protobuf.Duration attempt_delay = 4; + * + * @return The attemptDelay. + */ + com.google.protobuf.Duration getAttemptDelay(); + + /** + * + * + *
        +     * The server perceived delay between sending the last response and
        +     * receiving this attempt. Used for validating attempt delay backoff.
        +     * 
        + * + * .google.protobuf.Duration attempt_delay = 4; + */ + com.google.protobuf.DurationOrBuilder getAttemptDelayOrBuilder(); + + /** + * + * + *
        +     * The status returned to the attempt.
        +     * 
        + * + * .google.rpc.Status status = 5; + * + * @return Whether the status field is set. + */ + boolean hasStatus(); + + /** + * + * + *
        +     * The status returned to the attempt.
        +     * 
        + * + * .google.rpc.Status status = 5; + * + * @return The status. + */ + com.google.rpc.Status getStatus(); + + /** + * + * + *
        +     * The status returned to the attempt.
        +     * 
        + * + * .google.rpc.Status status = 5; + */ + com.google.rpc.StatusOrBuilder getStatusOrBuilder(); + } + + /** + * + * + *
        +   * Contains metrics on individual RPC Attempts in a sequence.
        +   * 
        + * + * Protobuf type {@code google.showcase.v1beta1.StreamingSequenceReport.Attempt} + */ + public static final class Attempt extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.StreamingSequenceReport.Attempt) + AttemptOrBuilder { + private static final long serialVersionUID = 0L; + + // Use Attempt.newBuilder() to construct. + private Attempt(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Attempt() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Attempt(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.SequenceOuterClass + .internal_static_google_showcase_v1beta1_StreamingSequenceReport_Attempt_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.SequenceOuterClass + .internal_static_google_showcase_v1beta1_StreamingSequenceReport_Attempt_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.StreamingSequenceReport.Attempt.class, + com.google.showcase.v1beta1.StreamingSequenceReport.Attempt.Builder.class); + } + + private int bitField0_; + public static final int ATTEMPT_NUMBER_FIELD_NUMBER = 1; + private int attemptNumber_ = 0; + + /** + * + * + *
        +     * The attempt number - starting at 0.
        +     * 
        + * + * int32 attempt_number = 1; + * + * @return The attemptNumber. + */ + @java.lang.Override + public int getAttemptNumber() { + return attemptNumber_; + } + + public static final int ATTEMPT_DEADLINE_FIELD_NUMBER = 2; + private com.google.protobuf.Timestamp attemptDeadline_; + + /** + * + * + *
        +     * The deadline dictated by the attempt to the server.
        +     * 
        + * + * .google.protobuf.Timestamp attempt_deadline = 2; + * + * @return Whether the attemptDeadline field is set. + */ + @java.lang.Override + public boolean hasAttemptDeadline() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
        +     * The deadline dictated by the attempt to the server.
        +     * 
        + * + * .google.protobuf.Timestamp attempt_deadline = 2; + * + * @return The attemptDeadline. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getAttemptDeadline() { + return attemptDeadline_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : attemptDeadline_; + } + + /** + * + * + *
        +     * The deadline dictated by the attempt to the server.
        +     * 
        + * + * .google.protobuf.Timestamp attempt_deadline = 2; + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getAttemptDeadlineOrBuilder() { + return attemptDeadline_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : attemptDeadline_; + } + + public static final int RESPONSE_TIME_FIELD_NUMBER = 3; + private com.google.protobuf.Timestamp responseTime_; + + /** + * + * + *
        +     * The time that the server responded to the RPC attempt. Used for
        +     * calculating attempt_delay.
        +     * 
        + * + * .google.protobuf.Timestamp response_time = 3; + * + * @return Whether the responseTime field is set. + */ + @java.lang.Override + public boolean hasResponseTime() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
        +     * The time that the server responded to the RPC attempt. Used for
        +     * calculating attempt_delay.
        +     * 
        + * + * .google.protobuf.Timestamp response_time = 3; + * + * @return The responseTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getResponseTime() { + return responseTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : responseTime_; + } + + /** + * + * + *
        +     * The time that the server responded to the RPC attempt. Used for
        +     * calculating attempt_delay.
        +     * 
        + * + * .google.protobuf.Timestamp response_time = 3; + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getResponseTimeOrBuilder() { + return responseTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : responseTime_; + } + + public static final int ATTEMPT_DELAY_FIELD_NUMBER = 4; + private com.google.protobuf.Duration attemptDelay_; + + /** + * + * + *
        +     * The server perceived delay between sending the last response and
        +     * receiving this attempt. Used for validating attempt delay backoff.
        +     * 
        + * + * .google.protobuf.Duration attempt_delay = 4; + * + * @return Whether the attemptDelay field is set. + */ + @java.lang.Override + public boolean hasAttemptDelay() { + return ((bitField0_ & 0x00000004) != 0); + } + + /** + * + * + *
        +     * The server perceived delay between sending the last response and
        +     * receiving this attempt. Used for validating attempt delay backoff.
        +     * 
        + * + * .google.protobuf.Duration attempt_delay = 4; + * + * @return The attemptDelay. + */ + @java.lang.Override + public com.google.protobuf.Duration getAttemptDelay() { + return attemptDelay_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : attemptDelay_; + } + + /** + * + * + *
        +     * The server perceived delay between sending the last response and
        +     * receiving this attempt. Used for validating attempt delay backoff.
        +     * 
        + * + * .google.protobuf.Duration attempt_delay = 4; + */ + @java.lang.Override + public com.google.protobuf.DurationOrBuilder getAttemptDelayOrBuilder() { + return attemptDelay_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : attemptDelay_; + } + + public static final int STATUS_FIELD_NUMBER = 5; + private com.google.rpc.Status status_; + + /** + * + * + *
        +     * The status returned to the attempt.
        +     * 
        + * + * .google.rpc.Status status = 5; + * + * @return Whether the status field is set. + */ + @java.lang.Override + public boolean hasStatus() { + return ((bitField0_ & 0x00000008) != 0); + } + + /** + * + * + *
        +     * The status returned to the attempt.
        +     * 
        + * + * .google.rpc.Status status = 5; + * + * @return The status. + */ + @java.lang.Override + public com.google.rpc.Status getStatus() { + return status_ == null ? com.google.rpc.Status.getDefaultInstance() : status_; + } + + /** + * + * + *
        +     * The status returned to the attempt.
        +     * 
        + * + * .google.rpc.Status status = 5; + */ + @java.lang.Override + public com.google.rpc.StatusOrBuilder getStatusOrBuilder() { + return status_ == null ? com.google.rpc.Status.getDefaultInstance() : status_; + } + + 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 (attemptNumber_ != 0) { + output.writeInt32(1, attemptNumber_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(2, getAttemptDeadline()); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeMessage(3, getResponseTime()); + } + if (((bitField0_ & 0x00000004) != 0)) { + output.writeMessage(4, getAttemptDelay()); + } + if (((bitField0_ & 0x00000008) != 0)) { + output.writeMessage(5, getStatus()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (attemptNumber_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(1, attemptNumber_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getAttemptDeadline()); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getResponseTime()); + } + if (((bitField0_ & 0x00000004) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, getAttemptDelay()); + } + if (((bitField0_ & 0x00000008) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(5, getStatus()); + } + 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.showcase.v1beta1.StreamingSequenceReport.Attempt)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.StreamingSequenceReport.Attempt other = + (com.google.showcase.v1beta1.StreamingSequenceReport.Attempt) obj; + + if (getAttemptNumber() != other.getAttemptNumber()) return false; + if (hasAttemptDeadline() != other.hasAttemptDeadline()) return false; + if (hasAttemptDeadline()) { + if (!getAttemptDeadline().equals(other.getAttemptDeadline())) return false; + } + if (hasResponseTime() != other.hasResponseTime()) return false; + if (hasResponseTime()) { + if (!getResponseTime().equals(other.getResponseTime())) return false; + } + if (hasAttemptDelay() != other.hasAttemptDelay()) return false; + if (hasAttemptDelay()) { + if (!getAttemptDelay().equals(other.getAttemptDelay())) return false; + } + if (hasStatus() != other.hasStatus()) return false; + if (hasStatus()) { + if (!getStatus().equals(other.getStatus())) 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) + ATTEMPT_NUMBER_FIELD_NUMBER; + hash = (53 * hash) + getAttemptNumber(); + if (hasAttemptDeadline()) { + hash = (37 * hash) + ATTEMPT_DEADLINE_FIELD_NUMBER; + hash = (53 * hash) + getAttemptDeadline().hashCode(); + } + if (hasResponseTime()) { + hash = (37 * hash) + RESPONSE_TIME_FIELD_NUMBER; + hash = (53 * hash) + getResponseTime().hashCode(); + } + if (hasAttemptDelay()) { + hash = (37 * hash) + ATTEMPT_DELAY_FIELD_NUMBER; + hash = (53 * hash) + getAttemptDelay().hashCode(); + } + if (hasStatus()) { + hash = (37 * hash) + STATUS_FIELD_NUMBER; + hash = (53 * hash) + getStatus().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.showcase.v1beta1.StreamingSequenceReport.Attempt parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.StreamingSequenceReport.Attempt parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.StreamingSequenceReport.Attempt parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.StreamingSequenceReport.Attempt 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.showcase.v1beta1.StreamingSequenceReport.Attempt parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.StreamingSequenceReport.Attempt parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.StreamingSequenceReport.Attempt parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.StreamingSequenceReport.Attempt 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.showcase.v1beta1.StreamingSequenceReport.Attempt parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.StreamingSequenceReport.Attempt 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.showcase.v1beta1.StreamingSequenceReport.Attempt parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.StreamingSequenceReport.Attempt 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.showcase.v1beta1.StreamingSequenceReport.Attempt prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
        +     * Contains metrics on individual RPC Attempts in a sequence.
        +     * 
        + * + * Protobuf type {@code google.showcase.v1beta1.StreamingSequenceReport.Attempt} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.StreamingSequenceReport.Attempt) + com.google.showcase.v1beta1.StreamingSequenceReport.AttemptOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.SequenceOuterClass + .internal_static_google_showcase_v1beta1_StreamingSequenceReport_Attempt_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.SequenceOuterClass + .internal_static_google_showcase_v1beta1_StreamingSequenceReport_Attempt_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.StreamingSequenceReport.Attempt.class, + com.google.showcase.v1beta1.StreamingSequenceReport.Attempt.Builder.class); + } + + // Construct using com.google.showcase.v1beta1.StreamingSequenceReport.Attempt.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getAttemptDeadlineFieldBuilder(); + getResponseTimeFieldBuilder(); + getAttemptDelayFieldBuilder(); + getStatusFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + attemptNumber_ = 0; + attemptDeadline_ = null; + if (attemptDeadlineBuilder_ != null) { + attemptDeadlineBuilder_.dispose(); + attemptDeadlineBuilder_ = null; + } + responseTime_ = null; + if (responseTimeBuilder_ != null) { + responseTimeBuilder_.dispose(); + responseTimeBuilder_ = null; + } + attemptDelay_ = null; + if (attemptDelayBuilder_ != null) { + attemptDelayBuilder_.dispose(); + attemptDelayBuilder_ = null; + } + status_ = null; + if (statusBuilder_ != null) { + statusBuilder_.dispose(); + statusBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.showcase.v1beta1.SequenceOuterClass + .internal_static_google_showcase_v1beta1_StreamingSequenceReport_Attempt_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.StreamingSequenceReport.Attempt + getDefaultInstanceForType() { + return com.google.showcase.v1beta1.StreamingSequenceReport.Attempt.getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.StreamingSequenceReport.Attempt build() { + com.google.showcase.v1beta1.StreamingSequenceReport.Attempt result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.StreamingSequenceReport.Attempt buildPartial() { + com.google.showcase.v1beta1.StreamingSequenceReport.Attempt result = + new com.google.showcase.v1beta1.StreamingSequenceReport.Attempt(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.showcase.v1beta1.StreamingSequenceReport.Attempt result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.attemptNumber_ = attemptNumber_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.attemptDeadline_ = + attemptDeadlineBuilder_ == null ? attemptDeadline_ : attemptDeadlineBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.responseTime_ = + responseTimeBuilder_ == null ? responseTime_ : responseTimeBuilder_.build(); + to_bitField0_ |= 0x00000002; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.attemptDelay_ = + attemptDelayBuilder_ == null ? attemptDelay_ : attemptDelayBuilder_.build(); + to_bitField0_ |= 0x00000004; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.status_ = statusBuilder_ == null ? status_ : statusBuilder_.build(); + to_bitField0_ |= 0x00000008; + } + 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.showcase.v1beta1.StreamingSequenceReport.Attempt) { + return mergeFrom((com.google.showcase.v1beta1.StreamingSequenceReport.Attempt) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.showcase.v1beta1.StreamingSequenceReport.Attempt other) { + if (other + == com.google.showcase.v1beta1.StreamingSequenceReport.Attempt.getDefaultInstance()) + return this; + if (other.getAttemptNumber() != 0) { + setAttemptNumber(other.getAttemptNumber()); + } + if (other.hasAttemptDeadline()) { + mergeAttemptDeadline(other.getAttemptDeadline()); + } + if (other.hasResponseTime()) { + mergeResponseTime(other.getResponseTime()); + } + if (other.hasAttemptDelay()) { + mergeAttemptDelay(other.getAttemptDelay()); + } + if (other.hasStatus()) { + mergeStatus(other.getStatus()); + } + 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: + { + attemptNumber_ = input.readInt32(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 18: + { + input.readMessage( + getAttemptDeadlineFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + input.readMessage(getResponseTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 34: + { + input.readMessage(getAttemptDelayFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000008; + break; + } // case 34 + case 42: + { + input.readMessage(getStatusFieldBuilder().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 int attemptNumber_; + + /** + * + * + *
        +       * The attempt number - starting at 0.
        +       * 
        + * + * int32 attempt_number = 1; + * + * @return The attemptNumber. + */ + @java.lang.Override + public int getAttemptNumber() { + return attemptNumber_; + } + + /** + * + * + *
        +       * The attempt number - starting at 0.
        +       * 
        + * + * int32 attempt_number = 1; + * + * @param value The attemptNumber to set. + * @return This builder for chaining. + */ + public Builder setAttemptNumber(int value) { + + attemptNumber_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
        +       * The attempt number - starting at 0.
        +       * 
        + * + * int32 attempt_number = 1; + * + * @return This builder for chaining. + */ + public Builder clearAttemptNumber() { + bitField0_ = (bitField0_ & ~0x00000001); + attemptNumber_ = 0; + onChanged(); + return this; + } + + private com.google.protobuf.Timestamp attemptDeadline_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + attemptDeadlineBuilder_; + + /** + * + * + *
        +       * The deadline dictated by the attempt to the server.
        +       * 
        + * + * .google.protobuf.Timestamp attempt_deadline = 2; + * + * @return Whether the attemptDeadline field is set. + */ + public boolean hasAttemptDeadline() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
        +       * The deadline dictated by the attempt to the server.
        +       * 
        + * + * .google.protobuf.Timestamp attempt_deadline = 2; + * + * @return The attemptDeadline. + */ + public com.google.protobuf.Timestamp getAttemptDeadline() { + if (attemptDeadlineBuilder_ == null) { + return attemptDeadline_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : attemptDeadline_; + } else { + return attemptDeadlineBuilder_.getMessage(); + } + } + + /** + * + * + *
        +       * The deadline dictated by the attempt to the server.
        +       * 
        + * + * .google.protobuf.Timestamp attempt_deadline = 2; + */ + public Builder setAttemptDeadline(com.google.protobuf.Timestamp value) { + if (attemptDeadlineBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + attemptDeadline_ = value; + } else { + attemptDeadlineBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
        +       * The deadline dictated by the attempt to the server.
        +       * 
        + * + * .google.protobuf.Timestamp attempt_deadline = 2; + */ + public Builder setAttemptDeadline(com.google.protobuf.Timestamp.Builder builderForValue) { + if (attemptDeadlineBuilder_ == null) { + attemptDeadline_ = builderForValue.build(); + } else { + attemptDeadlineBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
        +       * The deadline dictated by the attempt to the server.
        +       * 
        + * + * .google.protobuf.Timestamp attempt_deadline = 2; + */ + public Builder mergeAttemptDeadline(com.google.protobuf.Timestamp value) { + if (attemptDeadlineBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && attemptDeadline_ != null + && attemptDeadline_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getAttemptDeadlineBuilder().mergeFrom(value); + } else { + attemptDeadline_ = value; + } + } else { + attemptDeadlineBuilder_.mergeFrom(value); + } + if (attemptDeadline_ != null) { + bitField0_ |= 0x00000002; + onChanged(); + } + return this; + } + + /** + * + * + *
        +       * The deadline dictated by the attempt to the server.
        +       * 
        + * + * .google.protobuf.Timestamp attempt_deadline = 2; + */ + public Builder clearAttemptDeadline() { + bitField0_ = (bitField0_ & ~0x00000002); + attemptDeadline_ = null; + if (attemptDeadlineBuilder_ != null) { + attemptDeadlineBuilder_.dispose(); + attemptDeadlineBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
        +       * The deadline dictated by the attempt to the server.
        +       * 
        + * + * .google.protobuf.Timestamp attempt_deadline = 2; + */ + public com.google.protobuf.Timestamp.Builder getAttemptDeadlineBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return getAttemptDeadlineFieldBuilder().getBuilder(); + } + + /** + * + * + *
        +       * The deadline dictated by the attempt to the server.
        +       * 
        + * + * .google.protobuf.Timestamp attempt_deadline = 2; + */ + public com.google.protobuf.TimestampOrBuilder getAttemptDeadlineOrBuilder() { + if (attemptDeadlineBuilder_ != null) { + return attemptDeadlineBuilder_.getMessageOrBuilder(); + } else { + return attemptDeadline_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : attemptDeadline_; + } + } + + /** + * + * + *
        +       * The deadline dictated by the attempt to the server.
        +       * 
        + * + * .google.protobuf.Timestamp attempt_deadline = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getAttemptDeadlineFieldBuilder() { + if (attemptDeadlineBuilder_ == null) { + attemptDeadlineBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getAttemptDeadline(), getParentForChildren(), isClean()); + attemptDeadline_ = null; + } + return attemptDeadlineBuilder_; + } + + private com.google.protobuf.Timestamp responseTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + responseTimeBuilder_; + + /** + * + * + *
        +       * The time that the server responded to the RPC attempt. Used for
        +       * calculating attempt_delay.
        +       * 
        + * + * .google.protobuf.Timestamp response_time = 3; + * + * @return Whether the responseTime field is set. + */ + public boolean hasResponseTime() { + return ((bitField0_ & 0x00000004) != 0); + } + + /** + * + * + *
        +       * The time that the server responded to the RPC attempt. Used for
        +       * calculating attempt_delay.
        +       * 
        + * + * .google.protobuf.Timestamp response_time = 3; + * + * @return The responseTime. + */ + public com.google.protobuf.Timestamp getResponseTime() { + if (responseTimeBuilder_ == null) { + return responseTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : responseTime_; + } else { + return responseTimeBuilder_.getMessage(); + } + } + + /** + * + * + *
        +       * The time that the server responded to the RPC attempt. Used for
        +       * calculating attempt_delay.
        +       * 
        + * + * .google.protobuf.Timestamp response_time = 3; + */ + public Builder setResponseTime(com.google.protobuf.Timestamp value) { + if (responseTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + responseTime_ = value; + } else { + responseTimeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
        +       * The time that the server responded to the RPC attempt. Used for
        +       * calculating attempt_delay.
        +       * 
        + * + * .google.protobuf.Timestamp response_time = 3; + */ + public Builder setResponseTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (responseTimeBuilder_ == null) { + responseTime_ = builderForValue.build(); + } else { + responseTimeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
        +       * The time that the server responded to the RPC attempt. Used for
        +       * calculating attempt_delay.
        +       * 
        + * + * .google.protobuf.Timestamp response_time = 3; + */ + public Builder mergeResponseTime(com.google.protobuf.Timestamp value) { + if (responseTimeBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0) + && responseTime_ != null + && responseTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getResponseTimeBuilder().mergeFrom(value); + } else { + responseTime_ = value; + } + } else { + responseTimeBuilder_.mergeFrom(value); + } + if (responseTime_ != null) { + bitField0_ |= 0x00000004; + onChanged(); + } + return this; + } + + /** + * + * + *
        +       * The time that the server responded to the RPC attempt. Used for
        +       * calculating attempt_delay.
        +       * 
        + * + * .google.protobuf.Timestamp response_time = 3; + */ + public Builder clearResponseTime() { + bitField0_ = (bitField0_ & ~0x00000004); + responseTime_ = null; + if (responseTimeBuilder_ != null) { + responseTimeBuilder_.dispose(); + responseTimeBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
        +       * The time that the server responded to the RPC attempt. Used for
        +       * calculating attempt_delay.
        +       * 
        + * + * .google.protobuf.Timestamp response_time = 3; + */ + public com.google.protobuf.Timestamp.Builder getResponseTimeBuilder() { + bitField0_ |= 0x00000004; + onChanged(); + return getResponseTimeFieldBuilder().getBuilder(); + } + + /** + * + * + *
        +       * The time that the server responded to the RPC attempt. Used for
        +       * calculating attempt_delay.
        +       * 
        + * + * .google.protobuf.Timestamp response_time = 3; + */ + public com.google.protobuf.TimestampOrBuilder getResponseTimeOrBuilder() { + if (responseTimeBuilder_ != null) { + return responseTimeBuilder_.getMessageOrBuilder(); + } else { + return responseTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : responseTime_; + } + } + + /** + * + * + *
        +       * The time that the server responded to the RPC attempt. Used for
        +       * calculating attempt_delay.
        +       * 
        + * + * .google.protobuf.Timestamp response_time = 3; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getResponseTimeFieldBuilder() { + if (responseTimeBuilder_ == null) { + responseTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getResponseTime(), getParentForChildren(), isClean()); + responseTime_ = null; + } + return responseTimeBuilder_; + } + + private com.google.protobuf.Duration attemptDelay_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder> + attemptDelayBuilder_; + + /** + * + * + *
        +       * The server perceived delay between sending the last response and
        +       * receiving this attempt. Used for validating attempt delay backoff.
        +       * 
        + * + * .google.protobuf.Duration attempt_delay = 4; + * + * @return Whether the attemptDelay field is set. + */ + public boolean hasAttemptDelay() { + return ((bitField0_ & 0x00000008) != 0); + } + + /** + * + * + *
        +       * The server perceived delay between sending the last response and
        +       * receiving this attempt. Used for validating attempt delay backoff.
        +       * 
        + * + * .google.protobuf.Duration attempt_delay = 4; + * + * @return The attemptDelay. + */ + public com.google.protobuf.Duration getAttemptDelay() { + if (attemptDelayBuilder_ == null) { + return attemptDelay_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : attemptDelay_; + } else { + return attemptDelayBuilder_.getMessage(); + } + } + + /** + * + * + *
        +       * The server perceived delay between sending the last response and
        +       * receiving this attempt. Used for validating attempt delay backoff.
        +       * 
        + * + * .google.protobuf.Duration attempt_delay = 4; + */ + public Builder setAttemptDelay(com.google.protobuf.Duration value) { + if (attemptDelayBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + attemptDelay_ = value; + } else { + attemptDelayBuilder_.setMessage(value); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + /** + * + * + *
        +       * The server perceived delay between sending the last response and
        +       * receiving this attempt. Used for validating attempt delay backoff.
        +       * 
        + * + * .google.protobuf.Duration attempt_delay = 4; + */ + public Builder setAttemptDelay(com.google.protobuf.Duration.Builder builderForValue) { + if (attemptDelayBuilder_ == null) { + attemptDelay_ = builderForValue.build(); + } else { + attemptDelayBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + /** + * + * + *
        +       * The server perceived delay between sending the last response and
        +       * receiving this attempt. Used for validating attempt delay backoff.
        +       * 
        + * + * .google.protobuf.Duration attempt_delay = 4; + */ + public Builder mergeAttemptDelay(com.google.protobuf.Duration value) { + if (attemptDelayBuilder_ == null) { + if (((bitField0_ & 0x00000008) != 0) + && attemptDelay_ != null + && attemptDelay_ != com.google.protobuf.Duration.getDefaultInstance()) { + getAttemptDelayBuilder().mergeFrom(value); + } else { + attemptDelay_ = value; + } + } else { + attemptDelayBuilder_.mergeFrom(value); + } + if (attemptDelay_ != null) { + bitField0_ |= 0x00000008; + onChanged(); + } + return this; + } + + /** + * + * + *
        +       * The server perceived delay between sending the last response and
        +       * receiving this attempt. Used for validating attempt delay backoff.
        +       * 
        + * + * .google.protobuf.Duration attempt_delay = 4; + */ + public Builder clearAttemptDelay() { + bitField0_ = (bitField0_ & ~0x00000008); + attemptDelay_ = null; + if (attemptDelayBuilder_ != null) { + attemptDelayBuilder_.dispose(); + attemptDelayBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
        +       * The server perceived delay between sending the last response and
        +       * receiving this attempt. Used for validating attempt delay backoff.
        +       * 
        + * + * .google.protobuf.Duration attempt_delay = 4; + */ + public com.google.protobuf.Duration.Builder getAttemptDelayBuilder() { + bitField0_ |= 0x00000008; + onChanged(); + return getAttemptDelayFieldBuilder().getBuilder(); + } + + /** + * + * + *
        +       * The server perceived delay between sending the last response and
        +       * receiving this attempt. Used for validating attempt delay backoff.
        +       * 
        + * + * .google.protobuf.Duration attempt_delay = 4; + */ + public com.google.protobuf.DurationOrBuilder getAttemptDelayOrBuilder() { + if (attemptDelayBuilder_ != null) { + return attemptDelayBuilder_.getMessageOrBuilder(); + } else { + return attemptDelay_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : attemptDelay_; + } + } + + /** + * + * + *
        +       * The server perceived delay between sending the last response and
        +       * receiving this attempt. Used for validating attempt delay backoff.
        +       * 
        + * + * .google.protobuf.Duration attempt_delay = 4; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder> + getAttemptDelayFieldBuilder() { + if (attemptDelayBuilder_ == null) { + attemptDelayBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder>( + getAttemptDelay(), getParentForChildren(), isClean()); + attemptDelay_ = null; + } + return attemptDelayBuilder_; + } + + private com.google.rpc.Status status_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.rpc.Status, com.google.rpc.Status.Builder, com.google.rpc.StatusOrBuilder> + statusBuilder_; + + /** + * + * + *
        +       * The status returned to the attempt.
        +       * 
        + * + * .google.rpc.Status status = 5; + * + * @return Whether the status field is set. + */ + public boolean hasStatus() { + return ((bitField0_ & 0x00000010) != 0); + } + + /** + * + * + *
        +       * The status returned to the attempt.
        +       * 
        + * + * .google.rpc.Status status = 5; + * + * @return The status. + */ + public com.google.rpc.Status getStatus() { + if (statusBuilder_ == null) { + return status_ == null ? com.google.rpc.Status.getDefaultInstance() : status_; + } else { + return statusBuilder_.getMessage(); + } + } + + /** + * + * + *
        +       * The status returned to the attempt.
        +       * 
        + * + * .google.rpc.Status status = 5; + */ + public Builder setStatus(com.google.rpc.Status value) { + if (statusBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + status_ = value; + } else { + statusBuilder_.setMessage(value); + } + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + /** + * + * + *
        +       * The status returned to the attempt.
        +       * 
        + * + * .google.rpc.Status status = 5; + */ + public Builder setStatus(com.google.rpc.Status.Builder builderForValue) { + if (statusBuilder_ == null) { + status_ = builderForValue.build(); + } else { + statusBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + /** + * + * + *
        +       * The status returned to the attempt.
        +       * 
        + * + * .google.rpc.Status status = 5; + */ + public Builder mergeStatus(com.google.rpc.Status value) { + if (statusBuilder_ == null) { + if (((bitField0_ & 0x00000010) != 0) + && status_ != null + && status_ != com.google.rpc.Status.getDefaultInstance()) { + getStatusBuilder().mergeFrom(value); + } else { + status_ = value; + } + } else { + statusBuilder_.mergeFrom(value); + } + if (status_ != null) { + bitField0_ |= 0x00000010; + onChanged(); + } + return this; + } + + /** + * + * + *
        +       * The status returned to the attempt.
        +       * 
        + * + * .google.rpc.Status status = 5; + */ + public Builder clearStatus() { + bitField0_ = (bitField0_ & ~0x00000010); + status_ = null; + if (statusBuilder_ != null) { + statusBuilder_.dispose(); + statusBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
        +       * The status returned to the attempt.
        +       * 
        + * + * .google.rpc.Status status = 5; + */ + public com.google.rpc.Status.Builder getStatusBuilder() { + bitField0_ |= 0x00000010; + onChanged(); + return getStatusFieldBuilder().getBuilder(); + } + + /** + * + * + *
        +       * The status returned to the attempt.
        +       * 
        + * + * .google.rpc.Status status = 5; + */ + public com.google.rpc.StatusOrBuilder getStatusOrBuilder() { + if (statusBuilder_ != null) { + return statusBuilder_.getMessageOrBuilder(); + } else { + return status_ == null ? com.google.rpc.Status.getDefaultInstance() : status_; + } + } + + /** + * + * + *
        +       * The status returned to the attempt.
        +       * 
        + * + * .google.rpc.Status status = 5; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.rpc.Status, com.google.rpc.Status.Builder, com.google.rpc.StatusOrBuilder> + getStatusFieldBuilder() { + if (statusBuilder_ == null) { + statusBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.rpc.Status, + com.google.rpc.Status.Builder, + com.google.rpc.StatusOrBuilder>(getStatus(), getParentForChildren(), isClean()); + status_ = null; + } + return statusBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.showcase.v1beta1.StreamingSequenceReport.Attempt) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.StreamingSequenceReport.Attempt) + private static final com.google.showcase.v1beta1.StreamingSequenceReport.Attempt + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.StreamingSequenceReport.Attempt(); + } + + public static com.google.showcase.v1beta1.StreamingSequenceReport.Attempt getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Attempt 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.showcase.v1beta1.StreamingSequenceReport.Attempt getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + + /** + * 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; + } + } + + /** + * 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 ATTEMPTS_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private java.util.List attempts_; + + /** + * + * + *
        +   * The set of RPC attempts received by the server for a Sequence.
        +   * 
        + * + * repeated .google.showcase.v1beta1.StreamingSequenceReport.Attempt attempts = 2; + */ + @java.lang.Override + public java.util.List + getAttemptsList() { + return attempts_; + } + + /** + * + * + *
        +   * The set of RPC attempts received by the server for a Sequence.
        +   * 
        + * + * repeated .google.showcase.v1beta1.StreamingSequenceReport.Attempt attempts = 2; + */ + @java.lang.Override + public java.util.List< + ? extends com.google.showcase.v1beta1.StreamingSequenceReport.AttemptOrBuilder> + getAttemptsOrBuilderList() { + return attempts_; + } + + /** + * + * + *
        +   * The set of RPC attempts received by the server for a Sequence.
        +   * 
        + * + * repeated .google.showcase.v1beta1.StreamingSequenceReport.Attempt attempts = 2; + */ + @java.lang.Override + public int getAttemptsCount() { + return attempts_.size(); + } + + /** + * + * + *
        +   * The set of RPC attempts received by the server for a Sequence.
        +   * 
        + * + * repeated .google.showcase.v1beta1.StreamingSequenceReport.Attempt attempts = 2; + */ + @java.lang.Override + public com.google.showcase.v1beta1.StreamingSequenceReport.Attempt getAttempts(int index) { + return attempts_.get(index); + } + + /** + * + * + *
        +   * The set of RPC attempts received by the server for a Sequence.
        +   * 
        + * + * repeated .google.showcase.v1beta1.StreamingSequenceReport.Attempt attempts = 2; + */ + @java.lang.Override + public com.google.showcase.v1beta1.StreamingSequenceReport.AttemptOrBuilder getAttemptsOrBuilder( + int index) { + return attempts_.get(index); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + for (int i = 0; i < attempts_.size(); i++) { + output.writeMessage(2, attempts_.get(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(name_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + for (int i = 0; i < attempts_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, attempts_.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.showcase.v1beta1.StreamingSequenceReport)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.StreamingSequenceReport other = + (com.google.showcase.v1beta1.StreamingSequenceReport) obj; + + if (!getName().equals(other.getName())) return false; + if (!getAttemptsList().equals(other.getAttemptsList())) 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 (getAttemptsCount() > 0) { + hash = (37 * hash) + ATTEMPTS_FIELD_NUMBER; + hash = (53 * hash) + getAttemptsList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.showcase.v1beta1.StreamingSequenceReport parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.StreamingSequenceReport parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.StreamingSequenceReport parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.StreamingSequenceReport 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.showcase.v1beta1.StreamingSequenceReport parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.StreamingSequenceReport parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.StreamingSequenceReport parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.StreamingSequenceReport 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.showcase.v1beta1.StreamingSequenceReport parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.StreamingSequenceReport 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.showcase.v1beta1.StreamingSequenceReport parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.StreamingSequenceReport 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.showcase.v1beta1.StreamingSequenceReport prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** Protobuf type {@code google.showcase.v1beta1.StreamingSequenceReport} */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.StreamingSequenceReport) + com.google.showcase.v1beta1.StreamingSequenceReportOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.SequenceOuterClass + .internal_static_google_showcase_v1beta1_StreamingSequenceReport_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.SequenceOuterClass + .internal_static_google_showcase_v1beta1_StreamingSequenceReport_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.StreamingSequenceReport.class, + com.google.showcase.v1beta1.StreamingSequenceReport.Builder.class); + } + + // Construct using com.google.showcase.v1beta1.StreamingSequenceReport.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + if (attemptsBuilder_ == null) { + attempts_ = java.util.Collections.emptyList(); + } else { + attempts_ = null; + attemptsBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000002); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.showcase.v1beta1.SequenceOuterClass + .internal_static_google_showcase_v1beta1_StreamingSequenceReport_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.StreamingSequenceReport getDefaultInstanceForType() { + return com.google.showcase.v1beta1.StreamingSequenceReport.getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.StreamingSequenceReport build() { + com.google.showcase.v1beta1.StreamingSequenceReport result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.StreamingSequenceReport buildPartial() { + com.google.showcase.v1beta1.StreamingSequenceReport result = + new com.google.showcase.v1beta1.StreamingSequenceReport(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields( + com.google.showcase.v1beta1.StreamingSequenceReport result) { + if (attemptsBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0)) { + attempts_ = java.util.Collections.unmodifiableList(attempts_); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.attempts_ = attempts_; + } else { + result.attempts_ = attemptsBuilder_.build(); + } + } + + private void buildPartial0(com.google.showcase.v1beta1.StreamingSequenceReport 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.showcase.v1beta1.StreamingSequenceReport) { + return mergeFrom((com.google.showcase.v1beta1.StreamingSequenceReport) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.showcase.v1beta1.StreamingSequenceReport other) { + if (other == com.google.showcase.v1beta1.StreamingSequenceReport.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (attemptsBuilder_ == null) { + if (!other.attempts_.isEmpty()) { + if (attempts_.isEmpty()) { + attempts_ = other.attempts_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureAttemptsIsMutable(); + attempts_.addAll(other.attempts_); + } + onChanged(); + } + } else { + if (!other.attempts_.isEmpty()) { + if (attemptsBuilder_.isEmpty()) { + attemptsBuilder_.dispose(); + attemptsBuilder_ = null; + attempts_ = other.attempts_; + bitField0_ = (bitField0_ & ~0x00000002); + attemptsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getAttemptsFieldBuilder() + : null; + } else { + attemptsBuilder_.addAllMessages(other.attempts_); + } + } + } + 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: + { + com.google.showcase.v1beta1.StreamingSequenceReport.Attempt m = + input.readMessage( + com.google.showcase.v1beta1.StreamingSequenceReport.Attempt.parser(), + extensionRegistry); + if (attemptsBuilder_ == null) { + ensureAttemptsIsMutable(); + attempts_.add(m); + } else { + attemptsBuilder_.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.lang.Object name_ = ""; + + /** + * 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; + } + } + + /** + * 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; + } + } + + /** + * 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; + } + + /** + * 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; + } + + /** + * 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.util.List attempts_ = + java.util.Collections.emptyList(); + + private void ensureAttemptsIsMutable() { + if (!((bitField0_ & 0x00000002) != 0)) { + attempts_ = + new java.util.ArrayList( + attempts_); + bitField0_ |= 0x00000002; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.showcase.v1beta1.StreamingSequenceReport.Attempt, + com.google.showcase.v1beta1.StreamingSequenceReport.Attempt.Builder, + com.google.showcase.v1beta1.StreamingSequenceReport.AttemptOrBuilder> + attemptsBuilder_; + + /** + * + * + *
        +     * The set of RPC attempts received by the server for a Sequence.
        +     * 
        + * + * repeated .google.showcase.v1beta1.StreamingSequenceReport.Attempt attempts = 2; + */ + public java.util.List + getAttemptsList() { + if (attemptsBuilder_ == null) { + return java.util.Collections.unmodifiableList(attempts_); + } else { + return attemptsBuilder_.getMessageList(); + } + } + + /** + * + * + *
        +     * The set of RPC attempts received by the server for a Sequence.
        +     * 
        + * + * repeated .google.showcase.v1beta1.StreamingSequenceReport.Attempt attempts = 2; + */ + public int getAttemptsCount() { + if (attemptsBuilder_ == null) { + return attempts_.size(); + } else { + return attemptsBuilder_.getCount(); + } + } + + /** + * + * + *
        +     * The set of RPC attempts received by the server for a Sequence.
        +     * 
        + * + * repeated .google.showcase.v1beta1.StreamingSequenceReport.Attempt attempts = 2; + */ + public com.google.showcase.v1beta1.StreamingSequenceReport.Attempt getAttempts(int index) { + if (attemptsBuilder_ == null) { + return attempts_.get(index); + } else { + return attemptsBuilder_.getMessage(index); + } + } + + /** + * + * + *
        +     * The set of RPC attempts received by the server for a Sequence.
        +     * 
        + * + * repeated .google.showcase.v1beta1.StreamingSequenceReport.Attempt attempts = 2; + */ + public Builder setAttempts( + int index, com.google.showcase.v1beta1.StreamingSequenceReport.Attempt value) { + if (attemptsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureAttemptsIsMutable(); + attempts_.set(index, value); + onChanged(); + } else { + attemptsBuilder_.setMessage(index, value); + } + return this; + } + + /** + * + * + *
        +     * The set of RPC attempts received by the server for a Sequence.
        +     * 
        + * + * repeated .google.showcase.v1beta1.StreamingSequenceReport.Attempt attempts = 2; + */ + public Builder setAttempts( + int index, + com.google.showcase.v1beta1.StreamingSequenceReport.Attempt.Builder builderForValue) { + if (attemptsBuilder_ == null) { + ensureAttemptsIsMutable(); + attempts_.set(index, builderForValue.build()); + onChanged(); + } else { + attemptsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
        +     * The set of RPC attempts received by the server for a Sequence.
        +     * 
        + * + * repeated .google.showcase.v1beta1.StreamingSequenceReport.Attempt attempts = 2; + */ + public Builder addAttempts(com.google.showcase.v1beta1.StreamingSequenceReport.Attempt value) { + if (attemptsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureAttemptsIsMutable(); + attempts_.add(value); + onChanged(); + } else { + attemptsBuilder_.addMessage(value); + } + return this; + } + + /** + * + * + *
        +     * The set of RPC attempts received by the server for a Sequence.
        +     * 
        + * + * repeated .google.showcase.v1beta1.StreamingSequenceReport.Attempt attempts = 2; + */ + public Builder addAttempts( + int index, com.google.showcase.v1beta1.StreamingSequenceReport.Attempt value) { + if (attemptsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureAttemptsIsMutable(); + attempts_.add(index, value); + onChanged(); + } else { + attemptsBuilder_.addMessage(index, value); + } + return this; + } + + /** + * + * + *
        +     * The set of RPC attempts received by the server for a Sequence.
        +     * 
        + * + * repeated .google.showcase.v1beta1.StreamingSequenceReport.Attempt attempts = 2; + */ + public Builder addAttempts( + com.google.showcase.v1beta1.StreamingSequenceReport.Attempt.Builder builderForValue) { + if (attemptsBuilder_ == null) { + ensureAttemptsIsMutable(); + attempts_.add(builderForValue.build()); + onChanged(); + } else { + attemptsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + + /** + * + * + *
        +     * The set of RPC attempts received by the server for a Sequence.
        +     * 
        + * + * repeated .google.showcase.v1beta1.StreamingSequenceReport.Attempt attempts = 2; + */ + public Builder addAttempts( + int index, + com.google.showcase.v1beta1.StreamingSequenceReport.Attempt.Builder builderForValue) { + if (attemptsBuilder_ == null) { + ensureAttemptsIsMutable(); + attempts_.add(index, builderForValue.build()); + onChanged(); + } else { + attemptsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
        +     * The set of RPC attempts received by the server for a Sequence.
        +     * 
        + * + * repeated .google.showcase.v1beta1.StreamingSequenceReport.Attempt attempts = 2; + */ + public Builder addAllAttempts( + java.lang.Iterable + values) { + if (attemptsBuilder_ == null) { + ensureAttemptsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, attempts_); + onChanged(); + } else { + attemptsBuilder_.addAllMessages(values); + } + return this; + } + + /** + * + * + *
        +     * The set of RPC attempts received by the server for a Sequence.
        +     * 
        + * + * repeated .google.showcase.v1beta1.StreamingSequenceReport.Attempt attempts = 2; + */ + public Builder clearAttempts() { + if (attemptsBuilder_ == null) { + attempts_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + } else { + attemptsBuilder_.clear(); + } + return this; + } + + /** + * + * + *
        +     * The set of RPC attempts received by the server for a Sequence.
        +     * 
        + * + * repeated .google.showcase.v1beta1.StreamingSequenceReport.Attempt attempts = 2; + */ + public Builder removeAttempts(int index) { + if (attemptsBuilder_ == null) { + ensureAttemptsIsMutable(); + attempts_.remove(index); + onChanged(); + } else { + attemptsBuilder_.remove(index); + } + return this; + } + + /** + * + * + *
        +     * The set of RPC attempts received by the server for a Sequence.
        +     * 
        + * + * repeated .google.showcase.v1beta1.StreamingSequenceReport.Attempt attempts = 2; + */ + public com.google.showcase.v1beta1.StreamingSequenceReport.Attempt.Builder getAttemptsBuilder( + int index) { + return getAttemptsFieldBuilder().getBuilder(index); + } + + /** + * + * + *
        +     * The set of RPC attempts received by the server for a Sequence.
        +     * 
        + * + * repeated .google.showcase.v1beta1.StreamingSequenceReport.Attempt attempts = 2; + */ + public com.google.showcase.v1beta1.StreamingSequenceReport.AttemptOrBuilder + getAttemptsOrBuilder(int index) { + if (attemptsBuilder_ == null) { + return attempts_.get(index); + } else { + return attemptsBuilder_.getMessageOrBuilder(index); + } + } + + /** + * + * + *
        +     * The set of RPC attempts received by the server for a Sequence.
        +     * 
        + * + * repeated .google.showcase.v1beta1.StreamingSequenceReport.Attempt attempts = 2; + */ + public java.util.List< + ? extends com.google.showcase.v1beta1.StreamingSequenceReport.AttemptOrBuilder> + getAttemptsOrBuilderList() { + if (attemptsBuilder_ != null) { + return attemptsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(attempts_); + } + } + + /** + * + * + *
        +     * The set of RPC attempts received by the server for a Sequence.
        +     * 
        + * + * repeated .google.showcase.v1beta1.StreamingSequenceReport.Attempt attempts = 2; + */ + public com.google.showcase.v1beta1.StreamingSequenceReport.Attempt.Builder + addAttemptsBuilder() { + return getAttemptsFieldBuilder() + .addBuilder( + com.google.showcase.v1beta1.StreamingSequenceReport.Attempt.getDefaultInstance()); + } + + /** + * + * + *
        +     * The set of RPC attempts received by the server for a Sequence.
        +     * 
        + * + * repeated .google.showcase.v1beta1.StreamingSequenceReport.Attempt attempts = 2; + */ + public com.google.showcase.v1beta1.StreamingSequenceReport.Attempt.Builder addAttemptsBuilder( + int index) { + return getAttemptsFieldBuilder() + .addBuilder( + index, + com.google.showcase.v1beta1.StreamingSequenceReport.Attempt.getDefaultInstance()); + } + + /** + * + * + *
        +     * The set of RPC attempts received by the server for a Sequence.
        +     * 
        + * + * repeated .google.showcase.v1beta1.StreamingSequenceReport.Attempt attempts = 2; + */ + public java.util.List + getAttemptsBuilderList() { + return getAttemptsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.showcase.v1beta1.StreamingSequenceReport.Attempt, + com.google.showcase.v1beta1.StreamingSequenceReport.Attempt.Builder, + com.google.showcase.v1beta1.StreamingSequenceReport.AttemptOrBuilder> + getAttemptsFieldBuilder() { + if (attemptsBuilder_ == null) { + attemptsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.showcase.v1beta1.StreamingSequenceReport.Attempt, + com.google.showcase.v1beta1.StreamingSequenceReport.Attempt.Builder, + com.google.showcase.v1beta1.StreamingSequenceReport.AttemptOrBuilder>( + attempts_, ((bitField0_ & 0x00000002) != 0), getParentForChildren(), isClean()); + attempts_ = null; + } + return attemptsBuilder_; + } + + @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.showcase.v1beta1.StreamingSequenceReport) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.StreamingSequenceReport) + private static final com.google.showcase.v1beta1.StreamingSequenceReport DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.StreamingSequenceReport(); + } + + public static com.google.showcase.v1beta1.StreamingSequenceReport getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public StreamingSequenceReport 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.showcase.v1beta1.StreamingSequenceReport getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/StreamingSequenceReportName.java b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/StreamingSequenceReportName.java new file mode 100644 index 0000000000..d3e5c33ade --- /dev/null +++ b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/StreamingSequenceReportName.java @@ -0,0 +1,170 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1; + +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +@Generated("by gapic-generator-java") +public class StreamingSequenceReportName implements ResourceName { + private static final PathTemplate STREAMING_SEQUENCE = + PathTemplate.createWithoutUrlEncoding( + "streamingSequences/{streaming_sequence}/streamingSequenceReport"); + private volatile Map fieldValuesMap; + private final String streamingSequence; + + @Deprecated + protected StreamingSequenceReportName() { + streamingSequence = null; + } + + private StreamingSequenceReportName(Builder builder) { + streamingSequence = Preconditions.checkNotNull(builder.getStreamingSequence()); + } + + public String getStreamingSequence() { + return streamingSequence; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + public static StreamingSequenceReportName of(String streamingSequence) { + return newBuilder().setStreamingSequence(streamingSequence).build(); + } + + public static String format(String streamingSequence) { + return newBuilder().setStreamingSequence(streamingSequence).build().toString(); + } + + public static StreamingSequenceReportName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + STREAMING_SEQUENCE.validatedMatch( + formattedString, + "StreamingSequenceReportName.parse: formattedString not in valid format"); + return of(matchMap.get("streaming_sequence")); + } + + 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 (StreamingSequenceReportName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return STREAMING_SEQUENCE.matches(formattedString); + } + + @Override + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + if (streamingSequence != null) { + fieldMapBuilder.put("streaming_sequence", streamingSequence); + } + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return STREAMING_SEQUENCE.instantiate("streaming_sequence", streamingSequence); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o != null && getClass() == o.getClass()) { + StreamingSequenceReportName that = ((StreamingSequenceReportName) o); + return Objects.equals(this.streamingSequence, that.streamingSequence); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= Objects.hashCode(streamingSequence); + return h; + } + + /** Builder for streamingSequences/{streaming_sequence}/streamingSequenceReport. */ + public static class Builder { + private String streamingSequence; + + protected Builder() {} + + public String getStreamingSequence() { + return streamingSequence; + } + + public Builder setStreamingSequence(String streamingSequence) { + this.streamingSequence = streamingSequence; + return this; + } + + private Builder(StreamingSequenceReportName streamingSequenceReportName) { + this.streamingSequence = streamingSequenceReportName.streamingSequence; + } + + public StreamingSequenceReportName build() { + return new StreamingSequenceReportName(this); + } + } +} diff --git a/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/StreamingSequenceReportOrBuilder.java b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/StreamingSequenceReportOrBuilder.java new file mode 100644 index 0000000000..9ee1dc893d --- /dev/null +++ b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/StreamingSequenceReportOrBuilder.java @@ -0,0 +1,97 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/sequence.proto + +// Protobuf Java Version: 3.25.8 +package com.google.showcase.v1beta1; + +public interface StreamingSequenceReportOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.StreamingSequenceReport) + com.google.protobuf.MessageOrBuilder { + + /** + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The name. + */ + java.lang.String getName(); + + /** + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
        +   * The set of RPC attempts received by the server for a Sequence.
        +   * 
        + * + * repeated .google.showcase.v1beta1.StreamingSequenceReport.Attempt attempts = 2; + */ + java.util.List getAttemptsList(); + + /** + * + * + *
        +   * The set of RPC attempts received by the server for a Sequence.
        +   * 
        + * + * repeated .google.showcase.v1beta1.StreamingSequenceReport.Attempt attempts = 2; + */ + com.google.showcase.v1beta1.StreamingSequenceReport.Attempt getAttempts(int index); + + /** + * + * + *
        +   * The set of RPC attempts received by the server for a Sequence.
        +   * 
        + * + * repeated .google.showcase.v1beta1.StreamingSequenceReport.Attempt attempts = 2; + */ + int getAttemptsCount(); + + /** + * + * + *
        +   * The set of RPC attempts received by the server for a Sequence.
        +   * 
        + * + * repeated .google.showcase.v1beta1.StreamingSequenceReport.Attempt attempts = 2; + */ + java.util.List + getAttemptsOrBuilderList(); + + /** + * + * + *
        +   * The set of RPC attempts received by the server for a Sequence.
        +   * 
        + * + * repeated .google.showcase.v1beta1.StreamingSequenceReport.Attempt attempts = 2; + */ + com.google.showcase.v1beta1.StreamingSequenceReport.AttemptOrBuilder getAttemptsOrBuilder( + int index); +} diff --git a/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/Test.java b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/Test.java new file mode 100644 index 0000000000..d14bd6278e --- /dev/null +++ b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/Test.java @@ -0,0 +1,4352 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/testing.proto + +// Protobuf Java Version: 3.25.8 +package com.google.showcase.v1beta1; + +/** Protobuf type {@code google.showcase.v1beta1.Test} */ +public final class Test extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.Test) + TestOrBuilder { + private static final long serialVersionUID = 0L; + + // Use Test.newBuilder() to construct. + private Test(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Test() { + name_ = ""; + expectationLevel_ = 0; + description_ = ""; + blueprints_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Test(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.TestingOuterClass + .internal_static_google_showcase_v1beta1_Test_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.TestingOuterClass + .internal_static_google_showcase_v1beta1_Test_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.Test.class, com.google.showcase.v1beta1.Test.Builder.class); + } + + /** + * + * + *
        +   * Whether or not a test is required, recommended, or optional.
        +   * 
        + * + * Protobuf enum {@code google.showcase.v1beta1.Test.ExpectationLevel} + */ + public enum ExpectationLevel implements com.google.protobuf.ProtocolMessageEnum { + /** EXPECTATION_LEVEL_UNSPECIFIED = 0; */ + EXPECTATION_LEVEL_UNSPECIFIED(0), + /** + * + * + *
        +     * This test is strictly required.
        +     * 
        + * + * REQUIRED = 1; + */ + REQUIRED(1), + /** + * + * + *
        +     * This test is recommended.
        +     *
        +     * If a generator explicitly ignores a recommended test (see `DeleteTest`),
        +     * then the report may still pass, but with a warning.
        +     *
        +     * If a generator skips a recommended test and does not explicitly
        +     * express that intention, the report will fail.
        +     * 
        + * + * RECOMMENDED = 2; + */ + RECOMMENDED(2), + /** + * + * + *
        +     * This test is optional.
        +     *
        +     * If a generator explicitly ignores an optional test (see `DeleteTest`),
        +     * then the report may still pass, and no warning will be issued.
        +     *
        +     * If a generator skips an optional test and does not explicitly
        +     * express that intention, the report may still pass, but with a
        +     * warning.
        +     * 
        + * + * OPTIONAL = 3; + */ + OPTIONAL(3), + UNRECOGNIZED(-1), + ; + + /** EXPECTATION_LEVEL_UNSPECIFIED = 0; */ + public static final int EXPECTATION_LEVEL_UNSPECIFIED_VALUE = 0; + + /** + * + * + *
        +     * This test is strictly required.
        +     * 
        + * + * REQUIRED = 1; + */ + public static final int REQUIRED_VALUE = 1; + + /** + * + * + *
        +     * This test is recommended.
        +     *
        +     * If a generator explicitly ignores a recommended test (see `DeleteTest`),
        +     * then the report may still pass, but with a warning.
        +     *
        +     * If a generator skips a recommended test and does not explicitly
        +     * express that intention, the report will fail.
        +     * 
        + * + * RECOMMENDED = 2; + */ + public static final int RECOMMENDED_VALUE = 2; + + /** + * + * + *
        +     * This test is optional.
        +     *
        +     * If a generator explicitly ignores an optional test (see `DeleteTest`),
        +     * then the report may still pass, and no warning will be issued.
        +     *
        +     * If a generator skips an optional test and does not explicitly
        +     * express that intention, the report may still pass, but with a
        +     * warning.
        +     * 
        + * + * OPTIONAL = 3; + */ + public static final int OPTIONAL_VALUE = 3; + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static ExpectationLevel 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 ExpectationLevel forNumber(int value) { + switch (value) { + case 0: + return EXPECTATION_LEVEL_UNSPECIFIED; + case 1: + return REQUIRED; + case 2: + return RECOMMENDED; + case 3: + return OPTIONAL; + 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 ExpectationLevel findValueByNumber(int number) { + return ExpectationLevel.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.showcase.v1beta1.Test.getDescriptor().getEnumTypes().get(0); + } + + private static final ExpectationLevel[] VALUES = values(); + + public static ExpectationLevel 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 ExpectationLevel(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.showcase.v1beta1.Test.ExpectationLevel) + } + + public interface BlueprintOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.Test.Blueprint) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
        +     * The name of this blueprint.
        +     * 
        + * + * string name = 1; + * + * @return The name. + */ + java.lang.String getName(); + + /** + * + * + *
        +     * The name of this blueprint.
        +     * 
        + * + * string name = 1; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
        +     * A description of this blueprint.
        +     * 
        + * + * string description = 2; + * + * @return The description. + */ + java.lang.String getDescription(); + + /** + * + * + *
        +     * A description of this blueprint.
        +     * 
        + * + * string description = 2; + * + * @return The bytes for description. + */ + com.google.protobuf.ByteString getDescriptionBytes(); + + /** + * + * + *
        +     * The initial request to trigger this test.
        +     * 
        + * + * .google.showcase.v1beta1.Test.Blueprint.Invocation request = 3; + * + * @return Whether the request field is set. + */ + boolean hasRequest(); + + /** + * + * + *
        +     * The initial request to trigger this test.
        +     * 
        + * + * .google.showcase.v1beta1.Test.Blueprint.Invocation request = 3; + * + * @return The request. + */ + com.google.showcase.v1beta1.Test.Blueprint.Invocation getRequest(); + + /** + * + * + *
        +     * The initial request to trigger this test.
        +     * 
        + * + * .google.showcase.v1beta1.Test.Blueprint.Invocation request = 3; + */ + com.google.showcase.v1beta1.Test.Blueprint.InvocationOrBuilder getRequestOrBuilder(); + + /** + * + * + *
        +     * An ordered list of method calls that can be called to trigger this test.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Test.Blueprint.Invocation additional_requests = 4; + * + */ + java.util.List + getAdditionalRequestsList(); + + /** + * + * + *
        +     * An ordered list of method calls that can be called to trigger this test.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Test.Blueprint.Invocation additional_requests = 4; + * + */ + com.google.showcase.v1beta1.Test.Blueprint.Invocation getAdditionalRequests(int index); + + /** + * + * + *
        +     * An ordered list of method calls that can be called to trigger this test.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Test.Blueprint.Invocation additional_requests = 4; + * + */ + int getAdditionalRequestsCount(); + + /** + * + * + *
        +     * An ordered list of method calls that can be called to trigger this test.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Test.Blueprint.Invocation additional_requests = 4; + * + */ + java.util.List + getAdditionalRequestsOrBuilderList(); + + /** + * + * + *
        +     * An ordered list of method calls that can be called to trigger this test.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Test.Blueprint.Invocation additional_requests = 4; + * + */ + com.google.showcase.v1beta1.Test.Blueprint.InvocationOrBuilder getAdditionalRequestsOrBuilder( + int index); + } + + /** + * + * + *
        +   * A blueprint is an explicit definition of methods and requests that are needed
        +   * to be made to test this specific test case. Ideally this would be represented
        +   * by something more robust like CEL, but as of writing this, I am unsure if CEL
        +   * is ready.
        +   * 
        + * + * Protobuf type {@code google.showcase.v1beta1.Test.Blueprint} + */ + public static final class Blueprint extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.Test.Blueprint) + BlueprintOrBuilder { + private static final long serialVersionUID = 0L; + + // Use Blueprint.newBuilder() to construct. + private Blueprint(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Blueprint() { + name_ = ""; + description_ = ""; + additionalRequests_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Blueprint(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.TestingOuterClass + .internal_static_google_showcase_v1beta1_Test_Blueprint_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.TestingOuterClass + .internal_static_google_showcase_v1beta1_Test_Blueprint_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.Test.Blueprint.class, + com.google.showcase.v1beta1.Test.Blueprint.Builder.class); + } + + public interface InvocationOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.Test.Blueprint.Invocation) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
        +       * The fully qualified name of the showcase method to be invoked.
        +       * 
        + * + * string method = 1; + * + * @return The method. + */ + java.lang.String getMethod(); + + /** + * + * + *
        +       * The fully qualified name of the showcase method to be invoked.
        +       * 
        + * + * string method = 1; + * + * @return The bytes for method. + */ + com.google.protobuf.ByteString getMethodBytes(); + + /** + * + * + *
        +       * The request to be made if a specific request is necessary.
        +       * 
        + * + * bytes serialized_request = 2; + * + * @return The serializedRequest. + */ + com.google.protobuf.ByteString getSerializedRequest(); + } + + /** + * + * + *
        +     * A message representing a method invocation.
        +     * 
        + * + * Protobuf type {@code google.showcase.v1beta1.Test.Blueprint.Invocation} + */ + public static final class Invocation extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.Test.Blueprint.Invocation) + InvocationOrBuilder { + private static final long serialVersionUID = 0L; + + // Use Invocation.newBuilder() to construct. + private Invocation(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Invocation() { + method_ = ""; + serializedRequest_ = com.google.protobuf.ByteString.EMPTY; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Invocation(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.TestingOuterClass + .internal_static_google_showcase_v1beta1_Test_Blueprint_Invocation_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.TestingOuterClass + .internal_static_google_showcase_v1beta1_Test_Blueprint_Invocation_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.Test.Blueprint.Invocation.class, + com.google.showcase.v1beta1.Test.Blueprint.Invocation.Builder.class); + } + + public static final int METHOD_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object method_ = ""; + + /** + * + * + *
        +       * The fully qualified name of the showcase method to be invoked.
        +       * 
        + * + * string method = 1; + * + * @return The method. + */ + @java.lang.Override + public java.lang.String getMethod() { + java.lang.Object ref = method_; + 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(); + method_ = s; + return s; + } + } + + /** + * + * + *
        +       * The fully qualified name of the showcase method to be invoked.
        +       * 
        + * + * string method = 1; + * + * @return The bytes for method. + */ + @java.lang.Override + public com.google.protobuf.ByteString getMethodBytes() { + java.lang.Object ref = method_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + method_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int SERIALIZED_REQUEST_FIELD_NUMBER = 2; + private com.google.protobuf.ByteString serializedRequest_ = + com.google.protobuf.ByteString.EMPTY; + + /** + * + * + *
        +       * The request to be made if a specific request is necessary.
        +       * 
        + * + * bytes serialized_request = 2; + * + * @return The serializedRequest. + */ + @java.lang.Override + public com.google.protobuf.ByteString getSerializedRequest() { + return serializedRequest_; + } + + 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(method_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, method_); + } + if (!serializedRequest_.isEmpty()) { + output.writeBytes(2, serializedRequest_); + } + 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(method_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, method_); + } + if (!serializedRequest_.isEmpty()) { + size += com.google.protobuf.CodedOutputStream.computeBytesSize(2, serializedRequest_); + } + 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.showcase.v1beta1.Test.Blueprint.Invocation)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.Test.Blueprint.Invocation other = + (com.google.showcase.v1beta1.Test.Blueprint.Invocation) obj; + + if (!getMethod().equals(other.getMethod())) return false; + if (!getSerializedRequest().equals(other.getSerializedRequest())) 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) + METHOD_FIELD_NUMBER; + hash = (53 * hash) + getMethod().hashCode(); + hash = (37 * hash) + SERIALIZED_REQUEST_FIELD_NUMBER; + hash = (53 * hash) + getSerializedRequest().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.showcase.v1beta1.Test.Blueprint.Invocation parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.Test.Blueprint.Invocation parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.Test.Blueprint.Invocation parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.Test.Blueprint.Invocation 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.showcase.v1beta1.Test.Blueprint.Invocation parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.Test.Blueprint.Invocation parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.Test.Blueprint.Invocation parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.Test.Blueprint.Invocation 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.showcase.v1beta1.Test.Blueprint.Invocation parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.Test.Blueprint.Invocation 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.showcase.v1beta1.Test.Blueprint.Invocation parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.Test.Blueprint.Invocation 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.showcase.v1beta1.Test.Blueprint.Invocation prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
        +       * A message representing a method invocation.
        +       * 
        + * + * Protobuf type {@code google.showcase.v1beta1.Test.Blueprint.Invocation} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.Test.Blueprint.Invocation) + com.google.showcase.v1beta1.Test.Blueprint.InvocationOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.TestingOuterClass + .internal_static_google_showcase_v1beta1_Test_Blueprint_Invocation_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.TestingOuterClass + .internal_static_google_showcase_v1beta1_Test_Blueprint_Invocation_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.Test.Blueprint.Invocation.class, + com.google.showcase.v1beta1.Test.Blueprint.Invocation.Builder.class); + } + + // Construct using com.google.showcase.v1beta1.Test.Blueprint.Invocation.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + method_ = ""; + serializedRequest_ = com.google.protobuf.ByteString.EMPTY; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.showcase.v1beta1.TestingOuterClass + .internal_static_google_showcase_v1beta1_Test_Blueprint_Invocation_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.Test.Blueprint.Invocation getDefaultInstanceForType() { + return com.google.showcase.v1beta1.Test.Blueprint.Invocation.getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.Test.Blueprint.Invocation build() { + com.google.showcase.v1beta1.Test.Blueprint.Invocation result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.Test.Blueprint.Invocation buildPartial() { + com.google.showcase.v1beta1.Test.Blueprint.Invocation result = + new com.google.showcase.v1beta1.Test.Blueprint.Invocation(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.showcase.v1beta1.Test.Blueprint.Invocation result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.method_ = method_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.serializedRequest_ = serializedRequest_; + } + } + + @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.showcase.v1beta1.Test.Blueprint.Invocation) { + return mergeFrom((com.google.showcase.v1beta1.Test.Blueprint.Invocation) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.showcase.v1beta1.Test.Blueprint.Invocation other) { + if (other == com.google.showcase.v1beta1.Test.Blueprint.Invocation.getDefaultInstance()) + return this; + if (!other.getMethod().isEmpty()) { + method_ = other.method_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.getSerializedRequest() != com.google.protobuf.ByteString.EMPTY) { + setSerializedRequest(other.getSerializedRequest()); + } + 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: + { + method_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + serializedRequest_ = input.readBytes(); + 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 method_ = ""; + + /** + * + * + *
        +         * The fully qualified name of the showcase method to be invoked.
        +         * 
        + * + * string method = 1; + * + * @return The method. + */ + public java.lang.String getMethod() { + java.lang.Object ref = method_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + method_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
        +         * The fully qualified name of the showcase method to be invoked.
        +         * 
        + * + * string method = 1; + * + * @return The bytes for method. + */ + public com.google.protobuf.ByteString getMethodBytes() { + java.lang.Object ref = method_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + method_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
        +         * The fully qualified name of the showcase method to be invoked.
        +         * 
        + * + * string method = 1; + * + * @param value The method to set. + * @return This builder for chaining. + */ + public Builder setMethod(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + method_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
        +         * The fully qualified name of the showcase method to be invoked.
        +         * 
        + * + * string method = 1; + * + * @return This builder for chaining. + */ + public Builder clearMethod() { + method_ = getDefaultInstance().getMethod(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
        +         * The fully qualified name of the showcase method to be invoked.
        +         * 
        + * + * string method = 1; + * + * @param value The bytes for method to set. + * @return This builder for chaining. + */ + public Builder setMethodBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + method_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private com.google.protobuf.ByteString serializedRequest_ = + com.google.protobuf.ByteString.EMPTY; + + /** + * + * + *
        +         * The request to be made if a specific request is necessary.
        +         * 
        + * + * bytes serialized_request = 2; + * + * @return The serializedRequest. + */ + @java.lang.Override + public com.google.protobuf.ByteString getSerializedRequest() { + return serializedRequest_; + } + + /** + * + * + *
        +         * The request to be made if a specific request is necessary.
        +         * 
        + * + * bytes serialized_request = 2; + * + * @param value The serializedRequest to set. + * @return This builder for chaining. + */ + public Builder setSerializedRequest(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + serializedRequest_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
        +         * The request to be made if a specific request is necessary.
        +         * 
        + * + * bytes serialized_request = 2; + * + * @return This builder for chaining. + */ + public Builder clearSerializedRequest() { + bitField0_ = (bitField0_ & ~0x00000002); + serializedRequest_ = getDefaultInstance().getSerializedRequest(); + 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.showcase.v1beta1.Test.Blueprint.Invocation) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.Test.Blueprint.Invocation) + private static final com.google.showcase.v1beta1.Test.Blueprint.Invocation DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.Test.Blueprint.Invocation(); + } + + public static com.google.showcase.v1beta1.Test.Blueprint.Invocation getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Invocation 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.showcase.v1beta1.Test.Blueprint.Invocation getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + private int bitField0_; + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + + /** + * + * + *
        +     * The name of this blueprint.
        +     * 
        + * + * 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 name of this blueprint.
        +     * 
        + * + * 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_ = ""; + + /** + * + * + *
        +     * A description of this blueprint.
        +     * 
        + * + * 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; + } + } + + /** + * + * + *
        +     * A description of this blueprint.
        +     * 
        + * + * 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 REQUEST_FIELD_NUMBER = 3; + private com.google.showcase.v1beta1.Test.Blueprint.Invocation request_; + + /** + * + * + *
        +     * The initial request to trigger this test.
        +     * 
        + * + * .google.showcase.v1beta1.Test.Blueprint.Invocation request = 3; + * + * @return Whether the request field is set. + */ + @java.lang.Override + public boolean hasRequest() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
        +     * The initial request to trigger this test.
        +     * 
        + * + * .google.showcase.v1beta1.Test.Blueprint.Invocation request = 3; + * + * @return The request. + */ + @java.lang.Override + public com.google.showcase.v1beta1.Test.Blueprint.Invocation getRequest() { + return request_ == null + ? com.google.showcase.v1beta1.Test.Blueprint.Invocation.getDefaultInstance() + : request_; + } + + /** + * + * + *
        +     * The initial request to trigger this test.
        +     * 
        + * + * .google.showcase.v1beta1.Test.Blueprint.Invocation request = 3; + */ + @java.lang.Override + public com.google.showcase.v1beta1.Test.Blueprint.InvocationOrBuilder getRequestOrBuilder() { + return request_ == null + ? com.google.showcase.v1beta1.Test.Blueprint.Invocation.getDefaultInstance() + : request_; + } + + public static final int ADDITIONAL_REQUESTS_FIELD_NUMBER = 4; + + @SuppressWarnings("serial") + private java.util.List + additionalRequests_; + + /** + * + * + *
        +     * An ordered list of method calls that can be called to trigger this test.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Test.Blueprint.Invocation additional_requests = 4; + * + */ + @java.lang.Override + public java.util.List + getAdditionalRequestsList() { + return additionalRequests_; + } + + /** + * + * + *
        +     * An ordered list of method calls that can be called to trigger this test.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Test.Blueprint.Invocation additional_requests = 4; + * + */ + @java.lang.Override + public java.util.List + getAdditionalRequestsOrBuilderList() { + return additionalRequests_; + } + + /** + * + * + *
        +     * An ordered list of method calls that can be called to trigger this test.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Test.Blueprint.Invocation additional_requests = 4; + * + */ + @java.lang.Override + public int getAdditionalRequestsCount() { + return additionalRequests_.size(); + } + + /** + * + * + *
        +     * An ordered list of method calls that can be called to trigger this test.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Test.Blueprint.Invocation additional_requests = 4; + * + */ + @java.lang.Override + public com.google.showcase.v1beta1.Test.Blueprint.Invocation getAdditionalRequests(int index) { + return additionalRequests_.get(index); + } + + /** + * + * + *
        +     * An ordered list of method calls that can be called to trigger this test.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Test.Blueprint.Invocation additional_requests = 4; + * + */ + @java.lang.Override + public com.google.showcase.v1beta1.Test.Blueprint.InvocationOrBuilder + getAdditionalRequestsOrBuilder(int index) { + return additionalRequests_.get(index); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!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, getRequest()); + } + for (int i = 0; i < additionalRequests_.size(); i++) { + output.writeMessage(4, additionalRequests_.get(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(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, getRequest()); + } + for (int i = 0; i < additionalRequests_.size(); i++) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize(4, additionalRequests_.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.showcase.v1beta1.Test.Blueprint)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.Test.Blueprint other = + (com.google.showcase.v1beta1.Test.Blueprint) obj; + + if (!getName().equals(other.getName())) return false; + if (!getDescription().equals(other.getDescription())) return false; + if (hasRequest() != other.hasRequest()) return false; + if (hasRequest()) { + if (!getRequest().equals(other.getRequest())) return false; + } + if (!getAdditionalRequestsList().equals(other.getAdditionalRequestsList())) 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 (hasRequest()) { + hash = (37 * hash) + REQUEST_FIELD_NUMBER; + hash = (53 * hash) + getRequest().hashCode(); + } + if (getAdditionalRequestsCount() > 0) { + hash = (37 * hash) + ADDITIONAL_REQUESTS_FIELD_NUMBER; + hash = (53 * hash) + getAdditionalRequestsList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.showcase.v1beta1.Test.Blueprint parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.Test.Blueprint parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.Test.Blueprint parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.Test.Blueprint 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.showcase.v1beta1.Test.Blueprint parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.Test.Blueprint parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.Test.Blueprint parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.Test.Blueprint 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.showcase.v1beta1.Test.Blueprint parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.Test.Blueprint 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.showcase.v1beta1.Test.Blueprint parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.Test.Blueprint 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.showcase.v1beta1.Test.Blueprint prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
        +     * A blueprint is an explicit definition of methods and requests that are needed
        +     * to be made to test this specific test case. Ideally this would be represented
        +     * by something more robust like CEL, but as of writing this, I am unsure if CEL
        +     * is ready.
        +     * 
        + * + * Protobuf type {@code google.showcase.v1beta1.Test.Blueprint} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.Test.Blueprint) + com.google.showcase.v1beta1.Test.BlueprintOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.TestingOuterClass + .internal_static_google_showcase_v1beta1_Test_Blueprint_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.TestingOuterClass + .internal_static_google_showcase_v1beta1_Test_Blueprint_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.Test.Blueprint.class, + com.google.showcase.v1beta1.Test.Blueprint.Builder.class); + } + + // Construct using com.google.showcase.v1beta1.Test.Blueprint.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getRequestFieldBuilder(); + getAdditionalRequestsFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + description_ = ""; + request_ = null; + if (requestBuilder_ != null) { + requestBuilder_.dispose(); + requestBuilder_ = null; + } + if (additionalRequestsBuilder_ == null) { + additionalRequests_ = java.util.Collections.emptyList(); + } else { + additionalRequests_ = null; + additionalRequestsBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000008); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.showcase.v1beta1.TestingOuterClass + .internal_static_google_showcase_v1beta1_Test_Blueprint_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.Test.Blueprint getDefaultInstanceForType() { + return com.google.showcase.v1beta1.Test.Blueprint.getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.Test.Blueprint build() { + com.google.showcase.v1beta1.Test.Blueprint result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.Test.Blueprint buildPartial() { + com.google.showcase.v1beta1.Test.Blueprint result = + new com.google.showcase.v1beta1.Test.Blueprint(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields(com.google.showcase.v1beta1.Test.Blueprint result) { + if (additionalRequestsBuilder_ == null) { + if (((bitField0_ & 0x00000008) != 0)) { + additionalRequests_ = java.util.Collections.unmodifiableList(additionalRequests_); + bitField0_ = (bitField0_ & ~0x00000008); + } + result.additionalRequests_ = additionalRequests_; + } else { + result.additionalRequests_ = additionalRequestsBuilder_.build(); + } + } + + private void buildPartial0(com.google.showcase.v1beta1.Test.Blueprint 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.request_ = requestBuilder_ == null ? request_ : requestBuilder_.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.showcase.v1beta1.Test.Blueprint) { + return mergeFrom((com.google.showcase.v1beta1.Test.Blueprint) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.showcase.v1beta1.Test.Blueprint other) { + if (other == com.google.showcase.v1beta1.Test.Blueprint.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.hasRequest()) { + mergeRequest(other.getRequest()); + } + if (additionalRequestsBuilder_ == null) { + if (!other.additionalRequests_.isEmpty()) { + if (additionalRequests_.isEmpty()) { + additionalRequests_ = other.additionalRequests_; + bitField0_ = (bitField0_ & ~0x00000008); + } else { + ensureAdditionalRequestsIsMutable(); + additionalRequests_.addAll(other.additionalRequests_); + } + onChanged(); + } + } else { + if (!other.additionalRequests_.isEmpty()) { + if (additionalRequestsBuilder_.isEmpty()) { + additionalRequestsBuilder_.dispose(); + additionalRequestsBuilder_ = null; + additionalRequests_ = other.additionalRequests_; + bitField0_ = (bitField0_ & ~0x00000008); + additionalRequestsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getAdditionalRequestsFieldBuilder() + : null; + } else { + additionalRequestsBuilder_.addAllMessages(other.additionalRequests_); + } + } + } + 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(getRequestFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 34: + { + com.google.showcase.v1beta1.Test.Blueprint.Invocation m = + input.readMessage( + com.google.showcase.v1beta1.Test.Blueprint.Invocation.parser(), + extensionRegistry); + if (additionalRequestsBuilder_ == null) { + ensureAdditionalRequestsIsMutable(); + additionalRequests_.add(m); + } else { + additionalRequestsBuilder_.addMessage(m); + } + 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_ = ""; + + /** + * + * + *
        +       * The name of this blueprint.
        +       * 
        + * + * 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 name of this blueprint.
        +       * 
        + * + * 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 name of this blueprint.
        +       * 
        + * + * 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 name of this blueprint.
        +       * 
        + * + * string name = 1; + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
        +       * The name of this blueprint.
        +       * 
        + * + * 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_ = ""; + + /** + * + * + *
        +       * A description of this blueprint.
        +       * 
        + * + * 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; + } + } + + /** + * + * + *
        +       * A description of this blueprint.
        +       * 
        + * + * 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; + } + } + + /** + * + * + *
        +       * A description of this blueprint.
        +       * 
        + * + * 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; + } + + /** + * + * + *
        +       * A description of this blueprint.
        +       * 
        + * + * string description = 2; + * + * @return This builder for chaining. + */ + public Builder clearDescription() { + description_ = getDefaultInstance().getDescription(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
        +       * A description of this blueprint.
        +       * 
        + * + * 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.showcase.v1beta1.Test.Blueprint.Invocation request_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.showcase.v1beta1.Test.Blueprint.Invocation, + com.google.showcase.v1beta1.Test.Blueprint.Invocation.Builder, + com.google.showcase.v1beta1.Test.Blueprint.InvocationOrBuilder> + requestBuilder_; + + /** + * + * + *
        +       * The initial request to trigger this test.
        +       * 
        + * + * .google.showcase.v1beta1.Test.Blueprint.Invocation request = 3; + * + * @return Whether the request field is set. + */ + public boolean hasRequest() { + return ((bitField0_ & 0x00000004) != 0); + } + + /** + * + * + *
        +       * The initial request to trigger this test.
        +       * 
        + * + * .google.showcase.v1beta1.Test.Blueprint.Invocation request = 3; + * + * @return The request. + */ + public com.google.showcase.v1beta1.Test.Blueprint.Invocation getRequest() { + if (requestBuilder_ == null) { + return request_ == null + ? com.google.showcase.v1beta1.Test.Blueprint.Invocation.getDefaultInstance() + : request_; + } else { + return requestBuilder_.getMessage(); + } + } + + /** + * + * + *
        +       * The initial request to trigger this test.
        +       * 
        + * + * .google.showcase.v1beta1.Test.Blueprint.Invocation request = 3; + */ + public Builder setRequest(com.google.showcase.v1beta1.Test.Blueprint.Invocation value) { + if (requestBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + request_ = value; + } else { + requestBuilder_.setMessage(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
        +       * The initial request to trigger this test.
        +       * 
        + * + * .google.showcase.v1beta1.Test.Blueprint.Invocation request = 3; + */ + public Builder setRequest( + com.google.showcase.v1beta1.Test.Blueprint.Invocation.Builder builderForValue) { + if (requestBuilder_ == null) { + request_ = builderForValue.build(); + } else { + requestBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
        +       * The initial request to trigger this test.
        +       * 
        + * + * .google.showcase.v1beta1.Test.Blueprint.Invocation request = 3; + */ + public Builder mergeRequest(com.google.showcase.v1beta1.Test.Blueprint.Invocation value) { + if (requestBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0) + && request_ != null + && request_ + != com.google.showcase.v1beta1.Test.Blueprint.Invocation.getDefaultInstance()) { + getRequestBuilder().mergeFrom(value); + } else { + request_ = value; + } + } else { + requestBuilder_.mergeFrom(value); + } + if (request_ != null) { + bitField0_ |= 0x00000004; + onChanged(); + } + return this; + } + + /** + * + * + *
        +       * The initial request to trigger this test.
        +       * 
        + * + * .google.showcase.v1beta1.Test.Blueprint.Invocation request = 3; + */ + public Builder clearRequest() { + bitField0_ = (bitField0_ & ~0x00000004); + request_ = null; + if (requestBuilder_ != null) { + requestBuilder_.dispose(); + requestBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
        +       * The initial request to trigger this test.
        +       * 
        + * + * .google.showcase.v1beta1.Test.Blueprint.Invocation request = 3; + */ + public com.google.showcase.v1beta1.Test.Blueprint.Invocation.Builder getRequestBuilder() { + bitField0_ |= 0x00000004; + onChanged(); + return getRequestFieldBuilder().getBuilder(); + } + + /** + * + * + *
        +       * The initial request to trigger this test.
        +       * 
        + * + * .google.showcase.v1beta1.Test.Blueprint.Invocation request = 3; + */ + public com.google.showcase.v1beta1.Test.Blueprint.InvocationOrBuilder getRequestOrBuilder() { + if (requestBuilder_ != null) { + return requestBuilder_.getMessageOrBuilder(); + } else { + return request_ == null + ? com.google.showcase.v1beta1.Test.Blueprint.Invocation.getDefaultInstance() + : request_; + } + } + + /** + * + * + *
        +       * The initial request to trigger this test.
        +       * 
        + * + * .google.showcase.v1beta1.Test.Blueprint.Invocation request = 3; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.showcase.v1beta1.Test.Blueprint.Invocation, + com.google.showcase.v1beta1.Test.Blueprint.Invocation.Builder, + com.google.showcase.v1beta1.Test.Blueprint.InvocationOrBuilder> + getRequestFieldBuilder() { + if (requestBuilder_ == null) { + requestBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.showcase.v1beta1.Test.Blueprint.Invocation, + com.google.showcase.v1beta1.Test.Blueprint.Invocation.Builder, + com.google.showcase.v1beta1.Test.Blueprint.InvocationOrBuilder>( + getRequest(), getParentForChildren(), isClean()); + request_ = null; + } + return requestBuilder_; + } + + private java.util.List + additionalRequests_ = java.util.Collections.emptyList(); + + private void ensureAdditionalRequestsIsMutable() { + if (!((bitField0_ & 0x00000008) != 0)) { + additionalRequests_ = + new java.util.ArrayList( + additionalRequests_); + bitField0_ |= 0x00000008; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.showcase.v1beta1.Test.Blueprint.Invocation, + com.google.showcase.v1beta1.Test.Blueprint.Invocation.Builder, + com.google.showcase.v1beta1.Test.Blueprint.InvocationOrBuilder> + additionalRequestsBuilder_; + + /** + * + * + *
        +       * An ordered list of method calls that can be called to trigger this test.
        +       * 
        + * + * repeated .google.showcase.v1beta1.Test.Blueprint.Invocation additional_requests = 4; + * + */ + public java.util.List + getAdditionalRequestsList() { + if (additionalRequestsBuilder_ == null) { + return java.util.Collections.unmodifiableList(additionalRequests_); + } else { + return additionalRequestsBuilder_.getMessageList(); + } + } + + /** + * + * + *
        +       * An ordered list of method calls that can be called to trigger this test.
        +       * 
        + * + * repeated .google.showcase.v1beta1.Test.Blueprint.Invocation additional_requests = 4; + * + */ + public int getAdditionalRequestsCount() { + if (additionalRequestsBuilder_ == null) { + return additionalRequests_.size(); + } else { + return additionalRequestsBuilder_.getCount(); + } + } + + /** + * + * + *
        +       * An ordered list of method calls that can be called to trigger this test.
        +       * 
        + * + * repeated .google.showcase.v1beta1.Test.Blueprint.Invocation additional_requests = 4; + * + */ + public com.google.showcase.v1beta1.Test.Blueprint.Invocation getAdditionalRequests( + int index) { + if (additionalRequestsBuilder_ == null) { + return additionalRequests_.get(index); + } else { + return additionalRequestsBuilder_.getMessage(index); + } + } + + /** + * + * + *
        +       * An ordered list of method calls that can be called to trigger this test.
        +       * 
        + * + * repeated .google.showcase.v1beta1.Test.Blueprint.Invocation additional_requests = 4; + * + */ + public Builder setAdditionalRequests( + int index, com.google.showcase.v1beta1.Test.Blueprint.Invocation value) { + if (additionalRequestsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureAdditionalRequestsIsMutable(); + additionalRequests_.set(index, value); + onChanged(); + } else { + additionalRequestsBuilder_.setMessage(index, value); + } + return this; + } + + /** + * + * + *
        +       * An ordered list of method calls that can be called to trigger this test.
        +       * 
        + * + * repeated .google.showcase.v1beta1.Test.Blueprint.Invocation additional_requests = 4; + * + */ + public Builder setAdditionalRequests( + int index, + com.google.showcase.v1beta1.Test.Blueprint.Invocation.Builder builderForValue) { + if (additionalRequestsBuilder_ == null) { + ensureAdditionalRequestsIsMutable(); + additionalRequests_.set(index, builderForValue.build()); + onChanged(); + } else { + additionalRequestsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
        +       * An ordered list of method calls that can be called to trigger this test.
        +       * 
        + * + * repeated .google.showcase.v1beta1.Test.Blueprint.Invocation additional_requests = 4; + * + */ + public Builder addAdditionalRequests( + com.google.showcase.v1beta1.Test.Blueprint.Invocation value) { + if (additionalRequestsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureAdditionalRequestsIsMutable(); + additionalRequests_.add(value); + onChanged(); + } else { + additionalRequestsBuilder_.addMessage(value); + } + return this; + } + + /** + * + * + *
        +       * An ordered list of method calls that can be called to trigger this test.
        +       * 
        + * + * repeated .google.showcase.v1beta1.Test.Blueprint.Invocation additional_requests = 4; + * + */ + public Builder addAdditionalRequests( + int index, com.google.showcase.v1beta1.Test.Blueprint.Invocation value) { + if (additionalRequestsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureAdditionalRequestsIsMutable(); + additionalRequests_.add(index, value); + onChanged(); + } else { + additionalRequestsBuilder_.addMessage(index, value); + } + return this; + } + + /** + * + * + *
        +       * An ordered list of method calls that can be called to trigger this test.
        +       * 
        + * + * repeated .google.showcase.v1beta1.Test.Blueprint.Invocation additional_requests = 4; + * + */ + public Builder addAdditionalRequests( + com.google.showcase.v1beta1.Test.Blueprint.Invocation.Builder builderForValue) { + if (additionalRequestsBuilder_ == null) { + ensureAdditionalRequestsIsMutable(); + additionalRequests_.add(builderForValue.build()); + onChanged(); + } else { + additionalRequestsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + + /** + * + * + *
        +       * An ordered list of method calls that can be called to trigger this test.
        +       * 
        + * + * repeated .google.showcase.v1beta1.Test.Blueprint.Invocation additional_requests = 4; + * + */ + public Builder addAdditionalRequests( + int index, + com.google.showcase.v1beta1.Test.Blueprint.Invocation.Builder builderForValue) { + if (additionalRequestsBuilder_ == null) { + ensureAdditionalRequestsIsMutable(); + additionalRequests_.add(index, builderForValue.build()); + onChanged(); + } else { + additionalRequestsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
        +       * An ordered list of method calls that can be called to trigger this test.
        +       * 
        + * + * repeated .google.showcase.v1beta1.Test.Blueprint.Invocation additional_requests = 4; + * + */ + public Builder addAllAdditionalRequests( + java.lang.Iterable + values) { + if (additionalRequestsBuilder_ == null) { + ensureAdditionalRequestsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, additionalRequests_); + onChanged(); + } else { + additionalRequestsBuilder_.addAllMessages(values); + } + return this; + } + + /** + * + * + *
        +       * An ordered list of method calls that can be called to trigger this test.
        +       * 
        + * + * repeated .google.showcase.v1beta1.Test.Blueprint.Invocation additional_requests = 4; + * + */ + public Builder clearAdditionalRequests() { + if (additionalRequestsBuilder_ == null) { + additionalRequests_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + } else { + additionalRequestsBuilder_.clear(); + } + return this; + } + + /** + * + * + *
        +       * An ordered list of method calls that can be called to trigger this test.
        +       * 
        + * + * repeated .google.showcase.v1beta1.Test.Blueprint.Invocation additional_requests = 4; + * + */ + public Builder removeAdditionalRequests(int index) { + if (additionalRequestsBuilder_ == null) { + ensureAdditionalRequestsIsMutable(); + additionalRequests_.remove(index); + onChanged(); + } else { + additionalRequestsBuilder_.remove(index); + } + return this; + } + + /** + * + * + *
        +       * An ordered list of method calls that can be called to trigger this test.
        +       * 
        + * + * repeated .google.showcase.v1beta1.Test.Blueprint.Invocation additional_requests = 4; + * + */ + public com.google.showcase.v1beta1.Test.Blueprint.Invocation.Builder + getAdditionalRequestsBuilder(int index) { + return getAdditionalRequestsFieldBuilder().getBuilder(index); + } + + /** + * + * + *
        +       * An ordered list of method calls that can be called to trigger this test.
        +       * 
        + * + * repeated .google.showcase.v1beta1.Test.Blueprint.Invocation additional_requests = 4; + * + */ + public com.google.showcase.v1beta1.Test.Blueprint.InvocationOrBuilder + getAdditionalRequestsOrBuilder(int index) { + if (additionalRequestsBuilder_ == null) { + return additionalRequests_.get(index); + } else { + return additionalRequestsBuilder_.getMessageOrBuilder(index); + } + } + + /** + * + * + *
        +       * An ordered list of method calls that can be called to trigger this test.
        +       * 
        + * + * repeated .google.showcase.v1beta1.Test.Blueprint.Invocation additional_requests = 4; + * + */ + public java.util.List< + ? extends com.google.showcase.v1beta1.Test.Blueprint.InvocationOrBuilder> + getAdditionalRequestsOrBuilderList() { + if (additionalRequestsBuilder_ != null) { + return additionalRequestsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(additionalRequests_); + } + } + + /** + * + * + *
        +       * An ordered list of method calls that can be called to trigger this test.
        +       * 
        + * + * repeated .google.showcase.v1beta1.Test.Blueprint.Invocation additional_requests = 4; + * + */ + public com.google.showcase.v1beta1.Test.Blueprint.Invocation.Builder + addAdditionalRequestsBuilder() { + return getAdditionalRequestsFieldBuilder() + .addBuilder(com.google.showcase.v1beta1.Test.Blueprint.Invocation.getDefaultInstance()); + } + + /** + * + * + *
        +       * An ordered list of method calls that can be called to trigger this test.
        +       * 
        + * + * repeated .google.showcase.v1beta1.Test.Blueprint.Invocation additional_requests = 4; + * + */ + public com.google.showcase.v1beta1.Test.Blueprint.Invocation.Builder + addAdditionalRequestsBuilder(int index) { + return getAdditionalRequestsFieldBuilder() + .addBuilder( + index, com.google.showcase.v1beta1.Test.Blueprint.Invocation.getDefaultInstance()); + } + + /** + * + * + *
        +       * An ordered list of method calls that can be called to trigger this test.
        +       * 
        + * + * repeated .google.showcase.v1beta1.Test.Blueprint.Invocation additional_requests = 4; + * + */ + public java.util.List + getAdditionalRequestsBuilderList() { + return getAdditionalRequestsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.showcase.v1beta1.Test.Blueprint.Invocation, + com.google.showcase.v1beta1.Test.Blueprint.Invocation.Builder, + com.google.showcase.v1beta1.Test.Blueprint.InvocationOrBuilder> + getAdditionalRequestsFieldBuilder() { + if (additionalRequestsBuilder_ == null) { + additionalRequestsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.showcase.v1beta1.Test.Blueprint.Invocation, + com.google.showcase.v1beta1.Test.Blueprint.Invocation.Builder, + com.google.showcase.v1beta1.Test.Blueprint.InvocationOrBuilder>( + additionalRequests_, + ((bitField0_ & 0x00000008) != 0), + getParentForChildren(), + isClean()); + additionalRequests_ = null; + } + return additionalRequestsBuilder_; + } + + @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.showcase.v1beta1.Test.Blueprint) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.Test.Blueprint) + private static final com.google.showcase.v1beta1.Test.Blueprint DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.Test.Blueprint(); + } + + public static com.google.showcase.v1beta1.Test.Blueprint getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Blueprint 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.showcase.v1beta1.Test.Blueprint getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + + /** + * + * + *
        +   * The name of the test.
        +   * The tests/* portion of the names are hard-coded, and do not change
        +   * from session to session.
        +   * 
        + * + * 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 name of the test.
        +   * The tests/* portion of the names are hard-coded, and do not change
        +   * from session to session.
        +   * 
        + * + * 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 EXPECTATION_LEVEL_FIELD_NUMBER = 2; + private int expectationLevel_ = 0; + + /** + * + * + *
        +   * The expectation level for this test.
        +   * 
        + * + * .google.showcase.v1beta1.Test.ExpectationLevel expectation_level = 2; + * + * @return The enum numeric value on the wire for expectationLevel. + */ + @java.lang.Override + public int getExpectationLevelValue() { + return expectationLevel_; + } + + /** + * + * + *
        +   * The expectation level for this test.
        +   * 
        + * + * .google.showcase.v1beta1.Test.ExpectationLevel expectation_level = 2; + * + * @return The expectationLevel. + */ + @java.lang.Override + public com.google.showcase.v1beta1.Test.ExpectationLevel getExpectationLevel() { + com.google.showcase.v1beta1.Test.ExpectationLevel result = + com.google.showcase.v1beta1.Test.ExpectationLevel.forNumber(expectationLevel_); + return result == null ? com.google.showcase.v1beta1.Test.ExpectationLevel.UNRECOGNIZED : result; + } + + public static final int DESCRIPTION_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object description_ = ""; + + /** + * + * + *
        +   * A description of the test.
        +   * 
        + * + * 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; + } + } + + /** + * + * + *
        +   * A description of the test.
        +   * 
        + * + * 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 BLUEPRINTS_FIELD_NUMBER = 4; + + @SuppressWarnings("serial") + private java.util.List blueprints_; + + /** + * + * + *
        +   * The blueprints that will satisfy this test. There may be multiple blueprints
        +   * that can signal to the server that this test case is being exercised. Although
        +   * multiple blueprints are specified, only a single blueprint needs to be run to
        +   * signal that the test case was exercised.
        +   * 
        + * + * repeated .google.showcase.v1beta1.Test.Blueprint blueprints = 4; + */ + @java.lang.Override + public java.util.List getBlueprintsList() { + return blueprints_; + } + + /** + * + * + *
        +   * The blueprints that will satisfy this test. There may be multiple blueprints
        +   * that can signal to the server that this test case is being exercised. Although
        +   * multiple blueprints are specified, only a single blueprint needs to be run to
        +   * signal that the test case was exercised.
        +   * 
        + * + * repeated .google.showcase.v1beta1.Test.Blueprint blueprints = 4; + */ + @java.lang.Override + public java.util.List + getBlueprintsOrBuilderList() { + return blueprints_; + } + + /** + * + * + *
        +   * The blueprints that will satisfy this test. There may be multiple blueprints
        +   * that can signal to the server that this test case is being exercised. Although
        +   * multiple blueprints are specified, only a single blueprint needs to be run to
        +   * signal that the test case was exercised.
        +   * 
        + * + * repeated .google.showcase.v1beta1.Test.Blueprint blueprints = 4; + */ + @java.lang.Override + public int getBlueprintsCount() { + return blueprints_.size(); + } + + /** + * + * + *
        +   * The blueprints that will satisfy this test. There may be multiple blueprints
        +   * that can signal to the server that this test case is being exercised. Although
        +   * multiple blueprints are specified, only a single blueprint needs to be run to
        +   * signal that the test case was exercised.
        +   * 
        + * + * repeated .google.showcase.v1beta1.Test.Blueprint blueprints = 4; + */ + @java.lang.Override + public com.google.showcase.v1beta1.Test.Blueprint getBlueprints(int index) { + return blueprints_.get(index); + } + + /** + * + * + *
        +   * The blueprints that will satisfy this test. There may be multiple blueprints
        +   * that can signal to the server that this test case is being exercised. Although
        +   * multiple blueprints are specified, only a single blueprint needs to be run to
        +   * signal that the test case was exercised.
        +   * 
        + * + * repeated .google.showcase.v1beta1.Test.Blueprint blueprints = 4; + */ + @java.lang.Override + public com.google.showcase.v1beta1.Test.BlueprintOrBuilder getBlueprintsOrBuilder(int index) { + return blueprints_.get(index); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + if (expectationLevel_ + != com.google.showcase.v1beta1.Test.ExpectationLevel.EXPECTATION_LEVEL_UNSPECIFIED + .getNumber()) { + output.writeEnum(2, expectationLevel_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(description_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, description_); + } + for (int i = 0; i < blueprints_.size(); i++) { + output.writeMessage(4, blueprints_.get(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(name_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + if (expectationLevel_ + != com.google.showcase.v1beta1.Test.ExpectationLevel.EXPECTATION_LEVEL_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(2, expectationLevel_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(description_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, description_); + } + for (int i = 0; i < blueprints_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, blueprints_.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.showcase.v1beta1.Test)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.Test other = (com.google.showcase.v1beta1.Test) obj; + + if (!getName().equals(other.getName())) return false; + if (expectationLevel_ != other.expectationLevel_) return false; + if (!getDescription().equals(other.getDescription())) return false; + if (!getBlueprintsList().equals(other.getBlueprintsList())) 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) + EXPECTATION_LEVEL_FIELD_NUMBER; + hash = (53 * hash) + expectationLevel_; + hash = (37 * hash) + DESCRIPTION_FIELD_NUMBER; + hash = (53 * hash) + getDescription().hashCode(); + if (getBlueprintsCount() > 0) { + hash = (37 * hash) + BLUEPRINTS_FIELD_NUMBER; + hash = (53 * hash) + getBlueprintsList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.showcase.v1beta1.Test parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.Test parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.Test parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.Test 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.showcase.v1beta1.Test parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.Test parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.Test parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.Test 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.showcase.v1beta1.Test parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.Test 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.showcase.v1beta1.Test parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.Test 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.showcase.v1beta1.Test prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** Protobuf type {@code google.showcase.v1beta1.Test} */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.Test) + com.google.showcase.v1beta1.TestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.TestingOuterClass + .internal_static_google_showcase_v1beta1_Test_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.TestingOuterClass + .internal_static_google_showcase_v1beta1_Test_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.Test.class, + com.google.showcase.v1beta1.Test.Builder.class); + } + + // Construct using com.google.showcase.v1beta1.Test.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + expectationLevel_ = 0; + description_ = ""; + if (blueprintsBuilder_ == null) { + blueprints_ = java.util.Collections.emptyList(); + } else { + blueprints_ = null; + blueprintsBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000008); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.showcase.v1beta1.TestingOuterClass + .internal_static_google_showcase_v1beta1_Test_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.Test getDefaultInstanceForType() { + return com.google.showcase.v1beta1.Test.getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.Test build() { + com.google.showcase.v1beta1.Test result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.Test buildPartial() { + com.google.showcase.v1beta1.Test result = new com.google.showcase.v1beta1.Test(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields(com.google.showcase.v1beta1.Test result) { + if (blueprintsBuilder_ == null) { + if (((bitField0_ & 0x00000008) != 0)) { + blueprints_ = java.util.Collections.unmodifiableList(blueprints_); + bitField0_ = (bitField0_ & ~0x00000008); + } + result.blueprints_ = blueprints_; + } else { + result.blueprints_ = blueprintsBuilder_.build(); + } + } + + private void buildPartial0(com.google.showcase.v1beta1.Test result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.expectationLevel_ = expectationLevel_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.description_ = description_; + } + } + + @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.showcase.v1beta1.Test) { + return mergeFrom((com.google.showcase.v1beta1.Test) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.showcase.v1beta1.Test other) { + if (other == com.google.showcase.v1beta1.Test.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.expectationLevel_ != 0) { + setExpectationLevelValue(other.getExpectationLevelValue()); + } + if (!other.getDescription().isEmpty()) { + description_ = other.description_; + bitField0_ |= 0x00000004; + onChanged(); + } + if (blueprintsBuilder_ == null) { + if (!other.blueprints_.isEmpty()) { + if (blueprints_.isEmpty()) { + blueprints_ = other.blueprints_; + bitField0_ = (bitField0_ & ~0x00000008); + } else { + ensureBlueprintsIsMutable(); + blueprints_.addAll(other.blueprints_); + } + onChanged(); + } + } else { + if (!other.blueprints_.isEmpty()) { + if (blueprintsBuilder_.isEmpty()) { + blueprintsBuilder_.dispose(); + blueprintsBuilder_ = null; + blueprints_ = other.blueprints_; + bitField0_ = (bitField0_ & ~0x00000008); + blueprintsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getBlueprintsFieldBuilder() + : null; + } else { + blueprintsBuilder_.addAllMessages(other.blueprints_); + } + } + } + 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 16: + { + expectationLevel_ = input.readEnum(); + bitField0_ |= 0x00000002; + break; + } // case 16 + case 26: + { + description_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 34: + { + com.google.showcase.v1beta1.Test.Blueprint m = + input.readMessage( + com.google.showcase.v1beta1.Test.Blueprint.parser(), extensionRegistry); + if (blueprintsBuilder_ == null) { + ensureBlueprintsIsMutable(); + blueprints_.add(m); + } else { + blueprintsBuilder_.addMessage(m); + } + 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_ = ""; + + /** + * + * + *
        +     * The name of the test.
        +     * The tests/* portion of the names are hard-coded, and do not change
        +     * from session to session.
        +     * 
        + * + * 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 name of the test.
        +     * The tests/* portion of the names are hard-coded, and do not change
        +     * from session to session.
        +     * 
        + * + * 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 name of the test.
        +     * The tests/* portion of the names are hard-coded, and do not change
        +     * from session to session.
        +     * 
        + * + * 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 name of the test.
        +     * The tests/* portion of the names are hard-coded, and do not change
        +     * from session to session.
        +     * 
        + * + * string name = 1; + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
        +     * The name of the test.
        +     * The tests/* portion of the names are hard-coded, and do not change
        +     * from session to session.
        +     * 
        + * + * 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 int expectationLevel_ = 0; + + /** + * + * + *
        +     * The expectation level for this test.
        +     * 
        + * + * .google.showcase.v1beta1.Test.ExpectationLevel expectation_level = 2; + * + * @return The enum numeric value on the wire for expectationLevel. + */ + @java.lang.Override + public int getExpectationLevelValue() { + return expectationLevel_; + } + + /** + * + * + *
        +     * The expectation level for this test.
        +     * 
        + * + * .google.showcase.v1beta1.Test.ExpectationLevel expectation_level = 2; + * + * @param value The enum numeric value on the wire for expectationLevel to set. + * @return This builder for chaining. + */ + public Builder setExpectationLevelValue(int value) { + expectationLevel_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
        +     * The expectation level for this test.
        +     * 
        + * + * .google.showcase.v1beta1.Test.ExpectationLevel expectation_level = 2; + * + * @return The expectationLevel. + */ + @java.lang.Override + public com.google.showcase.v1beta1.Test.ExpectationLevel getExpectationLevel() { + com.google.showcase.v1beta1.Test.ExpectationLevel result = + com.google.showcase.v1beta1.Test.ExpectationLevel.forNumber(expectationLevel_); + return result == null + ? com.google.showcase.v1beta1.Test.ExpectationLevel.UNRECOGNIZED + : result; + } + + /** + * + * + *
        +     * The expectation level for this test.
        +     * 
        + * + * .google.showcase.v1beta1.Test.ExpectationLevel expectation_level = 2; + * + * @param value The expectationLevel to set. + * @return This builder for chaining. + */ + public Builder setExpectationLevel(com.google.showcase.v1beta1.Test.ExpectationLevel value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000002; + expectationLevel_ = value.getNumber(); + onChanged(); + return this; + } + + /** + * + * + *
        +     * The expectation level for this test.
        +     * 
        + * + * .google.showcase.v1beta1.Test.ExpectationLevel expectation_level = 2; + * + * @return This builder for chaining. + */ + public Builder clearExpectationLevel() { + bitField0_ = (bitField0_ & ~0x00000002); + expectationLevel_ = 0; + onChanged(); + return this; + } + + private java.lang.Object description_ = ""; + + /** + * + * + *
        +     * A description of the test.
        +     * 
        + * + * 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; + } + } + + /** + * + * + *
        +     * A description of the test.
        +     * 
        + * + * 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; + } + } + + /** + * + * + *
        +     * A description of the test.
        +     * 
        + * + * 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_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
        +     * A description of the test.
        +     * 
        + * + * string description = 3; + * + * @return This builder for chaining. + */ + public Builder clearDescription() { + description_ = getDefaultInstance().getDescription(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + + /** + * + * + *
        +     * A description of the test.
        +     * 
        + * + * 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_ |= 0x00000004; + onChanged(); + return this; + } + + private java.util.List blueprints_ = + java.util.Collections.emptyList(); + + private void ensureBlueprintsIsMutable() { + if (!((bitField0_ & 0x00000008) != 0)) { + blueprints_ = + new java.util.ArrayList(blueprints_); + bitField0_ |= 0x00000008; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.showcase.v1beta1.Test.Blueprint, + com.google.showcase.v1beta1.Test.Blueprint.Builder, + com.google.showcase.v1beta1.Test.BlueprintOrBuilder> + blueprintsBuilder_; + + /** + * + * + *
        +     * The blueprints that will satisfy this test. There may be multiple blueprints
        +     * that can signal to the server that this test case is being exercised. Although
        +     * multiple blueprints are specified, only a single blueprint needs to be run to
        +     * signal that the test case was exercised.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Test.Blueprint blueprints = 4; + */ + public java.util.List getBlueprintsList() { + if (blueprintsBuilder_ == null) { + return java.util.Collections.unmodifiableList(blueprints_); + } else { + return blueprintsBuilder_.getMessageList(); + } + } + + /** + * + * + *
        +     * The blueprints that will satisfy this test. There may be multiple blueprints
        +     * that can signal to the server that this test case is being exercised. Although
        +     * multiple blueprints are specified, only a single blueprint needs to be run to
        +     * signal that the test case was exercised.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Test.Blueprint blueprints = 4; + */ + public int getBlueprintsCount() { + if (blueprintsBuilder_ == null) { + return blueprints_.size(); + } else { + return blueprintsBuilder_.getCount(); + } + } + + /** + * + * + *
        +     * The blueprints that will satisfy this test. There may be multiple blueprints
        +     * that can signal to the server that this test case is being exercised. Although
        +     * multiple blueprints are specified, only a single blueprint needs to be run to
        +     * signal that the test case was exercised.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Test.Blueprint blueprints = 4; + */ + public com.google.showcase.v1beta1.Test.Blueprint getBlueprints(int index) { + if (blueprintsBuilder_ == null) { + return blueprints_.get(index); + } else { + return blueprintsBuilder_.getMessage(index); + } + } + + /** + * + * + *
        +     * The blueprints that will satisfy this test. There may be multiple blueprints
        +     * that can signal to the server that this test case is being exercised. Although
        +     * multiple blueprints are specified, only a single blueprint needs to be run to
        +     * signal that the test case was exercised.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Test.Blueprint blueprints = 4; + */ + public Builder setBlueprints(int index, com.google.showcase.v1beta1.Test.Blueprint value) { + if (blueprintsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureBlueprintsIsMutable(); + blueprints_.set(index, value); + onChanged(); + } else { + blueprintsBuilder_.setMessage(index, value); + } + return this; + } + + /** + * + * + *
        +     * The blueprints that will satisfy this test. There may be multiple blueprints
        +     * that can signal to the server that this test case is being exercised. Although
        +     * multiple blueprints are specified, only a single blueprint needs to be run to
        +     * signal that the test case was exercised.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Test.Blueprint blueprints = 4; + */ + public Builder setBlueprints( + int index, com.google.showcase.v1beta1.Test.Blueprint.Builder builderForValue) { + if (blueprintsBuilder_ == null) { + ensureBlueprintsIsMutable(); + blueprints_.set(index, builderForValue.build()); + onChanged(); + } else { + blueprintsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
        +     * The blueprints that will satisfy this test. There may be multiple blueprints
        +     * that can signal to the server that this test case is being exercised. Although
        +     * multiple blueprints are specified, only a single blueprint needs to be run to
        +     * signal that the test case was exercised.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Test.Blueprint blueprints = 4; + */ + public Builder addBlueprints(com.google.showcase.v1beta1.Test.Blueprint value) { + if (blueprintsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureBlueprintsIsMutable(); + blueprints_.add(value); + onChanged(); + } else { + blueprintsBuilder_.addMessage(value); + } + return this; + } + + /** + * + * + *
        +     * The blueprints that will satisfy this test. There may be multiple blueprints
        +     * that can signal to the server that this test case is being exercised. Although
        +     * multiple blueprints are specified, only a single blueprint needs to be run to
        +     * signal that the test case was exercised.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Test.Blueprint blueprints = 4; + */ + public Builder addBlueprints(int index, com.google.showcase.v1beta1.Test.Blueprint value) { + if (blueprintsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureBlueprintsIsMutable(); + blueprints_.add(index, value); + onChanged(); + } else { + blueprintsBuilder_.addMessage(index, value); + } + return this; + } + + /** + * + * + *
        +     * The blueprints that will satisfy this test. There may be multiple blueprints
        +     * that can signal to the server that this test case is being exercised. Although
        +     * multiple blueprints are specified, only a single blueprint needs to be run to
        +     * signal that the test case was exercised.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Test.Blueprint blueprints = 4; + */ + public Builder addBlueprints( + com.google.showcase.v1beta1.Test.Blueprint.Builder builderForValue) { + if (blueprintsBuilder_ == null) { + ensureBlueprintsIsMutable(); + blueprints_.add(builderForValue.build()); + onChanged(); + } else { + blueprintsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + + /** + * + * + *
        +     * The blueprints that will satisfy this test. There may be multiple blueprints
        +     * that can signal to the server that this test case is being exercised. Although
        +     * multiple blueprints are specified, only a single blueprint needs to be run to
        +     * signal that the test case was exercised.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Test.Blueprint blueprints = 4; + */ + public Builder addBlueprints( + int index, com.google.showcase.v1beta1.Test.Blueprint.Builder builderForValue) { + if (blueprintsBuilder_ == null) { + ensureBlueprintsIsMutable(); + blueprints_.add(index, builderForValue.build()); + onChanged(); + } else { + blueprintsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
        +     * The blueprints that will satisfy this test. There may be multiple blueprints
        +     * that can signal to the server that this test case is being exercised. Although
        +     * multiple blueprints are specified, only a single blueprint needs to be run to
        +     * signal that the test case was exercised.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Test.Blueprint blueprints = 4; + */ + public Builder addAllBlueprints( + java.lang.Iterable values) { + if (blueprintsBuilder_ == null) { + ensureBlueprintsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, blueprints_); + onChanged(); + } else { + blueprintsBuilder_.addAllMessages(values); + } + return this; + } + + /** + * + * + *
        +     * The blueprints that will satisfy this test. There may be multiple blueprints
        +     * that can signal to the server that this test case is being exercised. Although
        +     * multiple blueprints are specified, only a single blueprint needs to be run to
        +     * signal that the test case was exercised.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Test.Blueprint blueprints = 4; + */ + public Builder clearBlueprints() { + if (blueprintsBuilder_ == null) { + blueprints_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + } else { + blueprintsBuilder_.clear(); + } + return this; + } + + /** + * + * + *
        +     * The blueprints that will satisfy this test. There may be multiple blueprints
        +     * that can signal to the server that this test case is being exercised. Although
        +     * multiple blueprints are specified, only a single blueprint needs to be run to
        +     * signal that the test case was exercised.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Test.Blueprint blueprints = 4; + */ + public Builder removeBlueprints(int index) { + if (blueprintsBuilder_ == null) { + ensureBlueprintsIsMutable(); + blueprints_.remove(index); + onChanged(); + } else { + blueprintsBuilder_.remove(index); + } + return this; + } + + /** + * + * + *
        +     * The blueprints that will satisfy this test. There may be multiple blueprints
        +     * that can signal to the server that this test case is being exercised. Although
        +     * multiple blueprints are specified, only a single blueprint needs to be run to
        +     * signal that the test case was exercised.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Test.Blueprint blueprints = 4; + */ + public com.google.showcase.v1beta1.Test.Blueprint.Builder getBlueprintsBuilder(int index) { + return getBlueprintsFieldBuilder().getBuilder(index); + } + + /** + * + * + *
        +     * The blueprints that will satisfy this test. There may be multiple blueprints
        +     * that can signal to the server that this test case is being exercised. Although
        +     * multiple blueprints are specified, only a single blueprint needs to be run to
        +     * signal that the test case was exercised.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Test.Blueprint blueprints = 4; + */ + public com.google.showcase.v1beta1.Test.BlueprintOrBuilder getBlueprintsOrBuilder(int index) { + if (blueprintsBuilder_ == null) { + return blueprints_.get(index); + } else { + return blueprintsBuilder_.getMessageOrBuilder(index); + } + } + + /** + * + * + *
        +     * The blueprints that will satisfy this test. There may be multiple blueprints
        +     * that can signal to the server that this test case is being exercised. Although
        +     * multiple blueprints are specified, only a single blueprint needs to be run to
        +     * signal that the test case was exercised.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Test.Blueprint blueprints = 4; + */ + public java.util.List + getBlueprintsOrBuilderList() { + if (blueprintsBuilder_ != null) { + return blueprintsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(blueprints_); + } + } + + /** + * + * + *
        +     * The blueprints that will satisfy this test. There may be multiple blueprints
        +     * that can signal to the server that this test case is being exercised. Although
        +     * multiple blueprints are specified, only a single blueprint needs to be run to
        +     * signal that the test case was exercised.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Test.Blueprint blueprints = 4; + */ + public com.google.showcase.v1beta1.Test.Blueprint.Builder addBlueprintsBuilder() { + return getBlueprintsFieldBuilder() + .addBuilder(com.google.showcase.v1beta1.Test.Blueprint.getDefaultInstance()); + } + + /** + * + * + *
        +     * The blueprints that will satisfy this test. There may be multiple blueprints
        +     * that can signal to the server that this test case is being exercised. Although
        +     * multiple blueprints are specified, only a single blueprint needs to be run to
        +     * signal that the test case was exercised.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Test.Blueprint blueprints = 4; + */ + public com.google.showcase.v1beta1.Test.Blueprint.Builder addBlueprintsBuilder(int index) { + return getBlueprintsFieldBuilder() + .addBuilder(index, com.google.showcase.v1beta1.Test.Blueprint.getDefaultInstance()); + } + + /** + * + * + *
        +     * The blueprints that will satisfy this test. There may be multiple blueprints
        +     * that can signal to the server that this test case is being exercised. Although
        +     * multiple blueprints are specified, only a single blueprint needs to be run to
        +     * signal that the test case was exercised.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Test.Blueprint blueprints = 4; + */ + public java.util.List + getBlueprintsBuilderList() { + return getBlueprintsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.showcase.v1beta1.Test.Blueprint, + com.google.showcase.v1beta1.Test.Blueprint.Builder, + com.google.showcase.v1beta1.Test.BlueprintOrBuilder> + getBlueprintsFieldBuilder() { + if (blueprintsBuilder_ == null) { + blueprintsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.showcase.v1beta1.Test.Blueprint, + com.google.showcase.v1beta1.Test.Blueprint.Builder, + com.google.showcase.v1beta1.Test.BlueprintOrBuilder>( + blueprints_, ((bitField0_ & 0x00000008) != 0), getParentForChildren(), isClean()); + blueprints_ = null; + } + return blueprintsBuilder_; + } + + @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.showcase.v1beta1.Test) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.Test) + private static final com.google.showcase.v1beta1.Test DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.Test(); + } + + public static com.google.showcase.v1beta1.Test getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Test 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.showcase.v1beta1.Test getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/TestName.java b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/TestName.java new file mode 100644 index 0000000000..276698030f --- /dev/null +++ b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/TestName.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.showcase.v1beta1; + +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +@Generated("by gapic-generator-java") +public class TestName implements ResourceName { + private static final PathTemplate SESSION_TEST = + PathTemplate.createWithoutUrlEncoding("sessions/{session}/tests/{test}"); + private volatile Map fieldValuesMap; + private final String session; + private final String test; + + @Deprecated + protected TestName() { + session = null; + test = null; + } + + private TestName(Builder builder) { + session = Preconditions.checkNotNull(builder.getSession()); + test = Preconditions.checkNotNull(builder.getTest()); + } + + public String getSession() { + return session; + } + + public String getTest() { + return test; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + public static TestName of(String session, String test) { + return newBuilder().setSession(session).setTest(test).build(); + } + + public static String format(String session, String test) { + return newBuilder().setSession(session).setTest(test).build().toString(); + } + + public static TestName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + SESSION_TEST.validatedMatch( + formattedString, "TestName.parse: formattedString not in valid format"); + return of(matchMap.get("session"), matchMap.get("test")); + } + + 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 (TestName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return SESSION_TEST.matches(formattedString); + } + + @Override + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + if (session != null) { + fieldMapBuilder.put("session", session); + } + if (test != null) { + fieldMapBuilder.put("test", test); + } + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return SESSION_TEST.instantiate("session", session, "test", test); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o != null && getClass() == o.getClass()) { + TestName that = ((TestName) o); + return Objects.equals(this.session, that.session) && Objects.equals(this.test, that.test); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= Objects.hashCode(session); + h *= 1000003; + h ^= Objects.hashCode(test); + return h; + } + + /** Builder for sessions/{session}/tests/{test}. */ + public static class Builder { + private String session; + private String test; + + protected Builder() {} + + public String getSession() { + return session; + } + + public String getTest() { + return test; + } + + public Builder setSession(String session) { + this.session = session; + return this; + } + + public Builder setTest(String test) { + this.test = test; + return this; + } + + private Builder(TestName testName) { + this.session = testName.session; + this.test = testName.test; + } + + public TestName build() { + return new TestName(this); + } + } +} diff --git a/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/TestOrBuilder.java b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/TestOrBuilder.java new file mode 100644 index 0000000000..abeeb7ce8e --- /dev/null +++ b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/TestOrBuilder.java @@ -0,0 +1,179 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/testing.proto + +// Protobuf Java Version: 3.25.8 +package com.google.showcase.v1beta1; + +public interface TestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.Test) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
        +   * The name of the test.
        +   * The tests/* portion of the names are hard-coded, and do not change
        +   * from session to session.
        +   * 
        + * + * string name = 1; + * + * @return The name. + */ + java.lang.String getName(); + + /** + * + * + *
        +   * The name of the test.
        +   * The tests/* portion of the names are hard-coded, and do not change
        +   * from session to session.
        +   * 
        + * + * string name = 1; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
        +   * The expectation level for this test.
        +   * 
        + * + * .google.showcase.v1beta1.Test.ExpectationLevel expectation_level = 2; + * + * @return The enum numeric value on the wire for expectationLevel. + */ + int getExpectationLevelValue(); + + /** + * + * + *
        +   * The expectation level for this test.
        +   * 
        + * + * .google.showcase.v1beta1.Test.ExpectationLevel expectation_level = 2; + * + * @return The expectationLevel. + */ + com.google.showcase.v1beta1.Test.ExpectationLevel getExpectationLevel(); + + /** + * + * + *
        +   * A description of the test.
        +   * 
        + * + * string description = 3; + * + * @return The description. + */ + java.lang.String getDescription(); + + /** + * + * + *
        +   * A description of the test.
        +   * 
        + * + * string description = 3; + * + * @return The bytes for description. + */ + com.google.protobuf.ByteString getDescriptionBytes(); + + /** + * + * + *
        +   * The blueprints that will satisfy this test. There may be multiple blueprints
        +   * that can signal to the server that this test case is being exercised. Although
        +   * multiple blueprints are specified, only a single blueprint needs to be run to
        +   * signal that the test case was exercised.
        +   * 
        + * + * repeated .google.showcase.v1beta1.Test.Blueprint blueprints = 4; + */ + java.util.List getBlueprintsList(); + + /** + * + * + *
        +   * The blueprints that will satisfy this test. There may be multiple blueprints
        +   * that can signal to the server that this test case is being exercised. Although
        +   * multiple blueprints are specified, only a single blueprint needs to be run to
        +   * signal that the test case was exercised.
        +   * 
        + * + * repeated .google.showcase.v1beta1.Test.Blueprint blueprints = 4; + */ + com.google.showcase.v1beta1.Test.Blueprint getBlueprints(int index); + + /** + * + * + *
        +   * The blueprints that will satisfy this test. There may be multiple blueprints
        +   * that can signal to the server that this test case is being exercised. Although
        +   * multiple blueprints are specified, only a single blueprint needs to be run to
        +   * signal that the test case was exercised.
        +   * 
        + * + * repeated .google.showcase.v1beta1.Test.Blueprint blueprints = 4; + */ + int getBlueprintsCount(); + + /** + * + * + *
        +   * The blueprints that will satisfy this test. There may be multiple blueprints
        +   * that can signal to the server that this test case is being exercised. Although
        +   * multiple blueprints are specified, only a single blueprint needs to be run to
        +   * signal that the test case was exercised.
        +   * 
        + * + * repeated .google.showcase.v1beta1.Test.Blueprint blueprints = 4; + */ + java.util.List + getBlueprintsOrBuilderList(); + + /** + * + * + *
        +   * The blueprints that will satisfy this test. There may be multiple blueprints
        +   * that can signal to the server that this test case is being exercised. Although
        +   * multiple blueprints are specified, only a single blueprint needs to be run to
        +   * signal that the test case was exercised.
        +   * 
        + * + * repeated .google.showcase.v1beta1.Test.Blueprint blueprints = 4; + */ + com.google.showcase.v1beta1.Test.BlueprintOrBuilder getBlueprintsOrBuilder(int index); +} diff --git a/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/TestRun.java b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/TestRun.java new file mode 100644 index 0000000000..001fef15ab --- /dev/null +++ b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/TestRun.java @@ -0,0 +1,927 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/testing.proto + +// Protobuf Java Version: 3.25.8 +package com.google.showcase.v1beta1; + +/** + * + * + *
        + * A TestRun is the result of running a Test.
        + * 
        + * + * Protobuf type {@code google.showcase.v1beta1.TestRun} + */ +public final class TestRun extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.TestRun) + TestRunOrBuilder { + private static final long serialVersionUID = 0L; + + // Use TestRun.newBuilder() to construct. + private TestRun(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private TestRun() { + test_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new TestRun(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.TestingOuterClass + .internal_static_google_showcase_v1beta1_TestRun_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.TestingOuterClass + .internal_static_google_showcase_v1beta1_TestRun_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.TestRun.class, + com.google.showcase.v1beta1.TestRun.Builder.class); + } + + private int bitField0_; + public static final int TEST_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object test_ = ""; + + /** + * + * + *
        +   * The name of the test.
        +   * The tests/* portion of the names are hard-coded, and do not change
        +   * from session to session.
        +   * 
        + * + * string test = 1 [(.google.api.resource_reference) = { ... } + * + * @return The test. + */ + @java.lang.Override + public java.lang.String getTest() { + java.lang.Object ref = test_; + 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(); + test_ = s; + return s; + } + } + + /** + * + * + *
        +   * The name of the test.
        +   * The tests/* portion of the names are hard-coded, and do not change
        +   * from session to session.
        +   * 
        + * + * string test = 1 [(.google.api.resource_reference) = { ... } + * + * @return The bytes for test. + */ + @java.lang.Override + public com.google.protobuf.ByteString getTestBytes() { + java.lang.Object ref = test_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + test_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int ISSUE_FIELD_NUMBER = 2; + private com.google.showcase.v1beta1.Issue issue_; + + /** + * + * + *
        +   * An issue found with the test run. If empty, this test run was successful.
        +   * 
        + * + * .google.showcase.v1beta1.Issue issue = 2; + * + * @return Whether the issue field is set. + */ + @java.lang.Override + public boolean hasIssue() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
        +   * An issue found with the test run. If empty, this test run was successful.
        +   * 
        + * + * .google.showcase.v1beta1.Issue issue = 2; + * + * @return The issue. + */ + @java.lang.Override + public com.google.showcase.v1beta1.Issue getIssue() { + return issue_ == null ? com.google.showcase.v1beta1.Issue.getDefaultInstance() : issue_; + } + + /** + * + * + *
        +   * An issue found with the test run. If empty, this test run was successful.
        +   * 
        + * + * .google.showcase.v1beta1.Issue issue = 2; + */ + @java.lang.Override + public com.google.showcase.v1beta1.IssueOrBuilder getIssueOrBuilder() { + return issue_ == null ? com.google.showcase.v1beta1.Issue.getDefaultInstance() : issue_; + } + + 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(test_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, test_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(2, getIssue()); + } + 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(test_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, test_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getIssue()); + } + 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.showcase.v1beta1.TestRun)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.TestRun other = (com.google.showcase.v1beta1.TestRun) obj; + + if (!getTest().equals(other.getTest())) return false; + if (hasIssue() != other.hasIssue()) return false; + if (hasIssue()) { + if (!getIssue().equals(other.getIssue())) 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) + TEST_FIELD_NUMBER; + hash = (53 * hash) + getTest().hashCode(); + if (hasIssue()) { + hash = (37 * hash) + ISSUE_FIELD_NUMBER; + hash = (53 * hash) + getIssue().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.showcase.v1beta1.TestRun parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.TestRun parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.TestRun parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.TestRun 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.showcase.v1beta1.TestRun parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.TestRun parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.TestRun parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.TestRun 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.showcase.v1beta1.TestRun parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.TestRun 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.showcase.v1beta1.TestRun parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.TestRun 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.showcase.v1beta1.TestRun prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
        +   * A TestRun is the result of running a Test.
        +   * 
        + * + * Protobuf type {@code google.showcase.v1beta1.TestRun} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.TestRun) + com.google.showcase.v1beta1.TestRunOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.TestingOuterClass + .internal_static_google_showcase_v1beta1_TestRun_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.TestingOuterClass + .internal_static_google_showcase_v1beta1_TestRun_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.TestRun.class, + com.google.showcase.v1beta1.TestRun.Builder.class); + } + + // Construct using com.google.showcase.v1beta1.TestRun.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getIssueFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + test_ = ""; + issue_ = null; + if (issueBuilder_ != null) { + issueBuilder_.dispose(); + issueBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.showcase.v1beta1.TestingOuterClass + .internal_static_google_showcase_v1beta1_TestRun_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.TestRun getDefaultInstanceForType() { + return com.google.showcase.v1beta1.TestRun.getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.TestRun build() { + com.google.showcase.v1beta1.TestRun result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.TestRun buildPartial() { + com.google.showcase.v1beta1.TestRun result = new com.google.showcase.v1beta1.TestRun(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.showcase.v1beta1.TestRun result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.test_ = test_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.issue_ = issueBuilder_ == null ? issue_ : issueBuilder_.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.showcase.v1beta1.TestRun) { + return mergeFrom((com.google.showcase.v1beta1.TestRun) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.showcase.v1beta1.TestRun other) { + if (other == com.google.showcase.v1beta1.TestRun.getDefaultInstance()) return this; + if (!other.getTest().isEmpty()) { + test_ = other.test_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.hasIssue()) { + mergeIssue(other.getIssue()); + } + 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: + { + test_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + input.readMessage(getIssueFieldBuilder().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 test_ = ""; + + /** + * + * + *
        +     * The name of the test.
        +     * The tests/* portion of the names are hard-coded, and do not change
        +     * from session to session.
        +     * 
        + * + * string test = 1 [(.google.api.resource_reference) = { ... } + * + * @return The test. + */ + public java.lang.String getTest() { + java.lang.Object ref = test_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + test_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
        +     * The name of the test.
        +     * The tests/* portion of the names are hard-coded, and do not change
        +     * from session to session.
        +     * 
        + * + * string test = 1 [(.google.api.resource_reference) = { ... } + * + * @return The bytes for test. + */ + public com.google.protobuf.ByteString getTestBytes() { + java.lang.Object ref = test_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + test_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
        +     * The name of the test.
        +     * The tests/* portion of the names are hard-coded, and do not change
        +     * from session to session.
        +     * 
        + * + * string test = 1 [(.google.api.resource_reference) = { ... } + * + * @param value The test to set. + * @return This builder for chaining. + */ + public Builder setTest(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + test_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
        +     * The name of the test.
        +     * The tests/* portion of the names are hard-coded, and do not change
        +     * from session to session.
        +     * 
        + * + * string test = 1 [(.google.api.resource_reference) = { ... } + * + * @return This builder for chaining. + */ + public Builder clearTest() { + test_ = getDefaultInstance().getTest(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
        +     * The name of the test.
        +     * The tests/* portion of the names are hard-coded, and do not change
        +     * from session to session.
        +     * 
        + * + * string test = 1 [(.google.api.resource_reference) = { ... } + * + * @param value The bytes for test to set. + * @return This builder for chaining. + */ + public Builder setTestBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + test_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private com.google.showcase.v1beta1.Issue issue_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.showcase.v1beta1.Issue, + com.google.showcase.v1beta1.Issue.Builder, + com.google.showcase.v1beta1.IssueOrBuilder> + issueBuilder_; + + /** + * + * + *
        +     * An issue found with the test run. If empty, this test run was successful.
        +     * 
        + * + * .google.showcase.v1beta1.Issue issue = 2; + * + * @return Whether the issue field is set. + */ + public boolean hasIssue() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
        +     * An issue found with the test run. If empty, this test run was successful.
        +     * 
        + * + * .google.showcase.v1beta1.Issue issue = 2; + * + * @return The issue. + */ + public com.google.showcase.v1beta1.Issue getIssue() { + if (issueBuilder_ == null) { + return issue_ == null ? com.google.showcase.v1beta1.Issue.getDefaultInstance() : issue_; + } else { + return issueBuilder_.getMessage(); + } + } + + /** + * + * + *
        +     * An issue found with the test run. If empty, this test run was successful.
        +     * 
        + * + * .google.showcase.v1beta1.Issue issue = 2; + */ + public Builder setIssue(com.google.showcase.v1beta1.Issue value) { + if (issueBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + issue_ = value; + } else { + issueBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
        +     * An issue found with the test run. If empty, this test run was successful.
        +     * 
        + * + * .google.showcase.v1beta1.Issue issue = 2; + */ + public Builder setIssue(com.google.showcase.v1beta1.Issue.Builder builderForValue) { + if (issueBuilder_ == null) { + issue_ = builderForValue.build(); + } else { + issueBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
        +     * An issue found with the test run. If empty, this test run was successful.
        +     * 
        + * + * .google.showcase.v1beta1.Issue issue = 2; + */ + public Builder mergeIssue(com.google.showcase.v1beta1.Issue value) { + if (issueBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && issue_ != null + && issue_ != com.google.showcase.v1beta1.Issue.getDefaultInstance()) { + getIssueBuilder().mergeFrom(value); + } else { + issue_ = value; + } + } else { + issueBuilder_.mergeFrom(value); + } + if (issue_ != null) { + bitField0_ |= 0x00000002; + onChanged(); + } + return this; + } + + /** + * + * + *
        +     * An issue found with the test run. If empty, this test run was successful.
        +     * 
        + * + * .google.showcase.v1beta1.Issue issue = 2; + */ + public Builder clearIssue() { + bitField0_ = (bitField0_ & ~0x00000002); + issue_ = null; + if (issueBuilder_ != null) { + issueBuilder_.dispose(); + issueBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
        +     * An issue found with the test run. If empty, this test run was successful.
        +     * 
        + * + * .google.showcase.v1beta1.Issue issue = 2; + */ + public com.google.showcase.v1beta1.Issue.Builder getIssueBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return getIssueFieldBuilder().getBuilder(); + } + + /** + * + * + *
        +     * An issue found with the test run. If empty, this test run was successful.
        +     * 
        + * + * .google.showcase.v1beta1.Issue issue = 2; + */ + public com.google.showcase.v1beta1.IssueOrBuilder getIssueOrBuilder() { + if (issueBuilder_ != null) { + return issueBuilder_.getMessageOrBuilder(); + } else { + return issue_ == null ? com.google.showcase.v1beta1.Issue.getDefaultInstance() : issue_; + } + } + + /** + * + * + *
        +     * An issue found with the test run. If empty, this test run was successful.
        +     * 
        + * + * .google.showcase.v1beta1.Issue issue = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.showcase.v1beta1.Issue, + com.google.showcase.v1beta1.Issue.Builder, + com.google.showcase.v1beta1.IssueOrBuilder> + getIssueFieldBuilder() { + if (issueBuilder_ == null) { + issueBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.showcase.v1beta1.Issue, + com.google.showcase.v1beta1.Issue.Builder, + com.google.showcase.v1beta1.IssueOrBuilder>( + getIssue(), getParentForChildren(), isClean()); + issue_ = null; + } + return issueBuilder_; + } + + @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.showcase.v1beta1.TestRun) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.TestRun) + private static final com.google.showcase.v1beta1.TestRun DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.TestRun(); + } + + public static com.google.showcase.v1beta1.TestRun getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public TestRun 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.showcase.v1beta1.TestRun getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/TestRunOrBuilder.java b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/TestRunOrBuilder.java new file mode 100644 index 0000000000..c60047fe3e --- /dev/null +++ b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/TestRunOrBuilder.java @@ -0,0 +1,93 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/testing.proto + +// Protobuf Java Version: 3.25.8 +package com.google.showcase.v1beta1; + +public interface TestRunOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.TestRun) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
        +   * The name of the test.
        +   * The tests/* portion of the names are hard-coded, and do not change
        +   * from session to session.
        +   * 
        + * + * string test = 1 [(.google.api.resource_reference) = { ... } + * + * @return The test. + */ + java.lang.String getTest(); + + /** + * + * + *
        +   * The name of the test.
        +   * The tests/* portion of the names are hard-coded, and do not change
        +   * from session to session.
        +   * 
        + * + * string test = 1 [(.google.api.resource_reference) = { ... } + * + * @return The bytes for test. + */ + com.google.protobuf.ByteString getTestBytes(); + + /** + * + * + *
        +   * An issue found with the test run. If empty, this test run was successful.
        +   * 
        + * + * .google.showcase.v1beta1.Issue issue = 2; + * + * @return Whether the issue field is set. + */ + boolean hasIssue(); + + /** + * + * + *
        +   * An issue found with the test run. If empty, this test run was successful.
        +   * 
        + * + * .google.showcase.v1beta1.Issue issue = 2; + * + * @return The issue. + */ + com.google.showcase.v1beta1.Issue getIssue(); + + /** + * + * + *
        +   * An issue found with the test run. If empty, this test run was successful.
        +   * 
        + * + * .google.showcase.v1beta1.Issue issue = 2; + */ + com.google.showcase.v1beta1.IssueOrBuilder getIssueOrBuilder(); +} diff --git a/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/TestingOuterClass.java b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/TestingOuterClass.java new file mode 100644 index 0000000000..6527ae96b1 --- /dev/null +++ b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/TestingOuterClass.java @@ -0,0 +1,378 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/testing.proto + +// Protobuf Java Version: 3.25.8 +package com.google.showcase.v1beta1; + +public final class TestingOuterClass { + private TestingOuterClass() {} + + 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_showcase_v1beta1_Session_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_showcase_v1beta1_Session_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_showcase_v1beta1_CreateSessionRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_showcase_v1beta1_CreateSessionRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_showcase_v1beta1_GetSessionRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_showcase_v1beta1_GetSessionRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_showcase_v1beta1_ListSessionsRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_showcase_v1beta1_ListSessionsRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_showcase_v1beta1_ListSessionsResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_showcase_v1beta1_ListSessionsResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_showcase_v1beta1_DeleteSessionRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_showcase_v1beta1_DeleteSessionRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_showcase_v1beta1_ReportSessionRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_showcase_v1beta1_ReportSessionRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_showcase_v1beta1_ReportSessionResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_showcase_v1beta1_ReportSessionResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_showcase_v1beta1_Test_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_showcase_v1beta1_Test_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_showcase_v1beta1_Test_Blueprint_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_showcase_v1beta1_Test_Blueprint_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_showcase_v1beta1_Test_Blueprint_Invocation_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_showcase_v1beta1_Test_Blueprint_Invocation_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_showcase_v1beta1_Issue_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_showcase_v1beta1_Issue_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_showcase_v1beta1_ListTestsRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_showcase_v1beta1_ListTestsRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_showcase_v1beta1_ListTestsResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_showcase_v1beta1_ListTestsResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_showcase_v1beta1_TestRun_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_showcase_v1beta1_TestRun_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_showcase_v1beta1_DeleteTestRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_showcase_v1beta1_DeleteTestRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_showcase_v1beta1_VerifyTestRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_showcase_v1beta1_VerifyTestRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_showcase_v1beta1_VerifyTestResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_showcase_v1beta1_VerifyTestResponse_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,schema/google/showcase/v1beta1/testing" + + ".proto\022\027google.showcase.v1beta1\032\034google/" + + "api/annotations.proto\032\027google/api/client" + + ".proto\032\031google/api/resource.proto\032\033googl" + + "e/protobuf/empty.proto\"\311\001\n\007Session\022\014\n\004na" + + "me\030\001 \001(\t\0229\n\007version\030\002 \001(\0162(.google.showc" + + "ase.v1beta1.Session.Version\";\n\007Version\022\027" + + "\n\023VERSION_UNSPECIFIED\020\000\022\r\n\tV1_LATEST\020\001\022\010" + + "\n\004V1_0\020\002:8\352A5\n\037showcase.googleapis.com/S" + + "ession\022\022sessions/{session}\"I\n\024CreateSess" + + "ionRequest\0221\n\007session\030\001 \001(\0132 .google.sho" + + "wcase.v1beta1.Session\"G\n\021GetSessionReque" + + "st\0222\n\004name\030\001 \001(\tB$\372A!\n\037showcase.googleap" + + "is.com/Session\"<\n\023ListSessionsRequest\022\021\n" + + "\tpage_size\030\001 \001(\005\022\022\n\npage_token\030\002 \001(\t\"c\n\024" + + "ListSessionsResponse\0222\n\010sessions\030\001 \003(\0132 " + + ".google.showcase.v1beta1.Session\022\027\n\017next" + + "_page_token\030\002 \001(\t\"J\n\024DeleteSessionReques" + + "t\0222\n\004name\030\001 \001(\tB$\372A!\n\037showcase.googleapi" + + "s.com/Session\"J\n\024ReportSessionRequest\0222\n" + + "\004name\030\001 \001(\tB$\372A!\n\037showcase.googleapis.co" + + "m/Session\"\335\001\n\025ReportSessionResponse\022E\n\006r" + + "esult\030\001 \001(\01625.google.showcase.v1beta1.Re" + + "portSessionResponse.Result\0223\n\ttest_runs\030" + + "\002 \003(\0132 .google.showcase.v1beta1.TestRun\"" + + "H\n\006Result\022\026\n\022RESULT_UNSPECIFIED\020\000\022\n\n\006PAS" + + "SED\020\001\022\n\n\006FAILED\020\002\022\016\n\nINCOMPLETE\020\003\"\272\005\n\004Te" + + "st\022\014\n\004name\030\001 \001(\t\022I\n\021expectation_level\030\002 " + + "\001(\0162..google.showcase.v1beta1.Test.Expec" + + "tationLevel\022\023\n\013description\030\003 \001(\t\022;\n\nblue" + + "prints\030\004 \003(\0132\'.google.showcase.v1beta1.T" + + "est.Blueprint\032\336\002\n\tBlueprint\022\014\n\004name\030\001 \001(" + + "\t\022\023\n\013description\030\002 \001(\t\022C\n\007request\030\003 \001(\0132" + + "2.google.showcase.v1beta1.Test.Blueprint" + + ".Invocation\022O\n\023additional_requests\030\004 \003(\013" + + "22.google.showcase.v1beta1.Test.Blueprin" + + "t.Invocation\0328\n\nInvocation\022\016\n\006method\030\001 \001" + + "(\t\022\032\n\022serialized_request\030\002 \001(\014:^\352A[\n!sho" + + "wcase.googleapis.com/Blueprint\0226sessions" + + "/{session}/tests/{test}/blueprints/{blue" + + "print}\"b\n\020ExpectationLevel\022!\n\035EXPECTATIO" + + "N_LEVEL_UNSPECIFIED\020\000\022\014\n\010REQUIRED\020\001\022\017\n\013R" + + "ECOMMENDED\020\002\022\014\n\010OPTIONAL\020\003:B\352A?\n\034showcas" + + "e.googleapis.com/Test\022\037sessions/{session" + + "}/tests/{test}\"\234\002\n\005Issue\0221\n\004type\030\001 \001(\0162#" + + ".google.showcase.v1beta1.Issue.Type\0229\n\010s" + + "everity\030\002 \001(\0162\'.google.showcase.v1beta1." + + "Issue.Severity\022\023\n\013description\030\003 \001(\t\"R\n\004T" + + "ype\022\024\n\020TYPE_UNSPECIFIED\020\000\022\013\n\007SKIPPED\020\001\022\013" + + "\n\007PENDING\020\002\022\032\n\026INCORRECT_CONFIRMATION\020\003\"" + + "<\n\010Severity\022\030\n\024SEVERITY_UNSPECIFIED\020\000\022\t\n" + + "\005ERROR\020\001\022\013\n\007WARNING\020\002\"o\n\020ListTestsReques" + + "t\0224\n\006parent\030\001 \001(\tB$\372A!\n\037showcase.googlea" + + "pis.com/Session\022\021\n\tpage_size\030\002 \001(\005\022\022\n\npa" + + "ge_token\030\003 \001(\t\"Z\n\021ListTestsResponse\022,\n\005t" + + "ests\030\001 \003(\0132\035.google.showcase.v1beta1.Tes" + + "t\022\027\n\017next_page_token\030\002 \001(\t\"i\n\007TestRun\022/\n" + + "\004test\030\001 \001(\tB!\372A\036\n\034showcase.googleapis.co" + + "m/Test\022-\n\005issue\030\002 \001(\0132\036.google.showcase." + + "v1beta1.Issue\"D\n\021DeleteTestRequest\022/\n\004na" + + "me\030\001 \001(\tB!\372A\036\n\034showcase.googleapis.com/T" + + "est\"e\n\021VerifyTestRequest\022/\n\004name\030\001 \001(\tB!" + + "\372A\036\n\034showcase.googleapis.com/Test\022\016\n\006ans" + + "wer\030\002 \001(\014\022\017\n\007answers\030\003 \003(\014\"C\n\022VerifyTest" + + "Response\022-\n\005issue\030\001 \001(\0132\036.google.showcas" + + "e.v1beta1.Issue2\355\010\n\007Testing\022\204\001\n\rCreateSe" + + "ssion\022-.google.showcase.v1beta1.CreateSe" + + "ssionRequest\032 .google.showcase.v1beta1.S" + + "ession\"\"\202\323\344\223\002\034\"\021/v1beta1/sessions:\007sessi" + + "on\022~\n\nGetSession\022*.google.showcase.v1bet" + + "a1.GetSessionRequest\032 .google.showcase.v" + + "1beta1.Session\"\"\202\323\344\223\002\034\022\032/v1beta1/{name=s" + + "essions/*}\022\206\001\n\014ListSessions\022,.google.sho" + + "wcase.v1beta1.ListSessionsRequest\032-.goog" + + "le.showcase.v1beta1.ListSessionsResponse" + + "\"\031\202\323\344\223\002\023\022\021/v1beta1/sessions\022z\n\rDeleteSes" + + "sion\022-.google.showcase.v1beta1.DeleteSes" + + "sionRequest\032\026.google.protobuf.Empty\"\"\202\323\344" + + "\223\002\034*\032/v1beta1/{name=sessions/*}\022\231\001\n\rRepo" + + "rtSession\022-.google.showcase.v1beta1.Repo" + + "rtSessionRequest\032..google.showcase.v1bet" + + "a1.ReportSessionResponse\")\202\323\344\223\002#\"!/v1bet" + + "a1/{name=sessions/*}:report\022\216\001\n\tListTest" + + "s\022).google.showcase.v1beta1.ListTestsReq" + + "uest\032*.google.showcase.v1beta1.ListTests" + + "Response\"*\202\323\344\223\002$\022\"/v1beta1/{parent=sessi" + + "ons/*}/tests\022|\n\nDeleteTest\022*.google.show" + + "case.v1beta1.DeleteTestRequest\032\026.google." + + "protobuf.Empty\"*\202\323\344\223\002$*\"/v1beta1/{name=s" + + "essions/*/tests/*}\022\227\001\n\nVerifyTest\022*.goog" + + "le.showcase.v1beta1.VerifyTestRequest\032+." + + "google.showcase.v1beta1.VerifyTestRespon" + + "se\"0\202\323\344\223\002*\"(/v1beta1/{name=sessions/*/te" + + "sts/*}:check\032\021\312A\016localhost:7469Bq\n\033com.g" + + "oogle.showcase.v1beta1P\001Z4github.com/goo" + + "gleapis/gapic-showcase/server/genproto\352\002" + + "\031Google::Showcase::V1beta1b\006proto3" + }; + descriptor = + com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( + descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + com.google.api.AnnotationsProto.getDescriptor(), + com.google.api.ClientProto.getDescriptor(), + com.google.api.ResourceProto.getDescriptor(), + com.google.protobuf.EmptyProto.getDescriptor(), + }); + internal_static_google_showcase_v1beta1_Session_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_showcase_v1beta1_Session_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_showcase_v1beta1_Session_descriptor, + new java.lang.String[] { + "Name", "Version", + }); + internal_static_google_showcase_v1beta1_CreateSessionRequest_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_google_showcase_v1beta1_CreateSessionRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_showcase_v1beta1_CreateSessionRequest_descriptor, + new java.lang.String[] { + "Session", + }); + internal_static_google_showcase_v1beta1_GetSessionRequest_descriptor = + getDescriptor().getMessageTypes().get(2); + internal_static_google_showcase_v1beta1_GetSessionRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_showcase_v1beta1_GetSessionRequest_descriptor, + new java.lang.String[] { + "Name", + }); + internal_static_google_showcase_v1beta1_ListSessionsRequest_descriptor = + getDescriptor().getMessageTypes().get(3); + internal_static_google_showcase_v1beta1_ListSessionsRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_showcase_v1beta1_ListSessionsRequest_descriptor, + new java.lang.String[] { + "PageSize", "PageToken", + }); + internal_static_google_showcase_v1beta1_ListSessionsResponse_descriptor = + getDescriptor().getMessageTypes().get(4); + internal_static_google_showcase_v1beta1_ListSessionsResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_showcase_v1beta1_ListSessionsResponse_descriptor, + new java.lang.String[] { + "Sessions", "NextPageToken", + }); + internal_static_google_showcase_v1beta1_DeleteSessionRequest_descriptor = + getDescriptor().getMessageTypes().get(5); + internal_static_google_showcase_v1beta1_DeleteSessionRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_showcase_v1beta1_DeleteSessionRequest_descriptor, + new java.lang.String[] { + "Name", + }); + internal_static_google_showcase_v1beta1_ReportSessionRequest_descriptor = + getDescriptor().getMessageTypes().get(6); + internal_static_google_showcase_v1beta1_ReportSessionRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_showcase_v1beta1_ReportSessionRequest_descriptor, + new java.lang.String[] { + "Name", + }); + internal_static_google_showcase_v1beta1_ReportSessionResponse_descriptor = + getDescriptor().getMessageTypes().get(7); + internal_static_google_showcase_v1beta1_ReportSessionResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_showcase_v1beta1_ReportSessionResponse_descriptor, + new java.lang.String[] { + "Result", "TestRuns", + }); + internal_static_google_showcase_v1beta1_Test_descriptor = + getDescriptor().getMessageTypes().get(8); + internal_static_google_showcase_v1beta1_Test_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_showcase_v1beta1_Test_descriptor, + new java.lang.String[] { + "Name", "ExpectationLevel", "Description", "Blueprints", + }); + internal_static_google_showcase_v1beta1_Test_Blueprint_descriptor = + internal_static_google_showcase_v1beta1_Test_descriptor.getNestedTypes().get(0); + internal_static_google_showcase_v1beta1_Test_Blueprint_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_showcase_v1beta1_Test_Blueprint_descriptor, + new java.lang.String[] { + "Name", "Description", "Request", "AdditionalRequests", + }); + internal_static_google_showcase_v1beta1_Test_Blueprint_Invocation_descriptor = + internal_static_google_showcase_v1beta1_Test_Blueprint_descriptor.getNestedTypes().get(0); + internal_static_google_showcase_v1beta1_Test_Blueprint_Invocation_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_showcase_v1beta1_Test_Blueprint_Invocation_descriptor, + new java.lang.String[] { + "Method", "SerializedRequest", + }); + internal_static_google_showcase_v1beta1_Issue_descriptor = + getDescriptor().getMessageTypes().get(9); + internal_static_google_showcase_v1beta1_Issue_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_showcase_v1beta1_Issue_descriptor, + new java.lang.String[] { + "Type", "Severity", "Description", + }); + internal_static_google_showcase_v1beta1_ListTestsRequest_descriptor = + getDescriptor().getMessageTypes().get(10); + internal_static_google_showcase_v1beta1_ListTestsRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_showcase_v1beta1_ListTestsRequest_descriptor, + new java.lang.String[] { + "Parent", "PageSize", "PageToken", + }); + internal_static_google_showcase_v1beta1_ListTestsResponse_descriptor = + getDescriptor().getMessageTypes().get(11); + internal_static_google_showcase_v1beta1_ListTestsResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_showcase_v1beta1_ListTestsResponse_descriptor, + new java.lang.String[] { + "Tests", "NextPageToken", + }); + internal_static_google_showcase_v1beta1_TestRun_descriptor = + getDescriptor().getMessageTypes().get(12); + internal_static_google_showcase_v1beta1_TestRun_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_showcase_v1beta1_TestRun_descriptor, + new java.lang.String[] { + "Test", "Issue", + }); + internal_static_google_showcase_v1beta1_DeleteTestRequest_descriptor = + getDescriptor().getMessageTypes().get(13); + internal_static_google_showcase_v1beta1_DeleteTestRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_showcase_v1beta1_DeleteTestRequest_descriptor, + new java.lang.String[] { + "Name", + }); + internal_static_google_showcase_v1beta1_VerifyTestRequest_descriptor = + getDescriptor().getMessageTypes().get(14); + internal_static_google_showcase_v1beta1_VerifyTestRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_showcase_v1beta1_VerifyTestRequest_descriptor, + new java.lang.String[] { + "Name", "Answer", "Answers", + }); + internal_static_google_showcase_v1beta1_VerifyTestResponse_descriptor = + getDescriptor().getMessageTypes().get(15); + internal_static_google_showcase_v1beta1_VerifyTestResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_showcase_v1beta1_VerifyTestResponse_descriptor, + new java.lang.String[] { + "Issue", + }); + com.google.protobuf.ExtensionRegistry registry = + com.google.protobuf.ExtensionRegistry.newInstance(); + registry.add(com.google.api.ClientProto.defaultHost); + registry.add(com.google.api.AnnotationsProto.http); + registry.add(com.google.api.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.ResourceProto.getDescriptor(); + com.google.protobuf.EmptyProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/UpdateBlurbRequest.java b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/UpdateBlurbRequest.java new file mode 100644 index 0000000000..4e0ac845aa --- /dev/null +++ b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/UpdateBlurbRequest.java @@ -0,0 +1,1016 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/messaging.proto + +// Protobuf Java Version: 3.25.8 +package com.google.showcase.v1beta1; + +/** + * + * + *
        + * The request message for the google.showcase.v1beta1.Messaging\UpdateBlurb
        + * method.
        + * 
        + * + * Protobuf type {@code google.showcase.v1beta1.UpdateBlurbRequest} + */ +public final class UpdateBlurbRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.UpdateBlurbRequest) + UpdateBlurbRequestOrBuilder { + private static final long serialVersionUID = 0L; + + // Use UpdateBlurbRequest.newBuilder() to construct. + private UpdateBlurbRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private UpdateBlurbRequest() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new UpdateBlurbRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.MessagingOuterClass + .internal_static_google_showcase_v1beta1_UpdateBlurbRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.MessagingOuterClass + .internal_static_google_showcase_v1beta1_UpdateBlurbRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.UpdateBlurbRequest.class, + com.google.showcase.v1beta1.UpdateBlurbRequest.Builder.class); + } + + private int bitField0_; + public static final int BLURB_FIELD_NUMBER = 1; + private com.google.showcase.v1beta1.Blurb blurb_; + + /** + * + * + *
        +   * The blurb to update.
        +   * 
        + * + * .google.showcase.v1beta1.Blurb blurb = 1; + * + * @return Whether the blurb field is set. + */ + @java.lang.Override + public boolean hasBlurb() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
        +   * The blurb to update.
        +   * 
        + * + * .google.showcase.v1beta1.Blurb blurb = 1; + * + * @return The blurb. + */ + @java.lang.Override + public com.google.showcase.v1beta1.Blurb getBlurb() { + return blurb_ == null ? com.google.showcase.v1beta1.Blurb.getDefaultInstance() : blurb_; + } + + /** + * + * + *
        +   * The blurb to update.
        +   * 
        + * + * .google.showcase.v1beta1.Blurb blurb = 1; + */ + @java.lang.Override + public com.google.showcase.v1beta1.BlurbOrBuilder getBlurbOrBuilder() { + return blurb_ == null ? com.google.showcase.v1beta1.Blurb.getDefaultInstance() : blurb_; + } + + public static final int UPDATE_MASK_FIELD_NUMBER = 2; + private com.google.protobuf.FieldMask updateMask_; + + /** + * + * + *
        +   * The field mask to determine which fields are to be updated. If empty, the
        +   * server will assume all fields are to be updated.
        +   * 
        + * + * .google.protobuf.FieldMask update_mask = 2; + * + * @return Whether the updateMask field is set. + */ + @java.lang.Override + public boolean hasUpdateMask() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
        +   * The field mask to determine which fields are to be updated. If empty, the
        +   * server will assume all fields are to be updated.
        +   * 
        + * + * .google.protobuf.FieldMask update_mask = 2; + * + * @return The updateMask. + */ + @java.lang.Override + public com.google.protobuf.FieldMask getUpdateMask() { + return updateMask_ == null ? com.google.protobuf.FieldMask.getDefaultInstance() : updateMask_; + } + + /** + * + * + *
        +   * The field mask to determine which fields are to be updated. If empty, the
        +   * server will assume all fields are to be updated.
        +   * 
        + * + * .google.protobuf.FieldMask update_mask = 2; + */ + @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 (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(1, getBlurb()); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeMessage(2, getUpdateMask()); + } + 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, getBlurb()); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, 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.showcase.v1beta1.UpdateBlurbRequest)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.UpdateBlurbRequest other = + (com.google.showcase.v1beta1.UpdateBlurbRequest) obj; + + if (hasBlurb() != other.hasBlurb()) return false; + if (hasBlurb()) { + if (!getBlurb().equals(other.getBlurb())) 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(); + if (hasBlurb()) { + hash = (37 * hash) + BLURB_FIELD_NUMBER; + hash = (53 * hash) + getBlurb().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.showcase.v1beta1.UpdateBlurbRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.UpdateBlurbRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.UpdateBlurbRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.UpdateBlurbRequest 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.showcase.v1beta1.UpdateBlurbRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.UpdateBlurbRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.UpdateBlurbRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.UpdateBlurbRequest 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.showcase.v1beta1.UpdateBlurbRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.UpdateBlurbRequest 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.showcase.v1beta1.UpdateBlurbRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.UpdateBlurbRequest 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.showcase.v1beta1.UpdateBlurbRequest 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 request message for the google.showcase.v1beta1.Messaging\UpdateBlurb
        +   * method.
        +   * 
        + * + * Protobuf type {@code google.showcase.v1beta1.UpdateBlurbRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.UpdateBlurbRequest) + com.google.showcase.v1beta1.UpdateBlurbRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.MessagingOuterClass + .internal_static_google_showcase_v1beta1_UpdateBlurbRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.MessagingOuterClass + .internal_static_google_showcase_v1beta1_UpdateBlurbRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.UpdateBlurbRequest.class, + com.google.showcase.v1beta1.UpdateBlurbRequest.Builder.class); + } + + // Construct using com.google.showcase.v1beta1.UpdateBlurbRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getBlurbFieldBuilder(); + getUpdateMaskFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + blurb_ = null; + if (blurbBuilder_ != null) { + blurbBuilder_.dispose(); + blurbBuilder_ = 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.showcase.v1beta1.MessagingOuterClass + .internal_static_google_showcase_v1beta1_UpdateBlurbRequest_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.UpdateBlurbRequest getDefaultInstanceForType() { + return com.google.showcase.v1beta1.UpdateBlurbRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.UpdateBlurbRequest build() { + com.google.showcase.v1beta1.UpdateBlurbRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.UpdateBlurbRequest buildPartial() { + com.google.showcase.v1beta1.UpdateBlurbRequest result = + new com.google.showcase.v1beta1.UpdateBlurbRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.showcase.v1beta1.UpdateBlurbRequest result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.blurb_ = blurbBuilder_ == null ? blurb_ : blurbBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000002) != 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.showcase.v1beta1.UpdateBlurbRequest) { + return mergeFrom((com.google.showcase.v1beta1.UpdateBlurbRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.showcase.v1beta1.UpdateBlurbRequest other) { + if (other == com.google.showcase.v1beta1.UpdateBlurbRequest.getDefaultInstance()) return this; + if (other.hasBlurb()) { + mergeBlurb(other.getBlurb()); + } + 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: + { + input.readMessage(getBlurbFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + input.readMessage(getUpdateMaskFieldBuilder().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 com.google.showcase.v1beta1.Blurb blurb_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.showcase.v1beta1.Blurb, + com.google.showcase.v1beta1.Blurb.Builder, + com.google.showcase.v1beta1.BlurbOrBuilder> + blurbBuilder_; + + /** + * + * + *
        +     * The blurb to update.
        +     * 
        + * + * .google.showcase.v1beta1.Blurb blurb = 1; + * + * @return Whether the blurb field is set. + */ + public boolean hasBlurb() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
        +     * The blurb to update.
        +     * 
        + * + * .google.showcase.v1beta1.Blurb blurb = 1; + * + * @return The blurb. + */ + public com.google.showcase.v1beta1.Blurb getBlurb() { + if (blurbBuilder_ == null) { + return blurb_ == null ? com.google.showcase.v1beta1.Blurb.getDefaultInstance() : blurb_; + } else { + return blurbBuilder_.getMessage(); + } + } + + /** + * + * + *
        +     * The blurb to update.
        +     * 
        + * + * .google.showcase.v1beta1.Blurb blurb = 1; + */ + public Builder setBlurb(com.google.showcase.v1beta1.Blurb value) { + if (blurbBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + blurb_ = value; + } else { + blurbBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
        +     * The blurb to update.
        +     * 
        + * + * .google.showcase.v1beta1.Blurb blurb = 1; + */ + public Builder setBlurb(com.google.showcase.v1beta1.Blurb.Builder builderForValue) { + if (blurbBuilder_ == null) { + blurb_ = builderForValue.build(); + } else { + blurbBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
        +     * The blurb to update.
        +     * 
        + * + * .google.showcase.v1beta1.Blurb blurb = 1; + */ + public Builder mergeBlurb(com.google.showcase.v1beta1.Blurb value) { + if (blurbBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) + && blurb_ != null + && blurb_ != com.google.showcase.v1beta1.Blurb.getDefaultInstance()) { + getBlurbBuilder().mergeFrom(value); + } else { + blurb_ = value; + } + } else { + blurbBuilder_.mergeFrom(value); + } + if (blurb_ != null) { + bitField0_ |= 0x00000001; + onChanged(); + } + return this; + } + + /** + * + * + *
        +     * The blurb to update.
        +     * 
        + * + * .google.showcase.v1beta1.Blurb blurb = 1; + */ + public Builder clearBlurb() { + bitField0_ = (bitField0_ & ~0x00000001); + blurb_ = null; + if (blurbBuilder_ != null) { + blurbBuilder_.dispose(); + blurbBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
        +     * The blurb to update.
        +     * 
        + * + * .google.showcase.v1beta1.Blurb blurb = 1; + */ + public com.google.showcase.v1beta1.Blurb.Builder getBlurbBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return getBlurbFieldBuilder().getBuilder(); + } + + /** + * + * + *
        +     * The blurb to update.
        +     * 
        + * + * .google.showcase.v1beta1.Blurb blurb = 1; + */ + public com.google.showcase.v1beta1.BlurbOrBuilder getBlurbOrBuilder() { + if (blurbBuilder_ != null) { + return blurbBuilder_.getMessageOrBuilder(); + } else { + return blurb_ == null ? com.google.showcase.v1beta1.Blurb.getDefaultInstance() : blurb_; + } + } + + /** + * + * + *
        +     * The blurb to update.
        +     * 
        + * + * .google.showcase.v1beta1.Blurb blurb = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.showcase.v1beta1.Blurb, + com.google.showcase.v1beta1.Blurb.Builder, + com.google.showcase.v1beta1.BlurbOrBuilder> + getBlurbFieldBuilder() { + if (blurbBuilder_ == null) { + blurbBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.showcase.v1beta1.Blurb, + com.google.showcase.v1beta1.Blurb.Builder, + com.google.showcase.v1beta1.BlurbOrBuilder>( + getBlurb(), getParentForChildren(), isClean()); + blurb_ = null; + } + return blurbBuilder_; + } + + private com.google.protobuf.FieldMask updateMask_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder> + updateMaskBuilder_; + + /** + * + * + *
        +     * The field mask to determine which fields are to be updated. If empty, the
        +     * server will assume all fields are to be updated.
        +     * 
        + * + * .google.protobuf.FieldMask update_mask = 2; + * + * @return Whether the updateMask field is set. + */ + public boolean hasUpdateMask() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
        +     * The field mask to determine which fields are to be updated. If empty, the
        +     * server will assume all fields are to be updated.
        +     * 
        + * + * .google.protobuf.FieldMask update_mask = 2; + * + * @return The updateMask. + */ + public com.google.protobuf.FieldMask getUpdateMask() { + if (updateMaskBuilder_ == null) { + return updateMask_ == null + ? com.google.protobuf.FieldMask.getDefaultInstance() + : updateMask_; + } else { + return updateMaskBuilder_.getMessage(); + } + } + + /** + * + * + *
        +     * The field mask to determine which fields are to be updated. If empty, the
        +     * server will assume all fields are to be updated.
        +     * 
        + * + * .google.protobuf.FieldMask update_mask = 2; + */ + public Builder setUpdateMask(com.google.protobuf.FieldMask value) { + if (updateMaskBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + updateMask_ = value; + } else { + updateMaskBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
        +     * The field mask to determine which fields are to be updated. If empty, the
        +     * server will assume all fields are to be updated.
        +     * 
        + * + * .google.protobuf.FieldMask update_mask = 2; + */ + public Builder setUpdateMask(com.google.protobuf.FieldMask.Builder builderForValue) { + if (updateMaskBuilder_ == null) { + updateMask_ = builderForValue.build(); + } else { + updateMaskBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
        +     * The field mask to determine which fields are to be updated. If empty, the
        +     * server will assume all fields are to be updated.
        +     * 
        + * + * .google.protobuf.FieldMask update_mask = 2; + */ + public Builder mergeUpdateMask(com.google.protobuf.FieldMask value) { + if (updateMaskBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && updateMask_ != null + && updateMask_ != com.google.protobuf.FieldMask.getDefaultInstance()) { + getUpdateMaskBuilder().mergeFrom(value); + } else { + updateMask_ = value; + } + } else { + updateMaskBuilder_.mergeFrom(value); + } + if (updateMask_ != null) { + bitField0_ |= 0x00000002; + onChanged(); + } + return this; + } + + /** + * + * + *
        +     * The field mask to determine which fields are to be updated. If empty, the
        +     * server will assume all fields are to be updated.
        +     * 
        + * + * .google.protobuf.FieldMask update_mask = 2; + */ + public Builder clearUpdateMask() { + bitField0_ = (bitField0_ & ~0x00000002); + updateMask_ = null; + if (updateMaskBuilder_ != null) { + updateMaskBuilder_.dispose(); + updateMaskBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
        +     * The field mask to determine which fields are to be updated. If empty, the
        +     * server will assume all fields are to be updated.
        +     * 
        + * + * .google.protobuf.FieldMask update_mask = 2; + */ + public com.google.protobuf.FieldMask.Builder getUpdateMaskBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return getUpdateMaskFieldBuilder().getBuilder(); + } + + /** + * + * + *
        +     * The field mask to determine which fields are to be updated. If empty, the
        +     * server will assume all fields are to be updated.
        +     * 
        + * + * .google.protobuf.FieldMask update_mask = 2; + */ + public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { + if (updateMaskBuilder_ != null) { + return updateMaskBuilder_.getMessageOrBuilder(); + } else { + return updateMask_ == null + ? com.google.protobuf.FieldMask.getDefaultInstance() + : updateMask_; + } + } + + /** + * + * + *
        +     * The field mask to determine which fields are to be updated. If empty, the
        +     * server will assume all fields are to be updated.
        +     * 
        + * + * .google.protobuf.FieldMask update_mask = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder> + getUpdateMaskFieldBuilder() { + if (updateMaskBuilder_ == null) { + updateMaskBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder>( + getUpdateMask(), getParentForChildren(), isClean()); + updateMask_ = null; + } + return updateMaskBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.showcase.v1beta1.UpdateBlurbRequest) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.UpdateBlurbRequest) + private static final com.google.showcase.v1beta1.UpdateBlurbRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.UpdateBlurbRequest(); + } + + public static com.google.showcase.v1beta1.UpdateBlurbRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public UpdateBlurbRequest 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.showcase.v1beta1.UpdateBlurbRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/UpdateBlurbRequestOrBuilder.java b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/UpdateBlurbRequestOrBuilder.java new file mode 100644 index 0000000000..cb573c3388 --- /dev/null +++ b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/UpdateBlurbRequestOrBuilder.java @@ -0,0 +1,103 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/messaging.proto + +// Protobuf Java Version: 3.25.8 +package com.google.showcase.v1beta1; + +public interface UpdateBlurbRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.UpdateBlurbRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
        +   * The blurb to update.
        +   * 
        + * + * .google.showcase.v1beta1.Blurb blurb = 1; + * + * @return Whether the blurb field is set. + */ + boolean hasBlurb(); + + /** + * + * + *
        +   * The blurb to update.
        +   * 
        + * + * .google.showcase.v1beta1.Blurb blurb = 1; + * + * @return The blurb. + */ + com.google.showcase.v1beta1.Blurb getBlurb(); + + /** + * + * + *
        +   * The blurb to update.
        +   * 
        + * + * .google.showcase.v1beta1.Blurb blurb = 1; + */ + com.google.showcase.v1beta1.BlurbOrBuilder getBlurbOrBuilder(); + + /** + * + * + *
        +   * The field mask to determine which fields are to be updated. If empty, the
        +   * server will assume all fields are to be updated.
        +   * 
        + * + * .google.protobuf.FieldMask update_mask = 2; + * + * @return Whether the updateMask field is set. + */ + boolean hasUpdateMask(); + + /** + * + * + *
        +   * The field mask to determine which fields are to be updated. If empty, the
        +   * server will assume all fields are to be updated.
        +   * 
        + * + * .google.protobuf.FieldMask update_mask = 2; + * + * @return The updateMask. + */ + com.google.protobuf.FieldMask getUpdateMask(); + + /** + * + * + *
        +   * The field mask to determine which fields are to be updated. If empty, the
        +   * server will assume all fields are to be updated.
        +   * 
        + * + * .google.protobuf.FieldMask update_mask = 2; + */ + com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder(); +} diff --git a/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/UpdateRoomRequest.java b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/UpdateRoomRequest.java new file mode 100644 index 0000000000..9c35ee243d --- /dev/null +++ b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/UpdateRoomRequest.java @@ -0,0 +1,1016 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/messaging.proto + +// Protobuf Java Version: 3.25.8 +package com.google.showcase.v1beta1; + +/** + * + * + *
        + * The request message for the google.showcase.v1beta1.Messaging\UpdateRoom
        + * method.
        + * 
        + * + * Protobuf type {@code google.showcase.v1beta1.UpdateRoomRequest} + */ +public final class UpdateRoomRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.UpdateRoomRequest) + UpdateRoomRequestOrBuilder { + private static final long serialVersionUID = 0L; + + // Use UpdateRoomRequest.newBuilder() to construct. + private UpdateRoomRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private UpdateRoomRequest() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new UpdateRoomRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.MessagingOuterClass + .internal_static_google_showcase_v1beta1_UpdateRoomRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.MessagingOuterClass + .internal_static_google_showcase_v1beta1_UpdateRoomRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.UpdateRoomRequest.class, + com.google.showcase.v1beta1.UpdateRoomRequest.Builder.class); + } + + private int bitField0_; + public static final int ROOM_FIELD_NUMBER = 1; + private com.google.showcase.v1beta1.Room room_; + + /** + * + * + *
        +   * The room to update.
        +   * 
        + * + * .google.showcase.v1beta1.Room room = 1; + * + * @return Whether the room field is set. + */ + @java.lang.Override + public boolean hasRoom() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
        +   * The room to update.
        +   * 
        + * + * .google.showcase.v1beta1.Room room = 1; + * + * @return The room. + */ + @java.lang.Override + public com.google.showcase.v1beta1.Room getRoom() { + return room_ == null ? com.google.showcase.v1beta1.Room.getDefaultInstance() : room_; + } + + /** + * + * + *
        +   * The room to update.
        +   * 
        + * + * .google.showcase.v1beta1.Room room = 1; + */ + @java.lang.Override + public com.google.showcase.v1beta1.RoomOrBuilder getRoomOrBuilder() { + return room_ == null ? com.google.showcase.v1beta1.Room.getDefaultInstance() : room_; + } + + public static final int UPDATE_MASK_FIELD_NUMBER = 2; + private com.google.protobuf.FieldMask updateMask_; + + /** + * + * + *
        +   * The field mask to determine which fields are to be updated. If empty, the
        +   * server will assume all fields are to be updated.
        +   * 
        + * + * .google.protobuf.FieldMask update_mask = 2; + * + * @return Whether the updateMask field is set. + */ + @java.lang.Override + public boolean hasUpdateMask() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
        +   * The field mask to determine which fields are to be updated. If empty, the
        +   * server will assume all fields are to be updated.
        +   * 
        + * + * .google.protobuf.FieldMask update_mask = 2; + * + * @return The updateMask. + */ + @java.lang.Override + public com.google.protobuf.FieldMask getUpdateMask() { + return updateMask_ == null ? com.google.protobuf.FieldMask.getDefaultInstance() : updateMask_; + } + + /** + * + * + *
        +   * The field mask to determine which fields are to be updated. If empty, the
        +   * server will assume all fields are to be updated.
        +   * 
        + * + * .google.protobuf.FieldMask update_mask = 2; + */ + @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 (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(1, getRoom()); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeMessage(2, getUpdateMask()); + } + 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, getRoom()); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, 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.showcase.v1beta1.UpdateRoomRequest)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.UpdateRoomRequest other = + (com.google.showcase.v1beta1.UpdateRoomRequest) obj; + + if (hasRoom() != other.hasRoom()) return false; + if (hasRoom()) { + if (!getRoom().equals(other.getRoom())) 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(); + if (hasRoom()) { + hash = (37 * hash) + ROOM_FIELD_NUMBER; + hash = (53 * hash) + getRoom().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.showcase.v1beta1.UpdateRoomRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.UpdateRoomRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.UpdateRoomRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.UpdateRoomRequest 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.showcase.v1beta1.UpdateRoomRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.UpdateRoomRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.UpdateRoomRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.UpdateRoomRequest 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.showcase.v1beta1.UpdateRoomRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.UpdateRoomRequest 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.showcase.v1beta1.UpdateRoomRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.UpdateRoomRequest 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.showcase.v1beta1.UpdateRoomRequest 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 request message for the google.showcase.v1beta1.Messaging\UpdateRoom
        +   * method.
        +   * 
        + * + * Protobuf type {@code google.showcase.v1beta1.UpdateRoomRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.UpdateRoomRequest) + com.google.showcase.v1beta1.UpdateRoomRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.MessagingOuterClass + .internal_static_google_showcase_v1beta1_UpdateRoomRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.MessagingOuterClass + .internal_static_google_showcase_v1beta1_UpdateRoomRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.UpdateRoomRequest.class, + com.google.showcase.v1beta1.UpdateRoomRequest.Builder.class); + } + + // Construct using com.google.showcase.v1beta1.UpdateRoomRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getRoomFieldBuilder(); + getUpdateMaskFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + room_ = null; + if (roomBuilder_ != null) { + roomBuilder_.dispose(); + roomBuilder_ = 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.showcase.v1beta1.MessagingOuterClass + .internal_static_google_showcase_v1beta1_UpdateRoomRequest_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.UpdateRoomRequest getDefaultInstanceForType() { + return com.google.showcase.v1beta1.UpdateRoomRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.UpdateRoomRequest build() { + com.google.showcase.v1beta1.UpdateRoomRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.UpdateRoomRequest buildPartial() { + com.google.showcase.v1beta1.UpdateRoomRequest result = + new com.google.showcase.v1beta1.UpdateRoomRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.showcase.v1beta1.UpdateRoomRequest result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.room_ = roomBuilder_ == null ? room_ : roomBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000002) != 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.showcase.v1beta1.UpdateRoomRequest) { + return mergeFrom((com.google.showcase.v1beta1.UpdateRoomRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.showcase.v1beta1.UpdateRoomRequest other) { + if (other == com.google.showcase.v1beta1.UpdateRoomRequest.getDefaultInstance()) return this; + if (other.hasRoom()) { + mergeRoom(other.getRoom()); + } + 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: + { + input.readMessage(getRoomFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + input.readMessage(getUpdateMaskFieldBuilder().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 com.google.showcase.v1beta1.Room room_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.showcase.v1beta1.Room, + com.google.showcase.v1beta1.Room.Builder, + com.google.showcase.v1beta1.RoomOrBuilder> + roomBuilder_; + + /** + * + * + *
        +     * The room to update.
        +     * 
        + * + * .google.showcase.v1beta1.Room room = 1; + * + * @return Whether the room field is set. + */ + public boolean hasRoom() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
        +     * The room to update.
        +     * 
        + * + * .google.showcase.v1beta1.Room room = 1; + * + * @return The room. + */ + public com.google.showcase.v1beta1.Room getRoom() { + if (roomBuilder_ == null) { + return room_ == null ? com.google.showcase.v1beta1.Room.getDefaultInstance() : room_; + } else { + return roomBuilder_.getMessage(); + } + } + + /** + * + * + *
        +     * The room to update.
        +     * 
        + * + * .google.showcase.v1beta1.Room room = 1; + */ + public Builder setRoom(com.google.showcase.v1beta1.Room value) { + if (roomBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + room_ = value; + } else { + roomBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
        +     * The room to update.
        +     * 
        + * + * .google.showcase.v1beta1.Room room = 1; + */ + public Builder setRoom(com.google.showcase.v1beta1.Room.Builder builderForValue) { + if (roomBuilder_ == null) { + room_ = builderForValue.build(); + } else { + roomBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
        +     * The room to update.
        +     * 
        + * + * .google.showcase.v1beta1.Room room = 1; + */ + public Builder mergeRoom(com.google.showcase.v1beta1.Room value) { + if (roomBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) + && room_ != null + && room_ != com.google.showcase.v1beta1.Room.getDefaultInstance()) { + getRoomBuilder().mergeFrom(value); + } else { + room_ = value; + } + } else { + roomBuilder_.mergeFrom(value); + } + if (room_ != null) { + bitField0_ |= 0x00000001; + onChanged(); + } + return this; + } + + /** + * + * + *
        +     * The room to update.
        +     * 
        + * + * .google.showcase.v1beta1.Room room = 1; + */ + public Builder clearRoom() { + bitField0_ = (bitField0_ & ~0x00000001); + room_ = null; + if (roomBuilder_ != null) { + roomBuilder_.dispose(); + roomBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
        +     * The room to update.
        +     * 
        + * + * .google.showcase.v1beta1.Room room = 1; + */ + public com.google.showcase.v1beta1.Room.Builder getRoomBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return getRoomFieldBuilder().getBuilder(); + } + + /** + * + * + *
        +     * The room to update.
        +     * 
        + * + * .google.showcase.v1beta1.Room room = 1; + */ + public com.google.showcase.v1beta1.RoomOrBuilder getRoomOrBuilder() { + if (roomBuilder_ != null) { + return roomBuilder_.getMessageOrBuilder(); + } else { + return room_ == null ? com.google.showcase.v1beta1.Room.getDefaultInstance() : room_; + } + } + + /** + * + * + *
        +     * The room to update.
        +     * 
        + * + * .google.showcase.v1beta1.Room room = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.showcase.v1beta1.Room, + com.google.showcase.v1beta1.Room.Builder, + com.google.showcase.v1beta1.RoomOrBuilder> + getRoomFieldBuilder() { + if (roomBuilder_ == null) { + roomBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.showcase.v1beta1.Room, + com.google.showcase.v1beta1.Room.Builder, + com.google.showcase.v1beta1.RoomOrBuilder>( + getRoom(), getParentForChildren(), isClean()); + room_ = null; + } + return roomBuilder_; + } + + private com.google.protobuf.FieldMask updateMask_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder> + updateMaskBuilder_; + + /** + * + * + *
        +     * The field mask to determine which fields are to be updated. If empty, the
        +     * server will assume all fields are to be updated.
        +     * 
        + * + * .google.protobuf.FieldMask update_mask = 2; + * + * @return Whether the updateMask field is set. + */ + public boolean hasUpdateMask() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
        +     * The field mask to determine which fields are to be updated. If empty, the
        +     * server will assume all fields are to be updated.
        +     * 
        + * + * .google.protobuf.FieldMask update_mask = 2; + * + * @return The updateMask. + */ + public com.google.protobuf.FieldMask getUpdateMask() { + if (updateMaskBuilder_ == null) { + return updateMask_ == null + ? com.google.protobuf.FieldMask.getDefaultInstance() + : updateMask_; + } else { + return updateMaskBuilder_.getMessage(); + } + } + + /** + * + * + *
        +     * The field mask to determine which fields are to be updated. If empty, the
        +     * server will assume all fields are to be updated.
        +     * 
        + * + * .google.protobuf.FieldMask update_mask = 2; + */ + public Builder setUpdateMask(com.google.protobuf.FieldMask value) { + if (updateMaskBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + updateMask_ = value; + } else { + updateMaskBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
        +     * The field mask to determine which fields are to be updated. If empty, the
        +     * server will assume all fields are to be updated.
        +     * 
        + * + * .google.protobuf.FieldMask update_mask = 2; + */ + public Builder setUpdateMask(com.google.protobuf.FieldMask.Builder builderForValue) { + if (updateMaskBuilder_ == null) { + updateMask_ = builderForValue.build(); + } else { + updateMaskBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
        +     * The field mask to determine which fields are to be updated. If empty, the
        +     * server will assume all fields are to be updated.
        +     * 
        + * + * .google.protobuf.FieldMask update_mask = 2; + */ + public Builder mergeUpdateMask(com.google.protobuf.FieldMask value) { + if (updateMaskBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && updateMask_ != null + && updateMask_ != com.google.protobuf.FieldMask.getDefaultInstance()) { + getUpdateMaskBuilder().mergeFrom(value); + } else { + updateMask_ = value; + } + } else { + updateMaskBuilder_.mergeFrom(value); + } + if (updateMask_ != null) { + bitField0_ |= 0x00000002; + onChanged(); + } + return this; + } + + /** + * + * + *
        +     * The field mask to determine which fields are to be updated. If empty, the
        +     * server will assume all fields are to be updated.
        +     * 
        + * + * .google.protobuf.FieldMask update_mask = 2; + */ + public Builder clearUpdateMask() { + bitField0_ = (bitField0_ & ~0x00000002); + updateMask_ = null; + if (updateMaskBuilder_ != null) { + updateMaskBuilder_.dispose(); + updateMaskBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
        +     * The field mask to determine which fields are to be updated. If empty, the
        +     * server will assume all fields are to be updated.
        +     * 
        + * + * .google.protobuf.FieldMask update_mask = 2; + */ + public com.google.protobuf.FieldMask.Builder getUpdateMaskBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return getUpdateMaskFieldBuilder().getBuilder(); + } + + /** + * + * + *
        +     * The field mask to determine which fields are to be updated. If empty, the
        +     * server will assume all fields are to be updated.
        +     * 
        + * + * .google.protobuf.FieldMask update_mask = 2; + */ + public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { + if (updateMaskBuilder_ != null) { + return updateMaskBuilder_.getMessageOrBuilder(); + } else { + return updateMask_ == null + ? com.google.protobuf.FieldMask.getDefaultInstance() + : updateMask_; + } + } + + /** + * + * + *
        +     * The field mask to determine which fields are to be updated. If empty, the
        +     * server will assume all fields are to be updated.
        +     * 
        + * + * .google.protobuf.FieldMask update_mask = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder> + getUpdateMaskFieldBuilder() { + if (updateMaskBuilder_ == null) { + updateMaskBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder>( + getUpdateMask(), getParentForChildren(), isClean()); + updateMask_ = null; + } + return updateMaskBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.showcase.v1beta1.UpdateRoomRequest) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.UpdateRoomRequest) + private static final com.google.showcase.v1beta1.UpdateRoomRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.UpdateRoomRequest(); + } + + public static com.google.showcase.v1beta1.UpdateRoomRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public UpdateRoomRequest 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.showcase.v1beta1.UpdateRoomRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/UpdateRoomRequestOrBuilder.java b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/UpdateRoomRequestOrBuilder.java new file mode 100644 index 0000000000..c2b935993f --- /dev/null +++ b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/UpdateRoomRequestOrBuilder.java @@ -0,0 +1,103 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/messaging.proto + +// Protobuf Java Version: 3.25.8 +package com.google.showcase.v1beta1; + +public interface UpdateRoomRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.UpdateRoomRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
        +   * The room to update.
        +   * 
        + * + * .google.showcase.v1beta1.Room room = 1; + * + * @return Whether the room field is set. + */ + boolean hasRoom(); + + /** + * + * + *
        +   * The room to update.
        +   * 
        + * + * .google.showcase.v1beta1.Room room = 1; + * + * @return The room. + */ + com.google.showcase.v1beta1.Room getRoom(); + + /** + * + * + *
        +   * The room to update.
        +   * 
        + * + * .google.showcase.v1beta1.Room room = 1; + */ + com.google.showcase.v1beta1.RoomOrBuilder getRoomOrBuilder(); + + /** + * + * + *
        +   * The field mask to determine which fields are to be updated. If empty, the
        +   * server will assume all fields are to be updated.
        +   * 
        + * + * .google.protobuf.FieldMask update_mask = 2; + * + * @return Whether the updateMask field is set. + */ + boolean hasUpdateMask(); + + /** + * + * + *
        +   * The field mask to determine which fields are to be updated. If empty, the
        +   * server will assume all fields are to be updated.
        +   * 
        + * + * .google.protobuf.FieldMask update_mask = 2; + * + * @return The updateMask. + */ + com.google.protobuf.FieldMask getUpdateMask(); + + /** + * + * + *
        +   * The field mask to determine which fields are to be updated. If empty, the
        +   * server will assume all fields are to be updated.
        +   * 
        + * + * .google.protobuf.FieldMask update_mask = 2; + */ + com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder(); +} diff --git a/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/UpdateUserRequest.java b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/UpdateUserRequest.java new file mode 100644 index 0000000000..7041abd914 --- /dev/null +++ b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/UpdateUserRequest.java @@ -0,0 +1,1016 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/identity.proto + +// Protobuf Java Version: 3.25.8 +package com.google.showcase.v1beta1; + +/** + * + * + *
        + * The request message for the google.showcase.v1beta1.Identity\UpdateUser
        + * method.
        + * 
        + * + * Protobuf type {@code google.showcase.v1beta1.UpdateUserRequest} + */ +public final class UpdateUserRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.UpdateUserRequest) + UpdateUserRequestOrBuilder { + private static final long serialVersionUID = 0L; + + // Use UpdateUserRequest.newBuilder() to construct. + private UpdateUserRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private UpdateUserRequest() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new UpdateUserRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.IdentityOuterClass + .internal_static_google_showcase_v1beta1_UpdateUserRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.IdentityOuterClass + .internal_static_google_showcase_v1beta1_UpdateUserRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.UpdateUserRequest.class, + com.google.showcase.v1beta1.UpdateUserRequest.Builder.class); + } + + private int bitField0_; + public static final int USER_FIELD_NUMBER = 1; + private com.google.showcase.v1beta1.User user_; + + /** + * + * + *
        +   * The user to update.
        +   * 
        + * + * .google.showcase.v1beta1.User user = 1; + * + * @return Whether the user field is set. + */ + @java.lang.Override + public boolean hasUser() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
        +   * The user to update.
        +   * 
        + * + * .google.showcase.v1beta1.User user = 1; + * + * @return The user. + */ + @java.lang.Override + public com.google.showcase.v1beta1.User getUser() { + return user_ == null ? com.google.showcase.v1beta1.User.getDefaultInstance() : user_; + } + + /** + * + * + *
        +   * The user to update.
        +   * 
        + * + * .google.showcase.v1beta1.User user = 1; + */ + @java.lang.Override + public com.google.showcase.v1beta1.UserOrBuilder getUserOrBuilder() { + return user_ == null ? com.google.showcase.v1beta1.User.getDefaultInstance() : user_; + } + + public static final int UPDATE_MASK_FIELD_NUMBER = 2; + private com.google.protobuf.FieldMask updateMask_; + + /** + * + * + *
        +   * The field mask to determine which fields are to be updated. If empty, the
        +   * server will assume all fields are to be updated.
        +   * 
        + * + * .google.protobuf.FieldMask update_mask = 2; + * + * @return Whether the updateMask field is set. + */ + @java.lang.Override + public boolean hasUpdateMask() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
        +   * The field mask to determine which fields are to be updated. If empty, the
        +   * server will assume all fields are to be updated.
        +   * 
        + * + * .google.protobuf.FieldMask update_mask = 2; + * + * @return The updateMask. + */ + @java.lang.Override + public com.google.protobuf.FieldMask getUpdateMask() { + return updateMask_ == null ? com.google.protobuf.FieldMask.getDefaultInstance() : updateMask_; + } + + /** + * + * + *
        +   * The field mask to determine which fields are to be updated. If empty, the
        +   * server will assume all fields are to be updated.
        +   * 
        + * + * .google.protobuf.FieldMask update_mask = 2; + */ + @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 (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(1, getUser()); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeMessage(2, getUpdateMask()); + } + 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, getUser()); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, 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.showcase.v1beta1.UpdateUserRequest)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.UpdateUserRequest other = + (com.google.showcase.v1beta1.UpdateUserRequest) obj; + + if (hasUser() != other.hasUser()) return false; + if (hasUser()) { + if (!getUser().equals(other.getUser())) 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(); + if (hasUser()) { + hash = (37 * hash) + USER_FIELD_NUMBER; + hash = (53 * hash) + getUser().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.showcase.v1beta1.UpdateUserRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.UpdateUserRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.UpdateUserRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.UpdateUserRequest 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.showcase.v1beta1.UpdateUserRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.UpdateUserRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.UpdateUserRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.UpdateUserRequest 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.showcase.v1beta1.UpdateUserRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.UpdateUserRequest 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.showcase.v1beta1.UpdateUserRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.UpdateUserRequest 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.showcase.v1beta1.UpdateUserRequest 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 request message for the google.showcase.v1beta1.Identity\UpdateUser
        +   * method.
        +   * 
        + * + * Protobuf type {@code google.showcase.v1beta1.UpdateUserRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.UpdateUserRequest) + com.google.showcase.v1beta1.UpdateUserRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.IdentityOuterClass + .internal_static_google_showcase_v1beta1_UpdateUserRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.IdentityOuterClass + .internal_static_google_showcase_v1beta1_UpdateUserRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.UpdateUserRequest.class, + com.google.showcase.v1beta1.UpdateUserRequest.Builder.class); + } + + // Construct using com.google.showcase.v1beta1.UpdateUserRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getUserFieldBuilder(); + getUpdateMaskFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + user_ = null; + if (userBuilder_ != null) { + userBuilder_.dispose(); + userBuilder_ = 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.showcase.v1beta1.IdentityOuterClass + .internal_static_google_showcase_v1beta1_UpdateUserRequest_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.UpdateUserRequest getDefaultInstanceForType() { + return com.google.showcase.v1beta1.UpdateUserRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.UpdateUserRequest build() { + com.google.showcase.v1beta1.UpdateUserRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.UpdateUserRequest buildPartial() { + com.google.showcase.v1beta1.UpdateUserRequest result = + new com.google.showcase.v1beta1.UpdateUserRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.showcase.v1beta1.UpdateUserRequest result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.user_ = userBuilder_ == null ? user_ : userBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000002) != 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.showcase.v1beta1.UpdateUserRequest) { + return mergeFrom((com.google.showcase.v1beta1.UpdateUserRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.showcase.v1beta1.UpdateUserRequest other) { + if (other == com.google.showcase.v1beta1.UpdateUserRequest.getDefaultInstance()) return this; + if (other.hasUser()) { + mergeUser(other.getUser()); + } + 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: + { + input.readMessage(getUserFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + input.readMessage(getUpdateMaskFieldBuilder().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 com.google.showcase.v1beta1.User user_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.showcase.v1beta1.User, + com.google.showcase.v1beta1.User.Builder, + com.google.showcase.v1beta1.UserOrBuilder> + userBuilder_; + + /** + * + * + *
        +     * The user to update.
        +     * 
        + * + * .google.showcase.v1beta1.User user = 1; + * + * @return Whether the user field is set. + */ + public boolean hasUser() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
        +     * The user to update.
        +     * 
        + * + * .google.showcase.v1beta1.User user = 1; + * + * @return The user. + */ + public com.google.showcase.v1beta1.User getUser() { + if (userBuilder_ == null) { + return user_ == null ? com.google.showcase.v1beta1.User.getDefaultInstance() : user_; + } else { + return userBuilder_.getMessage(); + } + } + + /** + * + * + *
        +     * The user to update.
        +     * 
        + * + * .google.showcase.v1beta1.User user = 1; + */ + public Builder setUser(com.google.showcase.v1beta1.User value) { + if (userBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + user_ = value; + } else { + userBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
        +     * The user to update.
        +     * 
        + * + * .google.showcase.v1beta1.User user = 1; + */ + public Builder setUser(com.google.showcase.v1beta1.User.Builder builderForValue) { + if (userBuilder_ == null) { + user_ = builderForValue.build(); + } else { + userBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
        +     * The user to update.
        +     * 
        + * + * .google.showcase.v1beta1.User user = 1; + */ + public Builder mergeUser(com.google.showcase.v1beta1.User value) { + if (userBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) + && user_ != null + && user_ != com.google.showcase.v1beta1.User.getDefaultInstance()) { + getUserBuilder().mergeFrom(value); + } else { + user_ = value; + } + } else { + userBuilder_.mergeFrom(value); + } + if (user_ != null) { + bitField0_ |= 0x00000001; + onChanged(); + } + return this; + } + + /** + * + * + *
        +     * The user to update.
        +     * 
        + * + * .google.showcase.v1beta1.User user = 1; + */ + public Builder clearUser() { + bitField0_ = (bitField0_ & ~0x00000001); + user_ = null; + if (userBuilder_ != null) { + userBuilder_.dispose(); + userBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
        +     * The user to update.
        +     * 
        + * + * .google.showcase.v1beta1.User user = 1; + */ + public com.google.showcase.v1beta1.User.Builder getUserBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return getUserFieldBuilder().getBuilder(); + } + + /** + * + * + *
        +     * The user to update.
        +     * 
        + * + * .google.showcase.v1beta1.User user = 1; + */ + public com.google.showcase.v1beta1.UserOrBuilder getUserOrBuilder() { + if (userBuilder_ != null) { + return userBuilder_.getMessageOrBuilder(); + } else { + return user_ == null ? com.google.showcase.v1beta1.User.getDefaultInstance() : user_; + } + } + + /** + * + * + *
        +     * The user to update.
        +     * 
        + * + * .google.showcase.v1beta1.User user = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.showcase.v1beta1.User, + com.google.showcase.v1beta1.User.Builder, + com.google.showcase.v1beta1.UserOrBuilder> + getUserFieldBuilder() { + if (userBuilder_ == null) { + userBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.showcase.v1beta1.User, + com.google.showcase.v1beta1.User.Builder, + com.google.showcase.v1beta1.UserOrBuilder>( + getUser(), getParentForChildren(), isClean()); + user_ = null; + } + return userBuilder_; + } + + private com.google.protobuf.FieldMask updateMask_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder> + updateMaskBuilder_; + + /** + * + * + *
        +     * The field mask to determine which fields are to be updated. If empty, the
        +     * server will assume all fields are to be updated.
        +     * 
        + * + * .google.protobuf.FieldMask update_mask = 2; + * + * @return Whether the updateMask field is set. + */ + public boolean hasUpdateMask() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
        +     * The field mask to determine which fields are to be updated. If empty, the
        +     * server will assume all fields are to be updated.
        +     * 
        + * + * .google.protobuf.FieldMask update_mask = 2; + * + * @return The updateMask. + */ + public com.google.protobuf.FieldMask getUpdateMask() { + if (updateMaskBuilder_ == null) { + return updateMask_ == null + ? com.google.protobuf.FieldMask.getDefaultInstance() + : updateMask_; + } else { + return updateMaskBuilder_.getMessage(); + } + } + + /** + * + * + *
        +     * The field mask to determine which fields are to be updated. If empty, the
        +     * server will assume all fields are to be updated.
        +     * 
        + * + * .google.protobuf.FieldMask update_mask = 2; + */ + public Builder setUpdateMask(com.google.protobuf.FieldMask value) { + if (updateMaskBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + updateMask_ = value; + } else { + updateMaskBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
        +     * The field mask to determine which fields are to be updated. If empty, the
        +     * server will assume all fields are to be updated.
        +     * 
        + * + * .google.protobuf.FieldMask update_mask = 2; + */ + public Builder setUpdateMask(com.google.protobuf.FieldMask.Builder builderForValue) { + if (updateMaskBuilder_ == null) { + updateMask_ = builderForValue.build(); + } else { + updateMaskBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
        +     * The field mask to determine which fields are to be updated. If empty, the
        +     * server will assume all fields are to be updated.
        +     * 
        + * + * .google.protobuf.FieldMask update_mask = 2; + */ + public Builder mergeUpdateMask(com.google.protobuf.FieldMask value) { + if (updateMaskBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && updateMask_ != null + && updateMask_ != com.google.protobuf.FieldMask.getDefaultInstance()) { + getUpdateMaskBuilder().mergeFrom(value); + } else { + updateMask_ = value; + } + } else { + updateMaskBuilder_.mergeFrom(value); + } + if (updateMask_ != null) { + bitField0_ |= 0x00000002; + onChanged(); + } + return this; + } + + /** + * + * + *
        +     * The field mask to determine which fields are to be updated. If empty, the
        +     * server will assume all fields are to be updated.
        +     * 
        + * + * .google.protobuf.FieldMask update_mask = 2; + */ + public Builder clearUpdateMask() { + bitField0_ = (bitField0_ & ~0x00000002); + updateMask_ = null; + if (updateMaskBuilder_ != null) { + updateMaskBuilder_.dispose(); + updateMaskBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
        +     * The field mask to determine which fields are to be updated. If empty, the
        +     * server will assume all fields are to be updated.
        +     * 
        + * + * .google.protobuf.FieldMask update_mask = 2; + */ + public com.google.protobuf.FieldMask.Builder getUpdateMaskBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return getUpdateMaskFieldBuilder().getBuilder(); + } + + /** + * + * + *
        +     * The field mask to determine which fields are to be updated. If empty, the
        +     * server will assume all fields are to be updated.
        +     * 
        + * + * .google.protobuf.FieldMask update_mask = 2; + */ + public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { + if (updateMaskBuilder_ != null) { + return updateMaskBuilder_.getMessageOrBuilder(); + } else { + return updateMask_ == null + ? com.google.protobuf.FieldMask.getDefaultInstance() + : updateMask_; + } + } + + /** + * + * + *
        +     * The field mask to determine which fields are to be updated. If empty, the
        +     * server will assume all fields are to be updated.
        +     * 
        + * + * .google.protobuf.FieldMask update_mask = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder> + getUpdateMaskFieldBuilder() { + if (updateMaskBuilder_ == null) { + updateMaskBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder>( + getUpdateMask(), getParentForChildren(), isClean()); + updateMask_ = null; + } + return updateMaskBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.showcase.v1beta1.UpdateUserRequest) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.UpdateUserRequest) + private static final com.google.showcase.v1beta1.UpdateUserRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.UpdateUserRequest(); + } + + public static com.google.showcase.v1beta1.UpdateUserRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public UpdateUserRequest 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.showcase.v1beta1.UpdateUserRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/UpdateUserRequestOrBuilder.java b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/UpdateUserRequestOrBuilder.java new file mode 100644 index 0000000000..1fb139f12b --- /dev/null +++ b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/UpdateUserRequestOrBuilder.java @@ -0,0 +1,103 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/identity.proto + +// Protobuf Java Version: 3.25.8 +package com.google.showcase.v1beta1; + +public interface UpdateUserRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.UpdateUserRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
        +   * The user to update.
        +   * 
        + * + * .google.showcase.v1beta1.User user = 1; + * + * @return Whether the user field is set. + */ + boolean hasUser(); + + /** + * + * + *
        +   * The user to update.
        +   * 
        + * + * .google.showcase.v1beta1.User user = 1; + * + * @return The user. + */ + com.google.showcase.v1beta1.User getUser(); + + /** + * + * + *
        +   * The user to update.
        +   * 
        + * + * .google.showcase.v1beta1.User user = 1; + */ + com.google.showcase.v1beta1.UserOrBuilder getUserOrBuilder(); + + /** + * + * + *
        +   * The field mask to determine which fields are to be updated. If empty, the
        +   * server will assume all fields are to be updated.
        +   * 
        + * + * .google.protobuf.FieldMask update_mask = 2; + * + * @return Whether the updateMask field is set. + */ + boolean hasUpdateMask(); + + /** + * + * + *
        +   * The field mask to determine which fields are to be updated. If empty, the
        +   * server will assume all fields are to be updated.
        +   * 
        + * + * .google.protobuf.FieldMask update_mask = 2; + * + * @return The updateMask. + */ + com.google.protobuf.FieldMask getUpdateMask(); + + /** + * + * + *
        +   * The field mask to determine which fields are to be updated. If empty, the
        +   * server will assume all fields are to be updated.
        +   * 
        + * + * .google.protobuf.FieldMask update_mask = 2; + */ + com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder(); +} diff --git a/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/User.java b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/User.java new file mode 100644 index 0000000000..a3a9422d36 --- /dev/null +++ b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/User.java @@ -0,0 +1,2292 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/identity.proto + +// Protobuf Java Version: 3.25.8 +package com.google.showcase.v1beta1; + +/** + * + * + *
        + * A user.
        + * 
        + * + * Protobuf type {@code google.showcase.v1beta1.User} + */ +public final class User extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.User) + UserOrBuilder { + private static final long serialVersionUID = 0L; + + // Use User.newBuilder() to construct. + private User(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private User() { + name_ = ""; + displayName_ = ""; + email_ = ""; + nickname_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new User(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.IdentityOuterClass + .internal_static_google_showcase_v1beta1_User_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.IdentityOuterClass + .internal_static_google_showcase_v1beta1_User_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.User.class, com.google.showcase.v1beta1.User.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 user.
        +   * 
        + * + * 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 user.
        +   * 
        + * + * 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 DISPLAY_NAME_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object displayName_ = ""; + + /** + * + * + *
        +   * The display_name of the user.
        +   * 
        + * + * string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The displayName. + */ + @java.lang.Override + public java.lang.String getDisplayName() { + java.lang.Object ref = displayName_; + 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(); + displayName_ = s; + return s; + } + } + + /** + * + * + *
        +   * The display_name of the user.
        +   * 
        + * + * string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for displayName. + */ + @java.lang.Override + public com.google.protobuf.ByteString getDisplayNameBytes() { + java.lang.Object ref = displayName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + displayName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int EMAIL_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object email_ = ""; + + /** + * + * + *
        +   * The email address of the user.
        +   * 
        + * + * string email = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The email. + */ + @java.lang.Override + public java.lang.String getEmail() { + java.lang.Object ref = email_; + 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(); + email_ = s; + return s; + } + } + + /** + * + * + *
        +   * The email address of the user.
        +   * 
        + * + * string email = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for email. + */ + @java.lang.Override + public com.google.protobuf.ByteString getEmailBytes() { + java.lang.Object ref = email_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + email_ = 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_; + + /** + * + * + *
        +   * The timestamp at which the user was created.
        +   * 
        + * + * .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); + } + + /** + * + * + *
        +   * The timestamp at which the user was created.
        +   * 
        + * + * .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_; + } + + /** + * + * + *
        +   * The timestamp at which the user was created.
        +   * 
        + * + * .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_; + + /** + * + * + *
        +   * The latest timestamp at which the user was updated.
        +   * 
        + * + * .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the updateTime field is set. + */ + @java.lang.Override + public boolean hasUpdateTime() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
        +   * The latest timestamp at which the user was updated.
        +   * 
        + * + * .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The updateTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getUpdateTime() { + return updateTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : updateTime_; + } + + /** + * + * + *
        +   * The latest timestamp at which the user was updated.
        +   * 
        + * + * .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 AGE_FIELD_NUMBER = 6; + private int age_ = 0; + + /** + * + * + *
        +   * The age of the user in years.
        +   * 
        + * + * optional int32 age = 6; + * + * @return Whether the age field is set. + */ + @java.lang.Override + public boolean hasAge() { + return ((bitField0_ & 0x00000004) != 0); + } + + /** + * + * + *
        +   * The age of the user in years.
        +   * 
        + * + * optional int32 age = 6; + * + * @return The age. + */ + @java.lang.Override + public int getAge() { + return age_; + } + + public static final int HEIGHT_FEET_FIELD_NUMBER = 7; + private double heightFeet_ = 0D; + + /** + * + * + *
        +   * The height of the user in feet.
        +   * 
        + * + * optional double height_feet = 7; + * + * @return Whether the heightFeet field is set. + */ + @java.lang.Override + public boolean hasHeightFeet() { + return ((bitField0_ & 0x00000008) != 0); + } + + /** + * + * + *
        +   * The height of the user in feet.
        +   * 
        + * + * optional double height_feet = 7; + * + * @return The heightFeet. + */ + @java.lang.Override + public double getHeightFeet() { + return heightFeet_; + } + + public static final int NICKNAME_FIELD_NUMBER = 8; + + @SuppressWarnings("serial") + private volatile java.lang.Object nickname_ = ""; + + /** + * + * + *
        +   * The nickname of the user.
        +   *
        +   * (-- aip.dev/not-precedent: An empty string is a valid nickname.
        +   *     Ordinarily, proto3_optional should not be used on a `string` field. --)
        +   * 
        + * + * optional string nickname = 8; + * + * @return Whether the nickname field is set. + */ + @java.lang.Override + public boolean hasNickname() { + return ((bitField0_ & 0x00000010) != 0); + } + + /** + * + * + *
        +   * The nickname of the user.
        +   *
        +   * (-- aip.dev/not-precedent: An empty string is a valid nickname.
        +   *     Ordinarily, proto3_optional should not be used on a `string` field. --)
        +   * 
        + * + * optional string nickname = 8; + * + * @return The nickname. + */ + @java.lang.Override + public java.lang.String getNickname() { + java.lang.Object ref = nickname_; + 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(); + nickname_ = s; + return s; + } + } + + /** + * + * + *
        +   * The nickname of the user.
        +   *
        +   * (-- aip.dev/not-precedent: An empty string is a valid nickname.
        +   *     Ordinarily, proto3_optional should not be used on a `string` field. --)
        +   * 
        + * + * optional string nickname = 8; + * + * @return The bytes for nickname. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNicknameBytes() { + java.lang.Object ref = nickname_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + nickname_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int ENABLE_NOTIFICATIONS_FIELD_NUMBER = 9; + private boolean enableNotifications_ = false; + + /** + * + * + *
        +   * Enables the receiving of notifications. The default is true if unset.
        +   *
        +   * (-- aip.dev/not-precedent: The default for the feature is true.
        +   *     Ordinarily, the default for a `bool` field should be false. --)
        +   * 
        + * + * optional bool enable_notifications = 9; + * + * @return Whether the enableNotifications field is set. + */ + @java.lang.Override + public boolean hasEnableNotifications() { + return ((bitField0_ & 0x00000020) != 0); + } + + /** + * + * + *
        +   * Enables the receiving of notifications. The default is true if unset.
        +   *
        +   * (-- aip.dev/not-precedent: The default for the feature is true.
        +   *     Ordinarily, the default for a `bool` field should be false. --)
        +   * 
        + * + * optional bool enable_notifications = 9; + * + * @return The enableNotifications. + */ + @java.lang.Override + public boolean getEnableNotifications() { + return enableNotifications_; + } + + 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(displayName_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, displayName_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(email_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, email_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(4, getCreateTime()); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeMessage(5, getUpdateTime()); + } + if (((bitField0_ & 0x00000004) != 0)) { + output.writeInt32(6, age_); + } + if (((bitField0_ & 0x00000008) != 0)) { + output.writeDouble(7, heightFeet_); + } + if (((bitField0_ & 0x00000010) != 0)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 8, nickname_); + } + if (((bitField0_ & 0x00000020) != 0)) { + output.writeBool(9, enableNotifications_); + } + 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(displayName_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, displayName_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(email_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, email_); + } + 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 (((bitField0_ & 0x00000004) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(6, age_); + } + if (((bitField0_ & 0x00000008) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeDoubleSize(7, heightFeet_); + } + if (((bitField0_ & 0x00000010) != 0)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(8, nickname_); + } + if (((bitField0_ & 0x00000020) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(9, enableNotifications_); + } + 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.showcase.v1beta1.User)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.User other = (com.google.showcase.v1beta1.User) obj; + + if (!getName().equals(other.getName())) return false; + if (!getDisplayName().equals(other.getDisplayName())) return false; + if (!getEmail().equals(other.getEmail())) 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 (hasAge() != other.hasAge()) return false; + if (hasAge()) { + if (getAge() != other.getAge()) return false; + } + if (hasHeightFeet() != other.hasHeightFeet()) return false; + if (hasHeightFeet()) { + if (java.lang.Double.doubleToLongBits(getHeightFeet()) + != java.lang.Double.doubleToLongBits(other.getHeightFeet())) return false; + } + if (hasNickname() != other.hasNickname()) return false; + if (hasNickname()) { + if (!getNickname().equals(other.getNickname())) return false; + } + if (hasEnableNotifications() != other.hasEnableNotifications()) return false; + if (hasEnableNotifications()) { + if (getEnableNotifications() != other.getEnableNotifications()) 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) + DISPLAY_NAME_FIELD_NUMBER; + hash = (53 * hash) + getDisplayName().hashCode(); + hash = (37 * hash) + EMAIL_FIELD_NUMBER; + hash = (53 * hash) + getEmail().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(); + } + if (hasAge()) { + hash = (37 * hash) + AGE_FIELD_NUMBER; + hash = (53 * hash) + getAge(); + } + if (hasHeightFeet()) { + hash = (37 * hash) + HEIGHT_FEET_FIELD_NUMBER; + hash = + (53 * hash) + + com.google.protobuf.Internal.hashLong( + java.lang.Double.doubleToLongBits(getHeightFeet())); + } + if (hasNickname()) { + hash = (37 * hash) + NICKNAME_FIELD_NUMBER; + hash = (53 * hash) + getNickname().hashCode(); + } + if (hasEnableNotifications()) { + hash = (37 * hash) + ENABLE_NOTIFICATIONS_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getEnableNotifications()); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.showcase.v1beta1.User parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.User parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.User parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.User 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.showcase.v1beta1.User parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.User parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.User parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.User 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.showcase.v1beta1.User parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.User 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.showcase.v1beta1.User parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.User 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.showcase.v1beta1.User prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
        +   * A user.
        +   * 
        + * + * Protobuf type {@code google.showcase.v1beta1.User} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.User) + com.google.showcase.v1beta1.UserOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.IdentityOuterClass + .internal_static_google_showcase_v1beta1_User_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.IdentityOuterClass + .internal_static_google_showcase_v1beta1_User_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.User.class, + com.google.showcase.v1beta1.User.Builder.class); + } + + // Construct using com.google.showcase.v1beta1.User.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_ = ""; + displayName_ = ""; + email_ = ""; + createTime_ = null; + if (createTimeBuilder_ != null) { + createTimeBuilder_.dispose(); + createTimeBuilder_ = null; + } + updateTime_ = null; + if (updateTimeBuilder_ != null) { + updateTimeBuilder_.dispose(); + updateTimeBuilder_ = null; + } + age_ = 0; + heightFeet_ = 0D; + nickname_ = ""; + enableNotifications_ = false; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.showcase.v1beta1.IdentityOuterClass + .internal_static_google_showcase_v1beta1_User_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.User getDefaultInstanceForType() { + return com.google.showcase.v1beta1.User.getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.User build() { + com.google.showcase.v1beta1.User result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.User buildPartial() { + com.google.showcase.v1beta1.User result = new com.google.showcase.v1beta1.User(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.showcase.v1beta1.User result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.displayName_ = displayName_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.email_ = email_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000008) != 0)) { + result.createTime_ = createTimeBuilder_ == null ? createTime_ : createTimeBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.updateTime_ = updateTimeBuilder_ == null ? updateTime_ : updateTimeBuilder_.build(); + to_bitField0_ |= 0x00000002; + } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.age_ = age_; + to_bitField0_ |= 0x00000004; + } + if (((from_bitField0_ & 0x00000040) != 0)) { + result.heightFeet_ = heightFeet_; + to_bitField0_ |= 0x00000008; + } + if (((from_bitField0_ & 0x00000080) != 0)) { + result.nickname_ = nickname_; + to_bitField0_ |= 0x00000010; + } + if (((from_bitField0_ & 0x00000100) != 0)) { + result.enableNotifications_ = enableNotifications_; + to_bitField0_ |= 0x00000020; + } + 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.showcase.v1beta1.User) { + return mergeFrom((com.google.showcase.v1beta1.User) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.showcase.v1beta1.User other) { + if (other == com.google.showcase.v1beta1.User.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getDisplayName().isEmpty()) { + displayName_ = other.displayName_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (!other.getEmail().isEmpty()) { + email_ = other.email_; + bitField0_ |= 0x00000004; + onChanged(); + } + if (other.hasCreateTime()) { + mergeCreateTime(other.getCreateTime()); + } + if (other.hasUpdateTime()) { + mergeUpdateTime(other.getUpdateTime()); + } + if (other.hasAge()) { + setAge(other.getAge()); + } + if (other.hasHeightFeet()) { + setHeightFeet(other.getHeightFeet()); + } + if (other.hasNickname()) { + nickname_ = other.nickname_; + bitField0_ |= 0x00000080; + onChanged(); + } + if (other.hasEnableNotifications()) { + setEnableNotifications(other.getEnableNotifications()); + } + 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: + { + displayName_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + email_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 34: + { + input.readMessage(getCreateTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000008; + break; + } // case 34 + case 42: + { + input.readMessage(getUpdateTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000010; + break; + } // case 42 + case 48: + { + age_ = input.readInt32(); + bitField0_ |= 0x00000020; + break; + } // case 48 + case 57: + { + heightFeet_ = input.readDouble(); + bitField0_ |= 0x00000040; + break; + } // case 57 + case 66: + { + nickname_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000080; + break; + } // case 66 + case 72: + { + enableNotifications_ = input.readBool(); + bitField0_ |= 0x00000100; + break; + } // case 72 + 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 user.
        +     * 
        + * + * 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 user.
        +     * 
        + * + * 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 user.
        +     * 
        + * + * 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 user.
        +     * 
        + * + * 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 user.
        +     * 
        + * + * 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 displayName_ = ""; + + /** + * + * + *
        +     * The display_name of the user.
        +     * 
        + * + * string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The displayName. + */ + public java.lang.String getDisplayName() { + java.lang.Object ref = displayName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + displayName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
        +     * The display_name of the user.
        +     * 
        + * + * string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for displayName. + */ + public com.google.protobuf.ByteString getDisplayNameBytes() { + java.lang.Object ref = displayName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + displayName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
        +     * The display_name of the user.
        +     * 
        + * + * string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The displayName to set. + * @return This builder for chaining. + */ + public Builder setDisplayName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + displayName_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
        +     * The display_name of the user.
        +     * 
        + * + * string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearDisplayName() { + displayName_ = getDefaultInstance().getDisplayName(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
        +     * The display_name of the user.
        +     * 
        + * + * string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for displayName to set. + * @return This builder for chaining. + */ + public Builder setDisplayNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + displayName_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private java.lang.Object email_ = ""; + + /** + * + * + *
        +     * The email address of the user.
        +     * 
        + * + * string email = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The email. + */ + public java.lang.String getEmail() { + java.lang.Object ref = email_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + email_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
        +     * The email address of the user.
        +     * 
        + * + * string email = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for email. + */ + public com.google.protobuf.ByteString getEmailBytes() { + java.lang.Object ref = email_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + email_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
        +     * The email address of the user.
        +     * 
        + * + * string email = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The email to set. + * @return This builder for chaining. + */ + public Builder setEmail(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + email_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
        +     * The email address of the user.
        +     * 
        + * + * string email = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearEmail() { + email_ = getDefaultInstance().getEmail(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + + /** + * + * + *
        +     * The email address of the user.
        +     * 
        + * + * string email = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for email to set. + * @return This builder for chaining. + */ + public Builder setEmailBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + email_ = value; + bitField0_ |= 0x00000004; + 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_; + + /** + * + * + *
        +     * The timestamp at which the user was created.
        +     * 
        + * + * + * .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the createTime field is set. + */ + public boolean hasCreateTime() { + return ((bitField0_ & 0x00000008) != 0); + } + + /** + * + * + *
        +     * The timestamp at which the user was created.
        +     * 
        + * + * + * .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(); + } + } + + /** + * + * + *
        +     * The timestamp at which the user was created.
        +     * 
        + * + * + * .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_ |= 0x00000008; + onChanged(); + return this; + } + + /** + * + * + *
        +     * The timestamp at which the user was created.
        +     * 
        + * + * + * .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_ |= 0x00000008; + onChanged(); + return this; + } + + /** + * + * + *
        +     * The timestamp at which the user was created.
        +     * 
        + * + * + * .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_ & 0x00000008) != 0) + && createTime_ != null + && createTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getCreateTimeBuilder().mergeFrom(value); + } else { + createTime_ = value; + } + } else { + createTimeBuilder_.mergeFrom(value); + } + if (createTime_ != null) { + bitField0_ |= 0x00000008; + onChanged(); + } + return this; + } + + /** + * + * + *
        +     * The timestamp at which the user was created.
        +     * 
        + * + * + * .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearCreateTime() { + bitField0_ = (bitField0_ & ~0x00000008); + createTime_ = null; + if (createTimeBuilder_ != null) { + createTimeBuilder_.dispose(); + createTimeBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
        +     * The timestamp at which the user was created.
        +     * 
        + * + * + * .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.Timestamp.Builder getCreateTimeBuilder() { + bitField0_ |= 0x00000008; + onChanged(); + return getCreateTimeFieldBuilder().getBuilder(); + } + + /** + * + * + *
        +     * The timestamp at which the user was created.
        +     * 
        + * + * + * .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_; + } + } + + /** + * + * + *
        +     * The timestamp at which the user was created.
        +     * 
        + * + * + * .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_; + + /** + * + * + *
        +     * The latest timestamp at which the user was updated.
        +     * 
        + * + * + * .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the updateTime field is set. + */ + public boolean hasUpdateTime() { + return ((bitField0_ & 0x00000010) != 0); + } + + /** + * + * + *
        +     * The latest timestamp at which the user was updated.
        +     * 
        + * + * + * .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The updateTime. + */ + public com.google.protobuf.Timestamp getUpdateTime() { + if (updateTimeBuilder_ == null) { + return updateTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : updateTime_; + } else { + return updateTimeBuilder_.getMessage(); + } + } + + /** + * + * + *
        +     * The latest timestamp at which the user was updated.
        +     * 
        + * + * + * .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setUpdateTime(com.google.protobuf.Timestamp value) { + if (updateTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + updateTime_ = value; + } else { + updateTimeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + /** + * + * + *
        +     * The latest timestamp at which the user was updated.
        +     * 
        + * + * + * .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setUpdateTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (updateTimeBuilder_ == null) { + updateTime_ = builderForValue.build(); + } else { + updateTimeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + /** + * + * + *
        +     * The latest timestamp at which the user was updated.
        +     * 
        + * + * + * .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeUpdateTime(com.google.protobuf.Timestamp value) { + if (updateTimeBuilder_ == null) { + if (((bitField0_ & 0x00000010) != 0) + && updateTime_ != null + && updateTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getUpdateTimeBuilder().mergeFrom(value); + } else { + updateTime_ = value; + } + } else { + updateTimeBuilder_.mergeFrom(value); + } + if (updateTime_ != null) { + bitField0_ |= 0x00000010; + onChanged(); + } + return this; + } + + /** + * + * + *
        +     * The latest timestamp at which the user was updated.
        +     * 
        + * + * + * .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearUpdateTime() { + bitField0_ = (bitField0_ & ~0x00000010); + updateTime_ = null; + if (updateTimeBuilder_ != null) { + updateTimeBuilder_.dispose(); + updateTimeBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
        +     * The latest timestamp at which the user was updated.
        +     * 
        + * + * + * .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.Timestamp.Builder getUpdateTimeBuilder() { + bitField0_ |= 0x00000010; + onChanged(); + return getUpdateTimeFieldBuilder().getBuilder(); + } + + /** + * + * + *
        +     * The latest timestamp at which the user was updated.
        +     * 
        + * + * + * .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder() { + if (updateTimeBuilder_ != null) { + return updateTimeBuilder_.getMessageOrBuilder(); + } else { + return updateTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : updateTime_; + } + } + + /** + * + * + *
        +     * The latest timestamp at which the user was updated.
        +     * 
        + * + * + * .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getUpdateTimeFieldBuilder() { + if (updateTimeBuilder_ == null) { + updateTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getUpdateTime(), getParentForChildren(), isClean()); + updateTime_ = null; + } + return updateTimeBuilder_; + } + + private int age_; + + /** + * + * + *
        +     * The age of the user in years.
        +     * 
        + * + * optional int32 age = 6; + * + * @return Whether the age field is set. + */ + @java.lang.Override + public boolean hasAge() { + return ((bitField0_ & 0x00000020) != 0); + } + + /** + * + * + *
        +     * The age of the user in years.
        +     * 
        + * + * optional int32 age = 6; + * + * @return The age. + */ + @java.lang.Override + public int getAge() { + return age_; + } + + /** + * + * + *
        +     * The age of the user in years.
        +     * 
        + * + * optional int32 age = 6; + * + * @param value The age to set. + * @return This builder for chaining. + */ + public Builder setAge(int value) { + + age_ = value; + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + + /** + * + * + *
        +     * The age of the user in years.
        +     * 
        + * + * optional int32 age = 6; + * + * @return This builder for chaining. + */ + public Builder clearAge() { + bitField0_ = (bitField0_ & ~0x00000020); + age_ = 0; + onChanged(); + return this; + } + + private double heightFeet_; + + /** + * + * + *
        +     * The height of the user in feet.
        +     * 
        + * + * optional double height_feet = 7; + * + * @return Whether the heightFeet field is set. + */ + @java.lang.Override + public boolean hasHeightFeet() { + return ((bitField0_ & 0x00000040) != 0); + } + + /** + * + * + *
        +     * The height of the user in feet.
        +     * 
        + * + * optional double height_feet = 7; + * + * @return The heightFeet. + */ + @java.lang.Override + public double getHeightFeet() { + return heightFeet_; + } + + /** + * + * + *
        +     * The height of the user in feet.
        +     * 
        + * + * optional double height_feet = 7; + * + * @param value The heightFeet to set. + * @return This builder for chaining. + */ + public Builder setHeightFeet(double value) { + + heightFeet_ = value; + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + + /** + * + * + *
        +     * The height of the user in feet.
        +     * 
        + * + * optional double height_feet = 7; + * + * @return This builder for chaining. + */ + public Builder clearHeightFeet() { + bitField0_ = (bitField0_ & ~0x00000040); + heightFeet_ = 0D; + onChanged(); + return this; + } + + private java.lang.Object nickname_ = ""; + + /** + * + * + *
        +     * The nickname of the user.
        +     *
        +     * (-- aip.dev/not-precedent: An empty string is a valid nickname.
        +     *     Ordinarily, proto3_optional should not be used on a `string` field. --)
        +     * 
        + * + * optional string nickname = 8; + * + * @return Whether the nickname field is set. + */ + public boolean hasNickname() { + return ((bitField0_ & 0x00000080) != 0); + } + + /** + * + * + *
        +     * The nickname of the user.
        +     *
        +     * (-- aip.dev/not-precedent: An empty string is a valid nickname.
        +     *     Ordinarily, proto3_optional should not be used on a `string` field. --)
        +     * 
        + * + * optional string nickname = 8; + * + * @return The nickname. + */ + public java.lang.String getNickname() { + java.lang.Object ref = nickname_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nickname_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
        +     * The nickname of the user.
        +     *
        +     * (-- aip.dev/not-precedent: An empty string is a valid nickname.
        +     *     Ordinarily, proto3_optional should not be used on a `string` field. --)
        +     * 
        + * + * optional string nickname = 8; + * + * @return The bytes for nickname. + */ + public com.google.protobuf.ByteString getNicknameBytes() { + java.lang.Object ref = nickname_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + nickname_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
        +     * The nickname of the user.
        +     *
        +     * (-- aip.dev/not-precedent: An empty string is a valid nickname.
        +     *     Ordinarily, proto3_optional should not be used on a `string` field. --)
        +     * 
        + * + * optional string nickname = 8; + * + * @param value The nickname to set. + * @return This builder for chaining. + */ + public Builder setNickname(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + nickname_ = value; + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + + /** + * + * + *
        +     * The nickname of the user.
        +     *
        +     * (-- aip.dev/not-precedent: An empty string is a valid nickname.
        +     *     Ordinarily, proto3_optional should not be used on a `string` field. --)
        +     * 
        + * + * optional string nickname = 8; + * + * @return This builder for chaining. + */ + public Builder clearNickname() { + nickname_ = getDefaultInstance().getNickname(); + bitField0_ = (bitField0_ & ~0x00000080); + onChanged(); + return this; + } + + /** + * + * + *
        +     * The nickname of the user.
        +     *
        +     * (-- aip.dev/not-precedent: An empty string is a valid nickname.
        +     *     Ordinarily, proto3_optional should not be used on a `string` field. --)
        +     * 
        + * + * optional string nickname = 8; + * + * @param value The bytes for nickname to set. + * @return This builder for chaining. + */ + public Builder setNicknameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + nickname_ = value; + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + + private boolean enableNotifications_; + + /** + * + * + *
        +     * Enables the receiving of notifications. The default is true if unset.
        +     *
        +     * (-- aip.dev/not-precedent: The default for the feature is true.
        +     *     Ordinarily, the default for a `bool` field should be false. --)
        +     * 
        + * + * optional bool enable_notifications = 9; + * + * @return Whether the enableNotifications field is set. + */ + @java.lang.Override + public boolean hasEnableNotifications() { + return ((bitField0_ & 0x00000100) != 0); + } + + /** + * + * + *
        +     * Enables the receiving of notifications. The default is true if unset.
        +     *
        +     * (-- aip.dev/not-precedent: The default for the feature is true.
        +     *     Ordinarily, the default for a `bool` field should be false. --)
        +     * 
        + * + * optional bool enable_notifications = 9; + * + * @return The enableNotifications. + */ + @java.lang.Override + public boolean getEnableNotifications() { + return enableNotifications_; + } + + /** + * + * + *
        +     * Enables the receiving of notifications. The default is true if unset.
        +     *
        +     * (-- aip.dev/not-precedent: The default for the feature is true.
        +     *     Ordinarily, the default for a `bool` field should be false. --)
        +     * 
        + * + * optional bool enable_notifications = 9; + * + * @param value The enableNotifications to set. + * @return This builder for chaining. + */ + public Builder setEnableNotifications(boolean value) { + + enableNotifications_ = value; + bitField0_ |= 0x00000100; + onChanged(); + return this; + } + + /** + * + * + *
        +     * Enables the receiving of notifications. The default is true if unset.
        +     *
        +     * (-- aip.dev/not-precedent: The default for the feature is true.
        +     *     Ordinarily, the default for a `bool` field should be false. --)
        +     * 
        + * + * optional bool enable_notifications = 9; + * + * @return This builder for chaining. + */ + public Builder clearEnableNotifications() { + bitField0_ = (bitField0_ & ~0x00000100); + enableNotifications_ = 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.showcase.v1beta1.User) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.User) + private static final com.google.showcase.v1beta1.User DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.User(); + } + + public static com.google.showcase.v1beta1.User getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public User 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.showcase.v1beta1.User getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/UserName.java b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/UserName.java new file mode 100644 index 0000000000..0195b1062d --- /dev/null +++ b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/UserName.java @@ -0,0 +1,166 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1; + +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +@Generated("by gapic-generator-java") +public class UserName implements ResourceName { + private static final PathTemplate USER = PathTemplate.createWithoutUrlEncoding("users/{user}"); + private volatile Map fieldValuesMap; + private final String user; + + @Deprecated + protected UserName() { + user = null; + } + + private UserName(Builder builder) { + user = Preconditions.checkNotNull(builder.getUser()); + } + + public String getUser() { + return user; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + public static UserName of(String user) { + return newBuilder().setUser(user).build(); + } + + public static String format(String user) { + return newBuilder().setUser(user).build().toString(); + } + + public static UserName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + USER.validatedMatch(formattedString, "UserName.parse: formattedString not in valid format"); + return of(matchMap.get("user")); + } + + 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 (UserName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return USER.matches(formattedString); + } + + @Override + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + if (user != null) { + fieldMapBuilder.put("user", user); + } + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return USER.instantiate("user", user); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o != null && getClass() == o.getClass()) { + UserName that = ((UserName) o); + return Objects.equals(this.user, that.user); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= Objects.hashCode(user); + return h; + } + + /** Builder for users/{user}. */ + public static class Builder { + private String user; + + protected Builder() {} + + public String getUser() { + return user; + } + + public Builder setUser(String user) { + this.user = user; + return this; + } + + private Builder(UserName userName) { + this.user = userName.user; + } + + public UserName build() { + return new UserName(this); + } + } +} diff --git a/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/UserOrBuilder.java b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/UserOrBuilder.java new file mode 100644 index 0000000000..bd49258e71 --- /dev/null +++ b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/UserOrBuilder.java @@ -0,0 +1,316 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/identity.proto + +// Protobuf Java Version: 3.25.8 +package com.google.showcase.v1beta1; + +public interface UserOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.User) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
        +   * The resource name of the user.
        +   * 
        + * + * string name = 1; + * + * @return The name. + */ + java.lang.String getName(); + + /** + * + * + *
        +   * The resource name of the user.
        +   * 
        + * + * string name = 1; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
        +   * The display_name of the user.
        +   * 
        + * + * string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The displayName. + */ + java.lang.String getDisplayName(); + + /** + * + * + *
        +   * The display_name of the user.
        +   * 
        + * + * string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for displayName. + */ + com.google.protobuf.ByteString getDisplayNameBytes(); + + /** + * + * + *
        +   * The email address of the user.
        +   * 
        + * + * string email = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The email. + */ + java.lang.String getEmail(); + + /** + * + * + *
        +   * The email address of the user.
        +   * 
        + * + * string email = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for email. + */ + com.google.protobuf.ByteString getEmailBytes(); + + /** + * + * + *
        +   * The timestamp at which the user was created.
        +   * 
        + * + * .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the createTime field is set. + */ + boolean hasCreateTime(); + + /** + * + * + *
        +   * The timestamp at which the user was created.
        +   * 
        + * + * .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The createTime. + */ + com.google.protobuf.Timestamp getCreateTime(); + + /** + * + * + *
        +   * The timestamp at which the user was created.
        +   * 
        + * + * .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder(); + + /** + * + * + *
        +   * The latest timestamp at which the user was updated.
        +   * 
        + * + * .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the updateTime field is set. + */ + boolean hasUpdateTime(); + + /** + * + * + *
        +   * The latest timestamp at which the user was updated.
        +   * 
        + * + * .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The updateTime. + */ + com.google.protobuf.Timestamp getUpdateTime(); + + /** + * + * + *
        +   * The latest timestamp at which the user was updated.
        +   * 
        + * + * .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder(); + + /** + * + * + *
        +   * The age of the user in years.
        +   * 
        + * + * optional int32 age = 6; + * + * @return Whether the age field is set. + */ + boolean hasAge(); + + /** + * + * + *
        +   * The age of the user in years.
        +   * 
        + * + * optional int32 age = 6; + * + * @return The age. + */ + int getAge(); + + /** + * + * + *
        +   * The height of the user in feet.
        +   * 
        + * + * optional double height_feet = 7; + * + * @return Whether the heightFeet field is set. + */ + boolean hasHeightFeet(); + + /** + * + * + *
        +   * The height of the user in feet.
        +   * 
        + * + * optional double height_feet = 7; + * + * @return The heightFeet. + */ + double getHeightFeet(); + + /** + * + * + *
        +   * The nickname of the user.
        +   *
        +   * (-- aip.dev/not-precedent: An empty string is a valid nickname.
        +   *     Ordinarily, proto3_optional should not be used on a `string` field. --)
        +   * 
        + * + * optional string nickname = 8; + * + * @return Whether the nickname field is set. + */ + boolean hasNickname(); + + /** + * + * + *
        +   * The nickname of the user.
        +   *
        +   * (-- aip.dev/not-precedent: An empty string is a valid nickname.
        +   *     Ordinarily, proto3_optional should not be used on a `string` field. --)
        +   * 
        + * + * optional string nickname = 8; + * + * @return The nickname. + */ + java.lang.String getNickname(); + + /** + * + * + *
        +   * The nickname of the user.
        +   *
        +   * (-- aip.dev/not-precedent: An empty string is a valid nickname.
        +   *     Ordinarily, proto3_optional should not be used on a `string` field. --)
        +   * 
        + * + * optional string nickname = 8; + * + * @return The bytes for nickname. + */ + com.google.protobuf.ByteString getNicknameBytes(); + + /** + * + * + *
        +   * Enables the receiving of notifications. The default is true if unset.
        +   *
        +   * (-- aip.dev/not-precedent: The default for the feature is true.
        +   *     Ordinarily, the default for a `bool` field should be false. --)
        +   * 
        + * + * optional bool enable_notifications = 9; + * + * @return Whether the enableNotifications field is set. + */ + boolean hasEnableNotifications(); + + /** + * + * + *
        +   * Enables the receiving of notifications. The default is true if unset.
        +   *
        +   * (-- aip.dev/not-precedent: The default for the feature is true.
        +   *     Ordinarily, the default for a `bool` field should be false. --)
        +   * 
        + * + * optional bool enable_notifications = 9; + * + * @return The enableNotifications. + */ + boolean getEnableNotifications(); +} diff --git a/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/VerifyTestRequest.java b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/VerifyTestRequest.java new file mode 100644 index 0000000000..6b0013da9f --- /dev/null +++ b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/VerifyTestRequest.java @@ -0,0 +1,953 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/testing.proto + +// Protobuf Java Version: 3.25.8 +package com.google.showcase.v1beta1; + +/** Protobuf type {@code google.showcase.v1beta1.VerifyTestRequest} */ +public final class VerifyTestRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.VerifyTestRequest) + VerifyTestRequestOrBuilder { + private static final long serialVersionUID = 0L; + + // Use VerifyTestRequest.newBuilder() to construct. + private VerifyTestRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private VerifyTestRequest() { + name_ = ""; + answer_ = com.google.protobuf.ByteString.EMPTY; + answers_ = emptyList(com.google.protobuf.ByteString.class); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new VerifyTestRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.TestingOuterClass + .internal_static_google_showcase_v1beta1_VerifyTestRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.TestingOuterClass + .internal_static_google_showcase_v1beta1_VerifyTestRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.VerifyTestRequest.class, + com.google.showcase.v1beta1.VerifyTestRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + + /** + * + * + *
        +   * The test to have an answer registered to it.
        +   * 
        + * + * string name = 1 [(.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; + } + } + + /** + * + * + *
        +   * The test to have an answer registered to it.
        +   * 
        + * + * string name = 1 [(.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 ANSWER_FIELD_NUMBER = 2; + private com.google.protobuf.ByteString answer_ = com.google.protobuf.ByteString.EMPTY; + + /** + * + * + *
        +   * The answer from the test.
        +   * 
        + * + * bytes answer = 2; + * + * @return The answer. + */ + @java.lang.Override + public com.google.protobuf.ByteString getAnswer() { + return answer_; + } + + public static final int ANSWERS_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private com.google.protobuf.Internal.ProtobufList answers_ = + emptyList(com.google.protobuf.ByteString.class); + + /** + * + * + *
        +   * The answers from the test if multiple are to be checked
        +   * 
        + * + * repeated bytes answers = 3; + * + * @return A list containing the answers. + */ + @java.lang.Override + public java.util.List getAnswersList() { + return answers_; + } + + /** + * + * + *
        +   * The answers from the test if multiple are to be checked
        +   * 
        + * + * repeated bytes answers = 3; + * + * @return The count of answers. + */ + public int getAnswersCount() { + return answers_.size(); + } + + /** + * + * + *
        +   * The answers from the test if multiple are to be checked
        +   * 
        + * + * repeated bytes answers = 3; + * + * @param index The index of the element to return. + * @return The answers at the given index. + */ + public com.google.protobuf.ByteString getAnswers(int index) { + return answers_.get(index); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + if (!answer_.isEmpty()) { + output.writeBytes(2, answer_); + } + for (int i = 0; i < answers_.size(); i++) { + output.writeBytes(3, answers_.get(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(name_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + if (!answer_.isEmpty()) { + size += com.google.protobuf.CodedOutputStream.computeBytesSize(2, answer_); + } + { + int dataSize = 0; + for (int i = 0; i < answers_.size(); i++) { + dataSize += com.google.protobuf.CodedOutputStream.computeBytesSizeNoTag(answers_.get(i)); + } + size += dataSize; + size += 1 * getAnswersList().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.showcase.v1beta1.VerifyTestRequest)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.VerifyTestRequest other = + (com.google.showcase.v1beta1.VerifyTestRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (!getAnswer().equals(other.getAnswer())) return false; + if (!getAnswersList().equals(other.getAnswersList())) 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) + ANSWER_FIELD_NUMBER; + hash = (53 * hash) + getAnswer().hashCode(); + if (getAnswersCount() > 0) { + hash = (37 * hash) + ANSWERS_FIELD_NUMBER; + hash = (53 * hash) + getAnswersList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.showcase.v1beta1.VerifyTestRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.VerifyTestRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.VerifyTestRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.VerifyTestRequest 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.showcase.v1beta1.VerifyTestRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.VerifyTestRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.VerifyTestRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.VerifyTestRequest 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.showcase.v1beta1.VerifyTestRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.VerifyTestRequest 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.showcase.v1beta1.VerifyTestRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.VerifyTestRequest 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.showcase.v1beta1.VerifyTestRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** Protobuf type {@code google.showcase.v1beta1.VerifyTestRequest} */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.VerifyTestRequest) + com.google.showcase.v1beta1.VerifyTestRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.TestingOuterClass + .internal_static_google_showcase_v1beta1_VerifyTestRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.TestingOuterClass + .internal_static_google_showcase_v1beta1_VerifyTestRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.VerifyTestRequest.class, + com.google.showcase.v1beta1.VerifyTestRequest.Builder.class); + } + + // Construct using com.google.showcase.v1beta1.VerifyTestRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + answer_ = com.google.protobuf.ByteString.EMPTY; + answers_ = emptyList(com.google.protobuf.ByteString.class); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.showcase.v1beta1.TestingOuterClass + .internal_static_google_showcase_v1beta1_VerifyTestRequest_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.VerifyTestRequest getDefaultInstanceForType() { + return com.google.showcase.v1beta1.VerifyTestRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.VerifyTestRequest build() { + com.google.showcase.v1beta1.VerifyTestRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.VerifyTestRequest buildPartial() { + com.google.showcase.v1beta1.VerifyTestRequest result = + new com.google.showcase.v1beta1.VerifyTestRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.showcase.v1beta1.VerifyTestRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.answer_ = answer_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + answers_.makeImmutable(); + result.answers_ = answers_; + } + } + + @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.showcase.v1beta1.VerifyTestRequest) { + return mergeFrom((com.google.showcase.v1beta1.VerifyTestRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.showcase.v1beta1.VerifyTestRequest other) { + if (other == com.google.showcase.v1beta1.VerifyTestRequest.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.getAnswer() != com.google.protobuf.ByteString.EMPTY) { + setAnswer(other.getAnswer()); + } + if (!other.answers_.isEmpty()) { + if (answers_.isEmpty()) { + answers_ = other.answers_; + answers_.makeImmutable(); + bitField0_ |= 0x00000004; + } else { + ensureAnswersIsMutable(); + answers_.addAll(other.answers_); + } + 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: + { + answer_ = input.readBytes(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + com.google.protobuf.ByteString v = input.readBytes(); + ensureAnswersIsMutable(); + answers_.add(v); + 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_ = ""; + + /** + * + * + *
        +     * The test to have an answer registered to it.
        +     * 
        + * + * string name = 1 [(.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; + } + } + + /** + * + * + *
        +     * The test to have an answer registered to it.
        +     * 
        + * + * string name = 1 [(.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; + } + } + + /** + * + * + *
        +     * The test to have an answer registered to it.
        +     * 
        + * + * string name = 1 [(.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; + } + + /** + * + * + *
        +     * The test to have an answer registered to it.
        +     * 
        + * + * string name = 1 [(.google.api.resource_reference) = { ... } + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
        +     * The test to have an answer registered to it.
        +     * 
        + * + * string name = 1 [(.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.protobuf.ByteString answer_ = com.google.protobuf.ByteString.EMPTY; + + /** + * + * + *
        +     * The answer from the test.
        +     * 
        + * + * bytes answer = 2; + * + * @return The answer. + */ + @java.lang.Override + public com.google.protobuf.ByteString getAnswer() { + return answer_; + } + + /** + * + * + *
        +     * The answer from the test.
        +     * 
        + * + * bytes answer = 2; + * + * @param value The answer to set. + * @return This builder for chaining. + */ + public Builder setAnswer(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + answer_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
        +     * The answer from the test.
        +     * 
        + * + * bytes answer = 2; + * + * @return This builder for chaining. + */ + public Builder clearAnswer() { + bitField0_ = (bitField0_ & ~0x00000002); + answer_ = getDefaultInstance().getAnswer(); + onChanged(); + return this; + } + + private com.google.protobuf.Internal.ProtobufList answers_ = + emptyList(com.google.protobuf.ByteString.class); + + private void ensureAnswersIsMutable() { + if (!answers_.isModifiable()) { + answers_ = makeMutableCopy(answers_); + } + bitField0_ |= 0x00000004; + } + + /** + * + * + *
        +     * The answers from the test if multiple are to be checked
        +     * 
        + * + * repeated bytes answers = 3; + * + * @return A list containing the answers. + */ + public java.util.List getAnswersList() { + answers_.makeImmutable(); + return answers_; + } + + /** + * + * + *
        +     * The answers from the test if multiple are to be checked
        +     * 
        + * + * repeated bytes answers = 3; + * + * @return The count of answers. + */ + public int getAnswersCount() { + return answers_.size(); + } + + /** + * + * + *
        +     * The answers from the test if multiple are to be checked
        +     * 
        + * + * repeated bytes answers = 3; + * + * @param index The index of the element to return. + * @return The answers at the given index. + */ + public com.google.protobuf.ByteString getAnswers(int index) { + return answers_.get(index); + } + + /** + * + * + *
        +     * The answers from the test if multiple are to be checked
        +     * 
        + * + * repeated bytes answers = 3; + * + * @param index The index to set the value at. + * @param value The answers to set. + * @return This builder for chaining. + */ + public Builder setAnswers(int index, com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + ensureAnswersIsMutable(); + answers_.set(index, value); + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
        +     * The answers from the test if multiple are to be checked
        +     * 
        + * + * repeated bytes answers = 3; + * + * @param value The answers to add. + * @return This builder for chaining. + */ + public Builder addAnswers(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + ensureAnswersIsMutable(); + answers_.add(value); + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
        +     * The answers from the test if multiple are to be checked
        +     * 
        + * + * repeated bytes answers = 3; + * + * @param values The answers to add. + * @return This builder for chaining. + */ + public Builder addAllAnswers( + java.lang.Iterable values) { + ensureAnswersIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, answers_); + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
        +     * The answers from the test if multiple are to be checked
        +     * 
        + * + * repeated bytes answers = 3; + * + * @return This builder for chaining. + */ + public Builder clearAnswers() { + answers_ = emptyList(com.google.protobuf.ByteString.class); + bitField0_ = (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.showcase.v1beta1.VerifyTestRequest) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.VerifyTestRequest) + private static final com.google.showcase.v1beta1.VerifyTestRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.VerifyTestRequest(); + } + + public static com.google.showcase.v1beta1.VerifyTestRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public VerifyTestRequest 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.showcase.v1beta1.VerifyTestRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/VerifyTestRequestOrBuilder.java b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/VerifyTestRequestOrBuilder.java new file mode 100644 index 0000000000..f9746d2647 --- /dev/null +++ b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/VerifyTestRequestOrBuilder.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: schema/google/showcase/v1beta1/testing.proto + +// Protobuf Java Version: 3.25.8 +package com.google.showcase.v1beta1; + +public interface VerifyTestRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.VerifyTestRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
        +   * The test to have an answer registered to it.
        +   * 
        + * + * string name = 1 [(.google.api.resource_reference) = { ... } + * + * @return The name. + */ + java.lang.String getName(); + + /** + * + * + *
        +   * The test to have an answer registered to it.
        +   * 
        + * + * string name = 1 [(.google.api.resource_reference) = { ... } + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
        +   * The answer from the test.
        +   * 
        + * + * bytes answer = 2; + * + * @return The answer. + */ + com.google.protobuf.ByteString getAnswer(); + + /** + * + * + *
        +   * The answers from the test if multiple are to be checked
        +   * 
        + * + * repeated bytes answers = 3; + * + * @return A list containing the answers. + */ + java.util.List getAnswersList(); + + /** + * + * + *
        +   * The answers from the test if multiple are to be checked
        +   * 
        + * + * repeated bytes answers = 3; + * + * @return The count of answers. + */ + int getAnswersCount(); + + /** + * + * + *
        +   * The answers from the test if multiple are to be checked
        +   * 
        + * + * repeated bytes answers = 3; + * + * @param index The index of the element to return. + * @return The answers at the given index. + */ + com.google.protobuf.ByteString getAnswers(int index); +} diff --git a/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/VerifyTestResponse.java b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/VerifyTestResponse.java new file mode 100644 index 0000000000..e6107907d9 --- /dev/null +++ b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/VerifyTestResponse.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: schema/google/showcase/v1beta1/testing.proto + +// Protobuf Java Version: 3.25.8 +package com.google.showcase.v1beta1; + +/** Protobuf type {@code google.showcase.v1beta1.VerifyTestResponse} */ +public final class VerifyTestResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.VerifyTestResponse) + VerifyTestResponseOrBuilder { + private static final long serialVersionUID = 0L; + + // Use VerifyTestResponse.newBuilder() to construct. + private VerifyTestResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private VerifyTestResponse() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new VerifyTestResponse(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.TestingOuterClass + .internal_static_google_showcase_v1beta1_VerifyTestResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.TestingOuterClass + .internal_static_google_showcase_v1beta1_VerifyTestResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.VerifyTestResponse.class, + com.google.showcase.v1beta1.VerifyTestResponse.Builder.class); + } + + private int bitField0_; + public static final int ISSUE_FIELD_NUMBER = 1; + private com.google.showcase.v1beta1.Issue issue_; + + /** + * + * + *
        +   * An issue if check answer was unsuccessful. This will be empty if the check answer succeeded.
        +   * 
        + * + * .google.showcase.v1beta1.Issue issue = 1; + * + * @return Whether the issue field is set. + */ + @java.lang.Override + public boolean hasIssue() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
        +   * An issue if check answer was unsuccessful. This will be empty if the check answer succeeded.
        +   * 
        + * + * .google.showcase.v1beta1.Issue issue = 1; + * + * @return The issue. + */ + @java.lang.Override + public com.google.showcase.v1beta1.Issue getIssue() { + return issue_ == null ? com.google.showcase.v1beta1.Issue.getDefaultInstance() : issue_; + } + + /** + * + * + *
        +   * An issue if check answer was unsuccessful. This will be empty if the check answer succeeded.
        +   * 
        + * + * .google.showcase.v1beta1.Issue issue = 1; + */ + @java.lang.Override + public com.google.showcase.v1beta1.IssueOrBuilder getIssueOrBuilder() { + return issue_ == null ? com.google.showcase.v1beta1.Issue.getDefaultInstance() : issue_; + } + + 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, getIssue()); + } + 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, getIssue()); + } + 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.showcase.v1beta1.VerifyTestResponse)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.VerifyTestResponse other = + (com.google.showcase.v1beta1.VerifyTestResponse) obj; + + if (hasIssue() != other.hasIssue()) return false; + if (hasIssue()) { + if (!getIssue().equals(other.getIssue())) 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 (hasIssue()) { + hash = (37 * hash) + ISSUE_FIELD_NUMBER; + hash = (53 * hash) + getIssue().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.showcase.v1beta1.VerifyTestResponse parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.VerifyTestResponse parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.VerifyTestResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.VerifyTestResponse 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.showcase.v1beta1.VerifyTestResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.VerifyTestResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.VerifyTestResponse parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.VerifyTestResponse 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.showcase.v1beta1.VerifyTestResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.VerifyTestResponse 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.showcase.v1beta1.VerifyTestResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.VerifyTestResponse 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.showcase.v1beta1.VerifyTestResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** Protobuf type {@code google.showcase.v1beta1.VerifyTestResponse} */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.VerifyTestResponse) + com.google.showcase.v1beta1.VerifyTestResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.TestingOuterClass + .internal_static_google_showcase_v1beta1_VerifyTestResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.TestingOuterClass + .internal_static_google_showcase_v1beta1_VerifyTestResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.VerifyTestResponse.class, + com.google.showcase.v1beta1.VerifyTestResponse.Builder.class); + } + + // Construct using com.google.showcase.v1beta1.VerifyTestResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getIssueFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + issue_ = null; + if (issueBuilder_ != null) { + issueBuilder_.dispose(); + issueBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.showcase.v1beta1.TestingOuterClass + .internal_static_google_showcase_v1beta1_VerifyTestResponse_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.VerifyTestResponse getDefaultInstanceForType() { + return com.google.showcase.v1beta1.VerifyTestResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.VerifyTestResponse build() { + com.google.showcase.v1beta1.VerifyTestResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.VerifyTestResponse buildPartial() { + com.google.showcase.v1beta1.VerifyTestResponse result = + new com.google.showcase.v1beta1.VerifyTestResponse(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.showcase.v1beta1.VerifyTestResponse result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.issue_ = issueBuilder_ == null ? issue_ : issueBuilder_.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.showcase.v1beta1.VerifyTestResponse) { + return mergeFrom((com.google.showcase.v1beta1.VerifyTestResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.showcase.v1beta1.VerifyTestResponse other) { + if (other == com.google.showcase.v1beta1.VerifyTestResponse.getDefaultInstance()) return this; + if (other.hasIssue()) { + mergeIssue(other.getIssue()); + } + 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(getIssueFieldBuilder().getBuilder(), extensionRegistry); + 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 com.google.showcase.v1beta1.Issue issue_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.showcase.v1beta1.Issue, + com.google.showcase.v1beta1.Issue.Builder, + com.google.showcase.v1beta1.IssueOrBuilder> + issueBuilder_; + + /** + * + * + *
        +     * An issue if check answer was unsuccessful. This will be empty if the check answer succeeded.
        +     * 
        + * + * .google.showcase.v1beta1.Issue issue = 1; + * + * @return Whether the issue field is set. + */ + public boolean hasIssue() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
        +     * An issue if check answer was unsuccessful. This will be empty if the check answer succeeded.
        +     * 
        + * + * .google.showcase.v1beta1.Issue issue = 1; + * + * @return The issue. + */ + public com.google.showcase.v1beta1.Issue getIssue() { + if (issueBuilder_ == null) { + return issue_ == null ? com.google.showcase.v1beta1.Issue.getDefaultInstance() : issue_; + } else { + return issueBuilder_.getMessage(); + } + } + + /** + * + * + *
        +     * An issue if check answer was unsuccessful. This will be empty if the check answer succeeded.
        +     * 
        + * + * .google.showcase.v1beta1.Issue issue = 1; + */ + public Builder setIssue(com.google.showcase.v1beta1.Issue value) { + if (issueBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + issue_ = value; + } else { + issueBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
        +     * An issue if check answer was unsuccessful. This will be empty if the check answer succeeded.
        +     * 
        + * + * .google.showcase.v1beta1.Issue issue = 1; + */ + public Builder setIssue(com.google.showcase.v1beta1.Issue.Builder builderForValue) { + if (issueBuilder_ == null) { + issue_ = builderForValue.build(); + } else { + issueBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
        +     * An issue if check answer was unsuccessful. This will be empty if the check answer succeeded.
        +     * 
        + * + * .google.showcase.v1beta1.Issue issue = 1; + */ + public Builder mergeIssue(com.google.showcase.v1beta1.Issue value) { + if (issueBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) + && issue_ != null + && issue_ != com.google.showcase.v1beta1.Issue.getDefaultInstance()) { + getIssueBuilder().mergeFrom(value); + } else { + issue_ = value; + } + } else { + issueBuilder_.mergeFrom(value); + } + if (issue_ != null) { + bitField0_ |= 0x00000001; + onChanged(); + } + return this; + } + + /** + * + * + *
        +     * An issue if check answer was unsuccessful. This will be empty if the check answer succeeded.
        +     * 
        + * + * .google.showcase.v1beta1.Issue issue = 1; + */ + public Builder clearIssue() { + bitField0_ = (bitField0_ & ~0x00000001); + issue_ = null; + if (issueBuilder_ != null) { + issueBuilder_.dispose(); + issueBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
        +     * An issue if check answer was unsuccessful. This will be empty if the check answer succeeded.
        +     * 
        + * + * .google.showcase.v1beta1.Issue issue = 1; + */ + public com.google.showcase.v1beta1.Issue.Builder getIssueBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return getIssueFieldBuilder().getBuilder(); + } + + /** + * + * + *
        +     * An issue if check answer was unsuccessful. This will be empty if the check answer succeeded.
        +     * 
        + * + * .google.showcase.v1beta1.Issue issue = 1; + */ + public com.google.showcase.v1beta1.IssueOrBuilder getIssueOrBuilder() { + if (issueBuilder_ != null) { + return issueBuilder_.getMessageOrBuilder(); + } else { + return issue_ == null ? com.google.showcase.v1beta1.Issue.getDefaultInstance() : issue_; + } + } + + /** + * + * + *
        +     * An issue if check answer was unsuccessful. This will be empty if the check answer succeeded.
        +     * 
        + * + * .google.showcase.v1beta1.Issue issue = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.showcase.v1beta1.Issue, + com.google.showcase.v1beta1.Issue.Builder, + com.google.showcase.v1beta1.IssueOrBuilder> + getIssueFieldBuilder() { + if (issueBuilder_ == null) { + issueBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.showcase.v1beta1.Issue, + com.google.showcase.v1beta1.Issue.Builder, + com.google.showcase.v1beta1.IssueOrBuilder>( + getIssue(), getParentForChildren(), isClean()); + issue_ = null; + } + return issueBuilder_; + } + + @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.showcase.v1beta1.VerifyTestResponse) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.VerifyTestResponse) + private static final com.google.showcase.v1beta1.VerifyTestResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.VerifyTestResponse(); + } + + public static com.google.showcase.v1beta1.VerifyTestResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public VerifyTestResponse 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.showcase.v1beta1.VerifyTestResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/VerifyTestResponseOrBuilder.java b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/VerifyTestResponseOrBuilder.java new file mode 100644 index 0000000000..8edce42f1e --- /dev/null +++ b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/VerifyTestResponseOrBuilder.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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/testing.proto + +// Protobuf Java Version: 3.25.8 +package com.google.showcase.v1beta1; + +public interface VerifyTestResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.VerifyTestResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
        +   * An issue if check answer was unsuccessful. This will be empty if the check answer succeeded.
        +   * 
        + * + * .google.showcase.v1beta1.Issue issue = 1; + * + * @return Whether the issue field is set. + */ + boolean hasIssue(); + + /** + * + * + *
        +   * An issue if check answer was unsuccessful. This will be empty if the check answer succeeded.
        +   * 
        + * + * .google.showcase.v1beta1.Issue issue = 1; + * + * @return The issue. + */ + com.google.showcase.v1beta1.Issue getIssue(); + + /** + * + * + *
        +   * An issue if check answer was unsuccessful. This will be empty if the check answer succeeded.
        +   * 
        + * + * .google.showcase.v1beta1.Issue issue = 1; + */ + com.google.showcase.v1beta1.IssueOrBuilder getIssueOrBuilder(); +} diff --git a/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/WaitMetadata.java b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/WaitMetadata.java new file mode 100644 index 0000000000..8332ec8cf9 --- /dev/null +++ b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/WaitMetadata.java @@ -0,0 +1,725 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/echo.proto + +// Protobuf Java Version: 3.25.8 +package com.google.showcase.v1beta1; + +/** + * + * + *
        + * The metadata for Wait operation.
        + * 
        + * + * Protobuf type {@code google.showcase.v1beta1.WaitMetadata} + */ +public final class WaitMetadata extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.WaitMetadata) + WaitMetadataOrBuilder { + private static final long serialVersionUID = 0L; + + // Use WaitMetadata.newBuilder() to construct. + private WaitMetadata(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private WaitMetadata() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new WaitMetadata(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.EchoOuterClass + .internal_static_google_showcase_v1beta1_WaitMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.EchoOuterClass + .internal_static_google_showcase_v1beta1_WaitMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.WaitMetadata.class, + com.google.showcase.v1beta1.WaitMetadata.Builder.class); + } + + private int bitField0_; + public static final int END_TIME_FIELD_NUMBER = 1; + private com.google.protobuf.Timestamp endTime_; + + /** + * + * + *
        +   * The time that this operation will complete.
        +   * 
        + * + * .google.protobuf.Timestamp end_time = 1; + * + * @return Whether the endTime field is set. + */ + @java.lang.Override + public boolean hasEndTime() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
        +   * The time that this operation will complete.
        +   * 
        + * + * .google.protobuf.Timestamp end_time = 1; + * + * @return The endTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getEndTime() { + return endTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : endTime_; + } + + /** + * + * + *
        +   * The time that this operation will complete.
        +   * 
        + * + * .google.protobuf.Timestamp end_time = 1; + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getEndTimeOrBuilder() { + return endTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : endTime_; + } + + 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, getEndTime()); + } + 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, getEndTime()); + } + 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.showcase.v1beta1.WaitMetadata)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.WaitMetadata other = (com.google.showcase.v1beta1.WaitMetadata) obj; + + if (hasEndTime() != other.hasEndTime()) return false; + if (hasEndTime()) { + if (!getEndTime().equals(other.getEndTime())) 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 (hasEndTime()) { + hash = (37 * hash) + END_TIME_FIELD_NUMBER; + hash = (53 * hash) + getEndTime().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.showcase.v1beta1.WaitMetadata parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.WaitMetadata parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.WaitMetadata parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.WaitMetadata 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.showcase.v1beta1.WaitMetadata parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.WaitMetadata parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.WaitMetadata parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.WaitMetadata 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.showcase.v1beta1.WaitMetadata parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.WaitMetadata 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.showcase.v1beta1.WaitMetadata parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.WaitMetadata 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.showcase.v1beta1.WaitMetadata 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 metadata for Wait operation.
        +   * 
        + * + * Protobuf type {@code google.showcase.v1beta1.WaitMetadata} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.WaitMetadata) + com.google.showcase.v1beta1.WaitMetadataOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.EchoOuterClass + .internal_static_google_showcase_v1beta1_WaitMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.EchoOuterClass + .internal_static_google_showcase_v1beta1_WaitMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.WaitMetadata.class, + com.google.showcase.v1beta1.WaitMetadata.Builder.class); + } + + // Construct using com.google.showcase.v1beta1.WaitMetadata.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getEndTimeFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + endTime_ = null; + if (endTimeBuilder_ != null) { + endTimeBuilder_.dispose(); + endTimeBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.showcase.v1beta1.EchoOuterClass + .internal_static_google_showcase_v1beta1_WaitMetadata_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.WaitMetadata getDefaultInstanceForType() { + return com.google.showcase.v1beta1.WaitMetadata.getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.WaitMetadata build() { + com.google.showcase.v1beta1.WaitMetadata result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.WaitMetadata buildPartial() { + com.google.showcase.v1beta1.WaitMetadata result = + new com.google.showcase.v1beta1.WaitMetadata(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.showcase.v1beta1.WaitMetadata result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.endTime_ = endTimeBuilder_ == null ? endTime_ : endTimeBuilder_.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.showcase.v1beta1.WaitMetadata) { + return mergeFrom((com.google.showcase.v1beta1.WaitMetadata) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.showcase.v1beta1.WaitMetadata other) { + if (other == com.google.showcase.v1beta1.WaitMetadata.getDefaultInstance()) return this; + if (other.hasEndTime()) { + mergeEndTime(other.getEndTime()); + } + 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(getEndTimeFieldBuilder().getBuilder(), extensionRegistry); + 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 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 time that this operation will complete.
        +     * 
        + * + * .google.protobuf.Timestamp end_time = 1; + * + * @return Whether the endTime field is set. + */ + public boolean hasEndTime() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
        +     * The time that this operation will complete.
        +     * 
        + * + * .google.protobuf.Timestamp end_time = 1; + * + * @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 time that this operation will complete.
        +     * 
        + * + * .google.protobuf.Timestamp end_time = 1; + */ + public Builder setEndTime(com.google.protobuf.Timestamp value) { + if (endTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + endTime_ = value; + } else { + endTimeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
        +     * The time that this operation will complete.
        +     * 
        + * + * .google.protobuf.Timestamp end_time = 1; + */ + public Builder setEndTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (endTimeBuilder_ == null) { + endTime_ = builderForValue.build(); + } else { + endTimeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
        +     * The time that this operation will complete.
        +     * 
        + * + * .google.protobuf.Timestamp end_time = 1; + */ + public Builder mergeEndTime(com.google.protobuf.Timestamp value) { + if (endTimeBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) + && endTime_ != null + && endTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getEndTimeBuilder().mergeFrom(value); + } else { + endTime_ = value; + } + } else { + endTimeBuilder_.mergeFrom(value); + } + if (endTime_ != null) { + bitField0_ |= 0x00000001; + onChanged(); + } + return this; + } + + /** + * + * + *
        +     * The time that this operation will complete.
        +     * 
        + * + * .google.protobuf.Timestamp end_time = 1; + */ + public Builder clearEndTime() { + bitField0_ = (bitField0_ & ~0x00000001); + endTime_ = null; + if (endTimeBuilder_ != null) { + endTimeBuilder_.dispose(); + endTimeBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
        +     * The time that this operation will complete.
        +     * 
        + * + * .google.protobuf.Timestamp end_time = 1; + */ + public com.google.protobuf.Timestamp.Builder getEndTimeBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return getEndTimeFieldBuilder().getBuilder(); + } + + /** + * + * + *
        +     * The time that this operation will complete.
        +     * 
        + * + * .google.protobuf.Timestamp end_time = 1; + */ + public com.google.protobuf.TimestampOrBuilder getEndTimeOrBuilder() { + if (endTimeBuilder_ != null) { + return endTimeBuilder_.getMessageOrBuilder(); + } else { + return endTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : endTime_; + } + } + + /** + * + * + *
        +     * The time that this operation will complete.
        +     * 
        + * + * .google.protobuf.Timestamp end_time = 1; + */ + 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_; + } + + @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.showcase.v1beta1.WaitMetadata) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.WaitMetadata) + private static final com.google.showcase.v1beta1.WaitMetadata DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.WaitMetadata(); + } + + public static com.google.showcase.v1beta1.WaitMetadata getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public WaitMetadata 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.showcase.v1beta1.WaitMetadata getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/WaitMetadataOrBuilder.java b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/WaitMetadataOrBuilder.java new file mode 100644 index 0000000000..8540677867 --- /dev/null +++ b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/WaitMetadataOrBuilder.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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/echo.proto + +// Protobuf Java Version: 3.25.8 +package com.google.showcase.v1beta1; + +public interface WaitMetadataOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.WaitMetadata) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
        +   * The time that this operation will complete.
        +   * 
        + * + * .google.protobuf.Timestamp end_time = 1; + * + * @return Whether the endTime field is set. + */ + boolean hasEndTime(); + + /** + * + * + *
        +   * The time that this operation will complete.
        +   * 
        + * + * .google.protobuf.Timestamp end_time = 1; + * + * @return The endTime. + */ + com.google.protobuf.Timestamp getEndTime(); + + /** + * + * + *
        +   * The time that this operation will complete.
        +   * 
        + * + * .google.protobuf.Timestamp end_time = 1; + */ + com.google.protobuf.TimestampOrBuilder getEndTimeOrBuilder(); +} diff --git a/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/WaitRequest.java b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/WaitRequest.java new file mode 100644 index 0000000000..440382bff3 --- /dev/null +++ b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/WaitRequest.java @@ -0,0 +1,1820 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/echo.proto + +// Protobuf Java Version: 3.25.8 +package com.google.showcase.v1beta1; + +/** + * + * + *
        + * The request for Wait method.
        + * 
        + * + * Protobuf type {@code google.showcase.v1beta1.WaitRequest} + */ +public final class WaitRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.WaitRequest) + WaitRequestOrBuilder { + private static final long serialVersionUID = 0L; + + // Use WaitRequest.newBuilder() to construct. + private WaitRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private WaitRequest() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new WaitRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.EchoOuterClass + .internal_static_google_showcase_v1beta1_WaitRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.EchoOuterClass + .internal_static_google_showcase_v1beta1_WaitRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.WaitRequest.class, + com.google.showcase.v1beta1.WaitRequest.Builder.class); + } + + private int endCase_ = 0; + + @SuppressWarnings("serial") + private java.lang.Object end_; + + public enum EndCase + implements + com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + END_TIME(1), + TTL(4), + END_NOT_SET(0); + private final int value; + + private EndCase(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 EndCase valueOf(int value) { + return forNumber(value); + } + + public static EndCase forNumber(int value) { + switch (value) { + case 1: + return END_TIME; + case 4: + return TTL; + case 0: + return END_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public EndCase getEndCase() { + return EndCase.forNumber(endCase_); + } + + private int responseCase_ = 0; + + @SuppressWarnings("serial") + private java.lang.Object response_; + + public enum ResponseCase + implements + com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + ERROR(2), + SUCCESS(3), + RESPONSE_NOT_SET(0); + private final int value; + + private ResponseCase(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 ResponseCase valueOf(int value) { + return forNumber(value); + } + + public static ResponseCase forNumber(int value) { + switch (value) { + case 2: + return ERROR; + case 3: + return SUCCESS; + case 0: + return RESPONSE_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public ResponseCase getResponseCase() { + return ResponseCase.forNumber(responseCase_); + } + + public static final int END_TIME_FIELD_NUMBER = 1; + + /** + * + * + *
        +   * The time that this operation will complete.
        +   * 
        + * + * .google.protobuf.Timestamp end_time = 1; + * + * @return Whether the endTime field is set. + */ + @java.lang.Override + public boolean hasEndTime() { + return endCase_ == 1; + } + + /** + * + * + *
        +   * The time that this operation will complete.
        +   * 
        + * + * .google.protobuf.Timestamp end_time = 1; + * + * @return The endTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getEndTime() { + if (endCase_ == 1) { + return (com.google.protobuf.Timestamp) end_; + } + return com.google.protobuf.Timestamp.getDefaultInstance(); + } + + /** + * + * + *
        +   * The time that this operation will complete.
        +   * 
        + * + * .google.protobuf.Timestamp end_time = 1; + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getEndTimeOrBuilder() { + if (endCase_ == 1) { + return (com.google.protobuf.Timestamp) end_; + } + return com.google.protobuf.Timestamp.getDefaultInstance(); + } + + public static final int TTL_FIELD_NUMBER = 4; + + /** + * + * + *
        +   * The duration of this operation.
        +   * 
        + * + * .google.protobuf.Duration ttl = 4; + * + * @return Whether the ttl field is set. + */ + @java.lang.Override + public boolean hasTtl() { + return endCase_ == 4; + } + + /** + * + * + *
        +   * The duration of this operation.
        +   * 
        + * + * .google.protobuf.Duration ttl = 4; + * + * @return The ttl. + */ + @java.lang.Override + public com.google.protobuf.Duration getTtl() { + if (endCase_ == 4) { + return (com.google.protobuf.Duration) end_; + } + return com.google.protobuf.Duration.getDefaultInstance(); + } + + /** + * + * + *
        +   * The duration of this operation.
        +   * 
        + * + * .google.protobuf.Duration ttl = 4; + */ + @java.lang.Override + public com.google.protobuf.DurationOrBuilder getTtlOrBuilder() { + if (endCase_ == 4) { + return (com.google.protobuf.Duration) end_; + } + return com.google.protobuf.Duration.getDefaultInstance(); + } + + public static final int ERROR_FIELD_NUMBER = 2; + + /** + * + * + *
        +   * The error that will be returned by the server. If this code is specified
        +   * to be the OK rpc code, an empty response will be returned.
        +   * 
        + * + * .google.rpc.Status error = 2; + * + * @return Whether the error field is set. + */ + @java.lang.Override + public boolean hasError() { + return responseCase_ == 2; + } + + /** + * + * + *
        +   * The error that will be returned by the server. If this code is specified
        +   * to be the OK rpc code, an empty response will be returned.
        +   * 
        + * + * .google.rpc.Status error = 2; + * + * @return The error. + */ + @java.lang.Override + public com.google.rpc.Status getError() { + if (responseCase_ == 2) { + return (com.google.rpc.Status) response_; + } + return com.google.rpc.Status.getDefaultInstance(); + } + + /** + * + * + *
        +   * The error that will be returned by the server. If this code is specified
        +   * to be the OK rpc code, an empty response will be returned.
        +   * 
        + * + * .google.rpc.Status error = 2; + */ + @java.lang.Override + public com.google.rpc.StatusOrBuilder getErrorOrBuilder() { + if (responseCase_ == 2) { + return (com.google.rpc.Status) response_; + } + return com.google.rpc.Status.getDefaultInstance(); + } + + public static final int SUCCESS_FIELD_NUMBER = 3; + + /** + * + * + *
        +   * The response to be returned on operation completion.
        +   * 
        + * + * .google.showcase.v1beta1.WaitResponse success = 3; + * + * @return Whether the success field is set. + */ + @java.lang.Override + public boolean hasSuccess() { + return responseCase_ == 3; + } + + /** + * + * + *
        +   * The response to be returned on operation completion.
        +   * 
        + * + * .google.showcase.v1beta1.WaitResponse success = 3; + * + * @return The success. + */ + @java.lang.Override + public com.google.showcase.v1beta1.WaitResponse getSuccess() { + if (responseCase_ == 3) { + return (com.google.showcase.v1beta1.WaitResponse) response_; + } + return com.google.showcase.v1beta1.WaitResponse.getDefaultInstance(); + } + + /** + * + * + *
        +   * The response to be returned on operation completion.
        +   * 
        + * + * .google.showcase.v1beta1.WaitResponse success = 3; + */ + @java.lang.Override + public com.google.showcase.v1beta1.WaitResponseOrBuilder getSuccessOrBuilder() { + if (responseCase_ == 3) { + return (com.google.showcase.v1beta1.WaitResponse) response_; + } + return com.google.showcase.v1beta1.WaitResponse.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 (endCase_ == 1) { + output.writeMessage(1, (com.google.protobuf.Timestamp) end_); + } + if (responseCase_ == 2) { + output.writeMessage(2, (com.google.rpc.Status) response_); + } + if (responseCase_ == 3) { + output.writeMessage(3, (com.google.showcase.v1beta1.WaitResponse) response_); + } + if (endCase_ == 4) { + output.writeMessage(4, (com.google.protobuf.Duration) end_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (endCase_ == 1) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 1, (com.google.protobuf.Timestamp) end_); + } + if (responseCase_ == 2) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 2, (com.google.rpc.Status) response_); + } + if (responseCase_ == 3) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 3, (com.google.showcase.v1beta1.WaitResponse) response_); + } + if (endCase_ == 4) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 4, (com.google.protobuf.Duration) end_); + } + 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.showcase.v1beta1.WaitRequest)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.WaitRequest other = (com.google.showcase.v1beta1.WaitRequest) obj; + + if (!getEndCase().equals(other.getEndCase())) return false; + switch (endCase_) { + case 1: + if (!getEndTime().equals(other.getEndTime())) return false; + break; + case 4: + if (!getTtl().equals(other.getTtl())) return false; + break; + case 0: + default: + } + if (!getResponseCase().equals(other.getResponseCase())) return false; + switch (responseCase_) { + case 2: + if (!getError().equals(other.getError())) return false; + break; + case 3: + if (!getSuccess().equals(other.getSuccess())) 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(); + switch (endCase_) { + case 1: + hash = (37 * hash) + END_TIME_FIELD_NUMBER; + hash = (53 * hash) + getEndTime().hashCode(); + break; + case 4: + hash = (37 * hash) + TTL_FIELD_NUMBER; + hash = (53 * hash) + getTtl().hashCode(); + break; + case 0: + default: + } + switch (responseCase_) { + case 2: + hash = (37 * hash) + ERROR_FIELD_NUMBER; + hash = (53 * hash) + getError().hashCode(); + break; + case 3: + hash = (37 * hash) + SUCCESS_FIELD_NUMBER; + hash = (53 * hash) + getSuccess().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.showcase.v1beta1.WaitRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.WaitRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.WaitRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.WaitRequest 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.showcase.v1beta1.WaitRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.WaitRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.WaitRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.WaitRequest 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.showcase.v1beta1.WaitRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.WaitRequest 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.showcase.v1beta1.WaitRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.WaitRequest 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.showcase.v1beta1.WaitRequest 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 request for Wait method.
        +   * 
        + * + * Protobuf type {@code google.showcase.v1beta1.WaitRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.WaitRequest) + com.google.showcase.v1beta1.WaitRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.EchoOuterClass + .internal_static_google_showcase_v1beta1_WaitRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.EchoOuterClass + .internal_static_google_showcase_v1beta1_WaitRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.WaitRequest.class, + com.google.showcase.v1beta1.WaitRequest.Builder.class); + } + + // Construct using com.google.showcase.v1beta1.WaitRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (endTimeBuilder_ != null) { + endTimeBuilder_.clear(); + } + if (ttlBuilder_ != null) { + ttlBuilder_.clear(); + } + if (errorBuilder_ != null) { + errorBuilder_.clear(); + } + if (successBuilder_ != null) { + successBuilder_.clear(); + } + endCase_ = 0; + end_ = null; + responseCase_ = 0; + response_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.showcase.v1beta1.EchoOuterClass + .internal_static_google_showcase_v1beta1_WaitRequest_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.WaitRequest getDefaultInstanceForType() { + return com.google.showcase.v1beta1.WaitRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.WaitRequest build() { + com.google.showcase.v1beta1.WaitRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.WaitRequest buildPartial() { + com.google.showcase.v1beta1.WaitRequest result = + new com.google.showcase.v1beta1.WaitRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + buildPartialOneofs(result); + onBuilt(); + return result; + } + + private void buildPartial0(com.google.showcase.v1beta1.WaitRequest result) { + int from_bitField0_ = bitField0_; + } + + private void buildPartialOneofs(com.google.showcase.v1beta1.WaitRequest result) { + result.endCase_ = endCase_; + result.end_ = this.end_; + if (endCase_ == 1 && endTimeBuilder_ != null) { + result.end_ = endTimeBuilder_.build(); + } + if (endCase_ == 4 && ttlBuilder_ != null) { + result.end_ = ttlBuilder_.build(); + } + result.responseCase_ = responseCase_; + result.response_ = this.response_; + if (responseCase_ == 2 && errorBuilder_ != null) { + result.response_ = errorBuilder_.build(); + } + if (responseCase_ == 3 && successBuilder_ != null) { + result.response_ = successBuilder_.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.showcase.v1beta1.WaitRequest) { + return mergeFrom((com.google.showcase.v1beta1.WaitRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.showcase.v1beta1.WaitRequest other) { + if (other == com.google.showcase.v1beta1.WaitRequest.getDefaultInstance()) return this; + switch (other.getEndCase()) { + case END_TIME: + { + mergeEndTime(other.getEndTime()); + break; + } + case TTL: + { + mergeTtl(other.getTtl()); + break; + } + case END_NOT_SET: + { + break; + } + } + switch (other.getResponseCase()) { + case ERROR: + { + mergeError(other.getError()); + break; + } + case SUCCESS: + { + mergeSuccess(other.getSuccess()); + break; + } + case RESPONSE_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(getEndTimeFieldBuilder().getBuilder(), extensionRegistry); + endCase_ = 1; + break; + } // case 10 + case 18: + { + input.readMessage(getErrorFieldBuilder().getBuilder(), extensionRegistry); + responseCase_ = 2; + break; + } // case 18 + case 26: + { + input.readMessage(getSuccessFieldBuilder().getBuilder(), extensionRegistry); + responseCase_ = 3; + break; + } // case 26 + case 34: + { + input.readMessage(getTtlFieldBuilder().getBuilder(), extensionRegistry); + endCase_ = 4; + 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 endCase_ = 0; + private java.lang.Object end_; + + public EndCase getEndCase() { + return EndCase.forNumber(endCase_); + } + + public Builder clearEnd() { + endCase_ = 0; + end_ = null; + onChanged(); + return this; + } + + private int responseCase_ = 0; + private java.lang.Object response_; + + public ResponseCase getResponseCase() { + return ResponseCase.forNumber(responseCase_); + } + + public Builder clearResponse() { + responseCase_ = 0; + response_ = null; + onChanged(); + return this; + } + + private int bitField0_; + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + endTimeBuilder_; + + /** + * + * + *
        +     * The time that this operation will complete.
        +     * 
        + * + * .google.protobuf.Timestamp end_time = 1; + * + * @return Whether the endTime field is set. + */ + @java.lang.Override + public boolean hasEndTime() { + return endCase_ == 1; + } + + /** + * + * + *
        +     * The time that this operation will complete.
        +     * 
        + * + * .google.protobuf.Timestamp end_time = 1; + * + * @return The endTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getEndTime() { + if (endTimeBuilder_ == null) { + if (endCase_ == 1) { + return (com.google.protobuf.Timestamp) end_; + } + return com.google.protobuf.Timestamp.getDefaultInstance(); + } else { + if (endCase_ == 1) { + return endTimeBuilder_.getMessage(); + } + return com.google.protobuf.Timestamp.getDefaultInstance(); + } + } + + /** + * + * + *
        +     * The time that this operation will complete.
        +     * 
        + * + * .google.protobuf.Timestamp end_time = 1; + */ + public Builder setEndTime(com.google.protobuf.Timestamp value) { + if (endTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + end_ = value; + onChanged(); + } else { + endTimeBuilder_.setMessage(value); + } + endCase_ = 1; + return this; + } + + /** + * + * + *
        +     * The time that this operation will complete.
        +     * 
        + * + * .google.protobuf.Timestamp end_time = 1; + */ + public Builder setEndTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (endTimeBuilder_ == null) { + end_ = builderForValue.build(); + onChanged(); + } else { + endTimeBuilder_.setMessage(builderForValue.build()); + } + endCase_ = 1; + return this; + } + + /** + * + * + *
        +     * The time that this operation will complete.
        +     * 
        + * + * .google.protobuf.Timestamp end_time = 1; + */ + public Builder mergeEndTime(com.google.protobuf.Timestamp value) { + if (endTimeBuilder_ == null) { + if (endCase_ == 1 && end_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + end_ = + com.google.protobuf.Timestamp.newBuilder((com.google.protobuf.Timestamp) end_) + .mergeFrom(value) + .buildPartial(); + } else { + end_ = value; + } + onChanged(); + } else { + if (endCase_ == 1) { + endTimeBuilder_.mergeFrom(value); + } else { + endTimeBuilder_.setMessage(value); + } + } + endCase_ = 1; + return this; + } + + /** + * + * + *
        +     * The time that this operation will complete.
        +     * 
        + * + * .google.protobuf.Timestamp end_time = 1; + */ + public Builder clearEndTime() { + if (endTimeBuilder_ == null) { + if (endCase_ == 1) { + endCase_ = 0; + end_ = null; + onChanged(); + } + } else { + if (endCase_ == 1) { + endCase_ = 0; + end_ = null; + } + endTimeBuilder_.clear(); + } + return this; + } + + /** + * + * + *
        +     * The time that this operation will complete.
        +     * 
        + * + * .google.protobuf.Timestamp end_time = 1; + */ + public com.google.protobuf.Timestamp.Builder getEndTimeBuilder() { + return getEndTimeFieldBuilder().getBuilder(); + } + + /** + * + * + *
        +     * The time that this operation will complete.
        +     * 
        + * + * .google.protobuf.Timestamp end_time = 1; + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getEndTimeOrBuilder() { + if ((endCase_ == 1) && (endTimeBuilder_ != null)) { + return endTimeBuilder_.getMessageOrBuilder(); + } else { + if (endCase_ == 1) { + return (com.google.protobuf.Timestamp) end_; + } + return com.google.protobuf.Timestamp.getDefaultInstance(); + } + } + + /** + * + * + *
        +     * The time that this operation will complete.
        +     * 
        + * + * .google.protobuf.Timestamp end_time = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getEndTimeFieldBuilder() { + if (endTimeBuilder_ == null) { + if (!(endCase_ == 1)) { + end_ = com.google.protobuf.Timestamp.getDefaultInstance(); + } + endTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + (com.google.protobuf.Timestamp) end_, getParentForChildren(), isClean()); + end_ = null; + } + endCase_ = 1; + onChanged(); + return endTimeBuilder_; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder> + ttlBuilder_; + + /** + * + * + *
        +     * The duration of this operation.
        +     * 
        + * + * .google.protobuf.Duration ttl = 4; + * + * @return Whether the ttl field is set. + */ + @java.lang.Override + public boolean hasTtl() { + return endCase_ == 4; + } + + /** + * + * + *
        +     * The duration of this operation.
        +     * 
        + * + * .google.protobuf.Duration ttl = 4; + * + * @return The ttl. + */ + @java.lang.Override + public com.google.protobuf.Duration getTtl() { + if (ttlBuilder_ == null) { + if (endCase_ == 4) { + return (com.google.protobuf.Duration) end_; + } + return com.google.protobuf.Duration.getDefaultInstance(); + } else { + if (endCase_ == 4) { + return ttlBuilder_.getMessage(); + } + return com.google.protobuf.Duration.getDefaultInstance(); + } + } + + /** + * + * + *
        +     * The duration of this operation.
        +     * 
        + * + * .google.protobuf.Duration ttl = 4; + */ + public Builder setTtl(com.google.protobuf.Duration value) { + if (ttlBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + end_ = value; + onChanged(); + } else { + ttlBuilder_.setMessage(value); + } + endCase_ = 4; + return this; + } + + /** + * + * + *
        +     * The duration of this operation.
        +     * 
        + * + * .google.protobuf.Duration ttl = 4; + */ + public Builder setTtl(com.google.protobuf.Duration.Builder builderForValue) { + if (ttlBuilder_ == null) { + end_ = builderForValue.build(); + onChanged(); + } else { + ttlBuilder_.setMessage(builderForValue.build()); + } + endCase_ = 4; + return this; + } + + /** + * + * + *
        +     * The duration of this operation.
        +     * 
        + * + * .google.protobuf.Duration ttl = 4; + */ + public Builder mergeTtl(com.google.protobuf.Duration value) { + if (ttlBuilder_ == null) { + if (endCase_ == 4 && end_ != com.google.protobuf.Duration.getDefaultInstance()) { + end_ = + com.google.protobuf.Duration.newBuilder((com.google.protobuf.Duration) end_) + .mergeFrom(value) + .buildPartial(); + } else { + end_ = value; + } + onChanged(); + } else { + if (endCase_ == 4) { + ttlBuilder_.mergeFrom(value); + } else { + ttlBuilder_.setMessage(value); + } + } + endCase_ = 4; + return this; + } + + /** + * + * + *
        +     * The duration of this operation.
        +     * 
        + * + * .google.protobuf.Duration ttl = 4; + */ + public Builder clearTtl() { + if (ttlBuilder_ == null) { + if (endCase_ == 4) { + endCase_ = 0; + end_ = null; + onChanged(); + } + } else { + if (endCase_ == 4) { + endCase_ = 0; + end_ = null; + } + ttlBuilder_.clear(); + } + return this; + } + + /** + * + * + *
        +     * The duration of this operation.
        +     * 
        + * + * .google.protobuf.Duration ttl = 4; + */ + public com.google.protobuf.Duration.Builder getTtlBuilder() { + return getTtlFieldBuilder().getBuilder(); + } + + /** + * + * + *
        +     * The duration of this operation.
        +     * 
        + * + * .google.protobuf.Duration ttl = 4; + */ + @java.lang.Override + public com.google.protobuf.DurationOrBuilder getTtlOrBuilder() { + if ((endCase_ == 4) && (ttlBuilder_ != null)) { + return ttlBuilder_.getMessageOrBuilder(); + } else { + if (endCase_ == 4) { + return (com.google.protobuf.Duration) end_; + } + return com.google.protobuf.Duration.getDefaultInstance(); + } + } + + /** + * + * + *
        +     * The duration of this operation.
        +     * 
        + * + * .google.protobuf.Duration ttl = 4; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder> + getTtlFieldBuilder() { + if (ttlBuilder_ == null) { + if (!(endCase_ == 4)) { + end_ = com.google.protobuf.Duration.getDefaultInstance(); + } + ttlBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder>( + (com.google.protobuf.Duration) end_, getParentForChildren(), isClean()); + end_ = null; + } + endCase_ = 4; + onChanged(); + return ttlBuilder_; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.rpc.Status, com.google.rpc.Status.Builder, com.google.rpc.StatusOrBuilder> + errorBuilder_; + + /** + * + * + *
        +     * The error that will be returned by the server. If this code is specified
        +     * to be the OK rpc code, an empty response will be returned.
        +     * 
        + * + * .google.rpc.Status error = 2; + * + * @return Whether the error field is set. + */ + @java.lang.Override + public boolean hasError() { + return responseCase_ == 2; + } + + /** + * + * + *
        +     * The error that will be returned by the server. If this code is specified
        +     * to be the OK rpc code, an empty response will be returned.
        +     * 
        + * + * .google.rpc.Status error = 2; + * + * @return The error. + */ + @java.lang.Override + public com.google.rpc.Status getError() { + if (errorBuilder_ == null) { + if (responseCase_ == 2) { + return (com.google.rpc.Status) response_; + } + return com.google.rpc.Status.getDefaultInstance(); + } else { + if (responseCase_ == 2) { + return errorBuilder_.getMessage(); + } + return com.google.rpc.Status.getDefaultInstance(); + } + } + + /** + * + * + *
        +     * The error that will be returned by the server. If this code is specified
        +     * to be the OK rpc code, an empty response will be returned.
        +     * 
        + * + * .google.rpc.Status error = 2; + */ + public Builder setError(com.google.rpc.Status value) { + if (errorBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + response_ = value; + onChanged(); + } else { + errorBuilder_.setMessage(value); + } + responseCase_ = 2; + return this; + } + + /** + * + * + *
        +     * The error that will be returned by the server. If this code is specified
        +     * to be the OK rpc code, an empty response will be returned.
        +     * 
        + * + * .google.rpc.Status error = 2; + */ + public Builder setError(com.google.rpc.Status.Builder builderForValue) { + if (errorBuilder_ == null) { + response_ = builderForValue.build(); + onChanged(); + } else { + errorBuilder_.setMessage(builderForValue.build()); + } + responseCase_ = 2; + return this; + } + + /** + * + * + *
        +     * The error that will be returned by the server. If this code is specified
        +     * to be the OK rpc code, an empty response will be returned.
        +     * 
        + * + * .google.rpc.Status error = 2; + */ + public Builder mergeError(com.google.rpc.Status value) { + if (errorBuilder_ == null) { + if (responseCase_ == 2 && response_ != com.google.rpc.Status.getDefaultInstance()) { + response_ = + com.google.rpc.Status.newBuilder((com.google.rpc.Status) response_) + .mergeFrom(value) + .buildPartial(); + } else { + response_ = value; + } + onChanged(); + } else { + if (responseCase_ == 2) { + errorBuilder_.mergeFrom(value); + } else { + errorBuilder_.setMessage(value); + } + } + responseCase_ = 2; + return this; + } + + /** + * + * + *
        +     * The error that will be returned by the server. If this code is specified
        +     * to be the OK rpc code, an empty response will be returned.
        +     * 
        + * + * .google.rpc.Status error = 2; + */ + public Builder clearError() { + if (errorBuilder_ == null) { + if (responseCase_ == 2) { + responseCase_ = 0; + response_ = null; + onChanged(); + } + } else { + if (responseCase_ == 2) { + responseCase_ = 0; + response_ = null; + } + errorBuilder_.clear(); + } + return this; + } + + /** + * + * + *
        +     * The error that will be returned by the server. If this code is specified
        +     * to be the OK rpc code, an empty response will be returned.
        +     * 
        + * + * .google.rpc.Status error = 2; + */ + public com.google.rpc.Status.Builder getErrorBuilder() { + return getErrorFieldBuilder().getBuilder(); + } + + /** + * + * + *
        +     * The error that will be returned by the server. If this code is specified
        +     * to be the OK rpc code, an empty response will be returned.
        +     * 
        + * + * .google.rpc.Status error = 2; + */ + @java.lang.Override + public com.google.rpc.StatusOrBuilder getErrorOrBuilder() { + if ((responseCase_ == 2) && (errorBuilder_ != null)) { + return errorBuilder_.getMessageOrBuilder(); + } else { + if (responseCase_ == 2) { + return (com.google.rpc.Status) response_; + } + return com.google.rpc.Status.getDefaultInstance(); + } + } + + /** + * + * + *
        +     * The error that will be returned by the server. If this code is specified
        +     * to be the OK rpc code, an empty response will be returned.
        +     * 
        + * + * .google.rpc.Status error = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.rpc.Status, com.google.rpc.Status.Builder, com.google.rpc.StatusOrBuilder> + getErrorFieldBuilder() { + if (errorBuilder_ == null) { + if (!(responseCase_ == 2)) { + response_ = com.google.rpc.Status.getDefaultInstance(); + } + errorBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.rpc.Status, + com.google.rpc.Status.Builder, + com.google.rpc.StatusOrBuilder>( + (com.google.rpc.Status) response_, getParentForChildren(), isClean()); + response_ = null; + } + responseCase_ = 2; + onChanged(); + return errorBuilder_; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.showcase.v1beta1.WaitResponse, + com.google.showcase.v1beta1.WaitResponse.Builder, + com.google.showcase.v1beta1.WaitResponseOrBuilder> + successBuilder_; + + /** + * + * + *
        +     * The response to be returned on operation completion.
        +     * 
        + * + * .google.showcase.v1beta1.WaitResponse success = 3; + * + * @return Whether the success field is set. + */ + @java.lang.Override + public boolean hasSuccess() { + return responseCase_ == 3; + } + + /** + * + * + *
        +     * The response to be returned on operation completion.
        +     * 
        + * + * .google.showcase.v1beta1.WaitResponse success = 3; + * + * @return The success. + */ + @java.lang.Override + public com.google.showcase.v1beta1.WaitResponse getSuccess() { + if (successBuilder_ == null) { + if (responseCase_ == 3) { + return (com.google.showcase.v1beta1.WaitResponse) response_; + } + return com.google.showcase.v1beta1.WaitResponse.getDefaultInstance(); + } else { + if (responseCase_ == 3) { + return successBuilder_.getMessage(); + } + return com.google.showcase.v1beta1.WaitResponse.getDefaultInstance(); + } + } + + /** + * + * + *
        +     * The response to be returned on operation completion.
        +     * 
        + * + * .google.showcase.v1beta1.WaitResponse success = 3; + */ + public Builder setSuccess(com.google.showcase.v1beta1.WaitResponse value) { + if (successBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + response_ = value; + onChanged(); + } else { + successBuilder_.setMessage(value); + } + responseCase_ = 3; + return this; + } + + /** + * + * + *
        +     * The response to be returned on operation completion.
        +     * 
        + * + * .google.showcase.v1beta1.WaitResponse success = 3; + */ + public Builder setSuccess(com.google.showcase.v1beta1.WaitResponse.Builder builderForValue) { + if (successBuilder_ == null) { + response_ = builderForValue.build(); + onChanged(); + } else { + successBuilder_.setMessage(builderForValue.build()); + } + responseCase_ = 3; + return this; + } + + /** + * + * + *
        +     * The response to be returned on operation completion.
        +     * 
        + * + * .google.showcase.v1beta1.WaitResponse success = 3; + */ + public Builder mergeSuccess(com.google.showcase.v1beta1.WaitResponse value) { + if (successBuilder_ == null) { + if (responseCase_ == 3 + && response_ != com.google.showcase.v1beta1.WaitResponse.getDefaultInstance()) { + response_ = + com.google.showcase.v1beta1.WaitResponse.newBuilder( + (com.google.showcase.v1beta1.WaitResponse) response_) + .mergeFrom(value) + .buildPartial(); + } else { + response_ = value; + } + onChanged(); + } else { + if (responseCase_ == 3) { + successBuilder_.mergeFrom(value); + } else { + successBuilder_.setMessage(value); + } + } + responseCase_ = 3; + return this; + } + + /** + * + * + *
        +     * The response to be returned on operation completion.
        +     * 
        + * + * .google.showcase.v1beta1.WaitResponse success = 3; + */ + public Builder clearSuccess() { + if (successBuilder_ == null) { + if (responseCase_ == 3) { + responseCase_ = 0; + response_ = null; + onChanged(); + } + } else { + if (responseCase_ == 3) { + responseCase_ = 0; + response_ = null; + } + successBuilder_.clear(); + } + return this; + } + + /** + * + * + *
        +     * The response to be returned on operation completion.
        +     * 
        + * + * .google.showcase.v1beta1.WaitResponse success = 3; + */ + public com.google.showcase.v1beta1.WaitResponse.Builder getSuccessBuilder() { + return getSuccessFieldBuilder().getBuilder(); + } + + /** + * + * + *
        +     * The response to be returned on operation completion.
        +     * 
        + * + * .google.showcase.v1beta1.WaitResponse success = 3; + */ + @java.lang.Override + public com.google.showcase.v1beta1.WaitResponseOrBuilder getSuccessOrBuilder() { + if ((responseCase_ == 3) && (successBuilder_ != null)) { + return successBuilder_.getMessageOrBuilder(); + } else { + if (responseCase_ == 3) { + return (com.google.showcase.v1beta1.WaitResponse) response_; + } + return com.google.showcase.v1beta1.WaitResponse.getDefaultInstance(); + } + } + + /** + * + * + *
        +     * The response to be returned on operation completion.
        +     * 
        + * + * .google.showcase.v1beta1.WaitResponse success = 3; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.showcase.v1beta1.WaitResponse, + com.google.showcase.v1beta1.WaitResponse.Builder, + com.google.showcase.v1beta1.WaitResponseOrBuilder> + getSuccessFieldBuilder() { + if (successBuilder_ == null) { + if (!(responseCase_ == 3)) { + response_ = com.google.showcase.v1beta1.WaitResponse.getDefaultInstance(); + } + successBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.showcase.v1beta1.WaitResponse, + com.google.showcase.v1beta1.WaitResponse.Builder, + com.google.showcase.v1beta1.WaitResponseOrBuilder>( + (com.google.showcase.v1beta1.WaitResponse) response_, + getParentForChildren(), + isClean()); + response_ = null; + } + responseCase_ = 3; + onChanged(); + return successBuilder_; + } + + @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.showcase.v1beta1.WaitRequest) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.WaitRequest) + private static final com.google.showcase.v1beta1.WaitRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.WaitRequest(); + } + + public static com.google.showcase.v1beta1.WaitRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public WaitRequest 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.showcase.v1beta1.WaitRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/WaitRequestOrBuilder.java b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/WaitRequestOrBuilder.java new file mode 100644 index 0000000000..49092a708f --- /dev/null +++ b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/WaitRequestOrBuilder.java @@ -0,0 +1,181 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/echo.proto + +// Protobuf Java Version: 3.25.8 +package com.google.showcase.v1beta1; + +public interface WaitRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.WaitRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
        +   * The time that this operation will complete.
        +   * 
        + * + * .google.protobuf.Timestamp end_time = 1; + * + * @return Whether the endTime field is set. + */ + boolean hasEndTime(); + + /** + * + * + *
        +   * The time that this operation will complete.
        +   * 
        + * + * .google.protobuf.Timestamp end_time = 1; + * + * @return The endTime. + */ + com.google.protobuf.Timestamp getEndTime(); + + /** + * + * + *
        +   * The time that this operation will complete.
        +   * 
        + * + * .google.protobuf.Timestamp end_time = 1; + */ + com.google.protobuf.TimestampOrBuilder getEndTimeOrBuilder(); + + /** + * + * + *
        +   * The duration of this operation.
        +   * 
        + * + * .google.protobuf.Duration ttl = 4; + * + * @return Whether the ttl field is set. + */ + boolean hasTtl(); + + /** + * + * + *
        +   * The duration of this operation.
        +   * 
        + * + * .google.protobuf.Duration ttl = 4; + * + * @return The ttl. + */ + com.google.protobuf.Duration getTtl(); + + /** + * + * + *
        +   * The duration of this operation.
        +   * 
        + * + * .google.protobuf.Duration ttl = 4; + */ + com.google.protobuf.DurationOrBuilder getTtlOrBuilder(); + + /** + * + * + *
        +   * The error that will be returned by the server. If this code is specified
        +   * to be the OK rpc code, an empty response will be returned.
        +   * 
        + * + * .google.rpc.Status error = 2; + * + * @return Whether the error field is set. + */ + boolean hasError(); + + /** + * + * + *
        +   * The error that will be returned by the server. If this code is specified
        +   * to be the OK rpc code, an empty response will be returned.
        +   * 
        + * + * .google.rpc.Status error = 2; + * + * @return The error. + */ + com.google.rpc.Status getError(); + + /** + * + * + *
        +   * The error that will be returned by the server. If this code is specified
        +   * to be the OK rpc code, an empty response will be returned.
        +   * 
        + * + * .google.rpc.Status error = 2; + */ + com.google.rpc.StatusOrBuilder getErrorOrBuilder(); + + /** + * + * + *
        +   * The response to be returned on operation completion.
        +   * 
        + * + * .google.showcase.v1beta1.WaitResponse success = 3; + * + * @return Whether the success field is set. + */ + boolean hasSuccess(); + + /** + * + * + *
        +   * The response to be returned on operation completion.
        +   * 
        + * + * .google.showcase.v1beta1.WaitResponse success = 3; + * + * @return The success. + */ + com.google.showcase.v1beta1.WaitResponse getSuccess(); + + /** + * + * + *
        +   * The response to be returned on operation completion.
        +   * 
        + * + * .google.showcase.v1beta1.WaitResponse success = 3; + */ + com.google.showcase.v1beta1.WaitResponseOrBuilder getSuccessOrBuilder(); + + com.google.showcase.v1beta1.WaitRequest.EndCase getEndCase(); + + com.google.showcase.v1beta1.WaitRequest.ResponseCase getResponseCase(); +} diff --git a/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/WaitResponse.java b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/WaitResponse.java new file mode 100644 index 0000000000..17037550b6 --- /dev/null +++ b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/WaitResponse.java @@ -0,0 +1,632 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/echo.proto + +// Protobuf Java Version: 3.25.8 +package com.google.showcase.v1beta1; + +/** + * + * + *
        + * The result of the Wait operation.
        + * 
        + * + * Protobuf type {@code google.showcase.v1beta1.WaitResponse} + */ +public final class WaitResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.WaitResponse) + WaitResponseOrBuilder { + private static final long serialVersionUID = 0L; + + // Use WaitResponse.newBuilder() to construct. + private WaitResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private WaitResponse() { + content_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new WaitResponse(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.EchoOuterClass + .internal_static_google_showcase_v1beta1_WaitResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.EchoOuterClass + .internal_static_google_showcase_v1beta1_WaitResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.WaitResponse.class, + com.google.showcase.v1beta1.WaitResponse.Builder.class); + } + + public static final int CONTENT_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object content_ = ""; + + /** + * + * + *
        +   * This content of the result.
        +   * 
        + * + * string content = 1; + * + * @return The content. + */ + @java.lang.Override + public java.lang.String getContent() { + java.lang.Object ref = content_; + 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(); + content_ = s; + return s; + } + } + + /** + * + * + *
        +   * This content of the result.
        +   * 
        + * + * string content = 1; + * + * @return The bytes for content. + */ + @java.lang.Override + public com.google.protobuf.ByteString getContentBytes() { + java.lang.Object ref = content_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + content_ = 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(content_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, content_); + } + 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(content_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, content_); + } + 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.showcase.v1beta1.WaitResponse)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.WaitResponse other = (com.google.showcase.v1beta1.WaitResponse) obj; + + if (!getContent().equals(other.getContent())) 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) + CONTENT_FIELD_NUMBER; + hash = (53 * hash) + getContent().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.showcase.v1beta1.WaitResponse parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.WaitResponse parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.WaitResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.WaitResponse 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.showcase.v1beta1.WaitResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.WaitResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.WaitResponse parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.WaitResponse 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.showcase.v1beta1.WaitResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.WaitResponse 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.showcase.v1beta1.WaitResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.WaitResponse 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.showcase.v1beta1.WaitResponse 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 result of the Wait operation.
        +   * 
        + * + * Protobuf type {@code google.showcase.v1beta1.WaitResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.WaitResponse) + com.google.showcase.v1beta1.WaitResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.EchoOuterClass + .internal_static_google_showcase_v1beta1_WaitResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.EchoOuterClass + .internal_static_google_showcase_v1beta1_WaitResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.WaitResponse.class, + com.google.showcase.v1beta1.WaitResponse.Builder.class); + } + + // Construct using com.google.showcase.v1beta1.WaitResponse.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + content_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.showcase.v1beta1.EchoOuterClass + .internal_static_google_showcase_v1beta1_WaitResponse_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.WaitResponse getDefaultInstanceForType() { + return com.google.showcase.v1beta1.WaitResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.WaitResponse build() { + com.google.showcase.v1beta1.WaitResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.WaitResponse buildPartial() { + com.google.showcase.v1beta1.WaitResponse result = + new com.google.showcase.v1beta1.WaitResponse(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.showcase.v1beta1.WaitResponse result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.content_ = content_; + } + } + + @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.showcase.v1beta1.WaitResponse) { + return mergeFrom((com.google.showcase.v1beta1.WaitResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.showcase.v1beta1.WaitResponse other) { + if (other == com.google.showcase.v1beta1.WaitResponse.getDefaultInstance()) return this; + if (!other.getContent().isEmpty()) { + content_ = other.content_; + 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: + { + content_ = 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 content_ = ""; + + /** + * + * + *
        +     * This content of the result.
        +     * 
        + * + * string content = 1; + * + * @return The content. + */ + public java.lang.String getContent() { + java.lang.Object ref = content_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + content_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
        +     * This content of the result.
        +     * 
        + * + * string content = 1; + * + * @return The bytes for content. + */ + public com.google.protobuf.ByteString getContentBytes() { + java.lang.Object ref = content_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + content_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
        +     * This content of the result.
        +     * 
        + * + * string content = 1; + * + * @param value The content to set. + * @return This builder for chaining. + */ + public Builder setContent(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + content_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
        +     * This content of the result.
        +     * 
        + * + * string content = 1; + * + * @return This builder for chaining. + */ + public Builder clearContent() { + content_ = getDefaultInstance().getContent(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
        +     * This content of the result.
        +     * 
        + * + * string content = 1; + * + * @param value The bytes for content to set. + * @return This builder for chaining. + */ + public Builder setContentBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + content_ = 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.showcase.v1beta1.WaitResponse) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.WaitResponse) + private static final com.google.showcase.v1beta1.WaitResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.WaitResponse(); + } + + public static com.google.showcase.v1beta1.WaitResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public WaitResponse 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.showcase.v1beta1.WaitResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/WaitResponseOrBuilder.java b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/WaitResponseOrBuilder.java new file mode 100644 index 0000000000..d2976affe2 --- /dev/null +++ b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/WaitResponseOrBuilder.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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/echo.proto + +// Protobuf Java Version: 3.25.8 +package com.google.showcase.v1beta1; + +public interface WaitResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.WaitResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
        +   * This content of the result.
        +   * 
        + * + * string content = 1; + * + * @return The content. + */ + java.lang.String getContent(); + + /** + * + * + *
        +   * This content of the result.
        +   * 
        + * + * string content = 1; + * + * @return The bytes for content. + */ + com.google.protobuf.ByteString getContentBytes(); +} diff --git a/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/proto/schema/google/showcase/v1beta1/compliance.proto b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/proto/schema/google/showcase/v1beta1/compliance.proto new file mode 100644 index 0000000000..4e8cba6b25 --- /dev/null +++ b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/proto/schema/google/showcase/v1beta1/compliance.proto @@ -0,0 +1,269 @@ +// 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. + +syntax = "proto3"; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; + +package google.showcase.v1beta1; + +option go_package = "github.com/googleapis/gapic-showcase/server/genproto"; +option java_package = "com.google.showcase.v1beta1"; +option java_multiple_files = true; +option ruby_package = "Google::Showcase::V1beta1"; + +// This service is used to test that GAPICs implement various REST-related features correctly. This mostly means transcoding proto3 requests to REST format +// correctly for various types of HTTP annotations, but it also includes verifying that unknown (numeric) enums received by clients can be round-tripped +// correctly. +service Compliance { + // This service is meant to only run locally on the port 7469 (keypad digits + // for "show"). + option (google.api.default_host) = "localhost:7469"; + + // This method echoes the ComplianceData request. This method exercises + // sending the entire request object in the REST body. + rpc RepeatDataBody(RepeatRequest) returns (RepeatResponse) { + option (google.api.http) = { + post: "/v1beta1/repeat:body" + body: "*" + }; + } + + // This method echoes the ComplianceData request. This method exercises + // sending the a message-type field in the REST body. Per AIP-127, only + // top-level, non-repeated fields can be sent this way. + rpc RepeatDataBodyInfo(RepeatRequest) returns (RepeatResponse) { + option (google.api.http) = { + post: "/v1beta1/repeat:bodyinfo" + body: "info" + }; + } + + // This method echoes the ComplianceData request. This method exercises + // sending all request fields as query parameters. + rpc RepeatDataQuery(RepeatRequest) returns (RepeatResponse) { + option (google.api.http) = { + get: "/v1beta1/repeat:query" + }; + } + + // This method echoes the ComplianceData request. This method exercises + // sending some parameters as "simple" path variables (i.e., of the form + // "/bar/{foo}" rather than "/{foo=bar/*}"), and the rest as query parameters. + rpc RepeatDataSimplePath(RepeatRequest) returns (RepeatResponse) { + option (google.api.http) = { + get: "/v1beta1/repeat/{info.f_string}/{info.f_int32}/{info.f_double}/{info.f_bool}/{info.f_kingdom}:simplepath" + }; + } + + // Same as RepeatDataSimplePath, but with a path resource. + rpc RepeatDataPathResource(RepeatRequest) returns (RepeatResponse) { + option (google.api.http) = { + get: "/v1beta1/repeat/{info.f_string=first/*}/{info.f_child.f_string=second/*}/bool/{info.f_bool}:pathresource" + additional_bindings { + get: "/v1beta1/repeat/{info.f_child.f_string=first/*}/{info.f_string=second/*}/bool/{info.f_bool}:childfirstpathresource" + } + }; + } + + // Same as RepeatDataSimplePath, but with a trailing resource. + rpc RepeatDataPathTrailingResource(RepeatRequest) returns (RepeatResponse) { + option (google.api.http) = { + get: "/v1beta1/repeat/{info.f_string=first/*}/{info.f_child.f_string=second/**}:pathtrailingresource" + }; + } + + // This method echoes the ComplianceData request, using the HTTP PUT method. + rpc RepeatDataBodyPut(RepeatRequest) returns (RepeatResponse) { + option (google.api.http) = { + put: "/v1beta1/repeat:bodyput" + body: "*" + }; + } + + // This method echoes the ComplianceData request, using the HTTP PATCH method. + rpc RepeatDataBodyPatch(RepeatRequest) returns (RepeatResponse) { + option (google.api.http) = { + patch: "/v1beta1/repeat:bodypatch" + body: "*" + }; + } + + // This method requests an enum value from the server. Depending on the contents of EnumRequest, the enum value returned will be a known enum declared in the + // .proto file, or a made-up enum value the is unknown to the client. To verify that clients can round-trip unknown enum values they receive, use the + // response from this RPC as the request to VerifyEnum() + // + // The values of enums sent by the server when a known or unknown value is requested will be the same within a single Showcase server run (this is needed for + // VerifyEnum() to work) but are not guaranteed to be the same across separate Showcase server runs. + rpc GetEnum(EnumRequest) returns (EnumResponse) { + option (google.api.http) = { + get: "/v1beta1/compliance/enum" + }; + } + + // This method is used to verify that clients can round-trip enum values, which is particularly important for unknown enum values over REST. VerifyEnum() + // verifies that its request, which is presumably the response that the client previously got to a GetEnum(), contains the correct data. If so, it responds + // with the same EnumResponse; otherwise, the RPC errors. + // + // This works because the values of enums sent by the server when a known or unknown value is requested will be the same within a single Showcase server run, + // although they are not guaranteed to be the same across separate Showcase server runs. + rpc VerifyEnum(EnumResponse) returns (EnumResponse) { + option (google.api.http) = { + post: "/v1beta1/compliance/enum" + }; + } + +} + +message RepeatRequest { + string name = 1; + ComplianceData info = 2; + + // If true, the server will verify that the received request matches + // the request with the same name in the compliance test suite. + bool server_verify = 3; + + // The URI template this request is expected to be bound to server-side. + optional string intended_binding_uri = 10; + + // Some top level fields, to test that these are encoded correctly + // in query params. + int32 f_int32 = 4; + int64 f_int64 = 5; + double f_double = 6; + + optional int32 p_int32 = 7; + optional int64 p_int64 = 8; + optional double p_double = 9; +} + +message RepeatResponse { + RepeatRequest request = 1; + + // The URI template the request was bound to server-side. + string binding_uri = 2; +} + +// ComplianceSuite contains a set of requests that microgenerators should issue +// over REST to the Compliance service to test their gRPC-to-REST transcoding +// implementation. +message ComplianceSuite { + repeated ComplianceGroup group = 1; +} + +// ComplianceGroups encapsulates a group of RPC requests to the Compliance +// server: one request for each combination of elements of `rpcs` and of +// `requests`. +message ComplianceGroup { + string name = 1; + repeated string rpcs = 2; + repeated RepeatRequest requests = 3; +} + +// ComplianceData is a message used for testing REST transcoding of +// different data types. +message ComplianceData { + enum LifeKingdom { + LIFE_KINGDOM_UNSPECIFIED = 0; + ARCHAEBACTERIA = 1; + EUBACTERIA = 2; + PROTISTA = 3; + FUNGI = 4; + PLANTAE = 5; + ANIMALIA = 6; +} + // scalar types + + string f_string = 1; + + int32 f_int32 = 2; + sint32 f_sint32 = 3; + sfixed32 f_sfixed32 = 4; + + uint32 f_uint32 = 5; + fixed32 f_fixed32 = 6; + + int64 f_int64 = 7; + sint64 f_sint64 = 8; + sfixed64 f_sfixed64 = 9; + + uint64 f_uint64 = 10; + fixed64 f_fixed64 = 11; + + double f_double = 12; + float f_float = 13; + + bool f_bool = 14; + + bytes f_bytes = 15; + + LifeKingdom f_kingdom = 22; + + ComplianceDataChild f_child = 16; + + // optional fields + + optional string p_string = 17; + optional int32 p_int32 = 18; + optional double p_double = 19; + optional bool p_bool = 20; + optional LifeKingdom p_kingdom = 23; + optional ComplianceDataChild p_child = 21; +} + +message ComplianceDataChild { + string f_string = 1; + float f_float = 2; + double f_double = 3; + bool f_bool = 4; + Continent f_continent = 11; + ComplianceDataGrandchild f_child = 5; + + optional string p_string = 6; + optional float p_float = 7; + optional double p_double = 8; + optional bool p_bool = 9; + Continent p_continent = 12; + optional ComplianceDataGrandchild p_child = 10; +} + +message ComplianceDataGrandchild { + string f_string = 1; + double f_double = 2; + bool f_bool = 3; +} + +enum Continent { + CONTINENT_UNSPECIFIED = 0; + AFRICA = 1; + AMERICA = 2; + ANTARTICA = 3; + AUSTRALIA = 4; + EUROPE = 5; +} + + +message EnumRequest { + // Whether the client is requesting a new, unknown enum value or a known enum value already declared in this proto file. + bool unknown_enum = 1; +} + +message EnumResponse { + // The original request for a known or unknown enum from the server. + EnumRequest request = 1; + + // The actual enum the server provided. + Continent continent = 2; +} diff --git a/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/proto/schema/google/showcase/v1beta1/echo.proto b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/proto/schema/google/showcase/v1beta1/echo.proto new file mode 100644 index 0000000000..55b7ab578a --- /dev/null +++ b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/proto/schema/google/showcase/v1beta1/echo.proto @@ -0,0 +1,424 @@ +// 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 +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT 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"; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/field_info.proto"; +import "google/api/routing.proto"; +import "google/longrunning/operations.proto"; +import "google/protobuf/any.proto"; +import "google/protobuf/duration.proto"; +import "google/protobuf/timestamp.proto"; +import "google/rpc/status.proto"; + +package google.showcase.v1beta1; + +option go_package = "github.com/googleapis/gapic-showcase/server/genproto"; +option java_package = "com.google.showcase.v1beta1"; +option java_multiple_files = true; +option ruby_package = "Google::Showcase::V1beta1"; + +// This service is used showcase the four main types of rpcs - unary, server +// side streaming, client side streaming, and bidirectional streaming. This +// service also exposes methods that explicitly implement server delay, and +// paginated calls. Set the 'showcase-trailer' metadata key on any method +// to have the values echoed in the response trailers. Set the +// 'x-goog-request-params' metadata key on any method to have the values +// echoed in the response headers. +service Echo { + // This service is meant to only run locally on the port 7469 (keypad digits + // for "show"). + option (google.api.default_host) = "localhost:7469"; + // See https://github.com/aip-dev/google.aip.dev/pull/1331 + option (google.api.api_version) = "v1_20240408"; + + // This method simply echoes the request. This method showcases unary RPCs. + rpc Echo(EchoRequest) returns (EchoResponse) { + option (google.api.http) = { + post: "/v1beta1/echo:echo" + body: "*" + }; + option (google.api.routing) = { + routing_parameters{ + field: "header" + } + routing_parameters{ + field: "header" + path_template: "{routing_id=**}" + } + routing_parameters{ + field: "header" + path_template: "{table_name=regions/*/zones/*/**}" + } + routing_parameters{ + field: "header" + path_template: "{super_id=projects/*}/**" + } + routing_parameters{ + field: "header" + path_template: "{table_name=projects/*/instances/*/**}" + } + routing_parameters{ + field: "header" + path_template: "projects/*/{instance_id=instances/*}/**" + } + routing_parameters{ + field: "other_header" + path_template: "{baz=**}" + } + routing_parameters{ + field: "other_header" + path_template: "{qux=projects/*}/**" + } + }; + } + + // This method returns error details in a repeated "google.protobuf.Any" + // field. This method showcases handling errors thus encoded, particularly + // over REST transport. Note that GAPICs only allow the type + // "google.protobuf.Any" for field paths ending in "error.details", and, at + // run-time, the actual types for these fields must be one of the types in + // google/rpc/error_details.proto. + rpc EchoErrorDetails(EchoErrorDetailsRequest) returns (EchoErrorDetailsResponse) { + option (google.api.http) = { + post: "/v1beta1/echo:error-details" + body: "*" + }; + } + + // This method always fails with a gRPC "Aborted" error status that contains + // multiple error details. These include one instance of each of the standard + // ones in error_details.proto + // (https://github.com/googleapis/googleapis/blob/master/google/rpc/error_details.proto) + // plus a custom, Showcase-defined PoetryError. The intent of this RPC is to + // verify that GAPICs can process these various error details and surface them + // to the user in an idiomatic form. + rpc FailEchoWithDetails(FailEchoWithDetailsRequest) returns (FailEchoWithDetailsResponse) { + option (google.api.http) = { + post: "/v1beta1/echo:failWithDetails" + body: "*" + }; + } + + // This method splits the given content into words and will pass each word back + // through the stream. This method showcases server-side streaming RPCs. + rpc Expand(ExpandRequest) returns (stream EchoResponse) { + option (google.api.http) = { + post: "/v1beta1/echo:expand" + body: "*" + }; + // TODO(landrito): change this to be `fields: ["content", "error"]` once + // github.com/dcodeIO/protobuf.js/issues/1094 has been resolved. + option (google.api.method_signature) = "content,error"; + } + + // This method will collect the words given to it. When the stream is closed + // by the client, this method will return the a concatenation of the strings + // passed to it. This method showcases client-side streaming RPCs. + rpc Collect(stream EchoRequest) returns (EchoResponse) { + option (google.api.http) = { + post: "/v1beta1/echo:collect" + body: "*" + }; + } + + // This method, upon receiving a request on the stream, will pass the same + // content back on the stream. This method showcases bidirectional + // streaming RPCs. + rpc Chat(stream EchoRequest) returns (stream EchoResponse); + + // This is similar to the Expand method but instead of returning a stream of + // expanded words, this method returns a paged list of expanded words. + rpc PagedExpand(PagedExpandRequest) returns (PagedExpandResponse) { + option (google.api.http) = { + post: "/v1beta1/echo:pagedExpand" + body: "*" + }; + } + + // This is similar to the PagedExpand except that it uses + // max_results instead of page_size, as some legacy APIs still + // do. New APIs should NOT use this pattern. + rpc PagedExpandLegacy(PagedExpandLegacyRequest) returns (PagedExpandResponse) { + option (google.api.http) = { + post: "/v1beta1/echo:pagedExpandLegacy" + body: "*" + }; + } + + // This method returns a map containing lists of words that appear in the input, keyed by their + // initial character. The only words returned are the ones included in the current page, + // as determined by page_token and page_size, which both refer to the word indices in the + // input. This paging result consisting of a map of lists is a pattern used by some legacy + // APIs. New APIs should NOT use this pattern. + rpc PagedExpandLegacyMapped(PagedExpandRequest) returns (PagedExpandLegacyMappedResponse) { + option (google.api.http) = { + post: "/v1beta1/echo:pagedExpandLegacyMapped" + body: "*" + }; + } + + // This method will wait for the requested amount of time and then return. + // This method showcases how a client handles a request timeout. + rpc Wait(WaitRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1beta1/echo:wait" + body: "*" + }; + option (google.longrunning.operation_info) = { + response_type: "WaitResponse" + metadata_type: "WaitMetadata" + }; + } + + // This method will block (wait) for the requested amount of time + // and then return the response or error. + // This method showcases how a client handles delays or retries. + rpc Block(BlockRequest) returns (BlockResponse) { + option (google.api.http) = { + post: "/v1beta1/echo:block" + body: "*" + }; + }; +} + +// A severity enum used to test enum capabilities in GAPIC surfaces. +enum Severity { + UNNECESSARY = 0; + NECESSARY = 1; + URGENT = 2; + CRITICAL = 3; +} + + +// The request message used for the Echo, Collect and Chat methods. +// If content or opt are set in this message then the request will succeed. +// If status is set in this message then the status will be returned as an +// error. +message EchoRequest { + oneof response { + // The content to be echoed by the server. + string content = 1; + + // The error to be thrown by the server. + google.rpc.Status error = 2; + } + + // The severity to be echoed by the server. + Severity severity = 3; + + // Optional. This field can be set to test the routing annotation on the Echo method. + string header = 4; + + // Optional. This field can be set to test the routing annotation on the Echo method. + string other_header = 5; + + // To facilitate testing of https://google.aip.dev/client-libraries/4235 + string request_id = 7 [ + (google.api.field_info).format = UUID4 + ]; + + // To facilitate testing of https://google.aip.dev/client-libraries/4235 + optional string other_request_id = 8 [ + (google.api.field_info).format = UUID4 + ]; +} + +// The response message for the Echo methods. +message EchoResponse { + // The content specified in the request. + string content = 1; + + // The severity specified in the request. + Severity severity = 2; + + // The request ID specified or autopopulated in the request. + string request_id = 3; + + // The other request ID specified or autopopulated in the request. + string other_request_id = 4; +} + +// The request message used for the EchoErrorDetails method. +message EchoErrorDetailsRequest { + // Content to return in a singular `*.error.details` field of type + // `google.protobuf.Any` + string single_detail_text = 1; + + // Content to return in a repeated `*.error.details` field of type + // `google.protobuf.Any` + repeated string multi_detail_text = 2; +} + +// The response message used for the EchoErrorDetails method. +message EchoErrorDetailsResponse { + + message SingleDetail { + ErrorWithSingleDetail error = 1; + } + + message MultipleDetails { + ErrorWithMultipleDetails error = 1; + } + + SingleDetail single_detail = 1; + MultipleDetails multiple_details = 2; +} + +message ErrorWithSingleDetail { + google.protobuf.Any details = 1; +} + +message ErrorWithMultipleDetails { + repeated google.protobuf.Any details = 1; +} + +// The custom error detail to be included in the error response from the +// FailEchoWithDetails method. Client libraries should be able to +// surface this custom error detail. +message PoetryError { + string poem = 1; +} + +// The request message used for the FailEchoWithDetails method. +message FailEchoWithDetailsRequest { + // Optional message to echo back in the PoetryError. If empty, a value will be + // provided. + string message = 1; +} + +// The response message declared (but never used) for the FailEchoWithDetails +// method. +message FailEchoWithDetailsResponse {} + +// The request message for the Expand method. +message ExpandRequest { + // The content that will be split into words and returned on the stream. + string content = 1; + + // The error that is thrown after all words are sent on the stream. + google.rpc.Status error = 2; + + //The wait time between each server streaming messages + google.protobuf.Duration stream_wait_time = 3; +} + +// The request for the PagedExpand method. +message PagedExpandRequest { + // The string to expand. + string content = 1 [(google.api.field_behavior) = REQUIRED]; + + // The number of words to returned in each page. + int32 page_size = 2; + + // The position of the page to be returned. + string page_token = 3; +} + +// The request for the PagedExpandLegacy method. This is a pattern used by some legacy APIs. New +// APIs should NOT use this pattern, but rather something like PagedExpandRequest which conforms to +// aip.dev/158. +message PagedExpandLegacyRequest { + // The string to expand. + string content = 1 [(google.api.field_behavior) = REQUIRED]; + + // The number of words to returned in each page. + // (-- aip.dev/not-precedent: This is a legacy, non-standard pattern that + // violates aip.dev/158. Ordinarily, this should be page_size. --) + int32 max_results = 2; + + // The position of the page to be returned. + string page_token = 3; +} + +// The response for the PagedExpand method. +message PagedExpandResponse { + // The words that were expanded. + repeated EchoResponse responses = 1; + + // The next page token. + string next_page_token = 2; +} + +// A list of words. +message PagedExpandResponseList { + repeated string words = 1; +} + +message PagedExpandLegacyMappedResponse { + // The words that were expanded, indexed by their initial character. + // (-- aip.dev/not-precedent: This is a legacy, non-standard pattern that violates + // aip.dev/158. Ordinarily, this should be a `repeated` field, as in PagedExpandResponse. --) + map alphabetized = 1; + + // The next page token. + string next_page_token = 2; +} + +// The request for Wait method. +message WaitRequest { + oneof end { + // The time that this operation will complete. + google.protobuf.Timestamp end_time = 1; + + // The duration of this operation. + google.protobuf.Duration ttl = 4; + } + + oneof response { + // The error that will be returned by the server. If this code is specified + // to be the OK rpc code, an empty response will be returned. + google.rpc.Status error = 2; + + // The response to be returned on operation completion. + WaitResponse success = 3; + } +} + +// The result of the Wait operation. +message WaitResponse { + // This content of the result. + string content = 1; +} + +// The metadata for Wait operation. +message WaitMetadata { + // The time that this operation will complete. + google.protobuf.Timestamp end_time =1; +} + +// The request for Block method. +message BlockRequest { + // The amount of time to block before returning a response. + google.protobuf.Duration response_delay = 1; + + oneof response { + // The error that will be returned by the server. If this code is specified + // to be the OK rpc code, an empty response will be returned. + google.rpc.Status error = 2; + + // The response to be returned that will signify successful method call. + BlockResponse success = 3; + } +} + +// The response for Block method. +message BlockResponse { + // This content can contain anything, the server will not depend on a value + // here. + string content = 1; +} diff --git a/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/proto/schema/google/showcase/v1beta1/identity.proto b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/proto/schema/google/showcase/v1beta1/identity.proto new file mode 100644 index 0000000000..569c604d78 --- /dev/null +++ b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/proto/schema/google/showcase/v1beta1/identity.proto @@ -0,0 +1,186 @@ +// 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 +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT 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"; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/protobuf/empty.proto"; +import "google/protobuf/field_mask.proto"; +import "google/protobuf/timestamp.proto"; + +package google.showcase.v1beta1; + +option go_package = "github.com/googleapis/gapic-showcase/server/genproto"; +option java_package = "com.google.showcase.v1beta1"; +option java_multiple_files = true; +option ruby_package = "Google::Showcase::V1beta1"; + +// A simple identity service. +service Identity { + // This service is meant to only run locally on the port 7469 (keypad digits + // for "show"). + option (google.api.default_host) = "localhost:7469"; + + // Creates a user. + rpc CreateUser(CreateUserRequest) returns (User) { + option (google.api.http) = { + post: "/v1beta1/users" + body: "*" + }; + option (google.api.method_signature) = "user.display_name,user.email"; + option (google.api.method_signature) = + "user.display_name,user.email,user.age,user.nickname,user.enable_notifications,user.height_feet"; + } + + // Retrieves the User with the given uri. + rpc GetUser(GetUserRequest) returns (User) { + option (google.api.http) = { + get: "/v1beta1/{name=users/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Updates a user. + rpc UpdateUser(UpdateUserRequest) returns (User) { + option (google.api.http) = { + patch: "/v1beta1/{user.name=users/*}" + body: "user" + }; + } + + // Deletes a user, their profile, and all of their authored messages. + rpc DeleteUser(DeleteUserRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v1beta1/{name=users/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Lists all users. + rpc ListUsers(ListUsersRequest) returns (ListUsersResponse) { + option (google.api.http) = { + get: "/v1beta1/users" + }; + } +} + +// A user. +message User { + option (google.api.resource) = { + type: "showcase.googleapis.com/User" + pattern: "users/{user}" + }; + + // The resource name of the user. + string name = 1; + + // The display_name of the user. + string display_name = 2 [(google.api.field_behavior) = REQUIRED]; + + // The email address of the user. + string email = 3 [(google.api.field_behavior) = REQUIRED]; + + // The timestamp at which the user was created. + google.protobuf.Timestamp create_time = 4 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // The latest timestamp at which the user was updated. + google.protobuf.Timestamp update_time = 5 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // The age of the user in years. + optional int32 age = 6; + + // The height of the user in feet. + optional double height_feet = 7; + + // The nickname of the user. + // + // (-- aip.dev/not-precedent: An empty string is a valid nickname. + // Ordinarily, proto3_optional should not be used on a `string` field. --) + optional string nickname = 8; + + // Enables the receiving of notifications. The default is true if unset. + // + // (-- aip.dev/not-precedent: The default for the feature is true. + // Ordinarily, the default for a `bool` field should be false. --) + optional bool enable_notifications = 9; +} + +// The request message for the google.showcase.v1beta1.Identity\CreateUser +// method. +message CreateUserRequest { + // The user to create. + User user = 1; +} + +// The request message for the google.showcase.v1beta1.Identity\GetUser +// method. +message GetUserRequest { + // The resource name of the requested user. + string name = 1 [ + (google.api.resource_reference).type = "showcase.googleapis.com/User", + (google.api.field_behavior) = REQUIRED + ]; +} + +// The request message for the google.showcase.v1beta1.Identity\UpdateUser +// method. +message UpdateUserRequest { + // The user to update. + User user = 1; + + // The field mask to determine which fields are to be updated. If empty, the + // server will assume all fields are to be updated. + google.protobuf.FieldMask update_mask = 2; +} + +// The request message for the google.showcase.v1beta1.Identity\DeleteUser +// method. +message DeleteUserRequest { + // The resource name of the user to delete. + string name = 1 [ + (google.api.resource_reference).type = "showcase.googleapis.com/User", + (google.api.field_behavior) = REQUIRED + ]; +} + +// The request message for the google.showcase.v1beta1.Identity\ListUsers +// method. +message ListUsersRequest { + // The maximum number of users to return. Server may return fewer users + // than requested. If unspecified, server will pick an appropriate default. + int32 page_size = 1; + + // The value of google.showcase.v1beta1.ListUsersResponse.next_page_token + // returned from the previous call to + // `google.showcase.v1beta1.Identity\ListUsers` method. + string page_token = 2; +} + +// The response message for the google.showcase.v1beta1.Identity\ListUsers +// method. +message ListUsersResponse { + // The list of users. + repeated User users = 1; + + // A token to retrieve next page of results. + // Pass this value in ListUsersRequest.page_token field in the subsequent + // call to `google.showcase.v1beta1.Message\ListUsers` method to retrieve the + // next page of results. + string next_page_token = 2; +} diff --git a/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/proto/schema/google/showcase/v1beta1/messaging.proto b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/proto/schema/google/showcase/v1beta1/messaging.proto new file mode 100644 index 0000000000..330dc8c9e7 --- /dev/null +++ b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/proto/schema/google/showcase/v1beta1/messaging.proto @@ -0,0 +1,520 @@ +// 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 +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT 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"; + +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"; +import "google/rpc/error_details.proto"; + +package google.showcase.v1beta1; + +option go_package = "github.com/googleapis/gapic-showcase/server/genproto"; +option java_package = "com.google.showcase.v1beta1"; +option java_multiple_files = true; +option ruby_package = "Google::Showcase::V1beta1"; + +// A simple messaging service that implements chat rooms and profile posts. +// +// This messaging service showcases the features that API clients +// generated by gapic-generators implement. +service Messaging { + // This service is meant to only run locally on the port 7469 (keypad digits + // for "show"). + option (google.api.default_host) = "localhost:7469"; + + // Creates a room. + rpc CreateRoom(CreateRoomRequest) returns (Room) { + option (google.api.http) = { + post: "/v1beta1/rooms" + body: "*" + }; + option (google.api.method_signature) = "room.display_name,room.description"; + } + + // Retrieves the Room with the given resource name. + rpc GetRoom(GetRoomRequest) returns (Room) { + option (google.api.http) = { + get: "/v1beta1/{name=rooms/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Updates a room. + rpc UpdateRoom(UpdateRoomRequest) returns (Room) { + option (google.api.http) = { + patch: "/v1beta1/{room.name=rooms/*}" + body: "room" + }; + } + + // Deletes a room and all of its blurbs. + rpc DeleteRoom(DeleteRoomRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v1beta1/{name=rooms/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Lists all chat rooms. + rpc ListRooms(ListRoomsRequest) returns (ListRoomsResponse) { + option (google.api.http) = { + get: "/v1beta1/rooms" + }; + } + + // Creates a blurb. If the parent is a room, the blurb is understood to be a + // message in that room. If the parent is a profile, the blurb is understood + // to be a post on the profile. + rpc CreateBlurb(CreateBlurbRequest) returns (Blurb) { + option (google.api.http) = { + post: "/v1beta1/{parent=rooms/*}/blurbs" + body: "*" + additional_bindings: { + post: "/v1beta1/{parent=users/*/profile}/blurbs" + body: "*" + } + }; + option (google.api.method_signature) = "parent,blurb.user,blurb.text"; + option (google.api.method_signature) = "parent,blurb.user,blurb.image"; + } + + // Retrieves the Blurb with the given resource name. + rpc GetBlurb(GetBlurbRequest) returns (Blurb) { + option (google.api.http) = { + get: "/v1beta1/{name=rooms/*/blurbs/*}" + additional_bindings: { get: "/v1beta1/{name=users/*/profile/blurbs/*}" } + }; + option (google.api.method_signature) = "name"; + } + + // Updates a blurb. + rpc UpdateBlurb(UpdateBlurbRequest) returns (Blurb) { + option (google.api.http) = { + patch: "/v1beta1/{blurb.name=rooms/*/blurbs/*}" + body: "blurb" + additional_bindings: { + patch: "/v1beta1/{blurb.name=users/*/profile/blurbs/*}" + body: "blurb" + } + }; + } + + // Deletes a blurb. + rpc DeleteBlurb(DeleteBlurbRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v1beta1/{name=rooms/*/blurbs/*}" + additional_bindings: { + delete: "/v1beta1/{name=users/*/profile/blurbs/*}" + } + }; + option (google.api.method_signature) = "name"; + } + + // Lists blurbs for a specific chat room or user profile depending on the + // parent resource name. + rpc ListBlurbs(ListBlurbsRequest) returns (ListBlurbsResponse) { + option (google.api.http) = { + get: "/v1beta1/{parent=rooms/*}/blurbs" + additional_bindings: { get: "/v1beta1/{parent=users/*/profile}/blurbs" } + }; + option (google.api.method_signature) = "parent"; + } + + // This method searches through all blurbs across all rooms and profiles + // for blurbs containing to words found in the query. Only posts that + // contain an exact match of a queried word will be returned. + rpc SearchBlurbs(SearchBlurbsRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1beta1/{parent=rooms/*}/blurbs:search" + body: "*" + additional_bindings: { + post: "/v1beta1/{parent=users/*/profile}/blurbs:search" + } + }; + option (google.longrunning.operation_info) = { + response_type: "SearchBlurbsResponse" + metadata_type: "SearchBlurbsMetadata" + }; + option (google.api.method_signature) = "parent,query"; + } + + // This returns a stream that emits the blurbs that are created for a + // particular chat room or user profile. + rpc StreamBlurbs(StreamBlurbsRequest) returns (stream StreamBlurbsResponse) { + option (google.api.http) = { + post: "/v1beta1/{name=rooms/*}/blurbs:stream" + body: "*" + additional_bindings: { + post: "/v1beta1/{name=users/*/profile}/blurbs:stream" + body: "*" + } + }; + } + + // This is a stream to create multiple blurbs. If an invalid blurb is + // requested to be created, the stream will close with an error. + rpc SendBlurbs(stream CreateBlurbRequest) returns (SendBlurbsResponse) { + option (google.api.http) = { + post: "/v1beta1/{parent=rooms/*}/blurbs:send" + body: "*" + additional_bindings: { + post: "/v1beta1/{parent=users/*/profile}/blurbs:send" + body: "*" + } + }; + } + + // This method starts a bidirectional stream that receives all blurbs that + // are being created after the stream has started and sends requests to create + // blurbs. If an invalid blurb is requested to be created, the stream will + // close with an error. + rpc Connect(stream ConnectRequest) returns (stream StreamBlurbsResponse); +} + +// A chat room. +message Room { + option (google.api.resource) = { + type: "showcase.googleapis.com/Room" + pattern: "rooms/{room}" + }; + + // The resource name of the chat room. + string name = 1; + + // The human readable name of the chat room. + string display_name = 2 [(google.api.field_behavior) = REQUIRED]; + + // The description of the chat room. + string description = 3; + + // The timestamp at which the room was created. + google.protobuf.Timestamp create_time = 4 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // The latest timestamp at which the room was updated. + google.protobuf.Timestamp update_time = 5 + [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// The request message for the google.showcase.v1beta1.Messaging\CreateRoom +// method. +message CreateRoomRequest { + // The room to create. + Room room = 1; +} + +// The request message for the google.showcase.v1beta1.Messaging\GetRoom +// method. +message GetRoomRequest { + // The resource name of the requested room. + string name = 1 [ + (google.api.resource_reference).type = "showcase.googleapis.com/Room", + (google.api.field_behavior) = REQUIRED + ]; +} + +// The request message for the google.showcase.v1beta1.Messaging\UpdateRoom +// method. +message UpdateRoomRequest { + // The room to update. + Room room = 1; + + // The field mask to determine which fields are to be updated. If empty, the + // server will assume all fields are to be updated. + google.protobuf.FieldMask update_mask = 2; +} + +// The request message for the google.showcase.v1beta1.Messaging\DeleteRoom +// method. +message DeleteRoomRequest { + // The resource name of the requested room. + string name = 1 [ + (google.api.resource_reference).type = "showcase.googleapis.com/Room", + (google.api.field_behavior) = REQUIRED + ]; +} + +// The request message for the google.showcase.v1beta1.Messaging\ListRooms +// method. +message ListRoomsRequest { + // The maximum number of rooms return. Server may return fewer rooms + // than requested. If unspecified, server will pick an appropriate default. + int32 page_size = 1; + + // The value of google.showcase.v1beta1.ListRoomsResponse.next_page_token + // returned from the previous call to + // `google.showcase.v1beta1.Messaging\ListRooms` method. + string page_token = 2; +} + +// The response message for the google.showcase.v1beta1.Messaging\ListRooms +// method. +message ListRoomsResponse { + // The list of rooms. + repeated Room rooms = 1; + + // A token to retrieve next page of results. + // Pass this value in ListRoomsRequest.page_token field in the subsequent + // call to `google.showcase.v1beta1.Messaging\ListRooms` method to retrieve + // the next page of results. + string next_page_token = 2; +} + +// This protocol buffer message represents a blurb sent to a chat room or +// posted on a user profile. +message Blurb { + option (google.api.resource) = { + type: "showcase.googleapis.com/Blurb" + pattern: "users/{user}/profile/blurbs/legacy/{legacy_user}~{blurb}" + pattern: "users/{user}/profile/blurbs/{blurb}" + pattern: "rooms/{room}/blurbs/{blurb}" + pattern: "rooms/{room}/blurbs/legacy/{legacy_room}.{blurb}" + }; + + // The resource name of the chat room. + string name = 1; + + // The resource name of the blurb's author. + string user = 2 [ + (google.api.resource_reference).type = "showcase.googleapis.com/User", + (google.api.field_behavior) = REQUIRED + ]; + + oneof content { + // The textual content of this blurb. + string text = 3; + + // The image content of this blurb. + bytes image = 4; + } + + // The timestamp at which the blurb was created. + google.protobuf.Timestamp create_time = 5 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // The latest timestamp at which the blurb was updated. + google.protobuf.Timestamp update_time = 6 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // (-- aip.dev/not-precedent: This is designed for testing non-slash + // resource patterns. Ordinarily, non-slash separators are discouraged. + // --) + oneof legacy_id { + // The legacy id of the room. This field is used to signal + // the use of the compound resource pattern + // `rooms/{room}/blurbs/legacy/{legacy_room}.{blurb}` + string legacy_room_id = 7; + + // The legacy id of the user. This field is used to signal + // the use of the compound resource pattern + // `users/{user}/profile/blurbs/legacy/{legacy_user}~{blurb}` + string legacy_user_id = 8; + } +} + +// The request message for the google.showcase.v1beta1.Messaging\CreateBlurb +// method. +message CreateBlurbRequest { + // The resource name of the chat room or user profile that this blurb will + // be tied to. + string parent = 1 [ + (google.api.resource_reference).child_type = + "showcase.googleapis.com/Blurb", + (google.api.field_behavior) = REQUIRED + ]; + + // The blurb to create. + Blurb blurb = 2; +} + +// The request message for the google.showcase.v1beta1.Messaging\GetBlurb +// method. +message GetBlurbRequest { + // The resource name of the requested blurb. + string name = 1 [ + (google.api.resource_reference).type = "showcase.googleapis.com/Blurb", + (google.api.field_behavior) = REQUIRED + ]; +} + +// The request message for the google.showcase.v1beta1.Messaging\UpdateBlurb +// method. +message UpdateBlurbRequest { + // The blurb to update. + Blurb blurb = 1; + + // The field mask to determine which fields are to be updated. If empty, the + // server will assume all fields are to be updated. + google.protobuf.FieldMask update_mask = 2; +} + +// The request message for the google.showcase.v1beta1.Messaging\DeleteBlurb +// method. +message DeleteBlurbRequest { + // The resource name of the requested blurb. + string name = 1 [ + (google.api.resource_reference).type = "showcase.googleapis.com/Blurb", + (google.api.field_behavior) = REQUIRED + ]; +} + +// The request message for the google.showcase.v1beta1.Messaging\ListBlurbs +// method. +message ListBlurbsRequest { + // The resource name of the requested room or profile who blurbs to list. + string parent = 1 [ + (google.api.resource_reference).child_type = + "showcase.googleapis.com/Blurb", + (google.api.field_behavior) = REQUIRED + ]; + + // The maximum number of blurbs to return. Server may return fewer + // blurbs than requested. If unspecified, server will pick an appropriate + // default. + int32 page_size = 2; + + // The value of google.showcase.v1beta1.ListBlurbsResponse.next_page_token + // returned from the previous call to + // `google.showcase.v1beta1.Messaging\ListBlurbs` method. + string page_token = 3; +} + +// The response message for the google.showcase.v1beta1.Messaging\ListBlurbs +// method. +message ListBlurbsResponse { + // The list of blurbs. + repeated Blurb blurbs = 1; + + // A token to retrieve next page of results. + // Pass this value in ListBlurbsRequest.page_token field in the subsequent + // call to `google.showcase.v1beta1.Blurb\ListBlurbs` method to retrieve + // the next page of results. + string next_page_token = 2; +} + +// The request message for the google.showcase.v1beta1.Messaging\SearchBlurbs +// method. +message SearchBlurbsRequest { + // The query used to search for blurbs containing to words of this string. + // Only posts that contain an exact match of a queried word will be returned. + string query = 1 [(google.api.field_behavior) = REQUIRED]; + + // The rooms or profiles to search. If unset, `SearchBlurbs` will search all + // rooms and all profiles. + string parent = 2 [(google.api.resource_reference).child_type = + "showcase.googleapis.com/Blurb"]; + + // The maximum number of blurbs return. Server may return fewer + // blurbs than requested. If unspecified, server will pick an appropriate + // default. + int32 page_size = 3; + + // The value of + // google.showcase.v1beta1.SearchBlurbsResponse.next_page_token + // returned from the previous call to + // `google.showcase.v1beta1.Messaging\SearchBlurbs` method. + string page_token = 4; +} + +// The operation metadata message for the +// google.showcase.v1beta1.Messaging\SearchBlurbs method. +message SearchBlurbsMetadata { + // This signals to the client when to next poll for response. + google.rpc.RetryInfo retry_info = 1; +} + +// The operation response message for the +// google.showcase.v1beta1.Messaging\SearchBlurbs method. +message SearchBlurbsResponse { + // Blurbs that matched the search query. + repeated Blurb blurbs = 1; + + // A token to retrieve next page of results. + // Pass this value in SearchBlurbsRequest.page_token field in the subsequent + // call to `google.showcase.v1beta1.Blurb\SearchBlurbs` method to + // retrieve the next page of results. + string next_page_token = 2; +} + +// The request message for the google.showcase.v1beta1.Messaging\StreamBlurbs +// method. +message StreamBlurbsRequest { + // The resource name of a chat room or user profile whose blurbs to stream. + string name = 1 [ + (google.api.resource_reference).child_type = + "showcase.googleapis.com/Blurb", + (google.api.field_behavior) = REQUIRED + ]; + + // The time at which this stream will close. + google.protobuf.Timestamp expire_time = 2 + [(google.api.field_behavior) = REQUIRED]; +} + +// The response message for the google.showcase.v1beta1.Messaging\StreamBlurbs +// method. +message StreamBlurbsResponse { + // The blurb that was either created, updated, or deleted. + Blurb blurb = 1; + + // The action that triggered the blurb to be returned. + enum Action { + ACTION_UNSPECIFIED = 0; + + // Specifies that the blurb was created. + CREATE = 1; + + // Specifies that the blurb was updated. + UPDATE = 2; + + // Specifies that the blurb was deleted. + DELETE = 3; + } + + // The action that triggered the blurb to be returned. + Action action = 2; +} + +// The response message for the google.showcase.v1beta1.Messaging\SendBlurbs +// method. +message SendBlurbsResponse { + // The names of successful blurb creations. + repeated string names = 1; +} + +// The request message for the google.showcase.v1beta1.Messaging\Connect +// method. +message ConnectRequest { + message ConnectConfig { + // The room or profile to follow and create messages for. + string parent = 1 [(google.api.resource_reference).child_type = + "showcase.googleapis.com/Blurb"]; + } + + oneof request { + // Provides information that specifies how to process subsequent requests. + // The first `ConnectRequest` message must contain a `config` message. + ConnectConfig config = 1; + + // The blurb to be created. + Blurb blurb = 2; + } +} diff --git a/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/proto/schema/google/showcase/v1beta1/rest_error.proto b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/proto/schema/google/showcase/v1beta1/rest_error.proto new file mode 100644 index 0000000000..0b4e299597 --- /dev/null +++ b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/proto/schema/google/showcase/v1beta1/rest_error.proto @@ -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. + +syntax = "proto3"; + +import "google/protobuf/any.proto"; +import "google/rpc/code.proto"; + +package google.showcase.v1beta1; + +option go_package = "github.com/googleapis/gapic-showcase/server/genproto"; +option java_package = "com.google.showcase.v1beta1"; +option java_multiple_files = true; +option ruby_package = "Google::Showcase::V1beta1"; + +// HTTP/JSON error representation as defined in +// https://google.aip.dev/193#http11json-representation, +message RestError { + message Status { + // The HTTP status code that corresponds to `google.rpc.Status.code`. + int32 code = 1; + // This corresponds to `google.rpc.Status.message`. + string message = 2; + // This is the enum version for `google.rpc.Status.code`. + google.rpc.Code status = 4; + // This corresponds to `google.rpc.Status.details`. + repeated google.protobuf.Any details = 5; + } + + Status error = 1; +} diff --git a/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/proto/schema/google/showcase/v1beta1/sequence.proto b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/proto/schema/google/showcase/v1beta1/sequence.proto new file mode 100644 index 0000000000..a4e3ee28f1 --- /dev/null +++ b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/proto/schema/google/showcase/v1beta1/sequence.proto @@ -0,0 +1,260 @@ +// Copyright 2020 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/protobuf/duration.proto"; +import "google/protobuf/empty.proto"; +import "google/protobuf/timestamp.proto"; +import "google/rpc/status.proto"; + +package google.showcase.v1beta1; + +option go_package = "github.com/googleapis/gapic-showcase/server/genproto"; +option java_package = "com.google.showcase.v1beta1"; +option java_multiple_files = true; +option ruby_package = "Google::Showcase::V1beta1"; + +service SequenceService { + // This service is meant to only run locally on the port 7469 (keypad digits + // for "show"). + option (google.api.default_host) = "localhost:7469"; + + // Creates a sequence. + rpc CreateSequence(CreateSequenceRequest) returns (Sequence) { + option (google.api.http) = { + post: "/v1beta1/sequences" + body: "sequence" + }; + option (google.api.method_signature) = "sequence"; + }; + + // Creates a sequence. + rpc CreateStreamingSequence(CreateStreamingSequenceRequest) returns (StreamingSequence) { + option (google.api.http) = { + post: "/v1beta1/streamingSequences" + body: "streaming_sequence" + }; + option (google.api.method_signature) = "streaming_sequence"; + }; + + // Retrieves a sequence. + rpc GetSequenceReport(GetSequenceReportRequest) returns (SequenceReport) { + option (google.api.http) = { + get: "/v1beta1/{name=sequences/*/sequenceReport}" + }; + option (google.api.method_signature) = "name"; + }; + + // Retrieves a sequence. + rpc GetStreamingSequenceReport(GetStreamingSequenceReportRequest) returns (StreamingSequenceReport) { + option (google.api.http) = { + get: "/v1beta1/{name=streamingSequences/*/streamingSequenceReport}" + }; + option (google.api.method_signature) = "name"; + }; + + // Attempts a sequence. + rpc AttemptSequence(AttemptSequenceRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + post: "/v1beta1/{name=sequences/*}" + body: "*" + }; + option (google.api.method_signature) = "name"; + }; + + // Attempts a streaming sequence. + // May not function as expected in HTTP mode due to when http statuses are sent + // See https://github.com/googleapis/gapic-showcase/issues/1377 for more details + rpc AttemptStreamingSequence(AttemptStreamingSequenceRequest) returns (stream AttemptStreamingSequenceResponse) { + option (google.api.http) = { + post: "/v1beta1/{name=streamingSequences/*}:stream" + body: "*" + }; + option (google.api.method_signature) = "name"; + }; +} + +message Sequence { + option (google.api.resource) = { + type: "showcase.googleapis.com/Sequence" + pattern: "sequences/{sequence}" + }; + + string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // A server response to an RPC Attempt in a sequence. + message Response { + // The status to return for an individual attempt. + google.rpc.Status status = 1; + + // The amount of time to delay sending the response. + google.protobuf.Duration delay = 2; + } + + // Sequence of responses to return in order for each attempt. If empty, the + // default response is an immediate OK. + repeated Response responses = 2; +} + +message StreamingSequence { + option (google.api.resource) = { + type: "showcase.googleapis.com/StreamingSequence" + pattern: "streamingSequences/{streaming_sequence}" + }; + + string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // The Content that the stream will send + string content = 2; + + // A server response to an RPC Attempt in a sequence. + message Response { + // The status to return for an individual attempt. + google.rpc.Status status = 1; + + // The amount of time to delay sending the response. + google.protobuf.Duration delay = 2; + + // The index that the status should be sent + int32 response_index = 3; + } + + // Sequence of responses to return in order for each attempt. If empty, the + // default response is an immediate OK. + repeated Response responses = 3; +} + + +message StreamingSequenceReport { + option (google.api.resource) = { + type: "showcase.googleapis.com/StreamingSequenceReport" + pattern: "streamingSequences/{streaming_sequence}/streamingSequenceReport" + }; + + string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Contains metrics on individual RPC Attempts in a sequence. + message Attempt { + // The attempt number - starting at 0. + int32 attempt_number = 1; + + // The deadline dictated by the attempt to the server. + google.protobuf.Timestamp attempt_deadline = 2; + + // The time that the server responded to the RPC attempt. Used for + // calculating attempt_delay. + google.protobuf.Timestamp response_time = 3; + + // The server perceived delay between sending the last response and + // receiving this attempt. Used for validating attempt delay backoff. + google.protobuf.Duration attempt_delay = 4; + + // The status returned to the attempt. + google.rpc.Status status = 5; + + } + + // The set of RPC attempts received by the server for a Sequence. + repeated Attempt attempts = 2; +} + +message SequenceReport { + option (google.api.resource) = { + type: "showcase.googleapis.com/SequenceReport" + pattern: "sequences/{sequence}/sequenceReport" + }; + + string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Contains metrics on individual RPC Attempts in a sequence. + message Attempt { + // The attempt number - starting at 0. + int32 attempt_number = 1; + + // The deadline dictated by the attempt to the server. + google.protobuf.Timestamp attempt_deadline = 2; + + // The time that the server responded to the RPC attempt. Used for + // calculating attempt_delay. + google.protobuf.Timestamp response_time = 3; + + // The server perceived delay between sending the last response and + // receiving this attempt. Used for validating attempt delay backoff. + google.protobuf.Duration attempt_delay = 4; + + // The status returned to the attempt. + google.rpc.Status status = 5; + } + + // The set of RPC attempts received by the server for a Sequence. + repeated Attempt attempts = 2; +} + +message CreateSequenceRequest { + Sequence sequence = 1; +} + +message CreateStreamingSequenceRequest { + StreamingSequence streaming_sequence = 1; +} + +message AttemptSequenceRequest { + string name = 1 [ + (google.api.resource_reference).type = "showcase.googleapis.com/Sequence", + (google.api.field_behavior) = REQUIRED + ]; + +} + +message AttemptStreamingSequenceRequest { + string name = 1 [ + (google.api.resource_reference).type = "showcase.googleapis.com/StreamingSequence", + (google.api.field_behavior) = REQUIRED + ]; + + // used to send the index of the last failed message + // in the string "content" of an AttemptStreamingSequenceResponse + // needed for stream resumption logic testing + int32 last_fail_index = 2 [ + (google.api.field_behavior) = OPTIONAL + ]; +} + +// The response message for the Echo methods. +message AttemptStreamingSequenceResponse { + // The content specified in the request. + string content = 1; + +} + +message GetSequenceReportRequest { + string name = 1 [ + (google.api.resource_reference).type = + "showcase.googleapis.com/SequenceReport", + (google.api.field_behavior) = REQUIRED + ]; +} + +message GetStreamingSequenceReportRequest { + string name = 1 [ + (google.api.resource_reference).type = + "showcase.googleapis.com/StreamingSequenceReport", + (google.api.field_behavior) = REQUIRED + ]; +} diff --git a/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/proto/schema/google/showcase/v1beta1/testing.proto b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/proto/schema/google/showcase/v1beta1/testing.proto new file mode 100644 index 0000000000..be66091074 --- /dev/null +++ b/java-showcase-3.25.8/proto-gapic-showcase-v1beta1/src/main/proto/schema/google/showcase/v1beta1/testing.proto @@ -0,0 +1,392 @@ +// 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 +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT 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"; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/resource.proto"; +import "google/protobuf/empty.proto"; + +package google.showcase.v1beta1; + +option go_package = "github.com/googleapis/gapic-showcase/server/genproto"; +option java_package = "com.google.showcase.v1beta1"; +option java_multiple_files = true; +option ruby_package = "Google::Showcase::V1beta1"; + +// A service to facilitate running discrete sets of tests +// against Showcase. +// Adding this comment with special characters for comment formatting tests: +// 1. (abra->kadabra->alakazam) +// 2) [Nonsense][]: `pokemon/*/psychic/*` +service Testing { + // This service is meant to only run locally on the port 7469 (keypad digits + // for "show"). + option (google.api.default_host) = "localhost:7469"; + + // Creates a new testing session. + // Adding this comment with special characters for comment formatting tests: + // 1. (abra->kadabra->alakazam) + // 2) [Nonsense][]: `pokemon/*/psychic/*` + rpc CreateSession(CreateSessionRequest) returns (Session) { + option (google.api.http) = { + post: "/v1beta1/sessions" + body: "session" + }; + } + + // Gets a testing session. + rpc GetSession(GetSessionRequest) returns (Session) { + option (google.api.http) = { + get: "/v1beta1/{name=sessions/*}" + }; + } + + // Lists the current test sessions. + rpc ListSessions(ListSessionsRequest) returns (ListSessionsResponse) { + option (google.api.http) = { + get: "/v1beta1/sessions" + }; + } + + // Delete a test session. + rpc DeleteSession(DeleteSessionRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v1beta1/{name=sessions/*}" + }; + } + + // Report on the status of a session. + // This generates a report detailing which tests have been completed, + // and an overall rollup. + rpc ReportSession(ReportSessionRequest) returns (ReportSessionResponse) { + option (google.api.http) = { + post: "/v1beta1/{name=sessions/*}:report" + }; + } + + // List the tests of a sessesion. + rpc ListTests(ListTestsRequest) returns (ListTestsResponse) { + option (google.api.http) = { + get: "/v1beta1/{parent=sessions/*}/tests" + }; + } + + // Explicitly decline to implement a test. + // + // This removes the test from subsequent `ListTests` calls, and + // attempting to do the test will error. + // + // This method will error if attempting to delete a required test. + rpc DeleteTest(DeleteTestRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v1beta1/{name=sessions/*/tests/*}" + }; + } + + // Register a response to a test. + // + // In cases where a test involves registering a final answer at the + // end of the test, this method provides the means to do so. + rpc VerifyTest(VerifyTestRequest) returns (VerifyTestResponse) { + option (google.api.http) = { + post: "/v1beta1/{name=sessions/*/tests/*}:check" + }; + } +} + +// A session is a suite of tests, generally being made in the context +// of testing code generation. +// +// A session defines tests it may expect, based on which version of the +// code generation spec is in use. +message Session { + option (google.api.resource) = { + type: "showcase.googleapis.com/Session" + pattern: "sessions/{session}" + }; + + // The name of the session. The ID must conform to ^[a-z]+$ + // If this is not provided, Showcase chooses one at random. + string name = 1; + + // The specification versions understood by Showcase. + enum Version { + // Unspecified version. If passed on creation, the session will default + // to using the latest stable release. + VERSION_UNSPECIFIED = 0; + + // The latest v1. Currently, this is v1.0. + V1_LATEST = 1; + + // v1.0. (Until the spec is "GA", this will be a moving target.) + V1_0 = 2; + } + + // Required. The version this session is using. + Version version = 2; +} + +// The request for the CreateSession method. +message CreateSessionRequest { + // The session to be created. + // Sessions are immutable once they are created (although they can + // be deleted). + Session session = 1; +} + +// The request for the GetSession method. +message GetSessionRequest { + // The session to be retrieved. + string name = 1 [ + (google.api.resource_reference).type = "showcase.googleapis.com/Session"]; +} + +// The request for the ListSessions method. +message ListSessionsRequest { + // The maximum number of sessions to return per page. + int32 page_size = 1; + + // The page token, for retrieving subsequent pages. + string page_token = 2; +} + +// Response for the ListSessions method. +message ListSessionsResponse { + // The sessions being returned. + repeated Session sessions = 1; + + // The next page token, if any. + // An empty value here means the last page has been reached. + string next_page_token = 2; +} + +// Request for the DeleteSession method. +message DeleteSessionRequest { + // The session to be deleted. + string name = 1 [ + (google.api.resource_reference).type = "showcase.googleapis.com/Session"]; +} + +// Request message for reporting on a session. +message ReportSessionRequest { + // The session to be reported on. + string name = 1 [ + (google.api.resource_reference).type = "showcase.googleapis.com/Session"]; +} + +// Response message for reporting on a session. +message ReportSessionResponse { + // The topline state of the report. + enum Result { + RESULT_UNSPECIFIED = 0; + + // The session is complete, and everything passed. + PASSED = 1; + + // The session had an explicit failure. + FAILED = 2; + + // The session is incomplete. This is a failure response. + INCOMPLETE = 3; + } + + // The state of the report. + Result result = 1; + + // The test runs of this session. + repeated TestRun test_runs = 2; +} + +message Test { + option (google.api.resource) = { + type: "showcase.googleapis.com/Test" + pattern: "sessions/{session}/tests/{test}" + }; + + // The name of the test. + // The tests/* portion of the names are hard-coded, and do not change + // from session to session. + string name = 1; + + // Whether or not a test is required, recommended, or optional. + enum ExpectationLevel { + EXPECTATION_LEVEL_UNSPECIFIED = 0; + + // This test is strictly required. + REQUIRED = 1; + + // This test is recommended. + // + // If a generator explicitly ignores a recommended test (see `DeleteTest`), + // then the report may still pass, but with a warning. + // + // If a generator skips a recommended test and does not explicitly + // express that intention, the report will fail. + RECOMMENDED = 2; + + // This test is optional. + // + // If a generator explicitly ignores an optional test (see `DeleteTest`), + // then the report may still pass, and no warning will be issued. + // + // If a generator skips an optional test and does not explicitly + // express that intention, the report may still pass, but with a + // warning. + OPTIONAL = 3; + } + + // The expectation level for this test. + ExpectationLevel expectation_level = 2; + + // A description of the test. + string description = 3; + + // A blueprint is an explicit definition of methods and requests that are needed + // to be made to test this specific test case. Ideally this would be represented + // by something more robust like CEL, but as of writing this, I am unsure if CEL + // is ready. + message Blueprint { + option (google.api.resource) = { + type: "showcase.googleapis.com/Blueprint" + pattern: "sessions/{session}/tests/{test}/blueprints/{blueprint}" + }; + + // The name of this blueprint. + string name = 1; + + // A description of this blueprint. + string description = 2; + + // A message representing a method invocation. + message Invocation { + // The fully qualified name of the showcase method to be invoked. + string method = 1; + + // The request to be made if a specific request is necessary. + bytes serialized_request = 2; + } + + // The initial request to trigger this test. + Invocation request = 3; + + // An ordered list of method calls that can be called to trigger this test. + repeated Invocation additional_requests = 4; + } + + // The blueprints that will satisfy this test. There may be multiple blueprints + // that can signal to the server that this test case is being exercised. Although + // multiple blueprints are specified, only a single blueprint needs to be run to + // signal that the test case was exercised. + repeated Blueprint blueprints = 4; +} + +// An issue found in the test. +message Issue { + // The different potential types of issues. + enum Type { + TYPE_UNSPECIFIED = 0; + + // The test was never instrumented. + SKIPPED = 1; + + // The test was started but never confirmed. + PENDING = 2; + + // The test was instrumented, but Showcase got an unexpected + // value when the generator tried to confirm success. + INCORRECT_CONFIRMATION = 3; + } + + // The type of the issue. + Type type = 1; + + // Severity levels. + enum Severity { + SEVERITY_UNSPECIFIED = 0; + + // Errors. + ERROR = 1; + + // Warnings. + WARNING = 2; + } + + // The severity of the issue. + Severity severity = 2; + + // A description of the issue. + string description = 3; +} + +// The request for the ListTests method. +message ListTestsRequest { + // The session. + string parent = 1 [ + (google.api.resource_reference).type = "showcase.googleapis.com/Session"]; + + // The maximum number of tests to return per page. + int32 page_size = 2; + + // The page token, for retrieving subsequent pages. + string page_token = 3; +} + +// The response for the ListTests method. +message ListTestsResponse { + // The tests being returned. + repeated Test tests = 1; + + // The next page token, if any. + // An empty value here means the last page has been reached. + string next_page_token = 2; +} + +// A TestRun is the result of running a Test. +message TestRun { + // The name of the test. + // The tests/* portion of the names are hard-coded, and do not change + // from session to session. + string test = 1 [ + (google.api.resource_reference).type = "showcase.googleapis.com/Test"]; + + + // An issue found with the test run. If empty, this test run was successful. + Issue issue = 2; +} + +// Request message for deleting a test. +message DeleteTestRequest { + // The test to be deleted. + string name = 1 [ + (google.api.resource_reference).type = "showcase.googleapis.com/Test"]; +} + +message VerifyTestRequest { + // The test to have an answer registered to it. + string name = 1 [ + (google.api.resource_reference).type = "showcase.googleapis.com/Test"]; + + // The answer from the test. + bytes answer = 2; + + // The answers from the test if multiple are to be checked + repeated bytes answers = 3; +} + +message VerifyTestResponse { + // An issue if check answer was unsuccessful. This will be empty if the check answer succeeded. + Issue issue = 1; +} diff --git a/java-showcase/.OwlBot-hermetic.yaml b/java-showcase/.OwlBot-hermetic.yaml new file mode 100644 index 0000000000..209ddb62d3 --- /dev/null +++ b/java-showcase/.OwlBot-hermetic.yaml @@ -0,0 +1,36 @@ +# 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: +- "/grpc-gapic-showcase-v1beta1/src" +- "/proto-gapic-showcase-v1beta1/src" +- "/gapic-showcase/src" +- "/samples/snippets/generated" + +deep-preserve-regex: +- "/gapic-showcase/src/test" +- "/gapic-showcase/src/main/java/com/google/showcase/v1beta1/Version.java" + +deep-copy-regex: +- source: "/schema/google/showcase/(v.*)/.*-java/proto-.*/src" + dest: "/owl-bot-staging/showcase/$1/proto-gapic-showcase-$1/src" +- source: "/schema/google/showcase/(v.*)/.*-java/grpc-.*/src" + dest: "/owl-bot-staging/showcase/$1/grpc-gapic-showcase-$1/src" +- source: "/schema/google/showcase/(v.*)/.*-java/gapic-.*/src" + dest: "/owl-bot-staging/showcase/$1/gapic-showcase/src" +- source: "/schema/google/showcase/(v.*)/.*-java/samples/snippets/generated" + dest: "/owl-bot-staging/showcase/$1/samples/snippets/generated" + +api-name: showcase \ No newline at end of file diff --git a/java-showcase/.repo-metadata.json b/java-showcase/.repo-metadata.json new file mode 100644 index 0000000000..17f17c5d74 --- /dev/null +++ b/java-showcase/.repo-metadata.json @@ -0,0 +1,16 @@ +{ + "api_shortname": "showcase", + "name_pretty": "Showcase", + "product_documentation": "https://cloud.google.com/dummy", + "api_description": "Showcase module", + "client_documentation": "https://cloud.google.com/java/docs/reference/gapic-showcase/latest/overview", + "release_level": "preview", + "transport": "both", + "language": "java", + "repo": "googleapis/sdk-platform-java", + "repo_short": "java-showcase", + "distribution_name": "com.google.cloud:gapic-showcase", + "library_type": "OTHER", + "requires_billing": true, + "excluded_poms": "gapic-showcase-bom" +} \ No newline at end of file diff --git a/java-showcase/README.md b/java-showcase/README.md new file mode 100644 index 0000000000..0c0fd75acd --- /dev/null +++ b/java-showcase/README.md @@ -0,0 +1,95 @@ +# Showcase Integration Testing + +[GAPIC Showcase](https://github.com/googleapis/gapic-showcase) is an API that demonstrates Generated +API Client (GAPIC) features and common API patterns used by Google. It follows the [Cloud APIs +design guide](https://cloud.google.com/apis/design/). `gapic-generator-java` generates a client for +the Showcase API which can communicate with a local Showcase server to perform integration tests. + +## Requirements + +* Install [Go](https://go.dev) in your `PATH`. + +## Installing the Server + +Using the latest version of showcase is recommended, but backward compatibility between server +versions is not guaranteed. If changing the version of the server, it may also be necessary to +update to a compatible client version in `./WORKSPACE`. + +```shell +# Install the showcase server version defined in gapic-showcase/pom.xml +cd java-showcase +go install github.com/googleapis/gapic-showcase/cmd/gapic-showcase@v"$(cd gapic-showcase;mvn help:evaluate -Dexpression=gapic-showcase.version -q -DforceStdout |sed 's/\x1b\[[0-9;]*m//g')" +PATH=$PATH:`go env GOPATH`/bin +gapic-showcase --help +> Root command of gapic-showcase +> +> Usage: +> gapic-showcase [command] +> +> Available Commands: +> completion Emits bash a completion for gapic-showcase +> compliance This service is used to test that GAPICs... +> echo This service is used showcase the four main types... +> help Help about any command +> identity A simple identity service. +> messaging A simple messaging service that implements chat... +> run Runs the showcase server +> sequence Sub-command for Service: Sequence +> testing A service to facilitate running discrete sets of... +> +> Flags: +> -h, --help help for gapic-showcase +> -j, --json Print JSON output +> -v, --verbose Print verbose output +> --version version for gapic-showcase +``` + +## Running the Server + +Run the showcase server to allow requests to be sent to it. This opens port `:7469` to send and +receive requests. + +```shell +gapic-showcase run +> 2022/11/21 16:22:15 Showcase listening on port: :7469 +> 2022/11/21 16:22:15 Starting endpoint 0: gRPC endpoint +> 2022/11/21 16:22:15 Starting endpoint 1: HTTP/REST endpoint +> 2022/11/21 16:22:15 Starting endpoint multiplexer +> 2022/11/21 16:22:15 Listening for gRPC-fallback connections +> 2022/11/21 16:22:15 Listening for gRPC connections +> 2022/11/21 16:22:15 Listening for REST connections +> 2022/11/21 16:22:15 Fallback server listening on port: :1337 +``` + +## Running the Integration Tests + +Open a new terminal window in the root project directory. +This step does not require Docker. + +```shell +cd java-showcase +mvn verify -P enable-integration-tests +``` + +## Running the Golden tests + +**NOTE** This requires Docker to be installed in your machine. +Open a new terminal window in the root project directory. + +```shell +cd java-showcase +mvn verify -P enable-golden-tests +``` + + +## Update the Golden Showcase Files + +**NOTE** This requires Docker to be installed in your machine. +Open a new terminal window in the root project directory. + +```shell +# In repository's root directory +mvn clean install -DskipTests +cd java-showcase +mvn compile -P update +``` diff --git a/java-showcase/gapic-showcase-extended/proto/BUILD.bazel b/java-showcase/gapic-showcase-extended/proto/BUILD.bazel new file mode 100644 index 0000000000..bc57596d1b --- /dev/null +++ b/java-showcase/gapic-showcase-extended/proto/BUILD.bazel @@ -0,0 +1,34 @@ +# Copyright 2023 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +""" +Provides proto_library target +Exports grpc service config +""" +load ("@rules_proto//proto:defs.bzl", "proto_library") + +# This is an API workspace, having public visibility by default makes perfect sense. +package(default_visibility = ["//visibility:public"]) + +# This BUILD file is the framework for gapic-showcase-extended (an extension to the existing gapic-showcase) +# It serves to augment the existing showcase project with generic protos not *yet* suited to the upstream project +# +# gapic-showcase project is used to test the generated client behavior with a showcase server +# gapic-showcase-extension project is used to test the generator's behavior + +#proto_library( +# name = "showcase_proto_extended", +# srcs = [], +# deps = [] +#) \ No newline at end of file diff --git a/java-showcase/gapic-showcase-extended/proto/wicked.proto b/java-showcase/gapic-showcase-extended/proto/wicked.proto new file mode 100644 index 0000000000..ea45fee918 --- /dev/null +++ b/java-showcase/gapic-showcase-extended/proto/wicked.proto @@ -0,0 +1,49 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT 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"; + +import "google/api/client.proto"; + +package google.showcase.v1beta1; + +option go_package = "github.com/googleapis/gapic-showcase/server/genproto"; +option java_package = "com.google.showcase.v1beta1"; +option java_multiple_files = true; +option ruby_package = "Google::Showcase::V1beta1"; + +// This service is used to show a Service with either non-enabled or non-eligible +// RPCs for HttpJson (Http 1.1). +// Non-Enabled: Missing the (google.api.http) annotation to enabled it +// Non-Eligible: BIDI and Client side streaming are not supported with Http 1.1 +// Service name is reference to `No REST for the Wicked` +service Wicked { + // This service is meant to only run locally on the port 7469 (keypad digits + // for "show"). + option (google.api.default_host) = "localhost:7469"; + + rpc CraftEvilPlan(EvilRequest) returns (EvilResponse); + + rpc BrainstormEvilPlans(stream EvilRequest) returns (stream EvilResponse); + + rpc PersuadeEvilPlan(stream EvilRequest) returns (EvilResponse); +} + +message EvilRequest { + string malicious_idea = 1; +} + +message EvilResponse { + string malicious_plan = 1; +} \ No newline at end of file diff --git a/java-showcase/gapic-showcase/pom.xml b/java-showcase/gapic-showcase/pom.xml new file mode 100644 index 0000000000..bc8d2cc812 --- /dev/null +++ b/java-showcase/gapic-showcase/pom.xml @@ -0,0 +1,393 @@ + + + 4.0.0 + com.google.cloud + gapic-showcase + 0.0.1-SNAPSHOT + jar + GAPIC Showcase Client + + GAPIC Showcase is an API that demonstrates Generated API Client (GAPIC) features and common API + patterns used by Google. + + + com.google.cloud + gapic-showcase-parent + 0.0.1-SNAPSHOT + + + + 0.36.2 + + 1.2.13 + 1.5.25 + + + + + + org.jacoco + jacoco-maven-plugin + 0.8.13 + + + report + + report + + + + XML + HTML + + + + + + + com.spotify.fmt + fmt-maven-plugin + 2.25 + + (IT.*\.java)|(.*Test.java)|(TestClientInitializer.java) + + + + com.googlecode.maven-download-plugin + download-maven-plugin + 1.6.8 + + + download-compliance-suite + generate-test-resources + + wget + + + + https://raw.githubusercontent.com/googleapis/gapic-showcase/v${gapic-showcase.version}/server/services/compliance_suite.json + + src/test/resources + + true + + + + + + + + + + io.grpc + grpc-api + + + io.grpc + grpc-stub + + + io.grpc + grpc-protobuf + + + com.google.api + api-common + + + com.google.protobuf + protobuf-java + + + com.google.api.grpc + proto-google-common-protos + + + com.google.api.grpc + grpc-google-common-protos + test + + + com.google.api.grpc + proto-google-iam-v1 + + + com.google.api.grpc + proto-gapic-showcase-v1beta1 + + + com.google.guava + guava + + + com.google.api + gax + + + com.google.api + gax-grpc + + + com.google.api + gax-httpjson + + + + + org.junit.jupiter + junit-jupiter-engine + test + + + org.junit.vintage + junit-vintage-engine + test + + + org.junit.jupiter + junit-jupiter-params + test + + + com.google.truth + truth + 1.4.4 + + + junit + junit + + + test + + + + com.google.api.grpc + grpc-gapic-showcase-v1beta1 + test + + + + com.google.api + gax + test-jar + testlib + test + + + com.google.api + gax-grpc + test-jar + testlib + test + + + com.google.api + gax-httpjson + test-jar + testlib + test + + + com.google.auth + google-auth-library-oauth2-http + test-jar + testlib + test + + + com.google.api.grpc + grpc-google-iam-v1 + test + + + + + org.tensorflow + tensorflow-core-platform + 1.1.0 + test + + + + + io.opentelemetry + opentelemetry-api + test + + + io.opentelemetry + opentelemetry-sdk + test + + + io.opentelemetry + opentelemetry-sdk-testing + test + + + + io.grpc + grpc-opentelemetry + test + + + + + + + + slf4j2_logback + + + + slf4j2_logback + + + + + org.slf4j + slf4j-api + 2.0.16 + test + + + ch.qos.logback + logback-classic + ${slf4j2-logback.version} + test + + + ch.qos.logback + logback-core + ${slf4j2-logback.version} + test + + + + + + org.apache.maven.plugins + maven-compiler-plugin + + + **/com/google/showcase/v1beta1/it/*.java + **/com/google/showcase/v1beta1/it/logging/ITLoggingDisabled.java + **/com/google/showcase/v1beta1/it/logging/ITLogging1x.java + + + + + + + + slf4j1_logback + + + + slf4j1_logback + + + + + org.slf4j + slf4j-api + 1.7.36 + test + + + ch.qos.logback + logback-classic + ${slf4j1-logback.version} + test + + + ch.qos.logback + logback-core + ${slf4j1-logback.version} + test + + + + + + org.apache.maven.plugins + maven-compiler-plugin + + + **/com/google/showcase/v1beta1/it/*.java + **/com/google/showcase/v1beta1/it/logging/ITLoggingDisabled.java + **/com/google/showcase/v1beta1/it/logging/ITLogging.java + + + + + + + + disabledLogging + + + + + disable_logging + + + + + org.slf4j + slf4j-api + 1.7.36 + test + + + ch.qos.logback + logback-classic + ${slf4j1-logback.version} + test + + + ch.qos.logback + logback-core + ${slf4j1-logback.version} + test + + + + + + org.apache.maven.plugins + maven-compiler-plugin + + + **/com/google/showcase/v1beta1/it/*.java + **/com/google/showcase/v1beta1/it/logging/ITLogging1x.java + **/com/google/showcase/v1beta1/it/logging/ITLogging.java + + + + + + + + protobuf3 + + + + org.apache.maven.plugins + maven-compiler-plugin + + + **/com/google/showcase/v1beta1/it/logging/*.java + + + **/com/google/showcase/v1beta1/it/ITProtobuf3Compatibility.java + + + + + + + + + diff --git a/java-showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/ComplianceClient.java b/java-showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/ComplianceClient.java new file mode 100644 index 0000000000..7f1d2095d6 --- /dev/null +++ b/java-showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/ComplianceClient.java @@ -0,0 +1,1595 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1; + +import com.google.api.core.ApiFuture; +import com.google.api.core.ApiFutures; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.paging.AbstractFixedSizeCollection; +import com.google.api.gax.paging.AbstractPage; +import com.google.api.gax.paging.AbstractPagedListResponse; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.common.util.concurrent.MoreExecutors; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.showcase.v1beta1.stub.ComplianceStub; +import com.google.showcase.v1beta1.stub.ComplianceStubSettings; +import java.io.IOException; +import java.util.List; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Service Description: This service is used to test that GAPICs implement various REST-related + * features correctly. This mostly means transcoding proto3 requests to REST format correctly for + * various types of HTTP annotations, but it also includes verifying that unknown (numeric) enums + * received by clients can be round-tripped correctly. + * + *

        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 (ComplianceClient complianceClient = ComplianceClient.create()) {
        + *   RepeatRequest request =
        + *       RepeatRequest.newBuilder()
        + *           .setName("name3373707")
        + *           .setInfo(ComplianceData.newBuilder().build())
        + *           .setServerVerify(true)
        + *           .setIntendedBindingUri("intendedBindingUri780142386")
        + *           .setFInt32(-1143775883)
        + *           .setFInt64(-1143775788)
        + *           .setFDouble(-1239459382)
        + *           .setPInt32(-858673665)
        + *           .setPInt64(-858673570)
        + *           .setPDouble(-991225216)
        + *           .build();
        + *   RepeatResponse response = complianceClient.repeatDataBody(request);
        + * }
        + * }
        + * + *

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

        RepeatDataBody

        This method echoes the ComplianceData request. This method exercises sending the entire request object in the REST body.

        + *

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

        + *
          + *
        • repeatDataBody(RepeatRequest request) + *

        + *

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

        + *
          + *
        • repeatDataBodyCallable() + *

        + *

        RepeatDataBodyInfo

        This method echoes the ComplianceData request. This method exercises sending the a message-type field in the REST body. Per AIP-127, only top-level, non-repeated fields can be sent this way.

        + *

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

        + *
          + *
        • repeatDataBodyInfo(RepeatRequest request) + *

        + *

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

        + *
          + *
        • repeatDataBodyInfoCallable() + *

        + *

        RepeatDataQuery

        This method echoes the ComplianceData request. This method exercises sending all request fields as query parameters.

        + *

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

        + *
          + *
        • repeatDataQuery(RepeatRequest request) + *

        + *

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

        + *
          + *
        • repeatDataQueryCallable() + *

        + *

        RepeatDataSimplePath

        This method echoes the ComplianceData request. This method exercises sending some parameters as "simple" path variables (i.e., of the form "/bar/{foo}" rather than "/{foo=bar/*}"), and the rest as query parameters.

        + *

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

        + *
          + *
        • repeatDataSimplePath(RepeatRequest request) + *

        + *

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

        + *
          + *
        • repeatDataSimplePathCallable() + *

        + *

        RepeatDataPathResource

        Same as RepeatDataSimplePath, but with a path resource.

        + *

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

        + *
          + *
        • repeatDataPathResource(RepeatRequest request) + *

        + *

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

        + *
          + *
        • repeatDataPathResourceCallable() + *

        + *

        RepeatDataPathTrailingResource

        Same as RepeatDataSimplePath, but with a trailing resource.

        + *

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

        + *
          + *
        • repeatDataPathTrailingResource(RepeatRequest request) + *

        + *

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

        + *
          + *
        • repeatDataPathTrailingResourceCallable() + *

        + *

        RepeatDataBodyPut

        This method echoes the ComplianceData request, using the HTTP PUT method.

        + *

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

        + *
          + *
        • repeatDataBodyPut(RepeatRequest request) + *

        + *

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

        + *
          + *
        • repeatDataBodyPutCallable() + *

        + *

        RepeatDataBodyPatch

        This method echoes the ComplianceData request, using the HTTP PATCH method.

        + *

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

        + *
          + *
        • repeatDataBodyPatch(RepeatRequest request) + *

        + *

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

        + *
          + *
        • repeatDataBodyPatchCallable() + *

        + *

        GetEnum

        This method requests an enum value from the server. Depending on the contents of EnumRequest, the enum value returned will be a known enum declared in the .proto file, or a made-up enum value the is unknown to the client. To verify that clients can round-trip unknown enum values they receive, use the response from this RPC as the request to VerifyEnum() + *

        The values of enums sent by the server when a known or unknown value is requested will be the same within a single Showcase server run (this is needed for VerifyEnum() to work) but are not guaranteed to be the same across separate Showcase server runs.

        + *

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

        + *
          + *
        • getEnum(EnumRequest request) + *

        + *

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

        + *
          + *
        • getEnumCallable() + *

        + *

        VerifyEnum

        This method is used to verify that clients can round-trip enum values, which is particularly important for unknown enum values over REST. VerifyEnum() verifies that its request, which is presumably the response that the client previously got to a GetEnum(), contains the correct data. If so, it responds with the same EnumResponse; otherwise, the RPC errors. + *

        This works because the values of enums sent by the server when a known or unknown value is requested will be the same within a single Showcase server run, although they are not guaranteed to be the same across separate Showcase server runs.

        + *

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

        + *
          + *
        • verifyEnum(EnumResponse request) + *

        + *

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

        + *
          + *
        • verifyEnumCallable() + *

        + *

        ListLocations

        Lists information about the supported locations for this service.

        + *

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

        + *
          + *
        • listLocations(ListLocationsRequest request) + *

        + *

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

        + *
          + *
        • listLocationsPagedCallable() + *

        • listLocationsCallable() + *

        + *

        GetLocation

        Gets information about a location.

        + *

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

        + *
          + *
        • getLocation(GetLocationRequest request) + *

        + *

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

        + *
          + *
        • getLocationCallable() + *

        + *

        SetIamPolicy

        Sets the access control policy on the specified resource. Replaces any existing policy. + *

        Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED` errors.

        + *

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

        + *
          + *
        • setIamPolicy(SetIamPolicyRequest request) + *

        + *

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

        + *
          + *
        • setIamPolicyCallable() + *

        + *

        GetIamPolicy

        Gets the access control policy for a resource. Returns an empty policy if the resource exists and does not have a policy set.

        + *

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

        + *
          + *
        • getIamPolicy(GetIamPolicyRequest request) + *

        + *

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

        + *
          + *
        • getIamPolicyCallable() + *

        + *

        TestIamPermissions

        Returns permissions that a caller has on the specified resource. If the resource does not exist, this will return an empty set of permissions, not a `NOT_FOUND` error. + *

        Note: This operation is designed to be used for building permission-aware UIs and command-line tools, not for authorization checking. This operation may "fail open" without warning.

        + *

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

        + *
          + *
        • testIamPermissions(TestIamPermissionsRequest request) + *

        + *

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

        + *
          + *
        • testIamPermissionsCallable() + *

        + *
        + * + *

        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 ComplianceSettings 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
        + * ComplianceSettings complianceSettings =
        + *     ComplianceSettings.newBuilder()
        + *         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
        + *         .build();
        + * ComplianceClient complianceClient = ComplianceClient.create(complianceSettings);
        + * }
        + * + *

        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
        + * ComplianceSettings complianceSettings =
        + *     ComplianceSettings.newBuilder().setEndpoint(myEndpoint).build();
        + * ComplianceClient complianceClient = ComplianceClient.create(complianceSettings);
        + * }
        + * + *

        To use REST (HTTP1.1/JSON) transport (instead of gRPC) for sending and receiving requests over + * the wire: + * + *

        {@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
        + * ComplianceSettings complianceSettings = ComplianceSettings.newHttpJsonBuilder().build();
        + * ComplianceClient complianceClient = ComplianceClient.create(complianceSettings);
        + * }
        + * + *

        Please refer to the GitHub repository's samples for more quickstart code snippets. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class ComplianceClient implements BackgroundResource { + private final ComplianceSettings settings; + private final ComplianceStub stub; + + /** Constructs an instance of ComplianceClient with default settings. */ + public static final ComplianceClient create() throws IOException { + return create(ComplianceSettings.newBuilder().build()); + } + + /** + * Constructs an instance of ComplianceClient, 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 ComplianceClient create(ComplianceSettings settings) throws IOException { + return new ComplianceClient(settings); + } + + /** + * Constructs an instance of ComplianceClient, using the given stub for making calls. This is for + * advanced usage - prefer using create(ComplianceSettings). + */ + public static final ComplianceClient create(ComplianceStub stub) { + return new ComplianceClient(stub); + } + + /** + * Constructs an instance of ComplianceClient, 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 ComplianceClient(ComplianceSettings settings) throws IOException { + this.settings = settings; + this.stub = ((ComplianceStubSettings) settings.getStubSettings()).createStub(); + } + + protected ComplianceClient(ComplianceStub stub) { + this.settings = null; + this.stub = stub; + } + + public final ComplianceSettings getSettings() { + return settings; + } + + public ComplianceStub getStub() { + return stub; + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * This method echoes the ComplianceData request. This method exercises sending the entire request + * object in the REST body. + * + *

        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 (ComplianceClient complianceClient = ComplianceClient.create()) {
        +   *   RepeatRequest request =
        +   *       RepeatRequest.newBuilder()
        +   *           .setName("name3373707")
        +   *           .setInfo(ComplianceData.newBuilder().build())
        +   *           .setServerVerify(true)
        +   *           .setIntendedBindingUri("intendedBindingUri780142386")
        +   *           .setFInt32(-1143775883)
        +   *           .setFInt64(-1143775788)
        +   *           .setFDouble(-1239459382)
        +   *           .setPInt32(-858673665)
        +   *           .setPInt64(-858673570)
        +   *           .setPDouble(-991225216)
        +   *           .build();
        +   *   RepeatResponse response = complianceClient.repeatDataBody(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 RepeatResponse repeatDataBody(RepeatRequest request) { + return repeatDataBodyCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * This method echoes the ComplianceData request. This method exercises sending the entire request + * object in the REST body. + * + *

        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 (ComplianceClient complianceClient = ComplianceClient.create()) {
        +   *   RepeatRequest request =
        +   *       RepeatRequest.newBuilder()
        +   *           .setName("name3373707")
        +   *           .setInfo(ComplianceData.newBuilder().build())
        +   *           .setServerVerify(true)
        +   *           .setIntendedBindingUri("intendedBindingUri780142386")
        +   *           .setFInt32(-1143775883)
        +   *           .setFInt64(-1143775788)
        +   *           .setFDouble(-1239459382)
        +   *           .setPInt32(-858673665)
        +   *           .setPInt64(-858673570)
        +   *           .setPDouble(-991225216)
        +   *           .build();
        +   *   ApiFuture future =
        +   *       complianceClient.repeatDataBodyCallable().futureCall(request);
        +   *   // Do something.
        +   *   RepeatResponse response = future.get();
        +   * }
        +   * }
        + */ + public final UnaryCallable repeatDataBodyCallable() { + return stub.repeatDataBodyCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * This method echoes the ComplianceData request. This method exercises sending the a message-type + * field in the REST body. Per AIP-127, only top-level, non-repeated fields can be sent this way. + * + *

        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 (ComplianceClient complianceClient = ComplianceClient.create()) {
        +   *   RepeatRequest request =
        +   *       RepeatRequest.newBuilder()
        +   *           .setName("name3373707")
        +   *           .setInfo(ComplianceData.newBuilder().build())
        +   *           .setServerVerify(true)
        +   *           .setIntendedBindingUri("intendedBindingUri780142386")
        +   *           .setFInt32(-1143775883)
        +   *           .setFInt64(-1143775788)
        +   *           .setFDouble(-1239459382)
        +   *           .setPInt32(-858673665)
        +   *           .setPInt64(-858673570)
        +   *           .setPDouble(-991225216)
        +   *           .build();
        +   *   RepeatResponse response = complianceClient.repeatDataBodyInfo(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 RepeatResponse repeatDataBodyInfo(RepeatRequest request) { + return repeatDataBodyInfoCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * This method echoes the ComplianceData request. This method exercises sending the a message-type + * field in the REST body. Per AIP-127, only top-level, non-repeated fields can be sent this way. + * + *

        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 (ComplianceClient complianceClient = ComplianceClient.create()) {
        +   *   RepeatRequest request =
        +   *       RepeatRequest.newBuilder()
        +   *           .setName("name3373707")
        +   *           .setInfo(ComplianceData.newBuilder().build())
        +   *           .setServerVerify(true)
        +   *           .setIntendedBindingUri("intendedBindingUri780142386")
        +   *           .setFInt32(-1143775883)
        +   *           .setFInt64(-1143775788)
        +   *           .setFDouble(-1239459382)
        +   *           .setPInt32(-858673665)
        +   *           .setPInt64(-858673570)
        +   *           .setPDouble(-991225216)
        +   *           .build();
        +   *   ApiFuture future =
        +   *       complianceClient.repeatDataBodyInfoCallable().futureCall(request);
        +   *   // Do something.
        +   *   RepeatResponse response = future.get();
        +   * }
        +   * }
        + */ + public final UnaryCallable repeatDataBodyInfoCallable() { + return stub.repeatDataBodyInfoCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * This method echoes the ComplianceData request. This method exercises sending all request fields + * as query parameters. + * + *

        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 (ComplianceClient complianceClient = ComplianceClient.create()) {
        +   *   RepeatRequest request =
        +   *       RepeatRequest.newBuilder()
        +   *           .setName("name3373707")
        +   *           .setInfo(ComplianceData.newBuilder().build())
        +   *           .setServerVerify(true)
        +   *           .setIntendedBindingUri("intendedBindingUri780142386")
        +   *           .setFInt32(-1143775883)
        +   *           .setFInt64(-1143775788)
        +   *           .setFDouble(-1239459382)
        +   *           .setPInt32(-858673665)
        +   *           .setPInt64(-858673570)
        +   *           .setPDouble(-991225216)
        +   *           .build();
        +   *   RepeatResponse response = complianceClient.repeatDataQuery(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 RepeatResponse repeatDataQuery(RepeatRequest request) { + return repeatDataQueryCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * This method echoes the ComplianceData request. This method exercises sending all request fields + * as query parameters. + * + *

        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 (ComplianceClient complianceClient = ComplianceClient.create()) {
        +   *   RepeatRequest request =
        +   *       RepeatRequest.newBuilder()
        +   *           .setName("name3373707")
        +   *           .setInfo(ComplianceData.newBuilder().build())
        +   *           .setServerVerify(true)
        +   *           .setIntendedBindingUri("intendedBindingUri780142386")
        +   *           .setFInt32(-1143775883)
        +   *           .setFInt64(-1143775788)
        +   *           .setFDouble(-1239459382)
        +   *           .setPInt32(-858673665)
        +   *           .setPInt64(-858673570)
        +   *           .setPDouble(-991225216)
        +   *           .build();
        +   *   ApiFuture future =
        +   *       complianceClient.repeatDataQueryCallable().futureCall(request);
        +   *   // Do something.
        +   *   RepeatResponse response = future.get();
        +   * }
        +   * }
        + */ + public final UnaryCallable repeatDataQueryCallable() { + return stub.repeatDataQueryCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * This method echoes the ComplianceData request. This method exercises sending some parameters as + * "simple" path variables (i.e., of the form "/bar/{foo}" rather than "/{foo=bar/*}"), and + * the rest as query parameters. + * + *

        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 (ComplianceClient complianceClient = ComplianceClient.create()) {
        +   *   RepeatRequest request =
        +   *       RepeatRequest.newBuilder()
        +   *           .setName("name3373707")
        +   *           .setInfo(ComplianceData.newBuilder().build())
        +   *           .setServerVerify(true)
        +   *           .setIntendedBindingUri("intendedBindingUri780142386")
        +   *           .setFInt32(-1143775883)
        +   *           .setFInt64(-1143775788)
        +   *           .setFDouble(-1239459382)
        +   *           .setPInt32(-858673665)
        +   *           .setPInt64(-858673570)
        +   *           .setPDouble(-991225216)
        +   *           .build();
        +   *   RepeatResponse response = complianceClient.repeatDataSimplePath(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 RepeatResponse repeatDataSimplePath(RepeatRequest request) { + return repeatDataSimplePathCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * This method echoes the ComplianceData request. This method exercises sending some parameters as + * "simple" path variables (i.e., of the form "/bar/{foo}" rather than "/{foo=bar/*}"), and + * the rest as query parameters. + * + *

        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 (ComplianceClient complianceClient = ComplianceClient.create()) {
        +   *   RepeatRequest request =
        +   *       RepeatRequest.newBuilder()
        +   *           .setName("name3373707")
        +   *           .setInfo(ComplianceData.newBuilder().build())
        +   *           .setServerVerify(true)
        +   *           .setIntendedBindingUri("intendedBindingUri780142386")
        +   *           .setFInt32(-1143775883)
        +   *           .setFInt64(-1143775788)
        +   *           .setFDouble(-1239459382)
        +   *           .setPInt32(-858673665)
        +   *           .setPInt64(-858673570)
        +   *           .setPDouble(-991225216)
        +   *           .build();
        +   *   ApiFuture future =
        +   *       complianceClient.repeatDataSimplePathCallable().futureCall(request);
        +   *   // Do something.
        +   *   RepeatResponse response = future.get();
        +   * }
        +   * }
        + */ + public final UnaryCallable repeatDataSimplePathCallable() { + return stub.repeatDataSimplePathCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Same as RepeatDataSimplePath, but with a path 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 (ComplianceClient complianceClient = ComplianceClient.create()) {
        +   *   RepeatRequest request =
        +   *       RepeatRequest.newBuilder()
        +   *           .setName("name3373707")
        +   *           .setInfo(ComplianceData.newBuilder().build())
        +   *           .setServerVerify(true)
        +   *           .setIntendedBindingUri("intendedBindingUri780142386")
        +   *           .setFInt32(-1143775883)
        +   *           .setFInt64(-1143775788)
        +   *           .setFDouble(-1239459382)
        +   *           .setPInt32(-858673665)
        +   *           .setPInt64(-858673570)
        +   *           .setPDouble(-991225216)
        +   *           .build();
        +   *   RepeatResponse response = complianceClient.repeatDataPathResource(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 RepeatResponse repeatDataPathResource(RepeatRequest request) { + return repeatDataPathResourceCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Same as RepeatDataSimplePath, but with a path 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 (ComplianceClient complianceClient = ComplianceClient.create()) {
        +   *   RepeatRequest request =
        +   *       RepeatRequest.newBuilder()
        +   *           .setName("name3373707")
        +   *           .setInfo(ComplianceData.newBuilder().build())
        +   *           .setServerVerify(true)
        +   *           .setIntendedBindingUri("intendedBindingUri780142386")
        +   *           .setFInt32(-1143775883)
        +   *           .setFInt64(-1143775788)
        +   *           .setFDouble(-1239459382)
        +   *           .setPInt32(-858673665)
        +   *           .setPInt64(-858673570)
        +   *           .setPDouble(-991225216)
        +   *           .build();
        +   *   ApiFuture future =
        +   *       complianceClient.repeatDataPathResourceCallable().futureCall(request);
        +   *   // Do something.
        +   *   RepeatResponse response = future.get();
        +   * }
        +   * }
        + */ + public final UnaryCallable repeatDataPathResourceCallable() { + return stub.repeatDataPathResourceCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Same as RepeatDataSimplePath, but with a trailing 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 (ComplianceClient complianceClient = ComplianceClient.create()) {
        +   *   RepeatRequest request =
        +   *       RepeatRequest.newBuilder()
        +   *           .setName("name3373707")
        +   *           .setInfo(ComplianceData.newBuilder().build())
        +   *           .setServerVerify(true)
        +   *           .setIntendedBindingUri("intendedBindingUri780142386")
        +   *           .setFInt32(-1143775883)
        +   *           .setFInt64(-1143775788)
        +   *           .setFDouble(-1239459382)
        +   *           .setPInt32(-858673665)
        +   *           .setPInt64(-858673570)
        +   *           .setPDouble(-991225216)
        +   *           .build();
        +   *   RepeatResponse response = complianceClient.repeatDataPathTrailingResource(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 RepeatResponse repeatDataPathTrailingResource(RepeatRequest request) { + return repeatDataPathTrailingResourceCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Same as RepeatDataSimplePath, but with a trailing 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 (ComplianceClient complianceClient = ComplianceClient.create()) {
        +   *   RepeatRequest request =
        +   *       RepeatRequest.newBuilder()
        +   *           .setName("name3373707")
        +   *           .setInfo(ComplianceData.newBuilder().build())
        +   *           .setServerVerify(true)
        +   *           .setIntendedBindingUri("intendedBindingUri780142386")
        +   *           .setFInt32(-1143775883)
        +   *           .setFInt64(-1143775788)
        +   *           .setFDouble(-1239459382)
        +   *           .setPInt32(-858673665)
        +   *           .setPInt64(-858673570)
        +   *           .setPDouble(-991225216)
        +   *           .build();
        +   *   ApiFuture future =
        +   *       complianceClient.repeatDataPathTrailingResourceCallable().futureCall(request);
        +   *   // Do something.
        +   *   RepeatResponse response = future.get();
        +   * }
        +   * }
        + */ + public final UnaryCallable + repeatDataPathTrailingResourceCallable() { + return stub.repeatDataPathTrailingResourceCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * This method echoes the ComplianceData request, using the HTTP PUT method. + * + *

        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 (ComplianceClient complianceClient = ComplianceClient.create()) {
        +   *   RepeatRequest request =
        +   *       RepeatRequest.newBuilder()
        +   *           .setName("name3373707")
        +   *           .setInfo(ComplianceData.newBuilder().build())
        +   *           .setServerVerify(true)
        +   *           .setIntendedBindingUri("intendedBindingUri780142386")
        +   *           .setFInt32(-1143775883)
        +   *           .setFInt64(-1143775788)
        +   *           .setFDouble(-1239459382)
        +   *           .setPInt32(-858673665)
        +   *           .setPInt64(-858673570)
        +   *           .setPDouble(-991225216)
        +   *           .build();
        +   *   RepeatResponse response = complianceClient.repeatDataBodyPut(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 RepeatResponse repeatDataBodyPut(RepeatRequest request) { + return repeatDataBodyPutCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * This method echoes the ComplianceData request, using the HTTP PUT method. + * + *

        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 (ComplianceClient complianceClient = ComplianceClient.create()) {
        +   *   RepeatRequest request =
        +   *       RepeatRequest.newBuilder()
        +   *           .setName("name3373707")
        +   *           .setInfo(ComplianceData.newBuilder().build())
        +   *           .setServerVerify(true)
        +   *           .setIntendedBindingUri("intendedBindingUri780142386")
        +   *           .setFInt32(-1143775883)
        +   *           .setFInt64(-1143775788)
        +   *           .setFDouble(-1239459382)
        +   *           .setPInt32(-858673665)
        +   *           .setPInt64(-858673570)
        +   *           .setPDouble(-991225216)
        +   *           .build();
        +   *   ApiFuture future =
        +   *       complianceClient.repeatDataBodyPutCallable().futureCall(request);
        +   *   // Do something.
        +   *   RepeatResponse response = future.get();
        +   * }
        +   * }
        + */ + public final UnaryCallable repeatDataBodyPutCallable() { + return stub.repeatDataBodyPutCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * This method echoes the ComplianceData request, using the HTTP PATCH method. + * + *

        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 (ComplianceClient complianceClient = ComplianceClient.create()) {
        +   *   RepeatRequest request =
        +   *       RepeatRequest.newBuilder()
        +   *           .setName("name3373707")
        +   *           .setInfo(ComplianceData.newBuilder().build())
        +   *           .setServerVerify(true)
        +   *           .setIntendedBindingUri("intendedBindingUri780142386")
        +   *           .setFInt32(-1143775883)
        +   *           .setFInt64(-1143775788)
        +   *           .setFDouble(-1239459382)
        +   *           .setPInt32(-858673665)
        +   *           .setPInt64(-858673570)
        +   *           .setPDouble(-991225216)
        +   *           .build();
        +   *   RepeatResponse response = complianceClient.repeatDataBodyPatch(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 RepeatResponse repeatDataBodyPatch(RepeatRequest request) { + return repeatDataBodyPatchCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * This method echoes the ComplianceData request, using the HTTP PATCH method. + * + *

        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 (ComplianceClient complianceClient = ComplianceClient.create()) {
        +   *   RepeatRequest request =
        +   *       RepeatRequest.newBuilder()
        +   *           .setName("name3373707")
        +   *           .setInfo(ComplianceData.newBuilder().build())
        +   *           .setServerVerify(true)
        +   *           .setIntendedBindingUri("intendedBindingUri780142386")
        +   *           .setFInt32(-1143775883)
        +   *           .setFInt64(-1143775788)
        +   *           .setFDouble(-1239459382)
        +   *           .setPInt32(-858673665)
        +   *           .setPInt64(-858673570)
        +   *           .setPDouble(-991225216)
        +   *           .build();
        +   *   ApiFuture future =
        +   *       complianceClient.repeatDataBodyPatchCallable().futureCall(request);
        +   *   // Do something.
        +   *   RepeatResponse response = future.get();
        +   * }
        +   * }
        + */ + public final UnaryCallable repeatDataBodyPatchCallable() { + return stub.repeatDataBodyPatchCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * This method requests an enum value from the server. Depending on the contents of EnumRequest, + * the enum value returned will be a known enum declared in the .proto file, or a made-up enum + * value the is unknown to the client. To verify that clients can round-trip unknown enum values + * they receive, use the response from this RPC as the request to VerifyEnum() + * + *

        The values of enums sent by the server when a known or unknown value is requested will be + * the same within a single Showcase server run (this is needed for VerifyEnum() to work) but are + * not guaranteed to be the same across separate Showcase server runs. + * + *

        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 (ComplianceClient complianceClient = ComplianceClient.create()) {
        +   *   EnumRequest request = EnumRequest.newBuilder().setUnknownEnum(true).build();
        +   *   EnumResponse response = complianceClient.getEnum(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 EnumResponse getEnum(EnumRequest request) { + return getEnumCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * This method requests an enum value from the server. Depending on the contents of EnumRequest, + * the enum value returned will be a known enum declared in the .proto file, or a made-up enum + * value the is unknown to the client. To verify that clients can round-trip unknown enum values + * they receive, use the response from this RPC as the request to VerifyEnum() + * + *

        The values of enums sent by the server when a known or unknown value is requested will be + * the same within a single Showcase server run (this is needed for VerifyEnum() to work) but are + * not guaranteed to be the same across separate Showcase server runs. + * + *

        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 (ComplianceClient complianceClient = ComplianceClient.create()) {
        +   *   EnumRequest request = EnumRequest.newBuilder().setUnknownEnum(true).build();
        +   *   ApiFuture future = complianceClient.getEnumCallable().futureCall(request);
        +   *   // Do something.
        +   *   EnumResponse response = future.get();
        +   * }
        +   * }
        + */ + public final UnaryCallable getEnumCallable() { + return stub.getEnumCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * This method is used to verify that clients can round-trip enum values, which is particularly + * important for unknown enum values over REST. VerifyEnum() verifies that its request, which is + * presumably the response that the client previously got to a GetEnum(), contains the correct + * data. If so, it responds with the same EnumResponse; otherwise, the RPC errors. + * + *

        This works because the values of enums sent by the server when a known or unknown value is + * requested will be the same within a single Showcase server run, although they are not + * guaranteed to be the same across separate Showcase server runs. + * + *

        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 (ComplianceClient complianceClient = ComplianceClient.create()) {
        +   *   EnumResponse request =
        +   *       EnumResponse.newBuilder()
        +   *           .setRequest(EnumRequest.newBuilder().build())
        +   *           .setContinent(Continent.forNumber(0))
        +   *           .build();
        +   *   EnumResponse response = complianceClient.verifyEnum(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 EnumResponse verifyEnum(EnumResponse request) { + return verifyEnumCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * This method is used to verify that clients can round-trip enum values, which is particularly + * important for unknown enum values over REST. VerifyEnum() verifies that its request, which is + * presumably the response that the client previously got to a GetEnum(), contains the correct + * data. If so, it responds with the same EnumResponse; otherwise, the RPC errors. + * + *

        This works because the values of enums sent by the server when a known or unknown value is + * requested will be the same within a single Showcase server run, although they are not + * guaranteed to be the same across separate Showcase server runs. + * + *

        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 (ComplianceClient complianceClient = ComplianceClient.create()) {
        +   *   EnumResponse request =
        +   *       EnumResponse.newBuilder()
        +   *           .setRequest(EnumRequest.newBuilder().build())
        +   *           .setContinent(Continent.forNumber(0))
        +   *           .build();
        +   *   ApiFuture future = complianceClient.verifyEnumCallable().futureCall(request);
        +   *   // Do something.
        +   *   EnumResponse response = future.get();
        +   * }
        +   * }
        + */ + public final UnaryCallable verifyEnumCallable() { + return stub.verifyEnumCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists information about the supported locations for this service. + * + *

        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 (ComplianceClient complianceClient = ComplianceClient.create()) {
        +   *   ListLocationsRequest request =
        +   *       ListLocationsRequest.newBuilder()
        +   *           .setName("name3373707")
        +   *           .setFilter("filter-1274492040")
        +   *           .setPageSize(883849137)
        +   *           .setPageToken("pageToken873572522")
        +   *           .build();
        +   *   for (Location element : complianceClient.listLocations(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 ListLocationsPagedResponse listLocations(ListLocationsRequest request) { + return listLocationsPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists information about the supported locations for this service. + * + *

        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 (ComplianceClient complianceClient = ComplianceClient.create()) {
        +   *   ListLocationsRequest request =
        +   *       ListLocationsRequest.newBuilder()
        +   *           .setName("name3373707")
        +   *           .setFilter("filter-1274492040")
        +   *           .setPageSize(883849137)
        +   *           .setPageToken("pageToken873572522")
        +   *           .build();
        +   *   ApiFuture future =
        +   *       complianceClient.listLocationsPagedCallable().futureCall(request);
        +   *   // Do something.
        +   *   for (Location element : future.get().iterateAll()) {
        +   *     // doThingsWith(element);
        +   *   }
        +   * }
        +   * }
        + */ + public final UnaryCallable + listLocationsPagedCallable() { + return stub.listLocationsPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists information about the supported locations for this service. + * + *

        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 (ComplianceClient complianceClient = ComplianceClient.create()) {
        +   *   ListLocationsRequest request =
        +   *       ListLocationsRequest.newBuilder()
        +   *           .setName("name3373707")
        +   *           .setFilter("filter-1274492040")
        +   *           .setPageSize(883849137)
        +   *           .setPageToken("pageToken873572522")
        +   *           .build();
        +   *   while (true) {
        +   *     ListLocationsResponse response = complianceClient.listLocationsCallable().call(request);
        +   *     for (Location element : response.getLocationsList()) {
        +   *       // doThingsWith(element);
        +   *     }
        +   *     String nextPageToken = response.getNextPageToken();
        +   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
        +   *       request = request.toBuilder().setPageToken(nextPageToken).build();
        +   *     } else {
        +   *       break;
        +   *     }
        +   *   }
        +   * }
        +   * }
        + */ + public final UnaryCallable listLocationsCallable() { + return stub.listLocationsCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets information about a location. + * + *

        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 (ComplianceClient complianceClient = ComplianceClient.create()) {
        +   *   GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build();
        +   *   Location response = complianceClient.getLocation(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 Location getLocation(GetLocationRequest request) { + return getLocationCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets information about a location. + * + *

        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 (ComplianceClient complianceClient = ComplianceClient.create()) {
        +   *   GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build();
        +   *   ApiFuture future = complianceClient.getLocationCallable().futureCall(request);
        +   *   // Do something.
        +   *   Location response = future.get();
        +   * }
        +   * }
        + */ + public final UnaryCallable getLocationCallable() { + return stub.getLocationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Sets the access control policy on the specified resource. Replaces any existing policy. + * + *

        Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED` errors. + * + *

        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 (ComplianceClient complianceClient = ComplianceClient.create()) {
        +   *   SetIamPolicyRequest request =
        +   *       SetIamPolicyRequest.newBuilder()
        +   *           .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString())
        +   *           .setPolicy(Policy.newBuilder().build())
        +   *           .setUpdateMask(FieldMask.newBuilder().build())
        +   *           .build();
        +   *   Policy response = complianceClient.setIamPolicy(request);
        +   * }
        +   * }
        + * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Policy setIamPolicy(SetIamPolicyRequest request) { + return setIamPolicyCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Sets the access control policy on the specified resource. Replaces any existing policy. + * + *

        Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED` errors. + * + *

        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 (ComplianceClient complianceClient = ComplianceClient.create()) {
        +   *   SetIamPolicyRequest request =
        +   *       SetIamPolicyRequest.newBuilder()
        +   *           .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString())
        +   *           .setPolicy(Policy.newBuilder().build())
        +   *           .setUpdateMask(FieldMask.newBuilder().build())
        +   *           .build();
        +   *   ApiFuture future = complianceClient.setIamPolicyCallable().futureCall(request);
        +   *   // Do something.
        +   *   Policy response = future.get();
        +   * }
        +   * }
        + */ + public final UnaryCallable setIamPolicyCallable() { + return stub.setIamPolicyCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets the access control policy for a resource. Returns an empty policy if the resource exists + * and does not have a policy set. + * + *

        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 (ComplianceClient complianceClient = ComplianceClient.create()) {
        +   *   GetIamPolicyRequest request =
        +   *       GetIamPolicyRequest.newBuilder()
        +   *           .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString())
        +   *           .setOptions(GetPolicyOptions.newBuilder().build())
        +   *           .build();
        +   *   Policy response = complianceClient.getIamPolicy(request);
        +   * }
        +   * }
        + * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Policy getIamPolicy(GetIamPolicyRequest request) { + return getIamPolicyCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets the access control policy for a resource. Returns an empty policy if the resource exists + * and does not have a policy set. + * + *

        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 (ComplianceClient complianceClient = ComplianceClient.create()) {
        +   *   GetIamPolicyRequest request =
        +   *       GetIamPolicyRequest.newBuilder()
        +   *           .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString())
        +   *           .setOptions(GetPolicyOptions.newBuilder().build())
        +   *           .build();
        +   *   ApiFuture future = complianceClient.getIamPolicyCallable().futureCall(request);
        +   *   // Do something.
        +   *   Policy response = future.get();
        +   * }
        +   * }
        + */ + public final UnaryCallable getIamPolicyCallable() { + return stub.getIamPolicyCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Returns permissions that a caller has on the specified resource. If the resource does not + * exist, this will return an empty set of permissions, not a `NOT_FOUND` error. + * + *

        Note: This operation is designed to be used for building permission-aware UIs and + * command-line tools, not for authorization checking. This operation may "fail open" without + * warning. + * + *

        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 (ComplianceClient complianceClient = ComplianceClient.create()) {
        +   *   TestIamPermissionsRequest request =
        +   *       TestIamPermissionsRequest.newBuilder()
        +   *           .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString())
        +   *           .addAllPermissions(new ArrayList())
        +   *           .build();
        +   *   TestIamPermissionsResponse response = complianceClient.testIamPermissions(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 TestIamPermissionsResponse testIamPermissions(TestIamPermissionsRequest request) { + return testIamPermissionsCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Returns permissions that a caller has on the specified resource. If the resource does not + * exist, this will return an empty set of permissions, not a `NOT_FOUND` error. + * + *

        Note: This operation is designed to be used for building permission-aware UIs and + * command-line tools, not for authorization checking. This operation may "fail open" without + * warning. + * + *

        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 (ComplianceClient complianceClient = ComplianceClient.create()) {
        +   *   TestIamPermissionsRequest request =
        +   *       TestIamPermissionsRequest.newBuilder()
        +   *           .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString())
        +   *           .addAllPermissions(new ArrayList())
        +   *           .build();
        +   *   ApiFuture future =
        +   *       complianceClient.testIamPermissionsCallable().futureCall(request);
        +   *   // Do something.
        +   *   TestIamPermissionsResponse response = future.get();
        +   * }
        +   * }
        + */ + public final UnaryCallable + testIamPermissionsCallable() { + return stub.testIamPermissionsCallable(); + } + + @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 ListLocationsPagedResponse + extends AbstractPagedListResponse< + ListLocationsRequest, + ListLocationsResponse, + Location, + ListLocationsPage, + ListLocationsFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListLocationsPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + input -> new ListLocationsPagedResponse(input), + MoreExecutors.directExecutor()); + } + + private ListLocationsPagedResponse(ListLocationsPage page) { + super(page, ListLocationsFixedSizeCollection.createEmptyCollection()); + } + } + + public static class ListLocationsPage + extends AbstractPage< + ListLocationsRequest, ListLocationsResponse, Location, ListLocationsPage> { + + private ListLocationsPage( + PageContext context, + ListLocationsResponse response) { + super(context, response); + } + + private static ListLocationsPage createEmptyPage() { + return new ListLocationsPage(null, null); + } + + @Override + protected ListLocationsPage createPage( + PageContext context, + ListLocationsResponse response) { + return new ListLocationsPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class ListLocationsFixedSizeCollection + extends AbstractFixedSizeCollection< + ListLocationsRequest, + ListLocationsResponse, + Location, + ListLocationsPage, + ListLocationsFixedSizeCollection> { + + private ListLocationsFixedSizeCollection(List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListLocationsFixedSizeCollection createEmptyCollection() { + return new ListLocationsFixedSizeCollection(null, 0); + } + + @Override + protected ListLocationsFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListLocationsFixedSizeCollection(pages, collectionSize); + } + } +} diff --git a/java-showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/ComplianceSettings.java b/java-showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/ComplianceSettings.java new file mode 100644 index 0000000000..27c7f1a833 --- /dev/null +++ b/java-showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/ComplianceSettings.java @@ -0,0 +1,373 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1; + +import static com.google.showcase.v1beta1.ComplianceClient.ListLocationsPagedResponse; + +import com.google.api.core.ApiFunction; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; +import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; +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.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.showcase.v1beta1.stub.ComplianceStubSettings; +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 ComplianceClient}. + * + *

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

          + *
        • The default service address (localhost) and default port (7469) 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 repeatDataBody: + * + *

        {@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
        + * ComplianceSettings.Builder complianceSettingsBuilder = ComplianceSettings.newBuilder();
        + * complianceSettingsBuilder
        + *     .repeatDataBodySettings()
        + *     .setRetrySettings(
        + *         complianceSettingsBuilder
        + *             .repeatDataBodySettings()
        + *             .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());
        + * ComplianceSettings complianceSettings = complianceSettingsBuilder.build();
        + * }
        + * + * Please refer to the [Client Side Retry + * Guide](https://docs.cloud.google.com/java/docs/client-retries) for additional support in setting + * retries. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class ComplianceSettings extends ClientSettings { + + /** Returns the object with the settings used for calls to repeatDataBody. */ + public UnaryCallSettings repeatDataBodySettings() { + return ((ComplianceStubSettings) getStubSettings()).repeatDataBodySettings(); + } + + /** Returns the object with the settings used for calls to repeatDataBodyInfo. */ + public UnaryCallSettings repeatDataBodyInfoSettings() { + return ((ComplianceStubSettings) getStubSettings()).repeatDataBodyInfoSettings(); + } + + /** Returns the object with the settings used for calls to repeatDataQuery. */ + public UnaryCallSettings repeatDataQuerySettings() { + return ((ComplianceStubSettings) getStubSettings()).repeatDataQuerySettings(); + } + + /** Returns the object with the settings used for calls to repeatDataSimplePath. */ + public UnaryCallSettings repeatDataSimplePathSettings() { + return ((ComplianceStubSettings) getStubSettings()).repeatDataSimplePathSettings(); + } + + /** Returns the object with the settings used for calls to repeatDataPathResource. */ + public UnaryCallSettings repeatDataPathResourceSettings() { + return ((ComplianceStubSettings) getStubSettings()).repeatDataPathResourceSettings(); + } + + /** Returns the object with the settings used for calls to repeatDataPathTrailingResource. */ + public UnaryCallSettings repeatDataPathTrailingResourceSettings() { + return ((ComplianceStubSettings) getStubSettings()).repeatDataPathTrailingResourceSettings(); + } + + /** Returns the object with the settings used for calls to repeatDataBodyPut. */ + public UnaryCallSettings repeatDataBodyPutSettings() { + return ((ComplianceStubSettings) getStubSettings()).repeatDataBodyPutSettings(); + } + + /** Returns the object with the settings used for calls to repeatDataBodyPatch. */ + public UnaryCallSettings repeatDataBodyPatchSettings() { + return ((ComplianceStubSettings) getStubSettings()).repeatDataBodyPatchSettings(); + } + + /** Returns the object with the settings used for calls to getEnum. */ + public UnaryCallSettings getEnumSettings() { + return ((ComplianceStubSettings) getStubSettings()).getEnumSettings(); + } + + /** Returns the object with the settings used for calls to verifyEnum. */ + public UnaryCallSettings verifyEnumSettings() { + return ((ComplianceStubSettings) getStubSettings()).verifyEnumSettings(); + } + + /** Returns the object with the settings used for calls to listLocations. */ + public PagedCallSettings + listLocationsSettings() { + return ((ComplianceStubSettings) getStubSettings()).listLocationsSettings(); + } + + /** Returns the object with the settings used for calls to getLocation. */ + public UnaryCallSettings getLocationSettings() { + return ((ComplianceStubSettings) getStubSettings()).getLocationSettings(); + } + + /** Returns the object with the settings used for calls to setIamPolicy. */ + public UnaryCallSettings setIamPolicySettings() { + return ((ComplianceStubSettings) getStubSettings()).setIamPolicySettings(); + } + + /** Returns the object with the settings used for calls to getIamPolicy. */ + public UnaryCallSettings getIamPolicySettings() { + return ((ComplianceStubSettings) getStubSettings()).getIamPolicySettings(); + } + + /** Returns the object with the settings used for calls to testIamPermissions. */ + public UnaryCallSettings + testIamPermissionsSettings() { + return ((ComplianceStubSettings) getStubSettings()).testIamPermissionsSettings(); + } + + public static final ComplianceSettings create(ComplianceStubSettings stub) throws IOException { + return new ComplianceSettings.Builder(stub.toBuilder()).build(); + } + + /** Returns a builder for the default ExecutorProvider for this service. */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return ComplianceStubSettings.defaultExecutorProviderBuilder(); + } + + /** Returns the default service endpoint. */ + public static String getDefaultEndpoint() { + return ComplianceStubSettings.getDefaultEndpoint(); + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return ComplianceStubSettings.getDefaultServiceScopes(); + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return ComplianceStubSettings.defaultCredentialsProviderBuilder(); + } + + /** Returns a builder for the default gRPC ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return ComplianceStubSettings.defaultGrpcTransportProviderBuilder(); + } + + /** Returns a builder for the default REST ChannelProvider for this service. */ + @BetaApi + public static InstantiatingHttpJsonChannelProvider.Builder + defaultHttpJsonTransportProviderBuilder() { + return ComplianceStubSettings.defaultHttpJsonTransportProviderBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return ComplianceStubSettings.defaultTransportChannelProvider(); + } + + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return ComplianceStubSettings.defaultApiClientHeaderProviderBuilder(); + } + + /** Returns a new gRPC builder for this class. */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** Returns a new REST builder for this class. */ + public static Builder newHttpJsonBuilder() { + return Builder.createHttpJsonDefault(); + } + + /** 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 ComplianceSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + } + + /** Builder for ComplianceSettings. */ + public static class Builder extends ClientSettings.Builder { + + protected Builder() throws IOException { + this(((ClientContext) null)); + } + + protected Builder(ClientContext clientContext) { + super(ComplianceStubSettings.newBuilder(clientContext)); + } + + protected Builder(ComplianceSettings settings) { + super(settings.getStubSettings().toBuilder()); + } + + protected Builder(ComplianceStubSettings.Builder stubSettings) { + super(stubSettings); + } + + private static Builder createDefault() { + return new Builder(ComplianceStubSettings.newBuilder()); + } + + private static Builder createHttpJsonDefault() { + return new Builder(ComplianceStubSettings.newHttpJsonBuilder()); + } + + public ComplianceStubSettings.Builder getStubSettingsBuilder() { + return ((ComplianceStubSettings.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 repeatDataBody. */ + public UnaryCallSettings.Builder repeatDataBodySettings() { + return getStubSettingsBuilder().repeatDataBodySettings(); + } + + /** Returns the builder for the settings used for calls to repeatDataBodyInfo. */ + public UnaryCallSettings.Builder repeatDataBodyInfoSettings() { + return getStubSettingsBuilder().repeatDataBodyInfoSettings(); + } + + /** Returns the builder for the settings used for calls to repeatDataQuery. */ + public UnaryCallSettings.Builder repeatDataQuerySettings() { + return getStubSettingsBuilder().repeatDataQuerySettings(); + } + + /** Returns the builder for the settings used for calls to repeatDataSimplePath. */ + public UnaryCallSettings.Builder repeatDataSimplePathSettings() { + return getStubSettingsBuilder().repeatDataSimplePathSettings(); + } + + /** Returns the builder for the settings used for calls to repeatDataPathResource. */ + public UnaryCallSettings.Builder + repeatDataPathResourceSettings() { + return getStubSettingsBuilder().repeatDataPathResourceSettings(); + } + + /** Returns the builder for the settings used for calls to repeatDataPathTrailingResource. */ + public UnaryCallSettings.Builder + repeatDataPathTrailingResourceSettings() { + return getStubSettingsBuilder().repeatDataPathTrailingResourceSettings(); + } + + /** Returns the builder for the settings used for calls to repeatDataBodyPut. */ + public UnaryCallSettings.Builder repeatDataBodyPutSettings() { + return getStubSettingsBuilder().repeatDataBodyPutSettings(); + } + + /** Returns the builder for the settings used for calls to repeatDataBodyPatch. */ + public UnaryCallSettings.Builder repeatDataBodyPatchSettings() { + return getStubSettingsBuilder().repeatDataBodyPatchSettings(); + } + + /** Returns the builder for the settings used for calls to getEnum. */ + public UnaryCallSettings.Builder getEnumSettings() { + return getStubSettingsBuilder().getEnumSettings(); + } + + /** Returns the builder for the settings used for calls to verifyEnum. */ + public UnaryCallSettings.Builder verifyEnumSettings() { + return getStubSettingsBuilder().verifyEnumSettings(); + } + + /** Returns the builder for the settings used for calls to listLocations. */ + public PagedCallSettings.Builder< + ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse> + listLocationsSettings() { + return getStubSettingsBuilder().listLocationsSettings(); + } + + /** Returns the builder for the settings used for calls to getLocation. */ + public UnaryCallSettings.Builder getLocationSettings() { + return getStubSettingsBuilder().getLocationSettings(); + } + + /** Returns the builder for the settings used for calls to setIamPolicy. */ + public UnaryCallSettings.Builder setIamPolicySettings() { + return getStubSettingsBuilder().setIamPolicySettings(); + } + + /** Returns the builder for the settings used for calls to getIamPolicy. */ + public UnaryCallSettings.Builder getIamPolicySettings() { + return getStubSettingsBuilder().getIamPolicySettings(); + } + + /** Returns the builder for the settings used for calls to testIamPermissions. */ + public UnaryCallSettings.Builder + testIamPermissionsSettings() { + return getStubSettingsBuilder().testIamPermissionsSettings(); + } + + @Override + public ComplianceSettings build() throws IOException { + return new ComplianceSettings(this); + } + } +} diff --git a/java-showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/EchoClient.java b/java-showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/EchoClient.java new file mode 100644 index 0000000000..94d3fef234 --- /dev/null +++ b/java-showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/EchoClient.java @@ -0,0 +1,1783 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1; + +import com.google.api.core.ApiFuture; +import com.google.api.core.ApiFutures; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.httpjson.longrunning.OperationsClient; +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.BidiStreamingCallable; +import com.google.api.gax.rpc.ClientStreamingCallable; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.common.util.concurrent.MoreExecutors; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.longrunning.Operation; +import com.google.showcase.v1beta1.stub.EchoStub; +import com.google.showcase.v1beta1.stub.EchoStubSettings; +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: This service is used showcase the four main types of rpcs - unary, server + * side streaming, client side streaming, and bidirectional streaming. This service also exposes + * methods that explicitly implement server delay, and paginated calls. Set the 'showcase-trailer' + * metadata key on any method to have the values echoed in the response trailers. Set the + * 'x-goog-request-params' metadata key on any method to have the values echoed in the response + * headers. + * + *

        This client uses Echo version v1_20240408. + * + *

        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 (EchoClient echoClient = EchoClient.create()) {
        + *   EchoRequest request =
        + *       EchoRequest.newBuilder()
        + *           .setSeverity(Severity.forNumber(0))
        + *           .setHeader("header-1221270899")
        + *           .setOtherHeader("otherHeader-2026585667")
        + *           .setRequestId("requestId693933066")
        + *           .setOtherRequestId("otherRequestId1248995034")
        + *           .build();
        + *   EchoResponse response = echoClient.echo(request);
        + * }
        + * }
        + * + *

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

        Echo

        This method simply echoes the request. This method showcases unary RPCs.

        + *

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

        + *
          + *
        • echo(EchoRequest request) + *

        + *

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

        + *
          + *
        • echoCallable() + *

        + *

        EchoErrorDetails

        This method returns error details in a repeated "google.protobuf.Any" field. This method showcases handling errors thus encoded, particularly over REST transport. Note that GAPICs only allow the type "google.protobuf.Any" for field paths ending in "error.details", and, at run-time, the actual types for these fields must be one of the types in google/rpc/error_details.proto.

        + *

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

        + *
          + *
        • echoErrorDetails(EchoErrorDetailsRequest request) + *

        + *

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

        + *
          + *
        • echoErrorDetailsCallable() + *

        + *

        FailEchoWithDetails

        This method always fails with a gRPC "Aborted" error status that contains multiple error details. These include one instance of each of the standard ones in error_details.proto (https://github.com/googleapis/googleapis/blob/master/google/rpc/error_details.proto) plus a custom, Showcase-defined PoetryError. The intent of this RPC is to verify that GAPICs can process these various error details and surface them to the user in an idiomatic form.

        + *

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

        + *
          + *
        • failEchoWithDetails(FailEchoWithDetailsRequest request) + *

        + *

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

        + *
          + *
        • failEchoWithDetailsCallable() + *

        + *

        Expand

        This method splits the given content into words and will pass each word back through the stream. This method showcases server-side streaming RPCs.

        + *

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

        + *
          + *
        • expandCallable() + *

        + *

        Collect

        This method will collect the words given to it. When the stream is closed by the client, this method will return the a concatenation of the strings passed to it. This method showcases client-side streaming RPCs.

        + *

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

        + *
          + *
        • collectCallable() + *

        + *

        Chat

        This method, upon receiving a request on the stream, will pass the same content back on the stream. This method showcases bidirectional streaming RPCs.

        + *

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

        + *
          + *
        • chatCallable() + *

        + *

        PagedExpand

        This is similar to the Expand method but instead of returning a stream of expanded words, this method returns a paged list of expanded words.

        + *

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

        + *
          + *
        • pagedExpand(PagedExpandRequest request) + *

        + *

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

        + *
          + *
        • pagedExpandPagedCallable() + *

        • pagedExpandCallable() + *

        + *

        PagedExpandLegacy

        This is similar to the PagedExpand except that it uses max_results instead of page_size, as some legacy APIs still do. New APIs should NOT use this pattern.

        + *

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

        + *
          + *
        • pagedExpandLegacy(PagedExpandLegacyRequest request) + *

        + *

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

        + *
          + *
        • pagedExpandLegacyCallable() + *

        + *

        PagedExpandLegacyMapped

        This method returns a map containing lists of words that appear in the input, keyed by their initial character. The only words returned are the ones included in the current page, as determined by page_token and page_size, which both refer to the word indices in the input. This paging result consisting of a map of lists is a pattern used by some legacy APIs. New APIs should NOT use this pattern.

        + *

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

        + *
          + *
        • pagedExpandLegacyMapped(PagedExpandRequest request) + *

        + *

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

        + *
          + *
        • pagedExpandLegacyMappedPagedCallable() + *

        • pagedExpandLegacyMappedCallable() + *

        + *

        Wait

        This method will wait for the requested amount of time and then return. This method showcases how a client handles a request timeout.

        + *

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

        + *
          + *
        • waitAsync(WaitRequest request) + *

        + *

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

        + *
          + *
        • waitOperationCallable() + *

        • waitCallable() + *

        + *

        Block

        This method will block (wait) for the requested amount of time and then return the response or error. This method showcases how a client handles delays or retries.

        + *

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

        + *
          + *
        • block(BlockRequest request) + *

        + *

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

        + *
          + *
        • blockCallable() + *

        + *

        ListLocations

        Lists information about the supported locations for this service.

        + *

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

        + *
          + *
        • listLocations(ListLocationsRequest request) + *

        + *

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

        + *
          + *
        • listLocationsPagedCallable() + *

        • listLocationsCallable() + *

        + *

        GetLocation

        Gets information about a location.

        + *

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

        + *
          + *
        • getLocation(GetLocationRequest request) + *

        + *

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

        + *
          + *
        • getLocationCallable() + *

        + *

        SetIamPolicy

        Sets the access control policy on the specified resource. Replaces any existing policy. + *

        Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED` errors.

        + *

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

        + *
          + *
        • setIamPolicy(SetIamPolicyRequest request) + *

        + *

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

        + *
          + *
        • setIamPolicyCallable() + *

        + *

        GetIamPolicy

        Gets the access control policy for a resource. Returns an empty policy if the resource exists and does not have a policy set.

        + *

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

        + *
          + *
        • getIamPolicy(GetIamPolicyRequest request) + *

        + *

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

        + *
          + *
        • getIamPolicyCallable() + *

        + *

        TestIamPermissions

        Returns permissions that a caller has on the specified resource. If the resource does not exist, this will return an empty set of permissions, not a `NOT_FOUND` error. + *

        Note: This operation is designed to be used for building permission-aware UIs and command-line tools, not for authorization checking. This operation may "fail open" without warning.

        + *

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

        + *
          + *
        • testIamPermissions(TestIamPermissionsRequest request) + *

        + *

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

        + *
          + *
        • testIamPermissionsCallable() + *

        + *
        + * + *

        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 EchoSettings 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
        + * EchoSettings echoSettings =
        + *     EchoSettings.newBuilder()
        + *         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
        + *         .build();
        + * EchoClient echoClient = EchoClient.create(echoSettings);
        + * }
        + * + *

        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
        + * EchoSettings echoSettings = EchoSettings.newBuilder().setEndpoint(myEndpoint).build();
        + * EchoClient echoClient = EchoClient.create(echoSettings);
        + * }
        + * + *

        To use REST (HTTP1.1/JSON) transport (instead of gRPC) for sending and receiving requests over + * the wire: + * + *

        {@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
        + * EchoSettings echoSettings = EchoSettings.newHttpJsonBuilder().build();
        + * EchoClient echoClient = EchoClient.create(echoSettings);
        + * }
        + * + *

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

        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 (EchoClient echoClient = EchoClient.create()) {
        +   *   EchoRequest request =
        +   *       EchoRequest.newBuilder()
        +   *           .setSeverity(Severity.forNumber(0))
        +   *           .setHeader("header-1221270899")
        +   *           .setOtherHeader("otherHeader-2026585667")
        +   *           .setRequestId("requestId693933066")
        +   *           .setOtherRequestId("otherRequestId1248995034")
        +   *           .build();
        +   *   EchoResponse response = echoClient.echo(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 EchoResponse echo(EchoRequest request) { + return echoCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * This method simply echoes the request. This method showcases unary RPCs. + * + *

        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 (EchoClient echoClient = EchoClient.create()) {
        +   *   EchoRequest request =
        +   *       EchoRequest.newBuilder()
        +   *           .setSeverity(Severity.forNumber(0))
        +   *           .setHeader("header-1221270899")
        +   *           .setOtherHeader("otherHeader-2026585667")
        +   *           .setRequestId("requestId693933066")
        +   *           .setOtherRequestId("otherRequestId1248995034")
        +   *           .build();
        +   *   ApiFuture future = echoClient.echoCallable().futureCall(request);
        +   *   // Do something.
        +   *   EchoResponse response = future.get();
        +   * }
        +   * }
        + */ + public final UnaryCallable echoCallable() { + return stub.echoCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * This method returns error details in a repeated "google.protobuf.Any" field. This method + * showcases handling errors thus encoded, particularly over REST transport. Note that GAPICs only + * allow the type "google.protobuf.Any" for field paths ending in "error.details", and, at + * run-time, the actual types for these fields must be one of the types in + * google/rpc/error_details.proto. + * + *

        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 (EchoClient echoClient = EchoClient.create()) {
        +   *   EchoErrorDetailsRequest request =
        +   *       EchoErrorDetailsRequest.newBuilder()
        +   *           .setSingleDetailText("singleDetailText1774380934")
        +   *           .addAllMultiDetailText(new ArrayList())
        +   *           .build();
        +   *   EchoErrorDetailsResponse response = echoClient.echoErrorDetails(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 EchoErrorDetailsResponse echoErrorDetails(EchoErrorDetailsRequest request) { + return echoErrorDetailsCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * This method returns error details in a repeated "google.protobuf.Any" field. This method + * showcases handling errors thus encoded, particularly over REST transport. Note that GAPICs only + * allow the type "google.protobuf.Any" for field paths ending in "error.details", and, at + * run-time, the actual types for these fields must be one of the types in + * google/rpc/error_details.proto. + * + *

        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 (EchoClient echoClient = EchoClient.create()) {
        +   *   EchoErrorDetailsRequest request =
        +   *       EchoErrorDetailsRequest.newBuilder()
        +   *           .setSingleDetailText("singleDetailText1774380934")
        +   *           .addAllMultiDetailText(new ArrayList())
        +   *           .build();
        +   *   ApiFuture future =
        +   *       echoClient.echoErrorDetailsCallable().futureCall(request);
        +   *   // Do something.
        +   *   EchoErrorDetailsResponse response = future.get();
        +   * }
        +   * }
        + */ + public final UnaryCallable + echoErrorDetailsCallable() { + return stub.echoErrorDetailsCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * This method always fails with a gRPC "Aborted" error status that contains multiple error + * details. These include one instance of each of the standard ones in error_details.proto + * (https://github.com/googleapis/googleapis/blob/master/google/rpc/error_details.proto) plus a + * custom, Showcase-defined PoetryError. The intent of this RPC is to verify that GAPICs can + * process these various error details and surface them to the user in an idiomatic form. + * + *

        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 (EchoClient echoClient = EchoClient.create()) {
        +   *   FailEchoWithDetailsRequest request =
        +   *       FailEchoWithDetailsRequest.newBuilder().setMessage("message954925063").build();
        +   *   FailEchoWithDetailsResponse response = echoClient.failEchoWithDetails(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 FailEchoWithDetailsResponse failEchoWithDetails(FailEchoWithDetailsRequest request) { + return failEchoWithDetailsCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * This method always fails with a gRPC "Aborted" error status that contains multiple error + * details. These include one instance of each of the standard ones in error_details.proto + * (https://github.com/googleapis/googleapis/blob/master/google/rpc/error_details.proto) plus a + * custom, Showcase-defined PoetryError. The intent of this RPC is to verify that GAPICs can + * process these various error details and surface them to the user in an idiomatic form. + * + *

        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 (EchoClient echoClient = EchoClient.create()) {
        +   *   FailEchoWithDetailsRequest request =
        +   *       FailEchoWithDetailsRequest.newBuilder().setMessage("message954925063").build();
        +   *   ApiFuture future =
        +   *       echoClient.failEchoWithDetailsCallable().futureCall(request);
        +   *   // Do something.
        +   *   FailEchoWithDetailsResponse response = future.get();
        +   * }
        +   * }
        + */ + public final UnaryCallable + failEchoWithDetailsCallable() { + return stub.failEchoWithDetailsCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * This method splits the given content into words and will pass each word back through the + * stream. This method showcases server-side streaming RPCs. + * + *

        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 (EchoClient echoClient = EchoClient.create()) {
        +   *   ExpandRequest request =
        +   *       ExpandRequest.newBuilder()
        +   *           .setContent("content951530617")
        +   *           .setError(Status.newBuilder().build())
        +   *           .setStreamWaitTime(Duration.newBuilder().build())
        +   *           .build();
        +   *   ServerStream stream = echoClient.expandCallable().call(request);
        +   *   for (EchoResponse response : stream) {
        +   *     // Do something when a response is received.
        +   *   }
        +   * }
        +   * }
        + */ + public final ServerStreamingCallable expandCallable() { + return stub.expandCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * This method will collect the words given to it. When the stream is closed by the client, this + * method will return the a concatenation of the strings passed to it. This method showcases + * client-side streaming RPCs. + * + *

        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 (EchoClient echoClient = EchoClient.create()) {
        +   *   ApiStreamObserver responseObserver =
        +   *       new ApiStreamObserver() {
        +   *         {@literal @}Override
        +   *         public void onNext(EchoResponse response) {
        +   *           // Do something when a response is received.
        +   *         }
        +   *
        +   *         {@literal @}Override
        +   *         public void onError(Throwable t) {
        +   *           // Add error-handling
        +   *         }
        +   *
        +   *         {@literal @}Override
        +   *         public void onCompleted() {
        +   *           // Do something when complete.
        +   *         }
        +   *       };
        +   *   ApiStreamObserver requestObserver =
        +   *       echoClient.collect().clientStreamingCall(responseObserver);
        +   *   EchoRequest request =
        +   *       EchoRequest.newBuilder()
        +   *           .setSeverity(Severity.forNumber(0))
        +   *           .setHeader("header-1221270899")
        +   *           .setOtherHeader("otherHeader-2026585667")
        +   *           .setRequestId("requestId693933066")
        +   *           .setOtherRequestId("otherRequestId1248995034")
        +   *           .build();
        +   *   requestObserver.onNext(request);
        +   * }
        +   * }
        + */ + public final ClientStreamingCallable collectCallable() { + return stub.collectCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * This method, upon receiving a request on the stream, will pass the same content back on the + * stream. This method showcases bidirectional streaming RPCs. + * + *

        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 (EchoClient echoClient = EchoClient.create()) {
        +   *   BidiStream bidiStream = echoClient.chatCallable().call();
        +   *   EchoRequest request =
        +   *       EchoRequest.newBuilder()
        +   *           .setSeverity(Severity.forNumber(0))
        +   *           .setHeader("header-1221270899")
        +   *           .setOtherHeader("otherHeader-2026585667")
        +   *           .setRequestId("requestId693933066")
        +   *           .setOtherRequestId("otherRequestId1248995034")
        +   *           .build();
        +   *   bidiStream.send(request);
        +   *   for (EchoResponse response : bidiStream) {
        +   *     // Do something when a response is received.
        +   *   }
        +   * }
        +   * }
        + */ + public final BidiStreamingCallable chatCallable() { + return stub.chatCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * This is similar to the Expand method but instead of returning a stream of expanded words, this + * method returns a paged list of expanded words. + * + *

        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 (EchoClient echoClient = EchoClient.create()) {
        +   *   PagedExpandRequest request =
        +   *       PagedExpandRequest.newBuilder()
        +   *           .setContent("content951530617")
        +   *           .setPageSize(883849137)
        +   *           .setPageToken("pageToken873572522")
        +   *           .build();
        +   *   for (EchoResponse element : echoClient.pagedExpand(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 PagedExpandPagedResponse pagedExpand(PagedExpandRequest request) { + return pagedExpandPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * This is similar to the Expand method but instead of returning a stream of expanded words, this + * method returns a paged list of expanded words. + * + *

        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 (EchoClient echoClient = EchoClient.create()) {
        +   *   PagedExpandRequest request =
        +   *       PagedExpandRequest.newBuilder()
        +   *           .setContent("content951530617")
        +   *           .setPageSize(883849137)
        +   *           .setPageToken("pageToken873572522")
        +   *           .build();
        +   *   ApiFuture future = echoClient.pagedExpandPagedCallable().futureCall(request);
        +   *   // Do something.
        +   *   for (EchoResponse element : future.get().iterateAll()) {
        +   *     // doThingsWith(element);
        +   *   }
        +   * }
        +   * }
        + */ + public final UnaryCallable + pagedExpandPagedCallable() { + return stub.pagedExpandPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * This is similar to the Expand method but instead of returning a stream of expanded words, this + * method returns a paged list of expanded words. + * + *

        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 (EchoClient echoClient = EchoClient.create()) {
        +   *   PagedExpandRequest request =
        +   *       PagedExpandRequest.newBuilder()
        +   *           .setContent("content951530617")
        +   *           .setPageSize(883849137)
        +   *           .setPageToken("pageToken873572522")
        +   *           .build();
        +   *   while (true) {
        +   *     PagedExpandResponse response = echoClient.pagedExpandCallable().call(request);
        +   *     for (EchoResponse element : response.getResponsesList()) {
        +   *       // doThingsWith(element);
        +   *     }
        +   *     String nextPageToken = response.getNextPageToken();
        +   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
        +   *       request = request.toBuilder().setPageToken(nextPageToken).build();
        +   *     } else {
        +   *       break;
        +   *     }
        +   *   }
        +   * }
        +   * }
        + */ + public final UnaryCallable pagedExpandCallable() { + return stub.pagedExpandCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * This is similar to the PagedExpand except that it uses max_results instead of page_size, as + * some legacy APIs still do. New APIs should NOT use this pattern. + * + *

        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 (EchoClient echoClient = EchoClient.create()) {
        +   *   PagedExpandLegacyRequest request =
        +   *       PagedExpandLegacyRequest.newBuilder()
        +   *           .setContent("content951530617")
        +   *           .setMaxResults(1128457243)
        +   *           .setPageToken("pageToken873572522")
        +   *           .build();
        +   *   PagedExpandResponse response = echoClient.pagedExpandLegacy(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 PagedExpandResponse pagedExpandLegacy(PagedExpandLegacyRequest request) { + return pagedExpandLegacyCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * This is similar to the PagedExpand except that it uses max_results instead of page_size, as + * some legacy APIs still do. New APIs should NOT use this pattern. + * + *

        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 (EchoClient echoClient = EchoClient.create()) {
        +   *   PagedExpandLegacyRequest request =
        +   *       PagedExpandLegacyRequest.newBuilder()
        +   *           .setContent("content951530617")
        +   *           .setMaxResults(1128457243)
        +   *           .setPageToken("pageToken873572522")
        +   *           .build();
        +   *   ApiFuture future =
        +   *       echoClient.pagedExpandLegacyCallable().futureCall(request);
        +   *   // Do something.
        +   *   PagedExpandResponse response = future.get();
        +   * }
        +   * }
        + */ + public final UnaryCallable + pagedExpandLegacyCallable() { + return stub.pagedExpandLegacyCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * This method returns a map containing lists of words that appear in the input, keyed by their + * initial character. The only words returned are the ones included in the current page, as + * determined by page_token and page_size, which both refer to the word indices in the input. This + * paging result consisting of a map of lists is a pattern used by some legacy APIs. New APIs + * should NOT use this pattern. + * + *

        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 (EchoClient echoClient = EchoClient.create()) {
        +   *   PagedExpandRequest request =
        +   *       PagedExpandRequest.newBuilder()
        +   *           .setContent("content951530617")
        +   *           .setPageSize(883849137)
        +   *           .setPageToken("pageToken873572522")
        +   *           .build();
        +   *   for (Map.Entry element :
        +   *       echoClient.pagedExpandLegacyMapped(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 PagedExpandLegacyMappedPagedResponse pagedExpandLegacyMapped( + PagedExpandRequest request) { + return pagedExpandLegacyMappedPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * This method returns a map containing lists of words that appear in the input, keyed by their + * initial character. The only words returned are the ones included in the current page, as + * determined by page_token and page_size, which both refer to the word indices in the input. This + * paging result consisting of a map of lists is a pattern used by some legacy APIs. New APIs + * should NOT use this pattern. + * + *

        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 (EchoClient echoClient = EchoClient.create()) {
        +   *   PagedExpandRequest request =
        +   *       PagedExpandRequest.newBuilder()
        +   *           .setContent("content951530617")
        +   *           .setPageSize(883849137)
        +   *           .setPageToken("pageToken873572522")
        +   *           .build();
        +   *   ApiFuture> future =
        +   *       echoClient.pagedExpandLegacyMappedPagedCallable().futureCall(request);
        +   *   // Do something.
        +   *   for (Map.Entry element : future.get().iterateAll()) {
        +   *     // doThingsWith(element);
        +   *   }
        +   * }
        +   * }
        + */ + public final UnaryCallable + pagedExpandLegacyMappedPagedCallable() { + return stub.pagedExpandLegacyMappedPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * This method returns a map containing lists of words that appear in the input, keyed by their + * initial character. The only words returned are the ones included in the current page, as + * determined by page_token and page_size, which both refer to the word indices in the input. This + * paging result consisting of a map of lists is a pattern used by some legacy APIs. New APIs + * should NOT use this pattern. + * + *

        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 (EchoClient echoClient = EchoClient.create()) {
        +   *   PagedExpandRequest request =
        +   *       PagedExpandRequest.newBuilder()
        +   *           .setContent("content951530617")
        +   *           .setPageSize(883849137)
        +   *           .setPageToken("pageToken873572522")
        +   *           .build();
        +   *   while (true) {
        +   *     PagedExpandLegacyMappedResponse response =
        +   *         echoClient.pagedExpandLegacyMappedCallable().call(request);
        +   *     for (Map.Entry element : response.getAlphabetizedList()) {
        +   *       // doThingsWith(element);
        +   *     }
        +   *     String nextPageToken = response.getNextPageToken();
        +   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
        +   *       request = request.toBuilder().setPageToken(nextPageToken).build();
        +   *     } else {
        +   *       break;
        +   *     }
        +   *   }
        +   * }
        +   * }
        + */ + public final UnaryCallable + pagedExpandLegacyMappedCallable() { + return stub.pagedExpandLegacyMappedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * This method will wait for the requested amount of time and then return. This method showcases + * how a client handles a request timeout. + * + *

        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 (EchoClient echoClient = EchoClient.create()) {
        +   *   WaitRequest request = WaitRequest.newBuilder().build();
        +   *   WaitResponse response = echoClient.waitAsync(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 waitAsync(WaitRequest request) { + return waitOperationCallable().futureCall(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * This method will wait for the requested amount of time and then return. This method showcases + * how a client handles a request timeout. + * + *

        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 (EchoClient echoClient = EchoClient.create()) {
        +   *   WaitRequest request = WaitRequest.newBuilder().build();
        +   *   OperationFuture future =
        +   *       echoClient.waitOperationCallable().futureCall(request);
        +   *   // Do something.
        +   *   WaitResponse response = future.get();
        +   * }
        +   * }
        + */ + public final OperationCallable waitOperationCallable() { + return stub.waitOperationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * This method will wait for the requested amount of time and then return. This method showcases + * how a client handles a request timeout. + * + *

        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 (EchoClient echoClient = EchoClient.create()) {
        +   *   WaitRequest request = WaitRequest.newBuilder().build();
        +   *   ApiFuture future = echoClient.waitCallable().futureCall(request);
        +   *   // Do something.
        +   *   Operation response = future.get();
        +   * }
        +   * }
        + */ + public final UnaryCallable waitCallable() { + return stub.waitCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * This method will block (wait) for the requested amount of time and then return the response or + * error. This method showcases how a client handles delays or retries. + * + *

        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 (EchoClient echoClient = EchoClient.create()) {
        +   *   BlockRequest request =
        +   *       BlockRequest.newBuilder().setResponseDelay(Duration.newBuilder().build()).build();
        +   *   BlockResponse response = echoClient.block(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 BlockResponse block(BlockRequest request) { + return blockCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * This method will block (wait) for the requested amount of time and then return the response or + * error. This method showcases how a client handles delays or retries. + * + *

        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 (EchoClient echoClient = EchoClient.create()) {
        +   *   BlockRequest request =
        +   *       BlockRequest.newBuilder().setResponseDelay(Duration.newBuilder().build()).build();
        +   *   ApiFuture future = echoClient.blockCallable().futureCall(request);
        +   *   // Do something.
        +   *   BlockResponse response = future.get();
        +   * }
        +   * }
        + */ + public final UnaryCallable blockCallable() { + return stub.blockCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists information about the supported locations for this service. + * + *

        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 (EchoClient echoClient = EchoClient.create()) {
        +   *   ListLocationsRequest request =
        +   *       ListLocationsRequest.newBuilder()
        +   *           .setName("name3373707")
        +   *           .setFilter("filter-1274492040")
        +   *           .setPageSize(883849137)
        +   *           .setPageToken("pageToken873572522")
        +   *           .build();
        +   *   for (Location element : echoClient.listLocations(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 ListLocationsPagedResponse listLocations(ListLocationsRequest request) { + return listLocationsPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists information about the supported locations for this service. + * + *

        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 (EchoClient echoClient = EchoClient.create()) {
        +   *   ListLocationsRequest request =
        +   *       ListLocationsRequest.newBuilder()
        +   *           .setName("name3373707")
        +   *           .setFilter("filter-1274492040")
        +   *           .setPageSize(883849137)
        +   *           .setPageToken("pageToken873572522")
        +   *           .build();
        +   *   ApiFuture future = echoClient.listLocationsPagedCallable().futureCall(request);
        +   *   // Do something.
        +   *   for (Location element : future.get().iterateAll()) {
        +   *     // doThingsWith(element);
        +   *   }
        +   * }
        +   * }
        + */ + public final UnaryCallable + listLocationsPagedCallable() { + return stub.listLocationsPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists information about the supported locations for this service. + * + *

        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 (EchoClient echoClient = EchoClient.create()) {
        +   *   ListLocationsRequest request =
        +   *       ListLocationsRequest.newBuilder()
        +   *           .setName("name3373707")
        +   *           .setFilter("filter-1274492040")
        +   *           .setPageSize(883849137)
        +   *           .setPageToken("pageToken873572522")
        +   *           .build();
        +   *   while (true) {
        +   *     ListLocationsResponse response = echoClient.listLocationsCallable().call(request);
        +   *     for (Location element : response.getLocationsList()) {
        +   *       // doThingsWith(element);
        +   *     }
        +   *     String nextPageToken = response.getNextPageToken();
        +   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
        +   *       request = request.toBuilder().setPageToken(nextPageToken).build();
        +   *     } else {
        +   *       break;
        +   *     }
        +   *   }
        +   * }
        +   * }
        + */ + public final UnaryCallable listLocationsCallable() { + return stub.listLocationsCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets information about a location. + * + *

        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 (EchoClient echoClient = EchoClient.create()) {
        +   *   GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build();
        +   *   Location response = echoClient.getLocation(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 Location getLocation(GetLocationRequest request) { + return getLocationCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets information about a location. + * + *

        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 (EchoClient echoClient = EchoClient.create()) {
        +   *   GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build();
        +   *   ApiFuture future = echoClient.getLocationCallable().futureCall(request);
        +   *   // Do something.
        +   *   Location response = future.get();
        +   * }
        +   * }
        + */ + public final UnaryCallable getLocationCallable() { + return stub.getLocationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Sets the access control policy on the specified resource. Replaces any existing policy. + * + *

        Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED` errors. + * + *

        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 (EchoClient echoClient = EchoClient.create()) {
        +   *   SetIamPolicyRequest request =
        +   *       SetIamPolicyRequest.newBuilder()
        +   *           .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString())
        +   *           .setPolicy(Policy.newBuilder().build())
        +   *           .setUpdateMask(FieldMask.newBuilder().build())
        +   *           .build();
        +   *   Policy response = echoClient.setIamPolicy(request);
        +   * }
        +   * }
        + * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Policy setIamPolicy(SetIamPolicyRequest request) { + return setIamPolicyCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Sets the access control policy on the specified resource. Replaces any existing policy. + * + *

        Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED` errors. + * + *

        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 (EchoClient echoClient = EchoClient.create()) {
        +   *   SetIamPolicyRequest request =
        +   *       SetIamPolicyRequest.newBuilder()
        +   *           .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString())
        +   *           .setPolicy(Policy.newBuilder().build())
        +   *           .setUpdateMask(FieldMask.newBuilder().build())
        +   *           .build();
        +   *   ApiFuture future = echoClient.setIamPolicyCallable().futureCall(request);
        +   *   // Do something.
        +   *   Policy response = future.get();
        +   * }
        +   * }
        + */ + public final UnaryCallable setIamPolicyCallable() { + return stub.setIamPolicyCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets the access control policy for a resource. Returns an empty policy if the resource exists + * and does not have a policy set. + * + *

        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 (EchoClient echoClient = EchoClient.create()) {
        +   *   GetIamPolicyRequest request =
        +   *       GetIamPolicyRequest.newBuilder()
        +   *           .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString())
        +   *           .setOptions(GetPolicyOptions.newBuilder().build())
        +   *           .build();
        +   *   Policy response = echoClient.getIamPolicy(request);
        +   * }
        +   * }
        + * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Policy getIamPolicy(GetIamPolicyRequest request) { + return getIamPolicyCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets the access control policy for a resource. Returns an empty policy if the resource exists + * and does not have a policy set. + * + *

        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 (EchoClient echoClient = EchoClient.create()) {
        +   *   GetIamPolicyRequest request =
        +   *       GetIamPolicyRequest.newBuilder()
        +   *           .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString())
        +   *           .setOptions(GetPolicyOptions.newBuilder().build())
        +   *           .build();
        +   *   ApiFuture future = echoClient.getIamPolicyCallable().futureCall(request);
        +   *   // Do something.
        +   *   Policy response = future.get();
        +   * }
        +   * }
        + */ + public final UnaryCallable getIamPolicyCallable() { + return stub.getIamPolicyCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Returns permissions that a caller has on the specified resource. If the resource does not + * exist, this will return an empty set of permissions, not a `NOT_FOUND` error. + * + *

        Note: This operation is designed to be used for building permission-aware UIs and + * command-line tools, not for authorization checking. This operation may "fail open" without + * warning. + * + *

        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 (EchoClient echoClient = EchoClient.create()) {
        +   *   TestIamPermissionsRequest request =
        +   *       TestIamPermissionsRequest.newBuilder()
        +   *           .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString())
        +   *           .addAllPermissions(new ArrayList())
        +   *           .build();
        +   *   TestIamPermissionsResponse response = echoClient.testIamPermissions(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 TestIamPermissionsResponse testIamPermissions(TestIamPermissionsRequest request) { + return testIamPermissionsCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Returns permissions that a caller has on the specified resource. If the resource does not + * exist, this will return an empty set of permissions, not a `NOT_FOUND` error. + * + *

        Note: This operation is designed to be used for building permission-aware UIs and + * command-line tools, not for authorization checking. This operation may "fail open" without + * warning. + * + *

        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 (EchoClient echoClient = EchoClient.create()) {
        +   *   TestIamPermissionsRequest request =
        +   *       TestIamPermissionsRequest.newBuilder()
        +   *           .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString())
        +   *           .addAllPermissions(new ArrayList())
        +   *           .build();
        +   *   ApiFuture future =
        +   *       echoClient.testIamPermissionsCallable().futureCall(request);
        +   *   // Do something.
        +   *   TestIamPermissionsResponse response = future.get();
        +   * }
        +   * }
        + */ + public final UnaryCallable + testIamPermissionsCallable() { + return stub.testIamPermissionsCallable(); + } + + @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 PagedExpandPagedResponse + extends AbstractPagedListResponse< + PagedExpandRequest, + PagedExpandResponse, + EchoResponse, + PagedExpandPage, + PagedExpandFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + PagedExpandPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, input -> new PagedExpandPagedResponse(input), MoreExecutors.directExecutor()); + } + + private PagedExpandPagedResponse(PagedExpandPage page) { + super(page, PagedExpandFixedSizeCollection.createEmptyCollection()); + } + } + + public static class PagedExpandPage + extends AbstractPage { + + private PagedExpandPage( + PageContext context, + PagedExpandResponse response) { + super(context, response); + } + + private static PagedExpandPage createEmptyPage() { + return new PagedExpandPage(null, null); + } + + @Override + protected PagedExpandPage createPage( + PageContext context, + PagedExpandResponse response) { + return new PagedExpandPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class PagedExpandFixedSizeCollection + extends AbstractFixedSizeCollection< + PagedExpandRequest, + PagedExpandResponse, + EchoResponse, + PagedExpandPage, + PagedExpandFixedSizeCollection> { + + private PagedExpandFixedSizeCollection(List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static PagedExpandFixedSizeCollection createEmptyCollection() { + return new PagedExpandFixedSizeCollection(null, 0); + } + + @Override + protected PagedExpandFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new PagedExpandFixedSizeCollection(pages, collectionSize); + } + } + + public static class PagedExpandLegacyMappedPagedResponse + extends AbstractPagedListResponse< + PagedExpandRequest, + PagedExpandLegacyMappedResponse, + Map.Entry, + PagedExpandLegacyMappedPage, + PagedExpandLegacyMappedFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext< + PagedExpandRequest, + PagedExpandLegacyMappedResponse, + Map.Entry> + context, + ApiFuture futureResponse) { + ApiFuture futurePage = + PagedExpandLegacyMappedPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + input -> new PagedExpandLegacyMappedPagedResponse(input), + MoreExecutors.directExecutor()); + } + + private PagedExpandLegacyMappedPagedResponse(PagedExpandLegacyMappedPage page) { + super(page, PagedExpandLegacyMappedFixedSizeCollection.createEmptyCollection()); + } + } + + public static class PagedExpandLegacyMappedPage + extends AbstractPage< + PagedExpandRequest, + PagedExpandLegacyMappedResponse, + Map.Entry, + PagedExpandLegacyMappedPage> { + + private PagedExpandLegacyMappedPage( + PageContext< + PagedExpandRequest, + PagedExpandLegacyMappedResponse, + Map.Entry> + context, + PagedExpandLegacyMappedResponse response) { + super(context, response); + } + + private static PagedExpandLegacyMappedPage createEmptyPage() { + return new PagedExpandLegacyMappedPage(null, null); + } + + @Override + protected PagedExpandLegacyMappedPage createPage( + PageContext< + PagedExpandRequest, + PagedExpandLegacyMappedResponse, + Map.Entry> + context, + PagedExpandLegacyMappedResponse response) { + return new PagedExpandLegacyMappedPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext< + PagedExpandRequest, + PagedExpandLegacyMappedResponse, + Map.Entry> + context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class PagedExpandLegacyMappedFixedSizeCollection + extends AbstractFixedSizeCollection< + PagedExpandRequest, + PagedExpandLegacyMappedResponse, + Map.Entry, + PagedExpandLegacyMappedPage, + PagedExpandLegacyMappedFixedSizeCollection> { + + private PagedExpandLegacyMappedFixedSizeCollection( + List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static PagedExpandLegacyMappedFixedSizeCollection createEmptyCollection() { + return new PagedExpandLegacyMappedFixedSizeCollection(null, 0); + } + + @Override + protected PagedExpandLegacyMappedFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new PagedExpandLegacyMappedFixedSizeCollection(pages, collectionSize); + } + } + + public static class ListLocationsPagedResponse + extends AbstractPagedListResponse< + ListLocationsRequest, + ListLocationsResponse, + Location, + ListLocationsPage, + ListLocationsFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListLocationsPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + input -> new ListLocationsPagedResponse(input), + MoreExecutors.directExecutor()); + } + + private ListLocationsPagedResponse(ListLocationsPage page) { + super(page, ListLocationsFixedSizeCollection.createEmptyCollection()); + } + } + + public static class ListLocationsPage + extends AbstractPage< + ListLocationsRequest, ListLocationsResponse, Location, ListLocationsPage> { + + private ListLocationsPage( + PageContext context, + ListLocationsResponse response) { + super(context, response); + } + + private static ListLocationsPage createEmptyPage() { + return new ListLocationsPage(null, null); + } + + @Override + protected ListLocationsPage createPage( + PageContext context, + ListLocationsResponse response) { + return new ListLocationsPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class ListLocationsFixedSizeCollection + extends AbstractFixedSizeCollection< + ListLocationsRequest, + ListLocationsResponse, + Location, + ListLocationsPage, + ListLocationsFixedSizeCollection> { + + private ListLocationsFixedSizeCollection(List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListLocationsFixedSizeCollection createEmptyCollection() { + return new ListLocationsFixedSizeCollection(null, 0); + } + + @Override + protected ListLocationsFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListLocationsFixedSizeCollection(pages, collectionSize); + } + } +} diff --git a/java-showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/EchoSettings.java b/java-showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/EchoSettings.java new file mode 100644 index 0000000000..e070b3fe7f --- /dev/null +++ b/java-showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/EchoSettings.java @@ -0,0 +1,438 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1; + +import static com.google.showcase.v1beta1.EchoClient.ListLocationsPagedResponse; +import static com.google.showcase.v1beta1.EchoClient.PagedExpandLegacyMappedPagedResponse; +import static com.google.showcase.v1beta1.EchoClient.PagedExpandPagedResponse; + +import com.google.api.core.ApiFunction; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; +import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; +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.ServerStreamingCallSettings; +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.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.longrunning.Operation; +import com.google.showcase.v1beta1.stub.EchoStubSettings; +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 EchoClient}. + * + *

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

          + *
        • The default service address (localhost) and default port (7469) 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 echo: + * + *

        {@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
        + * EchoSettings.Builder echoSettingsBuilder = EchoSettings.newBuilder();
        + * echoSettingsBuilder
        + *     .echoSettings()
        + *     .setRetrySettings(
        + *         echoSettingsBuilder
        + *             .echoSettings()
        + *             .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());
        + * EchoSettings echoSettings = echoSettingsBuilder.build();
        + * }
        + * + * Please refer to the [Client Side Retry + * Guide](https://docs.cloud.google.com/java/docs/client-retries) 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 wait: + * + *

        {@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
        + * EchoSettings.Builder echoSettingsBuilder = EchoSettings.newBuilder();
        + * TimedRetryAlgorithm timedRetryAlgorithm =
        + *     OperationalTimedPollAlgorithm.create(
        + *         RetrySettings.newBuilder()
        + *             .setInitialRetryDelayDuration(Duration.ofMillis(500))
        + *             .setRetryDelayMultiplier(1.5)
        + *             .setMaxRetryDelayDuration(Duration.ofMillis(5000))
        + *             .setTotalTimeoutDuration(Duration.ofHours(24))
        + *             .build());
        + * echoSettingsBuilder
        + *     .createClusterOperationSettings()
        + *     .setPollingAlgorithm(timedRetryAlgorithm)
        + *     .build();
        + * }
        + */ +@BetaApi +@Generated("by gapic-generator-java") +public class EchoSettings extends ClientSettings { + + /** Returns the object with the settings used for calls to echo. */ + public UnaryCallSettings echoSettings() { + return ((EchoStubSettings) getStubSettings()).echoSettings(); + } + + /** Returns the object with the settings used for calls to echoErrorDetails. */ + public UnaryCallSettings + echoErrorDetailsSettings() { + return ((EchoStubSettings) getStubSettings()).echoErrorDetailsSettings(); + } + + /** Returns the object with the settings used for calls to failEchoWithDetails. */ + public UnaryCallSettings + failEchoWithDetailsSettings() { + return ((EchoStubSettings) getStubSettings()).failEchoWithDetailsSettings(); + } + + /** Returns the object with the settings used for calls to expand. */ + public ServerStreamingCallSettings expandSettings() { + return ((EchoStubSettings) getStubSettings()).expandSettings(); + } + + /** Returns the object with the settings used for calls to collect. */ + public StreamingCallSettings collectSettings() { + return ((EchoStubSettings) getStubSettings()).collectSettings(); + } + + /** Returns the object with the settings used for calls to chat. */ + public StreamingCallSettings chatSettings() { + return ((EchoStubSettings) getStubSettings()).chatSettings(); + } + + /** Returns the object with the settings used for calls to pagedExpand. */ + public PagedCallSettings + pagedExpandSettings() { + return ((EchoStubSettings) getStubSettings()).pagedExpandSettings(); + } + + /** Returns the object with the settings used for calls to pagedExpandLegacy. */ + public UnaryCallSettings + pagedExpandLegacySettings() { + return ((EchoStubSettings) getStubSettings()).pagedExpandLegacySettings(); + } + + /** Returns the object with the settings used for calls to pagedExpandLegacyMapped. */ + public PagedCallSettings< + PagedExpandRequest, PagedExpandLegacyMappedResponse, PagedExpandLegacyMappedPagedResponse> + pagedExpandLegacyMappedSettings() { + return ((EchoStubSettings) getStubSettings()).pagedExpandLegacyMappedSettings(); + } + + /** Returns the object with the settings used for calls to wait. */ + public UnaryCallSettings waitSettings() { + return ((EchoStubSettings) getStubSettings()).waitSettings(); + } + + /** Returns the object with the settings used for calls to wait. */ + public OperationCallSettings waitOperationSettings() { + return ((EchoStubSettings) getStubSettings()).waitOperationSettings(); + } + + /** Returns the object with the settings used for calls to block. */ + public UnaryCallSettings blockSettings() { + return ((EchoStubSettings) getStubSettings()).blockSettings(); + } + + /** Returns the object with the settings used for calls to listLocations. */ + public PagedCallSettings + listLocationsSettings() { + return ((EchoStubSettings) getStubSettings()).listLocationsSettings(); + } + + /** Returns the object with the settings used for calls to getLocation. */ + public UnaryCallSettings getLocationSettings() { + return ((EchoStubSettings) getStubSettings()).getLocationSettings(); + } + + /** Returns the object with the settings used for calls to setIamPolicy. */ + public UnaryCallSettings setIamPolicySettings() { + return ((EchoStubSettings) getStubSettings()).setIamPolicySettings(); + } + + /** Returns the object with the settings used for calls to getIamPolicy. */ + public UnaryCallSettings getIamPolicySettings() { + return ((EchoStubSettings) getStubSettings()).getIamPolicySettings(); + } + + /** Returns the object with the settings used for calls to testIamPermissions. */ + public UnaryCallSettings + testIamPermissionsSettings() { + return ((EchoStubSettings) getStubSettings()).testIamPermissionsSettings(); + } + + public static final EchoSettings create(EchoStubSettings stub) throws IOException { + return new EchoSettings.Builder(stub.toBuilder()).build(); + } + + /** Returns a builder for the default ExecutorProvider for this service. */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return EchoStubSettings.defaultExecutorProviderBuilder(); + } + + /** Returns the default service endpoint. */ + public static String getDefaultEndpoint() { + return EchoStubSettings.getDefaultEndpoint(); + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return EchoStubSettings.getDefaultServiceScopes(); + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return EchoStubSettings.defaultCredentialsProviderBuilder(); + } + + /** Returns a builder for the default gRPC ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return EchoStubSettings.defaultGrpcTransportProviderBuilder(); + } + + /** Returns a builder for the default REST ChannelProvider for this service. */ + @BetaApi + public static InstantiatingHttpJsonChannelProvider.Builder + defaultHttpJsonTransportProviderBuilder() { + return EchoStubSettings.defaultHttpJsonTransportProviderBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return EchoStubSettings.defaultTransportChannelProvider(); + } + + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return EchoStubSettings.defaultApiClientHeaderProviderBuilder(); + } + + /** Returns a new gRPC builder for this class. */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** Returns a new REST builder for this class. */ + public static Builder newHttpJsonBuilder() { + return Builder.createHttpJsonDefault(); + } + + /** 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 EchoSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + } + + /** Builder for EchoSettings. */ + public static class Builder extends ClientSettings.Builder { + + protected Builder() throws IOException { + this(((ClientContext) null)); + } + + protected Builder(ClientContext clientContext) { + super(EchoStubSettings.newBuilder(clientContext)); + } + + protected Builder(EchoSettings settings) { + super(settings.getStubSettings().toBuilder()); + } + + protected Builder(EchoStubSettings.Builder stubSettings) { + super(stubSettings); + } + + private static Builder createDefault() { + return new Builder(EchoStubSettings.newBuilder()); + } + + private static Builder createHttpJsonDefault() { + return new Builder(EchoStubSettings.newHttpJsonBuilder()); + } + + public EchoStubSettings.Builder getStubSettingsBuilder() { + return ((EchoStubSettings.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 echo. */ + public UnaryCallSettings.Builder echoSettings() { + return getStubSettingsBuilder().echoSettings(); + } + + /** Returns the builder for the settings used for calls to echoErrorDetails. */ + public UnaryCallSettings.Builder + echoErrorDetailsSettings() { + return getStubSettingsBuilder().echoErrorDetailsSettings(); + } + + /** Returns the builder for the settings used for calls to failEchoWithDetails. */ + public UnaryCallSettings.Builder + failEchoWithDetailsSettings() { + return getStubSettingsBuilder().failEchoWithDetailsSettings(); + } + + /** Returns the builder for the settings used for calls to expand. */ + public ServerStreamingCallSettings.Builder expandSettings() { + return getStubSettingsBuilder().expandSettings(); + } + + /** Returns the builder for the settings used for calls to collect. */ + public StreamingCallSettings.Builder collectSettings() { + return getStubSettingsBuilder().collectSettings(); + } + + /** Returns the builder for the settings used for calls to chat. */ + public StreamingCallSettings.Builder chatSettings() { + return getStubSettingsBuilder().chatSettings(); + } + + /** Returns the builder for the settings used for calls to pagedExpand. */ + public PagedCallSettings.Builder< + PagedExpandRequest, PagedExpandResponse, PagedExpandPagedResponse> + pagedExpandSettings() { + return getStubSettingsBuilder().pagedExpandSettings(); + } + + /** Returns the builder for the settings used for calls to pagedExpandLegacy. */ + public UnaryCallSettings.Builder + pagedExpandLegacySettings() { + return getStubSettingsBuilder().pagedExpandLegacySettings(); + } + + /** Returns the builder for the settings used for calls to pagedExpandLegacyMapped. */ + public PagedCallSettings.Builder< + PagedExpandRequest, + PagedExpandLegacyMappedResponse, + PagedExpandLegacyMappedPagedResponse> + pagedExpandLegacyMappedSettings() { + return getStubSettingsBuilder().pagedExpandLegacyMappedSettings(); + } + + /** Returns the builder for the settings used for calls to wait. */ + public UnaryCallSettings.Builder waitSettings() { + return getStubSettingsBuilder().waitSettings(); + } + + /** Returns the builder for the settings used for calls to wait. */ + public OperationCallSettings.Builder + waitOperationSettings() { + return getStubSettingsBuilder().waitOperationSettings(); + } + + /** Returns the builder for the settings used for calls to block. */ + public UnaryCallSettings.Builder blockSettings() { + return getStubSettingsBuilder().blockSettings(); + } + + /** Returns the builder for the settings used for calls to listLocations. */ + public PagedCallSettings.Builder< + ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse> + listLocationsSettings() { + return getStubSettingsBuilder().listLocationsSettings(); + } + + /** Returns the builder for the settings used for calls to getLocation. */ + public UnaryCallSettings.Builder getLocationSettings() { + return getStubSettingsBuilder().getLocationSettings(); + } + + /** Returns the builder for the settings used for calls to setIamPolicy. */ + public UnaryCallSettings.Builder setIamPolicySettings() { + return getStubSettingsBuilder().setIamPolicySettings(); + } + + /** Returns the builder for the settings used for calls to getIamPolicy. */ + public UnaryCallSettings.Builder getIamPolicySettings() { + return getStubSettingsBuilder().getIamPolicySettings(); + } + + /** Returns the builder for the settings used for calls to testIamPermissions. */ + public UnaryCallSettings.Builder + testIamPermissionsSettings() { + return getStubSettingsBuilder().testIamPermissionsSettings(); + } + + @Override + public EchoSettings build() throws IOException { + return new EchoSettings(this); + } + } +} diff --git a/java-showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/IdentityClient.java b/java-showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/IdentityClient.java new file mode 100644 index 0000000000..dfa80e1a7f --- /dev/null +++ b/java-showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/IdentityClient.java @@ -0,0 +1,1358 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1; + +import com.google.api.core.ApiFuture; +import com.google.api.core.ApiFutures; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.paging.AbstractFixedSizeCollection; +import com.google.api.gax.paging.AbstractPage; +import com.google.api.gax.paging.AbstractPagedListResponse; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.common.util.concurrent.MoreExecutors; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.protobuf.Empty; +import com.google.showcase.v1beta1.stub.IdentityStub; +import com.google.showcase.v1beta1.stub.IdentityStubSettings; +import java.io.IOException; +import java.util.List; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Service Description: A simple identity service. + * + *

        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 (IdentityClient identityClient = IdentityClient.create()) {
        + *   String displayName = "displayName1714148973";
        + *   String email = "email96619420";
        + *   User response = identityClient.createUser(displayName, email);
        + * }
        + * }
        + * + *

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

        CreateUser

        Creates a user.

        + *

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

        + *
          + *
        • createUser(CreateUserRequest request) + *

        + *

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

        + *
          + *
        • createUser(String displayName, String email) + *

        • createUser(String displayName, String email, int age, String nickname, boolean enableNotifications, double heightFeet) + *

        + *

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

        + *
          + *
        • createUserCallable() + *

        + *

        GetUser

        Retrieves the User with the given uri.

        + *

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

        + *
          + *
        • getUser(GetUserRequest request) + *

        + *

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

        + *
          + *
        • getUser(UserName name) + *

        • getUser(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.

        + *
          + *
        • getUserCallable() + *

        + *

        UpdateUser

        Updates a user.

        + *

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

        + *
          + *
        • updateUser(UpdateUserRequest request) + *

        + *

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

        + *
          + *
        • updateUserCallable() + *

        + *

        DeleteUser

        Deletes a user, their profile, and all of their authored messages.

        + *

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

        + *
          + *
        • deleteUser(DeleteUserRequest request) + *

        + *

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

        + *
          + *
        • deleteUser(UserName name) + *

        • deleteUser(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.

        + *
          + *
        • deleteUserCallable() + *

        + *

        ListUsers

        Lists all users.

        + *

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

        + *
          + *
        • listUsers(ListUsersRequest request) + *

        + *

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

        + *
          + *
        • listUsersPagedCallable() + *

        • listUsersCallable() + *

        + *

        ListLocations

        Lists information about the supported locations for this service.

        + *

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

        + *
          + *
        • listLocations(ListLocationsRequest request) + *

        + *

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

        + *
          + *
        • listLocationsPagedCallable() + *

        • listLocationsCallable() + *

        + *

        GetLocation

        Gets information about a location.

        + *

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

        + *
          + *
        • getLocation(GetLocationRequest request) + *

        + *

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

        + *
          + *
        • getLocationCallable() + *

        + *

        SetIamPolicy

        Sets the access control policy on the specified resource. Replaces any existing policy. + *

        Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED` errors.

        + *

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

        + *
          + *
        • setIamPolicy(SetIamPolicyRequest request) + *

        + *

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

        + *
          + *
        • setIamPolicyCallable() + *

        + *

        GetIamPolicy

        Gets the access control policy for a resource. Returns an empty policy if the resource exists and does not have a policy set.

        + *

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

        + *
          + *
        • getIamPolicy(GetIamPolicyRequest request) + *

        + *

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

        + *
          + *
        • getIamPolicyCallable() + *

        + *

        TestIamPermissions

        Returns permissions that a caller has on the specified resource. If the resource does not exist, this will return an empty set of permissions, not a `NOT_FOUND` error. + *

        Note: This operation is designed to be used for building permission-aware UIs and command-line tools, not for authorization checking. This operation may "fail open" without warning.

        + *

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

        + *
          + *
        • testIamPermissions(TestIamPermissionsRequest request) + *

        + *

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

        + *
          + *
        • testIamPermissionsCallable() + *

        + *
        + * + *

        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 IdentitySettings 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
        + * IdentitySettings identitySettings =
        + *     IdentitySettings.newBuilder()
        + *         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
        + *         .build();
        + * IdentityClient identityClient = IdentityClient.create(identitySettings);
        + * }
        + * + *

        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
        + * IdentitySettings identitySettings =
        + *     IdentitySettings.newBuilder().setEndpoint(myEndpoint).build();
        + * IdentityClient identityClient = IdentityClient.create(identitySettings);
        + * }
        + * + *

        To use REST (HTTP1.1/JSON) transport (instead of gRPC) for sending and receiving requests over + * the wire: + * + *

        {@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
        + * IdentitySettings identitySettings = IdentitySettings.newHttpJsonBuilder().build();
        + * IdentityClient identityClient = IdentityClient.create(identitySettings);
        + * }
        + * + *

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

        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 (IdentityClient identityClient = IdentityClient.create()) {
        +   *   String displayName = "displayName1714148973";
        +   *   String email = "email96619420";
        +   *   User response = identityClient.createUser(displayName, email);
        +   * }
        +   * }
        + * + * @param displayName The display_name of the user. + * @param email The email address of the user. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final User createUser(String displayName, String email) { + CreateUserRequest request = + CreateUserRequest.newBuilder() + .setUser(User.newBuilder().setDisplayName(displayName).setEmail(email).build()) + .build(); + return createUser(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a user. + * + *

        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 (IdentityClient identityClient = IdentityClient.create()) {
        +   *   String displayName = "displayName1714148973";
        +   *   String email = "email96619420";
        +   *   int age = 96511;
        +   *   String nickname = "nickname70690926";
        +   *   boolean enableNotifications = true;
        +   *   double heightFeet = -1032737338;
        +   *   User response =
        +   *       identityClient.createUser(
        +   *           displayName, email, age, nickname, enableNotifications, heightFeet);
        +   * }
        +   * }
        + * + * @param displayName The display_name of the user. + * @param email The email address of the user. + * @param age The age of the user in years. + * @param nickname The nickname of the user. + *

        (-- aip.dev/not-precedent: An empty string is a valid nickname. Ordinarily, + * proto3_optional should not be used on a `string` field. --) + * @param enableNotifications Enables the receiving of notifications. The default is true if + * unset. + *

        (-- aip.dev/not-precedent: The default for the feature is true. Ordinarily, the default + * for a `bool` field should be false. --) + * @param heightFeet The height of the user in feet. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final User createUser( + String displayName, + String email, + int age, + String nickname, + boolean enableNotifications, + double heightFeet) { + CreateUserRequest request = + CreateUserRequest.newBuilder() + .setUser( + User.newBuilder() + .setDisplayName(displayName) + .setEmail(email) + .setAge(age) + .setNickname(nickname) + .setEnableNotifications(enableNotifications) + .setHeightFeet(heightFeet) + .build()) + .build(); + return createUser(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a user. + * + *

        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 (IdentityClient identityClient = IdentityClient.create()) {
        +   *   CreateUserRequest request =
        +   *       CreateUserRequest.newBuilder().setUser(User.newBuilder().build()).build();
        +   *   User response = identityClient.createUser(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 User createUser(CreateUserRequest request) { + return createUserCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a user. + * + *

        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 (IdentityClient identityClient = IdentityClient.create()) {
        +   *   CreateUserRequest request =
        +   *       CreateUserRequest.newBuilder().setUser(User.newBuilder().build()).build();
        +   *   ApiFuture future = identityClient.createUserCallable().futureCall(request);
        +   *   // Do something.
        +   *   User response = future.get();
        +   * }
        +   * }
        + */ + public final UnaryCallable createUserCallable() { + return stub.createUserCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Retrieves the User with the given uri. + * + *

        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 (IdentityClient identityClient = IdentityClient.create()) {
        +   *   UserName name = UserName.of("[USER]");
        +   *   User response = identityClient.getUser(name);
        +   * }
        +   * }
        + * + * @param name The resource name of the requested user. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final User getUser(UserName name) { + GetUserRequest request = + GetUserRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + return getUser(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Retrieves the User with the given uri. + * + *

        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 (IdentityClient identityClient = IdentityClient.create()) {
        +   *   String name = UserName.of("[USER]").toString();
        +   *   User response = identityClient.getUser(name);
        +   * }
        +   * }
        + * + * @param name The resource name of the requested user. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final User getUser(String name) { + GetUserRequest request = GetUserRequest.newBuilder().setName(name).build(); + return getUser(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Retrieves the User with the given uri. + * + *

        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 (IdentityClient identityClient = IdentityClient.create()) {
        +   *   GetUserRequest request =
        +   *       GetUserRequest.newBuilder().setName(UserName.of("[USER]").toString()).build();
        +   *   User response = identityClient.getUser(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 User getUser(GetUserRequest request) { + return getUserCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Retrieves the User with the given uri. + * + *

        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 (IdentityClient identityClient = IdentityClient.create()) {
        +   *   GetUserRequest request =
        +   *       GetUserRequest.newBuilder().setName(UserName.of("[USER]").toString()).build();
        +   *   ApiFuture future = identityClient.getUserCallable().futureCall(request);
        +   *   // Do something.
        +   *   User response = future.get();
        +   * }
        +   * }
        + */ + public final UnaryCallable getUserCallable() { + return stub.getUserCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates a user. + * + *

        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 (IdentityClient identityClient = IdentityClient.create()) {
        +   *   UpdateUserRequest request =
        +   *       UpdateUserRequest.newBuilder()
        +   *           .setUser(User.newBuilder().build())
        +   *           .setUpdateMask(FieldMask.newBuilder().build())
        +   *           .build();
        +   *   User response = identityClient.updateUser(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 User updateUser(UpdateUserRequest request) { + return updateUserCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates a user. + * + *

        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 (IdentityClient identityClient = IdentityClient.create()) {
        +   *   UpdateUserRequest request =
        +   *       UpdateUserRequest.newBuilder()
        +   *           .setUser(User.newBuilder().build())
        +   *           .setUpdateMask(FieldMask.newBuilder().build())
        +   *           .build();
        +   *   ApiFuture future = identityClient.updateUserCallable().futureCall(request);
        +   *   // Do something.
        +   *   User response = future.get();
        +   * }
        +   * }
        + */ + public final UnaryCallable updateUserCallable() { + return stub.updateUserCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a user, their profile, and all of their authored messages. + * + *

        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 (IdentityClient identityClient = IdentityClient.create()) {
        +   *   UserName name = UserName.of("[USER]");
        +   *   identityClient.deleteUser(name);
        +   * }
        +   * }
        + * + * @param name The resource name of the user to delete. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final void deleteUser(UserName name) { + DeleteUserRequest request = + DeleteUserRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + deleteUser(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a user, their profile, and all of their authored messages. + * + *

        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 (IdentityClient identityClient = IdentityClient.create()) {
        +   *   String name = UserName.of("[USER]").toString();
        +   *   identityClient.deleteUser(name);
        +   * }
        +   * }
        + * + * @param name The resource name of the user to delete. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final void deleteUser(String name) { + DeleteUserRequest request = DeleteUserRequest.newBuilder().setName(name).build(); + deleteUser(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a user, their profile, and all of their authored messages. + * + *

        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 (IdentityClient identityClient = IdentityClient.create()) {
        +   *   DeleteUserRequest request =
        +   *       DeleteUserRequest.newBuilder().setName(UserName.of("[USER]").toString()).build();
        +   *   identityClient.deleteUser(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 deleteUser(DeleteUserRequest request) { + deleteUserCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a user, their profile, and all of their authored messages. + * + *

        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 (IdentityClient identityClient = IdentityClient.create()) {
        +   *   DeleteUserRequest request =
        +   *       DeleteUserRequest.newBuilder().setName(UserName.of("[USER]").toString()).build();
        +   *   ApiFuture future = identityClient.deleteUserCallable().futureCall(request);
        +   *   // Do something.
        +   *   future.get();
        +   * }
        +   * }
        + */ + public final UnaryCallable deleteUserCallable() { + return stub.deleteUserCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists all users. + * + *

        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 (IdentityClient identityClient = IdentityClient.create()) {
        +   *   ListUsersRequest request =
        +   *       ListUsersRequest.newBuilder()
        +   *           .setPageSize(883849137)
        +   *           .setPageToken("pageToken873572522")
        +   *           .build();
        +   *   for (User element : identityClient.listUsers(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 ListUsersPagedResponse listUsers(ListUsersRequest request) { + return listUsersPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists all users. + * + *

        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 (IdentityClient identityClient = IdentityClient.create()) {
        +   *   ListUsersRequest request =
        +   *       ListUsersRequest.newBuilder()
        +   *           .setPageSize(883849137)
        +   *           .setPageToken("pageToken873572522")
        +   *           .build();
        +   *   ApiFuture future = identityClient.listUsersPagedCallable().futureCall(request);
        +   *   // Do something.
        +   *   for (User element : future.get().iterateAll()) {
        +   *     // doThingsWith(element);
        +   *   }
        +   * }
        +   * }
        + */ + public final UnaryCallable listUsersPagedCallable() { + return stub.listUsersPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists all users. + * + *

        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 (IdentityClient identityClient = IdentityClient.create()) {
        +   *   ListUsersRequest request =
        +   *       ListUsersRequest.newBuilder()
        +   *           .setPageSize(883849137)
        +   *           .setPageToken("pageToken873572522")
        +   *           .build();
        +   *   while (true) {
        +   *     ListUsersResponse response = identityClient.listUsersCallable().call(request);
        +   *     for (User element : response.getUsersList()) {
        +   *       // doThingsWith(element);
        +   *     }
        +   *     String nextPageToken = response.getNextPageToken();
        +   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
        +   *       request = request.toBuilder().setPageToken(nextPageToken).build();
        +   *     } else {
        +   *       break;
        +   *     }
        +   *   }
        +   * }
        +   * }
        + */ + public final UnaryCallable listUsersCallable() { + return stub.listUsersCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists information about the supported locations for this service. + * + *

        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 (IdentityClient identityClient = IdentityClient.create()) {
        +   *   ListLocationsRequest request =
        +   *       ListLocationsRequest.newBuilder()
        +   *           .setName("name3373707")
        +   *           .setFilter("filter-1274492040")
        +   *           .setPageSize(883849137)
        +   *           .setPageToken("pageToken873572522")
        +   *           .build();
        +   *   for (Location element : identityClient.listLocations(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 ListLocationsPagedResponse listLocations(ListLocationsRequest request) { + return listLocationsPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists information about the supported locations for this service. + * + *

        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 (IdentityClient identityClient = IdentityClient.create()) {
        +   *   ListLocationsRequest request =
        +   *       ListLocationsRequest.newBuilder()
        +   *           .setName("name3373707")
        +   *           .setFilter("filter-1274492040")
        +   *           .setPageSize(883849137)
        +   *           .setPageToken("pageToken873572522")
        +   *           .build();
        +   *   ApiFuture future = identityClient.listLocationsPagedCallable().futureCall(request);
        +   *   // Do something.
        +   *   for (Location element : future.get().iterateAll()) {
        +   *     // doThingsWith(element);
        +   *   }
        +   * }
        +   * }
        + */ + public final UnaryCallable + listLocationsPagedCallable() { + return stub.listLocationsPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists information about the supported locations for this service. + * + *

        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 (IdentityClient identityClient = IdentityClient.create()) {
        +   *   ListLocationsRequest request =
        +   *       ListLocationsRequest.newBuilder()
        +   *           .setName("name3373707")
        +   *           .setFilter("filter-1274492040")
        +   *           .setPageSize(883849137)
        +   *           .setPageToken("pageToken873572522")
        +   *           .build();
        +   *   while (true) {
        +   *     ListLocationsResponse response = identityClient.listLocationsCallable().call(request);
        +   *     for (Location element : response.getLocationsList()) {
        +   *       // doThingsWith(element);
        +   *     }
        +   *     String nextPageToken = response.getNextPageToken();
        +   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
        +   *       request = request.toBuilder().setPageToken(nextPageToken).build();
        +   *     } else {
        +   *       break;
        +   *     }
        +   *   }
        +   * }
        +   * }
        + */ + public final UnaryCallable listLocationsCallable() { + return stub.listLocationsCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets information about a location. + * + *

        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 (IdentityClient identityClient = IdentityClient.create()) {
        +   *   GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build();
        +   *   Location response = identityClient.getLocation(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 Location getLocation(GetLocationRequest request) { + return getLocationCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets information about a location. + * + *

        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 (IdentityClient identityClient = IdentityClient.create()) {
        +   *   GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build();
        +   *   ApiFuture future = identityClient.getLocationCallable().futureCall(request);
        +   *   // Do something.
        +   *   Location response = future.get();
        +   * }
        +   * }
        + */ + public final UnaryCallable getLocationCallable() { + return stub.getLocationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Sets the access control policy on the specified resource. Replaces any existing policy. + * + *

        Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED` errors. + * + *

        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 (IdentityClient identityClient = IdentityClient.create()) {
        +   *   SetIamPolicyRequest request =
        +   *       SetIamPolicyRequest.newBuilder()
        +   *           .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString())
        +   *           .setPolicy(Policy.newBuilder().build())
        +   *           .setUpdateMask(FieldMask.newBuilder().build())
        +   *           .build();
        +   *   Policy response = identityClient.setIamPolicy(request);
        +   * }
        +   * }
        + * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Policy setIamPolicy(SetIamPolicyRequest request) { + return setIamPolicyCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Sets the access control policy on the specified resource. Replaces any existing policy. + * + *

        Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED` errors. + * + *

        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 (IdentityClient identityClient = IdentityClient.create()) {
        +   *   SetIamPolicyRequest request =
        +   *       SetIamPolicyRequest.newBuilder()
        +   *           .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString())
        +   *           .setPolicy(Policy.newBuilder().build())
        +   *           .setUpdateMask(FieldMask.newBuilder().build())
        +   *           .build();
        +   *   ApiFuture future = identityClient.setIamPolicyCallable().futureCall(request);
        +   *   // Do something.
        +   *   Policy response = future.get();
        +   * }
        +   * }
        + */ + public final UnaryCallable setIamPolicyCallable() { + return stub.setIamPolicyCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets the access control policy for a resource. Returns an empty policy if the resource exists + * and does not have a policy set. + * + *

        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 (IdentityClient identityClient = IdentityClient.create()) {
        +   *   GetIamPolicyRequest request =
        +   *       GetIamPolicyRequest.newBuilder()
        +   *           .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString())
        +   *           .setOptions(GetPolicyOptions.newBuilder().build())
        +   *           .build();
        +   *   Policy response = identityClient.getIamPolicy(request);
        +   * }
        +   * }
        + * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Policy getIamPolicy(GetIamPolicyRequest request) { + return getIamPolicyCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets the access control policy for a resource. Returns an empty policy if the resource exists + * and does not have a policy set. + * + *

        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 (IdentityClient identityClient = IdentityClient.create()) {
        +   *   GetIamPolicyRequest request =
        +   *       GetIamPolicyRequest.newBuilder()
        +   *           .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString())
        +   *           .setOptions(GetPolicyOptions.newBuilder().build())
        +   *           .build();
        +   *   ApiFuture future = identityClient.getIamPolicyCallable().futureCall(request);
        +   *   // Do something.
        +   *   Policy response = future.get();
        +   * }
        +   * }
        + */ + public final UnaryCallable getIamPolicyCallable() { + return stub.getIamPolicyCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Returns permissions that a caller has on the specified resource. If the resource does not + * exist, this will return an empty set of permissions, not a `NOT_FOUND` error. + * + *

        Note: This operation is designed to be used for building permission-aware UIs and + * command-line tools, not for authorization checking. This operation may "fail open" without + * warning. + * + *

        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 (IdentityClient identityClient = IdentityClient.create()) {
        +   *   TestIamPermissionsRequest request =
        +   *       TestIamPermissionsRequest.newBuilder()
        +   *           .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString())
        +   *           .addAllPermissions(new ArrayList())
        +   *           .build();
        +   *   TestIamPermissionsResponse response = identityClient.testIamPermissions(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 TestIamPermissionsResponse testIamPermissions(TestIamPermissionsRequest request) { + return testIamPermissionsCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Returns permissions that a caller has on the specified resource. If the resource does not + * exist, this will return an empty set of permissions, not a `NOT_FOUND` error. + * + *

        Note: This operation is designed to be used for building permission-aware UIs and + * command-line tools, not for authorization checking. This operation may "fail open" without + * warning. + * + *

        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 (IdentityClient identityClient = IdentityClient.create()) {
        +   *   TestIamPermissionsRequest request =
        +   *       TestIamPermissionsRequest.newBuilder()
        +   *           .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString())
        +   *           .addAllPermissions(new ArrayList())
        +   *           .build();
        +   *   ApiFuture future =
        +   *       identityClient.testIamPermissionsCallable().futureCall(request);
        +   *   // Do something.
        +   *   TestIamPermissionsResponse response = future.get();
        +   * }
        +   * }
        + */ + public final UnaryCallable + testIamPermissionsCallable() { + return stub.testIamPermissionsCallable(); + } + + @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 ListUsersPagedResponse + extends AbstractPagedListResponse< + ListUsersRequest, ListUsersResponse, User, ListUsersPage, ListUsersFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListUsersPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, input -> new ListUsersPagedResponse(input), MoreExecutors.directExecutor()); + } + + private ListUsersPagedResponse(ListUsersPage page) { + super(page, ListUsersFixedSizeCollection.createEmptyCollection()); + } + } + + public static class ListUsersPage + extends AbstractPage { + + private ListUsersPage( + PageContext context, + ListUsersResponse response) { + super(context, response); + } + + private static ListUsersPage createEmptyPage() { + return new ListUsersPage(null, null); + } + + @Override + protected ListUsersPage createPage( + PageContext context, + ListUsersResponse response) { + return new ListUsersPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class ListUsersFixedSizeCollection + extends AbstractFixedSizeCollection< + ListUsersRequest, ListUsersResponse, User, ListUsersPage, ListUsersFixedSizeCollection> { + + private ListUsersFixedSizeCollection(List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListUsersFixedSizeCollection createEmptyCollection() { + return new ListUsersFixedSizeCollection(null, 0); + } + + @Override + protected ListUsersFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListUsersFixedSizeCollection(pages, collectionSize); + } + } + + public static class ListLocationsPagedResponse + extends AbstractPagedListResponse< + ListLocationsRequest, + ListLocationsResponse, + Location, + ListLocationsPage, + ListLocationsFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListLocationsPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + input -> new ListLocationsPagedResponse(input), + MoreExecutors.directExecutor()); + } + + private ListLocationsPagedResponse(ListLocationsPage page) { + super(page, ListLocationsFixedSizeCollection.createEmptyCollection()); + } + } + + public static class ListLocationsPage + extends AbstractPage< + ListLocationsRequest, ListLocationsResponse, Location, ListLocationsPage> { + + private ListLocationsPage( + PageContext context, + ListLocationsResponse response) { + super(context, response); + } + + private static ListLocationsPage createEmptyPage() { + return new ListLocationsPage(null, null); + } + + @Override + protected ListLocationsPage createPage( + PageContext context, + ListLocationsResponse response) { + return new ListLocationsPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class ListLocationsFixedSizeCollection + extends AbstractFixedSizeCollection< + ListLocationsRequest, + ListLocationsResponse, + Location, + ListLocationsPage, + ListLocationsFixedSizeCollection> { + + private ListLocationsFixedSizeCollection(List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListLocationsFixedSizeCollection createEmptyCollection() { + return new ListLocationsFixedSizeCollection(null, 0); + } + + @Override + protected ListLocationsFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListLocationsFixedSizeCollection(pages, collectionSize); + } + } +} diff --git a/java-showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/IdentitySettings.java b/java-showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/IdentitySettings.java new file mode 100644 index 0000000000..f998c45023 --- /dev/null +++ b/java-showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/IdentitySettings.java @@ -0,0 +1,325 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1; + +import static com.google.showcase.v1beta1.IdentityClient.ListLocationsPagedResponse; +import static com.google.showcase.v1beta1.IdentityClient.ListUsersPagedResponse; + +import com.google.api.core.ApiFunction; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; +import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; +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.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.protobuf.Empty; +import com.google.showcase.v1beta1.stub.IdentityStubSettings; +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 IdentityClient}. + * + *

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

          + *
        • The default service address (localhost) and default port (7469) 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 createUser: + * + *

        {@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
        + * IdentitySettings.Builder identitySettingsBuilder = IdentitySettings.newBuilder();
        + * identitySettingsBuilder
        + *     .createUserSettings()
        + *     .setRetrySettings(
        + *         identitySettingsBuilder
        + *             .createUserSettings()
        + *             .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());
        + * IdentitySettings identitySettings = identitySettingsBuilder.build();
        + * }
        + * + * Please refer to the [Client Side Retry + * Guide](https://docs.cloud.google.com/java/docs/client-retries) for additional support in setting + * retries. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class IdentitySettings extends ClientSettings { + + /** Returns the object with the settings used for calls to createUser. */ + public UnaryCallSettings createUserSettings() { + return ((IdentityStubSettings) getStubSettings()).createUserSettings(); + } + + /** Returns the object with the settings used for calls to getUser. */ + public UnaryCallSettings getUserSettings() { + return ((IdentityStubSettings) getStubSettings()).getUserSettings(); + } + + /** Returns the object with the settings used for calls to updateUser. */ + public UnaryCallSettings updateUserSettings() { + return ((IdentityStubSettings) getStubSettings()).updateUserSettings(); + } + + /** Returns the object with the settings used for calls to deleteUser. */ + public UnaryCallSettings deleteUserSettings() { + return ((IdentityStubSettings) getStubSettings()).deleteUserSettings(); + } + + /** Returns the object with the settings used for calls to listUsers. */ + public PagedCallSettings + listUsersSettings() { + return ((IdentityStubSettings) getStubSettings()).listUsersSettings(); + } + + /** Returns the object with the settings used for calls to listLocations. */ + public PagedCallSettings + listLocationsSettings() { + return ((IdentityStubSettings) getStubSettings()).listLocationsSettings(); + } + + /** Returns the object with the settings used for calls to getLocation. */ + public UnaryCallSettings getLocationSettings() { + return ((IdentityStubSettings) getStubSettings()).getLocationSettings(); + } + + /** Returns the object with the settings used for calls to setIamPolicy. */ + public UnaryCallSettings setIamPolicySettings() { + return ((IdentityStubSettings) getStubSettings()).setIamPolicySettings(); + } + + /** Returns the object with the settings used for calls to getIamPolicy. */ + public UnaryCallSettings getIamPolicySettings() { + return ((IdentityStubSettings) getStubSettings()).getIamPolicySettings(); + } + + /** Returns the object with the settings used for calls to testIamPermissions. */ + public UnaryCallSettings + testIamPermissionsSettings() { + return ((IdentityStubSettings) getStubSettings()).testIamPermissionsSettings(); + } + + public static final IdentitySettings create(IdentityStubSettings stub) throws IOException { + return new IdentitySettings.Builder(stub.toBuilder()).build(); + } + + /** Returns a builder for the default ExecutorProvider for this service. */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return IdentityStubSettings.defaultExecutorProviderBuilder(); + } + + /** Returns the default service endpoint. */ + public static String getDefaultEndpoint() { + return IdentityStubSettings.getDefaultEndpoint(); + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return IdentityStubSettings.getDefaultServiceScopes(); + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return IdentityStubSettings.defaultCredentialsProviderBuilder(); + } + + /** Returns a builder for the default gRPC ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return IdentityStubSettings.defaultGrpcTransportProviderBuilder(); + } + + /** Returns a builder for the default REST ChannelProvider for this service. */ + @BetaApi + public static InstantiatingHttpJsonChannelProvider.Builder + defaultHttpJsonTransportProviderBuilder() { + return IdentityStubSettings.defaultHttpJsonTransportProviderBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return IdentityStubSettings.defaultTransportChannelProvider(); + } + + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return IdentityStubSettings.defaultApiClientHeaderProviderBuilder(); + } + + /** Returns a new gRPC builder for this class. */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** Returns a new REST builder for this class. */ + public static Builder newHttpJsonBuilder() { + return Builder.createHttpJsonDefault(); + } + + /** 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 IdentitySettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + } + + /** Builder for IdentitySettings. */ + public static class Builder extends ClientSettings.Builder { + + protected Builder() throws IOException { + this(((ClientContext) null)); + } + + protected Builder(ClientContext clientContext) { + super(IdentityStubSettings.newBuilder(clientContext)); + } + + protected Builder(IdentitySettings settings) { + super(settings.getStubSettings().toBuilder()); + } + + protected Builder(IdentityStubSettings.Builder stubSettings) { + super(stubSettings); + } + + private static Builder createDefault() { + return new Builder(IdentityStubSettings.newBuilder()); + } + + private static Builder createHttpJsonDefault() { + return new Builder(IdentityStubSettings.newHttpJsonBuilder()); + } + + public IdentityStubSettings.Builder getStubSettingsBuilder() { + return ((IdentityStubSettings.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 createUser. */ + public UnaryCallSettings.Builder createUserSettings() { + return getStubSettingsBuilder().createUserSettings(); + } + + /** Returns the builder for the settings used for calls to getUser. */ + public UnaryCallSettings.Builder getUserSettings() { + return getStubSettingsBuilder().getUserSettings(); + } + + /** Returns the builder for the settings used for calls to updateUser. */ + public UnaryCallSettings.Builder updateUserSettings() { + return getStubSettingsBuilder().updateUserSettings(); + } + + /** Returns the builder for the settings used for calls to deleteUser. */ + public UnaryCallSettings.Builder deleteUserSettings() { + return getStubSettingsBuilder().deleteUserSettings(); + } + + /** Returns the builder for the settings used for calls to listUsers. */ + public PagedCallSettings.Builder + listUsersSettings() { + return getStubSettingsBuilder().listUsersSettings(); + } + + /** Returns the builder for the settings used for calls to listLocations. */ + public PagedCallSettings.Builder< + ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse> + listLocationsSettings() { + return getStubSettingsBuilder().listLocationsSettings(); + } + + /** Returns the builder for the settings used for calls to getLocation. */ + public UnaryCallSettings.Builder getLocationSettings() { + return getStubSettingsBuilder().getLocationSettings(); + } + + /** Returns the builder for the settings used for calls to setIamPolicy. */ + public UnaryCallSettings.Builder setIamPolicySettings() { + return getStubSettingsBuilder().setIamPolicySettings(); + } + + /** Returns the builder for the settings used for calls to getIamPolicy. */ + public UnaryCallSettings.Builder getIamPolicySettings() { + return getStubSettingsBuilder().getIamPolicySettings(); + } + + /** Returns the builder for the settings used for calls to testIamPermissions. */ + public UnaryCallSettings.Builder + testIamPermissionsSettings() { + return getStubSettingsBuilder().testIamPermissionsSettings(); + } + + @Override + public IdentitySettings build() throws IOException { + return new IdentitySettings(this); + } + } +} diff --git a/java-showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/MessagingClient.java b/java-showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/MessagingClient.java new file mode 100644 index 0000000000..673923e8e8 --- /dev/null +++ b/java-showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/MessagingClient.java @@ -0,0 +1,2853 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1; + +import com.google.api.core.ApiFuture; +import com.google.api.core.ApiFutures; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.httpjson.longrunning.OperationsClient; +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.BidiStreamingCallable; +import com.google.api.gax.rpc.ClientStreamingCallable; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.common.util.concurrent.MoreExecutors; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.longrunning.Operation; +import com.google.protobuf.ByteString; +import com.google.protobuf.Empty; +import com.google.showcase.v1beta1.stub.MessagingStub; +import com.google.showcase.v1beta1.stub.MessagingStubSettings; +import java.io.IOException; +import java.util.List; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Service Description: A simple messaging service that implements chat rooms and profile posts. + * + *

        This messaging service showcases the features that API clients generated by gapic-generators + * implement. + * + *

        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 (MessagingClient messagingClient = MessagingClient.create()) {
        + *   String displayName = "displayName1714148973";
        + *   String description = "description-1724546052";
        + *   Room response = messagingClient.createRoom(displayName, description);
        + * }
        + * }
        + * + *

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

        CreateRoom

        Creates a room.

        + *

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

        + *
          + *
        • createRoom(CreateRoomRequest request) + *

        + *

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

        + *
          + *
        • createRoom(String displayName, String description) + *

        + *

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

        + *
          + *
        • createRoomCallable() + *

        + *

        GetRoom

        Retrieves the Room with the given resource name.

        + *

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

        + *
          + *
        • getRoom(GetRoomRequest request) + *

        + *

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

        + *
          + *
        • getRoom(RoomName name) + *

        • getRoom(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.

        + *
          + *
        • getRoomCallable() + *

        + *

        UpdateRoom

        Updates a room.

        + *

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

        + *
          + *
        • updateRoom(UpdateRoomRequest request) + *

        + *

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

        + *
          + *
        • updateRoomCallable() + *

        + *

        DeleteRoom

        Deletes a room and all of its blurbs.

        + *

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

        + *
          + *
        • deleteRoom(DeleteRoomRequest request) + *

        + *

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

        + *
          + *
        • deleteRoom(RoomName name) + *

        • deleteRoom(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.

        + *
          + *
        • deleteRoomCallable() + *

        + *

        ListRooms

        Lists all chat rooms.

        + *

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

        + *
          + *
        • listRooms(ListRoomsRequest request) + *

        + *

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

        + *
          + *
        • listRoomsPagedCallable() + *

        • listRoomsCallable() + *

        + *

        CreateBlurb

        Creates a blurb. If the parent is a room, the blurb is understood to be a message in that room. If the parent is a profile, the blurb is understood to be a post on the profile.

        + *

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

        + *
          + *
        • createBlurb(CreateBlurbRequest request) + *

        + *

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

        + *
          + *
        • createBlurb(ProfileName parent, UserName user, ByteString image) + *

        • createBlurb(ProfileName parent, UserName user, String text) + *

        • createBlurb(ProfileName parent, String user, ByteString image) + *

        • createBlurb(ProfileName parent, String user, String text) + *

        • createBlurb(RoomName parent, UserName user, ByteString image) + *

        • createBlurb(RoomName parent, UserName user, String text) + *

        • createBlurb(RoomName parent, String user, ByteString image) + *

        • createBlurb(RoomName parent, String user, String text) + *

        • createBlurb(String parent, UserName user, ByteString image) + *

        • createBlurb(String parent, UserName user, String text) + *

        • createBlurb(String parent, String user, ByteString image) + *

        • createBlurb(String parent, String user, String text) + *

        + *

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

        + *
          + *
        • createBlurbCallable() + *

        + *

        GetBlurb

        Retrieves the Blurb with the given resource name.

        + *

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

        + *
          + *
        • getBlurb(GetBlurbRequest request) + *

        + *

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

        + *
          + *
        • getBlurb(BlurbName name) + *

        • getBlurb(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.

        + *
          + *
        • getBlurbCallable() + *

        + *

        UpdateBlurb

        Updates a blurb.

        + *

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

        + *
          + *
        • updateBlurb(UpdateBlurbRequest request) + *

        + *

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

        + *
          + *
        • updateBlurbCallable() + *

        + *

        DeleteBlurb

        Deletes a blurb.

        + *

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

        + *
          + *
        • deleteBlurb(DeleteBlurbRequest request) + *

        + *

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

        + *
          + *
        • deleteBlurb(BlurbName name) + *

        • deleteBlurb(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.

        + *
          + *
        • deleteBlurbCallable() + *

        + *

        ListBlurbs

        Lists blurbs for a specific chat room or user profile depending on the parent resource name.

        + *

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

        + *
          + *
        • listBlurbs(ListBlurbsRequest request) + *

        + *

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

        + *
          + *
        • listBlurbs(ProfileName parent) + *

        • listBlurbs(RoomName parent) + *

        • listBlurbs(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.

        + *
          + *
        • listBlurbsPagedCallable() + *

        • listBlurbsCallable() + *

        + *

        SearchBlurbs

        This method searches through all blurbs across all rooms and profiles for blurbs containing to words found in the query. Only posts that contain an exact match of a queried word will be returned.

        + *

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

        + *
          + *
        • searchBlurbsAsync(SearchBlurbsRequest request) + *

        + *

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

        + *
          + *
        • searchBlurbsAsync(ProfileName parent, String query) + *

        • searchBlurbsAsync(RoomName parent, String query) + *

        • searchBlurbsAsync(String parent, String query) + *

        + *

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

        + *
          + *
        • searchBlurbsOperationCallable() + *

        • searchBlurbsCallable() + *

        + *

        StreamBlurbs

        This returns a stream that emits the blurbs that are created for a particular chat room or user profile.

        + *

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

        + *
          + *
        • streamBlurbsCallable() + *

        + *

        SendBlurbs

        This is a stream to create multiple blurbs. If an invalid blurb is requested to be created, the stream will close with an error.

        + *

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

        + *
          + *
        • sendBlurbsCallable() + *

        + *

        Connect

        This method starts a bidirectional stream that receives all blurbs that are being created after the stream has started and sends requests to create blurbs. If an invalid blurb is requested to be created, the stream will close with an error.

        + *

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

        + *
          + *
        • connectCallable() + *

        + *

        ListLocations

        Lists information about the supported locations for this service.

        + *

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

        + *
          + *
        • listLocations(ListLocationsRequest request) + *

        + *

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

        + *
          + *
        • listLocationsPagedCallable() + *

        • listLocationsCallable() + *

        + *

        GetLocation

        Gets information about a location.

        + *

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

        + *
          + *
        • getLocation(GetLocationRequest request) + *

        + *

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

        + *
          + *
        • getLocationCallable() + *

        + *

        SetIamPolicy

        Sets the access control policy on the specified resource. Replaces any existing policy. + *

        Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED` errors.

        + *

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

        + *
          + *
        • setIamPolicy(SetIamPolicyRequest request) + *

        + *

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

        + *
          + *
        • setIamPolicyCallable() + *

        + *

        GetIamPolicy

        Gets the access control policy for a resource. Returns an empty policy if the resource exists and does not have a policy set.

        + *

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

        + *
          + *
        • getIamPolicy(GetIamPolicyRequest request) + *

        + *

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

        + *
          + *
        • getIamPolicyCallable() + *

        + *

        TestIamPermissions

        Returns permissions that a caller has on the specified resource. If the resource does not exist, this will return an empty set of permissions, not a `NOT_FOUND` error. + *

        Note: This operation is designed to be used for building permission-aware UIs and command-line tools, not for authorization checking. This operation may "fail open" without warning.

        + *

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

        + *
          + *
        • testIamPermissions(TestIamPermissionsRequest request) + *

        + *

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

        + *
          + *
        • testIamPermissionsCallable() + *

        + *
        + * + *

        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 MessagingSettings 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
        + * MessagingSettings messagingSettings =
        + *     MessagingSettings.newBuilder()
        + *         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
        + *         .build();
        + * MessagingClient messagingClient = MessagingClient.create(messagingSettings);
        + * }
        + * + *

        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
        + * MessagingSettings messagingSettings =
        + *     MessagingSettings.newBuilder().setEndpoint(myEndpoint).build();
        + * MessagingClient messagingClient = MessagingClient.create(messagingSettings);
        + * }
        + * + *

        To use REST (HTTP1.1/JSON) transport (instead of gRPC) for sending and receiving requests over + * the wire: + * + *

        {@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
        + * MessagingSettings messagingSettings = MessagingSettings.newHttpJsonBuilder().build();
        + * MessagingClient messagingClient = MessagingClient.create(messagingSettings);
        + * }
        + * + *

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

        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 (MessagingClient messagingClient = MessagingClient.create()) {
        +   *   String displayName = "displayName1714148973";
        +   *   String description = "description-1724546052";
        +   *   Room response = messagingClient.createRoom(displayName, description);
        +   * }
        +   * }
        + * + * @param displayName The human readable name of the chat room. + * @param description The description of the chat room. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Room createRoom(String displayName, String description) { + CreateRoomRequest request = + CreateRoomRequest.newBuilder() + .setRoom( + Room.newBuilder().setDisplayName(displayName).setDescription(description).build()) + .build(); + return createRoom(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a room. + * + *

        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 (MessagingClient messagingClient = MessagingClient.create()) {
        +   *   CreateRoomRequest request =
        +   *       CreateRoomRequest.newBuilder().setRoom(Room.newBuilder().build()).build();
        +   *   Room response = messagingClient.createRoom(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 Room createRoom(CreateRoomRequest request) { + return createRoomCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a room. + * + *

        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 (MessagingClient messagingClient = MessagingClient.create()) {
        +   *   CreateRoomRequest request =
        +   *       CreateRoomRequest.newBuilder().setRoom(Room.newBuilder().build()).build();
        +   *   ApiFuture future = messagingClient.createRoomCallable().futureCall(request);
        +   *   // Do something.
        +   *   Room response = future.get();
        +   * }
        +   * }
        + */ + public final UnaryCallable createRoomCallable() { + return stub.createRoomCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Retrieves the Room with the given resource name. + * + *

        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 (MessagingClient messagingClient = MessagingClient.create()) {
        +   *   RoomName name = RoomName.of("[ROOM]");
        +   *   Room response = messagingClient.getRoom(name);
        +   * }
        +   * }
        + * + * @param name The resource name of the requested room. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Room getRoom(RoomName name) { + GetRoomRequest request = + GetRoomRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + return getRoom(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Retrieves the Room with the given resource name. + * + *

        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 (MessagingClient messagingClient = MessagingClient.create()) {
        +   *   String name = RoomName.of("[ROOM]").toString();
        +   *   Room response = messagingClient.getRoom(name);
        +   * }
        +   * }
        + * + * @param name The resource name of the requested room. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Room getRoom(String name) { + GetRoomRequest request = GetRoomRequest.newBuilder().setName(name).build(); + return getRoom(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Retrieves the Room with the given resource name. + * + *

        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 (MessagingClient messagingClient = MessagingClient.create()) {
        +   *   GetRoomRequest request =
        +   *       GetRoomRequest.newBuilder().setName(RoomName.of("[ROOM]").toString()).build();
        +   *   Room response = messagingClient.getRoom(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 Room getRoom(GetRoomRequest request) { + return getRoomCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Retrieves the Room with the given resource name. + * + *

        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 (MessagingClient messagingClient = MessagingClient.create()) {
        +   *   GetRoomRequest request =
        +   *       GetRoomRequest.newBuilder().setName(RoomName.of("[ROOM]").toString()).build();
        +   *   ApiFuture future = messagingClient.getRoomCallable().futureCall(request);
        +   *   // Do something.
        +   *   Room response = future.get();
        +   * }
        +   * }
        + */ + public final UnaryCallable getRoomCallable() { + return stub.getRoomCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates a room. + * + *

        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 (MessagingClient messagingClient = MessagingClient.create()) {
        +   *   UpdateRoomRequest request =
        +   *       UpdateRoomRequest.newBuilder()
        +   *           .setRoom(Room.newBuilder().build())
        +   *           .setUpdateMask(FieldMask.newBuilder().build())
        +   *           .build();
        +   *   Room response = messagingClient.updateRoom(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 Room updateRoom(UpdateRoomRequest request) { + return updateRoomCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates a room. + * + *

        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 (MessagingClient messagingClient = MessagingClient.create()) {
        +   *   UpdateRoomRequest request =
        +   *       UpdateRoomRequest.newBuilder()
        +   *           .setRoom(Room.newBuilder().build())
        +   *           .setUpdateMask(FieldMask.newBuilder().build())
        +   *           .build();
        +   *   ApiFuture future = messagingClient.updateRoomCallable().futureCall(request);
        +   *   // Do something.
        +   *   Room response = future.get();
        +   * }
        +   * }
        + */ + public final UnaryCallable updateRoomCallable() { + return stub.updateRoomCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a room and all of its blurbs. + * + *

        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 (MessagingClient messagingClient = MessagingClient.create()) {
        +   *   RoomName name = RoomName.of("[ROOM]");
        +   *   messagingClient.deleteRoom(name);
        +   * }
        +   * }
        + * + * @param name The resource name of the requested room. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final void deleteRoom(RoomName name) { + DeleteRoomRequest request = + DeleteRoomRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + deleteRoom(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a room and all of its blurbs. + * + *

        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 (MessagingClient messagingClient = MessagingClient.create()) {
        +   *   String name = RoomName.of("[ROOM]").toString();
        +   *   messagingClient.deleteRoom(name);
        +   * }
        +   * }
        + * + * @param name The resource name of the requested room. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final void deleteRoom(String name) { + DeleteRoomRequest request = DeleteRoomRequest.newBuilder().setName(name).build(); + deleteRoom(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a room and all of its blurbs. + * + *

        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 (MessagingClient messagingClient = MessagingClient.create()) {
        +   *   DeleteRoomRequest request =
        +   *       DeleteRoomRequest.newBuilder().setName(RoomName.of("[ROOM]").toString()).build();
        +   *   messagingClient.deleteRoom(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 deleteRoom(DeleteRoomRequest request) { + deleteRoomCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a room and all of its blurbs. + * + *

        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 (MessagingClient messagingClient = MessagingClient.create()) {
        +   *   DeleteRoomRequest request =
        +   *       DeleteRoomRequest.newBuilder().setName(RoomName.of("[ROOM]").toString()).build();
        +   *   ApiFuture future = messagingClient.deleteRoomCallable().futureCall(request);
        +   *   // Do something.
        +   *   future.get();
        +   * }
        +   * }
        + */ + public final UnaryCallable deleteRoomCallable() { + return stub.deleteRoomCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists all chat rooms. + * + *

        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 (MessagingClient messagingClient = MessagingClient.create()) {
        +   *   ListRoomsRequest request =
        +   *       ListRoomsRequest.newBuilder()
        +   *           .setPageSize(883849137)
        +   *           .setPageToken("pageToken873572522")
        +   *           .build();
        +   *   for (Room element : messagingClient.listRooms(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 ListRoomsPagedResponse listRooms(ListRoomsRequest request) { + return listRoomsPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists all chat rooms. + * + *

        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 (MessagingClient messagingClient = MessagingClient.create()) {
        +   *   ListRoomsRequest request =
        +   *       ListRoomsRequest.newBuilder()
        +   *           .setPageSize(883849137)
        +   *           .setPageToken("pageToken873572522")
        +   *           .build();
        +   *   ApiFuture future = messagingClient.listRoomsPagedCallable().futureCall(request);
        +   *   // Do something.
        +   *   for (Room element : future.get().iterateAll()) {
        +   *     // doThingsWith(element);
        +   *   }
        +   * }
        +   * }
        + */ + public final UnaryCallable listRoomsPagedCallable() { + return stub.listRoomsPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists all chat rooms. + * + *

        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 (MessagingClient messagingClient = MessagingClient.create()) {
        +   *   ListRoomsRequest request =
        +   *       ListRoomsRequest.newBuilder()
        +   *           .setPageSize(883849137)
        +   *           .setPageToken("pageToken873572522")
        +   *           .build();
        +   *   while (true) {
        +   *     ListRoomsResponse response = messagingClient.listRoomsCallable().call(request);
        +   *     for (Room element : response.getRoomsList()) {
        +   *       // doThingsWith(element);
        +   *     }
        +   *     String nextPageToken = response.getNextPageToken();
        +   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
        +   *       request = request.toBuilder().setPageToken(nextPageToken).build();
        +   *     } else {
        +   *       break;
        +   *     }
        +   *   }
        +   * }
        +   * }
        + */ + public final UnaryCallable listRoomsCallable() { + return stub.listRoomsCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a blurb. If the parent is a room, the blurb is understood to be a message in that room. + * If the parent is a profile, the blurb is understood to be a post on the profile. + * + *

        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 (MessagingClient messagingClient = MessagingClient.create()) {
        +   *   ProfileName parent = ProfileName.of("[USER]");
        +   *   UserName user = UserName.of("[USER]");
        +   *   ByteString image = ByteString.EMPTY;
        +   *   Blurb response = messagingClient.createBlurb(parent, user, image);
        +   * }
        +   * }
        + * + * @param parent The resource name of the chat room or user profile that this blurb will be tied + * to. + * @param user The resource name of the blurb's author. + * @param image The image content of this blurb. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Blurb createBlurb(ProfileName parent, UserName user, ByteString image) { + CreateBlurbRequest request = + CreateBlurbRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .setBlurb( + Blurb.newBuilder() + .setUser(user == null ? null : user.toString()) + .setImage(image) + .build()) + .build(); + return createBlurb(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a blurb. If the parent is a room, the blurb is understood to be a message in that room. + * If the parent is a profile, the blurb is understood to be a post on the profile. + * + *

        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 (MessagingClient messagingClient = MessagingClient.create()) {
        +   *   ProfileName parent = ProfileName.of("[USER]");
        +   *   UserName user = UserName.of("[USER]");
        +   *   String text = "text3556653";
        +   *   Blurb response = messagingClient.createBlurb(parent, user, text);
        +   * }
        +   * }
        + * + * @param parent The resource name of the chat room or user profile that this blurb will be tied + * to. + * @param user The resource name of the blurb's author. + * @param text The textual content of this blurb. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Blurb createBlurb(ProfileName parent, UserName user, String text) { + CreateBlurbRequest request = + CreateBlurbRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .setBlurb( + Blurb.newBuilder() + .setUser(user == null ? null : user.toString()) + .setText(text) + .build()) + .build(); + return createBlurb(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a blurb. If the parent is a room, the blurb is understood to be a message in that room. + * If the parent is a profile, the blurb is understood to be a post on the profile. + * + *

        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 (MessagingClient messagingClient = MessagingClient.create()) {
        +   *   ProfileName parent = ProfileName.of("[USER]");
        +   *   String user = UserName.of("[USER]").toString();
        +   *   ByteString image = ByteString.EMPTY;
        +   *   Blurb response = messagingClient.createBlurb(parent, user, image);
        +   * }
        +   * }
        + * + * @param parent The resource name of the chat room or user profile that this blurb will be tied + * to. + * @param user The resource name of the blurb's author. + * @param image The image content of this blurb. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Blurb createBlurb(ProfileName parent, String user, ByteString image) { + CreateBlurbRequest request = + CreateBlurbRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .setBlurb(Blurb.newBuilder().setUser(user).setImage(image).build()) + .build(); + return createBlurb(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a blurb. If the parent is a room, the blurb is understood to be a message in that room. + * If the parent is a profile, the blurb is understood to be a post on the profile. + * + *

        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 (MessagingClient messagingClient = MessagingClient.create()) {
        +   *   ProfileName parent = ProfileName.of("[USER]");
        +   *   String user = UserName.of("[USER]").toString();
        +   *   String text = "text3556653";
        +   *   Blurb response = messagingClient.createBlurb(parent, user, text);
        +   * }
        +   * }
        + * + * @param parent The resource name of the chat room or user profile that this blurb will be tied + * to. + * @param user The resource name of the blurb's author. + * @param text The textual content of this blurb. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Blurb createBlurb(ProfileName parent, String user, String text) { + CreateBlurbRequest request = + CreateBlurbRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .setBlurb(Blurb.newBuilder().setUser(user).setText(text).build()) + .build(); + return createBlurb(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a blurb. If the parent is a room, the blurb is understood to be a message in that room. + * If the parent is a profile, the blurb is understood to be a post on the profile. + * + *

        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 (MessagingClient messagingClient = MessagingClient.create()) {
        +   *   RoomName parent = RoomName.of("[ROOM]");
        +   *   UserName user = UserName.of("[USER]");
        +   *   ByteString image = ByteString.EMPTY;
        +   *   Blurb response = messagingClient.createBlurb(parent, user, image);
        +   * }
        +   * }
        + * + * @param parent The resource name of the chat room or user profile that this blurb will be tied + * to. + * @param user The resource name of the blurb's author. + * @param image The image content of this blurb. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Blurb createBlurb(RoomName parent, UserName user, ByteString image) { + CreateBlurbRequest request = + CreateBlurbRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .setBlurb( + Blurb.newBuilder() + .setUser(user == null ? null : user.toString()) + .setImage(image) + .build()) + .build(); + return createBlurb(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a blurb. If the parent is a room, the blurb is understood to be a message in that room. + * If the parent is a profile, the blurb is understood to be a post on the profile. + * + *

        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 (MessagingClient messagingClient = MessagingClient.create()) {
        +   *   RoomName parent = RoomName.of("[ROOM]");
        +   *   UserName user = UserName.of("[USER]");
        +   *   String text = "text3556653";
        +   *   Blurb response = messagingClient.createBlurb(parent, user, text);
        +   * }
        +   * }
        + * + * @param parent The resource name of the chat room or user profile that this blurb will be tied + * to. + * @param user The resource name of the blurb's author. + * @param text The textual content of this blurb. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Blurb createBlurb(RoomName parent, UserName user, String text) { + CreateBlurbRequest request = + CreateBlurbRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .setBlurb( + Blurb.newBuilder() + .setUser(user == null ? null : user.toString()) + .setText(text) + .build()) + .build(); + return createBlurb(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a blurb. If the parent is a room, the blurb is understood to be a message in that room. + * If the parent is a profile, the blurb is understood to be a post on the profile. + * + *

        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 (MessagingClient messagingClient = MessagingClient.create()) {
        +   *   RoomName parent = RoomName.of("[ROOM]");
        +   *   String user = UserName.of("[USER]").toString();
        +   *   ByteString image = ByteString.EMPTY;
        +   *   Blurb response = messagingClient.createBlurb(parent, user, image);
        +   * }
        +   * }
        + * + * @param parent The resource name of the chat room or user profile that this blurb will be tied + * to. + * @param user The resource name of the blurb's author. + * @param image The image content of this blurb. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Blurb createBlurb(RoomName parent, String user, ByteString image) { + CreateBlurbRequest request = + CreateBlurbRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .setBlurb(Blurb.newBuilder().setUser(user).setImage(image).build()) + .build(); + return createBlurb(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a blurb. If the parent is a room, the blurb is understood to be a message in that room. + * If the parent is a profile, the blurb is understood to be a post on the profile. + * + *

        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 (MessagingClient messagingClient = MessagingClient.create()) {
        +   *   RoomName parent = RoomName.of("[ROOM]");
        +   *   String user = UserName.of("[USER]").toString();
        +   *   String text = "text3556653";
        +   *   Blurb response = messagingClient.createBlurb(parent, user, text);
        +   * }
        +   * }
        + * + * @param parent The resource name of the chat room or user profile that this blurb will be tied + * to. + * @param user The resource name of the blurb's author. + * @param text The textual content of this blurb. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Blurb createBlurb(RoomName parent, String user, String text) { + CreateBlurbRequest request = + CreateBlurbRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .setBlurb(Blurb.newBuilder().setUser(user).setText(text).build()) + .build(); + return createBlurb(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a blurb. If the parent is a room, the blurb is understood to be a message in that room. + * If the parent is a profile, the blurb is understood to be a post on the profile. + * + *

        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 (MessagingClient messagingClient = MessagingClient.create()) {
        +   *   String parent = ProfileName.of("[USER]").toString();
        +   *   UserName user = UserName.of("[USER]");
        +   *   ByteString image = ByteString.EMPTY;
        +   *   Blurb response = messagingClient.createBlurb(parent, user, image);
        +   * }
        +   * }
        + * + * @param parent The resource name of the chat room or user profile that this blurb will be tied + * to. + * @param user The resource name of the blurb's author. + * @param image The image content of this blurb. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Blurb createBlurb(String parent, UserName user, ByteString image) { + CreateBlurbRequest request = + CreateBlurbRequest.newBuilder() + .setParent(parent) + .setBlurb( + Blurb.newBuilder() + .setUser(user == null ? null : user.toString()) + .setImage(image) + .build()) + .build(); + return createBlurb(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a blurb. If the parent is a room, the blurb is understood to be a message in that room. + * If the parent is a profile, the blurb is understood to be a post on the profile. + * + *

        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 (MessagingClient messagingClient = MessagingClient.create()) {
        +   *   String parent = ProfileName.of("[USER]").toString();
        +   *   UserName user = UserName.of("[USER]");
        +   *   String text = "text3556653";
        +   *   Blurb response = messagingClient.createBlurb(parent, user, text);
        +   * }
        +   * }
        + * + * @param parent The resource name of the chat room or user profile that this blurb will be tied + * to. + * @param user The resource name of the blurb's author. + * @param text The textual content of this blurb. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Blurb createBlurb(String parent, UserName user, String text) { + CreateBlurbRequest request = + CreateBlurbRequest.newBuilder() + .setParent(parent) + .setBlurb( + Blurb.newBuilder() + .setUser(user == null ? null : user.toString()) + .setText(text) + .build()) + .build(); + return createBlurb(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a blurb. If the parent is a room, the blurb is understood to be a message in that room. + * If the parent is a profile, the blurb is understood to be a post on the profile. + * + *

        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 (MessagingClient messagingClient = MessagingClient.create()) {
        +   *   String parent = ProfileName.of("[USER]").toString();
        +   *   String user = UserName.of("[USER]").toString();
        +   *   ByteString image = ByteString.EMPTY;
        +   *   Blurb response = messagingClient.createBlurb(parent, user, image);
        +   * }
        +   * }
        + * + * @param parent The resource name of the chat room or user profile that this blurb will be tied + * to. + * @param user The resource name of the blurb's author. + * @param image The image content of this blurb. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Blurb createBlurb(String parent, String user, ByteString image) { + CreateBlurbRequest request = + CreateBlurbRequest.newBuilder() + .setParent(parent) + .setBlurb(Blurb.newBuilder().setUser(user).setImage(image).build()) + .build(); + return createBlurb(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a blurb. If the parent is a room, the blurb is understood to be a message in that room. + * If the parent is a profile, the blurb is understood to be a post on the profile. + * + *

        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 (MessagingClient messagingClient = MessagingClient.create()) {
        +   *   String parent = ProfileName.of("[USER]").toString();
        +   *   String user = UserName.of("[USER]").toString();
        +   *   String text = "text3556653";
        +   *   Blurb response = messagingClient.createBlurb(parent, user, text);
        +   * }
        +   * }
        + * + * @param parent The resource name of the chat room or user profile that this blurb will be tied + * to. + * @param user The resource name of the blurb's author. + * @param text The textual content of this blurb. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Blurb createBlurb(String parent, String user, String text) { + CreateBlurbRequest request = + CreateBlurbRequest.newBuilder() + .setParent(parent) + .setBlurb(Blurb.newBuilder().setUser(user).setText(text).build()) + .build(); + return createBlurb(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a blurb. If the parent is a room, the blurb is understood to be a message in that room. + * If the parent is a profile, the blurb is understood to be a post on the profile. + * + *

        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 (MessagingClient messagingClient = MessagingClient.create()) {
        +   *   CreateBlurbRequest request =
        +   *       CreateBlurbRequest.newBuilder()
        +   *           .setParent(ProfileName.of("[USER]").toString())
        +   *           .setBlurb(Blurb.newBuilder().build())
        +   *           .build();
        +   *   Blurb response = messagingClient.createBlurb(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 Blurb createBlurb(CreateBlurbRequest request) { + return createBlurbCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a blurb. If the parent is a room, the blurb is understood to be a message in that room. + * If the parent is a profile, the blurb is understood to be a post on the profile. + * + *

        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 (MessagingClient messagingClient = MessagingClient.create()) {
        +   *   CreateBlurbRequest request =
        +   *       CreateBlurbRequest.newBuilder()
        +   *           .setParent(ProfileName.of("[USER]").toString())
        +   *           .setBlurb(Blurb.newBuilder().build())
        +   *           .build();
        +   *   ApiFuture future = messagingClient.createBlurbCallable().futureCall(request);
        +   *   // Do something.
        +   *   Blurb response = future.get();
        +   * }
        +   * }
        + */ + public final UnaryCallable createBlurbCallable() { + return stub.createBlurbCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Retrieves the Blurb with the given resource name. + * + *

        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 (MessagingClient messagingClient = MessagingClient.create()) {
        +   *   BlurbName name = BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]");
        +   *   Blurb response = messagingClient.getBlurb(name);
        +   * }
        +   * }
        + * + * @param name The resource name of the requested blurb. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Blurb getBlurb(BlurbName name) { + GetBlurbRequest request = + GetBlurbRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + return getBlurb(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Retrieves the Blurb with the given resource name. + * + *

        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 (MessagingClient messagingClient = MessagingClient.create()) {
        +   *   String name =
        +   *       BlurbName.ofUserLegacyUserBlurbName("[USER]", "[LEGACY_USER]", "[BLURB]").toString();
        +   *   Blurb response = messagingClient.getBlurb(name);
        +   * }
        +   * }
        + * + * @param name The resource name of the requested blurb. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Blurb getBlurb(String name) { + GetBlurbRequest request = GetBlurbRequest.newBuilder().setName(name).build(); + return getBlurb(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Retrieves the Blurb with the given resource name. + * + *

        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 (MessagingClient messagingClient = MessagingClient.create()) {
        +   *   GetBlurbRequest request =
        +   *       GetBlurbRequest.newBuilder()
        +   *           .setName(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString())
        +   *           .build();
        +   *   Blurb response = messagingClient.getBlurb(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 Blurb getBlurb(GetBlurbRequest request) { + return getBlurbCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Retrieves the Blurb with the given resource name. + * + *

        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 (MessagingClient messagingClient = MessagingClient.create()) {
        +   *   GetBlurbRequest request =
        +   *       GetBlurbRequest.newBuilder()
        +   *           .setName(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString())
        +   *           .build();
        +   *   ApiFuture future = messagingClient.getBlurbCallable().futureCall(request);
        +   *   // Do something.
        +   *   Blurb response = future.get();
        +   * }
        +   * }
        + */ + public final UnaryCallable getBlurbCallable() { + return stub.getBlurbCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates a blurb. + * + *

        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 (MessagingClient messagingClient = MessagingClient.create()) {
        +   *   UpdateBlurbRequest request =
        +   *       UpdateBlurbRequest.newBuilder()
        +   *           .setBlurb(Blurb.newBuilder().build())
        +   *           .setUpdateMask(FieldMask.newBuilder().build())
        +   *           .build();
        +   *   Blurb response = messagingClient.updateBlurb(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 Blurb updateBlurb(UpdateBlurbRequest request) { + return updateBlurbCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates a blurb. + * + *

        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 (MessagingClient messagingClient = MessagingClient.create()) {
        +   *   UpdateBlurbRequest request =
        +   *       UpdateBlurbRequest.newBuilder()
        +   *           .setBlurb(Blurb.newBuilder().build())
        +   *           .setUpdateMask(FieldMask.newBuilder().build())
        +   *           .build();
        +   *   ApiFuture future = messagingClient.updateBlurbCallable().futureCall(request);
        +   *   // Do something.
        +   *   Blurb response = future.get();
        +   * }
        +   * }
        + */ + public final UnaryCallable updateBlurbCallable() { + return stub.updateBlurbCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a blurb. + * + *

        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 (MessagingClient messagingClient = MessagingClient.create()) {
        +   *   BlurbName name = BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]");
        +   *   messagingClient.deleteBlurb(name);
        +   * }
        +   * }
        + * + * @param name The resource name of the requested blurb. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final void deleteBlurb(BlurbName name) { + DeleteBlurbRequest request = + DeleteBlurbRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + deleteBlurb(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a blurb. + * + *

        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 (MessagingClient messagingClient = MessagingClient.create()) {
        +   *   String name =
        +   *       BlurbName.ofUserLegacyUserBlurbName("[USER]", "[LEGACY_USER]", "[BLURB]").toString();
        +   *   messagingClient.deleteBlurb(name);
        +   * }
        +   * }
        + * + * @param name The resource name of the requested blurb. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final void deleteBlurb(String name) { + DeleteBlurbRequest request = DeleteBlurbRequest.newBuilder().setName(name).build(); + deleteBlurb(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a blurb. + * + *

        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 (MessagingClient messagingClient = MessagingClient.create()) {
        +   *   DeleteBlurbRequest request =
        +   *       DeleteBlurbRequest.newBuilder()
        +   *           .setName(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString())
        +   *           .build();
        +   *   messagingClient.deleteBlurb(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 deleteBlurb(DeleteBlurbRequest request) { + deleteBlurbCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a blurb. + * + *

        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 (MessagingClient messagingClient = MessagingClient.create()) {
        +   *   DeleteBlurbRequest request =
        +   *       DeleteBlurbRequest.newBuilder()
        +   *           .setName(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString())
        +   *           .build();
        +   *   ApiFuture future = messagingClient.deleteBlurbCallable().futureCall(request);
        +   *   // Do something.
        +   *   future.get();
        +   * }
        +   * }
        + */ + public final UnaryCallable deleteBlurbCallable() { + return stub.deleteBlurbCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists blurbs for a specific chat room or user profile depending on the parent resource name. + * + *

        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 (MessagingClient messagingClient = MessagingClient.create()) {
        +   *   ProfileName parent = ProfileName.of("[USER]");
        +   *   for (Blurb element : messagingClient.listBlurbs(parent).iterateAll()) {
        +   *     // doThingsWith(element);
        +   *   }
        +   * }
        +   * }
        + * + * @param parent The resource name of the requested room or profile who blurbs to list. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListBlurbsPagedResponse listBlurbs(ProfileName parent) { + ListBlurbsRequest request = + ListBlurbsRequest.newBuilder().setParent(parent == null ? null : parent.toString()).build(); + return listBlurbs(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists blurbs for a specific chat room or user profile depending on the parent resource name. + * + *

        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 (MessagingClient messagingClient = MessagingClient.create()) {
        +   *   RoomName parent = RoomName.of("[ROOM]");
        +   *   for (Blurb element : messagingClient.listBlurbs(parent).iterateAll()) {
        +   *     // doThingsWith(element);
        +   *   }
        +   * }
        +   * }
        + * + * @param parent The resource name of the requested room or profile who blurbs to list. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListBlurbsPagedResponse listBlurbs(RoomName parent) { + ListBlurbsRequest request = + ListBlurbsRequest.newBuilder().setParent(parent == null ? null : parent.toString()).build(); + return listBlurbs(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists blurbs for a specific chat room or user profile depending on the parent resource name. + * + *

        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 (MessagingClient messagingClient = MessagingClient.create()) {
        +   *   String parent = ProfileName.of("[USER]").toString();
        +   *   for (Blurb element : messagingClient.listBlurbs(parent).iterateAll()) {
        +   *     // doThingsWith(element);
        +   *   }
        +   * }
        +   * }
        + * + * @param parent The resource name of the requested room or profile who blurbs to list. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListBlurbsPagedResponse listBlurbs(String parent) { + ListBlurbsRequest request = ListBlurbsRequest.newBuilder().setParent(parent).build(); + return listBlurbs(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists blurbs for a specific chat room or user profile depending on the parent resource name. + * + *

        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 (MessagingClient messagingClient = MessagingClient.create()) {
        +   *   ListBlurbsRequest request =
        +   *       ListBlurbsRequest.newBuilder()
        +   *           .setParent(ProfileName.of("[USER]").toString())
        +   *           .setPageSize(883849137)
        +   *           .setPageToken("pageToken873572522")
        +   *           .build();
        +   *   for (Blurb element : messagingClient.listBlurbs(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 ListBlurbsPagedResponse listBlurbs(ListBlurbsRequest request) { + return listBlurbsPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists blurbs for a specific chat room or user profile depending on the parent resource name. + * + *

        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 (MessagingClient messagingClient = MessagingClient.create()) {
        +   *   ListBlurbsRequest request =
        +   *       ListBlurbsRequest.newBuilder()
        +   *           .setParent(ProfileName.of("[USER]").toString())
        +   *           .setPageSize(883849137)
        +   *           .setPageToken("pageToken873572522")
        +   *           .build();
        +   *   ApiFuture future = messagingClient.listBlurbsPagedCallable().futureCall(request);
        +   *   // Do something.
        +   *   for (Blurb element : future.get().iterateAll()) {
        +   *     // doThingsWith(element);
        +   *   }
        +   * }
        +   * }
        + */ + public final UnaryCallable listBlurbsPagedCallable() { + return stub.listBlurbsPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists blurbs for a specific chat room or user profile depending on the parent resource name. + * + *

        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 (MessagingClient messagingClient = MessagingClient.create()) {
        +   *   ListBlurbsRequest request =
        +   *       ListBlurbsRequest.newBuilder()
        +   *           .setParent(ProfileName.of("[USER]").toString())
        +   *           .setPageSize(883849137)
        +   *           .setPageToken("pageToken873572522")
        +   *           .build();
        +   *   while (true) {
        +   *     ListBlurbsResponse response = messagingClient.listBlurbsCallable().call(request);
        +   *     for (Blurb element : response.getBlurbsList()) {
        +   *       // doThingsWith(element);
        +   *     }
        +   *     String nextPageToken = response.getNextPageToken();
        +   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
        +   *       request = request.toBuilder().setPageToken(nextPageToken).build();
        +   *     } else {
        +   *       break;
        +   *     }
        +   *   }
        +   * }
        +   * }
        + */ + public final UnaryCallable listBlurbsCallable() { + return stub.listBlurbsCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * This method searches through all blurbs across all rooms and profiles for blurbs containing to + * words found in the query. Only posts that contain an exact match of a queried word will be + * returned. + * + *

        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 (MessagingClient messagingClient = MessagingClient.create()) {
        +   *   ProfileName parent = ProfileName.of("[USER]");
        +   *   String query = "query107944136";
        +   *   SearchBlurbsResponse response = messagingClient.searchBlurbsAsync(parent, query).get();
        +   * }
        +   * }
        + * + * @param parent The rooms or profiles to search. If unset, `SearchBlurbs` will search all rooms + * and all profiles. + * @param query The query used to search for blurbs containing to words of this string. Only posts + * that contain an exact match of a queried word will be returned. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture searchBlurbsAsync( + ProfileName parent, String query) { + SearchBlurbsRequest request = + SearchBlurbsRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .setQuery(query) + .build(); + return searchBlurbsAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * This method searches through all blurbs across all rooms and profiles for blurbs containing to + * words found in the query. Only posts that contain an exact match of a queried word will be + * returned. + * + *

        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 (MessagingClient messagingClient = MessagingClient.create()) {
        +   *   RoomName parent = RoomName.of("[ROOM]");
        +   *   String query = "query107944136";
        +   *   SearchBlurbsResponse response = messagingClient.searchBlurbsAsync(parent, query).get();
        +   * }
        +   * }
        + * + * @param parent The rooms or profiles to search. If unset, `SearchBlurbs` will search all rooms + * and all profiles. + * @param query The query used to search for blurbs containing to words of this string. Only posts + * that contain an exact match of a queried word will be returned. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture searchBlurbsAsync( + RoomName parent, String query) { + SearchBlurbsRequest request = + SearchBlurbsRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .setQuery(query) + .build(); + return searchBlurbsAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * This method searches through all blurbs across all rooms and profiles for blurbs containing to + * words found in the query. Only posts that contain an exact match of a queried word will be + * returned. + * + *

        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 (MessagingClient messagingClient = MessagingClient.create()) {
        +   *   String parent = ProfileName.of("[USER]").toString();
        +   *   String query = "query107944136";
        +   *   SearchBlurbsResponse response = messagingClient.searchBlurbsAsync(parent, query).get();
        +   * }
        +   * }
        + * + * @param parent The rooms or profiles to search. If unset, `SearchBlurbs` will search all rooms + * and all profiles. + * @param query The query used to search for blurbs containing to words of this string. Only posts + * that contain an exact match of a queried word will be returned. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture searchBlurbsAsync( + String parent, String query) { + SearchBlurbsRequest request = + SearchBlurbsRequest.newBuilder().setParent(parent).setQuery(query).build(); + return searchBlurbsAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * This method searches through all blurbs across all rooms and profiles for blurbs containing to + * words found in the query. Only posts that contain an exact match of a queried word will be + * returned. + * + *

        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 (MessagingClient messagingClient = MessagingClient.create()) {
        +   *   SearchBlurbsRequest request =
        +   *       SearchBlurbsRequest.newBuilder()
        +   *           .setQuery("query107944136")
        +   *           .setParent(ProfileName.of("[USER]").toString())
        +   *           .setPageSize(883849137)
        +   *           .setPageToken("pageToken873572522")
        +   *           .build();
        +   *   SearchBlurbsResponse response = messagingClient.searchBlurbsAsync(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 searchBlurbsAsync( + SearchBlurbsRequest request) { + return searchBlurbsOperationCallable().futureCall(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * This method searches through all blurbs across all rooms and profiles for blurbs containing to + * words found in the query. Only posts that contain an exact match of a queried word will be + * returned. + * + *

        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 (MessagingClient messagingClient = MessagingClient.create()) {
        +   *   SearchBlurbsRequest request =
        +   *       SearchBlurbsRequest.newBuilder()
        +   *           .setQuery("query107944136")
        +   *           .setParent(ProfileName.of("[USER]").toString())
        +   *           .setPageSize(883849137)
        +   *           .setPageToken("pageToken873572522")
        +   *           .build();
        +   *   OperationFuture future =
        +   *       messagingClient.searchBlurbsOperationCallable().futureCall(request);
        +   *   // Do something.
        +   *   SearchBlurbsResponse response = future.get();
        +   * }
        +   * }
        + */ + public final OperationCallable + searchBlurbsOperationCallable() { + return stub.searchBlurbsOperationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * This method searches through all blurbs across all rooms and profiles for blurbs containing to + * words found in the query. Only posts that contain an exact match of a queried word will be + * returned. + * + *

        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 (MessagingClient messagingClient = MessagingClient.create()) {
        +   *   SearchBlurbsRequest request =
        +   *       SearchBlurbsRequest.newBuilder()
        +   *           .setQuery("query107944136")
        +   *           .setParent(ProfileName.of("[USER]").toString())
        +   *           .setPageSize(883849137)
        +   *           .setPageToken("pageToken873572522")
        +   *           .build();
        +   *   ApiFuture future = messagingClient.searchBlurbsCallable().futureCall(request);
        +   *   // Do something.
        +   *   Operation response = future.get();
        +   * }
        +   * }
        + */ + public final UnaryCallable searchBlurbsCallable() { + return stub.searchBlurbsCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * This returns a stream that emits the blurbs that are created for a particular chat room or user + * profile. + * + *

        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 (MessagingClient messagingClient = MessagingClient.create()) {
        +   *   StreamBlurbsRequest request =
        +   *       StreamBlurbsRequest.newBuilder()
        +   *           .setName(ProfileName.of("[USER]").toString())
        +   *           .setExpireTime(Timestamp.newBuilder().build())
        +   *           .build();
        +   *   ServerStream stream =
        +   *       messagingClient.streamBlurbsCallable().call(request);
        +   *   for (StreamBlurbsResponse response : stream) {
        +   *     // Do something when a response is received.
        +   *   }
        +   * }
        +   * }
        + */ + public final ServerStreamingCallable + streamBlurbsCallable() { + return stub.streamBlurbsCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * This is a stream to create multiple blurbs. If an invalid blurb is requested to be created, the + * stream will close with an error. + * + *

        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 (MessagingClient messagingClient = MessagingClient.create()) {
        +   *   ApiStreamObserver responseObserver =
        +   *       new ApiStreamObserver() {
        +   *         {@literal @}Override
        +   *         public void onNext(SendBlurbsResponse response) {
        +   *           // Do something when a response is received.
        +   *         }
        +   *
        +   *         {@literal @}Override
        +   *         public void onError(Throwable t) {
        +   *           // Add error-handling
        +   *         }
        +   *
        +   *         {@literal @}Override
        +   *         public void onCompleted() {
        +   *           // Do something when complete.
        +   *         }
        +   *       };
        +   *   ApiStreamObserver requestObserver =
        +   *       messagingClient.sendBlurbs().clientStreamingCall(responseObserver);
        +   *   CreateBlurbRequest request =
        +   *       CreateBlurbRequest.newBuilder()
        +   *           .setParent(ProfileName.of("[USER]").toString())
        +   *           .setBlurb(Blurb.newBuilder().build())
        +   *           .build();
        +   *   requestObserver.onNext(request);
        +   * }
        +   * }
        + */ + public final ClientStreamingCallable + sendBlurbsCallable() { + return stub.sendBlurbsCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * This method starts a bidirectional stream that receives all blurbs that are being created after + * the stream has started and sends requests to create blurbs. If an invalid blurb is requested to + * be created, the stream will close with an error. + * + *

        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 (MessagingClient messagingClient = MessagingClient.create()) {
        +   *   BidiStream bidiStream =
        +   *       messagingClient.connectCallable().call();
        +   *   ConnectRequest request = ConnectRequest.newBuilder().build();
        +   *   bidiStream.send(request);
        +   *   for (StreamBlurbsResponse response : bidiStream) {
        +   *     // Do something when a response is received.
        +   *   }
        +   * }
        +   * }
        + */ + public final BidiStreamingCallable connectCallable() { + return stub.connectCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists information about the supported locations for this service. + * + *

        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 (MessagingClient messagingClient = MessagingClient.create()) {
        +   *   ListLocationsRequest request =
        +   *       ListLocationsRequest.newBuilder()
        +   *           .setName("name3373707")
        +   *           .setFilter("filter-1274492040")
        +   *           .setPageSize(883849137)
        +   *           .setPageToken("pageToken873572522")
        +   *           .build();
        +   *   for (Location element : messagingClient.listLocations(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 ListLocationsPagedResponse listLocations(ListLocationsRequest request) { + return listLocationsPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists information about the supported locations for this service. + * + *

        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 (MessagingClient messagingClient = MessagingClient.create()) {
        +   *   ListLocationsRequest request =
        +   *       ListLocationsRequest.newBuilder()
        +   *           .setName("name3373707")
        +   *           .setFilter("filter-1274492040")
        +   *           .setPageSize(883849137)
        +   *           .setPageToken("pageToken873572522")
        +   *           .build();
        +   *   ApiFuture future = messagingClient.listLocationsPagedCallable().futureCall(request);
        +   *   // Do something.
        +   *   for (Location element : future.get().iterateAll()) {
        +   *     // doThingsWith(element);
        +   *   }
        +   * }
        +   * }
        + */ + public final UnaryCallable + listLocationsPagedCallable() { + return stub.listLocationsPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists information about the supported locations for this service. + * + *

        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 (MessagingClient messagingClient = MessagingClient.create()) {
        +   *   ListLocationsRequest request =
        +   *       ListLocationsRequest.newBuilder()
        +   *           .setName("name3373707")
        +   *           .setFilter("filter-1274492040")
        +   *           .setPageSize(883849137)
        +   *           .setPageToken("pageToken873572522")
        +   *           .build();
        +   *   while (true) {
        +   *     ListLocationsResponse response = messagingClient.listLocationsCallable().call(request);
        +   *     for (Location element : response.getLocationsList()) {
        +   *       // doThingsWith(element);
        +   *     }
        +   *     String nextPageToken = response.getNextPageToken();
        +   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
        +   *       request = request.toBuilder().setPageToken(nextPageToken).build();
        +   *     } else {
        +   *       break;
        +   *     }
        +   *   }
        +   * }
        +   * }
        + */ + public final UnaryCallable listLocationsCallable() { + return stub.listLocationsCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets information about a location. + * + *

        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 (MessagingClient messagingClient = MessagingClient.create()) {
        +   *   GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build();
        +   *   Location response = messagingClient.getLocation(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 Location getLocation(GetLocationRequest request) { + return getLocationCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets information about a location. + * + *

        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 (MessagingClient messagingClient = MessagingClient.create()) {
        +   *   GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build();
        +   *   ApiFuture future = messagingClient.getLocationCallable().futureCall(request);
        +   *   // Do something.
        +   *   Location response = future.get();
        +   * }
        +   * }
        + */ + public final UnaryCallable getLocationCallable() { + return stub.getLocationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Sets the access control policy on the specified resource. Replaces any existing policy. + * + *

        Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED` errors. + * + *

        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 (MessagingClient messagingClient = MessagingClient.create()) {
        +   *   SetIamPolicyRequest request =
        +   *       SetIamPolicyRequest.newBuilder()
        +   *           .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString())
        +   *           .setPolicy(Policy.newBuilder().build())
        +   *           .setUpdateMask(FieldMask.newBuilder().build())
        +   *           .build();
        +   *   Policy response = messagingClient.setIamPolicy(request);
        +   * }
        +   * }
        + * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Policy setIamPolicy(SetIamPolicyRequest request) { + return setIamPolicyCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Sets the access control policy on the specified resource. Replaces any existing policy. + * + *

        Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED` errors. + * + *

        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 (MessagingClient messagingClient = MessagingClient.create()) {
        +   *   SetIamPolicyRequest request =
        +   *       SetIamPolicyRequest.newBuilder()
        +   *           .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString())
        +   *           .setPolicy(Policy.newBuilder().build())
        +   *           .setUpdateMask(FieldMask.newBuilder().build())
        +   *           .build();
        +   *   ApiFuture future = messagingClient.setIamPolicyCallable().futureCall(request);
        +   *   // Do something.
        +   *   Policy response = future.get();
        +   * }
        +   * }
        + */ + public final UnaryCallable setIamPolicyCallable() { + return stub.setIamPolicyCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets the access control policy for a resource. Returns an empty policy if the resource exists + * and does not have a policy set. + * + *

        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 (MessagingClient messagingClient = MessagingClient.create()) {
        +   *   GetIamPolicyRequest request =
        +   *       GetIamPolicyRequest.newBuilder()
        +   *           .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString())
        +   *           .setOptions(GetPolicyOptions.newBuilder().build())
        +   *           .build();
        +   *   Policy response = messagingClient.getIamPolicy(request);
        +   * }
        +   * }
        + * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Policy getIamPolicy(GetIamPolicyRequest request) { + return getIamPolicyCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets the access control policy for a resource. Returns an empty policy if the resource exists + * and does not have a policy set. + * + *

        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 (MessagingClient messagingClient = MessagingClient.create()) {
        +   *   GetIamPolicyRequest request =
        +   *       GetIamPolicyRequest.newBuilder()
        +   *           .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString())
        +   *           .setOptions(GetPolicyOptions.newBuilder().build())
        +   *           .build();
        +   *   ApiFuture future = messagingClient.getIamPolicyCallable().futureCall(request);
        +   *   // Do something.
        +   *   Policy response = future.get();
        +   * }
        +   * }
        + */ + public final UnaryCallable getIamPolicyCallable() { + return stub.getIamPolicyCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Returns permissions that a caller has on the specified resource. If the resource does not + * exist, this will return an empty set of permissions, not a `NOT_FOUND` error. + * + *

        Note: This operation is designed to be used for building permission-aware UIs and + * command-line tools, not for authorization checking. This operation may "fail open" without + * warning. + * + *

        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 (MessagingClient messagingClient = MessagingClient.create()) {
        +   *   TestIamPermissionsRequest request =
        +   *       TestIamPermissionsRequest.newBuilder()
        +   *           .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString())
        +   *           .addAllPermissions(new ArrayList())
        +   *           .build();
        +   *   TestIamPermissionsResponse response = messagingClient.testIamPermissions(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 TestIamPermissionsResponse testIamPermissions(TestIamPermissionsRequest request) { + return testIamPermissionsCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Returns permissions that a caller has on the specified resource. If the resource does not + * exist, this will return an empty set of permissions, not a `NOT_FOUND` error. + * + *

        Note: This operation is designed to be used for building permission-aware UIs and + * command-line tools, not for authorization checking. This operation may "fail open" without + * warning. + * + *

        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 (MessagingClient messagingClient = MessagingClient.create()) {
        +   *   TestIamPermissionsRequest request =
        +   *       TestIamPermissionsRequest.newBuilder()
        +   *           .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString())
        +   *           .addAllPermissions(new ArrayList())
        +   *           .build();
        +   *   ApiFuture future =
        +   *       messagingClient.testIamPermissionsCallable().futureCall(request);
        +   *   // Do something.
        +   *   TestIamPermissionsResponse response = future.get();
        +   * }
        +   * }
        + */ + public final UnaryCallable + testIamPermissionsCallable() { + return stub.testIamPermissionsCallable(); + } + + @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 ListRoomsPagedResponse + extends AbstractPagedListResponse< + ListRoomsRequest, ListRoomsResponse, Room, ListRoomsPage, ListRoomsFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListRoomsPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, input -> new ListRoomsPagedResponse(input), MoreExecutors.directExecutor()); + } + + private ListRoomsPagedResponse(ListRoomsPage page) { + super(page, ListRoomsFixedSizeCollection.createEmptyCollection()); + } + } + + public static class ListRoomsPage + extends AbstractPage { + + private ListRoomsPage( + PageContext context, + ListRoomsResponse response) { + super(context, response); + } + + private static ListRoomsPage createEmptyPage() { + return new ListRoomsPage(null, null); + } + + @Override + protected ListRoomsPage createPage( + PageContext context, + ListRoomsResponse response) { + return new ListRoomsPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class ListRoomsFixedSizeCollection + extends AbstractFixedSizeCollection< + ListRoomsRequest, ListRoomsResponse, Room, ListRoomsPage, ListRoomsFixedSizeCollection> { + + private ListRoomsFixedSizeCollection(List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListRoomsFixedSizeCollection createEmptyCollection() { + return new ListRoomsFixedSizeCollection(null, 0); + } + + @Override + protected ListRoomsFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListRoomsFixedSizeCollection(pages, collectionSize); + } + } + + public static class ListBlurbsPagedResponse + extends AbstractPagedListResponse< + ListBlurbsRequest, + ListBlurbsResponse, + Blurb, + ListBlurbsPage, + ListBlurbsFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListBlurbsPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, input -> new ListBlurbsPagedResponse(input), MoreExecutors.directExecutor()); + } + + private ListBlurbsPagedResponse(ListBlurbsPage page) { + super(page, ListBlurbsFixedSizeCollection.createEmptyCollection()); + } + } + + public static class ListBlurbsPage + extends AbstractPage { + + private ListBlurbsPage( + PageContext context, + ListBlurbsResponse response) { + super(context, response); + } + + private static ListBlurbsPage createEmptyPage() { + return new ListBlurbsPage(null, null); + } + + @Override + protected ListBlurbsPage createPage( + PageContext context, + ListBlurbsResponse response) { + return new ListBlurbsPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class ListBlurbsFixedSizeCollection + extends AbstractFixedSizeCollection< + ListBlurbsRequest, + ListBlurbsResponse, + Blurb, + ListBlurbsPage, + ListBlurbsFixedSizeCollection> { + + private ListBlurbsFixedSizeCollection(List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListBlurbsFixedSizeCollection createEmptyCollection() { + return new ListBlurbsFixedSizeCollection(null, 0); + } + + @Override + protected ListBlurbsFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListBlurbsFixedSizeCollection(pages, collectionSize); + } + } + + public static class ListLocationsPagedResponse + extends AbstractPagedListResponse< + ListLocationsRequest, + ListLocationsResponse, + Location, + ListLocationsPage, + ListLocationsFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListLocationsPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + input -> new ListLocationsPagedResponse(input), + MoreExecutors.directExecutor()); + } + + private ListLocationsPagedResponse(ListLocationsPage page) { + super(page, ListLocationsFixedSizeCollection.createEmptyCollection()); + } + } + + public static class ListLocationsPage + extends AbstractPage< + ListLocationsRequest, ListLocationsResponse, Location, ListLocationsPage> { + + private ListLocationsPage( + PageContext context, + ListLocationsResponse response) { + super(context, response); + } + + private static ListLocationsPage createEmptyPage() { + return new ListLocationsPage(null, null); + } + + @Override + protected ListLocationsPage createPage( + PageContext context, + ListLocationsResponse response) { + return new ListLocationsPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class ListLocationsFixedSizeCollection + extends AbstractFixedSizeCollection< + ListLocationsRequest, + ListLocationsResponse, + Location, + ListLocationsPage, + ListLocationsFixedSizeCollection> { + + private ListLocationsFixedSizeCollection(List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListLocationsFixedSizeCollection createEmptyCollection() { + return new ListLocationsFixedSizeCollection(null, 0); + } + + @Override + protected ListLocationsFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListLocationsFixedSizeCollection(pages, collectionSize); + } + } +} diff --git a/java-showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/MessagingSettings.java b/java-showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/MessagingSettings.java new file mode 100644 index 0000000000..5a7a29216f --- /dev/null +++ b/java-showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/MessagingSettings.java @@ -0,0 +1,463 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1; + +import static com.google.showcase.v1beta1.MessagingClient.ListBlurbsPagedResponse; +import static com.google.showcase.v1beta1.MessagingClient.ListLocationsPagedResponse; +import static com.google.showcase.v1beta1.MessagingClient.ListRoomsPagedResponse; + +import com.google.api.core.ApiFunction; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; +import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; +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.ServerStreamingCallSettings; +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.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.longrunning.Operation; +import com.google.protobuf.Empty; +import com.google.showcase.v1beta1.stub.MessagingStubSettings; +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 MessagingClient}. + * + *

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

          + *
        • The default service address (localhost) and default port (7469) 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 createRoom: + * + *

        {@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
        + * MessagingSettings.Builder messagingSettingsBuilder = MessagingSettings.newBuilder();
        + * messagingSettingsBuilder
        + *     .createRoomSettings()
        + *     .setRetrySettings(
        + *         messagingSettingsBuilder
        + *             .createRoomSettings()
        + *             .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());
        + * MessagingSettings messagingSettings = messagingSettingsBuilder.build();
        + * }
        + * + * Please refer to the [Client Side Retry + * Guide](https://docs.cloud.google.com/java/docs/client-retries) 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 searchBlurbs: + * + *

        {@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
        + * MessagingSettings.Builder messagingSettingsBuilder = MessagingSettings.newBuilder();
        + * TimedRetryAlgorithm timedRetryAlgorithm =
        + *     OperationalTimedPollAlgorithm.create(
        + *         RetrySettings.newBuilder()
        + *             .setInitialRetryDelayDuration(Duration.ofMillis(500))
        + *             .setRetryDelayMultiplier(1.5)
        + *             .setMaxRetryDelayDuration(Duration.ofMillis(5000))
        + *             .setTotalTimeoutDuration(Duration.ofHours(24))
        + *             .build());
        + * messagingSettingsBuilder
        + *     .createClusterOperationSettings()
        + *     .setPollingAlgorithm(timedRetryAlgorithm)
        + *     .build();
        + * }
        + */ +@BetaApi +@Generated("by gapic-generator-java") +public class MessagingSettings extends ClientSettings { + + /** Returns the object with the settings used for calls to createRoom. */ + public UnaryCallSettings createRoomSettings() { + return ((MessagingStubSettings) getStubSettings()).createRoomSettings(); + } + + /** Returns the object with the settings used for calls to getRoom. */ + public UnaryCallSettings getRoomSettings() { + return ((MessagingStubSettings) getStubSettings()).getRoomSettings(); + } + + /** Returns the object with the settings used for calls to updateRoom. */ + public UnaryCallSettings updateRoomSettings() { + return ((MessagingStubSettings) getStubSettings()).updateRoomSettings(); + } + + /** Returns the object with the settings used for calls to deleteRoom. */ + public UnaryCallSettings deleteRoomSettings() { + return ((MessagingStubSettings) getStubSettings()).deleteRoomSettings(); + } + + /** Returns the object with the settings used for calls to listRooms. */ + public PagedCallSettings + listRoomsSettings() { + return ((MessagingStubSettings) getStubSettings()).listRoomsSettings(); + } + + /** Returns the object with the settings used for calls to createBlurb. */ + public UnaryCallSettings createBlurbSettings() { + return ((MessagingStubSettings) getStubSettings()).createBlurbSettings(); + } + + /** Returns the object with the settings used for calls to getBlurb. */ + public UnaryCallSettings getBlurbSettings() { + return ((MessagingStubSettings) getStubSettings()).getBlurbSettings(); + } + + /** Returns the object with the settings used for calls to updateBlurb. */ + public UnaryCallSettings updateBlurbSettings() { + return ((MessagingStubSettings) getStubSettings()).updateBlurbSettings(); + } + + /** Returns the object with the settings used for calls to deleteBlurb. */ + public UnaryCallSettings deleteBlurbSettings() { + return ((MessagingStubSettings) getStubSettings()).deleteBlurbSettings(); + } + + /** Returns the object with the settings used for calls to listBlurbs. */ + public PagedCallSettings + listBlurbsSettings() { + return ((MessagingStubSettings) getStubSettings()).listBlurbsSettings(); + } + + /** Returns the object with the settings used for calls to searchBlurbs. */ + public UnaryCallSettings searchBlurbsSettings() { + return ((MessagingStubSettings) getStubSettings()).searchBlurbsSettings(); + } + + /** Returns the object with the settings used for calls to searchBlurbs. */ + public OperationCallSettings + searchBlurbsOperationSettings() { + return ((MessagingStubSettings) getStubSettings()).searchBlurbsOperationSettings(); + } + + /** Returns the object with the settings used for calls to streamBlurbs. */ + public ServerStreamingCallSettings + streamBlurbsSettings() { + return ((MessagingStubSettings) getStubSettings()).streamBlurbsSettings(); + } + + /** Returns the object with the settings used for calls to sendBlurbs. */ + public StreamingCallSettings sendBlurbsSettings() { + return ((MessagingStubSettings) getStubSettings()).sendBlurbsSettings(); + } + + /** Returns the object with the settings used for calls to connect. */ + public StreamingCallSettings connectSettings() { + return ((MessagingStubSettings) getStubSettings()).connectSettings(); + } + + /** Returns the object with the settings used for calls to listLocations. */ + public PagedCallSettings + listLocationsSettings() { + return ((MessagingStubSettings) getStubSettings()).listLocationsSettings(); + } + + /** Returns the object with the settings used for calls to getLocation. */ + public UnaryCallSettings getLocationSettings() { + return ((MessagingStubSettings) getStubSettings()).getLocationSettings(); + } + + /** Returns the object with the settings used for calls to setIamPolicy. */ + public UnaryCallSettings setIamPolicySettings() { + return ((MessagingStubSettings) getStubSettings()).setIamPolicySettings(); + } + + /** Returns the object with the settings used for calls to getIamPolicy. */ + public UnaryCallSettings getIamPolicySettings() { + return ((MessagingStubSettings) getStubSettings()).getIamPolicySettings(); + } + + /** Returns the object with the settings used for calls to testIamPermissions. */ + public UnaryCallSettings + testIamPermissionsSettings() { + return ((MessagingStubSettings) getStubSettings()).testIamPermissionsSettings(); + } + + public static final MessagingSettings create(MessagingStubSettings stub) throws IOException { + return new MessagingSettings.Builder(stub.toBuilder()).build(); + } + + /** Returns a builder for the default ExecutorProvider for this service. */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return MessagingStubSettings.defaultExecutorProviderBuilder(); + } + + /** Returns the default service endpoint. */ + public static String getDefaultEndpoint() { + return MessagingStubSettings.getDefaultEndpoint(); + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return MessagingStubSettings.getDefaultServiceScopes(); + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return MessagingStubSettings.defaultCredentialsProviderBuilder(); + } + + /** Returns a builder for the default gRPC ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return MessagingStubSettings.defaultGrpcTransportProviderBuilder(); + } + + /** Returns a builder for the default REST ChannelProvider for this service. */ + @BetaApi + public static InstantiatingHttpJsonChannelProvider.Builder + defaultHttpJsonTransportProviderBuilder() { + return MessagingStubSettings.defaultHttpJsonTransportProviderBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return MessagingStubSettings.defaultTransportChannelProvider(); + } + + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return MessagingStubSettings.defaultApiClientHeaderProviderBuilder(); + } + + /** Returns a new gRPC builder for this class. */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** Returns a new REST builder for this class. */ + public static Builder newHttpJsonBuilder() { + return Builder.createHttpJsonDefault(); + } + + /** 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 MessagingSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + } + + /** Builder for MessagingSettings. */ + public static class Builder extends ClientSettings.Builder { + + protected Builder() throws IOException { + this(((ClientContext) null)); + } + + protected Builder(ClientContext clientContext) { + super(MessagingStubSettings.newBuilder(clientContext)); + } + + protected Builder(MessagingSettings settings) { + super(settings.getStubSettings().toBuilder()); + } + + protected Builder(MessagingStubSettings.Builder stubSettings) { + super(stubSettings); + } + + private static Builder createDefault() { + return new Builder(MessagingStubSettings.newBuilder()); + } + + private static Builder createHttpJsonDefault() { + return new Builder(MessagingStubSettings.newHttpJsonBuilder()); + } + + public MessagingStubSettings.Builder getStubSettingsBuilder() { + return ((MessagingStubSettings.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 createRoom. */ + public UnaryCallSettings.Builder createRoomSettings() { + return getStubSettingsBuilder().createRoomSettings(); + } + + /** Returns the builder for the settings used for calls to getRoom. */ + public UnaryCallSettings.Builder getRoomSettings() { + return getStubSettingsBuilder().getRoomSettings(); + } + + /** Returns the builder for the settings used for calls to updateRoom. */ + public UnaryCallSettings.Builder updateRoomSettings() { + return getStubSettingsBuilder().updateRoomSettings(); + } + + /** Returns the builder for the settings used for calls to deleteRoom. */ + public UnaryCallSettings.Builder deleteRoomSettings() { + return getStubSettingsBuilder().deleteRoomSettings(); + } + + /** Returns the builder for the settings used for calls to listRooms. */ + public PagedCallSettings.Builder + listRoomsSettings() { + return getStubSettingsBuilder().listRoomsSettings(); + } + + /** Returns the builder for the settings used for calls to createBlurb. */ + public UnaryCallSettings.Builder createBlurbSettings() { + return getStubSettingsBuilder().createBlurbSettings(); + } + + /** Returns the builder for the settings used for calls to getBlurb. */ + public UnaryCallSettings.Builder getBlurbSettings() { + return getStubSettingsBuilder().getBlurbSettings(); + } + + /** Returns the builder for the settings used for calls to updateBlurb. */ + public UnaryCallSettings.Builder updateBlurbSettings() { + return getStubSettingsBuilder().updateBlurbSettings(); + } + + /** Returns the builder for the settings used for calls to deleteBlurb. */ + public UnaryCallSettings.Builder deleteBlurbSettings() { + return getStubSettingsBuilder().deleteBlurbSettings(); + } + + /** Returns the builder for the settings used for calls to listBlurbs. */ + public PagedCallSettings.Builder + listBlurbsSettings() { + return getStubSettingsBuilder().listBlurbsSettings(); + } + + /** Returns the builder for the settings used for calls to searchBlurbs. */ + public UnaryCallSettings.Builder searchBlurbsSettings() { + return getStubSettingsBuilder().searchBlurbsSettings(); + } + + /** Returns the builder for the settings used for calls to searchBlurbs. */ + public OperationCallSettings.Builder< + SearchBlurbsRequest, SearchBlurbsResponse, SearchBlurbsMetadata> + searchBlurbsOperationSettings() { + return getStubSettingsBuilder().searchBlurbsOperationSettings(); + } + + /** Returns the builder for the settings used for calls to streamBlurbs. */ + public ServerStreamingCallSettings.Builder + streamBlurbsSettings() { + return getStubSettingsBuilder().streamBlurbsSettings(); + } + + /** Returns the builder for the settings used for calls to sendBlurbs. */ + public StreamingCallSettings.Builder + sendBlurbsSettings() { + return getStubSettingsBuilder().sendBlurbsSettings(); + } + + /** Returns the builder for the settings used for calls to connect. */ + public StreamingCallSettings.Builder connectSettings() { + return getStubSettingsBuilder().connectSettings(); + } + + /** Returns the builder for the settings used for calls to listLocations. */ + public PagedCallSettings.Builder< + ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse> + listLocationsSettings() { + return getStubSettingsBuilder().listLocationsSettings(); + } + + /** Returns the builder for the settings used for calls to getLocation. */ + public UnaryCallSettings.Builder getLocationSettings() { + return getStubSettingsBuilder().getLocationSettings(); + } + + /** Returns the builder for the settings used for calls to setIamPolicy. */ + public UnaryCallSettings.Builder setIamPolicySettings() { + return getStubSettingsBuilder().setIamPolicySettings(); + } + + /** Returns the builder for the settings used for calls to getIamPolicy. */ + public UnaryCallSettings.Builder getIamPolicySettings() { + return getStubSettingsBuilder().getIamPolicySettings(); + } + + /** Returns the builder for the settings used for calls to testIamPermissions. */ + public UnaryCallSettings.Builder + testIamPermissionsSettings() { + return getStubSettingsBuilder().testIamPermissionsSettings(); + } + + @Override + public MessagingSettings build() throws IOException { + return new MessagingSettings(this); + } + } +} diff --git a/java-showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/SequenceServiceClient.java b/java-showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/SequenceServiceClient.java new file mode 100644 index 0000000000..29be19656f --- /dev/null +++ b/java-showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/SequenceServiceClient.java @@ -0,0 +1,1342 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1; + +import com.google.api.core.ApiFuture; +import com.google.api.core.ApiFutures; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.paging.AbstractFixedSizeCollection; +import com.google.api.gax.paging.AbstractPage; +import com.google.api.gax.paging.AbstractPagedListResponse; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.common.util.concurrent.MoreExecutors; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.protobuf.Empty; +import com.google.showcase.v1beta1.stub.SequenceServiceStub; +import com.google.showcase.v1beta1.stub.SequenceServiceStubSettings; +import java.io.IOException; +import java.util.List; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * 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 (SequenceServiceClient sequenceServiceClient = SequenceServiceClient.create()) {
        + *   Sequence sequence = Sequence.newBuilder().build();
        + *   Sequence response = sequenceServiceClient.createSequence(sequence);
        + * }
        + * }
        + * + *

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

        CreateSequence

        Creates a sequence.

        + *

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

        + *
          + *
        • createSequence(CreateSequenceRequest request) + *

        + *

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

        + *
          + *
        • createSequence(Sequence sequence) + *

        + *

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

        + *
          + *
        • createSequenceCallable() + *

        + *

        CreateStreamingSequence

        Creates a sequence.

        + *

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

        + *
          + *
        • createStreamingSequence(CreateStreamingSequenceRequest request) + *

        + *

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

        + *
          + *
        • createStreamingSequence(StreamingSequence streamingSequence) + *

        + *

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

        + *
          + *
        • createStreamingSequenceCallable() + *

        + *

        GetSequenceReport

        Retrieves a sequence.

        + *

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

        + *
          + *
        • getSequenceReport(GetSequenceReportRequest request) + *

        + *

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

        + *
          + *
        • getSequenceReport(SequenceReportName name) + *

        • getSequenceReport(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.

        + *
          + *
        • getSequenceReportCallable() + *

        + *

        GetStreamingSequenceReport

        Retrieves a sequence.

        + *

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

        + *
          + *
        • getStreamingSequenceReport(GetStreamingSequenceReportRequest request) + *

        + *

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

        + *
          + *
        • getStreamingSequenceReport(StreamingSequenceReportName name) + *

        • getStreamingSequenceReport(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.

        + *
          + *
        • getStreamingSequenceReportCallable() + *

        + *

        AttemptSequence

        Attempts a sequence.

        + *

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

        + *
          + *
        • attemptSequence(AttemptSequenceRequest request) + *

        + *

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

        + *
          + *
        • attemptSequence(SequenceName name) + *

        • attemptSequence(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.

        + *
          + *
        • attemptSequenceCallable() + *

        + *

        AttemptStreamingSequence

        Attempts a streaming sequence. May not function as expected in HTTP mode due to when http statuses are sent See https://github.com/googleapis/gapic-showcase/issues/1377 for more details

        + *

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

        + *
          + *
        • attemptStreamingSequenceCallable() + *

        + *

        ListLocations

        Lists information about the supported locations for this service.

        + *

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

        + *
          + *
        • listLocations(ListLocationsRequest request) + *

        + *

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

        + *
          + *
        • listLocationsPagedCallable() + *

        • listLocationsCallable() + *

        + *

        GetLocation

        Gets information about a location.

        + *

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

        + *
          + *
        • getLocation(GetLocationRequest request) + *

        + *

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

        + *
          + *
        • getLocationCallable() + *

        + *

        SetIamPolicy

        Sets the access control policy on the specified resource. Replaces any existing policy. + *

        Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED` errors.

        + *

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

        + *
          + *
        • setIamPolicy(SetIamPolicyRequest request) + *

        + *

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

        + *
          + *
        • setIamPolicyCallable() + *

        + *

        GetIamPolicy

        Gets the access control policy for a resource. Returns an empty policy if the resource exists and does not have a policy set.

        + *

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

        + *
          + *
        • getIamPolicy(GetIamPolicyRequest request) + *

        + *

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

        + *
          + *
        • getIamPolicyCallable() + *

        + *

        TestIamPermissions

        Returns permissions that a caller has on the specified resource. If the resource does not exist, this will return an empty set of permissions, not a `NOT_FOUND` error. + *

        Note: This operation is designed to be used for building permission-aware UIs and command-line tools, not for authorization checking. This operation may "fail open" without warning.

        + *

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

        + *
          + *
        • testIamPermissions(TestIamPermissionsRequest request) + *

        + *

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

        + *
          + *
        • testIamPermissionsCallable() + *

        + *
        + * + *

        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 SequenceServiceSettings 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
        + * SequenceServiceSettings sequenceServiceSettings =
        + *     SequenceServiceSettings.newBuilder()
        + *         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
        + *         .build();
        + * SequenceServiceClient sequenceServiceClient =
        + *     SequenceServiceClient.create(sequenceServiceSettings);
        + * }
        + * + *

        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
        + * SequenceServiceSettings sequenceServiceSettings =
        + *     SequenceServiceSettings.newBuilder().setEndpoint(myEndpoint).build();
        + * SequenceServiceClient sequenceServiceClient =
        + *     SequenceServiceClient.create(sequenceServiceSettings);
        + * }
        + * + *

        To use REST (HTTP1.1/JSON) transport (instead of gRPC) for sending and receiving requests over + * the wire: + * + *

        {@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
        + * SequenceServiceSettings sequenceServiceSettings =
        + *     SequenceServiceSettings.newHttpJsonBuilder().build();
        + * SequenceServiceClient sequenceServiceClient =
        + *     SequenceServiceClient.create(sequenceServiceSettings);
        + * }
        + * + *

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

        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 (SequenceServiceClient sequenceServiceClient = SequenceServiceClient.create()) {
        +   *   Sequence sequence = Sequence.newBuilder().build();
        +   *   Sequence response = sequenceServiceClient.createSequence(sequence);
        +   * }
        +   * }
        + * + * @param sequence + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Sequence createSequence(Sequence sequence) { + CreateSequenceRequest request = + CreateSequenceRequest.newBuilder().setSequence(sequence).build(); + return createSequence(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a sequence. + * + *

        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 (SequenceServiceClient sequenceServiceClient = SequenceServiceClient.create()) {
        +   *   CreateSequenceRequest request =
        +   *       CreateSequenceRequest.newBuilder().setSequence(Sequence.newBuilder().build()).build();
        +   *   Sequence response = sequenceServiceClient.createSequence(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 Sequence createSequence(CreateSequenceRequest request) { + return createSequenceCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a sequence. + * + *

        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 (SequenceServiceClient sequenceServiceClient = SequenceServiceClient.create()) {
        +   *   CreateSequenceRequest request =
        +   *       CreateSequenceRequest.newBuilder().setSequence(Sequence.newBuilder().build()).build();
        +   *   ApiFuture future =
        +   *       sequenceServiceClient.createSequenceCallable().futureCall(request);
        +   *   // Do something.
        +   *   Sequence response = future.get();
        +   * }
        +   * }
        + */ + public final UnaryCallable createSequenceCallable() { + return stub.createSequenceCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a sequence. + * + *

        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 (SequenceServiceClient sequenceServiceClient = SequenceServiceClient.create()) {
        +   *   StreamingSequence streamingSequence = StreamingSequence.newBuilder().build();
        +   *   StreamingSequence response = sequenceServiceClient.createStreamingSequence(streamingSequence);
        +   * }
        +   * }
        + * + * @param streamingSequence + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final StreamingSequence createStreamingSequence(StreamingSequence streamingSequence) { + CreateStreamingSequenceRequest request = + CreateStreamingSequenceRequest.newBuilder().setStreamingSequence(streamingSequence).build(); + return createStreamingSequence(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a sequence. + * + *

        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 (SequenceServiceClient sequenceServiceClient = SequenceServiceClient.create()) {
        +   *   CreateStreamingSequenceRequest request =
        +   *       CreateStreamingSequenceRequest.newBuilder()
        +   *           .setStreamingSequence(StreamingSequence.newBuilder().build())
        +   *           .build();
        +   *   StreamingSequence response = sequenceServiceClient.createStreamingSequence(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 StreamingSequence createStreamingSequence(CreateStreamingSequenceRequest request) { + return createStreamingSequenceCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a sequence. + * + *

        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 (SequenceServiceClient sequenceServiceClient = SequenceServiceClient.create()) {
        +   *   CreateStreamingSequenceRequest request =
        +   *       CreateStreamingSequenceRequest.newBuilder()
        +   *           .setStreamingSequence(StreamingSequence.newBuilder().build())
        +   *           .build();
        +   *   ApiFuture future =
        +   *       sequenceServiceClient.createStreamingSequenceCallable().futureCall(request);
        +   *   // Do something.
        +   *   StreamingSequence response = future.get();
        +   * }
        +   * }
        + */ + public final UnaryCallable + createStreamingSequenceCallable() { + return stub.createStreamingSequenceCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Retrieves a sequence. + * + *

        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 (SequenceServiceClient sequenceServiceClient = SequenceServiceClient.create()) {
        +   *   SequenceReportName name = SequenceReportName.of("[SEQUENCE]");
        +   *   SequenceReport response = sequenceServiceClient.getSequenceReport(name);
        +   * }
        +   * }
        + * + * @param name + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final SequenceReport getSequenceReport(SequenceReportName name) { + GetSequenceReportRequest request = + GetSequenceReportRequest.newBuilder() + .setName(name == null ? null : name.toString()) + .build(); + return getSequenceReport(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Retrieves a sequence. + * + *

        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 (SequenceServiceClient sequenceServiceClient = SequenceServiceClient.create()) {
        +   *   String name = SequenceReportName.of("[SEQUENCE]").toString();
        +   *   SequenceReport response = sequenceServiceClient.getSequenceReport(name);
        +   * }
        +   * }
        + * + * @param name + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final SequenceReport getSequenceReport(String name) { + GetSequenceReportRequest request = GetSequenceReportRequest.newBuilder().setName(name).build(); + return getSequenceReport(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Retrieves a sequence. + * + *

        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 (SequenceServiceClient sequenceServiceClient = SequenceServiceClient.create()) {
        +   *   GetSequenceReportRequest request =
        +   *       GetSequenceReportRequest.newBuilder()
        +   *           .setName(SequenceReportName.of("[SEQUENCE]").toString())
        +   *           .build();
        +   *   SequenceReport response = sequenceServiceClient.getSequenceReport(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 SequenceReport getSequenceReport(GetSequenceReportRequest request) { + return getSequenceReportCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Retrieves a sequence. + * + *

        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 (SequenceServiceClient sequenceServiceClient = SequenceServiceClient.create()) {
        +   *   GetSequenceReportRequest request =
        +   *       GetSequenceReportRequest.newBuilder()
        +   *           .setName(SequenceReportName.of("[SEQUENCE]").toString())
        +   *           .build();
        +   *   ApiFuture future =
        +   *       sequenceServiceClient.getSequenceReportCallable().futureCall(request);
        +   *   // Do something.
        +   *   SequenceReport response = future.get();
        +   * }
        +   * }
        + */ + public final UnaryCallable getSequenceReportCallable() { + return stub.getSequenceReportCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Retrieves a sequence. + * + *

        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 (SequenceServiceClient sequenceServiceClient = SequenceServiceClient.create()) {
        +   *   StreamingSequenceReportName name = StreamingSequenceReportName.of("[STREAMING_SEQUENCE]");
        +   *   StreamingSequenceReport response = sequenceServiceClient.getStreamingSequenceReport(name);
        +   * }
        +   * }
        + * + * @param name + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final StreamingSequenceReport getStreamingSequenceReport( + StreamingSequenceReportName name) { + GetStreamingSequenceReportRequest request = + GetStreamingSequenceReportRequest.newBuilder() + .setName(name == null ? null : name.toString()) + .build(); + return getStreamingSequenceReport(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Retrieves a sequence. + * + *

        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 (SequenceServiceClient sequenceServiceClient = SequenceServiceClient.create()) {
        +   *   String name = StreamingSequenceReportName.of("[STREAMING_SEQUENCE]").toString();
        +   *   StreamingSequenceReport response = sequenceServiceClient.getStreamingSequenceReport(name);
        +   * }
        +   * }
        + * + * @param name + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final StreamingSequenceReport getStreamingSequenceReport(String name) { + GetStreamingSequenceReportRequest request = + GetStreamingSequenceReportRequest.newBuilder().setName(name).build(); + return getStreamingSequenceReport(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Retrieves a sequence. + * + *

        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 (SequenceServiceClient sequenceServiceClient = SequenceServiceClient.create()) {
        +   *   GetStreamingSequenceReportRequest request =
        +   *       GetStreamingSequenceReportRequest.newBuilder()
        +   *           .setName(StreamingSequenceReportName.of("[STREAMING_SEQUENCE]").toString())
        +   *           .build();
        +   *   StreamingSequenceReport response = sequenceServiceClient.getStreamingSequenceReport(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 StreamingSequenceReport getStreamingSequenceReport( + GetStreamingSequenceReportRequest request) { + return getStreamingSequenceReportCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Retrieves a sequence. + * + *

        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 (SequenceServiceClient sequenceServiceClient = SequenceServiceClient.create()) {
        +   *   GetStreamingSequenceReportRequest request =
        +   *       GetStreamingSequenceReportRequest.newBuilder()
        +   *           .setName(StreamingSequenceReportName.of("[STREAMING_SEQUENCE]").toString())
        +   *           .build();
        +   *   ApiFuture future =
        +   *       sequenceServiceClient.getStreamingSequenceReportCallable().futureCall(request);
        +   *   // Do something.
        +   *   StreamingSequenceReport response = future.get();
        +   * }
        +   * }
        + */ + public final UnaryCallable + getStreamingSequenceReportCallable() { + return stub.getStreamingSequenceReportCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Attempts a sequence. + * + *

        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 (SequenceServiceClient sequenceServiceClient = SequenceServiceClient.create()) {
        +   *   SequenceName name = SequenceName.of("[SEQUENCE]");
        +   *   sequenceServiceClient.attemptSequence(name);
        +   * }
        +   * }
        + * + * @param name + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final void attemptSequence(SequenceName name) { + AttemptSequenceRequest request = + AttemptSequenceRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + attemptSequence(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Attempts a sequence. + * + *

        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 (SequenceServiceClient sequenceServiceClient = SequenceServiceClient.create()) {
        +   *   String name = SequenceName.of("[SEQUENCE]").toString();
        +   *   sequenceServiceClient.attemptSequence(name);
        +   * }
        +   * }
        + * + * @param name + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final void attemptSequence(String name) { + AttemptSequenceRequest request = AttemptSequenceRequest.newBuilder().setName(name).build(); + attemptSequence(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Attempts a sequence. + * + *

        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 (SequenceServiceClient sequenceServiceClient = SequenceServiceClient.create()) {
        +   *   AttemptSequenceRequest request =
        +   *       AttemptSequenceRequest.newBuilder()
        +   *           .setName(SequenceName.of("[SEQUENCE]").toString())
        +   *           .build();
        +   *   sequenceServiceClient.attemptSequence(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 attemptSequence(AttemptSequenceRequest request) { + attemptSequenceCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Attempts a sequence. + * + *

        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 (SequenceServiceClient sequenceServiceClient = SequenceServiceClient.create()) {
        +   *   AttemptSequenceRequest request =
        +   *       AttemptSequenceRequest.newBuilder()
        +   *           .setName(SequenceName.of("[SEQUENCE]").toString())
        +   *           .build();
        +   *   ApiFuture future = sequenceServiceClient.attemptSequenceCallable().futureCall(request);
        +   *   // Do something.
        +   *   future.get();
        +   * }
        +   * }
        + */ + public final UnaryCallable attemptSequenceCallable() { + return stub.attemptSequenceCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Attempts a streaming sequence. May not function as expected in HTTP mode due to when http + * statuses are sent See https://github.com/googleapis/gapic-showcase/issues/1377 for more details + * + *

        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 (SequenceServiceClient sequenceServiceClient = SequenceServiceClient.create()) {
        +   *   AttemptStreamingSequenceRequest request =
        +   *       AttemptStreamingSequenceRequest.newBuilder()
        +   *           .setName(StreamingSequenceName.of("[STREAMING_SEQUENCE]").toString())
        +   *           .setLastFailIndex(2006482362)
        +   *           .build();
        +   *   ServerStream stream =
        +   *       sequenceServiceClient.attemptStreamingSequenceCallable().call(request);
        +   *   for (AttemptStreamingSequenceResponse response : stream) {
        +   *     // Do something when a response is received.
        +   *   }
        +   * }
        +   * }
        + */ + public final ServerStreamingCallable< + AttemptStreamingSequenceRequest, AttemptStreamingSequenceResponse> + attemptStreamingSequenceCallable() { + return stub.attemptStreamingSequenceCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists information about the supported locations for this service. + * + *

        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 (SequenceServiceClient sequenceServiceClient = SequenceServiceClient.create()) {
        +   *   ListLocationsRequest request =
        +   *       ListLocationsRequest.newBuilder()
        +   *           .setName("name3373707")
        +   *           .setFilter("filter-1274492040")
        +   *           .setPageSize(883849137)
        +   *           .setPageToken("pageToken873572522")
        +   *           .build();
        +   *   for (Location element : sequenceServiceClient.listLocations(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 ListLocationsPagedResponse listLocations(ListLocationsRequest request) { + return listLocationsPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists information about the supported locations for this service. + * + *

        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 (SequenceServiceClient sequenceServiceClient = SequenceServiceClient.create()) {
        +   *   ListLocationsRequest request =
        +   *       ListLocationsRequest.newBuilder()
        +   *           .setName("name3373707")
        +   *           .setFilter("filter-1274492040")
        +   *           .setPageSize(883849137)
        +   *           .setPageToken("pageToken873572522")
        +   *           .build();
        +   *   ApiFuture future =
        +   *       sequenceServiceClient.listLocationsPagedCallable().futureCall(request);
        +   *   // Do something.
        +   *   for (Location element : future.get().iterateAll()) {
        +   *     // doThingsWith(element);
        +   *   }
        +   * }
        +   * }
        + */ + public final UnaryCallable + listLocationsPagedCallable() { + return stub.listLocationsPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists information about the supported locations for this service. + * + *

        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 (SequenceServiceClient sequenceServiceClient = SequenceServiceClient.create()) {
        +   *   ListLocationsRequest request =
        +   *       ListLocationsRequest.newBuilder()
        +   *           .setName("name3373707")
        +   *           .setFilter("filter-1274492040")
        +   *           .setPageSize(883849137)
        +   *           .setPageToken("pageToken873572522")
        +   *           .build();
        +   *   while (true) {
        +   *     ListLocationsResponse response =
        +   *         sequenceServiceClient.listLocationsCallable().call(request);
        +   *     for (Location element : response.getLocationsList()) {
        +   *       // doThingsWith(element);
        +   *     }
        +   *     String nextPageToken = response.getNextPageToken();
        +   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
        +   *       request = request.toBuilder().setPageToken(nextPageToken).build();
        +   *     } else {
        +   *       break;
        +   *     }
        +   *   }
        +   * }
        +   * }
        + */ + public final UnaryCallable listLocationsCallable() { + return stub.listLocationsCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets information about a location. + * + *

        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 (SequenceServiceClient sequenceServiceClient = SequenceServiceClient.create()) {
        +   *   GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build();
        +   *   Location response = sequenceServiceClient.getLocation(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 Location getLocation(GetLocationRequest request) { + return getLocationCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets information about a location. + * + *

        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 (SequenceServiceClient sequenceServiceClient = SequenceServiceClient.create()) {
        +   *   GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build();
        +   *   ApiFuture future = sequenceServiceClient.getLocationCallable().futureCall(request);
        +   *   // Do something.
        +   *   Location response = future.get();
        +   * }
        +   * }
        + */ + public final UnaryCallable getLocationCallable() { + return stub.getLocationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Sets the access control policy on the specified resource. Replaces any existing policy. + * + *

        Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED` errors. + * + *

        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 (SequenceServiceClient sequenceServiceClient = SequenceServiceClient.create()) {
        +   *   SetIamPolicyRequest request =
        +   *       SetIamPolicyRequest.newBuilder()
        +   *           .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString())
        +   *           .setPolicy(Policy.newBuilder().build())
        +   *           .setUpdateMask(FieldMask.newBuilder().build())
        +   *           .build();
        +   *   Policy response = sequenceServiceClient.setIamPolicy(request);
        +   * }
        +   * }
        + * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Policy setIamPolicy(SetIamPolicyRequest request) { + return setIamPolicyCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Sets the access control policy on the specified resource. Replaces any existing policy. + * + *

        Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED` errors. + * + *

        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 (SequenceServiceClient sequenceServiceClient = SequenceServiceClient.create()) {
        +   *   SetIamPolicyRequest request =
        +   *       SetIamPolicyRequest.newBuilder()
        +   *           .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString())
        +   *           .setPolicy(Policy.newBuilder().build())
        +   *           .setUpdateMask(FieldMask.newBuilder().build())
        +   *           .build();
        +   *   ApiFuture future = sequenceServiceClient.setIamPolicyCallable().futureCall(request);
        +   *   // Do something.
        +   *   Policy response = future.get();
        +   * }
        +   * }
        + */ + public final UnaryCallable setIamPolicyCallable() { + return stub.setIamPolicyCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets the access control policy for a resource. Returns an empty policy if the resource exists + * and does not have a policy set. + * + *

        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 (SequenceServiceClient sequenceServiceClient = SequenceServiceClient.create()) {
        +   *   GetIamPolicyRequest request =
        +   *       GetIamPolicyRequest.newBuilder()
        +   *           .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString())
        +   *           .setOptions(GetPolicyOptions.newBuilder().build())
        +   *           .build();
        +   *   Policy response = sequenceServiceClient.getIamPolicy(request);
        +   * }
        +   * }
        + * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Policy getIamPolicy(GetIamPolicyRequest request) { + return getIamPolicyCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets the access control policy for a resource. Returns an empty policy if the resource exists + * and does not have a policy set. + * + *

        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 (SequenceServiceClient sequenceServiceClient = SequenceServiceClient.create()) {
        +   *   GetIamPolicyRequest request =
        +   *       GetIamPolicyRequest.newBuilder()
        +   *           .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString())
        +   *           .setOptions(GetPolicyOptions.newBuilder().build())
        +   *           .build();
        +   *   ApiFuture future = sequenceServiceClient.getIamPolicyCallable().futureCall(request);
        +   *   // Do something.
        +   *   Policy response = future.get();
        +   * }
        +   * }
        + */ + public final UnaryCallable getIamPolicyCallable() { + return stub.getIamPolicyCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Returns permissions that a caller has on the specified resource. If the resource does not + * exist, this will return an empty set of permissions, not a `NOT_FOUND` error. + * + *

        Note: This operation is designed to be used for building permission-aware UIs and + * command-line tools, not for authorization checking. This operation may "fail open" without + * warning. + * + *

        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 (SequenceServiceClient sequenceServiceClient = SequenceServiceClient.create()) {
        +   *   TestIamPermissionsRequest request =
        +   *       TestIamPermissionsRequest.newBuilder()
        +   *           .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString())
        +   *           .addAllPermissions(new ArrayList())
        +   *           .build();
        +   *   TestIamPermissionsResponse response = sequenceServiceClient.testIamPermissions(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 TestIamPermissionsResponse testIamPermissions(TestIamPermissionsRequest request) { + return testIamPermissionsCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Returns permissions that a caller has on the specified resource. If the resource does not + * exist, this will return an empty set of permissions, not a `NOT_FOUND` error. + * + *

        Note: This operation is designed to be used for building permission-aware UIs and + * command-line tools, not for authorization checking. This operation may "fail open" without + * warning. + * + *

        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 (SequenceServiceClient sequenceServiceClient = SequenceServiceClient.create()) {
        +   *   TestIamPermissionsRequest request =
        +   *       TestIamPermissionsRequest.newBuilder()
        +   *           .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString())
        +   *           .addAllPermissions(new ArrayList())
        +   *           .build();
        +   *   ApiFuture future =
        +   *       sequenceServiceClient.testIamPermissionsCallable().futureCall(request);
        +   *   // Do something.
        +   *   TestIamPermissionsResponse response = future.get();
        +   * }
        +   * }
        + */ + public final UnaryCallable + testIamPermissionsCallable() { + return stub.testIamPermissionsCallable(); + } + + @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 ListLocationsPagedResponse + extends AbstractPagedListResponse< + ListLocationsRequest, + ListLocationsResponse, + Location, + ListLocationsPage, + ListLocationsFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListLocationsPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + input -> new ListLocationsPagedResponse(input), + MoreExecutors.directExecutor()); + } + + private ListLocationsPagedResponse(ListLocationsPage page) { + super(page, ListLocationsFixedSizeCollection.createEmptyCollection()); + } + } + + public static class ListLocationsPage + extends AbstractPage< + ListLocationsRequest, ListLocationsResponse, Location, ListLocationsPage> { + + private ListLocationsPage( + PageContext context, + ListLocationsResponse response) { + super(context, response); + } + + private static ListLocationsPage createEmptyPage() { + return new ListLocationsPage(null, null); + } + + @Override + protected ListLocationsPage createPage( + PageContext context, + ListLocationsResponse response) { + return new ListLocationsPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class ListLocationsFixedSizeCollection + extends AbstractFixedSizeCollection< + ListLocationsRequest, + ListLocationsResponse, + Location, + ListLocationsPage, + ListLocationsFixedSizeCollection> { + + private ListLocationsFixedSizeCollection(List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListLocationsFixedSizeCollection createEmptyCollection() { + return new ListLocationsFixedSizeCollection(null, 0); + } + + @Override + protected ListLocationsFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListLocationsFixedSizeCollection(pages, collectionSize); + } + } +} diff --git a/java-showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/SequenceServiceSettings.java b/java-showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/SequenceServiceSettings.java new file mode 100644 index 0000000000..ef27a713df --- /dev/null +++ b/java-showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/SequenceServiceSettings.java @@ -0,0 +1,344 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1; + +import static com.google.showcase.v1beta1.SequenceServiceClient.ListLocationsPagedResponse; + +import com.google.api.core.ApiFunction; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; +import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; +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.ServerStreamingCallSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.protobuf.Empty; +import com.google.showcase.v1beta1.stub.SequenceServiceStubSettings; +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 SequenceServiceClient}. + * + *

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

          + *
        • The default service address (localhost) and default port (7469) 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 createSequence: + * + *

        {@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
        + * SequenceServiceSettings.Builder sequenceServiceSettingsBuilder =
        + *     SequenceServiceSettings.newBuilder();
        + * sequenceServiceSettingsBuilder
        + *     .createSequenceSettings()
        + *     .setRetrySettings(
        + *         sequenceServiceSettingsBuilder
        + *             .createSequenceSettings()
        + *             .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());
        + * SequenceServiceSettings sequenceServiceSettings = sequenceServiceSettingsBuilder.build();
        + * }
        + * + * Please refer to the [Client Side Retry + * Guide](https://docs.cloud.google.com/java/docs/client-retries) for additional support in setting + * retries. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class SequenceServiceSettings extends ClientSettings { + + /** Returns the object with the settings used for calls to createSequence. */ + public UnaryCallSettings createSequenceSettings() { + return ((SequenceServiceStubSettings) getStubSettings()).createSequenceSettings(); + } + + /** Returns the object with the settings used for calls to createStreamingSequence. */ + public UnaryCallSettings + createStreamingSequenceSettings() { + return ((SequenceServiceStubSettings) getStubSettings()).createStreamingSequenceSettings(); + } + + /** Returns the object with the settings used for calls to getSequenceReport. */ + public UnaryCallSettings getSequenceReportSettings() { + return ((SequenceServiceStubSettings) getStubSettings()).getSequenceReportSettings(); + } + + /** Returns the object with the settings used for calls to getStreamingSequenceReport. */ + public UnaryCallSettings + getStreamingSequenceReportSettings() { + return ((SequenceServiceStubSettings) getStubSettings()).getStreamingSequenceReportSettings(); + } + + /** Returns the object with the settings used for calls to attemptSequence. */ + public UnaryCallSettings attemptSequenceSettings() { + return ((SequenceServiceStubSettings) getStubSettings()).attemptSequenceSettings(); + } + + /** Returns the object with the settings used for calls to attemptStreamingSequence. */ + public ServerStreamingCallSettings< + AttemptStreamingSequenceRequest, AttemptStreamingSequenceResponse> + attemptStreamingSequenceSettings() { + return ((SequenceServiceStubSettings) getStubSettings()).attemptStreamingSequenceSettings(); + } + + /** Returns the object with the settings used for calls to listLocations. */ + public PagedCallSettings + listLocationsSettings() { + return ((SequenceServiceStubSettings) getStubSettings()).listLocationsSettings(); + } + + /** Returns the object with the settings used for calls to getLocation. */ + public UnaryCallSettings getLocationSettings() { + return ((SequenceServiceStubSettings) getStubSettings()).getLocationSettings(); + } + + /** Returns the object with the settings used for calls to setIamPolicy. */ + public UnaryCallSettings setIamPolicySettings() { + return ((SequenceServiceStubSettings) getStubSettings()).setIamPolicySettings(); + } + + /** Returns the object with the settings used for calls to getIamPolicy. */ + public UnaryCallSettings getIamPolicySettings() { + return ((SequenceServiceStubSettings) getStubSettings()).getIamPolicySettings(); + } + + /** Returns the object with the settings used for calls to testIamPermissions. */ + public UnaryCallSettings + testIamPermissionsSettings() { + return ((SequenceServiceStubSettings) getStubSettings()).testIamPermissionsSettings(); + } + + public static final SequenceServiceSettings create(SequenceServiceStubSettings stub) + throws IOException { + return new SequenceServiceSettings.Builder(stub.toBuilder()).build(); + } + + /** Returns a builder for the default ExecutorProvider for this service. */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return SequenceServiceStubSettings.defaultExecutorProviderBuilder(); + } + + /** Returns the default service endpoint. */ + public static String getDefaultEndpoint() { + return SequenceServiceStubSettings.getDefaultEndpoint(); + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return SequenceServiceStubSettings.getDefaultServiceScopes(); + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return SequenceServiceStubSettings.defaultCredentialsProviderBuilder(); + } + + /** Returns a builder for the default gRPC ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return SequenceServiceStubSettings.defaultGrpcTransportProviderBuilder(); + } + + /** Returns a builder for the default REST ChannelProvider for this service. */ + @BetaApi + public static InstantiatingHttpJsonChannelProvider.Builder + defaultHttpJsonTransportProviderBuilder() { + return SequenceServiceStubSettings.defaultHttpJsonTransportProviderBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return SequenceServiceStubSettings.defaultTransportChannelProvider(); + } + + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return SequenceServiceStubSettings.defaultApiClientHeaderProviderBuilder(); + } + + /** Returns a new gRPC builder for this class. */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** Returns a new REST builder for this class. */ + public static Builder newHttpJsonBuilder() { + return Builder.createHttpJsonDefault(); + } + + /** 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 SequenceServiceSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + } + + /** Builder for SequenceServiceSettings. */ + public static class Builder extends ClientSettings.Builder { + + protected Builder() throws IOException { + this(((ClientContext) null)); + } + + protected Builder(ClientContext clientContext) { + super(SequenceServiceStubSettings.newBuilder(clientContext)); + } + + protected Builder(SequenceServiceSettings settings) { + super(settings.getStubSettings().toBuilder()); + } + + protected Builder(SequenceServiceStubSettings.Builder stubSettings) { + super(stubSettings); + } + + private static Builder createDefault() { + return new Builder(SequenceServiceStubSettings.newBuilder()); + } + + private static Builder createHttpJsonDefault() { + return new Builder(SequenceServiceStubSettings.newHttpJsonBuilder()); + } + + public SequenceServiceStubSettings.Builder getStubSettingsBuilder() { + return ((SequenceServiceStubSettings.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 createSequence. */ + public UnaryCallSettings.Builder createSequenceSettings() { + return getStubSettingsBuilder().createSequenceSettings(); + } + + /** Returns the builder for the settings used for calls to createStreamingSequence. */ + public UnaryCallSettings.Builder + createStreamingSequenceSettings() { + return getStubSettingsBuilder().createStreamingSequenceSettings(); + } + + /** Returns the builder for the settings used for calls to getSequenceReport. */ + public UnaryCallSettings.Builder + getSequenceReportSettings() { + return getStubSettingsBuilder().getSequenceReportSettings(); + } + + /** Returns the builder for the settings used for calls to getStreamingSequenceReport. */ + public UnaryCallSettings.Builder + getStreamingSequenceReportSettings() { + return getStubSettingsBuilder().getStreamingSequenceReportSettings(); + } + + /** Returns the builder for the settings used for calls to attemptSequence. */ + public UnaryCallSettings.Builder attemptSequenceSettings() { + return getStubSettingsBuilder().attemptSequenceSettings(); + } + + /** Returns the builder for the settings used for calls to attemptStreamingSequence. */ + public ServerStreamingCallSettings.Builder< + AttemptStreamingSequenceRequest, AttemptStreamingSequenceResponse> + attemptStreamingSequenceSettings() { + return getStubSettingsBuilder().attemptStreamingSequenceSettings(); + } + + /** Returns the builder for the settings used for calls to listLocations. */ + public PagedCallSettings.Builder< + ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse> + listLocationsSettings() { + return getStubSettingsBuilder().listLocationsSettings(); + } + + /** Returns the builder for the settings used for calls to getLocation. */ + public UnaryCallSettings.Builder getLocationSettings() { + return getStubSettingsBuilder().getLocationSettings(); + } + + /** Returns the builder for the settings used for calls to setIamPolicy. */ + public UnaryCallSettings.Builder setIamPolicySettings() { + return getStubSettingsBuilder().setIamPolicySettings(); + } + + /** Returns the builder for the settings used for calls to getIamPolicy. */ + public UnaryCallSettings.Builder getIamPolicySettings() { + return getStubSettingsBuilder().getIamPolicySettings(); + } + + /** Returns the builder for the settings used for calls to testIamPermissions. */ + public UnaryCallSettings.Builder + testIamPermissionsSettings() { + return getStubSettingsBuilder().testIamPermissionsSettings(); + } + + @Override + public SequenceServiceSettings build() throws IOException { + return new SequenceServiceSettings(this); + } + } +} diff --git a/java-showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/TestingClient.java b/java-showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/TestingClient.java new file mode 100644 index 0000000000..c941dc9676 --- /dev/null +++ b/java-showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/TestingClient.java @@ -0,0 +1,1501 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1; + +import com.google.api.core.ApiFuture; +import com.google.api.core.ApiFutures; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.paging.AbstractFixedSizeCollection; +import com.google.api.gax.paging.AbstractPage; +import com.google.api.gax.paging.AbstractPagedListResponse; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.common.util.concurrent.MoreExecutors; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.protobuf.Empty; +import com.google.showcase.v1beta1.stub.TestingStub; +import com.google.showcase.v1beta1.stub.TestingStubSettings; +import java.io.IOException; +import java.util.List; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Service Description: A service to facilitate running discrete sets of tests against Showcase. + * Adding this comment with special characters for comment formatting tests: 1. + * (abra->kadabra->alakazam) 2) [Nonsense][]: `pokemon/*/psychic/*` + * + *

        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 (TestingClient testingClient = TestingClient.create()) {
        + *   CreateSessionRequest request =
        + *       CreateSessionRequest.newBuilder().setSession(Session.newBuilder().build()).build();
        + *   Session response = testingClient.createSession(request);
        + * }
        + * }
        + * + *

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

        CreateSession

        Creates a new testing session. Adding this comment with special characters for comment formatting tests: 1. (abra->kadabra->alakazam) 2) [Nonsense][]: `pokemon/*/psychic/*`

        + *

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

        + *
          + *
        • createSession(CreateSessionRequest request) + *

        + *

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

        + *
          + *
        • createSessionCallable() + *

        + *

        GetSession

        Gets a testing session.

        + *

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

        + *
          + *
        • getSession(GetSessionRequest request) + *

        + *

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

        + *
          + *
        • getSessionCallable() + *

        + *

        ListSessions

        Lists the current test sessions.

        + *

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

        + *
          + *
        • listSessions(ListSessionsRequest request) + *

        + *

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

        + *
          + *
        • listSessionsPagedCallable() + *

        • listSessionsCallable() + *

        + *

        DeleteSession

        Delete a test session.

        + *

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

        + *
          + *
        • deleteSession(DeleteSessionRequest request) + *

        + *

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

        + *
          + *
        • deleteSessionCallable() + *

        + *

        ReportSession

        Report on the status of a session. This generates a report detailing which tests have been completed, and an overall rollup.

        + *

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

        + *
          + *
        • reportSession(ReportSessionRequest request) + *

        + *

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

        + *
          + *
        • reportSessionCallable() + *

        + *

        ListTests

        List the tests of a sessesion.

        + *

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

        + *
          + *
        • listTests(ListTestsRequest request) + *

        + *

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

        + *
          + *
        • listTestsPagedCallable() + *

        • listTestsCallable() + *

        + *

        DeleteTest

        Explicitly decline to implement a test. + *

        This removes the test from subsequent `ListTests` calls, and attempting to do the test will error. + *

        This method will error if attempting to delete a required test.

        + *

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

        + *
          + *
        • deleteTest(DeleteTestRequest request) + *

        + *

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

        + *
          + *
        • deleteTestCallable() + *

        + *

        VerifyTest

        Register a response to a test. + *

        In cases where a test involves registering a final answer at the end of the test, this method provides the means to do so.

        + *

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

        + *
          + *
        • verifyTest(VerifyTestRequest request) + *

        + *

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

        + *
          + *
        • verifyTestCallable() + *

        + *

        ListLocations

        Lists information about the supported locations for this service.

        + *

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

        + *
          + *
        • listLocations(ListLocationsRequest request) + *

        + *

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

        + *
          + *
        • listLocationsPagedCallable() + *

        • listLocationsCallable() + *

        + *

        GetLocation

        Gets information about a location.

        + *

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

        + *
          + *
        • getLocation(GetLocationRequest request) + *

        + *

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

        + *
          + *
        • getLocationCallable() + *

        + *

        SetIamPolicy

        Sets the access control policy on the specified resource. Replaces any existing policy. + *

        Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED` errors.

        + *

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

        + *
          + *
        • setIamPolicy(SetIamPolicyRequest request) + *

        + *

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

        + *
          + *
        • setIamPolicyCallable() + *

        + *

        GetIamPolicy

        Gets the access control policy for a resource. Returns an empty policy if the resource exists and does not have a policy set.

        + *

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

        + *
          + *
        • getIamPolicy(GetIamPolicyRequest request) + *

        + *

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

        + *
          + *
        • getIamPolicyCallable() + *

        + *

        TestIamPermissions

        Returns permissions that a caller has on the specified resource. If the resource does not exist, this will return an empty set of permissions, not a `NOT_FOUND` error. + *

        Note: This operation is designed to be used for building permission-aware UIs and command-line tools, not for authorization checking. This operation may "fail open" without warning.

        + *

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

        + *
          + *
        • testIamPermissions(TestIamPermissionsRequest request) + *

        + *

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

        + *
          + *
        • testIamPermissionsCallable() + *

        + *
        + * + *

        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 TestingSettings 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
        + * TestingSettings testingSettings =
        + *     TestingSettings.newBuilder()
        + *         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
        + *         .build();
        + * TestingClient testingClient = TestingClient.create(testingSettings);
        + * }
        + * + *

        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
        + * TestingSettings testingSettings = TestingSettings.newBuilder().setEndpoint(myEndpoint).build();
        + * TestingClient testingClient = TestingClient.create(testingSettings);
        + * }
        + * + *

        To use REST (HTTP1.1/JSON) transport (instead of gRPC) for sending and receiving requests over + * the wire: + * + *

        {@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
        + * TestingSettings testingSettings = TestingSettings.newHttpJsonBuilder().build();
        + * TestingClient testingClient = TestingClient.create(testingSettings);
        + * }
        + * + *

        Please refer to the GitHub repository's samples for more quickstart code snippets. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class TestingClient implements BackgroundResource { + private final TestingSettings settings; + private final TestingStub stub; + + /** Constructs an instance of TestingClient with default settings. */ + public static final TestingClient create() throws IOException { + return create(TestingSettings.newBuilder().build()); + } + + /** + * Constructs an instance of TestingClient, 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 TestingClient create(TestingSettings settings) throws IOException { + return new TestingClient(settings); + } + + /** + * Constructs an instance of TestingClient, using the given stub for making calls. This is for + * advanced usage - prefer using create(TestingSettings). + */ + public static final TestingClient create(TestingStub stub) { + return new TestingClient(stub); + } + + /** + * Constructs an instance of TestingClient, 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 TestingClient(TestingSettings settings) throws IOException { + this.settings = settings; + this.stub = ((TestingStubSettings) settings.getStubSettings()).createStub(); + } + + protected TestingClient(TestingStub stub) { + this.settings = null; + this.stub = stub; + } + + public final TestingSettings getSettings() { + return settings; + } + + public TestingStub getStub() { + return stub; + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a new testing session. Adding this comment with special characters for comment + * formatting tests: 1. (abra->kadabra->alakazam) 2) [Nonsense][]: + * `pokemon/*/psychic/*` + * + *

        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 (TestingClient testingClient = TestingClient.create()) {
        +   *   CreateSessionRequest request =
        +   *       CreateSessionRequest.newBuilder().setSession(Session.newBuilder().build()).build();
        +   *   Session response = testingClient.createSession(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 Session createSession(CreateSessionRequest request) { + return createSessionCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a new testing session. Adding this comment with special characters for comment + * formatting tests: 1. (abra->kadabra->alakazam) 2) [Nonsense][]: + * `pokemon/*/psychic/*` + * + *

        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 (TestingClient testingClient = TestingClient.create()) {
        +   *   CreateSessionRequest request =
        +   *       CreateSessionRequest.newBuilder().setSession(Session.newBuilder().build()).build();
        +   *   ApiFuture future = testingClient.createSessionCallable().futureCall(request);
        +   *   // Do something.
        +   *   Session response = future.get();
        +   * }
        +   * }
        + */ + public final UnaryCallable createSessionCallable() { + return stub.createSessionCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets a testing session. + * + *

        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 (TestingClient testingClient = TestingClient.create()) {
        +   *   GetSessionRequest request =
        +   *       GetSessionRequest.newBuilder().setName(SessionName.of("[SESSION]").toString()).build();
        +   *   Session response = testingClient.getSession(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 Session getSession(GetSessionRequest request) { + return getSessionCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets a testing session. + * + *

        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 (TestingClient testingClient = TestingClient.create()) {
        +   *   GetSessionRequest request =
        +   *       GetSessionRequest.newBuilder().setName(SessionName.of("[SESSION]").toString()).build();
        +   *   ApiFuture future = testingClient.getSessionCallable().futureCall(request);
        +   *   // Do something.
        +   *   Session response = future.get();
        +   * }
        +   * }
        + */ + public final UnaryCallable getSessionCallable() { + return stub.getSessionCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists the current test sessions. + * + *

        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 (TestingClient testingClient = TestingClient.create()) {
        +   *   ListSessionsRequest request =
        +   *       ListSessionsRequest.newBuilder()
        +   *           .setPageSize(883849137)
        +   *           .setPageToken("pageToken873572522")
        +   *           .build();
        +   *   for (Session element : testingClient.listSessions(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 ListSessionsPagedResponse listSessions(ListSessionsRequest request) { + return listSessionsPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists the current test sessions. + * + *

        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 (TestingClient testingClient = TestingClient.create()) {
        +   *   ListSessionsRequest request =
        +   *       ListSessionsRequest.newBuilder()
        +   *           .setPageSize(883849137)
        +   *           .setPageToken("pageToken873572522")
        +   *           .build();
        +   *   ApiFuture future = testingClient.listSessionsPagedCallable().futureCall(request);
        +   *   // Do something.
        +   *   for (Session element : future.get().iterateAll()) {
        +   *     // doThingsWith(element);
        +   *   }
        +   * }
        +   * }
        + */ + public final UnaryCallable + listSessionsPagedCallable() { + return stub.listSessionsPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists the current test sessions. + * + *

        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 (TestingClient testingClient = TestingClient.create()) {
        +   *   ListSessionsRequest request =
        +   *       ListSessionsRequest.newBuilder()
        +   *           .setPageSize(883849137)
        +   *           .setPageToken("pageToken873572522")
        +   *           .build();
        +   *   while (true) {
        +   *     ListSessionsResponse response = testingClient.listSessionsCallable().call(request);
        +   *     for (Session element : response.getSessionsList()) {
        +   *       // doThingsWith(element);
        +   *     }
        +   *     String nextPageToken = response.getNextPageToken();
        +   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
        +   *       request = request.toBuilder().setPageToken(nextPageToken).build();
        +   *     } else {
        +   *       break;
        +   *     }
        +   *   }
        +   * }
        +   * }
        + */ + public final UnaryCallable listSessionsCallable() { + return stub.listSessionsCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Delete a test session. + * + *

        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 (TestingClient testingClient = TestingClient.create()) {
        +   *   DeleteSessionRequest request =
        +   *       DeleteSessionRequest.newBuilder().setName(SessionName.of("[SESSION]").toString()).build();
        +   *   testingClient.deleteSession(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 deleteSession(DeleteSessionRequest request) { + deleteSessionCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Delete a test session. + * + *

        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 (TestingClient testingClient = TestingClient.create()) {
        +   *   DeleteSessionRequest request =
        +   *       DeleteSessionRequest.newBuilder().setName(SessionName.of("[SESSION]").toString()).build();
        +   *   ApiFuture future = testingClient.deleteSessionCallable().futureCall(request);
        +   *   // Do something.
        +   *   future.get();
        +   * }
        +   * }
        + */ + public final UnaryCallable deleteSessionCallable() { + return stub.deleteSessionCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Report on the status of a session. This generates a report detailing which tests have been + * completed, and an overall rollup. + * + *

        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 (TestingClient testingClient = TestingClient.create()) {
        +   *   ReportSessionRequest request =
        +   *       ReportSessionRequest.newBuilder().setName(SessionName.of("[SESSION]").toString()).build();
        +   *   ReportSessionResponse response = testingClient.reportSession(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 ReportSessionResponse reportSession(ReportSessionRequest request) { + return reportSessionCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Report on the status of a session. This generates a report detailing which tests have been + * completed, and an overall rollup. + * + *

        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 (TestingClient testingClient = TestingClient.create()) {
        +   *   ReportSessionRequest request =
        +   *       ReportSessionRequest.newBuilder().setName(SessionName.of("[SESSION]").toString()).build();
        +   *   ApiFuture future =
        +   *       testingClient.reportSessionCallable().futureCall(request);
        +   *   // Do something.
        +   *   ReportSessionResponse response = future.get();
        +   * }
        +   * }
        + */ + public final UnaryCallable reportSessionCallable() { + return stub.reportSessionCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * List the tests of a sessesion. + * + *

        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 (TestingClient testingClient = TestingClient.create()) {
        +   *   ListTestsRequest request =
        +   *       ListTestsRequest.newBuilder()
        +   *           .setParent(SessionName.of("[SESSION]").toString())
        +   *           .setPageSize(883849137)
        +   *           .setPageToken("pageToken873572522")
        +   *           .build();
        +   *   for (Test element : testingClient.listTests(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 ListTestsPagedResponse listTests(ListTestsRequest request) { + return listTestsPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * List the tests of a sessesion. + * + *

        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 (TestingClient testingClient = TestingClient.create()) {
        +   *   ListTestsRequest request =
        +   *       ListTestsRequest.newBuilder()
        +   *           .setParent(SessionName.of("[SESSION]").toString())
        +   *           .setPageSize(883849137)
        +   *           .setPageToken("pageToken873572522")
        +   *           .build();
        +   *   ApiFuture future = testingClient.listTestsPagedCallable().futureCall(request);
        +   *   // Do something.
        +   *   for (Test element : future.get().iterateAll()) {
        +   *     // doThingsWith(element);
        +   *   }
        +   * }
        +   * }
        + */ + public final UnaryCallable listTestsPagedCallable() { + return stub.listTestsPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * List the tests of a sessesion. + * + *

        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 (TestingClient testingClient = TestingClient.create()) {
        +   *   ListTestsRequest request =
        +   *       ListTestsRequest.newBuilder()
        +   *           .setParent(SessionName.of("[SESSION]").toString())
        +   *           .setPageSize(883849137)
        +   *           .setPageToken("pageToken873572522")
        +   *           .build();
        +   *   while (true) {
        +   *     ListTestsResponse response = testingClient.listTestsCallable().call(request);
        +   *     for (Test element : response.getTestsList()) {
        +   *       // doThingsWith(element);
        +   *     }
        +   *     String nextPageToken = response.getNextPageToken();
        +   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
        +   *       request = request.toBuilder().setPageToken(nextPageToken).build();
        +   *     } else {
        +   *       break;
        +   *     }
        +   *   }
        +   * }
        +   * }
        + */ + public final UnaryCallable listTestsCallable() { + return stub.listTestsCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Explicitly decline to implement a test. + * + *

        This removes the test from subsequent `ListTests` calls, and attempting to do the test will + * error. + * + *

        This method will error if attempting to delete a required test. + * + *

        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 (TestingClient testingClient = TestingClient.create()) {
        +   *   DeleteTestRequest request =
        +   *       DeleteTestRequest.newBuilder()
        +   *           .setName(TestName.of("[SESSION]", "[TEST]").toString())
        +   *           .build();
        +   *   testingClient.deleteTest(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 deleteTest(DeleteTestRequest request) { + deleteTestCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Explicitly decline to implement a test. + * + *

        This removes the test from subsequent `ListTests` calls, and attempting to do the test will + * error. + * + *

        This method will error if attempting to delete a required test. + * + *

        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 (TestingClient testingClient = TestingClient.create()) {
        +   *   DeleteTestRequest request =
        +   *       DeleteTestRequest.newBuilder()
        +   *           .setName(TestName.of("[SESSION]", "[TEST]").toString())
        +   *           .build();
        +   *   ApiFuture future = testingClient.deleteTestCallable().futureCall(request);
        +   *   // Do something.
        +   *   future.get();
        +   * }
        +   * }
        + */ + public final UnaryCallable deleteTestCallable() { + return stub.deleteTestCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Register a response to a test. + * + *

        In cases where a test involves registering a final answer at the end of the test, this + * method provides the means to do so. + * + *

        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 (TestingClient testingClient = TestingClient.create()) {
        +   *   VerifyTestRequest request =
        +   *       VerifyTestRequest.newBuilder()
        +   *           .setName(TestName.of("[SESSION]", "[TEST]").toString())
        +   *           .setAnswer(ByteString.EMPTY)
        +   *           .addAllAnswers(new ArrayList())
        +   *           .build();
        +   *   VerifyTestResponse response = testingClient.verifyTest(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 VerifyTestResponse verifyTest(VerifyTestRequest request) { + return verifyTestCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Register a response to a test. + * + *

        In cases where a test involves registering a final answer at the end of the test, this + * method provides the means to do so. + * + *

        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 (TestingClient testingClient = TestingClient.create()) {
        +   *   VerifyTestRequest request =
        +   *       VerifyTestRequest.newBuilder()
        +   *           .setName(TestName.of("[SESSION]", "[TEST]").toString())
        +   *           .setAnswer(ByteString.EMPTY)
        +   *           .addAllAnswers(new ArrayList())
        +   *           .build();
        +   *   ApiFuture future = testingClient.verifyTestCallable().futureCall(request);
        +   *   // Do something.
        +   *   VerifyTestResponse response = future.get();
        +   * }
        +   * }
        + */ + public final UnaryCallable verifyTestCallable() { + return stub.verifyTestCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists information about the supported locations for this service. + * + *

        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 (TestingClient testingClient = TestingClient.create()) {
        +   *   ListLocationsRequest request =
        +   *       ListLocationsRequest.newBuilder()
        +   *           .setName("name3373707")
        +   *           .setFilter("filter-1274492040")
        +   *           .setPageSize(883849137)
        +   *           .setPageToken("pageToken873572522")
        +   *           .build();
        +   *   for (Location element : testingClient.listLocations(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 ListLocationsPagedResponse listLocations(ListLocationsRequest request) { + return listLocationsPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists information about the supported locations for this service. + * + *

        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 (TestingClient testingClient = TestingClient.create()) {
        +   *   ListLocationsRequest request =
        +   *       ListLocationsRequest.newBuilder()
        +   *           .setName("name3373707")
        +   *           .setFilter("filter-1274492040")
        +   *           .setPageSize(883849137)
        +   *           .setPageToken("pageToken873572522")
        +   *           .build();
        +   *   ApiFuture future = testingClient.listLocationsPagedCallable().futureCall(request);
        +   *   // Do something.
        +   *   for (Location element : future.get().iterateAll()) {
        +   *     // doThingsWith(element);
        +   *   }
        +   * }
        +   * }
        + */ + public final UnaryCallable + listLocationsPagedCallable() { + return stub.listLocationsPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists information about the supported locations for this service. + * + *

        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 (TestingClient testingClient = TestingClient.create()) {
        +   *   ListLocationsRequest request =
        +   *       ListLocationsRequest.newBuilder()
        +   *           .setName("name3373707")
        +   *           .setFilter("filter-1274492040")
        +   *           .setPageSize(883849137)
        +   *           .setPageToken("pageToken873572522")
        +   *           .build();
        +   *   while (true) {
        +   *     ListLocationsResponse response = testingClient.listLocationsCallable().call(request);
        +   *     for (Location element : response.getLocationsList()) {
        +   *       // doThingsWith(element);
        +   *     }
        +   *     String nextPageToken = response.getNextPageToken();
        +   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
        +   *       request = request.toBuilder().setPageToken(nextPageToken).build();
        +   *     } else {
        +   *       break;
        +   *     }
        +   *   }
        +   * }
        +   * }
        + */ + public final UnaryCallable listLocationsCallable() { + return stub.listLocationsCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets information about a location. + * + *

        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 (TestingClient testingClient = TestingClient.create()) {
        +   *   GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build();
        +   *   Location response = testingClient.getLocation(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 Location getLocation(GetLocationRequest request) { + return getLocationCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets information about a location. + * + *

        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 (TestingClient testingClient = TestingClient.create()) {
        +   *   GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build();
        +   *   ApiFuture future = testingClient.getLocationCallable().futureCall(request);
        +   *   // Do something.
        +   *   Location response = future.get();
        +   * }
        +   * }
        + */ + public final UnaryCallable getLocationCallable() { + return stub.getLocationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Sets the access control policy on the specified resource. Replaces any existing policy. + * + *

        Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED` errors. + * + *

        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 (TestingClient testingClient = TestingClient.create()) {
        +   *   SetIamPolicyRequest request =
        +   *       SetIamPolicyRequest.newBuilder()
        +   *           .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString())
        +   *           .setPolicy(Policy.newBuilder().build())
        +   *           .setUpdateMask(FieldMask.newBuilder().build())
        +   *           .build();
        +   *   Policy response = testingClient.setIamPolicy(request);
        +   * }
        +   * }
        + * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Policy setIamPolicy(SetIamPolicyRequest request) { + return setIamPolicyCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Sets the access control policy on the specified resource. Replaces any existing policy. + * + *

        Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED` errors. + * + *

        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 (TestingClient testingClient = TestingClient.create()) {
        +   *   SetIamPolicyRequest request =
        +   *       SetIamPolicyRequest.newBuilder()
        +   *           .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString())
        +   *           .setPolicy(Policy.newBuilder().build())
        +   *           .setUpdateMask(FieldMask.newBuilder().build())
        +   *           .build();
        +   *   ApiFuture future = testingClient.setIamPolicyCallable().futureCall(request);
        +   *   // Do something.
        +   *   Policy response = future.get();
        +   * }
        +   * }
        + */ + public final UnaryCallable setIamPolicyCallable() { + return stub.setIamPolicyCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets the access control policy for a resource. Returns an empty policy if the resource exists + * and does not have a policy set. + * + *

        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 (TestingClient testingClient = TestingClient.create()) {
        +   *   GetIamPolicyRequest request =
        +   *       GetIamPolicyRequest.newBuilder()
        +   *           .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString())
        +   *           .setOptions(GetPolicyOptions.newBuilder().build())
        +   *           .build();
        +   *   Policy response = testingClient.getIamPolicy(request);
        +   * }
        +   * }
        + * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Policy getIamPolicy(GetIamPolicyRequest request) { + return getIamPolicyCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets the access control policy for a resource. Returns an empty policy if the resource exists + * and does not have a policy set. + * + *

        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 (TestingClient testingClient = TestingClient.create()) {
        +   *   GetIamPolicyRequest request =
        +   *       GetIamPolicyRequest.newBuilder()
        +   *           .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString())
        +   *           .setOptions(GetPolicyOptions.newBuilder().build())
        +   *           .build();
        +   *   ApiFuture future = testingClient.getIamPolicyCallable().futureCall(request);
        +   *   // Do something.
        +   *   Policy response = future.get();
        +   * }
        +   * }
        + */ + public final UnaryCallable getIamPolicyCallable() { + return stub.getIamPolicyCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Returns permissions that a caller has on the specified resource. If the resource does not + * exist, this will return an empty set of permissions, not a `NOT_FOUND` error. + * + *

        Note: This operation is designed to be used for building permission-aware UIs and + * command-line tools, not for authorization checking. This operation may "fail open" without + * warning. + * + *

        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 (TestingClient testingClient = TestingClient.create()) {
        +   *   TestIamPermissionsRequest request =
        +   *       TestIamPermissionsRequest.newBuilder()
        +   *           .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString())
        +   *           .addAllPermissions(new ArrayList())
        +   *           .build();
        +   *   TestIamPermissionsResponse response = testingClient.testIamPermissions(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 TestIamPermissionsResponse testIamPermissions(TestIamPermissionsRequest request) { + return testIamPermissionsCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Returns permissions that a caller has on the specified resource. If the resource does not + * exist, this will return an empty set of permissions, not a `NOT_FOUND` error. + * + *

        Note: This operation is designed to be used for building permission-aware UIs and + * command-line tools, not for authorization checking. This operation may "fail open" without + * warning. + * + *

        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 (TestingClient testingClient = TestingClient.create()) {
        +   *   TestIamPermissionsRequest request =
        +   *       TestIamPermissionsRequest.newBuilder()
        +   *           .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString())
        +   *           .addAllPermissions(new ArrayList())
        +   *           .build();
        +   *   ApiFuture future =
        +   *       testingClient.testIamPermissionsCallable().futureCall(request);
        +   *   // Do something.
        +   *   TestIamPermissionsResponse response = future.get();
        +   * }
        +   * }
        + */ + public final UnaryCallable + testIamPermissionsCallable() { + return stub.testIamPermissionsCallable(); + } + + @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 ListSessionsPagedResponse + extends AbstractPagedListResponse< + ListSessionsRequest, + ListSessionsResponse, + Session, + ListSessionsPage, + ListSessionsFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListSessionsPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + input -> new ListSessionsPagedResponse(input), + MoreExecutors.directExecutor()); + } + + private ListSessionsPagedResponse(ListSessionsPage page) { + super(page, ListSessionsFixedSizeCollection.createEmptyCollection()); + } + } + + public static class ListSessionsPage + extends AbstractPage { + + private ListSessionsPage( + PageContext context, + ListSessionsResponse response) { + super(context, response); + } + + private static ListSessionsPage createEmptyPage() { + return new ListSessionsPage(null, null); + } + + @Override + protected ListSessionsPage createPage( + PageContext context, + ListSessionsResponse response) { + return new ListSessionsPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class ListSessionsFixedSizeCollection + extends AbstractFixedSizeCollection< + ListSessionsRequest, + ListSessionsResponse, + Session, + ListSessionsPage, + ListSessionsFixedSizeCollection> { + + private ListSessionsFixedSizeCollection(List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListSessionsFixedSizeCollection createEmptyCollection() { + return new ListSessionsFixedSizeCollection(null, 0); + } + + @Override + protected ListSessionsFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListSessionsFixedSizeCollection(pages, collectionSize); + } + } + + public static class ListTestsPagedResponse + extends AbstractPagedListResponse< + ListTestsRequest, ListTestsResponse, Test, ListTestsPage, ListTestsFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListTestsPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, input -> new ListTestsPagedResponse(input), MoreExecutors.directExecutor()); + } + + private ListTestsPagedResponse(ListTestsPage page) { + super(page, ListTestsFixedSizeCollection.createEmptyCollection()); + } + } + + public static class ListTestsPage + extends AbstractPage { + + private ListTestsPage( + PageContext context, + ListTestsResponse response) { + super(context, response); + } + + private static ListTestsPage createEmptyPage() { + return new ListTestsPage(null, null); + } + + @Override + protected ListTestsPage createPage( + PageContext context, + ListTestsResponse response) { + return new ListTestsPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class ListTestsFixedSizeCollection + extends AbstractFixedSizeCollection< + ListTestsRequest, ListTestsResponse, Test, ListTestsPage, ListTestsFixedSizeCollection> { + + private ListTestsFixedSizeCollection(List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListTestsFixedSizeCollection createEmptyCollection() { + return new ListTestsFixedSizeCollection(null, 0); + } + + @Override + protected ListTestsFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListTestsFixedSizeCollection(pages, collectionSize); + } + } + + public static class ListLocationsPagedResponse + extends AbstractPagedListResponse< + ListLocationsRequest, + ListLocationsResponse, + Location, + ListLocationsPage, + ListLocationsFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListLocationsPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + input -> new ListLocationsPagedResponse(input), + MoreExecutors.directExecutor()); + } + + private ListLocationsPagedResponse(ListLocationsPage page) { + super(page, ListLocationsFixedSizeCollection.createEmptyCollection()); + } + } + + public static class ListLocationsPage + extends AbstractPage< + ListLocationsRequest, ListLocationsResponse, Location, ListLocationsPage> { + + private ListLocationsPage( + PageContext context, + ListLocationsResponse response) { + super(context, response); + } + + private static ListLocationsPage createEmptyPage() { + return new ListLocationsPage(null, null); + } + + @Override + protected ListLocationsPage createPage( + PageContext context, + ListLocationsResponse response) { + return new ListLocationsPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class ListLocationsFixedSizeCollection + extends AbstractFixedSizeCollection< + ListLocationsRequest, + ListLocationsResponse, + Location, + ListLocationsPage, + ListLocationsFixedSizeCollection> { + + private ListLocationsFixedSizeCollection(List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListLocationsFixedSizeCollection createEmptyCollection() { + return new ListLocationsFixedSizeCollection(null, 0); + } + + @Override + protected ListLocationsFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListLocationsFixedSizeCollection(pages, collectionSize); + } + } +} diff --git a/java-showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/TestingSettings.java b/java-showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/TestingSettings.java new file mode 100644 index 0000000000..7bd64be215 --- /dev/null +++ b/java-showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/TestingSettings.java @@ -0,0 +1,360 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1; + +import static com.google.showcase.v1beta1.TestingClient.ListLocationsPagedResponse; +import static com.google.showcase.v1beta1.TestingClient.ListSessionsPagedResponse; +import static com.google.showcase.v1beta1.TestingClient.ListTestsPagedResponse; + +import com.google.api.core.ApiFunction; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; +import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; +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.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.protobuf.Empty; +import com.google.showcase.v1beta1.stub.TestingStubSettings; +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 TestingClient}. + * + *

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

          + *
        • The default service address (localhost) and default port (7469) 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 createSession: + * + *

        {@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
        + * TestingSettings.Builder testingSettingsBuilder = TestingSettings.newBuilder();
        + * testingSettingsBuilder
        + *     .createSessionSettings()
        + *     .setRetrySettings(
        + *         testingSettingsBuilder
        + *             .createSessionSettings()
        + *             .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());
        + * TestingSettings testingSettings = testingSettingsBuilder.build();
        + * }
        + * + * Please refer to the [Client Side Retry + * Guide](https://docs.cloud.google.com/java/docs/client-retries) for additional support in setting + * retries. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class TestingSettings extends ClientSettings { + + /** Returns the object with the settings used for calls to createSession. */ + public UnaryCallSettings createSessionSettings() { + return ((TestingStubSettings) getStubSettings()).createSessionSettings(); + } + + /** Returns the object with the settings used for calls to getSession. */ + public UnaryCallSettings getSessionSettings() { + return ((TestingStubSettings) getStubSettings()).getSessionSettings(); + } + + /** Returns the object with the settings used for calls to listSessions. */ + public PagedCallSettings + listSessionsSettings() { + return ((TestingStubSettings) getStubSettings()).listSessionsSettings(); + } + + /** Returns the object with the settings used for calls to deleteSession. */ + public UnaryCallSettings deleteSessionSettings() { + return ((TestingStubSettings) getStubSettings()).deleteSessionSettings(); + } + + /** Returns the object with the settings used for calls to reportSession. */ + public UnaryCallSettings reportSessionSettings() { + return ((TestingStubSettings) getStubSettings()).reportSessionSettings(); + } + + /** Returns the object with the settings used for calls to listTests. */ + public PagedCallSettings + listTestsSettings() { + return ((TestingStubSettings) getStubSettings()).listTestsSettings(); + } + + /** Returns the object with the settings used for calls to deleteTest. */ + public UnaryCallSettings deleteTestSettings() { + return ((TestingStubSettings) getStubSettings()).deleteTestSettings(); + } + + /** Returns the object with the settings used for calls to verifyTest. */ + public UnaryCallSettings verifyTestSettings() { + return ((TestingStubSettings) getStubSettings()).verifyTestSettings(); + } + + /** Returns the object with the settings used for calls to listLocations. */ + public PagedCallSettings + listLocationsSettings() { + return ((TestingStubSettings) getStubSettings()).listLocationsSettings(); + } + + /** Returns the object with the settings used for calls to getLocation. */ + public UnaryCallSettings getLocationSettings() { + return ((TestingStubSettings) getStubSettings()).getLocationSettings(); + } + + /** Returns the object with the settings used for calls to setIamPolicy. */ + public UnaryCallSettings setIamPolicySettings() { + return ((TestingStubSettings) getStubSettings()).setIamPolicySettings(); + } + + /** Returns the object with the settings used for calls to getIamPolicy. */ + public UnaryCallSettings getIamPolicySettings() { + return ((TestingStubSettings) getStubSettings()).getIamPolicySettings(); + } + + /** Returns the object with the settings used for calls to testIamPermissions. */ + public UnaryCallSettings + testIamPermissionsSettings() { + return ((TestingStubSettings) getStubSettings()).testIamPermissionsSettings(); + } + + public static final TestingSettings create(TestingStubSettings stub) throws IOException { + return new TestingSettings.Builder(stub.toBuilder()).build(); + } + + /** Returns a builder for the default ExecutorProvider for this service. */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return TestingStubSettings.defaultExecutorProviderBuilder(); + } + + /** Returns the default service endpoint. */ + public static String getDefaultEndpoint() { + return TestingStubSettings.getDefaultEndpoint(); + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return TestingStubSettings.getDefaultServiceScopes(); + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return TestingStubSettings.defaultCredentialsProviderBuilder(); + } + + /** Returns a builder for the default gRPC ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return TestingStubSettings.defaultGrpcTransportProviderBuilder(); + } + + /** Returns a builder for the default REST ChannelProvider for this service. */ + @BetaApi + public static InstantiatingHttpJsonChannelProvider.Builder + defaultHttpJsonTransportProviderBuilder() { + return TestingStubSettings.defaultHttpJsonTransportProviderBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return TestingStubSettings.defaultTransportChannelProvider(); + } + + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return TestingStubSettings.defaultApiClientHeaderProviderBuilder(); + } + + /** Returns a new gRPC builder for this class. */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** Returns a new REST builder for this class. */ + public static Builder newHttpJsonBuilder() { + return Builder.createHttpJsonDefault(); + } + + /** 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 TestingSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + } + + /** Builder for TestingSettings. */ + public static class Builder extends ClientSettings.Builder { + + protected Builder() throws IOException { + this(((ClientContext) null)); + } + + protected Builder(ClientContext clientContext) { + super(TestingStubSettings.newBuilder(clientContext)); + } + + protected Builder(TestingSettings settings) { + super(settings.getStubSettings().toBuilder()); + } + + protected Builder(TestingStubSettings.Builder stubSettings) { + super(stubSettings); + } + + private static Builder createDefault() { + return new Builder(TestingStubSettings.newBuilder()); + } + + private static Builder createHttpJsonDefault() { + return new Builder(TestingStubSettings.newHttpJsonBuilder()); + } + + public TestingStubSettings.Builder getStubSettingsBuilder() { + return ((TestingStubSettings.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 createSession. */ + public UnaryCallSettings.Builder createSessionSettings() { + return getStubSettingsBuilder().createSessionSettings(); + } + + /** Returns the builder for the settings used for calls to getSession. */ + public UnaryCallSettings.Builder getSessionSettings() { + return getStubSettingsBuilder().getSessionSettings(); + } + + /** Returns the builder for the settings used for calls to listSessions. */ + public PagedCallSettings.Builder< + ListSessionsRequest, ListSessionsResponse, ListSessionsPagedResponse> + listSessionsSettings() { + return getStubSettingsBuilder().listSessionsSettings(); + } + + /** Returns the builder for the settings used for calls to deleteSession. */ + public UnaryCallSettings.Builder deleteSessionSettings() { + return getStubSettingsBuilder().deleteSessionSettings(); + } + + /** Returns the builder for the settings used for calls to reportSession. */ + public UnaryCallSettings.Builder + reportSessionSettings() { + return getStubSettingsBuilder().reportSessionSettings(); + } + + /** Returns the builder for the settings used for calls to listTests. */ + public PagedCallSettings.Builder + listTestsSettings() { + return getStubSettingsBuilder().listTestsSettings(); + } + + /** Returns the builder for the settings used for calls to deleteTest. */ + public UnaryCallSettings.Builder deleteTestSettings() { + return getStubSettingsBuilder().deleteTestSettings(); + } + + /** Returns the builder for the settings used for calls to verifyTest. */ + public UnaryCallSettings.Builder verifyTestSettings() { + return getStubSettingsBuilder().verifyTestSettings(); + } + + /** Returns the builder for the settings used for calls to listLocations. */ + public PagedCallSettings.Builder< + ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse> + listLocationsSettings() { + return getStubSettingsBuilder().listLocationsSettings(); + } + + /** Returns the builder for the settings used for calls to getLocation. */ + public UnaryCallSettings.Builder getLocationSettings() { + return getStubSettingsBuilder().getLocationSettings(); + } + + /** Returns the builder for the settings used for calls to setIamPolicy. */ + public UnaryCallSettings.Builder setIamPolicySettings() { + return getStubSettingsBuilder().setIamPolicySettings(); + } + + /** Returns the builder for the settings used for calls to getIamPolicy. */ + public UnaryCallSettings.Builder getIamPolicySettings() { + return getStubSettingsBuilder().getIamPolicySettings(); + } + + /** Returns the builder for the settings used for calls to testIamPermissions. */ + public UnaryCallSettings.Builder + testIamPermissionsSettings() { + return getStubSettingsBuilder().testIamPermissionsSettings(); + } + + @Override + public TestingSettings build() throws IOException { + return new TestingSettings(this); + } + } +} diff --git a/java-showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/Version.java b/java-showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/Version.java new file mode 100644 index 0000000000..2e43dbff55 --- /dev/null +++ b/java-showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/Version.java @@ -0,0 +1,27 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1; + +import com.google.api.core.InternalApi; + +@InternalApi("For internal use only") +public final class Version { + // {x-version-update-start:gapic-showcase:current} + public static final String VERSION = "0.0.0-SNAPSHOT"; + // {x-version-update-end} + +} diff --git a/java-showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/gapic_metadata.json b/java-showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/gapic_metadata.json new file mode 100644 index 0000000000..4d11ed39b9 --- /dev/null +++ b/java-showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/gapic_metadata.json @@ -0,0 +1,316 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "java", + "protoPackage": "google.showcase.v1beta1", + "libraryPackage": "com.google.showcase.v1beta1", + "services": { + "Compliance": { + "clients": { + "grpc": { + "libraryClient": "ComplianceClient", + "rpcs": { + "GetEnum": { + "methods": ["getEnum", "getEnumCallable"] + }, + "GetIamPolicy": { + "methods": ["getIamPolicy", "getIamPolicyCallable"] + }, + "GetLocation": { + "methods": ["getLocation", "getLocationCallable"] + }, + "ListLocations": { + "methods": ["listLocations", "listLocationsPagedCallable", "listLocationsCallable"] + }, + "RepeatDataBody": { + "methods": ["repeatDataBody", "repeatDataBodyCallable"] + }, + "RepeatDataBodyInfo": { + "methods": ["repeatDataBodyInfo", "repeatDataBodyInfoCallable"] + }, + "RepeatDataBodyPatch": { + "methods": ["repeatDataBodyPatch", "repeatDataBodyPatchCallable"] + }, + "RepeatDataBodyPut": { + "methods": ["repeatDataBodyPut", "repeatDataBodyPutCallable"] + }, + "RepeatDataPathResource": { + "methods": ["repeatDataPathResource", "repeatDataPathResourceCallable"] + }, + "RepeatDataPathTrailingResource": { + "methods": ["repeatDataPathTrailingResource", "repeatDataPathTrailingResourceCallable"] + }, + "RepeatDataQuery": { + "methods": ["repeatDataQuery", "repeatDataQueryCallable"] + }, + "RepeatDataSimplePath": { + "methods": ["repeatDataSimplePath", "repeatDataSimplePathCallable"] + }, + "SetIamPolicy": { + "methods": ["setIamPolicy", "setIamPolicyCallable"] + }, + "TestIamPermissions": { + "methods": ["testIamPermissions", "testIamPermissionsCallable"] + }, + "VerifyEnum": { + "methods": ["verifyEnum", "verifyEnumCallable"] + } + } + } + } + }, + "Echo": { + "clients": { + "grpc": { + "libraryClient": "EchoClient", + "rpcs": { + "Block": { + "methods": ["block", "blockCallable"] + }, + "Chat": { + "methods": ["chatCallable"] + }, + "Collect": { + "methods": ["collectCallable"] + }, + "Echo": { + "methods": ["echo", "echoCallable"] + }, + "EchoErrorDetails": { + "methods": ["echoErrorDetails", "echoErrorDetailsCallable"] + }, + "Expand": { + "methods": ["expandCallable"] + }, + "FailEchoWithDetails": { + "methods": ["failEchoWithDetails", "failEchoWithDetailsCallable"] + }, + "GetIamPolicy": { + "methods": ["getIamPolicy", "getIamPolicyCallable"] + }, + "GetLocation": { + "methods": ["getLocation", "getLocationCallable"] + }, + "ListLocations": { + "methods": ["listLocations", "listLocationsPagedCallable", "listLocationsCallable"] + }, + "PagedExpand": { + "methods": ["pagedExpand", "pagedExpandPagedCallable", "pagedExpandCallable"] + }, + "PagedExpandLegacy": { + "methods": ["pagedExpandLegacy", "pagedExpandLegacyCallable"] + }, + "PagedExpandLegacyMapped": { + "methods": ["pagedExpandLegacyMapped", "pagedExpandLegacyMappedPagedCallable", "pagedExpandLegacyMappedCallable"] + }, + "SetIamPolicy": { + "methods": ["setIamPolicy", "setIamPolicyCallable"] + }, + "TestIamPermissions": { + "methods": ["testIamPermissions", "testIamPermissionsCallable"] + }, + "Wait": { + "methods": ["waitAsync", "waitOperationCallable", "waitCallable"] + } + } + } + }, + "apiVersion": "v1_20240408" + }, + "Identity": { + "clients": { + "grpc": { + "libraryClient": "IdentityClient", + "rpcs": { + "CreateUser": { + "methods": ["createUser", "createUser", "createUser", "createUserCallable"] + }, + "DeleteUser": { + "methods": ["deleteUser", "deleteUser", "deleteUser", "deleteUserCallable"] + }, + "GetIamPolicy": { + "methods": ["getIamPolicy", "getIamPolicyCallable"] + }, + "GetLocation": { + "methods": ["getLocation", "getLocationCallable"] + }, + "GetUser": { + "methods": ["getUser", "getUser", "getUser", "getUserCallable"] + }, + "ListLocations": { + "methods": ["listLocations", "listLocationsPagedCallable", "listLocationsCallable"] + }, + "ListUsers": { + "methods": ["listUsers", "listUsersPagedCallable", "listUsersCallable"] + }, + "SetIamPolicy": { + "methods": ["setIamPolicy", "setIamPolicyCallable"] + }, + "TestIamPermissions": { + "methods": ["testIamPermissions", "testIamPermissionsCallable"] + }, + "UpdateUser": { + "methods": ["updateUser", "updateUserCallable"] + } + } + } + } + }, + "Messaging": { + "clients": { + "grpc": { + "libraryClient": "MessagingClient", + "rpcs": { + "Connect": { + "methods": ["connectCallable"] + }, + "CreateBlurb": { + "methods": ["createBlurb", "createBlurb", "createBlurb", "createBlurb", "createBlurb", "createBlurb", "createBlurb", "createBlurb", "createBlurb", "createBlurb", "createBlurb", "createBlurb", "createBlurb", "createBlurbCallable"] + }, + "CreateRoom": { + "methods": ["createRoom", "createRoom", "createRoomCallable"] + }, + "DeleteBlurb": { + "methods": ["deleteBlurb", "deleteBlurb", "deleteBlurb", "deleteBlurbCallable"] + }, + "DeleteRoom": { + "methods": ["deleteRoom", "deleteRoom", "deleteRoom", "deleteRoomCallable"] + }, + "GetBlurb": { + "methods": ["getBlurb", "getBlurb", "getBlurb", "getBlurbCallable"] + }, + "GetIamPolicy": { + "methods": ["getIamPolicy", "getIamPolicyCallable"] + }, + "GetLocation": { + "methods": ["getLocation", "getLocationCallable"] + }, + "GetRoom": { + "methods": ["getRoom", "getRoom", "getRoom", "getRoomCallable"] + }, + "ListBlurbs": { + "methods": ["listBlurbs", "listBlurbs", "listBlurbs", "listBlurbs", "listBlurbsPagedCallable", "listBlurbsCallable"] + }, + "ListLocations": { + "methods": ["listLocations", "listLocationsPagedCallable", "listLocationsCallable"] + }, + "ListRooms": { + "methods": ["listRooms", "listRoomsPagedCallable", "listRoomsCallable"] + }, + "SearchBlurbs": { + "methods": ["searchBlurbsAsync", "searchBlurbsAsync", "searchBlurbsAsync", "searchBlurbsAsync", "searchBlurbsOperationCallable", "searchBlurbsCallable"] + }, + "SendBlurbs": { + "methods": ["sendBlurbsCallable"] + }, + "SetIamPolicy": { + "methods": ["setIamPolicy", "setIamPolicyCallable"] + }, + "StreamBlurbs": { + "methods": ["streamBlurbsCallable"] + }, + "TestIamPermissions": { + "methods": ["testIamPermissions", "testIamPermissionsCallable"] + }, + "UpdateBlurb": { + "methods": ["updateBlurb", "updateBlurbCallable"] + }, + "UpdateRoom": { + "methods": ["updateRoom", "updateRoomCallable"] + } + } + } + } + }, + "SequenceService": { + "clients": { + "grpc": { + "libraryClient": "SequenceServiceClient", + "rpcs": { + "AttemptSequence": { + "methods": ["attemptSequence", "attemptSequence", "attemptSequence", "attemptSequenceCallable"] + }, + "AttemptStreamingSequence": { + "methods": ["attemptStreamingSequenceCallable"] + }, + "CreateSequence": { + "methods": ["createSequence", "createSequence", "createSequenceCallable"] + }, + "CreateStreamingSequence": { + "methods": ["createStreamingSequence", "createStreamingSequence", "createStreamingSequenceCallable"] + }, + "GetIamPolicy": { + "methods": ["getIamPolicy", "getIamPolicyCallable"] + }, + "GetLocation": { + "methods": ["getLocation", "getLocationCallable"] + }, + "GetSequenceReport": { + "methods": ["getSequenceReport", "getSequenceReport", "getSequenceReport", "getSequenceReportCallable"] + }, + "GetStreamingSequenceReport": { + "methods": ["getStreamingSequenceReport", "getStreamingSequenceReport", "getStreamingSequenceReport", "getStreamingSequenceReportCallable"] + }, + "ListLocations": { + "methods": ["listLocations", "listLocationsPagedCallable", "listLocationsCallable"] + }, + "SetIamPolicy": { + "methods": ["setIamPolicy", "setIamPolicyCallable"] + }, + "TestIamPermissions": { + "methods": ["testIamPermissions", "testIamPermissionsCallable"] + } + } + } + } + }, + "Testing": { + "clients": { + "grpc": { + "libraryClient": "TestingClient", + "rpcs": { + "CreateSession": { + "methods": ["createSession", "createSessionCallable"] + }, + "DeleteSession": { + "methods": ["deleteSession", "deleteSessionCallable"] + }, + "DeleteTest": { + "methods": ["deleteTest", "deleteTestCallable"] + }, + "GetIamPolicy": { + "methods": ["getIamPolicy", "getIamPolicyCallable"] + }, + "GetLocation": { + "methods": ["getLocation", "getLocationCallable"] + }, + "GetSession": { + "methods": ["getSession", "getSessionCallable"] + }, + "ListLocations": { + "methods": ["listLocations", "listLocationsPagedCallable", "listLocationsCallable"] + }, + "ListSessions": { + "methods": ["listSessions", "listSessionsPagedCallable", "listSessionsCallable"] + }, + "ListTests": { + "methods": ["listTests", "listTestsPagedCallable", "listTestsCallable"] + }, + "ReportSession": { + "methods": ["reportSession", "reportSessionCallable"] + }, + "SetIamPolicy": { + "methods": ["setIamPolicy", "setIamPolicyCallable"] + }, + "TestIamPermissions": { + "methods": ["testIamPermissions", "testIamPermissionsCallable"] + }, + "VerifyTest": { + "methods": ["verifyTest", "verifyTestCallable"] + } + } + } + } + } + } +} \ No newline at end of file diff --git a/java-showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/package-info.java b/java-showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/package-info.java new file mode 100644 index 0000000000..dff2b42214 --- /dev/null +++ b/java-showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/package-info.java @@ -0,0 +1,166 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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 Client Libraries Showcase API + * + *

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

        ======================= ComplianceClient ======================= + * + *

        Service Description: This service is used to test that GAPICs implement various REST-related + * features correctly. This mostly means transcoding proto3 requests to REST format correctly for + * various types of HTTP annotations, but it also includes verifying that unknown (numeric) enums + * received by clients can be round-tripped correctly. + * + *

        Sample for ComplianceClient: + * + *

        {@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 (ComplianceClient complianceClient = ComplianceClient.create()) {
        + *   RepeatRequest request =
        + *       RepeatRequest.newBuilder()
        + *           .setName("name3373707")
        + *           .setInfo(ComplianceData.newBuilder().build())
        + *           .setServerVerify(true)
        + *           .setIntendedBindingUri("intendedBindingUri780142386")
        + *           .setFInt32(-1143775883)
        + *           .setFInt64(-1143775788)
        + *           .setFDouble(-1239459382)
        + *           .setPInt32(-858673665)
        + *           .setPInt64(-858673570)
        + *           .setPDouble(-991225216)
        + *           .build();
        + *   RepeatResponse response = complianceClient.repeatDataBody(request);
        + * }
        + * }
        + * + *

        ======================= EchoClient ======================= + * + *

        Service Description: This service is used showcase the four main types of rpcs - unary, server + * side streaming, client side streaming, and bidirectional streaming. This service also exposes + * methods that explicitly implement server delay, and paginated calls. Set the 'showcase-trailer' + * metadata key on any method to have the values echoed in the response trailers. Set the + * 'x-goog-request-params' metadata key on any method to have the values echoed in the response + * headers. + * + *

        Sample for EchoClient: + * + *

        {@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 (EchoClient echoClient = EchoClient.create()) {
        + *   EchoRequest request =
        + *       EchoRequest.newBuilder()
        + *           .setSeverity(Severity.forNumber(0))
        + *           .setHeader("header-1221270899")
        + *           .setOtherHeader("otherHeader-2026585667")
        + *           .setRequestId("requestId693933066")
        + *           .setOtherRequestId("otherRequestId1248995034")
        + *           .build();
        + *   EchoResponse response = echoClient.echo(request);
        + * }
        + * }
        + * + *

        ======================= IdentityClient ======================= + * + *

        Service Description: A simple identity service. + * + *

        Sample for IdentityClient: + * + *

        {@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 (IdentityClient identityClient = IdentityClient.create()) {
        + *   String displayName = "displayName1714148973";
        + *   String email = "email96619420";
        + *   User response = identityClient.createUser(displayName, email);
        + * }
        + * }
        + * + *

        ======================= MessagingClient ======================= + * + *

        Service Description: A simple messaging service that implements chat rooms and profile posts. + * + *

        This messaging service showcases the features that API clients generated by gapic-generators + * implement. + * + *

        Sample for MessagingClient: + * + *

        {@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 (MessagingClient messagingClient = MessagingClient.create()) {
        + *   String displayName = "displayName1714148973";
        + *   String description = "description-1724546052";
        + *   Room response = messagingClient.createRoom(displayName, description);
        + * }
        + * }
        + * + *

        ======================= SequenceServiceClient ======================= + * + *

        Sample for SequenceServiceClient: + * + *

        {@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 (SequenceServiceClient sequenceServiceClient = SequenceServiceClient.create()) {
        + *   Sequence sequence = Sequence.newBuilder().build();
        + *   Sequence response = sequenceServiceClient.createSequence(sequence);
        + * }
        + * }
        + * + *

        ======================= TestingClient ======================= + * + *

        Service Description: A service to facilitate running discrete sets of tests against Showcase. + * Adding this comment with special characters for comment formatting tests: 1. + * (abra->kadabra->alakazam) 2) [Nonsense][]: `pokemon/*/psychic/*` + * + *

        Sample for TestingClient: + * + *

        {@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 (TestingClient testingClient = TestingClient.create()) {
        + *   CreateSessionRequest request =
        + *       CreateSessionRequest.newBuilder().setSession(Session.newBuilder().build()).build();
        + *   Session response = testingClient.createSession(request);
        + * }
        + * }
        + */ +@Generated("by gapic-generator-java") +package com.google.showcase.v1beta1; + +import javax.annotation.Generated; diff --git a/java-showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/ComplianceStub.java b/java-showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/ComplianceStub.java new file mode 100644 index 0000000000..022d3dee15 --- /dev/null +++ b/java-showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/ComplianceStub.java @@ -0,0 +1,118 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.stub; + +import static com.google.showcase.v1beta1.ComplianceClient.ListLocationsPagedResponse; + +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.showcase.v1beta1.EnumRequest; +import com.google.showcase.v1beta1.EnumResponse; +import com.google.showcase.v1beta1.RepeatRequest; +import com.google.showcase.v1beta1.RepeatResponse; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Base stub class for the Compliance service API. + * + *

        This class is for advanced usage and reflects the underlying API directly. + */ +@BetaApi +@Generated("by gapic-generator-java") +public abstract class ComplianceStub implements BackgroundResource { + + public UnaryCallable repeatDataBodyCallable() { + throw new UnsupportedOperationException("Not implemented: repeatDataBodyCallable()"); + } + + public UnaryCallable repeatDataBodyInfoCallable() { + throw new UnsupportedOperationException("Not implemented: repeatDataBodyInfoCallable()"); + } + + public UnaryCallable repeatDataQueryCallable() { + throw new UnsupportedOperationException("Not implemented: repeatDataQueryCallable()"); + } + + public UnaryCallable repeatDataSimplePathCallable() { + throw new UnsupportedOperationException("Not implemented: repeatDataSimplePathCallable()"); + } + + public UnaryCallable repeatDataPathResourceCallable() { + throw new UnsupportedOperationException("Not implemented: repeatDataPathResourceCallable()"); + } + + public UnaryCallable repeatDataPathTrailingResourceCallable() { + throw new UnsupportedOperationException( + "Not implemented: repeatDataPathTrailingResourceCallable()"); + } + + public UnaryCallable repeatDataBodyPutCallable() { + throw new UnsupportedOperationException("Not implemented: repeatDataBodyPutCallable()"); + } + + public UnaryCallable repeatDataBodyPatchCallable() { + throw new UnsupportedOperationException("Not implemented: repeatDataBodyPatchCallable()"); + } + + public UnaryCallable getEnumCallable() { + throw new UnsupportedOperationException("Not implemented: getEnumCallable()"); + } + + public UnaryCallable verifyEnumCallable() { + throw new UnsupportedOperationException("Not implemented: verifyEnumCallable()"); + } + + public UnaryCallable + listLocationsPagedCallable() { + throw new UnsupportedOperationException("Not implemented: listLocationsPagedCallable()"); + } + + public UnaryCallable listLocationsCallable() { + throw new UnsupportedOperationException("Not implemented: listLocationsCallable()"); + } + + public UnaryCallable getLocationCallable() { + throw new UnsupportedOperationException("Not implemented: getLocationCallable()"); + } + + public UnaryCallable setIamPolicyCallable() { + throw new UnsupportedOperationException("Not implemented: setIamPolicyCallable()"); + } + + public UnaryCallable getIamPolicyCallable() { + throw new UnsupportedOperationException("Not implemented: getIamPolicyCallable()"); + } + + public UnaryCallable + testIamPermissionsCallable() { + throw new UnsupportedOperationException("Not implemented: testIamPermissionsCallable()"); + } + + @Override + public abstract void close(); +} diff --git a/java-showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/ComplianceStubSettings.java b/java-showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/ComplianceStubSettings.java new file mode 100644 index 0000000000..72c98e6400 --- /dev/null +++ b/java-showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/ComplianceStubSettings.java @@ -0,0 +1,738 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.stub; + +import static com.google.showcase.v1beta1.ComplianceClient.ListLocationsPagedResponse; + +import com.google.api.core.ApiFunction; +import com.google.api.core.ApiFuture; +import com.google.api.core.BetaApi; +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.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.HttpJsonTransportChannel; +import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; +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.LibraryMetadata; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.PagedListDescriptor; +import com.google.api.gax.rpc.PagedListResponseFactory; +import com.google.api.gax.rpc.StatusCode; +import com.google.api.gax.rpc.StubSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +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.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.showcase.v1beta1.EnumRequest; +import com.google.showcase.v1beta1.EnumResponse; +import com.google.showcase.v1beta1.RepeatRequest; +import com.google.showcase.v1beta1.RepeatResponse; +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 ComplianceStub}. + * + *

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

          + *
        • The default service address (localhost) and default port (7469) 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 repeatDataBody: + * + *

        {@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
        + * ComplianceStubSettings.Builder complianceSettingsBuilder = ComplianceStubSettings.newBuilder();
        + * complianceSettingsBuilder
        + *     .repeatDataBodySettings()
        + *     .setRetrySettings(
        + *         complianceSettingsBuilder
        + *             .repeatDataBodySettings()
        + *             .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());
        + * ComplianceStubSettings complianceSettings = complianceSettingsBuilder.build();
        + * }
        + * + * Please refer to the [Client Side Retry + * Guide](https://docs.cloud.google.com/java/docs/client-retries) for additional support in setting + * retries. + */ +@BetaApi +@Generated("by gapic-generator-java") +@SuppressWarnings("CanonicalDuration") +public class ComplianceStubSettings extends StubSettings { + /** The default scopes of the service. */ + private static final ImmutableList DEFAULT_SERVICE_SCOPES = + ImmutableList.builder().build(); + + private final UnaryCallSettings repeatDataBodySettings; + private final UnaryCallSettings repeatDataBodyInfoSettings; + private final UnaryCallSettings repeatDataQuerySettings; + private final UnaryCallSettings repeatDataSimplePathSettings; + private final UnaryCallSettings repeatDataPathResourceSettings; + private final UnaryCallSettings + repeatDataPathTrailingResourceSettings; + private final UnaryCallSettings repeatDataBodyPutSettings; + private final UnaryCallSettings repeatDataBodyPatchSettings; + private final UnaryCallSettings getEnumSettings; + private final UnaryCallSettings verifyEnumSettings; + private final PagedCallSettings< + ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse> + listLocationsSettings; + private final UnaryCallSettings getLocationSettings; + private final UnaryCallSettings setIamPolicySettings; + private final UnaryCallSettings getIamPolicySettings; + private final UnaryCallSettings + testIamPermissionsSettings; + + private static final PagedListDescriptor + LIST_LOCATIONS_PAGE_STR_DESC = + new PagedListDescriptor() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public ListLocationsRequest injectToken(ListLocationsRequest payload, String token) { + return ListLocationsRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public ListLocationsRequest injectPageSize(ListLocationsRequest payload, int pageSize) { + return ListLocationsRequest.newBuilder(payload).setPageSize(pageSize).build(); + } + + @Override + public Integer extractPageSize(ListLocationsRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(ListLocationsResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources(ListLocationsResponse payload) { + return payload.getLocationsList(); + } + }; + + private static final PagedListResponseFactory< + ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse> + LIST_LOCATIONS_PAGE_STR_FACT = + new PagedListResponseFactory< + ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListLocationsRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext pageContext = + PageContext.create(callable, LIST_LOCATIONS_PAGE_STR_DESC, request, context); + return ListLocationsPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + /** Returns the object with the settings used for calls to repeatDataBody. */ + public UnaryCallSettings repeatDataBodySettings() { + return repeatDataBodySettings; + } + + /** Returns the object with the settings used for calls to repeatDataBodyInfo. */ + public UnaryCallSettings repeatDataBodyInfoSettings() { + return repeatDataBodyInfoSettings; + } + + /** Returns the object with the settings used for calls to repeatDataQuery. */ + public UnaryCallSettings repeatDataQuerySettings() { + return repeatDataQuerySettings; + } + + /** Returns the object with the settings used for calls to repeatDataSimplePath. */ + public UnaryCallSettings repeatDataSimplePathSettings() { + return repeatDataSimplePathSettings; + } + + /** Returns the object with the settings used for calls to repeatDataPathResource. */ + public UnaryCallSettings repeatDataPathResourceSettings() { + return repeatDataPathResourceSettings; + } + + /** Returns the object with the settings used for calls to repeatDataPathTrailingResource. */ + public UnaryCallSettings repeatDataPathTrailingResourceSettings() { + return repeatDataPathTrailingResourceSettings; + } + + /** Returns the object with the settings used for calls to repeatDataBodyPut. */ + public UnaryCallSettings repeatDataBodyPutSettings() { + return repeatDataBodyPutSettings; + } + + /** Returns the object with the settings used for calls to repeatDataBodyPatch. */ + public UnaryCallSettings repeatDataBodyPatchSettings() { + return repeatDataBodyPatchSettings; + } + + /** Returns the object with the settings used for calls to getEnum. */ + public UnaryCallSettings getEnumSettings() { + return getEnumSettings; + } + + /** Returns the object with the settings used for calls to verifyEnum. */ + public UnaryCallSettings verifyEnumSettings() { + return verifyEnumSettings; + } + + /** Returns the object with the settings used for calls to listLocations. */ + public PagedCallSettings + listLocationsSettings() { + return listLocationsSettings; + } + + /** Returns the object with the settings used for calls to getLocation. */ + public UnaryCallSettings getLocationSettings() { + return getLocationSettings; + } + + /** Returns the object with the settings used for calls to setIamPolicy. */ + public UnaryCallSettings setIamPolicySettings() { + return setIamPolicySettings; + } + + /** Returns the object with the settings used for calls to getIamPolicy. */ + public UnaryCallSettings getIamPolicySettings() { + return getIamPolicySettings; + } + + /** Returns the object with the settings used for calls to testIamPermissions. */ + public UnaryCallSettings + testIamPermissionsSettings() { + return testIamPermissionsSettings; + } + + public ComplianceStub createStub() throws IOException { + if (getTransportChannelProvider() + .getTransportName() + .equals(GrpcTransportChannel.getGrpcTransportName())) { + return GrpcComplianceStub.create(this); + } + if (getTransportChannelProvider() + .getTransportName() + .equals(HttpJsonTransportChannel.getHttpJsonTransportName())) { + return HttpJsonComplianceStub.create(this); + } + throw new UnsupportedOperationException( + String.format( + "Transport not supported: %s", getTransportChannelProvider().getTransportName())); + } + + /** Returns a builder for the default ExecutorProvider for this service. */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return InstantiatingExecutorProvider.newBuilder(); + } + + /** Returns the default service endpoint. */ + @ObsoleteApi("Use getEndpoint() instead") + public static String getDefaultEndpoint() { + return "localhost:7469"; + } + + /** Returns the default mTLS service endpoint. */ + public static String getDefaultMtlsEndpoint() { + return "localhost:7469"; + } + + /** 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 gRPC ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return InstantiatingGrpcChannelProvider.newBuilder() + .setMaxInboundMessageSize(Integer.MAX_VALUE); + } + + /** Returns a builder for the default REST ChannelProvider for this service. */ + @BetaApi + public static InstantiatingHttpJsonChannelProvider.Builder + defaultHttpJsonTransportProviderBuilder() { + return InstantiatingHttpJsonChannelProvider.newBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return defaultGrpcTransportProviderBuilder().build(); + } + + public static ApiClientHeaderProvider.Builder defaultGrpcApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken( + "gapic", GaxProperties.getLibraryVersion(ComplianceStubSettings.class)) + .setTransportToken( + GaxGrpcProperties.getGrpcTokenName(), GaxGrpcProperties.getGrpcVersion()); + } + + public static ApiClientHeaderProvider.Builder defaultHttpJsonApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken( + "gapic", GaxProperties.getLibraryVersion(ComplianceStubSettings.class)) + .setTransportToken( + GaxHttpJsonProperties.getHttpJsonTokenName(), + GaxHttpJsonProperties.getHttpJsonVersion()); + } + + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return ComplianceStubSettings.defaultGrpcApiClientHeaderProviderBuilder(); + } + + /** Returns a new gRPC builder for this class. */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** Returns a new REST builder for this class. */ + public static Builder newHttpJsonBuilder() { + return Builder.createHttpJsonDefault(); + } + + /** 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 ComplianceStubSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + + repeatDataBodySettings = settingsBuilder.repeatDataBodySettings().build(); + repeatDataBodyInfoSettings = settingsBuilder.repeatDataBodyInfoSettings().build(); + repeatDataQuerySettings = settingsBuilder.repeatDataQuerySettings().build(); + repeatDataSimplePathSettings = settingsBuilder.repeatDataSimplePathSettings().build(); + repeatDataPathResourceSettings = settingsBuilder.repeatDataPathResourceSettings().build(); + repeatDataPathTrailingResourceSettings = + settingsBuilder.repeatDataPathTrailingResourceSettings().build(); + repeatDataBodyPutSettings = settingsBuilder.repeatDataBodyPutSettings().build(); + repeatDataBodyPatchSettings = settingsBuilder.repeatDataBodyPatchSettings().build(); + getEnumSettings = settingsBuilder.getEnumSettings().build(); + verifyEnumSettings = settingsBuilder.verifyEnumSettings().build(); + listLocationsSettings = settingsBuilder.listLocationsSettings().build(); + getLocationSettings = settingsBuilder.getLocationSettings().build(); + setIamPolicySettings = settingsBuilder.setIamPolicySettings().build(); + getIamPolicySettings = settingsBuilder.getIamPolicySettings().build(); + testIamPermissionsSettings = settingsBuilder.testIamPermissionsSettings().build(); + } + + @Override + protected LibraryMetadata getLibraryMetadata() { + return LibraryMetadata.newBuilder() + .setArtifactName("com.google.cloud:gapic-showcase") + .setRepository("googleapis/sdk-platform-java") + .setVersion(Version.VERSION) + .build(); + } + + /** Builder for ComplianceStubSettings. */ + public static class Builder extends StubSettings.Builder { + private final ImmutableList> unaryMethodSettingsBuilders; + private final UnaryCallSettings.Builder repeatDataBodySettings; + private final UnaryCallSettings.Builder + repeatDataBodyInfoSettings; + private final UnaryCallSettings.Builder repeatDataQuerySettings; + private final UnaryCallSettings.Builder + repeatDataSimplePathSettings; + private final UnaryCallSettings.Builder + repeatDataPathResourceSettings; + private final UnaryCallSettings.Builder + repeatDataPathTrailingResourceSettings; + private final UnaryCallSettings.Builder + repeatDataBodyPutSettings; + private final UnaryCallSettings.Builder + repeatDataBodyPatchSettings; + private final UnaryCallSettings.Builder getEnumSettings; + private final UnaryCallSettings.Builder verifyEnumSettings; + private final PagedCallSettings.Builder< + ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse> + listLocationsSettings; + private final UnaryCallSettings.Builder getLocationSettings; + private final UnaryCallSettings.Builder setIamPolicySettings; + private final UnaryCallSettings.Builder getIamPolicySettings; + private final UnaryCallSettings.Builder + testIamPermissionsSettings; + private static final ImmutableMap> + RETRYABLE_CODE_DEFINITIONS; + + static { + ImmutableMap.Builder> definitions = + ImmutableMap.builder(); + definitions.put("no_retry_codes", ImmutableSet.copyOf(Lists.newArrayList())); + RETRYABLE_CODE_DEFINITIONS = definitions.build(); + } + + private static final ImmutableMap RETRY_PARAM_DEFINITIONS; + + static { + ImmutableMap.Builder definitions = ImmutableMap.builder(); + RetrySettings settings = null; + settings = RetrySettings.newBuilder().setRpcTimeoutMultiplier(1.0).build(); + definitions.put("no_retry_params", settings); + RETRY_PARAM_DEFINITIONS = definitions.build(); + } + + protected Builder() { + this(((ClientContext) null)); + } + + protected Builder(ClientContext clientContext) { + super(clientContext); + + repeatDataBodySettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + repeatDataBodyInfoSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + repeatDataQuerySettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + repeatDataSimplePathSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + repeatDataPathResourceSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + repeatDataPathTrailingResourceSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + repeatDataBodyPutSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + repeatDataBodyPatchSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + getEnumSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + verifyEnumSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + listLocationsSettings = PagedCallSettings.newBuilder(LIST_LOCATIONS_PAGE_STR_FACT); + getLocationSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + setIamPolicySettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + getIamPolicySettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + testIamPermissionsSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + repeatDataBodySettings, + repeatDataBodyInfoSettings, + repeatDataQuerySettings, + repeatDataSimplePathSettings, + repeatDataPathResourceSettings, + repeatDataPathTrailingResourceSettings, + repeatDataBodyPutSettings, + repeatDataBodyPatchSettings, + getEnumSettings, + verifyEnumSettings, + listLocationsSettings, + getLocationSettings, + setIamPolicySettings, + getIamPolicySettings, + testIamPermissionsSettings); + initDefaults(this); + } + + protected Builder(ComplianceStubSettings settings) { + super(settings); + + repeatDataBodySettings = settings.repeatDataBodySettings.toBuilder(); + repeatDataBodyInfoSettings = settings.repeatDataBodyInfoSettings.toBuilder(); + repeatDataQuerySettings = settings.repeatDataQuerySettings.toBuilder(); + repeatDataSimplePathSettings = settings.repeatDataSimplePathSettings.toBuilder(); + repeatDataPathResourceSettings = settings.repeatDataPathResourceSettings.toBuilder(); + repeatDataPathTrailingResourceSettings = + settings.repeatDataPathTrailingResourceSettings.toBuilder(); + repeatDataBodyPutSettings = settings.repeatDataBodyPutSettings.toBuilder(); + repeatDataBodyPatchSettings = settings.repeatDataBodyPatchSettings.toBuilder(); + getEnumSettings = settings.getEnumSettings.toBuilder(); + verifyEnumSettings = settings.verifyEnumSettings.toBuilder(); + listLocationsSettings = settings.listLocationsSettings.toBuilder(); + getLocationSettings = settings.getLocationSettings.toBuilder(); + setIamPolicySettings = settings.setIamPolicySettings.toBuilder(); + getIamPolicySettings = settings.getIamPolicySettings.toBuilder(); + testIamPermissionsSettings = settings.testIamPermissionsSettings.toBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + repeatDataBodySettings, + repeatDataBodyInfoSettings, + repeatDataQuerySettings, + repeatDataSimplePathSettings, + repeatDataPathResourceSettings, + repeatDataPathTrailingResourceSettings, + repeatDataBodyPutSettings, + repeatDataBodyPatchSettings, + getEnumSettings, + verifyEnumSettings, + listLocationsSettings, + getLocationSettings, + setIamPolicySettings, + getIamPolicySettings, + testIamPermissionsSettings); + } + + 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 createHttpJsonDefault() { + Builder builder = new Builder(((ClientContext) null)); + + builder.setTransportChannelProvider(defaultHttpJsonTransportProviderBuilder().build()); + builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); + builder.setInternalHeaderProvider(defaultHttpJsonApiClientHeaderProviderBuilder().build()); + builder.setMtlsEndpoint(getDefaultMtlsEndpoint()); + builder.setSwitchToMtlsEndpointAllowed(true); + + return initDefaults(builder); + } + + private static Builder initDefaults(Builder builder) { + builder + .repeatDataBodySettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .repeatDataBodyInfoSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .repeatDataQuerySettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .repeatDataSimplePathSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .repeatDataPathResourceSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .repeatDataPathTrailingResourceSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .repeatDataBodyPutSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .repeatDataBodyPatchSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .getEnumSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .verifyEnumSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .listLocationsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .getLocationSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .setIamPolicySettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .getIamPolicySettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .testIamPermissionsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_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 repeatDataBody. */ + public UnaryCallSettings.Builder repeatDataBodySettings() { + return repeatDataBodySettings; + } + + /** Returns the builder for the settings used for calls to repeatDataBodyInfo. */ + public UnaryCallSettings.Builder repeatDataBodyInfoSettings() { + return repeatDataBodyInfoSettings; + } + + /** Returns the builder for the settings used for calls to repeatDataQuery. */ + public UnaryCallSettings.Builder repeatDataQuerySettings() { + return repeatDataQuerySettings; + } + + /** Returns the builder for the settings used for calls to repeatDataSimplePath. */ + public UnaryCallSettings.Builder repeatDataSimplePathSettings() { + return repeatDataSimplePathSettings; + } + + /** Returns the builder for the settings used for calls to repeatDataPathResource. */ + public UnaryCallSettings.Builder + repeatDataPathResourceSettings() { + return repeatDataPathResourceSettings; + } + + /** Returns the builder for the settings used for calls to repeatDataPathTrailingResource. */ + public UnaryCallSettings.Builder + repeatDataPathTrailingResourceSettings() { + return repeatDataPathTrailingResourceSettings; + } + + /** Returns the builder for the settings used for calls to repeatDataBodyPut. */ + public UnaryCallSettings.Builder repeatDataBodyPutSettings() { + return repeatDataBodyPutSettings; + } + + /** Returns the builder for the settings used for calls to repeatDataBodyPatch. */ + public UnaryCallSettings.Builder repeatDataBodyPatchSettings() { + return repeatDataBodyPatchSettings; + } + + /** Returns the builder for the settings used for calls to getEnum. */ + public UnaryCallSettings.Builder getEnumSettings() { + return getEnumSettings; + } + + /** Returns the builder for the settings used for calls to verifyEnum. */ + public UnaryCallSettings.Builder verifyEnumSettings() { + return verifyEnumSettings; + } + + /** Returns the builder for the settings used for calls to listLocations. */ + public PagedCallSettings.Builder< + ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse> + listLocationsSettings() { + return listLocationsSettings; + } + + /** Returns the builder for the settings used for calls to getLocation. */ + public UnaryCallSettings.Builder getLocationSettings() { + return getLocationSettings; + } + + /** Returns the builder for the settings used for calls to setIamPolicy. */ + public UnaryCallSettings.Builder setIamPolicySettings() { + return setIamPolicySettings; + } + + /** Returns the builder for the settings used for calls to getIamPolicy. */ + public UnaryCallSettings.Builder getIamPolicySettings() { + return getIamPolicySettings; + } + + /** Returns the builder for the settings used for calls to testIamPermissions. */ + public UnaryCallSettings.Builder + testIamPermissionsSettings() { + return testIamPermissionsSettings; + } + + @Override + public ComplianceStubSettings build() throws IOException { + return new ComplianceStubSettings(this); + } + } +} diff --git a/java-showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/EchoStub.java b/java-showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/EchoStub.java new file mode 100644 index 0000000000..6eeddc421c --- /dev/null +++ b/java-showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/EchoStub.java @@ -0,0 +1,166 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.stub; + +import static com.google.showcase.v1beta1.EchoClient.ListLocationsPagedResponse; +import static com.google.showcase.v1beta1.EchoClient.PagedExpandLegacyMappedPagedResponse; +import static com.google.showcase.v1beta1.EchoClient.PagedExpandPagedResponse; + +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.rpc.BidiStreamingCallable; +import com.google.api.gax.rpc.ClientStreamingCallable; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.longrunning.Operation; +import com.google.longrunning.stub.OperationsStub; +import com.google.showcase.v1beta1.BlockRequest; +import com.google.showcase.v1beta1.BlockResponse; +import com.google.showcase.v1beta1.EchoErrorDetailsRequest; +import com.google.showcase.v1beta1.EchoErrorDetailsResponse; +import com.google.showcase.v1beta1.EchoRequest; +import com.google.showcase.v1beta1.EchoResponse; +import com.google.showcase.v1beta1.ExpandRequest; +import com.google.showcase.v1beta1.FailEchoWithDetailsRequest; +import com.google.showcase.v1beta1.FailEchoWithDetailsResponse; +import com.google.showcase.v1beta1.PagedExpandLegacyMappedResponse; +import com.google.showcase.v1beta1.PagedExpandLegacyRequest; +import com.google.showcase.v1beta1.PagedExpandRequest; +import com.google.showcase.v1beta1.PagedExpandResponse; +import com.google.showcase.v1beta1.WaitMetadata; +import com.google.showcase.v1beta1.WaitRequest; +import com.google.showcase.v1beta1.WaitResponse; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Base stub class for the Echo service API. + * + *

        This class is for advanced usage and reflects the underlying API directly. + */ +@BetaApi +@Generated("by gapic-generator-java") +public abstract class EchoStub implements BackgroundResource { + + public OperationsStub getOperationsStub() { + return null; + } + + public com.google.api.gax.httpjson.longrunning.stub.OperationsStub getHttpJsonOperationsStub() { + return null; + } + + public UnaryCallable echoCallable() { + throw new UnsupportedOperationException("Not implemented: echoCallable()"); + } + + public UnaryCallable + echoErrorDetailsCallable() { + throw new UnsupportedOperationException("Not implemented: echoErrorDetailsCallable()"); + } + + public UnaryCallable + failEchoWithDetailsCallable() { + throw new UnsupportedOperationException("Not implemented: failEchoWithDetailsCallable()"); + } + + public ServerStreamingCallable expandCallable() { + throw new UnsupportedOperationException("Not implemented: expandCallable()"); + } + + public ClientStreamingCallable collectCallable() { + throw new UnsupportedOperationException("Not implemented: collectCallable()"); + } + + public BidiStreamingCallable chatCallable() { + throw new UnsupportedOperationException("Not implemented: chatCallable()"); + } + + public UnaryCallable pagedExpandPagedCallable() { + throw new UnsupportedOperationException("Not implemented: pagedExpandPagedCallable()"); + } + + public UnaryCallable pagedExpandCallable() { + throw new UnsupportedOperationException("Not implemented: pagedExpandCallable()"); + } + + public UnaryCallable pagedExpandLegacyCallable() { + throw new UnsupportedOperationException("Not implemented: pagedExpandLegacyCallable()"); + } + + public UnaryCallable + pagedExpandLegacyMappedPagedCallable() { + throw new UnsupportedOperationException( + "Not implemented: pagedExpandLegacyMappedPagedCallable()"); + } + + public UnaryCallable + pagedExpandLegacyMappedCallable() { + throw new UnsupportedOperationException("Not implemented: pagedExpandLegacyMappedCallable()"); + } + + public OperationCallable waitOperationCallable() { + throw new UnsupportedOperationException("Not implemented: waitOperationCallable()"); + } + + public UnaryCallable waitCallable() { + throw new UnsupportedOperationException("Not implemented: waitCallable()"); + } + + public UnaryCallable blockCallable() { + throw new UnsupportedOperationException("Not implemented: blockCallable()"); + } + + public UnaryCallable + listLocationsPagedCallable() { + throw new UnsupportedOperationException("Not implemented: listLocationsPagedCallable()"); + } + + public UnaryCallable listLocationsCallable() { + throw new UnsupportedOperationException("Not implemented: listLocationsCallable()"); + } + + public UnaryCallable getLocationCallable() { + throw new UnsupportedOperationException("Not implemented: getLocationCallable()"); + } + + public UnaryCallable setIamPolicyCallable() { + throw new UnsupportedOperationException("Not implemented: setIamPolicyCallable()"); + } + + public UnaryCallable getIamPolicyCallable() { + throw new UnsupportedOperationException("Not implemented: getIamPolicyCallable()"); + } + + public UnaryCallable + testIamPermissionsCallable() { + throw new UnsupportedOperationException("Not implemented: testIamPermissionsCallable()"); + } + + @Override + public abstract void close(); +} diff --git a/java-showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/EchoStubSettings.java b/java-showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/EchoStubSettings.java new file mode 100644 index 0000000000..ebd2807839 --- /dev/null +++ b/java-showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/EchoStubSettings.java @@ -0,0 +1,992 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.stub; + +import static com.google.showcase.v1beta1.EchoClient.ListLocationsPagedResponse; +import static com.google.showcase.v1beta1.EchoClient.PagedExpandLegacyMappedPagedResponse; +import static com.google.showcase.v1beta1.EchoClient.PagedExpandPagedResponse; + +import com.google.api.core.ApiFunction; +import com.google.api.core.ApiFuture; +import com.google.api.core.BetaApi; +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.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.HttpJsonTransportChannel; +import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; +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.LibraryMetadata; +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.ServerStreamingCallSettings; +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.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +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.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.longrunning.Operation; +import com.google.showcase.v1beta1.BlockRequest; +import com.google.showcase.v1beta1.BlockResponse; +import com.google.showcase.v1beta1.EchoErrorDetailsRequest; +import com.google.showcase.v1beta1.EchoErrorDetailsResponse; +import com.google.showcase.v1beta1.EchoRequest; +import com.google.showcase.v1beta1.EchoResponse; +import com.google.showcase.v1beta1.ExpandRequest; +import com.google.showcase.v1beta1.FailEchoWithDetailsRequest; +import com.google.showcase.v1beta1.FailEchoWithDetailsResponse; +import com.google.showcase.v1beta1.PagedExpandLegacyMappedResponse; +import com.google.showcase.v1beta1.PagedExpandLegacyRequest; +import com.google.showcase.v1beta1.PagedExpandRequest; +import com.google.showcase.v1beta1.PagedExpandResponse; +import com.google.showcase.v1beta1.PagedExpandResponseList; +import com.google.showcase.v1beta1.WaitMetadata; +import com.google.showcase.v1beta1.WaitRequest; +import com.google.showcase.v1beta1.WaitResponse; +import java.io.IOException; +import java.time.Duration; +import java.util.List; +import java.util.Map; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Settings class to configure an instance of {@link EchoStub}. + * + *

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

          + *
        • The default service address (localhost) and default port (7469) 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 echo: + * + *

        {@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
        + * EchoStubSettings.Builder echoSettingsBuilder = EchoStubSettings.newBuilder();
        + * echoSettingsBuilder
        + *     .echoSettings()
        + *     .setRetrySettings(
        + *         echoSettingsBuilder
        + *             .echoSettings()
        + *             .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());
        + * EchoStubSettings echoSettings = echoSettingsBuilder.build();
        + * }
        + * + * Please refer to the [Client Side Retry + * Guide](https://docs.cloud.google.com/java/docs/client-retries) 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 wait: + * + *

        {@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
        + * EchoStubSettings.Builder echoSettingsBuilder = EchoStubSettings.newBuilder();
        + * TimedRetryAlgorithm timedRetryAlgorithm =
        + *     OperationalTimedPollAlgorithm.create(
        + *         RetrySettings.newBuilder()
        + *             .setInitialRetryDelayDuration(Duration.ofMillis(500))
        + *             .setRetryDelayMultiplier(1.5)
        + *             .setMaxRetryDelayDuration(Duration.ofMillis(5000))
        + *             .setTotalTimeoutDuration(Duration.ofHours(24))
        + *             .build());
        + * echoSettingsBuilder
        + *     .createClusterOperationSettings()
        + *     .setPollingAlgorithm(timedRetryAlgorithm)
        + *     .build();
        + * }
        + */ +@BetaApi +@Generated("by gapic-generator-java") +@SuppressWarnings("CanonicalDuration") +public class EchoStubSettings extends StubSettings { + /** The default scopes of the service. */ + private static final ImmutableList DEFAULT_SERVICE_SCOPES = + ImmutableList.builder().build(); + + private final UnaryCallSettings echoSettings; + private final UnaryCallSettings + echoErrorDetailsSettings; + private final UnaryCallSettings + failEchoWithDetailsSettings; + private final ServerStreamingCallSettings expandSettings; + private final StreamingCallSettings collectSettings; + private final StreamingCallSettings chatSettings; + private final PagedCallSettings + pagedExpandSettings; + private final UnaryCallSettings + pagedExpandLegacySettings; + private final PagedCallSettings< + PagedExpandRequest, PagedExpandLegacyMappedResponse, PagedExpandLegacyMappedPagedResponse> + pagedExpandLegacyMappedSettings; + private final UnaryCallSettings waitSettings; + private final OperationCallSettings + waitOperationSettings; + private final UnaryCallSettings blockSettings; + private final PagedCallSettings< + ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse> + listLocationsSettings; + private final UnaryCallSettings getLocationSettings; + private final UnaryCallSettings setIamPolicySettings; + private final UnaryCallSettings getIamPolicySettings; + private final UnaryCallSettings + testIamPermissionsSettings; + + private static final PagedListDescriptor + PAGED_EXPAND_PAGE_STR_DESC = + new PagedListDescriptor() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public PagedExpandRequest injectToken(PagedExpandRequest payload, String token) { + return PagedExpandRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public PagedExpandRequest injectPageSize(PagedExpandRequest payload, int pageSize) { + return PagedExpandRequest.newBuilder(payload).setPageSize(pageSize).build(); + } + + @Override + public Integer extractPageSize(PagedExpandRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(PagedExpandResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources(PagedExpandResponse payload) { + return payload.getResponsesList(); + } + }; + + private static final PagedListDescriptor< + PagedExpandRequest, + PagedExpandLegacyMappedResponse, + Map.Entry> + PAGED_EXPAND_LEGACY_MAPPED_PAGE_STR_DESC = + new PagedListDescriptor< + PagedExpandRequest, + PagedExpandLegacyMappedResponse, + Map.Entry>() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public PagedExpandRequest injectToken(PagedExpandRequest payload, String token) { + return PagedExpandRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public PagedExpandRequest injectPageSize(PagedExpandRequest payload, int pageSize) { + return PagedExpandRequest.newBuilder(payload).setPageSize(pageSize).build(); + } + + @Override + public Integer extractPageSize(PagedExpandRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(PagedExpandLegacyMappedResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable> extractResources( + PagedExpandLegacyMappedResponse payload) { + return payload.getAlphabetizedMap().entrySet(); + } + }; + + private static final PagedListDescriptor + LIST_LOCATIONS_PAGE_STR_DESC = + new PagedListDescriptor() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public ListLocationsRequest injectToken(ListLocationsRequest payload, String token) { + return ListLocationsRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public ListLocationsRequest injectPageSize(ListLocationsRequest payload, int pageSize) { + return ListLocationsRequest.newBuilder(payload).setPageSize(pageSize).build(); + } + + @Override + public Integer extractPageSize(ListLocationsRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(ListLocationsResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources(ListLocationsResponse payload) { + return payload.getLocationsList(); + } + }; + + private static final PagedListResponseFactory< + PagedExpandRequest, PagedExpandResponse, PagedExpandPagedResponse> + PAGED_EXPAND_PAGE_STR_FACT = + new PagedListResponseFactory< + PagedExpandRequest, PagedExpandResponse, PagedExpandPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + PagedExpandRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext pageContext = + PageContext.create(callable, PAGED_EXPAND_PAGE_STR_DESC, request, context); + return PagedExpandPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + private static final PagedListResponseFactory< + PagedExpandRequest, PagedExpandLegacyMappedResponse, PagedExpandLegacyMappedPagedResponse> + PAGED_EXPAND_LEGACY_MAPPED_PAGE_STR_FACT = + new PagedListResponseFactory< + PagedExpandRequest, + PagedExpandLegacyMappedResponse, + PagedExpandLegacyMappedPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + PagedExpandRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext< + PagedExpandRequest, + PagedExpandLegacyMappedResponse, + Map.Entry> + pageContext = + PageContext.create( + callable, PAGED_EXPAND_LEGACY_MAPPED_PAGE_STR_DESC, request, context); + return PagedExpandLegacyMappedPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + private static final PagedListResponseFactory< + ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse> + LIST_LOCATIONS_PAGE_STR_FACT = + new PagedListResponseFactory< + ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListLocationsRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext pageContext = + PageContext.create(callable, LIST_LOCATIONS_PAGE_STR_DESC, request, context); + return ListLocationsPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + /** Returns the object with the settings used for calls to echo. */ + public UnaryCallSettings echoSettings() { + return echoSettings; + } + + /** Returns the object with the settings used for calls to echoErrorDetails. */ + public UnaryCallSettings + echoErrorDetailsSettings() { + return echoErrorDetailsSettings; + } + + /** Returns the object with the settings used for calls to failEchoWithDetails. */ + public UnaryCallSettings + failEchoWithDetailsSettings() { + return failEchoWithDetailsSettings; + } + + /** Returns the object with the settings used for calls to expand. */ + public ServerStreamingCallSettings expandSettings() { + return expandSettings; + } + + /** Returns the object with the settings used for calls to collect. */ + public StreamingCallSettings collectSettings() { + return collectSettings; + } + + /** Returns the object with the settings used for calls to chat. */ + public StreamingCallSettings chatSettings() { + return chatSettings; + } + + /** Returns the object with the settings used for calls to pagedExpand. */ + public PagedCallSettings + pagedExpandSettings() { + return pagedExpandSettings; + } + + /** Returns the object with the settings used for calls to pagedExpandLegacy. */ + public UnaryCallSettings + pagedExpandLegacySettings() { + return pagedExpandLegacySettings; + } + + /** Returns the object with the settings used for calls to pagedExpandLegacyMapped. */ + public PagedCallSettings< + PagedExpandRequest, PagedExpandLegacyMappedResponse, PagedExpandLegacyMappedPagedResponse> + pagedExpandLegacyMappedSettings() { + return pagedExpandLegacyMappedSettings; + } + + /** Returns the object with the settings used for calls to wait. */ + public UnaryCallSettings waitSettings() { + return waitSettings; + } + + /** Returns the object with the settings used for calls to wait. */ + public OperationCallSettings waitOperationSettings() { + return waitOperationSettings; + } + + /** Returns the object with the settings used for calls to block. */ + public UnaryCallSettings blockSettings() { + return blockSettings; + } + + /** Returns the object with the settings used for calls to listLocations. */ + public PagedCallSettings + listLocationsSettings() { + return listLocationsSettings; + } + + /** Returns the object with the settings used for calls to getLocation. */ + public UnaryCallSettings getLocationSettings() { + return getLocationSettings; + } + + /** Returns the object with the settings used for calls to setIamPolicy. */ + public UnaryCallSettings setIamPolicySettings() { + return setIamPolicySettings; + } + + /** Returns the object with the settings used for calls to getIamPolicy. */ + public UnaryCallSettings getIamPolicySettings() { + return getIamPolicySettings; + } + + /** Returns the object with the settings used for calls to testIamPermissions. */ + public UnaryCallSettings + testIamPermissionsSettings() { + return testIamPermissionsSettings; + } + + public EchoStub createStub() throws IOException { + if (getTransportChannelProvider() + .getTransportName() + .equals(GrpcTransportChannel.getGrpcTransportName())) { + return GrpcEchoStub.create(this); + } + if (getTransportChannelProvider() + .getTransportName() + .equals(HttpJsonTransportChannel.getHttpJsonTransportName())) { + return HttpJsonEchoStub.create(this); + } + throw new UnsupportedOperationException( + String.format( + "Transport not supported: %s", getTransportChannelProvider().getTransportName())); + } + + /** Returns a builder for the default ExecutorProvider for this service. */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return InstantiatingExecutorProvider.newBuilder(); + } + + /** Returns the default service endpoint. */ + @ObsoleteApi("Use getEndpoint() instead") + public static String getDefaultEndpoint() { + return "localhost:7469"; + } + + /** Returns the default mTLS service endpoint. */ + public static String getDefaultMtlsEndpoint() { + return "localhost:7469"; + } + + /** 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 gRPC ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return InstantiatingGrpcChannelProvider.newBuilder() + .setMaxInboundMessageSize(Integer.MAX_VALUE); + } + + /** Returns a builder for the default REST ChannelProvider for this service. */ + @BetaApi + public static InstantiatingHttpJsonChannelProvider.Builder + defaultHttpJsonTransportProviderBuilder() { + return InstantiatingHttpJsonChannelProvider.newBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return defaultGrpcTransportProviderBuilder().build(); + } + + public static ApiClientHeaderProvider.Builder defaultGrpcApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken("gapic", GaxProperties.getLibraryVersion(EchoStubSettings.class)) + .setTransportToken(GaxGrpcProperties.getGrpcTokenName(), GaxGrpcProperties.getGrpcVersion()) + .setApiVersionToken("v1_20240408"); + } + + public static ApiClientHeaderProvider.Builder defaultHttpJsonApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken("gapic", GaxProperties.getLibraryVersion(EchoStubSettings.class)) + .setTransportToken( + GaxHttpJsonProperties.getHttpJsonTokenName(), + GaxHttpJsonProperties.getHttpJsonVersion()) + .setApiVersionToken("v1_20240408"); + } + + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return EchoStubSettings.defaultGrpcApiClientHeaderProviderBuilder(); + } + + /** Returns a new gRPC builder for this class. */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** Returns a new REST builder for this class. */ + public static Builder newHttpJsonBuilder() { + return Builder.createHttpJsonDefault(); + } + + /** 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 EchoStubSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + + echoSettings = settingsBuilder.echoSettings().build(); + echoErrorDetailsSettings = settingsBuilder.echoErrorDetailsSettings().build(); + failEchoWithDetailsSettings = settingsBuilder.failEchoWithDetailsSettings().build(); + expandSettings = settingsBuilder.expandSettings().build(); + collectSettings = settingsBuilder.collectSettings().build(); + chatSettings = settingsBuilder.chatSettings().build(); + pagedExpandSettings = settingsBuilder.pagedExpandSettings().build(); + pagedExpandLegacySettings = settingsBuilder.pagedExpandLegacySettings().build(); + pagedExpandLegacyMappedSettings = settingsBuilder.pagedExpandLegacyMappedSettings().build(); + waitSettings = settingsBuilder.waitSettings().build(); + waitOperationSettings = settingsBuilder.waitOperationSettings().build(); + blockSettings = settingsBuilder.blockSettings().build(); + listLocationsSettings = settingsBuilder.listLocationsSettings().build(); + getLocationSettings = settingsBuilder.getLocationSettings().build(); + setIamPolicySettings = settingsBuilder.setIamPolicySettings().build(); + getIamPolicySettings = settingsBuilder.getIamPolicySettings().build(); + testIamPermissionsSettings = settingsBuilder.testIamPermissionsSettings().build(); + } + + @Override + protected LibraryMetadata getLibraryMetadata() { + return LibraryMetadata.newBuilder() + .setArtifactName("com.google.cloud:gapic-showcase") + .setRepository("googleapis/sdk-platform-java") + .setVersion(Version.VERSION) + .build(); + } + + /** Builder for EchoStubSettings. */ + public static class Builder extends StubSettings.Builder { + private final ImmutableList> unaryMethodSettingsBuilders; + private final UnaryCallSettings.Builder echoSettings; + private final UnaryCallSettings.Builder + echoErrorDetailsSettings; + private final UnaryCallSettings.Builder + failEchoWithDetailsSettings; + private final ServerStreamingCallSettings.Builder expandSettings; + private final StreamingCallSettings.Builder collectSettings; + private final StreamingCallSettings.Builder chatSettings; + private final PagedCallSettings.Builder< + PagedExpandRequest, PagedExpandResponse, PagedExpandPagedResponse> + pagedExpandSettings; + private final UnaryCallSettings.Builder + pagedExpandLegacySettings; + private final PagedCallSettings.Builder< + PagedExpandRequest, + PagedExpandLegacyMappedResponse, + PagedExpandLegacyMappedPagedResponse> + pagedExpandLegacyMappedSettings; + private final UnaryCallSettings.Builder waitSettings; + private final OperationCallSettings.Builder + waitOperationSettings; + private final UnaryCallSettings.Builder blockSettings; + private final PagedCallSettings.Builder< + ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse> + listLocationsSettings; + private final UnaryCallSettings.Builder getLocationSettings; + private final UnaryCallSettings.Builder setIamPolicySettings; + private final UnaryCallSettings.Builder getIamPolicySettings; + private final UnaryCallSettings.Builder + testIamPermissionsSettings; + 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.UNAVAILABLE, StatusCode.Code.UNKNOWN))); + 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(2.0) + .setMaxRetryDelayDuration(Duration.ofMillis(3000L)) + .setInitialRpcTimeoutDuration(Duration.ofMillis(10000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeoutDuration(Duration.ofMillis(10000L)) + .setTotalTimeoutDuration(Duration.ofMillis(10000L)) + .build(); + definitions.put("retry_policy_1_params", settings); + settings = + RetrySettings.newBuilder() + .setInitialRpcTimeoutDuration(Duration.ofMillis(5000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeoutDuration(Duration.ofMillis(5000L)) + .setTotalTimeoutDuration(Duration.ofMillis(5000L)) + .build(); + definitions.put("no_retry_0_params", settings); + RETRY_PARAM_DEFINITIONS = definitions.build(); + } + + protected Builder() { + this(((ClientContext) null)); + } + + protected Builder(ClientContext clientContext) { + super(clientContext); + + echoSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + echoErrorDetailsSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + failEchoWithDetailsSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + expandSettings = ServerStreamingCallSettings.newBuilder(); + collectSettings = StreamingCallSettings.newBuilder(); + chatSettings = StreamingCallSettings.newBuilder(); + pagedExpandSettings = PagedCallSettings.newBuilder(PAGED_EXPAND_PAGE_STR_FACT); + pagedExpandLegacySettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + pagedExpandLegacyMappedSettings = + PagedCallSettings.newBuilder(PAGED_EXPAND_LEGACY_MAPPED_PAGE_STR_FACT); + waitSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + waitOperationSettings = OperationCallSettings.newBuilder(); + blockSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + listLocationsSettings = PagedCallSettings.newBuilder(LIST_LOCATIONS_PAGE_STR_FACT); + getLocationSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + setIamPolicySettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + getIamPolicySettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + testIamPermissionsSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + echoSettings, + echoErrorDetailsSettings, + failEchoWithDetailsSettings, + pagedExpandSettings, + pagedExpandLegacySettings, + pagedExpandLegacyMappedSettings, + waitSettings, + blockSettings, + listLocationsSettings, + getLocationSettings, + setIamPolicySettings, + getIamPolicySettings, + testIamPermissionsSettings); + initDefaults(this); + } + + protected Builder(EchoStubSettings settings) { + super(settings); + + echoSettings = settings.echoSettings.toBuilder(); + echoErrorDetailsSettings = settings.echoErrorDetailsSettings.toBuilder(); + failEchoWithDetailsSettings = settings.failEchoWithDetailsSettings.toBuilder(); + expandSettings = settings.expandSettings.toBuilder(); + collectSettings = settings.collectSettings.toBuilder(); + chatSettings = settings.chatSettings.toBuilder(); + pagedExpandSettings = settings.pagedExpandSettings.toBuilder(); + pagedExpandLegacySettings = settings.pagedExpandLegacySettings.toBuilder(); + pagedExpandLegacyMappedSettings = settings.pagedExpandLegacyMappedSettings.toBuilder(); + waitSettings = settings.waitSettings.toBuilder(); + waitOperationSettings = settings.waitOperationSettings.toBuilder(); + blockSettings = settings.blockSettings.toBuilder(); + listLocationsSettings = settings.listLocationsSettings.toBuilder(); + getLocationSettings = settings.getLocationSettings.toBuilder(); + setIamPolicySettings = settings.setIamPolicySettings.toBuilder(); + getIamPolicySettings = settings.getIamPolicySettings.toBuilder(); + testIamPermissionsSettings = settings.testIamPermissionsSettings.toBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + echoSettings, + echoErrorDetailsSettings, + failEchoWithDetailsSettings, + pagedExpandSettings, + pagedExpandLegacySettings, + pagedExpandLegacyMappedSettings, + waitSettings, + blockSettings, + listLocationsSettings, + getLocationSettings, + setIamPolicySettings, + getIamPolicySettings, + testIamPermissionsSettings); + } + + 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 createHttpJsonDefault() { + Builder builder = new Builder(((ClientContext) null)); + + builder.setTransportChannelProvider(defaultHttpJsonTransportProviderBuilder().build()); + builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); + builder.setInternalHeaderProvider(defaultHttpJsonApiClientHeaderProviderBuilder().build()); + builder.setMtlsEndpoint(getDefaultMtlsEndpoint()); + builder.setSwitchToMtlsEndpointAllowed(true); + + return initDefaults(builder); + } + + private static Builder initDefaults(Builder builder) { + builder + .echoSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")); + + builder + .echoErrorDetailsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + + builder + .failEchoWithDetailsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + + builder + .expandSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")); + + builder + .pagedExpandSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")); + + builder + .pagedExpandLegacySettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + + builder + .pagedExpandLegacyMappedSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + + builder + .waitSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + + builder + .blockSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + + builder + .listLocationsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + + builder + .getLocationSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + + builder + .setIamPolicySettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + + builder + .getIamPolicySettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + + builder + .testIamPermissionsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + + builder + .waitOperationSettings() + .setInitialCallSettings( + UnaryCallSettings.newUnaryCallSettingsBuilder() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")) + .build()) + .setResponseTransformer( + ProtoOperationTransformers.ResponseTransformer.create(WaitResponse.class)) + .setMetadataTransformer( + ProtoOperationTransformers.MetadataTransformer.create(WaitMetadata.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 echo. */ + public UnaryCallSettings.Builder echoSettings() { + return echoSettings; + } + + /** Returns the builder for the settings used for calls to echoErrorDetails. */ + public UnaryCallSettings.Builder + echoErrorDetailsSettings() { + return echoErrorDetailsSettings; + } + + /** Returns the builder for the settings used for calls to failEchoWithDetails. */ + public UnaryCallSettings.Builder + failEchoWithDetailsSettings() { + return failEchoWithDetailsSettings; + } + + /** Returns the builder for the settings used for calls to expand. */ + public ServerStreamingCallSettings.Builder expandSettings() { + return expandSettings; + } + + /** Returns the builder for the settings used for calls to collect. */ + public StreamingCallSettings.Builder collectSettings() { + return collectSettings; + } + + /** Returns the builder for the settings used for calls to chat. */ + public StreamingCallSettings.Builder chatSettings() { + return chatSettings; + } + + /** Returns the builder for the settings used for calls to pagedExpand. */ + public PagedCallSettings.Builder< + PagedExpandRequest, PagedExpandResponse, PagedExpandPagedResponse> + pagedExpandSettings() { + return pagedExpandSettings; + } + + /** Returns the builder for the settings used for calls to pagedExpandLegacy. */ + public UnaryCallSettings.Builder + pagedExpandLegacySettings() { + return pagedExpandLegacySettings; + } + + /** Returns the builder for the settings used for calls to pagedExpandLegacyMapped. */ + public PagedCallSettings.Builder< + PagedExpandRequest, + PagedExpandLegacyMappedResponse, + PagedExpandLegacyMappedPagedResponse> + pagedExpandLegacyMappedSettings() { + return pagedExpandLegacyMappedSettings; + } + + /** Returns the builder for the settings used for calls to wait. */ + public UnaryCallSettings.Builder waitSettings() { + return waitSettings; + } + + /** Returns the builder for the settings used for calls to wait. */ + public OperationCallSettings.Builder + waitOperationSettings() { + return waitOperationSettings; + } + + /** Returns the builder for the settings used for calls to block. */ + public UnaryCallSettings.Builder blockSettings() { + return blockSettings; + } + + /** Returns the builder for the settings used for calls to listLocations. */ + public PagedCallSettings.Builder< + ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse> + listLocationsSettings() { + return listLocationsSettings; + } + + /** Returns the builder for the settings used for calls to getLocation. */ + public UnaryCallSettings.Builder getLocationSettings() { + return getLocationSettings; + } + + /** Returns the builder for the settings used for calls to setIamPolicy. */ + public UnaryCallSettings.Builder setIamPolicySettings() { + return setIamPolicySettings; + } + + /** Returns the builder for the settings used for calls to getIamPolicy. */ + public UnaryCallSettings.Builder getIamPolicySettings() { + return getIamPolicySettings; + } + + /** Returns the builder for the settings used for calls to testIamPermissions. */ + public UnaryCallSettings.Builder + testIamPermissionsSettings() { + return testIamPermissionsSettings; + } + + @Override + public EchoStubSettings build() throws IOException { + return new EchoStubSettings(this); + } + } +} diff --git a/java-showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/GrpcComplianceCallableFactory.java b/java-showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/GrpcComplianceCallableFactory.java new file mode 100644 index 0000000000..e61ad2900c --- /dev/null +++ b/java-showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/GrpcComplianceCallableFactory.java @@ -0,0 +1,115 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.stub; + +import com.google.api.core.BetaApi; +import com.google.api.gax.grpc.GrpcCallSettings; +import com.google.api.gax.grpc.GrpcCallableFactory; +import com.google.api.gax.grpc.GrpcStubCallableFactory; +import com.google.api.gax.rpc.BatchingCallSettings; +import com.google.api.gax.rpc.BidiStreamingCallable; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientStreamingCallable; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.api.gax.rpc.StreamingCallSettings; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.longrunning.Operation; +import com.google.longrunning.stub.OperationsStub; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * gRPC callable factory implementation for the Compliance service API. + * + *

        This class is for advanced usage. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class GrpcComplianceCallableFactory 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-showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/GrpcComplianceStub.java b/java-showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/GrpcComplianceStub.java new file mode 100644 index 0000000000..3949f8d8c9 --- /dev/null +++ b/java-showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/GrpcComplianceStub.java @@ -0,0 +1,583 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.stub; + +import static com.google.showcase.v1beta1.ComplianceClient.ListLocationsPagedResponse; + +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.grpc.GrpcCallSettings; +import com.google.api.gax.grpc.GrpcStubCallableFactory; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.RequestParamsBuilder; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.longrunning.stub.GrpcOperationsStub; +import com.google.showcase.v1beta1.EnumRequest; +import com.google.showcase.v1beta1.EnumResponse; +import com.google.showcase.v1beta1.RepeatRequest; +import com.google.showcase.v1beta1.RepeatResponse; +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 Compliance service API. + * + *

        This class is for advanced usage and reflects the underlying API directly. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class GrpcComplianceStub extends ComplianceStub { + private static final MethodDescriptor + repeatDataBodyMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.showcase.v1beta1.Compliance/RepeatDataBody") + .setRequestMarshaller(ProtoUtils.marshaller(RepeatRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(RepeatResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor + repeatDataBodyInfoMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.showcase.v1beta1.Compliance/RepeatDataBodyInfo") + .setRequestMarshaller(ProtoUtils.marshaller(RepeatRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(RepeatResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor + repeatDataQueryMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.showcase.v1beta1.Compliance/RepeatDataQuery") + .setRequestMarshaller(ProtoUtils.marshaller(RepeatRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(RepeatResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor + repeatDataSimplePathMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.showcase.v1beta1.Compliance/RepeatDataSimplePath") + .setRequestMarshaller(ProtoUtils.marshaller(RepeatRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(RepeatResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor + repeatDataPathResourceMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.showcase.v1beta1.Compliance/RepeatDataPathResource") + .setRequestMarshaller(ProtoUtils.marshaller(RepeatRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(RepeatResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor + repeatDataPathTrailingResourceMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.showcase.v1beta1.Compliance/RepeatDataPathTrailingResource") + .setRequestMarshaller(ProtoUtils.marshaller(RepeatRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(RepeatResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor + repeatDataBodyPutMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.showcase.v1beta1.Compliance/RepeatDataBodyPut") + .setRequestMarshaller(ProtoUtils.marshaller(RepeatRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(RepeatResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor + repeatDataBodyPatchMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.showcase.v1beta1.Compliance/RepeatDataBodyPatch") + .setRequestMarshaller(ProtoUtils.marshaller(RepeatRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(RepeatResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor getEnumMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.showcase.v1beta1.Compliance/GetEnum") + .setRequestMarshaller(ProtoUtils.marshaller(EnumRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(EnumResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor verifyEnumMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.showcase.v1beta1.Compliance/VerifyEnum") + .setRequestMarshaller(ProtoUtils.marshaller(EnumResponse.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(EnumResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor + listLocationsMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.location.Locations/ListLocations") + .setRequestMarshaller( + ProtoUtils.marshaller(ListLocationsRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(ListLocationsResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor getLocationMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.location.Locations/GetLocation") + .setRequestMarshaller(ProtoUtils.marshaller(GetLocationRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Location.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor setIamPolicyMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.iam.v1.IAMPolicy/SetIamPolicy") + .setRequestMarshaller(ProtoUtils.marshaller(SetIamPolicyRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Policy.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor getIamPolicyMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.iam.v1.IAMPolicy/GetIamPolicy") + .setRequestMarshaller(ProtoUtils.marshaller(GetIamPolicyRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Policy.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor + testIamPermissionsMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.iam.v1.IAMPolicy/TestIamPermissions") + .setRequestMarshaller( + ProtoUtils.marshaller(TestIamPermissionsRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(TestIamPermissionsResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private final UnaryCallable repeatDataBodyCallable; + private final UnaryCallable repeatDataBodyInfoCallable; + private final UnaryCallable repeatDataQueryCallable; + private final UnaryCallable repeatDataSimplePathCallable; + private final UnaryCallable repeatDataPathResourceCallable; + private final UnaryCallable repeatDataPathTrailingResourceCallable; + private final UnaryCallable repeatDataBodyPutCallable; + private final UnaryCallable repeatDataBodyPatchCallable; + private final UnaryCallable getEnumCallable; + private final UnaryCallable verifyEnumCallable; + private final UnaryCallable listLocationsCallable; + private final UnaryCallable + listLocationsPagedCallable; + private final UnaryCallable getLocationCallable; + private final UnaryCallable setIamPolicyCallable; + private final UnaryCallable getIamPolicyCallable; + private final UnaryCallable + testIamPermissionsCallable; + + private final BackgroundResource backgroundResources; + private final GrpcOperationsStub operationsStub; + private final GrpcStubCallableFactory callableFactory; + + public static final GrpcComplianceStub create(ComplianceStubSettings settings) + throws IOException { + return new GrpcComplianceStub(settings, ClientContext.create(settings)); + } + + public static final GrpcComplianceStub create(ClientContext clientContext) throws IOException { + return new GrpcComplianceStub(ComplianceStubSettings.newBuilder().build(), clientContext); + } + + public static final GrpcComplianceStub create( + ClientContext clientContext, GrpcStubCallableFactory callableFactory) throws IOException { + return new GrpcComplianceStub( + ComplianceStubSettings.newBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of GrpcComplianceStub, 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 GrpcComplianceStub(ComplianceStubSettings settings, ClientContext clientContext) + throws IOException { + this(settings, clientContext, new GrpcComplianceCallableFactory()); + } + + /** + * Constructs an instance of GrpcComplianceStub, 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 GrpcComplianceStub( + ComplianceStubSettings settings, + ClientContext clientContext, + GrpcStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + this.operationsStub = GrpcOperationsStub.create(clientContext, callableFactory); + + GrpcCallSettings repeatDataBodyTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(repeatDataBodyMethodDescriptor) + .build(); + GrpcCallSettings repeatDataBodyInfoTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(repeatDataBodyInfoMethodDescriptor) + .build(); + GrpcCallSettings repeatDataQueryTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(repeatDataQueryMethodDescriptor) + .build(); + GrpcCallSettings repeatDataSimplePathTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(repeatDataSimplePathMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("info.f_bool", String.valueOf(request.getInfo().getFBool())); + builder.add("info.f_double", String.valueOf(request.getInfo().getFDouble())); + builder.add("info.f_int32", String.valueOf(request.getInfo().getFInt32())); + builder.add( + "info.f_kingdom", String.valueOf(request.getInfo().getFKingdomValue())); + builder.add("info.f_string", String.valueOf(request.getInfo().getFString())); + return builder.build(); + }) + .build(); + GrpcCallSettings repeatDataPathResourceTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(repeatDataPathResourceMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("info.f_bool", String.valueOf(request.getInfo().getFBool())); + builder.add( + "info.f_child.f_string", + String.valueOf(request.getInfo().getFChild().getFString())); + builder.add("info.f_string", String.valueOf(request.getInfo().getFString())); + return builder.build(); + }) + .build(); + GrpcCallSettings + repeatDataPathTrailingResourceTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(repeatDataPathTrailingResourceMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add( + "info.f_child.f_string", + String.valueOf(request.getInfo().getFChild().getFString())); + builder.add("info.f_string", String.valueOf(request.getInfo().getFString())); + return builder.build(); + }) + .build(); + GrpcCallSettings repeatDataBodyPutTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(repeatDataBodyPutMethodDescriptor) + .build(); + GrpcCallSettings repeatDataBodyPatchTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(repeatDataBodyPatchMethodDescriptor) + .build(); + GrpcCallSettings getEnumTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getEnumMethodDescriptor) + .build(); + GrpcCallSettings verifyEnumTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(verifyEnumMethodDescriptor) + .build(); + GrpcCallSettings listLocationsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(listLocationsMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + GrpcCallSettings getLocationTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getLocationMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + GrpcCallSettings setIamPolicyTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(setIamPolicyMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("resource", String.valueOf(request.getResource())); + return builder.build(); + }) + .setResourceNameExtractor(request -> request.getResource()) + .build(); + GrpcCallSettings getIamPolicyTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getIamPolicyMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("resource", String.valueOf(request.getResource())); + return builder.build(); + }) + .setResourceNameExtractor(request -> request.getResource()) + .build(); + GrpcCallSettings + testIamPermissionsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(testIamPermissionsMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("resource", String.valueOf(request.getResource())); + return builder.build(); + }) + .setResourceNameExtractor(request -> request.getResource()) + .build(); + + this.repeatDataBodyCallable = + callableFactory.createUnaryCallable( + repeatDataBodyTransportSettings, settings.repeatDataBodySettings(), clientContext); + this.repeatDataBodyInfoCallable = + callableFactory.createUnaryCallable( + repeatDataBodyInfoTransportSettings, + settings.repeatDataBodyInfoSettings(), + clientContext); + this.repeatDataQueryCallable = + callableFactory.createUnaryCallable( + repeatDataQueryTransportSettings, settings.repeatDataQuerySettings(), clientContext); + this.repeatDataSimplePathCallable = + callableFactory.createUnaryCallable( + repeatDataSimplePathTransportSettings, + settings.repeatDataSimplePathSettings(), + clientContext); + this.repeatDataPathResourceCallable = + callableFactory.createUnaryCallable( + repeatDataPathResourceTransportSettings, + settings.repeatDataPathResourceSettings(), + clientContext); + this.repeatDataPathTrailingResourceCallable = + callableFactory.createUnaryCallable( + repeatDataPathTrailingResourceTransportSettings, + settings.repeatDataPathTrailingResourceSettings(), + clientContext); + this.repeatDataBodyPutCallable = + callableFactory.createUnaryCallable( + repeatDataBodyPutTransportSettings, + settings.repeatDataBodyPutSettings(), + clientContext); + this.repeatDataBodyPatchCallable = + callableFactory.createUnaryCallable( + repeatDataBodyPatchTransportSettings, + settings.repeatDataBodyPatchSettings(), + clientContext); + this.getEnumCallable = + callableFactory.createUnaryCallable( + getEnumTransportSettings, settings.getEnumSettings(), clientContext); + this.verifyEnumCallable = + callableFactory.createUnaryCallable( + verifyEnumTransportSettings, settings.verifyEnumSettings(), clientContext); + this.listLocationsCallable = + callableFactory.createUnaryCallable( + listLocationsTransportSettings, settings.listLocationsSettings(), clientContext); + this.listLocationsPagedCallable = + callableFactory.createPagedCallable( + listLocationsTransportSettings, settings.listLocationsSettings(), clientContext); + this.getLocationCallable = + callableFactory.createUnaryCallable( + getLocationTransportSettings, settings.getLocationSettings(), clientContext); + this.setIamPolicyCallable = + callableFactory.createUnaryCallable( + setIamPolicyTransportSettings, settings.setIamPolicySettings(), clientContext); + this.getIamPolicyCallable = + callableFactory.createUnaryCallable( + getIamPolicyTransportSettings, settings.getIamPolicySettings(), clientContext); + this.testIamPermissionsCallable = + callableFactory.createUnaryCallable( + testIamPermissionsTransportSettings, + settings.testIamPermissionsSettings(), + clientContext); + + this.backgroundResources = + new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + public GrpcOperationsStub getOperationsStub() { + return operationsStub; + } + + @Override + public UnaryCallable repeatDataBodyCallable() { + return repeatDataBodyCallable; + } + + @Override + public UnaryCallable repeatDataBodyInfoCallable() { + return repeatDataBodyInfoCallable; + } + + @Override + public UnaryCallable repeatDataQueryCallable() { + return repeatDataQueryCallable; + } + + @Override + public UnaryCallable repeatDataSimplePathCallable() { + return repeatDataSimplePathCallable; + } + + @Override + public UnaryCallable repeatDataPathResourceCallable() { + return repeatDataPathResourceCallable; + } + + @Override + public UnaryCallable repeatDataPathTrailingResourceCallable() { + return repeatDataPathTrailingResourceCallable; + } + + @Override + public UnaryCallable repeatDataBodyPutCallable() { + return repeatDataBodyPutCallable; + } + + @Override + public UnaryCallable repeatDataBodyPatchCallable() { + return repeatDataBodyPatchCallable; + } + + @Override + public UnaryCallable getEnumCallable() { + return getEnumCallable; + } + + @Override + public UnaryCallable verifyEnumCallable() { + return verifyEnumCallable; + } + + @Override + public UnaryCallable listLocationsCallable() { + return listLocationsCallable; + } + + @Override + public UnaryCallable + listLocationsPagedCallable() { + return listLocationsPagedCallable; + } + + @Override + public UnaryCallable getLocationCallable() { + return getLocationCallable; + } + + @Override + public UnaryCallable setIamPolicyCallable() { + return setIamPolicyCallable; + } + + @Override + public UnaryCallable getIamPolicyCallable() { + return getIamPolicyCallable; + } + + @Override + public UnaryCallable + testIamPermissionsCallable() { + return testIamPermissionsCallable; + } + + @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-showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/GrpcEchoCallableFactory.java b/java-showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/GrpcEchoCallableFactory.java new file mode 100644 index 0000000000..7c2726f06e --- /dev/null +++ b/java-showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/GrpcEchoCallableFactory.java @@ -0,0 +1,115 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.stub; + +import com.google.api.core.BetaApi; +import com.google.api.gax.grpc.GrpcCallSettings; +import com.google.api.gax.grpc.GrpcCallableFactory; +import com.google.api.gax.grpc.GrpcStubCallableFactory; +import com.google.api.gax.rpc.BatchingCallSettings; +import com.google.api.gax.rpc.BidiStreamingCallable; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientStreamingCallable; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.api.gax.rpc.StreamingCallSettings; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.longrunning.Operation; +import com.google.longrunning.stub.OperationsStub; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * gRPC callable factory implementation for the Echo service API. + * + *

        This class is for advanced usage. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class GrpcEchoCallableFactory 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-showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/GrpcEchoStub.java b/java-showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/GrpcEchoStub.java new file mode 100644 index 0000000000..c5dccbe245 --- /dev/null +++ b/java-showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/GrpcEchoStub.java @@ -0,0 +1,671 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.stub; + +import static com.google.showcase.v1beta1.EchoClient.ListLocationsPagedResponse; +import static com.google.showcase.v1beta1.EchoClient.PagedExpandLegacyMappedPagedResponse; +import static com.google.showcase.v1beta1.EchoClient.PagedExpandPagedResponse; + +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.grpc.GrpcCallSettings; +import com.google.api.gax.grpc.GrpcStubCallableFactory; +import com.google.api.gax.rpc.BidiStreamingCallable; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientStreamingCallable; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.RequestParamsBuilder; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.api.pathtemplate.PathTemplate; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.common.base.Strings; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.longrunning.Operation; +import com.google.longrunning.stub.GrpcOperationsStub; +import com.google.showcase.v1beta1.BlockRequest; +import com.google.showcase.v1beta1.BlockResponse; +import com.google.showcase.v1beta1.EchoErrorDetailsRequest; +import com.google.showcase.v1beta1.EchoErrorDetailsResponse; +import com.google.showcase.v1beta1.EchoRequest; +import com.google.showcase.v1beta1.EchoResponse; +import com.google.showcase.v1beta1.ExpandRequest; +import com.google.showcase.v1beta1.FailEchoWithDetailsRequest; +import com.google.showcase.v1beta1.FailEchoWithDetailsResponse; +import com.google.showcase.v1beta1.PagedExpandLegacyMappedResponse; +import com.google.showcase.v1beta1.PagedExpandLegacyRequest; +import com.google.showcase.v1beta1.PagedExpandRequest; +import com.google.showcase.v1beta1.PagedExpandResponse; +import com.google.showcase.v1beta1.WaitMetadata; +import com.google.showcase.v1beta1.WaitRequest; +import com.google.showcase.v1beta1.WaitResponse; +import io.grpc.MethodDescriptor; +import io.grpc.protobuf.ProtoUtils; +import java.io.IOException; +import java.util.UUID; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * gRPC stub implementation for the Echo service API. + * + *

        This class is for advanced usage and reflects the underlying API directly. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class GrpcEchoStub extends EchoStub { + private static final MethodDescriptor echoMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.showcase.v1beta1.Echo/Echo") + .setRequestMarshaller(ProtoUtils.marshaller(EchoRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(EchoResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor + echoErrorDetailsMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.showcase.v1beta1.Echo/EchoErrorDetails") + .setRequestMarshaller( + ProtoUtils.marshaller(EchoErrorDetailsRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(EchoErrorDetailsResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor + failEchoWithDetailsMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.showcase.v1beta1.Echo/FailEchoWithDetails") + .setRequestMarshaller( + ProtoUtils.marshaller(FailEchoWithDetailsRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(FailEchoWithDetailsResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor expandMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.SERVER_STREAMING) + .setFullMethodName("google.showcase.v1beta1.Echo/Expand") + .setRequestMarshaller(ProtoUtils.marshaller(ExpandRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(EchoResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor collectMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.CLIENT_STREAMING) + .setFullMethodName("google.showcase.v1beta1.Echo/Collect") + .setRequestMarshaller(ProtoUtils.marshaller(EchoRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(EchoResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor chatMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.BIDI_STREAMING) + .setFullMethodName("google.showcase.v1beta1.Echo/Chat") + .setRequestMarshaller(ProtoUtils.marshaller(EchoRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(EchoResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor + pagedExpandMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.showcase.v1beta1.Echo/PagedExpand") + .setRequestMarshaller(ProtoUtils.marshaller(PagedExpandRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(PagedExpandResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor + pagedExpandLegacyMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.showcase.v1beta1.Echo/PagedExpandLegacy") + .setRequestMarshaller( + ProtoUtils.marshaller(PagedExpandLegacyRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(PagedExpandResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor + pagedExpandLegacyMappedMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.showcase.v1beta1.Echo/PagedExpandLegacyMapped") + .setRequestMarshaller(ProtoUtils.marshaller(PagedExpandRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(PagedExpandLegacyMappedResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor waitMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.showcase.v1beta1.Echo/Wait") + .setRequestMarshaller(ProtoUtils.marshaller(WaitRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor blockMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.showcase.v1beta1.Echo/Block") + .setRequestMarshaller(ProtoUtils.marshaller(BlockRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(BlockResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor + listLocationsMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.location.Locations/ListLocations") + .setRequestMarshaller( + ProtoUtils.marshaller(ListLocationsRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(ListLocationsResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor getLocationMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.location.Locations/GetLocation") + .setRequestMarshaller(ProtoUtils.marshaller(GetLocationRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Location.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor setIamPolicyMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.iam.v1.IAMPolicy/SetIamPolicy") + .setRequestMarshaller(ProtoUtils.marshaller(SetIamPolicyRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Policy.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor getIamPolicyMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.iam.v1.IAMPolicy/GetIamPolicy") + .setRequestMarshaller(ProtoUtils.marshaller(GetIamPolicyRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Policy.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor + testIamPermissionsMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.iam.v1.IAMPolicy/TestIamPermissions") + .setRequestMarshaller( + ProtoUtils.marshaller(TestIamPermissionsRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(TestIamPermissionsResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private final UnaryCallable echoCallable; + private final UnaryCallable + echoErrorDetailsCallable; + private final UnaryCallable + failEchoWithDetailsCallable; + private final ServerStreamingCallable expandCallable; + private final ClientStreamingCallable collectCallable; + private final BidiStreamingCallable chatCallable; + private final UnaryCallable pagedExpandCallable; + private final UnaryCallable + pagedExpandPagedCallable; + private final UnaryCallable + pagedExpandLegacyCallable; + private final UnaryCallable + pagedExpandLegacyMappedCallable; + private final UnaryCallable + pagedExpandLegacyMappedPagedCallable; + private final UnaryCallable waitCallable; + private final OperationCallable waitOperationCallable; + private final UnaryCallable blockCallable; + private final UnaryCallable listLocationsCallable; + private final UnaryCallable + listLocationsPagedCallable; + private final UnaryCallable getLocationCallable; + private final UnaryCallable setIamPolicyCallable; + private final UnaryCallable getIamPolicyCallable; + private final UnaryCallable + testIamPermissionsCallable; + + private final BackgroundResource backgroundResources; + private final GrpcOperationsStub operationsStub; + private final GrpcStubCallableFactory callableFactory; + + private static final PathTemplate ECHO_0_PATH_TEMPLATE = PathTemplate.create("{header=**}"); + private static final PathTemplate ECHO_1_PATH_TEMPLATE = PathTemplate.create("{routing_id=**}"); + private static final PathTemplate ECHO_2_PATH_TEMPLATE = + PathTemplate.create("{table_name=regions/*/zones/*/**}"); + private static final PathTemplate ECHO_3_PATH_TEMPLATE = + PathTemplate.create("{super_id=projects/*}/**"); + private static final PathTemplate ECHO_4_PATH_TEMPLATE = + PathTemplate.create("{table_name=projects/*/instances/*/**}"); + private static final PathTemplate ECHO_5_PATH_TEMPLATE = + PathTemplate.create("projects/*/{instance_id=instances/*}/**"); + private static final PathTemplate ECHO_6_PATH_TEMPLATE = PathTemplate.create("{baz=**}"); + private static final PathTemplate ECHO_7_PATH_TEMPLATE = + PathTemplate.create("{qux=projects/*}/**"); + + public static final GrpcEchoStub create(EchoStubSettings settings) throws IOException { + return new GrpcEchoStub(settings, ClientContext.create(settings)); + } + + public static final GrpcEchoStub create(ClientContext clientContext) throws IOException { + return new GrpcEchoStub(EchoStubSettings.newBuilder().build(), clientContext); + } + + public static final GrpcEchoStub create( + ClientContext clientContext, GrpcStubCallableFactory callableFactory) throws IOException { + return new GrpcEchoStub(EchoStubSettings.newBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of GrpcEchoStub, 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 GrpcEchoStub(EchoStubSettings settings, ClientContext clientContext) + throws IOException { + this(settings, clientContext, new GrpcEchoCallableFactory()); + } + + /** + * Constructs an instance of GrpcEchoStub, 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 GrpcEchoStub( + EchoStubSettings settings, + ClientContext clientContext, + GrpcStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + this.operationsStub = GrpcOperationsStub.create(clientContext, callableFactory); + + GrpcCallSettings echoTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(echoMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add(request.getHeader(), "header", ECHO_0_PATH_TEMPLATE); + builder.add(request.getHeader(), "routing_id", ECHO_1_PATH_TEMPLATE); + builder.add(request.getHeader(), "table_name", ECHO_2_PATH_TEMPLATE); + builder.add(request.getHeader(), "super_id", ECHO_3_PATH_TEMPLATE); + builder.add(request.getHeader(), "table_name", ECHO_4_PATH_TEMPLATE); + builder.add(request.getHeader(), "instance_id", ECHO_5_PATH_TEMPLATE); + builder.add(request.getOtherHeader(), "baz", ECHO_6_PATH_TEMPLATE); + builder.add(request.getOtherHeader(), "qux", ECHO_7_PATH_TEMPLATE); + return builder.build(); + }) + .setRequestMutator( + request -> { + EchoRequest.Builder requestBuilder = request.toBuilder(); + if (Strings.isNullOrEmpty(request.getRequestId())) { + requestBuilder.setRequestId(UUID.randomUUID().toString()); + } + if (Strings.isNullOrEmpty(request.getOtherRequestId())) { + requestBuilder.setOtherRequestId(UUID.randomUUID().toString()); + } + return requestBuilder.build(); + }) + .build(); + GrpcCallSettings + echoErrorDetailsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(echoErrorDetailsMethodDescriptor) + .build(); + GrpcCallSettings + failEchoWithDetailsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(failEchoWithDetailsMethodDescriptor) + .build(); + GrpcCallSettings expandTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(expandMethodDescriptor) + .build(); + GrpcCallSettings collectTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(collectMethodDescriptor) + .build(); + GrpcCallSettings chatTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(chatMethodDescriptor) + .build(); + GrpcCallSettings pagedExpandTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(pagedExpandMethodDescriptor) + .build(); + GrpcCallSettings + pagedExpandLegacyTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(pagedExpandLegacyMethodDescriptor) + .build(); + GrpcCallSettings + pagedExpandLegacyMappedTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(pagedExpandLegacyMappedMethodDescriptor) + .build(); + GrpcCallSettings waitTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(waitMethodDescriptor) + .build(); + GrpcCallSettings blockTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(blockMethodDescriptor) + .build(); + GrpcCallSettings listLocationsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(listLocationsMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + GrpcCallSettings getLocationTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getLocationMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + GrpcCallSettings setIamPolicyTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(setIamPolicyMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("resource", String.valueOf(request.getResource())); + return builder.build(); + }) + .setResourceNameExtractor(request -> request.getResource()) + .build(); + GrpcCallSettings getIamPolicyTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getIamPolicyMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("resource", String.valueOf(request.getResource())); + return builder.build(); + }) + .setResourceNameExtractor(request -> request.getResource()) + .build(); + GrpcCallSettings + testIamPermissionsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(testIamPermissionsMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("resource", String.valueOf(request.getResource())); + return builder.build(); + }) + .setResourceNameExtractor(request -> request.getResource()) + .build(); + + this.echoCallable = + callableFactory.createUnaryCallable( + echoTransportSettings, settings.echoSettings(), clientContext); + this.echoErrorDetailsCallable = + callableFactory.createUnaryCallable( + echoErrorDetailsTransportSettings, settings.echoErrorDetailsSettings(), clientContext); + this.failEchoWithDetailsCallable = + callableFactory.createUnaryCallable( + failEchoWithDetailsTransportSettings, + settings.failEchoWithDetailsSettings(), + clientContext); + this.expandCallable = + callableFactory.createServerStreamingCallable( + expandTransportSettings, settings.expandSettings(), clientContext); + this.collectCallable = + callableFactory.createClientStreamingCallable( + collectTransportSettings, settings.collectSettings(), clientContext); + this.chatCallable = + callableFactory.createBidiStreamingCallable( + chatTransportSettings, settings.chatSettings(), clientContext); + this.pagedExpandCallable = + callableFactory.createUnaryCallable( + pagedExpandTransportSettings, settings.pagedExpandSettings(), clientContext); + this.pagedExpandPagedCallable = + callableFactory.createPagedCallable( + pagedExpandTransportSettings, settings.pagedExpandSettings(), clientContext); + this.pagedExpandLegacyCallable = + callableFactory.createUnaryCallable( + pagedExpandLegacyTransportSettings, + settings.pagedExpandLegacySettings(), + clientContext); + this.pagedExpandLegacyMappedCallable = + callableFactory.createUnaryCallable( + pagedExpandLegacyMappedTransportSettings, + settings.pagedExpandLegacyMappedSettings(), + clientContext); + this.pagedExpandLegacyMappedPagedCallable = + callableFactory.createPagedCallable( + pagedExpandLegacyMappedTransportSettings, + settings.pagedExpandLegacyMappedSettings(), + clientContext); + this.waitCallable = + callableFactory.createUnaryCallable( + waitTransportSettings, settings.waitSettings(), clientContext); + this.waitOperationCallable = + callableFactory.createOperationCallable( + waitTransportSettings, settings.waitOperationSettings(), clientContext, operationsStub); + this.blockCallable = + callableFactory.createUnaryCallable( + blockTransportSettings, settings.blockSettings(), clientContext); + this.listLocationsCallable = + callableFactory.createUnaryCallable( + listLocationsTransportSettings, settings.listLocationsSettings(), clientContext); + this.listLocationsPagedCallable = + callableFactory.createPagedCallable( + listLocationsTransportSettings, settings.listLocationsSettings(), clientContext); + this.getLocationCallable = + callableFactory.createUnaryCallable( + getLocationTransportSettings, settings.getLocationSettings(), clientContext); + this.setIamPolicyCallable = + callableFactory.createUnaryCallable( + setIamPolicyTransportSettings, settings.setIamPolicySettings(), clientContext); + this.getIamPolicyCallable = + callableFactory.createUnaryCallable( + getIamPolicyTransportSettings, settings.getIamPolicySettings(), clientContext); + this.testIamPermissionsCallable = + callableFactory.createUnaryCallable( + testIamPermissionsTransportSettings, + settings.testIamPermissionsSettings(), + clientContext); + + this.backgroundResources = + new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + public GrpcOperationsStub getOperationsStub() { + return operationsStub; + } + + @Override + public UnaryCallable echoCallable() { + return echoCallable; + } + + @Override + public UnaryCallable + echoErrorDetailsCallable() { + return echoErrorDetailsCallable; + } + + @Override + public UnaryCallable + failEchoWithDetailsCallable() { + return failEchoWithDetailsCallable; + } + + @Override + public ServerStreamingCallable expandCallable() { + return expandCallable; + } + + @Override + public ClientStreamingCallable collectCallable() { + return collectCallable; + } + + @Override + public BidiStreamingCallable chatCallable() { + return chatCallable; + } + + @Override + public UnaryCallable pagedExpandCallable() { + return pagedExpandCallable; + } + + @Override + public UnaryCallable pagedExpandPagedCallable() { + return pagedExpandPagedCallable; + } + + @Override + public UnaryCallable pagedExpandLegacyCallable() { + return pagedExpandLegacyCallable; + } + + @Override + public UnaryCallable + pagedExpandLegacyMappedCallable() { + return pagedExpandLegacyMappedCallable; + } + + @Override + public UnaryCallable + pagedExpandLegacyMappedPagedCallable() { + return pagedExpandLegacyMappedPagedCallable; + } + + @Override + public UnaryCallable waitCallable() { + return waitCallable; + } + + @Override + public OperationCallable waitOperationCallable() { + return waitOperationCallable; + } + + @Override + public UnaryCallable blockCallable() { + return blockCallable; + } + + @Override + public UnaryCallable listLocationsCallable() { + return listLocationsCallable; + } + + @Override + public UnaryCallable + listLocationsPagedCallable() { + return listLocationsPagedCallable; + } + + @Override + public UnaryCallable getLocationCallable() { + return getLocationCallable; + } + + @Override + public UnaryCallable setIamPolicyCallable() { + return setIamPolicyCallable; + } + + @Override + public UnaryCallable getIamPolicyCallable() { + return getIamPolicyCallable; + } + + @Override + public UnaryCallable + testIamPermissionsCallable() { + return testIamPermissionsCallable; + } + + @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-showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/GrpcIdentityCallableFactory.java b/java-showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/GrpcIdentityCallableFactory.java new file mode 100644 index 0000000000..e59799ce9a --- /dev/null +++ b/java-showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/GrpcIdentityCallableFactory.java @@ -0,0 +1,115 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.stub; + +import com.google.api.core.BetaApi; +import com.google.api.gax.grpc.GrpcCallSettings; +import com.google.api.gax.grpc.GrpcCallableFactory; +import com.google.api.gax.grpc.GrpcStubCallableFactory; +import com.google.api.gax.rpc.BatchingCallSettings; +import com.google.api.gax.rpc.BidiStreamingCallable; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientStreamingCallable; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.api.gax.rpc.StreamingCallSettings; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.longrunning.Operation; +import com.google.longrunning.stub.OperationsStub; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * gRPC callable factory implementation for the Identity service API. + * + *

        This class is for advanced usage. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class GrpcIdentityCallableFactory 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-showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/GrpcIdentityStub.java b/java-showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/GrpcIdentityStub.java new file mode 100644 index 0000000000..666ce88c52 --- /dev/null +++ b/java-showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/GrpcIdentityStub.java @@ -0,0 +1,453 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.stub; + +import static com.google.showcase.v1beta1.IdentityClient.ListLocationsPagedResponse; +import static com.google.showcase.v1beta1.IdentityClient.ListUsersPagedResponse; + +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.grpc.GrpcCallSettings; +import com.google.api.gax.grpc.GrpcStubCallableFactory; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.RequestParamsBuilder; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.longrunning.stub.GrpcOperationsStub; +import com.google.protobuf.Empty; +import com.google.showcase.v1beta1.CreateUserRequest; +import com.google.showcase.v1beta1.DeleteUserRequest; +import com.google.showcase.v1beta1.GetUserRequest; +import com.google.showcase.v1beta1.ListUsersRequest; +import com.google.showcase.v1beta1.ListUsersResponse; +import com.google.showcase.v1beta1.UpdateUserRequest; +import com.google.showcase.v1beta1.User; +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 Identity service API. + * + *

        This class is for advanced usage and reflects the underlying API directly. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class GrpcIdentityStub extends IdentityStub { + private static final MethodDescriptor createUserMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.showcase.v1beta1.Identity/CreateUser") + .setRequestMarshaller(ProtoUtils.marshaller(CreateUserRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(User.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor getUserMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.showcase.v1beta1.Identity/GetUser") + .setRequestMarshaller(ProtoUtils.marshaller(GetUserRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(User.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor updateUserMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.showcase.v1beta1.Identity/UpdateUser") + .setRequestMarshaller(ProtoUtils.marshaller(UpdateUserRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(User.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor deleteUserMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.showcase.v1beta1.Identity/DeleteUser") + .setRequestMarshaller(ProtoUtils.marshaller(DeleteUserRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Empty.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor + listUsersMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.showcase.v1beta1.Identity/ListUsers") + .setRequestMarshaller(ProtoUtils.marshaller(ListUsersRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(ListUsersResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor + listLocationsMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.location.Locations/ListLocations") + .setRequestMarshaller( + ProtoUtils.marshaller(ListLocationsRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(ListLocationsResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor getLocationMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.location.Locations/GetLocation") + .setRequestMarshaller(ProtoUtils.marshaller(GetLocationRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Location.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor setIamPolicyMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.iam.v1.IAMPolicy/SetIamPolicy") + .setRequestMarshaller(ProtoUtils.marshaller(SetIamPolicyRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Policy.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor getIamPolicyMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.iam.v1.IAMPolicy/GetIamPolicy") + .setRequestMarshaller(ProtoUtils.marshaller(GetIamPolicyRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Policy.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor + testIamPermissionsMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.iam.v1.IAMPolicy/TestIamPermissions") + .setRequestMarshaller( + ProtoUtils.marshaller(TestIamPermissionsRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(TestIamPermissionsResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private final UnaryCallable createUserCallable; + private final UnaryCallable getUserCallable; + private final UnaryCallable updateUserCallable; + private final UnaryCallable deleteUserCallable; + private final UnaryCallable listUsersCallable; + private final UnaryCallable listUsersPagedCallable; + private final UnaryCallable listLocationsCallable; + private final UnaryCallable + listLocationsPagedCallable; + private final UnaryCallable getLocationCallable; + private final UnaryCallable setIamPolicyCallable; + private final UnaryCallable getIamPolicyCallable; + private final UnaryCallable + testIamPermissionsCallable; + + private final BackgroundResource backgroundResources; + private final GrpcOperationsStub operationsStub; + private final GrpcStubCallableFactory callableFactory; + + public static final GrpcIdentityStub create(IdentityStubSettings settings) throws IOException { + return new GrpcIdentityStub(settings, ClientContext.create(settings)); + } + + public static final GrpcIdentityStub create(ClientContext clientContext) throws IOException { + return new GrpcIdentityStub(IdentityStubSettings.newBuilder().build(), clientContext); + } + + public static final GrpcIdentityStub create( + ClientContext clientContext, GrpcStubCallableFactory callableFactory) throws IOException { + return new GrpcIdentityStub( + IdentityStubSettings.newBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of GrpcIdentityStub, 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 GrpcIdentityStub(IdentityStubSettings settings, ClientContext clientContext) + throws IOException { + this(settings, clientContext, new GrpcIdentityCallableFactory()); + } + + /** + * Constructs an instance of GrpcIdentityStub, 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 GrpcIdentityStub( + IdentityStubSettings settings, + ClientContext clientContext, + GrpcStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + this.operationsStub = GrpcOperationsStub.create(clientContext, callableFactory); + + GrpcCallSettings createUserTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(createUserMethodDescriptor) + .build(); + GrpcCallSettings getUserTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getUserMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .setResourceNameExtractor(request -> request.getName()) + .build(); + GrpcCallSettings updateUserTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(updateUserMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("user.name", String.valueOf(request.getUser().getName())); + return builder.build(); + }) + .build(); + GrpcCallSettings deleteUserTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(deleteUserMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .setResourceNameExtractor(request -> request.getName()) + .build(); + GrpcCallSettings listUsersTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(listUsersMethodDescriptor) + .build(); + GrpcCallSettings listLocationsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(listLocationsMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + GrpcCallSettings getLocationTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getLocationMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + GrpcCallSettings setIamPolicyTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(setIamPolicyMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("resource", String.valueOf(request.getResource())); + return builder.build(); + }) + .setResourceNameExtractor(request -> request.getResource()) + .build(); + GrpcCallSettings getIamPolicyTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getIamPolicyMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("resource", String.valueOf(request.getResource())); + return builder.build(); + }) + .setResourceNameExtractor(request -> request.getResource()) + .build(); + GrpcCallSettings + testIamPermissionsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(testIamPermissionsMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("resource", String.valueOf(request.getResource())); + return builder.build(); + }) + .setResourceNameExtractor(request -> request.getResource()) + .build(); + + this.createUserCallable = + callableFactory.createUnaryCallable( + createUserTransportSettings, settings.createUserSettings(), clientContext); + this.getUserCallable = + callableFactory.createUnaryCallable( + getUserTransportSettings, settings.getUserSettings(), clientContext); + this.updateUserCallable = + callableFactory.createUnaryCallable( + updateUserTransportSettings, settings.updateUserSettings(), clientContext); + this.deleteUserCallable = + callableFactory.createUnaryCallable( + deleteUserTransportSettings, settings.deleteUserSettings(), clientContext); + this.listUsersCallable = + callableFactory.createUnaryCallable( + listUsersTransportSettings, settings.listUsersSettings(), clientContext); + this.listUsersPagedCallable = + callableFactory.createPagedCallable( + listUsersTransportSettings, settings.listUsersSettings(), clientContext); + this.listLocationsCallable = + callableFactory.createUnaryCallable( + listLocationsTransportSettings, settings.listLocationsSettings(), clientContext); + this.listLocationsPagedCallable = + callableFactory.createPagedCallable( + listLocationsTransportSettings, settings.listLocationsSettings(), clientContext); + this.getLocationCallable = + callableFactory.createUnaryCallable( + getLocationTransportSettings, settings.getLocationSettings(), clientContext); + this.setIamPolicyCallable = + callableFactory.createUnaryCallable( + setIamPolicyTransportSettings, settings.setIamPolicySettings(), clientContext); + this.getIamPolicyCallable = + callableFactory.createUnaryCallable( + getIamPolicyTransportSettings, settings.getIamPolicySettings(), clientContext); + this.testIamPermissionsCallable = + callableFactory.createUnaryCallable( + testIamPermissionsTransportSettings, + settings.testIamPermissionsSettings(), + clientContext); + + this.backgroundResources = + new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + public GrpcOperationsStub getOperationsStub() { + return operationsStub; + } + + @Override + public UnaryCallable createUserCallable() { + return createUserCallable; + } + + @Override + public UnaryCallable getUserCallable() { + return getUserCallable; + } + + @Override + public UnaryCallable updateUserCallable() { + return updateUserCallable; + } + + @Override + public UnaryCallable deleteUserCallable() { + return deleteUserCallable; + } + + @Override + public UnaryCallable listUsersCallable() { + return listUsersCallable; + } + + @Override + public UnaryCallable listUsersPagedCallable() { + return listUsersPagedCallable; + } + + @Override + public UnaryCallable listLocationsCallable() { + return listLocationsCallable; + } + + @Override + public UnaryCallable + listLocationsPagedCallable() { + return listLocationsPagedCallable; + } + + @Override + public UnaryCallable getLocationCallable() { + return getLocationCallable; + } + + @Override + public UnaryCallable setIamPolicyCallable() { + return setIamPolicyCallable; + } + + @Override + public UnaryCallable getIamPolicyCallable() { + return getIamPolicyCallable; + } + + @Override + public UnaryCallable + testIamPermissionsCallable() { + return testIamPermissionsCallable; + } + + @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-showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/GrpcMessagingCallableFactory.java b/java-showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/GrpcMessagingCallableFactory.java new file mode 100644 index 0000000000..ceeab3d586 --- /dev/null +++ b/java-showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/GrpcMessagingCallableFactory.java @@ -0,0 +1,115 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.stub; + +import com.google.api.core.BetaApi; +import com.google.api.gax.grpc.GrpcCallSettings; +import com.google.api.gax.grpc.GrpcCallableFactory; +import com.google.api.gax.grpc.GrpcStubCallableFactory; +import com.google.api.gax.rpc.BatchingCallSettings; +import com.google.api.gax.rpc.BidiStreamingCallable; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientStreamingCallable; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.api.gax.rpc.StreamingCallSettings; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.longrunning.Operation; +import com.google.longrunning.stub.OperationsStub; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * gRPC callable factory implementation for the Messaging service API. + * + *

        This class is for advanced usage. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class GrpcMessagingCallableFactory 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-showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/GrpcMessagingStub.java b/java-showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/GrpcMessagingStub.java new file mode 100644 index 0000000000..4d343ab1e3 --- /dev/null +++ b/java-showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/GrpcMessagingStub.java @@ -0,0 +1,759 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.stub; + +import static com.google.showcase.v1beta1.MessagingClient.ListBlurbsPagedResponse; +import static com.google.showcase.v1beta1.MessagingClient.ListLocationsPagedResponse; +import static com.google.showcase.v1beta1.MessagingClient.ListRoomsPagedResponse; + +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.grpc.GrpcCallSettings; +import com.google.api.gax.grpc.GrpcStubCallableFactory; +import com.google.api.gax.rpc.BidiStreamingCallable; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientStreamingCallable; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.RequestParamsBuilder; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.longrunning.Operation; +import com.google.longrunning.stub.GrpcOperationsStub; +import com.google.protobuf.Empty; +import com.google.showcase.v1beta1.Blurb; +import com.google.showcase.v1beta1.ConnectRequest; +import com.google.showcase.v1beta1.CreateBlurbRequest; +import com.google.showcase.v1beta1.CreateRoomRequest; +import com.google.showcase.v1beta1.DeleteBlurbRequest; +import com.google.showcase.v1beta1.DeleteRoomRequest; +import com.google.showcase.v1beta1.GetBlurbRequest; +import com.google.showcase.v1beta1.GetRoomRequest; +import com.google.showcase.v1beta1.ListBlurbsRequest; +import com.google.showcase.v1beta1.ListBlurbsResponse; +import com.google.showcase.v1beta1.ListRoomsRequest; +import com.google.showcase.v1beta1.ListRoomsResponse; +import com.google.showcase.v1beta1.Room; +import com.google.showcase.v1beta1.SearchBlurbsMetadata; +import com.google.showcase.v1beta1.SearchBlurbsRequest; +import com.google.showcase.v1beta1.SearchBlurbsResponse; +import com.google.showcase.v1beta1.SendBlurbsResponse; +import com.google.showcase.v1beta1.StreamBlurbsRequest; +import com.google.showcase.v1beta1.StreamBlurbsResponse; +import com.google.showcase.v1beta1.UpdateBlurbRequest; +import com.google.showcase.v1beta1.UpdateRoomRequest; +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 Messaging service API. + * + *

        This class is for advanced usage and reflects the underlying API directly. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class GrpcMessagingStub extends MessagingStub { + private static final MethodDescriptor createRoomMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.showcase.v1beta1.Messaging/CreateRoom") + .setRequestMarshaller(ProtoUtils.marshaller(CreateRoomRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Room.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor getRoomMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.showcase.v1beta1.Messaging/GetRoom") + .setRequestMarshaller(ProtoUtils.marshaller(GetRoomRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Room.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor updateRoomMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.showcase.v1beta1.Messaging/UpdateRoom") + .setRequestMarshaller(ProtoUtils.marshaller(UpdateRoomRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Room.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor deleteRoomMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.showcase.v1beta1.Messaging/DeleteRoom") + .setRequestMarshaller(ProtoUtils.marshaller(DeleteRoomRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Empty.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor + listRoomsMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.showcase.v1beta1.Messaging/ListRooms") + .setRequestMarshaller(ProtoUtils.marshaller(ListRoomsRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(ListRoomsResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor createBlurbMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.showcase.v1beta1.Messaging/CreateBlurb") + .setRequestMarshaller(ProtoUtils.marshaller(CreateBlurbRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Blurb.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor getBlurbMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.showcase.v1beta1.Messaging/GetBlurb") + .setRequestMarshaller(ProtoUtils.marshaller(GetBlurbRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Blurb.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor updateBlurbMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.showcase.v1beta1.Messaging/UpdateBlurb") + .setRequestMarshaller(ProtoUtils.marshaller(UpdateBlurbRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Blurb.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor deleteBlurbMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.showcase.v1beta1.Messaging/DeleteBlurb") + .setRequestMarshaller(ProtoUtils.marshaller(DeleteBlurbRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Empty.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor + listBlurbsMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.showcase.v1beta1.Messaging/ListBlurbs") + .setRequestMarshaller(ProtoUtils.marshaller(ListBlurbsRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(ListBlurbsResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor + searchBlurbsMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.showcase.v1beta1.Messaging/SearchBlurbs") + .setRequestMarshaller(ProtoUtils.marshaller(SearchBlurbsRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor + streamBlurbsMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.SERVER_STREAMING) + .setFullMethodName("google.showcase.v1beta1.Messaging/StreamBlurbs") + .setRequestMarshaller(ProtoUtils.marshaller(StreamBlurbsRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(StreamBlurbsResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor + sendBlurbsMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.CLIENT_STREAMING) + .setFullMethodName("google.showcase.v1beta1.Messaging/SendBlurbs") + .setRequestMarshaller(ProtoUtils.marshaller(CreateBlurbRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(SendBlurbsResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor + connectMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.BIDI_STREAMING) + .setFullMethodName("google.showcase.v1beta1.Messaging/Connect") + .setRequestMarshaller(ProtoUtils.marshaller(ConnectRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(StreamBlurbsResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor + listLocationsMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.location.Locations/ListLocations") + .setRequestMarshaller( + ProtoUtils.marshaller(ListLocationsRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(ListLocationsResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor getLocationMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.location.Locations/GetLocation") + .setRequestMarshaller(ProtoUtils.marshaller(GetLocationRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Location.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor setIamPolicyMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.iam.v1.IAMPolicy/SetIamPolicy") + .setRequestMarshaller(ProtoUtils.marshaller(SetIamPolicyRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Policy.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor getIamPolicyMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.iam.v1.IAMPolicy/GetIamPolicy") + .setRequestMarshaller(ProtoUtils.marshaller(GetIamPolicyRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Policy.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor + testIamPermissionsMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.iam.v1.IAMPolicy/TestIamPermissions") + .setRequestMarshaller( + ProtoUtils.marshaller(TestIamPermissionsRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(TestIamPermissionsResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private final UnaryCallable createRoomCallable; + private final UnaryCallable getRoomCallable; + private final UnaryCallable updateRoomCallable; + private final UnaryCallable deleteRoomCallable; + private final UnaryCallable listRoomsCallable; + private final UnaryCallable listRoomsPagedCallable; + private final UnaryCallable createBlurbCallable; + private final UnaryCallable getBlurbCallable; + private final UnaryCallable updateBlurbCallable; + private final UnaryCallable deleteBlurbCallable; + private final UnaryCallable listBlurbsCallable; + private final UnaryCallable listBlurbsPagedCallable; + private final UnaryCallable searchBlurbsCallable; + private final OperationCallable + searchBlurbsOperationCallable; + private final ServerStreamingCallable + streamBlurbsCallable; + private final ClientStreamingCallable sendBlurbsCallable; + private final BidiStreamingCallable connectCallable; + private final UnaryCallable listLocationsCallable; + private final UnaryCallable + listLocationsPagedCallable; + private final UnaryCallable getLocationCallable; + private final UnaryCallable setIamPolicyCallable; + private final UnaryCallable getIamPolicyCallable; + private final UnaryCallable + testIamPermissionsCallable; + + private final BackgroundResource backgroundResources; + private final GrpcOperationsStub operationsStub; + private final GrpcStubCallableFactory callableFactory; + + public static final GrpcMessagingStub create(MessagingStubSettings settings) throws IOException { + return new GrpcMessagingStub(settings, ClientContext.create(settings)); + } + + public static final GrpcMessagingStub create(ClientContext clientContext) throws IOException { + return new GrpcMessagingStub(MessagingStubSettings.newBuilder().build(), clientContext); + } + + public static final GrpcMessagingStub create( + ClientContext clientContext, GrpcStubCallableFactory callableFactory) throws IOException { + return new GrpcMessagingStub( + MessagingStubSettings.newBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of GrpcMessagingStub, 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 GrpcMessagingStub(MessagingStubSettings settings, ClientContext clientContext) + throws IOException { + this(settings, clientContext, new GrpcMessagingCallableFactory()); + } + + /** + * Constructs an instance of GrpcMessagingStub, 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 GrpcMessagingStub( + MessagingStubSettings settings, + ClientContext clientContext, + GrpcStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + this.operationsStub = GrpcOperationsStub.create(clientContext, callableFactory); + + GrpcCallSettings createRoomTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(createRoomMethodDescriptor) + .build(); + GrpcCallSettings getRoomTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getRoomMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .setResourceNameExtractor(request -> request.getName()) + .build(); + GrpcCallSettings updateRoomTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(updateRoomMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("room.name", String.valueOf(request.getRoom().getName())); + return builder.build(); + }) + .build(); + GrpcCallSettings deleteRoomTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(deleteRoomMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .setResourceNameExtractor(request -> request.getName()) + .build(); + GrpcCallSettings listRoomsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(listRoomsMethodDescriptor) + .build(); + GrpcCallSettings createBlurbTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(createBlurbMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .setResourceNameExtractor(request -> request.getParent()) + .build(); + GrpcCallSettings getBlurbTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getBlurbMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .setResourceNameExtractor(request -> request.getName()) + .build(); + GrpcCallSettings updateBlurbTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(updateBlurbMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("blurb.name", String.valueOf(request.getBlurb().getName())); + return builder.build(); + }) + .build(); + GrpcCallSettings deleteBlurbTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(deleteBlurbMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .setResourceNameExtractor(request -> request.getName()) + .build(); + GrpcCallSettings listBlurbsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(listBlurbsMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .setResourceNameExtractor(request -> request.getParent()) + .build(); + GrpcCallSettings searchBlurbsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(searchBlurbsMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .setResourceNameExtractor(request -> request.getParent()) + .build(); + GrpcCallSettings streamBlurbsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(streamBlurbsMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .setResourceNameExtractor(request -> request.getName()) + .build(); + GrpcCallSettings sendBlurbsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(sendBlurbsMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .setResourceNameExtractor(request -> request.getParent()) + .build(); + GrpcCallSettings connectTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(connectMethodDescriptor) + .build(); + GrpcCallSettings listLocationsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(listLocationsMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + GrpcCallSettings getLocationTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getLocationMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + GrpcCallSettings setIamPolicyTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(setIamPolicyMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("resource", String.valueOf(request.getResource())); + return builder.build(); + }) + .setResourceNameExtractor(request -> request.getResource()) + .build(); + GrpcCallSettings getIamPolicyTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getIamPolicyMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("resource", String.valueOf(request.getResource())); + return builder.build(); + }) + .setResourceNameExtractor(request -> request.getResource()) + .build(); + GrpcCallSettings + testIamPermissionsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(testIamPermissionsMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("resource", String.valueOf(request.getResource())); + return builder.build(); + }) + .setResourceNameExtractor(request -> request.getResource()) + .build(); + + this.createRoomCallable = + callableFactory.createUnaryCallable( + createRoomTransportSettings, settings.createRoomSettings(), clientContext); + this.getRoomCallable = + callableFactory.createUnaryCallable( + getRoomTransportSettings, settings.getRoomSettings(), clientContext); + this.updateRoomCallable = + callableFactory.createUnaryCallable( + updateRoomTransportSettings, settings.updateRoomSettings(), clientContext); + this.deleteRoomCallable = + callableFactory.createUnaryCallable( + deleteRoomTransportSettings, settings.deleteRoomSettings(), clientContext); + this.listRoomsCallable = + callableFactory.createUnaryCallable( + listRoomsTransportSettings, settings.listRoomsSettings(), clientContext); + this.listRoomsPagedCallable = + callableFactory.createPagedCallable( + listRoomsTransportSettings, settings.listRoomsSettings(), clientContext); + this.createBlurbCallable = + callableFactory.createUnaryCallable( + createBlurbTransportSettings, settings.createBlurbSettings(), clientContext); + this.getBlurbCallable = + callableFactory.createUnaryCallable( + getBlurbTransportSettings, settings.getBlurbSettings(), clientContext); + this.updateBlurbCallable = + callableFactory.createUnaryCallable( + updateBlurbTransportSettings, settings.updateBlurbSettings(), clientContext); + this.deleteBlurbCallable = + callableFactory.createUnaryCallable( + deleteBlurbTransportSettings, settings.deleteBlurbSettings(), clientContext); + this.listBlurbsCallable = + callableFactory.createUnaryCallable( + listBlurbsTransportSettings, settings.listBlurbsSettings(), clientContext); + this.listBlurbsPagedCallable = + callableFactory.createPagedCallable( + listBlurbsTransportSettings, settings.listBlurbsSettings(), clientContext); + this.searchBlurbsCallable = + callableFactory.createUnaryCallable( + searchBlurbsTransportSettings, settings.searchBlurbsSettings(), clientContext); + this.searchBlurbsOperationCallable = + callableFactory.createOperationCallable( + searchBlurbsTransportSettings, + settings.searchBlurbsOperationSettings(), + clientContext, + operationsStub); + this.streamBlurbsCallable = + callableFactory.createServerStreamingCallable( + streamBlurbsTransportSettings, settings.streamBlurbsSettings(), clientContext); + this.sendBlurbsCallable = + callableFactory.createClientStreamingCallable( + sendBlurbsTransportSettings, settings.sendBlurbsSettings(), clientContext); + this.connectCallable = + callableFactory.createBidiStreamingCallable( + connectTransportSettings, settings.connectSettings(), clientContext); + this.listLocationsCallable = + callableFactory.createUnaryCallable( + listLocationsTransportSettings, settings.listLocationsSettings(), clientContext); + this.listLocationsPagedCallable = + callableFactory.createPagedCallable( + listLocationsTransportSettings, settings.listLocationsSettings(), clientContext); + this.getLocationCallable = + callableFactory.createUnaryCallable( + getLocationTransportSettings, settings.getLocationSettings(), clientContext); + this.setIamPolicyCallable = + callableFactory.createUnaryCallable( + setIamPolicyTransportSettings, settings.setIamPolicySettings(), clientContext); + this.getIamPolicyCallable = + callableFactory.createUnaryCallable( + getIamPolicyTransportSettings, settings.getIamPolicySettings(), clientContext); + this.testIamPermissionsCallable = + callableFactory.createUnaryCallable( + testIamPermissionsTransportSettings, + settings.testIamPermissionsSettings(), + clientContext); + + this.backgroundResources = + new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + public GrpcOperationsStub getOperationsStub() { + return operationsStub; + } + + @Override + public UnaryCallable createRoomCallable() { + return createRoomCallable; + } + + @Override + public UnaryCallable getRoomCallable() { + return getRoomCallable; + } + + @Override + public UnaryCallable updateRoomCallable() { + return updateRoomCallable; + } + + @Override + public UnaryCallable deleteRoomCallable() { + return deleteRoomCallable; + } + + @Override + public UnaryCallable listRoomsCallable() { + return listRoomsCallable; + } + + @Override + public UnaryCallable listRoomsPagedCallable() { + return listRoomsPagedCallable; + } + + @Override + public UnaryCallable createBlurbCallable() { + return createBlurbCallable; + } + + @Override + public UnaryCallable getBlurbCallable() { + return getBlurbCallable; + } + + @Override + public UnaryCallable updateBlurbCallable() { + return updateBlurbCallable; + } + + @Override + public UnaryCallable deleteBlurbCallable() { + return deleteBlurbCallable; + } + + @Override + public UnaryCallable listBlurbsCallable() { + return listBlurbsCallable; + } + + @Override + public UnaryCallable listBlurbsPagedCallable() { + return listBlurbsPagedCallable; + } + + @Override + public UnaryCallable searchBlurbsCallable() { + return searchBlurbsCallable; + } + + @Override + public OperationCallable + searchBlurbsOperationCallable() { + return searchBlurbsOperationCallable; + } + + @Override + public ServerStreamingCallable streamBlurbsCallable() { + return streamBlurbsCallable; + } + + @Override + public ClientStreamingCallable sendBlurbsCallable() { + return sendBlurbsCallable; + } + + @Override + public BidiStreamingCallable connectCallable() { + return connectCallable; + } + + @Override + public UnaryCallable listLocationsCallable() { + return listLocationsCallable; + } + + @Override + public UnaryCallable + listLocationsPagedCallable() { + return listLocationsPagedCallable; + } + + @Override + public UnaryCallable getLocationCallable() { + return getLocationCallable; + } + + @Override + public UnaryCallable setIamPolicyCallable() { + return setIamPolicyCallable; + } + + @Override + public UnaryCallable getIamPolicyCallable() { + return getIamPolicyCallable; + } + + @Override + public UnaryCallable + testIamPermissionsCallable() { + return testIamPermissionsCallable; + } + + @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-showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/GrpcSequenceServiceCallableFactory.java b/java-showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/GrpcSequenceServiceCallableFactory.java new file mode 100644 index 0000000000..43291ed81f --- /dev/null +++ b/java-showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/GrpcSequenceServiceCallableFactory.java @@ -0,0 +1,115 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.stub; + +import com.google.api.core.BetaApi; +import com.google.api.gax.grpc.GrpcCallSettings; +import com.google.api.gax.grpc.GrpcCallableFactory; +import com.google.api.gax.grpc.GrpcStubCallableFactory; +import com.google.api.gax.rpc.BatchingCallSettings; +import com.google.api.gax.rpc.BidiStreamingCallable; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientStreamingCallable; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.api.gax.rpc.StreamingCallSettings; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.longrunning.Operation; +import com.google.longrunning.stub.OperationsStub; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * gRPC callable factory implementation for the SequenceService service API. + * + *

        This class is for advanced usage. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class GrpcSequenceServiceCallableFactory 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-showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/GrpcSequenceServiceStub.java b/java-showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/GrpcSequenceServiceStub.java new file mode 100644 index 0000000000..545208ea67 --- /dev/null +++ b/java-showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/GrpcSequenceServiceStub.java @@ -0,0 +1,519 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.stub; + +import static com.google.showcase.v1beta1.SequenceServiceClient.ListLocationsPagedResponse; + +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.grpc.GrpcCallSettings; +import com.google.api.gax.grpc.GrpcStubCallableFactory; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.RequestParamsBuilder; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.longrunning.stub.GrpcOperationsStub; +import com.google.protobuf.Empty; +import com.google.showcase.v1beta1.AttemptSequenceRequest; +import com.google.showcase.v1beta1.AttemptStreamingSequenceRequest; +import com.google.showcase.v1beta1.AttemptStreamingSequenceResponse; +import com.google.showcase.v1beta1.CreateSequenceRequest; +import com.google.showcase.v1beta1.CreateStreamingSequenceRequest; +import com.google.showcase.v1beta1.GetSequenceReportRequest; +import com.google.showcase.v1beta1.GetStreamingSequenceReportRequest; +import com.google.showcase.v1beta1.Sequence; +import com.google.showcase.v1beta1.SequenceReport; +import com.google.showcase.v1beta1.StreamingSequence; +import com.google.showcase.v1beta1.StreamingSequenceReport; +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 SequenceService service API. + * + *

        This class is for advanced usage and reflects the underlying API directly. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class GrpcSequenceServiceStub extends SequenceServiceStub { + private static final MethodDescriptor + createSequenceMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.showcase.v1beta1.SequenceService/CreateSequence") + .setRequestMarshaller( + ProtoUtils.marshaller(CreateSequenceRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Sequence.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor + createStreamingSequenceMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.showcase.v1beta1.SequenceService/CreateStreamingSequence") + .setRequestMarshaller( + ProtoUtils.marshaller(CreateStreamingSequenceRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(StreamingSequence.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor + getSequenceReportMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.showcase.v1beta1.SequenceService/GetSequenceReport") + .setRequestMarshaller( + ProtoUtils.marshaller(GetSequenceReportRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(SequenceReport.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor + getStreamingSequenceReportMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.showcase.v1beta1.SequenceService/GetStreamingSequenceReport") + .setRequestMarshaller( + ProtoUtils.marshaller(GetStreamingSequenceReportRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(StreamingSequenceReport.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor + attemptSequenceMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.showcase.v1beta1.SequenceService/AttemptSequence") + .setRequestMarshaller( + ProtoUtils.marshaller(AttemptSequenceRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Empty.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor< + AttemptStreamingSequenceRequest, AttemptStreamingSequenceResponse> + attemptStreamingSequenceMethodDescriptor = + MethodDescriptor + .newBuilder() + .setType(MethodDescriptor.MethodType.SERVER_STREAMING) + .setFullMethodName("google.showcase.v1beta1.SequenceService/AttemptStreamingSequence") + .setRequestMarshaller( + ProtoUtils.marshaller(AttemptStreamingSequenceRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(AttemptStreamingSequenceResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor + listLocationsMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.location.Locations/ListLocations") + .setRequestMarshaller( + ProtoUtils.marshaller(ListLocationsRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(ListLocationsResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor getLocationMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.location.Locations/GetLocation") + .setRequestMarshaller(ProtoUtils.marshaller(GetLocationRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Location.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor setIamPolicyMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.iam.v1.IAMPolicy/SetIamPolicy") + .setRequestMarshaller(ProtoUtils.marshaller(SetIamPolicyRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Policy.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor getIamPolicyMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.iam.v1.IAMPolicy/GetIamPolicy") + .setRequestMarshaller(ProtoUtils.marshaller(GetIamPolicyRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Policy.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor + testIamPermissionsMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.iam.v1.IAMPolicy/TestIamPermissions") + .setRequestMarshaller( + ProtoUtils.marshaller(TestIamPermissionsRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(TestIamPermissionsResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private final UnaryCallable createSequenceCallable; + private final UnaryCallable + createStreamingSequenceCallable; + private final UnaryCallable getSequenceReportCallable; + private final UnaryCallable + getStreamingSequenceReportCallable; + private final UnaryCallable attemptSequenceCallable; + private final ServerStreamingCallable< + AttemptStreamingSequenceRequest, AttemptStreamingSequenceResponse> + attemptStreamingSequenceCallable; + private final UnaryCallable listLocationsCallable; + private final UnaryCallable + listLocationsPagedCallable; + private final UnaryCallable getLocationCallable; + private final UnaryCallable setIamPolicyCallable; + private final UnaryCallable getIamPolicyCallable; + private final UnaryCallable + testIamPermissionsCallable; + + private final BackgroundResource backgroundResources; + private final GrpcOperationsStub operationsStub; + private final GrpcStubCallableFactory callableFactory; + + public static final GrpcSequenceServiceStub create(SequenceServiceStubSettings settings) + throws IOException { + return new GrpcSequenceServiceStub(settings, ClientContext.create(settings)); + } + + public static final GrpcSequenceServiceStub create(ClientContext clientContext) + throws IOException { + return new GrpcSequenceServiceStub( + SequenceServiceStubSettings.newBuilder().build(), clientContext); + } + + public static final GrpcSequenceServiceStub create( + ClientContext clientContext, GrpcStubCallableFactory callableFactory) throws IOException { + return new GrpcSequenceServiceStub( + SequenceServiceStubSettings.newBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of GrpcSequenceServiceStub, 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 GrpcSequenceServiceStub( + SequenceServiceStubSettings settings, ClientContext clientContext) throws IOException { + this(settings, clientContext, new GrpcSequenceServiceCallableFactory()); + } + + /** + * Constructs an instance of GrpcSequenceServiceStub, 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 GrpcSequenceServiceStub( + SequenceServiceStubSettings settings, + ClientContext clientContext, + GrpcStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + this.operationsStub = GrpcOperationsStub.create(clientContext, callableFactory); + + GrpcCallSettings createSequenceTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(createSequenceMethodDescriptor) + .build(); + GrpcCallSettings + createStreamingSequenceTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(createStreamingSequenceMethodDescriptor) + .build(); + GrpcCallSettings getSequenceReportTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getSequenceReportMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .setResourceNameExtractor(request -> request.getName()) + .build(); + GrpcCallSettings + getStreamingSequenceReportTransportSettings = + GrpcCallSettings + .newBuilder() + .setMethodDescriptor(getStreamingSequenceReportMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .setResourceNameExtractor(request -> request.getName()) + .build(); + GrpcCallSettings attemptSequenceTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(attemptSequenceMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .setResourceNameExtractor(request -> request.getName()) + .build(); + GrpcCallSettings + attemptStreamingSequenceTransportSettings = + GrpcCallSettings + .newBuilder() + .setMethodDescriptor(attemptStreamingSequenceMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .setResourceNameExtractor(request -> request.getName()) + .build(); + GrpcCallSettings listLocationsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(listLocationsMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + GrpcCallSettings getLocationTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getLocationMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + GrpcCallSettings setIamPolicyTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(setIamPolicyMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("resource", String.valueOf(request.getResource())); + return builder.build(); + }) + .setResourceNameExtractor(request -> request.getResource()) + .build(); + GrpcCallSettings getIamPolicyTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getIamPolicyMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("resource", String.valueOf(request.getResource())); + return builder.build(); + }) + .setResourceNameExtractor(request -> request.getResource()) + .build(); + GrpcCallSettings + testIamPermissionsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(testIamPermissionsMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("resource", String.valueOf(request.getResource())); + return builder.build(); + }) + .setResourceNameExtractor(request -> request.getResource()) + .build(); + + this.createSequenceCallable = + callableFactory.createUnaryCallable( + createSequenceTransportSettings, settings.createSequenceSettings(), clientContext); + this.createStreamingSequenceCallable = + callableFactory.createUnaryCallable( + createStreamingSequenceTransportSettings, + settings.createStreamingSequenceSettings(), + clientContext); + this.getSequenceReportCallable = + callableFactory.createUnaryCallable( + getSequenceReportTransportSettings, + settings.getSequenceReportSettings(), + clientContext); + this.getStreamingSequenceReportCallable = + callableFactory.createUnaryCallable( + getStreamingSequenceReportTransportSettings, + settings.getStreamingSequenceReportSettings(), + clientContext); + this.attemptSequenceCallable = + callableFactory.createUnaryCallable( + attemptSequenceTransportSettings, settings.attemptSequenceSettings(), clientContext); + this.attemptStreamingSequenceCallable = + callableFactory.createServerStreamingCallable( + attemptStreamingSequenceTransportSettings, + settings.attemptStreamingSequenceSettings(), + clientContext); + this.listLocationsCallable = + callableFactory.createUnaryCallable( + listLocationsTransportSettings, settings.listLocationsSettings(), clientContext); + this.listLocationsPagedCallable = + callableFactory.createPagedCallable( + listLocationsTransportSettings, settings.listLocationsSettings(), clientContext); + this.getLocationCallable = + callableFactory.createUnaryCallable( + getLocationTransportSettings, settings.getLocationSettings(), clientContext); + this.setIamPolicyCallable = + callableFactory.createUnaryCallable( + setIamPolicyTransportSettings, settings.setIamPolicySettings(), clientContext); + this.getIamPolicyCallable = + callableFactory.createUnaryCallable( + getIamPolicyTransportSettings, settings.getIamPolicySettings(), clientContext); + this.testIamPermissionsCallable = + callableFactory.createUnaryCallable( + testIamPermissionsTransportSettings, + settings.testIamPermissionsSettings(), + clientContext); + + this.backgroundResources = + new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + public GrpcOperationsStub getOperationsStub() { + return operationsStub; + } + + @Override + public UnaryCallable createSequenceCallable() { + return createSequenceCallable; + } + + @Override + public UnaryCallable + createStreamingSequenceCallable() { + return createStreamingSequenceCallable; + } + + @Override + public UnaryCallable getSequenceReportCallable() { + return getSequenceReportCallable; + } + + @Override + public UnaryCallable + getStreamingSequenceReportCallable() { + return getStreamingSequenceReportCallable; + } + + @Override + public UnaryCallable attemptSequenceCallable() { + return attemptSequenceCallable; + } + + @Override + public ServerStreamingCallable + attemptStreamingSequenceCallable() { + return attemptStreamingSequenceCallable; + } + + @Override + public UnaryCallable listLocationsCallable() { + return listLocationsCallable; + } + + @Override + public UnaryCallable + listLocationsPagedCallable() { + return listLocationsPagedCallable; + } + + @Override + public UnaryCallable getLocationCallable() { + return getLocationCallable; + } + + @Override + public UnaryCallable setIamPolicyCallable() { + return setIamPolicyCallable; + } + + @Override + public UnaryCallable getIamPolicyCallable() { + return getIamPolicyCallable; + } + + @Override + public UnaryCallable + testIamPermissionsCallable() { + return testIamPermissionsCallable; + } + + @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-showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/GrpcTestingCallableFactory.java b/java-showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/GrpcTestingCallableFactory.java new file mode 100644 index 0000000000..9b99f011af --- /dev/null +++ b/java-showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/GrpcTestingCallableFactory.java @@ -0,0 +1,115 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.stub; + +import com.google.api.core.BetaApi; +import com.google.api.gax.grpc.GrpcCallSettings; +import com.google.api.gax.grpc.GrpcCallableFactory; +import com.google.api.gax.grpc.GrpcStubCallableFactory; +import com.google.api.gax.rpc.BatchingCallSettings; +import com.google.api.gax.rpc.BidiStreamingCallable; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientStreamingCallable; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.api.gax.rpc.StreamingCallSettings; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.longrunning.Operation; +import com.google.longrunning.stub.OperationsStub; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * gRPC callable factory implementation for the Testing service API. + * + *

        This class is for advanced usage. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class GrpcTestingCallableFactory 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-showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/GrpcTestingStub.java b/java-showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/GrpcTestingStub.java new file mode 100644 index 0000000000..6ceaa01ce7 --- /dev/null +++ b/java-showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/GrpcTestingStub.java @@ -0,0 +1,566 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.stub; + +import static com.google.showcase.v1beta1.TestingClient.ListLocationsPagedResponse; +import static com.google.showcase.v1beta1.TestingClient.ListSessionsPagedResponse; +import static com.google.showcase.v1beta1.TestingClient.ListTestsPagedResponse; + +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.grpc.GrpcCallSettings; +import com.google.api.gax.grpc.GrpcStubCallableFactory; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.RequestParamsBuilder; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.longrunning.stub.GrpcOperationsStub; +import com.google.protobuf.Empty; +import com.google.showcase.v1beta1.CreateSessionRequest; +import com.google.showcase.v1beta1.DeleteSessionRequest; +import com.google.showcase.v1beta1.DeleteTestRequest; +import com.google.showcase.v1beta1.GetSessionRequest; +import com.google.showcase.v1beta1.ListSessionsRequest; +import com.google.showcase.v1beta1.ListSessionsResponse; +import com.google.showcase.v1beta1.ListTestsRequest; +import com.google.showcase.v1beta1.ListTestsResponse; +import com.google.showcase.v1beta1.ReportSessionRequest; +import com.google.showcase.v1beta1.ReportSessionResponse; +import com.google.showcase.v1beta1.Session; +import com.google.showcase.v1beta1.VerifyTestRequest; +import com.google.showcase.v1beta1.VerifyTestResponse; +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 Testing service API. + * + *

        This class is for advanced usage and reflects the underlying API directly. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class GrpcTestingStub extends TestingStub { + private static final MethodDescriptor + createSessionMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.showcase.v1beta1.Testing/CreateSession") + .setRequestMarshaller( + ProtoUtils.marshaller(CreateSessionRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Session.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor getSessionMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.showcase.v1beta1.Testing/GetSession") + .setRequestMarshaller(ProtoUtils.marshaller(GetSessionRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Session.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor + listSessionsMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.showcase.v1beta1.Testing/ListSessions") + .setRequestMarshaller(ProtoUtils.marshaller(ListSessionsRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(ListSessionsResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor deleteSessionMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.showcase.v1beta1.Testing/DeleteSession") + .setRequestMarshaller(ProtoUtils.marshaller(DeleteSessionRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Empty.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor + reportSessionMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.showcase.v1beta1.Testing/ReportSession") + .setRequestMarshaller( + ProtoUtils.marshaller(ReportSessionRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(ReportSessionResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor + listTestsMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.showcase.v1beta1.Testing/ListTests") + .setRequestMarshaller(ProtoUtils.marshaller(ListTestsRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(ListTestsResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor deleteTestMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.showcase.v1beta1.Testing/DeleteTest") + .setRequestMarshaller(ProtoUtils.marshaller(DeleteTestRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Empty.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor + verifyTestMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.showcase.v1beta1.Testing/VerifyTest") + .setRequestMarshaller(ProtoUtils.marshaller(VerifyTestRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(VerifyTestResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor + listLocationsMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.location.Locations/ListLocations") + .setRequestMarshaller( + ProtoUtils.marshaller(ListLocationsRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(ListLocationsResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor getLocationMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.location.Locations/GetLocation") + .setRequestMarshaller(ProtoUtils.marshaller(GetLocationRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Location.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor setIamPolicyMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.iam.v1.IAMPolicy/SetIamPolicy") + .setRequestMarshaller(ProtoUtils.marshaller(SetIamPolicyRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Policy.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor getIamPolicyMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.iam.v1.IAMPolicy/GetIamPolicy") + .setRequestMarshaller(ProtoUtils.marshaller(GetIamPolicyRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Policy.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor + testIamPermissionsMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.iam.v1.IAMPolicy/TestIamPermissions") + .setRequestMarshaller( + ProtoUtils.marshaller(TestIamPermissionsRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(TestIamPermissionsResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private final UnaryCallable createSessionCallable; + private final UnaryCallable getSessionCallable; + private final UnaryCallable listSessionsCallable; + private final UnaryCallable + listSessionsPagedCallable; + private final UnaryCallable deleteSessionCallable; + private final UnaryCallable reportSessionCallable; + private final UnaryCallable listTestsCallable; + private final UnaryCallable listTestsPagedCallable; + private final UnaryCallable deleteTestCallable; + private final UnaryCallable verifyTestCallable; + private final UnaryCallable listLocationsCallable; + private final UnaryCallable + listLocationsPagedCallable; + private final UnaryCallable getLocationCallable; + private final UnaryCallable setIamPolicyCallable; + private final UnaryCallable getIamPolicyCallable; + private final UnaryCallable + testIamPermissionsCallable; + + private final BackgroundResource backgroundResources; + private final GrpcOperationsStub operationsStub; + private final GrpcStubCallableFactory callableFactory; + + public static final GrpcTestingStub create(TestingStubSettings settings) throws IOException { + return new GrpcTestingStub(settings, ClientContext.create(settings)); + } + + public static final GrpcTestingStub create(ClientContext clientContext) throws IOException { + return new GrpcTestingStub(TestingStubSettings.newBuilder().build(), clientContext); + } + + public static final GrpcTestingStub create( + ClientContext clientContext, GrpcStubCallableFactory callableFactory) throws IOException { + return new GrpcTestingStub( + TestingStubSettings.newBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of GrpcTestingStub, 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 GrpcTestingStub(TestingStubSettings settings, ClientContext clientContext) + throws IOException { + this(settings, clientContext, new GrpcTestingCallableFactory()); + } + + /** + * Constructs an instance of GrpcTestingStub, 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 GrpcTestingStub( + TestingStubSettings settings, + ClientContext clientContext, + GrpcStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + this.operationsStub = GrpcOperationsStub.create(clientContext, callableFactory); + + GrpcCallSettings createSessionTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(createSessionMethodDescriptor) + .build(); + GrpcCallSettings getSessionTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getSessionMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .setResourceNameExtractor(request -> request.getName()) + .build(); + GrpcCallSettings listSessionsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(listSessionsMethodDescriptor) + .build(); + GrpcCallSettings deleteSessionTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(deleteSessionMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .setResourceNameExtractor(request -> request.getName()) + .build(); + GrpcCallSettings reportSessionTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(reportSessionMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .setResourceNameExtractor(request -> request.getName()) + .build(); + GrpcCallSettings listTestsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(listTestsMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .setResourceNameExtractor(request -> request.getParent()) + .build(); + GrpcCallSettings deleteTestTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(deleteTestMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .setResourceNameExtractor(request -> request.getName()) + .build(); + GrpcCallSettings verifyTestTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(verifyTestMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .setResourceNameExtractor(request -> request.getName()) + .build(); + GrpcCallSettings listLocationsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(listLocationsMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + GrpcCallSettings getLocationTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getLocationMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + GrpcCallSettings setIamPolicyTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(setIamPolicyMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("resource", String.valueOf(request.getResource())); + return builder.build(); + }) + .setResourceNameExtractor(request -> request.getResource()) + .build(); + GrpcCallSettings getIamPolicyTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getIamPolicyMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("resource", String.valueOf(request.getResource())); + return builder.build(); + }) + .setResourceNameExtractor(request -> request.getResource()) + .build(); + GrpcCallSettings + testIamPermissionsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(testIamPermissionsMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("resource", String.valueOf(request.getResource())); + return builder.build(); + }) + .setResourceNameExtractor(request -> request.getResource()) + .build(); + + this.createSessionCallable = + callableFactory.createUnaryCallable( + createSessionTransportSettings, settings.createSessionSettings(), clientContext); + this.getSessionCallable = + callableFactory.createUnaryCallable( + getSessionTransportSettings, settings.getSessionSettings(), clientContext); + this.listSessionsCallable = + callableFactory.createUnaryCallable( + listSessionsTransportSettings, settings.listSessionsSettings(), clientContext); + this.listSessionsPagedCallable = + callableFactory.createPagedCallable( + listSessionsTransportSettings, settings.listSessionsSettings(), clientContext); + this.deleteSessionCallable = + callableFactory.createUnaryCallable( + deleteSessionTransportSettings, settings.deleteSessionSettings(), clientContext); + this.reportSessionCallable = + callableFactory.createUnaryCallable( + reportSessionTransportSettings, settings.reportSessionSettings(), clientContext); + this.listTestsCallable = + callableFactory.createUnaryCallable( + listTestsTransportSettings, settings.listTestsSettings(), clientContext); + this.listTestsPagedCallable = + callableFactory.createPagedCallable( + listTestsTransportSettings, settings.listTestsSettings(), clientContext); + this.deleteTestCallable = + callableFactory.createUnaryCallable( + deleteTestTransportSettings, settings.deleteTestSettings(), clientContext); + this.verifyTestCallable = + callableFactory.createUnaryCallable( + verifyTestTransportSettings, settings.verifyTestSettings(), clientContext); + this.listLocationsCallable = + callableFactory.createUnaryCallable( + listLocationsTransportSettings, settings.listLocationsSettings(), clientContext); + this.listLocationsPagedCallable = + callableFactory.createPagedCallable( + listLocationsTransportSettings, settings.listLocationsSettings(), clientContext); + this.getLocationCallable = + callableFactory.createUnaryCallable( + getLocationTransportSettings, settings.getLocationSettings(), clientContext); + this.setIamPolicyCallable = + callableFactory.createUnaryCallable( + setIamPolicyTransportSettings, settings.setIamPolicySettings(), clientContext); + this.getIamPolicyCallable = + callableFactory.createUnaryCallable( + getIamPolicyTransportSettings, settings.getIamPolicySettings(), clientContext); + this.testIamPermissionsCallable = + callableFactory.createUnaryCallable( + testIamPermissionsTransportSettings, + settings.testIamPermissionsSettings(), + clientContext); + + this.backgroundResources = + new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + public GrpcOperationsStub getOperationsStub() { + return operationsStub; + } + + @Override + public UnaryCallable createSessionCallable() { + return createSessionCallable; + } + + @Override + public UnaryCallable getSessionCallable() { + return getSessionCallable; + } + + @Override + public UnaryCallable listSessionsCallable() { + return listSessionsCallable; + } + + @Override + public UnaryCallable listSessionsPagedCallable() { + return listSessionsPagedCallable; + } + + @Override + public UnaryCallable deleteSessionCallable() { + return deleteSessionCallable; + } + + @Override + public UnaryCallable reportSessionCallable() { + return reportSessionCallable; + } + + @Override + public UnaryCallable listTestsCallable() { + return listTestsCallable; + } + + @Override + public UnaryCallable listTestsPagedCallable() { + return listTestsPagedCallable; + } + + @Override + public UnaryCallable deleteTestCallable() { + return deleteTestCallable; + } + + @Override + public UnaryCallable verifyTestCallable() { + return verifyTestCallable; + } + + @Override + public UnaryCallable listLocationsCallable() { + return listLocationsCallable; + } + + @Override + public UnaryCallable + listLocationsPagedCallable() { + return listLocationsPagedCallable; + } + + @Override + public UnaryCallable getLocationCallable() { + return getLocationCallable; + } + + @Override + public UnaryCallable setIamPolicyCallable() { + return setIamPolicyCallable; + } + + @Override + public UnaryCallable getIamPolicyCallable() { + return getIamPolicyCallable; + } + + @Override + public UnaryCallable + testIamPermissionsCallable() { + return testIamPermissionsCallable; + } + + @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-showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/HttpJsonComplianceCallableFactory.java b/java-showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/HttpJsonComplianceCallableFactory.java new file mode 100644 index 0000000000..ea3d3be7bc --- /dev/null +++ b/java-showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/HttpJsonComplianceCallableFactory.java @@ -0,0 +1,103 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.stub; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.HttpJsonCallSettings; +import com.google.api.gax.httpjson.HttpJsonCallableFactory; +import com.google.api.gax.httpjson.HttpJsonOperationSnapshotCallable; +import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; +import com.google.api.gax.httpjson.longrunning.stub.OperationsStub; +import com.google.api.gax.rpc.BatchingCallSettings; +import com.google.api.gax.rpc.ClientContext; +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.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.longrunning.Operation; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * REST callable factory implementation for the Compliance service API. + * + *

        This class is for advanced usage. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class HttpJsonComplianceCallableFactory + implements HttpJsonStubCallableFactory { + + @Override + public UnaryCallable createUnaryCallable( + HttpJsonCallSettings httpJsonCallSettings, + UnaryCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createUnaryCallable( + httpJsonCallSettings, callSettings, clientContext); + } + + @Override + public + UnaryCallable createPagedCallable( + HttpJsonCallSettings httpJsonCallSettings, + PagedCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createPagedCallable( + httpJsonCallSettings, callSettings, clientContext); + } + + @Override + public UnaryCallable createBatchingCallable( + HttpJsonCallSettings httpJsonCallSettings, + BatchingCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createBatchingCallable( + httpJsonCallSettings, callSettings, clientContext); + } + + @Override + public + OperationCallable createOperationCallable( + HttpJsonCallSettings httpJsonCallSettings, + OperationCallSettings callSettings, + ClientContext clientContext, + OperationsStub operationsStub) { + UnaryCallable innerCallable = + HttpJsonCallableFactory.createBaseUnaryCallable( + httpJsonCallSettings, callSettings.getInitialCallSettings(), clientContext); + HttpJsonOperationSnapshotCallable initialCallable = + new HttpJsonOperationSnapshotCallable( + innerCallable, + httpJsonCallSettings.getMethodDescriptor().getOperationSnapshotFactory()); + return HttpJsonCallableFactory.createOperationCallable( + callSettings, clientContext, operationsStub.longRunningClient(), initialCallable); + } + + @Override + public + ServerStreamingCallable createServerStreamingCallable( + HttpJsonCallSettings httpJsonCallSettings, + ServerStreamingCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createServerStreamingCallable( + httpJsonCallSettings, callSettings, clientContext); + } +} diff --git a/java-showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/HttpJsonComplianceStub.java b/java-showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/HttpJsonComplianceStub.java new file mode 100644 index 0000000000..247f16c37d --- /dev/null +++ b/java-showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/HttpJsonComplianceStub.java @@ -0,0 +1,1112 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.stub; + +import static com.google.showcase.v1beta1.ComplianceClient.ListLocationsPagedResponse; + +import com.google.api.core.BetaApi; +import com.google.api.core.InternalApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.httpjson.ApiMethodDescriptor; +import com.google.api.gax.httpjson.HttpJsonCallSettings; +import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; +import com.google.api.gax.httpjson.ProtoMessageRequestFormatter; +import com.google.api.gax.httpjson.ProtoMessageResponseParser; +import com.google.api.gax.httpjson.ProtoRestSerializer; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.RequestParamsBuilder; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.protobuf.TypeRegistry; +import com.google.showcase.v1beta1.EnumRequest; +import com.google.showcase.v1beta1.EnumResponse; +import com.google.showcase.v1beta1.RepeatRequest; +import com.google.showcase.v1beta1.RepeatResponse; +import java.io.IOException; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * REST stub implementation for the Compliance service API. + * + *

        This class is for advanced usage and reflects the underlying API directly. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class HttpJsonComplianceStub extends ComplianceStub { + private static final TypeRegistry typeRegistry = TypeRegistry.newBuilder().build(); + + private static final ApiMethodDescriptor + repeatDataBodyMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.showcase.v1beta1.Compliance/RepeatDataBody") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/repeat:body", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("*", request.toBuilder().build(), false)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(RepeatResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + repeatDataBodyInfoMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.showcase.v1beta1.Compliance/RepeatDataBodyInfo") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/repeat:bodyinfo", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "fDouble", request.getFDouble()); + serializer.putQueryParam(fields, "fInt32", request.getFInt32()); + serializer.putQueryParam(fields, "fInt64", request.getFInt64()); + if (request.hasIntendedBindingUri()) { + serializer.putQueryParam( + fields, "intendedBindingUri", request.getIntendedBindingUri()); + } + serializer.putQueryParam(fields, "name", request.getName()); + if (request.hasPDouble()) { + serializer.putQueryParam(fields, "pDouble", request.getPDouble()); + } + if (request.hasPInt32()) { + serializer.putQueryParam(fields, "pInt32", request.getPInt32()); + } + if (request.hasPInt64()) { + serializer.putQueryParam(fields, "pInt64", request.getPInt64()); + } + serializer.putQueryParam( + fields, "serverVerify", request.getServerVerify()); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create().toBody("info", request.getInfo(), false)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(RepeatResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + repeatDataQueryMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.showcase.v1beta1.Compliance/RepeatDataQuery") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/repeat:query", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "fDouble", request.getFDouble()); + serializer.putQueryParam(fields, "fInt32", request.getFInt32()); + serializer.putQueryParam(fields, "fInt64", request.getFInt64()); + serializer.putQueryParam(fields, "info", request.getInfo()); + if (request.hasIntendedBindingUri()) { + serializer.putQueryParam( + fields, "intendedBindingUri", request.getIntendedBindingUri()); + } + serializer.putQueryParam(fields, "name", request.getName()); + if (request.hasPDouble()) { + serializer.putQueryParam(fields, "pDouble", request.getPDouble()); + } + if (request.hasPInt32()) { + serializer.putQueryParam(fields, "pInt32", request.getPInt32()); + } + if (request.hasPInt64()) { + serializer.putQueryParam(fields, "pInt64", request.getPInt64()); + } + serializer.putQueryParam( + fields, "serverVerify", request.getServerVerify()); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(RepeatResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + repeatDataSimplePathMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.showcase.v1beta1.Compliance/RepeatDataSimplePath") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/repeat/{info.fString}/{info.fInt32}/{info.fDouble}/{info.fBool}/{info.fKingdom}:simplepath", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam( + fields, "info.fBool", request.getInfo().getFBool()); + serializer.putPathParam( + fields, "info.fDouble", request.getInfo().getFDouble()); + serializer.putPathParam( + fields, "info.fInt32", request.getInfo().getFInt32()); + serializer.putPathParam( + fields, "info.fKingdom", request.getInfo().getFKingdomValue()); + serializer.putPathParam( + fields, "info.fString", request.getInfo().getFString()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "fDouble", request.getFDouble()); + serializer.putQueryParam(fields, "fInt32", request.getFInt32()); + serializer.putQueryParam(fields, "fInt64", request.getFInt64()); + serializer.putQueryParam(fields, "info", request.getInfo()); + if (request.hasIntendedBindingUri()) { + serializer.putQueryParam( + fields, "intendedBindingUri", request.getIntendedBindingUri()); + } + serializer.putQueryParam(fields, "name", request.getName()); + if (request.hasPDouble()) { + serializer.putQueryParam(fields, "pDouble", request.getPDouble()); + } + if (request.hasPInt32()) { + serializer.putQueryParam(fields, "pInt32", request.getPInt32()); + } + if (request.hasPInt64()) { + serializer.putQueryParam(fields, "pInt64", request.getPInt64()); + } + serializer.putQueryParam( + fields, "serverVerify", request.getServerVerify()); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(RepeatResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + repeatDataPathResourceMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.showcase.v1beta1.Compliance/RepeatDataPathResource") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/repeat/{info.fString=first/*}/{info.fChild.fString=second/*}/bool/{info.fBool}:pathresource", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam( + fields, "info.fBool", request.getInfo().getFBool()); + serializer.putPathParam( + fields, + "info.fChild.fString", + request.getInfo().getFChild().getFString()); + serializer.putPathParam( + fields, "info.fString", request.getInfo().getFString()); + return fields; + }) + .setAdditionalPaths( + "/v1beta1/repeat/{info.fChild.fString=first/*}/{info.fString=second/*}/bool/{info.fBool}:childfirstpathresource") + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "fDouble", request.getFDouble()); + serializer.putQueryParam(fields, "fInt32", request.getFInt32()); + serializer.putQueryParam(fields, "fInt64", request.getFInt64()); + serializer.putQueryParam(fields, "info", request.getInfo()); + if (request.hasIntendedBindingUri()) { + serializer.putQueryParam( + fields, "intendedBindingUri", request.getIntendedBindingUri()); + } + serializer.putQueryParam(fields, "name", request.getName()); + if (request.hasPDouble()) { + serializer.putQueryParam(fields, "pDouble", request.getPDouble()); + } + if (request.hasPInt32()) { + serializer.putQueryParam(fields, "pInt32", request.getPInt32()); + } + if (request.hasPInt64()) { + serializer.putQueryParam(fields, "pInt64", request.getPInt64()); + } + serializer.putQueryParam( + fields, "serverVerify", request.getServerVerify()); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(RepeatResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + repeatDataPathTrailingResourceMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName( + "google.showcase.v1beta1.Compliance/RepeatDataPathTrailingResource") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/repeat/{info.fString=first/*}/{info.fChild.fString=second/**}:pathtrailingresource", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam( + fields, + "info.fChild.fString", + request.getInfo().getFChild().getFString()); + serializer.putPathParam( + fields, "info.fString", request.getInfo().getFString()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "fDouble", request.getFDouble()); + serializer.putQueryParam(fields, "fInt32", request.getFInt32()); + serializer.putQueryParam(fields, "fInt64", request.getFInt64()); + serializer.putQueryParam(fields, "info", request.getInfo()); + if (request.hasIntendedBindingUri()) { + serializer.putQueryParam( + fields, "intendedBindingUri", request.getIntendedBindingUri()); + } + serializer.putQueryParam(fields, "name", request.getName()); + if (request.hasPDouble()) { + serializer.putQueryParam(fields, "pDouble", request.getPDouble()); + } + if (request.hasPInt32()) { + serializer.putQueryParam(fields, "pInt32", request.getPInt32()); + } + if (request.hasPInt64()) { + serializer.putQueryParam(fields, "pInt64", request.getPInt64()); + } + serializer.putQueryParam( + fields, "serverVerify", request.getServerVerify()); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(RepeatResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + repeatDataBodyPutMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.showcase.v1beta1.Compliance/RepeatDataBodyPut") + .setHttpMethod("PUT") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/repeat:bodyput", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("*", request.toBuilder().build(), false)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(RepeatResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + repeatDataBodyPatchMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.showcase.v1beta1.Compliance/RepeatDataBodyPatch") + .setHttpMethod("PATCH") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/repeat:bodypatch", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("*", request.toBuilder().build(), false)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(RepeatResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor getEnumMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.showcase.v1beta1.Compliance/GetEnum") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/compliance/enum", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = ProtoRestSerializer.create(); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "unknownEnum", request.getUnknownEnum()); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(EnumResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor verifyEnumMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.showcase.v1beta1.Compliance/VerifyEnum") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/compliance/enum", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = ProtoRestSerializer.create(); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "continent", request.getContinentValue()); + serializer.putQueryParam(fields, "request", request.getRequest()); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(EnumResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + listLocationsMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.location.Locations/ListLocations") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/{name=projects/*}/locations", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(ListLocationsResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + getLocationMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.location.Locations/GetLocation") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/{name=projects/*/locations/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Location.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + setIamPolicyMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.iam.v1.IAMPolicy/SetIamPolicy") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/{resource=users/*}:setIamPolicy", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "resource", request.getResource()); + return fields; + }) + .setAdditionalPaths( + "/v1beta1/{resource=rooms/*}:setIamPolicy", + "/v1beta1/{resource=rooms/*/blurbs/*}:setIamPolicy", + "/v1beta1/{resource=sequences/*}:setIamPolicy") + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("*", request.toBuilder().clearResource().build(), false)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Policy.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + getIamPolicyMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.iam.v1.IAMPolicy/GetIamPolicy") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/{resource=users/*}:getIamPolicy", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "resource", request.getResource()); + return fields; + }) + .setAdditionalPaths( + "/v1beta1/{resource=rooms/*}:getIamPolicy", + "/v1beta1/{resource=rooms/*/blurbs/*}:getIamPolicy", + "/v1beta1/{resource=sequences/*}:getIamPolicy") + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Policy.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + testIamPermissionsMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.iam.v1.IAMPolicy/TestIamPermissions") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/{resource=users/*}:testIamPermissions", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "resource", request.getResource()); + return fields; + }) + .setAdditionalPaths( + "/v1beta1/{resource=rooms/*}:testIamPermissions", + "/v1beta1/{resource=rooms/*/blurbs/*}:testIamPermissions", + "/v1beta1/{resource=sequences/*}:testIamPermissions") + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("*", request.toBuilder().clearResource().build(), false)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(TestIamPermissionsResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private final UnaryCallable repeatDataBodyCallable; + private final UnaryCallable repeatDataBodyInfoCallable; + private final UnaryCallable repeatDataQueryCallable; + private final UnaryCallable repeatDataSimplePathCallable; + private final UnaryCallable repeatDataPathResourceCallable; + private final UnaryCallable repeatDataPathTrailingResourceCallable; + private final UnaryCallable repeatDataBodyPutCallable; + private final UnaryCallable repeatDataBodyPatchCallable; + private final UnaryCallable getEnumCallable; + private final UnaryCallable verifyEnumCallable; + private final UnaryCallable listLocationsCallable; + private final UnaryCallable + listLocationsPagedCallable; + private final UnaryCallable getLocationCallable; + private final UnaryCallable setIamPolicyCallable; + private final UnaryCallable getIamPolicyCallable; + private final UnaryCallable + testIamPermissionsCallable; + + private final BackgroundResource backgroundResources; + private final HttpJsonStubCallableFactory callableFactory; + + public static final HttpJsonComplianceStub create(ComplianceStubSettings settings) + throws IOException { + return new HttpJsonComplianceStub(settings, ClientContext.create(settings)); + } + + public static final HttpJsonComplianceStub create(ClientContext clientContext) + throws IOException { + return new HttpJsonComplianceStub( + ComplianceStubSettings.newHttpJsonBuilder().build(), clientContext); + } + + public static final HttpJsonComplianceStub create( + ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { + return new HttpJsonComplianceStub( + ComplianceStubSettings.newHttpJsonBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of HttpJsonComplianceStub, 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 HttpJsonComplianceStub(ComplianceStubSettings settings, ClientContext clientContext) + throws IOException { + this(settings, clientContext, new HttpJsonComplianceCallableFactory()); + } + + /** + * Constructs an instance of HttpJsonComplianceStub, 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 HttpJsonComplianceStub( + ComplianceStubSettings settings, + ClientContext clientContext, + HttpJsonStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + + HttpJsonCallSettings repeatDataBodyTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(repeatDataBodyMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings repeatDataBodyInfoTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(repeatDataBodyInfoMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings repeatDataQueryTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(repeatDataQueryMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings repeatDataSimplePathTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(repeatDataSimplePathMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("info.f_bool", String.valueOf(request.getInfo().getFBool())); + builder.add("info.f_double", String.valueOf(request.getInfo().getFDouble())); + builder.add("info.f_int32", String.valueOf(request.getInfo().getFInt32())); + builder.add( + "info.f_kingdom", String.valueOf(request.getInfo().getFKingdomValue())); + builder.add("info.f_string", String.valueOf(request.getInfo().getFString())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings repeatDataPathResourceTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(repeatDataPathResourceMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("info.f_bool", String.valueOf(request.getInfo().getFBool())); + builder.add( + "info.f_child.f_string", + String.valueOf(request.getInfo().getFChild().getFString())); + builder.add("info.f_string", String.valueOf(request.getInfo().getFString())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings + repeatDataPathTrailingResourceTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(repeatDataPathTrailingResourceMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add( + "info.f_child.f_string", + String.valueOf(request.getInfo().getFChild().getFString())); + builder.add("info.f_string", String.valueOf(request.getInfo().getFString())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings repeatDataBodyPutTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(repeatDataBodyPutMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings repeatDataBodyPatchTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(repeatDataBodyPatchMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings getEnumTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getEnumMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings verifyEnumTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(verifyEnumMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings + listLocationsTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(listLocationsMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings getLocationTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getLocationMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings setIamPolicyTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(setIamPolicyMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("resource", String.valueOf(request.getResource())); + return builder.build(); + }) + .setResourceNameExtractor(request -> request.getResource()) + .build(); + HttpJsonCallSettings getIamPolicyTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getIamPolicyMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("resource", String.valueOf(request.getResource())); + return builder.build(); + }) + .setResourceNameExtractor(request -> request.getResource()) + .build(); + HttpJsonCallSettings + testIamPermissionsTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(testIamPermissionsMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("resource", String.valueOf(request.getResource())); + return builder.build(); + }) + .setResourceNameExtractor(request -> request.getResource()) + .build(); + + this.repeatDataBodyCallable = + callableFactory.createUnaryCallable( + repeatDataBodyTransportSettings, settings.repeatDataBodySettings(), clientContext); + this.repeatDataBodyInfoCallable = + callableFactory.createUnaryCallable( + repeatDataBodyInfoTransportSettings, + settings.repeatDataBodyInfoSettings(), + clientContext); + this.repeatDataQueryCallable = + callableFactory.createUnaryCallable( + repeatDataQueryTransportSettings, settings.repeatDataQuerySettings(), clientContext); + this.repeatDataSimplePathCallable = + callableFactory.createUnaryCallable( + repeatDataSimplePathTransportSettings, + settings.repeatDataSimplePathSettings(), + clientContext); + this.repeatDataPathResourceCallable = + callableFactory.createUnaryCallable( + repeatDataPathResourceTransportSettings, + settings.repeatDataPathResourceSettings(), + clientContext); + this.repeatDataPathTrailingResourceCallable = + callableFactory.createUnaryCallable( + repeatDataPathTrailingResourceTransportSettings, + settings.repeatDataPathTrailingResourceSettings(), + clientContext); + this.repeatDataBodyPutCallable = + callableFactory.createUnaryCallable( + repeatDataBodyPutTransportSettings, + settings.repeatDataBodyPutSettings(), + clientContext); + this.repeatDataBodyPatchCallable = + callableFactory.createUnaryCallable( + repeatDataBodyPatchTransportSettings, + settings.repeatDataBodyPatchSettings(), + clientContext); + this.getEnumCallable = + callableFactory.createUnaryCallable( + getEnumTransportSettings, settings.getEnumSettings(), clientContext); + this.verifyEnumCallable = + callableFactory.createUnaryCallable( + verifyEnumTransportSettings, settings.verifyEnumSettings(), clientContext); + this.listLocationsCallable = + callableFactory.createUnaryCallable( + listLocationsTransportSettings, settings.listLocationsSettings(), clientContext); + this.listLocationsPagedCallable = + callableFactory.createPagedCallable( + listLocationsTransportSettings, settings.listLocationsSettings(), clientContext); + this.getLocationCallable = + callableFactory.createUnaryCallable( + getLocationTransportSettings, settings.getLocationSettings(), clientContext); + this.setIamPolicyCallable = + callableFactory.createUnaryCallable( + setIamPolicyTransportSettings, settings.setIamPolicySettings(), clientContext); + this.getIamPolicyCallable = + callableFactory.createUnaryCallable( + getIamPolicyTransportSettings, settings.getIamPolicySettings(), clientContext); + this.testIamPermissionsCallable = + callableFactory.createUnaryCallable( + testIamPermissionsTransportSettings, + settings.testIamPermissionsSettings(), + clientContext); + + this.backgroundResources = + new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + @InternalApi + public static List getMethodDescriptors() { + List methodDescriptors = new ArrayList<>(); + methodDescriptors.add(repeatDataBodyMethodDescriptor); + methodDescriptors.add(repeatDataBodyInfoMethodDescriptor); + methodDescriptors.add(repeatDataQueryMethodDescriptor); + methodDescriptors.add(repeatDataSimplePathMethodDescriptor); + methodDescriptors.add(repeatDataPathResourceMethodDescriptor); + methodDescriptors.add(repeatDataPathTrailingResourceMethodDescriptor); + methodDescriptors.add(repeatDataBodyPutMethodDescriptor); + methodDescriptors.add(repeatDataBodyPatchMethodDescriptor); + methodDescriptors.add(getEnumMethodDescriptor); + methodDescriptors.add(verifyEnumMethodDescriptor); + methodDescriptors.add(listLocationsMethodDescriptor); + methodDescriptors.add(getLocationMethodDescriptor); + methodDescriptors.add(setIamPolicyMethodDescriptor); + methodDescriptors.add(getIamPolicyMethodDescriptor); + methodDescriptors.add(testIamPermissionsMethodDescriptor); + return methodDescriptors; + } + + @Override + public UnaryCallable repeatDataBodyCallable() { + return repeatDataBodyCallable; + } + + @Override + public UnaryCallable repeatDataBodyInfoCallable() { + return repeatDataBodyInfoCallable; + } + + @Override + public UnaryCallable repeatDataQueryCallable() { + return repeatDataQueryCallable; + } + + @Override + public UnaryCallable repeatDataSimplePathCallable() { + return repeatDataSimplePathCallable; + } + + @Override + public UnaryCallable repeatDataPathResourceCallable() { + return repeatDataPathResourceCallable; + } + + @Override + public UnaryCallable repeatDataPathTrailingResourceCallable() { + return repeatDataPathTrailingResourceCallable; + } + + @Override + public UnaryCallable repeatDataBodyPutCallable() { + return repeatDataBodyPutCallable; + } + + @Override + public UnaryCallable repeatDataBodyPatchCallable() { + return repeatDataBodyPatchCallable; + } + + @Override + public UnaryCallable getEnumCallable() { + return getEnumCallable; + } + + @Override + public UnaryCallable verifyEnumCallable() { + return verifyEnumCallable; + } + + @Override + public UnaryCallable listLocationsCallable() { + return listLocationsCallable; + } + + @Override + public UnaryCallable + listLocationsPagedCallable() { + return listLocationsPagedCallable; + } + + @Override + public UnaryCallable getLocationCallable() { + return getLocationCallable; + } + + @Override + public UnaryCallable setIamPolicyCallable() { + return setIamPolicyCallable; + } + + @Override + public UnaryCallable getIamPolicyCallable() { + return getIamPolicyCallable; + } + + @Override + public UnaryCallable + testIamPermissionsCallable() { + return testIamPermissionsCallable; + } + + @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-showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/HttpJsonEchoCallableFactory.java b/java-showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/HttpJsonEchoCallableFactory.java new file mode 100644 index 0000000000..70b68fc247 --- /dev/null +++ b/java-showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/HttpJsonEchoCallableFactory.java @@ -0,0 +1,103 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.stub; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.HttpJsonCallSettings; +import com.google.api.gax.httpjson.HttpJsonCallableFactory; +import com.google.api.gax.httpjson.HttpJsonOperationSnapshotCallable; +import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; +import com.google.api.gax.httpjson.longrunning.stub.OperationsStub; +import com.google.api.gax.rpc.BatchingCallSettings; +import com.google.api.gax.rpc.ClientContext; +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.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.longrunning.Operation; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * REST callable factory implementation for the Echo service API. + * + *

        This class is for advanced usage. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class HttpJsonEchoCallableFactory + implements HttpJsonStubCallableFactory { + + @Override + public UnaryCallable createUnaryCallable( + HttpJsonCallSettings httpJsonCallSettings, + UnaryCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createUnaryCallable( + httpJsonCallSettings, callSettings, clientContext); + } + + @Override + public + UnaryCallable createPagedCallable( + HttpJsonCallSettings httpJsonCallSettings, + PagedCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createPagedCallable( + httpJsonCallSettings, callSettings, clientContext); + } + + @Override + public UnaryCallable createBatchingCallable( + HttpJsonCallSettings httpJsonCallSettings, + BatchingCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createBatchingCallable( + httpJsonCallSettings, callSettings, clientContext); + } + + @Override + public + OperationCallable createOperationCallable( + HttpJsonCallSettings httpJsonCallSettings, + OperationCallSettings callSettings, + ClientContext clientContext, + OperationsStub operationsStub) { + UnaryCallable innerCallable = + HttpJsonCallableFactory.createBaseUnaryCallable( + httpJsonCallSettings, callSettings.getInitialCallSettings(), clientContext); + HttpJsonOperationSnapshotCallable initialCallable = + new HttpJsonOperationSnapshotCallable( + innerCallable, + httpJsonCallSettings.getMethodDescriptor().getOperationSnapshotFactory()); + return HttpJsonCallableFactory.createOperationCallable( + callSettings, clientContext, operationsStub.longRunningClient(), initialCallable); + } + + @Override + public + ServerStreamingCallable createServerStreamingCallable( + HttpJsonCallSettings httpJsonCallSettings, + ServerStreamingCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createServerStreamingCallable( + httpJsonCallSettings, callSettings, clientContext); + } +} diff --git a/java-showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/HttpJsonEchoStub.java b/java-showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/HttpJsonEchoStub.java new file mode 100644 index 0000000000..a0e5b55dac --- /dev/null +++ b/java-showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/HttpJsonEchoStub.java @@ -0,0 +1,1061 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.stub; + +import static com.google.showcase.v1beta1.EchoClient.ListLocationsPagedResponse; +import static com.google.showcase.v1beta1.EchoClient.PagedExpandLegacyMappedPagedResponse; +import static com.google.showcase.v1beta1.EchoClient.PagedExpandPagedResponse; + +import com.google.api.HttpRule; +import com.google.api.core.BetaApi; +import com.google.api.core.InternalApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.httpjson.ApiMethodDescriptor; +import com.google.api.gax.httpjson.HttpJsonCallSettings; +import com.google.api.gax.httpjson.HttpJsonOperationSnapshot; +import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; +import com.google.api.gax.httpjson.ProtoMessageRequestFormatter; +import com.google.api.gax.httpjson.ProtoMessageResponseParser; +import com.google.api.gax.httpjson.ProtoRestSerializer; +import com.google.api.gax.httpjson.longrunning.stub.HttpJsonOperationsStub; +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.OperationCallable; +import com.google.api.gax.rpc.RequestParamsBuilder; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.api.pathtemplate.PathTemplate; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.common.base.Strings; +import com.google.common.collect.ImmutableMap; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.longrunning.Operation; +import com.google.protobuf.TypeRegistry; +import com.google.showcase.v1beta1.BlockRequest; +import com.google.showcase.v1beta1.BlockResponse; +import com.google.showcase.v1beta1.EchoErrorDetailsRequest; +import com.google.showcase.v1beta1.EchoErrorDetailsResponse; +import com.google.showcase.v1beta1.EchoRequest; +import com.google.showcase.v1beta1.EchoResponse; +import com.google.showcase.v1beta1.ExpandRequest; +import com.google.showcase.v1beta1.FailEchoWithDetailsRequest; +import com.google.showcase.v1beta1.FailEchoWithDetailsResponse; +import com.google.showcase.v1beta1.PagedExpandLegacyMappedResponse; +import com.google.showcase.v1beta1.PagedExpandLegacyRequest; +import com.google.showcase.v1beta1.PagedExpandRequest; +import com.google.showcase.v1beta1.PagedExpandResponse; +import com.google.showcase.v1beta1.WaitMetadata; +import com.google.showcase.v1beta1.WaitRequest; +import com.google.showcase.v1beta1.WaitResponse; +import java.io.IOException; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.UUID; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * REST stub implementation for the Echo service API. + * + *

        This class is for advanced usage and reflects the underlying API directly. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class HttpJsonEchoStub extends EchoStub { + private static final TypeRegistry typeRegistry = + TypeRegistry.newBuilder() + .add(WaitResponse.getDescriptor()) + .add(WaitMetadata.getDescriptor()) + .build(); + + private static final ApiMethodDescriptor echoMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.showcase.v1beta1.Echo/Echo") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/echo:echo", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = ProtoRestSerializer.create(); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("*", request.toBuilder().build(), false)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(EchoResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + echoErrorDetailsMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.showcase.v1beta1.Echo/EchoErrorDetails") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/echo:error-details", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("*", request.toBuilder().build(), false)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(EchoErrorDetailsResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + failEchoWithDetailsMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.showcase.v1beta1.Echo/FailEchoWithDetails") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/echo:failWithDetails", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("*", request.toBuilder().build(), false)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(FailEchoWithDetailsResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor expandMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.showcase.v1beta1.Echo/Expand") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.SERVER_STREAMING) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/echo:expand", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("*", request.toBuilder().build(), false)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(EchoResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + pagedExpandMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.showcase.v1beta1.Echo/PagedExpand") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/echo:pagedExpand", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("*", request.toBuilder().build(), false)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(PagedExpandResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + pagedExpandLegacyMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.showcase.v1beta1.Echo/PagedExpandLegacy") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/echo:pagedExpandLegacy", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("*", request.toBuilder().build(), false)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(PagedExpandResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + pagedExpandLegacyMappedMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.showcase.v1beta1.Echo/PagedExpandLegacyMapped") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/echo:pagedExpandLegacyMapped", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("*", request.toBuilder().build(), false)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(PagedExpandLegacyMappedResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor waitMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.showcase.v1beta1.Echo/Wait") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/echo:wait", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = ProtoRestSerializer.create(); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("*", request.toBuilder().build(), false)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Operation.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .setOperationSnapshotFactory( + (WaitRequest request, Operation response) -> + HttpJsonOperationSnapshot.create(response)) + .build(); + + private static final ApiMethodDescriptor blockMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.showcase.v1beta1.Echo/Block") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/echo:block", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = ProtoRestSerializer.create(); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("*", request.toBuilder().build(), false)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(BlockResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + listLocationsMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.location.Locations/ListLocations") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/{name=projects/*}/locations", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(ListLocationsResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + getLocationMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.location.Locations/GetLocation") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/{name=projects/*/locations/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Location.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + setIamPolicyMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.iam.v1.IAMPolicy/SetIamPolicy") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/{resource=users/*}:setIamPolicy", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "resource", request.getResource()); + return fields; + }) + .setAdditionalPaths( + "/v1beta1/{resource=rooms/*}:setIamPolicy", + "/v1beta1/{resource=rooms/*/blurbs/*}:setIamPolicy", + "/v1beta1/{resource=sequences/*}:setIamPolicy") + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("*", request.toBuilder().clearResource().build(), false)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Policy.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + getIamPolicyMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.iam.v1.IAMPolicy/GetIamPolicy") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/{resource=users/*}:getIamPolicy", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "resource", request.getResource()); + return fields; + }) + .setAdditionalPaths( + "/v1beta1/{resource=rooms/*}:getIamPolicy", + "/v1beta1/{resource=rooms/*/blurbs/*}:getIamPolicy", + "/v1beta1/{resource=sequences/*}:getIamPolicy") + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Policy.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + testIamPermissionsMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.iam.v1.IAMPolicy/TestIamPermissions") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/{resource=users/*}:testIamPermissions", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "resource", request.getResource()); + return fields; + }) + .setAdditionalPaths( + "/v1beta1/{resource=rooms/*}:testIamPermissions", + "/v1beta1/{resource=rooms/*/blurbs/*}:testIamPermissions", + "/v1beta1/{resource=sequences/*}:testIamPermissions") + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("*", request.toBuilder().clearResource().build(), false)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(TestIamPermissionsResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private final UnaryCallable echoCallable; + private final UnaryCallable + echoErrorDetailsCallable; + private final UnaryCallable + failEchoWithDetailsCallable; + private final ServerStreamingCallable expandCallable; + private final UnaryCallable pagedExpandCallable; + private final UnaryCallable + pagedExpandPagedCallable; + private final UnaryCallable + pagedExpandLegacyCallable; + private final UnaryCallable + pagedExpandLegacyMappedCallable; + private final UnaryCallable + pagedExpandLegacyMappedPagedCallable; + private final UnaryCallable waitCallable; + private final OperationCallable waitOperationCallable; + private final UnaryCallable blockCallable; + private final UnaryCallable listLocationsCallable; + private final UnaryCallable + listLocationsPagedCallable; + private final UnaryCallable getLocationCallable; + private final UnaryCallable setIamPolicyCallable; + private final UnaryCallable getIamPolicyCallable; + private final UnaryCallable + testIamPermissionsCallable; + + private final BackgroundResource backgroundResources; + private final HttpJsonOperationsStub httpJsonOperationsStub; + private final HttpJsonStubCallableFactory callableFactory; + + private static final PathTemplate ECHO_0_PATH_TEMPLATE = PathTemplate.create("{header=**}"); + private static final PathTemplate ECHO_1_PATH_TEMPLATE = PathTemplate.create("{routing_id=**}"); + private static final PathTemplate ECHO_2_PATH_TEMPLATE = + PathTemplate.create("{table_name=regions/*/zones/*/**}"); + private static final PathTemplate ECHO_3_PATH_TEMPLATE = + PathTemplate.create("{super_id=projects/*}/**"); + private static final PathTemplate ECHO_4_PATH_TEMPLATE = + PathTemplate.create("{table_name=projects/*/instances/*/**}"); + private static final PathTemplate ECHO_5_PATH_TEMPLATE = + PathTemplate.create("projects/*/{instance_id=instances/*}/**"); + private static final PathTemplate ECHO_6_PATH_TEMPLATE = PathTemplate.create("{baz=**}"); + private static final PathTemplate ECHO_7_PATH_TEMPLATE = + PathTemplate.create("{qux=projects/*}/**"); + + public static final HttpJsonEchoStub create(EchoStubSettings settings) throws IOException { + return new HttpJsonEchoStub(settings, ClientContext.create(settings)); + } + + public static final HttpJsonEchoStub create(ClientContext clientContext) throws IOException { + return new HttpJsonEchoStub(EchoStubSettings.newHttpJsonBuilder().build(), clientContext); + } + + public static final HttpJsonEchoStub create( + ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { + return new HttpJsonEchoStub( + EchoStubSettings.newHttpJsonBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of HttpJsonEchoStub, 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 HttpJsonEchoStub(EchoStubSettings settings, ClientContext clientContext) + throws IOException { + this(settings, clientContext, new HttpJsonEchoCallableFactory()); + } + + /** + * Constructs an instance of HttpJsonEchoStub, 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 HttpJsonEchoStub( + EchoStubSettings settings, + ClientContext clientContext, + HttpJsonStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + this.httpJsonOperationsStub = + HttpJsonOperationsStub.create( + clientContext, + callableFactory, + typeRegistry, + ImmutableMap.builder() + .put( + "google.longrunning.Operations.CancelOperation", + HttpRule.newBuilder().setPost("/v1beta1/{name=operations/**}:cancel").build()) + .put( + "google.longrunning.Operations.DeleteOperation", + HttpRule.newBuilder().setDelete("/v1beta1/{name=operations/**}").build()) + .put( + "google.longrunning.Operations.GetOperation", + HttpRule.newBuilder().setGet("/v1beta1/{name=operations/**}").build()) + .put( + "google.longrunning.Operations.ListOperations", + HttpRule.newBuilder().setGet("/v1beta1/operations").build()) + .build()); + + HttpJsonCallSettings echoTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(echoMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add(request.getHeader(), "header", ECHO_0_PATH_TEMPLATE); + builder.add(request.getHeader(), "routing_id", ECHO_1_PATH_TEMPLATE); + builder.add(request.getHeader(), "table_name", ECHO_2_PATH_TEMPLATE); + builder.add(request.getHeader(), "super_id", ECHO_3_PATH_TEMPLATE); + builder.add(request.getHeader(), "table_name", ECHO_4_PATH_TEMPLATE); + builder.add(request.getHeader(), "instance_id", ECHO_5_PATH_TEMPLATE); + builder.add(request.getOtherHeader(), "baz", ECHO_6_PATH_TEMPLATE); + builder.add(request.getOtherHeader(), "qux", ECHO_7_PATH_TEMPLATE); + return builder.build(); + }) + .setRequestMutator( + request -> { + EchoRequest.Builder requestBuilder = request.toBuilder(); + if (Strings.isNullOrEmpty(request.getRequestId())) { + requestBuilder.setRequestId(UUID.randomUUID().toString()); + } + if (Strings.isNullOrEmpty(request.getOtherRequestId())) { + requestBuilder.setOtherRequestId(UUID.randomUUID().toString()); + } + return requestBuilder.build(); + }) + .build(); + HttpJsonCallSettings + echoErrorDetailsTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(echoErrorDetailsMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings + failEchoWithDetailsTransportSettings = + HttpJsonCallSettings + .newBuilder() + .setMethodDescriptor(failEchoWithDetailsMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings expandTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(expandMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings pagedExpandTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(pagedExpandMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings + pagedExpandLegacyTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(pagedExpandLegacyMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings + pagedExpandLegacyMappedTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(pagedExpandLegacyMappedMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings waitTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(waitMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings blockTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(blockMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings + listLocationsTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(listLocationsMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings getLocationTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getLocationMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings setIamPolicyTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(setIamPolicyMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("resource", String.valueOf(request.getResource())); + return builder.build(); + }) + .setResourceNameExtractor(request -> request.getResource()) + .build(); + HttpJsonCallSettings getIamPolicyTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getIamPolicyMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("resource", String.valueOf(request.getResource())); + return builder.build(); + }) + .setResourceNameExtractor(request -> request.getResource()) + .build(); + HttpJsonCallSettings + testIamPermissionsTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(testIamPermissionsMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("resource", String.valueOf(request.getResource())); + return builder.build(); + }) + .setResourceNameExtractor(request -> request.getResource()) + .build(); + + this.echoCallable = + callableFactory.createUnaryCallable( + echoTransportSettings, settings.echoSettings(), clientContext); + this.echoErrorDetailsCallable = + callableFactory.createUnaryCallable( + echoErrorDetailsTransportSettings, settings.echoErrorDetailsSettings(), clientContext); + this.failEchoWithDetailsCallable = + callableFactory.createUnaryCallable( + failEchoWithDetailsTransportSettings, + settings.failEchoWithDetailsSettings(), + clientContext); + this.expandCallable = + callableFactory.createServerStreamingCallable( + expandTransportSettings, settings.expandSettings(), clientContext); + this.pagedExpandCallable = + callableFactory.createUnaryCallable( + pagedExpandTransportSettings, settings.pagedExpandSettings(), clientContext); + this.pagedExpandPagedCallable = + callableFactory.createPagedCallable( + pagedExpandTransportSettings, settings.pagedExpandSettings(), clientContext); + this.pagedExpandLegacyCallable = + callableFactory.createUnaryCallable( + pagedExpandLegacyTransportSettings, + settings.pagedExpandLegacySettings(), + clientContext); + this.pagedExpandLegacyMappedCallable = + callableFactory.createUnaryCallable( + pagedExpandLegacyMappedTransportSettings, + settings.pagedExpandLegacyMappedSettings(), + clientContext); + this.pagedExpandLegacyMappedPagedCallable = + callableFactory.createPagedCallable( + pagedExpandLegacyMappedTransportSettings, + settings.pagedExpandLegacyMappedSettings(), + clientContext); + this.waitCallable = + callableFactory.createUnaryCallable( + waitTransportSettings, settings.waitSettings(), clientContext); + this.waitOperationCallable = + callableFactory.createOperationCallable( + waitTransportSettings, + settings.waitOperationSettings(), + clientContext, + httpJsonOperationsStub); + this.blockCallable = + callableFactory.createUnaryCallable( + blockTransportSettings, settings.blockSettings(), clientContext); + this.listLocationsCallable = + callableFactory.createUnaryCallable( + listLocationsTransportSettings, settings.listLocationsSettings(), clientContext); + this.listLocationsPagedCallable = + callableFactory.createPagedCallable( + listLocationsTransportSettings, settings.listLocationsSettings(), clientContext); + this.getLocationCallable = + callableFactory.createUnaryCallable( + getLocationTransportSettings, settings.getLocationSettings(), clientContext); + this.setIamPolicyCallable = + callableFactory.createUnaryCallable( + setIamPolicyTransportSettings, settings.setIamPolicySettings(), clientContext); + this.getIamPolicyCallable = + callableFactory.createUnaryCallable( + getIamPolicyTransportSettings, settings.getIamPolicySettings(), clientContext); + this.testIamPermissionsCallable = + callableFactory.createUnaryCallable( + testIamPermissionsTransportSettings, + settings.testIamPermissionsSettings(), + clientContext); + + this.backgroundResources = + new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + @InternalApi + public static List getMethodDescriptors() { + List methodDescriptors = new ArrayList<>(); + methodDescriptors.add(echoMethodDescriptor); + methodDescriptors.add(echoErrorDetailsMethodDescriptor); + methodDescriptors.add(failEchoWithDetailsMethodDescriptor); + methodDescriptors.add(expandMethodDescriptor); + methodDescriptors.add(pagedExpandMethodDescriptor); + methodDescriptors.add(pagedExpandLegacyMethodDescriptor); + methodDescriptors.add(pagedExpandLegacyMappedMethodDescriptor); + methodDescriptors.add(waitMethodDescriptor); + methodDescriptors.add(blockMethodDescriptor); + methodDescriptors.add(listLocationsMethodDescriptor); + methodDescriptors.add(getLocationMethodDescriptor); + methodDescriptors.add(setIamPolicyMethodDescriptor); + methodDescriptors.add(getIamPolicyMethodDescriptor); + methodDescriptors.add(testIamPermissionsMethodDescriptor); + return methodDescriptors; + } + + public HttpJsonOperationsStub getHttpJsonOperationsStub() { + return httpJsonOperationsStub; + } + + @Override + public UnaryCallable echoCallable() { + return echoCallable; + } + + @Override + public UnaryCallable + echoErrorDetailsCallable() { + return echoErrorDetailsCallable; + } + + @Override + public UnaryCallable + failEchoWithDetailsCallable() { + return failEchoWithDetailsCallable; + } + + @Override + public ServerStreamingCallable expandCallable() { + return expandCallable; + } + + @Override + public UnaryCallable pagedExpandCallable() { + return pagedExpandCallable; + } + + @Override + public UnaryCallable pagedExpandPagedCallable() { + return pagedExpandPagedCallable; + } + + @Override + public UnaryCallable pagedExpandLegacyCallable() { + return pagedExpandLegacyCallable; + } + + @Override + public UnaryCallable + pagedExpandLegacyMappedCallable() { + return pagedExpandLegacyMappedCallable; + } + + @Override + public UnaryCallable + pagedExpandLegacyMappedPagedCallable() { + return pagedExpandLegacyMappedPagedCallable; + } + + @Override + public UnaryCallable waitCallable() { + return waitCallable; + } + + @Override + public OperationCallable waitOperationCallable() { + return waitOperationCallable; + } + + @Override + public UnaryCallable blockCallable() { + return blockCallable; + } + + @Override + public UnaryCallable listLocationsCallable() { + return listLocationsCallable; + } + + @Override + public UnaryCallable + listLocationsPagedCallable() { + return listLocationsPagedCallable; + } + + @Override + public UnaryCallable getLocationCallable() { + return getLocationCallable; + } + + @Override + public UnaryCallable setIamPolicyCallable() { + return setIamPolicyCallable; + } + + @Override + public UnaryCallable getIamPolicyCallable() { + return getIamPolicyCallable; + } + + @Override + public UnaryCallable + testIamPermissionsCallable() { + return testIamPermissionsCallable; + } + + @Override + public ClientStreamingCallable collectCallable() { + throw new UnsupportedOperationException( + "Not implemented: collectCallable(). REST transport is not implemented for this method" + + " yet."); + } + + @Override + public BidiStreamingCallable chatCallable() { + throw new UnsupportedOperationException( + "Not implemented: chatCallable(). REST transport is not implemented for this method yet."); + } + + @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-showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/HttpJsonIdentityCallableFactory.java b/java-showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/HttpJsonIdentityCallableFactory.java new file mode 100644 index 0000000000..5ea4ee07aa --- /dev/null +++ b/java-showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/HttpJsonIdentityCallableFactory.java @@ -0,0 +1,103 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.stub; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.HttpJsonCallSettings; +import com.google.api.gax.httpjson.HttpJsonCallableFactory; +import com.google.api.gax.httpjson.HttpJsonOperationSnapshotCallable; +import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; +import com.google.api.gax.httpjson.longrunning.stub.OperationsStub; +import com.google.api.gax.rpc.BatchingCallSettings; +import com.google.api.gax.rpc.ClientContext; +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.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.longrunning.Operation; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * REST callable factory implementation for the Identity service API. + * + *

        This class is for advanced usage. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class HttpJsonIdentityCallableFactory + implements HttpJsonStubCallableFactory { + + @Override + public UnaryCallable createUnaryCallable( + HttpJsonCallSettings httpJsonCallSettings, + UnaryCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createUnaryCallable( + httpJsonCallSettings, callSettings, clientContext); + } + + @Override + public + UnaryCallable createPagedCallable( + HttpJsonCallSettings httpJsonCallSettings, + PagedCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createPagedCallable( + httpJsonCallSettings, callSettings, clientContext); + } + + @Override + public UnaryCallable createBatchingCallable( + HttpJsonCallSettings httpJsonCallSettings, + BatchingCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createBatchingCallable( + httpJsonCallSettings, callSettings, clientContext); + } + + @Override + public + OperationCallable createOperationCallable( + HttpJsonCallSettings httpJsonCallSettings, + OperationCallSettings callSettings, + ClientContext clientContext, + OperationsStub operationsStub) { + UnaryCallable innerCallable = + HttpJsonCallableFactory.createBaseUnaryCallable( + httpJsonCallSettings, callSettings.getInitialCallSettings(), clientContext); + HttpJsonOperationSnapshotCallable initialCallable = + new HttpJsonOperationSnapshotCallable( + innerCallable, + httpJsonCallSettings.getMethodDescriptor().getOperationSnapshotFactory()); + return HttpJsonCallableFactory.createOperationCallable( + callSettings, clientContext, operationsStub.longRunningClient(), initialCallable); + } + + @Override + public + ServerStreamingCallable createServerStreamingCallable( + HttpJsonCallSettings httpJsonCallSettings, + ServerStreamingCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createServerStreamingCallable( + httpJsonCallSettings, callSettings, clientContext); + } +} diff --git a/java-showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/HttpJsonIdentityStub.java b/java-showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/HttpJsonIdentityStub.java new file mode 100644 index 0000000000..c4c305e052 --- /dev/null +++ b/java-showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/HttpJsonIdentityStub.java @@ -0,0 +1,740 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.stub; + +import static com.google.showcase.v1beta1.IdentityClient.ListLocationsPagedResponse; +import static com.google.showcase.v1beta1.IdentityClient.ListUsersPagedResponse; + +import com.google.api.core.BetaApi; +import com.google.api.core.InternalApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.httpjson.ApiMethodDescriptor; +import com.google.api.gax.httpjson.HttpJsonCallSettings; +import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; +import com.google.api.gax.httpjson.ProtoMessageRequestFormatter; +import com.google.api.gax.httpjson.ProtoMessageResponseParser; +import com.google.api.gax.httpjson.ProtoRestSerializer; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.RequestParamsBuilder; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.protobuf.Empty; +import com.google.protobuf.TypeRegistry; +import com.google.showcase.v1beta1.CreateUserRequest; +import com.google.showcase.v1beta1.DeleteUserRequest; +import com.google.showcase.v1beta1.GetUserRequest; +import com.google.showcase.v1beta1.ListUsersRequest; +import com.google.showcase.v1beta1.ListUsersResponse; +import com.google.showcase.v1beta1.UpdateUserRequest; +import com.google.showcase.v1beta1.User; +import java.io.IOException; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * REST stub implementation for the Identity service API. + * + *

        This class is for advanced usage and reflects the underlying API directly. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class HttpJsonIdentityStub extends IdentityStub { + private static final TypeRegistry typeRegistry = TypeRegistry.newBuilder().build(); + + private static final ApiMethodDescriptor createUserMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.showcase.v1beta1.Identity/CreateUser") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/users", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("*", request.toBuilder().build(), false)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(User.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor getUserMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.showcase.v1beta1.Identity/GetUser") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/{name=users/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(User.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor updateUserMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.showcase.v1beta1.Identity/UpdateUser") + .setHttpMethod("PATCH") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/{user.name=users/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "user.name", request.getUser().getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "updateMask", request.getUpdateMask()); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create().toBody("user", request.getUser(), false)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(User.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor deleteUserMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.showcase.v1beta1.Identity/DeleteUser") + .setHttpMethod("DELETE") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/{name=users/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Empty.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + listUsersMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.showcase.v1beta1.Identity/ListUsers") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/users", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "pageSize", request.getPageSize()); + serializer.putQueryParam(fields, "pageToken", request.getPageToken()); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(ListUsersResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + listLocationsMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.location.Locations/ListLocations") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/{name=projects/*}/locations", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(ListLocationsResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + getLocationMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.location.Locations/GetLocation") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/{name=projects/*/locations/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Location.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + setIamPolicyMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.iam.v1.IAMPolicy/SetIamPolicy") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/{resource=users/*}:setIamPolicy", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "resource", request.getResource()); + return fields; + }) + .setAdditionalPaths( + "/v1beta1/{resource=rooms/*}:setIamPolicy", + "/v1beta1/{resource=rooms/*/blurbs/*}:setIamPolicy", + "/v1beta1/{resource=sequences/*}:setIamPolicy") + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("*", request.toBuilder().clearResource().build(), false)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Policy.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + getIamPolicyMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.iam.v1.IAMPolicy/GetIamPolicy") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/{resource=users/*}:getIamPolicy", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "resource", request.getResource()); + return fields; + }) + .setAdditionalPaths( + "/v1beta1/{resource=rooms/*}:getIamPolicy", + "/v1beta1/{resource=rooms/*/blurbs/*}:getIamPolicy", + "/v1beta1/{resource=sequences/*}:getIamPolicy") + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Policy.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + testIamPermissionsMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.iam.v1.IAMPolicy/TestIamPermissions") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/{resource=users/*}:testIamPermissions", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "resource", request.getResource()); + return fields; + }) + .setAdditionalPaths( + "/v1beta1/{resource=rooms/*}:testIamPermissions", + "/v1beta1/{resource=rooms/*/blurbs/*}:testIamPermissions", + "/v1beta1/{resource=sequences/*}:testIamPermissions") + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("*", request.toBuilder().clearResource().build(), false)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(TestIamPermissionsResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private final UnaryCallable createUserCallable; + private final UnaryCallable getUserCallable; + private final UnaryCallable updateUserCallable; + private final UnaryCallable deleteUserCallable; + private final UnaryCallable listUsersCallable; + private final UnaryCallable listUsersPagedCallable; + private final UnaryCallable listLocationsCallable; + private final UnaryCallable + listLocationsPagedCallable; + private final UnaryCallable getLocationCallable; + private final UnaryCallable setIamPolicyCallable; + private final UnaryCallable getIamPolicyCallable; + private final UnaryCallable + testIamPermissionsCallable; + + private final BackgroundResource backgroundResources; + private final HttpJsonStubCallableFactory callableFactory; + + public static final HttpJsonIdentityStub create(IdentityStubSettings settings) + throws IOException { + return new HttpJsonIdentityStub(settings, ClientContext.create(settings)); + } + + public static final HttpJsonIdentityStub create(ClientContext clientContext) throws IOException { + return new HttpJsonIdentityStub( + IdentityStubSettings.newHttpJsonBuilder().build(), clientContext); + } + + public static final HttpJsonIdentityStub create( + ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { + return new HttpJsonIdentityStub( + IdentityStubSettings.newHttpJsonBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of HttpJsonIdentityStub, 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 HttpJsonIdentityStub(IdentityStubSettings settings, ClientContext clientContext) + throws IOException { + this(settings, clientContext, new HttpJsonIdentityCallableFactory()); + } + + /** + * Constructs an instance of HttpJsonIdentityStub, 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 HttpJsonIdentityStub( + IdentityStubSettings settings, + ClientContext clientContext, + HttpJsonStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + + HttpJsonCallSettings createUserTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(createUserMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings getUserTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getUserMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .setResourceNameExtractor(request -> request.getName()) + .build(); + HttpJsonCallSettings updateUserTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(updateUserMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("user.name", String.valueOf(request.getUser().getName())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings deleteUserTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(deleteUserMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .setResourceNameExtractor(request -> request.getName()) + .build(); + HttpJsonCallSettings listUsersTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(listUsersMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings + listLocationsTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(listLocationsMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings getLocationTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getLocationMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings setIamPolicyTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(setIamPolicyMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("resource", String.valueOf(request.getResource())); + return builder.build(); + }) + .setResourceNameExtractor(request -> request.getResource()) + .build(); + HttpJsonCallSettings getIamPolicyTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getIamPolicyMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("resource", String.valueOf(request.getResource())); + return builder.build(); + }) + .setResourceNameExtractor(request -> request.getResource()) + .build(); + HttpJsonCallSettings + testIamPermissionsTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(testIamPermissionsMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("resource", String.valueOf(request.getResource())); + return builder.build(); + }) + .setResourceNameExtractor(request -> request.getResource()) + .build(); + + this.createUserCallable = + callableFactory.createUnaryCallable( + createUserTransportSettings, settings.createUserSettings(), clientContext); + this.getUserCallable = + callableFactory.createUnaryCallable( + getUserTransportSettings, settings.getUserSettings(), clientContext); + this.updateUserCallable = + callableFactory.createUnaryCallable( + updateUserTransportSettings, settings.updateUserSettings(), clientContext); + this.deleteUserCallable = + callableFactory.createUnaryCallable( + deleteUserTransportSettings, settings.deleteUserSettings(), clientContext); + this.listUsersCallable = + callableFactory.createUnaryCallable( + listUsersTransportSettings, settings.listUsersSettings(), clientContext); + this.listUsersPagedCallable = + callableFactory.createPagedCallable( + listUsersTransportSettings, settings.listUsersSettings(), clientContext); + this.listLocationsCallable = + callableFactory.createUnaryCallable( + listLocationsTransportSettings, settings.listLocationsSettings(), clientContext); + this.listLocationsPagedCallable = + callableFactory.createPagedCallable( + listLocationsTransportSettings, settings.listLocationsSettings(), clientContext); + this.getLocationCallable = + callableFactory.createUnaryCallable( + getLocationTransportSettings, settings.getLocationSettings(), clientContext); + this.setIamPolicyCallable = + callableFactory.createUnaryCallable( + setIamPolicyTransportSettings, settings.setIamPolicySettings(), clientContext); + this.getIamPolicyCallable = + callableFactory.createUnaryCallable( + getIamPolicyTransportSettings, settings.getIamPolicySettings(), clientContext); + this.testIamPermissionsCallable = + callableFactory.createUnaryCallable( + testIamPermissionsTransportSettings, + settings.testIamPermissionsSettings(), + clientContext); + + this.backgroundResources = + new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + @InternalApi + public static List getMethodDescriptors() { + List methodDescriptors = new ArrayList<>(); + methodDescriptors.add(createUserMethodDescriptor); + methodDescriptors.add(getUserMethodDescriptor); + methodDescriptors.add(updateUserMethodDescriptor); + methodDescriptors.add(deleteUserMethodDescriptor); + methodDescriptors.add(listUsersMethodDescriptor); + methodDescriptors.add(listLocationsMethodDescriptor); + methodDescriptors.add(getLocationMethodDescriptor); + methodDescriptors.add(setIamPolicyMethodDescriptor); + methodDescriptors.add(getIamPolicyMethodDescriptor); + methodDescriptors.add(testIamPermissionsMethodDescriptor); + return methodDescriptors; + } + + @Override + public UnaryCallable createUserCallable() { + return createUserCallable; + } + + @Override + public UnaryCallable getUserCallable() { + return getUserCallable; + } + + @Override + public UnaryCallable updateUserCallable() { + return updateUserCallable; + } + + @Override + public UnaryCallable deleteUserCallable() { + return deleteUserCallable; + } + + @Override + public UnaryCallable listUsersCallable() { + return listUsersCallable; + } + + @Override + public UnaryCallable listUsersPagedCallable() { + return listUsersPagedCallable; + } + + @Override + public UnaryCallable listLocationsCallable() { + return listLocationsCallable; + } + + @Override + public UnaryCallable + listLocationsPagedCallable() { + return listLocationsPagedCallable; + } + + @Override + public UnaryCallable getLocationCallable() { + return getLocationCallable; + } + + @Override + public UnaryCallable setIamPolicyCallable() { + return setIamPolicyCallable; + } + + @Override + public UnaryCallable getIamPolicyCallable() { + return getIamPolicyCallable; + } + + @Override + public UnaryCallable + testIamPermissionsCallable() { + return testIamPermissionsCallable; + } + + @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-showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/HttpJsonMessagingCallableFactory.java b/java-showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/HttpJsonMessagingCallableFactory.java new file mode 100644 index 0000000000..6e59fe4c68 --- /dev/null +++ b/java-showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/HttpJsonMessagingCallableFactory.java @@ -0,0 +1,103 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.stub; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.HttpJsonCallSettings; +import com.google.api.gax.httpjson.HttpJsonCallableFactory; +import com.google.api.gax.httpjson.HttpJsonOperationSnapshotCallable; +import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; +import com.google.api.gax.httpjson.longrunning.stub.OperationsStub; +import com.google.api.gax.rpc.BatchingCallSettings; +import com.google.api.gax.rpc.ClientContext; +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.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.longrunning.Operation; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * REST callable factory implementation for the Messaging service API. + * + *

        This class is for advanced usage. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class HttpJsonMessagingCallableFactory + implements HttpJsonStubCallableFactory { + + @Override + public UnaryCallable createUnaryCallable( + HttpJsonCallSettings httpJsonCallSettings, + UnaryCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createUnaryCallable( + httpJsonCallSettings, callSettings, clientContext); + } + + @Override + public + UnaryCallable createPagedCallable( + HttpJsonCallSettings httpJsonCallSettings, + PagedCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createPagedCallable( + httpJsonCallSettings, callSettings, clientContext); + } + + @Override + public UnaryCallable createBatchingCallable( + HttpJsonCallSettings httpJsonCallSettings, + BatchingCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createBatchingCallable( + httpJsonCallSettings, callSettings, clientContext); + } + + @Override + public + OperationCallable createOperationCallable( + HttpJsonCallSettings httpJsonCallSettings, + OperationCallSettings callSettings, + ClientContext clientContext, + OperationsStub operationsStub) { + UnaryCallable innerCallable = + HttpJsonCallableFactory.createBaseUnaryCallable( + httpJsonCallSettings, callSettings.getInitialCallSettings(), clientContext); + HttpJsonOperationSnapshotCallable initialCallable = + new HttpJsonOperationSnapshotCallable( + innerCallable, + httpJsonCallSettings.getMethodDescriptor().getOperationSnapshotFactory()); + return HttpJsonCallableFactory.createOperationCallable( + callSettings, clientContext, operationsStub.longRunningClient(), initialCallable); + } + + @Override + public + ServerStreamingCallable createServerStreamingCallable( + HttpJsonCallSettings httpJsonCallSettings, + ServerStreamingCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createServerStreamingCallable( + httpJsonCallSettings, callSettings, clientContext); + } +} diff --git a/java-showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/HttpJsonMessagingStub.java b/java-showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/HttpJsonMessagingStub.java new file mode 100644 index 0000000000..dda9ca23b5 --- /dev/null +++ b/java-showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/HttpJsonMessagingStub.java @@ -0,0 +1,1234 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.stub; + +import static com.google.showcase.v1beta1.MessagingClient.ListBlurbsPagedResponse; +import static com.google.showcase.v1beta1.MessagingClient.ListLocationsPagedResponse; +import static com.google.showcase.v1beta1.MessagingClient.ListRoomsPagedResponse; + +import com.google.api.HttpRule; +import com.google.api.core.BetaApi; +import com.google.api.core.InternalApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.httpjson.ApiMethodDescriptor; +import com.google.api.gax.httpjson.HttpJsonCallSettings; +import com.google.api.gax.httpjson.HttpJsonOperationSnapshot; +import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; +import com.google.api.gax.httpjson.ProtoMessageRequestFormatter; +import com.google.api.gax.httpjson.ProtoMessageResponseParser; +import com.google.api.gax.httpjson.ProtoRestSerializer; +import com.google.api.gax.httpjson.longrunning.stub.HttpJsonOperationsStub; +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.OperationCallable; +import com.google.api.gax.rpc.RequestParamsBuilder; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.common.collect.ImmutableMap; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.longrunning.Operation; +import com.google.protobuf.Empty; +import com.google.protobuf.TypeRegistry; +import com.google.showcase.v1beta1.Blurb; +import com.google.showcase.v1beta1.ConnectRequest; +import com.google.showcase.v1beta1.CreateBlurbRequest; +import com.google.showcase.v1beta1.CreateRoomRequest; +import com.google.showcase.v1beta1.DeleteBlurbRequest; +import com.google.showcase.v1beta1.DeleteRoomRequest; +import com.google.showcase.v1beta1.GetBlurbRequest; +import com.google.showcase.v1beta1.GetRoomRequest; +import com.google.showcase.v1beta1.ListBlurbsRequest; +import com.google.showcase.v1beta1.ListBlurbsResponse; +import com.google.showcase.v1beta1.ListRoomsRequest; +import com.google.showcase.v1beta1.ListRoomsResponse; +import com.google.showcase.v1beta1.Room; +import com.google.showcase.v1beta1.SearchBlurbsMetadata; +import com.google.showcase.v1beta1.SearchBlurbsRequest; +import com.google.showcase.v1beta1.SearchBlurbsResponse; +import com.google.showcase.v1beta1.SendBlurbsResponse; +import com.google.showcase.v1beta1.StreamBlurbsRequest; +import com.google.showcase.v1beta1.StreamBlurbsResponse; +import com.google.showcase.v1beta1.UpdateBlurbRequest; +import com.google.showcase.v1beta1.UpdateRoomRequest; +import java.io.IOException; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * REST stub implementation for the Messaging service API. + * + *

        This class is for advanced usage and reflects the underlying API directly. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class HttpJsonMessagingStub extends MessagingStub { + private static final TypeRegistry typeRegistry = + TypeRegistry.newBuilder() + .add(SearchBlurbsResponse.getDescriptor()) + .add(SearchBlurbsMetadata.getDescriptor()) + .build(); + + private static final ApiMethodDescriptor createRoomMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.showcase.v1beta1.Messaging/CreateRoom") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/rooms", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("*", request.toBuilder().build(), false)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Room.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor getRoomMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.showcase.v1beta1.Messaging/GetRoom") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/{name=rooms/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Room.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor updateRoomMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.showcase.v1beta1.Messaging/UpdateRoom") + .setHttpMethod("PATCH") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/{room.name=rooms/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "room.name", request.getRoom().getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "updateMask", request.getUpdateMask()); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create().toBody("room", request.getRoom(), false)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Room.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor deleteRoomMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.showcase.v1beta1.Messaging/DeleteRoom") + .setHttpMethod("DELETE") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/{name=rooms/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Empty.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + listRoomsMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.showcase.v1beta1.Messaging/ListRooms") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/rooms", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "pageSize", request.getPageSize()); + serializer.putQueryParam(fields, "pageToken", request.getPageToken()); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(ListRoomsResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor createBlurbMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.showcase.v1beta1.Messaging/CreateBlurb") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/{parent=rooms/*}/blurbs", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "parent", request.getParent()); + return fields; + }) + .setAdditionalPaths("/v1beta1/{parent=users/*/profile}/blurbs") + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("*", request.toBuilder().clearParent().build(), false)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Blurb.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor getBlurbMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.showcase.v1beta1.Messaging/GetBlurb") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/{name=rooms/*/blurbs/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setAdditionalPaths("/v1beta1/{name=users/*/profile/blurbs/*}") + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Blurb.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor updateBlurbMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.showcase.v1beta1.Messaging/UpdateBlurb") + .setHttpMethod("PATCH") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/{blurb.name=rooms/*/blurbs/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "blurb.name", request.getBlurb().getName()); + return fields; + }) + .setAdditionalPaths("/v1beta1/{blurb.name=users/*/profile/blurbs/*}") + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "updateMask", request.getUpdateMask()); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create().toBody("blurb", request.getBlurb(), false)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Blurb.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor deleteBlurbMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.showcase.v1beta1.Messaging/DeleteBlurb") + .setHttpMethod("DELETE") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/{name=rooms/*/blurbs/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setAdditionalPaths("/v1beta1/{name=users/*/profile/blurbs/*}") + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Empty.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + listBlurbsMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.showcase.v1beta1.Messaging/ListBlurbs") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/{parent=rooms/*}/blurbs", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "parent", request.getParent()); + return fields; + }) + .setAdditionalPaths("/v1beta1/{parent=users/*/profile}/blurbs") + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "pageSize", request.getPageSize()); + serializer.putQueryParam(fields, "pageToken", request.getPageToken()); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(ListBlurbsResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + searchBlurbsMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.showcase.v1beta1.Messaging/SearchBlurbs") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/{parent=rooms/*}/blurbs:search", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "parent", request.getParent()); + return fields; + }) + .setAdditionalPaths("/v1beta1/{parent=users/*/profile}/blurbs:search") + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("*", request.toBuilder().clearParent().build(), false)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Operation.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .setOperationSnapshotFactory( + (SearchBlurbsRequest request, Operation response) -> + HttpJsonOperationSnapshot.create(response)) + .build(); + + private static final ApiMethodDescriptor + streamBlurbsMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.showcase.v1beta1.Messaging/StreamBlurbs") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.SERVER_STREAMING) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/{name=rooms/*}/blurbs:stream", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setAdditionalPaths("/v1beta1/{name=users/*/profile}/blurbs:stream") + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("*", request.toBuilder().clearName().build(), false)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(StreamBlurbsResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + listLocationsMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.location.Locations/ListLocations") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/{name=projects/*}/locations", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(ListLocationsResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + getLocationMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.location.Locations/GetLocation") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/{name=projects/*/locations/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Location.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + setIamPolicyMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.iam.v1.IAMPolicy/SetIamPolicy") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/{resource=users/*}:setIamPolicy", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "resource", request.getResource()); + return fields; + }) + .setAdditionalPaths( + "/v1beta1/{resource=rooms/*}:setIamPolicy", + "/v1beta1/{resource=rooms/*/blurbs/*}:setIamPolicy", + "/v1beta1/{resource=sequences/*}:setIamPolicy") + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("*", request.toBuilder().clearResource().build(), false)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Policy.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + getIamPolicyMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.iam.v1.IAMPolicy/GetIamPolicy") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/{resource=users/*}:getIamPolicy", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "resource", request.getResource()); + return fields; + }) + .setAdditionalPaths( + "/v1beta1/{resource=rooms/*}:getIamPolicy", + "/v1beta1/{resource=rooms/*/blurbs/*}:getIamPolicy", + "/v1beta1/{resource=sequences/*}:getIamPolicy") + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Policy.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + testIamPermissionsMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.iam.v1.IAMPolicy/TestIamPermissions") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/{resource=users/*}:testIamPermissions", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "resource", request.getResource()); + return fields; + }) + .setAdditionalPaths( + "/v1beta1/{resource=rooms/*}:testIamPermissions", + "/v1beta1/{resource=rooms/*/blurbs/*}:testIamPermissions", + "/v1beta1/{resource=sequences/*}:testIamPermissions") + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("*", request.toBuilder().clearResource().build(), false)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(TestIamPermissionsResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private final UnaryCallable createRoomCallable; + private final UnaryCallable getRoomCallable; + private final UnaryCallable updateRoomCallable; + private final UnaryCallable deleteRoomCallable; + private final UnaryCallable listRoomsCallable; + private final UnaryCallable listRoomsPagedCallable; + private final UnaryCallable createBlurbCallable; + private final UnaryCallable getBlurbCallable; + private final UnaryCallable updateBlurbCallable; + private final UnaryCallable deleteBlurbCallable; + private final UnaryCallable listBlurbsCallable; + private final UnaryCallable listBlurbsPagedCallable; + private final UnaryCallable searchBlurbsCallable; + private final OperationCallable + searchBlurbsOperationCallable; + private final ServerStreamingCallable + streamBlurbsCallable; + private final UnaryCallable listLocationsCallable; + private final UnaryCallable + listLocationsPagedCallable; + private final UnaryCallable getLocationCallable; + private final UnaryCallable setIamPolicyCallable; + private final UnaryCallable getIamPolicyCallable; + private final UnaryCallable + testIamPermissionsCallable; + + private final BackgroundResource backgroundResources; + private final HttpJsonOperationsStub httpJsonOperationsStub; + private final HttpJsonStubCallableFactory callableFactory; + + public static final HttpJsonMessagingStub create(MessagingStubSettings settings) + throws IOException { + return new HttpJsonMessagingStub(settings, ClientContext.create(settings)); + } + + public static final HttpJsonMessagingStub create(ClientContext clientContext) throws IOException { + return new HttpJsonMessagingStub( + MessagingStubSettings.newHttpJsonBuilder().build(), clientContext); + } + + public static final HttpJsonMessagingStub create( + ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { + return new HttpJsonMessagingStub( + MessagingStubSettings.newHttpJsonBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of HttpJsonMessagingStub, 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 HttpJsonMessagingStub(MessagingStubSettings settings, ClientContext clientContext) + throws IOException { + this(settings, clientContext, new HttpJsonMessagingCallableFactory()); + } + + /** + * Constructs an instance of HttpJsonMessagingStub, 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 HttpJsonMessagingStub( + MessagingStubSettings settings, + ClientContext clientContext, + HttpJsonStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + this.httpJsonOperationsStub = + HttpJsonOperationsStub.create( + clientContext, + callableFactory, + typeRegistry, + ImmutableMap.builder() + .put( + "google.longrunning.Operations.CancelOperation", + HttpRule.newBuilder().setPost("/v1beta1/{name=operations/**}:cancel").build()) + .put( + "google.longrunning.Operations.DeleteOperation", + HttpRule.newBuilder().setDelete("/v1beta1/{name=operations/**}").build()) + .put( + "google.longrunning.Operations.GetOperation", + HttpRule.newBuilder().setGet("/v1beta1/{name=operations/**}").build()) + .put( + "google.longrunning.Operations.ListOperations", + HttpRule.newBuilder().setGet("/v1beta1/operations").build()) + .build()); + + HttpJsonCallSettings createRoomTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(createRoomMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings getRoomTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getRoomMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .setResourceNameExtractor(request -> request.getName()) + .build(); + HttpJsonCallSettings updateRoomTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(updateRoomMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("room.name", String.valueOf(request.getRoom().getName())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings deleteRoomTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(deleteRoomMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .setResourceNameExtractor(request -> request.getName()) + .build(); + HttpJsonCallSettings listRoomsTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(listRoomsMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings createBlurbTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(createBlurbMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .setResourceNameExtractor(request -> request.getParent()) + .build(); + HttpJsonCallSettings getBlurbTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getBlurbMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .setResourceNameExtractor(request -> request.getName()) + .build(); + HttpJsonCallSettings updateBlurbTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(updateBlurbMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("blurb.name", String.valueOf(request.getBlurb().getName())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings deleteBlurbTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(deleteBlurbMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .setResourceNameExtractor(request -> request.getName()) + .build(); + HttpJsonCallSettings listBlurbsTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(listBlurbsMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .setResourceNameExtractor(request -> request.getParent()) + .build(); + HttpJsonCallSettings searchBlurbsTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(searchBlurbsMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .setResourceNameExtractor(request -> request.getParent()) + .build(); + HttpJsonCallSettings streamBlurbsTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(streamBlurbsMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .setResourceNameExtractor(request -> request.getName()) + .build(); + HttpJsonCallSettings + listLocationsTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(listLocationsMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings getLocationTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getLocationMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings setIamPolicyTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(setIamPolicyMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("resource", String.valueOf(request.getResource())); + return builder.build(); + }) + .setResourceNameExtractor(request -> request.getResource()) + .build(); + HttpJsonCallSettings getIamPolicyTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getIamPolicyMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("resource", String.valueOf(request.getResource())); + return builder.build(); + }) + .setResourceNameExtractor(request -> request.getResource()) + .build(); + HttpJsonCallSettings + testIamPermissionsTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(testIamPermissionsMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("resource", String.valueOf(request.getResource())); + return builder.build(); + }) + .setResourceNameExtractor(request -> request.getResource()) + .build(); + + this.createRoomCallable = + callableFactory.createUnaryCallable( + createRoomTransportSettings, settings.createRoomSettings(), clientContext); + this.getRoomCallable = + callableFactory.createUnaryCallable( + getRoomTransportSettings, settings.getRoomSettings(), clientContext); + this.updateRoomCallable = + callableFactory.createUnaryCallable( + updateRoomTransportSettings, settings.updateRoomSettings(), clientContext); + this.deleteRoomCallable = + callableFactory.createUnaryCallable( + deleteRoomTransportSettings, settings.deleteRoomSettings(), clientContext); + this.listRoomsCallable = + callableFactory.createUnaryCallable( + listRoomsTransportSettings, settings.listRoomsSettings(), clientContext); + this.listRoomsPagedCallable = + callableFactory.createPagedCallable( + listRoomsTransportSettings, settings.listRoomsSettings(), clientContext); + this.createBlurbCallable = + callableFactory.createUnaryCallable( + createBlurbTransportSettings, settings.createBlurbSettings(), clientContext); + this.getBlurbCallable = + callableFactory.createUnaryCallable( + getBlurbTransportSettings, settings.getBlurbSettings(), clientContext); + this.updateBlurbCallable = + callableFactory.createUnaryCallable( + updateBlurbTransportSettings, settings.updateBlurbSettings(), clientContext); + this.deleteBlurbCallable = + callableFactory.createUnaryCallable( + deleteBlurbTransportSettings, settings.deleteBlurbSettings(), clientContext); + this.listBlurbsCallable = + callableFactory.createUnaryCallable( + listBlurbsTransportSettings, settings.listBlurbsSettings(), clientContext); + this.listBlurbsPagedCallable = + callableFactory.createPagedCallable( + listBlurbsTransportSettings, settings.listBlurbsSettings(), clientContext); + this.searchBlurbsCallable = + callableFactory.createUnaryCallable( + searchBlurbsTransportSettings, settings.searchBlurbsSettings(), clientContext); + this.searchBlurbsOperationCallable = + callableFactory.createOperationCallable( + searchBlurbsTransportSettings, + settings.searchBlurbsOperationSettings(), + clientContext, + httpJsonOperationsStub); + this.streamBlurbsCallable = + callableFactory.createServerStreamingCallable( + streamBlurbsTransportSettings, settings.streamBlurbsSettings(), clientContext); + this.listLocationsCallable = + callableFactory.createUnaryCallable( + listLocationsTransportSettings, settings.listLocationsSettings(), clientContext); + this.listLocationsPagedCallable = + callableFactory.createPagedCallable( + listLocationsTransportSettings, settings.listLocationsSettings(), clientContext); + this.getLocationCallable = + callableFactory.createUnaryCallable( + getLocationTransportSettings, settings.getLocationSettings(), clientContext); + this.setIamPolicyCallable = + callableFactory.createUnaryCallable( + setIamPolicyTransportSettings, settings.setIamPolicySettings(), clientContext); + this.getIamPolicyCallable = + callableFactory.createUnaryCallable( + getIamPolicyTransportSettings, settings.getIamPolicySettings(), clientContext); + this.testIamPermissionsCallable = + callableFactory.createUnaryCallable( + testIamPermissionsTransportSettings, + settings.testIamPermissionsSettings(), + clientContext); + + this.backgroundResources = + new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + @InternalApi + public static List getMethodDescriptors() { + List methodDescriptors = new ArrayList<>(); + methodDescriptors.add(createRoomMethodDescriptor); + methodDescriptors.add(getRoomMethodDescriptor); + methodDescriptors.add(updateRoomMethodDescriptor); + methodDescriptors.add(deleteRoomMethodDescriptor); + methodDescriptors.add(listRoomsMethodDescriptor); + methodDescriptors.add(createBlurbMethodDescriptor); + methodDescriptors.add(getBlurbMethodDescriptor); + methodDescriptors.add(updateBlurbMethodDescriptor); + methodDescriptors.add(deleteBlurbMethodDescriptor); + methodDescriptors.add(listBlurbsMethodDescriptor); + methodDescriptors.add(searchBlurbsMethodDescriptor); + methodDescriptors.add(streamBlurbsMethodDescriptor); + methodDescriptors.add(listLocationsMethodDescriptor); + methodDescriptors.add(getLocationMethodDescriptor); + methodDescriptors.add(setIamPolicyMethodDescriptor); + methodDescriptors.add(getIamPolicyMethodDescriptor); + methodDescriptors.add(testIamPermissionsMethodDescriptor); + return methodDescriptors; + } + + public HttpJsonOperationsStub getHttpJsonOperationsStub() { + return httpJsonOperationsStub; + } + + @Override + public UnaryCallable createRoomCallable() { + return createRoomCallable; + } + + @Override + public UnaryCallable getRoomCallable() { + return getRoomCallable; + } + + @Override + public UnaryCallable updateRoomCallable() { + return updateRoomCallable; + } + + @Override + public UnaryCallable deleteRoomCallable() { + return deleteRoomCallable; + } + + @Override + public UnaryCallable listRoomsCallable() { + return listRoomsCallable; + } + + @Override + public UnaryCallable listRoomsPagedCallable() { + return listRoomsPagedCallable; + } + + @Override + public UnaryCallable createBlurbCallable() { + return createBlurbCallable; + } + + @Override + public UnaryCallable getBlurbCallable() { + return getBlurbCallable; + } + + @Override + public UnaryCallable updateBlurbCallable() { + return updateBlurbCallable; + } + + @Override + public UnaryCallable deleteBlurbCallable() { + return deleteBlurbCallable; + } + + @Override + public UnaryCallable listBlurbsCallable() { + return listBlurbsCallable; + } + + @Override + public UnaryCallable listBlurbsPagedCallable() { + return listBlurbsPagedCallable; + } + + @Override + public UnaryCallable searchBlurbsCallable() { + return searchBlurbsCallable; + } + + @Override + public OperationCallable + searchBlurbsOperationCallable() { + return searchBlurbsOperationCallable; + } + + @Override + public ServerStreamingCallable streamBlurbsCallable() { + return streamBlurbsCallable; + } + + @Override + public UnaryCallable listLocationsCallable() { + return listLocationsCallable; + } + + @Override + public UnaryCallable + listLocationsPagedCallable() { + return listLocationsPagedCallable; + } + + @Override + public UnaryCallable getLocationCallable() { + return getLocationCallable; + } + + @Override + public UnaryCallable setIamPolicyCallable() { + return setIamPolicyCallable; + } + + @Override + public UnaryCallable getIamPolicyCallable() { + return getIamPolicyCallable; + } + + @Override + public UnaryCallable + testIamPermissionsCallable() { + return testIamPermissionsCallable; + } + + @Override + public ClientStreamingCallable sendBlurbsCallable() { + throw new UnsupportedOperationException( + "Not implemented: sendBlurbsCallable(). REST transport is not implemented for this method" + + " yet."); + } + + @Override + public BidiStreamingCallable connectCallable() { + throw new UnsupportedOperationException( + "Not implemented: connectCallable(). REST transport is not implemented for this method" + + " yet."); + } + + @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-showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/HttpJsonSequenceServiceCallableFactory.java b/java-showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/HttpJsonSequenceServiceCallableFactory.java new file mode 100644 index 0000000000..34dc970004 --- /dev/null +++ b/java-showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/HttpJsonSequenceServiceCallableFactory.java @@ -0,0 +1,103 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.stub; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.HttpJsonCallSettings; +import com.google.api.gax.httpjson.HttpJsonCallableFactory; +import com.google.api.gax.httpjson.HttpJsonOperationSnapshotCallable; +import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; +import com.google.api.gax.httpjson.longrunning.stub.OperationsStub; +import com.google.api.gax.rpc.BatchingCallSettings; +import com.google.api.gax.rpc.ClientContext; +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.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.longrunning.Operation; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * REST callable factory implementation for the SequenceService service API. + * + *

        This class is for advanced usage. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class HttpJsonSequenceServiceCallableFactory + implements HttpJsonStubCallableFactory { + + @Override + public UnaryCallable createUnaryCallable( + HttpJsonCallSettings httpJsonCallSettings, + UnaryCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createUnaryCallable( + httpJsonCallSettings, callSettings, clientContext); + } + + @Override + public + UnaryCallable createPagedCallable( + HttpJsonCallSettings httpJsonCallSettings, + PagedCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createPagedCallable( + httpJsonCallSettings, callSettings, clientContext); + } + + @Override + public UnaryCallable createBatchingCallable( + HttpJsonCallSettings httpJsonCallSettings, + BatchingCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createBatchingCallable( + httpJsonCallSettings, callSettings, clientContext); + } + + @Override + public + OperationCallable createOperationCallable( + HttpJsonCallSettings httpJsonCallSettings, + OperationCallSettings callSettings, + ClientContext clientContext, + OperationsStub operationsStub) { + UnaryCallable innerCallable = + HttpJsonCallableFactory.createBaseUnaryCallable( + httpJsonCallSettings, callSettings.getInitialCallSettings(), clientContext); + HttpJsonOperationSnapshotCallable initialCallable = + new HttpJsonOperationSnapshotCallable( + innerCallable, + httpJsonCallSettings.getMethodDescriptor().getOperationSnapshotFactory()); + return HttpJsonCallableFactory.createOperationCallable( + callSettings, clientContext, operationsStub.longRunningClient(), initialCallable); + } + + @Override + public + ServerStreamingCallable createServerStreamingCallable( + HttpJsonCallSettings httpJsonCallSettings, + ServerStreamingCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createServerStreamingCallable( + httpJsonCallSettings, callSettings, clientContext); + } +} diff --git a/java-showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/HttpJsonSequenceServiceStub.java b/java-showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/HttpJsonSequenceServiceStub.java new file mode 100644 index 0000000000..da7116caad --- /dev/null +++ b/java-showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/HttpJsonSequenceServiceStub.java @@ -0,0 +1,827 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.stub; + +import static com.google.showcase.v1beta1.SequenceServiceClient.ListLocationsPagedResponse; + +import com.google.api.core.BetaApi; +import com.google.api.core.InternalApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.httpjson.ApiMethodDescriptor; +import com.google.api.gax.httpjson.HttpJsonCallSettings; +import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; +import com.google.api.gax.httpjson.ProtoMessageRequestFormatter; +import com.google.api.gax.httpjson.ProtoMessageResponseParser; +import com.google.api.gax.httpjson.ProtoRestSerializer; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.RequestParamsBuilder; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.protobuf.Empty; +import com.google.protobuf.TypeRegistry; +import com.google.showcase.v1beta1.AttemptSequenceRequest; +import com.google.showcase.v1beta1.AttemptStreamingSequenceRequest; +import com.google.showcase.v1beta1.AttemptStreamingSequenceResponse; +import com.google.showcase.v1beta1.CreateSequenceRequest; +import com.google.showcase.v1beta1.CreateStreamingSequenceRequest; +import com.google.showcase.v1beta1.GetSequenceReportRequest; +import com.google.showcase.v1beta1.GetStreamingSequenceReportRequest; +import com.google.showcase.v1beta1.Sequence; +import com.google.showcase.v1beta1.SequenceReport; +import com.google.showcase.v1beta1.StreamingSequence; +import com.google.showcase.v1beta1.StreamingSequenceReport; +import java.io.IOException; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * REST stub implementation for the SequenceService service API. + * + *

        This class is for advanced usage and reflects the underlying API directly. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class HttpJsonSequenceServiceStub extends SequenceServiceStub { + private static final TypeRegistry typeRegistry = TypeRegistry.newBuilder().build(); + + private static final ApiMethodDescriptor + createSequenceMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.showcase.v1beta1.SequenceService/CreateSequence") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/sequences", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("sequence", request.getSequence(), false)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Sequence.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + createStreamingSequenceMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.showcase.v1beta1.SequenceService/CreateStreamingSequence") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/streamingSequences", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody( + "streamingSequence", request.getStreamingSequence(), false)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(StreamingSequence.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + getSequenceReportMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.showcase.v1beta1.SequenceService/GetSequenceReport") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/{name=sequences/*/sequenceReport}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(SequenceReport.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor< + GetStreamingSequenceReportRequest, StreamingSequenceReport> + getStreamingSequenceReportMethodDescriptor = + ApiMethodDescriptor + .newBuilder() + .setFullMethodName( + "google.showcase.v1beta1.SequenceService/GetStreamingSequenceReport") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/{name=streamingSequences/*/streamingSequenceReport}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(StreamingSequenceReport.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + attemptSequenceMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.showcase.v1beta1.SequenceService/AttemptSequence") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/{name=sequences/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("*", request.toBuilder().clearName().build(), false)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Empty.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor< + AttemptStreamingSequenceRequest, AttemptStreamingSequenceResponse> + attemptStreamingSequenceMethodDescriptor = + ApiMethodDescriptor + .newBuilder() + .setFullMethodName("google.showcase.v1beta1.SequenceService/AttemptStreamingSequence") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.SERVER_STREAMING) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/{name=streamingSequences/*}:stream", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("*", request.toBuilder().clearName().build(), false)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(AttemptStreamingSequenceResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + listLocationsMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.location.Locations/ListLocations") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/{name=projects/*}/locations", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(ListLocationsResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + getLocationMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.location.Locations/GetLocation") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/{name=projects/*/locations/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Location.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + setIamPolicyMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.iam.v1.IAMPolicy/SetIamPolicy") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/{resource=users/*}:setIamPolicy", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "resource", request.getResource()); + return fields; + }) + .setAdditionalPaths( + "/v1beta1/{resource=rooms/*}:setIamPolicy", + "/v1beta1/{resource=rooms/*/blurbs/*}:setIamPolicy", + "/v1beta1/{resource=sequences/*}:setIamPolicy") + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("*", request.toBuilder().clearResource().build(), false)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Policy.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + getIamPolicyMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.iam.v1.IAMPolicy/GetIamPolicy") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/{resource=users/*}:getIamPolicy", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "resource", request.getResource()); + return fields; + }) + .setAdditionalPaths( + "/v1beta1/{resource=rooms/*}:getIamPolicy", + "/v1beta1/{resource=rooms/*/blurbs/*}:getIamPolicy", + "/v1beta1/{resource=sequences/*}:getIamPolicy") + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Policy.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + testIamPermissionsMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.iam.v1.IAMPolicy/TestIamPermissions") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/{resource=users/*}:testIamPermissions", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "resource", request.getResource()); + return fields; + }) + .setAdditionalPaths( + "/v1beta1/{resource=rooms/*}:testIamPermissions", + "/v1beta1/{resource=rooms/*/blurbs/*}:testIamPermissions", + "/v1beta1/{resource=sequences/*}:testIamPermissions") + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("*", request.toBuilder().clearResource().build(), false)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(TestIamPermissionsResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private final UnaryCallable createSequenceCallable; + private final UnaryCallable + createStreamingSequenceCallable; + private final UnaryCallable getSequenceReportCallable; + private final UnaryCallable + getStreamingSequenceReportCallable; + private final UnaryCallable attemptSequenceCallable; + private final ServerStreamingCallable< + AttemptStreamingSequenceRequest, AttemptStreamingSequenceResponse> + attemptStreamingSequenceCallable; + private final UnaryCallable listLocationsCallable; + private final UnaryCallable + listLocationsPagedCallable; + private final UnaryCallable getLocationCallable; + private final UnaryCallable setIamPolicyCallable; + private final UnaryCallable getIamPolicyCallable; + private final UnaryCallable + testIamPermissionsCallable; + + private final BackgroundResource backgroundResources; + private final HttpJsonStubCallableFactory callableFactory; + + public static final HttpJsonSequenceServiceStub create(SequenceServiceStubSettings settings) + throws IOException { + return new HttpJsonSequenceServiceStub(settings, ClientContext.create(settings)); + } + + public static final HttpJsonSequenceServiceStub create(ClientContext clientContext) + throws IOException { + return new HttpJsonSequenceServiceStub( + SequenceServiceStubSettings.newHttpJsonBuilder().build(), clientContext); + } + + public static final HttpJsonSequenceServiceStub create( + ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { + return new HttpJsonSequenceServiceStub( + SequenceServiceStubSettings.newHttpJsonBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of HttpJsonSequenceServiceStub, 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 HttpJsonSequenceServiceStub( + SequenceServiceStubSettings settings, ClientContext clientContext) throws IOException { + this(settings, clientContext, new HttpJsonSequenceServiceCallableFactory()); + } + + /** + * Constructs an instance of HttpJsonSequenceServiceStub, 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 HttpJsonSequenceServiceStub( + SequenceServiceStubSettings settings, + ClientContext clientContext, + HttpJsonStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + + HttpJsonCallSettings createSequenceTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(createSequenceMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings + createStreamingSequenceTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(createStreamingSequenceMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings + getSequenceReportTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getSequenceReportMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .setResourceNameExtractor(request -> request.getName()) + .build(); + HttpJsonCallSettings + getStreamingSequenceReportTransportSettings = + HttpJsonCallSettings + .newBuilder() + .setMethodDescriptor(getStreamingSequenceReportMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .setResourceNameExtractor(request -> request.getName()) + .build(); + HttpJsonCallSettings attemptSequenceTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(attemptSequenceMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .setResourceNameExtractor(request -> request.getName()) + .build(); + HttpJsonCallSettings + attemptStreamingSequenceTransportSettings = + HttpJsonCallSettings + .newBuilder() + .setMethodDescriptor(attemptStreamingSequenceMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .setResourceNameExtractor(request -> request.getName()) + .build(); + HttpJsonCallSettings + listLocationsTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(listLocationsMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings getLocationTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getLocationMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings setIamPolicyTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(setIamPolicyMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("resource", String.valueOf(request.getResource())); + return builder.build(); + }) + .setResourceNameExtractor(request -> request.getResource()) + .build(); + HttpJsonCallSettings getIamPolicyTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getIamPolicyMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("resource", String.valueOf(request.getResource())); + return builder.build(); + }) + .setResourceNameExtractor(request -> request.getResource()) + .build(); + HttpJsonCallSettings + testIamPermissionsTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(testIamPermissionsMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("resource", String.valueOf(request.getResource())); + return builder.build(); + }) + .setResourceNameExtractor(request -> request.getResource()) + .build(); + + this.createSequenceCallable = + callableFactory.createUnaryCallable( + createSequenceTransportSettings, settings.createSequenceSettings(), clientContext); + this.createStreamingSequenceCallable = + callableFactory.createUnaryCallable( + createStreamingSequenceTransportSettings, + settings.createStreamingSequenceSettings(), + clientContext); + this.getSequenceReportCallable = + callableFactory.createUnaryCallable( + getSequenceReportTransportSettings, + settings.getSequenceReportSettings(), + clientContext); + this.getStreamingSequenceReportCallable = + callableFactory.createUnaryCallable( + getStreamingSequenceReportTransportSettings, + settings.getStreamingSequenceReportSettings(), + clientContext); + this.attemptSequenceCallable = + callableFactory.createUnaryCallable( + attemptSequenceTransportSettings, settings.attemptSequenceSettings(), clientContext); + this.attemptStreamingSequenceCallable = + callableFactory.createServerStreamingCallable( + attemptStreamingSequenceTransportSettings, + settings.attemptStreamingSequenceSettings(), + clientContext); + this.listLocationsCallable = + callableFactory.createUnaryCallable( + listLocationsTransportSettings, settings.listLocationsSettings(), clientContext); + this.listLocationsPagedCallable = + callableFactory.createPagedCallable( + listLocationsTransportSettings, settings.listLocationsSettings(), clientContext); + this.getLocationCallable = + callableFactory.createUnaryCallable( + getLocationTransportSettings, settings.getLocationSettings(), clientContext); + this.setIamPolicyCallable = + callableFactory.createUnaryCallable( + setIamPolicyTransportSettings, settings.setIamPolicySettings(), clientContext); + this.getIamPolicyCallable = + callableFactory.createUnaryCallable( + getIamPolicyTransportSettings, settings.getIamPolicySettings(), clientContext); + this.testIamPermissionsCallable = + callableFactory.createUnaryCallable( + testIamPermissionsTransportSettings, + settings.testIamPermissionsSettings(), + clientContext); + + this.backgroundResources = + new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + @InternalApi + public static List getMethodDescriptors() { + List methodDescriptors = new ArrayList<>(); + methodDescriptors.add(createSequenceMethodDescriptor); + methodDescriptors.add(createStreamingSequenceMethodDescriptor); + methodDescriptors.add(getSequenceReportMethodDescriptor); + methodDescriptors.add(getStreamingSequenceReportMethodDescriptor); + methodDescriptors.add(attemptSequenceMethodDescriptor); + methodDescriptors.add(attemptStreamingSequenceMethodDescriptor); + methodDescriptors.add(listLocationsMethodDescriptor); + methodDescriptors.add(getLocationMethodDescriptor); + methodDescriptors.add(setIamPolicyMethodDescriptor); + methodDescriptors.add(getIamPolicyMethodDescriptor); + methodDescriptors.add(testIamPermissionsMethodDescriptor); + return methodDescriptors; + } + + @Override + public UnaryCallable createSequenceCallable() { + return createSequenceCallable; + } + + @Override + public UnaryCallable + createStreamingSequenceCallable() { + return createStreamingSequenceCallable; + } + + @Override + public UnaryCallable getSequenceReportCallable() { + return getSequenceReportCallable; + } + + @Override + public UnaryCallable + getStreamingSequenceReportCallable() { + return getStreamingSequenceReportCallable; + } + + @Override + public UnaryCallable attemptSequenceCallable() { + return attemptSequenceCallable; + } + + @Override + public ServerStreamingCallable + attemptStreamingSequenceCallable() { + return attemptStreamingSequenceCallable; + } + + @Override + public UnaryCallable listLocationsCallable() { + return listLocationsCallable; + } + + @Override + public UnaryCallable + listLocationsPagedCallable() { + return listLocationsPagedCallable; + } + + @Override + public UnaryCallable getLocationCallable() { + return getLocationCallable; + } + + @Override + public UnaryCallable setIamPolicyCallable() { + return setIamPolicyCallable; + } + + @Override + public UnaryCallable getIamPolicyCallable() { + return getIamPolicyCallable; + } + + @Override + public UnaryCallable + testIamPermissionsCallable() { + return testIamPermissionsCallable; + } + + @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-showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/HttpJsonTestingCallableFactory.java b/java-showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/HttpJsonTestingCallableFactory.java new file mode 100644 index 0000000000..be1186b7ec --- /dev/null +++ b/java-showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/HttpJsonTestingCallableFactory.java @@ -0,0 +1,103 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.stub; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.HttpJsonCallSettings; +import com.google.api.gax.httpjson.HttpJsonCallableFactory; +import com.google.api.gax.httpjson.HttpJsonOperationSnapshotCallable; +import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; +import com.google.api.gax.httpjson.longrunning.stub.OperationsStub; +import com.google.api.gax.rpc.BatchingCallSettings; +import com.google.api.gax.rpc.ClientContext; +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.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.longrunning.Operation; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * REST callable factory implementation for the Testing service API. + * + *

        This class is for advanced usage. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class HttpJsonTestingCallableFactory + implements HttpJsonStubCallableFactory { + + @Override + public UnaryCallable createUnaryCallable( + HttpJsonCallSettings httpJsonCallSettings, + UnaryCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createUnaryCallable( + httpJsonCallSettings, callSettings, clientContext); + } + + @Override + public + UnaryCallable createPagedCallable( + HttpJsonCallSettings httpJsonCallSettings, + PagedCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createPagedCallable( + httpJsonCallSettings, callSettings, clientContext); + } + + @Override + public UnaryCallable createBatchingCallable( + HttpJsonCallSettings httpJsonCallSettings, + BatchingCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createBatchingCallable( + httpJsonCallSettings, callSettings, clientContext); + } + + @Override + public + OperationCallable createOperationCallable( + HttpJsonCallSettings httpJsonCallSettings, + OperationCallSettings callSettings, + ClientContext clientContext, + OperationsStub operationsStub) { + UnaryCallable innerCallable = + HttpJsonCallableFactory.createBaseUnaryCallable( + httpJsonCallSettings, callSettings.getInitialCallSettings(), clientContext); + HttpJsonOperationSnapshotCallable initialCallable = + new HttpJsonOperationSnapshotCallable( + innerCallable, + httpJsonCallSettings.getMethodDescriptor().getOperationSnapshotFactory()); + return HttpJsonCallableFactory.createOperationCallable( + callSettings, clientContext, operationsStub.longRunningClient(), initialCallable); + } + + @Override + public + ServerStreamingCallable createServerStreamingCallable( + HttpJsonCallSettings httpJsonCallSettings, + ServerStreamingCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createServerStreamingCallable( + httpJsonCallSettings, callSettings, clientContext); + } +} diff --git a/java-showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/HttpJsonTestingStub.java b/java-showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/HttpJsonTestingStub.java new file mode 100644 index 0000000000..ed6aeae3eb --- /dev/null +++ b/java-showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/HttpJsonTestingStub.java @@ -0,0 +1,925 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.stub; + +import static com.google.showcase.v1beta1.TestingClient.ListLocationsPagedResponse; +import static com.google.showcase.v1beta1.TestingClient.ListSessionsPagedResponse; +import static com.google.showcase.v1beta1.TestingClient.ListTestsPagedResponse; + +import com.google.api.core.BetaApi; +import com.google.api.core.InternalApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.httpjson.ApiMethodDescriptor; +import com.google.api.gax.httpjson.HttpJsonCallSettings; +import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; +import com.google.api.gax.httpjson.ProtoMessageRequestFormatter; +import com.google.api.gax.httpjson.ProtoMessageResponseParser; +import com.google.api.gax.httpjson.ProtoRestSerializer; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.RequestParamsBuilder; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.protobuf.Empty; +import com.google.protobuf.TypeRegistry; +import com.google.showcase.v1beta1.CreateSessionRequest; +import com.google.showcase.v1beta1.DeleteSessionRequest; +import com.google.showcase.v1beta1.DeleteTestRequest; +import com.google.showcase.v1beta1.GetSessionRequest; +import com.google.showcase.v1beta1.ListSessionsRequest; +import com.google.showcase.v1beta1.ListSessionsResponse; +import com.google.showcase.v1beta1.ListTestsRequest; +import com.google.showcase.v1beta1.ListTestsResponse; +import com.google.showcase.v1beta1.ReportSessionRequest; +import com.google.showcase.v1beta1.ReportSessionResponse; +import com.google.showcase.v1beta1.Session; +import com.google.showcase.v1beta1.VerifyTestRequest; +import com.google.showcase.v1beta1.VerifyTestResponse; +import java.io.IOException; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * REST stub implementation for the Testing service API. + * + *

        This class is for advanced usage and reflects the underlying API directly. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class HttpJsonTestingStub extends TestingStub { + private static final TypeRegistry typeRegistry = TypeRegistry.newBuilder().build(); + + private static final ApiMethodDescriptor + createSessionMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.showcase.v1beta1.Testing/CreateSession") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/sessions", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("session", request.getSession(), false)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Session.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor getSessionMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.showcase.v1beta1.Testing/GetSession") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/{name=sessions/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Session.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + listSessionsMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.showcase.v1beta1.Testing/ListSessions") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/sessions", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "pageSize", request.getPageSize()); + serializer.putQueryParam(fields, "pageToken", request.getPageToken()); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(ListSessionsResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + deleteSessionMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.showcase.v1beta1.Testing/DeleteSession") + .setHttpMethod("DELETE") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/{name=sessions/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Empty.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + reportSessionMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.showcase.v1beta1.Testing/ReportSession") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/{name=sessions/*}:report", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(ReportSessionResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + listTestsMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.showcase.v1beta1.Testing/ListTests") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/{parent=sessions/*}/tests", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "parent", request.getParent()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "pageSize", request.getPageSize()); + serializer.putQueryParam(fields, "pageToken", request.getPageToken()); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(ListTestsResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor deleteTestMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.showcase.v1beta1.Testing/DeleteTest") + .setHttpMethod("DELETE") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/{name=sessions/*/tests/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Empty.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + verifyTestMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.showcase.v1beta1.Testing/VerifyTest") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/{name=sessions/*/tests/*}:check", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "answer", request.getAnswer()); + serializer.putQueryParam(fields, "answers", request.getAnswersList()); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(VerifyTestResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + listLocationsMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.location.Locations/ListLocations") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/{name=projects/*}/locations", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(ListLocationsResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + getLocationMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.location.Locations/GetLocation") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/{name=projects/*/locations/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Location.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + setIamPolicyMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.iam.v1.IAMPolicy/SetIamPolicy") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/{resource=users/*}:setIamPolicy", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "resource", request.getResource()); + return fields; + }) + .setAdditionalPaths( + "/v1beta1/{resource=rooms/*}:setIamPolicy", + "/v1beta1/{resource=rooms/*/blurbs/*}:setIamPolicy", + "/v1beta1/{resource=sequences/*}:setIamPolicy") + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("*", request.toBuilder().clearResource().build(), false)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Policy.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + getIamPolicyMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.iam.v1.IAMPolicy/GetIamPolicy") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/{resource=users/*}:getIamPolicy", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "resource", request.getResource()); + return fields; + }) + .setAdditionalPaths( + "/v1beta1/{resource=rooms/*}:getIamPolicy", + "/v1beta1/{resource=rooms/*/blurbs/*}:getIamPolicy", + "/v1beta1/{resource=sequences/*}:getIamPolicy") + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Policy.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + testIamPermissionsMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.iam.v1.IAMPolicy/TestIamPermissions") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/{resource=users/*}:testIamPermissions", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "resource", request.getResource()); + return fields; + }) + .setAdditionalPaths( + "/v1beta1/{resource=rooms/*}:testIamPermissions", + "/v1beta1/{resource=rooms/*/blurbs/*}:testIamPermissions", + "/v1beta1/{resource=sequences/*}:testIamPermissions") + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("*", request.toBuilder().clearResource().build(), false)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(TestIamPermissionsResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private final UnaryCallable createSessionCallable; + private final UnaryCallable getSessionCallable; + private final UnaryCallable listSessionsCallable; + private final UnaryCallable + listSessionsPagedCallable; + private final UnaryCallable deleteSessionCallable; + private final UnaryCallable reportSessionCallable; + private final UnaryCallable listTestsCallable; + private final UnaryCallable listTestsPagedCallable; + private final UnaryCallable deleteTestCallable; + private final UnaryCallable verifyTestCallable; + private final UnaryCallable listLocationsCallable; + private final UnaryCallable + listLocationsPagedCallable; + private final UnaryCallable getLocationCallable; + private final UnaryCallable setIamPolicyCallable; + private final UnaryCallable getIamPolicyCallable; + private final UnaryCallable + testIamPermissionsCallable; + + private final BackgroundResource backgroundResources; + private final HttpJsonStubCallableFactory callableFactory; + + public static final HttpJsonTestingStub create(TestingStubSettings settings) throws IOException { + return new HttpJsonTestingStub(settings, ClientContext.create(settings)); + } + + public static final HttpJsonTestingStub create(ClientContext clientContext) throws IOException { + return new HttpJsonTestingStub(TestingStubSettings.newHttpJsonBuilder().build(), clientContext); + } + + public static final HttpJsonTestingStub create( + ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { + return new HttpJsonTestingStub( + TestingStubSettings.newHttpJsonBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of HttpJsonTestingStub, 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 HttpJsonTestingStub(TestingStubSettings settings, ClientContext clientContext) + throws IOException { + this(settings, clientContext, new HttpJsonTestingCallableFactory()); + } + + /** + * Constructs an instance of HttpJsonTestingStub, 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 HttpJsonTestingStub( + TestingStubSettings settings, + ClientContext clientContext, + HttpJsonStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + + HttpJsonCallSettings createSessionTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(createSessionMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings getSessionTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getSessionMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .setResourceNameExtractor(request -> request.getName()) + .build(); + HttpJsonCallSettings listSessionsTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(listSessionsMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings deleteSessionTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(deleteSessionMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .setResourceNameExtractor(request -> request.getName()) + .build(); + HttpJsonCallSettings + reportSessionTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(reportSessionMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .setResourceNameExtractor(request -> request.getName()) + .build(); + HttpJsonCallSettings listTestsTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(listTestsMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .setResourceNameExtractor(request -> request.getParent()) + .build(); + HttpJsonCallSettings deleteTestTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(deleteTestMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .setResourceNameExtractor(request -> request.getName()) + .build(); + HttpJsonCallSettings verifyTestTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(verifyTestMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .setResourceNameExtractor(request -> request.getName()) + .build(); + HttpJsonCallSettings + listLocationsTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(listLocationsMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings getLocationTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getLocationMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings setIamPolicyTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(setIamPolicyMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("resource", String.valueOf(request.getResource())); + return builder.build(); + }) + .setResourceNameExtractor(request -> request.getResource()) + .build(); + HttpJsonCallSettings getIamPolicyTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getIamPolicyMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("resource", String.valueOf(request.getResource())); + return builder.build(); + }) + .setResourceNameExtractor(request -> request.getResource()) + .build(); + HttpJsonCallSettings + testIamPermissionsTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(testIamPermissionsMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("resource", String.valueOf(request.getResource())); + return builder.build(); + }) + .setResourceNameExtractor(request -> request.getResource()) + .build(); + + this.createSessionCallable = + callableFactory.createUnaryCallable( + createSessionTransportSettings, settings.createSessionSettings(), clientContext); + this.getSessionCallable = + callableFactory.createUnaryCallable( + getSessionTransportSettings, settings.getSessionSettings(), clientContext); + this.listSessionsCallable = + callableFactory.createUnaryCallable( + listSessionsTransportSettings, settings.listSessionsSettings(), clientContext); + this.listSessionsPagedCallable = + callableFactory.createPagedCallable( + listSessionsTransportSettings, settings.listSessionsSettings(), clientContext); + this.deleteSessionCallable = + callableFactory.createUnaryCallable( + deleteSessionTransportSettings, settings.deleteSessionSettings(), clientContext); + this.reportSessionCallable = + callableFactory.createUnaryCallable( + reportSessionTransportSettings, settings.reportSessionSettings(), clientContext); + this.listTestsCallable = + callableFactory.createUnaryCallable( + listTestsTransportSettings, settings.listTestsSettings(), clientContext); + this.listTestsPagedCallable = + callableFactory.createPagedCallable( + listTestsTransportSettings, settings.listTestsSettings(), clientContext); + this.deleteTestCallable = + callableFactory.createUnaryCallable( + deleteTestTransportSettings, settings.deleteTestSettings(), clientContext); + this.verifyTestCallable = + callableFactory.createUnaryCallable( + verifyTestTransportSettings, settings.verifyTestSettings(), clientContext); + this.listLocationsCallable = + callableFactory.createUnaryCallable( + listLocationsTransportSettings, settings.listLocationsSettings(), clientContext); + this.listLocationsPagedCallable = + callableFactory.createPagedCallable( + listLocationsTransportSettings, settings.listLocationsSettings(), clientContext); + this.getLocationCallable = + callableFactory.createUnaryCallable( + getLocationTransportSettings, settings.getLocationSettings(), clientContext); + this.setIamPolicyCallable = + callableFactory.createUnaryCallable( + setIamPolicyTransportSettings, settings.setIamPolicySettings(), clientContext); + this.getIamPolicyCallable = + callableFactory.createUnaryCallable( + getIamPolicyTransportSettings, settings.getIamPolicySettings(), clientContext); + this.testIamPermissionsCallable = + callableFactory.createUnaryCallable( + testIamPermissionsTransportSettings, + settings.testIamPermissionsSettings(), + clientContext); + + this.backgroundResources = + new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + @InternalApi + public static List getMethodDescriptors() { + List methodDescriptors = new ArrayList<>(); + methodDescriptors.add(createSessionMethodDescriptor); + methodDescriptors.add(getSessionMethodDescriptor); + methodDescriptors.add(listSessionsMethodDescriptor); + methodDescriptors.add(deleteSessionMethodDescriptor); + methodDescriptors.add(reportSessionMethodDescriptor); + methodDescriptors.add(listTestsMethodDescriptor); + methodDescriptors.add(deleteTestMethodDescriptor); + methodDescriptors.add(verifyTestMethodDescriptor); + methodDescriptors.add(listLocationsMethodDescriptor); + methodDescriptors.add(getLocationMethodDescriptor); + methodDescriptors.add(setIamPolicyMethodDescriptor); + methodDescriptors.add(getIamPolicyMethodDescriptor); + methodDescriptors.add(testIamPermissionsMethodDescriptor); + return methodDescriptors; + } + + @Override + public UnaryCallable createSessionCallable() { + return createSessionCallable; + } + + @Override + public UnaryCallable getSessionCallable() { + return getSessionCallable; + } + + @Override + public UnaryCallable listSessionsCallable() { + return listSessionsCallable; + } + + @Override + public UnaryCallable listSessionsPagedCallable() { + return listSessionsPagedCallable; + } + + @Override + public UnaryCallable deleteSessionCallable() { + return deleteSessionCallable; + } + + @Override + public UnaryCallable reportSessionCallable() { + return reportSessionCallable; + } + + @Override + public UnaryCallable listTestsCallable() { + return listTestsCallable; + } + + @Override + public UnaryCallable listTestsPagedCallable() { + return listTestsPagedCallable; + } + + @Override + public UnaryCallable deleteTestCallable() { + return deleteTestCallable; + } + + @Override + public UnaryCallable verifyTestCallable() { + return verifyTestCallable; + } + + @Override + public UnaryCallable listLocationsCallable() { + return listLocationsCallable; + } + + @Override + public UnaryCallable + listLocationsPagedCallable() { + return listLocationsPagedCallable; + } + + @Override + public UnaryCallable getLocationCallable() { + return getLocationCallable; + } + + @Override + public UnaryCallable setIamPolicyCallable() { + return setIamPolicyCallable; + } + + @Override + public UnaryCallable getIamPolicyCallable() { + return getIamPolicyCallable; + } + + @Override + public UnaryCallable + testIamPermissionsCallable() { + return testIamPermissionsCallable; + } + + @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-showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/IdentityStub.java b/java-showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/IdentityStub.java new file mode 100644 index 0000000000..740a6f42b3 --- /dev/null +++ b/java-showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/IdentityStub.java @@ -0,0 +1,106 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.stub; + +import static com.google.showcase.v1beta1.IdentityClient.ListLocationsPagedResponse; +import static com.google.showcase.v1beta1.IdentityClient.ListUsersPagedResponse; + +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.protobuf.Empty; +import com.google.showcase.v1beta1.CreateUserRequest; +import com.google.showcase.v1beta1.DeleteUserRequest; +import com.google.showcase.v1beta1.GetUserRequest; +import com.google.showcase.v1beta1.ListUsersRequest; +import com.google.showcase.v1beta1.ListUsersResponse; +import com.google.showcase.v1beta1.UpdateUserRequest; +import com.google.showcase.v1beta1.User; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Base stub class for the Identity service API. + * + *

        This class is for advanced usage and reflects the underlying API directly. + */ +@BetaApi +@Generated("by gapic-generator-java") +public abstract class IdentityStub implements BackgroundResource { + + public UnaryCallable createUserCallable() { + throw new UnsupportedOperationException("Not implemented: createUserCallable()"); + } + + public UnaryCallable getUserCallable() { + throw new UnsupportedOperationException("Not implemented: getUserCallable()"); + } + + public UnaryCallable updateUserCallable() { + throw new UnsupportedOperationException("Not implemented: updateUserCallable()"); + } + + public UnaryCallable deleteUserCallable() { + throw new UnsupportedOperationException("Not implemented: deleteUserCallable()"); + } + + public UnaryCallable listUsersPagedCallable() { + throw new UnsupportedOperationException("Not implemented: listUsersPagedCallable()"); + } + + public UnaryCallable listUsersCallable() { + throw new UnsupportedOperationException("Not implemented: listUsersCallable()"); + } + + public UnaryCallable + listLocationsPagedCallable() { + throw new UnsupportedOperationException("Not implemented: listLocationsPagedCallable()"); + } + + public UnaryCallable listLocationsCallable() { + throw new UnsupportedOperationException("Not implemented: listLocationsCallable()"); + } + + public UnaryCallable getLocationCallable() { + throw new UnsupportedOperationException("Not implemented: getLocationCallable()"); + } + + public UnaryCallable setIamPolicyCallable() { + throw new UnsupportedOperationException("Not implemented: setIamPolicyCallable()"); + } + + public UnaryCallable getIamPolicyCallable() { + throw new UnsupportedOperationException("Not implemented: getIamPolicyCallable()"); + } + + public UnaryCallable + testIamPermissionsCallable() { + throw new UnsupportedOperationException("Not implemented: testIamPermissionsCallable()"); + } + + @Override + public abstract void close(); +} diff --git a/java-showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/IdentityStubSettings.java b/java-showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/IdentityStubSettings.java new file mode 100644 index 0000000000..e84b8628cb --- /dev/null +++ b/java-showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/IdentityStubSettings.java @@ -0,0 +1,693 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.stub; + +import static com.google.showcase.v1beta1.IdentityClient.ListLocationsPagedResponse; +import static com.google.showcase.v1beta1.IdentityClient.ListUsersPagedResponse; + +import com.google.api.core.ApiFunction; +import com.google.api.core.ApiFuture; +import com.google.api.core.BetaApi; +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.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.HttpJsonTransportChannel; +import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; +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.LibraryMetadata; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.PagedListDescriptor; +import com.google.api.gax.rpc.PagedListResponseFactory; +import com.google.api.gax.rpc.StatusCode; +import com.google.api.gax.rpc.StubSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +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.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.protobuf.Empty; +import com.google.showcase.v1beta1.CreateUserRequest; +import com.google.showcase.v1beta1.DeleteUserRequest; +import com.google.showcase.v1beta1.GetUserRequest; +import com.google.showcase.v1beta1.ListUsersRequest; +import com.google.showcase.v1beta1.ListUsersResponse; +import com.google.showcase.v1beta1.UpdateUserRequest; +import com.google.showcase.v1beta1.User; +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 IdentityStub}. + * + *

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

          + *
        • The default service address (localhost) and default port (7469) 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 createUser: + * + *

        {@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
        + * IdentityStubSettings.Builder identitySettingsBuilder = IdentityStubSettings.newBuilder();
        + * identitySettingsBuilder
        + *     .createUserSettings()
        + *     .setRetrySettings(
        + *         identitySettingsBuilder
        + *             .createUserSettings()
        + *             .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());
        + * IdentityStubSettings identitySettings = identitySettingsBuilder.build();
        + * }
        + * + * Please refer to the [Client Side Retry + * Guide](https://docs.cloud.google.com/java/docs/client-retries) for additional support in setting + * retries. + */ +@BetaApi +@Generated("by gapic-generator-java") +@SuppressWarnings("CanonicalDuration") +public class IdentityStubSettings extends StubSettings { + /** The default scopes of the service. */ + private static final ImmutableList DEFAULT_SERVICE_SCOPES = + ImmutableList.builder().build(); + + private final UnaryCallSettings createUserSettings; + private final UnaryCallSettings getUserSettings; + private final UnaryCallSettings updateUserSettings; + private final UnaryCallSettings deleteUserSettings; + private final PagedCallSettings + listUsersSettings; + private final PagedCallSettings< + ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse> + listLocationsSettings; + private final UnaryCallSettings getLocationSettings; + private final UnaryCallSettings setIamPolicySettings; + private final UnaryCallSettings getIamPolicySettings; + private final UnaryCallSettings + testIamPermissionsSettings; + + private static final PagedListDescriptor + LIST_USERS_PAGE_STR_DESC = + new PagedListDescriptor() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public ListUsersRequest injectToken(ListUsersRequest payload, String token) { + return ListUsersRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public ListUsersRequest injectPageSize(ListUsersRequest payload, int pageSize) { + return ListUsersRequest.newBuilder(payload).setPageSize(pageSize).build(); + } + + @Override + public Integer extractPageSize(ListUsersRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(ListUsersResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources(ListUsersResponse payload) { + return payload.getUsersList(); + } + }; + + private static final PagedListDescriptor + LIST_LOCATIONS_PAGE_STR_DESC = + new PagedListDescriptor() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public ListLocationsRequest injectToken(ListLocationsRequest payload, String token) { + return ListLocationsRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public ListLocationsRequest injectPageSize(ListLocationsRequest payload, int pageSize) { + return ListLocationsRequest.newBuilder(payload).setPageSize(pageSize).build(); + } + + @Override + public Integer extractPageSize(ListLocationsRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(ListLocationsResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources(ListLocationsResponse payload) { + return payload.getLocationsList(); + } + }; + + private static final PagedListResponseFactory< + ListUsersRequest, ListUsersResponse, ListUsersPagedResponse> + LIST_USERS_PAGE_STR_FACT = + new PagedListResponseFactory< + ListUsersRequest, ListUsersResponse, ListUsersPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListUsersRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext pageContext = + PageContext.create(callable, LIST_USERS_PAGE_STR_DESC, request, context); + return ListUsersPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + private static final PagedListResponseFactory< + ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse> + LIST_LOCATIONS_PAGE_STR_FACT = + new PagedListResponseFactory< + ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListLocationsRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext pageContext = + PageContext.create(callable, LIST_LOCATIONS_PAGE_STR_DESC, request, context); + return ListLocationsPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + /** Returns the object with the settings used for calls to createUser. */ + public UnaryCallSettings createUserSettings() { + return createUserSettings; + } + + /** Returns the object with the settings used for calls to getUser. */ + public UnaryCallSettings getUserSettings() { + return getUserSettings; + } + + /** Returns the object with the settings used for calls to updateUser. */ + public UnaryCallSettings updateUserSettings() { + return updateUserSettings; + } + + /** Returns the object with the settings used for calls to deleteUser. */ + public UnaryCallSettings deleteUserSettings() { + return deleteUserSettings; + } + + /** Returns the object with the settings used for calls to listUsers. */ + public PagedCallSettings + listUsersSettings() { + return listUsersSettings; + } + + /** Returns the object with the settings used for calls to listLocations. */ + public PagedCallSettings + listLocationsSettings() { + return listLocationsSettings; + } + + /** Returns the object with the settings used for calls to getLocation. */ + public UnaryCallSettings getLocationSettings() { + return getLocationSettings; + } + + /** Returns the object with the settings used for calls to setIamPolicy. */ + public UnaryCallSettings setIamPolicySettings() { + return setIamPolicySettings; + } + + /** Returns the object with the settings used for calls to getIamPolicy. */ + public UnaryCallSettings getIamPolicySettings() { + return getIamPolicySettings; + } + + /** Returns the object with the settings used for calls to testIamPermissions. */ + public UnaryCallSettings + testIamPermissionsSettings() { + return testIamPermissionsSettings; + } + + public IdentityStub createStub() throws IOException { + if (getTransportChannelProvider() + .getTransportName() + .equals(GrpcTransportChannel.getGrpcTransportName())) { + return GrpcIdentityStub.create(this); + } + if (getTransportChannelProvider() + .getTransportName() + .equals(HttpJsonTransportChannel.getHttpJsonTransportName())) { + return HttpJsonIdentityStub.create(this); + } + throw new UnsupportedOperationException( + String.format( + "Transport not supported: %s", getTransportChannelProvider().getTransportName())); + } + + /** Returns a builder for the default ExecutorProvider for this service. */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return InstantiatingExecutorProvider.newBuilder(); + } + + /** Returns the default service endpoint. */ + @ObsoleteApi("Use getEndpoint() instead") + public static String getDefaultEndpoint() { + return "localhost:7469"; + } + + /** Returns the default mTLS service endpoint. */ + public static String getDefaultMtlsEndpoint() { + return "localhost:7469"; + } + + /** 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 gRPC ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return InstantiatingGrpcChannelProvider.newBuilder() + .setMaxInboundMessageSize(Integer.MAX_VALUE); + } + + /** Returns a builder for the default REST ChannelProvider for this service. */ + @BetaApi + public static InstantiatingHttpJsonChannelProvider.Builder + defaultHttpJsonTransportProviderBuilder() { + return InstantiatingHttpJsonChannelProvider.newBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return defaultGrpcTransportProviderBuilder().build(); + } + + public static ApiClientHeaderProvider.Builder defaultGrpcApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken("gapic", GaxProperties.getLibraryVersion(IdentityStubSettings.class)) + .setTransportToken( + GaxGrpcProperties.getGrpcTokenName(), GaxGrpcProperties.getGrpcVersion()); + } + + public static ApiClientHeaderProvider.Builder defaultHttpJsonApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken("gapic", GaxProperties.getLibraryVersion(IdentityStubSettings.class)) + .setTransportToken( + GaxHttpJsonProperties.getHttpJsonTokenName(), + GaxHttpJsonProperties.getHttpJsonVersion()); + } + + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return IdentityStubSettings.defaultGrpcApiClientHeaderProviderBuilder(); + } + + /** Returns a new gRPC builder for this class. */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** Returns a new REST builder for this class. */ + public static Builder newHttpJsonBuilder() { + return Builder.createHttpJsonDefault(); + } + + /** 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 IdentityStubSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + + createUserSettings = settingsBuilder.createUserSettings().build(); + getUserSettings = settingsBuilder.getUserSettings().build(); + updateUserSettings = settingsBuilder.updateUserSettings().build(); + deleteUserSettings = settingsBuilder.deleteUserSettings().build(); + listUsersSettings = settingsBuilder.listUsersSettings().build(); + listLocationsSettings = settingsBuilder.listLocationsSettings().build(); + getLocationSettings = settingsBuilder.getLocationSettings().build(); + setIamPolicySettings = settingsBuilder.setIamPolicySettings().build(); + getIamPolicySettings = settingsBuilder.getIamPolicySettings().build(); + testIamPermissionsSettings = settingsBuilder.testIamPermissionsSettings().build(); + } + + @Override + protected LibraryMetadata getLibraryMetadata() { + return LibraryMetadata.newBuilder() + .setArtifactName("com.google.cloud:gapic-showcase") + .setRepository("googleapis/sdk-platform-java") + .setVersion(Version.VERSION) + .build(); + } + + /** Builder for IdentityStubSettings. */ + public static class Builder extends StubSettings.Builder { + private final ImmutableList> unaryMethodSettingsBuilders; + private final UnaryCallSettings.Builder createUserSettings; + private final UnaryCallSettings.Builder getUserSettings; + private final UnaryCallSettings.Builder updateUserSettings; + private final UnaryCallSettings.Builder deleteUserSettings; + private final PagedCallSettings.Builder< + ListUsersRequest, ListUsersResponse, ListUsersPagedResponse> + listUsersSettings; + private final PagedCallSettings.Builder< + ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse> + listLocationsSettings; + private final UnaryCallSettings.Builder getLocationSettings; + private final UnaryCallSettings.Builder setIamPolicySettings; + private final UnaryCallSettings.Builder getIamPolicySettings; + private final UnaryCallSettings.Builder + testIamPermissionsSettings; + 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_2_codes", + ImmutableSet.copyOf( + Lists.newArrayList( + StatusCode.Code.UNAVAILABLE, StatusCode.Code.UNKNOWN))); + 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(200L)) + .setRetryDelayMultiplier(2.0) + .setMaxRetryDelayDuration(Duration.ofMillis(3000L)) + .setInitialRpcTimeoutDuration(Duration.ofMillis(5000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeoutDuration(Duration.ofMillis(5000L)) + .setTotalTimeoutDuration(Duration.ofMillis(5000L)) + .build(); + definitions.put("retry_policy_2_params", settings); + RETRY_PARAM_DEFINITIONS = definitions.build(); + } + + protected Builder() { + this(((ClientContext) null)); + } + + protected Builder(ClientContext clientContext) { + super(clientContext); + + createUserSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + getUserSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + updateUserSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + deleteUserSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + listUsersSettings = PagedCallSettings.newBuilder(LIST_USERS_PAGE_STR_FACT); + listLocationsSettings = PagedCallSettings.newBuilder(LIST_LOCATIONS_PAGE_STR_FACT); + getLocationSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + setIamPolicySettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + getIamPolicySettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + testIamPermissionsSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + createUserSettings, + getUserSettings, + updateUserSettings, + deleteUserSettings, + listUsersSettings, + listLocationsSettings, + getLocationSettings, + setIamPolicySettings, + getIamPolicySettings, + testIamPermissionsSettings); + initDefaults(this); + } + + protected Builder(IdentityStubSettings settings) { + super(settings); + + createUserSettings = settings.createUserSettings.toBuilder(); + getUserSettings = settings.getUserSettings.toBuilder(); + updateUserSettings = settings.updateUserSettings.toBuilder(); + deleteUserSettings = settings.deleteUserSettings.toBuilder(); + listUsersSettings = settings.listUsersSettings.toBuilder(); + listLocationsSettings = settings.listLocationsSettings.toBuilder(); + getLocationSettings = settings.getLocationSettings.toBuilder(); + setIamPolicySettings = settings.setIamPolicySettings.toBuilder(); + getIamPolicySettings = settings.getIamPolicySettings.toBuilder(); + testIamPermissionsSettings = settings.testIamPermissionsSettings.toBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + createUserSettings, + getUserSettings, + updateUserSettings, + deleteUserSettings, + listUsersSettings, + listLocationsSettings, + getLocationSettings, + setIamPolicySettings, + getIamPolicySettings, + testIamPermissionsSettings); + } + + 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 createHttpJsonDefault() { + Builder builder = new Builder(((ClientContext) null)); + + builder.setTransportChannelProvider(defaultHttpJsonTransportProviderBuilder().build()); + builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); + builder.setInternalHeaderProvider(defaultHttpJsonApiClientHeaderProviderBuilder().build()); + builder.setMtlsEndpoint(getDefaultMtlsEndpoint()); + builder.setSwitchToMtlsEndpointAllowed(true); + + return initDefaults(builder); + } + + private static Builder initDefaults(Builder builder) { + builder + .createUserSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .getUserSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_2_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_2_params")); + + builder + .updateUserSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .deleteUserSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .listUsersSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_2_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_2_params")); + + builder + .listLocationsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .getLocationSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .setIamPolicySettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .getIamPolicySettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .testIamPermissionsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_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 createUser. */ + public UnaryCallSettings.Builder createUserSettings() { + return createUserSettings; + } + + /** Returns the builder for the settings used for calls to getUser. */ + public UnaryCallSettings.Builder getUserSettings() { + return getUserSettings; + } + + /** Returns the builder for the settings used for calls to updateUser. */ + public UnaryCallSettings.Builder updateUserSettings() { + return updateUserSettings; + } + + /** Returns the builder for the settings used for calls to deleteUser. */ + public UnaryCallSettings.Builder deleteUserSettings() { + return deleteUserSettings; + } + + /** Returns the builder for the settings used for calls to listUsers. */ + public PagedCallSettings.Builder + listUsersSettings() { + return listUsersSettings; + } + + /** Returns the builder for the settings used for calls to listLocations. */ + public PagedCallSettings.Builder< + ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse> + listLocationsSettings() { + return listLocationsSettings; + } + + /** Returns the builder for the settings used for calls to getLocation. */ + public UnaryCallSettings.Builder getLocationSettings() { + return getLocationSettings; + } + + /** Returns the builder for the settings used for calls to setIamPolicy. */ + public UnaryCallSettings.Builder setIamPolicySettings() { + return setIamPolicySettings; + } + + /** Returns the builder for the settings used for calls to getIamPolicy. */ + public UnaryCallSettings.Builder getIamPolicySettings() { + return getIamPolicySettings; + } + + /** Returns the builder for the settings used for calls to testIamPermissions. */ + public UnaryCallSettings.Builder + testIamPermissionsSettings() { + return testIamPermissionsSettings; + } + + @Override + public IdentityStubSettings build() throws IOException { + return new IdentityStubSettings(this); + } + } +} diff --git a/java-showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/MessagingStub.java b/java-showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/MessagingStub.java new file mode 100644 index 0000000000..6bdad6e335 --- /dev/null +++ b/java-showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/MessagingStub.java @@ -0,0 +1,180 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.stub; + +import static com.google.showcase.v1beta1.MessagingClient.ListBlurbsPagedResponse; +import static com.google.showcase.v1beta1.MessagingClient.ListLocationsPagedResponse; +import static com.google.showcase.v1beta1.MessagingClient.ListRoomsPagedResponse; + +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.rpc.BidiStreamingCallable; +import com.google.api.gax.rpc.ClientStreamingCallable; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.longrunning.Operation; +import com.google.longrunning.stub.OperationsStub; +import com.google.protobuf.Empty; +import com.google.showcase.v1beta1.Blurb; +import com.google.showcase.v1beta1.ConnectRequest; +import com.google.showcase.v1beta1.CreateBlurbRequest; +import com.google.showcase.v1beta1.CreateRoomRequest; +import com.google.showcase.v1beta1.DeleteBlurbRequest; +import com.google.showcase.v1beta1.DeleteRoomRequest; +import com.google.showcase.v1beta1.GetBlurbRequest; +import com.google.showcase.v1beta1.GetRoomRequest; +import com.google.showcase.v1beta1.ListBlurbsRequest; +import com.google.showcase.v1beta1.ListBlurbsResponse; +import com.google.showcase.v1beta1.ListRoomsRequest; +import com.google.showcase.v1beta1.ListRoomsResponse; +import com.google.showcase.v1beta1.Room; +import com.google.showcase.v1beta1.SearchBlurbsMetadata; +import com.google.showcase.v1beta1.SearchBlurbsRequest; +import com.google.showcase.v1beta1.SearchBlurbsResponse; +import com.google.showcase.v1beta1.SendBlurbsResponse; +import com.google.showcase.v1beta1.StreamBlurbsRequest; +import com.google.showcase.v1beta1.StreamBlurbsResponse; +import com.google.showcase.v1beta1.UpdateBlurbRequest; +import com.google.showcase.v1beta1.UpdateRoomRequest; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Base stub class for the Messaging service API. + * + *

        This class is for advanced usage and reflects the underlying API directly. + */ +@BetaApi +@Generated("by gapic-generator-java") +public abstract class MessagingStub implements BackgroundResource { + + public OperationsStub getOperationsStub() { + return null; + } + + public com.google.api.gax.httpjson.longrunning.stub.OperationsStub getHttpJsonOperationsStub() { + return null; + } + + public UnaryCallable createRoomCallable() { + throw new UnsupportedOperationException("Not implemented: createRoomCallable()"); + } + + public UnaryCallable getRoomCallable() { + throw new UnsupportedOperationException("Not implemented: getRoomCallable()"); + } + + public UnaryCallable updateRoomCallable() { + throw new UnsupportedOperationException("Not implemented: updateRoomCallable()"); + } + + public UnaryCallable deleteRoomCallable() { + throw new UnsupportedOperationException("Not implemented: deleteRoomCallable()"); + } + + public UnaryCallable listRoomsPagedCallable() { + throw new UnsupportedOperationException("Not implemented: listRoomsPagedCallable()"); + } + + public UnaryCallable listRoomsCallable() { + throw new UnsupportedOperationException("Not implemented: listRoomsCallable()"); + } + + public UnaryCallable createBlurbCallable() { + throw new UnsupportedOperationException("Not implemented: createBlurbCallable()"); + } + + public UnaryCallable getBlurbCallable() { + throw new UnsupportedOperationException("Not implemented: getBlurbCallable()"); + } + + public UnaryCallable updateBlurbCallable() { + throw new UnsupportedOperationException("Not implemented: updateBlurbCallable()"); + } + + public UnaryCallable deleteBlurbCallable() { + throw new UnsupportedOperationException("Not implemented: deleteBlurbCallable()"); + } + + public UnaryCallable listBlurbsPagedCallable() { + throw new UnsupportedOperationException("Not implemented: listBlurbsPagedCallable()"); + } + + public UnaryCallable listBlurbsCallable() { + throw new UnsupportedOperationException("Not implemented: listBlurbsCallable()"); + } + + public OperationCallable + searchBlurbsOperationCallable() { + throw new UnsupportedOperationException("Not implemented: searchBlurbsOperationCallable()"); + } + + public UnaryCallable searchBlurbsCallable() { + throw new UnsupportedOperationException("Not implemented: searchBlurbsCallable()"); + } + + public ServerStreamingCallable streamBlurbsCallable() { + throw new UnsupportedOperationException("Not implemented: streamBlurbsCallable()"); + } + + public ClientStreamingCallable sendBlurbsCallable() { + throw new UnsupportedOperationException("Not implemented: sendBlurbsCallable()"); + } + + public BidiStreamingCallable connectCallable() { + throw new UnsupportedOperationException("Not implemented: connectCallable()"); + } + + public UnaryCallable + listLocationsPagedCallable() { + throw new UnsupportedOperationException("Not implemented: listLocationsPagedCallable()"); + } + + public UnaryCallable listLocationsCallable() { + throw new UnsupportedOperationException("Not implemented: listLocationsCallable()"); + } + + public UnaryCallable getLocationCallable() { + throw new UnsupportedOperationException("Not implemented: getLocationCallable()"); + } + + public UnaryCallable setIamPolicyCallable() { + throw new UnsupportedOperationException("Not implemented: setIamPolicyCallable()"); + } + + public UnaryCallable getIamPolicyCallable() { + throw new UnsupportedOperationException("Not implemented: getIamPolicyCallable()"); + } + + public UnaryCallable + testIamPermissionsCallable() { + throw new UnsupportedOperationException("Not implemented: testIamPermissionsCallable()"); + } + + @Override + public abstract void close(); +} diff --git a/java-showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/MessagingStubSettings.java b/java-showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/MessagingStubSettings.java new file mode 100644 index 0000000000..8da3288193 --- /dev/null +++ b/java-showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/MessagingStubSettings.java @@ -0,0 +1,1038 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.stub; + +import static com.google.showcase.v1beta1.MessagingClient.ListBlurbsPagedResponse; +import static com.google.showcase.v1beta1.MessagingClient.ListLocationsPagedResponse; +import static com.google.showcase.v1beta1.MessagingClient.ListRoomsPagedResponse; + +import com.google.api.core.ApiFunction; +import com.google.api.core.ApiFuture; +import com.google.api.core.BetaApi; +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.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.HttpJsonTransportChannel; +import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; +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.LibraryMetadata; +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.ServerStreamingCallSettings; +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.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +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.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.longrunning.Operation; +import com.google.protobuf.Empty; +import com.google.showcase.v1beta1.Blurb; +import com.google.showcase.v1beta1.ConnectRequest; +import com.google.showcase.v1beta1.CreateBlurbRequest; +import com.google.showcase.v1beta1.CreateRoomRequest; +import com.google.showcase.v1beta1.DeleteBlurbRequest; +import com.google.showcase.v1beta1.DeleteRoomRequest; +import com.google.showcase.v1beta1.GetBlurbRequest; +import com.google.showcase.v1beta1.GetRoomRequest; +import com.google.showcase.v1beta1.ListBlurbsRequest; +import com.google.showcase.v1beta1.ListBlurbsResponse; +import com.google.showcase.v1beta1.ListRoomsRequest; +import com.google.showcase.v1beta1.ListRoomsResponse; +import com.google.showcase.v1beta1.Room; +import com.google.showcase.v1beta1.SearchBlurbsMetadata; +import com.google.showcase.v1beta1.SearchBlurbsRequest; +import com.google.showcase.v1beta1.SearchBlurbsResponse; +import com.google.showcase.v1beta1.SendBlurbsResponse; +import com.google.showcase.v1beta1.StreamBlurbsRequest; +import com.google.showcase.v1beta1.StreamBlurbsResponse; +import com.google.showcase.v1beta1.UpdateBlurbRequest; +import com.google.showcase.v1beta1.UpdateRoomRequest; +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 MessagingStub}. + * + *

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

          + *
        • The default service address (localhost) and default port (7469) 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 createRoom: + * + *

        {@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
        + * MessagingStubSettings.Builder messagingSettingsBuilder = MessagingStubSettings.newBuilder();
        + * messagingSettingsBuilder
        + *     .createRoomSettings()
        + *     .setRetrySettings(
        + *         messagingSettingsBuilder
        + *             .createRoomSettings()
        + *             .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());
        + * MessagingStubSettings messagingSettings = messagingSettingsBuilder.build();
        + * }
        + * + * Please refer to the [Client Side Retry + * Guide](https://docs.cloud.google.com/java/docs/client-retries) 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 searchBlurbs: + * + *

        {@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
        + * MessagingStubSettings.Builder messagingSettingsBuilder = MessagingStubSettings.newBuilder();
        + * TimedRetryAlgorithm timedRetryAlgorithm =
        + *     OperationalTimedPollAlgorithm.create(
        + *         RetrySettings.newBuilder()
        + *             .setInitialRetryDelayDuration(Duration.ofMillis(500))
        + *             .setRetryDelayMultiplier(1.5)
        + *             .setMaxRetryDelayDuration(Duration.ofMillis(5000))
        + *             .setTotalTimeoutDuration(Duration.ofHours(24))
        + *             .build());
        + * messagingSettingsBuilder
        + *     .createClusterOperationSettings()
        + *     .setPollingAlgorithm(timedRetryAlgorithm)
        + *     .build();
        + * }
        + */ +@BetaApi +@Generated("by gapic-generator-java") +@SuppressWarnings("CanonicalDuration") +public class MessagingStubSettings extends StubSettings { + /** The default scopes of the service. */ + private static final ImmutableList DEFAULT_SERVICE_SCOPES = + ImmutableList.builder().build(); + + private final UnaryCallSettings createRoomSettings; + private final UnaryCallSettings getRoomSettings; + private final UnaryCallSettings updateRoomSettings; + private final UnaryCallSettings deleteRoomSettings; + private final PagedCallSettings + listRoomsSettings; + private final UnaryCallSettings createBlurbSettings; + private final UnaryCallSettings getBlurbSettings; + private final UnaryCallSettings updateBlurbSettings; + private final UnaryCallSettings deleteBlurbSettings; + private final PagedCallSettings + listBlurbsSettings; + private final UnaryCallSettings searchBlurbsSettings; + private final OperationCallSettings< + SearchBlurbsRequest, SearchBlurbsResponse, SearchBlurbsMetadata> + searchBlurbsOperationSettings; + private final ServerStreamingCallSettings + streamBlurbsSettings; + private final StreamingCallSettings sendBlurbsSettings; + private final StreamingCallSettings connectSettings; + private final PagedCallSettings< + ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse> + listLocationsSettings; + private final UnaryCallSettings getLocationSettings; + private final UnaryCallSettings setIamPolicySettings; + private final UnaryCallSettings getIamPolicySettings; + private final UnaryCallSettings + testIamPermissionsSettings; + + private static final PagedListDescriptor + LIST_ROOMS_PAGE_STR_DESC = + new PagedListDescriptor() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public ListRoomsRequest injectToken(ListRoomsRequest payload, String token) { + return ListRoomsRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public ListRoomsRequest injectPageSize(ListRoomsRequest payload, int pageSize) { + return ListRoomsRequest.newBuilder(payload).setPageSize(pageSize).build(); + } + + @Override + public Integer extractPageSize(ListRoomsRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(ListRoomsResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources(ListRoomsResponse payload) { + return payload.getRoomsList(); + } + }; + + private static final PagedListDescriptor + LIST_BLURBS_PAGE_STR_DESC = + new PagedListDescriptor() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public ListBlurbsRequest injectToken(ListBlurbsRequest payload, String token) { + return ListBlurbsRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public ListBlurbsRequest injectPageSize(ListBlurbsRequest payload, int pageSize) { + return ListBlurbsRequest.newBuilder(payload).setPageSize(pageSize).build(); + } + + @Override + public Integer extractPageSize(ListBlurbsRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(ListBlurbsResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources(ListBlurbsResponse payload) { + return payload.getBlurbsList(); + } + }; + + private static final PagedListDescriptor + LIST_LOCATIONS_PAGE_STR_DESC = + new PagedListDescriptor() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public ListLocationsRequest injectToken(ListLocationsRequest payload, String token) { + return ListLocationsRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public ListLocationsRequest injectPageSize(ListLocationsRequest payload, int pageSize) { + return ListLocationsRequest.newBuilder(payload).setPageSize(pageSize).build(); + } + + @Override + public Integer extractPageSize(ListLocationsRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(ListLocationsResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources(ListLocationsResponse payload) { + return payload.getLocationsList(); + } + }; + + private static final PagedListResponseFactory< + ListRoomsRequest, ListRoomsResponse, ListRoomsPagedResponse> + LIST_ROOMS_PAGE_STR_FACT = + new PagedListResponseFactory< + ListRoomsRequest, ListRoomsResponse, ListRoomsPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListRoomsRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext pageContext = + PageContext.create(callable, LIST_ROOMS_PAGE_STR_DESC, request, context); + return ListRoomsPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + private static final PagedListResponseFactory< + ListBlurbsRequest, ListBlurbsResponse, ListBlurbsPagedResponse> + LIST_BLURBS_PAGE_STR_FACT = + new PagedListResponseFactory< + ListBlurbsRequest, ListBlurbsResponse, ListBlurbsPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListBlurbsRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext pageContext = + PageContext.create(callable, LIST_BLURBS_PAGE_STR_DESC, request, context); + return ListBlurbsPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + private static final PagedListResponseFactory< + ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse> + LIST_LOCATIONS_PAGE_STR_FACT = + new PagedListResponseFactory< + ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListLocationsRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext pageContext = + PageContext.create(callable, LIST_LOCATIONS_PAGE_STR_DESC, request, context); + return ListLocationsPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + /** Returns the object with the settings used for calls to createRoom. */ + public UnaryCallSettings createRoomSettings() { + return createRoomSettings; + } + + /** Returns the object with the settings used for calls to getRoom. */ + public UnaryCallSettings getRoomSettings() { + return getRoomSettings; + } + + /** Returns the object with the settings used for calls to updateRoom. */ + public UnaryCallSettings updateRoomSettings() { + return updateRoomSettings; + } + + /** Returns the object with the settings used for calls to deleteRoom. */ + public UnaryCallSettings deleteRoomSettings() { + return deleteRoomSettings; + } + + /** Returns the object with the settings used for calls to listRooms. */ + public PagedCallSettings + listRoomsSettings() { + return listRoomsSettings; + } + + /** Returns the object with the settings used for calls to createBlurb. */ + public UnaryCallSettings createBlurbSettings() { + return createBlurbSettings; + } + + /** Returns the object with the settings used for calls to getBlurb. */ + public UnaryCallSettings getBlurbSettings() { + return getBlurbSettings; + } + + /** Returns the object with the settings used for calls to updateBlurb. */ + public UnaryCallSettings updateBlurbSettings() { + return updateBlurbSettings; + } + + /** Returns the object with the settings used for calls to deleteBlurb. */ + public UnaryCallSettings deleteBlurbSettings() { + return deleteBlurbSettings; + } + + /** Returns the object with the settings used for calls to listBlurbs. */ + public PagedCallSettings + listBlurbsSettings() { + return listBlurbsSettings; + } + + /** Returns the object with the settings used for calls to searchBlurbs. */ + public UnaryCallSettings searchBlurbsSettings() { + return searchBlurbsSettings; + } + + /** Returns the object with the settings used for calls to searchBlurbs. */ + public OperationCallSettings + searchBlurbsOperationSettings() { + return searchBlurbsOperationSettings; + } + + /** Returns the object with the settings used for calls to streamBlurbs. */ + public ServerStreamingCallSettings + streamBlurbsSettings() { + return streamBlurbsSettings; + } + + /** Returns the object with the settings used for calls to sendBlurbs. */ + public StreamingCallSettings sendBlurbsSettings() { + return sendBlurbsSettings; + } + + /** Returns the object with the settings used for calls to connect. */ + public StreamingCallSettings connectSettings() { + return connectSettings; + } + + /** Returns the object with the settings used for calls to listLocations. */ + public PagedCallSettings + listLocationsSettings() { + return listLocationsSettings; + } + + /** Returns the object with the settings used for calls to getLocation. */ + public UnaryCallSettings getLocationSettings() { + return getLocationSettings; + } + + /** Returns the object with the settings used for calls to setIamPolicy. */ + public UnaryCallSettings setIamPolicySettings() { + return setIamPolicySettings; + } + + /** Returns the object with the settings used for calls to getIamPolicy. */ + public UnaryCallSettings getIamPolicySettings() { + return getIamPolicySettings; + } + + /** Returns the object with the settings used for calls to testIamPermissions. */ + public UnaryCallSettings + testIamPermissionsSettings() { + return testIamPermissionsSettings; + } + + public MessagingStub createStub() throws IOException { + if (getTransportChannelProvider() + .getTransportName() + .equals(GrpcTransportChannel.getGrpcTransportName())) { + return GrpcMessagingStub.create(this); + } + if (getTransportChannelProvider() + .getTransportName() + .equals(HttpJsonTransportChannel.getHttpJsonTransportName())) { + return HttpJsonMessagingStub.create(this); + } + throw new UnsupportedOperationException( + String.format( + "Transport not supported: %s", getTransportChannelProvider().getTransportName())); + } + + /** Returns a builder for the default ExecutorProvider for this service. */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return InstantiatingExecutorProvider.newBuilder(); + } + + /** Returns the default service endpoint. */ + @ObsoleteApi("Use getEndpoint() instead") + public static String getDefaultEndpoint() { + return "localhost:7469"; + } + + /** Returns the default mTLS service endpoint. */ + public static String getDefaultMtlsEndpoint() { + return "localhost:7469"; + } + + /** 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 gRPC ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return InstantiatingGrpcChannelProvider.newBuilder() + .setMaxInboundMessageSize(Integer.MAX_VALUE); + } + + /** Returns a builder for the default REST ChannelProvider for this service. */ + @BetaApi + public static InstantiatingHttpJsonChannelProvider.Builder + defaultHttpJsonTransportProviderBuilder() { + return InstantiatingHttpJsonChannelProvider.newBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return defaultGrpcTransportProviderBuilder().build(); + } + + public static ApiClientHeaderProvider.Builder defaultGrpcApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken("gapic", GaxProperties.getLibraryVersion(MessagingStubSettings.class)) + .setTransportToken( + GaxGrpcProperties.getGrpcTokenName(), GaxGrpcProperties.getGrpcVersion()); + } + + public static ApiClientHeaderProvider.Builder defaultHttpJsonApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken("gapic", GaxProperties.getLibraryVersion(MessagingStubSettings.class)) + .setTransportToken( + GaxHttpJsonProperties.getHttpJsonTokenName(), + GaxHttpJsonProperties.getHttpJsonVersion()); + } + + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return MessagingStubSettings.defaultGrpcApiClientHeaderProviderBuilder(); + } + + /** Returns a new gRPC builder for this class. */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** Returns a new REST builder for this class. */ + public static Builder newHttpJsonBuilder() { + return Builder.createHttpJsonDefault(); + } + + /** 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 MessagingStubSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + + createRoomSettings = settingsBuilder.createRoomSettings().build(); + getRoomSettings = settingsBuilder.getRoomSettings().build(); + updateRoomSettings = settingsBuilder.updateRoomSettings().build(); + deleteRoomSettings = settingsBuilder.deleteRoomSettings().build(); + listRoomsSettings = settingsBuilder.listRoomsSettings().build(); + createBlurbSettings = settingsBuilder.createBlurbSettings().build(); + getBlurbSettings = settingsBuilder.getBlurbSettings().build(); + updateBlurbSettings = settingsBuilder.updateBlurbSettings().build(); + deleteBlurbSettings = settingsBuilder.deleteBlurbSettings().build(); + listBlurbsSettings = settingsBuilder.listBlurbsSettings().build(); + searchBlurbsSettings = settingsBuilder.searchBlurbsSettings().build(); + searchBlurbsOperationSettings = settingsBuilder.searchBlurbsOperationSettings().build(); + streamBlurbsSettings = settingsBuilder.streamBlurbsSettings().build(); + sendBlurbsSettings = settingsBuilder.sendBlurbsSettings().build(); + connectSettings = settingsBuilder.connectSettings().build(); + listLocationsSettings = settingsBuilder.listLocationsSettings().build(); + getLocationSettings = settingsBuilder.getLocationSettings().build(); + setIamPolicySettings = settingsBuilder.setIamPolicySettings().build(); + getIamPolicySettings = settingsBuilder.getIamPolicySettings().build(); + testIamPermissionsSettings = settingsBuilder.testIamPermissionsSettings().build(); + } + + @Override + protected LibraryMetadata getLibraryMetadata() { + return LibraryMetadata.newBuilder() + .setArtifactName("com.google.cloud:gapic-showcase") + .setRepository("googleapis/sdk-platform-java") + .setVersion(Version.VERSION) + .build(); + } + + /** Builder for MessagingStubSettings. */ + public static class Builder extends StubSettings.Builder { + private final ImmutableList> unaryMethodSettingsBuilders; + private final UnaryCallSettings.Builder createRoomSettings; + private final UnaryCallSettings.Builder getRoomSettings; + private final UnaryCallSettings.Builder updateRoomSettings; + private final UnaryCallSettings.Builder deleteRoomSettings; + private final PagedCallSettings.Builder< + ListRoomsRequest, ListRoomsResponse, ListRoomsPagedResponse> + listRoomsSettings; + private final UnaryCallSettings.Builder createBlurbSettings; + private final UnaryCallSettings.Builder getBlurbSettings; + private final UnaryCallSettings.Builder updateBlurbSettings; + private final UnaryCallSettings.Builder deleteBlurbSettings; + private final PagedCallSettings.Builder< + ListBlurbsRequest, ListBlurbsResponse, ListBlurbsPagedResponse> + listBlurbsSettings; + private final UnaryCallSettings.Builder searchBlurbsSettings; + private final OperationCallSettings.Builder< + SearchBlurbsRequest, SearchBlurbsResponse, SearchBlurbsMetadata> + searchBlurbsOperationSettings; + private final ServerStreamingCallSettings.Builder + streamBlurbsSettings; + private final StreamingCallSettings.Builder + sendBlurbsSettings; + private final StreamingCallSettings.Builder + connectSettings; + private final PagedCallSettings.Builder< + ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse> + listLocationsSettings; + private final UnaryCallSettings.Builder getLocationSettings; + private final UnaryCallSettings.Builder setIamPolicySettings; + private final UnaryCallSettings.Builder getIamPolicySettings; + private final UnaryCallSettings.Builder + testIamPermissionsSettings; + private static final ImmutableMap> + RETRYABLE_CODE_DEFINITIONS; + + static { + ImmutableMap.Builder> definitions = + ImmutableMap.builder(); + definitions.put( + "no_retry_0_codes", ImmutableSet.copyOf(Lists.newArrayList())); + definitions.put( + "retry_policy_1_codes", + ImmutableSet.copyOf( + Lists.newArrayList( + StatusCode.Code.UNAVAILABLE, StatusCode.Code.UNKNOWN))); + RETRYABLE_CODE_DEFINITIONS = definitions.build(); + } + + private static final ImmutableMap RETRY_PARAM_DEFINITIONS; + + static { + ImmutableMap.Builder definitions = ImmutableMap.builder(); + RetrySettings settings = null; + settings = + RetrySettings.newBuilder() + .setInitialRpcTimeoutDuration(Duration.ofMillis(5000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeoutDuration(Duration.ofMillis(5000L)) + .setTotalTimeoutDuration(Duration.ofMillis(5000L)) + .build(); + definitions.put("no_retry_0_params", settings); + settings = + RetrySettings.newBuilder() + .setInitialRetryDelayDuration(Duration.ofMillis(100L)) + .setRetryDelayMultiplier(2.0) + .setMaxRetryDelayDuration(Duration.ofMillis(3000L)) + .setInitialRpcTimeoutDuration(Duration.ofMillis(10000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeoutDuration(Duration.ofMillis(10000L)) + .setTotalTimeoutDuration(Duration.ofMillis(10000L)) + .build(); + definitions.put("retry_policy_1_params", settings); + RETRY_PARAM_DEFINITIONS = definitions.build(); + } + + protected Builder() { + this(((ClientContext) null)); + } + + protected Builder(ClientContext clientContext) { + super(clientContext); + + createRoomSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + getRoomSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + updateRoomSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + deleteRoomSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + listRoomsSettings = PagedCallSettings.newBuilder(LIST_ROOMS_PAGE_STR_FACT); + createBlurbSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + getBlurbSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + updateBlurbSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + deleteBlurbSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + listBlurbsSettings = PagedCallSettings.newBuilder(LIST_BLURBS_PAGE_STR_FACT); + searchBlurbsSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + searchBlurbsOperationSettings = OperationCallSettings.newBuilder(); + streamBlurbsSettings = ServerStreamingCallSettings.newBuilder(); + sendBlurbsSettings = StreamingCallSettings.newBuilder(); + connectSettings = StreamingCallSettings.newBuilder(); + listLocationsSettings = PagedCallSettings.newBuilder(LIST_LOCATIONS_PAGE_STR_FACT); + getLocationSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + setIamPolicySettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + getIamPolicySettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + testIamPermissionsSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + createRoomSettings, + getRoomSettings, + updateRoomSettings, + deleteRoomSettings, + listRoomsSettings, + createBlurbSettings, + getBlurbSettings, + updateBlurbSettings, + deleteBlurbSettings, + listBlurbsSettings, + searchBlurbsSettings, + listLocationsSettings, + getLocationSettings, + setIamPolicySettings, + getIamPolicySettings, + testIamPermissionsSettings); + initDefaults(this); + } + + protected Builder(MessagingStubSettings settings) { + super(settings); + + createRoomSettings = settings.createRoomSettings.toBuilder(); + getRoomSettings = settings.getRoomSettings.toBuilder(); + updateRoomSettings = settings.updateRoomSettings.toBuilder(); + deleteRoomSettings = settings.deleteRoomSettings.toBuilder(); + listRoomsSettings = settings.listRoomsSettings.toBuilder(); + createBlurbSettings = settings.createBlurbSettings.toBuilder(); + getBlurbSettings = settings.getBlurbSettings.toBuilder(); + updateBlurbSettings = settings.updateBlurbSettings.toBuilder(); + deleteBlurbSettings = settings.deleteBlurbSettings.toBuilder(); + listBlurbsSettings = settings.listBlurbsSettings.toBuilder(); + searchBlurbsSettings = settings.searchBlurbsSettings.toBuilder(); + searchBlurbsOperationSettings = settings.searchBlurbsOperationSettings.toBuilder(); + streamBlurbsSettings = settings.streamBlurbsSettings.toBuilder(); + sendBlurbsSettings = settings.sendBlurbsSettings.toBuilder(); + connectSettings = settings.connectSettings.toBuilder(); + listLocationsSettings = settings.listLocationsSettings.toBuilder(); + getLocationSettings = settings.getLocationSettings.toBuilder(); + setIamPolicySettings = settings.setIamPolicySettings.toBuilder(); + getIamPolicySettings = settings.getIamPolicySettings.toBuilder(); + testIamPermissionsSettings = settings.testIamPermissionsSettings.toBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + createRoomSettings, + getRoomSettings, + updateRoomSettings, + deleteRoomSettings, + listRoomsSettings, + createBlurbSettings, + getBlurbSettings, + updateBlurbSettings, + deleteBlurbSettings, + listBlurbsSettings, + searchBlurbsSettings, + listLocationsSettings, + getLocationSettings, + setIamPolicySettings, + getIamPolicySettings, + testIamPermissionsSettings); + } + + 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 createHttpJsonDefault() { + Builder builder = new Builder(((ClientContext) null)); + + builder.setTransportChannelProvider(defaultHttpJsonTransportProviderBuilder().build()); + builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); + builder.setInternalHeaderProvider(defaultHttpJsonApiClientHeaderProviderBuilder().build()); + builder.setMtlsEndpoint(getDefaultMtlsEndpoint()); + builder.setSwitchToMtlsEndpointAllowed(true); + + return initDefaults(builder); + } + + private static Builder initDefaults(Builder builder) { + builder + .createRoomSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + + builder + .getRoomSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")); + + builder + .updateRoomSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + + builder + .deleteRoomSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + + builder + .listRoomsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")); + + builder + .createBlurbSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + + builder + .getBlurbSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")); + + builder + .updateBlurbSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + + builder + .deleteBlurbSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + + builder + .listBlurbsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")); + + builder + .searchBlurbsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")); + + builder + .streamBlurbsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + + builder + .listLocationsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + + builder + .getLocationSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + + builder + .setIamPolicySettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + + builder + .getIamPolicySettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + + builder + .testIamPermissionsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + + builder + .searchBlurbsOperationSettings() + .setInitialCallSettings( + UnaryCallSettings + .newUnaryCallSettingsBuilder() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")) + .build()) + .setResponseTransformer( + ProtoOperationTransformers.ResponseTransformer.create(SearchBlurbsResponse.class)) + .setMetadataTransformer( + ProtoOperationTransformers.MetadataTransformer.create(SearchBlurbsMetadata.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 createRoom. */ + public UnaryCallSettings.Builder createRoomSettings() { + return createRoomSettings; + } + + /** Returns the builder for the settings used for calls to getRoom. */ + public UnaryCallSettings.Builder getRoomSettings() { + return getRoomSettings; + } + + /** Returns the builder for the settings used for calls to updateRoom. */ + public UnaryCallSettings.Builder updateRoomSettings() { + return updateRoomSettings; + } + + /** Returns the builder for the settings used for calls to deleteRoom. */ + public UnaryCallSettings.Builder deleteRoomSettings() { + return deleteRoomSettings; + } + + /** Returns the builder for the settings used for calls to listRooms. */ + public PagedCallSettings.Builder + listRoomsSettings() { + return listRoomsSettings; + } + + /** Returns the builder for the settings used for calls to createBlurb. */ + public UnaryCallSettings.Builder createBlurbSettings() { + return createBlurbSettings; + } + + /** Returns the builder for the settings used for calls to getBlurb. */ + public UnaryCallSettings.Builder getBlurbSettings() { + return getBlurbSettings; + } + + /** Returns the builder for the settings used for calls to updateBlurb. */ + public UnaryCallSettings.Builder updateBlurbSettings() { + return updateBlurbSettings; + } + + /** Returns the builder for the settings used for calls to deleteBlurb. */ + public UnaryCallSettings.Builder deleteBlurbSettings() { + return deleteBlurbSettings; + } + + /** Returns the builder for the settings used for calls to listBlurbs. */ + public PagedCallSettings.Builder + listBlurbsSettings() { + return listBlurbsSettings; + } + + /** Returns the builder for the settings used for calls to searchBlurbs. */ + public UnaryCallSettings.Builder searchBlurbsSettings() { + return searchBlurbsSettings; + } + + /** Returns the builder for the settings used for calls to searchBlurbs. */ + public OperationCallSettings.Builder< + SearchBlurbsRequest, SearchBlurbsResponse, SearchBlurbsMetadata> + searchBlurbsOperationSettings() { + return searchBlurbsOperationSettings; + } + + /** Returns the builder for the settings used for calls to streamBlurbs. */ + public ServerStreamingCallSettings.Builder + streamBlurbsSettings() { + return streamBlurbsSettings; + } + + /** Returns the builder for the settings used for calls to sendBlurbs. */ + public StreamingCallSettings.Builder + sendBlurbsSettings() { + return sendBlurbsSettings; + } + + /** Returns the builder for the settings used for calls to connect. */ + public StreamingCallSettings.Builder connectSettings() { + return connectSettings; + } + + /** Returns the builder for the settings used for calls to listLocations. */ + public PagedCallSettings.Builder< + ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse> + listLocationsSettings() { + return listLocationsSettings; + } + + /** Returns the builder for the settings used for calls to getLocation. */ + public UnaryCallSettings.Builder getLocationSettings() { + return getLocationSettings; + } + + /** Returns the builder for the settings used for calls to setIamPolicy. */ + public UnaryCallSettings.Builder setIamPolicySettings() { + return setIamPolicySettings; + } + + /** Returns the builder for the settings used for calls to getIamPolicy. */ + public UnaryCallSettings.Builder getIamPolicySettings() { + return getIamPolicySettings; + } + + /** Returns the builder for the settings used for calls to testIamPermissions. */ + public UnaryCallSettings.Builder + testIamPermissionsSettings() { + return testIamPermissionsSettings; + } + + @Override + public MessagingStubSettings build() throws IOException { + return new MessagingStubSettings(this); + } + } +} diff --git a/java-showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/SequenceServiceStub.java b/java-showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/SequenceServiceStub.java new file mode 100644 index 0000000000..39f8ccd1fc --- /dev/null +++ b/java-showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/SequenceServiceStub.java @@ -0,0 +1,114 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.stub; + +import static com.google.showcase.v1beta1.SequenceServiceClient.ListLocationsPagedResponse; + +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.protobuf.Empty; +import com.google.showcase.v1beta1.AttemptSequenceRequest; +import com.google.showcase.v1beta1.AttemptStreamingSequenceRequest; +import com.google.showcase.v1beta1.AttemptStreamingSequenceResponse; +import com.google.showcase.v1beta1.CreateSequenceRequest; +import com.google.showcase.v1beta1.CreateStreamingSequenceRequest; +import com.google.showcase.v1beta1.GetSequenceReportRequest; +import com.google.showcase.v1beta1.GetStreamingSequenceReportRequest; +import com.google.showcase.v1beta1.Sequence; +import com.google.showcase.v1beta1.SequenceReport; +import com.google.showcase.v1beta1.StreamingSequence; +import com.google.showcase.v1beta1.StreamingSequenceReport; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Base stub class for the SequenceService service API. + * + *

        This class is for advanced usage and reflects the underlying API directly. + */ +@BetaApi +@Generated("by gapic-generator-java") +public abstract class SequenceServiceStub implements BackgroundResource { + + public UnaryCallable createSequenceCallable() { + throw new UnsupportedOperationException("Not implemented: createSequenceCallable()"); + } + + public UnaryCallable + createStreamingSequenceCallable() { + throw new UnsupportedOperationException("Not implemented: createStreamingSequenceCallable()"); + } + + public UnaryCallable getSequenceReportCallable() { + throw new UnsupportedOperationException("Not implemented: getSequenceReportCallable()"); + } + + public UnaryCallable + getStreamingSequenceReportCallable() { + throw new UnsupportedOperationException( + "Not implemented: getStreamingSequenceReportCallable()"); + } + + public UnaryCallable attemptSequenceCallable() { + throw new UnsupportedOperationException("Not implemented: attemptSequenceCallable()"); + } + + public ServerStreamingCallable + attemptStreamingSequenceCallable() { + throw new UnsupportedOperationException("Not implemented: attemptStreamingSequenceCallable()"); + } + + public UnaryCallable + listLocationsPagedCallable() { + throw new UnsupportedOperationException("Not implemented: listLocationsPagedCallable()"); + } + + public UnaryCallable listLocationsCallable() { + throw new UnsupportedOperationException("Not implemented: listLocationsCallable()"); + } + + public UnaryCallable getLocationCallable() { + throw new UnsupportedOperationException("Not implemented: getLocationCallable()"); + } + + public UnaryCallable setIamPolicyCallable() { + throw new UnsupportedOperationException("Not implemented: setIamPolicyCallable()"); + } + + public UnaryCallable getIamPolicyCallable() { + throw new UnsupportedOperationException("Not implemented: getIamPolicyCallable()"); + } + + public UnaryCallable + testIamPermissionsCallable() { + throw new UnsupportedOperationException("Not implemented: testIamPermissionsCallable()"); + } + + @Override + public abstract void close(); +} diff --git a/java-showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/SequenceServiceStubSettings.java b/java-showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/SequenceServiceStubSettings.java new file mode 100644 index 0000000000..f2dbe6f1af --- /dev/null +++ b/java-showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/SequenceServiceStubSettings.java @@ -0,0 +1,692 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.stub; + +import static com.google.showcase.v1beta1.SequenceServiceClient.ListLocationsPagedResponse; + +import com.google.api.core.ApiFunction; +import com.google.api.core.ApiFuture; +import com.google.api.core.BetaApi; +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.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.HttpJsonTransportChannel; +import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; +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.LibraryMetadata; +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.ServerStreamingCallSettings; +import com.google.api.gax.rpc.StatusCode; +import com.google.api.gax.rpc.StubSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +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.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.protobuf.Empty; +import com.google.showcase.v1beta1.AttemptSequenceRequest; +import com.google.showcase.v1beta1.AttemptStreamingSequenceRequest; +import com.google.showcase.v1beta1.AttemptStreamingSequenceResponse; +import com.google.showcase.v1beta1.CreateSequenceRequest; +import com.google.showcase.v1beta1.CreateStreamingSequenceRequest; +import com.google.showcase.v1beta1.GetSequenceReportRequest; +import com.google.showcase.v1beta1.GetStreamingSequenceReportRequest; +import com.google.showcase.v1beta1.Sequence; +import com.google.showcase.v1beta1.SequenceReport; +import com.google.showcase.v1beta1.StreamingSequence; +import com.google.showcase.v1beta1.StreamingSequenceReport; +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 SequenceServiceStub}. + * + *

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

          + *
        • The default service address (localhost) and default port (7469) 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 createSequence: + * + *

        {@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
        + * SequenceServiceStubSettings.Builder sequenceServiceSettingsBuilder =
        + *     SequenceServiceStubSettings.newBuilder();
        + * sequenceServiceSettingsBuilder
        + *     .createSequenceSettings()
        + *     .setRetrySettings(
        + *         sequenceServiceSettingsBuilder
        + *             .createSequenceSettings()
        + *             .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());
        + * SequenceServiceStubSettings sequenceServiceSettings = sequenceServiceSettingsBuilder.build();
        + * }
        + * + * Please refer to the [Client Side Retry + * Guide](https://docs.cloud.google.com/java/docs/client-retries) for additional support in setting + * retries. + */ +@BetaApi +@Generated("by gapic-generator-java") +@SuppressWarnings("CanonicalDuration") +public class SequenceServiceStubSettings extends StubSettings { + /** The default scopes of the service. */ + private static final ImmutableList DEFAULT_SERVICE_SCOPES = + ImmutableList.builder().build(); + + private final UnaryCallSettings createSequenceSettings; + private final UnaryCallSettings + createStreamingSequenceSettings; + private final UnaryCallSettings + getSequenceReportSettings; + private final UnaryCallSettings + getStreamingSequenceReportSettings; + private final UnaryCallSettings attemptSequenceSettings; + private final ServerStreamingCallSettings< + AttemptStreamingSequenceRequest, AttemptStreamingSequenceResponse> + attemptStreamingSequenceSettings; + private final PagedCallSettings< + ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse> + listLocationsSettings; + private final UnaryCallSettings getLocationSettings; + private final UnaryCallSettings setIamPolicySettings; + private final UnaryCallSettings getIamPolicySettings; + private final UnaryCallSettings + testIamPermissionsSettings; + + private static final PagedListDescriptor + LIST_LOCATIONS_PAGE_STR_DESC = + new PagedListDescriptor() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public ListLocationsRequest injectToken(ListLocationsRequest payload, String token) { + return ListLocationsRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public ListLocationsRequest injectPageSize(ListLocationsRequest payload, int pageSize) { + return ListLocationsRequest.newBuilder(payload).setPageSize(pageSize).build(); + } + + @Override + public Integer extractPageSize(ListLocationsRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(ListLocationsResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources(ListLocationsResponse payload) { + return payload.getLocationsList(); + } + }; + + private static final PagedListResponseFactory< + ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse> + LIST_LOCATIONS_PAGE_STR_FACT = + new PagedListResponseFactory< + ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListLocationsRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext pageContext = + PageContext.create(callable, LIST_LOCATIONS_PAGE_STR_DESC, request, context); + return ListLocationsPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + /** Returns the object with the settings used for calls to createSequence. */ + public UnaryCallSettings createSequenceSettings() { + return createSequenceSettings; + } + + /** Returns the object with the settings used for calls to createStreamingSequence. */ + public UnaryCallSettings + createStreamingSequenceSettings() { + return createStreamingSequenceSettings; + } + + /** Returns the object with the settings used for calls to getSequenceReport. */ + public UnaryCallSettings getSequenceReportSettings() { + return getSequenceReportSettings; + } + + /** Returns the object with the settings used for calls to getStreamingSequenceReport. */ + public UnaryCallSettings + getStreamingSequenceReportSettings() { + return getStreamingSequenceReportSettings; + } + + /** Returns the object with the settings used for calls to attemptSequence. */ + public UnaryCallSettings attemptSequenceSettings() { + return attemptSequenceSettings; + } + + /** Returns the object with the settings used for calls to attemptStreamingSequence. */ + public ServerStreamingCallSettings< + AttemptStreamingSequenceRequest, AttemptStreamingSequenceResponse> + attemptStreamingSequenceSettings() { + return attemptStreamingSequenceSettings; + } + + /** Returns the object with the settings used for calls to listLocations. */ + public PagedCallSettings + listLocationsSettings() { + return listLocationsSettings; + } + + /** Returns the object with the settings used for calls to getLocation. */ + public UnaryCallSettings getLocationSettings() { + return getLocationSettings; + } + + /** Returns the object with the settings used for calls to setIamPolicy. */ + public UnaryCallSettings setIamPolicySettings() { + return setIamPolicySettings; + } + + /** Returns the object with the settings used for calls to getIamPolicy. */ + public UnaryCallSettings getIamPolicySettings() { + return getIamPolicySettings; + } + + /** Returns the object with the settings used for calls to testIamPermissions. */ + public UnaryCallSettings + testIamPermissionsSettings() { + return testIamPermissionsSettings; + } + + public SequenceServiceStub createStub() throws IOException { + if (getTransportChannelProvider() + .getTransportName() + .equals(GrpcTransportChannel.getGrpcTransportName())) { + return GrpcSequenceServiceStub.create(this); + } + if (getTransportChannelProvider() + .getTransportName() + .equals(HttpJsonTransportChannel.getHttpJsonTransportName())) { + return HttpJsonSequenceServiceStub.create(this); + } + throw new UnsupportedOperationException( + String.format( + "Transport not supported: %s", getTransportChannelProvider().getTransportName())); + } + + /** Returns a builder for the default ExecutorProvider for this service. */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return InstantiatingExecutorProvider.newBuilder(); + } + + /** Returns the default service endpoint. */ + @ObsoleteApi("Use getEndpoint() instead") + public static String getDefaultEndpoint() { + return "localhost:7469"; + } + + /** Returns the default mTLS service endpoint. */ + public static String getDefaultMtlsEndpoint() { + return "localhost:7469"; + } + + /** 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 gRPC ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return InstantiatingGrpcChannelProvider.newBuilder() + .setMaxInboundMessageSize(Integer.MAX_VALUE); + } + + /** Returns a builder for the default REST ChannelProvider for this service. */ + @BetaApi + public static InstantiatingHttpJsonChannelProvider.Builder + defaultHttpJsonTransportProviderBuilder() { + return InstantiatingHttpJsonChannelProvider.newBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return defaultGrpcTransportProviderBuilder().build(); + } + + public static ApiClientHeaderProvider.Builder defaultGrpcApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken( + "gapic", GaxProperties.getLibraryVersion(SequenceServiceStubSettings.class)) + .setTransportToken( + GaxGrpcProperties.getGrpcTokenName(), GaxGrpcProperties.getGrpcVersion()); + } + + public static ApiClientHeaderProvider.Builder defaultHttpJsonApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken( + "gapic", GaxProperties.getLibraryVersion(SequenceServiceStubSettings.class)) + .setTransportToken( + GaxHttpJsonProperties.getHttpJsonTokenName(), + GaxHttpJsonProperties.getHttpJsonVersion()); + } + + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return SequenceServiceStubSettings.defaultGrpcApiClientHeaderProviderBuilder(); + } + + /** Returns a new gRPC builder for this class. */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** Returns a new REST builder for this class. */ + public static Builder newHttpJsonBuilder() { + return Builder.createHttpJsonDefault(); + } + + /** 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 SequenceServiceStubSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + + createSequenceSettings = settingsBuilder.createSequenceSettings().build(); + createStreamingSequenceSettings = settingsBuilder.createStreamingSequenceSettings().build(); + getSequenceReportSettings = settingsBuilder.getSequenceReportSettings().build(); + getStreamingSequenceReportSettings = + settingsBuilder.getStreamingSequenceReportSettings().build(); + attemptSequenceSettings = settingsBuilder.attemptSequenceSettings().build(); + attemptStreamingSequenceSettings = settingsBuilder.attemptStreamingSequenceSettings().build(); + listLocationsSettings = settingsBuilder.listLocationsSettings().build(); + getLocationSettings = settingsBuilder.getLocationSettings().build(); + setIamPolicySettings = settingsBuilder.setIamPolicySettings().build(); + getIamPolicySettings = settingsBuilder.getIamPolicySettings().build(); + testIamPermissionsSettings = settingsBuilder.testIamPermissionsSettings().build(); + } + + @Override + protected LibraryMetadata getLibraryMetadata() { + return LibraryMetadata.newBuilder() + .setArtifactName("com.google.cloud:gapic-showcase") + .setRepository("googleapis/sdk-platform-java") + .setVersion(Version.VERSION) + .build(); + } + + /** Builder for SequenceServiceStubSettings. */ + public static class Builder extends StubSettings.Builder { + private final ImmutableList> unaryMethodSettingsBuilders; + private final UnaryCallSettings.Builder createSequenceSettings; + private final UnaryCallSettings.Builder + createStreamingSequenceSettings; + private final UnaryCallSettings.Builder + getSequenceReportSettings; + private final UnaryCallSettings.Builder< + GetStreamingSequenceReportRequest, StreamingSequenceReport> + getStreamingSequenceReportSettings; + private final UnaryCallSettings.Builder attemptSequenceSettings; + private final ServerStreamingCallSettings.Builder< + AttemptStreamingSequenceRequest, AttemptStreamingSequenceResponse> + attemptStreamingSequenceSettings; + private final PagedCallSettings.Builder< + ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse> + listLocationsSettings; + private final UnaryCallSettings.Builder getLocationSettings; + private final UnaryCallSettings.Builder setIamPolicySettings; + private final UnaryCallSettings.Builder getIamPolicySettings; + private final UnaryCallSettings.Builder + testIamPermissionsSettings; + private static final ImmutableMap> + RETRYABLE_CODE_DEFINITIONS; + + static { + ImmutableMap.Builder> definitions = + ImmutableMap.builder(); + definitions.put( + "no_retry_0_codes", ImmutableSet.copyOf(Lists.newArrayList())); + definitions.put( + "retry_policy_1_codes", + ImmutableSet.copyOf( + Lists.newArrayList( + StatusCode.Code.UNAVAILABLE, StatusCode.Code.UNKNOWN))); + RETRYABLE_CODE_DEFINITIONS = definitions.build(); + } + + private static final ImmutableMap RETRY_PARAM_DEFINITIONS; + + static { + ImmutableMap.Builder definitions = ImmutableMap.builder(); + RetrySettings settings = null; + settings = + RetrySettings.newBuilder() + .setInitialRpcTimeoutDuration(Duration.ofMillis(5000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeoutDuration(Duration.ofMillis(5000L)) + .setTotalTimeoutDuration(Duration.ofMillis(5000L)) + .build(); + definitions.put("no_retry_0_params", settings); + settings = + RetrySettings.newBuilder() + .setInitialRetryDelayDuration(Duration.ofMillis(100L)) + .setRetryDelayMultiplier(2.0) + .setMaxRetryDelayDuration(Duration.ofMillis(3000L)) + .setInitialRpcTimeoutDuration(Duration.ofMillis(10000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeoutDuration(Duration.ofMillis(10000L)) + .setTotalTimeoutDuration(Duration.ofMillis(10000L)) + .build(); + definitions.put("retry_policy_1_params", settings); + RETRY_PARAM_DEFINITIONS = definitions.build(); + } + + protected Builder() { + this(((ClientContext) null)); + } + + protected Builder(ClientContext clientContext) { + super(clientContext); + + createSequenceSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + createStreamingSequenceSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + getSequenceReportSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + getStreamingSequenceReportSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + attemptSequenceSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + attemptStreamingSequenceSettings = ServerStreamingCallSettings.newBuilder(); + listLocationsSettings = PagedCallSettings.newBuilder(LIST_LOCATIONS_PAGE_STR_FACT); + getLocationSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + setIamPolicySettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + getIamPolicySettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + testIamPermissionsSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + createSequenceSettings, + createStreamingSequenceSettings, + getSequenceReportSettings, + getStreamingSequenceReportSettings, + attemptSequenceSettings, + listLocationsSettings, + getLocationSettings, + setIamPolicySettings, + getIamPolicySettings, + testIamPermissionsSettings); + initDefaults(this); + } + + protected Builder(SequenceServiceStubSettings settings) { + super(settings); + + createSequenceSettings = settings.createSequenceSettings.toBuilder(); + createStreamingSequenceSettings = settings.createStreamingSequenceSettings.toBuilder(); + getSequenceReportSettings = settings.getSequenceReportSettings.toBuilder(); + getStreamingSequenceReportSettings = settings.getStreamingSequenceReportSettings.toBuilder(); + attemptSequenceSettings = settings.attemptSequenceSettings.toBuilder(); + attemptStreamingSequenceSettings = settings.attemptStreamingSequenceSettings.toBuilder(); + listLocationsSettings = settings.listLocationsSettings.toBuilder(); + getLocationSettings = settings.getLocationSettings.toBuilder(); + setIamPolicySettings = settings.setIamPolicySettings.toBuilder(); + getIamPolicySettings = settings.getIamPolicySettings.toBuilder(); + testIamPermissionsSettings = settings.testIamPermissionsSettings.toBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + createSequenceSettings, + createStreamingSequenceSettings, + getSequenceReportSettings, + getStreamingSequenceReportSettings, + attemptSequenceSettings, + listLocationsSettings, + getLocationSettings, + setIamPolicySettings, + getIamPolicySettings, + testIamPermissionsSettings); + } + + 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 createHttpJsonDefault() { + Builder builder = new Builder(((ClientContext) null)); + + builder.setTransportChannelProvider(defaultHttpJsonTransportProviderBuilder().build()); + builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); + builder.setInternalHeaderProvider(defaultHttpJsonApiClientHeaderProviderBuilder().build()); + builder.setMtlsEndpoint(getDefaultMtlsEndpoint()); + builder.setSwitchToMtlsEndpointAllowed(true); + + return initDefaults(builder); + } + + private static Builder initDefaults(Builder builder) { + builder + .createSequenceSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + + builder + .createStreamingSequenceSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + + builder + .getSequenceReportSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + + builder + .getStreamingSequenceReportSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + + builder + .attemptSequenceSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")); + + builder + .attemptStreamingSequenceSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + + builder + .listLocationsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + + builder + .getLocationSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + + builder + .setIamPolicySettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + + builder + .getIamPolicySettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + + builder + .testIamPermissionsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + + return builder; + } + + /** + * Applies the given settings updater function to all of the unary API methods in this service. + * + *

        Note: This method does not support applying settings to streaming methods. + */ + public Builder applyToAllUnaryMethods( + ApiFunction, Void> settingsUpdater) { + super.applyToAllUnaryMethods(unaryMethodSettingsBuilders, settingsUpdater); + return this; + } + + public ImmutableList> unaryMethodSettingsBuilders() { + return unaryMethodSettingsBuilders; + } + + /** Returns the builder for the settings used for calls to createSequence. */ + public UnaryCallSettings.Builder createSequenceSettings() { + return createSequenceSettings; + } + + /** Returns the builder for the settings used for calls to createStreamingSequence. */ + public UnaryCallSettings.Builder + createStreamingSequenceSettings() { + return createStreamingSequenceSettings; + } + + /** Returns the builder for the settings used for calls to getSequenceReport. */ + public UnaryCallSettings.Builder + getSequenceReportSettings() { + return getSequenceReportSettings; + } + + /** Returns the builder for the settings used for calls to getStreamingSequenceReport. */ + public UnaryCallSettings.Builder + getStreamingSequenceReportSettings() { + return getStreamingSequenceReportSettings; + } + + /** Returns the builder for the settings used for calls to attemptSequence. */ + public UnaryCallSettings.Builder attemptSequenceSettings() { + return attemptSequenceSettings; + } + + /** Returns the builder for the settings used for calls to attemptStreamingSequence. */ + public ServerStreamingCallSettings.Builder< + AttemptStreamingSequenceRequest, AttemptStreamingSequenceResponse> + attemptStreamingSequenceSettings() { + return attemptStreamingSequenceSettings; + } + + /** Returns the builder for the settings used for calls to listLocations. */ + public PagedCallSettings.Builder< + ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse> + listLocationsSettings() { + return listLocationsSettings; + } + + /** Returns the builder for the settings used for calls to getLocation. */ + public UnaryCallSettings.Builder getLocationSettings() { + return getLocationSettings; + } + + /** Returns the builder for the settings used for calls to setIamPolicy. */ + public UnaryCallSettings.Builder setIamPolicySettings() { + return setIamPolicySettings; + } + + /** Returns the builder for the settings used for calls to getIamPolicy. */ + public UnaryCallSettings.Builder getIamPolicySettings() { + return getIamPolicySettings; + } + + /** Returns the builder for the settings used for calls to testIamPermissions. */ + public UnaryCallSettings.Builder + testIamPermissionsSettings() { + return testIamPermissionsSettings; + } + + @Override + public SequenceServiceStubSettings build() throws IOException { + return new SequenceServiceStubSettings(this); + } + } +} diff --git a/java-showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/TestingStub.java b/java-showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/TestingStub.java new file mode 100644 index 0000000000..92b4a42f59 --- /dev/null +++ b/java-showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/TestingStub.java @@ -0,0 +1,129 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.stub; + +import static com.google.showcase.v1beta1.TestingClient.ListLocationsPagedResponse; +import static com.google.showcase.v1beta1.TestingClient.ListSessionsPagedResponse; +import static com.google.showcase.v1beta1.TestingClient.ListTestsPagedResponse; + +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.protobuf.Empty; +import com.google.showcase.v1beta1.CreateSessionRequest; +import com.google.showcase.v1beta1.DeleteSessionRequest; +import com.google.showcase.v1beta1.DeleteTestRequest; +import com.google.showcase.v1beta1.GetSessionRequest; +import com.google.showcase.v1beta1.ListSessionsRequest; +import com.google.showcase.v1beta1.ListSessionsResponse; +import com.google.showcase.v1beta1.ListTestsRequest; +import com.google.showcase.v1beta1.ListTestsResponse; +import com.google.showcase.v1beta1.ReportSessionRequest; +import com.google.showcase.v1beta1.ReportSessionResponse; +import com.google.showcase.v1beta1.Session; +import com.google.showcase.v1beta1.VerifyTestRequest; +import com.google.showcase.v1beta1.VerifyTestResponse; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Base stub class for the Testing service API. + * + *

        This class is for advanced usage and reflects the underlying API directly. + */ +@BetaApi +@Generated("by gapic-generator-java") +public abstract class TestingStub implements BackgroundResource { + + public UnaryCallable createSessionCallable() { + throw new UnsupportedOperationException("Not implemented: createSessionCallable()"); + } + + public UnaryCallable getSessionCallable() { + throw new UnsupportedOperationException("Not implemented: getSessionCallable()"); + } + + public UnaryCallable listSessionsPagedCallable() { + throw new UnsupportedOperationException("Not implemented: listSessionsPagedCallable()"); + } + + public UnaryCallable listSessionsCallable() { + throw new UnsupportedOperationException("Not implemented: listSessionsCallable()"); + } + + public UnaryCallable deleteSessionCallable() { + throw new UnsupportedOperationException("Not implemented: deleteSessionCallable()"); + } + + public UnaryCallable reportSessionCallable() { + throw new UnsupportedOperationException("Not implemented: reportSessionCallable()"); + } + + public UnaryCallable listTestsPagedCallable() { + throw new UnsupportedOperationException("Not implemented: listTestsPagedCallable()"); + } + + public UnaryCallable listTestsCallable() { + throw new UnsupportedOperationException("Not implemented: listTestsCallable()"); + } + + public UnaryCallable deleteTestCallable() { + throw new UnsupportedOperationException("Not implemented: deleteTestCallable()"); + } + + public UnaryCallable verifyTestCallable() { + throw new UnsupportedOperationException("Not implemented: verifyTestCallable()"); + } + + public UnaryCallable + listLocationsPagedCallable() { + throw new UnsupportedOperationException("Not implemented: listLocationsPagedCallable()"); + } + + public UnaryCallable listLocationsCallable() { + throw new UnsupportedOperationException("Not implemented: listLocationsCallable()"); + } + + public UnaryCallable getLocationCallable() { + throw new UnsupportedOperationException("Not implemented: getLocationCallable()"); + } + + public UnaryCallable setIamPolicyCallable() { + throw new UnsupportedOperationException("Not implemented: setIamPolicyCallable()"); + } + + public UnaryCallable getIamPolicyCallable() { + throw new UnsupportedOperationException("Not implemented: getIamPolicyCallable()"); + } + + public UnaryCallable + testIamPermissionsCallable() { + throw new UnsupportedOperationException("Not implemented: testIamPermissionsCallable()"); + } + + @Override + public abstract void close(); +} diff --git a/java-showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/TestingStubSettings.java b/java-showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/TestingStubSettings.java new file mode 100644 index 0000000000..55bde4b66e --- /dev/null +++ b/java-showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/TestingStubSettings.java @@ -0,0 +1,812 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.stub; + +import static com.google.showcase.v1beta1.TestingClient.ListLocationsPagedResponse; +import static com.google.showcase.v1beta1.TestingClient.ListSessionsPagedResponse; +import static com.google.showcase.v1beta1.TestingClient.ListTestsPagedResponse; + +import com.google.api.core.ApiFunction; +import com.google.api.core.ApiFuture; +import com.google.api.core.BetaApi; +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.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.HttpJsonTransportChannel; +import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; +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.LibraryMetadata; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.PagedListDescriptor; +import com.google.api.gax.rpc.PagedListResponseFactory; +import com.google.api.gax.rpc.StatusCode; +import com.google.api.gax.rpc.StubSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +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.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.protobuf.Empty; +import com.google.showcase.v1beta1.CreateSessionRequest; +import com.google.showcase.v1beta1.DeleteSessionRequest; +import com.google.showcase.v1beta1.DeleteTestRequest; +import com.google.showcase.v1beta1.GetSessionRequest; +import com.google.showcase.v1beta1.ListSessionsRequest; +import com.google.showcase.v1beta1.ListSessionsResponse; +import com.google.showcase.v1beta1.ListTestsRequest; +import com.google.showcase.v1beta1.ListTestsResponse; +import com.google.showcase.v1beta1.ReportSessionRequest; +import com.google.showcase.v1beta1.ReportSessionResponse; +import com.google.showcase.v1beta1.Session; +import com.google.showcase.v1beta1.Test; +import com.google.showcase.v1beta1.VerifyTestRequest; +import com.google.showcase.v1beta1.VerifyTestResponse; +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 TestingStub}. + * + *

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

          + *
        • The default service address (localhost) and default port (7469) 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 createSession: + * + *

        {@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
        + * TestingStubSettings.Builder testingSettingsBuilder = TestingStubSettings.newBuilder();
        + * testingSettingsBuilder
        + *     .createSessionSettings()
        + *     .setRetrySettings(
        + *         testingSettingsBuilder
        + *             .createSessionSettings()
        + *             .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());
        + * TestingStubSettings testingSettings = testingSettingsBuilder.build();
        + * }
        + * + * Please refer to the [Client Side Retry + * Guide](https://docs.cloud.google.com/java/docs/client-retries) for additional support in setting + * retries. + */ +@BetaApi +@Generated("by gapic-generator-java") +@SuppressWarnings("CanonicalDuration") +public class TestingStubSettings extends StubSettings { + /** The default scopes of the service. */ + private static final ImmutableList DEFAULT_SERVICE_SCOPES = + ImmutableList.builder().build(); + + private final UnaryCallSettings createSessionSettings; + private final UnaryCallSettings getSessionSettings; + private final PagedCallSettings< + ListSessionsRequest, ListSessionsResponse, ListSessionsPagedResponse> + listSessionsSettings; + private final UnaryCallSettings deleteSessionSettings; + private final UnaryCallSettings + reportSessionSettings; + private final PagedCallSettings + listTestsSettings; + private final UnaryCallSettings deleteTestSettings; + private final UnaryCallSettings verifyTestSettings; + private final PagedCallSettings< + ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse> + listLocationsSettings; + private final UnaryCallSettings getLocationSettings; + private final UnaryCallSettings setIamPolicySettings; + private final UnaryCallSettings getIamPolicySettings; + private final UnaryCallSettings + testIamPermissionsSettings; + + private static final PagedListDescriptor + LIST_SESSIONS_PAGE_STR_DESC = + new PagedListDescriptor() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public ListSessionsRequest injectToken(ListSessionsRequest payload, String token) { + return ListSessionsRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public ListSessionsRequest injectPageSize(ListSessionsRequest payload, int pageSize) { + return ListSessionsRequest.newBuilder(payload).setPageSize(pageSize).build(); + } + + @Override + public Integer extractPageSize(ListSessionsRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(ListSessionsResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources(ListSessionsResponse payload) { + return payload.getSessionsList(); + } + }; + + private static final PagedListDescriptor + LIST_TESTS_PAGE_STR_DESC = + new PagedListDescriptor() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public ListTestsRequest injectToken(ListTestsRequest payload, String token) { + return ListTestsRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public ListTestsRequest injectPageSize(ListTestsRequest payload, int pageSize) { + return ListTestsRequest.newBuilder(payload).setPageSize(pageSize).build(); + } + + @Override + public Integer extractPageSize(ListTestsRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(ListTestsResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources(ListTestsResponse payload) { + return payload.getTestsList(); + } + }; + + private static final PagedListDescriptor + LIST_LOCATIONS_PAGE_STR_DESC = + new PagedListDescriptor() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public ListLocationsRequest injectToken(ListLocationsRequest payload, String token) { + return ListLocationsRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public ListLocationsRequest injectPageSize(ListLocationsRequest payload, int pageSize) { + return ListLocationsRequest.newBuilder(payload).setPageSize(pageSize).build(); + } + + @Override + public Integer extractPageSize(ListLocationsRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(ListLocationsResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources(ListLocationsResponse payload) { + return payload.getLocationsList(); + } + }; + + private static final PagedListResponseFactory< + ListSessionsRequest, ListSessionsResponse, ListSessionsPagedResponse> + LIST_SESSIONS_PAGE_STR_FACT = + new PagedListResponseFactory< + ListSessionsRequest, ListSessionsResponse, ListSessionsPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListSessionsRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext pageContext = + PageContext.create(callable, LIST_SESSIONS_PAGE_STR_DESC, request, context); + return ListSessionsPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + private static final PagedListResponseFactory< + ListTestsRequest, ListTestsResponse, ListTestsPagedResponse> + LIST_TESTS_PAGE_STR_FACT = + new PagedListResponseFactory< + ListTestsRequest, ListTestsResponse, ListTestsPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListTestsRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext pageContext = + PageContext.create(callable, LIST_TESTS_PAGE_STR_DESC, request, context); + return ListTestsPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + private static final PagedListResponseFactory< + ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse> + LIST_LOCATIONS_PAGE_STR_FACT = + new PagedListResponseFactory< + ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListLocationsRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext pageContext = + PageContext.create(callable, LIST_LOCATIONS_PAGE_STR_DESC, request, context); + return ListLocationsPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + /** Returns the object with the settings used for calls to createSession. */ + public UnaryCallSettings createSessionSettings() { + return createSessionSettings; + } + + /** Returns the object with the settings used for calls to getSession. */ + public UnaryCallSettings getSessionSettings() { + return getSessionSettings; + } + + /** Returns the object with the settings used for calls to listSessions. */ + public PagedCallSettings + listSessionsSettings() { + return listSessionsSettings; + } + + /** Returns the object with the settings used for calls to deleteSession. */ + public UnaryCallSettings deleteSessionSettings() { + return deleteSessionSettings; + } + + /** Returns the object with the settings used for calls to reportSession. */ + public UnaryCallSettings reportSessionSettings() { + return reportSessionSettings; + } + + /** Returns the object with the settings used for calls to listTests. */ + public PagedCallSettings + listTestsSettings() { + return listTestsSettings; + } + + /** Returns the object with the settings used for calls to deleteTest. */ + public UnaryCallSettings deleteTestSettings() { + return deleteTestSettings; + } + + /** Returns the object with the settings used for calls to verifyTest. */ + public UnaryCallSettings verifyTestSettings() { + return verifyTestSettings; + } + + /** Returns the object with the settings used for calls to listLocations. */ + public PagedCallSettings + listLocationsSettings() { + return listLocationsSettings; + } + + /** Returns the object with the settings used for calls to getLocation. */ + public UnaryCallSettings getLocationSettings() { + return getLocationSettings; + } + + /** Returns the object with the settings used for calls to setIamPolicy. */ + public UnaryCallSettings setIamPolicySettings() { + return setIamPolicySettings; + } + + /** Returns the object with the settings used for calls to getIamPolicy. */ + public UnaryCallSettings getIamPolicySettings() { + return getIamPolicySettings; + } + + /** Returns the object with the settings used for calls to testIamPermissions. */ + public UnaryCallSettings + testIamPermissionsSettings() { + return testIamPermissionsSettings; + } + + public TestingStub createStub() throws IOException { + if (getTransportChannelProvider() + .getTransportName() + .equals(GrpcTransportChannel.getGrpcTransportName())) { + return GrpcTestingStub.create(this); + } + if (getTransportChannelProvider() + .getTransportName() + .equals(HttpJsonTransportChannel.getHttpJsonTransportName())) { + return HttpJsonTestingStub.create(this); + } + throw new UnsupportedOperationException( + String.format( + "Transport not supported: %s", getTransportChannelProvider().getTransportName())); + } + + /** Returns a builder for the default ExecutorProvider for this service. */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return InstantiatingExecutorProvider.newBuilder(); + } + + /** Returns the default service endpoint. */ + @ObsoleteApi("Use getEndpoint() instead") + public static String getDefaultEndpoint() { + return "localhost:7469"; + } + + /** Returns the default mTLS service endpoint. */ + public static String getDefaultMtlsEndpoint() { + return "localhost:7469"; + } + + /** 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 gRPC ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return InstantiatingGrpcChannelProvider.newBuilder() + .setMaxInboundMessageSize(Integer.MAX_VALUE); + } + + /** Returns a builder for the default REST ChannelProvider for this service. */ + @BetaApi + public static InstantiatingHttpJsonChannelProvider.Builder + defaultHttpJsonTransportProviderBuilder() { + return InstantiatingHttpJsonChannelProvider.newBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return defaultGrpcTransportProviderBuilder().build(); + } + + public static ApiClientHeaderProvider.Builder defaultGrpcApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken("gapic", GaxProperties.getLibraryVersion(TestingStubSettings.class)) + .setTransportToken( + GaxGrpcProperties.getGrpcTokenName(), GaxGrpcProperties.getGrpcVersion()); + } + + public static ApiClientHeaderProvider.Builder defaultHttpJsonApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken("gapic", GaxProperties.getLibraryVersion(TestingStubSettings.class)) + .setTransportToken( + GaxHttpJsonProperties.getHttpJsonTokenName(), + GaxHttpJsonProperties.getHttpJsonVersion()); + } + + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return TestingStubSettings.defaultGrpcApiClientHeaderProviderBuilder(); + } + + /** Returns a new gRPC builder for this class. */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** Returns a new REST builder for this class. */ + public static Builder newHttpJsonBuilder() { + return Builder.createHttpJsonDefault(); + } + + /** 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 TestingStubSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + + createSessionSettings = settingsBuilder.createSessionSettings().build(); + getSessionSettings = settingsBuilder.getSessionSettings().build(); + listSessionsSettings = settingsBuilder.listSessionsSettings().build(); + deleteSessionSettings = settingsBuilder.deleteSessionSettings().build(); + reportSessionSettings = settingsBuilder.reportSessionSettings().build(); + listTestsSettings = settingsBuilder.listTestsSettings().build(); + deleteTestSettings = settingsBuilder.deleteTestSettings().build(); + verifyTestSettings = settingsBuilder.verifyTestSettings().build(); + listLocationsSettings = settingsBuilder.listLocationsSettings().build(); + getLocationSettings = settingsBuilder.getLocationSettings().build(); + setIamPolicySettings = settingsBuilder.setIamPolicySettings().build(); + getIamPolicySettings = settingsBuilder.getIamPolicySettings().build(); + testIamPermissionsSettings = settingsBuilder.testIamPermissionsSettings().build(); + } + + @Override + protected LibraryMetadata getLibraryMetadata() { + return LibraryMetadata.newBuilder() + .setArtifactName("com.google.cloud:gapic-showcase") + .setRepository("googleapis/sdk-platform-java") + .setVersion(Version.VERSION) + .build(); + } + + /** Builder for TestingStubSettings. */ + public static class Builder extends StubSettings.Builder { + private final ImmutableList> unaryMethodSettingsBuilders; + private final UnaryCallSettings.Builder createSessionSettings; + private final UnaryCallSettings.Builder getSessionSettings; + private final PagedCallSettings.Builder< + ListSessionsRequest, ListSessionsResponse, ListSessionsPagedResponse> + listSessionsSettings; + private final UnaryCallSettings.Builder deleteSessionSettings; + private final UnaryCallSettings.Builder + reportSessionSettings; + private final PagedCallSettings.Builder< + ListTestsRequest, ListTestsResponse, ListTestsPagedResponse> + listTestsSettings; + private final UnaryCallSettings.Builder deleteTestSettings; + private final UnaryCallSettings.Builder + verifyTestSettings; + private final PagedCallSettings.Builder< + ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse> + listLocationsSettings; + private final UnaryCallSettings.Builder getLocationSettings; + private final UnaryCallSettings.Builder setIamPolicySettings; + private final UnaryCallSettings.Builder getIamPolicySettings; + private final UnaryCallSettings.Builder + testIamPermissionsSettings; + private static final ImmutableMap> + RETRYABLE_CODE_DEFINITIONS; + + static { + ImmutableMap.Builder> definitions = + ImmutableMap.builder(); + definitions.put("no_retry_codes", ImmutableSet.copyOf(Lists.newArrayList())); + RETRYABLE_CODE_DEFINITIONS = definitions.build(); + } + + private static final ImmutableMap RETRY_PARAM_DEFINITIONS; + + static { + ImmutableMap.Builder definitions = ImmutableMap.builder(); + RetrySettings settings = null; + settings = RetrySettings.newBuilder().setRpcTimeoutMultiplier(1.0).build(); + definitions.put("no_retry_params", settings); + RETRY_PARAM_DEFINITIONS = definitions.build(); + } + + protected Builder() { + this(((ClientContext) null)); + } + + protected Builder(ClientContext clientContext) { + super(clientContext); + + createSessionSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + getSessionSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + listSessionsSettings = PagedCallSettings.newBuilder(LIST_SESSIONS_PAGE_STR_FACT); + deleteSessionSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + reportSessionSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + listTestsSettings = PagedCallSettings.newBuilder(LIST_TESTS_PAGE_STR_FACT); + deleteTestSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + verifyTestSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + listLocationsSettings = PagedCallSettings.newBuilder(LIST_LOCATIONS_PAGE_STR_FACT); + getLocationSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + setIamPolicySettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + getIamPolicySettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + testIamPermissionsSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + createSessionSettings, + getSessionSettings, + listSessionsSettings, + deleteSessionSettings, + reportSessionSettings, + listTestsSettings, + deleteTestSettings, + verifyTestSettings, + listLocationsSettings, + getLocationSettings, + setIamPolicySettings, + getIamPolicySettings, + testIamPermissionsSettings); + initDefaults(this); + } + + protected Builder(TestingStubSettings settings) { + super(settings); + + createSessionSettings = settings.createSessionSettings.toBuilder(); + getSessionSettings = settings.getSessionSettings.toBuilder(); + listSessionsSettings = settings.listSessionsSettings.toBuilder(); + deleteSessionSettings = settings.deleteSessionSettings.toBuilder(); + reportSessionSettings = settings.reportSessionSettings.toBuilder(); + listTestsSettings = settings.listTestsSettings.toBuilder(); + deleteTestSettings = settings.deleteTestSettings.toBuilder(); + verifyTestSettings = settings.verifyTestSettings.toBuilder(); + listLocationsSettings = settings.listLocationsSettings.toBuilder(); + getLocationSettings = settings.getLocationSettings.toBuilder(); + setIamPolicySettings = settings.setIamPolicySettings.toBuilder(); + getIamPolicySettings = settings.getIamPolicySettings.toBuilder(); + testIamPermissionsSettings = settings.testIamPermissionsSettings.toBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + createSessionSettings, + getSessionSettings, + listSessionsSettings, + deleteSessionSettings, + reportSessionSettings, + listTestsSettings, + deleteTestSettings, + verifyTestSettings, + listLocationsSettings, + getLocationSettings, + setIamPolicySettings, + getIamPolicySettings, + testIamPermissionsSettings); + } + + 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 createHttpJsonDefault() { + Builder builder = new Builder(((ClientContext) null)); + + builder.setTransportChannelProvider(defaultHttpJsonTransportProviderBuilder().build()); + builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); + builder.setInternalHeaderProvider(defaultHttpJsonApiClientHeaderProviderBuilder().build()); + builder.setMtlsEndpoint(getDefaultMtlsEndpoint()); + builder.setSwitchToMtlsEndpointAllowed(true); + + return initDefaults(builder); + } + + private static Builder initDefaults(Builder builder) { + builder + .createSessionSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .getSessionSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .listSessionsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .deleteSessionSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .reportSessionSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .listTestsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .deleteTestSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .verifyTestSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .listLocationsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .getLocationSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .setIamPolicySettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .getIamPolicySettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .testIamPermissionsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_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 createSession. */ + public UnaryCallSettings.Builder createSessionSettings() { + return createSessionSettings; + } + + /** Returns the builder for the settings used for calls to getSession. */ + public UnaryCallSettings.Builder getSessionSettings() { + return getSessionSettings; + } + + /** Returns the builder for the settings used for calls to listSessions. */ + public PagedCallSettings.Builder< + ListSessionsRequest, ListSessionsResponse, ListSessionsPagedResponse> + listSessionsSettings() { + return listSessionsSettings; + } + + /** Returns the builder for the settings used for calls to deleteSession. */ + public UnaryCallSettings.Builder deleteSessionSettings() { + return deleteSessionSettings; + } + + /** Returns the builder for the settings used for calls to reportSession. */ + public UnaryCallSettings.Builder + reportSessionSettings() { + return reportSessionSettings; + } + + /** Returns the builder for the settings used for calls to listTests. */ + public PagedCallSettings.Builder + listTestsSettings() { + return listTestsSettings; + } + + /** Returns the builder for the settings used for calls to deleteTest. */ + public UnaryCallSettings.Builder deleteTestSettings() { + return deleteTestSettings; + } + + /** Returns the builder for the settings used for calls to verifyTest. */ + public UnaryCallSettings.Builder verifyTestSettings() { + return verifyTestSettings; + } + + /** Returns the builder for the settings used for calls to listLocations. */ + public PagedCallSettings.Builder< + ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse> + listLocationsSettings() { + return listLocationsSettings; + } + + /** Returns the builder for the settings used for calls to getLocation. */ + public UnaryCallSettings.Builder getLocationSettings() { + return getLocationSettings; + } + + /** Returns the builder for the settings used for calls to setIamPolicy. */ + public UnaryCallSettings.Builder setIamPolicySettings() { + return setIamPolicySettings; + } + + /** Returns the builder for the settings used for calls to getIamPolicy. */ + public UnaryCallSettings.Builder getIamPolicySettings() { + return getIamPolicySettings; + } + + /** Returns the builder for the settings used for calls to testIamPermissions. */ + public UnaryCallSettings.Builder + testIamPermissionsSettings() { + return testIamPermissionsSettings; + } + + @Override + public TestingStubSettings build() throws IOException { + return new TestingStubSettings(this); + } + } +} diff --git a/java-showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/Version.java b/java-showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/Version.java new file mode 100644 index 0000000000..4009043dd5 --- /dev/null +++ b/java-showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/Version.java @@ -0,0 +1,27 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.stub; + +import com.google.api.core.InternalApi; + +@InternalApi("For internal use only") +final class Version { + // {x-version-update-start:gapic-showcase:current} + static final String VERSION = "0.0.0-SNAPSHOT"; + // {x-version-update-end} + +} diff --git a/java-showcase/gapic-showcase/src/main/resources/META-INF/native-image/com.google.showcase.v1beta1/reflect-config.json b/java-showcase/gapic-showcase/src/main/resources/META-INF/native-image/com.google.showcase.v1beta1/reflect-config.json new file mode 100644 index 0000000000..55863aee26 --- /dev/null +++ b/java-showcase/gapic-showcase/src/main/resources/META-INF/native-image/com.google.showcase.v1beta1/reflect-config.json @@ -0,0 +1,3926 @@ +[ + { + "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.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.FieldInfo", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.FieldInfo$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.FieldInfo$Format", + "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.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.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.RoutingParameter", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.RoutingParameter$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.RoutingRule", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.RoutingRule$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.api.TypeReference", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.TypeReference$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.location.GetLocationRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.location.GetLocationRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.location.ListLocationsRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.location.ListLocationsRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.location.ListLocationsResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.location.ListLocationsResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.location.Location", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.location.Location$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.iam.v1.AuditConfig", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.iam.v1.AuditConfig$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.iam.v1.AuditConfigDelta", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.iam.v1.AuditConfigDelta$Action", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.iam.v1.AuditConfigDelta$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.iam.v1.AuditLogConfig", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.iam.v1.AuditLogConfig$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.iam.v1.AuditLogConfig$LogType", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.iam.v1.Binding", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.iam.v1.Binding$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.iam.v1.BindingDelta", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.iam.v1.BindingDelta$Action", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.iam.v1.BindingDelta$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.iam.v1.GetIamPolicyRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.iam.v1.GetIamPolicyRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.iam.v1.GetPolicyOptions", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.iam.v1.GetPolicyOptions$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.iam.v1.Policy", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.iam.v1.Policy$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.iam.v1.PolicyDelta", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.iam.v1.PolicyDelta$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.iam.v1.SetIamPolicyRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.iam.v1.SetIamPolicyRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.iam.v1.TestIamPermissionsRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.iam.v1.TestIamPermissionsRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.iam.v1.TestIamPermissionsResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.iam.v1.TestIamPermissionsResponse$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$EnforceNamingStyle", + "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$FeatureSet$VisibilityFeature", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FeatureSet$VisibilityFeature$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FeatureSet$VisibilityFeature$DefaultSymbolVisibility", + "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$FeatureSupport", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FieldOptions$FeatureSupport$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$SymbolVisibility", + "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.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.rpc.BadRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.rpc.BadRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.rpc.BadRequest$FieldViolation", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.rpc.BadRequest$FieldViolation$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.rpc.Code", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.rpc.DebugInfo", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.rpc.DebugInfo$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.rpc.ErrorInfo", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.rpc.ErrorInfo$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.rpc.Help", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.rpc.Help$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.rpc.Help$Link", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.rpc.Help$Link$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.rpc.LocalizedMessage", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.rpc.LocalizedMessage$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.rpc.PreconditionFailure", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.rpc.PreconditionFailure$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.rpc.PreconditionFailure$Violation", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.rpc.PreconditionFailure$Violation$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.rpc.QuotaFailure", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.rpc.QuotaFailure$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.rpc.QuotaFailure$Violation", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.rpc.QuotaFailure$Violation$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.rpc.RequestInfo", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.rpc.RequestInfo$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.rpc.ResourceInfo", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.rpc.ResourceInfo$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.rpc.RetryInfo", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.rpc.RetryInfo$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 + }, + { + "name": "com.google.showcase.v1beta1.AttemptSequenceRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.AttemptSequenceRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.AttemptStreamingSequenceRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.AttemptStreamingSequenceRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.AttemptStreamingSequenceResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.AttemptStreamingSequenceResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.BlockRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.BlockRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.BlockResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.BlockResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.Blurb", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.Blurb$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.ComplianceData", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.ComplianceData$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.ComplianceData$LifeKingdom", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.ComplianceDataChild", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.ComplianceDataChild$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.ComplianceDataGrandchild", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.ComplianceDataGrandchild$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.ComplianceGroup", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.ComplianceGroup$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.ComplianceSuite", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.ComplianceSuite$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.ConnectRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.ConnectRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.ConnectRequest$ConnectConfig", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.ConnectRequest$ConnectConfig$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.Continent", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.CreateBlurbRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.CreateBlurbRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.CreateRoomRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.CreateRoomRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.CreateSequenceRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.CreateSequenceRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.CreateSessionRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.CreateSessionRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.CreateStreamingSequenceRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.CreateStreamingSequenceRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.CreateUserRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.CreateUserRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.DeleteBlurbRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.DeleteBlurbRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.DeleteRoomRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.DeleteRoomRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.DeleteSessionRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.DeleteSessionRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.DeleteTestRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.DeleteTestRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.DeleteUserRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.DeleteUserRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.EchoErrorDetailsRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.EchoErrorDetailsRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.EchoErrorDetailsResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.EchoErrorDetailsResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.EchoErrorDetailsResponse$MultipleDetails", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.EchoErrorDetailsResponse$MultipleDetails$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.EchoErrorDetailsResponse$SingleDetail", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.EchoErrorDetailsResponse$SingleDetail$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.EchoRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.EchoRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.EchoResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.EchoResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.EnumRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.EnumRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.EnumResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.EnumResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.ErrorWithMultipleDetails", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.ErrorWithMultipleDetails$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.ErrorWithSingleDetail", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.ErrorWithSingleDetail$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.ExpandRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.ExpandRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.FailEchoWithDetailsRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.FailEchoWithDetailsRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.FailEchoWithDetailsResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.FailEchoWithDetailsResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.GetBlurbRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.GetBlurbRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.GetRoomRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.GetRoomRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.GetSequenceReportRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.GetSequenceReportRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.GetSessionRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.GetSessionRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.GetStreamingSequenceReportRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.GetStreamingSequenceReportRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.GetUserRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.GetUserRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.Issue", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.Issue$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.Issue$Severity", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.Issue$Type", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.ListBlurbsRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.ListBlurbsRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.ListBlurbsResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.ListBlurbsResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.ListRoomsRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.ListRoomsRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.ListRoomsResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.ListRoomsResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.ListSessionsRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.ListSessionsRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.ListSessionsResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.ListSessionsResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.ListTestsRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.ListTestsRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.ListTestsResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.ListTestsResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.ListUsersRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.ListUsersRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.ListUsersResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.ListUsersResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.PagedExpandLegacyMappedResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.PagedExpandLegacyMappedResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.PagedExpandLegacyRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.PagedExpandLegacyRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.PagedExpandRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.PagedExpandRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.PagedExpandResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.PagedExpandResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.PagedExpandResponseList", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.PagedExpandResponseList$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.PoetryError", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.PoetryError$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.RepeatRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.RepeatRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.RepeatResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.RepeatResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.ReportSessionRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.ReportSessionRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.ReportSessionResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.ReportSessionResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.ReportSessionResponse$Result", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.RestError", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.RestError$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.RestError$Status", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.RestError$Status$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.Room", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.Room$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.SearchBlurbsMetadata", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.SearchBlurbsMetadata$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.SearchBlurbsRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.SearchBlurbsRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.SearchBlurbsResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.SearchBlurbsResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.SendBlurbsResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.SendBlurbsResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.Sequence", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.Sequence$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.Sequence$Response", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.Sequence$Response$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.SequenceReport", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.SequenceReport$Attempt", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.SequenceReport$Attempt$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.SequenceReport$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.Session", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.Session$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.Session$Version", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.Severity", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.StreamBlurbsRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.StreamBlurbsRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.StreamBlurbsResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.StreamBlurbsResponse$Action", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.StreamBlurbsResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.StreamingSequence", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.StreamingSequence$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.StreamingSequence$Response", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.StreamingSequence$Response$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.StreamingSequenceReport", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.StreamingSequenceReport$Attempt", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.StreamingSequenceReport$Attempt$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.StreamingSequenceReport$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.Test", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.Test$Blueprint", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.Test$Blueprint$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.Test$Blueprint$Invocation", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.Test$Blueprint$Invocation$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.Test$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.Test$ExpectationLevel", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.TestRun", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.TestRun$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.UpdateBlurbRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.UpdateBlurbRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.UpdateRoomRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.UpdateRoomRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.UpdateUserRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.UpdateUserRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.User", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.User$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.VerifyTestRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.VerifyTestRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.VerifyTestResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.VerifyTestResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.WaitMetadata", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.WaitMetadata$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.WaitRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.WaitRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.WaitResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.WaitResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.type.Expr", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.type.Expr$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + } +] \ No newline at end of file diff --git a/java-showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/ComplianceClientHttpJsonTest.java b/java-showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/ComplianceClientHttpJsonTest.java new file mode 100644 index 0000000000..39767b4ae8 --- /dev/null +++ b/java-showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/ComplianceClientHttpJsonTest.java @@ -0,0 +1,1215 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1; + +import static com.google.showcase.v1beta1.ComplianceClient.ListLocationsPagedResponse; + +import com.google.api.gax.core.NoCredentialsProvider; +import com.google.api.gax.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.testing.MockHttpService; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ApiException; +import com.google.api.gax.rpc.ApiExceptionFactory; +import com.google.api.gax.rpc.InvalidArgumentException; +import com.google.api.gax.rpc.StatusCode; +import com.google.api.gax.rpc.testing.FakeStatusCode; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.common.collect.Lists; +import com.google.iam.v1.AuditConfig; +import com.google.iam.v1.Binding; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.GetPolicyOptions; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.protobuf.Any; +import com.google.protobuf.ByteString; +import com.google.protobuf.FieldMask; +import com.google.showcase.v1beta1.stub.HttpJsonComplianceStub; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +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 ComplianceClientHttpJsonTest { + private static MockHttpService mockService; + private static ComplianceClient client; + + @BeforeClass + public static void startStaticServer() throws IOException { + mockService = + new MockHttpService( + HttpJsonComplianceStub.getMethodDescriptors(), ComplianceSettings.getDefaultEndpoint()); + ComplianceSettings settings = + ComplianceSettings.newHttpJsonBuilder() + .setTransportChannelProvider( + ComplianceSettings.defaultHttpJsonTransportProviderBuilder() + .setHttpTransport(mockService) + .build()) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = ComplianceClient.create(settings); + } + + @AfterClass + public static void stopServer() { + client.close(); + } + + @Before + public void setUp() {} + + @After + public void tearDown() throws Exception { + mockService.reset(); + } + + @Test + public void repeatDataBodyTest() throws Exception { + RepeatResponse expectedResponse = + RepeatResponse.newBuilder() + .setRequest(RepeatRequest.newBuilder().build()) + .setBindingUri("bindingUri1514820775") + .build(); + mockService.addResponse(expectedResponse); + + RepeatRequest request = + RepeatRequest.newBuilder() + .setName("name3373707") + .setInfo(ComplianceData.newBuilder().build()) + .setServerVerify(true) + .setIntendedBindingUri("intendedBindingUri780142386") + .setFInt32(-1143775883) + .setFInt64(-1143775788) + .setFDouble(-1239459382) + .setPInt32(-858673665) + .setPInt64(-858673570) + .setPDouble(-991225216) + .build(); + + RepeatResponse actualResponse = client.repeatDataBody(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void repeatDataBodyExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + RepeatRequest request = + RepeatRequest.newBuilder() + .setName("name3373707") + .setInfo(ComplianceData.newBuilder().build()) + .setServerVerify(true) + .setIntendedBindingUri("intendedBindingUri780142386") + .setFInt32(-1143775883) + .setFInt64(-1143775788) + .setFDouble(-1239459382) + .setPInt32(-858673665) + .setPInt64(-858673570) + .setPDouble(-991225216) + .build(); + client.repeatDataBody(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void repeatDataBodyInfoTest() throws Exception { + RepeatResponse expectedResponse = + RepeatResponse.newBuilder() + .setRequest(RepeatRequest.newBuilder().build()) + .setBindingUri("bindingUri1514820775") + .build(); + mockService.addResponse(expectedResponse); + + RepeatRequest request = + RepeatRequest.newBuilder() + .setName("name3373707") + .setInfo(ComplianceData.newBuilder().build()) + .setServerVerify(true) + .setIntendedBindingUri("intendedBindingUri780142386") + .setFInt32(-1143775883) + .setFInt64(-1143775788) + .setFDouble(-1239459382) + .setPInt32(-858673665) + .setPInt64(-858673570) + .setPDouble(-991225216) + .build(); + + RepeatResponse actualResponse = client.repeatDataBodyInfo(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void repeatDataBodyInfoExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + RepeatRequest request = + RepeatRequest.newBuilder() + .setName("name3373707") + .setInfo(ComplianceData.newBuilder().build()) + .setServerVerify(true) + .setIntendedBindingUri("intendedBindingUri780142386") + .setFInt32(-1143775883) + .setFInt64(-1143775788) + .setFDouble(-1239459382) + .setPInt32(-858673665) + .setPInt64(-858673570) + .setPDouble(-991225216) + .build(); + client.repeatDataBodyInfo(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void repeatDataQueryTest() throws Exception { + RepeatResponse expectedResponse = + RepeatResponse.newBuilder() + .setRequest(RepeatRequest.newBuilder().build()) + .setBindingUri("bindingUri1514820775") + .build(); + mockService.addResponse(expectedResponse); + + RepeatRequest request = + RepeatRequest.newBuilder() + .setName("name3373707") + .setInfo(ComplianceData.newBuilder().build()) + .setServerVerify(true) + .setIntendedBindingUri("intendedBindingUri780142386") + .setFInt32(-1143775883) + .setFInt64(-1143775788) + .setFDouble(-1239459382) + .setPInt32(-858673665) + .setPInt64(-858673570) + .setPDouble(-991225216) + .build(); + + RepeatResponse actualResponse = client.repeatDataQuery(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void repeatDataQueryExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + RepeatRequest request = + RepeatRequest.newBuilder() + .setName("name3373707") + .setInfo(ComplianceData.newBuilder().build()) + .setServerVerify(true) + .setIntendedBindingUri("intendedBindingUri780142386") + .setFInt32(-1143775883) + .setFInt64(-1143775788) + .setFDouble(-1239459382) + .setPInt32(-858673665) + .setPInt64(-858673570) + .setPDouble(-991225216) + .build(); + client.repeatDataQuery(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void repeatDataSimplePathTest() throws Exception { + RepeatResponse expectedResponse = + RepeatResponse.newBuilder() + .setRequest(RepeatRequest.newBuilder().build()) + .setBindingUri("bindingUri1514820775") + .build(); + mockService.addResponse(expectedResponse); + + RepeatRequest request = + RepeatRequest.newBuilder() + .setName("name3373707") + .setInfo( + ComplianceData.newBuilder() + .setFString("fString-9139") + .setFInt32(-1143775883) + .setFSint32(-815756300) + .setFSfixed32(-763212615) + .setFUint32(-758497998) + .setFFixed32(1837548026) + .setFInt64(-1143775788) + .setFSint64(-815756205) + .setFSfixed64(-763212520) + .setFUint64(-758497903) + .setFFixed64(1837548121) + .setFDouble(-1239459382) + .setFFloat(-1146609341) + .setFBool(true) + .setFBytes(ByteString.EMPTY) + .setFChild(ComplianceDataChild.newBuilder().build()) + .setPString("pString-1191954271") + .setPInt32(-858673665) + .setPDouble(-991225216) + .setPBool(true) + .setPChild(ComplianceDataChild.newBuilder().build()) + .build()) + .setServerVerify(true) + .setIntendedBindingUri("intendedBindingUri780142386") + .setFInt32(-1143775883) + .setFInt64(-1143775788) + .setFDouble(-1239459382) + .setPInt32(-858673665) + .setPInt64(-858673570) + .setPDouble(-991225216) + .build(); + + RepeatResponse actualResponse = client.repeatDataSimplePath(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void repeatDataSimplePathExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + RepeatRequest request = + RepeatRequest.newBuilder() + .setName("name3373707") + .setInfo( + ComplianceData.newBuilder() + .setFString("fString-9139") + .setFInt32(-1143775883) + .setFSint32(-815756300) + .setFSfixed32(-763212615) + .setFUint32(-758497998) + .setFFixed32(1837548026) + .setFInt64(-1143775788) + .setFSint64(-815756205) + .setFSfixed64(-763212520) + .setFUint64(-758497903) + .setFFixed64(1837548121) + .setFDouble(-1239459382) + .setFFloat(-1146609341) + .setFBool(true) + .setFBytes(ByteString.EMPTY) + .setFChild(ComplianceDataChild.newBuilder().build()) + .setPString("pString-1191954271") + .setPInt32(-858673665) + .setPDouble(-991225216) + .setPBool(true) + .setPChild(ComplianceDataChild.newBuilder().build()) + .build()) + .setServerVerify(true) + .setIntendedBindingUri("intendedBindingUri780142386") + .setFInt32(-1143775883) + .setFInt64(-1143775788) + .setFDouble(-1239459382) + .setPInt32(-858673665) + .setPInt64(-858673570) + .setPDouble(-991225216) + .build(); + client.repeatDataSimplePath(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void repeatDataPathResourceTest() throws Exception { + RepeatResponse expectedResponse = + RepeatResponse.newBuilder() + .setRequest(RepeatRequest.newBuilder().build()) + .setBindingUri("bindingUri1514820775") + .build(); + mockService.addResponse(expectedResponse); + + RepeatRequest request = + RepeatRequest.newBuilder() + .setName("name3373707") + .setInfo( + ComplianceData.newBuilder() + .setFString("first/firs-9148") + .setFInt32(-1143775883) + .setFSint32(-815756300) + .setFSfixed32(-763212615) + .setFUint32(-758497998) + .setFFixed32(1837548026) + .setFInt64(-1143775788) + .setFSint64(-815756205) + .setFSfixed64(-763212520) + .setFUint64(-758497903) + .setFFixed64(1837548121) + .setFDouble(-1239459382) + .setFFloat(-1146609341) + .setFBool(true) + .setFBytes(ByteString.EMPTY) + .setFChild( + ComplianceDataChild.newBuilder() + .setFString("second/secon-5446") + .setFFloat(-1146609341) + .setFDouble(-1239459382) + .setFBool(true) + .setFContinent(Continent.forNumber(0)) + .setFChild(ComplianceDataGrandchild.newBuilder().build()) + .setPString("pString-1191954271") + .setPFloat(-861507123) + .setPDouble(-991225216) + .setPBool(true) + .setPContinent(Continent.forNumber(0)) + .setPChild(ComplianceDataGrandchild.newBuilder().build()) + .build()) + .setPString("pString-1191954271") + .setPInt32(-858673665) + .setPDouble(-991225216) + .setPBool(true) + .setPChild(ComplianceDataChild.newBuilder().build()) + .build()) + .setServerVerify(true) + .setIntendedBindingUri("intendedBindingUri780142386") + .setFInt32(-1143775883) + .setFInt64(-1143775788) + .setFDouble(-1239459382) + .setPInt32(-858673665) + .setPInt64(-858673570) + .setPDouble(-991225216) + .build(); + + RepeatResponse actualResponse = client.repeatDataPathResource(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void repeatDataPathResourceExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + RepeatRequest request = + RepeatRequest.newBuilder() + .setName("name3373707") + .setInfo( + ComplianceData.newBuilder() + .setFString("first/firs-9148") + .setFInt32(-1143775883) + .setFSint32(-815756300) + .setFSfixed32(-763212615) + .setFUint32(-758497998) + .setFFixed32(1837548026) + .setFInt64(-1143775788) + .setFSint64(-815756205) + .setFSfixed64(-763212520) + .setFUint64(-758497903) + .setFFixed64(1837548121) + .setFDouble(-1239459382) + .setFFloat(-1146609341) + .setFBool(true) + .setFBytes(ByteString.EMPTY) + .setFChild( + ComplianceDataChild.newBuilder() + .setFString("second/secon-5446") + .setFFloat(-1146609341) + .setFDouble(-1239459382) + .setFBool(true) + .setFContinent(Continent.forNumber(0)) + .setFChild(ComplianceDataGrandchild.newBuilder().build()) + .setPString("pString-1191954271") + .setPFloat(-861507123) + .setPDouble(-991225216) + .setPBool(true) + .setPContinent(Continent.forNumber(0)) + .setPChild(ComplianceDataGrandchild.newBuilder().build()) + .build()) + .setPString("pString-1191954271") + .setPInt32(-858673665) + .setPDouble(-991225216) + .setPBool(true) + .setPChild(ComplianceDataChild.newBuilder().build()) + .build()) + .setServerVerify(true) + .setIntendedBindingUri("intendedBindingUri780142386") + .setFInt32(-1143775883) + .setFInt64(-1143775788) + .setFDouble(-1239459382) + .setPInt32(-858673665) + .setPInt64(-858673570) + .setPDouble(-991225216) + .build(); + client.repeatDataPathResource(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void repeatDataPathTrailingResourceTest() throws Exception { + RepeatResponse expectedResponse = + RepeatResponse.newBuilder() + .setRequest(RepeatRequest.newBuilder().build()) + .setBindingUri("bindingUri1514820775") + .build(); + mockService.addResponse(expectedResponse); + + RepeatRequest request = + RepeatRequest.newBuilder() + .setName("name3373707") + .setInfo( + ComplianceData.newBuilder() + .setFString("first/firs-9148") + .setFInt32(-1143775883) + .setFSint32(-815756300) + .setFSfixed32(-763212615) + .setFUint32(-758497998) + .setFFixed32(1837548026) + .setFInt64(-1143775788) + .setFSint64(-815756205) + .setFSfixed64(-763212520) + .setFUint64(-758497903) + .setFFixed64(1837548121) + .setFDouble(-1239459382) + .setFFloat(-1146609341) + .setFBool(true) + .setFBytes(ByteString.EMPTY) + .setFChild( + ComplianceDataChild.newBuilder() + .setFString("second/secon-3276") + .setFFloat(-1146609341) + .setFDouble(-1239459382) + .setFBool(true) + .setFContinent(Continent.forNumber(0)) + .setFChild(ComplianceDataGrandchild.newBuilder().build()) + .setPString("pString-1191954271") + .setPFloat(-861507123) + .setPDouble(-991225216) + .setPBool(true) + .setPContinent(Continent.forNumber(0)) + .setPChild(ComplianceDataGrandchild.newBuilder().build()) + .build()) + .setPString("pString-1191954271") + .setPInt32(-858673665) + .setPDouble(-991225216) + .setPBool(true) + .setPChild(ComplianceDataChild.newBuilder().build()) + .build()) + .setServerVerify(true) + .setIntendedBindingUri("intendedBindingUri780142386") + .setFInt32(-1143775883) + .setFInt64(-1143775788) + .setFDouble(-1239459382) + .setPInt32(-858673665) + .setPInt64(-858673570) + .setPDouble(-991225216) + .build(); + + RepeatResponse actualResponse = client.repeatDataPathTrailingResource(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void repeatDataPathTrailingResourceExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + RepeatRequest request = + RepeatRequest.newBuilder() + .setName("name3373707") + .setInfo( + ComplianceData.newBuilder() + .setFString("first/firs-9148") + .setFInt32(-1143775883) + .setFSint32(-815756300) + .setFSfixed32(-763212615) + .setFUint32(-758497998) + .setFFixed32(1837548026) + .setFInt64(-1143775788) + .setFSint64(-815756205) + .setFSfixed64(-763212520) + .setFUint64(-758497903) + .setFFixed64(1837548121) + .setFDouble(-1239459382) + .setFFloat(-1146609341) + .setFBool(true) + .setFBytes(ByteString.EMPTY) + .setFChild( + ComplianceDataChild.newBuilder() + .setFString("second/secon-3276") + .setFFloat(-1146609341) + .setFDouble(-1239459382) + .setFBool(true) + .setFContinent(Continent.forNumber(0)) + .setFChild(ComplianceDataGrandchild.newBuilder().build()) + .setPString("pString-1191954271") + .setPFloat(-861507123) + .setPDouble(-991225216) + .setPBool(true) + .setPContinent(Continent.forNumber(0)) + .setPChild(ComplianceDataGrandchild.newBuilder().build()) + .build()) + .setPString("pString-1191954271") + .setPInt32(-858673665) + .setPDouble(-991225216) + .setPBool(true) + .setPChild(ComplianceDataChild.newBuilder().build()) + .build()) + .setServerVerify(true) + .setIntendedBindingUri("intendedBindingUri780142386") + .setFInt32(-1143775883) + .setFInt64(-1143775788) + .setFDouble(-1239459382) + .setPInt32(-858673665) + .setPInt64(-858673570) + .setPDouble(-991225216) + .build(); + client.repeatDataPathTrailingResource(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void repeatDataBodyPutTest() throws Exception { + RepeatResponse expectedResponse = + RepeatResponse.newBuilder() + .setRequest(RepeatRequest.newBuilder().build()) + .setBindingUri("bindingUri1514820775") + .build(); + mockService.addResponse(expectedResponse); + + RepeatRequest request = + RepeatRequest.newBuilder() + .setName("name3373707") + .setInfo(ComplianceData.newBuilder().build()) + .setServerVerify(true) + .setIntendedBindingUri("intendedBindingUri780142386") + .setFInt32(-1143775883) + .setFInt64(-1143775788) + .setFDouble(-1239459382) + .setPInt32(-858673665) + .setPInt64(-858673570) + .setPDouble(-991225216) + .build(); + + RepeatResponse actualResponse = client.repeatDataBodyPut(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void repeatDataBodyPutExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + RepeatRequest request = + RepeatRequest.newBuilder() + .setName("name3373707") + .setInfo(ComplianceData.newBuilder().build()) + .setServerVerify(true) + .setIntendedBindingUri("intendedBindingUri780142386") + .setFInt32(-1143775883) + .setFInt64(-1143775788) + .setFDouble(-1239459382) + .setPInt32(-858673665) + .setPInt64(-858673570) + .setPDouble(-991225216) + .build(); + client.repeatDataBodyPut(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void repeatDataBodyPatchTest() throws Exception { + RepeatResponse expectedResponse = + RepeatResponse.newBuilder() + .setRequest(RepeatRequest.newBuilder().build()) + .setBindingUri("bindingUri1514820775") + .build(); + mockService.addResponse(expectedResponse); + + RepeatRequest request = + RepeatRequest.newBuilder() + .setName("name3373707") + .setInfo(ComplianceData.newBuilder().build()) + .setServerVerify(true) + .setIntendedBindingUri("intendedBindingUri780142386") + .setFInt32(-1143775883) + .setFInt64(-1143775788) + .setFDouble(-1239459382) + .setPInt32(-858673665) + .setPInt64(-858673570) + .setPDouble(-991225216) + .build(); + + RepeatResponse actualResponse = client.repeatDataBodyPatch(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void repeatDataBodyPatchExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + RepeatRequest request = + RepeatRequest.newBuilder() + .setName("name3373707") + .setInfo(ComplianceData.newBuilder().build()) + .setServerVerify(true) + .setIntendedBindingUri("intendedBindingUri780142386") + .setFInt32(-1143775883) + .setFInt64(-1143775788) + .setFDouble(-1239459382) + .setPInt32(-858673665) + .setPInt64(-858673570) + .setPDouble(-991225216) + .build(); + client.repeatDataBodyPatch(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getEnumTest() throws Exception { + EnumResponse expectedResponse = + EnumResponse.newBuilder() + .setRequest(EnumRequest.newBuilder().build()) + .setContinent(Continent.forNumber(0)) + .build(); + mockService.addResponse(expectedResponse); + + EnumRequest request = EnumRequest.newBuilder().setUnknownEnum(true).build(); + + EnumResponse actualResponse = client.getEnum(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void getEnumExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + EnumRequest request = EnumRequest.newBuilder().setUnknownEnum(true).build(); + client.getEnum(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void verifyEnumTest() throws Exception { + EnumResponse expectedResponse = + EnumResponse.newBuilder() + .setRequest(EnumRequest.newBuilder().build()) + .setContinent(Continent.forNumber(0)) + .build(); + mockService.addResponse(expectedResponse); + + EnumResponse request = + EnumResponse.newBuilder() + .setRequest(EnumRequest.newBuilder().build()) + .setContinent(Continent.forNumber(0)) + .build(); + + EnumResponse actualResponse = client.verifyEnum(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void verifyEnumExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + EnumResponse request = + EnumResponse.newBuilder() + .setRequest(EnumRequest.newBuilder().build()) + .setContinent(Continent.forNumber(0)) + .build(); + client.verifyEnum(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listLocationsTest() throws Exception { + Location responsesElement = Location.newBuilder().build(); + ListLocationsResponse expectedResponse = + ListLocationsResponse.newBuilder() + .setNextPageToken("") + .addAllLocations(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + ListLocationsRequest request = + ListLocationsRequest.newBuilder() + .setName("projects/project-3664") + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + + ListLocationsPagedResponse pagedListResponse = client.listLocations(request); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getLocationsList().get(0), resources.get(0)); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void listLocationsExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ListLocationsRequest request = + ListLocationsRequest.newBuilder() + .setName("projects/project-3664") + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + client.listLocations(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getLocationTest() throws Exception { + Location expectedResponse = + Location.newBuilder() + .setName("name3373707") + .setLocationId("locationId1541836720") + .setDisplayName("displayName1714148973") + .putAllLabels(new HashMap()) + .setMetadata(Any.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + GetLocationRequest request = + GetLocationRequest.newBuilder() + .setName("projects/project-9062/locations/location-9062") + .build(); + + Location actualResponse = client.getLocation(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void getLocationExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + GetLocationRequest request = + GetLocationRequest.newBuilder() + .setName("projects/project-9062/locations/location-9062") + .build(); + client.getLocation(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void setIamPolicyTest() throws Exception { + Policy expectedResponse = + Policy.newBuilder() + .setVersion(351608024) + .addAllBindings(new ArrayList()) + .addAllAuditConfigs(new ArrayList()) + .setEtag(ByteString.EMPTY) + .build(); + mockService.addResponse(expectedResponse); + + SetIamPolicyRequest request = + SetIamPolicyRequest.newBuilder() + .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString()) + .setPolicy(Policy.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .build(); + + Policy actualResponse = client.setIamPolicy(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void setIamPolicyExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + SetIamPolicyRequest request = + SetIamPolicyRequest.newBuilder() + .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString()) + .setPolicy(Policy.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .build(); + client.setIamPolicy(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getIamPolicyTest() throws Exception { + Policy expectedResponse = + Policy.newBuilder() + .setVersion(351608024) + .addAllBindings(new ArrayList()) + .addAllAuditConfigs(new ArrayList()) + .setEtag(ByteString.EMPTY) + .build(); + mockService.addResponse(expectedResponse); + + GetIamPolicyRequest request = + GetIamPolicyRequest.newBuilder() + .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString()) + .setOptions(GetPolicyOptions.newBuilder().build()) + .build(); + + Policy actualResponse = client.getIamPolicy(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void getIamPolicyExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + GetIamPolicyRequest request = + GetIamPolicyRequest.newBuilder() + .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString()) + .setOptions(GetPolicyOptions.newBuilder().build()) + .build(); + client.getIamPolicy(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void testIamPermissionsTest() throws Exception { + TestIamPermissionsResponse expectedResponse = + TestIamPermissionsResponse.newBuilder().addAllPermissions(new ArrayList()).build(); + mockService.addResponse(expectedResponse); + + TestIamPermissionsRequest request = + TestIamPermissionsRequest.newBuilder() + .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString()) + .addAllPermissions(new ArrayList()) + .build(); + + TestIamPermissionsResponse actualResponse = client.testIamPermissions(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void testIamPermissionsExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + TestIamPermissionsRequest request = + TestIamPermissionsRequest.newBuilder() + .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString()) + .addAllPermissions(new ArrayList()) + .build(); + client.testIamPermissions(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } +} diff --git a/java-showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/ComplianceClientTest.java b/java-showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/ComplianceClientTest.java new file mode 100644 index 0000000000..add5465c05 --- /dev/null +++ b/java-showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/ComplianceClientTest.java @@ -0,0 +1,1014 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1; + +import static com.google.showcase.v1beta1.ComplianceClient.ListLocationsPagedResponse; + +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.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.common.collect.Lists; +import com.google.iam.v1.AuditConfig; +import com.google.iam.v1.Binding; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.GetPolicyOptions; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.protobuf.AbstractMessage; +import com.google.protobuf.Any; +import com.google.protobuf.ByteString; +import com.google.protobuf.FieldMask; +import io.grpc.StatusRuntimeException; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.UUID; +import javax.annotation.Generated; +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Assert; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; + +@Generated("by gapic-generator-java") +public class ComplianceClientTest { + private static MockCompliance mockCompliance; + private static MockIAMPolicy mockIAMPolicy; + private static MockLocations mockLocations; + private static MockServiceHelper mockServiceHelper; + private LocalChannelProvider channelProvider; + private ComplianceClient client; + + @BeforeClass + public static void startStaticServer() { + mockCompliance = new MockCompliance(); + mockLocations = new MockLocations(); + mockIAMPolicy = new MockIAMPolicy(); + mockServiceHelper = + new MockServiceHelper( + UUID.randomUUID().toString(), + Arrays.asList(mockCompliance, mockLocations, mockIAMPolicy)); + mockServiceHelper.start(); + } + + @AfterClass + public static void stopServer() { + mockServiceHelper.stop(); + } + + @Before + public void setUp() throws IOException { + mockServiceHelper.reset(); + channelProvider = mockServiceHelper.createChannelProvider(); + ComplianceSettings settings = + ComplianceSettings.newBuilder() + .setTransportChannelProvider(channelProvider) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = ComplianceClient.create(settings); + } + + @After + public void tearDown() throws Exception { + client.close(); + } + + @Test + public void repeatDataBodyTest() throws Exception { + RepeatResponse expectedResponse = + RepeatResponse.newBuilder() + .setRequest(RepeatRequest.newBuilder().build()) + .setBindingUri("bindingUri1514820775") + .build(); + mockCompliance.addResponse(expectedResponse); + + RepeatRequest request = + RepeatRequest.newBuilder() + .setName("name3373707") + .setInfo(ComplianceData.newBuilder().build()) + .setServerVerify(true) + .setIntendedBindingUri("intendedBindingUri780142386") + .setFInt32(-1143775883) + .setFInt64(-1143775788) + .setFDouble(-1239459382) + .setPInt32(-858673665) + .setPInt64(-858673570) + .setPDouble(-991225216) + .build(); + + RepeatResponse actualResponse = client.repeatDataBody(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockCompliance.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + RepeatRequest actualRequest = ((RepeatRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getName(), actualRequest.getName()); + Assert.assertEquals(request.getInfo(), actualRequest.getInfo()); + Assert.assertEquals(request.getServerVerify(), actualRequest.getServerVerify()); + Assert.assertEquals(request.getIntendedBindingUri(), actualRequest.getIntendedBindingUri()); + Assert.assertEquals(request.getFInt32(), actualRequest.getFInt32()); + Assert.assertEquals(request.getFInt64(), actualRequest.getFInt64()); + Assert.assertEquals(request.getFDouble(), actualRequest.getFDouble(), 0.0001); + Assert.assertEquals(request.getPInt32(), actualRequest.getPInt32()); + Assert.assertEquals(request.getPInt64(), actualRequest.getPInt64()); + Assert.assertEquals(request.getPDouble(), actualRequest.getPDouble(), 0.0001); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void repeatDataBodyExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockCompliance.addException(exception); + + try { + RepeatRequest request = + RepeatRequest.newBuilder() + .setName("name3373707") + .setInfo(ComplianceData.newBuilder().build()) + .setServerVerify(true) + .setIntendedBindingUri("intendedBindingUri780142386") + .setFInt32(-1143775883) + .setFInt64(-1143775788) + .setFDouble(-1239459382) + .setPInt32(-858673665) + .setPInt64(-858673570) + .setPDouble(-991225216) + .build(); + client.repeatDataBody(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void repeatDataBodyInfoTest() throws Exception { + RepeatResponse expectedResponse = + RepeatResponse.newBuilder() + .setRequest(RepeatRequest.newBuilder().build()) + .setBindingUri("bindingUri1514820775") + .build(); + mockCompliance.addResponse(expectedResponse); + + RepeatRequest request = + RepeatRequest.newBuilder() + .setName("name3373707") + .setInfo(ComplianceData.newBuilder().build()) + .setServerVerify(true) + .setIntendedBindingUri("intendedBindingUri780142386") + .setFInt32(-1143775883) + .setFInt64(-1143775788) + .setFDouble(-1239459382) + .setPInt32(-858673665) + .setPInt64(-858673570) + .setPDouble(-991225216) + .build(); + + RepeatResponse actualResponse = client.repeatDataBodyInfo(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockCompliance.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + RepeatRequest actualRequest = ((RepeatRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getName(), actualRequest.getName()); + Assert.assertEquals(request.getInfo(), actualRequest.getInfo()); + Assert.assertEquals(request.getServerVerify(), actualRequest.getServerVerify()); + Assert.assertEquals(request.getIntendedBindingUri(), actualRequest.getIntendedBindingUri()); + Assert.assertEquals(request.getFInt32(), actualRequest.getFInt32()); + Assert.assertEquals(request.getFInt64(), actualRequest.getFInt64()); + Assert.assertEquals(request.getFDouble(), actualRequest.getFDouble(), 0.0001); + Assert.assertEquals(request.getPInt32(), actualRequest.getPInt32()); + Assert.assertEquals(request.getPInt64(), actualRequest.getPInt64()); + Assert.assertEquals(request.getPDouble(), actualRequest.getPDouble(), 0.0001); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void repeatDataBodyInfoExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockCompliance.addException(exception); + + try { + RepeatRequest request = + RepeatRequest.newBuilder() + .setName("name3373707") + .setInfo(ComplianceData.newBuilder().build()) + .setServerVerify(true) + .setIntendedBindingUri("intendedBindingUri780142386") + .setFInt32(-1143775883) + .setFInt64(-1143775788) + .setFDouble(-1239459382) + .setPInt32(-858673665) + .setPInt64(-858673570) + .setPDouble(-991225216) + .build(); + client.repeatDataBodyInfo(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void repeatDataQueryTest() throws Exception { + RepeatResponse expectedResponse = + RepeatResponse.newBuilder() + .setRequest(RepeatRequest.newBuilder().build()) + .setBindingUri("bindingUri1514820775") + .build(); + mockCompliance.addResponse(expectedResponse); + + RepeatRequest request = + RepeatRequest.newBuilder() + .setName("name3373707") + .setInfo(ComplianceData.newBuilder().build()) + .setServerVerify(true) + .setIntendedBindingUri("intendedBindingUri780142386") + .setFInt32(-1143775883) + .setFInt64(-1143775788) + .setFDouble(-1239459382) + .setPInt32(-858673665) + .setPInt64(-858673570) + .setPDouble(-991225216) + .build(); + + RepeatResponse actualResponse = client.repeatDataQuery(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockCompliance.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + RepeatRequest actualRequest = ((RepeatRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getName(), actualRequest.getName()); + Assert.assertEquals(request.getInfo(), actualRequest.getInfo()); + Assert.assertEquals(request.getServerVerify(), actualRequest.getServerVerify()); + Assert.assertEquals(request.getIntendedBindingUri(), actualRequest.getIntendedBindingUri()); + Assert.assertEquals(request.getFInt32(), actualRequest.getFInt32()); + Assert.assertEquals(request.getFInt64(), actualRequest.getFInt64()); + Assert.assertEquals(request.getFDouble(), actualRequest.getFDouble(), 0.0001); + Assert.assertEquals(request.getPInt32(), actualRequest.getPInt32()); + Assert.assertEquals(request.getPInt64(), actualRequest.getPInt64()); + Assert.assertEquals(request.getPDouble(), actualRequest.getPDouble(), 0.0001); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void repeatDataQueryExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockCompliance.addException(exception); + + try { + RepeatRequest request = + RepeatRequest.newBuilder() + .setName("name3373707") + .setInfo(ComplianceData.newBuilder().build()) + .setServerVerify(true) + .setIntendedBindingUri("intendedBindingUri780142386") + .setFInt32(-1143775883) + .setFInt64(-1143775788) + .setFDouble(-1239459382) + .setPInt32(-858673665) + .setPInt64(-858673570) + .setPDouble(-991225216) + .build(); + client.repeatDataQuery(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void repeatDataSimplePathTest() throws Exception { + RepeatResponse expectedResponse = + RepeatResponse.newBuilder() + .setRequest(RepeatRequest.newBuilder().build()) + .setBindingUri("bindingUri1514820775") + .build(); + mockCompliance.addResponse(expectedResponse); + + RepeatRequest request = + RepeatRequest.newBuilder() + .setName("name3373707") + .setInfo(ComplianceData.newBuilder().build()) + .setServerVerify(true) + .setIntendedBindingUri("intendedBindingUri780142386") + .setFInt32(-1143775883) + .setFInt64(-1143775788) + .setFDouble(-1239459382) + .setPInt32(-858673665) + .setPInt64(-858673570) + .setPDouble(-991225216) + .build(); + + RepeatResponse actualResponse = client.repeatDataSimplePath(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockCompliance.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + RepeatRequest actualRequest = ((RepeatRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getName(), actualRequest.getName()); + Assert.assertEquals(request.getInfo(), actualRequest.getInfo()); + Assert.assertEquals(request.getServerVerify(), actualRequest.getServerVerify()); + Assert.assertEquals(request.getIntendedBindingUri(), actualRequest.getIntendedBindingUri()); + Assert.assertEquals(request.getFInt32(), actualRequest.getFInt32()); + Assert.assertEquals(request.getFInt64(), actualRequest.getFInt64()); + Assert.assertEquals(request.getFDouble(), actualRequest.getFDouble(), 0.0001); + Assert.assertEquals(request.getPInt32(), actualRequest.getPInt32()); + Assert.assertEquals(request.getPInt64(), actualRequest.getPInt64()); + Assert.assertEquals(request.getPDouble(), actualRequest.getPDouble(), 0.0001); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void repeatDataSimplePathExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockCompliance.addException(exception); + + try { + RepeatRequest request = + RepeatRequest.newBuilder() + .setName("name3373707") + .setInfo(ComplianceData.newBuilder().build()) + .setServerVerify(true) + .setIntendedBindingUri("intendedBindingUri780142386") + .setFInt32(-1143775883) + .setFInt64(-1143775788) + .setFDouble(-1239459382) + .setPInt32(-858673665) + .setPInt64(-858673570) + .setPDouble(-991225216) + .build(); + client.repeatDataSimplePath(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void repeatDataPathResourceTest() throws Exception { + RepeatResponse expectedResponse = + RepeatResponse.newBuilder() + .setRequest(RepeatRequest.newBuilder().build()) + .setBindingUri("bindingUri1514820775") + .build(); + mockCompliance.addResponse(expectedResponse); + + RepeatRequest request = + RepeatRequest.newBuilder() + .setName("name3373707") + .setInfo(ComplianceData.newBuilder().build()) + .setServerVerify(true) + .setIntendedBindingUri("intendedBindingUri780142386") + .setFInt32(-1143775883) + .setFInt64(-1143775788) + .setFDouble(-1239459382) + .setPInt32(-858673665) + .setPInt64(-858673570) + .setPDouble(-991225216) + .build(); + + RepeatResponse actualResponse = client.repeatDataPathResource(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockCompliance.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + RepeatRequest actualRequest = ((RepeatRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getName(), actualRequest.getName()); + Assert.assertEquals(request.getInfo(), actualRequest.getInfo()); + Assert.assertEquals(request.getServerVerify(), actualRequest.getServerVerify()); + Assert.assertEquals(request.getIntendedBindingUri(), actualRequest.getIntendedBindingUri()); + Assert.assertEquals(request.getFInt32(), actualRequest.getFInt32()); + Assert.assertEquals(request.getFInt64(), actualRequest.getFInt64()); + Assert.assertEquals(request.getFDouble(), actualRequest.getFDouble(), 0.0001); + Assert.assertEquals(request.getPInt32(), actualRequest.getPInt32()); + Assert.assertEquals(request.getPInt64(), actualRequest.getPInt64()); + Assert.assertEquals(request.getPDouble(), actualRequest.getPDouble(), 0.0001); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void repeatDataPathResourceExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockCompliance.addException(exception); + + try { + RepeatRequest request = + RepeatRequest.newBuilder() + .setName("name3373707") + .setInfo(ComplianceData.newBuilder().build()) + .setServerVerify(true) + .setIntendedBindingUri("intendedBindingUri780142386") + .setFInt32(-1143775883) + .setFInt64(-1143775788) + .setFDouble(-1239459382) + .setPInt32(-858673665) + .setPInt64(-858673570) + .setPDouble(-991225216) + .build(); + client.repeatDataPathResource(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void repeatDataPathTrailingResourceTest() throws Exception { + RepeatResponse expectedResponse = + RepeatResponse.newBuilder() + .setRequest(RepeatRequest.newBuilder().build()) + .setBindingUri("bindingUri1514820775") + .build(); + mockCompliance.addResponse(expectedResponse); + + RepeatRequest request = + RepeatRequest.newBuilder() + .setName("name3373707") + .setInfo(ComplianceData.newBuilder().build()) + .setServerVerify(true) + .setIntendedBindingUri("intendedBindingUri780142386") + .setFInt32(-1143775883) + .setFInt64(-1143775788) + .setFDouble(-1239459382) + .setPInt32(-858673665) + .setPInt64(-858673570) + .setPDouble(-991225216) + .build(); + + RepeatResponse actualResponse = client.repeatDataPathTrailingResource(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockCompliance.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + RepeatRequest actualRequest = ((RepeatRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getName(), actualRequest.getName()); + Assert.assertEquals(request.getInfo(), actualRequest.getInfo()); + Assert.assertEquals(request.getServerVerify(), actualRequest.getServerVerify()); + Assert.assertEquals(request.getIntendedBindingUri(), actualRequest.getIntendedBindingUri()); + Assert.assertEquals(request.getFInt32(), actualRequest.getFInt32()); + Assert.assertEquals(request.getFInt64(), actualRequest.getFInt64()); + Assert.assertEquals(request.getFDouble(), actualRequest.getFDouble(), 0.0001); + Assert.assertEquals(request.getPInt32(), actualRequest.getPInt32()); + Assert.assertEquals(request.getPInt64(), actualRequest.getPInt64()); + Assert.assertEquals(request.getPDouble(), actualRequest.getPDouble(), 0.0001); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void repeatDataPathTrailingResourceExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockCompliance.addException(exception); + + try { + RepeatRequest request = + RepeatRequest.newBuilder() + .setName("name3373707") + .setInfo(ComplianceData.newBuilder().build()) + .setServerVerify(true) + .setIntendedBindingUri("intendedBindingUri780142386") + .setFInt32(-1143775883) + .setFInt64(-1143775788) + .setFDouble(-1239459382) + .setPInt32(-858673665) + .setPInt64(-858673570) + .setPDouble(-991225216) + .build(); + client.repeatDataPathTrailingResource(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void repeatDataBodyPutTest() throws Exception { + RepeatResponse expectedResponse = + RepeatResponse.newBuilder() + .setRequest(RepeatRequest.newBuilder().build()) + .setBindingUri("bindingUri1514820775") + .build(); + mockCompliance.addResponse(expectedResponse); + + RepeatRequest request = + RepeatRequest.newBuilder() + .setName("name3373707") + .setInfo(ComplianceData.newBuilder().build()) + .setServerVerify(true) + .setIntendedBindingUri("intendedBindingUri780142386") + .setFInt32(-1143775883) + .setFInt64(-1143775788) + .setFDouble(-1239459382) + .setPInt32(-858673665) + .setPInt64(-858673570) + .setPDouble(-991225216) + .build(); + + RepeatResponse actualResponse = client.repeatDataBodyPut(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockCompliance.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + RepeatRequest actualRequest = ((RepeatRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getName(), actualRequest.getName()); + Assert.assertEquals(request.getInfo(), actualRequest.getInfo()); + Assert.assertEquals(request.getServerVerify(), actualRequest.getServerVerify()); + Assert.assertEquals(request.getIntendedBindingUri(), actualRequest.getIntendedBindingUri()); + Assert.assertEquals(request.getFInt32(), actualRequest.getFInt32()); + Assert.assertEquals(request.getFInt64(), actualRequest.getFInt64()); + Assert.assertEquals(request.getFDouble(), actualRequest.getFDouble(), 0.0001); + Assert.assertEquals(request.getPInt32(), actualRequest.getPInt32()); + Assert.assertEquals(request.getPInt64(), actualRequest.getPInt64()); + Assert.assertEquals(request.getPDouble(), actualRequest.getPDouble(), 0.0001); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void repeatDataBodyPutExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockCompliance.addException(exception); + + try { + RepeatRequest request = + RepeatRequest.newBuilder() + .setName("name3373707") + .setInfo(ComplianceData.newBuilder().build()) + .setServerVerify(true) + .setIntendedBindingUri("intendedBindingUri780142386") + .setFInt32(-1143775883) + .setFInt64(-1143775788) + .setFDouble(-1239459382) + .setPInt32(-858673665) + .setPInt64(-858673570) + .setPDouble(-991225216) + .build(); + client.repeatDataBodyPut(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void repeatDataBodyPatchTest() throws Exception { + RepeatResponse expectedResponse = + RepeatResponse.newBuilder() + .setRequest(RepeatRequest.newBuilder().build()) + .setBindingUri("bindingUri1514820775") + .build(); + mockCompliance.addResponse(expectedResponse); + + RepeatRequest request = + RepeatRequest.newBuilder() + .setName("name3373707") + .setInfo(ComplianceData.newBuilder().build()) + .setServerVerify(true) + .setIntendedBindingUri("intendedBindingUri780142386") + .setFInt32(-1143775883) + .setFInt64(-1143775788) + .setFDouble(-1239459382) + .setPInt32(-858673665) + .setPInt64(-858673570) + .setPDouble(-991225216) + .build(); + + RepeatResponse actualResponse = client.repeatDataBodyPatch(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockCompliance.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + RepeatRequest actualRequest = ((RepeatRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getName(), actualRequest.getName()); + Assert.assertEquals(request.getInfo(), actualRequest.getInfo()); + Assert.assertEquals(request.getServerVerify(), actualRequest.getServerVerify()); + Assert.assertEquals(request.getIntendedBindingUri(), actualRequest.getIntendedBindingUri()); + Assert.assertEquals(request.getFInt32(), actualRequest.getFInt32()); + Assert.assertEquals(request.getFInt64(), actualRequest.getFInt64()); + Assert.assertEquals(request.getFDouble(), actualRequest.getFDouble(), 0.0001); + Assert.assertEquals(request.getPInt32(), actualRequest.getPInt32()); + Assert.assertEquals(request.getPInt64(), actualRequest.getPInt64()); + Assert.assertEquals(request.getPDouble(), actualRequest.getPDouble(), 0.0001); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void repeatDataBodyPatchExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockCompliance.addException(exception); + + try { + RepeatRequest request = + RepeatRequest.newBuilder() + .setName("name3373707") + .setInfo(ComplianceData.newBuilder().build()) + .setServerVerify(true) + .setIntendedBindingUri("intendedBindingUri780142386") + .setFInt32(-1143775883) + .setFInt64(-1143775788) + .setFDouble(-1239459382) + .setPInt32(-858673665) + .setPInt64(-858673570) + .setPDouble(-991225216) + .build(); + client.repeatDataBodyPatch(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getEnumTest() throws Exception { + EnumResponse expectedResponse = + EnumResponse.newBuilder() + .setRequest(EnumRequest.newBuilder().build()) + .setContinent(Continent.forNumber(0)) + .build(); + mockCompliance.addResponse(expectedResponse); + + EnumRequest request = EnumRequest.newBuilder().setUnknownEnum(true).build(); + + EnumResponse actualResponse = client.getEnum(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockCompliance.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + EnumRequest actualRequest = ((EnumRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getUnknownEnum(), actualRequest.getUnknownEnum()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getEnumExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockCompliance.addException(exception); + + try { + EnumRequest request = EnumRequest.newBuilder().setUnknownEnum(true).build(); + client.getEnum(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void verifyEnumTest() throws Exception { + EnumResponse expectedResponse = + EnumResponse.newBuilder() + .setRequest(EnumRequest.newBuilder().build()) + .setContinent(Continent.forNumber(0)) + .build(); + mockCompliance.addResponse(expectedResponse); + + EnumResponse request = + EnumResponse.newBuilder() + .setRequest(EnumRequest.newBuilder().build()) + .setContinent(Continent.forNumber(0)) + .build(); + + EnumResponse actualResponse = client.verifyEnum(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockCompliance.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + EnumResponse actualRequest = ((EnumResponse) actualRequests.get(0)); + + Assert.assertEquals(request.getRequest(), actualRequest.getRequest()); + Assert.assertEquals(request.getContinent(), actualRequest.getContinent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void verifyEnumExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockCompliance.addException(exception); + + try { + EnumResponse request = + EnumResponse.newBuilder() + .setRequest(EnumRequest.newBuilder().build()) + .setContinent(Continent.forNumber(0)) + .build(); + client.verifyEnum(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listLocationsTest() throws Exception { + Location responsesElement = Location.newBuilder().build(); + ListLocationsResponse expectedResponse = + ListLocationsResponse.newBuilder() + .setNextPageToken("") + .addAllLocations(Arrays.asList(responsesElement)) + .build(); + mockLocations.addResponse(expectedResponse); + + ListLocationsRequest request = + ListLocationsRequest.newBuilder() + .setName("name3373707") + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + + ListLocationsPagedResponse pagedListResponse = client.listLocations(request); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getLocationsList().get(0), resources.get(0)); + + List actualRequests = mockLocations.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListLocationsRequest actualRequest = ((ListLocationsRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getName(), actualRequest.getName()); + Assert.assertEquals(request.getFilter(), actualRequest.getFilter()); + Assert.assertEquals(request.getPageSize(), actualRequest.getPageSize()); + Assert.assertEquals(request.getPageToken(), actualRequest.getPageToken()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listLocationsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockLocations.addException(exception); + + try { + ListLocationsRequest request = + ListLocationsRequest.newBuilder() + .setName("name3373707") + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + client.listLocations(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getLocationTest() throws Exception { + Location expectedResponse = + Location.newBuilder() + .setName("name3373707") + .setLocationId("locationId1541836720") + .setDisplayName("displayName1714148973") + .putAllLabels(new HashMap()) + .setMetadata(Any.newBuilder().build()) + .build(); + mockLocations.addResponse(expectedResponse); + + GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build(); + + Location actualResponse = client.getLocation(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockLocations.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetLocationRequest actualRequest = ((GetLocationRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getName(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getLocationExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockLocations.addException(exception); + + try { + GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build(); + client.getLocation(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void setIamPolicyTest() throws Exception { + Policy expectedResponse = + Policy.newBuilder() + .setVersion(351608024) + .addAllBindings(new ArrayList()) + .addAllAuditConfigs(new ArrayList()) + .setEtag(ByteString.EMPTY) + .build(); + mockIAMPolicy.addResponse(expectedResponse); + + SetIamPolicyRequest request = + SetIamPolicyRequest.newBuilder() + .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString()) + .setPolicy(Policy.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .build(); + + Policy actualResponse = client.setIamPolicy(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockIAMPolicy.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + SetIamPolicyRequest actualRequest = ((SetIamPolicyRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getResource(), actualRequest.getResource()); + Assert.assertEquals(request.getPolicy(), actualRequest.getPolicy()); + Assert.assertEquals(request.getUpdateMask(), actualRequest.getUpdateMask()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void setIamPolicyExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockIAMPolicy.addException(exception); + + try { + SetIamPolicyRequest request = + SetIamPolicyRequest.newBuilder() + .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString()) + .setPolicy(Policy.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .build(); + client.setIamPolicy(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getIamPolicyTest() throws Exception { + Policy expectedResponse = + Policy.newBuilder() + .setVersion(351608024) + .addAllBindings(new ArrayList()) + .addAllAuditConfigs(new ArrayList()) + .setEtag(ByteString.EMPTY) + .build(); + mockIAMPolicy.addResponse(expectedResponse); + + GetIamPolicyRequest request = + GetIamPolicyRequest.newBuilder() + .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString()) + .setOptions(GetPolicyOptions.newBuilder().build()) + .build(); + + Policy actualResponse = client.getIamPolicy(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockIAMPolicy.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetIamPolicyRequest actualRequest = ((GetIamPolicyRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getResource(), actualRequest.getResource()); + Assert.assertEquals(request.getOptions(), actualRequest.getOptions()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getIamPolicyExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockIAMPolicy.addException(exception); + + try { + GetIamPolicyRequest request = + GetIamPolicyRequest.newBuilder() + .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString()) + .setOptions(GetPolicyOptions.newBuilder().build()) + .build(); + client.getIamPolicy(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void testIamPermissionsTest() throws Exception { + TestIamPermissionsResponse expectedResponse = + TestIamPermissionsResponse.newBuilder().addAllPermissions(new ArrayList()).build(); + mockIAMPolicy.addResponse(expectedResponse); + + TestIamPermissionsRequest request = + TestIamPermissionsRequest.newBuilder() + .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString()) + .addAllPermissions(new ArrayList()) + .build(); + + TestIamPermissionsResponse actualResponse = client.testIamPermissions(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockIAMPolicy.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + TestIamPermissionsRequest actualRequest = ((TestIamPermissionsRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getResource(), actualRequest.getResource()); + Assert.assertEquals(request.getPermissionsList(), actualRequest.getPermissionsList()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void testIamPermissionsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockIAMPolicy.addException(exception); + + try { + TestIamPermissionsRequest request = + TestIamPermissionsRequest.newBuilder() + .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString()) + .addAllPermissions(new ArrayList()) + .build(); + client.testIamPermissions(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } +} diff --git a/java-showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/EchoClientHttpJsonTest.java b/java-showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/EchoClientHttpJsonTest.java new file mode 100644 index 0000000000..dd57f73019 --- /dev/null +++ b/java-showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/EchoClientHttpJsonTest.java @@ -0,0 +1,827 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1; + +import static com.google.showcase.v1beta1.EchoClient.ListLocationsPagedResponse; +import static com.google.showcase.v1beta1.EchoClient.PagedExpandLegacyMappedPagedResponse; +import static com.google.showcase.v1beta1.EchoClient.PagedExpandPagedResponse; + +import com.google.api.gax.core.NoCredentialsProvider; +import com.google.api.gax.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.testing.MockHttpService; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ApiException; +import com.google.api.gax.rpc.ApiExceptionFactory; +import com.google.api.gax.rpc.InvalidArgumentException; +import com.google.api.gax.rpc.StatusCode; +import com.google.api.gax.rpc.testing.FakeStatusCode; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.common.collect.Lists; +import com.google.iam.v1.AuditConfig; +import com.google.iam.v1.Binding; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.GetPolicyOptions; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.longrunning.Operation; +import com.google.protobuf.Any; +import com.google.protobuf.ByteString; +import com.google.protobuf.Duration; +import com.google.protobuf.FieldMask; +import com.google.showcase.v1beta1.stub.HttpJsonEchoStub; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +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 EchoClientHttpJsonTest { + private static MockHttpService mockService; + private static EchoClient client; + + @BeforeClass + public static void startStaticServer() throws IOException { + mockService = + new MockHttpService( + HttpJsonEchoStub.getMethodDescriptors(), EchoSettings.getDefaultEndpoint()); + EchoSettings settings = + EchoSettings.newHttpJsonBuilder() + .setTransportChannelProvider( + EchoSettings.defaultHttpJsonTransportProviderBuilder() + .setHttpTransport(mockService) + .build()) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = EchoClient.create(settings); + } + + @AfterClass + public static void stopServer() { + client.close(); + } + + @Before + public void setUp() {} + + @After + public void tearDown() throws Exception { + mockService.reset(); + } + + @Test + public void echoTest() throws Exception { + EchoResponse expectedResponse = + EchoResponse.newBuilder() + .setContent("content951530617") + .setSeverity(Severity.forNumber(0)) + .setRequestId("requestId693933066") + .setOtherRequestId("otherRequestId1248995034") + .build(); + mockService.addResponse(expectedResponse); + + EchoRequest request = + EchoRequest.newBuilder() + .setSeverity(Severity.forNumber(0)) + .setHeader("header-1221270899") + .setOtherHeader("otherHeader-2026585667") + .setRequestId("requestId693933066") + .setOtherRequestId("otherRequestId1248995034") + .build(); + + EchoResponse actualResponse = client.echo(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void echoExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + EchoRequest request = + EchoRequest.newBuilder() + .setSeverity(Severity.forNumber(0)) + .setHeader("header-1221270899") + .setOtherHeader("otherHeader-2026585667") + .setRequestId("requestId693933066") + .setOtherRequestId("otherRequestId1248995034") + .build(); + client.echo(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void echoErrorDetailsTest() throws Exception { + EchoErrorDetailsResponse expectedResponse = + EchoErrorDetailsResponse.newBuilder() + .setSingleDetail(EchoErrorDetailsResponse.SingleDetail.newBuilder().build()) + .setMultipleDetails(EchoErrorDetailsResponse.MultipleDetails.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + EchoErrorDetailsRequest request = + EchoErrorDetailsRequest.newBuilder() + .setSingleDetailText("singleDetailText1774380934") + .addAllMultiDetailText(new ArrayList()) + .build(); + + EchoErrorDetailsResponse actualResponse = client.echoErrorDetails(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void echoErrorDetailsExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + EchoErrorDetailsRequest request = + EchoErrorDetailsRequest.newBuilder() + .setSingleDetailText("singleDetailText1774380934") + .addAllMultiDetailText(new ArrayList()) + .build(); + client.echoErrorDetails(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void failEchoWithDetailsTest() throws Exception { + FailEchoWithDetailsResponse expectedResponse = FailEchoWithDetailsResponse.newBuilder().build(); + mockService.addResponse(expectedResponse); + + FailEchoWithDetailsRequest request = + FailEchoWithDetailsRequest.newBuilder().setMessage("message954925063").build(); + + FailEchoWithDetailsResponse actualResponse = client.failEchoWithDetails(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void failEchoWithDetailsExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + FailEchoWithDetailsRequest request = + FailEchoWithDetailsRequest.newBuilder().setMessage("message954925063").build(); + client.failEchoWithDetails(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void expandTest() throws Exception {} + + @Test + public void expandExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + } + + @Test + public void collectUnsupportedMethodTest() throws Exception { + // The collect() method is not supported in REST transport. + // This empty test is generated for technical reasons. + } + + @Test + public void chatUnsupportedMethodTest() throws Exception { + // The chat() method is not supported in REST transport. + // This empty test is generated for technical reasons. + } + + @Test + public void pagedExpandTest() throws Exception { + EchoResponse responsesElement = EchoResponse.newBuilder().build(); + PagedExpandResponse expectedResponse = + PagedExpandResponse.newBuilder() + .setNextPageToken("") + .addAllResponses(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + PagedExpandRequest request = + PagedExpandRequest.newBuilder() + .setContent("content951530617") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + + PagedExpandPagedResponse pagedListResponse = client.pagedExpand(request); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getResponsesList().get(0), resources.get(0)); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void pagedExpandExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + PagedExpandRequest request = + PagedExpandRequest.newBuilder() + .setContent("content951530617") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + client.pagedExpand(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void pagedExpandLegacyTest() throws Exception { + PagedExpandResponse expectedResponse = + PagedExpandResponse.newBuilder() + .addAllResponses(new ArrayList()) + .setNextPageToken("nextPageToken-1386094857") + .build(); + mockService.addResponse(expectedResponse); + + PagedExpandLegacyRequest request = + PagedExpandLegacyRequest.newBuilder() + .setContent("content951530617") + .setMaxResults(1128457243) + .setPageToken("pageToken873572522") + .build(); + + PagedExpandResponse actualResponse = client.pagedExpandLegacy(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void pagedExpandLegacyExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + PagedExpandLegacyRequest request = + PagedExpandLegacyRequest.newBuilder() + .setContent("content951530617") + .setMaxResults(1128457243) + .setPageToken("pageToken873572522") + .build(); + client.pagedExpandLegacy(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void pagedExpandLegacyMappedTest() throws Exception { + PagedExpandResponseList responsesElement = PagedExpandResponseList.newBuilder().build(); + PagedExpandLegacyMappedResponse expectedResponse = + PagedExpandLegacyMappedResponse.newBuilder() + .setNextPageToken("") + .putAllAlphabetized(Collections.singletonMap("alphabetized", responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + PagedExpandRequest request = + PagedExpandRequest.newBuilder() + .setContent("content951530617") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + + PagedExpandLegacyMappedPagedResponse pagedListResponse = + client.pagedExpandLegacyMapped(request); + + List> resources = + Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals( + expectedResponse.getAlphabetizedMap().entrySet().iterator().next(), resources.get(0)); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void pagedExpandLegacyMappedExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + PagedExpandRequest request = + PagedExpandRequest.newBuilder() + .setContent("content951530617") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + client.pagedExpandLegacyMapped(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void waitTest() throws Exception { + WaitResponse expectedResponse = + WaitResponse.newBuilder().setContent("content951530617").build(); + Operation resultOperation = + Operation.newBuilder() + .setName("waitTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockService.addResponse(resultOperation); + + WaitRequest request = WaitRequest.newBuilder().build(); + + WaitResponse actualResponse = client.waitAsync(request).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void waitExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + WaitRequest request = WaitRequest.newBuilder().build(); + client.waitAsync(request).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + } + } + + @Test + public void blockTest() throws Exception { + BlockResponse expectedResponse = + BlockResponse.newBuilder().setContent("content951530617").build(); + mockService.addResponse(expectedResponse); + + BlockRequest request = + BlockRequest.newBuilder().setResponseDelay(Duration.newBuilder().build()).build(); + + BlockResponse actualResponse = client.block(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void blockExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + BlockRequest request = + BlockRequest.newBuilder().setResponseDelay(Duration.newBuilder().build()).build(); + client.block(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listLocationsTest() throws Exception { + Location responsesElement = Location.newBuilder().build(); + ListLocationsResponse expectedResponse = + ListLocationsResponse.newBuilder() + .setNextPageToken("") + .addAllLocations(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + ListLocationsRequest request = + ListLocationsRequest.newBuilder() + .setName("projects/project-3664") + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + + ListLocationsPagedResponse pagedListResponse = client.listLocations(request); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getLocationsList().get(0), resources.get(0)); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void listLocationsExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ListLocationsRequest request = + ListLocationsRequest.newBuilder() + .setName("projects/project-3664") + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + client.listLocations(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getLocationTest() throws Exception { + Location expectedResponse = + Location.newBuilder() + .setName("name3373707") + .setLocationId("locationId1541836720") + .setDisplayName("displayName1714148973") + .putAllLabels(new HashMap()) + .setMetadata(Any.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + GetLocationRequest request = + GetLocationRequest.newBuilder() + .setName("projects/project-9062/locations/location-9062") + .build(); + + Location actualResponse = client.getLocation(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void getLocationExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + GetLocationRequest request = + GetLocationRequest.newBuilder() + .setName("projects/project-9062/locations/location-9062") + .build(); + client.getLocation(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void setIamPolicyTest() throws Exception { + Policy expectedResponse = + Policy.newBuilder() + .setVersion(351608024) + .addAllBindings(new ArrayList()) + .addAllAuditConfigs(new ArrayList()) + .setEtag(ByteString.EMPTY) + .build(); + mockService.addResponse(expectedResponse); + + SetIamPolicyRequest request = + SetIamPolicyRequest.newBuilder() + .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString()) + .setPolicy(Policy.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .build(); + + Policy actualResponse = client.setIamPolicy(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void setIamPolicyExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + SetIamPolicyRequest request = + SetIamPolicyRequest.newBuilder() + .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString()) + .setPolicy(Policy.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .build(); + client.setIamPolicy(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getIamPolicyTest() throws Exception { + Policy expectedResponse = + Policy.newBuilder() + .setVersion(351608024) + .addAllBindings(new ArrayList()) + .addAllAuditConfigs(new ArrayList()) + .setEtag(ByteString.EMPTY) + .build(); + mockService.addResponse(expectedResponse); + + GetIamPolicyRequest request = + GetIamPolicyRequest.newBuilder() + .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString()) + .setOptions(GetPolicyOptions.newBuilder().build()) + .build(); + + Policy actualResponse = client.getIamPolicy(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void getIamPolicyExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + GetIamPolicyRequest request = + GetIamPolicyRequest.newBuilder() + .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString()) + .setOptions(GetPolicyOptions.newBuilder().build()) + .build(); + client.getIamPolicy(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void testIamPermissionsTest() throws Exception { + TestIamPermissionsResponse expectedResponse = + TestIamPermissionsResponse.newBuilder().addAllPermissions(new ArrayList()).build(); + mockService.addResponse(expectedResponse); + + TestIamPermissionsRequest request = + TestIamPermissionsRequest.newBuilder() + .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString()) + .addAllPermissions(new ArrayList()) + .build(); + + TestIamPermissionsResponse actualResponse = client.testIamPermissions(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void testIamPermissionsExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + TestIamPermissionsRequest request = + TestIamPermissionsRequest.newBuilder() + .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString()) + .addAllPermissions(new ArrayList()) + .build(); + client.testIamPermissions(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } +} diff --git a/java-showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/EchoClientTest.java b/java-showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/EchoClientTest.java new file mode 100644 index 0000000000..560f9b3e0b --- /dev/null +++ b/java-showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/EchoClientTest.java @@ -0,0 +1,941 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1; + +import static com.google.showcase.v1beta1.EchoClient.ListLocationsPagedResponse; +import static com.google.showcase.v1beta1.EchoClient.PagedExpandLegacyMappedPagedResponse; +import static com.google.showcase.v1beta1.EchoClient.PagedExpandPagedResponse; + +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.ClientStreamingCallable; +import com.google.api.gax.rpc.InvalidArgumentException; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.api.gax.rpc.StatusCode; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.common.collect.Lists; +import com.google.iam.v1.AuditConfig; +import com.google.iam.v1.Binding; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.GetPolicyOptions; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.longrunning.Operation; +import com.google.protobuf.AbstractMessage; +import com.google.protobuf.Any; +import com.google.protobuf.ByteString; +import com.google.protobuf.Duration; +import com.google.protobuf.FieldMask; +import com.google.rpc.Status; +import io.grpc.StatusRuntimeException; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collections; +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 EchoClientTest { + private static MockEcho mockEcho; + private static MockIAMPolicy mockIAMPolicy; + private static MockLocations mockLocations; + private static MockServiceHelper mockServiceHelper; + private LocalChannelProvider channelProvider; + private EchoClient client; + + @BeforeClass + public static void startStaticServer() { + mockEcho = new MockEcho(); + mockLocations = new MockLocations(); + mockIAMPolicy = new MockIAMPolicy(); + mockServiceHelper = + new MockServiceHelper( + UUID.randomUUID().toString(), + Arrays.asList(mockEcho, mockLocations, mockIAMPolicy)); + mockServiceHelper.start(); + } + + @AfterClass + public static void stopServer() { + mockServiceHelper.stop(); + } + + @Before + public void setUp() throws IOException { + mockServiceHelper.reset(); + channelProvider = mockServiceHelper.createChannelProvider(); + EchoSettings settings = + EchoSettings.newBuilder() + .setTransportChannelProvider(channelProvider) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = EchoClient.create(settings); + } + + @After + public void tearDown() throws Exception { + client.close(); + } + + @Test + public void echoTest() throws Exception { + EchoResponse expectedResponse = + EchoResponse.newBuilder() + .setContent("content951530617") + .setSeverity(Severity.forNumber(0)) + .setRequestId("requestId693933066") + .setOtherRequestId("otherRequestId1248995034") + .build(); + mockEcho.addResponse(expectedResponse); + + EchoRequest request = + EchoRequest.newBuilder() + .setSeverity(Severity.forNumber(0)) + .setHeader("header-1221270899") + .setOtherHeader("otherHeader-2026585667") + .setRequestId("requestId693933066") + .setOtherRequestId("otherRequestId1248995034") + .build(); + + EchoResponse actualResponse = client.echo(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockEcho.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + EchoRequest actualRequest = ((EchoRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getContent(), actualRequest.getContent()); + Assert.assertEquals(request.getError(), actualRequest.getError()); + Assert.assertEquals(request.getSeverity(), actualRequest.getSeverity()); + Assert.assertEquals(request.getHeader(), actualRequest.getHeader()); + Assert.assertEquals(request.getOtherHeader(), actualRequest.getOtherHeader()); + Assert.assertEquals(request.getRequestId(), actualRequest.getRequestId()); + Assert.assertEquals(request.getOtherRequestId(), actualRequest.getOtherRequestId()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void echoExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockEcho.addException(exception); + + try { + EchoRequest request = + EchoRequest.newBuilder() + .setSeverity(Severity.forNumber(0)) + .setHeader("header-1221270899") + .setOtherHeader("otherHeader-2026585667") + .setRequestId("requestId693933066") + .setOtherRequestId("otherRequestId1248995034") + .build(); + client.echo(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void echoErrorDetailsTest() throws Exception { + EchoErrorDetailsResponse expectedResponse = + EchoErrorDetailsResponse.newBuilder() + .setSingleDetail(EchoErrorDetailsResponse.SingleDetail.newBuilder().build()) + .setMultipleDetails(EchoErrorDetailsResponse.MultipleDetails.newBuilder().build()) + .build(); + mockEcho.addResponse(expectedResponse); + + EchoErrorDetailsRequest request = + EchoErrorDetailsRequest.newBuilder() + .setSingleDetailText("singleDetailText1774380934") + .addAllMultiDetailText(new ArrayList()) + .build(); + + EchoErrorDetailsResponse actualResponse = client.echoErrorDetails(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockEcho.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + EchoErrorDetailsRequest actualRequest = ((EchoErrorDetailsRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getSingleDetailText(), actualRequest.getSingleDetailText()); + Assert.assertEquals(request.getMultiDetailTextList(), actualRequest.getMultiDetailTextList()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void echoErrorDetailsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockEcho.addException(exception); + + try { + EchoErrorDetailsRequest request = + EchoErrorDetailsRequest.newBuilder() + .setSingleDetailText("singleDetailText1774380934") + .addAllMultiDetailText(new ArrayList()) + .build(); + client.echoErrorDetails(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void failEchoWithDetailsTest() throws Exception { + FailEchoWithDetailsResponse expectedResponse = FailEchoWithDetailsResponse.newBuilder().build(); + mockEcho.addResponse(expectedResponse); + + FailEchoWithDetailsRequest request = + FailEchoWithDetailsRequest.newBuilder().setMessage("message954925063").build(); + + FailEchoWithDetailsResponse actualResponse = client.failEchoWithDetails(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockEcho.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + FailEchoWithDetailsRequest actualRequest = ((FailEchoWithDetailsRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getMessage(), actualRequest.getMessage()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void failEchoWithDetailsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockEcho.addException(exception); + + try { + FailEchoWithDetailsRequest request = + FailEchoWithDetailsRequest.newBuilder().setMessage("message954925063").build(); + client.failEchoWithDetails(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void expandTest() throws Exception { + EchoResponse expectedResponse = + EchoResponse.newBuilder() + .setContent("content951530617") + .setSeverity(Severity.forNumber(0)) + .setRequestId("requestId693933066") + .setOtherRequestId("otherRequestId1248995034") + .build(); + mockEcho.addResponse(expectedResponse); + ExpandRequest request = + ExpandRequest.newBuilder() + .setContent("content951530617") + .setError(Status.newBuilder().build()) + .setStreamWaitTime(Duration.newBuilder().build()) + .build(); + + MockStreamObserver responseObserver = new MockStreamObserver<>(); + + ServerStreamingCallable callable = client.expandCallable(); + callable.serverStreamingCall(request, responseObserver); + + List actualResponses = responseObserver.future().get(); + Assert.assertEquals(1, actualResponses.size()); + Assert.assertEquals(expectedResponse, actualResponses.get(0)); + } + + @Test + public void expandExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockEcho.addException(exception); + ExpandRequest request = + ExpandRequest.newBuilder() + .setContent("content951530617") + .setError(Status.newBuilder().build()) + .setStreamWaitTime(Duration.newBuilder().build()) + .build(); + + MockStreamObserver responseObserver = new MockStreamObserver<>(); + + ServerStreamingCallable callable = client.expandCallable(); + callable.serverStreamingCall(request, responseObserver); + + 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()); + } + } + + @Test + public void collectTest() throws Exception { + EchoResponse expectedResponse = + EchoResponse.newBuilder() + .setContent("content951530617") + .setSeverity(Severity.forNumber(0)) + .setRequestId("requestId693933066") + .setOtherRequestId("otherRequestId1248995034") + .build(); + mockEcho.addResponse(expectedResponse); + EchoRequest request = + EchoRequest.newBuilder() + .setSeverity(Severity.forNumber(0)) + .setHeader("header-1221270899") + .setOtherHeader("otherHeader-2026585667") + .setRequestId("requestId693933066") + .setOtherRequestId("otherRequestId1248995034") + .build(); + + MockStreamObserver responseObserver = new MockStreamObserver<>(); + + ClientStreamingCallable callable = client.collectCallable(); + ApiStreamObserver requestObserver = callable.clientStreamingCall(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 collectExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockEcho.addException(exception); + EchoRequest request = + EchoRequest.newBuilder() + .setSeverity(Severity.forNumber(0)) + .setHeader("header-1221270899") + .setOtherHeader("otherHeader-2026585667") + .setRequestId("requestId693933066") + .setOtherRequestId("otherRequestId1248995034") + .build(); + + MockStreamObserver responseObserver = new MockStreamObserver<>(); + + ClientStreamingCallable callable = client.collectCallable(); + ApiStreamObserver requestObserver = callable.clientStreamingCall(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()); + } + } + + @Test + public void chatTest() throws Exception { + EchoResponse expectedResponse = + EchoResponse.newBuilder() + .setContent("content951530617") + .setSeverity(Severity.forNumber(0)) + .setRequestId("requestId693933066") + .setOtherRequestId("otherRequestId1248995034") + .build(); + mockEcho.addResponse(expectedResponse); + EchoRequest request = + EchoRequest.newBuilder() + .setSeverity(Severity.forNumber(0)) + .setHeader("header-1221270899") + .setOtherHeader("otherHeader-2026585667") + .setRequestId("requestId693933066") + .setOtherRequestId("otherRequestId1248995034") + .build(); + + MockStreamObserver responseObserver = new MockStreamObserver<>(); + + BidiStreamingCallable callable = client.chatCallable(); + 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 chatExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockEcho.addException(exception); + EchoRequest request = + EchoRequest.newBuilder() + .setSeverity(Severity.forNumber(0)) + .setHeader("header-1221270899") + .setOtherHeader("otherHeader-2026585667") + .setRequestId("requestId693933066") + .setOtherRequestId("otherRequestId1248995034") + .build(); + + MockStreamObserver responseObserver = new MockStreamObserver<>(); + + BidiStreamingCallable callable = client.chatCallable(); + 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()); + } + } + + @Test + public void pagedExpandTest() throws Exception { + EchoResponse responsesElement = EchoResponse.newBuilder().build(); + PagedExpandResponse expectedResponse = + PagedExpandResponse.newBuilder() + .setNextPageToken("") + .addAllResponses(Arrays.asList(responsesElement)) + .build(); + mockEcho.addResponse(expectedResponse); + + PagedExpandRequest request = + PagedExpandRequest.newBuilder() + .setContent("content951530617") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + + PagedExpandPagedResponse pagedListResponse = client.pagedExpand(request); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getResponsesList().get(0), resources.get(0)); + + List actualRequests = mockEcho.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + PagedExpandRequest actualRequest = ((PagedExpandRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getContent(), actualRequest.getContent()); + Assert.assertEquals(request.getPageSize(), actualRequest.getPageSize()); + Assert.assertEquals(request.getPageToken(), actualRequest.getPageToken()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void pagedExpandExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockEcho.addException(exception); + + try { + PagedExpandRequest request = + PagedExpandRequest.newBuilder() + .setContent("content951530617") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + client.pagedExpand(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void pagedExpandLegacyTest() throws Exception { + PagedExpandResponse expectedResponse = + PagedExpandResponse.newBuilder() + .addAllResponses(new ArrayList()) + .setNextPageToken("nextPageToken-1386094857") + .build(); + mockEcho.addResponse(expectedResponse); + + PagedExpandLegacyRequest request = + PagedExpandLegacyRequest.newBuilder() + .setContent("content951530617") + .setMaxResults(1128457243) + .setPageToken("pageToken873572522") + .build(); + + PagedExpandResponse actualResponse = client.pagedExpandLegacy(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockEcho.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + PagedExpandLegacyRequest actualRequest = ((PagedExpandLegacyRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getContent(), actualRequest.getContent()); + Assert.assertEquals(request.getMaxResults(), actualRequest.getMaxResults()); + Assert.assertEquals(request.getPageToken(), actualRequest.getPageToken()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void pagedExpandLegacyExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockEcho.addException(exception); + + try { + PagedExpandLegacyRequest request = + PagedExpandLegacyRequest.newBuilder() + .setContent("content951530617") + .setMaxResults(1128457243) + .setPageToken("pageToken873572522") + .build(); + client.pagedExpandLegacy(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void pagedExpandLegacyMappedTest() throws Exception { + PagedExpandResponseList responsesElement = PagedExpandResponseList.newBuilder().build(); + PagedExpandLegacyMappedResponse expectedResponse = + PagedExpandLegacyMappedResponse.newBuilder() + .setNextPageToken("") + .putAllAlphabetized(Collections.singletonMap("alphabetized", responsesElement)) + .build(); + mockEcho.addResponse(expectedResponse); + + PagedExpandRequest request = + PagedExpandRequest.newBuilder() + .setContent("content951530617") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + + PagedExpandLegacyMappedPagedResponse pagedListResponse = + client.pagedExpandLegacyMapped(request); + + List> resources = + Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals( + expectedResponse.getAlphabetizedMap().entrySet().iterator().next(), resources.get(0)); + + List actualRequests = mockEcho.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + PagedExpandRequest actualRequest = ((PagedExpandRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getContent(), actualRequest.getContent()); + Assert.assertEquals(request.getPageSize(), actualRequest.getPageSize()); + Assert.assertEquals(request.getPageToken(), actualRequest.getPageToken()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void pagedExpandLegacyMappedExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockEcho.addException(exception); + + try { + PagedExpandRequest request = + PagedExpandRequest.newBuilder() + .setContent("content951530617") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + client.pagedExpandLegacyMapped(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void waitTest() throws Exception { + WaitResponse expectedResponse = + WaitResponse.newBuilder().setContent("content951530617").build(); + Operation resultOperation = + Operation.newBuilder() + .setName("waitTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockEcho.addResponse(resultOperation); + + WaitRequest request = WaitRequest.newBuilder().build(); + + WaitResponse actualResponse = client.waitAsync(request).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockEcho.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + WaitRequest actualRequest = ((WaitRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getEndTime(), actualRequest.getEndTime()); + Assert.assertEquals(request.getTtl(), actualRequest.getTtl()); + Assert.assertEquals(request.getError(), actualRequest.getError()); + Assert.assertEquals(request.getSuccess(), actualRequest.getSuccess()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void waitExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockEcho.addException(exception); + + try { + WaitRequest request = WaitRequest.newBuilder().build(); + client.waitAsync(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 blockTest() throws Exception { + BlockResponse expectedResponse = + BlockResponse.newBuilder().setContent("content951530617").build(); + mockEcho.addResponse(expectedResponse); + + BlockRequest request = + BlockRequest.newBuilder().setResponseDelay(Duration.newBuilder().build()).build(); + + BlockResponse actualResponse = client.block(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockEcho.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + BlockRequest actualRequest = ((BlockRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getResponseDelay(), actualRequest.getResponseDelay()); + Assert.assertEquals(request.getError(), actualRequest.getError()); + Assert.assertEquals(request.getSuccess(), actualRequest.getSuccess()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void blockExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockEcho.addException(exception); + + try { + BlockRequest request = + BlockRequest.newBuilder().setResponseDelay(Duration.newBuilder().build()).build(); + client.block(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listLocationsTest() throws Exception { + Location responsesElement = Location.newBuilder().build(); + ListLocationsResponse expectedResponse = + ListLocationsResponse.newBuilder() + .setNextPageToken("") + .addAllLocations(Arrays.asList(responsesElement)) + .build(); + mockLocations.addResponse(expectedResponse); + + ListLocationsRequest request = + ListLocationsRequest.newBuilder() + .setName("name3373707") + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + + ListLocationsPagedResponse pagedListResponse = client.listLocations(request); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getLocationsList().get(0), resources.get(0)); + + List actualRequests = mockLocations.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListLocationsRequest actualRequest = ((ListLocationsRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getName(), actualRequest.getName()); + Assert.assertEquals(request.getFilter(), actualRequest.getFilter()); + Assert.assertEquals(request.getPageSize(), actualRequest.getPageSize()); + Assert.assertEquals(request.getPageToken(), actualRequest.getPageToken()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listLocationsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockLocations.addException(exception); + + try { + ListLocationsRequest request = + ListLocationsRequest.newBuilder() + .setName("name3373707") + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + client.listLocations(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getLocationTest() throws Exception { + Location expectedResponse = + Location.newBuilder() + .setName("name3373707") + .setLocationId("locationId1541836720") + .setDisplayName("displayName1714148973") + .putAllLabels(new HashMap()) + .setMetadata(Any.newBuilder().build()) + .build(); + mockLocations.addResponse(expectedResponse); + + GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build(); + + Location actualResponse = client.getLocation(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockLocations.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetLocationRequest actualRequest = ((GetLocationRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getName(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getLocationExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockLocations.addException(exception); + + try { + GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build(); + client.getLocation(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void setIamPolicyTest() throws Exception { + Policy expectedResponse = + Policy.newBuilder() + .setVersion(351608024) + .addAllBindings(new ArrayList()) + .addAllAuditConfigs(new ArrayList()) + .setEtag(ByteString.EMPTY) + .build(); + mockIAMPolicy.addResponse(expectedResponse); + + SetIamPolicyRequest request = + SetIamPolicyRequest.newBuilder() + .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString()) + .setPolicy(Policy.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .build(); + + Policy actualResponse = client.setIamPolicy(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockIAMPolicy.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + SetIamPolicyRequest actualRequest = ((SetIamPolicyRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getResource(), actualRequest.getResource()); + Assert.assertEquals(request.getPolicy(), actualRequest.getPolicy()); + Assert.assertEquals(request.getUpdateMask(), actualRequest.getUpdateMask()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void setIamPolicyExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockIAMPolicy.addException(exception); + + try { + SetIamPolicyRequest request = + SetIamPolicyRequest.newBuilder() + .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString()) + .setPolicy(Policy.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .build(); + client.setIamPolicy(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getIamPolicyTest() throws Exception { + Policy expectedResponse = + Policy.newBuilder() + .setVersion(351608024) + .addAllBindings(new ArrayList()) + .addAllAuditConfigs(new ArrayList()) + .setEtag(ByteString.EMPTY) + .build(); + mockIAMPolicy.addResponse(expectedResponse); + + GetIamPolicyRequest request = + GetIamPolicyRequest.newBuilder() + .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString()) + .setOptions(GetPolicyOptions.newBuilder().build()) + .build(); + + Policy actualResponse = client.getIamPolicy(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockIAMPolicy.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetIamPolicyRequest actualRequest = ((GetIamPolicyRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getResource(), actualRequest.getResource()); + Assert.assertEquals(request.getOptions(), actualRequest.getOptions()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getIamPolicyExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockIAMPolicy.addException(exception); + + try { + GetIamPolicyRequest request = + GetIamPolicyRequest.newBuilder() + .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString()) + .setOptions(GetPolicyOptions.newBuilder().build()) + .build(); + client.getIamPolicy(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void testIamPermissionsTest() throws Exception { + TestIamPermissionsResponse expectedResponse = + TestIamPermissionsResponse.newBuilder().addAllPermissions(new ArrayList()).build(); + mockIAMPolicy.addResponse(expectedResponse); + + TestIamPermissionsRequest request = + TestIamPermissionsRequest.newBuilder() + .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString()) + .addAllPermissions(new ArrayList()) + .build(); + + TestIamPermissionsResponse actualResponse = client.testIamPermissions(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockIAMPolicy.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + TestIamPermissionsRequest actualRequest = ((TestIamPermissionsRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getResource(), actualRequest.getResource()); + Assert.assertEquals(request.getPermissionsList(), actualRequest.getPermissionsList()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void testIamPermissionsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockIAMPolicy.addException(exception); + + try { + TestIamPermissionsRequest request = + TestIamPermissionsRequest.newBuilder() + .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString()) + .addAllPermissions(new ArrayList()) + .build(); + client.testIamPermissions(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } +} diff --git a/java-showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/IdentityClientHttpJsonTest.java b/java-showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/IdentityClientHttpJsonTest.java new file mode 100644 index 0000000000..ebdb0b790f --- /dev/null +++ b/java-showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/IdentityClientHttpJsonTest.java @@ -0,0 +1,815 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1; + +import static com.google.showcase.v1beta1.IdentityClient.ListLocationsPagedResponse; +import static com.google.showcase.v1beta1.IdentityClient.ListUsersPagedResponse; + +import com.google.api.gax.core.NoCredentialsProvider; +import com.google.api.gax.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.testing.MockHttpService; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ApiException; +import com.google.api.gax.rpc.ApiExceptionFactory; +import com.google.api.gax.rpc.InvalidArgumentException; +import com.google.api.gax.rpc.StatusCode; +import com.google.api.gax.rpc.testing.FakeStatusCode; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.common.collect.Lists; +import com.google.iam.v1.AuditConfig; +import com.google.iam.v1.Binding; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.GetPolicyOptions; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.protobuf.Any; +import com.google.protobuf.ByteString; +import com.google.protobuf.Empty; +import com.google.protobuf.FieldMask; +import com.google.protobuf.Timestamp; +import com.google.showcase.v1beta1.stub.HttpJsonIdentityStub; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +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 IdentityClientHttpJsonTest { + private static MockHttpService mockService; + private static IdentityClient client; + + @BeforeClass + public static void startStaticServer() throws IOException { + mockService = + new MockHttpService( + HttpJsonIdentityStub.getMethodDescriptors(), IdentitySettings.getDefaultEndpoint()); + IdentitySettings settings = + IdentitySettings.newHttpJsonBuilder() + .setTransportChannelProvider( + IdentitySettings.defaultHttpJsonTransportProviderBuilder() + .setHttpTransport(mockService) + .build()) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = IdentityClient.create(settings); + } + + @AfterClass + public static void stopServer() { + client.close(); + } + + @Before + public void setUp() {} + + @After + public void tearDown() throws Exception { + mockService.reset(); + } + + @Test + public void createUserTest() throws Exception { + User expectedResponse = + User.newBuilder() + .setName(UserName.of("[USER]").toString()) + .setDisplayName("displayName1714148973") + .setEmail("email96619420") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setAge(96511) + .setHeightFeet(-1032737338) + .setNickname("nickname70690926") + .setEnableNotifications(true) + .build(); + mockService.addResponse(expectedResponse); + + String displayName = "displayName1714148973"; + String email = "email96619420"; + + User actualResponse = client.createUser(displayName, email); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void createUserExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String displayName = "displayName1714148973"; + String email = "email96619420"; + client.createUser(displayName, email); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createUserTest2() throws Exception { + User expectedResponse = + User.newBuilder() + .setName(UserName.of("[USER]").toString()) + .setDisplayName("displayName1714148973") + .setEmail("email96619420") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setAge(96511) + .setHeightFeet(-1032737338) + .setNickname("nickname70690926") + .setEnableNotifications(true) + .build(); + mockService.addResponse(expectedResponse); + + String displayName = "displayName1714148973"; + String email = "email96619420"; + int age = 96511; + String nickname = "nickname70690926"; + boolean enableNotifications = true; + double heightFeet = -1032737338; + + User actualResponse = + client.createUser(displayName, email, age, nickname, enableNotifications, heightFeet); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void createUserExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String displayName = "displayName1714148973"; + String email = "email96619420"; + int age = 96511; + String nickname = "nickname70690926"; + boolean enableNotifications = true; + double heightFeet = -1032737338; + client.createUser(displayName, email, age, nickname, enableNotifications, heightFeet); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getUserTest() throws Exception { + User expectedResponse = + User.newBuilder() + .setName(UserName.of("[USER]").toString()) + .setDisplayName("displayName1714148973") + .setEmail("email96619420") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setAge(96511) + .setHeightFeet(-1032737338) + .setNickname("nickname70690926") + .setEnableNotifications(true) + .build(); + mockService.addResponse(expectedResponse); + + UserName name = UserName.of("[USER]"); + + User actualResponse = client.getUser(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void getUserExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + UserName name = UserName.of("[USER]"); + client.getUser(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getUserTest2() throws Exception { + User expectedResponse = + User.newBuilder() + .setName(UserName.of("[USER]").toString()) + .setDisplayName("displayName1714148973") + .setEmail("email96619420") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setAge(96511) + .setHeightFeet(-1032737338) + .setNickname("nickname70690926") + .setEnableNotifications(true) + .build(); + mockService.addResponse(expectedResponse); + + String name = "users/user-6376"; + + User actualResponse = client.getUser(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void getUserExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String name = "users/user-6376"; + client.getUser(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void updateUserTest() throws Exception { + User expectedResponse = + User.newBuilder() + .setName(UserName.of("[USER]").toString()) + .setDisplayName("displayName1714148973") + .setEmail("email96619420") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setAge(96511) + .setHeightFeet(-1032737338) + .setNickname("nickname70690926") + .setEnableNotifications(true) + .build(); + mockService.addResponse(expectedResponse); + + UpdateUserRequest request = + UpdateUserRequest.newBuilder() + .setUser( + User.newBuilder() + .setName(UserName.of("[USER]").toString()) + .setDisplayName("displayName1714148973") + .setEmail("email96619420") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setAge(96511) + .setHeightFeet(-1032737338) + .setNickname("nickname70690926") + .setEnableNotifications(true) + .build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .build(); + + User actualResponse = client.updateUser(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void updateUserExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + UpdateUserRequest request = + UpdateUserRequest.newBuilder() + .setUser( + User.newBuilder() + .setName(UserName.of("[USER]").toString()) + .setDisplayName("displayName1714148973") + .setEmail("email96619420") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setAge(96511) + .setHeightFeet(-1032737338) + .setNickname("nickname70690926") + .setEnableNotifications(true) + .build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .build(); + client.updateUser(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void deleteUserTest() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockService.addResponse(expectedResponse); + + UserName name = UserName.of("[USER]"); + + client.deleteUser(name); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void deleteUserExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + UserName name = UserName.of("[USER]"); + client.deleteUser(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void deleteUserTest2() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockService.addResponse(expectedResponse); + + String name = "users/user-6376"; + + client.deleteUser(name); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void deleteUserExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String name = "users/user-6376"; + client.deleteUser(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listUsersTest() throws Exception { + User responsesElement = User.newBuilder().build(); + ListUsersResponse expectedResponse = + ListUsersResponse.newBuilder() + .setNextPageToken("") + .addAllUsers(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + ListUsersRequest request = + ListUsersRequest.newBuilder() + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + + ListUsersPagedResponse pagedListResponse = client.listUsers(request); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getUsersList().get(0), resources.get(0)); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void listUsersExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ListUsersRequest request = + ListUsersRequest.newBuilder() + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + client.listUsers(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listLocationsTest() throws Exception { + Location responsesElement = Location.newBuilder().build(); + ListLocationsResponse expectedResponse = + ListLocationsResponse.newBuilder() + .setNextPageToken("") + .addAllLocations(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + ListLocationsRequest request = + ListLocationsRequest.newBuilder() + .setName("projects/project-3664") + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + + ListLocationsPagedResponse pagedListResponse = client.listLocations(request); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getLocationsList().get(0), resources.get(0)); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void listLocationsExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ListLocationsRequest request = + ListLocationsRequest.newBuilder() + .setName("projects/project-3664") + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + client.listLocations(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getLocationTest() throws Exception { + Location expectedResponse = + Location.newBuilder() + .setName("name3373707") + .setLocationId("locationId1541836720") + .setDisplayName("displayName1714148973") + .putAllLabels(new HashMap()) + .setMetadata(Any.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + GetLocationRequest request = + GetLocationRequest.newBuilder() + .setName("projects/project-9062/locations/location-9062") + .build(); + + Location actualResponse = client.getLocation(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void getLocationExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + GetLocationRequest request = + GetLocationRequest.newBuilder() + .setName("projects/project-9062/locations/location-9062") + .build(); + client.getLocation(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void setIamPolicyTest() throws Exception { + Policy expectedResponse = + Policy.newBuilder() + .setVersion(351608024) + .addAllBindings(new ArrayList()) + .addAllAuditConfigs(new ArrayList()) + .setEtag(ByteString.EMPTY) + .build(); + mockService.addResponse(expectedResponse); + + SetIamPolicyRequest request = + SetIamPolicyRequest.newBuilder() + .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString()) + .setPolicy(Policy.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .build(); + + Policy actualResponse = client.setIamPolicy(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void setIamPolicyExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + SetIamPolicyRequest request = + SetIamPolicyRequest.newBuilder() + .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString()) + .setPolicy(Policy.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .build(); + client.setIamPolicy(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getIamPolicyTest() throws Exception { + Policy expectedResponse = + Policy.newBuilder() + .setVersion(351608024) + .addAllBindings(new ArrayList()) + .addAllAuditConfigs(new ArrayList()) + .setEtag(ByteString.EMPTY) + .build(); + mockService.addResponse(expectedResponse); + + GetIamPolicyRequest request = + GetIamPolicyRequest.newBuilder() + .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString()) + .setOptions(GetPolicyOptions.newBuilder().build()) + .build(); + + Policy actualResponse = client.getIamPolicy(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void getIamPolicyExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + GetIamPolicyRequest request = + GetIamPolicyRequest.newBuilder() + .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString()) + .setOptions(GetPolicyOptions.newBuilder().build()) + .build(); + client.getIamPolicy(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void testIamPermissionsTest() throws Exception { + TestIamPermissionsResponse expectedResponse = + TestIamPermissionsResponse.newBuilder().addAllPermissions(new ArrayList()).build(); + mockService.addResponse(expectedResponse); + + TestIamPermissionsRequest request = + TestIamPermissionsRequest.newBuilder() + .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString()) + .addAllPermissions(new ArrayList()) + .build(); + + TestIamPermissionsResponse actualResponse = client.testIamPermissions(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void testIamPermissionsExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + TestIamPermissionsRequest request = + TestIamPermissionsRequest.newBuilder() + .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString()) + .addAllPermissions(new ArrayList()) + .build(); + client.testIamPermissions(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } +} diff --git a/java-showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/IdentityClientTest.java b/java-showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/IdentityClientTest.java new file mode 100644 index 0000000000..a5d8474f64 --- /dev/null +++ b/java-showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/IdentityClientTest.java @@ -0,0 +1,733 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1; + +import static com.google.showcase.v1beta1.IdentityClient.ListLocationsPagedResponse; +import static com.google.showcase.v1beta1.IdentityClient.ListUsersPagedResponse; + +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.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.common.collect.Lists; +import com.google.iam.v1.AuditConfig; +import com.google.iam.v1.Binding; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.GetPolicyOptions; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.protobuf.AbstractMessage; +import com.google.protobuf.Any; +import com.google.protobuf.ByteString; +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.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 IdentityClientTest { + private static MockIAMPolicy mockIAMPolicy; + private static MockIdentity mockIdentity; + private static MockLocations mockLocations; + private static MockServiceHelper mockServiceHelper; + private LocalChannelProvider channelProvider; + private IdentityClient client; + + @BeforeClass + public static void startStaticServer() { + mockIdentity = new MockIdentity(); + mockLocations = new MockLocations(); + mockIAMPolicy = new MockIAMPolicy(); + mockServiceHelper = + new MockServiceHelper( + UUID.randomUUID().toString(), + Arrays.asList(mockIdentity, mockLocations, mockIAMPolicy)); + mockServiceHelper.start(); + } + + @AfterClass + public static void stopServer() { + mockServiceHelper.stop(); + } + + @Before + public void setUp() throws IOException { + mockServiceHelper.reset(); + channelProvider = mockServiceHelper.createChannelProvider(); + IdentitySettings settings = + IdentitySettings.newBuilder() + .setTransportChannelProvider(channelProvider) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = IdentityClient.create(settings); + } + + @After + public void tearDown() throws Exception { + client.close(); + } + + @Test + public void createUserTest() throws Exception { + User expectedResponse = + User.newBuilder() + .setName(UserName.of("[USER]").toString()) + .setDisplayName("displayName1714148973") + .setEmail("email96619420") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setAge(96511) + .setHeightFeet(-1032737338) + .setNickname("nickname70690926") + .setEnableNotifications(true) + .build(); + mockIdentity.addResponse(expectedResponse); + + String displayName = "displayName1714148973"; + String email = "email96619420"; + + User actualResponse = client.createUser(displayName, email); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockIdentity.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateUserRequest actualRequest = ((CreateUserRequest) actualRequests.get(0)); + + Assert.assertEquals(displayName, actualRequest.getUser().getDisplayName()); + Assert.assertEquals(email, actualRequest.getUser().getEmail()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void createUserExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockIdentity.addException(exception); + + try { + String displayName = "displayName1714148973"; + String email = "email96619420"; + client.createUser(displayName, email); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createUserTest2() throws Exception { + User expectedResponse = + User.newBuilder() + .setName(UserName.of("[USER]").toString()) + .setDisplayName("displayName1714148973") + .setEmail("email96619420") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setAge(96511) + .setHeightFeet(-1032737338) + .setNickname("nickname70690926") + .setEnableNotifications(true) + .build(); + mockIdentity.addResponse(expectedResponse); + + String displayName = "displayName1714148973"; + String email = "email96619420"; + int age = 96511; + String nickname = "nickname70690926"; + boolean enableNotifications = true; + double heightFeet = -1032737338; + + User actualResponse = + client.createUser(displayName, email, age, nickname, enableNotifications, heightFeet); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockIdentity.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateUserRequest actualRequest = ((CreateUserRequest) actualRequests.get(0)); + + Assert.assertEquals(displayName, actualRequest.getUser().getDisplayName()); + Assert.assertEquals(email, actualRequest.getUser().getEmail()); + Assert.assertEquals(age, actualRequest.getUser().getAge()); + Assert.assertEquals(nickname, actualRequest.getUser().getNickname()); + Assert.assertEquals(enableNotifications, actualRequest.getUser().getEnableNotifications()); + Assert.assertEquals(heightFeet, actualRequest.getUser().getHeightFeet(), 0.0001); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void createUserExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockIdentity.addException(exception); + + try { + String displayName = "displayName1714148973"; + String email = "email96619420"; + int age = 96511; + String nickname = "nickname70690926"; + boolean enableNotifications = true; + double heightFeet = -1032737338; + client.createUser(displayName, email, age, nickname, enableNotifications, heightFeet); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getUserTest() throws Exception { + User expectedResponse = + User.newBuilder() + .setName(UserName.of("[USER]").toString()) + .setDisplayName("displayName1714148973") + .setEmail("email96619420") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setAge(96511) + .setHeightFeet(-1032737338) + .setNickname("nickname70690926") + .setEnableNotifications(true) + .build(); + mockIdentity.addResponse(expectedResponse); + + UserName name = UserName.of("[USER]"); + + User actualResponse = client.getUser(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockIdentity.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetUserRequest actualRequest = ((GetUserRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getUserExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockIdentity.addException(exception); + + try { + UserName name = UserName.of("[USER]"); + client.getUser(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getUserTest2() throws Exception { + User expectedResponse = + User.newBuilder() + .setName(UserName.of("[USER]").toString()) + .setDisplayName("displayName1714148973") + .setEmail("email96619420") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setAge(96511) + .setHeightFeet(-1032737338) + .setNickname("nickname70690926") + .setEnableNotifications(true) + .build(); + mockIdentity.addResponse(expectedResponse); + + String name = "name3373707"; + + User actualResponse = client.getUser(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockIdentity.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetUserRequest actualRequest = ((GetUserRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getUserExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockIdentity.addException(exception); + + try { + String name = "name3373707"; + client.getUser(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void updateUserTest() throws Exception { + User expectedResponse = + User.newBuilder() + .setName(UserName.of("[USER]").toString()) + .setDisplayName("displayName1714148973") + .setEmail("email96619420") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setAge(96511) + .setHeightFeet(-1032737338) + .setNickname("nickname70690926") + .setEnableNotifications(true) + .build(); + mockIdentity.addResponse(expectedResponse); + + UpdateUserRequest request = + UpdateUserRequest.newBuilder() + .setUser(User.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .build(); + + User actualResponse = client.updateUser(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockIdentity.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + UpdateUserRequest actualRequest = ((UpdateUserRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getUser(), actualRequest.getUser()); + Assert.assertEquals(request.getUpdateMask(), actualRequest.getUpdateMask()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void updateUserExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockIdentity.addException(exception); + + try { + UpdateUserRequest request = + UpdateUserRequest.newBuilder() + .setUser(User.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .build(); + client.updateUser(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void deleteUserTest() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockIdentity.addResponse(expectedResponse); + + UserName name = UserName.of("[USER]"); + + client.deleteUser(name); + + List actualRequests = mockIdentity.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeleteUserRequest actualRequest = ((DeleteUserRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void deleteUserExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockIdentity.addException(exception); + + try { + UserName name = UserName.of("[USER]"); + client.deleteUser(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void deleteUserTest2() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockIdentity.addResponse(expectedResponse); + + String name = "name3373707"; + + client.deleteUser(name); + + List actualRequests = mockIdentity.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeleteUserRequest actualRequest = ((DeleteUserRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void deleteUserExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockIdentity.addException(exception); + + try { + String name = "name3373707"; + client.deleteUser(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listUsersTest() throws Exception { + User responsesElement = User.newBuilder().build(); + ListUsersResponse expectedResponse = + ListUsersResponse.newBuilder() + .setNextPageToken("") + .addAllUsers(Arrays.asList(responsesElement)) + .build(); + mockIdentity.addResponse(expectedResponse); + + ListUsersRequest request = + ListUsersRequest.newBuilder() + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + + ListUsersPagedResponse pagedListResponse = client.listUsers(request); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getUsersList().get(0), resources.get(0)); + + List actualRequests = mockIdentity.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListUsersRequest actualRequest = ((ListUsersRequest) 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 listUsersExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockIdentity.addException(exception); + + try { + ListUsersRequest request = + ListUsersRequest.newBuilder() + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + client.listUsers(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listLocationsTest() throws Exception { + Location responsesElement = Location.newBuilder().build(); + ListLocationsResponse expectedResponse = + ListLocationsResponse.newBuilder() + .setNextPageToken("") + .addAllLocations(Arrays.asList(responsesElement)) + .build(); + mockLocations.addResponse(expectedResponse); + + ListLocationsRequest request = + ListLocationsRequest.newBuilder() + .setName("name3373707") + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + + ListLocationsPagedResponse pagedListResponse = client.listLocations(request); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getLocationsList().get(0), resources.get(0)); + + List actualRequests = mockLocations.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListLocationsRequest actualRequest = ((ListLocationsRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getName(), actualRequest.getName()); + Assert.assertEquals(request.getFilter(), actualRequest.getFilter()); + Assert.assertEquals(request.getPageSize(), actualRequest.getPageSize()); + Assert.assertEquals(request.getPageToken(), actualRequest.getPageToken()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listLocationsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockLocations.addException(exception); + + try { + ListLocationsRequest request = + ListLocationsRequest.newBuilder() + .setName("name3373707") + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + client.listLocations(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getLocationTest() throws Exception { + Location expectedResponse = + Location.newBuilder() + .setName("name3373707") + .setLocationId("locationId1541836720") + .setDisplayName("displayName1714148973") + .putAllLabels(new HashMap()) + .setMetadata(Any.newBuilder().build()) + .build(); + mockLocations.addResponse(expectedResponse); + + GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build(); + + Location actualResponse = client.getLocation(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockLocations.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetLocationRequest actualRequest = ((GetLocationRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getName(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getLocationExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockLocations.addException(exception); + + try { + GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build(); + client.getLocation(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void setIamPolicyTest() throws Exception { + Policy expectedResponse = + Policy.newBuilder() + .setVersion(351608024) + .addAllBindings(new ArrayList()) + .addAllAuditConfigs(new ArrayList()) + .setEtag(ByteString.EMPTY) + .build(); + mockIAMPolicy.addResponse(expectedResponse); + + SetIamPolicyRequest request = + SetIamPolicyRequest.newBuilder() + .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString()) + .setPolicy(Policy.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .build(); + + Policy actualResponse = client.setIamPolicy(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockIAMPolicy.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + SetIamPolicyRequest actualRequest = ((SetIamPolicyRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getResource(), actualRequest.getResource()); + Assert.assertEquals(request.getPolicy(), actualRequest.getPolicy()); + Assert.assertEquals(request.getUpdateMask(), actualRequest.getUpdateMask()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void setIamPolicyExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockIAMPolicy.addException(exception); + + try { + SetIamPolicyRequest request = + SetIamPolicyRequest.newBuilder() + .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString()) + .setPolicy(Policy.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .build(); + client.setIamPolicy(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getIamPolicyTest() throws Exception { + Policy expectedResponse = + Policy.newBuilder() + .setVersion(351608024) + .addAllBindings(new ArrayList()) + .addAllAuditConfigs(new ArrayList()) + .setEtag(ByteString.EMPTY) + .build(); + mockIAMPolicy.addResponse(expectedResponse); + + GetIamPolicyRequest request = + GetIamPolicyRequest.newBuilder() + .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString()) + .setOptions(GetPolicyOptions.newBuilder().build()) + .build(); + + Policy actualResponse = client.getIamPolicy(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockIAMPolicy.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetIamPolicyRequest actualRequest = ((GetIamPolicyRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getResource(), actualRequest.getResource()); + Assert.assertEquals(request.getOptions(), actualRequest.getOptions()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getIamPolicyExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockIAMPolicy.addException(exception); + + try { + GetIamPolicyRequest request = + GetIamPolicyRequest.newBuilder() + .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString()) + .setOptions(GetPolicyOptions.newBuilder().build()) + .build(); + client.getIamPolicy(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void testIamPermissionsTest() throws Exception { + TestIamPermissionsResponse expectedResponse = + TestIamPermissionsResponse.newBuilder().addAllPermissions(new ArrayList()).build(); + mockIAMPolicy.addResponse(expectedResponse); + + TestIamPermissionsRequest request = + TestIamPermissionsRequest.newBuilder() + .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString()) + .addAllPermissions(new ArrayList()) + .build(); + + TestIamPermissionsResponse actualResponse = client.testIamPermissions(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockIAMPolicy.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + TestIamPermissionsRequest actualRequest = ((TestIamPermissionsRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getResource(), actualRequest.getResource()); + Assert.assertEquals(request.getPermissionsList(), actualRequest.getPermissionsList()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void testIamPermissionsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockIAMPolicy.addException(exception); + + try { + TestIamPermissionsRequest request = + TestIamPermissionsRequest.newBuilder() + .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString()) + .addAllPermissions(new ArrayList()) + .build(); + client.testIamPermissions(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } +} diff --git a/java-showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/MessagingClientHttpJsonTest.java b/java-showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/MessagingClientHttpJsonTest.java new file mode 100644 index 0000000000..993efb42e3 --- /dev/null +++ b/java-showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/MessagingClientHttpJsonTest.java @@ -0,0 +1,1937 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1; + +import static com.google.showcase.v1beta1.MessagingClient.ListBlurbsPagedResponse; +import static com.google.showcase.v1beta1.MessagingClient.ListLocationsPagedResponse; +import static com.google.showcase.v1beta1.MessagingClient.ListRoomsPagedResponse; + +import com.google.api.gax.core.NoCredentialsProvider; +import com.google.api.gax.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.testing.MockHttpService; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ApiException; +import com.google.api.gax.rpc.ApiExceptionFactory; +import com.google.api.gax.rpc.InvalidArgumentException; +import com.google.api.gax.rpc.StatusCode; +import com.google.api.gax.rpc.testing.FakeStatusCode; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.common.collect.Lists; +import com.google.iam.v1.AuditConfig; +import com.google.iam.v1.Binding; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.GetPolicyOptions; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.longrunning.Operation; +import com.google.protobuf.Any; +import com.google.protobuf.ByteString; +import com.google.protobuf.Empty; +import com.google.protobuf.FieldMask; +import com.google.protobuf.Timestamp; +import com.google.showcase.v1beta1.stub.HttpJsonMessagingStub; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +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 MessagingClientHttpJsonTest { + private static MockHttpService mockService; + private static MessagingClient client; + + @BeforeClass + public static void startStaticServer() throws IOException { + mockService = + new MockHttpService( + HttpJsonMessagingStub.getMethodDescriptors(), MessagingSettings.getDefaultEndpoint()); + MessagingSettings settings = + MessagingSettings.newHttpJsonBuilder() + .setTransportChannelProvider( + MessagingSettings.defaultHttpJsonTransportProviderBuilder() + .setHttpTransport(mockService) + .build()) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = MessagingClient.create(settings); + } + + @AfterClass + public static void stopServer() { + client.close(); + } + + @Before + public void setUp() {} + + @After + public void tearDown() throws Exception { + mockService.reset(); + } + + @Test + public void createRoomTest() throws Exception { + Room expectedResponse = + Room.newBuilder() + .setName(RoomName.of("[ROOM]").toString()) + .setDisplayName("displayName1714148973") + .setDescription("description-1724546052") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + String displayName = "displayName1714148973"; + String description = "description-1724546052"; + + Room actualResponse = client.createRoom(displayName, description); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void createRoomExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String displayName = "displayName1714148973"; + String description = "description-1724546052"; + client.createRoom(displayName, description); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getRoomTest() throws Exception { + Room expectedResponse = + Room.newBuilder() + .setName(RoomName.of("[ROOM]").toString()) + .setDisplayName("displayName1714148973") + .setDescription("description-1724546052") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + RoomName name = RoomName.of("[ROOM]"); + + Room actualResponse = client.getRoom(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void getRoomExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + RoomName name = RoomName.of("[ROOM]"); + client.getRoom(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getRoomTest2() throws Exception { + Room expectedResponse = + Room.newBuilder() + .setName(RoomName.of("[ROOM]").toString()) + .setDisplayName("displayName1714148973") + .setDescription("description-1724546052") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + String name = "rooms/room-472"; + + Room actualResponse = client.getRoom(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void getRoomExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String name = "rooms/room-472"; + client.getRoom(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void updateRoomTest() throws Exception { + Room expectedResponse = + Room.newBuilder() + .setName(RoomName.of("[ROOM]").toString()) + .setDisplayName("displayName1714148973") + .setDescription("description-1724546052") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + UpdateRoomRequest request = + UpdateRoomRequest.newBuilder() + .setRoom( + Room.newBuilder() + .setName(RoomName.of("[ROOM]").toString()) + .setDisplayName("displayName1714148973") + .setDescription("description-1724546052") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .build(); + + Room actualResponse = client.updateRoom(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void updateRoomExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + UpdateRoomRequest request = + UpdateRoomRequest.newBuilder() + .setRoom( + Room.newBuilder() + .setName(RoomName.of("[ROOM]").toString()) + .setDisplayName("displayName1714148973") + .setDescription("description-1724546052") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .build(); + client.updateRoom(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void deleteRoomTest() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockService.addResponse(expectedResponse); + + RoomName name = RoomName.of("[ROOM]"); + + client.deleteRoom(name); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void deleteRoomExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + RoomName name = RoomName.of("[ROOM]"); + client.deleteRoom(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void deleteRoomTest2() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockService.addResponse(expectedResponse); + + String name = "rooms/room-472"; + + client.deleteRoom(name); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void deleteRoomExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String name = "rooms/room-472"; + client.deleteRoom(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listRoomsTest() throws Exception { + Room responsesElement = Room.newBuilder().build(); + ListRoomsResponse expectedResponse = + ListRoomsResponse.newBuilder() + .setNextPageToken("") + .addAllRooms(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + ListRoomsRequest request = + ListRoomsRequest.newBuilder() + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + + ListRoomsPagedResponse pagedListResponse = client.listRooms(request); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getRoomsList().get(0), resources.get(0)); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void listRoomsExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ListRoomsRequest request = + ListRoomsRequest.newBuilder() + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + client.listRooms(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createBlurbTest() throws Exception { + Blurb expectedResponse = + Blurb.newBuilder() + .setName( + BlurbName.ofUserLegacyUserBlurbName("[USER]", "[LEGACY_USER]", "[BLURB]") + .toString()) + .setUser(UserName.of("[USER]").toString()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + ProfileName parent = ProfileName.of("[USER]"); + UserName user = UserName.of("[USER]"); + ByteString image = ByteString.EMPTY; + + Blurb actualResponse = client.createBlurb(parent, user, image); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void createBlurbExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ProfileName parent = ProfileName.of("[USER]"); + UserName user = UserName.of("[USER]"); + ByteString image = ByteString.EMPTY; + client.createBlurb(parent, user, image); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createBlurbTest2() throws Exception { + Blurb expectedResponse = + Blurb.newBuilder() + .setName( + BlurbName.ofUserLegacyUserBlurbName("[USER]", "[LEGACY_USER]", "[BLURB]") + .toString()) + .setUser(UserName.of("[USER]").toString()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + ProfileName parent = ProfileName.of("[USER]"); + UserName user = UserName.of("[USER]"); + String text = "text3556653"; + + Blurb actualResponse = client.createBlurb(parent, user, text); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void createBlurbExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ProfileName parent = ProfileName.of("[USER]"); + UserName user = UserName.of("[USER]"); + String text = "text3556653"; + client.createBlurb(parent, user, text); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createBlurbTest3() throws Exception { + Blurb expectedResponse = + Blurb.newBuilder() + .setName( + BlurbName.ofUserLegacyUserBlurbName("[USER]", "[LEGACY_USER]", "[BLURB]") + .toString()) + .setUser(UserName.of("[USER]").toString()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + ProfileName parent = ProfileName.of("[USER]"); + String user = "user3599307"; + ByteString image = ByteString.EMPTY; + + Blurb actualResponse = client.createBlurb(parent, user, image); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void createBlurbExceptionTest3() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ProfileName parent = ProfileName.of("[USER]"); + String user = "user3599307"; + ByteString image = ByteString.EMPTY; + client.createBlurb(parent, user, image); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createBlurbTest4() throws Exception { + Blurb expectedResponse = + Blurb.newBuilder() + .setName( + BlurbName.ofUserLegacyUserBlurbName("[USER]", "[LEGACY_USER]", "[BLURB]") + .toString()) + .setUser(UserName.of("[USER]").toString()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + ProfileName parent = ProfileName.of("[USER]"); + String user = "user3599307"; + String text = "text3556653"; + + Blurb actualResponse = client.createBlurb(parent, user, text); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void createBlurbExceptionTest4() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ProfileName parent = ProfileName.of("[USER]"); + String user = "user3599307"; + String text = "text3556653"; + client.createBlurb(parent, user, text); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createBlurbTest5() throws Exception { + Blurb expectedResponse = + Blurb.newBuilder() + .setName( + BlurbName.ofUserLegacyUserBlurbName("[USER]", "[LEGACY_USER]", "[BLURB]") + .toString()) + .setUser(UserName.of("[USER]").toString()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + RoomName parent = RoomName.of("[ROOM]"); + UserName user = UserName.of("[USER]"); + ByteString image = ByteString.EMPTY; + + Blurb actualResponse = client.createBlurb(parent, user, image); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void createBlurbExceptionTest5() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + RoomName parent = RoomName.of("[ROOM]"); + UserName user = UserName.of("[USER]"); + ByteString image = ByteString.EMPTY; + client.createBlurb(parent, user, image); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createBlurbTest6() throws Exception { + Blurb expectedResponse = + Blurb.newBuilder() + .setName( + BlurbName.ofUserLegacyUserBlurbName("[USER]", "[LEGACY_USER]", "[BLURB]") + .toString()) + .setUser(UserName.of("[USER]").toString()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + RoomName parent = RoomName.of("[ROOM]"); + UserName user = UserName.of("[USER]"); + String text = "text3556653"; + + Blurb actualResponse = client.createBlurb(parent, user, text); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void createBlurbExceptionTest6() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + RoomName parent = RoomName.of("[ROOM]"); + UserName user = UserName.of("[USER]"); + String text = "text3556653"; + client.createBlurb(parent, user, text); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createBlurbTest7() throws Exception { + Blurb expectedResponse = + Blurb.newBuilder() + .setName( + BlurbName.ofUserLegacyUserBlurbName("[USER]", "[LEGACY_USER]", "[BLURB]") + .toString()) + .setUser(UserName.of("[USER]").toString()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + RoomName parent = RoomName.of("[ROOM]"); + String user = "user3599307"; + ByteString image = ByteString.EMPTY; + + Blurb actualResponse = client.createBlurb(parent, user, image); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void createBlurbExceptionTest7() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + RoomName parent = RoomName.of("[ROOM]"); + String user = "user3599307"; + ByteString image = ByteString.EMPTY; + client.createBlurb(parent, user, image); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createBlurbTest8() throws Exception { + Blurb expectedResponse = + Blurb.newBuilder() + .setName( + BlurbName.ofUserLegacyUserBlurbName("[USER]", "[LEGACY_USER]", "[BLURB]") + .toString()) + .setUser(UserName.of("[USER]").toString()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + RoomName parent = RoomName.of("[ROOM]"); + String user = "user3599307"; + String text = "text3556653"; + + Blurb actualResponse = client.createBlurb(parent, user, text); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void createBlurbExceptionTest8() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + RoomName parent = RoomName.of("[ROOM]"); + String user = "user3599307"; + String text = "text3556653"; + client.createBlurb(parent, user, text); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createBlurbTest9() throws Exception { + Blurb expectedResponse = + Blurb.newBuilder() + .setName( + BlurbName.ofUserLegacyUserBlurbName("[USER]", "[LEGACY_USER]", "[BLURB]") + .toString()) + .setUser(UserName.of("[USER]").toString()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + String parent = "rooms/room-4889"; + UserName user = UserName.of("[USER]"); + ByteString image = ByteString.EMPTY; + + Blurb actualResponse = client.createBlurb(parent, user, image); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void createBlurbExceptionTest9() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String parent = "rooms/room-4889"; + UserName user = UserName.of("[USER]"); + ByteString image = ByteString.EMPTY; + client.createBlurb(parent, user, image); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createBlurbTest10() throws Exception { + Blurb expectedResponse = + Blurb.newBuilder() + .setName( + BlurbName.ofUserLegacyUserBlurbName("[USER]", "[LEGACY_USER]", "[BLURB]") + .toString()) + .setUser(UserName.of("[USER]").toString()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + String parent = "rooms/room-4889"; + UserName user = UserName.of("[USER]"); + String text = "text3556653"; + + Blurb actualResponse = client.createBlurb(parent, user, text); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void createBlurbExceptionTest10() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String parent = "rooms/room-4889"; + UserName user = UserName.of("[USER]"); + String text = "text3556653"; + client.createBlurb(parent, user, text); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createBlurbTest11() throws Exception { + Blurb expectedResponse = + Blurb.newBuilder() + .setName( + BlurbName.ofUserLegacyUserBlurbName("[USER]", "[LEGACY_USER]", "[BLURB]") + .toString()) + .setUser(UserName.of("[USER]").toString()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + String parent = "rooms/room-4889"; + String user = "user3599307"; + ByteString image = ByteString.EMPTY; + + Blurb actualResponse = client.createBlurb(parent, user, image); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void createBlurbExceptionTest11() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String parent = "rooms/room-4889"; + String user = "user3599307"; + ByteString image = ByteString.EMPTY; + client.createBlurb(parent, user, image); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createBlurbTest12() throws Exception { + Blurb expectedResponse = + Blurb.newBuilder() + .setName( + BlurbName.ofUserLegacyUserBlurbName("[USER]", "[LEGACY_USER]", "[BLURB]") + .toString()) + .setUser(UserName.of("[USER]").toString()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + String parent = "rooms/room-4889"; + String user = "user3599307"; + String text = "text3556653"; + + Blurb actualResponse = client.createBlurb(parent, user, text); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void createBlurbExceptionTest12() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String parent = "rooms/room-4889"; + String user = "user3599307"; + String text = "text3556653"; + client.createBlurb(parent, user, text); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getBlurbTest() throws Exception { + Blurb expectedResponse = + Blurb.newBuilder() + .setName(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString()) + .setUser(UserName.of("[USER]").toString()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + BlurbName name = BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]"); + + Blurb actualResponse = client.getBlurb(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void getBlurbExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + BlurbName name = BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]"); + client.getBlurb(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getBlurbTest2() throws Exception { + Blurb expectedResponse = + Blurb.newBuilder() + .setName(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString()) + .setUser(UserName.of("[USER]").toString()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + String name = "rooms/room-9094/blurbs/blurb-9094"; + + Blurb actualResponse = client.getBlurb(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void getBlurbExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String name = "rooms/room-9094/blurbs/blurb-9094"; + client.getBlurb(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void updateBlurbTest() throws Exception { + Blurb expectedResponse = + Blurb.newBuilder() + .setName(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString()) + .setUser(UserName.of("[USER]").toString()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + UpdateBlurbRequest request = + UpdateBlurbRequest.newBuilder() + .setBlurb( + Blurb.newBuilder() + .setName(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString()) + .setUser(UserName.of("[USER]").toString()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .build(); + + Blurb actualResponse = client.updateBlurb(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void updateBlurbExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + UpdateBlurbRequest request = + UpdateBlurbRequest.newBuilder() + .setBlurb( + Blurb.newBuilder() + .setName(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString()) + .setUser(UserName.of("[USER]").toString()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .build(); + client.updateBlurb(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void deleteBlurbTest() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockService.addResponse(expectedResponse); + + BlurbName name = BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]"); + + client.deleteBlurb(name); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void deleteBlurbExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + BlurbName name = BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]"); + client.deleteBlurb(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void deleteBlurbTest2() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockService.addResponse(expectedResponse); + + String name = "rooms/room-9094/blurbs/blurb-9094"; + + client.deleteBlurb(name); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void deleteBlurbExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String name = "rooms/room-9094/blurbs/blurb-9094"; + client.deleteBlurb(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listBlurbsTest() throws Exception { + Blurb responsesElement = Blurb.newBuilder().build(); + ListBlurbsResponse expectedResponse = + ListBlurbsResponse.newBuilder() + .setNextPageToken("") + .addAllBlurbs(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + ProfileName parent = ProfileName.of("[USER]"); + + ListBlurbsPagedResponse pagedListResponse = client.listBlurbs(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getBlurbsList().get(0), resources.get(0)); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void listBlurbsExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ProfileName parent = ProfileName.of("[USER]"); + client.listBlurbs(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listBlurbsTest2() throws Exception { + Blurb responsesElement = Blurb.newBuilder().build(); + ListBlurbsResponse expectedResponse = + ListBlurbsResponse.newBuilder() + .setNextPageToken("") + .addAllBlurbs(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + RoomName parent = RoomName.of("[ROOM]"); + + ListBlurbsPagedResponse pagedListResponse = client.listBlurbs(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getBlurbsList().get(0), resources.get(0)); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void listBlurbsExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + RoomName parent = RoomName.of("[ROOM]"); + client.listBlurbs(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listBlurbsTest3() throws Exception { + Blurb responsesElement = Blurb.newBuilder().build(); + ListBlurbsResponse expectedResponse = + ListBlurbsResponse.newBuilder() + .setNextPageToken("") + .addAllBlurbs(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + String parent = "rooms/room-4889"; + + ListBlurbsPagedResponse pagedListResponse = client.listBlurbs(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getBlurbsList().get(0), resources.get(0)); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void listBlurbsExceptionTest3() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String parent = "rooms/room-4889"; + client.listBlurbs(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void searchBlurbsTest() throws Exception { + SearchBlurbsResponse expectedResponse = + SearchBlurbsResponse.newBuilder() + .addAllBlurbs(new ArrayList()) + .setNextPageToken("nextPageToken-1386094857") + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("searchBlurbsTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockService.addResponse(resultOperation); + + ProfileName parent = ProfileName.of("[USER]"); + String query = "query107944136"; + + SearchBlurbsResponse actualResponse = client.searchBlurbsAsync(parent, query).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void searchBlurbsExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ProfileName parent = ProfileName.of("[USER]"); + String query = "query107944136"; + client.searchBlurbsAsync(parent, query).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + } + } + + @Test + public void searchBlurbsTest2() throws Exception { + SearchBlurbsResponse expectedResponse = + SearchBlurbsResponse.newBuilder() + .addAllBlurbs(new ArrayList()) + .setNextPageToken("nextPageToken-1386094857") + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("searchBlurbsTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockService.addResponse(resultOperation); + + RoomName parent = RoomName.of("[ROOM]"); + String query = "query107944136"; + + SearchBlurbsResponse actualResponse = client.searchBlurbsAsync(parent, query).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void searchBlurbsExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + RoomName parent = RoomName.of("[ROOM]"); + String query = "query107944136"; + client.searchBlurbsAsync(parent, query).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + } + } + + @Test + public void searchBlurbsTest3() throws Exception { + SearchBlurbsResponse expectedResponse = + SearchBlurbsResponse.newBuilder() + .addAllBlurbs(new ArrayList()) + .setNextPageToken("nextPageToken-1386094857") + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("searchBlurbsTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockService.addResponse(resultOperation); + + String parent = "rooms/room-4889"; + String query = "query107944136"; + + SearchBlurbsResponse actualResponse = client.searchBlurbsAsync(parent, query).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void searchBlurbsExceptionTest3() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String parent = "rooms/room-4889"; + String query = "query107944136"; + client.searchBlurbsAsync(parent, query).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + } + } + + @Test + public void streamBlurbsTest() throws Exception {} + + @Test + public void streamBlurbsExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + } + + @Test + public void sendBlurbsUnsupportedMethodTest() throws Exception { + // The sendBlurbs() method is not supported in REST transport. + // This empty test is generated for technical reasons. + } + + @Test + public void connectUnsupportedMethodTest() throws Exception { + // The connect() method is not supported in REST transport. + // This empty test is generated for technical reasons. + } + + @Test + public void listLocationsTest() throws Exception { + Location responsesElement = Location.newBuilder().build(); + ListLocationsResponse expectedResponse = + ListLocationsResponse.newBuilder() + .setNextPageToken("") + .addAllLocations(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + ListLocationsRequest request = + ListLocationsRequest.newBuilder() + .setName("projects/project-3664") + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + + ListLocationsPagedResponse pagedListResponse = client.listLocations(request); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getLocationsList().get(0), resources.get(0)); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void listLocationsExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ListLocationsRequest request = + ListLocationsRequest.newBuilder() + .setName("projects/project-3664") + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + client.listLocations(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getLocationTest() throws Exception { + Location expectedResponse = + Location.newBuilder() + .setName("name3373707") + .setLocationId("locationId1541836720") + .setDisplayName("displayName1714148973") + .putAllLabels(new HashMap()) + .setMetadata(Any.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + GetLocationRequest request = + GetLocationRequest.newBuilder() + .setName("projects/project-9062/locations/location-9062") + .build(); + + Location actualResponse = client.getLocation(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void getLocationExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + GetLocationRequest request = + GetLocationRequest.newBuilder() + .setName("projects/project-9062/locations/location-9062") + .build(); + client.getLocation(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void setIamPolicyTest() throws Exception { + Policy expectedResponse = + Policy.newBuilder() + .setVersion(351608024) + .addAllBindings(new ArrayList()) + .addAllAuditConfigs(new ArrayList()) + .setEtag(ByteString.EMPTY) + .build(); + mockService.addResponse(expectedResponse); + + SetIamPolicyRequest request = + SetIamPolicyRequest.newBuilder() + .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString()) + .setPolicy(Policy.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .build(); + + Policy actualResponse = client.setIamPolicy(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void setIamPolicyExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + SetIamPolicyRequest request = + SetIamPolicyRequest.newBuilder() + .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString()) + .setPolicy(Policy.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .build(); + client.setIamPolicy(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getIamPolicyTest() throws Exception { + Policy expectedResponse = + Policy.newBuilder() + .setVersion(351608024) + .addAllBindings(new ArrayList()) + .addAllAuditConfigs(new ArrayList()) + .setEtag(ByteString.EMPTY) + .build(); + mockService.addResponse(expectedResponse); + + GetIamPolicyRequest request = + GetIamPolicyRequest.newBuilder() + .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString()) + .setOptions(GetPolicyOptions.newBuilder().build()) + .build(); + + Policy actualResponse = client.getIamPolicy(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void getIamPolicyExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + GetIamPolicyRequest request = + GetIamPolicyRequest.newBuilder() + .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString()) + .setOptions(GetPolicyOptions.newBuilder().build()) + .build(); + client.getIamPolicy(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void testIamPermissionsTest() throws Exception { + TestIamPermissionsResponse expectedResponse = + TestIamPermissionsResponse.newBuilder().addAllPermissions(new ArrayList()).build(); + mockService.addResponse(expectedResponse); + + TestIamPermissionsRequest request = + TestIamPermissionsRequest.newBuilder() + .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString()) + .addAllPermissions(new ArrayList()) + .build(); + + TestIamPermissionsResponse actualResponse = client.testIamPermissions(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void testIamPermissionsExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + TestIamPermissionsRequest request = + TestIamPermissionsRequest.newBuilder() + .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString()) + .addAllPermissions(new ArrayList()) + .build(); + client.testIamPermissions(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } +} diff --git a/java-showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/MessagingClientTest.java b/java-showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/MessagingClientTest.java new file mode 100644 index 0000000000..2ec9a04365 --- /dev/null +++ b/java-showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/MessagingClientTest.java @@ -0,0 +1,1882 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1; + +import static com.google.showcase.v1beta1.MessagingClient.ListBlurbsPagedResponse; +import static com.google.showcase.v1beta1.MessagingClient.ListLocationsPagedResponse; +import static com.google.showcase.v1beta1.MessagingClient.ListRoomsPagedResponse; + +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.ClientStreamingCallable; +import com.google.api.gax.rpc.InvalidArgumentException; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.api.gax.rpc.StatusCode; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.common.collect.Lists; +import com.google.iam.v1.AuditConfig; +import com.google.iam.v1.Binding; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.GetPolicyOptions; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.longrunning.Operation; +import com.google.protobuf.AbstractMessage; +import com.google.protobuf.Any; +import com.google.protobuf.ByteString; +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.HashMap; +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 MessagingClientTest { + private static MockIAMPolicy mockIAMPolicy; + private static MockLocations mockLocations; + private static MockMessaging mockMessaging; + private static MockServiceHelper mockServiceHelper; + private LocalChannelProvider channelProvider; + private MessagingClient client; + + @BeforeClass + public static void startStaticServer() { + mockMessaging = new MockMessaging(); + mockLocations = new MockLocations(); + mockIAMPolicy = new MockIAMPolicy(); + mockServiceHelper = + new MockServiceHelper( + UUID.randomUUID().toString(), + Arrays.asList(mockMessaging, mockLocations, mockIAMPolicy)); + mockServiceHelper.start(); + } + + @AfterClass + public static void stopServer() { + mockServiceHelper.stop(); + } + + @Before + public void setUp() throws IOException { + mockServiceHelper.reset(); + channelProvider = mockServiceHelper.createChannelProvider(); + MessagingSettings settings = + MessagingSettings.newBuilder() + .setTransportChannelProvider(channelProvider) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = MessagingClient.create(settings); + } + + @After + public void tearDown() throws Exception { + client.close(); + } + + @Test + public void createRoomTest() throws Exception { + Room expectedResponse = + Room.newBuilder() + .setName(RoomName.of("[ROOM]").toString()) + .setDisplayName("displayName1714148973") + .setDescription("description-1724546052") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .build(); + mockMessaging.addResponse(expectedResponse); + + String displayName = "displayName1714148973"; + String description = "description-1724546052"; + + Room actualResponse = client.createRoom(displayName, description); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockMessaging.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateRoomRequest actualRequest = ((CreateRoomRequest) actualRequests.get(0)); + + Assert.assertEquals(displayName, actualRequest.getRoom().getDisplayName()); + Assert.assertEquals(description, actualRequest.getRoom().getDescription()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void createRoomExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockMessaging.addException(exception); + + try { + String displayName = "displayName1714148973"; + String description = "description-1724546052"; + client.createRoom(displayName, description); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getRoomTest() throws Exception { + Room expectedResponse = + Room.newBuilder() + .setName(RoomName.of("[ROOM]").toString()) + .setDisplayName("displayName1714148973") + .setDescription("description-1724546052") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .build(); + mockMessaging.addResponse(expectedResponse); + + RoomName name = RoomName.of("[ROOM]"); + + Room actualResponse = client.getRoom(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockMessaging.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetRoomRequest actualRequest = ((GetRoomRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getRoomExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockMessaging.addException(exception); + + try { + RoomName name = RoomName.of("[ROOM]"); + client.getRoom(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getRoomTest2() throws Exception { + Room expectedResponse = + Room.newBuilder() + .setName(RoomName.of("[ROOM]").toString()) + .setDisplayName("displayName1714148973") + .setDescription("description-1724546052") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .build(); + mockMessaging.addResponse(expectedResponse); + + String name = "name3373707"; + + Room actualResponse = client.getRoom(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockMessaging.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetRoomRequest actualRequest = ((GetRoomRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getRoomExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockMessaging.addException(exception); + + try { + String name = "name3373707"; + client.getRoom(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void updateRoomTest() throws Exception { + Room expectedResponse = + Room.newBuilder() + .setName(RoomName.of("[ROOM]").toString()) + .setDisplayName("displayName1714148973") + .setDescription("description-1724546052") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .build(); + mockMessaging.addResponse(expectedResponse); + + UpdateRoomRequest request = + UpdateRoomRequest.newBuilder() + .setRoom(Room.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .build(); + + Room actualResponse = client.updateRoom(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockMessaging.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + UpdateRoomRequest actualRequest = ((UpdateRoomRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getRoom(), actualRequest.getRoom()); + Assert.assertEquals(request.getUpdateMask(), actualRequest.getUpdateMask()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void updateRoomExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockMessaging.addException(exception); + + try { + UpdateRoomRequest request = + UpdateRoomRequest.newBuilder() + .setRoom(Room.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .build(); + client.updateRoom(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void deleteRoomTest() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockMessaging.addResponse(expectedResponse); + + RoomName name = RoomName.of("[ROOM]"); + + client.deleteRoom(name); + + List actualRequests = mockMessaging.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeleteRoomRequest actualRequest = ((DeleteRoomRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void deleteRoomExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockMessaging.addException(exception); + + try { + RoomName name = RoomName.of("[ROOM]"); + client.deleteRoom(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void deleteRoomTest2() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockMessaging.addResponse(expectedResponse); + + String name = "name3373707"; + + client.deleteRoom(name); + + List actualRequests = mockMessaging.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeleteRoomRequest actualRequest = ((DeleteRoomRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void deleteRoomExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockMessaging.addException(exception); + + try { + String name = "name3373707"; + client.deleteRoom(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listRoomsTest() throws Exception { + Room responsesElement = Room.newBuilder().build(); + ListRoomsResponse expectedResponse = + ListRoomsResponse.newBuilder() + .setNextPageToken("") + .addAllRooms(Arrays.asList(responsesElement)) + .build(); + mockMessaging.addResponse(expectedResponse); + + ListRoomsRequest request = + ListRoomsRequest.newBuilder() + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + + ListRoomsPagedResponse pagedListResponse = client.listRooms(request); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getRoomsList().get(0), resources.get(0)); + + List actualRequests = mockMessaging.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListRoomsRequest actualRequest = ((ListRoomsRequest) 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 listRoomsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockMessaging.addException(exception); + + try { + ListRoomsRequest request = + ListRoomsRequest.newBuilder() + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + client.listRooms(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createBlurbTest() throws Exception { + Blurb expectedResponse = + Blurb.newBuilder() + .setName( + BlurbName.ofUserLegacyUserBlurbName("[USER]", "[LEGACY_USER]", "[BLURB]") + .toString()) + .setUser(UserName.of("[USER]").toString()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .build(); + mockMessaging.addResponse(expectedResponse); + + ProfileName parent = ProfileName.of("[USER]"); + UserName user = UserName.of("[USER]"); + ByteString image = ByteString.EMPTY; + + Blurb actualResponse = client.createBlurb(parent, user, image); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockMessaging.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateBlurbRequest actualRequest = ((CreateBlurbRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertEquals(user.toString(), actualRequest.getBlurb().getUser()); + Assert.assertEquals(image, actualRequest.getBlurb().getImage()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void createBlurbExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockMessaging.addException(exception); + + try { + ProfileName parent = ProfileName.of("[USER]"); + UserName user = UserName.of("[USER]"); + ByteString image = ByteString.EMPTY; + client.createBlurb(parent, user, image); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createBlurbTest2() throws Exception { + Blurb expectedResponse = + Blurb.newBuilder() + .setName( + BlurbName.ofUserLegacyUserBlurbName("[USER]", "[LEGACY_USER]", "[BLURB]") + .toString()) + .setUser(UserName.of("[USER]").toString()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .build(); + mockMessaging.addResponse(expectedResponse); + + ProfileName parent = ProfileName.of("[USER]"); + UserName user = UserName.of("[USER]"); + String text = "text3556653"; + + Blurb actualResponse = client.createBlurb(parent, user, text); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockMessaging.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateBlurbRequest actualRequest = ((CreateBlurbRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertEquals(user.toString(), actualRequest.getBlurb().getUser()); + Assert.assertEquals(text, actualRequest.getBlurb().getText()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void createBlurbExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockMessaging.addException(exception); + + try { + ProfileName parent = ProfileName.of("[USER]"); + UserName user = UserName.of("[USER]"); + String text = "text3556653"; + client.createBlurb(parent, user, text); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createBlurbTest3() throws Exception { + Blurb expectedResponse = + Blurb.newBuilder() + .setName( + BlurbName.ofUserLegacyUserBlurbName("[USER]", "[LEGACY_USER]", "[BLURB]") + .toString()) + .setUser(UserName.of("[USER]").toString()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .build(); + mockMessaging.addResponse(expectedResponse); + + ProfileName parent = ProfileName.of("[USER]"); + String user = "user3599307"; + ByteString image = ByteString.EMPTY; + + Blurb actualResponse = client.createBlurb(parent, user, image); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockMessaging.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateBlurbRequest actualRequest = ((CreateBlurbRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertEquals(user, actualRequest.getBlurb().getUser()); + Assert.assertEquals(image, actualRequest.getBlurb().getImage()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void createBlurbExceptionTest3() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockMessaging.addException(exception); + + try { + ProfileName parent = ProfileName.of("[USER]"); + String user = "user3599307"; + ByteString image = ByteString.EMPTY; + client.createBlurb(parent, user, image); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createBlurbTest4() throws Exception { + Blurb expectedResponse = + Blurb.newBuilder() + .setName( + BlurbName.ofUserLegacyUserBlurbName("[USER]", "[LEGACY_USER]", "[BLURB]") + .toString()) + .setUser(UserName.of("[USER]").toString()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .build(); + mockMessaging.addResponse(expectedResponse); + + ProfileName parent = ProfileName.of("[USER]"); + String user = "user3599307"; + String text = "text3556653"; + + Blurb actualResponse = client.createBlurb(parent, user, text); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockMessaging.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateBlurbRequest actualRequest = ((CreateBlurbRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertEquals(user, actualRequest.getBlurb().getUser()); + Assert.assertEquals(text, actualRequest.getBlurb().getText()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void createBlurbExceptionTest4() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockMessaging.addException(exception); + + try { + ProfileName parent = ProfileName.of("[USER]"); + String user = "user3599307"; + String text = "text3556653"; + client.createBlurb(parent, user, text); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createBlurbTest5() throws Exception { + Blurb expectedResponse = + Blurb.newBuilder() + .setName( + BlurbName.ofUserLegacyUserBlurbName("[USER]", "[LEGACY_USER]", "[BLURB]") + .toString()) + .setUser(UserName.of("[USER]").toString()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .build(); + mockMessaging.addResponse(expectedResponse); + + RoomName parent = RoomName.of("[ROOM]"); + UserName user = UserName.of("[USER]"); + ByteString image = ByteString.EMPTY; + + Blurb actualResponse = client.createBlurb(parent, user, image); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockMessaging.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateBlurbRequest actualRequest = ((CreateBlurbRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertEquals(user.toString(), actualRequest.getBlurb().getUser()); + Assert.assertEquals(image, actualRequest.getBlurb().getImage()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void createBlurbExceptionTest5() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockMessaging.addException(exception); + + try { + RoomName parent = RoomName.of("[ROOM]"); + UserName user = UserName.of("[USER]"); + ByteString image = ByteString.EMPTY; + client.createBlurb(parent, user, image); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createBlurbTest6() throws Exception { + Blurb expectedResponse = + Blurb.newBuilder() + .setName( + BlurbName.ofUserLegacyUserBlurbName("[USER]", "[LEGACY_USER]", "[BLURB]") + .toString()) + .setUser(UserName.of("[USER]").toString()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .build(); + mockMessaging.addResponse(expectedResponse); + + RoomName parent = RoomName.of("[ROOM]"); + UserName user = UserName.of("[USER]"); + String text = "text3556653"; + + Blurb actualResponse = client.createBlurb(parent, user, text); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockMessaging.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateBlurbRequest actualRequest = ((CreateBlurbRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertEquals(user.toString(), actualRequest.getBlurb().getUser()); + Assert.assertEquals(text, actualRequest.getBlurb().getText()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void createBlurbExceptionTest6() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockMessaging.addException(exception); + + try { + RoomName parent = RoomName.of("[ROOM]"); + UserName user = UserName.of("[USER]"); + String text = "text3556653"; + client.createBlurb(parent, user, text); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createBlurbTest7() throws Exception { + Blurb expectedResponse = + Blurb.newBuilder() + .setName( + BlurbName.ofUserLegacyUserBlurbName("[USER]", "[LEGACY_USER]", "[BLURB]") + .toString()) + .setUser(UserName.of("[USER]").toString()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .build(); + mockMessaging.addResponse(expectedResponse); + + RoomName parent = RoomName.of("[ROOM]"); + String user = "user3599307"; + ByteString image = ByteString.EMPTY; + + Blurb actualResponse = client.createBlurb(parent, user, image); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockMessaging.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateBlurbRequest actualRequest = ((CreateBlurbRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertEquals(user, actualRequest.getBlurb().getUser()); + Assert.assertEquals(image, actualRequest.getBlurb().getImage()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void createBlurbExceptionTest7() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockMessaging.addException(exception); + + try { + RoomName parent = RoomName.of("[ROOM]"); + String user = "user3599307"; + ByteString image = ByteString.EMPTY; + client.createBlurb(parent, user, image); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createBlurbTest8() throws Exception { + Blurb expectedResponse = + Blurb.newBuilder() + .setName( + BlurbName.ofUserLegacyUserBlurbName("[USER]", "[LEGACY_USER]", "[BLURB]") + .toString()) + .setUser(UserName.of("[USER]").toString()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .build(); + mockMessaging.addResponse(expectedResponse); + + RoomName parent = RoomName.of("[ROOM]"); + String user = "user3599307"; + String text = "text3556653"; + + Blurb actualResponse = client.createBlurb(parent, user, text); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockMessaging.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateBlurbRequest actualRequest = ((CreateBlurbRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertEquals(user, actualRequest.getBlurb().getUser()); + Assert.assertEquals(text, actualRequest.getBlurb().getText()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void createBlurbExceptionTest8() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockMessaging.addException(exception); + + try { + RoomName parent = RoomName.of("[ROOM]"); + String user = "user3599307"; + String text = "text3556653"; + client.createBlurb(parent, user, text); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createBlurbTest9() throws Exception { + Blurb expectedResponse = + Blurb.newBuilder() + .setName( + BlurbName.ofUserLegacyUserBlurbName("[USER]", "[LEGACY_USER]", "[BLURB]") + .toString()) + .setUser(UserName.of("[USER]").toString()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .build(); + mockMessaging.addResponse(expectedResponse); + + String parent = "parent-995424086"; + UserName user = UserName.of("[USER]"); + ByteString image = ByteString.EMPTY; + + Blurb actualResponse = client.createBlurb(parent, user, image); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockMessaging.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateBlurbRequest actualRequest = ((CreateBlurbRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertEquals(user.toString(), actualRequest.getBlurb().getUser()); + Assert.assertEquals(image, actualRequest.getBlurb().getImage()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void createBlurbExceptionTest9() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockMessaging.addException(exception); + + try { + String parent = "parent-995424086"; + UserName user = UserName.of("[USER]"); + ByteString image = ByteString.EMPTY; + client.createBlurb(parent, user, image); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createBlurbTest10() throws Exception { + Blurb expectedResponse = + Blurb.newBuilder() + .setName( + BlurbName.ofUserLegacyUserBlurbName("[USER]", "[LEGACY_USER]", "[BLURB]") + .toString()) + .setUser(UserName.of("[USER]").toString()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .build(); + mockMessaging.addResponse(expectedResponse); + + String parent = "parent-995424086"; + UserName user = UserName.of("[USER]"); + String text = "text3556653"; + + Blurb actualResponse = client.createBlurb(parent, user, text); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockMessaging.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateBlurbRequest actualRequest = ((CreateBlurbRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertEquals(user.toString(), actualRequest.getBlurb().getUser()); + Assert.assertEquals(text, actualRequest.getBlurb().getText()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void createBlurbExceptionTest10() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockMessaging.addException(exception); + + try { + String parent = "parent-995424086"; + UserName user = UserName.of("[USER]"); + String text = "text3556653"; + client.createBlurb(parent, user, text); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createBlurbTest11() throws Exception { + Blurb expectedResponse = + Blurb.newBuilder() + .setName( + BlurbName.ofUserLegacyUserBlurbName("[USER]", "[LEGACY_USER]", "[BLURB]") + .toString()) + .setUser(UserName.of("[USER]").toString()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .build(); + mockMessaging.addResponse(expectedResponse); + + String parent = "parent-995424086"; + String user = "user3599307"; + ByteString image = ByteString.EMPTY; + + Blurb actualResponse = client.createBlurb(parent, user, image); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockMessaging.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateBlurbRequest actualRequest = ((CreateBlurbRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertEquals(user, actualRequest.getBlurb().getUser()); + Assert.assertEquals(image, actualRequest.getBlurb().getImage()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void createBlurbExceptionTest11() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockMessaging.addException(exception); + + try { + String parent = "parent-995424086"; + String user = "user3599307"; + ByteString image = ByteString.EMPTY; + client.createBlurb(parent, user, image); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createBlurbTest12() throws Exception { + Blurb expectedResponse = + Blurb.newBuilder() + .setName( + BlurbName.ofUserLegacyUserBlurbName("[USER]", "[LEGACY_USER]", "[BLURB]") + .toString()) + .setUser(UserName.of("[USER]").toString()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .build(); + mockMessaging.addResponse(expectedResponse); + + String parent = "parent-995424086"; + String user = "user3599307"; + String text = "text3556653"; + + Blurb actualResponse = client.createBlurb(parent, user, text); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockMessaging.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateBlurbRequest actualRequest = ((CreateBlurbRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertEquals(user, actualRequest.getBlurb().getUser()); + Assert.assertEquals(text, actualRequest.getBlurb().getText()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void createBlurbExceptionTest12() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockMessaging.addException(exception); + + try { + String parent = "parent-995424086"; + String user = "user3599307"; + String text = "text3556653"; + client.createBlurb(parent, user, text); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getBlurbTest() throws Exception { + Blurb expectedResponse = + Blurb.newBuilder() + .setName(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString()) + .setUser(UserName.of("[USER]").toString()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .build(); + mockMessaging.addResponse(expectedResponse); + + BlurbName name = BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]"); + + Blurb actualResponse = client.getBlurb(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockMessaging.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetBlurbRequest actualRequest = ((GetBlurbRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getBlurbExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockMessaging.addException(exception); + + try { + BlurbName name = BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]"); + client.getBlurb(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getBlurbTest2() throws Exception { + Blurb expectedResponse = + Blurb.newBuilder() + .setName(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString()) + .setUser(UserName.of("[USER]").toString()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .build(); + mockMessaging.addResponse(expectedResponse); + + String name = "name3373707"; + + Blurb actualResponse = client.getBlurb(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockMessaging.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetBlurbRequest actualRequest = ((GetBlurbRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getBlurbExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockMessaging.addException(exception); + + try { + String name = "name3373707"; + client.getBlurb(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void updateBlurbTest() throws Exception { + Blurb expectedResponse = + Blurb.newBuilder() + .setName(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString()) + .setUser(UserName.of("[USER]").toString()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .build(); + mockMessaging.addResponse(expectedResponse); + + UpdateBlurbRequest request = + UpdateBlurbRequest.newBuilder() + .setBlurb(Blurb.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .build(); + + Blurb actualResponse = client.updateBlurb(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockMessaging.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + UpdateBlurbRequest actualRequest = ((UpdateBlurbRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getBlurb(), actualRequest.getBlurb()); + Assert.assertEquals(request.getUpdateMask(), actualRequest.getUpdateMask()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void updateBlurbExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockMessaging.addException(exception); + + try { + UpdateBlurbRequest request = + UpdateBlurbRequest.newBuilder() + .setBlurb(Blurb.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .build(); + client.updateBlurb(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void deleteBlurbTest() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockMessaging.addResponse(expectedResponse); + + BlurbName name = BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]"); + + client.deleteBlurb(name); + + List actualRequests = mockMessaging.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeleteBlurbRequest actualRequest = ((DeleteBlurbRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void deleteBlurbExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockMessaging.addException(exception); + + try { + BlurbName name = BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]"); + client.deleteBlurb(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void deleteBlurbTest2() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockMessaging.addResponse(expectedResponse); + + String name = "name3373707"; + + client.deleteBlurb(name); + + List actualRequests = mockMessaging.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeleteBlurbRequest actualRequest = ((DeleteBlurbRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void deleteBlurbExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockMessaging.addException(exception); + + try { + String name = "name3373707"; + client.deleteBlurb(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listBlurbsTest() throws Exception { + Blurb responsesElement = Blurb.newBuilder().build(); + ListBlurbsResponse expectedResponse = + ListBlurbsResponse.newBuilder() + .setNextPageToken("") + .addAllBlurbs(Arrays.asList(responsesElement)) + .build(); + mockMessaging.addResponse(expectedResponse); + + ProfileName parent = ProfileName.of("[USER]"); + + ListBlurbsPagedResponse pagedListResponse = client.listBlurbs(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getBlurbsList().get(0), resources.get(0)); + + List actualRequests = mockMessaging.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListBlurbsRequest actualRequest = ((ListBlurbsRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listBlurbsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockMessaging.addException(exception); + + try { + ProfileName parent = ProfileName.of("[USER]"); + client.listBlurbs(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listBlurbsTest2() throws Exception { + Blurb responsesElement = Blurb.newBuilder().build(); + ListBlurbsResponse expectedResponse = + ListBlurbsResponse.newBuilder() + .setNextPageToken("") + .addAllBlurbs(Arrays.asList(responsesElement)) + .build(); + mockMessaging.addResponse(expectedResponse); + + RoomName parent = RoomName.of("[ROOM]"); + + ListBlurbsPagedResponse pagedListResponse = client.listBlurbs(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getBlurbsList().get(0), resources.get(0)); + + List actualRequests = mockMessaging.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListBlurbsRequest actualRequest = ((ListBlurbsRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listBlurbsExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockMessaging.addException(exception); + + try { + RoomName parent = RoomName.of("[ROOM]"); + client.listBlurbs(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listBlurbsTest3() throws Exception { + Blurb responsesElement = Blurb.newBuilder().build(); + ListBlurbsResponse expectedResponse = + ListBlurbsResponse.newBuilder() + .setNextPageToken("") + .addAllBlurbs(Arrays.asList(responsesElement)) + .build(); + mockMessaging.addResponse(expectedResponse); + + String parent = "parent-995424086"; + + ListBlurbsPagedResponse pagedListResponse = client.listBlurbs(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getBlurbsList().get(0), resources.get(0)); + + List actualRequests = mockMessaging.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListBlurbsRequest actualRequest = ((ListBlurbsRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listBlurbsExceptionTest3() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockMessaging.addException(exception); + + try { + String parent = "parent-995424086"; + client.listBlurbs(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void searchBlurbsTest() throws Exception { + SearchBlurbsResponse expectedResponse = + SearchBlurbsResponse.newBuilder() + .addAllBlurbs(new ArrayList()) + .setNextPageToken("nextPageToken-1386094857") + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("searchBlurbsTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockMessaging.addResponse(resultOperation); + + ProfileName parent = ProfileName.of("[USER]"); + String query = "query107944136"; + + SearchBlurbsResponse actualResponse = client.searchBlurbsAsync(parent, query).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockMessaging.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + SearchBlurbsRequest actualRequest = ((SearchBlurbsRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertEquals(query, actualRequest.getQuery()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void searchBlurbsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockMessaging.addException(exception); + + try { + ProfileName parent = ProfileName.of("[USER]"); + String query = "query107944136"; + client.searchBlurbsAsync(parent, query).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 searchBlurbsTest2() throws Exception { + SearchBlurbsResponse expectedResponse = + SearchBlurbsResponse.newBuilder() + .addAllBlurbs(new ArrayList()) + .setNextPageToken("nextPageToken-1386094857") + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("searchBlurbsTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockMessaging.addResponse(resultOperation); + + RoomName parent = RoomName.of("[ROOM]"); + String query = "query107944136"; + + SearchBlurbsResponse actualResponse = client.searchBlurbsAsync(parent, query).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockMessaging.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + SearchBlurbsRequest actualRequest = ((SearchBlurbsRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertEquals(query, actualRequest.getQuery()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void searchBlurbsExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockMessaging.addException(exception); + + try { + RoomName parent = RoomName.of("[ROOM]"); + String query = "query107944136"; + client.searchBlurbsAsync(parent, query).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 searchBlurbsTest3() throws Exception { + SearchBlurbsResponse expectedResponse = + SearchBlurbsResponse.newBuilder() + .addAllBlurbs(new ArrayList()) + .setNextPageToken("nextPageToken-1386094857") + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("searchBlurbsTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockMessaging.addResponse(resultOperation); + + String parent = "parent-995424086"; + String query = "query107944136"; + + SearchBlurbsResponse actualResponse = client.searchBlurbsAsync(parent, query).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockMessaging.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + SearchBlurbsRequest actualRequest = ((SearchBlurbsRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertEquals(query, actualRequest.getQuery()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void searchBlurbsExceptionTest3() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockMessaging.addException(exception); + + try { + String parent = "parent-995424086"; + String query = "query107944136"; + client.searchBlurbsAsync(parent, query).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 streamBlurbsTest() throws Exception { + StreamBlurbsResponse expectedResponse = + StreamBlurbsResponse.newBuilder().setBlurb(Blurb.newBuilder().build()).build(); + mockMessaging.addResponse(expectedResponse); + StreamBlurbsRequest request = + StreamBlurbsRequest.newBuilder() + .setName(ProfileName.of("[USER]").toString()) + .setExpireTime(Timestamp.newBuilder().build()) + .build(); + + MockStreamObserver responseObserver = new MockStreamObserver<>(); + + ServerStreamingCallable callable = + client.streamBlurbsCallable(); + callable.serverStreamingCall(request, responseObserver); + + List actualResponses = responseObserver.future().get(); + Assert.assertEquals(1, actualResponses.size()); + Assert.assertEquals(expectedResponse, actualResponses.get(0)); + } + + @Test + public void streamBlurbsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockMessaging.addException(exception); + StreamBlurbsRequest request = + StreamBlurbsRequest.newBuilder() + .setName(ProfileName.of("[USER]").toString()) + .setExpireTime(Timestamp.newBuilder().build()) + .build(); + + MockStreamObserver responseObserver = new MockStreamObserver<>(); + + ServerStreamingCallable callable = + client.streamBlurbsCallable(); + callable.serverStreamingCall(request, responseObserver); + + 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()); + } + } + + @Test + public void sendBlurbsTest() throws Exception { + SendBlurbsResponse expectedResponse = + SendBlurbsResponse.newBuilder().addAllNames(new ArrayList()).build(); + mockMessaging.addResponse(expectedResponse); + CreateBlurbRequest request = + CreateBlurbRequest.newBuilder() + .setParent(ProfileName.of("[USER]").toString()) + .setBlurb(Blurb.newBuilder().build()) + .build(); + + MockStreamObserver responseObserver = new MockStreamObserver<>(); + + ClientStreamingCallable callable = + client.sendBlurbsCallable(); + ApiStreamObserver requestObserver = + callable.clientStreamingCall(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 sendBlurbsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockMessaging.addException(exception); + CreateBlurbRequest request = + CreateBlurbRequest.newBuilder() + .setParent(ProfileName.of("[USER]").toString()) + .setBlurb(Blurb.newBuilder().build()) + .build(); + + MockStreamObserver responseObserver = new MockStreamObserver<>(); + + ClientStreamingCallable callable = + client.sendBlurbsCallable(); + ApiStreamObserver requestObserver = + callable.clientStreamingCall(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()); + } + } + + @Test + public void connectTest() throws Exception { + StreamBlurbsResponse expectedResponse = + StreamBlurbsResponse.newBuilder().setBlurb(Blurb.newBuilder().build()).build(); + mockMessaging.addResponse(expectedResponse); + ConnectRequest request = ConnectRequest.newBuilder().build(); + + MockStreamObserver responseObserver = new MockStreamObserver<>(); + + BidiStreamingCallable callable = client.connectCallable(); + 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 connectExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockMessaging.addException(exception); + ConnectRequest request = ConnectRequest.newBuilder().build(); + + MockStreamObserver responseObserver = new MockStreamObserver<>(); + + BidiStreamingCallable callable = client.connectCallable(); + 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()); + } + } + + @Test + public void listLocationsTest() throws Exception { + Location responsesElement = Location.newBuilder().build(); + ListLocationsResponse expectedResponse = + ListLocationsResponse.newBuilder() + .setNextPageToken("") + .addAllLocations(Arrays.asList(responsesElement)) + .build(); + mockLocations.addResponse(expectedResponse); + + ListLocationsRequest request = + ListLocationsRequest.newBuilder() + .setName("name3373707") + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + + ListLocationsPagedResponse pagedListResponse = client.listLocations(request); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getLocationsList().get(0), resources.get(0)); + + List actualRequests = mockLocations.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListLocationsRequest actualRequest = ((ListLocationsRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getName(), actualRequest.getName()); + Assert.assertEquals(request.getFilter(), actualRequest.getFilter()); + Assert.assertEquals(request.getPageSize(), actualRequest.getPageSize()); + Assert.assertEquals(request.getPageToken(), actualRequest.getPageToken()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listLocationsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockLocations.addException(exception); + + try { + ListLocationsRequest request = + ListLocationsRequest.newBuilder() + .setName("name3373707") + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + client.listLocations(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getLocationTest() throws Exception { + Location expectedResponse = + Location.newBuilder() + .setName("name3373707") + .setLocationId("locationId1541836720") + .setDisplayName("displayName1714148973") + .putAllLabels(new HashMap()) + .setMetadata(Any.newBuilder().build()) + .build(); + mockLocations.addResponse(expectedResponse); + + GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build(); + + Location actualResponse = client.getLocation(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockLocations.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetLocationRequest actualRequest = ((GetLocationRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getName(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getLocationExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockLocations.addException(exception); + + try { + GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build(); + client.getLocation(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void setIamPolicyTest() throws Exception { + Policy expectedResponse = + Policy.newBuilder() + .setVersion(351608024) + .addAllBindings(new ArrayList()) + .addAllAuditConfigs(new ArrayList()) + .setEtag(ByteString.EMPTY) + .build(); + mockIAMPolicy.addResponse(expectedResponse); + + SetIamPolicyRequest request = + SetIamPolicyRequest.newBuilder() + .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString()) + .setPolicy(Policy.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .build(); + + Policy actualResponse = client.setIamPolicy(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockIAMPolicy.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + SetIamPolicyRequest actualRequest = ((SetIamPolicyRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getResource(), actualRequest.getResource()); + Assert.assertEquals(request.getPolicy(), actualRequest.getPolicy()); + Assert.assertEquals(request.getUpdateMask(), actualRequest.getUpdateMask()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void setIamPolicyExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockIAMPolicy.addException(exception); + + try { + SetIamPolicyRequest request = + SetIamPolicyRequest.newBuilder() + .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString()) + .setPolicy(Policy.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .build(); + client.setIamPolicy(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getIamPolicyTest() throws Exception { + Policy expectedResponse = + Policy.newBuilder() + .setVersion(351608024) + .addAllBindings(new ArrayList()) + .addAllAuditConfigs(new ArrayList()) + .setEtag(ByteString.EMPTY) + .build(); + mockIAMPolicy.addResponse(expectedResponse); + + GetIamPolicyRequest request = + GetIamPolicyRequest.newBuilder() + .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString()) + .setOptions(GetPolicyOptions.newBuilder().build()) + .build(); + + Policy actualResponse = client.getIamPolicy(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockIAMPolicy.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetIamPolicyRequest actualRequest = ((GetIamPolicyRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getResource(), actualRequest.getResource()); + Assert.assertEquals(request.getOptions(), actualRequest.getOptions()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getIamPolicyExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockIAMPolicy.addException(exception); + + try { + GetIamPolicyRequest request = + GetIamPolicyRequest.newBuilder() + .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString()) + .setOptions(GetPolicyOptions.newBuilder().build()) + .build(); + client.getIamPolicy(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void testIamPermissionsTest() throws Exception { + TestIamPermissionsResponse expectedResponse = + TestIamPermissionsResponse.newBuilder().addAllPermissions(new ArrayList()).build(); + mockIAMPolicy.addResponse(expectedResponse); + + TestIamPermissionsRequest request = + TestIamPermissionsRequest.newBuilder() + .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString()) + .addAllPermissions(new ArrayList()) + .build(); + + TestIamPermissionsResponse actualResponse = client.testIamPermissions(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockIAMPolicy.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + TestIamPermissionsRequest actualRequest = ((TestIamPermissionsRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getResource(), actualRequest.getResource()); + Assert.assertEquals(request.getPermissionsList(), actualRequest.getPermissionsList()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void testIamPermissionsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockIAMPolicy.addException(exception); + + try { + TestIamPermissionsRequest request = + TestIamPermissionsRequest.newBuilder() + .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString()) + .addAllPermissions(new ArrayList()) + .build(); + client.testIamPermissions(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } +} diff --git a/java-showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/MockCompliance.java b/java-showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/MockCompliance.java new file mode 100644 index 0000000000..79b930cb34 --- /dev/null +++ b/java-showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/MockCompliance.java @@ -0,0 +1,59 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.grpc.testing.MockGrpcService; +import com.google.protobuf.AbstractMessage; +import io.grpc.ServerServiceDefinition; +import java.util.List; +import javax.annotation.Generated; + +@BetaApi +@Generated("by gapic-generator-java") +public class MockCompliance implements MockGrpcService { + private final MockComplianceImpl serviceImpl; + + public MockCompliance() { + serviceImpl = new MockComplianceImpl(); + } + + @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-showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/MockComplianceImpl.java b/java-showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/MockComplianceImpl.java new file mode 100644 index 0000000000..406660c72e --- /dev/null +++ b/java-showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/MockComplianceImpl.java @@ -0,0 +1,271 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1; + +import com.google.api.core.BetaApi; +import com.google.protobuf.AbstractMessage; +import com.google.showcase.v1beta1.ComplianceGrpc.ComplianceImplBase; +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 MockComplianceImpl extends ComplianceImplBase { + private List requests; + private Queue responses; + + public MockComplianceImpl() { + 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 repeatDataBody( + RepeatRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof RepeatResponse) { + requests.add(request); + responseObserver.onNext(((RepeatResponse) 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 RepeatDataBody, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + RepeatResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void repeatDataBodyInfo( + RepeatRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof RepeatResponse) { + requests.add(request); + responseObserver.onNext(((RepeatResponse) 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 RepeatDataBodyInfo, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + RepeatResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void repeatDataQuery( + RepeatRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof RepeatResponse) { + requests.add(request); + responseObserver.onNext(((RepeatResponse) 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 RepeatDataQuery, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + RepeatResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void repeatDataSimplePath( + RepeatRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof RepeatResponse) { + requests.add(request); + responseObserver.onNext(((RepeatResponse) 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 RepeatDataSimplePath, expected %s or" + + " %s", + response == null ? "null" : response.getClass().getName(), + RepeatResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void repeatDataPathResource( + RepeatRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof RepeatResponse) { + requests.add(request); + responseObserver.onNext(((RepeatResponse) 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 RepeatDataPathResource, expected %s or" + + " %s", + response == null ? "null" : response.getClass().getName(), + RepeatResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void repeatDataPathTrailingResource( + RepeatRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof RepeatResponse) { + requests.add(request); + responseObserver.onNext(((RepeatResponse) 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 RepeatDataPathTrailingResource," + + " expected %s or %s", + response == null ? "null" : response.getClass().getName(), + RepeatResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void repeatDataBodyPut( + RepeatRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof RepeatResponse) { + requests.add(request); + responseObserver.onNext(((RepeatResponse) 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 RepeatDataBodyPut, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + RepeatResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void repeatDataBodyPatch( + RepeatRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof RepeatResponse) { + requests.add(request); + responseObserver.onNext(((RepeatResponse) 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 RepeatDataBodyPatch, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + RepeatResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void getEnum(EnumRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof EnumResponse) { + requests.add(request); + responseObserver.onNext(((EnumResponse) 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 GetEnum, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + EnumResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void verifyEnum(EnumResponse request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof EnumResponse) { + requests.add(request); + responseObserver.onNext(((EnumResponse) 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 VerifyEnum, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + EnumResponse.class.getName(), + Exception.class.getName()))); + } + } +} diff --git a/java-showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/MockEcho.java b/java-showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/MockEcho.java new file mode 100644 index 0000000000..49d0305f9c --- /dev/null +++ b/java-showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/MockEcho.java @@ -0,0 +1,59 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.grpc.testing.MockGrpcService; +import com.google.protobuf.AbstractMessage; +import io.grpc.ServerServiceDefinition; +import java.util.List; +import javax.annotation.Generated; + +@BetaApi +@Generated("by gapic-generator-java") +public class MockEcho implements MockGrpcService { + private final MockEchoImpl serviceImpl; + + public MockEcho() { + serviceImpl = new MockEchoImpl(); + } + + @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-showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/MockEchoImpl.java b/java-showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/MockEchoImpl.java new file mode 100644 index 0000000000..184a4f3367 --- /dev/null +++ b/java-showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/MockEchoImpl.java @@ -0,0 +1,321 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1; + +import com.google.api.core.BetaApi; +import com.google.longrunning.Operation; +import com.google.protobuf.AbstractMessage; +import com.google.showcase.v1beta1.EchoGrpc.EchoImplBase; +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 MockEchoImpl extends EchoImplBase { + private List requests; + private Queue responses; + + public MockEchoImpl() { + 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 echo(EchoRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof EchoResponse) { + requests.add(request); + responseObserver.onNext(((EchoResponse) 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 Echo, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + EchoResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void echoErrorDetails( + EchoErrorDetailsRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof EchoErrorDetailsResponse) { + requests.add(request); + responseObserver.onNext(((EchoErrorDetailsResponse) 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 EchoErrorDetails, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + EchoErrorDetailsResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void failEchoWithDetails( + FailEchoWithDetailsRequest request, + StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof FailEchoWithDetailsResponse) { + requests.add(request); + responseObserver.onNext(((FailEchoWithDetailsResponse) 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 FailEchoWithDetails, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + FailEchoWithDetailsResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void expand(ExpandRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof EchoResponse) { + requests.add(request); + responseObserver.onNext(((EchoResponse) 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 Expand, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + EchoResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public StreamObserver collect(final StreamObserver responseObserver) { + StreamObserver requestObserver = + new StreamObserver() { + @Override + public void onNext(EchoRequest value) { + requests.add(value); + final Object response = responses.remove(); + if (response instanceof EchoResponse) { + responseObserver.onNext(((EchoResponse) response)); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method Collect, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + EchoResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void onError(Throwable t) { + responseObserver.onError(t); + } + + @Override + public void onCompleted() { + responseObserver.onCompleted(); + } + }; + return requestObserver; + } + + @Override + public StreamObserver chat(final StreamObserver responseObserver) { + StreamObserver requestObserver = + new StreamObserver() { + @Override + public void onNext(EchoRequest value) { + requests.add(value); + final Object response = responses.remove(); + if (response instanceof EchoResponse) { + responseObserver.onNext(((EchoResponse) response)); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method Chat, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + EchoResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void onError(Throwable t) { + responseObserver.onError(t); + } + + @Override + public void onCompleted() { + responseObserver.onCompleted(); + } + }; + return requestObserver; + } + + @Override + public void pagedExpand( + PagedExpandRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof PagedExpandResponse) { + requests.add(request); + responseObserver.onNext(((PagedExpandResponse) 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 PagedExpand, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + PagedExpandResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void pagedExpandLegacy( + PagedExpandLegacyRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof PagedExpandResponse) { + requests.add(request); + responseObserver.onNext(((PagedExpandResponse) 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 PagedExpandLegacy, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + PagedExpandResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void pagedExpandLegacyMapped( + PagedExpandRequest request, + StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof PagedExpandLegacyMappedResponse) { + requests.add(request); + responseObserver.onNext(((PagedExpandLegacyMappedResponse) 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 PagedExpandLegacyMapped, expected %s or" + + " %s", + response == null ? "null" : response.getClass().getName(), + PagedExpandLegacyMappedResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void wait(WaitRequest 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 Wait, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void block(BlockRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof BlockResponse) { + requests.add(request); + responseObserver.onNext(((BlockResponse) 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 Block, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + BlockResponse.class.getName(), + Exception.class.getName()))); + } + } +} diff --git a/java-showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/MockIAMPolicy.java b/java-showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/MockIAMPolicy.java new file mode 100644 index 0000000000..6a55373c54 --- /dev/null +++ b/java-showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/MockIAMPolicy.java @@ -0,0 +1,59 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.grpc.testing.MockGrpcService; +import com.google.protobuf.AbstractMessage; +import io.grpc.ServerServiceDefinition; +import java.util.List; +import javax.annotation.Generated; + +@BetaApi +@Generated("by gapic-generator-java") +public class MockIAMPolicy implements MockGrpcService { + private final MockIAMPolicyImpl serviceImpl; + + public MockIAMPolicy() { + serviceImpl = new MockIAMPolicyImpl(); + } + + @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-showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/MockIAMPolicyImpl.java b/java-showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/MockIAMPolicyImpl.java new file mode 100644 index 0000000000..b3072e248b --- /dev/null +++ b/java-showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/MockIAMPolicyImpl.java @@ -0,0 +1,127 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1; + +import com.google.api.core.BetaApi; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.IAMPolicyGrpc.IAMPolicyImplBase; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.protobuf.AbstractMessage; +import io.grpc.stub.StreamObserver; +import java.util.ArrayList; +import java.util.LinkedList; +import java.util.List; +import java.util.Queue; +import javax.annotation.Generated; + +@BetaApi +@Generated("by gapic-generator-java") +public class MockIAMPolicyImpl extends IAMPolicyImplBase { + private List requests; + private Queue responses; + + public MockIAMPolicyImpl() { + 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 testIamPermissions( + TestIamPermissionsRequest request, + StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof TestIamPermissionsResponse) { + requests.add(request); + responseObserver.onNext(((TestIamPermissionsResponse) 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 TestIamPermissions, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + TestIamPermissionsResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void setIamPolicy(SetIamPolicyRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Policy) { + requests.add(request); + responseObserver.onNext(((Policy) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method SetIamPolicy, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Policy.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void getIamPolicy(GetIamPolicyRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Policy) { + requests.add(request); + responseObserver.onNext(((Policy) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method GetIamPolicy, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Policy.class.getName(), + Exception.class.getName()))); + } + } +} diff --git a/java-showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/MockIdentity.java b/java-showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/MockIdentity.java new file mode 100644 index 0000000000..c7bb1df70c --- /dev/null +++ b/java-showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/MockIdentity.java @@ -0,0 +1,59 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.grpc.testing.MockGrpcService; +import com.google.protobuf.AbstractMessage; +import io.grpc.ServerServiceDefinition; +import java.util.List; +import javax.annotation.Generated; + +@BetaApi +@Generated("by gapic-generator-java") +public class MockIdentity implements MockGrpcService { + private final MockIdentityImpl serviceImpl; + + public MockIdentity() { + serviceImpl = new MockIdentityImpl(); + } + + @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-showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/MockIdentityImpl.java b/java-showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/MockIdentityImpl.java new file mode 100644 index 0000000000..c60efa97b4 --- /dev/null +++ b/java-showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/MockIdentityImpl.java @@ -0,0 +1,162 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1; + +import com.google.api.core.BetaApi; +import com.google.protobuf.AbstractMessage; +import com.google.protobuf.Empty; +import com.google.showcase.v1beta1.IdentityGrpc.IdentityImplBase; +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 MockIdentityImpl extends IdentityImplBase { + private List requests; + private Queue responses; + + public MockIdentityImpl() { + 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 createUser(CreateUserRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof User) { + requests.add(request); + responseObserver.onNext(((User) 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 CreateUser, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + User.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void getUser(GetUserRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof User) { + requests.add(request); + responseObserver.onNext(((User) 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 GetUser, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + User.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void updateUser(UpdateUserRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof User) { + requests.add(request); + responseObserver.onNext(((User) 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 UpdateUser, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + User.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void deleteUser(DeleteUserRequest 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 DeleteUser, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Empty.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void listUsers( + ListUsersRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof ListUsersResponse) { + requests.add(request); + responseObserver.onNext(((ListUsersResponse) 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 ListUsers, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + ListUsersResponse.class.getName(), + Exception.class.getName()))); + } + } +} diff --git a/java-showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/MockLocations.java b/java-showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/MockLocations.java new file mode 100644 index 0000000000..9f5ff901a9 --- /dev/null +++ b/java-showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/MockLocations.java @@ -0,0 +1,59 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.grpc.testing.MockGrpcService; +import com.google.protobuf.AbstractMessage; +import io.grpc.ServerServiceDefinition; +import java.util.List; +import javax.annotation.Generated; + +@BetaApi +@Generated("by gapic-generator-java") +public class MockLocations implements MockGrpcService { + private final MockLocationsImpl serviceImpl; + + public MockLocations() { + serviceImpl = new MockLocationsImpl(); + } + + @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-showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/MockLocationsImpl.java b/java-showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/MockLocationsImpl.java new file mode 100644 index 0000000000..b22ed07528 --- /dev/null +++ b/java-showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/MockLocationsImpl.java @@ -0,0 +1,105 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1; + +import com.google.api.core.BetaApi; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.cloud.location.LocationsGrpc.LocationsImplBase; +import com.google.protobuf.AbstractMessage; +import io.grpc.stub.StreamObserver; +import java.util.ArrayList; +import java.util.LinkedList; +import java.util.List; +import java.util.Queue; +import javax.annotation.Generated; + +@BetaApi +@Generated("by gapic-generator-java") +public class MockLocationsImpl extends LocationsImplBase { + private List requests; + private Queue responses; + + public MockLocationsImpl() { + 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 listLocations( + ListLocationsRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof ListLocationsResponse) { + requests.add(request); + responseObserver.onNext(((ListLocationsResponse) 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 ListLocations, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + ListLocationsResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void getLocation(GetLocationRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Location) { + requests.add(request); + responseObserver.onNext(((Location) 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 GetLocation, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Location.class.getName(), + Exception.class.getName()))); + } + } +} diff --git a/java-showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/MockMessaging.java b/java-showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/MockMessaging.java new file mode 100644 index 0000000000..f96b910960 --- /dev/null +++ b/java-showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/MockMessaging.java @@ -0,0 +1,59 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.grpc.testing.MockGrpcService; +import com.google.protobuf.AbstractMessage; +import io.grpc.ServerServiceDefinition; +import java.util.List; +import javax.annotation.Generated; + +@BetaApi +@Generated("by gapic-generator-java") +public class MockMessaging implements MockGrpcService { + private final MockMessagingImpl serviceImpl; + + public MockMessaging() { + serviceImpl = new MockMessagingImpl(); + } + + @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-showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/MockMessagingImpl.java b/java-showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/MockMessagingImpl.java new file mode 100644 index 0000000000..71fecd6383 --- /dev/null +++ b/java-showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/MockMessagingImpl.java @@ -0,0 +1,380 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1; + +import com.google.api.core.BetaApi; +import com.google.longrunning.Operation; +import com.google.protobuf.AbstractMessage; +import com.google.protobuf.Empty; +import com.google.showcase.v1beta1.MessagingGrpc.MessagingImplBase; +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 MockMessagingImpl extends MessagingImplBase { + private List requests; + private Queue responses; + + public MockMessagingImpl() { + 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 createRoom(CreateRoomRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Room) { + requests.add(request); + responseObserver.onNext(((Room) 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 CreateRoom, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Room.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void getRoom(GetRoomRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Room) { + requests.add(request); + responseObserver.onNext(((Room) 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 GetRoom, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Room.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void updateRoom(UpdateRoomRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Room) { + requests.add(request); + responseObserver.onNext(((Room) 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 UpdateRoom, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Room.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void deleteRoom(DeleteRoomRequest 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 DeleteRoom, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Empty.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void listRooms( + ListRoomsRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof ListRoomsResponse) { + requests.add(request); + responseObserver.onNext(((ListRoomsResponse) 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 ListRooms, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + ListRoomsResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void createBlurb(CreateBlurbRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Blurb) { + requests.add(request); + responseObserver.onNext(((Blurb) 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 CreateBlurb, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Blurb.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void getBlurb(GetBlurbRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Blurb) { + requests.add(request); + responseObserver.onNext(((Blurb) 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 GetBlurb, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Blurb.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void updateBlurb(UpdateBlurbRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Blurb) { + requests.add(request); + responseObserver.onNext(((Blurb) 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 UpdateBlurb, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Blurb.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void deleteBlurb(DeleteBlurbRequest 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 DeleteBlurb, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Empty.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void listBlurbs( + ListBlurbsRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof ListBlurbsResponse) { + requests.add(request); + responseObserver.onNext(((ListBlurbsResponse) 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 ListBlurbs, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + ListBlurbsResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void searchBlurbs( + SearchBlurbsRequest 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 SearchBlurbs, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void streamBlurbs( + StreamBlurbsRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof StreamBlurbsResponse) { + requests.add(request); + responseObserver.onNext(((StreamBlurbsResponse) 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 StreamBlurbs, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + StreamBlurbsResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public StreamObserver sendBlurbs( + final StreamObserver responseObserver) { + StreamObserver requestObserver = + new StreamObserver() { + @Override + public void onNext(CreateBlurbRequest value) { + requests.add(value); + final Object response = responses.remove(); + if (response instanceof SendBlurbsResponse) { + responseObserver.onNext(((SendBlurbsResponse) response)); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method SendBlurbs, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + SendBlurbsResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void onError(Throwable t) { + responseObserver.onError(t); + } + + @Override + public void onCompleted() { + responseObserver.onCompleted(); + } + }; + return requestObserver; + } + + @Override + public StreamObserver connect( + final StreamObserver responseObserver) { + StreamObserver requestObserver = + new StreamObserver() { + @Override + public void onNext(ConnectRequest value) { + requests.add(value); + final Object response = responses.remove(); + if (response instanceof StreamBlurbsResponse) { + responseObserver.onNext(((StreamBlurbsResponse) response)); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method Connect, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + StreamBlurbsResponse.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-showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/MockSequenceService.java b/java-showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/MockSequenceService.java new file mode 100644 index 0000000000..d0414efee4 --- /dev/null +++ b/java-showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/MockSequenceService.java @@ -0,0 +1,59 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.grpc.testing.MockGrpcService; +import com.google.protobuf.AbstractMessage; +import io.grpc.ServerServiceDefinition; +import java.util.List; +import javax.annotation.Generated; + +@BetaApi +@Generated("by gapic-generator-java") +public class MockSequenceService implements MockGrpcService { + private final MockSequenceServiceImpl serviceImpl; + + public MockSequenceService() { + serviceImpl = new MockSequenceServiceImpl(); + } + + @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-showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/MockSequenceServiceImpl.java b/java-showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/MockSequenceServiceImpl.java new file mode 100644 index 0000000000..87373559a5 --- /dev/null +++ b/java-showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/MockSequenceServiceImpl.java @@ -0,0 +1,192 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1; + +import com.google.api.core.BetaApi; +import com.google.protobuf.AbstractMessage; +import com.google.protobuf.Empty; +import com.google.showcase.v1beta1.SequenceServiceGrpc.SequenceServiceImplBase; +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 MockSequenceServiceImpl extends SequenceServiceImplBase { + private List requests; + private Queue responses; + + public MockSequenceServiceImpl() { + 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 createSequence( + CreateSequenceRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Sequence) { + requests.add(request); + responseObserver.onNext(((Sequence) 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 CreateSequence, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Sequence.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void createStreamingSequence( + CreateStreamingSequenceRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof StreamingSequence) { + requests.add(request); + responseObserver.onNext(((StreamingSequence) 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 CreateStreamingSequence, expected %s or" + + " %s", + response == null ? "null" : response.getClass().getName(), + StreamingSequence.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void getSequenceReport( + GetSequenceReportRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof SequenceReport) { + requests.add(request); + responseObserver.onNext(((SequenceReport) 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 GetSequenceReport, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + SequenceReport.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void getStreamingSequenceReport( + GetStreamingSequenceReportRequest request, + StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof StreamingSequenceReport) { + requests.add(request); + responseObserver.onNext(((StreamingSequenceReport) 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 GetStreamingSequenceReport, expected %s" + + " or %s", + response == null ? "null" : response.getClass().getName(), + StreamingSequenceReport.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void attemptSequence( + AttemptSequenceRequest 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 AttemptSequence, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Empty.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void attemptStreamingSequence( + AttemptStreamingSequenceRequest request, + StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof AttemptStreamingSequenceResponse) { + requests.add(request); + responseObserver.onNext(((AttemptStreamingSequenceResponse) 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 AttemptStreamingSequence, expected %s" + + " or %s", + response == null ? "null" : response.getClass().getName(), + AttemptStreamingSequenceResponse.class.getName(), + Exception.class.getName()))); + } + } +} diff --git a/java-showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/MockTesting.java b/java-showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/MockTesting.java new file mode 100644 index 0000000000..73652bf1a0 --- /dev/null +++ b/java-showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/MockTesting.java @@ -0,0 +1,59 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.grpc.testing.MockGrpcService; +import com.google.protobuf.AbstractMessage; +import io.grpc.ServerServiceDefinition; +import java.util.List; +import javax.annotation.Generated; + +@BetaApi +@Generated("by gapic-generator-java") +public class MockTesting implements MockGrpcService { + private final MockTestingImpl serviceImpl; + + public MockTesting() { + serviceImpl = new MockTestingImpl(); + } + + @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-showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/MockTestingImpl.java b/java-showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/MockTestingImpl.java new file mode 100644 index 0000000000..adee873682 --- /dev/null +++ b/java-showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/MockTestingImpl.java @@ -0,0 +1,226 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1; + +import com.google.api.core.BetaApi; +import com.google.protobuf.AbstractMessage; +import com.google.protobuf.Empty; +import com.google.showcase.v1beta1.TestingGrpc.TestingImplBase; +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 MockTestingImpl extends TestingImplBase { + private List requests; + private Queue responses; + + public MockTestingImpl() { + 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 createSession( + CreateSessionRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Session) { + requests.add(request); + responseObserver.onNext(((Session) 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 CreateSession, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Session.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void getSession(GetSessionRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Session) { + requests.add(request); + responseObserver.onNext(((Session) 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 GetSession, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Session.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void listSessions( + ListSessionsRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof ListSessionsResponse) { + requests.add(request); + responseObserver.onNext(((ListSessionsResponse) 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 ListSessions, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + ListSessionsResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void deleteSession(DeleteSessionRequest 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 DeleteSession, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Empty.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void reportSession( + ReportSessionRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof ReportSessionResponse) { + requests.add(request); + responseObserver.onNext(((ReportSessionResponse) 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 ReportSession, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + ReportSessionResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void listTests( + ListTestsRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof ListTestsResponse) { + requests.add(request); + responseObserver.onNext(((ListTestsResponse) 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 ListTests, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + ListTestsResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void deleteTest(DeleteTestRequest 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 DeleteTest, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Empty.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void verifyTest( + VerifyTestRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof VerifyTestResponse) { + requests.add(request); + responseObserver.onNext(((VerifyTestResponse) 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 VerifyTest, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + VerifyTestResponse.class.getName(), + Exception.class.getName()))); + } + } +} diff --git a/java-showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/SequenceServiceClientHttpJsonTest.java b/java-showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/SequenceServiceClientHttpJsonTest.java new file mode 100644 index 0000000000..60d2047cec --- /dev/null +++ b/java-showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/SequenceServiceClientHttpJsonTest.java @@ -0,0 +1,735 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1; + +import static com.google.showcase.v1beta1.SequenceServiceClient.ListLocationsPagedResponse; + +import com.google.api.gax.core.NoCredentialsProvider; +import com.google.api.gax.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.testing.MockHttpService; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ApiException; +import com.google.api.gax.rpc.ApiExceptionFactory; +import com.google.api.gax.rpc.InvalidArgumentException; +import com.google.api.gax.rpc.StatusCode; +import com.google.api.gax.rpc.testing.FakeStatusCode; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.common.collect.Lists; +import com.google.iam.v1.AuditConfig; +import com.google.iam.v1.Binding; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.GetPolicyOptions; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.protobuf.Any; +import com.google.protobuf.ByteString; +import com.google.protobuf.Empty; +import com.google.protobuf.FieldMask; +import com.google.showcase.v1beta1.stub.HttpJsonSequenceServiceStub; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +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 SequenceServiceClientHttpJsonTest { + private static MockHttpService mockService; + private static SequenceServiceClient client; + + @BeforeClass + public static void startStaticServer() throws IOException { + mockService = + new MockHttpService( + HttpJsonSequenceServiceStub.getMethodDescriptors(), + SequenceServiceSettings.getDefaultEndpoint()); + SequenceServiceSettings settings = + SequenceServiceSettings.newHttpJsonBuilder() + .setTransportChannelProvider( + SequenceServiceSettings.defaultHttpJsonTransportProviderBuilder() + .setHttpTransport(mockService) + .build()) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = SequenceServiceClient.create(settings); + } + + @AfterClass + public static void stopServer() { + client.close(); + } + + @Before + public void setUp() {} + + @After + public void tearDown() throws Exception { + mockService.reset(); + } + + @Test + public void createSequenceTest() throws Exception { + Sequence expectedResponse = + Sequence.newBuilder() + .setName(SequenceName.of("[SEQUENCE]").toString()) + .addAllResponses(new ArrayList()) + .build(); + mockService.addResponse(expectedResponse); + + Sequence sequence = Sequence.newBuilder().build(); + + Sequence actualResponse = client.createSequence(sequence); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void createSequenceExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + Sequence sequence = Sequence.newBuilder().build(); + client.createSequence(sequence); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createStreamingSequenceTest() throws Exception { + StreamingSequence expectedResponse = + StreamingSequence.newBuilder() + .setName(StreamingSequenceName.of("[STREAMING_SEQUENCE]").toString()) + .setContent("content951530617") + .addAllResponses(new ArrayList()) + .build(); + mockService.addResponse(expectedResponse); + + StreamingSequence streamingSequence = StreamingSequence.newBuilder().build(); + + StreamingSequence actualResponse = client.createStreamingSequence(streamingSequence); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void createStreamingSequenceExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + StreamingSequence streamingSequence = StreamingSequence.newBuilder().build(); + client.createStreamingSequence(streamingSequence); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getSequenceReportTest() throws Exception { + SequenceReport expectedResponse = + SequenceReport.newBuilder() + .setName(SequenceReportName.of("[SEQUENCE]").toString()) + .addAllAttempts(new ArrayList()) + .build(); + mockService.addResponse(expectedResponse); + + SequenceReportName name = SequenceReportName.of("[SEQUENCE]"); + + SequenceReport actualResponse = client.getSequenceReport(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void getSequenceReportExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + SequenceReportName name = SequenceReportName.of("[SEQUENCE]"); + client.getSequenceReport(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getSequenceReportTest2() throws Exception { + SequenceReport expectedResponse = + SequenceReport.newBuilder() + .setName(SequenceReportName.of("[SEQUENCE]").toString()) + .addAllAttempts(new ArrayList()) + .build(); + mockService.addResponse(expectedResponse); + + String name = "sequences/sequence-5566/sequenceReport"; + + SequenceReport actualResponse = client.getSequenceReport(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void getSequenceReportExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String name = "sequences/sequence-5566/sequenceReport"; + client.getSequenceReport(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getStreamingSequenceReportTest() throws Exception { + StreamingSequenceReport expectedResponse = + StreamingSequenceReport.newBuilder() + .setName(StreamingSequenceReportName.of("[STREAMING_SEQUENCE]").toString()) + .addAllAttempts(new ArrayList()) + .build(); + mockService.addResponse(expectedResponse); + + StreamingSequenceReportName name = StreamingSequenceReportName.of("[STREAMING_SEQUENCE]"); + + StreamingSequenceReport actualResponse = client.getStreamingSequenceReport(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void getStreamingSequenceReportExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + StreamingSequenceReportName name = StreamingSequenceReportName.of("[STREAMING_SEQUENCE]"); + client.getStreamingSequenceReport(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getStreamingSequenceReportTest2() throws Exception { + StreamingSequenceReport expectedResponse = + StreamingSequenceReport.newBuilder() + .setName(StreamingSequenceReportName.of("[STREAMING_SEQUENCE]").toString()) + .addAllAttempts(new ArrayList()) + .build(); + mockService.addResponse(expectedResponse); + + String name = "streamingSequences/streamingSequence-962/streamingSequenceReport"; + + StreamingSequenceReport actualResponse = client.getStreamingSequenceReport(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void getStreamingSequenceReportExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String name = "streamingSequences/streamingSequence-962/streamingSequenceReport"; + client.getStreamingSequenceReport(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void attemptSequenceTest() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockService.addResponse(expectedResponse); + + SequenceName name = SequenceName.of("[SEQUENCE]"); + + client.attemptSequence(name); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void attemptSequenceExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + SequenceName name = SequenceName.of("[SEQUENCE]"); + client.attemptSequence(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void attemptSequenceTest2() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockService.addResponse(expectedResponse); + + String name = "sequences/sequence-9950"; + + client.attemptSequence(name); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void attemptSequenceExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String name = "sequences/sequence-9950"; + client.attemptSequence(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void attemptStreamingSequenceTest() throws Exception {} + + @Test + public void attemptStreamingSequenceExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + } + + @Test + public void listLocationsTest() throws Exception { + Location responsesElement = Location.newBuilder().build(); + ListLocationsResponse expectedResponse = + ListLocationsResponse.newBuilder() + .setNextPageToken("") + .addAllLocations(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + ListLocationsRequest request = + ListLocationsRequest.newBuilder() + .setName("projects/project-3664") + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + + ListLocationsPagedResponse pagedListResponse = client.listLocations(request); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getLocationsList().get(0), resources.get(0)); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void listLocationsExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ListLocationsRequest request = + ListLocationsRequest.newBuilder() + .setName("projects/project-3664") + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + client.listLocations(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getLocationTest() throws Exception { + Location expectedResponse = + Location.newBuilder() + .setName("name3373707") + .setLocationId("locationId1541836720") + .setDisplayName("displayName1714148973") + .putAllLabels(new HashMap()) + .setMetadata(Any.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + GetLocationRequest request = + GetLocationRequest.newBuilder() + .setName("projects/project-9062/locations/location-9062") + .build(); + + Location actualResponse = client.getLocation(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void getLocationExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + GetLocationRequest request = + GetLocationRequest.newBuilder() + .setName("projects/project-9062/locations/location-9062") + .build(); + client.getLocation(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void setIamPolicyTest() throws Exception { + Policy expectedResponse = + Policy.newBuilder() + .setVersion(351608024) + .addAllBindings(new ArrayList()) + .addAllAuditConfigs(new ArrayList()) + .setEtag(ByteString.EMPTY) + .build(); + mockService.addResponse(expectedResponse); + + SetIamPolicyRequest request = + SetIamPolicyRequest.newBuilder() + .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString()) + .setPolicy(Policy.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .build(); + + Policy actualResponse = client.setIamPolicy(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void setIamPolicyExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + SetIamPolicyRequest request = + SetIamPolicyRequest.newBuilder() + .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString()) + .setPolicy(Policy.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .build(); + client.setIamPolicy(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getIamPolicyTest() throws Exception { + Policy expectedResponse = + Policy.newBuilder() + .setVersion(351608024) + .addAllBindings(new ArrayList()) + .addAllAuditConfigs(new ArrayList()) + .setEtag(ByteString.EMPTY) + .build(); + mockService.addResponse(expectedResponse); + + GetIamPolicyRequest request = + GetIamPolicyRequest.newBuilder() + .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString()) + .setOptions(GetPolicyOptions.newBuilder().build()) + .build(); + + Policy actualResponse = client.getIamPolicy(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void getIamPolicyExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + GetIamPolicyRequest request = + GetIamPolicyRequest.newBuilder() + .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString()) + .setOptions(GetPolicyOptions.newBuilder().build()) + .build(); + client.getIamPolicy(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void testIamPermissionsTest() throws Exception { + TestIamPermissionsResponse expectedResponse = + TestIamPermissionsResponse.newBuilder().addAllPermissions(new ArrayList()).build(); + mockService.addResponse(expectedResponse); + + TestIamPermissionsRequest request = + TestIamPermissionsRequest.newBuilder() + .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString()) + .addAllPermissions(new ArrayList()) + .build(); + + TestIamPermissionsResponse actualResponse = client.testIamPermissions(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void testIamPermissionsExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + TestIamPermissionsRequest request = + TestIamPermissionsRequest.newBuilder() + .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString()) + .addAllPermissions(new ArrayList()) + .build(); + client.testIamPermissions(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } +} diff --git a/java-showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/SequenceServiceClientTest.java b/java-showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/SequenceServiceClientTest.java new file mode 100644 index 0000000000..8989dd92a5 --- /dev/null +++ b/java-showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/SequenceServiceClientTest.java @@ -0,0 +1,712 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1; + +import static com.google.showcase.v1beta1.SequenceServiceClient.ListLocationsPagedResponse; + +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.InvalidArgumentException; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.api.gax.rpc.StatusCode; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.common.collect.Lists; +import com.google.iam.v1.AuditConfig; +import com.google.iam.v1.Binding; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.GetPolicyOptions; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.protobuf.AbstractMessage; +import com.google.protobuf.Any; +import com.google.protobuf.ByteString; +import com.google.protobuf.Empty; +import com.google.protobuf.FieldMask; +import io.grpc.StatusRuntimeException; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.UUID; +import 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 SequenceServiceClientTest { + private static MockIAMPolicy mockIAMPolicy; + private static MockLocations mockLocations; + private static MockSequenceService mockSequenceService; + private static MockServiceHelper mockServiceHelper; + private LocalChannelProvider channelProvider; + private SequenceServiceClient client; + + @BeforeClass + public static void startStaticServer() { + mockSequenceService = new MockSequenceService(); + mockLocations = new MockLocations(); + mockIAMPolicy = new MockIAMPolicy(); + mockServiceHelper = + new MockServiceHelper( + UUID.randomUUID().toString(), + Arrays.asList(mockSequenceService, mockLocations, mockIAMPolicy)); + mockServiceHelper.start(); + } + + @AfterClass + public static void stopServer() { + mockServiceHelper.stop(); + } + + @Before + public void setUp() throws IOException { + mockServiceHelper.reset(); + channelProvider = mockServiceHelper.createChannelProvider(); + SequenceServiceSettings settings = + SequenceServiceSettings.newBuilder() + .setTransportChannelProvider(channelProvider) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = SequenceServiceClient.create(settings); + } + + @After + public void tearDown() throws Exception { + client.close(); + } + + @Test + public void createSequenceTest() throws Exception { + Sequence expectedResponse = + Sequence.newBuilder() + .setName(SequenceName.of("[SEQUENCE]").toString()) + .addAllResponses(new ArrayList()) + .build(); + mockSequenceService.addResponse(expectedResponse); + + Sequence sequence = Sequence.newBuilder().build(); + + Sequence actualResponse = client.createSequence(sequence); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockSequenceService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateSequenceRequest actualRequest = ((CreateSequenceRequest) actualRequests.get(0)); + + Assert.assertEquals(sequence, actualRequest.getSequence()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void createSequenceExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockSequenceService.addException(exception); + + try { + Sequence sequence = Sequence.newBuilder().build(); + client.createSequence(sequence); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createStreamingSequenceTest() throws Exception { + StreamingSequence expectedResponse = + StreamingSequence.newBuilder() + .setName(StreamingSequenceName.of("[STREAMING_SEQUENCE]").toString()) + .setContent("content951530617") + .addAllResponses(new ArrayList()) + .build(); + mockSequenceService.addResponse(expectedResponse); + + StreamingSequence streamingSequence = StreamingSequence.newBuilder().build(); + + StreamingSequence actualResponse = client.createStreamingSequence(streamingSequence); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockSequenceService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateStreamingSequenceRequest actualRequest = + ((CreateStreamingSequenceRequest) actualRequests.get(0)); + + Assert.assertEquals(streamingSequence, actualRequest.getStreamingSequence()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void createStreamingSequenceExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockSequenceService.addException(exception); + + try { + StreamingSequence streamingSequence = StreamingSequence.newBuilder().build(); + client.createStreamingSequence(streamingSequence); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getSequenceReportTest() throws Exception { + SequenceReport expectedResponse = + SequenceReport.newBuilder() + .setName(SequenceReportName.of("[SEQUENCE]").toString()) + .addAllAttempts(new ArrayList()) + .build(); + mockSequenceService.addResponse(expectedResponse); + + SequenceReportName name = SequenceReportName.of("[SEQUENCE]"); + + SequenceReport actualResponse = client.getSequenceReport(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockSequenceService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetSequenceReportRequest actualRequest = ((GetSequenceReportRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getSequenceReportExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockSequenceService.addException(exception); + + try { + SequenceReportName name = SequenceReportName.of("[SEQUENCE]"); + client.getSequenceReport(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getSequenceReportTest2() throws Exception { + SequenceReport expectedResponse = + SequenceReport.newBuilder() + .setName(SequenceReportName.of("[SEQUENCE]").toString()) + .addAllAttempts(new ArrayList()) + .build(); + mockSequenceService.addResponse(expectedResponse); + + String name = "name3373707"; + + SequenceReport actualResponse = client.getSequenceReport(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockSequenceService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetSequenceReportRequest actualRequest = ((GetSequenceReportRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getSequenceReportExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockSequenceService.addException(exception); + + try { + String name = "name3373707"; + client.getSequenceReport(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getStreamingSequenceReportTest() throws Exception { + StreamingSequenceReport expectedResponse = + StreamingSequenceReport.newBuilder() + .setName(StreamingSequenceReportName.of("[STREAMING_SEQUENCE]").toString()) + .addAllAttempts(new ArrayList()) + .build(); + mockSequenceService.addResponse(expectedResponse); + + StreamingSequenceReportName name = StreamingSequenceReportName.of("[STREAMING_SEQUENCE]"); + + StreamingSequenceReport actualResponse = client.getStreamingSequenceReport(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockSequenceService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetStreamingSequenceReportRequest actualRequest = + ((GetStreamingSequenceReportRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getStreamingSequenceReportExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockSequenceService.addException(exception); + + try { + StreamingSequenceReportName name = StreamingSequenceReportName.of("[STREAMING_SEQUENCE]"); + client.getStreamingSequenceReport(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getStreamingSequenceReportTest2() throws Exception { + StreamingSequenceReport expectedResponse = + StreamingSequenceReport.newBuilder() + .setName(StreamingSequenceReportName.of("[STREAMING_SEQUENCE]").toString()) + .addAllAttempts(new ArrayList()) + .build(); + mockSequenceService.addResponse(expectedResponse); + + String name = "name3373707"; + + StreamingSequenceReport actualResponse = client.getStreamingSequenceReport(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockSequenceService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetStreamingSequenceReportRequest actualRequest = + ((GetStreamingSequenceReportRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getStreamingSequenceReportExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockSequenceService.addException(exception); + + try { + String name = "name3373707"; + client.getStreamingSequenceReport(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void attemptSequenceTest() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockSequenceService.addResponse(expectedResponse); + + SequenceName name = SequenceName.of("[SEQUENCE]"); + + client.attemptSequence(name); + + List actualRequests = mockSequenceService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + AttemptSequenceRequest actualRequest = ((AttemptSequenceRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void attemptSequenceExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockSequenceService.addException(exception); + + try { + SequenceName name = SequenceName.of("[SEQUENCE]"); + client.attemptSequence(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void attemptSequenceTest2() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockSequenceService.addResponse(expectedResponse); + + String name = "name3373707"; + + client.attemptSequence(name); + + List actualRequests = mockSequenceService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + AttemptSequenceRequest actualRequest = ((AttemptSequenceRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void attemptSequenceExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockSequenceService.addException(exception); + + try { + String name = "name3373707"; + client.attemptSequence(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void attemptStreamingSequenceTest() throws Exception { + AttemptStreamingSequenceResponse expectedResponse = + AttemptStreamingSequenceResponse.newBuilder().setContent("content951530617").build(); + mockSequenceService.addResponse(expectedResponse); + AttemptStreamingSequenceRequest request = + AttemptStreamingSequenceRequest.newBuilder() + .setName(StreamingSequenceName.of("[STREAMING_SEQUENCE]").toString()) + .setLastFailIndex(2006482362) + .build(); + + MockStreamObserver responseObserver = + new MockStreamObserver<>(); + + ServerStreamingCallable + callable = client.attemptStreamingSequenceCallable(); + callable.serverStreamingCall(request, responseObserver); + + List actualResponses = responseObserver.future().get(); + Assert.assertEquals(1, actualResponses.size()); + Assert.assertEquals(expectedResponse, actualResponses.get(0)); + } + + @Test + public void attemptStreamingSequenceExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockSequenceService.addException(exception); + AttemptStreamingSequenceRequest request = + AttemptStreamingSequenceRequest.newBuilder() + .setName(StreamingSequenceName.of("[STREAMING_SEQUENCE]").toString()) + .setLastFailIndex(2006482362) + .build(); + + MockStreamObserver responseObserver = + new MockStreamObserver<>(); + + ServerStreamingCallable + callable = client.attemptStreamingSequenceCallable(); + callable.serverStreamingCall(request, responseObserver); + + 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()); + } + } + + @Test + public void listLocationsTest() throws Exception { + Location responsesElement = Location.newBuilder().build(); + ListLocationsResponse expectedResponse = + ListLocationsResponse.newBuilder() + .setNextPageToken("") + .addAllLocations(Arrays.asList(responsesElement)) + .build(); + mockLocations.addResponse(expectedResponse); + + ListLocationsRequest request = + ListLocationsRequest.newBuilder() + .setName("name3373707") + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + + ListLocationsPagedResponse pagedListResponse = client.listLocations(request); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getLocationsList().get(0), resources.get(0)); + + List actualRequests = mockLocations.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListLocationsRequest actualRequest = ((ListLocationsRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getName(), actualRequest.getName()); + Assert.assertEquals(request.getFilter(), actualRequest.getFilter()); + Assert.assertEquals(request.getPageSize(), actualRequest.getPageSize()); + Assert.assertEquals(request.getPageToken(), actualRequest.getPageToken()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listLocationsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockLocations.addException(exception); + + try { + ListLocationsRequest request = + ListLocationsRequest.newBuilder() + .setName("name3373707") + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + client.listLocations(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getLocationTest() throws Exception { + Location expectedResponse = + Location.newBuilder() + .setName("name3373707") + .setLocationId("locationId1541836720") + .setDisplayName("displayName1714148973") + .putAllLabels(new HashMap()) + .setMetadata(Any.newBuilder().build()) + .build(); + mockLocations.addResponse(expectedResponse); + + GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build(); + + Location actualResponse = client.getLocation(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockLocations.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetLocationRequest actualRequest = ((GetLocationRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getName(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getLocationExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockLocations.addException(exception); + + try { + GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build(); + client.getLocation(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void setIamPolicyTest() throws Exception { + Policy expectedResponse = + Policy.newBuilder() + .setVersion(351608024) + .addAllBindings(new ArrayList()) + .addAllAuditConfigs(new ArrayList()) + .setEtag(ByteString.EMPTY) + .build(); + mockIAMPolicy.addResponse(expectedResponse); + + SetIamPolicyRequest request = + SetIamPolicyRequest.newBuilder() + .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString()) + .setPolicy(Policy.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .build(); + + Policy actualResponse = client.setIamPolicy(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockIAMPolicy.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + SetIamPolicyRequest actualRequest = ((SetIamPolicyRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getResource(), actualRequest.getResource()); + Assert.assertEquals(request.getPolicy(), actualRequest.getPolicy()); + Assert.assertEquals(request.getUpdateMask(), actualRequest.getUpdateMask()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void setIamPolicyExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockIAMPolicy.addException(exception); + + try { + SetIamPolicyRequest request = + SetIamPolicyRequest.newBuilder() + .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString()) + .setPolicy(Policy.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .build(); + client.setIamPolicy(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getIamPolicyTest() throws Exception { + Policy expectedResponse = + Policy.newBuilder() + .setVersion(351608024) + .addAllBindings(new ArrayList()) + .addAllAuditConfigs(new ArrayList()) + .setEtag(ByteString.EMPTY) + .build(); + mockIAMPolicy.addResponse(expectedResponse); + + GetIamPolicyRequest request = + GetIamPolicyRequest.newBuilder() + .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString()) + .setOptions(GetPolicyOptions.newBuilder().build()) + .build(); + + Policy actualResponse = client.getIamPolicy(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockIAMPolicy.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetIamPolicyRequest actualRequest = ((GetIamPolicyRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getResource(), actualRequest.getResource()); + Assert.assertEquals(request.getOptions(), actualRequest.getOptions()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getIamPolicyExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockIAMPolicy.addException(exception); + + try { + GetIamPolicyRequest request = + GetIamPolicyRequest.newBuilder() + .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString()) + .setOptions(GetPolicyOptions.newBuilder().build()) + .build(); + client.getIamPolicy(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void testIamPermissionsTest() throws Exception { + TestIamPermissionsResponse expectedResponse = + TestIamPermissionsResponse.newBuilder().addAllPermissions(new ArrayList()).build(); + mockIAMPolicy.addResponse(expectedResponse); + + TestIamPermissionsRequest request = + TestIamPermissionsRequest.newBuilder() + .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString()) + .addAllPermissions(new ArrayList()) + .build(); + + TestIamPermissionsResponse actualResponse = client.testIamPermissions(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockIAMPolicy.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + TestIamPermissionsRequest actualRequest = ((TestIamPermissionsRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getResource(), actualRequest.getResource()); + Assert.assertEquals(request.getPermissionsList(), actualRequest.getPermissionsList()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void testIamPermissionsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockIAMPolicy.addException(exception); + + try { + TestIamPermissionsRequest request = + TestIamPermissionsRequest.newBuilder() + .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString()) + .addAllPermissions(new ArrayList()) + .build(); + client.testIamPermissions(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } +} diff --git a/java-showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/TestingClientHttpJsonTest.java b/java-showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/TestingClientHttpJsonTest.java new file mode 100644 index 0000000000..49dd9e466f --- /dev/null +++ b/java-showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/TestingClientHttpJsonTest.java @@ -0,0 +1,766 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1; + +import static com.google.showcase.v1beta1.TestingClient.ListLocationsPagedResponse; +import static com.google.showcase.v1beta1.TestingClient.ListSessionsPagedResponse; +import static com.google.showcase.v1beta1.TestingClient.ListTestsPagedResponse; + +import com.google.api.gax.core.NoCredentialsProvider; +import com.google.api.gax.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.testing.MockHttpService; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ApiException; +import com.google.api.gax.rpc.ApiExceptionFactory; +import com.google.api.gax.rpc.InvalidArgumentException; +import com.google.api.gax.rpc.StatusCode; +import com.google.api.gax.rpc.testing.FakeStatusCode; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.common.collect.Lists; +import com.google.iam.v1.AuditConfig; +import com.google.iam.v1.Binding; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.GetPolicyOptions; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.protobuf.Any; +import com.google.protobuf.ByteString; +import com.google.protobuf.Empty; +import com.google.protobuf.FieldMask; +import com.google.showcase.v1beta1.stub.HttpJsonTestingStub; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +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 TestingClientHttpJsonTest { + private static MockHttpService mockService; + private static TestingClient client; + + @BeforeClass + public static void startStaticServer() throws IOException { + mockService = + new MockHttpService( + HttpJsonTestingStub.getMethodDescriptors(), TestingSettings.getDefaultEndpoint()); + TestingSettings settings = + TestingSettings.newHttpJsonBuilder() + .setTransportChannelProvider( + TestingSettings.defaultHttpJsonTransportProviderBuilder() + .setHttpTransport(mockService) + .build()) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = TestingClient.create(settings); + } + + @AfterClass + public static void stopServer() { + client.close(); + } + + @Before + public void setUp() {} + + @After + public void tearDown() throws Exception { + mockService.reset(); + } + + @Test + public void createSessionTest() throws Exception { + Session expectedResponse = + Session.newBuilder().setName(SessionName.of("[SESSION]").toString()).build(); + mockService.addResponse(expectedResponse); + + CreateSessionRequest request = + CreateSessionRequest.newBuilder().setSession(Session.newBuilder().build()).build(); + + Session actualResponse = client.createSession(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void createSessionExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + CreateSessionRequest request = + CreateSessionRequest.newBuilder().setSession(Session.newBuilder().build()).build(); + client.createSession(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getSessionTest() throws Exception { + Session expectedResponse = + Session.newBuilder().setName(SessionName.of("[SESSION]").toString()).build(); + mockService.addResponse(expectedResponse); + + GetSessionRequest request = + GetSessionRequest.newBuilder().setName(SessionName.of("[SESSION]").toString()).build(); + + Session actualResponse = client.getSession(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void getSessionExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + GetSessionRequest request = + GetSessionRequest.newBuilder().setName(SessionName.of("[SESSION]").toString()).build(); + client.getSession(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listSessionsTest() throws Exception { + Session responsesElement = Session.newBuilder().build(); + ListSessionsResponse expectedResponse = + ListSessionsResponse.newBuilder() + .setNextPageToken("") + .addAllSessions(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + ListSessionsRequest request = + ListSessionsRequest.newBuilder() + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + + ListSessionsPagedResponse pagedListResponse = client.listSessions(request); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getSessionsList().get(0), resources.get(0)); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void listSessionsExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ListSessionsRequest request = + ListSessionsRequest.newBuilder() + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + client.listSessions(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void deleteSessionTest() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockService.addResponse(expectedResponse); + + DeleteSessionRequest request = + DeleteSessionRequest.newBuilder().setName(SessionName.of("[SESSION]").toString()).build(); + + client.deleteSession(request); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void deleteSessionExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + DeleteSessionRequest request = + DeleteSessionRequest.newBuilder().setName(SessionName.of("[SESSION]").toString()).build(); + client.deleteSession(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void reportSessionTest() throws Exception { + ReportSessionResponse expectedResponse = + ReportSessionResponse.newBuilder().addAllTestRuns(new ArrayList()).build(); + mockService.addResponse(expectedResponse); + + ReportSessionRequest request = + ReportSessionRequest.newBuilder().setName(SessionName.of("[SESSION]").toString()).build(); + + ReportSessionResponse actualResponse = client.reportSession(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void reportSessionExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ReportSessionRequest request = + ReportSessionRequest.newBuilder().setName(SessionName.of("[SESSION]").toString()).build(); + client.reportSession(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listTestsTest() throws Exception { + com.google.showcase.v1beta1.Test responsesElement = + com.google.showcase.v1beta1.Test.newBuilder().build(); + ListTestsResponse expectedResponse = + ListTestsResponse.newBuilder() + .setNextPageToken("") + .addAllTests(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + ListTestsRequest request = + ListTestsRequest.newBuilder() + .setParent(SessionName.of("[SESSION]").toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + + ListTestsPagedResponse pagedListResponse = client.listTests(request); + + List resources = + Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getTestsList().get(0), resources.get(0)); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void listTestsExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ListTestsRequest request = + ListTestsRequest.newBuilder() + .setParent(SessionName.of("[SESSION]").toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + client.listTests(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void deleteTestTest() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockService.addResponse(expectedResponse); + + DeleteTestRequest request = + DeleteTestRequest.newBuilder() + .setName(TestName.of("[SESSION]", "[TEST]").toString()) + .build(); + + client.deleteTest(request); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void deleteTestExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + DeleteTestRequest request = + DeleteTestRequest.newBuilder() + .setName(TestName.of("[SESSION]", "[TEST]").toString()) + .build(); + client.deleteTest(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void verifyTestTest() throws Exception { + VerifyTestResponse expectedResponse = + VerifyTestResponse.newBuilder().setIssue(Issue.newBuilder().build()).build(); + mockService.addResponse(expectedResponse); + + VerifyTestRequest request = + VerifyTestRequest.newBuilder() + .setName(TestName.of("[SESSION]", "[TEST]").toString()) + .setAnswer(ByteString.EMPTY) + .addAllAnswers(new ArrayList()) + .build(); + + VerifyTestResponse actualResponse = client.verifyTest(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void verifyTestExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + VerifyTestRequest request = + VerifyTestRequest.newBuilder() + .setName(TestName.of("[SESSION]", "[TEST]").toString()) + .setAnswer(ByteString.EMPTY) + .addAllAnswers(new ArrayList()) + .build(); + client.verifyTest(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listLocationsTest() throws Exception { + Location responsesElement = Location.newBuilder().build(); + ListLocationsResponse expectedResponse = + ListLocationsResponse.newBuilder() + .setNextPageToken("") + .addAllLocations(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + ListLocationsRequest request = + ListLocationsRequest.newBuilder() + .setName("projects/project-3664") + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + + ListLocationsPagedResponse pagedListResponse = client.listLocations(request); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getLocationsList().get(0), resources.get(0)); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void listLocationsExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ListLocationsRequest request = + ListLocationsRequest.newBuilder() + .setName("projects/project-3664") + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + client.listLocations(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getLocationTest() throws Exception { + Location expectedResponse = + Location.newBuilder() + .setName("name3373707") + .setLocationId("locationId1541836720") + .setDisplayName("displayName1714148973") + .putAllLabels(new HashMap()) + .setMetadata(Any.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + GetLocationRequest request = + GetLocationRequest.newBuilder() + .setName("projects/project-9062/locations/location-9062") + .build(); + + Location actualResponse = client.getLocation(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void getLocationExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + GetLocationRequest request = + GetLocationRequest.newBuilder() + .setName("projects/project-9062/locations/location-9062") + .build(); + client.getLocation(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void setIamPolicyTest() throws Exception { + Policy expectedResponse = + Policy.newBuilder() + .setVersion(351608024) + .addAllBindings(new ArrayList()) + .addAllAuditConfigs(new ArrayList()) + .setEtag(ByteString.EMPTY) + .build(); + mockService.addResponse(expectedResponse); + + SetIamPolicyRequest request = + SetIamPolicyRequest.newBuilder() + .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString()) + .setPolicy(Policy.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .build(); + + Policy actualResponse = client.setIamPolicy(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void setIamPolicyExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + SetIamPolicyRequest request = + SetIamPolicyRequest.newBuilder() + .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString()) + .setPolicy(Policy.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .build(); + client.setIamPolicy(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getIamPolicyTest() throws Exception { + Policy expectedResponse = + Policy.newBuilder() + .setVersion(351608024) + .addAllBindings(new ArrayList()) + .addAllAuditConfigs(new ArrayList()) + .setEtag(ByteString.EMPTY) + .build(); + mockService.addResponse(expectedResponse); + + GetIamPolicyRequest request = + GetIamPolicyRequest.newBuilder() + .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString()) + .setOptions(GetPolicyOptions.newBuilder().build()) + .build(); + + Policy actualResponse = client.getIamPolicy(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void getIamPolicyExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + GetIamPolicyRequest request = + GetIamPolicyRequest.newBuilder() + .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString()) + .setOptions(GetPolicyOptions.newBuilder().build()) + .build(); + client.getIamPolicy(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void testIamPermissionsTest() throws Exception { + TestIamPermissionsResponse expectedResponse = + TestIamPermissionsResponse.newBuilder().addAllPermissions(new ArrayList()).build(); + mockService.addResponse(expectedResponse); + + TestIamPermissionsRequest request = + TestIamPermissionsRequest.newBuilder() + .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString()) + .addAllPermissions(new ArrayList()) + .build(); + + TestIamPermissionsResponse actualResponse = client.testIamPermissions(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void testIamPermissionsExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + TestIamPermissionsRequest request = + TestIamPermissionsRequest.newBuilder() + .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString()) + .addAllPermissions(new ArrayList()) + .build(); + client.testIamPermissions(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } +} diff --git a/java-showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/TestingClientTest.java b/java-showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/TestingClientTest.java new file mode 100644 index 0000000000..6ff29d95c6 --- /dev/null +++ b/java-showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/TestingClientTest.java @@ -0,0 +1,703 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1; + +import static com.google.showcase.v1beta1.TestingClient.ListLocationsPagedResponse; +import static com.google.showcase.v1beta1.TestingClient.ListSessionsPagedResponse; +import static com.google.showcase.v1beta1.TestingClient.ListTestsPagedResponse; + +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.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.common.collect.Lists; +import com.google.iam.v1.AuditConfig; +import com.google.iam.v1.Binding; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.GetPolicyOptions; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.protobuf.AbstractMessage; +import com.google.protobuf.Any; +import com.google.protobuf.ByteString; +import com.google.protobuf.Empty; +import com.google.protobuf.FieldMask; +import io.grpc.StatusRuntimeException; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.UUID; +import javax.annotation.Generated; +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Assert; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; + +@Generated("by gapic-generator-java") +public class TestingClientTest { + private static MockIAMPolicy mockIAMPolicy; + private static MockLocations mockLocations; + private static MockServiceHelper mockServiceHelper; + private static MockTesting mockTesting; + private LocalChannelProvider channelProvider; + private TestingClient client; + + @BeforeClass + public static void startStaticServer() { + mockTesting = new MockTesting(); + mockLocations = new MockLocations(); + mockIAMPolicy = new MockIAMPolicy(); + mockServiceHelper = + new MockServiceHelper( + UUID.randomUUID().toString(), + Arrays.asList(mockTesting, mockLocations, mockIAMPolicy)); + mockServiceHelper.start(); + } + + @AfterClass + public static void stopServer() { + mockServiceHelper.stop(); + } + + @Before + public void setUp() throws IOException { + mockServiceHelper.reset(); + channelProvider = mockServiceHelper.createChannelProvider(); + TestingSettings settings = + TestingSettings.newBuilder() + .setTransportChannelProvider(channelProvider) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = TestingClient.create(settings); + } + + @After + public void tearDown() throws Exception { + client.close(); + } + + @Test + public void createSessionTest() throws Exception { + Session expectedResponse = + Session.newBuilder().setName(SessionName.of("[SESSION]").toString()).build(); + mockTesting.addResponse(expectedResponse); + + CreateSessionRequest request = + CreateSessionRequest.newBuilder().setSession(Session.newBuilder().build()).build(); + + Session actualResponse = client.createSession(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockTesting.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateSessionRequest actualRequest = ((CreateSessionRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getSession(), actualRequest.getSession()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void createSessionExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockTesting.addException(exception); + + try { + CreateSessionRequest request = + CreateSessionRequest.newBuilder().setSession(Session.newBuilder().build()).build(); + client.createSession(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getSessionTest() throws Exception { + Session expectedResponse = + Session.newBuilder().setName(SessionName.of("[SESSION]").toString()).build(); + mockTesting.addResponse(expectedResponse); + + GetSessionRequest request = + GetSessionRequest.newBuilder().setName(SessionName.of("[SESSION]").toString()).build(); + + Session actualResponse = client.getSession(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockTesting.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetSessionRequest actualRequest = ((GetSessionRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getName(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getSessionExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockTesting.addException(exception); + + try { + GetSessionRequest request = + GetSessionRequest.newBuilder().setName(SessionName.of("[SESSION]").toString()).build(); + client.getSession(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listSessionsTest() throws Exception { + Session responsesElement = Session.newBuilder().build(); + ListSessionsResponse expectedResponse = + ListSessionsResponse.newBuilder() + .setNextPageToken("") + .addAllSessions(Arrays.asList(responsesElement)) + .build(); + mockTesting.addResponse(expectedResponse); + + ListSessionsRequest request = + ListSessionsRequest.newBuilder() + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + + ListSessionsPagedResponse pagedListResponse = client.listSessions(request); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getSessionsList().get(0), resources.get(0)); + + List actualRequests = mockTesting.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListSessionsRequest actualRequest = ((ListSessionsRequest) 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 listSessionsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockTesting.addException(exception); + + try { + ListSessionsRequest request = + ListSessionsRequest.newBuilder() + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + client.listSessions(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void deleteSessionTest() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockTesting.addResponse(expectedResponse); + + DeleteSessionRequest request = + DeleteSessionRequest.newBuilder().setName(SessionName.of("[SESSION]").toString()).build(); + + client.deleteSession(request); + + List actualRequests = mockTesting.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeleteSessionRequest actualRequest = ((DeleteSessionRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getName(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void deleteSessionExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockTesting.addException(exception); + + try { + DeleteSessionRequest request = + DeleteSessionRequest.newBuilder().setName(SessionName.of("[SESSION]").toString()).build(); + client.deleteSession(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void reportSessionTest() throws Exception { + ReportSessionResponse expectedResponse = + ReportSessionResponse.newBuilder().addAllTestRuns(new ArrayList()).build(); + mockTesting.addResponse(expectedResponse); + + ReportSessionRequest request = + ReportSessionRequest.newBuilder().setName(SessionName.of("[SESSION]").toString()).build(); + + ReportSessionResponse actualResponse = client.reportSession(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockTesting.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ReportSessionRequest actualRequest = ((ReportSessionRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getName(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void reportSessionExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockTesting.addException(exception); + + try { + ReportSessionRequest request = + ReportSessionRequest.newBuilder().setName(SessionName.of("[SESSION]").toString()).build(); + client.reportSession(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listTestsTest() throws Exception { + com.google.showcase.v1beta1.Test responsesElement = + com.google.showcase.v1beta1.Test.newBuilder().build(); + ListTestsResponse expectedResponse = + ListTestsResponse.newBuilder() + .setNextPageToken("") + .addAllTests(Arrays.asList(responsesElement)) + .build(); + mockTesting.addResponse(expectedResponse); + + ListTestsRequest request = + ListTestsRequest.newBuilder() + .setParent(SessionName.of("[SESSION]").toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + + ListTestsPagedResponse pagedListResponse = client.listTests(request); + + List resources = + Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getTestsList().get(0), resources.get(0)); + + List actualRequests = mockTesting.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListTestsRequest actualRequest = ((ListTestsRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getParent(), actualRequest.getParent()); + Assert.assertEquals(request.getPageSize(), actualRequest.getPageSize()); + Assert.assertEquals(request.getPageToken(), actualRequest.getPageToken()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listTestsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockTesting.addException(exception); + + try { + ListTestsRequest request = + ListTestsRequest.newBuilder() + .setParent(SessionName.of("[SESSION]").toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + client.listTests(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void deleteTestTest() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockTesting.addResponse(expectedResponse); + + DeleteTestRequest request = + DeleteTestRequest.newBuilder() + .setName(TestName.of("[SESSION]", "[TEST]").toString()) + .build(); + + client.deleteTest(request); + + List actualRequests = mockTesting.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeleteTestRequest actualRequest = ((DeleteTestRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getName(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void deleteTestExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockTesting.addException(exception); + + try { + DeleteTestRequest request = + DeleteTestRequest.newBuilder() + .setName(TestName.of("[SESSION]", "[TEST]").toString()) + .build(); + client.deleteTest(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void verifyTestTest() throws Exception { + VerifyTestResponse expectedResponse = + VerifyTestResponse.newBuilder().setIssue(Issue.newBuilder().build()).build(); + mockTesting.addResponse(expectedResponse); + + VerifyTestRequest request = + VerifyTestRequest.newBuilder() + .setName(TestName.of("[SESSION]", "[TEST]").toString()) + .setAnswer(ByteString.EMPTY) + .addAllAnswers(new ArrayList()) + .build(); + + VerifyTestResponse actualResponse = client.verifyTest(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockTesting.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + VerifyTestRequest actualRequest = ((VerifyTestRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getName(), actualRequest.getName()); + Assert.assertEquals(request.getAnswer(), actualRequest.getAnswer()); + Assert.assertEquals(request.getAnswersList(), actualRequest.getAnswersList()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void verifyTestExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockTesting.addException(exception); + + try { + VerifyTestRequest request = + VerifyTestRequest.newBuilder() + .setName(TestName.of("[SESSION]", "[TEST]").toString()) + .setAnswer(ByteString.EMPTY) + .addAllAnswers(new ArrayList()) + .build(); + client.verifyTest(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listLocationsTest() throws Exception { + Location responsesElement = Location.newBuilder().build(); + ListLocationsResponse expectedResponse = + ListLocationsResponse.newBuilder() + .setNextPageToken("") + .addAllLocations(Arrays.asList(responsesElement)) + .build(); + mockLocations.addResponse(expectedResponse); + + ListLocationsRequest request = + ListLocationsRequest.newBuilder() + .setName("name3373707") + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + + ListLocationsPagedResponse pagedListResponse = client.listLocations(request); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getLocationsList().get(0), resources.get(0)); + + List actualRequests = mockLocations.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListLocationsRequest actualRequest = ((ListLocationsRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getName(), actualRequest.getName()); + Assert.assertEquals(request.getFilter(), actualRequest.getFilter()); + Assert.assertEquals(request.getPageSize(), actualRequest.getPageSize()); + Assert.assertEquals(request.getPageToken(), actualRequest.getPageToken()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listLocationsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockLocations.addException(exception); + + try { + ListLocationsRequest request = + ListLocationsRequest.newBuilder() + .setName("name3373707") + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + client.listLocations(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getLocationTest() throws Exception { + Location expectedResponse = + Location.newBuilder() + .setName("name3373707") + .setLocationId("locationId1541836720") + .setDisplayName("displayName1714148973") + .putAllLabels(new HashMap()) + .setMetadata(Any.newBuilder().build()) + .build(); + mockLocations.addResponse(expectedResponse); + + GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build(); + + Location actualResponse = client.getLocation(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockLocations.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetLocationRequest actualRequest = ((GetLocationRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getName(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getLocationExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockLocations.addException(exception); + + try { + GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build(); + client.getLocation(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void setIamPolicyTest() throws Exception { + Policy expectedResponse = + Policy.newBuilder() + .setVersion(351608024) + .addAllBindings(new ArrayList()) + .addAllAuditConfigs(new ArrayList()) + .setEtag(ByteString.EMPTY) + .build(); + mockIAMPolicy.addResponse(expectedResponse); + + SetIamPolicyRequest request = + SetIamPolicyRequest.newBuilder() + .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString()) + .setPolicy(Policy.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .build(); + + Policy actualResponse = client.setIamPolicy(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockIAMPolicy.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + SetIamPolicyRequest actualRequest = ((SetIamPolicyRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getResource(), actualRequest.getResource()); + Assert.assertEquals(request.getPolicy(), actualRequest.getPolicy()); + Assert.assertEquals(request.getUpdateMask(), actualRequest.getUpdateMask()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void setIamPolicyExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockIAMPolicy.addException(exception); + + try { + SetIamPolicyRequest request = + SetIamPolicyRequest.newBuilder() + .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString()) + .setPolicy(Policy.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .build(); + client.setIamPolicy(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getIamPolicyTest() throws Exception { + Policy expectedResponse = + Policy.newBuilder() + .setVersion(351608024) + .addAllBindings(new ArrayList()) + .addAllAuditConfigs(new ArrayList()) + .setEtag(ByteString.EMPTY) + .build(); + mockIAMPolicy.addResponse(expectedResponse); + + GetIamPolicyRequest request = + GetIamPolicyRequest.newBuilder() + .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString()) + .setOptions(GetPolicyOptions.newBuilder().build()) + .build(); + + Policy actualResponse = client.getIamPolicy(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockIAMPolicy.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetIamPolicyRequest actualRequest = ((GetIamPolicyRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getResource(), actualRequest.getResource()); + Assert.assertEquals(request.getOptions(), actualRequest.getOptions()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getIamPolicyExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockIAMPolicy.addException(exception); + + try { + GetIamPolicyRequest request = + GetIamPolicyRequest.newBuilder() + .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString()) + .setOptions(GetPolicyOptions.newBuilder().build()) + .build(); + client.getIamPolicy(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void testIamPermissionsTest() throws Exception { + TestIamPermissionsResponse expectedResponse = + TestIamPermissionsResponse.newBuilder().addAllPermissions(new ArrayList()).build(); + mockIAMPolicy.addResponse(expectedResponse); + + TestIamPermissionsRequest request = + TestIamPermissionsRequest.newBuilder() + .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString()) + .addAllPermissions(new ArrayList()) + .build(); + + TestIamPermissionsResponse actualResponse = client.testIamPermissions(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockIAMPolicy.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + TestIamPermissionsRequest actualRequest = ((TestIamPermissionsRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getResource(), actualRequest.getResource()); + Assert.assertEquals(request.getPermissionsList(), actualRequest.getPermissionsList()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void testIamPermissionsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockIAMPolicy.addException(exception); + + try { + TestIamPermissionsRequest request = + TestIamPermissionsRequest.newBuilder() + .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString()) + .addAllPermissions(new ArrayList()) + .build(); + client.testIamPermissions(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } +} diff --git a/java-showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/ITApiKeyCredentials.java b/java-showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/ITApiKeyCredentials.java new file mode 100644 index 0000000000..5867bcfea9 --- /dev/null +++ b/java-showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/ITApiKeyCredentials.java @@ -0,0 +1,219 @@ +/* + * 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 + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.it; + +import static com.google.common.truth.Truth.assertThat; + +import com.google.api.client.http.javanet.NetHttpTransport; +import com.google.api.gax.rpc.FixedHeaderProvider; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.auth.http.AuthHttpConstants; +import com.google.common.collect.ImmutableList; +import com.google.showcase.v1beta1.EchoClient; +import com.google.showcase.v1beta1.EchoRequest; +import com.google.showcase.v1beta1.EchoSettings; +import com.google.showcase.v1beta1.it.util.GrpcCapturingClientInterceptor; +import com.google.showcase.v1beta1.it.util.HttpJsonCapturingClientInterceptor; +import com.google.showcase.v1beta1.it.util.TestClientInitializer; +import io.grpc.ManagedChannelBuilder; +import io.grpc.Metadata; +import java.io.IOException; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.concurrent.TimeUnit; +import java.util.stream.Collectors; +import java.util.stream.StreamSupport; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; + +/** + * Test suite to confirm a client can be instantiated with API key credentials and correct + * authorization sent via headers to back end + */ +class ITApiKeyCredentials { + + private static final String API_KEY = "fake_api_key"; + private static final String API_KEY_AUTH_HEADER = "x-goog-api-key"; + private static final String HTTP_RESPONSE_HEADER_STRING = + "x-showcase-request-" + API_KEY_AUTH_HEADER; + private static final String GRPC_ENDPOINT = "localhost:7469"; + private static final String HTTP_ENDPOINT = "http://localhost:7469"; + + private static HttpJsonCapturingClientInterceptor httpJsonInterceptor; + private static EchoClient grpcClient; + private static EchoClient httpJsonClient; + private static GrpcCapturingClientInterceptor grpcInterceptor; + + @BeforeEach + void setup() throws IOException { + grpcInterceptor = new GrpcCapturingClientInterceptor(); + httpJsonInterceptor = new HttpJsonCapturingClientInterceptor(); + } + + @AfterEach + void tearDown() throws InterruptedException { + if (httpJsonClient != null) { + httpJsonClient.close(); + httpJsonClient.awaitTermination( + TestClientInitializer.AWAIT_TERMINATION_SECONDS, TimeUnit.SECONDS); + } + if (grpcClient != null) { + grpcClient.close(); + grpcClient.awaitTermination( + TestClientInitializer.AWAIT_TERMINATION_SECONDS, TimeUnit.SECONDS); + } + } + + @Test + void testCreateGrpcClient_withApiKey_sendsApiHeaderToServer() throws IOException { + Metadata.Key apiKeyAuthHeader = + Metadata.Key.of(API_KEY_AUTH_HEADER, Metadata.ASCII_STRING_MARSHALLER); + Metadata.Key defaultAuthorizationHeader = + Metadata.Key.of(AuthHttpConstants.AUTHORIZATION, Metadata.ASCII_STRING_MARSHALLER); + EchoSettings.Builder echoBuilder = + EchoSettings.newBuilder() + .setApiKey(API_KEY) + .setEndpoint(GRPC_ENDPOINT) + .setTransportChannelProvider( + EchoSettings.defaultGrpcTransportProviderBuilder() + .setChannelConfigurator(ManagedChannelBuilder::usePlaintext) + .setInterceptorProvider(() -> ImmutableList.of(grpcInterceptor)) + .build()); + EchoSettings settings = echoBuilder.build(); + grpcClient = EchoClient.create(settings); + + grpcClient.echo(EchoRequest.newBuilder().build()); + + assertThat(echoBuilder.getApiKey()).isEqualTo(API_KEY); + assertThat(settings.getApiKey()).isEqualTo(API_KEY); + String headerValue = grpcInterceptor.metadata.get(apiKeyAuthHeader); + assertThat(headerValue).isEqualTo(API_KEY); + String defaultAuthorizationHeaderValue = + grpcInterceptor.metadata.get(defaultAuthorizationHeader); + assertThat(defaultAuthorizationHeaderValue).isNull(); + } + + @Test + void testCreateGrpcClient_withApiKeySetViaSetterAndHeader_dedupsHeader() throws IOException { + String apiHeaderKey = "fake_api_key_2"; + Metadata.Key apiKeyAuthHeader = + Metadata.Key.of(API_KEY_AUTH_HEADER, Metadata.ASCII_STRING_MARSHALLER); + Metadata.Key defaultAuthorizationHeader = + Metadata.Key.of(AuthHttpConstants.AUTHORIZATION, Metadata.ASCII_STRING_MARSHALLER); + Map header = + new HashMap() { + { + put(API_KEY_AUTH_HEADER, apiHeaderKey); + } + }; + FixedHeaderProvider headerProvider = FixedHeaderProvider.create(header); + + TransportChannelProvider transportChannelProvider = + EchoSettings.defaultGrpcTransportProviderBuilder() + .setHeaderProvider(headerProvider) + .setChannelConfigurator(ManagedChannelBuilder::usePlaintext) + .setInterceptorProvider(() -> ImmutableList.of(grpcInterceptor)) + .build(); + EchoSettings settings = + EchoSettings.newBuilder() + .setApiKey(API_KEY) + .setEndpoint(GRPC_ENDPOINT) + .setTransportChannelProvider(transportChannelProvider) + .build(); + grpcClient = EchoClient.create(settings); + + grpcClient.echo(EchoRequest.newBuilder().build()); + + Iterable matchingHeaders = grpcInterceptor.metadata.getAll(apiKeyAuthHeader); + List matchingHeadersList = + StreamSupport.stream(matchingHeaders.spliterator(), false).collect(Collectors.toList()); + + String headerValue = matchingHeadersList.get(0); + assertThat(headerValue).isEqualTo(API_KEY); + assertThat(matchingHeadersList.size()).isEqualTo(1); + } + + @Test + void testCreateHttpClient_withApiKey_sendsApiHeaderToServer() throws Exception { + EchoSettings httpJsonEchoSettings = + EchoSettings.newHttpJsonBuilder() + .setApiKey(API_KEY) + .setTransportChannelProvider( + EchoSettings.defaultHttpJsonTransportProviderBuilder() + .setHttpTransport( + new NetHttpTransport.Builder().doNotValidateCertificate().build()) + .setEndpoint(HTTP_ENDPOINT) + .setInterceptorProvider(() -> ImmutableList.of(httpJsonInterceptor)) + .build()) + .build(); + httpJsonClient = EchoClient.create(httpJsonEchoSettings); + + httpJsonClient.echo(EchoRequest.newBuilder().build()); + + ArrayList headerValues = + (ArrayList) + httpJsonInterceptor.metadata.getHeaders().get(HTTP_RESPONSE_HEADER_STRING); + String headerValue = headerValues.get(0); + assertThat(headerValue).isEqualTo(API_KEY); + } + + @Test + void testCreateHttpClient_withApiKeySetViaSetterAndHeader_dedupsHeader() throws Exception { + String apiHeaderKey = "fake_api_key_2"; + Metadata.Key apiKeyAuthHeader = + Metadata.Key.of(API_KEY_AUTH_HEADER, Metadata.ASCII_STRING_MARSHALLER); + Metadata.Key defaultAuthorizationHeader = + Metadata.Key.of(AuthHttpConstants.AUTHORIZATION, Metadata.ASCII_STRING_MARSHALLER); + Map header = + new HashMap() { + { + put(API_KEY_AUTH_HEADER, apiHeaderKey); + } + }; + FixedHeaderProvider headerProvider = FixedHeaderProvider.create(header); + + TransportChannelProvider transportChannelProvider = + EchoSettings.defaultHttpJsonTransportProviderBuilder() + .setHeaderProvider(headerProvider) + .setInterceptorProvider(() -> ImmutableList.of(httpJsonInterceptor)) + .build(); + EchoSettings httpJsonEchoSettings = + EchoSettings.newHttpJsonBuilder() + .setApiKey(API_KEY) + .setTransportChannelProvider( + EchoSettings.defaultHttpJsonTransportProviderBuilder() + .setHttpTransport( + new NetHttpTransport.Builder().doNotValidateCertificate().build()) + .setEndpoint(HTTP_ENDPOINT) + .setInterceptorProvider(() -> ImmutableList.of(httpJsonInterceptor)) + .build()) + .build(); + httpJsonClient = EchoClient.create(httpJsonEchoSettings); + + httpJsonClient.echo(EchoRequest.newBuilder().build()); + + ArrayList headerValues = + (ArrayList) + httpJsonInterceptor.metadata.getHeaders().get(HTTP_RESPONSE_HEADER_STRING); + String headerValue = headerValues.get(0); + assertThat(headerValue).isEqualTo(API_KEY); + assertThat(headerValues.size()).isEqualTo(1); + } +} diff --git a/java-showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/ITAutoPopulatedFields.java b/java-showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/ITAutoPopulatedFields.java new file mode 100644 index 0000000000..f73b6b3c7d --- /dev/null +++ b/java-showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/ITAutoPopulatedFields.java @@ -0,0 +1,379 @@ +/* + * 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 + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.showcase.v1beta1.it; + +import static org.junit.jupiter.api.Assertions.assertThrows; + +import com.google.api.gax.httpjson.ApiMethodDescriptor; +import com.google.api.gax.httpjson.ForwardingHttpJsonClientCall; +import com.google.api.gax.httpjson.HttpJsonCallOptions; +import com.google.api.gax.httpjson.HttpJsonChannel; +import com.google.api.gax.httpjson.HttpJsonClientCall; +import com.google.api.gax.httpjson.HttpJsonClientInterceptor; +import com.google.api.gax.retrying.RetrySettings; +import com.google.api.gax.retrying.RetryingFuture; +import com.google.api.gax.rpc.StatusCode.Code; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableSet; +import com.google.common.truth.Truth; +import com.google.rpc.Status; +import com.google.showcase.v1beta1.EchoClient; +import com.google.showcase.v1beta1.EchoRequest; +import com.google.showcase.v1beta1.EchoResponse; +import com.google.showcase.v1beta1.it.util.TestClientInitializer; +import io.grpc.CallOptions; +import io.grpc.Channel; +import io.grpc.ClientCall; +import io.grpc.ClientInterceptor; +import io.grpc.ForwardingClientCall; +import io.grpc.MethodDescriptor; +import java.util.ArrayList; +import java.util.List; +import java.util.Set; +import java.util.UUID; +import java.util.concurrent.ExecutionException; +import java.util.concurrent.TimeUnit; +import java.util.function.Consumer; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.threeten.bp.Duration; + +class ITAutoPopulatedFields { + + private static class HttpJsonInterceptor implements HttpJsonClientInterceptor { + private Consumer onRequestIntercepted; + + private HttpJsonInterceptor() {} + + private void setOnRequestIntercepted(Consumer onRequestIntercepted) { + this.onRequestIntercepted = onRequestIntercepted; + } + + @Override + public HttpJsonClientCall interceptCall( + ApiMethodDescriptor method, + HttpJsonCallOptions callOptions, + HttpJsonChannel next) { + HttpJsonClientCall call = next.newCall(method, callOptions); + + return new ForwardingHttpJsonClientCall.SimpleForwardingHttpJsonClientCall( + call) { + @Override + public void sendMessage(ReqT message) { + // Capture the request message + if (onRequestIntercepted != null) { + onRequestIntercepted.accept(message); + } + super.sendMessage(message); + } + }; + } + } + + // Implement a request interceptor to retrieve the request ID being sent on the request. + private static class GRPCInterceptor implements ClientInterceptor { + private Consumer onRequestIntercepted; + + private GRPCInterceptor() {} + + private void setOnRequestIntercepted(Consumer onRequestIntercepted) { + this.onRequestIntercepted = onRequestIntercepted; + } + + @Override + public ClientCall interceptCall( + MethodDescriptor method, CallOptions callOptions, Channel next) { + + return new ForwardingClientCall.SimpleForwardingClientCall( + next.newCall(method, callOptions)) { + @Override + public void sendMessage(ReqT message) { + // Capture the request message + if (onRequestIntercepted != null) { + onRequestIntercepted.accept(message); + } + super.sendMessage(message); + } + }; + } + } + + private GRPCInterceptor grpcRequestInterceptor; + private HttpJsonInterceptor httpJsonInterceptor; + private EchoClient grpcClientWithoutRetries; + private EchoClient grpcClientWithRetries; + + private EchoClient httpJsonClient; + private EchoClient httpJsonClientWithRetries; + + @BeforeEach + void createClients() throws Exception { + RetrySettings defaultRetrySettings = + RetrySettings.newBuilder() + .setInitialRpcTimeout(Duration.ofMillis(5000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ofMillis(5000L)) + .setTotalTimeout(Duration.ofMillis(5000L)) + // Cap retries at 5 + .setMaxAttempts(5) + .build(); + + // Adding `Code.INTERNAL` is necessary because for httpJson requests, the httpJson status code + // is mapped here: + // https://github.com/googleapis/sdk-platform-java/blob/acdde47445916dd306ce8b91489fab45c9c2ef50/gax-java/gax-httpjson/src/main/java/com/google/api/gax/httpjson/HttpJsonStatusCode.java#L96-L133 + // Therefore, just setting the error code to `Code.UNKNOWN` for httpJson will get translated + // instead to `Code.INTERNAL`. + Set retryableCodes = ImmutableSet.of(Code.UNKNOWN, Code.INTERNAL); + + // Create gRPC Interceptor and Client + grpcRequestInterceptor = new ITAutoPopulatedFields.GRPCInterceptor(); + grpcClientWithoutRetries = + TestClientInitializer.createGrpcEchoClient(ImmutableList.of(grpcRequestInterceptor)); + grpcClientWithRetries = + TestClientInitializer.createGrpcEchoClientWithRetrySettings( + defaultRetrySettings, retryableCodes, ImmutableList.of(grpcRequestInterceptor)); + + // Create HttpJson Interceptor and Client + httpJsonInterceptor = new ITAutoPopulatedFields.HttpJsonInterceptor(); + httpJsonClient = + TestClientInitializer.createHttpJsonEchoClient(ImmutableList.of(httpJsonInterceptor)); + httpJsonClientWithRetries = + TestClientInitializer.createHttpJsonEchoClientWithRetrySettings( + defaultRetrySettings, retryableCodes, ImmutableList.of(httpJsonInterceptor)); + } + + @AfterEach + void destroyClient() throws InterruptedException { + grpcClientWithoutRetries.close(); + grpcClientWithRetries.close(); + httpJsonClient.close(); + + grpcClientWithoutRetries.awaitTermination( + TestClientInitializer.AWAIT_TERMINATION_SECONDS, TimeUnit.SECONDS); + grpcClientWithRetries.awaitTermination( + TestClientInitializer.AWAIT_TERMINATION_SECONDS, TimeUnit.SECONDS); + httpJsonClient.awaitTermination( + TestClientInitializer.AWAIT_TERMINATION_SECONDS, TimeUnit.SECONDS); + } + + @Test + void testGrpc_autoPopulateRequestIdWhenAttemptedOnceSuccessfully() { + List capturedRequestIds = new ArrayList<>(); + grpcRequestInterceptor.setOnRequestIntercepted( + request -> { + if (request instanceof EchoRequest) { + EchoRequest echoRequest = (EchoRequest) request; + capturedRequestIds.add(echoRequest.getRequestId()); + } + }); + grpcClientWithoutRetries.echo(EchoRequest.newBuilder().build()); + Truth.assertThat(capturedRequestIds).isNotEmpty(); + // Autopopulation of UUID is currently only configured for format UUID4. + Integer UUIDVersion = 4; + Truth.assertThat(UUID.fromString(capturedRequestIds.get(0)).version()).isEqualTo(UUIDVersion); + } + + @Test + void testGrpc_shouldNotAutoPopulateRequestIdIfSetInRequest() { + List capturedRequestIds = new ArrayList<>(); + grpcRequestInterceptor.setOnRequestIntercepted( + request -> { + if (request instanceof EchoRequest) { + EchoRequest echoRequest = (EchoRequest) request; + capturedRequestIds.add(echoRequest.getRequestId()); + } + }); + String UUIDsent = UUID.randomUUID().toString(); + grpcClientWithoutRetries.echo(EchoRequest.newBuilder().setRequestId(UUIDsent).build()); + Truth.assertThat(capturedRequestIds).isNotEmpty(); + Truth.assertThat(capturedRequestIds).contains(UUIDsent); + } + + @Test + void testHttpJson_autoPopulateRequestIdWhenAttemptedOnceSuccessfully() { + List capturedRequestIds = new ArrayList<>(); + httpJsonInterceptor.setOnRequestIntercepted( + request -> { + if (request instanceof EchoRequest) { + EchoRequest echoRequest = (EchoRequest) request; + capturedRequestIds.add(echoRequest.getRequestId()); + } + }); + httpJsonClient.echo(EchoRequest.newBuilder().build()); + Truth.assertThat(capturedRequestIds).isNotEmpty(); + // Autopopulation of UUID is currently only configured for format UUID4. + Integer UUIDVersion = 4; + Truth.assertThat(UUID.fromString(capturedRequestIds.get(0)).version()).isEqualTo(UUIDVersion); + } + + @Test + void testHttpJson_shouldNotAutoPopulateRequestIdIfSetInRequest() { + String UUIDsent = UUID.randomUUID().toString(); + List capturedRequestIds = new ArrayList<>(); + httpJsonInterceptor.setOnRequestIntercepted( + request -> { + if (request instanceof EchoRequest) { + EchoRequest echoRequest = (EchoRequest) request; + capturedRequestIds.add(echoRequest.getRequestId()); + } + }); + httpJsonClient.echo(EchoRequest.newBuilder().setRequestId(UUIDsent).build()); + Truth.assertThat(capturedRequestIds).isNotEmpty(); + Truth.assertThat(capturedRequestIds).contains(UUIDsent); + } + + @Test + void testGRPC_setsSameRequestIdIfSetInRequestWhenRequestsAreRetried() throws Exception { + List capturedRequestIds = new ArrayList<>(); + grpcRequestInterceptor.setOnRequestIntercepted( + request -> { + if (request instanceof EchoRequest) { + EchoRequest echoRequest = (EchoRequest) request; + capturedRequestIds.add(echoRequest.getRequestId()); + } + }); + String UUIDsent = UUID.randomUUID().toString(); + EchoRequest requestSent = + EchoRequest.newBuilder() + .setRequestId(UUIDsent) + .setError(Status.newBuilder().setCode(Code.UNKNOWN.ordinal()).build()) + .build(); + + try { + RetryingFuture retryingFuture = + (RetryingFuture) + grpcClientWithRetries.echoCallable().futureCall(requestSent); + assertThrows(ExecutionException.class, () -> retryingFuture.get(10, TimeUnit.SECONDS)); + // assert that the number of request IDs is equal to the max attempt + Truth.assertThat(capturedRequestIds).hasSize(5); + // assert that each request ID sent is the same as the UUIDSent + Truth.assertThat(capturedRequestIds) + .containsExactly(UUIDsent, UUIDsent, UUIDsent, UUIDsent, UUIDsent); + } finally { + grpcClientWithRetries.close(); + grpcClientWithRetries.awaitTermination( + TestClientInitializer.AWAIT_TERMINATION_SECONDS, TimeUnit.SECONDS); + } + } + + @Test + void testGRPC_setsSameAutoPopulatedRequestIdWhenRequestsAreRetried() throws Exception { + List capturedRequestIds = new ArrayList<>(); + grpcRequestInterceptor.setOnRequestIntercepted( + request -> { + if (request instanceof EchoRequest) { + EchoRequest echoRequest = (EchoRequest) request; + capturedRequestIds.add(echoRequest.getRequestId()); + } + }); + + EchoRequest requestSent = + EchoRequest.newBuilder() + .setError(Status.newBuilder().setCode(Code.UNKNOWN.ordinal()).build()) + .build(); + + try { + RetryingFuture retryingFuture = + (RetryingFuture) + grpcClientWithRetries.echoCallable().futureCall(requestSent); + assertThrows(ExecutionException.class, () -> retryingFuture.get(10, TimeUnit.SECONDS)); + // assert that the number of request IDs is equal to the max attempt + Truth.assertThat(capturedRequestIds).hasSize(5); + // assert that each request ID sent is the same + Truth.assertThat(capturedRequestIds) + .containsExactly( + capturedRequestIds.get(0), + capturedRequestIds.get(0), + capturedRequestIds.get(0), + capturedRequestIds.get(0), + capturedRequestIds.get(0)); + } finally { + grpcClientWithRetries.close(); + grpcClientWithRetries.awaitTermination( + TestClientInitializer.AWAIT_TERMINATION_SECONDS, TimeUnit.SECONDS); + } + } + + @Test + void testHttpJson_setsSameRequestIdIfSetInRequestWhenRequestsAreRetried() throws Exception { + List capturedRequestIds = new ArrayList<>(); + httpJsonInterceptor.setOnRequestIntercepted( + request -> { + if (request instanceof EchoRequest) { + EchoRequest echoRequest = (EchoRequest) request; + capturedRequestIds.add(echoRequest.getRequestId()); + } + }); + String UUIDsent = UUID.randomUUID().toString(); + EchoRequest requestSent = + EchoRequest.newBuilder() + .setRequestId(UUIDsent) + .setError(Status.newBuilder().setCode(Code.UNKNOWN.getHttpStatusCode()).build()) + .build(); + try { + RetryingFuture retryingFuture = + (RetryingFuture) + httpJsonClientWithRetries.echoCallable().futureCall(requestSent); + assertThrows(ExecutionException.class, () -> retryingFuture.get(10, TimeUnit.SECONDS)); + // assert that the number of request IDs is equal to the max attempt + Truth.assertThat(capturedRequestIds).hasSize(5); + // assert that each request ID sent is the same as the UUIDSent + Truth.assertThat(capturedRequestIds) + .containsExactly(UUIDsent, UUIDsent, UUIDsent, UUIDsent, UUIDsent); + } finally { + httpJsonClientWithRetries.close(); + httpJsonClientWithRetries.awaitTermination( + TestClientInitializer.AWAIT_TERMINATION_SECONDS, TimeUnit.SECONDS); + } + } + + @Test + void testHttpJson_setsSameAutoPopulatedRequestIdWhenRequestsAreRetried() throws Exception { + List capturedRequestIds = new ArrayList<>(); + httpJsonInterceptor.setOnRequestIntercepted( + request -> { + if (request instanceof EchoRequest) { + EchoRequest echoRequest = (EchoRequest) request; + capturedRequestIds.add(echoRequest.getRequestId()); + } + }); + EchoRequest requestSent = + EchoRequest.newBuilder() + .setError(Status.newBuilder().setCode(Code.UNKNOWN.getHttpStatusCode()).build()) + .build(); + try { + RetryingFuture retryingFuture = + (RetryingFuture) + httpJsonClientWithRetries.echoCallable().futureCall(requestSent); + assertThrows(ExecutionException.class, () -> retryingFuture.get(10, TimeUnit.SECONDS)); + // assert that the number of request IDs is equal to the max attempt + Truth.assertThat(capturedRequestIds).hasSize(5); + // assert that each request ID sent is the same + Truth.assertThat(capturedRequestIds) + .containsExactly( + capturedRequestIds.get(0), + capturedRequestIds.get(0), + capturedRequestIds.get(0), + capturedRequestIds.get(0), + capturedRequestIds.get(0)); + } finally { + httpJsonClientWithRetries.close(); + httpJsonClientWithRetries.awaitTermination( + TestClientInitializer.AWAIT_TERMINATION_SECONDS, TimeUnit.SECONDS); + } + } +} diff --git a/java-showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/ITBidiStreaming.java b/java-showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/ITBidiStreaming.java new file mode 100644 index 0000000000..72b8f1b0de --- /dev/null +++ b/java-showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/ITBidiStreaming.java @@ -0,0 +1,107 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.it; + +import static com.google.common.truth.Truth.assertThat; + +import com.google.api.core.SettableApiFuture; +import com.google.api.gax.rpc.ClientStream; +import com.google.api.gax.rpc.ResponseObserver; +import com.google.api.gax.rpc.StreamController; +import com.google.showcase.v1beta1.EchoClient; +import com.google.showcase.v1beta1.EchoRequest; +import com.google.showcase.v1beta1.EchoResponse; +import com.google.showcase.v1beta1.it.util.TestClientInitializer; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.util.concurrent.TimeUnit; +import org.junit.jupiter.api.AfterAll; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Test; + +class ITBidiStreaming { + + private static EchoClient grpcClient; + + @BeforeAll + static void createClients() throws Exception { + // Create gRPC Echo Client + grpcClient = TestClientInitializer.createGrpcEchoClient(); + } + + @AfterAll + static void destroyClients() throws Exception { + grpcClient.close(); + grpcClient.awaitTermination(TestClientInitializer.AWAIT_TERMINATION_SECONDS, TimeUnit.SECONDS); + } + + // The current implementation of BIDI streaming on Echo showcase server is that it would echo the + // request content back on every request, so this test verifies that the response content is + // exactly the same as request content. + // Ideally we should make the BIDI streaming server more generic, e.g. only respond when there are + // three requests, respond twice for every request etc. If that happens, the response content may + // not be exactly the same as request content. + @Test + void testGrpc_splitCall_shouldListensToResponse() throws Exception { + // given + List expected = Arrays.asList("The rain in Spain stays mainly on the plain".split(" ")); + TestResponseObserver responseObserver = new TestResponseObserver(); + + // when + ClientStream clientStream = grpcClient.chatCallable().splitCall(responseObserver); + expected.forEach( + requestContent -> { + EchoRequest request = EchoRequest.newBuilder().setContent(requestContent).build(); + clientStream.send(request); + }); + clientStream.closeSend(); + + // then + List actual = responseObserver.getFuture().get(); + assertThat(actual).containsExactlyElementsIn(expected).inOrder(); + } + + private static class TestResponseObserver implements ResponseObserver { + private final List responses = new ArrayList<>(); + private final SettableApiFuture> future = SettableApiFuture.create(); + + @Override + public void onStart(StreamController controller) { + // no-op + } + + @Override + public void onResponse(EchoResponse response) { + responses.add(response.getContent()); + } + + @Override + public void onError(Throwable t) { + // no-op + } + + @Override + public void onComplete() { + future.set(responses); + } + + public SettableApiFuture> getFuture() { + return future; + } + } +} diff --git a/java-showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/ITClientShutdown.java b/java-showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/ITClientShutdown.java new file mode 100644 index 0000000000..e55ee8d1ed --- /dev/null +++ b/java-showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/ITClientShutdown.java @@ -0,0 +1,163 @@ +/* + * 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 + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.showcase.v1beta1.it; + +import com.google.api.gax.retrying.RetrySettings; +import com.google.api.gax.rpc.StatusCode; +import com.google.common.collect.ImmutableSet; +import com.google.common.truth.Truth; +import com.google.showcase.v1beta1.BlockRequest; +import com.google.showcase.v1beta1.BlockResponse; +import com.google.showcase.v1beta1.EchoClient; +import com.google.showcase.v1beta1.EchoRequest; +import com.google.showcase.v1beta1.it.util.TestClientInitializer; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.Timeout; +import org.threeten.bp.Duration; + +class ITClientShutdown { + + private static final long DEFAULT_RPC_TIMEOUT_MS = 15000L; + private static final long DEFAULT_CLIENT_TERMINATION_MS = 5000L; + + // Test to ensure the client can close + terminate properly + @Test + @Timeout(15) + void testGrpc_closeClient() throws Exception { + EchoClient grpcClient = TestClientInitializer.createGrpcEchoClient(); + assertClientTerminated(grpcClient); + } + + // Test to ensure the client can close + terminate properly + @Test + @Timeout(15) + void testHttpJson_closeClient() throws Exception { + EchoClient httpjsonClient = TestClientInitializer.createHttpJsonEchoClient(); + assertClientTerminated(httpjsonClient); + } + + // Test to ensure the client can close + terminate after a quick RPC invocation + @Test + @Timeout(15) + void testGrpc_rpcInvoked_closeClient() throws Exception { + EchoClient grpcClient = TestClientInitializer.createGrpcEchoClient(); + // Response is ignored for this test + grpcClient.echo(EchoRequest.newBuilder().setContent("Test").build()); + assertClientTerminated(grpcClient); + } + + // Test to ensure the client can close + terminate after a quick RPC invocation + @Test + @Timeout(15) + void testHttpJson_rpcInvoked_closeClient() throws Exception { + EchoClient httpjsonClient = TestClientInitializer.createHttpJsonEchoClient(); + // Response is ignored for this test + httpjsonClient.echo(EchoRequest.newBuilder().setContent("Test").build()); + assertClientTerminated(httpjsonClient); + } + + // This test is to ensure that the client is able to close + terminate any resources + // once a response has been received. Set a max test duration of 15s to ensure that + // the test does not continue on forever. + @Test + @Timeout(15) + void testGrpc_rpcInvokedWithLargeTimeout_closeClientOnceResponseReceived() throws Exception { + // Set the maxAttempts to 1 to ensure there are no retries scheduled. The single RPC + // invocation should time out in 15s, but the client will receive a response in 2s. + // Any outstanding tasks (timeout tasks) should be cancelled once a response has been + // received so the client can properly terminate. + RetrySettings defaultRetrySettings = + RetrySettings.newBuilder() + .setInitialRpcTimeout(Duration.ofMillis(DEFAULT_RPC_TIMEOUT_MS)) + .setMaxRpcTimeout(Duration.ofMillis(DEFAULT_RPC_TIMEOUT_MS)) + .setTotalTimeout(Duration.ofMillis(DEFAULT_RPC_TIMEOUT_MS)) + .setMaxAttempts(1) + .build(); + EchoClient grpcClient = + TestClientInitializer.createGrpcEchoClientCustomBlockSettings( + defaultRetrySettings, ImmutableSet.of(StatusCode.Code.DEADLINE_EXCEEDED)); + + BlockRequest blockRequest = + BlockRequest.newBuilder() + .setSuccess(BlockResponse.newBuilder().setContent("gRPCBlockContent_2sDelay")) + .setResponseDelay(com.google.protobuf.Duration.newBuilder().setSeconds(2).build()) + .build(); + + // Response is ignored for this test + grpcClient.block(blockRequest); + + assertClientTerminated(grpcClient); + } + + // This test is to ensure that the client is able to close + terminate any resources + // once a response has been received. Set a max test duration of 15s to ensure that + // the test does not continue on forever. + @Test + @Timeout(15) + void testHttpJson_rpcInvokedWithLargeTimeout_closeClientOnceResponseReceived() throws Exception { + // Set the maxAttempts to 1 to ensure there are no retries scheduled. The single RPC + // invocation should time out in 15s, but the client will receive a response in 2s. + // Any outstanding tasks (timeout tasks) should be cancelled once a response has been + // received so the client can properly terminate. + RetrySettings defaultRetrySettings = + RetrySettings.newBuilder() + .setInitialRpcTimeout(Duration.ofMillis(DEFAULT_RPC_TIMEOUT_MS)) + .setMaxRpcTimeout(Duration.ofMillis(DEFAULT_RPC_TIMEOUT_MS)) + .setTotalTimeout(Duration.ofMillis(DEFAULT_RPC_TIMEOUT_MS)) + .setMaxAttempts(1) + .build(); + EchoClient httpjsonClient = + TestClientInitializer.createHttpJsonEchoClientCustomBlockSettings( + defaultRetrySettings, ImmutableSet.of(StatusCode.Code.DEADLINE_EXCEEDED)); + + BlockRequest blockRequest = + BlockRequest.newBuilder() + .setSuccess(BlockResponse.newBuilder().setContent("httpjsonBlockContent_2sDelay")) + .setResponseDelay(com.google.protobuf.Duration.newBuilder().setSeconds(2).build()) + .build(); + + // Response is ignored for this test + httpjsonClient.block(blockRequest); + + assertClientTerminated(httpjsonClient); + } + + // This helper method asserts that the client is able to terminate within + // `AWAIT_TERMINATION_SECONDS` + private void assertClientTerminated(EchoClient echoClient) throws InterruptedException { + long start = System.currentTimeMillis(); + // Intentionally do not run echoClient.awaitTermination(...) as this test will + // check that everything is properly terminated after close() is called. + echoClient.close(); + + // Loop until the client has terminated successfully. For tests that use this, + // try to ensure there is a timeout associated, otherwise this may run forever. + // Future enhancement: Use awaitility instead of busy waiting + while (!echoClient.isTerminated()) { + Thread.sleep(500L); + } + // The busy-wait time won't be accurate, so account for a bit of buffer + long end = System.currentTimeMillis(); + + Truth.assertThat(echoClient.isShutdown()).isTrue(); + + // Check the termination time. If all the tasks/ resources are closed successfully, + // the termination time should only occur shortly after `close()` was invoked. The + // `DEFAULT_TERMINATION_MS` value should include a bit of buffer. + long terminationTime = end - start; + Truth.assertThat(terminationTime).isLessThan(DEFAULT_CLIENT_TERMINATION_MS); + } +} diff --git a/java-showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/ITClientSideStreaming.java b/java-showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/ITClientSideStreaming.java new file mode 100644 index 0000000000..61b507f49a --- /dev/null +++ b/java-showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/ITClientSideStreaming.java @@ -0,0 +1,123 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.it; + +import static com.google.common.truth.Truth.assertThat; +import static org.junit.jupiter.api.Assertions.assertThrows; + +import com.google.api.core.SettableApiFuture; +import com.google.api.gax.rpc.ApiStreamObserver; +import com.google.api.gax.rpc.CancelledException; +import com.google.api.gax.rpc.StatusCode; +import com.google.rpc.Status; +import com.google.showcase.v1beta1.EchoClient; +import com.google.showcase.v1beta1.EchoRequest; +import com.google.showcase.v1beta1.EchoResponse; +import com.google.showcase.v1beta1.it.util.TestClientInitializer; +import java.util.ArrayList; +import java.util.List; +import java.util.concurrent.ExecutionException; +import java.util.concurrent.TimeUnit; +import org.junit.jupiter.api.AfterAll; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Test; + +class ITClientSideStreaming { + + private static EchoClient grpcClient; + + @BeforeAll + static void createClients() throws Exception { + // Create gRPC Echo Client + grpcClient = TestClientInitializer.createGrpcEchoClient(); + } + + @AfterAll + static void destroyClients() throws InterruptedException { + grpcClient.close(); + grpcClient.awaitTermination(TestClientInitializer.AWAIT_TERMINATION_SECONDS, TimeUnit.SECONDS); + } + + @Test + void testGrpc_sendStreamedContent_receiveConcatenatedResponse() + throws ExecutionException, InterruptedException { + CollectStreamObserver responseObserver = new CollectStreamObserver<>(); + ApiStreamObserver requestObserver = + grpcClient.collectCallable().clientStreamingCall(responseObserver); + String content = "The rain in Spain stays mainly on the plain"; + for (String message : content.split("\\s")) { + requestObserver.onNext(EchoRequest.newBuilder().setContent(message).build()); + } + requestObserver.onCompleted(); + + List serverResponse = responseObserver.future().get(); + assertThat(serverResponse).hasSize(1); + assertThat(serverResponse.get(0).getContent()) + .isEqualTo("The rain in Spain stays mainly on the plain"); + } + + @Test + void testGrpc_sendStreamedContent_handleServerError() { + CollectStreamObserver responseObserver = new CollectStreamObserver<>(); + ApiStreamObserver requestObserver = + grpcClient.collectCallable().clientStreamingCall(responseObserver); + String content = "The rain in Spain stays mainly on the plain"; + for (String message : content.split("\\s")) { + requestObserver.onNext(EchoRequest.newBuilder().setContent(message).build()); + } + Status cancelledStatus = + Status.newBuilder().setCode(StatusCode.Code.CANCELLED.ordinal()).build(); + requestObserver.onNext(EchoRequest.newBuilder().setError(cancelledStatus).build()); + requestObserver.onCompleted(); + + ExecutionException exception = + assertThrows(ExecutionException.class, () -> responseObserver.future().get()); + assertThat(exception.getCause()).isInstanceOf(CancelledException.class); + CancelledException cancelledException = (CancelledException) exception.getCause(); + assertThat(cancelledException.getStatusCode().getCode()).isEqualTo(StatusCode.Code.CANCELLED); + } + + /** + * Implementation of {@link ApiStreamObserver} to accumulate streamed content. + * + * @param + */ + private class CollectStreamObserver implements ApiStreamObserver { + + private final SettableApiFuture> future = SettableApiFuture.create(); + private final List messages = new ArrayList<>(); + + @Override + public void onNext(T message) { + this.messages.add(message); + } + + @Override + public void onError(Throwable throwable) { + this.future.setException(throwable); + } + + @Override + public void onCompleted() { + future.set(this.messages); + } + + public SettableApiFuture> future() { + return this.future; + } + } +} diff --git a/java-showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/ITCommonServiceMixins.java b/java-showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/ITCommonServiceMixins.java new file mode 100644 index 0000000000..a64f95a258 --- /dev/null +++ b/java-showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/ITCommonServiceMixins.java @@ -0,0 +1,133 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.it; + +import static com.google.common.truth.Truth.assertThat; + +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.Location; +import com.google.common.collect.ImmutableList; +import com.google.showcase.v1beta1.EchoClient; +import com.google.showcase.v1beta1.it.util.TestClientInitializer; +import java.util.ArrayList; +import java.util.List; +import java.util.concurrent.TimeUnit; +import org.junit.jupiter.api.AfterAll; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Test; + +class ITCommonServiceMixins { + + // The showcase server always returns a fixed list of locations. See + // https://github.com/googleapis/gapic-showcase/blob/main/server/services/locations_service.go + private static final List EXPECTED_LOCATIONS = + ImmutableList.of( + Location.newBuilder() + .setName("projects/showcase/locations/us-north") + .setDisplayName("us-north") + .build(), + Location.newBuilder() + .setName("projects/showcase/locations/us-south") + .setDisplayName("us-south") + .build(), + Location.newBuilder() + .setName("projects/showcase/locations/us-east") + .setDisplayName("us-east") + .build(), + Location.newBuilder() + .setName("projects/showcase/locations/us-west") + .setDisplayName("us-west") + .build()); + private static EchoClient grpcClient; + private static EchoClient httpjsonClient; + + @BeforeAll + static void createClients() throws Exception { + // Create gRPC Echo Client + grpcClient = TestClientInitializer.createGrpcEchoClient(); + + // Create HttpJson Echo Client + httpjsonClient = TestClientInitializer.createHttpJsonEchoClient(); + } + + @AfterAll + static void destroyClients() throws InterruptedException { + grpcClient.close(); + httpjsonClient.close(); + + grpcClient.awaitTermination(TestClientInitializer.AWAIT_TERMINATION_SECONDS, TimeUnit.SECONDS); + httpjsonClient.awaitTermination( + TestClientInitializer.AWAIT_TERMINATION_SECONDS, TimeUnit.SECONDS); + } + + @Test + void testGrpc_getLocation() { + GetLocationRequest request = + GetLocationRequest.newBuilder().setName("projects/showcase/location/us-central1").build(); + Location location = grpcClient.getLocation(request); + assertThat(location) + .isEqualTo( + Location.newBuilder() + .setName("projects/showcase/location/us-central1") + .setDisplayName("us-central1") + .build()); + } + + @Test + void testGrpc_listLocations() { + ListLocationsRequest request = + ListLocationsRequest.newBuilder().setName("projects/showcase").build(); + EchoClient.ListLocationsPagedResponse locationsPagedResponse = + grpcClient.listLocations(request); + + List actualLocations = new ArrayList<>(); + for (Location location : locationsPagedResponse.iterateAll()) { + actualLocations.add(location); + } + + assertThat(actualLocations).containsExactlyElementsIn(EXPECTED_LOCATIONS).inOrder(); + } + + @Test + void testHttpJson_getLocation() { + GetLocationRequest request = + GetLocationRequest.newBuilder().setName("projects/showcase/locations/us-central1").build(); + Location location = httpjsonClient.getLocation(request); + assertThat(location) + .isEqualTo( + Location.newBuilder() + .setName("projects/showcase/locations/us-central1") + .setDisplayName("us-central1") + .build()); + } + + @Test + void testHttpJson_listLocations() { + ListLocationsRequest request = + ListLocationsRequest.newBuilder().setName("projects/showcase").build(); + EchoClient.ListLocationsPagedResponse locationsPagedResponse = + httpjsonClient.listLocations(request); + + List actualLocations = new ArrayList<>(); + for (Location location : locationsPagedResponse.iterateAll()) { + actualLocations.add(location); + } + + assertThat(actualLocations).containsExactlyElementsIn(EXPECTED_LOCATIONS).inOrder(); + } +} diff --git a/java-showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/ITCrud.java b/java-showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/ITCrud.java new file mode 100644 index 0000000000..bfb9e335e5 --- /dev/null +++ b/java-showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/ITCrud.java @@ -0,0 +1,189 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.showcase.v1beta1.it; + +import static com.google.common.truth.Truth.assertThat; + +import com.google.common.collect.ImmutableList; +import com.google.protobuf.FieldMask; +import com.google.showcase.v1beta1.CreateUserRequest; +import com.google.showcase.v1beta1.DeleteUserRequest; +import com.google.showcase.v1beta1.IdentityClient; +import com.google.showcase.v1beta1.ListUsersRequest; +import com.google.showcase.v1beta1.ListUsersResponse; +import com.google.showcase.v1beta1.UpdateUserRequest; +import com.google.showcase.v1beta1.User; +import com.google.showcase.v1beta1.it.util.TestClientInitializer; +import java.util.Arrays; +import java.util.List; +import java.util.concurrent.TimeUnit; +import org.junit.jupiter.api.AfterAll; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; + +class ITCrud { + + private static final User DEFAULT_USER = + User.newBuilder() + .setDisplayName("Jane Doe") + .setEmail("janedoe@example.com") + .setNickname("Doe") + .setHeightFeet(5) + .setAge(25) + .build(); + + private static IdentityClient grpcClient; + private static IdentityClient httpjsonClient; + + @BeforeAll + public static void createClients() throws Exception { + // Create gRPC IdentityClient + grpcClient = TestClientInitializer.createGrpcIdentityClient(); + // Create HttpJson IdentityClient + httpjsonClient = TestClientInitializer.createHttpJsonIdentityClient(); + } + + @AfterAll + public static void destroyClients() throws InterruptedException { + grpcClient.close(); + httpjsonClient.close(); + + grpcClient.awaitTermination(TestClientInitializer.AWAIT_TERMINATION_SECONDS, TimeUnit.SECONDS); + httpjsonClient.awaitTermination( + TestClientInitializer.AWAIT_TERMINATION_SECONDS, TimeUnit.SECONDS); + } + + @BeforeEach + void cleanupData() { + IdentityClient.ListUsersPagedResponse pagedResponse = + grpcClient.listUsers(ListUsersRequest.newBuilder().setPageSize(5).build()); + for (IdentityClient.ListUsersPage listUsersPage : pagedResponse.iteratePages()) { + for (User user : listUsersPage.getResponse().getUsersList()) { + grpcClient.deleteUser(user.getName()); + } + } + pagedResponse = httpjsonClient.listUsers(ListUsersRequest.newBuilder().setPageSize(5).build()); + assertThat(pagedResponse.getPage().getResponse().getUsersList().size()).isEqualTo(0); + } + + @Test + void testHttpJson_Create() { + User userResponse = createDefaultUser(); + + // These properties should be the same + assertThat(userResponse.getDisplayName()).isEqualTo(DEFAULT_USER.getDisplayName()); + assertThat(userResponse.getEmail()).isEqualTo(DEFAULT_USER.getEmail()); + assertThat(userResponse.getNickname()).isEqualTo(DEFAULT_USER.getNickname()); + assertThat(userResponse.getHeightFeet()).isEqualTo(DEFAULT_USER.getHeightFeet()); + assertThat(userResponse.getAge()).isEqualTo(DEFAULT_USER.getAge()); + + // Assert that the server populates these fields + assertThat(userResponse.getName()).isNotEmpty(); + assertThat(userResponse.getCreateTime()).isNotNull(); + assertThat(userResponse.getUpdateTime()).isNotNull(); + assertThat(userResponse.getEnableNotifications()).isNotNull(); + } + + @Test + void testHttpJson_Read() { + List expectedUsersList = + ImmutableList.of( + createDefaultUser(), + createUser( + DEFAULT_USER.toBuilder() + .setNickname("John Smith") + .setEmail("johnsmith@example.com") + .build())); + // Assert that only one User exists + IdentityClient.ListUsersPagedResponse listUsersPagedResponse = + httpjsonClient.listUsers(ListUsersRequest.newBuilder().setPageSize(5).build()); + ListUsersResponse listUsersResponse = listUsersPagedResponse.getPage().getResponse(); + assertThat(listUsersResponse.getUsersList().size()).isEqualTo(2); + + // Check that the response from both List (pagination) and Get + // List Users + assertThat(listUsersResponse.getUsersList()).containsExactlyElementsIn(expectedUsersList); + + // Get User + User defaultUser = expectedUsersList.get(0); + User getUserResponse = httpjsonClient.getUser(defaultUser.getName()); + assertThat(getUserResponse).isEqualTo(defaultUser); + } + + @Test + void testHttpJson_Update() { + User userResponse = createDefaultUser(); + // Update multiple fields in the User. Age + Nickname are not included in the FieldMask + // userResponse's enableNotifications field is populated from the server + User updateUser = + userResponse.toBuilder() + .setAge(50) + .setNickname("Smith") + .setEmail("janedoe@jane.com") + .setHeightFeet(6.0) + .setEnableNotifications(true) + .build(); + User updateUserResponse = + httpjsonClient.updateUser( + UpdateUserRequest.newBuilder() + .setUser(updateUser) + .setUpdateMask( + FieldMask.newBuilder() + .addAllPaths(Arrays.asList("email", "height_feet", "enable_notifications")) + .build()) + .build()); + + // Assert that only the fields in the FieldMask are updated correctly + assertThat(updateUserResponse).isNotEqualTo(userResponse); + assertThat(updateUserResponse.getAge()).isEqualTo(userResponse.getAge()); + assertThat(updateUserResponse.getNickname()).isEqualTo(userResponse.getNickname()); + + assertThat(updateUserResponse.getEmail()).isEqualTo(updateUser.getEmail()); + assertThat(updateUserResponse.getHeightFeet()).isEqualTo(updateUser.getHeightFeet()); + assertThat(updateUserResponse.getEnableNotifications()) + .isEqualTo(updateUser.getEnableNotifications()); + } + + @Test + void testHttpJson_Delete() { + User userResponse = createDefaultUser(); + + httpjsonClient.deleteUser( + DeleteUserRequest.newBuilder().setName(userResponse.getName()).build()); + + IdentityClient.ListUsersPagedResponse listUsersPagedResponse = + httpjsonClient.listUsers(ListUsersRequest.newBuilder().setPageSize(5).build()); + assertThat(listUsersPagedResponse.getPage().getResponse().getUsersList().size()).isEqualTo(0); + } + + private User createDefaultUser() { + return createUser(DEFAULT_USER); + } + + /** + * Helper method to create a user with the DEFAULT_USER configs. Server returns a generated name + * (not username) that is used to identify the individual user and each test uses the name for the + * RPC. Server also populates a few additional fields (Create Time, Updated Time, and Enable + * Notifications). + * + * @param user User to be created + * @return newly created user + */ + private User createUser(User user) { + return httpjsonClient.createUser(CreateUserRequest.newBuilder().setUser(user).build()); + } +} diff --git a/java-showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/ITDynamicRoutingHeaders.java b/java-showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/ITDynamicRoutingHeaders.java new file mode 100644 index 0000000000..7828da8b53 --- /dev/null +++ b/java-showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/ITDynamicRoutingHeaders.java @@ -0,0 +1,400 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.showcase.v1beta1.it; + +import static com.google.api.gax.rpc.internal.Headers.DYNAMIC_ROUTING_HEADER_KEY; +import static com.google.common.truth.Truth.assertThat; + +import com.google.api.gax.httpjson.ApiMethodDescriptor; +import com.google.api.gax.httpjson.ForwardingHttpJsonClientCall; +import com.google.api.gax.httpjson.ForwardingHttpJsonClientCallListener; +import com.google.api.gax.httpjson.HttpJsonCallOptions; +import com.google.api.gax.httpjson.HttpJsonChannel; +import com.google.api.gax.httpjson.HttpJsonClientCall; +import com.google.api.gax.httpjson.HttpJsonClientInterceptor; +import com.google.api.gax.httpjson.HttpJsonMetadata; +import com.google.common.collect.ImmutableList; +import com.google.showcase.v1beta1.ComplianceClient; +import com.google.showcase.v1beta1.ComplianceData; +import com.google.showcase.v1beta1.EchoClient; +import com.google.showcase.v1beta1.EchoRequest; +import com.google.showcase.v1beta1.RepeatRequest; +import com.google.showcase.v1beta1.RepeatResponse; +import com.google.showcase.v1beta1.it.util.TestClientInitializer; +import io.grpc.CallOptions; +import io.grpc.Channel; +import io.grpc.ClientCall; +import io.grpc.ClientInterceptor; +import io.grpc.ForwardingClientCall; +import io.grpc.Metadata; +import io.grpc.MethodDescriptor; +import java.util.Arrays; +import java.util.List; +import java.util.concurrent.TimeUnit; +import java.util.stream.Collectors; +import org.junit.jupiter.api.AfterAll; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; + +class ITDynamicRoutingHeaders { + private static final String SPLIT_TOKEN = "&"; + private static final Metadata.Key REQUEST_PARAMS_HEADER_KEY = + Metadata.Key.of(DYNAMIC_ROUTING_HEADER_KEY, Metadata.ASCII_STRING_MARSHALLER); + + // Implement a request interceptor to retrieve the headers being sent on the request. + // The headers being set are part of the Metadata + private static class GrpcCapturingClientInterceptor implements ClientInterceptor { + private Metadata metadata; + + @Override + public ClientCall interceptCall( + MethodDescriptor method, final CallOptions callOptions, Channel next) { + ClientCall call = next.newCall(method, callOptions); + return new ForwardingClientCall.SimpleForwardingClientCall(call) { + @Override + public void start(ClientCall.Listener responseListener, Metadata headers) { + metadata = headers; + super.start(responseListener, headers); + } + }; + } + } + + // Implement a request interceptor to retrieve the headers being sent on the request + // The headers being set are part of the CallOptions + private static class HttpJsonCapturingClientInterceptor implements HttpJsonClientInterceptor { + private String requestParam; + + @Override + public HttpJsonClientCall interceptCall( + ApiMethodDescriptor method, + HttpJsonCallOptions callOptions, + HttpJsonChannel next) { + HttpJsonClientCall call = next.newCall(method, callOptions); + return new ForwardingHttpJsonClientCall.SimpleForwardingHttpJsonClientCall< + RequestT, ResponseT>(call) { + @Override + public void start(Listener responseListener, HttpJsonMetadata requestHeaders) { + Listener forwardingResponseListener = + new ForwardingHttpJsonClientCallListener.SimpleForwardingHttpJsonClientCallListener< + ResponseT>(responseListener) { + @Override + public void onHeaders(HttpJsonMetadata responseHeaders) { + super.onHeaders(responseHeaders); + } + + @Override + public void onMessage(ResponseT message) { + super.onMessage(message); + } + + @Override + public void onClose(int statusCode, HttpJsonMetadata trailers) { + super.onClose(statusCode, trailers); + } + }; + + super.start(forwardingResponseListener, requestHeaders); + if (requestHeaders.getHeaders().containsKey(DYNAMIC_ROUTING_HEADER_KEY)) { + requestParam = + String.valueOf(requestHeaders.getHeaders().get(DYNAMIC_ROUTING_HEADER_KEY)); + } + } + }; + } + } + + private static HttpJsonCapturingClientInterceptor httpJsonInterceptor; + private static HttpJsonCapturingClientInterceptor httpJsonComplianceInterceptor; + private static GrpcCapturingClientInterceptor grpcInterceptor; + private static GrpcCapturingClientInterceptor grpcComplianceInterceptor; + + private static EchoClient grpcClient; + private static EchoClient httpJsonClient; + private static ComplianceClient grpcComplianceClient; + private static ComplianceClient httpJsonComplianceClient; + + @BeforeAll + static void createClients() throws Exception { + // Create gRPC Interceptor and Client + grpcInterceptor = new GrpcCapturingClientInterceptor(); + grpcClient = TestClientInitializer.createGrpcEchoClient(ImmutableList.of(grpcInterceptor)); + + // Create gRPC ComplianceClient and Interceptor + // Creating a compliance client because echo client doesn't have an implicit enum routing test + // case + grpcComplianceInterceptor = new GrpcCapturingClientInterceptor(); + grpcComplianceClient = + TestClientInitializer.createGrpcComplianceClient( + ImmutableList.of(grpcComplianceInterceptor)); + + // Create HttpJson ComplianceClient and Interceptor + httpJsonComplianceInterceptor = new HttpJsonCapturingClientInterceptor(); + httpJsonComplianceClient = + TestClientInitializer.createHttpJsonComplianceClient( + ImmutableList.of(httpJsonComplianceInterceptor)); + + // Create HttpJson Interceptor and Client + httpJsonInterceptor = new HttpJsonCapturingClientInterceptor(); + httpJsonClient = + TestClientInitializer.createHttpJsonEchoClient(ImmutableList.of(httpJsonInterceptor)); + } + + @BeforeEach + void cleanUpParams() { + grpcInterceptor.metadata = null; + grpcComplianceInterceptor.metadata = null; + httpJsonInterceptor.requestParam = null; + httpJsonComplianceInterceptor.requestParam = null; + } + + @AfterAll + static void destroyClient() throws InterruptedException { + grpcClient.close(); + grpcComplianceClient.close(); + + httpJsonClient.close(); + httpJsonComplianceClient.close(); + + grpcClient.awaitTermination(TestClientInitializer.AWAIT_TERMINATION_SECONDS, TimeUnit.SECONDS); + grpcComplianceClient.awaitTermination( + TestClientInitializer.AWAIT_TERMINATION_SECONDS, TimeUnit.SECONDS); + + httpJsonClient.awaitTermination( + TestClientInitializer.AWAIT_TERMINATION_SECONDS, TimeUnit.SECONDS); + httpJsonComplianceClient.awaitTermination( + TestClientInitializer.AWAIT_TERMINATION_SECONDS, TimeUnit.SECONDS); + } + + @Test + void testGrpc_noRoutingHeaderUsed() { + grpcClient.echo(EchoRequest.newBuilder().build()); + String headerValue = grpcInterceptor.metadata.get(REQUEST_PARAMS_HEADER_KEY); + assertThat(headerValue).isNull(); + } + + @Test + void testHttpJson_noRoutingHeaderUsed() { + httpJsonClient.echo(EchoRequest.newBuilder().build()); + String headerValue = httpJsonInterceptor.requestParam; + assertThat(headerValue).isNull(); + } + + @Test + void testGrpc_emptyHeader() { + grpcClient.echo(EchoRequest.newBuilder().setHeader("").build()); + String headerValue = grpcInterceptor.metadata.get(REQUEST_PARAMS_HEADER_KEY); + assertThat(headerValue).isNull(); + } + + @Test + void testHttpJson_emptyHeader() { + httpJsonClient.echo(EchoRequest.newBuilder().setHeader("").build()); + String headerValue = httpJsonInterceptor.requestParam; + assertThat(headerValue).isNull(); + } + + @Test + void testGrpc_matchesHeaderName() { + grpcClient.echo(EchoRequest.newBuilder().setHeader("potato").build()); + String headerValue = grpcInterceptor.metadata.get(REQUEST_PARAMS_HEADER_KEY); + assertThat(headerValue).isNotNull(); + List requestHeaders = + Arrays.stream(headerValue.split(SPLIT_TOKEN)).collect(Collectors.toList()); + List expectedHeaders = ImmutableList.of("header=potato", "routing_id=potato"); + assertThat(requestHeaders).containsExactlyElementsIn(expectedHeaders); + } + + @Test + void testGrpc_implicitHeaders_enumsEncodedasInt() { + RepeatRequest request = + RepeatRequest.newBuilder().setInfo(ComplianceData.newBuilder().setFKingdomValue(5)).build(); + RepeatResponse actualResponse = grpcComplianceClient.repeatDataSimplePath(request); + String headerValue = grpcComplianceInterceptor.metadata.get(REQUEST_PARAMS_HEADER_KEY); + assertThat(headerValue).isNotNull(); + List requestHeaders = + Arrays.stream(headerValue.split(SPLIT_TOKEN)).collect(Collectors.toList()); + // fields beside "info.f_kingdom" are default values (false, 0.0, 0) since we are not setting + // them in the request message. + List expectedHeaders = + ImmutableList.of( + "info.f_bool=false", "info.f_double=0.0", "info.f_int32=0", "info.f_kingdom=5"); + assertThat(requestHeaders).containsExactlyElementsIn(expectedHeaders); + } + + @Test + void testHttpJson_implicitHeaders_enumsEncodedasInt() { + RepeatRequest request = + RepeatRequest.newBuilder() + .setInfo( + ComplianceData.newBuilder() + .setFString("test") + .setFInt32(1) + .setFDouble(2) + .setFBool(true) + .setFKingdomValue(3)) + .build(); + RepeatResponse actualResponse = httpJsonComplianceClient.repeatDataSimplePath(request); + String headerValue = httpJsonComplianceInterceptor.requestParam; + assertThat(headerValue).isNotNull(); + List requestHeaders = + Arrays.stream(headerValue.split(SPLIT_TOKEN)).collect(Collectors.toList()); + // In this case, we are setting the values explicitly. + List expectedHeaders = + ImmutableList.of( + "info.f_bool=true", + "info.f_double=2.0", + "info.f_int32=1", + "info.f_kingdom=3", + "info.f_string=test"); + assertThat(requestHeaders).containsExactlyElementsIn(expectedHeaders); + } + + @Test + void testHttpJson_matchesHeaderName() { + httpJsonClient.echo(EchoRequest.newBuilder().setHeader("potato").build()); + String headerValue = httpJsonInterceptor.requestParam; + assertThat(headerValue).isNotNull(); + List requestHeaders = + Arrays.stream(headerValue.split(SPLIT_TOKEN)).collect(Collectors.toList()); + List expectedHeaders = ImmutableList.of("header=potato", "routing_id=potato"); + assertThat(requestHeaders).containsExactlyElementsIn(expectedHeaders); + } + + @Test + void testGrpc_matchesOtherHeaderName() { + grpcClient.echo(EchoRequest.newBuilder().setOtherHeader("instances/456").build()); + String headerValue = grpcInterceptor.metadata.get(REQUEST_PARAMS_HEADER_KEY); + assertThat(headerValue).isNotNull(); + List requestHeaders = + Arrays.stream(headerValue.split(SPLIT_TOKEN)).collect(Collectors.toList()); + List expectedHeaders = ImmutableList.of("baz=instances%2F456"); + assertThat(requestHeaders).containsExactlyElementsIn(expectedHeaders); + } + + @Test + void testHttpJson_matchesOtherHeaderName() { + httpJsonClient.echo(EchoRequest.newBuilder().setOtherHeader("instances/456").build()); + String headerValue = httpJsonInterceptor.requestParam; + assertThat(headerValue).isNotNull(); + List requestHeaders = + Arrays.stream(headerValue.split(SPLIT_TOKEN)).collect(Collectors.toList()); + List expectedHeaders = ImmutableList.of("baz=instances%2F456"); + assertThat(requestHeaders).containsExactlyElementsIn(expectedHeaders); + } + + @Test + void testGrpc_matchesMultipleOfSameRoutingHeader_usesHeader() { + grpcClient.echo(EchoRequest.newBuilder().setHeader("projects/123/instances/456").build()); + String headerValue = grpcInterceptor.metadata.get(REQUEST_PARAMS_HEADER_KEY); + assertThat(headerValue).isNotNull(); + List requestHeaders = + Arrays.stream(headerValue.split(SPLIT_TOKEN)).collect(Collectors.toList()); + List expectedHeaders = + ImmutableList.of( + "header=projects%2F123%2Finstances%2F456", + "routing_id=projects%2F123%2Finstances%2F456", + "super_id=projects%2F123", + "table_name=projects%2F123%2Finstances%2F456", + "instance_id=instances%2F456"); + assertThat(requestHeaders).containsExactlyElementsIn(expectedHeaders); + } + + @Test + void testHttpJson_matchesMultipleOfSameRoutingHeader_usesHeader() { + httpJsonClient.echo(EchoRequest.newBuilder().setHeader("projects/123/instances/456").build()); + String headerValue = httpJsonInterceptor.requestParam; + assertThat(headerValue).isNotNull(); + List requestHeaders = + Arrays.stream(headerValue.split(SPLIT_TOKEN)).collect(Collectors.toList()); + List expectedHeaders = + ImmutableList.of( + "header=projects%2F123%2Finstances%2F456", + "routing_id=projects%2F123%2Finstances%2F456", + "super_id=projects%2F123", + "table_name=projects%2F123%2Finstances%2F456", + "instance_id=instances%2F456"); + assertThat(requestHeaders).containsExactlyElementsIn(expectedHeaders).inOrder(); + } + + @Test + void testGrpc_matchesMultipleOfSameRoutingHeader_usesOtherHeader() { + grpcClient.echo(EchoRequest.newBuilder().setOtherHeader("projects/123/instances/456").build()); + String headerValue = grpcInterceptor.metadata.get(REQUEST_PARAMS_HEADER_KEY); + assertThat(headerValue).isNotNull(); + List requestHeaders = + Arrays.stream(headerValue.split(SPLIT_TOKEN)).collect(Collectors.toList()); + List expectedHeaders = + ImmutableList.of("baz=projects%2F123%2Finstances%2F456", "qux=projects%2F123"); + assertThat(requestHeaders).containsExactlyElementsIn(expectedHeaders); + } + + @Test + void testHttpJson_matchesMultipleOfSameRoutingHeader_usesOtherHeader() { + httpJsonClient.echo( + EchoRequest.newBuilder().setOtherHeader("projects/123/instances/456").build()); + String headerValue = httpJsonInterceptor.requestParam; + assertThat(headerValue).isNotNull(); + List requestHeaders = + Arrays.stream(headerValue.split(SPLIT_TOKEN)).collect(Collectors.toList()); + List expectedHeaders = + ImmutableList.of("baz=projects%2F123%2Finstances%2F456", "qux=projects%2F123"); + assertThat(requestHeaders).containsExactlyElementsIn(expectedHeaders); + } + + @Test + void testGrpc_matchesMultipleRoutingHeaders() { + grpcClient.echo( + EchoRequest.newBuilder() + .setHeader("regions/123/zones/456") + .setOtherHeader("projects/123/instances/456") + .build()); + String headerValue = grpcInterceptor.metadata.get(REQUEST_PARAMS_HEADER_KEY); + assertThat(headerValue).isNotNull(); + List requestHeaders = + Arrays.stream(headerValue.split(SPLIT_TOKEN)).collect(Collectors.toList()); + List expectedHeaders = + ImmutableList.of( + "baz=projects%2F123%2Finstances%2F456", + "qux=projects%2F123", + "table_name=regions%2F123%2Fzones%2F456", + "header=regions%2F123%2Fzones%2F456", + "routing_id=regions%2F123%2Fzones%2F456"); + assertThat(requestHeaders).containsExactlyElementsIn(expectedHeaders); + } + + @Test + void testHttpJson_matchesMultipleRoutingHeaders() { + httpJsonClient.echo( + EchoRequest.newBuilder() + .setHeader("regions/123/zones/456") + .setOtherHeader("projects/123/instances/456") + .build()); + String headerValue = httpJsonInterceptor.requestParam; + assertThat(headerValue).isNotNull(); + List requestHeaders = + Arrays.stream(headerValue.split(SPLIT_TOKEN)).collect(Collectors.toList()); + List expectedHeaders = + ImmutableList.of( + "baz=projects%2F123%2Finstances%2F456", + "qux=projects%2F123", + "table_name=regions%2F123%2Fzones%2F456", + "header=regions%2F123%2Fzones%2F456", + "routing_id=regions%2F123%2Fzones%2F456"); + assertThat(requestHeaders).containsExactlyElementsIn(expectedHeaders); + } +} diff --git a/java-showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/ITEndpointContext.java b/java-showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/ITEndpointContext.java new file mode 100644 index 0000000000..0f50051b68 --- /dev/null +++ b/java-showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/ITEndpointContext.java @@ -0,0 +1,469 @@ +package com.google.showcase.v1beta1.it; + +import static org.junit.jupiter.api.Assertions.assertThrows; + +import com.google.api.gax.core.CredentialsProvider; +import com.google.api.gax.core.NoCredentialsProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.UnauthenticatedException; +import com.google.auth.Credentials; +import com.google.auth.oauth2.GoogleCredentials; +import com.google.common.truth.Truth; +import com.google.showcase.v1beta1.EchoClient; +import com.google.showcase.v1beta1.EchoRequest; +import com.google.showcase.v1beta1.EchoSettings; +import com.google.showcase.v1beta1.it.util.TestClientInitializer; +import com.google.showcase.v1beta1.stub.EchoStub; +import com.google.showcase.v1beta1.stub.EchoStubSettings; +import io.grpc.ManagedChannelBuilder; +import java.io.IOException; +import java.net.URI; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.concurrent.TimeUnit; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.Test; + +/** + * This IT tests the different user configurations allowed and their effects on endpoint and + * universe domain resolution. + * + *

        In these tests, the client is not initialized with the default configuration: + * `EchoClient.create()`. For showcase tests run in CI, the client must be supplied explicitly + * supplied with a Credentials value. The tests use a wrapped Credentials and Credentials Provider + * (UniverseDomainCredentials and UniverseDomainCredentialsProvider) which allow for testing this. + * + *

        Endpoint resolution has the same behavior for both gRPC and HttpJson. The showcase tests below + * only use the gRPC transport for testing. HttpJson functionality exists inside the wrapper + * classes, but is not being used. + */ +class ITEndpointContext { + /** + * Inside the test cases below, we must explicitly configure serviceName. Normally this should not + * be configured at all, but showcase clients do not have a serviceName. The ExtendStubSettings + * wrapper return the serviceName by overriding the `getServiceName()` result. + */ + private static class ExtendedEchoStubSettings extends EchoStubSettings { + + private static final String DUMMY_MTLS_ENDPOINT = "mtls.googleapis.com:443"; + + protected ExtendedEchoStubSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + } + + @Override + public String getServiceName() { + return "test"; + } + + public static ExtendedEchoStubSettings.Builder newBuilder() { + return ExtendedEchoStubSettings.Builder.createDefault(); + } + + public static ExtendedEchoStubSettings.Builder newHttpJsonBuilder() { + return ExtendedEchoStubSettings.Builder.createHttpJsonDefault(); + } + + public static class Builder extends EchoStubSettings.Builder { + + protected Builder(ClientContext clientContext) { + super(clientContext); + } + + private static ExtendedEchoStubSettings.Builder createDefault() { + Builder builder = new Builder(((ClientContext) null)); + builder.setTransportChannelProvider(defaultTransportChannelProvider()); + builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); + builder.setInternalHeaderProvider(defaultApiClientHeaderProviderBuilder().build()); + builder.setMtlsEndpoint(DUMMY_MTLS_ENDPOINT); + builder.setSwitchToMtlsEndpointAllowed(true); + return builder; + } + + private static ExtendedEchoStubSettings.Builder createHttpJsonDefault() { + Builder builder = new Builder(((ClientContext) null)); + builder.setTransportChannelProvider(defaultHttpJsonTransportProviderBuilder().build()); + builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); + builder.setInternalHeaderProvider(defaultApiClientHeaderProviderBuilder().build()); + builder.setMtlsEndpoint(DUMMY_MTLS_ENDPOINT); + builder.setSwitchToMtlsEndpointAllowed(true); + return builder; + } + + @Override + public ExtendedEchoStubSettings build() throws IOException { + return new ExtendedEchoStubSettings(this); + } + } + } + + /** + * Without this ClientSettings wrapper, we must expose a serviceName setter to + * (Client|Stub)Settings and pass the StubSettings to the client. However, this will result in a + * null ClientSettings (See {@link EchoClient#create(EchoStub)}). Passing the stub to the Client + * will result in a NPE when doing `Client.getSettings().get(Endpoint|UniverseDomain)` as the + * ClientSettings is stored as null. + */ + private static class ExtendedEchoSettings extends EchoSettings { + + protected ExtendedEchoSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + } + + public static EchoSettings.Builder newBuilder() { + return ExtendedEchoSettings.Builder.createDefault(); + } + + public static EchoSettings.Builder newHttpJsonBuilder() { + return ExtendedEchoSettings.Builder.createHttpJsonDefault(); + } + + public static class Builder extends EchoSettings.Builder { + protected Builder() throws IOException {} + + private static ExtendedEchoSettings.Builder createDefault() { + return new ExtendedEchoSettings.Builder(ExtendedEchoStubSettings.newBuilder()); + } + + private static ExtendedEchoSettings.Builder createHttpJsonDefault() { + return new ExtendedEchoSettings.Builder(ExtendedEchoStubSettings.newHttpJsonBuilder()); + } + + protected Builder(ClientContext clientContext) { + super(clientContext); + } + + protected Builder(EchoSettings settings) { + super(settings); + } + + protected Builder(ExtendedEchoStubSettings.Builder stubSettings) { + super(stubSettings); + } + } + } + + /** + * Credentials Wrapper for showcase testing which is used to override the Universe Domain value. + * + *

        For the tests below, it will act as a valid Credentials and is used to test the flows where + * the user passes in a Credentials (i.e. ServiceAccount, AccessToken, Oauth, etc.) + */ + private static class UniverseDomainCredentials extends Credentials { + + private final String universeDomain; + + private UniverseDomainCredentials(String universeDomain) { + this.universeDomain = universeDomain; + } + + @Override + public String getAuthenticationType() { + return null; + } + + @Override + public Map> getRequestMetadata(URI uri) { + return new HashMap<>(); + } + + @Override + public boolean hasRequestMetadata() { + return false; + } + + @Override + public boolean hasRequestMetadataOnly() { + return false; + } + + @Override + public void refresh() { + // no-op + } + + @Override + public String getUniverseDomain() { + return universeDomain; + } + } + + /** + * CredentialsProvider wrapper to return the wrapped Universe Domain Credentials. This will return + * the custom Universe Domain value. + */ + private static class UniverseDomainCredentialsProvider implements CredentialsProvider { + + private final String universeDomain; + + public UniverseDomainCredentialsProvider(String universeDomain) { + this.universeDomain = universeDomain; + } + + public static UniverseDomainCredentialsProvider create() { + return new UniverseDomainCredentialsProvider(GoogleCredentials.GOOGLE_DEFAULT_UNIVERSE); + } + + public static UniverseDomainCredentialsProvider create(String universeDomain) { + return new UniverseDomainCredentialsProvider(universeDomain); + } + + @Override + public Credentials getCredentials() { + return new UniverseDomainCredentials(universeDomain); + } + } + + private static final String DEFAULT_ENDPOINT = "test.googleapis.com:443"; + private static final EchoRequest DEFAULT_REQUEST = + EchoRequest.newBuilder().setContent("echo").build(); + + private EchoClient echoClient; + + @AfterEach + void cleanup() throws InterruptedException { + if (echoClient != null) { + echoClient.close(); + echoClient.awaitTermination( + TestClientInitializer.AWAIT_TERMINATION_SECONDS, TimeUnit.SECONDS); + } + } + + // Default (no configuration) + @Test + void endpointResolution_default() throws IOException { + EchoSettings echoSettings = + ExtendedEchoSettings.newBuilder() + .setCredentialsProvider(UniverseDomainCredentialsProvider.create()) + .build(); + echoClient = EchoClient.create(echoSettings); + Truth.assertThat(echoClient.getSettings().getEndpoint()).isEqualTo(DEFAULT_ENDPOINT); + Truth.assertThat(echoClient.getSettings().getUniverseDomain()) + .isEqualTo(GoogleCredentials.GOOGLE_DEFAULT_UNIVERSE); + } + + // User configuration + @Test + void endpointResolution_userSetEndpoint() throws IOException { + String customEndpoint = "test.com:123"; + EchoSettings echoSettings = + ExtendedEchoSettings.newBuilder() + .setCredentialsProvider(UniverseDomainCredentialsProvider.create()) + .setEndpoint(customEndpoint) + .build(); + echoClient = EchoClient.create(echoSettings); + Truth.assertThat(echoClient.getSettings().getEndpoint()).isEqualTo(customEndpoint); + Truth.assertThat(echoClient.getSettings().getUniverseDomain()) + .isEqualTo(GoogleCredentials.GOOGLE_DEFAULT_UNIVERSE); + } + + @Test + void endpointResolution_userSetUniverseDomainAndNoUserSetEndpoint() throws IOException { + String customUniverseDomain = "random.com"; + EchoSettings echoSettings = + ExtendedEchoSettings.newBuilder() + .setCredentialsProvider(UniverseDomainCredentialsProvider.create()) + .setUniverseDomain(customUniverseDomain) + .build(); + echoClient = EchoClient.create(echoSettings); + // If user configured the universe domain, the endpoint is constructed from it + Truth.assertThat(echoClient.getSettings().getEndpoint()).isEqualTo("test.random.com:443"); + Truth.assertThat(echoClient.getSettings().getUniverseDomain()).isEqualTo(customUniverseDomain); + } + + @Test + void endpointResolution_userSetEndpointAndUniverseDomain() throws IOException { + String customEndpoint = "custom.endpoint.com:443"; + String customUniverseDomain = "random.com"; + EchoSettings echoSettings = + ExtendedEchoSettings.newBuilder() + .setCredentialsProvider(UniverseDomainCredentialsProvider.create()) + .setEndpoint(customEndpoint) + .setUniverseDomain(customUniverseDomain) + .build(); + echoClient = EchoClient.create(echoSettings); + // Custom Endpoint sets the endpoint for the client to use + Truth.assertThat(echoClient.getSettings().getEndpoint()).isEqualTo(customEndpoint); + // The universe domain doesn't match the endpoint. The call will fail validation when RPC is + // called. + Truth.assertThat(echoClient.getSettings().getUniverseDomain()).isEqualTo(customUniverseDomain); + } + + @Test + void universeDomainValidation_credentialsGDU_noUserConfiguration() throws IOException { + EchoSettings echoSettings = + ExtendedEchoSettings.newBuilder() + .setCredentialsProvider(UniverseDomainCredentialsProvider.create()) + .setEndpoint(TestClientInitializer.DEFAULT_GRPC_ENDPOINT) + .setTransportChannelProvider( + EchoSettings.defaultGrpcTransportProviderBuilder() + .setChannelConfigurator(ManagedChannelBuilder::usePlaintext) + .build()) + .build(); + echoClient = EchoClient.create(echoSettings); + + // Does not throw an error + echoClient.echo(DEFAULT_REQUEST); + } + + @Test + void universeDomainValidation_credentialsNonGDU_noUserConfiguration() throws IOException { + EchoSettings echoSettings = + ExtendedEchoSettings.newBuilder() + .setCredentialsProvider(UniverseDomainCredentialsProvider.create("random.com")) + .setEndpoint(TestClientInitializer.DEFAULT_GRPC_ENDPOINT) + .setTransportChannelProvider( + EchoSettings.defaultGrpcTransportProviderBuilder() + .setChannelConfigurator(ManagedChannelBuilder::usePlaintext) + .build()) + .build(); + echoClient = EchoClient.create(echoSettings); + + UnauthenticatedException exception = + assertThrows(UnauthenticatedException.class, () -> echoClient.echo(DEFAULT_REQUEST)); + Truth.assertThat(exception.getMessage()) + .contains( + "The configured universe domain (googleapis.com) does not match the universe domain" + + " found in the credentials (random.com)."); + } + + @Test + void universeDomainValidation_credentialsNonGDUMatchesUserConfiguration() throws IOException { + String universeDomain = "random.com"; + EchoSettings echoSettings = + ExtendedEchoSettings.newBuilder() + .setCredentialsProvider(UniverseDomainCredentialsProvider.create(universeDomain)) + .setEndpoint(TestClientInitializer.DEFAULT_GRPC_ENDPOINT) + .setUniverseDomain(universeDomain) + .setTransportChannelProvider( + EchoSettings.defaultGrpcTransportProviderBuilder() + .setChannelConfigurator(ManagedChannelBuilder::usePlaintext) + .build()) + .build(); + echoClient = EchoClient.create(echoSettings); + + // Does not throw an error + echoClient.echo(DEFAULT_REQUEST); + } + + @Test + void universeDomainValidation_credentialsNonGDUDoesNotMatchUserConfiguration() + throws IOException { + String universeDomain = "random.com"; + String userConfigurationUniverseDomain = "test.com"; + EchoSettings echoSettings = + ExtendedEchoSettings.newBuilder() + .setCredentialsProvider(UniverseDomainCredentialsProvider.create(universeDomain)) + .setEndpoint(TestClientInitializer.DEFAULT_GRPC_ENDPOINT) + .setUniverseDomain(userConfigurationUniverseDomain) + .setTransportChannelProvider( + EchoSettings.defaultGrpcTransportProviderBuilder() + .setChannelConfigurator(ManagedChannelBuilder::usePlaintext) + .build()) + .build(); + echoClient = EchoClient.create(echoSettings); + + UnauthenticatedException exception = + assertThrows(UnauthenticatedException.class, () -> echoClient.echo(DEFAULT_REQUEST)); + Truth.assertThat(exception.getMessage()) + .contains( + "The configured universe domain (test.com) does not match the universe domain found in" + + " the credentials (random.com)."); + } + + // This test uses NoCredentialsProvider (will default to GDU) + @Test + void universeDomainValidation_noCredentials_noUserSetUniverseDomain() throws IOException { + EchoSettings echoSettings = + ExtendedEchoSettings.newBuilder() + .setCredentialsProvider(NoCredentialsProvider.create()) + .setEndpoint(TestClientInitializer.DEFAULT_GRPC_ENDPOINT) + .setTransportChannelProvider( + EchoSettings.defaultGrpcTransportProviderBuilder() + .setChannelConfigurator(ManagedChannelBuilder::usePlaintext) + .build()) + .build(); + echoClient = EchoClient.create(echoSettings); + + // Does not throw an error + echoClient.echo(DEFAULT_REQUEST); + } + + // This test uses NoCredentialsProvider (will default to GDU) + @Test + void universeDomainValidation_noCredentials_userSetUniverseDomain() throws IOException { + String universeDomain = "random.com"; + EchoSettings echoSettings = + ExtendedEchoSettings.newBuilder() + .setCredentialsProvider(NoCredentialsProvider.create()) + .setEndpoint(TestClientInitializer.DEFAULT_GRPC_ENDPOINT) + .setUniverseDomain(universeDomain) + .setTransportChannelProvider( + EchoSettings.defaultGrpcTransportProviderBuilder() + .setChannelConfigurator(ManagedChannelBuilder::usePlaintext) + .build()) + .build(); + echoClient = EchoClient.create(echoSettings); + + UnauthenticatedException exception = + assertThrows(UnauthenticatedException.class, () -> echoClient.echo(DEFAULT_REQUEST)); + Truth.assertThat(exception.getMessage()) + .contains( + "The configured universe domain (random.com) does not match the universe domain found" + + " in the credentials (googleapis.com)."); + } + + // Default in Builder (no configuration) + @Test + void endpointResolution_defaultViaBuilder() { + EchoSettings.Builder echoSettingsBuilder = EchoSettings.newBuilder(); + // `StubSettings.newBuilder()` will return the clientSettingsEndpoint + Truth.assertThat(echoSettingsBuilder.getEndpoint()).isEqualTo(null); + } + + // User configuration in Builder + @Test + void endpointResolution_userConfigurationViaBuilder() { + EchoSettings.Builder echoSettingsBuilder = + EchoSettings.newBuilder().setEndpoint("test.com:123"); + // `StubSettings.newBuilder()` will return the clientSettingsEndpoint + Truth.assertThat(echoSettingsBuilder.getEndpoint()).isEqualTo("test.com:123"); + } + + @Test + void endpointResolution_builderBuilderBackToBuilder() throws IOException { + String customEndpoint = "test.com:123"; + EchoStubSettings.Builder echoStubSettingsBuilder = + EchoStubSettings.newBuilder().setEndpoint(customEndpoint); + // `StubSettings.newBuilder()` will return the clientSettingsEndpoint + Truth.assertThat(echoStubSettingsBuilder.getEndpoint()).isEqualTo(customEndpoint); + + // EndpointContext is recomputed when the Builder is re-built + EchoStubSettings echoStubSettings = echoStubSettingsBuilder.build(); + Truth.assertThat(echoStubSettings.getEndpoint()).isEqualTo(customEndpoint); + + // Calling toBuilder on StubSettings keeps the configurations the same + echoStubSettingsBuilder = echoStubSettings.toBuilder(); + Truth.assertThat(echoStubSettingsBuilder.getEndpoint()).isEqualTo(customEndpoint); + } + + @Test + void universeDomainValidation_quotaProjectId_credentialsNonGDUMatchesUserConfiguration() + throws IOException { + String universeDomain = "random.com"; + EchoSettings echoSettings = + ExtendedEchoSettings.newBuilder() + .setQuotaProjectId("exampleProject") + .setCredentialsProvider(UniverseDomainCredentialsProvider.create(universeDomain)) + .setEndpoint(TestClientInitializer.DEFAULT_GRPC_ENDPOINT) + .setUniverseDomain(universeDomain) + .setTransportChannelProvider( + EchoSettings.defaultGrpcTransportProviderBuilder() + .setChannelConfigurator(ManagedChannelBuilder::usePlaintext) + .build()) + .build(); + echoClient = EchoClient.create(echoSettings); + Truth.assertThat(echoClient.echo(DEFAULT_REQUEST).getContent()).isEqualTo("echo"); + } +} diff --git a/java-showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/ITGdch.java b/java-showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/ITGdch.java new file mode 100644 index 0000000000..f043d45cfc --- /dev/null +++ b/java-showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/ITGdch.java @@ -0,0 +1,224 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.it; + +import static com.google.common.truth.Truth.assertThat; +import static com.google.common.truth.Truth.assertWithMessage; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotSame; +import static org.junit.jupiter.api.Assertions.assertThrows; +import static org.junit.jupiter.api.Assertions.assertTrue; + +import com.google.api.client.json.GenericJson; +import com.google.api.client.json.JsonFactory; +import com.google.api.client.json.gson.GsonFactory; +import com.google.api.gax.core.FixedCredentialsProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.auth.Credentials; +import com.google.auth.oauth2.GdchCredentials; +import com.google.auth.oauth2.GdchCredentialsTestUtil; +import com.google.showcase.v1beta1.EchoClient; +import com.google.showcase.v1beta1.EchoSettings; +import com.google.showcase.v1beta1.it.util.InterceptingMockTokenServerTransportFactory; +import com.google.showcase.v1beta1.it.util.TestClientInitializer; +import com.google.showcase.v1beta1.stub.EchoStubSettings; +import java.io.File; +import java.io.FileWriter; +import java.io.IOException; +import java.io.InputStream; +import java.net.URI; +import java.nio.file.Files; +import java.nio.file.Path; +import java.nio.file.StandardCopyOption; +import java.util.concurrent.TimeUnit; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.io.TempDir; + +/** + * Test suite to confirm a client can be instantiated with GDCH credentials. No calls are made since + * it is not feasible to test against real GDCH servers (or replicate an environment) + */ +class ITGdch { + + private static final String CA_CERT_FILENAME = "fake_cert.pem"; + private static final String CA_CERT_RESOURCE_PATH = "/" + CA_CERT_FILENAME; + private static final String CA_CERT_JSON_KEY = "ca_cert_path"; + private static final String GDCH_CREDENTIAL_FILENAME = "test_gdch_credential.json"; + private static final String GDCH_CREDENTIAL_RESOURCE_PATH = "/" + GDCH_CREDENTIAL_FILENAME; + private static final String GDCH_TOKEN_STRING = "1/MkSJoj1xsli0AccessToken_NKPY2"; + private static final String SID_NAME = "service-identity-name"; + + private EchoClient client; + private EchoSettings settings; + private EchoStubSettings stubSettings; + private Credentials initialCredentials; + private ClientContext context; + private InterceptingMockTokenServerTransportFactory transportFactory; + private String projectId; + private URI tokenUri; + + @BeforeEach + void setup(@TempDir Path tempDir) throws IOException { + transportFactory = new InterceptingMockTokenServerTransportFactory(); + prepareCredentials(tempDir); + settings = + EchoSettings.newBuilder() + .setCredentialsProvider(FixedCredentialsProvider.create(initialCredentials)) + .build(); + } + + @AfterEach + void tearDown() throws InterruptedException { + if (client != null) { + client.close(); + client.awaitTermination(TestClientInitializer.AWAIT_TERMINATION_SECONDS, TimeUnit.SECONDS); + } + } + + private void prepareCredentials(Path tempDir) throws IOException { + // Copy file so it can be referenced by Path even in native-image builds + File caCertFile = new File(tempDir.toFile(), CA_CERT_FILENAME); + try (InputStream inputStream = getClass().getResourceAsStream(CA_CERT_RESOURCE_PATH)) { + assertThat(inputStream).isNotNull(); + Files.copy(inputStream, caCertFile.toPath(), StandardCopyOption.REPLACE_EXISTING); + } + assertWithMessage(caCertFile.toPath() + " should exist").that(caCertFile.exists()).isTrue(); + + // open gdch credential json (still needs its "ca_cert_path" to point to the CA certificate + // obtained from above) + JsonFactory factory = new GsonFactory(); + GenericJson converted = + factory.fromInputStream( + getClass().getResourceAsStream(GDCH_CREDENTIAL_RESOURCE_PATH), GenericJson.class); + + // modify and save to a temporary folder + converted.set(CA_CERT_JSON_KEY, caCertFile.toPath().toAbsolutePath().toString()); + projectId = converted.get("project").toString(); + tokenUri = URI.create(converted.get("token_uri").toString()); + + File tempGdchCredentialFile = new File(tempDir.toFile(), GDCH_CREDENTIAL_FILENAME); + try (FileWriter fileWriter = new FileWriter(tempGdchCredentialFile)) { + String preparedJson = converted.toPrettyString(); + fileWriter.write(preparedJson); + } + + // use temp location to instantiate credentials + initialCredentials = GdchCredentialsTestUtil.fromJson(converted, transportFactory); + } + + /** + * {@link com.google.api.gax.rpc.ClientContext} will create a new {@link GdchCredentials} with an + * audience defaulted to the endpoint if the audience is not manually passed. This test confirms + * that a new credential is created from the context and can be refreshed + * + * @throws IOException + */ + @Test + void testCreateClient_withGdchCredentialAndNoAudience_defaultsToEndpointBasedAudience() + throws IOException { + + // we create the client as usual - no audience passed + String testEndpoint = "custom-endpoint:123"; + settings = settings.toBuilder().setEndpoint(testEndpoint).build(); + context = ClientContext.create(settings); + stubSettings = EchoStubSettings.newBuilder(context).build(); + client = EchoClient.create(stubSettings.createStub()); + + // We retrieve from context and from client + // the client has only access to creds provider, which may differ from the actual credentials + // used in the Context + Credentials fromContext = context.getCredentials(); + Credentials fromClient = initialCredentials; + + // Since ClientContext.create() uses a modified version of GdchCredentials + // via GdchCredentials.createWithGdchAudience(), they should be different objects + assertNotSame(fromContext, fromClient); + + // When credentials don't have an audience (such as the ones we passed to client creation and + // now stored in the + // provider) they will throw if we try to refresh them + NullPointerException expectedEx = + assertThrows(NullPointerException.class, () -> initialCredentials.refresh()); + assertTrue( + expectedEx.getMessage().contains("Audience are not configured for GDCH service account")); + + // However, the credentials prepared in ClientContext should be able to refresh since the + // audience would be + // internally defaulted the endpoint of the StubSettings + registerCredential(fromContext); + ((GdchCredentials) fromContext).refreshAccessToken(); + String usedAudience = transportFactory.transport.getLastAudienceSent(); + assertEquals(testEndpoint, usedAudience); + } + + /** + * Confirms creating a client with a valid audience is successful. We cannot confirm which + * audience is chosen (our passed audience or the endpoint) but this is confirmed in the unit + * tests. + * + * @throws IOException + */ + @Test + void testCreateClient_withGdchCredentialWithValidAudience_usesCredentialWithPassedAudience() + throws IOException { + + // Similar to the previous test, create a client as usual but this time we pass a explicit + // audience. It should + // be created without issues + String testAudience = "valid-audience"; + settings = + settings.toBuilder().setGdchApiAudience(testAudience).setEndpoint("localhost:7469").build(); + context = ClientContext.create(settings); + stubSettings = EchoStubSettings.newBuilder(context).build(); + client = EchoClient.create(stubSettings.createStub()); + + // We retrieve both creds from the creds provider and the ones prepared in the context (which + // should have been + // re-created using GdchCredentials.createWithAudience("valid-audience")) + Credentials fromContext = context.getCredentials(); + assertNotSame(fromContext, initialCredentials); + + // Again, since the initial credentials don't have an audience, we should not be able to refresh + // them + NullPointerException thrownByClientCreds = + assertThrows(NullPointerException.class, () -> initialCredentials.refresh()); + assertTrue( + thrownByClientCreds + .getMessage() + .contains("Audience are not configured for GDCH service account")); + + // But the credentials prepared in ClientContext should be able to refresh since the audience + // would be internally + // set to the one passed in stub settings + registerCredential(fromContext); + ((GdchCredentials) fromContext).refreshAccessToken(); + String usedAudience = transportFactory.transport.getLastAudienceSent(); + assertEquals(testAudience, usedAudience); + } + + private void registerCredential(Credentials fromContext) { + GdchCredentialsTestUtil.registerGdchCredentialWithMockTransport( + (GdchCredentials) fromContext, + transportFactory.transport, + projectId, + SID_NAME, + GDCH_TOKEN_STRING, + tokenUri); + } +} diff --git a/java-showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/ITHttpAnnotation.java b/java-showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/ITHttpAnnotation.java new file mode 100644 index 0000000000..0daf858d14 --- /dev/null +++ b/java-showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/ITHttpAnnotation.java @@ -0,0 +1,145 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.showcase.v1beta1.it; + +import static com.google.common.truth.Truth.assertThat; + +import com.google.api.client.http.javanet.NetHttpTransport; +import com.google.api.gax.core.NoCredentialsProvider; +import com.google.common.collect.ImmutableMap; +import com.google.protobuf.util.JsonFormat; +import com.google.showcase.v1beta1.ComplianceClient; +import com.google.showcase.v1beta1.ComplianceData; +import com.google.showcase.v1beta1.ComplianceGroup; +import com.google.showcase.v1beta1.ComplianceSettings; +import com.google.showcase.v1beta1.ComplianceSuite; +import com.google.showcase.v1beta1.RepeatRequest; +import com.google.showcase.v1beta1.RepeatResponse; +import com.google.showcase.v1beta1.it.util.TestClientInitializer; +import java.io.IOException; +import java.io.InputStreamReader; +import java.nio.charset.StandardCharsets; +import java.security.GeneralSecurityException; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import java.util.concurrent.TimeUnit; +import java.util.function.Function; +import java.util.stream.Collectors; +import java.util.stream.Stream; +import org.junit.jupiter.api.AfterAll; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.Arguments; +import org.junit.jupiter.params.provider.MethodSource; + +// This test runs from the parameters in the compliance_suite.json file +// The file is downloaded from the gapic-showcase repo. Each compliance +// group is a set of HttpJson behaviors we want to test for. Each group +// tests the product of the rpc list and requests list. +class ITHttpAnnotation { + + static Stream data() { + return Stream.of( + Arguments.of("Fully working conversions, resources"), + Arguments.of("Binding selection testing"), + Arguments.of("Cases that apply to non-path requests"), + Arguments.of("Fully working conversions, no resources")); + } + + private static ComplianceClient httpjsonClient; + private static ComplianceSuite complianceSuite; + private static Map> validComplianceRpcMap; + + @BeforeAll + static void createClients() throws IOException, GeneralSecurityException { + ComplianceSuite.Builder builder = ComplianceSuite.newBuilder(); + JsonFormat.parser() + .merge( + new InputStreamReader( + Objects.requireNonNull( + ITHttpAnnotation.class + .getClassLoader() + .getResourceAsStream("compliance_suite.json")), + StandardCharsets.UTF_8), + builder); + complianceSuite = builder.build(); + + ComplianceSettings httpjsonComplianceSettings = + ComplianceSettings.newHttpJsonBuilder() + .setCredentialsProvider(NoCredentialsProvider.create()) + .setTransportChannelProvider( + ComplianceSettings.defaultHttpJsonTransportProviderBuilder() + .setHttpTransport( + new NetHttpTransport.Builder().doNotValidateCertificate().build()) + .setEndpoint("http://localhost:7469") + .build()) + .build(); + httpjsonClient = ComplianceClient.create(httpjsonComplianceSettings); + + // Mapping of Compliance Suite file RPC Names to ComplianceClient methods + validComplianceRpcMap = + ImmutableMap.of( + "Compliance.RepeatDataBody", + httpjsonClient::repeatDataBody, + "Compliance.RepeatDataBodyInfo", + httpjsonClient::repeatDataBodyInfo, + "Compliance.RepeatDataQuery", + httpjsonClient::repeatDataQuery, + "Compliance.RepeatDataSimplePath", + httpjsonClient::repeatDataSimplePath, + "Compliance.RepeatDataBodyPut", + httpjsonClient::repeatDataBodyPut, + "Compliance.RepeatDataBodyPatch", + httpjsonClient::repeatDataBodyPatch, + "Compliance.RepeatDataPathResource", + httpjsonClient::repeatDataPathResource); + } + + @AfterAll + static void destroyClients() throws InterruptedException { + httpjsonClient.close(); + httpjsonClient.awaitTermination( + TestClientInitializer.AWAIT_TERMINATION_SECONDS, TimeUnit.SECONDS); + } + + // Verify that the input's info is the same as the response's info + // This ensures that the entire group's behavior over HttpJson + // works as intended + @ParameterizedTest + @MethodSource("data") + void testComplianceGroup(String groupName) { + Optional complianceGroupOptional = + complianceSuite.getGroupList().stream() + .filter(x -> x.getName().equals(groupName)) + .findFirst(); + assertThat(complianceGroupOptional.isPresent()).isTrue(); + ComplianceGroup complianceGroup = complianceGroupOptional.get(); + List validRpcList = + complianceGroup.getRpcsList().stream() + .filter(validComplianceRpcMap::containsKey) + .collect(Collectors.toList()); + for (String rpcName : validRpcList) { + Function rpc = validComplianceRpcMap.get(rpcName); + for (RepeatRequest repeatRequest : complianceGroup.getRequestsList()) { + ComplianceData expectedData = repeatRequest.getInfo(); + RepeatResponse response = rpc.apply(repeatRequest); + assertThat(response.getRequest().getInfo()).isEqualTo(expectedData); + } + } + } +} diff --git a/java-showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/ITIam.java b/java-showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/ITIam.java new file mode 100644 index 0000000000..893eeb2679 --- /dev/null +++ b/java-showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/ITIam.java @@ -0,0 +1,180 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.showcase.v1beta1.it; + +import static com.google.common.truth.Truth.assertThat; +import static org.junit.jupiter.api.Assertions.assertThrows; + +import com.google.api.gax.rpc.InvalidArgumentException; +import com.google.common.collect.ImmutableList; +import com.google.iam.v1.Binding; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.showcase.v1beta1.IdentityClient; +import com.google.showcase.v1beta1.it.util.TestClientInitializer; +import java.util.List; +import java.util.UUID; +import java.util.concurrent.TimeUnit; +import org.junit.jupiter.api.AfterAll; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; + +class ITIam { + private static final Policy DEFAULT_POLICY = + Policy.newBuilder() + .addBindings(Binding.newBuilder().setRole("foo.editor").addMembers("allUsers")) + .build(); + private static IdentityClient grpcClient; + private static IdentityClient httpjsonClient; + private String resourceName; + + @BeforeAll + static void createClients() throws Exception { + grpcClient = TestClientInitializer.createGrpcIdentityClient(); + httpjsonClient = TestClientInitializer.createHttpJsonIdentityClient(); + } + + @BeforeEach + void setupTests() { + resourceName = "users/" + UUID.randomUUID().toString().substring(0, 8); + } + + @AfterAll + public static void destroyClients() throws InterruptedException { + grpcClient.close(); + httpjsonClient.close(); + + grpcClient.awaitTermination(TestClientInitializer.AWAIT_TERMINATION_SECONDS, TimeUnit.SECONDS); + httpjsonClient.awaitTermination( + TestClientInitializer.AWAIT_TERMINATION_SECONDS, TimeUnit.SECONDS); + } + + @Test + void testGrpc_setIamPolicy() { + SetIamPolicyRequest policyRequest = + SetIamPolicyRequest.newBuilder() + .setPolicy(DEFAULT_POLICY) + .setResource(resourceName) + .build(); + Policy policy = grpcClient.setIamPolicy(policyRequest); + assertThat(policy).isEqualTo(DEFAULT_POLICY); + } + + @Test + void testHttpJson_setIamPolicy() { + SetIamPolicyRequest policyRequest = + SetIamPolicyRequest.newBuilder() + .setPolicy(DEFAULT_POLICY) + .setResource(resourceName) + .build(); + Policy policy = httpjsonClient.setIamPolicy(policyRequest); + assertThat(policy).isEqualTo(DEFAULT_POLICY); + } + + @Test + void testGrpc_getIamPolicy() { + SetIamPolicyRequest policyRequest = + SetIamPolicyRequest.newBuilder() + .setPolicy(DEFAULT_POLICY) + .setResource(resourceName) + .build(); + grpcClient.setIamPolicy(policyRequest); + + Policy policy = + grpcClient.getIamPolicy( + GetIamPolicyRequest.newBuilder().setResource(policyRequest.getResource()).build()); + assertThat(policy).isEqualTo(DEFAULT_POLICY); + } + + @Test + void testHttpJson_getIamPolicy() { + SetIamPolicyRequest policyRequest = + SetIamPolicyRequest.newBuilder() + .setPolicy(DEFAULT_POLICY) + .setResource(resourceName) + .build(); + httpjsonClient.setIamPolicy(policyRequest); + + Policy policy = + httpjsonClient.getIamPolicy( + GetIamPolicyRequest.newBuilder().setResource(policyRequest.getResource()).build()); + assertThat(policy).isEqualTo(DEFAULT_POLICY); + } + + @Test + void testGrpc_testIamPermissions() { + SetIamPolicyRequest policyRequest = + SetIamPolicyRequest.newBuilder() + .setPolicy(DEFAULT_POLICY) + .setResource(resourceName) + .build(); + grpcClient.setIamPolicy(policyRequest); + List permissions = ImmutableList.of("foo.create", "foo.write"); + TestIamPermissionsResponse testIamPermissionsResponse = + grpcClient.testIamPermissions( + TestIamPermissionsRequest.newBuilder() + .setResource(policyRequest.getResource()) + .addAllPermissions(permissions) + .build()); + // Showcase server will simply echo the request's Permissions List back + // if the resource exists and contains a policy + assertThat(testIamPermissionsResponse.getPermissionsList()) + .containsExactlyElementsIn(permissions); + } + + @Test + void testHttpJson_testIamPermissions() { + SetIamPolicyRequest policyRequest = + SetIamPolicyRequest.newBuilder() + .setPolicy(DEFAULT_POLICY) + .setResource(resourceName) + .build(); + httpjsonClient.setIamPolicy(policyRequest); + List permissions = ImmutableList.of("foo.create", "foo.write"); + TestIamPermissionsResponse testIamPermissionsResponse = + httpjsonClient.testIamPermissions( + TestIamPermissionsRequest.newBuilder() + .setResource(policyRequest.getResource()) + .addAllPermissions(permissions) + .build()); + // Showcase server will simply echo the request's Permissions List back + // if the resource exists and contains a policy + assertThat(testIamPermissionsResponse.getPermissionsList()) + .containsExactlyElementsIn(permissions); + } + + // The tests below simply assert that an exception is being thrown for an invalid request + // in both transports. Showcase's IAM backend service will throw a few exceptions for a few + // cases, and we simply assert that an exception has been thrown for a single case with a single + // RPC (No resource in the request for SetIamPolicy's RPC). + @Test + void testGrpc_iamThrowsException() { + SetIamPolicyRequest setIamPolicyRequest = SetIamPolicyRequest.newBuilder().build(); + assertThrows( + InvalidArgumentException.class, () -> grpcClient.setIamPolicy(setIamPolicyRequest)); + } + + @Test + void testHttpJson_iamThrowsException() { + SetIamPolicyRequest setIamPolicyRequest = SetIamPolicyRequest.newBuilder().build(); + assertThrows( + InvalidArgumentException.class, () -> httpjsonClient.setIamPolicy(setIamPolicyRequest)); + } +} diff --git a/java-showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/ITLongRunningOperation.java b/java-showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/ITLongRunningOperation.java new file mode 100644 index 0000000000..09208861ba --- /dev/null +++ b/java-showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/ITLongRunningOperation.java @@ -0,0 +1,196 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.showcase.v1beta1.it; + +import static com.google.common.truth.Truth.assertThat; +import static org.junit.jupiter.api.Assertions.assertThrows; + +import com.google.api.gax.longrunning.OperationFuture; +import com.google.api.gax.retrying.RetrySettings; +import com.google.protobuf.Timestamp; +import com.google.showcase.v1beta1.EchoClient; +import com.google.showcase.v1beta1.WaitMetadata; +import com.google.showcase.v1beta1.WaitRequest; +import com.google.showcase.v1beta1.WaitResponse; +import com.google.showcase.v1beta1.it.util.TestClientInitializer; +import java.util.concurrent.CancellationException; +import java.util.concurrent.TimeUnit; +import org.junit.jupiter.api.Test; +import org.threeten.bp.Duration; +import org.threeten.bp.Instant; +import org.threeten.bp.temporal.ChronoUnit; + +/** + * For this test, we test a combination of various LRO RetrySettings and try to ensure that the + * calls are polling correctly. Each test attempts to test the number of attempts done in each call. + */ +class ITLongRunningOperation { + + @Test + void testGRPC_LROSuccessfulResponse_doesNotExceedTotalTimeout() throws Exception { + RetrySettings initialUnaryRetrySettings = + RetrySettings.newBuilder() + .setInitialRpcTimeout(Duration.ofMillis(3000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ofMillis(3000L)) + .setTotalTimeout(Duration.ofMillis(3000L)) + .build(); + RetrySettings pollingRetrySettings = + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(3000L)) + .setRetryDelayMultiplier(2.0) + .setMaxRetryDelay(Duration.ofMillis(5000L)) + .setTotalTimeout(Duration.ofMillis(10000L)) + .build(); + EchoClient grpcClient = + TestClientInitializer.createGrpcEchoClientCustomWaitSettings( + initialUnaryRetrySettings, pollingRetrySettings); + try { + long epochSecondsInFuture = Instant.now().plus(5, ChronoUnit.SECONDS).getEpochSecond(); + WaitRequest waitRequest = + WaitRequest.newBuilder() + .setSuccess(WaitResponse.newBuilder().setContent("gRPCWaitContent_5sDelay_noRetry")) + .setEndTime(Timestamp.newBuilder().setSeconds(epochSecondsInFuture).build()) + .build(); + OperationFuture operationFuture = + grpcClient.waitOperationCallable().futureCall(waitRequest); + WaitResponse waitResponse = operationFuture.get(); + assertThat(waitResponse.getContent()).isEqualTo("gRPCWaitContent_5sDelay_noRetry"); + int attemptCount = operationFuture.getPollingFuture().getAttemptSettings().getAttemptCount(); + assertThat(attemptCount).isAtLeast(2); + } finally { + grpcClient.close(); + grpcClient.awaitTermination( + TestClientInitializer.AWAIT_TERMINATION_SECONDS, TimeUnit.SECONDS); + } + } + + @Test + void testHttpJson_LROSuccessfulResponse_doesNotExceedTotalTimeout() throws Exception { + RetrySettings initialUnaryRetrySettings = + RetrySettings.newBuilder() + .setInitialRpcTimeout(Duration.ofMillis(3000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ofMillis(3000L)) + .setTotalTimeout(Duration.ofMillis(3000L)) + .build(); + RetrySettings pollingRetrySettings = + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(3000L)) + .setRetryDelayMultiplier(2.0) + .setMaxRetryDelay(Duration.ofMillis(5000L)) + .setTotalTimeout(Duration.ofMillis(10000L)) + .build(); + EchoClient httpjsonClient = + TestClientInitializer.createHttpJsonEchoClientCustomWaitSettings( + initialUnaryRetrySettings, pollingRetrySettings); + try { + long epochSecondsInFuture = Instant.now().plus(5, ChronoUnit.SECONDS).getEpochSecond(); + WaitRequest waitRequest = + WaitRequest.newBuilder() + .setSuccess( + WaitResponse.newBuilder().setContent("httpjsonWaitContent_5sDelay_noRetry")) + .setEndTime(Timestamp.newBuilder().setSeconds(epochSecondsInFuture).build()) + .build(); + OperationFuture operationFuture = + httpjsonClient.waitOperationCallable().futureCall(waitRequest); + WaitResponse waitResponse = operationFuture.get(); + assertThat(waitResponse.getContent()).isEqualTo("httpjsonWaitContent_5sDelay_noRetry"); + int attemptCount = operationFuture.getPollingFuture().getAttemptSettings().getAttemptCount(); + assertThat(attemptCount).isAtLeast(2); + } finally { + httpjsonClient.close(); + httpjsonClient.awaitTermination( + TestClientInitializer.AWAIT_TERMINATION_SECONDS, TimeUnit.SECONDS); + } + } + + @Test + void testGRPC_LROUnsuccessfulResponse_exceedsTotalTimeout_throwsDeadlineExceededException() + throws Exception { + RetrySettings initialUnaryRetrySettings = + RetrySettings.newBuilder() + .setInitialRpcTimeout(Duration.ofMillis(5000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ofMillis(5000L)) + .setTotalTimeout(Duration.ofMillis(5000L)) + .build(); + RetrySettings pollingRetrySettings = + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(1000L)) + .setRetryDelayMultiplier(2.0) + .setMaxRetryDelay(Duration.ofMillis(3000L)) + .setTotalTimeout(Duration.ofMillis(5000L)) + .build(); + EchoClient grpcClient = + TestClientInitializer.createGrpcEchoClientCustomWaitSettings( + initialUnaryRetrySettings, pollingRetrySettings); + try { + WaitRequest waitRequest = + WaitRequest.newBuilder() + .setSuccess(WaitResponse.newBuilder().setContent("httpjsonWaitContent_10sDelay")) + .setTtl(com.google.protobuf.Duration.newBuilder().setSeconds(10)) + .build(); + OperationFuture operationFuture = + grpcClient.waitOperationCallable().futureCall(waitRequest); + assertThrows(CancellationException.class, operationFuture::get); + int attemptCount = operationFuture.getPollingFuture().getAttemptSettings().getAttemptCount(); + assertThat(attemptCount).isGreaterThan(1); + } finally { + grpcClient.close(); + grpcClient.awaitTermination( + TestClientInitializer.AWAIT_TERMINATION_SECONDS, TimeUnit.SECONDS); + } + } + + @Test + void testHttpJson_LROUnsuccessfulResponse_exceedsTotalTimeout_throwsDeadlineExceededException() + throws Exception { + RetrySettings initialUnaryRetrySettings = + RetrySettings.newBuilder() + .setInitialRpcTimeout(Duration.ofMillis(500L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ofMillis(500L)) + .setTotalTimeout(Duration.ofMillis(500L)) + .build(); + RetrySettings pollingRetrySettings = + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(100L)) + .setRetryDelayMultiplier(2.0) + .setMaxRetryDelay(Duration.ofMillis(500L)) + .setTotalTimeout(Duration.ofMillis(1000L)) + .build(); + EchoClient httpjsonClient = + TestClientInitializer.createHttpJsonEchoClientCustomWaitSettings( + initialUnaryRetrySettings, pollingRetrySettings); + try { + WaitRequest waitRequest = + WaitRequest.newBuilder() + .setSuccess(WaitResponse.newBuilder().setContent("httpjsonWaitContent_10sDelay")) + .setTtl(com.google.protobuf.Duration.newBuilder().setSeconds(10)) + .build(); + OperationFuture operationFuture = + httpjsonClient.waitOperationCallable().futureCall(waitRequest); + assertThrows(CancellationException.class, operationFuture::get); + int attemptCount = operationFuture.getPollingFuture().getAttemptSettings().getAttemptCount(); + assertThat(attemptCount).isGreaterThan(1); + } finally { + httpjsonClient.close(); + httpjsonClient.awaitTermination( + TestClientInitializer.AWAIT_TERMINATION_SECONDS, TimeUnit.SECONDS); + } + } +} diff --git a/java-showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/ITNumericEnums.java b/java-showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/ITNumericEnums.java new file mode 100644 index 0000000000..76c54a803c --- /dev/null +++ b/java-showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/ITNumericEnums.java @@ -0,0 +1,67 @@ +/* + * 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 + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.it; + +import static org.junit.jupiter.api.Assertions.assertEquals; + +import com.google.api.client.http.javanet.NetHttpTransport; +import com.google.api.gax.core.NoCredentialsProvider; +import com.google.showcase.v1beta1.ComplianceClient; +import com.google.showcase.v1beta1.ComplianceSettings; +import com.google.showcase.v1beta1.EnumRequest; +import com.google.showcase.v1beta1.EnumResponse; +import com.google.showcase.v1beta1.it.util.TestClientInitializer; +import java.io.IOException; +import java.security.GeneralSecurityException; +import java.util.concurrent.TimeUnit; +import org.junit.jupiter.api.AfterAll; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Test; + +class ITNumericEnums { + + private static ComplianceClient httpjsonClient; + + @BeforeAll + static void createClients() throws GeneralSecurityException, IOException { + ComplianceSettings complianceSettings = + ComplianceSettings.newHttpJsonBuilder() + .setCredentialsProvider(NoCredentialsProvider.create()) + .setTransportChannelProvider( + ComplianceSettings.defaultHttpJsonTransportProviderBuilder() + .setHttpTransport( + new NetHttpTransport.Builder().doNotValidateCertificate().build()) + .setEndpoint("http://localhost:7469") + .build()) + .build(); + httpjsonClient = ComplianceClient.create(complianceSettings); + } + + @AfterAll + static void destroyClients() throws InterruptedException { + httpjsonClient.close(); + httpjsonClient.awaitTermination( + TestClientInitializer.AWAIT_TERMINATION_SECONDS, TimeUnit.SECONDS); + } + + @Test + void verifyEnums() { + EnumRequest request = EnumRequest.newBuilder().setUnknownEnum(true).build(); + EnumResponse initialResponse = httpjsonClient.getEnum(request); + assertEquals(initialResponse, httpjsonClient.verifyEnum(initialResponse)); + } +} diff --git a/java-showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/ITOtelMetrics.java b/java-showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/ITOtelMetrics.java new file mode 100644 index 0000000000..ad973e4137 --- /dev/null +++ b/java-showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/ITOtelMetrics.java @@ -0,0 +1,922 @@ +/* + * Copyright 2024 Google LLC + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Google LLC nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +package com.google.showcase.v1beta1.it; + +import static org.junit.Assert.assertThrows; + +import com.google.api.client.http.javanet.NetHttpTransport; +import com.google.api.core.ApiFunction; +import com.google.api.core.ApiFuture; +import com.google.api.gax.core.NoCredentialsProvider; +import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; +import com.google.api.gax.retrying.RetrySettings; +import com.google.api.gax.rpc.InvalidArgumentException; +import com.google.api.gax.rpc.StatusCode.Code; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.api.gax.rpc.UnavailableException; +import com.google.api.gax.tracing.MetricsTracer; +import com.google.api.gax.tracing.MetricsTracerFactory; +import com.google.api.gax.tracing.OpenTelemetryMetricsRecorder; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.ImmutableSet; +import com.google.common.truth.Truth; +import com.google.protobuf.Duration; +import com.google.rpc.Status; +import com.google.showcase.v1beta1.BlockRequest; +import com.google.showcase.v1beta1.BlockResponse; +import com.google.showcase.v1beta1.EchoClient; +import com.google.showcase.v1beta1.EchoRequest; +import com.google.showcase.v1beta1.EchoSettings; +import com.google.showcase.v1beta1.it.util.TestClientInitializer; +import com.google.showcase.v1beta1.stub.EchoStub; +import com.google.showcase.v1beta1.stub.EchoStubSettings; +import io.grpc.ManagedChannelBuilder; +import io.grpc.opentelemetry.GrpcOpenTelemetry; +import io.opentelemetry.api.OpenTelemetry; +import io.opentelemetry.api.common.AttributeKey; +import io.opentelemetry.api.common.Attributes; +import io.opentelemetry.sdk.OpenTelemetrySdk; +import io.opentelemetry.sdk.metrics.SdkMeterProvider; +import io.opentelemetry.sdk.metrics.data.Data; +import io.opentelemetry.sdk.metrics.data.HistogramPointData; +import io.opentelemetry.sdk.metrics.data.LongPointData; +import io.opentelemetry.sdk.metrics.data.MetricData; +import io.opentelemetry.sdk.metrics.data.PointData; +import io.opentelemetry.sdk.testing.exporter.InMemoryMetricReader; +import java.io.IOException; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Optional; +import java.util.Set; +import java.util.concurrent.ExecutionException; +import java.util.concurrent.TimeUnit; +import java.util.function.Predicate; +import java.util.stream.Collectors; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; + +/** + * Showcase Test to confirm that metrics are being collected and that the correct metrics are being + * recorded. Utilizes an in-memory metric reader to collect the data. + * + *

        Every test flows through the same way and runs through the same assertions. First, all th + * metrics are pulled in via {@link #getMetricDataList()} which are polled until all the metrics are + * collected. Then the test will attempt check that reader collected the correct number of data + * points in {@link #verifyPointDataSum(List, int)}. Then, check that the attributes to be collected + * via {@link #verifyStatusAttribute(List, List)}. Finally, check that the status for each attempt + * is correct. + */ +class ITOtelMetrics { + private static final int DEFAULT_OPERATION_COUNT = 1; + private static final String SERVICE_NAME = "ShowcaseTest"; + private static final String ATTEMPT_COUNT = SERVICE_NAME + "/attempt_count"; + private static final String OPERATION_COUNT = SERVICE_NAME + "/operation_count"; + private static final String ATTEMPT_LATENCY = SERVICE_NAME + "/attempt_latency"; + private static final String OPERATION_LATENCY = SERVICE_NAME + "/operation_latency"; + private static final Set GAX_METRICS = + ImmutableSet.of(ATTEMPT_COUNT, OPERATION_COUNT, ATTEMPT_LATENCY, OPERATION_LATENCY); + + // Gax provides four metrics by default. This number may change as new metrics are added. + private static final int NUM_GAX_OTEL_METRICS = 4; + private static final int NUM_DEFAULT_FLUSH_ATTEMPTS = 10; + + private InMemoryMetricReader inMemoryMetricReader; + private EchoClient grpcClient; + private EchoClient httpClient; + + /** + * Internal class in the Otel Showcases test used to assert that number of status codes recorded. + */ + private static class StatusCount { + private final Code statusCode; + private final int count; + + public StatusCount(Code statusCode) { + this(statusCode, 1); + } + + public StatusCount(Code statusCode, int count) { + this.statusCode = statusCode; + this.count = count; + } + + public Code getStatusCode() { + return statusCode; + } + + public int getCount() { + return count; + } + } + + private OpenTelemetryMetricsRecorder createOtelMetricsRecorder( + InMemoryMetricReader inMemoryMetricReader) { + SdkMeterProvider sdkMeterProvider = + SdkMeterProvider.builder().registerMetricReader(inMemoryMetricReader).build(); + + OpenTelemetry openTelemetry = + OpenTelemetrySdk.builder().setMeterProvider(sdkMeterProvider).build(); + return new OpenTelemetryMetricsRecorder(openTelemetry, SERVICE_NAME); + } + + @BeforeEach + void setup() throws Exception { + inMemoryMetricReader = InMemoryMetricReader.create(); + OpenTelemetryMetricsRecorder otelMetricsRecorder = + createOtelMetricsRecorder(inMemoryMetricReader); + grpcClient = + TestClientInitializer.createGrpcEchoClientOpentelemetry( + new MetricsTracerFactory(otelMetricsRecorder)); + httpClient = + TestClientInitializer.createHttpJsonEchoClientOpentelemetry( + new MetricsTracerFactory(otelMetricsRecorder)); + } + + @AfterEach + void cleanup() throws InterruptedException, IOException { + inMemoryMetricReader.close(); + inMemoryMetricReader.shutdown(); + + grpcClient.close(); + httpClient.close(); + + grpcClient.awaitTermination(TestClientInitializer.AWAIT_TERMINATION_SECONDS, TimeUnit.SECONDS); + httpClient.awaitTermination(TestClientInitializer.AWAIT_TERMINATION_SECONDS, TimeUnit.SECONDS); + } + + /** + * Iterate through all MetricData elements and check that the number of PointData values matches + * the expected value. A PointData element may have multiple values/ counts inside, so this + * extracts the value/ count from the PointData before summing. + * + *

        The expected sum for an operation is `1`. Expected sum for an attempt may be 1+. + */ + private void verifyPointDataSum(List metricDataList, int attemptCount) { + for (MetricData metricData : metricDataList) { + Data data = metricData.getData(); + List points = new ArrayList<>(data.getPoints()); + switch (metricData.getName()) { + case OPERATION_COUNT: + long operationCountSum = + points.stream().map(x -> ((LongPointData) x).getValue()).reduce(0L, Long::sum); + Truth.assertThat(operationCountSum).isEqualTo(DEFAULT_OPERATION_COUNT); + break; + case ATTEMPT_COUNT: + long attemptCountSum = + points.stream().map(x -> ((LongPointData) x).getValue()).reduce(0L, Long::sum); + Truth.assertThat(attemptCountSum).isEqualTo(attemptCount); + break; + case OPERATION_LATENCY: + long operationLatencyCountSum = + points.stream().map(x -> ((HistogramPointData) x).getCount()).reduce(0L, Long::sum); + // It is difficult to verify the actual latency values (operation or attempt) + // without flaky behavior. Test that the number of data points recorded matches. + Truth.assertThat(operationLatencyCountSum).isEqualTo(DEFAULT_OPERATION_COUNT); + break; + case ATTEMPT_LATENCY: + long attemptLatencyCountSum = + points.stream().map(x -> ((HistogramPointData) x).getCount()).reduce(0L, Long::sum); + // It is difficult to verify the actual latency values (operation or attempt) + // without flaky behavior. Test that the number of data points recorded matches. + Truth.assertThat(attemptLatencyCountSum).isEqualTo(attemptCount); + break; + default: + break; + } + } + } + + /** + * Extract the attributes from MetricData and ensures that default attributes are recorded. Uses + * the `OPERATION_COUNT` MetricData to test the attributes. The `OPERATION_COUNT` is only recorded + * once and should only have one element of PointData. + * + *

        Although the Status attribute is recorded by default on every operation, this helper method + * does not verify it. This is because every individual attempt (retry) may have a different + * status. {@link #verifyStatusAttribute(List, List)} is used to verify the statuses for every + * attempt. + */ + private void verifyDefaultMetricsAttributes( + List metricDataList, Map defaultAttributeMapping) { + Optional metricDataOptional = + metricDataList.stream().filter(x -> x.getName().equals(OPERATION_COUNT)).findAny(); + Truth.assertThat(metricDataOptional.isPresent()).isTrue(); + MetricData operationCountMetricData = metricDataOptional.get(); + + List pointDataList = new ArrayList<>(operationCountMetricData.getData().getPoints()); + // Operation Metrics should only have a 1 data point + Truth.assertThat(pointDataList.size()).isEqualTo(1); + Attributes recordedAttributes = pointDataList.get(0).getAttributes(); + Map, Object> recordedAttributesMap = recordedAttributes.asMap(); + for (Map.Entry entrySet : defaultAttributeMapping.entrySet()) { + String key = entrySet.getKey(); + String value = entrySet.getValue(); + AttributeKey stringAttributeKey = AttributeKey.stringKey(key); + Truth.assertThat(recordedAttributesMap.containsKey(stringAttributeKey)).isTrue(); + Truth.assertThat(recordedAttributesMap.get(stringAttributeKey)).isEqualTo(value); + } + } + + /** + * Extract the attributes from MetricData and ensures that default attributes are recorded. Uses + * the `ATTEMPT_COUNT` MetricData to test the attributes. The `ATTEMPT_COUNT` is recorded for + * every retry attempt and should record the status received that each attempt made. + */ + private void verifyStatusAttribute( + List metricDataList, List statusCountList) { + Optional metricDataOptional = + metricDataList.stream().filter(x -> x.getName().equals(ATTEMPT_COUNT)).findAny(); + Truth.assertThat(metricDataOptional.isPresent()).isTrue(); + MetricData attemptCountMetricData = metricDataOptional.get(); + + List pointDataList = new ArrayList<>(attemptCountMetricData.getData().getPoints()); + Truth.assertThat(pointDataList.size()).isEqualTo(statusCountList.size()); + + // The data for attempt count may not be ordered (i.e. the last data point recorded may be the + // first element in the PointData list). Search for the expected StatusCode from the + // statusCountList + // and match with the data inside the pointDataList + for (StatusCount statusCount : statusCountList) { + Code statusCode = statusCount.getStatusCode(); + Predicate pointDataPredicate = + x -> + x.getAttributes() + .get(AttributeKey.stringKey(MetricsTracer.STATUS_ATTRIBUTE)) + .equals(statusCode.toString()); + Optional pointDataOptional = + pointDataList.stream().filter(pointDataPredicate).findFirst(); + Truth.assertThat(pointDataOptional.isPresent()).isTrue(); + LongPointData longPointData = (LongPointData) pointDataOptional.get(); + Truth.assertThat(longPointData.getValue()).isEqualTo(statusCount.getCount()); + } + } + + /** Uses the default InMemoryMetricReader configured for showcase tests. */ + private List getMetricDataList() throws InterruptedException { + return getMetricDataList(inMemoryMetricReader); + } + + /** + * Attempts to retrieve the metrics from a custom InMemoryMetricsReader. Sleep every second for at + * most 10s to try and retrieve all the metrics available. If it is unable to retrieve all the + * metrics, fail the test. + */ + private List getMetricDataList(InMemoryMetricReader metricReader) + throws InterruptedException { + for (int i = 0; i < NUM_DEFAULT_FLUSH_ATTEMPTS; i++) { + Thread.sleep(1000L); + List metricData = new ArrayList<>(metricReader.collectAllMetrics()); + // Depending on the OpenTelemetry instance (i.e. OpenTelemetry, GrpcOpenTelemetry, etc.) + // there may be additional metrics recorded. Only check to ensure the Gax Metrics + // are recorded properly. Any additional metrics are fine to be passed. + if (metricData.size() >= NUM_GAX_OTEL_METRICS && areAllGaxMetricsRecorded(metricData)) { + return metricData; + } + } + Assertions.fail("Unable to collect all the GAX metrics required for the test"); + return new ArrayList<>(); + } + + private boolean areAllGaxMetricsRecorded(List metricData) { + return metricData.stream().filter(data -> GAX_METRICS.contains(data.getName())).count() + == NUM_GAX_OTEL_METRICS; + } + + @Test + void testGrpc_operationSucceeded_recordsMetrics() throws InterruptedException { + int attemptCount = 1; + EchoRequest echoRequest = + EchoRequest.newBuilder().setContent("test_grpc_operation_succeeded").build(); + grpcClient.echo(echoRequest); + + List actualMetricDataList = getMetricDataList(); + verifyPointDataSum(actualMetricDataList, attemptCount); + + Map expectedAttributes = + ImmutableMap.of( + MetricsTracer.METHOD_ATTRIBUTE, + "Echo.Echo", + MetricsTracer.LANGUAGE_ATTRIBUTE, + MetricsTracer.DEFAULT_LANGUAGE); + verifyDefaultMetricsAttributes(actualMetricDataList, expectedAttributes); + + List statusCountList = ImmutableList.of(new StatusCount(Code.OK)); + verifyStatusAttribute(actualMetricDataList, statusCountList); + } + + @Test + void testHttpJson_operationSucceeded_recordsMetrics() throws InterruptedException { + int attemptCount = 1; + EchoRequest echoRequest = EchoRequest.newBuilder().setContent("content").build(); + httpClient.echo(echoRequest); + + List actualMetricDataList = getMetricDataList(); + verifyPointDataSum(actualMetricDataList, attemptCount); + + Map expectedAttributes = + ImmutableMap.of( + MetricsTracer.METHOD_ATTRIBUTE, + "Echo.Echo", + MetricsTracer.LANGUAGE_ATTRIBUTE, + MetricsTracer.DEFAULT_LANGUAGE); + verifyDefaultMetricsAttributes(actualMetricDataList, expectedAttributes); + + List statusCountList = ImmutableList.of(new StatusCount(Code.OK)); + verifyStatusAttribute(actualMetricDataList, statusCountList); + } + + @Test + void testGrpc_operationCancelled_recordsMetrics() throws Exception { + int attemptCount = 1; + BlockRequest blockRequest = + BlockRequest.newBuilder() + .setResponseDelay(Duration.newBuilder().setSeconds(5)) + .setSuccess(BlockResponse.newBuilder().setContent("grpc_operationCancelled")) + .build(); + + UnaryCallable blockCallable = grpcClient.blockCallable(); + ApiFuture blockResponseApiFuture = blockCallable.futureCall(blockRequest); + // Sleep 1s before cancelling to let the request go through + Thread.sleep(1000); + blockResponseApiFuture.cancel(true); + + List actualMetricDataList = getMetricDataList(); + verifyPointDataSum(actualMetricDataList, attemptCount); + + Map expectedAttributes = + ImmutableMap.of( + MetricsTracer.METHOD_ATTRIBUTE, + "Echo.Block", + MetricsTracer.LANGUAGE_ATTRIBUTE, + MetricsTracer.DEFAULT_LANGUAGE); + verifyDefaultMetricsAttributes(actualMetricDataList, expectedAttributes); + + List statusCountList = ImmutableList.of(new StatusCount(Code.CANCELLED)); + verifyStatusAttribute(actualMetricDataList, statusCountList); + } + + @Test + void testHttpJson_operationCancelled_recordsMetrics() throws Exception { + int attemptCount = 1; + BlockRequest blockRequest = + BlockRequest.newBuilder().setResponseDelay(Duration.newBuilder().setSeconds(5)).build(); + + UnaryCallable blockCallable = httpClient.blockCallable(); + ApiFuture blockResponseApiFuture = blockCallable.futureCall(blockRequest); + // Sleep 1s before cancelling to let the request go through + Thread.sleep(1000); + blockResponseApiFuture.cancel(true); + + List actualMetricDataList = getMetricDataList(); + verifyPointDataSum(actualMetricDataList, attemptCount); + + Map expectedAttributes = + ImmutableMap.of( + MetricsTracer.METHOD_ATTRIBUTE, + "Echo.Block", + MetricsTracer.LANGUAGE_ATTRIBUTE, + MetricsTracer.DEFAULT_LANGUAGE); + verifyDefaultMetricsAttributes(actualMetricDataList, expectedAttributes); + + List statusCountList = ImmutableList.of(new StatusCount(Code.CANCELLED)); + verifyStatusAttribute(actualMetricDataList, statusCountList); + } + + @Test + void testGrpc_operationFailed_recordsMetrics() throws InterruptedException { + int attemptCount = 1; + Code statusCode = Code.INVALID_ARGUMENT; + BlockRequest blockRequest = + BlockRequest.newBuilder() + .setResponseDelay(Duration.newBuilder().setSeconds(2)) + .setError(Status.newBuilder().setCode(statusCode.ordinal())) + .build(); + + UnaryCallable blockCallable = grpcClient.blockCallable(); + ApiFuture blockResponseApiFuture = blockCallable.futureCall(blockRequest); + assertThrows(ExecutionException.class, blockResponseApiFuture::get); + + List actualMetricDataList = getMetricDataList(); + verifyPointDataSum(actualMetricDataList, attemptCount); + + Map expectedAttributes = + ImmutableMap.of( + MetricsTracer.METHOD_ATTRIBUTE, + "Echo.Block", + MetricsTracer.LANGUAGE_ATTRIBUTE, + MetricsTracer.DEFAULT_LANGUAGE); + verifyDefaultMetricsAttributes(actualMetricDataList, expectedAttributes); + + List statusCountList = ImmutableList.of(new StatusCount(statusCode)); + verifyStatusAttribute(actualMetricDataList, statusCountList); + } + + @Test + void testHttpJson_operationFailed_recordsMetrics() throws InterruptedException { + int attemptCount = 1; + Code statusCode = Code.INVALID_ARGUMENT; + BlockRequest blockRequest = + BlockRequest.newBuilder() + .setResponseDelay(Duration.newBuilder().setSeconds(2)) + .setError(Status.newBuilder().setCode(statusCode.ordinal())) + .build(); + + UnaryCallable blockCallable = httpClient.blockCallable(); + ApiFuture blockResponseApiFuture = blockCallable.futureCall(blockRequest); + assertThrows(ExecutionException.class, blockResponseApiFuture::get); + + List actualMetricDataList = getMetricDataList(); + verifyPointDataSum(actualMetricDataList, attemptCount); + + Map expectedAttributes = + ImmutableMap.of( + MetricsTracer.METHOD_ATTRIBUTE, + "Echo.Block", + MetricsTracer.LANGUAGE_ATTRIBUTE, + MetricsTracer.DEFAULT_LANGUAGE); + verifyDefaultMetricsAttributes(actualMetricDataList, expectedAttributes); + + List statusCountList = ImmutableList.of(new StatusCount(statusCode)); + verifyStatusAttribute(actualMetricDataList, statusCountList); + } + + @Test + void testGrpc_attemptFailedRetriesExhausted_recordsMetrics() throws Exception { + int attemptCount = 3; + Code statusCode = Code.UNAVAILABLE; + // A custom EchoClient is used in this test because retries have jitter, and we cannot + // predict the number of attempts that are scheduled for an RPC invocation otherwise. + // The custom retrySettings limit to a set number of attempts before the call gives up. + RetrySettings retrySettings = + RetrySettings.newBuilder() + .setTotalTimeout(org.threeten.bp.Duration.ofMillis(5000L)) + .setMaxAttempts(3) + .build(); + + EchoStubSettings.Builder grpcEchoSettingsBuilder = EchoStubSettings.newBuilder(); + grpcEchoSettingsBuilder + .echoSettings() + .setRetrySettings(retrySettings) + .setRetryableCodes(ImmutableSet.of(statusCode)); + EchoSettings grpcEchoSettings = EchoSettings.create(grpcEchoSettingsBuilder.build()); + grpcEchoSettings = + grpcEchoSettings.toBuilder() + .setCredentialsProvider(NoCredentialsProvider.create()) + .setTransportChannelProvider( + EchoSettings.defaultGrpcTransportProviderBuilder() + .setChannelConfigurator(ManagedChannelBuilder::usePlaintext) + .build()) + .setEndpoint("localhost:7469") + .build(); + + EchoStubSettings echoStubSettings = + (EchoStubSettings) + grpcEchoSettings.getStubSettings().toBuilder() + .setTracerFactory( + new MetricsTracerFactory(createOtelMetricsRecorder(inMemoryMetricReader))) + .build(); + EchoStub stub = echoStubSettings.createStub(); + EchoClient grpcClient = EchoClient.create(stub); + + EchoRequest echoRequest = + EchoRequest.newBuilder() + .setError(Status.newBuilder().setCode(statusCode.ordinal()).build()) + .build(); + + assertThrows(UnavailableException.class, () -> grpcClient.echo(echoRequest)); + + List actualMetricDataList = getMetricDataList(); + verifyPointDataSum(actualMetricDataList, attemptCount); + + Map expectedAttributes = + ImmutableMap.of( + MetricsTracer.METHOD_ATTRIBUTE, + "Echo.Echo", + MetricsTracer.LANGUAGE_ATTRIBUTE, + MetricsTracer.DEFAULT_LANGUAGE); + verifyDefaultMetricsAttributes(actualMetricDataList, expectedAttributes); + + List statusCountList = ImmutableList.of(new StatusCount(statusCode, 3)); + verifyStatusAttribute(actualMetricDataList, statusCountList); + + grpcClient.close(); + grpcClient.awaitTermination(TestClientInitializer.AWAIT_TERMINATION_SECONDS, TimeUnit.SECONDS); + } + + @Test + void testHttpJson_attemptFailedRetriesExhausted_recordsMetrics() throws Exception { + int attemptCount = 3; + Code statusCode = Code.UNAVAILABLE; + // A custom EchoClient is used in this test because retries have jitter, and we cannot + // predict the number of attempts that are scheduled for an RPC invocation otherwise. + // The custom retrySettings limit to a set number of attempts before the call gives up. + RetrySettings retrySettings = + RetrySettings.newBuilder() + .setTotalTimeout(org.threeten.bp.Duration.ofMillis(5000L)) + .setMaxAttempts(3) + .build(); + + EchoStubSettings.Builder httpJsonEchoSettingsBuilder = EchoStubSettings.newHttpJsonBuilder(); + httpJsonEchoSettingsBuilder + .echoSettings() + .setRetrySettings(retrySettings) + .setRetryableCodes(ImmutableSet.of(statusCode)); + EchoSettings httpJsonEchoSettings = EchoSettings.create(httpJsonEchoSettingsBuilder.build()); + httpJsonEchoSettings = + httpJsonEchoSettings.toBuilder() + .setCredentialsProvider(NoCredentialsProvider.create()) + .setTransportChannelProvider( + EchoSettings.defaultHttpJsonTransportProviderBuilder() + .setHttpTransport( + new NetHttpTransport.Builder().doNotValidateCertificate().build()) + .setEndpoint("http://localhost:7469") + .build()) + .build(); + + EchoStubSettings echoStubSettings = + (EchoStubSettings) + httpJsonEchoSettings.getStubSettings().toBuilder() + .setTracerFactory( + new MetricsTracerFactory(createOtelMetricsRecorder(inMemoryMetricReader))) + .build(); + EchoStub stub = echoStubSettings.createStub(); + EchoClient httpClient = EchoClient.create(stub); + + EchoRequest echoRequest = + EchoRequest.newBuilder() + .setError(Status.newBuilder().setCode(statusCode.ordinal()).build()) + .build(); + + assertThrows(UnavailableException.class, () -> httpClient.echo(echoRequest)); + + List actualMetricDataList = getMetricDataList(); + verifyPointDataSum(actualMetricDataList, attemptCount); + + Map expectedAttributes = + ImmutableMap.of( + MetricsTracer.METHOD_ATTRIBUTE, + "Echo.Echo", + MetricsTracer.LANGUAGE_ATTRIBUTE, + MetricsTracer.DEFAULT_LANGUAGE); + verifyDefaultMetricsAttributes(actualMetricDataList, expectedAttributes); + + List statusCountList = ImmutableList.of(new StatusCount(statusCode, 3)); + verifyStatusAttribute(actualMetricDataList, statusCountList); + + httpClient.close(); + httpClient.awaitTermination(TestClientInitializer.AWAIT_TERMINATION_SECONDS, TimeUnit.SECONDS); + } + + @Test + void testGrpc_attemptPermanentFailure_recordsMetrics() throws InterruptedException { + int attemptCount = 1; + Code statusCode = Code.INVALID_ARGUMENT; + BlockRequest blockRequest = + BlockRequest.newBuilder() + .setResponseDelay(Duration.newBuilder().setSeconds(2).build()) + .setError(Status.newBuilder().setCode(statusCode.ordinal()).build()) + .build(); + + assertThrows(InvalidArgumentException.class, () -> grpcClient.block(blockRequest)); + + List actualMetricDataList = getMetricDataList(); + verifyPointDataSum(actualMetricDataList, attemptCount); + + Map expectedAttributes = + ImmutableMap.of( + MetricsTracer.METHOD_ATTRIBUTE, + "Echo.Block", + MetricsTracer.LANGUAGE_ATTRIBUTE, + MetricsTracer.DEFAULT_LANGUAGE); + verifyDefaultMetricsAttributes(actualMetricDataList, expectedAttributes); + + List statusCountList = ImmutableList.of(new StatusCount(statusCode)); + verifyStatusAttribute(actualMetricDataList, statusCountList); + } + + @Test + void testHttpJson_attemptPermanentFailure_recordsMetrics() throws InterruptedException { + int attemptCount = 1; + Code statusCode = Code.INVALID_ARGUMENT; + BlockRequest blockRequest = + BlockRequest.newBuilder() + .setResponseDelay(Duration.newBuilder().setSeconds(2).build()) + .setError(Status.newBuilder().setCode(statusCode.ordinal()).build()) + .build(); + + assertThrows(InvalidArgumentException.class, () -> httpClient.block(blockRequest)); + + List actualMetricDataList = getMetricDataList(); + verifyPointDataSum(actualMetricDataList, attemptCount); + + Map expectedAttributes = + ImmutableMap.of( + MetricsTracer.METHOD_ATTRIBUTE, + "Echo.Block", + MetricsTracer.LANGUAGE_ATTRIBUTE, + MetricsTracer.DEFAULT_LANGUAGE); + verifyDefaultMetricsAttributes(actualMetricDataList, expectedAttributes); + + List statusCountList = ImmutableList.of(new StatusCount(statusCode)); + verifyStatusAttribute(actualMetricDataList, statusCountList); + } + + @Test + void testGrpc_multipleFailedAttempts_successfulOperation() throws Exception { + int attemptCount = 3; + // Disable Jitter on this test to try and ensure that the there are 3 attempts made + // for test. The first two calls should result in a DEADLINE_EXCEEDED exception as + // 0.5s and 1s are too short for the 1s blocking call (1s still requires time for + // the showcase server to respond back to the client). The 3rd and final call (2s) + // should result in an OK Status Code. + RetrySettings retrySettings = + RetrySettings.newBuilder() + .setInitialRpcTimeout(org.threeten.bp.Duration.ofMillis(500L)) + .setRpcTimeoutMultiplier(2.0) + .setMaxRpcTimeout(org.threeten.bp.Duration.ofMillis(2000L)) + .setTotalTimeout(org.threeten.bp.Duration.ofMillis(6000L)) + .setJittered(false) + .build(); + + EchoStubSettings.Builder grpcEchoSettingsBuilder = EchoStubSettings.newBuilder(); + grpcEchoSettingsBuilder + .blockSettings() + .setRetrySettings(retrySettings) + .setRetryableCodes(ImmutableSet.of(Code.DEADLINE_EXCEEDED)); + EchoSettings grpcEchoSettings = EchoSettings.create(grpcEchoSettingsBuilder.build()); + grpcEchoSettings = + grpcEchoSettings.toBuilder() + .setCredentialsProvider(NoCredentialsProvider.create()) + .setTransportChannelProvider( + EchoSettings.defaultGrpcTransportProviderBuilder() + .setChannelConfigurator(ManagedChannelBuilder::usePlaintext) + .build()) + .setEndpoint("localhost:7469") + .build(); + + EchoStubSettings echoStubSettings = + (EchoStubSettings) + grpcEchoSettings.getStubSettings().toBuilder() + .setTracerFactory( + new MetricsTracerFactory(createOtelMetricsRecorder(inMemoryMetricReader))) + .build(); + EchoStub stub = echoStubSettings.createStub(); + + EchoClient grpcClient = EchoClient.create(stub); + + BlockRequest blockRequest = + BlockRequest.newBuilder() + .setResponseDelay(Duration.newBuilder().setSeconds(1)) + .setSuccess(BlockResponse.newBuilder().setContent("grpcBlockResponse")) + .build(); + + grpcClient.block(blockRequest); + + List actualMetricDataList = getMetricDataList(); + verifyPointDataSum(actualMetricDataList, attemptCount); + + Map expectedAttributes = + ImmutableMap.of( + MetricsTracer.METHOD_ATTRIBUTE, + "Echo.Block", + MetricsTracer.LANGUAGE_ATTRIBUTE, + MetricsTracer.DEFAULT_LANGUAGE); + verifyDefaultMetricsAttributes(actualMetricDataList, expectedAttributes); + + List statusCountList = + ImmutableList.of(new StatusCount(Code.DEADLINE_EXCEEDED, 2), new StatusCount(Code.OK)); + verifyStatusAttribute(actualMetricDataList, statusCountList); + + grpcClient.close(); + grpcClient.awaitTermination(TestClientInitializer.AWAIT_TERMINATION_SECONDS, TimeUnit.SECONDS); + } + + @Test + void testHttpJson_multipleFailedAttempts_successfulOperation() throws Exception { + int attemptCount = 3; + RetrySettings retrySettings = + RetrySettings.newBuilder() + .setInitialRpcTimeout(org.threeten.bp.Duration.ofMillis(500L)) + .setRpcTimeoutMultiplier(2.0) + .setMaxRpcTimeout(org.threeten.bp.Duration.ofMillis(2000L)) + .setTotalTimeout(org.threeten.bp.Duration.ofMillis(6000L)) + .setJittered(false) + .build(); + + EchoStubSettings.Builder httpJsonEchoSettingsBuilder = EchoStubSettings.newHttpJsonBuilder(); + httpJsonEchoSettingsBuilder + .blockSettings() + .setRetrySettings(retrySettings) + .setRetryableCodes(ImmutableSet.of(Code.DEADLINE_EXCEEDED)); + EchoSettings httpJsonEchoSettings = EchoSettings.create(httpJsonEchoSettingsBuilder.build()); + httpJsonEchoSettings = + httpJsonEchoSettings.toBuilder() + .setCredentialsProvider(NoCredentialsProvider.create()) + .setTransportChannelProvider( + EchoSettings.defaultHttpJsonTransportProviderBuilder() + .setHttpTransport( + new NetHttpTransport.Builder().doNotValidateCertificate().build()) + .setEndpoint("http://localhost:7469") + .build()) + .build(); + + EchoStubSettings echoStubSettings = + (EchoStubSettings) + httpJsonEchoSettings.getStubSettings().toBuilder() + .setTracerFactory( + new MetricsTracerFactory(createOtelMetricsRecorder(inMemoryMetricReader))) + .build(); + EchoStub stub = echoStubSettings.createStub(); + + EchoClient httpClient = EchoClient.create(stub); + + BlockRequest blockRequest = + BlockRequest.newBuilder() + .setResponseDelay(Duration.newBuilder().setSeconds(1)) + .setSuccess(BlockResponse.newBuilder().setContent("httpjsonBlockResponse")) + .build(); + + httpClient.block(blockRequest); + + List actualMetricDataList = getMetricDataList(); + verifyPointDataSum(actualMetricDataList, attemptCount); + + Map expectedAttributes = + ImmutableMap.of( + MetricsTracer.METHOD_ATTRIBUTE, + "Echo.Block", + MetricsTracer.LANGUAGE_ATTRIBUTE, + MetricsTracer.DEFAULT_LANGUAGE); + verifyDefaultMetricsAttributes(actualMetricDataList, expectedAttributes); + + httpClient.close(); + httpClient.awaitTermination(TestClientInitializer.AWAIT_TERMINATION_SECONDS, TimeUnit.SECONDS); + } + + @Test + void recordsCustomAttributes() throws InterruptedException, IOException { + InstantiatingGrpcChannelProvider channelProvider = + EchoSettings.defaultGrpcTransportProviderBuilder() + .setChannelConfigurator(ManagedChannelBuilder::usePlaintext) + .setAttemptDirectPathXds() + .build(); + + // Add custom attributes to be added as client level attributes + Map customAttributes = new HashMap<>(); + String directpathEnabled = "directpath_enabled"; + customAttributes.put(directpathEnabled, String.valueOf(channelProvider.canUseDirectPath())); + String directpathXdsEnabled = "directpathxds_enabled"; + customAttributes.put( + directpathXdsEnabled, String.valueOf(channelProvider.isDirectPathXdsEnabled())); + String randomAttributeKey1 = "testing"; + String randomAttributeValue1 = "showcase"; + String randomAttributeKey2 = "hello"; + String randomAttributeValue2 = "world"; + customAttributes.put(randomAttributeKey1, randomAttributeValue1); + customAttributes.put(randomAttributeKey2, randomAttributeValue2); + + InMemoryMetricReader inMemoryMetricReader = InMemoryMetricReader.create(); + OpenTelemetryMetricsRecorder otelMetricsRecorder = + createOtelMetricsRecorder(inMemoryMetricReader); + MetricsTracerFactory metricsTracerFactory = + new MetricsTracerFactory(otelMetricsRecorder, customAttributes); + + EchoSettings grpcEchoSettings = + EchoSettings.newBuilder() + .setCredentialsProvider(NoCredentialsProvider.create()) + .setTransportChannelProvider(channelProvider) + .setEndpoint(TestClientInitializer.DEFAULT_GRPC_ENDPOINT) + .build(); + + EchoStubSettings echoStubSettings = + (EchoStubSettings) + grpcEchoSettings.getStubSettings().toBuilder() + .setTracerFactory(metricsTracerFactory) + .build(); + EchoStub stub = echoStubSettings.createStub(); + EchoClient grpcClient = EchoClient.create(stub); + + EchoRequest echoRequest = EchoRequest.newBuilder().setContent("content").build(); + grpcClient.echo(echoRequest); + + List actualMetricDataList = getMetricDataList(inMemoryMetricReader); + Map expectedAttributes = + ImmutableMap.of( + MetricsTracer.METHOD_ATTRIBUTE, + "Echo.Echo", + MetricsTracer.LANGUAGE_ATTRIBUTE, + MetricsTracer.DEFAULT_LANGUAGE, + directpathEnabled, + "false", + directpathXdsEnabled, + "true", + randomAttributeKey1, + randomAttributeValue1, + randomAttributeKey2, + randomAttributeValue2); + verifyDefaultMetricsAttributes(actualMetricDataList, expectedAttributes); + } + + // This test case uses GrpcOpenTelemetry from grpc-java and includes additional grpc-java specific + // metrics. This test case ensures that the `setSampledToLocalTracing` set to true will ensure + // that + // the gRPC full method name in the stub is recorded (not recorded as `other`). + @Test + void grpcOpenTelemetryImplementation_setSampledToLocalTracing_methodFullNameIsRecorded() + throws Exception { + SdkMeterProvider sdkMeterProvider = + SdkMeterProvider.builder().registerMetricReader(inMemoryMetricReader).build(); + + OpenTelemetry openTelemetry = + OpenTelemetrySdk.builder().setMeterProvider(sdkMeterProvider).build(); + + GrpcOpenTelemetry grpcOpenTelemetry = GrpcOpenTelemetry.newBuilder().sdk(openTelemetry).build(); + + // Java-Spanner configures the InstantiatingGrpcChannelProvider with gRPCOpenTelemetry + // This setup below is copied from their implementation + InstantiatingGrpcChannelProvider.Builder builder = + EchoSettings.defaultGrpcTransportProviderBuilder(); + ApiFunction channelConfigurator = + builder.getChannelConfigurator(); + builder.setChannelConfigurator( + b -> { + b.usePlaintext(); + grpcOpenTelemetry.configureChannelBuilder(b); + if (channelConfigurator != null) { + return channelConfigurator.apply(b); + } + return b; + }); + + OpenTelemetryMetricsRecorder otelMetricsRecorder = + new OpenTelemetryMetricsRecorder(openTelemetry, SERVICE_NAME); + + // Create a custom EchoClient that is different from what is created by default in setup() + EchoClient echoClient = + TestClientInitializer.createGrpcEchoClientOpentelemetry( + new MetricsTracerFactory(otelMetricsRecorder), builder.build()); + + EchoRequest echoRequest = + EchoRequest.newBuilder().setContent("test_grpc_request_succeeded").build(); + echoClient.echo(echoRequest); + + List metricDataList = getMetricDataList(); + + String gRPCMetricNamePrefix = "grpc."; + String gRPCMethodNameAttributeKey = "grpc.method"; + + List grpcMetricDataList = + metricDataList.stream() + .filter(x -> x.getName().startsWith(gRPCMetricNamePrefix)) + .collect(Collectors.toList()); + Truth.assertThat(grpcMetricDataList).isNotEmpty(); + for (MetricData grpcMetricData : grpcMetricDataList) { + List pointDataList = new ArrayList<>(grpcMetricData.getData().getPoints()); + + for (PointData pointData : pointDataList) { + String methodName = + pointData.getAttributes().get(AttributeKey.stringKey(gRPCMethodNameAttributeKey)); + + // All the attributes in the gRPC metrics should have the full method name + Truth.assertThat(methodName).doesNotMatch("other"); + Truth.assertThat(methodName).matches("^google.showcase.v1beta1.Echo/.*$"); + } + } + + echoClient.close(); + echoClient.awaitTermination(TestClientInitializer.AWAIT_TERMINATION_SECONDS, TimeUnit.SECONDS); + } +} diff --git a/java-showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/ITOtelTracing.java b/java-showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/ITOtelTracing.java new file mode 100644 index 0000000000..ddaff08896 --- /dev/null +++ b/java-showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/ITOtelTracing.java @@ -0,0 +1,379 @@ +/* + * Copyright 2026 Google LLC + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Google LLC nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +package com.google.showcase.v1beta1.it; + +import static com.google.common.truth.Truth.assertThat; +import static org.junit.Assert.assertThrows; + +import com.google.api.client.http.javanet.NetHttpTransport; +import com.google.api.gax.core.NoCredentialsProvider; +import com.google.api.gax.retrying.RetrySettings; +import com.google.api.gax.rpc.StatusCode; +import com.google.api.gax.rpc.UnavailableException; +import com.google.api.gax.tracing.ObservabilityAttributes; +import com.google.api.gax.tracing.SpanTracer; +import com.google.api.gax.tracing.SpanTracerFactory; +import com.google.rpc.Status; +import com.google.showcase.v1beta1.EchoClient; +import com.google.showcase.v1beta1.EchoRequest; +import com.google.showcase.v1beta1.EchoSettings; +import com.google.showcase.v1beta1.GetUserRequest; +import com.google.showcase.v1beta1.IdentityClient; +import com.google.showcase.v1beta1.it.util.TestClientInitializer; +import com.google.showcase.v1beta1.stub.EchoStub; +import com.google.showcase.v1beta1.stub.EchoStubSettings; +import io.opentelemetry.api.GlobalOpenTelemetry; +import io.opentelemetry.api.common.AttributeKey; +import io.opentelemetry.api.trace.SpanKind; +import io.opentelemetry.sdk.OpenTelemetrySdk; +import io.opentelemetry.sdk.testing.exporter.InMemorySpanExporter; +import io.opentelemetry.sdk.trace.SdkTracerProvider; +import io.opentelemetry.sdk.trace.data.SpanData; +import io.opentelemetry.sdk.trace.export.SimpleSpanProcessor; +import java.util.List; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; + +class ITOtelTracing { + private static final String SHOWCASE_SERVER_ADDRESS = "localhost"; + private static final long SHOWCASE_SERVER_PORT = 7469; + private static final String SHOWCASE_REPO = "googleapis/sdk-platform-java"; + private static final String SHOWCASE_ARTIFACT = "com.google.cloud:gapic-showcase"; + + private InMemorySpanExporter spanExporter; + private OpenTelemetrySdk openTelemetrySdk; + + @BeforeEach + void setup() { + spanExporter = InMemorySpanExporter.create(); + + SdkTracerProvider tracerProvider = + SdkTracerProvider.builder() + .addSpanProcessor(SimpleSpanProcessor.create(spanExporter)) + .build(); + + openTelemetrySdk = + OpenTelemetrySdk.builder().setTracerProvider(tracerProvider).buildAndRegisterGlobal(); + } + + @AfterEach + void tearDown() { + if (openTelemetrySdk != null) { + openTelemetrySdk.close(); + } + GlobalOpenTelemetry.resetForTest(); + } + + @Test + void testTracing_successfulIdentityGetUser_grpc() throws Exception { + SpanTracerFactory tracingFactory = new SpanTracerFactory(openTelemetrySdk); + + try (IdentityClient client = + TestClientInitializer.createGrpcIdentityClientOpentelemetry(tracingFactory)) { + + try { + client.getUser(GetUserRequest.newBuilder().setName("users/test-user").build()); + } catch (Exception e) { + // Ignored, the showcase server may not have this user, but trace is still generated. + } + + List spans = spanExporter.getFinishedSpanItems(); + assertThat(spans).isNotEmpty(); + + SpanData attemptSpan = + spans.stream() + .filter(span -> span.getName().equals("google.showcase.v1beta1.Identity/GetUser")) + .findFirst() + .orElseThrow(() -> new AssertionError("Incorrect span name")); + assertThat(attemptSpan.getKind()).isEqualTo(SpanKind.CLIENT); + assertThat( + attemptSpan + .getAttributes() + .get(AttributeKey.stringKey(SpanTracer.LANGUAGE_ATTRIBUTE))) + .isEqualTo(SpanTracer.DEFAULT_LANGUAGE); + assertThat( + attemptSpan + .getAttributes() + .get(AttributeKey.stringKey(ObservabilityAttributes.SERVER_ADDRESS_ATTRIBUTE))) + .isEqualTo(SHOWCASE_SERVER_ADDRESS); + assertThat( + attemptSpan + .getAttributes() + .get(AttributeKey.longKey(ObservabilityAttributes.SERVER_PORT_ATTRIBUTE))) + .isEqualTo(SHOWCASE_SERVER_PORT); + assertThat( + attemptSpan + .getAttributes() + .get(AttributeKey.stringKey(ObservabilityAttributes.REPO_ATTRIBUTE))) + .isEqualTo(SHOWCASE_REPO); + assertThat( + attemptSpan + .getAttributes() + .get(AttributeKey.stringKey(ObservabilityAttributes.ARTIFACT_ATTRIBUTE))) + .isEqualTo(SHOWCASE_ARTIFACT); + assertThat( + attemptSpan + .getAttributes() + .get(AttributeKey.stringKey(ObservabilityAttributes.RPC_SYSTEM_NAME_ATTRIBUTE))) + .isEqualTo("grpc"); + assertThat( + attemptSpan + .getAttributes() + .get(AttributeKey.stringKey(ObservabilityAttributes.GRPC_RPC_METHOD_ATTRIBUTE))) + .isEqualTo("google.showcase.v1beta1.Identity/GetUser"); + // {x-version-update-start:gapic-showcase:current} + assertThat( + attemptSpan + .getAttributes() + .get(AttributeKey.stringKey(ObservabilityAttributes.VERSION_ATTRIBUTE))) + .isEqualTo("0.0.0-SNAPSHOT"); + // {x-version-update-end} + assertThat( + attemptSpan + .getAttributes() + .get( + AttributeKey.stringKey( + ObservabilityAttributes.DESTINATION_RESOURCE_ID_ATTRIBUTE))) + .isEqualTo("users/test-user"); + } + } + + @Test + void testTracing_successfulIdentityGetUser_httpjson() throws Exception { + SpanTracerFactory tracingFactory = new SpanTracerFactory(openTelemetrySdk); + + try (IdentityClient client = + TestClientInitializer.createHttpJsonIdentityClientOpentelemetry(tracingFactory)) { + + try { + client.getUser(GetUserRequest.newBuilder().setName("users/test-user").build()); + } catch (Exception e) { + // Ignored, the showcase server may not have this user, but trace is still generated. + } + + List spans = spanExporter.getFinishedSpanItems(); + assertThat(spans).isNotEmpty(); + + SpanData attemptSpan = + spans.stream() + .filter(span -> span.getName().equals("GET v1beta1/{name=users/*}")) + .findFirst() + .orElseThrow( + () -> new AssertionError("Attempt span 'GET v1beta1/{name=users/*}' not found")); + assertThat(attemptSpan.getKind()).isEqualTo(SpanKind.CLIENT); + assertThat( + attemptSpan + .getAttributes() + .get(AttributeKey.stringKey(SpanTracer.LANGUAGE_ATTRIBUTE))) + .isEqualTo(SpanTracer.DEFAULT_LANGUAGE); + assertThat( + attemptSpan + .getAttributes() + .get(AttributeKey.stringKey(ObservabilityAttributes.SERVER_ADDRESS_ATTRIBUTE))) + .isEqualTo(SHOWCASE_SERVER_ADDRESS); + assertThat( + attemptSpan + .getAttributes() + .get(AttributeKey.longKey(ObservabilityAttributes.SERVER_PORT_ATTRIBUTE))) + .isEqualTo(SHOWCASE_SERVER_PORT); + assertThat( + attemptSpan + .getAttributes() + .get(AttributeKey.stringKey(ObservabilityAttributes.REPO_ATTRIBUTE))) + .isEqualTo(SHOWCASE_REPO); + assertThat( + attemptSpan + .getAttributes() + .get(AttributeKey.stringKey(ObservabilityAttributes.ARTIFACT_ATTRIBUTE))) + .isEqualTo(SHOWCASE_ARTIFACT); + assertThat( + attemptSpan + .getAttributes() + .get(AttributeKey.stringKey(ObservabilityAttributes.HTTP_METHOD_ATTRIBUTE))) + .isEqualTo("GET"); + assertThat( + attemptSpan + .getAttributes() + .get(AttributeKey.stringKey(ObservabilityAttributes.HTTP_URL_TEMPLATE_ATTRIBUTE))) + .isEqualTo("v1beta1/{name=users/*}"); + assertThat( + attemptSpan + .getAttributes() + .get( + AttributeKey.stringKey( + ObservabilityAttributes.DESTINATION_RESOURCE_ID_ATTRIBUTE))) + .isEqualTo("users/test-user"); + } + } + + @Test + void testTracing_retry_grpc() throws Exception { + final int attempts = 5; + final StatusCode.Code statusCode = StatusCode.Code.UNAVAILABLE; + // A custom EchoClient is used in this test because retries have jitter, and we cannot + // predict the number of attempts that are scheduled for an RPC invocation otherwise. + // The custom retrySettings limit to a set number of attempts before the call gives up. + RetrySettings retrySettings = + RetrySettings.newBuilder() + .setTotalTimeout(org.threeten.bp.Duration.ofMillis(5000L)) + .setMaxAttempts(attempts) + .build(); + + EchoStubSettings.Builder grpcEchoSettingsBuilder = EchoStubSettings.newBuilder(); + grpcEchoSettingsBuilder + .echoSettings() + .setRetrySettings(retrySettings) + .setRetryableCodes(statusCode); + EchoSettings grpcEchoSettings = EchoSettings.create(grpcEchoSettingsBuilder.build()); + grpcEchoSettings = + grpcEchoSettings.toBuilder() + .setCredentialsProvider(NoCredentialsProvider.create()) + .setTransportChannelProvider(EchoSettings.defaultGrpcTransportProviderBuilder().build()) + .setEndpoint("localhost:7469") + .build(); + + SpanTracerFactory tracingFactory = new SpanTracerFactory(openTelemetrySdk); + + EchoStubSettings echoStubSettings = + (EchoStubSettings) + grpcEchoSettings.getStubSettings().toBuilder().setTracerFactory(tracingFactory).build(); + EchoStub stub = echoStubSettings.createStub(); + EchoClient grpcClient = EchoClient.create(stub); + + EchoRequest echoRequest = + EchoRequest.newBuilder() + .setError(Status.newBuilder().setCode(statusCode.ordinal()).build()) + .build(); + + assertThrows(UnavailableException.class, () -> grpcClient.echo(echoRequest)); + + List spans = spanExporter.getFinishedSpanItems(); + assertThat(spans).hasSize(attempts); // Expect exactly one span for the successful retry + + // This single span represents the successful retry, which has resend_count=1 + // The first attempt has no resend_count. The subsequent retries will have a resend_count, + // starting from 1. + List resendCounts = + spans.stream() + .map( + span -> + (Long) + span.getAttributes() + .asMap() + .get( + AttributeKey.longKey( + ObservabilityAttributes.GRPC_RESEND_COUNT_ATTRIBUTE))) + .filter(java.util.Objects::nonNull) + .sorted() + .collect(java.util.stream.Collectors.toList()); + + List expectedCounts = + java.util.stream.LongStream.range(1, attempts) + .boxed() + .collect(java.util.stream.Collectors.toList()); + assertThat(resendCounts).containsExactlyElementsIn(expectedCounts).inOrder(); + } + + @Test + void testTracing_retry_httpjson() throws Exception { + final int attempts = 5; + final StatusCode.Code statusCode = StatusCode.Code.UNAVAILABLE; + // A custom EchoClient is used in this test because retries have jitter, and we cannot + // predict the number of attempts that are scheduled for an RPC invocation otherwise. + // The custom retrySettings limit to a set number of attempts before the call gives up. + RetrySettings retrySettings = + RetrySettings.newBuilder() + .setTotalTimeout(org.threeten.bp.Duration.ofMillis(5000L)) + .setMaxAttempts(attempts) + .build(); + + EchoStubSettings.Builder httpJsonEchoSettingsBuilder = EchoStubSettings.newHttpJsonBuilder(); + httpJsonEchoSettingsBuilder + .echoSettings() + .setRetrySettings(retrySettings) + .setRetryableCodes(statusCode); + EchoSettings httpJsonEchoSettings = EchoSettings.create(httpJsonEchoSettingsBuilder.build()); + httpJsonEchoSettings = + httpJsonEchoSettings.toBuilder() + .setCredentialsProvider(NoCredentialsProvider.create()) + .setTransportChannelProvider( + EchoSettings.defaultHttpJsonTransportProviderBuilder() + .setHttpTransport( + new NetHttpTransport.Builder().doNotValidateCertificate().build()) + .setEndpoint("http://localhost:7469") + .build()) + .build(); + + SpanTracerFactory tracingFactory = new SpanTracerFactory(openTelemetrySdk); + + EchoStubSettings echoStubSettings = + (EchoStubSettings) + httpJsonEchoSettings.getStubSettings().toBuilder() + .setTracerFactory(tracingFactory) + .build(); + EchoStub stub = echoStubSettings.createStub(); + EchoClient httpClient = EchoClient.create(stub); + + EchoRequest echoRequest = + EchoRequest.newBuilder() + .setError(Status.newBuilder().setCode(statusCode.ordinal()).build()) + .build(); + + assertThrows(UnavailableException.class, () -> httpClient.echo(echoRequest)); + + List spans = spanExporter.getFinishedSpanItems(); + assertThat(spans).hasSize(attempts); // Expect exactly one span for the successful retry + + // This single span represents the successful retry, which has resend_count=1 + // The first attempt has no resend_count. The subsequent retries will have a resend_count, + // starting from 1. + List resendCounts = + spans.stream() + .map( + span -> + (Long) + span.getAttributes() + .asMap() + .get( + AttributeKey.longKey( + ObservabilityAttributes.HTTP_RESEND_COUNT_ATTRIBUTE))) + .filter(java.util.Objects::nonNull) + .sorted() + .collect(java.util.stream.Collectors.toList()); + + List expectedCounts = + java.util.stream.LongStream.range(1, attempts) + .boxed() + .collect(java.util.stream.Collectors.toList()); + assertThat(resendCounts).containsExactlyElementsIn(expectedCounts).inOrder(); + } +} diff --git a/java-showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/ITPagination.java b/java-showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/ITPagination.java new file mode 100644 index 0000000000..ebcabeab9e --- /dev/null +++ b/java-showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/ITPagination.java @@ -0,0 +1,147 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.it; + +import static com.google.common.truth.Truth.assertThat; + +import com.google.showcase.v1beta1.EchoClient; +import com.google.showcase.v1beta1.EchoResponse; +import com.google.showcase.v1beta1.PagedExpandRequest; +import com.google.showcase.v1beta1.it.util.TestClientInitializer; +import java.util.concurrent.TimeUnit; +import org.junit.jupiter.api.AfterAll; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Test; + +class ITPagination { + + private static EchoClient grpcClient; + private static EchoClient httpjsonClient; + + @BeforeAll + static void createClients() throws Exception { + // Create gRPC Echo Client + grpcClient = TestClientInitializer.createGrpcEchoClient(); + // Create Http JSON Echo Client + httpjsonClient = TestClientInitializer.createHttpJsonEchoClient(); + } + + @AfterAll + static void destroyClients() throws InterruptedException { + grpcClient.close(); + httpjsonClient.close(); + + grpcClient.awaitTermination(TestClientInitializer.AWAIT_TERMINATION_SECONDS, TimeUnit.SECONDS); + httpjsonClient.awaitTermination( + TestClientInitializer.AWAIT_TERMINATION_SECONDS, TimeUnit.SECONDS); + } + + // This tests that pagination returns the correct number of pages + responses and that + // the content is correct. + // + // The pageToken is where the streaming responses come back from and the page size denotes + // how many of the responses come back together (in a page). i.e for PageSize = 2 and + // PageToken = 3, see below: + // | A | Series | Of | Words | That | Will | Be | Sent | Back | One | By | One + // Page # | - | - | - | 1 | 1 | 2 | 2 | 3 | 3 | 4 | 4 | 5 + // Token # | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 + @Test + void testPagedExpandWithTokenGrpc() { + int pageSize = 2; + int pageToken = 3; + String content = "A series of words that will be sent back one by one"; + int contentLength = content.split(" ").length; + + EchoClient.PagedExpandPagedResponse pagedExpandPagedResponse = + grpcClient.pagedExpand( + PagedExpandRequest.newBuilder() + .setContent(content) + .setPageSize(pageSize) + .setPageToken(String.valueOf(pageToken)) + .build()); + + String[] expected = content.split(" "); + int numExpectedPages = ((contentLength - pageToken) / pageSize); + // If the responses can't be evenly split into pages, then the extra responses + // will go to an additional page + if ((contentLength - pageToken) % pageSize != 0) { + numExpectedPages++; + } + int numExpectedResponses = contentLength - pageToken; + + validatePagedResponses( + pagedExpandPagedResponse, expected, pageToken, numExpectedResponses, numExpectedPages); + } + + // This tests that pagination returns the correct number of pages + responses and that + // the content is correct. + // + // The pageToken is where the streaming responses come back from and the page size denotes + // how many of the responses come back together (in a page). i.e for PageSize = 2 and + // PageToken = 3, see below: + // | A | Series | Of | Words | That | Will | Be | Sent | Back | One | By | One + // Page # | - | - | - | 1 | 1 | 2 | 2 | 3 | 3 | 4 | 4 | 5 + // Token # | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 + @Test + void testPagedExpandWithTokenHttpJson() { + int pageSize = 2; + int pageToken = 3; + String content = "A series of words that will be sent back one by one"; + int contentLength = content.split(" ").length; + + EchoClient.PagedExpandPagedResponse pagedExpandPagedResponse = + httpjsonClient.pagedExpand( + PagedExpandRequest.newBuilder() + .setContent(content) + .setPageSize(pageSize) + .setPageToken(String.valueOf(pageToken)) + .build()); + + String[] expected = content.split(" "); + int numExpectedPages = ((contentLength - pageToken) / pageSize); + // If the responses can't be evenly split into pages, then the extra responses + // will go to an additional page + if ((contentLength - pageToken) % pageSize != 0) { + numExpectedPages++; + } + int numExpectedResponses = contentLength - pageToken; + + validatePagedResponses( + pagedExpandPagedResponse, expected, pageToken, numExpectedResponses, numExpectedPages); + } + + private void validatePagedResponses( + EchoClient.PagedExpandPagedResponse pagedExpandPagedResponse, + String[] expected, + int pageToken, + int numExpectedResponses, + int numExpectedPages) { + int numResponses = 0; + int numPages = 0; + for (EchoClient.PagedExpandPage page : pagedExpandPagedResponse.iteratePages()) { + for (EchoResponse echoResponse : page.getValues()) { + // Add pageToken as offset to the expected array to start indexing at the pageToken + assertThat(echoResponse.getContent()).isEqualTo(expected[numResponses + pageToken]); + numResponses++; + } + numPages++; + } + + assertThat(numPages).isEqualTo(numExpectedPages); + assertThat(numResponses).isEqualTo(numExpectedResponses); + } +} diff --git a/java-showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/ITProtobuf3Compatibility.java b/java-showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/ITProtobuf3Compatibility.java new file mode 100644 index 0000000000..04582fe7fe --- /dev/null +++ b/java-showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/ITProtobuf3Compatibility.java @@ -0,0 +1,67 @@ +package com.google.showcase.v1beta1.it; + +import static com.google.common.truth.Truth.assertThat; + +import org.junit.jupiter.api.Test; +import org.tensorflow.Graph; +import org.tensorflow.Session; +import org.tensorflow.op.Ops; +import org.tensorflow.op.core.Constant; +import org.tensorflow.op.math.Add; +import org.tensorflow.proto.GraphDef; +import org.tensorflow.types.TInt32; + +/** + * Tensorflow depends on protobuf 3.x gen code and runtime, we test it in showcase module to prove + * that it works with protobuf 4.33+ gen code and runtime that comes with client libraries. + */ +class ITProtobuf3Compatibility { + + @Test + void testTensorflow_helloWorldExample() { + try (Graph graph = new Graph()) { + // Hello world example for "10 + 32" operation. + Ops tf = Ops.create(graph); + + int expectedValue1 = 10; + int expectedValue2 = 32; + int expectedSum = 42; + + String name1 = "constant1"; + String name2 = "constant2"; + + Constant constant1 = tf.withName(name1).constant(expectedValue1); + Constant constant2 = tf.withName(name2).constant(expectedValue2); + + Add sum = tf.math.add(constant1, constant2); + + try (Session s = new Session(graph)) { + try (TInt32 result = (TInt32) s.runner().fetch(sum).run().get(0)) { + int actualResult = result.getInt(); + assertThat(actualResult).isEqualTo(expectedSum); + } + } + + // GraphDef is a protobuf gen code. + GraphDef graphDef = graph.toGraphDef(); + + // Inspect the protobuf gen code + Integer actual1 = getValueFromGraphDefByName(graphDef, name1); + Integer actual2 = getValueFromGraphDefByName(graphDef, name2); + + assertThat(actual1).isEqualTo(expectedValue1); + assertThat(actual2).isEqualTo(expectedValue2); + } + } + + private static Integer getValueFromGraphDefByName(GraphDef graphDef, String name1) { + return graphDef.getNodeList().stream() + .filter(nodeDef -> nodeDef.getName().equals(name1)) + .findFirst() + .get() + .getAttrOrThrow("value") + .getTensor() + .getIntValList() + .get(0); + } +} diff --git a/java-showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/ITServerSideStreaming.java b/java-showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/ITServerSideStreaming.java new file mode 100644 index 0000000000..9d9ccba39e --- /dev/null +++ b/java-showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/ITServerSideStreaming.java @@ -0,0 +1,201 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.it; + +import static com.google.common.truth.Truth.assertThat; +import static org.junit.jupiter.api.Assertions.assertThrows; + +import com.google.api.gax.core.NoCredentialsProvider; +import com.google.api.gax.rpc.CancelledException; +import com.google.api.gax.rpc.ServerStream; +import com.google.api.gax.rpc.StatusCode; +import com.google.api.gax.rpc.WatchdogTimeoutException; +import com.google.common.collect.ImmutableList; +import com.google.rpc.Status; +import com.google.showcase.v1beta1.EchoClient; +import com.google.showcase.v1beta1.EchoResponse; +import com.google.showcase.v1beta1.EchoSettings; +import com.google.showcase.v1beta1.ExpandRequest; +import com.google.showcase.v1beta1.it.util.TestClientInitializer; +import io.grpc.ManagedChannelBuilder; +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; +import java.util.concurrent.TimeUnit; +import java.util.stream.Collectors; +import org.junit.jupiter.api.AfterAll; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; +import org.threeten.bp.Duration; + +class ITServerSideStreaming { + + private static EchoClient grpcClient; + private static EchoClient httpjsonClient; + + @BeforeAll + static void createClients() throws Exception { + // Create gRPC Echo Client + grpcClient = TestClientInitializer.createGrpcEchoClient(); + // Create Http JSON Echo Client + httpjsonClient = TestClientInitializer.createHttpJsonEchoClient(); + } + + @AfterAll + static void destroyClients() throws InterruptedException { + grpcClient.close(); + httpjsonClient.close(); + + grpcClient.awaitTermination(TestClientInitializer.AWAIT_TERMINATION_SECONDS, TimeUnit.SECONDS); + httpjsonClient.awaitTermination( + TestClientInitializer.AWAIT_TERMINATION_SECONDS, TimeUnit.SECONDS); + } + + @Test + void testGrpc_receiveStreamedContent() { + String content = "The rain in Spain stays mainly on the plain!"; + ServerStream responseStream = + grpcClient.expandCallable().call(ExpandRequest.newBuilder().setContent(content).build()); + ArrayList responses = new ArrayList<>(); + for (EchoResponse response : responseStream) { + responses.add(response.getContent()); + } + + assertThat(responses) + .containsExactlyElementsIn( + ImmutableList.of( + "The", "rain", "in", "Spain", "stays", "mainly", "on", "the", "plain!")) + .inOrder(); + } + + @Test + void testGrpc_receiveStreamedContentStreamAPI() { + String content = "The rain in Spain stays mainly on the plain!"; + ServerStream responseStream = + grpcClient.expandCallable().call(ExpandRequest.newBuilder().setContent(content).build()); + assertThat(responseStream.stream().map(EchoResponse::getContent).collect(Collectors.toList())) + .containsExactlyElementsIn( + ImmutableList.of( + "The", "rain", "in", "Spain", "stays", "mainly", "on", "the", "plain!")) + .inOrder(); + } + + @Test + void testGrpc_serverError_receiveErrorAfterLastWordInStream() { + String content = "The rain in Spain"; + Status cancelledStatus = + Status.newBuilder().setCode(StatusCode.Code.CANCELLED.ordinal()).build(); + ServerStream responseStream = + grpcClient + .expandCallable() + .call(ExpandRequest.newBuilder().setContent(content).setError(cancelledStatus).build()); + Iterator echoResponseIterator = responseStream.iterator(); + + assertThat(echoResponseIterator.next().getContent()).isEqualTo("The"); + assertThat(echoResponseIterator.next().getContent()).isEqualTo("rain"); + assertThat(echoResponseIterator.next().getContent()).isEqualTo("in"); + assertThat(echoResponseIterator.next().getContent()).isEqualTo("Spain"); + CancelledException cancelledException = + assertThrows(CancelledException.class, echoResponseIterator::next); + assertThat(cancelledException.getStatusCode().getCode()).isEqualTo(StatusCode.Code.CANCELLED); + } + + @Test + void testGrpc_serverWaitTimeout_watchdogCancelsStream() throws Exception { + EchoSettings.Builder settings = + EchoSettings.newBuilder() + .setCredentialsProvider(NoCredentialsProvider.create()) + .setTransportChannelProvider( + EchoSettings.defaultGrpcTransportProviderBuilder() + .setChannelConfigurator(ManagedChannelBuilder::usePlaintext) + .build()) + .setEndpoint("localhost:7469"); + + settings + .expandSettings() + .setIdleTimeout(Duration.ofMillis(100)) + .setWaitTimeout(Duration.ofMillis(100)); + + settings.getStubSettingsBuilder().setStreamWatchdogCheckInterval(Duration.ofMillis(50)); + + EchoClient echoClient = EchoClient.create(settings.build()); + + String content = "The rain in Spain stays mainly on the plain!"; + ServerStream responseStream = + echoClient + .expandCallable() + .call( + ExpandRequest.newBuilder() + .setContent(content) + // Configure server interval for returning the next response + .setStreamWaitTime( + com.google.protobuf.Duration.newBuilder().setSeconds(1).build()) + .build()); + List responses = new ArrayList<>(); + WatchdogTimeoutException exception = + assertThrows( + WatchdogTimeoutException.class, + () -> responseStream.forEach(x -> responses.add(x.getContent()))); + assertThat(exception) + .hasMessageThat() + .contains("Canceled due to timeout waiting for next response"); + echoClient.close(); + echoClient.awaitTermination(TestClientInitializer.AWAIT_TERMINATION_SECONDS, TimeUnit.SECONDS); + } + + @Test + void testHttpJson_receiveStreamedContent() { + String content = "The rain in Spain stays mainly on the plain!"; + ServerStream responseStream = + httpjsonClient + .expandCallable() + .call(ExpandRequest.newBuilder().setContent(content).build()); + ArrayList responses = new ArrayList<>(); + for (EchoResponse response : responseStream) { + responses.add(response.getContent()); + } + + assertThat(responses) + .containsExactlyElementsIn( + ImmutableList.of( + "The", "rain", "in", "Spain", "stays", "mainly", "on", "the", "plain!")) + .inOrder(); + } + + @Disabled( + value = "Ignore until https://github.com/googleapis/gapic-showcase/issues/1286 is resolved") + @Test + void testHttpJson_serverError_receiveErrorAfterLastWordInStream() { + String content = "The rain in Spain"; + Status cancelledStatus = + Status.newBuilder().setCode(StatusCode.Code.CANCELLED.ordinal()).build(); + ServerStream responseStream = + httpjsonClient + .expandCallable() + .call(ExpandRequest.newBuilder().setContent(content).setError(cancelledStatus).build()); + Iterator echoResponseIterator = responseStream.iterator(); + + assertThat(echoResponseIterator.next().getContent()).isEqualTo("The"); + assertThat(echoResponseIterator.next().getContent()).isEqualTo("rain"); + assertThat(echoResponseIterator.next().getContent()).isEqualTo("in"); + assertThat(echoResponseIterator.next().getContent()).isEqualTo("Spain"); + CancelledException cancelledException = + assertThrows(CancelledException.class, echoResponseIterator::next); + assertThat(cancelledException.getStatusCode().getCode()).isEqualTo(StatusCode.Code.CANCELLED); + } +} diff --git a/java-showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/ITTimeObjectsPropagationTest.java b/java-showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/ITTimeObjectsPropagationTest.java new file mode 100644 index 0000000000..f7f801f627 --- /dev/null +++ b/java-showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/ITTimeObjectsPropagationTest.java @@ -0,0 +1,64 @@ +package com.google.showcase.v1beta1.it; + +import static org.junit.Assert.assertEquals; + +import com.google.api.gax.retrying.RetrySettings; +import org.junit.Test; + +/** + * Tests to confirm that usage of retry settings can be done regardless of whether threeten or + * java.time is being used + */ +public class ITTimeObjectsPropagationTest { + @Test + public void testRetrySettings_fromJavaTimeHasEquivalentThreetenValues() { + java.time.Duration javaTimeCommonValue = java.time.Duration.ofMillis(123l); + org.threeten.bp.Duration threetenConvertedValue = + org.threeten.bp.Duration.ofMillis(javaTimeCommonValue.toMillis()); + RetrySettings javaTimeRetrySettings = + RetrySettings.newBuilder() + .setInitialRetryDelayDuration(javaTimeCommonValue) + .setMaxRetryDelayDuration(javaTimeCommonValue) + .setInitialRpcTimeoutDuration(javaTimeCommonValue) + .setMaxRpcTimeoutDuration(javaTimeCommonValue) + .setTotalTimeoutDuration(javaTimeCommonValue) + .build(); + + assertEquals( + threetenConvertedValue.toMillis(), javaTimeRetrySettings.getInitialRetryDelay().toMillis()); + assertEquals( + threetenConvertedValue.toMillis(), javaTimeRetrySettings.getMaxRetryDelay().toMillis()); + assertEquals( + threetenConvertedValue.toMillis(), javaTimeRetrySettings.getInitialRpcTimeout().toMillis()); + assertEquals( + threetenConvertedValue.toMillis(), javaTimeRetrySettings.getMaxRpcTimeout().toMillis()); + assertEquals( + threetenConvertedValue.toMillis(), javaTimeRetrySettings.getTotalTimeout().toMillis()); + } + + @Test + public void testRetrySettings_fromThreetenHasEquivalentJavaTimeValues() { + org.threeten.bp.Duration threetenCommonValue = org.threeten.bp.Duration.ofMillis(123l); + java.time.Duration javaTimeConvertedValue = + java.time.Duration.ofMillis(threetenCommonValue.toMillis()); + RetrySettings threetenRetrySettings = + RetrySettings.newBuilder() + .setInitialRetryDelay(threetenCommonValue) + .setMaxRetryDelay(threetenCommonValue) + .setInitialRpcTimeout(threetenCommonValue) + .setMaxRpcTimeout(threetenCommonValue) + .setTotalTimeout(threetenCommonValue) + .build(); + + assertEquals( + javaTimeConvertedValue.toMillis(), threetenRetrySettings.getInitialRetryDelay().toMillis()); + assertEquals( + javaTimeConvertedValue.toMillis(), threetenRetrySettings.getMaxRetryDelay().toMillis()); + assertEquals( + javaTimeConvertedValue.toMillis(), threetenRetrySettings.getInitialRpcTimeout().toMillis()); + assertEquals( + javaTimeConvertedValue.toMillis(), threetenRetrySettings.getMaxRpcTimeout().toMillis()); + assertEquals( + javaTimeConvertedValue.toMillis(), threetenRetrySettings.getTotalTimeout().toMillis()); + } +} diff --git a/java-showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/ITUnaryCallable.java b/java-showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/ITUnaryCallable.java new file mode 100644 index 0000000000..4d6018f6fc --- /dev/null +++ b/java-showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/ITUnaryCallable.java @@ -0,0 +1,101 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.it; + +import static com.google.common.truth.Truth.assertThat; +import static org.junit.jupiter.api.Assertions.assertThrows; + +import com.google.api.gax.grpc.GrpcStatusCode; +import com.google.api.gax.rpc.CancelledException; +import com.google.api.gax.rpc.StatusCode; +import com.google.rpc.Status; +import com.google.showcase.v1beta1.EchoClient; +import com.google.showcase.v1beta1.EchoRequest; +import com.google.showcase.v1beta1.EchoResponse; +import com.google.showcase.v1beta1.it.util.TestClientInitializer; +import java.util.concurrent.TimeUnit; +import org.junit.jupiter.api.AfterAll; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Test; + +class ITUnaryCallable { + + private static EchoClient grpcClient; + + private static EchoClient httpjsonClient; + + @BeforeAll + static void createClients() throws Exception { + // Create gRPC Echo Client + grpcClient = TestClientInitializer.createGrpcEchoClient(); + // Create Http JSON Echo Client + httpjsonClient = TestClientInitializer.createHttpJsonEchoClient(); + } + + @AfterAll + static void destroyClients() throws InterruptedException { + grpcClient.close(); + httpjsonClient.close(); + + grpcClient.awaitTermination(TestClientInitializer.AWAIT_TERMINATION_SECONDS, TimeUnit.SECONDS); + httpjsonClient.awaitTermination( + TestClientInitializer.AWAIT_TERMINATION_SECONDS, TimeUnit.SECONDS); + } + + @Test + void testGrpc_receiveContent() { + assertThat(echoGrpc("grpc-echo?")).isEqualTo("grpc-echo?"); + assertThat(echoGrpc("grpc-echo!")).isEqualTo("grpc-echo!"); + } + + @Test + void testGrpc_serverResponseError_throwsException() { + Status cancelledStatus = + Status.newBuilder().setCode(StatusCode.Code.CANCELLED.ordinal()).build(); + EchoRequest requestWithServerError = EchoRequest.newBuilder().setError(cancelledStatus).build(); + CancelledException exception = + assertThrows(CancelledException.class, () -> grpcClient.echo(requestWithServerError)); + assertThat(exception.getStatusCode().getCode()).isEqualTo(GrpcStatusCode.Code.CANCELLED); + } + + @Test + void testHttpJson_receiveContent() { + assertThat(echoHttpJson("http-echo?")).isEqualTo("http-echo?"); + assertThat(echoHttpJson("http-echo!")).isEqualTo("http-echo!"); + } + + @Test + void testHttpJson_serverResponseError_throwsException() { + EchoRequest requestWithServerError = + EchoRequest.newBuilder() + .setError(Status.newBuilder().setCode(StatusCode.Code.CANCELLED.ordinal()).build()) + .build(); + CancelledException exception = + assertThrows(CancelledException.class, () -> httpjsonClient.echo(requestWithServerError)); + assertThat(exception.getStatusCode().getCode()).isEqualTo(StatusCode.Code.CANCELLED); + } + + private String echoGrpc(String value) { + EchoResponse response = grpcClient.echo(EchoRequest.newBuilder().setContent(value).build()); + return response.getContent(); + } + + private String echoHttpJson(String value) { + EchoResponse response = httpjsonClient.echo(EchoRequest.newBuilder().setContent(value).build()); + return response.getContent(); + } +} diff --git a/java-showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/ITUnaryDeadline.java b/java-showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/ITUnaryDeadline.java new file mode 100644 index 0000000000..984598bc9e --- /dev/null +++ b/java-showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/ITUnaryDeadline.java @@ -0,0 +1,368 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.showcase.v1beta1.it; + +import static com.google.common.truth.Truth.assertThat; +import static org.junit.jupiter.api.Assertions.assertThrows; + +import com.google.api.gax.retrying.RetrySettings; +import com.google.api.gax.retrying.RetryingFuture; +import com.google.api.gax.rpc.DeadlineExceededException; +import com.google.api.gax.rpc.StatusCode; +import com.google.common.collect.ImmutableSet; +import com.google.showcase.v1beta1.BlockRequest; +import com.google.showcase.v1beta1.BlockResponse; +import com.google.showcase.v1beta1.EchoClient; +import com.google.showcase.v1beta1.it.util.TestClientInitializer; +import java.util.concurrent.ExecutionException; +import java.util.concurrent.TimeUnit; +import org.junit.jupiter.api.Test; +import org.threeten.bp.Duration; + +/** + * For this test, we test a combination of various RetrySettings to try and ensure that the timeouts + * set by the customer are cancelled when timeouts have exceeded their limits + * + *

        Each test attempts to get the number of attempts done in each call. The attemptCount is + * incremented by 1 as the first attempt is zero indexed. + */ +class ITUnaryDeadline { + + @Test + void testGRPC_unarySuccessfulResponse_doesNotExceedTotalTimeout() throws Exception { + RetrySettings defaultNoRetrySettings = + RetrySettings.newBuilder() + .setInitialRpcTimeout(Duration.ofMillis(5000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ofMillis(5000L)) + .setTotalTimeout(Duration.ofMillis(5000L)) + // Explicitly set retries as disabled (maxAttempts == 1) + .setMaxAttempts(1) + .build(); + EchoClient grpcClient = + TestClientInitializer.createGrpcEchoClientCustomBlockSettings( + defaultNoRetrySettings, ImmutableSet.of(StatusCode.Code.DEADLINE_EXCEEDED)); + try { + BlockRequest blockRequest = + BlockRequest.newBuilder() + .setSuccess(BlockResponse.newBuilder().setContent("gRPCBlockContent_3sDelay_noRetry")) + .setResponseDelay(com.google.protobuf.Duration.newBuilder().setSeconds(3).build()) + .build(); + RetryingFuture retryingFuture = + (RetryingFuture) grpcClient.blockCallable().futureCall(blockRequest); + BlockResponse blockResponse = retryingFuture.get(10, TimeUnit.SECONDS); + assertThat(blockResponse.getContent()).isEqualTo("gRPCBlockContent_3sDelay_noRetry"); + // Guarantee that this only runs once + int attemptCount = retryingFuture.getAttemptSettings().getAttemptCount() + 1; + assertThat(attemptCount).isEqualTo(1); + } finally { + grpcClient.close(); + grpcClient.awaitTermination( + TestClientInitializer.AWAIT_TERMINATION_SECONDS, TimeUnit.SECONDS); + } + } + + @Test + void testHttpJson_unarySuccessfulResponse_doesNotExceedTotalTimeout() throws Exception { + RetrySettings defaultNoRetrySettings = + RetrySettings.newBuilder() + .setInitialRpcTimeout(Duration.ofMillis(5000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ofMillis(5000L)) + .setTotalTimeout(Duration.ofMillis(5000L)) + // Explicitly set retries as disabled (maxAttempts == 1) + .setMaxAttempts(1) + .build(); + EchoClient httpjsonClient = + TestClientInitializer.createHttpJsonEchoClientCustomBlockSettings( + defaultNoRetrySettings, ImmutableSet.of(StatusCode.Code.DEADLINE_EXCEEDED)); + try { + BlockRequest blockRequest = + BlockRequest.newBuilder() + .setSuccess( + BlockResponse.newBuilder().setContent("httpjsonBlockContent_3sDelay_noRetry")) + .setResponseDelay(com.google.protobuf.Duration.newBuilder().setSeconds(3).build()) + .build(); + RetryingFuture retryingFuture = + (RetryingFuture) httpjsonClient.blockCallable().futureCall(blockRequest); + BlockResponse blockResponse = retryingFuture.get(10, TimeUnit.SECONDS); + assertThat(blockResponse.getContent()).isEqualTo("httpjsonBlockContent_3sDelay_noRetry"); + // Guarantee that this only runs once + int attemptCount = retryingFuture.getAttemptSettings().getAttemptCount() + 1; + assertThat(attemptCount).isEqualTo(1); + } finally { + httpjsonClient.close(); + httpjsonClient.awaitTermination( + TestClientInitializer.AWAIT_TERMINATION_SECONDS, TimeUnit.SECONDS); + } + } + + // Retry is configured by setting the initial RPC timeout (1.5s) to be less than + // the RPC delay (2s). The next RPC timeout (3s) will wait long enough for the delay. + @Test + void testGRPC_unarySuccessfulResponse_exceedsRPCDeadlineButWithinTotalTimeout() throws Exception { + RetrySettings defaultRetrySettings = + RetrySettings.newBuilder() + .setInitialRpcTimeout(Duration.ofMillis(1500L)) + .setRpcTimeoutMultiplier(2.0) + .setMaxRpcTimeout(Duration.ofMillis(3000L)) + .setTotalTimeout(Duration.ofMillis(5000L)) + .build(); + EchoClient grpcClient = + TestClientInitializer.createGrpcEchoClientCustomBlockSettings( + defaultRetrySettings, ImmutableSet.of(StatusCode.Code.DEADLINE_EXCEEDED)); + try { + BlockRequest blockRequest = + BlockRequest.newBuilder() + .setSuccess(BlockResponse.newBuilder().setContent("gRPCBlockContent_2sDelay_Retry")) + .setResponseDelay(com.google.protobuf.Duration.newBuilder().setSeconds(2).build()) + .build(); + RetryingFuture retryingFuture = + (RetryingFuture) grpcClient.blockCallable().futureCall(blockRequest); + BlockResponse blockResponse = retryingFuture.get(10, TimeUnit.SECONDS); + assertThat(blockResponse.getContent()).isEqualTo("gRPCBlockContent_2sDelay_Retry"); + // Guarantee that this only runs twice + int attemptCount = retryingFuture.getAttemptSettings().getAttemptCount() + 1; + assertThat(attemptCount).isEqualTo(2); + } finally { + grpcClient.close(); + grpcClient.awaitTermination( + TestClientInitializer.AWAIT_TERMINATION_SECONDS, TimeUnit.SECONDS); + } + } + + // Retry is configured by setting the initial RPC timeout (1.5s) to be less than + // the RPC delay (2s). The next RPC timeout (3s) will wait long enough for the delay. + @Test + void testHttpJson_unarySuccessfulResponse_exceedsRPCDeadlineButWithinTotalTimeout() + throws Exception { + RetrySettings defaultRetrySettings = + RetrySettings.newBuilder() + .setInitialRpcTimeout(Duration.ofMillis(1500L)) + .setRpcTimeoutMultiplier(2.0) + .setMaxRpcTimeout(Duration.ofMillis(3000L)) + .setTotalTimeout(Duration.ofMillis(5000L)) + .build(); + EchoClient httpjsonClient = + TestClientInitializer.createHttpJsonEchoClientCustomBlockSettings( + defaultRetrySettings, ImmutableSet.of(StatusCode.Code.DEADLINE_EXCEEDED)); + try { + BlockRequest blockRequest = + BlockRequest.newBuilder() + .setSuccess( + BlockResponse.newBuilder().setContent("httpjsonBlockContent_2sDelay_Retry")) + .setResponseDelay(com.google.protobuf.Duration.newBuilder().setSeconds(2).build()) + .build(); + RetryingFuture retryingFuture = + (RetryingFuture) httpjsonClient.blockCallable().futureCall(blockRequest); + BlockResponse blockResponse = retryingFuture.get(10, TimeUnit.SECONDS); + assertThat(blockResponse.getContent()).isEqualTo("httpjsonBlockContent_2sDelay_Retry"); + // Guarantee that this only runs twice + int attemptCount = retryingFuture.getAttemptSettings().getAttemptCount() + 1; + assertThat(attemptCount).isEqualTo(2); + } finally { + httpjsonClient.close(); + httpjsonClient.awaitTermination( + TestClientInitializer.AWAIT_TERMINATION_SECONDS, TimeUnit.SECONDS); + } + } + + // Request is set to block for 6 seconds to allow the RPC to timeout. If retries are + // disabled, the RPC timeout is set to be the totalTimeout (5s). + @Test + void + testGRPC_unaryUnsuccessfulResponse_exceedsRPCTimeoutAndTotalTimeout_throwsDeadlineExceededException() + throws Exception { + RetrySettings defaultNoRetrySettings = + RetrySettings.newBuilder() + .setInitialRpcTimeout(Duration.ofMillis(5000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ofMillis(5000L)) + .setTotalTimeout(Duration.ofMillis(5000L)) + // Explicitly set retries as disabled (maxAttempts == 1) + .setMaxAttempts(1) + .build(); + EchoClient grpcClient = + TestClientInitializer.createGrpcEchoClientCustomBlockSettings( + defaultNoRetrySettings, ImmutableSet.of(StatusCode.Code.DEADLINE_EXCEEDED)); + try { + BlockRequest blockRequest = + BlockRequest.newBuilder() + .setSuccess(BlockResponse.newBuilder().setContent("gRPCBlockContent_6sDelay_noRetry")) + .setResponseDelay(com.google.protobuf.Duration.newBuilder().setSeconds(6).build()) + .build(); + RetryingFuture retryingFuture = + (RetryingFuture) grpcClient.blockCallable().futureCall(blockRequest); + ExecutionException exception = + assertThrows(ExecutionException.class, () -> retryingFuture.get(10, TimeUnit.SECONDS)); + assertThat(exception.getCause()).isInstanceOf(DeadlineExceededException.class); + DeadlineExceededException deadlineExceededException = + (DeadlineExceededException) exception.getCause(); + assertThat(deadlineExceededException.getStatusCode().getCode()) + .isEqualTo(StatusCode.Code.DEADLINE_EXCEEDED); + // We can guarantee that this only runs once + int attemptCount = retryingFuture.getAttemptSettings().getAttemptCount() + 1; + assertThat(attemptCount).isEqualTo(1); + } finally { + grpcClient.close(); + grpcClient.awaitTermination( + TestClientInitializer.AWAIT_TERMINATION_SECONDS, TimeUnit.SECONDS); + } + } + + // Request is set to block for 6 seconds to allow the RPC to timeout. If retries are + // disabled, the RPC timeout is set to be the totalTimeout (5s). + @Test + void + testHttpJson_unaryUnsuccessfulResponse_exceedsRPCTimeoutAndTotalTimeout_throwsDeadlineExceededException() + throws Exception { + RetrySettings defaultNoRetrySettings = + RetrySettings.newBuilder() + .setInitialRpcTimeout(Duration.ofMillis(5000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ofMillis(5000L)) + .setTotalTimeout(Duration.ofMillis(5000L)) + // Explicitly set retries as disabled (maxAttempts == 1) + .setMaxAttempts(1) + .build(); + EchoClient httpjsonClient = + TestClientInitializer.createHttpJsonEchoClientCustomBlockSettings( + defaultNoRetrySettings, ImmutableSet.of(StatusCode.Code.DEADLINE_EXCEEDED)); + try { + BlockRequest blockRequest = + BlockRequest.newBuilder() + .setSuccess( + BlockResponse.newBuilder().setContent("httpjsonBlockContent_6sDelay_noRetry")) + .setResponseDelay(com.google.protobuf.Duration.newBuilder().setSeconds(6).build()) + .build(); + RetryingFuture retryingFuture = + (RetryingFuture) httpjsonClient.blockCallable().futureCall(blockRequest); + ExecutionException exception = + assertThrows(ExecutionException.class, () -> retryingFuture.get(10, TimeUnit.SECONDS)); + assertThat(exception.getCause()).isInstanceOf(DeadlineExceededException.class); + DeadlineExceededException deadlineExceededException = + (DeadlineExceededException) exception.getCause(); + assertThat(deadlineExceededException.getStatusCode().getCode()) + .isEqualTo(StatusCode.Code.DEADLINE_EXCEEDED); + // We can guarantee that this only runs once + int attemptCount = retryingFuture.getAttemptSettings().getAttemptCount() + 1; + assertThat(attemptCount).isEqualTo(1); + } finally { + httpjsonClient.close(); + httpjsonClient.awaitTermination( + TestClientInitializer.AWAIT_TERMINATION_SECONDS, TimeUnit.SECONDS); + } + } + + // The purpose of this test is to ensure that the deadlineScheduleExecutor is able + // to properly cancel the HttpRequest for each retry attempt. This test attempts to + // make a call every 100ms for 1 second. If the requestRunnable blocks until we + // receive a response from the server (200ms) regardless of it was cancelled, then + // we would expect at most 50 responses. + @Test + void testGRPC_unaryCallableRetry_deadlineExecutorTimesOutRequest_throwsDeadlineExceededException() + throws Exception { + RetrySettings defaultRetrySettings = + RetrySettings.newBuilder() + .setInitialRpcTimeout(Duration.ofMillis(100L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ofMillis(100L)) + .setTotalTimeout(Duration.ofMillis(1000L)) + .build(); + EchoClient grpcClient = + TestClientInitializer.createGrpcEchoClientCustomBlockSettings( + defaultRetrySettings, ImmutableSet.of(StatusCode.Code.DEADLINE_EXCEEDED)); + try { + BlockRequest blockRequest = + BlockRequest.newBuilder() + .setSuccess( + BlockResponse.newBuilder().setContent("gRPCBlockContent_200msDelay_Retry")) + // Set the timeout to be longer than the RPC timeout + .setResponseDelay( + com.google.protobuf.Duration.newBuilder().setNanos(200000000).build()) + .build(); + RetryingFuture retryingFuture = + (RetryingFuture) grpcClient.blockCallable().futureCall(blockRequest); + ExecutionException exception = + assertThrows(ExecutionException.class, () -> retryingFuture.get(10, TimeUnit.SECONDS)); + assertThat(exception.getCause()).isInstanceOf(DeadlineExceededException.class); + DeadlineExceededException deadlineExceededException = + (DeadlineExceededException) exception.getCause(); + assertThat(deadlineExceededException.getStatusCode().getCode()) + .isEqualTo(StatusCode.Code.DEADLINE_EXCEEDED); + // We cannot guarantee the number of attempts. The RetrySettings should be configured + // such that there is no delay between the attempts, but the execution takes time + // to run. Theoretically this should run exactly 100 times. + int attemptCount = retryingFuture.getAttemptSettings().getAttemptCount() + 1; + assertThat(attemptCount).isGreaterThan(5); + assertThat(attemptCount).isAtMost(10); + } finally { + grpcClient.close(); + grpcClient.awaitTermination( + TestClientInitializer.AWAIT_TERMINATION_SECONDS, TimeUnit.SECONDS); + } + } + + // The purpose of this test is to ensure that the deadlineScheduleExecutor is able + // to properly cancel the HttpRequest for each retry attempt. This test attempts to + // make a call every 100ms for 1 second. If the requestRunnable blocks until we + // receive a response from the server (200ms) regardless of it was cancelled, then + // we would expect at most 50 responses. + @Test + void + testHttpJson_unaryCallableRetry_deadlineExecutorTimesOutRequest_throwsDeadlineExceededException() + throws Exception { + RetrySettings defaultRetrySettings = + RetrySettings.newBuilder() + .setInitialRpcTimeout(Duration.ofMillis(100L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ofMillis(100L)) + .setTotalTimeout(Duration.ofMillis(10000L)) + .build(); + EchoClient httpjsonClient = + TestClientInitializer.createHttpJsonEchoClientCustomBlockSettings( + defaultRetrySettings, ImmutableSet.of(StatusCode.Code.DEADLINE_EXCEEDED)); + try { + BlockRequest blockRequest = + BlockRequest.newBuilder() + .setSuccess( + BlockResponse.newBuilder().setContent("httpjsonBlockContent_200msDelay_Retry")) + // Set the timeout to be longer than the RPC timeout + .setResponseDelay( + com.google.protobuf.Duration.newBuilder().setNanos(200000000).build()) + .build(); + RetryingFuture retryingFuture = + (RetryingFuture) httpjsonClient.blockCallable().futureCall(blockRequest); + ExecutionException exception = + assertThrows(ExecutionException.class, () -> retryingFuture.get(15, TimeUnit.SECONDS)); + assertThat(exception.getCause()).isInstanceOf(DeadlineExceededException.class); + DeadlineExceededException deadlineExceededException = + (DeadlineExceededException) exception.getCause(); + assertThat(deadlineExceededException.getStatusCode().getCode()) + .isEqualTo(StatusCode.Code.DEADLINE_EXCEEDED); + // We cannot guarantee the number of attempts. The RetrySettings should be configured + // such that there is no delay between the attempts, but the execution takes time + // to run. Theoretically this should run exactly 100 times. + int attemptCount = retryingFuture.getAttemptSettings().getAttemptCount() + 1; + assertThat(attemptCount).isGreaterThan(80); + assertThat(attemptCount).isAtMost(100); + } finally { + httpjsonClient.close(); + httpjsonClient.awaitTermination( + TestClientInitializer.AWAIT_TERMINATION_SECONDS, TimeUnit.SECONDS); + } + } +} diff --git a/java-showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/ITVersionHeaders.java b/java-showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/ITVersionHeaders.java new file mode 100644 index 0000000000..1cf9f0f577 --- /dev/null +++ b/java-showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/ITVersionHeaders.java @@ -0,0 +1,249 @@ +/* + * 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 + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.showcase.v1beta1.it; + +import static com.google.common.truth.Truth.assertThat; +import static org.junit.jupiter.api.Assertions.assertThrows; +import static org.junit.jupiter.api.Assertions.assertTrue; + +import com.google.api.gax.httpjson.*; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.FixedHeaderProvider; +import com.google.api.gax.rpc.StubSettings; +import com.google.common.collect.ImmutableList; +import com.google.showcase.v1beta1.*; +import com.google.showcase.v1beta1.it.util.GrpcCapturingClientInterceptor; +import com.google.showcase.v1beta1.it.util.HttpJsonCapturingClientInterceptor; +import com.google.showcase.v1beta1.it.util.TestClientInitializer; +import com.google.showcase.v1beta1.stub.ComplianceStubSettings; +import com.google.showcase.v1beta1.stub.EchoStubSettings; +import io.grpc.*; +import java.io.IOException; +import java.util.ArrayList; +import java.util.concurrent.TimeUnit; +import java.util.regex.Pattern; +import org.junit.jupiter.api.AfterAll; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Test; + +// TODO: add testing on error responses once feat is implemented in showcase. +// https://github.com/googleapis/gapic-showcase/pull/1456 +// TODO: watch for showcase gRPC trailer changes suggested in +// https://github.com/googleapis/gapic-showcase/pull/1509#issuecomment-2089147103 +class ITVersionHeaders { + private static final String HTTP_RESPONSE_HEADER_STRING = + "x-showcase-request-" + ApiClientHeaderProvider.API_VERSION_HEADER_KEY; + private static final String HTTP_CLIENT_API_HEADER_KEY = + "x-showcase-request-" + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(); + private static final Metadata.Key API_VERSION_HEADER_KEY = + Metadata.Key.of( + ApiClientHeaderProvider.API_VERSION_HEADER_KEY, Metadata.ASCII_STRING_MARSHALLER); + + private static final Metadata.Key API_CLIENT_HEADER_KEY = + Metadata.Key.of( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), Metadata.ASCII_STRING_MARSHALLER); + + private static final String EXPECTED_ECHO_API_VERSION = "v1_20240408"; + private static final String CUSTOM_API_VERSION = "user-supplied-version"; + private static final String EXPECTED_EXCEPTION_MESSAGE = + "Header provider can't override the header: " + + ApiClientHeaderProvider.API_VERSION_HEADER_KEY; + + private static HttpJsonCapturingClientInterceptor httpJsonInterceptor; + private static GrpcCapturingClientInterceptor grpcInterceptor; + private static HttpJsonCapturingClientInterceptor httpJsonComplianceInterceptor; + private static GrpcCapturingClientInterceptor grpcComplianceInterceptor; + private static EchoClient grpcClient; + private static EchoClient httpJsonClient; + private static ComplianceClient grpcComplianceClient; + private static ComplianceClient httpJsonComplianceClient; + + @BeforeAll + static void createClients() throws Exception { + // Create gRPC Interceptor and Client + grpcInterceptor = new GrpcCapturingClientInterceptor(); + grpcClient = TestClientInitializer.createGrpcEchoClient(ImmutableList.of(grpcInterceptor)); + + // Create HttpJson Interceptor and Client + httpJsonInterceptor = new HttpJsonCapturingClientInterceptor(); + httpJsonClient = + TestClientInitializer.createHttpJsonEchoClient(ImmutableList.of(httpJsonInterceptor)); + + // Create gRPC ComplianceClient and Interceptor + // Creating a compliance client to test case where api version is not set + grpcComplianceInterceptor = new GrpcCapturingClientInterceptor(); + grpcComplianceClient = + TestClientInitializer.createGrpcComplianceClient( + ImmutableList.of(grpcComplianceInterceptor)); + + // Create HttpJson ComplianceClient and Interceptor + httpJsonComplianceInterceptor = new HttpJsonCapturingClientInterceptor(); + httpJsonComplianceClient = + TestClientInitializer.createHttpJsonComplianceClient( + ImmutableList.of(httpJsonComplianceInterceptor)); + } + + @AfterAll + static void destroyClient() throws InterruptedException { + grpcClient.close(); + httpJsonClient.close(); + grpcComplianceClient.close(); + httpJsonComplianceClient.close(); + + grpcClient.awaitTermination(TestClientInitializer.AWAIT_TERMINATION_SECONDS, TimeUnit.SECONDS); + httpJsonClient.awaitTermination( + TestClientInitializer.AWAIT_TERMINATION_SECONDS, TimeUnit.SECONDS); + grpcComplianceClient.awaitTermination( + TestClientInitializer.AWAIT_TERMINATION_SECONDS, TimeUnit.SECONDS); + httpJsonComplianceClient.awaitTermination( + TestClientInitializer.AWAIT_TERMINATION_SECONDS, TimeUnit.SECONDS); + } + + @Test + void testGrpc_matchesApiVersion() { + grpcClient.echo(EchoRequest.newBuilder().build()); + String headerValue = grpcInterceptor.metadata.get(API_VERSION_HEADER_KEY); + assertThat(headerValue).isEqualTo(EXPECTED_ECHO_API_VERSION); + } + + @Test + void testHttpJson_matchesHeaderName() { + httpJsonClient.echo(EchoRequest.newBuilder().build()); + ArrayList headerValues = + (ArrayList) httpJsonInterceptor.metadata.getHeaders().get(HTTP_RESPONSE_HEADER_STRING); + String headerValue = (String) headerValues.get(0); + assertThat(headerValue).isEqualTo(EXPECTED_ECHO_API_VERSION); + } + + @Test + void testGrpc_noApiVersion() { + RepeatRequest request = + RepeatRequest.newBuilder().setInfo(ComplianceData.newBuilder().setFString("test")).build(); + grpcComplianceClient.repeatDataSimplePath(request); + assertThat(API_VERSION_HEADER_KEY).isNotIn(grpcComplianceInterceptor.metadata.keys()); + } + + @Test + void testHttpJson_noApiVersion() { + RepeatRequest request = + RepeatRequest.newBuilder().setInfo(ComplianceData.newBuilder().setFString("test")).build(); + httpJsonComplianceClient.repeatDataSimplePath(request); + assertThat(API_VERSION_HEADER_KEY) + .isNotIn(httpJsonComplianceInterceptor.metadata.getHeaders().keySet()); + } + + @Test + void testGrpcEcho_userApiVersionThrowsException() throws IOException { + StubSettings stubSettings = + grpcClient.getSettings().getStubSettings().toBuilder() + .setHeaderProvider( + FixedHeaderProvider.create( + ApiClientHeaderProvider.API_VERSION_HEADER_KEY, CUSTOM_API_VERSION)) + .build(); + + IllegalArgumentException exception = + assertThrows( + IllegalArgumentException.class, + () -> EchoClient.create(EchoSettings.create((EchoStubSettings) stubSettings))); + assertThat(exception.getMessage()).isEqualTo(EXPECTED_EXCEPTION_MESSAGE); + } + + @Test + void testHttpJsonEcho_userApiVersionThrowsException() throws IOException { + StubSettings stubSettings = + httpJsonClient.getSettings().getStubSettings().toBuilder() + .setHeaderProvider( + FixedHeaderProvider.create( + ApiClientHeaderProvider.API_VERSION_HEADER_KEY, CUSTOM_API_VERSION)) + .build(); + + IllegalArgumentException exception = + assertThrows( + IllegalArgumentException.class, + () -> EchoClient.create(EchoSettings.create((EchoStubSettings) stubSettings))); + assertThat(exception.getMessage()).isEqualTo(EXPECTED_EXCEPTION_MESSAGE); + } + + @Test + void testGrpcCompliance_userApiVersionSetSuccess() throws IOException { + StubSettings stubSettingsWithApiVersionHeader = + grpcComplianceClient.getSettings().getStubSettings().toBuilder() + .setHeaderProvider( + FixedHeaderProvider.create( + ApiClientHeaderProvider.API_VERSION_HEADER_KEY, CUSTOM_API_VERSION)) + .build(); + try (ComplianceClient customComplianceClient = + ComplianceClient.create( + ComplianceSettings.create((ComplianceStubSettings) stubSettingsWithApiVersionHeader))) { + + RepeatRequest request = + RepeatRequest.newBuilder() + .setInfo(ComplianceData.newBuilder().setFString("test")) + .build(); + customComplianceClient.repeatDataSimplePath(request); + String headerValue = grpcComplianceInterceptor.metadata.get(API_VERSION_HEADER_KEY); + assertThat(headerValue).isEqualTo(CUSTOM_API_VERSION); + } + } + + @Test + void testHttpJsonCompliance_userApiVersionSetSuccess() throws IOException { + StubSettings httpJsonStubSettingsWithApiVersionHeader = + httpJsonComplianceClient.getSettings().getStubSettings().toBuilder() + .setHeaderProvider( + FixedHeaderProvider.create( + ApiClientHeaderProvider.API_VERSION_HEADER_KEY, CUSTOM_API_VERSION)) + .build(); + try (ComplianceClient customComplianceClient = + ComplianceClient.create( + ComplianceSettings.create( + (ComplianceStubSettings) httpJsonStubSettingsWithApiVersionHeader))) { + + RepeatRequest request = + RepeatRequest.newBuilder() + .setInfo(ComplianceData.newBuilder().setFString("test")) + .build(); + customComplianceClient.repeatDataSimplePath(request); + + ArrayList headerValues = + (ArrayList) + httpJsonComplianceInterceptor.metadata.getHeaders().get(HTTP_RESPONSE_HEADER_STRING); + String headerValue = (String) headerValues.get(0); + assertThat(headerValue).isEqualTo(CUSTOM_API_VERSION); + } + } + + @Test + void testGrpcCall_sendsCorrectApiClientHeader() { + Pattern defautlGrpcHeaderPattern = + Pattern.compile("gl-java/.* gapic/.*?--protobuf-\\d.* gax/.* grpc/.* protobuf/\\d.*"); + grpcClient.echo(EchoRequest.newBuilder().build()); + String headerValue = grpcInterceptor.metadata.get(API_CLIENT_HEADER_KEY); + assertTrue(defautlGrpcHeaderPattern.matcher(headerValue).matches()); + } + + @Test + void testHttpJson_sendsCorrectApiClientHeader() { + Pattern defautlHttpHeaderPattern = + Pattern.compile("gl-java/.* gapic/.*?--protobuf-\\d.* gax/.* rest/ protobuf/\\d.*"); + httpJsonClient.echo(EchoRequest.newBuilder().build()); + ArrayList headerValues = + (ArrayList) + httpJsonInterceptor.metadata.getHeaders().get(HTTP_CLIENT_API_HEADER_KEY); + String headerValue = headerValues.get(0); + assertTrue(defautlHttpHeaderPattern.matcher(headerValue).matches()); + } +} diff --git a/java-showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/logging/ITLogging.java b/java-showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/logging/ITLogging.java new file mode 100644 index 0000000000..5979b88c41 --- /dev/null +++ b/java-showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/logging/ITLogging.java @@ -0,0 +1,257 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.it.logging; + +import static com.google.common.truth.Truth.assertThat; + +import ch.qos.logback.classic.Level; +import ch.qos.logback.classic.spi.ILoggingEvent; +import com.google.api.gax.grpc.GrpcLoggingInterceptor; +import com.google.api.gax.httpjson.HttpJsonLoggingInterceptor; +import com.google.common.collect.ImmutableMap; +import com.google.showcase.v1beta1.EchoClient; +import com.google.showcase.v1beta1.EchoRequest; +import com.google.showcase.v1beta1.EchoResponse; +import com.google.showcase.v1beta1.it.util.TestClientInitializer; +import java.util.List; +import java.util.Map; +import java.util.concurrent.TimeUnit; +import org.junit.jupiter.api.AfterAll; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Test; +import org.slf4j.LoggerFactory; +import org.slf4j.event.KeyValuePair; + +// This test needs to run with GOOGLE_SDK_JAVA_LOGGING=true +// mvn clean verify -P '!showcase,enable-integration-tests,loggingTestBase,slf4j2_logback' +public class ITLogging { + private static EchoClient grpcClient; + + private static EchoClient httpjsonClient; + + private static final KeyValuePair SERVICE_NAME_KEY_VALUE_PAIR = + new KeyValuePair("serviceName", "google.showcase.v1beta1.Echo"); + private static final KeyValuePair RPC_NAME_KEY_VALUE_PAIR = + new KeyValuePair("rpcName", "google.showcase.v1beta1.Echo/Echo"); + private static final KeyValuePair RESPONSE_STATUS_KEY_VALUE_PAIR = + new KeyValuePair("response.status", "OK"); + private static final KeyValuePair RESPONSE_STATUS_KEY_VALUE_PAIR_HTTP = + new KeyValuePair("response.status", "200"); + private static final KeyValuePair REQUEST_URL_KEY_VALUE_PAIR = + new KeyValuePair("request.url", "http://localhost:7469"); + + private static final KeyValuePair RESPONSE_HEADERS_KEY_VALUE_PAIR = + new KeyValuePair("response.headers", ImmutableMap.of("content-type", "application/grpc")); + + private static final String SENDING_REQUEST_MESSAGE = "Sending request"; + private static final String RECEIVING_RESPONSE_MESSAGE = "Received response"; + private static final String ECHO_STRING = "echo?"; + + private TestAppender setupTestLogger(Class clazz, Level level) { + TestAppender testAppender = new TestAppender(); + testAppender.start(); + org.slf4j.Logger logger = LoggerFactory.getLogger(clazz); + ((ch.qos.logback.classic.Logger) logger).setLevel(level); + ((ch.qos.logback.classic.Logger) logger).addAppender(testAppender); + return testAppender; + } + + @BeforeAll + static void createClients() throws Exception { + // Create gRPC Echo Client + grpcClient = TestClientInitializer.createGrpcEchoClient(); + // Create Http JSON Echo Client + httpjsonClient = TestClientInitializer.createHttpJsonEchoClient(); + } + + @AfterAll + static void destroyClients() throws InterruptedException { + grpcClient.close(); + httpjsonClient.close(); + + grpcClient.awaitTermination(TestClientInitializer.AWAIT_TERMINATION_SECONDS, TimeUnit.SECONDS); + httpjsonClient.awaitTermination( + TestClientInitializer.AWAIT_TERMINATION_SECONDS, TimeUnit.SECONDS); + } + + @Test + void testGrpc_receiveContent_logDebug() { + TestAppender testAppender = setupTestLogger(GrpcLoggingInterceptor.class, Level.DEBUG); + assertThat(echoGrpc(ECHO_STRING)).isEqualTo(ECHO_STRING); + + assertThat(testAppender.events.size()).isEqualTo(2); + // logging event for request + ILoggingEvent loggingEvent1 = testAppender.events.get(0); + assertThat(loggingEvent1.getMessage()).isEqualTo(SENDING_REQUEST_MESSAGE); + assertThat(loggingEvent1.getLevel()).isEqualTo(Level.DEBUG); + List keyValuePairs = loggingEvent1.getKeyValuePairs(); + assertThat(keyValuePairs.size()).isEqualTo(4); + assertThat(keyValuePairs).containsAtLeast(SERVICE_NAME_KEY_VALUE_PAIR, RPC_NAME_KEY_VALUE_PAIR); + + for (KeyValuePair kvp : keyValuePairs) { + if (kvp.key.equals("request.payload")) { + Map payload = (Map) kvp.value; + assertThat(payload.get("content")).isEqualTo(ECHO_STRING); + assertThat(payload.get("requestId")).isNotNull(); + assertThat(payload.get("otherRequestId")).isNotNull(); + } + if (kvp.key.equals("request.headers")) { + Map headers = (Map) kvp.value; + assertThat(headers).containsKey("x-goog-api-version"); + assertThat(headers).containsKey("x-goog-api-client"); + } + } + + // logging event for response + ILoggingEvent loggingEvent2 = testAppender.events.get(1); + assertThat(loggingEvent2.getMessage()).isEqualTo(RECEIVING_RESPONSE_MESSAGE); + + assertThat(loggingEvent2.getLevel()).isEqualTo(Level.DEBUG); + List keyValuePairs2 = loggingEvent2.getKeyValuePairs(); + assertThat(keyValuePairs2.size()).isEqualTo(5); + assertThat(keyValuePairs2) + .containsAtLeast( + RESPONSE_STATUS_KEY_VALUE_PAIR, + RESPONSE_HEADERS_KEY_VALUE_PAIR, + SERVICE_NAME_KEY_VALUE_PAIR, + RPC_NAME_KEY_VALUE_PAIR); + for (KeyValuePair kvp : keyValuePairs2) { + if (kvp.key.equals("response.payload")) { + Map payload = (Map) kvp.value; + assertThat(payload.get("content")).isEqualTo(ECHO_STRING); + assertThat(payload.get("requestId")).isNotNull(); + assertThat(payload.get("otherRequestId")).isNotNull(); + } + } + testAppender.stop(); + } + + @Test + void testGrpc_receiveContent_logInfo() { + TestAppender testAppender = setupTestLogger(GrpcLoggingInterceptor.class, Level.INFO); + assertThat(echoGrpc(ECHO_STRING)).isEqualTo(ECHO_STRING); + + assertThat(testAppender.events.size()).isEqualTo(2); + // logging event for request + ILoggingEvent loggingEvent1 = testAppender.events.get(0); + assertThat(loggingEvent1.getMessage()).isEqualTo(SENDING_REQUEST_MESSAGE); + assertThat(loggingEvent1.getLevel()).isEqualTo(Level.INFO); + List keyValuePairs = loggingEvent1.getKeyValuePairs(); + assertThat(keyValuePairs.size()).isEqualTo(2); + assertThat(keyValuePairs).containsAtLeast(SERVICE_NAME_KEY_VALUE_PAIR, RPC_NAME_KEY_VALUE_PAIR); + + // logging event for response + ILoggingEvent loggingEvent2 = testAppender.events.get(1); + assertThat(loggingEvent2.getMessage()).isEqualTo(RECEIVING_RESPONSE_MESSAGE); + + assertThat(loggingEvent2.getLevel()).isEqualTo(Level.INFO); + List keyValuePairs2 = loggingEvent2.getKeyValuePairs(); + assertThat(keyValuePairs2.size()).isEqualTo(3); + assertThat(keyValuePairs2) + .containsAtLeast( + RESPONSE_STATUS_KEY_VALUE_PAIR, SERVICE_NAME_KEY_VALUE_PAIR, RPC_NAME_KEY_VALUE_PAIR); + testAppender.stop(); + } + + @Test + void testHttpJson_receiveContent_logDebug() { + TestAppender testAppender = setupTestLogger(HttpJsonLoggingInterceptor.class, Level.DEBUG); + assertThat(echoHttpJson(ECHO_STRING)).isEqualTo(ECHO_STRING); + assertThat(testAppender.events.size()).isEqualTo(2); + // logging event for request + ILoggingEvent loggingEvent1 = testAppender.events.get(0); + assertThat(loggingEvent1.getMessage()).isEqualTo(SENDING_REQUEST_MESSAGE); + assertThat(loggingEvent1.getLevel()).isEqualTo(Level.DEBUG); + List keyValuePairs = loggingEvent1.getKeyValuePairs(); + assertThat(keyValuePairs.size()).isEqualTo(4); + assertThat(keyValuePairs).contains(RPC_NAME_KEY_VALUE_PAIR); + assertThat(keyValuePairs).contains(REQUEST_URL_KEY_VALUE_PAIR); + + for (KeyValuePair kvp : keyValuePairs) { + if (kvp.key.equals("request.payload")) { + Map payload = (Map) kvp.value; + assertThat(payload.get("content")).isEqualTo(ECHO_STRING); + assertThat(payload.get("requestId")).isNotNull(); + assertThat(payload.get("otherRequestId")).isNotNull(); + } + if (kvp.key.equals("request.headers")) { + Map headers = (Map) kvp.value; + assertThat(headers).containsKey("x-goog-api-version"); + assertThat(headers).containsKey("x-goog-api-client"); + } + } + + // logging event for response + ILoggingEvent loggingEvent2 = testAppender.events.get(1); + assertThat(loggingEvent2.getMessage()).isEqualTo(RECEIVING_RESPONSE_MESSAGE); + + assertThat(loggingEvent2.getLevel()).isEqualTo(Level.DEBUG); + List keyValuePairs2 = loggingEvent2.getKeyValuePairs(); + assertThat(keyValuePairs2.size()).isEqualTo(4); + assertThat(keyValuePairs2) + .containsAtLeast(RESPONSE_STATUS_KEY_VALUE_PAIR_HTTP, RPC_NAME_KEY_VALUE_PAIR); + for (KeyValuePair kvp : keyValuePairs2) { + if (kvp.key.equals("response.payload")) { + Map payload = (Map) kvp.value; + assertThat(payload.get("content")).isEqualTo(ECHO_STRING); + assertThat(payload.get("requestId")).isNotNull(); + assertThat(payload.get("otherRequestId")).isNotNull(); + } + if (kvp.key.equals("response.headers")) { + Map headers = (Map) kvp.value; + assertThat(headers.size()).isEqualTo(11); + } + } + testAppender.stop(); + } + + @Test + void testHttpJson_receiveContent_logInfo() { + TestAppender testAppender = setupTestLogger(HttpJsonLoggingInterceptor.class, Level.INFO); + assertThat(echoHttpJson(ECHO_STRING)).isEqualTo(ECHO_STRING); + assertThat(testAppender.events.size()).isEqualTo(2); + // logging event for request + ILoggingEvent loggingEvent1 = testAppender.events.get(0); + assertThat(loggingEvent1.getMessage()).isEqualTo(SENDING_REQUEST_MESSAGE); + assertThat(loggingEvent1.getLevel()).isEqualTo(Level.INFO); + List keyValuePairs = loggingEvent1.getKeyValuePairs(); + assertThat(keyValuePairs.size()).isEqualTo(2); + assertThat(keyValuePairs).contains(RPC_NAME_KEY_VALUE_PAIR); + assertThat(keyValuePairs).contains(REQUEST_URL_KEY_VALUE_PAIR); + + // logging event for response + ILoggingEvent loggingEvent2 = testAppender.events.get(1); + assertThat(loggingEvent2.getMessage()).isEqualTo(RECEIVING_RESPONSE_MESSAGE); + + assertThat(loggingEvent2.getLevel()).isEqualTo(Level.INFO); + List keyValuePairs2 = loggingEvent2.getKeyValuePairs(); + assertThat(keyValuePairs2.size()).isEqualTo(2); + assertThat(keyValuePairs2) + .containsAtLeast(RESPONSE_STATUS_KEY_VALUE_PAIR_HTTP, RPC_NAME_KEY_VALUE_PAIR); + testAppender.stop(); + } + + private String echoGrpc(String value) { + EchoResponse response = grpcClient.echo(EchoRequest.newBuilder().setContent(value).build()); + return response.getContent(); + } + + private String echoHttpJson(String value) { + EchoResponse response = httpjsonClient.echo(EchoRequest.newBuilder().setContent(value).build()); + return response.getContent(); + } +} diff --git a/java-showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/logging/ITLogging1x.java b/java-showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/logging/ITLogging1x.java new file mode 100644 index 0000000000..d0dec4b80d --- /dev/null +++ b/java-showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/logging/ITLogging1x.java @@ -0,0 +1,217 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.it.logging; + +import static com.google.common.truth.Truth.assertThat; + +import ch.qos.logback.classic.Level; +import ch.qos.logback.classic.spi.ILoggingEvent; +import com.google.api.gax.grpc.GrpcLoggingInterceptor; +import com.google.api.gax.httpjson.HttpJsonLoggingInterceptor; +import com.google.common.collect.ImmutableMap; +import com.google.showcase.v1beta1.EchoClient; +import com.google.showcase.v1beta1.EchoRequest; +import com.google.showcase.v1beta1.EchoResponse; +import com.google.showcase.v1beta1.it.util.TestClientInitializer; +import java.util.Map; +import java.util.concurrent.TimeUnit; +import org.junit.jupiter.api.AfterAll; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Test; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +// This test needs to run with GOOGLE_SDK_JAVA_LOGGING=true +// mvn verify -P +// '!showcase,enable-integration-tests,loggingTestBase,slf4j1_logback ' +public class ITLogging1x { + private static EchoClient grpcClient; + + private static EchoClient httpjsonClient; + + private static final String ECHO_STRING = "echo?"; + private static final String SERVICE_NAME = "google.showcase.v1beta1.Echo"; + private static final String RPC_NAME = "google.showcase.v1beta1.Echo/Echo"; + private static final String ENDPOINT = "http://localhost:7469"; + private static final String SENDING_REQUEST_MESSAGE = "Sending request"; + private static final String RECEIVING_RESPONSE_MESSAGE = "Received response"; + + private static Logger logger = LoggerFactory.getLogger(ITLogging1x.class); + + private TestAppender setupTestLogger(Class clazz, Level level) { + TestAppender testAppender = new TestAppender(); + testAppender.start(); + Logger logger = LoggerFactory.getLogger(clazz); + ((ch.qos.logback.classic.Logger) logger).setLevel(level); + ((ch.qos.logback.classic.Logger) logger).addAppender(testAppender); + return testAppender; + } + + @BeforeAll + static void createClients() throws Exception { + // Create gRPC Echo Client + grpcClient = TestClientInitializer.createGrpcEchoClient(); + // Create Http JSON Echo Client + httpjsonClient = TestClientInitializer.createHttpJsonEchoClient(); + } + + @AfterAll + static void destroyClients() throws InterruptedException { + grpcClient.close(); + httpjsonClient.close(); + + grpcClient.awaitTermination(TestClientInitializer.AWAIT_TERMINATION_SECONDS, TimeUnit.SECONDS); + httpjsonClient.awaitTermination( + TestClientInitializer.AWAIT_TERMINATION_SECONDS, TimeUnit.SECONDS); + } + + @Test + void test() { + assertThat(logger.isInfoEnabled()).isTrue(); + assertThat(logger.isDebugEnabled()).isTrue(); + } + + @Test + void testGrpc_receiveContent_logDebug() { + TestAppender testAppender = setupTestLogger(GrpcLoggingInterceptor.class, Level.DEBUG); + assertThat(echoGrpc(ECHO_STRING)).isEqualTo(ECHO_STRING); + + assertThat(testAppender.events.size()).isEqualTo(2); + // logging event for request + ILoggingEvent loggingEvent1 = testAppender.events.get(0); + assertThat(loggingEvent1.getMessage()).isEqualTo(SENDING_REQUEST_MESSAGE); + assertThat(loggingEvent1.getLevel()).isEqualTo(Level.DEBUG); + Map mdcPropertyMap = loggingEvent1.getMDCPropertyMap(); + assertThat(mdcPropertyMap) + .containsAtLeastEntriesIn( + ImmutableMap.of("serviceName", SERVICE_NAME, "rpcName", RPC_NAME)); + assertThat(mdcPropertyMap).containsKey("request.headers"); + assertThat(mdcPropertyMap.get("request.headers")).startsWith("{\"x-goog-api-"); + + assertThat(mdcPropertyMap).containsKey("request.payload"); + assertThat(mdcPropertyMap.get("request.payload")) + .startsWith("{\"content\":\"echo?\",\"requestId\":"); + + // logging event for response + ILoggingEvent loggingEvent2 = testAppender.events.get(1); + assertThat(loggingEvent2.getMessage()).isEqualTo(RECEIVING_RESPONSE_MESSAGE); + assertThat(loggingEvent2.getLevel()).isEqualTo(Level.DEBUG); + Map responseMdcPropertyMap = loggingEvent2.getMDCPropertyMap(); + assertThat(responseMdcPropertyMap) + .containsAtLeastEntriesIn( + ImmutableMap.of( + "serviceName", SERVICE_NAME, "rpcName", RPC_NAME, "response.status", "OK")); + assertThat(responseMdcPropertyMap).containsKey("response.payload"); + assertThat(responseMdcPropertyMap).containsKey("response.headers"); + + testAppender.stop(); + } + + @Test + void testGrpc_receiveContent_logInfo() { + TestAppender testAppender = setupTestLogger(GrpcLoggingInterceptor.class, Level.INFO); + assertThat(echoGrpc(ECHO_STRING)).isEqualTo(ECHO_STRING); + + assertThat(testAppender.events.size()).isEqualTo(2); + // logging event for request + ILoggingEvent loggingEvent1 = testAppender.events.get(0); + assertThat(loggingEvent1.getMessage()).isEqualTo(SENDING_REQUEST_MESSAGE); + assertThat(loggingEvent1.getLevel()).isEqualTo(Level.INFO); + Map mdcPropertyMap = loggingEvent1.getMDCPropertyMap(); + assertThat(mdcPropertyMap) + .containsExactlyEntriesIn( + ImmutableMap.of("serviceName", SERVICE_NAME, "rpcName", RPC_NAME)); + + // logging event for response + ILoggingEvent loggingEvent2 = testAppender.events.get(1); + assertThat(loggingEvent2.getMessage()).isEqualTo(RECEIVING_RESPONSE_MESSAGE); + assertThat(loggingEvent2.getLevel()).isEqualTo(Level.INFO); + Map responseMdcPropertyMap = loggingEvent2.getMDCPropertyMap(); + assertThat(responseMdcPropertyMap) + .containsExactlyEntriesIn( + ImmutableMap.of( + "serviceName", SERVICE_NAME, "rpcName", RPC_NAME, "response.status", "OK")); + + testAppender.stop(); + } + + @Test + void testHttpJson_receiveContent_logDebug() { + TestAppender testAppender = setupTestLogger(HttpJsonLoggingInterceptor.class, Level.DEBUG); + assertThat(echoHttpJson(ECHO_STRING)).isEqualTo(ECHO_STRING); + assertThat(testAppender.events.size()).isEqualTo(2); + // logging event for request + ILoggingEvent loggingEvent1 = testAppender.events.get(0); + assertThat(loggingEvent1.getMessage()).isEqualTo(SENDING_REQUEST_MESSAGE); + assertThat(loggingEvent1.getLevel()).isEqualTo(Level.DEBUG); + Map mdcPropertyMap = loggingEvent1.getMDCPropertyMap(); + assertThat(mdcPropertyMap).containsEntry("rpcName", RPC_NAME); + assertThat(mdcPropertyMap).containsEntry("request.url", ENDPOINT); + assertThat(mdcPropertyMap).containsKey("request.headers"); + assertThat(mdcPropertyMap.get("request.headers")).startsWith("{\"x-goog-api-"); + assertThat(mdcPropertyMap).containsKey("request.payload"); + assertThat(mdcPropertyMap.get("request.payload")) + .startsWith("{\"content\":\"echo?\",\"requestId\":"); + + // logging event for response + ILoggingEvent loggingEvent2 = testAppender.events.get(1); + assertThat(loggingEvent2.getMessage()).isEqualTo(RECEIVING_RESPONSE_MESSAGE); + assertThat(loggingEvent2.getLevel()).isEqualTo(Level.DEBUG); + Map responseMdcPropertyMap = loggingEvent2.getMDCPropertyMap(); + assertThat(responseMdcPropertyMap) + .containsAtLeastEntriesIn(ImmutableMap.of("rpcName", RPC_NAME, "response.status", "200")); + assertThat(responseMdcPropertyMap).containsKey("response.payload"); + assertThat(responseMdcPropertyMap).containsKey("response.headers"); + testAppender.stop(); + } + + @Test + void testHttpJson_receiveContent_logInfo() { + TestAppender testAppender = setupTestLogger(HttpJsonLoggingInterceptor.class, Level.INFO); + assertThat(echoHttpJson(ECHO_STRING)).isEqualTo(ECHO_STRING); + assertThat(testAppender.events.size()).isEqualTo(2); + // logging event for request + ILoggingEvent loggingEvent1 = testAppender.events.get(0); + assertThat(loggingEvent1.getMessage()).isEqualTo(SENDING_REQUEST_MESSAGE); + assertThat(loggingEvent1.getLevel()).isEqualTo(Level.INFO); + Map mdcPropertyMap = loggingEvent1.getMDCPropertyMap(); + assertThat(mdcPropertyMap) + .containsExactlyEntriesIn( + ImmutableMap.of( + "rpcName", RPC_NAME, + "request.url", ENDPOINT)); + + // logging event for response + ILoggingEvent loggingEvent2 = testAppender.events.get(1); + assertThat(loggingEvent2.getMessage()).isEqualTo(RECEIVING_RESPONSE_MESSAGE); + assertThat(loggingEvent2.getLevel()).isEqualTo(Level.INFO); + Map responseMdcPropertyMap = loggingEvent2.getMDCPropertyMap(); + assertThat(responseMdcPropertyMap) + .containsExactlyEntriesIn(ImmutableMap.of("rpcName", RPC_NAME, "response.status", "200")); + testAppender.stop(); + } + + private String echoGrpc(String value) { + EchoResponse response = grpcClient.echo(EchoRequest.newBuilder().setContent(value).build()); + return response.getContent(); + } + + private String echoHttpJson(String value) { + EchoResponse response = httpjsonClient.echo(EchoRequest.newBuilder().setContent(value).build()); + return response.getContent(); + } +} diff --git a/java-showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/logging/ITLoggingDisabled.java b/java-showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/logging/ITLoggingDisabled.java new file mode 100644 index 0000000000..16c6acb0a6 --- /dev/null +++ b/java-showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/logging/ITLoggingDisabled.java @@ -0,0 +1,78 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.it.logging; + +import static com.google.common.truth.Truth.assertThat; + +import ch.qos.logback.classic.Level; +import ch.qos.logback.classic.spi.ILoggingEvent; +import ch.qos.logback.core.read.ListAppender; +import com.google.api.gax.grpc.GrpcLoggingInterceptor; +import com.google.showcase.v1beta1.EchoClient; +import com.google.showcase.v1beta1.EchoRequest; +import com.google.showcase.v1beta1.EchoResponse; +import com.google.showcase.v1beta1.it.util.TestClientInitializer; +import java.util.concurrent.TimeUnit; +import org.junit.jupiter.api.AfterAll; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Test; +import org.slf4j.LoggerFactory; + +// mvn verify -P '!showcase,enable-integration-tests,loggingTestBase,disabledLogging' +public class ITLoggingDisabled { + + private static EchoClient grpcClient; + private static final String ECHO_STRING = "echo?"; + + private TestAppender setupTestLogger(Class clazz) { + TestAppender testAppender = new TestAppender(); + testAppender.start(); + ListAppender listAppender = new ListAppender<>(); + listAppender.start(); + org.slf4j.Logger logger = LoggerFactory.getLogger(clazz); + ((ch.qos.logback.classic.Logger) logger).setLevel(Level.DEBUG); + ((ch.qos.logback.classic.Logger) logger).addAppender(testAppender); + return testAppender; + } + + @BeforeAll + static void createClients() throws Exception { + // Create gRPC Echo Client + grpcClient = TestClientInitializer.createGrpcEchoClient(); + } + + @AfterAll + static void destroyClients() throws InterruptedException { + grpcClient.close(); + + grpcClient.awaitTermination(TestClientInitializer.AWAIT_TERMINATION_SECONDS, TimeUnit.SECONDS); + } + + // only run when GOOGLE_SDK_JAVA_LOGGING!=true + @Test + void testloggingDisabled() { + TestAppender testAppender = setupTestLogger(GrpcLoggingInterceptor.class); + assertThat(echoGrpc(ECHO_STRING)).isEqualTo(ECHO_STRING); + + assertThat(testAppender.events.size()).isEqualTo(0); + } + + private String echoGrpc(String value) { + EchoResponse response = grpcClient.echo(EchoRequest.newBuilder().setContent(value).build()); + return response.getContent(); + } +} diff --git a/java-showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/logging/TestAppender.java b/java-showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/logging/TestAppender.java new file mode 100644 index 0000000000..92a6996936 --- /dev/null +++ b/java-showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/logging/TestAppender.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.showcase.v1beta1.it.logging; + +import ch.qos.logback.classic.spi.ILoggingEvent; +import ch.qos.logback.core.AppenderBase; +import java.util.ArrayList; +import java.util.List; + +/** Logback appender used to set up tests. */ +public class TestAppender extends AppenderBase { + public List events = new ArrayList<>(); + + @Override + protected void append(ILoggingEvent eventObject) { + // triggering Logback to capture the current MDC context and store it with the log event + // the default ListAppender does not capture MDC contents + eventObject.getMDCPropertyMap(); + + events.add(eventObject); + } + + public void clearEvents() { + events.clear(); + } +} diff --git a/java-showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/util/GrpcCapturingClientInterceptor.java b/java-showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/util/GrpcCapturingClientInterceptor.java new file mode 100644 index 0000000000..e7d2a01f56 --- /dev/null +++ b/java-showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/util/GrpcCapturingClientInterceptor.java @@ -0,0 +1,83 @@ +/* + * 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 + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.it.util; + +import io.grpc.CallOptions; +import io.grpc.Channel; +import io.grpc.ClientCall; +import io.grpc.ClientInterceptor; +import io.grpc.ForwardingClientCall; +import io.grpc.Metadata; +import io.grpc.MethodDescriptor; +import io.grpc.Status; + +/** Implements a client interceptor to retrieve the metadata from a GRPC client request. */ +public class GrpcCapturingClientInterceptor implements ClientInterceptor { + public Metadata metadata; + + @Override + public ClientCall interceptCall( + MethodDescriptor method, final CallOptions callOptions, Channel next) { + ClientCall call = next.newCall(method, callOptions); + return new ForwardingClientCall.SimpleForwardingClientCall(call) { + @Override + public void start(Listener responseListener, Metadata headers) { + Listener wrappedListener = + new SimpleForwardingClientCallListener(responseListener) { + @Override + public void onClose(Status status, Metadata trailers) { + if (status.isOk()) { + metadata = trailers; + } + super.onClose(status, trailers); + } + }; + + super.start(wrappedListener, headers); + } + }; + } + + private static class SimpleForwardingClientCallListener + extends ClientCall.Listener { + private final ClientCall.Listener delegate; + + SimpleForwardingClientCallListener(ClientCall.Listener delegate) { + this.delegate = delegate; + } + + @Override + public void onHeaders(Metadata headers) { + delegate.onHeaders(headers); + } + + @Override + public void onMessage(RespT message) { + delegate.onMessage(message); + } + + @Override + public void onClose(Status status, Metadata trailers) { + delegate.onClose(status, trailers); + } + + @Override + public void onReady() { + delegate.onReady(); + } + } +} diff --git a/java-showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/util/HttpJsonCapturingClientInterceptor.java b/java-showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/util/HttpJsonCapturingClientInterceptor.java new file mode 100644 index 0000000000..ec9b9da9cb --- /dev/null +++ b/java-showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/util/HttpJsonCapturingClientInterceptor.java @@ -0,0 +1,66 @@ +/* + * 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 + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.it.util; + +import com.google.api.gax.httpjson.ApiMethodDescriptor; +import com.google.api.gax.httpjson.ForwardingHttpJsonClientCall; +import com.google.api.gax.httpjson.ForwardingHttpJsonClientCallListener; +import com.google.api.gax.httpjson.HttpJsonCallOptions; +import com.google.api.gax.httpjson.HttpJsonChannel; +import com.google.api.gax.httpjson.HttpJsonClientCall; +import com.google.api.gax.httpjson.HttpJsonClientInterceptor; +import com.google.api.gax.httpjson.HttpJsonMetadata; + +/** Implements a client interceptor to retrieve the response headers from a HTTP client request. */ +public class HttpJsonCapturingClientInterceptor implements HttpJsonClientInterceptor { + public HttpJsonMetadata metadata; + + @Override + public HttpJsonClientCall interceptCall( + ApiMethodDescriptor method, + HttpJsonCallOptions callOptions, + HttpJsonChannel next) { + HttpJsonClientCall call = next.newCall(method, callOptions); + return new ForwardingHttpJsonClientCall.SimpleForwardingHttpJsonClientCall( + call) { + @Override + public void start(Listener responseListener, HttpJsonMetadata requestHeaders) { + Listener forwardingResponseListener = + new ForwardingHttpJsonClientCallListener.SimpleForwardingHttpJsonClientCallListener< + ResponseT>(responseListener) { + @Override + public void onHeaders(HttpJsonMetadata responseHeaders) { + metadata = responseHeaders; + super.onHeaders(responseHeaders); + } + + @Override + public void onMessage(ResponseT message) { + super.onMessage(message); + } + + @Override + public void onClose(int statusCode, HttpJsonMetadata trailers) { + super.onClose(statusCode, trailers); + } + }; + + super.start(forwardingResponseListener, requestHeaders); + } + }; + } +} diff --git a/java-showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/util/InterceptingMockTokenServerTransport.java b/java-showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/util/InterceptingMockTokenServerTransport.java new file mode 100644 index 0000000000..4545d87f20 --- /dev/null +++ b/java-showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/util/InterceptingMockTokenServerTransport.java @@ -0,0 +1,48 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.it.util; + +import com.google.api.client.http.LowLevelHttpRequest; +import com.google.api.client.json.JsonFactory; +import com.google.api.client.json.gson.GsonFactory; +import com.google.api.client.json.webtoken.JsonWebSignature; +import com.google.api.client.testing.http.MockLowLevelHttpRequest; +import com.google.auth.TestUtils; +import com.google.auth.oauth2.MockTokenServerTransport; +import java.io.IOException; +import java.util.Map; + +public class InterceptingMockTokenServerTransport extends MockTokenServerTransport { + private MockLowLevelHttpRequest lastRequest; + private static final JsonFactory JSON_FACTORY = new GsonFactory(); + + @Override + public LowLevelHttpRequest buildRequest(String method, String url) throws IOException { + MockLowLevelHttpRequest baseRequest = (MockLowLevelHttpRequest) super.buildRequest(method, url); + lastRequest = baseRequest; + return baseRequest; + } + + public String getLastAudienceSent() throws IOException { + String contentString = lastRequest.getContentAsString(); + Map query = TestUtils.parseQuery(contentString); + String assertion = query.get("assertion"); + JsonWebSignature signature = JsonWebSignature.parse(JSON_FACTORY, assertion); + String foundTargetAudience = (String) signature.getPayload().get("api_audience"); + return foundTargetAudience; + } +} diff --git a/java-showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/util/InterceptingMockTokenServerTransportFactory.java b/java-showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/util/InterceptingMockTokenServerTransportFactory.java new file mode 100644 index 0000000000..ffb1e04132 --- /dev/null +++ b/java-showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/util/InterceptingMockTokenServerTransportFactory.java @@ -0,0 +1,31 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.it.util; + +import com.google.api.client.http.HttpTransport; +import com.google.auth.oauth2.MockTokenServerTransportFactory; + +public class InterceptingMockTokenServerTransportFactory extends MockTokenServerTransportFactory { + + public InterceptingMockTokenServerTransport transport = + new InterceptingMockTokenServerTransport(); + + @Override + public HttpTransport create() { + return transport; + } +} diff --git a/java-showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/util/TestClientInitializer.java b/java-showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/util/TestClientInitializer.java new file mode 100644 index 0000000000..39e2c60f01 --- /dev/null +++ b/java-showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/util/TestClientInitializer.java @@ -0,0 +1,384 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.it.util; + +import com.google.api.client.http.javanet.NetHttpTransport; +import com.google.api.gax.core.NoCredentialsProvider; +import com.google.api.gax.httpjson.HttpJsonClientInterceptor; +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.StatusCode; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.tracing.ApiTracerFactory; +import com.google.common.collect.ImmutableList; +import com.google.showcase.v1beta1.ComplianceClient; +import com.google.showcase.v1beta1.ComplianceSettings; +import com.google.showcase.v1beta1.EchoClient; +import com.google.showcase.v1beta1.EchoSettings; +import com.google.showcase.v1beta1.IdentityClient; +import com.google.showcase.v1beta1.IdentitySettings; +import com.google.showcase.v1beta1.WaitRequest; +import com.google.showcase.v1beta1.stub.EchoStub; +import com.google.showcase.v1beta1.stub.EchoStubSettings; +import io.grpc.ClientInterceptor; +import io.grpc.ManagedChannelBuilder; +import java.util.List; +import java.util.Set; + +public class TestClientInitializer { + + public static final int AWAIT_TERMINATION_SECONDS = 10; + + // gRPC's endpoint must follow the format of {host}:{port} + public static final String DEFAULT_GRPC_ENDPOINT = "localhost:7469"; + // httpjson's endpoint uses `https://` by default if the scheme is not specified + // local test requires `http://` as not SSL/TLS has been set up for showcase + public static final String DEFAULT_HTTPJSON_ENDPOINT = "http://localhost:7469"; + + public static EchoClient createGrpcEchoClient() throws Exception { + return createGrpcEchoClient(ImmutableList.of()); + } + + public static EchoClient createGrpcEchoClient(List interceptorList) + throws Exception { + EchoSettings grpcEchoSettings = + EchoSettings.newBuilder() + .setCredentialsProvider(NoCredentialsProvider.create()) + .setTransportChannelProvider( + EchoSettings.defaultGrpcTransportProviderBuilder() + .setChannelConfigurator(ManagedChannelBuilder::usePlaintext) + .setInterceptorProvider(() -> interceptorList) + .build()) + .setEndpoint(DEFAULT_GRPC_ENDPOINT) + .build(); + return EchoClient.create(grpcEchoSettings); + } + + public static EchoClient createGrpcEchoClientWithRetrySettings( + RetrySettings retrySettings, + Set retryableCodes, + List interceptorList) + throws Exception { + EchoStubSettings.Builder grpcEchoSettingsBuilder = EchoStubSettings.newBuilder(); + grpcEchoSettingsBuilder + .echoSettings() + .setRetrySettings(retrySettings) + .setRetryableCodes(retryableCodes); + EchoSettings grpcEchoSettings = EchoSettings.create(grpcEchoSettingsBuilder.build()); + grpcEchoSettings = + grpcEchoSettings.toBuilder() + .setCredentialsProvider(NoCredentialsProvider.create()) + .setTransportChannelProvider( + EchoSettings.defaultGrpcTransportProviderBuilder() + .setChannelConfigurator(ManagedChannelBuilder::usePlaintext) + .setInterceptorProvider(() -> interceptorList) + .build()) + .setEndpoint(DEFAULT_GRPC_ENDPOINT) + .build(); + return EchoClient.create(grpcEchoSettings); + } + + public static EchoClient createHttpJsonEchoClient() throws Exception { + return createHttpJsonEchoClient(ImmutableList.of()); + } + + public static EchoClient createHttpJsonEchoClient(List interceptorList) + throws Exception { + EchoSettings httpJsonEchoSettings = + EchoSettings.newHttpJsonBuilder() + .setCredentialsProvider(NoCredentialsProvider.create()) + .setTransportChannelProvider( + EchoSettings.defaultHttpJsonTransportProviderBuilder() + .setHttpTransport( + new NetHttpTransport.Builder().doNotValidateCertificate().build()) + .setEndpoint(DEFAULT_HTTPJSON_ENDPOINT) + .setInterceptorProvider(() -> interceptorList) + .build()) + .build(); + return EchoClient.create(httpJsonEchoSettings); + } + + public static EchoClient createHttpJsonEchoClientWithRetrySettings( + RetrySettings retrySettings, + Set retryableCodes, + List interceptorList) + throws Exception { + EchoStubSettings.Builder httpJsonEchoSettingsBuilder = EchoStubSettings.newHttpJsonBuilder(); + httpJsonEchoSettingsBuilder + .echoSettings() + .setRetrySettings(retrySettings) + .setRetryableCodes(retryableCodes); + EchoSettings httpJsonEchoSettings = EchoSettings.create(httpJsonEchoSettingsBuilder.build()); + httpJsonEchoSettings = + httpJsonEchoSettings.toBuilder() + .setCredentialsProvider(NoCredentialsProvider.create()) + .setTransportChannelProvider( + EchoSettings.defaultHttpJsonTransportProviderBuilder() + .setHttpTransport( + new NetHttpTransport.Builder().doNotValidateCertificate().build()) + .setInterceptorProvider(() -> interceptorList) + .setEndpoint(DEFAULT_HTTPJSON_ENDPOINT) + .build()) + .build(); + return EchoClient.create(httpJsonEchoSettings); + } + + public static EchoClient createGrpcEchoClientCustomBlockSettings( + RetrySettings retrySettings, Set retryableCodes) throws Exception { + EchoStubSettings.Builder grpcEchoSettingsBuilder = EchoStubSettings.newBuilder(); + grpcEchoSettingsBuilder + .blockSettings() + .setRetrySettings(retrySettings) + .setRetryableCodes(retryableCodes); + EchoSettings grpcEchoSettings = EchoSettings.create(grpcEchoSettingsBuilder.build()); + grpcEchoSettings = + grpcEchoSettings.toBuilder() + .setCredentialsProvider(NoCredentialsProvider.create()) + .setTransportChannelProvider( + EchoSettings.defaultGrpcTransportProviderBuilder() + .setChannelConfigurator(ManagedChannelBuilder::usePlaintext) + .build()) + .setEndpoint(DEFAULT_GRPC_ENDPOINT) + .build(); + return EchoClient.create(grpcEchoSettings); + } + + public static EchoClient createHttpJsonEchoClientCustomBlockSettings( + RetrySettings retrySettings, Set retryableCodes) throws Exception { + EchoStubSettings.Builder httpJsonEchoSettingsBuilder = EchoStubSettings.newHttpJsonBuilder(); + httpJsonEchoSettingsBuilder + .blockSettings() + .setRetrySettings(retrySettings) + .setRetryableCodes(retryableCodes); + EchoSettings httpJsonEchoSettings = EchoSettings.create(httpJsonEchoSettingsBuilder.build()); + httpJsonEchoSettings = + httpJsonEchoSettings.toBuilder() + .setCredentialsProvider(NoCredentialsProvider.create()) + .setTransportChannelProvider( + EchoSettings.defaultHttpJsonTransportProviderBuilder() + .setHttpTransport( + new NetHttpTransport.Builder().doNotValidateCertificate().build()) + .setEndpoint(DEFAULT_HTTPJSON_ENDPOINT) + .build()) + .build(); + return EchoClient.create(httpJsonEchoSettings); + } + + public static EchoClient createGrpcEchoClientCustomWaitSettings( + RetrySettings initialUnaryRetrySettings, RetrySettings pollingRetrySettings) + throws Exception { + EchoStubSettings.Builder grpcEchoSettingsBuilder = EchoStubSettings.newBuilder(); + grpcEchoSettingsBuilder + .waitOperationSettings() + .setInitialCallSettings( + UnaryCallSettings.newUnaryCallSettingsBuilder() + .setRetrySettings(initialUnaryRetrySettings) + .build()) + .setPollingAlgorithm(OperationTimedPollAlgorithm.create(pollingRetrySettings)); + EchoSettings grpcEchoSettings = EchoSettings.create(grpcEchoSettingsBuilder.build()); + grpcEchoSettings = + grpcEchoSettings.toBuilder() + .setCredentialsProvider(NoCredentialsProvider.create()) + .setTransportChannelProvider( + EchoSettings.defaultGrpcTransportProviderBuilder() + .setChannelConfigurator(ManagedChannelBuilder::usePlaintext) + .build()) + .setEndpoint(DEFAULT_GRPC_ENDPOINT) + .build(); + return EchoClient.create(grpcEchoSettings); + } + + public static EchoClient createHttpJsonEchoClientCustomWaitSettings( + RetrySettings initialUnaryRetrySettings, RetrySettings pollingRetrySettings) + throws Exception { + EchoStubSettings.Builder httpJsonEchoSettingsBuilder = EchoStubSettings.newHttpJsonBuilder(); + httpJsonEchoSettingsBuilder + .waitOperationSettings() + .setInitialCallSettings( + UnaryCallSettings.newUnaryCallSettingsBuilder() + .setRetrySettings(initialUnaryRetrySettings) + .build()) + .setPollingAlgorithm(OperationTimedPollAlgorithm.create(pollingRetrySettings)); + EchoSettings httpJsonEchoSettings = EchoSettings.create(httpJsonEchoSettingsBuilder.build()); + httpJsonEchoSettings = + httpJsonEchoSettings.toBuilder() + .setCredentialsProvider(NoCredentialsProvider.create()) + .setTransportChannelProvider( + EchoSettings.defaultHttpJsonTransportProviderBuilder() + .setHttpTransport( + new NetHttpTransport.Builder().doNotValidateCertificate().build()) + .setEndpoint(DEFAULT_HTTPJSON_ENDPOINT) + .build()) + .build(); + return EchoClient.create(httpJsonEchoSettings); + } + + public static IdentityClient createGrpcIdentityClient() throws Exception { + IdentitySettings grpcIdentitySettings = + IdentitySettings.newHttpJsonBuilder() + .setCredentialsProvider(NoCredentialsProvider.create()) + .setTransportChannelProvider( + IdentitySettings.defaultGrpcTransportProviderBuilder() + .setChannelConfigurator(ManagedChannelBuilder::usePlaintext) + .build()) + .setEndpoint(DEFAULT_GRPC_ENDPOINT) + .build(); + return IdentityClient.create(grpcIdentitySettings); + } + + public static IdentityClient createHttpJsonIdentityClient() throws Exception { + IdentitySettings httpjsonIdentitySettings = + IdentitySettings.newHttpJsonBuilder() + .setCredentialsProvider(NoCredentialsProvider.create()) + .setTransportChannelProvider( + EchoSettings.defaultHttpJsonTransportProviderBuilder() + .setHttpTransport( + new NetHttpTransport.Builder().doNotValidateCertificate().build()) + .setEndpoint(DEFAULT_HTTPJSON_ENDPOINT) + .build()) + .build(); + return IdentityClient.create(httpjsonIdentitySettings); + } + + // Create grpcComplianceClient with Interceptor + public static ComplianceClient createGrpcComplianceClient(List interceptorList) + throws Exception { + ComplianceSettings grpcComplianceSettings = + ComplianceSettings.newBuilder() + .setCredentialsProvider(NoCredentialsProvider.create()) + .setTransportChannelProvider( + ComplianceSettings.defaultGrpcTransportProviderBuilder() + .setChannelConfigurator(ManagedChannelBuilder::usePlaintext) + .setInterceptorProvider(() -> interceptorList) + .build()) + .setEndpoint(DEFAULT_GRPC_ENDPOINT) + .build(); + return ComplianceClient.create(grpcComplianceSettings); + } + + public static ComplianceClient createHttpJsonComplianceClient( + List interceptorList) throws Exception { + ComplianceSettings httpJsonComplianceSettings = + ComplianceSettings.newHttpJsonBuilder() + .setCredentialsProvider(NoCredentialsProvider.create()) + .setTransportChannelProvider( + EchoSettings.defaultHttpJsonTransportProviderBuilder() + .setHttpTransport( + new NetHttpTransport.Builder().doNotValidateCertificate().build()) + .setEndpoint(DEFAULT_HTTPJSON_ENDPOINT) + .setInterceptorProvider(() -> interceptorList) + .build()) + .build(); + return ComplianceClient.create(httpJsonComplianceSettings); + } + + public static EchoClient createGrpcEchoClientOpentelemetry(ApiTracerFactory metricsTracerFactory) + throws Exception { + return createGrpcEchoClientOpentelemetry( + metricsTracerFactory, + EchoSettings.defaultGrpcTransportProviderBuilder() + .setChannelConfigurator(ManagedChannelBuilder::usePlaintext) + .build()); + } + + public static EchoClient createGrpcEchoClientOpentelemetry( + ApiTracerFactory metricsTracerFactory, TransportChannelProvider transportChannelProvider) + throws Exception { + EchoSettings grpcEchoSettings = + EchoSettings.newBuilder() + .setCredentialsProvider(NoCredentialsProvider.create()) + .setTransportChannelProvider(transportChannelProvider) + .setEndpoint(DEFAULT_GRPC_ENDPOINT) + .build(); + + EchoStubSettings echoStubSettings = + (EchoStubSettings) + grpcEchoSettings.getStubSettings().toBuilder() + .setTracerFactory(metricsTracerFactory) + .build(); + EchoStub stub = echoStubSettings.createStub(); + + return EchoClient.create(stub); + } + + public static EchoClient createHttpJsonEchoClientOpentelemetry( + ApiTracerFactory metricsTracerFactory) throws Exception { + + EchoSettings httpJsonEchoSettings = + EchoSettings.newHttpJsonBuilder() + .setCredentialsProvider(NoCredentialsProvider.create()) + .setTransportChannelProvider( + EchoSettings.defaultHttpJsonTransportProviderBuilder() + .setHttpTransport( + new NetHttpTransport.Builder().doNotValidateCertificate().build()) + .setEndpoint(DEFAULT_HTTPJSON_ENDPOINT) + .build()) + .build(); + + EchoStubSettings echoStubSettings = + (EchoStubSettings) + httpJsonEchoSettings.getStubSettings().toBuilder() + .setTracerFactory(metricsTracerFactory) + .build(); + EchoStub stub = echoStubSettings.createStub(); + + return EchoClient.create(stub); + } + + public static IdentityClient createGrpcIdentityClientOpentelemetry(ApiTracerFactory tracerFactory) + throws Exception { + IdentitySettings grpcIdentitySettings = + IdentitySettings.newBuilder() + .setCredentialsProvider(NoCredentialsProvider.create()) + .setTransportChannelProvider( + IdentitySettings.defaultGrpcTransportProviderBuilder() + .setChannelConfigurator(ManagedChannelBuilder::usePlaintext) + .build()) + .setEndpoint(DEFAULT_GRPC_ENDPOINT) + .build(); + + com.google.showcase.v1beta1.stub.IdentityStubSettings identityStubSettings = + (com.google.showcase.v1beta1.stub.IdentityStubSettings) + grpcIdentitySettings.getStubSettings().toBuilder() + .setTracerFactory(tracerFactory) + .build(); + return IdentityClient.create(identityStubSettings.createStub()); + } + + public static IdentityClient createHttpJsonIdentityClientOpentelemetry( + ApiTracerFactory tracerFactory) throws Exception { + IdentitySettings httpJsonIdentitySettings = + IdentitySettings.newHttpJsonBuilder() + .setCredentialsProvider(NoCredentialsProvider.create()) + .setTransportChannelProvider( + IdentitySettings.defaultHttpJsonTransportProviderBuilder() + .setHttpTransport( + new NetHttpTransport.Builder().doNotValidateCertificate().build()) + .setEndpoint(DEFAULT_HTTPJSON_ENDPOINT) + .build()) + .build(); + + com.google.showcase.v1beta1.stub.IdentityStubSettings identityStubSettings = + (com.google.showcase.v1beta1.stub.IdentityStubSettings) + httpJsonIdentitySettings.getStubSettings().toBuilder() + .setTracerFactory(tracerFactory) + .build(); + return IdentityClient.create(identityStubSettings.createStub()); + } +} diff --git a/java-showcase/gapic-showcase/src/test/resources/META-INF/native-image/resource-config.json b/java-showcase/gapic-showcase/src/test/resources/META-INF/native-image/resource-config.json new file mode 100644 index 0000000000..bfa2659f0a --- /dev/null +++ b/java-showcase/gapic-showcase/src/test/resources/META-INF/native-image/resource-config.json @@ -0,0 +1,6 @@ +{ + "resources": [ + { "pattern": ".*.json" }, + { "pattern": ".*.pem" } + ] +} \ No newline at end of file diff --git a/java-showcase/gapic-showcase/src/test/resources/compliance_suite.json b/java-showcase/gapic-showcase/src/test/resources/compliance_suite.json new file mode 100644 index 0000000000..a458819b35 --- /dev/null +++ b/java-showcase/gapic-showcase/src/test/resources/compliance_suite.json @@ -0,0 +1,240 @@ +{ + "group": [ + { + "name": "Fully working conversions, no resources", + "rpcs": ["Compliance.RepeatDataBody", "Compliance.RepeatDataBodyPut", "Compliance.RepeatDataBodyPatch", "Compliance.RepeatDataQuery", "Compliance.RepeatDataSimplePath", "Compliance.RepeatDataBodyInfo"], + "requests": [ + { + "name": "Basic data types", + "serverVerify": true, + "info": { + "fString": "Hello", + "fInt32": -1, + "fSint32" : -2, + "fSfixed32": -3, + "fUint32": 5, + "fFixed32": 7, + "fInt64": -11, + "fSint64": -13, + "fSfixed64": -17, + "fUint64": 19, + "fFixed64":23, + "fDouble": -29e4, + "fFloat": -31, + "fBool": true, + "fKingdom": "ANIMALIA", + + "pString": "Goodbye", + "pInt32": -37, + "pDouble": -41.43, + "pBool": true, + "pKingdom": "PLANTAE", + + "fChild": { + "fString": "second/bool/salutation" + } + }, + "fInt32": -10, + "fInt64": -110, + "fDouble": -54e4, + + "pInt32": -47, + "pInt64": -477, + "pDouble": -61.73 + }, + { + "name": "Basic types, no optional fields", + "serverVerify": true, + "info": { + "fString": "Hello", + "fInt32": -1, + "fSint32" : -2, + "fSfixed32": -3, + "fUint32": 5, + "fFixed32": 7, + "fInt64": -11, + "fSint64": -13, + "fSfixed64": -17, + "fUint64": 19, + "fFixed64":23, + "fDouble": -29e4, + "fFloat": -31, + "fBool": true, + "fKingdom": "ANIMALIA", + + "fChild": { + "fString": "second/bool/salutation" + } + } + }, + + { + "name": "Zero values for non-string fields", + "serverVerify": true, + "info": { + "fString": "Hello", + "fInt32": 0, + "fSint32" : 0, + "fSfixed32": 0, + "fUint32": 0, + "fFixed32": 0, + "fInt64": 0, + "fSint64": 0, + "fSfixed64": 0, + "fUint64": 0, + "fFixed64": 0, + "fDouble": 0, + "fFloat": 0, + "fBool": false, + "fKingdom": "LIFE_KINGDOM_UNSPECIFIED", + + "pString": "Goodbye", + "pInt32": 0, + "pDouble": 0, + "pBool": false, + "pKingdom": "LIFE_KINGDOM_UNSPECIFIED" + } + }, + { + "name": "Extreme values", + "serverVerify": true, + "info": { + "fString": "non-ASCII+non-printable string ☺ → ← \"\\\/\b\f\r\t\u1234 works, not newlines yet", + "fInt32": 2147483647, + "fSint32" : 2147483647, + "fSfixed32": 2147483647, + "fUint32": 4294967295, + "fFixed32": 4294967295, + "fInt64": "9223372036854775807", + "fSint64": "9223372036854775807", + "fSfixed64": "9223372036854775807", + "fUint64": "18446744073709551615", + "fFixed64": "18446744073709551615", + "fDouble": 1.797693134862315708145274237317043567981e+308, + "fFloat": 3.40282346638528859811704183484516925440e+38, + "fBool": false, + + "pString": "Goodbye", + "pInt32": 2147483647, + "pDouble": 1.797693134862315708145274237317043567981e+308, + "pBool": false + } + }, + { + "name": "Strings with spaces", + "serverVerify": true, + "info": { + "fString": "Hello there" + } + }, + { + "name": "Strings with quotes", + "serverVerify": true, + "info": { + "fString": "Hello \"You\"" + } + }, + { + "name": "Strings with percents", + "serverVerify": true, + "info": { + "fString": "Hello 100%" + } + } + ] + }, + { + "name": "Fully working conversions, resources", + "rpcs": ["Compliance.RepeatDataBody", "Compliance.RepeatDataBodyPut", "Compliance.RepeatDataBodyPatch", "Compliance.RepeatDataQuery"], + "requests": [ + { + "name": "Strings with slashes and values that resemble subsequent resource templates", + "serverVerify": true, + "info": { + "fString": "first/hello/second/greetings", + "pBool": true, + + "fChild": { + "fString": "second/zzz/bool/true" + } + } + } + ] + }, + { + "name": "Binding selection testing", + "rpcs": ["Compliance.RepeatDataPathResource"], + "requests": [ + { + "name": "Binding testing baseline no Uri verification", + "serverVerify": true, + "info": { + "fString": "first/hello", + "pBool": true, + + "fChild": { + "fString": "second/greetings" + } + } + }, + { + "name": "Binding testing first binding", + "serverVerify": true, + "info": { + "fString": "first/hello", + "pBool": true, + + "fChild": { + "fString": "second/greetings" + } + }, + "intendedBindingUri": "/v1beta1/repeat/{info.f_string=first/*}/{info.f_child.f_string=second/*}/bool/{info.f_bool}:pathresource" + }, + { + "name": "Binding testing additional binding", + "serverVerify": true, + "info": { + "fString": "second/greetings", + "pBool": true, + + "fChild": { + "fString": "first/hello" + } + }, + "intendedBindingUri": "/v1beta1/repeat/{info.f_child.f_string=first/*}/{info.f_string=second/*}/bool/{info.f_bool}:childfirstpathresource" + } + ] + }, + { + "name": "Cases that apply to non-path requests", + "rpcs": ["Compliance.RepeatDataBody", "Compliance.RepeatDataBodyPut", "Compliance.RepeatDataBodyPatch", "Compliance.RepeatDataQuery"], + "requests": [ + { + "name": "Zero values for all fields", + "serverVerify": true, + "info": { + "fString": "", + "fInt32": 0, + "fSint32" : 0, + "fSfixed32": 0, + "fUint32": 0, + "fFixed32": 0, + "fInt64": 0, + "fSint64": 0, + "fSfixed64": 0, + "fUint64": 0, + "fFixed64":20, + "fDouble": 0, + "fFloat": 0, + "fBool": false, + + "pString": "", + "pInt32": 0, + "pDouble": 0, + "pBool": false + } + } + ] + } + ] +} diff --git a/java-showcase/gapic-showcase/src/test/resources/fake_cert.pem b/java-showcase/gapic-showcase/src/test/resources/fake_cert.pem new file mode 100644 index 0000000000..03febfd3ae --- /dev/null +++ b/java-showcase/gapic-showcase/src/test/resources/fake_cert.pem @@ -0,0 +1,15 @@ +-----BEGIN CERTIFICATE----- +MIICUTCCAfugAwIBAgIBADANBgkqhkiG9w0BAQQFADBXMQswCQYDVQQGEwJDTjEL +MAkGA1UECBMCUE4xCzAJBgNVBAcTAkNOMQswCQYDVQQKEwJPTjELMAkGA1UECxMC +VU4xFDASBgNVBAMTC0hlcm9uZyBZYW5nMB4XDTA1MDcxNTIxMTk0N1oXDTA1MDgx +NDIxMTk0N1owVzELMAkGA1UEBhMCQ04xCzAJBgNVBAgTAlBOMQswCQYDVQQHEwJD +TjELMAkGA1UEChMCT04xCzAJBgNVBAsTAlVOMRQwEgYDVQQDEwtIZXJvbmcgWWFu +ZzBcMA0GCSqGSIb3DQEBAQUAA0sAMEgCQQCp5hnG7ogBhtlynpOS21cBewKE/B7j +V14qeyslnr26xZUsSVko36ZnhiaO/zbMOoRcKK9vEcgMtcLFuQTWDl3RAgMBAAGj +gbEwga4wHQYDVR0OBBYEFFXI70krXeQDxZgbaCQoR4jUDncEMH8GA1UdIwR4MHaA +FFXI70krXeQDxZgbaCQoR4jUDncEoVukWTBXMQswCQYDVQQGEwJDTjELMAkGA1UE +CBMCUE4xCzAJBgNVBAcTAkNOMQswCQYDVQQKEwJPTjELMAkGA1UECxMCVU4xFDAS +BgNVBAMTC0hlcm9uZyBZYW5nggEAMAwGA1UdEwQFMAMBAf8wDQYJKoZIhvcNAQEE +BQADQQA/ugzBrjjK9jcWnDVfGHlk3icNRq0oV7Ri32z/+HQX67aRfgZu7KWdI+Ju +Wm7DCfrPNGVwFWUQOmsPue9rZBgO +-----END CERTIFICATE----- diff --git a/java-showcase/gapic-showcase/src/test/resources/test_gdch_credential.json b/java-showcase/gapic-showcase/src/test/resources/test_gdch_credential.json new file mode 100644 index 0000000000..16c2582cdc --- /dev/null +++ b/java-showcase/gapic-showcase/src/test/resources/test_gdch_credential.json @@ -0,0 +1,10 @@ +{ + "type": "gdch_service_account", + "format_version": "1", + "project": "project-id", + "private_key_id": "d84a4fefcf50791d4a90f2d7af17469d6282df9d", + "private_key": "-----BEGIN PRIVATE KEY-----\nMIICdgIBADANBgkqhkiG9w0BAQEFAASCAmAwggJcAgEAAoGBALX0PQoe1igW12i\nkv1bN/r9lN749y2ijmbc/mFHPyS3hNTyOCjDvBbXYbDhQJzWVUikh4mvGBA07qTj79Xc3yBDfKP2IeyYQIFe0t0\nzkd7R9Zdn98Y2rIQC47aAbDfubtkU1U72t4zL11kHvoa0/RuFZjncvlr42X7be7lYh4p3NAgMBAAECgYASk5wDw\n4Az2ZkmeuN6Fk/y9H+Lcb2pskJIXjrL533vrDWGOC48LrsThMQPv8cxBky8HFSEklPpkfTF95tpD43iVwJRB/Gr\nCtGTw65IfJ4/tI09h6zGc4yqvIo1cHX/LQ+SxKLGyir/dQM925rGt/VojxY5ryJR7GLbCzxPnJm/oQJBANwOCO6\nD2hy1LQYJhXh7O+RLtA/tSnT1xyMQsGT+uUCMiKS2bSKx2wxo9k7h3OegNJIu1q6nZ6AbxDK8H3+d0dUCQQDTrP\nSXagBxzp8PecbaCHjzNRSQE2in81qYnrAFNB4o3DpHyMMY6s5ALLeHKscEWnqP8Ur6X4PvzZecCWU9BKAZAkAut\nLPknAuxSCsUOvUfS1i87ex77Ot+w6POp34pEX+UWb+u5iFn2cQacDTHLV1LtE80L8jVLSbrbrlH43H0DjU5AkEA\ngidhycxS86dxpEljnOMCw8CKoUBd5I880IUahEiUltk7OLJYS/Ts1wbn3kPOVX3wyJs8WBDtBkFrDHW2ezth2QJ\nADj3e1YhMVdjJW5jqwlD/VNddGjgzyunmiZg0uOXsHXbytYmsA545S8KRQFaJKFXYYFo2kOjqOiC1T2cAzMDjCQ\n==\n-----END PRIVATE KEY-----\n", + "name": "service-identity-name", + "ca_cert_path": "fake-cert-path", + "token_uri": "https://service-identity.fake-domain/authenticate" +} diff --git a/java-showcase/grpc-gapic-showcase-v1beta1/clirr-ignored-differences.xml b/java-showcase/grpc-gapic-showcase-v1beta1/clirr-ignored-differences.xml new file mode 100644 index 0000000000..731f7543e2 --- /dev/null +++ b/java-showcase/grpc-gapic-showcase-v1beta1/clirr-ignored-differences.xml @@ -0,0 +1,8 @@ + + + + 7012 + com/google/showcase/v1beta1/EchoGrpc$AsyncService + *failEchoWithDetails(*) + + diff --git a/java-showcase/grpc-gapic-showcase-v1beta1/pom.xml b/java-showcase/grpc-gapic-showcase-v1beta1/pom.xml new file mode 100644 index 0000000000..9fce31015f --- /dev/null +++ b/java-showcase/grpc-gapic-showcase-v1beta1/pom.xml @@ -0,0 +1,65 @@ + + 4.0.0 + com.google.api.grpc + grpc-gapic-showcase-v1beta1 + 0.0.1-SNAPSHOT + grpc-gapic-showcase-v1beta1 + GRPC library for grpc-google-cloud-iot-v1 + + com.google.cloud + gapic-showcase-parent + 0.0.1-SNAPSHOT + + + + true + + + + + io.grpc + grpc-api + + + io.grpc + grpc-stub + + + io.grpc + grpc-protobuf + + + com.google.protobuf + protobuf-java + + + com.google.api.grpc + proto-gapic-showcase-v1beta1 + + + com.google.api.grpc + proto-google-iam-v1 + + + com.google.guava + guava + + + + + + + showcase-sonar-analysis + + + enableShowcaseTestCoverage + + + + true + + + + diff --git a/java-showcase/grpc-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ComplianceGrpc.java b/java-showcase/grpc-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ComplianceGrpc.java new file mode 100644 index 0000000000..50d218cf70 --- /dev/null +++ b/java-showcase/grpc-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ComplianceGrpc.java @@ -0,0 +1,1638 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.showcase.v1beta1; + +import static io.grpc.MethodDescriptor.generateFullMethodName; + +/** + * + * + *

        + * This service is used to test that GAPICs implement various REST-related features correctly. This mostly means transcoding proto3 requests to REST format
        + * correctly for various types of HTTP annotations, but it also includes verifying that unknown (numeric) enums received by clients can be round-tripped
        + * correctly.
        + * 
        + */ +@io.grpc.stub.annotations.GrpcGenerated +public final class ComplianceGrpc { + + private ComplianceGrpc() {} + + public static final java.lang.String SERVICE_NAME = "google.showcase.v1beta1.Compliance"; + + // Static method descriptors that strictly reflect the proto. + private static volatile io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.RepeatRequest, com.google.showcase.v1beta1.RepeatResponse> + getRepeatDataBodyMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "RepeatDataBody", + requestType = com.google.showcase.v1beta1.RepeatRequest.class, + responseType = com.google.showcase.v1beta1.RepeatResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.RepeatRequest, com.google.showcase.v1beta1.RepeatResponse> + getRepeatDataBodyMethod() { + io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.RepeatRequest, com.google.showcase.v1beta1.RepeatResponse> + getRepeatDataBodyMethod; + if ((getRepeatDataBodyMethod = ComplianceGrpc.getRepeatDataBodyMethod) == null) { + synchronized (ComplianceGrpc.class) { + if ((getRepeatDataBodyMethod = ComplianceGrpc.getRepeatDataBodyMethod) == null) { + ComplianceGrpc.getRepeatDataBodyMethod = + getRepeatDataBodyMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "RepeatDataBody")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.RepeatRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.RepeatResponse.getDefaultInstance())) + .setSchemaDescriptor(new ComplianceMethodDescriptorSupplier("RepeatDataBody")) + .build(); + } + } + } + return getRepeatDataBodyMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.RepeatRequest, com.google.showcase.v1beta1.RepeatResponse> + getRepeatDataBodyInfoMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "RepeatDataBodyInfo", + requestType = com.google.showcase.v1beta1.RepeatRequest.class, + responseType = com.google.showcase.v1beta1.RepeatResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.RepeatRequest, com.google.showcase.v1beta1.RepeatResponse> + getRepeatDataBodyInfoMethod() { + io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.RepeatRequest, com.google.showcase.v1beta1.RepeatResponse> + getRepeatDataBodyInfoMethod; + if ((getRepeatDataBodyInfoMethod = ComplianceGrpc.getRepeatDataBodyInfoMethod) == null) { + synchronized (ComplianceGrpc.class) { + if ((getRepeatDataBodyInfoMethod = ComplianceGrpc.getRepeatDataBodyInfoMethod) == null) { + ComplianceGrpc.getRepeatDataBodyInfoMethod = + getRepeatDataBodyInfoMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "RepeatDataBodyInfo")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.RepeatRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.RepeatResponse.getDefaultInstance())) + .setSchemaDescriptor( + new ComplianceMethodDescriptorSupplier("RepeatDataBodyInfo")) + .build(); + } + } + } + return getRepeatDataBodyInfoMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.RepeatRequest, com.google.showcase.v1beta1.RepeatResponse> + getRepeatDataQueryMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "RepeatDataQuery", + requestType = com.google.showcase.v1beta1.RepeatRequest.class, + responseType = com.google.showcase.v1beta1.RepeatResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.RepeatRequest, com.google.showcase.v1beta1.RepeatResponse> + getRepeatDataQueryMethod() { + io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.RepeatRequest, com.google.showcase.v1beta1.RepeatResponse> + getRepeatDataQueryMethod; + if ((getRepeatDataQueryMethod = ComplianceGrpc.getRepeatDataQueryMethod) == null) { + synchronized (ComplianceGrpc.class) { + if ((getRepeatDataQueryMethod = ComplianceGrpc.getRepeatDataQueryMethod) == null) { + ComplianceGrpc.getRepeatDataQueryMethod = + getRepeatDataQueryMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "RepeatDataQuery")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.RepeatRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.RepeatResponse.getDefaultInstance())) + .setSchemaDescriptor( + new ComplianceMethodDescriptorSupplier("RepeatDataQuery")) + .build(); + } + } + } + return getRepeatDataQueryMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.RepeatRequest, com.google.showcase.v1beta1.RepeatResponse> + getRepeatDataSimplePathMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "RepeatDataSimplePath", + requestType = com.google.showcase.v1beta1.RepeatRequest.class, + responseType = com.google.showcase.v1beta1.RepeatResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.RepeatRequest, com.google.showcase.v1beta1.RepeatResponse> + getRepeatDataSimplePathMethod() { + io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.RepeatRequest, com.google.showcase.v1beta1.RepeatResponse> + getRepeatDataSimplePathMethod; + if ((getRepeatDataSimplePathMethod = ComplianceGrpc.getRepeatDataSimplePathMethod) == null) { + synchronized (ComplianceGrpc.class) { + if ((getRepeatDataSimplePathMethod = ComplianceGrpc.getRepeatDataSimplePathMethod) + == null) { + ComplianceGrpc.getRepeatDataSimplePathMethod = + getRepeatDataSimplePathMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName(SERVICE_NAME, "RepeatDataSimplePath")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.RepeatRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.RepeatResponse.getDefaultInstance())) + .setSchemaDescriptor( + new ComplianceMethodDescriptorSupplier("RepeatDataSimplePath")) + .build(); + } + } + } + return getRepeatDataSimplePathMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.RepeatRequest, com.google.showcase.v1beta1.RepeatResponse> + getRepeatDataPathResourceMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "RepeatDataPathResource", + requestType = com.google.showcase.v1beta1.RepeatRequest.class, + responseType = com.google.showcase.v1beta1.RepeatResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.RepeatRequest, com.google.showcase.v1beta1.RepeatResponse> + getRepeatDataPathResourceMethod() { + io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.RepeatRequest, com.google.showcase.v1beta1.RepeatResponse> + getRepeatDataPathResourceMethod; + if ((getRepeatDataPathResourceMethod = ComplianceGrpc.getRepeatDataPathResourceMethod) + == null) { + synchronized (ComplianceGrpc.class) { + if ((getRepeatDataPathResourceMethod = ComplianceGrpc.getRepeatDataPathResourceMethod) + == null) { + ComplianceGrpc.getRepeatDataPathResourceMethod = + getRepeatDataPathResourceMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName(SERVICE_NAME, "RepeatDataPathResource")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.RepeatRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.RepeatResponse.getDefaultInstance())) + .setSchemaDescriptor( + new ComplianceMethodDescriptorSupplier("RepeatDataPathResource")) + .build(); + } + } + } + return getRepeatDataPathResourceMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.RepeatRequest, com.google.showcase.v1beta1.RepeatResponse> + getRepeatDataPathTrailingResourceMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "RepeatDataPathTrailingResource", + requestType = com.google.showcase.v1beta1.RepeatRequest.class, + responseType = com.google.showcase.v1beta1.RepeatResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.RepeatRequest, com.google.showcase.v1beta1.RepeatResponse> + getRepeatDataPathTrailingResourceMethod() { + io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.RepeatRequest, com.google.showcase.v1beta1.RepeatResponse> + getRepeatDataPathTrailingResourceMethod; + if ((getRepeatDataPathTrailingResourceMethod = + ComplianceGrpc.getRepeatDataPathTrailingResourceMethod) + == null) { + synchronized (ComplianceGrpc.class) { + if ((getRepeatDataPathTrailingResourceMethod = + ComplianceGrpc.getRepeatDataPathTrailingResourceMethod) + == null) { + ComplianceGrpc.getRepeatDataPathTrailingResourceMethod = + getRepeatDataPathTrailingResourceMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName(SERVICE_NAME, "RepeatDataPathTrailingResource")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.RepeatRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.RepeatResponse.getDefaultInstance())) + .setSchemaDescriptor( + new ComplianceMethodDescriptorSupplier("RepeatDataPathTrailingResource")) + .build(); + } + } + } + return getRepeatDataPathTrailingResourceMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.RepeatRequest, com.google.showcase.v1beta1.RepeatResponse> + getRepeatDataBodyPutMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "RepeatDataBodyPut", + requestType = com.google.showcase.v1beta1.RepeatRequest.class, + responseType = com.google.showcase.v1beta1.RepeatResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.RepeatRequest, com.google.showcase.v1beta1.RepeatResponse> + getRepeatDataBodyPutMethod() { + io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.RepeatRequest, com.google.showcase.v1beta1.RepeatResponse> + getRepeatDataBodyPutMethod; + if ((getRepeatDataBodyPutMethod = ComplianceGrpc.getRepeatDataBodyPutMethod) == null) { + synchronized (ComplianceGrpc.class) { + if ((getRepeatDataBodyPutMethod = ComplianceGrpc.getRepeatDataBodyPutMethod) == null) { + ComplianceGrpc.getRepeatDataBodyPutMethod = + getRepeatDataBodyPutMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "RepeatDataBodyPut")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.RepeatRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.RepeatResponse.getDefaultInstance())) + .setSchemaDescriptor( + new ComplianceMethodDescriptorSupplier("RepeatDataBodyPut")) + .build(); + } + } + } + return getRepeatDataBodyPutMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.RepeatRequest, com.google.showcase.v1beta1.RepeatResponse> + getRepeatDataBodyPatchMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "RepeatDataBodyPatch", + requestType = com.google.showcase.v1beta1.RepeatRequest.class, + responseType = com.google.showcase.v1beta1.RepeatResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.RepeatRequest, com.google.showcase.v1beta1.RepeatResponse> + getRepeatDataBodyPatchMethod() { + io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.RepeatRequest, com.google.showcase.v1beta1.RepeatResponse> + getRepeatDataBodyPatchMethod; + if ((getRepeatDataBodyPatchMethod = ComplianceGrpc.getRepeatDataBodyPatchMethod) == null) { + synchronized (ComplianceGrpc.class) { + if ((getRepeatDataBodyPatchMethod = ComplianceGrpc.getRepeatDataBodyPatchMethod) == null) { + ComplianceGrpc.getRepeatDataBodyPatchMethod = + getRepeatDataBodyPatchMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName(SERVICE_NAME, "RepeatDataBodyPatch")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.RepeatRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.RepeatResponse.getDefaultInstance())) + .setSchemaDescriptor( + new ComplianceMethodDescriptorSupplier("RepeatDataBodyPatch")) + .build(); + } + } + } + return getRepeatDataBodyPatchMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.EnumRequest, com.google.showcase.v1beta1.EnumResponse> + getGetEnumMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "GetEnum", + requestType = com.google.showcase.v1beta1.EnumRequest.class, + responseType = com.google.showcase.v1beta1.EnumResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.EnumRequest, com.google.showcase.v1beta1.EnumResponse> + getGetEnumMethod() { + io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.EnumRequest, com.google.showcase.v1beta1.EnumResponse> + getGetEnumMethod; + if ((getGetEnumMethod = ComplianceGrpc.getGetEnumMethod) == null) { + synchronized (ComplianceGrpc.class) { + if ((getGetEnumMethod = ComplianceGrpc.getGetEnumMethod) == null) { + ComplianceGrpc.getGetEnumMethod = + getGetEnumMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetEnum")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.EnumRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.EnumResponse.getDefaultInstance())) + .setSchemaDescriptor(new ComplianceMethodDescriptorSupplier("GetEnum")) + .build(); + } + } + } + return getGetEnumMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.EnumResponse, com.google.showcase.v1beta1.EnumResponse> + getVerifyEnumMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "VerifyEnum", + requestType = com.google.showcase.v1beta1.EnumResponse.class, + responseType = com.google.showcase.v1beta1.EnumResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.EnumResponse, com.google.showcase.v1beta1.EnumResponse> + getVerifyEnumMethod() { + io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.EnumResponse, com.google.showcase.v1beta1.EnumResponse> + getVerifyEnumMethod; + if ((getVerifyEnumMethod = ComplianceGrpc.getVerifyEnumMethod) == null) { + synchronized (ComplianceGrpc.class) { + if ((getVerifyEnumMethod = ComplianceGrpc.getVerifyEnumMethod) == null) { + ComplianceGrpc.getVerifyEnumMethod = + getVerifyEnumMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "VerifyEnum")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.EnumResponse.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.EnumResponse.getDefaultInstance())) + .setSchemaDescriptor(new ComplianceMethodDescriptorSupplier("VerifyEnum")) + .build(); + } + } + } + return getVerifyEnumMethod; + } + + /** Creates a new async stub that supports all call types for the service */ + public static ComplianceStub newStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public ComplianceStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new ComplianceStub(channel, callOptions); + } + }; + return ComplianceStub.newStub(factory, channel); + } + + /** Creates a new blocking-style stub that supports all types of calls on the service */ + public static ComplianceBlockingV2Stub newBlockingV2Stub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public ComplianceBlockingV2Stub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new ComplianceBlockingV2Stub(channel, callOptions); + } + }; + return ComplianceBlockingV2Stub.newStub(factory, channel); + } + + /** + * Creates a new blocking-style stub that supports unary and streaming output calls on the service + */ + public static ComplianceBlockingStub newBlockingStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public ComplianceBlockingStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new ComplianceBlockingStub(channel, callOptions); + } + }; + return ComplianceBlockingStub.newStub(factory, channel); + } + + /** Creates a new ListenableFuture-style stub that supports unary calls on the service */ + public static ComplianceFutureStub newFutureStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public ComplianceFutureStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new ComplianceFutureStub(channel, callOptions); + } + }; + return ComplianceFutureStub.newStub(factory, channel); + } + + /** + * + * + *
        +   * This service is used to test that GAPICs implement various REST-related features correctly. This mostly means transcoding proto3 requests to REST format
        +   * correctly for various types of HTTP annotations, but it also includes verifying that unknown (numeric) enums received by clients can be round-tripped
        +   * correctly.
        +   * 
        + */ + public interface AsyncService { + + /** + * + * + *
        +     * This method echoes the ComplianceData request. This method exercises
        +     * sending the entire request object in the REST body.
        +     * 
        + */ + default void repeatDataBody( + com.google.showcase.v1beta1.RepeatRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getRepeatDataBodyMethod(), responseObserver); + } + + /** + * + * + *
        +     * This method echoes the ComplianceData request. This method exercises
        +     * sending the a message-type field in the REST body. Per AIP-127, only
        +     * top-level, non-repeated fields can be sent this way.
        +     * 
        + */ + default void repeatDataBodyInfo( + com.google.showcase.v1beta1.RepeatRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getRepeatDataBodyInfoMethod(), responseObserver); + } + + /** + * + * + *
        +     * This method echoes the ComplianceData request. This method exercises
        +     * sending all request fields as query parameters.
        +     * 
        + */ + default void repeatDataQuery( + com.google.showcase.v1beta1.RepeatRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getRepeatDataQueryMethod(), responseObserver); + } + + /** + * + * + *
        +     * This method echoes the ComplianceData request. This method exercises
        +     * sending some parameters as "simple" path variables (i.e., of the form
        +     * "/bar/{foo}" rather than "/{foo=bar/*}"), and the rest as query parameters.
        +     * 
        + */ + default void repeatDataSimplePath( + com.google.showcase.v1beta1.RepeatRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getRepeatDataSimplePathMethod(), responseObserver); + } + + /** + * + * + *
        +     * Same as RepeatDataSimplePath, but with a path resource.
        +     * 
        + */ + default void repeatDataPathResource( + com.google.showcase.v1beta1.RepeatRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getRepeatDataPathResourceMethod(), responseObserver); + } + + /** + * + * + *
        +     * Same as RepeatDataSimplePath, but with a trailing resource.
        +     * 
        + */ + default void repeatDataPathTrailingResource( + com.google.showcase.v1beta1.RepeatRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getRepeatDataPathTrailingResourceMethod(), responseObserver); + } + + /** + * + * + *
        +     * This method echoes the ComplianceData request, using the HTTP PUT method.
        +     * 
        + */ + default void repeatDataBodyPut( + com.google.showcase.v1beta1.RepeatRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getRepeatDataBodyPutMethod(), responseObserver); + } + + /** + * + * + *
        +     * This method echoes the ComplianceData request, using the HTTP PATCH method.
        +     * 
        + */ + default void repeatDataBodyPatch( + com.google.showcase.v1beta1.RepeatRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getRepeatDataBodyPatchMethod(), responseObserver); + } + + /** + * + * + *
        +     * This method requests an enum value from the server. Depending on the contents of EnumRequest, the enum value returned will be a known enum declared in the
        +     * .proto file, or a made-up enum value the is unknown to the client. To verify that clients can round-trip unknown enum values they receive, use the
        +     * response from this RPC as the request to VerifyEnum()
        +     * The values of enums sent by the server when a known or unknown value is requested will be the same within a single Showcase server run (this is needed for
        +     * VerifyEnum() to work) but are not guaranteed to be the same across separate Showcase server runs.
        +     * 
        + */ + default void getEnum( + com.google.showcase.v1beta1.EnumRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getGetEnumMethod(), responseObserver); + } + + /** + * + * + *
        +     * This method is used to verify that clients can round-trip enum values, which is particularly important for unknown enum values over REST. VerifyEnum()
        +     * verifies that its request, which is presumably the response that the client previously got to a GetEnum(), contains the correct data. If so, it responds
        +     * with the same EnumResponse; otherwise, the RPC errors.
        +     * This works because the values of enums sent by the server when a known or unknown value is requested will be the same within a single Showcase server run,
        +     * although they are not guaranteed to be the same across separate Showcase server runs.
        +     * 
        + */ + default void verifyEnum( + com.google.showcase.v1beta1.EnumResponse request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getVerifyEnumMethod(), responseObserver); + } + } + + /** + * Base class for the server implementation of the service Compliance. + * + *
        +   * This service is used to test that GAPICs implement various REST-related features correctly. This mostly means transcoding proto3 requests to REST format
        +   * correctly for various types of HTTP annotations, but it also includes verifying that unknown (numeric) enums received by clients can be round-tripped
        +   * correctly.
        +   * 
        + */ + public abstract static class ComplianceImplBase implements io.grpc.BindableService, AsyncService { + + @java.lang.Override + public final io.grpc.ServerServiceDefinition bindService() { + return ComplianceGrpc.bindService(this); + } + } + + /** + * A stub to allow clients to do asynchronous rpc calls to service Compliance. + * + *
        +   * This service is used to test that GAPICs implement various REST-related features correctly. This mostly means transcoding proto3 requests to REST format
        +   * correctly for various types of HTTP annotations, but it also includes verifying that unknown (numeric) enums received by clients can be round-tripped
        +   * correctly.
        +   * 
        + */ + public static final class ComplianceStub extends io.grpc.stub.AbstractAsyncStub { + private ComplianceStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected ComplianceStub build(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new ComplianceStub(channel, callOptions); + } + + /** + * + * + *
        +     * This method echoes the ComplianceData request. This method exercises
        +     * sending the entire request object in the REST body.
        +     * 
        + */ + public void repeatDataBody( + com.google.showcase.v1beta1.RepeatRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getRepeatDataBodyMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
        +     * This method echoes the ComplianceData request. This method exercises
        +     * sending the a message-type field in the REST body. Per AIP-127, only
        +     * top-level, non-repeated fields can be sent this way.
        +     * 
        + */ + public void repeatDataBodyInfo( + com.google.showcase.v1beta1.RepeatRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getRepeatDataBodyInfoMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
        +     * This method echoes the ComplianceData request. This method exercises
        +     * sending all request fields as query parameters.
        +     * 
        + */ + public void repeatDataQuery( + com.google.showcase.v1beta1.RepeatRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getRepeatDataQueryMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
        +     * This method echoes the ComplianceData request. This method exercises
        +     * sending some parameters as "simple" path variables (i.e., of the form
        +     * "/bar/{foo}" rather than "/{foo=bar/*}"), and the rest as query parameters.
        +     * 
        + */ + public void repeatDataSimplePath( + com.google.showcase.v1beta1.RepeatRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getRepeatDataSimplePathMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
        +     * Same as RepeatDataSimplePath, but with a path resource.
        +     * 
        + */ + public void repeatDataPathResource( + com.google.showcase.v1beta1.RepeatRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getRepeatDataPathResourceMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
        +     * Same as RepeatDataSimplePath, but with a trailing resource.
        +     * 
        + */ + public void repeatDataPathTrailingResource( + com.google.showcase.v1beta1.RepeatRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getRepeatDataPathTrailingResourceMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
        +     * This method echoes the ComplianceData request, using the HTTP PUT method.
        +     * 
        + */ + public void repeatDataBodyPut( + com.google.showcase.v1beta1.RepeatRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getRepeatDataBodyPutMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
        +     * This method echoes the ComplianceData request, using the HTTP PATCH method.
        +     * 
        + */ + public void repeatDataBodyPatch( + com.google.showcase.v1beta1.RepeatRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getRepeatDataBodyPatchMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
        +     * This method requests an enum value from the server. Depending on the contents of EnumRequest, the enum value returned will be a known enum declared in the
        +     * .proto file, or a made-up enum value the is unknown to the client. To verify that clients can round-trip unknown enum values they receive, use the
        +     * response from this RPC as the request to VerifyEnum()
        +     * The values of enums sent by the server when a known or unknown value is requested will be the same within a single Showcase server run (this is needed for
        +     * VerifyEnum() to work) but are not guaranteed to be the same across separate Showcase server runs.
        +     * 
        + */ + public void getEnum( + com.google.showcase.v1beta1.EnumRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getGetEnumMethod(), getCallOptions()), request, responseObserver); + } + + /** + * + * + *
        +     * This method is used to verify that clients can round-trip enum values, which is particularly important for unknown enum values over REST. VerifyEnum()
        +     * verifies that its request, which is presumably the response that the client previously got to a GetEnum(), contains the correct data. If so, it responds
        +     * with the same EnumResponse; otherwise, the RPC errors.
        +     * This works because the values of enums sent by the server when a known or unknown value is requested will be the same within a single Showcase server run,
        +     * although they are not guaranteed to be the same across separate Showcase server runs.
        +     * 
        + */ + public void verifyEnum( + com.google.showcase.v1beta1.EnumResponse request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getVerifyEnumMethod(), getCallOptions()), request, responseObserver); + } + } + + /** + * A stub to allow clients to do synchronous rpc calls to service Compliance. + * + *
        +   * This service is used to test that GAPICs implement various REST-related features correctly. This mostly means transcoding proto3 requests to REST format
        +   * correctly for various types of HTTP annotations, but it also includes verifying that unknown (numeric) enums received by clients can be round-tripped
        +   * correctly.
        +   * 
        + */ + public static final class ComplianceBlockingV2Stub + extends io.grpc.stub.AbstractBlockingStub { + private ComplianceBlockingV2Stub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected ComplianceBlockingV2Stub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new ComplianceBlockingV2Stub(channel, callOptions); + } + + /** + * + * + *
        +     * This method echoes the ComplianceData request. This method exercises
        +     * sending the entire request object in the REST body.
        +     * 
        + */ + public com.google.showcase.v1beta1.RepeatResponse repeatDataBody( + com.google.showcase.v1beta1.RepeatRequest request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getRepeatDataBodyMethod(), getCallOptions(), request); + } + + /** + * + * + *
        +     * This method echoes the ComplianceData request. This method exercises
        +     * sending the a message-type field in the REST body. Per AIP-127, only
        +     * top-level, non-repeated fields can be sent this way.
        +     * 
        + */ + public com.google.showcase.v1beta1.RepeatResponse repeatDataBodyInfo( + com.google.showcase.v1beta1.RepeatRequest request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getRepeatDataBodyInfoMethod(), getCallOptions(), request); + } + + /** + * + * + *
        +     * This method echoes the ComplianceData request. This method exercises
        +     * sending all request fields as query parameters.
        +     * 
        + */ + public com.google.showcase.v1beta1.RepeatResponse repeatDataQuery( + com.google.showcase.v1beta1.RepeatRequest request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getRepeatDataQueryMethod(), getCallOptions(), request); + } + + /** + * + * + *
        +     * This method echoes the ComplianceData request. This method exercises
        +     * sending some parameters as "simple" path variables (i.e., of the form
        +     * "/bar/{foo}" rather than "/{foo=bar/*}"), and the rest as query parameters.
        +     * 
        + */ + public com.google.showcase.v1beta1.RepeatResponse repeatDataSimplePath( + com.google.showcase.v1beta1.RepeatRequest request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getRepeatDataSimplePathMethod(), getCallOptions(), request); + } + + /** + * + * + *
        +     * Same as RepeatDataSimplePath, but with a path resource.
        +     * 
        + */ + public com.google.showcase.v1beta1.RepeatResponse repeatDataPathResource( + com.google.showcase.v1beta1.RepeatRequest request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getRepeatDataPathResourceMethod(), getCallOptions(), request); + } + + /** + * + * + *
        +     * Same as RepeatDataSimplePath, but with a trailing resource.
        +     * 
        + */ + public com.google.showcase.v1beta1.RepeatResponse repeatDataPathTrailingResource( + com.google.showcase.v1beta1.RepeatRequest request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getRepeatDataPathTrailingResourceMethod(), getCallOptions(), request); + } + + /** + * + * + *
        +     * This method echoes the ComplianceData request, using the HTTP PUT method.
        +     * 
        + */ + public com.google.showcase.v1beta1.RepeatResponse repeatDataBodyPut( + com.google.showcase.v1beta1.RepeatRequest request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getRepeatDataBodyPutMethod(), getCallOptions(), request); + } + + /** + * + * + *
        +     * This method echoes the ComplianceData request, using the HTTP PATCH method.
        +     * 
        + */ + public com.google.showcase.v1beta1.RepeatResponse repeatDataBodyPatch( + com.google.showcase.v1beta1.RepeatRequest request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getRepeatDataBodyPatchMethod(), getCallOptions(), request); + } + + /** + * + * + *
        +     * This method requests an enum value from the server. Depending on the contents of EnumRequest, the enum value returned will be a known enum declared in the
        +     * .proto file, or a made-up enum value the is unknown to the client. To verify that clients can round-trip unknown enum values they receive, use the
        +     * response from this RPC as the request to VerifyEnum()
        +     * The values of enums sent by the server when a known or unknown value is requested will be the same within a single Showcase server run (this is needed for
        +     * VerifyEnum() to work) but are not guaranteed to be the same across separate Showcase server runs.
        +     * 
        + */ + public com.google.showcase.v1beta1.EnumResponse getEnum( + com.google.showcase.v1beta1.EnumRequest request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getGetEnumMethod(), getCallOptions(), request); + } + + /** + * + * + *
        +     * This method is used to verify that clients can round-trip enum values, which is particularly important for unknown enum values over REST. VerifyEnum()
        +     * verifies that its request, which is presumably the response that the client previously got to a GetEnum(), contains the correct data. If so, it responds
        +     * with the same EnumResponse; otherwise, the RPC errors.
        +     * This works because the values of enums sent by the server when a known or unknown value is requested will be the same within a single Showcase server run,
        +     * although they are not guaranteed to be the same across separate Showcase server runs.
        +     * 
        + */ + public com.google.showcase.v1beta1.EnumResponse verifyEnum( + com.google.showcase.v1beta1.EnumResponse request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getVerifyEnumMethod(), getCallOptions(), request); + } + } + + /** + * A stub to allow clients to do limited synchronous rpc calls to service Compliance. + * + *
        +   * This service is used to test that GAPICs implement various REST-related features correctly. This mostly means transcoding proto3 requests to REST format
        +   * correctly for various types of HTTP annotations, but it also includes verifying that unknown (numeric) enums received by clients can be round-tripped
        +   * correctly.
        +   * 
        + */ + public static final class ComplianceBlockingStub + extends io.grpc.stub.AbstractBlockingStub { + private ComplianceBlockingStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected ComplianceBlockingStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new ComplianceBlockingStub(channel, callOptions); + } + + /** + * + * + *
        +     * This method echoes the ComplianceData request. This method exercises
        +     * sending the entire request object in the REST body.
        +     * 
        + */ + public com.google.showcase.v1beta1.RepeatResponse repeatDataBody( + com.google.showcase.v1beta1.RepeatRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getRepeatDataBodyMethod(), getCallOptions(), request); + } + + /** + * + * + *
        +     * This method echoes the ComplianceData request. This method exercises
        +     * sending the a message-type field in the REST body. Per AIP-127, only
        +     * top-level, non-repeated fields can be sent this way.
        +     * 
        + */ + public com.google.showcase.v1beta1.RepeatResponse repeatDataBodyInfo( + com.google.showcase.v1beta1.RepeatRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getRepeatDataBodyInfoMethod(), getCallOptions(), request); + } + + /** + * + * + *
        +     * This method echoes the ComplianceData request. This method exercises
        +     * sending all request fields as query parameters.
        +     * 
        + */ + public com.google.showcase.v1beta1.RepeatResponse repeatDataQuery( + com.google.showcase.v1beta1.RepeatRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getRepeatDataQueryMethod(), getCallOptions(), request); + } + + /** + * + * + *
        +     * This method echoes the ComplianceData request. This method exercises
        +     * sending some parameters as "simple" path variables (i.e., of the form
        +     * "/bar/{foo}" rather than "/{foo=bar/*}"), and the rest as query parameters.
        +     * 
        + */ + public com.google.showcase.v1beta1.RepeatResponse repeatDataSimplePath( + com.google.showcase.v1beta1.RepeatRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getRepeatDataSimplePathMethod(), getCallOptions(), request); + } + + /** + * + * + *
        +     * Same as RepeatDataSimplePath, but with a path resource.
        +     * 
        + */ + public com.google.showcase.v1beta1.RepeatResponse repeatDataPathResource( + com.google.showcase.v1beta1.RepeatRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getRepeatDataPathResourceMethod(), getCallOptions(), request); + } + + /** + * + * + *
        +     * Same as RepeatDataSimplePath, but with a trailing resource.
        +     * 
        + */ + public com.google.showcase.v1beta1.RepeatResponse repeatDataPathTrailingResource( + com.google.showcase.v1beta1.RepeatRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getRepeatDataPathTrailingResourceMethod(), getCallOptions(), request); + } + + /** + * + * + *
        +     * This method echoes the ComplianceData request, using the HTTP PUT method.
        +     * 
        + */ + public com.google.showcase.v1beta1.RepeatResponse repeatDataBodyPut( + com.google.showcase.v1beta1.RepeatRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getRepeatDataBodyPutMethod(), getCallOptions(), request); + } + + /** + * + * + *
        +     * This method echoes the ComplianceData request, using the HTTP PATCH method.
        +     * 
        + */ + public com.google.showcase.v1beta1.RepeatResponse repeatDataBodyPatch( + com.google.showcase.v1beta1.RepeatRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getRepeatDataBodyPatchMethod(), getCallOptions(), request); + } + + /** + * + * + *
        +     * This method requests an enum value from the server. Depending on the contents of EnumRequest, the enum value returned will be a known enum declared in the
        +     * .proto file, or a made-up enum value the is unknown to the client. To verify that clients can round-trip unknown enum values they receive, use the
        +     * response from this RPC as the request to VerifyEnum()
        +     * The values of enums sent by the server when a known or unknown value is requested will be the same within a single Showcase server run (this is needed for
        +     * VerifyEnum() to work) but are not guaranteed to be the same across separate Showcase server runs.
        +     * 
        + */ + public com.google.showcase.v1beta1.EnumResponse getEnum( + com.google.showcase.v1beta1.EnumRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getGetEnumMethod(), getCallOptions(), request); + } + + /** + * + * + *
        +     * This method is used to verify that clients can round-trip enum values, which is particularly important for unknown enum values over REST. VerifyEnum()
        +     * verifies that its request, which is presumably the response that the client previously got to a GetEnum(), contains the correct data. If so, it responds
        +     * with the same EnumResponse; otherwise, the RPC errors.
        +     * This works because the values of enums sent by the server when a known or unknown value is requested will be the same within a single Showcase server run,
        +     * although they are not guaranteed to be the same across separate Showcase server runs.
        +     * 
        + */ + public com.google.showcase.v1beta1.EnumResponse verifyEnum( + com.google.showcase.v1beta1.EnumResponse request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getVerifyEnumMethod(), getCallOptions(), request); + } + } + + /** + * A stub to allow clients to do ListenableFuture-style rpc calls to service Compliance. + * + *
        +   * This service is used to test that GAPICs implement various REST-related features correctly. This mostly means transcoding proto3 requests to REST format
        +   * correctly for various types of HTTP annotations, but it also includes verifying that unknown (numeric) enums received by clients can be round-tripped
        +   * correctly.
        +   * 
        + */ + public static final class ComplianceFutureStub + extends io.grpc.stub.AbstractFutureStub { + private ComplianceFutureStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected ComplianceFutureStub build(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new ComplianceFutureStub(channel, callOptions); + } + + /** + * + * + *
        +     * This method echoes the ComplianceData request. This method exercises
        +     * sending the entire request object in the REST body.
        +     * 
        + */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.showcase.v1beta1.RepeatResponse> + repeatDataBody(com.google.showcase.v1beta1.RepeatRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getRepeatDataBodyMethod(), getCallOptions()), request); + } + + /** + * + * + *
        +     * This method echoes the ComplianceData request. This method exercises
        +     * sending the a message-type field in the REST body. Per AIP-127, only
        +     * top-level, non-repeated fields can be sent this way.
        +     * 
        + */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.showcase.v1beta1.RepeatResponse> + repeatDataBodyInfo(com.google.showcase.v1beta1.RepeatRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getRepeatDataBodyInfoMethod(), getCallOptions()), request); + } + + /** + * + * + *
        +     * This method echoes the ComplianceData request. This method exercises
        +     * sending all request fields as query parameters.
        +     * 
        + */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.showcase.v1beta1.RepeatResponse> + repeatDataQuery(com.google.showcase.v1beta1.RepeatRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getRepeatDataQueryMethod(), getCallOptions()), request); + } + + /** + * + * + *
        +     * This method echoes the ComplianceData request. This method exercises
        +     * sending some parameters as "simple" path variables (i.e., of the form
        +     * "/bar/{foo}" rather than "/{foo=bar/*}"), and the rest as query parameters.
        +     * 
        + */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.showcase.v1beta1.RepeatResponse> + repeatDataSimplePath(com.google.showcase.v1beta1.RepeatRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getRepeatDataSimplePathMethod(), getCallOptions()), request); + } + + /** + * + * + *
        +     * Same as RepeatDataSimplePath, but with a path resource.
        +     * 
        + */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.showcase.v1beta1.RepeatResponse> + repeatDataPathResource(com.google.showcase.v1beta1.RepeatRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getRepeatDataPathResourceMethod(), getCallOptions()), request); + } + + /** + * + * + *
        +     * Same as RepeatDataSimplePath, but with a trailing resource.
        +     * 
        + */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.showcase.v1beta1.RepeatResponse> + repeatDataPathTrailingResource(com.google.showcase.v1beta1.RepeatRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getRepeatDataPathTrailingResourceMethod(), getCallOptions()), + request); + } + + /** + * + * + *
        +     * This method echoes the ComplianceData request, using the HTTP PUT method.
        +     * 
        + */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.showcase.v1beta1.RepeatResponse> + repeatDataBodyPut(com.google.showcase.v1beta1.RepeatRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getRepeatDataBodyPutMethod(), getCallOptions()), request); + } + + /** + * + * + *
        +     * This method echoes the ComplianceData request, using the HTTP PATCH method.
        +     * 
        + */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.showcase.v1beta1.RepeatResponse> + repeatDataBodyPatch(com.google.showcase.v1beta1.RepeatRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getRepeatDataBodyPatchMethod(), getCallOptions()), request); + } + + /** + * + * + *
        +     * This method requests an enum value from the server. Depending on the contents of EnumRequest, the enum value returned will be a known enum declared in the
        +     * .proto file, or a made-up enum value the is unknown to the client. To verify that clients can round-trip unknown enum values they receive, use the
        +     * response from this RPC as the request to VerifyEnum()
        +     * The values of enums sent by the server when a known or unknown value is requested will be the same within a single Showcase server run (this is needed for
        +     * VerifyEnum() to work) but are not guaranteed to be the same across separate Showcase server runs.
        +     * 
        + */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.showcase.v1beta1.EnumResponse> + getEnum(com.google.showcase.v1beta1.EnumRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getGetEnumMethod(), getCallOptions()), request); + } + + /** + * + * + *
        +     * This method is used to verify that clients can round-trip enum values, which is particularly important for unknown enum values over REST. VerifyEnum()
        +     * verifies that its request, which is presumably the response that the client previously got to a GetEnum(), contains the correct data. If so, it responds
        +     * with the same EnumResponse; otherwise, the RPC errors.
        +     * This works because the values of enums sent by the server when a known or unknown value is requested will be the same within a single Showcase server run,
        +     * although they are not guaranteed to be the same across separate Showcase server runs.
        +     * 
        + */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.showcase.v1beta1.EnumResponse> + verifyEnum(com.google.showcase.v1beta1.EnumResponse request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getVerifyEnumMethod(), getCallOptions()), request); + } + } + + private static final int METHODID_REPEAT_DATA_BODY = 0; + private static final int METHODID_REPEAT_DATA_BODY_INFO = 1; + private static final int METHODID_REPEAT_DATA_QUERY = 2; + private static final int METHODID_REPEAT_DATA_SIMPLE_PATH = 3; + private static final int METHODID_REPEAT_DATA_PATH_RESOURCE = 4; + private static final int METHODID_REPEAT_DATA_PATH_TRAILING_RESOURCE = 5; + private static final int METHODID_REPEAT_DATA_BODY_PUT = 6; + private static final int METHODID_REPEAT_DATA_BODY_PATCH = 7; + private static final int METHODID_GET_ENUM = 8; + private static final int METHODID_VERIFY_ENUM = 9; + + 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_REPEAT_DATA_BODY: + serviceImpl.repeatDataBody( + (com.google.showcase.v1beta1.RepeatRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_REPEAT_DATA_BODY_INFO: + serviceImpl.repeatDataBodyInfo( + (com.google.showcase.v1beta1.RepeatRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_REPEAT_DATA_QUERY: + serviceImpl.repeatDataQuery( + (com.google.showcase.v1beta1.RepeatRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_REPEAT_DATA_SIMPLE_PATH: + serviceImpl.repeatDataSimplePath( + (com.google.showcase.v1beta1.RepeatRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_REPEAT_DATA_PATH_RESOURCE: + serviceImpl.repeatDataPathResource( + (com.google.showcase.v1beta1.RepeatRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_REPEAT_DATA_PATH_TRAILING_RESOURCE: + serviceImpl.repeatDataPathTrailingResource( + (com.google.showcase.v1beta1.RepeatRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_REPEAT_DATA_BODY_PUT: + serviceImpl.repeatDataBodyPut( + (com.google.showcase.v1beta1.RepeatRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_REPEAT_DATA_BODY_PATCH: + serviceImpl.repeatDataBodyPatch( + (com.google.showcase.v1beta1.RepeatRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_GET_ENUM: + serviceImpl.getEnum( + (com.google.showcase.v1beta1.EnumRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_VERIFY_ENUM: + serviceImpl.verifyEnum( + (com.google.showcase.v1beta1.EnumResponse) 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( + getRepeatDataBodyMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.showcase.v1beta1.RepeatRequest, + com.google.showcase.v1beta1.RepeatResponse>( + service, METHODID_REPEAT_DATA_BODY))) + .addMethod( + getRepeatDataBodyInfoMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.showcase.v1beta1.RepeatRequest, + com.google.showcase.v1beta1.RepeatResponse>( + service, METHODID_REPEAT_DATA_BODY_INFO))) + .addMethod( + getRepeatDataQueryMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.showcase.v1beta1.RepeatRequest, + com.google.showcase.v1beta1.RepeatResponse>( + service, METHODID_REPEAT_DATA_QUERY))) + .addMethod( + getRepeatDataSimplePathMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.showcase.v1beta1.RepeatRequest, + com.google.showcase.v1beta1.RepeatResponse>( + service, METHODID_REPEAT_DATA_SIMPLE_PATH))) + .addMethod( + getRepeatDataPathResourceMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.showcase.v1beta1.RepeatRequest, + com.google.showcase.v1beta1.RepeatResponse>( + service, METHODID_REPEAT_DATA_PATH_RESOURCE))) + .addMethod( + getRepeatDataPathTrailingResourceMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.showcase.v1beta1.RepeatRequest, + com.google.showcase.v1beta1.RepeatResponse>( + service, METHODID_REPEAT_DATA_PATH_TRAILING_RESOURCE))) + .addMethod( + getRepeatDataBodyPutMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.showcase.v1beta1.RepeatRequest, + com.google.showcase.v1beta1.RepeatResponse>( + service, METHODID_REPEAT_DATA_BODY_PUT))) + .addMethod( + getRepeatDataBodyPatchMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.showcase.v1beta1.RepeatRequest, + com.google.showcase.v1beta1.RepeatResponse>( + service, METHODID_REPEAT_DATA_BODY_PATCH))) + .addMethod( + getGetEnumMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.showcase.v1beta1.EnumRequest, + com.google.showcase.v1beta1.EnumResponse>(service, METHODID_GET_ENUM))) + .addMethod( + getVerifyEnumMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.showcase.v1beta1.EnumResponse, + com.google.showcase.v1beta1.EnumResponse>(service, METHODID_VERIFY_ENUM))) + .build(); + } + + private abstract static class ComplianceBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoFileDescriptorSupplier, + io.grpc.protobuf.ProtoServiceDescriptorSupplier { + ComplianceBaseDescriptorSupplier() {} + + @java.lang.Override + public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() { + return com.google.showcase.v1beta1.ComplianceOuterClass.getDescriptor(); + } + + @java.lang.Override + public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() { + return getFileDescriptor().findServiceByName("Compliance"); + } + } + + private static final class ComplianceFileDescriptorSupplier + extends ComplianceBaseDescriptorSupplier { + ComplianceFileDescriptorSupplier() {} + } + + private static final class ComplianceMethodDescriptorSupplier + extends ComplianceBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoMethodDescriptorSupplier { + private final java.lang.String methodName; + + ComplianceMethodDescriptorSupplier(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 (ComplianceGrpc.class) { + result = serviceDescriptor; + if (result == null) { + serviceDescriptor = + result = + io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME) + .setSchemaDescriptor(new ComplianceFileDescriptorSupplier()) + .addMethod(getRepeatDataBodyMethod()) + .addMethod(getRepeatDataBodyInfoMethod()) + .addMethod(getRepeatDataQueryMethod()) + .addMethod(getRepeatDataSimplePathMethod()) + .addMethod(getRepeatDataPathResourceMethod()) + .addMethod(getRepeatDataPathTrailingResourceMethod()) + .addMethod(getRepeatDataBodyPutMethod()) + .addMethod(getRepeatDataBodyPatchMethod()) + .addMethod(getGetEnumMethod()) + .addMethod(getVerifyEnumMethod()) + .build(); + } + } + } + return result; + } +} diff --git a/java-showcase/grpc-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/EchoGrpc.java b/java-showcase/grpc-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/EchoGrpc.java new file mode 100644 index 0000000000..b5d6911f7e --- /dev/null +++ b/java-showcase/grpc-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/EchoGrpc.java @@ -0,0 +1,1770 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.showcase.v1beta1; + +import static io.grpc.MethodDescriptor.generateFullMethodName; + +/** + * + * + *
        + * This service is used showcase the four main types of rpcs - unary, server
        + * side streaming, client side streaming, and bidirectional streaming. This
        + * service also exposes methods that explicitly implement server delay, and
        + * paginated calls. Set the 'showcase-trailer' metadata key on any method
        + * to have the values echoed in the response trailers. Set the
        + * 'x-goog-request-params' metadata key on any method to have the values
        + * echoed in the response headers.
        + * 
        + */ +@io.grpc.stub.annotations.GrpcGenerated +public final class EchoGrpc { + + private EchoGrpc() {} + + public static final java.lang.String SERVICE_NAME = "google.showcase.v1beta1.Echo"; + + // Static method descriptors that strictly reflect the proto. + private static volatile io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.EchoRequest, com.google.showcase.v1beta1.EchoResponse> + getEchoMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "Echo", + requestType = com.google.showcase.v1beta1.EchoRequest.class, + responseType = com.google.showcase.v1beta1.EchoResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.EchoRequest, com.google.showcase.v1beta1.EchoResponse> + getEchoMethod() { + io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.EchoRequest, com.google.showcase.v1beta1.EchoResponse> + getEchoMethod; + if ((getEchoMethod = EchoGrpc.getEchoMethod) == null) { + synchronized (EchoGrpc.class) { + if ((getEchoMethod = EchoGrpc.getEchoMethod) == null) { + EchoGrpc.getEchoMethod = + getEchoMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "Echo")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.EchoRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.EchoResponse.getDefaultInstance())) + .setSchemaDescriptor(new EchoMethodDescriptorSupplier("Echo")) + .build(); + } + } + } + return getEchoMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.EchoErrorDetailsRequest, + com.google.showcase.v1beta1.EchoErrorDetailsResponse> + getEchoErrorDetailsMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "EchoErrorDetails", + requestType = com.google.showcase.v1beta1.EchoErrorDetailsRequest.class, + responseType = com.google.showcase.v1beta1.EchoErrorDetailsResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.EchoErrorDetailsRequest, + com.google.showcase.v1beta1.EchoErrorDetailsResponse> + getEchoErrorDetailsMethod() { + io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.EchoErrorDetailsRequest, + com.google.showcase.v1beta1.EchoErrorDetailsResponse> + getEchoErrorDetailsMethod; + if ((getEchoErrorDetailsMethod = EchoGrpc.getEchoErrorDetailsMethod) == null) { + synchronized (EchoGrpc.class) { + if ((getEchoErrorDetailsMethod = EchoGrpc.getEchoErrorDetailsMethod) == null) { + EchoGrpc.getEchoErrorDetailsMethod = + getEchoErrorDetailsMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "EchoErrorDetails")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.EchoErrorDetailsRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.EchoErrorDetailsResponse + .getDefaultInstance())) + .setSchemaDescriptor(new EchoMethodDescriptorSupplier("EchoErrorDetails")) + .build(); + } + } + } + return getEchoErrorDetailsMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.FailEchoWithDetailsRequest, + com.google.showcase.v1beta1.FailEchoWithDetailsResponse> + getFailEchoWithDetailsMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "FailEchoWithDetails", + requestType = com.google.showcase.v1beta1.FailEchoWithDetailsRequest.class, + responseType = com.google.showcase.v1beta1.FailEchoWithDetailsResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.FailEchoWithDetailsRequest, + com.google.showcase.v1beta1.FailEchoWithDetailsResponse> + getFailEchoWithDetailsMethod() { + io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.FailEchoWithDetailsRequest, + com.google.showcase.v1beta1.FailEchoWithDetailsResponse> + getFailEchoWithDetailsMethod; + if ((getFailEchoWithDetailsMethod = EchoGrpc.getFailEchoWithDetailsMethod) == null) { + synchronized (EchoGrpc.class) { + if ((getFailEchoWithDetailsMethod = EchoGrpc.getFailEchoWithDetailsMethod) == null) { + EchoGrpc.getFailEchoWithDetailsMethod = + getFailEchoWithDetailsMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName(SERVICE_NAME, "FailEchoWithDetails")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.FailEchoWithDetailsRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.FailEchoWithDetailsResponse + .getDefaultInstance())) + .setSchemaDescriptor(new EchoMethodDescriptorSupplier("FailEchoWithDetails")) + .build(); + } + } + } + return getFailEchoWithDetailsMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.ExpandRequest, com.google.showcase.v1beta1.EchoResponse> + getExpandMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "Expand", + requestType = com.google.showcase.v1beta1.ExpandRequest.class, + responseType = com.google.showcase.v1beta1.EchoResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.SERVER_STREAMING) + public static io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.ExpandRequest, com.google.showcase.v1beta1.EchoResponse> + getExpandMethod() { + io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.ExpandRequest, com.google.showcase.v1beta1.EchoResponse> + getExpandMethod; + if ((getExpandMethod = EchoGrpc.getExpandMethod) == null) { + synchronized (EchoGrpc.class) { + if ((getExpandMethod = EchoGrpc.getExpandMethod) == null) { + EchoGrpc.getExpandMethod = + getExpandMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.SERVER_STREAMING) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "Expand")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.ExpandRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.EchoResponse.getDefaultInstance())) + .setSchemaDescriptor(new EchoMethodDescriptorSupplier("Expand")) + .build(); + } + } + } + return getExpandMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.EchoRequest, com.google.showcase.v1beta1.EchoResponse> + getCollectMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "Collect", + requestType = com.google.showcase.v1beta1.EchoRequest.class, + responseType = com.google.showcase.v1beta1.EchoResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.CLIENT_STREAMING) + public static io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.EchoRequest, com.google.showcase.v1beta1.EchoResponse> + getCollectMethod() { + io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.EchoRequest, com.google.showcase.v1beta1.EchoResponse> + getCollectMethod; + if ((getCollectMethod = EchoGrpc.getCollectMethod) == null) { + synchronized (EchoGrpc.class) { + if ((getCollectMethod = EchoGrpc.getCollectMethod) == null) { + EchoGrpc.getCollectMethod = + getCollectMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.CLIENT_STREAMING) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "Collect")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.EchoRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.EchoResponse.getDefaultInstance())) + .setSchemaDescriptor(new EchoMethodDescriptorSupplier("Collect")) + .build(); + } + } + } + return getCollectMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.EchoRequest, com.google.showcase.v1beta1.EchoResponse> + getChatMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "Chat", + requestType = com.google.showcase.v1beta1.EchoRequest.class, + responseType = com.google.showcase.v1beta1.EchoResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.BIDI_STREAMING) + public static io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.EchoRequest, com.google.showcase.v1beta1.EchoResponse> + getChatMethod() { + io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.EchoRequest, com.google.showcase.v1beta1.EchoResponse> + getChatMethod; + if ((getChatMethod = EchoGrpc.getChatMethod) == null) { + synchronized (EchoGrpc.class) { + if ((getChatMethod = EchoGrpc.getChatMethod) == null) { + EchoGrpc.getChatMethod = + getChatMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.BIDI_STREAMING) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "Chat")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.EchoRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.EchoResponse.getDefaultInstance())) + .setSchemaDescriptor(new EchoMethodDescriptorSupplier("Chat")) + .build(); + } + } + } + return getChatMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.PagedExpandRequest, + com.google.showcase.v1beta1.PagedExpandResponse> + getPagedExpandMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "PagedExpand", + requestType = com.google.showcase.v1beta1.PagedExpandRequest.class, + responseType = com.google.showcase.v1beta1.PagedExpandResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.PagedExpandRequest, + com.google.showcase.v1beta1.PagedExpandResponse> + getPagedExpandMethod() { + io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.PagedExpandRequest, + com.google.showcase.v1beta1.PagedExpandResponse> + getPagedExpandMethod; + if ((getPagedExpandMethod = EchoGrpc.getPagedExpandMethod) == null) { + synchronized (EchoGrpc.class) { + if ((getPagedExpandMethod = EchoGrpc.getPagedExpandMethod) == null) { + EchoGrpc.getPagedExpandMethod = + getPagedExpandMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "PagedExpand")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.PagedExpandRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.PagedExpandResponse.getDefaultInstance())) + .setSchemaDescriptor(new EchoMethodDescriptorSupplier("PagedExpand")) + .build(); + } + } + } + return getPagedExpandMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.PagedExpandLegacyRequest, + com.google.showcase.v1beta1.PagedExpandResponse> + getPagedExpandLegacyMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "PagedExpandLegacy", + requestType = com.google.showcase.v1beta1.PagedExpandLegacyRequest.class, + responseType = com.google.showcase.v1beta1.PagedExpandResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.PagedExpandLegacyRequest, + com.google.showcase.v1beta1.PagedExpandResponse> + getPagedExpandLegacyMethod() { + io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.PagedExpandLegacyRequest, + com.google.showcase.v1beta1.PagedExpandResponse> + getPagedExpandLegacyMethod; + if ((getPagedExpandLegacyMethod = EchoGrpc.getPagedExpandLegacyMethod) == null) { + synchronized (EchoGrpc.class) { + if ((getPagedExpandLegacyMethod = EchoGrpc.getPagedExpandLegacyMethod) == null) { + EchoGrpc.getPagedExpandLegacyMethod = + getPagedExpandLegacyMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "PagedExpandLegacy")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.PagedExpandLegacyRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.PagedExpandResponse.getDefaultInstance())) + .setSchemaDescriptor(new EchoMethodDescriptorSupplier("PagedExpandLegacy")) + .build(); + } + } + } + return getPagedExpandLegacyMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.PagedExpandRequest, + com.google.showcase.v1beta1.PagedExpandLegacyMappedResponse> + getPagedExpandLegacyMappedMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "PagedExpandLegacyMapped", + requestType = com.google.showcase.v1beta1.PagedExpandRequest.class, + responseType = com.google.showcase.v1beta1.PagedExpandLegacyMappedResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.PagedExpandRequest, + com.google.showcase.v1beta1.PagedExpandLegacyMappedResponse> + getPagedExpandLegacyMappedMethod() { + io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.PagedExpandRequest, + com.google.showcase.v1beta1.PagedExpandLegacyMappedResponse> + getPagedExpandLegacyMappedMethod; + if ((getPagedExpandLegacyMappedMethod = EchoGrpc.getPagedExpandLegacyMappedMethod) == null) { + synchronized (EchoGrpc.class) { + if ((getPagedExpandLegacyMappedMethod = EchoGrpc.getPagedExpandLegacyMappedMethod) + == null) { + EchoGrpc.getPagedExpandLegacyMappedMethod = + getPagedExpandLegacyMappedMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName(SERVICE_NAME, "PagedExpandLegacyMapped")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.PagedExpandRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.PagedExpandLegacyMappedResponse + .getDefaultInstance())) + .setSchemaDescriptor( + new EchoMethodDescriptorSupplier("PagedExpandLegacyMapped")) + .build(); + } + } + } + return getPagedExpandLegacyMappedMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.WaitRequest, com.google.longrunning.Operation> + getWaitMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "Wait", + requestType = com.google.showcase.v1beta1.WaitRequest.class, + responseType = com.google.longrunning.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.WaitRequest, com.google.longrunning.Operation> + getWaitMethod() { + io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.WaitRequest, com.google.longrunning.Operation> + getWaitMethod; + if ((getWaitMethod = EchoGrpc.getWaitMethod) == null) { + synchronized (EchoGrpc.class) { + if ((getWaitMethod = EchoGrpc.getWaitMethod) == null) { + EchoGrpc.getWaitMethod = + getWaitMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "Wait")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.WaitRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor(new EchoMethodDescriptorSupplier("Wait")) + .build(); + } + } + } + return getWaitMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.BlockRequest, com.google.showcase.v1beta1.BlockResponse> + getBlockMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "Block", + requestType = com.google.showcase.v1beta1.BlockRequest.class, + responseType = com.google.showcase.v1beta1.BlockResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.BlockRequest, com.google.showcase.v1beta1.BlockResponse> + getBlockMethod() { + io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.BlockRequest, com.google.showcase.v1beta1.BlockResponse> + getBlockMethod; + if ((getBlockMethod = EchoGrpc.getBlockMethod) == null) { + synchronized (EchoGrpc.class) { + if ((getBlockMethod = EchoGrpc.getBlockMethod) == null) { + EchoGrpc.getBlockMethod = + getBlockMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "Block")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.BlockRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.BlockResponse.getDefaultInstance())) + .setSchemaDescriptor(new EchoMethodDescriptorSupplier("Block")) + .build(); + } + } + } + return getBlockMethod; + } + + /** Creates a new async stub that supports all call types for the service */ + public static EchoStub newStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public EchoStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new EchoStub(channel, callOptions); + } + }; + return EchoStub.newStub(factory, channel); + } + + /** Creates a new blocking-style stub that supports all types of calls on the service */ + public static EchoBlockingV2Stub newBlockingV2Stub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public EchoBlockingV2Stub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new EchoBlockingV2Stub(channel, callOptions); + } + }; + return EchoBlockingV2Stub.newStub(factory, channel); + } + + /** + * Creates a new blocking-style stub that supports unary and streaming output calls on the service + */ + public static EchoBlockingStub newBlockingStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public EchoBlockingStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new EchoBlockingStub(channel, callOptions); + } + }; + return EchoBlockingStub.newStub(factory, channel); + } + + /** Creates a new ListenableFuture-style stub that supports unary calls on the service */ + public static EchoFutureStub newFutureStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public EchoFutureStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new EchoFutureStub(channel, callOptions); + } + }; + return EchoFutureStub.newStub(factory, channel); + } + + /** + * + * + *
        +   * This service is used showcase the four main types of rpcs - unary, server
        +   * side streaming, client side streaming, and bidirectional streaming. This
        +   * service also exposes methods that explicitly implement server delay, and
        +   * paginated calls. Set the 'showcase-trailer' metadata key on any method
        +   * to have the values echoed in the response trailers. Set the
        +   * 'x-goog-request-params' metadata key on any method to have the values
        +   * echoed in the response headers.
        +   * 
        + */ + public interface AsyncService { + + /** + * + * + *
        +     * This method simply echoes the request. This method showcases unary RPCs.
        +     * 
        + */ + default void echo( + com.google.showcase.v1beta1.EchoRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getEchoMethod(), responseObserver); + } + + /** + * + * + *
        +     * This method returns error details in a repeated "google.protobuf.Any"
        +     * field. This method showcases handling errors thus encoded, particularly
        +     * over REST transport. Note that GAPICs only allow the type
        +     * "google.protobuf.Any" for field paths ending in "error.details", and, at
        +     * run-time, the actual types for these fields must be one of the types in
        +     * google/rpc/error_details.proto.
        +     * 
        + */ + default void echoErrorDetails( + com.google.showcase.v1beta1.EchoErrorDetailsRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getEchoErrorDetailsMethod(), responseObserver); + } + + /** + * + * + *
        +     * This method always fails with a gRPC "Aborted" error status that contains
        +     * multiple error details.  These include one instance of each of the standard
        +     * ones in error_details.proto
        +     * (https://github.com/googleapis/googleapis/blob/master/google/rpc/error_details.proto)
        +     * plus a custom, Showcase-defined PoetryError. The intent of this RPC is to
        +     * verify that GAPICs can process these various error details and surface them
        +     * to the user in an idiomatic form.
        +     * 
        + */ + default void failEchoWithDetails( + com.google.showcase.v1beta1.FailEchoWithDetailsRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getFailEchoWithDetailsMethod(), responseObserver); + } + + /** + * + * + *
        +     * This method splits the given content into words and will pass each word back
        +     * through the stream. This method showcases server-side streaming RPCs.
        +     * 
        + */ + default void expand( + com.google.showcase.v1beta1.ExpandRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getExpandMethod(), responseObserver); + } + + /** + * + * + *
        +     * This method will collect the words given to it. When the stream is closed
        +     * by the client, this method will return the a concatenation of the strings
        +     * passed to it. This method showcases client-side streaming RPCs.
        +     * 
        + */ + default io.grpc.stub.StreamObserver collect( + io.grpc.stub.StreamObserver responseObserver) { + return io.grpc.stub.ServerCalls.asyncUnimplementedStreamingCall( + getCollectMethod(), responseObserver); + } + + /** + * + * + *
        +     * This method, upon receiving a request on the stream, will pass the same
        +     * content back on the stream. This method showcases bidirectional
        +     * streaming RPCs.
        +     * 
        + */ + default io.grpc.stub.StreamObserver chat( + io.grpc.stub.StreamObserver responseObserver) { + return io.grpc.stub.ServerCalls.asyncUnimplementedStreamingCall( + getChatMethod(), responseObserver); + } + + /** + * + * + *
        +     * This is similar to the Expand method but instead of returning a stream of
        +     * expanded words, this method returns a paged list of expanded words.
        +     * 
        + */ + default void pagedExpand( + com.google.showcase.v1beta1.PagedExpandRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getPagedExpandMethod(), responseObserver); + } + + /** + * + * + *
        +     * This is similar to the PagedExpand except that it uses
        +     * max_results instead of page_size, as some legacy APIs still
        +     * do. New APIs should NOT use this pattern.
        +     * 
        + */ + default void pagedExpandLegacy( + com.google.showcase.v1beta1.PagedExpandLegacyRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getPagedExpandLegacyMethod(), responseObserver); + } + + /** + * + * + *
        +     * This method returns a map containing lists of words that appear in the input, keyed by their
        +     * initial character. The only words returned are the ones included in the current page,
        +     * as determined by page_token and page_size, which both refer to the word indices in the
        +     * input. This paging result consisting of a map of lists is a pattern used by some legacy
        +     * APIs. New APIs should NOT use this pattern.
        +     * 
        + */ + default void pagedExpandLegacyMapped( + com.google.showcase.v1beta1.PagedExpandRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getPagedExpandLegacyMappedMethod(), responseObserver); + } + + /** + * + * + *
        +     * This method will wait for the requested amount of time and then return.
        +     * This method showcases how a client handles a request timeout.
        +     * 
        + */ + default void wait( + com.google.showcase.v1beta1.WaitRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getWaitMethod(), responseObserver); + } + + /** + * + * + *
        +     * This method will block (wait) for the requested amount of time
        +     * and then return the response or error.
        +     * This method showcases how a client handles delays or retries.
        +     * 
        + */ + default void block( + com.google.showcase.v1beta1.BlockRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getBlockMethod(), responseObserver); + } + } + + /** + * Base class for the server implementation of the service Echo. + * + *
        +   * This service is used showcase the four main types of rpcs - unary, server
        +   * side streaming, client side streaming, and bidirectional streaming. This
        +   * service also exposes methods that explicitly implement server delay, and
        +   * paginated calls. Set the 'showcase-trailer' metadata key on any method
        +   * to have the values echoed in the response trailers. Set the
        +   * 'x-goog-request-params' metadata key on any method to have the values
        +   * echoed in the response headers.
        +   * 
        + */ + public abstract static class EchoImplBase implements io.grpc.BindableService, AsyncService { + + @java.lang.Override + public final io.grpc.ServerServiceDefinition bindService() { + return EchoGrpc.bindService(this); + } + } + + /** + * A stub to allow clients to do asynchronous rpc calls to service Echo. + * + *
        +   * This service is used showcase the four main types of rpcs - unary, server
        +   * side streaming, client side streaming, and bidirectional streaming. This
        +   * service also exposes methods that explicitly implement server delay, and
        +   * paginated calls. Set the 'showcase-trailer' metadata key on any method
        +   * to have the values echoed in the response trailers. Set the
        +   * 'x-goog-request-params' metadata key on any method to have the values
        +   * echoed in the response headers.
        +   * 
        + */ + public static final class EchoStub extends io.grpc.stub.AbstractAsyncStub { + private EchoStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected EchoStub build(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new EchoStub(channel, callOptions); + } + + /** + * + * + *
        +     * This method simply echoes the request. This method showcases unary RPCs.
        +     * 
        + */ + public void echo( + com.google.showcase.v1beta1.EchoRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getEchoMethod(), getCallOptions()), request, responseObserver); + } + + /** + * + * + *
        +     * This method returns error details in a repeated "google.protobuf.Any"
        +     * field. This method showcases handling errors thus encoded, particularly
        +     * over REST transport. Note that GAPICs only allow the type
        +     * "google.protobuf.Any" for field paths ending in "error.details", and, at
        +     * run-time, the actual types for these fields must be one of the types in
        +     * google/rpc/error_details.proto.
        +     * 
        + */ + public void echoErrorDetails( + com.google.showcase.v1beta1.EchoErrorDetailsRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getEchoErrorDetailsMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
        +     * This method always fails with a gRPC "Aborted" error status that contains
        +     * multiple error details.  These include one instance of each of the standard
        +     * ones in error_details.proto
        +     * (https://github.com/googleapis/googleapis/blob/master/google/rpc/error_details.proto)
        +     * plus a custom, Showcase-defined PoetryError. The intent of this RPC is to
        +     * verify that GAPICs can process these various error details and surface them
        +     * to the user in an idiomatic form.
        +     * 
        + */ + public void failEchoWithDetails( + com.google.showcase.v1beta1.FailEchoWithDetailsRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getFailEchoWithDetailsMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
        +     * This method splits the given content into words and will pass each word back
        +     * through the stream. This method showcases server-side streaming RPCs.
        +     * 
        + */ + public void expand( + com.google.showcase.v1beta1.ExpandRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncServerStreamingCall( + getChannel().newCall(getExpandMethod(), getCallOptions()), request, responseObserver); + } + + /** + * + * + *
        +     * This method will collect the words given to it. When the stream is closed
        +     * by the client, this method will return the a concatenation of the strings
        +     * passed to it. This method showcases client-side streaming RPCs.
        +     * 
        + */ + public io.grpc.stub.StreamObserver collect( + io.grpc.stub.StreamObserver responseObserver) { + return io.grpc.stub.ClientCalls.asyncClientStreamingCall( + getChannel().newCall(getCollectMethod(), getCallOptions()), responseObserver); + } + + /** + * + * + *
        +     * This method, upon receiving a request on the stream, will pass the same
        +     * content back on the stream. This method showcases bidirectional
        +     * streaming RPCs.
        +     * 
        + */ + public io.grpc.stub.StreamObserver chat( + io.grpc.stub.StreamObserver responseObserver) { + return io.grpc.stub.ClientCalls.asyncBidiStreamingCall( + getChannel().newCall(getChatMethod(), getCallOptions()), responseObserver); + } + + /** + * + * + *
        +     * This is similar to the Expand method but instead of returning a stream of
        +     * expanded words, this method returns a paged list of expanded words.
        +     * 
        + */ + public void pagedExpand( + com.google.showcase.v1beta1.PagedExpandRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getPagedExpandMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
        +     * This is similar to the PagedExpand except that it uses
        +     * max_results instead of page_size, as some legacy APIs still
        +     * do. New APIs should NOT use this pattern.
        +     * 
        + */ + public void pagedExpandLegacy( + com.google.showcase.v1beta1.PagedExpandLegacyRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getPagedExpandLegacyMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
        +     * This method returns a map containing lists of words that appear in the input, keyed by their
        +     * initial character. The only words returned are the ones included in the current page,
        +     * as determined by page_token and page_size, which both refer to the word indices in the
        +     * input. This paging result consisting of a map of lists is a pattern used by some legacy
        +     * APIs. New APIs should NOT use this pattern.
        +     * 
        + */ + public void pagedExpandLegacyMapped( + com.google.showcase.v1beta1.PagedExpandRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getPagedExpandLegacyMappedMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
        +     * This method will wait for the requested amount of time and then return.
        +     * This method showcases how a client handles a request timeout.
        +     * 
        + */ + public void wait( + com.google.showcase.v1beta1.WaitRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getWaitMethod(), getCallOptions()), request, responseObserver); + } + + /** + * + * + *
        +     * This method will block (wait) for the requested amount of time
        +     * and then return the response or error.
        +     * This method showcases how a client handles delays or retries.
        +     * 
        + */ + public void block( + com.google.showcase.v1beta1.BlockRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getBlockMethod(), getCallOptions()), request, responseObserver); + } + } + + /** + * A stub to allow clients to do synchronous rpc calls to service Echo. + * + *
        +   * This service is used showcase the four main types of rpcs - unary, server
        +   * side streaming, client side streaming, and bidirectional streaming. This
        +   * service also exposes methods that explicitly implement server delay, and
        +   * paginated calls. Set the 'showcase-trailer' metadata key on any method
        +   * to have the values echoed in the response trailers. Set the
        +   * 'x-goog-request-params' metadata key on any method to have the values
        +   * echoed in the response headers.
        +   * 
        + */ + public static final class EchoBlockingV2Stub + extends io.grpc.stub.AbstractBlockingStub { + private EchoBlockingV2Stub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected EchoBlockingV2Stub build(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new EchoBlockingV2Stub(channel, callOptions); + } + + /** + * + * + *
        +     * This method simply echoes the request. This method showcases unary RPCs.
        +     * 
        + */ + public com.google.showcase.v1beta1.EchoResponse echo( + com.google.showcase.v1beta1.EchoRequest request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getEchoMethod(), getCallOptions(), request); + } + + /** + * + * + *
        +     * This method returns error details in a repeated "google.protobuf.Any"
        +     * field. This method showcases handling errors thus encoded, particularly
        +     * over REST transport. Note that GAPICs only allow the type
        +     * "google.protobuf.Any" for field paths ending in "error.details", and, at
        +     * run-time, the actual types for these fields must be one of the types in
        +     * google/rpc/error_details.proto.
        +     * 
        + */ + public com.google.showcase.v1beta1.EchoErrorDetailsResponse echoErrorDetails( + com.google.showcase.v1beta1.EchoErrorDetailsRequest request) + throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getEchoErrorDetailsMethod(), getCallOptions(), request); + } + + /** + * + * + *
        +     * This method always fails with a gRPC "Aborted" error status that contains
        +     * multiple error details.  These include one instance of each of the standard
        +     * ones in error_details.proto
        +     * (https://github.com/googleapis/googleapis/blob/master/google/rpc/error_details.proto)
        +     * plus a custom, Showcase-defined PoetryError. The intent of this RPC is to
        +     * verify that GAPICs can process these various error details and surface them
        +     * to the user in an idiomatic form.
        +     * 
        + */ + public com.google.showcase.v1beta1.FailEchoWithDetailsResponse failEchoWithDetails( + com.google.showcase.v1beta1.FailEchoWithDetailsRequest request) + throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getFailEchoWithDetailsMethod(), getCallOptions(), request); + } + + /** + * + * + *
        +     * This method splits the given content into words and will pass each word back
        +     * through the stream. This method showcases server-side streaming RPCs.
        +     * 
        + */ + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/10918") + public io.grpc.stub.BlockingClientCall expand( + com.google.showcase.v1beta1.ExpandRequest request) { + return io.grpc.stub.ClientCalls.blockingV2ServerStreamingCall( + getChannel(), getExpandMethod(), getCallOptions(), request); + } + + /** + * + * + *
        +     * This method will collect the words given to it. When the stream is closed
        +     * by the client, this method will return the a concatenation of the strings
        +     * passed to it. This method showcases client-side streaming RPCs.
        +     * 
        + */ + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/10918") + public io.grpc.stub.BlockingClientCall< + com.google.showcase.v1beta1.EchoRequest, com.google.showcase.v1beta1.EchoResponse> + collect() { + return io.grpc.stub.ClientCalls.blockingClientStreamingCall( + getChannel(), getCollectMethod(), getCallOptions()); + } + + /** + * + * + *
        +     * This method, upon receiving a request on the stream, will pass the same
        +     * content back on the stream. This method showcases bidirectional
        +     * streaming RPCs.
        +     * 
        + */ + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/10918") + public io.grpc.stub.BlockingClientCall< + com.google.showcase.v1beta1.EchoRequest, com.google.showcase.v1beta1.EchoResponse> + chat() { + return io.grpc.stub.ClientCalls.blockingBidiStreamingCall( + getChannel(), getChatMethod(), getCallOptions()); + } + + /** + * + * + *
        +     * This is similar to the Expand method but instead of returning a stream of
        +     * expanded words, this method returns a paged list of expanded words.
        +     * 
        + */ + public com.google.showcase.v1beta1.PagedExpandResponse pagedExpand( + com.google.showcase.v1beta1.PagedExpandRequest request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getPagedExpandMethod(), getCallOptions(), request); + } + + /** + * + * + *
        +     * This is similar to the PagedExpand except that it uses
        +     * max_results instead of page_size, as some legacy APIs still
        +     * do. New APIs should NOT use this pattern.
        +     * 
        + */ + public com.google.showcase.v1beta1.PagedExpandResponse pagedExpandLegacy( + com.google.showcase.v1beta1.PagedExpandLegacyRequest request) + throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getPagedExpandLegacyMethod(), getCallOptions(), request); + } + + /** + * + * + *
        +     * This method returns a map containing lists of words that appear in the input, keyed by their
        +     * initial character. The only words returned are the ones included in the current page,
        +     * as determined by page_token and page_size, which both refer to the word indices in the
        +     * input. This paging result consisting of a map of lists is a pattern used by some legacy
        +     * APIs. New APIs should NOT use this pattern.
        +     * 
        + */ + public com.google.showcase.v1beta1.PagedExpandLegacyMappedResponse pagedExpandLegacyMapped( + com.google.showcase.v1beta1.PagedExpandRequest request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getPagedExpandLegacyMappedMethod(), getCallOptions(), request); + } + + /** + * + * + *
        +     * This method will wait for the requested amount of time and then return.
        +     * This method showcases how a client handles a request timeout.
        +     * 
        + */ + public com.google.longrunning.Operation wait(com.google.showcase.v1beta1.WaitRequest request) + throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getWaitMethod(), getCallOptions(), request); + } + + /** + * + * + *
        +     * This method will block (wait) for the requested amount of time
        +     * and then return the response or error.
        +     * This method showcases how a client handles delays or retries.
        +     * 
        + */ + public com.google.showcase.v1beta1.BlockResponse block( + com.google.showcase.v1beta1.BlockRequest request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getBlockMethod(), getCallOptions(), request); + } + } + + /** + * A stub to allow clients to do limited synchronous rpc calls to service Echo. + * + *
        +   * This service is used showcase the four main types of rpcs - unary, server
        +   * side streaming, client side streaming, and bidirectional streaming. This
        +   * service also exposes methods that explicitly implement server delay, and
        +   * paginated calls. Set the 'showcase-trailer' metadata key on any method
        +   * to have the values echoed in the response trailers. Set the
        +   * 'x-goog-request-params' metadata key on any method to have the values
        +   * echoed in the response headers.
        +   * 
        + */ + public static final class EchoBlockingStub + extends io.grpc.stub.AbstractBlockingStub { + private EchoBlockingStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected EchoBlockingStub build(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new EchoBlockingStub(channel, callOptions); + } + + /** + * + * + *
        +     * This method simply echoes the request. This method showcases unary RPCs.
        +     * 
        + */ + public com.google.showcase.v1beta1.EchoResponse echo( + com.google.showcase.v1beta1.EchoRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getEchoMethod(), getCallOptions(), request); + } + + /** + * + * + *
        +     * This method returns error details in a repeated "google.protobuf.Any"
        +     * field. This method showcases handling errors thus encoded, particularly
        +     * over REST transport. Note that GAPICs only allow the type
        +     * "google.protobuf.Any" for field paths ending in "error.details", and, at
        +     * run-time, the actual types for these fields must be one of the types in
        +     * google/rpc/error_details.proto.
        +     * 
        + */ + public com.google.showcase.v1beta1.EchoErrorDetailsResponse echoErrorDetails( + com.google.showcase.v1beta1.EchoErrorDetailsRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getEchoErrorDetailsMethod(), getCallOptions(), request); + } + + /** + * + * + *
        +     * This method always fails with a gRPC "Aborted" error status that contains
        +     * multiple error details.  These include one instance of each of the standard
        +     * ones in error_details.proto
        +     * (https://github.com/googleapis/googleapis/blob/master/google/rpc/error_details.proto)
        +     * plus a custom, Showcase-defined PoetryError. The intent of this RPC is to
        +     * verify that GAPICs can process these various error details and surface them
        +     * to the user in an idiomatic form.
        +     * 
        + */ + public com.google.showcase.v1beta1.FailEchoWithDetailsResponse failEchoWithDetails( + com.google.showcase.v1beta1.FailEchoWithDetailsRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getFailEchoWithDetailsMethod(), getCallOptions(), request); + } + + /** + * + * + *
        +     * This method splits the given content into words and will pass each word back
        +     * through the stream. This method showcases server-side streaming RPCs.
        +     * 
        + */ + public java.util.Iterator expand( + com.google.showcase.v1beta1.ExpandRequest request) { + return io.grpc.stub.ClientCalls.blockingServerStreamingCall( + getChannel(), getExpandMethod(), getCallOptions(), request); + } + + /** + * + * + *
        +     * This is similar to the Expand method but instead of returning a stream of
        +     * expanded words, this method returns a paged list of expanded words.
        +     * 
        + */ + public com.google.showcase.v1beta1.PagedExpandResponse pagedExpand( + com.google.showcase.v1beta1.PagedExpandRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getPagedExpandMethod(), getCallOptions(), request); + } + + /** + * + * + *
        +     * This is similar to the PagedExpand except that it uses
        +     * max_results instead of page_size, as some legacy APIs still
        +     * do. New APIs should NOT use this pattern.
        +     * 
        + */ + public com.google.showcase.v1beta1.PagedExpandResponse pagedExpandLegacy( + com.google.showcase.v1beta1.PagedExpandLegacyRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getPagedExpandLegacyMethod(), getCallOptions(), request); + } + + /** + * + * + *
        +     * This method returns a map containing lists of words that appear in the input, keyed by their
        +     * initial character. The only words returned are the ones included in the current page,
        +     * as determined by page_token and page_size, which both refer to the word indices in the
        +     * input. This paging result consisting of a map of lists is a pattern used by some legacy
        +     * APIs. New APIs should NOT use this pattern.
        +     * 
        + */ + public com.google.showcase.v1beta1.PagedExpandLegacyMappedResponse pagedExpandLegacyMapped( + com.google.showcase.v1beta1.PagedExpandRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getPagedExpandLegacyMappedMethod(), getCallOptions(), request); + } + + /** + * + * + *
        +     * This method will wait for the requested amount of time and then return.
        +     * This method showcases how a client handles a request timeout.
        +     * 
        + */ + public com.google.longrunning.Operation wait(com.google.showcase.v1beta1.WaitRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getWaitMethod(), getCallOptions(), request); + } + + /** + * + * + *
        +     * This method will block (wait) for the requested amount of time
        +     * and then return the response or error.
        +     * This method showcases how a client handles delays or retries.
        +     * 
        + */ + public com.google.showcase.v1beta1.BlockResponse block( + com.google.showcase.v1beta1.BlockRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getBlockMethod(), getCallOptions(), request); + } + } + + /** + * A stub to allow clients to do ListenableFuture-style rpc calls to service Echo. + * + *
        +   * This service is used showcase the four main types of rpcs - unary, server
        +   * side streaming, client side streaming, and bidirectional streaming. This
        +   * service also exposes methods that explicitly implement server delay, and
        +   * paginated calls. Set the 'showcase-trailer' metadata key on any method
        +   * to have the values echoed in the response trailers. Set the
        +   * 'x-goog-request-params' metadata key on any method to have the values
        +   * echoed in the response headers.
        +   * 
        + */ + public static final class EchoFutureStub extends io.grpc.stub.AbstractFutureStub { + private EchoFutureStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected EchoFutureStub build(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new EchoFutureStub(channel, callOptions); + } + + /** + * + * + *
        +     * This method simply echoes the request. This method showcases unary RPCs.
        +     * 
        + */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.showcase.v1beta1.EchoResponse> + echo(com.google.showcase.v1beta1.EchoRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getEchoMethod(), getCallOptions()), request); + } + + /** + * + * + *
        +     * This method returns error details in a repeated "google.protobuf.Any"
        +     * field. This method showcases handling errors thus encoded, particularly
        +     * over REST transport. Note that GAPICs only allow the type
        +     * "google.protobuf.Any" for field paths ending in "error.details", and, at
        +     * run-time, the actual types for these fields must be one of the types in
        +     * google/rpc/error_details.proto.
        +     * 
        + */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.showcase.v1beta1.EchoErrorDetailsResponse> + echoErrorDetails(com.google.showcase.v1beta1.EchoErrorDetailsRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getEchoErrorDetailsMethod(), getCallOptions()), request); + } + + /** + * + * + *
        +     * This method always fails with a gRPC "Aborted" error status that contains
        +     * multiple error details.  These include one instance of each of the standard
        +     * ones in error_details.proto
        +     * (https://github.com/googleapis/googleapis/blob/master/google/rpc/error_details.proto)
        +     * plus a custom, Showcase-defined PoetryError. The intent of this RPC is to
        +     * verify that GAPICs can process these various error details and surface them
        +     * to the user in an idiomatic form.
        +     * 
        + */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.showcase.v1beta1.FailEchoWithDetailsResponse> + failEchoWithDetails(com.google.showcase.v1beta1.FailEchoWithDetailsRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getFailEchoWithDetailsMethod(), getCallOptions()), request); + } + + /** + * + * + *
        +     * This is similar to the Expand method but instead of returning a stream of
        +     * expanded words, this method returns a paged list of expanded words.
        +     * 
        + */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.showcase.v1beta1.PagedExpandResponse> + pagedExpand(com.google.showcase.v1beta1.PagedExpandRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getPagedExpandMethod(), getCallOptions()), request); + } + + /** + * + * + *
        +     * This is similar to the PagedExpand except that it uses
        +     * max_results instead of page_size, as some legacy APIs still
        +     * do. New APIs should NOT use this pattern.
        +     * 
        + */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.showcase.v1beta1.PagedExpandResponse> + pagedExpandLegacy(com.google.showcase.v1beta1.PagedExpandLegacyRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getPagedExpandLegacyMethod(), getCallOptions()), request); + } + + /** + * + * + *
        +     * This method returns a map containing lists of words that appear in the input, keyed by their
        +     * initial character. The only words returned are the ones included in the current page,
        +     * as determined by page_token and page_size, which both refer to the word indices in the
        +     * input. This paging result consisting of a map of lists is a pattern used by some legacy
        +     * APIs. New APIs should NOT use this pattern.
        +     * 
        + */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.showcase.v1beta1.PagedExpandLegacyMappedResponse> + pagedExpandLegacyMapped(com.google.showcase.v1beta1.PagedExpandRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getPagedExpandLegacyMappedMethod(), getCallOptions()), request); + } + + /** + * + * + *
        +     * This method will wait for the requested amount of time and then return.
        +     * This method showcases how a client handles a request timeout.
        +     * 
        + */ + public com.google.common.util.concurrent.ListenableFuture + wait(com.google.showcase.v1beta1.WaitRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getWaitMethod(), getCallOptions()), request); + } + + /** + * + * + *
        +     * This method will block (wait) for the requested amount of time
        +     * and then return the response or error.
        +     * This method showcases how a client handles delays or retries.
        +     * 
        + */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.showcase.v1beta1.BlockResponse> + block(com.google.showcase.v1beta1.BlockRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getBlockMethod(), getCallOptions()), request); + } + } + + private static final int METHODID_ECHO = 0; + private static final int METHODID_ECHO_ERROR_DETAILS = 1; + private static final int METHODID_FAIL_ECHO_WITH_DETAILS = 2; + private static final int METHODID_EXPAND = 3; + private static final int METHODID_PAGED_EXPAND = 4; + private static final int METHODID_PAGED_EXPAND_LEGACY = 5; + private static final int METHODID_PAGED_EXPAND_LEGACY_MAPPED = 6; + private static final int METHODID_WAIT = 7; + private static final int METHODID_BLOCK = 8; + private static final int METHODID_COLLECT = 9; + private static final int METHODID_CHAT = 10; + + 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_ECHO: + serviceImpl.echo( + (com.google.showcase.v1beta1.EchoRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_ECHO_ERROR_DETAILS: + serviceImpl.echoErrorDetails( + (com.google.showcase.v1beta1.EchoErrorDetailsRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_FAIL_ECHO_WITH_DETAILS: + serviceImpl.failEchoWithDetails( + (com.google.showcase.v1beta1.FailEchoWithDetailsRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_EXPAND: + serviceImpl.expand( + (com.google.showcase.v1beta1.ExpandRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_PAGED_EXPAND: + serviceImpl.pagedExpand( + (com.google.showcase.v1beta1.PagedExpandRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_PAGED_EXPAND_LEGACY: + serviceImpl.pagedExpandLegacy( + (com.google.showcase.v1beta1.PagedExpandLegacyRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_PAGED_EXPAND_LEGACY_MAPPED: + serviceImpl.pagedExpandLegacyMapped( + (com.google.showcase.v1beta1.PagedExpandRequest) request, + (io.grpc.stub.StreamObserver< + com.google.showcase.v1beta1.PagedExpandLegacyMappedResponse>) + responseObserver); + break; + case METHODID_WAIT: + serviceImpl.wait( + (com.google.showcase.v1beta1.WaitRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_BLOCK: + serviceImpl.block( + (com.google.showcase.v1beta1.BlockRequest) 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_COLLECT: + return (io.grpc.stub.StreamObserver) + serviceImpl.collect( + (io.grpc.stub.StreamObserver) + responseObserver); + case METHODID_CHAT: + return (io.grpc.stub.StreamObserver) + serviceImpl.chat( + (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( + getEchoMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.showcase.v1beta1.EchoRequest, + com.google.showcase.v1beta1.EchoResponse>(service, METHODID_ECHO))) + .addMethod( + getEchoErrorDetailsMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.showcase.v1beta1.EchoErrorDetailsRequest, + com.google.showcase.v1beta1.EchoErrorDetailsResponse>( + service, METHODID_ECHO_ERROR_DETAILS))) + .addMethod( + getFailEchoWithDetailsMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.showcase.v1beta1.FailEchoWithDetailsRequest, + com.google.showcase.v1beta1.FailEchoWithDetailsResponse>( + service, METHODID_FAIL_ECHO_WITH_DETAILS))) + .addMethod( + getExpandMethod(), + io.grpc.stub.ServerCalls.asyncServerStreamingCall( + new MethodHandlers< + com.google.showcase.v1beta1.ExpandRequest, + com.google.showcase.v1beta1.EchoResponse>(service, METHODID_EXPAND))) + .addMethod( + getCollectMethod(), + io.grpc.stub.ServerCalls.asyncClientStreamingCall( + new MethodHandlers< + com.google.showcase.v1beta1.EchoRequest, + com.google.showcase.v1beta1.EchoResponse>(service, METHODID_COLLECT))) + .addMethod( + getChatMethod(), + io.grpc.stub.ServerCalls.asyncBidiStreamingCall( + new MethodHandlers< + com.google.showcase.v1beta1.EchoRequest, + com.google.showcase.v1beta1.EchoResponse>(service, METHODID_CHAT))) + .addMethod( + getPagedExpandMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.showcase.v1beta1.PagedExpandRequest, + com.google.showcase.v1beta1.PagedExpandResponse>( + service, METHODID_PAGED_EXPAND))) + .addMethod( + getPagedExpandLegacyMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.showcase.v1beta1.PagedExpandLegacyRequest, + com.google.showcase.v1beta1.PagedExpandResponse>( + service, METHODID_PAGED_EXPAND_LEGACY))) + .addMethod( + getPagedExpandLegacyMappedMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.showcase.v1beta1.PagedExpandRequest, + com.google.showcase.v1beta1.PagedExpandLegacyMappedResponse>( + service, METHODID_PAGED_EXPAND_LEGACY_MAPPED))) + .addMethod( + getWaitMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.showcase.v1beta1.WaitRequest, com.google.longrunning.Operation>( + service, METHODID_WAIT))) + .addMethod( + getBlockMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.showcase.v1beta1.BlockRequest, + com.google.showcase.v1beta1.BlockResponse>(service, METHODID_BLOCK))) + .build(); + } + + private abstract static class EchoBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoFileDescriptorSupplier, + io.grpc.protobuf.ProtoServiceDescriptorSupplier { + EchoBaseDescriptorSupplier() {} + + @java.lang.Override + public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() { + return com.google.showcase.v1beta1.EchoOuterClass.getDescriptor(); + } + + @java.lang.Override + public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() { + return getFileDescriptor().findServiceByName("Echo"); + } + } + + private static final class EchoFileDescriptorSupplier extends EchoBaseDescriptorSupplier { + EchoFileDescriptorSupplier() {} + } + + private static final class EchoMethodDescriptorSupplier extends EchoBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoMethodDescriptorSupplier { + private final java.lang.String methodName; + + EchoMethodDescriptorSupplier(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 (EchoGrpc.class) { + result = serviceDescriptor; + if (result == null) { + serviceDescriptor = + result = + io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME) + .setSchemaDescriptor(new EchoFileDescriptorSupplier()) + .addMethod(getEchoMethod()) + .addMethod(getEchoErrorDetailsMethod()) + .addMethod(getFailEchoWithDetailsMethod()) + .addMethod(getExpandMethod()) + .addMethod(getCollectMethod()) + .addMethod(getChatMethod()) + .addMethod(getPagedExpandMethod()) + .addMethod(getPagedExpandLegacyMethod()) + .addMethod(getPagedExpandLegacyMappedMethod()) + .addMethod(getWaitMethod()) + .addMethod(getBlockMethod()) + .build(); + } + } + } + return result; + } +} diff --git a/java-showcase/grpc-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/IdentityGrpc.java b/java-showcase/grpc-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/IdentityGrpc.java new file mode 100644 index 0000000000..f2fdca8eb3 --- /dev/null +++ b/java-showcase/grpc-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/IdentityGrpc.java @@ -0,0 +1,886 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.showcase.v1beta1; + +import static io.grpc.MethodDescriptor.generateFullMethodName; + +/** + * + * + *
        + * A simple identity service.
        + * 
        + */ +@io.grpc.stub.annotations.GrpcGenerated +public final class IdentityGrpc { + + private IdentityGrpc() {} + + public static final java.lang.String SERVICE_NAME = "google.showcase.v1beta1.Identity"; + + // Static method descriptors that strictly reflect the proto. + private static volatile io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.CreateUserRequest, com.google.showcase.v1beta1.User> + getCreateUserMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "CreateUser", + requestType = com.google.showcase.v1beta1.CreateUserRequest.class, + responseType = com.google.showcase.v1beta1.User.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.CreateUserRequest, com.google.showcase.v1beta1.User> + getCreateUserMethod() { + io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.CreateUserRequest, com.google.showcase.v1beta1.User> + getCreateUserMethod; + if ((getCreateUserMethod = IdentityGrpc.getCreateUserMethod) == null) { + synchronized (IdentityGrpc.class) { + if ((getCreateUserMethod = IdentityGrpc.getCreateUserMethod) == null) { + IdentityGrpc.getCreateUserMethod = + getCreateUserMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "CreateUser")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.CreateUserRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.User.getDefaultInstance())) + .setSchemaDescriptor(new IdentityMethodDescriptorSupplier("CreateUser")) + .build(); + } + } + } + return getCreateUserMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.GetUserRequest, com.google.showcase.v1beta1.User> + getGetUserMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "GetUser", + requestType = com.google.showcase.v1beta1.GetUserRequest.class, + responseType = com.google.showcase.v1beta1.User.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.GetUserRequest, com.google.showcase.v1beta1.User> + getGetUserMethod() { + io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.GetUserRequest, com.google.showcase.v1beta1.User> + getGetUserMethod; + if ((getGetUserMethod = IdentityGrpc.getGetUserMethod) == null) { + synchronized (IdentityGrpc.class) { + if ((getGetUserMethod = IdentityGrpc.getGetUserMethod) == null) { + IdentityGrpc.getGetUserMethod = + getGetUserMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetUser")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.GetUserRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.User.getDefaultInstance())) + .setSchemaDescriptor(new IdentityMethodDescriptorSupplier("GetUser")) + .build(); + } + } + } + return getGetUserMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.UpdateUserRequest, com.google.showcase.v1beta1.User> + getUpdateUserMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "UpdateUser", + requestType = com.google.showcase.v1beta1.UpdateUserRequest.class, + responseType = com.google.showcase.v1beta1.User.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.UpdateUserRequest, com.google.showcase.v1beta1.User> + getUpdateUserMethod() { + io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.UpdateUserRequest, com.google.showcase.v1beta1.User> + getUpdateUserMethod; + if ((getUpdateUserMethod = IdentityGrpc.getUpdateUserMethod) == null) { + synchronized (IdentityGrpc.class) { + if ((getUpdateUserMethod = IdentityGrpc.getUpdateUserMethod) == null) { + IdentityGrpc.getUpdateUserMethod = + getUpdateUserMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "UpdateUser")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.UpdateUserRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.User.getDefaultInstance())) + .setSchemaDescriptor(new IdentityMethodDescriptorSupplier("UpdateUser")) + .build(); + } + } + } + return getUpdateUserMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.DeleteUserRequest, com.google.protobuf.Empty> + getDeleteUserMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "DeleteUser", + requestType = com.google.showcase.v1beta1.DeleteUserRequest.class, + responseType = com.google.protobuf.Empty.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.DeleteUserRequest, com.google.protobuf.Empty> + getDeleteUserMethod() { + io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.DeleteUserRequest, com.google.protobuf.Empty> + getDeleteUserMethod; + if ((getDeleteUserMethod = IdentityGrpc.getDeleteUserMethod) == null) { + synchronized (IdentityGrpc.class) { + if ((getDeleteUserMethod = IdentityGrpc.getDeleteUserMethod) == null) { + IdentityGrpc.getDeleteUserMethod = + getDeleteUserMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "DeleteUser")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.DeleteUserRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.protobuf.Empty.getDefaultInstance())) + .setSchemaDescriptor(new IdentityMethodDescriptorSupplier("DeleteUser")) + .build(); + } + } + } + return getDeleteUserMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.ListUsersRequest, + com.google.showcase.v1beta1.ListUsersResponse> + getListUsersMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "ListUsers", + requestType = com.google.showcase.v1beta1.ListUsersRequest.class, + responseType = com.google.showcase.v1beta1.ListUsersResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.ListUsersRequest, + com.google.showcase.v1beta1.ListUsersResponse> + getListUsersMethod() { + io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.ListUsersRequest, + com.google.showcase.v1beta1.ListUsersResponse> + getListUsersMethod; + if ((getListUsersMethod = IdentityGrpc.getListUsersMethod) == null) { + synchronized (IdentityGrpc.class) { + if ((getListUsersMethod = IdentityGrpc.getListUsersMethod) == null) { + IdentityGrpc.getListUsersMethod = + getListUsersMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "ListUsers")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.ListUsersRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.ListUsersResponse.getDefaultInstance())) + .setSchemaDescriptor(new IdentityMethodDescriptorSupplier("ListUsers")) + .build(); + } + } + } + return getListUsersMethod; + } + + /** Creates a new async stub that supports all call types for the service */ + public static IdentityStub newStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public IdentityStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new IdentityStub(channel, callOptions); + } + }; + return IdentityStub.newStub(factory, channel); + } + + /** Creates a new blocking-style stub that supports all types of calls on the service */ + public static IdentityBlockingV2Stub newBlockingV2Stub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public IdentityBlockingV2Stub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new IdentityBlockingV2Stub(channel, callOptions); + } + }; + return IdentityBlockingV2Stub.newStub(factory, channel); + } + + /** + * Creates a new blocking-style stub that supports unary and streaming output calls on the service + */ + public static IdentityBlockingStub newBlockingStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public IdentityBlockingStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new IdentityBlockingStub(channel, callOptions); + } + }; + return IdentityBlockingStub.newStub(factory, channel); + } + + /** Creates a new ListenableFuture-style stub that supports unary calls on the service */ + public static IdentityFutureStub newFutureStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public IdentityFutureStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new IdentityFutureStub(channel, callOptions); + } + }; + return IdentityFutureStub.newStub(factory, channel); + } + + /** + * + * + *
        +   * A simple identity service.
        +   * 
        + */ + public interface AsyncService { + + /** + * + * + *
        +     * Creates a user.
        +     * 
        + */ + default void createUser( + com.google.showcase.v1beta1.CreateUserRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getCreateUserMethod(), responseObserver); + } + + /** + * + * + *
        +     * Retrieves the User with the given uri.
        +     * 
        + */ + default void getUser( + com.google.showcase.v1beta1.GetUserRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getGetUserMethod(), responseObserver); + } + + /** + * + * + *
        +     * Updates a user.
        +     * 
        + */ + default void updateUser( + com.google.showcase.v1beta1.UpdateUserRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getUpdateUserMethod(), responseObserver); + } + + /** + * + * + *
        +     * Deletes a user, their profile, and all of their authored messages.
        +     * 
        + */ + default void deleteUser( + com.google.showcase.v1beta1.DeleteUserRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getDeleteUserMethod(), responseObserver); + } + + /** + * + * + *
        +     * Lists all users.
        +     * 
        + */ + default void listUsers( + com.google.showcase.v1beta1.ListUsersRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getListUsersMethod(), responseObserver); + } + } + + /** + * Base class for the server implementation of the service Identity. + * + *
        +   * A simple identity service.
        +   * 
        + */ + public abstract static class IdentityImplBase implements io.grpc.BindableService, AsyncService { + + @java.lang.Override + public final io.grpc.ServerServiceDefinition bindService() { + return IdentityGrpc.bindService(this); + } + } + + /** + * A stub to allow clients to do asynchronous rpc calls to service Identity. + * + *
        +   * A simple identity service.
        +   * 
        + */ + public static final class IdentityStub extends io.grpc.stub.AbstractAsyncStub { + private IdentityStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected IdentityStub build(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new IdentityStub(channel, callOptions); + } + + /** + * + * + *
        +     * Creates a user.
        +     * 
        + */ + public void createUser( + com.google.showcase.v1beta1.CreateUserRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getCreateUserMethod(), getCallOptions()), request, responseObserver); + } + + /** + * + * + *
        +     * Retrieves the User with the given uri.
        +     * 
        + */ + public void getUser( + com.google.showcase.v1beta1.GetUserRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getGetUserMethod(), getCallOptions()), request, responseObserver); + } + + /** + * + * + *
        +     * Updates a user.
        +     * 
        + */ + public void updateUser( + com.google.showcase.v1beta1.UpdateUserRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getUpdateUserMethod(), getCallOptions()), request, responseObserver); + } + + /** + * + * + *
        +     * Deletes a user, their profile, and all of their authored messages.
        +     * 
        + */ + public void deleteUser( + com.google.showcase.v1beta1.DeleteUserRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getDeleteUserMethod(), getCallOptions()), request, responseObserver); + } + + /** + * + * + *
        +     * Lists all users.
        +     * 
        + */ + public void listUsers( + com.google.showcase.v1beta1.ListUsersRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getListUsersMethod(), getCallOptions()), request, responseObserver); + } + } + + /** + * A stub to allow clients to do synchronous rpc calls to service Identity. + * + *
        +   * A simple identity service.
        +   * 
        + */ + public static final class IdentityBlockingV2Stub + extends io.grpc.stub.AbstractBlockingStub { + private IdentityBlockingV2Stub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected IdentityBlockingV2Stub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new IdentityBlockingV2Stub(channel, callOptions); + } + + /** + * + * + *
        +     * Creates a user.
        +     * 
        + */ + public com.google.showcase.v1beta1.User createUser( + com.google.showcase.v1beta1.CreateUserRequest request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getCreateUserMethod(), getCallOptions(), request); + } + + /** + * + * + *
        +     * Retrieves the User with the given uri.
        +     * 
        + */ + public com.google.showcase.v1beta1.User getUser( + com.google.showcase.v1beta1.GetUserRequest request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getGetUserMethod(), getCallOptions(), request); + } + + /** + * + * + *
        +     * Updates a user.
        +     * 
        + */ + public com.google.showcase.v1beta1.User updateUser( + com.google.showcase.v1beta1.UpdateUserRequest request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getUpdateUserMethod(), getCallOptions(), request); + } + + /** + * + * + *
        +     * Deletes a user, their profile, and all of their authored messages.
        +     * 
        + */ + public com.google.protobuf.Empty deleteUser( + com.google.showcase.v1beta1.DeleteUserRequest request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getDeleteUserMethod(), getCallOptions(), request); + } + + /** + * + * + *
        +     * Lists all users.
        +     * 
        + */ + public com.google.showcase.v1beta1.ListUsersResponse listUsers( + com.google.showcase.v1beta1.ListUsersRequest request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getListUsersMethod(), getCallOptions(), request); + } + } + + /** + * A stub to allow clients to do limited synchronous rpc calls to service Identity. + * + *
        +   * A simple identity service.
        +   * 
        + */ + public static final class IdentityBlockingStub + extends io.grpc.stub.AbstractBlockingStub { + private IdentityBlockingStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected IdentityBlockingStub build(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new IdentityBlockingStub(channel, callOptions); + } + + /** + * + * + *
        +     * Creates a user.
        +     * 
        + */ + public com.google.showcase.v1beta1.User createUser( + com.google.showcase.v1beta1.CreateUserRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getCreateUserMethod(), getCallOptions(), request); + } + + /** + * + * + *
        +     * Retrieves the User with the given uri.
        +     * 
        + */ + public com.google.showcase.v1beta1.User getUser( + com.google.showcase.v1beta1.GetUserRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getGetUserMethod(), getCallOptions(), request); + } + + /** + * + * + *
        +     * Updates a user.
        +     * 
        + */ + public com.google.showcase.v1beta1.User updateUser( + com.google.showcase.v1beta1.UpdateUserRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getUpdateUserMethod(), getCallOptions(), request); + } + + /** + * + * + *
        +     * Deletes a user, their profile, and all of their authored messages.
        +     * 
        + */ + public com.google.protobuf.Empty deleteUser( + com.google.showcase.v1beta1.DeleteUserRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getDeleteUserMethod(), getCallOptions(), request); + } + + /** + * + * + *
        +     * Lists all users.
        +     * 
        + */ + public com.google.showcase.v1beta1.ListUsersResponse listUsers( + com.google.showcase.v1beta1.ListUsersRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getListUsersMethod(), getCallOptions(), request); + } + } + + /** + * A stub to allow clients to do ListenableFuture-style rpc calls to service Identity. + * + *
        +   * A simple identity service.
        +   * 
        + */ + public static final class IdentityFutureStub + extends io.grpc.stub.AbstractFutureStub { + private IdentityFutureStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected IdentityFutureStub build(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new IdentityFutureStub(channel, callOptions); + } + + /** + * + * + *
        +     * Creates a user.
        +     * 
        + */ + public com.google.common.util.concurrent.ListenableFuture + createUser(com.google.showcase.v1beta1.CreateUserRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getCreateUserMethod(), getCallOptions()), request); + } + + /** + * + * + *
        +     * Retrieves the User with the given uri.
        +     * 
        + */ + public com.google.common.util.concurrent.ListenableFuture + getUser(com.google.showcase.v1beta1.GetUserRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getGetUserMethod(), getCallOptions()), request); + } + + /** + * + * + *
        +     * Updates a user.
        +     * 
        + */ + public com.google.common.util.concurrent.ListenableFuture + updateUser(com.google.showcase.v1beta1.UpdateUserRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getUpdateUserMethod(), getCallOptions()), request); + } + + /** + * + * + *
        +     * Deletes a user, their profile, and all of their authored messages.
        +     * 
        + */ + public com.google.common.util.concurrent.ListenableFuture deleteUser( + com.google.showcase.v1beta1.DeleteUserRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getDeleteUserMethod(), getCallOptions()), request); + } + + /** + * + * + *
        +     * Lists all users.
        +     * 
        + */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.showcase.v1beta1.ListUsersResponse> + listUsers(com.google.showcase.v1beta1.ListUsersRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getListUsersMethod(), getCallOptions()), request); + } + } + + private static final int METHODID_CREATE_USER = 0; + private static final int METHODID_GET_USER = 1; + private static final int METHODID_UPDATE_USER = 2; + private static final int METHODID_DELETE_USER = 3; + private static final int METHODID_LIST_USERS = 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_CREATE_USER: + serviceImpl.createUser( + (com.google.showcase.v1beta1.CreateUserRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_GET_USER: + serviceImpl.getUser( + (com.google.showcase.v1beta1.GetUserRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_UPDATE_USER: + serviceImpl.updateUser( + (com.google.showcase.v1beta1.UpdateUserRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_DELETE_USER: + serviceImpl.deleteUser( + (com.google.showcase.v1beta1.DeleteUserRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_LIST_USERS: + serviceImpl.listUsers( + (com.google.showcase.v1beta1.ListUsersRequest) 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( + getCreateUserMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.showcase.v1beta1.CreateUserRequest, + com.google.showcase.v1beta1.User>(service, METHODID_CREATE_USER))) + .addMethod( + getGetUserMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.showcase.v1beta1.GetUserRequest, com.google.showcase.v1beta1.User>( + service, METHODID_GET_USER))) + .addMethod( + getUpdateUserMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.showcase.v1beta1.UpdateUserRequest, + com.google.showcase.v1beta1.User>(service, METHODID_UPDATE_USER))) + .addMethod( + getDeleteUserMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.showcase.v1beta1.DeleteUserRequest, com.google.protobuf.Empty>( + service, METHODID_DELETE_USER))) + .addMethod( + getListUsersMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.showcase.v1beta1.ListUsersRequest, + com.google.showcase.v1beta1.ListUsersResponse>(service, METHODID_LIST_USERS))) + .build(); + } + + private abstract static class IdentityBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoFileDescriptorSupplier, + io.grpc.protobuf.ProtoServiceDescriptorSupplier { + IdentityBaseDescriptorSupplier() {} + + @java.lang.Override + public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() { + return com.google.showcase.v1beta1.IdentityOuterClass.getDescriptor(); + } + + @java.lang.Override + public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() { + return getFileDescriptor().findServiceByName("Identity"); + } + } + + private static final class IdentityFileDescriptorSupplier extends IdentityBaseDescriptorSupplier { + IdentityFileDescriptorSupplier() {} + } + + private static final class IdentityMethodDescriptorSupplier extends IdentityBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoMethodDescriptorSupplier { + private final java.lang.String methodName; + + IdentityMethodDescriptorSupplier(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 (IdentityGrpc.class) { + result = serviceDescriptor; + if (result == null) { + serviceDescriptor = + result = + io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME) + .setSchemaDescriptor(new IdentityFileDescriptorSupplier()) + .addMethod(getCreateUserMethod()) + .addMethod(getGetUserMethod()) + .addMethod(getUpdateUserMethod()) + .addMethod(getDeleteUserMethod()) + .addMethod(getListUsersMethod()) + .build(); + } + } + } + return result; + } +} diff --git a/java-showcase/grpc-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/MessagingGrpc.java b/java-showcase/grpc-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/MessagingGrpc.java new file mode 100644 index 0000000000..4c5fad1322 --- /dev/null +++ b/java-showcase/grpc-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/MessagingGrpc.java @@ -0,0 +1,2004 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.showcase.v1beta1; + +import static io.grpc.MethodDescriptor.generateFullMethodName; + +/** + * + * + *
        + * A simple messaging service that implements chat rooms and profile posts.
        + * This messaging service showcases the features that API clients
        + * generated by gapic-generators implement.
        + * 
        + */ +@io.grpc.stub.annotations.GrpcGenerated +public final class MessagingGrpc { + + private MessagingGrpc() {} + + public static final java.lang.String SERVICE_NAME = "google.showcase.v1beta1.Messaging"; + + // Static method descriptors that strictly reflect the proto. + private static volatile io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.CreateRoomRequest, com.google.showcase.v1beta1.Room> + getCreateRoomMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "CreateRoom", + requestType = com.google.showcase.v1beta1.CreateRoomRequest.class, + responseType = com.google.showcase.v1beta1.Room.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.CreateRoomRequest, com.google.showcase.v1beta1.Room> + getCreateRoomMethod() { + io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.CreateRoomRequest, com.google.showcase.v1beta1.Room> + getCreateRoomMethod; + if ((getCreateRoomMethod = MessagingGrpc.getCreateRoomMethod) == null) { + synchronized (MessagingGrpc.class) { + if ((getCreateRoomMethod = MessagingGrpc.getCreateRoomMethod) == null) { + MessagingGrpc.getCreateRoomMethod = + getCreateRoomMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "CreateRoom")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.CreateRoomRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.Room.getDefaultInstance())) + .setSchemaDescriptor(new MessagingMethodDescriptorSupplier("CreateRoom")) + .build(); + } + } + } + return getCreateRoomMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.GetRoomRequest, com.google.showcase.v1beta1.Room> + getGetRoomMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "GetRoom", + requestType = com.google.showcase.v1beta1.GetRoomRequest.class, + responseType = com.google.showcase.v1beta1.Room.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.GetRoomRequest, com.google.showcase.v1beta1.Room> + getGetRoomMethod() { + io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.GetRoomRequest, com.google.showcase.v1beta1.Room> + getGetRoomMethod; + if ((getGetRoomMethod = MessagingGrpc.getGetRoomMethod) == null) { + synchronized (MessagingGrpc.class) { + if ((getGetRoomMethod = MessagingGrpc.getGetRoomMethod) == null) { + MessagingGrpc.getGetRoomMethod = + getGetRoomMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetRoom")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.GetRoomRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.Room.getDefaultInstance())) + .setSchemaDescriptor(new MessagingMethodDescriptorSupplier("GetRoom")) + .build(); + } + } + } + return getGetRoomMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.UpdateRoomRequest, com.google.showcase.v1beta1.Room> + getUpdateRoomMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "UpdateRoom", + requestType = com.google.showcase.v1beta1.UpdateRoomRequest.class, + responseType = com.google.showcase.v1beta1.Room.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.UpdateRoomRequest, com.google.showcase.v1beta1.Room> + getUpdateRoomMethod() { + io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.UpdateRoomRequest, com.google.showcase.v1beta1.Room> + getUpdateRoomMethod; + if ((getUpdateRoomMethod = MessagingGrpc.getUpdateRoomMethod) == null) { + synchronized (MessagingGrpc.class) { + if ((getUpdateRoomMethod = MessagingGrpc.getUpdateRoomMethod) == null) { + MessagingGrpc.getUpdateRoomMethod = + getUpdateRoomMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "UpdateRoom")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.UpdateRoomRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.Room.getDefaultInstance())) + .setSchemaDescriptor(new MessagingMethodDescriptorSupplier("UpdateRoom")) + .build(); + } + } + } + return getUpdateRoomMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.DeleteRoomRequest, com.google.protobuf.Empty> + getDeleteRoomMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "DeleteRoom", + requestType = com.google.showcase.v1beta1.DeleteRoomRequest.class, + responseType = com.google.protobuf.Empty.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.DeleteRoomRequest, com.google.protobuf.Empty> + getDeleteRoomMethod() { + io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.DeleteRoomRequest, com.google.protobuf.Empty> + getDeleteRoomMethod; + if ((getDeleteRoomMethod = MessagingGrpc.getDeleteRoomMethod) == null) { + synchronized (MessagingGrpc.class) { + if ((getDeleteRoomMethod = MessagingGrpc.getDeleteRoomMethod) == null) { + MessagingGrpc.getDeleteRoomMethod = + getDeleteRoomMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "DeleteRoom")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.DeleteRoomRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.protobuf.Empty.getDefaultInstance())) + .setSchemaDescriptor(new MessagingMethodDescriptorSupplier("DeleteRoom")) + .build(); + } + } + } + return getDeleteRoomMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.ListRoomsRequest, + com.google.showcase.v1beta1.ListRoomsResponse> + getListRoomsMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "ListRooms", + requestType = com.google.showcase.v1beta1.ListRoomsRequest.class, + responseType = com.google.showcase.v1beta1.ListRoomsResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.ListRoomsRequest, + com.google.showcase.v1beta1.ListRoomsResponse> + getListRoomsMethod() { + io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.ListRoomsRequest, + com.google.showcase.v1beta1.ListRoomsResponse> + getListRoomsMethod; + if ((getListRoomsMethod = MessagingGrpc.getListRoomsMethod) == null) { + synchronized (MessagingGrpc.class) { + if ((getListRoomsMethod = MessagingGrpc.getListRoomsMethod) == null) { + MessagingGrpc.getListRoomsMethod = + getListRoomsMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "ListRooms")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.ListRoomsRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.ListRoomsResponse.getDefaultInstance())) + .setSchemaDescriptor(new MessagingMethodDescriptorSupplier("ListRooms")) + .build(); + } + } + } + return getListRoomsMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.CreateBlurbRequest, com.google.showcase.v1beta1.Blurb> + getCreateBlurbMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "CreateBlurb", + requestType = com.google.showcase.v1beta1.CreateBlurbRequest.class, + responseType = com.google.showcase.v1beta1.Blurb.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.CreateBlurbRequest, com.google.showcase.v1beta1.Blurb> + getCreateBlurbMethod() { + io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.CreateBlurbRequest, com.google.showcase.v1beta1.Blurb> + getCreateBlurbMethod; + if ((getCreateBlurbMethod = MessagingGrpc.getCreateBlurbMethod) == null) { + synchronized (MessagingGrpc.class) { + if ((getCreateBlurbMethod = MessagingGrpc.getCreateBlurbMethod) == null) { + MessagingGrpc.getCreateBlurbMethod = + getCreateBlurbMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "CreateBlurb")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.CreateBlurbRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.Blurb.getDefaultInstance())) + .setSchemaDescriptor(new MessagingMethodDescriptorSupplier("CreateBlurb")) + .build(); + } + } + } + return getCreateBlurbMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.GetBlurbRequest, com.google.showcase.v1beta1.Blurb> + getGetBlurbMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "GetBlurb", + requestType = com.google.showcase.v1beta1.GetBlurbRequest.class, + responseType = com.google.showcase.v1beta1.Blurb.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.GetBlurbRequest, com.google.showcase.v1beta1.Blurb> + getGetBlurbMethod() { + io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.GetBlurbRequest, com.google.showcase.v1beta1.Blurb> + getGetBlurbMethod; + if ((getGetBlurbMethod = MessagingGrpc.getGetBlurbMethod) == null) { + synchronized (MessagingGrpc.class) { + if ((getGetBlurbMethod = MessagingGrpc.getGetBlurbMethod) == null) { + MessagingGrpc.getGetBlurbMethod = + getGetBlurbMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetBlurb")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.GetBlurbRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.Blurb.getDefaultInstance())) + .setSchemaDescriptor(new MessagingMethodDescriptorSupplier("GetBlurb")) + .build(); + } + } + } + return getGetBlurbMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.UpdateBlurbRequest, com.google.showcase.v1beta1.Blurb> + getUpdateBlurbMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "UpdateBlurb", + requestType = com.google.showcase.v1beta1.UpdateBlurbRequest.class, + responseType = com.google.showcase.v1beta1.Blurb.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.UpdateBlurbRequest, com.google.showcase.v1beta1.Blurb> + getUpdateBlurbMethod() { + io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.UpdateBlurbRequest, com.google.showcase.v1beta1.Blurb> + getUpdateBlurbMethod; + if ((getUpdateBlurbMethod = MessagingGrpc.getUpdateBlurbMethod) == null) { + synchronized (MessagingGrpc.class) { + if ((getUpdateBlurbMethod = MessagingGrpc.getUpdateBlurbMethod) == null) { + MessagingGrpc.getUpdateBlurbMethod = + getUpdateBlurbMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "UpdateBlurb")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.UpdateBlurbRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.Blurb.getDefaultInstance())) + .setSchemaDescriptor(new MessagingMethodDescriptorSupplier("UpdateBlurb")) + .build(); + } + } + } + return getUpdateBlurbMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.DeleteBlurbRequest, com.google.protobuf.Empty> + getDeleteBlurbMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "DeleteBlurb", + requestType = com.google.showcase.v1beta1.DeleteBlurbRequest.class, + responseType = com.google.protobuf.Empty.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.DeleteBlurbRequest, com.google.protobuf.Empty> + getDeleteBlurbMethod() { + io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.DeleteBlurbRequest, com.google.protobuf.Empty> + getDeleteBlurbMethod; + if ((getDeleteBlurbMethod = MessagingGrpc.getDeleteBlurbMethod) == null) { + synchronized (MessagingGrpc.class) { + if ((getDeleteBlurbMethod = MessagingGrpc.getDeleteBlurbMethod) == null) { + MessagingGrpc.getDeleteBlurbMethod = + getDeleteBlurbMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "DeleteBlurb")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.DeleteBlurbRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.protobuf.Empty.getDefaultInstance())) + .setSchemaDescriptor(new MessagingMethodDescriptorSupplier("DeleteBlurb")) + .build(); + } + } + } + return getDeleteBlurbMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.ListBlurbsRequest, + com.google.showcase.v1beta1.ListBlurbsResponse> + getListBlurbsMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "ListBlurbs", + requestType = com.google.showcase.v1beta1.ListBlurbsRequest.class, + responseType = com.google.showcase.v1beta1.ListBlurbsResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.ListBlurbsRequest, + com.google.showcase.v1beta1.ListBlurbsResponse> + getListBlurbsMethod() { + io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.ListBlurbsRequest, + com.google.showcase.v1beta1.ListBlurbsResponse> + getListBlurbsMethod; + if ((getListBlurbsMethod = MessagingGrpc.getListBlurbsMethod) == null) { + synchronized (MessagingGrpc.class) { + if ((getListBlurbsMethod = MessagingGrpc.getListBlurbsMethod) == null) { + MessagingGrpc.getListBlurbsMethod = + getListBlurbsMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "ListBlurbs")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.ListBlurbsRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.ListBlurbsResponse.getDefaultInstance())) + .setSchemaDescriptor(new MessagingMethodDescriptorSupplier("ListBlurbs")) + .build(); + } + } + } + return getListBlurbsMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.SearchBlurbsRequest, com.google.longrunning.Operation> + getSearchBlurbsMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "SearchBlurbs", + requestType = com.google.showcase.v1beta1.SearchBlurbsRequest.class, + responseType = com.google.longrunning.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.SearchBlurbsRequest, com.google.longrunning.Operation> + getSearchBlurbsMethod() { + io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.SearchBlurbsRequest, com.google.longrunning.Operation> + getSearchBlurbsMethod; + if ((getSearchBlurbsMethod = MessagingGrpc.getSearchBlurbsMethod) == null) { + synchronized (MessagingGrpc.class) { + if ((getSearchBlurbsMethod = MessagingGrpc.getSearchBlurbsMethod) == null) { + MessagingGrpc.getSearchBlurbsMethod = + getSearchBlurbsMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "SearchBlurbs")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.SearchBlurbsRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor(new MessagingMethodDescriptorSupplier("SearchBlurbs")) + .build(); + } + } + } + return getSearchBlurbsMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.StreamBlurbsRequest, + com.google.showcase.v1beta1.StreamBlurbsResponse> + getStreamBlurbsMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "StreamBlurbs", + requestType = com.google.showcase.v1beta1.StreamBlurbsRequest.class, + responseType = com.google.showcase.v1beta1.StreamBlurbsResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.SERVER_STREAMING) + public static io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.StreamBlurbsRequest, + com.google.showcase.v1beta1.StreamBlurbsResponse> + getStreamBlurbsMethod() { + io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.StreamBlurbsRequest, + com.google.showcase.v1beta1.StreamBlurbsResponse> + getStreamBlurbsMethod; + if ((getStreamBlurbsMethod = MessagingGrpc.getStreamBlurbsMethod) == null) { + synchronized (MessagingGrpc.class) { + if ((getStreamBlurbsMethod = MessagingGrpc.getStreamBlurbsMethod) == null) { + MessagingGrpc.getStreamBlurbsMethod = + getStreamBlurbsMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.SERVER_STREAMING) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "StreamBlurbs")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.StreamBlurbsRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.StreamBlurbsResponse + .getDefaultInstance())) + .setSchemaDescriptor(new MessagingMethodDescriptorSupplier("StreamBlurbs")) + .build(); + } + } + } + return getStreamBlurbsMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.CreateBlurbRequest, + com.google.showcase.v1beta1.SendBlurbsResponse> + getSendBlurbsMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "SendBlurbs", + requestType = com.google.showcase.v1beta1.CreateBlurbRequest.class, + responseType = com.google.showcase.v1beta1.SendBlurbsResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.CLIENT_STREAMING) + public static io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.CreateBlurbRequest, + com.google.showcase.v1beta1.SendBlurbsResponse> + getSendBlurbsMethod() { + io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.CreateBlurbRequest, + com.google.showcase.v1beta1.SendBlurbsResponse> + getSendBlurbsMethod; + if ((getSendBlurbsMethod = MessagingGrpc.getSendBlurbsMethod) == null) { + synchronized (MessagingGrpc.class) { + if ((getSendBlurbsMethod = MessagingGrpc.getSendBlurbsMethod) == null) { + MessagingGrpc.getSendBlurbsMethod = + getSendBlurbsMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.CLIENT_STREAMING) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "SendBlurbs")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.CreateBlurbRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.SendBlurbsResponse.getDefaultInstance())) + .setSchemaDescriptor(new MessagingMethodDescriptorSupplier("SendBlurbs")) + .build(); + } + } + } + return getSendBlurbsMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.ConnectRequest, + com.google.showcase.v1beta1.StreamBlurbsResponse> + getConnectMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "Connect", + requestType = com.google.showcase.v1beta1.ConnectRequest.class, + responseType = com.google.showcase.v1beta1.StreamBlurbsResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.BIDI_STREAMING) + public static io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.ConnectRequest, + com.google.showcase.v1beta1.StreamBlurbsResponse> + getConnectMethod() { + io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.ConnectRequest, + com.google.showcase.v1beta1.StreamBlurbsResponse> + getConnectMethod; + if ((getConnectMethod = MessagingGrpc.getConnectMethod) == null) { + synchronized (MessagingGrpc.class) { + if ((getConnectMethod = MessagingGrpc.getConnectMethod) == null) { + MessagingGrpc.getConnectMethod = + getConnectMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.BIDI_STREAMING) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "Connect")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.ConnectRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.StreamBlurbsResponse + .getDefaultInstance())) + .setSchemaDescriptor(new MessagingMethodDescriptorSupplier("Connect")) + .build(); + } + } + } + return getConnectMethod; + } + + /** Creates a new async stub that supports all call types for the service */ + public static MessagingStub newStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public MessagingStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new MessagingStub(channel, callOptions); + } + }; + return MessagingStub.newStub(factory, channel); + } + + /** Creates a new blocking-style stub that supports all types of calls on the service */ + public static MessagingBlockingV2Stub newBlockingV2Stub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public MessagingBlockingV2Stub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new MessagingBlockingV2Stub(channel, callOptions); + } + }; + return MessagingBlockingV2Stub.newStub(factory, channel); + } + + /** + * Creates a new blocking-style stub that supports unary and streaming output calls on the service + */ + public static MessagingBlockingStub newBlockingStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public MessagingBlockingStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new MessagingBlockingStub(channel, callOptions); + } + }; + return MessagingBlockingStub.newStub(factory, channel); + } + + /** Creates a new ListenableFuture-style stub that supports unary calls on the service */ + public static MessagingFutureStub newFutureStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public MessagingFutureStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new MessagingFutureStub(channel, callOptions); + } + }; + return MessagingFutureStub.newStub(factory, channel); + } + + /** + * + * + *
        +   * A simple messaging service that implements chat rooms and profile posts.
        +   * This messaging service showcases the features that API clients
        +   * generated by gapic-generators implement.
        +   * 
        + */ + public interface AsyncService { + + /** + * + * + *
        +     * Creates a room.
        +     * 
        + */ + default void createRoom( + com.google.showcase.v1beta1.CreateRoomRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getCreateRoomMethod(), responseObserver); + } + + /** + * + * + *
        +     * Retrieves the Room with the given resource name.
        +     * 
        + */ + default void getRoom( + com.google.showcase.v1beta1.GetRoomRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getGetRoomMethod(), responseObserver); + } + + /** + * + * + *
        +     * Updates a room.
        +     * 
        + */ + default void updateRoom( + com.google.showcase.v1beta1.UpdateRoomRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getUpdateRoomMethod(), responseObserver); + } + + /** + * + * + *
        +     * Deletes a room and all of its blurbs.
        +     * 
        + */ + default void deleteRoom( + com.google.showcase.v1beta1.DeleteRoomRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getDeleteRoomMethod(), responseObserver); + } + + /** + * + * + *
        +     * Lists all chat rooms.
        +     * 
        + */ + default void listRooms( + com.google.showcase.v1beta1.ListRoomsRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getListRoomsMethod(), responseObserver); + } + + /** + * + * + *
        +     * Creates a blurb. If the parent is a room, the blurb is understood to be a
        +     * message in that room. If the parent is a profile, the blurb is understood
        +     * to be a post on the profile.
        +     * 
        + */ + default void createBlurb( + com.google.showcase.v1beta1.CreateBlurbRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getCreateBlurbMethod(), responseObserver); + } + + /** + * + * + *
        +     * Retrieves the Blurb with the given resource name.
        +     * 
        + */ + default void getBlurb( + com.google.showcase.v1beta1.GetBlurbRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getGetBlurbMethod(), responseObserver); + } + + /** + * + * + *
        +     * Updates a blurb.
        +     * 
        + */ + default void updateBlurb( + com.google.showcase.v1beta1.UpdateBlurbRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getUpdateBlurbMethod(), responseObserver); + } + + /** + * + * + *
        +     * Deletes a blurb.
        +     * 
        + */ + default void deleteBlurb( + com.google.showcase.v1beta1.DeleteBlurbRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getDeleteBlurbMethod(), responseObserver); + } + + /** + * + * + *
        +     * Lists blurbs for a specific chat room or user profile depending on the
        +     * parent resource name.
        +     * 
        + */ + default void listBlurbs( + com.google.showcase.v1beta1.ListBlurbsRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getListBlurbsMethod(), responseObserver); + } + + /** + * + * + *
        +     * This method searches through all blurbs across all rooms and profiles
        +     * for blurbs containing to words found in the query. Only posts that
        +     * contain an exact match of a queried word will be returned.
        +     * 
        + */ + default void searchBlurbs( + com.google.showcase.v1beta1.SearchBlurbsRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getSearchBlurbsMethod(), responseObserver); + } + + /** + * + * + *
        +     * This returns a stream that emits the blurbs that are created for a
        +     * particular chat room or user profile.
        +     * 
        + */ + default void streamBlurbs( + com.google.showcase.v1beta1.StreamBlurbsRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getStreamBlurbsMethod(), responseObserver); + } + + /** + * + * + *
        +     * This is a stream to create multiple blurbs. If an invalid blurb is
        +     * requested to be created, the stream will close with an error.
        +     * 
        + */ + default io.grpc.stub.StreamObserver sendBlurbs( + io.grpc.stub.StreamObserver + responseObserver) { + return io.grpc.stub.ServerCalls.asyncUnimplementedStreamingCall( + getSendBlurbsMethod(), responseObserver); + } + + /** + * + * + *
        +     * This method starts a bidirectional stream that receives all blurbs that
        +     * are being created after the stream has started and sends requests to create
        +     * blurbs. If an invalid blurb is requested to be created, the stream will
        +     * close with an error.
        +     * 
        + */ + default io.grpc.stub.StreamObserver connect( + io.grpc.stub.StreamObserver + responseObserver) { + return io.grpc.stub.ServerCalls.asyncUnimplementedStreamingCall( + getConnectMethod(), responseObserver); + } + } + + /** + * Base class for the server implementation of the service Messaging. + * + *
        +   * A simple messaging service that implements chat rooms and profile posts.
        +   * This messaging service showcases the features that API clients
        +   * generated by gapic-generators implement.
        +   * 
        + */ + public abstract static class MessagingImplBase implements io.grpc.BindableService, AsyncService { + + @java.lang.Override + public final io.grpc.ServerServiceDefinition bindService() { + return MessagingGrpc.bindService(this); + } + } + + /** + * A stub to allow clients to do asynchronous rpc calls to service Messaging. + * + *
        +   * A simple messaging service that implements chat rooms and profile posts.
        +   * This messaging service showcases the features that API clients
        +   * generated by gapic-generators implement.
        +   * 
        + */ + public static final class MessagingStub extends io.grpc.stub.AbstractAsyncStub { + private MessagingStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected MessagingStub build(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new MessagingStub(channel, callOptions); + } + + /** + * + * + *
        +     * Creates a room.
        +     * 
        + */ + public void createRoom( + com.google.showcase.v1beta1.CreateRoomRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getCreateRoomMethod(), getCallOptions()), request, responseObserver); + } + + /** + * + * + *
        +     * Retrieves the Room with the given resource name.
        +     * 
        + */ + public void getRoom( + com.google.showcase.v1beta1.GetRoomRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getGetRoomMethod(), getCallOptions()), request, responseObserver); + } + + /** + * + * + *
        +     * Updates a room.
        +     * 
        + */ + public void updateRoom( + com.google.showcase.v1beta1.UpdateRoomRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getUpdateRoomMethod(), getCallOptions()), request, responseObserver); + } + + /** + * + * + *
        +     * Deletes a room and all of its blurbs.
        +     * 
        + */ + public void deleteRoom( + com.google.showcase.v1beta1.DeleteRoomRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getDeleteRoomMethod(), getCallOptions()), request, responseObserver); + } + + /** + * + * + *
        +     * Lists all chat rooms.
        +     * 
        + */ + public void listRooms( + com.google.showcase.v1beta1.ListRoomsRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getListRoomsMethod(), getCallOptions()), request, responseObserver); + } + + /** + * + * + *
        +     * Creates a blurb. If the parent is a room, the blurb is understood to be a
        +     * message in that room. If the parent is a profile, the blurb is understood
        +     * to be a post on the profile.
        +     * 
        + */ + public void createBlurb( + com.google.showcase.v1beta1.CreateBlurbRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getCreateBlurbMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
        +     * Retrieves the Blurb with the given resource name.
        +     * 
        + */ + public void getBlurb( + com.google.showcase.v1beta1.GetBlurbRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getGetBlurbMethod(), getCallOptions()), request, responseObserver); + } + + /** + * + * + *
        +     * Updates a blurb.
        +     * 
        + */ + public void updateBlurb( + com.google.showcase.v1beta1.UpdateBlurbRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getUpdateBlurbMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
        +     * Deletes a blurb.
        +     * 
        + */ + public void deleteBlurb( + com.google.showcase.v1beta1.DeleteBlurbRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getDeleteBlurbMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
        +     * Lists blurbs for a specific chat room or user profile depending on the
        +     * parent resource name.
        +     * 
        + */ + public void listBlurbs( + com.google.showcase.v1beta1.ListBlurbsRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getListBlurbsMethod(), getCallOptions()), request, responseObserver); + } + + /** + * + * + *
        +     * This method searches through all blurbs across all rooms and profiles
        +     * for blurbs containing to words found in the query. Only posts that
        +     * contain an exact match of a queried word will be returned.
        +     * 
        + */ + public void searchBlurbs( + com.google.showcase.v1beta1.SearchBlurbsRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getSearchBlurbsMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
        +     * This returns a stream that emits the blurbs that are created for a
        +     * particular chat room or user profile.
        +     * 
        + */ + public void streamBlurbs( + com.google.showcase.v1beta1.StreamBlurbsRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncServerStreamingCall( + getChannel().newCall(getStreamBlurbsMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
        +     * This is a stream to create multiple blurbs. If an invalid blurb is
        +     * requested to be created, the stream will close with an error.
        +     * 
        + */ + public io.grpc.stub.StreamObserver sendBlurbs( + io.grpc.stub.StreamObserver + responseObserver) { + return io.grpc.stub.ClientCalls.asyncClientStreamingCall( + getChannel().newCall(getSendBlurbsMethod(), getCallOptions()), responseObserver); + } + + /** + * + * + *
        +     * This method starts a bidirectional stream that receives all blurbs that
        +     * are being created after the stream has started and sends requests to create
        +     * blurbs. If an invalid blurb is requested to be created, the stream will
        +     * close with an error.
        +     * 
        + */ + public io.grpc.stub.StreamObserver connect( + io.grpc.stub.StreamObserver + responseObserver) { + return io.grpc.stub.ClientCalls.asyncBidiStreamingCall( + getChannel().newCall(getConnectMethod(), getCallOptions()), responseObserver); + } + } + + /** + * A stub to allow clients to do synchronous rpc calls to service Messaging. + * + *
        +   * A simple messaging service that implements chat rooms and profile posts.
        +   * This messaging service showcases the features that API clients
        +   * generated by gapic-generators implement.
        +   * 
        + */ + public static final class MessagingBlockingV2Stub + extends io.grpc.stub.AbstractBlockingStub { + private MessagingBlockingV2Stub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected MessagingBlockingV2Stub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new MessagingBlockingV2Stub(channel, callOptions); + } + + /** + * + * + *
        +     * Creates a room.
        +     * 
        + */ + public com.google.showcase.v1beta1.Room createRoom( + com.google.showcase.v1beta1.CreateRoomRequest request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getCreateRoomMethod(), getCallOptions(), request); + } + + /** + * + * + *
        +     * Retrieves the Room with the given resource name.
        +     * 
        + */ + public com.google.showcase.v1beta1.Room getRoom( + com.google.showcase.v1beta1.GetRoomRequest request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getGetRoomMethod(), getCallOptions(), request); + } + + /** + * + * + *
        +     * Updates a room.
        +     * 
        + */ + public com.google.showcase.v1beta1.Room updateRoom( + com.google.showcase.v1beta1.UpdateRoomRequest request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getUpdateRoomMethod(), getCallOptions(), request); + } + + /** + * + * + *
        +     * Deletes a room and all of its blurbs.
        +     * 
        + */ + public com.google.protobuf.Empty deleteRoom( + com.google.showcase.v1beta1.DeleteRoomRequest request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getDeleteRoomMethod(), getCallOptions(), request); + } + + /** + * + * + *
        +     * Lists all chat rooms.
        +     * 
        + */ + public com.google.showcase.v1beta1.ListRoomsResponse listRooms( + com.google.showcase.v1beta1.ListRoomsRequest request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getListRoomsMethod(), getCallOptions(), request); + } + + /** + * + * + *
        +     * Creates a blurb. If the parent is a room, the blurb is understood to be a
        +     * message in that room. If the parent is a profile, the blurb is understood
        +     * to be a post on the profile.
        +     * 
        + */ + public com.google.showcase.v1beta1.Blurb createBlurb( + com.google.showcase.v1beta1.CreateBlurbRequest request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getCreateBlurbMethod(), getCallOptions(), request); + } + + /** + * + * + *
        +     * Retrieves the Blurb with the given resource name.
        +     * 
        + */ + public com.google.showcase.v1beta1.Blurb getBlurb( + com.google.showcase.v1beta1.GetBlurbRequest request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getGetBlurbMethod(), getCallOptions(), request); + } + + /** + * + * + *
        +     * Updates a blurb.
        +     * 
        + */ + public com.google.showcase.v1beta1.Blurb updateBlurb( + com.google.showcase.v1beta1.UpdateBlurbRequest request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getUpdateBlurbMethod(), getCallOptions(), request); + } + + /** + * + * + *
        +     * Deletes a blurb.
        +     * 
        + */ + public com.google.protobuf.Empty deleteBlurb( + com.google.showcase.v1beta1.DeleteBlurbRequest request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getDeleteBlurbMethod(), getCallOptions(), request); + } + + /** + * + * + *
        +     * Lists blurbs for a specific chat room or user profile depending on the
        +     * parent resource name.
        +     * 
        + */ + public com.google.showcase.v1beta1.ListBlurbsResponse listBlurbs( + com.google.showcase.v1beta1.ListBlurbsRequest request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getListBlurbsMethod(), getCallOptions(), request); + } + + /** + * + * + *
        +     * This method searches through all blurbs across all rooms and profiles
        +     * for blurbs containing to words found in the query. Only posts that
        +     * contain an exact match of a queried word will be returned.
        +     * 
        + */ + public com.google.longrunning.Operation searchBlurbs( + com.google.showcase.v1beta1.SearchBlurbsRequest request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getSearchBlurbsMethod(), getCallOptions(), request); + } + + /** + * + * + *
        +     * This returns a stream that emits the blurbs that are created for a
        +     * particular chat room or user profile.
        +     * 
        + */ + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/10918") + public io.grpc.stub.BlockingClientCall + streamBlurbs(com.google.showcase.v1beta1.StreamBlurbsRequest request) { + return io.grpc.stub.ClientCalls.blockingV2ServerStreamingCall( + getChannel(), getStreamBlurbsMethod(), getCallOptions(), request); + } + + /** + * + * + *
        +     * This is a stream to create multiple blurbs. If an invalid blurb is
        +     * requested to be created, the stream will close with an error.
        +     * 
        + */ + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/10918") + public io.grpc.stub.BlockingClientCall< + com.google.showcase.v1beta1.CreateBlurbRequest, + com.google.showcase.v1beta1.SendBlurbsResponse> + sendBlurbs() { + return io.grpc.stub.ClientCalls.blockingClientStreamingCall( + getChannel(), getSendBlurbsMethod(), getCallOptions()); + } + + /** + * + * + *
        +     * This method starts a bidirectional stream that receives all blurbs that
        +     * are being created after the stream has started and sends requests to create
        +     * blurbs. If an invalid blurb is requested to be created, the stream will
        +     * close with an error.
        +     * 
        + */ + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/10918") + public io.grpc.stub.BlockingClientCall< + com.google.showcase.v1beta1.ConnectRequest, + com.google.showcase.v1beta1.StreamBlurbsResponse> + connect() { + return io.grpc.stub.ClientCalls.blockingBidiStreamingCall( + getChannel(), getConnectMethod(), getCallOptions()); + } + } + + /** + * A stub to allow clients to do limited synchronous rpc calls to service Messaging. + * + *
        +   * A simple messaging service that implements chat rooms and profile posts.
        +   * This messaging service showcases the features that API clients
        +   * generated by gapic-generators implement.
        +   * 
        + */ + public static final class MessagingBlockingStub + extends io.grpc.stub.AbstractBlockingStub { + private MessagingBlockingStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected MessagingBlockingStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new MessagingBlockingStub(channel, callOptions); + } + + /** + * + * + *
        +     * Creates a room.
        +     * 
        + */ + public com.google.showcase.v1beta1.Room createRoom( + com.google.showcase.v1beta1.CreateRoomRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getCreateRoomMethod(), getCallOptions(), request); + } + + /** + * + * + *
        +     * Retrieves the Room with the given resource name.
        +     * 
        + */ + public com.google.showcase.v1beta1.Room getRoom( + com.google.showcase.v1beta1.GetRoomRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getGetRoomMethod(), getCallOptions(), request); + } + + /** + * + * + *
        +     * Updates a room.
        +     * 
        + */ + public com.google.showcase.v1beta1.Room updateRoom( + com.google.showcase.v1beta1.UpdateRoomRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getUpdateRoomMethod(), getCallOptions(), request); + } + + /** + * + * + *
        +     * Deletes a room and all of its blurbs.
        +     * 
        + */ + public com.google.protobuf.Empty deleteRoom( + com.google.showcase.v1beta1.DeleteRoomRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getDeleteRoomMethod(), getCallOptions(), request); + } + + /** + * + * + *
        +     * Lists all chat rooms.
        +     * 
        + */ + public com.google.showcase.v1beta1.ListRoomsResponse listRooms( + com.google.showcase.v1beta1.ListRoomsRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getListRoomsMethod(), getCallOptions(), request); + } + + /** + * + * + *
        +     * Creates a blurb. If the parent is a room, the blurb is understood to be a
        +     * message in that room. If the parent is a profile, the blurb is understood
        +     * to be a post on the profile.
        +     * 
        + */ + public com.google.showcase.v1beta1.Blurb createBlurb( + com.google.showcase.v1beta1.CreateBlurbRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getCreateBlurbMethod(), getCallOptions(), request); + } + + /** + * + * + *
        +     * Retrieves the Blurb with the given resource name.
        +     * 
        + */ + public com.google.showcase.v1beta1.Blurb getBlurb( + com.google.showcase.v1beta1.GetBlurbRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getGetBlurbMethod(), getCallOptions(), request); + } + + /** + * + * + *
        +     * Updates a blurb.
        +     * 
        + */ + public com.google.showcase.v1beta1.Blurb updateBlurb( + com.google.showcase.v1beta1.UpdateBlurbRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getUpdateBlurbMethod(), getCallOptions(), request); + } + + /** + * + * + *
        +     * Deletes a blurb.
        +     * 
        + */ + public com.google.protobuf.Empty deleteBlurb( + com.google.showcase.v1beta1.DeleteBlurbRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getDeleteBlurbMethod(), getCallOptions(), request); + } + + /** + * + * + *
        +     * Lists blurbs for a specific chat room or user profile depending on the
        +     * parent resource name.
        +     * 
        + */ + public com.google.showcase.v1beta1.ListBlurbsResponse listBlurbs( + com.google.showcase.v1beta1.ListBlurbsRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getListBlurbsMethod(), getCallOptions(), request); + } + + /** + * + * + *
        +     * This method searches through all blurbs across all rooms and profiles
        +     * for blurbs containing to words found in the query. Only posts that
        +     * contain an exact match of a queried word will be returned.
        +     * 
        + */ + public com.google.longrunning.Operation searchBlurbs( + com.google.showcase.v1beta1.SearchBlurbsRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getSearchBlurbsMethod(), getCallOptions(), request); + } + + /** + * + * + *
        +     * This returns a stream that emits the blurbs that are created for a
        +     * particular chat room or user profile.
        +     * 
        + */ + public java.util.Iterator streamBlurbs( + com.google.showcase.v1beta1.StreamBlurbsRequest request) { + return io.grpc.stub.ClientCalls.blockingServerStreamingCall( + getChannel(), getStreamBlurbsMethod(), getCallOptions(), request); + } + } + + /** + * A stub to allow clients to do ListenableFuture-style rpc calls to service Messaging. + * + *
        +   * A simple messaging service that implements chat rooms and profile posts.
        +   * This messaging service showcases the features that API clients
        +   * generated by gapic-generators implement.
        +   * 
        + */ + public static final class MessagingFutureStub + extends io.grpc.stub.AbstractFutureStub { + private MessagingFutureStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected MessagingFutureStub build(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new MessagingFutureStub(channel, callOptions); + } + + /** + * + * + *
        +     * Creates a room.
        +     * 
        + */ + public com.google.common.util.concurrent.ListenableFuture + createRoom(com.google.showcase.v1beta1.CreateRoomRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getCreateRoomMethod(), getCallOptions()), request); + } + + /** + * + * + *
        +     * Retrieves the Room with the given resource name.
        +     * 
        + */ + public com.google.common.util.concurrent.ListenableFuture + getRoom(com.google.showcase.v1beta1.GetRoomRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getGetRoomMethod(), getCallOptions()), request); + } + + /** + * + * + *
        +     * Updates a room.
        +     * 
        + */ + public com.google.common.util.concurrent.ListenableFuture + updateRoom(com.google.showcase.v1beta1.UpdateRoomRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getUpdateRoomMethod(), getCallOptions()), request); + } + + /** + * + * + *
        +     * Deletes a room and all of its blurbs.
        +     * 
        + */ + public com.google.common.util.concurrent.ListenableFuture deleteRoom( + com.google.showcase.v1beta1.DeleteRoomRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getDeleteRoomMethod(), getCallOptions()), request); + } + + /** + * + * + *
        +     * Lists all chat rooms.
        +     * 
        + */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.showcase.v1beta1.ListRoomsResponse> + listRooms(com.google.showcase.v1beta1.ListRoomsRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getListRoomsMethod(), getCallOptions()), request); + } + + /** + * + * + *
        +     * Creates a blurb. If the parent is a room, the blurb is understood to be a
        +     * message in that room. If the parent is a profile, the blurb is understood
        +     * to be a post on the profile.
        +     * 
        + */ + public com.google.common.util.concurrent.ListenableFuture + createBlurb(com.google.showcase.v1beta1.CreateBlurbRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getCreateBlurbMethod(), getCallOptions()), request); + } + + /** + * + * + *
        +     * Retrieves the Blurb with the given resource name.
        +     * 
        + */ + public com.google.common.util.concurrent.ListenableFuture + getBlurb(com.google.showcase.v1beta1.GetBlurbRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getGetBlurbMethod(), getCallOptions()), request); + } + + /** + * + * + *
        +     * Updates a blurb.
        +     * 
        + */ + public com.google.common.util.concurrent.ListenableFuture + updateBlurb(com.google.showcase.v1beta1.UpdateBlurbRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getUpdateBlurbMethod(), getCallOptions()), request); + } + + /** + * + * + *
        +     * Deletes a blurb.
        +     * 
        + */ + public com.google.common.util.concurrent.ListenableFuture + deleteBlurb(com.google.showcase.v1beta1.DeleteBlurbRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getDeleteBlurbMethod(), getCallOptions()), request); + } + + /** + * + * + *
        +     * Lists blurbs for a specific chat room or user profile depending on the
        +     * parent resource name.
        +     * 
        + */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.showcase.v1beta1.ListBlurbsResponse> + listBlurbs(com.google.showcase.v1beta1.ListBlurbsRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getListBlurbsMethod(), getCallOptions()), request); + } + + /** + * + * + *
        +     * This method searches through all blurbs across all rooms and profiles
        +     * for blurbs containing to words found in the query. Only posts that
        +     * contain an exact match of a queried word will be returned.
        +     * 
        + */ + public com.google.common.util.concurrent.ListenableFuture + searchBlurbs(com.google.showcase.v1beta1.SearchBlurbsRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getSearchBlurbsMethod(), getCallOptions()), request); + } + } + + private static final int METHODID_CREATE_ROOM = 0; + private static final int METHODID_GET_ROOM = 1; + private static final int METHODID_UPDATE_ROOM = 2; + private static final int METHODID_DELETE_ROOM = 3; + private static final int METHODID_LIST_ROOMS = 4; + private static final int METHODID_CREATE_BLURB = 5; + private static final int METHODID_GET_BLURB = 6; + private static final int METHODID_UPDATE_BLURB = 7; + private static final int METHODID_DELETE_BLURB = 8; + private static final int METHODID_LIST_BLURBS = 9; + private static final int METHODID_SEARCH_BLURBS = 10; + private static final int METHODID_STREAM_BLURBS = 11; + private static final int METHODID_SEND_BLURBS = 12; + private static final int METHODID_CONNECT = 13; + + 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_CREATE_ROOM: + serviceImpl.createRoom( + (com.google.showcase.v1beta1.CreateRoomRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_GET_ROOM: + serviceImpl.getRoom( + (com.google.showcase.v1beta1.GetRoomRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_UPDATE_ROOM: + serviceImpl.updateRoom( + (com.google.showcase.v1beta1.UpdateRoomRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_DELETE_ROOM: + serviceImpl.deleteRoom( + (com.google.showcase.v1beta1.DeleteRoomRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_LIST_ROOMS: + serviceImpl.listRooms( + (com.google.showcase.v1beta1.ListRoomsRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_CREATE_BLURB: + serviceImpl.createBlurb( + (com.google.showcase.v1beta1.CreateBlurbRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_GET_BLURB: + serviceImpl.getBlurb( + (com.google.showcase.v1beta1.GetBlurbRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_UPDATE_BLURB: + serviceImpl.updateBlurb( + (com.google.showcase.v1beta1.UpdateBlurbRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_DELETE_BLURB: + serviceImpl.deleteBlurb( + (com.google.showcase.v1beta1.DeleteBlurbRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_LIST_BLURBS: + serviceImpl.listBlurbs( + (com.google.showcase.v1beta1.ListBlurbsRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_SEARCH_BLURBS: + serviceImpl.searchBlurbs( + (com.google.showcase.v1beta1.SearchBlurbsRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_STREAM_BLURBS: + serviceImpl.streamBlurbs( + (com.google.showcase.v1beta1.StreamBlurbsRequest) 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_SEND_BLURBS: + return (io.grpc.stub.StreamObserver) + serviceImpl.sendBlurbs( + (io.grpc.stub.StreamObserver) + responseObserver); + case METHODID_CONNECT: + return (io.grpc.stub.StreamObserver) + serviceImpl.connect( + (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( + getCreateRoomMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.showcase.v1beta1.CreateRoomRequest, + com.google.showcase.v1beta1.Room>(service, METHODID_CREATE_ROOM))) + .addMethod( + getGetRoomMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.showcase.v1beta1.GetRoomRequest, com.google.showcase.v1beta1.Room>( + service, METHODID_GET_ROOM))) + .addMethod( + getUpdateRoomMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.showcase.v1beta1.UpdateRoomRequest, + com.google.showcase.v1beta1.Room>(service, METHODID_UPDATE_ROOM))) + .addMethod( + getDeleteRoomMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.showcase.v1beta1.DeleteRoomRequest, com.google.protobuf.Empty>( + service, METHODID_DELETE_ROOM))) + .addMethod( + getListRoomsMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.showcase.v1beta1.ListRoomsRequest, + com.google.showcase.v1beta1.ListRoomsResponse>(service, METHODID_LIST_ROOMS))) + .addMethod( + getCreateBlurbMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.showcase.v1beta1.CreateBlurbRequest, + com.google.showcase.v1beta1.Blurb>(service, METHODID_CREATE_BLURB))) + .addMethod( + getGetBlurbMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.showcase.v1beta1.GetBlurbRequest, com.google.showcase.v1beta1.Blurb>( + service, METHODID_GET_BLURB))) + .addMethod( + getUpdateBlurbMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.showcase.v1beta1.UpdateBlurbRequest, + com.google.showcase.v1beta1.Blurb>(service, METHODID_UPDATE_BLURB))) + .addMethod( + getDeleteBlurbMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.showcase.v1beta1.DeleteBlurbRequest, com.google.protobuf.Empty>( + service, METHODID_DELETE_BLURB))) + .addMethod( + getListBlurbsMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.showcase.v1beta1.ListBlurbsRequest, + com.google.showcase.v1beta1.ListBlurbsResponse>(service, METHODID_LIST_BLURBS))) + .addMethod( + getSearchBlurbsMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.showcase.v1beta1.SearchBlurbsRequest, + com.google.longrunning.Operation>(service, METHODID_SEARCH_BLURBS))) + .addMethod( + getStreamBlurbsMethod(), + io.grpc.stub.ServerCalls.asyncServerStreamingCall( + new MethodHandlers< + com.google.showcase.v1beta1.StreamBlurbsRequest, + com.google.showcase.v1beta1.StreamBlurbsResponse>( + service, METHODID_STREAM_BLURBS))) + .addMethod( + getSendBlurbsMethod(), + io.grpc.stub.ServerCalls.asyncClientStreamingCall( + new MethodHandlers< + com.google.showcase.v1beta1.CreateBlurbRequest, + com.google.showcase.v1beta1.SendBlurbsResponse>(service, METHODID_SEND_BLURBS))) + .addMethod( + getConnectMethod(), + io.grpc.stub.ServerCalls.asyncBidiStreamingCall( + new MethodHandlers< + com.google.showcase.v1beta1.ConnectRequest, + com.google.showcase.v1beta1.StreamBlurbsResponse>(service, METHODID_CONNECT))) + .build(); + } + + private abstract static class MessagingBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoFileDescriptorSupplier, + io.grpc.protobuf.ProtoServiceDescriptorSupplier { + MessagingBaseDescriptorSupplier() {} + + @java.lang.Override + public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() { + return com.google.showcase.v1beta1.MessagingOuterClass.getDescriptor(); + } + + @java.lang.Override + public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() { + return getFileDescriptor().findServiceByName("Messaging"); + } + } + + private static final class MessagingFileDescriptorSupplier + extends MessagingBaseDescriptorSupplier { + MessagingFileDescriptorSupplier() {} + } + + private static final class MessagingMethodDescriptorSupplier + extends MessagingBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoMethodDescriptorSupplier { + private final java.lang.String methodName; + + MessagingMethodDescriptorSupplier(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 (MessagingGrpc.class) { + result = serviceDescriptor; + if (result == null) { + serviceDescriptor = + result = + io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME) + .setSchemaDescriptor(new MessagingFileDescriptorSupplier()) + .addMethod(getCreateRoomMethod()) + .addMethod(getGetRoomMethod()) + .addMethod(getUpdateRoomMethod()) + .addMethod(getDeleteRoomMethod()) + .addMethod(getListRoomsMethod()) + .addMethod(getCreateBlurbMethod()) + .addMethod(getGetBlurbMethod()) + .addMethod(getUpdateBlurbMethod()) + .addMethod(getDeleteBlurbMethod()) + .addMethod(getListBlurbsMethod()) + .addMethod(getSearchBlurbsMethod()) + .addMethod(getStreamBlurbsMethod()) + .addMethod(getSendBlurbsMethod()) + .addMethod(getConnectMethod()) + .build(); + } + } + } + return result; + } +} diff --git a/java-showcase/grpc-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/SequenceServiceGrpc.java b/java-showcase/grpc-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/SequenceServiceGrpc.java new file mode 100644 index 0000000000..70d5338fc1 --- /dev/null +++ b/java-showcase/grpc-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/SequenceServiceGrpc.java @@ -0,0 +1,1045 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.showcase.v1beta1; + +import static io.grpc.MethodDescriptor.generateFullMethodName; + +/** */ +@io.grpc.stub.annotations.GrpcGenerated +public final class SequenceServiceGrpc { + + private SequenceServiceGrpc() {} + + public static final java.lang.String SERVICE_NAME = "google.showcase.v1beta1.SequenceService"; + + // Static method descriptors that strictly reflect the proto. + private static volatile io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.CreateSequenceRequest, com.google.showcase.v1beta1.Sequence> + getCreateSequenceMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "CreateSequence", + requestType = com.google.showcase.v1beta1.CreateSequenceRequest.class, + responseType = com.google.showcase.v1beta1.Sequence.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.CreateSequenceRequest, com.google.showcase.v1beta1.Sequence> + getCreateSequenceMethod() { + io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.CreateSequenceRequest, com.google.showcase.v1beta1.Sequence> + getCreateSequenceMethod; + if ((getCreateSequenceMethod = SequenceServiceGrpc.getCreateSequenceMethod) == null) { + synchronized (SequenceServiceGrpc.class) { + if ((getCreateSequenceMethod = SequenceServiceGrpc.getCreateSequenceMethod) == null) { + SequenceServiceGrpc.getCreateSequenceMethod = + getCreateSequenceMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "CreateSequence")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.CreateSequenceRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.Sequence.getDefaultInstance())) + .setSchemaDescriptor( + new SequenceServiceMethodDescriptorSupplier("CreateSequence")) + .build(); + } + } + } + return getCreateSequenceMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.CreateStreamingSequenceRequest, + com.google.showcase.v1beta1.StreamingSequence> + getCreateStreamingSequenceMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "CreateStreamingSequence", + requestType = com.google.showcase.v1beta1.CreateStreamingSequenceRequest.class, + responseType = com.google.showcase.v1beta1.StreamingSequence.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.CreateStreamingSequenceRequest, + com.google.showcase.v1beta1.StreamingSequence> + getCreateStreamingSequenceMethod() { + io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.CreateStreamingSequenceRequest, + com.google.showcase.v1beta1.StreamingSequence> + getCreateStreamingSequenceMethod; + if ((getCreateStreamingSequenceMethod = SequenceServiceGrpc.getCreateStreamingSequenceMethod) + == null) { + synchronized (SequenceServiceGrpc.class) { + if ((getCreateStreamingSequenceMethod = + SequenceServiceGrpc.getCreateStreamingSequenceMethod) + == null) { + SequenceServiceGrpc.getCreateStreamingSequenceMethod = + getCreateStreamingSequenceMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName(SERVICE_NAME, "CreateStreamingSequence")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.CreateStreamingSequenceRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.StreamingSequence.getDefaultInstance())) + .setSchemaDescriptor( + new SequenceServiceMethodDescriptorSupplier("CreateStreamingSequence")) + .build(); + } + } + } + return getCreateStreamingSequenceMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.GetSequenceReportRequest, + com.google.showcase.v1beta1.SequenceReport> + getGetSequenceReportMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "GetSequenceReport", + requestType = com.google.showcase.v1beta1.GetSequenceReportRequest.class, + responseType = com.google.showcase.v1beta1.SequenceReport.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.GetSequenceReportRequest, + com.google.showcase.v1beta1.SequenceReport> + getGetSequenceReportMethod() { + io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.GetSequenceReportRequest, + com.google.showcase.v1beta1.SequenceReport> + getGetSequenceReportMethod; + if ((getGetSequenceReportMethod = SequenceServiceGrpc.getGetSequenceReportMethod) == null) { + synchronized (SequenceServiceGrpc.class) { + if ((getGetSequenceReportMethod = SequenceServiceGrpc.getGetSequenceReportMethod) == null) { + SequenceServiceGrpc.getGetSequenceReportMethod = + getGetSequenceReportMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetSequenceReport")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.GetSequenceReportRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.SequenceReport.getDefaultInstance())) + .setSchemaDescriptor( + new SequenceServiceMethodDescriptorSupplier("GetSequenceReport")) + .build(); + } + } + } + return getGetSequenceReportMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.GetStreamingSequenceReportRequest, + com.google.showcase.v1beta1.StreamingSequenceReport> + getGetStreamingSequenceReportMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "GetStreamingSequenceReport", + requestType = com.google.showcase.v1beta1.GetStreamingSequenceReportRequest.class, + responseType = com.google.showcase.v1beta1.StreamingSequenceReport.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.GetStreamingSequenceReportRequest, + com.google.showcase.v1beta1.StreamingSequenceReport> + getGetStreamingSequenceReportMethod() { + io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.GetStreamingSequenceReportRequest, + com.google.showcase.v1beta1.StreamingSequenceReport> + getGetStreamingSequenceReportMethod; + if ((getGetStreamingSequenceReportMethod = + SequenceServiceGrpc.getGetStreamingSequenceReportMethod) + == null) { + synchronized (SequenceServiceGrpc.class) { + if ((getGetStreamingSequenceReportMethod = + SequenceServiceGrpc.getGetStreamingSequenceReportMethod) + == null) { + SequenceServiceGrpc.getGetStreamingSequenceReportMethod = + getGetStreamingSequenceReportMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName(SERVICE_NAME, "GetStreamingSequenceReport")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.GetStreamingSequenceReportRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.StreamingSequenceReport + .getDefaultInstance())) + .setSchemaDescriptor( + new SequenceServiceMethodDescriptorSupplier("GetStreamingSequenceReport")) + .build(); + } + } + } + return getGetStreamingSequenceReportMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.AttemptSequenceRequest, com.google.protobuf.Empty> + getAttemptSequenceMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "AttemptSequence", + requestType = com.google.showcase.v1beta1.AttemptSequenceRequest.class, + responseType = com.google.protobuf.Empty.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.AttemptSequenceRequest, com.google.protobuf.Empty> + getAttemptSequenceMethod() { + io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.AttemptSequenceRequest, com.google.protobuf.Empty> + getAttemptSequenceMethod; + if ((getAttemptSequenceMethod = SequenceServiceGrpc.getAttemptSequenceMethod) == null) { + synchronized (SequenceServiceGrpc.class) { + if ((getAttemptSequenceMethod = SequenceServiceGrpc.getAttemptSequenceMethod) == null) { + SequenceServiceGrpc.getAttemptSequenceMethod = + getAttemptSequenceMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "AttemptSequence")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.AttemptSequenceRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.protobuf.Empty.getDefaultInstance())) + .setSchemaDescriptor( + new SequenceServiceMethodDescriptorSupplier("AttemptSequence")) + .build(); + } + } + } + return getAttemptSequenceMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.AttemptStreamingSequenceRequest, + com.google.showcase.v1beta1.AttemptStreamingSequenceResponse> + getAttemptStreamingSequenceMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "AttemptStreamingSequence", + requestType = com.google.showcase.v1beta1.AttemptStreamingSequenceRequest.class, + responseType = com.google.showcase.v1beta1.AttemptStreamingSequenceResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.SERVER_STREAMING) + public static io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.AttemptStreamingSequenceRequest, + com.google.showcase.v1beta1.AttemptStreamingSequenceResponse> + getAttemptStreamingSequenceMethod() { + io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.AttemptStreamingSequenceRequest, + com.google.showcase.v1beta1.AttemptStreamingSequenceResponse> + getAttemptStreamingSequenceMethod; + if ((getAttemptStreamingSequenceMethod = SequenceServiceGrpc.getAttemptStreamingSequenceMethod) + == null) { + synchronized (SequenceServiceGrpc.class) { + if ((getAttemptStreamingSequenceMethod = + SequenceServiceGrpc.getAttemptStreamingSequenceMethod) + == null) { + SequenceServiceGrpc.getAttemptStreamingSequenceMethod = + getAttemptStreamingSequenceMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.SERVER_STREAMING) + .setFullMethodName( + generateFullMethodName(SERVICE_NAME, "AttemptStreamingSequence")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.AttemptStreamingSequenceRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.AttemptStreamingSequenceResponse + .getDefaultInstance())) + .setSchemaDescriptor( + new SequenceServiceMethodDescriptorSupplier("AttemptStreamingSequence")) + .build(); + } + } + } + return getAttemptStreamingSequenceMethod; + } + + /** Creates a new async stub that supports all call types for the service */ + public static SequenceServiceStub newStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public SequenceServiceStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new SequenceServiceStub(channel, callOptions); + } + }; + return SequenceServiceStub.newStub(factory, channel); + } + + /** Creates a new blocking-style stub that supports all types of calls on the service */ + public static SequenceServiceBlockingV2Stub newBlockingV2Stub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public SequenceServiceBlockingV2Stub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new SequenceServiceBlockingV2Stub(channel, callOptions); + } + }; + return SequenceServiceBlockingV2Stub.newStub(factory, channel); + } + + /** + * Creates a new blocking-style stub that supports unary and streaming output calls on the service + */ + public static SequenceServiceBlockingStub newBlockingStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public SequenceServiceBlockingStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new SequenceServiceBlockingStub(channel, callOptions); + } + }; + return SequenceServiceBlockingStub.newStub(factory, channel); + } + + /** Creates a new ListenableFuture-style stub that supports unary calls on the service */ + public static SequenceServiceFutureStub newFutureStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public SequenceServiceFutureStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new SequenceServiceFutureStub(channel, callOptions); + } + }; + return SequenceServiceFutureStub.newStub(factory, channel); + } + + /** */ + public interface AsyncService { + + /** + * + * + *
        +     * Creates a sequence.
        +     * 
        + */ + default void createSequence( + com.google.showcase.v1beta1.CreateSequenceRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getCreateSequenceMethod(), responseObserver); + } + + /** + * + * + *
        +     * Creates a sequence.
        +     * 
        + */ + default void createStreamingSequence( + com.google.showcase.v1beta1.CreateStreamingSequenceRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getCreateStreamingSequenceMethod(), responseObserver); + } + + /** + * + * + *
        +     * Retrieves a sequence.
        +     * 
        + */ + default void getSequenceReport( + com.google.showcase.v1beta1.GetSequenceReportRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getGetSequenceReportMethod(), responseObserver); + } + + /** + * + * + *
        +     * Retrieves a sequence.
        +     * 
        + */ + default void getStreamingSequenceReport( + com.google.showcase.v1beta1.GetStreamingSequenceReportRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getGetStreamingSequenceReportMethod(), responseObserver); + } + + /** + * + * + *
        +     * Attempts a sequence.
        +     * 
        + */ + default void attemptSequence( + com.google.showcase.v1beta1.AttemptSequenceRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getAttemptSequenceMethod(), responseObserver); + } + + /** + * + * + *
        +     * Attempts a streaming sequence.
        +     * May not function as expected in HTTP mode due to when http statuses are sent
        +     * See https://github.com/googleapis/gapic-showcase/issues/1377 for more details
        +     * 
        + */ + default void attemptStreamingSequence( + com.google.showcase.v1beta1.AttemptStreamingSequenceRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getAttemptStreamingSequenceMethod(), responseObserver); + } + } + + /** Base class for the server implementation of the service SequenceService. */ + public abstract static class SequenceServiceImplBase + implements io.grpc.BindableService, AsyncService { + + @java.lang.Override + public final io.grpc.ServerServiceDefinition bindService() { + return SequenceServiceGrpc.bindService(this); + } + } + + /** A stub to allow clients to do asynchronous rpc calls to service SequenceService. */ + public static final class SequenceServiceStub + extends io.grpc.stub.AbstractAsyncStub { + private SequenceServiceStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected SequenceServiceStub build(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new SequenceServiceStub(channel, callOptions); + } + + /** + * + * + *
        +     * Creates a sequence.
        +     * 
        + */ + public void createSequence( + com.google.showcase.v1beta1.CreateSequenceRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getCreateSequenceMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
        +     * Creates a sequence.
        +     * 
        + */ + public void createStreamingSequence( + com.google.showcase.v1beta1.CreateStreamingSequenceRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getCreateStreamingSequenceMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
        +     * Retrieves a sequence.
        +     * 
        + */ + public void getSequenceReport( + com.google.showcase.v1beta1.GetSequenceReportRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getGetSequenceReportMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
        +     * Retrieves a sequence.
        +     * 
        + */ + public void getStreamingSequenceReport( + com.google.showcase.v1beta1.GetStreamingSequenceReportRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getGetStreamingSequenceReportMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
        +     * Attempts a sequence.
        +     * 
        + */ + public void attemptSequence( + com.google.showcase.v1beta1.AttemptSequenceRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getAttemptSequenceMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
        +     * Attempts a streaming sequence.
        +     * May not function as expected in HTTP mode due to when http statuses are sent
        +     * See https://github.com/googleapis/gapic-showcase/issues/1377 for more details
        +     * 
        + */ + public void attemptStreamingSequence( + com.google.showcase.v1beta1.AttemptStreamingSequenceRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncServerStreamingCall( + getChannel().newCall(getAttemptStreamingSequenceMethod(), getCallOptions()), + request, + responseObserver); + } + } + + /** A stub to allow clients to do synchronous rpc calls to service SequenceService. */ + public static final class SequenceServiceBlockingV2Stub + extends io.grpc.stub.AbstractBlockingStub { + private SequenceServiceBlockingV2Stub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected SequenceServiceBlockingV2Stub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new SequenceServiceBlockingV2Stub(channel, callOptions); + } + + /** + * + * + *
        +     * Creates a sequence.
        +     * 
        + */ + public com.google.showcase.v1beta1.Sequence createSequence( + com.google.showcase.v1beta1.CreateSequenceRequest request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getCreateSequenceMethod(), getCallOptions(), request); + } + + /** + * + * + *
        +     * Creates a sequence.
        +     * 
        + */ + public com.google.showcase.v1beta1.StreamingSequence createStreamingSequence( + com.google.showcase.v1beta1.CreateStreamingSequenceRequest request) + throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getCreateStreamingSequenceMethod(), getCallOptions(), request); + } + + /** + * + * + *
        +     * Retrieves a sequence.
        +     * 
        + */ + public com.google.showcase.v1beta1.SequenceReport getSequenceReport( + com.google.showcase.v1beta1.GetSequenceReportRequest request) + throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getGetSequenceReportMethod(), getCallOptions(), request); + } + + /** + * + * + *
        +     * Retrieves a sequence.
        +     * 
        + */ + public com.google.showcase.v1beta1.StreamingSequenceReport getStreamingSequenceReport( + com.google.showcase.v1beta1.GetStreamingSequenceReportRequest request) + throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getGetStreamingSequenceReportMethod(), getCallOptions(), request); + } + + /** + * + * + *
        +     * Attempts a sequence.
        +     * 
        + */ + public com.google.protobuf.Empty attemptSequence( + com.google.showcase.v1beta1.AttemptSequenceRequest request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getAttemptSequenceMethod(), getCallOptions(), request); + } + + /** + * + * + *
        +     * Attempts a streaming sequence.
        +     * May not function as expected in HTTP mode due to when http statuses are sent
        +     * See https://github.com/googleapis/gapic-showcase/issues/1377 for more details
        +     * 
        + */ + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/10918") + public io.grpc.stub.BlockingClientCall< + ?, com.google.showcase.v1beta1.AttemptStreamingSequenceResponse> + attemptStreamingSequence( + com.google.showcase.v1beta1.AttemptStreamingSequenceRequest request) { + return io.grpc.stub.ClientCalls.blockingV2ServerStreamingCall( + getChannel(), getAttemptStreamingSequenceMethod(), getCallOptions(), request); + } + } + + /** A stub to allow clients to do limited synchronous rpc calls to service SequenceService. */ + public static final class SequenceServiceBlockingStub + extends io.grpc.stub.AbstractBlockingStub { + private SequenceServiceBlockingStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected SequenceServiceBlockingStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new SequenceServiceBlockingStub(channel, callOptions); + } + + /** + * + * + *
        +     * Creates a sequence.
        +     * 
        + */ + public com.google.showcase.v1beta1.Sequence createSequence( + com.google.showcase.v1beta1.CreateSequenceRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getCreateSequenceMethod(), getCallOptions(), request); + } + + /** + * + * + *
        +     * Creates a sequence.
        +     * 
        + */ + public com.google.showcase.v1beta1.StreamingSequence createStreamingSequence( + com.google.showcase.v1beta1.CreateStreamingSequenceRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getCreateStreamingSequenceMethod(), getCallOptions(), request); + } + + /** + * + * + *
        +     * Retrieves a sequence.
        +     * 
        + */ + public com.google.showcase.v1beta1.SequenceReport getSequenceReport( + com.google.showcase.v1beta1.GetSequenceReportRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getGetSequenceReportMethod(), getCallOptions(), request); + } + + /** + * + * + *
        +     * Retrieves a sequence.
        +     * 
        + */ + public com.google.showcase.v1beta1.StreamingSequenceReport getStreamingSequenceReport( + com.google.showcase.v1beta1.GetStreamingSequenceReportRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getGetStreamingSequenceReportMethod(), getCallOptions(), request); + } + + /** + * + * + *
        +     * Attempts a sequence.
        +     * 
        + */ + public com.google.protobuf.Empty attemptSequence( + com.google.showcase.v1beta1.AttemptSequenceRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getAttemptSequenceMethod(), getCallOptions(), request); + } + + /** + * + * + *
        +     * Attempts a streaming sequence.
        +     * May not function as expected in HTTP mode due to when http statuses are sent
        +     * See https://github.com/googleapis/gapic-showcase/issues/1377 for more details
        +     * 
        + */ + public java.util.Iterator + attemptStreamingSequence( + com.google.showcase.v1beta1.AttemptStreamingSequenceRequest request) { + return io.grpc.stub.ClientCalls.blockingServerStreamingCall( + getChannel(), getAttemptStreamingSequenceMethod(), getCallOptions(), request); + } + } + + /** A stub to allow clients to do ListenableFuture-style rpc calls to service SequenceService. */ + public static final class SequenceServiceFutureStub + extends io.grpc.stub.AbstractFutureStub { + private SequenceServiceFutureStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected SequenceServiceFutureStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new SequenceServiceFutureStub(channel, callOptions); + } + + /** + * + * + *
        +     * Creates a sequence.
        +     * 
        + */ + public com.google.common.util.concurrent.ListenableFuture + createSequence(com.google.showcase.v1beta1.CreateSequenceRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getCreateSequenceMethod(), getCallOptions()), request); + } + + /** + * + * + *
        +     * Creates a sequence.
        +     * 
        + */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.showcase.v1beta1.StreamingSequence> + createStreamingSequence( + com.google.showcase.v1beta1.CreateStreamingSequenceRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getCreateStreamingSequenceMethod(), getCallOptions()), request); + } + + /** + * + * + *
        +     * Retrieves a sequence.
        +     * 
        + */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.showcase.v1beta1.SequenceReport> + getSequenceReport(com.google.showcase.v1beta1.GetSequenceReportRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getGetSequenceReportMethod(), getCallOptions()), request); + } + + /** + * + * + *
        +     * Retrieves a sequence.
        +     * 
        + */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.showcase.v1beta1.StreamingSequenceReport> + getStreamingSequenceReport( + com.google.showcase.v1beta1.GetStreamingSequenceReportRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getGetStreamingSequenceReportMethod(), getCallOptions()), request); + } + + /** + * + * + *
        +     * Attempts a sequence.
        +     * 
        + */ + public com.google.common.util.concurrent.ListenableFuture + attemptSequence(com.google.showcase.v1beta1.AttemptSequenceRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getAttemptSequenceMethod(), getCallOptions()), request); + } + } + + private static final int METHODID_CREATE_SEQUENCE = 0; + private static final int METHODID_CREATE_STREAMING_SEQUENCE = 1; + private static final int METHODID_GET_SEQUENCE_REPORT = 2; + private static final int METHODID_GET_STREAMING_SEQUENCE_REPORT = 3; + private static final int METHODID_ATTEMPT_SEQUENCE = 4; + private static final int METHODID_ATTEMPT_STREAMING_SEQUENCE = 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_CREATE_SEQUENCE: + serviceImpl.createSequence( + (com.google.showcase.v1beta1.CreateSequenceRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_CREATE_STREAMING_SEQUENCE: + serviceImpl.createStreamingSequence( + (com.google.showcase.v1beta1.CreateStreamingSequenceRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_GET_SEQUENCE_REPORT: + serviceImpl.getSequenceReport( + (com.google.showcase.v1beta1.GetSequenceReportRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_GET_STREAMING_SEQUENCE_REPORT: + serviceImpl.getStreamingSequenceReport( + (com.google.showcase.v1beta1.GetStreamingSequenceReportRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_ATTEMPT_SEQUENCE: + serviceImpl.attemptSequence( + (com.google.showcase.v1beta1.AttemptSequenceRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_ATTEMPT_STREAMING_SEQUENCE: + serviceImpl.attemptStreamingSequence( + (com.google.showcase.v1beta1.AttemptStreamingSequenceRequest) request, + (io.grpc.stub.StreamObserver< + com.google.showcase.v1beta1.AttemptStreamingSequenceResponse>) + 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( + getCreateSequenceMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.showcase.v1beta1.CreateSequenceRequest, + com.google.showcase.v1beta1.Sequence>(service, METHODID_CREATE_SEQUENCE))) + .addMethod( + getCreateStreamingSequenceMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.showcase.v1beta1.CreateStreamingSequenceRequest, + com.google.showcase.v1beta1.StreamingSequence>( + service, METHODID_CREATE_STREAMING_SEQUENCE))) + .addMethod( + getGetSequenceReportMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.showcase.v1beta1.GetSequenceReportRequest, + com.google.showcase.v1beta1.SequenceReport>( + service, METHODID_GET_SEQUENCE_REPORT))) + .addMethod( + getGetStreamingSequenceReportMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.showcase.v1beta1.GetStreamingSequenceReportRequest, + com.google.showcase.v1beta1.StreamingSequenceReport>( + service, METHODID_GET_STREAMING_SEQUENCE_REPORT))) + .addMethod( + getAttemptSequenceMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.showcase.v1beta1.AttemptSequenceRequest, com.google.protobuf.Empty>( + service, METHODID_ATTEMPT_SEQUENCE))) + .addMethod( + getAttemptStreamingSequenceMethod(), + io.grpc.stub.ServerCalls.asyncServerStreamingCall( + new MethodHandlers< + com.google.showcase.v1beta1.AttemptStreamingSequenceRequest, + com.google.showcase.v1beta1.AttemptStreamingSequenceResponse>( + service, METHODID_ATTEMPT_STREAMING_SEQUENCE))) + .build(); + } + + private abstract static class SequenceServiceBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoFileDescriptorSupplier, + io.grpc.protobuf.ProtoServiceDescriptorSupplier { + SequenceServiceBaseDescriptorSupplier() {} + + @java.lang.Override + public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() { + return com.google.showcase.v1beta1.SequenceOuterClass.getDescriptor(); + } + + @java.lang.Override + public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() { + return getFileDescriptor().findServiceByName("SequenceService"); + } + } + + private static final class SequenceServiceFileDescriptorSupplier + extends SequenceServiceBaseDescriptorSupplier { + SequenceServiceFileDescriptorSupplier() {} + } + + private static final class SequenceServiceMethodDescriptorSupplier + extends SequenceServiceBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoMethodDescriptorSupplier { + private final java.lang.String methodName; + + SequenceServiceMethodDescriptorSupplier(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 (SequenceServiceGrpc.class) { + result = serviceDescriptor; + if (result == null) { + serviceDescriptor = + result = + io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME) + .setSchemaDescriptor(new SequenceServiceFileDescriptorSupplier()) + .addMethod(getCreateSequenceMethod()) + .addMethod(getCreateStreamingSequenceMethod()) + .addMethod(getGetSequenceReportMethod()) + .addMethod(getGetStreamingSequenceReportMethod()) + .addMethod(getAttemptSequenceMethod()) + .addMethod(getAttemptStreamingSequenceMethod()) + .build(); + } + } + } + return result; + } +} diff --git a/java-showcase/grpc-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/TestingGrpc.java b/java-showcase/grpc-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/TestingGrpc.java new file mode 100644 index 0000000000..7735ebdc2b --- /dev/null +++ b/java-showcase/grpc-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/TestingGrpc.java @@ -0,0 +1,1363 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.showcase.v1beta1; + +import static io.grpc.MethodDescriptor.generateFullMethodName; + +/** + * + * + *
        + * A service to facilitate running discrete sets of tests
        + * against Showcase.
        + * Adding this comment with special characters for comment formatting tests:
        + * 1. (abra->kadabra->alakazam)
        + * 2) [Nonsense][]: `pokemon/*/psychic/*`
        + * 
        + */ +@io.grpc.stub.annotations.GrpcGenerated +public final class TestingGrpc { + + private TestingGrpc() {} + + public static final java.lang.String SERVICE_NAME = "google.showcase.v1beta1.Testing"; + + // Static method descriptors that strictly reflect the proto. + private static volatile io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.CreateSessionRequest, com.google.showcase.v1beta1.Session> + getCreateSessionMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "CreateSession", + requestType = com.google.showcase.v1beta1.CreateSessionRequest.class, + responseType = com.google.showcase.v1beta1.Session.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.CreateSessionRequest, com.google.showcase.v1beta1.Session> + getCreateSessionMethod() { + io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.CreateSessionRequest, com.google.showcase.v1beta1.Session> + getCreateSessionMethod; + if ((getCreateSessionMethod = TestingGrpc.getCreateSessionMethod) == null) { + synchronized (TestingGrpc.class) { + if ((getCreateSessionMethod = TestingGrpc.getCreateSessionMethod) == null) { + TestingGrpc.getCreateSessionMethod = + getCreateSessionMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "CreateSession")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.CreateSessionRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.Session.getDefaultInstance())) + .setSchemaDescriptor(new TestingMethodDescriptorSupplier("CreateSession")) + .build(); + } + } + } + return getCreateSessionMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.GetSessionRequest, com.google.showcase.v1beta1.Session> + getGetSessionMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "GetSession", + requestType = com.google.showcase.v1beta1.GetSessionRequest.class, + responseType = com.google.showcase.v1beta1.Session.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.GetSessionRequest, com.google.showcase.v1beta1.Session> + getGetSessionMethod() { + io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.GetSessionRequest, com.google.showcase.v1beta1.Session> + getGetSessionMethod; + if ((getGetSessionMethod = TestingGrpc.getGetSessionMethod) == null) { + synchronized (TestingGrpc.class) { + if ((getGetSessionMethod = TestingGrpc.getGetSessionMethod) == null) { + TestingGrpc.getGetSessionMethod = + getGetSessionMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetSession")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.GetSessionRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.Session.getDefaultInstance())) + .setSchemaDescriptor(new TestingMethodDescriptorSupplier("GetSession")) + .build(); + } + } + } + return getGetSessionMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.ListSessionsRequest, + com.google.showcase.v1beta1.ListSessionsResponse> + getListSessionsMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "ListSessions", + requestType = com.google.showcase.v1beta1.ListSessionsRequest.class, + responseType = com.google.showcase.v1beta1.ListSessionsResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.ListSessionsRequest, + com.google.showcase.v1beta1.ListSessionsResponse> + getListSessionsMethod() { + io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.ListSessionsRequest, + com.google.showcase.v1beta1.ListSessionsResponse> + getListSessionsMethod; + if ((getListSessionsMethod = TestingGrpc.getListSessionsMethod) == null) { + synchronized (TestingGrpc.class) { + if ((getListSessionsMethod = TestingGrpc.getListSessionsMethod) == null) { + TestingGrpc.getListSessionsMethod = + getListSessionsMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "ListSessions")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.ListSessionsRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.ListSessionsResponse + .getDefaultInstance())) + .setSchemaDescriptor(new TestingMethodDescriptorSupplier("ListSessions")) + .build(); + } + } + } + return getListSessionsMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.DeleteSessionRequest, com.google.protobuf.Empty> + getDeleteSessionMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "DeleteSession", + requestType = com.google.showcase.v1beta1.DeleteSessionRequest.class, + responseType = com.google.protobuf.Empty.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.DeleteSessionRequest, com.google.protobuf.Empty> + getDeleteSessionMethod() { + io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.DeleteSessionRequest, com.google.protobuf.Empty> + getDeleteSessionMethod; + if ((getDeleteSessionMethod = TestingGrpc.getDeleteSessionMethod) == null) { + synchronized (TestingGrpc.class) { + if ((getDeleteSessionMethod = TestingGrpc.getDeleteSessionMethod) == null) { + TestingGrpc.getDeleteSessionMethod = + getDeleteSessionMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "DeleteSession")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.DeleteSessionRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.protobuf.Empty.getDefaultInstance())) + .setSchemaDescriptor(new TestingMethodDescriptorSupplier("DeleteSession")) + .build(); + } + } + } + return getDeleteSessionMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.ReportSessionRequest, + com.google.showcase.v1beta1.ReportSessionResponse> + getReportSessionMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "ReportSession", + requestType = com.google.showcase.v1beta1.ReportSessionRequest.class, + responseType = com.google.showcase.v1beta1.ReportSessionResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.ReportSessionRequest, + com.google.showcase.v1beta1.ReportSessionResponse> + getReportSessionMethod() { + io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.ReportSessionRequest, + com.google.showcase.v1beta1.ReportSessionResponse> + getReportSessionMethod; + if ((getReportSessionMethod = TestingGrpc.getReportSessionMethod) == null) { + synchronized (TestingGrpc.class) { + if ((getReportSessionMethod = TestingGrpc.getReportSessionMethod) == null) { + TestingGrpc.getReportSessionMethod = + getReportSessionMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "ReportSession")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.ReportSessionRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.ReportSessionResponse + .getDefaultInstance())) + .setSchemaDescriptor(new TestingMethodDescriptorSupplier("ReportSession")) + .build(); + } + } + } + return getReportSessionMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.ListTestsRequest, + com.google.showcase.v1beta1.ListTestsResponse> + getListTestsMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "ListTests", + requestType = com.google.showcase.v1beta1.ListTestsRequest.class, + responseType = com.google.showcase.v1beta1.ListTestsResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.ListTestsRequest, + com.google.showcase.v1beta1.ListTestsResponse> + getListTestsMethod() { + io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.ListTestsRequest, + com.google.showcase.v1beta1.ListTestsResponse> + getListTestsMethod; + if ((getListTestsMethod = TestingGrpc.getListTestsMethod) == null) { + synchronized (TestingGrpc.class) { + if ((getListTestsMethod = TestingGrpc.getListTestsMethod) == null) { + TestingGrpc.getListTestsMethod = + getListTestsMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "ListTests")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.ListTestsRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.ListTestsResponse.getDefaultInstance())) + .setSchemaDescriptor(new TestingMethodDescriptorSupplier("ListTests")) + .build(); + } + } + } + return getListTestsMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.DeleteTestRequest, com.google.protobuf.Empty> + getDeleteTestMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "DeleteTest", + requestType = com.google.showcase.v1beta1.DeleteTestRequest.class, + responseType = com.google.protobuf.Empty.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.DeleteTestRequest, com.google.protobuf.Empty> + getDeleteTestMethod() { + io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.DeleteTestRequest, com.google.protobuf.Empty> + getDeleteTestMethod; + if ((getDeleteTestMethod = TestingGrpc.getDeleteTestMethod) == null) { + synchronized (TestingGrpc.class) { + if ((getDeleteTestMethod = TestingGrpc.getDeleteTestMethod) == null) { + TestingGrpc.getDeleteTestMethod = + getDeleteTestMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "DeleteTest")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.DeleteTestRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.protobuf.Empty.getDefaultInstance())) + .setSchemaDescriptor(new TestingMethodDescriptorSupplier("DeleteTest")) + .build(); + } + } + } + return getDeleteTestMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.VerifyTestRequest, + com.google.showcase.v1beta1.VerifyTestResponse> + getVerifyTestMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "VerifyTest", + requestType = com.google.showcase.v1beta1.VerifyTestRequest.class, + responseType = com.google.showcase.v1beta1.VerifyTestResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.VerifyTestRequest, + com.google.showcase.v1beta1.VerifyTestResponse> + getVerifyTestMethod() { + io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.VerifyTestRequest, + com.google.showcase.v1beta1.VerifyTestResponse> + getVerifyTestMethod; + if ((getVerifyTestMethod = TestingGrpc.getVerifyTestMethod) == null) { + synchronized (TestingGrpc.class) { + if ((getVerifyTestMethod = TestingGrpc.getVerifyTestMethod) == null) { + TestingGrpc.getVerifyTestMethod = + getVerifyTestMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "VerifyTest")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.VerifyTestRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.VerifyTestResponse.getDefaultInstance())) + .setSchemaDescriptor(new TestingMethodDescriptorSupplier("VerifyTest")) + .build(); + } + } + } + return getVerifyTestMethod; + } + + /** Creates a new async stub that supports all call types for the service */ + public static TestingStub newStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public TestingStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new TestingStub(channel, callOptions); + } + }; + return TestingStub.newStub(factory, channel); + } + + /** Creates a new blocking-style stub that supports all types of calls on the service */ + public static TestingBlockingV2Stub newBlockingV2Stub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public TestingBlockingV2Stub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new TestingBlockingV2Stub(channel, callOptions); + } + }; + return TestingBlockingV2Stub.newStub(factory, channel); + } + + /** + * Creates a new blocking-style stub that supports unary and streaming output calls on the service + */ + public static TestingBlockingStub newBlockingStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public TestingBlockingStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new TestingBlockingStub(channel, callOptions); + } + }; + return TestingBlockingStub.newStub(factory, channel); + } + + /** Creates a new ListenableFuture-style stub that supports unary calls on the service */ + public static TestingFutureStub newFutureStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public TestingFutureStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new TestingFutureStub(channel, callOptions); + } + }; + return TestingFutureStub.newStub(factory, channel); + } + + /** + * + * + *
        +   * A service to facilitate running discrete sets of tests
        +   * against Showcase.
        +   * Adding this comment with special characters for comment formatting tests:
        +   * 1. (abra->kadabra->alakazam)
        +   * 2) [Nonsense][]: `pokemon/*/psychic/*`
        +   * 
        + */ + public interface AsyncService { + + /** + * + * + *
        +     * Creates a new testing session.
        +     * Adding this comment with special characters for comment formatting tests:
        +     * 1. (abra->kadabra->alakazam)
        +     * 2) [Nonsense][]: `pokemon/*/psychic/*`
        +     * 
        + */ + default void createSession( + com.google.showcase.v1beta1.CreateSessionRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getCreateSessionMethod(), responseObserver); + } + + /** + * + * + *
        +     * Gets a testing session.
        +     * 
        + */ + default void getSession( + com.google.showcase.v1beta1.GetSessionRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getGetSessionMethod(), responseObserver); + } + + /** + * + * + *
        +     * Lists the current test sessions.
        +     * 
        + */ + default void listSessions( + com.google.showcase.v1beta1.ListSessionsRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getListSessionsMethod(), responseObserver); + } + + /** + * + * + *
        +     * Delete a test session.
        +     * 
        + */ + default void deleteSession( + com.google.showcase.v1beta1.DeleteSessionRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getDeleteSessionMethod(), responseObserver); + } + + /** + * + * + *
        +     * Report on the status of a session.
        +     * This generates a report detailing which tests have been completed,
        +     * and an overall rollup.
        +     * 
        + */ + default void reportSession( + com.google.showcase.v1beta1.ReportSessionRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getReportSessionMethod(), responseObserver); + } + + /** + * + * + *
        +     * List the tests of a sessesion.
        +     * 
        + */ + default void listTests( + com.google.showcase.v1beta1.ListTestsRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getListTestsMethod(), responseObserver); + } + + /** + * + * + *
        +     * Explicitly decline to implement a test.
        +     * This removes the test from subsequent `ListTests` calls, and
        +     * attempting to do the test will error.
        +     * This method will error if attempting to delete a required test.
        +     * 
        + */ + default void deleteTest( + com.google.showcase.v1beta1.DeleteTestRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getDeleteTestMethod(), responseObserver); + } + + /** + * + * + *
        +     * Register a response to a test.
        +     * In cases where a test involves registering a final answer at the
        +     * end of the test, this method provides the means to do so.
        +     * 
        + */ + default void verifyTest( + com.google.showcase.v1beta1.VerifyTestRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getVerifyTestMethod(), responseObserver); + } + } + + /** + * Base class for the server implementation of the service Testing. + * + *
        +   * A service to facilitate running discrete sets of tests
        +   * against Showcase.
        +   * Adding this comment with special characters for comment formatting tests:
        +   * 1. (abra->kadabra->alakazam)
        +   * 2) [Nonsense][]: `pokemon/*/psychic/*`
        +   * 
        + */ + public abstract static class TestingImplBase implements io.grpc.BindableService, AsyncService { + + @java.lang.Override + public final io.grpc.ServerServiceDefinition bindService() { + return TestingGrpc.bindService(this); + } + } + + /** + * A stub to allow clients to do asynchronous rpc calls to service Testing. + * + *
        +   * A service to facilitate running discrete sets of tests
        +   * against Showcase.
        +   * Adding this comment with special characters for comment formatting tests:
        +   * 1. (abra->kadabra->alakazam)
        +   * 2) [Nonsense][]: `pokemon/*/psychic/*`
        +   * 
        + */ + public static final class TestingStub extends io.grpc.stub.AbstractAsyncStub { + private TestingStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected TestingStub build(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new TestingStub(channel, callOptions); + } + + /** + * + * + *
        +     * Creates a new testing session.
        +     * Adding this comment with special characters for comment formatting tests:
        +     * 1. (abra->kadabra->alakazam)
        +     * 2) [Nonsense][]: `pokemon/*/psychic/*`
        +     * 
        + */ + public void createSession( + com.google.showcase.v1beta1.CreateSessionRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getCreateSessionMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
        +     * Gets a testing session.
        +     * 
        + */ + public void getSession( + com.google.showcase.v1beta1.GetSessionRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getGetSessionMethod(), getCallOptions()), request, responseObserver); + } + + /** + * + * + *
        +     * Lists the current test sessions.
        +     * 
        + */ + public void listSessions( + com.google.showcase.v1beta1.ListSessionsRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getListSessionsMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
        +     * Delete a test session.
        +     * 
        + */ + public void deleteSession( + com.google.showcase.v1beta1.DeleteSessionRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getDeleteSessionMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
        +     * Report on the status of a session.
        +     * This generates a report detailing which tests have been completed,
        +     * and an overall rollup.
        +     * 
        + */ + public void reportSession( + com.google.showcase.v1beta1.ReportSessionRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getReportSessionMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
        +     * List the tests of a sessesion.
        +     * 
        + */ + public void listTests( + com.google.showcase.v1beta1.ListTestsRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getListTestsMethod(), getCallOptions()), request, responseObserver); + } + + /** + * + * + *
        +     * Explicitly decline to implement a test.
        +     * This removes the test from subsequent `ListTests` calls, and
        +     * attempting to do the test will error.
        +     * This method will error if attempting to delete a required test.
        +     * 
        + */ + public void deleteTest( + com.google.showcase.v1beta1.DeleteTestRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getDeleteTestMethod(), getCallOptions()), request, responseObserver); + } + + /** + * + * + *
        +     * Register a response to a test.
        +     * In cases where a test involves registering a final answer at the
        +     * end of the test, this method provides the means to do so.
        +     * 
        + */ + public void verifyTest( + com.google.showcase.v1beta1.VerifyTestRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getVerifyTestMethod(), getCallOptions()), request, responseObserver); + } + } + + /** + * A stub to allow clients to do synchronous rpc calls to service Testing. + * + *
        +   * A service to facilitate running discrete sets of tests
        +   * against Showcase.
        +   * Adding this comment with special characters for comment formatting tests:
        +   * 1. (abra->kadabra->alakazam)
        +   * 2) [Nonsense][]: `pokemon/*/psychic/*`
        +   * 
        + */ + public static final class TestingBlockingV2Stub + extends io.grpc.stub.AbstractBlockingStub { + private TestingBlockingV2Stub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected TestingBlockingV2Stub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new TestingBlockingV2Stub(channel, callOptions); + } + + /** + * + * + *
        +     * Creates a new testing session.
        +     * Adding this comment with special characters for comment formatting tests:
        +     * 1. (abra->kadabra->alakazam)
        +     * 2) [Nonsense][]: `pokemon/*/psychic/*`
        +     * 
        + */ + public com.google.showcase.v1beta1.Session createSession( + com.google.showcase.v1beta1.CreateSessionRequest request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getCreateSessionMethod(), getCallOptions(), request); + } + + /** + * + * + *
        +     * Gets a testing session.
        +     * 
        + */ + public com.google.showcase.v1beta1.Session getSession( + com.google.showcase.v1beta1.GetSessionRequest request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getGetSessionMethod(), getCallOptions(), request); + } + + /** + * + * + *
        +     * Lists the current test sessions.
        +     * 
        + */ + public com.google.showcase.v1beta1.ListSessionsResponse listSessions( + com.google.showcase.v1beta1.ListSessionsRequest request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getListSessionsMethod(), getCallOptions(), request); + } + + /** + * + * + *
        +     * Delete a test session.
        +     * 
        + */ + public com.google.protobuf.Empty deleteSession( + com.google.showcase.v1beta1.DeleteSessionRequest request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getDeleteSessionMethod(), getCallOptions(), request); + } + + /** + * + * + *
        +     * Report on the status of a session.
        +     * This generates a report detailing which tests have been completed,
        +     * and an overall rollup.
        +     * 
        + */ + public com.google.showcase.v1beta1.ReportSessionResponse reportSession( + com.google.showcase.v1beta1.ReportSessionRequest request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getReportSessionMethod(), getCallOptions(), request); + } + + /** + * + * + *
        +     * List the tests of a sessesion.
        +     * 
        + */ + public com.google.showcase.v1beta1.ListTestsResponse listTests( + com.google.showcase.v1beta1.ListTestsRequest request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getListTestsMethod(), getCallOptions(), request); + } + + /** + * + * + *
        +     * Explicitly decline to implement a test.
        +     * This removes the test from subsequent `ListTests` calls, and
        +     * attempting to do the test will error.
        +     * This method will error if attempting to delete a required test.
        +     * 
        + */ + public com.google.protobuf.Empty deleteTest( + com.google.showcase.v1beta1.DeleteTestRequest request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getDeleteTestMethod(), getCallOptions(), request); + } + + /** + * + * + *
        +     * Register a response to a test.
        +     * In cases where a test involves registering a final answer at the
        +     * end of the test, this method provides the means to do so.
        +     * 
        + */ + public com.google.showcase.v1beta1.VerifyTestResponse verifyTest( + com.google.showcase.v1beta1.VerifyTestRequest request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getVerifyTestMethod(), getCallOptions(), request); + } + } + + /** + * A stub to allow clients to do limited synchronous rpc calls to service Testing. + * + *
        +   * A service to facilitate running discrete sets of tests
        +   * against Showcase.
        +   * Adding this comment with special characters for comment formatting tests:
        +   * 1. (abra->kadabra->alakazam)
        +   * 2) [Nonsense][]: `pokemon/*/psychic/*`
        +   * 
        + */ + public static final class TestingBlockingStub + extends io.grpc.stub.AbstractBlockingStub { + private TestingBlockingStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected TestingBlockingStub build(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new TestingBlockingStub(channel, callOptions); + } + + /** + * + * + *
        +     * Creates a new testing session.
        +     * Adding this comment with special characters for comment formatting tests:
        +     * 1. (abra->kadabra->alakazam)
        +     * 2) [Nonsense][]: `pokemon/*/psychic/*`
        +     * 
        + */ + public com.google.showcase.v1beta1.Session createSession( + com.google.showcase.v1beta1.CreateSessionRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getCreateSessionMethod(), getCallOptions(), request); + } + + /** + * + * + *
        +     * Gets a testing session.
        +     * 
        + */ + public com.google.showcase.v1beta1.Session getSession( + com.google.showcase.v1beta1.GetSessionRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getGetSessionMethod(), getCallOptions(), request); + } + + /** + * + * + *
        +     * Lists the current test sessions.
        +     * 
        + */ + public com.google.showcase.v1beta1.ListSessionsResponse listSessions( + com.google.showcase.v1beta1.ListSessionsRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getListSessionsMethod(), getCallOptions(), request); + } + + /** + * + * + *
        +     * Delete a test session.
        +     * 
        + */ + public com.google.protobuf.Empty deleteSession( + com.google.showcase.v1beta1.DeleteSessionRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getDeleteSessionMethod(), getCallOptions(), request); + } + + /** + * + * + *
        +     * Report on the status of a session.
        +     * This generates a report detailing which tests have been completed,
        +     * and an overall rollup.
        +     * 
        + */ + public com.google.showcase.v1beta1.ReportSessionResponse reportSession( + com.google.showcase.v1beta1.ReportSessionRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getReportSessionMethod(), getCallOptions(), request); + } + + /** + * + * + *
        +     * List the tests of a sessesion.
        +     * 
        + */ + public com.google.showcase.v1beta1.ListTestsResponse listTests( + com.google.showcase.v1beta1.ListTestsRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getListTestsMethod(), getCallOptions(), request); + } + + /** + * + * + *
        +     * Explicitly decline to implement a test.
        +     * This removes the test from subsequent `ListTests` calls, and
        +     * attempting to do the test will error.
        +     * This method will error if attempting to delete a required test.
        +     * 
        + */ + public com.google.protobuf.Empty deleteTest( + com.google.showcase.v1beta1.DeleteTestRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getDeleteTestMethod(), getCallOptions(), request); + } + + /** + * + * + *
        +     * Register a response to a test.
        +     * In cases where a test involves registering a final answer at the
        +     * end of the test, this method provides the means to do so.
        +     * 
        + */ + public com.google.showcase.v1beta1.VerifyTestResponse verifyTest( + com.google.showcase.v1beta1.VerifyTestRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getVerifyTestMethod(), getCallOptions(), request); + } + } + + /** + * A stub to allow clients to do ListenableFuture-style rpc calls to service Testing. + * + *
        +   * A service to facilitate running discrete sets of tests
        +   * against Showcase.
        +   * Adding this comment with special characters for comment formatting tests:
        +   * 1. (abra->kadabra->alakazam)
        +   * 2) [Nonsense][]: `pokemon/*/psychic/*`
        +   * 
        + */ + public static final class TestingFutureStub + extends io.grpc.stub.AbstractFutureStub { + private TestingFutureStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected TestingFutureStub build(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new TestingFutureStub(channel, callOptions); + } + + /** + * + * + *
        +     * Creates a new testing session.
        +     * Adding this comment with special characters for comment formatting tests:
        +     * 1. (abra->kadabra->alakazam)
        +     * 2) [Nonsense][]: `pokemon/*/psychic/*`
        +     * 
        + */ + public com.google.common.util.concurrent.ListenableFuture + createSession(com.google.showcase.v1beta1.CreateSessionRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getCreateSessionMethod(), getCallOptions()), request); + } + + /** + * + * + *
        +     * Gets a testing session.
        +     * 
        + */ + public com.google.common.util.concurrent.ListenableFuture + getSession(com.google.showcase.v1beta1.GetSessionRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getGetSessionMethod(), getCallOptions()), request); + } + + /** + * + * + *
        +     * Lists the current test sessions.
        +     * 
        + */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.showcase.v1beta1.ListSessionsResponse> + listSessions(com.google.showcase.v1beta1.ListSessionsRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getListSessionsMethod(), getCallOptions()), request); + } + + /** + * + * + *
        +     * Delete a test session.
        +     * 
        + */ + public com.google.common.util.concurrent.ListenableFuture + deleteSession(com.google.showcase.v1beta1.DeleteSessionRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getDeleteSessionMethod(), getCallOptions()), request); + } + + /** + * + * + *
        +     * Report on the status of a session.
        +     * This generates a report detailing which tests have been completed,
        +     * and an overall rollup.
        +     * 
        + */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.showcase.v1beta1.ReportSessionResponse> + reportSession(com.google.showcase.v1beta1.ReportSessionRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getReportSessionMethod(), getCallOptions()), request); + } + + /** + * + * + *
        +     * List the tests of a sessesion.
        +     * 
        + */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.showcase.v1beta1.ListTestsResponse> + listTests(com.google.showcase.v1beta1.ListTestsRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getListTestsMethod(), getCallOptions()), request); + } + + /** + * + * + *
        +     * Explicitly decline to implement a test.
        +     * This removes the test from subsequent `ListTests` calls, and
        +     * attempting to do the test will error.
        +     * This method will error if attempting to delete a required test.
        +     * 
        + */ + public com.google.common.util.concurrent.ListenableFuture deleteTest( + com.google.showcase.v1beta1.DeleteTestRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getDeleteTestMethod(), getCallOptions()), request); + } + + /** + * + * + *
        +     * Register a response to a test.
        +     * In cases where a test involves registering a final answer at the
        +     * end of the test, this method provides the means to do so.
        +     * 
        + */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.showcase.v1beta1.VerifyTestResponse> + verifyTest(com.google.showcase.v1beta1.VerifyTestRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getVerifyTestMethod(), getCallOptions()), request); + } + } + + private static final int METHODID_CREATE_SESSION = 0; + private static final int METHODID_GET_SESSION = 1; + private static final int METHODID_LIST_SESSIONS = 2; + private static final int METHODID_DELETE_SESSION = 3; + private static final int METHODID_REPORT_SESSION = 4; + private static final int METHODID_LIST_TESTS = 5; + private static final int METHODID_DELETE_TEST = 6; + private static final int METHODID_VERIFY_TEST = 7; + + 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_CREATE_SESSION: + serviceImpl.createSession( + (com.google.showcase.v1beta1.CreateSessionRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_GET_SESSION: + serviceImpl.getSession( + (com.google.showcase.v1beta1.GetSessionRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_LIST_SESSIONS: + serviceImpl.listSessions( + (com.google.showcase.v1beta1.ListSessionsRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_DELETE_SESSION: + serviceImpl.deleteSession( + (com.google.showcase.v1beta1.DeleteSessionRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_REPORT_SESSION: + serviceImpl.reportSession( + (com.google.showcase.v1beta1.ReportSessionRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_LIST_TESTS: + serviceImpl.listTests( + (com.google.showcase.v1beta1.ListTestsRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_DELETE_TEST: + serviceImpl.deleteTest( + (com.google.showcase.v1beta1.DeleteTestRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_VERIFY_TEST: + serviceImpl.verifyTest( + (com.google.showcase.v1beta1.VerifyTestRequest) 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( + getCreateSessionMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.showcase.v1beta1.CreateSessionRequest, + com.google.showcase.v1beta1.Session>(service, METHODID_CREATE_SESSION))) + .addMethod( + getGetSessionMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.showcase.v1beta1.GetSessionRequest, + com.google.showcase.v1beta1.Session>(service, METHODID_GET_SESSION))) + .addMethod( + getListSessionsMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.showcase.v1beta1.ListSessionsRequest, + com.google.showcase.v1beta1.ListSessionsResponse>( + service, METHODID_LIST_SESSIONS))) + .addMethod( + getDeleteSessionMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.showcase.v1beta1.DeleteSessionRequest, com.google.protobuf.Empty>( + service, METHODID_DELETE_SESSION))) + .addMethod( + getReportSessionMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.showcase.v1beta1.ReportSessionRequest, + com.google.showcase.v1beta1.ReportSessionResponse>( + service, METHODID_REPORT_SESSION))) + .addMethod( + getListTestsMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.showcase.v1beta1.ListTestsRequest, + com.google.showcase.v1beta1.ListTestsResponse>(service, METHODID_LIST_TESTS))) + .addMethod( + getDeleteTestMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.showcase.v1beta1.DeleteTestRequest, com.google.protobuf.Empty>( + service, METHODID_DELETE_TEST))) + .addMethod( + getVerifyTestMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.showcase.v1beta1.VerifyTestRequest, + com.google.showcase.v1beta1.VerifyTestResponse>(service, METHODID_VERIFY_TEST))) + .build(); + } + + private abstract static class TestingBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoFileDescriptorSupplier, + io.grpc.protobuf.ProtoServiceDescriptorSupplier { + TestingBaseDescriptorSupplier() {} + + @java.lang.Override + public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() { + return com.google.showcase.v1beta1.TestingOuterClass.getDescriptor(); + } + + @java.lang.Override + public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() { + return getFileDescriptor().findServiceByName("Testing"); + } + } + + private static final class TestingFileDescriptorSupplier extends TestingBaseDescriptorSupplier { + TestingFileDescriptorSupplier() {} + } + + private static final class TestingMethodDescriptorSupplier extends TestingBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoMethodDescriptorSupplier { + private final java.lang.String methodName; + + TestingMethodDescriptorSupplier(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 (TestingGrpc.class) { + result = serviceDescriptor; + if (result == null) { + serviceDescriptor = + result = + io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME) + .setSchemaDescriptor(new TestingFileDescriptorSupplier()) + .addMethod(getCreateSessionMethod()) + .addMethod(getGetSessionMethod()) + .addMethod(getListSessionsMethod()) + .addMethod(getDeleteSessionMethod()) + .addMethod(getReportSessionMethod()) + .addMethod(getListTestsMethod()) + .addMethod(getDeleteTestMethod()) + .addMethod(getVerifyTestMethod()) + .build(); + } + } + } + return result; + } +} diff --git a/java-showcase/owlbot.py b/java-showcase/owlbot.py new file mode 100644 index 0000000000..effa23f506 --- /dev/null +++ b/java-showcase/owlbot.py @@ -0,0 +1,37 @@ +# 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 +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import synthtool as s +from synthtool.languages import java + + +for library in s.get_staging_dirs(): + # put any special-case replacements here + s.move(library) + +s.remove_staging_dirs() +java.common_templates(monorepo=True, excludes=[ + ".github/*", + ".kokoro/*", + "samples/*", + "README.md", + "CODE_OF_CONDUCT.md", + "CONTRIBUTING.md", + "LICENSE", + "SECURITY.md", + "java.header", + "license-checks.xml", + "renovate.json", + ".gitignore" +]) diff --git a/java-showcase/pom.xml b/java-showcase/pom.xml new file mode 100644 index 0000000000..780af2cef7 --- /dev/null +++ b/java-showcase/pom.xml @@ -0,0 +1,261 @@ + + + 4.0.0 + com.google.cloud + gapic-showcase-parent + pom + 0.0.1-SNAPSHOT + GAPIC Showcase Client Core Parent + + Java idiomatic client for Google Cloud Platform services. + + + + com.google.cloud + google-cloud-shared-config + 1.17.0 + + + + + UTF-8 + UTF-8 + github + google-cloud-showcase-parent + true + true + true + + + + + + com.google.cloud + google-cloud-shared-dependencies + 3.58.1-SNAPSHOT + pom + import + + + com.google.api.grpc + proto-gapic-showcase-v1beta1 + 0.0.1-SNAPSHOT + + + com.google.api.grpc + grpc-gapic-showcase-v1beta1 + 0.0.1-SNAPSHOT + + + com.google.cloud + gapic-showcase + 0.0.1-SNAPSHOT + + + org.junit + junit-bom + 5.11.4 + pom + import + + + + + + gapic-showcase + grpc-gapic-showcase-v1beta1 + proto-gapic-showcase-v1beta1 + + + + + native + + + + org.apache.maven.plugins + maven-compiler-plugin + + + + **/com/google/showcase/v1beta1/it/logging/*.java + **/com/google/showcase/v1beta1/it/ITProtobuf3Compatibility.java + + + + + org.graalvm.buildtools + native-maven-plugin + true + + + test-native + + test + + test + + + + + --no-fallback + --no-server + --verbose + + + + + + + + showcase + + true + + + + + org.apache.maven.plugins + maven-compiler-plugin + + + + **/com/google/showcase/v1beta1/it/logging/*.java + **/com/google/showcase/v1beta1/it/ITProtobuf3Compatibility.java + + + + + org.apache.maven.plugins + maven-surefire-plugin + 3.5.2 + + sponge_log + ${skipUnitTests} + + + + org.apache.maven.plugins + maven-failsafe-plugin + + + + + org.apache.maven.surefire + surefire-junit-platform + ${surefire.version} + + + + + org.codehaus.mojo + flatten-maven-plugin + + + + + + + loggingTestBase + + + + + org.apache.maven.plugins + maven-surefire-plugin + 3.5.2 + + sponge_log + ${skipUnitTests} + + + + org.apache.maven.plugins + maven-failsafe-plugin + + + + + org.apache.maven.surefire + surefire-junit-platform + ${surefire.version} + + + + + org.codehaus.mojo + flatten-maven-plugin + + + + + + enable-golden-tests + + + + org.apache.maven.plugins + maven-compiler-plugin + + + + **/com/google/showcase/v1beta1/it/logging/*.java + + + + + org.codehaus.mojo + exec-maven-plugin + 3.5.0 + false + + + verify-showcase + + exec + + test + + bash + + scripts/verify.sh + + + + + + + + + + update + + + + org.codehaus.mojo + exec-maven-plugin + 3.5.0 + false + + + verify-showcase + + exec + + generate-sources + + bash + + scripts/generate_showcase.sh + --replace + true + + + + + + + + + + diff --git a/java-showcase/proto-gapic-showcase-v1beta1/pom.xml b/java-showcase/proto-gapic-showcase-v1beta1/pom.xml new file mode 100644 index 0000000000..4d948c3a16 --- /dev/null +++ b/java-showcase/proto-gapic-showcase-v1beta1/pom.xml @@ -0,0 +1,58 @@ + + 4.0.0 + com.google.api.grpc + proto-gapic-showcase-v1beta1 + 0.0.1-SNAPSHOT + proto-gapic-showcase-v1beta1 + PROTO library for proto-gapic-showcase-v1beta1 + + com.google.cloud + gapic-showcase-parent + 0.0.1-SNAPSHOT + + + + true + true + + + + + com.google.protobuf + protobuf-java + + + com.google.api.grpc + proto-google-common-protos + + + com.google.api.grpc + proto-google-iam-v1 + + + com.google.api + api-common + + + com.google.guava + guava + + + + + + + showcase-sonar-analysis + + + enableShowcaseTestCoverage + + + + true + + + + diff --git a/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/AttemptSequenceRequest.java b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/AttemptSequenceRequest.java new file mode 100644 index 0000000000..cc7b4e4d40 --- /dev/null +++ b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/AttemptSequenceRequest.java @@ -0,0 +1,552 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: schema/google/showcase/v1beta1/sequence.proto +// Protobuf Java Version: 4.33.2 + +package com.google.showcase.v1beta1; + +/** Protobuf type {@code google.showcase.v1beta1.AttemptSequenceRequest} */ +@com.google.protobuf.Generated +public final class AttemptSequenceRequest extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.AttemptSequenceRequest) + AttemptSequenceRequestOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "AttemptSequenceRequest"); + } + + // Use AttemptSequenceRequest.newBuilder() to construct. + private AttemptSequenceRequest(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private AttemptSequenceRequest() { + name_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.SequenceOuterClass + .internal_static_google_showcase_v1beta1_AttemptSequenceRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.SequenceOuterClass + .internal_static_google_showcase_v1beta1_AttemptSequenceRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.AttemptSequenceRequest.class, + com.google.showcase.v1beta1.AttemptSequenceRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + + /** + * + * 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; + } + } + + /** + * + * 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.GeneratedMessage.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessage.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.GeneratedMessage.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessage.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.showcase.v1beta1.AttemptSequenceRequest)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.AttemptSequenceRequest other = + (com.google.showcase.v1beta1.AttemptSequenceRequest) 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.showcase.v1beta1.AttemptSequenceRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.AttemptSequenceRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.AttemptSequenceRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.AttemptSequenceRequest 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.showcase.v1beta1.AttemptSequenceRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.AttemptSequenceRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.AttemptSequenceRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.AttemptSequenceRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.showcase.v1beta1.AttemptSequenceRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.AttemptSequenceRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.showcase.v1beta1.AttemptSequenceRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.AttemptSequenceRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.showcase.v1beta1.AttemptSequenceRequest 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** Protobuf type {@code google.showcase.v1beta1.AttemptSequenceRequest} */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.AttemptSequenceRequest) + com.google.showcase.v1beta1.AttemptSequenceRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.SequenceOuterClass + .internal_static_google_showcase_v1beta1_AttemptSequenceRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.SequenceOuterClass + .internal_static_google_showcase_v1beta1_AttemptSequenceRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.AttemptSequenceRequest.class, + com.google.showcase.v1beta1.AttemptSequenceRequest.Builder.class); + } + + // Construct using com.google.showcase.v1beta1.AttemptSequenceRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.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.showcase.v1beta1.SequenceOuterClass + .internal_static_google_showcase_v1beta1_AttemptSequenceRequest_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.AttemptSequenceRequest getDefaultInstanceForType() { + return com.google.showcase.v1beta1.AttemptSequenceRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.AttemptSequenceRequest build() { + com.google.showcase.v1beta1.AttemptSequenceRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.AttemptSequenceRequest buildPartial() { + com.google.showcase.v1beta1.AttemptSequenceRequest result = + new com.google.showcase.v1beta1.AttemptSequenceRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.showcase.v1beta1.AttemptSequenceRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.showcase.v1beta1.AttemptSequenceRequest) { + return mergeFrom((com.google.showcase.v1beta1.AttemptSequenceRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.showcase.v1beta1.AttemptSequenceRequest other) { + if (other == com.google.showcase.v1beta1.AttemptSequenceRequest.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_ = ""; + + /** + * + * 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; + } + } + + /** + * + * 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; + } + } + + /** + * + * 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; + } + + /** + * + * 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; + } + + /** + * + * 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; + } + + // @@protoc_insertion_point(builder_scope:google.showcase.v1beta1.AttemptSequenceRequest) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.AttemptSequenceRequest) + private static final com.google.showcase.v1beta1.AttemptSequenceRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.AttemptSequenceRequest(); + } + + public static com.google.showcase.v1beta1.AttemptSequenceRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public AttemptSequenceRequest 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.showcase.v1beta1.AttemptSequenceRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/AttemptSequenceRequestOrBuilder.java b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/AttemptSequenceRequestOrBuilder.java new file mode 100644 index 0000000000..80ac4d9362 --- /dev/null +++ b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/AttemptSequenceRequestOrBuilder.java @@ -0,0 +1,46 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: schema/google/showcase/v1beta1/sequence.proto +// Protobuf Java Version: 4.33.2 + +package com.google.showcase.v1beta1; + +@com.google.protobuf.Generated +public interface AttemptSequenceRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.AttemptSequenceRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + + /** + * + * 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-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/AttemptStreamingSequenceRequest.java b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/AttemptStreamingSequenceRequest.java new file mode 100644 index 0000000000..736aa10f95 --- /dev/null +++ b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/AttemptStreamingSequenceRequest.java @@ -0,0 +1,658 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: schema/google/showcase/v1beta1/sequence.proto +// Protobuf Java Version: 4.33.2 + +package com.google.showcase.v1beta1; + +/** Protobuf type {@code google.showcase.v1beta1.AttemptStreamingSequenceRequest} */ +@com.google.protobuf.Generated +public final class AttemptStreamingSequenceRequest extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.AttemptStreamingSequenceRequest) + AttemptStreamingSequenceRequestOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "AttemptStreamingSequenceRequest"); + } + + // Use AttemptStreamingSequenceRequest.newBuilder() to construct. + private AttemptStreamingSequenceRequest(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private AttemptStreamingSequenceRequest() { + name_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.SequenceOuterClass + .internal_static_google_showcase_v1beta1_AttemptStreamingSequenceRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.SequenceOuterClass + .internal_static_google_showcase_v1beta1_AttemptStreamingSequenceRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.AttemptStreamingSequenceRequest.class, + com.google.showcase.v1beta1.AttemptStreamingSequenceRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + + /** + * + * 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; + } + } + + /** + * + * 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 LAST_FAIL_INDEX_FIELD_NUMBER = 2; + private int lastFailIndex_ = 0; + + /** + * + * + *
        +   * used to send the index of the last failed message
        +   * in the string "content" of an AttemptStreamingSequenceResponse
        +   * needed for stream resumption logic testing
        +   * 
        + * + * int32 last_fail_index = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The lastFailIndex. + */ + @java.lang.Override + public int getLastFailIndex() { + return lastFailIndex_; + } + + 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.GeneratedMessage.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, name_); + } + if (lastFailIndex_ != 0) { + output.writeInt32(2, lastFailIndex_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, name_); + } + if (lastFailIndex_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(2, lastFailIndex_); + } + 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.showcase.v1beta1.AttemptStreamingSequenceRequest)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.AttemptStreamingSequenceRequest other = + (com.google.showcase.v1beta1.AttemptStreamingSequenceRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (getLastFailIndex() != other.getLastFailIndex()) 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) + LAST_FAIL_INDEX_FIELD_NUMBER; + hash = (53 * hash) + getLastFailIndex(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.showcase.v1beta1.AttemptStreamingSequenceRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.AttemptStreamingSequenceRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.AttemptStreamingSequenceRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.AttemptStreamingSequenceRequest 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.showcase.v1beta1.AttemptStreamingSequenceRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.AttemptStreamingSequenceRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.AttemptStreamingSequenceRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.AttemptStreamingSequenceRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.showcase.v1beta1.AttemptStreamingSequenceRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.AttemptStreamingSequenceRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.showcase.v1beta1.AttemptStreamingSequenceRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.AttemptStreamingSequenceRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.showcase.v1beta1.AttemptStreamingSequenceRequest 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** Protobuf type {@code google.showcase.v1beta1.AttemptStreamingSequenceRequest} */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.AttemptStreamingSequenceRequest) + com.google.showcase.v1beta1.AttemptStreamingSequenceRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.SequenceOuterClass + .internal_static_google_showcase_v1beta1_AttemptStreamingSequenceRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.SequenceOuterClass + .internal_static_google_showcase_v1beta1_AttemptStreamingSequenceRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.AttemptStreamingSequenceRequest.class, + com.google.showcase.v1beta1.AttemptStreamingSequenceRequest.Builder.class); + } + + // Construct using com.google.showcase.v1beta1.AttemptStreamingSequenceRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + lastFailIndex_ = 0; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.showcase.v1beta1.SequenceOuterClass + .internal_static_google_showcase_v1beta1_AttemptStreamingSequenceRequest_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.AttemptStreamingSequenceRequest getDefaultInstanceForType() { + return com.google.showcase.v1beta1.AttemptStreamingSequenceRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.AttemptStreamingSequenceRequest build() { + com.google.showcase.v1beta1.AttemptStreamingSequenceRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.AttemptStreamingSequenceRequest buildPartial() { + com.google.showcase.v1beta1.AttemptStreamingSequenceRequest result = + new com.google.showcase.v1beta1.AttemptStreamingSequenceRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.showcase.v1beta1.AttemptStreamingSequenceRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.lastFailIndex_ = lastFailIndex_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.showcase.v1beta1.AttemptStreamingSequenceRequest) { + return mergeFrom((com.google.showcase.v1beta1.AttemptStreamingSequenceRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.showcase.v1beta1.AttemptStreamingSequenceRequest other) { + if (other == com.google.showcase.v1beta1.AttemptStreamingSequenceRequest.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.getLastFailIndex() != 0) { + setLastFailIndex(other.getLastFailIndex()); + } + 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 16: + { + lastFailIndex_ = 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 java.lang.Object name_ = ""; + + /** + * + * 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; + } + } + + /** + * + * 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; + } + } + + /** + * + * 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; + } + + /** + * + * 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; + } + + /** + * + * 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 int lastFailIndex_; + + /** + * + * + *
        +     * used to send the index of the last failed message
        +     * in the string "content" of an AttemptStreamingSequenceResponse
        +     * needed for stream resumption logic testing
        +     * 
        + * + * int32 last_fail_index = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The lastFailIndex. + */ + @java.lang.Override + public int getLastFailIndex() { + return lastFailIndex_; + } + + /** + * + * + *
        +     * used to send the index of the last failed message
        +     * in the string "content" of an AttemptStreamingSequenceResponse
        +     * needed for stream resumption logic testing
        +     * 
        + * + * int32 last_fail_index = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The lastFailIndex to set. + * @return This builder for chaining. + */ + public Builder setLastFailIndex(int value) { + + lastFailIndex_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
        +     * used to send the index of the last failed message
        +     * in the string "content" of an AttemptStreamingSequenceResponse
        +     * needed for stream resumption logic testing
        +     * 
        + * + * int32 last_fail_index = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearLastFailIndex() { + bitField0_ = (bitField0_ & ~0x00000002); + lastFailIndex_ = 0; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.showcase.v1beta1.AttemptStreamingSequenceRequest) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.AttemptStreamingSequenceRequest) + private static final com.google.showcase.v1beta1.AttemptStreamingSequenceRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.AttemptStreamingSequenceRequest(); + } + + public static com.google.showcase.v1beta1.AttemptStreamingSequenceRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public AttemptStreamingSequenceRequest 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.showcase.v1beta1.AttemptStreamingSequenceRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/AttemptStreamingSequenceRequestOrBuilder.java b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/AttemptStreamingSequenceRequestOrBuilder.java new file mode 100644 index 0000000000..2b37f57e7f --- /dev/null +++ b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/AttemptStreamingSequenceRequestOrBuilder.java @@ -0,0 +1,61 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: schema/google/showcase/v1beta1/sequence.proto +// Protobuf Java Version: 4.33.2 + +package com.google.showcase.v1beta1; + +@com.google.protobuf.Generated +public interface AttemptStreamingSequenceRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.AttemptStreamingSequenceRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + + /** + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
        +   * used to send the index of the last failed message
        +   * in the string "content" of an AttemptStreamingSequenceResponse
        +   * needed for stream resumption logic testing
        +   * 
        + * + * int32 last_fail_index = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The lastFailIndex. + */ + int getLastFailIndex(); +} diff --git a/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/AttemptStreamingSequenceResponse.java b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/AttemptStreamingSequenceResponse.java new file mode 100644 index 0000000000..7812b3e6c2 --- /dev/null +++ b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/AttemptStreamingSequenceResponse.java @@ -0,0 +1,602 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: schema/google/showcase/v1beta1/sequence.proto +// Protobuf Java Version: 4.33.2 + +package com.google.showcase.v1beta1; + +/** + * + * + *
        + * The response message for the Echo methods.
        + * 
        + * + * Protobuf type {@code google.showcase.v1beta1.AttemptStreamingSequenceResponse} + */ +@com.google.protobuf.Generated +public final class AttemptStreamingSequenceResponse extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.AttemptStreamingSequenceResponse) + AttemptStreamingSequenceResponseOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "AttemptStreamingSequenceResponse"); + } + + // Use AttemptStreamingSequenceResponse.newBuilder() to construct. + private AttemptStreamingSequenceResponse( + com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private AttemptStreamingSequenceResponse() { + content_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.SequenceOuterClass + .internal_static_google_showcase_v1beta1_AttemptStreamingSequenceResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.SequenceOuterClass + .internal_static_google_showcase_v1beta1_AttemptStreamingSequenceResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.AttemptStreamingSequenceResponse.class, + com.google.showcase.v1beta1.AttemptStreamingSequenceResponse.Builder.class); + } + + public static final int CONTENT_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object content_ = ""; + + /** + * + * + *
        +   * The content specified in the request.
        +   * 
        + * + * string content = 1; + * + * @return The content. + */ + @java.lang.Override + public java.lang.String getContent() { + java.lang.Object ref = content_; + 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(); + content_ = s; + return s; + } + } + + /** + * + * + *
        +   * The content specified in the request.
        +   * 
        + * + * string content = 1; + * + * @return The bytes for content. + */ + @java.lang.Override + public com.google.protobuf.ByteString getContentBytes() { + java.lang.Object ref = content_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + content_ = 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.GeneratedMessage.isStringEmpty(content_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, content_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(content_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, content_); + } + 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.showcase.v1beta1.AttemptStreamingSequenceResponse)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.AttemptStreamingSequenceResponse other = + (com.google.showcase.v1beta1.AttemptStreamingSequenceResponse) obj; + + if (!getContent().equals(other.getContent())) 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) + CONTENT_FIELD_NUMBER; + hash = (53 * hash) + getContent().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.showcase.v1beta1.AttemptStreamingSequenceResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.AttemptStreamingSequenceResponse parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.AttemptStreamingSequenceResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.AttemptStreamingSequenceResponse 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.showcase.v1beta1.AttemptStreamingSequenceResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.AttemptStreamingSequenceResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.AttemptStreamingSequenceResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.AttemptStreamingSequenceResponse parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.showcase.v1beta1.AttemptStreamingSequenceResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.AttemptStreamingSequenceResponse parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.showcase.v1beta1.AttemptStreamingSequenceResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.AttemptStreamingSequenceResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.showcase.v1beta1.AttemptStreamingSequenceResponse 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
        +   * The response message for the Echo methods.
        +   * 
        + * + * Protobuf type {@code google.showcase.v1beta1.AttemptStreamingSequenceResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.AttemptStreamingSequenceResponse) + com.google.showcase.v1beta1.AttemptStreamingSequenceResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.SequenceOuterClass + .internal_static_google_showcase_v1beta1_AttemptStreamingSequenceResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.SequenceOuterClass + .internal_static_google_showcase_v1beta1_AttemptStreamingSequenceResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.AttemptStreamingSequenceResponse.class, + com.google.showcase.v1beta1.AttemptStreamingSequenceResponse.Builder.class); + } + + // Construct using com.google.showcase.v1beta1.AttemptStreamingSequenceResponse.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + content_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.showcase.v1beta1.SequenceOuterClass + .internal_static_google_showcase_v1beta1_AttemptStreamingSequenceResponse_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.AttemptStreamingSequenceResponse + getDefaultInstanceForType() { + return com.google.showcase.v1beta1.AttemptStreamingSequenceResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.AttemptStreamingSequenceResponse build() { + com.google.showcase.v1beta1.AttemptStreamingSequenceResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.AttemptStreamingSequenceResponse buildPartial() { + com.google.showcase.v1beta1.AttemptStreamingSequenceResponse result = + new com.google.showcase.v1beta1.AttemptStreamingSequenceResponse(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.showcase.v1beta1.AttemptStreamingSequenceResponse result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.content_ = content_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.showcase.v1beta1.AttemptStreamingSequenceResponse) { + return mergeFrom((com.google.showcase.v1beta1.AttemptStreamingSequenceResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.showcase.v1beta1.AttemptStreamingSequenceResponse other) { + if (other + == com.google.showcase.v1beta1.AttemptStreamingSequenceResponse.getDefaultInstance()) + return this; + if (!other.getContent().isEmpty()) { + content_ = other.content_; + 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: + { + content_ = 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 content_ = ""; + + /** + * + * + *
        +     * The content specified in the request.
        +     * 
        + * + * string content = 1; + * + * @return The content. + */ + public java.lang.String getContent() { + java.lang.Object ref = content_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + content_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
        +     * The content specified in the request.
        +     * 
        + * + * string content = 1; + * + * @return The bytes for content. + */ + public com.google.protobuf.ByteString getContentBytes() { + java.lang.Object ref = content_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + content_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
        +     * The content specified in the request.
        +     * 
        + * + * string content = 1; + * + * @param value The content to set. + * @return This builder for chaining. + */ + public Builder setContent(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + content_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
        +     * The content specified in the request.
        +     * 
        + * + * string content = 1; + * + * @return This builder for chaining. + */ + public Builder clearContent() { + content_ = getDefaultInstance().getContent(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
        +     * The content specified in the request.
        +     * 
        + * + * string content = 1; + * + * @param value The bytes for content to set. + * @return This builder for chaining. + */ + public Builder setContentBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + content_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.showcase.v1beta1.AttemptStreamingSequenceResponse) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.AttemptStreamingSequenceResponse) + private static final com.google.showcase.v1beta1.AttemptStreamingSequenceResponse + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.AttemptStreamingSequenceResponse(); + } + + public static com.google.showcase.v1beta1.AttemptStreamingSequenceResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public AttemptStreamingSequenceResponse 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.showcase.v1beta1.AttemptStreamingSequenceResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/AttemptStreamingSequenceResponseOrBuilder.java b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/AttemptStreamingSequenceResponseOrBuilder.java new file mode 100644 index 0000000000..ea8f966430 --- /dev/null +++ b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/AttemptStreamingSequenceResponseOrBuilder.java @@ -0,0 +1,54 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: schema/google/showcase/v1beta1/sequence.proto +// Protobuf Java Version: 4.33.2 + +package com.google.showcase.v1beta1; + +@com.google.protobuf.Generated +public interface AttemptStreamingSequenceResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.AttemptStreamingSequenceResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
        +   * The content specified in the request.
        +   * 
        + * + * string content = 1; + * + * @return The content. + */ + java.lang.String getContent(); + + /** + * + * + *
        +   * The content specified in the request.
        +   * 
        + * + * string content = 1; + * + * @return The bytes for content. + */ + com.google.protobuf.ByteString getContentBytes(); +} diff --git a/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/BlockRequest.java b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/BlockRequest.java new file mode 100644 index 0000000000..1237937db0 --- /dev/null +++ b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/BlockRequest.java @@ -0,0 +1,1394 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: schema/google/showcase/v1beta1/echo.proto +// Protobuf Java Version: 4.33.2 + +package com.google.showcase.v1beta1; + +/** + * + * + *
        + * The request for Block method.
        + * 
        + * + * Protobuf type {@code google.showcase.v1beta1.BlockRequest} + */ +@com.google.protobuf.Generated +public final class BlockRequest extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.BlockRequest) + BlockRequestOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "BlockRequest"); + } + + // Use BlockRequest.newBuilder() to construct. + private BlockRequest(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private BlockRequest() {} + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.EchoOuterClass + .internal_static_google_showcase_v1beta1_BlockRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.EchoOuterClass + .internal_static_google_showcase_v1beta1_BlockRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.BlockRequest.class, + com.google.showcase.v1beta1.BlockRequest.Builder.class); + } + + private int bitField0_; + private int responseCase_ = 0; + + @SuppressWarnings("serial") + private java.lang.Object response_; + + public enum ResponseCase + implements + com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + ERROR(2), + SUCCESS(3), + RESPONSE_NOT_SET(0); + private final int value; + + private ResponseCase(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 ResponseCase valueOf(int value) { + return forNumber(value); + } + + public static ResponseCase forNumber(int value) { + switch (value) { + case 2: + return ERROR; + case 3: + return SUCCESS; + case 0: + return RESPONSE_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public ResponseCase getResponseCase() { + return ResponseCase.forNumber(responseCase_); + } + + public static final int RESPONSE_DELAY_FIELD_NUMBER = 1; + private com.google.protobuf.Duration responseDelay_; + + /** + * + * + *
        +   * The amount of time to block before returning a response.
        +   * 
        + * + * .google.protobuf.Duration response_delay = 1; + * + * @return Whether the responseDelay field is set. + */ + @java.lang.Override + public boolean hasResponseDelay() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
        +   * The amount of time to block before returning a response.
        +   * 
        + * + * .google.protobuf.Duration response_delay = 1; + * + * @return The responseDelay. + */ + @java.lang.Override + public com.google.protobuf.Duration getResponseDelay() { + return responseDelay_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : responseDelay_; + } + + /** + * + * + *
        +   * The amount of time to block before returning a response.
        +   * 
        + * + * .google.protobuf.Duration response_delay = 1; + */ + @java.lang.Override + public com.google.protobuf.DurationOrBuilder getResponseDelayOrBuilder() { + return responseDelay_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : responseDelay_; + } + + public static final int ERROR_FIELD_NUMBER = 2; + + /** + * + * + *
        +   * The error that will be returned by the server. If this code is specified
        +   * to be the OK rpc code, an empty response will be returned.
        +   * 
        + * + * .google.rpc.Status error = 2; + * + * @return Whether the error field is set. + */ + @java.lang.Override + public boolean hasError() { + return responseCase_ == 2; + } + + /** + * + * + *
        +   * The error that will be returned by the server. If this code is specified
        +   * to be the OK rpc code, an empty response will be returned.
        +   * 
        + * + * .google.rpc.Status error = 2; + * + * @return The error. + */ + @java.lang.Override + public com.google.rpc.Status getError() { + if (responseCase_ == 2) { + return (com.google.rpc.Status) response_; + } + return com.google.rpc.Status.getDefaultInstance(); + } + + /** + * + * + *
        +   * The error that will be returned by the server. If this code is specified
        +   * to be the OK rpc code, an empty response will be returned.
        +   * 
        + * + * .google.rpc.Status error = 2; + */ + @java.lang.Override + public com.google.rpc.StatusOrBuilder getErrorOrBuilder() { + if (responseCase_ == 2) { + return (com.google.rpc.Status) response_; + } + return com.google.rpc.Status.getDefaultInstance(); + } + + public static final int SUCCESS_FIELD_NUMBER = 3; + + /** + * + * + *
        +   * The response to be returned that will signify successful method call.
        +   * 
        + * + * .google.showcase.v1beta1.BlockResponse success = 3; + * + * @return Whether the success field is set. + */ + @java.lang.Override + public boolean hasSuccess() { + return responseCase_ == 3; + } + + /** + * + * + *
        +   * The response to be returned that will signify successful method call.
        +   * 
        + * + * .google.showcase.v1beta1.BlockResponse success = 3; + * + * @return The success. + */ + @java.lang.Override + public com.google.showcase.v1beta1.BlockResponse getSuccess() { + if (responseCase_ == 3) { + return (com.google.showcase.v1beta1.BlockResponse) response_; + } + return com.google.showcase.v1beta1.BlockResponse.getDefaultInstance(); + } + + /** + * + * + *
        +   * The response to be returned that will signify successful method call.
        +   * 
        + * + * .google.showcase.v1beta1.BlockResponse success = 3; + */ + @java.lang.Override + public com.google.showcase.v1beta1.BlockResponseOrBuilder getSuccessOrBuilder() { + if (responseCase_ == 3) { + return (com.google.showcase.v1beta1.BlockResponse) response_; + } + return com.google.showcase.v1beta1.BlockResponse.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, getResponseDelay()); + } + if (responseCase_ == 2) { + output.writeMessage(2, (com.google.rpc.Status) response_); + } + if (responseCase_ == 3) { + output.writeMessage(3, (com.google.showcase.v1beta1.BlockResponse) response_); + } + 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, getResponseDelay()); + } + if (responseCase_ == 2) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 2, (com.google.rpc.Status) response_); + } + if (responseCase_ == 3) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 3, (com.google.showcase.v1beta1.BlockResponse) response_); + } + 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.showcase.v1beta1.BlockRequest)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.BlockRequest other = (com.google.showcase.v1beta1.BlockRequest) obj; + + if (hasResponseDelay() != other.hasResponseDelay()) return false; + if (hasResponseDelay()) { + if (!getResponseDelay().equals(other.getResponseDelay())) return false; + } + if (!getResponseCase().equals(other.getResponseCase())) return false; + switch (responseCase_) { + case 2: + if (!getError().equals(other.getError())) return false; + break; + case 3: + if (!getSuccess().equals(other.getSuccess())) 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 (hasResponseDelay()) { + hash = (37 * hash) + RESPONSE_DELAY_FIELD_NUMBER; + hash = (53 * hash) + getResponseDelay().hashCode(); + } + switch (responseCase_) { + case 2: + hash = (37 * hash) + ERROR_FIELD_NUMBER; + hash = (53 * hash) + getError().hashCode(); + break; + case 3: + hash = (37 * hash) + SUCCESS_FIELD_NUMBER; + hash = (53 * hash) + getSuccess().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.showcase.v1beta1.BlockRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.BlockRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.BlockRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.BlockRequest 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.showcase.v1beta1.BlockRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.BlockRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.BlockRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.BlockRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.showcase.v1beta1.BlockRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.BlockRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.showcase.v1beta1.BlockRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.BlockRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.showcase.v1beta1.BlockRequest 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
        +   * The request for Block method.
        +   * 
        + * + * Protobuf type {@code google.showcase.v1beta1.BlockRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.BlockRequest) + com.google.showcase.v1beta1.BlockRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.EchoOuterClass + .internal_static_google_showcase_v1beta1_BlockRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.EchoOuterClass + .internal_static_google_showcase_v1beta1_BlockRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.BlockRequest.class, + com.google.showcase.v1beta1.BlockRequest.Builder.class); + } + + // Construct using com.google.showcase.v1beta1.BlockRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetResponseDelayFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + responseDelay_ = null; + if (responseDelayBuilder_ != null) { + responseDelayBuilder_.dispose(); + responseDelayBuilder_ = null; + } + if (errorBuilder_ != null) { + errorBuilder_.clear(); + } + if (successBuilder_ != null) { + successBuilder_.clear(); + } + responseCase_ = 0; + response_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.showcase.v1beta1.EchoOuterClass + .internal_static_google_showcase_v1beta1_BlockRequest_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.BlockRequest getDefaultInstanceForType() { + return com.google.showcase.v1beta1.BlockRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.BlockRequest build() { + com.google.showcase.v1beta1.BlockRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.BlockRequest buildPartial() { + com.google.showcase.v1beta1.BlockRequest result = + new com.google.showcase.v1beta1.BlockRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + buildPartialOneofs(result); + onBuilt(); + return result; + } + + private void buildPartial0(com.google.showcase.v1beta1.BlockRequest result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.responseDelay_ = + responseDelayBuilder_ == null ? responseDelay_ : responseDelayBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + result.bitField0_ |= to_bitField0_; + } + + private void buildPartialOneofs(com.google.showcase.v1beta1.BlockRequest result) { + result.responseCase_ = responseCase_; + result.response_ = this.response_; + if (responseCase_ == 2 && errorBuilder_ != null) { + result.response_ = errorBuilder_.build(); + } + if (responseCase_ == 3 && successBuilder_ != null) { + result.response_ = successBuilder_.build(); + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.showcase.v1beta1.BlockRequest) { + return mergeFrom((com.google.showcase.v1beta1.BlockRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.showcase.v1beta1.BlockRequest other) { + if (other == com.google.showcase.v1beta1.BlockRequest.getDefaultInstance()) return this; + if (other.hasResponseDelay()) { + mergeResponseDelay(other.getResponseDelay()); + } + switch (other.getResponseCase()) { + case ERROR: + { + mergeError(other.getError()); + break; + } + case SUCCESS: + { + mergeSuccess(other.getSuccess()); + break; + } + case RESPONSE_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( + internalGetResponseDelayFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + input.readMessage(internalGetErrorFieldBuilder().getBuilder(), extensionRegistry); + responseCase_ = 2; + break; + } // case 18 + case 26: + { + input.readMessage(internalGetSuccessFieldBuilder().getBuilder(), extensionRegistry); + responseCase_ = 3; + 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 responseCase_ = 0; + private java.lang.Object response_; + + public ResponseCase getResponseCase() { + return ResponseCase.forNumber(responseCase_); + } + + public Builder clearResponse() { + responseCase_ = 0; + response_ = null; + onChanged(); + return this; + } + + private int bitField0_; + + private com.google.protobuf.Duration responseDelay_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder> + responseDelayBuilder_; + + /** + * + * + *
        +     * The amount of time to block before returning a response.
        +     * 
        + * + * .google.protobuf.Duration response_delay = 1; + * + * @return Whether the responseDelay field is set. + */ + public boolean hasResponseDelay() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
        +     * The amount of time to block before returning a response.
        +     * 
        + * + * .google.protobuf.Duration response_delay = 1; + * + * @return The responseDelay. + */ + public com.google.protobuf.Duration getResponseDelay() { + if (responseDelayBuilder_ == null) { + return responseDelay_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : responseDelay_; + } else { + return responseDelayBuilder_.getMessage(); + } + } + + /** + * + * + *
        +     * The amount of time to block before returning a response.
        +     * 
        + * + * .google.protobuf.Duration response_delay = 1; + */ + public Builder setResponseDelay(com.google.protobuf.Duration value) { + if (responseDelayBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + responseDelay_ = value; + } else { + responseDelayBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
        +     * The amount of time to block before returning a response.
        +     * 
        + * + * .google.protobuf.Duration response_delay = 1; + */ + public Builder setResponseDelay(com.google.protobuf.Duration.Builder builderForValue) { + if (responseDelayBuilder_ == null) { + responseDelay_ = builderForValue.build(); + } else { + responseDelayBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
        +     * The amount of time to block before returning a response.
        +     * 
        + * + * .google.protobuf.Duration response_delay = 1; + */ + public Builder mergeResponseDelay(com.google.protobuf.Duration value) { + if (responseDelayBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) + && responseDelay_ != null + && responseDelay_ != com.google.protobuf.Duration.getDefaultInstance()) { + getResponseDelayBuilder().mergeFrom(value); + } else { + responseDelay_ = value; + } + } else { + responseDelayBuilder_.mergeFrom(value); + } + if (responseDelay_ != null) { + bitField0_ |= 0x00000001; + onChanged(); + } + return this; + } + + /** + * + * + *
        +     * The amount of time to block before returning a response.
        +     * 
        + * + * .google.protobuf.Duration response_delay = 1; + */ + public Builder clearResponseDelay() { + bitField0_ = (bitField0_ & ~0x00000001); + responseDelay_ = null; + if (responseDelayBuilder_ != null) { + responseDelayBuilder_.dispose(); + responseDelayBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
        +     * The amount of time to block before returning a response.
        +     * 
        + * + * .google.protobuf.Duration response_delay = 1; + */ + public com.google.protobuf.Duration.Builder getResponseDelayBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return internalGetResponseDelayFieldBuilder().getBuilder(); + } + + /** + * + * + *
        +     * The amount of time to block before returning a response.
        +     * 
        + * + * .google.protobuf.Duration response_delay = 1; + */ + public com.google.protobuf.DurationOrBuilder getResponseDelayOrBuilder() { + if (responseDelayBuilder_ != null) { + return responseDelayBuilder_.getMessageOrBuilder(); + } else { + return responseDelay_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : responseDelay_; + } + } + + /** + * + * + *
        +     * The amount of time to block before returning a response.
        +     * 
        + * + * .google.protobuf.Duration response_delay = 1; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder> + internalGetResponseDelayFieldBuilder() { + if (responseDelayBuilder_ == null) { + responseDelayBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder>( + getResponseDelay(), getParentForChildren(), isClean()); + responseDelay_ = null; + } + return responseDelayBuilder_; + } + + private com.google.protobuf.SingleFieldBuilder< + com.google.rpc.Status, com.google.rpc.Status.Builder, com.google.rpc.StatusOrBuilder> + errorBuilder_; + + /** + * + * + *
        +     * The error that will be returned by the server. If this code is specified
        +     * to be the OK rpc code, an empty response will be returned.
        +     * 
        + * + * .google.rpc.Status error = 2; + * + * @return Whether the error field is set. + */ + @java.lang.Override + public boolean hasError() { + return responseCase_ == 2; + } + + /** + * + * + *
        +     * The error that will be returned by the server. If this code is specified
        +     * to be the OK rpc code, an empty response will be returned.
        +     * 
        + * + * .google.rpc.Status error = 2; + * + * @return The error. + */ + @java.lang.Override + public com.google.rpc.Status getError() { + if (errorBuilder_ == null) { + if (responseCase_ == 2) { + return (com.google.rpc.Status) response_; + } + return com.google.rpc.Status.getDefaultInstance(); + } else { + if (responseCase_ == 2) { + return errorBuilder_.getMessage(); + } + return com.google.rpc.Status.getDefaultInstance(); + } + } + + /** + * + * + *
        +     * The error that will be returned by the server. If this code is specified
        +     * to be the OK rpc code, an empty response will be returned.
        +     * 
        + * + * .google.rpc.Status error = 2; + */ + public Builder setError(com.google.rpc.Status value) { + if (errorBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + response_ = value; + onChanged(); + } else { + errorBuilder_.setMessage(value); + } + responseCase_ = 2; + return this; + } + + /** + * + * + *
        +     * The error that will be returned by the server. If this code is specified
        +     * to be the OK rpc code, an empty response will be returned.
        +     * 
        + * + * .google.rpc.Status error = 2; + */ + public Builder setError(com.google.rpc.Status.Builder builderForValue) { + if (errorBuilder_ == null) { + response_ = builderForValue.build(); + onChanged(); + } else { + errorBuilder_.setMessage(builderForValue.build()); + } + responseCase_ = 2; + return this; + } + + /** + * + * + *
        +     * The error that will be returned by the server. If this code is specified
        +     * to be the OK rpc code, an empty response will be returned.
        +     * 
        + * + * .google.rpc.Status error = 2; + */ + public Builder mergeError(com.google.rpc.Status value) { + if (errorBuilder_ == null) { + if (responseCase_ == 2 && response_ != com.google.rpc.Status.getDefaultInstance()) { + response_ = + com.google.rpc.Status.newBuilder((com.google.rpc.Status) response_) + .mergeFrom(value) + .buildPartial(); + } else { + response_ = value; + } + onChanged(); + } else { + if (responseCase_ == 2) { + errorBuilder_.mergeFrom(value); + } else { + errorBuilder_.setMessage(value); + } + } + responseCase_ = 2; + return this; + } + + /** + * + * + *
        +     * The error that will be returned by the server. If this code is specified
        +     * to be the OK rpc code, an empty response will be returned.
        +     * 
        + * + * .google.rpc.Status error = 2; + */ + public Builder clearError() { + if (errorBuilder_ == null) { + if (responseCase_ == 2) { + responseCase_ = 0; + response_ = null; + onChanged(); + } + } else { + if (responseCase_ == 2) { + responseCase_ = 0; + response_ = null; + } + errorBuilder_.clear(); + } + return this; + } + + /** + * + * + *
        +     * The error that will be returned by the server. If this code is specified
        +     * to be the OK rpc code, an empty response will be returned.
        +     * 
        + * + * .google.rpc.Status error = 2; + */ + public com.google.rpc.Status.Builder getErrorBuilder() { + return internalGetErrorFieldBuilder().getBuilder(); + } + + /** + * + * + *
        +     * The error that will be returned by the server. If this code is specified
        +     * to be the OK rpc code, an empty response will be returned.
        +     * 
        + * + * .google.rpc.Status error = 2; + */ + @java.lang.Override + public com.google.rpc.StatusOrBuilder getErrorOrBuilder() { + if ((responseCase_ == 2) && (errorBuilder_ != null)) { + return errorBuilder_.getMessageOrBuilder(); + } else { + if (responseCase_ == 2) { + return (com.google.rpc.Status) response_; + } + return com.google.rpc.Status.getDefaultInstance(); + } + } + + /** + * + * + *
        +     * The error that will be returned by the server. If this code is specified
        +     * to be the OK rpc code, an empty response will be returned.
        +     * 
        + * + * .google.rpc.Status error = 2; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.rpc.Status, com.google.rpc.Status.Builder, com.google.rpc.StatusOrBuilder> + internalGetErrorFieldBuilder() { + if (errorBuilder_ == null) { + if (!(responseCase_ == 2)) { + response_ = com.google.rpc.Status.getDefaultInstance(); + } + errorBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.rpc.Status, + com.google.rpc.Status.Builder, + com.google.rpc.StatusOrBuilder>( + (com.google.rpc.Status) response_, getParentForChildren(), isClean()); + response_ = null; + } + responseCase_ = 2; + onChanged(); + return errorBuilder_; + } + + private com.google.protobuf.SingleFieldBuilder< + com.google.showcase.v1beta1.BlockResponse, + com.google.showcase.v1beta1.BlockResponse.Builder, + com.google.showcase.v1beta1.BlockResponseOrBuilder> + successBuilder_; + + /** + * + * + *
        +     * The response to be returned that will signify successful method call.
        +     * 
        + * + * .google.showcase.v1beta1.BlockResponse success = 3; + * + * @return Whether the success field is set. + */ + @java.lang.Override + public boolean hasSuccess() { + return responseCase_ == 3; + } + + /** + * + * + *
        +     * The response to be returned that will signify successful method call.
        +     * 
        + * + * .google.showcase.v1beta1.BlockResponse success = 3; + * + * @return The success. + */ + @java.lang.Override + public com.google.showcase.v1beta1.BlockResponse getSuccess() { + if (successBuilder_ == null) { + if (responseCase_ == 3) { + return (com.google.showcase.v1beta1.BlockResponse) response_; + } + return com.google.showcase.v1beta1.BlockResponse.getDefaultInstance(); + } else { + if (responseCase_ == 3) { + return successBuilder_.getMessage(); + } + return com.google.showcase.v1beta1.BlockResponse.getDefaultInstance(); + } + } + + /** + * + * + *
        +     * The response to be returned that will signify successful method call.
        +     * 
        + * + * .google.showcase.v1beta1.BlockResponse success = 3; + */ + public Builder setSuccess(com.google.showcase.v1beta1.BlockResponse value) { + if (successBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + response_ = value; + onChanged(); + } else { + successBuilder_.setMessage(value); + } + responseCase_ = 3; + return this; + } + + /** + * + * + *
        +     * The response to be returned that will signify successful method call.
        +     * 
        + * + * .google.showcase.v1beta1.BlockResponse success = 3; + */ + public Builder setSuccess(com.google.showcase.v1beta1.BlockResponse.Builder builderForValue) { + if (successBuilder_ == null) { + response_ = builderForValue.build(); + onChanged(); + } else { + successBuilder_.setMessage(builderForValue.build()); + } + responseCase_ = 3; + return this; + } + + /** + * + * + *
        +     * The response to be returned that will signify successful method call.
        +     * 
        + * + * .google.showcase.v1beta1.BlockResponse success = 3; + */ + public Builder mergeSuccess(com.google.showcase.v1beta1.BlockResponse value) { + if (successBuilder_ == null) { + if (responseCase_ == 3 + && response_ != com.google.showcase.v1beta1.BlockResponse.getDefaultInstance()) { + response_ = + com.google.showcase.v1beta1.BlockResponse.newBuilder( + (com.google.showcase.v1beta1.BlockResponse) response_) + .mergeFrom(value) + .buildPartial(); + } else { + response_ = value; + } + onChanged(); + } else { + if (responseCase_ == 3) { + successBuilder_.mergeFrom(value); + } else { + successBuilder_.setMessage(value); + } + } + responseCase_ = 3; + return this; + } + + /** + * + * + *
        +     * The response to be returned that will signify successful method call.
        +     * 
        + * + * .google.showcase.v1beta1.BlockResponse success = 3; + */ + public Builder clearSuccess() { + if (successBuilder_ == null) { + if (responseCase_ == 3) { + responseCase_ = 0; + response_ = null; + onChanged(); + } + } else { + if (responseCase_ == 3) { + responseCase_ = 0; + response_ = null; + } + successBuilder_.clear(); + } + return this; + } + + /** + * + * + *
        +     * The response to be returned that will signify successful method call.
        +     * 
        + * + * .google.showcase.v1beta1.BlockResponse success = 3; + */ + public com.google.showcase.v1beta1.BlockResponse.Builder getSuccessBuilder() { + return internalGetSuccessFieldBuilder().getBuilder(); + } + + /** + * + * + *
        +     * The response to be returned that will signify successful method call.
        +     * 
        + * + * .google.showcase.v1beta1.BlockResponse success = 3; + */ + @java.lang.Override + public com.google.showcase.v1beta1.BlockResponseOrBuilder getSuccessOrBuilder() { + if ((responseCase_ == 3) && (successBuilder_ != null)) { + return successBuilder_.getMessageOrBuilder(); + } else { + if (responseCase_ == 3) { + return (com.google.showcase.v1beta1.BlockResponse) response_; + } + return com.google.showcase.v1beta1.BlockResponse.getDefaultInstance(); + } + } + + /** + * + * + *
        +     * The response to be returned that will signify successful method call.
        +     * 
        + * + * .google.showcase.v1beta1.BlockResponse success = 3; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.showcase.v1beta1.BlockResponse, + com.google.showcase.v1beta1.BlockResponse.Builder, + com.google.showcase.v1beta1.BlockResponseOrBuilder> + internalGetSuccessFieldBuilder() { + if (successBuilder_ == null) { + if (!(responseCase_ == 3)) { + response_ = com.google.showcase.v1beta1.BlockResponse.getDefaultInstance(); + } + successBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.showcase.v1beta1.BlockResponse, + com.google.showcase.v1beta1.BlockResponse.Builder, + com.google.showcase.v1beta1.BlockResponseOrBuilder>( + (com.google.showcase.v1beta1.BlockResponse) response_, + getParentForChildren(), + isClean()); + response_ = null; + } + responseCase_ = 3; + onChanged(); + return successBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.showcase.v1beta1.BlockRequest) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.BlockRequest) + private static final com.google.showcase.v1beta1.BlockRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.BlockRequest(); + } + + public static com.google.showcase.v1beta1.BlockRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public BlockRequest 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.showcase.v1beta1.BlockRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/BlockRequestOrBuilder.java b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/BlockRequestOrBuilder.java new file mode 100644 index 0000000000..cab3604e54 --- /dev/null +++ b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/BlockRequestOrBuilder.java @@ -0,0 +1,144 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: schema/google/showcase/v1beta1/echo.proto +// Protobuf Java Version: 4.33.2 + +package com.google.showcase.v1beta1; + +@com.google.protobuf.Generated +public interface BlockRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.BlockRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
        +   * The amount of time to block before returning a response.
        +   * 
        + * + * .google.protobuf.Duration response_delay = 1; + * + * @return Whether the responseDelay field is set. + */ + boolean hasResponseDelay(); + + /** + * + * + *
        +   * The amount of time to block before returning a response.
        +   * 
        + * + * .google.protobuf.Duration response_delay = 1; + * + * @return The responseDelay. + */ + com.google.protobuf.Duration getResponseDelay(); + + /** + * + * + *
        +   * The amount of time to block before returning a response.
        +   * 
        + * + * .google.protobuf.Duration response_delay = 1; + */ + com.google.protobuf.DurationOrBuilder getResponseDelayOrBuilder(); + + /** + * + * + *
        +   * The error that will be returned by the server. If this code is specified
        +   * to be the OK rpc code, an empty response will be returned.
        +   * 
        + * + * .google.rpc.Status error = 2; + * + * @return Whether the error field is set. + */ + boolean hasError(); + + /** + * + * + *
        +   * The error that will be returned by the server. If this code is specified
        +   * to be the OK rpc code, an empty response will be returned.
        +   * 
        + * + * .google.rpc.Status error = 2; + * + * @return The error. + */ + com.google.rpc.Status getError(); + + /** + * + * + *
        +   * The error that will be returned by the server. If this code is specified
        +   * to be the OK rpc code, an empty response will be returned.
        +   * 
        + * + * .google.rpc.Status error = 2; + */ + com.google.rpc.StatusOrBuilder getErrorOrBuilder(); + + /** + * + * + *
        +   * The response to be returned that will signify successful method call.
        +   * 
        + * + * .google.showcase.v1beta1.BlockResponse success = 3; + * + * @return Whether the success field is set. + */ + boolean hasSuccess(); + + /** + * + * + *
        +   * The response to be returned that will signify successful method call.
        +   * 
        + * + * .google.showcase.v1beta1.BlockResponse success = 3; + * + * @return The success. + */ + com.google.showcase.v1beta1.BlockResponse getSuccess(); + + /** + * + * + *
        +   * The response to be returned that will signify successful method call.
        +   * 
        + * + * .google.showcase.v1beta1.BlockResponse success = 3; + */ + com.google.showcase.v1beta1.BlockResponseOrBuilder getSuccessOrBuilder(); + + com.google.showcase.v1beta1.BlockRequest.ResponseCase getResponseCase(); +} diff --git a/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/BlockResponse.java b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/BlockResponse.java new file mode 100644 index 0000000000..caaed30976 --- /dev/null +++ b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/BlockResponse.java @@ -0,0 +1,602 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: schema/google/showcase/v1beta1/echo.proto +// Protobuf Java Version: 4.33.2 + +package com.google.showcase.v1beta1; + +/** + * + * + *
        + * The response for Block method.
        + * 
        + * + * Protobuf type {@code google.showcase.v1beta1.BlockResponse} + */ +@com.google.protobuf.Generated +public final class BlockResponse extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.BlockResponse) + BlockResponseOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "BlockResponse"); + } + + // Use BlockResponse.newBuilder() to construct. + private BlockResponse(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private BlockResponse() { + content_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.EchoOuterClass + .internal_static_google_showcase_v1beta1_BlockResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.EchoOuterClass + .internal_static_google_showcase_v1beta1_BlockResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.BlockResponse.class, + com.google.showcase.v1beta1.BlockResponse.Builder.class); + } + + public static final int CONTENT_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object content_ = ""; + + /** + * + * + *
        +   * This content can contain anything, the server will not depend on a value
        +   * here.
        +   * 
        + * + * string content = 1; + * + * @return The content. + */ + @java.lang.Override + public java.lang.String getContent() { + java.lang.Object ref = content_; + 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(); + content_ = s; + return s; + } + } + + /** + * + * + *
        +   * This content can contain anything, the server will not depend on a value
        +   * here.
        +   * 
        + * + * string content = 1; + * + * @return The bytes for content. + */ + @java.lang.Override + public com.google.protobuf.ByteString getContentBytes() { + java.lang.Object ref = content_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + content_ = 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.GeneratedMessage.isStringEmpty(content_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, content_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(content_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, content_); + } + 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.showcase.v1beta1.BlockResponse)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.BlockResponse other = + (com.google.showcase.v1beta1.BlockResponse) obj; + + if (!getContent().equals(other.getContent())) 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) + CONTENT_FIELD_NUMBER; + hash = (53 * hash) + getContent().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.showcase.v1beta1.BlockResponse parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.BlockResponse parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.BlockResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.BlockResponse 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.showcase.v1beta1.BlockResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.BlockResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.BlockResponse parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.BlockResponse parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.showcase.v1beta1.BlockResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.BlockResponse parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.showcase.v1beta1.BlockResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.BlockResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.showcase.v1beta1.BlockResponse 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
        +   * The response for Block method.
        +   * 
        + * + * Protobuf type {@code google.showcase.v1beta1.BlockResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.BlockResponse) + com.google.showcase.v1beta1.BlockResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.EchoOuterClass + .internal_static_google_showcase_v1beta1_BlockResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.EchoOuterClass + .internal_static_google_showcase_v1beta1_BlockResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.BlockResponse.class, + com.google.showcase.v1beta1.BlockResponse.Builder.class); + } + + // Construct using com.google.showcase.v1beta1.BlockResponse.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + content_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.showcase.v1beta1.EchoOuterClass + .internal_static_google_showcase_v1beta1_BlockResponse_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.BlockResponse getDefaultInstanceForType() { + return com.google.showcase.v1beta1.BlockResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.BlockResponse build() { + com.google.showcase.v1beta1.BlockResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.BlockResponse buildPartial() { + com.google.showcase.v1beta1.BlockResponse result = + new com.google.showcase.v1beta1.BlockResponse(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.showcase.v1beta1.BlockResponse result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.content_ = content_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.showcase.v1beta1.BlockResponse) { + return mergeFrom((com.google.showcase.v1beta1.BlockResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.showcase.v1beta1.BlockResponse other) { + if (other == com.google.showcase.v1beta1.BlockResponse.getDefaultInstance()) return this; + if (!other.getContent().isEmpty()) { + content_ = other.content_; + 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: + { + content_ = 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 content_ = ""; + + /** + * + * + *
        +     * This content can contain anything, the server will not depend on a value
        +     * here.
        +     * 
        + * + * string content = 1; + * + * @return The content. + */ + public java.lang.String getContent() { + java.lang.Object ref = content_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + content_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
        +     * This content can contain anything, the server will not depend on a value
        +     * here.
        +     * 
        + * + * string content = 1; + * + * @return The bytes for content. + */ + public com.google.protobuf.ByteString getContentBytes() { + java.lang.Object ref = content_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + content_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
        +     * This content can contain anything, the server will not depend on a value
        +     * here.
        +     * 
        + * + * string content = 1; + * + * @param value The content to set. + * @return This builder for chaining. + */ + public Builder setContent(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + content_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
        +     * This content can contain anything, the server will not depend on a value
        +     * here.
        +     * 
        + * + * string content = 1; + * + * @return This builder for chaining. + */ + public Builder clearContent() { + content_ = getDefaultInstance().getContent(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
        +     * This content can contain anything, the server will not depend on a value
        +     * here.
        +     * 
        + * + * string content = 1; + * + * @param value The bytes for content to set. + * @return This builder for chaining. + */ + public Builder setContentBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + content_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.showcase.v1beta1.BlockResponse) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.BlockResponse) + private static final com.google.showcase.v1beta1.BlockResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.BlockResponse(); + } + + public static com.google.showcase.v1beta1.BlockResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public BlockResponse 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.showcase.v1beta1.BlockResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/BlockResponseOrBuilder.java b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/BlockResponseOrBuilder.java new file mode 100644 index 0000000000..86fcaff58e --- /dev/null +++ b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/BlockResponseOrBuilder.java @@ -0,0 +1,56 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: schema/google/showcase/v1beta1/echo.proto +// Protobuf Java Version: 4.33.2 + +package com.google.showcase.v1beta1; + +@com.google.protobuf.Generated +public interface BlockResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.BlockResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
        +   * This content can contain anything, the server will not depend on a value
        +   * here.
        +   * 
        + * + * string content = 1; + * + * @return The content. + */ + java.lang.String getContent(); + + /** + * + * + *
        +   * This content can contain anything, the server will not depend on a value
        +   * here.
        +   * 
        + * + * string content = 1; + * + * @return The bytes for content. + */ + com.google.protobuf.ByteString getContentBytes(); +} diff --git a/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/Blurb.java b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/Blurb.java new file mode 100644 index 0000000000..1a76e93d11 --- /dev/null +++ b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/Blurb.java @@ -0,0 +1,2465 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: schema/google/showcase/v1beta1/messaging.proto +// Protobuf Java Version: 4.33.2 + +package com.google.showcase.v1beta1; + +/** + * + * + *
        + * This protocol buffer message represents a blurb sent to a chat room or
        + * posted on a user profile.
        + * 
        + * + * Protobuf type {@code google.showcase.v1beta1.Blurb} + */ +@com.google.protobuf.Generated +public final class Blurb extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.Blurb) + BlurbOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "Blurb"); + } + + // Use Blurb.newBuilder() to construct. + private Blurb(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private Blurb() { + name_ = ""; + user_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.MessagingOuterClass + .internal_static_google_showcase_v1beta1_Blurb_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.MessagingOuterClass + .internal_static_google_showcase_v1beta1_Blurb_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.Blurb.class, + com.google.showcase.v1beta1.Blurb.Builder.class); + } + + private int bitField0_; + private int contentCase_ = 0; + + @SuppressWarnings("serial") + private java.lang.Object content_; + + public enum ContentCase + implements + com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + TEXT(3), + IMAGE(4), + CONTENT_NOT_SET(0); + private final int value; + + private ContentCase(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 ContentCase valueOf(int value) { + return forNumber(value); + } + + public static ContentCase forNumber(int value) { + switch (value) { + case 3: + return TEXT; + case 4: + return IMAGE; + case 0: + return CONTENT_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public ContentCase getContentCase() { + return ContentCase.forNumber(contentCase_); + } + + private int legacyIdCase_ = 0; + + @SuppressWarnings("serial") + private java.lang.Object legacyId_; + + public enum LegacyIdCase + implements + com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + LEGACY_ROOM_ID(7), + LEGACY_USER_ID(8), + LEGACYID_NOT_SET(0); + private final int value; + + private LegacyIdCase(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 LegacyIdCase valueOf(int value) { + return forNumber(value); + } + + public static LegacyIdCase forNumber(int value) { + switch (value) { + case 7: + return LEGACY_ROOM_ID; + case 8: + return LEGACY_USER_ID; + case 0: + return LEGACYID_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public LegacyIdCase getLegacyIdCase() { + return LegacyIdCase.forNumber(legacyIdCase_); + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + + /** + * + * + *
        +   * The resource name of the chat room.
        +   * 
        + * + * 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 chat room.
        +   * 
        + * + * 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 USER_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object user_ = ""; + + /** + * + * + *
        +   * The resource name of the blurb's author.
        +   * 
        + * + * + * string user = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The user. + */ + @java.lang.Override + public java.lang.String getUser() { + java.lang.Object ref = user_; + 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(); + user_ = s; + return s; + } + } + + /** + * + * + *
        +   * The resource name of the blurb's author.
        +   * 
        + * + * + * string user = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for user. + */ + @java.lang.Override + public com.google.protobuf.ByteString getUserBytes() { + java.lang.Object ref = user_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + user_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int TEXT_FIELD_NUMBER = 3; + + /** + * + * + *
        +   * The textual content of this blurb.
        +   * 
        + * + * string text = 3; + * + * @return Whether the text field is set. + */ + public boolean hasText() { + return contentCase_ == 3; + } + + /** + * + * + *
        +   * The textual content of this blurb.
        +   * 
        + * + * string text = 3; + * + * @return The text. + */ + public java.lang.String getText() { + java.lang.Object ref = ""; + if (contentCase_ == 3) { + ref = content_; + } + 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 (contentCase_ == 3) { + content_ = s; + } + return s; + } + } + + /** + * + * + *
        +   * The textual content of this blurb.
        +   * 
        + * + * string text = 3; + * + * @return The bytes for text. + */ + public com.google.protobuf.ByteString getTextBytes() { + java.lang.Object ref = ""; + if (contentCase_ == 3) { + ref = content_; + } + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + if (contentCase_ == 3) { + content_ = b; + } + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int IMAGE_FIELD_NUMBER = 4; + + /** + * + * + *
        +   * The image content of this blurb.
        +   * 
        + * + * bytes image = 4; + * + * @return Whether the image field is set. + */ + @java.lang.Override + public boolean hasImage() { + return contentCase_ == 4; + } + + /** + * + * + *
        +   * The image content of this blurb.
        +   * 
        + * + * bytes image = 4; + * + * @return The image. + */ + @java.lang.Override + public com.google.protobuf.ByteString getImage() { + if (contentCase_ == 4) { + return (com.google.protobuf.ByteString) content_; + } + return com.google.protobuf.ByteString.EMPTY; + } + + public static final int CREATE_TIME_FIELD_NUMBER = 5; + private com.google.protobuf.Timestamp createTime_; + + /** + * + * + *
        +   * The timestamp at which the blurb was created.
        +   * 
        + * + * .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); + } + + /** + * + * + *
        +   * The timestamp at which the blurb was created.
        +   * 
        + * + * .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_; + } + + /** + * + * + *
        +   * The timestamp at which the blurb was created.
        +   * 
        + * + * .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_; + + /** + * + * + *
        +   * The latest timestamp at which the blurb was updated.
        +   * 
        + * + * .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); + } + + /** + * + * + *
        +   * The latest timestamp at which the blurb was updated.
        +   * 
        + * + * .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_; + } + + /** + * + * + *
        +   * The latest timestamp at which the blurb was updated.
        +   * 
        + * + * .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_; + } + + public static final int LEGACY_ROOM_ID_FIELD_NUMBER = 7; + + /** + * + * + *
        +   * The legacy id of the room. This field is used to signal
        +   * the use of the compound resource pattern
        +   * `rooms/{room}/blurbs/legacy/{legacy_room}.{blurb}`
        +   * 
        + * + * string legacy_room_id = 7; + * + * @return Whether the legacyRoomId field is set. + */ + public boolean hasLegacyRoomId() { + return legacyIdCase_ == 7; + } + + /** + * + * + *
        +   * The legacy id of the room. This field is used to signal
        +   * the use of the compound resource pattern
        +   * `rooms/{room}/blurbs/legacy/{legacy_room}.{blurb}`
        +   * 
        + * + * string legacy_room_id = 7; + * + * @return The legacyRoomId. + */ + public java.lang.String getLegacyRoomId() { + java.lang.Object ref = ""; + if (legacyIdCase_ == 7) { + ref = legacyId_; + } + 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 (legacyIdCase_ == 7) { + legacyId_ = s; + } + return s; + } + } + + /** + * + * + *
        +   * The legacy id of the room. This field is used to signal
        +   * the use of the compound resource pattern
        +   * `rooms/{room}/blurbs/legacy/{legacy_room}.{blurb}`
        +   * 
        + * + * string legacy_room_id = 7; + * + * @return The bytes for legacyRoomId. + */ + public com.google.protobuf.ByteString getLegacyRoomIdBytes() { + java.lang.Object ref = ""; + if (legacyIdCase_ == 7) { + ref = legacyId_; + } + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + if (legacyIdCase_ == 7) { + legacyId_ = b; + } + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int LEGACY_USER_ID_FIELD_NUMBER = 8; + + /** + * + * + *
        +   * The legacy id of the user. This field is used to signal
        +   * the use of the compound resource pattern
        +   * `users/{user}/profile/blurbs/legacy/{legacy_user}~{blurb}`
        +   * 
        + * + * string legacy_user_id = 8; + * + * @return Whether the legacyUserId field is set. + */ + public boolean hasLegacyUserId() { + return legacyIdCase_ == 8; + } + + /** + * + * + *
        +   * The legacy id of the user. This field is used to signal
        +   * the use of the compound resource pattern
        +   * `users/{user}/profile/blurbs/legacy/{legacy_user}~{blurb}`
        +   * 
        + * + * string legacy_user_id = 8; + * + * @return The legacyUserId. + */ + public java.lang.String getLegacyUserId() { + java.lang.Object ref = ""; + if (legacyIdCase_ == 8) { + ref = legacyId_; + } + 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 (legacyIdCase_ == 8) { + legacyId_ = s; + } + return s; + } + } + + /** + * + * + *
        +   * The legacy id of the user. This field is used to signal
        +   * the use of the compound resource pattern
        +   * `users/{user}/profile/blurbs/legacy/{legacy_user}~{blurb}`
        +   * 
        + * + * string legacy_user_id = 8; + * + * @return The bytes for legacyUserId. + */ + public com.google.protobuf.ByteString getLegacyUserIdBytes() { + java.lang.Object ref = ""; + if (legacyIdCase_ == 8) { + ref = legacyId_; + } + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + if (legacyIdCase_ == 8) { + legacyId_ = 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.GeneratedMessage.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, name_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(user_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, user_); + } + if (contentCase_ == 3) { + com.google.protobuf.GeneratedMessage.writeString(output, 3, content_); + } + if (contentCase_ == 4) { + output.writeBytes(4, (com.google.protobuf.ByteString) content_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(5, getCreateTime()); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeMessage(6, getUpdateTime()); + } + if (legacyIdCase_ == 7) { + com.google.protobuf.GeneratedMessage.writeString(output, 7, legacyId_); + } + if (legacyIdCase_ == 8) { + com.google.protobuf.GeneratedMessage.writeString(output, 8, legacyId_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, name_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(user_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, user_); + } + if (contentCase_ == 3) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(3, content_); + } + if (contentCase_ == 4) { + size += + com.google.protobuf.CodedOutputStream.computeBytesSize( + 4, (com.google.protobuf.ByteString) content_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(5, getCreateTime()); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(6, getUpdateTime()); + } + if (legacyIdCase_ == 7) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(7, legacyId_); + } + if (legacyIdCase_ == 8) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(8, legacyId_); + } + 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.showcase.v1beta1.Blurb)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.Blurb other = (com.google.showcase.v1beta1.Blurb) obj; + + if (!getName().equals(other.getName())) return false; + if (!getUser().equals(other.getUser())) 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 (!getContentCase().equals(other.getContentCase())) return false; + switch (contentCase_) { + case 3: + if (!getText().equals(other.getText())) return false; + break; + case 4: + if (!getImage().equals(other.getImage())) return false; + break; + case 0: + default: + } + if (!getLegacyIdCase().equals(other.getLegacyIdCase())) return false; + switch (legacyIdCase_) { + case 7: + if (!getLegacyRoomId().equals(other.getLegacyRoomId())) return false; + break; + case 8: + if (!getLegacyUserId().equals(other.getLegacyUserId())) 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) + USER_FIELD_NUMBER; + hash = (53 * hash) + getUser().hashCode(); + if (hasCreateTime()) { + hash = (37 * hash) + CREATE_TIME_FIELD_NUMBER; + hash = (53 * hash) + getCreateTime().hashCode(); + } + if (hasUpdateTime()) { + hash = (37 * hash) + UPDATE_TIME_FIELD_NUMBER; + hash = (53 * hash) + getUpdateTime().hashCode(); + } + switch (contentCase_) { + case 3: + hash = (37 * hash) + TEXT_FIELD_NUMBER; + hash = (53 * hash) + getText().hashCode(); + break; + case 4: + hash = (37 * hash) + IMAGE_FIELD_NUMBER; + hash = (53 * hash) + getImage().hashCode(); + break; + case 0: + default: + } + switch (legacyIdCase_) { + case 7: + hash = (37 * hash) + LEGACY_ROOM_ID_FIELD_NUMBER; + hash = (53 * hash) + getLegacyRoomId().hashCode(); + break; + case 8: + hash = (37 * hash) + LEGACY_USER_ID_FIELD_NUMBER; + hash = (53 * hash) + getLegacyUserId().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.showcase.v1beta1.Blurb parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.Blurb parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.Blurb parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.Blurb 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.showcase.v1beta1.Blurb parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.Blurb parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.Blurb parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.Blurb parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.showcase.v1beta1.Blurb parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.Blurb parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.showcase.v1beta1.Blurb parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.Blurb parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.showcase.v1beta1.Blurb 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
        +   * This protocol buffer message represents a blurb sent to a chat room or
        +   * posted on a user profile.
        +   * 
        + * + * Protobuf type {@code google.showcase.v1beta1.Blurb} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.Blurb) + com.google.showcase.v1beta1.BlurbOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.MessagingOuterClass + .internal_static_google_showcase_v1beta1_Blurb_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.MessagingOuterClass + .internal_static_google_showcase_v1beta1_Blurb_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.Blurb.class, + com.google.showcase.v1beta1.Blurb.Builder.class); + } + + // Construct using com.google.showcase.v1beta1.Blurb.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetCreateTimeFieldBuilder(); + internalGetUpdateTimeFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + user_ = ""; + createTime_ = null; + if (createTimeBuilder_ != null) { + createTimeBuilder_.dispose(); + createTimeBuilder_ = null; + } + updateTime_ = null; + if (updateTimeBuilder_ != null) { + updateTimeBuilder_.dispose(); + updateTimeBuilder_ = null; + } + contentCase_ = 0; + content_ = null; + legacyIdCase_ = 0; + legacyId_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.showcase.v1beta1.MessagingOuterClass + .internal_static_google_showcase_v1beta1_Blurb_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.Blurb getDefaultInstanceForType() { + return com.google.showcase.v1beta1.Blurb.getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.Blurb build() { + com.google.showcase.v1beta1.Blurb result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.Blurb buildPartial() { + com.google.showcase.v1beta1.Blurb result = new com.google.showcase.v1beta1.Blurb(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + buildPartialOneofs(result); + onBuilt(); + return result; + } + + private void buildPartial0(com.google.showcase.v1beta1.Blurb result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.user_ = user_; + } + 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_; + } + + private void buildPartialOneofs(com.google.showcase.v1beta1.Blurb result) { + result.contentCase_ = contentCase_; + result.content_ = this.content_; + result.legacyIdCase_ = legacyIdCase_; + result.legacyId_ = this.legacyId_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.showcase.v1beta1.Blurb) { + return mergeFrom((com.google.showcase.v1beta1.Blurb) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.showcase.v1beta1.Blurb other) { + if (other == com.google.showcase.v1beta1.Blurb.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getUser().isEmpty()) { + user_ = other.user_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (other.hasCreateTime()) { + mergeCreateTime(other.getCreateTime()); + } + if (other.hasUpdateTime()) { + mergeUpdateTime(other.getUpdateTime()); + } + switch (other.getContentCase()) { + case TEXT: + { + contentCase_ = 3; + content_ = other.content_; + onChanged(); + break; + } + case IMAGE: + { + setImage(other.getImage()); + break; + } + case CONTENT_NOT_SET: + { + break; + } + } + switch (other.getLegacyIdCase()) { + case LEGACY_ROOM_ID: + { + legacyIdCase_ = 7; + legacyId_ = other.legacyId_; + onChanged(); + break; + } + case LEGACY_USER_ID: + { + legacyIdCase_ = 8; + legacyId_ = other.legacyId_; + onChanged(); + break; + } + case LEGACYID_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 18: + { + user_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + contentCase_ = 3; + content_ = s; + break; + } // case 26 + case 34: + { + content_ = input.readBytes(); + contentCase_ = 4; + break; + } // case 34 + case 42: + { + input.readMessage( + internalGetCreateTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000010; + break; + } // case 42 + case 50: + { + input.readMessage( + internalGetUpdateTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000020; + break; + } // case 50 + case 58: + { + java.lang.String s = input.readStringRequireUtf8(); + legacyIdCase_ = 7; + legacyId_ = s; + break; + } // case 58 + case 66: + { + java.lang.String s = input.readStringRequireUtf8(); + legacyIdCase_ = 8; + legacyId_ = 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 contentCase_ = 0; + private java.lang.Object content_; + + public ContentCase getContentCase() { + return ContentCase.forNumber(contentCase_); + } + + public Builder clearContent() { + contentCase_ = 0; + content_ = null; + onChanged(); + return this; + } + + private int legacyIdCase_ = 0; + private java.lang.Object legacyId_; + + public LegacyIdCase getLegacyIdCase() { + return LegacyIdCase.forNumber(legacyIdCase_); + } + + public Builder clearLegacyId() { + legacyIdCase_ = 0; + legacyId_ = null; + onChanged(); + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + + /** + * + * + *
        +     * The resource name of the chat room.
        +     * 
        + * + * 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 chat room.
        +     * 
        + * + * 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 chat room.
        +     * 
        + * + * 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 chat room.
        +     * 
        + * + * 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 chat room.
        +     * 
        + * + * 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 user_ = ""; + + /** + * + * + *
        +     * The resource name of the blurb's author.
        +     * 
        + * + * + * string user = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The user. + */ + public java.lang.String getUser() { + java.lang.Object ref = user_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + user_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
        +     * The resource name of the blurb's author.
        +     * 
        + * + * + * string user = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for user. + */ + public com.google.protobuf.ByteString getUserBytes() { + java.lang.Object ref = user_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + user_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
        +     * The resource name of the blurb's author.
        +     * 
        + * + * + * string user = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The user to set. + * @return This builder for chaining. + */ + public Builder setUser(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + user_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
        +     * The resource name of the blurb's author.
        +     * 
        + * + * + * string user = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearUser() { + user_ = getDefaultInstance().getUser(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
        +     * The resource name of the blurb's author.
        +     * 
        + * + * + * string user = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for user to set. + * @return This builder for chaining. + */ + public Builder setUserBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + user_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
        +     * The textual content of this blurb.
        +     * 
        + * + * string text = 3; + * + * @return Whether the text field is set. + */ + @java.lang.Override + public boolean hasText() { + return contentCase_ == 3; + } + + /** + * + * + *
        +     * The textual content of this blurb.
        +     * 
        + * + * string text = 3; + * + * @return The text. + */ + @java.lang.Override + public java.lang.String getText() { + java.lang.Object ref = ""; + if (contentCase_ == 3) { + ref = content_; + } + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (contentCase_ == 3) { + content_ = s; + } + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
        +     * The textual content of this blurb.
        +     * 
        + * + * string text = 3; + * + * @return The bytes for text. + */ + @java.lang.Override + public com.google.protobuf.ByteString getTextBytes() { + java.lang.Object ref = ""; + if (contentCase_ == 3) { + ref = content_; + } + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + if (contentCase_ == 3) { + content_ = b; + } + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
        +     * The textual content of this blurb.
        +     * 
        + * + * string text = 3; + * + * @param value The text to set. + * @return This builder for chaining. + */ + public Builder setText(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + contentCase_ = 3; + content_ = value; + onChanged(); + return this; + } + + /** + * + * + *
        +     * The textual content of this blurb.
        +     * 
        + * + * string text = 3; + * + * @return This builder for chaining. + */ + public Builder clearText() { + if (contentCase_ == 3) { + contentCase_ = 0; + content_ = null; + onChanged(); + } + return this; + } + + /** + * + * + *
        +     * The textual content of this blurb.
        +     * 
        + * + * string text = 3; + * + * @param value The bytes for text to set. + * @return This builder for chaining. + */ + public Builder setTextBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + contentCase_ = 3; + content_ = value; + onChanged(); + return this; + } + + /** + * + * + *
        +     * The image content of this blurb.
        +     * 
        + * + * bytes image = 4; + * + * @return Whether the image field is set. + */ + public boolean hasImage() { + return contentCase_ == 4; + } + + /** + * + * + *
        +     * The image content of this blurb.
        +     * 
        + * + * bytes image = 4; + * + * @return The image. + */ + public com.google.protobuf.ByteString getImage() { + if (contentCase_ == 4) { + return (com.google.protobuf.ByteString) content_; + } + return com.google.protobuf.ByteString.EMPTY; + } + + /** + * + * + *
        +     * The image content of this blurb.
        +     * 
        + * + * bytes image = 4; + * + * @param value The image to set. + * @return This builder for chaining. + */ + public Builder setImage(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + contentCase_ = 4; + content_ = value; + onChanged(); + return this; + } + + /** + * + * + *
        +     * The image content of this blurb.
        +     * 
        + * + * bytes image = 4; + * + * @return This builder for chaining. + */ + public Builder clearImage() { + if (contentCase_ == 4) { + contentCase_ = 0; + content_ = null; + onChanged(); + } + return this; + } + + private com.google.protobuf.Timestamp createTime_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + createTimeBuilder_; + + /** + * + * + *
        +     * The timestamp at which the blurb was created.
        +     * 
        + * + * + * .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); + } + + /** + * + * + *
        +     * The timestamp at which the blurb was created.
        +     * 
        + * + * + * .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(); + } + } + + /** + * + * + *
        +     * The timestamp at which the blurb was created.
        +     * 
        + * + * + * .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; + } + + /** + * + * + *
        +     * The timestamp at which the blurb was created.
        +     * 
        + * + * + * .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; + } + + /** + * + * + *
        +     * The timestamp at which the blurb was created.
        +     * 
        + * + * + * .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; + } + + /** + * + * + *
        +     * The timestamp at which the blurb was created.
        +     * 
        + * + * + * .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; + } + + /** + * + * + *
        +     * The timestamp at which the blurb was created.
        +     * 
        + * + * + * .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.Timestamp.Builder getCreateTimeBuilder() { + bitField0_ |= 0x00000010; + onChanged(); + return internalGetCreateTimeFieldBuilder().getBuilder(); + } + + /** + * + * + *
        +     * The timestamp at which the blurb was created.
        +     * 
        + * + * + * .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_; + } + } + + /** + * + * + *
        +     * The timestamp at which the blurb was created.
        +     * 
        + * + * + * .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + internalGetCreateTimeFieldBuilder() { + if (createTimeBuilder_ == null) { + createTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + 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.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + updateTimeBuilder_; + + /** + * + * + *
        +     * The latest timestamp at which the blurb was updated.
        +     * 
        + * + * + * .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); + } + + /** + * + * + *
        +     * The latest timestamp at which the blurb was updated.
        +     * 
        + * + * + * .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(); + } + } + + /** + * + * + *
        +     * The latest timestamp at which the blurb was updated.
        +     * 
        + * + * + * .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; + } + + /** + * + * + *
        +     * The latest timestamp at which the blurb was updated.
        +     * 
        + * + * + * .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; + } + + /** + * + * + *
        +     * The latest timestamp at which the blurb was updated.
        +     * 
        + * + * + * .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; + } + + /** + * + * + *
        +     * The latest timestamp at which the blurb was updated.
        +     * 
        + * + * + * .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; + } + + /** + * + * + *
        +     * The latest timestamp at which the blurb was updated.
        +     * 
        + * + * + * .google.protobuf.Timestamp update_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.Timestamp.Builder getUpdateTimeBuilder() { + bitField0_ |= 0x00000020; + onChanged(); + return internalGetUpdateTimeFieldBuilder().getBuilder(); + } + + /** + * + * + *
        +     * The latest timestamp at which the blurb was updated.
        +     * 
        + * + * + * .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_; + } + } + + /** + * + * + *
        +     * The latest timestamp at which the blurb was updated.
        +     * 
        + * + * + * .google.protobuf.Timestamp update_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + internalGetUpdateTimeFieldBuilder() { + if (updateTimeBuilder_ == null) { + updateTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getUpdateTime(), getParentForChildren(), isClean()); + updateTime_ = null; + } + return updateTimeBuilder_; + } + + /** + * + * + *
        +     * The legacy id of the room. This field is used to signal
        +     * the use of the compound resource pattern
        +     * `rooms/{room}/blurbs/legacy/{legacy_room}.{blurb}`
        +     * 
        + * + * string legacy_room_id = 7; + * + * @return Whether the legacyRoomId field is set. + */ + @java.lang.Override + public boolean hasLegacyRoomId() { + return legacyIdCase_ == 7; + } + + /** + * + * + *
        +     * The legacy id of the room. This field is used to signal
        +     * the use of the compound resource pattern
        +     * `rooms/{room}/blurbs/legacy/{legacy_room}.{blurb}`
        +     * 
        + * + * string legacy_room_id = 7; + * + * @return The legacyRoomId. + */ + @java.lang.Override + public java.lang.String getLegacyRoomId() { + java.lang.Object ref = ""; + if (legacyIdCase_ == 7) { + ref = legacyId_; + } + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (legacyIdCase_ == 7) { + legacyId_ = s; + } + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
        +     * The legacy id of the room. This field is used to signal
        +     * the use of the compound resource pattern
        +     * `rooms/{room}/blurbs/legacy/{legacy_room}.{blurb}`
        +     * 
        + * + * string legacy_room_id = 7; + * + * @return The bytes for legacyRoomId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getLegacyRoomIdBytes() { + java.lang.Object ref = ""; + if (legacyIdCase_ == 7) { + ref = legacyId_; + } + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + if (legacyIdCase_ == 7) { + legacyId_ = b; + } + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
        +     * The legacy id of the room. This field is used to signal
        +     * the use of the compound resource pattern
        +     * `rooms/{room}/blurbs/legacy/{legacy_room}.{blurb}`
        +     * 
        + * + * string legacy_room_id = 7; + * + * @param value The legacyRoomId to set. + * @return This builder for chaining. + */ + public Builder setLegacyRoomId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + legacyIdCase_ = 7; + legacyId_ = value; + onChanged(); + return this; + } + + /** + * + * + *
        +     * The legacy id of the room. This field is used to signal
        +     * the use of the compound resource pattern
        +     * `rooms/{room}/blurbs/legacy/{legacy_room}.{blurb}`
        +     * 
        + * + * string legacy_room_id = 7; + * + * @return This builder for chaining. + */ + public Builder clearLegacyRoomId() { + if (legacyIdCase_ == 7) { + legacyIdCase_ = 0; + legacyId_ = null; + onChanged(); + } + return this; + } + + /** + * + * + *
        +     * The legacy id of the room. This field is used to signal
        +     * the use of the compound resource pattern
        +     * `rooms/{room}/blurbs/legacy/{legacy_room}.{blurb}`
        +     * 
        + * + * string legacy_room_id = 7; + * + * @param value The bytes for legacyRoomId to set. + * @return This builder for chaining. + */ + public Builder setLegacyRoomIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + legacyIdCase_ = 7; + legacyId_ = value; + onChanged(); + return this; + } + + /** + * + * + *
        +     * The legacy id of the user. This field is used to signal
        +     * the use of the compound resource pattern
        +     * `users/{user}/profile/blurbs/legacy/{legacy_user}~{blurb}`
        +     * 
        + * + * string legacy_user_id = 8; + * + * @return Whether the legacyUserId field is set. + */ + @java.lang.Override + public boolean hasLegacyUserId() { + return legacyIdCase_ == 8; + } + + /** + * + * + *
        +     * The legacy id of the user. This field is used to signal
        +     * the use of the compound resource pattern
        +     * `users/{user}/profile/blurbs/legacy/{legacy_user}~{blurb}`
        +     * 
        + * + * string legacy_user_id = 8; + * + * @return The legacyUserId. + */ + @java.lang.Override + public java.lang.String getLegacyUserId() { + java.lang.Object ref = ""; + if (legacyIdCase_ == 8) { + ref = legacyId_; + } + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (legacyIdCase_ == 8) { + legacyId_ = s; + } + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
        +     * The legacy id of the user. This field is used to signal
        +     * the use of the compound resource pattern
        +     * `users/{user}/profile/blurbs/legacy/{legacy_user}~{blurb}`
        +     * 
        + * + * string legacy_user_id = 8; + * + * @return The bytes for legacyUserId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getLegacyUserIdBytes() { + java.lang.Object ref = ""; + if (legacyIdCase_ == 8) { + ref = legacyId_; + } + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + if (legacyIdCase_ == 8) { + legacyId_ = b; + } + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
        +     * The legacy id of the user. This field is used to signal
        +     * the use of the compound resource pattern
        +     * `users/{user}/profile/blurbs/legacy/{legacy_user}~{blurb}`
        +     * 
        + * + * string legacy_user_id = 8; + * + * @param value The legacyUserId to set. + * @return This builder for chaining. + */ + public Builder setLegacyUserId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + legacyIdCase_ = 8; + legacyId_ = value; + onChanged(); + return this; + } + + /** + * + * + *
        +     * The legacy id of the user. This field is used to signal
        +     * the use of the compound resource pattern
        +     * `users/{user}/profile/blurbs/legacy/{legacy_user}~{blurb}`
        +     * 
        + * + * string legacy_user_id = 8; + * + * @return This builder for chaining. + */ + public Builder clearLegacyUserId() { + if (legacyIdCase_ == 8) { + legacyIdCase_ = 0; + legacyId_ = null; + onChanged(); + } + return this; + } + + /** + * + * + *
        +     * The legacy id of the user. This field is used to signal
        +     * the use of the compound resource pattern
        +     * `users/{user}/profile/blurbs/legacy/{legacy_user}~{blurb}`
        +     * 
        + * + * string legacy_user_id = 8; + * + * @param value The bytes for legacyUserId to set. + * @return This builder for chaining. + */ + public Builder setLegacyUserIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + legacyIdCase_ = 8; + legacyId_ = value; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.showcase.v1beta1.Blurb) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.Blurb) + private static final com.google.showcase.v1beta1.Blurb DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.Blurb(); + } + + public static com.google.showcase.v1beta1.Blurb getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Blurb 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.showcase.v1beta1.Blurb getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/BlurbName.java b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/BlurbName.java new file mode 100644 index 0000000000..c0f03fe0ca --- /dev/null +++ b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/BlurbName.java @@ -0,0 +1,458 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1; + +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 BlurbName implements ResourceName { + private static final PathTemplate USER_LEGACY_USER_BLURB = + PathTemplate.createWithoutUrlEncoding( + "users/{user}/profile/blurbs/legacy/{legacy_user}~{blurb}"); + private static final PathTemplate USER_BLURB = + PathTemplate.createWithoutUrlEncoding("users/{user}/profile/blurbs/{blurb}"); + private static final PathTemplate ROOM_BLURB = + PathTemplate.createWithoutUrlEncoding("rooms/{room}/blurbs/{blurb}"); + private static final PathTemplate ROOM_LEGACY_ROOM_BLURB = + PathTemplate.createWithoutUrlEncoding("rooms/{room}/blurbs/legacy/{legacy_room}.{blurb}"); + private volatile Map fieldValuesMap; + private PathTemplate pathTemplate; + private String fixedValue; + private final String user; + private final String legacyUser; + private final String blurb; + private final String room; + private final String legacyRoom; + + @Deprecated + protected BlurbName() { + user = null; + legacyUser = null; + blurb = null; + room = null; + legacyRoom = null; + } + + private BlurbName(Builder builder) { + user = Preconditions.checkNotNull(builder.getUser()); + legacyUser = Preconditions.checkNotNull(builder.getLegacyUser()); + blurb = Preconditions.checkNotNull(builder.getBlurb()); + room = null; + legacyRoom = null; + pathTemplate = USER_LEGACY_USER_BLURB; + } + + private BlurbName(UserBlurbBuilder builder) { + user = Preconditions.checkNotNull(builder.getUser()); + blurb = Preconditions.checkNotNull(builder.getBlurb()); + legacyUser = null; + room = null; + legacyRoom = null; + pathTemplate = USER_BLURB; + } + + private BlurbName(RoomBlurbBuilder builder) { + room = Preconditions.checkNotNull(builder.getRoom()); + blurb = Preconditions.checkNotNull(builder.getBlurb()); + user = null; + legacyUser = null; + legacyRoom = null; + pathTemplate = ROOM_BLURB; + } + + private BlurbName(RoomLegacyRoomBlurbBuilder builder) { + room = Preconditions.checkNotNull(builder.getRoom()); + legacyRoom = Preconditions.checkNotNull(builder.getLegacyRoom()); + blurb = Preconditions.checkNotNull(builder.getBlurb()); + user = null; + legacyUser = null; + pathTemplate = ROOM_LEGACY_ROOM_BLURB; + } + + public String getUser() { + return user; + } + + public String getLegacyUser() { + return legacyUser; + } + + public String getBlurb() { + return blurb; + } + + public String getRoom() { + return room; + } + + public String getLegacyRoom() { + return legacyRoom; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public static Builder newUserLegacyUserBlurbBuilder() { + return new Builder(); + } + + public static UserBlurbBuilder newUserBlurbBuilder() { + return new UserBlurbBuilder(); + } + + public static RoomBlurbBuilder newRoomBlurbBuilder() { + return new RoomBlurbBuilder(); + } + + public static RoomLegacyRoomBlurbBuilder newRoomLegacyRoomBlurbBuilder() { + return new RoomLegacyRoomBlurbBuilder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + public static BlurbName of(String user, String legacyUser, String blurb) { + return newBuilder().setUser(user).setLegacyUser(legacyUser).setBlurb(blurb).build(); + } + + public static BlurbName ofUserLegacyUserBlurbName(String user, String legacyUser, String blurb) { + return newBuilder().setUser(user).setLegacyUser(legacyUser).setBlurb(blurb).build(); + } + + public static BlurbName ofUserBlurbName(String user, String blurb) { + return newUserBlurbBuilder().setUser(user).setBlurb(blurb).build(); + } + + public static BlurbName ofRoomBlurbName(String room, String blurb) { + return newRoomBlurbBuilder().setRoom(room).setBlurb(blurb).build(); + } + + public static BlurbName ofRoomLegacyRoomBlurbName(String room, String legacyRoom, String blurb) { + return newRoomLegacyRoomBlurbBuilder() + .setRoom(room) + .setLegacyRoom(legacyRoom) + .setBlurb(blurb) + .build(); + } + + public static String format(String user, String legacyUser, String blurb) { + return newBuilder().setUser(user).setLegacyUser(legacyUser).setBlurb(blurb).build().toString(); + } + + public static String formatUserLegacyUserBlurbName(String user, String legacyUser, String blurb) { + return newBuilder().setUser(user).setLegacyUser(legacyUser).setBlurb(blurb).build().toString(); + } + + public static String formatUserBlurbName(String user, String blurb) { + return newUserBlurbBuilder().setUser(user).setBlurb(blurb).build().toString(); + } + + public static String formatRoomBlurbName(String room, String blurb) { + return newRoomBlurbBuilder().setRoom(room).setBlurb(blurb).build().toString(); + } + + public static String formatRoomLegacyRoomBlurbName(String room, String legacyRoom, String blurb) { + return newRoomLegacyRoomBlurbBuilder() + .setRoom(room) + .setLegacyRoom(legacyRoom) + .setBlurb(blurb) + .build() + .toString(); + } + + public static BlurbName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + if (USER_LEGACY_USER_BLURB.matches(formattedString)) { + Map matchMap = USER_LEGACY_USER_BLURB.match(formattedString); + return ofUserLegacyUserBlurbName( + matchMap.get("user"), matchMap.get("legacy_user"), matchMap.get("blurb")); + } else if (USER_BLURB.matches(formattedString)) { + Map matchMap = USER_BLURB.match(formattedString); + return ofUserBlurbName(matchMap.get("user"), matchMap.get("blurb")); + } else if (ROOM_BLURB.matches(formattedString)) { + Map matchMap = ROOM_BLURB.match(formattedString); + return ofRoomBlurbName(matchMap.get("room"), matchMap.get("blurb")); + } else if (ROOM_LEGACY_ROOM_BLURB.matches(formattedString)) { + Map matchMap = ROOM_LEGACY_ROOM_BLURB.match(formattedString); + return ofRoomLegacyRoomBlurbName( + matchMap.get("room"), matchMap.get("legacy_room"), matchMap.get("blurb")); + } + throw new ValidationException("BlurbName.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 (BlurbName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return USER_LEGACY_USER_BLURB.matches(formattedString) + || USER_BLURB.matches(formattedString) + || ROOM_BLURB.matches(formattedString) + || ROOM_LEGACY_ROOM_BLURB.matches(formattedString); + } + + @Override + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + if (user != null) { + fieldMapBuilder.put("user", user); + } + if (legacyUser != null) { + fieldMapBuilder.put("legacy_user", legacyUser); + } + if (blurb != null) { + fieldMapBuilder.put("blurb", blurb); + } + if (room != null) { + fieldMapBuilder.put("room", room); + } + if (legacyRoom != null) { + fieldMapBuilder.put("legacy_room", legacyRoom); + } + 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()) { + BlurbName that = ((BlurbName) o); + return Objects.equals(this.user, that.user) + && Objects.equals(this.legacyUser, that.legacyUser) + && Objects.equals(this.blurb, that.blurb) + && Objects.equals(this.room, that.room) + && Objects.equals(this.legacyRoom, that.legacyRoom); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= Objects.hashCode(fixedValue); + h *= 1000003; + h ^= Objects.hashCode(user); + h *= 1000003; + h ^= Objects.hashCode(legacyUser); + h *= 1000003; + h ^= Objects.hashCode(blurb); + h *= 1000003; + h ^= Objects.hashCode(room); + h *= 1000003; + h ^= Objects.hashCode(legacyRoom); + return h; + } + + /** Builder for users/{user}/profile/blurbs/legacy/{legacy_user}~{blurb}. */ + public static class Builder { + private String user; + private String legacyUser; + private String blurb; + + protected Builder() {} + + public String getUser() { + return user; + } + + public String getLegacyUser() { + return legacyUser; + } + + public String getBlurb() { + return blurb; + } + + public Builder setUser(String user) { + this.user = user; + return this; + } + + public Builder setLegacyUser(String legacyUser) { + this.legacyUser = legacyUser; + return this; + } + + public Builder setBlurb(String blurb) { + this.blurb = blurb; + return this; + } + + private Builder(BlurbName blurbName) { + Preconditions.checkArgument( + Objects.equals(blurbName.pathTemplate, USER_LEGACY_USER_BLURB), + "toBuilder is only supported when BlurbName has the pattern of" + + " users/{user}/profile/blurbs/legacy/{legacy_user}~{blurb}"); + this.user = blurbName.user; + this.legacyUser = blurbName.legacyUser; + this.blurb = blurbName.blurb; + } + + public BlurbName build() { + return new BlurbName(this); + } + } + + /** Builder for users/{user}/profile/blurbs/{blurb}. */ + public static class UserBlurbBuilder { + private String user; + private String blurb; + + protected UserBlurbBuilder() {} + + public String getUser() { + return user; + } + + public String getBlurb() { + return blurb; + } + + public UserBlurbBuilder setUser(String user) { + this.user = user; + return this; + } + + public UserBlurbBuilder setBlurb(String blurb) { + this.blurb = blurb; + return this; + } + + public BlurbName build() { + return new BlurbName(this); + } + } + + /** Builder for rooms/{room}/blurbs/{blurb}. */ + public static class RoomBlurbBuilder { + private String room; + private String blurb; + + protected RoomBlurbBuilder() {} + + public String getRoom() { + return room; + } + + public String getBlurb() { + return blurb; + } + + public RoomBlurbBuilder setRoom(String room) { + this.room = room; + return this; + } + + public RoomBlurbBuilder setBlurb(String blurb) { + this.blurb = blurb; + return this; + } + + public BlurbName build() { + return new BlurbName(this); + } + } + + /** Builder for rooms/{room}/blurbs/legacy/{legacy_room}.{blurb}. */ + public static class RoomLegacyRoomBlurbBuilder { + private String room; + private String legacyRoom; + private String blurb; + + protected RoomLegacyRoomBlurbBuilder() {} + + public String getRoom() { + return room; + } + + public String getLegacyRoom() { + return legacyRoom; + } + + public String getBlurb() { + return blurb; + } + + public RoomLegacyRoomBlurbBuilder setRoom(String room) { + this.room = room; + return this; + } + + public RoomLegacyRoomBlurbBuilder setLegacyRoom(String legacyRoom) { + this.legacyRoom = legacyRoom; + return this; + } + + public RoomLegacyRoomBlurbBuilder setBlurb(String blurb) { + this.blurb = blurb; + return this; + } + + public BlurbName build() { + return new BlurbName(this); + } + } +} diff --git a/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/BlurbOrBuilder.java b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/BlurbOrBuilder.java new file mode 100644 index 0000000000..3055cc9759 --- /dev/null +++ b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/BlurbOrBuilder.java @@ -0,0 +1,323 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: schema/google/showcase/v1beta1/messaging.proto +// Protobuf Java Version: 4.33.2 + +package com.google.showcase.v1beta1; + +@com.google.protobuf.Generated +public interface BlurbOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.Blurb) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
        +   * The resource name of the chat room.
        +   * 
        + * + * string name = 1; + * + * @return The name. + */ + java.lang.String getName(); + + /** + * + * + *
        +   * The resource name of the chat room.
        +   * 
        + * + * string name = 1; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
        +   * The resource name of the blurb's author.
        +   * 
        + * + * + * string user = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The user. + */ + java.lang.String getUser(); + + /** + * + * + *
        +   * The resource name of the blurb's author.
        +   * 
        + * + * + * string user = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for user. + */ + com.google.protobuf.ByteString getUserBytes(); + + /** + * + * + *
        +   * The textual content of this blurb.
        +   * 
        + * + * string text = 3; + * + * @return Whether the text field is set. + */ + boolean hasText(); + + /** + * + * + *
        +   * The textual content of this blurb.
        +   * 
        + * + * string text = 3; + * + * @return The text. + */ + java.lang.String getText(); + + /** + * + * + *
        +   * The textual content of this blurb.
        +   * 
        + * + * string text = 3; + * + * @return The bytes for text. + */ + com.google.protobuf.ByteString getTextBytes(); + + /** + * + * + *
        +   * The image content of this blurb.
        +   * 
        + * + * bytes image = 4; + * + * @return Whether the image field is set. + */ + boolean hasImage(); + + /** + * + * + *
        +   * The image content of this blurb.
        +   * 
        + * + * bytes image = 4; + * + * @return The image. + */ + com.google.protobuf.ByteString getImage(); + + /** + * + * + *
        +   * The timestamp at which the blurb was created.
        +   * 
        + * + * .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the createTime field is set. + */ + boolean hasCreateTime(); + + /** + * + * + *
        +   * The timestamp at which the blurb was created.
        +   * 
        + * + * .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The createTime. + */ + com.google.protobuf.Timestamp getCreateTime(); + + /** + * + * + *
        +   * The timestamp at which the blurb was created.
        +   * 
        + * + * .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder(); + + /** + * + * + *
        +   * The latest timestamp at which the blurb was updated.
        +   * 
        + * + * .google.protobuf.Timestamp update_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the updateTime field is set. + */ + boolean hasUpdateTime(); + + /** + * + * + *
        +   * The latest timestamp at which the blurb was updated.
        +   * 
        + * + * .google.protobuf.Timestamp update_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The updateTime. + */ + com.google.protobuf.Timestamp getUpdateTime(); + + /** + * + * + *
        +   * The latest timestamp at which the blurb was updated.
        +   * 
        + * + * .google.protobuf.Timestamp update_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder(); + + /** + * + * + *
        +   * The legacy id of the room. This field is used to signal
        +   * the use of the compound resource pattern
        +   * `rooms/{room}/blurbs/legacy/{legacy_room}.{blurb}`
        +   * 
        + * + * string legacy_room_id = 7; + * + * @return Whether the legacyRoomId field is set. + */ + boolean hasLegacyRoomId(); + + /** + * + * + *
        +   * The legacy id of the room. This field is used to signal
        +   * the use of the compound resource pattern
        +   * `rooms/{room}/blurbs/legacy/{legacy_room}.{blurb}`
        +   * 
        + * + * string legacy_room_id = 7; + * + * @return The legacyRoomId. + */ + java.lang.String getLegacyRoomId(); + + /** + * + * + *
        +   * The legacy id of the room. This field is used to signal
        +   * the use of the compound resource pattern
        +   * `rooms/{room}/blurbs/legacy/{legacy_room}.{blurb}`
        +   * 
        + * + * string legacy_room_id = 7; + * + * @return The bytes for legacyRoomId. + */ + com.google.protobuf.ByteString getLegacyRoomIdBytes(); + + /** + * + * + *
        +   * The legacy id of the user. This field is used to signal
        +   * the use of the compound resource pattern
        +   * `users/{user}/profile/blurbs/legacy/{legacy_user}~{blurb}`
        +   * 
        + * + * string legacy_user_id = 8; + * + * @return Whether the legacyUserId field is set. + */ + boolean hasLegacyUserId(); + + /** + * + * + *
        +   * The legacy id of the user. This field is used to signal
        +   * the use of the compound resource pattern
        +   * `users/{user}/profile/blurbs/legacy/{legacy_user}~{blurb}`
        +   * 
        + * + * string legacy_user_id = 8; + * + * @return The legacyUserId. + */ + java.lang.String getLegacyUserId(); + + /** + * + * + *
        +   * The legacy id of the user. This field is used to signal
        +   * the use of the compound resource pattern
        +   * `users/{user}/profile/blurbs/legacy/{legacy_user}~{blurb}`
        +   * 
        + * + * string legacy_user_id = 8; + * + * @return The bytes for legacyUserId. + */ + com.google.protobuf.ByteString getLegacyUserIdBytes(); + + com.google.showcase.v1beta1.Blurb.ContentCase getContentCase(); + + com.google.showcase.v1beta1.Blurb.LegacyIdCase getLegacyIdCase(); +} diff --git a/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ComplianceData.java b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ComplianceData.java new file mode 100644 index 0000000000..a9ca21258d --- /dev/null +++ b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ComplianceData.java @@ -0,0 +1,2860 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: schema/google/showcase/v1beta1/compliance.proto +// Protobuf Java Version: 4.33.2 + +package com.google.showcase.v1beta1; + +/** + * + * + *
        + * ComplianceData is a message used for testing REST transcoding of
        + * different data types.
        + * 
        + * + * Protobuf type {@code google.showcase.v1beta1.ComplianceData} + */ +@com.google.protobuf.Generated +public final class ComplianceData extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.ComplianceData) + ComplianceDataOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "ComplianceData"); + } + + // Use ComplianceData.newBuilder() to construct. + private ComplianceData(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private ComplianceData() { + fString_ = ""; + fBytes_ = com.google.protobuf.ByteString.EMPTY; + fKingdom_ = 0; + pString_ = ""; + pKingdom_ = 0; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.ComplianceOuterClass + .internal_static_google_showcase_v1beta1_ComplianceData_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.ComplianceOuterClass + .internal_static_google_showcase_v1beta1_ComplianceData_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.ComplianceData.class, + com.google.showcase.v1beta1.ComplianceData.Builder.class); + } + + /** Protobuf enum {@code google.showcase.v1beta1.ComplianceData.LifeKingdom} */ + public enum LifeKingdom implements com.google.protobuf.ProtocolMessageEnum { + /** LIFE_KINGDOM_UNSPECIFIED = 0; */ + LIFE_KINGDOM_UNSPECIFIED(0), + /** ARCHAEBACTERIA = 1; */ + ARCHAEBACTERIA(1), + /** EUBACTERIA = 2; */ + EUBACTERIA(2), + /** PROTISTA = 3; */ + PROTISTA(3), + /** FUNGI = 4; */ + FUNGI(4), + /** PLANTAE = 5; */ + PLANTAE(5), + /** ANIMALIA = 6; */ + ANIMALIA(6), + UNRECOGNIZED(-1), + ; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "LifeKingdom"); + } + + /** LIFE_KINGDOM_UNSPECIFIED = 0; */ + public static final int LIFE_KINGDOM_UNSPECIFIED_VALUE = 0; + + /** ARCHAEBACTERIA = 1; */ + public static final int ARCHAEBACTERIA_VALUE = 1; + + /** EUBACTERIA = 2; */ + public static final int EUBACTERIA_VALUE = 2; + + /** PROTISTA = 3; */ + public static final int PROTISTA_VALUE = 3; + + /** FUNGI = 4; */ + public static final int FUNGI_VALUE = 4; + + /** PLANTAE = 5; */ + public static final int PLANTAE_VALUE = 5; + + /** ANIMALIA = 6; */ + public static final int ANIMALIA_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 LifeKingdom 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 LifeKingdom forNumber(int value) { + switch (value) { + case 0: + return LIFE_KINGDOM_UNSPECIFIED; + case 1: + return ARCHAEBACTERIA; + case 2: + return EUBACTERIA; + case 3: + return PROTISTA; + case 4: + return FUNGI; + case 5: + return PLANTAE; + case 6: + return ANIMALIA; + 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 LifeKingdom findValueByNumber(int number) { + return LifeKingdom.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 com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.showcase.v1beta1.ComplianceData.getDescriptor().getEnumTypes().get(0); + } + + private static final LifeKingdom[] VALUES = values(); + + public static LifeKingdom 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 LifeKingdom(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.showcase.v1beta1.ComplianceData.LifeKingdom) + } + + private int bitField0_; + public static final int F_STRING_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object fString_ = ""; + + /** + * string f_string = 1; + * + * @return The fString. + */ + @java.lang.Override + public java.lang.String getFString() { + java.lang.Object ref = fString_; + 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(); + fString_ = s; + return s; + } + } + + /** + * string f_string = 1; + * + * @return The bytes for fString. + */ + @java.lang.Override + public com.google.protobuf.ByteString getFStringBytes() { + java.lang.Object ref = fString_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + fString_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int F_INT32_FIELD_NUMBER = 2; + private int fInt32_ = 0; + + /** + * int32 f_int32 = 2; + * + * @return The fInt32. + */ + @java.lang.Override + public int getFInt32() { + return fInt32_; + } + + public static final int F_SINT32_FIELD_NUMBER = 3; + private int fSint32_ = 0; + + /** + * sint32 f_sint32 = 3; + * + * @return The fSint32. + */ + @java.lang.Override + public int getFSint32() { + return fSint32_; + } + + public static final int F_SFIXED32_FIELD_NUMBER = 4; + private int fSfixed32_ = 0; + + /** + * sfixed32 f_sfixed32 = 4; + * + * @return The fSfixed32. + */ + @java.lang.Override + public int getFSfixed32() { + return fSfixed32_; + } + + public static final int F_UINT32_FIELD_NUMBER = 5; + private int fUint32_ = 0; + + /** + * uint32 f_uint32 = 5; + * + * @return The fUint32. + */ + @java.lang.Override + public int getFUint32() { + return fUint32_; + } + + public static final int F_FIXED32_FIELD_NUMBER = 6; + private int fFixed32_ = 0; + + /** + * fixed32 f_fixed32 = 6; + * + * @return The fFixed32. + */ + @java.lang.Override + public int getFFixed32() { + return fFixed32_; + } + + public static final int F_INT64_FIELD_NUMBER = 7; + private long fInt64_ = 0L; + + /** + * int64 f_int64 = 7; + * + * @return The fInt64. + */ + @java.lang.Override + public long getFInt64() { + return fInt64_; + } + + public static final int F_SINT64_FIELD_NUMBER = 8; + private long fSint64_ = 0L; + + /** + * sint64 f_sint64 = 8; + * + * @return The fSint64. + */ + @java.lang.Override + public long getFSint64() { + return fSint64_; + } + + public static final int F_SFIXED64_FIELD_NUMBER = 9; + private long fSfixed64_ = 0L; + + /** + * sfixed64 f_sfixed64 = 9; + * + * @return The fSfixed64. + */ + @java.lang.Override + public long getFSfixed64() { + return fSfixed64_; + } + + public static final int F_UINT64_FIELD_NUMBER = 10; + private long fUint64_ = 0L; + + /** + * uint64 f_uint64 = 10; + * + * @return The fUint64. + */ + @java.lang.Override + public long getFUint64() { + return fUint64_; + } + + public static final int F_FIXED64_FIELD_NUMBER = 11; + private long fFixed64_ = 0L; + + /** + * fixed64 f_fixed64 = 11; + * + * @return The fFixed64. + */ + @java.lang.Override + public long getFFixed64() { + return fFixed64_; + } + + public static final int F_DOUBLE_FIELD_NUMBER = 12; + private double fDouble_ = 0D; + + /** + * double f_double = 12; + * + * @return The fDouble. + */ + @java.lang.Override + public double getFDouble() { + return fDouble_; + } + + public static final int F_FLOAT_FIELD_NUMBER = 13; + private float fFloat_ = 0F; + + /** + * float f_float = 13; + * + * @return The fFloat. + */ + @java.lang.Override + public float getFFloat() { + return fFloat_; + } + + public static final int F_BOOL_FIELD_NUMBER = 14; + private boolean fBool_ = false; + + /** + * bool f_bool = 14; + * + * @return The fBool. + */ + @java.lang.Override + public boolean getFBool() { + return fBool_; + } + + public static final int F_BYTES_FIELD_NUMBER = 15; + private com.google.protobuf.ByteString fBytes_ = com.google.protobuf.ByteString.EMPTY; + + /** + * bytes f_bytes = 15; + * + * @return The fBytes. + */ + @java.lang.Override + public com.google.protobuf.ByteString getFBytes() { + return fBytes_; + } + + public static final int F_KINGDOM_FIELD_NUMBER = 22; + private int fKingdom_ = 0; + + /** + * .google.showcase.v1beta1.ComplianceData.LifeKingdom f_kingdom = 22; + * + * @return The enum numeric value on the wire for fKingdom. + */ + @java.lang.Override + public int getFKingdomValue() { + return fKingdom_; + } + + /** + * .google.showcase.v1beta1.ComplianceData.LifeKingdom f_kingdom = 22; + * + * @return The fKingdom. + */ + @java.lang.Override + public com.google.showcase.v1beta1.ComplianceData.LifeKingdom getFKingdom() { + com.google.showcase.v1beta1.ComplianceData.LifeKingdom result = + com.google.showcase.v1beta1.ComplianceData.LifeKingdom.forNumber(fKingdom_); + return result == null + ? com.google.showcase.v1beta1.ComplianceData.LifeKingdom.UNRECOGNIZED + : result; + } + + public static final int F_CHILD_FIELD_NUMBER = 16; + private com.google.showcase.v1beta1.ComplianceDataChild fChild_; + + /** + * .google.showcase.v1beta1.ComplianceDataChild f_child = 16; + * + * @return Whether the fChild field is set. + */ + @java.lang.Override + public boolean hasFChild() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * .google.showcase.v1beta1.ComplianceDataChild f_child = 16; + * + * @return The fChild. + */ + @java.lang.Override + public com.google.showcase.v1beta1.ComplianceDataChild getFChild() { + return fChild_ == null + ? com.google.showcase.v1beta1.ComplianceDataChild.getDefaultInstance() + : fChild_; + } + + /** .google.showcase.v1beta1.ComplianceDataChild f_child = 16; */ + @java.lang.Override + public com.google.showcase.v1beta1.ComplianceDataChildOrBuilder getFChildOrBuilder() { + return fChild_ == null + ? com.google.showcase.v1beta1.ComplianceDataChild.getDefaultInstance() + : fChild_; + } + + public static final int P_STRING_FIELD_NUMBER = 17; + + @SuppressWarnings("serial") + private volatile java.lang.Object pString_ = ""; + + /** + * optional string p_string = 17; + * + * @return Whether the pString field is set. + */ + @java.lang.Override + public boolean hasPString() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * optional string p_string = 17; + * + * @return The pString. + */ + @java.lang.Override + public java.lang.String getPString() { + java.lang.Object ref = pString_; + 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(); + pString_ = s; + return s; + } + } + + /** + * optional string p_string = 17; + * + * @return The bytes for pString. + */ + @java.lang.Override + public com.google.protobuf.ByteString getPStringBytes() { + java.lang.Object ref = pString_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pString_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int P_INT32_FIELD_NUMBER = 18; + private int pInt32_ = 0; + + /** + * optional int32 p_int32 = 18; + * + * @return Whether the pInt32 field is set. + */ + @java.lang.Override + public boolean hasPInt32() { + return ((bitField0_ & 0x00000004) != 0); + } + + /** + * optional int32 p_int32 = 18; + * + * @return The pInt32. + */ + @java.lang.Override + public int getPInt32() { + return pInt32_; + } + + public static final int P_DOUBLE_FIELD_NUMBER = 19; + private double pDouble_ = 0D; + + /** + * optional double p_double = 19; + * + * @return Whether the pDouble field is set. + */ + @java.lang.Override + public boolean hasPDouble() { + return ((bitField0_ & 0x00000008) != 0); + } + + /** + * optional double p_double = 19; + * + * @return The pDouble. + */ + @java.lang.Override + public double getPDouble() { + return pDouble_; + } + + public static final int P_BOOL_FIELD_NUMBER = 20; + private boolean pBool_ = false; + + /** + * optional bool p_bool = 20; + * + * @return Whether the pBool field is set. + */ + @java.lang.Override + public boolean hasPBool() { + return ((bitField0_ & 0x00000010) != 0); + } + + /** + * optional bool p_bool = 20; + * + * @return The pBool. + */ + @java.lang.Override + public boolean getPBool() { + return pBool_; + } + + public static final int P_KINGDOM_FIELD_NUMBER = 23; + private int pKingdom_ = 0; + + /** + * optional .google.showcase.v1beta1.ComplianceData.LifeKingdom p_kingdom = 23; + * + * @return Whether the pKingdom field is set. + */ + @java.lang.Override + public boolean hasPKingdom() { + return ((bitField0_ & 0x00000020) != 0); + } + + /** + * optional .google.showcase.v1beta1.ComplianceData.LifeKingdom p_kingdom = 23; + * + * @return The enum numeric value on the wire for pKingdom. + */ + @java.lang.Override + public int getPKingdomValue() { + return pKingdom_; + } + + /** + * optional .google.showcase.v1beta1.ComplianceData.LifeKingdom p_kingdom = 23; + * + * @return The pKingdom. + */ + @java.lang.Override + public com.google.showcase.v1beta1.ComplianceData.LifeKingdom getPKingdom() { + com.google.showcase.v1beta1.ComplianceData.LifeKingdom result = + com.google.showcase.v1beta1.ComplianceData.LifeKingdom.forNumber(pKingdom_); + return result == null + ? com.google.showcase.v1beta1.ComplianceData.LifeKingdom.UNRECOGNIZED + : result; + } + + public static final int P_CHILD_FIELD_NUMBER = 21; + private com.google.showcase.v1beta1.ComplianceDataChild pChild_; + + /** + * optional .google.showcase.v1beta1.ComplianceDataChild p_child = 21; + * + * @return Whether the pChild field is set. + */ + @java.lang.Override + public boolean hasPChild() { + return ((bitField0_ & 0x00000040) != 0); + } + + /** + * optional .google.showcase.v1beta1.ComplianceDataChild p_child = 21; + * + * @return The pChild. + */ + @java.lang.Override + public com.google.showcase.v1beta1.ComplianceDataChild getPChild() { + return pChild_ == null + ? com.google.showcase.v1beta1.ComplianceDataChild.getDefaultInstance() + : pChild_; + } + + /** optional .google.showcase.v1beta1.ComplianceDataChild p_child = 21; */ + @java.lang.Override + public com.google.showcase.v1beta1.ComplianceDataChildOrBuilder getPChildOrBuilder() { + return pChild_ == null + ? com.google.showcase.v1beta1.ComplianceDataChild.getDefaultInstance() + : pChild_; + } + + 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.GeneratedMessage.isStringEmpty(fString_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, fString_); + } + if (fInt32_ != 0) { + output.writeInt32(2, fInt32_); + } + if (fSint32_ != 0) { + output.writeSInt32(3, fSint32_); + } + if (fSfixed32_ != 0) { + output.writeSFixed32(4, fSfixed32_); + } + if (fUint32_ != 0) { + output.writeUInt32(5, fUint32_); + } + if (fFixed32_ != 0) { + output.writeFixed32(6, fFixed32_); + } + if (fInt64_ != 0L) { + output.writeInt64(7, fInt64_); + } + if (fSint64_ != 0L) { + output.writeSInt64(8, fSint64_); + } + if (fSfixed64_ != 0L) { + output.writeSFixed64(9, fSfixed64_); + } + if (fUint64_ != 0L) { + output.writeUInt64(10, fUint64_); + } + if (fFixed64_ != 0L) { + output.writeFixed64(11, fFixed64_); + } + if (java.lang.Double.doubleToRawLongBits(fDouble_) != 0) { + output.writeDouble(12, fDouble_); + } + if (java.lang.Float.floatToRawIntBits(fFloat_) != 0) { + output.writeFloat(13, fFloat_); + } + if (fBool_ != false) { + output.writeBool(14, fBool_); + } + if (!fBytes_.isEmpty()) { + output.writeBytes(15, fBytes_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(16, getFChild()); + } + if (((bitField0_ & 0x00000002) != 0)) { + com.google.protobuf.GeneratedMessage.writeString(output, 17, pString_); + } + if (((bitField0_ & 0x00000004) != 0)) { + output.writeInt32(18, pInt32_); + } + if (((bitField0_ & 0x00000008) != 0)) { + output.writeDouble(19, pDouble_); + } + if (((bitField0_ & 0x00000010) != 0)) { + output.writeBool(20, pBool_); + } + if (((bitField0_ & 0x00000040) != 0)) { + output.writeMessage(21, getPChild()); + } + if (fKingdom_ + != com.google.showcase.v1beta1.ComplianceData.LifeKingdom.LIFE_KINGDOM_UNSPECIFIED + .getNumber()) { + output.writeEnum(22, fKingdom_); + } + if (((bitField0_ & 0x00000020) != 0)) { + output.writeEnum(23, pKingdom_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(fString_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, fString_); + } + if (fInt32_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(2, fInt32_); + } + if (fSint32_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeSInt32Size(3, fSint32_); + } + if (fSfixed32_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeSFixed32Size(4, fSfixed32_); + } + if (fUint32_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeUInt32Size(5, fUint32_); + } + if (fFixed32_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeFixed32Size(6, fFixed32_); + } + if (fInt64_ != 0L) { + size += com.google.protobuf.CodedOutputStream.computeInt64Size(7, fInt64_); + } + if (fSint64_ != 0L) { + size += com.google.protobuf.CodedOutputStream.computeSInt64Size(8, fSint64_); + } + if (fSfixed64_ != 0L) { + size += com.google.protobuf.CodedOutputStream.computeSFixed64Size(9, fSfixed64_); + } + if (fUint64_ != 0L) { + size += com.google.protobuf.CodedOutputStream.computeUInt64Size(10, fUint64_); + } + if (fFixed64_ != 0L) { + size += com.google.protobuf.CodedOutputStream.computeFixed64Size(11, fFixed64_); + } + if (java.lang.Double.doubleToRawLongBits(fDouble_) != 0) { + size += com.google.protobuf.CodedOutputStream.computeDoubleSize(12, fDouble_); + } + if (java.lang.Float.floatToRawIntBits(fFloat_) != 0) { + size += com.google.protobuf.CodedOutputStream.computeFloatSize(13, fFloat_); + } + if (fBool_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(14, fBool_); + } + if (!fBytes_.isEmpty()) { + size += com.google.protobuf.CodedOutputStream.computeBytesSize(15, fBytes_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(16, getFChild()); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(17, pString_); + } + if (((bitField0_ & 0x00000004) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(18, pInt32_); + } + if (((bitField0_ & 0x00000008) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeDoubleSize(19, pDouble_); + } + if (((bitField0_ & 0x00000010) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(20, pBool_); + } + if (((bitField0_ & 0x00000040) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(21, getPChild()); + } + if (fKingdom_ + != com.google.showcase.v1beta1.ComplianceData.LifeKingdom.LIFE_KINGDOM_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(22, fKingdom_); + } + if (((bitField0_ & 0x00000020) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(23, pKingdom_); + } + 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.showcase.v1beta1.ComplianceData)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.ComplianceData other = + (com.google.showcase.v1beta1.ComplianceData) obj; + + if (!getFString().equals(other.getFString())) return false; + if (getFInt32() != other.getFInt32()) return false; + if (getFSint32() != other.getFSint32()) return false; + if (getFSfixed32() != other.getFSfixed32()) return false; + if (getFUint32() != other.getFUint32()) return false; + if (getFFixed32() != other.getFFixed32()) return false; + if (getFInt64() != other.getFInt64()) return false; + if (getFSint64() != other.getFSint64()) return false; + if (getFSfixed64() != other.getFSfixed64()) return false; + if (getFUint64() != other.getFUint64()) return false; + if (getFFixed64() != other.getFFixed64()) return false; + if (java.lang.Double.doubleToLongBits(getFDouble()) + != java.lang.Double.doubleToLongBits(other.getFDouble())) return false; + if (java.lang.Float.floatToIntBits(getFFloat()) + != java.lang.Float.floatToIntBits(other.getFFloat())) return false; + if (getFBool() != other.getFBool()) return false; + if (!getFBytes().equals(other.getFBytes())) return false; + if (fKingdom_ != other.fKingdom_) return false; + if (hasFChild() != other.hasFChild()) return false; + if (hasFChild()) { + if (!getFChild().equals(other.getFChild())) return false; + } + if (hasPString() != other.hasPString()) return false; + if (hasPString()) { + if (!getPString().equals(other.getPString())) return false; + } + if (hasPInt32() != other.hasPInt32()) return false; + if (hasPInt32()) { + if (getPInt32() != other.getPInt32()) return false; + } + if (hasPDouble() != other.hasPDouble()) return false; + if (hasPDouble()) { + if (java.lang.Double.doubleToLongBits(getPDouble()) + != java.lang.Double.doubleToLongBits(other.getPDouble())) return false; + } + if (hasPBool() != other.hasPBool()) return false; + if (hasPBool()) { + if (getPBool() != other.getPBool()) return false; + } + if (hasPKingdom() != other.hasPKingdom()) return false; + if (hasPKingdom()) { + if (pKingdom_ != other.pKingdom_) return false; + } + if (hasPChild() != other.hasPChild()) return false; + if (hasPChild()) { + if (!getPChild().equals(other.getPChild())) 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) + F_STRING_FIELD_NUMBER; + hash = (53 * hash) + getFString().hashCode(); + hash = (37 * hash) + F_INT32_FIELD_NUMBER; + hash = (53 * hash) + getFInt32(); + hash = (37 * hash) + F_SINT32_FIELD_NUMBER; + hash = (53 * hash) + getFSint32(); + hash = (37 * hash) + F_SFIXED32_FIELD_NUMBER; + hash = (53 * hash) + getFSfixed32(); + hash = (37 * hash) + F_UINT32_FIELD_NUMBER; + hash = (53 * hash) + getFUint32(); + hash = (37 * hash) + F_FIXED32_FIELD_NUMBER; + hash = (53 * hash) + getFFixed32(); + hash = (37 * hash) + F_INT64_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getFInt64()); + hash = (37 * hash) + F_SINT64_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getFSint64()); + hash = (37 * hash) + F_SFIXED64_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getFSfixed64()); + hash = (37 * hash) + F_UINT64_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getFUint64()); + hash = (37 * hash) + F_FIXED64_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getFFixed64()); + hash = (37 * hash) + F_DOUBLE_FIELD_NUMBER; + hash = + (53 * hash) + + com.google.protobuf.Internal.hashLong( + java.lang.Double.doubleToLongBits(getFDouble())); + hash = (37 * hash) + F_FLOAT_FIELD_NUMBER; + hash = (53 * hash) + java.lang.Float.floatToIntBits(getFFloat()); + hash = (37 * hash) + F_BOOL_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getFBool()); + hash = (37 * hash) + F_BYTES_FIELD_NUMBER; + hash = (53 * hash) + getFBytes().hashCode(); + hash = (37 * hash) + F_KINGDOM_FIELD_NUMBER; + hash = (53 * hash) + fKingdom_; + if (hasFChild()) { + hash = (37 * hash) + F_CHILD_FIELD_NUMBER; + hash = (53 * hash) + getFChild().hashCode(); + } + if (hasPString()) { + hash = (37 * hash) + P_STRING_FIELD_NUMBER; + hash = (53 * hash) + getPString().hashCode(); + } + if (hasPInt32()) { + hash = (37 * hash) + P_INT32_FIELD_NUMBER; + hash = (53 * hash) + getPInt32(); + } + if (hasPDouble()) { + hash = (37 * hash) + P_DOUBLE_FIELD_NUMBER; + hash = + (53 * hash) + + com.google.protobuf.Internal.hashLong( + java.lang.Double.doubleToLongBits(getPDouble())); + } + if (hasPBool()) { + hash = (37 * hash) + P_BOOL_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getPBool()); + } + if (hasPKingdom()) { + hash = (37 * hash) + P_KINGDOM_FIELD_NUMBER; + hash = (53 * hash) + pKingdom_; + } + if (hasPChild()) { + hash = (37 * hash) + P_CHILD_FIELD_NUMBER; + hash = (53 * hash) + getPChild().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.showcase.v1beta1.ComplianceData parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.ComplianceData parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.ComplianceData parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.ComplianceData 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.showcase.v1beta1.ComplianceData parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.ComplianceData parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.ComplianceData parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.ComplianceData parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.showcase.v1beta1.ComplianceData parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.ComplianceData parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.showcase.v1beta1.ComplianceData parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.ComplianceData parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.showcase.v1beta1.ComplianceData 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
        +   * ComplianceData is a message used for testing REST transcoding of
        +   * different data types.
        +   * 
        + * + * Protobuf type {@code google.showcase.v1beta1.ComplianceData} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.ComplianceData) + com.google.showcase.v1beta1.ComplianceDataOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.ComplianceOuterClass + .internal_static_google_showcase_v1beta1_ComplianceData_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.ComplianceOuterClass + .internal_static_google_showcase_v1beta1_ComplianceData_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.ComplianceData.class, + com.google.showcase.v1beta1.ComplianceData.Builder.class); + } + + // Construct using com.google.showcase.v1beta1.ComplianceData.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetFChildFieldBuilder(); + internalGetPChildFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + fString_ = ""; + fInt32_ = 0; + fSint32_ = 0; + fSfixed32_ = 0; + fUint32_ = 0; + fFixed32_ = 0; + fInt64_ = 0L; + fSint64_ = 0L; + fSfixed64_ = 0L; + fUint64_ = 0L; + fFixed64_ = 0L; + fDouble_ = 0D; + fFloat_ = 0F; + fBool_ = false; + fBytes_ = com.google.protobuf.ByteString.EMPTY; + fKingdom_ = 0; + fChild_ = null; + if (fChildBuilder_ != null) { + fChildBuilder_.dispose(); + fChildBuilder_ = null; + } + pString_ = ""; + pInt32_ = 0; + pDouble_ = 0D; + pBool_ = false; + pKingdom_ = 0; + pChild_ = null; + if (pChildBuilder_ != null) { + pChildBuilder_.dispose(); + pChildBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.showcase.v1beta1.ComplianceOuterClass + .internal_static_google_showcase_v1beta1_ComplianceData_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.ComplianceData getDefaultInstanceForType() { + return com.google.showcase.v1beta1.ComplianceData.getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.ComplianceData build() { + com.google.showcase.v1beta1.ComplianceData result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.ComplianceData buildPartial() { + com.google.showcase.v1beta1.ComplianceData result = + new com.google.showcase.v1beta1.ComplianceData(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.showcase.v1beta1.ComplianceData result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.fString_ = fString_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.fInt32_ = fInt32_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.fSint32_ = fSint32_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.fSfixed32_ = fSfixed32_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.fUint32_ = fUint32_; + } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.fFixed32_ = fFixed32_; + } + if (((from_bitField0_ & 0x00000040) != 0)) { + result.fInt64_ = fInt64_; + } + if (((from_bitField0_ & 0x00000080) != 0)) { + result.fSint64_ = fSint64_; + } + if (((from_bitField0_ & 0x00000100) != 0)) { + result.fSfixed64_ = fSfixed64_; + } + if (((from_bitField0_ & 0x00000200) != 0)) { + result.fUint64_ = fUint64_; + } + if (((from_bitField0_ & 0x00000400) != 0)) { + result.fFixed64_ = fFixed64_; + } + if (((from_bitField0_ & 0x00000800) != 0)) { + result.fDouble_ = fDouble_; + } + if (((from_bitField0_ & 0x00001000) != 0)) { + result.fFloat_ = fFloat_; + } + if (((from_bitField0_ & 0x00002000) != 0)) { + result.fBool_ = fBool_; + } + if (((from_bitField0_ & 0x00004000) != 0)) { + result.fBytes_ = fBytes_; + } + if (((from_bitField0_ & 0x00008000) != 0)) { + result.fKingdom_ = fKingdom_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00010000) != 0)) { + result.fChild_ = fChildBuilder_ == null ? fChild_ : fChildBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00020000) != 0)) { + result.pString_ = pString_; + to_bitField0_ |= 0x00000002; + } + if (((from_bitField0_ & 0x00040000) != 0)) { + result.pInt32_ = pInt32_; + to_bitField0_ |= 0x00000004; + } + if (((from_bitField0_ & 0x00080000) != 0)) { + result.pDouble_ = pDouble_; + to_bitField0_ |= 0x00000008; + } + if (((from_bitField0_ & 0x00100000) != 0)) { + result.pBool_ = pBool_; + to_bitField0_ |= 0x00000010; + } + if (((from_bitField0_ & 0x00200000) != 0)) { + result.pKingdom_ = pKingdom_; + to_bitField0_ |= 0x00000020; + } + if (((from_bitField0_ & 0x00400000) != 0)) { + result.pChild_ = pChildBuilder_ == null ? pChild_ : pChildBuilder_.build(); + to_bitField0_ |= 0x00000040; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.showcase.v1beta1.ComplianceData) { + return mergeFrom((com.google.showcase.v1beta1.ComplianceData) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.showcase.v1beta1.ComplianceData other) { + if (other == com.google.showcase.v1beta1.ComplianceData.getDefaultInstance()) return this; + if (!other.getFString().isEmpty()) { + fString_ = other.fString_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.getFInt32() != 0) { + setFInt32(other.getFInt32()); + } + if (other.getFSint32() != 0) { + setFSint32(other.getFSint32()); + } + if (other.getFSfixed32() != 0) { + setFSfixed32(other.getFSfixed32()); + } + if (other.getFUint32() != 0) { + setFUint32(other.getFUint32()); + } + if (other.getFFixed32() != 0) { + setFFixed32(other.getFFixed32()); + } + if (other.getFInt64() != 0L) { + setFInt64(other.getFInt64()); + } + if (other.getFSint64() != 0L) { + setFSint64(other.getFSint64()); + } + if (other.getFSfixed64() != 0L) { + setFSfixed64(other.getFSfixed64()); + } + if (other.getFUint64() != 0L) { + setFUint64(other.getFUint64()); + } + if (other.getFFixed64() != 0L) { + setFFixed64(other.getFFixed64()); + } + if (java.lang.Double.doubleToRawLongBits(other.getFDouble()) != 0) { + setFDouble(other.getFDouble()); + } + if (java.lang.Float.floatToRawIntBits(other.getFFloat()) != 0) { + setFFloat(other.getFFloat()); + } + if (other.getFBool() != false) { + setFBool(other.getFBool()); + } + if (!other.getFBytes().isEmpty()) { + setFBytes(other.getFBytes()); + } + if (other.fKingdom_ != 0) { + setFKingdomValue(other.getFKingdomValue()); + } + if (other.hasFChild()) { + mergeFChild(other.getFChild()); + } + if (other.hasPString()) { + pString_ = other.pString_; + bitField0_ |= 0x00020000; + onChanged(); + } + if (other.hasPInt32()) { + setPInt32(other.getPInt32()); + } + if (other.hasPDouble()) { + setPDouble(other.getPDouble()); + } + if (other.hasPBool()) { + setPBool(other.getPBool()); + } + if (other.hasPKingdom()) { + setPKingdomValue(other.getPKingdomValue()); + } + if (other.hasPChild()) { + mergePChild(other.getPChild()); + } + 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: + { + fString_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 16: + { + fInt32_ = input.readInt32(); + bitField0_ |= 0x00000002; + break; + } // case 16 + case 24: + { + fSint32_ = input.readSInt32(); + bitField0_ |= 0x00000004; + break; + } // case 24 + case 37: + { + fSfixed32_ = input.readSFixed32(); + bitField0_ |= 0x00000008; + break; + } // case 37 + case 40: + { + fUint32_ = input.readUInt32(); + bitField0_ |= 0x00000010; + break; + } // case 40 + case 53: + { + fFixed32_ = input.readFixed32(); + bitField0_ |= 0x00000020; + break; + } // case 53 + case 56: + { + fInt64_ = input.readInt64(); + bitField0_ |= 0x00000040; + break; + } // case 56 + case 64: + { + fSint64_ = input.readSInt64(); + bitField0_ |= 0x00000080; + break; + } // case 64 + case 73: + { + fSfixed64_ = input.readSFixed64(); + bitField0_ |= 0x00000100; + break; + } // case 73 + case 80: + { + fUint64_ = input.readUInt64(); + bitField0_ |= 0x00000200; + break; + } // case 80 + case 89: + { + fFixed64_ = input.readFixed64(); + bitField0_ |= 0x00000400; + break; + } // case 89 + case 97: + { + fDouble_ = input.readDouble(); + bitField0_ |= 0x00000800; + break; + } // case 97 + case 109: + { + fFloat_ = input.readFloat(); + bitField0_ |= 0x00001000; + break; + } // case 109 + case 112: + { + fBool_ = input.readBool(); + bitField0_ |= 0x00002000; + break; + } // case 112 + case 122: + { + fBytes_ = input.readBytes(); + bitField0_ |= 0x00004000; + break; + } // case 122 + case 130: + { + input.readMessage(internalGetFChildFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00010000; + break; + } // case 130 + case 138: + { + pString_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00020000; + break; + } // case 138 + case 144: + { + pInt32_ = input.readInt32(); + bitField0_ |= 0x00040000; + break; + } // case 144 + case 153: + { + pDouble_ = input.readDouble(); + bitField0_ |= 0x00080000; + break; + } // case 153 + case 160: + { + pBool_ = input.readBool(); + bitField0_ |= 0x00100000; + break; + } // case 160 + case 170: + { + input.readMessage(internalGetPChildFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00400000; + break; + } // case 170 + case 176: + { + fKingdom_ = input.readEnum(); + bitField0_ |= 0x00008000; + break; + } // case 176 + case 184: + { + pKingdom_ = input.readEnum(); + bitField0_ |= 0x00200000; + break; + } // case 184 + 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 fString_ = ""; + + /** + * string f_string = 1; + * + * @return The fString. + */ + public java.lang.String getFString() { + java.lang.Object ref = fString_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + fString_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * string f_string = 1; + * + * @return The bytes for fString. + */ + public com.google.protobuf.ByteString getFStringBytes() { + java.lang.Object ref = fString_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + fString_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * string f_string = 1; + * + * @param value The fString to set. + * @return This builder for chaining. + */ + public Builder setFString(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + fString_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * string f_string = 1; + * + * @return This builder for chaining. + */ + public Builder clearFString() { + fString_ = getDefaultInstance().getFString(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * string f_string = 1; + * + * @param value The bytes for fString to set. + * @return This builder for chaining. + */ + public Builder setFStringBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + fString_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private int fInt32_; + + /** + * int32 f_int32 = 2; + * + * @return The fInt32. + */ + @java.lang.Override + public int getFInt32() { + return fInt32_; + } + + /** + * int32 f_int32 = 2; + * + * @param value The fInt32 to set. + * @return This builder for chaining. + */ + public Builder setFInt32(int value) { + + fInt32_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * int32 f_int32 = 2; + * + * @return This builder for chaining. + */ + public Builder clearFInt32() { + bitField0_ = (bitField0_ & ~0x00000002); + fInt32_ = 0; + onChanged(); + return this; + } + + private int fSint32_; + + /** + * sint32 f_sint32 = 3; + * + * @return The fSint32. + */ + @java.lang.Override + public int getFSint32() { + return fSint32_; + } + + /** + * sint32 f_sint32 = 3; + * + * @param value The fSint32 to set. + * @return This builder for chaining. + */ + public Builder setFSint32(int value) { + + fSint32_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * sint32 f_sint32 = 3; + * + * @return This builder for chaining. + */ + public Builder clearFSint32() { + bitField0_ = (bitField0_ & ~0x00000004); + fSint32_ = 0; + onChanged(); + return this; + } + + private int fSfixed32_; + + /** + * sfixed32 f_sfixed32 = 4; + * + * @return The fSfixed32. + */ + @java.lang.Override + public int getFSfixed32() { + return fSfixed32_; + } + + /** + * sfixed32 f_sfixed32 = 4; + * + * @param value The fSfixed32 to set. + * @return This builder for chaining. + */ + public Builder setFSfixed32(int value) { + + fSfixed32_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + /** + * sfixed32 f_sfixed32 = 4; + * + * @return This builder for chaining. + */ + public Builder clearFSfixed32() { + bitField0_ = (bitField0_ & ~0x00000008); + fSfixed32_ = 0; + onChanged(); + return this; + } + + private int fUint32_; + + /** + * uint32 f_uint32 = 5; + * + * @return The fUint32. + */ + @java.lang.Override + public int getFUint32() { + return fUint32_; + } + + /** + * uint32 f_uint32 = 5; + * + * @param value The fUint32 to set. + * @return This builder for chaining. + */ + public Builder setFUint32(int value) { + + fUint32_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + /** + * uint32 f_uint32 = 5; + * + * @return This builder for chaining. + */ + public Builder clearFUint32() { + bitField0_ = (bitField0_ & ~0x00000010); + fUint32_ = 0; + onChanged(); + return this; + } + + private int fFixed32_; + + /** + * fixed32 f_fixed32 = 6; + * + * @return The fFixed32. + */ + @java.lang.Override + public int getFFixed32() { + return fFixed32_; + } + + /** + * fixed32 f_fixed32 = 6; + * + * @param value The fFixed32 to set. + * @return This builder for chaining. + */ + public Builder setFFixed32(int value) { + + fFixed32_ = value; + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + + /** + * fixed32 f_fixed32 = 6; + * + * @return This builder for chaining. + */ + public Builder clearFFixed32() { + bitField0_ = (bitField0_ & ~0x00000020); + fFixed32_ = 0; + onChanged(); + return this; + } + + private long fInt64_; + + /** + * int64 f_int64 = 7; + * + * @return The fInt64. + */ + @java.lang.Override + public long getFInt64() { + return fInt64_; + } + + /** + * int64 f_int64 = 7; + * + * @param value The fInt64 to set. + * @return This builder for chaining. + */ + public Builder setFInt64(long value) { + + fInt64_ = value; + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + + /** + * int64 f_int64 = 7; + * + * @return This builder for chaining. + */ + public Builder clearFInt64() { + bitField0_ = (bitField0_ & ~0x00000040); + fInt64_ = 0L; + onChanged(); + return this; + } + + private long fSint64_; + + /** + * sint64 f_sint64 = 8; + * + * @return The fSint64. + */ + @java.lang.Override + public long getFSint64() { + return fSint64_; + } + + /** + * sint64 f_sint64 = 8; + * + * @param value The fSint64 to set. + * @return This builder for chaining. + */ + public Builder setFSint64(long value) { + + fSint64_ = value; + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + + /** + * sint64 f_sint64 = 8; + * + * @return This builder for chaining. + */ + public Builder clearFSint64() { + bitField0_ = (bitField0_ & ~0x00000080); + fSint64_ = 0L; + onChanged(); + return this; + } + + private long fSfixed64_; + + /** + * sfixed64 f_sfixed64 = 9; + * + * @return The fSfixed64. + */ + @java.lang.Override + public long getFSfixed64() { + return fSfixed64_; + } + + /** + * sfixed64 f_sfixed64 = 9; + * + * @param value The fSfixed64 to set. + * @return This builder for chaining. + */ + public Builder setFSfixed64(long value) { + + fSfixed64_ = value; + bitField0_ |= 0x00000100; + onChanged(); + return this; + } + + /** + * sfixed64 f_sfixed64 = 9; + * + * @return This builder for chaining. + */ + public Builder clearFSfixed64() { + bitField0_ = (bitField0_ & ~0x00000100); + fSfixed64_ = 0L; + onChanged(); + return this; + } + + private long fUint64_; + + /** + * uint64 f_uint64 = 10; + * + * @return The fUint64. + */ + @java.lang.Override + public long getFUint64() { + return fUint64_; + } + + /** + * uint64 f_uint64 = 10; + * + * @param value The fUint64 to set. + * @return This builder for chaining. + */ + public Builder setFUint64(long value) { + + fUint64_ = value; + bitField0_ |= 0x00000200; + onChanged(); + return this; + } + + /** + * uint64 f_uint64 = 10; + * + * @return This builder for chaining. + */ + public Builder clearFUint64() { + bitField0_ = (bitField0_ & ~0x00000200); + fUint64_ = 0L; + onChanged(); + return this; + } + + private long fFixed64_; + + /** + * fixed64 f_fixed64 = 11; + * + * @return The fFixed64. + */ + @java.lang.Override + public long getFFixed64() { + return fFixed64_; + } + + /** + * fixed64 f_fixed64 = 11; + * + * @param value The fFixed64 to set. + * @return This builder for chaining. + */ + public Builder setFFixed64(long value) { + + fFixed64_ = value; + bitField0_ |= 0x00000400; + onChanged(); + return this; + } + + /** + * fixed64 f_fixed64 = 11; + * + * @return This builder for chaining. + */ + public Builder clearFFixed64() { + bitField0_ = (bitField0_ & ~0x00000400); + fFixed64_ = 0L; + onChanged(); + return this; + } + + private double fDouble_; + + /** + * double f_double = 12; + * + * @return The fDouble. + */ + @java.lang.Override + public double getFDouble() { + return fDouble_; + } + + /** + * double f_double = 12; + * + * @param value The fDouble to set. + * @return This builder for chaining. + */ + public Builder setFDouble(double value) { + + fDouble_ = value; + bitField0_ |= 0x00000800; + onChanged(); + return this; + } + + /** + * double f_double = 12; + * + * @return This builder for chaining. + */ + public Builder clearFDouble() { + bitField0_ = (bitField0_ & ~0x00000800); + fDouble_ = 0D; + onChanged(); + return this; + } + + private float fFloat_; + + /** + * float f_float = 13; + * + * @return The fFloat. + */ + @java.lang.Override + public float getFFloat() { + return fFloat_; + } + + /** + * float f_float = 13; + * + * @param value The fFloat to set. + * @return This builder for chaining. + */ + public Builder setFFloat(float value) { + + fFloat_ = value; + bitField0_ |= 0x00001000; + onChanged(); + return this; + } + + /** + * float f_float = 13; + * + * @return This builder for chaining. + */ + public Builder clearFFloat() { + bitField0_ = (bitField0_ & ~0x00001000); + fFloat_ = 0F; + onChanged(); + return this; + } + + private boolean fBool_; + + /** + * bool f_bool = 14; + * + * @return The fBool. + */ + @java.lang.Override + public boolean getFBool() { + return fBool_; + } + + /** + * bool f_bool = 14; + * + * @param value The fBool to set. + * @return This builder for chaining. + */ + public Builder setFBool(boolean value) { + + fBool_ = value; + bitField0_ |= 0x00002000; + onChanged(); + return this; + } + + /** + * bool f_bool = 14; + * + * @return This builder for chaining. + */ + public Builder clearFBool() { + bitField0_ = (bitField0_ & ~0x00002000); + fBool_ = false; + onChanged(); + return this; + } + + private com.google.protobuf.ByteString fBytes_ = com.google.protobuf.ByteString.EMPTY; + + /** + * bytes f_bytes = 15; + * + * @return The fBytes. + */ + @java.lang.Override + public com.google.protobuf.ByteString getFBytes() { + return fBytes_; + } + + /** + * bytes f_bytes = 15; + * + * @param value The fBytes to set. + * @return This builder for chaining. + */ + public Builder setFBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + fBytes_ = value; + bitField0_ |= 0x00004000; + onChanged(); + return this; + } + + /** + * bytes f_bytes = 15; + * + * @return This builder for chaining. + */ + public Builder clearFBytes() { + bitField0_ = (bitField0_ & ~0x00004000); + fBytes_ = getDefaultInstance().getFBytes(); + onChanged(); + return this; + } + + private int fKingdom_ = 0; + + /** + * .google.showcase.v1beta1.ComplianceData.LifeKingdom f_kingdom = 22; + * + * @return The enum numeric value on the wire for fKingdom. + */ + @java.lang.Override + public int getFKingdomValue() { + return fKingdom_; + } + + /** + * .google.showcase.v1beta1.ComplianceData.LifeKingdom f_kingdom = 22; + * + * @param value The enum numeric value on the wire for fKingdom to set. + * @return This builder for chaining. + */ + public Builder setFKingdomValue(int value) { + fKingdom_ = value; + bitField0_ |= 0x00008000; + onChanged(); + return this; + } + + /** + * .google.showcase.v1beta1.ComplianceData.LifeKingdom f_kingdom = 22; + * + * @return The fKingdom. + */ + @java.lang.Override + public com.google.showcase.v1beta1.ComplianceData.LifeKingdom getFKingdom() { + com.google.showcase.v1beta1.ComplianceData.LifeKingdom result = + com.google.showcase.v1beta1.ComplianceData.LifeKingdom.forNumber(fKingdom_); + return result == null + ? com.google.showcase.v1beta1.ComplianceData.LifeKingdom.UNRECOGNIZED + : result; + } + + /** + * .google.showcase.v1beta1.ComplianceData.LifeKingdom f_kingdom = 22; + * + * @param value The fKingdom to set. + * @return This builder for chaining. + */ + public Builder setFKingdom(com.google.showcase.v1beta1.ComplianceData.LifeKingdom value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00008000; + fKingdom_ = value.getNumber(); + onChanged(); + return this; + } + + /** + * .google.showcase.v1beta1.ComplianceData.LifeKingdom f_kingdom = 22; + * + * @return This builder for chaining. + */ + public Builder clearFKingdom() { + bitField0_ = (bitField0_ & ~0x00008000); + fKingdom_ = 0; + onChanged(); + return this; + } + + private com.google.showcase.v1beta1.ComplianceDataChild fChild_; + private com.google.protobuf.SingleFieldBuilder< + com.google.showcase.v1beta1.ComplianceDataChild, + com.google.showcase.v1beta1.ComplianceDataChild.Builder, + com.google.showcase.v1beta1.ComplianceDataChildOrBuilder> + fChildBuilder_; + + /** + * .google.showcase.v1beta1.ComplianceDataChild f_child = 16; + * + * @return Whether the fChild field is set. + */ + public boolean hasFChild() { + return ((bitField0_ & 0x00010000) != 0); + } + + /** + * .google.showcase.v1beta1.ComplianceDataChild f_child = 16; + * + * @return The fChild. + */ + public com.google.showcase.v1beta1.ComplianceDataChild getFChild() { + if (fChildBuilder_ == null) { + return fChild_ == null + ? com.google.showcase.v1beta1.ComplianceDataChild.getDefaultInstance() + : fChild_; + } else { + return fChildBuilder_.getMessage(); + } + } + + /** .google.showcase.v1beta1.ComplianceDataChild f_child = 16; */ + public Builder setFChild(com.google.showcase.v1beta1.ComplianceDataChild value) { + if (fChildBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + fChild_ = value; + } else { + fChildBuilder_.setMessage(value); + } + bitField0_ |= 0x00010000; + onChanged(); + return this; + } + + /** .google.showcase.v1beta1.ComplianceDataChild f_child = 16; */ + public Builder setFChild( + com.google.showcase.v1beta1.ComplianceDataChild.Builder builderForValue) { + if (fChildBuilder_ == null) { + fChild_ = builderForValue.build(); + } else { + fChildBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00010000; + onChanged(); + return this; + } + + /** .google.showcase.v1beta1.ComplianceDataChild f_child = 16; */ + public Builder mergeFChild(com.google.showcase.v1beta1.ComplianceDataChild value) { + if (fChildBuilder_ == null) { + if (((bitField0_ & 0x00010000) != 0) + && fChild_ != null + && fChild_ != com.google.showcase.v1beta1.ComplianceDataChild.getDefaultInstance()) { + getFChildBuilder().mergeFrom(value); + } else { + fChild_ = value; + } + } else { + fChildBuilder_.mergeFrom(value); + } + if (fChild_ != null) { + bitField0_ |= 0x00010000; + onChanged(); + } + return this; + } + + /** .google.showcase.v1beta1.ComplianceDataChild f_child = 16; */ + public Builder clearFChild() { + bitField0_ = (bitField0_ & ~0x00010000); + fChild_ = null; + if (fChildBuilder_ != null) { + fChildBuilder_.dispose(); + fChildBuilder_ = null; + } + onChanged(); + return this; + } + + /** .google.showcase.v1beta1.ComplianceDataChild f_child = 16; */ + public com.google.showcase.v1beta1.ComplianceDataChild.Builder getFChildBuilder() { + bitField0_ |= 0x00010000; + onChanged(); + return internalGetFChildFieldBuilder().getBuilder(); + } + + /** .google.showcase.v1beta1.ComplianceDataChild f_child = 16; */ + public com.google.showcase.v1beta1.ComplianceDataChildOrBuilder getFChildOrBuilder() { + if (fChildBuilder_ != null) { + return fChildBuilder_.getMessageOrBuilder(); + } else { + return fChild_ == null + ? com.google.showcase.v1beta1.ComplianceDataChild.getDefaultInstance() + : fChild_; + } + } + + /** .google.showcase.v1beta1.ComplianceDataChild f_child = 16; */ + private com.google.protobuf.SingleFieldBuilder< + com.google.showcase.v1beta1.ComplianceDataChild, + com.google.showcase.v1beta1.ComplianceDataChild.Builder, + com.google.showcase.v1beta1.ComplianceDataChildOrBuilder> + internalGetFChildFieldBuilder() { + if (fChildBuilder_ == null) { + fChildBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.showcase.v1beta1.ComplianceDataChild, + com.google.showcase.v1beta1.ComplianceDataChild.Builder, + com.google.showcase.v1beta1.ComplianceDataChildOrBuilder>( + getFChild(), getParentForChildren(), isClean()); + fChild_ = null; + } + return fChildBuilder_; + } + + private java.lang.Object pString_ = ""; + + /** + * optional string p_string = 17; + * + * @return Whether the pString field is set. + */ + public boolean hasPString() { + return ((bitField0_ & 0x00020000) != 0); + } + + /** + * optional string p_string = 17; + * + * @return The pString. + */ + public java.lang.String getPString() { + java.lang.Object ref = pString_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pString_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * optional string p_string = 17; + * + * @return The bytes for pString. + */ + public com.google.protobuf.ByteString getPStringBytes() { + java.lang.Object ref = pString_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pString_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * optional string p_string = 17; + * + * @param value The pString to set. + * @return This builder for chaining. + */ + public Builder setPString(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + pString_ = value; + bitField0_ |= 0x00020000; + onChanged(); + return this; + } + + /** + * optional string p_string = 17; + * + * @return This builder for chaining. + */ + public Builder clearPString() { + pString_ = getDefaultInstance().getPString(); + bitField0_ = (bitField0_ & ~0x00020000); + onChanged(); + return this; + } + + /** + * optional string p_string = 17; + * + * @param value The bytes for pString to set. + * @return This builder for chaining. + */ + public Builder setPStringBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + pString_ = value; + bitField0_ |= 0x00020000; + onChanged(); + return this; + } + + private int pInt32_; + + /** + * optional int32 p_int32 = 18; + * + * @return Whether the pInt32 field is set. + */ + @java.lang.Override + public boolean hasPInt32() { + return ((bitField0_ & 0x00040000) != 0); + } + + /** + * optional int32 p_int32 = 18; + * + * @return The pInt32. + */ + @java.lang.Override + public int getPInt32() { + return pInt32_; + } + + /** + * optional int32 p_int32 = 18; + * + * @param value The pInt32 to set. + * @return This builder for chaining. + */ + public Builder setPInt32(int value) { + + pInt32_ = value; + bitField0_ |= 0x00040000; + onChanged(); + return this; + } + + /** + * optional int32 p_int32 = 18; + * + * @return This builder for chaining. + */ + public Builder clearPInt32() { + bitField0_ = (bitField0_ & ~0x00040000); + pInt32_ = 0; + onChanged(); + return this; + } + + private double pDouble_; + + /** + * optional double p_double = 19; + * + * @return Whether the pDouble field is set. + */ + @java.lang.Override + public boolean hasPDouble() { + return ((bitField0_ & 0x00080000) != 0); + } + + /** + * optional double p_double = 19; + * + * @return The pDouble. + */ + @java.lang.Override + public double getPDouble() { + return pDouble_; + } + + /** + * optional double p_double = 19; + * + * @param value The pDouble to set. + * @return This builder for chaining. + */ + public Builder setPDouble(double value) { + + pDouble_ = value; + bitField0_ |= 0x00080000; + onChanged(); + return this; + } + + /** + * optional double p_double = 19; + * + * @return This builder for chaining. + */ + public Builder clearPDouble() { + bitField0_ = (bitField0_ & ~0x00080000); + pDouble_ = 0D; + onChanged(); + return this; + } + + private boolean pBool_; + + /** + * optional bool p_bool = 20; + * + * @return Whether the pBool field is set. + */ + @java.lang.Override + public boolean hasPBool() { + return ((bitField0_ & 0x00100000) != 0); + } + + /** + * optional bool p_bool = 20; + * + * @return The pBool. + */ + @java.lang.Override + public boolean getPBool() { + return pBool_; + } + + /** + * optional bool p_bool = 20; + * + * @param value The pBool to set. + * @return This builder for chaining. + */ + public Builder setPBool(boolean value) { + + pBool_ = value; + bitField0_ |= 0x00100000; + onChanged(); + return this; + } + + /** + * optional bool p_bool = 20; + * + * @return This builder for chaining. + */ + public Builder clearPBool() { + bitField0_ = (bitField0_ & ~0x00100000); + pBool_ = false; + onChanged(); + return this; + } + + private int pKingdom_ = 0; + + /** + * optional .google.showcase.v1beta1.ComplianceData.LifeKingdom p_kingdom = 23; + * + * @return Whether the pKingdom field is set. + */ + @java.lang.Override + public boolean hasPKingdom() { + return ((bitField0_ & 0x00200000) != 0); + } + + /** + * optional .google.showcase.v1beta1.ComplianceData.LifeKingdom p_kingdom = 23; + * + * @return The enum numeric value on the wire for pKingdom. + */ + @java.lang.Override + public int getPKingdomValue() { + return pKingdom_; + } + + /** + * optional .google.showcase.v1beta1.ComplianceData.LifeKingdom p_kingdom = 23; + * + * @param value The enum numeric value on the wire for pKingdom to set. + * @return This builder for chaining. + */ + public Builder setPKingdomValue(int value) { + pKingdom_ = value; + bitField0_ |= 0x00200000; + onChanged(); + return this; + } + + /** + * optional .google.showcase.v1beta1.ComplianceData.LifeKingdom p_kingdom = 23; + * + * @return The pKingdom. + */ + @java.lang.Override + public com.google.showcase.v1beta1.ComplianceData.LifeKingdom getPKingdom() { + com.google.showcase.v1beta1.ComplianceData.LifeKingdom result = + com.google.showcase.v1beta1.ComplianceData.LifeKingdom.forNumber(pKingdom_); + return result == null + ? com.google.showcase.v1beta1.ComplianceData.LifeKingdom.UNRECOGNIZED + : result; + } + + /** + * optional .google.showcase.v1beta1.ComplianceData.LifeKingdom p_kingdom = 23; + * + * @param value The pKingdom to set. + * @return This builder for chaining. + */ + public Builder setPKingdom(com.google.showcase.v1beta1.ComplianceData.LifeKingdom value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00200000; + pKingdom_ = value.getNumber(); + onChanged(); + return this; + } + + /** + * optional .google.showcase.v1beta1.ComplianceData.LifeKingdom p_kingdom = 23; + * + * @return This builder for chaining. + */ + public Builder clearPKingdom() { + bitField0_ = (bitField0_ & ~0x00200000); + pKingdom_ = 0; + onChanged(); + return this; + } + + private com.google.showcase.v1beta1.ComplianceDataChild pChild_; + private com.google.protobuf.SingleFieldBuilder< + com.google.showcase.v1beta1.ComplianceDataChild, + com.google.showcase.v1beta1.ComplianceDataChild.Builder, + com.google.showcase.v1beta1.ComplianceDataChildOrBuilder> + pChildBuilder_; + + /** + * optional .google.showcase.v1beta1.ComplianceDataChild p_child = 21; + * + * @return Whether the pChild field is set. + */ + public boolean hasPChild() { + return ((bitField0_ & 0x00400000) != 0); + } + + /** + * optional .google.showcase.v1beta1.ComplianceDataChild p_child = 21; + * + * @return The pChild. + */ + public com.google.showcase.v1beta1.ComplianceDataChild getPChild() { + if (pChildBuilder_ == null) { + return pChild_ == null + ? com.google.showcase.v1beta1.ComplianceDataChild.getDefaultInstance() + : pChild_; + } else { + return pChildBuilder_.getMessage(); + } + } + + /** optional .google.showcase.v1beta1.ComplianceDataChild p_child = 21; */ + public Builder setPChild(com.google.showcase.v1beta1.ComplianceDataChild value) { + if (pChildBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + pChild_ = value; + } else { + pChildBuilder_.setMessage(value); + } + bitField0_ |= 0x00400000; + onChanged(); + return this; + } + + /** optional .google.showcase.v1beta1.ComplianceDataChild p_child = 21; */ + public Builder setPChild( + com.google.showcase.v1beta1.ComplianceDataChild.Builder builderForValue) { + if (pChildBuilder_ == null) { + pChild_ = builderForValue.build(); + } else { + pChildBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00400000; + onChanged(); + return this; + } + + /** optional .google.showcase.v1beta1.ComplianceDataChild p_child = 21; */ + public Builder mergePChild(com.google.showcase.v1beta1.ComplianceDataChild value) { + if (pChildBuilder_ == null) { + if (((bitField0_ & 0x00400000) != 0) + && pChild_ != null + && pChild_ != com.google.showcase.v1beta1.ComplianceDataChild.getDefaultInstance()) { + getPChildBuilder().mergeFrom(value); + } else { + pChild_ = value; + } + } else { + pChildBuilder_.mergeFrom(value); + } + if (pChild_ != null) { + bitField0_ |= 0x00400000; + onChanged(); + } + return this; + } + + /** optional .google.showcase.v1beta1.ComplianceDataChild p_child = 21; */ + public Builder clearPChild() { + bitField0_ = (bitField0_ & ~0x00400000); + pChild_ = null; + if (pChildBuilder_ != null) { + pChildBuilder_.dispose(); + pChildBuilder_ = null; + } + onChanged(); + return this; + } + + /** optional .google.showcase.v1beta1.ComplianceDataChild p_child = 21; */ + public com.google.showcase.v1beta1.ComplianceDataChild.Builder getPChildBuilder() { + bitField0_ |= 0x00400000; + onChanged(); + return internalGetPChildFieldBuilder().getBuilder(); + } + + /** optional .google.showcase.v1beta1.ComplianceDataChild p_child = 21; */ + public com.google.showcase.v1beta1.ComplianceDataChildOrBuilder getPChildOrBuilder() { + if (pChildBuilder_ != null) { + return pChildBuilder_.getMessageOrBuilder(); + } else { + return pChild_ == null + ? com.google.showcase.v1beta1.ComplianceDataChild.getDefaultInstance() + : pChild_; + } + } + + /** optional .google.showcase.v1beta1.ComplianceDataChild p_child = 21; */ + private com.google.protobuf.SingleFieldBuilder< + com.google.showcase.v1beta1.ComplianceDataChild, + com.google.showcase.v1beta1.ComplianceDataChild.Builder, + com.google.showcase.v1beta1.ComplianceDataChildOrBuilder> + internalGetPChildFieldBuilder() { + if (pChildBuilder_ == null) { + pChildBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.showcase.v1beta1.ComplianceDataChild, + com.google.showcase.v1beta1.ComplianceDataChild.Builder, + com.google.showcase.v1beta1.ComplianceDataChildOrBuilder>( + getPChild(), getParentForChildren(), isClean()); + pChild_ = null; + } + return pChildBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.showcase.v1beta1.ComplianceData) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.ComplianceData) + private static final com.google.showcase.v1beta1.ComplianceData DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.ComplianceData(); + } + + public static com.google.showcase.v1beta1.ComplianceData getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ComplianceData 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.showcase.v1beta1.ComplianceData getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ComplianceDataChild.java b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ComplianceDataChild.java new file mode 100644 index 0000000000..2363abca58 --- /dev/null +++ b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ComplianceDataChild.java @@ -0,0 +1,1861 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: schema/google/showcase/v1beta1/compliance.proto +// Protobuf Java Version: 4.33.2 + +package com.google.showcase.v1beta1; + +/** Protobuf type {@code google.showcase.v1beta1.ComplianceDataChild} */ +@com.google.protobuf.Generated +public final class ComplianceDataChild extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.ComplianceDataChild) + ComplianceDataChildOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "ComplianceDataChild"); + } + + // Use ComplianceDataChild.newBuilder() to construct. + private ComplianceDataChild(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private ComplianceDataChild() { + fString_ = ""; + fContinent_ = 0; + pString_ = ""; + pContinent_ = 0; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.ComplianceOuterClass + .internal_static_google_showcase_v1beta1_ComplianceDataChild_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.ComplianceOuterClass + .internal_static_google_showcase_v1beta1_ComplianceDataChild_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.ComplianceDataChild.class, + com.google.showcase.v1beta1.ComplianceDataChild.Builder.class); + } + + private int bitField0_; + public static final int F_STRING_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object fString_ = ""; + + /** + * string f_string = 1; + * + * @return The fString. + */ + @java.lang.Override + public java.lang.String getFString() { + java.lang.Object ref = fString_; + 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(); + fString_ = s; + return s; + } + } + + /** + * string f_string = 1; + * + * @return The bytes for fString. + */ + @java.lang.Override + public com.google.protobuf.ByteString getFStringBytes() { + java.lang.Object ref = fString_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + fString_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int F_FLOAT_FIELD_NUMBER = 2; + private float fFloat_ = 0F; + + /** + * float f_float = 2; + * + * @return The fFloat. + */ + @java.lang.Override + public float getFFloat() { + return fFloat_; + } + + public static final int F_DOUBLE_FIELD_NUMBER = 3; + private double fDouble_ = 0D; + + /** + * double f_double = 3; + * + * @return The fDouble. + */ + @java.lang.Override + public double getFDouble() { + return fDouble_; + } + + public static final int F_BOOL_FIELD_NUMBER = 4; + private boolean fBool_ = false; + + /** + * bool f_bool = 4; + * + * @return The fBool. + */ + @java.lang.Override + public boolean getFBool() { + return fBool_; + } + + public static final int F_CONTINENT_FIELD_NUMBER = 11; + private int fContinent_ = 0; + + /** + * .google.showcase.v1beta1.Continent f_continent = 11; + * + * @return The enum numeric value on the wire for fContinent. + */ + @java.lang.Override + public int getFContinentValue() { + return fContinent_; + } + + /** + * .google.showcase.v1beta1.Continent f_continent = 11; + * + * @return The fContinent. + */ + @java.lang.Override + public com.google.showcase.v1beta1.Continent getFContinent() { + com.google.showcase.v1beta1.Continent result = + com.google.showcase.v1beta1.Continent.forNumber(fContinent_); + return result == null ? com.google.showcase.v1beta1.Continent.UNRECOGNIZED : result; + } + + public static final int F_CHILD_FIELD_NUMBER = 5; + private com.google.showcase.v1beta1.ComplianceDataGrandchild fChild_; + + /** + * .google.showcase.v1beta1.ComplianceDataGrandchild f_child = 5; + * + * @return Whether the fChild field is set. + */ + @java.lang.Override + public boolean hasFChild() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * .google.showcase.v1beta1.ComplianceDataGrandchild f_child = 5; + * + * @return The fChild. + */ + @java.lang.Override + public com.google.showcase.v1beta1.ComplianceDataGrandchild getFChild() { + return fChild_ == null + ? com.google.showcase.v1beta1.ComplianceDataGrandchild.getDefaultInstance() + : fChild_; + } + + /** .google.showcase.v1beta1.ComplianceDataGrandchild f_child = 5; */ + @java.lang.Override + public com.google.showcase.v1beta1.ComplianceDataGrandchildOrBuilder getFChildOrBuilder() { + return fChild_ == null + ? com.google.showcase.v1beta1.ComplianceDataGrandchild.getDefaultInstance() + : fChild_; + } + + public static final int P_STRING_FIELD_NUMBER = 6; + + @SuppressWarnings("serial") + private volatile java.lang.Object pString_ = ""; + + /** + * optional string p_string = 6; + * + * @return Whether the pString field is set. + */ + @java.lang.Override + public boolean hasPString() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * optional string p_string = 6; + * + * @return The pString. + */ + @java.lang.Override + public java.lang.String getPString() { + java.lang.Object ref = pString_; + 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(); + pString_ = s; + return s; + } + } + + /** + * optional string p_string = 6; + * + * @return The bytes for pString. + */ + @java.lang.Override + public com.google.protobuf.ByteString getPStringBytes() { + java.lang.Object ref = pString_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pString_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int P_FLOAT_FIELD_NUMBER = 7; + private float pFloat_ = 0F; + + /** + * optional float p_float = 7; + * + * @return Whether the pFloat field is set. + */ + @java.lang.Override + public boolean hasPFloat() { + return ((bitField0_ & 0x00000004) != 0); + } + + /** + * optional float p_float = 7; + * + * @return The pFloat. + */ + @java.lang.Override + public float getPFloat() { + return pFloat_; + } + + public static final int P_DOUBLE_FIELD_NUMBER = 8; + private double pDouble_ = 0D; + + /** + * optional double p_double = 8; + * + * @return Whether the pDouble field is set. + */ + @java.lang.Override + public boolean hasPDouble() { + return ((bitField0_ & 0x00000008) != 0); + } + + /** + * optional double p_double = 8; + * + * @return The pDouble. + */ + @java.lang.Override + public double getPDouble() { + return pDouble_; + } + + public static final int P_BOOL_FIELD_NUMBER = 9; + private boolean pBool_ = false; + + /** + * optional bool p_bool = 9; + * + * @return Whether the pBool field is set. + */ + @java.lang.Override + public boolean hasPBool() { + return ((bitField0_ & 0x00000010) != 0); + } + + /** + * optional bool p_bool = 9; + * + * @return The pBool. + */ + @java.lang.Override + public boolean getPBool() { + return pBool_; + } + + public static final int P_CONTINENT_FIELD_NUMBER = 12; + private int pContinent_ = 0; + + /** + * .google.showcase.v1beta1.Continent p_continent = 12; + * + * @return The enum numeric value on the wire for pContinent. + */ + @java.lang.Override + public int getPContinentValue() { + return pContinent_; + } + + /** + * .google.showcase.v1beta1.Continent p_continent = 12; + * + * @return The pContinent. + */ + @java.lang.Override + public com.google.showcase.v1beta1.Continent getPContinent() { + com.google.showcase.v1beta1.Continent result = + com.google.showcase.v1beta1.Continent.forNumber(pContinent_); + return result == null ? com.google.showcase.v1beta1.Continent.UNRECOGNIZED : result; + } + + public static final int P_CHILD_FIELD_NUMBER = 10; + private com.google.showcase.v1beta1.ComplianceDataGrandchild pChild_; + + /** + * optional .google.showcase.v1beta1.ComplianceDataGrandchild p_child = 10; + * + * @return Whether the pChild field is set. + */ + @java.lang.Override + public boolean hasPChild() { + return ((bitField0_ & 0x00000020) != 0); + } + + /** + * optional .google.showcase.v1beta1.ComplianceDataGrandchild p_child = 10; + * + * @return The pChild. + */ + @java.lang.Override + public com.google.showcase.v1beta1.ComplianceDataGrandchild getPChild() { + return pChild_ == null + ? com.google.showcase.v1beta1.ComplianceDataGrandchild.getDefaultInstance() + : pChild_; + } + + /** optional .google.showcase.v1beta1.ComplianceDataGrandchild p_child = 10; */ + @java.lang.Override + public com.google.showcase.v1beta1.ComplianceDataGrandchildOrBuilder getPChildOrBuilder() { + return pChild_ == null + ? com.google.showcase.v1beta1.ComplianceDataGrandchild.getDefaultInstance() + : pChild_; + } + + 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.GeneratedMessage.isStringEmpty(fString_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, fString_); + } + if (java.lang.Float.floatToRawIntBits(fFloat_) != 0) { + output.writeFloat(2, fFloat_); + } + if (java.lang.Double.doubleToRawLongBits(fDouble_) != 0) { + output.writeDouble(3, fDouble_); + } + if (fBool_ != false) { + output.writeBool(4, fBool_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(5, getFChild()); + } + if (((bitField0_ & 0x00000002) != 0)) { + com.google.protobuf.GeneratedMessage.writeString(output, 6, pString_); + } + if (((bitField0_ & 0x00000004) != 0)) { + output.writeFloat(7, pFloat_); + } + if (((bitField0_ & 0x00000008) != 0)) { + output.writeDouble(8, pDouble_); + } + if (((bitField0_ & 0x00000010) != 0)) { + output.writeBool(9, pBool_); + } + if (((bitField0_ & 0x00000020) != 0)) { + output.writeMessage(10, getPChild()); + } + if (fContinent_ != com.google.showcase.v1beta1.Continent.CONTINENT_UNSPECIFIED.getNumber()) { + output.writeEnum(11, fContinent_); + } + if (pContinent_ != com.google.showcase.v1beta1.Continent.CONTINENT_UNSPECIFIED.getNumber()) { + output.writeEnum(12, pContinent_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(fString_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, fString_); + } + if (java.lang.Float.floatToRawIntBits(fFloat_) != 0) { + size += com.google.protobuf.CodedOutputStream.computeFloatSize(2, fFloat_); + } + if (java.lang.Double.doubleToRawLongBits(fDouble_) != 0) { + size += com.google.protobuf.CodedOutputStream.computeDoubleSize(3, fDouble_); + } + if (fBool_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(4, fBool_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(5, getFChild()); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(6, pString_); + } + if (((bitField0_ & 0x00000004) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeFloatSize(7, pFloat_); + } + if (((bitField0_ & 0x00000008) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeDoubleSize(8, pDouble_); + } + if (((bitField0_ & 0x00000010) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(9, pBool_); + } + if (((bitField0_ & 0x00000020) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(10, getPChild()); + } + if (fContinent_ != com.google.showcase.v1beta1.Continent.CONTINENT_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(11, fContinent_); + } + if (pContinent_ != com.google.showcase.v1beta1.Continent.CONTINENT_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(12, pContinent_); + } + 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.showcase.v1beta1.ComplianceDataChild)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.ComplianceDataChild other = + (com.google.showcase.v1beta1.ComplianceDataChild) obj; + + if (!getFString().equals(other.getFString())) return false; + if (java.lang.Float.floatToIntBits(getFFloat()) + != java.lang.Float.floatToIntBits(other.getFFloat())) return false; + if (java.lang.Double.doubleToLongBits(getFDouble()) + != java.lang.Double.doubleToLongBits(other.getFDouble())) return false; + if (getFBool() != other.getFBool()) return false; + if (fContinent_ != other.fContinent_) return false; + if (hasFChild() != other.hasFChild()) return false; + if (hasFChild()) { + if (!getFChild().equals(other.getFChild())) return false; + } + if (hasPString() != other.hasPString()) return false; + if (hasPString()) { + if (!getPString().equals(other.getPString())) return false; + } + if (hasPFloat() != other.hasPFloat()) return false; + if (hasPFloat()) { + if (java.lang.Float.floatToIntBits(getPFloat()) + != java.lang.Float.floatToIntBits(other.getPFloat())) return false; + } + if (hasPDouble() != other.hasPDouble()) return false; + if (hasPDouble()) { + if (java.lang.Double.doubleToLongBits(getPDouble()) + != java.lang.Double.doubleToLongBits(other.getPDouble())) return false; + } + if (hasPBool() != other.hasPBool()) return false; + if (hasPBool()) { + if (getPBool() != other.getPBool()) return false; + } + if (pContinent_ != other.pContinent_) return false; + if (hasPChild() != other.hasPChild()) return false; + if (hasPChild()) { + if (!getPChild().equals(other.getPChild())) 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) + F_STRING_FIELD_NUMBER; + hash = (53 * hash) + getFString().hashCode(); + hash = (37 * hash) + F_FLOAT_FIELD_NUMBER; + hash = (53 * hash) + java.lang.Float.floatToIntBits(getFFloat()); + hash = (37 * hash) + F_DOUBLE_FIELD_NUMBER; + hash = + (53 * hash) + + com.google.protobuf.Internal.hashLong( + java.lang.Double.doubleToLongBits(getFDouble())); + hash = (37 * hash) + F_BOOL_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getFBool()); + hash = (37 * hash) + F_CONTINENT_FIELD_NUMBER; + hash = (53 * hash) + fContinent_; + if (hasFChild()) { + hash = (37 * hash) + F_CHILD_FIELD_NUMBER; + hash = (53 * hash) + getFChild().hashCode(); + } + if (hasPString()) { + hash = (37 * hash) + P_STRING_FIELD_NUMBER; + hash = (53 * hash) + getPString().hashCode(); + } + if (hasPFloat()) { + hash = (37 * hash) + P_FLOAT_FIELD_NUMBER; + hash = (53 * hash) + java.lang.Float.floatToIntBits(getPFloat()); + } + if (hasPDouble()) { + hash = (37 * hash) + P_DOUBLE_FIELD_NUMBER; + hash = + (53 * hash) + + com.google.protobuf.Internal.hashLong( + java.lang.Double.doubleToLongBits(getPDouble())); + } + if (hasPBool()) { + hash = (37 * hash) + P_BOOL_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getPBool()); + } + hash = (37 * hash) + P_CONTINENT_FIELD_NUMBER; + hash = (53 * hash) + pContinent_; + if (hasPChild()) { + hash = (37 * hash) + P_CHILD_FIELD_NUMBER; + hash = (53 * hash) + getPChild().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.showcase.v1beta1.ComplianceDataChild parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.ComplianceDataChild parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.ComplianceDataChild parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.ComplianceDataChild 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.showcase.v1beta1.ComplianceDataChild parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.ComplianceDataChild parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.ComplianceDataChild parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.ComplianceDataChild parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.showcase.v1beta1.ComplianceDataChild parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.ComplianceDataChild parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.showcase.v1beta1.ComplianceDataChild parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.ComplianceDataChild parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.showcase.v1beta1.ComplianceDataChild 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** Protobuf type {@code google.showcase.v1beta1.ComplianceDataChild} */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.ComplianceDataChild) + com.google.showcase.v1beta1.ComplianceDataChildOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.ComplianceOuterClass + .internal_static_google_showcase_v1beta1_ComplianceDataChild_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.ComplianceOuterClass + .internal_static_google_showcase_v1beta1_ComplianceDataChild_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.ComplianceDataChild.class, + com.google.showcase.v1beta1.ComplianceDataChild.Builder.class); + } + + // Construct using com.google.showcase.v1beta1.ComplianceDataChild.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetFChildFieldBuilder(); + internalGetPChildFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + fString_ = ""; + fFloat_ = 0F; + fDouble_ = 0D; + fBool_ = false; + fContinent_ = 0; + fChild_ = null; + if (fChildBuilder_ != null) { + fChildBuilder_.dispose(); + fChildBuilder_ = null; + } + pString_ = ""; + pFloat_ = 0F; + pDouble_ = 0D; + pBool_ = false; + pContinent_ = 0; + pChild_ = null; + if (pChildBuilder_ != null) { + pChildBuilder_.dispose(); + pChildBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.showcase.v1beta1.ComplianceOuterClass + .internal_static_google_showcase_v1beta1_ComplianceDataChild_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.ComplianceDataChild getDefaultInstanceForType() { + return com.google.showcase.v1beta1.ComplianceDataChild.getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.ComplianceDataChild build() { + com.google.showcase.v1beta1.ComplianceDataChild result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.ComplianceDataChild buildPartial() { + com.google.showcase.v1beta1.ComplianceDataChild result = + new com.google.showcase.v1beta1.ComplianceDataChild(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.showcase.v1beta1.ComplianceDataChild result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.fString_ = fString_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.fFloat_ = fFloat_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.fDouble_ = fDouble_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.fBool_ = fBool_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.fContinent_ = fContinent_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000020) != 0)) { + result.fChild_ = fChildBuilder_ == null ? fChild_ : fChildBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000040) != 0)) { + result.pString_ = pString_; + to_bitField0_ |= 0x00000002; + } + if (((from_bitField0_ & 0x00000080) != 0)) { + result.pFloat_ = pFloat_; + to_bitField0_ |= 0x00000004; + } + if (((from_bitField0_ & 0x00000100) != 0)) { + result.pDouble_ = pDouble_; + to_bitField0_ |= 0x00000008; + } + if (((from_bitField0_ & 0x00000200) != 0)) { + result.pBool_ = pBool_; + to_bitField0_ |= 0x00000010; + } + if (((from_bitField0_ & 0x00000400) != 0)) { + result.pContinent_ = pContinent_; + } + if (((from_bitField0_ & 0x00000800) != 0)) { + result.pChild_ = pChildBuilder_ == null ? pChild_ : pChildBuilder_.build(); + to_bitField0_ |= 0x00000020; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.showcase.v1beta1.ComplianceDataChild) { + return mergeFrom((com.google.showcase.v1beta1.ComplianceDataChild) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.showcase.v1beta1.ComplianceDataChild other) { + if (other == com.google.showcase.v1beta1.ComplianceDataChild.getDefaultInstance()) + return this; + if (!other.getFString().isEmpty()) { + fString_ = other.fString_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (java.lang.Float.floatToRawIntBits(other.getFFloat()) != 0) { + setFFloat(other.getFFloat()); + } + if (java.lang.Double.doubleToRawLongBits(other.getFDouble()) != 0) { + setFDouble(other.getFDouble()); + } + if (other.getFBool() != false) { + setFBool(other.getFBool()); + } + if (other.fContinent_ != 0) { + setFContinentValue(other.getFContinentValue()); + } + if (other.hasFChild()) { + mergeFChild(other.getFChild()); + } + if (other.hasPString()) { + pString_ = other.pString_; + bitField0_ |= 0x00000040; + onChanged(); + } + if (other.hasPFloat()) { + setPFloat(other.getPFloat()); + } + if (other.hasPDouble()) { + setPDouble(other.getPDouble()); + } + if (other.hasPBool()) { + setPBool(other.getPBool()); + } + if (other.pContinent_ != 0) { + setPContinentValue(other.getPContinentValue()); + } + if (other.hasPChild()) { + mergePChild(other.getPChild()); + } + 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: + { + fString_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 21: + { + fFloat_ = input.readFloat(); + bitField0_ |= 0x00000002; + break; + } // case 21 + case 25: + { + fDouble_ = input.readDouble(); + bitField0_ |= 0x00000004; + break; + } // case 25 + case 32: + { + fBool_ = input.readBool(); + bitField0_ |= 0x00000008; + break; + } // case 32 + case 42: + { + input.readMessage(internalGetFChildFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000020; + break; + } // case 42 + case 50: + { + pString_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000040; + break; + } // case 50 + case 61: + { + pFloat_ = input.readFloat(); + bitField0_ |= 0x00000080; + break; + } // case 61 + case 65: + { + pDouble_ = input.readDouble(); + bitField0_ |= 0x00000100; + break; + } // case 65 + case 72: + { + pBool_ = input.readBool(); + bitField0_ |= 0x00000200; + break; + } // case 72 + case 82: + { + input.readMessage(internalGetPChildFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000800; + break; + } // case 82 + case 88: + { + fContinent_ = input.readEnum(); + bitField0_ |= 0x00000010; + break; + } // case 88 + case 96: + { + pContinent_ = input.readEnum(); + bitField0_ |= 0x00000400; + break; + } // case 96 + 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 fString_ = ""; + + /** + * string f_string = 1; + * + * @return The fString. + */ + public java.lang.String getFString() { + java.lang.Object ref = fString_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + fString_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * string f_string = 1; + * + * @return The bytes for fString. + */ + public com.google.protobuf.ByteString getFStringBytes() { + java.lang.Object ref = fString_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + fString_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * string f_string = 1; + * + * @param value The fString to set. + * @return This builder for chaining. + */ + public Builder setFString(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + fString_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * string f_string = 1; + * + * @return This builder for chaining. + */ + public Builder clearFString() { + fString_ = getDefaultInstance().getFString(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * string f_string = 1; + * + * @param value The bytes for fString to set. + * @return This builder for chaining. + */ + public Builder setFStringBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + fString_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private float fFloat_; + + /** + * float f_float = 2; + * + * @return The fFloat. + */ + @java.lang.Override + public float getFFloat() { + return fFloat_; + } + + /** + * float f_float = 2; + * + * @param value The fFloat to set. + * @return This builder for chaining. + */ + public Builder setFFloat(float value) { + + fFloat_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * float f_float = 2; + * + * @return This builder for chaining. + */ + public Builder clearFFloat() { + bitField0_ = (bitField0_ & ~0x00000002); + fFloat_ = 0F; + onChanged(); + return this; + } + + private double fDouble_; + + /** + * double f_double = 3; + * + * @return The fDouble. + */ + @java.lang.Override + public double getFDouble() { + return fDouble_; + } + + /** + * double f_double = 3; + * + * @param value The fDouble to set. + * @return This builder for chaining. + */ + public Builder setFDouble(double value) { + + fDouble_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * double f_double = 3; + * + * @return This builder for chaining. + */ + public Builder clearFDouble() { + bitField0_ = (bitField0_ & ~0x00000004); + fDouble_ = 0D; + onChanged(); + return this; + } + + private boolean fBool_; + + /** + * bool f_bool = 4; + * + * @return The fBool. + */ + @java.lang.Override + public boolean getFBool() { + return fBool_; + } + + /** + * bool f_bool = 4; + * + * @param value The fBool to set. + * @return This builder for chaining. + */ + public Builder setFBool(boolean value) { + + fBool_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + /** + * bool f_bool = 4; + * + * @return This builder for chaining. + */ + public Builder clearFBool() { + bitField0_ = (bitField0_ & ~0x00000008); + fBool_ = false; + onChanged(); + return this; + } + + private int fContinent_ = 0; + + /** + * .google.showcase.v1beta1.Continent f_continent = 11; + * + * @return The enum numeric value on the wire for fContinent. + */ + @java.lang.Override + public int getFContinentValue() { + return fContinent_; + } + + /** + * .google.showcase.v1beta1.Continent f_continent = 11; + * + * @param value The enum numeric value on the wire for fContinent to set. + * @return This builder for chaining. + */ + public Builder setFContinentValue(int value) { + fContinent_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + /** + * .google.showcase.v1beta1.Continent f_continent = 11; + * + * @return The fContinent. + */ + @java.lang.Override + public com.google.showcase.v1beta1.Continent getFContinent() { + com.google.showcase.v1beta1.Continent result = + com.google.showcase.v1beta1.Continent.forNumber(fContinent_); + return result == null ? com.google.showcase.v1beta1.Continent.UNRECOGNIZED : result; + } + + /** + * .google.showcase.v1beta1.Continent f_continent = 11; + * + * @param value The fContinent to set. + * @return This builder for chaining. + */ + public Builder setFContinent(com.google.showcase.v1beta1.Continent value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000010; + fContinent_ = value.getNumber(); + onChanged(); + return this; + } + + /** + * .google.showcase.v1beta1.Continent f_continent = 11; + * + * @return This builder for chaining. + */ + public Builder clearFContinent() { + bitField0_ = (bitField0_ & ~0x00000010); + fContinent_ = 0; + onChanged(); + return this; + } + + private com.google.showcase.v1beta1.ComplianceDataGrandchild fChild_; + private com.google.protobuf.SingleFieldBuilder< + com.google.showcase.v1beta1.ComplianceDataGrandchild, + com.google.showcase.v1beta1.ComplianceDataGrandchild.Builder, + com.google.showcase.v1beta1.ComplianceDataGrandchildOrBuilder> + fChildBuilder_; + + /** + * .google.showcase.v1beta1.ComplianceDataGrandchild f_child = 5; + * + * @return Whether the fChild field is set. + */ + public boolean hasFChild() { + return ((bitField0_ & 0x00000020) != 0); + } + + /** + * .google.showcase.v1beta1.ComplianceDataGrandchild f_child = 5; + * + * @return The fChild. + */ + public com.google.showcase.v1beta1.ComplianceDataGrandchild getFChild() { + if (fChildBuilder_ == null) { + return fChild_ == null + ? com.google.showcase.v1beta1.ComplianceDataGrandchild.getDefaultInstance() + : fChild_; + } else { + return fChildBuilder_.getMessage(); + } + } + + /** .google.showcase.v1beta1.ComplianceDataGrandchild f_child = 5; */ + public Builder setFChild(com.google.showcase.v1beta1.ComplianceDataGrandchild value) { + if (fChildBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + fChild_ = value; + } else { + fChildBuilder_.setMessage(value); + } + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + + /** .google.showcase.v1beta1.ComplianceDataGrandchild f_child = 5; */ + public Builder setFChild( + com.google.showcase.v1beta1.ComplianceDataGrandchild.Builder builderForValue) { + if (fChildBuilder_ == null) { + fChild_ = builderForValue.build(); + } else { + fChildBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + + /** .google.showcase.v1beta1.ComplianceDataGrandchild f_child = 5; */ + public Builder mergeFChild(com.google.showcase.v1beta1.ComplianceDataGrandchild value) { + if (fChildBuilder_ == null) { + if (((bitField0_ & 0x00000020) != 0) + && fChild_ != null + && fChild_ + != com.google.showcase.v1beta1.ComplianceDataGrandchild.getDefaultInstance()) { + getFChildBuilder().mergeFrom(value); + } else { + fChild_ = value; + } + } else { + fChildBuilder_.mergeFrom(value); + } + if (fChild_ != null) { + bitField0_ |= 0x00000020; + onChanged(); + } + return this; + } + + /** .google.showcase.v1beta1.ComplianceDataGrandchild f_child = 5; */ + public Builder clearFChild() { + bitField0_ = (bitField0_ & ~0x00000020); + fChild_ = null; + if (fChildBuilder_ != null) { + fChildBuilder_.dispose(); + fChildBuilder_ = null; + } + onChanged(); + return this; + } + + /** .google.showcase.v1beta1.ComplianceDataGrandchild f_child = 5; */ + public com.google.showcase.v1beta1.ComplianceDataGrandchild.Builder getFChildBuilder() { + bitField0_ |= 0x00000020; + onChanged(); + return internalGetFChildFieldBuilder().getBuilder(); + } + + /** .google.showcase.v1beta1.ComplianceDataGrandchild f_child = 5; */ + public com.google.showcase.v1beta1.ComplianceDataGrandchildOrBuilder getFChildOrBuilder() { + if (fChildBuilder_ != null) { + return fChildBuilder_.getMessageOrBuilder(); + } else { + return fChild_ == null + ? com.google.showcase.v1beta1.ComplianceDataGrandchild.getDefaultInstance() + : fChild_; + } + } + + /** .google.showcase.v1beta1.ComplianceDataGrandchild f_child = 5; */ + private com.google.protobuf.SingleFieldBuilder< + com.google.showcase.v1beta1.ComplianceDataGrandchild, + com.google.showcase.v1beta1.ComplianceDataGrandchild.Builder, + com.google.showcase.v1beta1.ComplianceDataGrandchildOrBuilder> + internalGetFChildFieldBuilder() { + if (fChildBuilder_ == null) { + fChildBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.showcase.v1beta1.ComplianceDataGrandchild, + com.google.showcase.v1beta1.ComplianceDataGrandchild.Builder, + com.google.showcase.v1beta1.ComplianceDataGrandchildOrBuilder>( + getFChild(), getParentForChildren(), isClean()); + fChild_ = null; + } + return fChildBuilder_; + } + + private java.lang.Object pString_ = ""; + + /** + * optional string p_string = 6; + * + * @return Whether the pString field is set. + */ + public boolean hasPString() { + return ((bitField0_ & 0x00000040) != 0); + } + + /** + * optional string p_string = 6; + * + * @return The pString. + */ + public java.lang.String getPString() { + java.lang.Object ref = pString_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pString_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * optional string p_string = 6; + * + * @return The bytes for pString. + */ + public com.google.protobuf.ByteString getPStringBytes() { + java.lang.Object ref = pString_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pString_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * optional string p_string = 6; + * + * @param value The pString to set. + * @return This builder for chaining. + */ + public Builder setPString(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + pString_ = value; + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + + /** + * optional string p_string = 6; + * + * @return This builder for chaining. + */ + public Builder clearPString() { + pString_ = getDefaultInstance().getPString(); + bitField0_ = (bitField0_ & ~0x00000040); + onChanged(); + return this; + } + + /** + * optional string p_string = 6; + * + * @param value The bytes for pString to set. + * @return This builder for chaining. + */ + public Builder setPStringBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + pString_ = value; + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + + private float pFloat_; + + /** + * optional float p_float = 7; + * + * @return Whether the pFloat field is set. + */ + @java.lang.Override + public boolean hasPFloat() { + return ((bitField0_ & 0x00000080) != 0); + } + + /** + * optional float p_float = 7; + * + * @return The pFloat. + */ + @java.lang.Override + public float getPFloat() { + return pFloat_; + } + + /** + * optional float p_float = 7; + * + * @param value The pFloat to set. + * @return This builder for chaining. + */ + public Builder setPFloat(float value) { + + pFloat_ = value; + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + + /** + * optional float p_float = 7; + * + * @return This builder for chaining. + */ + public Builder clearPFloat() { + bitField0_ = (bitField0_ & ~0x00000080); + pFloat_ = 0F; + onChanged(); + return this; + } + + private double pDouble_; + + /** + * optional double p_double = 8; + * + * @return Whether the pDouble field is set. + */ + @java.lang.Override + public boolean hasPDouble() { + return ((bitField0_ & 0x00000100) != 0); + } + + /** + * optional double p_double = 8; + * + * @return The pDouble. + */ + @java.lang.Override + public double getPDouble() { + return pDouble_; + } + + /** + * optional double p_double = 8; + * + * @param value The pDouble to set. + * @return This builder for chaining. + */ + public Builder setPDouble(double value) { + + pDouble_ = value; + bitField0_ |= 0x00000100; + onChanged(); + return this; + } + + /** + * optional double p_double = 8; + * + * @return This builder for chaining. + */ + public Builder clearPDouble() { + bitField0_ = (bitField0_ & ~0x00000100); + pDouble_ = 0D; + onChanged(); + return this; + } + + private boolean pBool_; + + /** + * optional bool p_bool = 9; + * + * @return Whether the pBool field is set. + */ + @java.lang.Override + public boolean hasPBool() { + return ((bitField0_ & 0x00000200) != 0); + } + + /** + * optional bool p_bool = 9; + * + * @return The pBool. + */ + @java.lang.Override + public boolean getPBool() { + return pBool_; + } + + /** + * optional bool p_bool = 9; + * + * @param value The pBool to set. + * @return This builder for chaining. + */ + public Builder setPBool(boolean value) { + + pBool_ = value; + bitField0_ |= 0x00000200; + onChanged(); + return this; + } + + /** + * optional bool p_bool = 9; + * + * @return This builder for chaining. + */ + public Builder clearPBool() { + bitField0_ = (bitField0_ & ~0x00000200); + pBool_ = false; + onChanged(); + return this; + } + + private int pContinent_ = 0; + + /** + * .google.showcase.v1beta1.Continent p_continent = 12; + * + * @return The enum numeric value on the wire for pContinent. + */ + @java.lang.Override + public int getPContinentValue() { + return pContinent_; + } + + /** + * .google.showcase.v1beta1.Continent p_continent = 12; + * + * @param value The enum numeric value on the wire for pContinent to set. + * @return This builder for chaining. + */ + public Builder setPContinentValue(int value) { + pContinent_ = value; + bitField0_ |= 0x00000400; + onChanged(); + return this; + } + + /** + * .google.showcase.v1beta1.Continent p_continent = 12; + * + * @return The pContinent. + */ + @java.lang.Override + public com.google.showcase.v1beta1.Continent getPContinent() { + com.google.showcase.v1beta1.Continent result = + com.google.showcase.v1beta1.Continent.forNumber(pContinent_); + return result == null ? com.google.showcase.v1beta1.Continent.UNRECOGNIZED : result; + } + + /** + * .google.showcase.v1beta1.Continent p_continent = 12; + * + * @param value The pContinent to set. + * @return This builder for chaining. + */ + public Builder setPContinent(com.google.showcase.v1beta1.Continent value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000400; + pContinent_ = value.getNumber(); + onChanged(); + return this; + } + + /** + * .google.showcase.v1beta1.Continent p_continent = 12; + * + * @return This builder for chaining. + */ + public Builder clearPContinent() { + bitField0_ = (bitField0_ & ~0x00000400); + pContinent_ = 0; + onChanged(); + return this; + } + + private com.google.showcase.v1beta1.ComplianceDataGrandchild pChild_; + private com.google.protobuf.SingleFieldBuilder< + com.google.showcase.v1beta1.ComplianceDataGrandchild, + com.google.showcase.v1beta1.ComplianceDataGrandchild.Builder, + com.google.showcase.v1beta1.ComplianceDataGrandchildOrBuilder> + pChildBuilder_; + + /** + * optional .google.showcase.v1beta1.ComplianceDataGrandchild p_child = 10; + * + * @return Whether the pChild field is set. + */ + public boolean hasPChild() { + return ((bitField0_ & 0x00000800) != 0); + } + + /** + * optional .google.showcase.v1beta1.ComplianceDataGrandchild p_child = 10; + * + * @return The pChild. + */ + public com.google.showcase.v1beta1.ComplianceDataGrandchild getPChild() { + if (pChildBuilder_ == null) { + return pChild_ == null + ? com.google.showcase.v1beta1.ComplianceDataGrandchild.getDefaultInstance() + : pChild_; + } else { + return pChildBuilder_.getMessage(); + } + } + + /** optional .google.showcase.v1beta1.ComplianceDataGrandchild p_child = 10; */ + public Builder setPChild(com.google.showcase.v1beta1.ComplianceDataGrandchild value) { + if (pChildBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + pChild_ = value; + } else { + pChildBuilder_.setMessage(value); + } + bitField0_ |= 0x00000800; + onChanged(); + return this; + } + + /** optional .google.showcase.v1beta1.ComplianceDataGrandchild p_child = 10; */ + public Builder setPChild( + com.google.showcase.v1beta1.ComplianceDataGrandchild.Builder builderForValue) { + if (pChildBuilder_ == null) { + pChild_ = builderForValue.build(); + } else { + pChildBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000800; + onChanged(); + return this; + } + + /** optional .google.showcase.v1beta1.ComplianceDataGrandchild p_child = 10; */ + public Builder mergePChild(com.google.showcase.v1beta1.ComplianceDataGrandchild value) { + if (pChildBuilder_ == null) { + if (((bitField0_ & 0x00000800) != 0) + && pChild_ != null + && pChild_ + != com.google.showcase.v1beta1.ComplianceDataGrandchild.getDefaultInstance()) { + getPChildBuilder().mergeFrom(value); + } else { + pChild_ = value; + } + } else { + pChildBuilder_.mergeFrom(value); + } + if (pChild_ != null) { + bitField0_ |= 0x00000800; + onChanged(); + } + return this; + } + + /** optional .google.showcase.v1beta1.ComplianceDataGrandchild p_child = 10; */ + public Builder clearPChild() { + bitField0_ = (bitField0_ & ~0x00000800); + pChild_ = null; + if (pChildBuilder_ != null) { + pChildBuilder_.dispose(); + pChildBuilder_ = null; + } + onChanged(); + return this; + } + + /** optional .google.showcase.v1beta1.ComplianceDataGrandchild p_child = 10; */ + public com.google.showcase.v1beta1.ComplianceDataGrandchild.Builder getPChildBuilder() { + bitField0_ |= 0x00000800; + onChanged(); + return internalGetPChildFieldBuilder().getBuilder(); + } + + /** optional .google.showcase.v1beta1.ComplianceDataGrandchild p_child = 10; */ + public com.google.showcase.v1beta1.ComplianceDataGrandchildOrBuilder getPChildOrBuilder() { + if (pChildBuilder_ != null) { + return pChildBuilder_.getMessageOrBuilder(); + } else { + return pChild_ == null + ? com.google.showcase.v1beta1.ComplianceDataGrandchild.getDefaultInstance() + : pChild_; + } + } + + /** optional .google.showcase.v1beta1.ComplianceDataGrandchild p_child = 10; */ + private com.google.protobuf.SingleFieldBuilder< + com.google.showcase.v1beta1.ComplianceDataGrandchild, + com.google.showcase.v1beta1.ComplianceDataGrandchild.Builder, + com.google.showcase.v1beta1.ComplianceDataGrandchildOrBuilder> + internalGetPChildFieldBuilder() { + if (pChildBuilder_ == null) { + pChildBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.showcase.v1beta1.ComplianceDataGrandchild, + com.google.showcase.v1beta1.ComplianceDataGrandchild.Builder, + com.google.showcase.v1beta1.ComplianceDataGrandchildOrBuilder>( + getPChild(), getParentForChildren(), isClean()); + pChild_ = null; + } + return pChildBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.showcase.v1beta1.ComplianceDataChild) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.ComplianceDataChild) + private static final com.google.showcase.v1beta1.ComplianceDataChild DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.ComplianceDataChild(); + } + + public static com.google.showcase.v1beta1.ComplianceDataChild getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ComplianceDataChild 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.showcase.v1beta1.ComplianceDataChild getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ComplianceDataChildOrBuilder.java b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ComplianceDataChildOrBuilder.java new file mode 100644 index 0000000000..2555e9c8e3 --- /dev/null +++ b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ComplianceDataChildOrBuilder.java @@ -0,0 +1,188 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: schema/google/showcase/v1beta1/compliance.proto +// Protobuf Java Version: 4.33.2 + +package com.google.showcase.v1beta1; + +@com.google.protobuf.Generated +public interface ComplianceDataChildOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.ComplianceDataChild) + com.google.protobuf.MessageOrBuilder { + + /** + * string f_string = 1; + * + * @return The fString. + */ + java.lang.String getFString(); + + /** + * string f_string = 1; + * + * @return The bytes for fString. + */ + com.google.protobuf.ByteString getFStringBytes(); + + /** + * float f_float = 2; + * + * @return The fFloat. + */ + float getFFloat(); + + /** + * double f_double = 3; + * + * @return The fDouble. + */ + double getFDouble(); + + /** + * bool f_bool = 4; + * + * @return The fBool. + */ + boolean getFBool(); + + /** + * .google.showcase.v1beta1.Continent f_continent = 11; + * + * @return The enum numeric value on the wire for fContinent. + */ + int getFContinentValue(); + + /** + * .google.showcase.v1beta1.Continent f_continent = 11; + * + * @return The fContinent. + */ + com.google.showcase.v1beta1.Continent getFContinent(); + + /** + * .google.showcase.v1beta1.ComplianceDataGrandchild f_child = 5; + * + * @return Whether the fChild field is set. + */ + boolean hasFChild(); + + /** + * .google.showcase.v1beta1.ComplianceDataGrandchild f_child = 5; + * + * @return The fChild. + */ + com.google.showcase.v1beta1.ComplianceDataGrandchild getFChild(); + + /** .google.showcase.v1beta1.ComplianceDataGrandchild f_child = 5; */ + com.google.showcase.v1beta1.ComplianceDataGrandchildOrBuilder getFChildOrBuilder(); + + /** + * optional string p_string = 6; + * + * @return Whether the pString field is set. + */ + boolean hasPString(); + + /** + * optional string p_string = 6; + * + * @return The pString. + */ + java.lang.String getPString(); + + /** + * optional string p_string = 6; + * + * @return The bytes for pString. + */ + com.google.protobuf.ByteString getPStringBytes(); + + /** + * optional float p_float = 7; + * + * @return Whether the pFloat field is set. + */ + boolean hasPFloat(); + + /** + * optional float p_float = 7; + * + * @return The pFloat. + */ + float getPFloat(); + + /** + * optional double p_double = 8; + * + * @return Whether the pDouble field is set. + */ + boolean hasPDouble(); + + /** + * optional double p_double = 8; + * + * @return The pDouble. + */ + double getPDouble(); + + /** + * optional bool p_bool = 9; + * + * @return Whether the pBool field is set. + */ + boolean hasPBool(); + + /** + * optional bool p_bool = 9; + * + * @return The pBool. + */ + boolean getPBool(); + + /** + * .google.showcase.v1beta1.Continent p_continent = 12; + * + * @return The enum numeric value on the wire for pContinent. + */ + int getPContinentValue(); + + /** + * .google.showcase.v1beta1.Continent p_continent = 12; + * + * @return The pContinent. + */ + com.google.showcase.v1beta1.Continent getPContinent(); + + /** + * optional .google.showcase.v1beta1.ComplianceDataGrandchild p_child = 10; + * + * @return Whether the pChild field is set. + */ + boolean hasPChild(); + + /** + * optional .google.showcase.v1beta1.ComplianceDataGrandchild p_child = 10; + * + * @return The pChild. + */ + com.google.showcase.v1beta1.ComplianceDataGrandchild getPChild(); + + /** optional .google.showcase.v1beta1.ComplianceDataGrandchild p_child = 10; */ + com.google.showcase.v1beta1.ComplianceDataGrandchildOrBuilder getPChildOrBuilder(); +} diff --git a/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ComplianceDataGrandchild.java b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ComplianceDataGrandchild.java new file mode 100644 index 0000000000..e2244cfae7 --- /dev/null +++ b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ComplianceDataGrandchild.java @@ -0,0 +1,688 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: schema/google/showcase/v1beta1/compliance.proto +// Protobuf Java Version: 4.33.2 + +package com.google.showcase.v1beta1; + +/** Protobuf type {@code google.showcase.v1beta1.ComplianceDataGrandchild} */ +@com.google.protobuf.Generated +public final class ComplianceDataGrandchild extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.ComplianceDataGrandchild) + ComplianceDataGrandchildOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "ComplianceDataGrandchild"); + } + + // Use ComplianceDataGrandchild.newBuilder() to construct. + private ComplianceDataGrandchild(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private ComplianceDataGrandchild() { + fString_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.ComplianceOuterClass + .internal_static_google_showcase_v1beta1_ComplianceDataGrandchild_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.ComplianceOuterClass + .internal_static_google_showcase_v1beta1_ComplianceDataGrandchild_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.ComplianceDataGrandchild.class, + com.google.showcase.v1beta1.ComplianceDataGrandchild.Builder.class); + } + + public static final int F_STRING_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object fString_ = ""; + + /** + * string f_string = 1; + * + * @return The fString. + */ + @java.lang.Override + public java.lang.String getFString() { + java.lang.Object ref = fString_; + 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(); + fString_ = s; + return s; + } + } + + /** + * string f_string = 1; + * + * @return The bytes for fString. + */ + @java.lang.Override + public com.google.protobuf.ByteString getFStringBytes() { + java.lang.Object ref = fString_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + fString_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int F_DOUBLE_FIELD_NUMBER = 2; + private double fDouble_ = 0D; + + /** + * double f_double = 2; + * + * @return The fDouble. + */ + @java.lang.Override + public double getFDouble() { + return fDouble_; + } + + public static final int F_BOOL_FIELD_NUMBER = 3; + private boolean fBool_ = false; + + /** + * bool f_bool = 3; + * + * @return The fBool. + */ + @java.lang.Override + public boolean getFBool() { + return fBool_; + } + + 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.GeneratedMessage.isStringEmpty(fString_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, fString_); + } + if (java.lang.Double.doubleToRawLongBits(fDouble_) != 0) { + output.writeDouble(2, fDouble_); + } + if (fBool_ != false) { + output.writeBool(3, fBool_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(fString_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, fString_); + } + if (java.lang.Double.doubleToRawLongBits(fDouble_) != 0) { + size += com.google.protobuf.CodedOutputStream.computeDoubleSize(2, fDouble_); + } + if (fBool_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(3, fBool_); + } + 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.showcase.v1beta1.ComplianceDataGrandchild)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.ComplianceDataGrandchild other = + (com.google.showcase.v1beta1.ComplianceDataGrandchild) obj; + + if (!getFString().equals(other.getFString())) return false; + if (java.lang.Double.doubleToLongBits(getFDouble()) + != java.lang.Double.doubleToLongBits(other.getFDouble())) return false; + if (getFBool() != other.getFBool()) 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) + F_STRING_FIELD_NUMBER; + hash = (53 * hash) + getFString().hashCode(); + hash = (37 * hash) + F_DOUBLE_FIELD_NUMBER; + hash = + (53 * hash) + + com.google.protobuf.Internal.hashLong( + java.lang.Double.doubleToLongBits(getFDouble())); + hash = (37 * hash) + F_BOOL_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getFBool()); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.showcase.v1beta1.ComplianceDataGrandchild parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.ComplianceDataGrandchild parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.ComplianceDataGrandchild parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.ComplianceDataGrandchild 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.showcase.v1beta1.ComplianceDataGrandchild parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.ComplianceDataGrandchild parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.ComplianceDataGrandchild parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.ComplianceDataGrandchild parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.showcase.v1beta1.ComplianceDataGrandchild parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.ComplianceDataGrandchild parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.showcase.v1beta1.ComplianceDataGrandchild parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.ComplianceDataGrandchild parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.showcase.v1beta1.ComplianceDataGrandchild 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** Protobuf type {@code google.showcase.v1beta1.ComplianceDataGrandchild} */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.ComplianceDataGrandchild) + com.google.showcase.v1beta1.ComplianceDataGrandchildOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.ComplianceOuterClass + .internal_static_google_showcase_v1beta1_ComplianceDataGrandchild_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.ComplianceOuterClass + .internal_static_google_showcase_v1beta1_ComplianceDataGrandchild_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.ComplianceDataGrandchild.class, + com.google.showcase.v1beta1.ComplianceDataGrandchild.Builder.class); + } + + // Construct using com.google.showcase.v1beta1.ComplianceDataGrandchild.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + fString_ = ""; + fDouble_ = 0D; + fBool_ = false; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.showcase.v1beta1.ComplianceOuterClass + .internal_static_google_showcase_v1beta1_ComplianceDataGrandchild_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.ComplianceDataGrandchild getDefaultInstanceForType() { + return com.google.showcase.v1beta1.ComplianceDataGrandchild.getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.ComplianceDataGrandchild build() { + com.google.showcase.v1beta1.ComplianceDataGrandchild result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.ComplianceDataGrandchild buildPartial() { + com.google.showcase.v1beta1.ComplianceDataGrandchild result = + new com.google.showcase.v1beta1.ComplianceDataGrandchild(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.showcase.v1beta1.ComplianceDataGrandchild result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.fString_ = fString_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.fDouble_ = fDouble_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.fBool_ = fBool_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.showcase.v1beta1.ComplianceDataGrandchild) { + return mergeFrom((com.google.showcase.v1beta1.ComplianceDataGrandchild) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.showcase.v1beta1.ComplianceDataGrandchild other) { + if (other == com.google.showcase.v1beta1.ComplianceDataGrandchild.getDefaultInstance()) + return this; + if (!other.getFString().isEmpty()) { + fString_ = other.fString_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (java.lang.Double.doubleToRawLongBits(other.getFDouble()) != 0) { + setFDouble(other.getFDouble()); + } + if (other.getFBool() != false) { + setFBool(other.getFBool()); + } + 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: + { + fString_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 17: + { + fDouble_ = input.readDouble(); + bitField0_ |= 0x00000002; + break; + } // case 17 + case 24: + { + fBool_ = 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 fString_ = ""; + + /** + * string f_string = 1; + * + * @return The fString. + */ + public java.lang.String getFString() { + java.lang.Object ref = fString_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + fString_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * string f_string = 1; + * + * @return The bytes for fString. + */ + public com.google.protobuf.ByteString getFStringBytes() { + java.lang.Object ref = fString_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + fString_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * string f_string = 1; + * + * @param value The fString to set. + * @return This builder for chaining. + */ + public Builder setFString(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + fString_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * string f_string = 1; + * + * @return This builder for chaining. + */ + public Builder clearFString() { + fString_ = getDefaultInstance().getFString(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * string f_string = 1; + * + * @param value The bytes for fString to set. + * @return This builder for chaining. + */ + public Builder setFStringBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + fString_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private double fDouble_; + + /** + * double f_double = 2; + * + * @return The fDouble. + */ + @java.lang.Override + public double getFDouble() { + return fDouble_; + } + + /** + * double f_double = 2; + * + * @param value The fDouble to set. + * @return This builder for chaining. + */ + public Builder setFDouble(double value) { + + fDouble_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * double f_double = 2; + * + * @return This builder for chaining. + */ + public Builder clearFDouble() { + bitField0_ = (bitField0_ & ~0x00000002); + fDouble_ = 0D; + onChanged(); + return this; + } + + private boolean fBool_; + + /** + * bool f_bool = 3; + * + * @return The fBool. + */ + @java.lang.Override + public boolean getFBool() { + return fBool_; + } + + /** + * bool f_bool = 3; + * + * @param value The fBool to set. + * @return This builder for chaining. + */ + public Builder setFBool(boolean value) { + + fBool_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * bool f_bool = 3; + * + * @return This builder for chaining. + */ + public Builder clearFBool() { + bitField0_ = (bitField0_ & ~0x00000004); + fBool_ = false; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.showcase.v1beta1.ComplianceDataGrandchild) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.ComplianceDataGrandchild) + private static final com.google.showcase.v1beta1.ComplianceDataGrandchild DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.ComplianceDataGrandchild(); + } + + public static com.google.showcase.v1beta1.ComplianceDataGrandchild getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ComplianceDataGrandchild 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.showcase.v1beta1.ComplianceDataGrandchild getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ComplianceDataGrandchildOrBuilder.java b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ComplianceDataGrandchildOrBuilder.java new file mode 100644 index 0000000000..ce25f57912 --- /dev/null +++ b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ComplianceDataGrandchildOrBuilder.java @@ -0,0 +1,56 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: schema/google/showcase/v1beta1/compliance.proto +// Protobuf Java Version: 4.33.2 + +package com.google.showcase.v1beta1; + +@com.google.protobuf.Generated +public interface ComplianceDataGrandchildOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.ComplianceDataGrandchild) + com.google.protobuf.MessageOrBuilder { + + /** + * string f_string = 1; + * + * @return The fString. + */ + java.lang.String getFString(); + + /** + * string f_string = 1; + * + * @return The bytes for fString. + */ + com.google.protobuf.ByteString getFStringBytes(); + + /** + * double f_double = 2; + * + * @return The fDouble. + */ + double getFDouble(); + + /** + * bool f_bool = 3; + * + * @return The fBool. + */ + boolean getFBool(); +} diff --git a/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ComplianceDataOrBuilder.java b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ComplianceDataOrBuilder.java new file mode 100644 index 0000000000..e60610462c --- /dev/null +++ b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ComplianceDataOrBuilder.java @@ -0,0 +1,272 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: schema/google/showcase/v1beta1/compliance.proto +// Protobuf Java Version: 4.33.2 + +package com.google.showcase.v1beta1; + +@com.google.protobuf.Generated +public interface ComplianceDataOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.ComplianceData) + com.google.protobuf.MessageOrBuilder { + + /** + * string f_string = 1; + * + * @return The fString. + */ + java.lang.String getFString(); + + /** + * string f_string = 1; + * + * @return The bytes for fString. + */ + com.google.protobuf.ByteString getFStringBytes(); + + /** + * int32 f_int32 = 2; + * + * @return The fInt32. + */ + int getFInt32(); + + /** + * sint32 f_sint32 = 3; + * + * @return The fSint32. + */ + int getFSint32(); + + /** + * sfixed32 f_sfixed32 = 4; + * + * @return The fSfixed32. + */ + int getFSfixed32(); + + /** + * uint32 f_uint32 = 5; + * + * @return The fUint32. + */ + int getFUint32(); + + /** + * fixed32 f_fixed32 = 6; + * + * @return The fFixed32. + */ + int getFFixed32(); + + /** + * int64 f_int64 = 7; + * + * @return The fInt64. + */ + long getFInt64(); + + /** + * sint64 f_sint64 = 8; + * + * @return The fSint64. + */ + long getFSint64(); + + /** + * sfixed64 f_sfixed64 = 9; + * + * @return The fSfixed64. + */ + long getFSfixed64(); + + /** + * uint64 f_uint64 = 10; + * + * @return The fUint64. + */ + long getFUint64(); + + /** + * fixed64 f_fixed64 = 11; + * + * @return The fFixed64. + */ + long getFFixed64(); + + /** + * double f_double = 12; + * + * @return The fDouble. + */ + double getFDouble(); + + /** + * float f_float = 13; + * + * @return The fFloat. + */ + float getFFloat(); + + /** + * bool f_bool = 14; + * + * @return The fBool. + */ + boolean getFBool(); + + /** + * bytes f_bytes = 15; + * + * @return The fBytes. + */ + com.google.protobuf.ByteString getFBytes(); + + /** + * .google.showcase.v1beta1.ComplianceData.LifeKingdom f_kingdom = 22; + * + * @return The enum numeric value on the wire for fKingdom. + */ + int getFKingdomValue(); + + /** + * .google.showcase.v1beta1.ComplianceData.LifeKingdom f_kingdom = 22; + * + * @return The fKingdom. + */ + com.google.showcase.v1beta1.ComplianceData.LifeKingdom getFKingdom(); + + /** + * .google.showcase.v1beta1.ComplianceDataChild f_child = 16; + * + * @return Whether the fChild field is set. + */ + boolean hasFChild(); + + /** + * .google.showcase.v1beta1.ComplianceDataChild f_child = 16; + * + * @return The fChild. + */ + com.google.showcase.v1beta1.ComplianceDataChild getFChild(); + + /** .google.showcase.v1beta1.ComplianceDataChild f_child = 16; */ + com.google.showcase.v1beta1.ComplianceDataChildOrBuilder getFChildOrBuilder(); + + /** + * optional string p_string = 17; + * + * @return Whether the pString field is set. + */ + boolean hasPString(); + + /** + * optional string p_string = 17; + * + * @return The pString. + */ + java.lang.String getPString(); + + /** + * optional string p_string = 17; + * + * @return The bytes for pString. + */ + com.google.protobuf.ByteString getPStringBytes(); + + /** + * optional int32 p_int32 = 18; + * + * @return Whether the pInt32 field is set. + */ + boolean hasPInt32(); + + /** + * optional int32 p_int32 = 18; + * + * @return The pInt32. + */ + int getPInt32(); + + /** + * optional double p_double = 19; + * + * @return Whether the pDouble field is set. + */ + boolean hasPDouble(); + + /** + * optional double p_double = 19; + * + * @return The pDouble. + */ + double getPDouble(); + + /** + * optional bool p_bool = 20; + * + * @return Whether the pBool field is set. + */ + boolean hasPBool(); + + /** + * optional bool p_bool = 20; + * + * @return The pBool. + */ + boolean getPBool(); + + /** + * optional .google.showcase.v1beta1.ComplianceData.LifeKingdom p_kingdom = 23; + * + * @return Whether the pKingdom field is set. + */ + boolean hasPKingdom(); + + /** + * optional .google.showcase.v1beta1.ComplianceData.LifeKingdom p_kingdom = 23; + * + * @return The enum numeric value on the wire for pKingdom. + */ + int getPKingdomValue(); + + /** + * optional .google.showcase.v1beta1.ComplianceData.LifeKingdom p_kingdom = 23; + * + * @return The pKingdom. + */ + com.google.showcase.v1beta1.ComplianceData.LifeKingdom getPKingdom(); + + /** + * optional .google.showcase.v1beta1.ComplianceDataChild p_child = 21; + * + * @return Whether the pChild field is set. + */ + boolean hasPChild(); + + /** + * optional .google.showcase.v1beta1.ComplianceDataChild p_child = 21; + * + * @return The pChild. + */ + com.google.showcase.v1beta1.ComplianceDataChild getPChild(); + + /** optional .google.showcase.v1beta1.ComplianceDataChild p_child = 21; */ + com.google.showcase.v1beta1.ComplianceDataChildOrBuilder getPChildOrBuilder(); +} diff --git a/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ComplianceGroup.java b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ComplianceGroup.java new file mode 100644 index 0000000000..5c986710f0 --- /dev/null +++ b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ComplianceGroup.java @@ -0,0 +1,1099 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: schema/google/showcase/v1beta1/compliance.proto +// Protobuf Java Version: 4.33.2 + +package com.google.showcase.v1beta1; + +/** + * + * + *
        + * ComplianceGroups encapsulates a group of RPC requests to the Compliance
        + * server: one request for each combination of elements of `rpcs` and of
        + * `requests`.
        + * 
        + * + * Protobuf type {@code google.showcase.v1beta1.ComplianceGroup} + */ +@com.google.protobuf.Generated +public final class ComplianceGroup extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.ComplianceGroup) + ComplianceGroupOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "ComplianceGroup"); + } + + // Use ComplianceGroup.newBuilder() to construct. + private ComplianceGroup(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private ComplianceGroup() { + name_ = ""; + rpcs_ = com.google.protobuf.LazyStringArrayList.emptyList(); + requests_ = java.util.Collections.emptyList(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.ComplianceOuterClass + .internal_static_google_showcase_v1beta1_ComplianceGroup_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.ComplianceOuterClass + .internal_static_google_showcase_v1beta1_ComplianceGroup_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.ComplianceGroup.class, + com.google.showcase.v1beta1.ComplianceGroup.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + + /** + * 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; + } + } + + /** + * 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 RPCS_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private com.google.protobuf.LazyStringArrayList rpcs_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + + /** + * repeated string rpcs = 2; + * + * @return A list containing the rpcs. + */ + public com.google.protobuf.ProtocolStringList getRpcsList() { + return rpcs_; + } + + /** + * repeated string rpcs = 2; + * + * @return The count of rpcs. + */ + public int getRpcsCount() { + return rpcs_.size(); + } + + /** + * repeated string rpcs = 2; + * + * @param index The index of the element to return. + * @return The rpcs at the given index. + */ + public java.lang.String getRpcs(int index) { + return rpcs_.get(index); + } + + /** + * repeated string rpcs = 2; + * + * @param index The index of the value to return. + * @return The bytes of the rpcs at the given index. + */ + public com.google.protobuf.ByteString getRpcsBytes(int index) { + return rpcs_.getByteString(index); + } + + public static final int REQUESTS_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private java.util.List requests_; + + /** repeated .google.showcase.v1beta1.RepeatRequest requests = 3; */ + @java.lang.Override + public java.util.List getRequestsList() { + return requests_; + } + + /** repeated .google.showcase.v1beta1.RepeatRequest requests = 3; */ + @java.lang.Override + public java.util.List + getRequestsOrBuilderList() { + return requests_; + } + + /** repeated .google.showcase.v1beta1.RepeatRequest requests = 3; */ + @java.lang.Override + public int getRequestsCount() { + return requests_.size(); + } + + /** repeated .google.showcase.v1beta1.RepeatRequest requests = 3; */ + @java.lang.Override + public com.google.showcase.v1beta1.RepeatRequest getRequests(int index) { + return requests_.get(index); + } + + /** repeated .google.showcase.v1beta1.RepeatRequest requests = 3; */ + @java.lang.Override + public com.google.showcase.v1beta1.RepeatRequestOrBuilder getRequestsOrBuilder(int index) { + return requests_.get(index); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, name_); + } + for (int i = 0; i < rpcs_.size(); i++) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, rpcs_.getRaw(i)); + } + for (int i = 0; i < requests_.size(); i++) { + output.writeMessage(3, requests_.get(i)); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, name_); + } + { + int dataSize = 0; + for (int i = 0; i < rpcs_.size(); i++) { + dataSize += computeStringSizeNoTag(rpcs_.getRaw(i)); + } + size += dataSize; + size += 1 * getRpcsList().size(); + } + for (int i = 0; i < requests_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, requests_.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.showcase.v1beta1.ComplianceGroup)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.ComplianceGroup other = + (com.google.showcase.v1beta1.ComplianceGroup) obj; + + if (!getName().equals(other.getName())) return false; + if (!getRpcsList().equals(other.getRpcsList())) return false; + if (!getRequestsList().equals(other.getRequestsList())) 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 (getRpcsCount() > 0) { + hash = (37 * hash) + RPCS_FIELD_NUMBER; + hash = (53 * hash) + getRpcsList().hashCode(); + } + if (getRequestsCount() > 0) { + hash = (37 * hash) + REQUESTS_FIELD_NUMBER; + hash = (53 * hash) + getRequestsList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.showcase.v1beta1.ComplianceGroup parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.ComplianceGroup parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.ComplianceGroup parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.ComplianceGroup 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.showcase.v1beta1.ComplianceGroup parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.ComplianceGroup parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.ComplianceGroup parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.ComplianceGroup parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.showcase.v1beta1.ComplianceGroup parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.ComplianceGroup parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.showcase.v1beta1.ComplianceGroup parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.ComplianceGroup parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.showcase.v1beta1.ComplianceGroup 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
        +   * ComplianceGroups encapsulates a group of RPC requests to the Compliance
        +   * server: one request for each combination of elements of `rpcs` and of
        +   * `requests`.
        +   * 
        + * + * Protobuf type {@code google.showcase.v1beta1.ComplianceGroup} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.ComplianceGroup) + com.google.showcase.v1beta1.ComplianceGroupOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.ComplianceOuterClass + .internal_static_google_showcase_v1beta1_ComplianceGroup_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.ComplianceOuterClass + .internal_static_google_showcase_v1beta1_ComplianceGroup_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.ComplianceGroup.class, + com.google.showcase.v1beta1.ComplianceGroup.Builder.class); + } + + // Construct using com.google.showcase.v1beta1.ComplianceGroup.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + rpcs_ = com.google.protobuf.LazyStringArrayList.emptyList(); + if (requestsBuilder_ == null) { + requests_ = java.util.Collections.emptyList(); + } else { + requests_ = null; + requestsBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000004); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.showcase.v1beta1.ComplianceOuterClass + .internal_static_google_showcase_v1beta1_ComplianceGroup_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.ComplianceGroup getDefaultInstanceForType() { + return com.google.showcase.v1beta1.ComplianceGroup.getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.ComplianceGroup build() { + com.google.showcase.v1beta1.ComplianceGroup result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.ComplianceGroup buildPartial() { + com.google.showcase.v1beta1.ComplianceGroup result = + new com.google.showcase.v1beta1.ComplianceGroup(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields(com.google.showcase.v1beta1.ComplianceGroup result) { + if (requestsBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0)) { + requests_ = java.util.Collections.unmodifiableList(requests_); + bitField0_ = (bitField0_ & ~0x00000004); + } + result.requests_ = requests_; + } else { + result.requests_ = requestsBuilder_.build(); + } + } + + private void buildPartial0(com.google.showcase.v1beta1.ComplianceGroup result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + rpcs_.makeImmutable(); + result.rpcs_ = rpcs_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.showcase.v1beta1.ComplianceGroup) { + return mergeFrom((com.google.showcase.v1beta1.ComplianceGroup) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.showcase.v1beta1.ComplianceGroup other) { + if (other == com.google.showcase.v1beta1.ComplianceGroup.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.rpcs_.isEmpty()) { + if (rpcs_.isEmpty()) { + rpcs_ = other.rpcs_; + bitField0_ |= 0x00000002; + } else { + ensureRpcsIsMutable(); + rpcs_.addAll(other.rpcs_); + } + onChanged(); + } + if (requestsBuilder_ == null) { + if (!other.requests_.isEmpty()) { + if (requests_.isEmpty()) { + requests_ = other.requests_; + bitField0_ = (bitField0_ & ~0x00000004); + } else { + ensureRequestsIsMutable(); + requests_.addAll(other.requests_); + } + onChanged(); + } + } else { + if (!other.requests_.isEmpty()) { + if (requestsBuilder_.isEmpty()) { + requestsBuilder_.dispose(); + requestsBuilder_ = null; + requests_ = other.requests_; + bitField0_ = (bitField0_ & ~0x00000004); + requestsBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders + ? internalGetRequestsFieldBuilder() + : null; + } else { + requestsBuilder_.addAllMessages(other.requests_); + } + } + } + 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: + { + java.lang.String s = input.readStringRequireUtf8(); + ensureRpcsIsMutable(); + rpcs_.add(s); + break; + } // case 18 + case 26: + { + com.google.showcase.v1beta1.RepeatRequest m = + input.readMessage( + com.google.showcase.v1beta1.RepeatRequest.parser(), extensionRegistry); + if (requestsBuilder_ == null) { + ensureRequestsIsMutable(); + requests_.add(m); + } else { + requestsBuilder_.addMessage(m); + } + 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_ = ""; + + /** + * 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; + } + } + + /** + * 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; + } + } + + /** + * 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; + } + + /** + * string name = 1; + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * 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 com.google.protobuf.LazyStringArrayList rpcs_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + + private void ensureRpcsIsMutable() { + if (!rpcs_.isModifiable()) { + rpcs_ = new com.google.protobuf.LazyStringArrayList(rpcs_); + } + bitField0_ |= 0x00000002; + } + + /** + * repeated string rpcs = 2; + * + * @return A list containing the rpcs. + */ + public com.google.protobuf.ProtocolStringList getRpcsList() { + rpcs_.makeImmutable(); + return rpcs_; + } + + /** + * repeated string rpcs = 2; + * + * @return The count of rpcs. + */ + public int getRpcsCount() { + return rpcs_.size(); + } + + /** + * repeated string rpcs = 2; + * + * @param index The index of the element to return. + * @return The rpcs at the given index. + */ + public java.lang.String getRpcs(int index) { + return rpcs_.get(index); + } + + /** + * repeated string rpcs = 2; + * + * @param index The index of the value to return. + * @return The bytes of the rpcs at the given index. + */ + public com.google.protobuf.ByteString getRpcsBytes(int index) { + return rpcs_.getByteString(index); + } + + /** + * repeated string rpcs = 2; + * + * @param index The index to set the value at. + * @param value The rpcs to set. + * @return This builder for chaining. + */ + public Builder setRpcs(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureRpcsIsMutable(); + rpcs_.set(index, value); + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * repeated string rpcs = 2; + * + * @param value The rpcs to add. + * @return This builder for chaining. + */ + public Builder addRpcs(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureRpcsIsMutable(); + rpcs_.add(value); + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * repeated string rpcs = 2; + * + * @param values The rpcs to add. + * @return This builder for chaining. + */ + public Builder addAllRpcs(java.lang.Iterable values) { + ensureRpcsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, rpcs_); + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * repeated string rpcs = 2; + * + * @return This builder for chaining. + */ + public Builder clearRpcs() { + rpcs_ = com.google.protobuf.LazyStringArrayList.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + ; + onChanged(); + return this; + } + + /** + * repeated string rpcs = 2; + * + * @param value The bytes of the rpcs to add. + * @return This builder for chaining. + */ + public Builder addRpcsBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureRpcsIsMutable(); + rpcs_.add(value); + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private java.util.List requests_ = + java.util.Collections.emptyList(); + + private void ensureRequestsIsMutable() { + if (!((bitField0_ & 0x00000004) != 0)) { + requests_ = new java.util.ArrayList(requests_); + bitField0_ |= 0x00000004; + } + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.google.showcase.v1beta1.RepeatRequest, + com.google.showcase.v1beta1.RepeatRequest.Builder, + com.google.showcase.v1beta1.RepeatRequestOrBuilder> + requestsBuilder_; + + /** repeated .google.showcase.v1beta1.RepeatRequest requests = 3; */ + public java.util.List getRequestsList() { + if (requestsBuilder_ == null) { + return java.util.Collections.unmodifiableList(requests_); + } else { + return requestsBuilder_.getMessageList(); + } + } + + /** repeated .google.showcase.v1beta1.RepeatRequest requests = 3; */ + public int getRequestsCount() { + if (requestsBuilder_ == null) { + return requests_.size(); + } else { + return requestsBuilder_.getCount(); + } + } + + /** repeated .google.showcase.v1beta1.RepeatRequest requests = 3; */ + public com.google.showcase.v1beta1.RepeatRequest getRequests(int index) { + if (requestsBuilder_ == null) { + return requests_.get(index); + } else { + return requestsBuilder_.getMessage(index); + } + } + + /** repeated .google.showcase.v1beta1.RepeatRequest requests = 3; */ + public Builder setRequests(int index, com.google.showcase.v1beta1.RepeatRequest value) { + if (requestsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureRequestsIsMutable(); + requests_.set(index, value); + onChanged(); + } else { + requestsBuilder_.setMessage(index, value); + } + return this; + } + + /** repeated .google.showcase.v1beta1.RepeatRequest requests = 3; */ + public Builder setRequests( + int index, com.google.showcase.v1beta1.RepeatRequest.Builder builderForValue) { + if (requestsBuilder_ == null) { + ensureRequestsIsMutable(); + requests_.set(index, builderForValue.build()); + onChanged(); + } else { + requestsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + + /** repeated .google.showcase.v1beta1.RepeatRequest requests = 3; */ + public Builder addRequests(com.google.showcase.v1beta1.RepeatRequest value) { + if (requestsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureRequestsIsMutable(); + requests_.add(value); + onChanged(); + } else { + requestsBuilder_.addMessage(value); + } + return this; + } + + /** repeated .google.showcase.v1beta1.RepeatRequest requests = 3; */ + public Builder addRequests(int index, com.google.showcase.v1beta1.RepeatRequest value) { + if (requestsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureRequestsIsMutable(); + requests_.add(index, value); + onChanged(); + } else { + requestsBuilder_.addMessage(index, value); + } + return this; + } + + /** repeated .google.showcase.v1beta1.RepeatRequest requests = 3; */ + public Builder addRequests(com.google.showcase.v1beta1.RepeatRequest.Builder builderForValue) { + if (requestsBuilder_ == null) { + ensureRequestsIsMutable(); + requests_.add(builderForValue.build()); + onChanged(); + } else { + requestsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + + /** repeated .google.showcase.v1beta1.RepeatRequest requests = 3; */ + public Builder addRequests( + int index, com.google.showcase.v1beta1.RepeatRequest.Builder builderForValue) { + if (requestsBuilder_ == null) { + ensureRequestsIsMutable(); + requests_.add(index, builderForValue.build()); + onChanged(); + } else { + requestsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + + /** repeated .google.showcase.v1beta1.RepeatRequest requests = 3; */ + public Builder addAllRequests( + java.lang.Iterable values) { + if (requestsBuilder_ == null) { + ensureRequestsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, requests_); + onChanged(); + } else { + requestsBuilder_.addAllMessages(values); + } + return this; + } + + /** repeated .google.showcase.v1beta1.RepeatRequest requests = 3; */ + public Builder clearRequests() { + if (requestsBuilder_ == null) { + requests_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + } else { + requestsBuilder_.clear(); + } + return this; + } + + /** repeated .google.showcase.v1beta1.RepeatRequest requests = 3; */ + public Builder removeRequests(int index) { + if (requestsBuilder_ == null) { + ensureRequestsIsMutable(); + requests_.remove(index); + onChanged(); + } else { + requestsBuilder_.remove(index); + } + return this; + } + + /** repeated .google.showcase.v1beta1.RepeatRequest requests = 3; */ + public com.google.showcase.v1beta1.RepeatRequest.Builder getRequestsBuilder(int index) { + return internalGetRequestsFieldBuilder().getBuilder(index); + } + + /** repeated .google.showcase.v1beta1.RepeatRequest requests = 3; */ + public com.google.showcase.v1beta1.RepeatRequestOrBuilder getRequestsOrBuilder(int index) { + if (requestsBuilder_ == null) { + return requests_.get(index); + } else { + return requestsBuilder_.getMessageOrBuilder(index); + } + } + + /** repeated .google.showcase.v1beta1.RepeatRequest requests = 3; */ + public java.util.List + getRequestsOrBuilderList() { + if (requestsBuilder_ != null) { + return requestsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(requests_); + } + } + + /** repeated .google.showcase.v1beta1.RepeatRequest requests = 3; */ + public com.google.showcase.v1beta1.RepeatRequest.Builder addRequestsBuilder() { + return internalGetRequestsFieldBuilder() + .addBuilder(com.google.showcase.v1beta1.RepeatRequest.getDefaultInstance()); + } + + /** repeated .google.showcase.v1beta1.RepeatRequest requests = 3; */ + public com.google.showcase.v1beta1.RepeatRequest.Builder addRequestsBuilder(int index) { + return internalGetRequestsFieldBuilder() + .addBuilder(index, com.google.showcase.v1beta1.RepeatRequest.getDefaultInstance()); + } + + /** repeated .google.showcase.v1beta1.RepeatRequest requests = 3; */ + public java.util.List + getRequestsBuilderList() { + return internalGetRequestsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.google.showcase.v1beta1.RepeatRequest, + com.google.showcase.v1beta1.RepeatRequest.Builder, + com.google.showcase.v1beta1.RepeatRequestOrBuilder> + internalGetRequestsFieldBuilder() { + if (requestsBuilder_ == null) { + requestsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilder< + com.google.showcase.v1beta1.RepeatRequest, + com.google.showcase.v1beta1.RepeatRequest.Builder, + com.google.showcase.v1beta1.RepeatRequestOrBuilder>( + requests_, ((bitField0_ & 0x00000004) != 0), getParentForChildren(), isClean()); + requests_ = null; + } + return requestsBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.showcase.v1beta1.ComplianceGroup) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.ComplianceGroup) + private static final com.google.showcase.v1beta1.ComplianceGroup DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.ComplianceGroup(); + } + + public static com.google.showcase.v1beta1.ComplianceGroup getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ComplianceGroup 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.showcase.v1beta1.ComplianceGroup getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ComplianceGroupOrBuilder.java b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ComplianceGroupOrBuilder.java new file mode 100644 index 0000000000..273ef4f0c3 --- /dev/null +++ b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ComplianceGroupOrBuilder.java @@ -0,0 +1,88 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: schema/google/showcase/v1beta1/compliance.proto +// Protobuf Java Version: 4.33.2 + +package com.google.showcase.v1beta1; + +@com.google.protobuf.Generated +public interface ComplianceGroupOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.ComplianceGroup) + com.google.protobuf.MessageOrBuilder { + + /** + * string name = 1; + * + * @return The name. + */ + java.lang.String getName(); + + /** + * string name = 1; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * repeated string rpcs = 2; + * + * @return A list containing the rpcs. + */ + java.util.List getRpcsList(); + + /** + * repeated string rpcs = 2; + * + * @return The count of rpcs. + */ + int getRpcsCount(); + + /** + * repeated string rpcs = 2; + * + * @param index The index of the element to return. + * @return The rpcs at the given index. + */ + java.lang.String getRpcs(int index); + + /** + * repeated string rpcs = 2; + * + * @param index The index of the value to return. + * @return The bytes of the rpcs at the given index. + */ + com.google.protobuf.ByteString getRpcsBytes(int index); + + /** repeated .google.showcase.v1beta1.RepeatRequest requests = 3; */ + java.util.List getRequestsList(); + + /** repeated .google.showcase.v1beta1.RepeatRequest requests = 3; */ + com.google.showcase.v1beta1.RepeatRequest getRequests(int index); + + /** repeated .google.showcase.v1beta1.RepeatRequest requests = 3; */ + int getRequestsCount(); + + /** repeated .google.showcase.v1beta1.RepeatRequest requests = 3; */ + java.util.List + getRequestsOrBuilderList(); + + /** repeated .google.showcase.v1beta1.RepeatRequest requests = 3; */ + com.google.showcase.v1beta1.RepeatRequestOrBuilder getRequestsOrBuilder(int index); +} diff --git a/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ComplianceOuterClass.java b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ComplianceOuterClass.java new file mode 100644 index 0000000000..3bbb7794aa --- /dev/null +++ b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ComplianceOuterClass.java @@ -0,0 +1,369 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: schema/google/showcase/v1beta1/compliance.proto +// Protobuf Java Version: 4.33.2 + +package com.google.showcase.v1beta1; + +@com.google.protobuf.Generated +public final class ComplianceOuterClass extends com.google.protobuf.GeneratedFile { + private ComplianceOuterClass() {} + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "ComplianceOuterClass"); + } + + 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_showcase_v1beta1_RepeatRequest_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_showcase_v1beta1_RepeatRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_showcase_v1beta1_RepeatResponse_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_showcase_v1beta1_RepeatResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_showcase_v1beta1_ComplianceSuite_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_showcase_v1beta1_ComplianceSuite_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_showcase_v1beta1_ComplianceGroup_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_showcase_v1beta1_ComplianceGroup_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_showcase_v1beta1_ComplianceData_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_showcase_v1beta1_ComplianceData_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_showcase_v1beta1_ComplianceDataChild_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_showcase_v1beta1_ComplianceDataChild_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_showcase_v1beta1_ComplianceDataGrandchild_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_showcase_v1beta1_ComplianceDataGrandchild_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_showcase_v1beta1_EnumRequest_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_showcase_v1beta1_EnumRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_showcase_v1beta1_EnumResponse_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_showcase_v1beta1_EnumResponse_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" + + "/schema/google/showcase/v1beta1/complia" + + "nce.proto\022\027google.showcase.v1beta1\032\034goog" + + "le/api/annotations.proto\032\027google/api/client.proto\"\303\002\n\r" + + "RepeatRequest\022\014\n" + + "\004name\030\001 \001(\t\0225\n" + + "\004info\030\002 \001(\0132\'.google.showcase.v1beta1.ComplianceData\022\025\n\r" + + "server_verify\030\003 \001(\010\022!\n" + + "\024intended_binding_uri\030\n" + + " \001(\tH\000\210\001\001\022\017\n" + + "\007f_int32\030\004 \001(\005\022\017\n" + + "\007f_int64\030\005 \001(\003\022\020\n" + + "\010f_double\030\006 \001(\001\022\024\n" + + "\007p_int32\030\007 \001(\005H\001\210\001\001\022\024\n" + + "\007p_int64\030\010 \001(\003H\002\210\001\001\022\025\n" + + "\010p_double\030\t \001(\001H\003\210\001\001B\027\n" + + "\025_intended_binding_uriB\n\n" + + "\010_p_int32B\n\n" + + "\010_p_int64B\013\n" + + "\t_p_double\"^\n" + + "\016RepeatResponse\0227\n" + + "\007request\030\001 \001(\0132&.google.showcase.v1beta1.RepeatRequest\022\023\n" + + "\013binding_uri\030\002 \001(\t\"J\n" + + "\017ComplianceSuite\0227\n" + + "\005group\030\001 \003(\0132(.google.showcase.v1beta1.ComplianceGroup\"g\n" + + "\017ComplianceGroup\022\014\n" + + "\004name\030\001 \001(\t\022\014\n" + + "\004rpcs\030\002 \003(\t\0228\n" + + "\010requests\030\003 \003(\0132&.google.showcase.v1beta1.RepeatRequest\"\340\006\n" + + "\016ComplianceData\022\020\n" + + "\010f_string\030\001 \001(\t\022\017\n" + + "\007f_int32\030\002 \001(\005\022\020\n" + + "\010f_sint32\030\003 \001(\021\022\022\n\n" + + "f_sfixed32\030\004 \001(\017\022\020\n" + + "\010f_uint32\030\005 \001(\r" + + "\022\021\n" + + "\tf_fixed32\030\006 \001(\007\022\017\n" + + "\007f_int64\030\007 \001(\003\022\020\n" + + "\010f_sint64\030\010 \001(\022\022\022\n\n" + + "f_sfixed64\030\t \001(\020\022\020\n" + + "\010f_uint64\030\n" + + " \001(\004\022\021\n" + + "\tf_fixed64\030\013 \001(\006\022\020\n" + + "\010f_double\030\014 \001(\001\022\017\n" + + "\007f_float\030\r" + + " \001(\002\022\016\n" + + "\006f_bool\030\016 \001(\010\022\017\n" + + "\007f_bytes\030\017 \001(\014\022F\n" + + "\tf_kingdom\030\026 \001(\016" + + "23.google.showcase.v1beta1.ComplianceData.LifeKingdom\022=\n" + + "\007f_child\030\020 \001(\0132,.google.showcase.v1beta1.ComplianceDataChild\022\025\n" + + "\010p_string\030\021 \001(\tH\000\210\001\001\022\024\n" + + "\007p_int32\030\022 \001(\005H\001\210\001\001\022\025\n" + + "\010p_double\030\023 \001(\001H\002\210\001\001\022\023\n" + + "\006p_bool\030\024 \001(\010H\003\210\001\001\022K\n" + + "\tp_kingdom\030\027 \001(\01623.google.showca" + + "se.v1beta1.ComplianceData.LifeKingdomH\004\210\001\001\022B\n" + + "\007p_child\030\025" + + " \001(\0132,.google.showcase.v1beta1.ComplianceDataChildH\005\210\001\001\"\203\001\n" + + "\013LifeKingdom\022\034\n" + + "\030LIFE_KINGDOM_UNSPECIFIED\020\000\022\022\n" + + "\016ARCHAEBACTERIA\020\001\022\016\n\n" + + "EUBACTERIA\020\002\022\014\n" + + "\010PROTISTA\020\003\022\t\n" + + "\005FUNGI\020\004\022\013\n" + + "\007PLANTAE\020\005\022\014\n" + + "\010ANIMALIA\020\006B\013\n" + + "\t_p_stringB\n\n" + + "\010_p_int32B\013\n" + + "\t_p_doubleB\t\n" + + "\007_p_boolB\014\n\n" + + "_p_kingdomB\n\n" + + "\010_p_child\"\357\003\n" + + "\023ComplianceDataChild\022\020\n" + + "\010f_string\030\001 \001(\t\022\017\n" + + "\007f_float\030\002 \001(\002\022\020\n" + + "\010f_double\030\003 \001(\001\022\016\n" + + "\006f_bool\030\004 \001(\010\0227\n" + + "\013f_continent\030\013 \001(\0162\".google.showcase.v1beta1.Continent\022B\n" + + "\007f_child\030\005" + + " \001(\01321.google.showcase.v1beta1.ComplianceDataGrandchild\022\025\n" + + "\010p_string\030\006 \001(\tH\000\210\001\001\022\024\n" + + "\007p_float\030\007 \001(\002H\001\210\001\001\022\025\n" + + "\010p_double\030\010 \001(\001H\002\210\001\001\022\023\n" + + "\006p_bool\030\t \001(\010H\003\210\001\001\0227\n" + + "\013p_continent\030\014 \001(\0162\".google.showcase.v1beta1.Continent\022G\n" + + "\007p_child\030\n" + + " \001(\01321.google.showcase.v1beta1.ComplianceDataGrandchildH\004\210\001\001B\013\n" + + "\t_p_stringB\n\n" + + "\010_p_floatB\013\n" + + "\t_p_doubleB\t\n" + + "\007_p_boolB\n\n" + + "\010_p_child\"N\n" + + "\030ComplianceDataGrandchild\022\020\n" + + "\010f_string\030\001 \001(\t\022\020\n" + + "\010f_double\030\002 \001(\001\022\016\n" + + "\006f_bool\030\003 \001(\010\"#\n" + + "\013EnumRequest\022\024\n" + + "\014unknown_enum\030\001 \001(\010\"|\n" + + "\014EnumResponse\0225\n" + + "\007request\030\001 \001(\0132$.google.showcase.v1beta1.EnumRequest\0225\n" + + "\tcontinent\030\002 \001(\0162\".google.showcase.v1beta1.Continent*i\n" + + "\tContinent\022\031\n" + + "\025CONTINENT_UNSPECIFIED\020\000\022\n\n" + + "\006AFRICA\020\001\022\013\n" + + "\007AMERICA\020\002\022\r\n" + + "\tANTARTICA\020\003\022\r\n" + + "\tAUSTRALIA\020\004\022\n\n" + + "\006EUROPE\020\0052\330\r\n\n" + + "Compliance\022\202\001\n" + + "\016RepeatDataBody\022&.google.showcase.v1beta1.RepeatReques" + + "t\032\'.google.showcase.v1beta1.RepeatResponse\"\037\202\323\344\223\002\031\"\024/v1beta1/repeat:body:\001*\022\215\001\n" + + "\022RepeatDataBodyInfo\022&.google.showcase.v1b" + + "eta1.RepeatRequest\032\'.google.showcase.v1beta1.RepeatResponse\"&\202\323\344\223\002" + + " \"\030/v1beta1/repeat:bodyinfo:\004info\022\201\001\n" + + "\017RepeatDataQuery\022&.google.showcase.v1beta1.RepeatRequest\032" + + "\'.google.showcase.v1beta1.RepeatResponse\"\035\202\323\344\223\002\027\022\025/v1beta1/repeat:query\022\331\001\n" + + "\024RepeatDataSimplePath\022&.google.showcase.v1bet" + + "a1.RepeatRequest\032\'.google.showcase.v1bet" + + "a1.RepeatResponse\"p\202\323\344\223\002j\022h/v1beta1/repe" + + "at/{info.f_string}/{info.f_int32}/{info." + + "f_double}/{info.f_bool}/{info.f_kingdom}:simplepath\022\323\002\n" + + "\026RepeatDataPathResource\022&.google.showcase.v1beta1.RepeatRequest\032\'" + + ".google.showcase.v1beta1.RepeatResponse\"" + + "\347\001\202\323\344\223\002\340\001\022h/v1beta1/repeat/{info.f_strin" + + "g=first/*}/{info.f_child.f_string=second/*}/bool/{info.f_bool}:pathresourceZt\022r/" + + "v1beta1/repeat/{info.f_child.f_string=fi" + + "rst/*}/{info.f_string=second/*}/bool/{info.f_bool}:childfirstpathresource\022\331\001\n" + + "\036RepeatDataPathTrailingResource\022&.google.sh" + + "owcase.v1beta1.RepeatRequest\032\'.google.sh" + + "owcase.v1beta1.RepeatResponse\"f\202\323\344\223\002`\022^/" + + "v1beta1/repeat/{info.f_string=first/*}/{" + + "info.f_child.f_string=second/**}:pathtrailingresource\022\210\001\n" + + "\021RepeatDataBodyPut\022&.google.showcase.v1beta1.RepeatRequest\032\'.go" + + "ogle.showcase.v1beta1.RepeatResponse\"\"\202\323\344\223\002\034\032\027/v1beta1/repeat:bodyput:\001*\022\214\001\n" + + "\023RepeatDataBodyPatch\022&.google.showcase.v1bet" + + "a1.RepeatRequest\032\'.google.showcase.v1bet" + + "a1.RepeatResponse\"$\202\323\344\223\002\0362\031/v1beta1/repeat:bodypatch:\001*\022x\n" + + "\007GetEnum\022$.google.show" + + "case.v1beta1.EnumRequest\032%.google.showcase.v1beta1.EnumResponse\"" + + " \202\323\344\223\002\032\022\030/v1beta1/compliance/enum\022|\n\n" + + "VerifyEnum\022%.google" + + ".showcase.v1beta1.EnumResponse\032%.google.showcase.v1beta1.EnumResponse\"" + + " \202\323\344\223\002\032\"\030/" + + "v1beta1/compliance/enum\032\021\312A\016localhost:7469Bq\n" + + "\033com.google.showcase.v1beta1P\001Z4github.com/googleapis/gapic-showcase/server" + + "/genproto\352\002\031Google::Showcase::V1beta1b\006proto3" + }; + descriptor = + com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( + descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + com.google.api.AnnotationsProto.getDescriptor(), + com.google.api.ClientProto.getDescriptor(), + }); + internal_static_google_showcase_v1beta1_RepeatRequest_descriptor = + getDescriptor().getMessageType(0); + internal_static_google_showcase_v1beta1_RepeatRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_showcase_v1beta1_RepeatRequest_descriptor, + new java.lang.String[] { + "Name", + "Info", + "ServerVerify", + "IntendedBindingUri", + "FInt32", + "FInt64", + "FDouble", + "PInt32", + "PInt64", + "PDouble", + }); + internal_static_google_showcase_v1beta1_RepeatResponse_descriptor = + getDescriptor().getMessageType(1); + internal_static_google_showcase_v1beta1_RepeatResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_showcase_v1beta1_RepeatResponse_descriptor, + new java.lang.String[] { + "Request", "BindingUri", + }); + internal_static_google_showcase_v1beta1_ComplianceSuite_descriptor = + getDescriptor().getMessageType(2); + internal_static_google_showcase_v1beta1_ComplianceSuite_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_showcase_v1beta1_ComplianceSuite_descriptor, + new java.lang.String[] { + "Group", + }); + internal_static_google_showcase_v1beta1_ComplianceGroup_descriptor = + getDescriptor().getMessageType(3); + internal_static_google_showcase_v1beta1_ComplianceGroup_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_showcase_v1beta1_ComplianceGroup_descriptor, + new java.lang.String[] { + "Name", "Rpcs", "Requests", + }); + internal_static_google_showcase_v1beta1_ComplianceData_descriptor = + getDescriptor().getMessageType(4); + internal_static_google_showcase_v1beta1_ComplianceData_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_showcase_v1beta1_ComplianceData_descriptor, + new java.lang.String[] { + "FString", + "FInt32", + "FSint32", + "FSfixed32", + "FUint32", + "FFixed32", + "FInt64", + "FSint64", + "FSfixed64", + "FUint64", + "FFixed64", + "FDouble", + "FFloat", + "FBool", + "FBytes", + "FKingdom", + "FChild", + "PString", + "PInt32", + "PDouble", + "PBool", + "PKingdom", + "PChild", + }); + internal_static_google_showcase_v1beta1_ComplianceDataChild_descriptor = + getDescriptor().getMessageType(5); + internal_static_google_showcase_v1beta1_ComplianceDataChild_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_showcase_v1beta1_ComplianceDataChild_descriptor, + new java.lang.String[] { + "FString", + "FFloat", + "FDouble", + "FBool", + "FContinent", + "FChild", + "PString", + "PFloat", + "PDouble", + "PBool", + "PContinent", + "PChild", + }); + internal_static_google_showcase_v1beta1_ComplianceDataGrandchild_descriptor = + getDescriptor().getMessageType(6); + internal_static_google_showcase_v1beta1_ComplianceDataGrandchild_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_showcase_v1beta1_ComplianceDataGrandchild_descriptor, + new java.lang.String[] { + "FString", "FDouble", "FBool", + }); + internal_static_google_showcase_v1beta1_EnumRequest_descriptor = + getDescriptor().getMessageType(7); + internal_static_google_showcase_v1beta1_EnumRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_showcase_v1beta1_EnumRequest_descriptor, + new java.lang.String[] { + "UnknownEnum", + }); + internal_static_google_showcase_v1beta1_EnumResponse_descriptor = + getDescriptor().getMessageType(8); + internal_static_google_showcase_v1beta1_EnumResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_showcase_v1beta1_EnumResponse_descriptor, + new java.lang.String[] { + "Request", "Continent", + }); + descriptor.resolveAllFeaturesImmutable(); + com.google.api.AnnotationsProto.getDescriptor(); + com.google.api.ClientProto.getDescriptor(); + com.google.protobuf.ExtensionRegistry registry = + com.google.protobuf.ExtensionRegistry.newInstance(); + registry.add(com.google.api.ClientProto.defaultHost); + registry.add(com.google.api.AnnotationsProto.http); + com.google.protobuf.Descriptors.FileDescriptor.internalUpdateFileDescriptor( + descriptor, registry); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ComplianceSuite.java b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ComplianceSuite.java new file mode 100644 index 0000000000..1f76d1a2f8 --- /dev/null +++ b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ComplianceSuite.java @@ -0,0 +1,740 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: schema/google/showcase/v1beta1/compliance.proto +// Protobuf Java Version: 4.33.2 + +package com.google.showcase.v1beta1; + +/** + * + * + *
        + * ComplianceSuite contains a set of requests that microgenerators should issue
        + * over REST to the Compliance service to test their gRPC-to-REST transcoding
        + * implementation.
        + * 
        + * + * Protobuf type {@code google.showcase.v1beta1.ComplianceSuite} + */ +@com.google.protobuf.Generated +public final class ComplianceSuite extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.ComplianceSuite) + ComplianceSuiteOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "ComplianceSuite"); + } + + // Use ComplianceSuite.newBuilder() to construct. + private ComplianceSuite(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private ComplianceSuite() { + group_ = java.util.Collections.emptyList(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.ComplianceOuterClass + .internal_static_google_showcase_v1beta1_ComplianceSuite_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.ComplianceOuterClass + .internal_static_google_showcase_v1beta1_ComplianceSuite_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.ComplianceSuite.class, + com.google.showcase.v1beta1.ComplianceSuite.Builder.class); + } + + public static final int GROUP_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private java.util.List group_; + + /** repeated .google.showcase.v1beta1.ComplianceGroup group = 1; */ + @java.lang.Override + public java.util.List getGroupList() { + return group_; + } + + /** repeated .google.showcase.v1beta1.ComplianceGroup group = 1; */ + @java.lang.Override + public java.util.List + getGroupOrBuilderList() { + return group_; + } + + /** repeated .google.showcase.v1beta1.ComplianceGroup group = 1; */ + @java.lang.Override + public int getGroupCount() { + return group_.size(); + } + + /** repeated .google.showcase.v1beta1.ComplianceGroup group = 1; */ + @java.lang.Override + public com.google.showcase.v1beta1.ComplianceGroup getGroup(int index) { + return group_.get(index); + } + + /** repeated .google.showcase.v1beta1.ComplianceGroup group = 1; */ + @java.lang.Override + public com.google.showcase.v1beta1.ComplianceGroupOrBuilder getGroupOrBuilder(int index) { + return group_.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 < group_.size(); i++) { + output.writeMessage(1, group_.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 < group_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, group_.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.showcase.v1beta1.ComplianceSuite)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.ComplianceSuite other = + (com.google.showcase.v1beta1.ComplianceSuite) obj; + + if (!getGroupList().equals(other.getGroupList())) 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 (getGroupCount() > 0) { + hash = (37 * hash) + GROUP_FIELD_NUMBER; + hash = (53 * hash) + getGroupList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.showcase.v1beta1.ComplianceSuite parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.ComplianceSuite parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.ComplianceSuite parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.ComplianceSuite 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.showcase.v1beta1.ComplianceSuite parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.ComplianceSuite parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.ComplianceSuite parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.ComplianceSuite parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.showcase.v1beta1.ComplianceSuite parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.ComplianceSuite parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.showcase.v1beta1.ComplianceSuite parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.ComplianceSuite parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.showcase.v1beta1.ComplianceSuite 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
        +   * ComplianceSuite contains a set of requests that microgenerators should issue
        +   * over REST to the Compliance service to test their gRPC-to-REST transcoding
        +   * implementation.
        +   * 
        + * + * Protobuf type {@code google.showcase.v1beta1.ComplianceSuite} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.ComplianceSuite) + com.google.showcase.v1beta1.ComplianceSuiteOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.ComplianceOuterClass + .internal_static_google_showcase_v1beta1_ComplianceSuite_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.ComplianceOuterClass + .internal_static_google_showcase_v1beta1_ComplianceSuite_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.ComplianceSuite.class, + com.google.showcase.v1beta1.ComplianceSuite.Builder.class); + } + + // Construct using com.google.showcase.v1beta1.ComplianceSuite.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (groupBuilder_ == null) { + group_ = java.util.Collections.emptyList(); + } else { + group_ = null; + groupBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.showcase.v1beta1.ComplianceOuterClass + .internal_static_google_showcase_v1beta1_ComplianceSuite_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.ComplianceSuite getDefaultInstanceForType() { + return com.google.showcase.v1beta1.ComplianceSuite.getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.ComplianceSuite build() { + com.google.showcase.v1beta1.ComplianceSuite result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.ComplianceSuite buildPartial() { + com.google.showcase.v1beta1.ComplianceSuite result = + new com.google.showcase.v1beta1.ComplianceSuite(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields(com.google.showcase.v1beta1.ComplianceSuite result) { + if (groupBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + group_ = java.util.Collections.unmodifiableList(group_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.group_ = group_; + } else { + result.group_ = groupBuilder_.build(); + } + } + + private void buildPartial0(com.google.showcase.v1beta1.ComplianceSuite result) { + int from_bitField0_ = bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.showcase.v1beta1.ComplianceSuite) { + return mergeFrom((com.google.showcase.v1beta1.ComplianceSuite) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.showcase.v1beta1.ComplianceSuite other) { + if (other == com.google.showcase.v1beta1.ComplianceSuite.getDefaultInstance()) return this; + if (groupBuilder_ == null) { + if (!other.group_.isEmpty()) { + if (group_.isEmpty()) { + group_ = other.group_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureGroupIsMutable(); + group_.addAll(other.group_); + } + onChanged(); + } + } else { + if (!other.group_.isEmpty()) { + if (groupBuilder_.isEmpty()) { + groupBuilder_.dispose(); + groupBuilder_ = null; + group_ = other.group_; + bitField0_ = (bitField0_ & ~0x00000001); + groupBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders + ? internalGetGroupFieldBuilder() + : null; + } else { + groupBuilder_.addAllMessages(other.group_); + } + } + } + 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.showcase.v1beta1.ComplianceGroup m = + input.readMessage( + com.google.showcase.v1beta1.ComplianceGroup.parser(), extensionRegistry); + if (groupBuilder_ == null) { + ensureGroupIsMutable(); + group_.add(m); + } else { + groupBuilder_.addMessage(m); + } + 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.util.List group_ = + java.util.Collections.emptyList(); + + private void ensureGroupIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + group_ = new java.util.ArrayList(group_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.google.showcase.v1beta1.ComplianceGroup, + com.google.showcase.v1beta1.ComplianceGroup.Builder, + com.google.showcase.v1beta1.ComplianceGroupOrBuilder> + groupBuilder_; + + /** repeated .google.showcase.v1beta1.ComplianceGroup group = 1; */ + public java.util.List getGroupList() { + if (groupBuilder_ == null) { + return java.util.Collections.unmodifiableList(group_); + } else { + return groupBuilder_.getMessageList(); + } + } + + /** repeated .google.showcase.v1beta1.ComplianceGroup group = 1; */ + public int getGroupCount() { + if (groupBuilder_ == null) { + return group_.size(); + } else { + return groupBuilder_.getCount(); + } + } + + /** repeated .google.showcase.v1beta1.ComplianceGroup group = 1; */ + public com.google.showcase.v1beta1.ComplianceGroup getGroup(int index) { + if (groupBuilder_ == null) { + return group_.get(index); + } else { + return groupBuilder_.getMessage(index); + } + } + + /** repeated .google.showcase.v1beta1.ComplianceGroup group = 1; */ + public Builder setGroup(int index, com.google.showcase.v1beta1.ComplianceGroup value) { + if (groupBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureGroupIsMutable(); + group_.set(index, value); + onChanged(); + } else { + groupBuilder_.setMessage(index, value); + } + return this; + } + + /** repeated .google.showcase.v1beta1.ComplianceGroup group = 1; */ + public Builder setGroup( + int index, com.google.showcase.v1beta1.ComplianceGroup.Builder builderForValue) { + if (groupBuilder_ == null) { + ensureGroupIsMutable(); + group_.set(index, builderForValue.build()); + onChanged(); + } else { + groupBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + + /** repeated .google.showcase.v1beta1.ComplianceGroup group = 1; */ + public Builder addGroup(com.google.showcase.v1beta1.ComplianceGroup value) { + if (groupBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureGroupIsMutable(); + group_.add(value); + onChanged(); + } else { + groupBuilder_.addMessage(value); + } + return this; + } + + /** repeated .google.showcase.v1beta1.ComplianceGroup group = 1; */ + public Builder addGroup(int index, com.google.showcase.v1beta1.ComplianceGroup value) { + if (groupBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureGroupIsMutable(); + group_.add(index, value); + onChanged(); + } else { + groupBuilder_.addMessage(index, value); + } + return this; + } + + /** repeated .google.showcase.v1beta1.ComplianceGroup group = 1; */ + public Builder addGroup(com.google.showcase.v1beta1.ComplianceGroup.Builder builderForValue) { + if (groupBuilder_ == null) { + ensureGroupIsMutable(); + group_.add(builderForValue.build()); + onChanged(); + } else { + groupBuilder_.addMessage(builderForValue.build()); + } + return this; + } + + /** repeated .google.showcase.v1beta1.ComplianceGroup group = 1; */ + public Builder addGroup( + int index, com.google.showcase.v1beta1.ComplianceGroup.Builder builderForValue) { + if (groupBuilder_ == null) { + ensureGroupIsMutable(); + group_.add(index, builderForValue.build()); + onChanged(); + } else { + groupBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + + /** repeated .google.showcase.v1beta1.ComplianceGroup group = 1; */ + public Builder addAllGroup( + java.lang.Iterable values) { + if (groupBuilder_ == null) { + ensureGroupIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, group_); + onChanged(); + } else { + groupBuilder_.addAllMessages(values); + } + return this; + } + + /** repeated .google.showcase.v1beta1.ComplianceGroup group = 1; */ + public Builder clearGroup() { + if (groupBuilder_ == null) { + group_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + groupBuilder_.clear(); + } + return this; + } + + /** repeated .google.showcase.v1beta1.ComplianceGroup group = 1; */ + public Builder removeGroup(int index) { + if (groupBuilder_ == null) { + ensureGroupIsMutable(); + group_.remove(index); + onChanged(); + } else { + groupBuilder_.remove(index); + } + return this; + } + + /** repeated .google.showcase.v1beta1.ComplianceGroup group = 1; */ + public com.google.showcase.v1beta1.ComplianceGroup.Builder getGroupBuilder(int index) { + return internalGetGroupFieldBuilder().getBuilder(index); + } + + /** repeated .google.showcase.v1beta1.ComplianceGroup group = 1; */ + public com.google.showcase.v1beta1.ComplianceGroupOrBuilder getGroupOrBuilder(int index) { + if (groupBuilder_ == null) { + return group_.get(index); + } else { + return groupBuilder_.getMessageOrBuilder(index); + } + } + + /** repeated .google.showcase.v1beta1.ComplianceGroup group = 1; */ + public java.util.List + getGroupOrBuilderList() { + if (groupBuilder_ != null) { + return groupBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(group_); + } + } + + /** repeated .google.showcase.v1beta1.ComplianceGroup group = 1; */ + public com.google.showcase.v1beta1.ComplianceGroup.Builder addGroupBuilder() { + return internalGetGroupFieldBuilder() + .addBuilder(com.google.showcase.v1beta1.ComplianceGroup.getDefaultInstance()); + } + + /** repeated .google.showcase.v1beta1.ComplianceGroup group = 1; */ + public com.google.showcase.v1beta1.ComplianceGroup.Builder addGroupBuilder(int index) { + return internalGetGroupFieldBuilder() + .addBuilder(index, com.google.showcase.v1beta1.ComplianceGroup.getDefaultInstance()); + } + + /** repeated .google.showcase.v1beta1.ComplianceGroup group = 1; */ + public java.util.List + getGroupBuilderList() { + return internalGetGroupFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.google.showcase.v1beta1.ComplianceGroup, + com.google.showcase.v1beta1.ComplianceGroup.Builder, + com.google.showcase.v1beta1.ComplianceGroupOrBuilder> + internalGetGroupFieldBuilder() { + if (groupBuilder_ == null) { + groupBuilder_ = + new com.google.protobuf.RepeatedFieldBuilder< + com.google.showcase.v1beta1.ComplianceGroup, + com.google.showcase.v1beta1.ComplianceGroup.Builder, + com.google.showcase.v1beta1.ComplianceGroupOrBuilder>( + group_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + group_ = null; + } + return groupBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.showcase.v1beta1.ComplianceSuite) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.ComplianceSuite) + private static final com.google.showcase.v1beta1.ComplianceSuite DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.ComplianceSuite(); + } + + public static com.google.showcase.v1beta1.ComplianceSuite getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ComplianceSuite 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.showcase.v1beta1.ComplianceSuite getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ComplianceSuiteOrBuilder.java b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ComplianceSuiteOrBuilder.java new file mode 100644 index 0000000000..a0e0bb5eba --- /dev/null +++ b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ComplianceSuiteOrBuilder.java @@ -0,0 +1,44 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: schema/google/showcase/v1beta1/compliance.proto +// Protobuf Java Version: 4.33.2 + +package com.google.showcase.v1beta1; + +@com.google.protobuf.Generated +public interface ComplianceSuiteOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.ComplianceSuite) + com.google.protobuf.MessageOrBuilder { + + /** repeated .google.showcase.v1beta1.ComplianceGroup group = 1; */ + java.util.List getGroupList(); + + /** repeated .google.showcase.v1beta1.ComplianceGroup group = 1; */ + com.google.showcase.v1beta1.ComplianceGroup getGroup(int index); + + /** repeated .google.showcase.v1beta1.ComplianceGroup group = 1; */ + int getGroupCount(); + + /** repeated .google.showcase.v1beta1.ComplianceGroup group = 1; */ + java.util.List + getGroupOrBuilderList(); + + /** repeated .google.showcase.v1beta1.ComplianceGroup group = 1; */ + com.google.showcase.v1beta1.ComplianceGroupOrBuilder getGroupOrBuilder(int index); +} diff --git a/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ConnectRequest.java b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ConnectRequest.java new file mode 100644 index 0000000000..9dc50d2219 --- /dev/null +++ b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ConnectRequest.java @@ -0,0 +1,1704 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: schema/google/showcase/v1beta1/messaging.proto +// Protobuf Java Version: 4.33.2 + +package com.google.showcase.v1beta1; + +/** + * + * + *
        + * The request message for the google.showcase.v1beta1.Messaging\Connect
        + * method.
        + * 
        + * + * Protobuf type {@code google.showcase.v1beta1.ConnectRequest} + */ +@com.google.protobuf.Generated +public final class ConnectRequest extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.ConnectRequest) + ConnectRequestOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "ConnectRequest"); + } + + // Use ConnectRequest.newBuilder() to construct. + private ConnectRequest(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private ConnectRequest() {} + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.MessagingOuterClass + .internal_static_google_showcase_v1beta1_ConnectRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.MessagingOuterClass + .internal_static_google_showcase_v1beta1_ConnectRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.ConnectRequest.class, + com.google.showcase.v1beta1.ConnectRequest.Builder.class); + } + + public interface ConnectConfigOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.ConnectRequest.ConnectConfig) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
        +     * The room or profile to follow and create messages for.
        +     * 
        + * + * string parent = 1 [(.google.api.resource_reference) = { ... } + * + * @return The parent. + */ + java.lang.String getParent(); + + /** + * + * + *
        +     * The room or profile to follow and create messages for.
        +     * 
        + * + * string parent = 1 [(.google.api.resource_reference) = { ... } + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + } + + /** Protobuf type {@code google.showcase.v1beta1.ConnectRequest.ConnectConfig} */ + public static final class ConnectConfig extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.ConnectRequest.ConnectConfig) + ConnectConfigOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "ConnectConfig"); + } + + // Use ConnectConfig.newBuilder() to construct. + private ConnectConfig(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private ConnectConfig() { + parent_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.MessagingOuterClass + .internal_static_google_showcase_v1beta1_ConnectRequest_ConnectConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.MessagingOuterClass + .internal_static_google_showcase_v1beta1_ConnectRequest_ConnectConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.ConnectRequest.ConnectConfig.class, + com.google.showcase.v1beta1.ConnectRequest.ConnectConfig.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object parent_ = ""; + + /** + * + * + *
        +     * The room or profile to follow and create messages for.
        +     * 
        + * + * string parent = 1 [(.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; + } + } + + /** + * + * + *
        +     * The room or profile to follow and create messages for.
        +     * 
        + * + * string parent = 1 [(.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; + } + } + + 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.GeneratedMessage.isStringEmpty(parent_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, parent_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(parent_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, parent_); + } + 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.showcase.v1beta1.ConnectRequest.ConnectConfig)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.ConnectRequest.ConnectConfig other = + (com.google.showcase.v1beta1.ConnectRequest.ConnectConfig) obj; + + if (!getParent().equals(other.getParent())) 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 = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.showcase.v1beta1.ConnectRequest.ConnectConfig parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.ConnectRequest.ConnectConfig parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.ConnectRequest.ConnectConfig parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.ConnectRequest.ConnectConfig 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.showcase.v1beta1.ConnectRequest.ConnectConfig parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.ConnectRequest.ConnectConfig parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.ConnectRequest.ConnectConfig parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.ConnectRequest.ConnectConfig parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.showcase.v1beta1.ConnectRequest.ConnectConfig parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.ConnectRequest.ConnectConfig parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.showcase.v1beta1.ConnectRequest.ConnectConfig parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.ConnectRequest.ConnectConfig parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.showcase.v1beta1.ConnectRequest.ConnectConfig 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** Protobuf type {@code google.showcase.v1beta1.ConnectRequest.ConnectConfig} */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.ConnectRequest.ConnectConfig) + com.google.showcase.v1beta1.ConnectRequest.ConnectConfigOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.MessagingOuterClass + .internal_static_google_showcase_v1beta1_ConnectRequest_ConnectConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.MessagingOuterClass + .internal_static_google_showcase_v1beta1_ConnectRequest_ConnectConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.ConnectRequest.ConnectConfig.class, + com.google.showcase.v1beta1.ConnectRequest.ConnectConfig.Builder.class); + } + + // Construct using com.google.showcase.v1beta1.ConnectRequest.ConnectConfig.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + parent_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.showcase.v1beta1.MessagingOuterClass + .internal_static_google_showcase_v1beta1_ConnectRequest_ConnectConfig_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.ConnectRequest.ConnectConfig getDefaultInstanceForType() { + return com.google.showcase.v1beta1.ConnectRequest.ConnectConfig.getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.ConnectRequest.ConnectConfig build() { + com.google.showcase.v1beta1.ConnectRequest.ConnectConfig result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.ConnectRequest.ConnectConfig buildPartial() { + com.google.showcase.v1beta1.ConnectRequest.ConnectConfig result = + new com.google.showcase.v1beta1.ConnectRequest.ConnectConfig(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.showcase.v1beta1.ConnectRequest.ConnectConfig result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.parent_ = parent_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.showcase.v1beta1.ConnectRequest.ConnectConfig) { + return mergeFrom((com.google.showcase.v1beta1.ConnectRequest.ConnectConfig) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.showcase.v1beta1.ConnectRequest.ConnectConfig other) { + if (other == com.google.showcase.v1beta1.ConnectRequest.ConnectConfig.getDefaultInstance()) + return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + 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: + { + parent_ = 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 parent_ = ""; + + /** + * + * + *
        +       * The room or profile to follow and create messages for.
        +       * 
        + * + * string parent = 1 [(.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; + } + } + + /** + * + * + *
        +       * The room or profile to follow and create messages for.
        +       * 
        + * + * string parent = 1 [(.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; + } + } + + /** + * + * + *
        +       * The room or profile to follow and create messages for.
        +       * 
        + * + * string parent = 1 [(.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; + } + + /** + * + * + *
        +       * The room or profile to follow and create messages for.
        +       * 
        + * + * string parent = 1 [(.google.api.resource_reference) = { ... } + * + * @return This builder for chaining. + */ + public Builder clearParent() { + parent_ = getDefaultInstance().getParent(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
        +       * The room or profile to follow and create messages for.
        +       * 
        + * + * string parent = 1 [(.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; + } + + // @@protoc_insertion_point(builder_scope:google.showcase.v1beta1.ConnectRequest.ConnectConfig) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.ConnectRequest.ConnectConfig) + private static final com.google.showcase.v1beta1.ConnectRequest.ConnectConfig DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.ConnectRequest.ConnectConfig(); + } + + public static com.google.showcase.v1beta1.ConnectRequest.ConnectConfig getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ConnectConfig 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.showcase.v1beta1.ConnectRequest.ConnectConfig getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + 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 { + CONFIG(1), + BLURB(2), + 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 1: + return CONFIG; + case 2: + return BLURB; + 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 CONFIG_FIELD_NUMBER = 1; + + /** + * + * + *
        +   * Provides information that specifies how to process subsequent requests.
        +   * The first `ConnectRequest` message must contain a `config`  message.
        +   * 
        + * + * .google.showcase.v1beta1.ConnectRequest.ConnectConfig config = 1; + * + * @return Whether the config field is set. + */ + @java.lang.Override + public boolean hasConfig() { + return requestCase_ == 1; + } + + /** + * + * + *
        +   * Provides information that specifies how to process subsequent requests.
        +   * The first `ConnectRequest` message must contain a `config`  message.
        +   * 
        + * + * .google.showcase.v1beta1.ConnectRequest.ConnectConfig config = 1; + * + * @return The config. + */ + @java.lang.Override + public com.google.showcase.v1beta1.ConnectRequest.ConnectConfig getConfig() { + if (requestCase_ == 1) { + return (com.google.showcase.v1beta1.ConnectRequest.ConnectConfig) request_; + } + return com.google.showcase.v1beta1.ConnectRequest.ConnectConfig.getDefaultInstance(); + } + + /** + * + * + *
        +   * Provides information that specifies how to process subsequent requests.
        +   * The first `ConnectRequest` message must contain a `config`  message.
        +   * 
        + * + * .google.showcase.v1beta1.ConnectRequest.ConnectConfig config = 1; + */ + @java.lang.Override + public com.google.showcase.v1beta1.ConnectRequest.ConnectConfigOrBuilder getConfigOrBuilder() { + if (requestCase_ == 1) { + return (com.google.showcase.v1beta1.ConnectRequest.ConnectConfig) request_; + } + return com.google.showcase.v1beta1.ConnectRequest.ConnectConfig.getDefaultInstance(); + } + + public static final int BLURB_FIELD_NUMBER = 2; + + /** + * + * + *
        +   * The blurb to be created.
        +   * 
        + * + * .google.showcase.v1beta1.Blurb blurb = 2; + * + * @return Whether the blurb field is set. + */ + @java.lang.Override + public boolean hasBlurb() { + return requestCase_ == 2; + } + + /** + * + * + *
        +   * The blurb to be created.
        +   * 
        + * + * .google.showcase.v1beta1.Blurb blurb = 2; + * + * @return The blurb. + */ + @java.lang.Override + public com.google.showcase.v1beta1.Blurb getBlurb() { + if (requestCase_ == 2) { + return (com.google.showcase.v1beta1.Blurb) request_; + } + return com.google.showcase.v1beta1.Blurb.getDefaultInstance(); + } + + /** + * + * + *
        +   * The blurb to be created.
        +   * 
        + * + * .google.showcase.v1beta1.Blurb blurb = 2; + */ + @java.lang.Override + public com.google.showcase.v1beta1.BlurbOrBuilder getBlurbOrBuilder() { + if (requestCase_ == 2) { + return (com.google.showcase.v1beta1.Blurb) request_; + } + return com.google.showcase.v1beta1.Blurb.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 (requestCase_ == 1) { + output.writeMessage(1, (com.google.showcase.v1beta1.ConnectRequest.ConnectConfig) request_); + } + if (requestCase_ == 2) { + output.writeMessage(2, (com.google.showcase.v1beta1.Blurb) request_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (requestCase_ == 1) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 1, (com.google.showcase.v1beta1.ConnectRequest.ConnectConfig) request_); + } + if (requestCase_ == 2) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 2, (com.google.showcase.v1beta1.Blurb) 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.showcase.v1beta1.ConnectRequest)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.ConnectRequest other = + (com.google.showcase.v1beta1.ConnectRequest) obj; + + if (!getRequestCase().equals(other.getRequestCase())) return false; + switch (requestCase_) { + case 1: + if (!getConfig().equals(other.getConfig())) return false; + break; + case 2: + if (!getBlurb().equals(other.getBlurb())) 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(); + switch (requestCase_) { + case 1: + hash = (37 * hash) + CONFIG_FIELD_NUMBER; + hash = (53 * hash) + getConfig().hashCode(); + break; + case 2: + hash = (37 * hash) + BLURB_FIELD_NUMBER; + hash = (53 * hash) + getBlurb().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.showcase.v1beta1.ConnectRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.ConnectRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.ConnectRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.ConnectRequest 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.showcase.v1beta1.ConnectRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.ConnectRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.ConnectRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.ConnectRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.showcase.v1beta1.ConnectRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.ConnectRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.showcase.v1beta1.ConnectRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.ConnectRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.showcase.v1beta1.ConnectRequest 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
        +   * The request message for the google.showcase.v1beta1.Messaging\Connect
        +   * method.
        +   * 
        + * + * Protobuf type {@code google.showcase.v1beta1.ConnectRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.ConnectRequest) + com.google.showcase.v1beta1.ConnectRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.MessagingOuterClass + .internal_static_google_showcase_v1beta1_ConnectRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.MessagingOuterClass + .internal_static_google_showcase_v1beta1_ConnectRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.ConnectRequest.class, + com.google.showcase.v1beta1.ConnectRequest.Builder.class); + } + + // Construct using com.google.showcase.v1beta1.ConnectRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (configBuilder_ != null) { + configBuilder_.clear(); + } + if (blurbBuilder_ != null) { + blurbBuilder_.clear(); + } + requestCase_ = 0; + request_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.showcase.v1beta1.MessagingOuterClass + .internal_static_google_showcase_v1beta1_ConnectRequest_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.ConnectRequest getDefaultInstanceForType() { + return com.google.showcase.v1beta1.ConnectRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.ConnectRequest build() { + com.google.showcase.v1beta1.ConnectRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.ConnectRequest buildPartial() { + com.google.showcase.v1beta1.ConnectRequest result = + new com.google.showcase.v1beta1.ConnectRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + buildPartialOneofs(result); + onBuilt(); + return result; + } + + private void buildPartial0(com.google.showcase.v1beta1.ConnectRequest result) { + int from_bitField0_ = bitField0_; + } + + private void buildPartialOneofs(com.google.showcase.v1beta1.ConnectRequest result) { + result.requestCase_ = requestCase_; + result.request_ = this.request_; + if (requestCase_ == 1 && configBuilder_ != null) { + result.request_ = configBuilder_.build(); + } + if (requestCase_ == 2 && blurbBuilder_ != null) { + result.request_ = blurbBuilder_.build(); + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.showcase.v1beta1.ConnectRequest) { + return mergeFrom((com.google.showcase.v1beta1.ConnectRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.showcase.v1beta1.ConnectRequest other) { + if (other == com.google.showcase.v1beta1.ConnectRequest.getDefaultInstance()) return this; + switch (other.getRequestCase()) { + case CONFIG: + { + mergeConfig(other.getConfig()); + break; + } + case BLURB: + { + mergeBlurb(other.getBlurb()); + 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(internalGetConfigFieldBuilder().getBuilder(), extensionRegistry); + requestCase_ = 1; + break; + } // case 10 + case 18: + { + input.readMessage(internalGetBlurbFieldBuilder().getBuilder(), extensionRegistry); + requestCase_ = 2; + 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 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.SingleFieldBuilder< + com.google.showcase.v1beta1.ConnectRequest.ConnectConfig, + com.google.showcase.v1beta1.ConnectRequest.ConnectConfig.Builder, + com.google.showcase.v1beta1.ConnectRequest.ConnectConfigOrBuilder> + configBuilder_; + + /** + * + * + *
        +     * Provides information that specifies how to process subsequent requests.
        +     * The first `ConnectRequest` message must contain a `config`  message.
        +     * 
        + * + * .google.showcase.v1beta1.ConnectRequest.ConnectConfig config = 1; + * + * @return Whether the config field is set. + */ + @java.lang.Override + public boolean hasConfig() { + return requestCase_ == 1; + } + + /** + * + * + *
        +     * Provides information that specifies how to process subsequent requests.
        +     * The first `ConnectRequest` message must contain a `config`  message.
        +     * 
        + * + * .google.showcase.v1beta1.ConnectRequest.ConnectConfig config = 1; + * + * @return The config. + */ + @java.lang.Override + public com.google.showcase.v1beta1.ConnectRequest.ConnectConfig getConfig() { + if (configBuilder_ == null) { + if (requestCase_ == 1) { + return (com.google.showcase.v1beta1.ConnectRequest.ConnectConfig) request_; + } + return com.google.showcase.v1beta1.ConnectRequest.ConnectConfig.getDefaultInstance(); + } else { + if (requestCase_ == 1) { + return configBuilder_.getMessage(); + } + return com.google.showcase.v1beta1.ConnectRequest.ConnectConfig.getDefaultInstance(); + } + } + + /** + * + * + *
        +     * Provides information that specifies how to process subsequent requests.
        +     * The first `ConnectRequest` message must contain a `config`  message.
        +     * 
        + * + * .google.showcase.v1beta1.ConnectRequest.ConnectConfig config = 1; + */ + public Builder setConfig(com.google.showcase.v1beta1.ConnectRequest.ConnectConfig value) { + if (configBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + request_ = value; + onChanged(); + } else { + configBuilder_.setMessage(value); + } + requestCase_ = 1; + return this; + } + + /** + * + * + *
        +     * Provides information that specifies how to process subsequent requests.
        +     * The first `ConnectRequest` message must contain a `config`  message.
        +     * 
        + * + * .google.showcase.v1beta1.ConnectRequest.ConnectConfig config = 1; + */ + public Builder setConfig( + com.google.showcase.v1beta1.ConnectRequest.ConnectConfig.Builder builderForValue) { + if (configBuilder_ == null) { + request_ = builderForValue.build(); + onChanged(); + } else { + configBuilder_.setMessage(builderForValue.build()); + } + requestCase_ = 1; + return this; + } + + /** + * + * + *
        +     * Provides information that specifies how to process subsequent requests.
        +     * The first `ConnectRequest` message must contain a `config`  message.
        +     * 
        + * + * .google.showcase.v1beta1.ConnectRequest.ConnectConfig config = 1; + */ + public Builder mergeConfig(com.google.showcase.v1beta1.ConnectRequest.ConnectConfig value) { + if (configBuilder_ == null) { + if (requestCase_ == 1 + && request_ + != com.google.showcase.v1beta1.ConnectRequest.ConnectConfig.getDefaultInstance()) { + request_ = + com.google.showcase.v1beta1.ConnectRequest.ConnectConfig.newBuilder( + (com.google.showcase.v1beta1.ConnectRequest.ConnectConfig) request_) + .mergeFrom(value) + .buildPartial(); + } else { + request_ = value; + } + onChanged(); + } else { + if (requestCase_ == 1) { + configBuilder_.mergeFrom(value); + } else { + configBuilder_.setMessage(value); + } + } + requestCase_ = 1; + return this; + } + + /** + * + * + *
        +     * Provides information that specifies how to process subsequent requests.
        +     * The first `ConnectRequest` message must contain a `config`  message.
        +     * 
        + * + * .google.showcase.v1beta1.ConnectRequest.ConnectConfig config = 1; + */ + public Builder clearConfig() { + if (configBuilder_ == null) { + if (requestCase_ == 1) { + requestCase_ = 0; + request_ = null; + onChanged(); + } + } else { + if (requestCase_ == 1) { + requestCase_ = 0; + request_ = null; + } + configBuilder_.clear(); + } + return this; + } + + /** + * + * + *
        +     * Provides information that specifies how to process subsequent requests.
        +     * The first `ConnectRequest` message must contain a `config`  message.
        +     * 
        + * + * .google.showcase.v1beta1.ConnectRequest.ConnectConfig config = 1; + */ + public com.google.showcase.v1beta1.ConnectRequest.ConnectConfig.Builder getConfigBuilder() { + return internalGetConfigFieldBuilder().getBuilder(); + } + + /** + * + * + *
        +     * Provides information that specifies how to process subsequent requests.
        +     * The first `ConnectRequest` message must contain a `config`  message.
        +     * 
        + * + * .google.showcase.v1beta1.ConnectRequest.ConnectConfig config = 1; + */ + @java.lang.Override + public com.google.showcase.v1beta1.ConnectRequest.ConnectConfigOrBuilder getConfigOrBuilder() { + if ((requestCase_ == 1) && (configBuilder_ != null)) { + return configBuilder_.getMessageOrBuilder(); + } else { + if (requestCase_ == 1) { + return (com.google.showcase.v1beta1.ConnectRequest.ConnectConfig) request_; + } + return com.google.showcase.v1beta1.ConnectRequest.ConnectConfig.getDefaultInstance(); + } + } + + /** + * + * + *
        +     * Provides information that specifies how to process subsequent requests.
        +     * The first `ConnectRequest` message must contain a `config`  message.
        +     * 
        + * + * .google.showcase.v1beta1.ConnectRequest.ConnectConfig config = 1; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.showcase.v1beta1.ConnectRequest.ConnectConfig, + com.google.showcase.v1beta1.ConnectRequest.ConnectConfig.Builder, + com.google.showcase.v1beta1.ConnectRequest.ConnectConfigOrBuilder> + internalGetConfigFieldBuilder() { + if (configBuilder_ == null) { + if (!(requestCase_ == 1)) { + request_ = com.google.showcase.v1beta1.ConnectRequest.ConnectConfig.getDefaultInstance(); + } + configBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.showcase.v1beta1.ConnectRequest.ConnectConfig, + com.google.showcase.v1beta1.ConnectRequest.ConnectConfig.Builder, + com.google.showcase.v1beta1.ConnectRequest.ConnectConfigOrBuilder>( + (com.google.showcase.v1beta1.ConnectRequest.ConnectConfig) request_, + getParentForChildren(), + isClean()); + request_ = null; + } + requestCase_ = 1; + onChanged(); + return configBuilder_; + } + + private com.google.protobuf.SingleFieldBuilder< + com.google.showcase.v1beta1.Blurb, + com.google.showcase.v1beta1.Blurb.Builder, + com.google.showcase.v1beta1.BlurbOrBuilder> + blurbBuilder_; + + /** + * + * + *
        +     * The blurb to be created.
        +     * 
        + * + * .google.showcase.v1beta1.Blurb blurb = 2; + * + * @return Whether the blurb field is set. + */ + @java.lang.Override + public boolean hasBlurb() { + return requestCase_ == 2; + } + + /** + * + * + *
        +     * The blurb to be created.
        +     * 
        + * + * .google.showcase.v1beta1.Blurb blurb = 2; + * + * @return The blurb. + */ + @java.lang.Override + public com.google.showcase.v1beta1.Blurb getBlurb() { + if (blurbBuilder_ == null) { + if (requestCase_ == 2) { + return (com.google.showcase.v1beta1.Blurb) request_; + } + return com.google.showcase.v1beta1.Blurb.getDefaultInstance(); + } else { + if (requestCase_ == 2) { + return blurbBuilder_.getMessage(); + } + return com.google.showcase.v1beta1.Blurb.getDefaultInstance(); + } + } + + /** + * + * + *
        +     * The blurb to be created.
        +     * 
        + * + * .google.showcase.v1beta1.Blurb blurb = 2; + */ + public Builder setBlurb(com.google.showcase.v1beta1.Blurb value) { + if (blurbBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + request_ = value; + onChanged(); + } else { + blurbBuilder_.setMessage(value); + } + requestCase_ = 2; + return this; + } + + /** + * + * + *
        +     * The blurb to be created.
        +     * 
        + * + * .google.showcase.v1beta1.Blurb blurb = 2; + */ + public Builder setBlurb(com.google.showcase.v1beta1.Blurb.Builder builderForValue) { + if (blurbBuilder_ == null) { + request_ = builderForValue.build(); + onChanged(); + } else { + blurbBuilder_.setMessage(builderForValue.build()); + } + requestCase_ = 2; + return this; + } + + /** + * + * + *
        +     * The blurb to be created.
        +     * 
        + * + * .google.showcase.v1beta1.Blurb blurb = 2; + */ + public Builder mergeBlurb(com.google.showcase.v1beta1.Blurb value) { + if (blurbBuilder_ == null) { + if (requestCase_ == 2 + && request_ != com.google.showcase.v1beta1.Blurb.getDefaultInstance()) { + request_ = + com.google.showcase.v1beta1.Blurb.newBuilder( + (com.google.showcase.v1beta1.Blurb) request_) + .mergeFrom(value) + .buildPartial(); + } else { + request_ = value; + } + onChanged(); + } else { + if (requestCase_ == 2) { + blurbBuilder_.mergeFrom(value); + } else { + blurbBuilder_.setMessage(value); + } + } + requestCase_ = 2; + return this; + } + + /** + * + * + *
        +     * The blurb to be created.
        +     * 
        + * + * .google.showcase.v1beta1.Blurb blurb = 2; + */ + public Builder clearBlurb() { + if (blurbBuilder_ == null) { + if (requestCase_ == 2) { + requestCase_ = 0; + request_ = null; + onChanged(); + } + } else { + if (requestCase_ == 2) { + requestCase_ = 0; + request_ = null; + } + blurbBuilder_.clear(); + } + return this; + } + + /** + * + * + *
        +     * The blurb to be created.
        +     * 
        + * + * .google.showcase.v1beta1.Blurb blurb = 2; + */ + public com.google.showcase.v1beta1.Blurb.Builder getBlurbBuilder() { + return internalGetBlurbFieldBuilder().getBuilder(); + } + + /** + * + * + *
        +     * The blurb to be created.
        +     * 
        + * + * .google.showcase.v1beta1.Blurb blurb = 2; + */ + @java.lang.Override + public com.google.showcase.v1beta1.BlurbOrBuilder getBlurbOrBuilder() { + if ((requestCase_ == 2) && (blurbBuilder_ != null)) { + return blurbBuilder_.getMessageOrBuilder(); + } else { + if (requestCase_ == 2) { + return (com.google.showcase.v1beta1.Blurb) request_; + } + return com.google.showcase.v1beta1.Blurb.getDefaultInstance(); + } + } + + /** + * + * + *
        +     * The blurb to be created.
        +     * 
        + * + * .google.showcase.v1beta1.Blurb blurb = 2; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.showcase.v1beta1.Blurb, + com.google.showcase.v1beta1.Blurb.Builder, + com.google.showcase.v1beta1.BlurbOrBuilder> + internalGetBlurbFieldBuilder() { + if (blurbBuilder_ == null) { + if (!(requestCase_ == 2)) { + request_ = com.google.showcase.v1beta1.Blurb.getDefaultInstance(); + } + blurbBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.showcase.v1beta1.Blurb, + com.google.showcase.v1beta1.Blurb.Builder, + com.google.showcase.v1beta1.BlurbOrBuilder>( + (com.google.showcase.v1beta1.Blurb) request_, getParentForChildren(), isClean()); + request_ = null; + } + requestCase_ = 2; + onChanged(); + return blurbBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.showcase.v1beta1.ConnectRequest) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.ConnectRequest) + private static final com.google.showcase.v1beta1.ConnectRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.ConnectRequest(); + } + + public static com.google.showcase.v1beta1.ConnectRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ConnectRequest 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.showcase.v1beta1.ConnectRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ConnectRequestOrBuilder.java b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ConnectRequestOrBuilder.java new file mode 100644 index 0000000000..2663d95cbe --- /dev/null +++ b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ConnectRequestOrBuilder.java @@ -0,0 +1,107 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: schema/google/showcase/v1beta1/messaging.proto +// Protobuf Java Version: 4.33.2 + +package com.google.showcase.v1beta1; + +@com.google.protobuf.Generated +public interface ConnectRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.ConnectRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
        +   * Provides information that specifies how to process subsequent requests.
        +   * The first `ConnectRequest` message must contain a `config`  message.
        +   * 
        + * + * .google.showcase.v1beta1.ConnectRequest.ConnectConfig config = 1; + * + * @return Whether the config field is set. + */ + boolean hasConfig(); + + /** + * + * + *
        +   * Provides information that specifies how to process subsequent requests.
        +   * The first `ConnectRequest` message must contain a `config`  message.
        +   * 
        + * + * .google.showcase.v1beta1.ConnectRequest.ConnectConfig config = 1; + * + * @return The config. + */ + com.google.showcase.v1beta1.ConnectRequest.ConnectConfig getConfig(); + + /** + * + * + *
        +   * Provides information that specifies how to process subsequent requests.
        +   * The first `ConnectRequest` message must contain a `config`  message.
        +   * 
        + * + * .google.showcase.v1beta1.ConnectRequest.ConnectConfig config = 1; + */ + com.google.showcase.v1beta1.ConnectRequest.ConnectConfigOrBuilder getConfigOrBuilder(); + + /** + * + * + *
        +   * The blurb to be created.
        +   * 
        + * + * .google.showcase.v1beta1.Blurb blurb = 2; + * + * @return Whether the blurb field is set. + */ + boolean hasBlurb(); + + /** + * + * + *
        +   * The blurb to be created.
        +   * 
        + * + * .google.showcase.v1beta1.Blurb blurb = 2; + * + * @return The blurb. + */ + com.google.showcase.v1beta1.Blurb getBlurb(); + + /** + * + * + *
        +   * The blurb to be created.
        +   * 
        + * + * .google.showcase.v1beta1.Blurb blurb = 2; + */ + com.google.showcase.v1beta1.BlurbOrBuilder getBlurbOrBuilder(); + + com.google.showcase.v1beta1.ConnectRequest.RequestCase getRequestCase(); +} diff --git a/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/Continent.java b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/Continent.java new file mode 100644 index 0000000000..9d44811bab --- /dev/null +++ b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/Continent.java @@ -0,0 +1,156 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: schema/google/showcase/v1beta1/compliance.proto +// Protobuf Java Version: 4.33.2 + +package com.google.showcase.v1beta1; + +/** Protobuf enum {@code google.showcase.v1beta1.Continent} */ +@com.google.protobuf.Generated +public enum Continent implements com.google.protobuf.ProtocolMessageEnum { + /** CONTINENT_UNSPECIFIED = 0; */ + CONTINENT_UNSPECIFIED(0), + /** AFRICA = 1; */ + AFRICA(1), + /** AMERICA = 2; */ + AMERICA(2), + /** ANTARTICA = 3; */ + ANTARTICA(3), + /** AUSTRALIA = 4; */ + AUSTRALIA(4), + /** EUROPE = 5; */ + EUROPE(5), + UNRECOGNIZED(-1), + ; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "Continent"); + } + + /** CONTINENT_UNSPECIFIED = 0; */ + public static final int CONTINENT_UNSPECIFIED_VALUE = 0; + + /** AFRICA = 1; */ + public static final int AFRICA_VALUE = 1; + + /** AMERICA = 2; */ + public static final int AMERICA_VALUE = 2; + + /** ANTARTICA = 3; */ + public static final int ANTARTICA_VALUE = 3; + + /** AUSTRALIA = 4; */ + public static final int AUSTRALIA_VALUE = 4; + + /** EUROPE = 5; */ + public static final int EUROPE_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 Continent 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 Continent forNumber(int value) { + switch (value) { + case 0: + return CONTINENT_UNSPECIFIED; + case 1: + return AFRICA; + case 2: + return AMERICA; + case 3: + return ANTARTICA; + case 4: + return AUSTRALIA; + case 5: + return EUROPE; + 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 Continent findValueByNumber(int number) { + return Continent.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 com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.showcase.v1beta1.ComplianceOuterClass.getDescriptor().getEnumTypes().get(0); + } + + private static final Continent[] VALUES = values(); + + public static Continent 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 Continent(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.showcase.v1beta1.Continent) +} diff --git a/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/CreateBlurbRequest.java b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/CreateBlurbRequest.java new file mode 100644 index 0000000000..c0b1ee349c --- /dev/null +++ b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/CreateBlurbRequest.java @@ -0,0 +1,901 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: schema/google/showcase/v1beta1/messaging.proto +// Protobuf Java Version: 4.33.2 + +package com.google.showcase.v1beta1; + +/** + * + * + *
        + * The request message for the google.showcase.v1beta1.Messaging\CreateBlurb
        + * method.
        + * 
        + * + * Protobuf type {@code google.showcase.v1beta1.CreateBlurbRequest} + */ +@com.google.protobuf.Generated +public final class CreateBlurbRequest extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.CreateBlurbRequest) + CreateBlurbRequestOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "CreateBlurbRequest"); + } + + // Use CreateBlurbRequest.newBuilder() to construct. + private CreateBlurbRequest(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private CreateBlurbRequest() { + parent_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.MessagingOuterClass + .internal_static_google_showcase_v1beta1_CreateBlurbRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.MessagingOuterClass + .internal_static_google_showcase_v1beta1_CreateBlurbRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.CreateBlurbRequest.class, + com.google.showcase.v1beta1.CreateBlurbRequest.Builder.class); + } + + private int bitField0_; + public static final int PARENT_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object parent_ = ""; + + /** + * + * + *
        +   * The resource name of the chat room or user profile that this blurb will
        +   * be tied to.
        +   * 
        + * + * + * 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; + } + } + + /** + * + * + *
        +   * The resource name of the chat room or user profile that this blurb will
        +   * be tied to.
        +   * 
        + * + * + * 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 BLURB_FIELD_NUMBER = 2; + private com.google.showcase.v1beta1.Blurb blurb_; + + /** + * + * + *
        +   * The blurb to create.
        +   * 
        + * + * .google.showcase.v1beta1.Blurb blurb = 2; + * + * @return Whether the blurb field is set. + */ + @java.lang.Override + public boolean hasBlurb() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
        +   * The blurb to create.
        +   * 
        + * + * .google.showcase.v1beta1.Blurb blurb = 2; + * + * @return The blurb. + */ + @java.lang.Override + public com.google.showcase.v1beta1.Blurb getBlurb() { + return blurb_ == null ? com.google.showcase.v1beta1.Blurb.getDefaultInstance() : blurb_; + } + + /** + * + * + *
        +   * The blurb to create.
        +   * 
        + * + * .google.showcase.v1beta1.Blurb blurb = 2; + */ + @java.lang.Override + public com.google.showcase.v1beta1.BlurbOrBuilder getBlurbOrBuilder() { + return blurb_ == null ? com.google.showcase.v1beta1.Blurb.getDefaultInstance() : blurb_; + } + + 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.GeneratedMessage.isStringEmpty(parent_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, parent_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(2, getBlurb()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(parent_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, parent_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getBlurb()); + } + 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.showcase.v1beta1.CreateBlurbRequest)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.CreateBlurbRequest other = + (com.google.showcase.v1beta1.CreateBlurbRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (hasBlurb() != other.hasBlurb()) return false; + if (hasBlurb()) { + if (!getBlurb().equals(other.getBlurb())) 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 (hasBlurb()) { + hash = (37 * hash) + BLURB_FIELD_NUMBER; + hash = (53 * hash) + getBlurb().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.showcase.v1beta1.CreateBlurbRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.CreateBlurbRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.CreateBlurbRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.CreateBlurbRequest 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.showcase.v1beta1.CreateBlurbRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.CreateBlurbRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.CreateBlurbRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.CreateBlurbRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.showcase.v1beta1.CreateBlurbRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.CreateBlurbRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.showcase.v1beta1.CreateBlurbRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.CreateBlurbRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.showcase.v1beta1.CreateBlurbRequest 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
        +   * The request message for the google.showcase.v1beta1.Messaging\CreateBlurb
        +   * method.
        +   * 
        + * + * Protobuf type {@code google.showcase.v1beta1.CreateBlurbRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.CreateBlurbRequest) + com.google.showcase.v1beta1.CreateBlurbRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.MessagingOuterClass + .internal_static_google_showcase_v1beta1_CreateBlurbRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.MessagingOuterClass + .internal_static_google_showcase_v1beta1_CreateBlurbRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.CreateBlurbRequest.class, + com.google.showcase.v1beta1.CreateBlurbRequest.Builder.class); + } + + // Construct using com.google.showcase.v1beta1.CreateBlurbRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetBlurbFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + parent_ = ""; + blurb_ = null; + if (blurbBuilder_ != null) { + blurbBuilder_.dispose(); + blurbBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.showcase.v1beta1.MessagingOuterClass + .internal_static_google_showcase_v1beta1_CreateBlurbRequest_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.CreateBlurbRequest getDefaultInstanceForType() { + return com.google.showcase.v1beta1.CreateBlurbRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.CreateBlurbRequest build() { + com.google.showcase.v1beta1.CreateBlurbRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.CreateBlurbRequest buildPartial() { + com.google.showcase.v1beta1.CreateBlurbRequest result = + new com.google.showcase.v1beta1.CreateBlurbRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.showcase.v1beta1.CreateBlurbRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.parent_ = parent_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.blurb_ = blurbBuilder_ == null ? blurb_ : blurbBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.showcase.v1beta1.CreateBlurbRequest) { + return mergeFrom((com.google.showcase.v1beta1.CreateBlurbRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.showcase.v1beta1.CreateBlurbRequest other) { + if (other == com.google.showcase.v1beta1.CreateBlurbRequest.getDefaultInstance()) return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.hasBlurb()) { + mergeBlurb(other.getBlurb()); + } + 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(internalGetBlurbFieldBuilder().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_ = ""; + + /** + * + * + *
        +     * The resource name of the chat room or user profile that this blurb will
        +     * be tied to.
        +     * 
        + * + * + * 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; + } + } + + /** + * + * + *
        +     * The resource name of the chat room or user profile that this blurb will
        +     * be tied to.
        +     * 
        + * + * + * 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; + } + } + + /** + * + * + *
        +     * The resource name of the chat room or user profile that this blurb will
        +     * be tied to.
        +     * 
        + * + * + * 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; + } + + /** + * + * + *
        +     * The resource name of the chat room or user profile that this blurb will
        +     * be tied to.
        +     * 
        + * + * + * 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; + } + + /** + * + * + *
        +     * The resource name of the chat room or user profile that this blurb will
        +     * be tied to.
        +     * 
        + * + * + * 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.showcase.v1beta1.Blurb blurb_; + private com.google.protobuf.SingleFieldBuilder< + com.google.showcase.v1beta1.Blurb, + com.google.showcase.v1beta1.Blurb.Builder, + com.google.showcase.v1beta1.BlurbOrBuilder> + blurbBuilder_; + + /** + * + * + *
        +     * The blurb to create.
        +     * 
        + * + * .google.showcase.v1beta1.Blurb blurb = 2; + * + * @return Whether the blurb field is set. + */ + public boolean hasBlurb() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
        +     * The blurb to create.
        +     * 
        + * + * .google.showcase.v1beta1.Blurb blurb = 2; + * + * @return The blurb. + */ + public com.google.showcase.v1beta1.Blurb getBlurb() { + if (blurbBuilder_ == null) { + return blurb_ == null ? com.google.showcase.v1beta1.Blurb.getDefaultInstance() : blurb_; + } else { + return blurbBuilder_.getMessage(); + } + } + + /** + * + * + *
        +     * The blurb to create.
        +     * 
        + * + * .google.showcase.v1beta1.Blurb blurb = 2; + */ + public Builder setBlurb(com.google.showcase.v1beta1.Blurb value) { + if (blurbBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + blurb_ = value; + } else { + blurbBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
        +     * The blurb to create.
        +     * 
        + * + * .google.showcase.v1beta1.Blurb blurb = 2; + */ + public Builder setBlurb(com.google.showcase.v1beta1.Blurb.Builder builderForValue) { + if (blurbBuilder_ == null) { + blurb_ = builderForValue.build(); + } else { + blurbBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
        +     * The blurb to create.
        +     * 
        + * + * .google.showcase.v1beta1.Blurb blurb = 2; + */ + public Builder mergeBlurb(com.google.showcase.v1beta1.Blurb value) { + if (blurbBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && blurb_ != null + && blurb_ != com.google.showcase.v1beta1.Blurb.getDefaultInstance()) { + getBlurbBuilder().mergeFrom(value); + } else { + blurb_ = value; + } + } else { + blurbBuilder_.mergeFrom(value); + } + if (blurb_ != null) { + bitField0_ |= 0x00000002; + onChanged(); + } + return this; + } + + /** + * + * + *
        +     * The blurb to create.
        +     * 
        + * + * .google.showcase.v1beta1.Blurb blurb = 2; + */ + public Builder clearBlurb() { + bitField0_ = (bitField0_ & ~0x00000002); + blurb_ = null; + if (blurbBuilder_ != null) { + blurbBuilder_.dispose(); + blurbBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
        +     * The blurb to create.
        +     * 
        + * + * .google.showcase.v1beta1.Blurb blurb = 2; + */ + public com.google.showcase.v1beta1.Blurb.Builder getBlurbBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return internalGetBlurbFieldBuilder().getBuilder(); + } + + /** + * + * + *
        +     * The blurb to create.
        +     * 
        + * + * .google.showcase.v1beta1.Blurb blurb = 2; + */ + public com.google.showcase.v1beta1.BlurbOrBuilder getBlurbOrBuilder() { + if (blurbBuilder_ != null) { + return blurbBuilder_.getMessageOrBuilder(); + } else { + return blurb_ == null ? com.google.showcase.v1beta1.Blurb.getDefaultInstance() : blurb_; + } + } + + /** + * + * + *
        +     * The blurb to create.
        +     * 
        + * + * .google.showcase.v1beta1.Blurb blurb = 2; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.showcase.v1beta1.Blurb, + com.google.showcase.v1beta1.Blurb.Builder, + com.google.showcase.v1beta1.BlurbOrBuilder> + internalGetBlurbFieldBuilder() { + if (blurbBuilder_ == null) { + blurbBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.showcase.v1beta1.Blurb, + com.google.showcase.v1beta1.Blurb.Builder, + com.google.showcase.v1beta1.BlurbOrBuilder>( + getBlurb(), getParentForChildren(), isClean()); + blurb_ = null; + } + return blurbBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.showcase.v1beta1.CreateBlurbRequest) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.CreateBlurbRequest) + private static final com.google.showcase.v1beta1.CreateBlurbRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.CreateBlurbRequest(); + } + + public static com.google.showcase.v1beta1.CreateBlurbRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CreateBlurbRequest 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.showcase.v1beta1.CreateBlurbRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/CreateBlurbRequestOrBuilder.java b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/CreateBlurbRequestOrBuilder.java new file mode 100644 index 0000000000..fb5d641049 --- /dev/null +++ b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/CreateBlurbRequestOrBuilder.java @@ -0,0 +1,97 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: schema/google/showcase/v1beta1/messaging.proto +// Protobuf Java Version: 4.33.2 + +package com.google.showcase.v1beta1; + +@com.google.protobuf.Generated +public interface CreateBlurbRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.CreateBlurbRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
        +   * The resource name of the chat room or user profile that this blurb will
        +   * be tied to.
        +   * 
        + * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + + /** + * + * + *
        +   * The resource name of the chat room or user profile that this blurb will
        +   * be tied to.
        +   * 
        + * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
        +   * The blurb to create.
        +   * 
        + * + * .google.showcase.v1beta1.Blurb blurb = 2; + * + * @return Whether the blurb field is set. + */ + boolean hasBlurb(); + + /** + * + * + *
        +   * The blurb to create.
        +   * 
        + * + * .google.showcase.v1beta1.Blurb blurb = 2; + * + * @return The blurb. + */ + com.google.showcase.v1beta1.Blurb getBlurb(); + + /** + * + * + *
        +   * The blurb to create.
        +   * 
        + * + * .google.showcase.v1beta1.Blurb blurb = 2; + */ + com.google.showcase.v1beta1.BlurbOrBuilder getBlurbOrBuilder(); +} diff --git a/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/CreateRoomRequest.java b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/CreateRoomRequest.java new file mode 100644 index 0000000000..1e310e343e --- /dev/null +++ b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/CreateRoomRequest.java @@ -0,0 +1,690 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: schema/google/showcase/v1beta1/messaging.proto +// Protobuf Java Version: 4.33.2 + +package com.google.showcase.v1beta1; + +/** + * + * + *
        + * The request message for the google.showcase.v1beta1.Messaging\CreateRoom
        + * method.
        + * 
        + * + * Protobuf type {@code google.showcase.v1beta1.CreateRoomRequest} + */ +@com.google.protobuf.Generated +public final class CreateRoomRequest extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.CreateRoomRequest) + CreateRoomRequestOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "CreateRoomRequest"); + } + + // Use CreateRoomRequest.newBuilder() to construct. + private CreateRoomRequest(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private CreateRoomRequest() {} + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.MessagingOuterClass + .internal_static_google_showcase_v1beta1_CreateRoomRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.MessagingOuterClass + .internal_static_google_showcase_v1beta1_CreateRoomRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.CreateRoomRequest.class, + com.google.showcase.v1beta1.CreateRoomRequest.Builder.class); + } + + private int bitField0_; + public static final int ROOM_FIELD_NUMBER = 1; + private com.google.showcase.v1beta1.Room room_; + + /** + * + * + *
        +   * The room to create.
        +   * 
        + * + * .google.showcase.v1beta1.Room room = 1; + * + * @return Whether the room field is set. + */ + @java.lang.Override + public boolean hasRoom() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
        +   * The room to create.
        +   * 
        + * + * .google.showcase.v1beta1.Room room = 1; + * + * @return The room. + */ + @java.lang.Override + public com.google.showcase.v1beta1.Room getRoom() { + return room_ == null ? com.google.showcase.v1beta1.Room.getDefaultInstance() : room_; + } + + /** + * + * + *
        +   * The room to create.
        +   * 
        + * + * .google.showcase.v1beta1.Room room = 1; + */ + @java.lang.Override + public com.google.showcase.v1beta1.RoomOrBuilder getRoomOrBuilder() { + return room_ == null ? com.google.showcase.v1beta1.Room.getDefaultInstance() : room_; + } + + 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, getRoom()); + } + 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, getRoom()); + } + 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.showcase.v1beta1.CreateRoomRequest)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.CreateRoomRequest other = + (com.google.showcase.v1beta1.CreateRoomRequest) obj; + + if (hasRoom() != other.hasRoom()) return false; + if (hasRoom()) { + if (!getRoom().equals(other.getRoom())) 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 (hasRoom()) { + hash = (37 * hash) + ROOM_FIELD_NUMBER; + hash = (53 * hash) + getRoom().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.showcase.v1beta1.CreateRoomRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.CreateRoomRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.CreateRoomRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.CreateRoomRequest 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.showcase.v1beta1.CreateRoomRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.CreateRoomRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.CreateRoomRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.CreateRoomRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.showcase.v1beta1.CreateRoomRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.CreateRoomRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.showcase.v1beta1.CreateRoomRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.CreateRoomRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.showcase.v1beta1.CreateRoomRequest 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
        +   * The request message for the google.showcase.v1beta1.Messaging\CreateRoom
        +   * method.
        +   * 
        + * + * Protobuf type {@code google.showcase.v1beta1.CreateRoomRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.CreateRoomRequest) + com.google.showcase.v1beta1.CreateRoomRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.MessagingOuterClass + .internal_static_google_showcase_v1beta1_CreateRoomRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.MessagingOuterClass + .internal_static_google_showcase_v1beta1_CreateRoomRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.CreateRoomRequest.class, + com.google.showcase.v1beta1.CreateRoomRequest.Builder.class); + } + + // Construct using com.google.showcase.v1beta1.CreateRoomRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetRoomFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + room_ = null; + if (roomBuilder_ != null) { + roomBuilder_.dispose(); + roomBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.showcase.v1beta1.MessagingOuterClass + .internal_static_google_showcase_v1beta1_CreateRoomRequest_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.CreateRoomRequest getDefaultInstanceForType() { + return com.google.showcase.v1beta1.CreateRoomRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.CreateRoomRequest build() { + com.google.showcase.v1beta1.CreateRoomRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.CreateRoomRequest buildPartial() { + com.google.showcase.v1beta1.CreateRoomRequest result = + new com.google.showcase.v1beta1.CreateRoomRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.showcase.v1beta1.CreateRoomRequest result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.room_ = roomBuilder_ == null ? room_ : roomBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.showcase.v1beta1.CreateRoomRequest) { + return mergeFrom((com.google.showcase.v1beta1.CreateRoomRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.showcase.v1beta1.CreateRoomRequest other) { + if (other == com.google.showcase.v1beta1.CreateRoomRequest.getDefaultInstance()) return this; + if (other.hasRoom()) { + mergeRoom(other.getRoom()); + } + 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(internalGetRoomFieldBuilder().getBuilder(), extensionRegistry); + 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 com.google.showcase.v1beta1.Room room_; + private com.google.protobuf.SingleFieldBuilder< + com.google.showcase.v1beta1.Room, + com.google.showcase.v1beta1.Room.Builder, + com.google.showcase.v1beta1.RoomOrBuilder> + roomBuilder_; + + /** + * + * + *
        +     * The room to create.
        +     * 
        + * + * .google.showcase.v1beta1.Room room = 1; + * + * @return Whether the room field is set. + */ + public boolean hasRoom() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
        +     * The room to create.
        +     * 
        + * + * .google.showcase.v1beta1.Room room = 1; + * + * @return The room. + */ + public com.google.showcase.v1beta1.Room getRoom() { + if (roomBuilder_ == null) { + return room_ == null ? com.google.showcase.v1beta1.Room.getDefaultInstance() : room_; + } else { + return roomBuilder_.getMessage(); + } + } + + /** + * + * + *
        +     * The room to create.
        +     * 
        + * + * .google.showcase.v1beta1.Room room = 1; + */ + public Builder setRoom(com.google.showcase.v1beta1.Room value) { + if (roomBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + room_ = value; + } else { + roomBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
        +     * The room to create.
        +     * 
        + * + * .google.showcase.v1beta1.Room room = 1; + */ + public Builder setRoom(com.google.showcase.v1beta1.Room.Builder builderForValue) { + if (roomBuilder_ == null) { + room_ = builderForValue.build(); + } else { + roomBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
        +     * The room to create.
        +     * 
        + * + * .google.showcase.v1beta1.Room room = 1; + */ + public Builder mergeRoom(com.google.showcase.v1beta1.Room value) { + if (roomBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) + && room_ != null + && room_ != com.google.showcase.v1beta1.Room.getDefaultInstance()) { + getRoomBuilder().mergeFrom(value); + } else { + room_ = value; + } + } else { + roomBuilder_.mergeFrom(value); + } + if (room_ != null) { + bitField0_ |= 0x00000001; + onChanged(); + } + return this; + } + + /** + * + * + *
        +     * The room to create.
        +     * 
        + * + * .google.showcase.v1beta1.Room room = 1; + */ + public Builder clearRoom() { + bitField0_ = (bitField0_ & ~0x00000001); + room_ = null; + if (roomBuilder_ != null) { + roomBuilder_.dispose(); + roomBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
        +     * The room to create.
        +     * 
        + * + * .google.showcase.v1beta1.Room room = 1; + */ + public com.google.showcase.v1beta1.Room.Builder getRoomBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return internalGetRoomFieldBuilder().getBuilder(); + } + + /** + * + * + *
        +     * The room to create.
        +     * 
        + * + * .google.showcase.v1beta1.Room room = 1; + */ + public com.google.showcase.v1beta1.RoomOrBuilder getRoomOrBuilder() { + if (roomBuilder_ != null) { + return roomBuilder_.getMessageOrBuilder(); + } else { + return room_ == null ? com.google.showcase.v1beta1.Room.getDefaultInstance() : room_; + } + } + + /** + * + * + *
        +     * The room to create.
        +     * 
        + * + * .google.showcase.v1beta1.Room room = 1; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.showcase.v1beta1.Room, + com.google.showcase.v1beta1.Room.Builder, + com.google.showcase.v1beta1.RoomOrBuilder> + internalGetRoomFieldBuilder() { + if (roomBuilder_ == null) { + roomBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.showcase.v1beta1.Room, + com.google.showcase.v1beta1.Room.Builder, + com.google.showcase.v1beta1.RoomOrBuilder>( + getRoom(), getParentForChildren(), isClean()); + room_ = null; + } + return roomBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.showcase.v1beta1.CreateRoomRequest) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.CreateRoomRequest) + private static final com.google.showcase.v1beta1.CreateRoomRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.CreateRoomRequest(); + } + + public static com.google.showcase.v1beta1.CreateRoomRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CreateRoomRequest 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.showcase.v1beta1.CreateRoomRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/CreateRoomRequestOrBuilder.java b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/CreateRoomRequestOrBuilder.java new file mode 100644 index 0000000000..a15ad18b17 --- /dev/null +++ b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/CreateRoomRequestOrBuilder.java @@ -0,0 +1,65 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: schema/google/showcase/v1beta1/messaging.proto +// Protobuf Java Version: 4.33.2 + +package com.google.showcase.v1beta1; + +@com.google.protobuf.Generated +public interface CreateRoomRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.CreateRoomRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
        +   * The room to create.
        +   * 
        + * + * .google.showcase.v1beta1.Room room = 1; + * + * @return Whether the room field is set. + */ + boolean hasRoom(); + + /** + * + * + *
        +   * The room to create.
        +   * 
        + * + * .google.showcase.v1beta1.Room room = 1; + * + * @return The room. + */ + com.google.showcase.v1beta1.Room getRoom(); + + /** + * + * + *
        +   * The room to create.
        +   * 
        + * + * .google.showcase.v1beta1.Room room = 1; + */ + com.google.showcase.v1beta1.RoomOrBuilder getRoomOrBuilder(); +} diff --git a/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/CreateSequenceRequest.java b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/CreateSequenceRequest.java new file mode 100644 index 0000000000..fb0d757e44 --- /dev/null +++ b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/CreateSequenceRequest.java @@ -0,0 +1,594 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: schema/google/showcase/v1beta1/sequence.proto +// Protobuf Java Version: 4.33.2 + +package com.google.showcase.v1beta1; + +/** Protobuf type {@code google.showcase.v1beta1.CreateSequenceRequest} */ +@com.google.protobuf.Generated +public final class CreateSequenceRequest extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.CreateSequenceRequest) + CreateSequenceRequestOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "CreateSequenceRequest"); + } + + // Use CreateSequenceRequest.newBuilder() to construct. + private CreateSequenceRequest(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private CreateSequenceRequest() {} + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.SequenceOuterClass + .internal_static_google_showcase_v1beta1_CreateSequenceRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.SequenceOuterClass + .internal_static_google_showcase_v1beta1_CreateSequenceRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.CreateSequenceRequest.class, + com.google.showcase.v1beta1.CreateSequenceRequest.Builder.class); + } + + private int bitField0_; + public static final int SEQUENCE_FIELD_NUMBER = 1; + private com.google.showcase.v1beta1.Sequence sequence_; + + /** + * .google.showcase.v1beta1.Sequence sequence = 1; + * + * @return Whether the sequence field is set. + */ + @java.lang.Override + public boolean hasSequence() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * .google.showcase.v1beta1.Sequence sequence = 1; + * + * @return The sequence. + */ + @java.lang.Override + public com.google.showcase.v1beta1.Sequence getSequence() { + return sequence_ == null + ? com.google.showcase.v1beta1.Sequence.getDefaultInstance() + : sequence_; + } + + /** .google.showcase.v1beta1.Sequence sequence = 1; */ + @java.lang.Override + public com.google.showcase.v1beta1.SequenceOrBuilder getSequenceOrBuilder() { + return sequence_ == null + ? com.google.showcase.v1beta1.Sequence.getDefaultInstance() + : sequence_; + } + + 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, getSequence()); + } + 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, getSequence()); + } + 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.showcase.v1beta1.CreateSequenceRequest)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.CreateSequenceRequest other = + (com.google.showcase.v1beta1.CreateSequenceRequest) obj; + + if (hasSequence() != other.hasSequence()) return false; + if (hasSequence()) { + if (!getSequence().equals(other.getSequence())) 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 (hasSequence()) { + hash = (37 * hash) + SEQUENCE_FIELD_NUMBER; + hash = (53 * hash) + getSequence().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.showcase.v1beta1.CreateSequenceRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.CreateSequenceRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.CreateSequenceRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.CreateSequenceRequest 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.showcase.v1beta1.CreateSequenceRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.CreateSequenceRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.CreateSequenceRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.CreateSequenceRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.showcase.v1beta1.CreateSequenceRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.CreateSequenceRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.showcase.v1beta1.CreateSequenceRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.CreateSequenceRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.showcase.v1beta1.CreateSequenceRequest 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** Protobuf type {@code google.showcase.v1beta1.CreateSequenceRequest} */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.CreateSequenceRequest) + com.google.showcase.v1beta1.CreateSequenceRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.SequenceOuterClass + .internal_static_google_showcase_v1beta1_CreateSequenceRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.SequenceOuterClass + .internal_static_google_showcase_v1beta1_CreateSequenceRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.CreateSequenceRequest.class, + com.google.showcase.v1beta1.CreateSequenceRequest.Builder.class); + } + + // Construct using com.google.showcase.v1beta1.CreateSequenceRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetSequenceFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + sequence_ = null; + if (sequenceBuilder_ != null) { + sequenceBuilder_.dispose(); + sequenceBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.showcase.v1beta1.SequenceOuterClass + .internal_static_google_showcase_v1beta1_CreateSequenceRequest_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.CreateSequenceRequest getDefaultInstanceForType() { + return com.google.showcase.v1beta1.CreateSequenceRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.CreateSequenceRequest build() { + com.google.showcase.v1beta1.CreateSequenceRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.CreateSequenceRequest buildPartial() { + com.google.showcase.v1beta1.CreateSequenceRequest result = + new com.google.showcase.v1beta1.CreateSequenceRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.showcase.v1beta1.CreateSequenceRequest result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.sequence_ = sequenceBuilder_ == null ? sequence_ : sequenceBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.showcase.v1beta1.CreateSequenceRequest) { + return mergeFrom((com.google.showcase.v1beta1.CreateSequenceRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.showcase.v1beta1.CreateSequenceRequest other) { + if (other == com.google.showcase.v1beta1.CreateSequenceRequest.getDefaultInstance()) + return this; + if (other.hasSequence()) { + mergeSequence(other.getSequence()); + } + 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( + internalGetSequenceFieldBuilder().getBuilder(), extensionRegistry); + 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 com.google.showcase.v1beta1.Sequence sequence_; + private com.google.protobuf.SingleFieldBuilder< + com.google.showcase.v1beta1.Sequence, + com.google.showcase.v1beta1.Sequence.Builder, + com.google.showcase.v1beta1.SequenceOrBuilder> + sequenceBuilder_; + + /** + * .google.showcase.v1beta1.Sequence sequence = 1; + * + * @return Whether the sequence field is set. + */ + public boolean hasSequence() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * .google.showcase.v1beta1.Sequence sequence = 1; + * + * @return The sequence. + */ + public com.google.showcase.v1beta1.Sequence getSequence() { + if (sequenceBuilder_ == null) { + return sequence_ == null + ? com.google.showcase.v1beta1.Sequence.getDefaultInstance() + : sequence_; + } else { + return sequenceBuilder_.getMessage(); + } + } + + /** .google.showcase.v1beta1.Sequence sequence = 1; */ + public Builder setSequence(com.google.showcase.v1beta1.Sequence value) { + if (sequenceBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + sequence_ = value; + } else { + sequenceBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** .google.showcase.v1beta1.Sequence sequence = 1; */ + public Builder setSequence(com.google.showcase.v1beta1.Sequence.Builder builderForValue) { + if (sequenceBuilder_ == null) { + sequence_ = builderForValue.build(); + } else { + sequenceBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** .google.showcase.v1beta1.Sequence sequence = 1; */ + public Builder mergeSequence(com.google.showcase.v1beta1.Sequence value) { + if (sequenceBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) + && sequence_ != null + && sequence_ != com.google.showcase.v1beta1.Sequence.getDefaultInstance()) { + getSequenceBuilder().mergeFrom(value); + } else { + sequence_ = value; + } + } else { + sequenceBuilder_.mergeFrom(value); + } + if (sequence_ != null) { + bitField0_ |= 0x00000001; + onChanged(); + } + return this; + } + + /** .google.showcase.v1beta1.Sequence sequence = 1; */ + public Builder clearSequence() { + bitField0_ = (bitField0_ & ~0x00000001); + sequence_ = null; + if (sequenceBuilder_ != null) { + sequenceBuilder_.dispose(); + sequenceBuilder_ = null; + } + onChanged(); + return this; + } + + /** .google.showcase.v1beta1.Sequence sequence = 1; */ + public com.google.showcase.v1beta1.Sequence.Builder getSequenceBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return internalGetSequenceFieldBuilder().getBuilder(); + } + + /** .google.showcase.v1beta1.Sequence sequence = 1; */ + public com.google.showcase.v1beta1.SequenceOrBuilder getSequenceOrBuilder() { + if (sequenceBuilder_ != null) { + return sequenceBuilder_.getMessageOrBuilder(); + } else { + return sequence_ == null + ? com.google.showcase.v1beta1.Sequence.getDefaultInstance() + : sequence_; + } + } + + /** .google.showcase.v1beta1.Sequence sequence = 1; */ + private com.google.protobuf.SingleFieldBuilder< + com.google.showcase.v1beta1.Sequence, + com.google.showcase.v1beta1.Sequence.Builder, + com.google.showcase.v1beta1.SequenceOrBuilder> + internalGetSequenceFieldBuilder() { + if (sequenceBuilder_ == null) { + sequenceBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.showcase.v1beta1.Sequence, + com.google.showcase.v1beta1.Sequence.Builder, + com.google.showcase.v1beta1.SequenceOrBuilder>( + getSequence(), getParentForChildren(), isClean()); + sequence_ = null; + } + return sequenceBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.showcase.v1beta1.CreateSequenceRequest) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.CreateSequenceRequest) + private static final com.google.showcase.v1beta1.CreateSequenceRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.CreateSequenceRequest(); + } + + public static com.google.showcase.v1beta1.CreateSequenceRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CreateSequenceRequest 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.showcase.v1beta1.CreateSequenceRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/CreateSequenceRequestOrBuilder.java b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/CreateSequenceRequestOrBuilder.java new file mode 100644 index 0000000000..52ce6d3269 --- /dev/null +++ b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/CreateSequenceRequestOrBuilder.java @@ -0,0 +1,45 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: schema/google/showcase/v1beta1/sequence.proto +// Protobuf Java Version: 4.33.2 + +package com.google.showcase.v1beta1; + +@com.google.protobuf.Generated +public interface CreateSequenceRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.CreateSequenceRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * .google.showcase.v1beta1.Sequence sequence = 1; + * + * @return Whether the sequence field is set. + */ + boolean hasSequence(); + + /** + * .google.showcase.v1beta1.Sequence sequence = 1; + * + * @return The sequence. + */ + com.google.showcase.v1beta1.Sequence getSequence(); + + /** .google.showcase.v1beta1.Sequence sequence = 1; */ + com.google.showcase.v1beta1.SequenceOrBuilder getSequenceOrBuilder(); +} diff --git a/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/CreateSessionRequest.java b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/CreateSessionRequest.java new file mode 100644 index 0000000000..ed8d6457dc --- /dev/null +++ b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/CreateSessionRequest.java @@ -0,0 +1,717 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: schema/google/showcase/v1beta1/testing.proto +// Protobuf Java Version: 4.33.2 + +package com.google.showcase.v1beta1; + +/** + * + * + *
        + * The request for the CreateSession method.
        + * 
        + * + * Protobuf type {@code google.showcase.v1beta1.CreateSessionRequest} + */ +@com.google.protobuf.Generated +public final class CreateSessionRequest extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.CreateSessionRequest) + CreateSessionRequestOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "CreateSessionRequest"); + } + + // Use CreateSessionRequest.newBuilder() to construct. + private CreateSessionRequest(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private CreateSessionRequest() {} + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.TestingOuterClass + .internal_static_google_showcase_v1beta1_CreateSessionRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.TestingOuterClass + .internal_static_google_showcase_v1beta1_CreateSessionRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.CreateSessionRequest.class, + com.google.showcase.v1beta1.CreateSessionRequest.Builder.class); + } + + private int bitField0_; + public static final int SESSION_FIELD_NUMBER = 1; + private com.google.showcase.v1beta1.Session session_; + + /** + * + * + *
        +   * The session to be created.
        +   * Sessions are immutable once they are created (although they can
        +   * be deleted).
        +   * 
        + * + * .google.showcase.v1beta1.Session session = 1; + * + * @return Whether the session field is set. + */ + @java.lang.Override + public boolean hasSession() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
        +   * The session to be created.
        +   * Sessions are immutable once they are created (although they can
        +   * be deleted).
        +   * 
        + * + * .google.showcase.v1beta1.Session session = 1; + * + * @return The session. + */ + @java.lang.Override + public com.google.showcase.v1beta1.Session getSession() { + return session_ == null ? com.google.showcase.v1beta1.Session.getDefaultInstance() : session_; + } + + /** + * + * + *
        +   * The session to be created.
        +   * Sessions are immutable once they are created (although they can
        +   * be deleted).
        +   * 
        + * + * .google.showcase.v1beta1.Session session = 1; + */ + @java.lang.Override + public com.google.showcase.v1beta1.SessionOrBuilder getSessionOrBuilder() { + return session_ == null ? com.google.showcase.v1beta1.Session.getDefaultInstance() : session_; + } + + 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, getSession()); + } + 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, getSession()); + } + 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.showcase.v1beta1.CreateSessionRequest)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.CreateSessionRequest other = + (com.google.showcase.v1beta1.CreateSessionRequest) obj; + + if (hasSession() != other.hasSession()) return false; + if (hasSession()) { + if (!getSession().equals(other.getSession())) 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 (hasSession()) { + hash = (37 * hash) + SESSION_FIELD_NUMBER; + hash = (53 * hash) + getSession().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.showcase.v1beta1.CreateSessionRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.CreateSessionRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.CreateSessionRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.CreateSessionRequest 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.showcase.v1beta1.CreateSessionRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.CreateSessionRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.CreateSessionRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.CreateSessionRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.showcase.v1beta1.CreateSessionRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.CreateSessionRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.showcase.v1beta1.CreateSessionRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.CreateSessionRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.showcase.v1beta1.CreateSessionRequest 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
        +   * The request for the CreateSession method.
        +   * 
        + * + * Protobuf type {@code google.showcase.v1beta1.CreateSessionRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.CreateSessionRequest) + com.google.showcase.v1beta1.CreateSessionRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.TestingOuterClass + .internal_static_google_showcase_v1beta1_CreateSessionRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.TestingOuterClass + .internal_static_google_showcase_v1beta1_CreateSessionRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.CreateSessionRequest.class, + com.google.showcase.v1beta1.CreateSessionRequest.Builder.class); + } + + // Construct using com.google.showcase.v1beta1.CreateSessionRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetSessionFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + session_ = null; + if (sessionBuilder_ != null) { + sessionBuilder_.dispose(); + sessionBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.showcase.v1beta1.TestingOuterClass + .internal_static_google_showcase_v1beta1_CreateSessionRequest_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.CreateSessionRequest getDefaultInstanceForType() { + return com.google.showcase.v1beta1.CreateSessionRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.CreateSessionRequest build() { + com.google.showcase.v1beta1.CreateSessionRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.CreateSessionRequest buildPartial() { + com.google.showcase.v1beta1.CreateSessionRequest result = + new com.google.showcase.v1beta1.CreateSessionRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.showcase.v1beta1.CreateSessionRequest result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.session_ = sessionBuilder_ == null ? session_ : sessionBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.showcase.v1beta1.CreateSessionRequest) { + return mergeFrom((com.google.showcase.v1beta1.CreateSessionRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.showcase.v1beta1.CreateSessionRequest other) { + if (other == com.google.showcase.v1beta1.CreateSessionRequest.getDefaultInstance()) + return this; + if (other.hasSession()) { + mergeSession(other.getSession()); + } + 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(internalGetSessionFieldBuilder().getBuilder(), extensionRegistry); + 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 com.google.showcase.v1beta1.Session session_; + private com.google.protobuf.SingleFieldBuilder< + com.google.showcase.v1beta1.Session, + com.google.showcase.v1beta1.Session.Builder, + com.google.showcase.v1beta1.SessionOrBuilder> + sessionBuilder_; + + /** + * + * + *
        +     * The session to be created.
        +     * Sessions are immutable once they are created (although they can
        +     * be deleted).
        +     * 
        + * + * .google.showcase.v1beta1.Session session = 1; + * + * @return Whether the session field is set. + */ + public boolean hasSession() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
        +     * The session to be created.
        +     * Sessions are immutable once they are created (although they can
        +     * be deleted).
        +     * 
        + * + * .google.showcase.v1beta1.Session session = 1; + * + * @return The session. + */ + public com.google.showcase.v1beta1.Session getSession() { + if (sessionBuilder_ == null) { + return session_ == null + ? com.google.showcase.v1beta1.Session.getDefaultInstance() + : session_; + } else { + return sessionBuilder_.getMessage(); + } + } + + /** + * + * + *
        +     * The session to be created.
        +     * Sessions are immutable once they are created (although they can
        +     * be deleted).
        +     * 
        + * + * .google.showcase.v1beta1.Session session = 1; + */ + public Builder setSession(com.google.showcase.v1beta1.Session value) { + if (sessionBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + session_ = value; + } else { + sessionBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
        +     * The session to be created.
        +     * Sessions are immutable once they are created (although they can
        +     * be deleted).
        +     * 
        + * + * .google.showcase.v1beta1.Session session = 1; + */ + public Builder setSession(com.google.showcase.v1beta1.Session.Builder builderForValue) { + if (sessionBuilder_ == null) { + session_ = builderForValue.build(); + } else { + sessionBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
        +     * The session to be created.
        +     * Sessions are immutable once they are created (although they can
        +     * be deleted).
        +     * 
        + * + * .google.showcase.v1beta1.Session session = 1; + */ + public Builder mergeSession(com.google.showcase.v1beta1.Session value) { + if (sessionBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) + && session_ != null + && session_ != com.google.showcase.v1beta1.Session.getDefaultInstance()) { + getSessionBuilder().mergeFrom(value); + } else { + session_ = value; + } + } else { + sessionBuilder_.mergeFrom(value); + } + if (session_ != null) { + bitField0_ |= 0x00000001; + onChanged(); + } + return this; + } + + /** + * + * + *
        +     * The session to be created.
        +     * Sessions are immutable once they are created (although they can
        +     * be deleted).
        +     * 
        + * + * .google.showcase.v1beta1.Session session = 1; + */ + public Builder clearSession() { + bitField0_ = (bitField0_ & ~0x00000001); + session_ = null; + if (sessionBuilder_ != null) { + sessionBuilder_.dispose(); + sessionBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
        +     * The session to be created.
        +     * Sessions are immutable once they are created (although they can
        +     * be deleted).
        +     * 
        + * + * .google.showcase.v1beta1.Session session = 1; + */ + public com.google.showcase.v1beta1.Session.Builder getSessionBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return internalGetSessionFieldBuilder().getBuilder(); + } + + /** + * + * + *
        +     * The session to be created.
        +     * Sessions are immutable once they are created (although they can
        +     * be deleted).
        +     * 
        + * + * .google.showcase.v1beta1.Session session = 1; + */ + public com.google.showcase.v1beta1.SessionOrBuilder getSessionOrBuilder() { + if (sessionBuilder_ != null) { + return sessionBuilder_.getMessageOrBuilder(); + } else { + return session_ == null + ? com.google.showcase.v1beta1.Session.getDefaultInstance() + : session_; + } + } + + /** + * + * + *
        +     * The session to be created.
        +     * Sessions are immutable once they are created (although they can
        +     * be deleted).
        +     * 
        + * + * .google.showcase.v1beta1.Session session = 1; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.showcase.v1beta1.Session, + com.google.showcase.v1beta1.Session.Builder, + com.google.showcase.v1beta1.SessionOrBuilder> + internalGetSessionFieldBuilder() { + if (sessionBuilder_ == null) { + sessionBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.showcase.v1beta1.Session, + com.google.showcase.v1beta1.Session.Builder, + com.google.showcase.v1beta1.SessionOrBuilder>( + getSession(), getParentForChildren(), isClean()); + session_ = null; + } + return sessionBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.showcase.v1beta1.CreateSessionRequest) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.CreateSessionRequest) + private static final com.google.showcase.v1beta1.CreateSessionRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.CreateSessionRequest(); + } + + public static com.google.showcase.v1beta1.CreateSessionRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CreateSessionRequest 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.showcase.v1beta1.CreateSessionRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/CreateSessionRequestOrBuilder.java b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/CreateSessionRequestOrBuilder.java new file mode 100644 index 0000000000..14c7fb4962 --- /dev/null +++ b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/CreateSessionRequestOrBuilder.java @@ -0,0 +1,71 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: schema/google/showcase/v1beta1/testing.proto +// Protobuf Java Version: 4.33.2 + +package com.google.showcase.v1beta1; + +@com.google.protobuf.Generated +public interface CreateSessionRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.CreateSessionRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
        +   * The session to be created.
        +   * Sessions are immutable once they are created (although they can
        +   * be deleted).
        +   * 
        + * + * .google.showcase.v1beta1.Session session = 1; + * + * @return Whether the session field is set. + */ + boolean hasSession(); + + /** + * + * + *
        +   * The session to be created.
        +   * Sessions are immutable once they are created (although they can
        +   * be deleted).
        +   * 
        + * + * .google.showcase.v1beta1.Session session = 1; + * + * @return The session. + */ + com.google.showcase.v1beta1.Session getSession(); + + /** + * + * + *
        +   * The session to be created.
        +   * Sessions are immutable once they are created (although they can
        +   * be deleted).
        +   * 
        + * + * .google.showcase.v1beta1.Session session = 1; + */ + com.google.showcase.v1beta1.SessionOrBuilder getSessionOrBuilder(); +} diff --git a/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/CreateStreamingSequenceRequest.java b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/CreateStreamingSequenceRequest.java new file mode 100644 index 0000000000..43cc59a1fa --- /dev/null +++ b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/CreateStreamingSequenceRequest.java @@ -0,0 +1,600 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: schema/google/showcase/v1beta1/sequence.proto +// Protobuf Java Version: 4.33.2 + +package com.google.showcase.v1beta1; + +/** Protobuf type {@code google.showcase.v1beta1.CreateStreamingSequenceRequest} */ +@com.google.protobuf.Generated +public final class CreateStreamingSequenceRequest extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.CreateStreamingSequenceRequest) + CreateStreamingSequenceRequestOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "CreateStreamingSequenceRequest"); + } + + // Use CreateStreamingSequenceRequest.newBuilder() to construct. + private CreateStreamingSequenceRequest(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private CreateStreamingSequenceRequest() {} + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.SequenceOuterClass + .internal_static_google_showcase_v1beta1_CreateStreamingSequenceRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.SequenceOuterClass + .internal_static_google_showcase_v1beta1_CreateStreamingSequenceRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.CreateStreamingSequenceRequest.class, + com.google.showcase.v1beta1.CreateStreamingSequenceRequest.Builder.class); + } + + private int bitField0_; + public static final int STREAMING_SEQUENCE_FIELD_NUMBER = 1; + private com.google.showcase.v1beta1.StreamingSequence streamingSequence_; + + /** + * .google.showcase.v1beta1.StreamingSequence streaming_sequence = 1; + * + * @return Whether the streamingSequence field is set. + */ + @java.lang.Override + public boolean hasStreamingSequence() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * .google.showcase.v1beta1.StreamingSequence streaming_sequence = 1; + * + * @return The streamingSequence. + */ + @java.lang.Override + public com.google.showcase.v1beta1.StreamingSequence getStreamingSequence() { + return streamingSequence_ == null + ? com.google.showcase.v1beta1.StreamingSequence.getDefaultInstance() + : streamingSequence_; + } + + /** .google.showcase.v1beta1.StreamingSequence streaming_sequence = 1; */ + @java.lang.Override + public com.google.showcase.v1beta1.StreamingSequenceOrBuilder getStreamingSequenceOrBuilder() { + return streamingSequence_ == null + ? com.google.showcase.v1beta1.StreamingSequence.getDefaultInstance() + : streamingSequence_; + } + + 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, getStreamingSequence()); + } + 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, getStreamingSequence()); + } + 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.showcase.v1beta1.CreateStreamingSequenceRequest)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.CreateStreamingSequenceRequest other = + (com.google.showcase.v1beta1.CreateStreamingSequenceRequest) obj; + + if (hasStreamingSequence() != other.hasStreamingSequence()) return false; + if (hasStreamingSequence()) { + if (!getStreamingSequence().equals(other.getStreamingSequence())) 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 (hasStreamingSequence()) { + hash = (37 * hash) + STREAMING_SEQUENCE_FIELD_NUMBER; + hash = (53 * hash) + getStreamingSequence().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.showcase.v1beta1.CreateStreamingSequenceRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.CreateStreamingSequenceRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.CreateStreamingSequenceRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.CreateStreamingSequenceRequest 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.showcase.v1beta1.CreateStreamingSequenceRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.CreateStreamingSequenceRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.CreateStreamingSequenceRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.CreateStreamingSequenceRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.showcase.v1beta1.CreateStreamingSequenceRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.CreateStreamingSequenceRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.showcase.v1beta1.CreateStreamingSequenceRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.CreateStreamingSequenceRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.showcase.v1beta1.CreateStreamingSequenceRequest 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** Protobuf type {@code google.showcase.v1beta1.CreateStreamingSequenceRequest} */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.CreateStreamingSequenceRequest) + com.google.showcase.v1beta1.CreateStreamingSequenceRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.SequenceOuterClass + .internal_static_google_showcase_v1beta1_CreateStreamingSequenceRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.SequenceOuterClass + .internal_static_google_showcase_v1beta1_CreateStreamingSequenceRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.CreateStreamingSequenceRequest.class, + com.google.showcase.v1beta1.CreateStreamingSequenceRequest.Builder.class); + } + + // Construct using com.google.showcase.v1beta1.CreateStreamingSequenceRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetStreamingSequenceFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + streamingSequence_ = null; + if (streamingSequenceBuilder_ != null) { + streamingSequenceBuilder_.dispose(); + streamingSequenceBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.showcase.v1beta1.SequenceOuterClass + .internal_static_google_showcase_v1beta1_CreateStreamingSequenceRequest_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.CreateStreamingSequenceRequest getDefaultInstanceForType() { + return com.google.showcase.v1beta1.CreateStreamingSequenceRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.CreateStreamingSequenceRequest build() { + com.google.showcase.v1beta1.CreateStreamingSequenceRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.CreateStreamingSequenceRequest buildPartial() { + com.google.showcase.v1beta1.CreateStreamingSequenceRequest result = + new com.google.showcase.v1beta1.CreateStreamingSequenceRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.showcase.v1beta1.CreateStreamingSequenceRequest result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.streamingSequence_ = + streamingSequenceBuilder_ == null + ? streamingSequence_ + : streamingSequenceBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.showcase.v1beta1.CreateStreamingSequenceRequest) { + return mergeFrom((com.google.showcase.v1beta1.CreateStreamingSequenceRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.showcase.v1beta1.CreateStreamingSequenceRequest other) { + if (other == com.google.showcase.v1beta1.CreateStreamingSequenceRequest.getDefaultInstance()) + return this; + if (other.hasStreamingSequence()) { + mergeStreamingSequence(other.getStreamingSequence()); + } + 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( + internalGetStreamingSequenceFieldBuilder().getBuilder(), extensionRegistry); + 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 com.google.showcase.v1beta1.StreamingSequence streamingSequence_; + private com.google.protobuf.SingleFieldBuilder< + com.google.showcase.v1beta1.StreamingSequence, + com.google.showcase.v1beta1.StreamingSequence.Builder, + com.google.showcase.v1beta1.StreamingSequenceOrBuilder> + streamingSequenceBuilder_; + + /** + * .google.showcase.v1beta1.StreamingSequence streaming_sequence = 1; + * + * @return Whether the streamingSequence field is set. + */ + public boolean hasStreamingSequence() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * .google.showcase.v1beta1.StreamingSequence streaming_sequence = 1; + * + * @return The streamingSequence. + */ + public com.google.showcase.v1beta1.StreamingSequence getStreamingSequence() { + if (streamingSequenceBuilder_ == null) { + return streamingSequence_ == null + ? com.google.showcase.v1beta1.StreamingSequence.getDefaultInstance() + : streamingSequence_; + } else { + return streamingSequenceBuilder_.getMessage(); + } + } + + /** .google.showcase.v1beta1.StreamingSequence streaming_sequence = 1; */ + public Builder setStreamingSequence(com.google.showcase.v1beta1.StreamingSequence value) { + if (streamingSequenceBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + streamingSequence_ = value; + } else { + streamingSequenceBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** .google.showcase.v1beta1.StreamingSequence streaming_sequence = 1; */ + public Builder setStreamingSequence( + com.google.showcase.v1beta1.StreamingSequence.Builder builderForValue) { + if (streamingSequenceBuilder_ == null) { + streamingSequence_ = builderForValue.build(); + } else { + streamingSequenceBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** .google.showcase.v1beta1.StreamingSequence streaming_sequence = 1; */ + public Builder mergeStreamingSequence(com.google.showcase.v1beta1.StreamingSequence value) { + if (streamingSequenceBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) + && streamingSequence_ != null + && streamingSequence_ + != com.google.showcase.v1beta1.StreamingSequence.getDefaultInstance()) { + getStreamingSequenceBuilder().mergeFrom(value); + } else { + streamingSequence_ = value; + } + } else { + streamingSequenceBuilder_.mergeFrom(value); + } + if (streamingSequence_ != null) { + bitField0_ |= 0x00000001; + onChanged(); + } + return this; + } + + /** .google.showcase.v1beta1.StreamingSequence streaming_sequence = 1; */ + public Builder clearStreamingSequence() { + bitField0_ = (bitField0_ & ~0x00000001); + streamingSequence_ = null; + if (streamingSequenceBuilder_ != null) { + streamingSequenceBuilder_.dispose(); + streamingSequenceBuilder_ = null; + } + onChanged(); + return this; + } + + /** .google.showcase.v1beta1.StreamingSequence streaming_sequence = 1; */ + public com.google.showcase.v1beta1.StreamingSequence.Builder getStreamingSequenceBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return internalGetStreamingSequenceFieldBuilder().getBuilder(); + } + + /** .google.showcase.v1beta1.StreamingSequence streaming_sequence = 1; */ + public com.google.showcase.v1beta1.StreamingSequenceOrBuilder getStreamingSequenceOrBuilder() { + if (streamingSequenceBuilder_ != null) { + return streamingSequenceBuilder_.getMessageOrBuilder(); + } else { + return streamingSequence_ == null + ? com.google.showcase.v1beta1.StreamingSequence.getDefaultInstance() + : streamingSequence_; + } + } + + /** .google.showcase.v1beta1.StreamingSequence streaming_sequence = 1; */ + private com.google.protobuf.SingleFieldBuilder< + com.google.showcase.v1beta1.StreamingSequence, + com.google.showcase.v1beta1.StreamingSequence.Builder, + com.google.showcase.v1beta1.StreamingSequenceOrBuilder> + internalGetStreamingSequenceFieldBuilder() { + if (streamingSequenceBuilder_ == null) { + streamingSequenceBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.showcase.v1beta1.StreamingSequence, + com.google.showcase.v1beta1.StreamingSequence.Builder, + com.google.showcase.v1beta1.StreamingSequenceOrBuilder>( + getStreamingSequence(), getParentForChildren(), isClean()); + streamingSequence_ = null; + } + return streamingSequenceBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.showcase.v1beta1.CreateStreamingSequenceRequest) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.CreateStreamingSequenceRequest) + private static final com.google.showcase.v1beta1.CreateStreamingSequenceRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.CreateStreamingSequenceRequest(); + } + + public static com.google.showcase.v1beta1.CreateStreamingSequenceRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CreateStreamingSequenceRequest 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.showcase.v1beta1.CreateStreamingSequenceRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/CreateStreamingSequenceRequestOrBuilder.java b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/CreateStreamingSequenceRequestOrBuilder.java new file mode 100644 index 0000000000..cb3093be05 --- /dev/null +++ b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/CreateStreamingSequenceRequestOrBuilder.java @@ -0,0 +1,45 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: schema/google/showcase/v1beta1/sequence.proto +// Protobuf Java Version: 4.33.2 + +package com.google.showcase.v1beta1; + +@com.google.protobuf.Generated +public interface CreateStreamingSequenceRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.CreateStreamingSequenceRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * .google.showcase.v1beta1.StreamingSequence streaming_sequence = 1; + * + * @return Whether the streamingSequence field is set. + */ + boolean hasStreamingSequence(); + + /** + * .google.showcase.v1beta1.StreamingSequence streaming_sequence = 1; + * + * @return The streamingSequence. + */ + com.google.showcase.v1beta1.StreamingSequence getStreamingSequence(); + + /** .google.showcase.v1beta1.StreamingSequence streaming_sequence = 1; */ + com.google.showcase.v1beta1.StreamingSequenceOrBuilder getStreamingSequenceOrBuilder(); +} diff --git a/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/CreateUserRequest.java b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/CreateUserRequest.java new file mode 100644 index 0000000000..184cb86429 --- /dev/null +++ b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/CreateUserRequest.java @@ -0,0 +1,690 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: schema/google/showcase/v1beta1/identity.proto +// Protobuf Java Version: 4.33.2 + +package com.google.showcase.v1beta1; + +/** + * + * + *
        + * The request message for the google.showcase.v1beta1.Identity\CreateUser
        + * method.
        + * 
        + * + * Protobuf type {@code google.showcase.v1beta1.CreateUserRequest} + */ +@com.google.protobuf.Generated +public final class CreateUserRequest extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.CreateUserRequest) + CreateUserRequestOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "CreateUserRequest"); + } + + // Use CreateUserRequest.newBuilder() to construct. + private CreateUserRequest(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private CreateUserRequest() {} + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.IdentityOuterClass + .internal_static_google_showcase_v1beta1_CreateUserRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.IdentityOuterClass + .internal_static_google_showcase_v1beta1_CreateUserRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.CreateUserRequest.class, + com.google.showcase.v1beta1.CreateUserRequest.Builder.class); + } + + private int bitField0_; + public static final int USER_FIELD_NUMBER = 1; + private com.google.showcase.v1beta1.User user_; + + /** + * + * + *
        +   * The user to create.
        +   * 
        + * + * .google.showcase.v1beta1.User user = 1; + * + * @return Whether the user field is set. + */ + @java.lang.Override + public boolean hasUser() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
        +   * The user to create.
        +   * 
        + * + * .google.showcase.v1beta1.User user = 1; + * + * @return The user. + */ + @java.lang.Override + public com.google.showcase.v1beta1.User getUser() { + return user_ == null ? com.google.showcase.v1beta1.User.getDefaultInstance() : user_; + } + + /** + * + * + *
        +   * The user to create.
        +   * 
        + * + * .google.showcase.v1beta1.User user = 1; + */ + @java.lang.Override + public com.google.showcase.v1beta1.UserOrBuilder getUserOrBuilder() { + return user_ == null ? com.google.showcase.v1beta1.User.getDefaultInstance() : user_; + } + + 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, getUser()); + } + 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, getUser()); + } + 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.showcase.v1beta1.CreateUserRequest)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.CreateUserRequest other = + (com.google.showcase.v1beta1.CreateUserRequest) obj; + + if (hasUser() != other.hasUser()) return false; + if (hasUser()) { + if (!getUser().equals(other.getUser())) 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 (hasUser()) { + hash = (37 * hash) + USER_FIELD_NUMBER; + hash = (53 * hash) + getUser().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.showcase.v1beta1.CreateUserRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.CreateUserRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.CreateUserRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.CreateUserRequest 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.showcase.v1beta1.CreateUserRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.CreateUserRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.CreateUserRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.CreateUserRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.showcase.v1beta1.CreateUserRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.CreateUserRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.showcase.v1beta1.CreateUserRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.CreateUserRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.showcase.v1beta1.CreateUserRequest 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
        +   * The request message for the google.showcase.v1beta1.Identity\CreateUser
        +   * method.
        +   * 
        + * + * Protobuf type {@code google.showcase.v1beta1.CreateUserRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.CreateUserRequest) + com.google.showcase.v1beta1.CreateUserRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.IdentityOuterClass + .internal_static_google_showcase_v1beta1_CreateUserRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.IdentityOuterClass + .internal_static_google_showcase_v1beta1_CreateUserRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.CreateUserRequest.class, + com.google.showcase.v1beta1.CreateUserRequest.Builder.class); + } + + // Construct using com.google.showcase.v1beta1.CreateUserRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetUserFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + user_ = null; + if (userBuilder_ != null) { + userBuilder_.dispose(); + userBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.showcase.v1beta1.IdentityOuterClass + .internal_static_google_showcase_v1beta1_CreateUserRequest_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.CreateUserRequest getDefaultInstanceForType() { + return com.google.showcase.v1beta1.CreateUserRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.CreateUserRequest build() { + com.google.showcase.v1beta1.CreateUserRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.CreateUserRequest buildPartial() { + com.google.showcase.v1beta1.CreateUserRequest result = + new com.google.showcase.v1beta1.CreateUserRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.showcase.v1beta1.CreateUserRequest result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.user_ = userBuilder_ == null ? user_ : userBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.showcase.v1beta1.CreateUserRequest) { + return mergeFrom((com.google.showcase.v1beta1.CreateUserRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.showcase.v1beta1.CreateUserRequest other) { + if (other == com.google.showcase.v1beta1.CreateUserRequest.getDefaultInstance()) return this; + if (other.hasUser()) { + mergeUser(other.getUser()); + } + 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(internalGetUserFieldBuilder().getBuilder(), extensionRegistry); + 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 com.google.showcase.v1beta1.User user_; + private com.google.protobuf.SingleFieldBuilder< + com.google.showcase.v1beta1.User, + com.google.showcase.v1beta1.User.Builder, + com.google.showcase.v1beta1.UserOrBuilder> + userBuilder_; + + /** + * + * + *
        +     * The user to create.
        +     * 
        + * + * .google.showcase.v1beta1.User user = 1; + * + * @return Whether the user field is set. + */ + public boolean hasUser() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
        +     * The user to create.
        +     * 
        + * + * .google.showcase.v1beta1.User user = 1; + * + * @return The user. + */ + public com.google.showcase.v1beta1.User getUser() { + if (userBuilder_ == null) { + return user_ == null ? com.google.showcase.v1beta1.User.getDefaultInstance() : user_; + } else { + return userBuilder_.getMessage(); + } + } + + /** + * + * + *
        +     * The user to create.
        +     * 
        + * + * .google.showcase.v1beta1.User user = 1; + */ + public Builder setUser(com.google.showcase.v1beta1.User value) { + if (userBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + user_ = value; + } else { + userBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
        +     * The user to create.
        +     * 
        + * + * .google.showcase.v1beta1.User user = 1; + */ + public Builder setUser(com.google.showcase.v1beta1.User.Builder builderForValue) { + if (userBuilder_ == null) { + user_ = builderForValue.build(); + } else { + userBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
        +     * The user to create.
        +     * 
        + * + * .google.showcase.v1beta1.User user = 1; + */ + public Builder mergeUser(com.google.showcase.v1beta1.User value) { + if (userBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) + && user_ != null + && user_ != com.google.showcase.v1beta1.User.getDefaultInstance()) { + getUserBuilder().mergeFrom(value); + } else { + user_ = value; + } + } else { + userBuilder_.mergeFrom(value); + } + if (user_ != null) { + bitField0_ |= 0x00000001; + onChanged(); + } + return this; + } + + /** + * + * + *
        +     * The user to create.
        +     * 
        + * + * .google.showcase.v1beta1.User user = 1; + */ + public Builder clearUser() { + bitField0_ = (bitField0_ & ~0x00000001); + user_ = null; + if (userBuilder_ != null) { + userBuilder_.dispose(); + userBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
        +     * The user to create.
        +     * 
        + * + * .google.showcase.v1beta1.User user = 1; + */ + public com.google.showcase.v1beta1.User.Builder getUserBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return internalGetUserFieldBuilder().getBuilder(); + } + + /** + * + * + *
        +     * The user to create.
        +     * 
        + * + * .google.showcase.v1beta1.User user = 1; + */ + public com.google.showcase.v1beta1.UserOrBuilder getUserOrBuilder() { + if (userBuilder_ != null) { + return userBuilder_.getMessageOrBuilder(); + } else { + return user_ == null ? com.google.showcase.v1beta1.User.getDefaultInstance() : user_; + } + } + + /** + * + * + *
        +     * The user to create.
        +     * 
        + * + * .google.showcase.v1beta1.User user = 1; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.showcase.v1beta1.User, + com.google.showcase.v1beta1.User.Builder, + com.google.showcase.v1beta1.UserOrBuilder> + internalGetUserFieldBuilder() { + if (userBuilder_ == null) { + userBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.showcase.v1beta1.User, + com.google.showcase.v1beta1.User.Builder, + com.google.showcase.v1beta1.UserOrBuilder>( + getUser(), getParentForChildren(), isClean()); + user_ = null; + } + return userBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.showcase.v1beta1.CreateUserRequest) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.CreateUserRequest) + private static final com.google.showcase.v1beta1.CreateUserRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.CreateUserRequest(); + } + + public static com.google.showcase.v1beta1.CreateUserRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CreateUserRequest 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.showcase.v1beta1.CreateUserRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/CreateUserRequestOrBuilder.java b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/CreateUserRequestOrBuilder.java new file mode 100644 index 0000000000..1c21e15f96 --- /dev/null +++ b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/CreateUserRequestOrBuilder.java @@ -0,0 +1,65 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: schema/google/showcase/v1beta1/identity.proto +// Protobuf Java Version: 4.33.2 + +package com.google.showcase.v1beta1; + +@com.google.protobuf.Generated +public interface CreateUserRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.CreateUserRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
        +   * The user to create.
        +   * 
        + * + * .google.showcase.v1beta1.User user = 1; + * + * @return Whether the user field is set. + */ + boolean hasUser(); + + /** + * + * + *
        +   * The user to create.
        +   * 
        + * + * .google.showcase.v1beta1.User user = 1; + * + * @return The user. + */ + com.google.showcase.v1beta1.User getUser(); + + /** + * + * + *
        +   * The user to create.
        +   * 
        + * + * .google.showcase.v1beta1.User user = 1; + */ + com.google.showcase.v1beta1.UserOrBuilder getUserOrBuilder(); +} diff --git a/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/DeleteBlurbRequest.java b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/DeleteBlurbRequest.java new file mode 100644 index 0000000000..0b308ed8d0 --- /dev/null +++ b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/DeleteBlurbRequest.java @@ -0,0 +1,611 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: schema/google/showcase/v1beta1/messaging.proto +// Protobuf Java Version: 4.33.2 + +package com.google.showcase.v1beta1; + +/** + * + * + *
        + * The request message for the google.showcase.v1beta1.Messaging\DeleteBlurb
        + * method.
        + * 
        + * + * Protobuf type {@code google.showcase.v1beta1.DeleteBlurbRequest} + */ +@com.google.protobuf.Generated +public final class DeleteBlurbRequest extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.DeleteBlurbRequest) + DeleteBlurbRequestOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "DeleteBlurbRequest"); + } + + // Use DeleteBlurbRequest.newBuilder() to construct. + private DeleteBlurbRequest(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private DeleteBlurbRequest() { + name_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.MessagingOuterClass + .internal_static_google_showcase_v1beta1_DeleteBlurbRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.MessagingOuterClass + .internal_static_google_showcase_v1beta1_DeleteBlurbRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.DeleteBlurbRequest.class, + com.google.showcase.v1beta1.DeleteBlurbRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + + /** + * + * + *
        +   * The resource name of the requested blurb.
        +   * 
        + * + * + * 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; + } + } + + /** + * + * + *
        +   * The resource name of the requested blurb.
        +   * 
        + * + * + * 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.GeneratedMessage.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessage.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.GeneratedMessage.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessage.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.showcase.v1beta1.DeleteBlurbRequest)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.DeleteBlurbRequest other = + (com.google.showcase.v1beta1.DeleteBlurbRequest) 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.showcase.v1beta1.DeleteBlurbRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.DeleteBlurbRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.DeleteBlurbRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.DeleteBlurbRequest 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.showcase.v1beta1.DeleteBlurbRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.DeleteBlurbRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.DeleteBlurbRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.DeleteBlurbRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.showcase.v1beta1.DeleteBlurbRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.DeleteBlurbRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.showcase.v1beta1.DeleteBlurbRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.DeleteBlurbRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.showcase.v1beta1.DeleteBlurbRequest 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
        +   * The request message for the google.showcase.v1beta1.Messaging\DeleteBlurb
        +   * method.
        +   * 
        + * + * Protobuf type {@code google.showcase.v1beta1.DeleteBlurbRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.DeleteBlurbRequest) + com.google.showcase.v1beta1.DeleteBlurbRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.MessagingOuterClass + .internal_static_google_showcase_v1beta1_DeleteBlurbRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.MessagingOuterClass + .internal_static_google_showcase_v1beta1_DeleteBlurbRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.DeleteBlurbRequest.class, + com.google.showcase.v1beta1.DeleteBlurbRequest.Builder.class); + } + + // Construct using com.google.showcase.v1beta1.DeleteBlurbRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.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.showcase.v1beta1.MessagingOuterClass + .internal_static_google_showcase_v1beta1_DeleteBlurbRequest_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.DeleteBlurbRequest getDefaultInstanceForType() { + return com.google.showcase.v1beta1.DeleteBlurbRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.DeleteBlurbRequest build() { + com.google.showcase.v1beta1.DeleteBlurbRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.DeleteBlurbRequest buildPartial() { + com.google.showcase.v1beta1.DeleteBlurbRequest result = + new com.google.showcase.v1beta1.DeleteBlurbRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.showcase.v1beta1.DeleteBlurbRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.showcase.v1beta1.DeleteBlurbRequest) { + return mergeFrom((com.google.showcase.v1beta1.DeleteBlurbRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.showcase.v1beta1.DeleteBlurbRequest other) { + if (other == com.google.showcase.v1beta1.DeleteBlurbRequest.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_ = ""; + + /** + * + * + *
        +     * The resource name of the requested blurb.
        +     * 
        + * + * + * 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; + } + } + + /** + * + * + *
        +     * The resource name of the requested blurb.
        +     * 
        + * + * + * 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; + } + } + + /** + * + * + *
        +     * The resource name of the requested blurb.
        +     * 
        + * + * + * 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; + } + + /** + * + * + *
        +     * The resource name of the requested blurb.
        +     * 
        + * + * + * 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; + } + + /** + * + * + *
        +     * The resource name of the requested blurb.
        +     * 
        + * + * + * 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; + } + + // @@protoc_insertion_point(builder_scope:google.showcase.v1beta1.DeleteBlurbRequest) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.DeleteBlurbRequest) + private static final com.google.showcase.v1beta1.DeleteBlurbRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.DeleteBlurbRequest(); + } + + public static com.google.showcase.v1beta1.DeleteBlurbRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DeleteBlurbRequest 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.showcase.v1beta1.DeleteBlurbRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/DeleteBlurbRequestOrBuilder.java b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/DeleteBlurbRequestOrBuilder.java new file mode 100644 index 0000000000..2557aadc48 --- /dev/null +++ b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/DeleteBlurbRequestOrBuilder.java @@ -0,0 +1,58 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: schema/google/showcase/v1beta1/messaging.proto +// Protobuf Java Version: 4.33.2 + +package com.google.showcase.v1beta1; + +@com.google.protobuf.Generated +public interface DeleteBlurbRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.DeleteBlurbRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
        +   * The resource name of the requested blurb.
        +   * 
        + * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + + /** + * + * + *
        +   * The resource name of the requested blurb.
        +   * 
        + * + * + * 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-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/DeleteRoomRequest.java b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/DeleteRoomRequest.java new file mode 100644 index 0000000000..ac446f4d4c --- /dev/null +++ b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/DeleteRoomRequest.java @@ -0,0 +1,611 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: schema/google/showcase/v1beta1/messaging.proto +// Protobuf Java Version: 4.33.2 + +package com.google.showcase.v1beta1; + +/** + * + * + *
        + * The request message for the google.showcase.v1beta1.Messaging\DeleteRoom
        + * method.
        + * 
        + * + * Protobuf type {@code google.showcase.v1beta1.DeleteRoomRequest} + */ +@com.google.protobuf.Generated +public final class DeleteRoomRequest extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.DeleteRoomRequest) + DeleteRoomRequestOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "DeleteRoomRequest"); + } + + // Use DeleteRoomRequest.newBuilder() to construct. + private DeleteRoomRequest(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private DeleteRoomRequest() { + name_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.MessagingOuterClass + .internal_static_google_showcase_v1beta1_DeleteRoomRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.MessagingOuterClass + .internal_static_google_showcase_v1beta1_DeleteRoomRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.DeleteRoomRequest.class, + com.google.showcase.v1beta1.DeleteRoomRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + + /** + * + * + *
        +   * The resource name of the requested room.
        +   * 
        + * + * + * 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; + } + } + + /** + * + * + *
        +   * The resource name of the requested room.
        +   * 
        + * + * + * 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.GeneratedMessage.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessage.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.GeneratedMessage.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessage.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.showcase.v1beta1.DeleteRoomRequest)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.DeleteRoomRequest other = + (com.google.showcase.v1beta1.DeleteRoomRequest) 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.showcase.v1beta1.DeleteRoomRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.DeleteRoomRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.DeleteRoomRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.DeleteRoomRequest 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.showcase.v1beta1.DeleteRoomRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.DeleteRoomRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.DeleteRoomRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.DeleteRoomRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.showcase.v1beta1.DeleteRoomRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.DeleteRoomRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.showcase.v1beta1.DeleteRoomRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.DeleteRoomRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.showcase.v1beta1.DeleteRoomRequest 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
        +   * The request message for the google.showcase.v1beta1.Messaging\DeleteRoom
        +   * method.
        +   * 
        + * + * Protobuf type {@code google.showcase.v1beta1.DeleteRoomRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.DeleteRoomRequest) + com.google.showcase.v1beta1.DeleteRoomRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.MessagingOuterClass + .internal_static_google_showcase_v1beta1_DeleteRoomRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.MessagingOuterClass + .internal_static_google_showcase_v1beta1_DeleteRoomRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.DeleteRoomRequest.class, + com.google.showcase.v1beta1.DeleteRoomRequest.Builder.class); + } + + // Construct using com.google.showcase.v1beta1.DeleteRoomRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.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.showcase.v1beta1.MessagingOuterClass + .internal_static_google_showcase_v1beta1_DeleteRoomRequest_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.DeleteRoomRequest getDefaultInstanceForType() { + return com.google.showcase.v1beta1.DeleteRoomRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.DeleteRoomRequest build() { + com.google.showcase.v1beta1.DeleteRoomRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.DeleteRoomRequest buildPartial() { + com.google.showcase.v1beta1.DeleteRoomRequest result = + new com.google.showcase.v1beta1.DeleteRoomRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.showcase.v1beta1.DeleteRoomRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.showcase.v1beta1.DeleteRoomRequest) { + return mergeFrom((com.google.showcase.v1beta1.DeleteRoomRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.showcase.v1beta1.DeleteRoomRequest other) { + if (other == com.google.showcase.v1beta1.DeleteRoomRequest.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_ = ""; + + /** + * + * + *
        +     * The resource name of the requested room.
        +     * 
        + * + * + * 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; + } + } + + /** + * + * + *
        +     * The resource name of the requested room.
        +     * 
        + * + * + * 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; + } + } + + /** + * + * + *
        +     * The resource name of the requested room.
        +     * 
        + * + * + * 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; + } + + /** + * + * + *
        +     * The resource name of the requested room.
        +     * 
        + * + * + * 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; + } + + /** + * + * + *
        +     * The resource name of the requested room.
        +     * 
        + * + * + * 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; + } + + // @@protoc_insertion_point(builder_scope:google.showcase.v1beta1.DeleteRoomRequest) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.DeleteRoomRequest) + private static final com.google.showcase.v1beta1.DeleteRoomRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.DeleteRoomRequest(); + } + + public static com.google.showcase.v1beta1.DeleteRoomRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DeleteRoomRequest 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.showcase.v1beta1.DeleteRoomRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/DeleteRoomRequestOrBuilder.java b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/DeleteRoomRequestOrBuilder.java new file mode 100644 index 0000000000..6334cc3bfe --- /dev/null +++ b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/DeleteRoomRequestOrBuilder.java @@ -0,0 +1,58 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: schema/google/showcase/v1beta1/messaging.proto +// Protobuf Java Version: 4.33.2 + +package com.google.showcase.v1beta1; + +@com.google.protobuf.Generated +public interface DeleteRoomRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.DeleteRoomRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
        +   * The resource name of the requested room.
        +   * 
        + * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + + /** + * + * + *
        +   * The resource name of the requested room.
        +   * 
        + * + * + * 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-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/DeleteSessionRequest.java b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/DeleteSessionRequest.java new file mode 100644 index 0000000000..990b928431 --- /dev/null +++ b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/DeleteSessionRequest.java @@ -0,0 +1,596 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: schema/google/showcase/v1beta1/testing.proto +// Protobuf Java Version: 4.33.2 + +package com.google.showcase.v1beta1; + +/** + * + * + *
        + * Request for the DeleteSession method.
        + * 
        + * + * Protobuf type {@code google.showcase.v1beta1.DeleteSessionRequest} + */ +@com.google.protobuf.Generated +public final class DeleteSessionRequest extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.DeleteSessionRequest) + DeleteSessionRequestOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "DeleteSessionRequest"); + } + + // Use DeleteSessionRequest.newBuilder() to construct. + private DeleteSessionRequest(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private DeleteSessionRequest() { + name_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.TestingOuterClass + .internal_static_google_showcase_v1beta1_DeleteSessionRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.TestingOuterClass + .internal_static_google_showcase_v1beta1_DeleteSessionRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.DeleteSessionRequest.class, + com.google.showcase.v1beta1.DeleteSessionRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + + /** + * + * + *
        +   * The session to be deleted.
        +   * 
        + * + * string name = 1 [(.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; + } + } + + /** + * + * + *
        +   * The session to be deleted.
        +   * 
        + * + * string name = 1 [(.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.GeneratedMessage.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessage.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.GeneratedMessage.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessage.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.showcase.v1beta1.DeleteSessionRequest)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.DeleteSessionRequest other = + (com.google.showcase.v1beta1.DeleteSessionRequest) 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.showcase.v1beta1.DeleteSessionRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.DeleteSessionRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.DeleteSessionRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.DeleteSessionRequest 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.showcase.v1beta1.DeleteSessionRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.DeleteSessionRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.DeleteSessionRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.DeleteSessionRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.showcase.v1beta1.DeleteSessionRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.DeleteSessionRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.showcase.v1beta1.DeleteSessionRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.DeleteSessionRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.showcase.v1beta1.DeleteSessionRequest 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
        +   * Request for the DeleteSession method.
        +   * 
        + * + * Protobuf type {@code google.showcase.v1beta1.DeleteSessionRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.DeleteSessionRequest) + com.google.showcase.v1beta1.DeleteSessionRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.TestingOuterClass + .internal_static_google_showcase_v1beta1_DeleteSessionRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.TestingOuterClass + .internal_static_google_showcase_v1beta1_DeleteSessionRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.DeleteSessionRequest.class, + com.google.showcase.v1beta1.DeleteSessionRequest.Builder.class); + } + + // Construct using com.google.showcase.v1beta1.DeleteSessionRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.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.showcase.v1beta1.TestingOuterClass + .internal_static_google_showcase_v1beta1_DeleteSessionRequest_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.DeleteSessionRequest getDefaultInstanceForType() { + return com.google.showcase.v1beta1.DeleteSessionRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.DeleteSessionRequest build() { + com.google.showcase.v1beta1.DeleteSessionRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.DeleteSessionRequest buildPartial() { + com.google.showcase.v1beta1.DeleteSessionRequest result = + new com.google.showcase.v1beta1.DeleteSessionRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.showcase.v1beta1.DeleteSessionRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.showcase.v1beta1.DeleteSessionRequest) { + return mergeFrom((com.google.showcase.v1beta1.DeleteSessionRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.showcase.v1beta1.DeleteSessionRequest other) { + if (other == com.google.showcase.v1beta1.DeleteSessionRequest.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_ = ""; + + /** + * + * + *
        +     * The session to be deleted.
        +     * 
        + * + * string name = 1 [(.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; + } + } + + /** + * + * + *
        +     * The session to be deleted.
        +     * 
        + * + * string name = 1 [(.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; + } + } + + /** + * + * + *
        +     * The session to be deleted.
        +     * 
        + * + * string name = 1 [(.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; + } + + /** + * + * + *
        +     * The session to be deleted.
        +     * 
        + * + * string name = 1 [(.google.api.resource_reference) = { ... } + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
        +     * The session to be deleted.
        +     * 
        + * + * string name = 1 [(.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; + } + + // @@protoc_insertion_point(builder_scope:google.showcase.v1beta1.DeleteSessionRequest) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.DeleteSessionRequest) + private static final com.google.showcase.v1beta1.DeleteSessionRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.DeleteSessionRequest(); + } + + public static com.google.showcase.v1beta1.DeleteSessionRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DeleteSessionRequest 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.showcase.v1beta1.DeleteSessionRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/DeleteSessionRequestOrBuilder.java b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/DeleteSessionRequestOrBuilder.java new file mode 100644 index 0000000000..77396ebe58 --- /dev/null +++ b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/DeleteSessionRequestOrBuilder.java @@ -0,0 +1,54 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: schema/google/showcase/v1beta1/testing.proto +// Protobuf Java Version: 4.33.2 + +package com.google.showcase.v1beta1; + +@com.google.protobuf.Generated +public interface DeleteSessionRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.DeleteSessionRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
        +   * The session to be deleted.
        +   * 
        + * + * string name = 1 [(.google.api.resource_reference) = { ... } + * + * @return The name. + */ + java.lang.String getName(); + + /** + * + * + *
        +   * The session to be deleted.
        +   * 
        + * + * string name = 1 [(.google.api.resource_reference) = { ... } + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); +} diff --git a/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/DeleteTestRequest.java b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/DeleteTestRequest.java new file mode 100644 index 0000000000..2d64687b8b --- /dev/null +++ b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/DeleteTestRequest.java @@ -0,0 +1,595 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: schema/google/showcase/v1beta1/testing.proto +// Protobuf Java Version: 4.33.2 + +package com.google.showcase.v1beta1; + +/** + * + * + *
        + * Request message for deleting a test.
        + * 
        + * + * Protobuf type {@code google.showcase.v1beta1.DeleteTestRequest} + */ +@com.google.protobuf.Generated +public final class DeleteTestRequest extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.DeleteTestRequest) + DeleteTestRequestOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "DeleteTestRequest"); + } + + // Use DeleteTestRequest.newBuilder() to construct. + private DeleteTestRequest(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private DeleteTestRequest() { + name_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.TestingOuterClass + .internal_static_google_showcase_v1beta1_DeleteTestRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.TestingOuterClass + .internal_static_google_showcase_v1beta1_DeleteTestRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.DeleteTestRequest.class, + com.google.showcase.v1beta1.DeleteTestRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + + /** + * + * + *
        +   * The test to be deleted.
        +   * 
        + * + * string name = 1 [(.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; + } + } + + /** + * + * + *
        +   * The test to be deleted.
        +   * 
        + * + * string name = 1 [(.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.GeneratedMessage.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessage.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.GeneratedMessage.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessage.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.showcase.v1beta1.DeleteTestRequest)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.DeleteTestRequest other = + (com.google.showcase.v1beta1.DeleteTestRequest) 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.showcase.v1beta1.DeleteTestRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.DeleteTestRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.DeleteTestRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.DeleteTestRequest 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.showcase.v1beta1.DeleteTestRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.DeleteTestRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.DeleteTestRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.DeleteTestRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.showcase.v1beta1.DeleteTestRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.DeleteTestRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.showcase.v1beta1.DeleteTestRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.DeleteTestRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.showcase.v1beta1.DeleteTestRequest 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
        +   * Request message for deleting a test.
        +   * 
        + * + * Protobuf type {@code google.showcase.v1beta1.DeleteTestRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.DeleteTestRequest) + com.google.showcase.v1beta1.DeleteTestRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.TestingOuterClass + .internal_static_google_showcase_v1beta1_DeleteTestRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.TestingOuterClass + .internal_static_google_showcase_v1beta1_DeleteTestRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.DeleteTestRequest.class, + com.google.showcase.v1beta1.DeleteTestRequest.Builder.class); + } + + // Construct using com.google.showcase.v1beta1.DeleteTestRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.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.showcase.v1beta1.TestingOuterClass + .internal_static_google_showcase_v1beta1_DeleteTestRequest_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.DeleteTestRequest getDefaultInstanceForType() { + return com.google.showcase.v1beta1.DeleteTestRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.DeleteTestRequest build() { + com.google.showcase.v1beta1.DeleteTestRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.DeleteTestRequest buildPartial() { + com.google.showcase.v1beta1.DeleteTestRequest result = + new com.google.showcase.v1beta1.DeleteTestRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.showcase.v1beta1.DeleteTestRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.showcase.v1beta1.DeleteTestRequest) { + return mergeFrom((com.google.showcase.v1beta1.DeleteTestRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.showcase.v1beta1.DeleteTestRequest other) { + if (other == com.google.showcase.v1beta1.DeleteTestRequest.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_ = ""; + + /** + * + * + *
        +     * The test to be deleted.
        +     * 
        + * + * string name = 1 [(.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; + } + } + + /** + * + * + *
        +     * The test to be deleted.
        +     * 
        + * + * string name = 1 [(.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; + } + } + + /** + * + * + *
        +     * The test to be deleted.
        +     * 
        + * + * string name = 1 [(.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; + } + + /** + * + * + *
        +     * The test to be deleted.
        +     * 
        + * + * string name = 1 [(.google.api.resource_reference) = { ... } + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
        +     * The test to be deleted.
        +     * 
        + * + * string name = 1 [(.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; + } + + // @@protoc_insertion_point(builder_scope:google.showcase.v1beta1.DeleteTestRequest) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.DeleteTestRequest) + private static final com.google.showcase.v1beta1.DeleteTestRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.DeleteTestRequest(); + } + + public static com.google.showcase.v1beta1.DeleteTestRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DeleteTestRequest 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.showcase.v1beta1.DeleteTestRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/DeleteTestRequestOrBuilder.java b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/DeleteTestRequestOrBuilder.java new file mode 100644 index 0000000000..1348997f87 --- /dev/null +++ b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/DeleteTestRequestOrBuilder.java @@ -0,0 +1,54 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: schema/google/showcase/v1beta1/testing.proto +// Protobuf Java Version: 4.33.2 + +package com.google.showcase.v1beta1; + +@com.google.protobuf.Generated +public interface DeleteTestRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.DeleteTestRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
        +   * The test to be deleted.
        +   * 
        + * + * string name = 1 [(.google.api.resource_reference) = { ... } + * + * @return The name. + */ + java.lang.String getName(); + + /** + * + * + *
        +   * The test to be deleted.
        +   * 
        + * + * string name = 1 [(.google.api.resource_reference) = { ... } + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); +} diff --git a/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/DeleteUserRequest.java b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/DeleteUserRequest.java new file mode 100644 index 0000000000..a73a28527e --- /dev/null +++ b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/DeleteUserRequest.java @@ -0,0 +1,611 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: schema/google/showcase/v1beta1/identity.proto +// Protobuf Java Version: 4.33.2 + +package com.google.showcase.v1beta1; + +/** + * + * + *
        + * The request message for the google.showcase.v1beta1.Identity\DeleteUser
        + * method.
        + * 
        + * + * Protobuf type {@code google.showcase.v1beta1.DeleteUserRequest} + */ +@com.google.protobuf.Generated +public final class DeleteUserRequest extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.DeleteUserRequest) + DeleteUserRequestOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "DeleteUserRequest"); + } + + // Use DeleteUserRequest.newBuilder() to construct. + private DeleteUserRequest(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private DeleteUserRequest() { + name_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.IdentityOuterClass + .internal_static_google_showcase_v1beta1_DeleteUserRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.IdentityOuterClass + .internal_static_google_showcase_v1beta1_DeleteUserRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.DeleteUserRequest.class, + com.google.showcase.v1beta1.DeleteUserRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + + /** + * + * + *
        +   * The resource name of the user to delete.
        +   * 
        + * + * + * 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; + } + } + + /** + * + * + *
        +   * The resource name of the user to delete.
        +   * 
        + * + * + * 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.GeneratedMessage.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessage.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.GeneratedMessage.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessage.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.showcase.v1beta1.DeleteUserRequest)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.DeleteUserRequest other = + (com.google.showcase.v1beta1.DeleteUserRequest) 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.showcase.v1beta1.DeleteUserRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.DeleteUserRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.DeleteUserRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.DeleteUserRequest 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.showcase.v1beta1.DeleteUserRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.DeleteUserRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.DeleteUserRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.DeleteUserRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.showcase.v1beta1.DeleteUserRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.DeleteUserRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.showcase.v1beta1.DeleteUserRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.DeleteUserRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.showcase.v1beta1.DeleteUserRequest 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
        +   * The request message for the google.showcase.v1beta1.Identity\DeleteUser
        +   * method.
        +   * 
        + * + * Protobuf type {@code google.showcase.v1beta1.DeleteUserRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.DeleteUserRequest) + com.google.showcase.v1beta1.DeleteUserRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.IdentityOuterClass + .internal_static_google_showcase_v1beta1_DeleteUserRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.IdentityOuterClass + .internal_static_google_showcase_v1beta1_DeleteUserRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.DeleteUserRequest.class, + com.google.showcase.v1beta1.DeleteUserRequest.Builder.class); + } + + // Construct using com.google.showcase.v1beta1.DeleteUserRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.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.showcase.v1beta1.IdentityOuterClass + .internal_static_google_showcase_v1beta1_DeleteUserRequest_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.DeleteUserRequest getDefaultInstanceForType() { + return com.google.showcase.v1beta1.DeleteUserRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.DeleteUserRequest build() { + com.google.showcase.v1beta1.DeleteUserRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.DeleteUserRequest buildPartial() { + com.google.showcase.v1beta1.DeleteUserRequest result = + new com.google.showcase.v1beta1.DeleteUserRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.showcase.v1beta1.DeleteUserRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.showcase.v1beta1.DeleteUserRequest) { + return mergeFrom((com.google.showcase.v1beta1.DeleteUserRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.showcase.v1beta1.DeleteUserRequest other) { + if (other == com.google.showcase.v1beta1.DeleteUserRequest.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_ = ""; + + /** + * + * + *
        +     * The resource name of the user to delete.
        +     * 
        + * + * + * 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; + } + } + + /** + * + * + *
        +     * The resource name of the user to delete.
        +     * 
        + * + * + * 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; + } + } + + /** + * + * + *
        +     * The resource name of the user to delete.
        +     * 
        + * + * + * 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; + } + + /** + * + * + *
        +     * The resource name of the user to delete.
        +     * 
        + * + * + * 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; + } + + /** + * + * + *
        +     * The resource name of the user to delete.
        +     * 
        + * + * + * 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; + } + + // @@protoc_insertion_point(builder_scope:google.showcase.v1beta1.DeleteUserRequest) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.DeleteUserRequest) + private static final com.google.showcase.v1beta1.DeleteUserRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.DeleteUserRequest(); + } + + public static com.google.showcase.v1beta1.DeleteUserRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DeleteUserRequest 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.showcase.v1beta1.DeleteUserRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/DeleteUserRequestOrBuilder.java b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/DeleteUserRequestOrBuilder.java new file mode 100644 index 0000000000..49ebbd9113 --- /dev/null +++ b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/DeleteUserRequestOrBuilder.java @@ -0,0 +1,58 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: schema/google/showcase/v1beta1/identity.proto +// Protobuf Java Version: 4.33.2 + +package com.google.showcase.v1beta1; + +@com.google.protobuf.Generated +public interface DeleteUserRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.DeleteUserRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
        +   * The resource name of the user to delete.
        +   * 
        + * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + + /** + * + * + *
        +   * The resource name of the user to delete.
        +   * 
        + * + * + * 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-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/EchoErrorDetailsRequest.java b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/EchoErrorDetailsRequest.java new file mode 100644 index 0000000000..bd30569038 --- /dev/null +++ b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/EchoErrorDetailsRequest.java @@ -0,0 +1,906 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: schema/google/showcase/v1beta1/echo.proto +// Protobuf Java Version: 4.33.2 + +package com.google.showcase.v1beta1; + +/** + * + * + *
        + * The request message used for the EchoErrorDetails method.
        + * 
        + * + * Protobuf type {@code google.showcase.v1beta1.EchoErrorDetailsRequest} + */ +@com.google.protobuf.Generated +public final class EchoErrorDetailsRequest extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.EchoErrorDetailsRequest) + EchoErrorDetailsRequestOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "EchoErrorDetailsRequest"); + } + + // Use EchoErrorDetailsRequest.newBuilder() to construct. + private EchoErrorDetailsRequest(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private EchoErrorDetailsRequest() { + singleDetailText_ = ""; + multiDetailText_ = com.google.protobuf.LazyStringArrayList.emptyList(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.EchoOuterClass + .internal_static_google_showcase_v1beta1_EchoErrorDetailsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.EchoOuterClass + .internal_static_google_showcase_v1beta1_EchoErrorDetailsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.EchoErrorDetailsRequest.class, + com.google.showcase.v1beta1.EchoErrorDetailsRequest.Builder.class); + } + + public static final int SINGLE_DETAIL_TEXT_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object singleDetailText_ = ""; + + /** + * + * + *
        +   * Content to return in a singular `*.error.details` field of type
        +   * `google.protobuf.Any`
        +   * 
        + * + * string single_detail_text = 1; + * + * @return The singleDetailText. + */ + @java.lang.Override + public java.lang.String getSingleDetailText() { + java.lang.Object ref = singleDetailText_; + 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(); + singleDetailText_ = s; + return s; + } + } + + /** + * + * + *
        +   * Content to return in a singular `*.error.details` field of type
        +   * `google.protobuf.Any`
        +   * 
        + * + * string single_detail_text = 1; + * + * @return The bytes for singleDetailText. + */ + @java.lang.Override + public com.google.protobuf.ByteString getSingleDetailTextBytes() { + java.lang.Object ref = singleDetailText_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + singleDetailText_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int MULTI_DETAIL_TEXT_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private com.google.protobuf.LazyStringArrayList multiDetailText_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + + /** + * + * + *
        +   * Content to return in a repeated `*.error.details` field of type
        +   * `google.protobuf.Any`
        +   * 
        + * + * repeated string multi_detail_text = 2; + * + * @return A list containing the multiDetailText. + */ + public com.google.protobuf.ProtocolStringList getMultiDetailTextList() { + return multiDetailText_; + } + + /** + * + * + *
        +   * Content to return in a repeated `*.error.details` field of type
        +   * `google.protobuf.Any`
        +   * 
        + * + * repeated string multi_detail_text = 2; + * + * @return The count of multiDetailText. + */ + public int getMultiDetailTextCount() { + return multiDetailText_.size(); + } + + /** + * + * + *
        +   * Content to return in a repeated `*.error.details` field of type
        +   * `google.protobuf.Any`
        +   * 
        + * + * repeated string multi_detail_text = 2; + * + * @param index The index of the element to return. + * @return The multiDetailText at the given index. + */ + public java.lang.String getMultiDetailText(int index) { + return multiDetailText_.get(index); + } + + /** + * + * + *
        +   * Content to return in a repeated `*.error.details` field of type
        +   * `google.protobuf.Any`
        +   * 
        + * + * repeated string multi_detail_text = 2; + * + * @param index The index of the value to return. + * @return The bytes of the multiDetailText at the given index. + */ + public com.google.protobuf.ByteString getMultiDetailTextBytes(int index) { + return multiDetailText_.getByteString(index); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(singleDetailText_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, singleDetailText_); + } + for (int i = 0; i < multiDetailText_.size(); i++) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, multiDetailText_.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.GeneratedMessage.isStringEmpty(singleDetailText_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, singleDetailText_); + } + { + int dataSize = 0; + for (int i = 0; i < multiDetailText_.size(); i++) { + dataSize += computeStringSizeNoTag(multiDetailText_.getRaw(i)); + } + size += dataSize; + size += 1 * getMultiDetailTextList().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.showcase.v1beta1.EchoErrorDetailsRequest)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.EchoErrorDetailsRequest other = + (com.google.showcase.v1beta1.EchoErrorDetailsRequest) obj; + + if (!getSingleDetailText().equals(other.getSingleDetailText())) return false; + if (!getMultiDetailTextList().equals(other.getMultiDetailTextList())) 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) + SINGLE_DETAIL_TEXT_FIELD_NUMBER; + hash = (53 * hash) + getSingleDetailText().hashCode(); + if (getMultiDetailTextCount() > 0) { + hash = (37 * hash) + MULTI_DETAIL_TEXT_FIELD_NUMBER; + hash = (53 * hash) + getMultiDetailTextList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.showcase.v1beta1.EchoErrorDetailsRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.EchoErrorDetailsRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.EchoErrorDetailsRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.EchoErrorDetailsRequest 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.showcase.v1beta1.EchoErrorDetailsRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.EchoErrorDetailsRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.EchoErrorDetailsRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.EchoErrorDetailsRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.showcase.v1beta1.EchoErrorDetailsRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.EchoErrorDetailsRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.showcase.v1beta1.EchoErrorDetailsRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.EchoErrorDetailsRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.showcase.v1beta1.EchoErrorDetailsRequest 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
        +   * The request message used for the EchoErrorDetails method.
        +   * 
        + * + * Protobuf type {@code google.showcase.v1beta1.EchoErrorDetailsRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.EchoErrorDetailsRequest) + com.google.showcase.v1beta1.EchoErrorDetailsRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.EchoOuterClass + .internal_static_google_showcase_v1beta1_EchoErrorDetailsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.EchoOuterClass + .internal_static_google_showcase_v1beta1_EchoErrorDetailsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.EchoErrorDetailsRequest.class, + com.google.showcase.v1beta1.EchoErrorDetailsRequest.Builder.class); + } + + // Construct using com.google.showcase.v1beta1.EchoErrorDetailsRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + singleDetailText_ = ""; + multiDetailText_ = com.google.protobuf.LazyStringArrayList.emptyList(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.showcase.v1beta1.EchoOuterClass + .internal_static_google_showcase_v1beta1_EchoErrorDetailsRequest_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.EchoErrorDetailsRequest getDefaultInstanceForType() { + return com.google.showcase.v1beta1.EchoErrorDetailsRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.EchoErrorDetailsRequest build() { + com.google.showcase.v1beta1.EchoErrorDetailsRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.EchoErrorDetailsRequest buildPartial() { + com.google.showcase.v1beta1.EchoErrorDetailsRequest result = + new com.google.showcase.v1beta1.EchoErrorDetailsRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.showcase.v1beta1.EchoErrorDetailsRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.singleDetailText_ = singleDetailText_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + multiDetailText_.makeImmutable(); + result.multiDetailText_ = multiDetailText_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.showcase.v1beta1.EchoErrorDetailsRequest) { + return mergeFrom((com.google.showcase.v1beta1.EchoErrorDetailsRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.showcase.v1beta1.EchoErrorDetailsRequest other) { + if (other == com.google.showcase.v1beta1.EchoErrorDetailsRequest.getDefaultInstance()) + return this; + if (!other.getSingleDetailText().isEmpty()) { + singleDetailText_ = other.singleDetailText_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.multiDetailText_.isEmpty()) { + if (multiDetailText_.isEmpty()) { + multiDetailText_ = other.multiDetailText_; + bitField0_ |= 0x00000002; + } else { + ensureMultiDetailTextIsMutable(); + multiDetailText_.addAll(other.multiDetailText_); + } + 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: + { + singleDetailText_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + ensureMultiDetailTextIsMutable(); + multiDetailText_.add(s); + 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 singleDetailText_ = ""; + + /** + * + * + *
        +     * Content to return in a singular `*.error.details` field of type
        +     * `google.protobuf.Any`
        +     * 
        + * + * string single_detail_text = 1; + * + * @return The singleDetailText. + */ + public java.lang.String getSingleDetailText() { + java.lang.Object ref = singleDetailText_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + singleDetailText_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
        +     * Content to return in a singular `*.error.details` field of type
        +     * `google.protobuf.Any`
        +     * 
        + * + * string single_detail_text = 1; + * + * @return The bytes for singleDetailText. + */ + public com.google.protobuf.ByteString getSingleDetailTextBytes() { + java.lang.Object ref = singleDetailText_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + singleDetailText_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
        +     * Content to return in a singular `*.error.details` field of type
        +     * `google.protobuf.Any`
        +     * 
        + * + * string single_detail_text = 1; + * + * @param value The singleDetailText to set. + * @return This builder for chaining. + */ + public Builder setSingleDetailText(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + singleDetailText_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
        +     * Content to return in a singular `*.error.details` field of type
        +     * `google.protobuf.Any`
        +     * 
        + * + * string single_detail_text = 1; + * + * @return This builder for chaining. + */ + public Builder clearSingleDetailText() { + singleDetailText_ = getDefaultInstance().getSingleDetailText(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
        +     * Content to return in a singular `*.error.details` field of type
        +     * `google.protobuf.Any`
        +     * 
        + * + * string single_detail_text = 1; + * + * @param value The bytes for singleDetailText to set. + * @return This builder for chaining. + */ + public Builder setSingleDetailTextBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + singleDetailText_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private com.google.protobuf.LazyStringArrayList multiDetailText_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + + private void ensureMultiDetailTextIsMutable() { + if (!multiDetailText_.isModifiable()) { + multiDetailText_ = new com.google.protobuf.LazyStringArrayList(multiDetailText_); + } + bitField0_ |= 0x00000002; + } + + /** + * + * + *
        +     * Content to return in a repeated `*.error.details` field of type
        +     * `google.protobuf.Any`
        +     * 
        + * + * repeated string multi_detail_text = 2; + * + * @return A list containing the multiDetailText. + */ + public com.google.protobuf.ProtocolStringList getMultiDetailTextList() { + multiDetailText_.makeImmutable(); + return multiDetailText_; + } + + /** + * + * + *
        +     * Content to return in a repeated `*.error.details` field of type
        +     * `google.protobuf.Any`
        +     * 
        + * + * repeated string multi_detail_text = 2; + * + * @return The count of multiDetailText. + */ + public int getMultiDetailTextCount() { + return multiDetailText_.size(); + } + + /** + * + * + *
        +     * Content to return in a repeated `*.error.details` field of type
        +     * `google.protobuf.Any`
        +     * 
        + * + * repeated string multi_detail_text = 2; + * + * @param index The index of the element to return. + * @return The multiDetailText at the given index. + */ + public java.lang.String getMultiDetailText(int index) { + return multiDetailText_.get(index); + } + + /** + * + * + *
        +     * Content to return in a repeated `*.error.details` field of type
        +     * `google.protobuf.Any`
        +     * 
        + * + * repeated string multi_detail_text = 2; + * + * @param index The index of the value to return. + * @return The bytes of the multiDetailText at the given index. + */ + public com.google.protobuf.ByteString getMultiDetailTextBytes(int index) { + return multiDetailText_.getByteString(index); + } + + /** + * + * + *
        +     * Content to return in a repeated `*.error.details` field of type
        +     * `google.protobuf.Any`
        +     * 
        + * + * repeated string multi_detail_text = 2; + * + * @param index The index to set the value at. + * @param value The multiDetailText to set. + * @return This builder for chaining. + */ + public Builder setMultiDetailText(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureMultiDetailTextIsMutable(); + multiDetailText_.set(index, value); + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
        +     * Content to return in a repeated `*.error.details` field of type
        +     * `google.protobuf.Any`
        +     * 
        + * + * repeated string multi_detail_text = 2; + * + * @param value The multiDetailText to add. + * @return This builder for chaining. + */ + public Builder addMultiDetailText(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureMultiDetailTextIsMutable(); + multiDetailText_.add(value); + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
        +     * Content to return in a repeated `*.error.details` field of type
        +     * `google.protobuf.Any`
        +     * 
        + * + * repeated string multi_detail_text = 2; + * + * @param values The multiDetailText to add. + * @return This builder for chaining. + */ + public Builder addAllMultiDetailText(java.lang.Iterable values) { + ensureMultiDetailTextIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, multiDetailText_); + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
        +     * Content to return in a repeated `*.error.details` field of type
        +     * `google.protobuf.Any`
        +     * 
        + * + * repeated string multi_detail_text = 2; + * + * @return This builder for chaining. + */ + public Builder clearMultiDetailText() { + multiDetailText_ = com.google.protobuf.LazyStringArrayList.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + ; + onChanged(); + return this; + } + + /** + * + * + *
        +     * Content to return in a repeated `*.error.details` field of type
        +     * `google.protobuf.Any`
        +     * 
        + * + * repeated string multi_detail_text = 2; + * + * @param value The bytes of the multiDetailText to add. + * @return This builder for chaining. + */ + public Builder addMultiDetailTextBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureMultiDetailTextIsMutable(); + multiDetailText_.add(value); + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.showcase.v1beta1.EchoErrorDetailsRequest) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.EchoErrorDetailsRequest) + private static final com.google.showcase.v1beta1.EchoErrorDetailsRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.EchoErrorDetailsRequest(); + } + + public static com.google.showcase.v1beta1.EchoErrorDetailsRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public EchoErrorDetailsRequest 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.showcase.v1beta1.EchoErrorDetailsRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/EchoErrorDetailsRequestOrBuilder.java b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/EchoErrorDetailsRequestOrBuilder.java new file mode 100644 index 0000000000..bf0f7977fe --- /dev/null +++ b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/EchoErrorDetailsRequestOrBuilder.java @@ -0,0 +1,114 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: schema/google/showcase/v1beta1/echo.proto +// Protobuf Java Version: 4.33.2 + +package com.google.showcase.v1beta1; + +@com.google.protobuf.Generated +public interface EchoErrorDetailsRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.EchoErrorDetailsRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
        +   * Content to return in a singular `*.error.details` field of type
        +   * `google.protobuf.Any`
        +   * 
        + * + * string single_detail_text = 1; + * + * @return The singleDetailText. + */ + java.lang.String getSingleDetailText(); + + /** + * + * + *
        +   * Content to return in a singular `*.error.details` field of type
        +   * `google.protobuf.Any`
        +   * 
        + * + * string single_detail_text = 1; + * + * @return The bytes for singleDetailText. + */ + com.google.protobuf.ByteString getSingleDetailTextBytes(); + + /** + * + * + *
        +   * Content to return in a repeated `*.error.details` field of type
        +   * `google.protobuf.Any`
        +   * 
        + * + * repeated string multi_detail_text = 2; + * + * @return A list containing the multiDetailText. + */ + java.util.List getMultiDetailTextList(); + + /** + * + * + *
        +   * Content to return in a repeated `*.error.details` field of type
        +   * `google.protobuf.Any`
        +   * 
        + * + * repeated string multi_detail_text = 2; + * + * @return The count of multiDetailText. + */ + int getMultiDetailTextCount(); + + /** + * + * + *
        +   * Content to return in a repeated `*.error.details` field of type
        +   * `google.protobuf.Any`
        +   * 
        + * + * repeated string multi_detail_text = 2; + * + * @param index The index of the element to return. + * @return The multiDetailText at the given index. + */ + java.lang.String getMultiDetailText(int index); + + /** + * + * + *
        +   * Content to return in a repeated `*.error.details` field of type
        +   * `google.protobuf.Any`
        +   * 
        + * + * repeated string multi_detail_text = 2; + * + * @param index The index of the value to return. + * @return The bytes of the multiDetailText at the given index. + */ + com.google.protobuf.ByteString getMultiDetailTextBytes(int index); +} diff --git a/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/EchoErrorDetailsResponse.java b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/EchoErrorDetailsResponse.java new file mode 100644 index 0000000000..00aced5378 --- /dev/null +++ b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/EchoErrorDetailsResponse.java @@ -0,0 +1,2096 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: schema/google/showcase/v1beta1/echo.proto +// Protobuf Java Version: 4.33.2 + +package com.google.showcase.v1beta1; + +/** + * + * + *
        + * The response message used for the EchoErrorDetails method.
        + * 
        + * + * Protobuf type {@code google.showcase.v1beta1.EchoErrorDetailsResponse} + */ +@com.google.protobuf.Generated +public final class EchoErrorDetailsResponse extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.EchoErrorDetailsResponse) + EchoErrorDetailsResponseOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "EchoErrorDetailsResponse"); + } + + // Use EchoErrorDetailsResponse.newBuilder() to construct. + private EchoErrorDetailsResponse(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private EchoErrorDetailsResponse() {} + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.EchoOuterClass + .internal_static_google_showcase_v1beta1_EchoErrorDetailsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.EchoOuterClass + .internal_static_google_showcase_v1beta1_EchoErrorDetailsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.EchoErrorDetailsResponse.class, + com.google.showcase.v1beta1.EchoErrorDetailsResponse.Builder.class); + } + + public interface SingleDetailOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.EchoErrorDetailsResponse.SingleDetail) + com.google.protobuf.MessageOrBuilder { + + /** + * .google.showcase.v1beta1.ErrorWithSingleDetail error = 1; + * + * @return Whether the error field is set. + */ + boolean hasError(); + + /** + * .google.showcase.v1beta1.ErrorWithSingleDetail error = 1; + * + * @return The error. + */ + com.google.showcase.v1beta1.ErrorWithSingleDetail getError(); + + /** .google.showcase.v1beta1.ErrorWithSingleDetail error = 1; */ + com.google.showcase.v1beta1.ErrorWithSingleDetailOrBuilder getErrorOrBuilder(); + } + + /** Protobuf type {@code google.showcase.v1beta1.EchoErrorDetailsResponse.SingleDetail} */ + public static final class SingleDetail extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.EchoErrorDetailsResponse.SingleDetail) + SingleDetailOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "SingleDetail"); + } + + // Use SingleDetail.newBuilder() to construct. + private SingleDetail(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private SingleDetail() {} + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.EchoOuterClass + .internal_static_google_showcase_v1beta1_EchoErrorDetailsResponse_SingleDetail_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.EchoOuterClass + .internal_static_google_showcase_v1beta1_EchoErrorDetailsResponse_SingleDetail_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.EchoErrorDetailsResponse.SingleDetail.class, + com.google.showcase.v1beta1.EchoErrorDetailsResponse.SingleDetail.Builder.class); + } + + private int bitField0_; + public static final int ERROR_FIELD_NUMBER = 1; + private com.google.showcase.v1beta1.ErrorWithSingleDetail error_; + + /** + * .google.showcase.v1beta1.ErrorWithSingleDetail error = 1; + * + * @return Whether the error field is set. + */ + @java.lang.Override + public boolean hasError() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * .google.showcase.v1beta1.ErrorWithSingleDetail error = 1; + * + * @return The error. + */ + @java.lang.Override + public com.google.showcase.v1beta1.ErrorWithSingleDetail getError() { + return error_ == null + ? com.google.showcase.v1beta1.ErrorWithSingleDetail.getDefaultInstance() + : error_; + } + + /** .google.showcase.v1beta1.ErrorWithSingleDetail error = 1; */ + @java.lang.Override + public com.google.showcase.v1beta1.ErrorWithSingleDetailOrBuilder getErrorOrBuilder() { + return error_ == null + ? com.google.showcase.v1beta1.ErrorWithSingleDetail.getDefaultInstance() + : error_; + } + + 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, getError()); + } + 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, getError()); + } + 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.showcase.v1beta1.EchoErrorDetailsResponse.SingleDetail)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.EchoErrorDetailsResponse.SingleDetail other = + (com.google.showcase.v1beta1.EchoErrorDetailsResponse.SingleDetail) obj; + + if (hasError() != other.hasError()) return false; + if (hasError()) { + if (!getError().equals(other.getError())) 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 (hasError()) { + hash = (37 * hash) + ERROR_FIELD_NUMBER; + hash = (53 * hash) + getError().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.showcase.v1beta1.EchoErrorDetailsResponse.SingleDetail parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.EchoErrorDetailsResponse.SingleDetail parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.EchoErrorDetailsResponse.SingleDetail parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.EchoErrorDetailsResponse.SingleDetail 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.showcase.v1beta1.EchoErrorDetailsResponse.SingleDetail parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.EchoErrorDetailsResponse.SingleDetail parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.EchoErrorDetailsResponse.SingleDetail parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.EchoErrorDetailsResponse.SingleDetail parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.showcase.v1beta1.EchoErrorDetailsResponse.SingleDetail + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.EchoErrorDetailsResponse.SingleDetail + parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.showcase.v1beta1.EchoErrorDetailsResponse.SingleDetail parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.EchoErrorDetailsResponse.SingleDetail parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.showcase.v1beta1.EchoErrorDetailsResponse.SingleDetail 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** Protobuf type {@code google.showcase.v1beta1.EchoErrorDetailsResponse.SingleDetail} */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.EchoErrorDetailsResponse.SingleDetail) + com.google.showcase.v1beta1.EchoErrorDetailsResponse.SingleDetailOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.EchoOuterClass + .internal_static_google_showcase_v1beta1_EchoErrorDetailsResponse_SingleDetail_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.EchoOuterClass + .internal_static_google_showcase_v1beta1_EchoErrorDetailsResponse_SingleDetail_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.EchoErrorDetailsResponse.SingleDetail.class, + com.google.showcase.v1beta1.EchoErrorDetailsResponse.SingleDetail.Builder.class); + } + + // Construct using + // com.google.showcase.v1beta1.EchoErrorDetailsResponse.SingleDetail.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetErrorFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + error_ = null; + if (errorBuilder_ != null) { + errorBuilder_.dispose(); + errorBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.showcase.v1beta1.EchoOuterClass + .internal_static_google_showcase_v1beta1_EchoErrorDetailsResponse_SingleDetail_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.EchoErrorDetailsResponse.SingleDetail + getDefaultInstanceForType() { + return com.google.showcase.v1beta1.EchoErrorDetailsResponse.SingleDetail + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.EchoErrorDetailsResponse.SingleDetail build() { + com.google.showcase.v1beta1.EchoErrorDetailsResponse.SingleDetail result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.EchoErrorDetailsResponse.SingleDetail buildPartial() { + com.google.showcase.v1beta1.EchoErrorDetailsResponse.SingleDetail result = + new com.google.showcase.v1beta1.EchoErrorDetailsResponse.SingleDetail(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.showcase.v1beta1.EchoErrorDetailsResponse.SingleDetail result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.error_ = errorBuilder_ == null ? error_ : errorBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.showcase.v1beta1.EchoErrorDetailsResponse.SingleDetail) { + return mergeFrom( + (com.google.showcase.v1beta1.EchoErrorDetailsResponse.SingleDetail) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.showcase.v1beta1.EchoErrorDetailsResponse.SingleDetail other) { + if (other + == com.google.showcase.v1beta1.EchoErrorDetailsResponse.SingleDetail + .getDefaultInstance()) return this; + if (other.hasError()) { + mergeError(other.getError()); + } + 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(internalGetErrorFieldBuilder().getBuilder(), extensionRegistry); + 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 com.google.showcase.v1beta1.ErrorWithSingleDetail error_; + private com.google.protobuf.SingleFieldBuilder< + com.google.showcase.v1beta1.ErrorWithSingleDetail, + com.google.showcase.v1beta1.ErrorWithSingleDetail.Builder, + com.google.showcase.v1beta1.ErrorWithSingleDetailOrBuilder> + errorBuilder_; + + /** + * .google.showcase.v1beta1.ErrorWithSingleDetail error = 1; + * + * @return Whether the error field is set. + */ + public boolean hasError() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * .google.showcase.v1beta1.ErrorWithSingleDetail error = 1; + * + * @return The error. + */ + public com.google.showcase.v1beta1.ErrorWithSingleDetail getError() { + if (errorBuilder_ == null) { + return error_ == null + ? com.google.showcase.v1beta1.ErrorWithSingleDetail.getDefaultInstance() + : error_; + } else { + return errorBuilder_.getMessage(); + } + } + + /** .google.showcase.v1beta1.ErrorWithSingleDetail error = 1; */ + public Builder setError(com.google.showcase.v1beta1.ErrorWithSingleDetail value) { + if (errorBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + error_ = value; + } else { + errorBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** .google.showcase.v1beta1.ErrorWithSingleDetail error = 1; */ + public Builder setError( + com.google.showcase.v1beta1.ErrorWithSingleDetail.Builder builderForValue) { + if (errorBuilder_ == null) { + error_ = builderForValue.build(); + } else { + errorBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** .google.showcase.v1beta1.ErrorWithSingleDetail error = 1; */ + public Builder mergeError(com.google.showcase.v1beta1.ErrorWithSingleDetail value) { + if (errorBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) + && error_ != null + && error_ != com.google.showcase.v1beta1.ErrorWithSingleDetail.getDefaultInstance()) { + getErrorBuilder().mergeFrom(value); + } else { + error_ = value; + } + } else { + errorBuilder_.mergeFrom(value); + } + if (error_ != null) { + bitField0_ |= 0x00000001; + onChanged(); + } + return this; + } + + /** .google.showcase.v1beta1.ErrorWithSingleDetail error = 1; */ + public Builder clearError() { + bitField0_ = (bitField0_ & ~0x00000001); + error_ = null; + if (errorBuilder_ != null) { + errorBuilder_.dispose(); + errorBuilder_ = null; + } + onChanged(); + return this; + } + + /** .google.showcase.v1beta1.ErrorWithSingleDetail error = 1; */ + public com.google.showcase.v1beta1.ErrorWithSingleDetail.Builder getErrorBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return internalGetErrorFieldBuilder().getBuilder(); + } + + /** .google.showcase.v1beta1.ErrorWithSingleDetail error = 1; */ + public com.google.showcase.v1beta1.ErrorWithSingleDetailOrBuilder getErrorOrBuilder() { + if (errorBuilder_ != null) { + return errorBuilder_.getMessageOrBuilder(); + } else { + return error_ == null + ? com.google.showcase.v1beta1.ErrorWithSingleDetail.getDefaultInstance() + : error_; + } + } + + /** .google.showcase.v1beta1.ErrorWithSingleDetail error = 1; */ + private com.google.protobuf.SingleFieldBuilder< + com.google.showcase.v1beta1.ErrorWithSingleDetail, + com.google.showcase.v1beta1.ErrorWithSingleDetail.Builder, + com.google.showcase.v1beta1.ErrorWithSingleDetailOrBuilder> + internalGetErrorFieldBuilder() { + if (errorBuilder_ == null) { + errorBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.showcase.v1beta1.ErrorWithSingleDetail, + com.google.showcase.v1beta1.ErrorWithSingleDetail.Builder, + com.google.showcase.v1beta1.ErrorWithSingleDetailOrBuilder>( + getError(), getParentForChildren(), isClean()); + error_ = null; + } + return errorBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.showcase.v1beta1.EchoErrorDetailsResponse.SingleDetail) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.EchoErrorDetailsResponse.SingleDetail) + private static final com.google.showcase.v1beta1.EchoErrorDetailsResponse.SingleDetail + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.EchoErrorDetailsResponse.SingleDetail(); + } + + public static com.google.showcase.v1beta1.EchoErrorDetailsResponse.SingleDetail + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SingleDetail 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.showcase.v1beta1.EchoErrorDetailsResponse.SingleDetail + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface MultipleDetailsOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.EchoErrorDetailsResponse.MultipleDetails) + com.google.protobuf.MessageOrBuilder { + + /** + * .google.showcase.v1beta1.ErrorWithMultipleDetails error = 1; + * + * @return Whether the error field is set. + */ + boolean hasError(); + + /** + * .google.showcase.v1beta1.ErrorWithMultipleDetails error = 1; + * + * @return The error. + */ + com.google.showcase.v1beta1.ErrorWithMultipleDetails getError(); + + /** .google.showcase.v1beta1.ErrorWithMultipleDetails error = 1; */ + com.google.showcase.v1beta1.ErrorWithMultipleDetailsOrBuilder getErrorOrBuilder(); + } + + /** Protobuf type {@code google.showcase.v1beta1.EchoErrorDetailsResponse.MultipleDetails} */ + public static final class MultipleDetails extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.EchoErrorDetailsResponse.MultipleDetails) + MultipleDetailsOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "MultipleDetails"); + } + + // Use MultipleDetails.newBuilder() to construct. + private MultipleDetails(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private MultipleDetails() {} + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.EchoOuterClass + .internal_static_google_showcase_v1beta1_EchoErrorDetailsResponse_MultipleDetails_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.EchoOuterClass + .internal_static_google_showcase_v1beta1_EchoErrorDetailsResponse_MultipleDetails_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.EchoErrorDetailsResponse.MultipleDetails.class, + com.google.showcase.v1beta1.EchoErrorDetailsResponse.MultipleDetails.Builder.class); + } + + private int bitField0_; + public static final int ERROR_FIELD_NUMBER = 1; + private com.google.showcase.v1beta1.ErrorWithMultipleDetails error_; + + /** + * .google.showcase.v1beta1.ErrorWithMultipleDetails error = 1; + * + * @return Whether the error field is set. + */ + @java.lang.Override + public boolean hasError() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * .google.showcase.v1beta1.ErrorWithMultipleDetails error = 1; + * + * @return The error. + */ + @java.lang.Override + public com.google.showcase.v1beta1.ErrorWithMultipleDetails getError() { + return error_ == null + ? com.google.showcase.v1beta1.ErrorWithMultipleDetails.getDefaultInstance() + : error_; + } + + /** .google.showcase.v1beta1.ErrorWithMultipleDetails error = 1; */ + @java.lang.Override + public com.google.showcase.v1beta1.ErrorWithMultipleDetailsOrBuilder getErrorOrBuilder() { + return error_ == null + ? com.google.showcase.v1beta1.ErrorWithMultipleDetails.getDefaultInstance() + : error_; + } + + 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, getError()); + } + 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, getError()); + } + 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.showcase.v1beta1.EchoErrorDetailsResponse.MultipleDetails)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.EchoErrorDetailsResponse.MultipleDetails other = + (com.google.showcase.v1beta1.EchoErrorDetailsResponse.MultipleDetails) obj; + + if (hasError() != other.hasError()) return false; + if (hasError()) { + if (!getError().equals(other.getError())) 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 (hasError()) { + hash = (37 * hash) + ERROR_FIELD_NUMBER; + hash = (53 * hash) + getError().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.showcase.v1beta1.EchoErrorDetailsResponse.MultipleDetails parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.EchoErrorDetailsResponse.MultipleDetails parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.EchoErrorDetailsResponse.MultipleDetails parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.EchoErrorDetailsResponse.MultipleDetails 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.showcase.v1beta1.EchoErrorDetailsResponse.MultipleDetails parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.EchoErrorDetailsResponse.MultipleDetails parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.EchoErrorDetailsResponse.MultipleDetails parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.EchoErrorDetailsResponse.MultipleDetails parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.showcase.v1beta1.EchoErrorDetailsResponse.MultipleDetails + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.EchoErrorDetailsResponse.MultipleDetails + parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.showcase.v1beta1.EchoErrorDetailsResponse.MultipleDetails parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.EchoErrorDetailsResponse.MultipleDetails parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.showcase.v1beta1.EchoErrorDetailsResponse.MultipleDetails 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** Protobuf type {@code google.showcase.v1beta1.EchoErrorDetailsResponse.MultipleDetails} */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.EchoErrorDetailsResponse.MultipleDetails) + com.google.showcase.v1beta1.EchoErrorDetailsResponse.MultipleDetailsOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.EchoOuterClass + .internal_static_google_showcase_v1beta1_EchoErrorDetailsResponse_MultipleDetails_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.EchoOuterClass + .internal_static_google_showcase_v1beta1_EchoErrorDetailsResponse_MultipleDetails_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.EchoErrorDetailsResponse.MultipleDetails.class, + com.google.showcase.v1beta1.EchoErrorDetailsResponse.MultipleDetails.Builder.class); + } + + // Construct using + // com.google.showcase.v1beta1.EchoErrorDetailsResponse.MultipleDetails.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetErrorFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + error_ = null; + if (errorBuilder_ != null) { + errorBuilder_.dispose(); + errorBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.showcase.v1beta1.EchoOuterClass + .internal_static_google_showcase_v1beta1_EchoErrorDetailsResponse_MultipleDetails_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.EchoErrorDetailsResponse.MultipleDetails + getDefaultInstanceForType() { + return com.google.showcase.v1beta1.EchoErrorDetailsResponse.MultipleDetails + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.EchoErrorDetailsResponse.MultipleDetails build() { + com.google.showcase.v1beta1.EchoErrorDetailsResponse.MultipleDetails result = + buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.EchoErrorDetailsResponse.MultipleDetails buildPartial() { + com.google.showcase.v1beta1.EchoErrorDetailsResponse.MultipleDetails result = + new com.google.showcase.v1beta1.EchoErrorDetailsResponse.MultipleDetails(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.showcase.v1beta1.EchoErrorDetailsResponse.MultipleDetails result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.error_ = errorBuilder_ == null ? error_ : errorBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.showcase.v1beta1.EchoErrorDetailsResponse.MultipleDetails) { + return mergeFrom( + (com.google.showcase.v1beta1.EchoErrorDetailsResponse.MultipleDetails) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.showcase.v1beta1.EchoErrorDetailsResponse.MultipleDetails other) { + if (other + == com.google.showcase.v1beta1.EchoErrorDetailsResponse.MultipleDetails + .getDefaultInstance()) return this; + if (other.hasError()) { + mergeError(other.getError()); + } + 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(internalGetErrorFieldBuilder().getBuilder(), extensionRegistry); + 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 com.google.showcase.v1beta1.ErrorWithMultipleDetails error_; + private com.google.protobuf.SingleFieldBuilder< + com.google.showcase.v1beta1.ErrorWithMultipleDetails, + com.google.showcase.v1beta1.ErrorWithMultipleDetails.Builder, + com.google.showcase.v1beta1.ErrorWithMultipleDetailsOrBuilder> + errorBuilder_; + + /** + * .google.showcase.v1beta1.ErrorWithMultipleDetails error = 1; + * + * @return Whether the error field is set. + */ + public boolean hasError() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * .google.showcase.v1beta1.ErrorWithMultipleDetails error = 1; + * + * @return The error. + */ + public com.google.showcase.v1beta1.ErrorWithMultipleDetails getError() { + if (errorBuilder_ == null) { + return error_ == null + ? com.google.showcase.v1beta1.ErrorWithMultipleDetails.getDefaultInstance() + : error_; + } else { + return errorBuilder_.getMessage(); + } + } + + /** .google.showcase.v1beta1.ErrorWithMultipleDetails error = 1; */ + public Builder setError(com.google.showcase.v1beta1.ErrorWithMultipleDetails value) { + if (errorBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + error_ = value; + } else { + errorBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** .google.showcase.v1beta1.ErrorWithMultipleDetails error = 1; */ + public Builder setError( + com.google.showcase.v1beta1.ErrorWithMultipleDetails.Builder builderForValue) { + if (errorBuilder_ == null) { + error_ = builderForValue.build(); + } else { + errorBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** .google.showcase.v1beta1.ErrorWithMultipleDetails error = 1; */ + public Builder mergeError(com.google.showcase.v1beta1.ErrorWithMultipleDetails value) { + if (errorBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) + && error_ != null + && error_ + != com.google.showcase.v1beta1.ErrorWithMultipleDetails.getDefaultInstance()) { + getErrorBuilder().mergeFrom(value); + } else { + error_ = value; + } + } else { + errorBuilder_.mergeFrom(value); + } + if (error_ != null) { + bitField0_ |= 0x00000001; + onChanged(); + } + return this; + } + + /** .google.showcase.v1beta1.ErrorWithMultipleDetails error = 1; */ + public Builder clearError() { + bitField0_ = (bitField0_ & ~0x00000001); + error_ = null; + if (errorBuilder_ != null) { + errorBuilder_.dispose(); + errorBuilder_ = null; + } + onChanged(); + return this; + } + + /** .google.showcase.v1beta1.ErrorWithMultipleDetails error = 1; */ + public com.google.showcase.v1beta1.ErrorWithMultipleDetails.Builder getErrorBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return internalGetErrorFieldBuilder().getBuilder(); + } + + /** .google.showcase.v1beta1.ErrorWithMultipleDetails error = 1; */ + public com.google.showcase.v1beta1.ErrorWithMultipleDetailsOrBuilder getErrorOrBuilder() { + if (errorBuilder_ != null) { + return errorBuilder_.getMessageOrBuilder(); + } else { + return error_ == null + ? com.google.showcase.v1beta1.ErrorWithMultipleDetails.getDefaultInstance() + : error_; + } + } + + /** .google.showcase.v1beta1.ErrorWithMultipleDetails error = 1; */ + private com.google.protobuf.SingleFieldBuilder< + com.google.showcase.v1beta1.ErrorWithMultipleDetails, + com.google.showcase.v1beta1.ErrorWithMultipleDetails.Builder, + com.google.showcase.v1beta1.ErrorWithMultipleDetailsOrBuilder> + internalGetErrorFieldBuilder() { + if (errorBuilder_ == null) { + errorBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.showcase.v1beta1.ErrorWithMultipleDetails, + com.google.showcase.v1beta1.ErrorWithMultipleDetails.Builder, + com.google.showcase.v1beta1.ErrorWithMultipleDetailsOrBuilder>( + getError(), getParentForChildren(), isClean()); + error_ = null; + } + return errorBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.showcase.v1beta1.EchoErrorDetailsResponse.MultipleDetails) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.EchoErrorDetailsResponse.MultipleDetails) + private static final com.google.showcase.v1beta1.EchoErrorDetailsResponse.MultipleDetails + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.EchoErrorDetailsResponse.MultipleDetails(); + } + + public static com.google.showcase.v1beta1.EchoErrorDetailsResponse.MultipleDetails + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public MultipleDetails 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.showcase.v1beta1.EchoErrorDetailsResponse.MultipleDetails + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + private int bitField0_; + public static final int SINGLE_DETAIL_FIELD_NUMBER = 1; + private com.google.showcase.v1beta1.EchoErrorDetailsResponse.SingleDetail singleDetail_; + + /** + * .google.showcase.v1beta1.EchoErrorDetailsResponse.SingleDetail single_detail = 1; + * + * @return Whether the singleDetail field is set. + */ + @java.lang.Override + public boolean hasSingleDetail() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * .google.showcase.v1beta1.EchoErrorDetailsResponse.SingleDetail single_detail = 1; + * + * @return The singleDetail. + */ + @java.lang.Override + public com.google.showcase.v1beta1.EchoErrorDetailsResponse.SingleDetail getSingleDetail() { + return singleDetail_ == null + ? com.google.showcase.v1beta1.EchoErrorDetailsResponse.SingleDetail.getDefaultInstance() + : singleDetail_; + } + + /** + * .google.showcase.v1beta1.EchoErrorDetailsResponse.SingleDetail single_detail = 1; + */ + @java.lang.Override + public com.google.showcase.v1beta1.EchoErrorDetailsResponse.SingleDetailOrBuilder + getSingleDetailOrBuilder() { + return singleDetail_ == null + ? com.google.showcase.v1beta1.EchoErrorDetailsResponse.SingleDetail.getDefaultInstance() + : singleDetail_; + } + + public static final int MULTIPLE_DETAILS_FIELD_NUMBER = 2; + private com.google.showcase.v1beta1.EchoErrorDetailsResponse.MultipleDetails multipleDetails_; + + /** + * .google.showcase.v1beta1.EchoErrorDetailsResponse.MultipleDetails multiple_details = 2; + * + * + * @return Whether the multipleDetails field is set. + */ + @java.lang.Override + public boolean hasMultipleDetails() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * .google.showcase.v1beta1.EchoErrorDetailsResponse.MultipleDetails multiple_details = 2; + * + * + * @return The multipleDetails. + */ + @java.lang.Override + public com.google.showcase.v1beta1.EchoErrorDetailsResponse.MultipleDetails getMultipleDetails() { + return multipleDetails_ == null + ? com.google.showcase.v1beta1.EchoErrorDetailsResponse.MultipleDetails.getDefaultInstance() + : multipleDetails_; + } + + /** + * .google.showcase.v1beta1.EchoErrorDetailsResponse.MultipleDetails multiple_details = 2; + * + */ + @java.lang.Override + public com.google.showcase.v1beta1.EchoErrorDetailsResponse.MultipleDetailsOrBuilder + getMultipleDetailsOrBuilder() { + return multipleDetails_ == null + ? com.google.showcase.v1beta1.EchoErrorDetailsResponse.MultipleDetails.getDefaultInstance() + : multipleDetails_; + } + + 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, getSingleDetail()); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeMessage(2, getMultipleDetails()); + } + 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, getSingleDetail()); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getMultipleDetails()); + } + 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.showcase.v1beta1.EchoErrorDetailsResponse)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.EchoErrorDetailsResponse other = + (com.google.showcase.v1beta1.EchoErrorDetailsResponse) obj; + + if (hasSingleDetail() != other.hasSingleDetail()) return false; + if (hasSingleDetail()) { + if (!getSingleDetail().equals(other.getSingleDetail())) return false; + } + if (hasMultipleDetails() != other.hasMultipleDetails()) return false; + if (hasMultipleDetails()) { + if (!getMultipleDetails().equals(other.getMultipleDetails())) 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 (hasSingleDetail()) { + hash = (37 * hash) + SINGLE_DETAIL_FIELD_NUMBER; + hash = (53 * hash) + getSingleDetail().hashCode(); + } + if (hasMultipleDetails()) { + hash = (37 * hash) + MULTIPLE_DETAILS_FIELD_NUMBER; + hash = (53 * hash) + getMultipleDetails().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.showcase.v1beta1.EchoErrorDetailsResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.EchoErrorDetailsResponse parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.EchoErrorDetailsResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.EchoErrorDetailsResponse 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.showcase.v1beta1.EchoErrorDetailsResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.EchoErrorDetailsResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.EchoErrorDetailsResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.EchoErrorDetailsResponse parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.showcase.v1beta1.EchoErrorDetailsResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.EchoErrorDetailsResponse parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.showcase.v1beta1.EchoErrorDetailsResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.EchoErrorDetailsResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.showcase.v1beta1.EchoErrorDetailsResponse 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
        +   * The response message used for the EchoErrorDetails method.
        +   * 
        + * + * Protobuf type {@code google.showcase.v1beta1.EchoErrorDetailsResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.EchoErrorDetailsResponse) + com.google.showcase.v1beta1.EchoErrorDetailsResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.EchoOuterClass + .internal_static_google_showcase_v1beta1_EchoErrorDetailsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.EchoOuterClass + .internal_static_google_showcase_v1beta1_EchoErrorDetailsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.EchoErrorDetailsResponse.class, + com.google.showcase.v1beta1.EchoErrorDetailsResponse.Builder.class); + } + + // Construct using com.google.showcase.v1beta1.EchoErrorDetailsResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetSingleDetailFieldBuilder(); + internalGetMultipleDetailsFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + singleDetail_ = null; + if (singleDetailBuilder_ != null) { + singleDetailBuilder_.dispose(); + singleDetailBuilder_ = null; + } + multipleDetails_ = null; + if (multipleDetailsBuilder_ != null) { + multipleDetailsBuilder_.dispose(); + multipleDetailsBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.showcase.v1beta1.EchoOuterClass + .internal_static_google_showcase_v1beta1_EchoErrorDetailsResponse_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.EchoErrorDetailsResponse getDefaultInstanceForType() { + return com.google.showcase.v1beta1.EchoErrorDetailsResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.EchoErrorDetailsResponse build() { + com.google.showcase.v1beta1.EchoErrorDetailsResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.EchoErrorDetailsResponse buildPartial() { + com.google.showcase.v1beta1.EchoErrorDetailsResponse result = + new com.google.showcase.v1beta1.EchoErrorDetailsResponse(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.showcase.v1beta1.EchoErrorDetailsResponse result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.singleDetail_ = + singleDetailBuilder_ == null ? singleDetail_ : singleDetailBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.multipleDetails_ = + multipleDetailsBuilder_ == null ? multipleDetails_ : multipleDetailsBuilder_.build(); + to_bitField0_ |= 0x00000002; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.showcase.v1beta1.EchoErrorDetailsResponse) { + return mergeFrom((com.google.showcase.v1beta1.EchoErrorDetailsResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.showcase.v1beta1.EchoErrorDetailsResponse other) { + if (other == com.google.showcase.v1beta1.EchoErrorDetailsResponse.getDefaultInstance()) + return this; + if (other.hasSingleDetail()) { + mergeSingleDetail(other.getSingleDetail()); + } + if (other.hasMultipleDetails()) { + mergeMultipleDetails(other.getMultipleDetails()); + } + 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( + internalGetSingleDetailFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + input.readMessage( + internalGetMultipleDetailsFieldBuilder().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 com.google.showcase.v1beta1.EchoErrorDetailsResponse.SingleDetail singleDetail_; + private com.google.protobuf.SingleFieldBuilder< + com.google.showcase.v1beta1.EchoErrorDetailsResponse.SingleDetail, + com.google.showcase.v1beta1.EchoErrorDetailsResponse.SingleDetail.Builder, + com.google.showcase.v1beta1.EchoErrorDetailsResponse.SingleDetailOrBuilder> + singleDetailBuilder_; + + /** + * .google.showcase.v1beta1.EchoErrorDetailsResponse.SingleDetail single_detail = 1; + * + * + * @return Whether the singleDetail field is set. + */ + public boolean hasSingleDetail() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * .google.showcase.v1beta1.EchoErrorDetailsResponse.SingleDetail single_detail = 1; + * + * + * @return The singleDetail. + */ + public com.google.showcase.v1beta1.EchoErrorDetailsResponse.SingleDetail getSingleDetail() { + if (singleDetailBuilder_ == null) { + return singleDetail_ == null + ? com.google.showcase.v1beta1.EchoErrorDetailsResponse.SingleDetail.getDefaultInstance() + : singleDetail_; + } else { + return singleDetailBuilder_.getMessage(); + } + } + + /** + * .google.showcase.v1beta1.EchoErrorDetailsResponse.SingleDetail single_detail = 1; + * + */ + public Builder setSingleDetail( + com.google.showcase.v1beta1.EchoErrorDetailsResponse.SingleDetail value) { + if (singleDetailBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + singleDetail_ = value; + } else { + singleDetailBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * .google.showcase.v1beta1.EchoErrorDetailsResponse.SingleDetail single_detail = 1; + * + */ + public Builder setSingleDetail( + com.google.showcase.v1beta1.EchoErrorDetailsResponse.SingleDetail.Builder builderForValue) { + if (singleDetailBuilder_ == null) { + singleDetail_ = builderForValue.build(); + } else { + singleDetailBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * .google.showcase.v1beta1.EchoErrorDetailsResponse.SingleDetail single_detail = 1; + * + */ + public Builder mergeSingleDetail( + com.google.showcase.v1beta1.EchoErrorDetailsResponse.SingleDetail value) { + if (singleDetailBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) + && singleDetail_ != null + && singleDetail_ + != com.google.showcase.v1beta1.EchoErrorDetailsResponse.SingleDetail + .getDefaultInstance()) { + getSingleDetailBuilder().mergeFrom(value); + } else { + singleDetail_ = value; + } + } else { + singleDetailBuilder_.mergeFrom(value); + } + if (singleDetail_ != null) { + bitField0_ |= 0x00000001; + onChanged(); + } + return this; + } + + /** + * .google.showcase.v1beta1.EchoErrorDetailsResponse.SingleDetail single_detail = 1; + * + */ + public Builder clearSingleDetail() { + bitField0_ = (bitField0_ & ~0x00000001); + singleDetail_ = null; + if (singleDetailBuilder_ != null) { + singleDetailBuilder_.dispose(); + singleDetailBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * .google.showcase.v1beta1.EchoErrorDetailsResponse.SingleDetail single_detail = 1; + * + */ + public com.google.showcase.v1beta1.EchoErrorDetailsResponse.SingleDetail.Builder + getSingleDetailBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return internalGetSingleDetailFieldBuilder().getBuilder(); + } + + /** + * .google.showcase.v1beta1.EchoErrorDetailsResponse.SingleDetail single_detail = 1; + * + */ + public com.google.showcase.v1beta1.EchoErrorDetailsResponse.SingleDetailOrBuilder + getSingleDetailOrBuilder() { + if (singleDetailBuilder_ != null) { + return singleDetailBuilder_.getMessageOrBuilder(); + } else { + return singleDetail_ == null + ? com.google.showcase.v1beta1.EchoErrorDetailsResponse.SingleDetail.getDefaultInstance() + : singleDetail_; + } + } + + /** + * .google.showcase.v1beta1.EchoErrorDetailsResponse.SingleDetail single_detail = 1; + * + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.showcase.v1beta1.EchoErrorDetailsResponse.SingleDetail, + com.google.showcase.v1beta1.EchoErrorDetailsResponse.SingleDetail.Builder, + com.google.showcase.v1beta1.EchoErrorDetailsResponse.SingleDetailOrBuilder> + internalGetSingleDetailFieldBuilder() { + if (singleDetailBuilder_ == null) { + singleDetailBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.showcase.v1beta1.EchoErrorDetailsResponse.SingleDetail, + com.google.showcase.v1beta1.EchoErrorDetailsResponse.SingleDetail.Builder, + com.google.showcase.v1beta1.EchoErrorDetailsResponse.SingleDetailOrBuilder>( + getSingleDetail(), getParentForChildren(), isClean()); + singleDetail_ = null; + } + return singleDetailBuilder_; + } + + private com.google.showcase.v1beta1.EchoErrorDetailsResponse.MultipleDetails multipleDetails_; + private com.google.protobuf.SingleFieldBuilder< + com.google.showcase.v1beta1.EchoErrorDetailsResponse.MultipleDetails, + com.google.showcase.v1beta1.EchoErrorDetailsResponse.MultipleDetails.Builder, + com.google.showcase.v1beta1.EchoErrorDetailsResponse.MultipleDetailsOrBuilder> + multipleDetailsBuilder_; + + /** + * .google.showcase.v1beta1.EchoErrorDetailsResponse.MultipleDetails multiple_details = 2; + * + * + * @return Whether the multipleDetails field is set. + */ + public boolean hasMultipleDetails() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * .google.showcase.v1beta1.EchoErrorDetailsResponse.MultipleDetails multiple_details = 2; + * + * + * @return The multipleDetails. + */ + public com.google.showcase.v1beta1.EchoErrorDetailsResponse.MultipleDetails + getMultipleDetails() { + if (multipleDetailsBuilder_ == null) { + return multipleDetails_ == null + ? com.google.showcase.v1beta1.EchoErrorDetailsResponse.MultipleDetails + .getDefaultInstance() + : multipleDetails_; + } else { + return multipleDetailsBuilder_.getMessage(); + } + } + + /** + * .google.showcase.v1beta1.EchoErrorDetailsResponse.MultipleDetails multiple_details = 2; + * + */ + public Builder setMultipleDetails( + com.google.showcase.v1beta1.EchoErrorDetailsResponse.MultipleDetails value) { + if (multipleDetailsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + multipleDetails_ = value; + } else { + multipleDetailsBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * .google.showcase.v1beta1.EchoErrorDetailsResponse.MultipleDetails multiple_details = 2; + * + */ + public Builder setMultipleDetails( + com.google.showcase.v1beta1.EchoErrorDetailsResponse.MultipleDetails.Builder + builderForValue) { + if (multipleDetailsBuilder_ == null) { + multipleDetails_ = builderForValue.build(); + } else { + multipleDetailsBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * .google.showcase.v1beta1.EchoErrorDetailsResponse.MultipleDetails multiple_details = 2; + * + */ + public Builder mergeMultipleDetails( + com.google.showcase.v1beta1.EchoErrorDetailsResponse.MultipleDetails value) { + if (multipleDetailsBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && multipleDetails_ != null + && multipleDetails_ + != com.google.showcase.v1beta1.EchoErrorDetailsResponse.MultipleDetails + .getDefaultInstance()) { + getMultipleDetailsBuilder().mergeFrom(value); + } else { + multipleDetails_ = value; + } + } else { + multipleDetailsBuilder_.mergeFrom(value); + } + if (multipleDetails_ != null) { + bitField0_ |= 0x00000002; + onChanged(); + } + return this; + } + + /** + * .google.showcase.v1beta1.EchoErrorDetailsResponse.MultipleDetails multiple_details = 2; + * + */ + public Builder clearMultipleDetails() { + bitField0_ = (bitField0_ & ~0x00000002); + multipleDetails_ = null; + if (multipleDetailsBuilder_ != null) { + multipleDetailsBuilder_.dispose(); + multipleDetailsBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * .google.showcase.v1beta1.EchoErrorDetailsResponse.MultipleDetails multiple_details = 2; + * + */ + public com.google.showcase.v1beta1.EchoErrorDetailsResponse.MultipleDetails.Builder + getMultipleDetailsBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return internalGetMultipleDetailsFieldBuilder().getBuilder(); + } + + /** + * .google.showcase.v1beta1.EchoErrorDetailsResponse.MultipleDetails multiple_details = 2; + * + */ + public com.google.showcase.v1beta1.EchoErrorDetailsResponse.MultipleDetailsOrBuilder + getMultipleDetailsOrBuilder() { + if (multipleDetailsBuilder_ != null) { + return multipleDetailsBuilder_.getMessageOrBuilder(); + } else { + return multipleDetails_ == null + ? com.google.showcase.v1beta1.EchoErrorDetailsResponse.MultipleDetails + .getDefaultInstance() + : multipleDetails_; + } + } + + /** + * .google.showcase.v1beta1.EchoErrorDetailsResponse.MultipleDetails multiple_details = 2; + * + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.showcase.v1beta1.EchoErrorDetailsResponse.MultipleDetails, + com.google.showcase.v1beta1.EchoErrorDetailsResponse.MultipleDetails.Builder, + com.google.showcase.v1beta1.EchoErrorDetailsResponse.MultipleDetailsOrBuilder> + internalGetMultipleDetailsFieldBuilder() { + if (multipleDetailsBuilder_ == null) { + multipleDetailsBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.showcase.v1beta1.EchoErrorDetailsResponse.MultipleDetails, + com.google.showcase.v1beta1.EchoErrorDetailsResponse.MultipleDetails.Builder, + com.google.showcase.v1beta1.EchoErrorDetailsResponse.MultipleDetailsOrBuilder>( + getMultipleDetails(), getParentForChildren(), isClean()); + multipleDetails_ = null; + } + return multipleDetailsBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.showcase.v1beta1.EchoErrorDetailsResponse) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.EchoErrorDetailsResponse) + private static final com.google.showcase.v1beta1.EchoErrorDetailsResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.EchoErrorDetailsResponse(); + } + + public static com.google.showcase.v1beta1.EchoErrorDetailsResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public EchoErrorDetailsResponse 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.showcase.v1beta1.EchoErrorDetailsResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/EchoErrorDetailsResponseOrBuilder.java b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/EchoErrorDetailsResponseOrBuilder.java new file mode 100644 index 0000000000..700bc95bef --- /dev/null +++ b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/EchoErrorDetailsResponseOrBuilder.java @@ -0,0 +1,71 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: schema/google/showcase/v1beta1/echo.proto +// Protobuf Java Version: 4.33.2 + +package com.google.showcase.v1beta1; + +@com.google.protobuf.Generated +public interface EchoErrorDetailsResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.EchoErrorDetailsResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * .google.showcase.v1beta1.EchoErrorDetailsResponse.SingleDetail single_detail = 1; + * + * @return Whether the singleDetail field is set. + */ + boolean hasSingleDetail(); + + /** + * .google.showcase.v1beta1.EchoErrorDetailsResponse.SingleDetail single_detail = 1; + * + * @return The singleDetail. + */ + com.google.showcase.v1beta1.EchoErrorDetailsResponse.SingleDetail getSingleDetail(); + + /** + * .google.showcase.v1beta1.EchoErrorDetailsResponse.SingleDetail single_detail = 1; + */ + com.google.showcase.v1beta1.EchoErrorDetailsResponse.SingleDetailOrBuilder + getSingleDetailOrBuilder(); + + /** + * .google.showcase.v1beta1.EchoErrorDetailsResponse.MultipleDetails multiple_details = 2; + * + * + * @return Whether the multipleDetails field is set. + */ + boolean hasMultipleDetails(); + + /** + * .google.showcase.v1beta1.EchoErrorDetailsResponse.MultipleDetails multiple_details = 2; + * + * + * @return The multipleDetails. + */ + com.google.showcase.v1beta1.EchoErrorDetailsResponse.MultipleDetails getMultipleDetails(); + + /** + * .google.showcase.v1beta1.EchoErrorDetailsResponse.MultipleDetails multiple_details = 2; + * + */ + com.google.showcase.v1beta1.EchoErrorDetailsResponse.MultipleDetailsOrBuilder + getMultipleDetailsOrBuilder(); +} diff --git a/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/EchoOuterClass.java b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/EchoOuterClass.java new file mode 100644 index 0000000000..9f24e3f6d1 --- /dev/null +++ b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/EchoOuterClass.java @@ -0,0 +1,517 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: schema/google/showcase/v1beta1/echo.proto +// Protobuf Java Version: 4.33.2 + +package com.google.showcase.v1beta1; + +@com.google.protobuf.Generated +public final class EchoOuterClass extends com.google.protobuf.GeneratedFile { + private EchoOuterClass() {} + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "EchoOuterClass"); + } + + 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_showcase_v1beta1_EchoRequest_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_showcase_v1beta1_EchoRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_showcase_v1beta1_EchoResponse_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_showcase_v1beta1_EchoResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_showcase_v1beta1_EchoErrorDetailsRequest_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_showcase_v1beta1_EchoErrorDetailsRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_showcase_v1beta1_EchoErrorDetailsResponse_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_showcase_v1beta1_EchoErrorDetailsResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_showcase_v1beta1_EchoErrorDetailsResponse_SingleDetail_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_showcase_v1beta1_EchoErrorDetailsResponse_SingleDetail_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_showcase_v1beta1_EchoErrorDetailsResponse_MultipleDetails_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_showcase_v1beta1_EchoErrorDetailsResponse_MultipleDetails_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_showcase_v1beta1_ErrorWithSingleDetail_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_showcase_v1beta1_ErrorWithSingleDetail_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_showcase_v1beta1_ErrorWithMultipleDetails_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_showcase_v1beta1_ErrorWithMultipleDetails_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_showcase_v1beta1_PoetryError_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_showcase_v1beta1_PoetryError_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_showcase_v1beta1_FailEchoWithDetailsRequest_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_showcase_v1beta1_FailEchoWithDetailsRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_showcase_v1beta1_FailEchoWithDetailsResponse_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_showcase_v1beta1_FailEchoWithDetailsResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_showcase_v1beta1_ExpandRequest_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_showcase_v1beta1_ExpandRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_showcase_v1beta1_PagedExpandRequest_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_showcase_v1beta1_PagedExpandRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_showcase_v1beta1_PagedExpandLegacyRequest_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_showcase_v1beta1_PagedExpandLegacyRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_showcase_v1beta1_PagedExpandResponse_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_showcase_v1beta1_PagedExpandResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_showcase_v1beta1_PagedExpandResponseList_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_showcase_v1beta1_PagedExpandResponseList_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_showcase_v1beta1_PagedExpandLegacyMappedResponse_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_showcase_v1beta1_PagedExpandLegacyMappedResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_showcase_v1beta1_PagedExpandLegacyMappedResponse_AlphabetizedEntry_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_showcase_v1beta1_PagedExpandLegacyMappedResponse_AlphabetizedEntry_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_showcase_v1beta1_WaitRequest_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_showcase_v1beta1_WaitRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_showcase_v1beta1_WaitResponse_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_showcase_v1beta1_WaitResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_showcase_v1beta1_WaitMetadata_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_showcase_v1beta1_WaitMetadata_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_showcase_v1beta1_BlockRequest_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_showcase_v1beta1_BlockRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_showcase_v1beta1_BlockResponse_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_showcase_v1beta1_BlockResponse_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" + + ")schema/google/showcase/v1beta1/echo.pr" + + "oto\022\027google.showcase.v1beta1\032\034google/api" + + "/annotations.proto\032\027google/api/client.pr" + + "oto\032\037google/api/field_behavior.proto\032\033go" + + "ogle/api/field_info.proto\032\030google/api/ro" + + "uting.proto\032#google/longrunning/operatio" + + "ns.proto\032\031google/protobuf/any.proto\032\036goo" + + "gle/protobuf/duration.proto\032\037google/prot" + + "obuf/timestamp.proto\032\027google/rpc/status.proto\"\210\002\n" + + "\013EchoRequest\022\021\n" + + "\007content\030\001 \001(\tH\000\022#\n" + + "\005error\030\002 \001(\0132\022.google.rpc.StatusH\000\0223\n" + + "\010severity\030\003 \001(\0162!.google.showcase.v1beta1.Severity\022\016\n" + + "\006header\030\004 \001(\t\022\024\n" + + "\014other_header\030\005 \001(\t\022\034\n\n" + + "request_id\030\007 \001(\tB\010\342\214\317\327\010\002\010\001\022\'\n" + + "\020other_request_id\030\010 \001(" + + "\tB\010\342\214\317\327\010\002\010\001H\001\210\001\001B\n\n" + + "\010responseB\023\n" + + "\021_other_request_id\"\202\001\n" + + "\014EchoResponse\022\017\n" + + "\007content\030\001 \001(\t\0223\n" + + "\010severity\030\002 \001(\0162!.google.showcase.v1beta1.Severity\022\022\n\n" + + "request_id\030\003 \001(\t\022\030\n" + + "\020other_request_id\030\004 \001(\t\"P\n" + + "\027EchoErrorDetailsRequest\022\032\n" + + "\022single_detail_text\030\001 \001(\t\022\031\n" + + "\021multi_detail_text\030\002 \003(\t\"\362\002\n" + + "\030EchoErrorDetailsResponse\022U\n\r" + + "single_detail\030\001 \001(\0132>.google.showcase.v1" + + "beta1.EchoErrorDetailsResponse.SingleDetail\022[\n" + + "\020multiple_details\030\002 \001(\0132A.google.s" + + "howcase.v1beta1.EchoErrorDetailsResponse.MultipleDetails\032M\n" + + "\014SingleDetail\022=\n" + + "\005error\030\001 \001(\0132..google.showcase.v1beta1.ErrorWithSingleDetail\032S\n" + + "\017MultipleDetails\022@\n" + + "\005error\030\001 \001(\01321.google.showcase.v1beta1.ErrorWithMultipleDetails\">\n" + + "\025ErrorWithSingleDetail\022%\n" + + "\007details\030\001 \001(\0132\024.google.protobuf.Any\"A\n" + + "\030ErrorWithMultipleDetails\022%\n" + + "\007details\030\001 \003(\0132\024.google.protobuf.Any\"\033\n" + + "\013PoetryError\022\014\n" + + "\004poem\030\001 \001(\t\"-\n" + + "\032FailEchoWithDetailsRequest\022\017\n" + + "\007message\030\001 \001(\t\"\035\n" + + "\033FailEchoWithDetailsResponse\"x\n\r" + + "ExpandRequest\022\017\n" + + "\007content\030\001 \001(\t\022!\n" + + "\005error\030\002 \001(\0132\022.google.rpc.Status\0223\n" + + "\020stream_wait_time\030\003 \001(\0132\031.google.protobuf.Duration\"Q\n" + + "\022PagedExpandRequest\022\024\n" + + "\007content\030\001 \001(\tB\003\340A\002\022\021\n" + + "\tpage_size\030\002 \001(\005\022\022\n\n" + + "page_token\030\003 \001(\t\"Y\n" + + "\030PagedExpandLegacyRequest\022\024\n" + + "\007content\030\001 \001(\tB\003\340A\002\022\023\n" + + "\013max_results\030\002 \001(\005\022\022\n\n" + + "page_token\030\003 \001(\t\"h\n" + + "\023PagedExpandResponse\0228\n" + + "\tresponses\030\001 \003(\0132%.google.showcase.v1beta1.EchoResponse\022\027\n" + + "\017next_page_token\030\002 \001(\t\"(\n" + + "\027PagedExpandResponseList\022\r\n" + + "\005words\030\001 \003(\t\"\203\002\n" + + "\037PagedExpandLegacyMappedResponse\022`\n" + + "\014alphabetized\030\001 \003(\013" + + "2J.google.showcase.v1beta1.PagedExpandLegacyMappedResponse.AlphabetizedEntry\022\027\n" + + "\017next_page_token\030\002 \001(\t\032e\n" + + "\021AlphabetizedEntry\022\013\n" + + "\003key\030\001 \001(\t\022?\n" + + "\005value\030\002 \001(\01320.google." + + "showcase.v1beta1.PagedExpandResponseList:\0028\001\"\331\001\n" + + "\013WaitRequest\022.\n" + + "\010end_time\030\001 \001(\0132\032.google.protobuf.TimestampH\000\022(\n" + + "\003ttl\030\004 \001(\0132\031.google.protobuf.DurationH\000\022#\n" + + "\005error\030\002 \001(\0132\022.google.rpc.StatusH\001\0228\n" + + "\007success\030\003 \001(\0132%.google.showcase.v1beta1.WaitResponseH\001B\005\n" + + "\003endB\n\n" + + "\010response\"\037\n" + + "\014WaitResponse\022\017\n" + + "\007content\030\001 \001(\t\"<\n" + + "\014WaitMetadata\022,\n" + + "\010end_time\030\001 \001(\0132\032.google.protobuf.Timestamp\"\255\001\n" + + "\014BlockRequest\0221\n" + + "\016response_delay\030\001 \001(\0132\031.google.protobuf.Duration\022#\n" + + "\005error\030\002 \001(\0132\022.google.rpc.StatusH\000\0229\n" + + "\007success\030\003 \001(\0132&.google.showcase.v1beta1.BlockResponseH\000B\n\n" + + "\010response\" \n\r" + + "BlockResponse\022\017\n" + + "\007content\030\001 \001(\t*D\n" + + "\010Severity\022\017\n" + + "\013UNNECESSARY\020\000\022\r" + + "\n" + + "\tNECESSARY\020\001\022\n\n" + + "\006URGENT\020\002\022\014\n" + + "\010CRITICAL\020\0032\337\016\n" + + "\004Echo\022\224\003\n" + + "\004Echo\022$.google.showcase.v1beta1.EchoRequest\032%.google.showcase.v1beta" + + "1.EchoResponse\"\276\002\202\323\344\223\002\027\"\022/v1beta1/echo:echo:\001*\212\323\344\223\002\232\002\022\010\n" + + "\006header\022\031\n" + + "\006header\022\017{routing_id=**}\022+\n" + + "\006header\022!{table_name=regions/*/zones/*/**}\022\"\n" + + "\006header\022\030{super_id=projects/*}/**\0220\n" + + "\006header\022&{table_name=projects/*/instances/*/**}\0221\n" + + "\006header\022\'projects/*/{instance_id=instances/*}/**\022\030\n" + + "\014other_header\022\010{baz=**}\022#\n" + + "\014other_header\022\023{qux=projects/*}/**\022\237\001\n" + + "\020EchoErrorDetails\0220.google.showcase.v1beta1.EchoErrorDetailsR" + + "equest\0321.google.showcase.v1beta1.EchoErrorDetailsResponse\"&\202\323\344\223\002" + + " \"\033/v1beta1/echo:error-details:\001*\022\252\001\n" + + "\023FailEchoWithDetails\0223.google.showcase.v1beta1.FailEchoWith" + + "DetailsRequest\0324.google.showcase.v1beta1" + + ".FailEchoWithDetailsResponse\"(\202\323\344\223\002\"\"\035/v1beta1/echo:failWithDetails:\001*\022\212\001\n" + + "\006Expand\022&.google.showcase.v1beta1.ExpandReques" + + "t\032%.google.showcase.v1beta1.EchoResponse\"/\332A\r" + + "content,error\202\323\344\223\002\031\"\024/v1beta1/echo:expand:\001*0\001\022z\n" + + "\007Collect\022$.google.showcase" + + ".v1beta1.EchoRequest\032%.google.showcase.v1beta1.EchoResponse\"" + + " \202\323\344\223\002\032\"\025/v1beta1/echo:collect:\001*(\001\022W\n" + + "\004Chat\022$.google.showcas" + + "e.v1beta1.EchoRequest\032%.google.showcase.v1beta1.EchoResponse(\0010\001\022\216\001\n" + + "\013PagedExpand\022+.google.showcase.v1beta1.PagedExpandRe" + + "quest\032,.google.showcase.v1beta1.PagedExp" + + "andResponse\"$\202\323\344\223\002\036\"\031/v1beta1/echo:pagedExpand:\001*\022\240\001\n" + + "\021PagedExpandLegacy\0221.google.showcase.v1beta1.PagedExpandLegacyReque" + + "st\032,.google.showcase.v1beta1.PagedExpand" + + "Response\"*\202\323\344\223\002$\"\037/v1beta1/echo:pagedExpandLegacy:\001*\022\262\001\n" + + "\027PagedExpandLegacyMapped\022+.google.showcase.v1beta1.PagedExpandRe" + + "quest\0328.google.showcase.v1beta1.PagedExp" + + "andLegacyMappedResponse\"0\202\323\344\223\002*\"%/v1beta1/echo:pagedExpandLegacyMapped:\001*\022\211\001\n" + + "\004Wa" + + "it\022$.google.showcase.v1beta1.WaitRequest\032\035.google.longrunning.Operation\"<\312A\034\n" + + "\014Wa" + + "itResponse\022\014WaitMetadata\202\323\344\223\002\027\"\022/v1beta1/echo:wait:\001*\022v\n" + + "\005Block\022%.google.showcase.v1beta1.BlockRequest\032&.google.showcase." + + "v1beta1.BlockResponse\"\036\202\323\344\223\002\030\"\023/v1beta1/" + + "echo:block:\001*\032\"\312A\016localhost:7469\212\324\333\322\017\013v1_20240408Bq\n" + + "\033com.google.showcase.v1beta1P\001Z4github.com/googleapis/gapic-showcase" + + "/server/genproto\352\002\031Google::Showcase::V1beta1b\006proto3" + }; + descriptor = + com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( + descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + com.google.api.AnnotationsProto.getDescriptor(), + com.google.api.ClientProto.getDescriptor(), + com.google.api.FieldBehaviorProto.getDescriptor(), + com.google.api.FieldInfoProto.getDescriptor(), + com.google.api.RoutingProto.getDescriptor(), + com.google.longrunning.OperationsProto.getDescriptor(), + com.google.protobuf.AnyProto.getDescriptor(), + com.google.protobuf.DurationProto.getDescriptor(), + com.google.protobuf.TimestampProto.getDescriptor(), + com.google.rpc.StatusProto.getDescriptor(), + }); + internal_static_google_showcase_v1beta1_EchoRequest_descriptor = + getDescriptor().getMessageType(0); + internal_static_google_showcase_v1beta1_EchoRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_showcase_v1beta1_EchoRequest_descriptor, + new java.lang.String[] { + "Content", + "Error", + "Severity", + "Header", + "OtherHeader", + "RequestId", + "OtherRequestId", + "Response", + }); + internal_static_google_showcase_v1beta1_EchoResponse_descriptor = + getDescriptor().getMessageType(1); + internal_static_google_showcase_v1beta1_EchoResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_showcase_v1beta1_EchoResponse_descriptor, + new java.lang.String[] { + "Content", "Severity", "RequestId", "OtherRequestId", + }); + internal_static_google_showcase_v1beta1_EchoErrorDetailsRequest_descriptor = + getDescriptor().getMessageType(2); + internal_static_google_showcase_v1beta1_EchoErrorDetailsRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_showcase_v1beta1_EchoErrorDetailsRequest_descriptor, + new java.lang.String[] { + "SingleDetailText", "MultiDetailText", + }); + internal_static_google_showcase_v1beta1_EchoErrorDetailsResponse_descriptor = + getDescriptor().getMessageType(3); + internal_static_google_showcase_v1beta1_EchoErrorDetailsResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_showcase_v1beta1_EchoErrorDetailsResponse_descriptor, + new java.lang.String[] { + "SingleDetail", "MultipleDetails", + }); + internal_static_google_showcase_v1beta1_EchoErrorDetailsResponse_SingleDetail_descriptor = + internal_static_google_showcase_v1beta1_EchoErrorDetailsResponse_descriptor.getNestedType( + 0); + internal_static_google_showcase_v1beta1_EchoErrorDetailsResponse_SingleDetail_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_showcase_v1beta1_EchoErrorDetailsResponse_SingleDetail_descriptor, + new java.lang.String[] { + "Error", + }); + internal_static_google_showcase_v1beta1_EchoErrorDetailsResponse_MultipleDetails_descriptor = + internal_static_google_showcase_v1beta1_EchoErrorDetailsResponse_descriptor.getNestedType( + 1); + internal_static_google_showcase_v1beta1_EchoErrorDetailsResponse_MultipleDetails_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_showcase_v1beta1_EchoErrorDetailsResponse_MultipleDetails_descriptor, + new java.lang.String[] { + "Error", + }); + internal_static_google_showcase_v1beta1_ErrorWithSingleDetail_descriptor = + getDescriptor().getMessageType(4); + internal_static_google_showcase_v1beta1_ErrorWithSingleDetail_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_showcase_v1beta1_ErrorWithSingleDetail_descriptor, + new java.lang.String[] { + "Details", + }); + internal_static_google_showcase_v1beta1_ErrorWithMultipleDetails_descriptor = + getDescriptor().getMessageType(5); + internal_static_google_showcase_v1beta1_ErrorWithMultipleDetails_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_showcase_v1beta1_ErrorWithMultipleDetails_descriptor, + new java.lang.String[] { + "Details", + }); + internal_static_google_showcase_v1beta1_PoetryError_descriptor = + getDescriptor().getMessageType(6); + internal_static_google_showcase_v1beta1_PoetryError_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_showcase_v1beta1_PoetryError_descriptor, + new java.lang.String[] { + "Poem", + }); + internal_static_google_showcase_v1beta1_FailEchoWithDetailsRequest_descriptor = + getDescriptor().getMessageType(7); + internal_static_google_showcase_v1beta1_FailEchoWithDetailsRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_showcase_v1beta1_FailEchoWithDetailsRequest_descriptor, + new java.lang.String[] { + "Message", + }); + internal_static_google_showcase_v1beta1_FailEchoWithDetailsResponse_descriptor = + getDescriptor().getMessageType(8); + internal_static_google_showcase_v1beta1_FailEchoWithDetailsResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_showcase_v1beta1_FailEchoWithDetailsResponse_descriptor, + new java.lang.String[] {}); + internal_static_google_showcase_v1beta1_ExpandRequest_descriptor = + getDescriptor().getMessageType(9); + internal_static_google_showcase_v1beta1_ExpandRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_showcase_v1beta1_ExpandRequest_descriptor, + new java.lang.String[] { + "Content", "Error", "StreamWaitTime", + }); + internal_static_google_showcase_v1beta1_PagedExpandRequest_descriptor = + getDescriptor().getMessageType(10); + internal_static_google_showcase_v1beta1_PagedExpandRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_showcase_v1beta1_PagedExpandRequest_descriptor, + new java.lang.String[] { + "Content", "PageSize", "PageToken", + }); + internal_static_google_showcase_v1beta1_PagedExpandLegacyRequest_descriptor = + getDescriptor().getMessageType(11); + internal_static_google_showcase_v1beta1_PagedExpandLegacyRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_showcase_v1beta1_PagedExpandLegacyRequest_descriptor, + new java.lang.String[] { + "Content", "MaxResults", "PageToken", + }); + internal_static_google_showcase_v1beta1_PagedExpandResponse_descriptor = + getDescriptor().getMessageType(12); + internal_static_google_showcase_v1beta1_PagedExpandResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_showcase_v1beta1_PagedExpandResponse_descriptor, + new java.lang.String[] { + "Responses", "NextPageToken", + }); + internal_static_google_showcase_v1beta1_PagedExpandResponseList_descriptor = + getDescriptor().getMessageType(13); + internal_static_google_showcase_v1beta1_PagedExpandResponseList_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_showcase_v1beta1_PagedExpandResponseList_descriptor, + new java.lang.String[] { + "Words", + }); + internal_static_google_showcase_v1beta1_PagedExpandLegacyMappedResponse_descriptor = + getDescriptor().getMessageType(14); + internal_static_google_showcase_v1beta1_PagedExpandLegacyMappedResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_showcase_v1beta1_PagedExpandLegacyMappedResponse_descriptor, + new java.lang.String[] { + "Alphabetized", "NextPageToken", + }); + internal_static_google_showcase_v1beta1_PagedExpandLegacyMappedResponse_AlphabetizedEntry_descriptor = + internal_static_google_showcase_v1beta1_PagedExpandLegacyMappedResponse_descriptor + .getNestedType(0); + internal_static_google_showcase_v1beta1_PagedExpandLegacyMappedResponse_AlphabetizedEntry_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_showcase_v1beta1_PagedExpandLegacyMappedResponse_AlphabetizedEntry_descriptor, + new java.lang.String[] { + "Key", "Value", + }); + internal_static_google_showcase_v1beta1_WaitRequest_descriptor = + getDescriptor().getMessageType(15); + internal_static_google_showcase_v1beta1_WaitRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_showcase_v1beta1_WaitRequest_descriptor, + new java.lang.String[] { + "EndTime", "Ttl", "Error", "Success", "End", "Response", + }); + internal_static_google_showcase_v1beta1_WaitResponse_descriptor = + getDescriptor().getMessageType(16); + internal_static_google_showcase_v1beta1_WaitResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_showcase_v1beta1_WaitResponse_descriptor, + new java.lang.String[] { + "Content", + }); + internal_static_google_showcase_v1beta1_WaitMetadata_descriptor = + getDescriptor().getMessageType(17); + internal_static_google_showcase_v1beta1_WaitMetadata_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_showcase_v1beta1_WaitMetadata_descriptor, + new java.lang.String[] { + "EndTime", + }); + internal_static_google_showcase_v1beta1_BlockRequest_descriptor = + getDescriptor().getMessageType(18); + internal_static_google_showcase_v1beta1_BlockRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_showcase_v1beta1_BlockRequest_descriptor, + new java.lang.String[] { + "ResponseDelay", "Error", "Success", "Response", + }); + internal_static_google_showcase_v1beta1_BlockResponse_descriptor = + getDescriptor().getMessageType(19); + internal_static_google_showcase_v1beta1_BlockResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_showcase_v1beta1_BlockResponse_descriptor, + new java.lang.String[] { + "Content", + }); + descriptor.resolveAllFeaturesImmutable(); + com.google.api.AnnotationsProto.getDescriptor(); + com.google.api.ClientProto.getDescriptor(); + com.google.api.FieldBehaviorProto.getDescriptor(); + com.google.api.FieldInfoProto.getDescriptor(); + com.google.api.RoutingProto.getDescriptor(); + com.google.longrunning.OperationsProto.getDescriptor(); + com.google.protobuf.AnyProto.getDescriptor(); + com.google.protobuf.DurationProto.getDescriptor(); + com.google.protobuf.TimestampProto.getDescriptor(); + com.google.rpc.StatusProto.getDescriptor(); + com.google.protobuf.ExtensionRegistry registry = + com.google.protobuf.ExtensionRegistry.newInstance(); + registry.add(com.google.api.ClientProto.apiVersion); + registry.add(com.google.api.ClientProto.defaultHost); + registry.add(com.google.api.FieldBehaviorProto.fieldBehavior); + registry.add(com.google.api.FieldInfoProto.fieldInfo); + registry.add(com.google.api.AnnotationsProto.http); + registry.add(com.google.api.ClientProto.methodSignature); + registry.add(com.google.api.RoutingProto.routing); + registry.add(com.google.longrunning.OperationsProto.operationInfo); + com.google.protobuf.Descriptors.FileDescriptor.internalUpdateFileDescriptor( + descriptor, registry); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/EchoRequest.java b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/EchoRequest.java new file mode 100644 index 0000000000..3a1489e6d9 --- /dev/null +++ b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/EchoRequest.java @@ -0,0 +1,1983 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: schema/google/showcase/v1beta1/echo.proto +// Protobuf Java Version: 4.33.2 + +package com.google.showcase.v1beta1; + +/** + * + * + *
        + * The request message used for the Echo, Collect and Chat methods.
        + * If content or opt are set in this message then the request will succeed.
        + * If status is set in this message then the status will be returned as an
        + * error.
        + * 
        + * + * Protobuf type {@code google.showcase.v1beta1.EchoRequest} + */ +@com.google.protobuf.Generated +public final class EchoRequest extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.EchoRequest) + EchoRequestOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "EchoRequest"); + } + + // Use EchoRequest.newBuilder() to construct. + private EchoRequest(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private EchoRequest() { + severity_ = 0; + header_ = ""; + otherHeader_ = ""; + requestId_ = ""; + otherRequestId_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.EchoOuterClass + .internal_static_google_showcase_v1beta1_EchoRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.EchoOuterClass + .internal_static_google_showcase_v1beta1_EchoRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.EchoRequest.class, + com.google.showcase.v1beta1.EchoRequest.Builder.class); + } + + private int bitField0_; + private int responseCase_ = 0; + + @SuppressWarnings("serial") + private java.lang.Object response_; + + public enum ResponseCase + implements + com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + CONTENT(1), + ERROR(2), + RESPONSE_NOT_SET(0); + private final int value; + + private ResponseCase(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 ResponseCase valueOf(int value) { + return forNumber(value); + } + + public static ResponseCase forNumber(int value) { + switch (value) { + case 1: + return CONTENT; + case 2: + return ERROR; + case 0: + return RESPONSE_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public ResponseCase getResponseCase() { + return ResponseCase.forNumber(responseCase_); + } + + public static final int CONTENT_FIELD_NUMBER = 1; + + /** + * + * + *
        +   * The content to be echoed by the server.
        +   * 
        + * + * string content = 1; + * + * @return Whether the content field is set. + */ + public boolean hasContent() { + return responseCase_ == 1; + } + + /** + * + * + *
        +   * The content to be echoed by the server.
        +   * 
        + * + * string content = 1; + * + * @return The content. + */ + public java.lang.String getContent() { + java.lang.Object ref = ""; + if (responseCase_ == 1) { + ref = response_; + } + 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 (responseCase_ == 1) { + response_ = s; + } + return s; + } + } + + /** + * + * + *
        +   * The content to be echoed by the server.
        +   * 
        + * + * string content = 1; + * + * @return The bytes for content. + */ + public com.google.protobuf.ByteString getContentBytes() { + java.lang.Object ref = ""; + if (responseCase_ == 1) { + ref = response_; + } + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + if (responseCase_ == 1) { + response_ = b; + } + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int ERROR_FIELD_NUMBER = 2; + + /** + * + * + *
        +   * The error to be thrown by the server.
        +   * 
        + * + * .google.rpc.Status error = 2; + * + * @return Whether the error field is set. + */ + @java.lang.Override + public boolean hasError() { + return responseCase_ == 2; + } + + /** + * + * + *
        +   * The error to be thrown by the server.
        +   * 
        + * + * .google.rpc.Status error = 2; + * + * @return The error. + */ + @java.lang.Override + public com.google.rpc.Status getError() { + if (responseCase_ == 2) { + return (com.google.rpc.Status) response_; + } + return com.google.rpc.Status.getDefaultInstance(); + } + + /** + * + * + *
        +   * The error to be thrown by the server.
        +   * 
        + * + * .google.rpc.Status error = 2; + */ + @java.lang.Override + public com.google.rpc.StatusOrBuilder getErrorOrBuilder() { + if (responseCase_ == 2) { + return (com.google.rpc.Status) response_; + } + return com.google.rpc.Status.getDefaultInstance(); + } + + public static final int SEVERITY_FIELD_NUMBER = 3; + private int severity_ = 0; + + /** + * + * + *
        +   * The severity to be echoed by the server.
        +   * 
        + * + * .google.showcase.v1beta1.Severity severity = 3; + * + * @return The enum numeric value on the wire for severity. + */ + @java.lang.Override + public int getSeverityValue() { + return severity_; + } + + /** + * + * + *
        +   * The severity to be echoed by the server.
        +   * 
        + * + * .google.showcase.v1beta1.Severity severity = 3; + * + * @return The severity. + */ + @java.lang.Override + public com.google.showcase.v1beta1.Severity getSeverity() { + com.google.showcase.v1beta1.Severity result = + com.google.showcase.v1beta1.Severity.forNumber(severity_); + return result == null ? com.google.showcase.v1beta1.Severity.UNRECOGNIZED : result; + } + + public static final int HEADER_FIELD_NUMBER = 4; + + @SuppressWarnings("serial") + private volatile java.lang.Object header_ = ""; + + /** + * + * + *
        +   * Optional. This field can be set to test the routing annotation on the Echo method.
        +   * 
        + * + * string header = 4; + * + * @return The header. + */ + @java.lang.Override + public java.lang.String getHeader() { + java.lang.Object ref = header_; + 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(); + header_ = s; + return s; + } + } + + /** + * + * + *
        +   * Optional. This field can be set to test the routing annotation on the Echo method.
        +   * 
        + * + * string header = 4; + * + * @return The bytes for header. + */ + @java.lang.Override + public com.google.protobuf.ByteString getHeaderBytes() { + java.lang.Object ref = header_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + header_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int OTHER_HEADER_FIELD_NUMBER = 5; + + @SuppressWarnings("serial") + private volatile java.lang.Object otherHeader_ = ""; + + /** + * + * + *
        +   * Optional. This field can be set to test the routing annotation on the Echo method.
        +   * 
        + * + * string other_header = 5; + * + * @return The otherHeader. + */ + @java.lang.Override + public java.lang.String getOtherHeader() { + java.lang.Object ref = otherHeader_; + 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(); + otherHeader_ = s; + return s; + } + } + + /** + * + * + *
        +   * Optional. This field can be set to test the routing annotation on the Echo method.
        +   * 
        + * + * string other_header = 5; + * + * @return The bytes for otherHeader. + */ + @java.lang.Override + public com.google.protobuf.ByteString getOtherHeaderBytes() { + java.lang.Object ref = otherHeader_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + otherHeader_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int REQUEST_ID_FIELD_NUMBER = 7; + + @SuppressWarnings("serial") + private volatile java.lang.Object requestId_ = ""; + + /** + * + * + *
        +   * To facilitate testing of https://google.aip.dev/client-libraries/4235
        +   * 
        + * + * string request_id = 7 [(.google.api.field_info) = { ... } + * + * @return The requestId. + */ + @java.lang.Override + public java.lang.String getRequestId() { + java.lang.Object ref = requestId_; + 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(); + requestId_ = s; + return s; + } + } + + /** + * + * + *
        +   * To facilitate testing of https://google.aip.dev/client-libraries/4235
        +   * 
        + * + * string request_id = 7 [(.google.api.field_info) = { ... } + * + * @return The bytes for requestId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getRequestIdBytes() { + java.lang.Object ref = requestId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + requestId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int OTHER_REQUEST_ID_FIELD_NUMBER = 8; + + @SuppressWarnings("serial") + private volatile java.lang.Object otherRequestId_ = ""; + + /** + * + * + *
        +   * To facilitate testing of https://google.aip.dev/client-libraries/4235
        +   * 
        + * + * optional string other_request_id = 8 [(.google.api.field_info) = { ... } + * + * @return Whether the otherRequestId field is set. + */ + @java.lang.Override + public boolean hasOtherRequestId() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
        +   * To facilitate testing of https://google.aip.dev/client-libraries/4235
        +   * 
        + * + * optional string other_request_id = 8 [(.google.api.field_info) = { ... } + * + * @return The otherRequestId. + */ + @java.lang.Override + public java.lang.String getOtherRequestId() { + java.lang.Object ref = otherRequestId_; + 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(); + otherRequestId_ = s; + return s; + } + } + + /** + * + * + *
        +   * To facilitate testing of https://google.aip.dev/client-libraries/4235
        +   * 
        + * + * optional string other_request_id = 8 [(.google.api.field_info) = { ... } + * + * @return The bytes for otherRequestId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getOtherRequestIdBytes() { + java.lang.Object ref = otherRequestId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + otherRequestId_ = 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 (responseCase_ == 1) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, response_); + } + if (responseCase_ == 2) { + output.writeMessage(2, (com.google.rpc.Status) response_); + } + if (severity_ != com.google.showcase.v1beta1.Severity.UNNECESSARY.getNumber()) { + output.writeEnum(3, severity_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(header_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 4, header_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(otherHeader_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 5, otherHeader_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(requestId_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 7, requestId_); + } + if (((bitField0_ & 0x00000001) != 0)) { + com.google.protobuf.GeneratedMessage.writeString(output, 8, otherRequestId_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (responseCase_ == 1) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, response_); + } + if (responseCase_ == 2) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 2, (com.google.rpc.Status) response_); + } + if (severity_ != com.google.showcase.v1beta1.Severity.UNNECESSARY.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(3, severity_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(header_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(4, header_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(otherHeader_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(5, otherHeader_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(requestId_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(7, requestId_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(8, otherRequestId_); + } + 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.showcase.v1beta1.EchoRequest)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.EchoRequest other = (com.google.showcase.v1beta1.EchoRequest) obj; + + if (severity_ != other.severity_) return false; + if (!getHeader().equals(other.getHeader())) return false; + if (!getOtherHeader().equals(other.getOtherHeader())) return false; + if (!getRequestId().equals(other.getRequestId())) return false; + if (hasOtherRequestId() != other.hasOtherRequestId()) return false; + if (hasOtherRequestId()) { + if (!getOtherRequestId().equals(other.getOtherRequestId())) return false; + } + if (!getResponseCase().equals(other.getResponseCase())) return false; + switch (responseCase_) { + case 1: + if (!getContent().equals(other.getContent())) return false; + break; + case 2: + if (!getError().equals(other.getError())) 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) + SEVERITY_FIELD_NUMBER; + hash = (53 * hash) + severity_; + hash = (37 * hash) + HEADER_FIELD_NUMBER; + hash = (53 * hash) + getHeader().hashCode(); + hash = (37 * hash) + OTHER_HEADER_FIELD_NUMBER; + hash = (53 * hash) + getOtherHeader().hashCode(); + hash = (37 * hash) + REQUEST_ID_FIELD_NUMBER; + hash = (53 * hash) + getRequestId().hashCode(); + if (hasOtherRequestId()) { + hash = (37 * hash) + OTHER_REQUEST_ID_FIELD_NUMBER; + hash = (53 * hash) + getOtherRequestId().hashCode(); + } + switch (responseCase_) { + case 1: + hash = (37 * hash) + CONTENT_FIELD_NUMBER; + hash = (53 * hash) + getContent().hashCode(); + break; + case 2: + hash = (37 * hash) + ERROR_FIELD_NUMBER; + hash = (53 * hash) + getError().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.showcase.v1beta1.EchoRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.EchoRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.EchoRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.EchoRequest 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.showcase.v1beta1.EchoRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.EchoRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.EchoRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.EchoRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.showcase.v1beta1.EchoRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.EchoRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.showcase.v1beta1.EchoRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.EchoRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.showcase.v1beta1.EchoRequest 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
        +   * The request message used for the Echo, Collect and Chat methods.
        +   * If content or opt are set in this message then the request will succeed.
        +   * If status is set in this message then the status will be returned as an
        +   * error.
        +   * 
        + * + * Protobuf type {@code google.showcase.v1beta1.EchoRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.EchoRequest) + com.google.showcase.v1beta1.EchoRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.EchoOuterClass + .internal_static_google_showcase_v1beta1_EchoRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.EchoOuterClass + .internal_static_google_showcase_v1beta1_EchoRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.EchoRequest.class, + com.google.showcase.v1beta1.EchoRequest.Builder.class); + } + + // Construct using com.google.showcase.v1beta1.EchoRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (errorBuilder_ != null) { + errorBuilder_.clear(); + } + severity_ = 0; + header_ = ""; + otherHeader_ = ""; + requestId_ = ""; + otherRequestId_ = ""; + responseCase_ = 0; + response_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.showcase.v1beta1.EchoOuterClass + .internal_static_google_showcase_v1beta1_EchoRequest_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.EchoRequest getDefaultInstanceForType() { + return com.google.showcase.v1beta1.EchoRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.EchoRequest build() { + com.google.showcase.v1beta1.EchoRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.EchoRequest buildPartial() { + com.google.showcase.v1beta1.EchoRequest result = + new com.google.showcase.v1beta1.EchoRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + buildPartialOneofs(result); + onBuilt(); + return result; + } + + private void buildPartial0(com.google.showcase.v1beta1.EchoRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000004) != 0)) { + result.severity_ = severity_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.header_ = header_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.otherHeader_ = otherHeader_; + } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.requestId_ = requestId_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000040) != 0)) { + result.otherRequestId_ = otherRequestId_; + to_bitField0_ |= 0x00000001; + } + result.bitField0_ |= to_bitField0_; + } + + private void buildPartialOneofs(com.google.showcase.v1beta1.EchoRequest result) { + result.responseCase_ = responseCase_; + result.response_ = this.response_; + if (responseCase_ == 2 && errorBuilder_ != null) { + result.response_ = errorBuilder_.build(); + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.showcase.v1beta1.EchoRequest) { + return mergeFrom((com.google.showcase.v1beta1.EchoRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.showcase.v1beta1.EchoRequest other) { + if (other == com.google.showcase.v1beta1.EchoRequest.getDefaultInstance()) return this; + if (other.severity_ != 0) { + setSeverityValue(other.getSeverityValue()); + } + if (!other.getHeader().isEmpty()) { + header_ = other.header_; + bitField0_ |= 0x00000008; + onChanged(); + } + if (!other.getOtherHeader().isEmpty()) { + otherHeader_ = other.otherHeader_; + bitField0_ |= 0x00000010; + onChanged(); + } + if (!other.getRequestId().isEmpty()) { + requestId_ = other.requestId_; + bitField0_ |= 0x00000020; + onChanged(); + } + if (other.hasOtherRequestId()) { + otherRequestId_ = other.otherRequestId_; + bitField0_ |= 0x00000040; + onChanged(); + } + switch (other.getResponseCase()) { + case CONTENT: + { + responseCase_ = 1; + response_ = other.response_; + onChanged(); + break; + } + case ERROR: + { + mergeError(other.getError()); + break; + } + case RESPONSE_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: + { + java.lang.String s = input.readStringRequireUtf8(); + responseCase_ = 1; + response_ = s; + break; + } // case 10 + case 18: + { + input.readMessage(internalGetErrorFieldBuilder().getBuilder(), extensionRegistry); + responseCase_ = 2; + break; + } // case 18 + case 24: + { + severity_ = input.readEnum(); + bitField0_ |= 0x00000004; + break; + } // case 24 + case 34: + { + header_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000008; + break; + } // case 34 + case 42: + { + otherHeader_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000010; + break; + } // case 42 + case 58: + { + requestId_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000020; + break; + } // case 58 + case 66: + { + otherRequestId_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000040; + 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 responseCase_ = 0; + private java.lang.Object response_; + + public ResponseCase getResponseCase() { + return ResponseCase.forNumber(responseCase_); + } + + public Builder clearResponse() { + responseCase_ = 0; + response_ = null; + onChanged(); + return this; + } + + private int bitField0_; + + /** + * + * + *
        +     * The content to be echoed by the server.
        +     * 
        + * + * string content = 1; + * + * @return Whether the content field is set. + */ + @java.lang.Override + public boolean hasContent() { + return responseCase_ == 1; + } + + /** + * + * + *
        +     * The content to be echoed by the server.
        +     * 
        + * + * string content = 1; + * + * @return The content. + */ + @java.lang.Override + public java.lang.String getContent() { + java.lang.Object ref = ""; + if (responseCase_ == 1) { + ref = response_; + } + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (responseCase_ == 1) { + response_ = s; + } + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
        +     * The content to be echoed by the server.
        +     * 
        + * + * string content = 1; + * + * @return The bytes for content. + */ + @java.lang.Override + public com.google.protobuf.ByteString getContentBytes() { + java.lang.Object ref = ""; + if (responseCase_ == 1) { + ref = response_; + } + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + if (responseCase_ == 1) { + response_ = b; + } + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
        +     * The content to be echoed by the server.
        +     * 
        + * + * string content = 1; + * + * @param value The content to set. + * @return This builder for chaining. + */ + public Builder setContent(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + responseCase_ = 1; + response_ = value; + onChanged(); + return this; + } + + /** + * + * + *
        +     * The content to be echoed by the server.
        +     * 
        + * + * string content = 1; + * + * @return This builder for chaining. + */ + public Builder clearContent() { + if (responseCase_ == 1) { + responseCase_ = 0; + response_ = null; + onChanged(); + } + return this; + } + + /** + * + * + *
        +     * The content to be echoed by the server.
        +     * 
        + * + * string content = 1; + * + * @param value The bytes for content to set. + * @return This builder for chaining. + */ + public Builder setContentBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + responseCase_ = 1; + response_ = value; + onChanged(); + return this; + } + + private com.google.protobuf.SingleFieldBuilder< + com.google.rpc.Status, com.google.rpc.Status.Builder, com.google.rpc.StatusOrBuilder> + errorBuilder_; + + /** + * + * + *
        +     * The error to be thrown by the server.
        +     * 
        + * + * .google.rpc.Status error = 2; + * + * @return Whether the error field is set. + */ + @java.lang.Override + public boolean hasError() { + return responseCase_ == 2; + } + + /** + * + * + *
        +     * The error to be thrown by the server.
        +     * 
        + * + * .google.rpc.Status error = 2; + * + * @return The error. + */ + @java.lang.Override + public com.google.rpc.Status getError() { + if (errorBuilder_ == null) { + if (responseCase_ == 2) { + return (com.google.rpc.Status) response_; + } + return com.google.rpc.Status.getDefaultInstance(); + } else { + if (responseCase_ == 2) { + return errorBuilder_.getMessage(); + } + return com.google.rpc.Status.getDefaultInstance(); + } + } + + /** + * + * + *
        +     * The error to be thrown by the server.
        +     * 
        + * + * .google.rpc.Status error = 2; + */ + public Builder setError(com.google.rpc.Status value) { + if (errorBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + response_ = value; + onChanged(); + } else { + errorBuilder_.setMessage(value); + } + responseCase_ = 2; + return this; + } + + /** + * + * + *
        +     * The error to be thrown by the server.
        +     * 
        + * + * .google.rpc.Status error = 2; + */ + public Builder setError(com.google.rpc.Status.Builder builderForValue) { + if (errorBuilder_ == null) { + response_ = builderForValue.build(); + onChanged(); + } else { + errorBuilder_.setMessage(builderForValue.build()); + } + responseCase_ = 2; + return this; + } + + /** + * + * + *
        +     * The error to be thrown by the server.
        +     * 
        + * + * .google.rpc.Status error = 2; + */ + public Builder mergeError(com.google.rpc.Status value) { + if (errorBuilder_ == null) { + if (responseCase_ == 2 && response_ != com.google.rpc.Status.getDefaultInstance()) { + response_ = + com.google.rpc.Status.newBuilder((com.google.rpc.Status) response_) + .mergeFrom(value) + .buildPartial(); + } else { + response_ = value; + } + onChanged(); + } else { + if (responseCase_ == 2) { + errorBuilder_.mergeFrom(value); + } else { + errorBuilder_.setMessage(value); + } + } + responseCase_ = 2; + return this; + } + + /** + * + * + *
        +     * The error to be thrown by the server.
        +     * 
        + * + * .google.rpc.Status error = 2; + */ + public Builder clearError() { + if (errorBuilder_ == null) { + if (responseCase_ == 2) { + responseCase_ = 0; + response_ = null; + onChanged(); + } + } else { + if (responseCase_ == 2) { + responseCase_ = 0; + response_ = null; + } + errorBuilder_.clear(); + } + return this; + } + + /** + * + * + *
        +     * The error to be thrown by the server.
        +     * 
        + * + * .google.rpc.Status error = 2; + */ + public com.google.rpc.Status.Builder getErrorBuilder() { + return internalGetErrorFieldBuilder().getBuilder(); + } + + /** + * + * + *
        +     * The error to be thrown by the server.
        +     * 
        + * + * .google.rpc.Status error = 2; + */ + @java.lang.Override + public com.google.rpc.StatusOrBuilder getErrorOrBuilder() { + if ((responseCase_ == 2) && (errorBuilder_ != null)) { + return errorBuilder_.getMessageOrBuilder(); + } else { + if (responseCase_ == 2) { + return (com.google.rpc.Status) response_; + } + return com.google.rpc.Status.getDefaultInstance(); + } + } + + /** + * + * + *
        +     * The error to be thrown by the server.
        +     * 
        + * + * .google.rpc.Status error = 2; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.rpc.Status, com.google.rpc.Status.Builder, com.google.rpc.StatusOrBuilder> + internalGetErrorFieldBuilder() { + if (errorBuilder_ == null) { + if (!(responseCase_ == 2)) { + response_ = com.google.rpc.Status.getDefaultInstance(); + } + errorBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.rpc.Status, + com.google.rpc.Status.Builder, + com.google.rpc.StatusOrBuilder>( + (com.google.rpc.Status) response_, getParentForChildren(), isClean()); + response_ = null; + } + responseCase_ = 2; + onChanged(); + return errorBuilder_; + } + + private int severity_ = 0; + + /** + * + * + *
        +     * The severity to be echoed by the server.
        +     * 
        + * + * .google.showcase.v1beta1.Severity severity = 3; + * + * @return The enum numeric value on the wire for severity. + */ + @java.lang.Override + public int getSeverityValue() { + return severity_; + } + + /** + * + * + *
        +     * The severity to be echoed by the server.
        +     * 
        + * + * .google.showcase.v1beta1.Severity severity = 3; + * + * @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_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
        +     * The severity to be echoed by the server.
        +     * 
        + * + * .google.showcase.v1beta1.Severity severity = 3; + * + * @return The severity. + */ + @java.lang.Override + public com.google.showcase.v1beta1.Severity getSeverity() { + com.google.showcase.v1beta1.Severity result = + com.google.showcase.v1beta1.Severity.forNumber(severity_); + return result == null ? com.google.showcase.v1beta1.Severity.UNRECOGNIZED : result; + } + + /** + * + * + *
        +     * The severity to be echoed by the server.
        +     * 
        + * + * .google.showcase.v1beta1.Severity severity = 3; + * + * @param value The severity to set. + * @return This builder for chaining. + */ + public Builder setSeverity(com.google.showcase.v1beta1.Severity value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000004; + severity_ = value.getNumber(); + onChanged(); + return this; + } + + /** + * + * + *
        +     * The severity to be echoed by the server.
        +     * 
        + * + * .google.showcase.v1beta1.Severity severity = 3; + * + * @return This builder for chaining. + */ + public Builder clearSeverity() { + bitField0_ = (bitField0_ & ~0x00000004); + severity_ = 0; + onChanged(); + return this; + } + + private java.lang.Object header_ = ""; + + /** + * + * + *
        +     * Optional. This field can be set to test the routing annotation on the Echo method.
        +     * 
        + * + * string header = 4; + * + * @return The header. + */ + public java.lang.String getHeader() { + java.lang.Object ref = header_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + header_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
        +     * Optional. This field can be set to test the routing annotation on the Echo method.
        +     * 
        + * + * string header = 4; + * + * @return The bytes for header. + */ + public com.google.protobuf.ByteString getHeaderBytes() { + java.lang.Object ref = header_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + header_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
        +     * Optional. This field can be set to test the routing annotation on the Echo method.
        +     * 
        + * + * string header = 4; + * + * @param value The header to set. + * @return This builder for chaining. + */ + public Builder setHeader(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + header_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + /** + * + * + *
        +     * Optional. This field can be set to test the routing annotation on the Echo method.
        +     * 
        + * + * string header = 4; + * + * @return This builder for chaining. + */ + public Builder clearHeader() { + header_ = getDefaultInstance().getHeader(); + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + return this; + } + + /** + * + * + *
        +     * Optional. This field can be set to test the routing annotation on the Echo method.
        +     * 
        + * + * string header = 4; + * + * @param value The bytes for header to set. + * @return This builder for chaining. + */ + public Builder setHeaderBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + header_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + private java.lang.Object otherHeader_ = ""; + + /** + * + * + *
        +     * Optional. This field can be set to test the routing annotation on the Echo method.
        +     * 
        + * + * string other_header = 5; + * + * @return The otherHeader. + */ + public java.lang.String getOtherHeader() { + java.lang.Object ref = otherHeader_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + otherHeader_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
        +     * Optional. This field can be set to test the routing annotation on the Echo method.
        +     * 
        + * + * string other_header = 5; + * + * @return The bytes for otherHeader. + */ + public com.google.protobuf.ByteString getOtherHeaderBytes() { + java.lang.Object ref = otherHeader_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + otherHeader_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
        +     * Optional. This field can be set to test the routing annotation on the Echo method.
        +     * 
        + * + * string other_header = 5; + * + * @param value The otherHeader to set. + * @return This builder for chaining. + */ + public Builder setOtherHeader(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + otherHeader_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + /** + * + * + *
        +     * Optional. This field can be set to test the routing annotation on the Echo method.
        +     * 
        + * + * string other_header = 5; + * + * @return This builder for chaining. + */ + public Builder clearOtherHeader() { + otherHeader_ = getDefaultInstance().getOtherHeader(); + bitField0_ = (bitField0_ & ~0x00000010); + onChanged(); + return this; + } + + /** + * + * + *
        +     * Optional. This field can be set to test the routing annotation on the Echo method.
        +     * 
        + * + * string other_header = 5; + * + * @param value The bytes for otherHeader to set. + * @return This builder for chaining. + */ + public Builder setOtherHeaderBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + otherHeader_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + private java.lang.Object requestId_ = ""; + + /** + * + * + *
        +     * To facilitate testing of https://google.aip.dev/client-libraries/4235
        +     * 
        + * + * string request_id = 7 [(.google.api.field_info) = { ... } + * + * @return The requestId. + */ + public java.lang.String getRequestId() { + java.lang.Object ref = requestId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + requestId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
        +     * To facilitate testing of https://google.aip.dev/client-libraries/4235
        +     * 
        + * + * string request_id = 7 [(.google.api.field_info) = { ... } + * + * @return The bytes for requestId. + */ + public com.google.protobuf.ByteString getRequestIdBytes() { + java.lang.Object ref = requestId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + requestId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
        +     * To facilitate testing of https://google.aip.dev/client-libraries/4235
        +     * 
        + * + * string request_id = 7 [(.google.api.field_info) = { ... } + * + * @param value The requestId to set. + * @return This builder for chaining. + */ + public Builder setRequestId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + requestId_ = value; + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + + /** + * + * + *
        +     * To facilitate testing of https://google.aip.dev/client-libraries/4235
        +     * 
        + * + * string request_id = 7 [(.google.api.field_info) = { ... } + * + * @return This builder for chaining. + */ + public Builder clearRequestId() { + requestId_ = getDefaultInstance().getRequestId(); + bitField0_ = (bitField0_ & ~0x00000020); + onChanged(); + return this; + } + + /** + * + * + *
        +     * To facilitate testing of https://google.aip.dev/client-libraries/4235
        +     * 
        + * + * string request_id = 7 [(.google.api.field_info) = { ... } + * + * @param value The bytes for requestId to set. + * @return This builder for chaining. + */ + public Builder setRequestIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + requestId_ = value; + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + + private java.lang.Object otherRequestId_ = ""; + + /** + * + * + *
        +     * To facilitate testing of https://google.aip.dev/client-libraries/4235
        +     * 
        + * + * optional string other_request_id = 8 [(.google.api.field_info) = { ... } + * + * @return Whether the otherRequestId field is set. + */ + public boolean hasOtherRequestId() { + return ((bitField0_ & 0x00000040) != 0); + } + + /** + * + * + *
        +     * To facilitate testing of https://google.aip.dev/client-libraries/4235
        +     * 
        + * + * optional string other_request_id = 8 [(.google.api.field_info) = { ... } + * + * @return The otherRequestId. + */ + public java.lang.String getOtherRequestId() { + java.lang.Object ref = otherRequestId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + otherRequestId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
        +     * To facilitate testing of https://google.aip.dev/client-libraries/4235
        +     * 
        + * + * optional string other_request_id = 8 [(.google.api.field_info) = { ... } + * + * @return The bytes for otherRequestId. + */ + public com.google.protobuf.ByteString getOtherRequestIdBytes() { + java.lang.Object ref = otherRequestId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + otherRequestId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
        +     * To facilitate testing of https://google.aip.dev/client-libraries/4235
        +     * 
        + * + * optional string other_request_id = 8 [(.google.api.field_info) = { ... } + * + * @param value The otherRequestId to set. + * @return This builder for chaining. + */ + public Builder setOtherRequestId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + otherRequestId_ = value; + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + + /** + * + * + *
        +     * To facilitate testing of https://google.aip.dev/client-libraries/4235
        +     * 
        + * + * optional string other_request_id = 8 [(.google.api.field_info) = { ... } + * + * @return This builder for chaining. + */ + public Builder clearOtherRequestId() { + otherRequestId_ = getDefaultInstance().getOtherRequestId(); + bitField0_ = (bitField0_ & ~0x00000040); + onChanged(); + return this; + } + + /** + * + * + *
        +     * To facilitate testing of https://google.aip.dev/client-libraries/4235
        +     * 
        + * + * optional string other_request_id = 8 [(.google.api.field_info) = { ... } + * + * @param value The bytes for otherRequestId to set. + * @return This builder for chaining. + */ + public Builder setOtherRequestIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + otherRequestId_ = value; + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.showcase.v1beta1.EchoRequest) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.EchoRequest) + private static final com.google.showcase.v1beta1.EchoRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.EchoRequest(); + } + + public static com.google.showcase.v1beta1.EchoRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public EchoRequest 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.showcase.v1beta1.EchoRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/EchoRequestOrBuilder.java b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/EchoRequestOrBuilder.java new file mode 100644 index 0000000000..c8c45d36b9 --- /dev/null +++ b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/EchoRequestOrBuilder.java @@ -0,0 +1,249 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: schema/google/showcase/v1beta1/echo.proto +// Protobuf Java Version: 4.33.2 + +package com.google.showcase.v1beta1; + +@com.google.protobuf.Generated +public interface EchoRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.EchoRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
        +   * The content to be echoed by the server.
        +   * 
        + * + * string content = 1; + * + * @return Whether the content field is set. + */ + boolean hasContent(); + + /** + * + * + *
        +   * The content to be echoed by the server.
        +   * 
        + * + * string content = 1; + * + * @return The content. + */ + java.lang.String getContent(); + + /** + * + * + *
        +   * The content to be echoed by the server.
        +   * 
        + * + * string content = 1; + * + * @return The bytes for content. + */ + com.google.protobuf.ByteString getContentBytes(); + + /** + * + * + *
        +   * The error to be thrown by the server.
        +   * 
        + * + * .google.rpc.Status error = 2; + * + * @return Whether the error field is set. + */ + boolean hasError(); + + /** + * + * + *
        +   * The error to be thrown by the server.
        +   * 
        + * + * .google.rpc.Status error = 2; + * + * @return The error. + */ + com.google.rpc.Status getError(); + + /** + * + * + *
        +   * The error to be thrown by the server.
        +   * 
        + * + * .google.rpc.Status error = 2; + */ + com.google.rpc.StatusOrBuilder getErrorOrBuilder(); + + /** + * + * + *
        +   * The severity to be echoed by the server.
        +   * 
        + * + * .google.showcase.v1beta1.Severity severity = 3; + * + * @return The enum numeric value on the wire for severity. + */ + int getSeverityValue(); + + /** + * + * + *
        +   * The severity to be echoed by the server.
        +   * 
        + * + * .google.showcase.v1beta1.Severity severity = 3; + * + * @return The severity. + */ + com.google.showcase.v1beta1.Severity getSeverity(); + + /** + * + * + *
        +   * Optional. This field can be set to test the routing annotation on the Echo method.
        +   * 
        + * + * string header = 4; + * + * @return The header. + */ + java.lang.String getHeader(); + + /** + * + * + *
        +   * Optional. This field can be set to test the routing annotation on the Echo method.
        +   * 
        + * + * string header = 4; + * + * @return The bytes for header. + */ + com.google.protobuf.ByteString getHeaderBytes(); + + /** + * + * + *
        +   * Optional. This field can be set to test the routing annotation on the Echo method.
        +   * 
        + * + * string other_header = 5; + * + * @return The otherHeader. + */ + java.lang.String getOtherHeader(); + + /** + * + * + *
        +   * Optional. This field can be set to test the routing annotation on the Echo method.
        +   * 
        + * + * string other_header = 5; + * + * @return The bytes for otherHeader. + */ + com.google.protobuf.ByteString getOtherHeaderBytes(); + + /** + * + * + *
        +   * To facilitate testing of https://google.aip.dev/client-libraries/4235
        +   * 
        + * + * string request_id = 7 [(.google.api.field_info) = { ... } + * + * @return The requestId. + */ + java.lang.String getRequestId(); + + /** + * + * + *
        +   * To facilitate testing of https://google.aip.dev/client-libraries/4235
        +   * 
        + * + * string request_id = 7 [(.google.api.field_info) = { ... } + * + * @return The bytes for requestId. + */ + com.google.protobuf.ByteString getRequestIdBytes(); + + /** + * + * + *
        +   * To facilitate testing of https://google.aip.dev/client-libraries/4235
        +   * 
        + * + * optional string other_request_id = 8 [(.google.api.field_info) = { ... } + * + * @return Whether the otherRequestId field is set. + */ + boolean hasOtherRequestId(); + + /** + * + * + *
        +   * To facilitate testing of https://google.aip.dev/client-libraries/4235
        +   * 
        + * + * optional string other_request_id = 8 [(.google.api.field_info) = { ... } + * + * @return The otherRequestId. + */ + java.lang.String getOtherRequestId(); + + /** + * + * + *
        +   * To facilitate testing of https://google.aip.dev/client-libraries/4235
        +   * 
        + * + * optional string other_request_id = 8 [(.google.api.field_info) = { ... } + * + * @return The bytes for otherRequestId. + */ + com.google.protobuf.ByteString getOtherRequestIdBytes(); + + com.google.showcase.v1beta1.EchoRequest.ResponseCase getResponseCase(); +} diff --git a/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/EchoResponse.java b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/EchoResponse.java new file mode 100644 index 0000000000..adbb2e74d8 --- /dev/null +++ b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/EchoResponse.java @@ -0,0 +1,1127 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: schema/google/showcase/v1beta1/echo.proto +// Protobuf Java Version: 4.33.2 + +package com.google.showcase.v1beta1; + +/** + * + * + *
        + * The response message for the Echo methods.
        + * 
        + * + * Protobuf type {@code google.showcase.v1beta1.EchoResponse} + */ +@com.google.protobuf.Generated +public final class EchoResponse extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.EchoResponse) + EchoResponseOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "EchoResponse"); + } + + // Use EchoResponse.newBuilder() to construct. + private EchoResponse(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private EchoResponse() { + content_ = ""; + severity_ = 0; + requestId_ = ""; + otherRequestId_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.EchoOuterClass + .internal_static_google_showcase_v1beta1_EchoResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.EchoOuterClass + .internal_static_google_showcase_v1beta1_EchoResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.EchoResponse.class, + com.google.showcase.v1beta1.EchoResponse.Builder.class); + } + + public static final int CONTENT_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object content_ = ""; + + /** + * + * + *
        +   * The content specified in the request.
        +   * 
        + * + * string content = 1; + * + * @return The content. + */ + @java.lang.Override + public java.lang.String getContent() { + java.lang.Object ref = content_; + 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(); + content_ = s; + return s; + } + } + + /** + * + * + *
        +   * The content specified in the request.
        +   * 
        + * + * string content = 1; + * + * @return The bytes for content. + */ + @java.lang.Override + public com.google.protobuf.ByteString getContentBytes() { + java.lang.Object ref = content_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + content_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int SEVERITY_FIELD_NUMBER = 2; + private int severity_ = 0; + + /** + * + * + *
        +   * The severity specified in the request.
        +   * 
        + * + * .google.showcase.v1beta1.Severity severity = 2; + * + * @return The enum numeric value on the wire for severity. + */ + @java.lang.Override + public int getSeverityValue() { + return severity_; + } + + /** + * + * + *
        +   * The severity specified in the request.
        +   * 
        + * + * .google.showcase.v1beta1.Severity severity = 2; + * + * @return The severity. + */ + @java.lang.Override + public com.google.showcase.v1beta1.Severity getSeverity() { + com.google.showcase.v1beta1.Severity result = + com.google.showcase.v1beta1.Severity.forNumber(severity_); + return result == null ? com.google.showcase.v1beta1.Severity.UNRECOGNIZED : result; + } + + public static final int REQUEST_ID_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object requestId_ = ""; + + /** + * + * + *
        +   * The request ID specified or autopopulated in the request.
        +   * 
        + * + * string request_id = 3; + * + * @return The requestId. + */ + @java.lang.Override + public java.lang.String getRequestId() { + java.lang.Object ref = requestId_; + 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(); + requestId_ = s; + return s; + } + } + + /** + * + * + *
        +   * The request ID specified or autopopulated in the request.
        +   * 
        + * + * string request_id = 3; + * + * @return The bytes for requestId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getRequestIdBytes() { + java.lang.Object ref = requestId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + requestId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int OTHER_REQUEST_ID_FIELD_NUMBER = 4; + + @SuppressWarnings("serial") + private volatile java.lang.Object otherRequestId_ = ""; + + /** + * + * + *
        +   * The other request ID specified or autopopulated in the request.
        +   * 
        + * + * string other_request_id = 4; + * + * @return The otherRequestId. + */ + @java.lang.Override + public java.lang.String getOtherRequestId() { + java.lang.Object ref = otherRequestId_; + 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(); + otherRequestId_ = s; + return s; + } + } + + /** + * + * + *
        +   * The other request ID specified or autopopulated in the request.
        +   * 
        + * + * string other_request_id = 4; + * + * @return The bytes for otherRequestId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getOtherRequestIdBytes() { + java.lang.Object ref = otherRequestId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + otherRequestId_ = 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.GeneratedMessage.isStringEmpty(content_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, content_); + } + if (severity_ != com.google.showcase.v1beta1.Severity.UNNECESSARY.getNumber()) { + output.writeEnum(2, severity_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(requestId_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 3, requestId_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(otherRequestId_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 4, otherRequestId_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(content_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, content_); + } + if (severity_ != com.google.showcase.v1beta1.Severity.UNNECESSARY.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(2, severity_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(requestId_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(3, requestId_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(otherRequestId_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(4, otherRequestId_); + } + 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.showcase.v1beta1.EchoResponse)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.EchoResponse other = (com.google.showcase.v1beta1.EchoResponse) obj; + + if (!getContent().equals(other.getContent())) return false; + if (severity_ != other.severity_) return false; + if (!getRequestId().equals(other.getRequestId())) return false; + if (!getOtherRequestId().equals(other.getOtherRequestId())) 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) + CONTENT_FIELD_NUMBER; + hash = (53 * hash) + getContent().hashCode(); + hash = (37 * hash) + SEVERITY_FIELD_NUMBER; + hash = (53 * hash) + severity_; + hash = (37 * hash) + REQUEST_ID_FIELD_NUMBER; + hash = (53 * hash) + getRequestId().hashCode(); + hash = (37 * hash) + OTHER_REQUEST_ID_FIELD_NUMBER; + hash = (53 * hash) + getOtherRequestId().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.showcase.v1beta1.EchoResponse parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.EchoResponse parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.EchoResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.EchoResponse 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.showcase.v1beta1.EchoResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.EchoResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.EchoResponse parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.EchoResponse parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.showcase.v1beta1.EchoResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.EchoResponse parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.showcase.v1beta1.EchoResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.EchoResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.showcase.v1beta1.EchoResponse 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
        +   * The response message for the Echo methods.
        +   * 
        + * + * Protobuf type {@code google.showcase.v1beta1.EchoResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.EchoResponse) + com.google.showcase.v1beta1.EchoResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.EchoOuterClass + .internal_static_google_showcase_v1beta1_EchoResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.EchoOuterClass + .internal_static_google_showcase_v1beta1_EchoResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.EchoResponse.class, + com.google.showcase.v1beta1.EchoResponse.Builder.class); + } + + // Construct using com.google.showcase.v1beta1.EchoResponse.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + content_ = ""; + severity_ = 0; + requestId_ = ""; + otherRequestId_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.showcase.v1beta1.EchoOuterClass + .internal_static_google_showcase_v1beta1_EchoResponse_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.EchoResponse getDefaultInstanceForType() { + return com.google.showcase.v1beta1.EchoResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.EchoResponse build() { + com.google.showcase.v1beta1.EchoResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.EchoResponse buildPartial() { + com.google.showcase.v1beta1.EchoResponse result = + new com.google.showcase.v1beta1.EchoResponse(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.showcase.v1beta1.EchoResponse result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.content_ = content_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.severity_ = severity_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.requestId_ = requestId_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.otherRequestId_ = otherRequestId_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.showcase.v1beta1.EchoResponse) { + return mergeFrom((com.google.showcase.v1beta1.EchoResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.showcase.v1beta1.EchoResponse other) { + if (other == com.google.showcase.v1beta1.EchoResponse.getDefaultInstance()) return this; + if (!other.getContent().isEmpty()) { + content_ = other.content_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.severity_ != 0) { + setSeverityValue(other.getSeverityValue()); + } + if (!other.getRequestId().isEmpty()) { + requestId_ = other.requestId_; + bitField0_ |= 0x00000004; + onChanged(); + } + if (!other.getOtherRequestId().isEmpty()) { + otherRequestId_ = other.otherRequestId_; + 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: + { + content_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 16: + { + severity_ = input.readEnum(); + bitField0_ |= 0x00000002; + break; + } // case 16 + case 26: + { + requestId_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 34: + { + otherRequestId_ = input.readStringRequireUtf8(); + 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 content_ = ""; + + /** + * + * + *
        +     * The content specified in the request.
        +     * 
        + * + * string content = 1; + * + * @return The content. + */ + public java.lang.String getContent() { + java.lang.Object ref = content_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + content_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
        +     * The content specified in the request.
        +     * 
        + * + * string content = 1; + * + * @return The bytes for content. + */ + public com.google.protobuf.ByteString getContentBytes() { + java.lang.Object ref = content_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + content_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
        +     * The content specified in the request.
        +     * 
        + * + * string content = 1; + * + * @param value The content to set. + * @return This builder for chaining. + */ + public Builder setContent(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + content_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
        +     * The content specified in the request.
        +     * 
        + * + * string content = 1; + * + * @return This builder for chaining. + */ + public Builder clearContent() { + content_ = getDefaultInstance().getContent(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
        +     * The content specified in the request.
        +     * 
        + * + * string content = 1; + * + * @param value The bytes for content to set. + * @return This builder for chaining. + */ + public Builder setContentBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + content_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private int severity_ = 0; + + /** + * + * + *
        +     * The severity specified in the request.
        +     * 
        + * + * .google.showcase.v1beta1.Severity severity = 2; + * + * @return The enum numeric value on the wire for severity. + */ + @java.lang.Override + public int getSeverityValue() { + return severity_; + } + + /** + * + * + *
        +     * The severity specified in the request.
        +     * 
        + * + * .google.showcase.v1beta1.Severity severity = 2; + * + * @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_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
        +     * The severity specified in the request.
        +     * 
        + * + * .google.showcase.v1beta1.Severity severity = 2; + * + * @return The severity. + */ + @java.lang.Override + public com.google.showcase.v1beta1.Severity getSeverity() { + com.google.showcase.v1beta1.Severity result = + com.google.showcase.v1beta1.Severity.forNumber(severity_); + return result == null ? com.google.showcase.v1beta1.Severity.UNRECOGNIZED : result; + } + + /** + * + * + *
        +     * The severity specified in the request.
        +     * 
        + * + * .google.showcase.v1beta1.Severity severity = 2; + * + * @param value The severity to set. + * @return This builder for chaining. + */ + public Builder setSeverity(com.google.showcase.v1beta1.Severity value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000002; + severity_ = value.getNumber(); + onChanged(); + return this; + } + + /** + * + * + *
        +     * The severity specified in the request.
        +     * 
        + * + * .google.showcase.v1beta1.Severity severity = 2; + * + * @return This builder for chaining. + */ + public Builder clearSeverity() { + bitField0_ = (bitField0_ & ~0x00000002); + severity_ = 0; + onChanged(); + return this; + } + + private java.lang.Object requestId_ = ""; + + /** + * + * + *
        +     * The request ID specified or autopopulated in the request.
        +     * 
        + * + * string request_id = 3; + * + * @return The requestId. + */ + public java.lang.String getRequestId() { + java.lang.Object ref = requestId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + requestId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
        +     * The request ID specified or autopopulated in the request.
        +     * 
        + * + * string request_id = 3; + * + * @return The bytes for requestId. + */ + public com.google.protobuf.ByteString getRequestIdBytes() { + java.lang.Object ref = requestId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + requestId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
        +     * The request ID specified or autopopulated in the request.
        +     * 
        + * + * string request_id = 3; + * + * @param value The requestId to set. + * @return This builder for chaining. + */ + public Builder setRequestId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + requestId_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
        +     * The request ID specified or autopopulated in the request.
        +     * 
        + * + * string request_id = 3; + * + * @return This builder for chaining. + */ + public Builder clearRequestId() { + requestId_ = getDefaultInstance().getRequestId(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + + /** + * + * + *
        +     * The request ID specified or autopopulated in the request.
        +     * 
        + * + * string request_id = 3; + * + * @param value The bytes for requestId to set. + * @return This builder for chaining. + */ + public Builder setRequestIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + requestId_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + private java.lang.Object otherRequestId_ = ""; + + /** + * + * + *
        +     * The other request ID specified or autopopulated in the request.
        +     * 
        + * + * string other_request_id = 4; + * + * @return The otherRequestId. + */ + public java.lang.String getOtherRequestId() { + java.lang.Object ref = otherRequestId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + otherRequestId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
        +     * The other request ID specified or autopopulated in the request.
        +     * 
        + * + * string other_request_id = 4; + * + * @return The bytes for otherRequestId. + */ + public com.google.protobuf.ByteString getOtherRequestIdBytes() { + java.lang.Object ref = otherRequestId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + otherRequestId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
        +     * The other request ID specified or autopopulated in the request.
        +     * 
        + * + * string other_request_id = 4; + * + * @param value The otherRequestId to set. + * @return This builder for chaining. + */ + public Builder setOtherRequestId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + otherRequestId_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + /** + * + * + *
        +     * The other request ID specified or autopopulated in the request.
        +     * 
        + * + * string other_request_id = 4; + * + * @return This builder for chaining. + */ + public Builder clearOtherRequestId() { + otherRequestId_ = getDefaultInstance().getOtherRequestId(); + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + return this; + } + + /** + * + * + *
        +     * The other request ID specified or autopopulated in the request.
        +     * 
        + * + * string other_request_id = 4; + * + * @param value The bytes for otherRequestId to set. + * @return This builder for chaining. + */ + public Builder setOtherRequestIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + otherRequestId_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.showcase.v1beta1.EchoResponse) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.EchoResponse) + private static final com.google.showcase.v1beta1.EchoResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.EchoResponse(); + } + + public static com.google.showcase.v1beta1.EchoResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public EchoResponse 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.showcase.v1beta1.EchoResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/EchoResponseOrBuilder.java b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/EchoResponseOrBuilder.java new file mode 100644 index 0000000000..d1cb16b4c5 --- /dev/null +++ b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/EchoResponseOrBuilder.java @@ -0,0 +1,132 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: schema/google/showcase/v1beta1/echo.proto +// Protobuf Java Version: 4.33.2 + +package com.google.showcase.v1beta1; + +@com.google.protobuf.Generated +public interface EchoResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.EchoResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
        +   * The content specified in the request.
        +   * 
        + * + * string content = 1; + * + * @return The content. + */ + java.lang.String getContent(); + + /** + * + * + *
        +   * The content specified in the request.
        +   * 
        + * + * string content = 1; + * + * @return The bytes for content. + */ + com.google.protobuf.ByteString getContentBytes(); + + /** + * + * + *
        +   * The severity specified in the request.
        +   * 
        + * + * .google.showcase.v1beta1.Severity severity = 2; + * + * @return The enum numeric value on the wire for severity. + */ + int getSeverityValue(); + + /** + * + * + *
        +   * The severity specified in the request.
        +   * 
        + * + * .google.showcase.v1beta1.Severity severity = 2; + * + * @return The severity. + */ + com.google.showcase.v1beta1.Severity getSeverity(); + + /** + * + * + *
        +   * The request ID specified or autopopulated in the request.
        +   * 
        + * + * string request_id = 3; + * + * @return The requestId. + */ + java.lang.String getRequestId(); + + /** + * + * + *
        +   * The request ID specified or autopopulated in the request.
        +   * 
        + * + * string request_id = 3; + * + * @return The bytes for requestId. + */ + com.google.protobuf.ByteString getRequestIdBytes(); + + /** + * + * + *
        +   * The other request ID specified or autopopulated in the request.
        +   * 
        + * + * string other_request_id = 4; + * + * @return The otherRequestId. + */ + java.lang.String getOtherRequestId(); + + /** + * + * + *
        +   * The other request ID specified or autopopulated in the request.
        +   * 
        + * + * string other_request_id = 4; + * + * @return The bytes for otherRequestId. + */ + com.google.protobuf.ByteString getOtherRequestIdBytes(); +} diff --git a/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/EnumRequest.java b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/EnumRequest.java new file mode 100644 index 0000000000..20add57753 --- /dev/null +++ b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/EnumRequest.java @@ -0,0 +1,485 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: schema/google/showcase/v1beta1/compliance.proto +// Protobuf Java Version: 4.33.2 + +package com.google.showcase.v1beta1; + +/** Protobuf type {@code google.showcase.v1beta1.EnumRequest} */ +@com.google.protobuf.Generated +public final class EnumRequest extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.EnumRequest) + EnumRequestOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "EnumRequest"); + } + + // Use EnumRequest.newBuilder() to construct. + private EnumRequest(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private EnumRequest() {} + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.ComplianceOuterClass + .internal_static_google_showcase_v1beta1_EnumRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.ComplianceOuterClass + .internal_static_google_showcase_v1beta1_EnumRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.EnumRequest.class, + com.google.showcase.v1beta1.EnumRequest.Builder.class); + } + + public static final int UNKNOWN_ENUM_FIELD_NUMBER = 1; + private boolean unknownEnum_ = false; + + /** + * + * + *
        +   * Whether the client is requesting a new, unknown enum value or a known enum value already declared in this proto file.
        +   * 
        + * + * bool unknown_enum = 1; + * + * @return The unknownEnum. + */ + @java.lang.Override + public boolean getUnknownEnum() { + return unknownEnum_; + } + + 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 (unknownEnum_ != false) { + output.writeBool(1, unknownEnum_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (unknownEnum_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(1, unknownEnum_); + } + 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.showcase.v1beta1.EnumRequest)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.EnumRequest other = (com.google.showcase.v1beta1.EnumRequest) obj; + + if (getUnknownEnum() != other.getUnknownEnum()) 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) + UNKNOWN_ENUM_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getUnknownEnum()); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.showcase.v1beta1.EnumRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.EnumRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.EnumRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.EnumRequest 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.showcase.v1beta1.EnumRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.EnumRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.EnumRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.EnumRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.showcase.v1beta1.EnumRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.EnumRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.showcase.v1beta1.EnumRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.EnumRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.showcase.v1beta1.EnumRequest 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** Protobuf type {@code google.showcase.v1beta1.EnumRequest} */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.EnumRequest) + com.google.showcase.v1beta1.EnumRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.ComplianceOuterClass + .internal_static_google_showcase_v1beta1_EnumRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.ComplianceOuterClass + .internal_static_google_showcase_v1beta1_EnumRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.EnumRequest.class, + com.google.showcase.v1beta1.EnumRequest.Builder.class); + } + + // Construct using com.google.showcase.v1beta1.EnumRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + unknownEnum_ = false; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.showcase.v1beta1.ComplianceOuterClass + .internal_static_google_showcase_v1beta1_EnumRequest_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.EnumRequest getDefaultInstanceForType() { + return com.google.showcase.v1beta1.EnumRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.EnumRequest build() { + com.google.showcase.v1beta1.EnumRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.EnumRequest buildPartial() { + com.google.showcase.v1beta1.EnumRequest result = + new com.google.showcase.v1beta1.EnumRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.showcase.v1beta1.EnumRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.unknownEnum_ = unknownEnum_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.showcase.v1beta1.EnumRequest) { + return mergeFrom((com.google.showcase.v1beta1.EnumRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.showcase.v1beta1.EnumRequest other) { + if (other == com.google.showcase.v1beta1.EnumRequest.getDefaultInstance()) return this; + if (other.getUnknownEnum() != false) { + setUnknownEnum(other.getUnknownEnum()); + } + 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: + { + unknownEnum_ = 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 unknownEnum_; + + /** + * + * + *
        +     * Whether the client is requesting a new, unknown enum value or a known enum value already declared in this proto file.
        +     * 
        + * + * bool unknown_enum = 1; + * + * @return The unknownEnum. + */ + @java.lang.Override + public boolean getUnknownEnum() { + return unknownEnum_; + } + + /** + * + * + *
        +     * Whether the client is requesting a new, unknown enum value or a known enum value already declared in this proto file.
        +     * 
        + * + * bool unknown_enum = 1; + * + * @param value The unknownEnum to set. + * @return This builder for chaining. + */ + public Builder setUnknownEnum(boolean value) { + + unknownEnum_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
        +     * Whether the client is requesting a new, unknown enum value or a known enum value already declared in this proto file.
        +     * 
        + * + * bool unknown_enum = 1; + * + * @return This builder for chaining. + */ + public Builder clearUnknownEnum() { + bitField0_ = (bitField0_ & ~0x00000001); + unknownEnum_ = false; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.showcase.v1beta1.EnumRequest) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.EnumRequest) + private static final com.google.showcase.v1beta1.EnumRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.EnumRequest(); + } + + public static com.google.showcase.v1beta1.EnumRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public EnumRequest 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.showcase.v1beta1.EnumRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/EnumRequestOrBuilder.java b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/EnumRequestOrBuilder.java new file mode 100644 index 0000000000..f874fcb211 --- /dev/null +++ b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/EnumRequestOrBuilder.java @@ -0,0 +1,41 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: schema/google/showcase/v1beta1/compliance.proto +// Protobuf Java Version: 4.33.2 + +package com.google.showcase.v1beta1; + +@com.google.protobuf.Generated +public interface EnumRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.EnumRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
        +   * Whether the client is requesting a new, unknown enum value or a known enum value already declared in this proto file.
        +   * 
        + * + * bool unknown_enum = 1; + * + * @return The unknownEnum. + */ + boolean getUnknownEnum(); +} diff --git a/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/EnumResponse.java b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/EnumResponse.java new file mode 100644 index 0000000000..bfabe13ec3 --- /dev/null +++ b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/EnumResponse.java @@ -0,0 +1,835 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: schema/google/showcase/v1beta1/compliance.proto +// Protobuf Java Version: 4.33.2 + +package com.google.showcase.v1beta1; + +/** Protobuf type {@code google.showcase.v1beta1.EnumResponse} */ +@com.google.protobuf.Generated +public final class EnumResponse extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.EnumResponse) + EnumResponseOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "EnumResponse"); + } + + // Use EnumResponse.newBuilder() to construct. + private EnumResponse(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private EnumResponse() { + continent_ = 0; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.ComplianceOuterClass + .internal_static_google_showcase_v1beta1_EnumResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.ComplianceOuterClass + .internal_static_google_showcase_v1beta1_EnumResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.EnumResponse.class, + com.google.showcase.v1beta1.EnumResponse.Builder.class); + } + + private int bitField0_; + public static final int REQUEST_FIELD_NUMBER = 1; + private com.google.showcase.v1beta1.EnumRequest request_; + + /** + * + * + *
        +   * The original request for a known or unknown enum from the server.
        +   * 
        + * + * .google.showcase.v1beta1.EnumRequest request = 1; + * + * @return Whether the request field is set. + */ + @java.lang.Override + public boolean hasRequest() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
        +   * The original request for a known or unknown enum from the server.
        +   * 
        + * + * .google.showcase.v1beta1.EnumRequest request = 1; + * + * @return The request. + */ + @java.lang.Override + public com.google.showcase.v1beta1.EnumRequest getRequest() { + return request_ == null + ? com.google.showcase.v1beta1.EnumRequest.getDefaultInstance() + : request_; + } + + /** + * + * + *
        +   * The original request for a known or unknown enum from the server.
        +   * 
        + * + * .google.showcase.v1beta1.EnumRequest request = 1; + */ + @java.lang.Override + public com.google.showcase.v1beta1.EnumRequestOrBuilder getRequestOrBuilder() { + return request_ == null + ? com.google.showcase.v1beta1.EnumRequest.getDefaultInstance() + : request_; + } + + public static final int CONTINENT_FIELD_NUMBER = 2; + private int continent_ = 0; + + /** + * + * + *
        +   * The actual enum the server provided.
        +   * 
        + * + * .google.showcase.v1beta1.Continent continent = 2; + * + * @return The enum numeric value on the wire for continent. + */ + @java.lang.Override + public int getContinentValue() { + return continent_; + } + + /** + * + * + *
        +   * The actual enum the server provided.
        +   * 
        + * + * .google.showcase.v1beta1.Continent continent = 2; + * + * @return The continent. + */ + @java.lang.Override + public com.google.showcase.v1beta1.Continent getContinent() { + com.google.showcase.v1beta1.Continent result = + com.google.showcase.v1beta1.Continent.forNumber(continent_); + return result == null ? com.google.showcase.v1beta1.Continent.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 (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(1, getRequest()); + } + if (continent_ != com.google.showcase.v1beta1.Continent.CONTINENT_UNSPECIFIED.getNumber()) { + output.writeEnum(2, continent_); + } + 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, getRequest()); + } + if (continent_ != com.google.showcase.v1beta1.Continent.CONTINENT_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(2, continent_); + } + 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.showcase.v1beta1.EnumResponse)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.EnumResponse other = (com.google.showcase.v1beta1.EnumResponse) obj; + + if (hasRequest() != other.hasRequest()) return false; + if (hasRequest()) { + if (!getRequest().equals(other.getRequest())) return false; + } + if (continent_ != other.continent_) 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 (hasRequest()) { + hash = (37 * hash) + REQUEST_FIELD_NUMBER; + hash = (53 * hash) + getRequest().hashCode(); + } + hash = (37 * hash) + CONTINENT_FIELD_NUMBER; + hash = (53 * hash) + continent_; + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.showcase.v1beta1.EnumResponse parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.EnumResponse parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.EnumResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.EnumResponse 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.showcase.v1beta1.EnumResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.EnumResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.EnumResponse parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.EnumResponse parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.showcase.v1beta1.EnumResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.EnumResponse parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.showcase.v1beta1.EnumResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.EnumResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.showcase.v1beta1.EnumResponse 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** Protobuf type {@code google.showcase.v1beta1.EnumResponse} */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.EnumResponse) + com.google.showcase.v1beta1.EnumResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.ComplianceOuterClass + .internal_static_google_showcase_v1beta1_EnumResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.ComplianceOuterClass + .internal_static_google_showcase_v1beta1_EnumResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.EnumResponse.class, + com.google.showcase.v1beta1.EnumResponse.Builder.class); + } + + // Construct using com.google.showcase.v1beta1.EnumResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetRequestFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + request_ = null; + if (requestBuilder_ != null) { + requestBuilder_.dispose(); + requestBuilder_ = null; + } + continent_ = 0; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.showcase.v1beta1.ComplianceOuterClass + .internal_static_google_showcase_v1beta1_EnumResponse_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.EnumResponse getDefaultInstanceForType() { + return com.google.showcase.v1beta1.EnumResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.EnumResponse build() { + com.google.showcase.v1beta1.EnumResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.EnumResponse buildPartial() { + com.google.showcase.v1beta1.EnumResponse result = + new com.google.showcase.v1beta1.EnumResponse(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.showcase.v1beta1.EnumResponse result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.request_ = requestBuilder_ == null ? request_ : requestBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.continent_ = continent_; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.showcase.v1beta1.EnumResponse) { + return mergeFrom((com.google.showcase.v1beta1.EnumResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.showcase.v1beta1.EnumResponse other) { + if (other == com.google.showcase.v1beta1.EnumResponse.getDefaultInstance()) return this; + if (other.hasRequest()) { + mergeRequest(other.getRequest()); + } + if (other.continent_ != 0) { + setContinentValue(other.getContinentValue()); + } + 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(internalGetRequestFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 16: + { + continent_ = input.readEnum(); + 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 com.google.showcase.v1beta1.EnumRequest request_; + private com.google.protobuf.SingleFieldBuilder< + com.google.showcase.v1beta1.EnumRequest, + com.google.showcase.v1beta1.EnumRequest.Builder, + com.google.showcase.v1beta1.EnumRequestOrBuilder> + requestBuilder_; + + /** + * + * + *
        +     * The original request for a known or unknown enum from the server.
        +     * 
        + * + * .google.showcase.v1beta1.EnumRequest request = 1; + * + * @return Whether the request field is set. + */ + public boolean hasRequest() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
        +     * The original request for a known or unknown enum from the server.
        +     * 
        + * + * .google.showcase.v1beta1.EnumRequest request = 1; + * + * @return The request. + */ + public com.google.showcase.v1beta1.EnumRequest getRequest() { + if (requestBuilder_ == null) { + return request_ == null + ? com.google.showcase.v1beta1.EnumRequest.getDefaultInstance() + : request_; + } else { + return requestBuilder_.getMessage(); + } + } + + /** + * + * + *
        +     * The original request for a known or unknown enum from the server.
        +     * 
        + * + * .google.showcase.v1beta1.EnumRequest request = 1; + */ + public Builder setRequest(com.google.showcase.v1beta1.EnumRequest value) { + if (requestBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + request_ = value; + } else { + requestBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
        +     * The original request for a known or unknown enum from the server.
        +     * 
        + * + * .google.showcase.v1beta1.EnumRequest request = 1; + */ + public Builder setRequest(com.google.showcase.v1beta1.EnumRequest.Builder builderForValue) { + if (requestBuilder_ == null) { + request_ = builderForValue.build(); + } else { + requestBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
        +     * The original request for a known or unknown enum from the server.
        +     * 
        + * + * .google.showcase.v1beta1.EnumRequest request = 1; + */ + public Builder mergeRequest(com.google.showcase.v1beta1.EnumRequest value) { + if (requestBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) + && request_ != null + && request_ != com.google.showcase.v1beta1.EnumRequest.getDefaultInstance()) { + getRequestBuilder().mergeFrom(value); + } else { + request_ = value; + } + } else { + requestBuilder_.mergeFrom(value); + } + if (request_ != null) { + bitField0_ |= 0x00000001; + onChanged(); + } + return this; + } + + /** + * + * + *
        +     * The original request for a known or unknown enum from the server.
        +     * 
        + * + * .google.showcase.v1beta1.EnumRequest request = 1; + */ + public Builder clearRequest() { + bitField0_ = (bitField0_ & ~0x00000001); + request_ = null; + if (requestBuilder_ != null) { + requestBuilder_.dispose(); + requestBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
        +     * The original request for a known or unknown enum from the server.
        +     * 
        + * + * .google.showcase.v1beta1.EnumRequest request = 1; + */ + public com.google.showcase.v1beta1.EnumRequest.Builder getRequestBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return internalGetRequestFieldBuilder().getBuilder(); + } + + /** + * + * + *
        +     * The original request for a known or unknown enum from the server.
        +     * 
        + * + * .google.showcase.v1beta1.EnumRequest request = 1; + */ + public com.google.showcase.v1beta1.EnumRequestOrBuilder getRequestOrBuilder() { + if (requestBuilder_ != null) { + return requestBuilder_.getMessageOrBuilder(); + } else { + return request_ == null + ? com.google.showcase.v1beta1.EnumRequest.getDefaultInstance() + : request_; + } + } + + /** + * + * + *
        +     * The original request for a known or unknown enum from the server.
        +     * 
        + * + * .google.showcase.v1beta1.EnumRequest request = 1; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.showcase.v1beta1.EnumRequest, + com.google.showcase.v1beta1.EnumRequest.Builder, + com.google.showcase.v1beta1.EnumRequestOrBuilder> + internalGetRequestFieldBuilder() { + if (requestBuilder_ == null) { + requestBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.showcase.v1beta1.EnumRequest, + com.google.showcase.v1beta1.EnumRequest.Builder, + com.google.showcase.v1beta1.EnumRequestOrBuilder>( + getRequest(), getParentForChildren(), isClean()); + request_ = null; + } + return requestBuilder_; + } + + private int continent_ = 0; + + /** + * + * + *
        +     * The actual enum the server provided.
        +     * 
        + * + * .google.showcase.v1beta1.Continent continent = 2; + * + * @return The enum numeric value on the wire for continent. + */ + @java.lang.Override + public int getContinentValue() { + return continent_; + } + + /** + * + * + *
        +     * The actual enum the server provided.
        +     * 
        + * + * .google.showcase.v1beta1.Continent continent = 2; + * + * @param value The enum numeric value on the wire for continent to set. + * @return This builder for chaining. + */ + public Builder setContinentValue(int value) { + continent_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
        +     * The actual enum the server provided.
        +     * 
        + * + * .google.showcase.v1beta1.Continent continent = 2; + * + * @return The continent. + */ + @java.lang.Override + public com.google.showcase.v1beta1.Continent getContinent() { + com.google.showcase.v1beta1.Continent result = + com.google.showcase.v1beta1.Continent.forNumber(continent_); + return result == null ? com.google.showcase.v1beta1.Continent.UNRECOGNIZED : result; + } + + /** + * + * + *
        +     * The actual enum the server provided.
        +     * 
        + * + * .google.showcase.v1beta1.Continent continent = 2; + * + * @param value The continent to set. + * @return This builder for chaining. + */ + public Builder setContinent(com.google.showcase.v1beta1.Continent value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000002; + continent_ = value.getNumber(); + onChanged(); + return this; + } + + /** + * + * + *
        +     * The actual enum the server provided.
        +     * 
        + * + * .google.showcase.v1beta1.Continent continent = 2; + * + * @return This builder for chaining. + */ + public Builder clearContinent() { + bitField0_ = (bitField0_ & ~0x00000002); + continent_ = 0; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.showcase.v1beta1.EnumResponse) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.EnumResponse) + private static final com.google.showcase.v1beta1.EnumResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.EnumResponse(); + } + + public static com.google.showcase.v1beta1.EnumResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public EnumResponse 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.showcase.v1beta1.EnumResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/EnumResponseOrBuilder.java b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/EnumResponseOrBuilder.java new file mode 100644 index 0000000000..4f4fd97a9c --- /dev/null +++ b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/EnumResponseOrBuilder.java @@ -0,0 +1,91 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: schema/google/showcase/v1beta1/compliance.proto +// Protobuf Java Version: 4.33.2 + +package com.google.showcase.v1beta1; + +@com.google.protobuf.Generated +public interface EnumResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.EnumResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
        +   * The original request for a known or unknown enum from the server.
        +   * 
        + * + * .google.showcase.v1beta1.EnumRequest request = 1; + * + * @return Whether the request field is set. + */ + boolean hasRequest(); + + /** + * + * + *
        +   * The original request for a known or unknown enum from the server.
        +   * 
        + * + * .google.showcase.v1beta1.EnumRequest request = 1; + * + * @return The request. + */ + com.google.showcase.v1beta1.EnumRequest getRequest(); + + /** + * + * + *
        +   * The original request for a known or unknown enum from the server.
        +   * 
        + * + * .google.showcase.v1beta1.EnumRequest request = 1; + */ + com.google.showcase.v1beta1.EnumRequestOrBuilder getRequestOrBuilder(); + + /** + * + * + *
        +   * The actual enum the server provided.
        +   * 
        + * + * .google.showcase.v1beta1.Continent continent = 2; + * + * @return The enum numeric value on the wire for continent. + */ + int getContinentValue(); + + /** + * + * + *
        +   * The actual enum the server provided.
        +   * 
        + * + * .google.showcase.v1beta1.Continent continent = 2; + * + * @return The continent. + */ + com.google.showcase.v1beta1.Continent getContinent(); +} diff --git a/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ErrorWithMultipleDetails.java b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ErrorWithMultipleDetails.java new file mode 100644 index 0000000000..7381ba172e --- /dev/null +++ b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ErrorWithMultipleDetails.java @@ -0,0 +1,714 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: schema/google/showcase/v1beta1/echo.proto +// Protobuf Java Version: 4.33.2 + +package com.google.showcase.v1beta1; + +/** Protobuf type {@code google.showcase.v1beta1.ErrorWithMultipleDetails} */ +@com.google.protobuf.Generated +public final class ErrorWithMultipleDetails extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.ErrorWithMultipleDetails) + ErrorWithMultipleDetailsOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "ErrorWithMultipleDetails"); + } + + // Use ErrorWithMultipleDetails.newBuilder() to construct. + private ErrorWithMultipleDetails(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private ErrorWithMultipleDetails() { + details_ = java.util.Collections.emptyList(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.EchoOuterClass + .internal_static_google_showcase_v1beta1_ErrorWithMultipleDetails_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.EchoOuterClass + .internal_static_google_showcase_v1beta1_ErrorWithMultipleDetails_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.ErrorWithMultipleDetails.class, + com.google.showcase.v1beta1.ErrorWithMultipleDetails.Builder.class); + } + + public static final int DETAILS_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private java.util.List details_; + + /** repeated .google.protobuf.Any details = 1; */ + @java.lang.Override + public java.util.List getDetailsList() { + return details_; + } + + /** repeated .google.protobuf.Any details = 1; */ + @java.lang.Override + public java.util.List getDetailsOrBuilderList() { + return details_; + } + + /** repeated .google.protobuf.Any details = 1; */ + @java.lang.Override + public int getDetailsCount() { + return details_.size(); + } + + /** repeated .google.protobuf.Any details = 1; */ + @java.lang.Override + public com.google.protobuf.Any getDetails(int index) { + return details_.get(index); + } + + /** repeated .google.protobuf.Any details = 1; */ + @java.lang.Override + public com.google.protobuf.AnyOrBuilder getDetailsOrBuilder(int index) { + return details_.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 < details_.size(); i++) { + output.writeMessage(1, details_.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 < details_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, details_.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.showcase.v1beta1.ErrorWithMultipleDetails)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.ErrorWithMultipleDetails other = + (com.google.showcase.v1beta1.ErrorWithMultipleDetails) obj; + + if (!getDetailsList().equals(other.getDetailsList())) 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 (getDetailsCount() > 0) { + hash = (37 * hash) + DETAILS_FIELD_NUMBER; + hash = (53 * hash) + getDetailsList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.showcase.v1beta1.ErrorWithMultipleDetails parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.ErrorWithMultipleDetails parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.ErrorWithMultipleDetails parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.ErrorWithMultipleDetails 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.showcase.v1beta1.ErrorWithMultipleDetails parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.ErrorWithMultipleDetails parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.ErrorWithMultipleDetails parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.ErrorWithMultipleDetails parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.showcase.v1beta1.ErrorWithMultipleDetails parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.ErrorWithMultipleDetails parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.showcase.v1beta1.ErrorWithMultipleDetails parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.ErrorWithMultipleDetails parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.showcase.v1beta1.ErrorWithMultipleDetails 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** Protobuf type {@code google.showcase.v1beta1.ErrorWithMultipleDetails} */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.ErrorWithMultipleDetails) + com.google.showcase.v1beta1.ErrorWithMultipleDetailsOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.EchoOuterClass + .internal_static_google_showcase_v1beta1_ErrorWithMultipleDetails_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.EchoOuterClass + .internal_static_google_showcase_v1beta1_ErrorWithMultipleDetails_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.ErrorWithMultipleDetails.class, + com.google.showcase.v1beta1.ErrorWithMultipleDetails.Builder.class); + } + + // Construct using com.google.showcase.v1beta1.ErrorWithMultipleDetails.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (detailsBuilder_ == null) { + details_ = java.util.Collections.emptyList(); + } else { + details_ = null; + detailsBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.showcase.v1beta1.EchoOuterClass + .internal_static_google_showcase_v1beta1_ErrorWithMultipleDetails_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.ErrorWithMultipleDetails getDefaultInstanceForType() { + return com.google.showcase.v1beta1.ErrorWithMultipleDetails.getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.ErrorWithMultipleDetails build() { + com.google.showcase.v1beta1.ErrorWithMultipleDetails result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.ErrorWithMultipleDetails buildPartial() { + com.google.showcase.v1beta1.ErrorWithMultipleDetails result = + new com.google.showcase.v1beta1.ErrorWithMultipleDetails(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields( + com.google.showcase.v1beta1.ErrorWithMultipleDetails result) { + if (detailsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + details_ = java.util.Collections.unmodifiableList(details_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.details_ = details_; + } else { + result.details_ = detailsBuilder_.build(); + } + } + + private void buildPartial0(com.google.showcase.v1beta1.ErrorWithMultipleDetails result) { + int from_bitField0_ = bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.showcase.v1beta1.ErrorWithMultipleDetails) { + return mergeFrom((com.google.showcase.v1beta1.ErrorWithMultipleDetails) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.showcase.v1beta1.ErrorWithMultipleDetails other) { + if (other == com.google.showcase.v1beta1.ErrorWithMultipleDetails.getDefaultInstance()) + return this; + if (detailsBuilder_ == null) { + if (!other.details_.isEmpty()) { + if (details_.isEmpty()) { + details_ = other.details_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureDetailsIsMutable(); + details_.addAll(other.details_); + } + onChanged(); + } + } else { + if (!other.details_.isEmpty()) { + if (detailsBuilder_.isEmpty()) { + detailsBuilder_.dispose(); + detailsBuilder_ = null; + details_ = other.details_; + bitField0_ = (bitField0_ & ~0x00000001); + detailsBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders + ? internalGetDetailsFieldBuilder() + : null; + } else { + detailsBuilder_.addAllMessages(other.details_); + } + } + } + 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.Any m = + input.readMessage(com.google.protobuf.Any.parser(), extensionRegistry); + if (detailsBuilder_ == null) { + ensureDetailsIsMutable(); + details_.add(m); + } else { + detailsBuilder_.addMessage(m); + } + 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.util.List details_ = java.util.Collections.emptyList(); + + private void ensureDetailsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + details_ = new java.util.ArrayList(details_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.google.protobuf.Any, + com.google.protobuf.Any.Builder, + com.google.protobuf.AnyOrBuilder> + detailsBuilder_; + + /** repeated .google.protobuf.Any details = 1; */ + public java.util.List getDetailsList() { + if (detailsBuilder_ == null) { + return java.util.Collections.unmodifiableList(details_); + } else { + return detailsBuilder_.getMessageList(); + } + } + + /** repeated .google.protobuf.Any details = 1; */ + public int getDetailsCount() { + if (detailsBuilder_ == null) { + return details_.size(); + } else { + return detailsBuilder_.getCount(); + } + } + + /** repeated .google.protobuf.Any details = 1; */ + public com.google.protobuf.Any getDetails(int index) { + if (detailsBuilder_ == null) { + return details_.get(index); + } else { + return detailsBuilder_.getMessage(index); + } + } + + /** repeated .google.protobuf.Any details = 1; */ + public Builder setDetails(int index, com.google.protobuf.Any value) { + if (detailsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureDetailsIsMutable(); + details_.set(index, value); + onChanged(); + } else { + detailsBuilder_.setMessage(index, value); + } + return this; + } + + /** repeated .google.protobuf.Any details = 1; */ + public Builder setDetails(int index, com.google.protobuf.Any.Builder builderForValue) { + if (detailsBuilder_ == null) { + ensureDetailsIsMutable(); + details_.set(index, builderForValue.build()); + onChanged(); + } else { + detailsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + + /** repeated .google.protobuf.Any details = 1; */ + public Builder addDetails(com.google.protobuf.Any value) { + if (detailsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureDetailsIsMutable(); + details_.add(value); + onChanged(); + } else { + detailsBuilder_.addMessage(value); + } + return this; + } + + /** repeated .google.protobuf.Any details = 1; */ + public Builder addDetails(int index, com.google.protobuf.Any value) { + if (detailsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureDetailsIsMutable(); + details_.add(index, value); + onChanged(); + } else { + detailsBuilder_.addMessage(index, value); + } + return this; + } + + /** repeated .google.protobuf.Any details = 1; */ + public Builder addDetails(com.google.protobuf.Any.Builder builderForValue) { + if (detailsBuilder_ == null) { + ensureDetailsIsMutable(); + details_.add(builderForValue.build()); + onChanged(); + } else { + detailsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + + /** repeated .google.protobuf.Any details = 1; */ + public Builder addDetails(int index, com.google.protobuf.Any.Builder builderForValue) { + if (detailsBuilder_ == null) { + ensureDetailsIsMutable(); + details_.add(index, builderForValue.build()); + onChanged(); + } else { + detailsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + + /** repeated .google.protobuf.Any details = 1; */ + public Builder addAllDetails(java.lang.Iterable values) { + if (detailsBuilder_ == null) { + ensureDetailsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, details_); + onChanged(); + } else { + detailsBuilder_.addAllMessages(values); + } + return this; + } + + /** repeated .google.protobuf.Any details = 1; */ + public Builder clearDetails() { + if (detailsBuilder_ == null) { + details_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + detailsBuilder_.clear(); + } + return this; + } + + /** repeated .google.protobuf.Any details = 1; */ + public Builder removeDetails(int index) { + if (detailsBuilder_ == null) { + ensureDetailsIsMutable(); + details_.remove(index); + onChanged(); + } else { + detailsBuilder_.remove(index); + } + return this; + } + + /** repeated .google.protobuf.Any details = 1; */ + public com.google.protobuf.Any.Builder getDetailsBuilder(int index) { + return internalGetDetailsFieldBuilder().getBuilder(index); + } + + /** repeated .google.protobuf.Any details = 1; */ + public com.google.protobuf.AnyOrBuilder getDetailsOrBuilder(int index) { + if (detailsBuilder_ == null) { + return details_.get(index); + } else { + return detailsBuilder_.getMessageOrBuilder(index); + } + } + + /** repeated .google.protobuf.Any details = 1; */ + public java.util.List getDetailsOrBuilderList() { + if (detailsBuilder_ != null) { + return detailsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(details_); + } + } + + /** repeated .google.protobuf.Any details = 1; */ + public com.google.protobuf.Any.Builder addDetailsBuilder() { + return internalGetDetailsFieldBuilder() + .addBuilder(com.google.protobuf.Any.getDefaultInstance()); + } + + /** repeated .google.protobuf.Any details = 1; */ + public com.google.protobuf.Any.Builder addDetailsBuilder(int index) { + return internalGetDetailsFieldBuilder() + .addBuilder(index, com.google.protobuf.Any.getDefaultInstance()); + } + + /** repeated .google.protobuf.Any details = 1; */ + public java.util.List getDetailsBuilderList() { + return internalGetDetailsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.google.protobuf.Any, + com.google.protobuf.Any.Builder, + com.google.protobuf.AnyOrBuilder> + internalGetDetailsFieldBuilder() { + if (detailsBuilder_ == null) { + detailsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilder< + com.google.protobuf.Any, + com.google.protobuf.Any.Builder, + com.google.protobuf.AnyOrBuilder>( + details_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + details_ = null; + } + return detailsBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.showcase.v1beta1.ErrorWithMultipleDetails) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.ErrorWithMultipleDetails) + private static final com.google.showcase.v1beta1.ErrorWithMultipleDetails DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.ErrorWithMultipleDetails(); + } + + public static com.google.showcase.v1beta1.ErrorWithMultipleDetails getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ErrorWithMultipleDetails 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.showcase.v1beta1.ErrorWithMultipleDetails getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ErrorWithMultipleDetailsOrBuilder.java b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ErrorWithMultipleDetailsOrBuilder.java new file mode 100644 index 0000000000..f5c1ff94ae --- /dev/null +++ b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ErrorWithMultipleDetailsOrBuilder.java @@ -0,0 +1,43 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: schema/google/showcase/v1beta1/echo.proto +// Protobuf Java Version: 4.33.2 + +package com.google.showcase.v1beta1; + +@com.google.protobuf.Generated +public interface ErrorWithMultipleDetailsOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.ErrorWithMultipleDetails) + com.google.protobuf.MessageOrBuilder { + + /** repeated .google.protobuf.Any details = 1; */ + java.util.List getDetailsList(); + + /** repeated .google.protobuf.Any details = 1; */ + com.google.protobuf.Any getDetails(int index); + + /** repeated .google.protobuf.Any details = 1; */ + int getDetailsCount(); + + /** repeated .google.protobuf.Any details = 1; */ + java.util.List getDetailsOrBuilderList(); + + /** repeated .google.protobuf.Any details = 1; */ + com.google.protobuf.AnyOrBuilder getDetailsOrBuilder(int index); +} diff --git a/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ErrorWithSingleDetail.java b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ErrorWithSingleDetail.java new file mode 100644 index 0000000000..7ba6576c55 --- /dev/null +++ b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ErrorWithSingleDetail.java @@ -0,0 +1,584 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: schema/google/showcase/v1beta1/echo.proto +// Protobuf Java Version: 4.33.2 + +package com.google.showcase.v1beta1; + +/** Protobuf type {@code google.showcase.v1beta1.ErrorWithSingleDetail} */ +@com.google.protobuf.Generated +public final class ErrorWithSingleDetail extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.ErrorWithSingleDetail) + ErrorWithSingleDetailOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "ErrorWithSingleDetail"); + } + + // Use ErrorWithSingleDetail.newBuilder() to construct. + private ErrorWithSingleDetail(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private ErrorWithSingleDetail() {} + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.EchoOuterClass + .internal_static_google_showcase_v1beta1_ErrorWithSingleDetail_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.EchoOuterClass + .internal_static_google_showcase_v1beta1_ErrorWithSingleDetail_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.ErrorWithSingleDetail.class, + com.google.showcase.v1beta1.ErrorWithSingleDetail.Builder.class); + } + + private int bitField0_; + public static final int DETAILS_FIELD_NUMBER = 1; + private com.google.protobuf.Any details_; + + /** + * .google.protobuf.Any details = 1; + * + * @return Whether the details field is set. + */ + @java.lang.Override + public boolean hasDetails() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * .google.protobuf.Any details = 1; + * + * @return The details. + */ + @java.lang.Override + public com.google.protobuf.Any getDetails() { + return details_ == null ? com.google.protobuf.Any.getDefaultInstance() : details_; + } + + /** .google.protobuf.Any details = 1; */ + @java.lang.Override + public com.google.protobuf.AnyOrBuilder getDetailsOrBuilder() { + return details_ == null ? com.google.protobuf.Any.getDefaultInstance() : details_; + } + + 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, getDetails()); + } + 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, getDetails()); + } + 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.showcase.v1beta1.ErrorWithSingleDetail)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.ErrorWithSingleDetail other = + (com.google.showcase.v1beta1.ErrorWithSingleDetail) obj; + + if (hasDetails() != other.hasDetails()) return false; + if (hasDetails()) { + if (!getDetails().equals(other.getDetails())) 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 (hasDetails()) { + hash = (37 * hash) + DETAILS_FIELD_NUMBER; + hash = (53 * hash) + getDetails().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.showcase.v1beta1.ErrorWithSingleDetail parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.ErrorWithSingleDetail parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.ErrorWithSingleDetail parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.ErrorWithSingleDetail 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.showcase.v1beta1.ErrorWithSingleDetail parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.ErrorWithSingleDetail parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.ErrorWithSingleDetail parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.ErrorWithSingleDetail parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.showcase.v1beta1.ErrorWithSingleDetail parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.ErrorWithSingleDetail parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.showcase.v1beta1.ErrorWithSingleDetail parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.ErrorWithSingleDetail parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.showcase.v1beta1.ErrorWithSingleDetail 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** Protobuf type {@code google.showcase.v1beta1.ErrorWithSingleDetail} */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.ErrorWithSingleDetail) + com.google.showcase.v1beta1.ErrorWithSingleDetailOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.EchoOuterClass + .internal_static_google_showcase_v1beta1_ErrorWithSingleDetail_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.EchoOuterClass + .internal_static_google_showcase_v1beta1_ErrorWithSingleDetail_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.ErrorWithSingleDetail.class, + com.google.showcase.v1beta1.ErrorWithSingleDetail.Builder.class); + } + + // Construct using com.google.showcase.v1beta1.ErrorWithSingleDetail.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetDetailsFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + details_ = null; + if (detailsBuilder_ != null) { + detailsBuilder_.dispose(); + detailsBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.showcase.v1beta1.EchoOuterClass + .internal_static_google_showcase_v1beta1_ErrorWithSingleDetail_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.ErrorWithSingleDetail getDefaultInstanceForType() { + return com.google.showcase.v1beta1.ErrorWithSingleDetail.getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.ErrorWithSingleDetail build() { + com.google.showcase.v1beta1.ErrorWithSingleDetail result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.ErrorWithSingleDetail buildPartial() { + com.google.showcase.v1beta1.ErrorWithSingleDetail result = + new com.google.showcase.v1beta1.ErrorWithSingleDetail(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.showcase.v1beta1.ErrorWithSingleDetail result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.details_ = detailsBuilder_ == null ? details_ : detailsBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.showcase.v1beta1.ErrorWithSingleDetail) { + return mergeFrom((com.google.showcase.v1beta1.ErrorWithSingleDetail) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.showcase.v1beta1.ErrorWithSingleDetail other) { + if (other == com.google.showcase.v1beta1.ErrorWithSingleDetail.getDefaultInstance()) + return this; + if (other.hasDetails()) { + mergeDetails(other.getDetails()); + } + 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(internalGetDetailsFieldBuilder().getBuilder(), extensionRegistry); + 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 com.google.protobuf.Any details_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Any, + com.google.protobuf.Any.Builder, + com.google.protobuf.AnyOrBuilder> + detailsBuilder_; + + /** + * .google.protobuf.Any details = 1; + * + * @return Whether the details field is set. + */ + public boolean hasDetails() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * .google.protobuf.Any details = 1; + * + * @return The details. + */ + public com.google.protobuf.Any getDetails() { + if (detailsBuilder_ == null) { + return details_ == null ? com.google.protobuf.Any.getDefaultInstance() : details_; + } else { + return detailsBuilder_.getMessage(); + } + } + + /** .google.protobuf.Any details = 1; */ + public Builder setDetails(com.google.protobuf.Any value) { + if (detailsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + details_ = value; + } else { + detailsBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** .google.protobuf.Any details = 1; */ + public Builder setDetails(com.google.protobuf.Any.Builder builderForValue) { + if (detailsBuilder_ == null) { + details_ = builderForValue.build(); + } else { + detailsBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** .google.protobuf.Any details = 1; */ + public Builder mergeDetails(com.google.protobuf.Any value) { + if (detailsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) + && details_ != null + && details_ != com.google.protobuf.Any.getDefaultInstance()) { + getDetailsBuilder().mergeFrom(value); + } else { + details_ = value; + } + } else { + detailsBuilder_.mergeFrom(value); + } + if (details_ != null) { + bitField0_ |= 0x00000001; + onChanged(); + } + return this; + } + + /** .google.protobuf.Any details = 1; */ + public Builder clearDetails() { + bitField0_ = (bitField0_ & ~0x00000001); + details_ = null; + if (detailsBuilder_ != null) { + detailsBuilder_.dispose(); + detailsBuilder_ = null; + } + onChanged(); + return this; + } + + /** .google.protobuf.Any details = 1; */ + public com.google.protobuf.Any.Builder getDetailsBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return internalGetDetailsFieldBuilder().getBuilder(); + } + + /** .google.protobuf.Any details = 1; */ + public com.google.protobuf.AnyOrBuilder getDetailsOrBuilder() { + if (detailsBuilder_ != null) { + return detailsBuilder_.getMessageOrBuilder(); + } else { + return details_ == null ? com.google.protobuf.Any.getDefaultInstance() : details_; + } + } + + /** .google.protobuf.Any details = 1; */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Any, + com.google.protobuf.Any.Builder, + com.google.protobuf.AnyOrBuilder> + internalGetDetailsFieldBuilder() { + if (detailsBuilder_ == null) { + detailsBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Any, + com.google.protobuf.Any.Builder, + com.google.protobuf.AnyOrBuilder>(getDetails(), getParentForChildren(), isClean()); + details_ = null; + } + return detailsBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.showcase.v1beta1.ErrorWithSingleDetail) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.ErrorWithSingleDetail) + private static final com.google.showcase.v1beta1.ErrorWithSingleDetail DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.ErrorWithSingleDetail(); + } + + public static com.google.showcase.v1beta1.ErrorWithSingleDetail getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ErrorWithSingleDetail 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.showcase.v1beta1.ErrorWithSingleDetail getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ErrorWithSingleDetailOrBuilder.java b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ErrorWithSingleDetailOrBuilder.java new file mode 100644 index 0000000000..40132826d5 --- /dev/null +++ b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ErrorWithSingleDetailOrBuilder.java @@ -0,0 +1,45 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: schema/google/showcase/v1beta1/echo.proto +// Protobuf Java Version: 4.33.2 + +package com.google.showcase.v1beta1; + +@com.google.protobuf.Generated +public interface ErrorWithSingleDetailOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.ErrorWithSingleDetail) + com.google.protobuf.MessageOrBuilder { + + /** + * .google.protobuf.Any details = 1; + * + * @return Whether the details field is set. + */ + boolean hasDetails(); + + /** + * .google.protobuf.Any details = 1; + * + * @return The details. + */ + com.google.protobuf.Any getDetails(); + + /** .google.protobuf.Any details = 1; */ + com.google.protobuf.AnyOrBuilder getDetailsOrBuilder(); +} diff --git a/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ExpandRequest.java b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ExpandRequest.java new file mode 100644 index 0000000000..d20ae100b0 --- /dev/null +++ b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ExpandRequest.java @@ -0,0 +1,1155 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: schema/google/showcase/v1beta1/echo.proto +// Protobuf Java Version: 4.33.2 + +package com.google.showcase.v1beta1; + +/** + * + * + *
        + * The request message for the Expand method.
        + * 
        + * + * Protobuf type {@code google.showcase.v1beta1.ExpandRequest} + */ +@com.google.protobuf.Generated +public final class ExpandRequest extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.ExpandRequest) + ExpandRequestOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "ExpandRequest"); + } + + // Use ExpandRequest.newBuilder() to construct. + private ExpandRequest(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private ExpandRequest() { + content_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.EchoOuterClass + .internal_static_google_showcase_v1beta1_ExpandRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.EchoOuterClass + .internal_static_google_showcase_v1beta1_ExpandRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.ExpandRequest.class, + com.google.showcase.v1beta1.ExpandRequest.Builder.class); + } + + private int bitField0_; + public static final int CONTENT_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object content_ = ""; + + /** + * + * + *
        +   * The content that will be split into words and returned on the stream.
        +   * 
        + * + * string content = 1; + * + * @return The content. + */ + @java.lang.Override + public java.lang.String getContent() { + java.lang.Object ref = content_; + 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(); + content_ = s; + return s; + } + } + + /** + * + * + *
        +   * The content that will be split into words and returned on the stream.
        +   * 
        + * + * string content = 1; + * + * @return The bytes for content. + */ + @java.lang.Override + public com.google.protobuf.ByteString getContentBytes() { + java.lang.Object ref = content_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + content_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int ERROR_FIELD_NUMBER = 2; + private com.google.rpc.Status error_; + + /** + * + * + *
        +   * The error that is thrown after all words are sent on the stream.
        +   * 
        + * + * .google.rpc.Status error = 2; + * + * @return Whether the error field is set. + */ + @java.lang.Override + public boolean hasError() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
        +   * The error that is thrown after all words are sent on the stream.
        +   * 
        + * + * .google.rpc.Status error = 2; + * + * @return The error. + */ + @java.lang.Override + public com.google.rpc.Status getError() { + return error_ == null ? com.google.rpc.Status.getDefaultInstance() : error_; + } + + /** + * + * + *
        +   * The error that is thrown after all words are sent on the stream.
        +   * 
        + * + * .google.rpc.Status error = 2; + */ + @java.lang.Override + public com.google.rpc.StatusOrBuilder getErrorOrBuilder() { + return error_ == null ? com.google.rpc.Status.getDefaultInstance() : error_; + } + + public static final int STREAM_WAIT_TIME_FIELD_NUMBER = 3; + private com.google.protobuf.Duration streamWaitTime_; + + /** + * + * + *
        +   * The wait time between each server streaming messages
        +   * 
        + * + * .google.protobuf.Duration stream_wait_time = 3; + * + * @return Whether the streamWaitTime field is set. + */ + @java.lang.Override + public boolean hasStreamWaitTime() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
        +   * The wait time between each server streaming messages
        +   * 
        + * + * .google.protobuf.Duration stream_wait_time = 3; + * + * @return The streamWaitTime. + */ + @java.lang.Override + public com.google.protobuf.Duration getStreamWaitTime() { + return streamWaitTime_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : streamWaitTime_; + } + + /** + * + * + *
        +   * The wait time between each server streaming messages
        +   * 
        + * + * .google.protobuf.Duration stream_wait_time = 3; + */ + @java.lang.Override + public com.google.protobuf.DurationOrBuilder getStreamWaitTimeOrBuilder() { + return streamWaitTime_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : streamWaitTime_; + } + + 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.GeneratedMessage.isStringEmpty(content_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, content_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(2, getError()); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeMessage(3, getStreamWaitTime()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(content_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, content_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getError()); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getStreamWaitTime()); + } + 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.showcase.v1beta1.ExpandRequest)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.ExpandRequest other = + (com.google.showcase.v1beta1.ExpandRequest) obj; + + if (!getContent().equals(other.getContent())) return false; + if (hasError() != other.hasError()) return false; + if (hasError()) { + if (!getError().equals(other.getError())) return false; + } + if (hasStreamWaitTime() != other.hasStreamWaitTime()) return false; + if (hasStreamWaitTime()) { + if (!getStreamWaitTime().equals(other.getStreamWaitTime())) 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) + CONTENT_FIELD_NUMBER; + hash = (53 * hash) + getContent().hashCode(); + if (hasError()) { + hash = (37 * hash) + ERROR_FIELD_NUMBER; + hash = (53 * hash) + getError().hashCode(); + } + if (hasStreamWaitTime()) { + hash = (37 * hash) + STREAM_WAIT_TIME_FIELD_NUMBER; + hash = (53 * hash) + getStreamWaitTime().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.showcase.v1beta1.ExpandRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.ExpandRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.ExpandRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.ExpandRequest 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.showcase.v1beta1.ExpandRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.ExpandRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.ExpandRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.ExpandRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.showcase.v1beta1.ExpandRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.ExpandRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.showcase.v1beta1.ExpandRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.ExpandRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.showcase.v1beta1.ExpandRequest 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
        +   * The request message for the Expand method.
        +   * 
        + * + * Protobuf type {@code google.showcase.v1beta1.ExpandRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.ExpandRequest) + com.google.showcase.v1beta1.ExpandRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.EchoOuterClass + .internal_static_google_showcase_v1beta1_ExpandRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.EchoOuterClass + .internal_static_google_showcase_v1beta1_ExpandRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.ExpandRequest.class, + com.google.showcase.v1beta1.ExpandRequest.Builder.class); + } + + // Construct using com.google.showcase.v1beta1.ExpandRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetErrorFieldBuilder(); + internalGetStreamWaitTimeFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + content_ = ""; + error_ = null; + if (errorBuilder_ != null) { + errorBuilder_.dispose(); + errorBuilder_ = null; + } + streamWaitTime_ = null; + if (streamWaitTimeBuilder_ != null) { + streamWaitTimeBuilder_.dispose(); + streamWaitTimeBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.showcase.v1beta1.EchoOuterClass + .internal_static_google_showcase_v1beta1_ExpandRequest_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.ExpandRequest getDefaultInstanceForType() { + return com.google.showcase.v1beta1.ExpandRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.ExpandRequest build() { + com.google.showcase.v1beta1.ExpandRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.ExpandRequest buildPartial() { + com.google.showcase.v1beta1.ExpandRequest result = + new com.google.showcase.v1beta1.ExpandRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.showcase.v1beta1.ExpandRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.content_ = content_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.error_ = errorBuilder_ == null ? error_ : errorBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.streamWaitTime_ = + streamWaitTimeBuilder_ == null ? streamWaitTime_ : streamWaitTimeBuilder_.build(); + to_bitField0_ |= 0x00000002; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.showcase.v1beta1.ExpandRequest) { + return mergeFrom((com.google.showcase.v1beta1.ExpandRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.showcase.v1beta1.ExpandRequest other) { + if (other == com.google.showcase.v1beta1.ExpandRequest.getDefaultInstance()) return this; + if (!other.getContent().isEmpty()) { + content_ = other.content_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.hasError()) { + mergeError(other.getError()); + } + if (other.hasStreamWaitTime()) { + mergeStreamWaitTime(other.getStreamWaitTime()); + } + 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: + { + content_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + input.readMessage(internalGetErrorFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + input.readMessage( + internalGetStreamWaitTimeFieldBuilder().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 content_ = ""; + + /** + * + * + *
        +     * The content that will be split into words and returned on the stream.
        +     * 
        + * + * string content = 1; + * + * @return The content. + */ + public java.lang.String getContent() { + java.lang.Object ref = content_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + content_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
        +     * The content that will be split into words and returned on the stream.
        +     * 
        + * + * string content = 1; + * + * @return The bytes for content. + */ + public com.google.protobuf.ByteString getContentBytes() { + java.lang.Object ref = content_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + content_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
        +     * The content that will be split into words and returned on the stream.
        +     * 
        + * + * string content = 1; + * + * @param value The content to set. + * @return This builder for chaining. + */ + public Builder setContent(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + content_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
        +     * The content that will be split into words and returned on the stream.
        +     * 
        + * + * string content = 1; + * + * @return This builder for chaining. + */ + public Builder clearContent() { + content_ = getDefaultInstance().getContent(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
        +     * The content that will be split into words and returned on the stream.
        +     * 
        + * + * string content = 1; + * + * @param value The bytes for content to set. + * @return This builder for chaining. + */ + public Builder setContentBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + content_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private com.google.rpc.Status error_; + private com.google.protobuf.SingleFieldBuilder< + com.google.rpc.Status, com.google.rpc.Status.Builder, com.google.rpc.StatusOrBuilder> + errorBuilder_; + + /** + * + * + *
        +     * The error that is thrown after all words are sent on the stream.
        +     * 
        + * + * .google.rpc.Status error = 2; + * + * @return Whether the error field is set. + */ + public boolean hasError() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
        +     * The error that is thrown after all words are sent on the stream.
        +     * 
        + * + * .google.rpc.Status error = 2; + * + * @return The error. + */ + public com.google.rpc.Status getError() { + if (errorBuilder_ == null) { + return error_ == null ? com.google.rpc.Status.getDefaultInstance() : error_; + } else { + return errorBuilder_.getMessage(); + } + } + + /** + * + * + *
        +     * The error that is thrown after all words are sent on the stream.
        +     * 
        + * + * .google.rpc.Status error = 2; + */ + public Builder setError(com.google.rpc.Status value) { + if (errorBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + error_ = value; + } else { + errorBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
        +     * The error that is thrown after all words are sent on the stream.
        +     * 
        + * + * .google.rpc.Status error = 2; + */ + public Builder setError(com.google.rpc.Status.Builder builderForValue) { + if (errorBuilder_ == null) { + error_ = builderForValue.build(); + } else { + errorBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
        +     * The error that is thrown after all words are sent on the stream.
        +     * 
        + * + * .google.rpc.Status error = 2; + */ + public Builder mergeError(com.google.rpc.Status value) { + if (errorBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && error_ != null + && error_ != com.google.rpc.Status.getDefaultInstance()) { + getErrorBuilder().mergeFrom(value); + } else { + error_ = value; + } + } else { + errorBuilder_.mergeFrom(value); + } + if (error_ != null) { + bitField0_ |= 0x00000002; + onChanged(); + } + return this; + } + + /** + * + * + *
        +     * The error that is thrown after all words are sent on the stream.
        +     * 
        + * + * .google.rpc.Status error = 2; + */ + public Builder clearError() { + bitField0_ = (bitField0_ & ~0x00000002); + error_ = null; + if (errorBuilder_ != null) { + errorBuilder_.dispose(); + errorBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
        +     * The error that is thrown after all words are sent on the stream.
        +     * 
        + * + * .google.rpc.Status error = 2; + */ + public com.google.rpc.Status.Builder getErrorBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return internalGetErrorFieldBuilder().getBuilder(); + } + + /** + * + * + *
        +     * The error that is thrown after all words are sent on the stream.
        +     * 
        + * + * .google.rpc.Status error = 2; + */ + public com.google.rpc.StatusOrBuilder getErrorOrBuilder() { + if (errorBuilder_ != null) { + return errorBuilder_.getMessageOrBuilder(); + } else { + return error_ == null ? com.google.rpc.Status.getDefaultInstance() : error_; + } + } + + /** + * + * + *
        +     * The error that is thrown after all words are sent on the stream.
        +     * 
        + * + * .google.rpc.Status error = 2; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.rpc.Status, com.google.rpc.Status.Builder, com.google.rpc.StatusOrBuilder> + internalGetErrorFieldBuilder() { + if (errorBuilder_ == null) { + errorBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.rpc.Status, + com.google.rpc.Status.Builder, + com.google.rpc.StatusOrBuilder>(getError(), getParentForChildren(), isClean()); + error_ = null; + } + return errorBuilder_; + } + + private com.google.protobuf.Duration streamWaitTime_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder> + streamWaitTimeBuilder_; + + /** + * + * + *
        +     * The wait time between each server streaming messages
        +     * 
        + * + * .google.protobuf.Duration stream_wait_time = 3; + * + * @return Whether the streamWaitTime field is set. + */ + public boolean hasStreamWaitTime() { + return ((bitField0_ & 0x00000004) != 0); + } + + /** + * + * + *
        +     * The wait time between each server streaming messages
        +     * 
        + * + * .google.protobuf.Duration stream_wait_time = 3; + * + * @return The streamWaitTime. + */ + public com.google.protobuf.Duration getStreamWaitTime() { + if (streamWaitTimeBuilder_ == null) { + return streamWaitTime_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : streamWaitTime_; + } else { + return streamWaitTimeBuilder_.getMessage(); + } + } + + /** + * + * + *
        +     * The wait time between each server streaming messages
        +     * 
        + * + * .google.protobuf.Duration stream_wait_time = 3; + */ + public Builder setStreamWaitTime(com.google.protobuf.Duration value) { + if (streamWaitTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + streamWaitTime_ = value; + } else { + streamWaitTimeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
        +     * The wait time between each server streaming messages
        +     * 
        + * + * .google.protobuf.Duration stream_wait_time = 3; + */ + public Builder setStreamWaitTime(com.google.protobuf.Duration.Builder builderForValue) { + if (streamWaitTimeBuilder_ == null) { + streamWaitTime_ = builderForValue.build(); + } else { + streamWaitTimeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
        +     * The wait time between each server streaming messages
        +     * 
        + * + * .google.protobuf.Duration stream_wait_time = 3; + */ + public Builder mergeStreamWaitTime(com.google.protobuf.Duration value) { + if (streamWaitTimeBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0) + && streamWaitTime_ != null + && streamWaitTime_ != com.google.protobuf.Duration.getDefaultInstance()) { + getStreamWaitTimeBuilder().mergeFrom(value); + } else { + streamWaitTime_ = value; + } + } else { + streamWaitTimeBuilder_.mergeFrom(value); + } + if (streamWaitTime_ != null) { + bitField0_ |= 0x00000004; + onChanged(); + } + return this; + } + + /** + * + * + *
        +     * The wait time between each server streaming messages
        +     * 
        + * + * .google.protobuf.Duration stream_wait_time = 3; + */ + public Builder clearStreamWaitTime() { + bitField0_ = (bitField0_ & ~0x00000004); + streamWaitTime_ = null; + if (streamWaitTimeBuilder_ != null) { + streamWaitTimeBuilder_.dispose(); + streamWaitTimeBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
        +     * The wait time between each server streaming messages
        +     * 
        + * + * .google.protobuf.Duration stream_wait_time = 3; + */ + public com.google.protobuf.Duration.Builder getStreamWaitTimeBuilder() { + bitField0_ |= 0x00000004; + onChanged(); + return internalGetStreamWaitTimeFieldBuilder().getBuilder(); + } + + /** + * + * + *
        +     * The wait time between each server streaming messages
        +     * 
        + * + * .google.protobuf.Duration stream_wait_time = 3; + */ + public com.google.protobuf.DurationOrBuilder getStreamWaitTimeOrBuilder() { + if (streamWaitTimeBuilder_ != null) { + return streamWaitTimeBuilder_.getMessageOrBuilder(); + } else { + return streamWaitTime_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : streamWaitTime_; + } + } + + /** + * + * + *
        +     * The wait time between each server streaming messages
        +     * 
        + * + * .google.protobuf.Duration stream_wait_time = 3; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder> + internalGetStreamWaitTimeFieldBuilder() { + if (streamWaitTimeBuilder_ == null) { + streamWaitTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder>( + getStreamWaitTime(), getParentForChildren(), isClean()); + streamWaitTime_ = null; + } + return streamWaitTimeBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.showcase.v1beta1.ExpandRequest) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.ExpandRequest) + private static final com.google.showcase.v1beta1.ExpandRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.ExpandRequest(); + } + + public static com.google.showcase.v1beta1.ExpandRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ExpandRequest 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.showcase.v1beta1.ExpandRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ExpandRequestOrBuilder.java b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ExpandRequestOrBuilder.java new file mode 100644 index 0000000000..8e32d8b1fe --- /dev/null +++ b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ExpandRequestOrBuilder.java @@ -0,0 +1,128 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: schema/google/showcase/v1beta1/echo.proto +// Protobuf Java Version: 4.33.2 + +package com.google.showcase.v1beta1; + +@com.google.protobuf.Generated +public interface ExpandRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.ExpandRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
        +   * The content that will be split into words and returned on the stream.
        +   * 
        + * + * string content = 1; + * + * @return The content. + */ + java.lang.String getContent(); + + /** + * + * + *
        +   * The content that will be split into words and returned on the stream.
        +   * 
        + * + * string content = 1; + * + * @return The bytes for content. + */ + com.google.protobuf.ByteString getContentBytes(); + + /** + * + * + *
        +   * The error that is thrown after all words are sent on the stream.
        +   * 
        + * + * .google.rpc.Status error = 2; + * + * @return Whether the error field is set. + */ + boolean hasError(); + + /** + * + * + *
        +   * The error that is thrown after all words are sent on the stream.
        +   * 
        + * + * .google.rpc.Status error = 2; + * + * @return The error. + */ + com.google.rpc.Status getError(); + + /** + * + * + *
        +   * The error that is thrown after all words are sent on the stream.
        +   * 
        + * + * .google.rpc.Status error = 2; + */ + com.google.rpc.StatusOrBuilder getErrorOrBuilder(); + + /** + * + * + *
        +   * The wait time between each server streaming messages
        +   * 
        + * + * .google.protobuf.Duration stream_wait_time = 3; + * + * @return Whether the streamWaitTime field is set. + */ + boolean hasStreamWaitTime(); + + /** + * + * + *
        +   * The wait time between each server streaming messages
        +   * 
        + * + * .google.protobuf.Duration stream_wait_time = 3; + * + * @return The streamWaitTime. + */ + com.google.protobuf.Duration getStreamWaitTime(); + + /** + * + * + *
        +   * The wait time between each server streaming messages
        +   * 
        + * + * .google.protobuf.Duration stream_wait_time = 3; + */ + com.google.protobuf.DurationOrBuilder getStreamWaitTimeOrBuilder(); +} diff --git a/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/FailEchoWithDetailsRequest.java b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/FailEchoWithDetailsRequest.java new file mode 100644 index 0000000000..65416a5d38 --- /dev/null +++ b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/FailEchoWithDetailsRequest.java @@ -0,0 +1,604 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: schema/google/showcase/v1beta1/echo.proto +// Protobuf Java Version: 4.33.2 + +package com.google.showcase.v1beta1; + +/** + * + * + *
        + * The request message used for the FailEchoWithDetails method.
        + * 
        + * + * Protobuf type {@code google.showcase.v1beta1.FailEchoWithDetailsRequest} + */ +@com.google.protobuf.Generated +public final class FailEchoWithDetailsRequest extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.FailEchoWithDetailsRequest) + FailEchoWithDetailsRequestOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "FailEchoWithDetailsRequest"); + } + + // Use FailEchoWithDetailsRequest.newBuilder() to construct. + private FailEchoWithDetailsRequest(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private FailEchoWithDetailsRequest() { + message_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.EchoOuterClass + .internal_static_google_showcase_v1beta1_FailEchoWithDetailsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.EchoOuterClass + .internal_static_google_showcase_v1beta1_FailEchoWithDetailsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.FailEchoWithDetailsRequest.class, + com.google.showcase.v1beta1.FailEchoWithDetailsRequest.Builder.class); + } + + public static final int MESSAGE_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object message_ = ""; + + /** + * + * + *
        +   * Optional message to echo back in the PoetryError. If empty, a value will be
        +   * provided.
        +   * 
        + * + * string message = 1; + * + * @return The message. + */ + @java.lang.Override + public java.lang.String getMessage() { + java.lang.Object ref = message_; + 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(); + message_ = s; + return s; + } + } + + /** + * + * + *
        +   * Optional message to echo back in the PoetryError. If empty, a value will be
        +   * provided.
        +   * 
        + * + * string message = 1; + * + * @return The bytes for message. + */ + @java.lang.Override + public com.google.protobuf.ByteString getMessageBytes() { + java.lang.Object ref = message_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + message_ = 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.GeneratedMessage.isStringEmpty(message_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, message_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(message_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, message_); + } + 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.showcase.v1beta1.FailEchoWithDetailsRequest)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.FailEchoWithDetailsRequest other = + (com.google.showcase.v1beta1.FailEchoWithDetailsRequest) obj; + + if (!getMessage().equals(other.getMessage())) 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) + MESSAGE_FIELD_NUMBER; + hash = (53 * hash) + getMessage().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.showcase.v1beta1.FailEchoWithDetailsRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.FailEchoWithDetailsRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.FailEchoWithDetailsRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.FailEchoWithDetailsRequest 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.showcase.v1beta1.FailEchoWithDetailsRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.FailEchoWithDetailsRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.FailEchoWithDetailsRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.FailEchoWithDetailsRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.showcase.v1beta1.FailEchoWithDetailsRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.FailEchoWithDetailsRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.showcase.v1beta1.FailEchoWithDetailsRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.FailEchoWithDetailsRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.showcase.v1beta1.FailEchoWithDetailsRequest 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
        +   * The request message used for the FailEchoWithDetails method.
        +   * 
        + * + * Protobuf type {@code google.showcase.v1beta1.FailEchoWithDetailsRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.FailEchoWithDetailsRequest) + com.google.showcase.v1beta1.FailEchoWithDetailsRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.EchoOuterClass + .internal_static_google_showcase_v1beta1_FailEchoWithDetailsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.EchoOuterClass + .internal_static_google_showcase_v1beta1_FailEchoWithDetailsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.FailEchoWithDetailsRequest.class, + com.google.showcase.v1beta1.FailEchoWithDetailsRequest.Builder.class); + } + + // Construct using com.google.showcase.v1beta1.FailEchoWithDetailsRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + message_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.showcase.v1beta1.EchoOuterClass + .internal_static_google_showcase_v1beta1_FailEchoWithDetailsRequest_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.FailEchoWithDetailsRequest getDefaultInstanceForType() { + return com.google.showcase.v1beta1.FailEchoWithDetailsRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.FailEchoWithDetailsRequest build() { + com.google.showcase.v1beta1.FailEchoWithDetailsRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.FailEchoWithDetailsRequest buildPartial() { + com.google.showcase.v1beta1.FailEchoWithDetailsRequest result = + new com.google.showcase.v1beta1.FailEchoWithDetailsRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.showcase.v1beta1.FailEchoWithDetailsRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.message_ = message_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.showcase.v1beta1.FailEchoWithDetailsRequest) { + return mergeFrom((com.google.showcase.v1beta1.FailEchoWithDetailsRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.showcase.v1beta1.FailEchoWithDetailsRequest other) { + if (other == com.google.showcase.v1beta1.FailEchoWithDetailsRequest.getDefaultInstance()) + return this; + if (!other.getMessage().isEmpty()) { + message_ = other.message_; + 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: + { + message_ = 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 message_ = ""; + + /** + * + * + *
        +     * Optional message to echo back in the PoetryError. If empty, a value will be
        +     * provided.
        +     * 
        + * + * string message = 1; + * + * @return The message. + */ + public java.lang.String getMessage() { + java.lang.Object ref = message_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + message_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
        +     * Optional message to echo back in the PoetryError. If empty, a value will be
        +     * provided.
        +     * 
        + * + * string message = 1; + * + * @return The bytes for message. + */ + public com.google.protobuf.ByteString getMessageBytes() { + java.lang.Object ref = message_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + message_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
        +     * Optional message to echo back in the PoetryError. If empty, a value will be
        +     * provided.
        +     * 
        + * + * string message = 1; + * + * @param value The message to set. + * @return This builder for chaining. + */ + public Builder setMessage(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + message_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
        +     * Optional message to echo back in the PoetryError. If empty, a value will be
        +     * provided.
        +     * 
        + * + * string message = 1; + * + * @return This builder for chaining. + */ + public Builder clearMessage() { + message_ = getDefaultInstance().getMessage(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
        +     * Optional message to echo back in the PoetryError. If empty, a value will be
        +     * provided.
        +     * 
        + * + * string message = 1; + * + * @param value The bytes for message to set. + * @return This builder for chaining. + */ + public Builder setMessageBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + message_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.showcase.v1beta1.FailEchoWithDetailsRequest) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.FailEchoWithDetailsRequest) + private static final com.google.showcase.v1beta1.FailEchoWithDetailsRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.FailEchoWithDetailsRequest(); + } + + public static com.google.showcase.v1beta1.FailEchoWithDetailsRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public FailEchoWithDetailsRequest 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.showcase.v1beta1.FailEchoWithDetailsRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/FailEchoWithDetailsRequestOrBuilder.java b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/FailEchoWithDetailsRequestOrBuilder.java new file mode 100644 index 0000000000..add2088403 --- /dev/null +++ b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/FailEchoWithDetailsRequestOrBuilder.java @@ -0,0 +1,56 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: schema/google/showcase/v1beta1/echo.proto +// Protobuf Java Version: 4.33.2 + +package com.google.showcase.v1beta1; + +@com.google.protobuf.Generated +public interface FailEchoWithDetailsRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.FailEchoWithDetailsRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
        +   * Optional message to echo back in the PoetryError. If empty, a value will be
        +   * provided.
        +   * 
        + * + * string message = 1; + * + * @return The message. + */ + java.lang.String getMessage(); + + /** + * + * + *
        +   * Optional message to echo back in the PoetryError. If empty, a value will be
        +   * provided.
        +   * 
        + * + * string message = 1; + * + * @return The bytes for message. + */ + com.google.protobuf.ByteString getMessageBytes(); +} diff --git a/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/FailEchoWithDetailsResponse.java b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/FailEchoWithDetailsResponse.java new file mode 100644 index 0000000000..c09c7e137f --- /dev/null +++ b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/FailEchoWithDetailsResponse.java @@ -0,0 +1,399 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: schema/google/showcase/v1beta1/echo.proto +// Protobuf Java Version: 4.33.2 + +package com.google.showcase.v1beta1; + +/** + * + * + *
        + * The response message declared (but never used) for the FailEchoWithDetails
        + * method.
        + * 
        + * + * Protobuf type {@code google.showcase.v1beta1.FailEchoWithDetailsResponse} + */ +@com.google.protobuf.Generated +public final class FailEchoWithDetailsResponse extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.FailEchoWithDetailsResponse) + FailEchoWithDetailsResponseOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "FailEchoWithDetailsResponse"); + } + + // Use FailEchoWithDetailsResponse.newBuilder() to construct. + private FailEchoWithDetailsResponse(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private FailEchoWithDetailsResponse() {} + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.EchoOuterClass + .internal_static_google_showcase_v1beta1_FailEchoWithDetailsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.EchoOuterClass + .internal_static_google_showcase_v1beta1_FailEchoWithDetailsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.FailEchoWithDetailsResponse.class, + com.google.showcase.v1beta1.FailEchoWithDetailsResponse.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.showcase.v1beta1.FailEchoWithDetailsResponse)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.FailEchoWithDetailsResponse other = + (com.google.showcase.v1beta1.FailEchoWithDetailsResponse) 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.showcase.v1beta1.FailEchoWithDetailsResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.FailEchoWithDetailsResponse parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.FailEchoWithDetailsResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.FailEchoWithDetailsResponse 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.showcase.v1beta1.FailEchoWithDetailsResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.FailEchoWithDetailsResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.FailEchoWithDetailsResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.FailEchoWithDetailsResponse parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.showcase.v1beta1.FailEchoWithDetailsResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.FailEchoWithDetailsResponse parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.showcase.v1beta1.FailEchoWithDetailsResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.FailEchoWithDetailsResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.showcase.v1beta1.FailEchoWithDetailsResponse 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
        +   * The response message declared (but never used) for the FailEchoWithDetails
        +   * method.
        +   * 
        + * + * Protobuf type {@code google.showcase.v1beta1.FailEchoWithDetailsResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.FailEchoWithDetailsResponse) + com.google.showcase.v1beta1.FailEchoWithDetailsResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.EchoOuterClass + .internal_static_google_showcase_v1beta1_FailEchoWithDetailsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.EchoOuterClass + .internal_static_google_showcase_v1beta1_FailEchoWithDetailsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.FailEchoWithDetailsResponse.class, + com.google.showcase.v1beta1.FailEchoWithDetailsResponse.Builder.class); + } + + // Construct using com.google.showcase.v1beta1.FailEchoWithDetailsResponse.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.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.showcase.v1beta1.EchoOuterClass + .internal_static_google_showcase_v1beta1_FailEchoWithDetailsResponse_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.FailEchoWithDetailsResponse getDefaultInstanceForType() { + return com.google.showcase.v1beta1.FailEchoWithDetailsResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.FailEchoWithDetailsResponse build() { + com.google.showcase.v1beta1.FailEchoWithDetailsResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.FailEchoWithDetailsResponse buildPartial() { + com.google.showcase.v1beta1.FailEchoWithDetailsResponse result = + new com.google.showcase.v1beta1.FailEchoWithDetailsResponse(this); + onBuilt(); + return result; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.showcase.v1beta1.FailEchoWithDetailsResponse) { + return mergeFrom((com.google.showcase.v1beta1.FailEchoWithDetailsResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.showcase.v1beta1.FailEchoWithDetailsResponse other) { + if (other == com.google.showcase.v1beta1.FailEchoWithDetailsResponse.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; + } + + // @@protoc_insertion_point(builder_scope:google.showcase.v1beta1.FailEchoWithDetailsResponse) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.FailEchoWithDetailsResponse) + private static final com.google.showcase.v1beta1.FailEchoWithDetailsResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.FailEchoWithDetailsResponse(); + } + + public static com.google.showcase.v1beta1.FailEchoWithDetailsResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public FailEchoWithDetailsResponse 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.showcase.v1beta1.FailEchoWithDetailsResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/FailEchoWithDetailsResponseOrBuilder.java b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/FailEchoWithDetailsResponseOrBuilder.java new file mode 100644 index 0000000000..f75dde5899 --- /dev/null +++ b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/FailEchoWithDetailsResponseOrBuilder.java @@ -0,0 +1,27 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: schema/google/showcase/v1beta1/echo.proto +// Protobuf Java Version: 4.33.2 + +package com.google.showcase.v1beta1; + +@com.google.protobuf.Generated +public interface FailEchoWithDetailsResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.FailEchoWithDetailsResponse) + com.google.protobuf.MessageOrBuilder {} diff --git a/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/GetBlurbRequest.java b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/GetBlurbRequest.java new file mode 100644 index 0000000000..3d80ed3648 --- /dev/null +++ b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/GetBlurbRequest.java @@ -0,0 +1,611 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: schema/google/showcase/v1beta1/messaging.proto +// Protobuf Java Version: 4.33.2 + +package com.google.showcase.v1beta1; + +/** + * + * + *
        + * The request message for the google.showcase.v1beta1.Messaging\GetBlurb
        + * method.
        + * 
        + * + * Protobuf type {@code google.showcase.v1beta1.GetBlurbRequest} + */ +@com.google.protobuf.Generated +public final class GetBlurbRequest extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.GetBlurbRequest) + GetBlurbRequestOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "GetBlurbRequest"); + } + + // Use GetBlurbRequest.newBuilder() to construct. + private GetBlurbRequest(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private GetBlurbRequest() { + name_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.MessagingOuterClass + .internal_static_google_showcase_v1beta1_GetBlurbRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.MessagingOuterClass + .internal_static_google_showcase_v1beta1_GetBlurbRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.GetBlurbRequest.class, + com.google.showcase.v1beta1.GetBlurbRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + + /** + * + * + *
        +   * The resource name of the requested blurb.
        +   * 
        + * + * + * 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; + } + } + + /** + * + * + *
        +   * The resource name of the requested blurb.
        +   * 
        + * + * + * 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.GeneratedMessage.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessage.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.GeneratedMessage.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessage.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.showcase.v1beta1.GetBlurbRequest)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.GetBlurbRequest other = + (com.google.showcase.v1beta1.GetBlurbRequest) 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.showcase.v1beta1.GetBlurbRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.GetBlurbRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.GetBlurbRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.GetBlurbRequest 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.showcase.v1beta1.GetBlurbRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.GetBlurbRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.GetBlurbRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.GetBlurbRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.showcase.v1beta1.GetBlurbRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.GetBlurbRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.showcase.v1beta1.GetBlurbRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.GetBlurbRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.showcase.v1beta1.GetBlurbRequest 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
        +   * The request message for the google.showcase.v1beta1.Messaging\GetBlurb
        +   * method.
        +   * 
        + * + * Protobuf type {@code google.showcase.v1beta1.GetBlurbRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.GetBlurbRequest) + com.google.showcase.v1beta1.GetBlurbRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.MessagingOuterClass + .internal_static_google_showcase_v1beta1_GetBlurbRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.MessagingOuterClass + .internal_static_google_showcase_v1beta1_GetBlurbRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.GetBlurbRequest.class, + com.google.showcase.v1beta1.GetBlurbRequest.Builder.class); + } + + // Construct using com.google.showcase.v1beta1.GetBlurbRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.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.showcase.v1beta1.MessagingOuterClass + .internal_static_google_showcase_v1beta1_GetBlurbRequest_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.GetBlurbRequest getDefaultInstanceForType() { + return com.google.showcase.v1beta1.GetBlurbRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.GetBlurbRequest build() { + com.google.showcase.v1beta1.GetBlurbRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.GetBlurbRequest buildPartial() { + com.google.showcase.v1beta1.GetBlurbRequest result = + new com.google.showcase.v1beta1.GetBlurbRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.showcase.v1beta1.GetBlurbRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.showcase.v1beta1.GetBlurbRequest) { + return mergeFrom((com.google.showcase.v1beta1.GetBlurbRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.showcase.v1beta1.GetBlurbRequest other) { + if (other == com.google.showcase.v1beta1.GetBlurbRequest.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_ = ""; + + /** + * + * + *
        +     * The resource name of the requested blurb.
        +     * 
        + * + * + * 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; + } + } + + /** + * + * + *
        +     * The resource name of the requested blurb.
        +     * 
        + * + * + * 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; + } + } + + /** + * + * + *
        +     * The resource name of the requested blurb.
        +     * 
        + * + * + * 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; + } + + /** + * + * + *
        +     * The resource name of the requested blurb.
        +     * 
        + * + * + * 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; + } + + /** + * + * + *
        +     * The resource name of the requested blurb.
        +     * 
        + * + * + * 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; + } + + // @@protoc_insertion_point(builder_scope:google.showcase.v1beta1.GetBlurbRequest) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.GetBlurbRequest) + private static final com.google.showcase.v1beta1.GetBlurbRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.GetBlurbRequest(); + } + + public static com.google.showcase.v1beta1.GetBlurbRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GetBlurbRequest 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.showcase.v1beta1.GetBlurbRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/GetBlurbRequestOrBuilder.java b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/GetBlurbRequestOrBuilder.java new file mode 100644 index 0000000000..c6e31c065c --- /dev/null +++ b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/GetBlurbRequestOrBuilder.java @@ -0,0 +1,58 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: schema/google/showcase/v1beta1/messaging.proto +// Protobuf Java Version: 4.33.2 + +package com.google.showcase.v1beta1; + +@com.google.protobuf.Generated +public interface GetBlurbRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.GetBlurbRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
        +   * The resource name of the requested blurb.
        +   * 
        + * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + + /** + * + * + *
        +   * The resource name of the requested blurb.
        +   * 
        + * + * + * 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-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/GetRoomRequest.java b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/GetRoomRequest.java new file mode 100644 index 0000000000..72d7f496c6 --- /dev/null +++ b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/GetRoomRequest.java @@ -0,0 +1,611 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: schema/google/showcase/v1beta1/messaging.proto +// Protobuf Java Version: 4.33.2 + +package com.google.showcase.v1beta1; + +/** + * + * + *
        + * The request message for the google.showcase.v1beta1.Messaging\GetRoom
        + * method.
        + * 
        + * + * Protobuf type {@code google.showcase.v1beta1.GetRoomRequest} + */ +@com.google.protobuf.Generated +public final class GetRoomRequest extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.GetRoomRequest) + GetRoomRequestOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "GetRoomRequest"); + } + + // Use GetRoomRequest.newBuilder() to construct. + private GetRoomRequest(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private GetRoomRequest() { + name_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.MessagingOuterClass + .internal_static_google_showcase_v1beta1_GetRoomRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.MessagingOuterClass + .internal_static_google_showcase_v1beta1_GetRoomRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.GetRoomRequest.class, + com.google.showcase.v1beta1.GetRoomRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + + /** + * + * + *
        +   * The resource name of the requested room.
        +   * 
        + * + * + * 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; + } + } + + /** + * + * + *
        +   * The resource name of the requested room.
        +   * 
        + * + * + * 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.GeneratedMessage.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessage.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.GeneratedMessage.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessage.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.showcase.v1beta1.GetRoomRequest)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.GetRoomRequest other = + (com.google.showcase.v1beta1.GetRoomRequest) 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.showcase.v1beta1.GetRoomRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.GetRoomRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.GetRoomRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.GetRoomRequest 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.showcase.v1beta1.GetRoomRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.GetRoomRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.GetRoomRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.GetRoomRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.showcase.v1beta1.GetRoomRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.GetRoomRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.showcase.v1beta1.GetRoomRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.GetRoomRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.showcase.v1beta1.GetRoomRequest 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
        +   * The request message for the google.showcase.v1beta1.Messaging\GetRoom
        +   * method.
        +   * 
        + * + * Protobuf type {@code google.showcase.v1beta1.GetRoomRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.GetRoomRequest) + com.google.showcase.v1beta1.GetRoomRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.MessagingOuterClass + .internal_static_google_showcase_v1beta1_GetRoomRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.MessagingOuterClass + .internal_static_google_showcase_v1beta1_GetRoomRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.GetRoomRequest.class, + com.google.showcase.v1beta1.GetRoomRequest.Builder.class); + } + + // Construct using com.google.showcase.v1beta1.GetRoomRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.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.showcase.v1beta1.MessagingOuterClass + .internal_static_google_showcase_v1beta1_GetRoomRequest_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.GetRoomRequest getDefaultInstanceForType() { + return com.google.showcase.v1beta1.GetRoomRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.GetRoomRequest build() { + com.google.showcase.v1beta1.GetRoomRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.GetRoomRequest buildPartial() { + com.google.showcase.v1beta1.GetRoomRequest result = + new com.google.showcase.v1beta1.GetRoomRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.showcase.v1beta1.GetRoomRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.showcase.v1beta1.GetRoomRequest) { + return mergeFrom((com.google.showcase.v1beta1.GetRoomRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.showcase.v1beta1.GetRoomRequest other) { + if (other == com.google.showcase.v1beta1.GetRoomRequest.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_ = ""; + + /** + * + * + *
        +     * The resource name of the requested room.
        +     * 
        + * + * + * 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; + } + } + + /** + * + * + *
        +     * The resource name of the requested room.
        +     * 
        + * + * + * 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; + } + } + + /** + * + * + *
        +     * The resource name of the requested room.
        +     * 
        + * + * + * 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; + } + + /** + * + * + *
        +     * The resource name of the requested room.
        +     * 
        + * + * + * 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; + } + + /** + * + * + *
        +     * The resource name of the requested room.
        +     * 
        + * + * + * 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; + } + + // @@protoc_insertion_point(builder_scope:google.showcase.v1beta1.GetRoomRequest) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.GetRoomRequest) + private static final com.google.showcase.v1beta1.GetRoomRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.GetRoomRequest(); + } + + public static com.google.showcase.v1beta1.GetRoomRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GetRoomRequest 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.showcase.v1beta1.GetRoomRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/GetRoomRequestOrBuilder.java b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/GetRoomRequestOrBuilder.java new file mode 100644 index 0000000000..f7fcd849f1 --- /dev/null +++ b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/GetRoomRequestOrBuilder.java @@ -0,0 +1,58 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: schema/google/showcase/v1beta1/messaging.proto +// Protobuf Java Version: 4.33.2 + +package com.google.showcase.v1beta1; + +@com.google.protobuf.Generated +public interface GetRoomRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.GetRoomRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
        +   * The resource name of the requested room.
        +   * 
        + * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + + /** + * + * + *
        +   * The resource name of the requested room.
        +   * 
        + * + * + * 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-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/GetSequenceReportRequest.java b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/GetSequenceReportRequest.java new file mode 100644 index 0000000000..3fb290d1d8 --- /dev/null +++ b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/GetSequenceReportRequest.java @@ -0,0 +1,552 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: schema/google/showcase/v1beta1/sequence.proto +// Protobuf Java Version: 4.33.2 + +package com.google.showcase.v1beta1; + +/** Protobuf type {@code google.showcase.v1beta1.GetSequenceReportRequest} */ +@com.google.protobuf.Generated +public final class GetSequenceReportRequest extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.GetSequenceReportRequest) + GetSequenceReportRequestOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "GetSequenceReportRequest"); + } + + // Use GetSequenceReportRequest.newBuilder() to construct. + private GetSequenceReportRequest(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private GetSequenceReportRequest() { + name_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.SequenceOuterClass + .internal_static_google_showcase_v1beta1_GetSequenceReportRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.SequenceOuterClass + .internal_static_google_showcase_v1beta1_GetSequenceReportRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.GetSequenceReportRequest.class, + com.google.showcase.v1beta1.GetSequenceReportRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + + /** + * + * 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; + } + } + + /** + * + * 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.GeneratedMessage.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessage.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.GeneratedMessage.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessage.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.showcase.v1beta1.GetSequenceReportRequest)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.GetSequenceReportRequest other = + (com.google.showcase.v1beta1.GetSequenceReportRequest) 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.showcase.v1beta1.GetSequenceReportRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.GetSequenceReportRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.GetSequenceReportRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.GetSequenceReportRequest 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.showcase.v1beta1.GetSequenceReportRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.GetSequenceReportRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.GetSequenceReportRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.GetSequenceReportRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.showcase.v1beta1.GetSequenceReportRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.GetSequenceReportRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.showcase.v1beta1.GetSequenceReportRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.GetSequenceReportRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.showcase.v1beta1.GetSequenceReportRequest 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** Protobuf type {@code google.showcase.v1beta1.GetSequenceReportRequest} */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.GetSequenceReportRequest) + com.google.showcase.v1beta1.GetSequenceReportRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.SequenceOuterClass + .internal_static_google_showcase_v1beta1_GetSequenceReportRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.SequenceOuterClass + .internal_static_google_showcase_v1beta1_GetSequenceReportRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.GetSequenceReportRequest.class, + com.google.showcase.v1beta1.GetSequenceReportRequest.Builder.class); + } + + // Construct using com.google.showcase.v1beta1.GetSequenceReportRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.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.showcase.v1beta1.SequenceOuterClass + .internal_static_google_showcase_v1beta1_GetSequenceReportRequest_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.GetSequenceReportRequest getDefaultInstanceForType() { + return com.google.showcase.v1beta1.GetSequenceReportRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.GetSequenceReportRequest build() { + com.google.showcase.v1beta1.GetSequenceReportRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.GetSequenceReportRequest buildPartial() { + com.google.showcase.v1beta1.GetSequenceReportRequest result = + new com.google.showcase.v1beta1.GetSequenceReportRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.showcase.v1beta1.GetSequenceReportRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.showcase.v1beta1.GetSequenceReportRequest) { + return mergeFrom((com.google.showcase.v1beta1.GetSequenceReportRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.showcase.v1beta1.GetSequenceReportRequest other) { + if (other == com.google.showcase.v1beta1.GetSequenceReportRequest.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_ = ""; + + /** + * + * 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; + } + } + + /** + * + * 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; + } + } + + /** + * + * 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; + } + + /** + * + * 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; + } + + /** + * + * 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; + } + + // @@protoc_insertion_point(builder_scope:google.showcase.v1beta1.GetSequenceReportRequest) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.GetSequenceReportRequest) + private static final com.google.showcase.v1beta1.GetSequenceReportRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.GetSequenceReportRequest(); + } + + public static com.google.showcase.v1beta1.GetSequenceReportRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GetSequenceReportRequest 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.showcase.v1beta1.GetSequenceReportRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/GetSequenceReportRequestOrBuilder.java b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/GetSequenceReportRequestOrBuilder.java new file mode 100644 index 0000000000..589fac4cf1 --- /dev/null +++ b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/GetSequenceReportRequestOrBuilder.java @@ -0,0 +1,46 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: schema/google/showcase/v1beta1/sequence.proto +// Protobuf Java Version: 4.33.2 + +package com.google.showcase.v1beta1; + +@com.google.protobuf.Generated +public interface GetSequenceReportRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.GetSequenceReportRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + + /** + * + * 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-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/GetSessionRequest.java b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/GetSessionRequest.java new file mode 100644 index 0000000000..13a9396b15 --- /dev/null +++ b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/GetSessionRequest.java @@ -0,0 +1,595 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: schema/google/showcase/v1beta1/testing.proto +// Protobuf Java Version: 4.33.2 + +package com.google.showcase.v1beta1; + +/** + * + * + *
        + * The request for the GetSession method.
        + * 
        + * + * Protobuf type {@code google.showcase.v1beta1.GetSessionRequest} + */ +@com.google.protobuf.Generated +public final class GetSessionRequest extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.GetSessionRequest) + GetSessionRequestOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "GetSessionRequest"); + } + + // Use GetSessionRequest.newBuilder() to construct. + private GetSessionRequest(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private GetSessionRequest() { + name_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.TestingOuterClass + .internal_static_google_showcase_v1beta1_GetSessionRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.TestingOuterClass + .internal_static_google_showcase_v1beta1_GetSessionRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.GetSessionRequest.class, + com.google.showcase.v1beta1.GetSessionRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + + /** + * + * + *
        +   * The session to be retrieved.
        +   * 
        + * + * string name = 1 [(.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; + } + } + + /** + * + * + *
        +   * The session to be retrieved.
        +   * 
        + * + * string name = 1 [(.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.GeneratedMessage.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessage.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.GeneratedMessage.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessage.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.showcase.v1beta1.GetSessionRequest)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.GetSessionRequest other = + (com.google.showcase.v1beta1.GetSessionRequest) 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.showcase.v1beta1.GetSessionRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.GetSessionRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.GetSessionRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.GetSessionRequest 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.showcase.v1beta1.GetSessionRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.GetSessionRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.GetSessionRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.GetSessionRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.showcase.v1beta1.GetSessionRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.GetSessionRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.showcase.v1beta1.GetSessionRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.GetSessionRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.showcase.v1beta1.GetSessionRequest 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
        +   * The request for the GetSession method.
        +   * 
        + * + * Protobuf type {@code google.showcase.v1beta1.GetSessionRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.GetSessionRequest) + com.google.showcase.v1beta1.GetSessionRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.TestingOuterClass + .internal_static_google_showcase_v1beta1_GetSessionRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.TestingOuterClass + .internal_static_google_showcase_v1beta1_GetSessionRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.GetSessionRequest.class, + com.google.showcase.v1beta1.GetSessionRequest.Builder.class); + } + + // Construct using com.google.showcase.v1beta1.GetSessionRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.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.showcase.v1beta1.TestingOuterClass + .internal_static_google_showcase_v1beta1_GetSessionRequest_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.GetSessionRequest getDefaultInstanceForType() { + return com.google.showcase.v1beta1.GetSessionRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.GetSessionRequest build() { + com.google.showcase.v1beta1.GetSessionRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.GetSessionRequest buildPartial() { + com.google.showcase.v1beta1.GetSessionRequest result = + new com.google.showcase.v1beta1.GetSessionRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.showcase.v1beta1.GetSessionRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.showcase.v1beta1.GetSessionRequest) { + return mergeFrom((com.google.showcase.v1beta1.GetSessionRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.showcase.v1beta1.GetSessionRequest other) { + if (other == com.google.showcase.v1beta1.GetSessionRequest.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_ = ""; + + /** + * + * + *
        +     * The session to be retrieved.
        +     * 
        + * + * string name = 1 [(.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; + } + } + + /** + * + * + *
        +     * The session to be retrieved.
        +     * 
        + * + * string name = 1 [(.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; + } + } + + /** + * + * + *
        +     * The session to be retrieved.
        +     * 
        + * + * string name = 1 [(.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; + } + + /** + * + * + *
        +     * The session to be retrieved.
        +     * 
        + * + * string name = 1 [(.google.api.resource_reference) = { ... } + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
        +     * The session to be retrieved.
        +     * 
        + * + * string name = 1 [(.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; + } + + // @@protoc_insertion_point(builder_scope:google.showcase.v1beta1.GetSessionRequest) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.GetSessionRequest) + private static final com.google.showcase.v1beta1.GetSessionRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.GetSessionRequest(); + } + + public static com.google.showcase.v1beta1.GetSessionRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GetSessionRequest 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.showcase.v1beta1.GetSessionRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/GetSessionRequestOrBuilder.java b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/GetSessionRequestOrBuilder.java new file mode 100644 index 0000000000..35aa992060 --- /dev/null +++ b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/GetSessionRequestOrBuilder.java @@ -0,0 +1,54 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: schema/google/showcase/v1beta1/testing.proto +// Protobuf Java Version: 4.33.2 + +package com.google.showcase.v1beta1; + +@com.google.protobuf.Generated +public interface GetSessionRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.GetSessionRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
        +   * The session to be retrieved.
        +   * 
        + * + * string name = 1 [(.google.api.resource_reference) = { ... } + * + * @return The name. + */ + java.lang.String getName(); + + /** + * + * + *
        +   * The session to be retrieved.
        +   * 
        + * + * string name = 1 [(.google.api.resource_reference) = { ... } + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); +} diff --git a/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/GetStreamingSequenceReportRequest.java b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/GetStreamingSequenceReportRequest.java new file mode 100644 index 0000000000..cd964097b4 --- /dev/null +++ b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/GetStreamingSequenceReportRequest.java @@ -0,0 +1,558 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: schema/google/showcase/v1beta1/sequence.proto +// Protobuf Java Version: 4.33.2 + +package com.google.showcase.v1beta1; + +/** Protobuf type {@code google.showcase.v1beta1.GetStreamingSequenceReportRequest} */ +@com.google.protobuf.Generated +public final class GetStreamingSequenceReportRequest extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.GetStreamingSequenceReportRequest) + GetStreamingSequenceReportRequestOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "GetStreamingSequenceReportRequest"); + } + + // Use GetStreamingSequenceReportRequest.newBuilder() to construct. + private GetStreamingSequenceReportRequest( + com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private GetStreamingSequenceReportRequest() { + name_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.SequenceOuterClass + .internal_static_google_showcase_v1beta1_GetStreamingSequenceReportRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.SequenceOuterClass + .internal_static_google_showcase_v1beta1_GetStreamingSequenceReportRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.GetStreamingSequenceReportRequest.class, + com.google.showcase.v1beta1.GetStreamingSequenceReportRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + + /** + * + * 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; + } + } + + /** + * + * 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.GeneratedMessage.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessage.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.GeneratedMessage.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessage.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.showcase.v1beta1.GetStreamingSequenceReportRequest)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.GetStreamingSequenceReportRequest other = + (com.google.showcase.v1beta1.GetStreamingSequenceReportRequest) 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.showcase.v1beta1.GetStreamingSequenceReportRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.GetStreamingSequenceReportRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.GetStreamingSequenceReportRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.GetStreamingSequenceReportRequest 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.showcase.v1beta1.GetStreamingSequenceReportRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.GetStreamingSequenceReportRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.GetStreamingSequenceReportRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.GetStreamingSequenceReportRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.showcase.v1beta1.GetStreamingSequenceReportRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.GetStreamingSequenceReportRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.showcase.v1beta1.GetStreamingSequenceReportRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.GetStreamingSequenceReportRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.showcase.v1beta1.GetStreamingSequenceReportRequest 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** Protobuf type {@code google.showcase.v1beta1.GetStreamingSequenceReportRequest} */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.GetStreamingSequenceReportRequest) + com.google.showcase.v1beta1.GetStreamingSequenceReportRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.SequenceOuterClass + .internal_static_google_showcase_v1beta1_GetStreamingSequenceReportRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.SequenceOuterClass + .internal_static_google_showcase_v1beta1_GetStreamingSequenceReportRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.GetStreamingSequenceReportRequest.class, + com.google.showcase.v1beta1.GetStreamingSequenceReportRequest.Builder.class); + } + + // Construct using com.google.showcase.v1beta1.GetStreamingSequenceReportRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.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.showcase.v1beta1.SequenceOuterClass + .internal_static_google_showcase_v1beta1_GetStreamingSequenceReportRequest_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.GetStreamingSequenceReportRequest + getDefaultInstanceForType() { + return com.google.showcase.v1beta1.GetStreamingSequenceReportRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.GetStreamingSequenceReportRequest build() { + com.google.showcase.v1beta1.GetStreamingSequenceReportRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.GetStreamingSequenceReportRequest buildPartial() { + com.google.showcase.v1beta1.GetStreamingSequenceReportRequest result = + new com.google.showcase.v1beta1.GetStreamingSequenceReportRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.showcase.v1beta1.GetStreamingSequenceReportRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.showcase.v1beta1.GetStreamingSequenceReportRequest) { + return mergeFrom((com.google.showcase.v1beta1.GetStreamingSequenceReportRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.showcase.v1beta1.GetStreamingSequenceReportRequest other) { + if (other + == com.google.showcase.v1beta1.GetStreamingSequenceReportRequest.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_ = ""; + + /** + * + * 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; + } + } + + /** + * + * 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; + } + } + + /** + * + * 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; + } + + /** + * + * 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; + } + + /** + * + * 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; + } + + // @@protoc_insertion_point(builder_scope:google.showcase.v1beta1.GetStreamingSequenceReportRequest) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.GetStreamingSequenceReportRequest) + private static final com.google.showcase.v1beta1.GetStreamingSequenceReportRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.GetStreamingSequenceReportRequest(); + } + + public static com.google.showcase.v1beta1.GetStreamingSequenceReportRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GetStreamingSequenceReportRequest 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.showcase.v1beta1.GetStreamingSequenceReportRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/GetStreamingSequenceReportRequestOrBuilder.java b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/GetStreamingSequenceReportRequestOrBuilder.java new file mode 100644 index 0000000000..00f7730d25 --- /dev/null +++ b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/GetStreamingSequenceReportRequestOrBuilder.java @@ -0,0 +1,46 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: schema/google/showcase/v1beta1/sequence.proto +// Protobuf Java Version: 4.33.2 + +package com.google.showcase.v1beta1; + +@com.google.protobuf.Generated +public interface GetStreamingSequenceReportRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.GetStreamingSequenceReportRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + + /** + * + * 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-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/GetUserRequest.java b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/GetUserRequest.java new file mode 100644 index 0000000000..c2c1a9bc80 --- /dev/null +++ b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/GetUserRequest.java @@ -0,0 +1,611 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: schema/google/showcase/v1beta1/identity.proto +// Protobuf Java Version: 4.33.2 + +package com.google.showcase.v1beta1; + +/** + * + * + *
        + * The request message for the google.showcase.v1beta1.Identity\GetUser
        + * method.
        + * 
        + * + * Protobuf type {@code google.showcase.v1beta1.GetUserRequest} + */ +@com.google.protobuf.Generated +public final class GetUserRequest extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.GetUserRequest) + GetUserRequestOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "GetUserRequest"); + } + + // Use GetUserRequest.newBuilder() to construct. + private GetUserRequest(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private GetUserRequest() { + name_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.IdentityOuterClass + .internal_static_google_showcase_v1beta1_GetUserRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.IdentityOuterClass + .internal_static_google_showcase_v1beta1_GetUserRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.GetUserRequest.class, + com.google.showcase.v1beta1.GetUserRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + + /** + * + * + *
        +   * The resource name of the requested user.
        +   * 
        + * + * + * 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; + } + } + + /** + * + * + *
        +   * The resource name of the requested user.
        +   * 
        + * + * + * 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.GeneratedMessage.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessage.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.GeneratedMessage.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessage.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.showcase.v1beta1.GetUserRequest)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.GetUserRequest other = + (com.google.showcase.v1beta1.GetUserRequest) 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.showcase.v1beta1.GetUserRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.GetUserRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.GetUserRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.GetUserRequest 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.showcase.v1beta1.GetUserRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.GetUserRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.GetUserRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.GetUserRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.showcase.v1beta1.GetUserRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.GetUserRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.showcase.v1beta1.GetUserRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.GetUserRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.showcase.v1beta1.GetUserRequest 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
        +   * The request message for the google.showcase.v1beta1.Identity\GetUser
        +   * method.
        +   * 
        + * + * Protobuf type {@code google.showcase.v1beta1.GetUserRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.GetUserRequest) + com.google.showcase.v1beta1.GetUserRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.IdentityOuterClass + .internal_static_google_showcase_v1beta1_GetUserRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.IdentityOuterClass + .internal_static_google_showcase_v1beta1_GetUserRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.GetUserRequest.class, + com.google.showcase.v1beta1.GetUserRequest.Builder.class); + } + + // Construct using com.google.showcase.v1beta1.GetUserRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.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.showcase.v1beta1.IdentityOuterClass + .internal_static_google_showcase_v1beta1_GetUserRequest_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.GetUserRequest getDefaultInstanceForType() { + return com.google.showcase.v1beta1.GetUserRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.GetUserRequest build() { + com.google.showcase.v1beta1.GetUserRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.GetUserRequest buildPartial() { + com.google.showcase.v1beta1.GetUserRequest result = + new com.google.showcase.v1beta1.GetUserRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.showcase.v1beta1.GetUserRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.showcase.v1beta1.GetUserRequest) { + return mergeFrom((com.google.showcase.v1beta1.GetUserRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.showcase.v1beta1.GetUserRequest other) { + if (other == com.google.showcase.v1beta1.GetUserRequest.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_ = ""; + + /** + * + * + *
        +     * The resource name of the requested user.
        +     * 
        + * + * + * 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; + } + } + + /** + * + * + *
        +     * The resource name of the requested user.
        +     * 
        + * + * + * 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; + } + } + + /** + * + * + *
        +     * The resource name of the requested user.
        +     * 
        + * + * + * 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; + } + + /** + * + * + *
        +     * The resource name of the requested user.
        +     * 
        + * + * + * 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; + } + + /** + * + * + *
        +     * The resource name of the requested user.
        +     * 
        + * + * + * 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; + } + + // @@protoc_insertion_point(builder_scope:google.showcase.v1beta1.GetUserRequest) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.GetUserRequest) + private static final com.google.showcase.v1beta1.GetUserRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.GetUserRequest(); + } + + public static com.google.showcase.v1beta1.GetUserRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GetUserRequest 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.showcase.v1beta1.GetUserRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/GetUserRequestOrBuilder.java b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/GetUserRequestOrBuilder.java new file mode 100644 index 0000000000..5920809f31 --- /dev/null +++ b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/GetUserRequestOrBuilder.java @@ -0,0 +1,58 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: schema/google/showcase/v1beta1/identity.proto +// Protobuf Java Version: 4.33.2 + +package com.google.showcase.v1beta1; + +@com.google.protobuf.Generated +public interface GetUserRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.GetUserRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
        +   * The resource name of the requested user.
        +   * 
        + * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + + /** + * + * + *
        +   * The resource name of the requested user.
        +   * 
        + * + * + * 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-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/IdentityOuterClass.java b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/IdentityOuterClass.java new file mode 100644 index 0000000000..827227f23e --- /dev/null +++ b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/IdentityOuterClass.java @@ -0,0 +1,234 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: schema/google/showcase/v1beta1/identity.proto +// Protobuf Java Version: 4.33.2 + +package com.google.showcase.v1beta1; + +@com.google.protobuf.Generated +public final class IdentityOuterClass extends com.google.protobuf.GeneratedFile { + private IdentityOuterClass() {} + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "IdentityOuterClass"); + } + + 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_showcase_v1beta1_User_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_showcase_v1beta1_User_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_showcase_v1beta1_CreateUserRequest_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_showcase_v1beta1_CreateUserRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_showcase_v1beta1_GetUserRequest_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_showcase_v1beta1_GetUserRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_showcase_v1beta1_UpdateUserRequest_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_showcase_v1beta1_UpdateUserRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_showcase_v1beta1_DeleteUserRequest_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_showcase_v1beta1_DeleteUserRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_showcase_v1beta1_ListUsersRequest_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_showcase_v1beta1_ListUsersRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_showcase_v1beta1_ListUsersResponse_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_showcase_v1beta1_ListUsersResponse_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" + + "-schema/google/showcase/v1beta1/identit" + + "y.proto\022\027google.showcase.v1beta1\032\034google" + + "/api/annotations.proto\032\027google/api/clien" + + "t.proto\032\037google/api/field_behavior.proto" + + "\032\031google/api/resource.proto\032\033google/protobuf/empty.proto\032" + + " google/protobuf/field_mask.proto\032\037google/protobuf/timestamp.proto\"\204\003\n" + + "\004User\022\014\n" + + "\004name\030\001 \001(\t\022\031\n" + + "\014display_name\030\002 \001(\tB\003\340A\002\022\022\n" + + "\005email\030\003 \001(\tB\003\340A\002\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\020\n" + + "\003age\030\006 \001(\005H\000\210\001\001\022\030\n" + + "\013height_feet\030\007 \001(\001H\001\210\001\001\022\025\n" + + "\010nickname\030\010 \001(\tH\002\210\001\001\022!\n" + + "\024enable_notifications\030\t \001(\010H\003\210\001\001:/\352A,\n" + + "\034showcase.googleapis.com/User\022\014users/{user}B\006\n" + + "\004_ageB\016\n" + + "\014_height_feetB\013\n" + + "\t_nicknameB\027\n" + + "\025_enable_notifications\"@\n" + + "\021CreateUserRequest\022+\n" + + "\004user\030\001 \001(\0132\035.google.showcase.v1beta1.User\"D\n" + + "\016GetUserRequest\0222\n" + + "\004name\030\001 \001(\tB$\340A\002\372A\036\n" + + "\034showcase.googleapis.com/User\"q\n" + + "\021UpdateUserRequest\022+\n" + + "\004user\030\001 \001(\0132\035.google.showcase.v1beta1.User\022/\n" + + "\013update_mask\030\002 \001(\0132\032.google.protobuf.FieldMask\"G\n" + + "\021DeleteUserRequest\0222\n" + + "\004name\030\001 \001(\tB$\340A\002\372A\036\n" + + "\034showcase.googleapis.com/User\"9\n" + + "\020ListUsersRequest\022\021\n" + + "\tpage_size\030\001 \001(\005\022\022\n" + + "\n" + + "page_token\030\002 \001(\t\"Z\n" + + "\021ListUsersResponse\022,\n" + + "\005users\030\001 \003(\0132\035.google.showcase.v1beta1.User\022\027\n" + + "\017next_page_token\030\002 \001(\t2\212\006\n" + + "\010Identity\022\363\001\n\n" + + "CreateUser\022*.google.showcase.v1beta1.CreateUserRequest\032\035.google.showcase." + + "v1beta1.User\"\231\001\332A\034user.display_name,user" + + ".email\332A^user.display_name,user.email,user.age,user.nickname,user.enable_notific" + + "ations,user.height_feet\202\323\344\223\002\023\"\016/v1beta1/users:\001*\022y\n" + + "\007GetUser\022\'.google.showcase.v1beta1.GetUserRequest\032\035.google.showcase.v" + + "1beta1.User\"&\332A\004name\202\323\344\223\002\031\022\027/v1beta1/{name=users/*}\022\203\001\n\n" + + "UpdateUser\022*.google.showcase.v1beta1.UpdateUserRequest\032\035.google." + + "showcase.v1beta1.User\"*\202\323\344\223\002$2\034/v1beta1/{user.name=users/*}:\004user\022x\n\n" + + "DeleteUser\022*.google.showcase.v1beta1.DeleteUserRequ" + + "est\032\026.google.protobuf.Empty\"&\332A\004name\202\323\344\223\002\031*\027/v1beta1/{name=users/*}\022z\n" + + "\tListUsers\022).google.showcase.v1beta1.ListUsersRequ" + + "est\032*.google.showcase.v1beta1.ListUsersR" + + "esponse\"\026\202\323\344\223\002\020\022\016/v1beta1/users\032\021\312A\016localhost:7469Bq\n" + + "\033com.google.showcase.v1beta1P\001Z4github.com/googleapis/gapic-showcas" + + "e/server/genproto\352\002\031Google::Showcase::V1beta1b\006proto3" + }; + descriptor = + com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( + descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + com.google.api.AnnotationsProto.getDescriptor(), + com.google.api.ClientProto.getDescriptor(), + com.google.api.FieldBehaviorProto.getDescriptor(), + com.google.api.ResourceProto.getDescriptor(), + com.google.protobuf.EmptyProto.getDescriptor(), + com.google.protobuf.FieldMaskProto.getDescriptor(), + com.google.protobuf.TimestampProto.getDescriptor(), + }); + internal_static_google_showcase_v1beta1_User_descriptor = getDescriptor().getMessageType(0); + internal_static_google_showcase_v1beta1_User_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_showcase_v1beta1_User_descriptor, + new java.lang.String[] { + "Name", + "DisplayName", + "Email", + "CreateTime", + "UpdateTime", + "Age", + "HeightFeet", + "Nickname", + "EnableNotifications", + }); + internal_static_google_showcase_v1beta1_CreateUserRequest_descriptor = + getDescriptor().getMessageType(1); + internal_static_google_showcase_v1beta1_CreateUserRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_showcase_v1beta1_CreateUserRequest_descriptor, + new java.lang.String[] { + "User", + }); + internal_static_google_showcase_v1beta1_GetUserRequest_descriptor = + getDescriptor().getMessageType(2); + internal_static_google_showcase_v1beta1_GetUserRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_showcase_v1beta1_GetUserRequest_descriptor, + new java.lang.String[] { + "Name", + }); + internal_static_google_showcase_v1beta1_UpdateUserRequest_descriptor = + getDescriptor().getMessageType(3); + internal_static_google_showcase_v1beta1_UpdateUserRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_showcase_v1beta1_UpdateUserRequest_descriptor, + new java.lang.String[] { + "User", "UpdateMask", + }); + internal_static_google_showcase_v1beta1_DeleteUserRequest_descriptor = + getDescriptor().getMessageType(4); + internal_static_google_showcase_v1beta1_DeleteUserRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_showcase_v1beta1_DeleteUserRequest_descriptor, + new java.lang.String[] { + "Name", + }); + internal_static_google_showcase_v1beta1_ListUsersRequest_descriptor = + getDescriptor().getMessageType(5); + internal_static_google_showcase_v1beta1_ListUsersRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_showcase_v1beta1_ListUsersRequest_descriptor, + new java.lang.String[] { + "PageSize", "PageToken", + }); + internal_static_google_showcase_v1beta1_ListUsersResponse_descriptor = + getDescriptor().getMessageType(6); + internal_static_google_showcase_v1beta1_ListUsersResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_showcase_v1beta1_ListUsersResponse_descriptor, + new java.lang.String[] { + "Users", "NextPageToken", + }); + descriptor.resolveAllFeaturesImmutable(); + com.google.api.AnnotationsProto.getDescriptor(); + com.google.api.ClientProto.getDescriptor(); + com.google.api.FieldBehaviorProto.getDescriptor(); + com.google.api.ResourceProto.getDescriptor(); + com.google.protobuf.EmptyProto.getDescriptor(); + com.google.protobuf.FieldMaskProto.getDescriptor(); + com.google.protobuf.TimestampProto.getDescriptor(); + 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.ResourceProto.resource); + registry.add(com.google.api.ResourceProto.resourceReference); + com.google.protobuf.Descriptors.FileDescriptor.internalUpdateFileDescriptor( + descriptor, registry); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/Issue.java b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/Issue.java new file mode 100644 index 0000000000..6afc6eb0cf --- /dev/null +++ b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/Issue.java @@ -0,0 +1,1233 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: schema/google/showcase/v1beta1/testing.proto +// Protobuf Java Version: 4.33.2 + +package com.google.showcase.v1beta1; + +/** + * + * + *
        + * An issue found in the test.
        + * 
        + * + * Protobuf type {@code google.showcase.v1beta1.Issue} + */ +@com.google.protobuf.Generated +public final class Issue extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.Issue) + IssueOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "Issue"); + } + + // Use Issue.newBuilder() to construct. + private Issue(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private Issue() { + type_ = 0; + severity_ = 0; + description_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.TestingOuterClass + .internal_static_google_showcase_v1beta1_Issue_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.TestingOuterClass + .internal_static_google_showcase_v1beta1_Issue_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.Issue.class, + com.google.showcase.v1beta1.Issue.Builder.class); + } + + /** + * + * + *
        +   * The different potential types of issues.
        +   * 
        + * + * Protobuf enum {@code google.showcase.v1beta1.Issue.Type} + */ + public enum Type implements com.google.protobuf.ProtocolMessageEnum { + /** TYPE_UNSPECIFIED = 0; */ + TYPE_UNSPECIFIED(0), + /** + * + * + *
        +     * The test was never instrumented.
        +     * 
        + * + * SKIPPED = 1; + */ + SKIPPED(1), + /** + * + * + *
        +     * The test was started but never confirmed.
        +     * 
        + * + * PENDING = 2; + */ + PENDING(2), + /** + * + * + *
        +     * The test was instrumented, but Showcase got an unexpected
        +     * value when the generator tried to confirm success.
        +     * 
        + * + * INCORRECT_CONFIRMATION = 3; + */ + INCORRECT_CONFIRMATION(3), + UNRECOGNIZED(-1), + ; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "Type"); + } + + /** TYPE_UNSPECIFIED = 0; */ + public static final int TYPE_UNSPECIFIED_VALUE = 0; + + /** + * + * + *
        +     * The test was never instrumented.
        +     * 
        + * + * SKIPPED = 1; + */ + public static final int SKIPPED_VALUE = 1; + + /** + * + * + *
        +     * The test was started but never confirmed.
        +     * 
        + * + * PENDING = 2; + */ + public static final int PENDING_VALUE = 2; + + /** + * + * + *
        +     * The test was instrumented, but Showcase got an unexpected
        +     * value when the generator tried to confirm success.
        +     * 
        + * + * INCORRECT_CONFIRMATION = 3; + */ + public static final int INCORRECT_CONFIRMATION_VALUE = 3; + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static Type valueOf(int value) { + return forNumber(value); + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + */ + public static Type forNumber(int value) { + switch (value) { + case 0: + return TYPE_UNSPECIFIED; + case 1: + return SKIPPED; + case 2: + return PENDING; + case 3: + return INCORRECT_CONFIRMATION; + default: + return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap internalGetValueMap() { + return internalValueMap; + } + + private static final com.google.protobuf.Internal.EnumLiteMap internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public Type findValueByNumber(int number) { + return Type.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { + 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 com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.showcase.v1beta1.Issue.getDescriptor().getEnumTypes().get(0); + } + + private static final Type[] VALUES = values(); + + public static Type valueOf(com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException("EnumValueDescriptor is not for this type."); + } + if (desc.getIndex() == -1) { + return UNRECOGNIZED; + } + return VALUES[desc.getIndex()]; + } + + private final int value; + + private Type(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.showcase.v1beta1.Issue.Type) + } + + /** + * + * + *
        +   * Severity levels.
        +   * 
        + * + * Protobuf enum {@code google.showcase.v1beta1.Issue.Severity} + */ + public enum Severity implements com.google.protobuf.ProtocolMessageEnum { + /** SEVERITY_UNSPECIFIED = 0; */ + SEVERITY_UNSPECIFIED(0), + /** + * + * + *
        +     * Errors.
        +     * 
        + * + * ERROR = 1; + */ + ERROR(1), + /** + * + * + *
        +     * Warnings.
        +     * 
        + * + * WARNING = 2; + */ + WARNING(2), + UNRECOGNIZED(-1), + ; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "Severity"); + } + + /** SEVERITY_UNSPECIFIED = 0; */ + public static final int SEVERITY_UNSPECIFIED_VALUE = 0; + + /** + * + * + *
        +     * Errors.
        +     * 
        + * + * ERROR = 1; + */ + public static final int ERROR_VALUE = 1; + + /** + * + * + *
        +     * Warnings.
        +     * 
        + * + * WARNING = 2; + */ + public static final int WARNING_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 Severity 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 Severity forNumber(int value) { + switch (value) { + case 0: + return SEVERITY_UNSPECIFIED; + case 1: + return ERROR; + case 2: + return WARNING; + 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 Severity findValueByNumber(int number) { + return Severity.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 com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.showcase.v1beta1.Issue.getDescriptor().getEnumTypes().get(1); + } + + private static final Severity[] VALUES = values(); + + public static Severity 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 Severity(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.showcase.v1beta1.Issue.Severity) + } + + public static final int TYPE_FIELD_NUMBER = 1; + private int type_ = 0; + + /** + * + * + *
        +   * The type of the issue.
        +   * 
        + * + * .google.showcase.v1beta1.Issue.Type type = 1; + * + * @return The enum numeric value on the wire for type. + */ + @java.lang.Override + public int getTypeValue() { + return type_; + } + + /** + * + * + *
        +   * The type of the issue.
        +   * 
        + * + * .google.showcase.v1beta1.Issue.Type type = 1; + * + * @return The type. + */ + @java.lang.Override + public com.google.showcase.v1beta1.Issue.Type getType() { + com.google.showcase.v1beta1.Issue.Type result = + com.google.showcase.v1beta1.Issue.Type.forNumber(type_); + return result == null ? com.google.showcase.v1beta1.Issue.Type.UNRECOGNIZED : result; + } + + public static final int SEVERITY_FIELD_NUMBER = 2; + private int severity_ = 0; + + /** + * + * + *
        +   * The severity of the issue.
        +   * 
        + * + * .google.showcase.v1beta1.Issue.Severity severity = 2; + * + * @return The enum numeric value on the wire for severity. + */ + @java.lang.Override + public int getSeverityValue() { + return severity_; + } + + /** + * + * + *
        +   * The severity of the issue.
        +   * 
        + * + * .google.showcase.v1beta1.Issue.Severity severity = 2; + * + * @return The severity. + */ + @java.lang.Override + public com.google.showcase.v1beta1.Issue.Severity getSeverity() { + com.google.showcase.v1beta1.Issue.Severity result = + com.google.showcase.v1beta1.Issue.Severity.forNumber(severity_); + return result == null ? com.google.showcase.v1beta1.Issue.Severity.UNRECOGNIZED : result; + } + + public static final int DESCRIPTION_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object description_ = ""; + + /** + * + * + *
        +   * A description of the issue.
        +   * 
        + * + * 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; + } + } + + /** + * + * + *
        +   * A description of the issue.
        +   * 
        + * + * string description = 3; + * + * @return The bytes for description. + */ + @java.lang.Override + public com.google.protobuf.ByteString getDescriptionBytes() { + java.lang.Object ref = description_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + description_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (type_ != com.google.showcase.v1beta1.Issue.Type.TYPE_UNSPECIFIED.getNumber()) { + output.writeEnum(1, type_); + } + if (severity_ != com.google.showcase.v1beta1.Issue.Severity.SEVERITY_UNSPECIFIED.getNumber()) { + output.writeEnum(2, severity_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(description_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 3, description_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (type_ != com.google.showcase.v1beta1.Issue.Type.TYPE_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(1, type_); + } + if (severity_ != com.google.showcase.v1beta1.Issue.Severity.SEVERITY_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(2, severity_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(description_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(3, description_); + } + 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.showcase.v1beta1.Issue)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.Issue other = (com.google.showcase.v1beta1.Issue) obj; + + if (type_ != other.type_) return false; + if (severity_ != other.severity_) return false; + if (!getDescription().equals(other.getDescription())) 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) + TYPE_FIELD_NUMBER; + hash = (53 * hash) + type_; + hash = (37 * hash) + SEVERITY_FIELD_NUMBER; + hash = (53 * hash) + severity_; + hash = (37 * hash) + DESCRIPTION_FIELD_NUMBER; + hash = (53 * hash) + getDescription().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.showcase.v1beta1.Issue parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.Issue parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.Issue parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.Issue 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.showcase.v1beta1.Issue parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.Issue parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.Issue parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.Issue parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.showcase.v1beta1.Issue parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.Issue parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.showcase.v1beta1.Issue parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.Issue parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.showcase.v1beta1.Issue 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
        +   * An issue found in the test.
        +   * 
        + * + * Protobuf type {@code google.showcase.v1beta1.Issue} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.Issue) + com.google.showcase.v1beta1.IssueOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.TestingOuterClass + .internal_static_google_showcase_v1beta1_Issue_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.TestingOuterClass + .internal_static_google_showcase_v1beta1_Issue_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.Issue.class, + com.google.showcase.v1beta1.Issue.Builder.class); + } + + // Construct using com.google.showcase.v1beta1.Issue.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + type_ = 0; + severity_ = 0; + description_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.showcase.v1beta1.TestingOuterClass + .internal_static_google_showcase_v1beta1_Issue_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.Issue getDefaultInstanceForType() { + return com.google.showcase.v1beta1.Issue.getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.Issue build() { + com.google.showcase.v1beta1.Issue result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.Issue buildPartial() { + com.google.showcase.v1beta1.Issue result = new com.google.showcase.v1beta1.Issue(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.showcase.v1beta1.Issue result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.type_ = type_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.severity_ = severity_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.description_ = description_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.showcase.v1beta1.Issue) { + return mergeFrom((com.google.showcase.v1beta1.Issue) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.showcase.v1beta1.Issue other) { + if (other == com.google.showcase.v1beta1.Issue.getDefaultInstance()) return this; + if (other.type_ != 0) { + setTypeValue(other.getTypeValue()); + } + if (other.severity_ != 0) { + setSeverityValue(other.getSeverityValue()); + } + if (!other.getDescription().isEmpty()) { + description_ = other.description_; + 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 8: + { + type_ = input.readEnum(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 16: + { + severity_ = input.readEnum(); + bitField0_ |= 0x00000002; + break; + } // case 16 + case 26: + { + description_ = 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 int type_ = 0; + + /** + * + * + *
        +     * The type of the issue.
        +     * 
        + * + * .google.showcase.v1beta1.Issue.Type type = 1; + * + * @return The enum numeric value on the wire for type. + */ + @java.lang.Override + public int getTypeValue() { + return type_; + } + + /** + * + * + *
        +     * The type of the issue.
        +     * 
        + * + * .google.showcase.v1beta1.Issue.Type type = 1; + * + * @param value The enum numeric value on the wire for type to set. + * @return This builder for chaining. + */ + public Builder setTypeValue(int value) { + type_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
        +     * The type of the issue.
        +     * 
        + * + * .google.showcase.v1beta1.Issue.Type type = 1; + * + * @return The type. + */ + @java.lang.Override + public com.google.showcase.v1beta1.Issue.Type getType() { + com.google.showcase.v1beta1.Issue.Type result = + com.google.showcase.v1beta1.Issue.Type.forNumber(type_); + return result == null ? com.google.showcase.v1beta1.Issue.Type.UNRECOGNIZED : result; + } + + /** + * + * + *
        +     * The type of the issue.
        +     * 
        + * + * .google.showcase.v1beta1.Issue.Type type = 1; + * + * @param value The type to set. + * @return This builder for chaining. + */ + public Builder setType(com.google.showcase.v1beta1.Issue.Type value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000001; + type_ = value.getNumber(); + onChanged(); + return this; + } + + /** + * + * + *
        +     * The type of the issue.
        +     * 
        + * + * .google.showcase.v1beta1.Issue.Type type = 1; + * + * @return This builder for chaining. + */ + public Builder clearType() { + bitField0_ = (bitField0_ & ~0x00000001); + type_ = 0; + onChanged(); + return this; + } + + private int severity_ = 0; + + /** + * + * + *
        +     * The severity of the issue.
        +     * 
        + * + * .google.showcase.v1beta1.Issue.Severity severity = 2; + * + * @return The enum numeric value on the wire for severity. + */ + @java.lang.Override + public int getSeverityValue() { + return severity_; + } + + /** + * + * + *
        +     * The severity of the issue.
        +     * 
        + * + * .google.showcase.v1beta1.Issue.Severity severity = 2; + * + * @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_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
        +     * The severity of the issue.
        +     * 
        + * + * .google.showcase.v1beta1.Issue.Severity severity = 2; + * + * @return The severity. + */ + @java.lang.Override + public com.google.showcase.v1beta1.Issue.Severity getSeverity() { + com.google.showcase.v1beta1.Issue.Severity result = + com.google.showcase.v1beta1.Issue.Severity.forNumber(severity_); + return result == null ? com.google.showcase.v1beta1.Issue.Severity.UNRECOGNIZED : result; + } + + /** + * + * + *
        +     * The severity of the issue.
        +     * 
        + * + * .google.showcase.v1beta1.Issue.Severity severity = 2; + * + * @param value The severity to set. + * @return This builder for chaining. + */ + public Builder setSeverity(com.google.showcase.v1beta1.Issue.Severity value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000002; + severity_ = value.getNumber(); + onChanged(); + return this; + } + + /** + * + * + *
        +     * The severity of the issue.
        +     * 
        + * + * .google.showcase.v1beta1.Issue.Severity severity = 2; + * + * @return This builder for chaining. + */ + public Builder clearSeverity() { + bitField0_ = (bitField0_ & ~0x00000002); + severity_ = 0; + onChanged(); + return this; + } + + private java.lang.Object description_ = ""; + + /** + * + * + *
        +     * A description of the issue.
        +     * 
        + * + * 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; + } + } + + /** + * + * + *
        +     * A description of the issue.
        +     * 
        + * + * 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; + } + } + + /** + * + * + *
        +     * A description of the issue.
        +     * 
        + * + * 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_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
        +     * A description of the issue.
        +     * 
        + * + * string description = 3; + * + * @return This builder for chaining. + */ + public Builder clearDescription() { + description_ = getDefaultInstance().getDescription(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + + /** + * + * + *
        +     * A description of the issue.
        +     * 
        + * + * 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_ |= 0x00000004; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.showcase.v1beta1.Issue) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.Issue) + private static final com.google.showcase.v1beta1.Issue DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.Issue(); + } + + public static com.google.showcase.v1beta1.Issue getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Issue 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.showcase.v1beta1.Issue getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/IssueOrBuilder.java b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/IssueOrBuilder.java new file mode 100644 index 0000000000..2d3c0fc971 --- /dev/null +++ b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/IssueOrBuilder.java @@ -0,0 +1,106 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: schema/google/showcase/v1beta1/testing.proto +// Protobuf Java Version: 4.33.2 + +package com.google.showcase.v1beta1; + +@com.google.protobuf.Generated +public interface IssueOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.Issue) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
        +   * The type of the issue.
        +   * 
        + * + * .google.showcase.v1beta1.Issue.Type type = 1; + * + * @return The enum numeric value on the wire for type. + */ + int getTypeValue(); + + /** + * + * + *
        +   * The type of the issue.
        +   * 
        + * + * .google.showcase.v1beta1.Issue.Type type = 1; + * + * @return The type. + */ + com.google.showcase.v1beta1.Issue.Type getType(); + + /** + * + * + *
        +   * The severity of the issue.
        +   * 
        + * + * .google.showcase.v1beta1.Issue.Severity severity = 2; + * + * @return The enum numeric value on the wire for severity. + */ + int getSeverityValue(); + + /** + * + * + *
        +   * The severity of the issue.
        +   * 
        + * + * .google.showcase.v1beta1.Issue.Severity severity = 2; + * + * @return The severity. + */ + com.google.showcase.v1beta1.Issue.Severity getSeverity(); + + /** + * + * + *
        +   * A description of the issue.
        +   * 
        + * + * string description = 3; + * + * @return The description. + */ + java.lang.String getDescription(); + + /** + * + * + *
        +   * A description of the issue.
        +   * 
        + * + * string description = 3; + * + * @return The bytes for description. + */ + com.google.protobuf.ByteString getDescriptionBytes(); +} diff --git a/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListBlurbsRequest.java b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListBlurbsRequest.java new file mode 100644 index 0000000000..74bee13080 --- /dev/null +++ b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListBlurbsRequest.java @@ -0,0 +1,919 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: schema/google/showcase/v1beta1/messaging.proto +// Protobuf Java Version: 4.33.2 + +package com.google.showcase.v1beta1; + +/** + * + * + *
        + * The request message for the google.showcase.v1beta1.Messaging\ListBlurbs
        + * method.
        + * 
        + * + * Protobuf type {@code google.showcase.v1beta1.ListBlurbsRequest} + */ +@com.google.protobuf.Generated +public final class ListBlurbsRequest extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.ListBlurbsRequest) + ListBlurbsRequestOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "ListBlurbsRequest"); + } + + // Use ListBlurbsRequest.newBuilder() to construct. + private ListBlurbsRequest(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private ListBlurbsRequest() { + parent_ = ""; + pageToken_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.MessagingOuterClass + .internal_static_google_showcase_v1beta1_ListBlurbsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.MessagingOuterClass + .internal_static_google_showcase_v1beta1_ListBlurbsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.ListBlurbsRequest.class, + com.google.showcase.v1beta1.ListBlurbsRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object parent_ = ""; + + /** + * + * + *
        +   * The resource name of the requested room or profile who blurbs to list.
        +   * 
        + * + * + * 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; + } + } + + /** + * + * + *
        +   * The resource name of the requested room or profile who blurbs to list.
        +   * 
        + * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + @java.lang.Override + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PAGE_SIZE_FIELD_NUMBER = 2; + private int pageSize_ = 0; + + /** + * + * + *
        +   * The maximum number of blurbs to return. Server may return fewer
        +   * blurbs than requested. If unspecified, server will pick an appropriate
        +   * default.
        +   * 
        + * + * int32 page_size = 2; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + + public static final int PAGE_TOKEN_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object pageToken_ = ""; + + /** + * + * + *
        +   * The value of google.showcase.v1beta1.ListBlurbsResponse.next_page_token
        +   * returned from the previous call to
        +   * `google.showcase.v1beta1.Messaging\ListBlurbs` method.
        +   * 
        + * + * string page_token = 3; + * + * @return The pageToken. + */ + @java.lang.Override + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; + } + } + + /** + * + * + *
        +   * The value of google.showcase.v1beta1.ListBlurbsResponse.next_page_token
        +   * returned from the previous call to
        +   * `google.showcase.v1beta1.Messaging\ListBlurbs` method.
        +   * 
        + * + * string page_token = 3; + * + * @return The bytes for pageToken. + */ + @java.lang.Override + public com.google.protobuf.ByteString getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(parent_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, parent_); + } + if (pageSize_ != 0) { + output.writeInt32(2, pageSize_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(pageToken_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 3, pageToken_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(parent_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, parent_); + } + if (pageSize_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(2, pageSize_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(pageToken_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(3, 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.showcase.v1beta1.ListBlurbsRequest)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.ListBlurbsRequest other = + (com.google.showcase.v1beta1.ListBlurbsRequest) obj; + + if (!getParent().equals(other.getParent())) 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(); + 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.showcase.v1beta1.ListBlurbsRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.ListBlurbsRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.ListBlurbsRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.ListBlurbsRequest 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.showcase.v1beta1.ListBlurbsRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.ListBlurbsRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.ListBlurbsRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.ListBlurbsRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.showcase.v1beta1.ListBlurbsRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.ListBlurbsRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.showcase.v1beta1.ListBlurbsRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.ListBlurbsRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.showcase.v1beta1.ListBlurbsRequest 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
        +   * The request message for the google.showcase.v1beta1.Messaging\ListBlurbs
        +   * method.
        +   * 
        + * + * Protobuf type {@code google.showcase.v1beta1.ListBlurbsRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.ListBlurbsRequest) + com.google.showcase.v1beta1.ListBlurbsRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.MessagingOuterClass + .internal_static_google_showcase_v1beta1_ListBlurbsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.MessagingOuterClass + .internal_static_google_showcase_v1beta1_ListBlurbsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.ListBlurbsRequest.class, + com.google.showcase.v1beta1.ListBlurbsRequest.Builder.class); + } + + // Construct using com.google.showcase.v1beta1.ListBlurbsRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + parent_ = ""; + pageSize_ = 0; + pageToken_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.showcase.v1beta1.MessagingOuterClass + .internal_static_google_showcase_v1beta1_ListBlurbsRequest_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.ListBlurbsRequest getDefaultInstanceForType() { + return com.google.showcase.v1beta1.ListBlurbsRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.ListBlurbsRequest build() { + com.google.showcase.v1beta1.ListBlurbsRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.ListBlurbsRequest buildPartial() { + com.google.showcase.v1beta1.ListBlurbsRequest result = + new com.google.showcase.v1beta1.ListBlurbsRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.showcase.v1beta1.ListBlurbsRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.parent_ = parent_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.pageSize_ = pageSize_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.pageToken_ = pageToken_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.showcase.v1beta1.ListBlurbsRequest) { + return mergeFrom((com.google.showcase.v1beta1.ListBlurbsRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.showcase.v1beta1.ListBlurbsRequest other) { + if (other == com.google.showcase.v1beta1.ListBlurbsRequest.getDefaultInstance()) return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.getPageSize() != 0) { + setPageSize(other.getPageSize()); + } + if (!other.getPageToken().isEmpty()) { + pageToken_ = other.pageToken_; + 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 16: + { + pageSize_ = input.readInt32(); + bitField0_ |= 0x00000002; + break; + } // case 16 + case 26: + { + pageToken_ = 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_ = ""; + + /** + * + * + *
        +     * The resource name of the requested room or profile who blurbs to list.
        +     * 
        + * + * + * 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; + } + } + + /** + * + * + *
        +     * The resource name of the requested room or profile who blurbs to list.
        +     * 
        + * + * + * 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; + } + } + + /** + * + * + *
        +     * The resource name of the requested room or profile who blurbs to list.
        +     * 
        + * + * + * 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; + } + + /** + * + * + *
        +     * The resource name of the requested room or profile who blurbs to list.
        +     * 
        + * + * + * 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; + } + + /** + * + * + *
        +     * The resource name of the requested room or profile who blurbs to list.
        +     * 
        + * + * + * 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 int pageSize_; + + /** + * + * + *
        +     * The maximum number of blurbs to return. Server may return fewer
        +     * blurbs than requested. If unspecified, server will pick an appropriate
        +     * default.
        +     * 
        + * + * int32 page_size = 2; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + + /** + * + * + *
        +     * The maximum number of blurbs to return. Server may return fewer
        +     * blurbs than requested. If unspecified, server will pick an appropriate
        +     * default.
        +     * 
        + * + * int32 page_size = 2; + * + * @param value The pageSize to set. + * @return This builder for chaining. + */ + public Builder setPageSize(int value) { + + pageSize_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
        +     * The maximum number of blurbs to return. Server may return fewer
        +     * blurbs than requested. If unspecified, server will pick an appropriate
        +     * default.
        +     * 
        + * + * int32 page_size = 2; + * + * @return This builder for chaining. + */ + public Builder clearPageSize() { + bitField0_ = (bitField0_ & ~0x00000002); + pageSize_ = 0; + onChanged(); + return this; + } + + private java.lang.Object pageToken_ = ""; + + /** + * + * + *
        +     * The value of google.showcase.v1beta1.ListBlurbsResponse.next_page_token
        +     * returned from the previous call to
        +     * `google.showcase.v1beta1.Messaging\ListBlurbs` method.
        +     * 
        + * + * string page_token = 3; + * + * @return The pageToken. + */ + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
        +     * The value of google.showcase.v1beta1.ListBlurbsResponse.next_page_token
        +     * returned from the previous call to
        +     * `google.showcase.v1beta1.Messaging\ListBlurbs` method.
        +     * 
        + * + * string page_token = 3; + * + * @return The bytes for pageToken. + */ + public com.google.protobuf.ByteString getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
        +     * The value of google.showcase.v1beta1.ListBlurbsResponse.next_page_token
        +     * returned from the previous call to
        +     * `google.showcase.v1beta1.Messaging\ListBlurbs` method.
        +     * 
        + * + * string page_token = 3; + * + * @param value The pageToken to set. + * @return This builder for chaining. + */ + public Builder setPageToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + pageToken_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
        +     * The value of google.showcase.v1beta1.ListBlurbsResponse.next_page_token
        +     * returned from the previous call to
        +     * `google.showcase.v1beta1.Messaging\ListBlurbs` method.
        +     * 
        + * + * string page_token = 3; + * + * @return This builder for chaining. + */ + public Builder clearPageToken() { + pageToken_ = getDefaultInstance().getPageToken(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + + /** + * + * + *
        +     * The value of google.showcase.v1beta1.ListBlurbsResponse.next_page_token
        +     * returned from the previous call to
        +     * `google.showcase.v1beta1.Messaging\ListBlurbs` method.
        +     * 
        + * + * string page_token = 3; + * + * @param value The bytes for pageToken to set. + * @return This builder for chaining. + */ + public Builder setPageTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + pageToken_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.showcase.v1beta1.ListBlurbsRequest) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.ListBlurbsRequest) + private static final com.google.showcase.v1beta1.ListBlurbsRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.ListBlurbsRequest(); + } + + public static com.google.showcase.v1beta1.ListBlurbsRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListBlurbsRequest 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.showcase.v1beta1.ListBlurbsRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListBlurbsRequestOrBuilder.java b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListBlurbsRequestOrBuilder.java new file mode 100644 index 0000000000..fd7f97dcb9 --- /dev/null +++ b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListBlurbsRequestOrBuilder.java @@ -0,0 +1,103 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: schema/google/showcase/v1beta1/messaging.proto +// Protobuf Java Version: 4.33.2 + +package com.google.showcase.v1beta1; + +@com.google.protobuf.Generated +public interface ListBlurbsRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.ListBlurbsRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
        +   * The resource name of the requested room or profile who blurbs to list.
        +   * 
        + * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + + /** + * + * + *
        +   * The resource name of the requested room or profile who blurbs to list.
        +   * 
        + * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
        +   * The maximum number of blurbs to return. Server may return fewer
        +   * blurbs than requested. If unspecified, server will pick an appropriate
        +   * default.
        +   * 
        + * + * int32 page_size = 2; + * + * @return The pageSize. + */ + int getPageSize(); + + /** + * + * + *
        +   * The value of google.showcase.v1beta1.ListBlurbsResponse.next_page_token
        +   * returned from the previous call to
        +   * `google.showcase.v1beta1.Messaging\ListBlurbs` method.
        +   * 
        + * + * string page_token = 3; + * + * @return The pageToken. + */ + java.lang.String getPageToken(); + + /** + * + * + *
        +   * The value of google.showcase.v1beta1.ListBlurbsResponse.next_page_token
        +   * returned from the previous call to
        +   * `google.showcase.v1beta1.Messaging\ListBlurbs` method.
        +   * 
        + * + * string page_token = 3; + * + * @return The bytes for pageToken. + */ + com.google.protobuf.ByteString getPageTokenBytes(); +} diff --git a/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListBlurbsResponse.java b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListBlurbsResponse.java new file mode 100644 index 0000000000..acb55a4605 --- /dev/null +++ b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListBlurbsResponse.java @@ -0,0 +1,1129 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: schema/google/showcase/v1beta1/messaging.proto +// Protobuf Java Version: 4.33.2 + +package com.google.showcase.v1beta1; + +/** + * + * + *
        + * The response message for the google.showcase.v1beta1.Messaging\ListBlurbs
        + * method.
        + * 
        + * + * Protobuf type {@code google.showcase.v1beta1.ListBlurbsResponse} + */ +@com.google.protobuf.Generated +public final class ListBlurbsResponse extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.ListBlurbsResponse) + ListBlurbsResponseOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "ListBlurbsResponse"); + } + + // Use ListBlurbsResponse.newBuilder() to construct. + private ListBlurbsResponse(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private ListBlurbsResponse() { + blurbs_ = java.util.Collections.emptyList(); + nextPageToken_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.MessagingOuterClass + .internal_static_google_showcase_v1beta1_ListBlurbsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.MessagingOuterClass + .internal_static_google_showcase_v1beta1_ListBlurbsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.ListBlurbsResponse.class, + com.google.showcase.v1beta1.ListBlurbsResponse.Builder.class); + } + + public static final int BLURBS_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private java.util.List blurbs_; + + /** + * + * + *
        +   * The list of blurbs.
        +   * 
        + * + * repeated .google.showcase.v1beta1.Blurb blurbs = 1; + */ + @java.lang.Override + public java.util.List getBlurbsList() { + return blurbs_; + } + + /** + * + * + *
        +   * The list of blurbs.
        +   * 
        + * + * repeated .google.showcase.v1beta1.Blurb blurbs = 1; + */ + @java.lang.Override + public java.util.List + getBlurbsOrBuilderList() { + return blurbs_; + } + + /** + * + * + *
        +   * The list of blurbs.
        +   * 
        + * + * repeated .google.showcase.v1beta1.Blurb blurbs = 1; + */ + @java.lang.Override + public int getBlurbsCount() { + return blurbs_.size(); + } + + /** + * + * + *
        +   * The list of blurbs.
        +   * 
        + * + * repeated .google.showcase.v1beta1.Blurb blurbs = 1; + */ + @java.lang.Override + public com.google.showcase.v1beta1.Blurb getBlurbs(int index) { + return blurbs_.get(index); + } + + /** + * + * + *
        +   * The list of blurbs.
        +   * 
        + * + * repeated .google.showcase.v1beta1.Blurb blurbs = 1; + */ + @java.lang.Override + public com.google.showcase.v1beta1.BlurbOrBuilder getBlurbsOrBuilder(int index) { + return blurbs_.get(index); + } + + public static final int NEXT_PAGE_TOKEN_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object nextPageToken_ = ""; + + /** + * + * + *
        +   * A token to retrieve next page of results.
        +   * Pass this value in ListBlurbsRequest.page_token field in the subsequent
        +   * call to `google.showcase.v1beta1.Blurb\ListBlurbs` method to retrieve
        +   * the next page of results.
        +   * 
        + * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + @java.lang.Override + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nextPageToken_ = s; + return s; + } + } + + /** + * + * + *
        +   * A token to retrieve next page of results.
        +   * Pass this value in ListBlurbsRequest.page_token field in the subsequent
        +   * call to `google.showcase.v1beta1.Blurb\ListBlurbs` method to retrieve
        +   * the next page of results.
        +   * 
        + * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + nextPageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + for (int i = 0; i < blurbs_.size(); i++) { + output.writeMessage(1, blurbs_.get(i)); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(nextPageToken_)) { + com.google.protobuf.GeneratedMessage.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 < blurbs_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, blurbs_.get(i)); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(nextPageToken_)) { + size += com.google.protobuf.GeneratedMessage.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.showcase.v1beta1.ListBlurbsResponse)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.ListBlurbsResponse other = + (com.google.showcase.v1beta1.ListBlurbsResponse) obj; + + if (!getBlurbsList().equals(other.getBlurbsList())) 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 (getBlurbsCount() > 0) { + hash = (37 * hash) + BLURBS_FIELD_NUMBER; + hash = (53 * hash) + getBlurbsList().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.showcase.v1beta1.ListBlurbsResponse parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.ListBlurbsResponse parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.ListBlurbsResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.ListBlurbsResponse 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.showcase.v1beta1.ListBlurbsResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.ListBlurbsResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.ListBlurbsResponse parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.ListBlurbsResponse parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.showcase.v1beta1.ListBlurbsResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.ListBlurbsResponse parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.showcase.v1beta1.ListBlurbsResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.ListBlurbsResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.showcase.v1beta1.ListBlurbsResponse 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
        +   * The response message for the google.showcase.v1beta1.Messaging\ListBlurbs
        +   * method.
        +   * 
        + * + * Protobuf type {@code google.showcase.v1beta1.ListBlurbsResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.ListBlurbsResponse) + com.google.showcase.v1beta1.ListBlurbsResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.MessagingOuterClass + .internal_static_google_showcase_v1beta1_ListBlurbsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.MessagingOuterClass + .internal_static_google_showcase_v1beta1_ListBlurbsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.ListBlurbsResponse.class, + com.google.showcase.v1beta1.ListBlurbsResponse.Builder.class); + } + + // Construct using com.google.showcase.v1beta1.ListBlurbsResponse.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (blurbsBuilder_ == null) { + blurbs_ = java.util.Collections.emptyList(); + } else { + blurbs_ = null; + blurbsBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + nextPageToken_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.showcase.v1beta1.MessagingOuterClass + .internal_static_google_showcase_v1beta1_ListBlurbsResponse_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.ListBlurbsResponse getDefaultInstanceForType() { + return com.google.showcase.v1beta1.ListBlurbsResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.ListBlurbsResponse build() { + com.google.showcase.v1beta1.ListBlurbsResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.ListBlurbsResponse buildPartial() { + com.google.showcase.v1beta1.ListBlurbsResponse result = + new com.google.showcase.v1beta1.ListBlurbsResponse(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields(com.google.showcase.v1beta1.ListBlurbsResponse result) { + if (blurbsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + blurbs_ = java.util.Collections.unmodifiableList(blurbs_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.blurbs_ = blurbs_; + } else { + result.blurbs_ = blurbsBuilder_.build(); + } + } + + private void buildPartial0(com.google.showcase.v1beta1.ListBlurbsResponse result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.nextPageToken_ = nextPageToken_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.showcase.v1beta1.ListBlurbsResponse) { + return mergeFrom((com.google.showcase.v1beta1.ListBlurbsResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.showcase.v1beta1.ListBlurbsResponse other) { + if (other == com.google.showcase.v1beta1.ListBlurbsResponse.getDefaultInstance()) return this; + if (blurbsBuilder_ == null) { + if (!other.blurbs_.isEmpty()) { + if (blurbs_.isEmpty()) { + blurbs_ = other.blurbs_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureBlurbsIsMutable(); + blurbs_.addAll(other.blurbs_); + } + onChanged(); + } + } else { + if (!other.blurbs_.isEmpty()) { + if (blurbsBuilder_.isEmpty()) { + blurbsBuilder_.dispose(); + blurbsBuilder_ = null; + blurbs_ = other.blurbs_; + bitField0_ = (bitField0_ & ~0x00000001); + blurbsBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders + ? internalGetBlurbsFieldBuilder() + : null; + } else { + blurbsBuilder_.addAllMessages(other.blurbs_); + } + } + } + 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.showcase.v1beta1.Blurb m = + input.readMessage( + com.google.showcase.v1beta1.Blurb.parser(), extensionRegistry); + if (blurbsBuilder_ == null) { + ensureBlurbsIsMutable(); + blurbs_.add(m); + } else { + blurbsBuilder_.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 blurbs_ = + java.util.Collections.emptyList(); + + private void ensureBlurbsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + blurbs_ = new java.util.ArrayList(blurbs_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.google.showcase.v1beta1.Blurb, + com.google.showcase.v1beta1.Blurb.Builder, + com.google.showcase.v1beta1.BlurbOrBuilder> + blurbsBuilder_; + + /** + * + * + *
        +     * The list of blurbs.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Blurb blurbs = 1; + */ + public java.util.List getBlurbsList() { + if (blurbsBuilder_ == null) { + return java.util.Collections.unmodifiableList(blurbs_); + } else { + return blurbsBuilder_.getMessageList(); + } + } + + /** + * + * + *
        +     * The list of blurbs.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Blurb blurbs = 1; + */ + public int getBlurbsCount() { + if (blurbsBuilder_ == null) { + return blurbs_.size(); + } else { + return blurbsBuilder_.getCount(); + } + } + + /** + * + * + *
        +     * The list of blurbs.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Blurb blurbs = 1; + */ + public com.google.showcase.v1beta1.Blurb getBlurbs(int index) { + if (blurbsBuilder_ == null) { + return blurbs_.get(index); + } else { + return blurbsBuilder_.getMessage(index); + } + } + + /** + * + * + *
        +     * The list of blurbs.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Blurb blurbs = 1; + */ + public Builder setBlurbs(int index, com.google.showcase.v1beta1.Blurb value) { + if (blurbsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureBlurbsIsMutable(); + blurbs_.set(index, value); + onChanged(); + } else { + blurbsBuilder_.setMessage(index, value); + } + return this; + } + + /** + * + * + *
        +     * The list of blurbs.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Blurb blurbs = 1; + */ + public Builder setBlurbs(int index, com.google.showcase.v1beta1.Blurb.Builder builderForValue) { + if (blurbsBuilder_ == null) { + ensureBlurbsIsMutable(); + blurbs_.set(index, builderForValue.build()); + onChanged(); + } else { + blurbsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
        +     * The list of blurbs.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Blurb blurbs = 1; + */ + public Builder addBlurbs(com.google.showcase.v1beta1.Blurb value) { + if (blurbsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureBlurbsIsMutable(); + blurbs_.add(value); + onChanged(); + } else { + blurbsBuilder_.addMessage(value); + } + return this; + } + + /** + * + * + *
        +     * The list of blurbs.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Blurb blurbs = 1; + */ + public Builder addBlurbs(int index, com.google.showcase.v1beta1.Blurb value) { + if (blurbsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureBlurbsIsMutable(); + blurbs_.add(index, value); + onChanged(); + } else { + blurbsBuilder_.addMessage(index, value); + } + return this; + } + + /** + * + * + *
        +     * The list of blurbs.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Blurb blurbs = 1; + */ + public Builder addBlurbs(com.google.showcase.v1beta1.Blurb.Builder builderForValue) { + if (blurbsBuilder_ == null) { + ensureBlurbsIsMutable(); + blurbs_.add(builderForValue.build()); + onChanged(); + } else { + blurbsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + + /** + * + * + *
        +     * The list of blurbs.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Blurb blurbs = 1; + */ + public Builder addBlurbs(int index, com.google.showcase.v1beta1.Blurb.Builder builderForValue) { + if (blurbsBuilder_ == null) { + ensureBlurbsIsMutable(); + blurbs_.add(index, builderForValue.build()); + onChanged(); + } else { + blurbsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
        +     * The list of blurbs.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Blurb blurbs = 1; + */ + public Builder addAllBlurbs( + java.lang.Iterable values) { + if (blurbsBuilder_ == null) { + ensureBlurbsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, blurbs_); + onChanged(); + } else { + blurbsBuilder_.addAllMessages(values); + } + return this; + } + + /** + * + * + *
        +     * The list of blurbs.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Blurb blurbs = 1; + */ + public Builder clearBlurbs() { + if (blurbsBuilder_ == null) { + blurbs_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + blurbsBuilder_.clear(); + } + return this; + } + + /** + * + * + *
        +     * The list of blurbs.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Blurb blurbs = 1; + */ + public Builder removeBlurbs(int index) { + if (blurbsBuilder_ == null) { + ensureBlurbsIsMutable(); + blurbs_.remove(index); + onChanged(); + } else { + blurbsBuilder_.remove(index); + } + return this; + } + + /** + * + * + *
        +     * The list of blurbs.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Blurb blurbs = 1; + */ + public com.google.showcase.v1beta1.Blurb.Builder getBlurbsBuilder(int index) { + return internalGetBlurbsFieldBuilder().getBuilder(index); + } + + /** + * + * + *
        +     * The list of blurbs.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Blurb blurbs = 1; + */ + public com.google.showcase.v1beta1.BlurbOrBuilder getBlurbsOrBuilder(int index) { + if (blurbsBuilder_ == null) { + return blurbs_.get(index); + } else { + return blurbsBuilder_.getMessageOrBuilder(index); + } + } + + /** + * + * + *
        +     * The list of blurbs.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Blurb blurbs = 1; + */ + public java.util.List + getBlurbsOrBuilderList() { + if (blurbsBuilder_ != null) { + return blurbsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(blurbs_); + } + } + + /** + * + * + *
        +     * The list of blurbs.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Blurb blurbs = 1; + */ + public com.google.showcase.v1beta1.Blurb.Builder addBlurbsBuilder() { + return internalGetBlurbsFieldBuilder() + .addBuilder(com.google.showcase.v1beta1.Blurb.getDefaultInstance()); + } + + /** + * + * + *
        +     * The list of blurbs.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Blurb blurbs = 1; + */ + public com.google.showcase.v1beta1.Blurb.Builder addBlurbsBuilder(int index) { + return internalGetBlurbsFieldBuilder() + .addBuilder(index, com.google.showcase.v1beta1.Blurb.getDefaultInstance()); + } + + /** + * + * + *
        +     * The list of blurbs.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Blurb blurbs = 1; + */ + public java.util.List getBlurbsBuilderList() { + return internalGetBlurbsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.google.showcase.v1beta1.Blurb, + com.google.showcase.v1beta1.Blurb.Builder, + com.google.showcase.v1beta1.BlurbOrBuilder> + internalGetBlurbsFieldBuilder() { + if (blurbsBuilder_ == null) { + blurbsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilder< + com.google.showcase.v1beta1.Blurb, + com.google.showcase.v1beta1.Blurb.Builder, + com.google.showcase.v1beta1.BlurbOrBuilder>( + blurbs_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + blurbs_ = null; + } + return blurbsBuilder_; + } + + private java.lang.Object nextPageToken_ = ""; + + /** + * + * + *
        +     * A token to retrieve next page of results.
        +     * Pass this value in ListBlurbsRequest.page_token field in the subsequent
        +     * call to `google.showcase.v1beta1.Blurb\ListBlurbs` method to retrieve
        +     * the next page of results.
        +     * 
        + * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nextPageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
        +     * A token to retrieve next page of results.
        +     * Pass this value in ListBlurbsRequest.page_token field in the subsequent
        +     * call to `google.showcase.v1beta1.Blurb\ListBlurbs` method to retrieve
        +     * the next page of results.
        +     * 
        + * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + public com.google.protobuf.ByteString getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + nextPageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
        +     * A token to retrieve next page of results.
        +     * Pass this value in ListBlurbsRequest.page_token field in the subsequent
        +     * call to `google.showcase.v1beta1.Blurb\ListBlurbs` method to retrieve
        +     * the next page of results.
        +     * 
        + * + * string next_page_token = 2; + * + * @param value The nextPageToken to set. + * @return This builder for chaining. + */ + public Builder setNextPageToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + nextPageToken_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
        +     * A token to retrieve next page of results.
        +     * Pass this value in ListBlurbsRequest.page_token field in the subsequent
        +     * call to `google.showcase.v1beta1.Blurb\ListBlurbs` method to retrieve
        +     * the next page of results.
        +     * 
        + * + * string next_page_token = 2; + * + * @return This builder for chaining. + */ + public Builder clearNextPageToken() { + nextPageToken_ = getDefaultInstance().getNextPageToken(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
        +     * A token to retrieve next page of results.
        +     * Pass this value in ListBlurbsRequest.page_token field in the subsequent
        +     * call to `google.showcase.v1beta1.Blurb\ListBlurbs` method to retrieve
        +     * the next page of results.
        +     * 
        + * + * string next_page_token = 2; + * + * @param value The bytes for nextPageToken to set. + * @return This builder for chaining. + */ + public Builder setNextPageTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + nextPageToken_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.showcase.v1beta1.ListBlurbsResponse) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.ListBlurbsResponse) + private static final com.google.showcase.v1beta1.ListBlurbsResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.ListBlurbsResponse(); + } + + public static com.google.showcase.v1beta1.ListBlurbsResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListBlurbsResponse 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.showcase.v1beta1.ListBlurbsResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListBlurbsResponseOrBuilder.java b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListBlurbsResponseOrBuilder.java new file mode 100644 index 0000000000..0a19e30dc4 --- /dev/null +++ b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListBlurbsResponseOrBuilder.java @@ -0,0 +1,115 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: schema/google/showcase/v1beta1/messaging.proto +// Protobuf Java Version: 4.33.2 + +package com.google.showcase.v1beta1; + +@com.google.protobuf.Generated +public interface ListBlurbsResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.ListBlurbsResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
        +   * The list of blurbs.
        +   * 
        + * + * repeated .google.showcase.v1beta1.Blurb blurbs = 1; + */ + java.util.List getBlurbsList(); + + /** + * + * + *
        +   * The list of blurbs.
        +   * 
        + * + * repeated .google.showcase.v1beta1.Blurb blurbs = 1; + */ + com.google.showcase.v1beta1.Blurb getBlurbs(int index); + + /** + * + * + *
        +   * The list of blurbs.
        +   * 
        + * + * repeated .google.showcase.v1beta1.Blurb blurbs = 1; + */ + int getBlurbsCount(); + + /** + * + * + *
        +   * The list of blurbs.
        +   * 
        + * + * repeated .google.showcase.v1beta1.Blurb blurbs = 1; + */ + java.util.List getBlurbsOrBuilderList(); + + /** + * + * + *
        +   * The list of blurbs.
        +   * 
        + * + * repeated .google.showcase.v1beta1.Blurb blurbs = 1; + */ + com.google.showcase.v1beta1.BlurbOrBuilder getBlurbsOrBuilder(int index); + + /** + * + * + *
        +   * A token to retrieve next page of results.
        +   * Pass this value in ListBlurbsRequest.page_token field in the subsequent
        +   * call to `google.showcase.v1beta1.Blurb\ListBlurbs` method to retrieve
        +   * the next page of results.
        +   * 
        + * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + java.lang.String getNextPageToken(); + + /** + * + * + *
        +   * A token to retrieve next page of results.
        +   * Pass this value in ListBlurbsRequest.page_token field in the subsequent
        +   * call to `google.showcase.v1beta1.Blurb\ListBlurbs` method to retrieve
        +   * the next page of results.
        +   * 
        + * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + com.google.protobuf.ByteString getNextPageTokenBytes(); +} diff --git a/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListRoomsRequest.java b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListRoomsRequest.java new file mode 100644 index 0000000000..a50ad63338 --- /dev/null +++ b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListRoomsRequest.java @@ -0,0 +1,712 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: schema/google/showcase/v1beta1/messaging.proto +// Protobuf Java Version: 4.33.2 + +package com.google.showcase.v1beta1; + +/** + * + * + *
        + * The request message for the google.showcase.v1beta1.Messaging\ListRooms
        + * method.
        + * 
        + * + * Protobuf type {@code google.showcase.v1beta1.ListRoomsRequest} + */ +@com.google.protobuf.Generated +public final class ListRoomsRequest extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.ListRoomsRequest) + ListRoomsRequestOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "ListRoomsRequest"); + } + + // Use ListRoomsRequest.newBuilder() to construct. + private ListRoomsRequest(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private ListRoomsRequest() { + pageToken_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.MessagingOuterClass + .internal_static_google_showcase_v1beta1_ListRoomsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.MessagingOuterClass + .internal_static_google_showcase_v1beta1_ListRoomsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.ListRoomsRequest.class, + com.google.showcase.v1beta1.ListRoomsRequest.Builder.class); + } + + public static final int PAGE_SIZE_FIELD_NUMBER = 1; + private int pageSize_ = 0; + + /** + * + * + *
        +   * The maximum number of rooms return. Server may return fewer rooms
        +   * than requested. If unspecified, server will pick an appropriate default.
        +   * 
        + * + * int32 page_size = 1; + * + * @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_ = ""; + + /** + * + * + *
        +   * The value of google.showcase.v1beta1.ListRoomsResponse.next_page_token
        +   * returned from the previous call to
        +   * `google.showcase.v1beta1.Messaging\ListRooms` method.
        +   * 
        + * + * string page_token = 2; + * + * @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; + } + } + + /** + * + * + *
        +   * The value of google.showcase.v1beta1.ListRoomsResponse.next_page_token
        +   * returned from the previous call to
        +   * `google.showcase.v1beta1.Messaging\ListRooms` method.
        +   * 
        + * + * string page_token = 2; + * + * @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.GeneratedMessage.isStringEmpty(pageToken_)) { + com.google.protobuf.GeneratedMessage.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.GeneratedMessage.isStringEmpty(pageToken_)) { + size += com.google.protobuf.GeneratedMessage.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.showcase.v1beta1.ListRoomsRequest)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.ListRoomsRequest other = + (com.google.showcase.v1beta1.ListRoomsRequest) 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.showcase.v1beta1.ListRoomsRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.ListRoomsRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.ListRoomsRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.ListRoomsRequest 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.showcase.v1beta1.ListRoomsRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.ListRoomsRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.ListRoomsRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.ListRoomsRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.showcase.v1beta1.ListRoomsRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.ListRoomsRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.showcase.v1beta1.ListRoomsRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.ListRoomsRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.showcase.v1beta1.ListRoomsRequest 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
        +   * The request message for the google.showcase.v1beta1.Messaging\ListRooms
        +   * method.
        +   * 
        + * + * Protobuf type {@code google.showcase.v1beta1.ListRoomsRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.ListRoomsRequest) + com.google.showcase.v1beta1.ListRoomsRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.MessagingOuterClass + .internal_static_google_showcase_v1beta1_ListRoomsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.MessagingOuterClass + .internal_static_google_showcase_v1beta1_ListRoomsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.ListRoomsRequest.class, + com.google.showcase.v1beta1.ListRoomsRequest.Builder.class); + } + + // Construct using com.google.showcase.v1beta1.ListRoomsRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.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.showcase.v1beta1.MessagingOuterClass + .internal_static_google_showcase_v1beta1_ListRoomsRequest_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.ListRoomsRequest getDefaultInstanceForType() { + return com.google.showcase.v1beta1.ListRoomsRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.ListRoomsRequest build() { + com.google.showcase.v1beta1.ListRoomsRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.ListRoomsRequest buildPartial() { + com.google.showcase.v1beta1.ListRoomsRequest result = + new com.google.showcase.v1beta1.ListRoomsRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.showcase.v1beta1.ListRoomsRequest 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 mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.showcase.v1beta1.ListRoomsRequest) { + return mergeFrom((com.google.showcase.v1beta1.ListRoomsRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.showcase.v1beta1.ListRoomsRequest other) { + if (other == com.google.showcase.v1beta1.ListRoomsRequest.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_; + + /** + * + * + *
        +     * The maximum number of rooms return. Server may return fewer rooms
        +     * than requested. If unspecified, server will pick an appropriate default.
        +     * 
        + * + * int32 page_size = 1; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + + /** + * + * + *
        +     * The maximum number of rooms return. Server may return fewer rooms
        +     * than requested. If unspecified, server will pick an appropriate default.
        +     * 
        + * + * int32 page_size = 1; + * + * @param value The pageSize to set. + * @return This builder for chaining. + */ + public Builder setPageSize(int value) { + + pageSize_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
        +     * The maximum number of rooms return. Server may return fewer rooms
        +     * than requested. If unspecified, server will pick an appropriate default.
        +     * 
        + * + * int32 page_size = 1; + * + * @return This builder for chaining. + */ + public Builder clearPageSize() { + bitField0_ = (bitField0_ & ~0x00000001); + pageSize_ = 0; + onChanged(); + return this; + } + + private java.lang.Object pageToken_ = ""; + + /** + * + * + *
        +     * The value of google.showcase.v1beta1.ListRoomsResponse.next_page_token
        +     * returned from the previous call to
        +     * `google.showcase.v1beta1.Messaging\ListRooms` method.
        +     * 
        + * + * string page_token = 2; + * + * @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; + } + } + + /** + * + * + *
        +     * The value of google.showcase.v1beta1.ListRoomsResponse.next_page_token
        +     * returned from the previous call to
        +     * `google.showcase.v1beta1.Messaging\ListRooms` method.
        +     * 
        + * + * string page_token = 2; + * + * @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; + } + } + + /** + * + * + *
        +     * The value of google.showcase.v1beta1.ListRoomsResponse.next_page_token
        +     * returned from the previous call to
        +     * `google.showcase.v1beta1.Messaging\ListRooms` method.
        +     * 
        + * + * string page_token = 2; + * + * @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; + } + + /** + * + * + *
        +     * The value of google.showcase.v1beta1.ListRoomsResponse.next_page_token
        +     * returned from the previous call to
        +     * `google.showcase.v1beta1.Messaging\ListRooms` method.
        +     * 
        + * + * string page_token = 2; + * + * @return This builder for chaining. + */ + public Builder clearPageToken() { + pageToken_ = getDefaultInstance().getPageToken(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
        +     * The value of google.showcase.v1beta1.ListRoomsResponse.next_page_token
        +     * returned from the previous call to
        +     * `google.showcase.v1beta1.Messaging\ListRooms` method.
        +     * 
        + * + * string page_token = 2; + * + * @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; + } + + // @@protoc_insertion_point(builder_scope:google.showcase.v1beta1.ListRoomsRequest) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.ListRoomsRequest) + private static final com.google.showcase.v1beta1.ListRoomsRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.ListRoomsRequest(); + } + + public static com.google.showcase.v1beta1.ListRoomsRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListRoomsRequest 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.showcase.v1beta1.ListRoomsRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListRoomsRequestOrBuilder.java b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListRoomsRequestOrBuilder.java new file mode 100644 index 0000000000..fb8834ee0d --- /dev/null +++ b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListRoomsRequestOrBuilder.java @@ -0,0 +1,72 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: schema/google/showcase/v1beta1/messaging.proto +// Protobuf Java Version: 4.33.2 + +package com.google.showcase.v1beta1; + +@com.google.protobuf.Generated +public interface ListRoomsRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.ListRoomsRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
        +   * The maximum number of rooms return. Server may return fewer rooms
        +   * than requested. If unspecified, server will pick an appropriate default.
        +   * 
        + * + * int32 page_size = 1; + * + * @return The pageSize. + */ + int getPageSize(); + + /** + * + * + *
        +   * The value of google.showcase.v1beta1.ListRoomsResponse.next_page_token
        +   * returned from the previous call to
        +   * `google.showcase.v1beta1.Messaging\ListRooms` method.
        +   * 
        + * + * string page_token = 2; + * + * @return The pageToken. + */ + java.lang.String getPageToken(); + + /** + * + * + *
        +   * The value of google.showcase.v1beta1.ListRoomsResponse.next_page_token
        +   * returned from the previous call to
        +   * `google.showcase.v1beta1.Messaging\ListRooms` method.
        +   * 
        + * + * string page_token = 2; + * + * @return The bytes for pageToken. + */ + com.google.protobuf.ByteString getPageTokenBytes(); +} diff --git a/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListRoomsResponse.java b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListRoomsResponse.java new file mode 100644 index 0000000000..351bb9ca93 --- /dev/null +++ b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListRoomsResponse.java @@ -0,0 +1,1128 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: schema/google/showcase/v1beta1/messaging.proto +// Protobuf Java Version: 4.33.2 + +package com.google.showcase.v1beta1; + +/** + * + * + *
        + * The response message for the google.showcase.v1beta1.Messaging\ListRooms
        + * method.
        + * 
        + * + * Protobuf type {@code google.showcase.v1beta1.ListRoomsResponse} + */ +@com.google.protobuf.Generated +public final class ListRoomsResponse extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.ListRoomsResponse) + ListRoomsResponseOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "ListRoomsResponse"); + } + + // Use ListRoomsResponse.newBuilder() to construct. + private ListRoomsResponse(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private ListRoomsResponse() { + rooms_ = java.util.Collections.emptyList(); + nextPageToken_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.MessagingOuterClass + .internal_static_google_showcase_v1beta1_ListRoomsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.MessagingOuterClass + .internal_static_google_showcase_v1beta1_ListRoomsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.ListRoomsResponse.class, + com.google.showcase.v1beta1.ListRoomsResponse.Builder.class); + } + + public static final int ROOMS_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private java.util.List rooms_; + + /** + * + * + *
        +   * The list of rooms.
        +   * 
        + * + * repeated .google.showcase.v1beta1.Room rooms = 1; + */ + @java.lang.Override + public java.util.List getRoomsList() { + return rooms_; + } + + /** + * + * + *
        +   * The list of rooms.
        +   * 
        + * + * repeated .google.showcase.v1beta1.Room rooms = 1; + */ + @java.lang.Override + public java.util.List + getRoomsOrBuilderList() { + return rooms_; + } + + /** + * + * + *
        +   * The list of rooms.
        +   * 
        + * + * repeated .google.showcase.v1beta1.Room rooms = 1; + */ + @java.lang.Override + public int getRoomsCount() { + return rooms_.size(); + } + + /** + * + * + *
        +   * The list of rooms.
        +   * 
        + * + * repeated .google.showcase.v1beta1.Room rooms = 1; + */ + @java.lang.Override + public com.google.showcase.v1beta1.Room getRooms(int index) { + return rooms_.get(index); + } + + /** + * + * + *
        +   * The list of rooms.
        +   * 
        + * + * repeated .google.showcase.v1beta1.Room rooms = 1; + */ + @java.lang.Override + public com.google.showcase.v1beta1.RoomOrBuilder getRoomsOrBuilder(int index) { + return rooms_.get(index); + } + + public static final int NEXT_PAGE_TOKEN_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object nextPageToken_ = ""; + + /** + * + * + *
        +   * A token to retrieve next page of results.
        +   * Pass this value in ListRoomsRequest.page_token field in the subsequent
        +   * call to `google.showcase.v1beta1.Messaging\ListRooms` method to retrieve
        +   * the next page of results.
        +   * 
        + * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + @java.lang.Override + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nextPageToken_ = s; + return s; + } + } + + /** + * + * + *
        +   * A token to retrieve next page of results.
        +   * Pass this value in ListRoomsRequest.page_token field in the subsequent
        +   * call to `google.showcase.v1beta1.Messaging\ListRooms` method to retrieve
        +   * the next page of results.
        +   * 
        + * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + nextPageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + for (int i = 0; i < rooms_.size(); i++) { + output.writeMessage(1, rooms_.get(i)); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(nextPageToken_)) { + com.google.protobuf.GeneratedMessage.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 < rooms_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, rooms_.get(i)); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(nextPageToken_)) { + size += com.google.protobuf.GeneratedMessage.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.showcase.v1beta1.ListRoomsResponse)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.ListRoomsResponse other = + (com.google.showcase.v1beta1.ListRoomsResponse) obj; + + if (!getRoomsList().equals(other.getRoomsList())) 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 (getRoomsCount() > 0) { + hash = (37 * hash) + ROOMS_FIELD_NUMBER; + hash = (53 * hash) + getRoomsList().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.showcase.v1beta1.ListRoomsResponse parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.ListRoomsResponse parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.ListRoomsResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.ListRoomsResponse 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.showcase.v1beta1.ListRoomsResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.ListRoomsResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.ListRoomsResponse parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.ListRoomsResponse parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.showcase.v1beta1.ListRoomsResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.ListRoomsResponse parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.showcase.v1beta1.ListRoomsResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.ListRoomsResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.showcase.v1beta1.ListRoomsResponse 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
        +   * The response message for the google.showcase.v1beta1.Messaging\ListRooms
        +   * method.
        +   * 
        + * + * Protobuf type {@code google.showcase.v1beta1.ListRoomsResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.ListRoomsResponse) + com.google.showcase.v1beta1.ListRoomsResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.MessagingOuterClass + .internal_static_google_showcase_v1beta1_ListRoomsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.MessagingOuterClass + .internal_static_google_showcase_v1beta1_ListRoomsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.ListRoomsResponse.class, + com.google.showcase.v1beta1.ListRoomsResponse.Builder.class); + } + + // Construct using com.google.showcase.v1beta1.ListRoomsResponse.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (roomsBuilder_ == null) { + rooms_ = java.util.Collections.emptyList(); + } else { + rooms_ = null; + roomsBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + nextPageToken_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.showcase.v1beta1.MessagingOuterClass + .internal_static_google_showcase_v1beta1_ListRoomsResponse_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.ListRoomsResponse getDefaultInstanceForType() { + return com.google.showcase.v1beta1.ListRoomsResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.ListRoomsResponse build() { + com.google.showcase.v1beta1.ListRoomsResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.ListRoomsResponse buildPartial() { + com.google.showcase.v1beta1.ListRoomsResponse result = + new com.google.showcase.v1beta1.ListRoomsResponse(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields(com.google.showcase.v1beta1.ListRoomsResponse result) { + if (roomsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + rooms_ = java.util.Collections.unmodifiableList(rooms_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.rooms_ = rooms_; + } else { + result.rooms_ = roomsBuilder_.build(); + } + } + + private void buildPartial0(com.google.showcase.v1beta1.ListRoomsResponse result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.nextPageToken_ = nextPageToken_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.showcase.v1beta1.ListRoomsResponse) { + return mergeFrom((com.google.showcase.v1beta1.ListRoomsResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.showcase.v1beta1.ListRoomsResponse other) { + if (other == com.google.showcase.v1beta1.ListRoomsResponse.getDefaultInstance()) return this; + if (roomsBuilder_ == null) { + if (!other.rooms_.isEmpty()) { + if (rooms_.isEmpty()) { + rooms_ = other.rooms_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureRoomsIsMutable(); + rooms_.addAll(other.rooms_); + } + onChanged(); + } + } else { + if (!other.rooms_.isEmpty()) { + if (roomsBuilder_.isEmpty()) { + roomsBuilder_.dispose(); + roomsBuilder_ = null; + rooms_ = other.rooms_; + bitField0_ = (bitField0_ & ~0x00000001); + roomsBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders + ? internalGetRoomsFieldBuilder() + : null; + } else { + roomsBuilder_.addAllMessages(other.rooms_); + } + } + } + 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.showcase.v1beta1.Room m = + input.readMessage(com.google.showcase.v1beta1.Room.parser(), extensionRegistry); + if (roomsBuilder_ == null) { + ensureRoomsIsMutable(); + rooms_.add(m); + } else { + roomsBuilder_.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 rooms_ = + java.util.Collections.emptyList(); + + private void ensureRoomsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + rooms_ = new java.util.ArrayList(rooms_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.google.showcase.v1beta1.Room, + com.google.showcase.v1beta1.Room.Builder, + com.google.showcase.v1beta1.RoomOrBuilder> + roomsBuilder_; + + /** + * + * + *
        +     * The list of rooms.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Room rooms = 1; + */ + public java.util.List getRoomsList() { + if (roomsBuilder_ == null) { + return java.util.Collections.unmodifiableList(rooms_); + } else { + return roomsBuilder_.getMessageList(); + } + } + + /** + * + * + *
        +     * The list of rooms.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Room rooms = 1; + */ + public int getRoomsCount() { + if (roomsBuilder_ == null) { + return rooms_.size(); + } else { + return roomsBuilder_.getCount(); + } + } + + /** + * + * + *
        +     * The list of rooms.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Room rooms = 1; + */ + public com.google.showcase.v1beta1.Room getRooms(int index) { + if (roomsBuilder_ == null) { + return rooms_.get(index); + } else { + return roomsBuilder_.getMessage(index); + } + } + + /** + * + * + *
        +     * The list of rooms.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Room rooms = 1; + */ + public Builder setRooms(int index, com.google.showcase.v1beta1.Room value) { + if (roomsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureRoomsIsMutable(); + rooms_.set(index, value); + onChanged(); + } else { + roomsBuilder_.setMessage(index, value); + } + return this; + } + + /** + * + * + *
        +     * The list of rooms.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Room rooms = 1; + */ + public Builder setRooms(int index, com.google.showcase.v1beta1.Room.Builder builderForValue) { + if (roomsBuilder_ == null) { + ensureRoomsIsMutable(); + rooms_.set(index, builderForValue.build()); + onChanged(); + } else { + roomsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
        +     * The list of rooms.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Room rooms = 1; + */ + public Builder addRooms(com.google.showcase.v1beta1.Room value) { + if (roomsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureRoomsIsMutable(); + rooms_.add(value); + onChanged(); + } else { + roomsBuilder_.addMessage(value); + } + return this; + } + + /** + * + * + *
        +     * The list of rooms.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Room rooms = 1; + */ + public Builder addRooms(int index, com.google.showcase.v1beta1.Room value) { + if (roomsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureRoomsIsMutable(); + rooms_.add(index, value); + onChanged(); + } else { + roomsBuilder_.addMessage(index, value); + } + return this; + } + + /** + * + * + *
        +     * The list of rooms.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Room rooms = 1; + */ + public Builder addRooms(com.google.showcase.v1beta1.Room.Builder builderForValue) { + if (roomsBuilder_ == null) { + ensureRoomsIsMutable(); + rooms_.add(builderForValue.build()); + onChanged(); + } else { + roomsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + + /** + * + * + *
        +     * The list of rooms.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Room rooms = 1; + */ + public Builder addRooms(int index, com.google.showcase.v1beta1.Room.Builder builderForValue) { + if (roomsBuilder_ == null) { + ensureRoomsIsMutable(); + rooms_.add(index, builderForValue.build()); + onChanged(); + } else { + roomsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
        +     * The list of rooms.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Room rooms = 1; + */ + public Builder addAllRooms( + java.lang.Iterable values) { + if (roomsBuilder_ == null) { + ensureRoomsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, rooms_); + onChanged(); + } else { + roomsBuilder_.addAllMessages(values); + } + return this; + } + + /** + * + * + *
        +     * The list of rooms.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Room rooms = 1; + */ + public Builder clearRooms() { + if (roomsBuilder_ == null) { + rooms_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + roomsBuilder_.clear(); + } + return this; + } + + /** + * + * + *
        +     * The list of rooms.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Room rooms = 1; + */ + public Builder removeRooms(int index) { + if (roomsBuilder_ == null) { + ensureRoomsIsMutable(); + rooms_.remove(index); + onChanged(); + } else { + roomsBuilder_.remove(index); + } + return this; + } + + /** + * + * + *
        +     * The list of rooms.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Room rooms = 1; + */ + public com.google.showcase.v1beta1.Room.Builder getRoomsBuilder(int index) { + return internalGetRoomsFieldBuilder().getBuilder(index); + } + + /** + * + * + *
        +     * The list of rooms.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Room rooms = 1; + */ + public com.google.showcase.v1beta1.RoomOrBuilder getRoomsOrBuilder(int index) { + if (roomsBuilder_ == null) { + return rooms_.get(index); + } else { + return roomsBuilder_.getMessageOrBuilder(index); + } + } + + /** + * + * + *
        +     * The list of rooms.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Room rooms = 1; + */ + public java.util.List + getRoomsOrBuilderList() { + if (roomsBuilder_ != null) { + return roomsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(rooms_); + } + } + + /** + * + * + *
        +     * The list of rooms.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Room rooms = 1; + */ + public com.google.showcase.v1beta1.Room.Builder addRoomsBuilder() { + return internalGetRoomsFieldBuilder() + .addBuilder(com.google.showcase.v1beta1.Room.getDefaultInstance()); + } + + /** + * + * + *
        +     * The list of rooms.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Room rooms = 1; + */ + public com.google.showcase.v1beta1.Room.Builder addRoomsBuilder(int index) { + return internalGetRoomsFieldBuilder() + .addBuilder(index, com.google.showcase.v1beta1.Room.getDefaultInstance()); + } + + /** + * + * + *
        +     * The list of rooms.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Room rooms = 1; + */ + public java.util.List getRoomsBuilderList() { + return internalGetRoomsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.google.showcase.v1beta1.Room, + com.google.showcase.v1beta1.Room.Builder, + com.google.showcase.v1beta1.RoomOrBuilder> + internalGetRoomsFieldBuilder() { + if (roomsBuilder_ == null) { + roomsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilder< + com.google.showcase.v1beta1.Room, + com.google.showcase.v1beta1.Room.Builder, + com.google.showcase.v1beta1.RoomOrBuilder>( + rooms_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + rooms_ = null; + } + return roomsBuilder_; + } + + private java.lang.Object nextPageToken_ = ""; + + /** + * + * + *
        +     * A token to retrieve next page of results.
        +     * Pass this value in ListRoomsRequest.page_token field in the subsequent
        +     * call to `google.showcase.v1beta1.Messaging\ListRooms` method to retrieve
        +     * the next page of results.
        +     * 
        + * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nextPageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
        +     * A token to retrieve next page of results.
        +     * Pass this value in ListRoomsRequest.page_token field in the subsequent
        +     * call to `google.showcase.v1beta1.Messaging\ListRooms` method to retrieve
        +     * the next page of results.
        +     * 
        + * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + public com.google.protobuf.ByteString getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + nextPageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
        +     * A token to retrieve next page of results.
        +     * Pass this value in ListRoomsRequest.page_token field in the subsequent
        +     * call to `google.showcase.v1beta1.Messaging\ListRooms` method to retrieve
        +     * the next page of results.
        +     * 
        + * + * string next_page_token = 2; + * + * @param value The nextPageToken to set. + * @return This builder for chaining. + */ + public Builder setNextPageToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + nextPageToken_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
        +     * A token to retrieve next page of results.
        +     * Pass this value in ListRoomsRequest.page_token field in the subsequent
        +     * call to `google.showcase.v1beta1.Messaging\ListRooms` method to retrieve
        +     * the next page of results.
        +     * 
        + * + * string next_page_token = 2; + * + * @return This builder for chaining. + */ + public Builder clearNextPageToken() { + nextPageToken_ = getDefaultInstance().getNextPageToken(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
        +     * A token to retrieve next page of results.
        +     * Pass this value in ListRoomsRequest.page_token field in the subsequent
        +     * call to `google.showcase.v1beta1.Messaging\ListRooms` method to retrieve
        +     * the next page of results.
        +     * 
        + * + * string next_page_token = 2; + * + * @param value The bytes for nextPageToken to set. + * @return This builder for chaining. + */ + public Builder setNextPageTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + nextPageToken_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.showcase.v1beta1.ListRoomsResponse) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.ListRoomsResponse) + private static final com.google.showcase.v1beta1.ListRoomsResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.ListRoomsResponse(); + } + + public static com.google.showcase.v1beta1.ListRoomsResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListRoomsResponse 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.showcase.v1beta1.ListRoomsResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListRoomsResponseOrBuilder.java b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListRoomsResponseOrBuilder.java new file mode 100644 index 0000000000..c3ec2a369b --- /dev/null +++ b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListRoomsResponseOrBuilder.java @@ -0,0 +1,115 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: schema/google/showcase/v1beta1/messaging.proto +// Protobuf Java Version: 4.33.2 + +package com.google.showcase.v1beta1; + +@com.google.protobuf.Generated +public interface ListRoomsResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.ListRoomsResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
        +   * The list of rooms.
        +   * 
        + * + * repeated .google.showcase.v1beta1.Room rooms = 1; + */ + java.util.List getRoomsList(); + + /** + * + * + *
        +   * The list of rooms.
        +   * 
        + * + * repeated .google.showcase.v1beta1.Room rooms = 1; + */ + com.google.showcase.v1beta1.Room getRooms(int index); + + /** + * + * + *
        +   * The list of rooms.
        +   * 
        + * + * repeated .google.showcase.v1beta1.Room rooms = 1; + */ + int getRoomsCount(); + + /** + * + * + *
        +   * The list of rooms.
        +   * 
        + * + * repeated .google.showcase.v1beta1.Room rooms = 1; + */ + java.util.List getRoomsOrBuilderList(); + + /** + * + * + *
        +   * The list of rooms.
        +   * 
        + * + * repeated .google.showcase.v1beta1.Room rooms = 1; + */ + com.google.showcase.v1beta1.RoomOrBuilder getRoomsOrBuilder(int index); + + /** + * + * + *
        +   * A token to retrieve next page of results.
        +   * Pass this value in ListRoomsRequest.page_token field in the subsequent
        +   * call to `google.showcase.v1beta1.Messaging\ListRooms` method to retrieve
        +   * the next page of results.
        +   * 
        + * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + java.lang.String getNextPageToken(); + + /** + * + * + *
        +   * A token to retrieve next page of results.
        +   * Pass this value in ListRoomsRequest.page_token field in the subsequent
        +   * call to `google.showcase.v1beta1.Messaging\ListRooms` method to retrieve
        +   * the next page of results.
        +   * 
        + * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + com.google.protobuf.ByteString getNextPageTokenBytes(); +} diff --git a/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListSessionsRequest.java b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListSessionsRequest.java new file mode 100644 index 0000000000..5ef07054c5 --- /dev/null +++ b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListSessionsRequest.java @@ -0,0 +1,693 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: schema/google/showcase/v1beta1/testing.proto +// Protobuf Java Version: 4.33.2 + +package com.google.showcase.v1beta1; + +/** + * + * + *
        + * The request for the ListSessions method.
        + * 
        + * + * Protobuf type {@code google.showcase.v1beta1.ListSessionsRequest} + */ +@com.google.protobuf.Generated +public final class ListSessionsRequest extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.ListSessionsRequest) + ListSessionsRequestOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "ListSessionsRequest"); + } + + // Use ListSessionsRequest.newBuilder() to construct. + private ListSessionsRequest(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private ListSessionsRequest() { + pageToken_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.TestingOuterClass + .internal_static_google_showcase_v1beta1_ListSessionsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.TestingOuterClass + .internal_static_google_showcase_v1beta1_ListSessionsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.ListSessionsRequest.class, + com.google.showcase.v1beta1.ListSessionsRequest.Builder.class); + } + + public static final int PAGE_SIZE_FIELD_NUMBER = 1; + private int pageSize_ = 0; + + /** + * + * + *
        +   * The maximum number of sessions to return per page.
        +   * 
        + * + * int32 page_size = 1; + * + * @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_ = ""; + + /** + * + * + *
        +   * The page token, for retrieving subsequent pages.
        +   * 
        + * + * string page_token = 2; + * + * @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; + } + } + + /** + * + * + *
        +   * The page token, for retrieving subsequent pages.
        +   * 
        + * + * string page_token = 2; + * + * @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.GeneratedMessage.isStringEmpty(pageToken_)) { + com.google.protobuf.GeneratedMessage.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.GeneratedMessage.isStringEmpty(pageToken_)) { + size += com.google.protobuf.GeneratedMessage.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.showcase.v1beta1.ListSessionsRequest)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.ListSessionsRequest other = + (com.google.showcase.v1beta1.ListSessionsRequest) 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.showcase.v1beta1.ListSessionsRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.ListSessionsRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.ListSessionsRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.ListSessionsRequest 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.showcase.v1beta1.ListSessionsRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.ListSessionsRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.ListSessionsRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.ListSessionsRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.showcase.v1beta1.ListSessionsRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.ListSessionsRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.showcase.v1beta1.ListSessionsRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.ListSessionsRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.showcase.v1beta1.ListSessionsRequest 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
        +   * The request for the ListSessions method.
        +   * 
        + * + * Protobuf type {@code google.showcase.v1beta1.ListSessionsRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.ListSessionsRequest) + com.google.showcase.v1beta1.ListSessionsRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.TestingOuterClass + .internal_static_google_showcase_v1beta1_ListSessionsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.TestingOuterClass + .internal_static_google_showcase_v1beta1_ListSessionsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.ListSessionsRequest.class, + com.google.showcase.v1beta1.ListSessionsRequest.Builder.class); + } + + // Construct using com.google.showcase.v1beta1.ListSessionsRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.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.showcase.v1beta1.TestingOuterClass + .internal_static_google_showcase_v1beta1_ListSessionsRequest_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.ListSessionsRequest getDefaultInstanceForType() { + return com.google.showcase.v1beta1.ListSessionsRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.ListSessionsRequest build() { + com.google.showcase.v1beta1.ListSessionsRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.ListSessionsRequest buildPartial() { + com.google.showcase.v1beta1.ListSessionsRequest result = + new com.google.showcase.v1beta1.ListSessionsRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.showcase.v1beta1.ListSessionsRequest 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 mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.showcase.v1beta1.ListSessionsRequest) { + return mergeFrom((com.google.showcase.v1beta1.ListSessionsRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.showcase.v1beta1.ListSessionsRequest other) { + if (other == com.google.showcase.v1beta1.ListSessionsRequest.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_; + + /** + * + * + *
        +     * The maximum number of sessions to return per page.
        +     * 
        + * + * int32 page_size = 1; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + + /** + * + * + *
        +     * The maximum number of sessions to return per page.
        +     * 
        + * + * int32 page_size = 1; + * + * @param value The pageSize to set. + * @return This builder for chaining. + */ + public Builder setPageSize(int value) { + + pageSize_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
        +     * The maximum number of sessions to return per page.
        +     * 
        + * + * int32 page_size = 1; + * + * @return This builder for chaining. + */ + public Builder clearPageSize() { + bitField0_ = (bitField0_ & ~0x00000001); + pageSize_ = 0; + onChanged(); + return this; + } + + private java.lang.Object pageToken_ = ""; + + /** + * + * + *
        +     * The page token, for retrieving subsequent pages.
        +     * 
        + * + * string page_token = 2; + * + * @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; + } + } + + /** + * + * + *
        +     * The page token, for retrieving subsequent pages.
        +     * 
        + * + * string page_token = 2; + * + * @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; + } + } + + /** + * + * + *
        +     * The page token, for retrieving subsequent pages.
        +     * 
        + * + * string page_token = 2; + * + * @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; + } + + /** + * + * + *
        +     * The page token, for retrieving subsequent pages.
        +     * 
        + * + * string page_token = 2; + * + * @return This builder for chaining. + */ + public Builder clearPageToken() { + pageToken_ = getDefaultInstance().getPageToken(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
        +     * The page token, for retrieving subsequent pages.
        +     * 
        + * + * string page_token = 2; + * + * @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; + } + + // @@protoc_insertion_point(builder_scope:google.showcase.v1beta1.ListSessionsRequest) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.ListSessionsRequest) + private static final com.google.showcase.v1beta1.ListSessionsRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.ListSessionsRequest(); + } + + public static com.google.showcase.v1beta1.ListSessionsRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListSessionsRequest 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.showcase.v1beta1.ListSessionsRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListSessionsRequestOrBuilder.java b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListSessionsRequestOrBuilder.java new file mode 100644 index 0000000000..1e2185b93f --- /dev/null +++ b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListSessionsRequestOrBuilder.java @@ -0,0 +1,67 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: schema/google/showcase/v1beta1/testing.proto +// Protobuf Java Version: 4.33.2 + +package com.google.showcase.v1beta1; + +@com.google.protobuf.Generated +public interface ListSessionsRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.ListSessionsRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
        +   * The maximum number of sessions to return per page.
        +   * 
        + * + * int32 page_size = 1; + * + * @return The pageSize. + */ + int getPageSize(); + + /** + * + * + *
        +   * The page token, for retrieving subsequent pages.
        +   * 
        + * + * string page_token = 2; + * + * @return The pageToken. + */ + java.lang.String getPageToken(); + + /** + * + * + *
        +   * The page token, for retrieving subsequent pages.
        +   * 
        + * + * string page_token = 2; + * + * @return The bytes for pageToken. + */ + com.google.protobuf.ByteString getPageTokenBytes(); +} diff --git a/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListSessionsResponse.java b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListSessionsResponse.java new file mode 100644 index 0000000000..688da4cf0f --- /dev/null +++ b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListSessionsResponse.java @@ -0,0 +1,1117 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: schema/google/showcase/v1beta1/testing.proto +// Protobuf Java Version: 4.33.2 + +package com.google.showcase.v1beta1; + +/** + * + * + *
        + * Response for the ListSessions method.
        + * 
        + * + * Protobuf type {@code google.showcase.v1beta1.ListSessionsResponse} + */ +@com.google.protobuf.Generated +public final class ListSessionsResponse extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.ListSessionsResponse) + ListSessionsResponseOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "ListSessionsResponse"); + } + + // Use ListSessionsResponse.newBuilder() to construct. + private ListSessionsResponse(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private ListSessionsResponse() { + sessions_ = java.util.Collections.emptyList(); + nextPageToken_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.TestingOuterClass + .internal_static_google_showcase_v1beta1_ListSessionsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.TestingOuterClass + .internal_static_google_showcase_v1beta1_ListSessionsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.ListSessionsResponse.class, + com.google.showcase.v1beta1.ListSessionsResponse.Builder.class); + } + + public static final int SESSIONS_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private java.util.List sessions_; + + /** + * + * + *
        +   * The sessions being returned.
        +   * 
        + * + * repeated .google.showcase.v1beta1.Session sessions = 1; + */ + @java.lang.Override + public java.util.List getSessionsList() { + return sessions_; + } + + /** + * + * + *
        +   * The sessions being returned.
        +   * 
        + * + * repeated .google.showcase.v1beta1.Session sessions = 1; + */ + @java.lang.Override + public java.util.List + getSessionsOrBuilderList() { + return sessions_; + } + + /** + * + * + *
        +   * The sessions being returned.
        +   * 
        + * + * repeated .google.showcase.v1beta1.Session sessions = 1; + */ + @java.lang.Override + public int getSessionsCount() { + return sessions_.size(); + } + + /** + * + * + *
        +   * The sessions being returned.
        +   * 
        + * + * repeated .google.showcase.v1beta1.Session sessions = 1; + */ + @java.lang.Override + public com.google.showcase.v1beta1.Session getSessions(int index) { + return sessions_.get(index); + } + + /** + * + * + *
        +   * The sessions being returned.
        +   * 
        + * + * repeated .google.showcase.v1beta1.Session sessions = 1; + */ + @java.lang.Override + public com.google.showcase.v1beta1.SessionOrBuilder getSessionsOrBuilder(int index) { + return sessions_.get(index); + } + + public static final int NEXT_PAGE_TOKEN_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object nextPageToken_ = ""; + + /** + * + * + *
        +   * The next page token, if any.
        +   * An empty value here means the last page has been reached.
        +   * 
        + * + * 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; + } + } + + /** + * + * + *
        +   * The next page token, if any.
        +   * An empty value here means the last page has been reached.
        +   * 
        + * + * 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 < sessions_.size(); i++) { + output.writeMessage(1, sessions_.get(i)); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(nextPageToken_)) { + com.google.protobuf.GeneratedMessage.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 < sessions_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, sessions_.get(i)); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(nextPageToken_)) { + size += com.google.protobuf.GeneratedMessage.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.showcase.v1beta1.ListSessionsResponse)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.ListSessionsResponse other = + (com.google.showcase.v1beta1.ListSessionsResponse) obj; + + if (!getSessionsList().equals(other.getSessionsList())) 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 (getSessionsCount() > 0) { + hash = (37 * hash) + SESSIONS_FIELD_NUMBER; + hash = (53 * hash) + getSessionsList().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.showcase.v1beta1.ListSessionsResponse parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.ListSessionsResponse parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.ListSessionsResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.ListSessionsResponse 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.showcase.v1beta1.ListSessionsResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.ListSessionsResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.ListSessionsResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.ListSessionsResponse parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.showcase.v1beta1.ListSessionsResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.ListSessionsResponse parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.showcase.v1beta1.ListSessionsResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.ListSessionsResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.showcase.v1beta1.ListSessionsResponse 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
        +   * Response for the ListSessions method.
        +   * 
        + * + * Protobuf type {@code google.showcase.v1beta1.ListSessionsResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.ListSessionsResponse) + com.google.showcase.v1beta1.ListSessionsResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.TestingOuterClass + .internal_static_google_showcase_v1beta1_ListSessionsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.TestingOuterClass + .internal_static_google_showcase_v1beta1_ListSessionsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.ListSessionsResponse.class, + com.google.showcase.v1beta1.ListSessionsResponse.Builder.class); + } + + // Construct using com.google.showcase.v1beta1.ListSessionsResponse.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (sessionsBuilder_ == null) { + sessions_ = java.util.Collections.emptyList(); + } else { + sessions_ = null; + sessionsBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + nextPageToken_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.showcase.v1beta1.TestingOuterClass + .internal_static_google_showcase_v1beta1_ListSessionsResponse_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.ListSessionsResponse getDefaultInstanceForType() { + return com.google.showcase.v1beta1.ListSessionsResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.ListSessionsResponse build() { + com.google.showcase.v1beta1.ListSessionsResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.ListSessionsResponse buildPartial() { + com.google.showcase.v1beta1.ListSessionsResponse result = + new com.google.showcase.v1beta1.ListSessionsResponse(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields( + com.google.showcase.v1beta1.ListSessionsResponse result) { + if (sessionsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + sessions_ = java.util.Collections.unmodifiableList(sessions_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.sessions_ = sessions_; + } else { + result.sessions_ = sessionsBuilder_.build(); + } + } + + private void buildPartial0(com.google.showcase.v1beta1.ListSessionsResponse result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.nextPageToken_ = nextPageToken_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.showcase.v1beta1.ListSessionsResponse) { + return mergeFrom((com.google.showcase.v1beta1.ListSessionsResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.showcase.v1beta1.ListSessionsResponse other) { + if (other == com.google.showcase.v1beta1.ListSessionsResponse.getDefaultInstance()) + return this; + if (sessionsBuilder_ == null) { + if (!other.sessions_.isEmpty()) { + if (sessions_.isEmpty()) { + sessions_ = other.sessions_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureSessionsIsMutable(); + sessions_.addAll(other.sessions_); + } + onChanged(); + } + } else { + if (!other.sessions_.isEmpty()) { + if (sessionsBuilder_.isEmpty()) { + sessionsBuilder_.dispose(); + sessionsBuilder_ = null; + sessions_ = other.sessions_; + bitField0_ = (bitField0_ & ~0x00000001); + sessionsBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders + ? internalGetSessionsFieldBuilder() + : null; + } else { + sessionsBuilder_.addAllMessages(other.sessions_); + } + } + } + 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.showcase.v1beta1.Session m = + input.readMessage( + com.google.showcase.v1beta1.Session.parser(), extensionRegistry); + if (sessionsBuilder_ == null) { + ensureSessionsIsMutable(); + sessions_.add(m); + } else { + sessionsBuilder_.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 sessions_ = + java.util.Collections.emptyList(); + + private void ensureSessionsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + sessions_ = new java.util.ArrayList(sessions_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.google.showcase.v1beta1.Session, + com.google.showcase.v1beta1.Session.Builder, + com.google.showcase.v1beta1.SessionOrBuilder> + sessionsBuilder_; + + /** + * + * + *
        +     * The sessions being returned.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Session sessions = 1; + */ + public java.util.List getSessionsList() { + if (sessionsBuilder_ == null) { + return java.util.Collections.unmodifiableList(sessions_); + } else { + return sessionsBuilder_.getMessageList(); + } + } + + /** + * + * + *
        +     * The sessions being returned.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Session sessions = 1; + */ + public int getSessionsCount() { + if (sessionsBuilder_ == null) { + return sessions_.size(); + } else { + return sessionsBuilder_.getCount(); + } + } + + /** + * + * + *
        +     * The sessions being returned.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Session sessions = 1; + */ + public com.google.showcase.v1beta1.Session getSessions(int index) { + if (sessionsBuilder_ == null) { + return sessions_.get(index); + } else { + return sessionsBuilder_.getMessage(index); + } + } + + /** + * + * + *
        +     * The sessions being returned.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Session sessions = 1; + */ + public Builder setSessions(int index, com.google.showcase.v1beta1.Session value) { + if (sessionsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureSessionsIsMutable(); + sessions_.set(index, value); + onChanged(); + } else { + sessionsBuilder_.setMessage(index, value); + } + return this; + } + + /** + * + * + *
        +     * The sessions being returned.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Session sessions = 1; + */ + public Builder setSessions( + int index, com.google.showcase.v1beta1.Session.Builder builderForValue) { + if (sessionsBuilder_ == null) { + ensureSessionsIsMutable(); + sessions_.set(index, builderForValue.build()); + onChanged(); + } else { + sessionsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
        +     * The sessions being returned.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Session sessions = 1; + */ + public Builder addSessions(com.google.showcase.v1beta1.Session value) { + if (sessionsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureSessionsIsMutable(); + sessions_.add(value); + onChanged(); + } else { + sessionsBuilder_.addMessage(value); + } + return this; + } + + /** + * + * + *
        +     * The sessions being returned.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Session sessions = 1; + */ + public Builder addSessions(int index, com.google.showcase.v1beta1.Session value) { + if (sessionsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureSessionsIsMutable(); + sessions_.add(index, value); + onChanged(); + } else { + sessionsBuilder_.addMessage(index, value); + } + return this; + } + + /** + * + * + *
        +     * The sessions being returned.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Session sessions = 1; + */ + public Builder addSessions(com.google.showcase.v1beta1.Session.Builder builderForValue) { + if (sessionsBuilder_ == null) { + ensureSessionsIsMutable(); + sessions_.add(builderForValue.build()); + onChanged(); + } else { + sessionsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + + /** + * + * + *
        +     * The sessions being returned.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Session sessions = 1; + */ + public Builder addSessions( + int index, com.google.showcase.v1beta1.Session.Builder builderForValue) { + if (sessionsBuilder_ == null) { + ensureSessionsIsMutable(); + sessions_.add(index, builderForValue.build()); + onChanged(); + } else { + sessionsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
        +     * The sessions being returned.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Session sessions = 1; + */ + public Builder addAllSessions( + java.lang.Iterable values) { + if (sessionsBuilder_ == null) { + ensureSessionsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, sessions_); + onChanged(); + } else { + sessionsBuilder_.addAllMessages(values); + } + return this; + } + + /** + * + * + *
        +     * The sessions being returned.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Session sessions = 1; + */ + public Builder clearSessions() { + if (sessionsBuilder_ == null) { + sessions_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + sessionsBuilder_.clear(); + } + return this; + } + + /** + * + * + *
        +     * The sessions being returned.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Session sessions = 1; + */ + public Builder removeSessions(int index) { + if (sessionsBuilder_ == null) { + ensureSessionsIsMutable(); + sessions_.remove(index); + onChanged(); + } else { + sessionsBuilder_.remove(index); + } + return this; + } + + /** + * + * + *
        +     * The sessions being returned.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Session sessions = 1; + */ + public com.google.showcase.v1beta1.Session.Builder getSessionsBuilder(int index) { + return internalGetSessionsFieldBuilder().getBuilder(index); + } + + /** + * + * + *
        +     * The sessions being returned.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Session sessions = 1; + */ + public com.google.showcase.v1beta1.SessionOrBuilder getSessionsOrBuilder(int index) { + if (sessionsBuilder_ == null) { + return sessions_.get(index); + } else { + return sessionsBuilder_.getMessageOrBuilder(index); + } + } + + /** + * + * + *
        +     * The sessions being returned.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Session sessions = 1; + */ + public java.util.List + getSessionsOrBuilderList() { + if (sessionsBuilder_ != null) { + return sessionsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(sessions_); + } + } + + /** + * + * + *
        +     * The sessions being returned.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Session sessions = 1; + */ + public com.google.showcase.v1beta1.Session.Builder addSessionsBuilder() { + return internalGetSessionsFieldBuilder() + .addBuilder(com.google.showcase.v1beta1.Session.getDefaultInstance()); + } + + /** + * + * + *
        +     * The sessions being returned.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Session sessions = 1; + */ + public com.google.showcase.v1beta1.Session.Builder addSessionsBuilder(int index) { + return internalGetSessionsFieldBuilder() + .addBuilder(index, com.google.showcase.v1beta1.Session.getDefaultInstance()); + } + + /** + * + * + *
        +     * The sessions being returned.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Session sessions = 1; + */ + public java.util.List getSessionsBuilderList() { + return internalGetSessionsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.google.showcase.v1beta1.Session, + com.google.showcase.v1beta1.Session.Builder, + com.google.showcase.v1beta1.SessionOrBuilder> + internalGetSessionsFieldBuilder() { + if (sessionsBuilder_ == null) { + sessionsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilder< + com.google.showcase.v1beta1.Session, + com.google.showcase.v1beta1.Session.Builder, + com.google.showcase.v1beta1.SessionOrBuilder>( + sessions_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + sessions_ = null; + } + return sessionsBuilder_; + } + + private java.lang.Object nextPageToken_ = ""; + + /** + * + * + *
        +     * The next page token, if any.
        +     * An empty value here means the last page has been reached.
        +     * 
        + * + * 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; + } + } + + /** + * + * + *
        +     * The next page token, if any.
        +     * An empty value here means the last page has been reached.
        +     * 
        + * + * 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; + } + } + + /** + * + * + *
        +     * The next page token, if any.
        +     * An empty value here means the last page has been reached.
        +     * 
        + * + * 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; + } + + /** + * + * + *
        +     * The next page token, if any.
        +     * An empty value here means the last page has been reached.
        +     * 
        + * + * string next_page_token = 2; + * + * @return This builder for chaining. + */ + public Builder clearNextPageToken() { + nextPageToken_ = getDefaultInstance().getNextPageToken(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
        +     * The next page token, if any.
        +     * An empty value here means the last page has been reached.
        +     * 
        + * + * 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; + } + + // @@protoc_insertion_point(builder_scope:google.showcase.v1beta1.ListSessionsResponse) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.ListSessionsResponse) + private static final com.google.showcase.v1beta1.ListSessionsResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.ListSessionsResponse(); + } + + public static com.google.showcase.v1beta1.ListSessionsResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListSessionsResponse 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.showcase.v1beta1.ListSessionsResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListSessionsResponseOrBuilder.java b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListSessionsResponseOrBuilder.java new file mode 100644 index 0000000000..80d7d37868 --- /dev/null +++ b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListSessionsResponseOrBuilder.java @@ -0,0 +1,111 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: schema/google/showcase/v1beta1/testing.proto +// Protobuf Java Version: 4.33.2 + +package com.google.showcase.v1beta1; + +@com.google.protobuf.Generated +public interface ListSessionsResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.ListSessionsResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
        +   * The sessions being returned.
        +   * 
        + * + * repeated .google.showcase.v1beta1.Session sessions = 1; + */ + java.util.List getSessionsList(); + + /** + * + * + *
        +   * The sessions being returned.
        +   * 
        + * + * repeated .google.showcase.v1beta1.Session sessions = 1; + */ + com.google.showcase.v1beta1.Session getSessions(int index); + + /** + * + * + *
        +   * The sessions being returned.
        +   * 
        + * + * repeated .google.showcase.v1beta1.Session sessions = 1; + */ + int getSessionsCount(); + + /** + * + * + *
        +   * The sessions being returned.
        +   * 
        + * + * repeated .google.showcase.v1beta1.Session sessions = 1; + */ + java.util.List getSessionsOrBuilderList(); + + /** + * + * + *
        +   * The sessions being returned.
        +   * 
        + * + * repeated .google.showcase.v1beta1.Session sessions = 1; + */ + com.google.showcase.v1beta1.SessionOrBuilder getSessionsOrBuilder(int index); + + /** + * + * + *
        +   * The next page token, if any.
        +   * An empty value here means the last page has been reached.
        +   * 
        + * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + java.lang.String getNextPageToken(); + + /** + * + * + *
        +   * The next page token, if any.
        +   * An empty value here means the last page has been reached.
        +   * 
        + * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + com.google.protobuf.ByteString getNextPageTokenBytes(); +} diff --git a/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListTestsRequest.java b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListTestsRequest.java new file mode 100644 index 0000000000..320243630d --- /dev/null +++ b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListTestsRequest.java @@ -0,0 +1,881 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: schema/google/showcase/v1beta1/testing.proto +// Protobuf Java Version: 4.33.2 + +package com.google.showcase.v1beta1; + +/** + * + * + *
        + * The request for the ListTests method.
        + * 
        + * + * Protobuf type {@code google.showcase.v1beta1.ListTestsRequest} + */ +@com.google.protobuf.Generated +public final class ListTestsRequest extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.ListTestsRequest) + ListTestsRequestOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "ListTestsRequest"); + } + + // Use ListTestsRequest.newBuilder() to construct. + private ListTestsRequest(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private ListTestsRequest() { + parent_ = ""; + pageToken_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.TestingOuterClass + .internal_static_google_showcase_v1beta1_ListTestsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.TestingOuterClass + .internal_static_google_showcase_v1beta1_ListTestsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.ListTestsRequest.class, + com.google.showcase.v1beta1.ListTestsRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object parent_ = ""; + + /** + * + * + *
        +   * The session.
        +   * 
        + * + * string parent = 1 [(.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; + } + } + + /** + * + * + *
        +   * The session.
        +   * 
        + * + * string parent = 1 [(.google.api.resource_reference) = { ... } + * + * @return The bytes for parent. + */ + @java.lang.Override + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PAGE_SIZE_FIELD_NUMBER = 2; + private int pageSize_ = 0; + + /** + * + * + *
        +   * The maximum number of tests to return per page.
        +   * 
        + * + * int32 page_size = 2; + * + * @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_ = ""; + + /** + * + * + *
        +   * The page token, for retrieving subsequent pages.
        +   * 
        + * + * string page_token = 3; + * + * @return The pageToken. + */ + @java.lang.Override + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; + } + } + + /** + * + * + *
        +   * The page token, for retrieving subsequent pages.
        +   * 
        + * + * string page_token = 3; + * + * @return The bytes for pageToken. + */ + @java.lang.Override + public com.google.protobuf.ByteString getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(parent_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, parent_); + } + if (pageSize_ != 0) { + output.writeInt32(2, pageSize_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(pageToken_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 3, pageToken_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(parent_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, parent_); + } + if (pageSize_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(2, pageSize_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(pageToken_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(3, 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.showcase.v1beta1.ListTestsRequest)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.ListTestsRequest other = + (com.google.showcase.v1beta1.ListTestsRequest) obj; + + if (!getParent().equals(other.getParent())) 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(); + 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.showcase.v1beta1.ListTestsRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.ListTestsRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.ListTestsRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.ListTestsRequest 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.showcase.v1beta1.ListTestsRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.ListTestsRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.ListTestsRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.ListTestsRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.showcase.v1beta1.ListTestsRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.ListTestsRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.showcase.v1beta1.ListTestsRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.ListTestsRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.showcase.v1beta1.ListTestsRequest 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
        +   * The request for the ListTests method.
        +   * 
        + * + * Protobuf type {@code google.showcase.v1beta1.ListTestsRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.ListTestsRequest) + com.google.showcase.v1beta1.ListTestsRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.TestingOuterClass + .internal_static_google_showcase_v1beta1_ListTestsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.TestingOuterClass + .internal_static_google_showcase_v1beta1_ListTestsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.ListTestsRequest.class, + com.google.showcase.v1beta1.ListTestsRequest.Builder.class); + } + + // Construct using com.google.showcase.v1beta1.ListTestsRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + parent_ = ""; + pageSize_ = 0; + pageToken_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.showcase.v1beta1.TestingOuterClass + .internal_static_google_showcase_v1beta1_ListTestsRequest_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.ListTestsRequest getDefaultInstanceForType() { + return com.google.showcase.v1beta1.ListTestsRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.ListTestsRequest build() { + com.google.showcase.v1beta1.ListTestsRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.ListTestsRequest buildPartial() { + com.google.showcase.v1beta1.ListTestsRequest result = + new com.google.showcase.v1beta1.ListTestsRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.showcase.v1beta1.ListTestsRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.parent_ = parent_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.pageSize_ = pageSize_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.pageToken_ = pageToken_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.showcase.v1beta1.ListTestsRequest) { + return mergeFrom((com.google.showcase.v1beta1.ListTestsRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.showcase.v1beta1.ListTestsRequest other) { + if (other == com.google.showcase.v1beta1.ListTestsRequest.getDefaultInstance()) return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.getPageSize() != 0) { + setPageSize(other.getPageSize()); + } + if (!other.getPageToken().isEmpty()) { + pageToken_ = other.pageToken_; + 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 16: + { + pageSize_ = input.readInt32(); + bitField0_ |= 0x00000002; + break; + } // case 16 + case 26: + { + pageToken_ = 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_ = ""; + + /** + * + * + *
        +     * The session.
        +     * 
        + * + * string parent = 1 [(.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; + } + } + + /** + * + * + *
        +     * The session.
        +     * 
        + * + * string parent = 1 [(.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; + } + } + + /** + * + * + *
        +     * The session.
        +     * 
        + * + * string parent = 1 [(.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; + } + + /** + * + * + *
        +     * The session.
        +     * 
        + * + * string parent = 1 [(.google.api.resource_reference) = { ... } + * + * @return This builder for chaining. + */ + public Builder clearParent() { + parent_ = getDefaultInstance().getParent(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
        +     * The session.
        +     * 
        + * + * string parent = 1 [(.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 int pageSize_; + + /** + * + * + *
        +     * The maximum number of tests to return per page.
        +     * 
        + * + * int32 page_size = 2; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + + /** + * + * + *
        +     * The maximum number of tests to return per page.
        +     * 
        + * + * int32 page_size = 2; + * + * @param value The pageSize to set. + * @return This builder for chaining. + */ + public Builder setPageSize(int value) { + + pageSize_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
        +     * The maximum number of tests to return per page.
        +     * 
        + * + * int32 page_size = 2; + * + * @return This builder for chaining. + */ + public Builder clearPageSize() { + bitField0_ = (bitField0_ & ~0x00000002); + pageSize_ = 0; + onChanged(); + return this; + } + + private java.lang.Object pageToken_ = ""; + + /** + * + * + *
        +     * The page token, for retrieving subsequent pages.
        +     * 
        + * + * string page_token = 3; + * + * @return The pageToken. + */ + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
        +     * The page token, for retrieving subsequent pages.
        +     * 
        + * + * string page_token = 3; + * + * @return The bytes for pageToken. + */ + public com.google.protobuf.ByteString getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
        +     * The page token, for retrieving subsequent pages.
        +     * 
        + * + * string page_token = 3; + * + * @param value The pageToken to set. + * @return This builder for chaining. + */ + public Builder setPageToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + pageToken_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
        +     * The page token, for retrieving subsequent pages.
        +     * 
        + * + * string page_token = 3; + * + * @return This builder for chaining. + */ + public Builder clearPageToken() { + pageToken_ = getDefaultInstance().getPageToken(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + + /** + * + * + *
        +     * The page token, for retrieving subsequent pages.
        +     * 
        + * + * string page_token = 3; + * + * @param value The bytes for pageToken to set. + * @return This builder for chaining. + */ + public Builder setPageTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + pageToken_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.showcase.v1beta1.ListTestsRequest) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.ListTestsRequest) + private static final com.google.showcase.v1beta1.ListTestsRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.ListTestsRequest(); + } + + public static com.google.showcase.v1beta1.ListTestsRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListTestsRequest 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.showcase.v1beta1.ListTestsRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListTestsRequestOrBuilder.java b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListTestsRequestOrBuilder.java new file mode 100644 index 0000000000..1a0de1127a --- /dev/null +++ b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListTestsRequestOrBuilder.java @@ -0,0 +1,93 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: schema/google/showcase/v1beta1/testing.proto +// Protobuf Java Version: 4.33.2 + +package com.google.showcase.v1beta1; + +@com.google.protobuf.Generated +public interface ListTestsRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.ListTestsRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
        +   * The session.
        +   * 
        + * + * string parent = 1 [(.google.api.resource_reference) = { ... } + * + * @return The parent. + */ + java.lang.String getParent(); + + /** + * + * + *
        +   * The session.
        +   * 
        + * + * string parent = 1 [(.google.api.resource_reference) = { ... } + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
        +   * The maximum number of tests to return per page.
        +   * 
        + * + * int32 page_size = 2; + * + * @return The pageSize. + */ + int getPageSize(); + + /** + * + * + *
        +   * The page token, for retrieving subsequent pages.
        +   * 
        + * + * string page_token = 3; + * + * @return The pageToken. + */ + java.lang.String getPageToken(); + + /** + * + * + *
        +   * The page token, for retrieving subsequent pages.
        +   * 
        + * + * string page_token = 3; + * + * @return The bytes for pageToken. + */ + com.google.protobuf.ByteString getPageTokenBytes(); +} diff --git a/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListTestsResponse.java b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListTestsResponse.java new file mode 100644 index 0000000000..c5ceabb561 --- /dev/null +++ b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListTestsResponse.java @@ -0,0 +1,1112 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: schema/google/showcase/v1beta1/testing.proto +// Protobuf Java Version: 4.33.2 + +package com.google.showcase.v1beta1; + +/** + * + * + *
        + * The response for the ListTests method.
        + * 
        + * + * Protobuf type {@code google.showcase.v1beta1.ListTestsResponse} + */ +@com.google.protobuf.Generated +public final class ListTestsResponse extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.ListTestsResponse) + ListTestsResponseOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "ListTestsResponse"); + } + + // Use ListTestsResponse.newBuilder() to construct. + private ListTestsResponse(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private ListTestsResponse() { + tests_ = java.util.Collections.emptyList(); + nextPageToken_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.TestingOuterClass + .internal_static_google_showcase_v1beta1_ListTestsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.TestingOuterClass + .internal_static_google_showcase_v1beta1_ListTestsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.ListTestsResponse.class, + com.google.showcase.v1beta1.ListTestsResponse.Builder.class); + } + + public static final int TESTS_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private java.util.List tests_; + + /** + * + * + *
        +   * The tests being returned.
        +   * 
        + * + * repeated .google.showcase.v1beta1.Test tests = 1; + */ + @java.lang.Override + public java.util.List getTestsList() { + return tests_; + } + + /** + * + * + *
        +   * The tests being returned.
        +   * 
        + * + * repeated .google.showcase.v1beta1.Test tests = 1; + */ + @java.lang.Override + public java.util.List + getTestsOrBuilderList() { + return tests_; + } + + /** + * + * + *
        +   * The tests being returned.
        +   * 
        + * + * repeated .google.showcase.v1beta1.Test tests = 1; + */ + @java.lang.Override + public int getTestsCount() { + return tests_.size(); + } + + /** + * + * + *
        +   * The tests being returned.
        +   * 
        + * + * repeated .google.showcase.v1beta1.Test tests = 1; + */ + @java.lang.Override + public com.google.showcase.v1beta1.Test getTests(int index) { + return tests_.get(index); + } + + /** + * + * + *
        +   * The tests being returned.
        +   * 
        + * + * repeated .google.showcase.v1beta1.Test tests = 1; + */ + @java.lang.Override + public com.google.showcase.v1beta1.TestOrBuilder getTestsOrBuilder(int index) { + return tests_.get(index); + } + + public static final int NEXT_PAGE_TOKEN_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object nextPageToken_ = ""; + + /** + * + * + *
        +   * The next page token, if any.
        +   * An empty value here means the last page has been reached.
        +   * 
        + * + * 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; + } + } + + /** + * + * + *
        +   * The next page token, if any.
        +   * An empty value here means the last page has been reached.
        +   * 
        + * + * 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 < tests_.size(); i++) { + output.writeMessage(1, tests_.get(i)); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(nextPageToken_)) { + com.google.protobuf.GeneratedMessage.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 < tests_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, tests_.get(i)); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(nextPageToken_)) { + size += com.google.protobuf.GeneratedMessage.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.showcase.v1beta1.ListTestsResponse)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.ListTestsResponse other = + (com.google.showcase.v1beta1.ListTestsResponse) obj; + + if (!getTestsList().equals(other.getTestsList())) 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 (getTestsCount() > 0) { + hash = (37 * hash) + TESTS_FIELD_NUMBER; + hash = (53 * hash) + getTestsList().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.showcase.v1beta1.ListTestsResponse parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.ListTestsResponse parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.ListTestsResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.ListTestsResponse 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.showcase.v1beta1.ListTestsResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.ListTestsResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.ListTestsResponse parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.ListTestsResponse parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.showcase.v1beta1.ListTestsResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.ListTestsResponse parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.showcase.v1beta1.ListTestsResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.ListTestsResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.showcase.v1beta1.ListTestsResponse 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
        +   * The response for the ListTests method.
        +   * 
        + * + * Protobuf type {@code google.showcase.v1beta1.ListTestsResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.ListTestsResponse) + com.google.showcase.v1beta1.ListTestsResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.TestingOuterClass + .internal_static_google_showcase_v1beta1_ListTestsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.TestingOuterClass + .internal_static_google_showcase_v1beta1_ListTestsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.ListTestsResponse.class, + com.google.showcase.v1beta1.ListTestsResponse.Builder.class); + } + + // Construct using com.google.showcase.v1beta1.ListTestsResponse.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (testsBuilder_ == null) { + tests_ = java.util.Collections.emptyList(); + } else { + tests_ = null; + testsBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + nextPageToken_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.showcase.v1beta1.TestingOuterClass + .internal_static_google_showcase_v1beta1_ListTestsResponse_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.ListTestsResponse getDefaultInstanceForType() { + return com.google.showcase.v1beta1.ListTestsResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.ListTestsResponse build() { + com.google.showcase.v1beta1.ListTestsResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.ListTestsResponse buildPartial() { + com.google.showcase.v1beta1.ListTestsResponse result = + new com.google.showcase.v1beta1.ListTestsResponse(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields(com.google.showcase.v1beta1.ListTestsResponse result) { + if (testsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + tests_ = java.util.Collections.unmodifiableList(tests_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.tests_ = tests_; + } else { + result.tests_ = testsBuilder_.build(); + } + } + + private void buildPartial0(com.google.showcase.v1beta1.ListTestsResponse result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.nextPageToken_ = nextPageToken_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.showcase.v1beta1.ListTestsResponse) { + return mergeFrom((com.google.showcase.v1beta1.ListTestsResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.showcase.v1beta1.ListTestsResponse other) { + if (other == com.google.showcase.v1beta1.ListTestsResponse.getDefaultInstance()) return this; + if (testsBuilder_ == null) { + if (!other.tests_.isEmpty()) { + if (tests_.isEmpty()) { + tests_ = other.tests_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureTestsIsMutable(); + tests_.addAll(other.tests_); + } + onChanged(); + } + } else { + if (!other.tests_.isEmpty()) { + if (testsBuilder_.isEmpty()) { + testsBuilder_.dispose(); + testsBuilder_ = null; + tests_ = other.tests_; + bitField0_ = (bitField0_ & ~0x00000001); + testsBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders + ? internalGetTestsFieldBuilder() + : null; + } else { + testsBuilder_.addAllMessages(other.tests_); + } + } + } + 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.showcase.v1beta1.Test m = + input.readMessage(com.google.showcase.v1beta1.Test.parser(), extensionRegistry); + if (testsBuilder_ == null) { + ensureTestsIsMutable(); + tests_.add(m); + } else { + testsBuilder_.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 tests_ = + java.util.Collections.emptyList(); + + private void ensureTestsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + tests_ = new java.util.ArrayList(tests_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.google.showcase.v1beta1.Test, + com.google.showcase.v1beta1.Test.Builder, + com.google.showcase.v1beta1.TestOrBuilder> + testsBuilder_; + + /** + * + * + *
        +     * The tests being returned.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Test tests = 1; + */ + public java.util.List getTestsList() { + if (testsBuilder_ == null) { + return java.util.Collections.unmodifiableList(tests_); + } else { + return testsBuilder_.getMessageList(); + } + } + + /** + * + * + *
        +     * The tests being returned.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Test tests = 1; + */ + public int getTestsCount() { + if (testsBuilder_ == null) { + return tests_.size(); + } else { + return testsBuilder_.getCount(); + } + } + + /** + * + * + *
        +     * The tests being returned.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Test tests = 1; + */ + public com.google.showcase.v1beta1.Test getTests(int index) { + if (testsBuilder_ == null) { + return tests_.get(index); + } else { + return testsBuilder_.getMessage(index); + } + } + + /** + * + * + *
        +     * The tests being returned.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Test tests = 1; + */ + public Builder setTests(int index, com.google.showcase.v1beta1.Test value) { + if (testsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureTestsIsMutable(); + tests_.set(index, value); + onChanged(); + } else { + testsBuilder_.setMessage(index, value); + } + return this; + } + + /** + * + * + *
        +     * The tests being returned.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Test tests = 1; + */ + public Builder setTests(int index, com.google.showcase.v1beta1.Test.Builder builderForValue) { + if (testsBuilder_ == null) { + ensureTestsIsMutable(); + tests_.set(index, builderForValue.build()); + onChanged(); + } else { + testsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
        +     * The tests being returned.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Test tests = 1; + */ + public Builder addTests(com.google.showcase.v1beta1.Test value) { + if (testsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureTestsIsMutable(); + tests_.add(value); + onChanged(); + } else { + testsBuilder_.addMessage(value); + } + return this; + } + + /** + * + * + *
        +     * The tests being returned.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Test tests = 1; + */ + public Builder addTests(int index, com.google.showcase.v1beta1.Test value) { + if (testsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureTestsIsMutable(); + tests_.add(index, value); + onChanged(); + } else { + testsBuilder_.addMessage(index, value); + } + return this; + } + + /** + * + * + *
        +     * The tests being returned.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Test tests = 1; + */ + public Builder addTests(com.google.showcase.v1beta1.Test.Builder builderForValue) { + if (testsBuilder_ == null) { + ensureTestsIsMutable(); + tests_.add(builderForValue.build()); + onChanged(); + } else { + testsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + + /** + * + * + *
        +     * The tests being returned.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Test tests = 1; + */ + public Builder addTests(int index, com.google.showcase.v1beta1.Test.Builder builderForValue) { + if (testsBuilder_ == null) { + ensureTestsIsMutable(); + tests_.add(index, builderForValue.build()); + onChanged(); + } else { + testsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
        +     * The tests being returned.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Test tests = 1; + */ + public Builder addAllTests( + java.lang.Iterable values) { + if (testsBuilder_ == null) { + ensureTestsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, tests_); + onChanged(); + } else { + testsBuilder_.addAllMessages(values); + } + return this; + } + + /** + * + * + *
        +     * The tests being returned.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Test tests = 1; + */ + public Builder clearTests() { + if (testsBuilder_ == null) { + tests_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + testsBuilder_.clear(); + } + return this; + } + + /** + * + * + *
        +     * The tests being returned.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Test tests = 1; + */ + public Builder removeTests(int index) { + if (testsBuilder_ == null) { + ensureTestsIsMutable(); + tests_.remove(index); + onChanged(); + } else { + testsBuilder_.remove(index); + } + return this; + } + + /** + * + * + *
        +     * The tests being returned.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Test tests = 1; + */ + public com.google.showcase.v1beta1.Test.Builder getTestsBuilder(int index) { + return internalGetTestsFieldBuilder().getBuilder(index); + } + + /** + * + * + *
        +     * The tests being returned.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Test tests = 1; + */ + public com.google.showcase.v1beta1.TestOrBuilder getTestsOrBuilder(int index) { + if (testsBuilder_ == null) { + return tests_.get(index); + } else { + return testsBuilder_.getMessageOrBuilder(index); + } + } + + /** + * + * + *
        +     * The tests being returned.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Test tests = 1; + */ + public java.util.List + getTestsOrBuilderList() { + if (testsBuilder_ != null) { + return testsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(tests_); + } + } + + /** + * + * + *
        +     * The tests being returned.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Test tests = 1; + */ + public com.google.showcase.v1beta1.Test.Builder addTestsBuilder() { + return internalGetTestsFieldBuilder() + .addBuilder(com.google.showcase.v1beta1.Test.getDefaultInstance()); + } + + /** + * + * + *
        +     * The tests being returned.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Test tests = 1; + */ + public com.google.showcase.v1beta1.Test.Builder addTestsBuilder(int index) { + return internalGetTestsFieldBuilder() + .addBuilder(index, com.google.showcase.v1beta1.Test.getDefaultInstance()); + } + + /** + * + * + *
        +     * The tests being returned.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Test tests = 1; + */ + public java.util.List getTestsBuilderList() { + return internalGetTestsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.google.showcase.v1beta1.Test, + com.google.showcase.v1beta1.Test.Builder, + com.google.showcase.v1beta1.TestOrBuilder> + internalGetTestsFieldBuilder() { + if (testsBuilder_ == null) { + testsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilder< + com.google.showcase.v1beta1.Test, + com.google.showcase.v1beta1.Test.Builder, + com.google.showcase.v1beta1.TestOrBuilder>( + tests_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + tests_ = null; + } + return testsBuilder_; + } + + private java.lang.Object nextPageToken_ = ""; + + /** + * + * + *
        +     * The next page token, if any.
        +     * An empty value here means the last page has been reached.
        +     * 
        + * + * 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; + } + } + + /** + * + * + *
        +     * The next page token, if any.
        +     * An empty value here means the last page has been reached.
        +     * 
        + * + * 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; + } + } + + /** + * + * + *
        +     * The next page token, if any.
        +     * An empty value here means the last page has been reached.
        +     * 
        + * + * 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; + } + + /** + * + * + *
        +     * The next page token, if any.
        +     * An empty value here means the last page has been reached.
        +     * 
        + * + * string next_page_token = 2; + * + * @return This builder for chaining. + */ + public Builder clearNextPageToken() { + nextPageToken_ = getDefaultInstance().getNextPageToken(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
        +     * The next page token, if any.
        +     * An empty value here means the last page has been reached.
        +     * 
        + * + * 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; + } + + // @@protoc_insertion_point(builder_scope:google.showcase.v1beta1.ListTestsResponse) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.ListTestsResponse) + private static final com.google.showcase.v1beta1.ListTestsResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.ListTestsResponse(); + } + + public static com.google.showcase.v1beta1.ListTestsResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListTestsResponse 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.showcase.v1beta1.ListTestsResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListTestsResponseOrBuilder.java b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListTestsResponseOrBuilder.java new file mode 100644 index 0000000000..6cd117cad7 --- /dev/null +++ b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListTestsResponseOrBuilder.java @@ -0,0 +1,111 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: schema/google/showcase/v1beta1/testing.proto +// Protobuf Java Version: 4.33.2 + +package com.google.showcase.v1beta1; + +@com.google.protobuf.Generated +public interface ListTestsResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.ListTestsResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
        +   * The tests being returned.
        +   * 
        + * + * repeated .google.showcase.v1beta1.Test tests = 1; + */ + java.util.List getTestsList(); + + /** + * + * + *
        +   * The tests being returned.
        +   * 
        + * + * repeated .google.showcase.v1beta1.Test tests = 1; + */ + com.google.showcase.v1beta1.Test getTests(int index); + + /** + * + * + *
        +   * The tests being returned.
        +   * 
        + * + * repeated .google.showcase.v1beta1.Test tests = 1; + */ + int getTestsCount(); + + /** + * + * + *
        +   * The tests being returned.
        +   * 
        + * + * repeated .google.showcase.v1beta1.Test tests = 1; + */ + java.util.List getTestsOrBuilderList(); + + /** + * + * + *
        +   * The tests being returned.
        +   * 
        + * + * repeated .google.showcase.v1beta1.Test tests = 1; + */ + com.google.showcase.v1beta1.TestOrBuilder getTestsOrBuilder(int index); + + /** + * + * + *
        +   * The next page token, if any.
        +   * An empty value here means the last page has been reached.
        +   * 
        + * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + java.lang.String getNextPageToken(); + + /** + * + * + *
        +   * The next page token, if any.
        +   * An empty value here means the last page has been reached.
        +   * 
        + * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + com.google.protobuf.ByteString getNextPageTokenBytes(); +} diff --git a/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListUsersRequest.java b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListUsersRequest.java new file mode 100644 index 0000000000..f8fc68a0b7 --- /dev/null +++ b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListUsersRequest.java @@ -0,0 +1,712 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: schema/google/showcase/v1beta1/identity.proto +// Protobuf Java Version: 4.33.2 + +package com.google.showcase.v1beta1; + +/** + * + * + *
        + * The request message for the google.showcase.v1beta1.Identity\ListUsers
        + * method.
        + * 
        + * + * Protobuf type {@code google.showcase.v1beta1.ListUsersRequest} + */ +@com.google.protobuf.Generated +public final class ListUsersRequest extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.ListUsersRequest) + ListUsersRequestOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "ListUsersRequest"); + } + + // Use ListUsersRequest.newBuilder() to construct. + private ListUsersRequest(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private ListUsersRequest() { + pageToken_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.IdentityOuterClass + .internal_static_google_showcase_v1beta1_ListUsersRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.IdentityOuterClass + .internal_static_google_showcase_v1beta1_ListUsersRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.ListUsersRequest.class, + com.google.showcase.v1beta1.ListUsersRequest.Builder.class); + } + + public static final int PAGE_SIZE_FIELD_NUMBER = 1; + private int pageSize_ = 0; + + /** + * + * + *
        +   * The maximum number of users to return. Server may return fewer users
        +   * than requested. If unspecified, server will pick an appropriate default.
        +   * 
        + * + * int32 page_size = 1; + * + * @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_ = ""; + + /** + * + * + *
        +   * The value of google.showcase.v1beta1.ListUsersResponse.next_page_token
        +   * returned from the previous call to
        +   * `google.showcase.v1beta1.Identity\ListUsers` method.
        +   * 
        + * + * string page_token = 2; + * + * @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; + } + } + + /** + * + * + *
        +   * The value of google.showcase.v1beta1.ListUsersResponse.next_page_token
        +   * returned from the previous call to
        +   * `google.showcase.v1beta1.Identity\ListUsers` method.
        +   * 
        + * + * string page_token = 2; + * + * @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.GeneratedMessage.isStringEmpty(pageToken_)) { + com.google.protobuf.GeneratedMessage.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.GeneratedMessage.isStringEmpty(pageToken_)) { + size += com.google.protobuf.GeneratedMessage.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.showcase.v1beta1.ListUsersRequest)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.ListUsersRequest other = + (com.google.showcase.v1beta1.ListUsersRequest) 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.showcase.v1beta1.ListUsersRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.ListUsersRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.ListUsersRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.ListUsersRequest 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.showcase.v1beta1.ListUsersRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.ListUsersRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.ListUsersRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.ListUsersRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.showcase.v1beta1.ListUsersRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.ListUsersRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.showcase.v1beta1.ListUsersRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.ListUsersRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.showcase.v1beta1.ListUsersRequest 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
        +   * The request message for the google.showcase.v1beta1.Identity\ListUsers
        +   * method.
        +   * 
        + * + * Protobuf type {@code google.showcase.v1beta1.ListUsersRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.ListUsersRequest) + com.google.showcase.v1beta1.ListUsersRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.IdentityOuterClass + .internal_static_google_showcase_v1beta1_ListUsersRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.IdentityOuterClass + .internal_static_google_showcase_v1beta1_ListUsersRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.ListUsersRequest.class, + com.google.showcase.v1beta1.ListUsersRequest.Builder.class); + } + + // Construct using com.google.showcase.v1beta1.ListUsersRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.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.showcase.v1beta1.IdentityOuterClass + .internal_static_google_showcase_v1beta1_ListUsersRequest_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.ListUsersRequest getDefaultInstanceForType() { + return com.google.showcase.v1beta1.ListUsersRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.ListUsersRequest build() { + com.google.showcase.v1beta1.ListUsersRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.ListUsersRequest buildPartial() { + com.google.showcase.v1beta1.ListUsersRequest result = + new com.google.showcase.v1beta1.ListUsersRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.showcase.v1beta1.ListUsersRequest 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 mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.showcase.v1beta1.ListUsersRequest) { + return mergeFrom((com.google.showcase.v1beta1.ListUsersRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.showcase.v1beta1.ListUsersRequest other) { + if (other == com.google.showcase.v1beta1.ListUsersRequest.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_; + + /** + * + * + *
        +     * The maximum number of users to return. Server may return fewer users
        +     * than requested. If unspecified, server will pick an appropriate default.
        +     * 
        + * + * int32 page_size = 1; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + + /** + * + * + *
        +     * The maximum number of users to return. Server may return fewer users
        +     * than requested. If unspecified, server will pick an appropriate default.
        +     * 
        + * + * int32 page_size = 1; + * + * @param value The pageSize to set. + * @return This builder for chaining. + */ + public Builder setPageSize(int value) { + + pageSize_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
        +     * The maximum number of users to return. Server may return fewer users
        +     * than requested. If unspecified, server will pick an appropriate default.
        +     * 
        + * + * int32 page_size = 1; + * + * @return This builder for chaining. + */ + public Builder clearPageSize() { + bitField0_ = (bitField0_ & ~0x00000001); + pageSize_ = 0; + onChanged(); + return this; + } + + private java.lang.Object pageToken_ = ""; + + /** + * + * + *
        +     * The value of google.showcase.v1beta1.ListUsersResponse.next_page_token
        +     * returned from the previous call to
        +     * `google.showcase.v1beta1.Identity\ListUsers` method.
        +     * 
        + * + * string page_token = 2; + * + * @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; + } + } + + /** + * + * + *
        +     * The value of google.showcase.v1beta1.ListUsersResponse.next_page_token
        +     * returned from the previous call to
        +     * `google.showcase.v1beta1.Identity\ListUsers` method.
        +     * 
        + * + * string page_token = 2; + * + * @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; + } + } + + /** + * + * + *
        +     * The value of google.showcase.v1beta1.ListUsersResponse.next_page_token
        +     * returned from the previous call to
        +     * `google.showcase.v1beta1.Identity\ListUsers` method.
        +     * 
        + * + * string page_token = 2; + * + * @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; + } + + /** + * + * + *
        +     * The value of google.showcase.v1beta1.ListUsersResponse.next_page_token
        +     * returned from the previous call to
        +     * `google.showcase.v1beta1.Identity\ListUsers` method.
        +     * 
        + * + * string page_token = 2; + * + * @return This builder for chaining. + */ + public Builder clearPageToken() { + pageToken_ = getDefaultInstance().getPageToken(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
        +     * The value of google.showcase.v1beta1.ListUsersResponse.next_page_token
        +     * returned from the previous call to
        +     * `google.showcase.v1beta1.Identity\ListUsers` method.
        +     * 
        + * + * string page_token = 2; + * + * @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; + } + + // @@protoc_insertion_point(builder_scope:google.showcase.v1beta1.ListUsersRequest) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.ListUsersRequest) + private static final com.google.showcase.v1beta1.ListUsersRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.ListUsersRequest(); + } + + public static com.google.showcase.v1beta1.ListUsersRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListUsersRequest 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.showcase.v1beta1.ListUsersRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListUsersRequestOrBuilder.java b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListUsersRequestOrBuilder.java new file mode 100644 index 0000000000..9aaf1db00f --- /dev/null +++ b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListUsersRequestOrBuilder.java @@ -0,0 +1,72 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: schema/google/showcase/v1beta1/identity.proto +// Protobuf Java Version: 4.33.2 + +package com.google.showcase.v1beta1; + +@com.google.protobuf.Generated +public interface ListUsersRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.ListUsersRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
        +   * The maximum number of users to return. Server may return fewer users
        +   * than requested. If unspecified, server will pick an appropriate default.
        +   * 
        + * + * int32 page_size = 1; + * + * @return The pageSize. + */ + int getPageSize(); + + /** + * + * + *
        +   * The value of google.showcase.v1beta1.ListUsersResponse.next_page_token
        +   * returned from the previous call to
        +   * `google.showcase.v1beta1.Identity\ListUsers` method.
        +   * 
        + * + * string page_token = 2; + * + * @return The pageToken. + */ + java.lang.String getPageToken(); + + /** + * + * + *
        +   * The value of google.showcase.v1beta1.ListUsersResponse.next_page_token
        +   * returned from the previous call to
        +   * `google.showcase.v1beta1.Identity\ListUsers` method.
        +   * 
        + * + * string page_token = 2; + * + * @return The bytes for pageToken. + */ + com.google.protobuf.ByteString getPageTokenBytes(); +} diff --git a/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListUsersResponse.java b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListUsersResponse.java new file mode 100644 index 0000000000..85827181b5 --- /dev/null +++ b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListUsersResponse.java @@ -0,0 +1,1128 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: schema/google/showcase/v1beta1/identity.proto +// Protobuf Java Version: 4.33.2 + +package com.google.showcase.v1beta1; + +/** + * + * + *
        + * The response message for the google.showcase.v1beta1.Identity\ListUsers
        + * method.
        + * 
        + * + * Protobuf type {@code google.showcase.v1beta1.ListUsersResponse} + */ +@com.google.protobuf.Generated +public final class ListUsersResponse extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.ListUsersResponse) + ListUsersResponseOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "ListUsersResponse"); + } + + // Use ListUsersResponse.newBuilder() to construct. + private ListUsersResponse(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private ListUsersResponse() { + users_ = java.util.Collections.emptyList(); + nextPageToken_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.IdentityOuterClass + .internal_static_google_showcase_v1beta1_ListUsersResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.IdentityOuterClass + .internal_static_google_showcase_v1beta1_ListUsersResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.ListUsersResponse.class, + com.google.showcase.v1beta1.ListUsersResponse.Builder.class); + } + + public static final int USERS_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private java.util.List users_; + + /** + * + * + *
        +   * The list of users.
        +   * 
        + * + * repeated .google.showcase.v1beta1.User users = 1; + */ + @java.lang.Override + public java.util.List getUsersList() { + return users_; + } + + /** + * + * + *
        +   * The list of users.
        +   * 
        + * + * repeated .google.showcase.v1beta1.User users = 1; + */ + @java.lang.Override + public java.util.List + getUsersOrBuilderList() { + return users_; + } + + /** + * + * + *
        +   * The list of users.
        +   * 
        + * + * repeated .google.showcase.v1beta1.User users = 1; + */ + @java.lang.Override + public int getUsersCount() { + return users_.size(); + } + + /** + * + * + *
        +   * The list of users.
        +   * 
        + * + * repeated .google.showcase.v1beta1.User users = 1; + */ + @java.lang.Override + public com.google.showcase.v1beta1.User getUsers(int index) { + return users_.get(index); + } + + /** + * + * + *
        +   * The list of users.
        +   * 
        + * + * repeated .google.showcase.v1beta1.User users = 1; + */ + @java.lang.Override + public com.google.showcase.v1beta1.UserOrBuilder getUsersOrBuilder(int index) { + return users_.get(index); + } + + public static final int NEXT_PAGE_TOKEN_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object nextPageToken_ = ""; + + /** + * + * + *
        +   * A token to retrieve next page of results.
        +   * Pass this value in ListUsersRequest.page_token field in the subsequent
        +   * call to `google.showcase.v1beta1.Message\ListUsers` method to retrieve the
        +   * next page of results.
        +   * 
        + * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + @java.lang.Override + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nextPageToken_ = s; + return s; + } + } + + /** + * + * + *
        +   * A token to retrieve next page of results.
        +   * Pass this value in ListUsersRequest.page_token field in the subsequent
        +   * call to `google.showcase.v1beta1.Message\ListUsers` method to retrieve the
        +   * next page of results.
        +   * 
        + * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + nextPageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + for (int i = 0; i < users_.size(); i++) { + output.writeMessage(1, users_.get(i)); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(nextPageToken_)) { + com.google.protobuf.GeneratedMessage.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 < users_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, users_.get(i)); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(nextPageToken_)) { + size += com.google.protobuf.GeneratedMessage.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.showcase.v1beta1.ListUsersResponse)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.ListUsersResponse other = + (com.google.showcase.v1beta1.ListUsersResponse) obj; + + if (!getUsersList().equals(other.getUsersList())) 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 (getUsersCount() > 0) { + hash = (37 * hash) + USERS_FIELD_NUMBER; + hash = (53 * hash) + getUsersList().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.showcase.v1beta1.ListUsersResponse parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.ListUsersResponse parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.ListUsersResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.ListUsersResponse 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.showcase.v1beta1.ListUsersResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.ListUsersResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.ListUsersResponse parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.ListUsersResponse parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.showcase.v1beta1.ListUsersResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.ListUsersResponse parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.showcase.v1beta1.ListUsersResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.ListUsersResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.showcase.v1beta1.ListUsersResponse 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
        +   * The response message for the google.showcase.v1beta1.Identity\ListUsers
        +   * method.
        +   * 
        + * + * Protobuf type {@code google.showcase.v1beta1.ListUsersResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.ListUsersResponse) + com.google.showcase.v1beta1.ListUsersResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.IdentityOuterClass + .internal_static_google_showcase_v1beta1_ListUsersResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.IdentityOuterClass + .internal_static_google_showcase_v1beta1_ListUsersResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.ListUsersResponse.class, + com.google.showcase.v1beta1.ListUsersResponse.Builder.class); + } + + // Construct using com.google.showcase.v1beta1.ListUsersResponse.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (usersBuilder_ == null) { + users_ = java.util.Collections.emptyList(); + } else { + users_ = null; + usersBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + nextPageToken_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.showcase.v1beta1.IdentityOuterClass + .internal_static_google_showcase_v1beta1_ListUsersResponse_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.ListUsersResponse getDefaultInstanceForType() { + return com.google.showcase.v1beta1.ListUsersResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.ListUsersResponse build() { + com.google.showcase.v1beta1.ListUsersResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.ListUsersResponse buildPartial() { + com.google.showcase.v1beta1.ListUsersResponse result = + new com.google.showcase.v1beta1.ListUsersResponse(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields(com.google.showcase.v1beta1.ListUsersResponse result) { + if (usersBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + users_ = java.util.Collections.unmodifiableList(users_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.users_ = users_; + } else { + result.users_ = usersBuilder_.build(); + } + } + + private void buildPartial0(com.google.showcase.v1beta1.ListUsersResponse result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.nextPageToken_ = nextPageToken_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.showcase.v1beta1.ListUsersResponse) { + return mergeFrom((com.google.showcase.v1beta1.ListUsersResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.showcase.v1beta1.ListUsersResponse other) { + if (other == com.google.showcase.v1beta1.ListUsersResponse.getDefaultInstance()) return this; + if (usersBuilder_ == null) { + if (!other.users_.isEmpty()) { + if (users_.isEmpty()) { + users_ = other.users_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureUsersIsMutable(); + users_.addAll(other.users_); + } + onChanged(); + } + } else { + if (!other.users_.isEmpty()) { + if (usersBuilder_.isEmpty()) { + usersBuilder_.dispose(); + usersBuilder_ = null; + users_ = other.users_; + bitField0_ = (bitField0_ & ~0x00000001); + usersBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders + ? internalGetUsersFieldBuilder() + : null; + } else { + usersBuilder_.addAllMessages(other.users_); + } + } + } + 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.showcase.v1beta1.User m = + input.readMessage(com.google.showcase.v1beta1.User.parser(), extensionRegistry); + if (usersBuilder_ == null) { + ensureUsersIsMutable(); + users_.add(m); + } else { + usersBuilder_.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 users_ = + java.util.Collections.emptyList(); + + private void ensureUsersIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + users_ = new java.util.ArrayList(users_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.google.showcase.v1beta1.User, + com.google.showcase.v1beta1.User.Builder, + com.google.showcase.v1beta1.UserOrBuilder> + usersBuilder_; + + /** + * + * + *
        +     * The list of users.
        +     * 
        + * + * repeated .google.showcase.v1beta1.User users = 1; + */ + public java.util.List getUsersList() { + if (usersBuilder_ == null) { + return java.util.Collections.unmodifiableList(users_); + } else { + return usersBuilder_.getMessageList(); + } + } + + /** + * + * + *
        +     * The list of users.
        +     * 
        + * + * repeated .google.showcase.v1beta1.User users = 1; + */ + public int getUsersCount() { + if (usersBuilder_ == null) { + return users_.size(); + } else { + return usersBuilder_.getCount(); + } + } + + /** + * + * + *
        +     * The list of users.
        +     * 
        + * + * repeated .google.showcase.v1beta1.User users = 1; + */ + public com.google.showcase.v1beta1.User getUsers(int index) { + if (usersBuilder_ == null) { + return users_.get(index); + } else { + return usersBuilder_.getMessage(index); + } + } + + /** + * + * + *
        +     * The list of users.
        +     * 
        + * + * repeated .google.showcase.v1beta1.User users = 1; + */ + public Builder setUsers(int index, com.google.showcase.v1beta1.User value) { + if (usersBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureUsersIsMutable(); + users_.set(index, value); + onChanged(); + } else { + usersBuilder_.setMessage(index, value); + } + return this; + } + + /** + * + * + *
        +     * The list of users.
        +     * 
        + * + * repeated .google.showcase.v1beta1.User users = 1; + */ + public Builder setUsers(int index, com.google.showcase.v1beta1.User.Builder builderForValue) { + if (usersBuilder_ == null) { + ensureUsersIsMutable(); + users_.set(index, builderForValue.build()); + onChanged(); + } else { + usersBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
        +     * The list of users.
        +     * 
        + * + * repeated .google.showcase.v1beta1.User users = 1; + */ + public Builder addUsers(com.google.showcase.v1beta1.User value) { + if (usersBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureUsersIsMutable(); + users_.add(value); + onChanged(); + } else { + usersBuilder_.addMessage(value); + } + return this; + } + + /** + * + * + *
        +     * The list of users.
        +     * 
        + * + * repeated .google.showcase.v1beta1.User users = 1; + */ + public Builder addUsers(int index, com.google.showcase.v1beta1.User value) { + if (usersBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureUsersIsMutable(); + users_.add(index, value); + onChanged(); + } else { + usersBuilder_.addMessage(index, value); + } + return this; + } + + /** + * + * + *
        +     * The list of users.
        +     * 
        + * + * repeated .google.showcase.v1beta1.User users = 1; + */ + public Builder addUsers(com.google.showcase.v1beta1.User.Builder builderForValue) { + if (usersBuilder_ == null) { + ensureUsersIsMutable(); + users_.add(builderForValue.build()); + onChanged(); + } else { + usersBuilder_.addMessage(builderForValue.build()); + } + return this; + } + + /** + * + * + *
        +     * The list of users.
        +     * 
        + * + * repeated .google.showcase.v1beta1.User users = 1; + */ + public Builder addUsers(int index, com.google.showcase.v1beta1.User.Builder builderForValue) { + if (usersBuilder_ == null) { + ensureUsersIsMutable(); + users_.add(index, builderForValue.build()); + onChanged(); + } else { + usersBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
        +     * The list of users.
        +     * 
        + * + * repeated .google.showcase.v1beta1.User users = 1; + */ + public Builder addAllUsers( + java.lang.Iterable values) { + if (usersBuilder_ == null) { + ensureUsersIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, users_); + onChanged(); + } else { + usersBuilder_.addAllMessages(values); + } + return this; + } + + /** + * + * + *
        +     * The list of users.
        +     * 
        + * + * repeated .google.showcase.v1beta1.User users = 1; + */ + public Builder clearUsers() { + if (usersBuilder_ == null) { + users_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + usersBuilder_.clear(); + } + return this; + } + + /** + * + * + *
        +     * The list of users.
        +     * 
        + * + * repeated .google.showcase.v1beta1.User users = 1; + */ + public Builder removeUsers(int index) { + if (usersBuilder_ == null) { + ensureUsersIsMutable(); + users_.remove(index); + onChanged(); + } else { + usersBuilder_.remove(index); + } + return this; + } + + /** + * + * + *
        +     * The list of users.
        +     * 
        + * + * repeated .google.showcase.v1beta1.User users = 1; + */ + public com.google.showcase.v1beta1.User.Builder getUsersBuilder(int index) { + return internalGetUsersFieldBuilder().getBuilder(index); + } + + /** + * + * + *
        +     * The list of users.
        +     * 
        + * + * repeated .google.showcase.v1beta1.User users = 1; + */ + public com.google.showcase.v1beta1.UserOrBuilder getUsersOrBuilder(int index) { + if (usersBuilder_ == null) { + return users_.get(index); + } else { + return usersBuilder_.getMessageOrBuilder(index); + } + } + + /** + * + * + *
        +     * The list of users.
        +     * 
        + * + * repeated .google.showcase.v1beta1.User users = 1; + */ + public java.util.List + getUsersOrBuilderList() { + if (usersBuilder_ != null) { + return usersBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(users_); + } + } + + /** + * + * + *
        +     * The list of users.
        +     * 
        + * + * repeated .google.showcase.v1beta1.User users = 1; + */ + public com.google.showcase.v1beta1.User.Builder addUsersBuilder() { + return internalGetUsersFieldBuilder() + .addBuilder(com.google.showcase.v1beta1.User.getDefaultInstance()); + } + + /** + * + * + *
        +     * The list of users.
        +     * 
        + * + * repeated .google.showcase.v1beta1.User users = 1; + */ + public com.google.showcase.v1beta1.User.Builder addUsersBuilder(int index) { + return internalGetUsersFieldBuilder() + .addBuilder(index, com.google.showcase.v1beta1.User.getDefaultInstance()); + } + + /** + * + * + *
        +     * The list of users.
        +     * 
        + * + * repeated .google.showcase.v1beta1.User users = 1; + */ + public java.util.List getUsersBuilderList() { + return internalGetUsersFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.google.showcase.v1beta1.User, + com.google.showcase.v1beta1.User.Builder, + com.google.showcase.v1beta1.UserOrBuilder> + internalGetUsersFieldBuilder() { + if (usersBuilder_ == null) { + usersBuilder_ = + new com.google.protobuf.RepeatedFieldBuilder< + com.google.showcase.v1beta1.User, + com.google.showcase.v1beta1.User.Builder, + com.google.showcase.v1beta1.UserOrBuilder>( + users_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + users_ = null; + } + return usersBuilder_; + } + + private java.lang.Object nextPageToken_ = ""; + + /** + * + * + *
        +     * A token to retrieve next page of results.
        +     * Pass this value in ListUsersRequest.page_token field in the subsequent
        +     * call to `google.showcase.v1beta1.Message\ListUsers` method to retrieve the
        +     * next page of results.
        +     * 
        + * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nextPageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
        +     * A token to retrieve next page of results.
        +     * Pass this value in ListUsersRequest.page_token field in the subsequent
        +     * call to `google.showcase.v1beta1.Message\ListUsers` method to retrieve the
        +     * next page of results.
        +     * 
        + * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + public com.google.protobuf.ByteString getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + nextPageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
        +     * A token to retrieve next page of results.
        +     * Pass this value in ListUsersRequest.page_token field in the subsequent
        +     * call to `google.showcase.v1beta1.Message\ListUsers` method to retrieve the
        +     * next page of results.
        +     * 
        + * + * string next_page_token = 2; + * + * @param value The nextPageToken to set. + * @return This builder for chaining. + */ + public Builder setNextPageToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + nextPageToken_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
        +     * A token to retrieve next page of results.
        +     * Pass this value in ListUsersRequest.page_token field in the subsequent
        +     * call to `google.showcase.v1beta1.Message\ListUsers` method to retrieve the
        +     * next page of results.
        +     * 
        + * + * string next_page_token = 2; + * + * @return This builder for chaining. + */ + public Builder clearNextPageToken() { + nextPageToken_ = getDefaultInstance().getNextPageToken(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
        +     * A token to retrieve next page of results.
        +     * Pass this value in ListUsersRequest.page_token field in the subsequent
        +     * call to `google.showcase.v1beta1.Message\ListUsers` method to retrieve the
        +     * next page of results.
        +     * 
        + * + * string next_page_token = 2; + * + * @param value The bytes for nextPageToken to set. + * @return This builder for chaining. + */ + public Builder setNextPageTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + nextPageToken_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.showcase.v1beta1.ListUsersResponse) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.ListUsersResponse) + private static final com.google.showcase.v1beta1.ListUsersResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.ListUsersResponse(); + } + + public static com.google.showcase.v1beta1.ListUsersResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListUsersResponse 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.showcase.v1beta1.ListUsersResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListUsersResponseOrBuilder.java b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListUsersResponseOrBuilder.java new file mode 100644 index 0000000000..870548f540 --- /dev/null +++ b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListUsersResponseOrBuilder.java @@ -0,0 +1,115 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: schema/google/showcase/v1beta1/identity.proto +// Protobuf Java Version: 4.33.2 + +package com.google.showcase.v1beta1; + +@com.google.protobuf.Generated +public interface ListUsersResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.ListUsersResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
        +   * The list of users.
        +   * 
        + * + * repeated .google.showcase.v1beta1.User users = 1; + */ + java.util.List getUsersList(); + + /** + * + * + *
        +   * The list of users.
        +   * 
        + * + * repeated .google.showcase.v1beta1.User users = 1; + */ + com.google.showcase.v1beta1.User getUsers(int index); + + /** + * + * + *
        +   * The list of users.
        +   * 
        + * + * repeated .google.showcase.v1beta1.User users = 1; + */ + int getUsersCount(); + + /** + * + * + *
        +   * The list of users.
        +   * 
        + * + * repeated .google.showcase.v1beta1.User users = 1; + */ + java.util.List getUsersOrBuilderList(); + + /** + * + * + *
        +   * The list of users.
        +   * 
        + * + * repeated .google.showcase.v1beta1.User users = 1; + */ + com.google.showcase.v1beta1.UserOrBuilder getUsersOrBuilder(int index); + + /** + * + * + *
        +   * A token to retrieve next page of results.
        +   * Pass this value in ListUsersRequest.page_token field in the subsequent
        +   * call to `google.showcase.v1beta1.Message\ListUsers` method to retrieve the
        +   * next page of results.
        +   * 
        + * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + java.lang.String getNextPageToken(); + + /** + * + * + *
        +   * A token to retrieve next page of results.
        +   * Pass this value in ListUsersRequest.page_token field in the subsequent
        +   * call to `google.showcase.v1beta1.Message\ListUsers` method to retrieve the
        +   * next page of results.
        +   * 
        + * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + com.google.protobuf.ByteString getNextPageTokenBytes(); +} diff --git a/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/MessagingOuterClass.java b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/MessagingOuterClass.java new file mode 100644 index 0000000000..6b76c24838 --- /dev/null +++ b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/MessagingOuterClass.java @@ -0,0 +1,504 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: schema/google/showcase/v1beta1/messaging.proto +// Protobuf Java Version: 4.33.2 + +package com.google.showcase.v1beta1; + +@com.google.protobuf.Generated +public final class MessagingOuterClass extends com.google.protobuf.GeneratedFile { + private MessagingOuterClass() {} + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "MessagingOuterClass"); + } + + 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_showcase_v1beta1_Room_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_showcase_v1beta1_Room_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_showcase_v1beta1_CreateRoomRequest_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_showcase_v1beta1_CreateRoomRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_showcase_v1beta1_GetRoomRequest_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_showcase_v1beta1_GetRoomRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_showcase_v1beta1_UpdateRoomRequest_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_showcase_v1beta1_UpdateRoomRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_showcase_v1beta1_DeleteRoomRequest_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_showcase_v1beta1_DeleteRoomRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_showcase_v1beta1_ListRoomsRequest_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_showcase_v1beta1_ListRoomsRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_showcase_v1beta1_ListRoomsResponse_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_showcase_v1beta1_ListRoomsResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_showcase_v1beta1_Blurb_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_showcase_v1beta1_Blurb_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_showcase_v1beta1_CreateBlurbRequest_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_showcase_v1beta1_CreateBlurbRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_showcase_v1beta1_GetBlurbRequest_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_showcase_v1beta1_GetBlurbRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_showcase_v1beta1_UpdateBlurbRequest_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_showcase_v1beta1_UpdateBlurbRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_showcase_v1beta1_DeleteBlurbRequest_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_showcase_v1beta1_DeleteBlurbRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_showcase_v1beta1_ListBlurbsRequest_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_showcase_v1beta1_ListBlurbsRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_showcase_v1beta1_ListBlurbsResponse_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_showcase_v1beta1_ListBlurbsResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_showcase_v1beta1_SearchBlurbsRequest_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_showcase_v1beta1_SearchBlurbsRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_showcase_v1beta1_SearchBlurbsMetadata_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_showcase_v1beta1_SearchBlurbsMetadata_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_showcase_v1beta1_SearchBlurbsResponse_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_showcase_v1beta1_SearchBlurbsResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_showcase_v1beta1_StreamBlurbsRequest_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_showcase_v1beta1_StreamBlurbsRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_showcase_v1beta1_StreamBlurbsResponse_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_showcase_v1beta1_StreamBlurbsResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_showcase_v1beta1_SendBlurbsResponse_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_showcase_v1beta1_SendBlurbsResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_showcase_v1beta1_ConnectRequest_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_showcase_v1beta1_ConnectRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_showcase_v1beta1_ConnectRequest_ConnectConfig_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_showcase_v1beta1_ConnectRequest_ConnectConfig_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.schema/google/showcase/v1beta1/messagi" + + "ng.proto\022\027google.showcase.v1beta1\032\034googl" + + "e/api/annotations.proto\032\027google/api/clie" + + "nt.proto\032\037google/api/field_behavior.prot" + + "o\032\031google/api/resource.proto\032#google/lon" + + "grunning/operations.proto\032\033google/protob" + + "uf/empty.proto\032 google/protobuf/field_ma" + + "sk.proto\032\037google/protobuf/timestamp.prot" + + "o\032\036google/rpc/error_details.proto\"\341\001\n\004Ro" + + "om\022\014\n\004name\030\001 \001(\t\022\031\n\014display_name\030\002 \001(\tB\003" + + "\340A\002\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.Ti" + + "mestampB\003\340A\003:/\352A,\n\034showcase.googleapis.c" + + "om/Room\022\014rooms/{room}\"@\n\021CreateRoomReque" + + "st\022+\n\004room\030\001 \001(\0132\035.google.showcase.v1bet" + + "a1.Room\"D\n\016GetRoomRequest\0222\n\004name\030\001 \001(\tB" + + "$\340A\002\372A\036\n\034showcase.googleapis.com/Room\"q\n" + + "\021UpdateRoomRequest\022+\n\004room\030\001 \001(\0132\035.googl" + + "e.showcase.v1beta1.Room\022/\n\013update_mask\030\002" + + " \001(\0132\032.google.protobuf.FieldMask\"G\n\021Dele" + + "teRoomRequest\0222\n\004name\030\001 \001(\tB$\340A\002\372A\036\n\034sho" + + "wcase.googleapis.com/Room\"9\n\020ListRoomsRe" + + "quest\022\021\n\tpage_size\030\001 \001(\005\022\022\n\npage_token\030\002" + + " \001(\t\"Z\n\021ListRoomsResponse\022,\n\005rooms\030\001 \003(\013" + + "2\035.google.showcase.v1beta1.Room\022\027\n\017next_" + + "page_token\030\002 \001(\t\"\366\003\n\005Blurb\022\014\n\004name\030\001 \001(\t" + + "\0222\n\004user\030\002 \001(\tB$\340A\002\372A\036\n\034showcase.googlea" + + "pis.com/User\022\016\n\004text\030\003 \001(\tH\000\022\017\n\005image\030\004 " + + "\001(\014H\000\0224\n\013create_time\030\005 \001(\0132\032.google.prot" + + "obuf.TimestampB\003\340A\003\0224\n\013update_time\030\006 \001(\013" + + "2\032.google.protobuf.TimestampB\003\340A\003\022\030\n\016leg" + + "acy_room_id\030\007 \001(\tH\001\022\030\n\016legacy_user_id\030\010 " + + "\001(\tH\001:\321\001\352A\315\001\n\035showcase.googleapis.com/Bl" + + "urb\0228users/{user}/profile/blurbs/legacy/" + + "{legacy_user}~{blurb}\022#users/{user}/prof" + + "ile/blurbs/{blurb}\022\033rooms/{room}/blurbs/" + + "{blurb}\0220rooms/{room}/blurbs/legacy/{leg" + + "acy_room}.{blurb}B\t\n\007contentB\013\n\tlegacy_i" + + "d\"z\n\022CreateBlurbRequest\0225\n\006parent\030\001 \001(\tB" + + "%\340A\002\372A\037\022\035showcase.googleapis.com/Blurb\022-" + + "\n\005blurb\030\002 \001(\0132\036.google.showcase.v1beta1." + + "Blurb\"F\n\017GetBlurbRequest\0223\n\004name\030\001 \001(\tB%" + + "\340A\002\372A\037\n\035showcase.googleapis.com/Blurb\"t\n" + + "\022UpdateBlurbRequest\022-\n\005blurb\030\001 \001(\0132\036.goo" + + "gle.showcase.v1beta1.Blurb\022/\n\013update_mas" + + "k\030\002 \001(\0132\032.google.protobuf.FieldMask\"I\n\022D" + + "eleteBlurbRequest\0223\n\004name\030\001 \001(\tB%\340A\002\372A\037\n" + + "\035showcase.googleapis.com/Blurb\"q\n\021ListBl" + + "urbsRequest\0225\n\006parent\030\001 \001(\tB%\340A\002\372A\037\022\035sho" + + "wcase.googleapis.com/Blurb\022\021\n\tpage_size\030" + + "\002 \001(\005\022\022\n\npage_token\030\003 \001(\t\"]\n\022ListBlurbsR" + + "esponse\022.\n\006blurbs\030\001 \003(\0132\036.google.showcas" + + "e.v1beta1.Blurb\022\027\n\017next_page_token\030\002 \001(\t" + + "\"\204\001\n\023SearchBlurbsRequest\022\022\n\005query\030\001 \001(\tB" + + "\003\340A\002\0222\n\006parent\030\002 \001(\tB\"\372A\037\022\035showcase.goog" + + "leapis.com/Blurb\022\021\n\tpage_size\030\003 \001(\005\022\022\n\np" + + "age_token\030\004 \001(\t\"A\n\024SearchBlurbsMetadata\022" + + ")\n\nretry_info\030\001 \001(\0132\025.google.rpc.RetryIn" + + "fo\"_\n\024SearchBlurbsResponse\022.\n\006blurbs\030\001 \003" + + "(\0132\036.google.showcase.v1beta1.Blurb\022\027\n\017ne" + + "xt_page_token\030\002 \001(\t\"\200\001\n\023StreamBlurbsRequ" + + "est\0223\n\004name\030\001 \001(\tB%\340A\002\372A\037\022\035showcase.goog" + + "leapis.com/Blurb\0224\n\013expire_time\030\002 \001(\0132\032." + + "google.protobuf.TimestampB\003\340A\002\"\321\001\n\024Strea" + + "mBlurbsResponse\022-\n\005blurb\030\001 \001(\0132\036.google." + + "showcase.v1beta1.Blurb\022D\n\006action\030\002 \001(\01624" + + ".google.showcase.v1beta1.StreamBlurbsRes" + + "ponse.Action\"D\n\006Action\022\026\n\022ACTION_UNSPECI" + + "FIED\020\000\022\n\n\006CREATE\020\001\022\n\n\006UPDATE\020\002\022\n\n\006DELETE" + + "\020\003\"#\n\022SendBlurbsResponse\022\r\n\005names\030\001 \003(\t\"" + + "\332\001\n\016ConnectRequest\022G\n\006config\030\001 \001(\01325.goo" + + "gle.showcase.v1beta1.ConnectRequest.Conn" + + "ectConfigH\000\022/\n\005blurb\030\002 \001(\0132\036.google.show" + + "case.v1beta1.BlurbH\000\032C\n\rConnectConfig\0222\n" + + "\006parent\030\001 \001(\tB\"\372A\037\022\035showcase.googleapis." + + "com/BlurbB\t\n\007request2\264\023\n\tMessaging\022\227\001\n\nC" + + "reateRoom\022*.google.showcase.v1beta1.Crea" + + "teRoomRequest\032\035.google.showcase.v1beta1." + + "Room\">\332A\"room.display_name,room.descript" + + "ion\202\323\344\223\002\023\"\016/v1beta1/rooms:\001*\022y\n\007GetRoom\022" + + "\'.google.showcase.v1beta1.GetRoomRequest" + + "\032\035.google.showcase.v1beta1.Room\"&\332A\004name" + + "\202\323\344\223\002\031\022\027/v1beta1/{name=rooms/*}\022\203\001\n\nUpda" + + "teRoom\022*.google.showcase.v1beta1.UpdateR" + + "oomRequest\032\035.google.showcase.v1beta1.Roo" + + "m\"*\202\323\344\223\002$2\034/v1beta1/{room.name=rooms/*}:" + + "\004room\022x\n\nDeleteRoom\022*.google.showcase.v1" + + "beta1.DeleteRoomRequest\032\026.google.protobu" + + "f.Empty\"&\332A\004name\202\323\344\223\002\031*\027/v1beta1/{name=r" + + "ooms/*}\022z\n\tListRooms\022).google.showcase.v" + + "1beta1.ListRoomsRequest\032*.google.showcas" + + "e.v1beta1.ListRoomsResponse\"\026\202\323\344\223\002\020\022\016/v1" + + "beta1/rooms\022\366\001\n\013CreateBlurb\022+.google.sho" + + "wcase.v1beta1.CreateBlurbRequest\032\036.googl" + + "e.showcase.v1beta1.Blurb\"\231\001\332A\034parent,blu" + + "rb.user,blurb.text\332A\035parent,blurb.user,b" + + "lurb.image\202\323\344\223\002T\" /v1beta1/{parent=rooms" + + "/*}/blurbs:\001*Z-\"(/v1beta1/{parent=users/" + + "*/profile}/blurbs:\001*\022\261\001\n\010GetBlurb\022(.goog" + + "le.showcase.v1beta1.GetBlurbRequest\032\036.go" + + "ogle.showcase.v1beta1.Blurb\"[\332A\004name\202\323\344\223" + + "\002N\022 /v1beta1/{name=rooms/*/blurbs/*}Z*\022(" + + "/v1beta1/{name=users/*/profile/blurbs/*}" + + "\022\312\001\n\013UpdateBlurb\022+.google.showcase.v1bet" + + "a1.UpdateBlurbRequest\032\036.google.showcase." + + "v1beta1.Blurb\"n\202\323\344\223\002h2&/v1beta1/{blurb.n" + + "ame=rooms/*/blurbs/*}:\005blurbZ72./v1beta1" + + "/{blurb.name=users/*/profile/blurbs/*}:\005" + + "blurb\022\257\001\n\013DeleteBlurb\022+.google.showcase." + + "v1beta1.DeleteBlurbRequest\032\026.google.prot" + + "obuf.Empty\"[\332A\004name\202\323\344\223\002N* /v1beta1/{nam" + + "e=rooms/*/blurbs/*}Z**(/v1beta1/{name=us" + + "ers/*/profile/blurbs/*}\022\304\001\n\nListBlurbs\022*" + + ".google.showcase.v1beta1.ListBlurbsReque" + + "st\032+.google.showcase.v1beta1.ListBlurbsR" + + "esponse\"]\332A\006parent\202\323\344\223\002N\022 /v1beta1/{pare" + + "nt=rooms/*}/blurbsZ*\022(/v1beta1/{parent=u" + + "sers/*/profile}/blurbs\022\201\002\n\014SearchBlurbs\022" + + ",.google.showcase.v1beta1.SearchBlurbsRe" + + "quest\032\035.google.longrunning.Operation\"\243\001\312" + + "A,\n\024SearchBlurbsResponse\022\024SearchBlurbsMe" + + "tadata\332A\014parent,query\202\323\344\223\002_\"\'/v1beta1/{p" + + "arent=rooms/*}/blurbs:search:\001*Z1\"//v1be" + + "ta1/{parent=users/*/profile}/blurbs:sear" + + "ch\022\323\001\n\014StreamBlurbs\022,.google.showcase.v1" + + "beta1.StreamBlurbsRequest\032-.google.showc" + + "ase.v1beta1.StreamBlurbsResponse\"d\202\323\344\223\002^" + + "\"%/v1beta1/{name=rooms/*}/blurbs:stream:" + + "\001*Z2\"-/v1beta1/{name=users/*/profile}/bl" + + "urbs:stream:\001*0\001\022\316\001\n\nSendBlurbs\022+.google" + + ".showcase.v1beta1.CreateBlurbRequest\032+.g" + + "oogle.showcase.v1beta1.SendBlurbsRespons" + + "e\"d\202\323\344\223\002^\"%/v1beta1/{parent=rooms/*}/blu" + + "rbs:send:\001*Z2\"-/v1beta1/{parent=users/*/" + + "profile}/blurbs:send:\001*(\001\022e\n\007Connect\022\'.g" + + "oogle.showcase.v1beta1.ConnectRequest\032-." + + "google.showcase.v1beta1.StreamBlurbsResp" + + "onse(\0010\001\032\021\312A\016localhost:7469Bq\n\033com.googl" + + "e.showcase.v1beta1P\001Z4github.com/googlea" + + "pis/gapic-showcase/server/genproto\352\002\031Goo" + + "gle::Showcase::V1beta1b\006proto3" + }; + descriptor = + com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( + descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + com.google.api.AnnotationsProto.getDescriptor(), + com.google.api.ClientProto.getDescriptor(), + com.google.api.FieldBehaviorProto.getDescriptor(), + com.google.api.ResourceProto.getDescriptor(), + com.google.longrunning.OperationsProto.getDescriptor(), + com.google.protobuf.EmptyProto.getDescriptor(), + com.google.protobuf.FieldMaskProto.getDescriptor(), + com.google.protobuf.TimestampProto.getDescriptor(), + com.google.rpc.ErrorDetailsProto.getDescriptor(), + }); + internal_static_google_showcase_v1beta1_Room_descriptor = getDescriptor().getMessageType(0); + internal_static_google_showcase_v1beta1_Room_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_showcase_v1beta1_Room_descriptor, + new java.lang.String[] { + "Name", "DisplayName", "Description", "CreateTime", "UpdateTime", + }); + internal_static_google_showcase_v1beta1_CreateRoomRequest_descriptor = + getDescriptor().getMessageType(1); + internal_static_google_showcase_v1beta1_CreateRoomRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_showcase_v1beta1_CreateRoomRequest_descriptor, + new java.lang.String[] { + "Room", + }); + internal_static_google_showcase_v1beta1_GetRoomRequest_descriptor = + getDescriptor().getMessageType(2); + internal_static_google_showcase_v1beta1_GetRoomRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_showcase_v1beta1_GetRoomRequest_descriptor, + new java.lang.String[] { + "Name", + }); + internal_static_google_showcase_v1beta1_UpdateRoomRequest_descriptor = + getDescriptor().getMessageType(3); + internal_static_google_showcase_v1beta1_UpdateRoomRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_showcase_v1beta1_UpdateRoomRequest_descriptor, + new java.lang.String[] { + "Room", "UpdateMask", + }); + internal_static_google_showcase_v1beta1_DeleteRoomRequest_descriptor = + getDescriptor().getMessageType(4); + internal_static_google_showcase_v1beta1_DeleteRoomRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_showcase_v1beta1_DeleteRoomRequest_descriptor, + new java.lang.String[] { + "Name", + }); + internal_static_google_showcase_v1beta1_ListRoomsRequest_descriptor = + getDescriptor().getMessageType(5); + internal_static_google_showcase_v1beta1_ListRoomsRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_showcase_v1beta1_ListRoomsRequest_descriptor, + new java.lang.String[] { + "PageSize", "PageToken", + }); + internal_static_google_showcase_v1beta1_ListRoomsResponse_descriptor = + getDescriptor().getMessageType(6); + internal_static_google_showcase_v1beta1_ListRoomsResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_showcase_v1beta1_ListRoomsResponse_descriptor, + new java.lang.String[] { + "Rooms", "NextPageToken", + }); + internal_static_google_showcase_v1beta1_Blurb_descriptor = getDescriptor().getMessageType(7); + internal_static_google_showcase_v1beta1_Blurb_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_showcase_v1beta1_Blurb_descriptor, + new java.lang.String[] { + "Name", + "User", + "Text", + "Image", + "CreateTime", + "UpdateTime", + "LegacyRoomId", + "LegacyUserId", + "Content", + "LegacyId", + }); + internal_static_google_showcase_v1beta1_CreateBlurbRequest_descriptor = + getDescriptor().getMessageType(8); + internal_static_google_showcase_v1beta1_CreateBlurbRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_showcase_v1beta1_CreateBlurbRequest_descriptor, + new java.lang.String[] { + "Parent", "Blurb", + }); + internal_static_google_showcase_v1beta1_GetBlurbRequest_descriptor = + getDescriptor().getMessageType(9); + internal_static_google_showcase_v1beta1_GetBlurbRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_showcase_v1beta1_GetBlurbRequest_descriptor, + new java.lang.String[] { + "Name", + }); + internal_static_google_showcase_v1beta1_UpdateBlurbRequest_descriptor = + getDescriptor().getMessageType(10); + internal_static_google_showcase_v1beta1_UpdateBlurbRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_showcase_v1beta1_UpdateBlurbRequest_descriptor, + new java.lang.String[] { + "Blurb", "UpdateMask", + }); + internal_static_google_showcase_v1beta1_DeleteBlurbRequest_descriptor = + getDescriptor().getMessageType(11); + internal_static_google_showcase_v1beta1_DeleteBlurbRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_showcase_v1beta1_DeleteBlurbRequest_descriptor, + new java.lang.String[] { + "Name", + }); + internal_static_google_showcase_v1beta1_ListBlurbsRequest_descriptor = + getDescriptor().getMessageType(12); + internal_static_google_showcase_v1beta1_ListBlurbsRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_showcase_v1beta1_ListBlurbsRequest_descriptor, + new java.lang.String[] { + "Parent", "PageSize", "PageToken", + }); + internal_static_google_showcase_v1beta1_ListBlurbsResponse_descriptor = + getDescriptor().getMessageType(13); + internal_static_google_showcase_v1beta1_ListBlurbsResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_showcase_v1beta1_ListBlurbsResponse_descriptor, + new java.lang.String[] { + "Blurbs", "NextPageToken", + }); + internal_static_google_showcase_v1beta1_SearchBlurbsRequest_descriptor = + getDescriptor().getMessageType(14); + internal_static_google_showcase_v1beta1_SearchBlurbsRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_showcase_v1beta1_SearchBlurbsRequest_descriptor, + new java.lang.String[] { + "Query", "Parent", "PageSize", "PageToken", + }); + internal_static_google_showcase_v1beta1_SearchBlurbsMetadata_descriptor = + getDescriptor().getMessageType(15); + internal_static_google_showcase_v1beta1_SearchBlurbsMetadata_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_showcase_v1beta1_SearchBlurbsMetadata_descriptor, + new java.lang.String[] { + "RetryInfo", + }); + internal_static_google_showcase_v1beta1_SearchBlurbsResponse_descriptor = + getDescriptor().getMessageType(16); + internal_static_google_showcase_v1beta1_SearchBlurbsResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_showcase_v1beta1_SearchBlurbsResponse_descriptor, + new java.lang.String[] { + "Blurbs", "NextPageToken", + }); + internal_static_google_showcase_v1beta1_StreamBlurbsRequest_descriptor = + getDescriptor().getMessageType(17); + internal_static_google_showcase_v1beta1_StreamBlurbsRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_showcase_v1beta1_StreamBlurbsRequest_descriptor, + new java.lang.String[] { + "Name", "ExpireTime", + }); + internal_static_google_showcase_v1beta1_StreamBlurbsResponse_descriptor = + getDescriptor().getMessageType(18); + internal_static_google_showcase_v1beta1_StreamBlurbsResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_showcase_v1beta1_StreamBlurbsResponse_descriptor, + new java.lang.String[] { + "Blurb", "Action", + }); + internal_static_google_showcase_v1beta1_SendBlurbsResponse_descriptor = + getDescriptor().getMessageType(19); + internal_static_google_showcase_v1beta1_SendBlurbsResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_showcase_v1beta1_SendBlurbsResponse_descriptor, + new java.lang.String[] { + "Names", + }); + internal_static_google_showcase_v1beta1_ConnectRequest_descriptor = + getDescriptor().getMessageType(20); + internal_static_google_showcase_v1beta1_ConnectRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_showcase_v1beta1_ConnectRequest_descriptor, + new java.lang.String[] { + "Config", "Blurb", "Request", + }); + internal_static_google_showcase_v1beta1_ConnectRequest_ConnectConfig_descriptor = + internal_static_google_showcase_v1beta1_ConnectRequest_descriptor.getNestedType(0); + internal_static_google_showcase_v1beta1_ConnectRequest_ConnectConfig_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_showcase_v1beta1_ConnectRequest_ConnectConfig_descriptor, + new java.lang.String[] { + "Parent", + }); + descriptor.resolveAllFeaturesImmutable(); + 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(); + com.google.rpc.ErrorDetailsProto.getDescriptor(); + 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.ResourceProto.resource); + registry.add(com.google.api.ResourceProto.resourceReference); + registry.add(com.google.longrunning.OperationsProto.operationInfo); + com.google.protobuf.Descriptors.FileDescriptor.internalUpdateFileDescriptor( + descriptor, registry); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/PagedExpandLegacyMappedResponse.java b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/PagedExpandLegacyMappedResponse.java new file mode 100644 index 0000000000..594d996894 --- /dev/null +++ b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/PagedExpandLegacyMappedResponse.java @@ -0,0 +1,1063 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: schema/google/showcase/v1beta1/echo.proto +// Protobuf Java Version: 4.33.2 + +package com.google.showcase.v1beta1; + +/** Protobuf type {@code google.showcase.v1beta1.PagedExpandLegacyMappedResponse} */ +@com.google.protobuf.Generated +public final class PagedExpandLegacyMappedResponse extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.PagedExpandLegacyMappedResponse) + PagedExpandLegacyMappedResponseOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "PagedExpandLegacyMappedResponse"); + } + + // Use PagedExpandLegacyMappedResponse.newBuilder() to construct. + private PagedExpandLegacyMappedResponse(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private PagedExpandLegacyMappedResponse() { + nextPageToken_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.EchoOuterClass + .internal_static_google_showcase_v1beta1_PagedExpandLegacyMappedResponse_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + @java.lang.Override + protected com.google.protobuf.MapFieldReflectionAccessor internalGetMapFieldReflection( + int number) { + switch (number) { + case 1: + return internalGetAlphabetized(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.EchoOuterClass + .internal_static_google_showcase_v1beta1_PagedExpandLegacyMappedResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.PagedExpandLegacyMappedResponse.class, + com.google.showcase.v1beta1.PagedExpandLegacyMappedResponse.Builder.class); + } + + public static final int ALPHABETIZED_FIELD_NUMBER = 1; + + private static final class AlphabetizedDefaultEntryHolder { + static final com.google.protobuf.MapEntry< + java.lang.String, com.google.showcase.v1beta1.PagedExpandResponseList> + defaultEntry = + com.google.protobuf.MapEntry + . + newDefaultInstance( + com.google.showcase.v1beta1.EchoOuterClass + .internal_static_google_showcase_v1beta1_PagedExpandLegacyMappedResponse_AlphabetizedEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.MESSAGE, + com.google.showcase.v1beta1.PagedExpandResponseList.getDefaultInstance()); + } + + @SuppressWarnings("serial") + private com.google.protobuf.MapField< + java.lang.String, com.google.showcase.v1beta1.PagedExpandResponseList> + alphabetized_; + + private com.google.protobuf.MapField< + java.lang.String, com.google.showcase.v1beta1.PagedExpandResponseList> + internalGetAlphabetized() { + if (alphabetized_ == null) { + return com.google.protobuf.MapField.emptyMapField( + AlphabetizedDefaultEntryHolder.defaultEntry); + } + return alphabetized_; + } + + public int getAlphabetizedCount() { + return internalGetAlphabetized().getMap().size(); + } + + /** + * + * + *
        +   * The words that were expanded, indexed by their initial character.
        +   * (-- aip.dev/not-precedent: This is a legacy, non-standard pattern that violates
        +   * aip.dev/158. Ordinarily, this should be a `repeated` field, as in PagedExpandResponse. --)
        +   * 
        + * + * map<string, .google.showcase.v1beta1.PagedExpandResponseList> alphabetized = 1; + * + */ + @java.lang.Override + public boolean containsAlphabetized(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + return internalGetAlphabetized().getMap().containsKey(key); + } + + /** Use {@link #getAlphabetizedMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map + getAlphabetized() { + return getAlphabetizedMap(); + } + + /** + * + * + *
        +   * The words that were expanded, indexed by their initial character.
        +   * (-- aip.dev/not-precedent: This is a legacy, non-standard pattern that violates
        +   * aip.dev/158. Ordinarily, this should be a `repeated` field, as in PagedExpandResponse. --)
        +   * 
        + * + * map<string, .google.showcase.v1beta1.PagedExpandResponseList> alphabetized = 1; + * + */ + @java.lang.Override + public java.util.Map + getAlphabetizedMap() { + return internalGetAlphabetized().getMap(); + } + + /** + * + * + *
        +   * The words that were expanded, indexed by their initial character.
        +   * (-- aip.dev/not-precedent: This is a legacy, non-standard pattern that violates
        +   * aip.dev/158. Ordinarily, this should be a `repeated` field, as in PagedExpandResponse. --)
        +   * 
        + * + * map<string, .google.showcase.v1beta1.PagedExpandResponseList> alphabetized = 1; + * + */ + @java.lang.Override + public /* nullable */ com.google.showcase.v1beta1.PagedExpandResponseList + getAlphabetizedOrDefault( + java.lang.String key, + /* nullable */ + com.google.showcase.v1beta1.PagedExpandResponseList defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = + internalGetAlphabetized().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + + /** + * + * + *
        +   * The words that were expanded, indexed by their initial character.
        +   * (-- aip.dev/not-precedent: This is a legacy, non-standard pattern that violates
        +   * aip.dev/158. Ordinarily, this should be a `repeated` field, as in PagedExpandResponse. --)
        +   * 
        + * + * map<string, .google.showcase.v1beta1.PagedExpandResponseList> alphabetized = 1; + * + */ + @java.lang.Override + public com.google.showcase.v1beta1.PagedExpandResponseList getAlphabetizedOrThrow( + java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = + internalGetAlphabetized().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public static final int NEXT_PAGE_TOKEN_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object nextPageToken_ = ""; + + /** + * + * + *
        +   * The next page token.
        +   * 
        + * + * 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; + } + } + + /** + * + * + *
        +   * The next page token.
        +   * 
        + * + * 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 { + com.google.protobuf.GeneratedMessage.serializeStringMapTo( + output, internalGetAlphabetized(), AlphabetizedDefaultEntryHolder.defaultEntry, 1); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(nextPageToken_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, nextPageToken_); + } + 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 : internalGetAlphabetized().getMap().entrySet()) { + com.google.protobuf.MapEntry< + java.lang.String, com.google.showcase.v1beta1.PagedExpandResponseList> + alphabetized__ = + AlphabetizedDefaultEntryHolder.defaultEntry + .newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, alphabetized__); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(nextPageToken_)) { + size += com.google.protobuf.GeneratedMessage.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.showcase.v1beta1.PagedExpandLegacyMappedResponse)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.PagedExpandLegacyMappedResponse other = + (com.google.showcase.v1beta1.PagedExpandLegacyMappedResponse) obj; + + if (!internalGetAlphabetized().equals(other.internalGetAlphabetized())) 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 (!internalGetAlphabetized().getMap().isEmpty()) { + hash = (37 * hash) + ALPHABETIZED_FIELD_NUMBER; + hash = (53 * hash) + internalGetAlphabetized().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.showcase.v1beta1.PagedExpandLegacyMappedResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.PagedExpandLegacyMappedResponse parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.PagedExpandLegacyMappedResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.PagedExpandLegacyMappedResponse 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.showcase.v1beta1.PagedExpandLegacyMappedResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.PagedExpandLegacyMappedResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.PagedExpandLegacyMappedResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.PagedExpandLegacyMappedResponse parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.showcase.v1beta1.PagedExpandLegacyMappedResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.PagedExpandLegacyMappedResponse parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.showcase.v1beta1.PagedExpandLegacyMappedResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.PagedExpandLegacyMappedResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.showcase.v1beta1.PagedExpandLegacyMappedResponse 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** Protobuf type {@code google.showcase.v1beta1.PagedExpandLegacyMappedResponse} */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.PagedExpandLegacyMappedResponse) + com.google.showcase.v1beta1.PagedExpandLegacyMappedResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.EchoOuterClass + .internal_static_google_showcase_v1beta1_PagedExpandLegacyMappedResponse_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapFieldReflectionAccessor internalGetMapFieldReflection( + int number) { + switch (number) { + case 1: + return internalGetAlphabetized(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapFieldReflectionAccessor internalGetMutableMapFieldReflection( + int number) { + switch (number) { + case 1: + return internalGetMutableAlphabetized(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.EchoOuterClass + .internal_static_google_showcase_v1beta1_PagedExpandLegacyMappedResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.PagedExpandLegacyMappedResponse.class, + com.google.showcase.v1beta1.PagedExpandLegacyMappedResponse.Builder.class); + } + + // Construct using com.google.showcase.v1beta1.PagedExpandLegacyMappedResponse.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + internalGetMutableAlphabetized().clear(); + nextPageToken_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.showcase.v1beta1.EchoOuterClass + .internal_static_google_showcase_v1beta1_PagedExpandLegacyMappedResponse_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.PagedExpandLegacyMappedResponse getDefaultInstanceForType() { + return com.google.showcase.v1beta1.PagedExpandLegacyMappedResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.PagedExpandLegacyMappedResponse build() { + com.google.showcase.v1beta1.PagedExpandLegacyMappedResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.PagedExpandLegacyMappedResponse buildPartial() { + com.google.showcase.v1beta1.PagedExpandLegacyMappedResponse result = + new com.google.showcase.v1beta1.PagedExpandLegacyMappedResponse(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.showcase.v1beta1.PagedExpandLegacyMappedResponse result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.alphabetized_ = + internalGetAlphabetized().build(AlphabetizedDefaultEntryHolder.defaultEntry); + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.nextPageToken_ = nextPageToken_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.showcase.v1beta1.PagedExpandLegacyMappedResponse) { + return mergeFrom((com.google.showcase.v1beta1.PagedExpandLegacyMappedResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.showcase.v1beta1.PagedExpandLegacyMappedResponse other) { + if (other == com.google.showcase.v1beta1.PagedExpandLegacyMappedResponse.getDefaultInstance()) + return this; + internalGetMutableAlphabetized().mergeFrom(other.internalGetAlphabetized()); + bitField0_ |= 0x00000001; + 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.protobuf.MapEntry< + java.lang.String, com.google.showcase.v1beta1.PagedExpandResponseList> + alphabetized__ = + input.readMessage( + AlphabetizedDefaultEntryHolder.defaultEntry.getParserForType(), + extensionRegistry); + internalGetMutableAlphabetized() + .ensureBuilderMap() + .put(alphabetized__.getKey(), alphabetized__.getValue()); + bitField0_ |= 0x00000001; + 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 static final class AlphabetizedConverter + implements com.google.protobuf.MapFieldBuilder.Converter< + java.lang.String, + com.google.showcase.v1beta1.PagedExpandResponseListOrBuilder, + com.google.showcase.v1beta1.PagedExpandResponseList> { + @java.lang.Override + public com.google.showcase.v1beta1.PagedExpandResponseList build( + com.google.showcase.v1beta1.PagedExpandResponseListOrBuilder val) { + if (val instanceof com.google.showcase.v1beta1.PagedExpandResponseList) { + return (com.google.showcase.v1beta1.PagedExpandResponseList) val; + } + return ((com.google.showcase.v1beta1.PagedExpandResponseList.Builder) val).build(); + } + + @java.lang.Override + public com.google.protobuf.MapEntry< + java.lang.String, com.google.showcase.v1beta1.PagedExpandResponseList> + defaultEntry() { + return AlphabetizedDefaultEntryHolder.defaultEntry; + } + } + ; + + private static final AlphabetizedConverter alphabetizedConverter = new AlphabetizedConverter(); + + private com.google.protobuf.MapFieldBuilder< + java.lang.String, + com.google.showcase.v1beta1.PagedExpandResponseListOrBuilder, + com.google.showcase.v1beta1.PagedExpandResponseList, + com.google.showcase.v1beta1.PagedExpandResponseList.Builder> + alphabetized_; + + private com.google.protobuf.MapFieldBuilder< + java.lang.String, + com.google.showcase.v1beta1.PagedExpandResponseListOrBuilder, + com.google.showcase.v1beta1.PagedExpandResponseList, + com.google.showcase.v1beta1.PagedExpandResponseList.Builder> + internalGetAlphabetized() { + if (alphabetized_ == null) { + return new com.google.protobuf.MapFieldBuilder<>(alphabetizedConverter); + } + return alphabetized_; + } + + private com.google.protobuf.MapFieldBuilder< + java.lang.String, + com.google.showcase.v1beta1.PagedExpandResponseListOrBuilder, + com.google.showcase.v1beta1.PagedExpandResponseList, + com.google.showcase.v1beta1.PagedExpandResponseList.Builder> + internalGetMutableAlphabetized() { + if (alphabetized_ == null) { + alphabetized_ = new com.google.protobuf.MapFieldBuilder<>(alphabetizedConverter); + } + bitField0_ |= 0x00000001; + onChanged(); + return alphabetized_; + } + + public int getAlphabetizedCount() { + return internalGetAlphabetized().ensureBuilderMap().size(); + } + + /** + * + * + *
        +     * The words that were expanded, indexed by their initial character.
        +     * (-- aip.dev/not-precedent: This is a legacy, non-standard pattern that violates
        +     * aip.dev/158. Ordinarily, this should be a `repeated` field, as in PagedExpandResponse. --)
        +     * 
        + * + * map<string, .google.showcase.v1beta1.PagedExpandResponseList> alphabetized = 1; + * + */ + @java.lang.Override + public boolean containsAlphabetized(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + return internalGetAlphabetized().ensureBuilderMap().containsKey(key); + } + + /** Use {@link #getAlphabetizedMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map + getAlphabetized() { + return getAlphabetizedMap(); + } + + /** + * + * + *
        +     * The words that were expanded, indexed by their initial character.
        +     * (-- aip.dev/not-precedent: This is a legacy, non-standard pattern that violates
        +     * aip.dev/158. Ordinarily, this should be a `repeated` field, as in PagedExpandResponse. --)
        +     * 
        + * + * map<string, .google.showcase.v1beta1.PagedExpandResponseList> alphabetized = 1; + * + */ + @java.lang.Override + public java.util.Map + getAlphabetizedMap() { + return internalGetAlphabetized().getImmutableMap(); + } + + /** + * + * + *
        +     * The words that were expanded, indexed by their initial character.
        +     * (-- aip.dev/not-precedent: This is a legacy, non-standard pattern that violates
        +     * aip.dev/158. Ordinarily, this should be a `repeated` field, as in PagedExpandResponse. --)
        +     * 
        + * + * map<string, .google.showcase.v1beta1.PagedExpandResponseList> alphabetized = 1; + * + */ + @java.lang.Override + public /* nullable */ com.google.showcase.v1beta1.PagedExpandResponseList + getAlphabetizedOrDefault( + java.lang.String key, + /* nullable */ + com.google.showcase.v1beta1.PagedExpandResponseList defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map + map = internalGetMutableAlphabetized().ensureBuilderMap(); + return map.containsKey(key) ? alphabetizedConverter.build(map.get(key)) : defaultValue; + } + + /** + * + * + *
        +     * The words that were expanded, indexed by their initial character.
        +     * (-- aip.dev/not-precedent: This is a legacy, non-standard pattern that violates
        +     * aip.dev/158. Ordinarily, this should be a `repeated` field, as in PagedExpandResponse. --)
        +     * 
        + * + * map<string, .google.showcase.v1beta1.PagedExpandResponseList> alphabetized = 1; + * + */ + @java.lang.Override + public com.google.showcase.v1beta1.PagedExpandResponseList getAlphabetizedOrThrow( + java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map + map = internalGetMutableAlphabetized().ensureBuilderMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return alphabetizedConverter.build(map.get(key)); + } + + public Builder clearAlphabetized() { + bitField0_ = (bitField0_ & ~0x00000001); + internalGetMutableAlphabetized().clear(); + return this; + } + + /** + * + * + *
        +     * The words that were expanded, indexed by their initial character.
        +     * (-- aip.dev/not-precedent: This is a legacy, non-standard pattern that violates
        +     * aip.dev/158. Ordinarily, this should be a `repeated` field, as in PagedExpandResponse. --)
        +     * 
        + * + * map<string, .google.showcase.v1beta1.PagedExpandResponseList> alphabetized = 1; + * + */ + public Builder removeAlphabetized(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + internalGetMutableAlphabetized().ensureBuilderMap().remove(key); + return this; + } + + /** Use alternate mutation accessors instead. */ + @java.lang.Deprecated + public java.util.Map + getMutableAlphabetized() { + bitField0_ |= 0x00000001; + return internalGetMutableAlphabetized().ensureMessageMap(); + } + + /** + * + * + *
        +     * The words that were expanded, indexed by their initial character.
        +     * (-- aip.dev/not-precedent: This is a legacy, non-standard pattern that violates
        +     * aip.dev/158. Ordinarily, this should be a `repeated` field, as in PagedExpandResponse. --)
        +     * 
        + * + * map<string, .google.showcase.v1beta1.PagedExpandResponseList> alphabetized = 1; + * + */ + public Builder putAlphabetized( + java.lang.String key, com.google.showcase.v1beta1.PagedExpandResponseList value) { + if (key == null) { + throw new NullPointerException("map key"); + } + if (value == null) { + throw new NullPointerException("map value"); + } + internalGetMutableAlphabetized().ensureBuilderMap().put(key, value); + bitField0_ |= 0x00000001; + return this; + } + + /** + * + * + *
        +     * The words that were expanded, indexed by their initial character.
        +     * (-- aip.dev/not-precedent: This is a legacy, non-standard pattern that violates
        +     * aip.dev/158. Ordinarily, this should be a `repeated` field, as in PagedExpandResponse. --)
        +     * 
        + * + * map<string, .google.showcase.v1beta1.PagedExpandResponseList> alphabetized = 1; + * + */ + public Builder putAllAlphabetized( + java.util.Map + values) { + for (java.util.Map.Entry< + java.lang.String, com.google.showcase.v1beta1.PagedExpandResponseList> + e : values.entrySet()) { + if (e.getKey() == null || e.getValue() == null) { + throw new NullPointerException(); + } + } + internalGetMutableAlphabetized().ensureBuilderMap().putAll(values); + bitField0_ |= 0x00000001; + return this; + } + + /** + * + * + *
        +     * The words that were expanded, indexed by their initial character.
        +     * (-- aip.dev/not-precedent: This is a legacy, non-standard pattern that violates
        +     * aip.dev/158. Ordinarily, this should be a `repeated` field, as in PagedExpandResponse. --)
        +     * 
        + * + * map<string, .google.showcase.v1beta1.PagedExpandResponseList> alphabetized = 1; + * + */ + public com.google.showcase.v1beta1.PagedExpandResponseList.Builder + putAlphabetizedBuilderIfAbsent(java.lang.String key) { + java.util.Map + builderMap = internalGetMutableAlphabetized().ensureBuilderMap(); + com.google.showcase.v1beta1.PagedExpandResponseListOrBuilder entry = builderMap.get(key); + if (entry == null) { + entry = com.google.showcase.v1beta1.PagedExpandResponseList.newBuilder(); + builderMap.put(key, entry); + } + if (entry instanceof com.google.showcase.v1beta1.PagedExpandResponseList) { + entry = ((com.google.showcase.v1beta1.PagedExpandResponseList) entry).toBuilder(); + builderMap.put(key, entry); + } + return (com.google.showcase.v1beta1.PagedExpandResponseList.Builder) entry; + } + + private java.lang.Object nextPageToken_ = ""; + + /** + * + * + *
        +     * The next page token.
        +     * 
        + * + * 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; + } + } + + /** + * + * + *
        +     * The next page token.
        +     * 
        + * + * 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; + } + } + + /** + * + * + *
        +     * The next page token.
        +     * 
        + * + * 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; + } + + /** + * + * + *
        +     * The next page token.
        +     * 
        + * + * string next_page_token = 2; + * + * @return This builder for chaining. + */ + public Builder clearNextPageToken() { + nextPageToken_ = getDefaultInstance().getNextPageToken(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
        +     * The next page token.
        +     * 
        + * + * 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; + } + + // @@protoc_insertion_point(builder_scope:google.showcase.v1beta1.PagedExpandLegacyMappedResponse) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.PagedExpandLegacyMappedResponse) + private static final com.google.showcase.v1beta1.PagedExpandLegacyMappedResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.PagedExpandLegacyMappedResponse(); + } + + public static com.google.showcase.v1beta1.PagedExpandLegacyMappedResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public PagedExpandLegacyMappedResponse 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.showcase.v1beta1.PagedExpandLegacyMappedResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/PagedExpandLegacyMappedResponseOrBuilder.java b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/PagedExpandLegacyMappedResponseOrBuilder.java new file mode 100644 index 0000000000..5a81585c6d --- /dev/null +++ b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/PagedExpandLegacyMappedResponseOrBuilder.java @@ -0,0 +1,134 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: schema/google/showcase/v1beta1/echo.proto +// Protobuf Java Version: 4.33.2 + +package com.google.showcase.v1beta1; + +@com.google.protobuf.Generated +public interface PagedExpandLegacyMappedResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.PagedExpandLegacyMappedResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
        +   * The words that were expanded, indexed by their initial character.
        +   * (-- aip.dev/not-precedent: This is a legacy, non-standard pattern that violates
        +   * aip.dev/158. Ordinarily, this should be a `repeated` field, as in PagedExpandResponse. --)
        +   * 
        + * + * map<string, .google.showcase.v1beta1.PagedExpandResponseList> alphabetized = 1; + * + */ + int getAlphabetizedCount(); + + /** + * + * + *
        +   * The words that were expanded, indexed by their initial character.
        +   * (-- aip.dev/not-precedent: This is a legacy, non-standard pattern that violates
        +   * aip.dev/158. Ordinarily, this should be a `repeated` field, as in PagedExpandResponse. --)
        +   * 
        + * + * map<string, .google.showcase.v1beta1.PagedExpandResponseList> alphabetized = 1; + * + */ + boolean containsAlphabetized(java.lang.String key); + + /** Use {@link #getAlphabetizedMap()} instead. */ + @java.lang.Deprecated + java.util.Map + getAlphabetized(); + + /** + * + * + *
        +   * The words that were expanded, indexed by their initial character.
        +   * (-- aip.dev/not-precedent: This is a legacy, non-standard pattern that violates
        +   * aip.dev/158. Ordinarily, this should be a `repeated` field, as in PagedExpandResponse. --)
        +   * 
        + * + * map<string, .google.showcase.v1beta1.PagedExpandResponseList> alphabetized = 1; + * + */ + java.util.Map + getAlphabetizedMap(); + + /** + * + * + *
        +   * The words that were expanded, indexed by their initial character.
        +   * (-- aip.dev/not-precedent: This is a legacy, non-standard pattern that violates
        +   * aip.dev/158. Ordinarily, this should be a `repeated` field, as in PagedExpandResponse. --)
        +   * 
        + * + * map<string, .google.showcase.v1beta1.PagedExpandResponseList> alphabetized = 1; + * + */ + /* nullable */ + com.google.showcase.v1beta1.PagedExpandResponseList getAlphabetizedOrDefault( + java.lang.String key, + /* nullable */ + com.google.showcase.v1beta1.PagedExpandResponseList defaultValue); + + /** + * + * + *
        +   * The words that were expanded, indexed by their initial character.
        +   * (-- aip.dev/not-precedent: This is a legacy, non-standard pattern that violates
        +   * aip.dev/158. Ordinarily, this should be a `repeated` field, as in PagedExpandResponse. --)
        +   * 
        + * + * map<string, .google.showcase.v1beta1.PagedExpandResponseList> alphabetized = 1; + * + */ + com.google.showcase.v1beta1.PagedExpandResponseList getAlphabetizedOrThrow(java.lang.String key); + + /** + * + * + *
        +   * The next page token.
        +   * 
        + * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + java.lang.String getNextPageToken(); + + /** + * + * + *
        +   * The next page token.
        +   * 
        + * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + com.google.protobuf.ByteString getNextPageTokenBytes(); +} diff --git a/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/PagedExpandLegacyRequest.java b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/PagedExpandLegacyRequest.java new file mode 100644 index 0000000000..dfe6035096 --- /dev/null +++ b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/PagedExpandLegacyRequest.java @@ -0,0 +1,894 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: schema/google/showcase/v1beta1/echo.proto +// Protobuf Java Version: 4.33.2 + +package com.google.showcase.v1beta1; + +/** + * + * + *
        + * The request for the PagedExpandLegacy method.  This is a pattern used by some legacy APIs. New
        + * APIs should NOT use this pattern, but rather something like PagedExpandRequest which conforms to
        + * aip.dev/158.
        + * 
        + * + * Protobuf type {@code google.showcase.v1beta1.PagedExpandLegacyRequest} + */ +@com.google.protobuf.Generated +public final class PagedExpandLegacyRequest extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.PagedExpandLegacyRequest) + PagedExpandLegacyRequestOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "PagedExpandLegacyRequest"); + } + + // Use PagedExpandLegacyRequest.newBuilder() to construct. + private PagedExpandLegacyRequest(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private PagedExpandLegacyRequest() { + content_ = ""; + pageToken_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.EchoOuterClass + .internal_static_google_showcase_v1beta1_PagedExpandLegacyRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.EchoOuterClass + .internal_static_google_showcase_v1beta1_PagedExpandLegacyRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.PagedExpandLegacyRequest.class, + com.google.showcase.v1beta1.PagedExpandLegacyRequest.Builder.class); + } + + public static final int CONTENT_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object content_ = ""; + + /** + * + * + *
        +   * The string to expand.
        +   * 
        + * + * string content = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The content. + */ + @java.lang.Override + public java.lang.String getContent() { + java.lang.Object ref = content_; + 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(); + content_ = s; + return s; + } + } + + /** + * + * + *
        +   * The string to expand.
        +   * 
        + * + * string content = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for content. + */ + @java.lang.Override + public com.google.protobuf.ByteString getContentBytes() { + java.lang.Object ref = content_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + content_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int MAX_RESULTS_FIELD_NUMBER = 2; + private int maxResults_ = 0; + + /** + * + * + *
        +   * The number of words to returned in each page.
        +   * (-- aip.dev/not-precedent: This is a legacy, non-standard pattern that
        +   * violates aip.dev/158. Ordinarily, this should be page_size. --)
        +   * 
        + * + * int32 max_results = 2; + * + * @return The maxResults. + */ + @java.lang.Override + public int getMaxResults() { + return maxResults_; + } + + public static final int PAGE_TOKEN_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object pageToken_ = ""; + + /** + * + * + *
        +   * The position of the page to be returned.
        +   * 
        + * + * string page_token = 3; + * + * @return The pageToken. + */ + @java.lang.Override + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; + } + } + + /** + * + * + *
        +   * The position of the page to be returned.
        +   * 
        + * + * string page_token = 3; + * + * @return The bytes for pageToken. + */ + @java.lang.Override + public com.google.protobuf.ByteString getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(content_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, content_); + } + if (maxResults_ != 0) { + output.writeInt32(2, maxResults_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(pageToken_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 3, pageToken_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(content_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, content_); + } + if (maxResults_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(2, maxResults_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(pageToken_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(3, 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.showcase.v1beta1.PagedExpandLegacyRequest)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.PagedExpandLegacyRequest other = + (com.google.showcase.v1beta1.PagedExpandLegacyRequest) obj; + + if (!getContent().equals(other.getContent())) return false; + if (getMaxResults() != other.getMaxResults()) 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) + CONTENT_FIELD_NUMBER; + hash = (53 * hash) + getContent().hashCode(); + hash = (37 * hash) + MAX_RESULTS_FIELD_NUMBER; + hash = (53 * hash) + getMaxResults(); + 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.showcase.v1beta1.PagedExpandLegacyRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.PagedExpandLegacyRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.PagedExpandLegacyRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.PagedExpandLegacyRequest 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.showcase.v1beta1.PagedExpandLegacyRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.PagedExpandLegacyRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.PagedExpandLegacyRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.PagedExpandLegacyRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.showcase.v1beta1.PagedExpandLegacyRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.PagedExpandLegacyRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.showcase.v1beta1.PagedExpandLegacyRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.PagedExpandLegacyRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.showcase.v1beta1.PagedExpandLegacyRequest 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
        +   * The request for the PagedExpandLegacy method.  This is a pattern used by some legacy APIs. New
        +   * APIs should NOT use this pattern, but rather something like PagedExpandRequest which conforms to
        +   * aip.dev/158.
        +   * 
        + * + * Protobuf type {@code google.showcase.v1beta1.PagedExpandLegacyRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.PagedExpandLegacyRequest) + com.google.showcase.v1beta1.PagedExpandLegacyRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.EchoOuterClass + .internal_static_google_showcase_v1beta1_PagedExpandLegacyRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.EchoOuterClass + .internal_static_google_showcase_v1beta1_PagedExpandLegacyRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.PagedExpandLegacyRequest.class, + com.google.showcase.v1beta1.PagedExpandLegacyRequest.Builder.class); + } + + // Construct using com.google.showcase.v1beta1.PagedExpandLegacyRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + content_ = ""; + maxResults_ = 0; + pageToken_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.showcase.v1beta1.EchoOuterClass + .internal_static_google_showcase_v1beta1_PagedExpandLegacyRequest_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.PagedExpandLegacyRequest getDefaultInstanceForType() { + return com.google.showcase.v1beta1.PagedExpandLegacyRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.PagedExpandLegacyRequest build() { + com.google.showcase.v1beta1.PagedExpandLegacyRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.PagedExpandLegacyRequest buildPartial() { + com.google.showcase.v1beta1.PagedExpandLegacyRequest result = + new com.google.showcase.v1beta1.PagedExpandLegacyRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.showcase.v1beta1.PagedExpandLegacyRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.content_ = content_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.maxResults_ = maxResults_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.pageToken_ = pageToken_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.showcase.v1beta1.PagedExpandLegacyRequest) { + return mergeFrom((com.google.showcase.v1beta1.PagedExpandLegacyRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.showcase.v1beta1.PagedExpandLegacyRequest other) { + if (other == com.google.showcase.v1beta1.PagedExpandLegacyRequest.getDefaultInstance()) + return this; + if (!other.getContent().isEmpty()) { + content_ = other.content_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.getMaxResults() != 0) { + setMaxResults(other.getMaxResults()); + } + if (!other.getPageToken().isEmpty()) { + pageToken_ = other.pageToken_; + 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: + { + content_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 16: + { + maxResults_ = input.readInt32(); + bitField0_ |= 0x00000002; + break; + } // case 16 + case 26: + { + pageToken_ = 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 content_ = ""; + + /** + * + * + *
        +     * The string to expand.
        +     * 
        + * + * string content = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The content. + */ + public java.lang.String getContent() { + java.lang.Object ref = content_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + content_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
        +     * The string to expand.
        +     * 
        + * + * string content = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for content. + */ + public com.google.protobuf.ByteString getContentBytes() { + java.lang.Object ref = content_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + content_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
        +     * The string to expand.
        +     * 
        + * + * string content = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The content to set. + * @return This builder for chaining. + */ + public Builder setContent(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + content_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
        +     * The string to expand.
        +     * 
        + * + * string content = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearContent() { + content_ = getDefaultInstance().getContent(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
        +     * The string to expand.
        +     * 
        + * + * string content = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for content to set. + * @return This builder for chaining. + */ + public Builder setContentBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + content_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private int maxResults_; + + /** + * + * + *
        +     * The number of words to returned in each page.
        +     * (-- aip.dev/not-precedent: This is a legacy, non-standard pattern that
        +     * violates aip.dev/158. Ordinarily, this should be page_size. --)
        +     * 
        + * + * int32 max_results = 2; + * + * @return The maxResults. + */ + @java.lang.Override + public int getMaxResults() { + return maxResults_; + } + + /** + * + * + *
        +     * The number of words to returned in each page.
        +     * (-- aip.dev/not-precedent: This is a legacy, non-standard pattern that
        +     * violates aip.dev/158. Ordinarily, this should be page_size. --)
        +     * 
        + * + * int32 max_results = 2; + * + * @param value The maxResults to set. + * @return This builder for chaining. + */ + public Builder setMaxResults(int value) { + + maxResults_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
        +     * The number of words to returned in each page.
        +     * (-- aip.dev/not-precedent: This is a legacy, non-standard pattern that
        +     * violates aip.dev/158. Ordinarily, this should be page_size. --)
        +     * 
        + * + * int32 max_results = 2; + * + * @return This builder for chaining. + */ + public Builder clearMaxResults() { + bitField0_ = (bitField0_ & ~0x00000002); + maxResults_ = 0; + onChanged(); + return this; + } + + private java.lang.Object pageToken_ = ""; + + /** + * + * + *
        +     * The position of the page to be returned.
        +     * 
        + * + * string page_token = 3; + * + * @return The pageToken. + */ + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
        +     * The position of the page to be returned.
        +     * 
        + * + * string page_token = 3; + * + * @return The bytes for pageToken. + */ + public com.google.protobuf.ByteString getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
        +     * The position of the page to be returned.
        +     * 
        + * + * string page_token = 3; + * + * @param value The pageToken to set. + * @return This builder for chaining. + */ + public Builder setPageToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + pageToken_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
        +     * The position of the page to be returned.
        +     * 
        + * + * string page_token = 3; + * + * @return This builder for chaining. + */ + public Builder clearPageToken() { + pageToken_ = getDefaultInstance().getPageToken(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + + /** + * + * + *
        +     * The position of the page to be returned.
        +     * 
        + * + * string page_token = 3; + * + * @param value The bytes for pageToken to set. + * @return This builder for chaining. + */ + public Builder setPageTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + pageToken_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.showcase.v1beta1.PagedExpandLegacyRequest) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.PagedExpandLegacyRequest) + private static final com.google.showcase.v1beta1.PagedExpandLegacyRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.PagedExpandLegacyRequest(); + } + + public static com.google.showcase.v1beta1.PagedExpandLegacyRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public PagedExpandLegacyRequest 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.showcase.v1beta1.PagedExpandLegacyRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/PagedExpandLegacyRequestOrBuilder.java b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/PagedExpandLegacyRequestOrBuilder.java new file mode 100644 index 0000000000..a773e38726 --- /dev/null +++ b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/PagedExpandLegacyRequestOrBuilder.java @@ -0,0 +1,95 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: schema/google/showcase/v1beta1/echo.proto +// Protobuf Java Version: 4.33.2 + +package com.google.showcase.v1beta1; + +@com.google.protobuf.Generated +public interface PagedExpandLegacyRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.PagedExpandLegacyRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
        +   * The string to expand.
        +   * 
        + * + * string content = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The content. + */ + java.lang.String getContent(); + + /** + * + * + *
        +   * The string to expand.
        +   * 
        + * + * string content = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for content. + */ + com.google.protobuf.ByteString getContentBytes(); + + /** + * + * + *
        +   * The number of words to returned in each page.
        +   * (-- aip.dev/not-precedent: This is a legacy, non-standard pattern that
        +   * violates aip.dev/158. Ordinarily, this should be page_size. --)
        +   * 
        + * + * int32 max_results = 2; + * + * @return The maxResults. + */ + int getMaxResults(); + + /** + * + * + *
        +   * The position of the page to be returned.
        +   * 
        + * + * string page_token = 3; + * + * @return The pageToken. + */ + java.lang.String getPageToken(); + + /** + * + * + *
        +   * The position of the page to be returned.
        +   * 
        + * + * string page_token = 3; + * + * @return The bytes for pageToken. + */ + com.google.protobuf.ByteString getPageTokenBytes(); +} diff --git a/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/PagedExpandRequest.java b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/PagedExpandRequest.java new file mode 100644 index 0000000000..7784857223 --- /dev/null +++ b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/PagedExpandRequest.java @@ -0,0 +1,881 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: schema/google/showcase/v1beta1/echo.proto +// Protobuf Java Version: 4.33.2 + +package com.google.showcase.v1beta1; + +/** + * + * + *
        + * The request for the PagedExpand method.
        + * 
        + * + * Protobuf type {@code google.showcase.v1beta1.PagedExpandRequest} + */ +@com.google.protobuf.Generated +public final class PagedExpandRequest extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.PagedExpandRequest) + PagedExpandRequestOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "PagedExpandRequest"); + } + + // Use PagedExpandRequest.newBuilder() to construct. + private PagedExpandRequest(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private PagedExpandRequest() { + content_ = ""; + pageToken_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.EchoOuterClass + .internal_static_google_showcase_v1beta1_PagedExpandRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.EchoOuterClass + .internal_static_google_showcase_v1beta1_PagedExpandRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.PagedExpandRequest.class, + com.google.showcase.v1beta1.PagedExpandRequest.Builder.class); + } + + public static final int CONTENT_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object content_ = ""; + + /** + * + * + *
        +   * The string to expand.
        +   * 
        + * + * string content = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The content. + */ + @java.lang.Override + public java.lang.String getContent() { + java.lang.Object ref = content_; + 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(); + content_ = s; + return s; + } + } + + /** + * + * + *
        +   * The string to expand.
        +   * 
        + * + * string content = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for content. + */ + @java.lang.Override + public com.google.protobuf.ByteString getContentBytes() { + java.lang.Object ref = content_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + content_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PAGE_SIZE_FIELD_NUMBER = 2; + private int pageSize_ = 0; + + /** + * + * + *
        +   * The number of words to returned in each page.
        +   * 
        + * + * int32 page_size = 2; + * + * @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_ = ""; + + /** + * + * + *
        +   * The position of the page to be returned.
        +   * 
        + * + * string page_token = 3; + * + * @return The pageToken. + */ + @java.lang.Override + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; + } + } + + /** + * + * + *
        +   * The position of the page to be returned.
        +   * 
        + * + * string page_token = 3; + * + * @return The bytes for pageToken. + */ + @java.lang.Override + public com.google.protobuf.ByteString getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(content_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, content_); + } + if (pageSize_ != 0) { + output.writeInt32(2, pageSize_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(pageToken_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 3, pageToken_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(content_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, content_); + } + if (pageSize_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(2, pageSize_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(pageToken_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(3, 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.showcase.v1beta1.PagedExpandRequest)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.PagedExpandRequest other = + (com.google.showcase.v1beta1.PagedExpandRequest) obj; + + if (!getContent().equals(other.getContent())) 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) + CONTENT_FIELD_NUMBER; + hash = (53 * hash) + getContent().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.showcase.v1beta1.PagedExpandRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.PagedExpandRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.PagedExpandRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.PagedExpandRequest 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.showcase.v1beta1.PagedExpandRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.PagedExpandRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.PagedExpandRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.PagedExpandRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.showcase.v1beta1.PagedExpandRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.PagedExpandRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.showcase.v1beta1.PagedExpandRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.PagedExpandRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.showcase.v1beta1.PagedExpandRequest 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
        +   * The request for the PagedExpand method.
        +   * 
        + * + * Protobuf type {@code google.showcase.v1beta1.PagedExpandRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.PagedExpandRequest) + com.google.showcase.v1beta1.PagedExpandRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.EchoOuterClass + .internal_static_google_showcase_v1beta1_PagedExpandRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.EchoOuterClass + .internal_static_google_showcase_v1beta1_PagedExpandRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.PagedExpandRequest.class, + com.google.showcase.v1beta1.PagedExpandRequest.Builder.class); + } + + // Construct using com.google.showcase.v1beta1.PagedExpandRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + content_ = ""; + pageSize_ = 0; + pageToken_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.showcase.v1beta1.EchoOuterClass + .internal_static_google_showcase_v1beta1_PagedExpandRequest_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.PagedExpandRequest getDefaultInstanceForType() { + return com.google.showcase.v1beta1.PagedExpandRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.PagedExpandRequest build() { + com.google.showcase.v1beta1.PagedExpandRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.PagedExpandRequest buildPartial() { + com.google.showcase.v1beta1.PagedExpandRequest result = + new com.google.showcase.v1beta1.PagedExpandRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.showcase.v1beta1.PagedExpandRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.content_ = content_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.pageSize_ = pageSize_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.pageToken_ = pageToken_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.showcase.v1beta1.PagedExpandRequest) { + return mergeFrom((com.google.showcase.v1beta1.PagedExpandRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.showcase.v1beta1.PagedExpandRequest other) { + if (other == com.google.showcase.v1beta1.PagedExpandRequest.getDefaultInstance()) return this; + if (!other.getContent().isEmpty()) { + content_ = other.content_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.getPageSize() != 0) { + setPageSize(other.getPageSize()); + } + if (!other.getPageToken().isEmpty()) { + pageToken_ = other.pageToken_; + 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: + { + content_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 16: + { + pageSize_ = input.readInt32(); + bitField0_ |= 0x00000002; + break; + } // case 16 + case 26: + { + pageToken_ = 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 content_ = ""; + + /** + * + * + *
        +     * The string to expand.
        +     * 
        + * + * string content = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The content. + */ + public java.lang.String getContent() { + java.lang.Object ref = content_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + content_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
        +     * The string to expand.
        +     * 
        + * + * string content = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for content. + */ + public com.google.protobuf.ByteString getContentBytes() { + java.lang.Object ref = content_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + content_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
        +     * The string to expand.
        +     * 
        + * + * string content = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The content to set. + * @return This builder for chaining. + */ + public Builder setContent(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + content_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
        +     * The string to expand.
        +     * 
        + * + * string content = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearContent() { + content_ = getDefaultInstance().getContent(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
        +     * The string to expand.
        +     * 
        + * + * string content = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for content to set. + * @return This builder for chaining. + */ + public Builder setContentBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + content_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private int pageSize_; + + /** + * + * + *
        +     * The number of words to returned in each page.
        +     * 
        + * + * int32 page_size = 2; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + + /** + * + * + *
        +     * The number of words to returned in each page.
        +     * 
        + * + * int32 page_size = 2; + * + * @param value The pageSize to set. + * @return This builder for chaining. + */ + public Builder setPageSize(int value) { + + pageSize_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
        +     * The number of words to returned in each page.
        +     * 
        + * + * int32 page_size = 2; + * + * @return This builder for chaining. + */ + public Builder clearPageSize() { + bitField0_ = (bitField0_ & ~0x00000002); + pageSize_ = 0; + onChanged(); + return this; + } + + private java.lang.Object pageToken_ = ""; + + /** + * + * + *
        +     * The position of the page to be returned.
        +     * 
        + * + * string page_token = 3; + * + * @return The pageToken. + */ + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
        +     * The position of the page to be returned.
        +     * 
        + * + * string page_token = 3; + * + * @return The bytes for pageToken. + */ + public com.google.protobuf.ByteString getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
        +     * The position of the page to be returned.
        +     * 
        + * + * string page_token = 3; + * + * @param value The pageToken to set. + * @return This builder for chaining. + */ + public Builder setPageToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + pageToken_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
        +     * The position of the page to be returned.
        +     * 
        + * + * string page_token = 3; + * + * @return This builder for chaining. + */ + public Builder clearPageToken() { + pageToken_ = getDefaultInstance().getPageToken(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + + /** + * + * + *
        +     * The position of the page to be returned.
        +     * 
        + * + * string page_token = 3; + * + * @param value The bytes for pageToken to set. + * @return This builder for chaining. + */ + public Builder setPageTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + pageToken_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.showcase.v1beta1.PagedExpandRequest) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.PagedExpandRequest) + private static final com.google.showcase.v1beta1.PagedExpandRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.PagedExpandRequest(); + } + + public static com.google.showcase.v1beta1.PagedExpandRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public PagedExpandRequest 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.showcase.v1beta1.PagedExpandRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/PagedExpandRequestOrBuilder.java b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/PagedExpandRequestOrBuilder.java new file mode 100644 index 0000000000..b820ad1803 --- /dev/null +++ b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/PagedExpandRequestOrBuilder.java @@ -0,0 +1,93 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: schema/google/showcase/v1beta1/echo.proto +// Protobuf Java Version: 4.33.2 + +package com.google.showcase.v1beta1; + +@com.google.protobuf.Generated +public interface PagedExpandRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.PagedExpandRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
        +   * The string to expand.
        +   * 
        + * + * string content = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The content. + */ + java.lang.String getContent(); + + /** + * + * + *
        +   * The string to expand.
        +   * 
        + * + * string content = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for content. + */ + com.google.protobuf.ByteString getContentBytes(); + + /** + * + * + *
        +   * The number of words to returned in each page.
        +   * 
        + * + * int32 page_size = 2; + * + * @return The pageSize. + */ + int getPageSize(); + + /** + * + * + *
        +   * The position of the page to be returned.
        +   * 
        + * + * string page_token = 3; + * + * @return The pageToken. + */ + java.lang.String getPageToken(); + + /** + * + * + *
        +   * The position of the page to be returned.
        +   * 
        + * + * string page_token = 3; + * + * @return The bytes for pageToken. + */ + com.google.protobuf.ByteString getPageTokenBytes(); +} diff --git a/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/PagedExpandResponse.java b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/PagedExpandResponse.java new file mode 100644 index 0000000000..cd69e20acc --- /dev/null +++ b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/PagedExpandResponse.java @@ -0,0 +1,1111 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: schema/google/showcase/v1beta1/echo.proto +// Protobuf Java Version: 4.33.2 + +package com.google.showcase.v1beta1; + +/** + * + * + *
        + * The response for the PagedExpand method.
        + * 
        + * + * Protobuf type {@code google.showcase.v1beta1.PagedExpandResponse} + */ +@com.google.protobuf.Generated +public final class PagedExpandResponse extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.PagedExpandResponse) + PagedExpandResponseOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "PagedExpandResponse"); + } + + // Use PagedExpandResponse.newBuilder() to construct. + private PagedExpandResponse(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private PagedExpandResponse() { + responses_ = java.util.Collections.emptyList(); + nextPageToken_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.EchoOuterClass + .internal_static_google_showcase_v1beta1_PagedExpandResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.EchoOuterClass + .internal_static_google_showcase_v1beta1_PagedExpandResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.PagedExpandResponse.class, + com.google.showcase.v1beta1.PagedExpandResponse.Builder.class); + } + + public static final int RESPONSES_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private java.util.List responses_; + + /** + * + * + *
        +   * The words that were expanded.
        +   * 
        + * + * repeated .google.showcase.v1beta1.EchoResponse responses = 1; + */ + @java.lang.Override + public java.util.List getResponsesList() { + return responses_; + } + + /** + * + * + *
        +   * The words that were expanded.
        +   * 
        + * + * repeated .google.showcase.v1beta1.EchoResponse responses = 1; + */ + @java.lang.Override + public java.util.List + getResponsesOrBuilderList() { + return responses_; + } + + /** + * + * + *
        +   * The words that were expanded.
        +   * 
        + * + * repeated .google.showcase.v1beta1.EchoResponse responses = 1; + */ + @java.lang.Override + public int getResponsesCount() { + return responses_.size(); + } + + /** + * + * + *
        +   * The words that were expanded.
        +   * 
        + * + * repeated .google.showcase.v1beta1.EchoResponse responses = 1; + */ + @java.lang.Override + public com.google.showcase.v1beta1.EchoResponse getResponses(int index) { + return responses_.get(index); + } + + /** + * + * + *
        +   * The words that were expanded.
        +   * 
        + * + * repeated .google.showcase.v1beta1.EchoResponse responses = 1; + */ + @java.lang.Override + public com.google.showcase.v1beta1.EchoResponseOrBuilder getResponsesOrBuilder(int index) { + return responses_.get(index); + } + + public static final int NEXT_PAGE_TOKEN_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object nextPageToken_ = ""; + + /** + * + * + *
        +   * The next page token.
        +   * 
        + * + * 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; + } + } + + /** + * + * + *
        +   * The next page token.
        +   * 
        + * + * 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 < responses_.size(); i++) { + output.writeMessage(1, responses_.get(i)); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(nextPageToken_)) { + com.google.protobuf.GeneratedMessage.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 < responses_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, responses_.get(i)); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(nextPageToken_)) { + size += com.google.protobuf.GeneratedMessage.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.showcase.v1beta1.PagedExpandResponse)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.PagedExpandResponse other = + (com.google.showcase.v1beta1.PagedExpandResponse) obj; + + if (!getResponsesList().equals(other.getResponsesList())) 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 (getResponsesCount() > 0) { + hash = (37 * hash) + RESPONSES_FIELD_NUMBER; + hash = (53 * hash) + getResponsesList().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.showcase.v1beta1.PagedExpandResponse parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.PagedExpandResponse parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.PagedExpandResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.PagedExpandResponse 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.showcase.v1beta1.PagedExpandResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.PagedExpandResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.PagedExpandResponse parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.PagedExpandResponse parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.showcase.v1beta1.PagedExpandResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.PagedExpandResponse parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.showcase.v1beta1.PagedExpandResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.PagedExpandResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.showcase.v1beta1.PagedExpandResponse 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
        +   * The response for the PagedExpand method.
        +   * 
        + * + * Protobuf type {@code google.showcase.v1beta1.PagedExpandResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.PagedExpandResponse) + com.google.showcase.v1beta1.PagedExpandResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.EchoOuterClass + .internal_static_google_showcase_v1beta1_PagedExpandResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.EchoOuterClass + .internal_static_google_showcase_v1beta1_PagedExpandResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.PagedExpandResponse.class, + com.google.showcase.v1beta1.PagedExpandResponse.Builder.class); + } + + // Construct using com.google.showcase.v1beta1.PagedExpandResponse.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (responsesBuilder_ == null) { + responses_ = java.util.Collections.emptyList(); + } else { + responses_ = null; + responsesBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + nextPageToken_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.showcase.v1beta1.EchoOuterClass + .internal_static_google_showcase_v1beta1_PagedExpandResponse_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.PagedExpandResponse getDefaultInstanceForType() { + return com.google.showcase.v1beta1.PagedExpandResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.PagedExpandResponse build() { + com.google.showcase.v1beta1.PagedExpandResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.PagedExpandResponse buildPartial() { + com.google.showcase.v1beta1.PagedExpandResponse result = + new com.google.showcase.v1beta1.PagedExpandResponse(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields( + com.google.showcase.v1beta1.PagedExpandResponse result) { + if (responsesBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + responses_ = java.util.Collections.unmodifiableList(responses_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.responses_ = responses_; + } else { + result.responses_ = responsesBuilder_.build(); + } + } + + private void buildPartial0(com.google.showcase.v1beta1.PagedExpandResponse result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.nextPageToken_ = nextPageToken_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.showcase.v1beta1.PagedExpandResponse) { + return mergeFrom((com.google.showcase.v1beta1.PagedExpandResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.showcase.v1beta1.PagedExpandResponse other) { + if (other == com.google.showcase.v1beta1.PagedExpandResponse.getDefaultInstance()) + return this; + if (responsesBuilder_ == null) { + if (!other.responses_.isEmpty()) { + if (responses_.isEmpty()) { + responses_ = other.responses_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureResponsesIsMutable(); + responses_.addAll(other.responses_); + } + onChanged(); + } + } else { + if (!other.responses_.isEmpty()) { + if (responsesBuilder_.isEmpty()) { + responsesBuilder_.dispose(); + responsesBuilder_ = null; + responses_ = other.responses_; + bitField0_ = (bitField0_ & ~0x00000001); + responsesBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders + ? internalGetResponsesFieldBuilder() + : null; + } else { + responsesBuilder_.addAllMessages(other.responses_); + } + } + } + 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.showcase.v1beta1.EchoResponse m = + input.readMessage( + com.google.showcase.v1beta1.EchoResponse.parser(), extensionRegistry); + if (responsesBuilder_ == null) { + ensureResponsesIsMutable(); + responses_.add(m); + } else { + responsesBuilder_.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 responses_ = + java.util.Collections.emptyList(); + + private void ensureResponsesIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + responses_ = new java.util.ArrayList(responses_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.google.showcase.v1beta1.EchoResponse, + com.google.showcase.v1beta1.EchoResponse.Builder, + com.google.showcase.v1beta1.EchoResponseOrBuilder> + responsesBuilder_; + + /** + * + * + *
        +     * The words that were expanded.
        +     * 
        + * + * repeated .google.showcase.v1beta1.EchoResponse responses = 1; + */ + public java.util.List getResponsesList() { + if (responsesBuilder_ == null) { + return java.util.Collections.unmodifiableList(responses_); + } else { + return responsesBuilder_.getMessageList(); + } + } + + /** + * + * + *
        +     * The words that were expanded.
        +     * 
        + * + * repeated .google.showcase.v1beta1.EchoResponse responses = 1; + */ + public int getResponsesCount() { + if (responsesBuilder_ == null) { + return responses_.size(); + } else { + return responsesBuilder_.getCount(); + } + } + + /** + * + * + *
        +     * The words that were expanded.
        +     * 
        + * + * repeated .google.showcase.v1beta1.EchoResponse responses = 1; + */ + public com.google.showcase.v1beta1.EchoResponse getResponses(int index) { + if (responsesBuilder_ == null) { + return responses_.get(index); + } else { + return responsesBuilder_.getMessage(index); + } + } + + /** + * + * + *
        +     * The words that were expanded.
        +     * 
        + * + * repeated .google.showcase.v1beta1.EchoResponse responses = 1; + */ + public Builder setResponses(int index, com.google.showcase.v1beta1.EchoResponse value) { + if (responsesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureResponsesIsMutable(); + responses_.set(index, value); + onChanged(); + } else { + responsesBuilder_.setMessage(index, value); + } + return this; + } + + /** + * + * + *
        +     * The words that were expanded.
        +     * 
        + * + * repeated .google.showcase.v1beta1.EchoResponse responses = 1; + */ + public Builder setResponses( + int index, com.google.showcase.v1beta1.EchoResponse.Builder builderForValue) { + if (responsesBuilder_ == null) { + ensureResponsesIsMutable(); + responses_.set(index, builderForValue.build()); + onChanged(); + } else { + responsesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
        +     * The words that were expanded.
        +     * 
        + * + * repeated .google.showcase.v1beta1.EchoResponse responses = 1; + */ + public Builder addResponses(com.google.showcase.v1beta1.EchoResponse value) { + if (responsesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureResponsesIsMutable(); + responses_.add(value); + onChanged(); + } else { + responsesBuilder_.addMessage(value); + } + return this; + } + + /** + * + * + *
        +     * The words that were expanded.
        +     * 
        + * + * repeated .google.showcase.v1beta1.EchoResponse responses = 1; + */ + public Builder addResponses(int index, com.google.showcase.v1beta1.EchoResponse value) { + if (responsesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureResponsesIsMutable(); + responses_.add(index, value); + onChanged(); + } else { + responsesBuilder_.addMessage(index, value); + } + return this; + } + + /** + * + * + *
        +     * The words that were expanded.
        +     * 
        + * + * repeated .google.showcase.v1beta1.EchoResponse responses = 1; + */ + public Builder addResponses(com.google.showcase.v1beta1.EchoResponse.Builder builderForValue) { + if (responsesBuilder_ == null) { + ensureResponsesIsMutable(); + responses_.add(builderForValue.build()); + onChanged(); + } else { + responsesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + + /** + * + * + *
        +     * The words that were expanded.
        +     * 
        + * + * repeated .google.showcase.v1beta1.EchoResponse responses = 1; + */ + public Builder addResponses( + int index, com.google.showcase.v1beta1.EchoResponse.Builder builderForValue) { + if (responsesBuilder_ == null) { + ensureResponsesIsMutable(); + responses_.add(index, builderForValue.build()); + onChanged(); + } else { + responsesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
        +     * The words that were expanded.
        +     * 
        + * + * repeated .google.showcase.v1beta1.EchoResponse responses = 1; + */ + public Builder addAllResponses( + java.lang.Iterable values) { + if (responsesBuilder_ == null) { + ensureResponsesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, responses_); + onChanged(); + } else { + responsesBuilder_.addAllMessages(values); + } + return this; + } + + /** + * + * + *
        +     * The words that were expanded.
        +     * 
        + * + * repeated .google.showcase.v1beta1.EchoResponse responses = 1; + */ + public Builder clearResponses() { + if (responsesBuilder_ == null) { + responses_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + responsesBuilder_.clear(); + } + return this; + } + + /** + * + * + *
        +     * The words that were expanded.
        +     * 
        + * + * repeated .google.showcase.v1beta1.EchoResponse responses = 1; + */ + public Builder removeResponses(int index) { + if (responsesBuilder_ == null) { + ensureResponsesIsMutable(); + responses_.remove(index); + onChanged(); + } else { + responsesBuilder_.remove(index); + } + return this; + } + + /** + * + * + *
        +     * The words that were expanded.
        +     * 
        + * + * repeated .google.showcase.v1beta1.EchoResponse responses = 1; + */ + public com.google.showcase.v1beta1.EchoResponse.Builder getResponsesBuilder(int index) { + return internalGetResponsesFieldBuilder().getBuilder(index); + } + + /** + * + * + *
        +     * The words that were expanded.
        +     * 
        + * + * repeated .google.showcase.v1beta1.EchoResponse responses = 1; + */ + public com.google.showcase.v1beta1.EchoResponseOrBuilder getResponsesOrBuilder(int index) { + if (responsesBuilder_ == null) { + return responses_.get(index); + } else { + return responsesBuilder_.getMessageOrBuilder(index); + } + } + + /** + * + * + *
        +     * The words that were expanded.
        +     * 
        + * + * repeated .google.showcase.v1beta1.EchoResponse responses = 1; + */ + public java.util.List + getResponsesOrBuilderList() { + if (responsesBuilder_ != null) { + return responsesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(responses_); + } + } + + /** + * + * + *
        +     * The words that were expanded.
        +     * 
        + * + * repeated .google.showcase.v1beta1.EchoResponse responses = 1; + */ + public com.google.showcase.v1beta1.EchoResponse.Builder addResponsesBuilder() { + return internalGetResponsesFieldBuilder() + .addBuilder(com.google.showcase.v1beta1.EchoResponse.getDefaultInstance()); + } + + /** + * + * + *
        +     * The words that were expanded.
        +     * 
        + * + * repeated .google.showcase.v1beta1.EchoResponse responses = 1; + */ + public com.google.showcase.v1beta1.EchoResponse.Builder addResponsesBuilder(int index) { + return internalGetResponsesFieldBuilder() + .addBuilder(index, com.google.showcase.v1beta1.EchoResponse.getDefaultInstance()); + } + + /** + * + * + *
        +     * The words that were expanded.
        +     * 
        + * + * repeated .google.showcase.v1beta1.EchoResponse responses = 1; + */ + public java.util.List + getResponsesBuilderList() { + return internalGetResponsesFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.google.showcase.v1beta1.EchoResponse, + com.google.showcase.v1beta1.EchoResponse.Builder, + com.google.showcase.v1beta1.EchoResponseOrBuilder> + internalGetResponsesFieldBuilder() { + if (responsesBuilder_ == null) { + responsesBuilder_ = + new com.google.protobuf.RepeatedFieldBuilder< + com.google.showcase.v1beta1.EchoResponse, + com.google.showcase.v1beta1.EchoResponse.Builder, + com.google.showcase.v1beta1.EchoResponseOrBuilder>( + responses_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + responses_ = null; + } + return responsesBuilder_; + } + + private java.lang.Object nextPageToken_ = ""; + + /** + * + * + *
        +     * The next page token.
        +     * 
        + * + * 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; + } + } + + /** + * + * + *
        +     * The next page token.
        +     * 
        + * + * 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; + } + } + + /** + * + * + *
        +     * The next page token.
        +     * 
        + * + * 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; + } + + /** + * + * + *
        +     * The next page token.
        +     * 
        + * + * string next_page_token = 2; + * + * @return This builder for chaining. + */ + public Builder clearNextPageToken() { + nextPageToken_ = getDefaultInstance().getNextPageToken(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
        +     * The next page token.
        +     * 
        + * + * 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; + } + + // @@protoc_insertion_point(builder_scope:google.showcase.v1beta1.PagedExpandResponse) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.PagedExpandResponse) + private static final com.google.showcase.v1beta1.PagedExpandResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.PagedExpandResponse(); + } + + public static com.google.showcase.v1beta1.PagedExpandResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public PagedExpandResponse 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.showcase.v1beta1.PagedExpandResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/PagedExpandResponseList.java b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/PagedExpandResponseList.java new file mode 100644 index 0000000000..bc867545c6 --- /dev/null +++ b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/PagedExpandResponseList.java @@ -0,0 +1,619 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: schema/google/showcase/v1beta1/echo.proto +// Protobuf Java Version: 4.33.2 + +package com.google.showcase.v1beta1; + +/** + * + * + *
        + * A list of words.
        + * 
        + * + * Protobuf type {@code google.showcase.v1beta1.PagedExpandResponseList} + */ +@com.google.protobuf.Generated +public final class PagedExpandResponseList extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.PagedExpandResponseList) + PagedExpandResponseListOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "PagedExpandResponseList"); + } + + // Use PagedExpandResponseList.newBuilder() to construct. + private PagedExpandResponseList(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private PagedExpandResponseList() { + words_ = com.google.protobuf.LazyStringArrayList.emptyList(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.EchoOuterClass + .internal_static_google_showcase_v1beta1_PagedExpandResponseList_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.EchoOuterClass + .internal_static_google_showcase_v1beta1_PagedExpandResponseList_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.PagedExpandResponseList.class, + com.google.showcase.v1beta1.PagedExpandResponseList.Builder.class); + } + + public static final int WORDS_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private com.google.protobuf.LazyStringArrayList words_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + + /** + * repeated string words = 1; + * + * @return A list containing the words. + */ + public com.google.protobuf.ProtocolStringList getWordsList() { + return words_; + } + + /** + * repeated string words = 1; + * + * @return The count of words. + */ + public int getWordsCount() { + return words_.size(); + } + + /** + * repeated string words = 1; + * + * @param index The index of the element to return. + * @return The words at the given index. + */ + public java.lang.String getWords(int index) { + return words_.get(index); + } + + /** + * repeated string words = 1; + * + * @param index The index of the value to return. + * @return The bytes of the words at the given index. + */ + public com.google.protobuf.ByteString getWordsBytes(int index) { + return words_.getByteString(index); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + for (int i = 0; i < words_.size(); i++) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, words_.getRaw(i)); + } + 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 < words_.size(); i++) { + dataSize += computeStringSizeNoTag(words_.getRaw(i)); + } + size += dataSize; + size += 1 * getWordsList().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.showcase.v1beta1.PagedExpandResponseList)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.PagedExpandResponseList other = + (com.google.showcase.v1beta1.PagedExpandResponseList) obj; + + if (!getWordsList().equals(other.getWordsList())) 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 (getWordsCount() > 0) { + hash = (37 * hash) + WORDS_FIELD_NUMBER; + hash = (53 * hash) + getWordsList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.showcase.v1beta1.PagedExpandResponseList parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.PagedExpandResponseList parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.PagedExpandResponseList parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.PagedExpandResponseList 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.showcase.v1beta1.PagedExpandResponseList parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.PagedExpandResponseList parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.PagedExpandResponseList parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.PagedExpandResponseList parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.showcase.v1beta1.PagedExpandResponseList parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.PagedExpandResponseList parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.showcase.v1beta1.PagedExpandResponseList parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.PagedExpandResponseList parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.showcase.v1beta1.PagedExpandResponseList 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
        +   * A list of words.
        +   * 
        + * + * Protobuf type {@code google.showcase.v1beta1.PagedExpandResponseList} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.PagedExpandResponseList) + com.google.showcase.v1beta1.PagedExpandResponseListOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.EchoOuterClass + .internal_static_google_showcase_v1beta1_PagedExpandResponseList_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.EchoOuterClass + .internal_static_google_showcase_v1beta1_PagedExpandResponseList_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.PagedExpandResponseList.class, + com.google.showcase.v1beta1.PagedExpandResponseList.Builder.class); + } + + // Construct using com.google.showcase.v1beta1.PagedExpandResponseList.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + words_ = com.google.protobuf.LazyStringArrayList.emptyList(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.showcase.v1beta1.EchoOuterClass + .internal_static_google_showcase_v1beta1_PagedExpandResponseList_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.PagedExpandResponseList getDefaultInstanceForType() { + return com.google.showcase.v1beta1.PagedExpandResponseList.getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.PagedExpandResponseList build() { + com.google.showcase.v1beta1.PagedExpandResponseList result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.PagedExpandResponseList buildPartial() { + com.google.showcase.v1beta1.PagedExpandResponseList result = + new com.google.showcase.v1beta1.PagedExpandResponseList(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.showcase.v1beta1.PagedExpandResponseList result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + words_.makeImmutable(); + result.words_ = words_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.showcase.v1beta1.PagedExpandResponseList) { + return mergeFrom((com.google.showcase.v1beta1.PagedExpandResponseList) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.showcase.v1beta1.PagedExpandResponseList other) { + if (other == com.google.showcase.v1beta1.PagedExpandResponseList.getDefaultInstance()) + return this; + if (!other.words_.isEmpty()) { + if (words_.isEmpty()) { + words_ = other.words_; + bitField0_ |= 0x00000001; + } else { + ensureWordsIsMutable(); + words_.addAll(other.words_); + } + 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: + { + java.lang.String s = input.readStringRequireUtf8(); + ensureWordsIsMutable(); + words_.add(s); + 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 com.google.protobuf.LazyStringArrayList words_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + + private void ensureWordsIsMutable() { + if (!words_.isModifiable()) { + words_ = new com.google.protobuf.LazyStringArrayList(words_); + } + bitField0_ |= 0x00000001; + } + + /** + * repeated string words = 1; + * + * @return A list containing the words. + */ + public com.google.protobuf.ProtocolStringList getWordsList() { + words_.makeImmutable(); + return words_; + } + + /** + * repeated string words = 1; + * + * @return The count of words. + */ + public int getWordsCount() { + return words_.size(); + } + + /** + * repeated string words = 1; + * + * @param index The index of the element to return. + * @return The words at the given index. + */ + public java.lang.String getWords(int index) { + return words_.get(index); + } + + /** + * repeated string words = 1; + * + * @param index The index of the value to return. + * @return The bytes of the words at the given index. + */ + public com.google.protobuf.ByteString getWordsBytes(int index) { + return words_.getByteString(index); + } + + /** + * repeated string words = 1; + * + * @param index The index to set the value at. + * @param value The words to set. + * @return This builder for chaining. + */ + public Builder setWords(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureWordsIsMutable(); + words_.set(index, value); + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * repeated string words = 1; + * + * @param value The words to add. + * @return This builder for chaining. + */ + public Builder addWords(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureWordsIsMutable(); + words_.add(value); + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * repeated string words = 1; + * + * @param values The words to add. + * @return This builder for chaining. + */ + public Builder addAllWords(java.lang.Iterable values) { + ensureWordsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, words_); + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * repeated string words = 1; + * + * @return This builder for chaining. + */ + public Builder clearWords() { + words_ = com.google.protobuf.LazyStringArrayList.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + ; + onChanged(); + return this; + } + + /** + * repeated string words = 1; + * + * @param value The bytes of the words to add. + * @return This builder for chaining. + */ + public Builder addWordsBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureWordsIsMutable(); + words_.add(value); + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.showcase.v1beta1.PagedExpandResponseList) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.PagedExpandResponseList) + private static final com.google.showcase.v1beta1.PagedExpandResponseList DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.PagedExpandResponseList(); + } + + public static com.google.showcase.v1beta1.PagedExpandResponseList getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public PagedExpandResponseList 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.showcase.v1beta1.PagedExpandResponseList getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/PagedExpandResponseListOrBuilder.java b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/PagedExpandResponseListOrBuilder.java new file mode 100644 index 0000000000..5fcc5e6581 --- /dev/null +++ b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/PagedExpandResponseListOrBuilder.java @@ -0,0 +1,58 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: schema/google/showcase/v1beta1/echo.proto +// Protobuf Java Version: 4.33.2 + +package com.google.showcase.v1beta1; + +@com.google.protobuf.Generated +public interface PagedExpandResponseListOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.PagedExpandResponseList) + com.google.protobuf.MessageOrBuilder { + + /** + * repeated string words = 1; + * + * @return A list containing the words. + */ + java.util.List getWordsList(); + + /** + * repeated string words = 1; + * + * @return The count of words. + */ + int getWordsCount(); + + /** + * repeated string words = 1; + * + * @param index The index of the element to return. + * @return The words at the given index. + */ + java.lang.String getWords(int index); + + /** + * repeated string words = 1; + * + * @param index The index of the value to return. + * @return The bytes of the words at the given index. + */ + com.google.protobuf.ByteString getWordsBytes(int index); +} diff --git a/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/PagedExpandResponseOrBuilder.java b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/PagedExpandResponseOrBuilder.java new file mode 100644 index 0000000000..cb355a01b4 --- /dev/null +++ b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/PagedExpandResponseOrBuilder.java @@ -0,0 +1,110 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: schema/google/showcase/v1beta1/echo.proto +// Protobuf Java Version: 4.33.2 + +package com.google.showcase.v1beta1; + +@com.google.protobuf.Generated +public interface PagedExpandResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.PagedExpandResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
        +   * The words that were expanded.
        +   * 
        + * + * repeated .google.showcase.v1beta1.EchoResponse responses = 1; + */ + java.util.List getResponsesList(); + + /** + * + * + *
        +   * The words that were expanded.
        +   * 
        + * + * repeated .google.showcase.v1beta1.EchoResponse responses = 1; + */ + com.google.showcase.v1beta1.EchoResponse getResponses(int index); + + /** + * + * + *
        +   * The words that were expanded.
        +   * 
        + * + * repeated .google.showcase.v1beta1.EchoResponse responses = 1; + */ + int getResponsesCount(); + + /** + * + * + *
        +   * The words that were expanded.
        +   * 
        + * + * repeated .google.showcase.v1beta1.EchoResponse responses = 1; + */ + java.util.List + getResponsesOrBuilderList(); + + /** + * + * + *
        +   * The words that were expanded.
        +   * 
        + * + * repeated .google.showcase.v1beta1.EchoResponse responses = 1; + */ + com.google.showcase.v1beta1.EchoResponseOrBuilder getResponsesOrBuilder(int index); + + /** + * + * + *
        +   * The next page token.
        +   * 
        + * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + java.lang.String getNextPageToken(); + + /** + * + * + *
        +   * The next page token.
        +   * 
        + * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + com.google.protobuf.ByteString getNextPageTokenBytes(); +} diff --git a/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/PoetryError.java b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/PoetryError.java new file mode 100644 index 0000000000..2479e82726 --- /dev/null +++ b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/PoetryError.java @@ -0,0 +1,556 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: schema/google/showcase/v1beta1/echo.proto +// Protobuf Java Version: 4.33.2 + +package com.google.showcase.v1beta1; + +/** + * + * + *
        + * The custom error detail to be included in the error response from the
        + * FailEchoWithDetails method. Client libraries should be able to
        + * surface this custom error detail.
        + * 
        + * + * Protobuf type {@code google.showcase.v1beta1.PoetryError} + */ +@com.google.protobuf.Generated +public final class PoetryError extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.PoetryError) + PoetryErrorOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "PoetryError"); + } + + // Use PoetryError.newBuilder() to construct. + private PoetryError(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private PoetryError() { + poem_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.EchoOuterClass + .internal_static_google_showcase_v1beta1_PoetryError_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.EchoOuterClass + .internal_static_google_showcase_v1beta1_PoetryError_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.PoetryError.class, + com.google.showcase.v1beta1.PoetryError.Builder.class); + } + + public static final int POEM_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object poem_ = ""; + + /** + * string poem = 1; + * + * @return The poem. + */ + @java.lang.Override + public java.lang.String getPoem() { + java.lang.Object ref = poem_; + 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(); + poem_ = s; + return s; + } + } + + /** + * string poem = 1; + * + * @return The bytes for poem. + */ + @java.lang.Override + public com.google.protobuf.ByteString getPoemBytes() { + java.lang.Object ref = poem_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + poem_ = 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.GeneratedMessage.isStringEmpty(poem_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, poem_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(poem_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, poem_); + } + 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.showcase.v1beta1.PoetryError)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.PoetryError other = (com.google.showcase.v1beta1.PoetryError) obj; + + if (!getPoem().equals(other.getPoem())) 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) + POEM_FIELD_NUMBER; + hash = (53 * hash) + getPoem().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.showcase.v1beta1.PoetryError parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.PoetryError parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.PoetryError parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.PoetryError 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.showcase.v1beta1.PoetryError parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.PoetryError parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.PoetryError parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.PoetryError parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.showcase.v1beta1.PoetryError parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.PoetryError parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.showcase.v1beta1.PoetryError parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.PoetryError parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.showcase.v1beta1.PoetryError 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
        +   * The custom error detail to be included in the error response from the
        +   * FailEchoWithDetails method. Client libraries should be able to
        +   * surface this custom error detail.
        +   * 
        + * + * Protobuf type {@code google.showcase.v1beta1.PoetryError} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.PoetryError) + com.google.showcase.v1beta1.PoetryErrorOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.EchoOuterClass + .internal_static_google_showcase_v1beta1_PoetryError_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.EchoOuterClass + .internal_static_google_showcase_v1beta1_PoetryError_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.PoetryError.class, + com.google.showcase.v1beta1.PoetryError.Builder.class); + } + + // Construct using com.google.showcase.v1beta1.PoetryError.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + poem_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.showcase.v1beta1.EchoOuterClass + .internal_static_google_showcase_v1beta1_PoetryError_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.PoetryError getDefaultInstanceForType() { + return com.google.showcase.v1beta1.PoetryError.getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.PoetryError build() { + com.google.showcase.v1beta1.PoetryError result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.PoetryError buildPartial() { + com.google.showcase.v1beta1.PoetryError result = + new com.google.showcase.v1beta1.PoetryError(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.showcase.v1beta1.PoetryError result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.poem_ = poem_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.showcase.v1beta1.PoetryError) { + return mergeFrom((com.google.showcase.v1beta1.PoetryError) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.showcase.v1beta1.PoetryError other) { + if (other == com.google.showcase.v1beta1.PoetryError.getDefaultInstance()) return this; + if (!other.getPoem().isEmpty()) { + poem_ = other.poem_; + 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: + { + poem_ = 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 poem_ = ""; + + /** + * string poem = 1; + * + * @return The poem. + */ + public java.lang.String getPoem() { + java.lang.Object ref = poem_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + poem_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * string poem = 1; + * + * @return The bytes for poem. + */ + public com.google.protobuf.ByteString getPoemBytes() { + java.lang.Object ref = poem_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + poem_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * string poem = 1; + * + * @param value The poem to set. + * @return This builder for chaining. + */ + public Builder setPoem(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + poem_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * string poem = 1; + * + * @return This builder for chaining. + */ + public Builder clearPoem() { + poem_ = getDefaultInstance().getPoem(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * string poem = 1; + * + * @param value The bytes for poem to set. + * @return This builder for chaining. + */ + public Builder setPoemBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + poem_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.showcase.v1beta1.PoetryError) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.PoetryError) + private static final com.google.showcase.v1beta1.PoetryError DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.PoetryError(); + } + + public static com.google.showcase.v1beta1.PoetryError getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public PoetryError 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.showcase.v1beta1.PoetryError getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/PoetryErrorOrBuilder.java b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/PoetryErrorOrBuilder.java new file mode 100644 index 0000000000..c484fc80b1 --- /dev/null +++ b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/PoetryErrorOrBuilder.java @@ -0,0 +1,42 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: schema/google/showcase/v1beta1/echo.proto +// Protobuf Java Version: 4.33.2 + +package com.google.showcase.v1beta1; + +@com.google.protobuf.Generated +public interface PoetryErrorOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.PoetryError) + com.google.protobuf.MessageOrBuilder { + + /** + * string poem = 1; + * + * @return The poem. + */ + java.lang.String getPoem(); + + /** + * string poem = 1; + * + * @return The bytes for poem. + */ + com.google.protobuf.ByteString getPoemBytes(); +} diff --git a/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ProfileName.java b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ProfileName.java new file mode 100644 index 0000000000..1a76331959 --- /dev/null +++ b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ProfileName.java @@ -0,0 +1,168 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1; + +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +@Generated("by gapic-generator-java") +public class ProfileName implements ResourceName { + private static final PathTemplate USER = + PathTemplate.createWithoutUrlEncoding("users/{user}/profile/blurbs"); + private volatile Map fieldValuesMap; + private final String user; + + @Deprecated + protected ProfileName() { + user = null; + } + + private ProfileName(Builder builder) { + user = Preconditions.checkNotNull(builder.getUser()); + } + + public String getUser() { + return user; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + public static ProfileName of(String user) { + return newBuilder().setUser(user).build(); + } + + public static String format(String user) { + return newBuilder().setUser(user).build().toString(); + } + + public static ProfileName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + USER.validatedMatch( + formattedString, "ProfileName.parse: formattedString not in valid format"); + return of(matchMap.get("user")); + } + + 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 (ProfileName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return USER.matches(formattedString); + } + + @Override + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + if (user != null) { + fieldMapBuilder.put("user", user); + } + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return USER.instantiate("user", user); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o != null && getClass() == o.getClass()) { + ProfileName that = ((ProfileName) o); + return Objects.equals(this.user, that.user); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= Objects.hashCode(user); + return h; + } + + /** Builder for users/{user}/profile/blurbs. */ + public static class Builder { + private String user; + + protected Builder() {} + + public String getUser() { + return user; + } + + public Builder setUser(String user) { + this.user = user; + return this; + } + + private Builder(ProfileName profileName) { + this.user = profileName.user; + } + + public ProfileName build() { + return new ProfileName(this); + } + } +} diff --git a/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/RepeatRequest.java b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/RepeatRequest.java new file mode 100644 index 0000000000..d330d3e74f --- /dev/null +++ b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/RepeatRequest.java @@ -0,0 +1,1615 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: schema/google/showcase/v1beta1/compliance.proto +// Protobuf Java Version: 4.33.2 + +package com.google.showcase.v1beta1; + +/** Protobuf type {@code google.showcase.v1beta1.RepeatRequest} */ +@com.google.protobuf.Generated +public final class RepeatRequest extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.RepeatRequest) + RepeatRequestOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "RepeatRequest"); + } + + // Use RepeatRequest.newBuilder() to construct. + private RepeatRequest(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private RepeatRequest() { + name_ = ""; + intendedBindingUri_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.ComplianceOuterClass + .internal_static_google_showcase_v1beta1_RepeatRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.ComplianceOuterClass + .internal_static_google_showcase_v1beta1_RepeatRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.RepeatRequest.class, + com.google.showcase.v1beta1.RepeatRequest.Builder.class); + } + + private int bitField0_; + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + + /** + * 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; + } + } + + /** + * 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 INFO_FIELD_NUMBER = 2; + private com.google.showcase.v1beta1.ComplianceData info_; + + /** + * .google.showcase.v1beta1.ComplianceData info = 2; + * + * @return Whether the info field is set. + */ + @java.lang.Override + public boolean hasInfo() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * .google.showcase.v1beta1.ComplianceData info = 2; + * + * @return The info. + */ + @java.lang.Override + public com.google.showcase.v1beta1.ComplianceData getInfo() { + return info_ == null ? com.google.showcase.v1beta1.ComplianceData.getDefaultInstance() : info_; + } + + /** .google.showcase.v1beta1.ComplianceData info = 2; */ + @java.lang.Override + public com.google.showcase.v1beta1.ComplianceDataOrBuilder getInfoOrBuilder() { + return info_ == null ? com.google.showcase.v1beta1.ComplianceData.getDefaultInstance() : info_; + } + + public static final int SERVER_VERIFY_FIELD_NUMBER = 3; + private boolean serverVerify_ = false; + + /** + * + * + *
        +   * If true, the server will verify that the received request matches
        +   * the request with the same name in the compliance test suite.
        +   * 
        + * + * bool server_verify = 3; + * + * @return The serverVerify. + */ + @java.lang.Override + public boolean getServerVerify() { + return serverVerify_; + } + + public static final int INTENDED_BINDING_URI_FIELD_NUMBER = 10; + + @SuppressWarnings("serial") + private volatile java.lang.Object intendedBindingUri_ = ""; + + /** + * + * + *
        +   * The URI template this request is expected to be bound to server-side.
        +   * 
        + * + * optional string intended_binding_uri = 10; + * + * @return Whether the intendedBindingUri field is set. + */ + @java.lang.Override + public boolean hasIntendedBindingUri() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
        +   * The URI template this request is expected to be bound to server-side.
        +   * 
        + * + * optional string intended_binding_uri = 10; + * + * @return The intendedBindingUri. + */ + @java.lang.Override + public java.lang.String getIntendedBindingUri() { + java.lang.Object ref = intendedBindingUri_; + 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(); + intendedBindingUri_ = s; + return s; + } + } + + /** + * + * + *
        +   * The URI template this request is expected to be bound to server-side.
        +   * 
        + * + * optional string intended_binding_uri = 10; + * + * @return The bytes for intendedBindingUri. + */ + @java.lang.Override + public com.google.protobuf.ByteString getIntendedBindingUriBytes() { + java.lang.Object ref = intendedBindingUri_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + intendedBindingUri_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int F_INT32_FIELD_NUMBER = 4; + private int fInt32_ = 0; + + /** + * + * + *
        +   * Some top level fields, to test that these are encoded correctly
        +   * in query params.
        +   * 
        + * + * int32 f_int32 = 4; + * + * @return The fInt32. + */ + @java.lang.Override + public int getFInt32() { + return fInt32_; + } + + public static final int F_INT64_FIELD_NUMBER = 5; + private long fInt64_ = 0L; + + /** + * int64 f_int64 = 5; + * + * @return The fInt64. + */ + @java.lang.Override + public long getFInt64() { + return fInt64_; + } + + public static final int F_DOUBLE_FIELD_NUMBER = 6; + private double fDouble_ = 0D; + + /** + * double f_double = 6; + * + * @return The fDouble. + */ + @java.lang.Override + public double getFDouble() { + return fDouble_; + } + + public static final int P_INT32_FIELD_NUMBER = 7; + private int pInt32_ = 0; + + /** + * optional int32 p_int32 = 7; + * + * @return Whether the pInt32 field is set. + */ + @java.lang.Override + public boolean hasPInt32() { + return ((bitField0_ & 0x00000004) != 0); + } + + /** + * optional int32 p_int32 = 7; + * + * @return The pInt32. + */ + @java.lang.Override + public int getPInt32() { + return pInt32_; + } + + public static final int P_INT64_FIELD_NUMBER = 8; + private long pInt64_ = 0L; + + /** + * optional int64 p_int64 = 8; + * + * @return Whether the pInt64 field is set. + */ + @java.lang.Override + public boolean hasPInt64() { + return ((bitField0_ & 0x00000008) != 0); + } + + /** + * optional int64 p_int64 = 8; + * + * @return The pInt64. + */ + @java.lang.Override + public long getPInt64() { + return pInt64_; + } + + public static final int P_DOUBLE_FIELD_NUMBER = 9; + private double pDouble_ = 0D; + + /** + * optional double p_double = 9; + * + * @return Whether the pDouble field is set. + */ + @java.lang.Override + public boolean hasPDouble() { + return ((bitField0_ & 0x00000010) != 0); + } + + /** + * optional double p_double = 9; + * + * @return The pDouble. + */ + @java.lang.Override + public double getPDouble() { + return pDouble_; + } + + 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.GeneratedMessage.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, name_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(2, getInfo()); + } + if (serverVerify_ != false) { + output.writeBool(3, serverVerify_); + } + if (fInt32_ != 0) { + output.writeInt32(4, fInt32_); + } + if (fInt64_ != 0L) { + output.writeInt64(5, fInt64_); + } + if (java.lang.Double.doubleToRawLongBits(fDouble_) != 0) { + output.writeDouble(6, fDouble_); + } + if (((bitField0_ & 0x00000004) != 0)) { + output.writeInt32(7, pInt32_); + } + if (((bitField0_ & 0x00000008) != 0)) { + output.writeInt64(8, pInt64_); + } + if (((bitField0_ & 0x00000010) != 0)) { + output.writeDouble(9, pDouble_); + } + if (((bitField0_ & 0x00000002) != 0)) { + com.google.protobuf.GeneratedMessage.writeString(output, 10, intendedBindingUri_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, name_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getInfo()); + } + if (serverVerify_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(3, serverVerify_); + } + if (fInt32_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(4, fInt32_); + } + if (fInt64_ != 0L) { + size += com.google.protobuf.CodedOutputStream.computeInt64Size(5, fInt64_); + } + if (java.lang.Double.doubleToRawLongBits(fDouble_) != 0) { + size += com.google.protobuf.CodedOutputStream.computeDoubleSize(6, fDouble_); + } + if (((bitField0_ & 0x00000004) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(7, pInt32_); + } + if (((bitField0_ & 0x00000008) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeInt64Size(8, pInt64_); + } + if (((bitField0_ & 0x00000010) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeDoubleSize(9, pDouble_); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(10, intendedBindingUri_); + } + 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.showcase.v1beta1.RepeatRequest)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.RepeatRequest other = + (com.google.showcase.v1beta1.RepeatRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (hasInfo() != other.hasInfo()) return false; + if (hasInfo()) { + if (!getInfo().equals(other.getInfo())) return false; + } + if (getServerVerify() != other.getServerVerify()) return false; + if (hasIntendedBindingUri() != other.hasIntendedBindingUri()) return false; + if (hasIntendedBindingUri()) { + if (!getIntendedBindingUri().equals(other.getIntendedBindingUri())) return false; + } + if (getFInt32() != other.getFInt32()) return false; + if (getFInt64() != other.getFInt64()) return false; + if (java.lang.Double.doubleToLongBits(getFDouble()) + != java.lang.Double.doubleToLongBits(other.getFDouble())) return false; + if (hasPInt32() != other.hasPInt32()) return false; + if (hasPInt32()) { + if (getPInt32() != other.getPInt32()) return false; + } + if (hasPInt64() != other.hasPInt64()) return false; + if (hasPInt64()) { + if (getPInt64() != other.getPInt64()) return false; + } + if (hasPDouble() != other.hasPDouble()) return false; + if (hasPDouble()) { + if (java.lang.Double.doubleToLongBits(getPDouble()) + != java.lang.Double.doubleToLongBits(other.getPDouble())) 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 (hasInfo()) { + hash = (37 * hash) + INFO_FIELD_NUMBER; + hash = (53 * hash) + getInfo().hashCode(); + } + hash = (37 * hash) + SERVER_VERIFY_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getServerVerify()); + if (hasIntendedBindingUri()) { + hash = (37 * hash) + INTENDED_BINDING_URI_FIELD_NUMBER; + hash = (53 * hash) + getIntendedBindingUri().hashCode(); + } + hash = (37 * hash) + F_INT32_FIELD_NUMBER; + hash = (53 * hash) + getFInt32(); + hash = (37 * hash) + F_INT64_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getFInt64()); + hash = (37 * hash) + F_DOUBLE_FIELD_NUMBER; + hash = + (53 * hash) + + com.google.protobuf.Internal.hashLong( + java.lang.Double.doubleToLongBits(getFDouble())); + if (hasPInt32()) { + hash = (37 * hash) + P_INT32_FIELD_NUMBER; + hash = (53 * hash) + getPInt32(); + } + if (hasPInt64()) { + hash = (37 * hash) + P_INT64_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getPInt64()); + } + if (hasPDouble()) { + hash = (37 * hash) + P_DOUBLE_FIELD_NUMBER; + hash = + (53 * hash) + + com.google.protobuf.Internal.hashLong( + java.lang.Double.doubleToLongBits(getPDouble())); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.showcase.v1beta1.RepeatRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.RepeatRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.RepeatRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.RepeatRequest 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.showcase.v1beta1.RepeatRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.RepeatRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.RepeatRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.RepeatRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.showcase.v1beta1.RepeatRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.RepeatRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.showcase.v1beta1.RepeatRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.RepeatRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.showcase.v1beta1.RepeatRequest 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** Protobuf type {@code google.showcase.v1beta1.RepeatRequest} */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.RepeatRequest) + com.google.showcase.v1beta1.RepeatRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.ComplianceOuterClass + .internal_static_google_showcase_v1beta1_RepeatRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.ComplianceOuterClass + .internal_static_google_showcase_v1beta1_RepeatRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.RepeatRequest.class, + com.google.showcase.v1beta1.RepeatRequest.Builder.class); + } + + // Construct using com.google.showcase.v1beta1.RepeatRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetInfoFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + info_ = null; + if (infoBuilder_ != null) { + infoBuilder_.dispose(); + infoBuilder_ = null; + } + serverVerify_ = false; + intendedBindingUri_ = ""; + fInt32_ = 0; + fInt64_ = 0L; + fDouble_ = 0D; + pInt32_ = 0; + pInt64_ = 0L; + pDouble_ = 0D; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.showcase.v1beta1.ComplianceOuterClass + .internal_static_google_showcase_v1beta1_RepeatRequest_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.RepeatRequest getDefaultInstanceForType() { + return com.google.showcase.v1beta1.RepeatRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.RepeatRequest build() { + com.google.showcase.v1beta1.RepeatRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.RepeatRequest buildPartial() { + com.google.showcase.v1beta1.RepeatRequest result = + new com.google.showcase.v1beta1.RepeatRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.showcase.v1beta1.RepeatRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.info_ = infoBuilder_ == null ? info_ : infoBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.serverVerify_ = serverVerify_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.intendedBindingUri_ = intendedBindingUri_; + to_bitField0_ |= 0x00000002; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.fInt32_ = fInt32_; + } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.fInt64_ = fInt64_; + } + if (((from_bitField0_ & 0x00000040) != 0)) { + result.fDouble_ = fDouble_; + } + if (((from_bitField0_ & 0x00000080) != 0)) { + result.pInt32_ = pInt32_; + to_bitField0_ |= 0x00000004; + } + if (((from_bitField0_ & 0x00000100) != 0)) { + result.pInt64_ = pInt64_; + to_bitField0_ |= 0x00000008; + } + if (((from_bitField0_ & 0x00000200) != 0)) { + result.pDouble_ = pDouble_; + to_bitField0_ |= 0x00000010; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.showcase.v1beta1.RepeatRequest) { + return mergeFrom((com.google.showcase.v1beta1.RepeatRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.showcase.v1beta1.RepeatRequest other) { + if (other == com.google.showcase.v1beta1.RepeatRequest.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.hasInfo()) { + mergeInfo(other.getInfo()); + } + if (other.getServerVerify() != false) { + setServerVerify(other.getServerVerify()); + } + if (other.hasIntendedBindingUri()) { + intendedBindingUri_ = other.intendedBindingUri_; + bitField0_ |= 0x00000008; + onChanged(); + } + if (other.getFInt32() != 0) { + setFInt32(other.getFInt32()); + } + if (other.getFInt64() != 0L) { + setFInt64(other.getFInt64()); + } + if (java.lang.Double.doubleToRawLongBits(other.getFDouble()) != 0) { + setFDouble(other.getFDouble()); + } + if (other.hasPInt32()) { + setPInt32(other.getPInt32()); + } + if (other.hasPInt64()) { + setPInt64(other.getPInt64()); + } + if (other.hasPDouble()) { + setPDouble(other.getPDouble()); + } + 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(internalGetInfoFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 24: + { + serverVerify_ = input.readBool(); + bitField0_ |= 0x00000004; + break; + } // case 24 + case 32: + { + fInt32_ = input.readInt32(); + bitField0_ |= 0x00000010; + break; + } // case 32 + case 40: + { + fInt64_ = input.readInt64(); + bitField0_ |= 0x00000020; + break; + } // case 40 + case 49: + { + fDouble_ = input.readDouble(); + bitField0_ |= 0x00000040; + break; + } // case 49 + case 56: + { + pInt32_ = input.readInt32(); + bitField0_ |= 0x00000080; + break; + } // case 56 + case 64: + { + pInt64_ = input.readInt64(); + bitField0_ |= 0x00000100; + break; + } // case 64 + case 73: + { + pDouble_ = input.readDouble(); + bitField0_ |= 0x00000200; + break; + } // case 73 + case 82: + { + intendedBindingUri_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000008; + break; + } // case 82 + 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_ = ""; + + /** + * 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; + } + } + + /** + * 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; + } + } + + /** + * 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; + } + + /** + * string name = 1; + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * 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 com.google.showcase.v1beta1.ComplianceData info_; + private com.google.protobuf.SingleFieldBuilder< + com.google.showcase.v1beta1.ComplianceData, + com.google.showcase.v1beta1.ComplianceData.Builder, + com.google.showcase.v1beta1.ComplianceDataOrBuilder> + infoBuilder_; + + /** + * .google.showcase.v1beta1.ComplianceData info = 2; + * + * @return Whether the info field is set. + */ + public boolean hasInfo() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * .google.showcase.v1beta1.ComplianceData info = 2; + * + * @return The info. + */ + public com.google.showcase.v1beta1.ComplianceData getInfo() { + if (infoBuilder_ == null) { + return info_ == null + ? com.google.showcase.v1beta1.ComplianceData.getDefaultInstance() + : info_; + } else { + return infoBuilder_.getMessage(); + } + } + + /** .google.showcase.v1beta1.ComplianceData info = 2; */ + public Builder setInfo(com.google.showcase.v1beta1.ComplianceData value) { + if (infoBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + info_ = value; + } else { + infoBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** .google.showcase.v1beta1.ComplianceData info = 2; */ + public Builder setInfo(com.google.showcase.v1beta1.ComplianceData.Builder builderForValue) { + if (infoBuilder_ == null) { + info_ = builderForValue.build(); + } else { + infoBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** .google.showcase.v1beta1.ComplianceData info = 2; */ + public Builder mergeInfo(com.google.showcase.v1beta1.ComplianceData value) { + if (infoBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && info_ != null + && info_ != com.google.showcase.v1beta1.ComplianceData.getDefaultInstance()) { + getInfoBuilder().mergeFrom(value); + } else { + info_ = value; + } + } else { + infoBuilder_.mergeFrom(value); + } + if (info_ != null) { + bitField0_ |= 0x00000002; + onChanged(); + } + return this; + } + + /** .google.showcase.v1beta1.ComplianceData info = 2; */ + public Builder clearInfo() { + bitField0_ = (bitField0_ & ~0x00000002); + info_ = null; + if (infoBuilder_ != null) { + infoBuilder_.dispose(); + infoBuilder_ = null; + } + onChanged(); + return this; + } + + /** .google.showcase.v1beta1.ComplianceData info = 2; */ + public com.google.showcase.v1beta1.ComplianceData.Builder getInfoBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return internalGetInfoFieldBuilder().getBuilder(); + } + + /** .google.showcase.v1beta1.ComplianceData info = 2; */ + public com.google.showcase.v1beta1.ComplianceDataOrBuilder getInfoOrBuilder() { + if (infoBuilder_ != null) { + return infoBuilder_.getMessageOrBuilder(); + } else { + return info_ == null + ? com.google.showcase.v1beta1.ComplianceData.getDefaultInstance() + : info_; + } + } + + /** .google.showcase.v1beta1.ComplianceData info = 2; */ + private com.google.protobuf.SingleFieldBuilder< + com.google.showcase.v1beta1.ComplianceData, + com.google.showcase.v1beta1.ComplianceData.Builder, + com.google.showcase.v1beta1.ComplianceDataOrBuilder> + internalGetInfoFieldBuilder() { + if (infoBuilder_ == null) { + infoBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.showcase.v1beta1.ComplianceData, + com.google.showcase.v1beta1.ComplianceData.Builder, + com.google.showcase.v1beta1.ComplianceDataOrBuilder>( + getInfo(), getParentForChildren(), isClean()); + info_ = null; + } + return infoBuilder_; + } + + private boolean serverVerify_; + + /** + * + * + *
        +     * If true, the server will verify that the received request matches
        +     * the request with the same name in the compliance test suite.
        +     * 
        + * + * bool server_verify = 3; + * + * @return The serverVerify. + */ + @java.lang.Override + public boolean getServerVerify() { + return serverVerify_; + } + + /** + * + * + *
        +     * If true, the server will verify that the received request matches
        +     * the request with the same name in the compliance test suite.
        +     * 
        + * + * bool server_verify = 3; + * + * @param value The serverVerify to set. + * @return This builder for chaining. + */ + public Builder setServerVerify(boolean value) { + + serverVerify_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
        +     * If true, the server will verify that the received request matches
        +     * the request with the same name in the compliance test suite.
        +     * 
        + * + * bool server_verify = 3; + * + * @return This builder for chaining. + */ + public Builder clearServerVerify() { + bitField0_ = (bitField0_ & ~0x00000004); + serverVerify_ = false; + onChanged(); + return this; + } + + private java.lang.Object intendedBindingUri_ = ""; + + /** + * + * + *
        +     * The URI template this request is expected to be bound to server-side.
        +     * 
        + * + * optional string intended_binding_uri = 10; + * + * @return Whether the intendedBindingUri field is set. + */ + public boolean hasIntendedBindingUri() { + return ((bitField0_ & 0x00000008) != 0); + } + + /** + * + * + *
        +     * The URI template this request is expected to be bound to server-side.
        +     * 
        + * + * optional string intended_binding_uri = 10; + * + * @return The intendedBindingUri. + */ + public java.lang.String getIntendedBindingUri() { + java.lang.Object ref = intendedBindingUri_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + intendedBindingUri_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
        +     * The URI template this request is expected to be bound to server-side.
        +     * 
        + * + * optional string intended_binding_uri = 10; + * + * @return The bytes for intendedBindingUri. + */ + public com.google.protobuf.ByteString getIntendedBindingUriBytes() { + java.lang.Object ref = intendedBindingUri_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + intendedBindingUri_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
        +     * The URI template this request is expected to be bound to server-side.
        +     * 
        + * + * optional string intended_binding_uri = 10; + * + * @param value The intendedBindingUri to set. + * @return This builder for chaining. + */ + public Builder setIntendedBindingUri(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + intendedBindingUri_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + /** + * + * + *
        +     * The URI template this request is expected to be bound to server-side.
        +     * 
        + * + * optional string intended_binding_uri = 10; + * + * @return This builder for chaining. + */ + public Builder clearIntendedBindingUri() { + intendedBindingUri_ = getDefaultInstance().getIntendedBindingUri(); + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + return this; + } + + /** + * + * + *
        +     * The URI template this request is expected to be bound to server-side.
        +     * 
        + * + * optional string intended_binding_uri = 10; + * + * @param value The bytes for intendedBindingUri to set. + * @return This builder for chaining. + */ + public Builder setIntendedBindingUriBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + intendedBindingUri_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + private int fInt32_; + + /** + * + * + *
        +     * Some top level fields, to test that these are encoded correctly
        +     * in query params.
        +     * 
        + * + * int32 f_int32 = 4; + * + * @return The fInt32. + */ + @java.lang.Override + public int getFInt32() { + return fInt32_; + } + + /** + * + * + *
        +     * Some top level fields, to test that these are encoded correctly
        +     * in query params.
        +     * 
        + * + * int32 f_int32 = 4; + * + * @param value The fInt32 to set. + * @return This builder for chaining. + */ + public Builder setFInt32(int value) { + + fInt32_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + /** + * + * + *
        +     * Some top level fields, to test that these are encoded correctly
        +     * in query params.
        +     * 
        + * + * int32 f_int32 = 4; + * + * @return This builder for chaining. + */ + public Builder clearFInt32() { + bitField0_ = (bitField0_ & ~0x00000010); + fInt32_ = 0; + onChanged(); + return this; + } + + private long fInt64_; + + /** + * int64 f_int64 = 5; + * + * @return The fInt64. + */ + @java.lang.Override + public long getFInt64() { + return fInt64_; + } + + /** + * int64 f_int64 = 5; + * + * @param value The fInt64 to set. + * @return This builder for chaining. + */ + public Builder setFInt64(long value) { + + fInt64_ = value; + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + + /** + * int64 f_int64 = 5; + * + * @return This builder for chaining. + */ + public Builder clearFInt64() { + bitField0_ = (bitField0_ & ~0x00000020); + fInt64_ = 0L; + onChanged(); + return this; + } + + private double fDouble_; + + /** + * double f_double = 6; + * + * @return The fDouble. + */ + @java.lang.Override + public double getFDouble() { + return fDouble_; + } + + /** + * double f_double = 6; + * + * @param value The fDouble to set. + * @return This builder for chaining. + */ + public Builder setFDouble(double value) { + + fDouble_ = value; + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + + /** + * double f_double = 6; + * + * @return This builder for chaining. + */ + public Builder clearFDouble() { + bitField0_ = (bitField0_ & ~0x00000040); + fDouble_ = 0D; + onChanged(); + return this; + } + + private int pInt32_; + + /** + * optional int32 p_int32 = 7; + * + * @return Whether the pInt32 field is set. + */ + @java.lang.Override + public boolean hasPInt32() { + return ((bitField0_ & 0x00000080) != 0); + } + + /** + * optional int32 p_int32 = 7; + * + * @return The pInt32. + */ + @java.lang.Override + public int getPInt32() { + return pInt32_; + } + + /** + * optional int32 p_int32 = 7; + * + * @param value The pInt32 to set. + * @return This builder for chaining. + */ + public Builder setPInt32(int value) { + + pInt32_ = value; + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + + /** + * optional int32 p_int32 = 7; + * + * @return This builder for chaining. + */ + public Builder clearPInt32() { + bitField0_ = (bitField0_ & ~0x00000080); + pInt32_ = 0; + onChanged(); + return this; + } + + private long pInt64_; + + /** + * optional int64 p_int64 = 8; + * + * @return Whether the pInt64 field is set. + */ + @java.lang.Override + public boolean hasPInt64() { + return ((bitField0_ & 0x00000100) != 0); + } + + /** + * optional int64 p_int64 = 8; + * + * @return The pInt64. + */ + @java.lang.Override + public long getPInt64() { + return pInt64_; + } + + /** + * optional int64 p_int64 = 8; + * + * @param value The pInt64 to set. + * @return This builder for chaining. + */ + public Builder setPInt64(long value) { + + pInt64_ = value; + bitField0_ |= 0x00000100; + onChanged(); + return this; + } + + /** + * optional int64 p_int64 = 8; + * + * @return This builder for chaining. + */ + public Builder clearPInt64() { + bitField0_ = (bitField0_ & ~0x00000100); + pInt64_ = 0L; + onChanged(); + return this; + } + + private double pDouble_; + + /** + * optional double p_double = 9; + * + * @return Whether the pDouble field is set. + */ + @java.lang.Override + public boolean hasPDouble() { + return ((bitField0_ & 0x00000200) != 0); + } + + /** + * optional double p_double = 9; + * + * @return The pDouble. + */ + @java.lang.Override + public double getPDouble() { + return pDouble_; + } + + /** + * optional double p_double = 9; + * + * @param value The pDouble to set. + * @return This builder for chaining. + */ + public Builder setPDouble(double value) { + + pDouble_ = value; + bitField0_ |= 0x00000200; + onChanged(); + return this; + } + + /** + * optional double p_double = 9; + * + * @return This builder for chaining. + */ + public Builder clearPDouble() { + bitField0_ = (bitField0_ & ~0x00000200); + pDouble_ = 0D; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.showcase.v1beta1.RepeatRequest) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.RepeatRequest) + private static final com.google.showcase.v1beta1.RepeatRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.RepeatRequest(); + } + + public static com.google.showcase.v1beta1.RepeatRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public RepeatRequest 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.showcase.v1beta1.RepeatRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/RepeatRequestOrBuilder.java b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/RepeatRequestOrBuilder.java new file mode 100644 index 0000000000..e15bc2a152 --- /dev/null +++ b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/RepeatRequestOrBuilder.java @@ -0,0 +1,182 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: schema/google/showcase/v1beta1/compliance.proto +// Protobuf Java Version: 4.33.2 + +package com.google.showcase.v1beta1; + +@com.google.protobuf.Generated +public interface RepeatRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.RepeatRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * string name = 1; + * + * @return The name. + */ + java.lang.String getName(); + + /** + * string name = 1; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * .google.showcase.v1beta1.ComplianceData info = 2; + * + * @return Whether the info field is set. + */ + boolean hasInfo(); + + /** + * .google.showcase.v1beta1.ComplianceData info = 2; + * + * @return The info. + */ + com.google.showcase.v1beta1.ComplianceData getInfo(); + + /** .google.showcase.v1beta1.ComplianceData info = 2; */ + com.google.showcase.v1beta1.ComplianceDataOrBuilder getInfoOrBuilder(); + + /** + * + * + *
        +   * If true, the server will verify that the received request matches
        +   * the request with the same name in the compliance test suite.
        +   * 
        + * + * bool server_verify = 3; + * + * @return The serverVerify. + */ + boolean getServerVerify(); + + /** + * + * + *
        +   * The URI template this request is expected to be bound to server-side.
        +   * 
        + * + * optional string intended_binding_uri = 10; + * + * @return Whether the intendedBindingUri field is set. + */ + boolean hasIntendedBindingUri(); + + /** + * + * + *
        +   * The URI template this request is expected to be bound to server-side.
        +   * 
        + * + * optional string intended_binding_uri = 10; + * + * @return The intendedBindingUri. + */ + java.lang.String getIntendedBindingUri(); + + /** + * + * + *
        +   * The URI template this request is expected to be bound to server-side.
        +   * 
        + * + * optional string intended_binding_uri = 10; + * + * @return The bytes for intendedBindingUri. + */ + com.google.protobuf.ByteString getIntendedBindingUriBytes(); + + /** + * + * + *
        +   * Some top level fields, to test that these are encoded correctly
        +   * in query params.
        +   * 
        + * + * int32 f_int32 = 4; + * + * @return The fInt32. + */ + int getFInt32(); + + /** + * int64 f_int64 = 5; + * + * @return The fInt64. + */ + long getFInt64(); + + /** + * double f_double = 6; + * + * @return The fDouble. + */ + double getFDouble(); + + /** + * optional int32 p_int32 = 7; + * + * @return Whether the pInt32 field is set. + */ + boolean hasPInt32(); + + /** + * optional int32 p_int32 = 7; + * + * @return The pInt32. + */ + int getPInt32(); + + /** + * optional int64 p_int64 = 8; + * + * @return Whether the pInt64 field is set. + */ + boolean hasPInt64(); + + /** + * optional int64 p_int64 = 8; + * + * @return The pInt64. + */ + long getPInt64(); + + /** + * optional double p_double = 9; + * + * @return Whether the pDouble field is set. + */ + boolean hasPDouble(); + + /** + * optional double p_double = 9; + * + * @return The pDouble. + */ + double getPDouble(); +} diff --git a/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/RepeatResponse.java b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/RepeatResponse.java new file mode 100644 index 0000000000..e0a1dd9e69 --- /dev/null +++ b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/RepeatResponse.java @@ -0,0 +1,782 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: schema/google/showcase/v1beta1/compliance.proto +// Protobuf Java Version: 4.33.2 + +package com.google.showcase.v1beta1; + +/** Protobuf type {@code google.showcase.v1beta1.RepeatResponse} */ +@com.google.protobuf.Generated +public final class RepeatResponse extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.RepeatResponse) + RepeatResponseOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "RepeatResponse"); + } + + // Use RepeatResponse.newBuilder() to construct. + private RepeatResponse(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private RepeatResponse() { + bindingUri_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.ComplianceOuterClass + .internal_static_google_showcase_v1beta1_RepeatResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.ComplianceOuterClass + .internal_static_google_showcase_v1beta1_RepeatResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.RepeatResponse.class, + com.google.showcase.v1beta1.RepeatResponse.Builder.class); + } + + private int bitField0_; + public static final int REQUEST_FIELD_NUMBER = 1; + private com.google.showcase.v1beta1.RepeatRequest request_; + + /** + * .google.showcase.v1beta1.RepeatRequest request = 1; + * + * @return Whether the request field is set. + */ + @java.lang.Override + public boolean hasRequest() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * .google.showcase.v1beta1.RepeatRequest request = 1; + * + * @return The request. + */ + @java.lang.Override + public com.google.showcase.v1beta1.RepeatRequest getRequest() { + return request_ == null + ? com.google.showcase.v1beta1.RepeatRequest.getDefaultInstance() + : request_; + } + + /** .google.showcase.v1beta1.RepeatRequest request = 1; */ + @java.lang.Override + public com.google.showcase.v1beta1.RepeatRequestOrBuilder getRequestOrBuilder() { + return request_ == null + ? com.google.showcase.v1beta1.RepeatRequest.getDefaultInstance() + : request_; + } + + public static final int BINDING_URI_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object bindingUri_ = ""; + + /** + * + * + *
        +   * The URI template the request was bound to server-side.
        +   * 
        + * + * string binding_uri = 2; + * + * @return The bindingUri. + */ + @java.lang.Override + public java.lang.String getBindingUri() { + java.lang.Object ref = bindingUri_; + 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(); + bindingUri_ = s; + return s; + } + } + + /** + * + * + *
        +   * The URI template the request was bound to server-side.
        +   * 
        + * + * string binding_uri = 2; + * + * @return The bytes for bindingUri. + */ + @java.lang.Override + public com.google.protobuf.ByteString getBindingUriBytes() { + java.lang.Object ref = bindingUri_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + bindingUri_ = 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, getRequest()); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(bindingUri_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, bindingUri_); + } + 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, getRequest()); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(bindingUri_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, bindingUri_); + } + 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.showcase.v1beta1.RepeatResponse)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.RepeatResponse other = + (com.google.showcase.v1beta1.RepeatResponse) obj; + + if (hasRequest() != other.hasRequest()) return false; + if (hasRequest()) { + if (!getRequest().equals(other.getRequest())) return false; + } + if (!getBindingUri().equals(other.getBindingUri())) 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 (hasRequest()) { + hash = (37 * hash) + REQUEST_FIELD_NUMBER; + hash = (53 * hash) + getRequest().hashCode(); + } + hash = (37 * hash) + BINDING_URI_FIELD_NUMBER; + hash = (53 * hash) + getBindingUri().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.showcase.v1beta1.RepeatResponse parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.RepeatResponse parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.RepeatResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.RepeatResponse 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.showcase.v1beta1.RepeatResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.RepeatResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.RepeatResponse parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.RepeatResponse parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.showcase.v1beta1.RepeatResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.RepeatResponse parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.showcase.v1beta1.RepeatResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.RepeatResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.showcase.v1beta1.RepeatResponse 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** Protobuf type {@code google.showcase.v1beta1.RepeatResponse} */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.RepeatResponse) + com.google.showcase.v1beta1.RepeatResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.ComplianceOuterClass + .internal_static_google_showcase_v1beta1_RepeatResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.ComplianceOuterClass + .internal_static_google_showcase_v1beta1_RepeatResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.RepeatResponse.class, + com.google.showcase.v1beta1.RepeatResponse.Builder.class); + } + + // Construct using com.google.showcase.v1beta1.RepeatResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetRequestFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + request_ = null; + if (requestBuilder_ != null) { + requestBuilder_.dispose(); + requestBuilder_ = null; + } + bindingUri_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.showcase.v1beta1.ComplianceOuterClass + .internal_static_google_showcase_v1beta1_RepeatResponse_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.RepeatResponse getDefaultInstanceForType() { + return com.google.showcase.v1beta1.RepeatResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.RepeatResponse build() { + com.google.showcase.v1beta1.RepeatResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.RepeatResponse buildPartial() { + com.google.showcase.v1beta1.RepeatResponse result = + new com.google.showcase.v1beta1.RepeatResponse(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.showcase.v1beta1.RepeatResponse result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.request_ = requestBuilder_ == null ? request_ : requestBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.bindingUri_ = bindingUri_; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.showcase.v1beta1.RepeatResponse) { + return mergeFrom((com.google.showcase.v1beta1.RepeatResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.showcase.v1beta1.RepeatResponse other) { + if (other == com.google.showcase.v1beta1.RepeatResponse.getDefaultInstance()) return this; + if (other.hasRequest()) { + mergeRequest(other.getRequest()); + } + if (!other.getBindingUri().isEmpty()) { + bindingUri_ = other.bindingUri_; + 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: + { + input.readMessage(internalGetRequestFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + bindingUri_ = 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 com.google.showcase.v1beta1.RepeatRequest request_; + private com.google.protobuf.SingleFieldBuilder< + com.google.showcase.v1beta1.RepeatRequest, + com.google.showcase.v1beta1.RepeatRequest.Builder, + com.google.showcase.v1beta1.RepeatRequestOrBuilder> + requestBuilder_; + + /** + * .google.showcase.v1beta1.RepeatRequest request = 1; + * + * @return Whether the request field is set. + */ + public boolean hasRequest() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * .google.showcase.v1beta1.RepeatRequest request = 1; + * + * @return The request. + */ + public com.google.showcase.v1beta1.RepeatRequest getRequest() { + if (requestBuilder_ == null) { + return request_ == null + ? com.google.showcase.v1beta1.RepeatRequest.getDefaultInstance() + : request_; + } else { + return requestBuilder_.getMessage(); + } + } + + /** .google.showcase.v1beta1.RepeatRequest request = 1; */ + public Builder setRequest(com.google.showcase.v1beta1.RepeatRequest value) { + if (requestBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + request_ = value; + } else { + requestBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** .google.showcase.v1beta1.RepeatRequest request = 1; */ + public Builder setRequest(com.google.showcase.v1beta1.RepeatRequest.Builder builderForValue) { + if (requestBuilder_ == null) { + request_ = builderForValue.build(); + } else { + requestBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** .google.showcase.v1beta1.RepeatRequest request = 1; */ + public Builder mergeRequest(com.google.showcase.v1beta1.RepeatRequest value) { + if (requestBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) + && request_ != null + && request_ != com.google.showcase.v1beta1.RepeatRequest.getDefaultInstance()) { + getRequestBuilder().mergeFrom(value); + } else { + request_ = value; + } + } else { + requestBuilder_.mergeFrom(value); + } + if (request_ != null) { + bitField0_ |= 0x00000001; + onChanged(); + } + return this; + } + + /** .google.showcase.v1beta1.RepeatRequest request = 1; */ + public Builder clearRequest() { + bitField0_ = (bitField0_ & ~0x00000001); + request_ = null; + if (requestBuilder_ != null) { + requestBuilder_.dispose(); + requestBuilder_ = null; + } + onChanged(); + return this; + } + + /** .google.showcase.v1beta1.RepeatRequest request = 1; */ + public com.google.showcase.v1beta1.RepeatRequest.Builder getRequestBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return internalGetRequestFieldBuilder().getBuilder(); + } + + /** .google.showcase.v1beta1.RepeatRequest request = 1; */ + public com.google.showcase.v1beta1.RepeatRequestOrBuilder getRequestOrBuilder() { + if (requestBuilder_ != null) { + return requestBuilder_.getMessageOrBuilder(); + } else { + return request_ == null + ? com.google.showcase.v1beta1.RepeatRequest.getDefaultInstance() + : request_; + } + } + + /** .google.showcase.v1beta1.RepeatRequest request = 1; */ + private com.google.protobuf.SingleFieldBuilder< + com.google.showcase.v1beta1.RepeatRequest, + com.google.showcase.v1beta1.RepeatRequest.Builder, + com.google.showcase.v1beta1.RepeatRequestOrBuilder> + internalGetRequestFieldBuilder() { + if (requestBuilder_ == null) { + requestBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.showcase.v1beta1.RepeatRequest, + com.google.showcase.v1beta1.RepeatRequest.Builder, + com.google.showcase.v1beta1.RepeatRequestOrBuilder>( + getRequest(), getParentForChildren(), isClean()); + request_ = null; + } + return requestBuilder_; + } + + private java.lang.Object bindingUri_ = ""; + + /** + * + * + *
        +     * The URI template the request was bound to server-side.
        +     * 
        + * + * string binding_uri = 2; + * + * @return The bindingUri. + */ + public java.lang.String getBindingUri() { + java.lang.Object ref = bindingUri_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + bindingUri_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
        +     * The URI template the request was bound to server-side.
        +     * 
        + * + * string binding_uri = 2; + * + * @return The bytes for bindingUri. + */ + public com.google.protobuf.ByteString getBindingUriBytes() { + java.lang.Object ref = bindingUri_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + bindingUri_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
        +     * The URI template the request was bound to server-side.
        +     * 
        + * + * string binding_uri = 2; + * + * @param value The bindingUri to set. + * @return This builder for chaining. + */ + public Builder setBindingUri(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + bindingUri_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
        +     * The URI template the request was bound to server-side.
        +     * 
        + * + * string binding_uri = 2; + * + * @return This builder for chaining. + */ + public Builder clearBindingUri() { + bindingUri_ = getDefaultInstance().getBindingUri(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
        +     * The URI template the request was bound to server-side.
        +     * 
        + * + * string binding_uri = 2; + * + * @param value The bytes for bindingUri to set. + * @return This builder for chaining. + */ + public Builder setBindingUriBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + bindingUri_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.showcase.v1beta1.RepeatResponse) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.RepeatResponse) + private static final com.google.showcase.v1beta1.RepeatResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.RepeatResponse(); + } + + public static com.google.showcase.v1beta1.RepeatResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public RepeatResponse 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.showcase.v1beta1.RepeatResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/RepeatResponseOrBuilder.java b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/RepeatResponseOrBuilder.java new file mode 100644 index 0000000000..7fda9e5e6c --- /dev/null +++ b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/RepeatResponseOrBuilder.java @@ -0,0 +1,71 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: schema/google/showcase/v1beta1/compliance.proto +// Protobuf Java Version: 4.33.2 + +package com.google.showcase.v1beta1; + +@com.google.protobuf.Generated +public interface RepeatResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.RepeatResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * .google.showcase.v1beta1.RepeatRequest request = 1; + * + * @return Whether the request field is set. + */ + boolean hasRequest(); + + /** + * .google.showcase.v1beta1.RepeatRequest request = 1; + * + * @return The request. + */ + com.google.showcase.v1beta1.RepeatRequest getRequest(); + + /** .google.showcase.v1beta1.RepeatRequest request = 1; */ + com.google.showcase.v1beta1.RepeatRequestOrBuilder getRequestOrBuilder(); + + /** + * + * + *
        +   * The URI template the request was bound to server-side.
        +   * 
        + * + * string binding_uri = 2; + * + * @return The bindingUri. + */ + java.lang.String getBindingUri(); + + /** + * + * + *
        +   * The URI template the request was bound to server-side.
        +   * 
        + * + * string binding_uri = 2; + * + * @return The bytes for bindingUri. + */ + com.google.protobuf.ByteString getBindingUriBytes(); +} diff --git a/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ReportSessionRequest.java b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ReportSessionRequest.java new file mode 100644 index 0000000000..5457774c38 --- /dev/null +++ b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ReportSessionRequest.java @@ -0,0 +1,596 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: schema/google/showcase/v1beta1/testing.proto +// Protobuf Java Version: 4.33.2 + +package com.google.showcase.v1beta1; + +/** + * + * + *
        + * Request message for reporting on a session.
        + * 
        + * + * Protobuf type {@code google.showcase.v1beta1.ReportSessionRequest} + */ +@com.google.protobuf.Generated +public final class ReportSessionRequest extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.ReportSessionRequest) + ReportSessionRequestOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "ReportSessionRequest"); + } + + // Use ReportSessionRequest.newBuilder() to construct. + private ReportSessionRequest(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private ReportSessionRequest() { + name_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.TestingOuterClass + .internal_static_google_showcase_v1beta1_ReportSessionRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.TestingOuterClass + .internal_static_google_showcase_v1beta1_ReportSessionRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.ReportSessionRequest.class, + com.google.showcase.v1beta1.ReportSessionRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + + /** + * + * + *
        +   * The session to be reported on.
        +   * 
        + * + * string name = 1 [(.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; + } + } + + /** + * + * + *
        +   * The session to be reported on.
        +   * 
        + * + * string name = 1 [(.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.GeneratedMessage.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessage.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.GeneratedMessage.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessage.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.showcase.v1beta1.ReportSessionRequest)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.ReportSessionRequest other = + (com.google.showcase.v1beta1.ReportSessionRequest) 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.showcase.v1beta1.ReportSessionRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.ReportSessionRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.ReportSessionRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.ReportSessionRequest 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.showcase.v1beta1.ReportSessionRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.ReportSessionRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.ReportSessionRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.ReportSessionRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.showcase.v1beta1.ReportSessionRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.ReportSessionRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.showcase.v1beta1.ReportSessionRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.ReportSessionRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.showcase.v1beta1.ReportSessionRequest 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
        +   * Request message for reporting on a session.
        +   * 
        + * + * Protobuf type {@code google.showcase.v1beta1.ReportSessionRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.ReportSessionRequest) + com.google.showcase.v1beta1.ReportSessionRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.TestingOuterClass + .internal_static_google_showcase_v1beta1_ReportSessionRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.TestingOuterClass + .internal_static_google_showcase_v1beta1_ReportSessionRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.ReportSessionRequest.class, + com.google.showcase.v1beta1.ReportSessionRequest.Builder.class); + } + + // Construct using com.google.showcase.v1beta1.ReportSessionRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.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.showcase.v1beta1.TestingOuterClass + .internal_static_google_showcase_v1beta1_ReportSessionRequest_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.ReportSessionRequest getDefaultInstanceForType() { + return com.google.showcase.v1beta1.ReportSessionRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.ReportSessionRequest build() { + com.google.showcase.v1beta1.ReportSessionRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.ReportSessionRequest buildPartial() { + com.google.showcase.v1beta1.ReportSessionRequest result = + new com.google.showcase.v1beta1.ReportSessionRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.showcase.v1beta1.ReportSessionRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.showcase.v1beta1.ReportSessionRequest) { + return mergeFrom((com.google.showcase.v1beta1.ReportSessionRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.showcase.v1beta1.ReportSessionRequest other) { + if (other == com.google.showcase.v1beta1.ReportSessionRequest.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_ = ""; + + /** + * + * + *
        +     * The session to be reported on.
        +     * 
        + * + * string name = 1 [(.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; + } + } + + /** + * + * + *
        +     * The session to be reported on.
        +     * 
        + * + * string name = 1 [(.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; + } + } + + /** + * + * + *
        +     * The session to be reported on.
        +     * 
        + * + * string name = 1 [(.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; + } + + /** + * + * + *
        +     * The session to be reported on.
        +     * 
        + * + * string name = 1 [(.google.api.resource_reference) = { ... } + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
        +     * The session to be reported on.
        +     * 
        + * + * string name = 1 [(.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; + } + + // @@protoc_insertion_point(builder_scope:google.showcase.v1beta1.ReportSessionRequest) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.ReportSessionRequest) + private static final com.google.showcase.v1beta1.ReportSessionRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.ReportSessionRequest(); + } + + public static com.google.showcase.v1beta1.ReportSessionRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ReportSessionRequest 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.showcase.v1beta1.ReportSessionRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ReportSessionRequestOrBuilder.java b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ReportSessionRequestOrBuilder.java new file mode 100644 index 0000000000..353279cc50 --- /dev/null +++ b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ReportSessionRequestOrBuilder.java @@ -0,0 +1,54 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: schema/google/showcase/v1beta1/testing.proto +// Protobuf Java Version: 4.33.2 + +package com.google.showcase.v1beta1; + +@com.google.protobuf.Generated +public interface ReportSessionRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.ReportSessionRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
        +   * The session to be reported on.
        +   * 
        + * + * string name = 1 [(.google.api.resource_reference) = { ... } + * + * @return The name. + */ + java.lang.String getName(); + + /** + * + * + *
        +   * The session to be reported on.
        +   * 
        + * + * string name = 1 [(.google.api.resource_reference) = { ... } + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); +} diff --git a/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ReportSessionResponse.java b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ReportSessionResponse.java new file mode 100644 index 0000000000..8140319b9e --- /dev/null +++ b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ReportSessionResponse.java @@ -0,0 +1,1262 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: schema/google/showcase/v1beta1/testing.proto +// Protobuf Java Version: 4.33.2 + +package com.google.showcase.v1beta1; + +/** + * + * + *
        + * Response message for reporting on a session.
        + * 
        + * + * Protobuf type {@code google.showcase.v1beta1.ReportSessionResponse} + */ +@com.google.protobuf.Generated +public final class ReportSessionResponse extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.ReportSessionResponse) + ReportSessionResponseOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "ReportSessionResponse"); + } + + // Use ReportSessionResponse.newBuilder() to construct. + private ReportSessionResponse(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private ReportSessionResponse() { + result_ = 0; + testRuns_ = java.util.Collections.emptyList(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.TestingOuterClass + .internal_static_google_showcase_v1beta1_ReportSessionResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.TestingOuterClass + .internal_static_google_showcase_v1beta1_ReportSessionResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.ReportSessionResponse.class, + com.google.showcase.v1beta1.ReportSessionResponse.Builder.class); + } + + /** + * + * + *
        +   * The topline state of the report.
        +   * 
        + * + * Protobuf enum {@code google.showcase.v1beta1.ReportSessionResponse.Result} + */ + public enum Result implements com.google.protobuf.ProtocolMessageEnum { + /** RESULT_UNSPECIFIED = 0; */ + RESULT_UNSPECIFIED(0), + /** + * + * + *
        +     * The session is complete, and everything passed.
        +     * 
        + * + * PASSED = 1; + */ + PASSED(1), + /** + * + * + *
        +     * The session had an explicit failure.
        +     * 
        + * + * FAILED = 2; + */ + FAILED(2), + /** + * + * + *
        +     * The session is incomplete. This is a failure response.
        +     * 
        + * + * INCOMPLETE = 3; + */ + INCOMPLETE(3), + UNRECOGNIZED(-1), + ; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "Result"); + } + + /** RESULT_UNSPECIFIED = 0; */ + public static final int RESULT_UNSPECIFIED_VALUE = 0; + + /** + * + * + *
        +     * The session is complete, and everything passed.
        +     * 
        + * + * PASSED = 1; + */ + public static final int PASSED_VALUE = 1; + + /** + * + * + *
        +     * The session had an explicit failure.
        +     * 
        + * + * FAILED = 2; + */ + public static final int FAILED_VALUE = 2; + + /** + * + * + *
        +     * The session is incomplete. This is a failure response.
        +     * 
        + * + * INCOMPLETE = 3; + */ + public static final int INCOMPLETE_VALUE = 3; + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static Result 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 Result forNumber(int value) { + switch (value) { + case 0: + return RESULT_UNSPECIFIED; + case 1: + return PASSED; + case 2: + return FAILED; + case 3: + return INCOMPLETE; + 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 Result findValueByNumber(int number) { + return Result.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 com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.showcase.v1beta1.ReportSessionResponse.getDescriptor() + .getEnumTypes() + .get(0); + } + + private static final Result[] VALUES = values(); + + public static Result 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 Result(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.showcase.v1beta1.ReportSessionResponse.Result) + } + + public static final int RESULT_FIELD_NUMBER = 1; + private int result_ = 0; + + /** + * + * + *
        +   * The state of the report.
        +   * 
        + * + * .google.showcase.v1beta1.ReportSessionResponse.Result result = 1; + * + * @return The enum numeric value on the wire for result. + */ + @java.lang.Override + public int getResultValue() { + return result_; + } + + /** + * + * + *
        +   * The state of the report.
        +   * 
        + * + * .google.showcase.v1beta1.ReportSessionResponse.Result result = 1; + * + * @return The result. + */ + @java.lang.Override + public com.google.showcase.v1beta1.ReportSessionResponse.Result getResult() { + com.google.showcase.v1beta1.ReportSessionResponse.Result result = + com.google.showcase.v1beta1.ReportSessionResponse.Result.forNumber(result_); + return result == null + ? com.google.showcase.v1beta1.ReportSessionResponse.Result.UNRECOGNIZED + : result; + } + + public static final int TEST_RUNS_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private java.util.List testRuns_; + + /** + * + * + *
        +   * The test runs of this session.
        +   * 
        + * + * repeated .google.showcase.v1beta1.TestRun test_runs = 2; + */ + @java.lang.Override + public java.util.List getTestRunsList() { + return testRuns_; + } + + /** + * + * + *
        +   * The test runs of this session.
        +   * 
        + * + * repeated .google.showcase.v1beta1.TestRun test_runs = 2; + */ + @java.lang.Override + public java.util.List + getTestRunsOrBuilderList() { + return testRuns_; + } + + /** + * + * + *
        +   * The test runs of this session.
        +   * 
        + * + * repeated .google.showcase.v1beta1.TestRun test_runs = 2; + */ + @java.lang.Override + public int getTestRunsCount() { + return testRuns_.size(); + } + + /** + * + * + *
        +   * The test runs of this session.
        +   * 
        + * + * repeated .google.showcase.v1beta1.TestRun test_runs = 2; + */ + @java.lang.Override + public com.google.showcase.v1beta1.TestRun getTestRuns(int index) { + return testRuns_.get(index); + } + + /** + * + * + *
        +   * The test runs of this session.
        +   * 
        + * + * repeated .google.showcase.v1beta1.TestRun test_runs = 2; + */ + @java.lang.Override + public com.google.showcase.v1beta1.TestRunOrBuilder getTestRunsOrBuilder(int index) { + return testRuns_.get(index); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (result_ + != com.google.showcase.v1beta1.ReportSessionResponse.Result.RESULT_UNSPECIFIED + .getNumber()) { + output.writeEnum(1, result_); + } + for (int i = 0; i < testRuns_.size(); i++) { + output.writeMessage(2, testRuns_.get(i)); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (result_ + != com.google.showcase.v1beta1.ReportSessionResponse.Result.RESULT_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(1, result_); + } + for (int i = 0; i < testRuns_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, testRuns_.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.showcase.v1beta1.ReportSessionResponse)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.ReportSessionResponse other = + (com.google.showcase.v1beta1.ReportSessionResponse) obj; + + if (result_ != other.result_) return false; + if (!getTestRunsList().equals(other.getTestRunsList())) 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) + RESULT_FIELD_NUMBER; + hash = (53 * hash) + result_; + if (getTestRunsCount() > 0) { + hash = (37 * hash) + TEST_RUNS_FIELD_NUMBER; + hash = (53 * hash) + getTestRunsList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.showcase.v1beta1.ReportSessionResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.ReportSessionResponse parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.ReportSessionResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.ReportSessionResponse 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.showcase.v1beta1.ReportSessionResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.ReportSessionResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.ReportSessionResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.ReportSessionResponse parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.showcase.v1beta1.ReportSessionResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.ReportSessionResponse parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.showcase.v1beta1.ReportSessionResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.ReportSessionResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.showcase.v1beta1.ReportSessionResponse 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
        +   * Response message for reporting on a session.
        +   * 
        + * + * Protobuf type {@code google.showcase.v1beta1.ReportSessionResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.ReportSessionResponse) + com.google.showcase.v1beta1.ReportSessionResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.TestingOuterClass + .internal_static_google_showcase_v1beta1_ReportSessionResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.TestingOuterClass + .internal_static_google_showcase_v1beta1_ReportSessionResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.ReportSessionResponse.class, + com.google.showcase.v1beta1.ReportSessionResponse.Builder.class); + } + + // Construct using com.google.showcase.v1beta1.ReportSessionResponse.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + result_ = 0; + if (testRunsBuilder_ == null) { + testRuns_ = java.util.Collections.emptyList(); + } else { + testRuns_ = null; + testRunsBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000002); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.showcase.v1beta1.TestingOuterClass + .internal_static_google_showcase_v1beta1_ReportSessionResponse_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.ReportSessionResponse getDefaultInstanceForType() { + return com.google.showcase.v1beta1.ReportSessionResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.ReportSessionResponse build() { + com.google.showcase.v1beta1.ReportSessionResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.ReportSessionResponse buildPartial() { + com.google.showcase.v1beta1.ReportSessionResponse result = + new com.google.showcase.v1beta1.ReportSessionResponse(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields( + com.google.showcase.v1beta1.ReportSessionResponse result) { + if (testRunsBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0)) { + testRuns_ = java.util.Collections.unmodifiableList(testRuns_); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.testRuns_ = testRuns_; + } else { + result.testRuns_ = testRunsBuilder_.build(); + } + } + + private void buildPartial0(com.google.showcase.v1beta1.ReportSessionResponse result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.result_ = result_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.showcase.v1beta1.ReportSessionResponse) { + return mergeFrom((com.google.showcase.v1beta1.ReportSessionResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.showcase.v1beta1.ReportSessionResponse other) { + if (other == com.google.showcase.v1beta1.ReportSessionResponse.getDefaultInstance()) + return this; + if (other.result_ != 0) { + setResultValue(other.getResultValue()); + } + if (testRunsBuilder_ == null) { + if (!other.testRuns_.isEmpty()) { + if (testRuns_.isEmpty()) { + testRuns_ = other.testRuns_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureTestRunsIsMutable(); + testRuns_.addAll(other.testRuns_); + } + onChanged(); + } + } else { + if (!other.testRuns_.isEmpty()) { + if (testRunsBuilder_.isEmpty()) { + testRunsBuilder_.dispose(); + testRunsBuilder_ = null; + testRuns_ = other.testRuns_; + bitField0_ = (bitField0_ & ~0x00000002); + testRunsBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders + ? internalGetTestRunsFieldBuilder() + : null; + } else { + testRunsBuilder_.addAllMessages(other.testRuns_); + } + } + } + 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: + { + result_ = input.readEnum(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 18: + { + com.google.showcase.v1beta1.TestRun m = + input.readMessage( + com.google.showcase.v1beta1.TestRun.parser(), extensionRegistry); + if (testRunsBuilder_ == null) { + ensureTestRunsIsMutable(); + testRuns_.add(m); + } else { + testRunsBuilder_.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 int result_ = 0; + + /** + * + * + *
        +     * The state of the report.
        +     * 
        + * + * .google.showcase.v1beta1.ReportSessionResponse.Result result = 1; + * + * @return The enum numeric value on the wire for result. + */ + @java.lang.Override + public int getResultValue() { + return result_; + } + + /** + * + * + *
        +     * The state of the report.
        +     * 
        + * + * .google.showcase.v1beta1.ReportSessionResponse.Result result = 1; + * + * @param value The enum numeric value on the wire for result to set. + * @return This builder for chaining. + */ + public Builder setResultValue(int value) { + result_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
        +     * The state of the report.
        +     * 
        + * + * .google.showcase.v1beta1.ReportSessionResponse.Result result = 1; + * + * @return The result. + */ + @java.lang.Override + public com.google.showcase.v1beta1.ReportSessionResponse.Result getResult() { + com.google.showcase.v1beta1.ReportSessionResponse.Result result = + com.google.showcase.v1beta1.ReportSessionResponse.Result.forNumber(result_); + return result == null + ? com.google.showcase.v1beta1.ReportSessionResponse.Result.UNRECOGNIZED + : result; + } + + /** + * + * + *
        +     * The state of the report.
        +     * 
        + * + * .google.showcase.v1beta1.ReportSessionResponse.Result result = 1; + * + * @param value The result to set. + * @return This builder for chaining. + */ + public Builder setResult(com.google.showcase.v1beta1.ReportSessionResponse.Result value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000001; + result_ = value.getNumber(); + onChanged(); + return this; + } + + /** + * + * + *
        +     * The state of the report.
        +     * 
        + * + * .google.showcase.v1beta1.ReportSessionResponse.Result result = 1; + * + * @return This builder for chaining. + */ + public Builder clearResult() { + bitField0_ = (bitField0_ & ~0x00000001); + result_ = 0; + onChanged(); + return this; + } + + private java.util.List testRuns_ = + java.util.Collections.emptyList(); + + private void ensureTestRunsIsMutable() { + if (!((bitField0_ & 0x00000002) != 0)) { + testRuns_ = new java.util.ArrayList(testRuns_); + bitField0_ |= 0x00000002; + } + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.google.showcase.v1beta1.TestRun, + com.google.showcase.v1beta1.TestRun.Builder, + com.google.showcase.v1beta1.TestRunOrBuilder> + testRunsBuilder_; + + /** + * + * + *
        +     * The test runs of this session.
        +     * 
        + * + * repeated .google.showcase.v1beta1.TestRun test_runs = 2; + */ + public java.util.List getTestRunsList() { + if (testRunsBuilder_ == null) { + return java.util.Collections.unmodifiableList(testRuns_); + } else { + return testRunsBuilder_.getMessageList(); + } + } + + /** + * + * + *
        +     * The test runs of this session.
        +     * 
        + * + * repeated .google.showcase.v1beta1.TestRun test_runs = 2; + */ + public int getTestRunsCount() { + if (testRunsBuilder_ == null) { + return testRuns_.size(); + } else { + return testRunsBuilder_.getCount(); + } + } + + /** + * + * + *
        +     * The test runs of this session.
        +     * 
        + * + * repeated .google.showcase.v1beta1.TestRun test_runs = 2; + */ + public com.google.showcase.v1beta1.TestRun getTestRuns(int index) { + if (testRunsBuilder_ == null) { + return testRuns_.get(index); + } else { + return testRunsBuilder_.getMessage(index); + } + } + + /** + * + * + *
        +     * The test runs of this session.
        +     * 
        + * + * repeated .google.showcase.v1beta1.TestRun test_runs = 2; + */ + public Builder setTestRuns(int index, com.google.showcase.v1beta1.TestRun value) { + if (testRunsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureTestRunsIsMutable(); + testRuns_.set(index, value); + onChanged(); + } else { + testRunsBuilder_.setMessage(index, value); + } + return this; + } + + /** + * + * + *
        +     * The test runs of this session.
        +     * 
        + * + * repeated .google.showcase.v1beta1.TestRun test_runs = 2; + */ + public Builder setTestRuns( + int index, com.google.showcase.v1beta1.TestRun.Builder builderForValue) { + if (testRunsBuilder_ == null) { + ensureTestRunsIsMutable(); + testRuns_.set(index, builderForValue.build()); + onChanged(); + } else { + testRunsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
        +     * The test runs of this session.
        +     * 
        + * + * repeated .google.showcase.v1beta1.TestRun test_runs = 2; + */ + public Builder addTestRuns(com.google.showcase.v1beta1.TestRun value) { + if (testRunsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureTestRunsIsMutable(); + testRuns_.add(value); + onChanged(); + } else { + testRunsBuilder_.addMessage(value); + } + return this; + } + + /** + * + * + *
        +     * The test runs of this session.
        +     * 
        + * + * repeated .google.showcase.v1beta1.TestRun test_runs = 2; + */ + public Builder addTestRuns(int index, com.google.showcase.v1beta1.TestRun value) { + if (testRunsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureTestRunsIsMutable(); + testRuns_.add(index, value); + onChanged(); + } else { + testRunsBuilder_.addMessage(index, value); + } + return this; + } + + /** + * + * + *
        +     * The test runs of this session.
        +     * 
        + * + * repeated .google.showcase.v1beta1.TestRun test_runs = 2; + */ + public Builder addTestRuns(com.google.showcase.v1beta1.TestRun.Builder builderForValue) { + if (testRunsBuilder_ == null) { + ensureTestRunsIsMutable(); + testRuns_.add(builderForValue.build()); + onChanged(); + } else { + testRunsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + + /** + * + * + *
        +     * The test runs of this session.
        +     * 
        + * + * repeated .google.showcase.v1beta1.TestRun test_runs = 2; + */ + public Builder addTestRuns( + int index, com.google.showcase.v1beta1.TestRun.Builder builderForValue) { + if (testRunsBuilder_ == null) { + ensureTestRunsIsMutable(); + testRuns_.add(index, builderForValue.build()); + onChanged(); + } else { + testRunsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
        +     * The test runs of this session.
        +     * 
        + * + * repeated .google.showcase.v1beta1.TestRun test_runs = 2; + */ + public Builder addAllTestRuns( + java.lang.Iterable values) { + if (testRunsBuilder_ == null) { + ensureTestRunsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, testRuns_); + onChanged(); + } else { + testRunsBuilder_.addAllMessages(values); + } + return this; + } + + /** + * + * + *
        +     * The test runs of this session.
        +     * 
        + * + * repeated .google.showcase.v1beta1.TestRun test_runs = 2; + */ + public Builder clearTestRuns() { + if (testRunsBuilder_ == null) { + testRuns_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + } else { + testRunsBuilder_.clear(); + } + return this; + } + + /** + * + * + *
        +     * The test runs of this session.
        +     * 
        + * + * repeated .google.showcase.v1beta1.TestRun test_runs = 2; + */ + public Builder removeTestRuns(int index) { + if (testRunsBuilder_ == null) { + ensureTestRunsIsMutable(); + testRuns_.remove(index); + onChanged(); + } else { + testRunsBuilder_.remove(index); + } + return this; + } + + /** + * + * + *
        +     * The test runs of this session.
        +     * 
        + * + * repeated .google.showcase.v1beta1.TestRun test_runs = 2; + */ + public com.google.showcase.v1beta1.TestRun.Builder getTestRunsBuilder(int index) { + return internalGetTestRunsFieldBuilder().getBuilder(index); + } + + /** + * + * + *
        +     * The test runs of this session.
        +     * 
        + * + * repeated .google.showcase.v1beta1.TestRun test_runs = 2; + */ + public com.google.showcase.v1beta1.TestRunOrBuilder getTestRunsOrBuilder(int index) { + if (testRunsBuilder_ == null) { + return testRuns_.get(index); + } else { + return testRunsBuilder_.getMessageOrBuilder(index); + } + } + + /** + * + * + *
        +     * The test runs of this session.
        +     * 
        + * + * repeated .google.showcase.v1beta1.TestRun test_runs = 2; + */ + public java.util.List + getTestRunsOrBuilderList() { + if (testRunsBuilder_ != null) { + return testRunsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(testRuns_); + } + } + + /** + * + * + *
        +     * The test runs of this session.
        +     * 
        + * + * repeated .google.showcase.v1beta1.TestRun test_runs = 2; + */ + public com.google.showcase.v1beta1.TestRun.Builder addTestRunsBuilder() { + return internalGetTestRunsFieldBuilder() + .addBuilder(com.google.showcase.v1beta1.TestRun.getDefaultInstance()); + } + + /** + * + * + *
        +     * The test runs of this session.
        +     * 
        + * + * repeated .google.showcase.v1beta1.TestRun test_runs = 2; + */ + public com.google.showcase.v1beta1.TestRun.Builder addTestRunsBuilder(int index) { + return internalGetTestRunsFieldBuilder() + .addBuilder(index, com.google.showcase.v1beta1.TestRun.getDefaultInstance()); + } + + /** + * + * + *
        +     * The test runs of this session.
        +     * 
        + * + * repeated .google.showcase.v1beta1.TestRun test_runs = 2; + */ + public java.util.List getTestRunsBuilderList() { + return internalGetTestRunsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.google.showcase.v1beta1.TestRun, + com.google.showcase.v1beta1.TestRun.Builder, + com.google.showcase.v1beta1.TestRunOrBuilder> + internalGetTestRunsFieldBuilder() { + if (testRunsBuilder_ == null) { + testRunsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilder< + com.google.showcase.v1beta1.TestRun, + com.google.showcase.v1beta1.TestRun.Builder, + com.google.showcase.v1beta1.TestRunOrBuilder>( + testRuns_, ((bitField0_ & 0x00000002) != 0), getParentForChildren(), isClean()); + testRuns_ = null; + } + return testRunsBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.showcase.v1beta1.ReportSessionResponse) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.ReportSessionResponse) + private static final com.google.showcase.v1beta1.ReportSessionResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.ReportSessionResponse(); + } + + public static com.google.showcase.v1beta1.ReportSessionResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ReportSessionResponse 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.showcase.v1beta1.ReportSessionResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ReportSessionResponseOrBuilder.java b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ReportSessionResponseOrBuilder.java new file mode 100644 index 0000000000..d1f90f36ee --- /dev/null +++ b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ReportSessionResponseOrBuilder.java @@ -0,0 +1,109 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: schema/google/showcase/v1beta1/testing.proto +// Protobuf Java Version: 4.33.2 + +package com.google.showcase.v1beta1; + +@com.google.protobuf.Generated +public interface ReportSessionResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.ReportSessionResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
        +   * The state of the report.
        +   * 
        + * + * .google.showcase.v1beta1.ReportSessionResponse.Result result = 1; + * + * @return The enum numeric value on the wire for result. + */ + int getResultValue(); + + /** + * + * + *
        +   * The state of the report.
        +   * 
        + * + * .google.showcase.v1beta1.ReportSessionResponse.Result result = 1; + * + * @return The result. + */ + com.google.showcase.v1beta1.ReportSessionResponse.Result getResult(); + + /** + * + * + *
        +   * The test runs of this session.
        +   * 
        + * + * repeated .google.showcase.v1beta1.TestRun test_runs = 2; + */ + java.util.List getTestRunsList(); + + /** + * + * + *
        +   * The test runs of this session.
        +   * 
        + * + * repeated .google.showcase.v1beta1.TestRun test_runs = 2; + */ + com.google.showcase.v1beta1.TestRun getTestRuns(int index); + + /** + * + * + *
        +   * The test runs of this session.
        +   * 
        + * + * repeated .google.showcase.v1beta1.TestRun test_runs = 2; + */ + int getTestRunsCount(); + + /** + * + * + *
        +   * The test runs of this session.
        +   * 
        + * + * repeated .google.showcase.v1beta1.TestRun test_runs = 2; + */ + java.util.List getTestRunsOrBuilderList(); + + /** + * + * + *
        +   * The test runs of this session.
        +   * 
        + * + * repeated .google.showcase.v1beta1.TestRun test_runs = 2; + */ + com.google.showcase.v1beta1.TestRunOrBuilder getTestRunsOrBuilder(int index); +} diff --git a/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/RestError.java b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/RestError.java new file mode 100644 index 0000000000..fa9c7515de --- /dev/null +++ b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/RestError.java @@ -0,0 +1,2048 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: schema/google/showcase/v1beta1/rest_error.proto +// Protobuf Java Version: 4.33.2 + +package com.google.showcase.v1beta1; + +/** + * + * + *
        + * HTTP/JSON error representation as defined in
        + * https://google.aip.dev/193#http11json-representation,
        + * 
        + * + * Protobuf type {@code google.showcase.v1beta1.RestError} + */ +@com.google.protobuf.Generated +public final class RestError extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.RestError) + RestErrorOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "RestError"); + } + + // Use RestError.newBuilder() to construct. + private RestError(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private RestError() {} + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.RestErrorOuterClass + .internal_static_google_showcase_v1beta1_RestError_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.RestErrorOuterClass + .internal_static_google_showcase_v1beta1_RestError_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.RestError.class, + com.google.showcase.v1beta1.RestError.Builder.class); + } + + public interface StatusOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.RestError.Status) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
        +     * The HTTP status code that corresponds to `google.rpc.Status.code`.
        +     * 
        + * + * int32 code = 1; + * + * @return The code. + */ + int getCode(); + + /** + * + * + *
        +     * This corresponds to `google.rpc.Status.message`.
        +     * 
        + * + * string message = 2; + * + * @return The message. + */ + java.lang.String getMessage(); + + /** + * + * + *
        +     * This corresponds to `google.rpc.Status.message`.
        +     * 
        + * + * string message = 2; + * + * @return The bytes for message. + */ + com.google.protobuf.ByteString getMessageBytes(); + + /** + * + * + *
        +     * This is the enum version for `google.rpc.Status.code`.
        +     * 
        + * + * .google.rpc.Code status = 4; + * + * @return The enum numeric value on the wire for status. + */ + int getStatusValue(); + + /** + * + * + *
        +     * This is the enum version for `google.rpc.Status.code`.
        +     * 
        + * + * .google.rpc.Code status = 4; + * + * @return The status. + */ + com.google.rpc.Code getStatus(); + + /** + * + * + *
        +     * This corresponds to `google.rpc.Status.details`.
        +     * 
        + * + * repeated .google.protobuf.Any details = 5; + */ + java.util.List getDetailsList(); + + /** + * + * + *
        +     * This corresponds to `google.rpc.Status.details`.
        +     * 
        + * + * repeated .google.protobuf.Any details = 5; + */ + com.google.protobuf.Any getDetails(int index); + + /** + * + * + *
        +     * This corresponds to `google.rpc.Status.details`.
        +     * 
        + * + * repeated .google.protobuf.Any details = 5; + */ + int getDetailsCount(); + + /** + * + * + *
        +     * This corresponds to `google.rpc.Status.details`.
        +     * 
        + * + * repeated .google.protobuf.Any details = 5; + */ + java.util.List getDetailsOrBuilderList(); + + /** + * + * + *
        +     * This corresponds to `google.rpc.Status.details`.
        +     * 
        + * + * repeated .google.protobuf.Any details = 5; + */ + com.google.protobuf.AnyOrBuilder getDetailsOrBuilder(int index); + } + + /** Protobuf type {@code google.showcase.v1beta1.RestError.Status} */ + public static final class Status extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.RestError.Status) + StatusOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "Status"); + } + + // Use Status.newBuilder() to construct. + private Status(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private Status() { + message_ = ""; + status_ = 0; + details_ = java.util.Collections.emptyList(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.RestErrorOuterClass + .internal_static_google_showcase_v1beta1_RestError_Status_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.RestErrorOuterClass + .internal_static_google_showcase_v1beta1_RestError_Status_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.RestError.Status.class, + com.google.showcase.v1beta1.RestError.Status.Builder.class); + } + + public static final int CODE_FIELD_NUMBER = 1; + private int code_ = 0; + + /** + * + * + *
        +     * The HTTP status code that corresponds to `google.rpc.Status.code`.
        +     * 
        + * + * int32 code = 1; + * + * @return The code. + */ + @java.lang.Override + public int getCode() { + return code_; + } + + public static final int MESSAGE_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object message_ = ""; + + /** + * + * + *
        +     * This corresponds to `google.rpc.Status.message`.
        +     * 
        + * + * string message = 2; + * + * @return The message. + */ + @java.lang.Override + public java.lang.String getMessage() { + java.lang.Object ref = message_; + 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(); + message_ = s; + return s; + } + } + + /** + * + * + *
        +     * This corresponds to `google.rpc.Status.message`.
        +     * 
        + * + * string message = 2; + * + * @return The bytes for message. + */ + @java.lang.Override + public com.google.protobuf.ByteString getMessageBytes() { + java.lang.Object ref = message_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + message_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int STATUS_FIELD_NUMBER = 4; + private int status_ = 0; + + /** + * + * + *
        +     * This is the enum version for `google.rpc.Status.code`.
        +     * 
        + * + * .google.rpc.Code status = 4; + * + * @return The enum numeric value on the wire for status. + */ + @java.lang.Override + public int getStatusValue() { + return status_; + } + + /** + * + * + *
        +     * This is the enum version for `google.rpc.Status.code`.
        +     * 
        + * + * .google.rpc.Code status = 4; + * + * @return The status. + */ + @java.lang.Override + public com.google.rpc.Code getStatus() { + com.google.rpc.Code result = com.google.rpc.Code.forNumber(status_); + return result == null ? com.google.rpc.Code.UNRECOGNIZED : result; + } + + public static final int DETAILS_FIELD_NUMBER = 5; + + @SuppressWarnings("serial") + private java.util.List details_; + + /** + * + * + *
        +     * This corresponds to `google.rpc.Status.details`.
        +     * 
        + * + * repeated .google.protobuf.Any details = 5; + */ + @java.lang.Override + public java.util.List getDetailsList() { + return details_; + } + + /** + * + * + *
        +     * This corresponds to `google.rpc.Status.details`.
        +     * 
        + * + * repeated .google.protobuf.Any details = 5; + */ + @java.lang.Override + public java.util.List getDetailsOrBuilderList() { + return details_; + } + + /** + * + * + *
        +     * This corresponds to `google.rpc.Status.details`.
        +     * 
        + * + * repeated .google.protobuf.Any details = 5; + */ + @java.lang.Override + public int getDetailsCount() { + return details_.size(); + } + + /** + * + * + *
        +     * This corresponds to `google.rpc.Status.details`.
        +     * 
        + * + * repeated .google.protobuf.Any details = 5; + */ + @java.lang.Override + public com.google.protobuf.Any getDetails(int index) { + return details_.get(index); + } + + /** + * + * + *
        +     * This corresponds to `google.rpc.Status.details`.
        +     * 
        + * + * repeated .google.protobuf.Any details = 5; + */ + @java.lang.Override + public com.google.protobuf.AnyOrBuilder getDetailsOrBuilder(int index) { + return details_.get(index); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (code_ != 0) { + output.writeInt32(1, code_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(message_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, message_); + } + if (status_ != com.google.rpc.Code.OK.getNumber()) { + output.writeEnum(4, status_); + } + for (int i = 0; i < details_.size(); i++) { + output.writeMessage(5, details_.get(i)); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (code_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(1, code_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(message_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, message_); + } + if (status_ != com.google.rpc.Code.OK.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(4, status_); + } + for (int i = 0; i < details_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(5, details_.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.showcase.v1beta1.RestError.Status)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.RestError.Status other = + (com.google.showcase.v1beta1.RestError.Status) obj; + + if (getCode() != other.getCode()) return false; + if (!getMessage().equals(other.getMessage())) return false; + if (status_ != other.status_) return false; + if (!getDetailsList().equals(other.getDetailsList())) 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) + CODE_FIELD_NUMBER; + hash = (53 * hash) + getCode(); + hash = (37 * hash) + MESSAGE_FIELD_NUMBER; + hash = (53 * hash) + getMessage().hashCode(); + hash = (37 * hash) + STATUS_FIELD_NUMBER; + hash = (53 * hash) + status_; + if (getDetailsCount() > 0) { + hash = (37 * hash) + DETAILS_FIELD_NUMBER; + hash = (53 * hash) + getDetailsList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.showcase.v1beta1.RestError.Status parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.RestError.Status parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.RestError.Status parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.RestError.Status 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.showcase.v1beta1.RestError.Status parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.RestError.Status parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.RestError.Status parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.RestError.Status parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.showcase.v1beta1.RestError.Status parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.RestError.Status parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.showcase.v1beta1.RestError.Status parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.RestError.Status parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.showcase.v1beta1.RestError.Status 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** Protobuf type {@code google.showcase.v1beta1.RestError.Status} */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.RestError.Status) + com.google.showcase.v1beta1.RestError.StatusOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.RestErrorOuterClass + .internal_static_google_showcase_v1beta1_RestError_Status_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.RestErrorOuterClass + .internal_static_google_showcase_v1beta1_RestError_Status_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.RestError.Status.class, + com.google.showcase.v1beta1.RestError.Status.Builder.class); + } + + // Construct using com.google.showcase.v1beta1.RestError.Status.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + code_ = 0; + message_ = ""; + status_ = 0; + if (detailsBuilder_ == null) { + details_ = java.util.Collections.emptyList(); + } else { + details_ = null; + detailsBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000008); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.showcase.v1beta1.RestErrorOuterClass + .internal_static_google_showcase_v1beta1_RestError_Status_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.RestError.Status getDefaultInstanceForType() { + return com.google.showcase.v1beta1.RestError.Status.getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.RestError.Status build() { + com.google.showcase.v1beta1.RestError.Status result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.RestError.Status buildPartial() { + com.google.showcase.v1beta1.RestError.Status result = + new com.google.showcase.v1beta1.RestError.Status(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields(com.google.showcase.v1beta1.RestError.Status result) { + if (detailsBuilder_ == null) { + if (((bitField0_ & 0x00000008) != 0)) { + details_ = java.util.Collections.unmodifiableList(details_); + bitField0_ = (bitField0_ & ~0x00000008); + } + result.details_ = details_; + } else { + result.details_ = detailsBuilder_.build(); + } + } + + private void buildPartial0(com.google.showcase.v1beta1.RestError.Status result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.code_ = code_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.message_ = message_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.status_ = status_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.showcase.v1beta1.RestError.Status) { + return mergeFrom((com.google.showcase.v1beta1.RestError.Status) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.showcase.v1beta1.RestError.Status other) { + if (other == com.google.showcase.v1beta1.RestError.Status.getDefaultInstance()) return this; + if (other.getCode() != 0) { + setCode(other.getCode()); + } + if (!other.getMessage().isEmpty()) { + message_ = other.message_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (other.status_ != 0) { + setStatusValue(other.getStatusValue()); + } + if (detailsBuilder_ == null) { + if (!other.details_.isEmpty()) { + if (details_.isEmpty()) { + details_ = other.details_; + bitField0_ = (bitField0_ & ~0x00000008); + } else { + ensureDetailsIsMutable(); + details_.addAll(other.details_); + } + onChanged(); + } + } else { + if (!other.details_.isEmpty()) { + if (detailsBuilder_.isEmpty()) { + detailsBuilder_.dispose(); + detailsBuilder_ = null; + details_ = other.details_; + bitField0_ = (bitField0_ & ~0x00000008); + detailsBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders + ? internalGetDetailsFieldBuilder() + : null; + } else { + detailsBuilder_.addAllMessages(other.details_); + } + } + } + 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: + { + code_ = input.readInt32(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 18: + { + message_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 32: + { + status_ = input.readEnum(); + bitField0_ |= 0x00000004; + break; + } // case 32 + case 42: + { + com.google.protobuf.Any m = + input.readMessage(com.google.protobuf.Any.parser(), extensionRegistry); + if (detailsBuilder_ == null) { + ensureDetailsIsMutable(); + details_.add(m); + } else { + detailsBuilder_.addMessage(m); + } + 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 int code_; + + /** + * + * + *
        +       * The HTTP status code that corresponds to `google.rpc.Status.code`.
        +       * 
        + * + * int32 code = 1; + * + * @return The code. + */ + @java.lang.Override + public int getCode() { + return code_; + } + + /** + * + * + *
        +       * The HTTP status code that corresponds to `google.rpc.Status.code`.
        +       * 
        + * + * int32 code = 1; + * + * @param value The code to set. + * @return This builder for chaining. + */ + public Builder setCode(int value) { + + code_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
        +       * The HTTP status code that corresponds to `google.rpc.Status.code`.
        +       * 
        + * + * int32 code = 1; + * + * @return This builder for chaining. + */ + public Builder clearCode() { + bitField0_ = (bitField0_ & ~0x00000001); + code_ = 0; + onChanged(); + return this; + } + + private java.lang.Object message_ = ""; + + /** + * + * + *
        +       * This corresponds to `google.rpc.Status.message`.
        +       * 
        + * + * string message = 2; + * + * @return The message. + */ + public java.lang.String getMessage() { + java.lang.Object ref = message_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + message_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
        +       * This corresponds to `google.rpc.Status.message`.
        +       * 
        + * + * string message = 2; + * + * @return The bytes for message. + */ + public com.google.protobuf.ByteString getMessageBytes() { + java.lang.Object ref = message_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + message_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
        +       * This corresponds to `google.rpc.Status.message`.
        +       * 
        + * + * string message = 2; + * + * @param value The message to set. + * @return This builder for chaining. + */ + public Builder setMessage(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + message_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
        +       * This corresponds to `google.rpc.Status.message`.
        +       * 
        + * + * string message = 2; + * + * @return This builder for chaining. + */ + public Builder clearMessage() { + message_ = getDefaultInstance().getMessage(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
        +       * This corresponds to `google.rpc.Status.message`.
        +       * 
        + * + * string message = 2; + * + * @param value The bytes for message to set. + * @return This builder for chaining. + */ + public Builder setMessageBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + message_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private int status_ = 0; + + /** + * + * + *
        +       * This is the enum version for `google.rpc.Status.code`.
        +       * 
        + * + * .google.rpc.Code status = 4; + * + * @return The enum numeric value on the wire for status. + */ + @java.lang.Override + public int getStatusValue() { + return status_; + } + + /** + * + * + *
        +       * This is the enum version for `google.rpc.Status.code`.
        +       * 
        + * + * .google.rpc.Code status = 4; + * + * @param value The enum numeric value on the wire for status to set. + * @return This builder for chaining. + */ + public Builder setStatusValue(int value) { + status_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
        +       * This is the enum version for `google.rpc.Status.code`.
        +       * 
        + * + * .google.rpc.Code status = 4; + * + * @return The status. + */ + @java.lang.Override + public com.google.rpc.Code getStatus() { + com.google.rpc.Code result = com.google.rpc.Code.forNumber(status_); + return result == null ? com.google.rpc.Code.UNRECOGNIZED : result; + } + + /** + * + * + *
        +       * This is the enum version for `google.rpc.Status.code`.
        +       * 
        + * + * .google.rpc.Code status = 4; + * + * @param value The status to set. + * @return This builder for chaining. + */ + public Builder setStatus(com.google.rpc.Code value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000004; + status_ = value.getNumber(); + onChanged(); + return this; + } + + /** + * + * + *
        +       * This is the enum version for `google.rpc.Status.code`.
        +       * 
        + * + * .google.rpc.Code status = 4; + * + * @return This builder for chaining. + */ + public Builder clearStatus() { + bitField0_ = (bitField0_ & ~0x00000004); + status_ = 0; + onChanged(); + return this; + } + + private java.util.List details_ = java.util.Collections.emptyList(); + + private void ensureDetailsIsMutable() { + if (!((bitField0_ & 0x00000008) != 0)) { + details_ = new java.util.ArrayList(details_); + bitField0_ |= 0x00000008; + } + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.google.protobuf.Any, + com.google.protobuf.Any.Builder, + com.google.protobuf.AnyOrBuilder> + detailsBuilder_; + + /** + * + * + *
        +       * This corresponds to `google.rpc.Status.details`.
        +       * 
        + * + * repeated .google.protobuf.Any details = 5; + */ + public java.util.List getDetailsList() { + if (detailsBuilder_ == null) { + return java.util.Collections.unmodifiableList(details_); + } else { + return detailsBuilder_.getMessageList(); + } + } + + /** + * + * + *
        +       * This corresponds to `google.rpc.Status.details`.
        +       * 
        + * + * repeated .google.protobuf.Any details = 5; + */ + public int getDetailsCount() { + if (detailsBuilder_ == null) { + return details_.size(); + } else { + return detailsBuilder_.getCount(); + } + } + + /** + * + * + *
        +       * This corresponds to `google.rpc.Status.details`.
        +       * 
        + * + * repeated .google.protobuf.Any details = 5; + */ + public com.google.protobuf.Any getDetails(int index) { + if (detailsBuilder_ == null) { + return details_.get(index); + } else { + return detailsBuilder_.getMessage(index); + } + } + + /** + * + * + *
        +       * This corresponds to `google.rpc.Status.details`.
        +       * 
        + * + * repeated .google.protobuf.Any details = 5; + */ + public Builder setDetails(int index, com.google.protobuf.Any value) { + if (detailsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureDetailsIsMutable(); + details_.set(index, value); + onChanged(); + } else { + detailsBuilder_.setMessage(index, value); + } + return this; + } + + /** + * + * + *
        +       * This corresponds to `google.rpc.Status.details`.
        +       * 
        + * + * repeated .google.protobuf.Any details = 5; + */ + public Builder setDetails(int index, com.google.protobuf.Any.Builder builderForValue) { + if (detailsBuilder_ == null) { + ensureDetailsIsMutable(); + details_.set(index, builderForValue.build()); + onChanged(); + } else { + detailsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
        +       * This corresponds to `google.rpc.Status.details`.
        +       * 
        + * + * repeated .google.protobuf.Any details = 5; + */ + public Builder addDetails(com.google.protobuf.Any value) { + if (detailsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureDetailsIsMutable(); + details_.add(value); + onChanged(); + } else { + detailsBuilder_.addMessage(value); + } + return this; + } + + /** + * + * + *
        +       * This corresponds to `google.rpc.Status.details`.
        +       * 
        + * + * repeated .google.protobuf.Any details = 5; + */ + public Builder addDetails(int index, com.google.protobuf.Any value) { + if (detailsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureDetailsIsMutable(); + details_.add(index, value); + onChanged(); + } else { + detailsBuilder_.addMessage(index, value); + } + return this; + } + + /** + * + * + *
        +       * This corresponds to `google.rpc.Status.details`.
        +       * 
        + * + * repeated .google.protobuf.Any details = 5; + */ + public Builder addDetails(com.google.protobuf.Any.Builder builderForValue) { + if (detailsBuilder_ == null) { + ensureDetailsIsMutable(); + details_.add(builderForValue.build()); + onChanged(); + } else { + detailsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + + /** + * + * + *
        +       * This corresponds to `google.rpc.Status.details`.
        +       * 
        + * + * repeated .google.protobuf.Any details = 5; + */ + public Builder addDetails(int index, com.google.protobuf.Any.Builder builderForValue) { + if (detailsBuilder_ == null) { + ensureDetailsIsMutable(); + details_.add(index, builderForValue.build()); + onChanged(); + } else { + detailsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
        +       * This corresponds to `google.rpc.Status.details`.
        +       * 
        + * + * repeated .google.protobuf.Any details = 5; + */ + public Builder addAllDetails(java.lang.Iterable values) { + if (detailsBuilder_ == null) { + ensureDetailsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, details_); + onChanged(); + } else { + detailsBuilder_.addAllMessages(values); + } + return this; + } + + /** + * + * + *
        +       * This corresponds to `google.rpc.Status.details`.
        +       * 
        + * + * repeated .google.protobuf.Any details = 5; + */ + public Builder clearDetails() { + if (detailsBuilder_ == null) { + details_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + } else { + detailsBuilder_.clear(); + } + return this; + } + + /** + * + * + *
        +       * This corresponds to `google.rpc.Status.details`.
        +       * 
        + * + * repeated .google.protobuf.Any details = 5; + */ + public Builder removeDetails(int index) { + if (detailsBuilder_ == null) { + ensureDetailsIsMutable(); + details_.remove(index); + onChanged(); + } else { + detailsBuilder_.remove(index); + } + return this; + } + + /** + * + * + *
        +       * This corresponds to `google.rpc.Status.details`.
        +       * 
        + * + * repeated .google.protobuf.Any details = 5; + */ + public com.google.protobuf.Any.Builder getDetailsBuilder(int index) { + return internalGetDetailsFieldBuilder().getBuilder(index); + } + + /** + * + * + *
        +       * This corresponds to `google.rpc.Status.details`.
        +       * 
        + * + * repeated .google.protobuf.Any details = 5; + */ + public com.google.protobuf.AnyOrBuilder getDetailsOrBuilder(int index) { + if (detailsBuilder_ == null) { + return details_.get(index); + } else { + return detailsBuilder_.getMessageOrBuilder(index); + } + } + + /** + * + * + *
        +       * This corresponds to `google.rpc.Status.details`.
        +       * 
        + * + * repeated .google.protobuf.Any details = 5; + */ + public java.util.List getDetailsOrBuilderList() { + if (detailsBuilder_ != null) { + return detailsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(details_); + } + } + + /** + * + * + *
        +       * This corresponds to `google.rpc.Status.details`.
        +       * 
        + * + * repeated .google.protobuf.Any details = 5; + */ + public com.google.protobuf.Any.Builder addDetailsBuilder() { + return internalGetDetailsFieldBuilder() + .addBuilder(com.google.protobuf.Any.getDefaultInstance()); + } + + /** + * + * + *
        +       * This corresponds to `google.rpc.Status.details`.
        +       * 
        + * + * repeated .google.protobuf.Any details = 5; + */ + public com.google.protobuf.Any.Builder addDetailsBuilder(int index) { + return internalGetDetailsFieldBuilder() + .addBuilder(index, com.google.protobuf.Any.getDefaultInstance()); + } + + /** + * + * + *
        +       * This corresponds to `google.rpc.Status.details`.
        +       * 
        + * + * repeated .google.protobuf.Any details = 5; + */ + public java.util.List getDetailsBuilderList() { + return internalGetDetailsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.google.protobuf.Any, + com.google.protobuf.Any.Builder, + com.google.protobuf.AnyOrBuilder> + internalGetDetailsFieldBuilder() { + if (detailsBuilder_ == null) { + detailsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilder< + com.google.protobuf.Any, + com.google.protobuf.Any.Builder, + com.google.protobuf.AnyOrBuilder>( + details_, ((bitField0_ & 0x00000008) != 0), getParentForChildren(), isClean()); + details_ = null; + } + return detailsBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.showcase.v1beta1.RestError.Status) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.RestError.Status) + private static final com.google.showcase.v1beta1.RestError.Status DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.RestError.Status(); + } + + public static com.google.showcase.v1beta1.RestError.Status getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Status 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.showcase.v1beta1.RestError.Status getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + private int bitField0_; + public static final int ERROR_FIELD_NUMBER = 1; + private com.google.showcase.v1beta1.RestError.Status error_; + + /** + * .google.showcase.v1beta1.RestError.Status error = 1; + * + * @return Whether the error field is set. + */ + @java.lang.Override + public boolean hasError() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * .google.showcase.v1beta1.RestError.Status error = 1; + * + * @return The error. + */ + @java.lang.Override + public com.google.showcase.v1beta1.RestError.Status getError() { + return error_ == null + ? com.google.showcase.v1beta1.RestError.Status.getDefaultInstance() + : error_; + } + + /** .google.showcase.v1beta1.RestError.Status error = 1; */ + @java.lang.Override + public com.google.showcase.v1beta1.RestError.StatusOrBuilder getErrorOrBuilder() { + return error_ == null + ? com.google.showcase.v1beta1.RestError.Status.getDefaultInstance() + : error_; + } + + 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, getError()); + } + 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, getError()); + } + 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.showcase.v1beta1.RestError)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.RestError other = (com.google.showcase.v1beta1.RestError) obj; + + if (hasError() != other.hasError()) return false; + if (hasError()) { + if (!getError().equals(other.getError())) 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 (hasError()) { + hash = (37 * hash) + ERROR_FIELD_NUMBER; + hash = (53 * hash) + getError().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.showcase.v1beta1.RestError parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.RestError parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.RestError parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.RestError 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.showcase.v1beta1.RestError parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.RestError parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.RestError parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.RestError parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.showcase.v1beta1.RestError parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.RestError parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.showcase.v1beta1.RestError parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.RestError parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.showcase.v1beta1.RestError 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
        +   * HTTP/JSON error representation as defined in
        +   * https://google.aip.dev/193#http11json-representation,
        +   * 
        + * + * Protobuf type {@code google.showcase.v1beta1.RestError} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.RestError) + com.google.showcase.v1beta1.RestErrorOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.RestErrorOuterClass + .internal_static_google_showcase_v1beta1_RestError_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.RestErrorOuterClass + .internal_static_google_showcase_v1beta1_RestError_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.RestError.class, + com.google.showcase.v1beta1.RestError.Builder.class); + } + + // Construct using com.google.showcase.v1beta1.RestError.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetErrorFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + error_ = null; + if (errorBuilder_ != null) { + errorBuilder_.dispose(); + errorBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.showcase.v1beta1.RestErrorOuterClass + .internal_static_google_showcase_v1beta1_RestError_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.RestError getDefaultInstanceForType() { + return com.google.showcase.v1beta1.RestError.getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.RestError build() { + com.google.showcase.v1beta1.RestError result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.RestError buildPartial() { + com.google.showcase.v1beta1.RestError result = + new com.google.showcase.v1beta1.RestError(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.showcase.v1beta1.RestError result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.error_ = errorBuilder_ == null ? error_ : errorBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.showcase.v1beta1.RestError) { + return mergeFrom((com.google.showcase.v1beta1.RestError) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.showcase.v1beta1.RestError other) { + if (other == com.google.showcase.v1beta1.RestError.getDefaultInstance()) return this; + if (other.hasError()) { + mergeError(other.getError()); + } + 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(internalGetErrorFieldBuilder().getBuilder(), extensionRegistry); + 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 com.google.showcase.v1beta1.RestError.Status error_; + private com.google.protobuf.SingleFieldBuilder< + com.google.showcase.v1beta1.RestError.Status, + com.google.showcase.v1beta1.RestError.Status.Builder, + com.google.showcase.v1beta1.RestError.StatusOrBuilder> + errorBuilder_; + + /** + * .google.showcase.v1beta1.RestError.Status error = 1; + * + * @return Whether the error field is set. + */ + public boolean hasError() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * .google.showcase.v1beta1.RestError.Status error = 1; + * + * @return The error. + */ + public com.google.showcase.v1beta1.RestError.Status getError() { + if (errorBuilder_ == null) { + return error_ == null + ? com.google.showcase.v1beta1.RestError.Status.getDefaultInstance() + : error_; + } else { + return errorBuilder_.getMessage(); + } + } + + /** .google.showcase.v1beta1.RestError.Status error = 1; */ + public Builder setError(com.google.showcase.v1beta1.RestError.Status value) { + if (errorBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + error_ = value; + } else { + errorBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** .google.showcase.v1beta1.RestError.Status error = 1; */ + public Builder setError(com.google.showcase.v1beta1.RestError.Status.Builder builderForValue) { + if (errorBuilder_ == null) { + error_ = builderForValue.build(); + } else { + errorBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** .google.showcase.v1beta1.RestError.Status error = 1; */ + public Builder mergeError(com.google.showcase.v1beta1.RestError.Status value) { + if (errorBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) + && error_ != null + && error_ != com.google.showcase.v1beta1.RestError.Status.getDefaultInstance()) { + getErrorBuilder().mergeFrom(value); + } else { + error_ = value; + } + } else { + errorBuilder_.mergeFrom(value); + } + if (error_ != null) { + bitField0_ |= 0x00000001; + onChanged(); + } + return this; + } + + /** .google.showcase.v1beta1.RestError.Status error = 1; */ + public Builder clearError() { + bitField0_ = (bitField0_ & ~0x00000001); + error_ = null; + if (errorBuilder_ != null) { + errorBuilder_.dispose(); + errorBuilder_ = null; + } + onChanged(); + return this; + } + + /** .google.showcase.v1beta1.RestError.Status error = 1; */ + public com.google.showcase.v1beta1.RestError.Status.Builder getErrorBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return internalGetErrorFieldBuilder().getBuilder(); + } + + /** .google.showcase.v1beta1.RestError.Status error = 1; */ + public com.google.showcase.v1beta1.RestError.StatusOrBuilder getErrorOrBuilder() { + if (errorBuilder_ != null) { + return errorBuilder_.getMessageOrBuilder(); + } else { + return error_ == null + ? com.google.showcase.v1beta1.RestError.Status.getDefaultInstance() + : error_; + } + } + + /** .google.showcase.v1beta1.RestError.Status error = 1; */ + private com.google.protobuf.SingleFieldBuilder< + com.google.showcase.v1beta1.RestError.Status, + com.google.showcase.v1beta1.RestError.Status.Builder, + com.google.showcase.v1beta1.RestError.StatusOrBuilder> + internalGetErrorFieldBuilder() { + if (errorBuilder_ == null) { + errorBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.showcase.v1beta1.RestError.Status, + com.google.showcase.v1beta1.RestError.Status.Builder, + com.google.showcase.v1beta1.RestError.StatusOrBuilder>( + getError(), getParentForChildren(), isClean()); + error_ = null; + } + return errorBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.showcase.v1beta1.RestError) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.RestError) + private static final com.google.showcase.v1beta1.RestError DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.RestError(); + } + + public static com.google.showcase.v1beta1.RestError getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public RestError 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.showcase.v1beta1.RestError getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/RestErrorOrBuilder.java b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/RestErrorOrBuilder.java new file mode 100644 index 0000000000..e67ab4eea5 --- /dev/null +++ b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/RestErrorOrBuilder.java @@ -0,0 +1,45 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: schema/google/showcase/v1beta1/rest_error.proto +// Protobuf Java Version: 4.33.2 + +package com.google.showcase.v1beta1; + +@com.google.protobuf.Generated +public interface RestErrorOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.RestError) + com.google.protobuf.MessageOrBuilder { + + /** + * .google.showcase.v1beta1.RestError.Status error = 1; + * + * @return Whether the error field is set. + */ + boolean hasError(); + + /** + * .google.showcase.v1beta1.RestError.Status error = 1; + * + * @return The error. + */ + com.google.showcase.v1beta1.RestError.Status getError(); + + /** .google.showcase.v1beta1.RestError.Status error = 1; */ + com.google.showcase.v1beta1.RestError.StatusOrBuilder getErrorOrBuilder(); +} diff --git a/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/RestErrorOuterClass.java b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/RestErrorOuterClass.java new file mode 100644 index 0000000000..2781ab4677 --- /dev/null +++ b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/RestErrorOuterClass.java @@ -0,0 +1,101 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: schema/google/showcase/v1beta1/rest_error.proto +// Protobuf Java Version: 4.33.2 + +package com.google.showcase.v1beta1; + +@com.google.protobuf.Generated +public final class RestErrorOuterClass extends com.google.protobuf.GeneratedFile { + private RestErrorOuterClass() {} + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "RestErrorOuterClass"); + } + + 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_showcase_v1beta1_RestError_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_showcase_v1beta1_RestError_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_showcase_v1beta1_RestError_Status_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_showcase_v1beta1_RestError_Status_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/schema/google/showcase/v1beta1/rest_er" + + "ror.proto\022\027google.showcase.v1beta1\032\031goog" + + "le/protobuf/any.proto\032\025google/rpc/code.p" + + "roto\"\267\001\n\tRestError\0228\n\005error\030\001 \001(\0132).goog" + + "le.showcase.v1beta1.RestError.Status\032p\n\006" + + "Status\022\014\n\004code\030\001 \001(\005\022\017\n\007message\030\002 \001(\t\022 \n" + + "\006status\030\004 \001(\0162\020.google.rpc.Code\022%\n\007detai" + + "ls\030\005 \003(\0132\024.google.protobuf.AnyBq\n\033com.go" + + "ogle.showcase.v1beta1P\001Z4github.com/goog" + + "leapis/gapic-showcase/server/genproto\352\002\031" + + "Google::Showcase::V1beta1b\006proto3" + }; + descriptor = + com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( + descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + com.google.protobuf.AnyProto.getDescriptor(), + com.google.rpc.CodeProto.getDescriptor(), + }); + internal_static_google_showcase_v1beta1_RestError_descriptor = + getDescriptor().getMessageType(0); + internal_static_google_showcase_v1beta1_RestError_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_showcase_v1beta1_RestError_descriptor, + new java.lang.String[] { + "Error", + }); + internal_static_google_showcase_v1beta1_RestError_Status_descriptor = + internal_static_google_showcase_v1beta1_RestError_descriptor.getNestedType(0); + internal_static_google_showcase_v1beta1_RestError_Status_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_showcase_v1beta1_RestError_Status_descriptor, + new java.lang.String[] { + "Code", "Message", "Status", "Details", + }); + descriptor.resolveAllFeaturesImmutable(); + com.google.protobuf.AnyProto.getDescriptor(); + com.google.rpc.CodeProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/Room.java b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/Room.java new file mode 100644 index 0000000000..de93772992 --- /dev/null +++ b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/Room.java @@ -0,0 +1,1576 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: schema/google/showcase/v1beta1/messaging.proto +// Protobuf Java Version: 4.33.2 + +package com.google.showcase.v1beta1; + +/** + * + * + *
        + * A chat room.
        + * 
        + * + * Protobuf type {@code google.showcase.v1beta1.Room} + */ +@com.google.protobuf.Generated +public final class Room extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.Room) + RoomOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "Room"); + } + + // Use Room.newBuilder() to construct. + private Room(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private Room() { + name_ = ""; + displayName_ = ""; + description_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.MessagingOuterClass + .internal_static_google_showcase_v1beta1_Room_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.MessagingOuterClass + .internal_static_google_showcase_v1beta1_Room_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.Room.class, com.google.showcase.v1beta1.Room.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 chat room.
        +   * 
        + * + * 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 chat room.
        +   * 
        + * + * 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 DISPLAY_NAME_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object displayName_ = ""; + + /** + * + * + *
        +   * The human readable name of the chat room.
        +   * 
        + * + * string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The displayName. + */ + @java.lang.Override + public java.lang.String getDisplayName() { + java.lang.Object ref = displayName_; + 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(); + displayName_ = s; + return s; + } + } + + /** + * + * + *
        +   * The human readable name of the chat room.
        +   * 
        + * + * string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for displayName. + */ + @java.lang.Override + public com.google.protobuf.ByteString getDisplayNameBytes() { + java.lang.Object ref = displayName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + displayName_ = 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_ = ""; + + /** + * + * + *
        +   * The description of the chat room.
        +   * 
        + * + * 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; + } + } + + /** + * + * + *
        +   * The description of the chat room.
        +   * 
        + * + * 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_; + + /** + * + * + *
        +   * The timestamp at which the room was created.
        +   * 
        + * + * .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); + } + + /** + * + * + *
        +   * The timestamp at which the room was created.
        +   * 
        + * + * .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_; + } + + /** + * + * + *
        +   * The timestamp at which the room was created.
        +   * 
        + * + * .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_; + + /** + * + * + *
        +   * The latest timestamp at which the room was updated.
        +   * 
        + * + * .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the updateTime field is set. + */ + @java.lang.Override + public boolean hasUpdateTime() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
        +   * The latest timestamp at which the room was updated.
        +   * 
        + * + * .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The updateTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getUpdateTime() { + return updateTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : updateTime_; + } + + /** + * + * + *
        +   * The latest timestamp at which the room was updated.
        +   * 
        + * + * .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_; + } + + 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.GeneratedMessage.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, name_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(displayName_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, displayName_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(description_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 3, description_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(4, getCreateTime()); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeMessage(5, getUpdateTime()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, name_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(displayName_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, displayName_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(description_)) { + size += com.google.protobuf.GeneratedMessage.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()); + } + 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.showcase.v1beta1.Room)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.Room other = (com.google.showcase.v1beta1.Room) obj; + + if (!getName().equals(other.getName())) return false; + if (!getDisplayName().equals(other.getDisplayName())) 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 (!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) + DISPLAY_NAME_FIELD_NUMBER; + hash = (53 * hash) + getDisplayName().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 = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.showcase.v1beta1.Room parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.Room parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.Room parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.Room 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.showcase.v1beta1.Room parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.Room parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.Room parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.Room parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.showcase.v1beta1.Room parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.Room parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.showcase.v1beta1.Room parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.Room parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.showcase.v1beta1.Room 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
        +   * A chat room.
        +   * 
        + * + * Protobuf type {@code google.showcase.v1beta1.Room} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.Room) + com.google.showcase.v1beta1.RoomOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.MessagingOuterClass + .internal_static_google_showcase_v1beta1_Room_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.MessagingOuterClass + .internal_static_google_showcase_v1beta1_Room_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.Room.class, + com.google.showcase.v1beta1.Room.Builder.class); + } + + // Construct using com.google.showcase.v1beta1.Room.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetCreateTimeFieldBuilder(); + internalGetUpdateTimeFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + displayName_ = ""; + description_ = ""; + 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.showcase.v1beta1.MessagingOuterClass + .internal_static_google_showcase_v1beta1_Room_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.Room getDefaultInstanceForType() { + return com.google.showcase.v1beta1.Room.getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.Room build() { + com.google.showcase.v1beta1.Room result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.Room buildPartial() { + com.google.showcase.v1beta1.Room result = new com.google.showcase.v1beta1.Room(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.showcase.v1beta1.Room result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.displayName_ = displayName_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.description_ = description_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000008) != 0)) { + result.createTime_ = createTimeBuilder_ == null ? createTime_ : createTimeBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.updateTime_ = updateTimeBuilder_ == null ? updateTime_ : updateTimeBuilder_.build(); + to_bitField0_ |= 0x00000002; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.showcase.v1beta1.Room) { + return mergeFrom((com.google.showcase.v1beta1.Room) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.showcase.v1beta1.Room other) { + if (other == com.google.showcase.v1beta1.Room.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getDisplayName().isEmpty()) { + displayName_ = other.displayName_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (!other.getDescription().isEmpty()) { + description_ = other.description_; + bitField0_ |= 0x00000004; + onChanged(); + } + 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: + { + displayName_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + description_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 34: + { + input.readMessage( + internalGetCreateTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000008; + break; + } // case 34 + case 42: + { + input.readMessage( + internalGetUpdateTimeFieldBuilder().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 chat room.
        +     * 
        + * + * 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 chat room.
        +     * 
        + * + * 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 chat room.
        +     * 
        + * + * 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 chat room.
        +     * 
        + * + * 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 chat room.
        +     * 
        + * + * 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 displayName_ = ""; + + /** + * + * + *
        +     * The human readable name of the chat room.
        +     * 
        + * + * string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The displayName. + */ + public java.lang.String getDisplayName() { + java.lang.Object ref = displayName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + displayName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
        +     * The human readable name of the chat room.
        +     * 
        + * + * string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for displayName. + */ + public com.google.protobuf.ByteString getDisplayNameBytes() { + java.lang.Object ref = displayName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + displayName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
        +     * The human readable name of the chat room.
        +     * 
        + * + * string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The displayName to set. + * @return This builder for chaining. + */ + public Builder setDisplayName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + displayName_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
        +     * The human readable name of the chat room.
        +     * 
        + * + * string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearDisplayName() { + displayName_ = getDefaultInstance().getDisplayName(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
        +     * The human readable name of the chat room.
        +     * 
        + * + * string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for displayName to set. + * @return This builder for chaining. + */ + public Builder setDisplayNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + displayName_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private java.lang.Object description_ = ""; + + /** + * + * + *
        +     * The description of the chat room.
        +     * 
        + * + * 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; + } + } + + /** + * + * + *
        +     * The description of the chat room.
        +     * 
        + * + * 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; + } + } + + /** + * + * + *
        +     * The description of the chat room.
        +     * 
        + * + * 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_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
        +     * The description of the chat room.
        +     * 
        + * + * string description = 3; + * + * @return This builder for chaining. + */ + public Builder clearDescription() { + description_ = getDefaultInstance().getDescription(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + + /** + * + * + *
        +     * The description of the chat room.
        +     * 
        + * + * 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_ |= 0x00000004; + onChanged(); + return this; + } + + private com.google.protobuf.Timestamp createTime_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + createTimeBuilder_; + + /** + * + * + *
        +     * The timestamp at which the room was created.
        +     * 
        + * + * + * .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the createTime field is set. + */ + public boolean hasCreateTime() { + return ((bitField0_ & 0x00000008) != 0); + } + + /** + * + * + *
        +     * The timestamp at which the room was created.
        +     * 
        + * + * + * .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(); + } + } + + /** + * + * + *
        +     * The timestamp at which the room was created.
        +     * 
        + * + * + * .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_ |= 0x00000008; + onChanged(); + return this; + } + + /** + * + * + *
        +     * The timestamp at which the room was created.
        +     * 
        + * + * + * .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_ |= 0x00000008; + onChanged(); + return this; + } + + /** + * + * + *
        +     * The timestamp at which the room was created.
        +     * 
        + * + * + * .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_ & 0x00000008) != 0) + && createTime_ != null + && createTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getCreateTimeBuilder().mergeFrom(value); + } else { + createTime_ = value; + } + } else { + createTimeBuilder_.mergeFrom(value); + } + if (createTime_ != null) { + bitField0_ |= 0x00000008; + onChanged(); + } + return this; + } + + /** + * + * + *
        +     * The timestamp at which the room was created.
        +     * 
        + * + * + * .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearCreateTime() { + bitField0_ = (bitField0_ & ~0x00000008); + createTime_ = null; + if (createTimeBuilder_ != null) { + createTimeBuilder_.dispose(); + createTimeBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
        +     * The timestamp at which the room was created.
        +     * 
        + * + * + * .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.Timestamp.Builder getCreateTimeBuilder() { + bitField0_ |= 0x00000008; + onChanged(); + return internalGetCreateTimeFieldBuilder().getBuilder(); + } + + /** + * + * + *
        +     * The timestamp at which the room was created.
        +     * 
        + * + * + * .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_; + } + } + + /** + * + * + *
        +     * The timestamp at which the room was created.
        +     * 
        + * + * + * .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + internalGetCreateTimeFieldBuilder() { + if (createTimeBuilder_ == null) { + createTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + 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.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + updateTimeBuilder_; + + /** + * + * + *
        +     * The latest timestamp at which the room was updated.
        +     * 
        + * + * + * .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the updateTime field is set. + */ + public boolean hasUpdateTime() { + return ((bitField0_ & 0x00000010) != 0); + } + + /** + * + * + *
        +     * The latest timestamp at which the room was updated.
        +     * 
        + * + * + * .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The updateTime. + */ + public com.google.protobuf.Timestamp getUpdateTime() { + if (updateTimeBuilder_ == null) { + return updateTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : updateTime_; + } else { + return updateTimeBuilder_.getMessage(); + } + } + + /** + * + * + *
        +     * The latest timestamp at which the room was updated.
        +     * 
        + * + * + * .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setUpdateTime(com.google.protobuf.Timestamp value) { + if (updateTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + updateTime_ = value; + } else { + updateTimeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + /** + * + * + *
        +     * The latest timestamp at which the room was updated.
        +     * 
        + * + * + * .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setUpdateTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (updateTimeBuilder_ == null) { + updateTime_ = builderForValue.build(); + } else { + updateTimeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + /** + * + * + *
        +     * The latest timestamp at which the room was updated.
        +     * 
        + * + * + * .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeUpdateTime(com.google.protobuf.Timestamp value) { + if (updateTimeBuilder_ == null) { + if (((bitField0_ & 0x00000010) != 0) + && updateTime_ != null + && updateTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getUpdateTimeBuilder().mergeFrom(value); + } else { + updateTime_ = value; + } + } else { + updateTimeBuilder_.mergeFrom(value); + } + if (updateTime_ != null) { + bitField0_ |= 0x00000010; + onChanged(); + } + return this; + } + + /** + * + * + *
        +     * The latest timestamp at which the room was updated.
        +     * 
        + * + * + * .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearUpdateTime() { + bitField0_ = (bitField0_ & ~0x00000010); + updateTime_ = null; + if (updateTimeBuilder_ != null) { + updateTimeBuilder_.dispose(); + updateTimeBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
        +     * The latest timestamp at which the room was updated.
        +     * 
        + * + * + * .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.Timestamp.Builder getUpdateTimeBuilder() { + bitField0_ |= 0x00000010; + onChanged(); + return internalGetUpdateTimeFieldBuilder().getBuilder(); + } + + /** + * + * + *
        +     * The latest timestamp at which the room was updated.
        +     * 
        + * + * + * .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder() { + if (updateTimeBuilder_ != null) { + return updateTimeBuilder_.getMessageOrBuilder(); + } else { + return updateTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : updateTime_; + } + } + + /** + * + * + *
        +     * The latest timestamp at which the room was updated.
        +     * 
        + * + * + * .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + internalGetUpdateTimeFieldBuilder() { + if (updateTimeBuilder_ == null) { + updateTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getUpdateTime(), getParentForChildren(), isClean()); + updateTime_ = null; + } + return updateTimeBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.showcase.v1beta1.Room) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.Room) + private static final com.google.showcase.v1beta1.Room DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.Room(); + } + + public static com.google.showcase.v1beta1.Room getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Room 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.showcase.v1beta1.Room getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/RoomName.java b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/RoomName.java new file mode 100644 index 0000000000..1dbb32e73c --- /dev/null +++ b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/RoomName.java @@ -0,0 +1,166 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1; + +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +@Generated("by gapic-generator-java") +public class RoomName implements ResourceName { + private static final PathTemplate ROOM = PathTemplate.createWithoutUrlEncoding("rooms/{room}"); + private volatile Map fieldValuesMap; + private final String room; + + @Deprecated + protected RoomName() { + room = null; + } + + private RoomName(Builder builder) { + room = Preconditions.checkNotNull(builder.getRoom()); + } + + public String getRoom() { + return room; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + public static RoomName of(String room) { + return newBuilder().setRoom(room).build(); + } + + public static String format(String room) { + return newBuilder().setRoom(room).build().toString(); + } + + public static RoomName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + ROOM.validatedMatch(formattedString, "RoomName.parse: formattedString not in valid format"); + return of(matchMap.get("room")); + } + + 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 (RoomName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return ROOM.matches(formattedString); + } + + @Override + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + if (room != null) { + fieldMapBuilder.put("room", room); + } + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return ROOM.instantiate("room", room); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o != null && getClass() == o.getClass()) { + RoomName that = ((RoomName) o); + return Objects.equals(this.room, that.room); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= Objects.hashCode(room); + return h; + } + + /** Builder for rooms/{room}. */ + public static class Builder { + private String room; + + protected Builder() {} + + public String getRoom() { + return room; + } + + public Builder setRoom(String room) { + this.room = room; + return this; + } + + private Builder(RoomName roomName) { + this.room = roomName.room; + } + + public RoomName build() { + return new RoomName(this); + } + } +} diff --git a/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/RoomOrBuilder.java b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/RoomOrBuilder.java new file mode 100644 index 0000000000..61a9a9e936 --- /dev/null +++ b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/RoomOrBuilder.java @@ -0,0 +1,186 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: schema/google/showcase/v1beta1/messaging.proto +// Protobuf Java Version: 4.33.2 + +package com.google.showcase.v1beta1; + +@com.google.protobuf.Generated +public interface RoomOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.Room) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
        +   * The resource name of the chat room.
        +   * 
        + * + * string name = 1; + * + * @return The name. + */ + java.lang.String getName(); + + /** + * + * + *
        +   * The resource name of the chat room.
        +   * 
        + * + * string name = 1; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
        +   * The human readable name of the chat room.
        +   * 
        + * + * string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The displayName. + */ + java.lang.String getDisplayName(); + + /** + * + * + *
        +   * The human readable name of the chat room.
        +   * 
        + * + * string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for displayName. + */ + com.google.protobuf.ByteString getDisplayNameBytes(); + + /** + * + * + *
        +   * The description of the chat room.
        +   * 
        + * + * string description = 3; + * + * @return The description. + */ + java.lang.String getDescription(); + + /** + * + * + *
        +   * The description of the chat room.
        +   * 
        + * + * string description = 3; + * + * @return The bytes for description. + */ + com.google.protobuf.ByteString getDescriptionBytes(); + + /** + * + * + *
        +   * The timestamp at which the room was created.
        +   * 
        + * + * .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the createTime field is set. + */ + boolean hasCreateTime(); + + /** + * + * + *
        +   * The timestamp at which the room was created.
        +   * 
        + * + * .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The createTime. + */ + com.google.protobuf.Timestamp getCreateTime(); + + /** + * + * + *
        +   * The timestamp at which the room was created.
        +   * 
        + * + * .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder(); + + /** + * + * + *
        +   * The latest timestamp at which the room was updated.
        +   * 
        + * + * .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the updateTime field is set. + */ + boolean hasUpdateTime(); + + /** + * + * + *
        +   * The latest timestamp at which the room was updated.
        +   * 
        + * + * .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The updateTime. + */ + com.google.protobuf.Timestamp getUpdateTime(); + + /** + * + * + *
        +   * The latest timestamp at which the room was updated.
        +   * 
        + * + * .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder(); +} diff --git a/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/SearchBlurbsMetadata.java b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/SearchBlurbsMetadata.java new file mode 100644 index 0000000000..b9276d3a69 --- /dev/null +++ b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/SearchBlurbsMetadata.java @@ -0,0 +1,692 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: schema/google/showcase/v1beta1/messaging.proto +// Protobuf Java Version: 4.33.2 + +package com.google.showcase.v1beta1; + +/** + * + * + *
        + * The operation metadata message for the
        + * google.showcase.v1beta1.Messaging\SearchBlurbs method.
        + * 
        + * + * Protobuf type {@code google.showcase.v1beta1.SearchBlurbsMetadata} + */ +@com.google.protobuf.Generated +public final class SearchBlurbsMetadata extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.SearchBlurbsMetadata) + SearchBlurbsMetadataOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "SearchBlurbsMetadata"); + } + + // Use SearchBlurbsMetadata.newBuilder() to construct. + private SearchBlurbsMetadata(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private SearchBlurbsMetadata() {} + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.MessagingOuterClass + .internal_static_google_showcase_v1beta1_SearchBlurbsMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.MessagingOuterClass + .internal_static_google_showcase_v1beta1_SearchBlurbsMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.SearchBlurbsMetadata.class, + com.google.showcase.v1beta1.SearchBlurbsMetadata.Builder.class); + } + + private int bitField0_; + public static final int RETRY_INFO_FIELD_NUMBER = 1; + private com.google.rpc.RetryInfo retryInfo_; + + /** + * + * + *
        +   * This signals to the client when to next poll for response.
        +   * 
        + * + * .google.rpc.RetryInfo retry_info = 1; + * + * @return Whether the retryInfo field is set. + */ + @java.lang.Override + public boolean hasRetryInfo() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
        +   * This signals to the client when to next poll for response.
        +   * 
        + * + * .google.rpc.RetryInfo retry_info = 1; + * + * @return The retryInfo. + */ + @java.lang.Override + public com.google.rpc.RetryInfo getRetryInfo() { + return retryInfo_ == null ? com.google.rpc.RetryInfo.getDefaultInstance() : retryInfo_; + } + + /** + * + * + *
        +   * This signals to the client when to next poll for response.
        +   * 
        + * + * .google.rpc.RetryInfo retry_info = 1; + */ + @java.lang.Override + public com.google.rpc.RetryInfoOrBuilder getRetryInfoOrBuilder() { + return retryInfo_ == null ? com.google.rpc.RetryInfo.getDefaultInstance() : retryInfo_; + } + + 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, getRetryInfo()); + } + 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, getRetryInfo()); + } + 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.showcase.v1beta1.SearchBlurbsMetadata)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.SearchBlurbsMetadata other = + (com.google.showcase.v1beta1.SearchBlurbsMetadata) obj; + + if (hasRetryInfo() != other.hasRetryInfo()) return false; + if (hasRetryInfo()) { + if (!getRetryInfo().equals(other.getRetryInfo())) 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 (hasRetryInfo()) { + hash = (37 * hash) + RETRY_INFO_FIELD_NUMBER; + hash = (53 * hash) + getRetryInfo().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.showcase.v1beta1.SearchBlurbsMetadata parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.SearchBlurbsMetadata parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.SearchBlurbsMetadata parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.SearchBlurbsMetadata 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.showcase.v1beta1.SearchBlurbsMetadata parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.SearchBlurbsMetadata parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.SearchBlurbsMetadata parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.SearchBlurbsMetadata parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.showcase.v1beta1.SearchBlurbsMetadata parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.SearchBlurbsMetadata parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.showcase.v1beta1.SearchBlurbsMetadata parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.SearchBlurbsMetadata parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.showcase.v1beta1.SearchBlurbsMetadata 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
        +   * The operation metadata message for the
        +   * google.showcase.v1beta1.Messaging\SearchBlurbs method.
        +   * 
        + * + * Protobuf type {@code google.showcase.v1beta1.SearchBlurbsMetadata} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.SearchBlurbsMetadata) + com.google.showcase.v1beta1.SearchBlurbsMetadataOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.MessagingOuterClass + .internal_static_google_showcase_v1beta1_SearchBlurbsMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.MessagingOuterClass + .internal_static_google_showcase_v1beta1_SearchBlurbsMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.SearchBlurbsMetadata.class, + com.google.showcase.v1beta1.SearchBlurbsMetadata.Builder.class); + } + + // Construct using com.google.showcase.v1beta1.SearchBlurbsMetadata.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetRetryInfoFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + retryInfo_ = null; + if (retryInfoBuilder_ != null) { + retryInfoBuilder_.dispose(); + retryInfoBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.showcase.v1beta1.MessagingOuterClass + .internal_static_google_showcase_v1beta1_SearchBlurbsMetadata_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.SearchBlurbsMetadata getDefaultInstanceForType() { + return com.google.showcase.v1beta1.SearchBlurbsMetadata.getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.SearchBlurbsMetadata build() { + com.google.showcase.v1beta1.SearchBlurbsMetadata result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.SearchBlurbsMetadata buildPartial() { + com.google.showcase.v1beta1.SearchBlurbsMetadata result = + new com.google.showcase.v1beta1.SearchBlurbsMetadata(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.showcase.v1beta1.SearchBlurbsMetadata result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.retryInfo_ = retryInfoBuilder_ == null ? retryInfo_ : retryInfoBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.showcase.v1beta1.SearchBlurbsMetadata) { + return mergeFrom((com.google.showcase.v1beta1.SearchBlurbsMetadata) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.showcase.v1beta1.SearchBlurbsMetadata other) { + if (other == com.google.showcase.v1beta1.SearchBlurbsMetadata.getDefaultInstance()) + return this; + if (other.hasRetryInfo()) { + mergeRetryInfo(other.getRetryInfo()); + } + 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( + internalGetRetryInfoFieldBuilder().getBuilder(), extensionRegistry); + 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 com.google.rpc.RetryInfo retryInfo_; + private com.google.protobuf.SingleFieldBuilder< + com.google.rpc.RetryInfo, + com.google.rpc.RetryInfo.Builder, + com.google.rpc.RetryInfoOrBuilder> + retryInfoBuilder_; + + /** + * + * + *
        +     * This signals to the client when to next poll for response.
        +     * 
        + * + * .google.rpc.RetryInfo retry_info = 1; + * + * @return Whether the retryInfo field is set. + */ + public boolean hasRetryInfo() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
        +     * This signals to the client when to next poll for response.
        +     * 
        + * + * .google.rpc.RetryInfo retry_info = 1; + * + * @return The retryInfo. + */ + public com.google.rpc.RetryInfo getRetryInfo() { + if (retryInfoBuilder_ == null) { + return retryInfo_ == null ? com.google.rpc.RetryInfo.getDefaultInstance() : retryInfo_; + } else { + return retryInfoBuilder_.getMessage(); + } + } + + /** + * + * + *
        +     * This signals to the client when to next poll for response.
        +     * 
        + * + * .google.rpc.RetryInfo retry_info = 1; + */ + public Builder setRetryInfo(com.google.rpc.RetryInfo value) { + if (retryInfoBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + retryInfo_ = value; + } else { + retryInfoBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
        +     * This signals to the client when to next poll for response.
        +     * 
        + * + * .google.rpc.RetryInfo retry_info = 1; + */ + public Builder setRetryInfo(com.google.rpc.RetryInfo.Builder builderForValue) { + if (retryInfoBuilder_ == null) { + retryInfo_ = builderForValue.build(); + } else { + retryInfoBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
        +     * This signals to the client when to next poll for response.
        +     * 
        + * + * .google.rpc.RetryInfo retry_info = 1; + */ + public Builder mergeRetryInfo(com.google.rpc.RetryInfo value) { + if (retryInfoBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) + && retryInfo_ != null + && retryInfo_ != com.google.rpc.RetryInfo.getDefaultInstance()) { + getRetryInfoBuilder().mergeFrom(value); + } else { + retryInfo_ = value; + } + } else { + retryInfoBuilder_.mergeFrom(value); + } + if (retryInfo_ != null) { + bitField0_ |= 0x00000001; + onChanged(); + } + return this; + } + + /** + * + * + *
        +     * This signals to the client when to next poll for response.
        +     * 
        + * + * .google.rpc.RetryInfo retry_info = 1; + */ + public Builder clearRetryInfo() { + bitField0_ = (bitField0_ & ~0x00000001); + retryInfo_ = null; + if (retryInfoBuilder_ != null) { + retryInfoBuilder_.dispose(); + retryInfoBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
        +     * This signals to the client when to next poll for response.
        +     * 
        + * + * .google.rpc.RetryInfo retry_info = 1; + */ + public com.google.rpc.RetryInfo.Builder getRetryInfoBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return internalGetRetryInfoFieldBuilder().getBuilder(); + } + + /** + * + * + *
        +     * This signals to the client when to next poll for response.
        +     * 
        + * + * .google.rpc.RetryInfo retry_info = 1; + */ + public com.google.rpc.RetryInfoOrBuilder getRetryInfoOrBuilder() { + if (retryInfoBuilder_ != null) { + return retryInfoBuilder_.getMessageOrBuilder(); + } else { + return retryInfo_ == null ? com.google.rpc.RetryInfo.getDefaultInstance() : retryInfo_; + } + } + + /** + * + * + *
        +     * This signals to the client when to next poll for response.
        +     * 
        + * + * .google.rpc.RetryInfo retry_info = 1; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.rpc.RetryInfo, + com.google.rpc.RetryInfo.Builder, + com.google.rpc.RetryInfoOrBuilder> + internalGetRetryInfoFieldBuilder() { + if (retryInfoBuilder_ == null) { + retryInfoBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.rpc.RetryInfo, + com.google.rpc.RetryInfo.Builder, + com.google.rpc.RetryInfoOrBuilder>( + getRetryInfo(), getParentForChildren(), isClean()); + retryInfo_ = null; + } + return retryInfoBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.showcase.v1beta1.SearchBlurbsMetadata) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.SearchBlurbsMetadata) + private static final com.google.showcase.v1beta1.SearchBlurbsMetadata DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.SearchBlurbsMetadata(); + } + + public static com.google.showcase.v1beta1.SearchBlurbsMetadata getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SearchBlurbsMetadata 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.showcase.v1beta1.SearchBlurbsMetadata getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/SearchBlurbsMetadataOrBuilder.java b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/SearchBlurbsMetadataOrBuilder.java new file mode 100644 index 0000000000..e7f75df89b --- /dev/null +++ b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/SearchBlurbsMetadataOrBuilder.java @@ -0,0 +1,65 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: schema/google/showcase/v1beta1/messaging.proto +// Protobuf Java Version: 4.33.2 + +package com.google.showcase.v1beta1; + +@com.google.protobuf.Generated +public interface SearchBlurbsMetadataOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.SearchBlurbsMetadata) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
        +   * This signals to the client when to next poll for response.
        +   * 
        + * + * .google.rpc.RetryInfo retry_info = 1; + * + * @return Whether the retryInfo field is set. + */ + boolean hasRetryInfo(); + + /** + * + * + *
        +   * This signals to the client when to next poll for response.
        +   * 
        + * + * .google.rpc.RetryInfo retry_info = 1; + * + * @return The retryInfo. + */ + com.google.rpc.RetryInfo getRetryInfo(); + + /** + * + * + *
        +   * This signals to the client when to next poll for response.
        +   * 
        + * + * .google.rpc.RetryInfo retry_info = 1; + */ + com.google.rpc.RetryInfoOrBuilder getRetryInfoOrBuilder(); +} diff --git a/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/SearchBlurbsRequest.java b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/SearchBlurbsRequest.java new file mode 100644 index 0000000000..67459b4ff5 --- /dev/null +++ b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/SearchBlurbsRequest.java @@ -0,0 +1,1116 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: schema/google/showcase/v1beta1/messaging.proto +// Protobuf Java Version: 4.33.2 + +package com.google.showcase.v1beta1; + +/** + * + * + *
        + * The request message for the google.showcase.v1beta1.Messaging\SearchBlurbs
        + * method.
        + * 
        + * + * Protobuf type {@code google.showcase.v1beta1.SearchBlurbsRequest} + */ +@com.google.protobuf.Generated +public final class SearchBlurbsRequest extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.SearchBlurbsRequest) + SearchBlurbsRequestOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "SearchBlurbsRequest"); + } + + // Use SearchBlurbsRequest.newBuilder() to construct. + private SearchBlurbsRequest(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private SearchBlurbsRequest() { + query_ = ""; + parent_ = ""; + pageToken_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.MessagingOuterClass + .internal_static_google_showcase_v1beta1_SearchBlurbsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.MessagingOuterClass + .internal_static_google_showcase_v1beta1_SearchBlurbsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.SearchBlurbsRequest.class, + com.google.showcase.v1beta1.SearchBlurbsRequest.Builder.class); + } + + public static final int QUERY_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object query_ = ""; + + /** + * + * + *
        +   * The query used to search for blurbs containing to words of this string.
        +   * Only posts that contain an exact match of a queried word will be returned.
        +   * 
        + * + * string query = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The query. + */ + @java.lang.Override + public java.lang.String getQuery() { + java.lang.Object ref = query_; + 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(); + query_ = s; + return s; + } + } + + /** + * + * + *
        +   * The query used to search for blurbs containing to words of this string.
        +   * Only posts that contain an exact match of a queried word will be returned.
        +   * 
        + * + * string query = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for query. + */ + @java.lang.Override + public com.google.protobuf.ByteString getQueryBytes() { + java.lang.Object ref = query_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + query_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PARENT_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object parent_ = ""; + + /** + * + * + *
        +   * The rooms or profiles to search. If unset, `SearchBlurbs` will search all
        +   * rooms and all profiles.
        +   * 
        + * + * string parent = 2 [(.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; + } + } + + /** + * + * + *
        +   * The rooms or profiles to search. If unset, `SearchBlurbs` will search all
        +   * rooms and all profiles.
        +   * 
        + * + * string parent = 2 [(.google.api.resource_reference) = { ... } + * + * @return The bytes for parent. + */ + @java.lang.Override + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PAGE_SIZE_FIELD_NUMBER = 3; + private int pageSize_ = 0; + + /** + * + * + *
        +   * The maximum number of blurbs return. Server may return fewer
        +   * blurbs than requested. If unspecified, server will pick an appropriate
        +   * default.
        +   * 
        + * + * int32 page_size = 3; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + + public static final int PAGE_TOKEN_FIELD_NUMBER = 4; + + @SuppressWarnings("serial") + private volatile java.lang.Object pageToken_ = ""; + + /** + * + * + *
        +   * The value of
        +   * google.showcase.v1beta1.SearchBlurbsResponse.next_page_token
        +   * returned from the previous call to
        +   * `google.showcase.v1beta1.Messaging\SearchBlurbs` method.
        +   * 
        + * + * string page_token = 4; + * + * @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; + } + } + + /** + * + * + *
        +   * The value of
        +   * google.showcase.v1beta1.SearchBlurbsResponse.next_page_token
        +   * returned from the previous call to
        +   * `google.showcase.v1beta1.Messaging\SearchBlurbs` method.
        +   * 
        + * + * string page_token = 4; + * + * @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.GeneratedMessage.isStringEmpty(query_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, query_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(parent_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, parent_); + } + if (pageSize_ != 0) { + output.writeInt32(3, pageSize_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(pageToken_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 4, pageToken_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(query_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, query_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(parent_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, parent_); + } + if (pageSize_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(3, pageSize_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(pageToken_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(4, 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.showcase.v1beta1.SearchBlurbsRequest)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.SearchBlurbsRequest other = + (com.google.showcase.v1beta1.SearchBlurbsRequest) obj; + + if (!getQuery().equals(other.getQuery())) return false; + if (!getParent().equals(other.getParent())) 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) + QUERY_FIELD_NUMBER; + hash = (53 * hash) + getQuery().hashCode(); + hash = (37 * hash) + PARENT_FIELD_NUMBER; + hash = (53 * hash) + getParent().hashCode(); + hash = (37 * hash) + PAGE_SIZE_FIELD_NUMBER; + hash = (53 * hash) + getPageSize(); + hash = (37 * hash) + PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getPageToken().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.showcase.v1beta1.SearchBlurbsRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.SearchBlurbsRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.SearchBlurbsRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.SearchBlurbsRequest 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.showcase.v1beta1.SearchBlurbsRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.SearchBlurbsRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.SearchBlurbsRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.SearchBlurbsRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.showcase.v1beta1.SearchBlurbsRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.SearchBlurbsRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.showcase.v1beta1.SearchBlurbsRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.SearchBlurbsRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.showcase.v1beta1.SearchBlurbsRequest 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
        +   * The request message for the google.showcase.v1beta1.Messaging\SearchBlurbs
        +   * method.
        +   * 
        + * + * Protobuf type {@code google.showcase.v1beta1.SearchBlurbsRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.SearchBlurbsRequest) + com.google.showcase.v1beta1.SearchBlurbsRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.MessagingOuterClass + .internal_static_google_showcase_v1beta1_SearchBlurbsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.MessagingOuterClass + .internal_static_google_showcase_v1beta1_SearchBlurbsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.SearchBlurbsRequest.class, + com.google.showcase.v1beta1.SearchBlurbsRequest.Builder.class); + } + + // Construct using com.google.showcase.v1beta1.SearchBlurbsRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + query_ = ""; + parent_ = ""; + pageSize_ = 0; + pageToken_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.showcase.v1beta1.MessagingOuterClass + .internal_static_google_showcase_v1beta1_SearchBlurbsRequest_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.SearchBlurbsRequest getDefaultInstanceForType() { + return com.google.showcase.v1beta1.SearchBlurbsRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.SearchBlurbsRequest build() { + com.google.showcase.v1beta1.SearchBlurbsRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.SearchBlurbsRequest buildPartial() { + com.google.showcase.v1beta1.SearchBlurbsRequest result = + new com.google.showcase.v1beta1.SearchBlurbsRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.showcase.v1beta1.SearchBlurbsRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.query_ = query_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.parent_ = parent_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.pageSize_ = pageSize_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.pageToken_ = pageToken_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.showcase.v1beta1.SearchBlurbsRequest) { + return mergeFrom((com.google.showcase.v1beta1.SearchBlurbsRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.showcase.v1beta1.SearchBlurbsRequest other) { + if (other == com.google.showcase.v1beta1.SearchBlurbsRequest.getDefaultInstance()) + return this; + if (!other.getQuery().isEmpty()) { + query_ = other.query_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + bitField0_ |= 0x00000002; + 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: + { + query_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + parent_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 24: + { + pageSize_ = input.readInt32(); + bitField0_ |= 0x00000004; + break; + } // case 24 + case 34: + { + pageToken_ = input.readStringRequireUtf8(); + 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 query_ = ""; + + /** + * + * + *
        +     * The query used to search for blurbs containing to words of this string.
        +     * Only posts that contain an exact match of a queried word will be returned.
        +     * 
        + * + * string query = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The query. + */ + public java.lang.String getQuery() { + java.lang.Object ref = query_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + query_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
        +     * The query used to search for blurbs containing to words of this string.
        +     * Only posts that contain an exact match of a queried word will be returned.
        +     * 
        + * + * string query = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for query. + */ + public com.google.protobuf.ByteString getQueryBytes() { + java.lang.Object ref = query_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + query_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
        +     * The query used to search for blurbs containing to words of this string.
        +     * Only posts that contain an exact match of a queried word will be returned.
        +     * 
        + * + * string query = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The query to set. + * @return This builder for chaining. + */ + public Builder setQuery(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + query_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
        +     * The query used to search for blurbs containing to words of this string.
        +     * Only posts that contain an exact match of a queried word will be returned.
        +     * 
        + * + * string query = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearQuery() { + query_ = getDefaultInstance().getQuery(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
        +     * The query used to search for blurbs containing to words of this string.
        +     * Only posts that contain an exact match of a queried word will be returned.
        +     * 
        + * + * string query = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for query to set. + * @return This builder for chaining. + */ + public Builder setQueryBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + query_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object parent_ = ""; + + /** + * + * + *
        +     * The rooms or profiles to search. If unset, `SearchBlurbs` will search all
        +     * rooms and all profiles.
        +     * 
        + * + * string parent = 2 [(.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; + } + } + + /** + * + * + *
        +     * The rooms or profiles to search. If unset, `SearchBlurbs` will search all
        +     * rooms and all profiles.
        +     * 
        + * + * string parent = 2 [(.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; + } + } + + /** + * + * + *
        +     * The rooms or profiles to search. If unset, `SearchBlurbs` will search all
        +     * rooms and all profiles.
        +     * 
        + * + * string parent = 2 [(.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_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
        +     * The rooms or profiles to search. If unset, `SearchBlurbs` will search all
        +     * rooms and all profiles.
        +     * 
        + * + * string parent = 2 [(.google.api.resource_reference) = { ... } + * + * @return This builder for chaining. + */ + public Builder clearParent() { + parent_ = getDefaultInstance().getParent(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
        +     * The rooms or profiles to search. If unset, `SearchBlurbs` will search all
        +     * rooms and all profiles.
        +     * 
        + * + * string parent = 2 [(.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_ |= 0x00000002; + onChanged(); + return this; + } + + private int pageSize_; + + /** + * + * + *
        +     * The maximum number of blurbs return. Server may return fewer
        +     * blurbs than requested. If unspecified, server will pick an appropriate
        +     * default.
        +     * 
        + * + * int32 page_size = 3; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + + /** + * + * + *
        +     * The maximum number of blurbs return. Server may return fewer
        +     * blurbs than requested. If unspecified, server will pick an appropriate
        +     * default.
        +     * 
        + * + * int32 page_size = 3; + * + * @param value The pageSize to set. + * @return This builder for chaining. + */ + public Builder setPageSize(int value) { + + pageSize_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
        +     * The maximum number of blurbs return. Server may return fewer
        +     * blurbs than requested. If unspecified, server will pick an appropriate
        +     * default.
        +     * 
        + * + * int32 page_size = 3; + * + * @return This builder for chaining. + */ + public Builder clearPageSize() { + bitField0_ = (bitField0_ & ~0x00000004); + pageSize_ = 0; + onChanged(); + return this; + } + + private java.lang.Object pageToken_ = ""; + + /** + * + * + *
        +     * The value of
        +     * google.showcase.v1beta1.SearchBlurbsResponse.next_page_token
        +     * returned from the previous call to
        +     * `google.showcase.v1beta1.Messaging\SearchBlurbs` method.
        +     * 
        + * + * string page_token = 4; + * + * @return The pageToken. + */ + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
        +     * The value of
        +     * google.showcase.v1beta1.SearchBlurbsResponse.next_page_token
        +     * returned from the previous call to
        +     * `google.showcase.v1beta1.Messaging\SearchBlurbs` method.
        +     * 
        + * + * string page_token = 4; + * + * @return The bytes for pageToken. + */ + public com.google.protobuf.ByteString getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
        +     * The value of
        +     * google.showcase.v1beta1.SearchBlurbsResponse.next_page_token
        +     * returned from the previous call to
        +     * `google.showcase.v1beta1.Messaging\SearchBlurbs` method.
        +     * 
        + * + * string page_token = 4; + * + * @param value The pageToken to set. + * @return This builder for chaining. + */ + public Builder setPageToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + pageToken_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + /** + * + * + *
        +     * The value of
        +     * google.showcase.v1beta1.SearchBlurbsResponse.next_page_token
        +     * returned from the previous call to
        +     * `google.showcase.v1beta1.Messaging\SearchBlurbs` method.
        +     * 
        + * + * string page_token = 4; + * + * @return This builder for chaining. + */ + public Builder clearPageToken() { + pageToken_ = getDefaultInstance().getPageToken(); + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + return this; + } + + /** + * + * + *
        +     * The value of
        +     * google.showcase.v1beta1.SearchBlurbsResponse.next_page_token
        +     * returned from the previous call to
        +     * `google.showcase.v1beta1.Messaging\SearchBlurbs` method.
        +     * 
        + * + * string page_token = 4; + * + * @param value The bytes for pageToken to set. + * @return This builder for chaining. + */ + public Builder setPageTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + pageToken_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.showcase.v1beta1.SearchBlurbsRequest) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.SearchBlurbsRequest) + private static final com.google.showcase.v1beta1.SearchBlurbsRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.SearchBlurbsRequest(); + } + + public static com.google.showcase.v1beta1.SearchBlurbsRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SearchBlurbsRequest 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.showcase.v1beta1.SearchBlurbsRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/SearchBlurbsRequestOrBuilder.java b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/SearchBlurbsRequestOrBuilder.java new file mode 100644 index 0000000000..d37d647161 --- /dev/null +++ b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/SearchBlurbsRequestOrBuilder.java @@ -0,0 +1,131 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: schema/google/showcase/v1beta1/messaging.proto +// Protobuf Java Version: 4.33.2 + +package com.google.showcase.v1beta1; + +@com.google.protobuf.Generated +public interface SearchBlurbsRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.SearchBlurbsRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
        +   * The query used to search for blurbs containing to words of this string.
        +   * Only posts that contain an exact match of a queried word will be returned.
        +   * 
        + * + * string query = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The query. + */ + java.lang.String getQuery(); + + /** + * + * + *
        +   * The query used to search for blurbs containing to words of this string.
        +   * Only posts that contain an exact match of a queried word will be returned.
        +   * 
        + * + * string query = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for query. + */ + com.google.protobuf.ByteString getQueryBytes(); + + /** + * + * + *
        +   * The rooms or profiles to search. If unset, `SearchBlurbs` will search all
        +   * rooms and all profiles.
        +   * 
        + * + * string parent = 2 [(.google.api.resource_reference) = { ... } + * + * @return The parent. + */ + java.lang.String getParent(); + + /** + * + * + *
        +   * The rooms or profiles to search. If unset, `SearchBlurbs` will search all
        +   * rooms and all profiles.
        +   * 
        + * + * string parent = 2 [(.google.api.resource_reference) = { ... } + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
        +   * The maximum number of blurbs return. Server may return fewer
        +   * blurbs than requested. If unspecified, server will pick an appropriate
        +   * default.
        +   * 
        + * + * int32 page_size = 3; + * + * @return The pageSize. + */ + int getPageSize(); + + /** + * + * + *
        +   * The value of
        +   * google.showcase.v1beta1.SearchBlurbsResponse.next_page_token
        +   * returned from the previous call to
        +   * `google.showcase.v1beta1.Messaging\SearchBlurbs` method.
        +   * 
        + * + * string page_token = 4; + * + * @return The pageToken. + */ + java.lang.String getPageToken(); + + /** + * + * + *
        +   * The value of
        +   * google.showcase.v1beta1.SearchBlurbsResponse.next_page_token
        +   * returned from the previous call to
        +   * `google.showcase.v1beta1.Messaging\SearchBlurbs` method.
        +   * 
        + * + * string page_token = 4; + * + * @return The bytes for pageToken. + */ + com.google.protobuf.ByteString getPageTokenBytes(); +} diff --git a/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/SearchBlurbsResponse.java b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/SearchBlurbsResponse.java new file mode 100644 index 0000000000..d5391a276e --- /dev/null +++ b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/SearchBlurbsResponse.java @@ -0,0 +1,1131 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: schema/google/showcase/v1beta1/messaging.proto +// Protobuf Java Version: 4.33.2 + +package com.google.showcase.v1beta1; + +/** + * + * + *
        + * The operation response message for the
        + * google.showcase.v1beta1.Messaging\SearchBlurbs method.
        + * 
        + * + * Protobuf type {@code google.showcase.v1beta1.SearchBlurbsResponse} + */ +@com.google.protobuf.Generated +public final class SearchBlurbsResponse extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.SearchBlurbsResponse) + SearchBlurbsResponseOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "SearchBlurbsResponse"); + } + + // Use SearchBlurbsResponse.newBuilder() to construct. + private SearchBlurbsResponse(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private SearchBlurbsResponse() { + blurbs_ = java.util.Collections.emptyList(); + nextPageToken_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.MessagingOuterClass + .internal_static_google_showcase_v1beta1_SearchBlurbsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.MessagingOuterClass + .internal_static_google_showcase_v1beta1_SearchBlurbsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.SearchBlurbsResponse.class, + com.google.showcase.v1beta1.SearchBlurbsResponse.Builder.class); + } + + public static final int BLURBS_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private java.util.List blurbs_; + + /** + * + * + *
        +   * Blurbs that matched the search query.
        +   * 
        + * + * repeated .google.showcase.v1beta1.Blurb blurbs = 1; + */ + @java.lang.Override + public java.util.List getBlurbsList() { + return blurbs_; + } + + /** + * + * + *
        +   * Blurbs that matched the search query.
        +   * 
        + * + * repeated .google.showcase.v1beta1.Blurb blurbs = 1; + */ + @java.lang.Override + public java.util.List + getBlurbsOrBuilderList() { + return blurbs_; + } + + /** + * + * + *
        +   * Blurbs that matched the search query.
        +   * 
        + * + * repeated .google.showcase.v1beta1.Blurb blurbs = 1; + */ + @java.lang.Override + public int getBlurbsCount() { + return blurbs_.size(); + } + + /** + * + * + *
        +   * Blurbs that matched the search query.
        +   * 
        + * + * repeated .google.showcase.v1beta1.Blurb blurbs = 1; + */ + @java.lang.Override + public com.google.showcase.v1beta1.Blurb getBlurbs(int index) { + return blurbs_.get(index); + } + + /** + * + * + *
        +   * Blurbs that matched the search query.
        +   * 
        + * + * repeated .google.showcase.v1beta1.Blurb blurbs = 1; + */ + @java.lang.Override + public com.google.showcase.v1beta1.BlurbOrBuilder getBlurbsOrBuilder(int index) { + return blurbs_.get(index); + } + + public static final int NEXT_PAGE_TOKEN_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object nextPageToken_ = ""; + + /** + * + * + *
        +   * A token to retrieve next page of results.
        +   * Pass this value in SearchBlurbsRequest.page_token field in the subsequent
        +   * call to `google.showcase.v1beta1.Blurb\SearchBlurbs` method to
        +   * retrieve the next page of results.
        +   * 
        + * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + @java.lang.Override + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nextPageToken_ = s; + return s; + } + } + + /** + * + * + *
        +   * A token to retrieve next page of results.
        +   * Pass this value in SearchBlurbsRequest.page_token field in the subsequent
        +   * call to `google.showcase.v1beta1.Blurb\SearchBlurbs` method to
        +   * retrieve the next page of results.
        +   * 
        + * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + nextPageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + for (int i = 0; i < blurbs_.size(); i++) { + output.writeMessage(1, blurbs_.get(i)); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(nextPageToken_)) { + com.google.protobuf.GeneratedMessage.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 < blurbs_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, blurbs_.get(i)); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(nextPageToken_)) { + size += com.google.protobuf.GeneratedMessage.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.showcase.v1beta1.SearchBlurbsResponse)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.SearchBlurbsResponse other = + (com.google.showcase.v1beta1.SearchBlurbsResponse) obj; + + if (!getBlurbsList().equals(other.getBlurbsList())) 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 (getBlurbsCount() > 0) { + hash = (37 * hash) + BLURBS_FIELD_NUMBER; + hash = (53 * hash) + getBlurbsList().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.showcase.v1beta1.SearchBlurbsResponse parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.SearchBlurbsResponse parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.SearchBlurbsResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.SearchBlurbsResponse 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.showcase.v1beta1.SearchBlurbsResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.SearchBlurbsResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.SearchBlurbsResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.SearchBlurbsResponse parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.showcase.v1beta1.SearchBlurbsResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.SearchBlurbsResponse parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.showcase.v1beta1.SearchBlurbsResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.SearchBlurbsResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.showcase.v1beta1.SearchBlurbsResponse 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
        +   * The operation response message for the
        +   * google.showcase.v1beta1.Messaging\SearchBlurbs method.
        +   * 
        + * + * Protobuf type {@code google.showcase.v1beta1.SearchBlurbsResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.SearchBlurbsResponse) + com.google.showcase.v1beta1.SearchBlurbsResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.MessagingOuterClass + .internal_static_google_showcase_v1beta1_SearchBlurbsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.MessagingOuterClass + .internal_static_google_showcase_v1beta1_SearchBlurbsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.SearchBlurbsResponse.class, + com.google.showcase.v1beta1.SearchBlurbsResponse.Builder.class); + } + + // Construct using com.google.showcase.v1beta1.SearchBlurbsResponse.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (blurbsBuilder_ == null) { + blurbs_ = java.util.Collections.emptyList(); + } else { + blurbs_ = null; + blurbsBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + nextPageToken_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.showcase.v1beta1.MessagingOuterClass + .internal_static_google_showcase_v1beta1_SearchBlurbsResponse_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.SearchBlurbsResponse getDefaultInstanceForType() { + return com.google.showcase.v1beta1.SearchBlurbsResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.SearchBlurbsResponse build() { + com.google.showcase.v1beta1.SearchBlurbsResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.SearchBlurbsResponse buildPartial() { + com.google.showcase.v1beta1.SearchBlurbsResponse result = + new com.google.showcase.v1beta1.SearchBlurbsResponse(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields( + com.google.showcase.v1beta1.SearchBlurbsResponse result) { + if (blurbsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + blurbs_ = java.util.Collections.unmodifiableList(blurbs_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.blurbs_ = blurbs_; + } else { + result.blurbs_ = blurbsBuilder_.build(); + } + } + + private void buildPartial0(com.google.showcase.v1beta1.SearchBlurbsResponse result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.nextPageToken_ = nextPageToken_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.showcase.v1beta1.SearchBlurbsResponse) { + return mergeFrom((com.google.showcase.v1beta1.SearchBlurbsResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.showcase.v1beta1.SearchBlurbsResponse other) { + if (other == com.google.showcase.v1beta1.SearchBlurbsResponse.getDefaultInstance()) + return this; + if (blurbsBuilder_ == null) { + if (!other.blurbs_.isEmpty()) { + if (blurbs_.isEmpty()) { + blurbs_ = other.blurbs_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureBlurbsIsMutable(); + blurbs_.addAll(other.blurbs_); + } + onChanged(); + } + } else { + if (!other.blurbs_.isEmpty()) { + if (blurbsBuilder_.isEmpty()) { + blurbsBuilder_.dispose(); + blurbsBuilder_ = null; + blurbs_ = other.blurbs_; + bitField0_ = (bitField0_ & ~0x00000001); + blurbsBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders + ? internalGetBlurbsFieldBuilder() + : null; + } else { + blurbsBuilder_.addAllMessages(other.blurbs_); + } + } + } + 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.showcase.v1beta1.Blurb m = + input.readMessage( + com.google.showcase.v1beta1.Blurb.parser(), extensionRegistry); + if (blurbsBuilder_ == null) { + ensureBlurbsIsMutable(); + blurbs_.add(m); + } else { + blurbsBuilder_.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 blurbs_ = + java.util.Collections.emptyList(); + + private void ensureBlurbsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + blurbs_ = new java.util.ArrayList(blurbs_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.google.showcase.v1beta1.Blurb, + com.google.showcase.v1beta1.Blurb.Builder, + com.google.showcase.v1beta1.BlurbOrBuilder> + blurbsBuilder_; + + /** + * + * + *
        +     * Blurbs that matched the search query.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Blurb blurbs = 1; + */ + public java.util.List getBlurbsList() { + if (blurbsBuilder_ == null) { + return java.util.Collections.unmodifiableList(blurbs_); + } else { + return blurbsBuilder_.getMessageList(); + } + } + + /** + * + * + *
        +     * Blurbs that matched the search query.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Blurb blurbs = 1; + */ + public int getBlurbsCount() { + if (blurbsBuilder_ == null) { + return blurbs_.size(); + } else { + return blurbsBuilder_.getCount(); + } + } + + /** + * + * + *
        +     * Blurbs that matched the search query.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Blurb blurbs = 1; + */ + public com.google.showcase.v1beta1.Blurb getBlurbs(int index) { + if (blurbsBuilder_ == null) { + return blurbs_.get(index); + } else { + return blurbsBuilder_.getMessage(index); + } + } + + /** + * + * + *
        +     * Blurbs that matched the search query.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Blurb blurbs = 1; + */ + public Builder setBlurbs(int index, com.google.showcase.v1beta1.Blurb value) { + if (blurbsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureBlurbsIsMutable(); + blurbs_.set(index, value); + onChanged(); + } else { + blurbsBuilder_.setMessage(index, value); + } + return this; + } + + /** + * + * + *
        +     * Blurbs that matched the search query.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Blurb blurbs = 1; + */ + public Builder setBlurbs(int index, com.google.showcase.v1beta1.Blurb.Builder builderForValue) { + if (blurbsBuilder_ == null) { + ensureBlurbsIsMutable(); + blurbs_.set(index, builderForValue.build()); + onChanged(); + } else { + blurbsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
        +     * Blurbs that matched the search query.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Blurb blurbs = 1; + */ + public Builder addBlurbs(com.google.showcase.v1beta1.Blurb value) { + if (blurbsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureBlurbsIsMutable(); + blurbs_.add(value); + onChanged(); + } else { + blurbsBuilder_.addMessage(value); + } + return this; + } + + /** + * + * + *
        +     * Blurbs that matched the search query.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Blurb blurbs = 1; + */ + public Builder addBlurbs(int index, com.google.showcase.v1beta1.Blurb value) { + if (blurbsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureBlurbsIsMutable(); + blurbs_.add(index, value); + onChanged(); + } else { + blurbsBuilder_.addMessage(index, value); + } + return this; + } + + /** + * + * + *
        +     * Blurbs that matched the search query.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Blurb blurbs = 1; + */ + public Builder addBlurbs(com.google.showcase.v1beta1.Blurb.Builder builderForValue) { + if (blurbsBuilder_ == null) { + ensureBlurbsIsMutable(); + blurbs_.add(builderForValue.build()); + onChanged(); + } else { + blurbsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + + /** + * + * + *
        +     * Blurbs that matched the search query.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Blurb blurbs = 1; + */ + public Builder addBlurbs(int index, com.google.showcase.v1beta1.Blurb.Builder builderForValue) { + if (blurbsBuilder_ == null) { + ensureBlurbsIsMutable(); + blurbs_.add(index, builderForValue.build()); + onChanged(); + } else { + blurbsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
        +     * Blurbs that matched the search query.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Blurb blurbs = 1; + */ + public Builder addAllBlurbs( + java.lang.Iterable values) { + if (blurbsBuilder_ == null) { + ensureBlurbsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, blurbs_); + onChanged(); + } else { + blurbsBuilder_.addAllMessages(values); + } + return this; + } + + /** + * + * + *
        +     * Blurbs that matched the search query.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Blurb blurbs = 1; + */ + public Builder clearBlurbs() { + if (blurbsBuilder_ == null) { + blurbs_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + blurbsBuilder_.clear(); + } + return this; + } + + /** + * + * + *
        +     * Blurbs that matched the search query.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Blurb blurbs = 1; + */ + public Builder removeBlurbs(int index) { + if (blurbsBuilder_ == null) { + ensureBlurbsIsMutable(); + blurbs_.remove(index); + onChanged(); + } else { + blurbsBuilder_.remove(index); + } + return this; + } + + /** + * + * + *
        +     * Blurbs that matched the search query.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Blurb blurbs = 1; + */ + public com.google.showcase.v1beta1.Blurb.Builder getBlurbsBuilder(int index) { + return internalGetBlurbsFieldBuilder().getBuilder(index); + } + + /** + * + * + *
        +     * Blurbs that matched the search query.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Blurb blurbs = 1; + */ + public com.google.showcase.v1beta1.BlurbOrBuilder getBlurbsOrBuilder(int index) { + if (blurbsBuilder_ == null) { + return blurbs_.get(index); + } else { + return blurbsBuilder_.getMessageOrBuilder(index); + } + } + + /** + * + * + *
        +     * Blurbs that matched the search query.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Blurb blurbs = 1; + */ + public java.util.List + getBlurbsOrBuilderList() { + if (blurbsBuilder_ != null) { + return blurbsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(blurbs_); + } + } + + /** + * + * + *
        +     * Blurbs that matched the search query.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Blurb blurbs = 1; + */ + public com.google.showcase.v1beta1.Blurb.Builder addBlurbsBuilder() { + return internalGetBlurbsFieldBuilder() + .addBuilder(com.google.showcase.v1beta1.Blurb.getDefaultInstance()); + } + + /** + * + * + *
        +     * Blurbs that matched the search query.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Blurb blurbs = 1; + */ + public com.google.showcase.v1beta1.Blurb.Builder addBlurbsBuilder(int index) { + return internalGetBlurbsFieldBuilder() + .addBuilder(index, com.google.showcase.v1beta1.Blurb.getDefaultInstance()); + } + + /** + * + * + *
        +     * Blurbs that matched the search query.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Blurb blurbs = 1; + */ + public java.util.List getBlurbsBuilderList() { + return internalGetBlurbsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.google.showcase.v1beta1.Blurb, + com.google.showcase.v1beta1.Blurb.Builder, + com.google.showcase.v1beta1.BlurbOrBuilder> + internalGetBlurbsFieldBuilder() { + if (blurbsBuilder_ == null) { + blurbsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilder< + com.google.showcase.v1beta1.Blurb, + com.google.showcase.v1beta1.Blurb.Builder, + com.google.showcase.v1beta1.BlurbOrBuilder>( + blurbs_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + blurbs_ = null; + } + return blurbsBuilder_; + } + + private java.lang.Object nextPageToken_ = ""; + + /** + * + * + *
        +     * A token to retrieve next page of results.
        +     * Pass this value in SearchBlurbsRequest.page_token field in the subsequent
        +     * call to `google.showcase.v1beta1.Blurb\SearchBlurbs` method to
        +     * retrieve the next page of results.
        +     * 
        + * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nextPageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
        +     * A token to retrieve next page of results.
        +     * Pass this value in SearchBlurbsRequest.page_token field in the subsequent
        +     * call to `google.showcase.v1beta1.Blurb\SearchBlurbs` method to
        +     * retrieve the next page of results.
        +     * 
        + * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + public com.google.protobuf.ByteString getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + nextPageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
        +     * A token to retrieve next page of results.
        +     * Pass this value in SearchBlurbsRequest.page_token field in the subsequent
        +     * call to `google.showcase.v1beta1.Blurb\SearchBlurbs` method to
        +     * retrieve the next page of results.
        +     * 
        + * + * string next_page_token = 2; + * + * @param value The nextPageToken to set. + * @return This builder for chaining. + */ + public Builder setNextPageToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + nextPageToken_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
        +     * A token to retrieve next page of results.
        +     * Pass this value in SearchBlurbsRequest.page_token field in the subsequent
        +     * call to `google.showcase.v1beta1.Blurb\SearchBlurbs` method to
        +     * retrieve the next page of results.
        +     * 
        + * + * string next_page_token = 2; + * + * @return This builder for chaining. + */ + public Builder clearNextPageToken() { + nextPageToken_ = getDefaultInstance().getNextPageToken(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
        +     * A token to retrieve next page of results.
        +     * Pass this value in SearchBlurbsRequest.page_token field in the subsequent
        +     * call to `google.showcase.v1beta1.Blurb\SearchBlurbs` method to
        +     * retrieve the next page of results.
        +     * 
        + * + * string next_page_token = 2; + * + * @param value The bytes for nextPageToken to set. + * @return This builder for chaining. + */ + public Builder setNextPageTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + nextPageToken_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.showcase.v1beta1.SearchBlurbsResponse) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.SearchBlurbsResponse) + private static final com.google.showcase.v1beta1.SearchBlurbsResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.SearchBlurbsResponse(); + } + + public static com.google.showcase.v1beta1.SearchBlurbsResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SearchBlurbsResponse 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.showcase.v1beta1.SearchBlurbsResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/SearchBlurbsResponseOrBuilder.java b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/SearchBlurbsResponseOrBuilder.java new file mode 100644 index 0000000000..64b5238132 --- /dev/null +++ b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/SearchBlurbsResponseOrBuilder.java @@ -0,0 +1,115 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: schema/google/showcase/v1beta1/messaging.proto +// Protobuf Java Version: 4.33.2 + +package com.google.showcase.v1beta1; + +@com.google.protobuf.Generated +public interface SearchBlurbsResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.SearchBlurbsResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
        +   * Blurbs that matched the search query.
        +   * 
        + * + * repeated .google.showcase.v1beta1.Blurb blurbs = 1; + */ + java.util.List getBlurbsList(); + + /** + * + * + *
        +   * Blurbs that matched the search query.
        +   * 
        + * + * repeated .google.showcase.v1beta1.Blurb blurbs = 1; + */ + com.google.showcase.v1beta1.Blurb getBlurbs(int index); + + /** + * + * + *
        +   * Blurbs that matched the search query.
        +   * 
        + * + * repeated .google.showcase.v1beta1.Blurb blurbs = 1; + */ + int getBlurbsCount(); + + /** + * + * + *
        +   * Blurbs that matched the search query.
        +   * 
        + * + * repeated .google.showcase.v1beta1.Blurb blurbs = 1; + */ + java.util.List getBlurbsOrBuilderList(); + + /** + * + * + *
        +   * Blurbs that matched the search query.
        +   * 
        + * + * repeated .google.showcase.v1beta1.Blurb blurbs = 1; + */ + com.google.showcase.v1beta1.BlurbOrBuilder getBlurbsOrBuilder(int index); + + /** + * + * + *
        +   * A token to retrieve next page of results.
        +   * Pass this value in SearchBlurbsRequest.page_token field in the subsequent
        +   * call to `google.showcase.v1beta1.Blurb\SearchBlurbs` method to
        +   * retrieve the next page of results.
        +   * 
        + * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + java.lang.String getNextPageToken(); + + /** + * + * + *
        +   * A token to retrieve next page of results.
        +   * Pass this value in SearchBlurbsRequest.page_token field in the subsequent
        +   * call to `google.showcase.v1beta1.Blurb\SearchBlurbs` method to
        +   * retrieve the next page of results.
        +   * 
        + * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + com.google.protobuf.ByteString getNextPageTokenBytes(); +} diff --git a/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/SendBlurbsResponse.java b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/SendBlurbsResponse.java new file mode 100644 index 0000000000..b4e40d4227 --- /dev/null +++ b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/SendBlurbsResponse.java @@ -0,0 +1,698 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: schema/google/showcase/v1beta1/messaging.proto +// Protobuf Java Version: 4.33.2 + +package com.google.showcase.v1beta1; + +/** + * + * + *
        + * The response message for the google.showcase.v1beta1.Messaging\SendBlurbs
        + * method.
        + * 
        + * + * Protobuf type {@code google.showcase.v1beta1.SendBlurbsResponse} + */ +@com.google.protobuf.Generated +public final class SendBlurbsResponse extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.SendBlurbsResponse) + SendBlurbsResponseOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "SendBlurbsResponse"); + } + + // Use SendBlurbsResponse.newBuilder() to construct. + private SendBlurbsResponse(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private SendBlurbsResponse() { + names_ = com.google.protobuf.LazyStringArrayList.emptyList(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.MessagingOuterClass + .internal_static_google_showcase_v1beta1_SendBlurbsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.MessagingOuterClass + .internal_static_google_showcase_v1beta1_SendBlurbsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.SendBlurbsResponse.class, + com.google.showcase.v1beta1.SendBlurbsResponse.Builder.class); + } + + public static final int NAMES_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private com.google.protobuf.LazyStringArrayList names_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + + /** + * + * + *
        +   * The names of successful blurb creations.
        +   * 
        + * + * repeated string names = 1; + * + * @return A list containing the names. + */ + public com.google.protobuf.ProtocolStringList getNamesList() { + return names_; + } + + /** + * + * + *
        +   * The names of successful blurb creations.
        +   * 
        + * + * repeated string names = 1; + * + * @return The count of names. + */ + public int getNamesCount() { + return names_.size(); + } + + /** + * + * + *
        +   * The names of successful blurb creations.
        +   * 
        + * + * repeated string names = 1; + * + * @param index The index of the element to return. + * @return The names at the given index. + */ + public java.lang.String getNames(int index) { + return names_.get(index); + } + + /** + * + * + *
        +   * The names of successful blurb creations.
        +   * 
        + * + * repeated string names = 1; + * + * @param index The index of the value to return. + * @return The bytes of the names at the given index. + */ + public com.google.protobuf.ByteString getNamesBytes(int index) { + return names_.getByteString(index); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + for (int i = 0; i < names_.size(); i++) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, names_.getRaw(i)); + } + 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 < names_.size(); i++) { + dataSize += computeStringSizeNoTag(names_.getRaw(i)); + } + size += dataSize; + size += 1 * getNamesList().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.showcase.v1beta1.SendBlurbsResponse)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.SendBlurbsResponse other = + (com.google.showcase.v1beta1.SendBlurbsResponse) obj; + + if (!getNamesList().equals(other.getNamesList())) 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 (getNamesCount() > 0) { + hash = (37 * hash) + NAMES_FIELD_NUMBER; + hash = (53 * hash) + getNamesList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.showcase.v1beta1.SendBlurbsResponse parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.SendBlurbsResponse parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.SendBlurbsResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.SendBlurbsResponse 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.showcase.v1beta1.SendBlurbsResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.SendBlurbsResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.SendBlurbsResponse parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.SendBlurbsResponse parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.showcase.v1beta1.SendBlurbsResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.SendBlurbsResponse parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.showcase.v1beta1.SendBlurbsResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.SendBlurbsResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.showcase.v1beta1.SendBlurbsResponse 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
        +   * The response message for the google.showcase.v1beta1.Messaging\SendBlurbs
        +   * method.
        +   * 
        + * + * Protobuf type {@code google.showcase.v1beta1.SendBlurbsResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.SendBlurbsResponse) + com.google.showcase.v1beta1.SendBlurbsResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.MessagingOuterClass + .internal_static_google_showcase_v1beta1_SendBlurbsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.MessagingOuterClass + .internal_static_google_showcase_v1beta1_SendBlurbsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.SendBlurbsResponse.class, + com.google.showcase.v1beta1.SendBlurbsResponse.Builder.class); + } + + // Construct using com.google.showcase.v1beta1.SendBlurbsResponse.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + names_ = com.google.protobuf.LazyStringArrayList.emptyList(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.showcase.v1beta1.MessagingOuterClass + .internal_static_google_showcase_v1beta1_SendBlurbsResponse_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.SendBlurbsResponse getDefaultInstanceForType() { + return com.google.showcase.v1beta1.SendBlurbsResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.SendBlurbsResponse build() { + com.google.showcase.v1beta1.SendBlurbsResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.SendBlurbsResponse buildPartial() { + com.google.showcase.v1beta1.SendBlurbsResponse result = + new com.google.showcase.v1beta1.SendBlurbsResponse(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.showcase.v1beta1.SendBlurbsResponse result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + names_.makeImmutable(); + result.names_ = names_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.showcase.v1beta1.SendBlurbsResponse) { + return mergeFrom((com.google.showcase.v1beta1.SendBlurbsResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.showcase.v1beta1.SendBlurbsResponse other) { + if (other == com.google.showcase.v1beta1.SendBlurbsResponse.getDefaultInstance()) return this; + if (!other.names_.isEmpty()) { + if (names_.isEmpty()) { + names_ = other.names_; + bitField0_ |= 0x00000001; + } else { + ensureNamesIsMutable(); + names_.addAll(other.names_); + } + 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: + { + java.lang.String s = input.readStringRequireUtf8(); + ensureNamesIsMutable(); + names_.add(s); + 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 com.google.protobuf.LazyStringArrayList names_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + + private void ensureNamesIsMutable() { + if (!names_.isModifiable()) { + names_ = new com.google.protobuf.LazyStringArrayList(names_); + } + bitField0_ |= 0x00000001; + } + + /** + * + * + *
        +     * The names of successful blurb creations.
        +     * 
        + * + * repeated string names = 1; + * + * @return A list containing the names. + */ + public com.google.protobuf.ProtocolStringList getNamesList() { + names_.makeImmutable(); + return names_; + } + + /** + * + * + *
        +     * The names of successful blurb creations.
        +     * 
        + * + * repeated string names = 1; + * + * @return The count of names. + */ + public int getNamesCount() { + return names_.size(); + } + + /** + * + * + *
        +     * The names of successful blurb creations.
        +     * 
        + * + * repeated string names = 1; + * + * @param index The index of the element to return. + * @return The names at the given index. + */ + public java.lang.String getNames(int index) { + return names_.get(index); + } + + /** + * + * + *
        +     * The names of successful blurb creations.
        +     * 
        + * + * repeated string names = 1; + * + * @param index The index of the value to return. + * @return The bytes of the names at the given index. + */ + public com.google.protobuf.ByteString getNamesBytes(int index) { + return names_.getByteString(index); + } + + /** + * + * + *
        +     * The names of successful blurb creations.
        +     * 
        + * + * repeated string names = 1; + * + * @param index The index to set the value at. + * @param value The names to set. + * @return This builder for chaining. + */ + public Builder setNames(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureNamesIsMutable(); + names_.set(index, value); + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
        +     * The names of successful blurb creations.
        +     * 
        + * + * repeated string names = 1; + * + * @param value The names to add. + * @return This builder for chaining. + */ + public Builder addNames(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureNamesIsMutable(); + names_.add(value); + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
        +     * The names of successful blurb creations.
        +     * 
        + * + * repeated string names = 1; + * + * @param values The names to add. + * @return This builder for chaining. + */ + public Builder addAllNames(java.lang.Iterable values) { + ensureNamesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, names_); + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
        +     * The names of successful blurb creations.
        +     * 
        + * + * repeated string names = 1; + * + * @return This builder for chaining. + */ + public Builder clearNames() { + names_ = com.google.protobuf.LazyStringArrayList.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + ; + onChanged(); + return this; + } + + /** + * + * + *
        +     * The names of successful blurb creations.
        +     * 
        + * + * repeated string names = 1; + * + * @param value The bytes of the names to add. + * @return This builder for chaining. + */ + public Builder addNamesBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureNamesIsMutable(); + names_.add(value); + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.showcase.v1beta1.SendBlurbsResponse) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.SendBlurbsResponse) + private static final com.google.showcase.v1beta1.SendBlurbsResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.SendBlurbsResponse(); + } + + public static com.google.showcase.v1beta1.SendBlurbsResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SendBlurbsResponse 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.showcase.v1beta1.SendBlurbsResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/SendBlurbsResponseOrBuilder.java b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/SendBlurbsResponseOrBuilder.java new file mode 100644 index 0000000000..7d1d780a4c --- /dev/null +++ b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/SendBlurbsResponseOrBuilder.java @@ -0,0 +1,82 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: schema/google/showcase/v1beta1/messaging.proto +// Protobuf Java Version: 4.33.2 + +package com.google.showcase.v1beta1; + +@com.google.protobuf.Generated +public interface SendBlurbsResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.SendBlurbsResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
        +   * The names of successful blurb creations.
        +   * 
        + * + * repeated string names = 1; + * + * @return A list containing the names. + */ + java.util.List getNamesList(); + + /** + * + * + *
        +   * The names of successful blurb creations.
        +   * 
        + * + * repeated string names = 1; + * + * @return The count of names. + */ + int getNamesCount(); + + /** + * + * + *
        +   * The names of successful blurb creations.
        +   * 
        + * + * repeated string names = 1; + * + * @param index The index of the element to return. + * @return The names at the given index. + */ + java.lang.String getNames(int index); + + /** + * + * + *
        +   * The names of successful blurb creations.
        +   * 
        + * + * repeated string names = 1; + * + * @param index The index of the value to return. + * @return The bytes of the names at the given index. + */ + com.google.protobuf.ByteString getNamesBytes(int index); +} diff --git a/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/Sequence.java b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/Sequence.java new file mode 100644 index 0000000000..c0f7c3095c --- /dev/null +++ b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/Sequence.java @@ -0,0 +1,2089 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: schema/google/showcase/v1beta1/sequence.proto +// Protobuf Java Version: 4.33.2 + +package com.google.showcase.v1beta1; + +/** Protobuf type {@code google.showcase.v1beta1.Sequence} */ +@com.google.protobuf.Generated +public final class Sequence extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.Sequence) + SequenceOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "Sequence"); + } + + // Use Sequence.newBuilder() to construct. + private Sequence(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private Sequence() { + name_ = ""; + responses_ = java.util.Collections.emptyList(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.SequenceOuterClass + .internal_static_google_showcase_v1beta1_Sequence_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.SequenceOuterClass + .internal_static_google_showcase_v1beta1_Sequence_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.Sequence.class, + com.google.showcase.v1beta1.Sequence.Builder.class); + } + + public interface ResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.Sequence.Response) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
        +     * The status to return for an individual attempt.
        +     * 
        + * + * .google.rpc.Status status = 1; + * + * @return Whether the status field is set. + */ + boolean hasStatus(); + + /** + * + * + *
        +     * The status to return for an individual attempt.
        +     * 
        + * + * .google.rpc.Status status = 1; + * + * @return The status. + */ + com.google.rpc.Status getStatus(); + + /** + * + * + *
        +     * The status to return for an individual attempt.
        +     * 
        + * + * .google.rpc.Status status = 1; + */ + com.google.rpc.StatusOrBuilder getStatusOrBuilder(); + + /** + * + * + *
        +     * The amount of time to delay sending the response.
        +     * 
        + * + * .google.protobuf.Duration delay = 2; + * + * @return Whether the delay field is set. + */ + boolean hasDelay(); + + /** + * + * + *
        +     * The amount of time to delay sending the response.
        +     * 
        + * + * .google.protobuf.Duration delay = 2; + * + * @return The delay. + */ + com.google.protobuf.Duration getDelay(); + + /** + * + * + *
        +     * The amount of time to delay sending the response.
        +     * 
        + * + * .google.protobuf.Duration delay = 2; + */ + com.google.protobuf.DurationOrBuilder getDelayOrBuilder(); + } + + /** + * + * + *
        +   * A server response to an RPC Attempt in a sequence.
        +   * 
        + * + * Protobuf type {@code google.showcase.v1beta1.Sequence.Response} + */ + public static final class Response extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.Sequence.Response) + ResponseOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "Response"); + } + + // Use Response.newBuilder() to construct. + private Response(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private Response() {} + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.SequenceOuterClass + .internal_static_google_showcase_v1beta1_Sequence_Response_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.SequenceOuterClass + .internal_static_google_showcase_v1beta1_Sequence_Response_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.Sequence.Response.class, + com.google.showcase.v1beta1.Sequence.Response.Builder.class); + } + + private int bitField0_; + public static final int STATUS_FIELD_NUMBER = 1; + private com.google.rpc.Status status_; + + /** + * + * + *
        +     * The status to return for an individual attempt.
        +     * 
        + * + * .google.rpc.Status status = 1; + * + * @return Whether the status field is set. + */ + @java.lang.Override + public boolean hasStatus() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
        +     * The status to return for an individual attempt.
        +     * 
        + * + * .google.rpc.Status status = 1; + * + * @return The status. + */ + @java.lang.Override + public com.google.rpc.Status getStatus() { + return status_ == null ? com.google.rpc.Status.getDefaultInstance() : status_; + } + + /** + * + * + *
        +     * The status to return for an individual attempt.
        +     * 
        + * + * .google.rpc.Status status = 1; + */ + @java.lang.Override + public com.google.rpc.StatusOrBuilder getStatusOrBuilder() { + return status_ == null ? com.google.rpc.Status.getDefaultInstance() : status_; + } + + public static final int DELAY_FIELD_NUMBER = 2; + private com.google.protobuf.Duration delay_; + + /** + * + * + *
        +     * The amount of time to delay sending the response.
        +     * 
        + * + * .google.protobuf.Duration delay = 2; + * + * @return Whether the delay field is set. + */ + @java.lang.Override + public boolean hasDelay() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
        +     * The amount of time to delay sending the response.
        +     * 
        + * + * .google.protobuf.Duration delay = 2; + * + * @return The delay. + */ + @java.lang.Override + public com.google.protobuf.Duration getDelay() { + return delay_ == null ? com.google.protobuf.Duration.getDefaultInstance() : delay_; + } + + /** + * + * + *
        +     * The amount of time to delay sending the response.
        +     * 
        + * + * .google.protobuf.Duration delay = 2; + */ + @java.lang.Override + public com.google.protobuf.DurationOrBuilder getDelayOrBuilder() { + return delay_ == null ? com.google.protobuf.Duration.getDefaultInstance() : delay_; + } + + 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, getStatus()); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeMessage(2, getDelay()); + } + 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, getStatus()); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getDelay()); + } + 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.showcase.v1beta1.Sequence.Response)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.Sequence.Response other = + (com.google.showcase.v1beta1.Sequence.Response) obj; + + if (hasStatus() != other.hasStatus()) return false; + if (hasStatus()) { + if (!getStatus().equals(other.getStatus())) return false; + } + if (hasDelay() != other.hasDelay()) return false; + if (hasDelay()) { + if (!getDelay().equals(other.getDelay())) 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 (hasStatus()) { + hash = (37 * hash) + STATUS_FIELD_NUMBER; + hash = (53 * hash) + getStatus().hashCode(); + } + if (hasDelay()) { + hash = (37 * hash) + DELAY_FIELD_NUMBER; + hash = (53 * hash) + getDelay().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.showcase.v1beta1.Sequence.Response parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.Sequence.Response parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.Sequence.Response parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.Sequence.Response 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.showcase.v1beta1.Sequence.Response parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.Sequence.Response parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.Sequence.Response parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.Sequence.Response parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.showcase.v1beta1.Sequence.Response parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.Sequence.Response parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.showcase.v1beta1.Sequence.Response parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.Sequence.Response parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.showcase.v1beta1.Sequence.Response 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
        +     * A server response to an RPC Attempt in a sequence.
        +     * 
        + * + * Protobuf type {@code google.showcase.v1beta1.Sequence.Response} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.Sequence.Response) + com.google.showcase.v1beta1.Sequence.ResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.SequenceOuterClass + .internal_static_google_showcase_v1beta1_Sequence_Response_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.SequenceOuterClass + .internal_static_google_showcase_v1beta1_Sequence_Response_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.Sequence.Response.class, + com.google.showcase.v1beta1.Sequence.Response.Builder.class); + } + + // Construct using com.google.showcase.v1beta1.Sequence.Response.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetStatusFieldBuilder(); + internalGetDelayFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + status_ = null; + if (statusBuilder_ != null) { + statusBuilder_.dispose(); + statusBuilder_ = null; + } + delay_ = null; + if (delayBuilder_ != null) { + delayBuilder_.dispose(); + delayBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.showcase.v1beta1.SequenceOuterClass + .internal_static_google_showcase_v1beta1_Sequence_Response_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.Sequence.Response getDefaultInstanceForType() { + return com.google.showcase.v1beta1.Sequence.Response.getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.Sequence.Response build() { + com.google.showcase.v1beta1.Sequence.Response result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.Sequence.Response buildPartial() { + com.google.showcase.v1beta1.Sequence.Response result = + new com.google.showcase.v1beta1.Sequence.Response(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.showcase.v1beta1.Sequence.Response result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.status_ = statusBuilder_ == null ? status_ : statusBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.delay_ = delayBuilder_ == null ? delay_ : delayBuilder_.build(); + to_bitField0_ |= 0x00000002; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.showcase.v1beta1.Sequence.Response) { + return mergeFrom((com.google.showcase.v1beta1.Sequence.Response) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.showcase.v1beta1.Sequence.Response other) { + if (other == com.google.showcase.v1beta1.Sequence.Response.getDefaultInstance()) + return this; + if (other.hasStatus()) { + mergeStatus(other.getStatus()); + } + if (other.hasDelay()) { + mergeDelay(other.getDelay()); + } + 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( + internalGetStatusFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + input.readMessage(internalGetDelayFieldBuilder().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 com.google.rpc.Status status_; + private com.google.protobuf.SingleFieldBuilder< + com.google.rpc.Status, com.google.rpc.Status.Builder, com.google.rpc.StatusOrBuilder> + statusBuilder_; + + /** + * + * + *
        +       * The status to return for an individual attempt.
        +       * 
        + * + * .google.rpc.Status status = 1; + * + * @return Whether the status field is set. + */ + public boolean hasStatus() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
        +       * The status to return for an individual attempt.
        +       * 
        + * + * .google.rpc.Status status = 1; + * + * @return The status. + */ + public com.google.rpc.Status getStatus() { + if (statusBuilder_ == null) { + return status_ == null ? com.google.rpc.Status.getDefaultInstance() : status_; + } else { + return statusBuilder_.getMessage(); + } + } + + /** + * + * + *
        +       * The status to return for an individual attempt.
        +       * 
        + * + * .google.rpc.Status status = 1; + */ + public Builder setStatus(com.google.rpc.Status value) { + if (statusBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + status_ = value; + } else { + statusBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
        +       * The status to return for an individual attempt.
        +       * 
        + * + * .google.rpc.Status status = 1; + */ + public Builder setStatus(com.google.rpc.Status.Builder builderForValue) { + if (statusBuilder_ == null) { + status_ = builderForValue.build(); + } else { + statusBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
        +       * The status to return for an individual attempt.
        +       * 
        + * + * .google.rpc.Status status = 1; + */ + public Builder mergeStatus(com.google.rpc.Status value) { + if (statusBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) + && status_ != null + && status_ != com.google.rpc.Status.getDefaultInstance()) { + getStatusBuilder().mergeFrom(value); + } else { + status_ = value; + } + } else { + statusBuilder_.mergeFrom(value); + } + if (status_ != null) { + bitField0_ |= 0x00000001; + onChanged(); + } + return this; + } + + /** + * + * + *
        +       * The status to return for an individual attempt.
        +       * 
        + * + * .google.rpc.Status status = 1; + */ + public Builder clearStatus() { + bitField0_ = (bitField0_ & ~0x00000001); + status_ = null; + if (statusBuilder_ != null) { + statusBuilder_.dispose(); + statusBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
        +       * The status to return for an individual attempt.
        +       * 
        + * + * .google.rpc.Status status = 1; + */ + public com.google.rpc.Status.Builder getStatusBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return internalGetStatusFieldBuilder().getBuilder(); + } + + /** + * + * + *
        +       * The status to return for an individual attempt.
        +       * 
        + * + * .google.rpc.Status status = 1; + */ + public com.google.rpc.StatusOrBuilder getStatusOrBuilder() { + if (statusBuilder_ != null) { + return statusBuilder_.getMessageOrBuilder(); + } else { + return status_ == null ? com.google.rpc.Status.getDefaultInstance() : status_; + } + } + + /** + * + * + *
        +       * The status to return for an individual attempt.
        +       * 
        + * + * .google.rpc.Status status = 1; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.rpc.Status, com.google.rpc.Status.Builder, com.google.rpc.StatusOrBuilder> + internalGetStatusFieldBuilder() { + if (statusBuilder_ == null) { + statusBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.rpc.Status, + com.google.rpc.Status.Builder, + com.google.rpc.StatusOrBuilder>(getStatus(), getParentForChildren(), isClean()); + status_ = null; + } + return statusBuilder_; + } + + private com.google.protobuf.Duration delay_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder> + delayBuilder_; + + /** + * + * + *
        +       * The amount of time to delay sending the response.
        +       * 
        + * + * .google.protobuf.Duration delay = 2; + * + * @return Whether the delay field is set. + */ + public boolean hasDelay() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
        +       * The amount of time to delay sending the response.
        +       * 
        + * + * .google.protobuf.Duration delay = 2; + * + * @return The delay. + */ + public com.google.protobuf.Duration getDelay() { + if (delayBuilder_ == null) { + return delay_ == null ? com.google.protobuf.Duration.getDefaultInstance() : delay_; + } else { + return delayBuilder_.getMessage(); + } + } + + /** + * + * + *
        +       * The amount of time to delay sending the response.
        +       * 
        + * + * .google.protobuf.Duration delay = 2; + */ + public Builder setDelay(com.google.protobuf.Duration value) { + if (delayBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + delay_ = value; + } else { + delayBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
        +       * The amount of time to delay sending the response.
        +       * 
        + * + * .google.protobuf.Duration delay = 2; + */ + public Builder setDelay(com.google.protobuf.Duration.Builder builderForValue) { + if (delayBuilder_ == null) { + delay_ = builderForValue.build(); + } else { + delayBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
        +       * The amount of time to delay sending the response.
        +       * 
        + * + * .google.protobuf.Duration delay = 2; + */ + public Builder mergeDelay(com.google.protobuf.Duration value) { + if (delayBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && delay_ != null + && delay_ != com.google.protobuf.Duration.getDefaultInstance()) { + getDelayBuilder().mergeFrom(value); + } else { + delay_ = value; + } + } else { + delayBuilder_.mergeFrom(value); + } + if (delay_ != null) { + bitField0_ |= 0x00000002; + onChanged(); + } + return this; + } + + /** + * + * + *
        +       * The amount of time to delay sending the response.
        +       * 
        + * + * .google.protobuf.Duration delay = 2; + */ + public Builder clearDelay() { + bitField0_ = (bitField0_ & ~0x00000002); + delay_ = null; + if (delayBuilder_ != null) { + delayBuilder_.dispose(); + delayBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
        +       * The amount of time to delay sending the response.
        +       * 
        + * + * .google.protobuf.Duration delay = 2; + */ + public com.google.protobuf.Duration.Builder getDelayBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return internalGetDelayFieldBuilder().getBuilder(); + } + + /** + * + * + *
        +       * The amount of time to delay sending the response.
        +       * 
        + * + * .google.protobuf.Duration delay = 2; + */ + public com.google.protobuf.DurationOrBuilder getDelayOrBuilder() { + if (delayBuilder_ != null) { + return delayBuilder_.getMessageOrBuilder(); + } else { + return delay_ == null ? com.google.protobuf.Duration.getDefaultInstance() : delay_; + } + } + + /** + * + * + *
        +       * The amount of time to delay sending the response.
        +       * 
        + * + * .google.protobuf.Duration delay = 2; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder> + internalGetDelayFieldBuilder() { + if (delayBuilder_ == null) { + delayBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder>( + getDelay(), getParentForChildren(), isClean()); + delay_ = null; + } + return delayBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.showcase.v1beta1.Sequence.Response) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.Sequence.Response) + private static final com.google.showcase.v1beta1.Sequence.Response DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.Sequence.Response(); + } + + public static com.google.showcase.v1beta1.Sequence.Response getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Response 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.showcase.v1beta1.Sequence.Response getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + + /** + * 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; + } + } + + /** + * 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 RESPONSES_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private java.util.List responses_; + + /** + * + * + *
        +   * Sequence of responses to return in order for each attempt. If empty, the
        +   * default response is an immediate OK.
        +   * 
        + * + * repeated .google.showcase.v1beta1.Sequence.Response responses = 2; + */ + @java.lang.Override + public java.util.List getResponsesList() { + return responses_; + } + + /** + * + * + *
        +   * Sequence of responses to return in order for each attempt. If empty, the
        +   * default response is an immediate OK.
        +   * 
        + * + * repeated .google.showcase.v1beta1.Sequence.Response responses = 2; + */ + @java.lang.Override + public java.util.List + getResponsesOrBuilderList() { + return responses_; + } + + /** + * + * + *
        +   * Sequence of responses to return in order for each attempt. If empty, the
        +   * default response is an immediate OK.
        +   * 
        + * + * repeated .google.showcase.v1beta1.Sequence.Response responses = 2; + */ + @java.lang.Override + public int getResponsesCount() { + return responses_.size(); + } + + /** + * + * + *
        +   * Sequence of responses to return in order for each attempt. If empty, the
        +   * default response is an immediate OK.
        +   * 
        + * + * repeated .google.showcase.v1beta1.Sequence.Response responses = 2; + */ + @java.lang.Override + public com.google.showcase.v1beta1.Sequence.Response getResponses(int index) { + return responses_.get(index); + } + + /** + * + * + *
        +   * Sequence of responses to return in order for each attempt. If empty, the
        +   * default response is an immediate OK.
        +   * 
        + * + * repeated .google.showcase.v1beta1.Sequence.Response responses = 2; + */ + @java.lang.Override + public com.google.showcase.v1beta1.Sequence.ResponseOrBuilder getResponsesOrBuilder(int index) { + return responses_.get(index); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, name_); + } + for (int i = 0; i < responses_.size(); i++) { + output.writeMessage(2, responses_.get(i)); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, name_); + } + for (int i = 0; i < responses_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, responses_.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.showcase.v1beta1.Sequence)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.Sequence other = (com.google.showcase.v1beta1.Sequence) obj; + + if (!getName().equals(other.getName())) return false; + if (!getResponsesList().equals(other.getResponsesList())) 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 (getResponsesCount() > 0) { + hash = (37 * hash) + RESPONSES_FIELD_NUMBER; + hash = (53 * hash) + getResponsesList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.showcase.v1beta1.Sequence parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.Sequence parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.Sequence parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.Sequence 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.showcase.v1beta1.Sequence parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.Sequence parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.Sequence parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.Sequence parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.showcase.v1beta1.Sequence parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.Sequence parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.showcase.v1beta1.Sequence parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.Sequence parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.showcase.v1beta1.Sequence 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** Protobuf type {@code google.showcase.v1beta1.Sequence} */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.Sequence) + com.google.showcase.v1beta1.SequenceOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.SequenceOuterClass + .internal_static_google_showcase_v1beta1_Sequence_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.SequenceOuterClass + .internal_static_google_showcase_v1beta1_Sequence_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.Sequence.class, + com.google.showcase.v1beta1.Sequence.Builder.class); + } + + // Construct using com.google.showcase.v1beta1.Sequence.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + if (responsesBuilder_ == null) { + responses_ = java.util.Collections.emptyList(); + } else { + responses_ = null; + responsesBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000002); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.showcase.v1beta1.SequenceOuterClass + .internal_static_google_showcase_v1beta1_Sequence_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.Sequence getDefaultInstanceForType() { + return com.google.showcase.v1beta1.Sequence.getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.Sequence build() { + com.google.showcase.v1beta1.Sequence result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.Sequence buildPartial() { + com.google.showcase.v1beta1.Sequence result = new com.google.showcase.v1beta1.Sequence(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields(com.google.showcase.v1beta1.Sequence result) { + if (responsesBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0)) { + responses_ = java.util.Collections.unmodifiableList(responses_); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.responses_ = responses_; + } else { + result.responses_ = responsesBuilder_.build(); + } + } + + private void buildPartial0(com.google.showcase.v1beta1.Sequence result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.showcase.v1beta1.Sequence) { + return mergeFrom((com.google.showcase.v1beta1.Sequence) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.showcase.v1beta1.Sequence other) { + if (other == com.google.showcase.v1beta1.Sequence.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (responsesBuilder_ == null) { + if (!other.responses_.isEmpty()) { + if (responses_.isEmpty()) { + responses_ = other.responses_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureResponsesIsMutable(); + responses_.addAll(other.responses_); + } + onChanged(); + } + } else { + if (!other.responses_.isEmpty()) { + if (responsesBuilder_.isEmpty()) { + responsesBuilder_.dispose(); + responsesBuilder_ = null; + responses_ = other.responses_; + bitField0_ = (bitField0_ & ~0x00000002); + responsesBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders + ? internalGetResponsesFieldBuilder() + : null; + } else { + responsesBuilder_.addAllMessages(other.responses_); + } + } + } + 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: + { + com.google.showcase.v1beta1.Sequence.Response m = + input.readMessage( + com.google.showcase.v1beta1.Sequence.Response.parser(), extensionRegistry); + if (responsesBuilder_ == null) { + ensureResponsesIsMutable(); + responses_.add(m); + } else { + responsesBuilder_.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.lang.Object name_ = ""; + + /** + * 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; + } + } + + /** + * 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; + } + } + + /** + * 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; + } + + /** + * 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; + } + + /** + * 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.util.List responses_ = + java.util.Collections.emptyList(); + + private void ensureResponsesIsMutable() { + if (!((bitField0_ & 0x00000002) != 0)) { + responses_ = + new java.util.ArrayList(responses_); + bitField0_ |= 0x00000002; + } + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.google.showcase.v1beta1.Sequence.Response, + com.google.showcase.v1beta1.Sequence.Response.Builder, + com.google.showcase.v1beta1.Sequence.ResponseOrBuilder> + responsesBuilder_; + + /** + * + * + *
        +     * Sequence of responses to return in order for each attempt. If empty, the
        +     * default response is an immediate OK.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Sequence.Response responses = 2; + */ + public java.util.List getResponsesList() { + if (responsesBuilder_ == null) { + return java.util.Collections.unmodifiableList(responses_); + } else { + return responsesBuilder_.getMessageList(); + } + } + + /** + * + * + *
        +     * Sequence of responses to return in order for each attempt. If empty, the
        +     * default response is an immediate OK.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Sequence.Response responses = 2; + */ + public int getResponsesCount() { + if (responsesBuilder_ == null) { + return responses_.size(); + } else { + return responsesBuilder_.getCount(); + } + } + + /** + * + * + *
        +     * Sequence of responses to return in order for each attempt. If empty, the
        +     * default response is an immediate OK.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Sequence.Response responses = 2; + */ + public com.google.showcase.v1beta1.Sequence.Response getResponses(int index) { + if (responsesBuilder_ == null) { + return responses_.get(index); + } else { + return responsesBuilder_.getMessage(index); + } + } + + /** + * + * + *
        +     * Sequence of responses to return in order for each attempt. If empty, the
        +     * default response is an immediate OK.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Sequence.Response responses = 2; + */ + public Builder setResponses(int index, com.google.showcase.v1beta1.Sequence.Response value) { + if (responsesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureResponsesIsMutable(); + responses_.set(index, value); + onChanged(); + } else { + responsesBuilder_.setMessage(index, value); + } + return this; + } + + /** + * + * + *
        +     * Sequence of responses to return in order for each attempt. If empty, the
        +     * default response is an immediate OK.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Sequence.Response responses = 2; + */ + public Builder setResponses( + int index, com.google.showcase.v1beta1.Sequence.Response.Builder builderForValue) { + if (responsesBuilder_ == null) { + ensureResponsesIsMutable(); + responses_.set(index, builderForValue.build()); + onChanged(); + } else { + responsesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
        +     * Sequence of responses to return in order for each attempt. If empty, the
        +     * default response is an immediate OK.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Sequence.Response responses = 2; + */ + public Builder addResponses(com.google.showcase.v1beta1.Sequence.Response value) { + if (responsesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureResponsesIsMutable(); + responses_.add(value); + onChanged(); + } else { + responsesBuilder_.addMessage(value); + } + return this; + } + + /** + * + * + *
        +     * Sequence of responses to return in order for each attempt. If empty, the
        +     * default response is an immediate OK.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Sequence.Response responses = 2; + */ + public Builder addResponses(int index, com.google.showcase.v1beta1.Sequence.Response value) { + if (responsesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureResponsesIsMutable(); + responses_.add(index, value); + onChanged(); + } else { + responsesBuilder_.addMessage(index, value); + } + return this; + } + + /** + * + * + *
        +     * Sequence of responses to return in order for each attempt. If empty, the
        +     * default response is an immediate OK.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Sequence.Response responses = 2; + */ + public Builder addResponses( + com.google.showcase.v1beta1.Sequence.Response.Builder builderForValue) { + if (responsesBuilder_ == null) { + ensureResponsesIsMutable(); + responses_.add(builderForValue.build()); + onChanged(); + } else { + responsesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + + /** + * + * + *
        +     * Sequence of responses to return in order for each attempt. If empty, the
        +     * default response is an immediate OK.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Sequence.Response responses = 2; + */ + public Builder addResponses( + int index, com.google.showcase.v1beta1.Sequence.Response.Builder builderForValue) { + if (responsesBuilder_ == null) { + ensureResponsesIsMutable(); + responses_.add(index, builderForValue.build()); + onChanged(); + } else { + responsesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
        +     * Sequence of responses to return in order for each attempt. If empty, the
        +     * default response is an immediate OK.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Sequence.Response responses = 2; + */ + public Builder addAllResponses( + java.lang.Iterable values) { + if (responsesBuilder_ == null) { + ensureResponsesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, responses_); + onChanged(); + } else { + responsesBuilder_.addAllMessages(values); + } + return this; + } + + /** + * + * + *
        +     * Sequence of responses to return in order for each attempt. If empty, the
        +     * default response is an immediate OK.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Sequence.Response responses = 2; + */ + public Builder clearResponses() { + if (responsesBuilder_ == null) { + responses_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + } else { + responsesBuilder_.clear(); + } + return this; + } + + /** + * + * + *
        +     * Sequence of responses to return in order for each attempt. If empty, the
        +     * default response is an immediate OK.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Sequence.Response responses = 2; + */ + public Builder removeResponses(int index) { + if (responsesBuilder_ == null) { + ensureResponsesIsMutable(); + responses_.remove(index); + onChanged(); + } else { + responsesBuilder_.remove(index); + } + return this; + } + + /** + * + * + *
        +     * Sequence of responses to return in order for each attempt. If empty, the
        +     * default response is an immediate OK.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Sequence.Response responses = 2; + */ + public com.google.showcase.v1beta1.Sequence.Response.Builder getResponsesBuilder(int index) { + return internalGetResponsesFieldBuilder().getBuilder(index); + } + + /** + * + * + *
        +     * Sequence of responses to return in order for each attempt. If empty, the
        +     * default response is an immediate OK.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Sequence.Response responses = 2; + */ + public com.google.showcase.v1beta1.Sequence.ResponseOrBuilder getResponsesOrBuilder(int index) { + if (responsesBuilder_ == null) { + return responses_.get(index); + } else { + return responsesBuilder_.getMessageOrBuilder(index); + } + } + + /** + * + * + *
        +     * Sequence of responses to return in order for each attempt. If empty, the
        +     * default response is an immediate OK.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Sequence.Response responses = 2; + */ + public java.util.List + getResponsesOrBuilderList() { + if (responsesBuilder_ != null) { + return responsesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(responses_); + } + } + + /** + * + * + *
        +     * Sequence of responses to return in order for each attempt. If empty, the
        +     * default response is an immediate OK.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Sequence.Response responses = 2; + */ + public com.google.showcase.v1beta1.Sequence.Response.Builder addResponsesBuilder() { + return internalGetResponsesFieldBuilder() + .addBuilder(com.google.showcase.v1beta1.Sequence.Response.getDefaultInstance()); + } + + /** + * + * + *
        +     * Sequence of responses to return in order for each attempt. If empty, the
        +     * default response is an immediate OK.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Sequence.Response responses = 2; + */ + public com.google.showcase.v1beta1.Sequence.Response.Builder addResponsesBuilder(int index) { + return internalGetResponsesFieldBuilder() + .addBuilder(index, com.google.showcase.v1beta1.Sequence.Response.getDefaultInstance()); + } + + /** + * + * + *
        +     * Sequence of responses to return in order for each attempt. If empty, the
        +     * default response is an immediate OK.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Sequence.Response responses = 2; + */ + public java.util.List + getResponsesBuilderList() { + return internalGetResponsesFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.google.showcase.v1beta1.Sequence.Response, + com.google.showcase.v1beta1.Sequence.Response.Builder, + com.google.showcase.v1beta1.Sequence.ResponseOrBuilder> + internalGetResponsesFieldBuilder() { + if (responsesBuilder_ == null) { + responsesBuilder_ = + new com.google.protobuf.RepeatedFieldBuilder< + com.google.showcase.v1beta1.Sequence.Response, + com.google.showcase.v1beta1.Sequence.Response.Builder, + com.google.showcase.v1beta1.Sequence.ResponseOrBuilder>( + responses_, ((bitField0_ & 0x00000002) != 0), getParentForChildren(), isClean()); + responses_ = null; + } + return responsesBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.showcase.v1beta1.Sequence) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.Sequence) + private static final com.google.showcase.v1beta1.Sequence DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.Sequence(); + } + + public static com.google.showcase.v1beta1.Sequence getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Sequence 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.showcase.v1beta1.Sequence getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/SequenceName.java b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/SequenceName.java new file mode 100644 index 0000000000..a4703d1b39 --- /dev/null +++ b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/SequenceName.java @@ -0,0 +1,168 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1; + +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +@Generated("by gapic-generator-java") +public class SequenceName implements ResourceName { + private static final PathTemplate SEQUENCE = + PathTemplate.createWithoutUrlEncoding("sequences/{sequence}"); + private volatile Map fieldValuesMap; + private final String sequence; + + @Deprecated + protected SequenceName() { + sequence = null; + } + + private SequenceName(Builder builder) { + sequence = Preconditions.checkNotNull(builder.getSequence()); + } + + public String getSequence() { + return sequence; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + public static SequenceName of(String sequence) { + return newBuilder().setSequence(sequence).build(); + } + + public static String format(String sequence) { + return newBuilder().setSequence(sequence).build().toString(); + } + + public static SequenceName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + SEQUENCE.validatedMatch( + formattedString, "SequenceName.parse: formattedString not in valid format"); + return of(matchMap.get("sequence")); + } + + 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 (SequenceName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return SEQUENCE.matches(formattedString); + } + + @Override + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + if (sequence != null) { + fieldMapBuilder.put("sequence", sequence); + } + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return SEQUENCE.instantiate("sequence", sequence); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o != null && getClass() == o.getClass()) { + SequenceName that = ((SequenceName) o); + return Objects.equals(this.sequence, that.sequence); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= Objects.hashCode(sequence); + return h; + } + + /** Builder for sequences/{sequence}. */ + public static class Builder { + private String sequence; + + protected Builder() {} + + public String getSequence() { + return sequence; + } + + public Builder setSequence(String sequence) { + this.sequence = sequence; + return this; + } + + private Builder(SequenceName sequenceName) { + this.sequence = sequenceName.sequence; + } + + public SequenceName build() { + return new SequenceName(this); + } + } +} diff --git a/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/SequenceOrBuilder.java b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/SequenceOrBuilder.java new file mode 100644 index 0000000000..149a5fb019 --- /dev/null +++ b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/SequenceOrBuilder.java @@ -0,0 +1,103 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: schema/google/showcase/v1beta1/sequence.proto +// Protobuf Java Version: 4.33.2 + +package com.google.showcase.v1beta1; + +@com.google.protobuf.Generated +public interface SequenceOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.Sequence) + com.google.protobuf.MessageOrBuilder { + + /** + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The name. + */ + java.lang.String getName(); + + /** + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
        +   * Sequence of responses to return in order for each attempt. If empty, the
        +   * default response is an immediate OK.
        +   * 
        + * + * repeated .google.showcase.v1beta1.Sequence.Response responses = 2; + */ + java.util.List getResponsesList(); + + /** + * + * + *
        +   * Sequence of responses to return in order for each attempt. If empty, the
        +   * default response is an immediate OK.
        +   * 
        + * + * repeated .google.showcase.v1beta1.Sequence.Response responses = 2; + */ + com.google.showcase.v1beta1.Sequence.Response getResponses(int index); + + /** + * + * + *
        +   * Sequence of responses to return in order for each attempt. If empty, the
        +   * default response is an immediate OK.
        +   * 
        + * + * repeated .google.showcase.v1beta1.Sequence.Response responses = 2; + */ + int getResponsesCount(); + + /** + * + * + *
        +   * Sequence of responses to return in order for each attempt. If empty, the
        +   * default response is an immediate OK.
        +   * 
        + * + * repeated .google.showcase.v1beta1.Sequence.Response responses = 2; + */ + java.util.List + getResponsesOrBuilderList(); + + /** + * + * + *
        +   * Sequence of responses to return in order for each attempt. If empty, the
        +   * default response is an immediate OK.
        +   * 
        + * + * repeated .google.showcase.v1beta1.Sequence.Response responses = 2; + */ + com.google.showcase.v1beta1.Sequence.ResponseOrBuilder getResponsesOrBuilder(int index); +} diff --git a/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/SequenceOuterClass.java b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/SequenceOuterClass.java new file mode 100644 index 0000000000..4df5daf93d --- /dev/null +++ b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/SequenceOuterClass.java @@ -0,0 +1,359 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: schema/google/showcase/v1beta1/sequence.proto +// Protobuf Java Version: 4.33.2 + +package com.google.showcase.v1beta1; + +@com.google.protobuf.Generated +public final class SequenceOuterClass extends com.google.protobuf.GeneratedFile { + private SequenceOuterClass() {} + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "SequenceOuterClass"); + } + + 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_showcase_v1beta1_Sequence_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_showcase_v1beta1_Sequence_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_showcase_v1beta1_Sequence_Response_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_showcase_v1beta1_Sequence_Response_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_showcase_v1beta1_StreamingSequence_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_showcase_v1beta1_StreamingSequence_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_showcase_v1beta1_StreamingSequence_Response_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_showcase_v1beta1_StreamingSequence_Response_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_showcase_v1beta1_StreamingSequenceReport_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_showcase_v1beta1_StreamingSequenceReport_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_showcase_v1beta1_StreamingSequenceReport_Attempt_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_showcase_v1beta1_StreamingSequenceReport_Attempt_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_showcase_v1beta1_SequenceReport_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_showcase_v1beta1_SequenceReport_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_showcase_v1beta1_SequenceReport_Attempt_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_showcase_v1beta1_SequenceReport_Attempt_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_showcase_v1beta1_CreateSequenceRequest_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_showcase_v1beta1_CreateSequenceRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_showcase_v1beta1_CreateStreamingSequenceRequest_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_showcase_v1beta1_CreateStreamingSequenceRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_showcase_v1beta1_AttemptSequenceRequest_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_showcase_v1beta1_AttemptSequenceRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_showcase_v1beta1_AttemptStreamingSequenceRequest_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_showcase_v1beta1_AttemptStreamingSequenceRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_showcase_v1beta1_AttemptStreamingSequenceResponse_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_showcase_v1beta1_AttemptStreamingSequenceResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_showcase_v1beta1_GetSequenceReportRequest_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_showcase_v1beta1_GetSequenceReportRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_showcase_v1beta1_GetStreamingSequenceReportRequest_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_showcase_v1beta1_GetStreamingSequenceReportRequest_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-schema/google/showcase/v1beta1/sequenc" + + "e.proto\022\027google.showcase.v1beta1\032\034google" + + "/api/annotations.proto\032\027google/api/clien" + + "t.proto\032\037google/api/field_behavior.proto" + + "\032\031google/api/resource.proto\032\036google/prot" + + "obuf/duration.proto\032\033google/protobuf/emp" + + "ty.proto\032\037google/protobuf/timestamp.prot" + + "o\032\027google/rpc/status.proto\"\363\001\n\010Sequence\022" + + "\021\n\004name\030\001 \001(\tB\003\340A\003\022=\n\tresponses\030\002 \003(\0132*." + + "google.showcase.v1beta1.Sequence.Respons" + + "e\032X\n\010Response\022\"\n\006status\030\001 \001(\0132\022.google.r" + + "pc.Status\022(\n\005delay\030\002 \001(\0132\031.google.protob" + + "uf.Duration:;\352A8\n showcase.googleapis.co" + + "m/Sequence\022\024sequences/{sequence}\"\312\002\n\021Str" + + "eamingSequence\022\021\n\004name\030\001 \001(\tB\003\340A\003\022\017\n\007con" + + "tent\030\002 \001(\t\022F\n\tresponses\030\003 \003(\01323.google.s" + + "howcase.v1beta1.StreamingSequence.Respon" + + "se\032p\n\010Response\022\"\n\006status\030\001 \001(\0132\022.google." + + "rpc.Status\022(\n\005delay\030\002 \001(\0132\031.google.proto" + + "buf.Duration\022\026\n\016response_index\030\003 \001(\005:W\352A" + + "T\n)showcase.googleapis.com/StreamingSequ" + + "ence\022\'streamingSequences/{streaming_sequ" + + "ence}\"\322\003\n\027StreamingSequenceReport\022\021\n\004nam" + + "e\030\001 \001(\tB\003\340A\003\022J\n\010attempts\030\002 \003(\01328.google." + + "showcase.v1beta1.StreamingSequenceReport" + + ".Attempt\032\340\001\n\007Attempt\022\026\n\016attempt_number\030\001" + + " \001(\005\0224\n\020attempt_deadline\030\002 \001(\0132\032.google." + + "protobuf.Timestamp\0221\n\rresponse_time\030\003 \001(" + + "\0132\032.google.protobuf.Timestamp\0220\n\rattempt" + + "_delay\030\004 \001(\0132\031.google.protobuf.Duration\022" + + "\"\n\006status\030\005 \001(\0132\022.google.rpc.Status:u\352Ar" + + "\n/showcase.googleapis.com/StreamingSeque" + + "nceReport\022?streamingSequences/{streaming" + + "_sequence}/streamingSequenceReport\"\233\003\n\016S" + + "equenceReport\022\021\n\004name\030\001 \001(\tB\003\340A\003\022A\n\010atte" + + "mpts\030\002 \003(\0132/.google.showcase.v1beta1.Seq" + + "uenceReport.Attempt\032\340\001\n\007Attempt\022\026\n\016attem" + + "pt_number\030\001 \001(\005\0224\n\020attempt_deadline\030\002 \001(" + + "\0132\032.google.protobuf.Timestamp\0221\n\rrespons" + + "e_time\030\003 \001(\0132\032.google.protobuf.Timestamp" + + "\0220\n\rattempt_delay\030\004 \001(\0132\031.google.protobu" + + "f.Duration\022\"\n\006status\030\005 \001(\0132\022.google.rpc." + + "Status:P\352AM\n&showcase.googleapis.com/Seq" + + "uenceReport\022#sequences/{sequence}/sequen" + + "ceReport\"L\n\025CreateSequenceRequest\0223\n\010seq" + + "uence\030\001 \001(\0132!.google.showcase.v1beta1.Se" + + "quence\"h\n\036CreateStreamingSequenceRequest" + + "\022F\n\022streaming_sequence\030\001 \001(\0132*.google.sh" + + "owcase.v1beta1.StreamingSequence\"P\n\026Atte" + + "mptSequenceRequest\0226\n\004name\030\001 \001(\tB(\340A\002\372A\"" + + "\n showcase.googleapis.com/Sequence\"\200\001\n\037A" + + "ttemptStreamingSequenceRequest\022?\n\004name\030\001" + + " \001(\tB1\340A\002\372A+\n)showcase.googleapis.com/St" + + "reamingSequence\022\034\n\017last_fail_index\030\002 \001(\005" + + "B\003\340A\001\"3\n AttemptStreamingSequenceRespons" + + "e\022\017\n\007content\030\001 \001(\t\"X\n\030GetSequenceReportR" + + "equest\022<\n\004name\030\001 \001(\tB.\340A\002\372A(\n&showcase.g" + + "oogleapis.com/SequenceReport\"j\n!GetStrea" + + "mingSequenceReportRequest\022E\n\004name\030\001 \001(\tB" + + "7\340A\002\372A1\n/showcase.googleapis.com/Streami" + + "ngSequenceReport2\360\010\n\017SequenceService\022\224\001\n" + + "\016CreateSequence\022..google.showcase.v1beta" + + "1.CreateSequenceRequest\032!.google.showcas" + + "e.v1beta1.Sequence\"/\332A\010sequence\202\323\344\223\002\036\"\022/" + + "v1beta1/sequences:\010sequence\022\314\001\n\027CreateSt" + + "reamingSequence\0227.google.showcase.v1beta" + + "1.CreateStreamingSequenceRequest\032*.googl" + + "e.showcase.v1beta1.StreamingSequence\"L\332A" + + "\022streaming_sequence\202\323\344\223\0021\"\033/v1beta1/stre" + + "amingSequences:\022streaming_sequence\022\252\001\n\021G" + + "etSequenceReport\0221.google.showcase.v1bet" + + "a1.GetSequenceReportRequest\032\'.google.sho" + + "wcase.v1beta1.SequenceReport\"9\332A\004name\202\323\344" + + "\223\002,\022*/v1beta1/{name=sequences/*/sequence" + + "Report}\022\327\001\n\032GetStreamingSequenceReport\022:" + + ".google.showcase.v1beta1.GetStreamingSeq" + + "uenceReportRequest\0320.google.showcase.v1b" + + "eta1.StreamingSequenceReport\"K\332A\004name\202\323\344" + + "\223\002>\022 builder) { + super(builder); + } + + private SequenceReport() { + name_ = ""; + attempts_ = java.util.Collections.emptyList(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.SequenceOuterClass + .internal_static_google_showcase_v1beta1_SequenceReport_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.SequenceOuterClass + .internal_static_google_showcase_v1beta1_SequenceReport_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.SequenceReport.class, + com.google.showcase.v1beta1.SequenceReport.Builder.class); + } + + public interface AttemptOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.SequenceReport.Attempt) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
        +     * The attempt number - starting at 0.
        +     * 
        + * + * int32 attempt_number = 1; + * + * @return The attemptNumber. + */ + int getAttemptNumber(); + + /** + * + * + *
        +     * The deadline dictated by the attempt to the server.
        +     * 
        + * + * .google.protobuf.Timestamp attempt_deadline = 2; + * + * @return Whether the attemptDeadline field is set. + */ + boolean hasAttemptDeadline(); + + /** + * + * + *
        +     * The deadline dictated by the attempt to the server.
        +     * 
        + * + * .google.protobuf.Timestamp attempt_deadline = 2; + * + * @return The attemptDeadline. + */ + com.google.protobuf.Timestamp getAttemptDeadline(); + + /** + * + * + *
        +     * The deadline dictated by the attempt to the server.
        +     * 
        + * + * .google.protobuf.Timestamp attempt_deadline = 2; + */ + com.google.protobuf.TimestampOrBuilder getAttemptDeadlineOrBuilder(); + + /** + * + * + *
        +     * The time that the server responded to the RPC attempt. Used for
        +     * calculating attempt_delay.
        +     * 
        + * + * .google.protobuf.Timestamp response_time = 3; + * + * @return Whether the responseTime field is set. + */ + boolean hasResponseTime(); + + /** + * + * + *
        +     * The time that the server responded to the RPC attempt. Used for
        +     * calculating attempt_delay.
        +     * 
        + * + * .google.protobuf.Timestamp response_time = 3; + * + * @return The responseTime. + */ + com.google.protobuf.Timestamp getResponseTime(); + + /** + * + * + *
        +     * The time that the server responded to the RPC attempt. Used for
        +     * calculating attempt_delay.
        +     * 
        + * + * .google.protobuf.Timestamp response_time = 3; + */ + com.google.protobuf.TimestampOrBuilder getResponseTimeOrBuilder(); + + /** + * + * + *
        +     * The server perceived delay between sending the last response and
        +     * receiving this attempt. Used for validating attempt delay backoff.
        +     * 
        + * + * .google.protobuf.Duration attempt_delay = 4; + * + * @return Whether the attemptDelay field is set. + */ + boolean hasAttemptDelay(); + + /** + * + * + *
        +     * The server perceived delay between sending the last response and
        +     * receiving this attempt. Used for validating attempt delay backoff.
        +     * 
        + * + * .google.protobuf.Duration attempt_delay = 4; + * + * @return The attemptDelay. + */ + com.google.protobuf.Duration getAttemptDelay(); + + /** + * + * + *
        +     * The server perceived delay between sending the last response and
        +     * receiving this attempt. Used for validating attempt delay backoff.
        +     * 
        + * + * .google.protobuf.Duration attempt_delay = 4; + */ + com.google.protobuf.DurationOrBuilder getAttemptDelayOrBuilder(); + + /** + * + * + *
        +     * The status returned to the attempt.
        +     * 
        + * + * .google.rpc.Status status = 5; + * + * @return Whether the status field is set. + */ + boolean hasStatus(); + + /** + * + * + *
        +     * The status returned to the attempt.
        +     * 
        + * + * .google.rpc.Status status = 5; + * + * @return The status. + */ + com.google.rpc.Status getStatus(); + + /** + * + * + *
        +     * The status returned to the attempt.
        +     * 
        + * + * .google.rpc.Status status = 5; + */ + com.google.rpc.StatusOrBuilder getStatusOrBuilder(); + } + + /** + * + * + *
        +   * Contains metrics on individual RPC Attempts in a sequence.
        +   * 
        + * + * Protobuf type {@code google.showcase.v1beta1.SequenceReport.Attempt} + */ + public static final class Attempt extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.SequenceReport.Attempt) + AttemptOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "Attempt"); + } + + // Use Attempt.newBuilder() to construct. + private Attempt(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private Attempt() {} + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.SequenceOuterClass + .internal_static_google_showcase_v1beta1_SequenceReport_Attempt_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.SequenceOuterClass + .internal_static_google_showcase_v1beta1_SequenceReport_Attempt_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.SequenceReport.Attempt.class, + com.google.showcase.v1beta1.SequenceReport.Attempt.Builder.class); + } + + private int bitField0_; + public static final int ATTEMPT_NUMBER_FIELD_NUMBER = 1; + private int attemptNumber_ = 0; + + /** + * + * + *
        +     * The attempt number - starting at 0.
        +     * 
        + * + * int32 attempt_number = 1; + * + * @return The attemptNumber. + */ + @java.lang.Override + public int getAttemptNumber() { + return attemptNumber_; + } + + public static final int ATTEMPT_DEADLINE_FIELD_NUMBER = 2; + private com.google.protobuf.Timestamp attemptDeadline_; + + /** + * + * + *
        +     * The deadline dictated by the attempt to the server.
        +     * 
        + * + * .google.protobuf.Timestamp attempt_deadline = 2; + * + * @return Whether the attemptDeadline field is set. + */ + @java.lang.Override + public boolean hasAttemptDeadline() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
        +     * The deadline dictated by the attempt to the server.
        +     * 
        + * + * .google.protobuf.Timestamp attempt_deadline = 2; + * + * @return The attemptDeadline. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getAttemptDeadline() { + return attemptDeadline_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : attemptDeadline_; + } + + /** + * + * + *
        +     * The deadline dictated by the attempt to the server.
        +     * 
        + * + * .google.protobuf.Timestamp attempt_deadline = 2; + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getAttemptDeadlineOrBuilder() { + return attemptDeadline_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : attemptDeadline_; + } + + public static final int RESPONSE_TIME_FIELD_NUMBER = 3; + private com.google.protobuf.Timestamp responseTime_; + + /** + * + * + *
        +     * The time that the server responded to the RPC attempt. Used for
        +     * calculating attempt_delay.
        +     * 
        + * + * .google.protobuf.Timestamp response_time = 3; + * + * @return Whether the responseTime field is set. + */ + @java.lang.Override + public boolean hasResponseTime() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
        +     * The time that the server responded to the RPC attempt. Used for
        +     * calculating attempt_delay.
        +     * 
        + * + * .google.protobuf.Timestamp response_time = 3; + * + * @return The responseTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getResponseTime() { + return responseTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : responseTime_; + } + + /** + * + * + *
        +     * The time that the server responded to the RPC attempt. Used for
        +     * calculating attempt_delay.
        +     * 
        + * + * .google.protobuf.Timestamp response_time = 3; + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getResponseTimeOrBuilder() { + return responseTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : responseTime_; + } + + public static final int ATTEMPT_DELAY_FIELD_NUMBER = 4; + private com.google.protobuf.Duration attemptDelay_; + + /** + * + * + *
        +     * The server perceived delay between sending the last response and
        +     * receiving this attempt. Used for validating attempt delay backoff.
        +     * 
        + * + * .google.protobuf.Duration attempt_delay = 4; + * + * @return Whether the attemptDelay field is set. + */ + @java.lang.Override + public boolean hasAttemptDelay() { + return ((bitField0_ & 0x00000004) != 0); + } + + /** + * + * + *
        +     * The server perceived delay between sending the last response and
        +     * receiving this attempt. Used for validating attempt delay backoff.
        +     * 
        + * + * .google.protobuf.Duration attempt_delay = 4; + * + * @return The attemptDelay. + */ + @java.lang.Override + public com.google.protobuf.Duration getAttemptDelay() { + return attemptDelay_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : attemptDelay_; + } + + /** + * + * + *
        +     * The server perceived delay between sending the last response and
        +     * receiving this attempt. Used for validating attempt delay backoff.
        +     * 
        + * + * .google.protobuf.Duration attempt_delay = 4; + */ + @java.lang.Override + public com.google.protobuf.DurationOrBuilder getAttemptDelayOrBuilder() { + return attemptDelay_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : attemptDelay_; + } + + public static final int STATUS_FIELD_NUMBER = 5; + private com.google.rpc.Status status_; + + /** + * + * + *
        +     * The status returned to the attempt.
        +     * 
        + * + * .google.rpc.Status status = 5; + * + * @return Whether the status field is set. + */ + @java.lang.Override + public boolean hasStatus() { + return ((bitField0_ & 0x00000008) != 0); + } + + /** + * + * + *
        +     * The status returned to the attempt.
        +     * 
        + * + * .google.rpc.Status status = 5; + * + * @return The status. + */ + @java.lang.Override + public com.google.rpc.Status getStatus() { + return status_ == null ? com.google.rpc.Status.getDefaultInstance() : status_; + } + + /** + * + * + *
        +     * The status returned to the attempt.
        +     * 
        + * + * .google.rpc.Status status = 5; + */ + @java.lang.Override + public com.google.rpc.StatusOrBuilder getStatusOrBuilder() { + return status_ == null ? com.google.rpc.Status.getDefaultInstance() : status_; + } + + 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 (attemptNumber_ != 0) { + output.writeInt32(1, attemptNumber_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(2, getAttemptDeadline()); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeMessage(3, getResponseTime()); + } + if (((bitField0_ & 0x00000004) != 0)) { + output.writeMessage(4, getAttemptDelay()); + } + if (((bitField0_ & 0x00000008) != 0)) { + output.writeMessage(5, getStatus()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (attemptNumber_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(1, attemptNumber_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getAttemptDeadline()); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getResponseTime()); + } + if (((bitField0_ & 0x00000004) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, getAttemptDelay()); + } + if (((bitField0_ & 0x00000008) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(5, getStatus()); + } + 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.showcase.v1beta1.SequenceReport.Attempt)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.SequenceReport.Attempt other = + (com.google.showcase.v1beta1.SequenceReport.Attempt) obj; + + if (getAttemptNumber() != other.getAttemptNumber()) return false; + if (hasAttemptDeadline() != other.hasAttemptDeadline()) return false; + if (hasAttemptDeadline()) { + if (!getAttemptDeadline().equals(other.getAttemptDeadline())) return false; + } + if (hasResponseTime() != other.hasResponseTime()) return false; + if (hasResponseTime()) { + if (!getResponseTime().equals(other.getResponseTime())) return false; + } + if (hasAttemptDelay() != other.hasAttemptDelay()) return false; + if (hasAttemptDelay()) { + if (!getAttemptDelay().equals(other.getAttemptDelay())) return false; + } + if (hasStatus() != other.hasStatus()) return false; + if (hasStatus()) { + if (!getStatus().equals(other.getStatus())) 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) + ATTEMPT_NUMBER_FIELD_NUMBER; + hash = (53 * hash) + getAttemptNumber(); + if (hasAttemptDeadline()) { + hash = (37 * hash) + ATTEMPT_DEADLINE_FIELD_NUMBER; + hash = (53 * hash) + getAttemptDeadline().hashCode(); + } + if (hasResponseTime()) { + hash = (37 * hash) + RESPONSE_TIME_FIELD_NUMBER; + hash = (53 * hash) + getResponseTime().hashCode(); + } + if (hasAttemptDelay()) { + hash = (37 * hash) + ATTEMPT_DELAY_FIELD_NUMBER; + hash = (53 * hash) + getAttemptDelay().hashCode(); + } + if (hasStatus()) { + hash = (37 * hash) + STATUS_FIELD_NUMBER; + hash = (53 * hash) + getStatus().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.showcase.v1beta1.SequenceReport.Attempt parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.SequenceReport.Attempt parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.SequenceReport.Attempt parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.SequenceReport.Attempt 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.showcase.v1beta1.SequenceReport.Attempt parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.SequenceReport.Attempt parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.SequenceReport.Attempt parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.SequenceReport.Attempt parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.showcase.v1beta1.SequenceReport.Attempt parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.SequenceReport.Attempt parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.showcase.v1beta1.SequenceReport.Attempt parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.SequenceReport.Attempt parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.showcase.v1beta1.SequenceReport.Attempt 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
        +     * Contains metrics on individual RPC Attempts in a sequence.
        +     * 
        + * + * Protobuf type {@code google.showcase.v1beta1.SequenceReport.Attempt} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.SequenceReport.Attempt) + com.google.showcase.v1beta1.SequenceReport.AttemptOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.SequenceOuterClass + .internal_static_google_showcase_v1beta1_SequenceReport_Attempt_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.SequenceOuterClass + .internal_static_google_showcase_v1beta1_SequenceReport_Attempt_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.SequenceReport.Attempt.class, + com.google.showcase.v1beta1.SequenceReport.Attempt.Builder.class); + } + + // Construct using com.google.showcase.v1beta1.SequenceReport.Attempt.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetAttemptDeadlineFieldBuilder(); + internalGetResponseTimeFieldBuilder(); + internalGetAttemptDelayFieldBuilder(); + internalGetStatusFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + attemptNumber_ = 0; + attemptDeadline_ = null; + if (attemptDeadlineBuilder_ != null) { + attemptDeadlineBuilder_.dispose(); + attemptDeadlineBuilder_ = null; + } + responseTime_ = null; + if (responseTimeBuilder_ != null) { + responseTimeBuilder_.dispose(); + responseTimeBuilder_ = null; + } + attemptDelay_ = null; + if (attemptDelayBuilder_ != null) { + attemptDelayBuilder_.dispose(); + attemptDelayBuilder_ = null; + } + status_ = null; + if (statusBuilder_ != null) { + statusBuilder_.dispose(); + statusBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.showcase.v1beta1.SequenceOuterClass + .internal_static_google_showcase_v1beta1_SequenceReport_Attempt_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.SequenceReport.Attempt getDefaultInstanceForType() { + return com.google.showcase.v1beta1.SequenceReport.Attempt.getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.SequenceReport.Attempt build() { + com.google.showcase.v1beta1.SequenceReport.Attempt result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.SequenceReport.Attempt buildPartial() { + com.google.showcase.v1beta1.SequenceReport.Attempt result = + new com.google.showcase.v1beta1.SequenceReport.Attempt(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.showcase.v1beta1.SequenceReport.Attempt result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.attemptNumber_ = attemptNumber_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.attemptDeadline_ = + attemptDeadlineBuilder_ == null ? attemptDeadline_ : attemptDeadlineBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.responseTime_ = + responseTimeBuilder_ == null ? responseTime_ : responseTimeBuilder_.build(); + to_bitField0_ |= 0x00000002; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.attemptDelay_ = + attemptDelayBuilder_ == null ? attemptDelay_ : attemptDelayBuilder_.build(); + to_bitField0_ |= 0x00000004; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.status_ = statusBuilder_ == null ? status_ : statusBuilder_.build(); + to_bitField0_ |= 0x00000008; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.showcase.v1beta1.SequenceReport.Attempt) { + return mergeFrom((com.google.showcase.v1beta1.SequenceReport.Attempt) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.showcase.v1beta1.SequenceReport.Attempt other) { + if (other == com.google.showcase.v1beta1.SequenceReport.Attempt.getDefaultInstance()) + return this; + if (other.getAttemptNumber() != 0) { + setAttemptNumber(other.getAttemptNumber()); + } + if (other.hasAttemptDeadline()) { + mergeAttemptDeadline(other.getAttemptDeadline()); + } + if (other.hasResponseTime()) { + mergeResponseTime(other.getResponseTime()); + } + if (other.hasAttemptDelay()) { + mergeAttemptDelay(other.getAttemptDelay()); + } + if (other.hasStatus()) { + mergeStatus(other.getStatus()); + } + 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: + { + attemptNumber_ = input.readInt32(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 18: + { + input.readMessage( + internalGetAttemptDeadlineFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + input.readMessage( + internalGetResponseTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 34: + { + input.readMessage( + internalGetAttemptDelayFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000008; + break; + } // case 34 + case 42: + { + input.readMessage( + internalGetStatusFieldBuilder().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 int attemptNumber_; + + /** + * + * + *
        +       * The attempt number - starting at 0.
        +       * 
        + * + * int32 attempt_number = 1; + * + * @return The attemptNumber. + */ + @java.lang.Override + public int getAttemptNumber() { + return attemptNumber_; + } + + /** + * + * + *
        +       * The attempt number - starting at 0.
        +       * 
        + * + * int32 attempt_number = 1; + * + * @param value The attemptNumber to set. + * @return This builder for chaining. + */ + public Builder setAttemptNumber(int value) { + + attemptNumber_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
        +       * The attempt number - starting at 0.
        +       * 
        + * + * int32 attempt_number = 1; + * + * @return This builder for chaining. + */ + public Builder clearAttemptNumber() { + bitField0_ = (bitField0_ & ~0x00000001); + attemptNumber_ = 0; + onChanged(); + return this; + } + + private com.google.protobuf.Timestamp attemptDeadline_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + attemptDeadlineBuilder_; + + /** + * + * + *
        +       * The deadline dictated by the attempt to the server.
        +       * 
        + * + * .google.protobuf.Timestamp attempt_deadline = 2; + * + * @return Whether the attemptDeadline field is set. + */ + public boolean hasAttemptDeadline() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
        +       * The deadline dictated by the attempt to the server.
        +       * 
        + * + * .google.protobuf.Timestamp attempt_deadline = 2; + * + * @return The attemptDeadline. + */ + public com.google.protobuf.Timestamp getAttemptDeadline() { + if (attemptDeadlineBuilder_ == null) { + return attemptDeadline_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : attemptDeadline_; + } else { + return attemptDeadlineBuilder_.getMessage(); + } + } + + /** + * + * + *
        +       * The deadline dictated by the attempt to the server.
        +       * 
        + * + * .google.protobuf.Timestamp attempt_deadline = 2; + */ + public Builder setAttemptDeadline(com.google.protobuf.Timestamp value) { + if (attemptDeadlineBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + attemptDeadline_ = value; + } else { + attemptDeadlineBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
        +       * The deadline dictated by the attempt to the server.
        +       * 
        + * + * .google.protobuf.Timestamp attempt_deadline = 2; + */ + public Builder setAttemptDeadline(com.google.protobuf.Timestamp.Builder builderForValue) { + if (attemptDeadlineBuilder_ == null) { + attemptDeadline_ = builderForValue.build(); + } else { + attemptDeadlineBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
        +       * The deadline dictated by the attempt to the server.
        +       * 
        + * + * .google.protobuf.Timestamp attempt_deadline = 2; + */ + public Builder mergeAttemptDeadline(com.google.protobuf.Timestamp value) { + if (attemptDeadlineBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && attemptDeadline_ != null + && attemptDeadline_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getAttemptDeadlineBuilder().mergeFrom(value); + } else { + attemptDeadline_ = value; + } + } else { + attemptDeadlineBuilder_.mergeFrom(value); + } + if (attemptDeadline_ != null) { + bitField0_ |= 0x00000002; + onChanged(); + } + return this; + } + + /** + * + * + *
        +       * The deadline dictated by the attempt to the server.
        +       * 
        + * + * .google.protobuf.Timestamp attempt_deadline = 2; + */ + public Builder clearAttemptDeadline() { + bitField0_ = (bitField0_ & ~0x00000002); + attemptDeadline_ = null; + if (attemptDeadlineBuilder_ != null) { + attemptDeadlineBuilder_.dispose(); + attemptDeadlineBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
        +       * The deadline dictated by the attempt to the server.
        +       * 
        + * + * .google.protobuf.Timestamp attempt_deadline = 2; + */ + public com.google.protobuf.Timestamp.Builder getAttemptDeadlineBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return internalGetAttemptDeadlineFieldBuilder().getBuilder(); + } + + /** + * + * + *
        +       * The deadline dictated by the attempt to the server.
        +       * 
        + * + * .google.protobuf.Timestamp attempt_deadline = 2; + */ + public com.google.protobuf.TimestampOrBuilder getAttemptDeadlineOrBuilder() { + if (attemptDeadlineBuilder_ != null) { + return attemptDeadlineBuilder_.getMessageOrBuilder(); + } else { + return attemptDeadline_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : attemptDeadline_; + } + } + + /** + * + * + *
        +       * The deadline dictated by the attempt to the server.
        +       * 
        + * + * .google.protobuf.Timestamp attempt_deadline = 2; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + internalGetAttemptDeadlineFieldBuilder() { + if (attemptDeadlineBuilder_ == null) { + attemptDeadlineBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getAttemptDeadline(), getParentForChildren(), isClean()); + attemptDeadline_ = null; + } + return attemptDeadlineBuilder_; + } + + private com.google.protobuf.Timestamp responseTime_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + responseTimeBuilder_; + + /** + * + * + *
        +       * The time that the server responded to the RPC attempt. Used for
        +       * calculating attempt_delay.
        +       * 
        + * + * .google.protobuf.Timestamp response_time = 3; + * + * @return Whether the responseTime field is set. + */ + public boolean hasResponseTime() { + return ((bitField0_ & 0x00000004) != 0); + } + + /** + * + * + *
        +       * The time that the server responded to the RPC attempt. Used for
        +       * calculating attempt_delay.
        +       * 
        + * + * .google.protobuf.Timestamp response_time = 3; + * + * @return The responseTime. + */ + public com.google.protobuf.Timestamp getResponseTime() { + if (responseTimeBuilder_ == null) { + return responseTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : responseTime_; + } else { + return responseTimeBuilder_.getMessage(); + } + } + + /** + * + * + *
        +       * The time that the server responded to the RPC attempt. Used for
        +       * calculating attempt_delay.
        +       * 
        + * + * .google.protobuf.Timestamp response_time = 3; + */ + public Builder setResponseTime(com.google.protobuf.Timestamp value) { + if (responseTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + responseTime_ = value; + } else { + responseTimeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
        +       * The time that the server responded to the RPC attempt. Used for
        +       * calculating attempt_delay.
        +       * 
        + * + * .google.protobuf.Timestamp response_time = 3; + */ + public Builder setResponseTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (responseTimeBuilder_ == null) { + responseTime_ = builderForValue.build(); + } else { + responseTimeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
        +       * The time that the server responded to the RPC attempt. Used for
        +       * calculating attempt_delay.
        +       * 
        + * + * .google.protobuf.Timestamp response_time = 3; + */ + public Builder mergeResponseTime(com.google.protobuf.Timestamp value) { + if (responseTimeBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0) + && responseTime_ != null + && responseTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getResponseTimeBuilder().mergeFrom(value); + } else { + responseTime_ = value; + } + } else { + responseTimeBuilder_.mergeFrom(value); + } + if (responseTime_ != null) { + bitField0_ |= 0x00000004; + onChanged(); + } + return this; + } + + /** + * + * + *
        +       * The time that the server responded to the RPC attempt. Used for
        +       * calculating attempt_delay.
        +       * 
        + * + * .google.protobuf.Timestamp response_time = 3; + */ + public Builder clearResponseTime() { + bitField0_ = (bitField0_ & ~0x00000004); + responseTime_ = null; + if (responseTimeBuilder_ != null) { + responseTimeBuilder_.dispose(); + responseTimeBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
        +       * The time that the server responded to the RPC attempt. Used for
        +       * calculating attempt_delay.
        +       * 
        + * + * .google.protobuf.Timestamp response_time = 3; + */ + public com.google.protobuf.Timestamp.Builder getResponseTimeBuilder() { + bitField0_ |= 0x00000004; + onChanged(); + return internalGetResponseTimeFieldBuilder().getBuilder(); + } + + /** + * + * + *
        +       * The time that the server responded to the RPC attempt. Used for
        +       * calculating attempt_delay.
        +       * 
        + * + * .google.protobuf.Timestamp response_time = 3; + */ + public com.google.protobuf.TimestampOrBuilder getResponseTimeOrBuilder() { + if (responseTimeBuilder_ != null) { + return responseTimeBuilder_.getMessageOrBuilder(); + } else { + return responseTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : responseTime_; + } + } + + /** + * + * + *
        +       * The time that the server responded to the RPC attempt. Used for
        +       * calculating attempt_delay.
        +       * 
        + * + * .google.protobuf.Timestamp response_time = 3; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + internalGetResponseTimeFieldBuilder() { + if (responseTimeBuilder_ == null) { + responseTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getResponseTime(), getParentForChildren(), isClean()); + responseTime_ = null; + } + return responseTimeBuilder_; + } + + private com.google.protobuf.Duration attemptDelay_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder> + attemptDelayBuilder_; + + /** + * + * + *
        +       * The server perceived delay between sending the last response and
        +       * receiving this attempt. Used for validating attempt delay backoff.
        +       * 
        + * + * .google.protobuf.Duration attempt_delay = 4; + * + * @return Whether the attemptDelay field is set. + */ + public boolean hasAttemptDelay() { + return ((bitField0_ & 0x00000008) != 0); + } + + /** + * + * + *
        +       * The server perceived delay between sending the last response and
        +       * receiving this attempt. Used for validating attempt delay backoff.
        +       * 
        + * + * .google.protobuf.Duration attempt_delay = 4; + * + * @return The attemptDelay. + */ + public com.google.protobuf.Duration getAttemptDelay() { + if (attemptDelayBuilder_ == null) { + return attemptDelay_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : attemptDelay_; + } else { + return attemptDelayBuilder_.getMessage(); + } + } + + /** + * + * + *
        +       * The server perceived delay between sending the last response and
        +       * receiving this attempt. Used for validating attempt delay backoff.
        +       * 
        + * + * .google.protobuf.Duration attempt_delay = 4; + */ + public Builder setAttemptDelay(com.google.protobuf.Duration value) { + if (attemptDelayBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + attemptDelay_ = value; + } else { + attemptDelayBuilder_.setMessage(value); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + /** + * + * + *
        +       * The server perceived delay between sending the last response and
        +       * receiving this attempt. Used for validating attempt delay backoff.
        +       * 
        + * + * .google.protobuf.Duration attempt_delay = 4; + */ + public Builder setAttemptDelay(com.google.protobuf.Duration.Builder builderForValue) { + if (attemptDelayBuilder_ == null) { + attemptDelay_ = builderForValue.build(); + } else { + attemptDelayBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + /** + * + * + *
        +       * The server perceived delay between sending the last response and
        +       * receiving this attempt. Used for validating attempt delay backoff.
        +       * 
        + * + * .google.protobuf.Duration attempt_delay = 4; + */ + public Builder mergeAttemptDelay(com.google.protobuf.Duration value) { + if (attemptDelayBuilder_ == null) { + if (((bitField0_ & 0x00000008) != 0) + && attemptDelay_ != null + && attemptDelay_ != com.google.protobuf.Duration.getDefaultInstance()) { + getAttemptDelayBuilder().mergeFrom(value); + } else { + attemptDelay_ = value; + } + } else { + attemptDelayBuilder_.mergeFrom(value); + } + if (attemptDelay_ != null) { + bitField0_ |= 0x00000008; + onChanged(); + } + return this; + } + + /** + * + * + *
        +       * The server perceived delay between sending the last response and
        +       * receiving this attempt. Used for validating attempt delay backoff.
        +       * 
        + * + * .google.protobuf.Duration attempt_delay = 4; + */ + public Builder clearAttemptDelay() { + bitField0_ = (bitField0_ & ~0x00000008); + attemptDelay_ = null; + if (attemptDelayBuilder_ != null) { + attemptDelayBuilder_.dispose(); + attemptDelayBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
        +       * The server perceived delay between sending the last response and
        +       * receiving this attempt. Used for validating attempt delay backoff.
        +       * 
        + * + * .google.protobuf.Duration attempt_delay = 4; + */ + public com.google.protobuf.Duration.Builder getAttemptDelayBuilder() { + bitField0_ |= 0x00000008; + onChanged(); + return internalGetAttemptDelayFieldBuilder().getBuilder(); + } + + /** + * + * + *
        +       * The server perceived delay between sending the last response and
        +       * receiving this attempt. Used for validating attempt delay backoff.
        +       * 
        + * + * .google.protobuf.Duration attempt_delay = 4; + */ + public com.google.protobuf.DurationOrBuilder getAttemptDelayOrBuilder() { + if (attemptDelayBuilder_ != null) { + return attemptDelayBuilder_.getMessageOrBuilder(); + } else { + return attemptDelay_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : attemptDelay_; + } + } + + /** + * + * + *
        +       * The server perceived delay between sending the last response and
        +       * receiving this attempt. Used for validating attempt delay backoff.
        +       * 
        + * + * .google.protobuf.Duration attempt_delay = 4; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder> + internalGetAttemptDelayFieldBuilder() { + if (attemptDelayBuilder_ == null) { + attemptDelayBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder>( + getAttemptDelay(), getParentForChildren(), isClean()); + attemptDelay_ = null; + } + return attemptDelayBuilder_; + } + + private com.google.rpc.Status status_; + private com.google.protobuf.SingleFieldBuilder< + com.google.rpc.Status, com.google.rpc.Status.Builder, com.google.rpc.StatusOrBuilder> + statusBuilder_; + + /** + * + * + *
        +       * The status returned to the attempt.
        +       * 
        + * + * .google.rpc.Status status = 5; + * + * @return Whether the status field is set. + */ + public boolean hasStatus() { + return ((bitField0_ & 0x00000010) != 0); + } + + /** + * + * + *
        +       * The status returned to the attempt.
        +       * 
        + * + * .google.rpc.Status status = 5; + * + * @return The status. + */ + public com.google.rpc.Status getStatus() { + if (statusBuilder_ == null) { + return status_ == null ? com.google.rpc.Status.getDefaultInstance() : status_; + } else { + return statusBuilder_.getMessage(); + } + } + + /** + * + * + *
        +       * The status returned to the attempt.
        +       * 
        + * + * .google.rpc.Status status = 5; + */ + public Builder setStatus(com.google.rpc.Status value) { + if (statusBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + status_ = value; + } else { + statusBuilder_.setMessage(value); + } + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + /** + * + * + *
        +       * The status returned to the attempt.
        +       * 
        + * + * .google.rpc.Status status = 5; + */ + public Builder setStatus(com.google.rpc.Status.Builder builderForValue) { + if (statusBuilder_ == null) { + status_ = builderForValue.build(); + } else { + statusBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + /** + * + * + *
        +       * The status returned to the attempt.
        +       * 
        + * + * .google.rpc.Status status = 5; + */ + public Builder mergeStatus(com.google.rpc.Status value) { + if (statusBuilder_ == null) { + if (((bitField0_ & 0x00000010) != 0) + && status_ != null + && status_ != com.google.rpc.Status.getDefaultInstance()) { + getStatusBuilder().mergeFrom(value); + } else { + status_ = value; + } + } else { + statusBuilder_.mergeFrom(value); + } + if (status_ != null) { + bitField0_ |= 0x00000010; + onChanged(); + } + return this; + } + + /** + * + * + *
        +       * The status returned to the attempt.
        +       * 
        + * + * .google.rpc.Status status = 5; + */ + public Builder clearStatus() { + bitField0_ = (bitField0_ & ~0x00000010); + status_ = null; + if (statusBuilder_ != null) { + statusBuilder_.dispose(); + statusBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
        +       * The status returned to the attempt.
        +       * 
        + * + * .google.rpc.Status status = 5; + */ + public com.google.rpc.Status.Builder getStatusBuilder() { + bitField0_ |= 0x00000010; + onChanged(); + return internalGetStatusFieldBuilder().getBuilder(); + } + + /** + * + * + *
        +       * The status returned to the attempt.
        +       * 
        + * + * .google.rpc.Status status = 5; + */ + public com.google.rpc.StatusOrBuilder getStatusOrBuilder() { + if (statusBuilder_ != null) { + return statusBuilder_.getMessageOrBuilder(); + } else { + return status_ == null ? com.google.rpc.Status.getDefaultInstance() : status_; + } + } + + /** + * + * + *
        +       * The status returned to the attempt.
        +       * 
        + * + * .google.rpc.Status status = 5; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.rpc.Status, com.google.rpc.Status.Builder, com.google.rpc.StatusOrBuilder> + internalGetStatusFieldBuilder() { + if (statusBuilder_ == null) { + statusBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.rpc.Status, + com.google.rpc.Status.Builder, + com.google.rpc.StatusOrBuilder>(getStatus(), getParentForChildren(), isClean()); + status_ = null; + } + return statusBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.showcase.v1beta1.SequenceReport.Attempt) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.SequenceReport.Attempt) + private static final com.google.showcase.v1beta1.SequenceReport.Attempt DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.SequenceReport.Attempt(); + } + + public static com.google.showcase.v1beta1.SequenceReport.Attempt getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Attempt 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.showcase.v1beta1.SequenceReport.Attempt getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + + /** + * 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; + } + } + + /** + * 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 ATTEMPTS_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private java.util.List attempts_; + + /** + * + * + *
        +   * The set of RPC attempts received by the server for a Sequence.
        +   * 
        + * + * repeated .google.showcase.v1beta1.SequenceReport.Attempt attempts = 2; + */ + @java.lang.Override + public java.util.List getAttemptsList() { + return attempts_; + } + + /** + * + * + *
        +   * The set of RPC attempts received by the server for a Sequence.
        +   * 
        + * + * repeated .google.showcase.v1beta1.SequenceReport.Attempt attempts = 2; + */ + @java.lang.Override + public java.util.List + getAttemptsOrBuilderList() { + return attempts_; + } + + /** + * + * + *
        +   * The set of RPC attempts received by the server for a Sequence.
        +   * 
        + * + * repeated .google.showcase.v1beta1.SequenceReport.Attempt attempts = 2; + */ + @java.lang.Override + public int getAttemptsCount() { + return attempts_.size(); + } + + /** + * + * + *
        +   * The set of RPC attempts received by the server for a Sequence.
        +   * 
        + * + * repeated .google.showcase.v1beta1.SequenceReport.Attempt attempts = 2; + */ + @java.lang.Override + public com.google.showcase.v1beta1.SequenceReport.Attempt getAttempts(int index) { + return attempts_.get(index); + } + + /** + * + * + *
        +   * The set of RPC attempts received by the server for a Sequence.
        +   * 
        + * + * repeated .google.showcase.v1beta1.SequenceReport.Attempt attempts = 2; + */ + @java.lang.Override + public com.google.showcase.v1beta1.SequenceReport.AttemptOrBuilder getAttemptsOrBuilder( + int index) { + return attempts_.get(index); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, name_); + } + for (int i = 0; i < attempts_.size(); i++) { + output.writeMessage(2, attempts_.get(i)); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, name_); + } + for (int i = 0; i < attempts_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, attempts_.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.showcase.v1beta1.SequenceReport)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.SequenceReport other = + (com.google.showcase.v1beta1.SequenceReport) obj; + + if (!getName().equals(other.getName())) return false; + if (!getAttemptsList().equals(other.getAttemptsList())) 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 (getAttemptsCount() > 0) { + hash = (37 * hash) + ATTEMPTS_FIELD_NUMBER; + hash = (53 * hash) + getAttemptsList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.showcase.v1beta1.SequenceReport parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.SequenceReport parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.SequenceReport parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.SequenceReport 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.showcase.v1beta1.SequenceReport parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.SequenceReport parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.SequenceReport parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.SequenceReport parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.showcase.v1beta1.SequenceReport parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.SequenceReport parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.showcase.v1beta1.SequenceReport parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.SequenceReport parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.showcase.v1beta1.SequenceReport 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** Protobuf type {@code google.showcase.v1beta1.SequenceReport} */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.SequenceReport) + com.google.showcase.v1beta1.SequenceReportOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.SequenceOuterClass + .internal_static_google_showcase_v1beta1_SequenceReport_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.SequenceOuterClass + .internal_static_google_showcase_v1beta1_SequenceReport_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.SequenceReport.class, + com.google.showcase.v1beta1.SequenceReport.Builder.class); + } + + // Construct using com.google.showcase.v1beta1.SequenceReport.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + if (attemptsBuilder_ == null) { + attempts_ = java.util.Collections.emptyList(); + } else { + attempts_ = null; + attemptsBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000002); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.showcase.v1beta1.SequenceOuterClass + .internal_static_google_showcase_v1beta1_SequenceReport_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.SequenceReport getDefaultInstanceForType() { + return com.google.showcase.v1beta1.SequenceReport.getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.SequenceReport build() { + com.google.showcase.v1beta1.SequenceReport result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.SequenceReport buildPartial() { + com.google.showcase.v1beta1.SequenceReport result = + new com.google.showcase.v1beta1.SequenceReport(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields(com.google.showcase.v1beta1.SequenceReport result) { + if (attemptsBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0)) { + attempts_ = java.util.Collections.unmodifiableList(attempts_); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.attempts_ = attempts_; + } else { + result.attempts_ = attemptsBuilder_.build(); + } + } + + private void buildPartial0(com.google.showcase.v1beta1.SequenceReport result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.showcase.v1beta1.SequenceReport) { + return mergeFrom((com.google.showcase.v1beta1.SequenceReport) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.showcase.v1beta1.SequenceReport other) { + if (other == com.google.showcase.v1beta1.SequenceReport.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (attemptsBuilder_ == null) { + if (!other.attempts_.isEmpty()) { + if (attempts_.isEmpty()) { + attempts_ = other.attempts_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureAttemptsIsMutable(); + attempts_.addAll(other.attempts_); + } + onChanged(); + } + } else { + if (!other.attempts_.isEmpty()) { + if (attemptsBuilder_.isEmpty()) { + attemptsBuilder_.dispose(); + attemptsBuilder_ = null; + attempts_ = other.attempts_; + bitField0_ = (bitField0_ & ~0x00000002); + attemptsBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders + ? internalGetAttemptsFieldBuilder() + : null; + } else { + attemptsBuilder_.addAllMessages(other.attempts_); + } + } + } + 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: + { + com.google.showcase.v1beta1.SequenceReport.Attempt m = + input.readMessage( + com.google.showcase.v1beta1.SequenceReport.Attempt.parser(), + extensionRegistry); + if (attemptsBuilder_ == null) { + ensureAttemptsIsMutable(); + attempts_.add(m); + } else { + attemptsBuilder_.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.lang.Object name_ = ""; + + /** + * 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; + } + } + + /** + * 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; + } + } + + /** + * 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; + } + + /** + * 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; + } + + /** + * 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.util.List attempts_ = + java.util.Collections.emptyList(); + + private void ensureAttemptsIsMutable() { + if (!((bitField0_ & 0x00000002) != 0)) { + attempts_ = + new java.util.ArrayList(attempts_); + bitField0_ |= 0x00000002; + } + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.google.showcase.v1beta1.SequenceReport.Attempt, + com.google.showcase.v1beta1.SequenceReport.Attempt.Builder, + com.google.showcase.v1beta1.SequenceReport.AttemptOrBuilder> + attemptsBuilder_; + + /** + * + * + *
        +     * The set of RPC attempts received by the server for a Sequence.
        +     * 
        + * + * repeated .google.showcase.v1beta1.SequenceReport.Attempt attempts = 2; + */ + public java.util.List getAttemptsList() { + if (attemptsBuilder_ == null) { + return java.util.Collections.unmodifiableList(attempts_); + } else { + return attemptsBuilder_.getMessageList(); + } + } + + /** + * + * + *
        +     * The set of RPC attempts received by the server for a Sequence.
        +     * 
        + * + * repeated .google.showcase.v1beta1.SequenceReport.Attempt attempts = 2; + */ + public int getAttemptsCount() { + if (attemptsBuilder_ == null) { + return attempts_.size(); + } else { + return attemptsBuilder_.getCount(); + } + } + + /** + * + * + *
        +     * The set of RPC attempts received by the server for a Sequence.
        +     * 
        + * + * repeated .google.showcase.v1beta1.SequenceReport.Attempt attempts = 2; + */ + public com.google.showcase.v1beta1.SequenceReport.Attempt getAttempts(int index) { + if (attemptsBuilder_ == null) { + return attempts_.get(index); + } else { + return attemptsBuilder_.getMessage(index); + } + } + + /** + * + * + *
        +     * The set of RPC attempts received by the server for a Sequence.
        +     * 
        + * + * repeated .google.showcase.v1beta1.SequenceReport.Attempt attempts = 2; + */ + public Builder setAttempts( + int index, com.google.showcase.v1beta1.SequenceReport.Attempt value) { + if (attemptsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureAttemptsIsMutable(); + attempts_.set(index, value); + onChanged(); + } else { + attemptsBuilder_.setMessage(index, value); + } + return this; + } + + /** + * + * + *
        +     * The set of RPC attempts received by the server for a Sequence.
        +     * 
        + * + * repeated .google.showcase.v1beta1.SequenceReport.Attempt attempts = 2; + */ + public Builder setAttempts( + int index, com.google.showcase.v1beta1.SequenceReport.Attempt.Builder builderForValue) { + if (attemptsBuilder_ == null) { + ensureAttemptsIsMutable(); + attempts_.set(index, builderForValue.build()); + onChanged(); + } else { + attemptsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
        +     * The set of RPC attempts received by the server for a Sequence.
        +     * 
        + * + * repeated .google.showcase.v1beta1.SequenceReport.Attempt attempts = 2; + */ + public Builder addAttempts(com.google.showcase.v1beta1.SequenceReport.Attempt value) { + if (attemptsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureAttemptsIsMutable(); + attempts_.add(value); + onChanged(); + } else { + attemptsBuilder_.addMessage(value); + } + return this; + } + + /** + * + * + *
        +     * The set of RPC attempts received by the server for a Sequence.
        +     * 
        + * + * repeated .google.showcase.v1beta1.SequenceReport.Attempt attempts = 2; + */ + public Builder addAttempts( + int index, com.google.showcase.v1beta1.SequenceReport.Attempt value) { + if (attemptsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureAttemptsIsMutable(); + attempts_.add(index, value); + onChanged(); + } else { + attemptsBuilder_.addMessage(index, value); + } + return this; + } + + /** + * + * + *
        +     * The set of RPC attempts received by the server for a Sequence.
        +     * 
        + * + * repeated .google.showcase.v1beta1.SequenceReport.Attempt attempts = 2; + */ + public Builder addAttempts( + com.google.showcase.v1beta1.SequenceReport.Attempt.Builder builderForValue) { + if (attemptsBuilder_ == null) { + ensureAttemptsIsMutable(); + attempts_.add(builderForValue.build()); + onChanged(); + } else { + attemptsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + + /** + * + * + *
        +     * The set of RPC attempts received by the server for a Sequence.
        +     * 
        + * + * repeated .google.showcase.v1beta1.SequenceReport.Attempt attempts = 2; + */ + public Builder addAttempts( + int index, com.google.showcase.v1beta1.SequenceReport.Attempt.Builder builderForValue) { + if (attemptsBuilder_ == null) { + ensureAttemptsIsMutable(); + attempts_.add(index, builderForValue.build()); + onChanged(); + } else { + attemptsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
        +     * The set of RPC attempts received by the server for a Sequence.
        +     * 
        + * + * repeated .google.showcase.v1beta1.SequenceReport.Attempt attempts = 2; + */ + public Builder addAllAttempts( + java.lang.Iterable values) { + if (attemptsBuilder_ == null) { + ensureAttemptsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, attempts_); + onChanged(); + } else { + attemptsBuilder_.addAllMessages(values); + } + return this; + } + + /** + * + * + *
        +     * The set of RPC attempts received by the server for a Sequence.
        +     * 
        + * + * repeated .google.showcase.v1beta1.SequenceReport.Attempt attempts = 2; + */ + public Builder clearAttempts() { + if (attemptsBuilder_ == null) { + attempts_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + } else { + attemptsBuilder_.clear(); + } + return this; + } + + /** + * + * + *
        +     * The set of RPC attempts received by the server for a Sequence.
        +     * 
        + * + * repeated .google.showcase.v1beta1.SequenceReport.Attempt attempts = 2; + */ + public Builder removeAttempts(int index) { + if (attemptsBuilder_ == null) { + ensureAttemptsIsMutable(); + attempts_.remove(index); + onChanged(); + } else { + attemptsBuilder_.remove(index); + } + return this; + } + + /** + * + * + *
        +     * The set of RPC attempts received by the server for a Sequence.
        +     * 
        + * + * repeated .google.showcase.v1beta1.SequenceReport.Attempt attempts = 2; + */ + public com.google.showcase.v1beta1.SequenceReport.Attempt.Builder getAttemptsBuilder( + int index) { + return internalGetAttemptsFieldBuilder().getBuilder(index); + } + + /** + * + * + *
        +     * The set of RPC attempts received by the server for a Sequence.
        +     * 
        + * + * repeated .google.showcase.v1beta1.SequenceReport.Attempt attempts = 2; + */ + public com.google.showcase.v1beta1.SequenceReport.AttemptOrBuilder getAttemptsOrBuilder( + int index) { + if (attemptsBuilder_ == null) { + return attempts_.get(index); + } else { + return attemptsBuilder_.getMessageOrBuilder(index); + } + } + + /** + * + * + *
        +     * The set of RPC attempts received by the server for a Sequence.
        +     * 
        + * + * repeated .google.showcase.v1beta1.SequenceReport.Attempt attempts = 2; + */ + public java.util.List + getAttemptsOrBuilderList() { + if (attemptsBuilder_ != null) { + return attemptsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(attempts_); + } + } + + /** + * + * + *
        +     * The set of RPC attempts received by the server for a Sequence.
        +     * 
        + * + * repeated .google.showcase.v1beta1.SequenceReport.Attempt attempts = 2; + */ + public com.google.showcase.v1beta1.SequenceReport.Attempt.Builder addAttemptsBuilder() { + return internalGetAttemptsFieldBuilder() + .addBuilder(com.google.showcase.v1beta1.SequenceReport.Attempt.getDefaultInstance()); + } + + /** + * + * + *
        +     * The set of RPC attempts received by the server for a Sequence.
        +     * 
        + * + * repeated .google.showcase.v1beta1.SequenceReport.Attempt attempts = 2; + */ + public com.google.showcase.v1beta1.SequenceReport.Attempt.Builder addAttemptsBuilder( + int index) { + return internalGetAttemptsFieldBuilder() + .addBuilder( + index, com.google.showcase.v1beta1.SequenceReport.Attempt.getDefaultInstance()); + } + + /** + * + * + *
        +     * The set of RPC attempts received by the server for a Sequence.
        +     * 
        + * + * repeated .google.showcase.v1beta1.SequenceReport.Attempt attempts = 2; + */ + public java.util.List + getAttemptsBuilderList() { + return internalGetAttemptsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.google.showcase.v1beta1.SequenceReport.Attempt, + com.google.showcase.v1beta1.SequenceReport.Attempt.Builder, + com.google.showcase.v1beta1.SequenceReport.AttemptOrBuilder> + internalGetAttemptsFieldBuilder() { + if (attemptsBuilder_ == null) { + attemptsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilder< + com.google.showcase.v1beta1.SequenceReport.Attempt, + com.google.showcase.v1beta1.SequenceReport.Attempt.Builder, + com.google.showcase.v1beta1.SequenceReport.AttemptOrBuilder>( + attempts_, ((bitField0_ & 0x00000002) != 0), getParentForChildren(), isClean()); + attempts_ = null; + } + return attemptsBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.showcase.v1beta1.SequenceReport) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.SequenceReport) + private static final com.google.showcase.v1beta1.SequenceReport DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.SequenceReport(); + } + + public static com.google.showcase.v1beta1.SequenceReport getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SequenceReport 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.showcase.v1beta1.SequenceReport getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/SequenceReportName.java b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/SequenceReportName.java new file mode 100644 index 0000000000..27970631de --- /dev/null +++ b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/SequenceReportName.java @@ -0,0 +1,168 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1; + +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +@Generated("by gapic-generator-java") +public class SequenceReportName implements ResourceName { + private static final PathTemplate SEQUENCE = + PathTemplate.createWithoutUrlEncoding("sequences/{sequence}/sequenceReport"); + private volatile Map fieldValuesMap; + private final String sequence; + + @Deprecated + protected SequenceReportName() { + sequence = null; + } + + private SequenceReportName(Builder builder) { + sequence = Preconditions.checkNotNull(builder.getSequence()); + } + + public String getSequence() { + return sequence; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + public static SequenceReportName of(String sequence) { + return newBuilder().setSequence(sequence).build(); + } + + public static String format(String sequence) { + return newBuilder().setSequence(sequence).build().toString(); + } + + public static SequenceReportName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + SEQUENCE.validatedMatch( + formattedString, "SequenceReportName.parse: formattedString not in valid format"); + return of(matchMap.get("sequence")); + } + + 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 (SequenceReportName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return SEQUENCE.matches(formattedString); + } + + @Override + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + if (sequence != null) { + fieldMapBuilder.put("sequence", sequence); + } + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return SEQUENCE.instantiate("sequence", sequence); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o != null && getClass() == o.getClass()) { + SequenceReportName that = ((SequenceReportName) o); + return Objects.equals(this.sequence, that.sequence); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= Objects.hashCode(sequence); + return h; + } + + /** Builder for sequences/{sequence}/sequenceReport. */ + public static class Builder { + private String sequence; + + protected Builder() {} + + public String getSequence() { + return sequence; + } + + public Builder setSequence(String sequence) { + this.sequence = sequence; + return this; + } + + private Builder(SequenceReportName sequenceReportName) { + this.sequence = sequenceReportName.sequence; + } + + public SequenceReportName build() { + return new SequenceReportName(this); + } + } +} diff --git a/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/SequenceReportOrBuilder.java b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/SequenceReportOrBuilder.java new file mode 100644 index 0000000000..8b10792fc7 --- /dev/null +++ b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/SequenceReportOrBuilder.java @@ -0,0 +1,98 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: schema/google/showcase/v1beta1/sequence.proto +// Protobuf Java Version: 4.33.2 + +package com.google.showcase.v1beta1; + +@com.google.protobuf.Generated +public interface SequenceReportOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.SequenceReport) + com.google.protobuf.MessageOrBuilder { + + /** + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The name. + */ + java.lang.String getName(); + + /** + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
        +   * The set of RPC attempts received by the server for a Sequence.
        +   * 
        + * + * repeated .google.showcase.v1beta1.SequenceReport.Attempt attempts = 2; + */ + java.util.List getAttemptsList(); + + /** + * + * + *
        +   * The set of RPC attempts received by the server for a Sequence.
        +   * 
        + * + * repeated .google.showcase.v1beta1.SequenceReport.Attempt attempts = 2; + */ + com.google.showcase.v1beta1.SequenceReport.Attempt getAttempts(int index); + + /** + * + * + *
        +   * The set of RPC attempts received by the server for a Sequence.
        +   * 
        + * + * repeated .google.showcase.v1beta1.SequenceReport.Attempt attempts = 2; + */ + int getAttemptsCount(); + + /** + * + * + *
        +   * The set of RPC attempts received by the server for a Sequence.
        +   * 
        + * + * repeated .google.showcase.v1beta1.SequenceReport.Attempt attempts = 2; + */ + java.util.List + getAttemptsOrBuilderList(); + + /** + * + * + *
        +   * The set of RPC attempts received by the server for a Sequence.
        +   * 
        + * + * repeated .google.showcase.v1beta1.SequenceReport.Attempt attempts = 2; + */ + com.google.showcase.v1beta1.SequenceReport.AttemptOrBuilder getAttemptsOrBuilder(int index); +} diff --git a/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/Session.java b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/Session.java new file mode 100644 index 0000000000..32594bd064 --- /dev/null +++ b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/Session.java @@ -0,0 +1,933 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: schema/google/showcase/v1beta1/testing.proto +// Protobuf Java Version: 4.33.2 + +package com.google.showcase.v1beta1; + +/** + * + * + *
        + * A session is a suite of tests, generally being made in the context
        + * of testing code generation.
        + *
        + * A session defines tests it may expect, based on which version of the
        + * code generation spec is in use.
        + * 
        + * + * Protobuf type {@code google.showcase.v1beta1.Session} + */ +@com.google.protobuf.Generated +public final class Session extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.Session) + SessionOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "Session"); + } + + // Use Session.newBuilder() to construct. + private Session(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private Session() { + name_ = ""; + version_ = 0; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.TestingOuterClass + .internal_static_google_showcase_v1beta1_Session_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.TestingOuterClass + .internal_static_google_showcase_v1beta1_Session_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.Session.class, + com.google.showcase.v1beta1.Session.Builder.class); + } + + /** + * + * + *
        +   * The specification versions understood by Showcase.
        +   * 
        + * + * Protobuf enum {@code google.showcase.v1beta1.Session.Version} + */ + public enum Version implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
        +     * Unspecified version. If passed on creation, the session will default
        +     * to using the latest stable release.
        +     * 
        + * + * VERSION_UNSPECIFIED = 0; + */ + VERSION_UNSPECIFIED(0), + /** + * + * + *
        +     * The latest v1. Currently, this is v1.0.
        +     * 
        + * + * V1_LATEST = 1; + */ + V1_LATEST(1), + /** + * + * + *
        +     * v1.0. (Until the spec is "GA", this will be a moving target.)
        +     * 
        + * + * V1_0 = 2; + */ + V1_0(2), + UNRECOGNIZED(-1), + ; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "Version"); + } + + /** + * + * + *
        +     * Unspecified version. If passed on creation, the session will default
        +     * to using the latest stable release.
        +     * 
        + * + * VERSION_UNSPECIFIED = 0; + */ + public static final int VERSION_UNSPECIFIED_VALUE = 0; + + /** + * + * + *
        +     * The latest v1. Currently, this is v1.0.
        +     * 
        + * + * V1_LATEST = 1; + */ + public static final int V1_LATEST_VALUE = 1; + + /** + * + * + *
        +     * v1.0. (Until the spec is "GA", this will be a moving target.)
        +     * 
        + * + * V1_0 = 2; + */ + public static final int V1_0_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 Version 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 Version forNumber(int value) { + switch (value) { + case 0: + return VERSION_UNSPECIFIED; + case 1: + return V1_LATEST; + case 2: + return V1_0; + 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 Version findValueByNumber(int number) { + return Version.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 com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.showcase.v1beta1.Session.getDescriptor().getEnumTypes().get(0); + } + + private static final Version[] VALUES = values(); + + public static Version 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 Version(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.showcase.v1beta1.Session.Version) + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + + /** + * + * + *
        +   * The name of the session. The ID must conform to ^[a-z]+$
        +   * If this is not provided, Showcase chooses one at random.
        +   * 
        + * + * 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 name of the session. The ID must conform to ^[a-z]+$
        +   * If this is not provided, Showcase chooses one at random.
        +   * 
        + * + * 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 VERSION_FIELD_NUMBER = 2; + private int version_ = 0; + + /** + * + * + *
        +   * Required. The version this session is using.
        +   * 
        + * + * .google.showcase.v1beta1.Session.Version version = 2; + * + * @return The enum numeric value on the wire for version. + */ + @java.lang.Override + public int getVersionValue() { + return version_; + } + + /** + * + * + *
        +   * Required. The version this session is using.
        +   * 
        + * + * .google.showcase.v1beta1.Session.Version version = 2; + * + * @return The version. + */ + @java.lang.Override + public com.google.showcase.v1beta1.Session.Version getVersion() { + com.google.showcase.v1beta1.Session.Version result = + com.google.showcase.v1beta1.Session.Version.forNumber(version_); + return result == null ? com.google.showcase.v1beta1.Session.Version.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.GeneratedMessage.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, name_); + } + if (version_ != com.google.showcase.v1beta1.Session.Version.VERSION_UNSPECIFIED.getNumber()) { + output.writeEnum(2, version_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, name_); + } + if (version_ != com.google.showcase.v1beta1.Session.Version.VERSION_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(2, version_); + } + 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.showcase.v1beta1.Session)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.Session other = (com.google.showcase.v1beta1.Session) obj; + + if (!getName().equals(other.getName())) 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) + VERSION_FIELD_NUMBER; + hash = (53 * hash) + version_; + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.showcase.v1beta1.Session parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.Session parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.Session parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.Session 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.showcase.v1beta1.Session parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.Session parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.Session parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.Session parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.showcase.v1beta1.Session parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.Session parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.showcase.v1beta1.Session parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.Session parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.showcase.v1beta1.Session 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
        +   * A session is a suite of tests, generally being made in the context
        +   * of testing code generation.
        +   *
        +   * A session defines tests it may expect, based on which version of the
        +   * code generation spec is in use.
        +   * 
        + * + * Protobuf type {@code google.showcase.v1beta1.Session} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.Session) + com.google.showcase.v1beta1.SessionOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.TestingOuterClass + .internal_static_google_showcase_v1beta1_Session_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.TestingOuterClass + .internal_static_google_showcase_v1beta1_Session_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.Session.class, + com.google.showcase.v1beta1.Session.Builder.class); + } + + // Construct using com.google.showcase.v1beta1.Session.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + version_ = 0; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.showcase.v1beta1.TestingOuterClass + .internal_static_google_showcase_v1beta1_Session_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.Session getDefaultInstanceForType() { + return com.google.showcase.v1beta1.Session.getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.Session build() { + com.google.showcase.v1beta1.Session result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.Session buildPartial() { + com.google.showcase.v1beta1.Session result = new com.google.showcase.v1beta1.Session(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.showcase.v1beta1.Session result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.version_ = version_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.showcase.v1beta1.Session) { + return mergeFrom((com.google.showcase.v1beta1.Session) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.showcase.v1beta1.Session other) { + if (other == com.google.showcase.v1beta1.Session.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + 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 16: + { + version_ = input.readEnum(); + 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 java.lang.Object name_ = ""; + + /** + * + * + *
        +     * The name of the session. The ID must conform to ^[a-z]+$
        +     * If this is not provided, Showcase chooses one at random.
        +     * 
        + * + * 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 name of the session. The ID must conform to ^[a-z]+$
        +     * If this is not provided, Showcase chooses one at random.
        +     * 
        + * + * 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 name of the session. The ID must conform to ^[a-z]+$
        +     * If this is not provided, Showcase chooses one at random.
        +     * 
        + * + * 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 name of the session. The ID must conform to ^[a-z]+$
        +     * If this is not provided, Showcase chooses one at random.
        +     * 
        + * + * string name = 1; + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
        +     * The name of the session. The ID must conform to ^[a-z]+$
        +     * If this is not provided, Showcase chooses one at random.
        +     * 
        + * + * 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 int version_ = 0; + + /** + * + * + *
        +     * Required. The version this session is using.
        +     * 
        + * + * .google.showcase.v1beta1.Session.Version version = 2; + * + * @return The enum numeric value on the wire for version. + */ + @java.lang.Override + public int getVersionValue() { + return version_; + } + + /** + * + * + *
        +     * Required. The version this session is using.
        +     * 
        + * + * .google.showcase.v1beta1.Session.Version version = 2; + * + * @param value The enum numeric value on the wire for version to set. + * @return This builder for chaining. + */ + public Builder setVersionValue(int value) { + version_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
        +     * Required. The version this session is using.
        +     * 
        + * + * .google.showcase.v1beta1.Session.Version version = 2; + * + * @return The version. + */ + @java.lang.Override + public com.google.showcase.v1beta1.Session.Version getVersion() { + com.google.showcase.v1beta1.Session.Version result = + com.google.showcase.v1beta1.Session.Version.forNumber(version_); + return result == null ? com.google.showcase.v1beta1.Session.Version.UNRECOGNIZED : result; + } + + /** + * + * + *
        +     * Required. The version this session is using.
        +     * 
        + * + * .google.showcase.v1beta1.Session.Version version = 2; + * + * @param value The version to set. + * @return This builder for chaining. + */ + public Builder setVersion(com.google.showcase.v1beta1.Session.Version value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000002; + version_ = value.getNumber(); + onChanged(); + return this; + } + + /** + * + * + *
        +     * Required. The version this session is using.
        +     * 
        + * + * .google.showcase.v1beta1.Session.Version version = 2; + * + * @return This builder for chaining. + */ + public Builder clearVersion() { + bitField0_ = (bitField0_ & ~0x00000002); + version_ = 0; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.showcase.v1beta1.Session) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.Session) + private static final com.google.showcase.v1beta1.Session DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.Session(); + } + + public static com.google.showcase.v1beta1.Session getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Session 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.showcase.v1beta1.Session getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/SessionName.java b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/SessionName.java new file mode 100644 index 0000000000..4f40865d28 --- /dev/null +++ b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/SessionName.java @@ -0,0 +1,168 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1; + +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +@Generated("by gapic-generator-java") +public class SessionName implements ResourceName { + private static final PathTemplate SESSION = + PathTemplate.createWithoutUrlEncoding("sessions/{session}"); + private volatile Map fieldValuesMap; + private final String session; + + @Deprecated + protected SessionName() { + session = null; + } + + private SessionName(Builder builder) { + session = Preconditions.checkNotNull(builder.getSession()); + } + + public String getSession() { + return session; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + public static SessionName of(String session) { + return newBuilder().setSession(session).build(); + } + + public static String format(String session) { + return newBuilder().setSession(session).build().toString(); + } + + public static SessionName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + SESSION.validatedMatch( + formattedString, "SessionName.parse: formattedString not in valid format"); + return of(matchMap.get("session")); + } + + 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 (SessionName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return SESSION.matches(formattedString); + } + + @Override + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + if (session != null) { + fieldMapBuilder.put("session", session); + } + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return SESSION.instantiate("session", session); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o != null && getClass() == o.getClass()) { + SessionName that = ((SessionName) o); + return Objects.equals(this.session, that.session); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= Objects.hashCode(session); + return h; + } + + /** Builder for sessions/{session}. */ + public static class Builder { + private String session; + + protected Builder() {} + + public String getSession() { + return session; + } + + public Builder setSession(String session) { + this.session = session; + return this; + } + + private Builder(SessionName sessionName) { + this.session = sessionName.session; + } + + public SessionName build() { + return new SessionName(this); + } + } +} diff --git a/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/SessionOrBuilder.java b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/SessionOrBuilder.java new file mode 100644 index 0000000000..934571b57a --- /dev/null +++ b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/SessionOrBuilder.java @@ -0,0 +1,82 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: schema/google/showcase/v1beta1/testing.proto +// Protobuf Java Version: 4.33.2 + +package com.google.showcase.v1beta1; + +@com.google.protobuf.Generated +public interface SessionOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.Session) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
        +   * The name of the session. The ID must conform to ^[a-z]+$
        +   * If this is not provided, Showcase chooses one at random.
        +   * 
        + * + * string name = 1; + * + * @return The name. + */ + java.lang.String getName(); + + /** + * + * + *
        +   * The name of the session. The ID must conform to ^[a-z]+$
        +   * If this is not provided, Showcase chooses one at random.
        +   * 
        + * + * string name = 1; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
        +   * Required. The version this session is using.
        +   * 
        + * + * .google.showcase.v1beta1.Session.Version version = 2; + * + * @return The enum numeric value on the wire for version. + */ + int getVersionValue(); + + /** + * + * + *
        +   * Required. The version this session is using.
        +   * 
        + * + * .google.showcase.v1beta1.Session.Version version = 2; + * + * @return The version. + */ + com.google.showcase.v1beta1.Session.Version getVersion(); +} diff --git a/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/Severity.java b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/Severity.java new file mode 100644 index 0000000000..817093f67e --- /dev/null +++ b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/Severity.java @@ -0,0 +1,150 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: schema/google/showcase/v1beta1/echo.proto +// Protobuf Java Version: 4.33.2 + +package com.google.showcase.v1beta1; + +/** + * + * + *
        + * A severity enum used to test enum capabilities in GAPIC surfaces.
        + * 
        + * + * Protobuf enum {@code google.showcase.v1beta1.Severity} + */ +@com.google.protobuf.Generated +public enum Severity implements com.google.protobuf.ProtocolMessageEnum { + /** UNNECESSARY = 0; */ + UNNECESSARY(0), + /** NECESSARY = 1; */ + NECESSARY(1), + /** URGENT = 2; */ + URGENT(2), + /** CRITICAL = 3; */ + CRITICAL(3), + UNRECOGNIZED(-1), + ; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "Severity"); + } + + /** UNNECESSARY = 0; */ + public static final int UNNECESSARY_VALUE = 0; + + /** NECESSARY = 1; */ + public static final int NECESSARY_VALUE = 1; + + /** URGENT = 2; */ + public static final int URGENT_VALUE = 2; + + /** CRITICAL = 3; */ + public static final int CRITICAL_VALUE = 3; + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static Severity 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 Severity forNumber(int value) { + switch (value) { + case 0: + return UNNECESSARY; + case 1: + return NECESSARY; + case 2: + return URGENT; + case 3: + return CRITICAL; + 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 Severity findValueByNumber(int number) { + return Severity.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 com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.showcase.v1beta1.EchoOuterClass.getDescriptor().getEnumTypes().get(0); + } + + private static final Severity[] VALUES = values(); + + public static Severity 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 Severity(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.showcase.v1beta1.Severity) +} diff --git a/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/StreamBlurbsRequest.java b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/StreamBlurbsRequest.java new file mode 100644 index 0000000000..6048ffb6f0 --- /dev/null +++ b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/StreamBlurbsRequest.java @@ -0,0 +1,912 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: schema/google/showcase/v1beta1/messaging.proto +// Protobuf Java Version: 4.33.2 + +package com.google.showcase.v1beta1; + +/** + * + * + *
        + * The request message for the google.showcase.v1beta1.Messaging\StreamBlurbs
        + * method.
        + * 
        + * + * Protobuf type {@code google.showcase.v1beta1.StreamBlurbsRequest} + */ +@com.google.protobuf.Generated +public final class StreamBlurbsRequest extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.StreamBlurbsRequest) + StreamBlurbsRequestOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "StreamBlurbsRequest"); + } + + // Use StreamBlurbsRequest.newBuilder() to construct. + private StreamBlurbsRequest(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private StreamBlurbsRequest() { + name_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.MessagingOuterClass + .internal_static_google_showcase_v1beta1_StreamBlurbsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.MessagingOuterClass + .internal_static_google_showcase_v1beta1_StreamBlurbsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.StreamBlurbsRequest.class, + com.google.showcase.v1beta1.StreamBlurbsRequest.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 a chat room or user profile whose blurbs to stream.
        +   * 
        + * + * + * 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; + } + } + + /** + * + * + *
        +   * The resource name of a chat room or user profile whose blurbs to stream.
        +   * 
        + * + * + * 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 EXPIRE_TIME_FIELD_NUMBER = 2; + private com.google.protobuf.Timestamp expireTime_; + + /** + * + * + *
        +   * The time at which this stream will close.
        +   * 
        + * + * .google.protobuf.Timestamp expire_time = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the expireTime field is set. + */ + @java.lang.Override + public boolean hasExpireTime() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
        +   * The time at which this stream will close.
        +   * 
        + * + * .google.protobuf.Timestamp expire_time = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The expireTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getExpireTime() { + return expireTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : expireTime_; + } + + /** + * + * + *
        +   * The time at which this stream will close.
        +   * 
        + * + * .google.protobuf.Timestamp expire_time = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getExpireTimeOrBuilder() { + return expireTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : expireTime_; + } + + 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.GeneratedMessage.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, name_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(2, getExpireTime()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, name_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getExpireTime()); + } + 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.showcase.v1beta1.StreamBlurbsRequest)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.StreamBlurbsRequest other = + (com.google.showcase.v1beta1.StreamBlurbsRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (hasExpireTime() != other.hasExpireTime()) return false; + if (hasExpireTime()) { + if (!getExpireTime().equals(other.getExpireTime())) 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 (hasExpireTime()) { + hash = (37 * hash) + EXPIRE_TIME_FIELD_NUMBER; + hash = (53 * hash) + getExpireTime().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.showcase.v1beta1.StreamBlurbsRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.StreamBlurbsRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.StreamBlurbsRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.StreamBlurbsRequest 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.showcase.v1beta1.StreamBlurbsRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.StreamBlurbsRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.StreamBlurbsRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.StreamBlurbsRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.showcase.v1beta1.StreamBlurbsRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.StreamBlurbsRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.showcase.v1beta1.StreamBlurbsRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.StreamBlurbsRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.showcase.v1beta1.StreamBlurbsRequest 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
        +   * The request message for the google.showcase.v1beta1.Messaging\StreamBlurbs
        +   * method.
        +   * 
        + * + * Protobuf type {@code google.showcase.v1beta1.StreamBlurbsRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.StreamBlurbsRequest) + com.google.showcase.v1beta1.StreamBlurbsRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.MessagingOuterClass + .internal_static_google_showcase_v1beta1_StreamBlurbsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.MessagingOuterClass + .internal_static_google_showcase_v1beta1_StreamBlurbsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.StreamBlurbsRequest.class, + com.google.showcase.v1beta1.StreamBlurbsRequest.Builder.class); + } + + // Construct using com.google.showcase.v1beta1.StreamBlurbsRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetExpireTimeFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + expireTime_ = null; + if (expireTimeBuilder_ != null) { + expireTimeBuilder_.dispose(); + expireTimeBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.showcase.v1beta1.MessagingOuterClass + .internal_static_google_showcase_v1beta1_StreamBlurbsRequest_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.StreamBlurbsRequest getDefaultInstanceForType() { + return com.google.showcase.v1beta1.StreamBlurbsRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.StreamBlurbsRequest build() { + com.google.showcase.v1beta1.StreamBlurbsRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.StreamBlurbsRequest buildPartial() { + com.google.showcase.v1beta1.StreamBlurbsRequest result = + new com.google.showcase.v1beta1.StreamBlurbsRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.showcase.v1beta1.StreamBlurbsRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.expireTime_ = expireTimeBuilder_ == null ? expireTime_ : expireTimeBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.showcase.v1beta1.StreamBlurbsRequest) { + return mergeFrom((com.google.showcase.v1beta1.StreamBlurbsRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.showcase.v1beta1.StreamBlurbsRequest other) { + if (other == com.google.showcase.v1beta1.StreamBlurbsRequest.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.hasExpireTime()) { + mergeExpireTime(other.getExpireTime()); + } + 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( + internalGetExpireTimeFieldBuilder().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 name_ = ""; + + /** + * + * + *
        +     * The resource name of a chat room or user profile whose blurbs to stream.
        +     * 
        + * + * + * 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; + } + } + + /** + * + * + *
        +     * The resource name of a chat room or user profile whose blurbs to stream.
        +     * 
        + * + * + * 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; + } + } + + /** + * + * + *
        +     * The resource name of a chat room or user profile whose blurbs to stream.
        +     * 
        + * + * + * 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; + } + + /** + * + * + *
        +     * The resource name of a chat room or user profile whose blurbs to stream.
        +     * 
        + * + * + * 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; + } + + /** + * + * + *
        +     * The resource name of a chat room or user profile whose blurbs to stream.
        +     * 
        + * + * + * 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.protobuf.Timestamp expireTime_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + expireTimeBuilder_; + + /** + * + * + *
        +     * The time at which this stream will close.
        +     * 
        + * + * .google.protobuf.Timestamp expire_time = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the expireTime field is set. + */ + public boolean hasExpireTime() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
        +     * The time at which this stream will close.
        +     * 
        + * + * .google.protobuf.Timestamp expire_time = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The expireTime. + */ + public com.google.protobuf.Timestamp getExpireTime() { + if (expireTimeBuilder_ == null) { + return expireTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : expireTime_; + } else { + return expireTimeBuilder_.getMessage(); + } + } + + /** + * + * + *
        +     * The time at which this stream will close.
        +     * 
        + * + * .google.protobuf.Timestamp expire_time = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setExpireTime(com.google.protobuf.Timestamp value) { + if (expireTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + expireTime_ = value; + } else { + expireTimeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
        +     * The time at which this stream will close.
        +     * 
        + * + * .google.protobuf.Timestamp expire_time = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setExpireTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (expireTimeBuilder_ == null) { + expireTime_ = builderForValue.build(); + } else { + expireTimeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
        +     * The time at which this stream will close.
        +     * 
        + * + * .google.protobuf.Timestamp expire_time = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeExpireTime(com.google.protobuf.Timestamp value) { + if (expireTimeBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && expireTime_ != null + && expireTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getExpireTimeBuilder().mergeFrom(value); + } else { + expireTime_ = value; + } + } else { + expireTimeBuilder_.mergeFrom(value); + } + if (expireTime_ != null) { + bitField0_ |= 0x00000002; + onChanged(); + } + return this; + } + + /** + * + * + *
        +     * The time at which this stream will close.
        +     * 
        + * + * .google.protobuf.Timestamp expire_time = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearExpireTime() { + bitField0_ = (bitField0_ & ~0x00000002); + expireTime_ = null; + if (expireTimeBuilder_ != null) { + expireTimeBuilder_.dispose(); + expireTimeBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
        +     * The time at which this stream will close.
        +     * 
        + * + * .google.protobuf.Timestamp expire_time = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.protobuf.Timestamp.Builder getExpireTimeBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return internalGetExpireTimeFieldBuilder().getBuilder(); + } + + /** + * + * + *
        +     * The time at which this stream will close.
        +     * 
        + * + * .google.protobuf.Timestamp expire_time = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.protobuf.TimestampOrBuilder getExpireTimeOrBuilder() { + if (expireTimeBuilder_ != null) { + return expireTimeBuilder_.getMessageOrBuilder(); + } else { + return expireTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : expireTime_; + } + } + + /** + * + * + *
        +     * The time at which this stream will close.
        +     * 
        + * + * .google.protobuf.Timestamp expire_time = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + internalGetExpireTimeFieldBuilder() { + if (expireTimeBuilder_ == null) { + expireTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getExpireTime(), getParentForChildren(), isClean()); + expireTime_ = null; + } + return expireTimeBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.showcase.v1beta1.StreamBlurbsRequest) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.StreamBlurbsRequest) + private static final com.google.showcase.v1beta1.StreamBlurbsRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.StreamBlurbsRequest(); + } + + public static com.google.showcase.v1beta1.StreamBlurbsRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public StreamBlurbsRequest 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.showcase.v1beta1.StreamBlurbsRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/StreamBlurbsRequestOrBuilder.java b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/StreamBlurbsRequestOrBuilder.java new file mode 100644 index 0000000000..ea253564a8 --- /dev/null +++ b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/StreamBlurbsRequestOrBuilder.java @@ -0,0 +1,98 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: schema/google/showcase/v1beta1/messaging.proto +// Protobuf Java Version: 4.33.2 + +package com.google.showcase.v1beta1; + +@com.google.protobuf.Generated +public interface StreamBlurbsRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.StreamBlurbsRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
        +   * The resource name of a chat room or user profile whose blurbs to stream.
        +   * 
        + * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + + /** + * + * + *
        +   * The resource name of a chat room or user profile whose blurbs to stream.
        +   * 
        + * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
        +   * The time at which this stream will close.
        +   * 
        + * + * .google.protobuf.Timestamp expire_time = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the expireTime field is set. + */ + boolean hasExpireTime(); + + /** + * + * + *
        +   * The time at which this stream will close.
        +   * 
        + * + * .google.protobuf.Timestamp expire_time = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The expireTime. + */ + com.google.protobuf.Timestamp getExpireTime(); + + /** + * + * + *
        +   * The time at which this stream will close.
        +   * 
        + * + * .google.protobuf.Timestamp expire_time = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.protobuf.TimestampOrBuilder getExpireTimeOrBuilder(); +} diff --git a/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/StreamBlurbsResponse.java b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/StreamBlurbsResponse.java new file mode 100644 index 0000000000..2547f6de2d --- /dev/null +++ b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/StreamBlurbsResponse.java @@ -0,0 +1,1029 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: schema/google/showcase/v1beta1/messaging.proto +// Protobuf Java Version: 4.33.2 + +package com.google.showcase.v1beta1; + +/** + * + * + *
        + * The response message for the google.showcase.v1beta1.Messaging\StreamBlurbs
        + * method.
        + * 
        + * + * Protobuf type {@code google.showcase.v1beta1.StreamBlurbsResponse} + */ +@com.google.protobuf.Generated +public final class StreamBlurbsResponse extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.StreamBlurbsResponse) + StreamBlurbsResponseOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "StreamBlurbsResponse"); + } + + // Use StreamBlurbsResponse.newBuilder() to construct. + private StreamBlurbsResponse(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private StreamBlurbsResponse() { + action_ = 0; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.MessagingOuterClass + .internal_static_google_showcase_v1beta1_StreamBlurbsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.MessagingOuterClass + .internal_static_google_showcase_v1beta1_StreamBlurbsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.StreamBlurbsResponse.class, + com.google.showcase.v1beta1.StreamBlurbsResponse.Builder.class); + } + + /** + * + * + *
        +   * The action that triggered the blurb to be returned.
        +   * 
        + * + * Protobuf enum {@code google.showcase.v1beta1.StreamBlurbsResponse.Action} + */ + public enum Action implements com.google.protobuf.ProtocolMessageEnum { + /** ACTION_UNSPECIFIED = 0; */ + ACTION_UNSPECIFIED(0), + /** + * + * + *
        +     * Specifies that the blurb was created.
        +     * 
        + * + * CREATE = 1; + */ + CREATE(1), + /** + * + * + *
        +     * Specifies that the blurb was updated.
        +     * 
        + * + * UPDATE = 2; + */ + UPDATE(2), + /** + * + * + *
        +     * Specifies that the blurb was deleted.
        +     * 
        + * + * DELETE = 3; + */ + DELETE(3), + UNRECOGNIZED(-1), + ; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "Action"); + } + + /** ACTION_UNSPECIFIED = 0; */ + public static final int ACTION_UNSPECIFIED_VALUE = 0; + + /** + * + * + *
        +     * Specifies that the blurb was created.
        +     * 
        + * + * CREATE = 1; + */ + public static final int CREATE_VALUE = 1; + + /** + * + * + *
        +     * Specifies that the blurb was updated.
        +     * 
        + * + * UPDATE = 2; + */ + public static final int UPDATE_VALUE = 2; + + /** + * + * + *
        +     * Specifies that the blurb was deleted.
        +     * 
        + * + * DELETE = 3; + */ + public static final int DELETE_VALUE = 3; + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static Action 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 Action forNumber(int value) { + switch (value) { + case 0: + return ACTION_UNSPECIFIED; + case 1: + return CREATE; + case 2: + return UPDATE; + case 3: + return DELETE; + 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 Action findValueByNumber(int number) { + return Action.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 com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.showcase.v1beta1.StreamBlurbsResponse.getDescriptor().getEnumTypes().get(0); + } + + private static final Action[] VALUES = values(); + + public static Action 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 Action(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.showcase.v1beta1.StreamBlurbsResponse.Action) + } + + private int bitField0_; + public static final int BLURB_FIELD_NUMBER = 1; + private com.google.showcase.v1beta1.Blurb blurb_; + + /** + * + * + *
        +   * The blurb that was either created, updated, or deleted.
        +   * 
        + * + * .google.showcase.v1beta1.Blurb blurb = 1; + * + * @return Whether the blurb field is set. + */ + @java.lang.Override + public boolean hasBlurb() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
        +   * The blurb that was either created, updated, or deleted.
        +   * 
        + * + * .google.showcase.v1beta1.Blurb blurb = 1; + * + * @return The blurb. + */ + @java.lang.Override + public com.google.showcase.v1beta1.Blurb getBlurb() { + return blurb_ == null ? com.google.showcase.v1beta1.Blurb.getDefaultInstance() : blurb_; + } + + /** + * + * + *
        +   * The blurb that was either created, updated, or deleted.
        +   * 
        + * + * .google.showcase.v1beta1.Blurb blurb = 1; + */ + @java.lang.Override + public com.google.showcase.v1beta1.BlurbOrBuilder getBlurbOrBuilder() { + return blurb_ == null ? com.google.showcase.v1beta1.Blurb.getDefaultInstance() : blurb_; + } + + public static final int ACTION_FIELD_NUMBER = 2; + private int action_ = 0; + + /** + * + * + *
        +   * The action that triggered the blurb to be returned.
        +   * 
        + * + * .google.showcase.v1beta1.StreamBlurbsResponse.Action action = 2; + * + * @return The enum numeric value on the wire for action. + */ + @java.lang.Override + public int getActionValue() { + return action_; + } + + /** + * + * + *
        +   * The action that triggered the blurb to be returned.
        +   * 
        + * + * .google.showcase.v1beta1.StreamBlurbsResponse.Action action = 2; + * + * @return The action. + */ + @java.lang.Override + public com.google.showcase.v1beta1.StreamBlurbsResponse.Action getAction() { + com.google.showcase.v1beta1.StreamBlurbsResponse.Action result = + com.google.showcase.v1beta1.StreamBlurbsResponse.Action.forNumber(action_); + return result == null + ? com.google.showcase.v1beta1.StreamBlurbsResponse.Action.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 (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(1, getBlurb()); + } + if (action_ + != com.google.showcase.v1beta1.StreamBlurbsResponse.Action.ACTION_UNSPECIFIED.getNumber()) { + output.writeEnum(2, action_); + } + 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, getBlurb()); + } + if (action_ + != com.google.showcase.v1beta1.StreamBlurbsResponse.Action.ACTION_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(2, action_); + } + 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.showcase.v1beta1.StreamBlurbsResponse)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.StreamBlurbsResponse other = + (com.google.showcase.v1beta1.StreamBlurbsResponse) obj; + + if (hasBlurb() != other.hasBlurb()) return false; + if (hasBlurb()) { + if (!getBlurb().equals(other.getBlurb())) return false; + } + if (action_ != other.action_) 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 (hasBlurb()) { + hash = (37 * hash) + BLURB_FIELD_NUMBER; + hash = (53 * hash) + getBlurb().hashCode(); + } + hash = (37 * hash) + ACTION_FIELD_NUMBER; + hash = (53 * hash) + action_; + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.showcase.v1beta1.StreamBlurbsResponse parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.StreamBlurbsResponse parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.StreamBlurbsResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.StreamBlurbsResponse 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.showcase.v1beta1.StreamBlurbsResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.StreamBlurbsResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.StreamBlurbsResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.StreamBlurbsResponse parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.showcase.v1beta1.StreamBlurbsResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.StreamBlurbsResponse parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.showcase.v1beta1.StreamBlurbsResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.StreamBlurbsResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.showcase.v1beta1.StreamBlurbsResponse 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
        +   * The response message for the google.showcase.v1beta1.Messaging\StreamBlurbs
        +   * method.
        +   * 
        + * + * Protobuf type {@code google.showcase.v1beta1.StreamBlurbsResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.StreamBlurbsResponse) + com.google.showcase.v1beta1.StreamBlurbsResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.MessagingOuterClass + .internal_static_google_showcase_v1beta1_StreamBlurbsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.MessagingOuterClass + .internal_static_google_showcase_v1beta1_StreamBlurbsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.StreamBlurbsResponse.class, + com.google.showcase.v1beta1.StreamBlurbsResponse.Builder.class); + } + + // Construct using com.google.showcase.v1beta1.StreamBlurbsResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetBlurbFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + blurb_ = null; + if (blurbBuilder_ != null) { + blurbBuilder_.dispose(); + blurbBuilder_ = null; + } + action_ = 0; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.showcase.v1beta1.MessagingOuterClass + .internal_static_google_showcase_v1beta1_StreamBlurbsResponse_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.StreamBlurbsResponse getDefaultInstanceForType() { + return com.google.showcase.v1beta1.StreamBlurbsResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.StreamBlurbsResponse build() { + com.google.showcase.v1beta1.StreamBlurbsResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.StreamBlurbsResponse buildPartial() { + com.google.showcase.v1beta1.StreamBlurbsResponse result = + new com.google.showcase.v1beta1.StreamBlurbsResponse(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.showcase.v1beta1.StreamBlurbsResponse result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.blurb_ = blurbBuilder_ == null ? blurb_ : blurbBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.action_ = action_; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.showcase.v1beta1.StreamBlurbsResponse) { + return mergeFrom((com.google.showcase.v1beta1.StreamBlurbsResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.showcase.v1beta1.StreamBlurbsResponse other) { + if (other == com.google.showcase.v1beta1.StreamBlurbsResponse.getDefaultInstance()) + return this; + if (other.hasBlurb()) { + mergeBlurb(other.getBlurb()); + } + if (other.action_ != 0) { + setActionValue(other.getActionValue()); + } + 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(internalGetBlurbFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 16: + { + action_ = input.readEnum(); + 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 com.google.showcase.v1beta1.Blurb blurb_; + private com.google.protobuf.SingleFieldBuilder< + com.google.showcase.v1beta1.Blurb, + com.google.showcase.v1beta1.Blurb.Builder, + com.google.showcase.v1beta1.BlurbOrBuilder> + blurbBuilder_; + + /** + * + * + *
        +     * The blurb that was either created, updated, or deleted.
        +     * 
        + * + * .google.showcase.v1beta1.Blurb blurb = 1; + * + * @return Whether the blurb field is set. + */ + public boolean hasBlurb() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
        +     * The blurb that was either created, updated, or deleted.
        +     * 
        + * + * .google.showcase.v1beta1.Blurb blurb = 1; + * + * @return The blurb. + */ + public com.google.showcase.v1beta1.Blurb getBlurb() { + if (blurbBuilder_ == null) { + return blurb_ == null ? com.google.showcase.v1beta1.Blurb.getDefaultInstance() : blurb_; + } else { + return blurbBuilder_.getMessage(); + } + } + + /** + * + * + *
        +     * The blurb that was either created, updated, or deleted.
        +     * 
        + * + * .google.showcase.v1beta1.Blurb blurb = 1; + */ + public Builder setBlurb(com.google.showcase.v1beta1.Blurb value) { + if (blurbBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + blurb_ = value; + } else { + blurbBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
        +     * The blurb that was either created, updated, or deleted.
        +     * 
        + * + * .google.showcase.v1beta1.Blurb blurb = 1; + */ + public Builder setBlurb(com.google.showcase.v1beta1.Blurb.Builder builderForValue) { + if (blurbBuilder_ == null) { + blurb_ = builderForValue.build(); + } else { + blurbBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
        +     * The blurb that was either created, updated, or deleted.
        +     * 
        + * + * .google.showcase.v1beta1.Blurb blurb = 1; + */ + public Builder mergeBlurb(com.google.showcase.v1beta1.Blurb value) { + if (blurbBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) + && blurb_ != null + && blurb_ != com.google.showcase.v1beta1.Blurb.getDefaultInstance()) { + getBlurbBuilder().mergeFrom(value); + } else { + blurb_ = value; + } + } else { + blurbBuilder_.mergeFrom(value); + } + if (blurb_ != null) { + bitField0_ |= 0x00000001; + onChanged(); + } + return this; + } + + /** + * + * + *
        +     * The blurb that was either created, updated, or deleted.
        +     * 
        + * + * .google.showcase.v1beta1.Blurb blurb = 1; + */ + public Builder clearBlurb() { + bitField0_ = (bitField0_ & ~0x00000001); + blurb_ = null; + if (blurbBuilder_ != null) { + blurbBuilder_.dispose(); + blurbBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
        +     * The blurb that was either created, updated, or deleted.
        +     * 
        + * + * .google.showcase.v1beta1.Blurb blurb = 1; + */ + public com.google.showcase.v1beta1.Blurb.Builder getBlurbBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return internalGetBlurbFieldBuilder().getBuilder(); + } + + /** + * + * + *
        +     * The blurb that was either created, updated, or deleted.
        +     * 
        + * + * .google.showcase.v1beta1.Blurb blurb = 1; + */ + public com.google.showcase.v1beta1.BlurbOrBuilder getBlurbOrBuilder() { + if (blurbBuilder_ != null) { + return blurbBuilder_.getMessageOrBuilder(); + } else { + return blurb_ == null ? com.google.showcase.v1beta1.Blurb.getDefaultInstance() : blurb_; + } + } + + /** + * + * + *
        +     * The blurb that was either created, updated, or deleted.
        +     * 
        + * + * .google.showcase.v1beta1.Blurb blurb = 1; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.showcase.v1beta1.Blurb, + com.google.showcase.v1beta1.Blurb.Builder, + com.google.showcase.v1beta1.BlurbOrBuilder> + internalGetBlurbFieldBuilder() { + if (blurbBuilder_ == null) { + blurbBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.showcase.v1beta1.Blurb, + com.google.showcase.v1beta1.Blurb.Builder, + com.google.showcase.v1beta1.BlurbOrBuilder>( + getBlurb(), getParentForChildren(), isClean()); + blurb_ = null; + } + return blurbBuilder_; + } + + private int action_ = 0; + + /** + * + * + *
        +     * The action that triggered the blurb to be returned.
        +     * 
        + * + * .google.showcase.v1beta1.StreamBlurbsResponse.Action action = 2; + * + * @return The enum numeric value on the wire for action. + */ + @java.lang.Override + public int getActionValue() { + return action_; + } + + /** + * + * + *
        +     * The action that triggered the blurb to be returned.
        +     * 
        + * + * .google.showcase.v1beta1.StreamBlurbsResponse.Action action = 2; + * + * @param value The enum numeric value on the wire for action to set. + * @return This builder for chaining. + */ + public Builder setActionValue(int value) { + action_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
        +     * The action that triggered the blurb to be returned.
        +     * 
        + * + * .google.showcase.v1beta1.StreamBlurbsResponse.Action action = 2; + * + * @return The action. + */ + @java.lang.Override + public com.google.showcase.v1beta1.StreamBlurbsResponse.Action getAction() { + com.google.showcase.v1beta1.StreamBlurbsResponse.Action result = + com.google.showcase.v1beta1.StreamBlurbsResponse.Action.forNumber(action_); + return result == null + ? com.google.showcase.v1beta1.StreamBlurbsResponse.Action.UNRECOGNIZED + : result; + } + + /** + * + * + *
        +     * The action that triggered the blurb to be returned.
        +     * 
        + * + * .google.showcase.v1beta1.StreamBlurbsResponse.Action action = 2; + * + * @param value The action to set. + * @return This builder for chaining. + */ + public Builder setAction(com.google.showcase.v1beta1.StreamBlurbsResponse.Action value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000002; + action_ = value.getNumber(); + onChanged(); + return this; + } + + /** + * + * + *
        +     * The action that triggered the blurb to be returned.
        +     * 
        + * + * .google.showcase.v1beta1.StreamBlurbsResponse.Action action = 2; + * + * @return This builder for chaining. + */ + public Builder clearAction() { + bitField0_ = (bitField0_ & ~0x00000002); + action_ = 0; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.showcase.v1beta1.StreamBlurbsResponse) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.StreamBlurbsResponse) + private static final com.google.showcase.v1beta1.StreamBlurbsResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.StreamBlurbsResponse(); + } + + public static com.google.showcase.v1beta1.StreamBlurbsResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public StreamBlurbsResponse 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.showcase.v1beta1.StreamBlurbsResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/StreamBlurbsResponseOrBuilder.java b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/StreamBlurbsResponseOrBuilder.java new file mode 100644 index 0000000000..74c64832d6 --- /dev/null +++ b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/StreamBlurbsResponseOrBuilder.java @@ -0,0 +1,91 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: schema/google/showcase/v1beta1/messaging.proto +// Protobuf Java Version: 4.33.2 + +package com.google.showcase.v1beta1; + +@com.google.protobuf.Generated +public interface StreamBlurbsResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.StreamBlurbsResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
        +   * The blurb that was either created, updated, or deleted.
        +   * 
        + * + * .google.showcase.v1beta1.Blurb blurb = 1; + * + * @return Whether the blurb field is set. + */ + boolean hasBlurb(); + + /** + * + * + *
        +   * The blurb that was either created, updated, or deleted.
        +   * 
        + * + * .google.showcase.v1beta1.Blurb blurb = 1; + * + * @return The blurb. + */ + com.google.showcase.v1beta1.Blurb getBlurb(); + + /** + * + * + *
        +   * The blurb that was either created, updated, or deleted.
        +   * 
        + * + * .google.showcase.v1beta1.Blurb blurb = 1; + */ + com.google.showcase.v1beta1.BlurbOrBuilder getBlurbOrBuilder(); + + /** + * + * + *
        +   * The action that triggered the blurb to be returned.
        +   * 
        + * + * .google.showcase.v1beta1.StreamBlurbsResponse.Action action = 2; + * + * @return The enum numeric value on the wire for action. + */ + int getActionValue(); + + /** + * + * + *
        +   * The action that triggered the blurb to be returned.
        +   * 
        + * + * .google.showcase.v1beta1.StreamBlurbsResponse.Action action = 2; + * + * @return The action. + */ + com.google.showcase.v1beta1.StreamBlurbsResponse.Action getAction(); +} diff --git a/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/StreamingSequence.java b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/StreamingSequence.java new file mode 100644 index 0000000000..2aceeee676 --- /dev/null +++ b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/StreamingSequence.java @@ -0,0 +1,2403 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: schema/google/showcase/v1beta1/sequence.proto +// Protobuf Java Version: 4.33.2 + +package com.google.showcase.v1beta1; + +/** Protobuf type {@code google.showcase.v1beta1.StreamingSequence} */ +@com.google.protobuf.Generated +public final class StreamingSequence extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.StreamingSequence) + StreamingSequenceOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "StreamingSequence"); + } + + // Use StreamingSequence.newBuilder() to construct. + private StreamingSequence(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private StreamingSequence() { + name_ = ""; + content_ = ""; + responses_ = java.util.Collections.emptyList(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.SequenceOuterClass + .internal_static_google_showcase_v1beta1_StreamingSequence_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.SequenceOuterClass + .internal_static_google_showcase_v1beta1_StreamingSequence_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.StreamingSequence.class, + com.google.showcase.v1beta1.StreamingSequence.Builder.class); + } + + public interface ResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.StreamingSequence.Response) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
        +     * The status to return for an individual attempt.
        +     * 
        + * + * .google.rpc.Status status = 1; + * + * @return Whether the status field is set. + */ + boolean hasStatus(); + + /** + * + * + *
        +     * The status to return for an individual attempt.
        +     * 
        + * + * .google.rpc.Status status = 1; + * + * @return The status. + */ + com.google.rpc.Status getStatus(); + + /** + * + * + *
        +     * The status to return for an individual attempt.
        +     * 
        + * + * .google.rpc.Status status = 1; + */ + com.google.rpc.StatusOrBuilder getStatusOrBuilder(); + + /** + * + * + *
        +     * The amount of time to delay sending the response.
        +     * 
        + * + * .google.protobuf.Duration delay = 2; + * + * @return Whether the delay field is set. + */ + boolean hasDelay(); + + /** + * + * + *
        +     * The amount of time to delay sending the response.
        +     * 
        + * + * .google.protobuf.Duration delay = 2; + * + * @return The delay. + */ + com.google.protobuf.Duration getDelay(); + + /** + * + * + *
        +     * The amount of time to delay sending the response.
        +     * 
        + * + * .google.protobuf.Duration delay = 2; + */ + com.google.protobuf.DurationOrBuilder getDelayOrBuilder(); + + /** + * + * + *
        +     * The index that the status should be sent
        +     * 
        + * + * int32 response_index = 3; + * + * @return The responseIndex. + */ + int getResponseIndex(); + } + + /** + * + * + *
        +   * A server response to an RPC Attempt in a sequence.
        +   * 
        + * + * Protobuf type {@code google.showcase.v1beta1.StreamingSequence.Response} + */ + public static final class Response extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.StreamingSequence.Response) + ResponseOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "Response"); + } + + // Use Response.newBuilder() to construct. + private Response(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private Response() {} + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.SequenceOuterClass + .internal_static_google_showcase_v1beta1_StreamingSequence_Response_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.SequenceOuterClass + .internal_static_google_showcase_v1beta1_StreamingSequence_Response_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.StreamingSequence.Response.class, + com.google.showcase.v1beta1.StreamingSequence.Response.Builder.class); + } + + private int bitField0_; + public static final int STATUS_FIELD_NUMBER = 1; + private com.google.rpc.Status status_; + + /** + * + * + *
        +     * The status to return for an individual attempt.
        +     * 
        + * + * .google.rpc.Status status = 1; + * + * @return Whether the status field is set. + */ + @java.lang.Override + public boolean hasStatus() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
        +     * The status to return for an individual attempt.
        +     * 
        + * + * .google.rpc.Status status = 1; + * + * @return The status. + */ + @java.lang.Override + public com.google.rpc.Status getStatus() { + return status_ == null ? com.google.rpc.Status.getDefaultInstance() : status_; + } + + /** + * + * + *
        +     * The status to return for an individual attempt.
        +     * 
        + * + * .google.rpc.Status status = 1; + */ + @java.lang.Override + public com.google.rpc.StatusOrBuilder getStatusOrBuilder() { + return status_ == null ? com.google.rpc.Status.getDefaultInstance() : status_; + } + + public static final int DELAY_FIELD_NUMBER = 2; + private com.google.protobuf.Duration delay_; + + /** + * + * + *
        +     * The amount of time to delay sending the response.
        +     * 
        + * + * .google.protobuf.Duration delay = 2; + * + * @return Whether the delay field is set. + */ + @java.lang.Override + public boolean hasDelay() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
        +     * The amount of time to delay sending the response.
        +     * 
        + * + * .google.protobuf.Duration delay = 2; + * + * @return The delay. + */ + @java.lang.Override + public com.google.protobuf.Duration getDelay() { + return delay_ == null ? com.google.protobuf.Duration.getDefaultInstance() : delay_; + } + + /** + * + * + *
        +     * The amount of time to delay sending the response.
        +     * 
        + * + * .google.protobuf.Duration delay = 2; + */ + @java.lang.Override + public com.google.protobuf.DurationOrBuilder getDelayOrBuilder() { + return delay_ == null ? com.google.protobuf.Duration.getDefaultInstance() : delay_; + } + + public static final int RESPONSE_INDEX_FIELD_NUMBER = 3; + private int responseIndex_ = 0; + + /** + * + * + *
        +     * The index that the status should be sent
        +     * 
        + * + * int32 response_index = 3; + * + * @return The responseIndex. + */ + @java.lang.Override + public int getResponseIndex() { + return responseIndex_; + } + + 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, getStatus()); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeMessage(2, getDelay()); + } + if (responseIndex_ != 0) { + output.writeInt32(3, responseIndex_); + } + 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, getStatus()); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getDelay()); + } + if (responseIndex_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(3, responseIndex_); + } + 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.showcase.v1beta1.StreamingSequence.Response)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.StreamingSequence.Response other = + (com.google.showcase.v1beta1.StreamingSequence.Response) obj; + + if (hasStatus() != other.hasStatus()) return false; + if (hasStatus()) { + if (!getStatus().equals(other.getStatus())) return false; + } + if (hasDelay() != other.hasDelay()) return false; + if (hasDelay()) { + if (!getDelay().equals(other.getDelay())) return false; + } + if (getResponseIndex() != other.getResponseIndex()) 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 (hasStatus()) { + hash = (37 * hash) + STATUS_FIELD_NUMBER; + hash = (53 * hash) + getStatus().hashCode(); + } + if (hasDelay()) { + hash = (37 * hash) + DELAY_FIELD_NUMBER; + hash = (53 * hash) + getDelay().hashCode(); + } + hash = (37 * hash) + RESPONSE_INDEX_FIELD_NUMBER; + hash = (53 * hash) + getResponseIndex(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.showcase.v1beta1.StreamingSequence.Response parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.StreamingSequence.Response parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.StreamingSequence.Response parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.StreamingSequence.Response 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.showcase.v1beta1.StreamingSequence.Response parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.StreamingSequence.Response parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.StreamingSequence.Response parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.StreamingSequence.Response parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.showcase.v1beta1.StreamingSequence.Response parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.StreamingSequence.Response parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.showcase.v1beta1.StreamingSequence.Response parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.StreamingSequence.Response parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.showcase.v1beta1.StreamingSequence.Response 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
        +     * A server response to an RPC Attempt in a sequence.
        +     * 
        + * + * Protobuf type {@code google.showcase.v1beta1.StreamingSequence.Response} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.StreamingSequence.Response) + com.google.showcase.v1beta1.StreamingSequence.ResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.SequenceOuterClass + .internal_static_google_showcase_v1beta1_StreamingSequence_Response_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.SequenceOuterClass + .internal_static_google_showcase_v1beta1_StreamingSequence_Response_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.StreamingSequence.Response.class, + com.google.showcase.v1beta1.StreamingSequence.Response.Builder.class); + } + + // Construct using com.google.showcase.v1beta1.StreamingSequence.Response.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetStatusFieldBuilder(); + internalGetDelayFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + status_ = null; + if (statusBuilder_ != null) { + statusBuilder_.dispose(); + statusBuilder_ = null; + } + delay_ = null; + if (delayBuilder_ != null) { + delayBuilder_.dispose(); + delayBuilder_ = null; + } + responseIndex_ = 0; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.showcase.v1beta1.SequenceOuterClass + .internal_static_google_showcase_v1beta1_StreamingSequence_Response_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.StreamingSequence.Response getDefaultInstanceForType() { + return com.google.showcase.v1beta1.StreamingSequence.Response.getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.StreamingSequence.Response build() { + com.google.showcase.v1beta1.StreamingSequence.Response result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.StreamingSequence.Response buildPartial() { + com.google.showcase.v1beta1.StreamingSequence.Response result = + new com.google.showcase.v1beta1.StreamingSequence.Response(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.showcase.v1beta1.StreamingSequence.Response result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.status_ = statusBuilder_ == null ? status_ : statusBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.delay_ = delayBuilder_ == null ? delay_ : delayBuilder_.build(); + to_bitField0_ |= 0x00000002; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.responseIndex_ = responseIndex_; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.showcase.v1beta1.StreamingSequence.Response) { + return mergeFrom((com.google.showcase.v1beta1.StreamingSequence.Response) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.showcase.v1beta1.StreamingSequence.Response other) { + if (other == com.google.showcase.v1beta1.StreamingSequence.Response.getDefaultInstance()) + return this; + if (other.hasStatus()) { + mergeStatus(other.getStatus()); + } + if (other.hasDelay()) { + mergeDelay(other.getDelay()); + } + if (other.getResponseIndex() != 0) { + setResponseIndex(other.getResponseIndex()); + } + 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( + internalGetStatusFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + input.readMessage(internalGetDelayFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 24: + { + responseIndex_ = 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 com.google.rpc.Status status_; + private com.google.protobuf.SingleFieldBuilder< + com.google.rpc.Status, com.google.rpc.Status.Builder, com.google.rpc.StatusOrBuilder> + statusBuilder_; + + /** + * + * + *
        +       * The status to return for an individual attempt.
        +       * 
        + * + * .google.rpc.Status status = 1; + * + * @return Whether the status field is set. + */ + public boolean hasStatus() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
        +       * The status to return for an individual attempt.
        +       * 
        + * + * .google.rpc.Status status = 1; + * + * @return The status. + */ + public com.google.rpc.Status getStatus() { + if (statusBuilder_ == null) { + return status_ == null ? com.google.rpc.Status.getDefaultInstance() : status_; + } else { + return statusBuilder_.getMessage(); + } + } + + /** + * + * + *
        +       * The status to return for an individual attempt.
        +       * 
        + * + * .google.rpc.Status status = 1; + */ + public Builder setStatus(com.google.rpc.Status value) { + if (statusBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + status_ = value; + } else { + statusBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
        +       * The status to return for an individual attempt.
        +       * 
        + * + * .google.rpc.Status status = 1; + */ + public Builder setStatus(com.google.rpc.Status.Builder builderForValue) { + if (statusBuilder_ == null) { + status_ = builderForValue.build(); + } else { + statusBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
        +       * The status to return for an individual attempt.
        +       * 
        + * + * .google.rpc.Status status = 1; + */ + public Builder mergeStatus(com.google.rpc.Status value) { + if (statusBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) + && status_ != null + && status_ != com.google.rpc.Status.getDefaultInstance()) { + getStatusBuilder().mergeFrom(value); + } else { + status_ = value; + } + } else { + statusBuilder_.mergeFrom(value); + } + if (status_ != null) { + bitField0_ |= 0x00000001; + onChanged(); + } + return this; + } + + /** + * + * + *
        +       * The status to return for an individual attempt.
        +       * 
        + * + * .google.rpc.Status status = 1; + */ + public Builder clearStatus() { + bitField0_ = (bitField0_ & ~0x00000001); + status_ = null; + if (statusBuilder_ != null) { + statusBuilder_.dispose(); + statusBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
        +       * The status to return for an individual attempt.
        +       * 
        + * + * .google.rpc.Status status = 1; + */ + public com.google.rpc.Status.Builder getStatusBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return internalGetStatusFieldBuilder().getBuilder(); + } + + /** + * + * + *
        +       * The status to return for an individual attempt.
        +       * 
        + * + * .google.rpc.Status status = 1; + */ + public com.google.rpc.StatusOrBuilder getStatusOrBuilder() { + if (statusBuilder_ != null) { + return statusBuilder_.getMessageOrBuilder(); + } else { + return status_ == null ? com.google.rpc.Status.getDefaultInstance() : status_; + } + } + + /** + * + * + *
        +       * The status to return for an individual attempt.
        +       * 
        + * + * .google.rpc.Status status = 1; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.rpc.Status, com.google.rpc.Status.Builder, com.google.rpc.StatusOrBuilder> + internalGetStatusFieldBuilder() { + if (statusBuilder_ == null) { + statusBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.rpc.Status, + com.google.rpc.Status.Builder, + com.google.rpc.StatusOrBuilder>(getStatus(), getParentForChildren(), isClean()); + status_ = null; + } + return statusBuilder_; + } + + private com.google.protobuf.Duration delay_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder> + delayBuilder_; + + /** + * + * + *
        +       * The amount of time to delay sending the response.
        +       * 
        + * + * .google.protobuf.Duration delay = 2; + * + * @return Whether the delay field is set. + */ + public boolean hasDelay() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
        +       * The amount of time to delay sending the response.
        +       * 
        + * + * .google.protobuf.Duration delay = 2; + * + * @return The delay. + */ + public com.google.protobuf.Duration getDelay() { + if (delayBuilder_ == null) { + return delay_ == null ? com.google.protobuf.Duration.getDefaultInstance() : delay_; + } else { + return delayBuilder_.getMessage(); + } + } + + /** + * + * + *
        +       * The amount of time to delay sending the response.
        +       * 
        + * + * .google.protobuf.Duration delay = 2; + */ + public Builder setDelay(com.google.protobuf.Duration value) { + if (delayBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + delay_ = value; + } else { + delayBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
        +       * The amount of time to delay sending the response.
        +       * 
        + * + * .google.protobuf.Duration delay = 2; + */ + public Builder setDelay(com.google.protobuf.Duration.Builder builderForValue) { + if (delayBuilder_ == null) { + delay_ = builderForValue.build(); + } else { + delayBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
        +       * The amount of time to delay sending the response.
        +       * 
        + * + * .google.protobuf.Duration delay = 2; + */ + public Builder mergeDelay(com.google.protobuf.Duration value) { + if (delayBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && delay_ != null + && delay_ != com.google.protobuf.Duration.getDefaultInstance()) { + getDelayBuilder().mergeFrom(value); + } else { + delay_ = value; + } + } else { + delayBuilder_.mergeFrom(value); + } + if (delay_ != null) { + bitField0_ |= 0x00000002; + onChanged(); + } + return this; + } + + /** + * + * + *
        +       * The amount of time to delay sending the response.
        +       * 
        + * + * .google.protobuf.Duration delay = 2; + */ + public Builder clearDelay() { + bitField0_ = (bitField0_ & ~0x00000002); + delay_ = null; + if (delayBuilder_ != null) { + delayBuilder_.dispose(); + delayBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
        +       * The amount of time to delay sending the response.
        +       * 
        + * + * .google.protobuf.Duration delay = 2; + */ + public com.google.protobuf.Duration.Builder getDelayBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return internalGetDelayFieldBuilder().getBuilder(); + } + + /** + * + * + *
        +       * The amount of time to delay sending the response.
        +       * 
        + * + * .google.protobuf.Duration delay = 2; + */ + public com.google.protobuf.DurationOrBuilder getDelayOrBuilder() { + if (delayBuilder_ != null) { + return delayBuilder_.getMessageOrBuilder(); + } else { + return delay_ == null ? com.google.protobuf.Duration.getDefaultInstance() : delay_; + } + } + + /** + * + * + *
        +       * The amount of time to delay sending the response.
        +       * 
        + * + * .google.protobuf.Duration delay = 2; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder> + internalGetDelayFieldBuilder() { + if (delayBuilder_ == null) { + delayBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder>( + getDelay(), getParentForChildren(), isClean()); + delay_ = null; + } + return delayBuilder_; + } + + private int responseIndex_; + + /** + * + * + *
        +       * The index that the status should be sent
        +       * 
        + * + * int32 response_index = 3; + * + * @return The responseIndex. + */ + @java.lang.Override + public int getResponseIndex() { + return responseIndex_; + } + + /** + * + * + *
        +       * The index that the status should be sent
        +       * 
        + * + * int32 response_index = 3; + * + * @param value The responseIndex to set. + * @return This builder for chaining. + */ + public Builder setResponseIndex(int value) { + + responseIndex_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
        +       * The index that the status should be sent
        +       * 
        + * + * int32 response_index = 3; + * + * @return This builder for chaining. + */ + public Builder clearResponseIndex() { + bitField0_ = (bitField0_ & ~0x00000004); + responseIndex_ = 0; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.showcase.v1beta1.StreamingSequence.Response) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.StreamingSequence.Response) + private static final com.google.showcase.v1beta1.StreamingSequence.Response DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.StreamingSequence.Response(); + } + + public static com.google.showcase.v1beta1.StreamingSequence.Response getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Response 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.showcase.v1beta1.StreamingSequence.Response getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + + /** + * 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; + } + } + + /** + * 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 CONTENT_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object content_ = ""; + + /** + * + * + *
        +   * The Content that the stream will send
        +   * 
        + * + * string content = 2; + * + * @return The content. + */ + @java.lang.Override + public java.lang.String getContent() { + java.lang.Object ref = content_; + 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(); + content_ = s; + return s; + } + } + + /** + * + * + *
        +   * The Content that the stream will send
        +   * 
        + * + * string content = 2; + * + * @return The bytes for content. + */ + @java.lang.Override + public com.google.protobuf.ByteString getContentBytes() { + java.lang.Object ref = content_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + content_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int RESPONSES_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private java.util.List responses_; + + /** + * + * + *
        +   * Sequence of responses to return in order for each attempt. If empty, the
        +   * default response is an immediate OK.
        +   * 
        + * + * repeated .google.showcase.v1beta1.StreamingSequence.Response responses = 3; + */ + @java.lang.Override + public java.util.List getResponsesList() { + return responses_; + } + + /** + * + * + *
        +   * Sequence of responses to return in order for each attempt. If empty, the
        +   * default response is an immediate OK.
        +   * 
        + * + * repeated .google.showcase.v1beta1.StreamingSequence.Response responses = 3; + */ + @java.lang.Override + public java.util.List + getResponsesOrBuilderList() { + return responses_; + } + + /** + * + * + *
        +   * Sequence of responses to return in order for each attempt. If empty, the
        +   * default response is an immediate OK.
        +   * 
        + * + * repeated .google.showcase.v1beta1.StreamingSequence.Response responses = 3; + */ + @java.lang.Override + public int getResponsesCount() { + return responses_.size(); + } + + /** + * + * + *
        +   * Sequence of responses to return in order for each attempt. If empty, the
        +   * default response is an immediate OK.
        +   * 
        + * + * repeated .google.showcase.v1beta1.StreamingSequence.Response responses = 3; + */ + @java.lang.Override + public com.google.showcase.v1beta1.StreamingSequence.Response getResponses(int index) { + return responses_.get(index); + } + + /** + * + * + *
        +   * Sequence of responses to return in order for each attempt. If empty, the
        +   * default response is an immediate OK.
        +   * 
        + * + * repeated .google.showcase.v1beta1.StreamingSequence.Response responses = 3; + */ + @java.lang.Override + public com.google.showcase.v1beta1.StreamingSequence.ResponseOrBuilder getResponsesOrBuilder( + int index) { + return responses_.get(index); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, name_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(content_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, content_); + } + for (int i = 0; i < responses_.size(); i++) { + output.writeMessage(3, responses_.get(i)); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, name_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(content_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, content_); + } + for (int i = 0; i < responses_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, responses_.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.showcase.v1beta1.StreamingSequence)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.StreamingSequence other = + (com.google.showcase.v1beta1.StreamingSequence) obj; + + if (!getName().equals(other.getName())) return false; + if (!getContent().equals(other.getContent())) return false; + if (!getResponsesList().equals(other.getResponsesList())) 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) + CONTENT_FIELD_NUMBER; + hash = (53 * hash) + getContent().hashCode(); + if (getResponsesCount() > 0) { + hash = (37 * hash) + RESPONSES_FIELD_NUMBER; + hash = (53 * hash) + getResponsesList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.showcase.v1beta1.StreamingSequence parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.StreamingSequence parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.StreamingSequence parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.StreamingSequence 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.showcase.v1beta1.StreamingSequence parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.StreamingSequence parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.StreamingSequence parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.StreamingSequence parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.showcase.v1beta1.StreamingSequence parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.StreamingSequence parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.showcase.v1beta1.StreamingSequence parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.StreamingSequence parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.showcase.v1beta1.StreamingSequence 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** Protobuf type {@code google.showcase.v1beta1.StreamingSequence} */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.StreamingSequence) + com.google.showcase.v1beta1.StreamingSequenceOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.SequenceOuterClass + .internal_static_google_showcase_v1beta1_StreamingSequence_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.SequenceOuterClass + .internal_static_google_showcase_v1beta1_StreamingSequence_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.StreamingSequence.class, + com.google.showcase.v1beta1.StreamingSequence.Builder.class); + } + + // Construct using com.google.showcase.v1beta1.StreamingSequence.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + content_ = ""; + if (responsesBuilder_ == null) { + responses_ = java.util.Collections.emptyList(); + } else { + responses_ = null; + responsesBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000004); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.showcase.v1beta1.SequenceOuterClass + .internal_static_google_showcase_v1beta1_StreamingSequence_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.StreamingSequence getDefaultInstanceForType() { + return com.google.showcase.v1beta1.StreamingSequence.getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.StreamingSequence build() { + com.google.showcase.v1beta1.StreamingSequence result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.StreamingSequence buildPartial() { + com.google.showcase.v1beta1.StreamingSequence result = + new com.google.showcase.v1beta1.StreamingSequence(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields(com.google.showcase.v1beta1.StreamingSequence result) { + if (responsesBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0)) { + responses_ = java.util.Collections.unmodifiableList(responses_); + bitField0_ = (bitField0_ & ~0x00000004); + } + result.responses_ = responses_; + } else { + result.responses_ = responsesBuilder_.build(); + } + } + + private void buildPartial0(com.google.showcase.v1beta1.StreamingSequence result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.content_ = content_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.showcase.v1beta1.StreamingSequence) { + return mergeFrom((com.google.showcase.v1beta1.StreamingSequence) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.showcase.v1beta1.StreamingSequence other) { + if (other == com.google.showcase.v1beta1.StreamingSequence.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getContent().isEmpty()) { + content_ = other.content_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (responsesBuilder_ == null) { + if (!other.responses_.isEmpty()) { + if (responses_.isEmpty()) { + responses_ = other.responses_; + bitField0_ = (bitField0_ & ~0x00000004); + } else { + ensureResponsesIsMutable(); + responses_.addAll(other.responses_); + } + onChanged(); + } + } else { + if (!other.responses_.isEmpty()) { + if (responsesBuilder_.isEmpty()) { + responsesBuilder_.dispose(); + responsesBuilder_ = null; + responses_ = other.responses_; + bitField0_ = (bitField0_ & ~0x00000004); + responsesBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders + ? internalGetResponsesFieldBuilder() + : null; + } else { + responsesBuilder_.addAllMessages(other.responses_); + } + } + } + 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: + { + content_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + com.google.showcase.v1beta1.StreamingSequence.Response m = + input.readMessage( + com.google.showcase.v1beta1.StreamingSequence.Response.parser(), + extensionRegistry); + if (responsesBuilder_ == null) { + ensureResponsesIsMutable(); + responses_.add(m); + } else { + responsesBuilder_.addMessage(m); + } + 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_ = ""; + + /** + * 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; + } + } + + /** + * 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; + } + } + + /** + * 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; + } + + /** + * 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; + } + + /** + * 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 content_ = ""; + + /** + * + * + *
        +     * The Content that the stream will send
        +     * 
        + * + * string content = 2; + * + * @return The content. + */ + public java.lang.String getContent() { + java.lang.Object ref = content_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + content_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
        +     * The Content that the stream will send
        +     * 
        + * + * string content = 2; + * + * @return The bytes for content. + */ + public com.google.protobuf.ByteString getContentBytes() { + java.lang.Object ref = content_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + content_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
        +     * The Content that the stream will send
        +     * 
        + * + * string content = 2; + * + * @param value The content to set. + * @return This builder for chaining. + */ + public Builder setContent(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + content_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
        +     * The Content that the stream will send
        +     * 
        + * + * string content = 2; + * + * @return This builder for chaining. + */ + public Builder clearContent() { + content_ = getDefaultInstance().getContent(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
        +     * The Content that the stream will send
        +     * 
        + * + * string content = 2; + * + * @param value The bytes for content to set. + * @return This builder for chaining. + */ + public Builder setContentBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + content_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private java.util.List responses_ = + java.util.Collections.emptyList(); + + private void ensureResponsesIsMutable() { + if (!((bitField0_ & 0x00000004) != 0)) { + responses_ = + new java.util.ArrayList( + responses_); + bitField0_ |= 0x00000004; + } + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.google.showcase.v1beta1.StreamingSequence.Response, + com.google.showcase.v1beta1.StreamingSequence.Response.Builder, + com.google.showcase.v1beta1.StreamingSequence.ResponseOrBuilder> + responsesBuilder_; + + /** + * + * + *
        +     * Sequence of responses to return in order for each attempt. If empty, the
        +     * default response is an immediate OK.
        +     * 
        + * + * repeated .google.showcase.v1beta1.StreamingSequence.Response responses = 3; + */ + public java.util.List + getResponsesList() { + if (responsesBuilder_ == null) { + return java.util.Collections.unmodifiableList(responses_); + } else { + return responsesBuilder_.getMessageList(); + } + } + + /** + * + * + *
        +     * Sequence of responses to return in order for each attempt. If empty, the
        +     * default response is an immediate OK.
        +     * 
        + * + * repeated .google.showcase.v1beta1.StreamingSequence.Response responses = 3; + */ + public int getResponsesCount() { + if (responsesBuilder_ == null) { + return responses_.size(); + } else { + return responsesBuilder_.getCount(); + } + } + + /** + * + * + *
        +     * Sequence of responses to return in order for each attempt. If empty, the
        +     * default response is an immediate OK.
        +     * 
        + * + * repeated .google.showcase.v1beta1.StreamingSequence.Response responses = 3; + */ + public com.google.showcase.v1beta1.StreamingSequence.Response getResponses(int index) { + if (responsesBuilder_ == null) { + return responses_.get(index); + } else { + return responsesBuilder_.getMessage(index); + } + } + + /** + * + * + *
        +     * Sequence of responses to return in order for each attempt. If empty, the
        +     * default response is an immediate OK.
        +     * 
        + * + * repeated .google.showcase.v1beta1.StreamingSequence.Response responses = 3; + */ + public Builder setResponses( + int index, com.google.showcase.v1beta1.StreamingSequence.Response value) { + if (responsesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureResponsesIsMutable(); + responses_.set(index, value); + onChanged(); + } else { + responsesBuilder_.setMessage(index, value); + } + return this; + } + + /** + * + * + *
        +     * Sequence of responses to return in order for each attempt. If empty, the
        +     * default response is an immediate OK.
        +     * 
        + * + * repeated .google.showcase.v1beta1.StreamingSequence.Response responses = 3; + */ + public Builder setResponses( + int index, com.google.showcase.v1beta1.StreamingSequence.Response.Builder builderForValue) { + if (responsesBuilder_ == null) { + ensureResponsesIsMutable(); + responses_.set(index, builderForValue.build()); + onChanged(); + } else { + responsesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
        +     * Sequence of responses to return in order for each attempt. If empty, the
        +     * default response is an immediate OK.
        +     * 
        + * + * repeated .google.showcase.v1beta1.StreamingSequence.Response responses = 3; + */ + public Builder addResponses(com.google.showcase.v1beta1.StreamingSequence.Response value) { + if (responsesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureResponsesIsMutable(); + responses_.add(value); + onChanged(); + } else { + responsesBuilder_.addMessage(value); + } + return this; + } + + /** + * + * + *
        +     * Sequence of responses to return in order for each attempt. If empty, the
        +     * default response is an immediate OK.
        +     * 
        + * + * repeated .google.showcase.v1beta1.StreamingSequence.Response responses = 3; + */ + public Builder addResponses( + int index, com.google.showcase.v1beta1.StreamingSequence.Response value) { + if (responsesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureResponsesIsMutable(); + responses_.add(index, value); + onChanged(); + } else { + responsesBuilder_.addMessage(index, value); + } + return this; + } + + /** + * + * + *
        +     * Sequence of responses to return in order for each attempt. If empty, the
        +     * default response is an immediate OK.
        +     * 
        + * + * repeated .google.showcase.v1beta1.StreamingSequence.Response responses = 3; + */ + public Builder addResponses( + com.google.showcase.v1beta1.StreamingSequence.Response.Builder builderForValue) { + if (responsesBuilder_ == null) { + ensureResponsesIsMutable(); + responses_.add(builderForValue.build()); + onChanged(); + } else { + responsesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + + /** + * + * + *
        +     * Sequence of responses to return in order for each attempt. If empty, the
        +     * default response is an immediate OK.
        +     * 
        + * + * repeated .google.showcase.v1beta1.StreamingSequence.Response responses = 3; + */ + public Builder addResponses( + int index, com.google.showcase.v1beta1.StreamingSequence.Response.Builder builderForValue) { + if (responsesBuilder_ == null) { + ensureResponsesIsMutable(); + responses_.add(index, builderForValue.build()); + onChanged(); + } else { + responsesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
        +     * Sequence of responses to return in order for each attempt. If empty, the
        +     * default response is an immediate OK.
        +     * 
        + * + * repeated .google.showcase.v1beta1.StreamingSequence.Response responses = 3; + */ + public Builder addAllResponses( + java.lang.Iterable + values) { + if (responsesBuilder_ == null) { + ensureResponsesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, responses_); + onChanged(); + } else { + responsesBuilder_.addAllMessages(values); + } + return this; + } + + /** + * + * + *
        +     * Sequence of responses to return in order for each attempt. If empty, the
        +     * default response is an immediate OK.
        +     * 
        + * + * repeated .google.showcase.v1beta1.StreamingSequence.Response responses = 3; + */ + public Builder clearResponses() { + if (responsesBuilder_ == null) { + responses_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + } else { + responsesBuilder_.clear(); + } + return this; + } + + /** + * + * + *
        +     * Sequence of responses to return in order for each attempt. If empty, the
        +     * default response is an immediate OK.
        +     * 
        + * + * repeated .google.showcase.v1beta1.StreamingSequence.Response responses = 3; + */ + public Builder removeResponses(int index) { + if (responsesBuilder_ == null) { + ensureResponsesIsMutable(); + responses_.remove(index); + onChanged(); + } else { + responsesBuilder_.remove(index); + } + return this; + } + + /** + * + * + *
        +     * Sequence of responses to return in order for each attempt. If empty, the
        +     * default response is an immediate OK.
        +     * 
        + * + * repeated .google.showcase.v1beta1.StreamingSequence.Response responses = 3; + */ + public com.google.showcase.v1beta1.StreamingSequence.Response.Builder getResponsesBuilder( + int index) { + return internalGetResponsesFieldBuilder().getBuilder(index); + } + + /** + * + * + *
        +     * Sequence of responses to return in order for each attempt. If empty, the
        +     * default response is an immediate OK.
        +     * 
        + * + * repeated .google.showcase.v1beta1.StreamingSequence.Response responses = 3; + */ + public com.google.showcase.v1beta1.StreamingSequence.ResponseOrBuilder getResponsesOrBuilder( + int index) { + if (responsesBuilder_ == null) { + return responses_.get(index); + } else { + return responsesBuilder_.getMessageOrBuilder(index); + } + } + + /** + * + * + *
        +     * Sequence of responses to return in order for each attempt. If empty, the
        +     * default response is an immediate OK.
        +     * 
        + * + * repeated .google.showcase.v1beta1.StreamingSequence.Response responses = 3; + */ + public java.util.List + getResponsesOrBuilderList() { + if (responsesBuilder_ != null) { + return responsesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(responses_); + } + } + + /** + * + * + *
        +     * Sequence of responses to return in order for each attempt. If empty, the
        +     * default response is an immediate OK.
        +     * 
        + * + * repeated .google.showcase.v1beta1.StreamingSequence.Response responses = 3; + */ + public com.google.showcase.v1beta1.StreamingSequence.Response.Builder addResponsesBuilder() { + return internalGetResponsesFieldBuilder() + .addBuilder(com.google.showcase.v1beta1.StreamingSequence.Response.getDefaultInstance()); + } + + /** + * + * + *
        +     * Sequence of responses to return in order for each attempt. If empty, the
        +     * default response is an immediate OK.
        +     * 
        + * + * repeated .google.showcase.v1beta1.StreamingSequence.Response responses = 3; + */ + public com.google.showcase.v1beta1.StreamingSequence.Response.Builder addResponsesBuilder( + int index) { + return internalGetResponsesFieldBuilder() + .addBuilder( + index, com.google.showcase.v1beta1.StreamingSequence.Response.getDefaultInstance()); + } + + /** + * + * + *
        +     * Sequence of responses to return in order for each attempt. If empty, the
        +     * default response is an immediate OK.
        +     * 
        + * + * repeated .google.showcase.v1beta1.StreamingSequence.Response responses = 3; + */ + public java.util.List + getResponsesBuilderList() { + return internalGetResponsesFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.google.showcase.v1beta1.StreamingSequence.Response, + com.google.showcase.v1beta1.StreamingSequence.Response.Builder, + com.google.showcase.v1beta1.StreamingSequence.ResponseOrBuilder> + internalGetResponsesFieldBuilder() { + if (responsesBuilder_ == null) { + responsesBuilder_ = + new com.google.protobuf.RepeatedFieldBuilder< + com.google.showcase.v1beta1.StreamingSequence.Response, + com.google.showcase.v1beta1.StreamingSequence.Response.Builder, + com.google.showcase.v1beta1.StreamingSequence.ResponseOrBuilder>( + responses_, ((bitField0_ & 0x00000004) != 0), getParentForChildren(), isClean()); + responses_ = null; + } + return responsesBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.showcase.v1beta1.StreamingSequence) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.StreamingSequence) + private static final com.google.showcase.v1beta1.StreamingSequence DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.StreamingSequence(); + } + + public static com.google.showcase.v1beta1.StreamingSequence getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public StreamingSequence 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.showcase.v1beta1.StreamingSequence getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/StreamingSequenceName.java b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/StreamingSequenceName.java new file mode 100644 index 0000000000..bfced7876e --- /dev/null +++ b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/StreamingSequenceName.java @@ -0,0 +1,168 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1; + +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +@Generated("by gapic-generator-java") +public class StreamingSequenceName implements ResourceName { + private static final PathTemplate STREAMING_SEQUENCE = + PathTemplate.createWithoutUrlEncoding("streamingSequences/{streaming_sequence}"); + private volatile Map fieldValuesMap; + private final String streamingSequence; + + @Deprecated + protected StreamingSequenceName() { + streamingSequence = null; + } + + private StreamingSequenceName(Builder builder) { + streamingSequence = Preconditions.checkNotNull(builder.getStreamingSequence()); + } + + public String getStreamingSequence() { + return streamingSequence; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + public static StreamingSequenceName of(String streamingSequence) { + return newBuilder().setStreamingSequence(streamingSequence).build(); + } + + public static String format(String streamingSequence) { + return newBuilder().setStreamingSequence(streamingSequence).build().toString(); + } + + public static StreamingSequenceName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + STREAMING_SEQUENCE.validatedMatch( + formattedString, "StreamingSequenceName.parse: formattedString not in valid format"); + return of(matchMap.get("streaming_sequence")); + } + + 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 (StreamingSequenceName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return STREAMING_SEQUENCE.matches(formattedString); + } + + @Override + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + if (streamingSequence != null) { + fieldMapBuilder.put("streaming_sequence", streamingSequence); + } + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return STREAMING_SEQUENCE.instantiate("streaming_sequence", streamingSequence); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o != null && getClass() == o.getClass()) { + StreamingSequenceName that = ((StreamingSequenceName) o); + return Objects.equals(this.streamingSequence, that.streamingSequence); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= Objects.hashCode(streamingSequence); + return h; + } + + /** Builder for streamingSequences/{streaming_sequence}. */ + public static class Builder { + private String streamingSequence; + + protected Builder() {} + + public String getStreamingSequence() { + return streamingSequence; + } + + public Builder setStreamingSequence(String streamingSequence) { + this.streamingSequence = streamingSequence; + return this; + } + + private Builder(StreamingSequenceName streamingSequenceName) { + this.streamingSequence = streamingSequenceName.streamingSequence; + } + + public StreamingSequenceName build() { + return new StreamingSequenceName(this); + } + } +} diff --git a/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/StreamingSequenceOrBuilder.java b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/StreamingSequenceOrBuilder.java new file mode 100644 index 0000000000..f743a4087c --- /dev/null +++ b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/StreamingSequenceOrBuilder.java @@ -0,0 +1,129 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: schema/google/showcase/v1beta1/sequence.proto +// Protobuf Java Version: 4.33.2 + +package com.google.showcase.v1beta1; + +@com.google.protobuf.Generated +public interface StreamingSequenceOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.StreamingSequence) + com.google.protobuf.MessageOrBuilder { + + /** + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The name. + */ + java.lang.String getName(); + + /** + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
        +   * The Content that the stream will send
        +   * 
        + * + * string content = 2; + * + * @return The content. + */ + java.lang.String getContent(); + + /** + * + * + *
        +   * The Content that the stream will send
        +   * 
        + * + * string content = 2; + * + * @return The bytes for content. + */ + com.google.protobuf.ByteString getContentBytes(); + + /** + * + * + *
        +   * Sequence of responses to return in order for each attempt. If empty, the
        +   * default response is an immediate OK.
        +   * 
        + * + * repeated .google.showcase.v1beta1.StreamingSequence.Response responses = 3; + */ + java.util.List getResponsesList(); + + /** + * + * + *
        +   * Sequence of responses to return in order for each attempt. If empty, the
        +   * default response is an immediate OK.
        +   * 
        + * + * repeated .google.showcase.v1beta1.StreamingSequence.Response responses = 3; + */ + com.google.showcase.v1beta1.StreamingSequence.Response getResponses(int index); + + /** + * + * + *
        +   * Sequence of responses to return in order for each attempt. If empty, the
        +   * default response is an immediate OK.
        +   * 
        + * + * repeated .google.showcase.v1beta1.StreamingSequence.Response responses = 3; + */ + int getResponsesCount(); + + /** + * + * + *
        +   * Sequence of responses to return in order for each attempt. If empty, the
        +   * default response is an immediate OK.
        +   * 
        + * + * repeated .google.showcase.v1beta1.StreamingSequence.Response responses = 3; + */ + java.util.List + getResponsesOrBuilderList(); + + /** + * + * + *
        +   * Sequence of responses to return in order for each attempt. If empty, the
        +   * default response is an immediate OK.
        +   * 
        + * + * repeated .google.showcase.v1beta1.StreamingSequence.Response responses = 3; + */ + com.google.showcase.v1beta1.StreamingSequence.ResponseOrBuilder getResponsesOrBuilder(int index); +} diff --git a/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/StreamingSequenceReport.java b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/StreamingSequenceReport.java new file mode 100644 index 0000000000..4d14fafae1 --- /dev/null +++ b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/StreamingSequenceReport.java @@ -0,0 +1,2883 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: schema/google/showcase/v1beta1/sequence.proto +// Protobuf Java Version: 4.33.2 + +package com.google.showcase.v1beta1; + +/** Protobuf type {@code google.showcase.v1beta1.StreamingSequenceReport} */ +@com.google.protobuf.Generated +public final class StreamingSequenceReport extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.StreamingSequenceReport) + StreamingSequenceReportOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "StreamingSequenceReport"); + } + + // Use StreamingSequenceReport.newBuilder() to construct. + private StreamingSequenceReport(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private StreamingSequenceReport() { + name_ = ""; + attempts_ = java.util.Collections.emptyList(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.SequenceOuterClass + .internal_static_google_showcase_v1beta1_StreamingSequenceReport_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.SequenceOuterClass + .internal_static_google_showcase_v1beta1_StreamingSequenceReport_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.StreamingSequenceReport.class, + com.google.showcase.v1beta1.StreamingSequenceReport.Builder.class); + } + + public interface AttemptOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.StreamingSequenceReport.Attempt) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
        +     * The attempt number - starting at 0.
        +     * 
        + * + * int32 attempt_number = 1; + * + * @return The attemptNumber. + */ + int getAttemptNumber(); + + /** + * + * + *
        +     * The deadline dictated by the attempt to the server.
        +     * 
        + * + * .google.protobuf.Timestamp attempt_deadline = 2; + * + * @return Whether the attemptDeadline field is set. + */ + boolean hasAttemptDeadline(); + + /** + * + * + *
        +     * The deadline dictated by the attempt to the server.
        +     * 
        + * + * .google.protobuf.Timestamp attempt_deadline = 2; + * + * @return The attemptDeadline. + */ + com.google.protobuf.Timestamp getAttemptDeadline(); + + /** + * + * + *
        +     * The deadline dictated by the attempt to the server.
        +     * 
        + * + * .google.protobuf.Timestamp attempt_deadline = 2; + */ + com.google.protobuf.TimestampOrBuilder getAttemptDeadlineOrBuilder(); + + /** + * + * + *
        +     * The time that the server responded to the RPC attempt. Used for
        +     * calculating attempt_delay.
        +     * 
        + * + * .google.protobuf.Timestamp response_time = 3; + * + * @return Whether the responseTime field is set. + */ + boolean hasResponseTime(); + + /** + * + * + *
        +     * The time that the server responded to the RPC attempt. Used for
        +     * calculating attempt_delay.
        +     * 
        + * + * .google.protobuf.Timestamp response_time = 3; + * + * @return The responseTime. + */ + com.google.protobuf.Timestamp getResponseTime(); + + /** + * + * + *
        +     * The time that the server responded to the RPC attempt. Used for
        +     * calculating attempt_delay.
        +     * 
        + * + * .google.protobuf.Timestamp response_time = 3; + */ + com.google.protobuf.TimestampOrBuilder getResponseTimeOrBuilder(); + + /** + * + * + *
        +     * The server perceived delay between sending the last response and
        +     * receiving this attempt. Used for validating attempt delay backoff.
        +     * 
        + * + * .google.protobuf.Duration attempt_delay = 4; + * + * @return Whether the attemptDelay field is set. + */ + boolean hasAttemptDelay(); + + /** + * + * + *
        +     * The server perceived delay between sending the last response and
        +     * receiving this attempt. Used for validating attempt delay backoff.
        +     * 
        + * + * .google.protobuf.Duration attempt_delay = 4; + * + * @return The attemptDelay. + */ + com.google.protobuf.Duration getAttemptDelay(); + + /** + * + * + *
        +     * The server perceived delay between sending the last response and
        +     * receiving this attempt. Used for validating attempt delay backoff.
        +     * 
        + * + * .google.protobuf.Duration attempt_delay = 4; + */ + com.google.protobuf.DurationOrBuilder getAttemptDelayOrBuilder(); + + /** + * + * + *
        +     * The status returned to the attempt.
        +     * 
        + * + * .google.rpc.Status status = 5; + * + * @return Whether the status field is set. + */ + boolean hasStatus(); + + /** + * + * + *
        +     * The status returned to the attempt.
        +     * 
        + * + * .google.rpc.Status status = 5; + * + * @return The status. + */ + com.google.rpc.Status getStatus(); + + /** + * + * + *
        +     * The status returned to the attempt.
        +     * 
        + * + * .google.rpc.Status status = 5; + */ + com.google.rpc.StatusOrBuilder getStatusOrBuilder(); + } + + /** + * + * + *
        +   * Contains metrics on individual RPC Attempts in a sequence.
        +   * 
        + * + * Protobuf type {@code google.showcase.v1beta1.StreamingSequenceReport.Attempt} + */ + public static final class Attempt extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.StreamingSequenceReport.Attempt) + AttemptOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "Attempt"); + } + + // Use Attempt.newBuilder() to construct. + private Attempt(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private Attempt() {} + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.SequenceOuterClass + .internal_static_google_showcase_v1beta1_StreamingSequenceReport_Attempt_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.SequenceOuterClass + .internal_static_google_showcase_v1beta1_StreamingSequenceReport_Attempt_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.StreamingSequenceReport.Attempt.class, + com.google.showcase.v1beta1.StreamingSequenceReport.Attempt.Builder.class); + } + + private int bitField0_; + public static final int ATTEMPT_NUMBER_FIELD_NUMBER = 1; + private int attemptNumber_ = 0; + + /** + * + * + *
        +     * The attempt number - starting at 0.
        +     * 
        + * + * int32 attempt_number = 1; + * + * @return The attemptNumber. + */ + @java.lang.Override + public int getAttemptNumber() { + return attemptNumber_; + } + + public static final int ATTEMPT_DEADLINE_FIELD_NUMBER = 2; + private com.google.protobuf.Timestamp attemptDeadline_; + + /** + * + * + *
        +     * The deadline dictated by the attempt to the server.
        +     * 
        + * + * .google.protobuf.Timestamp attempt_deadline = 2; + * + * @return Whether the attemptDeadline field is set. + */ + @java.lang.Override + public boolean hasAttemptDeadline() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
        +     * The deadline dictated by the attempt to the server.
        +     * 
        + * + * .google.protobuf.Timestamp attempt_deadline = 2; + * + * @return The attemptDeadline. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getAttemptDeadline() { + return attemptDeadline_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : attemptDeadline_; + } + + /** + * + * + *
        +     * The deadline dictated by the attempt to the server.
        +     * 
        + * + * .google.protobuf.Timestamp attempt_deadline = 2; + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getAttemptDeadlineOrBuilder() { + return attemptDeadline_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : attemptDeadline_; + } + + public static final int RESPONSE_TIME_FIELD_NUMBER = 3; + private com.google.protobuf.Timestamp responseTime_; + + /** + * + * + *
        +     * The time that the server responded to the RPC attempt. Used for
        +     * calculating attempt_delay.
        +     * 
        + * + * .google.protobuf.Timestamp response_time = 3; + * + * @return Whether the responseTime field is set. + */ + @java.lang.Override + public boolean hasResponseTime() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
        +     * The time that the server responded to the RPC attempt. Used for
        +     * calculating attempt_delay.
        +     * 
        + * + * .google.protobuf.Timestamp response_time = 3; + * + * @return The responseTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getResponseTime() { + return responseTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : responseTime_; + } + + /** + * + * + *
        +     * The time that the server responded to the RPC attempt. Used for
        +     * calculating attempt_delay.
        +     * 
        + * + * .google.protobuf.Timestamp response_time = 3; + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getResponseTimeOrBuilder() { + return responseTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : responseTime_; + } + + public static final int ATTEMPT_DELAY_FIELD_NUMBER = 4; + private com.google.protobuf.Duration attemptDelay_; + + /** + * + * + *
        +     * The server perceived delay between sending the last response and
        +     * receiving this attempt. Used for validating attempt delay backoff.
        +     * 
        + * + * .google.protobuf.Duration attempt_delay = 4; + * + * @return Whether the attemptDelay field is set. + */ + @java.lang.Override + public boolean hasAttemptDelay() { + return ((bitField0_ & 0x00000004) != 0); + } + + /** + * + * + *
        +     * The server perceived delay between sending the last response and
        +     * receiving this attempt. Used for validating attempt delay backoff.
        +     * 
        + * + * .google.protobuf.Duration attempt_delay = 4; + * + * @return The attemptDelay. + */ + @java.lang.Override + public com.google.protobuf.Duration getAttemptDelay() { + return attemptDelay_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : attemptDelay_; + } + + /** + * + * + *
        +     * The server perceived delay between sending the last response and
        +     * receiving this attempt. Used for validating attempt delay backoff.
        +     * 
        + * + * .google.protobuf.Duration attempt_delay = 4; + */ + @java.lang.Override + public com.google.protobuf.DurationOrBuilder getAttemptDelayOrBuilder() { + return attemptDelay_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : attemptDelay_; + } + + public static final int STATUS_FIELD_NUMBER = 5; + private com.google.rpc.Status status_; + + /** + * + * + *
        +     * The status returned to the attempt.
        +     * 
        + * + * .google.rpc.Status status = 5; + * + * @return Whether the status field is set. + */ + @java.lang.Override + public boolean hasStatus() { + return ((bitField0_ & 0x00000008) != 0); + } + + /** + * + * + *
        +     * The status returned to the attempt.
        +     * 
        + * + * .google.rpc.Status status = 5; + * + * @return The status. + */ + @java.lang.Override + public com.google.rpc.Status getStatus() { + return status_ == null ? com.google.rpc.Status.getDefaultInstance() : status_; + } + + /** + * + * + *
        +     * The status returned to the attempt.
        +     * 
        + * + * .google.rpc.Status status = 5; + */ + @java.lang.Override + public com.google.rpc.StatusOrBuilder getStatusOrBuilder() { + return status_ == null ? com.google.rpc.Status.getDefaultInstance() : status_; + } + + 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 (attemptNumber_ != 0) { + output.writeInt32(1, attemptNumber_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(2, getAttemptDeadline()); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeMessage(3, getResponseTime()); + } + if (((bitField0_ & 0x00000004) != 0)) { + output.writeMessage(4, getAttemptDelay()); + } + if (((bitField0_ & 0x00000008) != 0)) { + output.writeMessage(5, getStatus()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (attemptNumber_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(1, attemptNumber_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getAttemptDeadline()); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getResponseTime()); + } + if (((bitField0_ & 0x00000004) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, getAttemptDelay()); + } + if (((bitField0_ & 0x00000008) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(5, getStatus()); + } + 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.showcase.v1beta1.StreamingSequenceReport.Attempt)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.StreamingSequenceReport.Attempt other = + (com.google.showcase.v1beta1.StreamingSequenceReport.Attempt) obj; + + if (getAttemptNumber() != other.getAttemptNumber()) return false; + if (hasAttemptDeadline() != other.hasAttemptDeadline()) return false; + if (hasAttemptDeadline()) { + if (!getAttemptDeadline().equals(other.getAttemptDeadline())) return false; + } + if (hasResponseTime() != other.hasResponseTime()) return false; + if (hasResponseTime()) { + if (!getResponseTime().equals(other.getResponseTime())) return false; + } + if (hasAttemptDelay() != other.hasAttemptDelay()) return false; + if (hasAttemptDelay()) { + if (!getAttemptDelay().equals(other.getAttemptDelay())) return false; + } + if (hasStatus() != other.hasStatus()) return false; + if (hasStatus()) { + if (!getStatus().equals(other.getStatus())) 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) + ATTEMPT_NUMBER_FIELD_NUMBER; + hash = (53 * hash) + getAttemptNumber(); + if (hasAttemptDeadline()) { + hash = (37 * hash) + ATTEMPT_DEADLINE_FIELD_NUMBER; + hash = (53 * hash) + getAttemptDeadline().hashCode(); + } + if (hasResponseTime()) { + hash = (37 * hash) + RESPONSE_TIME_FIELD_NUMBER; + hash = (53 * hash) + getResponseTime().hashCode(); + } + if (hasAttemptDelay()) { + hash = (37 * hash) + ATTEMPT_DELAY_FIELD_NUMBER; + hash = (53 * hash) + getAttemptDelay().hashCode(); + } + if (hasStatus()) { + hash = (37 * hash) + STATUS_FIELD_NUMBER; + hash = (53 * hash) + getStatus().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.showcase.v1beta1.StreamingSequenceReport.Attempt parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.StreamingSequenceReport.Attempt parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.StreamingSequenceReport.Attempt parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.StreamingSequenceReport.Attempt 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.showcase.v1beta1.StreamingSequenceReport.Attempt parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.StreamingSequenceReport.Attempt parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.StreamingSequenceReport.Attempt parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.StreamingSequenceReport.Attempt parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.showcase.v1beta1.StreamingSequenceReport.Attempt parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.StreamingSequenceReport.Attempt parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.showcase.v1beta1.StreamingSequenceReport.Attempt parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.StreamingSequenceReport.Attempt parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.showcase.v1beta1.StreamingSequenceReport.Attempt 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
        +     * Contains metrics on individual RPC Attempts in a sequence.
        +     * 
        + * + * Protobuf type {@code google.showcase.v1beta1.StreamingSequenceReport.Attempt} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.StreamingSequenceReport.Attempt) + com.google.showcase.v1beta1.StreamingSequenceReport.AttemptOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.SequenceOuterClass + .internal_static_google_showcase_v1beta1_StreamingSequenceReport_Attempt_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.SequenceOuterClass + .internal_static_google_showcase_v1beta1_StreamingSequenceReport_Attempt_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.StreamingSequenceReport.Attempt.class, + com.google.showcase.v1beta1.StreamingSequenceReport.Attempt.Builder.class); + } + + // Construct using com.google.showcase.v1beta1.StreamingSequenceReport.Attempt.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetAttemptDeadlineFieldBuilder(); + internalGetResponseTimeFieldBuilder(); + internalGetAttemptDelayFieldBuilder(); + internalGetStatusFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + attemptNumber_ = 0; + attemptDeadline_ = null; + if (attemptDeadlineBuilder_ != null) { + attemptDeadlineBuilder_.dispose(); + attemptDeadlineBuilder_ = null; + } + responseTime_ = null; + if (responseTimeBuilder_ != null) { + responseTimeBuilder_.dispose(); + responseTimeBuilder_ = null; + } + attemptDelay_ = null; + if (attemptDelayBuilder_ != null) { + attemptDelayBuilder_.dispose(); + attemptDelayBuilder_ = null; + } + status_ = null; + if (statusBuilder_ != null) { + statusBuilder_.dispose(); + statusBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.showcase.v1beta1.SequenceOuterClass + .internal_static_google_showcase_v1beta1_StreamingSequenceReport_Attempt_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.StreamingSequenceReport.Attempt + getDefaultInstanceForType() { + return com.google.showcase.v1beta1.StreamingSequenceReport.Attempt.getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.StreamingSequenceReport.Attempt build() { + com.google.showcase.v1beta1.StreamingSequenceReport.Attempt result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.StreamingSequenceReport.Attempt buildPartial() { + com.google.showcase.v1beta1.StreamingSequenceReport.Attempt result = + new com.google.showcase.v1beta1.StreamingSequenceReport.Attempt(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.showcase.v1beta1.StreamingSequenceReport.Attempt result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.attemptNumber_ = attemptNumber_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.attemptDeadline_ = + attemptDeadlineBuilder_ == null ? attemptDeadline_ : attemptDeadlineBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.responseTime_ = + responseTimeBuilder_ == null ? responseTime_ : responseTimeBuilder_.build(); + to_bitField0_ |= 0x00000002; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.attemptDelay_ = + attemptDelayBuilder_ == null ? attemptDelay_ : attemptDelayBuilder_.build(); + to_bitField0_ |= 0x00000004; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.status_ = statusBuilder_ == null ? status_ : statusBuilder_.build(); + to_bitField0_ |= 0x00000008; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.showcase.v1beta1.StreamingSequenceReport.Attempt) { + return mergeFrom((com.google.showcase.v1beta1.StreamingSequenceReport.Attempt) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.showcase.v1beta1.StreamingSequenceReport.Attempt other) { + if (other + == com.google.showcase.v1beta1.StreamingSequenceReport.Attempt.getDefaultInstance()) + return this; + if (other.getAttemptNumber() != 0) { + setAttemptNumber(other.getAttemptNumber()); + } + if (other.hasAttemptDeadline()) { + mergeAttemptDeadline(other.getAttemptDeadline()); + } + if (other.hasResponseTime()) { + mergeResponseTime(other.getResponseTime()); + } + if (other.hasAttemptDelay()) { + mergeAttemptDelay(other.getAttemptDelay()); + } + if (other.hasStatus()) { + mergeStatus(other.getStatus()); + } + 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: + { + attemptNumber_ = input.readInt32(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 18: + { + input.readMessage( + internalGetAttemptDeadlineFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + input.readMessage( + internalGetResponseTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 34: + { + input.readMessage( + internalGetAttemptDelayFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000008; + break; + } // case 34 + case 42: + { + input.readMessage( + internalGetStatusFieldBuilder().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 int attemptNumber_; + + /** + * + * + *
        +       * The attempt number - starting at 0.
        +       * 
        + * + * int32 attempt_number = 1; + * + * @return The attemptNumber. + */ + @java.lang.Override + public int getAttemptNumber() { + return attemptNumber_; + } + + /** + * + * + *
        +       * The attempt number - starting at 0.
        +       * 
        + * + * int32 attempt_number = 1; + * + * @param value The attemptNumber to set. + * @return This builder for chaining. + */ + public Builder setAttemptNumber(int value) { + + attemptNumber_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
        +       * The attempt number - starting at 0.
        +       * 
        + * + * int32 attempt_number = 1; + * + * @return This builder for chaining. + */ + public Builder clearAttemptNumber() { + bitField0_ = (bitField0_ & ~0x00000001); + attemptNumber_ = 0; + onChanged(); + return this; + } + + private com.google.protobuf.Timestamp attemptDeadline_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + attemptDeadlineBuilder_; + + /** + * + * + *
        +       * The deadline dictated by the attempt to the server.
        +       * 
        + * + * .google.protobuf.Timestamp attempt_deadline = 2; + * + * @return Whether the attemptDeadline field is set. + */ + public boolean hasAttemptDeadline() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
        +       * The deadline dictated by the attempt to the server.
        +       * 
        + * + * .google.protobuf.Timestamp attempt_deadline = 2; + * + * @return The attemptDeadline. + */ + public com.google.protobuf.Timestamp getAttemptDeadline() { + if (attemptDeadlineBuilder_ == null) { + return attemptDeadline_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : attemptDeadline_; + } else { + return attemptDeadlineBuilder_.getMessage(); + } + } + + /** + * + * + *
        +       * The deadline dictated by the attempt to the server.
        +       * 
        + * + * .google.protobuf.Timestamp attempt_deadline = 2; + */ + public Builder setAttemptDeadline(com.google.protobuf.Timestamp value) { + if (attemptDeadlineBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + attemptDeadline_ = value; + } else { + attemptDeadlineBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
        +       * The deadline dictated by the attempt to the server.
        +       * 
        + * + * .google.protobuf.Timestamp attempt_deadline = 2; + */ + public Builder setAttemptDeadline(com.google.protobuf.Timestamp.Builder builderForValue) { + if (attemptDeadlineBuilder_ == null) { + attemptDeadline_ = builderForValue.build(); + } else { + attemptDeadlineBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
        +       * The deadline dictated by the attempt to the server.
        +       * 
        + * + * .google.protobuf.Timestamp attempt_deadline = 2; + */ + public Builder mergeAttemptDeadline(com.google.protobuf.Timestamp value) { + if (attemptDeadlineBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && attemptDeadline_ != null + && attemptDeadline_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getAttemptDeadlineBuilder().mergeFrom(value); + } else { + attemptDeadline_ = value; + } + } else { + attemptDeadlineBuilder_.mergeFrom(value); + } + if (attemptDeadline_ != null) { + bitField0_ |= 0x00000002; + onChanged(); + } + return this; + } + + /** + * + * + *
        +       * The deadline dictated by the attempt to the server.
        +       * 
        + * + * .google.protobuf.Timestamp attempt_deadline = 2; + */ + public Builder clearAttemptDeadline() { + bitField0_ = (bitField0_ & ~0x00000002); + attemptDeadline_ = null; + if (attemptDeadlineBuilder_ != null) { + attemptDeadlineBuilder_.dispose(); + attemptDeadlineBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
        +       * The deadline dictated by the attempt to the server.
        +       * 
        + * + * .google.protobuf.Timestamp attempt_deadline = 2; + */ + public com.google.protobuf.Timestamp.Builder getAttemptDeadlineBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return internalGetAttemptDeadlineFieldBuilder().getBuilder(); + } + + /** + * + * + *
        +       * The deadline dictated by the attempt to the server.
        +       * 
        + * + * .google.protobuf.Timestamp attempt_deadline = 2; + */ + public com.google.protobuf.TimestampOrBuilder getAttemptDeadlineOrBuilder() { + if (attemptDeadlineBuilder_ != null) { + return attemptDeadlineBuilder_.getMessageOrBuilder(); + } else { + return attemptDeadline_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : attemptDeadline_; + } + } + + /** + * + * + *
        +       * The deadline dictated by the attempt to the server.
        +       * 
        + * + * .google.protobuf.Timestamp attempt_deadline = 2; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + internalGetAttemptDeadlineFieldBuilder() { + if (attemptDeadlineBuilder_ == null) { + attemptDeadlineBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getAttemptDeadline(), getParentForChildren(), isClean()); + attemptDeadline_ = null; + } + return attemptDeadlineBuilder_; + } + + private com.google.protobuf.Timestamp responseTime_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + responseTimeBuilder_; + + /** + * + * + *
        +       * The time that the server responded to the RPC attempt. Used for
        +       * calculating attempt_delay.
        +       * 
        + * + * .google.protobuf.Timestamp response_time = 3; + * + * @return Whether the responseTime field is set. + */ + public boolean hasResponseTime() { + return ((bitField0_ & 0x00000004) != 0); + } + + /** + * + * + *
        +       * The time that the server responded to the RPC attempt. Used for
        +       * calculating attempt_delay.
        +       * 
        + * + * .google.protobuf.Timestamp response_time = 3; + * + * @return The responseTime. + */ + public com.google.protobuf.Timestamp getResponseTime() { + if (responseTimeBuilder_ == null) { + return responseTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : responseTime_; + } else { + return responseTimeBuilder_.getMessage(); + } + } + + /** + * + * + *
        +       * The time that the server responded to the RPC attempt. Used for
        +       * calculating attempt_delay.
        +       * 
        + * + * .google.protobuf.Timestamp response_time = 3; + */ + public Builder setResponseTime(com.google.protobuf.Timestamp value) { + if (responseTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + responseTime_ = value; + } else { + responseTimeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
        +       * The time that the server responded to the RPC attempt. Used for
        +       * calculating attempt_delay.
        +       * 
        + * + * .google.protobuf.Timestamp response_time = 3; + */ + public Builder setResponseTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (responseTimeBuilder_ == null) { + responseTime_ = builderForValue.build(); + } else { + responseTimeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
        +       * The time that the server responded to the RPC attempt. Used for
        +       * calculating attempt_delay.
        +       * 
        + * + * .google.protobuf.Timestamp response_time = 3; + */ + public Builder mergeResponseTime(com.google.protobuf.Timestamp value) { + if (responseTimeBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0) + && responseTime_ != null + && responseTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getResponseTimeBuilder().mergeFrom(value); + } else { + responseTime_ = value; + } + } else { + responseTimeBuilder_.mergeFrom(value); + } + if (responseTime_ != null) { + bitField0_ |= 0x00000004; + onChanged(); + } + return this; + } + + /** + * + * + *
        +       * The time that the server responded to the RPC attempt. Used for
        +       * calculating attempt_delay.
        +       * 
        + * + * .google.protobuf.Timestamp response_time = 3; + */ + public Builder clearResponseTime() { + bitField0_ = (bitField0_ & ~0x00000004); + responseTime_ = null; + if (responseTimeBuilder_ != null) { + responseTimeBuilder_.dispose(); + responseTimeBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
        +       * The time that the server responded to the RPC attempt. Used for
        +       * calculating attempt_delay.
        +       * 
        + * + * .google.protobuf.Timestamp response_time = 3; + */ + public com.google.protobuf.Timestamp.Builder getResponseTimeBuilder() { + bitField0_ |= 0x00000004; + onChanged(); + return internalGetResponseTimeFieldBuilder().getBuilder(); + } + + /** + * + * + *
        +       * The time that the server responded to the RPC attempt. Used for
        +       * calculating attempt_delay.
        +       * 
        + * + * .google.protobuf.Timestamp response_time = 3; + */ + public com.google.protobuf.TimestampOrBuilder getResponseTimeOrBuilder() { + if (responseTimeBuilder_ != null) { + return responseTimeBuilder_.getMessageOrBuilder(); + } else { + return responseTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : responseTime_; + } + } + + /** + * + * + *
        +       * The time that the server responded to the RPC attempt. Used for
        +       * calculating attempt_delay.
        +       * 
        + * + * .google.protobuf.Timestamp response_time = 3; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + internalGetResponseTimeFieldBuilder() { + if (responseTimeBuilder_ == null) { + responseTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getResponseTime(), getParentForChildren(), isClean()); + responseTime_ = null; + } + return responseTimeBuilder_; + } + + private com.google.protobuf.Duration attemptDelay_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder> + attemptDelayBuilder_; + + /** + * + * + *
        +       * The server perceived delay between sending the last response and
        +       * receiving this attempt. Used for validating attempt delay backoff.
        +       * 
        + * + * .google.protobuf.Duration attempt_delay = 4; + * + * @return Whether the attemptDelay field is set. + */ + public boolean hasAttemptDelay() { + return ((bitField0_ & 0x00000008) != 0); + } + + /** + * + * + *
        +       * The server perceived delay between sending the last response and
        +       * receiving this attempt. Used for validating attempt delay backoff.
        +       * 
        + * + * .google.protobuf.Duration attempt_delay = 4; + * + * @return The attemptDelay. + */ + public com.google.protobuf.Duration getAttemptDelay() { + if (attemptDelayBuilder_ == null) { + return attemptDelay_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : attemptDelay_; + } else { + return attemptDelayBuilder_.getMessage(); + } + } + + /** + * + * + *
        +       * The server perceived delay between sending the last response and
        +       * receiving this attempt. Used for validating attempt delay backoff.
        +       * 
        + * + * .google.protobuf.Duration attempt_delay = 4; + */ + public Builder setAttemptDelay(com.google.protobuf.Duration value) { + if (attemptDelayBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + attemptDelay_ = value; + } else { + attemptDelayBuilder_.setMessage(value); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + /** + * + * + *
        +       * The server perceived delay between sending the last response and
        +       * receiving this attempt. Used for validating attempt delay backoff.
        +       * 
        + * + * .google.protobuf.Duration attempt_delay = 4; + */ + public Builder setAttemptDelay(com.google.protobuf.Duration.Builder builderForValue) { + if (attemptDelayBuilder_ == null) { + attemptDelay_ = builderForValue.build(); + } else { + attemptDelayBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + /** + * + * + *
        +       * The server perceived delay between sending the last response and
        +       * receiving this attempt. Used for validating attempt delay backoff.
        +       * 
        + * + * .google.protobuf.Duration attempt_delay = 4; + */ + public Builder mergeAttemptDelay(com.google.protobuf.Duration value) { + if (attemptDelayBuilder_ == null) { + if (((bitField0_ & 0x00000008) != 0) + && attemptDelay_ != null + && attemptDelay_ != com.google.protobuf.Duration.getDefaultInstance()) { + getAttemptDelayBuilder().mergeFrom(value); + } else { + attemptDelay_ = value; + } + } else { + attemptDelayBuilder_.mergeFrom(value); + } + if (attemptDelay_ != null) { + bitField0_ |= 0x00000008; + onChanged(); + } + return this; + } + + /** + * + * + *
        +       * The server perceived delay between sending the last response and
        +       * receiving this attempt. Used for validating attempt delay backoff.
        +       * 
        + * + * .google.protobuf.Duration attempt_delay = 4; + */ + public Builder clearAttemptDelay() { + bitField0_ = (bitField0_ & ~0x00000008); + attemptDelay_ = null; + if (attemptDelayBuilder_ != null) { + attemptDelayBuilder_.dispose(); + attemptDelayBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
        +       * The server perceived delay between sending the last response and
        +       * receiving this attempt. Used for validating attempt delay backoff.
        +       * 
        + * + * .google.protobuf.Duration attempt_delay = 4; + */ + public com.google.protobuf.Duration.Builder getAttemptDelayBuilder() { + bitField0_ |= 0x00000008; + onChanged(); + return internalGetAttemptDelayFieldBuilder().getBuilder(); + } + + /** + * + * + *
        +       * The server perceived delay between sending the last response and
        +       * receiving this attempt. Used for validating attempt delay backoff.
        +       * 
        + * + * .google.protobuf.Duration attempt_delay = 4; + */ + public com.google.protobuf.DurationOrBuilder getAttemptDelayOrBuilder() { + if (attemptDelayBuilder_ != null) { + return attemptDelayBuilder_.getMessageOrBuilder(); + } else { + return attemptDelay_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : attemptDelay_; + } + } + + /** + * + * + *
        +       * The server perceived delay between sending the last response and
        +       * receiving this attempt. Used for validating attempt delay backoff.
        +       * 
        + * + * .google.protobuf.Duration attempt_delay = 4; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder> + internalGetAttemptDelayFieldBuilder() { + if (attemptDelayBuilder_ == null) { + attemptDelayBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder>( + getAttemptDelay(), getParentForChildren(), isClean()); + attemptDelay_ = null; + } + return attemptDelayBuilder_; + } + + private com.google.rpc.Status status_; + private com.google.protobuf.SingleFieldBuilder< + com.google.rpc.Status, com.google.rpc.Status.Builder, com.google.rpc.StatusOrBuilder> + statusBuilder_; + + /** + * + * + *
        +       * The status returned to the attempt.
        +       * 
        + * + * .google.rpc.Status status = 5; + * + * @return Whether the status field is set. + */ + public boolean hasStatus() { + return ((bitField0_ & 0x00000010) != 0); + } + + /** + * + * + *
        +       * The status returned to the attempt.
        +       * 
        + * + * .google.rpc.Status status = 5; + * + * @return The status. + */ + public com.google.rpc.Status getStatus() { + if (statusBuilder_ == null) { + return status_ == null ? com.google.rpc.Status.getDefaultInstance() : status_; + } else { + return statusBuilder_.getMessage(); + } + } + + /** + * + * + *
        +       * The status returned to the attempt.
        +       * 
        + * + * .google.rpc.Status status = 5; + */ + public Builder setStatus(com.google.rpc.Status value) { + if (statusBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + status_ = value; + } else { + statusBuilder_.setMessage(value); + } + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + /** + * + * + *
        +       * The status returned to the attempt.
        +       * 
        + * + * .google.rpc.Status status = 5; + */ + public Builder setStatus(com.google.rpc.Status.Builder builderForValue) { + if (statusBuilder_ == null) { + status_ = builderForValue.build(); + } else { + statusBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + /** + * + * + *
        +       * The status returned to the attempt.
        +       * 
        + * + * .google.rpc.Status status = 5; + */ + public Builder mergeStatus(com.google.rpc.Status value) { + if (statusBuilder_ == null) { + if (((bitField0_ & 0x00000010) != 0) + && status_ != null + && status_ != com.google.rpc.Status.getDefaultInstance()) { + getStatusBuilder().mergeFrom(value); + } else { + status_ = value; + } + } else { + statusBuilder_.mergeFrom(value); + } + if (status_ != null) { + bitField0_ |= 0x00000010; + onChanged(); + } + return this; + } + + /** + * + * + *
        +       * The status returned to the attempt.
        +       * 
        + * + * .google.rpc.Status status = 5; + */ + public Builder clearStatus() { + bitField0_ = (bitField0_ & ~0x00000010); + status_ = null; + if (statusBuilder_ != null) { + statusBuilder_.dispose(); + statusBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
        +       * The status returned to the attempt.
        +       * 
        + * + * .google.rpc.Status status = 5; + */ + public com.google.rpc.Status.Builder getStatusBuilder() { + bitField0_ |= 0x00000010; + onChanged(); + return internalGetStatusFieldBuilder().getBuilder(); + } + + /** + * + * + *
        +       * The status returned to the attempt.
        +       * 
        + * + * .google.rpc.Status status = 5; + */ + public com.google.rpc.StatusOrBuilder getStatusOrBuilder() { + if (statusBuilder_ != null) { + return statusBuilder_.getMessageOrBuilder(); + } else { + return status_ == null ? com.google.rpc.Status.getDefaultInstance() : status_; + } + } + + /** + * + * + *
        +       * The status returned to the attempt.
        +       * 
        + * + * .google.rpc.Status status = 5; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.rpc.Status, com.google.rpc.Status.Builder, com.google.rpc.StatusOrBuilder> + internalGetStatusFieldBuilder() { + if (statusBuilder_ == null) { + statusBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.rpc.Status, + com.google.rpc.Status.Builder, + com.google.rpc.StatusOrBuilder>(getStatus(), getParentForChildren(), isClean()); + status_ = null; + } + return statusBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.showcase.v1beta1.StreamingSequenceReport.Attempt) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.StreamingSequenceReport.Attempt) + private static final com.google.showcase.v1beta1.StreamingSequenceReport.Attempt + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.StreamingSequenceReport.Attempt(); + } + + public static com.google.showcase.v1beta1.StreamingSequenceReport.Attempt getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Attempt 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.showcase.v1beta1.StreamingSequenceReport.Attempt getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + + /** + * 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; + } + } + + /** + * 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 ATTEMPTS_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private java.util.List attempts_; + + /** + * + * + *
        +   * The set of RPC attempts received by the server for a Sequence.
        +   * 
        + * + * repeated .google.showcase.v1beta1.StreamingSequenceReport.Attempt attempts = 2; + */ + @java.lang.Override + public java.util.List + getAttemptsList() { + return attempts_; + } + + /** + * + * + *
        +   * The set of RPC attempts received by the server for a Sequence.
        +   * 
        + * + * repeated .google.showcase.v1beta1.StreamingSequenceReport.Attempt attempts = 2; + */ + @java.lang.Override + public java.util.List< + ? extends com.google.showcase.v1beta1.StreamingSequenceReport.AttemptOrBuilder> + getAttemptsOrBuilderList() { + return attempts_; + } + + /** + * + * + *
        +   * The set of RPC attempts received by the server for a Sequence.
        +   * 
        + * + * repeated .google.showcase.v1beta1.StreamingSequenceReport.Attempt attempts = 2; + */ + @java.lang.Override + public int getAttemptsCount() { + return attempts_.size(); + } + + /** + * + * + *
        +   * The set of RPC attempts received by the server for a Sequence.
        +   * 
        + * + * repeated .google.showcase.v1beta1.StreamingSequenceReport.Attempt attempts = 2; + */ + @java.lang.Override + public com.google.showcase.v1beta1.StreamingSequenceReport.Attempt getAttempts(int index) { + return attempts_.get(index); + } + + /** + * + * + *
        +   * The set of RPC attempts received by the server for a Sequence.
        +   * 
        + * + * repeated .google.showcase.v1beta1.StreamingSequenceReport.Attempt attempts = 2; + */ + @java.lang.Override + public com.google.showcase.v1beta1.StreamingSequenceReport.AttemptOrBuilder getAttemptsOrBuilder( + int index) { + return attempts_.get(index); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, name_); + } + for (int i = 0; i < attempts_.size(); i++) { + output.writeMessage(2, attempts_.get(i)); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, name_); + } + for (int i = 0; i < attempts_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, attempts_.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.showcase.v1beta1.StreamingSequenceReport)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.StreamingSequenceReport other = + (com.google.showcase.v1beta1.StreamingSequenceReport) obj; + + if (!getName().equals(other.getName())) return false; + if (!getAttemptsList().equals(other.getAttemptsList())) 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 (getAttemptsCount() > 0) { + hash = (37 * hash) + ATTEMPTS_FIELD_NUMBER; + hash = (53 * hash) + getAttemptsList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.showcase.v1beta1.StreamingSequenceReport parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.StreamingSequenceReport parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.StreamingSequenceReport parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.StreamingSequenceReport 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.showcase.v1beta1.StreamingSequenceReport parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.StreamingSequenceReport parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.StreamingSequenceReport parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.StreamingSequenceReport parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.showcase.v1beta1.StreamingSequenceReport parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.StreamingSequenceReport parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.showcase.v1beta1.StreamingSequenceReport parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.StreamingSequenceReport parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.showcase.v1beta1.StreamingSequenceReport 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** Protobuf type {@code google.showcase.v1beta1.StreamingSequenceReport} */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.StreamingSequenceReport) + com.google.showcase.v1beta1.StreamingSequenceReportOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.SequenceOuterClass + .internal_static_google_showcase_v1beta1_StreamingSequenceReport_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.SequenceOuterClass + .internal_static_google_showcase_v1beta1_StreamingSequenceReport_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.StreamingSequenceReport.class, + com.google.showcase.v1beta1.StreamingSequenceReport.Builder.class); + } + + // Construct using com.google.showcase.v1beta1.StreamingSequenceReport.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + if (attemptsBuilder_ == null) { + attempts_ = java.util.Collections.emptyList(); + } else { + attempts_ = null; + attemptsBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000002); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.showcase.v1beta1.SequenceOuterClass + .internal_static_google_showcase_v1beta1_StreamingSequenceReport_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.StreamingSequenceReport getDefaultInstanceForType() { + return com.google.showcase.v1beta1.StreamingSequenceReport.getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.StreamingSequenceReport build() { + com.google.showcase.v1beta1.StreamingSequenceReport result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.StreamingSequenceReport buildPartial() { + com.google.showcase.v1beta1.StreamingSequenceReport result = + new com.google.showcase.v1beta1.StreamingSequenceReport(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields( + com.google.showcase.v1beta1.StreamingSequenceReport result) { + if (attemptsBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0)) { + attempts_ = java.util.Collections.unmodifiableList(attempts_); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.attempts_ = attempts_; + } else { + result.attempts_ = attemptsBuilder_.build(); + } + } + + private void buildPartial0(com.google.showcase.v1beta1.StreamingSequenceReport result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.showcase.v1beta1.StreamingSequenceReport) { + return mergeFrom((com.google.showcase.v1beta1.StreamingSequenceReport) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.showcase.v1beta1.StreamingSequenceReport other) { + if (other == com.google.showcase.v1beta1.StreamingSequenceReport.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (attemptsBuilder_ == null) { + if (!other.attempts_.isEmpty()) { + if (attempts_.isEmpty()) { + attempts_ = other.attempts_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureAttemptsIsMutable(); + attempts_.addAll(other.attempts_); + } + onChanged(); + } + } else { + if (!other.attempts_.isEmpty()) { + if (attemptsBuilder_.isEmpty()) { + attemptsBuilder_.dispose(); + attemptsBuilder_ = null; + attempts_ = other.attempts_; + bitField0_ = (bitField0_ & ~0x00000002); + attemptsBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders + ? internalGetAttemptsFieldBuilder() + : null; + } else { + attemptsBuilder_.addAllMessages(other.attempts_); + } + } + } + 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: + { + com.google.showcase.v1beta1.StreamingSequenceReport.Attempt m = + input.readMessage( + com.google.showcase.v1beta1.StreamingSequenceReport.Attempt.parser(), + extensionRegistry); + if (attemptsBuilder_ == null) { + ensureAttemptsIsMutable(); + attempts_.add(m); + } else { + attemptsBuilder_.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.lang.Object name_ = ""; + + /** + * 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; + } + } + + /** + * 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; + } + } + + /** + * 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; + } + + /** + * 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; + } + + /** + * 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.util.List attempts_ = + java.util.Collections.emptyList(); + + private void ensureAttemptsIsMutable() { + if (!((bitField0_ & 0x00000002) != 0)) { + attempts_ = + new java.util.ArrayList( + attempts_); + bitField0_ |= 0x00000002; + } + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.google.showcase.v1beta1.StreamingSequenceReport.Attempt, + com.google.showcase.v1beta1.StreamingSequenceReport.Attempt.Builder, + com.google.showcase.v1beta1.StreamingSequenceReport.AttemptOrBuilder> + attemptsBuilder_; + + /** + * + * + *
        +     * The set of RPC attempts received by the server for a Sequence.
        +     * 
        + * + * repeated .google.showcase.v1beta1.StreamingSequenceReport.Attempt attempts = 2; + */ + public java.util.List + getAttemptsList() { + if (attemptsBuilder_ == null) { + return java.util.Collections.unmodifiableList(attempts_); + } else { + return attemptsBuilder_.getMessageList(); + } + } + + /** + * + * + *
        +     * The set of RPC attempts received by the server for a Sequence.
        +     * 
        + * + * repeated .google.showcase.v1beta1.StreamingSequenceReport.Attempt attempts = 2; + */ + public int getAttemptsCount() { + if (attemptsBuilder_ == null) { + return attempts_.size(); + } else { + return attemptsBuilder_.getCount(); + } + } + + /** + * + * + *
        +     * The set of RPC attempts received by the server for a Sequence.
        +     * 
        + * + * repeated .google.showcase.v1beta1.StreamingSequenceReport.Attempt attempts = 2; + */ + public com.google.showcase.v1beta1.StreamingSequenceReport.Attempt getAttempts(int index) { + if (attemptsBuilder_ == null) { + return attempts_.get(index); + } else { + return attemptsBuilder_.getMessage(index); + } + } + + /** + * + * + *
        +     * The set of RPC attempts received by the server for a Sequence.
        +     * 
        + * + * repeated .google.showcase.v1beta1.StreamingSequenceReport.Attempt attempts = 2; + */ + public Builder setAttempts( + int index, com.google.showcase.v1beta1.StreamingSequenceReport.Attempt value) { + if (attemptsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureAttemptsIsMutable(); + attempts_.set(index, value); + onChanged(); + } else { + attemptsBuilder_.setMessage(index, value); + } + return this; + } + + /** + * + * + *
        +     * The set of RPC attempts received by the server for a Sequence.
        +     * 
        + * + * repeated .google.showcase.v1beta1.StreamingSequenceReport.Attempt attempts = 2; + */ + public Builder setAttempts( + int index, + com.google.showcase.v1beta1.StreamingSequenceReport.Attempt.Builder builderForValue) { + if (attemptsBuilder_ == null) { + ensureAttemptsIsMutable(); + attempts_.set(index, builderForValue.build()); + onChanged(); + } else { + attemptsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
        +     * The set of RPC attempts received by the server for a Sequence.
        +     * 
        + * + * repeated .google.showcase.v1beta1.StreamingSequenceReport.Attempt attempts = 2; + */ + public Builder addAttempts(com.google.showcase.v1beta1.StreamingSequenceReport.Attempt value) { + if (attemptsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureAttemptsIsMutable(); + attempts_.add(value); + onChanged(); + } else { + attemptsBuilder_.addMessage(value); + } + return this; + } + + /** + * + * + *
        +     * The set of RPC attempts received by the server for a Sequence.
        +     * 
        + * + * repeated .google.showcase.v1beta1.StreamingSequenceReport.Attempt attempts = 2; + */ + public Builder addAttempts( + int index, com.google.showcase.v1beta1.StreamingSequenceReport.Attempt value) { + if (attemptsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureAttemptsIsMutable(); + attempts_.add(index, value); + onChanged(); + } else { + attemptsBuilder_.addMessage(index, value); + } + return this; + } + + /** + * + * + *
        +     * The set of RPC attempts received by the server for a Sequence.
        +     * 
        + * + * repeated .google.showcase.v1beta1.StreamingSequenceReport.Attempt attempts = 2; + */ + public Builder addAttempts( + com.google.showcase.v1beta1.StreamingSequenceReport.Attempt.Builder builderForValue) { + if (attemptsBuilder_ == null) { + ensureAttemptsIsMutable(); + attempts_.add(builderForValue.build()); + onChanged(); + } else { + attemptsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + + /** + * + * + *
        +     * The set of RPC attempts received by the server for a Sequence.
        +     * 
        + * + * repeated .google.showcase.v1beta1.StreamingSequenceReport.Attempt attempts = 2; + */ + public Builder addAttempts( + int index, + com.google.showcase.v1beta1.StreamingSequenceReport.Attempt.Builder builderForValue) { + if (attemptsBuilder_ == null) { + ensureAttemptsIsMutable(); + attempts_.add(index, builderForValue.build()); + onChanged(); + } else { + attemptsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
        +     * The set of RPC attempts received by the server for a Sequence.
        +     * 
        + * + * repeated .google.showcase.v1beta1.StreamingSequenceReport.Attempt attempts = 2; + */ + public Builder addAllAttempts( + java.lang.Iterable + values) { + if (attemptsBuilder_ == null) { + ensureAttemptsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, attempts_); + onChanged(); + } else { + attemptsBuilder_.addAllMessages(values); + } + return this; + } + + /** + * + * + *
        +     * The set of RPC attempts received by the server for a Sequence.
        +     * 
        + * + * repeated .google.showcase.v1beta1.StreamingSequenceReport.Attempt attempts = 2; + */ + public Builder clearAttempts() { + if (attemptsBuilder_ == null) { + attempts_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + } else { + attemptsBuilder_.clear(); + } + return this; + } + + /** + * + * + *
        +     * The set of RPC attempts received by the server for a Sequence.
        +     * 
        + * + * repeated .google.showcase.v1beta1.StreamingSequenceReport.Attempt attempts = 2; + */ + public Builder removeAttempts(int index) { + if (attemptsBuilder_ == null) { + ensureAttemptsIsMutable(); + attempts_.remove(index); + onChanged(); + } else { + attemptsBuilder_.remove(index); + } + return this; + } + + /** + * + * + *
        +     * The set of RPC attempts received by the server for a Sequence.
        +     * 
        + * + * repeated .google.showcase.v1beta1.StreamingSequenceReport.Attempt attempts = 2; + */ + public com.google.showcase.v1beta1.StreamingSequenceReport.Attempt.Builder getAttemptsBuilder( + int index) { + return internalGetAttemptsFieldBuilder().getBuilder(index); + } + + /** + * + * + *
        +     * The set of RPC attempts received by the server for a Sequence.
        +     * 
        + * + * repeated .google.showcase.v1beta1.StreamingSequenceReport.Attempt attempts = 2; + */ + public com.google.showcase.v1beta1.StreamingSequenceReport.AttemptOrBuilder + getAttemptsOrBuilder(int index) { + if (attemptsBuilder_ == null) { + return attempts_.get(index); + } else { + return attemptsBuilder_.getMessageOrBuilder(index); + } + } + + /** + * + * + *
        +     * The set of RPC attempts received by the server for a Sequence.
        +     * 
        + * + * repeated .google.showcase.v1beta1.StreamingSequenceReport.Attempt attempts = 2; + */ + public java.util.List< + ? extends com.google.showcase.v1beta1.StreamingSequenceReport.AttemptOrBuilder> + getAttemptsOrBuilderList() { + if (attemptsBuilder_ != null) { + return attemptsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(attempts_); + } + } + + /** + * + * + *
        +     * The set of RPC attempts received by the server for a Sequence.
        +     * 
        + * + * repeated .google.showcase.v1beta1.StreamingSequenceReport.Attempt attempts = 2; + */ + public com.google.showcase.v1beta1.StreamingSequenceReport.Attempt.Builder + addAttemptsBuilder() { + return internalGetAttemptsFieldBuilder() + .addBuilder( + com.google.showcase.v1beta1.StreamingSequenceReport.Attempt.getDefaultInstance()); + } + + /** + * + * + *
        +     * The set of RPC attempts received by the server for a Sequence.
        +     * 
        + * + * repeated .google.showcase.v1beta1.StreamingSequenceReport.Attempt attempts = 2; + */ + public com.google.showcase.v1beta1.StreamingSequenceReport.Attempt.Builder addAttemptsBuilder( + int index) { + return internalGetAttemptsFieldBuilder() + .addBuilder( + index, + com.google.showcase.v1beta1.StreamingSequenceReport.Attempt.getDefaultInstance()); + } + + /** + * + * + *
        +     * The set of RPC attempts received by the server for a Sequence.
        +     * 
        + * + * repeated .google.showcase.v1beta1.StreamingSequenceReport.Attempt attempts = 2; + */ + public java.util.List + getAttemptsBuilderList() { + return internalGetAttemptsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.google.showcase.v1beta1.StreamingSequenceReport.Attempt, + com.google.showcase.v1beta1.StreamingSequenceReport.Attempt.Builder, + com.google.showcase.v1beta1.StreamingSequenceReport.AttemptOrBuilder> + internalGetAttemptsFieldBuilder() { + if (attemptsBuilder_ == null) { + attemptsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilder< + com.google.showcase.v1beta1.StreamingSequenceReport.Attempt, + com.google.showcase.v1beta1.StreamingSequenceReport.Attempt.Builder, + com.google.showcase.v1beta1.StreamingSequenceReport.AttemptOrBuilder>( + attempts_, ((bitField0_ & 0x00000002) != 0), getParentForChildren(), isClean()); + attempts_ = null; + } + return attemptsBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.showcase.v1beta1.StreamingSequenceReport) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.StreamingSequenceReport) + private static final com.google.showcase.v1beta1.StreamingSequenceReport DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.StreamingSequenceReport(); + } + + public static com.google.showcase.v1beta1.StreamingSequenceReport getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public StreamingSequenceReport 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.showcase.v1beta1.StreamingSequenceReport getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/StreamingSequenceReportName.java b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/StreamingSequenceReportName.java new file mode 100644 index 0000000000..59f40f2c58 --- /dev/null +++ b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/StreamingSequenceReportName.java @@ -0,0 +1,170 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1; + +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +@Generated("by gapic-generator-java") +public class StreamingSequenceReportName implements ResourceName { + private static final PathTemplate STREAMING_SEQUENCE = + PathTemplate.createWithoutUrlEncoding( + "streamingSequences/{streaming_sequence}/streamingSequenceReport"); + private volatile Map fieldValuesMap; + private final String streamingSequence; + + @Deprecated + protected StreamingSequenceReportName() { + streamingSequence = null; + } + + private StreamingSequenceReportName(Builder builder) { + streamingSequence = Preconditions.checkNotNull(builder.getStreamingSequence()); + } + + public String getStreamingSequence() { + return streamingSequence; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + public static StreamingSequenceReportName of(String streamingSequence) { + return newBuilder().setStreamingSequence(streamingSequence).build(); + } + + public static String format(String streamingSequence) { + return newBuilder().setStreamingSequence(streamingSequence).build().toString(); + } + + public static StreamingSequenceReportName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + STREAMING_SEQUENCE.validatedMatch( + formattedString, + "StreamingSequenceReportName.parse: formattedString not in valid format"); + return of(matchMap.get("streaming_sequence")); + } + + 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 (StreamingSequenceReportName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return STREAMING_SEQUENCE.matches(formattedString); + } + + @Override + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + if (streamingSequence != null) { + fieldMapBuilder.put("streaming_sequence", streamingSequence); + } + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return STREAMING_SEQUENCE.instantiate("streaming_sequence", streamingSequence); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o != null && getClass() == o.getClass()) { + StreamingSequenceReportName that = ((StreamingSequenceReportName) o); + return Objects.equals(this.streamingSequence, that.streamingSequence); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= Objects.hashCode(streamingSequence); + return h; + } + + /** Builder for streamingSequences/{streaming_sequence}/streamingSequenceReport. */ + public static class Builder { + private String streamingSequence; + + protected Builder() {} + + public String getStreamingSequence() { + return streamingSequence; + } + + public Builder setStreamingSequence(String streamingSequence) { + this.streamingSequence = streamingSequence; + return this; + } + + private Builder(StreamingSequenceReportName streamingSequenceReportName) { + this.streamingSequence = streamingSequenceReportName.streamingSequence; + } + + public StreamingSequenceReportName build() { + return new StreamingSequenceReportName(this); + } + } +} diff --git a/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/StreamingSequenceReportOrBuilder.java b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/StreamingSequenceReportOrBuilder.java new file mode 100644 index 0000000000..31bc3f5e7d --- /dev/null +++ b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/StreamingSequenceReportOrBuilder.java @@ -0,0 +1,99 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: schema/google/showcase/v1beta1/sequence.proto +// Protobuf Java Version: 4.33.2 + +package com.google.showcase.v1beta1; + +@com.google.protobuf.Generated +public interface StreamingSequenceReportOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.StreamingSequenceReport) + com.google.protobuf.MessageOrBuilder { + + /** + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The name. + */ + java.lang.String getName(); + + /** + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
        +   * The set of RPC attempts received by the server for a Sequence.
        +   * 
        + * + * repeated .google.showcase.v1beta1.StreamingSequenceReport.Attempt attempts = 2; + */ + java.util.List getAttemptsList(); + + /** + * + * + *
        +   * The set of RPC attempts received by the server for a Sequence.
        +   * 
        + * + * repeated .google.showcase.v1beta1.StreamingSequenceReport.Attempt attempts = 2; + */ + com.google.showcase.v1beta1.StreamingSequenceReport.Attempt getAttempts(int index); + + /** + * + * + *
        +   * The set of RPC attempts received by the server for a Sequence.
        +   * 
        + * + * repeated .google.showcase.v1beta1.StreamingSequenceReport.Attempt attempts = 2; + */ + int getAttemptsCount(); + + /** + * + * + *
        +   * The set of RPC attempts received by the server for a Sequence.
        +   * 
        + * + * repeated .google.showcase.v1beta1.StreamingSequenceReport.Attempt attempts = 2; + */ + java.util.List + getAttemptsOrBuilderList(); + + /** + * + * + *
        +   * The set of RPC attempts received by the server for a Sequence.
        +   * 
        + * + * repeated .google.showcase.v1beta1.StreamingSequenceReport.Attempt attempts = 2; + */ + com.google.showcase.v1beta1.StreamingSequenceReport.AttemptOrBuilder getAttemptsOrBuilder( + int index); +} diff --git a/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/Test.java b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/Test.java new file mode 100644 index 0000000000..e1f2e858c9 --- /dev/null +++ b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/Test.java @@ -0,0 +1,4237 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: schema/google/showcase/v1beta1/testing.proto +// Protobuf Java Version: 4.33.2 + +package com.google.showcase.v1beta1; + +/** Protobuf type {@code google.showcase.v1beta1.Test} */ +@com.google.protobuf.Generated +public final class Test extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.Test) + TestOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "Test"); + } + + // Use Test.newBuilder() to construct. + private Test(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private Test() { + name_ = ""; + expectationLevel_ = 0; + description_ = ""; + blueprints_ = java.util.Collections.emptyList(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.TestingOuterClass + .internal_static_google_showcase_v1beta1_Test_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.TestingOuterClass + .internal_static_google_showcase_v1beta1_Test_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.Test.class, com.google.showcase.v1beta1.Test.Builder.class); + } + + /** + * + * + *
        +   * Whether or not a test is required, recommended, or optional.
        +   * 
        + * + * Protobuf enum {@code google.showcase.v1beta1.Test.ExpectationLevel} + */ + public enum ExpectationLevel implements com.google.protobuf.ProtocolMessageEnum { + /** EXPECTATION_LEVEL_UNSPECIFIED = 0; */ + EXPECTATION_LEVEL_UNSPECIFIED(0), + /** + * + * + *
        +     * This test is strictly required.
        +     * 
        + * + * REQUIRED = 1; + */ + REQUIRED(1), + /** + * + * + *
        +     * This test is recommended.
        +     *
        +     * If a generator explicitly ignores a recommended test (see `DeleteTest`),
        +     * then the report may still pass, but with a warning.
        +     *
        +     * If a generator skips a recommended test and does not explicitly
        +     * express that intention, the report will fail.
        +     * 
        + * + * RECOMMENDED = 2; + */ + RECOMMENDED(2), + /** + * + * + *
        +     * This test is optional.
        +     *
        +     * If a generator explicitly ignores an optional test (see `DeleteTest`),
        +     * then the report may still pass, and no warning will be issued.
        +     *
        +     * If a generator skips an optional test and does not explicitly
        +     * express that intention, the report may still pass, but with a
        +     * warning.
        +     * 
        + * + * OPTIONAL = 3; + */ + OPTIONAL(3), + UNRECOGNIZED(-1), + ; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "ExpectationLevel"); + } + + /** EXPECTATION_LEVEL_UNSPECIFIED = 0; */ + public static final int EXPECTATION_LEVEL_UNSPECIFIED_VALUE = 0; + + /** + * + * + *
        +     * This test is strictly required.
        +     * 
        + * + * REQUIRED = 1; + */ + public static final int REQUIRED_VALUE = 1; + + /** + * + * + *
        +     * This test is recommended.
        +     *
        +     * If a generator explicitly ignores a recommended test (see `DeleteTest`),
        +     * then the report may still pass, but with a warning.
        +     *
        +     * If a generator skips a recommended test and does not explicitly
        +     * express that intention, the report will fail.
        +     * 
        + * + * RECOMMENDED = 2; + */ + public static final int RECOMMENDED_VALUE = 2; + + /** + * + * + *
        +     * This test is optional.
        +     *
        +     * If a generator explicitly ignores an optional test (see `DeleteTest`),
        +     * then the report may still pass, and no warning will be issued.
        +     *
        +     * If a generator skips an optional test and does not explicitly
        +     * express that intention, the report may still pass, but with a
        +     * warning.
        +     * 
        + * + * OPTIONAL = 3; + */ + public static final int OPTIONAL_VALUE = 3; + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static ExpectationLevel 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 ExpectationLevel forNumber(int value) { + switch (value) { + case 0: + return EXPECTATION_LEVEL_UNSPECIFIED; + case 1: + return REQUIRED; + case 2: + return RECOMMENDED; + case 3: + return OPTIONAL; + 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 ExpectationLevel findValueByNumber(int number) { + return ExpectationLevel.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 com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.showcase.v1beta1.Test.getDescriptor().getEnumTypes().get(0); + } + + private static final ExpectationLevel[] VALUES = values(); + + public static ExpectationLevel 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 ExpectationLevel(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.showcase.v1beta1.Test.ExpectationLevel) + } + + public interface BlueprintOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.Test.Blueprint) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
        +     * The name of this blueprint.
        +     * 
        + * + * string name = 1; + * + * @return The name. + */ + java.lang.String getName(); + + /** + * + * + *
        +     * The name of this blueprint.
        +     * 
        + * + * string name = 1; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
        +     * A description of this blueprint.
        +     * 
        + * + * string description = 2; + * + * @return The description. + */ + java.lang.String getDescription(); + + /** + * + * + *
        +     * A description of this blueprint.
        +     * 
        + * + * string description = 2; + * + * @return The bytes for description. + */ + com.google.protobuf.ByteString getDescriptionBytes(); + + /** + * + * + *
        +     * The initial request to trigger this test.
        +     * 
        + * + * .google.showcase.v1beta1.Test.Blueprint.Invocation request = 3; + * + * @return Whether the request field is set. + */ + boolean hasRequest(); + + /** + * + * + *
        +     * The initial request to trigger this test.
        +     * 
        + * + * .google.showcase.v1beta1.Test.Blueprint.Invocation request = 3; + * + * @return The request. + */ + com.google.showcase.v1beta1.Test.Blueprint.Invocation getRequest(); + + /** + * + * + *
        +     * The initial request to trigger this test.
        +     * 
        + * + * .google.showcase.v1beta1.Test.Blueprint.Invocation request = 3; + */ + com.google.showcase.v1beta1.Test.Blueprint.InvocationOrBuilder getRequestOrBuilder(); + + /** + * + * + *
        +     * An ordered list of method calls that can be called to trigger this test.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Test.Blueprint.Invocation additional_requests = 4; + * + */ + java.util.List + getAdditionalRequestsList(); + + /** + * + * + *
        +     * An ordered list of method calls that can be called to trigger this test.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Test.Blueprint.Invocation additional_requests = 4; + * + */ + com.google.showcase.v1beta1.Test.Blueprint.Invocation getAdditionalRequests(int index); + + /** + * + * + *
        +     * An ordered list of method calls that can be called to trigger this test.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Test.Blueprint.Invocation additional_requests = 4; + * + */ + int getAdditionalRequestsCount(); + + /** + * + * + *
        +     * An ordered list of method calls that can be called to trigger this test.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Test.Blueprint.Invocation additional_requests = 4; + * + */ + java.util.List + getAdditionalRequestsOrBuilderList(); + + /** + * + * + *
        +     * An ordered list of method calls that can be called to trigger this test.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Test.Blueprint.Invocation additional_requests = 4; + * + */ + com.google.showcase.v1beta1.Test.Blueprint.InvocationOrBuilder getAdditionalRequestsOrBuilder( + int index); + } + + /** + * + * + *
        +   * A blueprint is an explicit definition of methods and requests that are needed
        +   * to be made to test this specific test case. Ideally this would be represented
        +   * by something more robust like CEL, but as of writing this, I am unsure if CEL
        +   * is ready.
        +   * 
        + * + * Protobuf type {@code google.showcase.v1beta1.Test.Blueprint} + */ + public static final class Blueprint extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.Test.Blueprint) + BlueprintOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "Blueprint"); + } + + // Use Blueprint.newBuilder() to construct. + private Blueprint(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private Blueprint() { + name_ = ""; + description_ = ""; + additionalRequests_ = java.util.Collections.emptyList(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.TestingOuterClass + .internal_static_google_showcase_v1beta1_Test_Blueprint_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.TestingOuterClass + .internal_static_google_showcase_v1beta1_Test_Blueprint_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.Test.Blueprint.class, + com.google.showcase.v1beta1.Test.Blueprint.Builder.class); + } + + public interface InvocationOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.Test.Blueprint.Invocation) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
        +       * The fully qualified name of the showcase method to be invoked.
        +       * 
        + * + * string method = 1; + * + * @return The method. + */ + java.lang.String getMethod(); + + /** + * + * + *
        +       * The fully qualified name of the showcase method to be invoked.
        +       * 
        + * + * string method = 1; + * + * @return The bytes for method. + */ + com.google.protobuf.ByteString getMethodBytes(); + + /** + * + * + *
        +       * The request to be made if a specific request is necessary.
        +       * 
        + * + * bytes serialized_request = 2; + * + * @return The serializedRequest. + */ + com.google.protobuf.ByteString getSerializedRequest(); + } + + /** + * + * + *
        +     * A message representing a method invocation.
        +     * 
        + * + * Protobuf type {@code google.showcase.v1beta1.Test.Blueprint.Invocation} + */ + public static final class Invocation extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.Test.Blueprint.Invocation) + InvocationOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "Invocation"); + } + + // Use Invocation.newBuilder() to construct. + private Invocation(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private Invocation() { + method_ = ""; + serializedRequest_ = com.google.protobuf.ByteString.EMPTY; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.TestingOuterClass + .internal_static_google_showcase_v1beta1_Test_Blueprint_Invocation_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.TestingOuterClass + .internal_static_google_showcase_v1beta1_Test_Blueprint_Invocation_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.Test.Blueprint.Invocation.class, + com.google.showcase.v1beta1.Test.Blueprint.Invocation.Builder.class); + } + + public static final int METHOD_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object method_ = ""; + + /** + * + * + *
        +       * The fully qualified name of the showcase method to be invoked.
        +       * 
        + * + * string method = 1; + * + * @return The method. + */ + @java.lang.Override + public java.lang.String getMethod() { + java.lang.Object ref = method_; + 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(); + method_ = s; + return s; + } + } + + /** + * + * + *
        +       * The fully qualified name of the showcase method to be invoked.
        +       * 
        + * + * string method = 1; + * + * @return The bytes for method. + */ + @java.lang.Override + public com.google.protobuf.ByteString getMethodBytes() { + java.lang.Object ref = method_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + method_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int SERIALIZED_REQUEST_FIELD_NUMBER = 2; + private com.google.protobuf.ByteString serializedRequest_ = + com.google.protobuf.ByteString.EMPTY; + + /** + * + * + *
        +       * The request to be made if a specific request is necessary.
        +       * 
        + * + * bytes serialized_request = 2; + * + * @return The serializedRequest. + */ + @java.lang.Override + public com.google.protobuf.ByteString getSerializedRequest() { + return serializedRequest_; + } + + 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.GeneratedMessage.isStringEmpty(method_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, method_); + } + if (!serializedRequest_.isEmpty()) { + output.writeBytes(2, serializedRequest_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(method_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, method_); + } + if (!serializedRequest_.isEmpty()) { + size += com.google.protobuf.CodedOutputStream.computeBytesSize(2, serializedRequest_); + } + 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.showcase.v1beta1.Test.Blueprint.Invocation)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.Test.Blueprint.Invocation other = + (com.google.showcase.v1beta1.Test.Blueprint.Invocation) obj; + + if (!getMethod().equals(other.getMethod())) return false; + if (!getSerializedRequest().equals(other.getSerializedRequest())) 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) + METHOD_FIELD_NUMBER; + hash = (53 * hash) + getMethod().hashCode(); + hash = (37 * hash) + SERIALIZED_REQUEST_FIELD_NUMBER; + hash = (53 * hash) + getSerializedRequest().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.showcase.v1beta1.Test.Blueprint.Invocation parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.Test.Blueprint.Invocation parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.Test.Blueprint.Invocation parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.Test.Blueprint.Invocation 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.showcase.v1beta1.Test.Blueprint.Invocation parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.Test.Blueprint.Invocation parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.Test.Blueprint.Invocation parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.Test.Blueprint.Invocation parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.showcase.v1beta1.Test.Blueprint.Invocation parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.Test.Blueprint.Invocation parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.showcase.v1beta1.Test.Blueprint.Invocation parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.Test.Blueprint.Invocation parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.showcase.v1beta1.Test.Blueprint.Invocation 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
        +       * A message representing a method invocation.
        +       * 
        + * + * Protobuf type {@code google.showcase.v1beta1.Test.Blueprint.Invocation} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.Test.Blueprint.Invocation) + com.google.showcase.v1beta1.Test.Blueprint.InvocationOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.TestingOuterClass + .internal_static_google_showcase_v1beta1_Test_Blueprint_Invocation_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.TestingOuterClass + .internal_static_google_showcase_v1beta1_Test_Blueprint_Invocation_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.Test.Blueprint.Invocation.class, + com.google.showcase.v1beta1.Test.Blueprint.Invocation.Builder.class); + } + + // Construct using com.google.showcase.v1beta1.Test.Blueprint.Invocation.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + method_ = ""; + serializedRequest_ = com.google.protobuf.ByteString.EMPTY; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.showcase.v1beta1.TestingOuterClass + .internal_static_google_showcase_v1beta1_Test_Blueprint_Invocation_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.Test.Blueprint.Invocation getDefaultInstanceForType() { + return com.google.showcase.v1beta1.Test.Blueprint.Invocation.getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.Test.Blueprint.Invocation build() { + com.google.showcase.v1beta1.Test.Blueprint.Invocation result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.Test.Blueprint.Invocation buildPartial() { + com.google.showcase.v1beta1.Test.Blueprint.Invocation result = + new com.google.showcase.v1beta1.Test.Blueprint.Invocation(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.showcase.v1beta1.Test.Blueprint.Invocation result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.method_ = method_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.serializedRequest_ = serializedRequest_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.showcase.v1beta1.Test.Blueprint.Invocation) { + return mergeFrom((com.google.showcase.v1beta1.Test.Blueprint.Invocation) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.showcase.v1beta1.Test.Blueprint.Invocation other) { + if (other == com.google.showcase.v1beta1.Test.Blueprint.Invocation.getDefaultInstance()) + return this; + if (!other.getMethod().isEmpty()) { + method_ = other.method_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getSerializedRequest().isEmpty()) { + setSerializedRequest(other.getSerializedRequest()); + } + 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: + { + method_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + serializedRequest_ = input.readBytes(); + 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 method_ = ""; + + /** + * + * + *
        +         * The fully qualified name of the showcase method to be invoked.
        +         * 
        + * + * string method = 1; + * + * @return The method. + */ + public java.lang.String getMethod() { + java.lang.Object ref = method_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + method_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
        +         * The fully qualified name of the showcase method to be invoked.
        +         * 
        + * + * string method = 1; + * + * @return The bytes for method. + */ + public com.google.protobuf.ByteString getMethodBytes() { + java.lang.Object ref = method_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + method_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
        +         * The fully qualified name of the showcase method to be invoked.
        +         * 
        + * + * string method = 1; + * + * @param value The method to set. + * @return This builder for chaining. + */ + public Builder setMethod(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + method_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
        +         * The fully qualified name of the showcase method to be invoked.
        +         * 
        + * + * string method = 1; + * + * @return This builder for chaining. + */ + public Builder clearMethod() { + method_ = getDefaultInstance().getMethod(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
        +         * The fully qualified name of the showcase method to be invoked.
        +         * 
        + * + * string method = 1; + * + * @param value The bytes for method to set. + * @return This builder for chaining. + */ + public Builder setMethodBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + method_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private com.google.protobuf.ByteString serializedRequest_ = + com.google.protobuf.ByteString.EMPTY; + + /** + * + * + *
        +         * The request to be made if a specific request is necessary.
        +         * 
        + * + * bytes serialized_request = 2; + * + * @return The serializedRequest. + */ + @java.lang.Override + public com.google.protobuf.ByteString getSerializedRequest() { + return serializedRequest_; + } + + /** + * + * + *
        +         * The request to be made if a specific request is necessary.
        +         * 
        + * + * bytes serialized_request = 2; + * + * @param value The serializedRequest to set. + * @return This builder for chaining. + */ + public Builder setSerializedRequest(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + serializedRequest_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
        +         * The request to be made if a specific request is necessary.
        +         * 
        + * + * bytes serialized_request = 2; + * + * @return This builder for chaining. + */ + public Builder clearSerializedRequest() { + bitField0_ = (bitField0_ & ~0x00000002); + serializedRequest_ = getDefaultInstance().getSerializedRequest(); + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.showcase.v1beta1.Test.Blueprint.Invocation) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.Test.Blueprint.Invocation) + private static final com.google.showcase.v1beta1.Test.Blueprint.Invocation DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.Test.Blueprint.Invocation(); + } + + public static com.google.showcase.v1beta1.Test.Blueprint.Invocation getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Invocation 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.showcase.v1beta1.Test.Blueprint.Invocation getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + private int bitField0_; + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + + /** + * + * + *
        +     * The name of this blueprint.
        +     * 
        + * + * 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 name of this blueprint.
        +     * 
        + * + * 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_ = ""; + + /** + * + * + *
        +     * A description of this blueprint.
        +     * 
        + * + * 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; + } + } + + /** + * + * + *
        +     * A description of this blueprint.
        +     * 
        + * + * 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 REQUEST_FIELD_NUMBER = 3; + private com.google.showcase.v1beta1.Test.Blueprint.Invocation request_; + + /** + * + * + *
        +     * The initial request to trigger this test.
        +     * 
        + * + * .google.showcase.v1beta1.Test.Blueprint.Invocation request = 3; + * + * @return Whether the request field is set. + */ + @java.lang.Override + public boolean hasRequest() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
        +     * The initial request to trigger this test.
        +     * 
        + * + * .google.showcase.v1beta1.Test.Blueprint.Invocation request = 3; + * + * @return The request. + */ + @java.lang.Override + public com.google.showcase.v1beta1.Test.Blueprint.Invocation getRequest() { + return request_ == null + ? com.google.showcase.v1beta1.Test.Blueprint.Invocation.getDefaultInstance() + : request_; + } + + /** + * + * + *
        +     * The initial request to trigger this test.
        +     * 
        + * + * .google.showcase.v1beta1.Test.Blueprint.Invocation request = 3; + */ + @java.lang.Override + public com.google.showcase.v1beta1.Test.Blueprint.InvocationOrBuilder getRequestOrBuilder() { + return request_ == null + ? com.google.showcase.v1beta1.Test.Blueprint.Invocation.getDefaultInstance() + : request_; + } + + public static final int ADDITIONAL_REQUESTS_FIELD_NUMBER = 4; + + @SuppressWarnings("serial") + private java.util.List + additionalRequests_; + + /** + * + * + *
        +     * An ordered list of method calls that can be called to trigger this test.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Test.Blueprint.Invocation additional_requests = 4; + * + */ + @java.lang.Override + public java.util.List + getAdditionalRequestsList() { + return additionalRequests_; + } + + /** + * + * + *
        +     * An ordered list of method calls that can be called to trigger this test.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Test.Blueprint.Invocation additional_requests = 4; + * + */ + @java.lang.Override + public java.util.List + getAdditionalRequestsOrBuilderList() { + return additionalRequests_; + } + + /** + * + * + *
        +     * An ordered list of method calls that can be called to trigger this test.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Test.Blueprint.Invocation additional_requests = 4; + * + */ + @java.lang.Override + public int getAdditionalRequestsCount() { + return additionalRequests_.size(); + } + + /** + * + * + *
        +     * An ordered list of method calls that can be called to trigger this test.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Test.Blueprint.Invocation additional_requests = 4; + * + */ + @java.lang.Override + public com.google.showcase.v1beta1.Test.Blueprint.Invocation getAdditionalRequests(int index) { + return additionalRequests_.get(index); + } + + /** + * + * + *
        +     * An ordered list of method calls that can be called to trigger this test.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Test.Blueprint.Invocation additional_requests = 4; + * + */ + @java.lang.Override + public com.google.showcase.v1beta1.Test.Blueprint.InvocationOrBuilder + getAdditionalRequestsOrBuilder(int index) { + return additionalRequests_.get(index); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, name_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(description_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, description_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(3, getRequest()); + } + for (int i = 0; i < additionalRequests_.size(); i++) { + output.writeMessage(4, additionalRequests_.get(i)); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, name_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(description_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, description_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getRequest()); + } + for (int i = 0; i < additionalRequests_.size(); i++) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize(4, additionalRequests_.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.showcase.v1beta1.Test.Blueprint)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.Test.Blueprint other = + (com.google.showcase.v1beta1.Test.Blueprint) obj; + + if (!getName().equals(other.getName())) return false; + if (!getDescription().equals(other.getDescription())) return false; + if (hasRequest() != other.hasRequest()) return false; + if (hasRequest()) { + if (!getRequest().equals(other.getRequest())) return false; + } + if (!getAdditionalRequestsList().equals(other.getAdditionalRequestsList())) 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 (hasRequest()) { + hash = (37 * hash) + REQUEST_FIELD_NUMBER; + hash = (53 * hash) + getRequest().hashCode(); + } + if (getAdditionalRequestsCount() > 0) { + hash = (37 * hash) + ADDITIONAL_REQUESTS_FIELD_NUMBER; + hash = (53 * hash) + getAdditionalRequestsList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.showcase.v1beta1.Test.Blueprint parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.Test.Blueprint parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.Test.Blueprint parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.Test.Blueprint 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.showcase.v1beta1.Test.Blueprint parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.Test.Blueprint parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.Test.Blueprint parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.Test.Blueprint parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.showcase.v1beta1.Test.Blueprint parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.Test.Blueprint parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.showcase.v1beta1.Test.Blueprint parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.Test.Blueprint parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.showcase.v1beta1.Test.Blueprint 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
        +     * A blueprint is an explicit definition of methods and requests that are needed
        +     * to be made to test this specific test case. Ideally this would be represented
        +     * by something more robust like CEL, but as of writing this, I am unsure if CEL
        +     * is ready.
        +     * 
        + * + * Protobuf type {@code google.showcase.v1beta1.Test.Blueprint} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.Test.Blueprint) + com.google.showcase.v1beta1.Test.BlueprintOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.TestingOuterClass + .internal_static_google_showcase_v1beta1_Test_Blueprint_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.TestingOuterClass + .internal_static_google_showcase_v1beta1_Test_Blueprint_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.Test.Blueprint.class, + com.google.showcase.v1beta1.Test.Blueprint.Builder.class); + } + + // Construct using com.google.showcase.v1beta1.Test.Blueprint.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetRequestFieldBuilder(); + internalGetAdditionalRequestsFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + description_ = ""; + request_ = null; + if (requestBuilder_ != null) { + requestBuilder_.dispose(); + requestBuilder_ = null; + } + if (additionalRequestsBuilder_ == null) { + additionalRequests_ = java.util.Collections.emptyList(); + } else { + additionalRequests_ = null; + additionalRequestsBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000008); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.showcase.v1beta1.TestingOuterClass + .internal_static_google_showcase_v1beta1_Test_Blueprint_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.Test.Blueprint getDefaultInstanceForType() { + return com.google.showcase.v1beta1.Test.Blueprint.getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.Test.Blueprint build() { + com.google.showcase.v1beta1.Test.Blueprint result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.Test.Blueprint buildPartial() { + com.google.showcase.v1beta1.Test.Blueprint result = + new com.google.showcase.v1beta1.Test.Blueprint(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields(com.google.showcase.v1beta1.Test.Blueprint result) { + if (additionalRequestsBuilder_ == null) { + if (((bitField0_ & 0x00000008) != 0)) { + additionalRequests_ = java.util.Collections.unmodifiableList(additionalRequests_); + bitField0_ = (bitField0_ & ~0x00000008); + } + result.additionalRequests_ = additionalRequests_; + } else { + result.additionalRequests_ = additionalRequestsBuilder_.build(); + } + } + + private void buildPartial0(com.google.showcase.v1beta1.Test.Blueprint 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.request_ = requestBuilder_ == null ? request_ : requestBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.showcase.v1beta1.Test.Blueprint) { + return mergeFrom((com.google.showcase.v1beta1.Test.Blueprint) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.showcase.v1beta1.Test.Blueprint other) { + if (other == com.google.showcase.v1beta1.Test.Blueprint.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.hasRequest()) { + mergeRequest(other.getRequest()); + } + if (additionalRequestsBuilder_ == null) { + if (!other.additionalRequests_.isEmpty()) { + if (additionalRequests_.isEmpty()) { + additionalRequests_ = other.additionalRequests_; + bitField0_ = (bitField0_ & ~0x00000008); + } else { + ensureAdditionalRequestsIsMutable(); + additionalRequests_.addAll(other.additionalRequests_); + } + onChanged(); + } + } else { + if (!other.additionalRequests_.isEmpty()) { + if (additionalRequestsBuilder_.isEmpty()) { + additionalRequestsBuilder_.dispose(); + additionalRequestsBuilder_ = null; + additionalRequests_ = other.additionalRequests_; + bitField0_ = (bitField0_ & ~0x00000008); + additionalRequestsBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders + ? internalGetAdditionalRequestsFieldBuilder() + : null; + } else { + additionalRequestsBuilder_.addAllMessages(other.additionalRequests_); + } + } + } + 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( + internalGetRequestFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 34: + { + com.google.showcase.v1beta1.Test.Blueprint.Invocation m = + input.readMessage( + com.google.showcase.v1beta1.Test.Blueprint.Invocation.parser(), + extensionRegistry); + if (additionalRequestsBuilder_ == null) { + ensureAdditionalRequestsIsMutable(); + additionalRequests_.add(m); + } else { + additionalRequestsBuilder_.addMessage(m); + } + 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_ = ""; + + /** + * + * + *
        +       * The name of this blueprint.
        +       * 
        + * + * 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 name of this blueprint.
        +       * 
        + * + * 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 name of this blueprint.
        +       * 
        + * + * 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 name of this blueprint.
        +       * 
        + * + * string name = 1; + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
        +       * The name of this blueprint.
        +       * 
        + * + * 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_ = ""; + + /** + * + * + *
        +       * A description of this blueprint.
        +       * 
        + * + * 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; + } + } + + /** + * + * + *
        +       * A description of this blueprint.
        +       * 
        + * + * 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; + } + } + + /** + * + * + *
        +       * A description of this blueprint.
        +       * 
        + * + * 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; + } + + /** + * + * + *
        +       * A description of this blueprint.
        +       * 
        + * + * string description = 2; + * + * @return This builder for chaining. + */ + public Builder clearDescription() { + description_ = getDefaultInstance().getDescription(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
        +       * A description of this blueprint.
        +       * 
        + * + * 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.showcase.v1beta1.Test.Blueprint.Invocation request_; + private com.google.protobuf.SingleFieldBuilder< + com.google.showcase.v1beta1.Test.Blueprint.Invocation, + com.google.showcase.v1beta1.Test.Blueprint.Invocation.Builder, + com.google.showcase.v1beta1.Test.Blueprint.InvocationOrBuilder> + requestBuilder_; + + /** + * + * + *
        +       * The initial request to trigger this test.
        +       * 
        + * + * .google.showcase.v1beta1.Test.Blueprint.Invocation request = 3; + * + * @return Whether the request field is set. + */ + public boolean hasRequest() { + return ((bitField0_ & 0x00000004) != 0); + } + + /** + * + * + *
        +       * The initial request to trigger this test.
        +       * 
        + * + * .google.showcase.v1beta1.Test.Blueprint.Invocation request = 3; + * + * @return The request. + */ + public com.google.showcase.v1beta1.Test.Blueprint.Invocation getRequest() { + if (requestBuilder_ == null) { + return request_ == null + ? com.google.showcase.v1beta1.Test.Blueprint.Invocation.getDefaultInstance() + : request_; + } else { + return requestBuilder_.getMessage(); + } + } + + /** + * + * + *
        +       * The initial request to trigger this test.
        +       * 
        + * + * .google.showcase.v1beta1.Test.Blueprint.Invocation request = 3; + */ + public Builder setRequest(com.google.showcase.v1beta1.Test.Blueprint.Invocation value) { + if (requestBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + request_ = value; + } else { + requestBuilder_.setMessage(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
        +       * The initial request to trigger this test.
        +       * 
        + * + * .google.showcase.v1beta1.Test.Blueprint.Invocation request = 3; + */ + public Builder setRequest( + com.google.showcase.v1beta1.Test.Blueprint.Invocation.Builder builderForValue) { + if (requestBuilder_ == null) { + request_ = builderForValue.build(); + } else { + requestBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
        +       * The initial request to trigger this test.
        +       * 
        + * + * .google.showcase.v1beta1.Test.Blueprint.Invocation request = 3; + */ + public Builder mergeRequest(com.google.showcase.v1beta1.Test.Blueprint.Invocation value) { + if (requestBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0) + && request_ != null + && request_ + != com.google.showcase.v1beta1.Test.Blueprint.Invocation.getDefaultInstance()) { + getRequestBuilder().mergeFrom(value); + } else { + request_ = value; + } + } else { + requestBuilder_.mergeFrom(value); + } + if (request_ != null) { + bitField0_ |= 0x00000004; + onChanged(); + } + return this; + } + + /** + * + * + *
        +       * The initial request to trigger this test.
        +       * 
        + * + * .google.showcase.v1beta1.Test.Blueprint.Invocation request = 3; + */ + public Builder clearRequest() { + bitField0_ = (bitField0_ & ~0x00000004); + request_ = null; + if (requestBuilder_ != null) { + requestBuilder_.dispose(); + requestBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
        +       * The initial request to trigger this test.
        +       * 
        + * + * .google.showcase.v1beta1.Test.Blueprint.Invocation request = 3; + */ + public com.google.showcase.v1beta1.Test.Blueprint.Invocation.Builder getRequestBuilder() { + bitField0_ |= 0x00000004; + onChanged(); + return internalGetRequestFieldBuilder().getBuilder(); + } + + /** + * + * + *
        +       * The initial request to trigger this test.
        +       * 
        + * + * .google.showcase.v1beta1.Test.Blueprint.Invocation request = 3; + */ + public com.google.showcase.v1beta1.Test.Blueprint.InvocationOrBuilder getRequestOrBuilder() { + if (requestBuilder_ != null) { + return requestBuilder_.getMessageOrBuilder(); + } else { + return request_ == null + ? com.google.showcase.v1beta1.Test.Blueprint.Invocation.getDefaultInstance() + : request_; + } + } + + /** + * + * + *
        +       * The initial request to trigger this test.
        +       * 
        + * + * .google.showcase.v1beta1.Test.Blueprint.Invocation request = 3; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.showcase.v1beta1.Test.Blueprint.Invocation, + com.google.showcase.v1beta1.Test.Blueprint.Invocation.Builder, + com.google.showcase.v1beta1.Test.Blueprint.InvocationOrBuilder> + internalGetRequestFieldBuilder() { + if (requestBuilder_ == null) { + requestBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.showcase.v1beta1.Test.Blueprint.Invocation, + com.google.showcase.v1beta1.Test.Blueprint.Invocation.Builder, + com.google.showcase.v1beta1.Test.Blueprint.InvocationOrBuilder>( + getRequest(), getParentForChildren(), isClean()); + request_ = null; + } + return requestBuilder_; + } + + private java.util.List + additionalRequests_ = java.util.Collections.emptyList(); + + private void ensureAdditionalRequestsIsMutable() { + if (!((bitField0_ & 0x00000008) != 0)) { + additionalRequests_ = + new java.util.ArrayList( + additionalRequests_); + bitField0_ |= 0x00000008; + } + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.google.showcase.v1beta1.Test.Blueprint.Invocation, + com.google.showcase.v1beta1.Test.Blueprint.Invocation.Builder, + com.google.showcase.v1beta1.Test.Blueprint.InvocationOrBuilder> + additionalRequestsBuilder_; + + /** + * + * + *
        +       * An ordered list of method calls that can be called to trigger this test.
        +       * 
        + * + * repeated .google.showcase.v1beta1.Test.Blueprint.Invocation additional_requests = 4; + * + */ + public java.util.List + getAdditionalRequestsList() { + if (additionalRequestsBuilder_ == null) { + return java.util.Collections.unmodifiableList(additionalRequests_); + } else { + return additionalRequestsBuilder_.getMessageList(); + } + } + + /** + * + * + *
        +       * An ordered list of method calls that can be called to trigger this test.
        +       * 
        + * + * repeated .google.showcase.v1beta1.Test.Blueprint.Invocation additional_requests = 4; + * + */ + public int getAdditionalRequestsCount() { + if (additionalRequestsBuilder_ == null) { + return additionalRequests_.size(); + } else { + return additionalRequestsBuilder_.getCount(); + } + } + + /** + * + * + *
        +       * An ordered list of method calls that can be called to trigger this test.
        +       * 
        + * + * repeated .google.showcase.v1beta1.Test.Blueprint.Invocation additional_requests = 4; + * + */ + public com.google.showcase.v1beta1.Test.Blueprint.Invocation getAdditionalRequests( + int index) { + if (additionalRequestsBuilder_ == null) { + return additionalRequests_.get(index); + } else { + return additionalRequestsBuilder_.getMessage(index); + } + } + + /** + * + * + *
        +       * An ordered list of method calls that can be called to trigger this test.
        +       * 
        + * + * repeated .google.showcase.v1beta1.Test.Blueprint.Invocation additional_requests = 4; + * + */ + public Builder setAdditionalRequests( + int index, com.google.showcase.v1beta1.Test.Blueprint.Invocation value) { + if (additionalRequestsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureAdditionalRequestsIsMutable(); + additionalRequests_.set(index, value); + onChanged(); + } else { + additionalRequestsBuilder_.setMessage(index, value); + } + return this; + } + + /** + * + * + *
        +       * An ordered list of method calls that can be called to trigger this test.
        +       * 
        + * + * repeated .google.showcase.v1beta1.Test.Blueprint.Invocation additional_requests = 4; + * + */ + public Builder setAdditionalRequests( + int index, + com.google.showcase.v1beta1.Test.Blueprint.Invocation.Builder builderForValue) { + if (additionalRequestsBuilder_ == null) { + ensureAdditionalRequestsIsMutable(); + additionalRequests_.set(index, builderForValue.build()); + onChanged(); + } else { + additionalRequestsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
        +       * An ordered list of method calls that can be called to trigger this test.
        +       * 
        + * + * repeated .google.showcase.v1beta1.Test.Blueprint.Invocation additional_requests = 4; + * + */ + public Builder addAdditionalRequests( + com.google.showcase.v1beta1.Test.Blueprint.Invocation value) { + if (additionalRequestsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureAdditionalRequestsIsMutable(); + additionalRequests_.add(value); + onChanged(); + } else { + additionalRequestsBuilder_.addMessage(value); + } + return this; + } + + /** + * + * + *
        +       * An ordered list of method calls that can be called to trigger this test.
        +       * 
        + * + * repeated .google.showcase.v1beta1.Test.Blueprint.Invocation additional_requests = 4; + * + */ + public Builder addAdditionalRequests( + int index, com.google.showcase.v1beta1.Test.Blueprint.Invocation value) { + if (additionalRequestsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureAdditionalRequestsIsMutable(); + additionalRequests_.add(index, value); + onChanged(); + } else { + additionalRequestsBuilder_.addMessage(index, value); + } + return this; + } + + /** + * + * + *
        +       * An ordered list of method calls that can be called to trigger this test.
        +       * 
        + * + * repeated .google.showcase.v1beta1.Test.Blueprint.Invocation additional_requests = 4; + * + */ + public Builder addAdditionalRequests( + com.google.showcase.v1beta1.Test.Blueprint.Invocation.Builder builderForValue) { + if (additionalRequestsBuilder_ == null) { + ensureAdditionalRequestsIsMutable(); + additionalRequests_.add(builderForValue.build()); + onChanged(); + } else { + additionalRequestsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + + /** + * + * + *
        +       * An ordered list of method calls that can be called to trigger this test.
        +       * 
        + * + * repeated .google.showcase.v1beta1.Test.Blueprint.Invocation additional_requests = 4; + * + */ + public Builder addAdditionalRequests( + int index, + com.google.showcase.v1beta1.Test.Blueprint.Invocation.Builder builderForValue) { + if (additionalRequestsBuilder_ == null) { + ensureAdditionalRequestsIsMutable(); + additionalRequests_.add(index, builderForValue.build()); + onChanged(); + } else { + additionalRequestsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
        +       * An ordered list of method calls that can be called to trigger this test.
        +       * 
        + * + * repeated .google.showcase.v1beta1.Test.Blueprint.Invocation additional_requests = 4; + * + */ + public Builder addAllAdditionalRequests( + java.lang.Iterable + values) { + if (additionalRequestsBuilder_ == null) { + ensureAdditionalRequestsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, additionalRequests_); + onChanged(); + } else { + additionalRequestsBuilder_.addAllMessages(values); + } + return this; + } + + /** + * + * + *
        +       * An ordered list of method calls that can be called to trigger this test.
        +       * 
        + * + * repeated .google.showcase.v1beta1.Test.Blueprint.Invocation additional_requests = 4; + * + */ + public Builder clearAdditionalRequests() { + if (additionalRequestsBuilder_ == null) { + additionalRequests_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + } else { + additionalRequestsBuilder_.clear(); + } + return this; + } + + /** + * + * + *
        +       * An ordered list of method calls that can be called to trigger this test.
        +       * 
        + * + * repeated .google.showcase.v1beta1.Test.Blueprint.Invocation additional_requests = 4; + * + */ + public Builder removeAdditionalRequests(int index) { + if (additionalRequestsBuilder_ == null) { + ensureAdditionalRequestsIsMutable(); + additionalRequests_.remove(index); + onChanged(); + } else { + additionalRequestsBuilder_.remove(index); + } + return this; + } + + /** + * + * + *
        +       * An ordered list of method calls that can be called to trigger this test.
        +       * 
        + * + * repeated .google.showcase.v1beta1.Test.Blueprint.Invocation additional_requests = 4; + * + */ + public com.google.showcase.v1beta1.Test.Blueprint.Invocation.Builder + getAdditionalRequestsBuilder(int index) { + return internalGetAdditionalRequestsFieldBuilder().getBuilder(index); + } + + /** + * + * + *
        +       * An ordered list of method calls that can be called to trigger this test.
        +       * 
        + * + * repeated .google.showcase.v1beta1.Test.Blueprint.Invocation additional_requests = 4; + * + */ + public com.google.showcase.v1beta1.Test.Blueprint.InvocationOrBuilder + getAdditionalRequestsOrBuilder(int index) { + if (additionalRequestsBuilder_ == null) { + return additionalRequests_.get(index); + } else { + return additionalRequestsBuilder_.getMessageOrBuilder(index); + } + } + + /** + * + * + *
        +       * An ordered list of method calls that can be called to trigger this test.
        +       * 
        + * + * repeated .google.showcase.v1beta1.Test.Blueprint.Invocation additional_requests = 4; + * + */ + public java.util.List< + ? extends com.google.showcase.v1beta1.Test.Blueprint.InvocationOrBuilder> + getAdditionalRequestsOrBuilderList() { + if (additionalRequestsBuilder_ != null) { + return additionalRequestsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(additionalRequests_); + } + } + + /** + * + * + *
        +       * An ordered list of method calls that can be called to trigger this test.
        +       * 
        + * + * repeated .google.showcase.v1beta1.Test.Blueprint.Invocation additional_requests = 4; + * + */ + public com.google.showcase.v1beta1.Test.Blueprint.Invocation.Builder + addAdditionalRequestsBuilder() { + return internalGetAdditionalRequestsFieldBuilder() + .addBuilder(com.google.showcase.v1beta1.Test.Blueprint.Invocation.getDefaultInstance()); + } + + /** + * + * + *
        +       * An ordered list of method calls that can be called to trigger this test.
        +       * 
        + * + * repeated .google.showcase.v1beta1.Test.Blueprint.Invocation additional_requests = 4; + * + */ + public com.google.showcase.v1beta1.Test.Blueprint.Invocation.Builder + addAdditionalRequestsBuilder(int index) { + return internalGetAdditionalRequestsFieldBuilder() + .addBuilder( + index, com.google.showcase.v1beta1.Test.Blueprint.Invocation.getDefaultInstance()); + } + + /** + * + * + *
        +       * An ordered list of method calls that can be called to trigger this test.
        +       * 
        + * + * repeated .google.showcase.v1beta1.Test.Blueprint.Invocation additional_requests = 4; + * + */ + public java.util.List + getAdditionalRequestsBuilderList() { + return internalGetAdditionalRequestsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.google.showcase.v1beta1.Test.Blueprint.Invocation, + com.google.showcase.v1beta1.Test.Blueprint.Invocation.Builder, + com.google.showcase.v1beta1.Test.Blueprint.InvocationOrBuilder> + internalGetAdditionalRequestsFieldBuilder() { + if (additionalRequestsBuilder_ == null) { + additionalRequestsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilder< + com.google.showcase.v1beta1.Test.Blueprint.Invocation, + com.google.showcase.v1beta1.Test.Blueprint.Invocation.Builder, + com.google.showcase.v1beta1.Test.Blueprint.InvocationOrBuilder>( + additionalRequests_, + ((bitField0_ & 0x00000008) != 0), + getParentForChildren(), + isClean()); + additionalRequests_ = null; + } + return additionalRequestsBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.showcase.v1beta1.Test.Blueprint) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.Test.Blueprint) + private static final com.google.showcase.v1beta1.Test.Blueprint DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.Test.Blueprint(); + } + + public static com.google.showcase.v1beta1.Test.Blueprint getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Blueprint 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.showcase.v1beta1.Test.Blueprint getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + + /** + * + * + *
        +   * The name of the test.
        +   * The tests/* portion of the names are hard-coded, and do not change
        +   * from session to session.
        +   * 
        + * + * 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 name of the test.
        +   * The tests/* portion of the names are hard-coded, and do not change
        +   * from session to session.
        +   * 
        + * + * 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 EXPECTATION_LEVEL_FIELD_NUMBER = 2; + private int expectationLevel_ = 0; + + /** + * + * + *
        +   * The expectation level for this test.
        +   * 
        + * + * .google.showcase.v1beta1.Test.ExpectationLevel expectation_level = 2; + * + * @return The enum numeric value on the wire for expectationLevel. + */ + @java.lang.Override + public int getExpectationLevelValue() { + return expectationLevel_; + } + + /** + * + * + *
        +   * The expectation level for this test.
        +   * 
        + * + * .google.showcase.v1beta1.Test.ExpectationLevel expectation_level = 2; + * + * @return The expectationLevel. + */ + @java.lang.Override + public com.google.showcase.v1beta1.Test.ExpectationLevel getExpectationLevel() { + com.google.showcase.v1beta1.Test.ExpectationLevel result = + com.google.showcase.v1beta1.Test.ExpectationLevel.forNumber(expectationLevel_); + return result == null ? com.google.showcase.v1beta1.Test.ExpectationLevel.UNRECOGNIZED : result; + } + + public static final int DESCRIPTION_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object description_ = ""; + + /** + * + * + *
        +   * A description of the test.
        +   * 
        + * + * 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; + } + } + + /** + * + * + *
        +   * A description of the test.
        +   * 
        + * + * 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 BLUEPRINTS_FIELD_NUMBER = 4; + + @SuppressWarnings("serial") + private java.util.List blueprints_; + + /** + * + * + *
        +   * The blueprints that will satisfy this test. There may be multiple blueprints
        +   * that can signal to the server that this test case is being exercised. Although
        +   * multiple blueprints are specified, only a single blueprint needs to be run to
        +   * signal that the test case was exercised.
        +   * 
        + * + * repeated .google.showcase.v1beta1.Test.Blueprint blueprints = 4; + */ + @java.lang.Override + public java.util.List getBlueprintsList() { + return blueprints_; + } + + /** + * + * + *
        +   * The blueprints that will satisfy this test. There may be multiple blueprints
        +   * that can signal to the server that this test case is being exercised. Although
        +   * multiple blueprints are specified, only a single blueprint needs to be run to
        +   * signal that the test case was exercised.
        +   * 
        + * + * repeated .google.showcase.v1beta1.Test.Blueprint blueprints = 4; + */ + @java.lang.Override + public java.util.List + getBlueprintsOrBuilderList() { + return blueprints_; + } + + /** + * + * + *
        +   * The blueprints that will satisfy this test. There may be multiple blueprints
        +   * that can signal to the server that this test case is being exercised. Although
        +   * multiple blueprints are specified, only a single blueprint needs to be run to
        +   * signal that the test case was exercised.
        +   * 
        + * + * repeated .google.showcase.v1beta1.Test.Blueprint blueprints = 4; + */ + @java.lang.Override + public int getBlueprintsCount() { + return blueprints_.size(); + } + + /** + * + * + *
        +   * The blueprints that will satisfy this test. There may be multiple blueprints
        +   * that can signal to the server that this test case is being exercised. Although
        +   * multiple blueprints are specified, only a single blueprint needs to be run to
        +   * signal that the test case was exercised.
        +   * 
        + * + * repeated .google.showcase.v1beta1.Test.Blueprint blueprints = 4; + */ + @java.lang.Override + public com.google.showcase.v1beta1.Test.Blueprint getBlueprints(int index) { + return blueprints_.get(index); + } + + /** + * + * + *
        +   * The blueprints that will satisfy this test. There may be multiple blueprints
        +   * that can signal to the server that this test case is being exercised. Although
        +   * multiple blueprints are specified, only a single blueprint needs to be run to
        +   * signal that the test case was exercised.
        +   * 
        + * + * repeated .google.showcase.v1beta1.Test.Blueprint blueprints = 4; + */ + @java.lang.Override + public com.google.showcase.v1beta1.Test.BlueprintOrBuilder getBlueprintsOrBuilder(int index) { + return blueprints_.get(index); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, name_); + } + if (expectationLevel_ + != com.google.showcase.v1beta1.Test.ExpectationLevel.EXPECTATION_LEVEL_UNSPECIFIED + .getNumber()) { + output.writeEnum(2, expectationLevel_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(description_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 3, description_); + } + for (int i = 0; i < blueprints_.size(); i++) { + output.writeMessage(4, blueprints_.get(i)); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, name_); + } + if (expectationLevel_ + != com.google.showcase.v1beta1.Test.ExpectationLevel.EXPECTATION_LEVEL_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(2, expectationLevel_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(description_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(3, description_); + } + for (int i = 0; i < blueprints_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, blueprints_.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.showcase.v1beta1.Test)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.Test other = (com.google.showcase.v1beta1.Test) obj; + + if (!getName().equals(other.getName())) return false; + if (expectationLevel_ != other.expectationLevel_) return false; + if (!getDescription().equals(other.getDescription())) return false; + if (!getBlueprintsList().equals(other.getBlueprintsList())) 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) + EXPECTATION_LEVEL_FIELD_NUMBER; + hash = (53 * hash) + expectationLevel_; + hash = (37 * hash) + DESCRIPTION_FIELD_NUMBER; + hash = (53 * hash) + getDescription().hashCode(); + if (getBlueprintsCount() > 0) { + hash = (37 * hash) + BLUEPRINTS_FIELD_NUMBER; + hash = (53 * hash) + getBlueprintsList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.showcase.v1beta1.Test parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.Test parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.Test parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.Test 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.showcase.v1beta1.Test parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.Test parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.Test parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.Test parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.showcase.v1beta1.Test parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.Test parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.showcase.v1beta1.Test parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.Test parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.showcase.v1beta1.Test 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** Protobuf type {@code google.showcase.v1beta1.Test} */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.Test) + com.google.showcase.v1beta1.TestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.TestingOuterClass + .internal_static_google_showcase_v1beta1_Test_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.TestingOuterClass + .internal_static_google_showcase_v1beta1_Test_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.Test.class, + com.google.showcase.v1beta1.Test.Builder.class); + } + + // Construct using com.google.showcase.v1beta1.Test.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + expectationLevel_ = 0; + description_ = ""; + if (blueprintsBuilder_ == null) { + blueprints_ = java.util.Collections.emptyList(); + } else { + blueprints_ = null; + blueprintsBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000008); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.showcase.v1beta1.TestingOuterClass + .internal_static_google_showcase_v1beta1_Test_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.Test getDefaultInstanceForType() { + return com.google.showcase.v1beta1.Test.getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.Test build() { + com.google.showcase.v1beta1.Test result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.Test buildPartial() { + com.google.showcase.v1beta1.Test result = new com.google.showcase.v1beta1.Test(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields(com.google.showcase.v1beta1.Test result) { + if (blueprintsBuilder_ == null) { + if (((bitField0_ & 0x00000008) != 0)) { + blueprints_ = java.util.Collections.unmodifiableList(blueprints_); + bitField0_ = (bitField0_ & ~0x00000008); + } + result.blueprints_ = blueprints_; + } else { + result.blueprints_ = blueprintsBuilder_.build(); + } + } + + private void buildPartial0(com.google.showcase.v1beta1.Test result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.expectationLevel_ = expectationLevel_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.description_ = description_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.showcase.v1beta1.Test) { + return mergeFrom((com.google.showcase.v1beta1.Test) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.showcase.v1beta1.Test other) { + if (other == com.google.showcase.v1beta1.Test.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.expectationLevel_ != 0) { + setExpectationLevelValue(other.getExpectationLevelValue()); + } + if (!other.getDescription().isEmpty()) { + description_ = other.description_; + bitField0_ |= 0x00000004; + onChanged(); + } + if (blueprintsBuilder_ == null) { + if (!other.blueprints_.isEmpty()) { + if (blueprints_.isEmpty()) { + blueprints_ = other.blueprints_; + bitField0_ = (bitField0_ & ~0x00000008); + } else { + ensureBlueprintsIsMutable(); + blueprints_.addAll(other.blueprints_); + } + onChanged(); + } + } else { + if (!other.blueprints_.isEmpty()) { + if (blueprintsBuilder_.isEmpty()) { + blueprintsBuilder_.dispose(); + blueprintsBuilder_ = null; + blueprints_ = other.blueprints_; + bitField0_ = (bitField0_ & ~0x00000008); + blueprintsBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders + ? internalGetBlueprintsFieldBuilder() + : null; + } else { + blueprintsBuilder_.addAllMessages(other.blueprints_); + } + } + } + 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 16: + { + expectationLevel_ = input.readEnum(); + bitField0_ |= 0x00000002; + break; + } // case 16 + case 26: + { + description_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 34: + { + com.google.showcase.v1beta1.Test.Blueprint m = + input.readMessage( + com.google.showcase.v1beta1.Test.Blueprint.parser(), extensionRegistry); + if (blueprintsBuilder_ == null) { + ensureBlueprintsIsMutable(); + blueprints_.add(m); + } else { + blueprintsBuilder_.addMessage(m); + } + 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_ = ""; + + /** + * + * + *
        +     * The name of the test.
        +     * The tests/* portion of the names are hard-coded, and do not change
        +     * from session to session.
        +     * 
        + * + * 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 name of the test.
        +     * The tests/* portion of the names are hard-coded, and do not change
        +     * from session to session.
        +     * 
        + * + * 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 name of the test.
        +     * The tests/* portion of the names are hard-coded, and do not change
        +     * from session to session.
        +     * 
        + * + * 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 name of the test.
        +     * The tests/* portion of the names are hard-coded, and do not change
        +     * from session to session.
        +     * 
        + * + * string name = 1; + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
        +     * The name of the test.
        +     * The tests/* portion of the names are hard-coded, and do not change
        +     * from session to session.
        +     * 
        + * + * 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 int expectationLevel_ = 0; + + /** + * + * + *
        +     * The expectation level for this test.
        +     * 
        + * + * .google.showcase.v1beta1.Test.ExpectationLevel expectation_level = 2; + * + * @return The enum numeric value on the wire for expectationLevel. + */ + @java.lang.Override + public int getExpectationLevelValue() { + return expectationLevel_; + } + + /** + * + * + *
        +     * The expectation level for this test.
        +     * 
        + * + * .google.showcase.v1beta1.Test.ExpectationLevel expectation_level = 2; + * + * @param value The enum numeric value on the wire for expectationLevel to set. + * @return This builder for chaining. + */ + public Builder setExpectationLevelValue(int value) { + expectationLevel_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
        +     * The expectation level for this test.
        +     * 
        + * + * .google.showcase.v1beta1.Test.ExpectationLevel expectation_level = 2; + * + * @return The expectationLevel. + */ + @java.lang.Override + public com.google.showcase.v1beta1.Test.ExpectationLevel getExpectationLevel() { + com.google.showcase.v1beta1.Test.ExpectationLevel result = + com.google.showcase.v1beta1.Test.ExpectationLevel.forNumber(expectationLevel_); + return result == null + ? com.google.showcase.v1beta1.Test.ExpectationLevel.UNRECOGNIZED + : result; + } + + /** + * + * + *
        +     * The expectation level for this test.
        +     * 
        + * + * .google.showcase.v1beta1.Test.ExpectationLevel expectation_level = 2; + * + * @param value The expectationLevel to set. + * @return This builder for chaining. + */ + public Builder setExpectationLevel(com.google.showcase.v1beta1.Test.ExpectationLevel value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000002; + expectationLevel_ = value.getNumber(); + onChanged(); + return this; + } + + /** + * + * + *
        +     * The expectation level for this test.
        +     * 
        + * + * .google.showcase.v1beta1.Test.ExpectationLevel expectation_level = 2; + * + * @return This builder for chaining. + */ + public Builder clearExpectationLevel() { + bitField0_ = (bitField0_ & ~0x00000002); + expectationLevel_ = 0; + onChanged(); + return this; + } + + private java.lang.Object description_ = ""; + + /** + * + * + *
        +     * A description of the test.
        +     * 
        + * + * 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; + } + } + + /** + * + * + *
        +     * A description of the test.
        +     * 
        + * + * 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; + } + } + + /** + * + * + *
        +     * A description of the test.
        +     * 
        + * + * 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_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
        +     * A description of the test.
        +     * 
        + * + * string description = 3; + * + * @return This builder for chaining. + */ + public Builder clearDescription() { + description_ = getDefaultInstance().getDescription(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + + /** + * + * + *
        +     * A description of the test.
        +     * 
        + * + * 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_ |= 0x00000004; + onChanged(); + return this; + } + + private java.util.List blueprints_ = + java.util.Collections.emptyList(); + + private void ensureBlueprintsIsMutable() { + if (!((bitField0_ & 0x00000008) != 0)) { + blueprints_ = + new java.util.ArrayList(blueprints_); + bitField0_ |= 0x00000008; + } + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.google.showcase.v1beta1.Test.Blueprint, + com.google.showcase.v1beta1.Test.Blueprint.Builder, + com.google.showcase.v1beta1.Test.BlueprintOrBuilder> + blueprintsBuilder_; + + /** + * + * + *
        +     * The blueprints that will satisfy this test. There may be multiple blueprints
        +     * that can signal to the server that this test case is being exercised. Although
        +     * multiple blueprints are specified, only a single blueprint needs to be run to
        +     * signal that the test case was exercised.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Test.Blueprint blueprints = 4; + */ + public java.util.List getBlueprintsList() { + if (blueprintsBuilder_ == null) { + return java.util.Collections.unmodifiableList(blueprints_); + } else { + return blueprintsBuilder_.getMessageList(); + } + } + + /** + * + * + *
        +     * The blueprints that will satisfy this test. There may be multiple blueprints
        +     * that can signal to the server that this test case is being exercised. Although
        +     * multiple blueprints are specified, only a single blueprint needs to be run to
        +     * signal that the test case was exercised.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Test.Blueprint blueprints = 4; + */ + public int getBlueprintsCount() { + if (blueprintsBuilder_ == null) { + return blueprints_.size(); + } else { + return blueprintsBuilder_.getCount(); + } + } + + /** + * + * + *
        +     * The blueprints that will satisfy this test. There may be multiple blueprints
        +     * that can signal to the server that this test case is being exercised. Although
        +     * multiple blueprints are specified, only a single blueprint needs to be run to
        +     * signal that the test case was exercised.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Test.Blueprint blueprints = 4; + */ + public com.google.showcase.v1beta1.Test.Blueprint getBlueprints(int index) { + if (blueprintsBuilder_ == null) { + return blueprints_.get(index); + } else { + return blueprintsBuilder_.getMessage(index); + } + } + + /** + * + * + *
        +     * The blueprints that will satisfy this test. There may be multiple blueprints
        +     * that can signal to the server that this test case is being exercised. Although
        +     * multiple blueprints are specified, only a single blueprint needs to be run to
        +     * signal that the test case was exercised.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Test.Blueprint blueprints = 4; + */ + public Builder setBlueprints(int index, com.google.showcase.v1beta1.Test.Blueprint value) { + if (blueprintsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureBlueprintsIsMutable(); + blueprints_.set(index, value); + onChanged(); + } else { + blueprintsBuilder_.setMessage(index, value); + } + return this; + } + + /** + * + * + *
        +     * The blueprints that will satisfy this test. There may be multiple blueprints
        +     * that can signal to the server that this test case is being exercised. Although
        +     * multiple blueprints are specified, only a single blueprint needs to be run to
        +     * signal that the test case was exercised.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Test.Blueprint blueprints = 4; + */ + public Builder setBlueprints( + int index, com.google.showcase.v1beta1.Test.Blueprint.Builder builderForValue) { + if (blueprintsBuilder_ == null) { + ensureBlueprintsIsMutable(); + blueprints_.set(index, builderForValue.build()); + onChanged(); + } else { + blueprintsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
        +     * The blueprints that will satisfy this test. There may be multiple blueprints
        +     * that can signal to the server that this test case is being exercised. Although
        +     * multiple blueprints are specified, only a single blueprint needs to be run to
        +     * signal that the test case was exercised.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Test.Blueprint blueprints = 4; + */ + public Builder addBlueprints(com.google.showcase.v1beta1.Test.Blueprint value) { + if (blueprintsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureBlueprintsIsMutable(); + blueprints_.add(value); + onChanged(); + } else { + blueprintsBuilder_.addMessage(value); + } + return this; + } + + /** + * + * + *
        +     * The blueprints that will satisfy this test. There may be multiple blueprints
        +     * that can signal to the server that this test case is being exercised. Although
        +     * multiple blueprints are specified, only a single blueprint needs to be run to
        +     * signal that the test case was exercised.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Test.Blueprint blueprints = 4; + */ + public Builder addBlueprints(int index, com.google.showcase.v1beta1.Test.Blueprint value) { + if (blueprintsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureBlueprintsIsMutable(); + blueprints_.add(index, value); + onChanged(); + } else { + blueprintsBuilder_.addMessage(index, value); + } + return this; + } + + /** + * + * + *
        +     * The blueprints that will satisfy this test. There may be multiple blueprints
        +     * that can signal to the server that this test case is being exercised. Although
        +     * multiple blueprints are specified, only a single blueprint needs to be run to
        +     * signal that the test case was exercised.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Test.Blueprint blueprints = 4; + */ + public Builder addBlueprints( + com.google.showcase.v1beta1.Test.Blueprint.Builder builderForValue) { + if (blueprintsBuilder_ == null) { + ensureBlueprintsIsMutable(); + blueprints_.add(builderForValue.build()); + onChanged(); + } else { + blueprintsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + + /** + * + * + *
        +     * The blueprints that will satisfy this test. There may be multiple blueprints
        +     * that can signal to the server that this test case is being exercised. Although
        +     * multiple blueprints are specified, only a single blueprint needs to be run to
        +     * signal that the test case was exercised.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Test.Blueprint blueprints = 4; + */ + public Builder addBlueprints( + int index, com.google.showcase.v1beta1.Test.Blueprint.Builder builderForValue) { + if (blueprintsBuilder_ == null) { + ensureBlueprintsIsMutable(); + blueprints_.add(index, builderForValue.build()); + onChanged(); + } else { + blueprintsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
        +     * The blueprints that will satisfy this test. There may be multiple blueprints
        +     * that can signal to the server that this test case is being exercised. Although
        +     * multiple blueprints are specified, only a single blueprint needs to be run to
        +     * signal that the test case was exercised.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Test.Blueprint blueprints = 4; + */ + public Builder addAllBlueprints( + java.lang.Iterable values) { + if (blueprintsBuilder_ == null) { + ensureBlueprintsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, blueprints_); + onChanged(); + } else { + blueprintsBuilder_.addAllMessages(values); + } + return this; + } + + /** + * + * + *
        +     * The blueprints that will satisfy this test. There may be multiple blueprints
        +     * that can signal to the server that this test case is being exercised. Although
        +     * multiple blueprints are specified, only a single blueprint needs to be run to
        +     * signal that the test case was exercised.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Test.Blueprint blueprints = 4; + */ + public Builder clearBlueprints() { + if (blueprintsBuilder_ == null) { + blueprints_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + } else { + blueprintsBuilder_.clear(); + } + return this; + } + + /** + * + * + *
        +     * The blueprints that will satisfy this test. There may be multiple blueprints
        +     * that can signal to the server that this test case is being exercised. Although
        +     * multiple blueprints are specified, only a single blueprint needs to be run to
        +     * signal that the test case was exercised.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Test.Blueprint blueprints = 4; + */ + public Builder removeBlueprints(int index) { + if (blueprintsBuilder_ == null) { + ensureBlueprintsIsMutable(); + blueprints_.remove(index); + onChanged(); + } else { + blueprintsBuilder_.remove(index); + } + return this; + } + + /** + * + * + *
        +     * The blueprints that will satisfy this test. There may be multiple blueprints
        +     * that can signal to the server that this test case is being exercised. Although
        +     * multiple blueprints are specified, only a single blueprint needs to be run to
        +     * signal that the test case was exercised.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Test.Blueprint blueprints = 4; + */ + public com.google.showcase.v1beta1.Test.Blueprint.Builder getBlueprintsBuilder(int index) { + return internalGetBlueprintsFieldBuilder().getBuilder(index); + } + + /** + * + * + *
        +     * The blueprints that will satisfy this test. There may be multiple blueprints
        +     * that can signal to the server that this test case is being exercised. Although
        +     * multiple blueprints are specified, only a single blueprint needs to be run to
        +     * signal that the test case was exercised.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Test.Blueprint blueprints = 4; + */ + public com.google.showcase.v1beta1.Test.BlueprintOrBuilder getBlueprintsOrBuilder(int index) { + if (blueprintsBuilder_ == null) { + return blueprints_.get(index); + } else { + return blueprintsBuilder_.getMessageOrBuilder(index); + } + } + + /** + * + * + *
        +     * The blueprints that will satisfy this test. There may be multiple blueprints
        +     * that can signal to the server that this test case is being exercised. Although
        +     * multiple blueprints are specified, only a single blueprint needs to be run to
        +     * signal that the test case was exercised.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Test.Blueprint blueprints = 4; + */ + public java.util.List + getBlueprintsOrBuilderList() { + if (blueprintsBuilder_ != null) { + return blueprintsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(blueprints_); + } + } + + /** + * + * + *
        +     * The blueprints that will satisfy this test. There may be multiple blueprints
        +     * that can signal to the server that this test case is being exercised. Although
        +     * multiple blueprints are specified, only a single blueprint needs to be run to
        +     * signal that the test case was exercised.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Test.Blueprint blueprints = 4; + */ + public com.google.showcase.v1beta1.Test.Blueprint.Builder addBlueprintsBuilder() { + return internalGetBlueprintsFieldBuilder() + .addBuilder(com.google.showcase.v1beta1.Test.Blueprint.getDefaultInstance()); + } + + /** + * + * + *
        +     * The blueprints that will satisfy this test. There may be multiple blueprints
        +     * that can signal to the server that this test case is being exercised. Although
        +     * multiple blueprints are specified, only a single blueprint needs to be run to
        +     * signal that the test case was exercised.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Test.Blueprint blueprints = 4; + */ + public com.google.showcase.v1beta1.Test.Blueprint.Builder addBlueprintsBuilder(int index) { + return internalGetBlueprintsFieldBuilder() + .addBuilder(index, com.google.showcase.v1beta1.Test.Blueprint.getDefaultInstance()); + } + + /** + * + * + *
        +     * The blueprints that will satisfy this test. There may be multiple blueprints
        +     * that can signal to the server that this test case is being exercised. Although
        +     * multiple blueprints are specified, only a single blueprint needs to be run to
        +     * signal that the test case was exercised.
        +     * 
        + * + * repeated .google.showcase.v1beta1.Test.Blueprint blueprints = 4; + */ + public java.util.List + getBlueprintsBuilderList() { + return internalGetBlueprintsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.google.showcase.v1beta1.Test.Blueprint, + com.google.showcase.v1beta1.Test.Blueprint.Builder, + com.google.showcase.v1beta1.Test.BlueprintOrBuilder> + internalGetBlueprintsFieldBuilder() { + if (blueprintsBuilder_ == null) { + blueprintsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilder< + com.google.showcase.v1beta1.Test.Blueprint, + com.google.showcase.v1beta1.Test.Blueprint.Builder, + com.google.showcase.v1beta1.Test.BlueprintOrBuilder>( + blueprints_, ((bitField0_ & 0x00000008) != 0), getParentForChildren(), isClean()); + blueprints_ = null; + } + return blueprintsBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.showcase.v1beta1.Test) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.Test) + private static final com.google.showcase.v1beta1.Test DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.Test(); + } + + public static com.google.showcase.v1beta1.Test getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Test 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.showcase.v1beta1.Test getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/TestName.java b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/TestName.java new file mode 100644 index 0000000000..34499c19fd --- /dev/null +++ b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/TestName.java @@ -0,0 +1,191 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1; + +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +@Generated("by gapic-generator-java") +public class TestName implements ResourceName { + private static final PathTemplate SESSION_TEST = + PathTemplate.createWithoutUrlEncoding("sessions/{session}/tests/{test}"); + private volatile Map fieldValuesMap; + private final String session; + private final String test; + + @Deprecated + protected TestName() { + session = null; + test = null; + } + + private TestName(Builder builder) { + session = Preconditions.checkNotNull(builder.getSession()); + test = Preconditions.checkNotNull(builder.getTest()); + } + + public String getSession() { + return session; + } + + public String getTest() { + return test; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + public static TestName of(String session, String test) { + return newBuilder().setSession(session).setTest(test).build(); + } + + public static String format(String session, String test) { + return newBuilder().setSession(session).setTest(test).build().toString(); + } + + public static TestName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + SESSION_TEST.validatedMatch( + formattedString, "TestName.parse: formattedString not in valid format"); + return of(matchMap.get("session"), matchMap.get("test")); + } + + 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 (TestName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return SESSION_TEST.matches(formattedString); + } + + @Override + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + if (session != null) { + fieldMapBuilder.put("session", session); + } + if (test != null) { + fieldMapBuilder.put("test", test); + } + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return SESSION_TEST.instantiate("session", session, "test", test); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o != null && getClass() == o.getClass()) { + TestName that = ((TestName) o); + return Objects.equals(this.session, that.session) && Objects.equals(this.test, that.test); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= Objects.hashCode(session); + h *= 1000003; + h ^= Objects.hashCode(test); + return h; + } + + /** Builder for sessions/{session}/tests/{test}. */ + public static class Builder { + private String session; + private String test; + + protected Builder() {} + + public String getSession() { + return session; + } + + public String getTest() { + return test; + } + + public Builder setSession(String session) { + this.session = session; + return this; + } + + public Builder setTest(String test) { + this.test = test; + return this; + } + + private Builder(TestName testName) { + this.session = testName.session; + this.test = testName.test; + } + + public TestName build() { + return new TestName(this); + } + } +} diff --git a/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/TestOrBuilder.java b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/TestOrBuilder.java new file mode 100644 index 0000000000..44bd7c7637 --- /dev/null +++ b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/TestOrBuilder.java @@ -0,0 +1,181 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: schema/google/showcase/v1beta1/testing.proto +// Protobuf Java Version: 4.33.2 + +package com.google.showcase.v1beta1; + +@com.google.protobuf.Generated +public interface TestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.Test) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
        +   * The name of the test.
        +   * The tests/* portion of the names are hard-coded, and do not change
        +   * from session to session.
        +   * 
        + * + * string name = 1; + * + * @return The name. + */ + java.lang.String getName(); + + /** + * + * + *
        +   * The name of the test.
        +   * The tests/* portion of the names are hard-coded, and do not change
        +   * from session to session.
        +   * 
        + * + * string name = 1; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
        +   * The expectation level for this test.
        +   * 
        + * + * .google.showcase.v1beta1.Test.ExpectationLevel expectation_level = 2; + * + * @return The enum numeric value on the wire for expectationLevel. + */ + int getExpectationLevelValue(); + + /** + * + * + *
        +   * The expectation level for this test.
        +   * 
        + * + * .google.showcase.v1beta1.Test.ExpectationLevel expectation_level = 2; + * + * @return The expectationLevel. + */ + com.google.showcase.v1beta1.Test.ExpectationLevel getExpectationLevel(); + + /** + * + * + *
        +   * A description of the test.
        +   * 
        + * + * string description = 3; + * + * @return The description. + */ + java.lang.String getDescription(); + + /** + * + * + *
        +   * A description of the test.
        +   * 
        + * + * string description = 3; + * + * @return The bytes for description. + */ + com.google.protobuf.ByteString getDescriptionBytes(); + + /** + * + * + *
        +   * The blueprints that will satisfy this test. There may be multiple blueprints
        +   * that can signal to the server that this test case is being exercised. Although
        +   * multiple blueprints are specified, only a single blueprint needs to be run to
        +   * signal that the test case was exercised.
        +   * 
        + * + * repeated .google.showcase.v1beta1.Test.Blueprint blueprints = 4; + */ + java.util.List getBlueprintsList(); + + /** + * + * + *
        +   * The blueprints that will satisfy this test. There may be multiple blueprints
        +   * that can signal to the server that this test case is being exercised. Although
        +   * multiple blueprints are specified, only a single blueprint needs to be run to
        +   * signal that the test case was exercised.
        +   * 
        + * + * repeated .google.showcase.v1beta1.Test.Blueprint blueprints = 4; + */ + com.google.showcase.v1beta1.Test.Blueprint getBlueprints(int index); + + /** + * + * + *
        +   * The blueprints that will satisfy this test. There may be multiple blueprints
        +   * that can signal to the server that this test case is being exercised. Although
        +   * multiple blueprints are specified, only a single blueprint needs to be run to
        +   * signal that the test case was exercised.
        +   * 
        + * + * repeated .google.showcase.v1beta1.Test.Blueprint blueprints = 4; + */ + int getBlueprintsCount(); + + /** + * + * + *
        +   * The blueprints that will satisfy this test. There may be multiple blueprints
        +   * that can signal to the server that this test case is being exercised. Although
        +   * multiple blueprints are specified, only a single blueprint needs to be run to
        +   * signal that the test case was exercised.
        +   * 
        + * + * repeated .google.showcase.v1beta1.Test.Blueprint blueprints = 4; + */ + java.util.List + getBlueprintsOrBuilderList(); + + /** + * + * + *
        +   * The blueprints that will satisfy this test. There may be multiple blueprints
        +   * that can signal to the server that this test case is being exercised. Although
        +   * multiple blueprints are specified, only a single blueprint needs to be run to
        +   * signal that the test case was exercised.
        +   * 
        + * + * repeated .google.showcase.v1beta1.Test.Blueprint blueprints = 4; + */ + com.google.showcase.v1beta1.Test.BlueprintOrBuilder getBlueprintsOrBuilder(int index); +} diff --git a/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/TestRun.java b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/TestRun.java new file mode 100644 index 0000000000..c47a79af96 --- /dev/null +++ b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/TestRun.java @@ -0,0 +1,889 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: schema/google/showcase/v1beta1/testing.proto +// Protobuf Java Version: 4.33.2 + +package com.google.showcase.v1beta1; + +/** + * + * + *
        + * A TestRun is the result of running a Test.
        + * 
        + * + * Protobuf type {@code google.showcase.v1beta1.TestRun} + */ +@com.google.protobuf.Generated +public final class TestRun extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.TestRun) + TestRunOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "TestRun"); + } + + // Use TestRun.newBuilder() to construct. + private TestRun(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private TestRun() { + test_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.TestingOuterClass + .internal_static_google_showcase_v1beta1_TestRun_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.TestingOuterClass + .internal_static_google_showcase_v1beta1_TestRun_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.TestRun.class, + com.google.showcase.v1beta1.TestRun.Builder.class); + } + + private int bitField0_; + public static final int TEST_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object test_ = ""; + + /** + * + * + *
        +   * The name of the test.
        +   * The tests/* portion of the names are hard-coded, and do not change
        +   * from session to session.
        +   * 
        + * + * string test = 1 [(.google.api.resource_reference) = { ... } + * + * @return The test. + */ + @java.lang.Override + public java.lang.String getTest() { + java.lang.Object ref = test_; + 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(); + test_ = s; + return s; + } + } + + /** + * + * + *
        +   * The name of the test.
        +   * The tests/* portion of the names are hard-coded, and do not change
        +   * from session to session.
        +   * 
        + * + * string test = 1 [(.google.api.resource_reference) = { ... } + * + * @return The bytes for test. + */ + @java.lang.Override + public com.google.protobuf.ByteString getTestBytes() { + java.lang.Object ref = test_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + test_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int ISSUE_FIELD_NUMBER = 2; + private com.google.showcase.v1beta1.Issue issue_; + + /** + * + * + *
        +   * An issue found with the test run. If empty, this test run was successful.
        +   * 
        + * + * .google.showcase.v1beta1.Issue issue = 2; + * + * @return Whether the issue field is set. + */ + @java.lang.Override + public boolean hasIssue() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
        +   * An issue found with the test run. If empty, this test run was successful.
        +   * 
        + * + * .google.showcase.v1beta1.Issue issue = 2; + * + * @return The issue. + */ + @java.lang.Override + public com.google.showcase.v1beta1.Issue getIssue() { + return issue_ == null ? com.google.showcase.v1beta1.Issue.getDefaultInstance() : issue_; + } + + /** + * + * + *
        +   * An issue found with the test run. If empty, this test run was successful.
        +   * 
        + * + * .google.showcase.v1beta1.Issue issue = 2; + */ + @java.lang.Override + public com.google.showcase.v1beta1.IssueOrBuilder getIssueOrBuilder() { + return issue_ == null ? com.google.showcase.v1beta1.Issue.getDefaultInstance() : issue_; + } + + 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.GeneratedMessage.isStringEmpty(test_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, test_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(2, getIssue()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(test_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, test_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getIssue()); + } + 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.showcase.v1beta1.TestRun)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.TestRun other = (com.google.showcase.v1beta1.TestRun) obj; + + if (!getTest().equals(other.getTest())) return false; + if (hasIssue() != other.hasIssue()) return false; + if (hasIssue()) { + if (!getIssue().equals(other.getIssue())) 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) + TEST_FIELD_NUMBER; + hash = (53 * hash) + getTest().hashCode(); + if (hasIssue()) { + hash = (37 * hash) + ISSUE_FIELD_NUMBER; + hash = (53 * hash) + getIssue().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.showcase.v1beta1.TestRun parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.TestRun parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.TestRun parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.TestRun 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.showcase.v1beta1.TestRun parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.TestRun parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.TestRun parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.TestRun parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.showcase.v1beta1.TestRun parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.TestRun parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.showcase.v1beta1.TestRun parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.TestRun parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.showcase.v1beta1.TestRun 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
        +   * A TestRun is the result of running a Test.
        +   * 
        + * + * Protobuf type {@code google.showcase.v1beta1.TestRun} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.TestRun) + com.google.showcase.v1beta1.TestRunOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.TestingOuterClass + .internal_static_google_showcase_v1beta1_TestRun_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.TestingOuterClass + .internal_static_google_showcase_v1beta1_TestRun_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.TestRun.class, + com.google.showcase.v1beta1.TestRun.Builder.class); + } + + // Construct using com.google.showcase.v1beta1.TestRun.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetIssueFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + test_ = ""; + issue_ = null; + if (issueBuilder_ != null) { + issueBuilder_.dispose(); + issueBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.showcase.v1beta1.TestingOuterClass + .internal_static_google_showcase_v1beta1_TestRun_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.TestRun getDefaultInstanceForType() { + return com.google.showcase.v1beta1.TestRun.getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.TestRun build() { + com.google.showcase.v1beta1.TestRun result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.TestRun buildPartial() { + com.google.showcase.v1beta1.TestRun result = new com.google.showcase.v1beta1.TestRun(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.showcase.v1beta1.TestRun result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.test_ = test_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.issue_ = issueBuilder_ == null ? issue_ : issueBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.showcase.v1beta1.TestRun) { + return mergeFrom((com.google.showcase.v1beta1.TestRun) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.showcase.v1beta1.TestRun other) { + if (other == com.google.showcase.v1beta1.TestRun.getDefaultInstance()) return this; + if (!other.getTest().isEmpty()) { + test_ = other.test_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.hasIssue()) { + mergeIssue(other.getIssue()); + } + 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: + { + test_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + input.readMessage(internalGetIssueFieldBuilder().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 test_ = ""; + + /** + * + * + *
        +     * The name of the test.
        +     * The tests/* portion of the names are hard-coded, and do not change
        +     * from session to session.
        +     * 
        + * + * string test = 1 [(.google.api.resource_reference) = { ... } + * + * @return The test. + */ + public java.lang.String getTest() { + java.lang.Object ref = test_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + test_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
        +     * The name of the test.
        +     * The tests/* portion of the names are hard-coded, and do not change
        +     * from session to session.
        +     * 
        + * + * string test = 1 [(.google.api.resource_reference) = { ... } + * + * @return The bytes for test. + */ + public com.google.protobuf.ByteString getTestBytes() { + java.lang.Object ref = test_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + test_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
        +     * The name of the test.
        +     * The tests/* portion of the names are hard-coded, and do not change
        +     * from session to session.
        +     * 
        + * + * string test = 1 [(.google.api.resource_reference) = { ... } + * + * @param value The test to set. + * @return This builder for chaining. + */ + public Builder setTest(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + test_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
        +     * The name of the test.
        +     * The tests/* portion of the names are hard-coded, and do not change
        +     * from session to session.
        +     * 
        + * + * string test = 1 [(.google.api.resource_reference) = { ... } + * + * @return This builder for chaining. + */ + public Builder clearTest() { + test_ = getDefaultInstance().getTest(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
        +     * The name of the test.
        +     * The tests/* portion of the names are hard-coded, and do not change
        +     * from session to session.
        +     * 
        + * + * string test = 1 [(.google.api.resource_reference) = { ... } + * + * @param value The bytes for test to set. + * @return This builder for chaining. + */ + public Builder setTestBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + test_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private com.google.showcase.v1beta1.Issue issue_; + private com.google.protobuf.SingleFieldBuilder< + com.google.showcase.v1beta1.Issue, + com.google.showcase.v1beta1.Issue.Builder, + com.google.showcase.v1beta1.IssueOrBuilder> + issueBuilder_; + + /** + * + * + *
        +     * An issue found with the test run. If empty, this test run was successful.
        +     * 
        + * + * .google.showcase.v1beta1.Issue issue = 2; + * + * @return Whether the issue field is set. + */ + public boolean hasIssue() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
        +     * An issue found with the test run. If empty, this test run was successful.
        +     * 
        + * + * .google.showcase.v1beta1.Issue issue = 2; + * + * @return The issue. + */ + public com.google.showcase.v1beta1.Issue getIssue() { + if (issueBuilder_ == null) { + return issue_ == null ? com.google.showcase.v1beta1.Issue.getDefaultInstance() : issue_; + } else { + return issueBuilder_.getMessage(); + } + } + + /** + * + * + *
        +     * An issue found with the test run. If empty, this test run was successful.
        +     * 
        + * + * .google.showcase.v1beta1.Issue issue = 2; + */ + public Builder setIssue(com.google.showcase.v1beta1.Issue value) { + if (issueBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + issue_ = value; + } else { + issueBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
        +     * An issue found with the test run. If empty, this test run was successful.
        +     * 
        + * + * .google.showcase.v1beta1.Issue issue = 2; + */ + public Builder setIssue(com.google.showcase.v1beta1.Issue.Builder builderForValue) { + if (issueBuilder_ == null) { + issue_ = builderForValue.build(); + } else { + issueBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
        +     * An issue found with the test run. If empty, this test run was successful.
        +     * 
        + * + * .google.showcase.v1beta1.Issue issue = 2; + */ + public Builder mergeIssue(com.google.showcase.v1beta1.Issue value) { + if (issueBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && issue_ != null + && issue_ != com.google.showcase.v1beta1.Issue.getDefaultInstance()) { + getIssueBuilder().mergeFrom(value); + } else { + issue_ = value; + } + } else { + issueBuilder_.mergeFrom(value); + } + if (issue_ != null) { + bitField0_ |= 0x00000002; + onChanged(); + } + return this; + } + + /** + * + * + *
        +     * An issue found with the test run. If empty, this test run was successful.
        +     * 
        + * + * .google.showcase.v1beta1.Issue issue = 2; + */ + public Builder clearIssue() { + bitField0_ = (bitField0_ & ~0x00000002); + issue_ = null; + if (issueBuilder_ != null) { + issueBuilder_.dispose(); + issueBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
        +     * An issue found with the test run. If empty, this test run was successful.
        +     * 
        + * + * .google.showcase.v1beta1.Issue issue = 2; + */ + public com.google.showcase.v1beta1.Issue.Builder getIssueBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return internalGetIssueFieldBuilder().getBuilder(); + } + + /** + * + * + *
        +     * An issue found with the test run. If empty, this test run was successful.
        +     * 
        + * + * .google.showcase.v1beta1.Issue issue = 2; + */ + public com.google.showcase.v1beta1.IssueOrBuilder getIssueOrBuilder() { + if (issueBuilder_ != null) { + return issueBuilder_.getMessageOrBuilder(); + } else { + return issue_ == null ? com.google.showcase.v1beta1.Issue.getDefaultInstance() : issue_; + } + } + + /** + * + * + *
        +     * An issue found with the test run. If empty, this test run was successful.
        +     * 
        + * + * .google.showcase.v1beta1.Issue issue = 2; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.showcase.v1beta1.Issue, + com.google.showcase.v1beta1.Issue.Builder, + com.google.showcase.v1beta1.IssueOrBuilder> + internalGetIssueFieldBuilder() { + if (issueBuilder_ == null) { + issueBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.showcase.v1beta1.Issue, + com.google.showcase.v1beta1.Issue.Builder, + com.google.showcase.v1beta1.IssueOrBuilder>( + getIssue(), getParentForChildren(), isClean()); + issue_ = null; + } + return issueBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.showcase.v1beta1.TestRun) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.TestRun) + private static final com.google.showcase.v1beta1.TestRun DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.TestRun(); + } + + public static com.google.showcase.v1beta1.TestRun getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public TestRun 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.showcase.v1beta1.TestRun getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/TestRunOrBuilder.java b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/TestRunOrBuilder.java new file mode 100644 index 0000000000..95a59163a8 --- /dev/null +++ b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/TestRunOrBuilder.java @@ -0,0 +1,95 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: schema/google/showcase/v1beta1/testing.proto +// Protobuf Java Version: 4.33.2 + +package com.google.showcase.v1beta1; + +@com.google.protobuf.Generated +public interface TestRunOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.TestRun) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
        +   * The name of the test.
        +   * The tests/* portion of the names are hard-coded, and do not change
        +   * from session to session.
        +   * 
        + * + * string test = 1 [(.google.api.resource_reference) = { ... } + * + * @return The test. + */ + java.lang.String getTest(); + + /** + * + * + *
        +   * The name of the test.
        +   * The tests/* portion of the names are hard-coded, and do not change
        +   * from session to session.
        +   * 
        + * + * string test = 1 [(.google.api.resource_reference) = { ... } + * + * @return The bytes for test. + */ + com.google.protobuf.ByteString getTestBytes(); + + /** + * + * + *
        +   * An issue found with the test run. If empty, this test run was successful.
        +   * 
        + * + * .google.showcase.v1beta1.Issue issue = 2; + * + * @return Whether the issue field is set. + */ + boolean hasIssue(); + + /** + * + * + *
        +   * An issue found with the test run. If empty, this test run was successful.
        +   * 
        + * + * .google.showcase.v1beta1.Issue issue = 2; + * + * @return The issue. + */ + com.google.showcase.v1beta1.Issue getIssue(); + + /** + * + * + *
        +   * An issue found with the test run. If empty, this test run was successful.
        +   * 
        + * + * .google.showcase.v1beta1.Issue issue = 2; + */ + com.google.showcase.v1beta1.IssueOrBuilder getIssueOrBuilder(); +} diff --git a/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/TestingOuterClass.java b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/TestingOuterClass.java new file mode 100644 index 0000000000..0a2e4f5a9f --- /dev/null +++ b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/TestingOuterClass.java @@ -0,0 +1,387 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: schema/google/showcase/v1beta1/testing.proto +// Protobuf Java Version: 4.33.2 + +package com.google.showcase.v1beta1; + +@com.google.protobuf.Generated +public final class TestingOuterClass extends com.google.protobuf.GeneratedFile { + private TestingOuterClass() {} + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "TestingOuterClass"); + } + + 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_showcase_v1beta1_Session_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_showcase_v1beta1_Session_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_showcase_v1beta1_CreateSessionRequest_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_showcase_v1beta1_CreateSessionRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_showcase_v1beta1_GetSessionRequest_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_showcase_v1beta1_GetSessionRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_showcase_v1beta1_ListSessionsRequest_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_showcase_v1beta1_ListSessionsRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_showcase_v1beta1_ListSessionsResponse_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_showcase_v1beta1_ListSessionsResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_showcase_v1beta1_DeleteSessionRequest_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_showcase_v1beta1_DeleteSessionRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_showcase_v1beta1_ReportSessionRequest_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_showcase_v1beta1_ReportSessionRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_showcase_v1beta1_ReportSessionResponse_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_showcase_v1beta1_ReportSessionResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_showcase_v1beta1_Test_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_showcase_v1beta1_Test_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_showcase_v1beta1_Test_Blueprint_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_showcase_v1beta1_Test_Blueprint_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_showcase_v1beta1_Test_Blueprint_Invocation_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_showcase_v1beta1_Test_Blueprint_Invocation_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_showcase_v1beta1_Issue_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_showcase_v1beta1_Issue_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_showcase_v1beta1_ListTestsRequest_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_showcase_v1beta1_ListTestsRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_showcase_v1beta1_ListTestsResponse_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_showcase_v1beta1_ListTestsResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_showcase_v1beta1_TestRun_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_showcase_v1beta1_TestRun_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_showcase_v1beta1_DeleteTestRequest_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_showcase_v1beta1_DeleteTestRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_showcase_v1beta1_VerifyTestRequest_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_showcase_v1beta1_VerifyTestRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_showcase_v1beta1_VerifyTestResponse_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_showcase_v1beta1_VerifyTestResponse_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,schema/google/showcase/v1beta1/testing" + + ".proto\022\027google.showcase.v1beta1\032\034google/" + + "api/annotations.proto\032\027google/api/client" + + ".proto\032\031google/api/resource.proto\032\033googl" + + "e/protobuf/empty.proto\"\311\001\n\007Session\022\014\n\004na" + + "me\030\001 \001(\t\0229\n\007version\030\002 \001(\0162(.google.showc" + + "ase.v1beta1.Session.Version\";\n\007Version\022\027" + + "\n\023VERSION_UNSPECIFIED\020\000\022\r\n\tV1_LATEST\020\001\022\010" + + "\n\004V1_0\020\002:8\352A5\n\037showcase.googleapis.com/S" + + "ession\022\022sessions/{session}\"I\n\024CreateSess" + + "ionRequest\0221\n\007session\030\001 \001(\0132 .google.sho" + + "wcase.v1beta1.Session\"G\n\021GetSessionReque" + + "st\0222\n\004name\030\001 \001(\tB$\372A!\n\037showcase.googleap" + + "is.com/Session\"<\n\023ListSessionsRequest\022\021\n" + + "\tpage_size\030\001 \001(\005\022\022\n\npage_token\030\002 \001(\t\"c\n\024" + + "ListSessionsResponse\0222\n\010sessions\030\001 \003(\0132 " + + ".google.showcase.v1beta1.Session\022\027\n\017next" + + "_page_token\030\002 \001(\t\"J\n\024DeleteSessionReques" + + "t\0222\n\004name\030\001 \001(\tB$\372A!\n\037showcase.googleapi" + + "s.com/Session\"J\n\024ReportSessionRequest\0222\n" + + "\004name\030\001 \001(\tB$\372A!\n\037showcase.googleapis.co" + + "m/Session\"\335\001\n\025ReportSessionResponse\022E\n\006r" + + "esult\030\001 \001(\01625.google.showcase.v1beta1.Re" + + "portSessionResponse.Result\0223\n\ttest_runs\030" + + "\002 \003(\0132 .google.showcase.v1beta1.TestRun\"" + + "H\n\006Result\022\026\n\022RESULT_UNSPECIFIED\020\000\022\n\n\006PAS" + + "SED\020\001\022\n\n\006FAILED\020\002\022\016\n\nINCOMPLETE\020\003\"\272\005\n\004Te" + + "st\022\014\n\004name\030\001 \001(\t\022I\n\021expectation_level\030\002 " + + "\001(\0162..google.showcase.v1beta1.Test.Expec" + + "tationLevel\022\023\n\013description\030\003 \001(\t\022;\n\nblue" + + "prints\030\004 \003(\0132\'.google.showcase.v1beta1.T" + + "est.Blueprint\032\336\002\n\tBlueprint\022\014\n\004name\030\001 \001(" + + "\t\022\023\n\013description\030\002 \001(\t\022C\n\007request\030\003 \001(\0132" + + "2.google.showcase.v1beta1.Test.Blueprint" + + ".Invocation\022O\n\023additional_requests\030\004 \003(\013" + + "22.google.showcase.v1beta1.Test.Blueprin" + + "t.Invocation\0328\n\nInvocation\022\016\n\006method\030\001 \001" + + "(\t\022\032\n\022serialized_request\030\002 \001(\014:^\352A[\n!sho" + + "wcase.googleapis.com/Blueprint\0226sessions" + + "/{session}/tests/{test}/blueprints/{blue" + + "print}\"b\n\020ExpectationLevel\022!\n\035EXPECTATIO" + + "N_LEVEL_UNSPECIFIED\020\000\022\014\n\010REQUIRED\020\001\022\017\n\013R" + + "ECOMMENDED\020\002\022\014\n\010OPTIONAL\020\003:B\352A?\n\034showcas" + + "e.googleapis.com/Test\022\037sessions/{session" + + "}/tests/{test}\"\234\002\n\005Issue\0221\n\004type\030\001 \001(\0162#" + + ".google.showcase.v1beta1.Issue.Type\0229\n\010s" + + "everity\030\002 \001(\0162\'.google.showcase.v1beta1." + + "Issue.Severity\022\023\n\013description\030\003 \001(\t\"R\n\004T" + + "ype\022\024\n\020TYPE_UNSPECIFIED\020\000\022\013\n\007SKIPPED\020\001\022\013" + + "\n\007PENDING\020\002\022\032\n\026INCORRECT_CONFIRMATION\020\003\"" + + "<\n\010Severity\022\030\n\024SEVERITY_UNSPECIFIED\020\000\022\t\n" + + "\005ERROR\020\001\022\013\n\007WARNING\020\002\"o\n\020ListTestsReques" + + "t\0224\n\006parent\030\001 \001(\tB$\372A!\n\037showcase.googlea" + + "pis.com/Session\022\021\n\tpage_size\030\002 \001(\005\022\022\n\npa" + + "ge_token\030\003 \001(\t\"Z\n\021ListTestsResponse\022,\n\005t" + + "ests\030\001 \003(\0132\035.google.showcase.v1beta1.Tes" + + "t\022\027\n\017next_page_token\030\002 \001(\t\"i\n\007TestRun\022/\n" + + "\004test\030\001 \001(\tB!\372A\036\n\034showcase.googleapis.co" + + "m/Test\022-\n\005issue\030\002 \001(\0132\036.google.showcase." + + "v1beta1.Issue\"D\n\021DeleteTestRequest\022/\n\004na" + + "me\030\001 \001(\tB!\372A\036\n\034showcase.googleapis.com/T" + + "est\"e\n\021VerifyTestRequest\022/\n\004name\030\001 \001(\tB!" + + "\372A\036\n\034showcase.googleapis.com/Test\022\016\n\006ans" + + "wer\030\002 \001(\014\022\017\n\007answers\030\003 \003(\014\"C\n\022VerifyTest" + + "Response\022-\n\005issue\030\001 \001(\0132\036.google.showcas" + + "e.v1beta1.Issue2\355\010\n\007Testing\022\204\001\n\rCreateSe" + + "ssion\022-.google.showcase.v1beta1.CreateSe" + + "ssionRequest\032 .google.showcase.v1beta1.S" + + "ession\"\"\202\323\344\223\002\034\"\021/v1beta1/sessions:\007sessi" + + "on\022~\n\nGetSession\022*.google.showcase.v1bet" + + "a1.GetSessionRequest\032 .google.showcase.v" + + "1beta1.Session\"\"\202\323\344\223\002\034\022\032/v1beta1/{name=s" + + "essions/*}\022\206\001\n\014ListSessions\022,.google.sho" + + "wcase.v1beta1.ListSessionsRequest\032-.goog" + + "le.showcase.v1beta1.ListSessionsResponse" + + "\"\031\202\323\344\223\002\023\022\021/v1beta1/sessions\022z\n\rDeleteSes" + + "sion\022-.google.showcase.v1beta1.DeleteSes" + + "sionRequest\032\026.google.protobuf.Empty\"\"\202\323\344" + + "\223\002\034*\032/v1beta1/{name=sessions/*}\022\231\001\n\rRepo" + + "rtSession\022-.google.showcase.v1beta1.Repo" + + "rtSessionRequest\032..google.showcase.v1bet" + + "a1.ReportSessionResponse\")\202\323\344\223\002#\"!/v1bet" + + "a1/{name=sessions/*}:report\022\216\001\n\tListTest" + + "s\022).google.showcase.v1beta1.ListTestsReq" + + "uest\032*.google.showcase.v1beta1.ListTests" + + "Response\"*\202\323\344\223\002$\022\"/v1beta1/{parent=sessi" + + "ons/*}/tests\022|\n\nDeleteTest\022*.google.show" + + "case.v1beta1.DeleteTestRequest\032\026.google." + + "protobuf.Empty\"*\202\323\344\223\002$*\"/v1beta1/{name=s" + + "essions/*/tests/*}\022\227\001\n\nVerifyTest\022*.goog" + + "le.showcase.v1beta1.VerifyTestRequest\032+." + + "google.showcase.v1beta1.VerifyTestRespon" + + "se\"0\202\323\344\223\002*\"(/v1beta1/{name=sessions/*/te" + + "sts/*}:check\032\021\312A\016localhost:7469Bq\n\033com.g" + + "oogle.showcase.v1beta1P\001Z4github.com/goo" + + "gleapis/gapic-showcase/server/genproto\352\002" + + "\031Google::Showcase::V1beta1b\006proto3" + }; + descriptor = + com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( + descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + com.google.api.AnnotationsProto.getDescriptor(), + com.google.api.ClientProto.getDescriptor(), + com.google.api.ResourceProto.getDescriptor(), + com.google.protobuf.EmptyProto.getDescriptor(), + }); + internal_static_google_showcase_v1beta1_Session_descriptor = getDescriptor().getMessageType(0); + internal_static_google_showcase_v1beta1_Session_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_showcase_v1beta1_Session_descriptor, + new java.lang.String[] { + "Name", "Version", + }); + internal_static_google_showcase_v1beta1_CreateSessionRequest_descriptor = + getDescriptor().getMessageType(1); + internal_static_google_showcase_v1beta1_CreateSessionRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_showcase_v1beta1_CreateSessionRequest_descriptor, + new java.lang.String[] { + "Session", + }); + internal_static_google_showcase_v1beta1_GetSessionRequest_descriptor = + getDescriptor().getMessageType(2); + internal_static_google_showcase_v1beta1_GetSessionRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_showcase_v1beta1_GetSessionRequest_descriptor, + new java.lang.String[] { + "Name", + }); + internal_static_google_showcase_v1beta1_ListSessionsRequest_descriptor = + getDescriptor().getMessageType(3); + internal_static_google_showcase_v1beta1_ListSessionsRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_showcase_v1beta1_ListSessionsRequest_descriptor, + new java.lang.String[] { + "PageSize", "PageToken", + }); + internal_static_google_showcase_v1beta1_ListSessionsResponse_descriptor = + getDescriptor().getMessageType(4); + internal_static_google_showcase_v1beta1_ListSessionsResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_showcase_v1beta1_ListSessionsResponse_descriptor, + new java.lang.String[] { + "Sessions", "NextPageToken", + }); + internal_static_google_showcase_v1beta1_DeleteSessionRequest_descriptor = + getDescriptor().getMessageType(5); + internal_static_google_showcase_v1beta1_DeleteSessionRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_showcase_v1beta1_DeleteSessionRequest_descriptor, + new java.lang.String[] { + "Name", + }); + internal_static_google_showcase_v1beta1_ReportSessionRequest_descriptor = + getDescriptor().getMessageType(6); + internal_static_google_showcase_v1beta1_ReportSessionRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_showcase_v1beta1_ReportSessionRequest_descriptor, + new java.lang.String[] { + "Name", + }); + internal_static_google_showcase_v1beta1_ReportSessionResponse_descriptor = + getDescriptor().getMessageType(7); + internal_static_google_showcase_v1beta1_ReportSessionResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_showcase_v1beta1_ReportSessionResponse_descriptor, + new java.lang.String[] { + "Result", "TestRuns", + }); + internal_static_google_showcase_v1beta1_Test_descriptor = getDescriptor().getMessageType(8); + internal_static_google_showcase_v1beta1_Test_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_showcase_v1beta1_Test_descriptor, + new java.lang.String[] { + "Name", "ExpectationLevel", "Description", "Blueprints", + }); + internal_static_google_showcase_v1beta1_Test_Blueprint_descriptor = + internal_static_google_showcase_v1beta1_Test_descriptor.getNestedType(0); + internal_static_google_showcase_v1beta1_Test_Blueprint_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_showcase_v1beta1_Test_Blueprint_descriptor, + new java.lang.String[] { + "Name", "Description", "Request", "AdditionalRequests", + }); + internal_static_google_showcase_v1beta1_Test_Blueprint_Invocation_descriptor = + internal_static_google_showcase_v1beta1_Test_Blueprint_descriptor.getNestedType(0); + internal_static_google_showcase_v1beta1_Test_Blueprint_Invocation_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_showcase_v1beta1_Test_Blueprint_Invocation_descriptor, + new java.lang.String[] { + "Method", "SerializedRequest", + }); + internal_static_google_showcase_v1beta1_Issue_descriptor = getDescriptor().getMessageType(9); + internal_static_google_showcase_v1beta1_Issue_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_showcase_v1beta1_Issue_descriptor, + new java.lang.String[] { + "Type", "Severity", "Description", + }); + internal_static_google_showcase_v1beta1_ListTestsRequest_descriptor = + getDescriptor().getMessageType(10); + internal_static_google_showcase_v1beta1_ListTestsRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_showcase_v1beta1_ListTestsRequest_descriptor, + new java.lang.String[] { + "Parent", "PageSize", "PageToken", + }); + internal_static_google_showcase_v1beta1_ListTestsResponse_descriptor = + getDescriptor().getMessageType(11); + internal_static_google_showcase_v1beta1_ListTestsResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_showcase_v1beta1_ListTestsResponse_descriptor, + new java.lang.String[] { + "Tests", "NextPageToken", + }); + internal_static_google_showcase_v1beta1_TestRun_descriptor = getDescriptor().getMessageType(12); + internal_static_google_showcase_v1beta1_TestRun_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_showcase_v1beta1_TestRun_descriptor, + new java.lang.String[] { + "Test", "Issue", + }); + internal_static_google_showcase_v1beta1_DeleteTestRequest_descriptor = + getDescriptor().getMessageType(13); + internal_static_google_showcase_v1beta1_DeleteTestRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_showcase_v1beta1_DeleteTestRequest_descriptor, + new java.lang.String[] { + "Name", + }); + internal_static_google_showcase_v1beta1_VerifyTestRequest_descriptor = + getDescriptor().getMessageType(14); + internal_static_google_showcase_v1beta1_VerifyTestRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_showcase_v1beta1_VerifyTestRequest_descriptor, + new java.lang.String[] { + "Name", "Answer", "Answers", + }); + internal_static_google_showcase_v1beta1_VerifyTestResponse_descriptor = + getDescriptor().getMessageType(15); + internal_static_google_showcase_v1beta1_VerifyTestResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_showcase_v1beta1_VerifyTestResponse_descriptor, + new java.lang.String[] { + "Issue", + }); + descriptor.resolveAllFeaturesImmutable(); + com.google.api.AnnotationsProto.getDescriptor(); + com.google.api.ClientProto.getDescriptor(); + com.google.api.ResourceProto.getDescriptor(); + com.google.protobuf.EmptyProto.getDescriptor(); + com.google.protobuf.ExtensionRegistry registry = + com.google.protobuf.ExtensionRegistry.newInstance(); + registry.add(com.google.api.ClientProto.defaultHost); + registry.add(com.google.api.AnnotationsProto.http); + registry.add(com.google.api.ResourceProto.resource); + registry.add(com.google.api.ResourceProto.resourceReference); + com.google.protobuf.Descriptors.FileDescriptor.internalUpdateFileDescriptor( + descriptor, registry); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/UpdateBlurbRequest.java b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/UpdateBlurbRequest.java new file mode 100644 index 0000000000..84e4eae05b --- /dev/null +++ b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/UpdateBlurbRequest.java @@ -0,0 +1,979 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: schema/google/showcase/v1beta1/messaging.proto +// Protobuf Java Version: 4.33.2 + +package com.google.showcase.v1beta1; + +/** + * + * + *
        + * The request message for the google.showcase.v1beta1.Messaging\UpdateBlurb
        + * method.
        + * 
        + * + * Protobuf type {@code google.showcase.v1beta1.UpdateBlurbRequest} + */ +@com.google.protobuf.Generated +public final class UpdateBlurbRequest extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.UpdateBlurbRequest) + UpdateBlurbRequestOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "UpdateBlurbRequest"); + } + + // Use UpdateBlurbRequest.newBuilder() to construct. + private UpdateBlurbRequest(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private UpdateBlurbRequest() {} + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.MessagingOuterClass + .internal_static_google_showcase_v1beta1_UpdateBlurbRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.MessagingOuterClass + .internal_static_google_showcase_v1beta1_UpdateBlurbRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.UpdateBlurbRequest.class, + com.google.showcase.v1beta1.UpdateBlurbRequest.Builder.class); + } + + private int bitField0_; + public static final int BLURB_FIELD_NUMBER = 1; + private com.google.showcase.v1beta1.Blurb blurb_; + + /** + * + * + *
        +   * The blurb to update.
        +   * 
        + * + * .google.showcase.v1beta1.Blurb blurb = 1; + * + * @return Whether the blurb field is set. + */ + @java.lang.Override + public boolean hasBlurb() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
        +   * The blurb to update.
        +   * 
        + * + * .google.showcase.v1beta1.Blurb blurb = 1; + * + * @return The blurb. + */ + @java.lang.Override + public com.google.showcase.v1beta1.Blurb getBlurb() { + return blurb_ == null ? com.google.showcase.v1beta1.Blurb.getDefaultInstance() : blurb_; + } + + /** + * + * + *
        +   * The blurb to update.
        +   * 
        + * + * .google.showcase.v1beta1.Blurb blurb = 1; + */ + @java.lang.Override + public com.google.showcase.v1beta1.BlurbOrBuilder getBlurbOrBuilder() { + return blurb_ == null ? com.google.showcase.v1beta1.Blurb.getDefaultInstance() : blurb_; + } + + public static final int UPDATE_MASK_FIELD_NUMBER = 2; + private com.google.protobuf.FieldMask updateMask_; + + /** + * + * + *
        +   * The field mask to determine which fields are to be updated. If empty, the
        +   * server will assume all fields are to be updated.
        +   * 
        + * + * .google.protobuf.FieldMask update_mask = 2; + * + * @return Whether the updateMask field is set. + */ + @java.lang.Override + public boolean hasUpdateMask() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
        +   * The field mask to determine which fields are to be updated. If empty, the
        +   * server will assume all fields are to be updated.
        +   * 
        + * + * .google.protobuf.FieldMask update_mask = 2; + * + * @return The updateMask. + */ + @java.lang.Override + public com.google.protobuf.FieldMask getUpdateMask() { + return updateMask_ == null ? com.google.protobuf.FieldMask.getDefaultInstance() : updateMask_; + } + + /** + * + * + *
        +   * The field mask to determine which fields are to be updated. If empty, the
        +   * server will assume all fields are to be updated.
        +   * 
        + * + * .google.protobuf.FieldMask update_mask = 2; + */ + @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 (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(1, getBlurb()); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeMessage(2, getUpdateMask()); + } + 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, getBlurb()); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, 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.showcase.v1beta1.UpdateBlurbRequest)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.UpdateBlurbRequest other = + (com.google.showcase.v1beta1.UpdateBlurbRequest) obj; + + if (hasBlurb() != other.hasBlurb()) return false; + if (hasBlurb()) { + if (!getBlurb().equals(other.getBlurb())) 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(); + if (hasBlurb()) { + hash = (37 * hash) + BLURB_FIELD_NUMBER; + hash = (53 * hash) + getBlurb().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.showcase.v1beta1.UpdateBlurbRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.UpdateBlurbRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.UpdateBlurbRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.UpdateBlurbRequest 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.showcase.v1beta1.UpdateBlurbRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.UpdateBlurbRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.UpdateBlurbRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.UpdateBlurbRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.showcase.v1beta1.UpdateBlurbRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.UpdateBlurbRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.showcase.v1beta1.UpdateBlurbRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.UpdateBlurbRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.showcase.v1beta1.UpdateBlurbRequest 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
        +   * The request message for the google.showcase.v1beta1.Messaging\UpdateBlurb
        +   * method.
        +   * 
        + * + * Protobuf type {@code google.showcase.v1beta1.UpdateBlurbRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.UpdateBlurbRequest) + com.google.showcase.v1beta1.UpdateBlurbRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.MessagingOuterClass + .internal_static_google_showcase_v1beta1_UpdateBlurbRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.MessagingOuterClass + .internal_static_google_showcase_v1beta1_UpdateBlurbRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.UpdateBlurbRequest.class, + com.google.showcase.v1beta1.UpdateBlurbRequest.Builder.class); + } + + // Construct using com.google.showcase.v1beta1.UpdateBlurbRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetBlurbFieldBuilder(); + internalGetUpdateMaskFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + blurb_ = null; + if (blurbBuilder_ != null) { + blurbBuilder_.dispose(); + blurbBuilder_ = 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.showcase.v1beta1.MessagingOuterClass + .internal_static_google_showcase_v1beta1_UpdateBlurbRequest_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.UpdateBlurbRequest getDefaultInstanceForType() { + return com.google.showcase.v1beta1.UpdateBlurbRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.UpdateBlurbRequest build() { + com.google.showcase.v1beta1.UpdateBlurbRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.UpdateBlurbRequest buildPartial() { + com.google.showcase.v1beta1.UpdateBlurbRequest result = + new com.google.showcase.v1beta1.UpdateBlurbRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.showcase.v1beta1.UpdateBlurbRequest result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.blurb_ = blurbBuilder_ == null ? blurb_ : blurbBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.updateMask_ = updateMaskBuilder_ == null ? updateMask_ : updateMaskBuilder_.build(); + to_bitField0_ |= 0x00000002; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.showcase.v1beta1.UpdateBlurbRequest) { + return mergeFrom((com.google.showcase.v1beta1.UpdateBlurbRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.showcase.v1beta1.UpdateBlurbRequest other) { + if (other == com.google.showcase.v1beta1.UpdateBlurbRequest.getDefaultInstance()) return this; + if (other.hasBlurb()) { + mergeBlurb(other.getBlurb()); + } + 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: + { + input.readMessage(internalGetBlurbFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + input.readMessage( + internalGetUpdateMaskFieldBuilder().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 com.google.showcase.v1beta1.Blurb blurb_; + private com.google.protobuf.SingleFieldBuilder< + com.google.showcase.v1beta1.Blurb, + com.google.showcase.v1beta1.Blurb.Builder, + com.google.showcase.v1beta1.BlurbOrBuilder> + blurbBuilder_; + + /** + * + * + *
        +     * The blurb to update.
        +     * 
        + * + * .google.showcase.v1beta1.Blurb blurb = 1; + * + * @return Whether the blurb field is set. + */ + public boolean hasBlurb() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
        +     * The blurb to update.
        +     * 
        + * + * .google.showcase.v1beta1.Blurb blurb = 1; + * + * @return The blurb. + */ + public com.google.showcase.v1beta1.Blurb getBlurb() { + if (blurbBuilder_ == null) { + return blurb_ == null ? com.google.showcase.v1beta1.Blurb.getDefaultInstance() : blurb_; + } else { + return blurbBuilder_.getMessage(); + } + } + + /** + * + * + *
        +     * The blurb to update.
        +     * 
        + * + * .google.showcase.v1beta1.Blurb blurb = 1; + */ + public Builder setBlurb(com.google.showcase.v1beta1.Blurb value) { + if (blurbBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + blurb_ = value; + } else { + blurbBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
        +     * The blurb to update.
        +     * 
        + * + * .google.showcase.v1beta1.Blurb blurb = 1; + */ + public Builder setBlurb(com.google.showcase.v1beta1.Blurb.Builder builderForValue) { + if (blurbBuilder_ == null) { + blurb_ = builderForValue.build(); + } else { + blurbBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
        +     * The blurb to update.
        +     * 
        + * + * .google.showcase.v1beta1.Blurb blurb = 1; + */ + public Builder mergeBlurb(com.google.showcase.v1beta1.Blurb value) { + if (blurbBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) + && blurb_ != null + && blurb_ != com.google.showcase.v1beta1.Blurb.getDefaultInstance()) { + getBlurbBuilder().mergeFrom(value); + } else { + blurb_ = value; + } + } else { + blurbBuilder_.mergeFrom(value); + } + if (blurb_ != null) { + bitField0_ |= 0x00000001; + onChanged(); + } + return this; + } + + /** + * + * + *
        +     * The blurb to update.
        +     * 
        + * + * .google.showcase.v1beta1.Blurb blurb = 1; + */ + public Builder clearBlurb() { + bitField0_ = (bitField0_ & ~0x00000001); + blurb_ = null; + if (blurbBuilder_ != null) { + blurbBuilder_.dispose(); + blurbBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
        +     * The blurb to update.
        +     * 
        + * + * .google.showcase.v1beta1.Blurb blurb = 1; + */ + public com.google.showcase.v1beta1.Blurb.Builder getBlurbBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return internalGetBlurbFieldBuilder().getBuilder(); + } + + /** + * + * + *
        +     * The blurb to update.
        +     * 
        + * + * .google.showcase.v1beta1.Blurb blurb = 1; + */ + public com.google.showcase.v1beta1.BlurbOrBuilder getBlurbOrBuilder() { + if (blurbBuilder_ != null) { + return blurbBuilder_.getMessageOrBuilder(); + } else { + return blurb_ == null ? com.google.showcase.v1beta1.Blurb.getDefaultInstance() : blurb_; + } + } + + /** + * + * + *
        +     * The blurb to update.
        +     * 
        + * + * .google.showcase.v1beta1.Blurb blurb = 1; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.showcase.v1beta1.Blurb, + com.google.showcase.v1beta1.Blurb.Builder, + com.google.showcase.v1beta1.BlurbOrBuilder> + internalGetBlurbFieldBuilder() { + if (blurbBuilder_ == null) { + blurbBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.showcase.v1beta1.Blurb, + com.google.showcase.v1beta1.Blurb.Builder, + com.google.showcase.v1beta1.BlurbOrBuilder>( + getBlurb(), getParentForChildren(), isClean()); + blurb_ = null; + } + return blurbBuilder_; + } + + private com.google.protobuf.FieldMask updateMask_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder> + updateMaskBuilder_; + + /** + * + * + *
        +     * The field mask to determine which fields are to be updated. If empty, the
        +     * server will assume all fields are to be updated.
        +     * 
        + * + * .google.protobuf.FieldMask update_mask = 2; + * + * @return Whether the updateMask field is set. + */ + public boolean hasUpdateMask() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
        +     * The field mask to determine which fields are to be updated. If empty, the
        +     * server will assume all fields are to be updated.
        +     * 
        + * + * .google.protobuf.FieldMask update_mask = 2; + * + * @return The updateMask. + */ + public com.google.protobuf.FieldMask getUpdateMask() { + if (updateMaskBuilder_ == null) { + return updateMask_ == null + ? com.google.protobuf.FieldMask.getDefaultInstance() + : updateMask_; + } else { + return updateMaskBuilder_.getMessage(); + } + } + + /** + * + * + *
        +     * The field mask to determine which fields are to be updated. If empty, the
        +     * server will assume all fields are to be updated.
        +     * 
        + * + * .google.protobuf.FieldMask update_mask = 2; + */ + public Builder setUpdateMask(com.google.protobuf.FieldMask value) { + if (updateMaskBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + updateMask_ = value; + } else { + updateMaskBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
        +     * The field mask to determine which fields are to be updated. If empty, the
        +     * server will assume all fields are to be updated.
        +     * 
        + * + * .google.protobuf.FieldMask update_mask = 2; + */ + public Builder setUpdateMask(com.google.protobuf.FieldMask.Builder builderForValue) { + if (updateMaskBuilder_ == null) { + updateMask_ = builderForValue.build(); + } else { + updateMaskBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
        +     * The field mask to determine which fields are to be updated. If empty, the
        +     * server will assume all fields are to be updated.
        +     * 
        + * + * .google.protobuf.FieldMask update_mask = 2; + */ + public Builder mergeUpdateMask(com.google.protobuf.FieldMask value) { + if (updateMaskBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && updateMask_ != null + && updateMask_ != com.google.protobuf.FieldMask.getDefaultInstance()) { + getUpdateMaskBuilder().mergeFrom(value); + } else { + updateMask_ = value; + } + } else { + updateMaskBuilder_.mergeFrom(value); + } + if (updateMask_ != null) { + bitField0_ |= 0x00000002; + onChanged(); + } + return this; + } + + /** + * + * + *
        +     * The field mask to determine which fields are to be updated. If empty, the
        +     * server will assume all fields are to be updated.
        +     * 
        + * + * .google.protobuf.FieldMask update_mask = 2; + */ + public Builder clearUpdateMask() { + bitField0_ = (bitField0_ & ~0x00000002); + updateMask_ = null; + if (updateMaskBuilder_ != null) { + updateMaskBuilder_.dispose(); + updateMaskBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
        +     * The field mask to determine which fields are to be updated. If empty, the
        +     * server will assume all fields are to be updated.
        +     * 
        + * + * .google.protobuf.FieldMask update_mask = 2; + */ + public com.google.protobuf.FieldMask.Builder getUpdateMaskBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return internalGetUpdateMaskFieldBuilder().getBuilder(); + } + + /** + * + * + *
        +     * The field mask to determine which fields are to be updated. If empty, the
        +     * server will assume all fields are to be updated.
        +     * 
        + * + * .google.protobuf.FieldMask update_mask = 2; + */ + public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { + if (updateMaskBuilder_ != null) { + return updateMaskBuilder_.getMessageOrBuilder(); + } else { + return updateMask_ == null + ? com.google.protobuf.FieldMask.getDefaultInstance() + : updateMask_; + } + } + + /** + * + * + *
        +     * The field mask to determine which fields are to be updated. If empty, the
        +     * server will assume all fields are to be updated.
        +     * 
        + * + * .google.protobuf.FieldMask update_mask = 2; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder> + internalGetUpdateMaskFieldBuilder() { + if (updateMaskBuilder_ == null) { + updateMaskBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder>( + getUpdateMask(), getParentForChildren(), isClean()); + updateMask_ = null; + } + return updateMaskBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.showcase.v1beta1.UpdateBlurbRequest) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.UpdateBlurbRequest) + private static final com.google.showcase.v1beta1.UpdateBlurbRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.UpdateBlurbRequest(); + } + + public static com.google.showcase.v1beta1.UpdateBlurbRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public UpdateBlurbRequest 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.showcase.v1beta1.UpdateBlurbRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/UpdateBlurbRequestOrBuilder.java b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/UpdateBlurbRequestOrBuilder.java new file mode 100644 index 0000000000..2da432f22e --- /dev/null +++ b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/UpdateBlurbRequestOrBuilder.java @@ -0,0 +1,105 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: schema/google/showcase/v1beta1/messaging.proto +// Protobuf Java Version: 4.33.2 + +package com.google.showcase.v1beta1; + +@com.google.protobuf.Generated +public interface UpdateBlurbRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.UpdateBlurbRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
        +   * The blurb to update.
        +   * 
        + * + * .google.showcase.v1beta1.Blurb blurb = 1; + * + * @return Whether the blurb field is set. + */ + boolean hasBlurb(); + + /** + * + * + *
        +   * The blurb to update.
        +   * 
        + * + * .google.showcase.v1beta1.Blurb blurb = 1; + * + * @return The blurb. + */ + com.google.showcase.v1beta1.Blurb getBlurb(); + + /** + * + * + *
        +   * The blurb to update.
        +   * 
        + * + * .google.showcase.v1beta1.Blurb blurb = 1; + */ + com.google.showcase.v1beta1.BlurbOrBuilder getBlurbOrBuilder(); + + /** + * + * + *
        +   * The field mask to determine which fields are to be updated. If empty, the
        +   * server will assume all fields are to be updated.
        +   * 
        + * + * .google.protobuf.FieldMask update_mask = 2; + * + * @return Whether the updateMask field is set. + */ + boolean hasUpdateMask(); + + /** + * + * + *
        +   * The field mask to determine which fields are to be updated. If empty, the
        +   * server will assume all fields are to be updated.
        +   * 
        + * + * .google.protobuf.FieldMask update_mask = 2; + * + * @return The updateMask. + */ + com.google.protobuf.FieldMask getUpdateMask(); + + /** + * + * + *
        +   * The field mask to determine which fields are to be updated. If empty, the
        +   * server will assume all fields are to be updated.
        +   * 
        + * + * .google.protobuf.FieldMask update_mask = 2; + */ + com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder(); +} diff --git a/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/UpdateRoomRequest.java b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/UpdateRoomRequest.java new file mode 100644 index 0000000000..77e886e1b3 --- /dev/null +++ b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/UpdateRoomRequest.java @@ -0,0 +1,979 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: schema/google/showcase/v1beta1/messaging.proto +// Protobuf Java Version: 4.33.2 + +package com.google.showcase.v1beta1; + +/** + * + * + *
        + * The request message for the google.showcase.v1beta1.Messaging\UpdateRoom
        + * method.
        + * 
        + * + * Protobuf type {@code google.showcase.v1beta1.UpdateRoomRequest} + */ +@com.google.protobuf.Generated +public final class UpdateRoomRequest extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.UpdateRoomRequest) + UpdateRoomRequestOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "UpdateRoomRequest"); + } + + // Use UpdateRoomRequest.newBuilder() to construct. + private UpdateRoomRequest(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private UpdateRoomRequest() {} + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.MessagingOuterClass + .internal_static_google_showcase_v1beta1_UpdateRoomRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.MessagingOuterClass + .internal_static_google_showcase_v1beta1_UpdateRoomRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.UpdateRoomRequest.class, + com.google.showcase.v1beta1.UpdateRoomRequest.Builder.class); + } + + private int bitField0_; + public static final int ROOM_FIELD_NUMBER = 1; + private com.google.showcase.v1beta1.Room room_; + + /** + * + * + *
        +   * The room to update.
        +   * 
        + * + * .google.showcase.v1beta1.Room room = 1; + * + * @return Whether the room field is set. + */ + @java.lang.Override + public boolean hasRoom() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
        +   * The room to update.
        +   * 
        + * + * .google.showcase.v1beta1.Room room = 1; + * + * @return The room. + */ + @java.lang.Override + public com.google.showcase.v1beta1.Room getRoom() { + return room_ == null ? com.google.showcase.v1beta1.Room.getDefaultInstance() : room_; + } + + /** + * + * + *
        +   * The room to update.
        +   * 
        + * + * .google.showcase.v1beta1.Room room = 1; + */ + @java.lang.Override + public com.google.showcase.v1beta1.RoomOrBuilder getRoomOrBuilder() { + return room_ == null ? com.google.showcase.v1beta1.Room.getDefaultInstance() : room_; + } + + public static final int UPDATE_MASK_FIELD_NUMBER = 2; + private com.google.protobuf.FieldMask updateMask_; + + /** + * + * + *
        +   * The field mask to determine which fields are to be updated. If empty, the
        +   * server will assume all fields are to be updated.
        +   * 
        + * + * .google.protobuf.FieldMask update_mask = 2; + * + * @return Whether the updateMask field is set. + */ + @java.lang.Override + public boolean hasUpdateMask() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
        +   * The field mask to determine which fields are to be updated. If empty, the
        +   * server will assume all fields are to be updated.
        +   * 
        + * + * .google.protobuf.FieldMask update_mask = 2; + * + * @return The updateMask. + */ + @java.lang.Override + public com.google.protobuf.FieldMask getUpdateMask() { + return updateMask_ == null ? com.google.protobuf.FieldMask.getDefaultInstance() : updateMask_; + } + + /** + * + * + *
        +   * The field mask to determine which fields are to be updated. If empty, the
        +   * server will assume all fields are to be updated.
        +   * 
        + * + * .google.protobuf.FieldMask update_mask = 2; + */ + @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 (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(1, getRoom()); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeMessage(2, getUpdateMask()); + } + 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, getRoom()); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, 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.showcase.v1beta1.UpdateRoomRequest)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.UpdateRoomRequest other = + (com.google.showcase.v1beta1.UpdateRoomRequest) obj; + + if (hasRoom() != other.hasRoom()) return false; + if (hasRoom()) { + if (!getRoom().equals(other.getRoom())) 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(); + if (hasRoom()) { + hash = (37 * hash) + ROOM_FIELD_NUMBER; + hash = (53 * hash) + getRoom().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.showcase.v1beta1.UpdateRoomRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.UpdateRoomRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.UpdateRoomRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.UpdateRoomRequest 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.showcase.v1beta1.UpdateRoomRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.UpdateRoomRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.UpdateRoomRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.UpdateRoomRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.showcase.v1beta1.UpdateRoomRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.UpdateRoomRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.showcase.v1beta1.UpdateRoomRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.UpdateRoomRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.showcase.v1beta1.UpdateRoomRequest 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
        +   * The request message for the google.showcase.v1beta1.Messaging\UpdateRoom
        +   * method.
        +   * 
        + * + * Protobuf type {@code google.showcase.v1beta1.UpdateRoomRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.UpdateRoomRequest) + com.google.showcase.v1beta1.UpdateRoomRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.MessagingOuterClass + .internal_static_google_showcase_v1beta1_UpdateRoomRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.MessagingOuterClass + .internal_static_google_showcase_v1beta1_UpdateRoomRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.UpdateRoomRequest.class, + com.google.showcase.v1beta1.UpdateRoomRequest.Builder.class); + } + + // Construct using com.google.showcase.v1beta1.UpdateRoomRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetRoomFieldBuilder(); + internalGetUpdateMaskFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + room_ = null; + if (roomBuilder_ != null) { + roomBuilder_.dispose(); + roomBuilder_ = 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.showcase.v1beta1.MessagingOuterClass + .internal_static_google_showcase_v1beta1_UpdateRoomRequest_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.UpdateRoomRequest getDefaultInstanceForType() { + return com.google.showcase.v1beta1.UpdateRoomRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.UpdateRoomRequest build() { + com.google.showcase.v1beta1.UpdateRoomRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.UpdateRoomRequest buildPartial() { + com.google.showcase.v1beta1.UpdateRoomRequest result = + new com.google.showcase.v1beta1.UpdateRoomRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.showcase.v1beta1.UpdateRoomRequest result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.room_ = roomBuilder_ == null ? room_ : roomBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.updateMask_ = updateMaskBuilder_ == null ? updateMask_ : updateMaskBuilder_.build(); + to_bitField0_ |= 0x00000002; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.showcase.v1beta1.UpdateRoomRequest) { + return mergeFrom((com.google.showcase.v1beta1.UpdateRoomRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.showcase.v1beta1.UpdateRoomRequest other) { + if (other == com.google.showcase.v1beta1.UpdateRoomRequest.getDefaultInstance()) return this; + if (other.hasRoom()) { + mergeRoom(other.getRoom()); + } + 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: + { + input.readMessage(internalGetRoomFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + input.readMessage( + internalGetUpdateMaskFieldBuilder().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 com.google.showcase.v1beta1.Room room_; + private com.google.protobuf.SingleFieldBuilder< + com.google.showcase.v1beta1.Room, + com.google.showcase.v1beta1.Room.Builder, + com.google.showcase.v1beta1.RoomOrBuilder> + roomBuilder_; + + /** + * + * + *
        +     * The room to update.
        +     * 
        + * + * .google.showcase.v1beta1.Room room = 1; + * + * @return Whether the room field is set. + */ + public boolean hasRoom() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
        +     * The room to update.
        +     * 
        + * + * .google.showcase.v1beta1.Room room = 1; + * + * @return The room. + */ + public com.google.showcase.v1beta1.Room getRoom() { + if (roomBuilder_ == null) { + return room_ == null ? com.google.showcase.v1beta1.Room.getDefaultInstance() : room_; + } else { + return roomBuilder_.getMessage(); + } + } + + /** + * + * + *
        +     * The room to update.
        +     * 
        + * + * .google.showcase.v1beta1.Room room = 1; + */ + public Builder setRoom(com.google.showcase.v1beta1.Room value) { + if (roomBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + room_ = value; + } else { + roomBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
        +     * The room to update.
        +     * 
        + * + * .google.showcase.v1beta1.Room room = 1; + */ + public Builder setRoom(com.google.showcase.v1beta1.Room.Builder builderForValue) { + if (roomBuilder_ == null) { + room_ = builderForValue.build(); + } else { + roomBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
        +     * The room to update.
        +     * 
        + * + * .google.showcase.v1beta1.Room room = 1; + */ + public Builder mergeRoom(com.google.showcase.v1beta1.Room value) { + if (roomBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) + && room_ != null + && room_ != com.google.showcase.v1beta1.Room.getDefaultInstance()) { + getRoomBuilder().mergeFrom(value); + } else { + room_ = value; + } + } else { + roomBuilder_.mergeFrom(value); + } + if (room_ != null) { + bitField0_ |= 0x00000001; + onChanged(); + } + return this; + } + + /** + * + * + *
        +     * The room to update.
        +     * 
        + * + * .google.showcase.v1beta1.Room room = 1; + */ + public Builder clearRoom() { + bitField0_ = (bitField0_ & ~0x00000001); + room_ = null; + if (roomBuilder_ != null) { + roomBuilder_.dispose(); + roomBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
        +     * The room to update.
        +     * 
        + * + * .google.showcase.v1beta1.Room room = 1; + */ + public com.google.showcase.v1beta1.Room.Builder getRoomBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return internalGetRoomFieldBuilder().getBuilder(); + } + + /** + * + * + *
        +     * The room to update.
        +     * 
        + * + * .google.showcase.v1beta1.Room room = 1; + */ + public com.google.showcase.v1beta1.RoomOrBuilder getRoomOrBuilder() { + if (roomBuilder_ != null) { + return roomBuilder_.getMessageOrBuilder(); + } else { + return room_ == null ? com.google.showcase.v1beta1.Room.getDefaultInstance() : room_; + } + } + + /** + * + * + *
        +     * The room to update.
        +     * 
        + * + * .google.showcase.v1beta1.Room room = 1; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.showcase.v1beta1.Room, + com.google.showcase.v1beta1.Room.Builder, + com.google.showcase.v1beta1.RoomOrBuilder> + internalGetRoomFieldBuilder() { + if (roomBuilder_ == null) { + roomBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.showcase.v1beta1.Room, + com.google.showcase.v1beta1.Room.Builder, + com.google.showcase.v1beta1.RoomOrBuilder>( + getRoom(), getParentForChildren(), isClean()); + room_ = null; + } + return roomBuilder_; + } + + private com.google.protobuf.FieldMask updateMask_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder> + updateMaskBuilder_; + + /** + * + * + *
        +     * The field mask to determine which fields are to be updated. If empty, the
        +     * server will assume all fields are to be updated.
        +     * 
        + * + * .google.protobuf.FieldMask update_mask = 2; + * + * @return Whether the updateMask field is set. + */ + public boolean hasUpdateMask() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
        +     * The field mask to determine which fields are to be updated. If empty, the
        +     * server will assume all fields are to be updated.
        +     * 
        + * + * .google.protobuf.FieldMask update_mask = 2; + * + * @return The updateMask. + */ + public com.google.protobuf.FieldMask getUpdateMask() { + if (updateMaskBuilder_ == null) { + return updateMask_ == null + ? com.google.protobuf.FieldMask.getDefaultInstance() + : updateMask_; + } else { + return updateMaskBuilder_.getMessage(); + } + } + + /** + * + * + *
        +     * The field mask to determine which fields are to be updated. If empty, the
        +     * server will assume all fields are to be updated.
        +     * 
        + * + * .google.protobuf.FieldMask update_mask = 2; + */ + public Builder setUpdateMask(com.google.protobuf.FieldMask value) { + if (updateMaskBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + updateMask_ = value; + } else { + updateMaskBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
        +     * The field mask to determine which fields are to be updated. If empty, the
        +     * server will assume all fields are to be updated.
        +     * 
        + * + * .google.protobuf.FieldMask update_mask = 2; + */ + public Builder setUpdateMask(com.google.protobuf.FieldMask.Builder builderForValue) { + if (updateMaskBuilder_ == null) { + updateMask_ = builderForValue.build(); + } else { + updateMaskBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
        +     * The field mask to determine which fields are to be updated. If empty, the
        +     * server will assume all fields are to be updated.
        +     * 
        + * + * .google.protobuf.FieldMask update_mask = 2; + */ + public Builder mergeUpdateMask(com.google.protobuf.FieldMask value) { + if (updateMaskBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && updateMask_ != null + && updateMask_ != com.google.protobuf.FieldMask.getDefaultInstance()) { + getUpdateMaskBuilder().mergeFrom(value); + } else { + updateMask_ = value; + } + } else { + updateMaskBuilder_.mergeFrom(value); + } + if (updateMask_ != null) { + bitField0_ |= 0x00000002; + onChanged(); + } + return this; + } + + /** + * + * + *
        +     * The field mask to determine which fields are to be updated. If empty, the
        +     * server will assume all fields are to be updated.
        +     * 
        + * + * .google.protobuf.FieldMask update_mask = 2; + */ + public Builder clearUpdateMask() { + bitField0_ = (bitField0_ & ~0x00000002); + updateMask_ = null; + if (updateMaskBuilder_ != null) { + updateMaskBuilder_.dispose(); + updateMaskBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
        +     * The field mask to determine which fields are to be updated. If empty, the
        +     * server will assume all fields are to be updated.
        +     * 
        + * + * .google.protobuf.FieldMask update_mask = 2; + */ + public com.google.protobuf.FieldMask.Builder getUpdateMaskBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return internalGetUpdateMaskFieldBuilder().getBuilder(); + } + + /** + * + * + *
        +     * The field mask to determine which fields are to be updated. If empty, the
        +     * server will assume all fields are to be updated.
        +     * 
        + * + * .google.protobuf.FieldMask update_mask = 2; + */ + public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { + if (updateMaskBuilder_ != null) { + return updateMaskBuilder_.getMessageOrBuilder(); + } else { + return updateMask_ == null + ? com.google.protobuf.FieldMask.getDefaultInstance() + : updateMask_; + } + } + + /** + * + * + *
        +     * The field mask to determine which fields are to be updated. If empty, the
        +     * server will assume all fields are to be updated.
        +     * 
        + * + * .google.protobuf.FieldMask update_mask = 2; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder> + internalGetUpdateMaskFieldBuilder() { + if (updateMaskBuilder_ == null) { + updateMaskBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder>( + getUpdateMask(), getParentForChildren(), isClean()); + updateMask_ = null; + } + return updateMaskBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.showcase.v1beta1.UpdateRoomRequest) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.UpdateRoomRequest) + private static final com.google.showcase.v1beta1.UpdateRoomRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.UpdateRoomRequest(); + } + + public static com.google.showcase.v1beta1.UpdateRoomRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public UpdateRoomRequest 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.showcase.v1beta1.UpdateRoomRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/UpdateRoomRequestOrBuilder.java b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/UpdateRoomRequestOrBuilder.java new file mode 100644 index 0000000000..11894f528a --- /dev/null +++ b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/UpdateRoomRequestOrBuilder.java @@ -0,0 +1,105 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: schema/google/showcase/v1beta1/messaging.proto +// Protobuf Java Version: 4.33.2 + +package com.google.showcase.v1beta1; + +@com.google.protobuf.Generated +public interface UpdateRoomRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.UpdateRoomRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
        +   * The room to update.
        +   * 
        + * + * .google.showcase.v1beta1.Room room = 1; + * + * @return Whether the room field is set. + */ + boolean hasRoom(); + + /** + * + * + *
        +   * The room to update.
        +   * 
        + * + * .google.showcase.v1beta1.Room room = 1; + * + * @return The room. + */ + com.google.showcase.v1beta1.Room getRoom(); + + /** + * + * + *
        +   * The room to update.
        +   * 
        + * + * .google.showcase.v1beta1.Room room = 1; + */ + com.google.showcase.v1beta1.RoomOrBuilder getRoomOrBuilder(); + + /** + * + * + *
        +   * The field mask to determine which fields are to be updated. If empty, the
        +   * server will assume all fields are to be updated.
        +   * 
        + * + * .google.protobuf.FieldMask update_mask = 2; + * + * @return Whether the updateMask field is set. + */ + boolean hasUpdateMask(); + + /** + * + * + *
        +   * The field mask to determine which fields are to be updated. If empty, the
        +   * server will assume all fields are to be updated.
        +   * 
        + * + * .google.protobuf.FieldMask update_mask = 2; + * + * @return The updateMask. + */ + com.google.protobuf.FieldMask getUpdateMask(); + + /** + * + * + *
        +   * The field mask to determine which fields are to be updated. If empty, the
        +   * server will assume all fields are to be updated.
        +   * 
        + * + * .google.protobuf.FieldMask update_mask = 2; + */ + com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder(); +} diff --git a/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/UpdateUserRequest.java b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/UpdateUserRequest.java new file mode 100644 index 0000000000..959b924046 --- /dev/null +++ b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/UpdateUserRequest.java @@ -0,0 +1,979 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: schema/google/showcase/v1beta1/identity.proto +// Protobuf Java Version: 4.33.2 + +package com.google.showcase.v1beta1; + +/** + * + * + *
        + * The request message for the google.showcase.v1beta1.Identity\UpdateUser
        + * method.
        + * 
        + * + * Protobuf type {@code google.showcase.v1beta1.UpdateUserRequest} + */ +@com.google.protobuf.Generated +public final class UpdateUserRequest extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.UpdateUserRequest) + UpdateUserRequestOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "UpdateUserRequest"); + } + + // Use UpdateUserRequest.newBuilder() to construct. + private UpdateUserRequest(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private UpdateUserRequest() {} + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.IdentityOuterClass + .internal_static_google_showcase_v1beta1_UpdateUserRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.IdentityOuterClass + .internal_static_google_showcase_v1beta1_UpdateUserRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.UpdateUserRequest.class, + com.google.showcase.v1beta1.UpdateUserRequest.Builder.class); + } + + private int bitField0_; + public static final int USER_FIELD_NUMBER = 1; + private com.google.showcase.v1beta1.User user_; + + /** + * + * + *
        +   * The user to update.
        +   * 
        + * + * .google.showcase.v1beta1.User user = 1; + * + * @return Whether the user field is set. + */ + @java.lang.Override + public boolean hasUser() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
        +   * The user to update.
        +   * 
        + * + * .google.showcase.v1beta1.User user = 1; + * + * @return The user. + */ + @java.lang.Override + public com.google.showcase.v1beta1.User getUser() { + return user_ == null ? com.google.showcase.v1beta1.User.getDefaultInstance() : user_; + } + + /** + * + * + *
        +   * The user to update.
        +   * 
        + * + * .google.showcase.v1beta1.User user = 1; + */ + @java.lang.Override + public com.google.showcase.v1beta1.UserOrBuilder getUserOrBuilder() { + return user_ == null ? com.google.showcase.v1beta1.User.getDefaultInstance() : user_; + } + + public static final int UPDATE_MASK_FIELD_NUMBER = 2; + private com.google.protobuf.FieldMask updateMask_; + + /** + * + * + *
        +   * The field mask to determine which fields are to be updated. If empty, the
        +   * server will assume all fields are to be updated.
        +   * 
        + * + * .google.protobuf.FieldMask update_mask = 2; + * + * @return Whether the updateMask field is set. + */ + @java.lang.Override + public boolean hasUpdateMask() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
        +   * The field mask to determine which fields are to be updated. If empty, the
        +   * server will assume all fields are to be updated.
        +   * 
        + * + * .google.protobuf.FieldMask update_mask = 2; + * + * @return The updateMask. + */ + @java.lang.Override + public com.google.protobuf.FieldMask getUpdateMask() { + return updateMask_ == null ? com.google.protobuf.FieldMask.getDefaultInstance() : updateMask_; + } + + /** + * + * + *
        +   * The field mask to determine which fields are to be updated. If empty, the
        +   * server will assume all fields are to be updated.
        +   * 
        + * + * .google.protobuf.FieldMask update_mask = 2; + */ + @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 (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(1, getUser()); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeMessage(2, getUpdateMask()); + } + 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, getUser()); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, 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.showcase.v1beta1.UpdateUserRequest)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.UpdateUserRequest other = + (com.google.showcase.v1beta1.UpdateUserRequest) obj; + + if (hasUser() != other.hasUser()) return false; + if (hasUser()) { + if (!getUser().equals(other.getUser())) 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(); + if (hasUser()) { + hash = (37 * hash) + USER_FIELD_NUMBER; + hash = (53 * hash) + getUser().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.showcase.v1beta1.UpdateUserRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.UpdateUserRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.UpdateUserRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.UpdateUserRequest 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.showcase.v1beta1.UpdateUserRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.UpdateUserRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.UpdateUserRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.UpdateUserRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.showcase.v1beta1.UpdateUserRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.UpdateUserRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.showcase.v1beta1.UpdateUserRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.UpdateUserRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.showcase.v1beta1.UpdateUserRequest 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
        +   * The request message for the google.showcase.v1beta1.Identity\UpdateUser
        +   * method.
        +   * 
        + * + * Protobuf type {@code google.showcase.v1beta1.UpdateUserRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.UpdateUserRequest) + com.google.showcase.v1beta1.UpdateUserRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.IdentityOuterClass + .internal_static_google_showcase_v1beta1_UpdateUserRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.IdentityOuterClass + .internal_static_google_showcase_v1beta1_UpdateUserRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.UpdateUserRequest.class, + com.google.showcase.v1beta1.UpdateUserRequest.Builder.class); + } + + // Construct using com.google.showcase.v1beta1.UpdateUserRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetUserFieldBuilder(); + internalGetUpdateMaskFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + user_ = null; + if (userBuilder_ != null) { + userBuilder_.dispose(); + userBuilder_ = 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.showcase.v1beta1.IdentityOuterClass + .internal_static_google_showcase_v1beta1_UpdateUserRequest_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.UpdateUserRequest getDefaultInstanceForType() { + return com.google.showcase.v1beta1.UpdateUserRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.UpdateUserRequest build() { + com.google.showcase.v1beta1.UpdateUserRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.UpdateUserRequest buildPartial() { + com.google.showcase.v1beta1.UpdateUserRequest result = + new com.google.showcase.v1beta1.UpdateUserRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.showcase.v1beta1.UpdateUserRequest result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.user_ = userBuilder_ == null ? user_ : userBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.updateMask_ = updateMaskBuilder_ == null ? updateMask_ : updateMaskBuilder_.build(); + to_bitField0_ |= 0x00000002; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.showcase.v1beta1.UpdateUserRequest) { + return mergeFrom((com.google.showcase.v1beta1.UpdateUserRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.showcase.v1beta1.UpdateUserRequest other) { + if (other == com.google.showcase.v1beta1.UpdateUserRequest.getDefaultInstance()) return this; + if (other.hasUser()) { + mergeUser(other.getUser()); + } + 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: + { + input.readMessage(internalGetUserFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + input.readMessage( + internalGetUpdateMaskFieldBuilder().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 com.google.showcase.v1beta1.User user_; + private com.google.protobuf.SingleFieldBuilder< + com.google.showcase.v1beta1.User, + com.google.showcase.v1beta1.User.Builder, + com.google.showcase.v1beta1.UserOrBuilder> + userBuilder_; + + /** + * + * + *
        +     * The user to update.
        +     * 
        + * + * .google.showcase.v1beta1.User user = 1; + * + * @return Whether the user field is set. + */ + public boolean hasUser() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
        +     * The user to update.
        +     * 
        + * + * .google.showcase.v1beta1.User user = 1; + * + * @return The user. + */ + public com.google.showcase.v1beta1.User getUser() { + if (userBuilder_ == null) { + return user_ == null ? com.google.showcase.v1beta1.User.getDefaultInstance() : user_; + } else { + return userBuilder_.getMessage(); + } + } + + /** + * + * + *
        +     * The user to update.
        +     * 
        + * + * .google.showcase.v1beta1.User user = 1; + */ + public Builder setUser(com.google.showcase.v1beta1.User value) { + if (userBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + user_ = value; + } else { + userBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
        +     * The user to update.
        +     * 
        + * + * .google.showcase.v1beta1.User user = 1; + */ + public Builder setUser(com.google.showcase.v1beta1.User.Builder builderForValue) { + if (userBuilder_ == null) { + user_ = builderForValue.build(); + } else { + userBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
        +     * The user to update.
        +     * 
        + * + * .google.showcase.v1beta1.User user = 1; + */ + public Builder mergeUser(com.google.showcase.v1beta1.User value) { + if (userBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) + && user_ != null + && user_ != com.google.showcase.v1beta1.User.getDefaultInstance()) { + getUserBuilder().mergeFrom(value); + } else { + user_ = value; + } + } else { + userBuilder_.mergeFrom(value); + } + if (user_ != null) { + bitField0_ |= 0x00000001; + onChanged(); + } + return this; + } + + /** + * + * + *
        +     * The user to update.
        +     * 
        + * + * .google.showcase.v1beta1.User user = 1; + */ + public Builder clearUser() { + bitField0_ = (bitField0_ & ~0x00000001); + user_ = null; + if (userBuilder_ != null) { + userBuilder_.dispose(); + userBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
        +     * The user to update.
        +     * 
        + * + * .google.showcase.v1beta1.User user = 1; + */ + public com.google.showcase.v1beta1.User.Builder getUserBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return internalGetUserFieldBuilder().getBuilder(); + } + + /** + * + * + *
        +     * The user to update.
        +     * 
        + * + * .google.showcase.v1beta1.User user = 1; + */ + public com.google.showcase.v1beta1.UserOrBuilder getUserOrBuilder() { + if (userBuilder_ != null) { + return userBuilder_.getMessageOrBuilder(); + } else { + return user_ == null ? com.google.showcase.v1beta1.User.getDefaultInstance() : user_; + } + } + + /** + * + * + *
        +     * The user to update.
        +     * 
        + * + * .google.showcase.v1beta1.User user = 1; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.showcase.v1beta1.User, + com.google.showcase.v1beta1.User.Builder, + com.google.showcase.v1beta1.UserOrBuilder> + internalGetUserFieldBuilder() { + if (userBuilder_ == null) { + userBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.showcase.v1beta1.User, + com.google.showcase.v1beta1.User.Builder, + com.google.showcase.v1beta1.UserOrBuilder>( + getUser(), getParentForChildren(), isClean()); + user_ = null; + } + return userBuilder_; + } + + private com.google.protobuf.FieldMask updateMask_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder> + updateMaskBuilder_; + + /** + * + * + *
        +     * The field mask to determine which fields are to be updated. If empty, the
        +     * server will assume all fields are to be updated.
        +     * 
        + * + * .google.protobuf.FieldMask update_mask = 2; + * + * @return Whether the updateMask field is set. + */ + public boolean hasUpdateMask() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
        +     * The field mask to determine which fields are to be updated. If empty, the
        +     * server will assume all fields are to be updated.
        +     * 
        + * + * .google.protobuf.FieldMask update_mask = 2; + * + * @return The updateMask. + */ + public com.google.protobuf.FieldMask getUpdateMask() { + if (updateMaskBuilder_ == null) { + return updateMask_ == null + ? com.google.protobuf.FieldMask.getDefaultInstance() + : updateMask_; + } else { + return updateMaskBuilder_.getMessage(); + } + } + + /** + * + * + *
        +     * The field mask to determine which fields are to be updated. If empty, the
        +     * server will assume all fields are to be updated.
        +     * 
        + * + * .google.protobuf.FieldMask update_mask = 2; + */ + public Builder setUpdateMask(com.google.protobuf.FieldMask value) { + if (updateMaskBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + updateMask_ = value; + } else { + updateMaskBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
        +     * The field mask to determine which fields are to be updated. If empty, the
        +     * server will assume all fields are to be updated.
        +     * 
        + * + * .google.protobuf.FieldMask update_mask = 2; + */ + public Builder setUpdateMask(com.google.protobuf.FieldMask.Builder builderForValue) { + if (updateMaskBuilder_ == null) { + updateMask_ = builderForValue.build(); + } else { + updateMaskBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
        +     * The field mask to determine which fields are to be updated. If empty, the
        +     * server will assume all fields are to be updated.
        +     * 
        + * + * .google.protobuf.FieldMask update_mask = 2; + */ + public Builder mergeUpdateMask(com.google.protobuf.FieldMask value) { + if (updateMaskBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && updateMask_ != null + && updateMask_ != com.google.protobuf.FieldMask.getDefaultInstance()) { + getUpdateMaskBuilder().mergeFrom(value); + } else { + updateMask_ = value; + } + } else { + updateMaskBuilder_.mergeFrom(value); + } + if (updateMask_ != null) { + bitField0_ |= 0x00000002; + onChanged(); + } + return this; + } + + /** + * + * + *
        +     * The field mask to determine which fields are to be updated. If empty, the
        +     * server will assume all fields are to be updated.
        +     * 
        + * + * .google.protobuf.FieldMask update_mask = 2; + */ + public Builder clearUpdateMask() { + bitField0_ = (bitField0_ & ~0x00000002); + updateMask_ = null; + if (updateMaskBuilder_ != null) { + updateMaskBuilder_.dispose(); + updateMaskBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
        +     * The field mask to determine which fields are to be updated. If empty, the
        +     * server will assume all fields are to be updated.
        +     * 
        + * + * .google.protobuf.FieldMask update_mask = 2; + */ + public com.google.protobuf.FieldMask.Builder getUpdateMaskBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return internalGetUpdateMaskFieldBuilder().getBuilder(); + } + + /** + * + * + *
        +     * The field mask to determine which fields are to be updated. If empty, the
        +     * server will assume all fields are to be updated.
        +     * 
        + * + * .google.protobuf.FieldMask update_mask = 2; + */ + public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { + if (updateMaskBuilder_ != null) { + return updateMaskBuilder_.getMessageOrBuilder(); + } else { + return updateMask_ == null + ? com.google.protobuf.FieldMask.getDefaultInstance() + : updateMask_; + } + } + + /** + * + * + *
        +     * The field mask to determine which fields are to be updated. If empty, the
        +     * server will assume all fields are to be updated.
        +     * 
        + * + * .google.protobuf.FieldMask update_mask = 2; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder> + internalGetUpdateMaskFieldBuilder() { + if (updateMaskBuilder_ == null) { + updateMaskBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder>( + getUpdateMask(), getParentForChildren(), isClean()); + updateMask_ = null; + } + return updateMaskBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.showcase.v1beta1.UpdateUserRequest) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.UpdateUserRequest) + private static final com.google.showcase.v1beta1.UpdateUserRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.UpdateUserRequest(); + } + + public static com.google.showcase.v1beta1.UpdateUserRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public UpdateUserRequest 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.showcase.v1beta1.UpdateUserRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/UpdateUserRequestOrBuilder.java b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/UpdateUserRequestOrBuilder.java new file mode 100644 index 0000000000..0efa1f07ed --- /dev/null +++ b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/UpdateUserRequestOrBuilder.java @@ -0,0 +1,105 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: schema/google/showcase/v1beta1/identity.proto +// Protobuf Java Version: 4.33.2 + +package com.google.showcase.v1beta1; + +@com.google.protobuf.Generated +public interface UpdateUserRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.UpdateUserRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
        +   * The user to update.
        +   * 
        + * + * .google.showcase.v1beta1.User user = 1; + * + * @return Whether the user field is set. + */ + boolean hasUser(); + + /** + * + * + *
        +   * The user to update.
        +   * 
        + * + * .google.showcase.v1beta1.User user = 1; + * + * @return The user. + */ + com.google.showcase.v1beta1.User getUser(); + + /** + * + * + *
        +   * The user to update.
        +   * 
        + * + * .google.showcase.v1beta1.User user = 1; + */ + com.google.showcase.v1beta1.UserOrBuilder getUserOrBuilder(); + + /** + * + * + *
        +   * The field mask to determine which fields are to be updated. If empty, the
        +   * server will assume all fields are to be updated.
        +   * 
        + * + * .google.protobuf.FieldMask update_mask = 2; + * + * @return Whether the updateMask field is set. + */ + boolean hasUpdateMask(); + + /** + * + * + *
        +   * The field mask to determine which fields are to be updated. If empty, the
        +   * server will assume all fields are to be updated.
        +   * 
        + * + * .google.protobuf.FieldMask update_mask = 2; + * + * @return The updateMask. + */ + com.google.protobuf.FieldMask getUpdateMask(); + + /** + * + * + *
        +   * The field mask to determine which fields are to be updated. If empty, the
        +   * server will assume all fields are to be updated.
        +   * 
        + * + * .google.protobuf.FieldMask update_mask = 2; + */ + com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder(); +} diff --git a/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/User.java b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/User.java new file mode 100644 index 0000000000..f7af644ab0 --- /dev/null +++ b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/User.java @@ -0,0 +1,2256 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: schema/google/showcase/v1beta1/identity.proto +// Protobuf Java Version: 4.33.2 + +package com.google.showcase.v1beta1; + +/** + * + * + *
        + * A user.
        + * 
        + * + * Protobuf type {@code google.showcase.v1beta1.User} + */ +@com.google.protobuf.Generated +public final class User extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.User) + UserOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "User"); + } + + // Use User.newBuilder() to construct. + private User(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private User() { + name_ = ""; + displayName_ = ""; + email_ = ""; + nickname_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.IdentityOuterClass + .internal_static_google_showcase_v1beta1_User_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.IdentityOuterClass + .internal_static_google_showcase_v1beta1_User_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.User.class, com.google.showcase.v1beta1.User.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 user.
        +   * 
        + * + * 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 user.
        +   * 
        + * + * 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 DISPLAY_NAME_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object displayName_ = ""; + + /** + * + * + *
        +   * The display_name of the user.
        +   * 
        + * + * string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The displayName. + */ + @java.lang.Override + public java.lang.String getDisplayName() { + java.lang.Object ref = displayName_; + 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(); + displayName_ = s; + return s; + } + } + + /** + * + * + *
        +   * The display_name of the user.
        +   * 
        + * + * string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for displayName. + */ + @java.lang.Override + public com.google.protobuf.ByteString getDisplayNameBytes() { + java.lang.Object ref = displayName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + displayName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int EMAIL_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object email_ = ""; + + /** + * + * + *
        +   * The email address of the user.
        +   * 
        + * + * string email = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The email. + */ + @java.lang.Override + public java.lang.String getEmail() { + java.lang.Object ref = email_; + 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(); + email_ = s; + return s; + } + } + + /** + * + * + *
        +   * The email address of the user.
        +   * 
        + * + * string email = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for email. + */ + @java.lang.Override + public com.google.protobuf.ByteString getEmailBytes() { + java.lang.Object ref = email_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + email_ = 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_; + + /** + * + * + *
        +   * The timestamp at which the user was created.
        +   * 
        + * + * .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); + } + + /** + * + * + *
        +   * The timestamp at which the user was created.
        +   * 
        + * + * .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_; + } + + /** + * + * + *
        +   * The timestamp at which the user was created.
        +   * 
        + * + * .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_; + + /** + * + * + *
        +   * The latest timestamp at which the user was updated.
        +   * 
        + * + * .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the updateTime field is set. + */ + @java.lang.Override + public boolean hasUpdateTime() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
        +   * The latest timestamp at which the user was updated.
        +   * 
        + * + * .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The updateTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getUpdateTime() { + return updateTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : updateTime_; + } + + /** + * + * + *
        +   * The latest timestamp at which the user was updated.
        +   * 
        + * + * .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 AGE_FIELD_NUMBER = 6; + private int age_ = 0; + + /** + * + * + *
        +   * The age of the user in years.
        +   * 
        + * + * optional int32 age = 6; + * + * @return Whether the age field is set. + */ + @java.lang.Override + public boolean hasAge() { + return ((bitField0_ & 0x00000004) != 0); + } + + /** + * + * + *
        +   * The age of the user in years.
        +   * 
        + * + * optional int32 age = 6; + * + * @return The age. + */ + @java.lang.Override + public int getAge() { + return age_; + } + + public static final int HEIGHT_FEET_FIELD_NUMBER = 7; + private double heightFeet_ = 0D; + + /** + * + * + *
        +   * The height of the user in feet.
        +   * 
        + * + * optional double height_feet = 7; + * + * @return Whether the heightFeet field is set. + */ + @java.lang.Override + public boolean hasHeightFeet() { + return ((bitField0_ & 0x00000008) != 0); + } + + /** + * + * + *
        +   * The height of the user in feet.
        +   * 
        + * + * optional double height_feet = 7; + * + * @return The heightFeet. + */ + @java.lang.Override + public double getHeightFeet() { + return heightFeet_; + } + + public static final int NICKNAME_FIELD_NUMBER = 8; + + @SuppressWarnings("serial") + private volatile java.lang.Object nickname_ = ""; + + /** + * + * + *
        +   * The nickname of the user.
        +   *
        +   * (-- aip.dev/not-precedent: An empty string is a valid nickname.
        +   * Ordinarily, proto3_optional should not be used on a `string` field. --)
        +   * 
        + * + * optional string nickname = 8; + * + * @return Whether the nickname field is set. + */ + @java.lang.Override + public boolean hasNickname() { + return ((bitField0_ & 0x00000010) != 0); + } + + /** + * + * + *
        +   * The nickname of the user.
        +   *
        +   * (-- aip.dev/not-precedent: An empty string is a valid nickname.
        +   * Ordinarily, proto3_optional should not be used on a `string` field. --)
        +   * 
        + * + * optional string nickname = 8; + * + * @return The nickname. + */ + @java.lang.Override + public java.lang.String getNickname() { + java.lang.Object ref = nickname_; + 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(); + nickname_ = s; + return s; + } + } + + /** + * + * + *
        +   * The nickname of the user.
        +   *
        +   * (-- aip.dev/not-precedent: An empty string is a valid nickname.
        +   * Ordinarily, proto3_optional should not be used on a `string` field. --)
        +   * 
        + * + * optional string nickname = 8; + * + * @return The bytes for nickname. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNicknameBytes() { + java.lang.Object ref = nickname_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + nickname_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int ENABLE_NOTIFICATIONS_FIELD_NUMBER = 9; + private boolean enableNotifications_ = false; + + /** + * + * + *
        +   * Enables the receiving of notifications. The default is true if unset.
        +   *
        +   * (-- aip.dev/not-precedent: The default for the feature is true.
        +   * Ordinarily, the default for a `bool` field should be false. --)
        +   * 
        + * + * optional bool enable_notifications = 9; + * + * @return Whether the enableNotifications field is set. + */ + @java.lang.Override + public boolean hasEnableNotifications() { + return ((bitField0_ & 0x00000020) != 0); + } + + /** + * + * + *
        +   * Enables the receiving of notifications. The default is true if unset.
        +   *
        +   * (-- aip.dev/not-precedent: The default for the feature is true.
        +   * Ordinarily, the default for a `bool` field should be false. --)
        +   * 
        + * + * optional bool enable_notifications = 9; + * + * @return The enableNotifications. + */ + @java.lang.Override + public boolean getEnableNotifications() { + return enableNotifications_; + } + + 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.GeneratedMessage.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, name_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(displayName_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, displayName_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(email_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 3, email_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(4, getCreateTime()); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeMessage(5, getUpdateTime()); + } + if (((bitField0_ & 0x00000004) != 0)) { + output.writeInt32(6, age_); + } + if (((bitField0_ & 0x00000008) != 0)) { + output.writeDouble(7, heightFeet_); + } + if (((bitField0_ & 0x00000010) != 0)) { + com.google.protobuf.GeneratedMessage.writeString(output, 8, nickname_); + } + if (((bitField0_ & 0x00000020) != 0)) { + output.writeBool(9, enableNotifications_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, name_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(displayName_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, displayName_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(email_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(3, email_); + } + 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 (((bitField0_ & 0x00000004) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(6, age_); + } + if (((bitField0_ & 0x00000008) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeDoubleSize(7, heightFeet_); + } + if (((bitField0_ & 0x00000010) != 0)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(8, nickname_); + } + if (((bitField0_ & 0x00000020) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(9, enableNotifications_); + } + 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.showcase.v1beta1.User)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.User other = (com.google.showcase.v1beta1.User) obj; + + if (!getName().equals(other.getName())) return false; + if (!getDisplayName().equals(other.getDisplayName())) return false; + if (!getEmail().equals(other.getEmail())) 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 (hasAge() != other.hasAge()) return false; + if (hasAge()) { + if (getAge() != other.getAge()) return false; + } + if (hasHeightFeet() != other.hasHeightFeet()) return false; + if (hasHeightFeet()) { + if (java.lang.Double.doubleToLongBits(getHeightFeet()) + != java.lang.Double.doubleToLongBits(other.getHeightFeet())) return false; + } + if (hasNickname() != other.hasNickname()) return false; + if (hasNickname()) { + if (!getNickname().equals(other.getNickname())) return false; + } + if (hasEnableNotifications() != other.hasEnableNotifications()) return false; + if (hasEnableNotifications()) { + if (getEnableNotifications() != other.getEnableNotifications()) 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) + DISPLAY_NAME_FIELD_NUMBER; + hash = (53 * hash) + getDisplayName().hashCode(); + hash = (37 * hash) + EMAIL_FIELD_NUMBER; + hash = (53 * hash) + getEmail().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(); + } + if (hasAge()) { + hash = (37 * hash) + AGE_FIELD_NUMBER; + hash = (53 * hash) + getAge(); + } + if (hasHeightFeet()) { + hash = (37 * hash) + HEIGHT_FEET_FIELD_NUMBER; + hash = + (53 * hash) + + com.google.protobuf.Internal.hashLong( + java.lang.Double.doubleToLongBits(getHeightFeet())); + } + if (hasNickname()) { + hash = (37 * hash) + NICKNAME_FIELD_NUMBER; + hash = (53 * hash) + getNickname().hashCode(); + } + if (hasEnableNotifications()) { + hash = (37 * hash) + ENABLE_NOTIFICATIONS_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getEnableNotifications()); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.showcase.v1beta1.User parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.User parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.User parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.User 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.showcase.v1beta1.User parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.User parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.User parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.User parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.showcase.v1beta1.User parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.User parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.showcase.v1beta1.User parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.User parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.showcase.v1beta1.User 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
        +   * A user.
        +   * 
        + * + * Protobuf type {@code google.showcase.v1beta1.User} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.User) + com.google.showcase.v1beta1.UserOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.IdentityOuterClass + .internal_static_google_showcase_v1beta1_User_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.IdentityOuterClass + .internal_static_google_showcase_v1beta1_User_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.User.class, + com.google.showcase.v1beta1.User.Builder.class); + } + + // Construct using com.google.showcase.v1beta1.User.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetCreateTimeFieldBuilder(); + internalGetUpdateTimeFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + displayName_ = ""; + email_ = ""; + createTime_ = null; + if (createTimeBuilder_ != null) { + createTimeBuilder_.dispose(); + createTimeBuilder_ = null; + } + updateTime_ = null; + if (updateTimeBuilder_ != null) { + updateTimeBuilder_.dispose(); + updateTimeBuilder_ = null; + } + age_ = 0; + heightFeet_ = 0D; + nickname_ = ""; + enableNotifications_ = false; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.showcase.v1beta1.IdentityOuterClass + .internal_static_google_showcase_v1beta1_User_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.User getDefaultInstanceForType() { + return com.google.showcase.v1beta1.User.getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.User build() { + com.google.showcase.v1beta1.User result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.User buildPartial() { + com.google.showcase.v1beta1.User result = new com.google.showcase.v1beta1.User(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.showcase.v1beta1.User result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.displayName_ = displayName_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.email_ = email_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000008) != 0)) { + result.createTime_ = createTimeBuilder_ == null ? createTime_ : createTimeBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.updateTime_ = updateTimeBuilder_ == null ? updateTime_ : updateTimeBuilder_.build(); + to_bitField0_ |= 0x00000002; + } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.age_ = age_; + to_bitField0_ |= 0x00000004; + } + if (((from_bitField0_ & 0x00000040) != 0)) { + result.heightFeet_ = heightFeet_; + to_bitField0_ |= 0x00000008; + } + if (((from_bitField0_ & 0x00000080) != 0)) { + result.nickname_ = nickname_; + to_bitField0_ |= 0x00000010; + } + if (((from_bitField0_ & 0x00000100) != 0)) { + result.enableNotifications_ = enableNotifications_; + to_bitField0_ |= 0x00000020; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.showcase.v1beta1.User) { + return mergeFrom((com.google.showcase.v1beta1.User) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.showcase.v1beta1.User other) { + if (other == com.google.showcase.v1beta1.User.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getDisplayName().isEmpty()) { + displayName_ = other.displayName_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (!other.getEmail().isEmpty()) { + email_ = other.email_; + bitField0_ |= 0x00000004; + onChanged(); + } + if (other.hasCreateTime()) { + mergeCreateTime(other.getCreateTime()); + } + if (other.hasUpdateTime()) { + mergeUpdateTime(other.getUpdateTime()); + } + if (other.hasAge()) { + setAge(other.getAge()); + } + if (other.hasHeightFeet()) { + setHeightFeet(other.getHeightFeet()); + } + if (other.hasNickname()) { + nickname_ = other.nickname_; + bitField0_ |= 0x00000080; + onChanged(); + } + if (other.hasEnableNotifications()) { + setEnableNotifications(other.getEnableNotifications()); + } + 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: + { + displayName_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + email_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 34: + { + input.readMessage( + internalGetCreateTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000008; + break; + } // case 34 + case 42: + { + input.readMessage( + internalGetUpdateTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000010; + break; + } // case 42 + case 48: + { + age_ = input.readInt32(); + bitField0_ |= 0x00000020; + break; + } // case 48 + case 57: + { + heightFeet_ = input.readDouble(); + bitField0_ |= 0x00000040; + break; + } // case 57 + case 66: + { + nickname_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000080; + break; + } // case 66 + case 72: + { + enableNotifications_ = input.readBool(); + bitField0_ |= 0x00000100; + break; + } // case 72 + 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 user.
        +     * 
        + * + * 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 user.
        +     * 
        + * + * 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 user.
        +     * 
        + * + * 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 user.
        +     * 
        + * + * 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 user.
        +     * 
        + * + * 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 displayName_ = ""; + + /** + * + * + *
        +     * The display_name of the user.
        +     * 
        + * + * string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The displayName. + */ + public java.lang.String getDisplayName() { + java.lang.Object ref = displayName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + displayName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
        +     * The display_name of the user.
        +     * 
        + * + * string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for displayName. + */ + public com.google.protobuf.ByteString getDisplayNameBytes() { + java.lang.Object ref = displayName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + displayName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
        +     * The display_name of the user.
        +     * 
        + * + * string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The displayName to set. + * @return This builder for chaining. + */ + public Builder setDisplayName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + displayName_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
        +     * The display_name of the user.
        +     * 
        + * + * string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearDisplayName() { + displayName_ = getDefaultInstance().getDisplayName(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
        +     * The display_name of the user.
        +     * 
        + * + * string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for displayName to set. + * @return This builder for chaining. + */ + public Builder setDisplayNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + displayName_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private java.lang.Object email_ = ""; + + /** + * + * + *
        +     * The email address of the user.
        +     * 
        + * + * string email = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The email. + */ + public java.lang.String getEmail() { + java.lang.Object ref = email_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + email_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
        +     * The email address of the user.
        +     * 
        + * + * string email = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for email. + */ + public com.google.protobuf.ByteString getEmailBytes() { + java.lang.Object ref = email_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + email_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
        +     * The email address of the user.
        +     * 
        + * + * string email = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The email to set. + * @return This builder for chaining. + */ + public Builder setEmail(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + email_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
        +     * The email address of the user.
        +     * 
        + * + * string email = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearEmail() { + email_ = getDefaultInstance().getEmail(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + + /** + * + * + *
        +     * The email address of the user.
        +     * 
        + * + * string email = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for email to set. + * @return This builder for chaining. + */ + public Builder setEmailBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + email_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + private com.google.protobuf.Timestamp createTime_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + createTimeBuilder_; + + /** + * + * + *
        +     * The timestamp at which the user was created.
        +     * 
        + * + * + * .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the createTime field is set. + */ + public boolean hasCreateTime() { + return ((bitField0_ & 0x00000008) != 0); + } + + /** + * + * + *
        +     * The timestamp at which the user was created.
        +     * 
        + * + * + * .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(); + } + } + + /** + * + * + *
        +     * The timestamp at which the user was created.
        +     * 
        + * + * + * .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_ |= 0x00000008; + onChanged(); + return this; + } + + /** + * + * + *
        +     * The timestamp at which the user was created.
        +     * 
        + * + * + * .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_ |= 0x00000008; + onChanged(); + return this; + } + + /** + * + * + *
        +     * The timestamp at which the user was created.
        +     * 
        + * + * + * .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_ & 0x00000008) != 0) + && createTime_ != null + && createTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getCreateTimeBuilder().mergeFrom(value); + } else { + createTime_ = value; + } + } else { + createTimeBuilder_.mergeFrom(value); + } + if (createTime_ != null) { + bitField0_ |= 0x00000008; + onChanged(); + } + return this; + } + + /** + * + * + *
        +     * The timestamp at which the user was created.
        +     * 
        + * + * + * .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearCreateTime() { + bitField0_ = (bitField0_ & ~0x00000008); + createTime_ = null; + if (createTimeBuilder_ != null) { + createTimeBuilder_.dispose(); + createTimeBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
        +     * The timestamp at which the user was created.
        +     * 
        + * + * + * .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.Timestamp.Builder getCreateTimeBuilder() { + bitField0_ |= 0x00000008; + onChanged(); + return internalGetCreateTimeFieldBuilder().getBuilder(); + } + + /** + * + * + *
        +     * The timestamp at which the user was created.
        +     * 
        + * + * + * .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_; + } + } + + /** + * + * + *
        +     * The timestamp at which the user was created.
        +     * 
        + * + * + * .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + internalGetCreateTimeFieldBuilder() { + if (createTimeBuilder_ == null) { + createTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + 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.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + updateTimeBuilder_; + + /** + * + * + *
        +     * The latest timestamp at which the user was updated.
        +     * 
        + * + * + * .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the updateTime field is set. + */ + public boolean hasUpdateTime() { + return ((bitField0_ & 0x00000010) != 0); + } + + /** + * + * + *
        +     * The latest timestamp at which the user was updated.
        +     * 
        + * + * + * .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The updateTime. + */ + public com.google.protobuf.Timestamp getUpdateTime() { + if (updateTimeBuilder_ == null) { + return updateTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : updateTime_; + } else { + return updateTimeBuilder_.getMessage(); + } + } + + /** + * + * + *
        +     * The latest timestamp at which the user was updated.
        +     * 
        + * + * + * .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setUpdateTime(com.google.protobuf.Timestamp value) { + if (updateTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + updateTime_ = value; + } else { + updateTimeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + /** + * + * + *
        +     * The latest timestamp at which the user was updated.
        +     * 
        + * + * + * .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setUpdateTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (updateTimeBuilder_ == null) { + updateTime_ = builderForValue.build(); + } else { + updateTimeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + /** + * + * + *
        +     * The latest timestamp at which the user was updated.
        +     * 
        + * + * + * .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeUpdateTime(com.google.protobuf.Timestamp value) { + if (updateTimeBuilder_ == null) { + if (((bitField0_ & 0x00000010) != 0) + && updateTime_ != null + && updateTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getUpdateTimeBuilder().mergeFrom(value); + } else { + updateTime_ = value; + } + } else { + updateTimeBuilder_.mergeFrom(value); + } + if (updateTime_ != null) { + bitField0_ |= 0x00000010; + onChanged(); + } + return this; + } + + /** + * + * + *
        +     * The latest timestamp at which the user was updated.
        +     * 
        + * + * + * .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearUpdateTime() { + bitField0_ = (bitField0_ & ~0x00000010); + updateTime_ = null; + if (updateTimeBuilder_ != null) { + updateTimeBuilder_.dispose(); + updateTimeBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
        +     * The latest timestamp at which the user was updated.
        +     * 
        + * + * + * .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.Timestamp.Builder getUpdateTimeBuilder() { + bitField0_ |= 0x00000010; + onChanged(); + return internalGetUpdateTimeFieldBuilder().getBuilder(); + } + + /** + * + * + *
        +     * The latest timestamp at which the user was updated.
        +     * 
        + * + * + * .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder() { + if (updateTimeBuilder_ != null) { + return updateTimeBuilder_.getMessageOrBuilder(); + } else { + return updateTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : updateTime_; + } + } + + /** + * + * + *
        +     * The latest timestamp at which the user was updated.
        +     * 
        + * + * + * .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + internalGetUpdateTimeFieldBuilder() { + if (updateTimeBuilder_ == null) { + updateTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getUpdateTime(), getParentForChildren(), isClean()); + updateTime_ = null; + } + return updateTimeBuilder_; + } + + private int age_; + + /** + * + * + *
        +     * The age of the user in years.
        +     * 
        + * + * optional int32 age = 6; + * + * @return Whether the age field is set. + */ + @java.lang.Override + public boolean hasAge() { + return ((bitField0_ & 0x00000020) != 0); + } + + /** + * + * + *
        +     * The age of the user in years.
        +     * 
        + * + * optional int32 age = 6; + * + * @return The age. + */ + @java.lang.Override + public int getAge() { + return age_; + } + + /** + * + * + *
        +     * The age of the user in years.
        +     * 
        + * + * optional int32 age = 6; + * + * @param value The age to set. + * @return This builder for chaining. + */ + public Builder setAge(int value) { + + age_ = value; + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + + /** + * + * + *
        +     * The age of the user in years.
        +     * 
        + * + * optional int32 age = 6; + * + * @return This builder for chaining. + */ + public Builder clearAge() { + bitField0_ = (bitField0_ & ~0x00000020); + age_ = 0; + onChanged(); + return this; + } + + private double heightFeet_; + + /** + * + * + *
        +     * The height of the user in feet.
        +     * 
        + * + * optional double height_feet = 7; + * + * @return Whether the heightFeet field is set. + */ + @java.lang.Override + public boolean hasHeightFeet() { + return ((bitField0_ & 0x00000040) != 0); + } + + /** + * + * + *
        +     * The height of the user in feet.
        +     * 
        + * + * optional double height_feet = 7; + * + * @return The heightFeet. + */ + @java.lang.Override + public double getHeightFeet() { + return heightFeet_; + } + + /** + * + * + *
        +     * The height of the user in feet.
        +     * 
        + * + * optional double height_feet = 7; + * + * @param value The heightFeet to set. + * @return This builder for chaining. + */ + public Builder setHeightFeet(double value) { + + heightFeet_ = value; + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + + /** + * + * + *
        +     * The height of the user in feet.
        +     * 
        + * + * optional double height_feet = 7; + * + * @return This builder for chaining. + */ + public Builder clearHeightFeet() { + bitField0_ = (bitField0_ & ~0x00000040); + heightFeet_ = 0D; + onChanged(); + return this; + } + + private java.lang.Object nickname_ = ""; + + /** + * + * + *
        +     * The nickname of the user.
        +     *
        +     * (-- aip.dev/not-precedent: An empty string is a valid nickname.
        +     * Ordinarily, proto3_optional should not be used on a `string` field. --)
        +     * 
        + * + * optional string nickname = 8; + * + * @return Whether the nickname field is set. + */ + public boolean hasNickname() { + return ((bitField0_ & 0x00000080) != 0); + } + + /** + * + * + *
        +     * The nickname of the user.
        +     *
        +     * (-- aip.dev/not-precedent: An empty string is a valid nickname.
        +     * Ordinarily, proto3_optional should not be used on a `string` field. --)
        +     * 
        + * + * optional string nickname = 8; + * + * @return The nickname. + */ + public java.lang.String getNickname() { + java.lang.Object ref = nickname_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nickname_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
        +     * The nickname of the user.
        +     *
        +     * (-- aip.dev/not-precedent: An empty string is a valid nickname.
        +     * Ordinarily, proto3_optional should not be used on a `string` field. --)
        +     * 
        + * + * optional string nickname = 8; + * + * @return The bytes for nickname. + */ + public com.google.protobuf.ByteString getNicknameBytes() { + java.lang.Object ref = nickname_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + nickname_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
        +     * The nickname of the user.
        +     *
        +     * (-- aip.dev/not-precedent: An empty string is a valid nickname.
        +     * Ordinarily, proto3_optional should not be used on a `string` field. --)
        +     * 
        + * + * optional string nickname = 8; + * + * @param value The nickname to set. + * @return This builder for chaining. + */ + public Builder setNickname(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + nickname_ = value; + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + + /** + * + * + *
        +     * The nickname of the user.
        +     *
        +     * (-- aip.dev/not-precedent: An empty string is a valid nickname.
        +     * Ordinarily, proto3_optional should not be used on a `string` field. --)
        +     * 
        + * + * optional string nickname = 8; + * + * @return This builder for chaining. + */ + public Builder clearNickname() { + nickname_ = getDefaultInstance().getNickname(); + bitField0_ = (bitField0_ & ~0x00000080); + onChanged(); + return this; + } + + /** + * + * + *
        +     * The nickname of the user.
        +     *
        +     * (-- aip.dev/not-precedent: An empty string is a valid nickname.
        +     * Ordinarily, proto3_optional should not be used on a `string` field. --)
        +     * 
        + * + * optional string nickname = 8; + * + * @param value The bytes for nickname to set. + * @return This builder for chaining. + */ + public Builder setNicknameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + nickname_ = value; + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + + private boolean enableNotifications_; + + /** + * + * + *
        +     * Enables the receiving of notifications. The default is true if unset.
        +     *
        +     * (-- aip.dev/not-precedent: The default for the feature is true.
        +     * Ordinarily, the default for a `bool` field should be false. --)
        +     * 
        + * + * optional bool enable_notifications = 9; + * + * @return Whether the enableNotifications field is set. + */ + @java.lang.Override + public boolean hasEnableNotifications() { + return ((bitField0_ & 0x00000100) != 0); + } + + /** + * + * + *
        +     * Enables the receiving of notifications. The default is true if unset.
        +     *
        +     * (-- aip.dev/not-precedent: The default for the feature is true.
        +     * Ordinarily, the default for a `bool` field should be false. --)
        +     * 
        + * + * optional bool enable_notifications = 9; + * + * @return The enableNotifications. + */ + @java.lang.Override + public boolean getEnableNotifications() { + return enableNotifications_; + } + + /** + * + * + *
        +     * Enables the receiving of notifications. The default is true if unset.
        +     *
        +     * (-- aip.dev/not-precedent: The default for the feature is true.
        +     * Ordinarily, the default for a `bool` field should be false. --)
        +     * 
        + * + * optional bool enable_notifications = 9; + * + * @param value The enableNotifications to set. + * @return This builder for chaining. + */ + public Builder setEnableNotifications(boolean value) { + + enableNotifications_ = value; + bitField0_ |= 0x00000100; + onChanged(); + return this; + } + + /** + * + * + *
        +     * Enables the receiving of notifications. The default is true if unset.
        +     *
        +     * (-- aip.dev/not-precedent: The default for the feature is true.
        +     * Ordinarily, the default for a `bool` field should be false. --)
        +     * 
        + * + * optional bool enable_notifications = 9; + * + * @return This builder for chaining. + */ + public Builder clearEnableNotifications() { + bitField0_ = (bitField0_ & ~0x00000100); + enableNotifications_ = false; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.showcase.v1beta1.User) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.User) + private static final com.google.showcase.v1beta1.User DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.User(); + } + + public static com.google.showcase.v1beta1.User getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public User 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.showcase.v1beta1.User getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/UserName.java b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/UserName.java new file mode 100644 index 0000000000..92105d5d77 --- /dev/null +++ b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/UserName.java @@ -0,0 +1,166 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1; + +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +@Generated("by gapic-generator-java") +public class UserName implements ResourceName { + private static final PathTemplate USER = PathTemplate.createWithoutUrlEncoding("users/{user}"); + private volatile Map fieldValuesMap; + private final String user; + + @Deprecated + protected UserName() { + user = null; + } + + private UserName(Builder builder) { + user = Preconditions.checkNotNull(builder.getUser()); + } + + public String getUser() { + return user; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + public static UserName of(String user) { + return newBuilder().setUser(user).build(); + } + + public static String format(String user) { + return newBuilder().setUser(user).build().toString(); + } + + public static UserName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + USER.validatedMatch(formattedString, "UserName.parse: formattedString not in valid format"); + return of(matchMap.get("user")); + } + + 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 (UserName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return USER.matches(formattedString); + } + + @Override + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + if (user != null) { + fieldMapBuilder.put("user", user); + } + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return USER.instantiate("user", user); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o != null && getClass() == o.getClass()) { + UserName that = ((UserName) o); + return Objects.equals(this.user, that.user); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= Objects.hashCode(user); + return h; + } + + /** Builder for users/{user}. */ + public static class Builder { + private String user; + + protected Builder() {} + + public String getUser() { + return user; + } + + public Builder setUser(String user) { + this.user = user; + return this; + } + + private Builder(UserName userName) { + this.user = userName.user; + } + + public UserName build() { + return new UserName(this); + } + } +} diff --git a/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/UserOrBuilder.java b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/UserOrBuilder.java new file mode 100644 index 0000000000..e3b40cec36 --- /dev/null +++ b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/UserOrBuilder.java @@ -0,0 +1,318 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: schema/google/showcase/v1beta1/identity.proto +// Protobuf Java Version: 4.33.2 + +package com.google.showcase.v1beta1; + +@com.google.protobuf.Generated +public interface UserOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.User) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
        +   * The resource name of the user.
        +   * 
        + * + * string name = 1; + * + * @return The name. + */ + java.lang.String getName(); + + /** + * + * + *
        +   * The resource name of the user.
        +   * 
        + * + * string name = 1; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
        +   * The display_name of the user.
        +   * 
        + * + * string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The displayName. + */ + java.lang.String getDisplayName(); + + /** + * + * + *
        +   * The display_name of the user.
        +   * 
        + * + * string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for displayName. + */ + com.google.protobuf.ByteString getDisplayNameBytes(); + + /** + * + * + *
        +   * The email address of the user.
        +   * 
        + * + * string email = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The email. + */ + java.lang.String getEmail(); + + /** + * + * + *
        +   * The email address of the user.
        +   * 
        + * + * string email = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for email. + */ + com.google.protobuf.ByteString getEmailBytes(); + + /** + * + * + *
        +   * The timestamp at which the user was created.
        +   * 
        + * + * .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the createTime field is set. + */ + boolean hasCreateTime(); + + /** + * + * + *
        +   * The timestamp at which the user was created.
        +   * 
        + * + * .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The createTime. + */ + com.google.protobuf.Timestamp getCreateTime(); + + /** + * + * + *
        +   * The timestamp at which the user was created.
        +   * 
        + * + * .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder(); + + /** + * + * + *
        +   * The latest timestamp at which the user was updated.
        +   * 
        + * + * .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the updateTime field is set. + */ + boolean hasUpdateTime(); + + /** + * + * + *
        +   * The latest timestamp at which the user was updated.
        +   * 
        + * + * .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The updateTime. + */ + com.google.protobuf.Timestamp getUpdateTime(); + + /** + * + * + *
        +   * The latest timestamp at which the user was updated.
        +   * 
        + * + * .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder(); + + /** + * + * + *
        +   * The age of the user in years.
        +   * 
        + * + * optional int32 age = 6; + * + * @return Whether the age field is set. + */ + boolean hasAge(); + + /** + * + * + *
        +   * The age of the user in years.
        +   * 
        + * + * optional int32 age = 6; + * + * @return The age. + */ + int getAge(); + + /** + * + * + *
        +   * The height of the user in feet.
        +   * 
        + * + * optional double height_feet = 7; + * + * @return Whether the heightFeet field is set. + */ + boolean hasHeightFeet(); + + /** + * + * + *
        +   * The height of the user in feet.
        +   * 
        + * + * optional double height_feet = 7; + * + * @return The heightFeet. + */ + double getHeightFeet(); + + /** + * + * + *
        +   * The nickname of the user.
        +   *
        +   * (-- aip.dev/not-precedent: An empty string is a valid nickname.
        +   * Ordinarily, proto3_optional should not be used on a `string` field. --)
        +   * 
        + * + * optional string nickname = 8; + * + * @return Whether the nickname field is set. + */ + boolean hasNickname(); + + /** + * + * + *
        +   * The nickname of the user.
        +   *
        +   * (-- aip.dev/not-precedent: An empty string is a valid nickname.
        +   * Ordinarily, proto3_optional should not be used on a `string` field. --)
        +   * 
        + * + * optional string nickname = 8; + * + * @return The nickname. + */ + java.lang.String getNickname(); + + /** + * + * + *
        +   * The nickname of the user.
        +   *
        +   * (-- aip.dev/not-precedent: An empty string is a valid nickname.
        +   * Ordinarily, proto3_optional should not be used on a `string` field. --)
        +   * 
        + * + * optional string nickname = 8; + * + * @return The bytes for nickname. + */ + com.google.protobuf.ByteString getNicknameBytes(); + + /** + * + * + *
        +   * Enables the receiving of notifications. The default is true if unset.
        +   *
        +   * (-- aip.dev/not-precedent: The default for the feature is true.
        +   * Ordinarily, the default for a `bool` field should be false. --)
        +   * 
        + * + * optional bool enable_notifications = 9; + * + * @return Whether the enableNotifications field is set. + */ + boolean hasEnableNotifications(); + + /** + * + * + *
        +   * Enables the receiving of notifications. The default is true if unset.
        +   *
        +   * (-- aip.dev/not-precedent: The default for the feature is true.
        +   * Ordinarily, the default for a `bool` field should be false. --)
        +   * 
        + * + * optional bool enable_notifications = 9; + * + * @return The enableNotifications. + */ + boolean getEnableNotifications(); +} diff --git a/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/VerifyTestRequest.java b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/VerifyTestRequest.java new file mode 100644 index 0000000000..e68a697226 --- /dev/null +++ b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/VerifyTestRequest.java @@ -0,0 +1,915 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: schema/google/showcase/v1beta1/testing.proto +// Protobuf Java Version: 4.33.2 + +package com.google.showcase.v1beta1; + +/** Protobuf type {@code google.showcase.v1beta1.VerifyTestRequest} */ +@com.google.protobuf.Generated +public final class VerifyTestRequest extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.VerifyTestRequest) + VerifyTestRequestOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "VerifyTestRequest"); + } + + // Use VerifyTestRequest.newBuilder() to construct. + private VerifyTestRequest(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private VerifyTestRequest() { + name_ = ""; + answer_ = com.google.protobuf.ByteString.EMPTY; + answers_ = emptyList(com.google.protobuf.ByteString.class); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.TestingOuterClass + .internal_static_google_showcase_v1beta1_VerifyTestRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.TestingOuterClass + .internal_static_google_showcase_v1beta1_VerifyTestRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.VerifyTestRequest.class, + com.google.showcase.v1beta1.VerifyTestRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + + /** + * + * + *
        +   * The test to have an answer registered to it.
        +   * 
        + * + * string name = 1 [(.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; + } + } + + /** + * + * + *
        +   * The test to have an answer registered to it.
        +   * 
        + * + * string name = 1 [(.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 ANSWER_FIELD_NUMBER = 2; + private com.google.protobuf.ByteString answer_ = com.google.protobuf.ByteString.EMPTY; + + /** + * + * + *
        +   * The answer from the test.
        +   * 
        + * + * bytes answer = 2; + * + * @return The answer. + */ + @java.lang.Override + public com.google.protobuf.ByteString getAnswer() { + return answer_; + } + + public static final int ANSWERS_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private com.google.protobuf.Internal.ProtobufList answers_ = + emptyList(com.google.protobuf.ByteString.class); + + /** + * + * + *
        +   * The answers from the test if multiple are to be checked
        +   * 
        + * + * repeated bytes answers = 3; + * + * @return A list containing the answers. + */ + @java.lang.Override + public java.util.List getAnswersList() { + return answers_; + } + + /** + * + * + *
        +   * The answers from the test if multiple are to be checked
        +   * 
        + * + * repeated bytes answers = 3; + * + * @return The count of answers. + */ + public int getAnswersCount() { + return answers_.size(); + } + + /** + * + * + *
        +   * The answers from the test if multiple are to be checked
        +   * 
        + * + * repeated bytes answers = 3; + * + * @param index The index of the element to return. + * @return The answers at the given index. + */ + public com.google.protobuf.ByteString getAnswers(int index) { + return answers_.get(index); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, name_); + } + if (!answer_.isEmpty()) { + output.writeBytes(2, answer_); + } + for (int i = 0; i < answers_.size(); i++) { + output.writeBytes(3, answers_.get(i)); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, name_); + } + if (!answer_.isEmpty()) { + size += com.google.protobuf.CodedOutputStream.computeBytesSize(2, answer_); + } + { + int dataSize = 0; + for (int i = 0; i < answers_.size(); i++) { + dataSize += com.google.protobuf.CodedOutputStream.computeBytesSizeNoTag(answers_.get(i)); + } + size += dataSize; + size += 1 * getAnswersList().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.showcase.v1beta1.VerifyTestRequest)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.VerifyTestRequest other = + (com.google.showcase.v1beta1.VerifyTestRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (!getAnswer().equals(other.getAnswer())) return false; + if (!getAnswersList().equals(other.getAnswersList())) 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) + ANSWER_FIELD_NUMBER; + hash = (53 * hash) + getAnswer().hashCode(); + if (getAnswersCount() > 0) { + hash = (37 * hash) + ANSWERS_FIELD_NUMBER; + hash = (53 * hash) + getAnswersList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.showcase.v1beta1.VerifyTestRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.VerifyTestRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.VerifyTestRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.VerifyTestRequest 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.showcase.v1beta1.VerifyTestRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.VerifyTestRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.VerifyTestRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.VerifyTestRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.showcase.v1beta1.VerifyTestRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.VerifyTestRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.showcase.v1beta1.VerifyTestRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.VerifyTestRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.showcase.v1beta1.VerifyTestRequest 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** Protobuf type {@code google.showcase.v1beta1.VerifyTestRequest} */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.VerifyTestRequest) + com.google.showcase.v1beta1.VerifyTestRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.TestingOuterClass + .internal_static_google_showcase_v1beta1_VerifyTestRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.TestingOuterClass + .internal_static_google_showcase_v1beta1_VerifyTestRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.VerifyTestRequest.class, + com.google.showcase.v1beta1.VerifyTestRequest.Builder.class); + } + + // Construct using com.google.showcase.v1beta1.VerifyTestRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + answer_ = com.google.protobuf.ByteString.EMPTY; + answers_ = emptyList(com.google.protobuf.ByteString.class); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.showcase.v1beta1.TestingOuterClass + .internal_static_google_showcase_v1beta1_VerifyTestRequest_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.VerifyTestRequest getDefaultInstanceForType() { + return com.google.showcase.v1beta1.VerifyTestRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.VerifyTestRequest build() { + com.google.showcase.v1beta1.VerifyTestRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.VerifyTestRequest buildPartial() { + com.google.showcase.v1beta1.VerifyTestRequest result = + new com.google.showcase.v1beta1.VerifyTestRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.showcase.v1beta1.VerifyTestRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.answer_ = answer_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + answers_.makeImmutable(); + result.answers_ = answers_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.showcase.v1beta1.VerifyTestRequest) { + return mergeFrom((com.google.showcase.v1beta1.VerifyTestRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.showcase.v1beta1.VerifyTestRequest other) { + if (other == com.google.showcase.v1beta1.VerifyTestRequest.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getAnswer().isEmpty()) { + setAnswer(other.getAnswer()); + } + if (!other.answers_.isEmpty()) { + if (answers_.isEmpty()) { + answers_ = other.answers_; + answers_.makeImmutable(); + bitField0_ |= 0x00000004; + } else { + ensureAnswersIsMutable(); + answers_.addAll(other.answers_); + } + 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: + { + answer_ = input.readBytes(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + com.google.protobuf.ByteString v = input.readBytes(); + ensureAnswersIsMutable(); + answers_.add(v); + 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_ = ""; + + /** + * + * + *
        +     * The test to have an answer registered to it.
        +     * 
        + * + * string name = 1 [(.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; + } + } + + /** + * + * + *
        +     * The test to have an answer registered to it.
        +     * 
        + * + * string name = 1 [(.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; + } + } + + /** + * + * + *
        +     * The test to have an answer registered to it.
        +     * 
        + * + * string name = 1 [(.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; + } + + /** + * + * + *
        +     * The test to have an answer registered to it.
        +     * 
        + * + * string name = 1 [(.google.api.resource_reference) = { ... } + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
        +     * The test to have an answer registered to it.
        +     * 
        + * + * string name = 1 [(.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.protobuf.ByteString answer_ = com.google.protobuf.ByteString.EMPTY; + + /** + * + * + *
        +     * The answer from the test.
        +     * 
        + * + * bytes answer = 2; + * + * @return The answer. + */ + @java.lang.Override + public com.google.protobuf.ByteString getAnswer() { + return answer_; + } + + /** + * + * + *
        +     * The answer from the test.
        +     * 
        + * + * bytes answer = 2; + * + * @param value The answer to set. + * @return This builder for chaining. + */ + public Builder setAnswer(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + answer_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
        +     * The answer from the test.
        +     * 
        + * + * bytes answer = 2; + * + * @return This builder for chaining. + */ + public Builder clearAnswer() { + bitField0_ = (bitField0_ & ~0x00000002); + answer_ = getDefaultInstance().getAnswer(); + onChanged(); + return this; + } + + private com.google.protobuf.Internal.ProtobufList answers_ = + emptyList(com.google.protobuf.ByteString.class); + + private void ensureAnswersIsMutable() { + if (!answers_.isModifiable()) { + answers_ = makeMutableCopy(answers_); + } + bitField0_ |= 0x00000004; + } + + /** + * + * + *
        +     * The answers from the test if multiple are to be checked
        +     * 
        + * + * repeated bytes answers = 3; + * + * @return A list containing the answers. + */ + public java.util.List getAnswersList() { + answers_.makeImmutable(); + return answers_; + } + + /** + * + * + *
        +     * The answers from the test if multiple are to be checked
        +     * 
        + * + * repeated bytes answers = 3; + * + * @return The count of answers. + */ + public int getAnswersCount() { + return answers_.size(); + } + + /** + * + * + *
        +     * The answers from the test if multiple are to be checked
        +     * 
        + * + * repeated bytes answers = 3; + * + * @param index The index of the element to return. + * @return The answers at the given index. + */ + public com.google.protobuf.ByteString getAnswers(int index) { + return answers_.get(index); + } + + /** + * + * + *
        +     * The answers from the test if multiple are to be checked
        +     * 
        + * + * repeated bytes answers = 3; + * + * @param index The index to set the value at. + * @param value The answers to set. + * @return This builder for chaining. + */ + public Builder setAnswers(int index, com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + ensureAnswersIsMutable(); + answers_.set(index, value); + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
        +     * The answers from the test if multiple are to be checked
        +     * 
        + * + * repeated bytes answers = 3; + * + * @param value The answers to add. + * @return This builder for chaining. + */ + public Builder addAnswers(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + ensureAnswersIsMutable(); + answers_.add(value); + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
        +     * The answers from the test if multiple are to be checked
        +     * 
        + * + * repeated bytes answers = 3; + * + * @param values The answers to add. + * @return This builder for chaining. + */ + public Builder addAllAnswers( + java.lang.Iterable values) { + ensureAnswersIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, answers_); + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
        +     * The answers from the test if multiple are to be checked
        +     * 
        + * + * repeated bytes answers = 3; + * + * @return This builder for chaining. + */ + public Builder clearAnswers() { + answers_ = emptyList(com.google.protobuf.ByteString.class); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.showcase.v1beta1.VerifyTestRequest) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.VerifyTestRequest) + private static final com.google.showcase.v1beta1.VerifyTestRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.VerifyTestRequest(); + } + + public static com.google.showcase.v1beta1.VerifyTestRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public VerifyTestRequest 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.showcase.v1beta1.VerifyTestRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/VerifyTestRequestOrBuilder.java b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/VerifyTestRequestOrBuilder.java new file mode 100644 index 0000000000..3c9d1e2306 --- /dev/null +++ b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/VerifyTestRequestOrBuilder.java @@ -0,0 +1,107 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: schema/google/showcase/v1beta1/testing.proto +// Protobuf Java Version: 4.33.2 + +package com.google.showcase.v1beta1; + +@com.google.protobuf.Generated +public interface VerifyTestRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.VerifyTestRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
        +   * The test to have an answer registered to it.
        +   * 
        + * + * string name = 1 [(.google.api.resource_reference) = { ... } + * + * @return The name. + */ + java.lang.String getName(); + + /** + * + * + *
        +   * The test to have an answer registered to it.
        +   * 
        + * + * string name = 1 [(.google.api.resource_reference) = { ... } + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
        +   * The answer from the test.
        +   * 
        + * + * bytes answer = 2; + * + * @return The answer. + */ + com.google.protobuf.ByteString getAnswer(); + + /** + * + * + *
        +   * The answers from the test if multiple are to be checked
        +   * 
        + * + * repeated bytes answers = 3; + * + * @return A list containing the answers. + */ + java.util.List getAnswersList(); + + /** + * + * + *
        +   * The answers from the test if multiple are to be checked
        +   * 
        + * + * repeated bytes answers = 3; + * + * @return The count of answers. + */ + int getAnswersCount(); + + /** + * + * + *
        +   * The answers from the test if multiple are to be checked
        +   * 
        + * + * repeated bytes answers = 3; + * + * @param index The index of the element to return. + * @return The answers at the given index. + */ + com.google.protobuf.ByteString getAnswers(int index); +} diff --git a/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/VerifyTestResponse.java b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/VerifyTestResponse.java new file mode 100644 index 0000000000..9346537df1 --- /dev/null +++ b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/VerifyTestResponse.java @@ -0,0 +1,672 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: schema/google/showcase/v1beta1/testing.proto +// Protobuf Java Version: 4.33.2 + +package com.google.showcase.v1beta1; + +/** Protobuf type {@code google.showcase.v1beta1.VerifyTestResponse} */ +@com.google.protobuf.Generated +public final class VerifyTestResponse extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.VerifyTestResponse) + VerifyTestResponseOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "VerifyTestResponse"); + } + + // Use VerifyTestResponse.newBuilder() to construct. + private VerifyTestResponse(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private VerifyTestResponse() {} + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.TestingOuterClass + .internal_static_google_showcase_v1beta1_VerifyTestResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.TestingOuterClass + .internal_static_google_showcase_v1beta1_VerifyTestResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.VerifyTestResponse.class, + com.google.showcase.v1beta1.VerifyTestResponse.Builder.class); + } + + private int bitField0_; + public static final int ISSUE_FIELD_NUMBER = 1; + private com.google.showcase.v1beta1.Issue issue_; + + /** + * + * + *
        +   * An issue if check answer was unsuccessful. This will be empty if the check answer succeeded.
        +   * 
        + * + * .google.showcase.v1beta1.Issue issue = 1; + * + * @return Whether the issue field is set. + */ + @java.lang.Override + public boolean hasIssue() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
        +   * An issue if check answer was unsuccessful. This will be empty if the check answer succeeded.
        +   * 
        + * + * .google.showcase.v1beta1.Issue issue = 1; + * + * @return The issue. + */ + @java.lang.Override + public com.google.showcase.v1beta1.Issue getIssue() { + return issue_ == null ? com.google.showcase.v1beta1.Issue.getDefaultInstance() : issue_; + } + + /** + * + * + *
        +   * An issue if check answer was unsuccessful. This will be empty if the check answer succeeded.
        +   * 
        + * + * .google.showcase.v1beta1.Issue issue = 1; + */ + @java.lang.Override + public com.google.showcase.v1beta1.IssueOrBuilder getIssueOrBuilder() { + return issue_ == null ? com.google.showcase.v1beta1.Issue.getDefaultInstance() : issue_; + } + + 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, getIssue()); + } + 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, getIssue()); + } + 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.showcase.v1beta1.VerifyTestResponse)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.VerifyTestResponse other = + (com.google.showcase.v1beta1.VerifyTestResponse) obj; + + if (hasIssue() != other.hasIssue()) return false; + if (hasIssue()) { + if (!getIssue().equals(other.getIssue())) 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 (hasIssue()) { + hash = (37 * hash) + ISSUE_FIELD_NUMBER; + hash = (53 * hash) + getIssue().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.showcase.v1beta1.VerifyTestResponse parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.VerifyTestResponse parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.VerifyTestResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.VerifyTestResponse 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.showcase.v1beta1.VerifyTestResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.VerifyTestResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.VerifyTestResponse parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.VerifyTestResponse parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.showcase.v1beta1.VerifyTestResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.VerifyTestResponse parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.showcase.v1beta1.VerifyTestResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.VerifyTestResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.showcase.v1beta1.VerifyTestResponse 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** Protobuf type {@code google.showcase.v1beta1.VerifyTestResponse} */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.VerifyTestResponse) + com.google.showcase.v1beta1.VerifyTestResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.TestingOuterClass + .internal_static_google_showcase_v1beta1_VerifyTestResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.TestingOuterClass + .internal_static_google_showcase_v1beta1_VerifyTestResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.VerifyTestResponse.class, + com.google.showcase.v1beta1.VerifyTestResponse.Builder.class); + } + + // Construct using com.google.showcase.v1beta1.VerifyTestResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetIssueFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + issue_ = null; + if (issueBuilder_ != null) { + issueBuilder_.dispose(); + issueBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.showcase.v1beta1.TestingOuterClass + .internal_static_google_showcase_v1beta1_VerifyTestResponse_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.VerifyTestResponse getDefaultInstanceForType() { + return com.google.showcase.v1beta1.VerifyTestResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.VerifyTestResponse build() { + com.google.showcase.v1beta1.VerifyTestResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.VerifyTestResponse buildPartial() { + com.google.showcase.v1beta1.VerifyTestResponse result = + new com.google.showcase.v1beta1.VerifyTestResponse(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.showcase.v1beta1.VerifyTestResponse result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.issue_ = issueBuilder_ == null ? issue_ : issueBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.showcase.v1beta1.VerifyTestResponse) { + return mergeFrom((com.google.showcase.v1beta1.VerifyTestResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.showcase.v1beta1.VerifyTestResponse other) { + if (other == com.google.showcase.v1beta1.VerifyTestResponse.getDefaultInstance()) return this; + if (other.hasIssue()) { + mergeIssue(other.getIssue()); + } + 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(internalGetIssueFieldBuilder().getBuilder(), extensionRegistry); + 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 com.google.showcase.v1beta1.Issue issue_; + private com.google.protobuf.SingleFieldBuilder< + com.google.showcase.v1beta1.Issue, + com.google.showcase.v1beta1.Issue.Builder, + com.google.showcase.v1beta1.IssueOrBuilder> + issueBuilder_; + + /** + * + * + *
        +     * An issue if check answer was unsuccessful. This will be empty if the check answer succeeded.
        +     * 
        + * + * .google.showcase.v1beta1.Issue issue = 1; + * + * @return Whether the issue field is set. + */ + public boolean hasIssue() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
        +     * An issue if check answer was unsuccessful. This will be empty if the check answer succeeded.
        +     * 
        + * + * .google.showcase.v1beta1.Issue issue = 1; + * + * @return The issue. + */ + public com.google.showcase.v1beta1.Issue getIssue() { + if (issueBuilder_ == null) { + return issue_ == null ? com.google.showcase.v1beta1.Issue.getDefaultInstance() : issue_; + } else { + return issueBuilder_.getMessage(); + } + } + + /** + * + * + *
        +     * An issue if check answer was unsuccessful. This will be empty if the check answer succeeded.
        +     * 
        + * + * .google.showcase.v1beta1.Issue issue = 1; + */ + public Builder setIssue(com.google.showcase.v1beta1.Issue value) { + if (issueBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + issue_ = value; + } else { + issueBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
        +     * An issue if check answer was unsuccessful. This will be empty if the check answer succeeded.
        +     * 
        + * + * .google.showcase.v1beta1.Issue issue = 1; + */ + public Builder setIssue(com.google.showcase.v1beta1.Issue.Builder builderForValue) { + if (issueBuilder_ == null) { + issue_ = builderForValue.build(); + } else { + issueBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
        +     * An issue if check answer was unsuccessful. This will be empty if the check answer succeeded.
        +     * 
        + * + * .google.showcase.v1beta1.Issue issue = 1; + */ + public Builder mergeIssue(com.google.showcase.v1beta1.Issue value) { + if (issueBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) + && issue_ != null + && issue_ != com.google.showcase.v1beta1.Issue.getDefaultInstance()) { + getIssueBuilder().mergeFrom(value); + } else { + issue_ = value; + } + } else { + issueBuilder_.mergeFrom(value); + } + if (issue_ != null) { + bitField0_ |= 0x00000001; + onChanged(); + } + return this; + } + + /** + * + * + *
        +     * An issue if check answer was unsuccessful. This will be empty if the check answer succeeded.
        +     * 
        + * + * .google.showcase.v1beta1.Issue issue = 1; + */ + public Builder clearIssue() { + bitField0_ = (bitField0_ & ~0x00000001); + issue_ = null; + if (issueBuilder_ != null) { + issueBuilder_.dispose(); + issueBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
        +     * An issue if check answer was unsuccessful. This will be empty if the check answer succeeded.
        +     * 
        + * + * .google.showcase.v1beta1.Issue issue = 1; + */ + public com.google.showcase.v1beta1.Issue.Builder getIssueBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return internalGetIssueFieldBuilder().getBuilder(); + } + + /** + * + * + *
        +     * An issue if check answer was unsuccessful. This will be empty if the check answer succeeded.
        +     * 
        + * + * .google.showcase.v1beta1.Issue issue = 1; + */ + public com.google.showcase.v1beta1.IssueOrBuilder getIssueOrBuilder() { + if (issueBuilder_ != null) { + return issueBuilder_.getMessageOrBuilder(); + } else { + return issue_ == null ? com.google.showcase.v1beta1.Issue.getDefaultInstance() : issue_; + } + } + + /** + * + * + *
        +     * An issue if check answer was unsuccessful. This will be empty if the check answer succeeded.
        +     * 
        + * + * .google.showcase.v1beta1.Issue issue = 1; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.showcase.v1beta1.Issue, + com.google.showcase.v1beta1.Issue.Builder, + com.google.showcase.v1beta1.IssueOrBuilder> + internalGetIssueFieldBuilder() { + if (issueBuilder_ == null) { + issueBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.showcase.v1beta1.Issue, + com.google.showcase.v1beta1.Issue.Builder, + com.google.showcase.v1beta1.IssueOrBuilder>( + getIssue(), getParentForChildren(), isClean()); + issue_ = null; + } + return issueBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.showcase.v1beta1.VerifyTestResponse) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.VerifyTestResponse) + private static final com.google.showcase.v1beta1.VerifyTestResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.VerifyTestResponse(); + } + + public static com.google.showcase.v1beta1.VerifyTestResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public VerifyTestResponse 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.showcase.v1beta1.VerifyTestResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/VerifyTestResponseOrBuilder.java b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/VerifyTestResponseOrBuilder.java new file mode 100644 index 0000000000..76b44e629a --- /dev/null +++ b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/VerifyTestResponseOrBuilder.java @@ -0,0 +1,65 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: schema/google/showcase/v1beta1/testing.proto +// Protobuf Java Version: 4.33.2 + +package com.google.showcase.v1beta1; + +@com.google.protobuf.Generated +public interface VerifyTestResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.VerifyTestResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
        +   * An issue if check answer was unsuccessful. This will be empty if the check answer succeeded.
        +   * 
        + * + * .google.showcase.v1beta1.Issue issue = 1; + * + * @return Whether the issue field is set. + */ + boolean hasIssue(); + + /** + * + * + *
        +   * An issue if check answer was unsuccessful. This will be empty if the check answer succeeded.
        +   * 
        + * + * .google.showcase.v1beta1.Issue issue = 1; + * + * @return The issue. + */ + com.google.showcase.v1beta1.Issue getIssue(); + + /** + * + * + *
        +   * An issue if check answer was unsuccessful. This will be empty if the check answer succeeded.
        +   * 
        + * + * .google.showcase.v1beta1.Issue issue = 1; + */ + com.google.showcase.v1beta1.IssueOrBuilder getIssueOrBuilder(); +} diff --git a/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/WaitMetadata.java b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/WaitMetadata.java new file mode 100644 index 0000000000..50bf4a1f5b --- /dev/null +++ b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/WaitMetadata.java @@ -0,0 +1,687 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: schema/google/showcase/v1beta1/echo.proto +// Protobuf Java Version: 4.33.2 + +package com.google.showcase.v1beta1; + +/** + * + * + *
        + * The metadata for Wait operation.
        + * 
        + * + * Protobuf type {@code google.showcase.v1beta1.WaitMetadata} + */ +@com.google.protobuf.Generated +public final class WaitMetadata extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.WaitMetadata) + WaitMetadataOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "WaitMetadata"); + } + + // Use WaitMetadata.newBuilder() to construct. + private WaitMetadata(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private WaitMetadata() {} + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.EchoOuterClass + .internal_static_google_showcase_v1beta1_WaitMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.EchoOuterClass + .internal_static_google_showcase_v1beta1_WaitMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.WaitMetadata.class, + com.google.showcase.v1beta1.WaitMetadata.Builder.class); + } + + private int bitField0_; + public static final int END_TIME_FIELD_NUMBER = 1; + private com.google.protobuf.Timestamp endTime_; + + /** + * + * + *
        +   * The time that this operation will complete.
        +   * 
        + * + * .google.protobuf.Timestamp end_time = 1; + * + * @return Whether the endTime field is set. + */ + @java.lang.Override + public boolean hasEndTime() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
        +   * The time that this operation will complete.
        +   * 
        + * + * .google.protobuf.Timestamp end_time = 1; + * + * @return The endTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getEndTime() { + return endTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : endTime_; + } + + /** + * + * + *
        +   * The time that this operation will complete.
        +   * 
        + * + * .google.protobuf.Timestamp end_time = 1; + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getEndTimeOrBuilder() { + return endTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : endTime_; + } + + 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, getEndTime()); + } + 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, getEndTime()); + } + 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.showcase.v1beta1.WaitMetadata)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.WaitMetadata other = (com.google.showcase.v1beta1.WaitMetadata) obj; + + if (hasEndTime() != other.hasEndTime()) return false; + if (hasEndTime()) { + if (!getEndTime().equals(other.getEndTime())) 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 (hasEndTime()) { + hash = (37 * hash) + END_TIME_FIELD_NUMBER; + hash = (53 * hash) + getEndTime().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.showcase.v1beta1.WaitMetadata parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.WaitMetadata parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.WaitMetadata parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.WaitMetadata 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.showcase.v1beta1.WaitMetadata parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.WaitMetadata parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.WaitMetadata parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.WaitMetadata parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.showcase.v1beta1.WaitMetadata parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.WaitMetadata parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.showcase.v1beta1.WaitMetadata parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.WaitMetadata parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.showcase.v1beta1.WaitMetadata 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
        +   * The metadata for Wait operation.
        +   * 
        + * + * Protobuf type {@code google.showcase.v1beta1.WaitMetadata} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.WaitMetadata) + com.google.showcase.v1beta1.WaitMetadataOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.EchoOuterClass + .internal_static_google_showcase_v1beta1_WaitMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.EchoOuterClass + .internal_static_google_showcase_v1beta1_WaitMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.WaitMetadata.class, + com.google.showcase.v1beta1.WaitMetadata.Builder.class); + } + + // Construct using com.google.showcase.v1beta1.WaitMetadata.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetEndTimeFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + endTime_ = null; + if (endTimeBuilder_ != null) { + endTimeBuilder_.dispose(); + endTimeBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.showcase.v1beta1.EchoOuterClass + .internal_static_google_showcase_v1beta1_WaitMetadata_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.WaitMetadata getDefaultInstanceForType() { + return com.google.showcase.v1beta1.WaitMetadata.getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.WaitMetadata build() { + com.google.showcase.v1beta1.WaitMetadata result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.WaitMetadata buildPartial() { + com.google.showcase.v1beta1.WaitMetadata result = + new com.google.showcase.v1beta1.WaitMetadata(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.showcase.v1beta1.WaitMetadata result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.endTime_ = endTimeBuilder_ == null ? endTime_ : endTimeBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.showcase.v1beta1.WaitMetadata) { + return mergeFrom((com.google.showcase.v1beta1.WaitMetadata) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.showcase.v1beta1.WaitMetadata other) { + if (other == com.google.showcase.v1beta1.WaitMetadata.getDefaultInstance()) return this; + if (other.hasEndTime()) { + mergeEndTime(other.getEndTime()); + } + 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(internalGetEndTimeFieldBuilder().getBuilder(), extensionRegistry); + 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 com.google.protobuf.Timestamp endTime_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + endTimeBuilder_; + + /** + * + * + *
        +     * The time that this operation will complete.
        +     * 
        + * + * .google.protobuf.Timestamp end_time = 1; + * + * @return Whether the endTime field is set. + */ + public boolean hasEndTime() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
        +     * The time that this operation will complete.
        +     * 
        + * + * .google.protobuf.Timestamp end_time = 1; + * + * @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 time that this operation will complete.
        +     * 
        + * + * .google.protobuf.Timestamp end_time = 1; + */ + public Builder setEndTime(com.google.protobuf.Timestamp value) { + if (endTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + endTime_ = value; + } else { + endTimeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
        +     * The time that this operation will complete.
        +     * 
        + * + * .google.protobuf.Timestamp end_time = 1; + */ + public Builder setEndTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (endTimeBuilder_ == null) { + endTime_ = builderForValue.build(); + } else { + endTimeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
        +     * The time that this operation will complete.
        +     * 
        + * + * .google.protobuf.Timestamp end_time = 1; + */ + public Builder mergeEndTime(com.google.protobuf.Timestamp value) { + if (endTimeBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) + && endTime_ != null + && endTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getEndTimeBuilder().mergeFrom(value); + } else { + endTime_ = value; + } + } else { + endTimeBuilder_.mergeFrom(value); + } + if (endTime_ != null) { + bitField0_ |= 0x00000001; + onChanged(); + } + return this; + } + + /** + * + * + *
        +     * The time that this operation will complete.
        +     * 
        + * + * .google.protobuf.Timestamp end_time = 1; + */ + public Builder clearEndTime() { + bitField0_ = (bitField0_ & ~0x00000001); + endTime_ = null; + if (endTimeBuilder_ != null) { + endTimeBuilder_.dispose(); + endTimeBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
        +     * The time that this operation will complete.
        +     * 
        + * + * .google.protobuf.Timestamp end_time = 1; + */ + public com.google.protobuf.Timestamp.Builder getEndTimeBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return internalGetEndTimeFieldBuilder().getBuilder(); + } + + /** + * + * + *
        +     * The time that this operation will complete.
        +     * 
        + * + * .google.protobuf.Timestamp end_time = 1; + */ + public com.google.protobuf.TimestampOrBuilder getEndTimeOrBuilder() { + if (endTimeBuilder_ != null) { + return endTimeBuilder_.getMessageOrBuilder(); + } else { + return endTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : endTime_; + } + } + + /** + * + * + *
        +     * The time that this operation will complete.
        +     * 
        + * + * .google.protobuf.Timestamp end_time = 1; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + internalGetEndTimeFieldBuilder() { + if (endTimeBuilder_ == null) { + endTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getEndTime(), getParentForChildren(), isClean()); + endTime_ = null; + } + return endTimeBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.showcase.v1beta1.WaitMetadata) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.WaitMetadata) + private static final com.google.showcase.v1beta1.WaitMetadata DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.WaitMetadata(); + } + + public static com.google.showcase.v1beta1.WaitMetadata getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public WaitMetadata 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.showcase.v1beta1.WaitMetadata getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/WaitMetadataOrBuilder.java b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/WaitMetadataOrBuilder.java new file mode 100644 index 0000000000..6748206428 --- /dev/null +++ b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/WaitMetadataOrBuilder.java @@ -0,0 +1,65 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: schema/google/showcase/v1beta1/echo.proto +// Protobuf Java Version: 4.33.2 + +package com.google.showcase.v1beta1; + +@com.google.protobuf.Generated +public interface WaitMetadataOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.WaitMetadata) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
        +   * The time that this operation will complete.
        +   * 
        + * + * .google.protobuf.Timestamp end_time = 1; + * + * @return Whether the endTime field is set. + */ + boolean hasEndTime(); + + /** + * + * + *
        +   * The time that this operation will complete.
        +   * 
        + * + * .google.protobuf.Timestamp end_time = 1; + * + * @return The endTime. + */ + com.google.protobuf.Timestamp getEndTime(); + + /** + * + * + *
        +   * The time that this operation will complete.
        +   * 
        + * + * .google.protobuf.Timestamp end_time = 1; + */ + com.google.protobuf.TimestampOrBuilder getEndTimeOrBuilder(); +} diff --git a/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/WaitRequest.java b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/WaitRequest.java new file mode 100644 index 0000000000..503931d667 --- /dev/null +++ b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/WaitRequest.java @@ -0,0 +1,1782 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: schema/google/showcase/v1beta1/echo.proto +// Protobuf Java Version: 4.33.2 + +package com.google.showcase.v1beta1; + +/** + * + * + *
        + * The request for Wait method.
        + * 
        + * + * Protobuf type {@code google.showcase.v1beta1.WaitRequest} + */ +@com.google.protobuf.Generated +public final class WaitRequest extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.WaitRequest) + WaitRequestOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "WaitRequest"); + } + + // Use WaitRequest.newBuilder() to construct. + private WaitRequest(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private WaitRequest() {} + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.EchoOuterClass + .internal_static_google_showcase_v1beta1_WaitRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.EchoOuterClass + .internal_static_google_showcase_v1beta1_WaitRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.WaitRequest.class, + com.google.showcase.v1beta1.WaitRequest.Builder.class); + } + + private int endCase_ = 0; + + @SuppressWarnings("serial") + private java.lang.Object end_; + + public enum EndCase + implements + com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + END_TIME(1), + TTL(4), + END_NOT_SET(0); + private final int value; + + private EndCase(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 EndCase valueOf(int value) { + return forNumber(value); + } + + public static EndCase forNumber(int value) { + switch (value) { + case 1: + return END_TIME; + case 4: + return TTL; + case 0: + return END_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public EndCase getEndCase() { + return EndCase.forNumber(endCase_); + } + + private int responseCase_ = 0; + + @SuppressWarnings("serial") + private java.lang.Object response_; + + public enum ResponseCase + implements + com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + ERROR(2), + SUCCESS(3), + RESPONSE_NOT_SET(0); + private final int value; + + private ResponseCase(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 ResponseCase valueOf(int value) { + return forNumber(value); + } + + public static ResponseCase forNumber(int value) { + switch (value) { + case 2: + return ERROR; + case 3: + return SUCCESS; + case 0: + return RESPONSE_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public ResponseCase getResponseCase() { + return ResponseCase.forNumber(responseCase_); + } + + public static final int END_TIME_FIELD_NUMBER = 1; + + /** + * + * + *
        +   * The time that this operation will complete.
        +   * 
        + * + * .google.protobuf.Timestamp end_time = 1; + * + * @return Whether the endTime field is set. + */ + @java.lang.Override + public boolean hasEndTime() { + return endCase_ == 1; + } + + /** + * + * + *
        +   * The time that this operation will complete.
        +   * 
        + * + * .google.protobuf.Timestamp end_time = 1; + * + * @return The endTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getEndTime() { + if (endCase_ == 1) { + return (com.google.protobuf.Timestamp) end_; + } + return com.google.protobuf.Timestamp.getDefaultInstance(); + } + + /** + * + * + *
        +   * The time that this operation will complete.
        +   * 
        + * + * .google.protobuf.Timestamp end_time = 1; + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getEndTimeOrBuilder() { + if (endCase_ == 1) { + return (com.google.protobuf.Timestamp) end_; + } + return com.google.protobuf.Timestamp.getDefaultInstance(); + } + + public static final int TTL_FIELD_NUMBER = 4; + + /** + * + * + *
        +   * The duration of this operation.
        +   * 
        + * + * .google.protobuf.Duration ttl = 4; + * + * @return Whether the ttl field is set. + */ + @java.lang.Override + public boolean hasTtl() { + return endCase_ == 4; + } + + /** + * + * + *
        +   * The duration of this operation.
        +   * 
        + * + * .google.protobuf.Duration ttl = 4; + * + * @return The ttl. + */ + @java.lang.Override + public com.google.protobuf.Duration getTtl() { + if (endCase_ == 4) { + return (com.google.protobuf.Duration) end_; + } + return com.google.protobuf.Duration.getDefaultInstance(); + } + + /** + * + * + *
        +   * The duration of this operation.
        +   * 
        + * + * .google.protobuf.Duration ttl = 4; + */ + @java.lang.Override + public com.google.protobuf.DurationOrBuilder getTtlOrBuilder() { + if (endCase_ == 4) { + return (com.google.protobuf.Duration) end_; + } + return com.google.protobuf.Duration.getDefaultInstance(); + } + + public static final int ERROR_FIELD_NUMBER = 2; + + /** + * + * + *
        +   * The error that will be returned by the server. If this code is specified
        +   * to be the OK rpc code, an empty response will be returned.
        +   * 
        + * + * .google.rpc.Status error = 2; + * + * @return Whether the error field is set. + */ + @java.lang.Override + public boolean hasError() { + return responseCase_ == 2; + } + + /** + * + * + *
        +   * The error that will be returned by the server. If this code is specified
        +   * to be the OK rpc code, an empty response will be returned.
        +   * 
        + * + * .google.rpc.Status error = 2; + * + * @return The error. + */ + @java.lang.Override + public com.google.rpc.Status getError() { + if (responseCase_ == 2) { + return (com.google.rpc.Status) response_; + } + return com.google.rpc.Status.getDefaultInstance(); + } + + /** + * + * + *
        +   * The error that will be returned by the server. If this code is specified
        +   * to be the OK rpc code, an empty response will be returned.
        +   * 
        + * + * .google.rpc.Status error = 2; + */ + @java.lang.Override + public com.google.rpc.StatusOrBuilder getErrorOrBuilder() { + if (responseCase_ == 2) { + return (com.google.rpc.Status) response_; + } + return com.google.rpc.Status.getDefaultInstance(); + } + + public static final int SUCCESS_FIELD_NUMBER = 3; + + /** + * + * + *
        +   * The response to be returned on operation completion.
        +   * 
        + * + * .google.showcase.v1beta1.WaitResponse success = 3; + * + * @return Whether the success field is set. + */ + @java.lang.Override + public boolean hasSuccess() { + return responseCase_ == 3; + } + + /** + * + * + *
        +   * The response to be returned on operation completion.
        +   * 
        + * + * .google.showcase.v1beta1.WaitResponse success = 3; + * + * @return The success. + */ + @java.lang.Override + public com.google.showcase.v1beta1.WaitResponse getSuccess() { + if (responseCase_ == 3) { + return (com.google.showcase.v1beta1.WaitResponse) response_; + } + return com.google.showcase.v1beta1.WaitResponse.getDefaultInstance(); + } + + /** + * + * + *
        +   * The response to be returned on operation completion.
        +   * 
        + * + * .google.showcase.v1beta1.WaitResponse success = 3; + */ + @java.lang.Override + public com.google.showcase.v1beta1.WaitResponseOrBuilder getSuccessOrBuilder() { + if (responseCase_ == 3) { + return (com.google.showcase.v1beta1.WaitResponse) response_; + } + return com.google.showcase.v1beta1.WaitResponse.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 (endCase_ == 1) { + output.writeMessage(1, (com.google.protobuf.Timestamp) end_); + } + if (responseCase_ == 2) { + output.writeMessage(2, (com.google.rpc.Status) response_); + } + if (responseCase_ == 3) { + output.writeMessage(3, (com.google.showcase.v1beta1.WaitResponse) response_); + } + if (endCase_ == 4) { + output.writeMessage(4, (com.google.protobuf.Duration) end_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (endCase_ == 1) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 1, (com.google.protobuf.Timestamp) end_); + } + if (responseCase_ == 2) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 2, (com.google.rpc.Status) response_); + } + if (responseCase_ == 3) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 3, (com.google.showcase.v1beta1.WaitResponse) response_); + } + if (endCase_ == 4) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 4, (com.google.protobuf.Duration) end_); + } + 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.showcase.v1beta1.WaitRequest)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.WaitRequest other = (com.google.showcase.v1beta1.WaitRequest) obj; + + if (!getEndCase().equals(other.getEndCase())) return false; + switch (endCase_) { + case 1: + if (!getEndTime().equals(other.getEndTime())) return false; + break; + case 4: + if (!getTtl().equals(other.getTtl())) return false; + break; + case 0: + default: + } + if (!getResponseCase().equals(other.getResponseCase())) return false; + switch (responseCase_) { + case 2: + if (!getError().equals(other.getError())) return false; + break; + case 3: + if (!getSuccess().equals(other.getSuccess())) 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(); + switch (endCase_) { + case 1: + hash = (37 * hash) + END_TIME_FIELD_NUMBER; + hash = (53 * hash) + getEndTime().hashCode(); + break; + case 4: + hash = (37 * hash) + TTL_FIELD_NUMBER; + hash = (53 * hash) + getTtl().hashCode(); + break; + case 0: + default: + } + switch (responseCase_) { + case 2: + hash = (37 * hash) + ERROR_FIELD_NUMBER; + hash = (53 * hash) + getError().hashCode(); + break; + case 3: + hash = (37 * hash) + SUCCESS_FIELD_NUMBER; + hash = (53 * hash) + getSuccess().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.showcase.v1beta1.WaitRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.WaitRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.WaitRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.WaitRequest 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.showcase.v1beta1.WaitRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.WaitRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.WaitRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.WaitRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.showcase.v1beta1.WaitRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.WaitRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.showcase.v1beta1.WaitRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.WaitRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.showcase.v1beta1.WaitRequest 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
        +   * The request for Wait method.
        +   * 
        + * + * Protobuf type {@code google.showcase.v1beta1.WaitRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.WaitRequest) + com.google.showcase.v1beta1.WaitRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.EchoOuterClass + .internal_static_google_showcase_v1beta1_WaitRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.EchoOuterClass + .internal_static_google_showcase_v1beta1_WaitRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.WaitRequest.class, + com.google.showcase.v1beta1.WaitRequest.Builder.class); + } + + // Construct using com.google.showcase.v1beta1.WaitRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (endTimeBuilder_ != null) { + endTimeBuilder_.clear(); + } + if (ttlBuilder_ != null) { + ttlBuilder_.clear(); + } + if (errorBuilder_ != null) { + errorBuilder_.clear(); + } + if (successBuilder_ != null) { + successBuilder_.clear(); + } + endCase_ = 0; + end_ = null; + responseCase_ = 0; + response_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.showcase.v1beta1.EchoOuterClass + .internal_static_google_showcase_v1beta1_WaitRequest_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.WaitRequest getDefaultInstanceForType() { + return com.google.showcase.v1beta1.WaitRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.WaitRequest build() { + com.google.showcase.v1beta1.WaitRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.WaitRequest buildPartial() { + com.google.showcase.v1beta1.WaitRequest result = + new com.google.showcase.v1beta1.WaitRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + buildPartialOneofs(result); + onBuilt(); + return result; + } + + private void buildPartial0(com.google.showcase.v1beta1.WaitRequest result) { + int from_bitField0_ = bitField0_; + } + + private void buildPartialOneofs(com.google.showcase.v1beta1.WaitRequest result) { + result.endCase_ = endCase_; + result.end_ = this.end_; + if (endCase_ == 1 && endTimeBuilder_ != null) { + result.end_ = endTimeBuilder_.build(); + } + if (endCase_ == 4 && ttlBuilder_ != null) { + result.end_ = ttlBuilder_.build(); + } + result.responseCase_ = responseCase_; + result.response_ = this.response_; + if (responseCase_ == 2 && errorBuilder_ != null) { + result.response_ = errorBuilder_.build(); + } + if (responseCase_ == 3 && successBuilder_ != null) { + result.response_ = successBuilder_.build(); + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.showcase.v1beta1.WaitRequest) { + return mergeFrom((com.google.showcase.v1beta1.WaitRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.showcase.v1beta1.WaitRequest other) { + if (other == com.google.showcase.v1beta1.WaitRequest.getDefaultInstance()) return this; + switch (other.getEndCase()) { + case END_TIME: + { + mergeEndTime(other.getEndTime()); + break; + } + case TTL: + { + mergeTtl(other.getTtl()); + break; + } + case END_NOT_SET: + { + break; + } + } + switch (other.getResponseCase()) { + case ERROR: + { + mergeError(other.getError()); + break; + } + case SUCCESS: + { + mergeSuccess(other.getSuccess()); + break; + } + case RESPONSE_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(internalGetEndTimeFieldBuilder().getBuilder(), extensionRegistry); + endCase_ = 1; + break; + } // case 10 + case 18: + { + input.readMessage(internalGetErrorFieldBuilder().getBuilder(), extensionRegistry); + responseCase_ = 2; + break; + } // case 18 + case 26: + { + input.readMessage(internalGetSuccessFieldBuilder().getBuilder(), extensionRegistry); + responseCase_ = 3; + break; + } // case 26 + case 34: + { + input.readMessage(internalGetTtlFieldBuilder().getBuilder(), extensionRegistry); + endCase_ = 4; + 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 endCase_ = 0; + private java.lang.Object end_; + + public EndCase getEndCase() { + return EndCase.forNumber(endCase_); + } + + public Builder clearEnd() { + endCase_ = 0; + end_ = null; + onChanged(); + return this; + } + + private int responseCase_ = 0; + private java.lang.Object response_; + + public ResponseCase getResponseCase() { + return ResponseCase.forNumber(responseCase_); + } + + public Builder clearResponse() { + responseCase_ = 0; + response_ = null; + onChanged(); + return this; + } + + private int bitField0_; + + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + endTimeBuilder_; + + /** + * + * + *
        +     * The time that this operation will complete.
        +     * 
        + * + * .google.protobuf.Timestamp end_time = 1; + * + * @return Whether the endTime field is set. + */ + @java.lang.Override + public boolean hasEndTime() { + return endCase_ == 1; + } + + /** + * + * + *
        +     * The time that this operation will complete.
        +     * 
        + * + * .google.protobuf.Timestamp end_time = 1; + * + * @return The endTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getEndTime() { + if (endTimeBuilder_ == null) { + if (endCase_ == 1) { + return (com.google.protobuf.Timestamp) end_; + } + return com.google.protobuf.Timestamp.getDefaultInstance(); + } else { + if (endCase_ == 1) { + return endTimeBuilder_.getMessage(); + } + return com.google.protobuf.Timestamp.getDefaultInstance(); + } + } + + /** + * + * + *
        +     * The time that this operation will complete.
        +     * 
        + * + * .google.protobuf.Timestamp end_time = 1; + */ + public Builder setEndTime(com.google.protobuf.Timestamp value) { + if (endTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + end_ = value; + onChanged(); + } else { + endTimeBuilder_.setMessage(value); + } + endCase_ = 1; + return this; + } + + /** + * + * + *
        +     * The time that this operation will complete.
        +     * 
        + * + * .google.protobuf.Timestamp end_time = 1; + */ + public Builder setEndTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (endTimeBuilder_ == null) { + end_ = builderForValue.build(); + onChanged(); + } else { + endTimeBuilder_.setMessage(builderForValue.build()); + } + endCase_ = 1; + return this; + } + + /** + * + * + *
        +     * The time that this operation will complete.
        +     * 
        + * + * .google.protobuf.Timestamp end_time = 1; + */ + public Builder mergeEndTime(com.google.protobuf.Timestamp value) { + if (endTimeBuilder_ == null) { + if (endCase_ == 1 && end_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + end_ = + com.google.protobuf.Timestamp.newBuilder((com.google.protobuf.Timestamp) end_) + .mergeFrom(value) + .buildPartial(); + } else { + end_ = value; + } + onChanged(); + } else { + if (endCase_ == 1) { + endTimeBuilder_.mergeFrom(value); + } else { + endTimeBuilder_.setMessage(value); + } + } + endCase_ = 1; + return this; + } + + /** + * + * + *
        +     * The time that this operation will complete.
        +     * 
        + * + * .google.protobuf.Timestamp end_time = 1; + */ + public Builder clearEndTime() { + if (endTimeBuilder_ == null) { + if (endCase_ == 1) { + endCase_ = 0; + end_ = null; + onChanged(); + } + } else { + if (endCase_ == 1) { + endCase_ = 0; + end_ = null; + } + endTimeBuilder_.clear(); + } + return this; + } + + /** + * + * + *
        +     * The time that this operation will complete.
        +     * 
        + * + * .google.protobuf.Timestamp end_time = 1; + */ + public com.google.protobuf.Timestamp.Builder getEndTimeBuilder() { + return internalGetEndTimeFieldBuilder().getBuilder(); + } + + /** + * + * + *
        +     * The time that this operation will complete.
        +     * 
        + * + * .google.protobuf.Timestamp end_time = 1; + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getEndTimeOrBuilder() { + if ((endCase_ == 1) && (endTimeBuilder_ != null)) { + return endTimeBuilder_.getMessageOrBuilder(); + } else { + if (endCase_ == 1) { + return (com.google.protobuf.Timestamp) end_; + } + return com.google.protobuf.Timestamp.getDefaultInstance(); + } + } + + /** + * + * + *
        +     * The time that this operation will complete.
        +     * 
        + * + * .google.protobuf.Timestamp end_time = 1; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + internalGetEndTimeFieldBuilder() { + if (endTimeBuilder_ == null) { + if (!(endCase_ == 1)) { + end_ = com.google.protobuf.Timestamp.getDefaultInstance(); + } + endTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + (com.google.protobuf.Timestamp) end_, getParentForChildren(), isClean()); + end_ = null; + } + endCase_ = 1; + onChanged(); + return endTimeBuilder_; + } + + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder> + ttlBuilder_; + + /** + * + * + *
        +     * The duration of this operation.
        +     * 
        + * + * .google.protobuf.Duration ttl = 4; + * + * @return Whether the ttl field is set. + */ + @java.lang.Override + public boolean hasTtl() { + return endCase_ == 4; + } + + /** + * + * + *
        +     * The duration of this operation.
        +     * 
        + * + * .google.protobuf.Duration ttl = 4; + * + * @return The ttl. + */ + @java.lang.Override + public com.google.protobuf.Duration getTtl() { + if (ttlBuilder_ == null) { + if (endCase_ == 4) { + return (com.google.protobuf.Duration) end_; + } + return com.google.protobuf.Duration.getDefaultInstance(); + } else { + if (endCase_ == 4) { + return ttlBuilder_.getMessage(); + } + return com.google.protobuf.Duration.getDefaultInstance(); + } + } + + /** + * + * + *
        +     * The duration of this operation.
        +     * 
        + * + * .google.protobuf.Duration ttl = 4; + */ + public Builder setTtl(com.google.protobuf.Duration value) { + if (ttlBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + end_ = value; + onChanged(); + } else { + ttlBuilder_.setMessage(value); + } + endCase_ = 4; + return this; + } + + /** + * + * + *
        +     * The duration of this operation.
        +     * 
        + * + * .google.protobuf.Duration ttl = 4; + */ + public Builder setTtl(com.google.protobuf.Duration.Builder builderForValue) { + if (ttlBuilder_ == null) { + end_ = builderForValue.build(); + onChanged(); + } else { + ttlBuilder_.setMessage(builderForValue.build()); + } + endCase_ = 4; + return this; + } + + /** + * + * + *
        +     * The duration of this operation.
        +     * 
        + * + * .google.protobuf.Duration ttl = 4; + */ + public Builder mergeTtl(com.google.protobuf.Duration value) { + if (ttlBuilder_ == null) { + if (endCase_ == 4 && end_ != com.google.protobuf.Duration.getDefaultInstance()) { + end_ = + com.google.protobuf.Duration.newBuilder((com.google.protobuf.Duration) end_) + .mergeFrom(value) + .buildPartial(); + } else { + end_ = value; + } + onChanged(); + } else { + if (endCase_ == 4) { + ttlBuilder_.mergeFrom(value); + } else { + ttlBuilder_.setMessage(value); + } + } + endCase_ = 4; + return this; + } + + /** + * + * + *
        +     * The duration of this operation.
        +     * 
        + * + * .google.protobuf.Duration ttl = 4; + */ + public Builder clearTtl() { + if (ttlBuilder_ == null) { + if (endCase_ == 4) { + endCase_ = 0; + end_ = null; + onChanged(); + } + } else { + if (endCase_ == 4) { + endCase_ = 0; + end_ = null; + } + ttlBuilder_.clear(); + } + return this; + } + + /** + * + * + *
        +     * The duration of this operation.
        +     * 
        + * + * .google.protobuf.Duration ttl = 4; + */ + public com.google.protobuf.Duration.Builder getTtlBuilder() { + return internalGetTtlFieldBuilder().getBuilder(); + } + + /** + * + * + *
        +     * The duration of this operation.
        +     * 
        + * + * .google.protobuf.Duration ttl = 4; + */ + @java.lang.Override + public com.google.protobuf.DurationOrBuilder getTtlOrBuilder() { + if ((endCase_ == 4) && (ttlBuilder_ != null)) { + return ttlBuilder_.getMessageOrBuilder(); + } else { + if (endCase_ == 4) { + return (com.google.protobuf.Duration) end_; + } + return com.google.protobuf.Duration.getDefaultInstance(); + } + } + + /** + * + * + *
        +     * The duration of this operation.
        +     * 
        + * + * .google.protobuf.Duration ttl = 4; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder> + internalGetTtlFieldBuilder() { + if (ttlBuilder_ == null) { + if (!(endCase_ == 4)) { + end_ = com.google.protobuf.Duration.getDefaultInstance(); + } + ttlBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder>( + (com.google.protobuf.Duration) end_, getParentForChildren(), isClean()); + end_ = null; + } + endCase_ = 4; + onChanged(); + return ttlBuilder_; + } + + private com.google.protobuf.SingleFieldBuilder< + com.google.rpc.Status, com.google.rpc.Status.Builder, com.google.rpc.StatusOrBuilder> + errorBuilder_; + + /** + * + * + *
        +     * The error that will be returned by the server. If this code is specified
        +     * to be the OK rpc code, an empty response will be returned.
        +     * 
        + * + * .google.rpc.Status error = 2; + * + * @return Whether the error field is set. + */ + @java.lang.Override + public boolean hasError() { + return responseCase_ == 2; + } + + /** + * + * + *
        +     * The error that will be returned by the server. If this code is specified
        +     * to be the OK rpc code, an empty response will be returned.
        +     * 
        + * + * .google.rpc.Status error = 2; + * + * @return The error. + */ + @java.lang.Override + public com.google.rpc.Status getError() { + if (errorBuilder_ == null) { + if (responseCase_ == 2) { + return (com.google.rpc.Status) response_; + } + return com.google.rpc.Status.getDefaultInstance(); + } else { + if (responseCase_ == 2) { + return errorBuilder_.getMessage(); + } + return com.google.rpc.Status.getDefaultInstance(); + } + } + + /** + * + * + *
        +     * The error that will be returned by the server. If this code is specified
        +     * to be the OK rpc code, an empty response will be returned.
        +     * 
        + * + * .google.rpc.Status error = 2; + */ + public Builder setError(com.google.rpc.Status value) { + if (errorBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + response_ = value; + onChanged(); + } else { + errorBuilder_.setMessage(value); + } + responseCase_ = 2; + return this; + } + + /** + * + * + *
        +     * The error that will be returned by the server. If this code is specified
        +     * to be the OK rpc code, an empty response will be returned.
        +     * 
        + * + * .google.rpc.Status error = 2; + */ + public Builder setError(com.google.rpc.Status.Builder builderForValue) { + if (errorBuilder_ == null) { + response_ = builderForValue.build(); + onChanged(); + } else { + errorBuilder_.setMessage(builderForValue.build()); + } + responseCase_ = 2; + return this; + } + + /** + * + * + *
        +     * The error that will be returned by the server. If this code is specified
        +     * to be the OK rpc code, an empty response will be returned.
        +     * 
        + * + * .google.rpc.Status error = 2; + */ + public Builder mergeError(com.google.rpc.Status value) { + if (errorBuilder_ == null) { + if (responseCase_ == 2 && response_ != com.google.rpc.Status.getDefaultInstance()) { + response_ = + com.google.rpc.Status.newBuilder((com.google.rpc.Status) response_) + .mergeFrom(value) + .buildPartial(); + } else { + response_ = value; + } + onChanged(); + } else { + if (responseCase_ == 2) { + errorBuilder_.mergeFrom(value); + } else { + errorBuilder_.setMessage(value); + } + } + responseCase_ = 2; + return this; + } + + /** + * + * + *
        +     * The error that will be returned by the server. If this code is specified
        +     * to be the OK rpc code, an empty response will be returned.
        +     * 
        + * + * .google.rpc.Status error = 2; + */ + public Builder clearError() { + if (errorBuilder_ == null) { + if (responseCase_ == 2) { + responseCase_ = 0; + response_ = null; + onChanged(); + } + } else { + if (responseCase_ == 2) { + responseCase_ = 0; + response_ = null; + } + errorBuilder_.clear(); + } + return this; + } + + /** + * + * + *
        +     * The error that will be returned by the server. If this code is specified
        +     * to be the OK rpc code, an empty response will be returned.
        +     * 
        + * + * .google.rpc.Status error = 2; + */ + public com.google.rpc.Status.Builder getErrorBuilder() { + return internalGetErrorFieldBuilder().getBuilder(); + } + + /** + * + * + *
        +     * The error that will be returned by the server. If this code is specified
        +     * to be the OK rpc code, an empty response will be returned.
        +     * 
        + * + * .google.rpc.Status error = 2; + */ + @java.lang.Override + public com.google.rpc.StatusOrBuilder getErrorOrBuilder() { + if ((responseCase_ == 2) && (errorBuilder_ != null)) { + return errorBuilder_.getMessageOrBuilder(); + } else { + if (responseCase_ == 2) { + return (com.google.rpc.Status) response_; + } + return com.google.rpc.Status.getDefaultInstance(); + } + } + + /** + * + * + *
        +     * The error that will be returned by the server. If this code is specified
        +     * to be the OK rpc code, an empty response will be returned.
        +     * 
        + * + * .google.rpc.Status error = 2; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.rpc.Status, com.google.rpc.Status.Builder, com.google.rpc.StatusOrBuilder> + internalGetErrorFieldBuilder() { + if (errorBuilder_ == null) { + if (!(responseCase_ == 2)) { + response_ = com.google.rpc.Status.getDefaultInstance(); + } + errorBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.rpc.Status, + com.google.rpc.Status.Builder, + com.google.rpc.StatusOrBuilder>( + (com.google.rpc.Status) response_, getParentForChildren(), isClean()); + response_ = null; + } + responseCase_ = 2; + onChanged(); + return errorBuilder_; + } + + private com.google.protobuf.SingleFieldBuilder< + com.google.showcase.v1beta1.WaitResponse, + com.google.showcase.v1beta1.WaitResponse.Builder, + com.google.showcase.v1beta1.WaitResponseOrBuilder> + successBuilder_; + + /** + * + * + *
        +     * The response to be returned on operation completion.
        +     * 
        + * + * .google.showcase.v1beta1.WaitResponse success = 3; + * + * @return Whether the success field is set. + */ + @java.lang.Override + public boolean hasSuccess() { + return responseCase_ == 3; + } + + /** + * + * + *
        +     * The response to be returned on operation completion.
        +     * 
        + * + * .google.showcase.v1beta1.WaitResponse success = 3; + * + * @return The success. + */ + @java.lang.Override + public com.google.showcase.v1beta1.WaitResponse getSuccess() { + if (successBuilder_ == null) { + if (responseCase_ == 3) { + return (com.google.showcase.v1beta1.WaitResponse) response_; + } + return com.google.showcase.v1beta1.WaitResponse.getDefaultInstance(); + } else { + if (responseCase_ == 3) { + return successBuilder_.getMessage(); + } + return com.google.showcase.v1beta1.WaitResponse.getDefaultInstance(); + } + } + + /** + * + * + *
        +     * The response to be returned on operation completion.
        +     * 
        + * + * .google.showcase.v1beta1.WaitResponse success = 3; + */ + public Builder setSuccess(com.google.showcase.v1beta1.WaitResponse value) { + if (successBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + response_ = value; + onChanged(); + } else { + successBuilder_.setMessage(value); + } + responseCase_ = 3; + return this; + } + + /** + * + * + *
        +     * The response to be returned on operation completion.
        +     * 
        + * + * .google.showcase.v1beta1.WaitResponse success = 3; + */ + public Builder setSuccess(com.google.showcase.v1beta1.WaitResponse.Builder builderForValue) { + if (successBuilder_ == null) { + response_ = builderForValue.build(); + onChanged(); + } else { + successBuilder_.setMessage(builderForValue.build()); + } + responseCase_ = 3; + return this; + } + + /** + * + * + *
        +     * The response to be returned on operation completion.
        +     * 
        + * + * .google.showcase.v1beta1.WaitResponse success = 3; + */ + public Builder mergeSuccess(com.google.showcase.v1beta1.WaitResponse value) { + if (successBuilder_ == null) { + if (responseCase_ == 3 + && response_ != com.google.showcase.v1beta1.WaitResponse.getDefaultInstance()) { + response_ = + com.google.showcase.v1beta1.WaitResponse.newBuilder( + (com.google.showcase.v1beta1.WaitResponse) response_) + .mergeFrom(value) + .buildPartial(); + } else { + response_ = value; + } + onChanged(); + } else { + if (responseCase_ == 3) { + successBuilder_.mergeFrom(value); + } else { + successBuilder_.setMessage(value); + } + } + responseCase_ = 3; + return this; + } + + /** + * + * + *
        +     * The response to be returned on operation completion.
        +     * 
        + * + * .google.showcase.v1beta1.WaitResponse success = 3; + */ + public Builder clearSuccess() { + if (successBuilder_ == null) { + if (responseCase_ == 3) { + responseCase_ = 0; + response_ = null; + onChanged(); + } + } else { + if (responseCase_ == 3) { + responseCase_ = 0; + response_ = null; + } + successBuilder_.clear(); + } + return this; + } + + /** + * + * + *
        +     * The response to be returned on operation completion.
        +     * 
        + * + * .google.showcase.v1beta1.WaitResponse success = 3; + */ + public com.google.showcase.v1beta1.WaitResponse.Builder getSuccessBuilder() { + return internalGetSuccessFieldBuilder().getBuilder(); + } + + /** + * + * + *
        +     * The response to be returned on operation completion.
        +     * 
        + * + * .google.showcase.v1beta1.WaitResponse success = 3; + */ + @java.lang.Override + public com.google.showcase.v1beta1.WaitResponseOrBuilder getSuccessOrBuilder() { + if ((responseCase_ == 3) && (successBuilder_ != null)) { + return successBuilder_.getMessageOrBuilder(); + } else { + if (responseCase_ == 3) { + return (com.google.showcase.v1beta1.WaitResponse) response_; + } + return com.google.showcase.v1beta1.WaitResponse.getDefaultInstance(); + } + } + + /** + * + * + *
        +     * The response to be returned on operation completion.
        +     * 
        + * + * .google.showcase.v1beta1.WaitResponse success = 3; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.showcase.v1beta1.WaitResponse, + com.google.showcase.v1beta1.WaitResponse.Builder, + com.google.showcase.v1beta1.WaitResponseOrBuilder> + internalGetSuccessFieldBuilder() { + if (successBuilder_ == null) { + if (!(responseCase_ == 3)) { + response_ = com.google.showcase.v1beta1.WaitResponse.getDefaultInstance(); + } + successBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.showcase.v1beta1.WaitResponse, + com.google.showcase.v1beta1.WaitResponse.Builder, + com.google.showcase.v1beta1.WaitResponseOrBuilder>( + (com.google.showcase.v1beta1.WaitResponse) response_, + getParentForChildren(), + isClean()); + response_ = null; + } + responseCase_ = 3; + onChanged(); + return successBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.showcase.v1beta1.WaitRequest) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.WaitRequest) + private static final com.google.showcase.v1beta1.WaitRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.WaitRequest(); + } + + public static com.google.showcase.v1beta1.WaitRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public WaitRequest 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.showcase.v1beta1.WaitRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/WaitRequestOrBuilder.java b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/WaitRequestOrBuilder.java new file mode 100644 index 0000000000..5bc3c5883e --- /dev/null +++ b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/WaitRequestOrBuilder.java @@ -0,0 +1,183 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: schema/google/showcase/v1beta1/echo.proto +// Protobuf Java Version: 4.33.2 + +package com.google.showcase.v1beta1; + +@com.google.protobuf.Generated +public interface WaitRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.WaitRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
        +   * The time that this operation will complete.
        +   * 
        + * + * .google.protobuf.Timestamp end_time = 1; + * + * @return Whether the endTime field is set. + */ + boolean hasEndTime(); + + /** + * + * + *
        +   * The time that this operation will complete.
        +   * 
        + * + * .google.protobuf.Timestamp end_time = 1; + * + * @return The endTime. + */ + com.google.protobuf.Timestamp getEndTime(); + + /** + * + * + *
        +   * The time that this operation will complete.
        +   * 
        + * + * .google.protobuf.Timestamp end_time = 1; + */ + com.google.protobuf.TimestampOrBuilder getEndTimeOrBuilder(); + + /** + * + * + *
        +   * The duration of this operation.
        +   * 
        + * + * .google.protobuf.Duration ttl = 4; + * + * @return Whether the ttl field is set. + */ + boolean hasTtl(); + + /** + * + * + *
        +   * The duration of this operation.
        +   * 
        + * + * .google.protobuf.Duration ttl = 4; + * + * @return The ttl. + */ + com.google.protobuf.Duration getTtl(); + + /** + * + * + *
        +   * The duration of this operation.
        +   * 
        + * + * .google.protobuf.Duration ttl = 4; + */ + com.google.protobuf.DurationOrBuilder getTtlOrBuilder(); + + /** + * + * + *
        +   * The error that will be returned by the server. If this code is specified
        +   * to be the OK rpc code, an empty response will be returned.
        +   * 
        + * + * .google.rpc.Status error = 2; + * + * @return Whether the error field is set. + */ + boolean hasError(); + + /** + * + * + *
        +   * The error that will be returned by the server. If this code is specified
        +   * to be the OK rpc code, an empty response will be returned.
        +   * 
        + * + * .google.rpc.Status error = 2; + * + * @return The error. + */ + com.google.rpc.Status getError(); + + /** + * + * + *
        +   * The error that will be returned by the server. If this code is specified
        +   * to be the OK rpc code, an empty response will be returned.
        +   * 
        + * + * .google.rpc.Status error = 2; + */ + com.google.rpc.StatusOrBuilder getErrorOrBuilder(); + + /** + * + * + *
        +   * The response to be returned on operation completion.
        +   * 
        + * + * .google.showcase.v1beta1.WaitResponse success = 3; + * + * @return Whether the success field is set. + */ + boolean hasSuccess(); + + /** + * + * + *
        +   * The response to be returned on operation completion.
        +   * 
        + * + * .google.showcase.v1beta1.WaitResponse success = 3; + * + * @return The success. + */ + com.google.showcase.v1beta1.WaitResponse getSuccess(); + + /** + * + * + *
        +   * The response to be returned on operation completion.
        +   * 
        + * + * .google.showcase.v1beta1.WaitResponse success = 3; + */ + com.google.showcase.v1beta1.WaitResponseOrBuilder getSuccessOrBuilder(); + + com.google.showcase.v1beta1.WaitRequest.EndCase getEndCase(); + + com.google.showcase.v1beta1.WaitRequest.ResponseCase getResponseCase(); +} diff --git a/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/WaitResponse.java b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/WaitResponse.java new file mode 100644 index 0000000000..e13d9ea689 --- /dev/null +++ b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/WaitResponse.java @@ -0,0 +1,594 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: schema/google/showcase/v1beta1/echo.proto +// Protobuf Java Version: 4.33.2 + +package com.google.showcase.v1beta1; + +/** + * + * + *
        + * The result of the Wait operation.
        + * 
        + * + * Protobuf type {@code google.showcase.v1beta1.WaitResponse} + */ +@com.google.protobuf.Generated +public final class WaitResponse extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.WaitResponse) + WaitResponseOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "WaitResponse"); + } + + // Use WaitResponse.newBuilder() to construct. + private WaitResponse(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private WaitResponse() { + content_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.EchoOuterClass + .internal_static_google_showcase_v1beta1_WaitResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.EchoOuterClass + .internal_static_google_showcase_v1beta1_WaitResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.WaitResponse.class, + com.google.showcase.v1beta1.WaitResponse.Builder.class); + } + + public static final int CONTENT_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object content_ = ""; + + /** + * + * + *
        +   * This content of the result.
        +   * 
        + * + * string content = 1; + * + * @return The content. + */ + @java.lang.Override + public java.lang.String getContent() { + java.lang.Object ref = content_; + 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(); + content_ = s; + return s; + } + } + + /** + * + * + *
        +   * This content of the result.
        +   * 
        + * + * string content = 1; + * + * @return The bytes for content. + */ + @java.lang.Override + public com.google.protobuf.ByteString getContentBytes() { + java.lang.Object ref = content_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + content_ = 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.GeneratedMessage.isStringEmpty(content_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, content_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(content_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, content_); + } + 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.showcase.v1beta1.WaitResponse)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.WaitResponse other = (com.google.showcase.v1beta1.WaitResponse) obj; + + if (!getContent().equals(other.getContent())) 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) + CONTENT_FIELD_NUMBER; + hash = (53 * hash) + getContent().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.showcase.v1beta1.WaitResponse parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.WaitResponse parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.WaitResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.WaitResponse 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.showcase.v1beta1.WaitResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.WaitResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.WaitResponse parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.WaitResponse parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.showcase.v1beta1.WaitResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.WaitResponse parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.showcase.v1beta1.WaitResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.WaitResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.showcase.v1beta1.WaitResponse 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
        +   * The result of the Wait operation.
        +   * 
        + * + * Protobuf type {@code google.showcase.v1beta1.WaitResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.WaitResponse) + com.google.showcase.v1beta1.WaitResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.EchoOuterClass + .internal_static_google_showcase_v1beta1_WaitResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.EchoOuterClass + .internal_static_google_showcase_v1beta1_WaitResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.WaitResponse.class, + com.google.showcase.v1beta1.WaitResponse.Builder.class); + } + + // Construct using com.google.showcase.v1beta1.WaitResponse.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + content_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.showcase.v1beta1.EchoOuterClass + .internal_static_google_showcase_v1beta1_WaitResponse_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.WaitResponse getDefaultInstanceForType() { + return com.google.showcase.v1beta1.WaitResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.WaitResponse build() { + com.google.showcase.v1beta1.WaitResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.WaitResponse buildPartial() { + com.google.showcase.v1beta1.WaitResponse result = + new com.google.showcase.v1beta1.WaitResponse(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.showcase.v1beta1.WaitResponse result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.content_ = content_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.showcase.v1beta1.WaitResponse) { + return mergeFrom((com.google.showcase.v1beta1.WaitResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.showcase.v1beta1.WaitResponse other) { + if (other == com.google.showcase.v1beta1.WaitResponse.getDefaultInstance()) return this; + if (!other.getContent().isEmpty()) { + content_ = other.content_; + 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: + { + content_ = 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 content_ = ""; + + /** + * + * + *
        +     * This content of the result.
        +     * 
        + * + * string content = 1; + * + * @return The content. + */ + public java.lang.String getContent() { + java.lang.Object ref = content_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + content_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
        +     * This content of the result.
        +     * 
        + * + * string content = 1; + * + * @return The bytes for content. + */ + public com.google.protobuf.ByteString getContentBytes() { + java.lang.Object ref = content_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + content_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
        +     * This content of the result.
        +     * 
        + * + * string content = 1; + * + * @param value The content to set. + * @return This builder for chaining. + */ + public Builder setContent(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + content_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
        +     * This content of the result.
        +     * 
        + * + * string content = 1; + * + * @return This builder for chaining. + */ + public Builder clearContent() { + content_ = getDefaultInstance().getContent(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
        +     * This content of the result.
        +     * 
        + * + * string content = 1; + * + * @param value The bytes for content to set. + * @return This builder for chaining. + */ + public Builder setContentBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + content_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.showcase.v1beta1.WaitResponse) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.WaitResponse) + private static final com.google.showcase.v1beta1.WaitResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.WaitResponse(); + } + + public static com.google.showcase.v1beta1.WaitResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public WaitResponse 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.showcase.v1beta1.WaitResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/WaitResponseOrBuilder.java b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/WaitResponseOrBuilder.java new file mode 100644 index 0000000000..5f82845b6c --- /dev/null +++ b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/WaitResponseOrBuilder.java @@ -0,0 +1,54 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: schema/google/showcase/v1beta1/echo.proto +// Protobuf Java Version: 4.33.2 + +package com.google.showcase.v1beta1; + +@com.google.protobuf.Generated +public interface WaitResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.WaitResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
        +   * This content of the result.
        +   * 
        + * + * string content = 1; + * + * @return The content. + */ + java.lang.String getContent(); + + /** + * + * + *
        +   * This content of the result.
        +   * 
        + * + * string content = 1; + * + * @return The bytes for content. + */ + com.google.protobuf.ByteString getContentBytes(); +} diff --git a/java-showcase/proto-gapic-showcase-v1beta1/src/main/proto/schema/google/showcase/v1beta1/compliance.proto b/java-showcase/proto-gapic-showcase-v1beta1/src/main/proto/schema/google/showcase/v1beta1/compliance.proto new file mode 100644 index 0000000000..4e8cba6b25 --- /dev/null +++ b/java-showcase/proto-gapic-showcase-v1beta1/src/main/proto/schema/google/showcase/v1beta1/compliance.proto @@ -0,0 +1,269 @@ +// 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. + +syntax = "proto3"; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; + +package google.showcase.v1beta1; + +option go_package = "github.com/googleapis/gapic-showcase/server/genproto"; +option java_package = "com.google.showcase.v1beta1"; +option java_multiple_files = true; +option ruby_package = "Google::Showcase::V1beta1"; + +// This service is used to test that GAPICs implement various REST-related features correctly. This mostly means transcoding proto3 requests to REST format +// correctly for various types of HTTP annotations, but it also includes verifying that unknown (numeric) enums received by clients can be round-tripped +// correctly. +service Compliance { + // This service is meant to only run locally on the port 7469 (keypad digits + // for "show"). + option (google.api.default_host) = "localhost:7469"; + + // This method echoes the ComplianceData request. This method exercises + // sending the entire request object in the REST body. + rpc RepeatDataBody(RepeatRequest) returns (RepeatResponse) { + option (google.api.http) = { + post: "/v1beta1/repeat:body" + body: "*" + }; + } + + // This method echoes the ComplianceData request. This method exercises + // sending the a message-type field in the REST body. Per AIP-127, only + // top-level, non-repeated fields can be sent this way. + rpc RepeatDataBodyInfo(RepeatRequest) returns (RepeatResponse) { + option (google.api.http) = { + post: "/v1beta1/repeat:bodyinfo" + body: "info" + }; + } + + // This method echoes the ComplianceData request. This method exercises + // sending all request fields as query parameters. + rpc RepeatDataQuery(RepeatRequest) returns (RepeatResponse) { + option (google.api.http) = { + get: "/v1beta1/repeat:query" + }; + } + + // This method echoes the ComplianceData request. This method exercises + // sending some parameters as "simple" path variables (i.e., of the form + // "/bar/{foo}" rather than "/{foo=bar/*}"), and the rest as query parameters. + rpc RepeatDataSimplePath(RepeatRequest) returns (RepeatResponse) { + option (google.api.http) = { + get: "/v1beta1/repeat/{info.f_string}/{info.f_int32}/{info.f_double}/{info.f_bool}/{info.f_kingdom}:simplepath" + }; + } + + // Same as RepeatDataSimplePath, but with a path resource. + rpc RepeatDataPathResource(RepeatRequest) returns (RepeatResponse) { + option (google.api.http) = { + get: "/v1beta1/repeat/{info.f_string=first/*}/{info.f_child.f_string=second/*}/bool/{info.f_bool}:pathresource" + additional_bindings { + get: "/v1beta1/repeat/{info.f_child.f_string=first/*}/{info.f_string=second/*}/bool/{info.f_bool}:childfirstpathresource" + } + }; + } + + // Same as RepeatDataSimplePath, but with a trailing resource. + rpc RepeatDataPathTrailingResource(RepeatRequest) returns (RepeatResponse) { + option (google.api.http) = { + get: "/v1beta1/repeat/{info.f_string=first/*}/{info.f_child.f_string=second/**}:pathtrailingresource" + }; + } + + // This method echoes the ComplianceData request, using the HTTP PUT method. + rpc RepeatDataBodyPut(RepeatRequest) returns (RepeatResponse) { + option (google.api.http) = { + put: "/v1beta1/repeat:bodyput" + body: "*" + }; + } + + // This method echoes the ComplianceData request, using the HTTP PATCH method. + rpc RepeatDataBodyPatch(RepeatRequest) returns (RepeatResponse) { + option (google.api.http) = { + patch: "/v1beta1/repeat:bodypatch" + body: "*" + }; + } + + // This method requests an enum value from the server. Depending on the contents of EnumRequest, the enum value returned will be a known enum declared in the + // .proto file, or a made-up enum value the is unknown to the client. To verify that clients can round-trip unknown enum values they receive, use the + // response from this RPC as the request to VerifyEnum() + // + // The values of enums sent by the server when a known or unknown value is requested will be the same within a single Showcase server run (this is needed for + // VerifyEnum() to work) but are not guaranteed to be the same across separate Showcase server runs. + rpc GetEnum(EnumRequest) returns (EnumResponse) { + option (google.api.http) = { + get: "/v1beta1/compliance/enum" + }; + } + + // This method is used to verify that clients can round-trip enum values, which is particularly important for unknown enum values over REST. VerifyEnum() + // verifies that its request, which is presumably the response that the client previously got to a GetEnum(), contains the correct data. If so, it responds + // with the same EnumResponse; otherwise, the RPC errors. + // + // This works because the values of enums sent by the server when a known or unknown value is requested will be the same within a single Showcase server run, + // although they are not guaranteed to be the same across separate Showcase server runs. + rpc VerifyEnum(EnumResponse) returns (EnumResponse) { + option (google.api.http) = { + post: "/v1beta1/compliance/enum" + }; + } + +} + +message RepeatRequest { + string name = 1; + ComplianceData info = 2; + + // If true, the server will verify that the received request matches + // the request with the same name in the compliance test suite. + bool server_verify = 3; + + // The URI template this request is expected to be bound to server-side. + optional string intended_binding_uri = 10; + + // Some top level fields, to test that these are encoded correctly + // in query params. + int32 f_int32 = 4; + int64 f_int64 = 5; + double f_double = 6; + + optional int32 p_int32 = 7; + optional int64 p_int64 = 8; + optional double p_double = 9; +} + +message RepeatResponse { + RepeatRequest request = 1; + + // The URI template the request was bound to server-side. + string binding_uri = 2; +} + +// ComplianceSuite contains a set of requests that microgenerators should issue +// over REST to the Compliance service to test their gRPC-to-REST transcoding +// implementation. +message ComplianceSuite { + repeated ComplianceGroup group = 1; +} + +// ComplianceGroups encapsulates a group of RPC requests to the Compliance +// server: one request for each combination of elements of `rpcs` and of +// `requests`. +message ComplianceGroup { + string name = 1; + repeated string rpcs = 2; + repeated RepeatRequest requests = 3; +} + +// ComplianceData is a message used for testing REST transcoding of +// different data types. +message ComplianceData { + enum LifeKingdom { + LIFE_KINGDOM_UNSPECIFIED = 0; + ARCHAEBACTERIA = 1; + EUBACTERIA = 2; + PROTISTA = 3; + FUNGI = 4; + PLANTAE = 5; + ANIMALIA = 6; +} + // scalar types + + string f_string = 1; + + int32 f_int32 = 2; + sint32 f_sint32 = 3; + sfixed32 f_sfixed32 = 4; + + uint32 f_uint32 = 5; + fixed32 f_fixed32 = 6; + + int64 f_int64 = 7; + sint64 f_sint64 = 8; + sfixed64 f_sfixed64 = 9; + + uint64 f_uint64 = 10; + fixed64 f_fixed64 = 11; + + double f_double = 12; + float f_float = 13; + + bool f_bool = 14; + + bytes f_bytes = 15; + + LifeKingdom f_kingdom = 22; + + ComplianceDataChild f_child = 16; + + // optional fields + + optional string p_string = 17; + optional int32 p_int32 = 18; + optional double p_double = 19; + optional bool p_bool = 20; + optional LifeKingdom p_kingdom = 23; + optional ComplianceDataChild p_child = 21; +} + +message ComplianceDataChild { + string f_string = 1; + float f_float = 2; + double f_double = 3; + bool f_bool = 4; + Continent f_continent = 11; + ComplianceDataGrandchild f_child = 5; + + optional string p_string = 6; + optional float p_float = 7; + optional double p_double = 8; + optional bool p_bool = 9; + Continent p_continent = 12; + optional ComplianceDataGrandchild p_child = 10; +} + +message ComplianceDataGrandchild { + string f_string = 1; + double f_double = 2; + bool f_bool = 3; +} + +enum Continent { + CONTINENT_UNSPECIFIED = 0; + AFRICA = 1; + AMERICA = 2; + ANTARTICA = 3; + AUSTRALIA = 4; + EUROPE = 5; +} + + +message EnumRequest { + // Whether the client is requesting a new, unknown enum value or a known enum value already declared in this proto file. + bool unknown_enum = 1; +} + +message EnumResponse { + // The original request for a known or unknown enum from the server. + EnumRequest request = 1; + + // The actual enum the server provided. + Continent continent = 2; +} diff --git a/java-showcase/proto-gapic-showcase-v1beta1/src/main/proto/schema/google/showcase/v1beta1/echo.proto b/java-showcase/proto-gapic-showcase-v1beta1/src/main/proto/schema/google/showcase/v1beta1/echo.proto new file mode 100644 index 0000000000..55b7ab578a --- /dev/null +++ b/java-showcase/proto-gapic-showcase-v1beta1/src/main/proto/schema/google/showcase/v1beta1/echo.proto @@ -0,0 +1,424 @@ +// 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 +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT 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"; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/field_info.proto"; +import "google/api/routing.proto"; +import "google/longrunning/operations.proto"; +import "google/protobuf/any.proto"; +import "google/protobuf/duration.proto"; +import "google/protobuf/timestamp.proto"; +import "google/rpc/status.proto"; + +package google.showcase.v1beta1; + +option go_package = "github.com/googleapis/gapic-showcase/server/genproto"; +option java_package = "com.google.showcase.v1beta1"; +option java_multiple_files = true; +option ruby_package = "Google::Showcase::V1beta1"; + +// This service is used showcase the four main types of rpcs - unary, server +// side streaming, client side streaming, and bidirectional streaming. This +// service also exposes methods that explicitly implement server delay, and +// paginated calls. Set the 'showcase-trailer' metadata key on any method +// to have the values echoed in the response trailers. Set the +// 'x-goog-request-params' metadata key on any method to have the values +// echoed in the response headers. +service Echo { + // This service is meant to only run locally on the port 7469 (keypad digits + // for "show"). + option (google.api.default_host) = "localhost:7469"; + // See https://github.com/aip-dev/google.aip.dev/pull/1331 + option (google.api.api_version) = "v1_20240408"; + + // This method simply echoes the request. This method showcases unary RPCs. + rpc Echo(EchoRequest) returns (EchoResponse) { + option (google.api.http) = { + post: "/v1beta1/echo:echo" + body: "*" + }; + option (google.api.routing) = { + routing_parameters{ + field: "header" + } + routing_parameters{ + field: "header" + path_template: "{routing_id=**}" + } + routing_parameters{ + field: "header" + path_template: "{table_name=regions/*/zones/*/**}" + } + routing_parameters{ + field: "header" + path_template: "{super_id=projects/*}/**" + } + routing_parameters{ + field: "header" + path_template: "{table_name=projects/*/instances/*/**}" + } + routing_parameters{ + field: "header" + path_template: "projects/*/{instance_id=instances/*}/**" + } + routing_parameters{ + field: "other_header" + path_template: "{baz=**}" + } + routing_parameters{ + field: "other_header" + path_template: "{qux=projects/*}/**" + } + }; + } + + // This method returns error details in a repeated "google.protobuf.Any" + // field. This method showcases handling errors thus encoded, particularly + // over REST transport. Note that GAPICs only allow the type + // "google.protobuf.Any" for field paths ending in "error.details", and, at + // run-time, the actual types for these fields must be one of the types in + // google/rpc/error_details.proto. + rpc EchoErrorDetails(EchoErrorDetailsRequest) returns (EchoErrorDetailsResponse) { + option (google.api.http) = { + post: "/v1beta1/echo:error-details" + body: "*" + }; + } + + // This method always fails with a gRPC "Aborted" error status that contains + // multiple error details. These include one instance of each of the standard + // ones in error_details.proto + // (https://github.com/googleapis/googleapis/blob/master/google/rpc/error_details.proto) + // plus a custom, Showcase-defined PoetryError. The intent of this RPC is to + // verify that GAPICs can process these various error details and surface them + // to the user in an idiomatic form. + rpc FailEchoWithDetails(FailEchoWithDetailsRequest) returns (FailEchoWithDetailsResponse) { + option (google.api.http) = { + post: "/v1beta1/echo:failWithDetails" + body: "*" + }; + } + + // This method splits the given content into words and will pass each word back + // through the stream. This method showcases server-side streaming RPCs. + rpc Expand(ExpandRequest) returns (stream EchoResponse) { + option (google.api.http) = { + post: "/v1beta1/echo:expand" + body: "*" + }; + // TODO(landrito): change this to be `fields: ["content", "error"]` once + // github.com/dcodeIO/protobuf.js/issues/1094 has been resolved. + option (google.api.method_signature) = "content,error"; + } + + // This method will collect the words given to it. When the stream is closed + // by the client, this method will return the a concatenation of the strings + // passed to it. This method showcases client-side streaming RPCs. + rpc Collect(stream EchoRequest) returns (EchoResponse) { + option (google.api.http) = { + post: "/v1beta1/echo:collect" + body: "*" + }; + } + + // This method, upon receiving a request on the stream, will pass the same + // content back on the stream. This method showcases bidirectional + // streaming RPCs. + rpc Chat(stream EchoRequest) returns (stream EchoResponse); + + // This is similar to the Expand method but instead of returning a stream of + // expanded words, this method returns a paged list of expanded words. + rpc PagedExpand(PagedExpandRequest) returns (PagedExpandResponse) { + option (google.api.http) = { + post: "/v1beta1/echo:pagedExpand" + body: "*" + }; + } + + // This is similar to the PagedExpand except that it uses + // max_results instead of page_size, as some legacy APIs still + // do. New APIs should NOT use this pattern. + rpc PagedExpandLegacy(PagedExpandLegacyRequest) returns (PagedExpandResponse) { + option (google.api.http) = { + post: "/v1beta1/echo:pagedExpandLegacy" + body: "*" + }; + } + + // This method returns a map containing lists of words that appear in the input, keyed by their + // initial character. The only words returned are the ones included in the current page, + // as determined by page_token and page_size, which both refer to the word indices in the + // input. This paging result consisting of a map of lists is a pattern used by some legacy + // APIs. New APIs should NOT use this pattern. + rpc PagedExpandLegacyMapped(PagedExpandRequest) returns (PagedExpandLegacyMappedResponse) { + option (google.api.http) = { + post: "/v1beta1/echo:pagedExpandLegacyMapped" + body: "*" + }; + } + + // This method will wait for the requested amount of time and then return. + // This method showcases how a client handles a request timeout. + rpc Wait(WaitRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1beta1/echo:wait" + body: "*" + }; + option (google.longrunning.operation_info) = { + response_type: "WaitResponse" + metadata_type: "WaitMetadata" + }; + } + + // This method will block (wait) for the requested amount of time + // and then return the response or error. + // This method showcases how a client handles delays or retries. + rpc Block(BlockRequest) returns (BlockResponse) { + option (google.api.http) = { + post: "/v1beta1/echo:block" + body: "*" + }; + }; +} + +// A severity enum used to test enum capabilities in GAPIC surfaces. +enum Severity { + UNNECESSARY = 0; + NECESSARY = 1; + URGENT = 2; + CRITICAL = 3; +} + + +// The request message used for the Echo, Collect and Chat methods. +// If content or opt are set in this message then the request will succeed. +// If status is set in this message then the status will be returned as an +// error. +message EchoRequest { + oneof response { + // The content to be echoed by the server. + string content = 1; + + // The error to be thrown by the server. + google.rpc.Status error = 2; + } + + // The severity to be echoed by the server. + Severity severity = 3; + + // Optional. This field can be set to test the routing annotation on the Echo method. + string header = 4; + + // Optional. This field can be set to test the routing annotation on the Echo method. + string other_header = 5; + + // To facilitate testing of https://google.aip.dev/client-libraries/4235 + string request_id = 7 [ + (google.api.field_info).format = UUID4 + ]; + + // To facilitate testing of https://google.aip.dev/client-libraries/4235 + optional string other_request_id = 8 [ + (google.api.field_info).format = UUID4 + ]; +} + +// The response message for the Echo methods. +message EchoResponse { + // The content specified in the request. + string content = 1; + + // The severity specified in the request. + Severity severity = 2; + + // The request ID specified or autopopulated in the request. + string request_id = 3; + + // The other request ID specified or autopopulated in the request. + string other_request_id = 4; +} + +// The request message used for the EchoErrorDetails method. +message EchoErrorDetailsRequest { + // Content to return in a singular `*.error.details` field of type + // `google.protobuf.Any` + string single_detail_text = 1; + + // Content to return in a repeated `*.error.details` field of type + // `google.protobuf.Any` + repeated string multi_detail_text = 2; +} + +// The response message used for the EchoErrorDetails method. +message EchoErrorDetailsResponse { + + message SingleDetail { + ErrorWithSingleDetail error = 1; + } + + message MultipleDetails { + ErrorWithMultipleDetails error = 1; + } + + SingleDetail single_detail = 1; + MultipleDetails multiple_details = 2; +} + +message ErrorWithSingleDetail { + google.protobuf.Any details = 1; +} + +message ErrorWithMultipleDetails { + repeated google.protobuf.Any details = 1; +} + +// The custom error detail to be included in the error response from the +// FailEchoWithDetails method. Client libraries should be able to +// surface this custom error detail. +message PoetryError { + string poem = 1; +} + +// The request message used for the FailEchoWithDetails method. +message FailEchoWithDetailsRequest { + // Optional message to echo back in the PoetryError. If empty, a value will be + // provided. + string message = 1; +} + +// The response message declared (but never used) for the FailEchoWithDetails +// method. +message FailEchoWithDetailsResponse {} + +// The request message for the Expand method. +message ExpandRequest { + // The content that will be split into words and returned on the stream. + string content = 1; + + // The error that is thrown after all words are sent on the stream. + google.rpc.Status error = 2; + + //The wait time between each server streaming messages + google.protobuf.Duration stream_wait_time = 3; +} + +// The request for the PagedExpand method. +message PagedExpandRequest { + // The string to expand. + string content = 1 [(google.api.field_behavior) = REQUIRED]; + + // The number of words to returned in each page. + int32 page_size = 2; + + // The position of the page to be returned. + string page_token = 3; +} + +// The request for the PagedExpandLegacy method. This is a pattern used by some legacy APIs. New +// APIs should NOT use this pattern, but rather something like PagedExpandRequest which conforms to +// aip.dev/158. +message PagedExpandLegacyRequest { + // The string to expand. + string content = 1 [(google.api.field_behavior) = REQUIRED]; + + // The number of words to returned in each page. + // (-- aip.dev/not-precedent: This is a legacy, non-standard pattern that + // violates aip.dev/158. Ordinarily, this should be page_size. --) + int32 max_results = 2; + + // The position of the page to be returned. + string page_token = 3; +} + +// The response for the PagedExpand method. +message PagedExpandResponse { + // The words that were expanded. + repeated EchoResponse responses = 1; + + // The next page token. + string next_page_token = 2; +} + +// A list of words. +message PagedExpandResponseList { + repeated string words = 1; +} + +message PagedExpandLegacyMappedResponse { + // The words that were expanded, indexed by their initial character. + // (-- aip.dev/not-precedent: This is a legacy, non-standard pattern that violates + // aip.dev/158. Ordinarily, this should be a `repeated` field, as in PagedExpandResponse. --) + map alphabetized = 1; + + // The next page token. + string next_page_token = 2; +} + +// The request for Wait method. +message WaitRequest { + oneof end { + // The time that this operation will complete. + google.protobuf.Timestamp end_time = 1; + + // The duration of this operation. + google.protobuf.Duration ttl = 4; + } + + oneof response { + // The error that will be returned by the server. If this code is specified + // to be the OK rpc code, an empty response will be returned. + google.rpc.Status error = 2; + + // The response to be returned on operation completion. + WaitResponse success = 3; + } +} + +// The result of the Wait operation. +message WaitResponse { + // This content of the result. + string content = 1; +} + +// The metadata for Wait operation. +message WaitMetadata { + // The time that this operation will complete. + google.protobuf.Timestamp end_time =1; +} + +// The request for Block method. +message BlockRequest { + // The amount of time to block before returning a response. + google.protobuf.Duration response_delay = 1; + + oneof response { + // The error that will be returned by the server. If this code is specified + // to be the OK rpc code, an empty response will be returned. + google.rpc.Status error = 2; + + // The response to be returned that will signify successful method call. + BlockResponse success = 3; + } +} + +// The response for Block method. +message BlockResponse { + // This content can contain anything, the server will not depend on a value + // here. + string content = 1; +} diff --git a/java-showcase/proto-gapic-showcase-v1beta1/src/main/proto/schema/google/showcase/v1beta1/identity.proto b/java-showcase/proto-gapic-showcase-v1beta1/src/main/proto/schema/google/showcase/v1beta1/identity.proto new file mode 100644 index 0000000000..569c604d78 --- /dev/null +++ b/java-showcase/proto-gapic-showcase-v1beta1/src/main/proto/schema/google/showcase/v1beta1/identity.proto @@ -0,0 +1,186 @@ +// 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 +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT 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"; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/protobuf/empty.proto"; +import "google/protobuf/field_mask.proto"; +import "google/protobuf/timestamp.proto"; + +package google.showcase.v1beta1; + +option go_package = "github.com/googleapis/gapic-showcase/server/genproto"; +option java_package = "com.google.showcase.v1beta1"; +option java_multiple_files = true; +option ruby_package = "Google::Showcase::V1beta1"; + +// A simple identity service. +service Identity { + // This service is meant to only run locally on the port 7469 (keypad digits + // for "show"). + option (google.api.default_host) = "localhost:7469"; + + // Creates a user. + rpc CreateUser(CreateUserRequest) returns (User) { + option (google.api.http) = { + post: "/v1beta1/users" + body: "*" + }; + option (google.api.method_signature) = "user.display_name,user.email"; + option (google.api.method_signature) = + "user.display_name,user.email,user.age,user.nickname,user.enable_notifications,user.height_feet"; + } + + // Retrieves the User with the given uri. + rpc GetUser(GetUserRequest) returns (User) { + option (google.api.http) = { + get: "/v1beta1/{name=users/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Updates a user. + rpc UpdateUser(UpdateUserRequest) returns (User) { + option (google.api.http) = { + patch: "/v1beta1/{user.name=users/*}" + body: "user" + }; + } + + // Deletes a user, their profile, and all of their authored messages. + rpc DeleteUser(DeleteUserRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v1beta1/{name=users/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Lists all users. + rpc ListUsers(ListUsersRequest) returns (ListUsersResponse) { + option (google.api.http) = { + get: "/v1beta1/users" + }; + } +} + +// A user. +message User { + option (google.api.resource) = { + type: "showcase.googleapis.com/User" + pattern: "users/{user}" + }; + + // The resource name of the user. + string name = 1; + + // The display_name of the user. + string display_name = 2 [(google.api.field_behavior) = REQUIRED]; + + // The email address of the user. + string email = 3 [(google.api.field_behavior) = REQUIRED]; + + // The timestamp at which the user was created. + google.protobuf.Timestamp create_time = 4 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // The latest timestamp at which the user was updated. + google.protobuf.Timestamp update_time = 5 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // The age of the user in years. + optional int32 age = 6; + + // The height of the user in feet. + optional double height_feet = 7; + + // The nickname of the user. + // + // (-- aip.dev/not-precedent: An empty string is a valid nickname. + // Ordinarily, proto3_optional should not be used on a `string` field. --) + optional string nickname = 8; + + // Enables the receiving of notifications. The default is true if unset. + // + // (-- aip.dev/not-precedent: The default for the feature is true. + // Ordinarily, the default for a `bool` field should be false. --) + optional bool enable_notifications = 9; +} + +// The request message for the google.showcase.v1beta1.Identity\CreateUser +// method. +message CreateUserRequest { + // The user to create. + User user = 1; +} + +// The request message for the google.showcase.v1beta1.Identity\GetUser +// method. +message GetUserRequest { + // The resource name of the requested user. + string name = 1 [ + (google.api.resource_reference).type = "showcase.googleapis.com/User", + (google.api.field_behavior) = REQUIRED + ]; +} + +// The request message for the google.showcase.v1beta1.Identity\UpdateUser +// method. +message UpdateUserRequest { + // The user to update. + User user = 1; + + // The field mask to determine which fields are to be updated. If empty, the + // server will assume all fields are to be updated. + google.protobuf.FieldMask update_mask = 2; +} + +// The request message for the google.showcase.v1beta1.Identity\DeleteUser +// method. +message DeleteUserRequest { + // The resource name of the user to delete. + string name = 1 [ + (google.api.resource_reference).type = "showcase.googleapis.com/User", + (google.api.field_behavior) = REQUIRED + ]; +} + +// The request message for the google.showcase.v1beta1.Identity\ListUsers +// method. +message ListUsersRequest { + // The maximum number of users to return. Server may return fewer users + // than requested. If unspecified, server will pick an appropriate default. + int32 page_size = 1; + + // The value of google.showcase.v1beta1.ListUsersResponse.next_page_token + // returned from the previous call to + // `google.showcase.v1beta1.Identity\ListUsers` method. + string page_token = 2; +} + +// The response message for the google.showcase.v1beta1.Identity\ListUsers +// method. +message ListUsersResponse { + // The list of users. + repeated User users = 1; + + // A token to retrieve next page of results. + // Pass this value in ListUsersRequest.page_token field in the subsequent + // call to `google.showcase.v1beta1.Message\ListUsers` method to retrieve the + // next page of results. + string next_page_token = 2; +} diff --git a/java-showcase/proto-gapic-showcase-v1beta1/src/main/proto/schema/google/showcase/v1beta1/messaging.proto b/java-showcase/proto-gapic-showcase-v1beta1/src/main/proto/schema/google/showcase/v1beta1/messaging.proto new file mode 100644 index 0000000000..330dc8c9e7 --- /dev/null +++ b/java-showcase/proto-gapic-showcase-v1beta1/src/main/proto/schema/google/showcase/v1beta1/messaging.proto @@ -0,0 +1,520 @@ +// 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 +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT 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"; + +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"; +import "google/rpc/error_details.proto"; + +package google.showcase.v1beta1; + +option go_package = "github.com/googleapis/gapic-showcase/server/genproto"; +option java_package = "com.google.showcase.v1beta1"; +option java_multiple_files = true; +option ruby_package = "Google::Showcase::V1beta1"; + +// A simple messaging service that implements chat rooms and profile posts. +// +// This messaging service showcases the features that API clients +// generated by gapic-generators implement. +service Messaging { + // This service is meant to only run locally on the port 7469 (keypad digits + // for "show"). + option (google.api.default_host) = "localhost:7469"; + + // Creates a room. + rpc CreateRoom(CreateRoomRequest) returns (Room) { + option (google.api.http) = { + post: "/v1beta1/rooms" + body: "*" + }; + option (google.api.method_signature) = "room.display_name,room.description"; + } + + // Retrieves the Room with the given resource name. + rpc GetRoom(GetRoomRequest) returns (Room) { + option (google.api.http) = { + get: "/v1beta1/{name=rooms/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Updates a room. + rpc UpdateRoom(UpdateRoomRequest) returns (Room) { + option (google.api.http) = { + patch: "/v1beta1/{room.name=rooms/*}" + body: "room" + }; + } + + // Deletes a room and all of its blurbs. + rpc DeleteRoom(DeleteRoomRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v1beta1/{name=rooms/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Lists all chat rooms. + rpc ListRooms(ListRoomsRequest) returns (ListRoomsResponse) { + option (google.api.http) = { + get: "/v1beta1/rooms" + }; + } + + // Creates a blurb. If the parent is a room, the blurb is understood to be a + // message in that room. If the parent is a profile, the blurb is understood + // to be a post on the profile. + rpc CreateBlurb(CreateBlurbRequest) returns (Blurb) { + option (google.api.http) = { + post: "/v1beta1/{parent=rooms/*}/blurbs" + body: "*" + additional_bindings: { + post: "/v1beta1/{parent=users/*/profile}/blurbs" + body: "*" + } + }; + option (google.api.method_signature) = "parent,blurb.user,blurb.text"; + option (google.api.method_signature) = "parent,blurb.user,blurb.image"; + } + + // Retrieves the Blurb with the given resource name. + rpc GetBlurb(GetBlurbRequest) returns (Blurb) { + option (google.api.http) = { + get: "/v1beta1/{name=rooms/*/blurbs/*}" + additional_bindings: { get: "/v1beta1/{name=users/*/profile/blurbs/*}" } + }; + option (google.api.method_signature) = "name"; + } + + // Updates a blurb. + rpc UpdateBlurb(UpdateBlurbRequest) returns (Blurb) { + option (google.api.http) = { + patch: "/v1beta1/{blurb.name=rooms/*/blurbs/*}" + body: "blurb" + additional_bindings: { + patch: "/v1beta1/{blurb.name=users/*/profile/blurbs/*}" + body: "blurb" + } + }; + } + + // Deletes a blurb. + rpc DeleteBlurb(DeleteBlurbRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v1beta1/{name=rooms/*/blurbs/*}" + additional_bindings: { + delete: "/v1beta1/{name=users/*/profile/blurbs/*}" + } + }; + option (google.api.method_signature) = "name"; + } + + // Lists blurbs for a specific chat room or user profile depending on the + // parent resource name. + rpc ListBlurbs(ListBlurbsRequest) returns (ListBlurbsResponse) { + option (google.api.http) = { + get: "/v1beta1/{parent=rooms/*}/blurbs" + additional_bindings: { get: "/v1beta1/{parent=users/*/profile}/blurbs" } + }; + option (google.api.method_signature) = "parent"; + } + + // This method searches through all blurbs across all rooms and profiles + // for blurbs containing to words found in the query. Only posts that + // contain an exact match of a queried word will be returned. + rpc SearchBlurbs(SearchBlurbsRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1beta1/{parent=rooms/*}/blurbs:search" + body: "*" + additional_bindings: { + post: "/v1beta1/{parent=users/*/profile}/blurbs:search" + } + }; + option (google.longrunning.operation_info) = { + response_type: "SearchBlurbsResponse" + metadata_type: "SearchBlurbsMetadata" + }; + option (google.api.method_signature) = "parent,query"; + } + + // This returns a stream that emits the blurbs that are created for a + // particular chat room or user profile. + rpc StreamBlurbs(StreamBlurbsRequest) returns (stream StreamBlurbsResponse) { + option (google.api.http) = { + post: "/v1beta1/{name=rooms/*}/blurbs:stream" + body: "*" + additional_bindings: { + post: "/v1beta1/{name=users/*/profile}/blurbs:stream" + body: "*" + } + }; + } + + // This is a stream to create multiple blurbs. If an invalid blurb is + // requested to be created, the stream will close with an error. + rpc SendBlurbs(stream CreateBlurbRequest) returns (SendBlurbsResponse) { + option (google.api.http) = { + post: "/v1beta1/{parent=rooms/*}/blurbs:send" + body: "*" + additional_bindings: { + post: "/v1beta1/{parent=users/*/profile}/blurbs:send" + body: "*" + } + }; + } + + // This method starts a bidirectional stream that receives all blurbs that + // are being created after the stream has started and sends requests to create + // blurbs. If an invalid blurb is requested to be created, the stream will + // close with an error. + rpc Connect(stream ConnectRequest) returns (stream StreamBlurbsResponse); +} + +// A chat room. +message Room { + option (google.api.resource) = { + type: "showcase.googleapis.com/Room" + pattern: "rooms/{room}" + }; + + // The resource name of the chat room. + string name = 1; + + // The human readable name of the chat room. + string display_name = 2 [(google.api.field_behavior) = REQUIRED]; + + // The description of the chat room. + string description = 3; + + // The timestamp at which the room was created. + google.protobuf.Timestamp create_time = 4 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // The latest timestamp at which the room was updated. + google.protobuf.Timestamp update_time = 5 + [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// The request message for the google.showcase.v1beta1.Messaging\CreateRoom +// method. +message CreateRoomRequest { + // The room to create. + Room room = 1; +} + +// The request message for the google.showcase.v1beta1.Messaging\GetRoom +// method. +message GetRoomRequest { + // The resource name of the requested room. + string name = 1 [ + (google.api.resource_reference).type = "showcase.googleapis.com/Room", + (google.api.field_behavior) = REQUIRED + ]; +} + +// The request message for the google.showcase.v1beta1.Messaging\UpdateRoom +// method. +message UpdateRoomRequest { + // The room to update. + Room room = 1; + + // The field mask to determine which fields are to be updated. If empty, the + // server will assume all fields are to be updated. + google.protobuf.FieldMask update_mask = 2; +} + +// The request message for the google.showcase.v1beta1.Messaging\DeleteRoom +// method. +message DeleteRoomRequest { + // The resource name of the requested room. + string name = 1 [ + (google.api.resource_reference).type = "showcase.googleapis.com/Room", + (google.api.field_behavior) = REQUIRED + ]; +} + +// The request message for the google.showcase.v1beta1.Messaging\ListRooms +// method. +message ListRoomsRequest { + // The maximum number of rooms return. Server may return fewer rooms + // than requested. If unspecified, server will pick an appropriate default. + int32 page_size = 1; + + // The value of google.showcase.v1beta1.ListRoomsResponse.next_page_token + // returned from the previous call to + // `google.showcase.v1beta1.Messaging\ListRooms` method. + string page_token = 2; +} + +// The response message for the google.showcase.v1beta1.Messaging\ListRooms +// method. +message ListRoomsResponse { + // The list of rooms. + repeated Room rooms = 1; + + // A token to retrieve next page of results. + // Pass this value in ListRoomsRequest.page_token field in the subsequent + // call to `google.showcase.v1beta1.Messaging\ListRooms` method to retrieve + // the next page of results. + string next_page_token = 2; +} + +// This protocol buffer message represents a blurb sent to a chat room or +// posted on a user profile. +message Blurb { + option (google.api.resource) = { + type: "showcase.googleapis.com/Blurb" + pattern: "users/{user}/profile/blurbs/legacy/{legacy_user}~{blurb}" + pattern: "users/{user}/profile/blurbs/{blurb}" + pattern: "rooms/{room}/blurbs/{blurb}" + pattern: "rooms/{room}/blurbs/legacy/{legacy_room}.{blurb}" + }; + + // The resource name of the chat room. + string name = 1; + + // The resource name of the blurb's author. + string user = 2 [ + (google.api.resource_reference).type = "showcase.googleapis.com/User", + (google.api.field_behavior) = REQUIRED + ]; + + oneof content { + // The textual content of this blurb. + string text = 3; + + // The image content of this blurb. + bytes image = 4; + } + + // The timestamp at which the blurb was created. + google.protobuf.Timestamp create_time = 5 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // The latest timestamp at which the blurb was updated. + google.protobuf.Timestamp update_time = 6 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // (-- aip.dev/not-precedent: This is designed for testing non-slash + // resource patterns. Ordinarily, non-slash separators are discouraged. + // --) + oneof legacy_id { + // The legacy id of the room. This field is used to signal + // the use of the compound resource pattern + // `rooms/{room}/blurbs/legacy/{legacy_room}.{blurb}` + string legacy_room_id = 7; + + // The legacy id of the user. This field is used to signal + // the use of the compound resource pattern + // `users/{user}/profile/blurbs/legacy/{legacy_user}~{blurb}` + string legacy_user_id = 8; + } +} + +// The request message for the google.showcase.v1beta1.Messaging\CreateBlurb +// method. +message CreateBlurbRequest { + // The resource name of the chat room or user profile that this blurb will + // be tied to. + string parent = 1 [ + (google.api.resource_reference).child_type = + "showcase.googleapis.com/Blurb", + (google.api.field_behavior) = REQUIRED + ]; + + // The blurb to create. + Blurb blurb = 2; +} + +// The request message for the google.showcase.v1beta1.Messaging\GetBlurb +// method. +message GetBlurbRequest { + // The resource name of the requested blurb. + string name = 1 [ + (google.api.resource_reference).type = "showcase.googleapis.com/Blurb", + (google.api.field_behavior) = REQUIRED + ]; +} + +// The request message for the google.showcase.v1beta1.Messaging\UpdateBlurb +// method. +message UpdateBlurbRequest { + // The blurb to update. + Blurb blurb = 1; + + // The field mask to determine which fields are to be updated. If empty, the + // server will assume all fields are to be updated. + google.protobuf.FieldMask update_mask = 2; +} + +// The request message for the google.showcase.v1beta1.Messaging\DeleteBlurb +// method. +message DeleteBlurbRequest { + // The resource name of the requested blurb. + string name = 1 [ + (google.api.resource_reference).type = "showcase.googleapis.com/Blurb", + (google.api.field_behavior) = REQUIRED + ]; +} + +// The request message for the google.showcase.v1beta1.Messaging\ListBlurbs +// method. +message ListBlurbsRequest { + // The resource name of the requested room or profile who blurbs to list. + string parent = 1 [ + (google.api.resource_reference).child_type = + "showcase.googleapis.com/Blurb", + (google.api.field_behavior) = REQUIRED + ]; + + // The maximum number of blurbs to return. Server may return fewer + // blurbs than requested. If unspecified, server will pick an appropriate + // default. + int32 page_size = 2; + + // The value of google.showcase.v1beta1.ListBlurbsResponse.next_page_token + // returned from the previous call to + // `google.showcase.v1beta1.Messaging\ListBlurbs` method. + string page_token = 3; +} + +// The response message for the google.showcase.v1beta1.Messaging\ListBlurbs +// method. +message ListBlurbsResponse { + // The list of blurbs. + repeated Blurb blurbs = 1; + + // A token to retrieve next page of results. + // Pass this value in ListBlurbsRequest.page_token field in the subsequent + // call to `google.showcase.v1beta1.Blurb\ListBlurbs` method to retrieve + // the next page of results. + string next_page_token = 2; +} + +// The request message for the google.showcase.v1beta1.Messaging\SearchBlurbs +// method. +message SearchBlurbsRequest { + // The query used to search for blurbs containing to words of this string. + // Only posts that contain an exact match of a queried word will be returned. + string query = 1 [(google.api.field_behavior) = REQUIRED]; + + // The rooms or profiles to search. If unset, `SearchBlurbs` will search all + // rooms and all profiles. + string parent = 2 [(google.api.resource_reference).child_type = + "showcase.googleapis.com/Blurb"]; + + // The maximum number of blurbs return. Server may return fewer + // blurbs than requested. If unspecified, server will pick an appropriate + // default. + int32 page_size = 3; + + // The value of + // google.showcase.v1beta1.SearchBlurbsResponse.next_page_token + // returned from the previous call to + // `google.showcase.v1beta1.Messaging\SearchBlurbs` method. + string page_token = 4; +} + +// The operation metadata message for the +// google.showcase.v1beta1.Messaging\SearchBlurbs method. +message SearchBlurbsMetadata { + // This signals to the client when to next poll for response. + google.rpc.RetryInfo retry_info = 1; +} + +// The operation response message for the +// google.showcase.v1beta1.Messaging\SearchBlurbs method. +message SearchBlurbsResponse { + // Blurbs that matched the search query. + repeated Blurb blurbs = 1; + + // A token to retrieve next page of results. + // Pass this value in SearchBlurbsRequest.page_token field in the subsequent + // call to `google.showcase.v1beta1.Blurb\SearchBlurbs` method to + // retrieve the next page of results. + string next_page_token = 2; +} + +// The request message for the google.showcase.v1beta1.Messaging\StreamBlurbs +// method. +message StreamBlurbsRequest { + // The resource name of a chat room or user profile whose blurbs to stream. + string name = 1 [ + (google.api.resource_reference).child_type = + "showcase.googleapis.com/Blurb", + (google.api.field_behavior) = REQUIRED + ]; + + // The time at which this stream will close. + google.protobuf.Timestamp expire_time = 2 + [(google.api.field_behavior) = REQUIRED]; +} + +// The response message for the google.showcase.v1beta1.Messaging\StreamBlurbs +// method. +message StreamBlurbsResponse { + // The blurb that was either created, updated, or deleted. + Blurb blurb = 1; + + // The action that triggered the blurb to be returned. + enum Action { + ACTION_UNSPECIFIED = 0; + + // Specifies that the blurb was created. + CREATE = 1; + + // Specifies that the blurb was updated. + UPDATE = 2; + + // Specifies that the blurb was deleted. + DELETE = 3; + } + + // The action that triggered the blurb to be returned. + Action action = 2; +} + +// The response message for the google.showcase.v1beta1.Messaging\SendBlurbs +// method. +message SendBlurbsResponse { + // The names of successful blurb creations. + repeated string names = 1; +} + +// The request message for the google.showcase.v1beta1.Messaging\Connect +// method. +message ConnectRequest { + message ConnectConfig { + // The room or profile to follow and create messages for. + string parent = 1 [(google.api.resource_reference).child_type = + "showcase.googleapis.com/Blurb"]; + } + + oneof request { + // Provides information that specifies how to process subsequent requests. + // The first `ConnectRequest` message must contain a `config` message. + ConnectConfig config = 1; + + // The blurb to be created. + Blurb blurb = 2; + } +} diff --git a/java-showcase/proto-gapic-showcase-v1beta1/src/main/proto/schema/google/showcase/v1beta1/rest_error.proto b/java-showcase/proto-gapic-showcase-v1beta1/src/main/proto/schema/google/showcase/v1beta1/rest_error.proto new file mode 100644 index 0000000000..0b4e299597 --- /dev/null +++ b/java-showcase/proto-gapic-showcase-v1beta1/src/main/proto/schema/google/showcase/v1beta1/rest_error.proto @@ -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. + +syntax = "proto3"; + +import "google/protobuf/any.proto"; +import "google/rpc/code.proto"; + +package google.showcase.v1beta1; + +option go_package = "github.com/googleapis/gapic-showcase/server/genproto"; +option java_package = "com.google.showcase.v1beta1"; +option java_multiple_files = true; +option ruby_package = "Google::Showcase::V1beta1"; + +// HTTP/JSON error representation as defined in +// https://google.aip.dev/193#http11json-representation, +message RestError { + message Status { + // The HTTP status code that corresponds to `google.rpc.Status.code`. + int32 code = 1; + // This corresponds to `google.rpc.Status.message`. + string message = 2; + // This is the enum version for `google.rpc.Status.code`. + google.rpc.Code status = 4; + // This corresponds to `google.rpc.Status.details`. + repeated google.protobuf.Any details = 5; + } + + Status error = 1; +} diff --git a/java-showcase/proto-gapic-showcase-v1beta1/src/main/proto/schema/google/showcase/v1beta1/sequence.proto b/java-showcase/proto-gapic-showcase-v1beta1/src/main/proto/schema/google/showcase/v1beta1/sequence.proto new file mode 100644 index 0000000000..a4e3ee28f1 --- /dev/null +++ b/java-showcase/proto-gapic-showcase-v1beta1/src/main/proto/schema/google/showcase/v1beta1/sequence.proto @@ -0,0 +1,260 @@ +// Copyright 2020 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/protobuf/duration.proto"; +import "google/protobuf/empty.proto"; +import "google/protobuf/timestamp.proto"; +import "google/rpc/status.proto"; + +package google.showcase.v1beta1; + +option go_package = "github.com/googleapis/gapic-showcase/server/genproto"; +option java_package = "com.google.showcase.v1beta1"; +option java_multiple_files = true; +option ruby_package = "Google::Showcase::V1beta1"; + +service SequenceService { + // This service is meant to only run locally on the port 7469 (keypad digits + // for "show"). + option (google.api.default_host) = "localhost:7469"; + + // Creates a sequence. + rpc CreateSequence(CreateSequenceRequest) returns (Sequence) { + option (google.api.http) = { + post: "/v1beta1/sequences" + body: "sequence" + }; + option (google.api.method_signature) = "sequence"; + }; + + // Creates a sequence. + rpc CreateStreamingSequence(CreateStreamingSequenceRequest) returns (StreamingSequence) { + option (google.api.http) = { + post: "/v1beta1/streamingSequences" + body: "streaming_sequence" + }; + option (google.api.method_signature) = "streaming_sequence"; + }; + + // Retrieves a sequence. + rpc GetSequenceReport(GetSequenceReportRequest) returns (SequenceReport) { + option (google.api.http) = { + get: "/v1beta1/{name=sequences/*/sequenceReport}" + }; + option (google.api.method_signature) = "name"; + }; + + // Retrieves a sequence. + rpc GetStreamingSequenceReport(GetStreamingSequenceReportRequest) returns (StreamingSequenceReport) { + option (google.api.http) = { + get: "/v1beta1/{name=streamingSequences/*/streamingSequenceReport}" + }; + option (google.api.method_signature) = "name"; + }; + + // Attempts a sequence. + rpc AttemptSequence(AttemptSequenceRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + post: "/v1beta1/{name=sequences/*}" + body: "*" + }; + option (google.api.method_signature) = "name"; + }; + + // Attempts a streaming sequence. + // May not function as expected in HTTP mode due to when http statuses are sent + // See https://github.com/googleapis/gapic-showcase/issues/1377 for more details + rpc AttemptStreamingSequence(AttemptStreamingSequenceRequest) returns (stream AttemptStreamingSequenceResponse) { + option (google.api.http) = { + post: "/v1beta1/{name=streamingSequences/*}:stream" + body: "*" + }; + option (google.api.method_signature) = "name"; + }; +} + +message Sequence { + option (google.api.resource) = { + type: "showcase.googleapis.com/Sequence" + pattern: "sequences/{sequence}" + }; + + string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // A server response to an RPC Attempt in a sequence. + message Response { + // The status to return for an individual attempt. + google.rpc.Status status = 1; + + // The amount of time to delay sending the response. + google.protobuf.Duration delay = 2; + } + + // Sequence of responses to return in order for each attempt. If empty, the + // default response is an immediate OK. + repeated Response responses = 2; +} + +message StreamingSequence { + option (google.api.resource) = { + type: "showcase.googleapis.com/StreamingSequence" + pattern: "streamingSequences/{streaming_sequence}" + }; + + string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // The Content that the stream will send + string content = 2; + + // A server response to an RPC Attempt in a sequence. + message Response { + // The status to return for an individual attempt. + google.rpc.Status status = 1; + + // The amount of time to delay sending the response. + google.protobuf.Duration delay = 2; + + // The index that the status should be sent + int32 response_index = 3; + } + + // Sequence of responses to return in order for each attempt. If empty, the + // default response is an immediate OK. + repeated Response responses = 3; +} + + +message StreamingSequenceReport { + option (google.api.resource) = { + type: "showcase.googleapis.com/StreamingSequenceReport" + pattern: "streamingSequences/{streaming_sequence}/streamingSequenceReport" + }; + + string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Contains metrics on individual RPC Attempts in a sequence. + message Attempt { + // The attempt number - starting at 0. + int32 attempt_number = 1; + + // The deadline dictated by the attempt to the server. + google.protobuf.Timestamp attempt_deadline = 2; + + // The time that the server responded to the RPC attempt. Used for + // calculating attempt_delay. + google.protobuf.Timestamp response_time = 3; + + // The server perceived delay between sending the last response and + // receiving this attempt. Used for validating attempt delay backoff. + google.protobuf.Duration attempt_delay = 4; + + // The status returned to the attempt. + google.rpc.Status status = 5; + + } + + // The set of RPC attempts received by the server for a Sequence. + repeated Attempt attempts = 2; +} + +message SequenceReport { + option (google.api.resource) = { + type: "showcase.googleapis.com/SequenceReport" + pattern: "sequences/{sequence}/sequenceReport" + }; + + string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Contains metrics on individual RPC Attempts in a sequence. + message Attempt { + // The attempt number - starting at 0. + int32 attempt_number = 1; + + // The deadline dictated by the attempt to the server. + google.protobuf.Timestamp attempt_deadline = 2; + + // The time that the server responded to the RPC attempt. Used for + // calculating attempt_delay. + google.protobuf.Timestamp response_time = 3; + + // The server perceived delay between sending the last response and + // receiving this attempt. Used for validating attempt delay backoff. + google.protobuf.Duration attempt_delay = 4; + + // The status returned to the attempt. + google.rpc.Status status = 5; + } + + // The set of RPC attempts received by the server for a Sequence. + repeated Attempt attempts = 2; +} + +message CreateSequenceRequest { + Sequence sequence = 1; +} + +message CreateStreamingSequenceRequest { + StreamingSequence streaming_sequence = 1; +} + +message AttemptSequenceRequest { + string name = 1 [ + (google.api.resource_reference).type = "showcase.googleapis.com/Sequence", + (google.api.field_behavior) = REQUIRED + ]; + +} + +message AttemptStreamingSequenceRequest { + string name = 1 [ + (google.api.resource_reference).type = "showcase.googleapis.com/StreamingSequence", + (google.api.field_behavior) = REQUIRED + ]; + + // used to send the index of the last failed message + // in the string "content" of an AttemptStreamingSequenceResponse + // needed for stream resumption logic testing + int32 last_fail_index = 2 [ + (google.api.field_behavior) = OPTIONAL + ]; +} + +// The response message for the Echo methods. +message AttemptStreamingSequenceResponse { + // The content specified in the request. + string content = 1; + +} + +message GetSequenceReportRequest { + string name = 1 [ + (google.api.resource_reference).type = + "showcase.googleapis.com/SequenceReport", + (google.api.field_behavior) = REQUIRED + ]; +} + +message GetStreamingSequenceReportRequest { + string name = 1 [ + (google.api.resource_reference).type = + "showcase.googleapis.com/StreamingSequenceReport", + (google.api.field_behavior) = REQUIRED + ]; +} diff --git a/java-showcase/proto-gapic-showcase-v1beta1/src/main/proto/schema/google/showcase/v1beta1/testing.proto b/java-showcase/proto-gapic-showcase-v1beta1/src/main/proto/schema/google/showcase/v1beta1/testing.proto new file mode 100644 index 0000000000..be66091074 --- /dev/null +++ b/java-showcase/proto-gapic-showcase-v1beta1/src/main/proto/schema/google/showcase/v1beta1/testing.proto @@ -0,0 +1,392 @@ +// 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 +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT 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"; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/resource.proto"; +import "google/protobuf/empty.proto"; + +package google.showcase.v1beta1; + +option go_package = "github.com/googleapis/gapic-showcase/server/genproto"; +option java_package = "com.google.showcase.v1beta1"; +option java_multiple_files = true; +option ruby_package = "Google::Showcase::V1beta1"; + +// A service to facilitate running discrete sets of tests +// against Showcase. +// Adding this comment with special characters for comment formatting tests: +// 1. (abra->kadabra->alakazam) +// 2) [Nonsense][]: `pokemon/*/psychic/*` +service Testing { + // This service is meant to only run locally on the port 7469 (keypad digits + // for "show"). + option (google.api.default_host) = "localhost:7469"; + + // Creates a new testing session. + // Adding this comment with special characters for comment formatting tests: + // 1. (abra->kadabra->alakazam) + // 2) [Nonsense][]: `pokemon/*/psychic/*` + rpc CreateSession(CreateSessionRequest) returns (Session) { + option (google.api.http) = { + post: "/v1beta1/sessions" + body: "session" + }; + } + + // Gets a testing session. + rpc GetSession(GetSessionRequest) returns (Session) { + option (google.api.http) = { + get: "/v1beta1/{name=sessions/*}" + }; + } + + // Lists the current test sessions. + rpc ListSessions(ListSessionsRequest) returns (ListSessionsResponse) { + option (google.api.http) = { + get: "/v1beta1/sessions" + }; + } + + // Delete a test session. + rpc DeleteSession(DeleteSessionRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v1beta1/{name=sessions/*}" + }; + } + + // Report on the status of a session. + // This generates a report detailing which tests have been completed, + // and an overall rollup. + rpc ReportSession(ReportSessionRequest) returns (ReportSessionResponse) { + option (google.api.http) = { + post: "/v1beta1/{name=sessions/*}:report" + }; + } + + // List the tests of a sessesion. + rpc ListTests(ListTestsRequest) returns (ListTestsResponse) { + option (google.api.http) = { + get: "/v1beta1/{parent=sessions/*}/tests" + }; + } + + // Explicitly decline to implement a test. + // + // This removes the test from subsequent `ListTests` calls, and + // attempting to do the test will error. + // + // This method will error if attempting to delete a required test. + rpc DeleteTest(DeleteTestRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v1beta1/{name=sessions/*/tests/*}" + }; + } + + // Register a response to a test. + // + // In cases where a test involves registering a final answer at the + // end of the test, this method provides the means to do so. + rpc VerifyTest(VerifyTestRequest) returns (VerifyTestResponse) { + option (google.api.http) = { + post: "/v1beta1/{name=sessions/*/tests/*}:check" + }; + } +} + +// A session is a suite of tests, generally being made in the context +// of testing code generation. +// +// A session defines tests it may expect, based on which version of the +// code generation spec is in use. +message Session { + option (google.api.resource) = { + type: "showcase.googleapis.com/Session" + pattern: "sessions/{session}" + }; + + // The name of the session. The ID must conform to ^[a-z]+$ + // If this is not provided, Showcase chooses one at random. + string name = 1; + + // The specification versions understood by Showcase. + enum Version { + // Unspecified version. If passed on creation, the session will default + // to using the latest stable release. + VERSION_UNSPECIFIED = 0; + + // The latest v1. Currently, this is v1.0. + V1_LATEST = 1; + + // v1.0. (Until the spec is "GA", this will be a moving target.) + V1_0 = 2; + } + + // Required. The version this session is using. + Version version = 2; +} + +// The request for the CreateSession method. +message CreateSessionRequest { + // The session to be created. + // Sessions are immutable once they are created (although they can + // be deleted). + Session session = 1; +} + +// The request for the GetSession method. +message GetSessionRequest { + // The session to be retrieved. + string name = 1 [ + (google.api.resource_reference).type = "showcase.googleapis.com/Session"]; +} + +// The request for the ListSessions method. +message ListSessionsRequest { + // The maximum number of sessions to return per page. + int32 page_size = 1; + + // The page token, for retrieving subsequent pages. + string page_token = 2; +} + +// Response for the ListSessions method. +message ListSessionsResponse { + // The sessions being returned. + repeated Session sessions = 1; + + // The next page token, if any. + // An empty value here means the last page has been reached. + string next_page_token = 2; +} + +// Request for the DeleteSession method. +message DeleteSessionRequest { + // The session to be deleted. + string name = 1 [ + (google.api.resource_reference).type = "showcase.googleapis.com/Session"]; +} + +// Request message for reporting on a session. +message ReportSessionRequest { + // The session to be reported on. + string name = 1 [ + (google.api.resource_reference).type = "showcase.googleapis.com/Session"]; +} + +// Response message for reporting on a session. +message ReportSessionResponse { + // The topline state of the report. + enum Result { + RESULT_UNSPECIFIED = 0; + + // The session is complete, and everything passed. + PASSED = 1; + + // The session had an explicit failure. + FAILED = 2; + + // The session is incomplete. This is a failure response. + INCOMPLETE = 3; + } + + // The state of the report. + Result result = 1; + + // The test runs of this session. + repeated TestRun test_runs = 2; +} + +message Test { + option (google.api.resource) = { + type: "showcase.googleapis.com/Test" + pattern: "sessions/{session}/tests/{test}" + }; + + // The name of the test. + // The tests/* portion of the names are hard-coded, and do not change + // from session to session. + string name = 1; + + // Whether or not a test is required, recommended, or optional. + enum ExpectationLevel { + EXPECTATION_LEVEL_UNSPECIFIED = 0; + + // This test is strictly required. + REQUIRED = 1; + + // This test is recommended. + // + // If a generator explicitly ignores a recommended test (see `DeleteTest`), + // then the report may still pass, but with a warning. + // + // If a generator skips a recommended test and does not explicitly + // express that intention, the report will fail. + RECOMMENDED = 2; + + // This test is optional. + // + // If a generator explicitly ignores an optional test (see `DeleteTest`), + // then the report may still pass, and no warning will be issued. + // + // If a generator skips an optional test and does not explicitly + // express that intention, the report may still pass, but with a + // warning. + OPTIONAL = 3; + } + + // The expectation level for this test. + ExpectationLevel expectation_level = 2; + + // A description of the test. + string description = 3; + + // A blueprint is an explicit definition of methods and requests that are needed + // to be made to test this specific test case. Ideally this would be represented + // by something more robust like CEL, but as of writing this, I am unsure if CEL + // is ready. + message Blueprint { + option (google.api.resource) = { + type: "showcase.googleapis.com/Blueprint" + pattern: "sessions/{session}/tests/{test}/blueprints/{blueprint}" + }; + + // The name of this blueprint. + string name = 1; + + // A description of this blueprint. + string description = 2; + + // A message representing a method invocation. + message Invocation { + // The fully qualified name of the showcase method to be invoked. + string method = 1; + + // The request to be made if a specific request is necessary. + bytes serialized_request = 2; + } + + // The initial request to trigger this test. + Invocation request = 3; + + // An ordered list of method calls that can be called to trigger this test. + repeated Invocation additional_requests = 4; + } + + // The blueprints that will satisfy this test. There may be multiple blueprints + // that can signal to the server that this test case is being exercised. Although + // multiple blueprints are specified, only a single blueprint needs to be run to + // signal that the test case was exercised. + repeated Blueprint blueprints = 4; +} + +// An issue found in the test. +message Issue { + // The different potential types of issues. + enum Type { + TYPE_UNSPECIFIED = 0; + + // The test was never instrumented. + SKIPPED = 1; + + // The test was started but never confirmed. + PENDING = 2; + + // The test was instrumented, but Showcase got an unexpected + // value when the generator tried to confirm success. + INCORRECT_CONFIRMATION = 3; + } + + // The type of the issue. + Type type = 1; + + // Severity levels. + enum Severity { + SEVERITY_UNSPECIFIED = 0; + + // Errors. + ERROR = 1; + + // Warnings. + WARNING = 2; + } + + // The severity of the issue. + Severity severity = 2; + + // A description of the issue. + string description = 3; +} + +// The request for the ListTests method. +message ListTestsRequest { + // The session. + string parent = 1 [ + (google.api.resource_reference).type = "showcase.googleapis.com/Session"]; + + // The maximum number of tests to return per page. + int32 page_size = 2; + + // The page token, for retrieving subsequent pages. + string page_token = 3; +} + +// The response for the ListTests method. +message ListTestsResponse { + // The tests being returned. + repeated Test tests = 1; + + // The next page token, if any. + // An empty value here means the last page has been reached. + string next_page_token = 2; +} + +// A TestRun is the result of running a Test. +message TestRun { + // The name of the test. + // The tests/* portion of the names are hard-coded, and do not change + // from session to session. + string test = 1 [ + (google.api.resource_reference).type = "showcase.googleapis.com/Test"]; + + + // An issue found with the test run. If empty, this test run was successful. + Issue issue = 2; +} + +// Request message for deleting a test. +message DeleteTestRequest { + // The test to be deleted. + string name = 1 [ + (google.api.resource_reference).type = "showcase.googleapis.com/Test"]; +} + +message VerifyTestRequest { + // The test to have an answer registered to it. + string name = 1 [ + (google.api.resource_reference).type = "showcase.googleapis.com/Test"]; + + // The answer from the test. + bytes answer = 2; + + // The answers from the test if multiple are to be checked + repeated bytes answers = 3; +} + +message VerifyTestResponse { + // An issue if check answer was unsuccessful. This will be empty if the check answer succeeded. + Issue issue = 1; +} diff --git a/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/compliance/create/SyncCreateSetCredentialsProvider.java b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/compliance/create/SyncCreateSetCredentialsProvider.java new file mode 100644 index 0000000000..d176c7cbd5 --- /dev/null +++ b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/compliance/create/SyncCreateSetCredentialsProvider.java @@ -0,0 +1,44 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.samples; + +// [START localhost7469_v1beta1_generated_Compliance_Create_SetCredentialsProvider_sync] +import com.google.api.gax.core.FixedCredentialsProvider; +import com.google.showcase.v1beta1.ComplianceClient; +import com.google.showcase.v1beta1.ComplianceSettings; +import com.google.showcase.v1beta1.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 + ComplianceSettings complianceSettings = + ComplianceSettings.newBuilder() + .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials)) + .build(); + ComplianceClient complianceClient = ComplianceClient.create(complianceSettings); + } +} +// [END localhost7469_v1beta1_generated_Compliance_Create_SetCredentialsProvider_sync] diff --git a/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/compliance/create/SyncCreateSetEndpoint.java b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/compliance/create/SyncCreateSetEndpoint.java new file mode 100644 index 0000000000..3278a12a80 --- /dev/null +++ b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/compliance/create/SyncCreateSetEndpoint.java @@ -0,0 +1,41 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.samples; + +// [START localhost7469_v1beta1_generated_Compliance_Create_SetEndpoint_sync] +import com.google.showcase.v1beta1.ComplianceClient; +import com.google.showcase.v1beta1.ComplianceSettings; +import com.google.showcase.v1beta1.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 + ComplianceSettings complianceSettings = + ComplianceSettings.newBuilder().setEndpoint(myEndpoint).build(); + ComplianceClient complianceClient = ComplianceClient.create(complianceSettings); + } +} +// [END localhost7469_v1beta1_generated_Compliance_Create_SetEndpoint_sync] diff --git a/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/compliance/create/SyncCreateUseHttpJsonTransport.java b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/compliance/create/SyncCreateUseHttpJsonTransport.java new file mode 100644 index 0000000000..b4294b06d2 --- /dev/null +++ b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/compliance/create/SyncCreateUseHttpJsonTransport.java @@ -0,0 +1,39 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.samples; + +// [START localhost7469_v1beta1_generated_Compliance_Create_UseHttpJsonTransport_sync] +import com.google.showcase.v1beta1.ComplianceClient; +import com.google.showcase.v1beta1.ComplianceSettings; + +public class SyncCreateUseHttpJsonTransport { + + public static void main(String[] args) throws Exception { + syncCreateUseHttpJsonTransport(); + } + + public static void syncCreateUseHttpJsonTransport() 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 + ComplianceSettings complianceSettings = ComplianceSettings.newHttpJsonBuilder().build(); + ComplianceClient complianceClient = ComplianceClient.create(complianceSettings); + } +} +// [END localhost7469_v1beta1_generated_Compliance_Create_UseHttpJsonTransport_sync] diff --git a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/compliance/getenum/AsyncGetEnum.java b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/compliance/getenum/AsyncGetEnum.java similarity index 98% rename from showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/compliance/getenum/AsyncGetEnum.java rename to java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/compliance/getenum/AsyncGetEnum.java index 464c666e72..ce9bf69a83 100644 --- a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/compliance/getenum/AsyncGetEnum.java +++ b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/compliance/getenum/AsyncGetEnum.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/compliance/getenum/SyncGetEnum.java b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/compliance/getenum/SyncGetEnum.java similarity index 98% rename from showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/compliance/getenum/SyncGetEnum.java rename to java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/compliance/getenum/SyncGetEnum.java index 25e134f2a3..6172758f6e 100644 --- a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/compliance/getenum/SyncGetEnum.java +++ b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/compliance/getenum/SyncGetEnum.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/compliance/getiampolicy/AsyncGetIamPolicy.java b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/compliance/getiampolicy/AsyncGetIamPolicy.java new file mode 100644 index 0000000000..51f3548736 --- /dev/null +++ b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/compliance/getiampolicy/AsyncGetIamPolicy.java @@ -0,0 +1,51 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.samples; + +// [START localhost7469_v1beta1_generated_Compliance_GetIamPolicy_async] +import com.google.api.core.ApiFuture; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.GetPolicyOptions; +import com.google.iam.v1.Policy; +import com.google.showcase.v1beta1.BlurbName; +import com.google.showcase.v1beta1.ComplianceClient; + +public class AsyncGetIamPolicy { + + public static void main(String[] args) throws Exception { + asyncGetIamPolicy(); + } + + public static void asyncGetIamPolicy() 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 (ComplianceClient complianceClient = ComplianceClient.create()) { + GetIamPolicyRequest request = + GetIamPolicyRequest.newBuilder() + .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString()) + .setOptions(GetPolicyOptions.newBuilder().build()) + .build(); + ApiFuture future = complianceClient.getIamPolicyCallable().futureCall(request); + // Do something. + Policy response = future.get(); + } + } +} +// [END localhost7469_v1beta1_generated_Compliance_GetIamPolicy_async] diff --git a/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/compliance/getiampolicy/SyncGetIamPolicy.java b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/compliance/getiampolicy/SyncGetIamPolicy.java new file mode 100644 index 0000000000..6512dfb02c --- /dev/null +++ b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/compliance/getiampolicy/SyncGetIamPolicy.java @@ -0,0 +1,48 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.samples; + +// [START localhost7469_v1beta1_generated_Compliance_GetIamPolicy_sync] +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.GetPolicyOptions; +import com.google.iam.v1.Policy; +import com.google.showcase.v1beta1.BlurbName; +import com.google.showcase.v1beta1.ComplianceClient; + +public class SyncGetIamPolicy { + + public static void main(String[] args) throws Exception { + syncGetIamPolicy(); + } + + public static void syncGetIamPolicy() 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 (ComplianceClient complianceClient = ComplianceClient.create()) { + GetIamPolicyRequest request = + GetIamPolicyRequest.newBuilder() + .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString()) + .setOptions(GetPolicyOptions.newBuilder().build()) + .build(); + Policy response = complianceClient.getIamPolicy(request); + } + } +} +// [END localhost7469_v1beta1_generated_Compliance_GetIamPolicy_sync] diff --git a/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/compliance/getlocation/AsyncGetLocation.java b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/compliance/getlocation/AsyncGetLocation.java new file mode 100644 index 0000000000..5a37e0894b --- /dev/null +++ b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/compliance/getlocation/AsyncGetLocation.java @@ -0,0 +1,45 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.samples; + +// [START localhost7469_v1beta1_generated_Compliance_GetLocation_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.Location; +import com.google.showcase.v1beta1.ComplianceClient; + +public class AsyncGetLocation { + + public static void main(String[] args) throws Exception { + asyncGetLocation(); + } + + public static void asyncGetLocation() 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 (ComplianceClient complianceClient = ComplianceClient.create()) { + GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build(); + ApiFuture future = complianceClient.getLocationCallable().futureCall(request); + // Do something. + Location response = future.get(); + } + } +} +// [END localhost7469_v1beta1_generated_Compliance_GetLocation_async] diff --git a/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/compliance/getlocation/SyncGetLocation.java b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/compliance/getlocation/SyncGetLocation.java new file mode 100644 index 0000000000..629f35d81a --- /dev/null +++ b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/compliance/getlocation/SyncGetLocation.java @@ -0,0 +1,42 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.samples; + +// [START localhost7469_v1beta1_generated_Compliance_GetLocation_sync] +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.Location; +import com.google.showcase.v1beta1.ComplianceClient; + +public class SyncGetLocation { + + public static void main(String[] args) throws Exception { + syncGetLocation(); + } + + public static void syncGetLocation() 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 (ComplianceClient complianceClient = ComplianceClient.create()) { + GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build(); + Location response = complianceClient.getLocation(request); + } + } +} +// [END localhost7469_v1beta1_generated_Compliance_GetLocation_sync] diff --git a/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/compliance/listlocations/AsyncListLocations.java b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/compliance/listlocations/AsyncListLocations.java new file mode 100644 index 0000000000..3a79d09641 --- /dev/null +++ b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/compliance/listlocations/AsyncListLocations.java @@ -0,0 +1,54 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.samples; + +// [START localhost7469_v1beta1_generated_Compliance_ListLocations_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.Location; +import com.google.showcase.v1beta1.ComplianceClient; + +public class AsyncListLocations { + + public static void main(String[] args) throws Exception { + asyncListLocations(); + } + + public static void asyncListLocations() 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 (ComplianceClient complianceClient = ComplianceClient.create()) { + ListLocationsRequest request = + ListLocationsRequest.newBuilder() + .setName("name3373707") + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + ApiFuture future = + complianceClient.listLocationsPagedCallable().futureCall(request); + // Do something. + for (Location element : future.get().iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END localhost7469_v1beta1_generated_Compliance_ListLocations_async] diff --git a/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/compliance/listlocations/AsyncListLocationsPaged.java b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/compliance/listlocations/AsyncListLocationsPaged.java new file mode 100644 index 0000000000..93d5d42725 --- /dev/null +++ b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/compliance/listlocations/AsyncListLocationsPaged.java @@ -0,0 +1,61 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.samples; + +// [START localhost7469_v1beta1_generated_Compliance_ListLocations_Paged_async] +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.common.base.Strings; +import com.google.showcase.v1beta1.ComplianceClient; + +public class AsyncListLocationsPaged { + + public static void main(String[] args) throws Exception { + asyncListLocationsPaged(); + } + + public static void asyncListLocationsPaged() 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 (ComplianceClient complianceClient = ComplianceClient.create()) { + ListLocationsRequest request = + ListLocationsRequest.newBuilder() + .setName("name3373707") + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + while (true) { + ListLocationsResponse response = complianceClient.listLocationsCallable().call(request); + for (Location element : response.getLocationsList()) { + // doThingsWith(element); + } + String nextPageToken = response.getNextPageToken(); + if (!Strings.isNullOrEmpty(nextPageToken)) { + request = request.toBuilder().setPageToken(nextPageToken).build(); + } else { + break; + } + } + } + } +} +// [END localhost7469_v1beta1_generated_Compliance_ListLocations_Paged_async] diff --git a/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/compliance/listlocations/SyncListLocations.java b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/compliance/listlocations/SyncListLocations.java new file mode 100644 index 0000000000..98f749bf2c --- /dev/null +++ b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/compliance/listlocations/SyncListLocations.java @@ -0,0 +1,50 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.samples; + +// [START localhost7469_v1beta1_generated_Compliance_ListLocations_sync] +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.Location; +import com.google.showcase.v1beta1.ComplianceClient; + +public class SyncListLocations { + + public static void main(String[] args) throws Exception { + syncListLocations(); + } + + public static void syncListLocations() 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 (ComplianceClient complianceClient = ComplianceClient.create()) { + ListLocationsRequest request = + ListLocationsRequest.newBuilder() + .setName("name3373707") + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + for (Location element : complianceClient.listLocations(request).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END localhost7469_v1beta1_generated_Compliance_ListLocations_sync] diff --git a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/compliance/repeatdatabody/AsyncRepeatDataBody.java b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/compliance/repeatdatabody/AsyncRepeatDataBody.java similarity index 98% rename from showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/compliance/repeatdatabody/AsyncRepeatDataBody.java rename to java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/compliance/repeatdatabody/AsyncRepeatDataBody.java index 02379d2e01..4dc4b10387 100644 --- a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/compliance/repeatdatabody/AsyncRepeatDataBody.java +++ b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/compliance/repeatdatabody/AsyncRepeatDataBody.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/compliance/repeatdatabody/SyncRepeatDataBody.java b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/compliance/repeatdatabody/SyncRepeatDataBody.java new file mode 100644 index 0000000000..8557ef7f07 --- /dev/null +++ b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/compliance/repeatdatabody/SyncRepeatDataBody.java @@ -0,0 +1,55 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.samples; + +// [START localhost7469_v1beta1_generated_Compliance_RepeatDataBody_sync] +import com.google.showcase.v1beta1.ComplianceClient; +import com.google.showcase.v1beta1.ComplianceData; +import com.google.showcase.v1beta1.RepeatRequest; +import com.google.showcase.v1beta1.RepeatResponse; + +public class SyncRepeatDataBody { + + public static void main(String[] args) throws Exception { + syncRepeatDataBody(); + } + + public static void syncRepeatDataBody() 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 (ComplianceClient complianceClient = ComplianceClient.create()) { + RepeatRequest request = + RepeatRequest.newBuilder() + .setName("name3373707") + .setInfo(ComplianceData.newBuilder().build()) + .setServerVerify(true) + .setIntendedBindingUri("intendedBindingUri780142386") + .setFInt32(-1143775883) + .setFInt64(-1143775788) + .setFDouble(-1239459382) + .setPInt32(-858673665) + .setPInt64(-858673570) + .setPDouble(-991225216) + .build(); + RepeatResponse response = complianceClient.repeatDataBody(request); + } + } +} +// [END localhost7469_v1beta1_generated_Compliance_RepeatDataBody_sync] diff --git a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/compliance/repeatdatabodyinfo/AsyncRepeatDataBodyInfo.java b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/compliance/repeatdatabodyinfo/AsyncRepeatDataBodyInfo.java similarity index 98% rename from showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/compliance/repeatdatabodyinfo/AsyncRepeatDataBodyInfo.java rename to java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/compliance/repeatdatabodyinfo/AsyncRepeatDataBodyInfo.java index 80138be72f..e45cfc6210 100644 --- a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/compliance/repeatdatabodyinfo/AsyncRepeatDataBodyInfo.java +++ b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/compliance/repeatdatabodyinfo/AsyncRepeatDataBodyInfo.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/compliance/repeatdatabodyinfo/SyncRepeatDataBodyInfo.java b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/compliance/repeatdatabodyinfo/SyncRepeatDataBodyInfo.java similarity index 98% rename from showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/compliance/repeatdatabodyinfo/SyncRepeatDataBodyInfo.java rename to java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/compliance/repeatdatabodyinfo/SyncRepeatDataBodyInfo.java index c3b00bd27e..07dc61a7a5 100644 --- a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/compliance/repeatdatabodyinfo/SyncRepeatDataBodyInfo.java +++ b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/compliance/repeatdatabodyinfo/SyncRepeatDataBodyInfo.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/compliance/repeatdatabodypatch/AsyncRepeatDataBodyPatch.java b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/compliance/repeatdatabodypatch/AsyncRepeatDataBodyPatch.java similarity index 98% rename from showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/compliance/repeatdatabodypatch/AsyncRepeatDataBodyPatch.java rename to java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/compliance/repeatdatabodypatch/AsyncRepeatDataBodyPatch.java index d62dcd97b9..26d68e7c54 100644 --- a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/compliance/repeatdatabodypatch/AsyncRepeatDataBodyPatch.java +++ b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/compliance/repeatdatabodypatch/AsyncRepeatDataBodyPatch.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/compliance/repeatdatabodypatch/SyncRepeatDataBodyPatch.java b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/compliance/repeatdatabodypatch/SyncRepeatDataBodyPatch.java similarity index 98% rename from showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/compliance/repeatdatabodypatch/SyncRepeatDataBodyPatch.java rename to java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/compliance/repeatdatabodypatch/SyncRepeatDataBodyPatch.java index 1e53216e8d..9649269da5 100644 --- a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/compliance/repeatdatabodypatch/SyncRepeatDataBodyPatch.java +++ b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/compliance/repeatdatabodypatch/SyncRepeatDataBodyPatch.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/compliance/repeatdatabodyput/AsyncRepeatDataBodyPut.java b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/compliance/repeatdatabodyput/AsyncRepeatDataBodyPut.java similarity index 98% rename from showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/compliance/repeatdatabodyput/AsyncRepeatDataBodyPut.java rename to java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/compliance/repeatdatabodyput/AsyncRepeatDataBodyPut.java index 61fb607032..134cd1a0d7 100644 --- a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/compliance/repeatdatabodyput/AsyncRepeatDataBodyPut.java +++ b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/compliance/repeatdatabodyput/AsyncRepeatDataBodyPut.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/compliance/repeatdatabodyput/SyncRepeatDataBodyPut.java b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/compliance/repeatdatabodyput/SyncRepeatDataBodyPut.java similarity index 98% rename from showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/compliance/repeatdatabodyput/SyncRepeatDataBodyPut.java rename to java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/compliance/repeatdatabodyput/SyncRepeatDataBodyPut.java index 4f4d65a084..fc20fc9a12 100644 --- a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/compliance/repeatdatabodyput/SyncRepeatDataBodyPut.java +++ b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/compliance/repeatdatabodyput/SyncRepeatDataBodyPut.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/compliance/repeatdatapathresource/AsyncRepeatDataPathResource.java b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/compliance/repeatdatapathresource/AsyncRepeatDataPathResource.java similarity index 98% rename from showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/compliance/repeatdatapathresource/AsyncRepeatDataPathResource.java rename to java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/compliance/repeatdatapathresource/AsyncRepeatDataPathResource.java index 020978c742..8a9ca84d2d 100644 --- a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/compliance/repeatdatapathresource/AsyncRepeatDataPathResource.java +++ b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/compliance/repeatdatapathresource/AsyncRepeatDataPathResource.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/compliance/repeatdatapathresource/SyncRepeatDataPathResource.java b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/compliance/repeatdatapathresource/SyncRepeatDataPathResource.java similarity index 98% rename from showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/compliance/repeatdatapathresource/SyncRepeatDataPathResource.java rename to java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/compliance/repeatdatapathresource/SyncRepeatDataPathResource.java index 3a0e60981f..f547b7dfed 100644 --- a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/compliance/repeatdatapathresource/SyncRepeatDataPathResource.java +++ b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/compliance/repeatdatapathresource/SyncRepeatDataPathResource.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/compliance/repeatdatapathtrailingresource/AsyncRepeatDataPathTrailingResource.java b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/compliance/repeatdatapathtrailingresource/AsyncRepeatDataPathTrailingResource.java similarity index 98% rename from showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/compliance/repeatdatapathtrailingresource/AsyncRepeatDataPathTrailingResource.java rename to java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/compliance/repeatdatapathtrailingresource/AsyncRepeatDataPathTrailingResource.java index 1c3b305371..1536d74927 100644 --- a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/compliance/repeatdatapathtrailingresource/AsyncRepeatDataPathTrailingResource.java +++ b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/compliance/repeatdatapathtrailingresource/AsyncRepeatDataPathTrailingResource.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/compliance/repeatdatapathtrailingresource/SyncRepeatDataPathTrailingResource.java b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/compliance/repeatdatapathtrailingresource/SyncRepeatDataPathTrailingResource.java similarity index 98% rename from showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/compliance/repeatdatapathtrailingresource/SyncRepeatDataPathTrailingResource.java rename to java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/compliance/repeatdatapathtrailingresource/SyncRepeatDataPathTrailingResource.java index 73883a1773..1601748f06 100644 --- a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/compliance/repeatdatapathtrailingresource/SyncRepeatDataPathTrailingResource.java +++ b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/compliance/repeatdatapathtrailingresource/SyncRepeatDataPathTrailingResource.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/compliance/repeatdataquery/AsyncRepeatDataQuery.java b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/compliance/repeatdataquery/AsyncRepeatDataQuery.java similarity index 98% rename from showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/compliance/repeatdataquery/AsyncRepeatDataQuery.java rename to java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/compliance/repeatdataquery/AsyncRepeatDataQuery.java index c174e28a01..2394a20b3c 100644 --- a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/compliance/repeatdataquery/AsyncRepeatDataQuery.java +++ b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/compliance/repeatdataquery/AsyncRepeatDataQuery.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/compliance/repeatdataquery/SyncRepeatDataQuery.java b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/compliance/repeatdataquery/SyncRepeatDataQuery.java similarity index 98% rename from showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/compliance/repeatdataquery/SyncRepeatDataQuery.java rename to java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/compliance/repeatdataquery/SyncRepeatDataQuery.java index 2f4dd67b42..0298e62a8e 100644 --- a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/compliance/repeatdataquery/SyncRepeatDataQuery.java +++ b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/compliance/repeatdataquery/SyncRepeatDataQuery.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/compliance/repeatdatasimplepath/AsyncRepeatDataSimplePath.java b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/compliance/repeatdatasimplepath/AsyncRepeatDataSimplePath.java similarity index 98% rename from showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/compliance/repeatdatasimplepath/AsyncRepeatDataSimplePath.java rename to java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/compliance/repeatdatasimplepath/AsyncRepeatDataSimplePath.java index ff20f79853..9d301f7c57 100644 --- a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/compliance/repeatdatasimplepath/AsyncRepeatDataSimplePath.java +++ b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/compliance/repeatdatasimplepath/AsyncRepeatDataSimplePath.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/compliance/repeatdatasimplepath/SyncRepeatDataSimplePath.java b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/compliance/repeatdatasimplepath/SyncRepeatDataSimplePath.java similarity index 98% rename from showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/compliance/repeatdatasimplepath/SyncRepeatDataSimplePath.java rename to java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/compliance/repeatdatasimplepath/SyncRepeatDataSimplePath.java index 4cec930750..2188905c9c 100644 --- a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/compliance/repeatdatasimplepath/SyncRepeatDataSimplePath.java +++ b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/compliance/repeatdatasimplepath/SyncRepeatDataSimplePath.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/compliance/setiampolicy/AsyncSetIamPolicy.java b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/compliance/setiampolicy/AsyncSetIamPolicy.java new file mode 100644 index 0000000000..7debb0fe48 --- /dev/null +++ b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/compliance/setiampolicy/AsyncSetIamPolicy.java @@ -0,0 +1,52 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.samples; + +// [START localhost7469_v1beta1_generated_Compliance_SetIamPolicy_async] +import com.google.api.core.ApiFuture; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.protobuf.FieldMask; +import com.google.showcase.v1beta1.BlurbName; +import com.google.showcase.v1beta1.ComplianceClient; + +public class AsyncSetIamPolicy { + + public static void main(String[] args) throws Exception { + asyncSetIamPolicy(); + } + + public static void asyncSetIamPolicy() 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 (ComplianceClient complianceClient = ComplianceClient.create()) { + SetIamPolicyRequest request = + SetIamPolicyRequest.newBuilder() + .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString()) + .setPolicy(Policy.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .build(); + ApiFuture future = complianceClient.setIamPolicyCallable().futureCall(request); + // Do something. + Policy response = future.get(); + } + } +} +// [END localhost7469_v1beta1_generated_Compliance_SetIamPolicy_async] diff --git a/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/compliance/setiampolicy/SyncSetIamPolicy.java b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/compliance/setiampolicy/SyncSetIamPolicy.java new file mode 100644 index 0000000000..86d075c770 --- /dev/null +++ b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/compliance/setiampolicy/SyncSetIamPolicy.java @@ -0,0 +1,49 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.samples; + +// [START localhost7469_v1beta1_generated_Compliance_SetIamPolicy_sync] +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.protobuf.FieldMask; +import com.google.showcase.v1beta1.BlurbName; +import com.google.showcase.v1beta1.ComplianceClient; + +public class SyncSetIamPolicy { + + public static void main(String[] args) throws Exception { + syncSetIamPolicy(); + } + + public static void syncSetIamPolicy() 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 (ComplianceClient complianceClient = ComplianceClient.create()) { + SetIamPolicyRequest request = + SetIamPolicyRequest.newBuilder() + .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString()) + .setPolicy(Policy.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .build(); + Policy response = complianceClient.setIamPolicy(request); + } + } +} +// [END localhost7469_v1beta1_generated_Compliance_SetIamPolicy_sync] diff --git a/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/compliance/testiampermissions/AsyncTestIamPermissions.java b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/compliance/testiampermissions/AsyncTestIamPermissions.java new file mode 100644 index 0000000000..dd3372fffe --- /dev/null +++ b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/compliance/testiampermissions/AsyncTestIamPermissions.java @@ -0,0 +1,52 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.samples; + +// [START localhost7469_v1beta1_generated_Compliance_TestIamPermissions_async] +import com.google.api.core.ApiFuture; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.showcase.v1beta1.BlurbName; +import com.google.showcase.v1beta1.ComplianceClient; +import java.util.ArrayList; + +public class AsyncTestIamPermissions { + + public static void main(String[] args) throws Exception { + asyncTestIamPermissions(); + } + + public static void asyncTestIamPermissions() 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 (ComplianceClient complianceClient = ComplianceClient.create()) { + TestIamPermissionsRequest request = + TestIamPermissionsRequest.newBuilder() + .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString()) + .addAllPermissions(new ArrayList()) + .build(); + ApiFuture future = + complianceClient.testIamPermissionsCallable().futureCall(request); + // Do something. + TestIamPermissionsResponse response = future.get(); + } + } +} +// [END localhost7469_v1beta1_generated_Compliance_TestIamPermissions_async] diff --git a/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/compliance/testiampermissions/SyncTestIamPermissions.java b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/compliance/testiampermissions/SyncTestIamPermissions.java new file mode 100644 index 0000000000..fbe3975a56 --- /dev/null +++ b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/compliance/testiampermissions/SyncTestIamPermissions.java @@ -0,0 +1,48 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.samples; + +// [START localhost7469_v1beta1_generated_Compliance_TestIamPermissions_sync] +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.showcase.v1beta1.BlurbName; +import com.google.showcase.v1beta1.ComplianceClient; +import java.util.ArrayList; + +public class SyncTestIamPermissions { + + public static void main(String[] args) throws Exception { + syncTestIamPermissions(); + } + + public static void syncTestIamPermissions() 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 (ComplianceClient complianceClient = ComplianceClient.create()) { + TestIamPermissionsRequest request = + TestIamPermissionsRequest.newBuilder() + .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString()) + .addAllPermissions(new ArrayList()) + .build(); + TestIamPermissionsResponse response = complianceClient.testIamPermissions(request); + } + } +} +// [END localhost7469_v1beta1_generated_Compliance_TestIamPermissions_sync] diff --git a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/compliance/verifyenum/AsyncVerifyEnum.java b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/compliance/verifyenum/AsyncVerifyEnum.java similarity index 98% rename from showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/compliance/verifyenum/AsyncVerifyEnum.java rename to java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/compliance/verifyenum/AsyncVerifyEnum.java index ceae5e5edc..a4a556d720 100644 --- a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/compliance/verifyenum/AsyncVerifyEnum.java +++ b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/compliance/verifyenum/AsyncVerifyEnum.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/compliance/verifyenum/SyncVerifyEnum.java b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/compliance/verifyenum/SyncVerifyEnum.java similarity index 98% rename from showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/compliance/verifyenum/SyncVerifyEnum.java rename to java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/compliance/verifyenum/SyncVerifyEnum.java index cf742f475d..089050b3ea 100644 --- a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/compliance/verifyenum/SyncVerifyEnum.java +++ b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/compliance/verifyenum/SyncVerifyEnum.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/compliancesettings/repeatdatabody/SyncRepeatDataBody.java b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/compliancesettings/repeatdatabody/SyncRepeatDataBody.java new file mode 100644 index 0000000000..9d2a4df131 --- /dev/null +++ b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/compliancesettings/repeatdatabody/SyncRepeatDataBody.java @@ -0,0 +1,55 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.samples; + +// [START localhost7469_v1beta1_generated_ComplianceSettings_RepeatDataBody_sync] +import com.google.showcase.v1beta1.ComplianceSettings; +import java.time.Duration; + +public class SyncRepeatDataBody { + + public static void main(String[] args) throws Exception { + syncRepeatDataBody(); + } + + public static void syncRepeatDataBody() 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 + ComplianceSettings.Builder complianceSettingsBuilder = ComplianceSettings.newBuilder(); + complianceSettingsBuilder + .repeatDataBodySettings() + .setRetrySettings( + complianceSettingsBuilder + .repeatDataBodySettings() + .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()); + ComplianceSettings complianceSettings = complianceSettingsBuilder.build(); + } +} +// [END localhost7469_v1beta1_generated_ComplianceSettings_RepeatDataBody_sync] diff --git a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/echo/block/AsyncBlock.java b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/echo/block/AsyncBlock.java similarity index 98% rename from showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/echo/block/AsyncBlock.java rename to java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/echo/block/AsyncBlock.java index 5d1e13ec6b..baf1e9b380 100644 --- a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/echo/block/AsyncBlock.java +++ b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/echo/block/AsyncBlock.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/echo/block/SyncBlock.java b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/echo/block/SyncBlock.java similarity index 98% rename from showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/echo/block/SyncBlock.java rename to java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/echo/block/SyncBlock.java index 33e753f91c..f006013625 100644 --- a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/echo/block/SyncBlock.java +++ b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/echo/block/SyncBlock.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/echo/chat/AsyncChat.java b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/echo/chat/AsyncChat.java similarity index 93% rename from showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/echo/chat/AsyncChat.java rename to java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/echo/chat/AsyncChat.java index fc7ae4a2fd..b452b8f620 100644 --- a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/echo/chat/AsyncChat.java +++ b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/echo/chat/AsyncChat.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -42,6 +42,8 @@ public static void asyncChat() throws Exception { .setSeverity(Severity.forNumber(0)) .setHeader("header-1221270899") .setOtherHeader("otherHeader-2026585667") + .setRequestId("requestId693933066") + .setOtherRequestId("otherRequestId1248995034") .build(); bidiStream.send(request); for (EchoResponse response : bidiStream) { diff --git a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/echo/collect/AsyncCollect.java b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/echo/collect/AsyncCollect.java similarity index 94% rename from showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/echo/collect/AsyncCollect.java rename to java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/echo/collect/AsyncCollect.java index faace6e726..2e2f76b713 100644 --- a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/echo/collect/AsyncCollect.java +++ b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/echo/collect/AsyncCollect.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -60,6 +60,8 @@ public void onCompleted() { .setSeverity(Severity.forNumber(0)) .setHeader("header-1221270899") .setOtherHeader("otherHeader-2026585667") + .setRequestId("requestId693933066") + .setOtherRequestId("otherRequestId1248995034") .build(); requestObserver.onNext(request); } diff --git a/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/echo/create/SyncCreateSetCredentialsProvider.java b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/echo/create/SyncCreateSetCredentialsProvider.java new file mode 100644 index 0000000000..0c6138a727 --- /dev/null +++ b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/echo/create/SyncCreateSetCredentialsProvider.java @@ -0,0 +1,44 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.samples; + +// [START localhost7469_v1beta1_generated_Echo_Create_SetCredentialsProvider_sync] +import com.google.api.gax.core.FixedCredentialsProvider; +import com.google.showcase.v1beta1.EchoClient; +import com.google.showcase.v1beta1.EchoSettings; +import com.google.showcase.v1beta1.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 + EchoSettings echoSettings = + EchoSettings.newBuilder() + .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials)) + .build(); + EchoClient echoClient = EchoClient.create(echoSettings); + } +} +// [END localhost7469_v1beta1_generated_Echo_Create_SetCredentialsProvider_sync] diff --git a/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/echo/create/SyncCreateSetEndpoint.java b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/echo/create/SyncCreateSetEndpoint.java new file mode 100644 index 0000000000..a02366b7fa --- /dev/null +++ b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/echo/create/SyncCreateSetEndpoint.java @@ -0,0 +1,40 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.samples; + +// [START localhost7469_v1beta1_generated_Echo_Create_SetEndpoint_sync] +import com.google.showcase.v1beta1.EchoClient; +import com.google.showcase.v1beta1.EchoSettings; +import com.google.showcase.v1beta1.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 + EchoSettings echoSettings = EchoSettings.newBuilder().setEndpoint(myEndpoint).build(); + EchoClient echoClient = EchoClient.create(echoSettings); + } +} +// [END localhost7469_v1beta1_generated_Echo_Create_SetEndpoint_sync] diff --git a/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/echo/create/SyncCreateUseHttpJsonTransport.java b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/echo/create/SyncCreateUseHttpJsonTransport.java new file mode 100644 index 0000000000..9493740fd9 --- /dev/null +++ b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/echo/create/SyncCreateUseHttpJsonTransport.java @@ -0,0 +1,39 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.samples; + +// [START localhost7469_v1beta1_generated_Echo_Create_UseHttpJsonTransport_sync] +import com.google.showcase.v1beta1.EchoClient; +import com.google.showcase.v1beta1.EchoSettings; + +public class SyncCreateUseHttpJsonTransport { + + public static void main(String[] args) throws Exception { + syncCreateUseHttpJsonTransport(); + } + + public static void syncCreateUseHttpJsonTransport() 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 + EchoSettings echoSettings = EchoSettings.newHttpJsonBuilder().build(); + EchoClient echoClient = EchoClient.create(echoSettings); + } +} +// [END localhost7469_v1beta1_generated_Echo_Create_UseHttpJsonTransport_sync] diff --git a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/echo/echo/AsyncEcho.java b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/echo/echo/AsyncEcho.java similarity index 93% rename from showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/echo/echo/AsyncEcho.java rename to java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/echo/echo/AsyncEcho.java index 705e8c273b..86b367df70 100644 --- a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/echo/echo/AsyncEcho.java +++ b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/echo/echo/AsyncEcho.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -41,6 +41,8 @@ public static void asyncEcho() throws Exception { .setSeverity(Severity.forNumber(0)) .setHeader("header-1221270899") .setOtherHeader("otherHeader-2026585667") + .setRequestId("requestId693933066") + .setOtherRequestId("otherRequestId1248995034") .build(); ApiFuture future = echoClient.echoCallable().futureCall(request); // Do something. diff --git a/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/echo/echo/SyncEcho.java b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/echo/echo/SyncEcho.java new file mode 100644 index 0000000000..010f6f44b6 --- /dev/null +++ b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/echo/echo/SyncEcho.java @@ -0,0 +1,50 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.samples; + +// [START localhost7469_v1beta1_generated_Echo_Echo_sync] +import com.google.showcase.v1beta1.EchoClient; +import com.google.showcase.v1beta1.EchoRequest; +import com.google.showcase.v1beta1.EchoResponse; +import com.google.showcase.v1beta1.Severity; + +public class SyncEcho { + + public static void main(String[] args) throws Exception { + syncEcho(); + } + + public static void syncEcho() 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 (EchoClient echoClient = EchoClient.create()) { + EchoRequest request = + EchoRequest.newBuilder() + .setSeverity(Severity.forNumber(0)) + .setHeader("header-1221270899") + .setOtherHeader("otherHeader-2026585667") + .setRequestId("requestId693933066") + .setOtherRequestId("otherRequestId1248995034") + .build(); + EchoResponse response = echoClient.echo(request); + } + } +} +// [END localhost7469_v1beta1_generated_Echo_Echo_sync] diff --git a/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/echo/echoerrordetails/AsyncEchoErrorDetails.java b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/echo/echoerrordetails/AsyncEchoErrorDetails.java new file mode 100644 index 0000000000..8754d6ad7a --- /dev/null +++ b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/echo/echoerrordetails/AsyncEchoErrorDetails.java @@ -0,0 +1,51 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.samples; + +// [START localhost7469_v1beta1_generated_Echo_EchoErrorDetails_async] +import com.google.api.core.ApiFuture; +import com.google.showcase.v1beta1.EchoClient; +import com.google.showcase.v1beta1.EchoErrorDetailsRequest; +import com.google.showcase.v1beta1.EchoErrorDetailsResponse; +import java.util.ArrayList; + +public class AsyncEchoErrorDetails { + + public static void main(String[] args) throws Exception { + asyncEchoErrorDetails(); + } + + public static void asyncEchoErrorDetails() 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 (EchoClient echoClient = EchoClient.create()) { + EchoErrorDetailsRequest request = + EchoErrorDetailsRequest.newBuilder() + .setSingleDetailText("singleDetailText1774380934") + .addAllMultiDetailText(new ArrayList()) + .build(); + ApiFuture future = + echoClient.echoErrorDetailsCallable().futureCall(request); + // Do something. + EchoErrorDetailsResponse response = future.get(); + } + } +} +// [END localhost7469_v1beta1_generated_Echo_EchoErrorDetails_async] diff --git a/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/echo/echoerrordetails/SyncEchoErrorDetails.java b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/echo/echoerrordetails/SyncEchoErrorDetails.java new file mode 100644 index 0000000000..b1ec731a00 --- /dev/null +++ b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/echo/echoerrordetails/SyncEchoErrorDetails.java @@ -0,0 +1,47 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.samples; + +// [START localhost7469_v1beta1_generated_Echo_EchoErrorDetails_sync] +import com.google.showcase.v1beta1.EchoClient; +import com.google.showcase.v1beta1.EchoErrorDetailsRequest; +import com.google.showcase.v1beta1.EchoErrorDetailsResponse; +import java.util.ArrayList; + +public class SyncEchoErrorDetails { + + public static void main(String[] args) throws Exception { + syncEchoErrorDetails(); + } + + public static void syncEchoErrorDetails() 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 (EchoClient echoClient = EchoClient.create()) { + EchoErrorDetailsRequest request = + EchoErrorDetailsRequest.newBuilder() + .setSingleDetailText("singleDetailText1774380934") + .addAllMultiDetailText(new ArrayList()) + .build(); + EchoErrorDetailsResponse response = echoClient.echoErrorDetails(request); + } + } +} +// [END localhost7469_v1beta1_generated_Echo_EchoErrorDetails_sync] diff --git a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/echo/expand/AsyncExpand.java b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/echo/expand/AsyncExpand.java similarity index 93% rename from showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/echo/expand/AsyncExpand.java rename to java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/echo/expand/AsyncExpand.java index 80c5f6d6b4..c503359770 100644 --- a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/echo/expand/AsyncExpand.java +++ b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/echo/expand/AsyncExpand.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -18,6 +18,7 @@ // [START localhost7469_v1beta1_generated_Echo_Expand_async] import com.google.api.gax.rpc.ServerStream; +import com.google.protobuf.Duration; import com.google.rpc.Status; import com.google.showcase.v1beta1.EchoClient; import com.google.showcase.v1beta1.EchoResponse; @@ -40,6 +41,7 @@ public static void asyncExpand() throws Exception { ExpandRequest.newBuilder() .setContent("content951530617") .setError(Status.newBuilder().build()) + .setStreamWaitTime(Duration.newBuilder().build()) .build(); ServerStream stream = echoClient.expandCallable().call(request); for (EchoResponse response : stream) { diff --git a/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/echo/failechowithdetails/AsyncFailEchoWithDetails.java b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/echo/failechowithdetails/AsyncFailEchoWithDetails.java new file mode 100644 index 0000000000..9195aa2e26 --- /dev/null +++ b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/echo/failechowithdetails/AsyncFailEchoWithDetails.java @@ -0,0 +1,47 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.samples; + +// [START localhost7469_v1beta1_generated_Echo_FailEchoWithDetails_async] +import com.google.api.core.ApiFuture; +import com.google.showcase.v1beta1.EchoClient; +import com.google.showcase.v1beta1.FailEchoWithDetailsRequest; +import com.google.showcase.v1beta1.FailEchoWithDetailsResponse; + +public class AsyncFailEchoWithDetails { + + public static void main(String[] args) throws Exception { + asyncFailEchoWithDetails(); + } + + public static void asyncFailEchoWithDetails() 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 (EchoClient echoClient = EchoClient.create()) { + FailEchoWithDetailsRequest request = + FailEchoWithDetailsRequest.newBuilder().setMessage("message954925063").build(); + ApiFuture future = + echoClient.failEchoWithDetailsCallable().futureCall(request); + // Do something. + FailEchoWithDetailsResponse response = future.get(); + } + } +} +// [END localhost7469_v1beta1_generated_Echo_FailEchoWithDetails_async] diff --git a/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/echo/failechowithdetails/SyncFailEchoWithDetails.java b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/echo/failechowithdetails/SyncFailEchoWithDetails.java new file mode 100644 index 0000000000..73af92d5c2 --- /dev/null +++ b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/echo/failechowithdetails/SyncFailEchoWithDetails.java @@ -0,0 +1,43 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.samples; + +// [START localhost7469_v1beta1_generated_Echo_FailEchoWithDetails_sync] +import com.google.showcase.v1beta1.EchoClient; +import com.google.showcase.v1beta1.FailEchoWithDetailsRequest; +import com.google.showcase.v1beta1.FailEchoWithDetailsResponse; + +public class SyncFailEchoWithDetails { + + public static void main(String[] args) throws Exception { + syncFailEchoWithDetails(); + } + + public static void syncFailEchoWithDetails() 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 (EchoClient echoClient = EchoClient.create()) { + FailEchoWithDetailsRequest request = + FailEchoWithDetailsRequest.newBuilder().setMessage("message954925063").build(); + FailEchoWithDetailsResponse response = echoClient.failEchoWithDetails(request); + } + } +} +// [END localhost7469_v1beta1_generated_Echo_FailEchoWithDetails_sync] diff --git a/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/echo/getiampolicy/AsyncGetIamPolicy.java b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/echo/getiampolicy/AsyncGetIamPolicy.java new file mode 100644 index 0000000000..b67f84be7f --- /dev/null +++ b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/echo/getiampolicy/AsyncGetIamPolicy.java @@ -0,0 +1,51 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.samples; + +// [START localhost7469_v1beta1_generated_Echo_GetIamPolicy_async] +import com.google.api.core.ApiFuture; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.GetPolicyOptions; +import com.google.iam.v1.Policy; +import com.google.showcase.v1beta1.BlurbName; +import com.google.showcase.v1beta1.EchoClient; + +public class AsyncGetIamPolicy { + + public static void main(String[] args) throws Exception { + asyncGetIamPolicy(); + } + + public static void asyncGetIamPolicy() 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 (EchoClient echoClient = EchoClient.create()) { + GetIamPolicyRequest request = + GetIamPolicyRequest.newBuilder() + .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString()) + .setOptions(GetPolicyOptions.newBuilder().build()) + .build(); + ApiFuture future = echoClient.getIamPolicyCallable().futureCall(request); + // Do something. + Policy response = future.get(); + } + } +} +// [END localhost7469_v1beta1_generated_Echo_GetIamPolicy_async] diff --git a/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/echo/getiampolicy/SyncGetIamPolicy.java b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/echo/getiampolicy/SyncGetIamPolicy.java new file mode 100644 index 0000000000..1f9af20f39 --- /dev/null +++ b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/echo/getiampolicy/SyncGetIamPolicy.java @@ -0,0 +1,48 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.samples; + +// [START localhost7469_v1beta1_generated_Echo_GetIamPolicy_sync] +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.GetPolicyOptions; +import com.google.iam.v1.Policy; +import com.google.showcase.v1beta1.BlurbName; +import com.google.showcase.v1beta1.EchoClient; + +public class SyncGetIamPolicy { + + public static void main(String[] args) throws Exception { + syncGetIamPolicy(); + } + + public static void syncGetIamPolicy() 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 (EchoClient echoClient = EchoClient.create()) { + GetIamPolicyRequest request = + GetIamPolicyRequest.newBuilder() + .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString()) + .setOptions(GetPolicyOptions.newBuilder().build()) + .build(); + Policy response = echoClient.getIamPolicy(request); + } + } +} +// [END localhost7469_v1beta1_generated_Echo_GetIamPolicy_sync] diff --git a/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/echo/getlocation/AsyncGetLocation.java b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/echo/getlocation/AsyncGetLocation.java new file mode 100644 index 0000000000..b63045fd37 --- /dev/null +++ b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/echo/getlocation/AsyncGetLocation.java @@ -0,0 +1,45 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.samples; + +// [START localhost7469_v1beta1_generated_Echo_GetLocation_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.Location; +import com.google.showcase.v1beta1.EchoClient; + +public class AsyncGetLocation { + + public static void main(String[] args) throws Exception { + asyncGetLocation(); + } + + public static void asyncGetLocation() 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 (EchoClient echoClient = EchoClient.create()) { + GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build(); + ApiFuture future = echoClient.getLocationCallable().futureCall(request); + // Do something. + Location response = future.get(); + } + } +} +// [END localhost7469_v1beta1_generated_Echo_GetLocation_async] diff --git a/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/echo/getlocation/SyncGetLocation.java b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/echo/getlocation/SyncGetLocation.java new file mode 100644 index 0000000000..1a22ba1dab --- /dev/null +++ b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/echo/getlocation/SyncGetLocation.java @@ -0,0 +1,42 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.samples; + +// [START localhost7469_v1beta1_generated_Echo_GetLocation_sync] +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.Location; +import com.google.showcase.v1beta1.EchoClient; + +public class SyncGetLocation { + + public static void main(String[] args) throws Exception { + syncGetLocation(); + } + + public static void syncGetLocation() 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 (EchoClient echoClient = EchoClient.create()) { + GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build(); + Location response = echoClient.getLocation(request); + } + } +} +// [END localhost7469_v1beta1_generated_Echo_GetLocation_sync] diff --git a/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/echo/listlocations/AsyncListLocations.java b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/echo/listlocations/AsyncListLocations.java new file mode 100644 index 0000000000..6909e62e52 --- /dev/null +++ b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/echo/listlocations/AsyncListLocations.java @@ -0,0 +1,53 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.samples; + +// [START localhost7469_v1beta1_generated_Echo_ListLocations_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.Location; +import com.google.showcase.v1beta1.EchoClient; + +public class AsyncListLocations { + + public static void main(String[] args) throws Exception { + asyncListLocations(); + } + + public static void asyncListLocations() 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 (EchoClient echoClient = EchoClient.create()) { + ListLocationsRequest request = + ListLocationsRequest.newBuilder() + .setName("name3373707") + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + ApiFuture future = echoClient.listLocationsPagedCallable().futureCall(request); + // Do something. + for (Location element : future.get().iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END localhost7469_v1beta1_generated_Echo_ListLocations_async] diff --git a/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/echo/listlocations/AsyncListLocationsPaged.java b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/echo/listlocations/AsyncListLocationsPaged.java new file mode 100644 index 0000000000..1c668dd68c --- /dev/null +++ b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/echo/listlocations/AsyncListLocationsPaged.java @@ -0,0 +1,61 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.samples; + +// [START localhost7469_v1beta1_generated_Echo_ListLocations_Paged_async] +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.common.base.Strings; +import com.google.showcase.v1beta1.EchoClient; + +public class AsyncListLocationsPaged { + + public static void main(String[] args) throws Exception { + asyncListLocationsPaged(); + } + + public static void asyncListLocationsPaged() 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 (EchoClient echoClient = EchoClient.create()) { + ListLocationsRequest request = + ListLocationsRequest.newBuilder() + .setName("name3373707") + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + while (true) { + ListLocationsResponse response = echoClient.listLocationsCallable().call(request); + for (Location element : response.getLocationsList()) { + // doThingsWith(element); + } + String nextPageToken = response.getNextPageToken(); + if (!Strings.isNullOrEmpty(nextPageToken)) { + request = request.toBuilder().setPageToken(nextPageToken).build(); + } else { + break; + } + } + } + } +} +// [END localhost7469_v1beta1_generated_Echo_ListLocations_Paged_async] diff --git a/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/echo/listlocations/SyncListLocations.java b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/echo/listlocations/SyncListLocations.java new file mode 100644 index 0000000000..197f4a76b4 --- /dev/null +++ b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/echo/listlocations/SyncListLocations.java @@ -0,0 +1,50 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.samples; + +// [START localhost7469_v1beta1_generated_Echo_ListLocations_sync] +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.Location; +import com.google.showcase.v1beta1.EchoClient; + +public class SyncListLocations { + + public static void main(String[] args) throws Exception { + syncListLocations(); + } + + public static void syncListLocations() 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 (EchoClient echoClient = EchoClient.create()) { + ListLocationsRequest request = + ListLocationsRequest.newBuilder() + .setName("name3373707") + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + for (Location element : echoClient.listLocations(request).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END localhost7469_v1beta1_generated_Echo_ListLocations_sync] diff --git a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/echo/pagedexpand/AsyncPagedExpand.java b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/echo/pagedexpand/AsyncPagedExpand.java similarity index 98% rename from showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/echo/pagedexpand/AsyncPagedExpand.java rename to java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/echo/pagedexpand/AsyncPagedExpand.java index 46257d1453..ded7b0b72e 100644 --- a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/echo/pagedexpand/AsyncPagedExpand.java +++ b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/echo/pagedexpand/AsyncPagedExpand.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/echo/pagedexpand/AsyncPagedExpandPaged.java b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/echo/pagedexpand/AsyncPagedExpandPaged.java similarity index 98% rename from showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/echo/pagedexpand/AsyncPagedExpandPaged.java rename to java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/echo/pagedexpand/AsyncPagedExpandPaged.java index 28a19a69af..6cc31accfc 100644 --- a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/echo/pagedexpand/AsyncPagedExpandPaged.java +++ b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/echo/pagedexpand/AsyncPagedExpandPaged.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/echo/pagedexpand/SyncPagedExpand.java b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/echo/pagedexpand/SyncPagedExpand.java similarity index 98% rename from showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/echo/pagedexpand/SyncPagedExpand.java rename to java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/echo/pagedexpand/SyncPagedExpand.java index c9c1a85279..20647f5e52 100644 --- a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/echo/pagedexpand/SyncPagedExpand.java +++ b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/echo/pagedexpand/SyncPagedExpand.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/echo/pagedexpandlegacy/AsyncPagedExpandLegacy.java b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/echo/pagedexpandlegacy/AsyncPagedExpandLegacy.java similarity index 98% rename from showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/echo/pagedexpandlegacy/AsyncPagedExpandLegacy.java rename to java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/echo/pagedexpandlegacy/AsyncPagedExpandLegacy.java index 624e4caec1..d294afd5e1 100644 --- a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/echo/pagedexpandlegacy/AsyncPagedExpandLegacy.java +++ b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/echo/pagedexpandlegacy/AsyncPagedExpandLegacy.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/echo/pagedexpandlegacy/SyncPagedExpandLegacy.java b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/echo/pagedexpandlegacy/SyncPagedExpandLegacy.java similarity index 98% rename from showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/echo/pagedexpandlegacy/SyncPagedExpandLegacy.java rename to java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/echo/pagedexpandlegacy/SyncPagedExpandLegacy.java index c82b7bbae7..518bc81c3b 100644 --- a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/echo/pagedexpandlegacy/SyncPagedExpandLegacy.java +++ b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/echo/pagedexpandlegacy/SyncPagedExpandLegacy.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/echo/pagedexpandlegacymapped/AsyncPagedExpandLegacyMapped.java b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/echo/pagedexpandlegacymapped/AsyncPagedExpandLegacyMapped.java similarity index 98% rename from showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/echo/pagedexpandlegacymapped/AsyncPagedExpandLegacyMapped.java rename to java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/echo/pagedexpandlegacymapped/AsyncPagedExpandLegacyMapped.java index be038a2fb5..f10d124bcd 100644 --- a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/echo/pagedexpandlegacymapped/AsyncPagedExpandLegacyMapped.java +++ b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/echo/pagedexpandlegacymapped/AsyncPagedExpandLegacyMapped.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/echo/pagedexpandlegacymapped/AsyncPagedExpandLegacyMappedPaged.java b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/echo/pagedexpandlegacymapped/AsyncPagedExpandLegacyMappedPaged.java similarity index 98% rename from showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/echo/pagedexpandlegacymapped/AsyncPagedExpandLegacyMappedPaged.java rename to java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/echo/pagedexpandlegacymapped/AsyncPagedExpandLegacyMappedPaged.java index 538a3247e8..ceb1bf8c43 100644 --- a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/echo/pagedexpandlegacymapped/AsyncPagedExpandLegacyMappedPaged.java +++ b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/echo/pagedexpandlegacymapped/AsyncPagedExpandLegacyMappedPaged.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/echo/pagedexpandlegacymapped/SyncPagedExpandLegacyMapped.java b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/echo/pagedexpandlegacymapped/SyncPagedExpandLegacyMapped.java similarity index 98% rename from showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/echo/pagedexpandlegacymapped/SyncPagedExpandLegacyMapped.java rename to java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/echo/pagedexpandlegacymapped/SyncPagedExpandLegacyMapped.java index 2b644c8837..3643ff2900 100644 --- a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/echo/pagedexpandlegacymapped/SyncPagedExpandLegacyMapped.java +++ b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/echo/pagedexpandlegacymapped/SyncPagedExpandLegacyMapped.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/echo/setiampolicy/AsyncSetIamPolicy.java b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/echo/setiampolicy/AsyncSetIamPolicy.java new file mode 100644 index 0000000000..d54772d33e --- /dev/null +++ b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/echo/setiampolicy/AsyncSetIamPolicy.java @@ -0,0 +1,52 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.samples; + +// [START localhost7469_v1beta1_generated_Echo_SetIamPolicy_async] +import com.google.api.core.ApiFuture; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.protobuf.FieldMask; +import com.google.showcase.v1beta1.BlurbName; +import com.google.showcase.v1beta1.EchoClient; + +public class AsyncSetIamPolicy { + + public static void main(String[] args) throws Exception { + asyncSetIamPolicy(); + } + + public static void asyncSetIamPolicy() 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 (EchoClient echoClient = EchoClient.create()) { + SetIamPolicyRequest request = + SetIamPolicyRequest.newBuilder() + .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString()) + .setPolicy(Policy.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .build(); + ApiFuture future = echoClient.setIamPolicyCallable().futureCall(request); + // Do something. + Policy response = future.get(); + } + } +} +// [END localhost7469_v1beta1_generated_Echo_SetIamPolicy_async] diff --git a/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/echo/setiampolicy/SyncSetIamPolicy.java b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/echo/setiampolicy/SyncSetIamPolicy.java new file mode 100644 index 0000000000..63c49a074e --- /dev/null +++ b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/echo/setiampolicy/SyncSetIamPolicy.java @@ -0,0 +1,49 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.samples; + +// [START localhost7469_v1beta1_generated_Echo_SetIamPolicy_sync] +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.protobuf.FieldMask; +import com.google.showcase.v1beta1.BlurbName; +import com.google.showcase.v1beta1.EchoClient; + +public class SyncSetIamPolicy { + + public static void main(String[] args) throws Exception { + syncSetIamPolicy(); + } + + public static void syncSetIamPolicy() 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 (EchoClient echoClient = EchoClient.create()) { + SetIamPolicyRequest request = + SetIamPolicyRequest.newBuilder() + .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString()) + .setPolicy(Policy.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .build(); + Policy response = echoClient.setIamPolicy(request); + } + } +} +// [END localhost7469_v1beta1_generated_Echo_SetIamPolicy_sync] diff --git a/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/echo/testiampermissions/AsyncTestIamPermissions.java b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/echo/testiampermissions/AsyncTestIamPermissions.java new file mode 100644 index 0000000000..8bfca4f72b --- /dev/null +++ b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/echo/testiampermissions/AsyncTestIamPermissions.java @@ -0,0 +1,52 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.samples; + +// [START localhost7469_v1beta1_generated_Echo_TestIamPermissions_async] +import com.google.api.core.ApiFuture; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.showcase.v1beta1.BlurbName; +import com.google.showcase.v1beta1.EchoClient; +import java.util.ArrayList; + +public class AsyncTestIamPermissions { + + public static void main(String[] args) throws Exception { + asyncTestIamPermissions(); + } + + public static void asyncTestIamPermissions() 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 (EchoClient echoClient = EchoClient.create()) { + TestIamPermissionsRequest request = + TestIamPermissionsRequest.newBuilder() + .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString()) + .addAllPermissions(new ArrayList()) + .build(); + ApiFuture future = + echoClient.testIamPermissionsCallable().futureCall(request); + // Do something. + TestIamPermissionsResponse response = future.get(); + } + } +} +// [END localhost7469_v1beta1_generated_Echo_TestIamPermissions_async] diff --git a/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/echo/testiampermissions/SyncTestIamPermissions.java b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/echo/testiampermissions/SyncTestIamPermissions.java new file mode 100644 index 0000000000..35d8eaada0 --- /dev/null +++ b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/echo/testiampermissions/SyncTestIamPermissions.java @@ -0,0 +1,48 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.samples; + +// [START localhost7469_v1beta1_generated_Echo_TestIamPermissions_sync] +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.showcase.v1beta1.BlurbName; +import com.google.showcase.v1beta1.EchoClient; +import java.util.ArrayList; + +public class SyncTestIamPermissions { + + public static void main(String[] args) throws Exception { + syncTestIamPermissions(); + } + + public static void syncTestIamPermissions() 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 (EchoClient echoClient = EchoClient.create()) { + TestIamPermissionsRequest request = + TestIamPermissionsRequest.newBuilder() + .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString()) + .addAllPermissions(new ArrayList()) + .build(); + TestIamPermissionsResponse response = echoClient.testIamPermissions(request); + } + } +} +// [END localhost7469_v1beta1_generated_Echo_TestIamPermissions_sync] diff --git a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/echo/wait/AsyncWait.java b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/echo/wait/AsyncWait.java similarity index 98% rename from showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/echo/wait/AsyncWait.java rename to java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/echo/wait/AsyncWait.java index 4fe1f78ed2..ff99a2d3b6 100644 --- a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/echo/wait/AsyncWait.java +++ b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/echo/wait/AsyncWait.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/echo/wait/AsyncWaitLRO.java b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/echo/wait/AsyncWaitLRO.java similarity index 98% rename from showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/echo/wait/AsyncWaitLRO.java rename to java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/echo/wait/AsyncWaitLRO.java index 450ec96d94..d6b616ec78 100644 --- a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/echo/wait/AsyncWaitLRO.java +++ b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/echo/wait/AsyncWaitLRO.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/echo/wait/SyncWait.java b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/echo/wait/SyncWait.java new file mode 100644 index 0000000000..c1eb791ba0 --- /dev/null +++ b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/echo/wait/SyncWait.java @@ -0,0 +1,42 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.samples; + +// [START localhost7469_v1beta1_generated_Echo_Wait_sync] +import com.google.showcase.v1beta1.EchoClient; +import com.google.showcase.v1beta1.WaitRequest; +import com.google.showcase.v1beta1.WaitResponse; + +public class SyncWait { + + public static void main(String[] args) throws Exception { + syncWait(); + } + + public static void syncWait() 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 (EchoClient echoClient = EchoClient.create()) { + WaitRequest request = WaitRequest.newBuilder().build(); + WaitResponse response = echoClient.waitAsync(request).get(); + } + } +} +// [END localhost7469_v1beta1_generated_Echo_Wait_sync] diff --git a/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/echosettings/echo/SyncEcho.java b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/echosettings/echo/SyncEcho.java new file mode 100644 index 0000000000..40b5561b95 --- /dev/null +++ b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/echosettings/echo/SyncEcho.java @@ -0,0 +1,55 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.samples; + +// [START localhost7469_v1beta1_generated_EchoSettings_Echo_sync] +import com.google.showcase.v1beta1.EchoSettings; +import java.time.Duration; + +public class SyncEcho { + + public static void main(String[] args) throws Exception { + syncEcho(); + } + + public static void syncEcho() 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 + EchoSettings.Builder echoSettingsBuilder = EchoSettings.newBuilder(); + echoSettingsBuilder + .echoSettings() + .setRetrySettings( + echoSettingsBuilder + .echoSettings() + .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()); + EchoSettings echoSettings = echoSettingsBuilder.build(); + } +} +// [END localhost7469_v1beta1_generated_EchoSettings_Echo_sync] diff --git a/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/echosettings/wait/SyncWait.java b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/echosettings/wait/SyncWait.java new file mode 100644 index 0000000000..7703175d30 --- /dev/null +++ b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/echosettings/wait/SyncWait.java @@ -0,0 +1,53 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.samples; + +// [START localhost7469_v1beta1_generated_EchoSettings_Wait_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.showcase.v1beta1.EchoSettings; +import java.time.Duration; + +public class SyncWait { + + public static void main(String[] args) throws Exception { + syncWait(); + } + + public static void syncWait() 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 + EchoSettings.Builder echoSettingsBuilder = EchoSettings.newBuilder(); + TimedRetryAlgorithm timedRetryAlgorithm = + OperationalTimedPollAlgorithm.create( + RetrySettings.newBuilder() + .setInitialRetryDelayDuration(Duration.ofMillis(500)) + .setRetryDelayMultiplier(1.5) + .setMaxRetryDelayDuration(Duration.ofMillis(5000)) + .setTotalTimeoutDuration(Duration.ofHours(24)) + .build()); + echoSettingsBuilder + .createClusterOperationSettings() + .setPollingAlgorithm(timedRetryAlgorithm) + .build(); + } +} +// [END localhost7469_v1beta1_generated_EchoSettings_Wait_sync] diff --git a/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/identity/create/SyncCreateSetCredentialsProvider.java b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/identity/create/SyncCreateSetCredentialsProvider.java new file mode 100644 index 0000000000..c452972c0e --- /dev/null +++ b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/identity/create/SyncCreateSetCredentialsProvider.java @@ -0,0 +1,44 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.samples; + +// [START localhost7469_v1beta1_generated_Identity_Create_SetCredentialsProvider_sync] +import com.google.api.gax.core.FixedCredentialsProvider; +import com.google.showcase.v1beta1.IdentityClient; +import com.google.showcase.v1beta1.IdentitySettings; +import com.google.showcase.v1beta1.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 + IdentitySettings identitySettings = + IdentitySettings.newBuilder() + .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials)) + .build(); + IdentityClient identityClient = IdentityClient.create(identitySettings); + } +} +// [END localhost7469_v1beta1_generated_Identity_Create_SetCredentialsProvider_sync] diff --git a/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/identity/create/SyncCreateSetEndpoint.java b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/identity/create/SyncCreateSetEndpoint.java new file mode 100644 index 0000000000..b745574711 --- /dev/null +++ b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/identity/create/SyncCreateSetEndpoint.java @@ -0,0 +1,41 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.samples; + +// [START localhost7469_v1beta1_generated_Identity_Create_SetEndpoint_sync] +import com.google.showcase.v1beta1.IdentityClient; +import com.google.showcase.v1beta1.IdentitySettings; +import com.google.showcase.v1beta1.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 + IdentitySettings identitySettings = + IdentitySettings.newBuilder().setEndpoint(myEndpoint).build(); + IdentityClient identityClient = IdentityClient.create(identitySettings); + } +} +// [END localhost7469_v1beta1_generated_Identity_Create_SetEndpoint_sync] diff --git a/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/identity/create/SyncCreateUseHttpJsonTransport.java b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/identity/create/SyncCreateUseHttpJsonTransport.java new file mode 100644 index 0000000000..8ec3244163 --- /dev/null +++ b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/identity/create/SyncCreateUseHttpJsonTransport.java @@ -0,0 +1,39 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.samples; + +// [START localhost7469_v1beta1_generated_Identity_Create_UseHttpJsonTransport_sync] +import com.google.showcase.v1beta1.IdentityClient; +import com.google.showcase.v1beta1.IdentitySettings; + +public class SyncCreateUseHttpJsonTransport { + + public static void main(String[] args) throws Exception { + syncCreateUseHttpJsonTransport(); + } + + public static void syncCreateUseHttpJsonTransport() 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 + IdentitySettings identitySettings = IdentitySettings.newHttpJsonBuilder().build(); + IdentityClient identityClient = IdentityClient.create(identitySettings); + } +} +// [END localhost7469_v1beta1_generated_Identity_Create_UseHttpJsonTransport_sync] diff --git a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/identity/createuser/AsyncCreateUser.java b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/identity/createuser/AsyncCreateUser.java similarity index 98% rename from showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/identity/createuser/AsyncCreateUser.java rename to java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/identity/createuser/AsyncCreateUser.java index 6159e29f8b..1c490636d8 100644 --- a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/identity/createuser/AsyncCreateUser.java +++ b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/identity/createuser/AsyncCreateUser.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/identity/createuser/SyncCreateUser.java b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/identity/createuser/SyncCreateUser.java new file mode 100644 index 0000000000..fd25b29374 --- /dev/null +++ b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/identity/createuser/SyncCreateUser.java @@ -0,0 +1,43 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.samples; + +// [START localhost7469_v1beta1_generated_Identity_CreateUser_sync] +import com.google.showcase.v1beta1.CreateUserRequest; +import com.google.showcase.v1beta1.IdentityClient; +import com.google.showcase.v1beta1.User; + +public class SyncCreateUser { + + public static void main(String[] args) throws Exception { + syncCreateUser(); + } + + public static void syncCreateUser() 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 (IdentityClient identityClient = IdentityClient.create()) { + CreateUserRequest request = + CreateUserRequest.newBuilder().setUser(User.newBuilder().build()).build(); + User response = identityClient.createUser(request); + } + } +} +// [END localhost7469_v1beta1_generated_Identity_CreateUser_sync] diff --git a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/identity/createuser/SyncCreateUserStringString.java b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/identity/createuser/SyncCreateUserStringString.java similarity index 98% rename from showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/identity/createuser/SyncCreateUserStringString.java rename to java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/identity/createuser/SyncCreateUserStringString.java index 54552b0fae..165f997cd4 100644 --- a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/identity/createuser/SyncCreateUserStringString.java +++ b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/identity/createuser/SyncCreateUserStringString.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/identity/createuser/SyncCreateUserStringStringIntStringBooleanDouble.java b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/identity/createuser/SyncCreateUserStringStringIntStringBooleanDouble.java similarity index 98% rename from showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/identity/createuser/SyncCreateUserStringStringIntStringBooleanDouble.java rename to java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/identity/createuser/SyncCreateUserStringStringIntStringBooleanDouble.java index 61705d69f3..c0aa687f9f 100644 --- a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/identity/createuser/SyncCreateUserStringStringIntStringBooleanDouble.java +++ b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/identity/createuser/SyncCreateUserStringStringIntStringBooleanDouble.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/identity/deleteuser/AsyncDeleteUser.java b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/identity/deleteuser/AsyncDeleteUser.java similarity index 98% rename from showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/identity/deleteuser/AsyncDeleteUser.java rename to java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/identity/deleteuser/AsyncDeleteUser.java index 8d8de43b47..ce17012192 100644 --- a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/identity/deleteuser/AsyncDeleteUser.java +++ b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/identity/deleteuser/AsyncDeleteUser.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/identity/deleteuser/SyncDeleteUser.java b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/identity/deleteuser/SyncDeleteUser.java similarity index 98% rename from showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/identity/deleteuser/SyncDeleteUser.java rename to java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/identity/deleteuser/SyncDeleteUser.java index 9bdce522e9..6bb05582ed 100644 --- a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/identity/deleteuser/SyncDeleteUser.java +++ b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/identity/deleteuser/SyncDeleteUser.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/identity/deleteuser/SyncDeleteUserString.java b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/identity/deleteuser/SyncDeleteUserString.java similarity index 98% rename from showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/identity/deleteuser/SyncDeleteUserString.java rename to java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/identity/deleteuser/SyncDeleteUserString.java index bb894748d3..dbaf221d68 100644 --- a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/identity/deleteuser/SyncDeleteUserString.java +++ b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/identity/deleteuser/SyncDeleteUserString.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/identity/deleteuser/SyncDeleteUserUsername.java b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/identity/deleteuser/SyncDeleteUserUsername.java similarity index 98% rename from showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/identity/deleteuser/SyncDeleteUserUsername.java rename to java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/identity/deleteuser/SyncDeleteUserUsername.java index b61c33d83c..4c7492ce68 100644 --- a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/identity/deleteuser/SyncDeleteUserUsername.java +++ b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/identity/deleteuser/SyncDeleteUserUsername.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/identity/getiampolicy/AsyncGetIamPolicy.java b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/identity/getiampolicy/AsyncGetIamPolicy.java new file mode 100644 index 0000000000..545624def8 --- /dev/null +++ b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/identity/getiampolicy/AsyncGetIamPolicy.java @@ -0,0 +1,51 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.samples; + +// [START localhost7469_v1beta1_generated_Identity_GetIamPolicy_async] +import com.google.api.core.ApiFuture; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.GetPolicyOptions; +import com.google.iam.v1.Policy; +import com.google.showcase.v1beta1.BlurbName; +import com.google.showcase.v1beta1.IdentityClient; + +public class AsyncGetIamPolicy { + + public static void main(String[] args) throws Exception { + asyncGetIamPolicy(); + } + + public static void asyncGetIamPolicy() 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 (IdentityClient identityClient = IdentityClient.create()) { + GetIamPolicyRequest request = + GetIamPolicyRequest.newBuilder() + .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString()) + .setOptions(GetPolicyOptions.newBuilder().build()) + .build(); + ApiFuture future = identityClient.getIamPolicyCallable().futureCall(request); + // Do something. + Policy response = future.get(); + } + } +} +// [END localhost7469_v1beta1_generated_Identity_GetIamPolicy_async] diff --git a/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/identity/getiampolicy/SyncGetIamPolicy.java b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/identity/getiampolicy/SyncGetIamPolicy.java new file mode 100644 index 0000000000..deb273fc38 --- /dev/null +++ b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/identity/getiampolicy/SyncGetIamPolicy.java @@ -0,0 +1,48 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.samples; + +// [START localhost7469_v1beta1_generated_Identity_GetIamPolicy_sync] +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.GetPolicyOptions; +import com.google.iam.v1.Policy; +import com.google.showcase.v1beta1.BlurbName; +import com.google.showcase.v1beta1.IdentityClient; + +public class SyncGetIamPolicy { + + public static void main(String[] args) throws Exception { + syncGetIamPolicy(); + } + + public static void syncGetIamPolicy() 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 (IdentityClient identityClient = IdentityClient.create()) { + GetIamPolicyRequest request = + GetIamPolicyRequest.newBuilder() + .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString()) + .setOptions(GetPolicyOptions.newBuilder().build()) + .build(); + Policy response = identityClient.getIamPolicy(request); + } + } +} +// [END localhost7469_v1beta1_generated_Identity_GetIamPolicy_sync] diff --git a/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/identity/getlocation/AsyncGetLocation.java b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/identity/getlocation/AsyncGetLocation.java new file mode 100644 index 0000000000..e05b29dc2a --- /dev/null +++ b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/identity/getlocation/AsyncGetLocation.java @@ -0,0 +1,45 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.samples; + +// [START localhost7469_v1beta1_generated_Identity_GetLocation_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.Location; +import com.google.showcase.v1beta1.IdentityClient; + +public class AsyncGetLocation { + + public static void main(String[] args) throws Exception { + asyncGetLocation(); + } + + public static void asyncGetLocation() 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 (IdentityClient identityClient = IdentityClient.create()) { + GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build(); + ApiFuture future = identityClient.getLocationCallable().futureCall(request); + // Do something. + Location response = future.get(); + } + } +} +// [END localhost7469_v1beta1_generated_Identity_GetLocation_async] diff --git a/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/identity/getlocation/SyncGetLocation.java b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/identity/getlocation/SyncGetLocation.java new file mode 100644 index 0000000000..5eb60f801b --- /dev/null +++ b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/identity/getlocation/SyncGetLocation.java @@ -0,0 +1,42 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.samples; + +// [START localhost7469_v1beta1_generated_Identity_GetLocation_sync] +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.Location; +import com.google.showcase.v1beta1.IdentityClient; + +public class SyncGetLocation { + + public static void main(String[] args) throws Exception { + syncGetLocation(); + } + + public static void syncGetLocation() 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 (IdentityClient identityClient = IdentityClient.create()) { + GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build(); + Location response = identityClient.getLocation(request); + } + } +} +// [END localhost7469_v1beta1_generated_Identity_GetLocation_sync] diff --git a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/identity/getuser/AsyncGetUser.java b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/identity/getuser/AsyncGetUser.java similarity index 98% rename from showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/identity/getuser/AsyncGetUser.java rename to java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/identity/getuser/AsyncGetUser.java index 640d726784..a7e37063a4 100644 --- a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/identity/getuser/AsyncGetUser.java +++ b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/identity/getuser/AsyncGetUser.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/identity/getuser/SyncGetUser.java b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/identity/getuser/SyncGetUser.java similarity index 98% rename from showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/identity/getuser/SyncGetUser.java rename to java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/identity/getuser/SyncGetUser.java index 9e6adc257c..1dcd163e44 100644 --- a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/identity/getuser/SyncGetUser.java +++ b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/identity/getuser/SyncGetUser.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/identity/getuser/SyncGetUserString.java b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/identity/getuser/SyncGetUserString.java similarity index 98% rename from showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/identity/getuser/SyncGetUserString.java rename to java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/identity/getuser/SyncGetUserString.java index 3443054f45..36284b6ed3 100644 --- a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/identity/getuser/SyncGetUserString.java +++ b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/identity/getuser/SyncGetUserString.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/identity/getuser/SyncGetUserUsername.java b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/identity/getuser/SyncGetUserUsername.java similarity index 98% rename from showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/identity/getuser/SyncGetUserUsername.java rename to java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/identity/getuser/SyncGetUserUsername.java index 53313b1f09..705faaf357 100644 --- a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/identity/getuser/SyncGetUserUsername.java +++ b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/identity/getuser/SyncGetUserUsername.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/identity/listlocations/AsyncListLocations.java b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/identity/listlocations/AsyncListLocations.java new file mode 100644 index 0000000000..7bfc34a247 --- /dev/null +++ b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/identity/listlocations/AsyncListLocations.java @@ -0,0 +1,53 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.samples; + +// [START localhost7469_v1beta1_generated_Identity_ListLocations_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.Location; +import com.google.showcase.v1beta1.IdentityClient; + +public class AsyncListLocations { + + public static void main(String[] args) throws Exception { + asyncListLocations(); + } + + public static void asyncListLocations() 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 (IdentityClient identityClient = IdentityClient.create()) { + ListLocationsRequest request = + ListLocationsRequest.newBuilder() + .setName("name3373707") + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + ApiFuture future = identityClient.listLocationsPagedCallable().futureCall(request); + // Do something. + for (Location element : future.get().iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END localhost7469_v1beta1_generated_Identity_ListLocations_async] diff --git a/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/identity/listlocations/AsyncListLocationsPaged.java b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/identity/listlocations/AsyncListLocationsPaged.java new file mode 100644 index 0000000000..7ec0c4de2f --- /dev/null +++ b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/identity/listlocations/AsyncListLocationsPaged.java @@ -0,0 +1,61 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.samples; + +// [START localhost7469_v1beta1_generated_Identity_ListLocations_Paged_async] +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.common.base.Strings; +import com.google.showcase.v1beta1.IdentityClient; + +public class AsyncListLocationsPaged { + + public static void main(String[] args) throws Exception { + asyncListLocationsPaged(); + } + + public static void asyncListLocationsPaged() 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 (IdentityClient identityClient = IdentityClient.create()) { + ListLocationsRequest request = + ListLocationsRequest.newBuilder() + .setName("name3373707") + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + while (true) { + ListLocationsResponse response = identityClient.listLocationsCallable().call(request); + for (Location element : response.getLocationsList()) { + // doThingsWith(element); + } + String nextPageToken = response.getNextPageToken(); + if (!Strings.isNullOrEmpty(nextPageToken)) { + request = request.toBuilder().setPageToken(nextPageToken).build(); + } else { + break; + } + } + } + } +} +// [END localhost7469_v1beta1_generated_Identity_ListLocations_Paged_async] diff --git a/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/identity/listlocations/SyncListLocations.java b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/identity/listlocations/SyncListLocations.java new file mode 100644 index 0000000000..8db49ca62f --- /dev/null +++ b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/identity/listlocations/SyncListLocations.java @@ -0,0 +1,50 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.samples; + +// [START localhost7469_v1beta1_generated_Identity_ListLocations_sync] +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.Location; +import com.google.showcase.v1beta1.IdentityClient; + +public class SyncListLocations { + + public static void main(String[] args) throws Exception { + syncListLocations(); + } + + public static void syncListLocations() 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 (IdentityClient identityClient = IdentityClient.create()) { + ListLocationsRequest request = + ListLocationsRequest.newBuilder() + .setName("name3373707") + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + for (Location element : identityClient.listLocations(request).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END localhost7469_v1beta1_generated_Identity_ListLocations_sync] diff --git a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/identity/listusers/AsyncListUsers.java b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/identity/listusers/AsyncListUsers.java similarity index 98% rename from showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/identity/listusers/AsyncListUsers.java rename to java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/identity/listusers/AsyncListUsers.java index b72d2c1f7f..360bb04616 100644 --- a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/identity/listusers/AsyncListUsers.java +++ b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/identity/listusers/AsyncListUsers.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/identity/listusers/AsyncListUsersPaged.java b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/identity/listusers/AsyncListUsersPaged.java similarity index 98% rename from showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/identity/listusers/AsyncListUsersPaged.java rename to java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/identity/listusers/AsyncListUsersPaged.java index 50351698b4..bf886cf9b6 100644 --- a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/identity/listusers/AsyncListUsersPaged.java +++ b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/identity/listusers/AsyncListUsersPaged.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/identity/listusers/SyncListUsers.java b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/identity/listusers/SyncListUsers.java similarity index 98% rename from showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/identity/listusers/SyncListUsers.java rename to java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/identity/listusers/SyncListUsers.java index ea0578c12a..9a5af16304 100644 --- a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/identity/listusers/SyncListUsers.java +++ b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/identity/listusers/SyncListUsers.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/identity/setiampolicy/AsyncSetIamPolicy.java b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/identity/setiampolicy/AsyncSetIamPolicy.java new file mode 100644 index 0000000000..569cc8a958 --- /dev/null +++ b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/identity/setiampolicy/AsyncSetIamPolicy.java @@ -0,0 +1,52 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.samples; + +// [START localhost7469_v1beta1_generated_Identity_SetIamPolicy_async] +import com.google.api.core.ApiFuture; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.protobuf.FieldMask; +import com.google.showcase.v1beta1.BlurbName; +import com.google.showcase.v1beta1.IdentityClient; + +public class AsyncSetIamPolicy { + + public static void main(String[] args) throws Exception { + asyncSetIamPolicy(); + } + + public static void asyncSetIamPolicy() 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 (IdentityClient identityClient = IdentityClient.create()) { + SetIamPolicyRequest request = + SetIamPolicyRequest.newBuilder() + .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString()) + .setPolicy(Policy.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .build(); + ApiFuture future = identityClient.setIamPolicyCallable().futureCall(request); + // Do something. + Policy response = future.get(); + } + } +} +// [END localhost7469_v1beta1_generated_Identity_SetIamPolicy_async] diff --git a/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/identity/setiampolicy/SyncSetIamPolicy.java b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/identity/setiampolicy/SyncSetIamPolicy.java new file mode 100644 index 0000000000..40fc8cca6d --- /dev/null +++ b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/identity/setiampolicy/SyncSetIamPolicy.java @@ -0,0 +1,49 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.samples; + +// [START localhost7469_v1beta1_generated_Identity_SetIamPolicy_sync] +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.protobuf.FieldMask; +import com.google.showcase.v1beta1.BlurbName; +import com.google.showcase.v1beta1.IdentityClient; + +public class SyncSetIamPolicy { + + public static void main(String[] args) throws Exception { + syncSetIamPolicy(); + } + + public static void syncSetIamPolicy() 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 (IdentityClient identityClient = IdentityClient.create()) { + SetIamPolicyRequest request = + SetIamPolicyRequest.newBuilder() + .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString()) + .setPolicy(Policy.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .build(); + Policy response = identityClient.setIamPolicy(request); + } + } +} +// [END localhost7469_v1beta1_generated_Identity_SetIamPolicy_sync] diff --git a/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/identity/testiampermissions/AsyncTestIamPermissions.java b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/identity/testiampermissions/AsyncTestIamPermissions.java new file mode 100644 index 0000000000..acde2f0de7 --- /dev/null +++ b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/identity/testiampermissions/AsyncTestIamPermissions.java @@ -0,0 +1,52 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.samples; + +// [START localhost7469_v1beta1_generated_Identity_TestIamPermissions_async] +import com.google.api.core.ApiFuture; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.showcase.v1beta1.BlurbName; +import com.google.showcase.v1beta1.IdentityClient; +import java.util.ArrayList; + +public class AsyncTestIamPermissions { + + public static void main(String[] args) throws Exception { + asyncTestIamPermissions(); + } + + public static void asyncTestIamPermissions() 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 (IdentityClient identityClient = IdentityClient.create()) { + TestIamPermissionsRequest request = + TestIamPermissionsRequest.newBuilder() + .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString()) + .addAllPermissions(new ArrayList()) + .build(); + ApiFuture future = + identityClient.testIamPermissionsCallable().futureCall(request); + // Do something. + TestIamPermissionsResponse response = future.get(); + } + } +} +// [END localhost7469_v1beta1_generated_Identity_TestIamPermissions_async] diff --git a/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/identity/testiampermissions/SyncTestIamPermissions.java b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/identity/testiampermissions/SyncTestIamPermissions.java new file mode 100644 index 0000000000..e24a10d7f8 --- /dev/null +++ b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/identity/testiampermissions/SyncTestIamPermissions.java @@ -0,0 +1,48 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.samples; + +// [START localhost7469_v1beta1_generated_Identity_TestIamPermissions_sync] +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.showcase.v1beta1.BlurbName; +import com.google.showcase.v1beta1.IdentityClient; +import java.util.ArrayList; + +public class SyncTestIamPermissions { + + public static void main(String[] args) throws Exception { + syncTestIamPermissions(); + } + + public static void syncTestIamPermissions() 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 (IdentityClient identityClient = IdentityClient.create()) { + TestIamPermissionsRequest request = + TestIamPermissionsRequest.newBuilder() + .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString()) + .addAllPermissions(new ArrayList()) + .build(); + TestIamPermissionsResponse response = identityClient.testIamPermissions(request); + } + } +} +// [END localhost7469_v1beta1_generated_Identity_TestIamPermissions_sync] diff --git a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/identity/updateuser/AsyncUpdateUser.java b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/identity/updateuser/AsyncUpdateUser.java similarity index 98% rename from showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/identity/updateuser/AsyncUpdateUser.java rename to java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/identity/updateuser/AsyncUpdateUser.java index 5d2fc84649..63fdd985f3 100644 --- a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/identity/updateuser/AsyncUpdateUser.java +++ b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/identity/updateuser/AsyncUpdateUser.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/identity/updateuser/SyncUpdateUser.java b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/identity/updateuser/SyncUpdateUser.java similarity index 98% rename from showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/identity/updateuser/SyncUpdateUser.java rename to java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/identity/updateuser/SyncUpdateUser.java index 23b62e3bbc..3cbdf19062 100644 --- a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/identity/updateuser/SyncUpdateUser.java +++ b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/identity/updateuser/SyncUpdateUser.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/identitysettings/createuser/SyncCreateUser.java b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/identitysettings/createuser/SyncCreateUser.java new file mode 100644 index 0000000000..8e90408f6e --- /dev/null +++ b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/identitysettings/createuser/SyncCreateUser.java @@ -0,0 +1,55 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.samples; + +// [START localhost7469_v1beta1_generated_IdentitySettings_CreateUser_sync] +import com.google.showcase.v1beta1.IdentitySettings; +import java.time.Duration; + +public class SyncCreateUser { + + public static void main(String[] args) throws Exception { + syncCreateUser(); + } + + public static void syncCreateUser() 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 + IdentitySettings.Builder identitySettingsBuilder = IdentitySettings.newBuilder(); + identitySettingsBuilder + .createUserSettings() + .setRetrySettings( + identitySettingsBuilder + .createUserSettings() + .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()); + IdentitySettings identitySettings = identitySettingsBuilder.build(); + } +} +// [END localhost7469_v1beta1_generated_IdentitySettings_CreateUser_sync] diff --git a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/connect/AsyncConnect.java b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/messaging/connect/AsyncConnect.java similarity index 98% rename from showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/connect/AsyncConnect.java rename to java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/messaging/connect/AsyncConnect.java index 34f70c0c41..13ab49a518 100644 --- a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/connect/AsyncConnect.java +++ b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/messaging/connect/AsyncConnect.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/messaging/create/SyncCreateSetCredentialsProvider.java b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/messaging/create/SyncCreateSetCredentialsProvider.java new file mode 100644 index 0000000000..77dfed2e01 --- /dev/null +++ b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/messaging/create/SyncCreateSetCredentialsProvider.java @@ -0,0 +1,44 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.samples; + +// [START localhost7469_v1beta1_generated_Messaging_Create_SetCredentialsProvider_sync] +import com.google.api.gax.core.FixedCredentialsProvider; +import com.google.showcase.v1beta1.MessagingClient; +import com.google.showcase.v1beta1.MessagingSettings; +import com.google.showcase.v1beta1.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 + MessagingSettings messagingSettings = + MessagingSettings.newBuilder() + .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials)) + .build(); + MessagingClient messagingClient = MessagingClient.create(messagingSettings); + } +} +// [END localhost7469_v1beta1_generated_Messaging_Create_SetCredentialsProvider_sync] diff --git a/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/messaging/create/SyncCreateSetEndpoint.java b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/messaging/create/SyncCreateSetEndpoint.java new file mode 100644 index 0000000000..a6f90104f0 --- /dev/null +++ b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/messaging/create/SyncCreateSetEndpoint.java @@ -0,0 +1,41 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.samples; + +// [START localhost7469_v1beta1_generated_Messaging_Create_SetEndpoint_sync] +import com.google.showcase.v1beta1.MessagingClient; +import com.google.showcase.v1beta1.MessagingSettings; +import com.google.showcase.v1beta1.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 + MessagingSettings messagingSettings = + MessagingSettings.newBuilder().setEndpoint(myEndpoint).build(); + MessagingClient messagingClient = MessagingClient.create(messagingSettings); + } +} +// [END localhost7469_v1beta1_generated_Messaging_Create_SetEndpoint_sync] diff --git a/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/messaging/create/SyncCreateUseHttpJsonTransport.java b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/messaging/create/SyncCreateUseHttpJsonTransport.java new file mode 100644 index 0000000000..3c40e36a6c --- /dev/null +++ b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/messaging/create/SyncCreateUseHttpJsonTransport.java @@ -0,0 +1,39 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.samples; + +// [START localhost7469_v1beta1_generated_Messaging_Create_UseHttpJsonTransport_sync] +import com.google.showcase.v1beta1.MessagingClient; +import com.google.showcase.v1beta1.MessagingSettings; + +public class SyncCreateUseHttpJsonTransport { + + public static void main(String[] args) throws Exception { + syncCreateUseHttpJsonTransport(); + } + + public static void syncCreateUseHttpJsonTransport() 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 + MessagingSettings messagingSettings = MessagingSettings.newHttpJsonBuilder().build(); + MessagingClient messagingClient = MessagingClient.create(messagingSettings); + } +} +// [END localhost7469_v1beta1_generated_Messaging_Create_UseHttpJsonTransport_sync] diff --git a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/createblurb/AsyncCreateBlurb.java b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/messaging/createblurb/AsyncCreateBlurb.java similarity index 98% rename from showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/createblurb/AsyncCreateBlurb.java rename to java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/messaging/createblurb/AsyncCreateBlurb.java index ab21cabfa7..d593ea230b 100644 --- a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/createblurb/AsyncCreateBlurb.java +++ b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/messaging/createblurb/AsyncCreateBlurb.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/createblurb/SyncCreateBlurb.java b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/messaging/createblurb/SyncCreateBlurb.java similarity index 98% rename from showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/createblurb/SyncCreateBlurb.java rename to java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/messaging/createblurb/SyncCreateBlurb.java index 10f979355d..b753dc3c96 100644 --- a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/createblurb/SyncCreateBlurb.java +++ b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/messaging/createblurb/SyncCreateBlurb.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/createblurb/SyncCreateBlurbProfilenameStringBytestring.java b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/messaging/createblurb/SyncCreateBlurbProfilenameStringBytestring.java similarity index 98% rename from showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/createblurb/SyncCreateBlurbProfilenameStringBytestring.java rename to java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/messaging/createblurb/SyncCreateBlurbProfilenameStringBytestring.java index 8fe16595eb..f98271c588 100644 --- a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/createblurb/SyncCreateBlurbProfilenameStringBytestring.java +++ b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/messaging/createblurb/SyncCreateBlurbProfilenameStringBytestring.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/createblurb/SyncCreateBlurbProfilenameStringString.java b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/messaging/createblurb/SyncCreateBlurbProfilenameStringString.java similarity index 98% rename from showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/createblurb/SyncCreateBlurbProfilenameStringString.java rename to java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/messaging/createblurb/SyncCreateBlurbProfilenameStringString.java index 5d4c8e8986..443a93e5e1 100644 --- a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/createblurb/SyncCreateBlurbProfilenameStringString.java +++ b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/messaging/createblurb/SyncCreateBlurbProfilenameStringString.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/createblurb/SyncCreateBlurbProfilenameUsernameBytestring.java b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/messaging/createblurb/SyncCreateBlurbProfilenameUsernameBytestring.java similarity index 98% rename from showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/createblurb/SyncCreateBlurbProfilenameUsernameBytestring.java rename to java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/messaging/createblurb/SyncCreateBlurbProfilenameUsernameBytestring.java index 9c3d7b8c98..a96bd093cb 100644 --- a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/createblurb/SyncCreateBlurbProfilenameUsernameBytestring.java +++ b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/messaging/createblurb/SyncCreateBlurbProfilenameUsernameBytestring.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/createblurb/SyncCreateBlurbProfilenameUsernameString.java b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/messaging/createblurb/SyncCreateBlurbProfilenameUsernameString.java similarity index 98% rename from showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/createblurb/SyncCreateBlurbProfilenameUsernameString.java rename to java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/messaging/createblurb/SyncCreateBlurbProfilenameUsernameString.java index f431a92155..0f96b58a4e 100644 --- a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/createblurb/SyncCreateBlurbProfilenameUsernameString.java +++ b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/messaging/createblurb/SyncCreateBlurbProfilenameUsernameString.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/createblurb/SyncCreateBlurbRoomnameStringBytestring.java b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/messaging/createblurb/SyncCreateBlurbRoomnameStringBytestring.java similarity index 98% rename from showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/createblurb/SyncCreateBlurbRoomnameStringBytestring.java rename to java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/messaging/createblurb/SyncCreateBlurbRoomnameStringBytestring.java index 477ed0b163..af842f9c3c 100644 --- a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/createblurb/SyncCreateBlurbRoomnameStringBytestring.java +++ b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/messaging/createblurb/SyncCreateBlurbRoomnameStringBytestring.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/createblurb/SyncCreateBlurbRoomnameStringString.java b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/messaging/createblurb/SyncCreateBlurbRoomnameStringString.java similarity index 98% rename from showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/createblurb/SyncCreateBlurbRoomnameStringString.java rename to java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/messaging/createblurb/SyncCreateBlurbRoomnameStringString.java index 07dc451756..653e2de8e9 100644 --- a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/createblurb/SyncCreateBlurbRoomnameStringString.java +++ b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/messaging/createblurb/SyncCreateBlurbRoomnameStringString.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/createblurb/SyncCreateBlurbRoomnameUsernameBytestring.java b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/messaging/createblurb/SyncCreateBlurbRoomnameUsernameBytestring.java similarity index 98% rename from showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/createblurb/SyncCreateBlurbRoomnameUsernameBytestring.java rename to java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/messaging/createblurb/SyncCreateBlurbRoomnameUsernameBytestring.java index a4cff9e110..07674779b6 100644 --- a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/createblurb/SyncCreateBlurbRoomnameUsernameBytestring.java +++ b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/messaging/createblurb/SyncCreateBlurbRoomnameUsernameBytestring.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/createblurb/SyncCreateBlurbRoomnameUsernameString.java b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/messaging/createblurb/SyncCreateBlurbRoomnameUsernameString.java similarity index 98% rename from showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/createblurb/SyncCreateBlurbRoomnameUsernameString.java rename to java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/messaging/createblurb/SyncCreateBlurbRoomnameUsernameString.java index 5e71b33344..70909217b3 100644 --- a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/createblurb/SyncCreateBlurbRoomnameUsernameString.java +++ b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/messaging/createblurb/SyncCreateBlurbRoomnameUsernameString.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/createblurb/SyncCreateBlurbStringStringBytestring.java b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/messaging/createblurb/SyncCreateBlurbStringStringBytestring.java similarity index 98% rename from showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/createblurb/SyncCreateBlurbStringStringBytestring.java rename to java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/messaging/createblurb/SyncCreateBlurbStringStringBytestring.java index bfed9b8941..91dcaeff4e 100644 --- a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/createblurb/SyncCreateBlurbStringStringBytestring.java +++ b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/messaging/createblurb/SyncCreateBlurbStringStringBytestring.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/createblurb/SyncCreateBlurbStringStringString.java b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/messaging/createblurb/SyncCreateBlurbStringStringString.java similarity index 98% rename from showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/createblurb/SyncCreateBlurbStringStringString.java rename to java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/messaging/createblurb/SyncCreateBlurbStringStringString.java index f2611ad321..026c386483 100644 --- a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/createblurb/SyncCreateBlurbStringStringString.java +++ b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/messaging/createblurb/SyncCreateBlurbStringStringString.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/createblurb/SyncCreateBlurbStringUsernameBytestring.java b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/messaging/createblurb/SyncCreateBlurbStringUsernameBytestring.java similarity index 98% rename from showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/createblurb/SyncCreateBlurbStringUsernameBytestring.java rename to java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/messaging/createblurb/SyncCreateBlurbStringUsernameBytestring.java index 20ac75deb0..1419a6ada9 100644 --- a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/createblurb/SyncCreateBlurbStringUsernameBytestring.java +++ b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/messaging/createblurb/SyncCreateBlurbStringUsernameBytestring.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/createblurb/SyncCreateBlurbStringUsernameString.java b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/messaging/createblurb/SyncCreateBlurbStringUsernameString.java similarity index 98% rename from showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/createblurb/SyncCreateBlurbStringUsernameString.java rename to java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/messaging/createblurb/SyncCreateBlurbStringUsernameString.java index a9a3cd4af8..0b01d12b46 100644 --- a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/createblurb/SyncCreateBlurbStringUsernameString.java +++ b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/messaging/createblurb/SyncCreateBlurbStringUsernameString.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/createroom/AsyncCreateRoom.java b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/messaging/createroom/AsyncCreateRoom.java similarity index 98% rename from showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/createroom/AsyncCreateRoom.java rename to java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/messaging/createroom/AsyncCreateRoom.java index 70a76f23b0..ac91e37828 100644 --- a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/createroom/AsyncCreateRoom.java +++ b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/messaging/createroom/AsyncCreateRoom.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/messaging/createroom/SyncCreateRoom.java b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/messaging/createroom/SyncCreateRoom.java new file mode 100644 index 0000000000..52b1fac1e4 --- /dev/null +++ b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/messaging/createroom/SyncCreateRoom.java @@ -0,0 +1,43 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.samples; + +// [START localhost7469_v1beta1_generated_Messaging_CreateRoom_sync] +import com.google.showcase.v1beta1.CreateRoomRequest; +import com.google.showcase.v1beta1.MessagingClient; +import com.google.showcase.v1beta1.Room; + +public class SyncCreateRoom { + + public static void main(String[] args) throws Exception { + syncCreateRoom(); + } + + public static void syncCreateRoom() 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 (MessagingClient messagingClient = MessagingClient.create()) { + CreateRoomRequest request = + CreateRoomRequest.newBuilder().setRoom(Room.newBuilder().build()).build(); + Room response = messagingClient.createRoom(request); + } + } +} +// [END localhost7469_v1beta1_generated_Messaging_CreateRoom_sync] diff --git a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/createroom/SyncCreateRoomStringString.java b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/messaging/createroom/SyncCreateRoomStringString.java similarity index 98% rename from showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/createroom/SyncCreateRoomStringString.java rename to java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/messaging/createroom/SyncCreateRoomStringString.java index 7fcd4b7c45..9754625d35 100644 --- a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/createroom/SyncCreateRoomStringString.java +++ b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/messaging/createroom/SyncCreateRoomStringString.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/deleteblurb/AsyncDeleteBlurb.java b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/messaging/deleteblurb/AsyncDeleteBlurb.java similarity index 98% rename from showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/deleteblurb/AsyncDeleteBlurb.java rename to java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/messaging/deleteblurb/AsyncDeleteBlurb.java index 664a34bc76..00f7b1e14d 100644 --- a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/deleteblurb/AsyncDeleteBlurb.java +++ b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/messaging/deleteblurb/AsyncDeleteBlurb.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/deleteblurb/SyncDeleteBlurb.java b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/messaging/deleteblurb/SyncDeleteBlurb.java similarity index 98% rename from showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/deleteblurb/SyncDeleteBlurb.java rename to java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/messaging/deleteblurb/SyncDeleteBlurb.java index cd93918820..624977dce4 100644 --- a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/deleteblurb/SyncDeleteBlurb.java +++ b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/messaging/deleteblurb/SyncDeleteBlurb.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/deleteblurb/SyncDeleteBlurbBlurbname.java b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/messaging/deleteblurb/SyncDeleteBlurbBlurbname.java similarity index 98% rename from showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/deleteblurb/SyncDeleteBlurbBlurbname.java rename to java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/messaging/deleteblurb/SyncDeleteBlurbBlurbname.java index 815c598962..72a1efe1cd 100644 --- a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/deleteblurb/SyncDeleteBlurbBlurbname.java +++ b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/messaging/deleteblurb/SyncDeleteBlurbBlurbname.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/deleteblurb/SyncDeleteBlurbString.java b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/messaging/deleteblurb/SyncDeleteBlurbString.java similarity index 98% rename from showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/deleteblurb/SyncDeleteBlurbString.java rename to java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/messaging/deleteblurb/SyncDeleteBlurbString.java index 30d35e96cb..c7eaf55c28 100644 --- a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/deleteblurb/SyncDeleteBlurbString.java +++ b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/messaging/deleteblurb/SyncDeleteBlurbString.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/deleteroom/AsyncDeleteRoom.java b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/messaging/deleteroom/AsyncDeleteRoom.java similarity index 98% rename from showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/deleteroom/AsyncDeleteRoom.java rename to java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/messaging/deleteroom/AsyncDeleteRoom.java index f521ea0ab6..df87e72c24 100644 --- a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/deleteroom/AsyncDeleteRoom.java +++ b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/messaging/deleteroom/AsyncDeleteRoom.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/deleteroom/SyncDeleteRoom.java b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/messaging/deleteroom/SyncDeleteRoom.java similarity index 98% rename from showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/deleteroom/SyncDeleteRoom.java rename to java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/messaging/deleteroom/SyncDeleteRoom.java index bcb643cbea..131f694d67 100644 --- a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/deleteroom/SyncDeleteRoom.java +++ b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/messaging/deleteroom/SyncDeleteRoom.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/deleteroom/SyncDeleteRoomRoomname.java b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/messaging/deleteroom/SyncDeleteRoomRoomname.java similarity index 98% rename from showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/deleteroom/SyncDeleteRoomRoomname.java rename to java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/messaging/deleteroom/SyncDeleteRoomRoomname.java index bed6bd6339..09fcd1b9b4 100644 --- a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/deleteroom/SyncDeleteRoomRoomname.java +++ b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/messaging/deleteroom/SyncDeleteRoomRoomname.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/deleteroom/SyncDeleteRoomString.java b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/messaging/deleteroom/SyncDeleteRoomString.java similarity index 98% rename from showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/deleteroom/SyncDeleteRoomString.java rename to java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/messaging/deleteroom/SyncDeleteRoomString.java index c8ef55c8f0..42077eacce 100644 --- a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/deleteroom/SyncDeleteRoomString.java +++ b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/messaging/deleteroom/SyncDeleteRoomString.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/getblurb/AsyncGetBlurb.java b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/messaging/getblurb/AsyncGetBlurb.java similarity index 98% rename from showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/getblurb/AsyncGetBlurb.java rename to java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/messaging/getblurb/AsyncGetBlurb.java index 3bcdc0dfa2..1b4c8806fa 100644 --- a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/getblurb/AsyncGetBlurb.java +++ b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/messaging/getblurb/AsyncGetBlurb.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/getblurb/SyncGetBlurb.java b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/messaging/getblurb/SyncGetBlurb.java similarity index 98% rename from showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/getblurb/SyncGetBlurb.java rename to java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/messaging/getblurb/SyncGetBlurb.java index 0ca916ecfb..2318ca84e9 100644 --- a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/getblurb/SyncGetBlurb.java +++ b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/messaging/getblurb/SyncGetBlurb.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/getblurb/SyncGetBlurbBlurbname.java b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/messaging/getblurb/SyncGetBlurbBlurbname.java similarity index 98% rename from showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/getblurb/SyncGetBlurbBlurbname.java rename to java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/messaging/getblurb/SyncGetBlurbBlurbname.java index 8288ba1002..ae6cf09b8f 100644 --- a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/getblurb/SyncGetBlurbBlurbname.java +++ b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/messaging/getblurb/SyncGetBlurbBlurbname.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/getblurb/SyncGetBlurbString.java b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/messaging/getblurb/SyncGetBlurbString.java similarity index 98% rename from showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/getblurb/SyncGetBlurbString.java rename to java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/messaging/getblurb/SyncGetBlurbString.java index 3a7f190d7b..a00e23c992 100644 --- a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/getblurb/SyncGetBlurbString.java +++ b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/messaging/getblurb/SyncGetBlurbString.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/messaging/getiampolicy/AsyncGetIamPolicy.java b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/messaging/getiampolicy/AsyncGetIamPolicy.java new file mode 100644 index 0000000000..843d9685f3 --- /dev/null +++ b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/messaging/getiampolicy/AsyncGetIamPolicy.java @@ -0,0 +1,51 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.samples; + +// [START localhost7469_v1beta1_generated_Messaging_GetIamPolicy_async] +import com.google.api.core.ApiFuture; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.GetPolicyOptions; +import com.google.iam.v1.Policy; +import com.google.showcase.v1beta1.BlurbName; +import com.google.showcase.v1beta1.MessagingClient; + +public class AsyncGetIamPolicy { + + public static void main(String[] args) throws Exception { + asyncGetIamPolicy(); + } + + public static void asyncGetIamPolicy() 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 (MessagingClient messagingClient = MessagingClient.create()) { + GetIamPolicyRequest request = + GetIamPolicyRequest.newBuilder() + .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString()) + .setOptions(GetPolicyOptions.newBuilder().build()) + .build(); + ApiFuture future = messagingClient.getIamPolicyCallable().futureCall(request); + // Do something. + Policy response = future.get(); + } + } +} +// [END localhost7469_v1beta1_generated_Messaging_GetIamPolicy_async] diff --git a/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/messaging/getiampolicy/SyncGetIamPolicy.java b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/messaging/getiampolicy/SyncGetIamPolicy.java new file mode 100644 index 0000000000..fe567ecba6 --- /dev/null +++ b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/messaging/getiampolicy/SyncGetIamPolicy.java @@ -0,0 +1,48 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.samples; + +// [START localhost7469_v1beta1_generated_Messaging_GetIamPolicy_sync] +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.GetPolicyOptions; +import com.google.iam.v1.Policy; +import com.google.showcase.v1beta1.BlurbName; +import com.google.showcase.v1beta1.MessagingClient; + +public class SyncGetIamPolicy { + + public static void main(String[] args) throws Exception { + syncGetIamPolicy(); + } + + public static void syncGetIamPolicy() 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 (MessagingClient messagingClient = MessagingClient.create()) { + GetIamPolicyRequest request = + GetIamPolicyRequest.newBuilder() + .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString()) + .setOptions(GetPolicyOptions.newBuilder().build()) + .build(); + Policy response = messagingClient.getIamPolicy(request); + } + } +} +// [END localhost7469_v1beta1_generated_Messaging_GetIamPolicy_sync] diff --git a/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/messaging/getlocation/AsyncGetLocation.java b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/messaging/getlocation/AsyncGetLocation.java new file mode 100644 index 0000000000..8a0d9470a9 --- /dev/null +++ b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/messaging/getlocation/AsyncGetLocation.java @@ -0,0 +1,45 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.samples; + +// [START localhost7469_v1beta1_generated_Messaging_GetLocation_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.Location; +import com.google.showcase.v1beta1.MessagingClient; + +public class AsyncGetLocation { + + public static void main(String[] args) throws Exception { + asyncGetLocation(); + } + + public static void asyncGetLocation() 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 (MessagingClient messagingClient = MessagingClient.create()) { + GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build(); + ApiFuture future = messagingClient.getLocationCallable().futureCall(request); + // Do something. + Location response = future.get(); + } + } +} +// [END localhost7469_v1beta1_generated_Messaging_GetLocation_async] diff --git a/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/messaging/getlocation/SyncGetLocation.java b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/messaging/getlocation/SyncGetLocation.java new file mode 100644 index 0000000000..67e62caf4d --- /dev/null +++ b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/messaging/getlocation/SyncGetLocation.java @@ -0,0 +1,42 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.samples; + +// [START localhost7469_v1beta1_generated_Messaging_GetLocation_sync] +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.Location; +import com.google.showcase.v1beta1.MessagingClient; + +public class SyncGetLocation { + + public static void main(String[] args) throws Exception { + syncGetLocation(); + } + + public static void syncGetLocation() 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 (MessagingClient messagingClient = MessagingClient.create()) { + GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build(); + Location response = messagingClient.getLocation(request); + } + } +} +// [END localhost7469_v1beta1_generated_Messaging_GetLocation_sync] diff --git a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/getroom/AsyncGetRoom.java b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/messaging/getroom/AsyncGetRoom.java similarity index 98% rename from showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/getroom/AsyncGetRoom.java rename to java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/messaging/getroom/AsyncGetRoom.java index 7449457aec..95d0335304 100644 --- a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/getroom/AsyncGetRoom.java +++ b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/messaging/getroom/AsyncGetRoom.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/getroom/SyncGetRoom.java b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/messaging/getroom/SyncGetRoom.java similarity index 98% rename from showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/getroom/SyncGetRoom.java rename to java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/messaging/getroom/SyncGetRoom.java index 50195f0808..f5645f6dcd 100644 --- a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/getroom/SyncGetRoom.java +++ b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/messaging/getroom/SyncGetRoom.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/getroom/SyncGetRoomRoomname.java b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/messaging/getroom/SyncGetRoomRoomname.java similarity index 98% rename from showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/getroom/SyncGetRoomRoomname.java rename to java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/messaging/getroom/SyncGetRoomRoomname.java index 330ff415e6..96767246d8 100644 --- a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/getroom/SyncGetRoomRoomname.java +++ b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/messaging/getroom/SyncGetRoomRoomname.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/getroom/SyncGetRoomString.java b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/messaging/getroom/SyncGetRoomString.java similarity index 98% rename from showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/getroom/SyncGetRoomString.java rename to java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/messaging/getroom/SyncGetRoomString.java index a0d1d29738..e384daa884 100644 --- a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/getroom/SyncGetRoomString.java +++ b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/messaging/getroom/SyncGetRoomString.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/listblurbs/AsyncListBlurbs.java b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/messaging/listblurbs/AsyncListBlurbs.java similarity index 98% rename from showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/listblurbs/AsyncListBlurbs.java rename to java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/messaging/listblurbs/AsyncListBlurbs.java index e1ed6b891e..036e08b803 100644 --- a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/listblurbs/AsyncListBlurbs.java +++ b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/messaging/listblurbs/AsyncListBlurbs.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/listblurbs/AsyncListBlurbsPaged.java b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/messaging/listblurbs/AsyncListBlurbsPaged.java similarity index 98% rename from showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/listblurbs/AsyncListBlurbsPaged.java rename to java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/messaging/listblurbs/AsyncListBlurbsPaged.java index 4fe5854968..739a18de60 100644 --- a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/listblurbs/AsyncListBlurbsPaged.java +++ b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/messaging/listblurbs/AsyncListBlurbsPaged.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/listblurbs/SyncListBlurbs.java b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/messaging/listblurbs/SyncListBlurbs.java similarity index 98% rename from showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/listblurbs/SyncListBlurbs.java rename to java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/messaging/listblurbs/SyncListBlurbs.java index ad1fe7ca00..25db9aaa50 100644 --- a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/listblurbs/SyncListBlurbs.java +++ b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/messaging/listblurbs/SyncListBlurbs.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/listblurbs/SyncListBlurbsProfilename.java b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/messaging/listblurbs/SyncListBlurbsProfilename.java similarity index 98% rename from showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/listblurbs/SyncListBlurbsProfilename.java rename to java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/messaging/listblurbs/SyncListBlurbsProfilename.java index cd576614b4..1f684aa341 100644 --- a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/listblurbs/SyncListBlurbsProfilename.java +++ b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/messaging/listblurbs/SyncListBlurbsProfilename.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/listblurbs/SyncListBlurbsRoomname.java b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/messaging/listblurbs/SyncListBlurbsRoomname.java similarity index 98% rename from showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/listblurbs/SyncListBlurbsRoomname.java rename to java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/messaging/listblurbs/SyncListBlurbsRoomname.java index e4e34b5327..97002c1900 100644 --- a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/listblurbs/SyncListBlurbsRoomname.java +++ b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/messaging/listblurbs/SyncListBlurbsRoomname.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/listblurbs/SyncListBlurbsString.java b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/messaging/listblurbs/SyncListBlurbsString.java similarity index 98% rename from showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/listblurbs/SyncListBlurbsString.java rename to java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/messaging/listblurbs/SyncListBlurbsString.java index 77b1f2b68d..3ef3e6f7aa 100644 --- a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/listblurbs/SyncListBlurbsString.java +++ b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/messaging/listblurbs/SyncListBlurbsString.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/messaging/listlocations/AsyncListLocations.java b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/messaging/listlocations/AsyncListLocations.java new file mode 100644 index 0000000000..6279e8ebc7 --- /dev/null +++ b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/messaging/listlocations/AsyncListLocations.java @@ -0,0 +1,53 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.samples; + +// [START localhost7469_v1beta1_generated_Messaging_ListLocations_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.Location; +import com.google.showcase.v1beta1.MessagingClient; + +public class AsyncListLocations { + + public static void main(String[] args) throws Exception { + asyncListLocations(); + } + + public static void asyncListLocations() 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 (MessagingClient messagingClient = MessagingClient.create()) { + ListLocationsRequest request = + ListLocationsRequest.newBuilder() + .setName("name3373707") + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + ApiFuture future = messagingClient.listLocationsPagedCallable().futureCall(request); + // Do something. + for (Location element : future.get().iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END localhost7469_v1beta1_generated_Messaging_ListLocations_async] diff --git a/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/messaging/listlocations/AsyncListLocationsPaged.java b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/messaging/listlocations/AsyncListLocationsPaged.java new file mode 100644 index 0000000000..32db25a8a7 --- /dev/null +++ b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/messaging/listlocations/AsyncListLocationsPaged.java @@ -0,0 +1,61 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.samples; + +// [START localhost7469_v1beta1_generated_Messaging_ListLocations_Paged_async] +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.common.base.Strings; +import com.google.showcase.v1beta1.MessagingClient; + +public class AsyncListLocationsPaged { + + public static void main(String[] args) throws Exception { + asyncListLocationsPaged(); + } + + public static void asyncListLocationsPaged() 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 (MessagingClient messagingClient = MessagingClient.create()) { + ListLocationsRequest request = + ListLocationsRequest.newBuilder() + .setName("name3373707") + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + while (true) { + ListLocationsResponse response = messagingClient.listLocationsCallable().call(request); + for (Location element : response.getLocationsList()) { + // doThingsWith(element); + } + String nextPageToken = response.getNextPageToken(); + if (!Strings.isNullOrEmpty(nextPageToken)) { + request = request.toBuilder().setPageToken(nextPageToken).build(); + } else { + break; + } + } + } + } +} +// [END localhost7469_v1beta1_generated_Messaging_ListLocations_Paged_async] diff --git a/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/messaging/listlocations/SyncListLocations.java b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/messaging/listlocations/SyncListLocations.java new file mode 100644 index 0000000000..c04b6158a0 --- /dev/null +++ b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/messaging/listlocations/SyncListLocations.java @@ -0,0 +1,50 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.samples; + +// [START localhost7469_v1beta1_generated_Messaging_ListLocations_sync] +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.Location; +import com.google.showcase.v1beta1.MessagingClient; + +public class SyncListLocations { + + public static void main(String[] args) throws Exception { + syncListLocations(); + } + + public static void syncListLocations() 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 (MessagingClient messagingClient = MessagingClient.create()) { + ListLocationsRequest request = + ListLocationsRequest.newBuilder() + .setName("name3373707") + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + for (Location element : messagingClient.listLocations(request).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END localhost7469_v1beta1_generated_Messaging_ListLocations_sync] diff --git a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/listrooms/AsyncListRooms.java b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/messaging/listrooms/AsyncListRooms.java similarity index 98% rename from showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/listrooms/AsyncListRooms.java rename to java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/messaging/listrooms/AsyncListRooms.java index 245db794fc..786181d1e3 100644 --- a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/listrooms/AsyncListRooms.java +++ b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/messaging/listrooms/AsyncListRooms.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/listrooms/AsyncListRoomsPaged.java b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/messaging/listrooms/AsyncListRoomsPaged.java similarity index 98% rename from showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/listrooms/AsyncListRoomsPaged.java rename to java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/messaging/listrooms/AsyncListRoomsPaged.java index faf33d3da5..88e85e5835 100644 --- a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/listrooms/AsyncListRoomsPaged.java +++ b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/messaging/listrooms/AsyncListRoomsPaged.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/listrooms/SyncListRooms.java b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/messaging/listrooms/SyncListRooms.java similarity index 98% rename from showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/listrooms/SyncListRooms.java rename to java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/messaging/listrooms/SyncListRooms.java index f8196f7e96..0633420dd9 100644 --- a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/listrooms/SyncListRooms.java +++ b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/messaging/listrooms/SyncListRooms.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/searchblurbs/AsyncSearchBlurbs.java b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/messaging/searchblurbs/AsyncSearchBlurbs.java similarity index 98% rename from showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/searchblurbs/AsyncSearchBlurbs.java rename to java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/messaging/searchblurbs/AsyncSearchBlurbs.java index f74d6da297..c43842fc53 100644 --- a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/searchblurbs/AsyncSearchBlurbs.java +++ b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/messaging/searchblurbs/AsyncSearchBlurbs.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/searchblurbs/AsyncSearchBlurbsLRO.java b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/messaging/searchblurbs/AsyncSearchBlurbsLRO.java similarity index 98% rename from showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/searchblurbs/AsyncSearchBlurbsLRO.java rename to java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/messaging/searchblurbs/AsyncSearchBlurbsLRO.java index 70be85e24a..24636a4772 100644 --- a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/searchblurbs/AsyncSearchBlurbsLRO.java +++ b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/messaging/searchblurbs/AsyncSearchBlurbsLRO.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/messaging/searchblurbs/SyncSearchBlurbs.java b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/messaging/searchblurbs/SyncSearchBlurbs.java new file mode 100644 index 0000000000..95ef1fe9a8 --- /dev/null +++ b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/messaging/searchblurbs/SyncSearchBlurbs.java @@ -0,0 +1,49 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.samples; + +// [START localhost7469_v1beta1_generated_Messaging_SearchBlurbs_sync] +import com.google.showcase.v1beta1.MessagingClient; +import com.google.showcase.v1beta1.ProfileName; +import com.google.showcase.v1beta1.SearchBlurbsRequest; +import com.google.showcase.v1beta1.SearchBlurbsResponse; + +public class SyncSearchBlurbs { + + public static void main(String[] args) throws Exception { + syncSearchBlurbs(); + } + + public static void syncSearchBlurbs() 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 (MessagingClient messagingClient = MessagingClient.create()) { + SearchBlurbsRequest request = + SearchBlurbsRequest.newBuilder() + .setQuery("query107944136") + .setParent(ProfileName.of("[USER]").toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + SearchBlurbsResponse response = messagingClient.searchBlurbsAsync(request).get(); + } + } +} +// [END localhost7469_v1beta1_generated_Messaging_SearchBlurbs_sync] diff --git a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/searchblurbs/SyncSearchBlurbsProfilenameString.java b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/messaging/searchblurbs/SyncSearchBlurbsProfilenameString.java similarity index 98% rename from showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/searchblurbs/SyncSearchBlurbsProfilenameString.java rename to java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/messaging/searchblurbs/SyncSearchBlurbsProfilenameString.java index 3601c897d4..4091dd3b49 100644 --- a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/searchblurbs/SyncSearchBlurbsProfilenameString.java +++ b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/messaging/searchblurbs/SyncSearchBlurbsProfilenameString.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/searchblurbs/SyncSearchBlurbsRoomnameString.java b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/messaging/searchblurbs/SyncSearchBlurbsRoomnameString.java similarity index 98% rename from showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/searchblurbs/SyncSearchBlurbsRoomnameString.java rename to java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/messaging/searchblurbs/SyncSearchBlurbsRoomnameString.java index 164a2a0d52..cda4f5b24b 100644 --- a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/searchblurbs/SyncSearchBlurbsRoomnameString.java +++ b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/messaging/searchblurbs/SyncSearchBlurbsRoomnameString.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/searchblurbs/SyncSearchBlurbsStringString.java b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/messaging/searchblurbs/SyncSearchBlurbsStringString.java similarity index 98% rename from showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/searchblurbs/SyncSearchBlurbsStringString.java rename to java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/messaging/searchblurbs/SyncSearchBlurbsStringString.java index dffc4662fd..62d6fa8d01 100644 --- a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/searchblurbs/SyncSearchBlurbsStringString.java +++ b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/messaging/searchblurbs/SyncSearchBlurbsStringString.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/sendblurbs/AsyncSendBlurbs.java b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/messaging/sendblurbs/AsyncSendBlurbs.java similarity index 98% rename from showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/sendblurbs/AsyncSendBlurbs.java rename to java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/messaging/sendblurbs/AsyncSendBlurbs.java index 88c6d67af7..1a827b8756 100644 --- a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/sendblurbs/AsyncSendBlurbs.java +++ b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/messaging/sendblurbs/AsyncSendBlurbs.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/messaging/setiampolicy/AsyncSetIamPolicy.java b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/messaging/setiampolicy/AsyncSetIamPolicy.java new file mode 100644 index 0000000000..91345a8ce2 --- /dev/null +++ b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/messaging/setiampolicy/AsyncSetIamPolicy.java @@ -0,0 +1,52 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.samples; + +// [START localhost7469_v1beta1_generated_Messaging_SetIamPolicy_async] +import com.google.api.core.ApiFuture; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.protobuf.FieldMask; +import com.google.showcase.v1beta1.BlurbName; +import com.google.showcase.v1beta1.MessagingClient; + +public class AsyncSetIamPolicy { + + public static void main(String[] args) throws Exception { + asyncSetIamPolicy(); + } + + public static void asyncSetIamPolicy() 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 (MessagingClient messagingClient = MessagingClient.create()) { + SetIamPolicyRequest request = + SetIamPolicyRequest.newBuilder() + .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString()) + .setPolicy(Policy.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .build(); + ApiFuture future = messagingClient.setIamPolicyCallable().futureCall(request); + // Do something. + Policy response = future.get(); + } + } +} +// [END localhost7469_v1beta1_generated_Messaging_SetIamPolicy_async] diff --git a/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/messaging/setiampolicy/SyncSetIamPolicy.java b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/messaging/setiampolicy/SyncSetIamPolicy.java new file mode 100644 index 0000000000..78cb196c09 --- /dev/null +++ b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/messaging/setiampolicy/SyncSetIamPolicy.java @@ -0,0 +1,49 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.samples; + +// [START localhost7469_v1beta1_generated_Messaging_SetIamPolicy_sync] +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.protobuf.FieldMask; +import com.google.showcase.v1beta1.BlurbName; +import com.google.showcase.v1beta1.MessagingClient; + +public class SyncSetIamPolicy { + + public static void main(String[] args) throws Exception { + syncSetIamPolicy(); + } + + public static void syncSetIamPolicy() 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 (MessagingClient messagingClient = MessagingClient.create()) { + SetIamPolicyRequest request = + SetIamPolicyRequest.newBuilder() + .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString()) + .setPolicy(Policy.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .build(); + Policy response = messagingClient.setIamPolicy(request); + } + } +} +// [END localhost7469_v1beta1_generated_Messaging_SetIamPolicy_sync] diff --git a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/streamblurbs/AsyncStreamBlurbs.java b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/messaging/streamblurbs/AsyncStreamBlurbs.java similarity index 98% rename from showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/streamblurbs/AsyncStreamBlurbs.java rename to java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/messaging/streamblurbs/AsyncStreamBlurbs.java index 22d85305d4..2f10b869e6 100644 --- a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/streamblurbs/AsyncStreamBlurbs.java +++ b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/messaging/streamblurbs/AsyncStreamBlurbs.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/messaging/testiampermissions/AsyncTestIamPermissions.java b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/messaging/testiampermissions/AsyncTestIamPermissions.java new file mode 100644 index 0000000000..b4f7cea043 --- /dev/null +++ b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/messaging/testiampermissions/AsyncTestIamPermissions.java @@ -0,0 +1,52 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.samples; + +// [START localhost7469_v1beta1_generated_Messaging_TestIamPermissions_async] +import com.google.api.core.ApiFuture; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.showcase.v1beta1.BlurbName; +import com.google.showcase.v1beta1.MessagingClient; +import java.util.ArrayList; + +public class AsyncTestIamPermissions { + + public static void main(String[] args) throws Exception { + asyncTestIamPermissions(); + } + + public static void asyncTestIamPermissions() 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 (MessagingClient messagingClient = MessagingClient.create()) { + TestIamPermissionsRequest request = + TestIamPermissionsRequest.newBuilder() + .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString()) + .addAllPermissions(new ArrayList()) + .build(); + ApiFuture future = + messagingClient.testIamPermissionsCallable().futureCall(request); + // Do something. + TestIamPermissionsResponse response = future.get(); + } + } +} +// [END localhost7469_v1beta1_generated_Messaging_TestIamPermissions_async] diff --git a/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/messaging/testiampermissions/SyncTestIamPermissions.java b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/messaging/testiampermissions/SyncTestIamPermissions.java new file mode 100644 index 0000000000..27d165c2b1 --- /dev/null +++ b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/messaging/testiampermissions/SyncTestIamPermissions.java @@ -0,0 +1,48 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.samples; + +// [START localhost7469_v1beta1_generated_Messaging_TestIamPermissions_sync] +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.showcase.v1beta1.BlurbName; +import com.google.showcase.v1beta1.MessagingClient; +import java.util.ArrayList; + +public class SyncTestIamPermissions { + + public static void main(String[] args) throws Exception { + syncTestIamPermissions(); + } + + public static void syncTestIamPermissions() 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 (MessagingClient messagingClient = MessagingClient.create()) { + TestIamPermissionsRequest request = + TestIamPermissionsRequest.newBuilder() + .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString()) + .addAllPermissions(new ArrayList()) + .build(); + TestIamPermissionsResponse response = messagingClient.testIamPermissions(request); + } + } +} +// [END localhost7469_v1beta1_generated_Messaging_TestIamPermissions_sync] diff --git a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/updateblurb/AsyncUpdateBlurb.java b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/messaging/updateblurb/AsyncUpdateBlurb.java similarity index 98% rename from showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/updateblurb/AsyncUpdateBlurb.java rename to java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/messaging/updateblurb/AsyncUpdateBlurb.java index 5f26fbdccc..599e7ab0b6 100644 --- a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/updateblurb/AsyncUpdateBlurb.java +++ b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/messaging/updateblurb/AsyncUpdateBlurb.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/updateblurb/SyncUpdateBlurb.java b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/messaging/updateblurb/SyncUpdateBlurb.java similarity index 98% rename from showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/updateblurb/SyncUpdateBlurb.java rename to java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/messaging/updateblurb/SyncUpdateBlurb.java index 415b326718..c14eb4dcc2 100644 --- a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/updateblurb/SyncUpdateBlurb.java +++ b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/messaging/updateblurb/SyncUpdateBlurb.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/updateroom/AsyncUpdateRoom.java b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/messaging/updateroom/AsyncUpdateRoom.java similarity index 98% rename from showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/updateroom/AsyncUpdateRoom.java rename to java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/messaging/updateroom/AsyncUpdateRoom.java index 6e7b19ad5c..c1dfa77100 100644 --- a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/updateroom/AsyncUpdateRoom.java +++ b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/messaging/updateroom/AsyncUpdateRoom.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/updateroom/SyncUpdateRoom.java b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/messaging/updateroom/SyncUpdateRoom.java similarity index 98% rename from showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/updateroom/SyncUpdateRoom.java rename to java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/messaging/updateroom/SyncUpdateRoom.java index 915b84c12e..cfa33857eb 100644 --- a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/updateroom/SyncUpdateRoom.java +++ b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/messaging/updateroom/SyncUpdateRoom.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/messagingsettings/createroom/SyncCreateRoom.java b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/messagingsettings/createroom/SyncCreateRoom.java new file mode 100644 index 0000000000..45d9e57c80 --- /dev/null +++ b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/messagingsettings/createroom/SyncCreateRoom.java @@ -0,0 +1,55 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.samples; + +// [START localhost7469_v1beta1_generated_MessagingSettings_CreateRoom_sync] +import com.google.showcase.v1beta1.MessagingSettings; +import java.time.Duration; + +public class SyncCreateRoom { + + public static void main(String[] args) throws Exception { + syncCreateRoom(); + } + + public static void syncCreateRoom() 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 + MessagingSettings.Builder messagingSettingsBuilder = MessagingSettings.newBuilder(); + messagingSettingsBuilder + .createRoomSettings() + .setRetrySettings( + messagingSettingsBuilder + .createRoomSettings() + .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()); + MessagingSettings messagingSettings = messagingSettingsBuilder.build(); + } +} +// [END localhost7469_v1beta1_generated_MessagingSettings_CreateRoom_sync] diff --git a/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/messagingsettings/searchblurbs/SyncSearchBlurbs.java b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/messagingsettings/searchblurbs/SyncSearchBlurbs.java new file mode 100644 index 0000000000..bc6ba379e9 --- /dev/null +++ b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/messagingsettings/searchblurbs/SyncSearchBlurbs.java @@ -0,0 +1,53 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.samples; + +// [START localhost7469_v1beta1_generated_MessagingSettings_SearchBlurbs_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.showcase.v1beta1.MessagingSettings; +import java.time.Duration; + +public class SyncSearchBlurbs { + + public static void main(String[] args) throws Exception { + syncSearchBlurbs(); + } + + public static void syncSearchBlurbs() 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 + MessagingSettings.Builder messagingSettingsBuilder = MessagingSettings.newBuilder(); + TimedRetryAlgorithm timedRetryAlgorithm = + OperationalTimedPollAlgorithm.create( + RetrySettings.newBuilder() + .setInitialRetryDelayDuration(Duration.ofMillis(500)) + .setRetryDelayMultiplier(1.5) + .setMaxRetryDelayDuration(Duration.ofMillis(5000)) + .setTotalTimeoutDuration(Duration.ofHours(24)) + .build()); + messagingSettingsBuilder + .createClusterOperationSettings() + .setPollingAlgorithm(timedRetryAlgorithm) + .build(); + } +} +// [END localhost7469_v1beta1_generated_MessagingSettings_SearchBlurbs_sync] diff --git a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/sequenceservice/attemptsequence/AsyncAttemptSequence.java b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/sequenceservice/attemptsequence/AsyncAttemptSequence.java similarity index 98% rename from showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/sequenceservice/attemptsequence/AsyncAttemptSequence.java rename to java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/sequenceservice/attemptsequence/AsyncAttemptSequence.java index b8cbd41577..2186528780 100644 --- a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/sequenceservice/attemptsequence/AsyncAttemptSequence.java +++ b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/sequenceservice/attemptsequence/AsyncAttemptSequence.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/sequenceservice/attemptsequence/SyncAttemptSequence.java b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/sequenceservice/attemptsequence/SyncAttemptSequence.java similarity index 98% rename from showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/sequenceservice/attemptsequence/SyncAttemptSequence.java rename to java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/sequenceservice/attemptsequence/SyncAttemptSequence.java index 3d6637e455..2d421c3bba 100644 --- a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/sequenceservice/attemptsequence/SyncAttemptSequence.java +++ b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/sequenceservice/attemptsequence/SyncAttemptSequence.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/sequenceservice/attemptsequence/SyncAttemptSequenceSequencename.java b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/sequenceservice/attemptsequence/SyncAttemptSequenceSequencename.java similarity index 98% rename from showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/sequenceservice/attemptsequence/SyncAttemptSequenceSequencename.java rename to java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/sequenceservice/attemptsequence/SyncAttemptSequenceSequencename.java index 0e9a0ff985..2be8988548 100644 --- a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/sequenceservice/attemptsequence/SyncAttemptSequenceSequencename.java +++ b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/sequenceservice/attemptsequence/SyncAttemptSequenceSequencename.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/sequenceservice/attemptsequence/SyncAttemptSequenceString.java b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/sequenceservice/attemptsequence/SyncAttemptSequenceString.java similarity index 98% rename from showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/sequenceservice/attemptsequence/SyncAttemptSequenceString.java rename to java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/sequenceservice/attemptsequence/SyncAttemptSequenceString.java index cfc94a15c6..eaa9a36520 100644 --- a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/sequenceservice/attemptsequence/SyncAttemptSequenceString.java +++ b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/sequenceservice/attemptsequence/SyncAttemptSequenceString.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/sequenceservice/attemptstreamingsequence/AsyncAttemptStreamingSequence.java b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/sequenceservice/attemptstreamingsequence/AsyncAttemptStreamingSequence.java new file mode 100644 index 0000000000..e724a29e78 --- /dev/null +++ b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/sequenceservice/attemptstreamingsequence/AsyncAttemptStreamingSequence.java @@ -0,0 +1,52 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.samples; + +// [START localhost7469_v1beta1_generated_SequenceService_AttemptStreamingSequence_async] +import com.google.api.gax.rpc.ServerStream; +import com.google.showcase.v1beta1.AttemptStreamingSequenceRequest; +import com.google.showcase.v1beta1.AttemptStreamingSequenceResponse; +import com.google.showcase.v1beta1.SequenceServiceClient; +import com.google.showcase.v1beta1.StreamingSequenceName; + +public class AsyncAttemptStreamingSequence { + + public static void main(String[] args) throws Exception { + asyncAttemptStreamingSequence(); + } + + public static void asyncAttemptStreamingSequence() 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 (SequenceServiceClient sequenceServiceClient = SequenceServiceClient.create()) { + AttemptStreamingSequenceRequest request = + AttemptStreamingSequenceRequest.newBuilder() + .setName(StreamingSequenceName.of("[STREAMING_SEQUENCE]").toString()) + .setLastFailIndex(2006482362) + .build(); + ServerStream stream = + sequenceServiceClient.attemptStreamingSequenceCallable().call(request); + for (AttemptStreamingSequenceResponse response : stream) { + // Do something when a response is received. + } + } + } +} +// [END localhost7469_v1beta1_generated_SequenceService_AttemptStreamingSequence_async] diff --git a/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/sequenceservice/create/SyncCreateSetCredentialsProvider.java b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/sequenceservice/create/SyncCreateSetCredentialsProvider.java new file mode 100644 index 0000000000..3300a1ebdb --- /dev/null +++ b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/sequenceservice/create/SyncCreateSetCredentialsProvider.java @@ -0,0 +1,45 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.samples; + +// [START localhost7469_v1beta1_generated_SequenceService_Create_SetCredentialsProvider_sync] +import com.google.api.gax.core.FixedCredentialsProvider; +import com.google.showcase.v1beta1.SequenceServiceClient; +import com.google.showcase.v1beta1.SequenceServiceSettings; +import com.google.showcase.v1beta1.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 + SequenceServiceSettings sequenceServiceSettings = + SequenceServiceSettings.newBuilder() + .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials)) + .build(); + SequenceServiceClient sequenceServiceClient = + SequenceServiceClient.create(sequenceServiceSettings); + } +} +// [END localhost7469_v1beta1_generated_SequenceService_Create_SetCredentialsProvider_sync] diff --git a/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/sequenceservice/create/SyncCreateSetEndpoint.java b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/sequenceservice/create/SyncCreateSetEndpoint.java new file mode 100644 index 0000000000..5f553a37d2 --- /dev/null +++ b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/sequenceservice/create/SyncCreateSetEndpoint.java @@ -0,0 +1,42 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.samples; + +// [START localhost7469_v1beta1_generated_SequenceService_Create_SetEndpoint_sync] +import com.google.showcase.v1beta1.SequenceServiceClient; +import com.google.showcase.v1beta1.SequenceServiceSettings; +import com.google.showcase.v1beta1.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 + SequenceServiceSettings sequenceServiceSettings = + SequenceServiceSettings.newBuilder().setEndpoint(myEndpoint).build(); + SequenceServiceClient sequenceServiceClient = + SequenceServiceClient.create(sequenceServiceSettings); + } +} +// [END localhost7469_v1beta1_generated_SequenceService_Create_SetEndpoint_sync] diff --git a/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/sequenceservice/create/SyncCreateUseHttpJsonTransport.java b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/sequenceservice/create/SyncCreateUseHttpJsonTransport.java new file mode 100644 index 0000000000..facfcf8966 --- /dev/null +++ b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/sequenceservice/create/SyncCreateUseHttpJsonTransport.java @@ -0,0 +1,41 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.samples; + +// [START localhost7469_v1beta1_generated_SequenceService_Create_UseHttpJsonTransport_sync] +import com.google.showcase.v1beta1.SequenceServiceClient; +import com.google.showcase.v1beta1.SequenceServiceSettings; + +public class SyncCreateUseHttpJsonTransport { + + public static void main(String[] args) throws Exception { + syncCreateUseHttpJsonTransport(); + } + + public static void syncCreateUseHttpJsonTransport() 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 + SequenceServiceSettings sequenceServiceSettings = + SequenceServiceSettings.newHttpJsonBuilder().build(); + SequenceServiceClient sequenceServiceClient = + SequenceServiceClient.create(sequenceServiceSettings); + } +} +// [END localhost7469_v1beta1_generated_SequenceService_Create_UseHttpJsonTransport_sync] diff --git a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/sequenceservice/createsequence/AsyncCreateSequence.java b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/sequenceservice/createsequence/AsyncCreateSequence.java similarity index 98% rename from showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/sequenceservice/createsequence/AsyncCreateSequence.java rename to java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/sequenceservice/createsequence/AsyncCreateSequence.java index 75bd7fdd4a..8f24a14aa3 100644 --- a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/sequenceservice/createsequence/AsyncCreateSequence.java +++ b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/sequenceservice/createsequence/AsyncCreateSequence.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/sequenceservice/createsequence/SyncCreateSequence.java b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/sequenceservice/createsequence/SyncCreateSequence.java new file mode 100644 index 0000000000..e9d5dc5b45 --- /dev/null +++ b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/sequenceservice/createsequence/SyncCreateSequence.java @@ -0,0 +1,43 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.samples; + +// [START localhost7469_v1beta1_generated_SequenceService_CreateSequence_sync] +import com.google.showcase.v1beta1.CreateSequenceRequest; +import com.google.showcase.v1beta1.Sequence; +import com.google.showcase.v1beta1.SequenceServiceClient; + +public class SyncCreateSequence { + + public static void main(String[] args) throws Exception { + syncCreateSequence(); + } + + public static void syncCreateSequence() 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 (SequenceServiceClient sequenceServiceClient = SequenceServiceClient.create()) { + CreateSequenceRequest request = + CreateSequenceRequest.newBuilder().setSequence(Sequence.newBuilder().build()).build(); + Sequence response = sequenceServiceClient.createSequence(request); + } + } +} +// [END localhost7469_v1beta1_generated_SequenceService_CreateSequence_sync] diff --git a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/sequenceservice/createsequence/SyncCreateSequenceSequence.java b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/sequenceservice/createsequence/SyncCreateSequenceSequence.java similarity index 98% rename from showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/sequenceservice/createsequence/SyncCreateSequenceSequence.java rename to java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/sequenceservice/createsequence/SyncCreateSequenceSequence.java index 857cf07c55..2521c353d6 100644 --- a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/sequenceservice/createsequence/SyncCreateSequenceSequence.java +++ b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/sequenceservice/createsequence/SyncCreateSequenceSequence.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/sequenceservice/createstreamingsequence/AsyncCreateStreamingSequence.java b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/sequenceservice/createstreamingsequence/AsyncCreateStreamingSequence.java new file mode 100644 index 0000000000..981fa6d225 --- /dev/null +++ b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/sequenceservice/createstreamingsequence/AsyncCreateStreamingSequence.java @@ -0,0 +1,49 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.samples; + +// [START localhost7469_v1beta1_generated_SequenceService_CreateStreamingSequence_async] +import com.google.api.core.ApiFuture; +import com.google.showcase.v1beta1.CreateStreamingSequenceRequest; +import com.google.showcase.v1beta1.SequenceServiceClient; +import com.google.showcase.v1beta1.StreamingSequence; + +public class AsyncCreateStreamingSequence { + + public static void main(String[] args) throws Exception { + asyncCreateStreamingSequence(); + } + + public static void asyncCreateStreamingSequence() 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 (SequenceServiceClient sequenceServiceClient = SequenceServiceClient.create()) { + CreateStreamingSequenceRequest request = + CreateStreamingSequenceRequest.newBuilder() + .setStreamingSequence(StreamingSequence.newBuilder().build()) + .build(); + ApiFuture future = + sequenceServiceClient.createStreamingSequenceCallable().futureCall(request); + // Do something. + StreamingSequence response = future.get(); + } + } +} +// [END localhost7469_v1beta1_generated_SequenceService_CreateStreamingSequence_async] diff --git a/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/sequenceservice/createstreamingsequence/SyncCreateStreamingSequence.java b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/sequenceservice/createstreamingsequence/SyncCreateStreamingSequence.java new file mode 100644 index 0000000000..4c1f24a15f --- /dev/null +++ b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/sequenceservice/createstreamingsequence/SyncCreateStreamingSequence.java @@ -0,0 +1,45 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.samples; + +// [START localhost7469_v1beta1_generated_SequenceService_CreateStreamingSequence_sync] +import com.google.showcase.v1beta1.CreateStreamingSequenceRequest; +import com.google.showcase.v1beta1.SequenceServiceClient; +import com.google.showcase.v1beta1.StreamingSequence; + +public class SyncCreateStreamingSequence { + + public static void main(String[] args) throws Exception { + syncCreateStreamingSequence(); + } + + public static void syncCreateStreamingSequence() 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 (SequenceServiceClient sequenceServiceClient = SequenceServiceClient.create()) { + CreateStreamingSequenceRequest request = + CreateStreamingSequenceRequest.newBuilder() + .setStreamingSequence(StreamingSequence.newBuilder().build()) + .build(); + StreamingSequence response = sequenceServiceClient.createStreamingSequence(request); + } + } +} +// [END localhost7469_v1beta1_generated_SequenceService_CreateStreamingSequence_sync] diff --git a/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/sequenceservice/createstreamingsequence/SyncCreateStreamingSequenceStreamingsequence.java b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/sequenceservice/createstreamingsequence/SyncCreateStreamingSequenceStreamingsequence.java new file mode 100644 index 0000000000..4cad0d1538 --- /dev/null +++ b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/sequenceservice/createstreamingsequence/SyncCreateStreamingSequenceStreamingsequence.java @@ -0,0 +1,41 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.samples; + +// [START localhost7469_v1beta1_generated_SequenceService_CreateStreamingSequence_Streamingsequence_sync] +import com.google.showcase.v1beta1.SequenceServiceClient; +import com.google.showcase.v1beta1.StreamingSequence; + +public class SyncCreateStreamingSequenceStreamingsequence { + + public static void main(String[] args) throws Exception { + syncCreateStreamingSequenceStreamingsequence(); + } + + public static void syncCreateStreamingSequenceStreamingsequence() 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 (SequenceServiceClient sequenceServiceClient = SequenceServiceClient.create()) { + StreamingSequence streamingSequence = StreamingSequence.newBuilder().build(); + StreamingSequence response = sequenceServiceClient.createStreamingSequence(streamingSequence); + } + } +} +// [END localhost7469_v1beta1_generated_SequenceService_CreateStreamingSequence_Streamingsequence_sync] diff --git a/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/sequenceservice/getiampolicy/AsyncGetIamPolicy.java b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/sequenceservice/getiampolicy/AsyncGetIamPolicy.java new file mode 100644 index 0000000000..17b1b2ab0b --- /dev/null +++ b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/sequenceservice/getiampolicy/AsyncGetIamPolicy.java @@ -0,0 +1,51 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.samples; + +// [START localhost7469_v1beta1_generated_SequenceService_GetIamPolicy_async] +import com.google.api.core.ApiFuture; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.GetPolicyOptions; +import com.google.iam.v1.Policy; +import com.google.showcase.v1beta1.BlurbName; +import com.google.showcase.v1beta1.SequenceServiceClient; + +public class AsyncGetIamPolicy { + + public static void main(String[] args) throws Exception { + asyncGetIamPolicy(); + } + + public static void asyncGetIamPolicy() 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 (SequenceServiceClient sequenceServiceClient = SequenceServiceClient.create()) { + GetIamPolicyRequest request = + GetIamPolicyRequest.newBuilder() + .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString()) + .setOptions(GetPolicyOptions.newBuilder().build()) + .build(); + ApiFuture future = sequenceServiceClient.getIamPolicyCallable().futureCall(request); + // Do something. + Policy response = future.get(); + } + } +} +// [END localhost7469_v1beta1_generated_SequenceService_GetIamPolicy_async] diff --git a/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/sequenceservice/getiampolicy/SyncGetIamPolicy.java b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/sequenceservice/getiampolicy/SyncGetIamPolicy.java new file mode 100644 index 0000000000..16d6246dff --- /dev/null +++ b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/sequenceservice/getiampolicy/SyncGetIamPolicy.java @@ -0,0 +1,48 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.samples; + +// [START localhost7469_v1beta1_generated_SequenceService_GetIamPolicy_sync] +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.GetPolicyOptions; +import com.google.iam.v1.Policy; +import com.google.showcase.v1beta1.BlurbName; +import com.google.showcase.v1beta1.SequenceServiceClient; + +public class SyncGetIamPolicy { + + public static void main(String[] args) throws Exception { + syncGetIamPolicy(); + } + + public static void syncGetIamPolicy() 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 (SequenceServiceClient sequenceServiceClient = SequenceServiceClient.create()) { + GetIamPolicyRequest request = + GetIamPolicyRequest.newBuilder() + .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString()) + .setOptions(GetPolicyOptions.newBuilder().build()) + .build(); + Policy response = sequenceServiceClient.getIamPolicy(request); + } + } +} +// [END localhost7469_v1beta1_generated_SequenceService_GetIamPolicy_sync] diff --git a/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/sequenceservice/getlocation/AsyncGetLocation.java b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/sequenceservice/getlocation/AsyncGetLocation.java new file mode 100644 index 0000000000..1fb0b1d461 --- /dev/null +++ b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/sequenceservice/getlocation/AsyncGetLocation.java @@ -0,0 +1,45 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.samples; + +// [START localhost7469_v1beta1_generated_SequenceService_GetLocation_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.Location; +import com.google.showcase.v1beta1.SequenceServiceClient; + +public class AsyncGetLocation { + + public static void main(String[] args) throws Exception { + asyncGetLocation(); + } + + public static void asyncGetLocation() 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 (SequenceServiceClient sequenceServiceClient = SequenceServiceClient.create()) { + GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build(); + ApiFuture future = sequenceServiceClient.getLocationCallable().futureCall(request); + // Do something. + Location response = future.get(); + } + } +} +// [END localhost7469_v1beta1_generated_SequenceService_GetLocation_async] diff --git a/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/sequenceservice/getlocation/SyncGetLocation.java b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/sequenceservice/getlocation/SyncGetLocation.java new file mode 100644 index 0000000000..a35cbd597f --- /dev/null +++ b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/sequenceservice/getlocation/SyncGetLocation.java @@ -0,0 +1,42 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.samples; + +// [START localhost7469_v1beta1_generated_SequenceService_GetLocation_sync] +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.Location; +import com.google.showcase.v1beta1.SequenceServiceClient; + +public class SyncGetLocation { + + public static void main(String[] args) throws Exception { + syncGetLocation(); + } + + public static void syncGetLocation() 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 (SequenceServiceClient sequenceServiceClient = SequenceServiceClient.create()) { + GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build(); + Location response = sequenceServiceClient.getLocation(request); + } + } +} +// [END localhost7469_v1beta1_generated_SequenceService_GetLocation_sync] diff --git a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/sequenceservice/getsequencereport/AsyncGetSequenceReport.java b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/sequenceservice/getsequencereport/AsyncGetSequenceReport.java similarity index 98% rename from showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/sequenceservice/getsequencereport/AsyncGetSequenceReport.java rename to java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/sequenceservice/getsequencereport/AsyncGetSequenceReport.java index 98e96691d7..ab00817499 100644 --- a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/sequenceservice/getsequencereport/AsyncGetSequenceReport.java +++ b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/sequenceservice/getsequencereport/AsyncGetSequenceReport.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/sequenceservice/getsequencereport/SyncGetSequenceReport.java b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/sequenceservice/getsequencereport/SyncGetSequenceReport.java similarity index 98% rename from showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/sequenceservice/getsequencereport/SyncGetSequenceReport.java rename to java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/sequenceservice/getsequencereport/SyncGetSequenceReport.java index 703ffb36fc..35b6a573db 100644 --- a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/sequenceservice/getsequencereport/SyncGetSequenceReport.java +++ b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/sequenceservice/getsequencereport/SyncGetSequenceReport.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/sequenceservice/getsequencereport/SyncGetSequenceReportSequencereportname.java b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/sequenceservice/getsequencereport/SyncGetSequenceReportSequencereportname.java similarity index 98% rename from showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/sequenceservice/getsequencereport/SyncGetSequenceReportSequencereportname.java rename to java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/sequenceservice/getsequencereport/SyncGetSequenceReportSequencereportname.java index d40653efc3..707964cbdc 100644 --- a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/sequenceservice/getsequencereport/SyncGetSequenceReportSequencereportname.java +++ b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/sequenceservice/getsequencereport/SyncGetSequenceReportSequencereportname.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/sequenceservice/getsequencereport/SyncGetSequenceReportString.java b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/sequenceservice/getsequencereport/SyncGetSequenceReportString.java similarity index 98% rename from showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/sequenceservice/getsequencereport/SyncGetSequenceReportString.java rename to java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/sequenceservice/getsequencereport/SyncGetSequenceReportString.java index f0ac090a1f..ddac8f1d08 100644 --- a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/sequenceservice/getsequencereport/SyncGetSequenceReportString.java +++ b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/sequenceservice/getsequencereport/SyncGetSequenceReportString.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/sequenceservice/getstreamingsequencereport/AsyncGetStreamingSequenceReport.java b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/sequenceservice/getstreamingsequencereport/AsyncGetStreamingSequenceReport.java new file mode 100644 index 0000000000..144fd40013 --- /dev/null +++ b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/sequenceservice/getstreamingsequencereport/AsyncGetStreamingSequenceReport.java @@ -0,0 +1,50 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.samples; + +// [START localhost7469_v1beta1_generated_SequenceService_GetStreamingSequenceReport_async] +import com.google.api.core.ApiFuture; +import com.google.showcase.v1beta1.GetStreamingSequenceReportRequest; +import com.google.showcase.v1beta1.SequenceServiceClient; +import com.google.showcase.v1beta1.StreamingSequenceReport; +import com.google.showcase.v1beta1.StreamingSequenceReportName; + +public class AsyncGetStreamingSequenceReport { + + public static void main(String[] args) throws Exception { + asyncGetStreamingSequenceReport(); + } + + public static void asyncGetStreamingSequenceReport() 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 (SequenceServiceClient sequenceServiceClient = SequenceServiceClient.create()) { + GetStreamingSequenceReportRequest request = + GetStreamingSequenceReportRequest.newBuilder() + .setName(StreamingSequenceReportName.of("[STREAMING_SEQUENCE]").toString()) + .build(); + ApiFuture future = + sequenceServiceClient.getStreamingSequenceReportCallable().futureCall(request); + // Do something. + StreamingSequenceReport response = future.get(); + } + } +} +// [END localhost7469_v1beta1_generated_SequenceService_GetStreamingSequenceReport_async] diff --git a/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/sequenceservice/getstreamingsequencereport/SyncGetStreamingSequenceReport.java b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/sequenceservice/getstreamingsequencereport/SyncGetStreamingSequenceReport.java new file mode 100644 index 0000000000..3e7812ae39 --- /dev/null +++ b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/sequenceservice/getstreamingsequencereport/SyncGetStreamingSequenceReport.java @@ -0,0 +1,46 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.samples; + +// [START localhost7469_v1beta1_generated_SequenceService_GetStreamingSequenceReport_sync] +import com.google.showcase.v1beta1.GetStreamingSequenceReportRequest; +import com.google.showcase.v1beta1.SequenceServiceClient; +import com.google.showcase.v1beta1.StreamingSequenceReport; +import com.google.showcase.v1beta1.StreamingSequenceReportName; + +public class SyncGetStreamingSequenceReport { + + public static void main(String[] args) throws Exception { + syncGetStreamingSequenceReport(); + } + + public static void syncGetStreamingSequenceReport() 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 (SequenceServiceClient sequenceServiceClient = SequenceServiceClient.create()) { + GetStreamingSequenceReportRequest request = + GetStreamingSequenceReportRequest.newBuilder() + .setName(StreamingSequenceReportName.of("[STREAMING_SEQUENCE]").toString()) + .build(); + StreamingSequenceReport response = sequenceServiceClient.getStreamingSequenceReport(request); + } + } +} +// [END localhost7469_v1beta1_generated_SequenceService_GetStreamingSequenceReport_sync] diff --git a/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/sequenceservice/getstreamingsequencereport/SyncGetStreamingSequenceReportStreamingsequencereportname.java b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/sequenceservice/getstreamingsequencereport/SyncGetStreamingSequenceReportStreamingsequencereportname.java new file mode 100644 index 0000000000..4d4592c70b --- /dev/null +++ b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/sequenceservice/getstreamingsequencereport/SyncGetStreamingSequenceReportStreamingsequencereportname.java @@ -0,0 +1,42 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.samples; + +// [START localhost7469_v1beta1_generated_SequenceService_GetStreamingSequenceReport_Streamingsequencereportname_sync] +import com.google.showcase.v1beta1.SequenceServiceClient; +import com.google.showcase.v1beta1.StreamingSequenceReport; +import com.google.showcase.v1beta1.StreamingSequenceReportName; + +public class SyncGetStreamingSequenceReportStreamingsequencereportname { + + public static void main(String[] args) throws Exception { + syncGetStreamingSequenceReportStreamingsequencereportname(); + } + + public static void syncGetStreamingSequenceReportStreamingsequencereportname() 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 (SequenceServiceClient sequenceServiceClient = SequenceServiceClient.create()) { + StreamingSequenceReportName name = StreamingSequenceReportName.of("[STREAMING_SEQUENCE]"); + StreamingSequenceReport response = sequenceServiceClient.getStreamingSequenceReport(name); + } + } +} +// [END localhost7469_v1beta1_generated_SequenceService_GetStreamingSequenceReport_Streamingsequencereportname_sync] diff --git a/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/sequenceservice/getstreamingsequencereport/SyncGetStreamingSequenceReportString.java b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/sequenceservice/getstreamingsequencereport/SyncGetStreamingSequenceReportString.java new file mode 100644 index 0000000000..fb3de6b3b4 --- /dev/null +++ b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/sequenceservice/getstreamingsequencereport/SyncGetStreamingSequenceReportString.java @@ -0,0 +1,42 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.samples; + +// [START localhost7469_v1beta1_generated_SequenceService_GetStreamingSequenceReport_String_sync] +import com.google.showcase.v1beta1.SequenceServiceClient; +import com.google.showcase.v1beta1.StreamingSequenceReport; +import com.google.showcase.v1beta1.StreamingSequenceReportName; + +public class SyncGetStreamingSequenceReportString { + + public static void main(String[] args) throws Exception { + syncGetStreamingSequenceReportString(); + } + + public static void syncGetStreamingSequenceReportString() 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 (SequenceServiceClient sequenceServiceClient = SequenceServiceClient.create()) { + String name = StreamingSequenceReportName.of("[STREAMING_SEQUENCE]").toString(); + StreamingSequenceReport response = sequenceServiceClient.getStreamingSequenceReport(name); + } + } +} +// [END localhost7469_v1beta1_generated_SequenceService_GetStreamingSequenceReport_String_sync] diff --git a/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/sequenceservice/listlocations/AsyncListLocations.java b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/sequenceservice/listlocations/AsyncListLocations.java new file mode 100644 index 0000000000..72d91dc5da --- /dev/null +++ b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/sequenceservice/listlocations/AsyncListLocations.java @@ -0,0 +1,54 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.samples; + +// [START localhost7469_v1beta1_generated_SequenceService_ListLocations_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.Location; +import com.google.showcase.v1beta1.SequenceServiceClient; + +public class AsyncListLocations { + + public static void main(String[] args) throws Exception { + asyncListLocations(); + } + + public static void asyncListLocations() 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 (SequenceServiceClient sequenceServiceClient = SequenceServiceClient.create()) { + ListLocationsRequest request = + ListLocationsRequest.newBuilder() + .setName("name3373707") + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + ApiFuture future = + sequenceServiceClient.listLocationsPagedCallable().futureCall(request); + // Do something. + for (Location element : future.get().iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END localhost7469_v1beta1_generated_SequenceService_ListLocations_async] diff --git a/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/sequenceservice/listlocations/AsyncListLocationsPaged.java b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/sequenceservice/listlocations/AsyncListLocationsPaged.java new file mode 100644 index 0000000000..684375c087 --- /dev/null +++ b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/sequenceservice/listlocations/AsyncListLocationsPaged.java @@ -0,0 +1,62 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.samples; + +// [START localhost7469_v1beta1_generated_SequenceService_ListLocations_Paged_async] +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.common.base.Strings; +import com.google.showcase.v1beta1.SequenceServiceClient; + +public class AsyncListLocationsPaged { + + public static void main(String[] args) throws Exception { + asyncListLocationsPaged(); + } + + public static void asyncListLocationsPaged() 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 (SequenceServiceClient sequenceServiceClient = SequenceServiceClient.create()) { + ListLocationsRequest request = + ListLocationsRequest.newBuilder() + .setName("name3373707") + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + while (true) { + ListLocationsResponse response = + sequenceServiceClient.listLocationsCallable().call(request); + for (Location element : response.getLocationsList()) { + // doThingsWith(element); + } + String nextPageToken = response.getNextPageToken(); + if (!Strings.isNullOrEmpty(nextPageToken)) { + request = request.toBuilder().setPageToken(nextPageToken).build(); + } else { + break; + } + } + } + } +} +// [END localhost7469_v1beta1_generated_SequenceService_ListLocations_Paged_async] diff --git a/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/sequenceservice/listlocations/SyncListLocations.java b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/sequenceservice/listlocations/SyncListLocations.java new file mode 100644 index 0000000000..0dcb4868ee --- /dev/null +++ b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/sequenceservice/listlocations/SyncListLocations.java @@ -0,0 +1,50 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.samples; + +// [START localhost7469_v1beta1_generated_SequenceService_ListLocations_sync] +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.Location; +import com.google.showcase.v1beta1.SequenceServiceClient; + +public class SyncListLocations { + + public static void main(String[] args) throws Exception { + syncListLocations(); + } + + public static void syncListLocations() 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 (SequenceServiceClient sequenceServiceClient = SequenceServiceClient.create()) { + ListLocationsRequest request = + ListLocationsRequest.newBuilder() + .setName("name3373707") + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + for (Location element : sequenceServiceClient.listLocations(request).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END localhost7469_v1beta1_generated_SequenceService_ListLocations_sync] diff --git a/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/sequenceservice/setiampolicy/AsyncSetIamPolicy.java b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/sequenceservice/setiampolicy/AsyncSetIamPolicy.java new file mode 100644 index 0000000000..15e16a4e8c --- /dev/null +++ b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/sequenceservice/setiampolicy/AsyncSetIamPolicy.java @@ -0,0 +1,52 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.samples; + +// [START localhost7469_v1beta1_generated_SequenceService_SetIamPolicy_async] +import com.google.api.core.ApiFuture; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.protobuf.FieldMask; +import com.google.showcase.v1beta1.BlurbName; +import com.google.showcase.v1beta1.SequenceServiceClient; + +public class AsyncSetIamPolicy { + + public static void main(String[] args) throws Exception { + asyncSetIamPolicy(); + } + + public static void asyncSetIamPolicy() 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 (SequenceServiceClient sequenceServiceClient = SequenceServiceClient.create()) { + SetIamPolicyRequest request = + SetIamPolicyRequest.newBuilder() + .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString()) + .setPolicy(Policy.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .build(); + ApiFuture future = sequenceServiceClient.setIamPolicyCallable().futureCall(request); + // Do something. + Policy response = future.get(); + } + } +} +// [END localhost7469_v1beta1_generated_SequenceService_SetIamPolicy_async] diff --git a/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/sequenceservice/setiampolicy/SyncSetIamPolicy.java b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/sequenceservice/setiampolicy/SyncSetIamPolicy.java new file mode 100644 index 0000000000..4ade9c845a --- /dev/null +++ b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/sequenceservice/setiampolicy/SyncSetIamPolicy.java @@ -0,0 +1,49 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.samples; + +// [START localhost7469_v1beta1_generated_SequenceService_SetIamPolicy_sync] +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.protobuf.FieldMask; +import com.google.showcase.v1beta1.BlurbName; +import com.google.showcase.v1beta1.SequenceServiceClient; + +public class SyncSetIamPolicy { + + public static void main(String[] args) throws Exception { + syncSetIamPolicy(); + } + + public static void syncSetIamPolicy() 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 (SequenceServiceClient sequenceServiceClient = SequenceServiceClient.create()) { + SetIamPolicyRequest request = + SetIamPolicyRequest.newBuilder() + .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString()) + .setPolicy(Policy.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .build(); + Policy response = sequenceServiceClient.setIamPolicy(request); + } + } +} +// [END localhost7469_v1beta1_generated_SequenceService_SetIamPolicy_sync] diff --git a/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/sequenceservice/testiampermissions/AsyncTestIamPermissions.java b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/sequenceservice/testiampermissions/AsyncTestIamPermissions.java new file mode 100644 index 0000000000..05a54c6165 --- /dev/null +++ b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/sequenceservice/testiampermissions/AsyncTestIamPermissions.java @@ -0,0 +1,52 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.samples; + +// [START localhost7469_v1beta1_generated_SequenceService_TestIamPermissions_async] +import com.google.api.core.ApiFuture; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.showcase.v1beta1.BlurbName; +import com.google.showcase.v1beta1.SequenceServiceClient; +import java.util.ArrayList; + +public class AsyncTestIamPermissions { + + public static void main(String[] args) throws Exception { + asyncTestIamPermissions(); + } + + public static void asyncTestIamPermissions() 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 (SequenceServiceClient sequenceServiceClient = SequenceServiceClient.create()) { + TestIamPermissionsRequest request = + TestIamPermissionsRequest.newBuilder() + .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString()) + .addAllPermissions(new ArrayList()) + .build(); + ApiFuture future = + sequenceServiceClient.testIamPermissionsCallable().futureCall(request); + // Do something. + TestIamPermissionsResponse response = future.get(); + } + } +} +// [END localhost7469_v1beta1_generated_SequenceService_TestIamPermissions_async] diff --git a/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/sequenceservice/testiampermissions/SyncTestIamPermissions.java b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/sequenceservice/testiampermissions/SyncTestIamPermissions.java new file mode 100644 index 0000000000..1c7b94affb --- /dev/null +++ b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/sequenceservice/testiampermissions/SyncTestIamPermissions.java @@ -0,0 +1,48 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.samples; + +// [START localhost7469_v1beta1_generated_SequenceService_TestIamPermissions_sync] +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.showcase.v1beta1.BlurbName; +import com.google.showcase.v1beta1.SequenceServiceClient; +import java.util.ArrayList; + +public class SyncTestIamPermissions { + + public static void main(String[] args) throws Exception { + syncTestIamPermissions(); + } + + public static void syncTestIamPermissions() 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 (SequenceServiceClient sequenceServiceClient = SequenceServiceClient.create()) { + TestIamPermissionsRequest request = + TestIamPermissionsRequest.newBuilder() + .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString()) + .addAllPermissions(new ArrayList()) + .build(); + TestIamPermissionsResponse response = sequenceServiceClient.testIamPermissions(request); + } + } +} +// [END localhost7469_v1beta1_generated_SequenceService_TestIamPermissions_sync] diff --git a/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/sequenceservicesettings/createsequence/SyncCreateSequence.java b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/sequenceservicesettings/createsequence/SyncCreateSequence.java new file mode 100644 index 0000000000..69065ed9b8 --- /dev/null +++ b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/sequenceservicesettings/createsequence/SyncCreateSequence.java @@ -0,0 +1,56 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.samples; + +// [START localhost7469_v1beta1_generated_SequenceServiceSettings_CreateSequence_sync] +import com.google.showcase.v1beta1.SequenceServiceSettings; +import java.time.Duration; + +public class SyncCreateSequence { + + public static void main(String[] args) throws Exception { + syncCreateSequence(); + } + + public static void syncCreateSequence() 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 + SequenceServiceSettings.Builder sequenceServiceSettingsBuilder = + SequenceServiceSettings.newBuilder(); + sequenceServiceSettingsBuilder + .createSequenceSettings() + .setRetrySettings( + sequenceServiceSettingsBuilder + .createSequenceSettings() + .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()); + SequenceServiceSettings sequenceServiceSettings = sequenceServiceSettingsBuilder.build(); + } +} +// [END localhost7469_v1beta1_generated_SequenceServiceSettings_CreateSequence_sync] diff --git a/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/stub/compliancestubsettings/repeatdatabody/SyncRepeatDataBody.java b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/stub/compliancestubsettings/repeatdatabody/SyncRepeatDataBody.java new file mode 100644 index 0000000000..bb3b573ae0 --- /dev/null +++ b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/stub/compliancestubsettings/repeatdatabody/SyncRepeatDataBody.java @@ -0,0 +1,55 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.stub.samples; + +// [START localhost7469_v1beta1_generated_ComplianceStubSettings_RepeatDataBody_sync] +import com.google.showcase.v1beta1.stub.ComplianceStubSettings; +import java.time.Duration; + +public class SyncRepeatDataBody { + + public static void main(String[] args) throws Exception { + syncRepeatDataBody(); + } + + public static void syncRepeatDataBody() 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 + ComplianceStubSettings.Builder complianceSettingsBuilder = ComplianceStubSettings.newBuilder(); + complianceSettingsBuilder + .repeatDataBodySettings() + .setRetrySettings( + complianceSettingsBuilder + .repeatDataBodySettings() + .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()); + ComplianceStubSettings complianceSettings = complianceSettingsBuilder.build(); + } +} +// [END localhost7469_v1beta1_generated_ComplianceStubSettings_RepeatDataBody_sync] diff --git a/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/stub/echostubsettings/echo/SyncEcho.java b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/stub/echostubsettings/echo/SyncEcho.java new file mode 100644 index 0000000000..65f7fed15e --- /dev/null +++ b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/stub/echostubsettings/echo/SyncEcho.java @@ -0,0 +1,55 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.stub.samples; + +// [START localhost7469_v1beta1_generated_EchoStubSettings_Echo_sync] +import com.google.showcase.v1beta1.stub.EchoStubSettings; +import java.time.Duration; + +public class SyncEcho { + + public static void main(String[] args) throws Exception { + syncEcho(); + } + + public static void syncEcho() 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 + EchoStubSettings.Builder echoSettingsBuilder = EchoStubSettings.newBuilder(); + echoSettingsBuilder + .echoSettings() + .setRetrySettings( + echoSettingsBuilder + .echoSettings() + .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()); + EchoStubSettings echoSettings = echoSettingsBuilder.build(); + } +} +// [END localhost7469_v1beta1_generated_EchoStubSettings_Echo_sync] diff --git a/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/stub/echostubsettings/wait/SyncWait.java b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/stub/echostubsettings/wait/SyncWait.java new file mode 100644 index 0000000000..31e801889f --- /dev/null +++ b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/stub/echostubsettings/wait/SyncWait.java @@ -0,0 +1,53 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.stub.samples; + +// [START localhost7469_v1beta1_generated_EchoStubSettings_Wait_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.showcase.v1beta1.stub.EchoStubSettings; +import java.time.Duration; + +public class SyncWait { + + public static void main(String[] args) throws Exception { + syncWait(); + } + + public static void syncWait() 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 + EchoStubSettings.Builder echoSettingsBuilder = EchoStubSettings.newBuilder(); + TimedRetryAlgorithm timedRetryAlgorithm = + OperationalTimedPollAlgorithm.create( + RetrySettings.newBuilder() + .setInitialRetryDelayDuration(Duration.ofMillis(500)) + .setRetryDelayMultiplier(1.5) + .setMaxRetryDelayDuration(Duration.ofMillis(5000)) + .setTotalTimeoutDuration(Duration.ofHours(24)) + .build()); + echoSettingsBuilder + .createClusterOperationSettings() + .setPollingAlgorithm(timedRetryAlgorithm) + .build(); + } +} +// [END localhost7469_v1beta1_generated_EchoStubSettings_Wait_sync] diff --git a/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/stub/identitystubsettings/createuser/SyncCreateUser.java b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/stub/identitystubsettings/createuser/SyncCreateUser.java new file mode 100644 index 0000000000..e9ca8457ad --- /dev/null +++ b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/stub/identitystubsettings/createuser/SyncCreateUser.java @@ -0,0 +1,55 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.stub.samples; + +// [START localhost7469_v1beta1_generated_IdentityStubSettings_CreateUser_sync] +import com.google.showcase.v1beta1.stub.IdentityStubSettings; +import java.time.Duration; + +public class SyncCreateUser { + + public static void main(String[] args) throws Exception { + syncCreateUser(); + } + + public static void syncCreateUser() 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 + IdentityStubSettings.Builder identitySettingsBuilder = IdentityStubSettings.newBuilder(); + identitySettingsBuilder + .createUserSettings() + .setRetrySettings( + identitySettingsBuilder + .createUserSettings() + .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()); + IdentityStubSettings identitySettings = identitySettingsBuilder.build(); + } +} +// [END localhost7469_v1beta1_generated_IdentityStubSettings_CreateUser_sync] diff --git a/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/stub/messagingstubsettings/createroom/SyncCreateRoom.java b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/stub/messagingstubsettings/createroom/SyncCreateRoom.java new file mode 100644 index 0000000000..53fac57a6e --- /dev/null +++ b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/stub/messagingstubsettings/createroom/SyncCreateRoom.java @@ -0,0 +1,55 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.stub.samples; + +// [START localhost7469_v1beta1_generated_MessagingStubSettings_CreateRoom_sync] +import com.google.showcase.v1beta1.stub.MessagingStubSettings; +import java.time.Duration; + +public class SyncCreateRoom { + + public static void main(String[] args) throws Exception { + syncCreateRoom(); + } + + public static void syncCreateRoom() 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 + MessagingStubSettings.Builder messagingSettingsBuilder = MessagingStubSettings.newBuilder(); + messagingSettingsBuilder + .createRoomSettings() + .setRetrySettings( + messagingSettingsBuilder + .createRoomSettings() + .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()); + MessagingStubSettings messagingSettings = messagingSettingsBuilder.build(); + } +} +// [END localhost7469_v1beta1_generated_MessagingStubSettings_CreateRoom_sync] diff --git a/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/stub/messagingstubsettings/searchblurbs/SyncSearchBlurbs.java b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/stub/messagingstubsettings/searchblurbs/SyncSearchBlurbs.java new file mode 100644 index 0000000000..262c3bf95e --- /dev/null +++ b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/stub/messagingstubsettings/searchblurbs/SyncSearchBlurbs.java @@ -0,0 +1,53 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.stub.samples; + +// [START localhost7469_v1beta1_generated_MessagingStubSettings_SearchBlurbs_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.showcase.v1beta1.stub.MessagingStubSettings; +import java.time.Duration; + +public class SyncSearchBlurbs { + + public static void main(String[] args) throws Exception { + syncSearchBlurbs(); + } + + public static void syncSearchBlurbs() 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 + MessagingStubSettings.Builder messagingSettingsBuilder = MessagingStubSettings.newBuilder(); + TimedRetryAlgorithm timedRetryAlgorithm = + OperationalTimedPollAlgorithm.create( + RetrySettings.newBuilder() + .setInitialRetryDelayDuration(Duration.ofMillis(500)) + .setRetryDelayMultiplier(1.5) + .setMaxRetryDelayDuration(Duration.ofMillis(5000)) + .setTotalTimeoutDuration(Duration.ofHours(24)) + .build()); + messagingSettingsBuilder + .createClusterOperationSettings() + .setPollingAlgorithm(timedRetryAlgorithm) + .build(); + } +} +// [END localhost7469_v1beta1_generated_MessagingStubSettings_SearchBlurbs_sync] diff --git a/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/stub/sequenceservicestubsettings/createsequence/SyncCreateSequence.java b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/stub/sequenceservicestubsettings/createsequence/SyncCreateSequence.java new file mode 100644 index 0000000000..a4b8b16256 --- /dev/null +++ b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/stub/sequenceservicestubsettings/createsequence/SyncCreateSequence.java @@ -0,0 +1,56 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.stub.samples; + +// [START localhost7469_v1beta1_generated_SequenceServiceStubSettings_CreateSequence_sync] +import com.google.showcase.v1beta1.stub.SequenceServiceStubSettings; +import java.time.Duration; + +public class SyncCreateSequence { + + public static void main(String[] args) throws Exception { + syncCreateSequence(); + } + + public static void syncCreateSequence() 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 + SequenceServiceStubSettings.Builder sequenceServiceSettingsBuilder = + SequenceServiceStubSettings.newBuilder(); + sequenceServiceSettingsBuilder + .createSequenceSettings() + .setRetrySettings( + sequenceServiceSettingsBuilder + .createSequenceSettings() + .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()); + SequenceServiceStubSettings sequenceServiceSettings = sequenceServiceSettingsBuilder.build(); + } +} +// [END localhost7469_v1beta1_generated_SequenceServiceStubSettings_CreateSequence_sync] diff --git a/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/stub/testingstubsettings/createsession/SyncCreateSession.java b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/stub/testingstubsettings/createsession/SyncCreateSession.java new file mode 100644 index 0000000000..b456b5c601 --- /dev/null +++ b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/stub/testingstubsettings/createsession/SyncCreateSession.java @@ -0,0 +1,55 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.stub.samples; + +// [START localhost7469_v1beta1_generated_TestingStubSettings_CreateSession_sync] +import com.google.showcase.v1beta1.stub.TestingStubSettings; +import java.time.Duration; + +public class SyncCreateSession { + + public static void main(String[] args) throws Exception { + syncCreateSession(); + } + + public static void syncCreateSession() 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 + TestingStubSettings.Builder testingSettingsBuilder = TestingStubSettings.newBuilder(); + testingSettingsBuilder + .createSessionSettings() + .setRetrySettings( + testingSettingsBuilder + .createSessionSettings() + .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()); + TestingStubSettings testingSettings = testingSettingsBuilder.build(); + } +} +// [END localhost7469_v1beta1_generated_TestingStubSettings_CreateSession_sync] diff --git a/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/testing/create/SyncCreateSetCredentialsProvider.java b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/testing/create/SyncCreateSetCredentialsProvider.java new file mode 100644 index 0000000000..e316753c28 --- /dev/null +++ b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/testing/create/SyncCreateSetCredentialsProvider.java @@ -0,0 +1,44 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.samples; + +// [START localhost7469_v1beta1_generated_Testing_Create_SetCredentialsProvider_sync] +import com.google.api.gax.core.FixedCredentialsProvider; +import com.google.showcase.v1beta1.TestingClient; +import com.google.showcase.v1beta1.TestingSettings; +import com.google.showcase.v1beta1.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 + TestingSettings testingSettings = + TestingSettings.newBuilder() + .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials)) + .build(); + TestingClient testingClient = TestingClient.create(testingSettings); + } +} +// [END localhost7469_v1beta1_generated_Testing_Create_SetCredentialsProvider_sync] diff --git a/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/testing/create/SyncCreateSetEndpoint.java b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/testing/create/SyncCreateSetEndpoint.java new file mode 100644 index 0000000000..2d12c3bd9c --- /dev/null +++ b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/testing/create/SyncCreateSetEndpoint.java @@ -0,0 +1,40 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.samples; + +// [START localhost7469_v1beta1_generated_Testing_Create_SetEndpoint_sync] +import com.google.showcase.v1beta1.TestingClient; +import com.google.showcase.v1beta1.TestingSettings; +import com.google.showcase.v1beta1.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 + TestingSettings testingSettings = TestingSettings.newBuilder().setEndpoint(myEndpoint).build(); + TestingClient testingClient = TestingClient.create(testingSettings); + } +} +// [END localhost7469_v1beta1_generated_Testing_Create_SetEndpoint_sync] diff --git a/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/testing/create/SyncCreateUseHttpJsonTransport.java b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/testing/create/SyncCreateUseHttpJsonTransport.java new file mode 100644 index 0000000000..a9a05f88d3 --- /dev/null +++ b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/testing/create/SyncCreateUseHttpJsonTransport.java @@ -0,0 +1,39 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.samples; + +// [START localhost7469_v1beta1_generated_Testing_Create_UseHttpJsonTransport_sync] +import com.google.showcase.v1beta1.TestingClient; +import com.google.showcase.v1beta1.TestingSettings; + +public class SyncCreateUseHttpJsonTransport { + + public static void main(String[] args) throws Exception { + syncCreateUseHttpJsonTransport(); + } + + public static void syncCreateUseHttpJsonTransport() 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 + TestingSettings testingSettings = TestingSettings.newHttpJsonBuilder().build(); + TestingClient testingClient = TestingClient.create(testingSettings); + } +} +// [END localhost7469_v1beta1_generated_Testing_Create_UseHttpJsonTransport_sync] diff --git a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/testing/createsession/AsyncCreateSession.java b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/testing/createsession/AsyncCreateSession.java similarity index 98% rename from showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/testing/createsession/AsyncCreateSession.java rename to java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/testing/createsession/AsyncCreateSession.java index 6706d5fbbf..497f66de85 100644 --- a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/testing/createsession/AsyncCreateSession.java +++ b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/testing/createsession/AsyncCreateSession.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/testing/createsession/SyncCreateSession.java b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/testing/createsession/SyncCreateSession.java new file mode 100644 index 0000000000..fa509e25a9 --- /dev/null +++ b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/testing/createsession/SyncCreateSession.java @@ -0,0 +1,43 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.samples; + +// [START localhost7469_v1beta1_generated_Testing_CreateSession_sync] +import com.google.showcase.v1beta1.CreateSessionRequest; +import com.google.showcase.v1beta1.Session; +import com.google.showcase.v1beta1.TestingClient; + +public class SyncCreateSession { + + public static void main(String[] args) throws Exception { + syncCreateSession(); + } + + public static void syncCreateSession() 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 (TestingClient testingClient = TestingClient.create()) { + CreateSessionRequest request = + CreateSessionRequest.newBuilder().setSession(Session.newBuilder().build()).build(); + Session response = testingClient.createSession(request); + } + } +} +// [END localhost7469_v1beta1_generated_Testing_CreateSession_sync] diff --git a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/testing/deletesession/AsyncDeleteSession.java b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/testing/deletesession/AsyncDeleteSession.java similarity index 98% rename from showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/testing/deletesession/AsyncDeleteSession.java rename to java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/testing/deletesession/AsyncDeleteSession.java index 38d1dff284..2900f1ee35 100644 --- a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/testing/deletesession/AsyncDeleteSession.java +++ b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/testing/deletesession/AsyncDeleteSession.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/testing/deletesession/SyncDeleteSession.java b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/testing/deletesession/SyncDeleteSession.java similarity index 98% rename from showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/testing/deletesession/SyncDeleteSession.java rename to java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/testing/deletesession/SyncDeleteSession.java index d8e1cfcefb..f90436ed23 100644 --- a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/testing/deletesession/SyncDeleteSession.java +++ b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/testing/deletesession/SyncDeleteSession.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/testing/deletetest/AsyncDeleteTest.java b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/testing/deletetest/AsyncDeleteTest.java similarity index 98% rename from showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/testing/deletetest/AsyncDeleteTest.java rename to java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/testing/deletetest/AsyncDeleteTest.java index bbe7e7edc2..ff0a6ea4d9 100644 --- a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/testing/deletetest/AsyncDeleteTest.java +++ b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/testing/deletetest/AsyncDeleteTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/testing/deletetest/SyncDeleteTest.java b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/testing/deletetest/SyncDeleteTest.java similarity index 98% rename from showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/testing/deletetest/SyncDeleteTest.java rename to java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/testing/deletetest/SyncDeleteTest.java index aa2ad11d74..d1c3c9ce71 100644 --- a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/testing/deletetest/SyncDeleteTest.java +++ b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/testing/deletetest/SyncDeleteTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/testing/getiampolicy/AsyncGetIamPolicy.java b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/testing/getiampolicy/AsyncGetIamPolicy.java new file mode 100644 index 0000000000..b5db231e7d --- /dev/null +++ b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/testing/getiampolicy/AsyncGetIamPolicy.java @@ -0,0 +1,51 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.samples; + +// [START localhost7469_v1beta1_generated_Testing_GetIamPolicy_async] +import com.google.api.core.ApiFuture; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.GetPolicyOptions; +import com.google.iam.v1.Policy; +import com.google.showcase.v1beta1.BlurbName; +import com.google.showcase.v1beta1.TestingClient; + +public class AsyncGetIamPolicy { + + public static void main(String[] args) throws Exception { + asyncGetIamPolicy(); + } + + public static void asyncGetIamPolicy() 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 (TestingClient testingClient = TestingClient.create()) { + GetIamPolicyRequest request = + GetIamPolicyRequest.newBuilder() + .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString()) + .setOptions(GetPolicyOptions.newBuilder().build()) + .build(); + ApiFuture future = testingClient.getIamPolicyCallable().futureCall(request); + // Do something. + Policy response = future.get(); + } + } +} +// [END localhost7469_v1beta1_generated_Testing_GetIamPolicy_async] diff --git a/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/testing/getiampolicy/SyncGetIamPolicy.java b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/testing/getiampolicy/SyncGetIamPolicy.java new file mode 100644 index 0000000000..ed3745e247 --- /dev/null +++ b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/testing/getiampolicy/SyncGetIamPolicy.java @@ -0,0 +1,48 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.samples; + +// [START localhost7469_v1beta1_generated_Testing_GetIamPolicy_sync] +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.GetPolicyOptions; +import com.google.iam.v1.Policy; +import com.google.showcase.v1beta1.BlurbName; +import com.google.showcase.v1beta1.TestingClient; + +public class SyncGetIamPolicy { + + public static void main(String[] args) throws Exception { + syncGetIamPolicy(); + } + + public static void syncGetIamPolicy() 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 (TestingClient testingClient = TestingClient.create()) { + GetIamPolicyRequest request = + GetIamPolicyRequest.newBuilder() + .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString()) + .setOptions(GetPolicyOptions.newBuilder().build()) + .build(); + Policy response = testingClient.getIamPolicy(request); + } + } +} +// [END localhost7469_v1beta1_generated_Testing_GetIamPolicy_sync] diff --git a/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/testing/getlocation/AsyncGetLocation.java b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/testing/getlocation/AsyncGetLocation.java new file mode 100644 index 0000000000..33cc1c1b05 --- /dev/null +++ b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/testing/getlocation/AsyncGetLocation.java @@ -0,0 +1,45 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.samples; + +// [START localhost7469_v1beta1_generated_Testing_GetLocation_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.Location; +import com.google.showcase.v1beta1.TestingClient; + +public class AsyncGetLocation { + + public static void main(String[] args) throws Exception { + asyncGetLocation(); + } + + public static void asyncGetLocation() 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 (TestingClient testingClient = TestingClient.create()) { + GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build(); + ApiFuture future = testingClient.getLocationCallable().futureCall(request); + // Do something. + Location response = future.get(); + } + } +} +// [END localhost7469_v1beta1_generated_Testing_GetLocation_async] diff --git a/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/testing/getlocation/SyncGetLocation.java b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/testing/getlocation/SyncGetLocation.java new file mode 100644 index 0000000000..bdcc11889a --- /dev/null +++ b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/testing/getlocation/SyncGetLocation.java @@ -0,0 +1,42 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.samples; + +// [START localhost7469_v1beta1_generated_Testing_GetLocation_sync] +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.Location; +import com.google.showcase.v1beta1.TestingClient; + +public class SyncGetLocation { + + public static void main(String[] args) throws Exception { + syncGetLocation(); + } + + public static void syncGetLocation() 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 (TestingClient testingClient = TestingClient.create()) { + GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build(); + Location response = testingClient.getLocation(request); + } + } +} +// [END localhost7469_v1beta1_generated_Testing_GetLocation_sync] diff --git a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/testing/getsession/AsyncGetSession.java b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/testing/getsession/AsyncGetSession.java similarity index 98% rename from showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/testing/getsession/AsyncGetSession.java rename to java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/testing/getsession/AsyncGetSession.java index f00a7a974b..b106ff2a7f 100644 --- a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/testing/getsession/AsyncGetSession.java +++ b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/testing/getsession/AsyncGetSession.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/testing/getsession/SyncGetSession.java b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/testing/getsession/SyncGetSession.java similarity index 98% rename from showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/testing/getsession/SyncGetSession.java rename to java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/testing/getsession/SyncGetSession.java index 3ed0205286..2c2e254f5c 100644 --- a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/testing/getsession/SyncGetSession.java +++ b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/testing/getsession/SyncGetSession.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/testing/listlocations/AsyncListLocations.java b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/testing/listlocations/AsyncListLocations.java new file mode 100644 index 0000000000..c951515c5d --- /dev/null +++ b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/testing/listlocations/AsyncListLocations.java @@ -0,0 +1,53 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.samples; + +// [START localhost7469_v1beta1_generated_Testing_ListLocations_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.Location; +import com.google.showcase.v1beta1.TestingClient; + +public class AsyncListLocations { + + public static void main(String[] args) throws Exception { + asyncListLocations(); + } + + public static void asyncListLocations() 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 (TestingClient testingClient = TestingClient.create()) { + ListLocationsRequest request = + ListLocationsRequest.newBuilder() + .setName("name3373707") + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + ApiFuture future = testingClient.listLocationsPagedCallable().futureCall(request); + // Do something. + for (Location element : future.get().iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END localhost7469_v1beta1_generated_Testing_ListLocations_async] diff --git a/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/testing/listlocations/AsyncListLocationsPaged.java b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/testing/listlocations/AsyncListLocationsPaged.java new file mode 100644 index 0000000000..37ed766830 --- /dev/null +++ b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/testing/listlocations/AsyncListLocationsPaged.java @@ -0,0 +1,61 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.samples; + +// [START localhost7469_v1beta1_generated_Testing_ListLocations_Paged_async] +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.common.base.Strings; +import com.google.showcase.v1beta1.TestingClient; + +public class AsyncListLocationsPaged { + + public static void main(String[] args) throws Exception { + asyncListLocationsPaged(); + } + + public static void asyncListLocationsPaged() 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 (TestingClient testingClient = TestingClient.create()) { + ListLocationsRequest request = + ListLocationsRequest.newBuilder() + .setName("name3373707") + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + while (true) { + ListLocationsResponse response = testingClient.listLocationsCallable().call(request); + for (Location element : response.getLocationsList()) { + // doThingsWith(element); + } + String nextPageToken = response.getNextPageToken(); + if (!Strings.isNullOrEmpty(nextPageToken)) { + request = request.toBuilder().setPageToken(nextPageToken).build(); + } else { + break; + } + } + } + } +} +// [END localhost7469_v1beta1_generated_Testing_ListLocations_Paged_async] diff --git a/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/testing/listlocations/SyncListLocations.java b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/testing/listlocations/SyncListLocations.java new file mode 100644 index 0000000000..88a8e6f2f8 --- /dev/null +++ b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/testing/listlocations/SyncListLocations.java @@ -0,0 +1,50 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.samples; + +// [START localhost7469_v1beta1_generated_Testing_ListLocations_sync] +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.Location; +import com.google.showcase.v1beta1.TestingClient; + +public class SyncListLocations { + + public static void main(String[] args) throws Exception { + syncListLocations(); + } + + public static void syncListLocations() 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 (TestingClient testingClient = TestingClient.create()) { + ListLocationsRequest request = + ListLocationsRequest.newBuilder() + .setName("name3373707") + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + for (Location element : testingClient.listLocations(request).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END localhost7469_v1beta1_generated_Testing_ListLocations_sync] diff --git a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/testing/listsessions/AsyncListSessions.java b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/testing/listsessions/AsyncListSessions.java similarity index 98% rename from showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/testing/listsessions/AsyncListSessions.java rename to java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/testing/listsessions/AsyncListSessions.java index 416101c8d7..abcba44172 100644 --- a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/testing/listsessions/AsyncListSessions.java +++ b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/testing/listsessions/AsyncListSessions.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/testing/listsessions/AsyncListSessionsPaged.java b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/testing/listsessions/AsyncListSessionsPaged.java similarity index 98% rename from showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/testing/listsessions/AsyncListSessionsPaged.java rename to java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/testing/listsessions/AsyncListSessionsPaged.java index afc3931922..b3561b4396 100644 --- a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/testing/listsessions/AsyncListSessionsPaged.java +++ b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/testing/listsessions/AsyncListSessionsPaged.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/testing/listsessions/SyncListSessions.java b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/testing/listsessions/SyncListSessions.java similarity index 98% rename from showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/testing/listsessions/SyncListSessions.java rename to java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/testing/listsessions/SyncListSessions.java index af3db7796e..9720574c19 100644 --- a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/testing/listsessions/SyncListSessions.java +++ b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/testing/listsessions/SyncListSessions.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/testing/listtests/AsyncListTests.java b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/testing/listtests/AsyncListTests.java similarity index 98% rename from showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/testing/listtests/AsyncListTests.java rename to java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/testing/listtests/AsyncListTests.java index b32136cb50..68cfbc6ea8 100644 --- a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/testing/listtests/AsyncListTests.java +++ b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/testing/listtests/AsyncListTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/testing/listtests/AsyncListTestsPaged.java b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/testing/listtests/AsyncListTestsPaged.java similarity index 98% rename from showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/testing/listtests/AsyncListTestsPaged.java rename to java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/testing/listtests/AsyncListTestsPaged.java index 41692c2cdc..8bb953d9c1 100644 --- a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/testing/listtests/AsyncListTestsPaged.java +++ b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/testing/listtests/AsyncListTestsPaged.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/testing/listtests/SyncListTests.java b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/testing/listtests/SyncListTests.java similarity index 98% rename from showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/testing/listtests/SyncListTests.java rename to java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/testing/listtests/SyncListTests.java index 09e918bcbf..f11111e8ab 100644 --- a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/testing/listtests/SyncListTests.java +++ b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/testing/listtests/SyncListTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/testing/reportsession/AsyncReportSession.java b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/testing/reportsession/AsyncReportSession.java similarity index 98% rename from showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/testing/reportsession/AsyncReportSession.java rename to java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/testing/reportsession/AsyncReportSession.java index b049d290f1..8f47716b0f 100644 --- a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/testing/reportsession/AsyncReportSession.java +++ b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/testing/reportsession/AsyncReportSession.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/testing/reportsession/SyncReportSession.java b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/testing/reportsession/SyncReportSession.java similarity index 98% rename from showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/testing/reportsession/SyncReportSession.java rename to java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/testing/reportsession/SyncReportSession.java index 1420b6a569..8596c19409 100644 --- a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/testing/reportsession/SyncReportSession.java +++ b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/testing/reportsession/SyncReportSession.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/testing/setiampolicy/AsyncSetIamPolicy.java b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/testing/setiampolicy/AsyncSetIamPolicy.java new file mode 100644 index 0000000000..81051549c9 --- /dev/null +++ b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/testing/setiampolicy/AsyncSetIamPolicy.java @@ -0,0 +1,52 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.samples; + +// [START localhost7469_v1beta1_generated_Testing_SetIamPolicy_async] +import com.google.api.core.ApiFuture; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.protobuf.FieldMask; +import com.google.showcase.v1beta1.BlurbName; +import com.google.showcase.v1beta1.TestingClient; + +public class AsyncSetIamPolicy { + + public static void main(String[] args) throws Exception { + asyncSetIamPolicy(); + } + + public static void asyncSetIamPolicy() 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 (TestingClient testingClient = TestingClient.create()) { + SetIamPolicyRequest request = + SetIamPolicyRequest.newBuilder() + .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString()) + .setPolicy(Policy.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .build(); + ApiFuture future = testingClient.setIamPolicyCallable().futureCall(request); + // Do something. + Policy response = future.get(); + } + } +} +// [END localhost7469_v1beta1_generated_Testing_SetIamPolicy_async] diff --git a/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/testing/setiampolicy/SyncSetIamPolicy.java b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/testing/setiampolicy/SyncSetIamPolicy.java new file mode 100644 index 0000000000..2176c8e099 --- /dev/null +++ b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/testing/setiampolicy/SyncSetIamPolicy.java @@ -0,0 +1,49 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.samples; + +// [START localhost7469_v1beta1_generated_Testing_SetIamPolicy_sync] +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.protobuf.FieldMask; +import com.google.showcase.v1beta1.BlurbName; +import com.google.showcase.v1beta1.TestingClient; + +public class SyncSetIamPolicy { + + public static void main(String[] args) throws Exception { + syncSetIamPolicy(); + } + + public static void syncSetIamPolicy() 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 (TestingClient testingClient = TestingClient.create()) { + SetIamPolicyRequest request = + SetIamPolicyRequest.newBuilder() + .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString()) + .setPolicy(Policy.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .build(); + Policy response = testingClient.setIamPolicy(request); + } + } +} +// [END localhost7469_v1beta1_generated_Testing_SetIamPolicy_sync] diff --git a/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/testing/testiampermissions/AsyncTestIamPermissions.java b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/testing/testiampermissions/AsyncTestIamPermissions.java new file mode 100644 index 0000000000..ecc68ec034 --- /dev/null +++ b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/testing/testiampermissions/AsyncTestIamPermissions.java @@ -0,0 +1,52 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.samples; + +// [START localhost7469_v1beta1_generated_Testing_TestIamPermissions_async] +import com.google.api.core.ApiFuture; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.showcase.v1beta1.BlurbName; +import com.google.showcase.v1beta1.TestingClient; +import java.util.ArrayList; + +public class AsyncTestIamPermissions { + + public static void main(String[] args) throws Exception { + asyncTestIamPermissions(); + } + + public static void asyncTestIamPermissions() 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 (TestingClient testingClient = TestingClient.create()) { + TestIamPermissionsRequest request = + TestIamPermissionsRequest.newBuilder() + .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString()) + .addAllPermissions(new ArrayList()) + .build(); + ApiFuture future = + testingClient.testIamPermissionsCallable().futureCall(request); + // Do something. + TestIamPermissionsResponse response = future.get(); + } + } +} +// [END localhost7469_v1beta1_generated_Testing_TestIamPermissions_async] diff --git a/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/testing/testiampermissions/SyncTestIamPermissions.java b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/testing/testiampermissions/SyncTestIamPermissions.java new file mode 100644 index 0000000000..9084a7ea9d --- /dev/null +++ b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/testing/testiampermissions/SyncTestIamPermissions.java @@ -0,0 +1,48 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.samples; + +// [START localhost7469_v1beta1_generated_Testing_TestIamPermissions_sync] +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.showcase.v1beta1.BlurbName; +import com.google.showcase.v1beta1.TestingClient; +import java.util.ArrayList; + +public class SyncTestIamPermissions { + + public static void main(String[] args) throws Exception { + syncTestIamPermissions(); + } + + public static void syncTestIamPermissions() 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 (TestingClient testingClient = TestingClient.create()) { + TestIamPermissionsRequest request = + TestIamPermissionsRequest.newBuilder() + .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString()) + .addAllPermissions(new ArrayList()) + .build(); + TestIamPermissionsResponse response = testingClient.testIamPermissions(request); + } + } +} +// [END localhost7469_v1beta1_generated_Testing_TestIamPermissions_sync] diff --git a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/testing/verifytest/AsyncVerifyTest.java b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/testing/verifytest/AsyncVerifyTest.java similarity index 98% rename from showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/testing/verifytest/AsyncVerifyTest.java rename to java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/testing/verifytest/AsyncVerifyTest.java index 1c6216b9ba..98f82ca82a 100644 --- a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/testing/verifytest/AsyncVerifyTest.java +++ b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/testing/verifytest/AsyncVerifyTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/testing/verifytest/SyncVerifyTest.java b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/testing/verifytest/SyncVerifyTest.java similarity index 98% rename from showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/testing/verifytest/SyncVerifyTest.java rename to java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/testing/verifytest/SyncVerifyTest.java index 26ed7c7d1a..3f16480b8e 100644 --- a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/testing/verifytest/SyncVerifyTest.java +++ b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/testing/verifytest/SyncVerifyTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/testingsettings/createsession/SyncCreateSession.java b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/testingsettings/createsession/SyncCreateSession.java new file mode 100644 index 0000000000..6edec2b6fc --- /dev/null +++ b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/testingsettings/createsession/SyncCreateSession.java @@ -0,0 +1,55 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.samples; + +// [START localhost7469_v1beta1_generated_TestingSettings_CreateSession_sync] +import com.google.showcase.v1beta1.TestingSettings; +import java.time.Duration; + +public class SyncCreateSession { + + public static void main(String[] args) throws Exception { + syncCreateSession(); + } + + public static void syncCreateSession() 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 + TestingSettings.Builder testingSettingsBuilder = TestingSettings.newBuilder(); + testingSettingsBuilder + .createSessionSettings() + .setRetrySettings( + testingSettingsBuilder + .createSessionSettings() + .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()); + TestingSettings testingSettings = testingSettingsBuilder.build(); + } +} +// [END localhost7469_v1beta1_generated_TestingSettings_CreateSession_sync] diff --git a/java-showcase/scripts/generate_showcase.sh b/java-showcase/scripts/generate_showcase.sh new file mode 100755 index 0000000000..c93fa95567 --- /dev/null +++ b/java-showcase/scripts/generate_showcase.sh @@ -0,0 +1,87 @@ +#!/bin/bash +# Generates the showcase library using the docker image, which is built +# from the current state of the repo in order to test local changes. +set -ex + +trap cleanup ERR + +readonly ROOT_DIR="$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )/../.." +pushd "${ROOT_DIR}" +source "${ROOT_DIR}/java-showcase/scripts/showcase_utilities.sh" + +cleanup() { + if [[ -z "${api_def_dir}" ]]; then + rm -rf "${api_def_dir}" + fi + if [[ -z "${showcase_def_dir}" ]]; then + rm -rf "${showcase_def_dir}" + fi +} + +while [[ $# -gt 0 ]]; do +key="$1" +case "${key}" in + --replace) + replace="$2" + shift + ;; + *) + echo "Invalid option: [$1]" + exit 1 + ;; +esac +shift +done + +if [ -z "${replace}" ]; then + replace="false" +fi + + +# download api definitions from googleapis repository +googleapis_commitish=$(grep googleapis_commitish generation_config.yaml | cut -d ":" -f 2 | xargs) +api_def_dir=$(mktemp -d) +git clone https://github.com/googleapis/googleapis.git "${api_def_dir}" + +pushd "${api_def_dir}" +git checkout "${googleapis_commitish}" +# for local setups, we avoid permission issues when the docker image +# performs version-dependent operations. +rm -rf ".git/" +popd + +append_showcase_to_api_defs "${api_def_dir}" + +echo "building docker image" +DOCKER_BUILDKIT=1 docker build --file .cloudbuild/library_generation/library_generation.Dockerfile --iidfile image-id . + +if [[ "${replace}" == "true" ]]; then + generated_files_dir="${ROOT_DIR}" +else + export generated_files_dir=$(mktemp -d) + # here we store the generated library location for upstream scripts to use + # it. + echo "${generated_files_dir}/java-showcase" > "${ROOT_DIR}/generated-showcase-location" + # we prepare the temp folder with the minimal setup to perform an incremental + # generation. + pushd "${ROOT_DIR}" + cp -r generation_config.yaml java-showcase/ versions.txt "${generated_files_dir}" + popd #ROOT_DIR +fi + +GENERATOR_VERSION=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout -pl gapic-generator-java) + +echo "generating showcase" +workspace_name="/workspace" +docker run \ + --rm \ + -u "$(id -u):$(id -g)" \ + -v "${generated_files_dir}:${workspace_name}" \ + -v "${api_def_dir}:${workspace_name}/googleapis" \ + -e GENERATOR_VERSION="${GENERATOR_VERSION}" \ + "$(cat image-id)" \ + --generation-config-path="${workspace_name}/generation_config.yaml" \ + --library-names="showcase" \ + --api-definitions-path="${workspace_name}/googleapis" + +echo "generated showcase library in ${generated_files_dir}" diff --git a/java-showcase/scripts/resources/BUILD.partial.bazel b/java-showcase/scripts/resources/BUILD.partial.bazel new file mode 100644 index 0000000000..2744c3a7b9 --- /dev/null +++ b/java-showcase/scripts/resources/BUILD.partial.bazel @@ -0,0 +1,27 @@ +# This file is a partial recovery of the BUILD.bazel file, which was last seen on +# https://github.com/googleapis/sdk-platform-java/commit/d59b87feddce69077c05ef8e44faea8c44f3338b +# +# We keep it here in order to leverage the protoc parameter inference of the hermetic build Docker image, +# which parses BUILD.bazel files from folders with api definitions (e.g. googleapis/googleapis). + +java_gapic_library( + grpc_service_config = "showcase_grpc_service_config.json", + service_yaml = "showcase_v1beta1.yaml", + test_deps = [ + ":showcase_java_grpc", + "@com_google_googleapis//google/cloud/location:location_java_grpc", + "@com_google_googleapis//google/iam/v1:iam_java_grpc" + ], + transport = "grpc+rest", +) + +proto_library_with_info( + deps = [ + "//google/cloud/location:location_proto", + "//google/iam/v1:iam_policy_proto" + ], +) + +java_gapic_assembly_gradle_pkg( + include_samples = True, +) diff --git a/java-showcase/scripts/showcase_utilities.sh b/java-showcase/scripts/showcase_utilities.sh new file mode 100644 index 0000000000..48e4a12acf --- /dev/null +++ b/java-showcase/scripts/showcase_utilities.sh @@ -0,0 +1,41 @@ +#!/bin/bash +readonly REPO_DIR="$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )/../.." + +function cleanup { + script_dir=$1 + cd "${script_dir}" + rm -rf output gapic-generator-java* + rm -rf "${script_dir}/../../generated-showcase-location" +} + +get_version_from_pom() { + target_pom="$1" + key="$2" + # prints the result to stdout + grep -e "<${key}>" "${target_pom}" | cut -d'>' -f2 | cut -d'<' -f1 +} + +append_showcase_to_api_defs() { + api_def_dir="$1" + # append showcase definitions to googleapis repository + export showcase_def_dir=$(mktemp -d) + git clone https://github.com/googleapis/gapic-showcase.git "${showcase_def_dir}" + # looks at sdk-platform-java/java-showcase/gapic-showcase/pom.xml to extract the + # version of gapic-showcase + # see https://github.com/googleapis/gapic-showcase/releases + showcase_version=$(get_version_from_pom \ + "${REPO_DIR}/java-showcase/gapic-showcase/pom.xml" "gapic-showcase.version" + ) + pushd "${showcase_def_dir}" + git checkout "v${showcase_version}" + popd + # compliance_suite.json is a symbolic link outside of the schema folder, so we + # replace it with the actual contents in its original location. + compliance_suite_path="${showcase_def_dir}/schema/google/showcase/v1beta1/compliance_suite.json" + unlink "${compliance_suite_path}" + cp "${showcase_def_dir}/server/services/compliance_suite.json" "${compliance_suite_path}" + # we complete the BUILD.bazel in gapic-showcase with our java_library in order + # to generate the gapic portion. + cat "${REPO_DIR}/java-showcase/scripts/resources/BUILD.partial.bazel" >> "${showcase_def_dir}/schema/google/showcase/v1beta1/BUILD.bazel" + cp -r "${showcase_def_dir}/schema" "${api_def_dir}/" +} diff --git a/java-showcase/scripts/verify.sh b/java-showcase/scripts/verify.sh new file mode 100755 index 0000000000..dc241d2308 --- /dev/null +++ b/java-showcase/scripts/verify.sh @@ -0,0 +1,19 @@ +#!/bin/sh +# This script generates showcase in a temporary/untracked folder and compares +# its contents with the actual showcase libraries. + +set -oxe +readonly SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) +readonly ROOT_DIR="${SCRIPT_DIR}/../.." +source "${SCRIPT_DIR}/showcase_utilities.sh" +readonly SHOWCASE_DIR="${SCRIPT_DIR}/.." + +# generate sources +bash "${SCRIPT_DIR}/generate_showcase.sh" --replace "false" + +generated_library_location=$(cat "${ROOT_DIR}/generated-showcase-location") + +# compare library +diff -ru "${SHOWCASE_DIR}/" "${generated_library_location}" + +cleanup $SCRIPT_DIR diff --git a/pom.xml b/pom.xml index 3950b69edc..40402d8436 100644 --- a/pom.xml +++ b/pom.xml @@ -9,7 +9,7 @@ 0.1.0-SNAPSHOT - true + true UTF-8 @@ -20,21 +20,38 @@ gapic-generator-java java-common-protos java-iam + java-core gapic-generator-java-bom + java-shared-dependencies + sdk-platform-java-config + + com.spotify.fmt + fmt-maven-plugin + org.apache.maven.plugins maven-deploy-plugin - 3.0.0 + 3.1.3 true + + + sonatype-nexus-snapshots + https://google.oss.sonatype.org/content/repositories/snapshots + + + sonatype-nexus-staging + https://google.oss.sonatype.org/service/local/staging/deploy/maven2/ + + @@ -45,23 +62,13 @@ !gpg.executable - - - sonatype-nexus-snapshots - https://google.oss.sonatype.org/content/repositories/snapshots - - - sonatype-nexus-staging - https://google.oss.sonatype.org/service/local/staging/deploy/maven2/ - - org.sonatype.plugins nexus-staging-maven-plugin - 1.6.13 + 1.7.0 true sonatype-nexus-staging @@ -72,6 +79,34 @@ + + + full-project-coverage + + + enableFullTestCoverage + + + + java-showcase + + + + + activate-showcase-coverage + + + enableShowcaseTestCoverage + + + + java-showcase + coverage-report + + + ${maven.multiModuleProjectDirectory}/coverage-report/target/site/jacoco-aggregate/jacoco.xml + + diff --git a/release-please-config.json b/release-please-config.json new file mode 100644 index 0000000000..db518b5db8 --- /dev/null +++ b/release-please-config.json @@ -0,0 +1,25 @@ +{ + "release-type": "java-yoshi-mono-repo", + "separate-pull-requests": false, + "include-component-in-tag": false, + "group-pull-request-title-pattern": "chore(${branch}): release ${version}", + "packages": { + ".": { + "extra-files": [ + "WORKSPACE", + ".cloudbuild/graalvm/cloudbuild.yaml", + ".cloudbuild/graalvm/cloudbuild-test-a.yaml", + ".cloudbuild/graalvm/cloudbuild-test-b.yaml", + ".cloudbuild/graalvm/cloudbuild-test-c.yaml", + ".cloudbuild/library_generation/cloudbuild-library-generation-push.yaml", + ".cloudbuild/library_generation/library_generation.Dockerfile", + ".cloudbuild/library_generation/library_generation_airlock.Dockerfile", + "hermetic_build/library_generation/owlbot/templates/java_library/.kokoro/presubmit/graalvm-native-a.cfg", + "hermetic_build/library_generation/owlbot/templates/java_library/.kokoro/presubmit/graalvm-native-b.cfg", + "hermetic_build/library_generation/owlbot/templates/java_library/.kokoro/presubmit/graalvm-native-c.cfg", + "java-showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/Version.java" + + ] + } + } +} diff --git a/renovate.json b/renovate.json index 79c04a2d4f..a319663dbd 100644 --- a/renovate.json +++ b/renovate.json @@ -1,6 +1,231 @@ { "extends": [ - "config:base" + "config:recommended" ], - "ignorePaths": [".kokoro/requirements.txt"] + "dependencyDashboard": true, + "ignoreDeps": [ + "rules_pkg" + ], + "ignorePaths": [ + "^library_generation/requirements\\.txt$" + ], + "customManagers": [ + { + "customType": "regex", + "fileMatch": ["dependencies.txt"], + "matchStrings": ["(?.*),(.*)=(?.*)"], + "datasourceTemplate": "maven" + }, + { + "customType": "regex", + "fileMatch": [ + "^gax-java/dependencies\\.properties$" + ], + "matchStrings": [ + "=(?.+\\:.+?):(?.+?)\\n" + ], + "datasourceTemplate": "maven" + }, + { + "customType": "regex", + "fileMatch": [ + "^gax-java/dependencies\\.properties$" + ], + "matchStrings": [ + "version\\.google_java_format=(?.+?)\\n" + ], + "depNameTemplate": "com.google.googlejavaformat:google-java-format", + "datasourceTemplate": "maven" + }, + { + "customType": "regex", + "fileMatch": [ + "^gax-java/dependencies\\.properties$", + "^\\.cloudbuild/library_generation/library_generation.*\\.Dockerfile$" + ], + "matchStrings": [ + "version\\.io_grpc=(?.+?)\\n", + "ARG GRPC_VERSION=[\"']?(?.+?)[\"']?\\s+" + ], + "depNameTemplate": "io.grpc:grpc-core", + "datasourceTemplate": "maven" + }, + { + "customType": "regex", + "fileMatch": [ + "^.kokoro/presubmit/graalvm-native.*.cfg$" + ], + "matchStrings": [ + "value: \"gcr.io/cloud-devrel-kokoro-resources/graalvm:(?.*?)\"", + "value: \"gcr.io/cloud-devrel-kokoro-resources/graalvm17:(?.*?)\"" + ], + "depNameTemplate": "ghcr.io/graalvm/graalvm-ce", + "datasourceTemplate": "docker" + }, + { + "customType": "regex", + "fileMatch": [ + "^.cloudbuild/*" + ], + "matchStrings": [ + " _JAVA_SHARED_CONFIG_VERSION: '(?.+?)'" + ], + "depNameTemplate": "com.google.cloud:google-cloud-shared-config", + "datasourceTemplate": "maven" + }, + { + "customType": "regex", + "fileMatch": [ + "^.cloudbuild/library_generation/library_generation.*\\.Dockerfile$" + ], + "matchStrings": [ + "OWLBOT_CLI_COMMITTISH=(?.*?)\\n" + ], + "currentValueTemplate": "main", + "depNameTemplate": "repo-automation-bots", + "packageNameTemplate": "https://github.com/googleapis/repo-automation-bots", + "datasourceTemplate": "git-refs" + } + ], + "packageRules": [ + { + "matchPackageNames": [ + "com.google.cloud:google-cloud-shared-config" + ], + "registryUrls": [ + "https://repo.maven.apache.org/maven2/", + "https://repo1.maven.org/maven2" + ] + }, + { + "matchUpdateTypes": [ + "major" + ], + "enabled": false, + "matchPackageNames": [ + "*" + ] + }, + { + "enabled": false, + "matchPackageNames": [ + "/^com.google.protobuf:/" + ] + }, + { + "versioning": "docker", + "matchPackageNames": [ + "/^com.google.guava:/" + ], + "enabled": false + }, + { + "semanticCommitType": "deps", + "semanticCommitScope": null, + "matchPackageNames": [ + "*" + ] + }, + { + "semanticCommitType": "build", + "semanticCommitScope": "deps", + "enabled": true, + "matchPackageNames": [ + "/^org.apache.maven/", + "/^org.jacoco:/", + "/^org.codehaus.mojo:/", + "/^org.sonatype.plugins:/", + "/^com.google.cloud:google-cloud-shared-config/" + ] + }, + { + "semanticCommitType": "chore", + "semanticCommitScope": "deps", + "matchPackageNames": [ + "/^{{metadata['repo']['distribution_name']}}/", + "/^com.google.cloud:libraries-bom/", + "/^com.google.cloud.samples:shared-configuration/" + ] + }, + { + "semanticCommitType": "test", + "semanticCommitScope": "deps", + "matchPackageNames": [ + "/^junit:junit/", + "/^com.google.truth:truth/", + "/^org.mockito:mockito-core/", + "/^org.objenesis:objenesis/", + "/^com.google.cloud:google-cloud-conformance-tests/" + ] + }, + { + "ignoreUnstable": false, + "matchPackageNames": [ + "/^com.google.cloud:google-cloud-/" + ] + }, + { + "groupName": "jackson dependencies", + "matchPackageNames": [ + "/^com.fasterxml.jackson.core/" + ] + }, + { + "groupName": "gRPC dependencies", + "matchPackageNames": [ + "/^io.grpc/" + ], + "enabled": false + }, + { + "groupName": "Google Auth Library dependencies", + "matchPackageNames": [ + "/^com.google.auth/" + ] + }, + { + "groupName": "Google API dependencies", + "matchPackageNames": [ + "/com.google.api.grpc:grpc-google-common-protos/", + "/com.google.api.grpc:grpc-google-iam-v1/", + "/com.google.api.grpc:proto-google-common-protos/", + "/com.google.api.grpc:proto-google-iam-v1/", + "/com.google.api:api-common/" + ] + }, + { + "groupName": "Google HTTP Client dependencies", + "matchPackageNames": [ + "/^com.google.http-client/" + ] + }, + { + "groupName": "OpenCensus dependencies", + "matchPackageNames": [ + "/^io.opencensus/" + ] + }, + { + "groupName": "Netty dependencies", + "matchPackageNames": [ + "/^io.netty/" + ] + }, + { + "groupName": "Error Prone dependencies", + "matchPackageNames": [ + "/^com.google.errorprone/" + ] + }, + { + "matchManagers": [ + "regex" + ], + "semanticCommitType": "chore", + "matchFileNames": ["dependencies.txt"], + "matchDatasources": ["maven"], + "groupName": "Upper Bound Dependencies File", + "description": "Group all dependencies from the Upper Bound Dependencies File" + } + ] } diff --git a/repositories.bzl b/repositories.bzl deleted file mode 100644 index 5b651757d5..0000000000 --- a/repositories.bzl +++ /dev/null @@ -1,87 +0,0 @@ -# Copyright 2019 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_jar") -load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") -load("@bazel_tools//tools/build_defs/repo:jvm.bzl", "jvm_maven_import_external") -load("//:PROPERTIES.bzl", "PROPERTIES") - -def gapic_generator_java_repositories(): - # Import dependencies shared between Gradle and Bazel (i.e. maven dependencies) - for name, artifact in PROPERTIES.items(): - _maybe( - jvm_maven_import_external, - name = name, - strip_repo_prefix = "maven.", - artifact = _fix_bazel_artifact_format(artifact), - server_urls = ["https://repo.maven.apache.org/maven2/", "http://repo1.maven.org/maven2/"], - licenses = ["notice", "reciprocal"], - ) - - # Import Bazel-only dependencies (Gradle version will import maven artifacts of same - # version, while Bazel will depend on Bazel workspaces). The versions are shared in the - # properties file. - _protobuf_version = PROPERTIES["version.com_google_protobuf"] - _maybe( - http_archive, - name = "com_google_protobuf", - urls = ["https://github.com/protocolbuffers/protobuf/archive/v%s.zip" % _protobuf_version], - strip_prefix = "protobuf-%s" % _protobuf_version, - ) - - _maybe( - jvm_maven_import_external, - name = "google_java_format_all_deps", - artifact = "com.google.googlejavaformat:google-java-format:jar:all-deps:%s" % PROPERTIES["version.google_java_format"], - server_urls = ["https://repo.maven.apache.org/maven2/", "http://repo1.maven.org/maven2/"], - licenses = ["notice", "reciprocal"], - ) - - _maybe( - http_archive, - name = "bazel_skylib", - sha256 = "18ae58793e9036305e02333f6d59c9e0ea73e6d066d874c04bb83a1c5c9ac4a7", - strip_prefix = "bazel-skylib-872e9b06e18ae8ba2897cb65b9aaa172aa6279f3", - urls = ["https://github.com/bazelbuild/bazel-skylib/archive/872e9b06e18ae8ba2897cb65b9aaa172aa6279f3.tar.gz"], - ) - - _maybe( - native.bind, - name = "guava", - actual = "@com_google_guava_guava//jar", - ) - - _maybe( - native.bind, - name = "gson", - actual = "@com_google_code_gson_gson//jar", - ) - -def _maybe(repo_rule, name, strip_repo_prefix = "", **kwargs): - if not name.startswith(strip_repo_prefix): - return - repo_name = name[len(strip_repo_prefix):] - if repo_name in native.existing_rules(): - return - repo_rule(name = repo_name, **kwargs) - -def _fix_bazel_artifact_format(artifact_id): - # Fix the artifact id format discrepancy between Bazel & Gradle. - # This is relevant only when classifier is specified explicitly. - # Bazel format: groupId:artifactId:jar:classifier:version - # Gradle format: groupId:artifactId:version:classifier - ids = artifact_id.split(":") - if len(ids) != 4: - return artifact_id - return "%s:%s:%s:%s:%s" % (ids[0], ids[1], "jar", ids[3], ids[2]) diff --git a/rules_java_gapic/BUILD.bazel b/rules_java_gapic/BUILD.bazel index 34a5a2948d..9ec683154f 100644 --- a/rules_java_gapic/BUILD.bazel +++ b/rules_java_gapic/BUILD.bazel @@ -1,4 +1,4 @@ -load("@bazel_tools//tools/build_defs/pkg:pkg.bzl", "pkg_tar") +load("@rules_pkg//pkg:pkg.bzl", "pkg_tar") package(default_visibility = ["//visibility:public"]) diff --git a/rules_java_gapic/java_gapic.bzl b/rules_java_gapic/java_gapic.bzl index eb2cdee79a..fdab81e7af 100644 --- a/rules_java_gapic/java_gapic.bzl +++ b/rules_java_gapic/java_gapic.bzl @@ -37,7 +37,7 @@ def _java_gapic_postprocess_srcjar_impl(ctx): WORKING_DIR=`pwd` # Main source files. - cd {output_dir_path}/src/main/java + cd {output_dir_path}/src/main zip -r $WORKING_DIR/{output_srcjar_name}.srcjar ./ # Resource name source files. @@ -94,7 +94,7 @@ _java_gapic_postprocess_srcjar = rule( "formatter": attr.label( default = Label("//:google_java_format_binary"), executable = True, - cfg = "host", + cfg = "exec", ), }, outputs = { @@ -152,7 +152,7 @@ _java_gapic_samples_srcjar = rule( "formatter": attr.label( default = Label("//:google_java_format_binary"), executable = True, - cfg = "host", + cfg = "exec", ), }, outputs = { @@ -333,6 +333,7 @@ def java_gapic_library( # Test deps. actual_test_deps = [ "@com_google_googleapis//google/type:type_java_proto", # Commonly used. + "@com_google_googleapis//google/geo/type:viewport_java_proto", # Used by Geo. "@com_google_api_gax_java//gax:gax_testlib", "@com_google_code_gson_gson//jar", "@junit_junit//jar", diff --git a/rules_java_gapic/java_gapic_pkg.bzl b/rules_java_gapic/java_gapic_pkg.bzl index 36a0d4314c..de71350113 100644 --- a/rules_java_gapic/java_gapic_pkg.bzl +++ b/rules_java_gapic/java_gapic_pkg.bzl @@ -13,6 +13,7 @@ # limitations under the License. load("@com_google_api_gax_java_properties//:dependencies.properties.bzl", "PROPERTIES") +load("@com_google_protobuf//:protobuf_version.bzl", "PROTOBUF_JAVA_VERSION") def _wrapPropertyNamesInBraces(properties): wrappedProperties = {} @@ -20,7 +21,13 @@ def _wrapPropertyNamesInBraces(properties): wrappedProperties["{{%s}}" % k] = v return wrappedProperties -_PROPERTIES = _wrapPropertyNamesInBraces(PROPERTIES) +# Before this replacement, there was a problem (e.g., b/284292352) when +# the version of protobuf defined in googleapis is higher than protobuf +# defined in gax-java/dependencies.properties, use this replacement to +# sync the two versions. +SYNCED_PROPERTIES = dict(PROPERTIES) +SYNCED_PROPERTIES.update({"version.com_google_protobuf": PROTOBUF_JAVA_VERSION}) +_PROPERTIES = _wrapPropertyNamesInBraces(SYNCED_PROPERTIES) # ======================================================================== # General packaging helpers. @@ -63,7 +70,7 @@ def _gapic_pkg_tar_impl(ctx): for f in dep.files.to_list(): deps.append(f) - samples =[] + samples = [] for s in ctx.attr.samples: for f in s.files.to_list(): samples.append(f) @@ -142,7 +149,7 @@ def _construct_extra_deps(scope_to_deps, versions_map): if not extra_deps.get(key): extra_deps[key] = "%s project(':%s')" % (scope, pkg_dependency) elif _is_java_dependency(dep): - for f in dep[JavaInfo].transitive_deps.to_list(): + for f in dep[JavaInfo].transitive_compile_time_jars.to_list(): maven_artifact = label_name_to_maven_artifact.get(f.owner.name) if not maven_artifact: continue @@ -267,6 +274,14 @@ def _java_gapic_srcs_pkg_impl(ctx): unzip -q -o $src -d {package_dir_path}/src/main/java rm -r -f {package_dir_path}/src/main/java/META-INF + # GAPIC libraries generate java/ and resources/ folders, unlike grpc and proto. + # If this is a GAPIC library, move its output up one directory. + if [ -d {package_dir_path}/src/main/java/java ]; then + mv {package_dir_path}/src/main/java {package_dir_path}/src/main/tmp-java + mv {package_dir_path}/src/main/tmp-java/* {package_dir_path}/src/main + rm -d {package_dir_path}/src/main/tmp-java + fi + # Remove empty files. If there are no resource names, one such file might have # been created. See java_gapic.bzl. find {package_dir_path}/src/main/java -type f -size 0 | while read f; do rm -f $f; done diff --git a/rules_java_gapic/resources/gradle/client_grpc.gradle.tmpl b/rules_java_gapic/resources/gradle/client_grpc.gradle.tmpl index 2b12008b58..35a1ba56c9 100644 --- a/rules_java_gapic/resources/gradle/client_grpc.gradle.tmpl +++ b/rules_java_gapic/resources/gradle/client_grpc.gradle.tmpl @@ -6,11 +6,11 @@ compileJava.options.encoding = 'UTF-8' javadoc.options.encoding = 'UTF-8' dependencies { - implementation 'com.google.api:gax:{{version.gax}}' + api 'com.google.api:gax:{{version.gax}}' testImplementation 'com.google.api:gax:{{version.gax}}:testlib' - implementation 'com.google.api:gax-grpc:{{version.gax_grpc}}' + api 'com.google.api:gax-grpc:{{version.gax_grpc}}' testImplementation 'com.google.api:gax-grpc:{{version.gax_grpc}}:testlib' - implementation 'io.grpc:grpc-protobuf:{{version.io_grpc}}' + api 'io.grpc:grpc-protobuf:{{version.io_grpc}}' testImplementation 'io.grpc:grpc-stub:{{version.io_grpc}}' testImplementation 'io.grpc:grpc-netty-shaded:{{version.io_grpc}}' testImplementation '{{maven.junit_junit}}' @@ -37,6 +37,15 @@ clean { delete 'all-jars' } +task javadocJar(type: Jar) { + archiveClassifier = 'javadoc' + from javadoc +} + +artifacts { + archives javadocJar +} + task allJars(type: Copy) { dependsOn test, jar into 'all-jars' diff --git a/rules_java_gapic/resources/gradle/client_grpcrest.gradle.tmpl b/rules_java_gapic/resources/gradle/client_grpcrest.gradle.tmpl index edd95846c3..9b475a5cb7 100644 --- a/rules_java_gapic/resources/gradle/client_grpcrest.gradle.tmpl +++ b/rules_java_gapic/resources/gradle/client_grpcrest.gradle.tmpl @@ -6,13 +6,13 @@ compileJava.options.encoding = 'UTF-8' javadoc.options.encoding = 'UTF-8' dependencies { - implementation 'com.google.api:gax:{{version.gax}}' + api 'com.google.api:gax:{{version.gax}}' testImplementation 'com.google.api:gax:{{version.gax}}:testlib' - implementation 'com.google.api:gax-grpc:{{version.gax_grpc}}' + api 'com.google.api:gax-grpc:{{version.gax_grpc}}' testImplementation 'com.google.api:gax-grpc:{{version.gax_grpc}}:testlib' - implementation 'com.google.api:gax-httpjson:{{version.gax_httpjson}}' + api 'com.google.api:gax-httpjson:{{version.gax_httpjson}}' testImplementation 'com.google.api:gax-httpjson:{{version.gax_httpjson}}:testlib' - implementation 'io.grpc:grpc-protobuf:{{version.io_grpc}}' + api 'io.grpc:grpc-protobuf:{{version.io_grpc}}' testImplementation 'io.grpc:grpc-stub:{{version.io_grpc}}' testImplementation 'io.grpc:grpc-netty-shaded:{{version.io_grpc}}' testImplementation '{{maven.junit_junit}}' @@ -39,6 +39,15 @@ clean { delete 'all-jars' } +task javadocJar(type: Jar) { + archiveClassifier = 'javadoc' + from javadoc +} + +artifacts { + archives javadocJar +} + task allJars(type: Copy) { dependsOn test, jar into 'all-jars' diff --git a/rules_java_gapic/resources/gradle/client_rest.gradle.tmpl b/rules_java_gapic/resources/gradle/client_rest.gradle.tmpl index aeb2e68d36..bdd69028e7 100644 --- a/rules_java_gapic/resources/gradle/client_rest.gradle.tmpl +++ b/rules_java_gapic/resources/gradle/client_rest.gradle.tmpl @@ -6,9 +6,9 @@ compileJava.options.encoding = 'UTF-8' javadoc.options.encoding = 'UTF-8' dependencies { - implementation 'com.google.api:gax:{{version.gax}}' + api 'com.google.api:gax:{{version.gax}}' testImplementation 'com.google.api:gax:{{version.gax}}:testlib' - implementation 'com.google.api:gax-httpjson:{{version.gax_httpjson}}' + api 'com.google.api:gax-httpjson:{{version.gax_httpjson}}' testImplementation 'com.google.api:gax-httpjson:{{version.gax_httpjson}}:testlib' testImplementation '{{maven.junit_junit}}' @@ -34,6 +34,15 @@ clean { delete 'all-jars' } +task javadocJar(type: Jar) { + archiveClassifier = 'javadoc' + from javadoc +} + +artifacts { + archives javadocJar +} + task allJars(type: Copy) { dependsOn test, jar into 'all-jars' diff --git a/rules_java_gapic/resources/gradle/gradle/wrapper/gradle-wrapper.properties b/rules_java_gapic/resources/gradle/gradle/wrapper/gradle-wrapper.properties index 070cb702f0..3994438e22 100644 --- a/rules_java_gapic/resources/gradle/gradle/wrapper/gradle-wrapper.properties +++ b/rules_java_gapic/resources/gradle/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.6-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.4-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/scripts/create_native_image_test_env.sh b/scripts/create_native_image_test_env.sh new file mode 100644 index 0000000000..4e3689ec30 --- /dev/null +++ b/scripts/create_native_image_test_env.sh @@ -0,0 +1,234 @@ +#!/bin/bash + +# This script creates a submodule project with all the necessary repositories (forked) and changes needed to test +# GraalVM updates with handwritten libraries (including, pubsub, bigquery, bigtable and spanner-jdbc). +# It serves two main purposes; first, it allows for the creation of a testing environment that can be shared with +# teammates and second, given that the submodule leverages creation of test branches in the (forked) repositories, +# any extra configurations necessary for making the library compatible with GraalVM can easily be sent for review as a PR +# from the branch itself. +# At a high-level, the script will do the following: +# - Modifies graal-sdk version in gapic-generator-java/gax +# - Modifies the gapic-generator-bom version in java-shared-dependencies. +# - Updates the version of native-maven-plugin in java-shared-config. +# - Updates the java-shared-config and java-shared-dependencies versions in the handwritten libraries listed. +# - Adds gapic-generator-java, java-shared-config and handwritten libraries listed previously +# with the associated changes, to the submodule project. +set -eo pipefail + +function modify_shared_config() { + xmllint --shell pom.xml < + + + + + + + diff --git a/sdk-platform-java-config/pom.xml b/sdk-platform-java-config/pom.xml new file mode 100644 index 0000000000..0216342c79 --- /dev/null +++ b/sdk-platform-java-config/pom.xml @@ -0,0 +1,24 @@ + + + 4.0.0 + com.google.cloud + sdk-platform-java-config + pom + 3.58.1-SNAPSHOT + SDK Platform For Java Configurations + + Shared build configuration for Google Cloud Java libraries. + + + + com.google.cloud + google-cloud-shared-config + 1.17.0 + + + + 3.58.1-SNAPSHOT + + true + + \ No newline at end of file diff --git a/settings.xml b/settings.xml new file mode 100644 index 0000000000..5f2958623a --- /dev/null +++ b/settings.xml @@ -0,0 +1,32 @@ + + + + + + + + + + + + + + + diff --git a/showcase/BUILD.bazel b/showcase/BUILD.bazel deleted file mode 100644 index 919547453c..0000000000 --- a/showcase/BUILD.bazel +++ /dev/null @@ -1,138 +0,0 @@ -load( - "//rules_java_gapic:java_gapic.bzl", - "java_gapic_library", - "java_gapic_test", -) -load("@io_grpc_grpc_java//:java_grpc_library.bzl", "java_grpc_library") -load("@rules_gapic//:gapic.bzl", "proto_library_with_info") -load("@rules_proto//proto:defs.bzl", "proto_library") -load("//rules_java_gapic:java_gapic_pkg.bzl", "java_gapic_assembly_gradle_pkg") - -package(default_visibility = ["//visibility:public"]) - -proto_library_with_info( - name = "showcase_proto_with_info", - deps = [ - "@com_google_gapic_showcase//schema/google/showcase/v1beta1:showcase_proto", - "@com_google_googleapis//google/cloud:common_resources_proto", - ], -) - -java_proto_library( - name = "showcase_java_proto", - deps = ["@com_google_gapic_showcase//schema/google/showcase/v1beta1:showcase_proto"], -) - -java_grpc_library( - name = "showcase_java_grpc", - srcs = ["@com_google_gapic_showcase//schema/google/showcase/v1beta1:showcase_proto"], - deps = [":showcase_java_proto"], -) - -java_gapic_library( - name = "showcase_java_gapic", - srcs = [":showcase_proto_with_info"], - gapic_yaml = None, - grpc_service_config = "@com_google_gapic_showcase//schema/google/showcase/v1beta1:showcase_grpc_service_config.json", - rest_numeric_enums = True, - service_yaml = "@com_google_gapic_showcase//schema/google/showcase/v1beta1:showcase_v1beta1.yaml", - test_deps = [ - ":showcase_java_grpc", - ], - transport = "grpc+rest", - deps = [ - ":showcase_java_proto", - "@com_google_googleapis//google/api:api_java_proto", - ], -) - -# Open Source Packages -java_gapic_assembly_gradle_pkg( - name = "google-cloud-showcase-v1beta1-java", - transport = "grpc+rest", - deps = [ - ":showcase_java_gapic", - ":showcase_java_grpc", - ":showcase_java_proto", - "@com_google_gapic_showcase//schema/google/showcase/v1beta1:showcase_proto", - ], -) - -# Golden File Directories -filegroup( - name = "gapic_showcase_files", - srcs = glob(["gapic-showcase/src/**"]), -) - -filegroup( - name = "grpc_gapic_showcase_files", - srcs = glob(["grpc-gapic-showcase-v1beta1/src/**"]), -) - -filegroup( - name = "proto_gapic_showcase_files", - srcs = glob(["proto-gapic-showcase-v1beta1/src/**"]), -) - -# GAPIC Showcase : Update and Verify -GAPIC_DATA = [ - "showcase_java_gapic_srcjar_raw.srcjar", - ":gapic_showcase_files", - "//showcase:showcase_java_gapic", -] - -sh_binary( - name = "update_gapic", - srcs = ["//showcase/scripts:update.sh"], - args = ["gapic"], - data = GAPIC_DATA, -) - -sh_binary( - name = "verify_gapic", - srcs = ["//showcase/scripts:verify.sh"], - args = ["gapic"], - data = GAPIC_DATA, -) - -# GRPC Showcase : Update and Verify -GRPC_DATA = [ - "libshowcase_java_grpc-src.jar", - ":grpc_gapic_showcase_files", - "//showcase:showcase_java_grpc", -] - -sh_binary( - name = "update_grpc", - srcs = ["//showcase/scripts:update.sh"], - args = ["grpc"], - data = GRPC_DATA, -) - -sh_binary( - name = "verify_grpc", - srcs = ["//showcase/scripts:verify.sh"], - args = ["grpc"], - data = GRPC_DATA, -) - -# Proto Showcase : Update and Verify -PROTO_DATA = [ - "proto-google-cloud-showcase-v1beta1-java.tar.gz", - ":proto_gapic_showcase_files", - "//showcase:showcase_java_proto", -] - -sh_binary( - name = "update_proto", - srcs = ["//showcase/scripts:update.sh"], - args = ["proto"], - data = PROTO_DATA, -) - -sh_binary( - name = "verify_proto", - srcs = ["//showcase/scripts:verify.sh"], - args = ["proto"], - data = PROTO_DATA, -) diff --git a/showcase/gapic-showcase/pom.xml b/showcase/gapic-showcase/pom.xml deleted file mode 100644 index 92c7b7a8a3..0000000000 --- a/showcase/gapic-showcase/pom.xml +++ /dev/null @@ -1,193 +0,0 @@ - - - 4.0.0 - com.google.cloud - gapic-showcase - 0.0.1-SHAPSHOT - jar - GAPIC Showcase Client - - GAPIC Showcase is an API that demonstrates Generated API Client (GAPIC) features and common API - patterns used by Google. - - - com.google.cloud - gapic-showcase-parent - 0.0.1-SNAPSHOT - - - - true - - - - - enable-golden-tests - - true - - - - - org.codehaus.mojo - exec-maven-plugin - 3.1.0 - - - verify-showcase - - exec - - test - - bazel - - run - //showcase:verify_gapic - - - - - - - - - - update - - - - org.codehaus.mojo - exec-maven-plugin - 3.1.0 - - - verify-showcase - - exec - - generate-sources - - bazelisk - - run - //showcase:update_gapic - - - - - - - - - - - - - - org.jacoco - jacoco-maven-plugin - 0.8.8 - - - report - - report - - - - XML - HTML - - - - - - - - - - - io.grpc - grpc-api - - - io.grpc - grpc-stub - - - io.grpc - grpc-protobuf - - - com.google.api - api-common - - - com.google.protobuf - protobuf-java - - - com.google.api.grpc - proto-google-common-protos - - - com.google.api.grpc - proto-google-iam-v1 - - - com.google.api.grpc - proto-gapic-showcase-v1beta1 - - - com.google.guava - guava - - - com.google.api - gax - - - com.google.api - gax-grpc - - - com.google.api - gax-httpjson - - - - - junit - junit - test - - - - com.google.api.grpc - grpc-gapic-showcase-v1beta1 - test - - - - com.google.api - gax - testlib - test - - - com.google.api - gax-grpc - testlib - test - - - com.google.api - gax-httpjson - testlib - test - - - diff --git a/showcase/gapic-showcase/proto/src/main/java/com/google/showcase/v1beta1/BlurbName.java b/showcase/gapic-showcase/proto/src/main/java/com/google/showcase/v1beta1/BlurbName.java deleted file mode 100644 index 32f3ed2380..0000000000 --- a/showcase/gapic-showcase/proto/src/main/java/com/google/showcase/v1beta1/BlurbName.java +++ /dev/null @@ -1,473 +0,0 @@ -/* - * 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 - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1; - -import com.google.api.core.BetaApi; -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 BlurbName implements ResourceName { - private static final PathTemplate USER_LEGACY_USER_BLURB = - PathTemplate.createWithoutUrlEncoding( - "users/{user}/profile/blurbs/legacy/{legacy_user}~{blurb}"); - private static final PathTemplate USER_BLURB = - PathTemplate.createWithoutUrlEncoding("users/{user}/profile/blurbs/{blurb}"); - private static final PathTemplate ROOM_BLURB = - PathTemplate.createWithoutUrlEncoding("rooms/{room}/blurbs/{blurb}"); - private static final PathTemplate ROOM_LEGACY_ROOM_BLURB = - PathTemplate.createWithoutUrlEncoding("rooms/{room}/blurbs/legacy/{legacy_room}.{blurb}"); - private volatile Map fieldValuesMap; - private PathTemplate pathTemplate; - private String fixedValue; - private final String user; - private final String legacyUser; - private final String blurb; - private final String room; - private final String legacyRoom; - - @Deprecated - protected BlurbName() { - user = null; - legacyUser = null; - blurb = null; - room = null; - legacyRoom = null; - } - - private BlurbName(Builder builder) { - user = Preconditions.checkNotNull(builder.getUser()); - legacyUser = Preconditions.checkNotNull(builder.getLegacyUser()); - blurb = Preconditions.checkNotNull(builder.getBlurb()); - room = null; - legacyRoom = null; - pathTemplate = USER_LEGACY_USER_BLURB; - } - - private BlurbName(UserBlurbBuilder builder) { - user = Preconditions.checkNotNull(builder.getUser()); - blurb = Preconditions.checkNotNull(builder.getBlurb()); - legacyUser = null; - room = null; - legacyRoom = null; - pathTemplate = USER_BLURB; - } - - private BlurbName(RoomBlurbBuilder builder) { - room = Preconditions.checkNotNull(builder.getRoom()); - blurb = Preconditions.checkNotNull(builder.getBlurb()); - user = null; - legacyUser = null; - legacyRoom = null; - pathTemplate = ROOM_BLURB; - } - - private BlurbName(RoomLegacyRoomBlurbBuilder builder) { - room = Preconditions.checkNotNull(builder.getRoom()); - legacyRoom = Preconditions.checkNotNull(builder.getLegacyRoom()); - blurb = Preconditions.checkNotNull(builder.getBlurb()); - user = null; - legacyUser = null; - pathTemplate = ROOM_LEGACY_ROOM_BLURB; - } - - public String getUser() { - return user; - } - - public String getLegacyUser() { - return legacyUser; - } - - public String getBlurb() { - return blurb; - } - - public String getRoom() { - return room; - } - - public String getLegacyRoom() { - return legacyRoom; - } - - public static Builder newBuilder() { - return new Builder(); - } - - @BetaApi("The per-pattern Builders are not stable yet and may be changed in the future.") - public static Builder newUserLegacyUserBlurbBuilder() { - return new Builder(); - } - - @BetaApi("The per-pattern Builders are not stable yet and may be changed in the future.") - public static UserBlurbBuilder newUserBlurbBuilder() { - return new UserBlurbBuilder(); - } - - @BetaApi("The per-pattern Builders are not stable yet and may be changed in the future.") - public static RoomBlurbBuilder newRoomBlurbBuilder() { - return new RoomBlurbBuilder(); - } - - @BetaApi("The per-pattern Builders are not stable yet and may be changed in the future.") - public static RoomLegacyRoomBlurbBuilder newRoomLegacyRoomBlurbBuilder() { - return new RoomLegacyRoomBlurbBuilder(); - } - - public Builder toBuilder() { - return new Builder(this); - } - - public static BlurbName of(String user, String legacyUser, String blurb) { - return newBuilder().setUser(user).setLegacyUser(legacyUser).setBlurb(blurb).build(); - } - - @BetaApi("The static create methods are not stable yet and may be changed in the future.") - public static BlurbName ofUserLegacyUserBlurbName(String user, String legacyUser, String blurb) { - return newBuilder().setUser(user).setLegacyUser(legacyUser).setBlurb(blurb).build(); - } - - @BetaApi("The static create methods are not stable yet and may be changed in the future.") - public static BlurbName ofUserBlurbName(String user, String blurb) { - return newUserBlurbBuilder().setUser(user).setBlurb(blurb).build(); - } - - @BetaApi("The static create methods are not stable yet and may be changed in the future.") - public static BlurbName ofRoomBlurbName(String room, String blurb) { - return newRoomBlurbBuilder().setRoom(room).setBlurb(blurb).build(); - } - - @BetaApi("The static create methods are not stable yet and may be changed in the future.") - public static BlurbName ofRoomLegacyRoomBlurbName(String room, String legacyRoom, String blurb) { - return newRoomLegacyRoomBlurbBuilder() - .setRoom(room) - .setLegacyRoom(legacyRoom) - .setBlurb(blurb) - .build(); - } - - public static String format(String user, String legacyUser, String blurb) { - return newBuilder().setUser(user).setLegacyUser(legacyUser).setBlurb(blurb).build().toString(); - } - - @BetaApi("The static format methods are not stable yet and may be changed in the future.") - public static String formatUserLegacyUserBlurbName(String user, String legacyUser, String blurb) { - return newBuilder().setUser(user).setLegacyUser(legacyUser).setBlurb(blurb).build().toString(); - } - - @BetaApi("The static format methods are not stable yet and may be changed in the future.") - public static String formatUserBlurbName(String user, String blurb) { - return newUserBlurbBuilder().setUser(user).setBlurb(blurb).build().toString(); - } - - @BetaApi("The static format methods are not stable yet and may be changed in the future.") - public static String formatRoomBlurbName(String room, String blurb) { - return newRoomBlurbBuilder().setRoom(room).setBlurb(blurb).build().toString(); - } - - @BetaApi("The static format methods are not stable yet and may be changed in the future.") - public static String formatRoomLegacyRoomBlurbName(String room, String legacyRoom, String blurb) { - return newRoomLegacyRoomBlurbBuilder() - .setRoom(room) - .setLegacyRoom(legacyRoom) - .setBlurb(blurb) - .build() - .toString(); - } - - public static BlurbName parse(String formattedString) { - if (formattedString.isEmpty()) { - return null; - } - if (USER_LEGACY_USER_BLURB.matches(formattedString)) { - Map matchMap = USER_LEGACY_USER_BLURB.match(formattedString); - return ofUserLegacyUserBlurbName( - matchMap.get("user"), matchMap.get("legacy_user"), matchMap.get("blurb")); - } else if (USER_BLURB.matches(formattedString)) { - Map matchMap = USER_BLURB.match(formattedString); - return ofUserBlurbName(matchMap.get("user"), matchMap.get("blurb")); - } else if (ROOM_BLURB.matches(formattedString)) { - Map matchMap = ROOM_BLURB.match(formattedString); - return ofRoomBlurbName(matchMap.get("room"), matchMap.get("blurb")); - } else if (ROOM_LEGACY_ROOM_BLURB.matches(formattedString)) { - Map matchMap = ROOM_LEGACY_ROOM_BLURB.match(formattedString); - return ofRoomLegacyRoomBlurbName( - matchMap.get("room"), matchMap.get("legacy_room"), matchMap.get("blurb")); - } - throw new ValidationException("BlurbName.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 (BlurbName value : values) { - if (value == null) { - list.add(""); - } else { - list.add(value.toString()); - } - } - return list; - } - - public static boolean isParsableFrom(String formattedString) { - return USER_LEGACY_USER_BLURB.matches(formattedString) - || USER_BLURB.matches(formattedString) - || ROOM_BLURB.matches(formattedString) - || ROOM_LEGACY_ROOM_BLURB.matches(formattedString); - } - - @Override - public Map getFieldValuesMap() { - if (fieldValuesMap == null) { - synchronized (this) { - if (fieldValuesMap == null) { - ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); - if (user != null) { - fieldMapBuilder.put("user", user); - } - if (legacyUser != null) { - fieldMapBuilder.put("legacy_user", legacyUser); - } - if (blurb != null) { - fieldMapBuilder.put("blurb", blurb); - } - if (room != null) { - fieldMapBuilder.put("room", room); - } - if (legacyRoom != null) { - fieldMapBuilder.put("legacy_room", legacyRoom); - } - 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()) { - BlurbName that = ((BlurbName) o); - return Objects.equals(this.user, that.user) - && Objects.equals(this.legacyUser, that.legacyUser) - && Objects.equals(this.blurb, that.blurb) - && Objects.equals(this.room, that.room) - && Objects.equals(this.legacyRoom, that.legacyRoom); - } - return false; - } - - @Override - public int hashCode() { - int h = 1; - h *= 1000003; - h ^= Objects.hashCode(fixedValue); - h *= 1000003; - h ^= Objects.hashCode(user); - h *= 1000003; - h ^= Objects.hashCode(legacyUser); - h *= 1000003; - h ^= Objects.hashCode(blurb); - h *= 1000003; - h ^= Objects.hashCode(room); - h *= 1000003; - h ^= Objects.hashCode(legacyRoom); - return h; - } - - /** Builder for users/{user}/profile/blurbs/legacy/{legacy_user}~{blurb}. */ - public static class Builder { - private String user; - private String legacyUser; - private String blurb; - - protected Builder() {} - - public String getUser() { - return user; - } - - public String getLegacyUser() { - return legacyUser; - } - - public String getBlurb() { - return blurb; - } - - public Builder setUser(String user) { - this.user = user; - return this; - } - - public Builder setLegacyUser(String legacyUser) { - this.legacyUser = legacyUser; - return this; - } - - public Builder setBlurb(String blurb) { - this.blurb = blurb; - return this; - } - - private Builder(BlurbName blurbName) { - Preconditions.checkArgument( - Objects.equals(blurbName.pathTemplate, USER_LEGACY_USER_BLURB), - "toBuilder is only supported when BlurbName has the pattern of users/{user}/profile/blurbs/legacy/{legacy_user}~{blurb}"); - this.user = blurbName.user; - this.legacyUser = blurbName.legacyUser; - this.blurb = blurbName.blurb; - } - - public BlurbName build() { - return new BlurbName(this); - } - } - - /** Builder for users/{user}/profile/blurbs/{blurb}. */ - @BetaApi("The per-pattern Builders are not stable yet and may be changed in the future.") - public static class UserBlurbBuilder { - private String user; - private String blurb; - - protected UserBlurbBuilder() {} - - public String getUser() { - return user; - } - - public String getBlurb() { - return blurb; - } - - public UserBlurbBuilder setUser(String user) { - this.user = user; - return this; - } - - public UserBlurbBuilder setBlurb(String blurb) { - this.blurb = blurb; - return this; - } - - public BlurbName build() { - return new BlurbName(this); - } - } - - /** Builder for rooms/{room}/blurbs/{blurb}. */ - @BetaApi("The per-pattern Builders are not stable yet and may be changed in the future.") - public static class RoomBlurbBuilder { - private String room; - private String blurb; - - protected RoomBlurbBuilder() {} - - public String getRoom() { - return room; - } - - public String getBlurb() { - return blurb; - } - - public RoomBlurbBuilder setRoom(String room) { - this.room = room; - return this; - } - - public RoomBlurbBuilder setBlurb(String blurb) { - this.blurb = blurb; - return this; - } - - public BlurbName build() { - return new BlurbName(this); - } - } - - /** Builder for rooms/{room}/blurbs/legacy/{legacy_room}.{blurb}. */ - @BetaApi("The per-pattern Builders are not stable yet and may be changed in the future.") - public static class RoomLegacyRoomBlurbBuilder { - private String room; - private String legacyRoom; - private String blurb; - - protected RoomLegacyRoomBlurbBuilder() {} - - public String getRoom() { - return room; - } - - public String getLegacyRoom() { - return legacyRoom; - } - - public String getBlurb() { - return blurb; - } - - public RoomLegacyRoomBlurbBuilder setRoom(String room) { - this.room = room; - return this; - } - - public RoomLegacyRoomBlurbBuilder setLegacyRoom(String legacyRoom) { - this.legacyRoom = legacyRoom; - return this; - } - - public RoomLegacyRoomBlurbBuilder setBlurb(String blurb) { - this.blurb = blurb; - return this; - } - - public BlurbName build() { - return new BlurbName(this); - } - } -} diff --git a/showcase/gapic-showcase/proto/src/main/java/com/google/showcase/v1beta1/ProfileName.java b/showcase/gapic-showcase/proto/src/main/java/com/google/showcase/v1beta1/ProfileName.java deleted file mode 100644 index b69500d0ae..0000000000 --- a/showcase/gapic-showcase/proto/src/main/java/com/google/showcase/v1beta1/ProfileName.java +++ /dev/null @@ -1,168 +0,0 @@ -/* - * 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 - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1; - -import com.google.api.pathtemplate.PathTemplate; -import com.google.api.resourcenames.ResourceName; -import com.google.common.base.Preconditions; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import javax.annotation.Generated; - -// AUTO-GENERATED DOCUMENTATION AND CLASS. -@Generated("by gapic-generator-java") -public class ProfileName implements ResourceName { - private static final PathTemplate USER = - PathTemplate.createWithoutUrlEncoding("users/{user}/profile/blurbs"); - private volatile Map fieldValuesMap; - private final String user; - - @Deprecated - protected ProfileName() { - user = null; - } - - private ProfileName(Builder builder) { - user = Preconditions.checkNotNull(builder.getUser()); - } - - public String getUser() { - return user; - } - - public static Builder newBuilder() { - return new Builder(); - } - - public Builder toBuilder() { - return new Builder(this); - } - - public static ProfileName of(String user) { - return newBuilder().setUser(user).build(); - } - - public static String format(String user) { - return newBuilder().setUser(user).build().toString(); - } - - public static ProfileName parse(String formattedString) { - if (formattedString.isEmpty()) { - return null; - } - Map matchMap = - USER.validatedMatch( - formattedString, "ProfileName.parse: formattedString not in valid format"); - return of(matchMap.get("user")); - } - - 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 (ProfileName value : values) { - if (value == null) { - list.add(""); - } else { - list.add(value.toString()); - } - } - return list; - } - - public static boolean isParsableFrom(String formattedString) { - return USER.matches(formattedString); - } - - @Override - public Map getFieldValuesMap() { - if (fieldValuesMap == null) { - synchronized (this) { - if (fieldValuesMap == null) { - ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); - if (user != null) { - fieldMapBuilder.put("user", user); - } - fieldValuesMap = fieldMapBuilder.build(); - } - } - } - return fieldValuesMap; - } - - public String getFieldValue(String fieldName) { - return getFieldValuesMap().get(fieldName); - } - - @Override - public String toString() { - return USER.instantiate("user", user); - } - - @Override - public boolean equals(Object o) { - if (o == this) { - return true; - } - if (o != null || getClass() == o.getClass()) { - ProfileName that = ((ProfileName) o); - return Objects.equals(this.user, that.user); - } - return false; - } - - @Override - public int hashCode() { - int h = 1; - h *= 1000003; - h ^= Objects.hashCode(user); - return h; - } - - /** Builder for users/{user}/profile/blurbs. */ - public static class Builder { - private String user; - - protected Builder() {} - - public String getUser() { - return user; - } - - public Builder setUser(String user) { - this.user = user; - return this; - } - - private Builder(ProfileName profileName) { - this.user = profileName.user; - } - - public ProfileName build() { - return new ProfileName(this); - } - } -} diff --git a/showcase/gapic-showcase/proto/src/main/java/com/google/showcase/v1beta1/RoomName.java b/showcase/gapic-showcase/proto/src/main/java/com/google/showcase/v1beta1/RoomName.java deleted file mode 100644 index b7ebbbad5d..0000000000 --- a/showcase/gapic-showcase/proto/src/main/java/com/google/showcase/v1beta1/RoomName.java +++ /dev/null @@ -1,166 +0,0 @@ -/* - * 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 - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1; - -import com.google.api.pathtemplate.PathTemplate; -import com.google.api.resourcenames.ResourceName; -import com.google.common.base.Preconditions; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import javax.annotation.Generated; - -// AUTO-GENERATED DOCUMENTATION AND CLASS. -@Generated("by gapic-generator-java") -public class RoomName implements ResourceName { - private static final PathTemplate ROOM = PathTemplate.createWithoutUrlEncoding("rooms/{room}"); - private volatile Map fieldValuesMap; - private final String room; - - @Deprecated - protected RoomName() { - room = null; - } - - private RoomName(Builder builder) { - room = Preconditions.checkNotNull(builder.getRoom()); - } - - public String getRoom() { - return room; - } - - public static Builder newBuilder() { - return new Builder(); - } - - public Builder toBuilder() { - return new Builder(this); - } - - public static RoomName of(String room) { - return newBuilder().setRoom(room).build(); - } - - public static String format(String room) { - return newBuilder().setRoom(room).build().toString(); - } - - public static RoomName parse(String formattedString) { - if (formattedString.isEmpty()) { - return null; - } - Map matchMap = - ROOM.validatedMatch(formattedString, "RoomName.parse: formattedString not in valid format"); - return of(matchMap.get("room")); - } - - 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 (RoomName value : values) { - if (value == null) { - list.add(""); - } else { - list.add(value.toString()); - } - } - return list; - } - - public static boolean isParsableFrom(String formattedString) { - return ROOM.matches(formattedString); - } - - @Override - public Map getFieldValuesMap() { - if (fieldValuesMap == null) { - synchronized (this) { - if (fieldValuesMap == null) { - ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); - if (room != null) { - fieldMapBuilder.put("room", room); - } - fieldValuesMap = fieldMapBuilder.build(); - } - } - } - return fieldValuesMap; - } - - public String getFieldValue(String fieldName) { - return getFieldValuesMap().get(fieldName); - } - - @Override - public String toString() { - return ROOM.instantiate("room", room); - } - - @Override - public boolean equals(Object o) { - if (o == this) { - return true; - } - if (o != null || getClass() == o.getClass()) { - RoomName that = ((RoomName) o); - return Objects.equals(this.room, that.room); - } - return false; - } - - @Override - public int hashCode() { - int h = 1; - h *= 1000003; - h ^= Objects.hashCode(room); - return h; - } - - /** Builder for rooms/{room}. */ - public static class Builder { - private String room; - - protected Builder() {} - - public String getRoom() { - return room; - } - - public Builder setRoom(String room) { - this.room = room; - return this; - } - - private Builder(RoomName roomName) { - this.room = roomName.room; - } - - public RoomName build() { - return new RoomName(this); - } - } -} diff --git a/showcase/gapic-showcase/proto/src/main/java/com/google/showcase/v1beta1/SequenceName.java b/showcase/gapic-showcase/proto/src/main/java/com/google/showcase/v1beta1/SequenceName.java deleted file mode 100644 index 067bb15adb..0000000000 --- a/showcase/gapic-showcase/proto/src/main/java/com/google/showcase/v1beta1/SequenceName.java +++ /dev/null @@ -1,168 +0,0 @@ -/* - * 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 - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1; - -import com.google.api.pathtemplate.PathTemplate; -import com.google.api.resourcenames.ResourceName; -import com.google.common.base.Preconditions; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import javax.annotation.Generated; - -// AUTO-GENERATED DOCUMENTATION AND CLASS. -@Generated("by gapic-generator-java") -public class SequenceName implements ResourceName { - private static final PathTemplate SEQUENCE = - PathTemplate.createWithoutUrlEncoding("sequences/{sequence}"); - private volatile Map fieldValuesMap; - private final String sequence; - - @Deprecated - protected SequenceName() { - sequence = null; - } - - private SequenceName(Builder builder) { - sequence = Preconditions.checkNotNull(builder.getSequence()); - } - - public String getSequence() { - return sequence; - } - - public static Builder newBuilder() { - return new Builder(); - } - - public Builder toBuilder() { - return new Builder(this); - } - - public static SequenceName of(String sequence) { - return newBuilder().setSequence(sequence).build(); - } - - public static String format(String sequence) { - return newBuilder().setSequence(sequence).build().toString(); - } - - public static SequenceName parse(String formattedString) { - if (formattedString.isEmpty()) { - return null; - } - Map matchMap = - SEQUENCE.validatedMatch( - formattedString, "SequenceName.parse: formattedString not in valid format"); - return of(matchMap.get("sequence")); - } - - 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 (SequenceName value : values) { - if (value == null) { - list.add(""); - } else { - list.add(value.toString()); - } - } - return list; - } - - public static boolean isParsableFrom(String formattedString) { - return SEQUENCE.matches(formattedString); - } - - @Override - public Map getFieldValuesMap() { - if (fieldValuesMap == null) { - synchronized (this) { - if (fieldValuesMap == null) { - ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); - if (sequence != null) { - fieldMapBuilder.put("sequence", sequence); - } - fieldValuesMap = fieldMapBuilder.build(); - } - } - } - return fieldValuesMap; - } - - public String getFieldValue(String fieldName) { - return getFieldValuesMap().get(fieldName); - } - - @Override - public String toString() { - return SEQUENCE.instantiate("sequence", sequence); - } - - @Override - public boolean equals(Object o) { - if (o == this) { - return true; - } - if (o != null || getClass() == o.getClass()) { - SequenceName that = ((SequenceName) o); - return Objects.equals(this.sequence, that.sequence); - } - return false; - } - - @Override - public int hashCode() { - int h = 1; - h *= 1000003; - h ^= Objects.hashCode(sequence); - return h; - } - - /** Builder for sequences/{sequence}. */ - public static class Builder { - private String sequence; - - protected Builder() {} - - public String getSequence() { - return sequence; - } - - public Builder setSequence(String sequence) { - this.sequence = sequence; - return this; - } - - private Builder(SequenceName sequenceName) { - this.sequence = sequenceName.sequence; - } - - public SequenceName build() { - return new SequenceName(this); - } - } -} diff --git a/showcase/gapic-showcase/proto/src/main/java/com/google/showcase/v1beta1/SequenceReportName.java b/showcase/gapic-showcase/proto/src/main/java/com/google/showcase/v1beta1/SequenceReportName.java deleted file mode 100644 index 80742478a3..0000000000 --- a/showcase/gapic-showcase/proto/src/main/java/com/google/showcase/v1beta1/SequenceReportName.java +++ /dev/null @@ -1,168 +0,0 @@ -/* - * 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 - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1; - -import com.google.api.pathtemplate.PathTemplate; -import com.google.api.resourcenames.ResourceName; -import com.google.common.base.Preconditions; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import javax.annotation.Generated; - -// AUTO-GENERATED DOCUMENTATION AND CLASS. -@Generated("by gapic-generator-java") -public class SequenceReportName implements ResourceName { - private static final PathTemplate SEQUENCE = - PathTemplate.createWithoutUrlEncoding("sequences/{sequence}/sequenceReport"); - private volatile Map fieldValuesMap; - private final String sequence; - - @Deprecated - protected SequenceReportName() { - sequence = null; - } - - private SequenceReportName(Builder builder) { - sequence = Preconditions.checkNotNull(builder.getSequence()); - } - - public String getSequence() { - return sequence; - } - - public static Builder newBuilder() { - return new Builder(); - } - - public Builder toBuilder() { - return new Builder(this); - } - - public static SequenceReportName of(String sequence) { - return newBuilder().setSequence(sequence).build(); - } - - public static String format(String sequence) { - return newBuilder().setSequence(sequence).build().toString(); - } - - public static SequenceReportName parse(String formattedString) { - if (formattedString.isEmpty()) { - return null; - } - Map matchMap = - SEQUENCE.validatedMatch( - formattedString, "SequenceReportName.parse: formattedString not in valid format"); - return of(matchMap.get("sequence")); - } - - 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 (SequenceReportName value : values) { - if (value == null) { - list.add(""); - } else { - list.add(value.toString()); - } - } - return list; - } - - public static boolean isParsableFrom(String formattedString) { - return SEQUENCE.matches(formattedString); - } - - @Override - public Map getFieldValuesMap() { - if (fieldValuesMap == null) { - synchronized (this) { - if (fieldValuesMap == null) { - ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); - if (sequence != null) { - fieldMapBuilder.put("sequence", sequence); - } - fieldValuesMap = fieldMapBuilder.build(); - } - } - } - return fieldValuesMap; - } - - public String getFieldValue(String fieldName) { - return getFieldValuesMap().get(fieldName); - } - - @Override - public String toString() { - return SEQUENCE.instantiate("sequence", sequence); - } - - @Override - public boolean equals(Object o) { - if (o == this) { - return true; - } - if (o != null || getClass() == o.getClass()) { - SequenceReportName that = ((SequenceReportName) o); - return Objects.equals(this.sequence, that.sequence); - } - return false; - } - - @Override - public int hashCode() { - int h = 1; - h *= 1000003; - h ^= Objects.hashCode(sequence); - return h; - } - - /** Builder for sequences/{sequence}/sequenceReport. */ - public static class Builder { - private String sequence; - - protected Builder() {} - - public String getSequence() { - return sequence; - } - - public Builder setSequence(String sequence) { - this.sequence = sequence; - return this; - } - - private Builder(SequenceReportName sequenceReportName) { - this.sequence = sequenceReportName.sequence; - } - - public SequenceReportName build() { - return new SequenceReportName(this); - } - } -} diff --git a/showcase/gapic-showcase/proto/src/main/java/com/google/showcase/v1beta1/SessionName.java b/showcase/gapic-showcase/proto/src/main/java/com/google/showcase/v1beta1/SessionName.java deleted file mode 100644 index a205c1272d..0000000000 --- a/showcase/gapic-showcase/proto/src/main/java/com/google/showcase/v1beta1/SessionName.java +++ /dev/null @@ -1,168 +0,0 @@ -/* - * 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 - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1; - -import com.google.api.pathtemplate.PathTemplate; -import com.google.api.resourcenames.ResourceName; -import com.google.common.base.Preconditions; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import javax.annotation.Generated; - -// AUTO-GENERATED DOCUMENTATION AND CLASS. -@Generated("by gapic-generator-java") -public class SessionName implements ResourceName { - private static final PathTemplate SESSION = - PathTemplate.createWithoutUrlEncoding("sessions/{session}"); - private volatile Map fieldValuesMap; - private final String session; - - @Deprecated - protected SessionName() { - session = null; - } - - private SessionName(Builder builder) { - session = Preconditions.checkNotNull(builder.getSession()); - } - - public String getSession() { - return session; - } - - public static Builder newBuilder() { - return new Builder(); - } - - public Builder toBuilder() { - return new Builder(this); - } - - public static SessionName of(String session) { - return newBuilder().setSession(session).build(); - } - - public static String format(String session) { - return newBuilder().setSession(session).build().toString(); - } - - public static SessionName parse(String formattedString) { - if (formattedString.isEmpty()) { - return null; - } - Map matchMap = - SESSION.validatedMatch( - formattedString, "SessionName.parse: formattedString not in valid format"); - return of(matchMap.get("session")); - } - - 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 (SessionName value : values) { - if (value == null) { - list.add(""); - } else { - list.add(value.toString()); - } - } - return list; - } - - public static boolean isParsableFrom(String formattedString) { - return SESSION.matches(formattedString); - } - - @Override - public Map getFieldValuesMap() { - if (fieldValuesMap == null) { - synchronized (this) { - if (fieldValuesMap == null) { - ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); - if (session != null) { - fieldMapBuilder.put("session", session); - } - fieldValuesMap = fieldMapBuilder.build(); - } - } - } - return fieldValuesMap; - } - - public String getFieldValue(String fieldName) { - return getFieldValuesMap().get(fieldName); - } - - @Override - public String toString() { - return SESSION.instantiate("session", session); - } - - @Override - public boolean equals(Object o) { - if (o == this) { - return true; - } - if (o != null || getClass() == o.getClass()) { - SessionName that = ((SessionName) o); - return Objects.equals(this.session, that.session); - } - return false; - } - - @Override - public int hashCode() { - int h = 1; - h *= 1000003; - h ^= Objects.hashCode(session); - return h; - } - - /** Builder for sessions/{session}. */ - public static class Builder { - private String session; - - protected Builder() {} - - public String getSession() { - return session; - } - - public Builder setSession(String session) { - this.session = session; - return this; - } - - private Builder(SessionName sessionName) { - this.session = sessionName.session; - } - - public SessionName build() { - return new SessionName(this); - } - } -} diff --git a/showcase/gapic-showcase/proto/src/main/java/com/google/showcase/v1beta1/TestName.java b/showcase/gapic-showcase/proto/src/main/java/com/google/showcase/v1beta1/TestName.java deleted file mode 100644 index fb2855113a..0000000000 --- a/showcase/gapic-showcase/proto/src/main/java/com/google/showcase/v1beta1/TestName.java +++ /dev/null @@ -1,191 +0,0 @@ -/* - * 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 - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1; - -import com.google.api.pathtemplate.PathTemplate; -import com.google.api.resourcenames.ResourceName; -import com.google.common.base.Preconditions; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import javax.annotation.Generated; - -// AUTO-GENERATED DOCUMENTATION AND CLASS. -@Generated("by gapic-generator-java") -public class TestName implements ResourceName { - private static final PathTemplate SESSION_TEST = - PathTemplate.createWithoutUrlEncoding("sessions/{session}/tests/{test}"); - private volatile Map fieldValuesMap; - private final String session; - private final String test; - - @Deprecated - protected TestName() { - session = null; - test = null; - } - - private TestName(Builder builder) { - session = Preconditions.checkNotNull(builder.getSession()); - test = Preconditions.checkNotNull(builder.getTest()); - } - - public String getSession() { - return session; - } - - public String getTest() { - return test; - } - - public static Builder newBuilder() { - return new Builder(); - } - - public Builder toBuilder() { - return new Builder(this); - } - - public static TestName of(String session, String test) { - return newBuilder().setSession(session).setTest(test).build(); - } - - public static String format(String session, String test) { - return newBuilder().setSession(session).setTest(test).build().toString(); - } - - public static TestName parse(String formattedString) { - if (formattedString.isEmpty()) { - return null; - } - Map matchMap = - SESSION_TEST.validatedMatch( - formattedString, "TestName.parse: formattedString not in valid format"); - return of(matchMap.get("session"), matchMap.get("test")); - } - - 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 (TestName value : values) { - if (value == null) { - list.add(""); - } else { - list.add(value.toString()); - } - } - return list; - } - - public static boolean isParsableFrom(String formattedString) { - return SESSION_TEST.matches(formattedString); - } - - @Override - public Map getFieldValuesMap() { - if (fieldValuesMap == null) { - synchronized (this) { - if (fieldValuesMap == null) { - ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); - if (session != null) { - fieldMapBuilder.put("session", session); - } - if (test != null) { - fieldMapBuilder.put("test", test); - } - fieldValuesMap = fieldMapBuilder.build(); - } - } - } - return fieldValuesMap; - } - - public String getFieldValue(String fieldName) { - return getFieldValuesMap().get(fieldName); - } - - @Override - public String toString() { - return SESSION_TEST.instantiate("session", session, "test", test); - } - - @Override - public boolean equals(Object o) { - if (o == this) { - return true; - } - if (o != null || getClass() == o.getClass()) { - TestName that = ((TestName) o); - return Objects.equals(this.session, that.session) && Objects.equals(this.test, that.test); - } - return false; - } - - @Override - public int hashCode() { - int h = 1; - h *= 1000003; - h ^= Objects.hashCode(session); - h *= 1000003; - h ^= Objects.hashCode(test); - return h; - } - - /** Builder for sessions/{session}/tests/{test}. */ - public static class Builder { - private String session; - private String test; - - protected Builder() {} - - public String getSession() { - return session; - } - - public String getTest() { - return test; - } - - public Builder setSession(String session) { - this.session = session; - return this; - } - - public Builder setTest(String test) { - this.test = test; - return this; - } - - private Builder(TestName testName) { - this.session = testName.session; - this.test = testName.test; - } - - public TestName build() { - return new TestName(this); - } - } -} diff --git a/showcase/gapic-showcase/proto/src/main/java/com/google/showcase/v1beta1/UserName.java b/showcase/gapic-showcase/proto/src/main/java/com/google/showcase/v1beta1/UserName.java deleted file mode 100644 index df5a3618b7..0000000000 --- a/showcase/gapic-showcase/proto/src/main/java/com/google/showcase/v1beta1/UserName.java +++ /dev/null @@ -1,166 +0,0 @@ -/* - * 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 - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1; - -import com.google.api.pathtemplate.PathTemplate; -import com.google.api.resourcenames.ResourceName; -import com.google.common.base.Preconditions; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import javax.annotation.Generated; - -// AUTO-GENERATED DOCUMENTATION AND CLASS. -@Generated("by gapic-generator-java") -public class UserName implements ResourceName { - private static final PathTemplate USER = PathTemplate.createWithoutUrlEncoding("users/{user}"); - private volatile Map fieldValuesMap; - private final String user; - - @Deprecated - protected UserName() { - user = null; - } - - private UserName(Builder builder) { - user = Preconditions.checkNotNull(builder.getUser()); - } - - public String getUser() { - return user; - } - - public static Builder newBuilder() { - return new Builder(); - } - - public Builder toBuilder() { - return new Builder(this); - } - - public static UserName of(String user) { - return newBuilder().setUser(user).build(); - } - - public static String format(String user) { - return newBuilder().setUser(user).build().toString(); - } - - public static UserName parse(String formattedString) { - if (formattedString.isEmpty()) { - return null; - } - Map matchMap = - USER.validatedMatch(formattedString, "UserName.parse: formattedString not in valid format"); - return of(matchMap.get("user")); - } - - 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 (UserName value : values) { - if (value == null) { - list.add(""); - } else { - list.add(value.toString()); - } - } - return list; - } - - public static boolean isParsableFrom(String formattedString) { - return USER.matches(formattedString); - } - - @Override - public Map getFieldValuesMap() { - if (fieldValuesMap == null) { - synchronized (this) { - if (fieldValuesMap == null) { - ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); - if (user != null) { - fieldMapBuilder.put("user", user); - } - fieldValuesMap = fieldMapBuilder.build(); - } - } - } - return fieldValuesMap; - } - - public String getFieldValue(String fieldName) { - return getFieldValuesMap().get(fieldName); - } - - @Override - public String toString() { - return USER.instantiate("user", user); - } - - @Override - public boolean equals(Object o) { - if (o == this) { - return true; - } - if (o != null || getClass() == o.getClass()) { - UserName that = ((UserName) o); - return Objects.equals(this.user, that.user); - } - return false; - } - - @Override - public int hashCode() { - int h = 1; - h *= 1000003; - h ^= Objects.hashCode(user); - return h; - } - - /** Builder for users/{user}. */ - public static class Builder { - private String user; - - protected Builder() {} - - public String getUser() { - return user; - } - - public Builder setUser(String user) { - this.user = user; - return this; - } - - private Builder(UserName userName) { - this.user = userName.user; - } - - public UserName build() { - return new UserName(this); - } - } -} diff --git a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/compliance/create/SyncCreateSetCredentialsProvider.java b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/compliance/create/SyncCreateSetCredentialsProvider.java deleted file mode 100644 index 46846134bb..0000000000 --- a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/compliance/create/SyncCreateSetCredentialsProvider.java +++ /dev/null @@ -1,44 +0,0 @@ -/* - * 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 - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1.samples; - -// [START localhost7469_v1beta1_generated_Compliance_Create_SetCredentialsProvider_sync] -import com.google.api.gax.core.FixedCredentialsProvider; -import com.google.showcase.v1beta1.ComplianceClient; -import com.google.showcase.v1beta1.ComplianceSettings; -import com.google.showcase.v1beta1.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 - ComplianceSettings complianceSettings = - ComplianceSettings.newBuilder() - .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials)) - .build(); - ComplianceClient complianceClient = ComplianceClient.create(complianceSettings); - } -} -// [END localhost7469_v1beta1_generated_Compliance_Create_SetCredentialsProvider_sync] diff --git a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/compliance/create/SyncCreateSetCredentialsProvider1.java b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/compliance/create/SyncCreateSetCredentialsProvider1.java deleted file mode 100644 index f28602378a..0000000000 --- a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/compliance/create/SyncCreateSetCredentialsProvider1.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - * 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 - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1.samples; - -// [START localhost7469_v1beta1_generated_Compliance_Create_SetCredentialsProvider1_sync] -import com.google.showcase.v1beta1.ComplianceClient; -import com.google.showcase.v1beta1.ComplianceSettings; - -public class SyncCreateSetCredentialsProvider1 { - - public static void main(String[] args) throws Exception { - syncCreateSetCredentialsProvider1(); - } - - public static void syncCreateSetCredentialsProvider1() 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 - ComplianceSettings complianceSettings = ComplianceSettings.newHttpJsonBuilder().build(); - ComplianceClient complianceClient = ComplianceClient.create(complianceSettings); - } -} -// [END localhost7469_v1beta1_generated_Compliance_Create_SetCredentialsProvider1_sync] diff --git a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/compliance/create/SyncCreateSetEndpoint.java b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/compliance/create/SyncCreateSetEndpoint.java deleted file mode 100644 index 40b937f7f3..0000000000 --- a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/compliance/create/SyncCreateSetEndpoint.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * 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 - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1.samples; - -// [START localhost7469_v1beta1_generated_Compliance_Create_SetEndpoint_sync] -import com.google.showcase.v1beta1.ComplianceClient; -import com.google.showcase.v1beta1.ComplianceSettings; -import com.google.showcase.v1beta1.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 - ComplianceSettings complianceSettings = - ComplianceSettings.newBuilder().setEndpoint(myEndpoint).build(); - ComplianceClient complianceClient = ComplianceClient.create(complianceSettings); - } -} -// [END localhost7469_v1beta1_generated_Compliance_Create_SetEndpoint_sync] diff --git a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/compliance/repeatdatabody/SyncRepeatDataBody.java b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/compliance/repeatdatabody/SyncRepeatDataBody.java deleted file mode 100644 index 9769ea47da..0000000000 --- a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/compliance/repeatdatabody/SyncRepeatDataBody.java +++ /dev/null @@ -1,55 +0,0 @@ -/* - * 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 - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1.samples; - -// [START localhost7469_v1beta1_generated_Compliance_RepeatDataBody_sync] -import com.google.showcase.v1beta1.ComplianceClient; -import com.google.showcase.v1beta1.ComplianceData; -import com.google.showcase.v1beta1.RepeatRequest; -import com.google.showcase.v1beta1.RepeatResponse; - -public class SyncRepeatDataBody { - - public static void main(String[] args) throws Exception { - syncRepeatDataBody(); - } - - public static void syncRepeatDataBody() 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 (ComplianceClient complianceClient = ComplianceClient.create()) { - RepeatRequest request = - RepeatRequest.newBuilder() - .setName("name3373707") - .setInfo(ComplianceData.newBuilder().build()) - .setServerVerify(true) - .setIntendedBindingUri("intendedBindingUri780142386") - .setFInt32(-1143775883) - .setFInt64(-1143775788) - .setFDouble(-1239459382) - .setPInt32(-858673665) - .setPInt64(-858673570) - .setPDouble(-991225216) - .build(); - RepeatResponse response = complianceClient.repeatDataBody(request); - } - } -} -// [END localhost7469_v1beta1_generated_Compliance_RepeatDataBody_sync] diff --git a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/compliancesettings/repeatdatabody/SyncRepeatDataBody.java b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/compliancesettings/repeatdatabody/SyncRepeatDataBody.java deleted file mode 100644 index 50c6680f41..0000000000 --- a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/compliancesettings/repeatdatabody/SyncRepeatDataBody.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * 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 - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1.samples; - -// [START localhost7469_v1beta1_generated_ComplianceSettings_RepeatDataBody_sync] -import com.google.showcase.v1beta1.ComplianceSettings; -import java.time.Duration; - -public class SyncRepeatDataBody { - - public static void main(String[] args) throws Exception { - syncRepeatDataBody(); - } - - public static void syncRepeatDataBody() 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 - ComplianceSettings.Builder complianceSettingsBuilder = ComplianceSettings.newBuilder(); - complianceSettingsBuilder - .repeatDataBodySettings() - .setRetrySettings( - complianceSettingsBuilder - .repeatDataBodySettings() - .getRetrySettings() - .toBuilder() - .setTotalTimeout(Duration.ofSeconds(30)) - .build()); - ComplianceSettings complianceSettings = complianceSettingsBuilder.build(); - } -} -// [END localhost7469_v1beta1_generated_ComplianceSettings_RepeatDataBody_sync] diff --git a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/echo/create/SyncCreateSetCredentialsProvider.java b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/echo/create/SyncCreateSetCredentialsProvider.java deleted file mode 100644 index a9ebbf7ae9..0000000000 --- a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/echo/create/SyncCreateSetCredentialsProvider.java +++ /dev/null @@ -1,44 +0,0 @@ -/* - * 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 - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1.samples; - -// [START localhost7469_v1beta1_generated_Echo_Create_SetCredentialsProvider_sync] -import com.google.api.gax.core.FixedCredentialsProvider; -import com.google.showcase.v1beta1.EchoClient; -import com.google.showcase.v1beta1.EchoSettings; -import com.google.showcase.v1beta1.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 - EchoSettings echoSettings = - EchoSettings.newBuilder() - .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials)) - .build(); - EchoClient echoClient = EchoClient.create(echoSettings); - } -} -// [END localhost7469_v1beta1_generated_Echo_Create_SetCredentialsProvider_sync] diff --git a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/echo/create/SyncCreateSetCredentialsProvider1.java b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/echo/create/SyncCreateSetCredentialsProvider1.java deleted file mode 100644 index cb6c708da6..0000000000 --- a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/echo/create/SyncCreateSetCredentialsProvider1.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - * 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 - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1.samples; - -// [START localhost7469_v1beta1_generated_Echo_Create_SetCredentialsProvider1_sync] -import com.google.showcase.v1beta1.EchoClient; -import com.google.showcase.v1beta1.EchoSettings; - -public class SyncCreateSetCredentialsProvider1 { - - public static void main(String[] args) throws Exception { - syncCreateSetCredentialsProvider1(); - } - - public static void syncCreateSetCredentialsProvider1() 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 - EchoSettings echoSettings = EchoSettings.newHttpJsonBuilder().build(); - EchoClient echoClient = EchoClient.create(echoSettings); - } -} -// [END localhost7469_v1beta1_generated_Echo_Create_SetCredentialsProvider1_sync] diff --git a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/echo/create/SyncCreateSetEndpoint.java b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/echo/create/SyncCreateSetEndpoint.java deleted file mode 100644 index ad36585408..0000000000 --- a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/echo/create/SyncCreateSetEndpoint.java +++ /dev/null @@ -1,40 +0,0 @@ -/* - * 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 - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1.samples; - -// [START localhost7469_v1beta1_generated_Echo_Create_SetEndpoint_sync] -import com.google.showcase.v1beta1.EchoClient; -import com.google.showcase.v1beta1.EchoSettings; -import com.google.showcase.v1beta1.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 - EchoSettings echoSettings = EchoSettings.newBuilder().setEndpoint(myEndpoint).build(); - EchoClient echoClient = EchoClient.create(echoSettings); - } -} -// [END localhost7469_v1beta1_generated_Echo_Create_SetEndpoint_sync] diff --git a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/echo/echo/SyncEcho.java b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/echo/echo/SyncEcho.java deleted file mode 100644 index 37388425b1..0000000000 --- a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/echo/echo/SyncEcho.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * 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 - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1.samples; - -// [START localhost7469_v1beta1_generated_Echo_Echo_sync] -import com.google.showcase.v1beta1.EchoClient; -import com.google.showcase.v1beta1.EchoRequest; -import com.google.showcase.v1beta1.EchoResponse; -import com.google.showcase.v1beta1.Severity; - -public class SyncEcho { - - public static void main(String[] args) throws Exception { - syncEcho(); - } - - public static void syncEcho() 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 (EchoClient echoClient = EchoClient.create()) { - EchoRequest request = - EchoRequest.newBuilder() - .setSeverity(Severity.forNumber(0)) - .setHeader("header-1221270899") - .setOtherHeader("otherHeader-2026585667") - .build(); - EchoResponse response = echoClient.echo(request); - } - } -} -// [END localhost7469_v1beta1_generated_Echo_Echo_sync] diff --git a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/echo/wait/SyncWait.java b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/echo/wait/SyncWait.java deleted file mode 100644 index b79a0c4abe..0000000000 --- a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/echo/wait/SyncWait.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * 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 - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1.samples; - -// [START localhost7469_v1beta1_generated_Echo_Wait_sync] -import com.google.showcase.v1beta1.EchoClient; -import com.google.showcase.v1beta1.WaitRequest; -import com.google.showcase.v1beta1.WaitResponse; - -public class SyncWait { - - public static void main(String[] args) throws Exception { - syncWait(); - } - - public static void syncWait() 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 (EchoClient echoClient = EchoClient.create()) { - WaitRequest request = WaitRequest.newBuilder().build(); - WaitResponse response = echoClient.waitAsync(request).get(); - } - } -} -// [END localhost7469_v1beta1_generated_Echo_Wait_sync] diff --git a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/echosettings/echo/SyncEcho.java b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/echosettings/echo/SyncEcho.java deleted file mode 100644 index 8297f9021e..0000000000 --- a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/echosettings/echo/SyncEcho.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * 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 - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1.samples; - -// [START localhost7469_v1beta1_generated_EchoSettings_Echo_sync] -import com.google.showcase.v1beta1.EchoSettings; -import java.time.Duration; - -public class SyncEcho { - - public static void main(String[] args) throws Exception { - syncEcho(); - } - - public static void syncEcho() 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 - EchoSettings.Builder echoSettingsBuilder = EchoSettings.newBuilder(); - echoSettingsBuilder - .echoSettings() - .setRetrySettings( - echoSettingsBuilder - .echoSettings() - .getRetrySettings() - .toBuilder() - .setTotalTimeout(Duration.ofSeconds(30)) - .build()); - EchoSettings echoSettings = echoSettingsBuilder.build(); - } -} -// [END localhost7469_v1beta1_generated_EchoSettings_Echo_sync] diff --git a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/identity/create/SyncCreateSetCredentialsProvider.java b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/identity/create/SyncCreateSetCredentialsProvider.java deleted file mode 100644 index 2ebcf3d498..0000000000 --- a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/identity/create/SyncCreateSetCredentialsProvider.java +++ /dev/null @@ -1,44 +0,0 @@ -/* - * 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 - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1.samples; - -// [START localhost7469_v1beta1_generated_Identity_Create_SetCredentialsProvider_sync] -import com.google.api.gax.core.FixedCredentialsProvider; -import com.google.showcase.v1beta1.IdentityClient; -import com.google.showcase.v1beta1.IdentitySettings; -import com.google.showcase.v1beta1.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 - IdentitySettings identitySettings = - IdentitySettings.newBuilder() - .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials)) - .build(); - IdentityClient identityClient = IdentityClient.create(identitySettings); - } -} -// [END localhost7469_v1beta1_generated_Identity_Create_SetCredentialsProvider_sync] diff --git a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/identity/create/SyncCreateSetCredentialsProvider1.java b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/identity/create/SyncCreateSetCredentialsProvider1.java deleted file mode 100644 index 4ef4b5c388..0000000000 --- a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/identity/create/SyncCreateSetCredentialsProvider1.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - * 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 - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1.samples; - -// [START localhost7469_v1beta1_generated_Identity_Create_SetCredentialsProvider1_sync] -import com.google.showcase.v1beta1.IdentityClient; -import com.google.showcase.v1beta1.IdentitySettings; - -public class SyncCreateSetCredentialsProvider1 { - - public static void main(String[] args) throws Exception { - syncCreateSetCredentialsProvider1(); - } - - public static void syncCreateSetCredentialsProvider1() 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 - IdentitySettings identitySettings = IdentitySettings.newHttpJsonBuilder().build(); - IdentityClient identityClient = IdentityClient.create(identitySettings); - } -} -// [END localhost7469_v1beta1_generated_Identity_Create_SetCredentialsProvider1_sync] diff --git a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/identity/create/SyncCreateSetEndpoint.java b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/identity/create/SyncCreateSetEndpoint.java deleted file mode 100644 index 56a9453ba2..0000000000 --- a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/identity/create/SyncCreateSetEndpoint.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * 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 - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1.samples; - -// [START localhost7469_v1beta1_generated_Identity_Create_SetEndpoint_sync] -import com.google.showcase.v1beta1.IdentityClient; -import com.google.showcase.v1beta1.IdentitySettings; -import com.google.showcase.v1beta1.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 - IdentitySettings identitySettings = - IdentitySettings.newBuilder().setEndpoint(myEndpoint).build(); - IdentityClient identityClient = IdentityClient.create(identitySettings); - } -} -// [END localhost7469_v1beta1_generated_Identity_Create_SetEndpoint_sync] diff --git a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/identity/createuser/SyncCreateUser.java b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/identity/createuser/SyncCreateUser.java deleted file mode 100644 index efced6437d..0000000000 --- a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/identity/createuser/SyncCreateUser.java +++ /dev/null @@ -1,43 +0,0 @@ -/* - * 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 - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1.samples; - -// [START localhost7469_v1beta1_generated_Identity_CreateUser_sync] -import com.google.showcase.v1beta1.CreateUserRequest; -import com.google.showcase.v1beta1.IdentityClient; -import com.google.showcase.v1beta1.User; - -public class SyncCreateUser { - - public static void main(String[] args) throws Exception { - syncCreateUser(); - } - - public static void syncCreateUser() 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 (IdentityClient identityClient = IdentityClient.create()) { - CreateUserRequest request = - CreateUserRequest.newBuilder().setUser(User.newBuilder().build()).build(); - User response = identityClient.createUser(request); - } - } -} -// [END localhost7469_v1beta1_generated_Identity_CreateUser_sync] diff --git a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/identitysettings/createuser/SyncCreateUser.java b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/identitysettings/createuser/SyncCreateUser.java deleted file mode 100644 index ecc969af0e..0000000000 --- a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/identitysettings/createuser/SyncCreateUser.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * 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 - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1.samples; - -// [START localhost7469_v1beta1_generated_IdentitySettings_CreateUser_sync] -import com.google.showcase.v1beta1.IdentitySettings; -import java.time.Duration; - -public class SyncCreateUser { - - public static void main(String[] args) throws Exception { - syncCreateUser(); - } - - public static void syncCreateUser() 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 - IdentitySettings.Builder identitySettingsBuilder = IdentitySettings.newBuilder(); - identitySettingsBuilder - .createUserSettings() - .setRetrySettings( - identitySettingsBuilder - .createUserSettings() - .getRetrySettings() - .toBuilder() - .setTotalTimeout(Duration.ofSeconds(30)) - .build()); - IdentitySettings identitySettings = identitySettingsBuilder.build(); - } -} -// [END localhost7469_v1beta1_generated_IdentitySettings_CreateUser_sync] diff --git a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/create/SyncCreateSetCredentialsProvider.java b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/create/SyncCreateSetCredentialsProvider.java deleted file mode 100644 index c6c26a4fae..0000000000 --- a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/create/SyncCreateSetCredentialsProvider.java +++ /dev/null @@ -1,44 +0,0 @@ -/* - * 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 - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1.samples; - -// [START localhost7469_v1beta1_generated_Messaging_Create_SetCredentialsProvider_sync] -import com.google.api.gax.core.FixedCredentialsProvider; -import com.google.showcase.v1beta1.MessagingClient; -import com.google.showcase.v1beta1.MessagingSettings; -import com.google.showcase.v1beta1.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 - MessagingSettings messagingSettings = - MessagingSettings.newBuilder() - .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials)) - .build(); - MessagingClient messagingClient = MessagingClient.create(messagingSettings); - } -} -// [END localhost7469_v1beta1_generated_Messaging_Create_SetCredentialsProvider_sync] diff --git a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/create/SyncCreateSetCredentialsProvider1.java b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/create/SyncCreateSetCredentialsProvider1.java deleted file mode 100644 index ac54a1ca4e..0000000000 --- a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/create/SyncCreateSetCredentialsProvider1.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - * 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 - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1.samples; - -// [START localhost7469_v1beta1_generated_Messaging_Create_SetCredentialsProvider1_sync] -import com.google.showcase.v1beta1.MessagingClient; -import com.google.showcase.v1beta1.MessagingSettings; - -public class SyncCreateSetCredentialsProvider1 { - - public static void main(String[] args) throws Exception { - syncCreateSetCredentialsProvider1(); - } - - public static void syncCreateSetCredentialsProvider1() 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 - MessagingSettings messagingSettings = MessagingSettings.newHttpJsonBuilder().build(); - MessagingClient messagingClient = MessagingClient.create(messagingSettings); - } -} -// [END localhost7469_v1beta1_generated_Messaging_Create_SetCredentialsProvider1_sync] diff --git a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/create/SyncCreateSetEndpoint.java b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/create/SyncCreateSetEndpoint.java deleted file mode 100644 index 0380588c4a..0000000000 --- a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/create/SyncCreateSetEndpoint.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * 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 - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1.samples; - -// [START localhost7469_v1beta1_generated_Messaging_Create_SetEndpoint_sync] -import com.google.showcase.v1beta1.MessagingClient; -import com.google.showcase.v1beta1.MessagingSettings; -import com.google.showcase.v1beta1.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 - MessagingSettings messagingSettings = - MessagingSettings.newBuilder().setEndpoint(myEndpoint).build(); - MessagingClient messagingClient = MessagingClient.create(messagingSettings); - } -} -// [END localhost7469_v1beta1_generated_Messaging_Create_SetEndpoint_sync] diff --git a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/createroom/SyncCreateRoom.java b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/createroom/SyncCreateRoom.java deleted file mode 100644 index 5aa1b3e94e..0000000000 --- a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/createroom/SyncCreateRoom.java +++ /dev/null @@ -1,43 +0,0 @@ -/* - * 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 - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1.samples; - -// [START localhost7469_v1beta1_generated_Messaging_CreateRoom_sync] -import com.google.showcase.v1beta1.CreateRoomRequest; -import com.google.showcase.v1beta1.MessagingClient; -import com.google.showcase.v1beta1.Room; - -public class SyncCreateRoom { - - public static void main(String[] args) throws Exception { - syncCreateRoom(); - } - - public static void syncCreateRoom() 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 (MessagingClient messagingClient = MessagingClient.create()) { - CreateRoomRequest request = - CreateRoomRequest.newBuilder().setRoom(Room.newBuilder().build()).build(); - Room response = messagingClient.createRoom(request); - } - } -} -// [END localhost7469_v1beta1_generated_Messaging_CreateRoom_sync] diff --git a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/searchblurbs/SyncSearchBlurbs.java b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/searchblurbs/SyncSearchBlurbs.java deleted file mode 100644 index 9185a19d58..0000000000 --- a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messaging/searchblurbs/SyncSearchBlurbs.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - * 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 - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1.samples; - -// [START localhost7469_v1beta1_generated_Messaging_SearchBlurbs_sync] -import com.google.showcase.v1beta1.MessagingClient; -import com.google.showcase.v1beta1.ProfileName; -import com.google.showcase.v1beta1.SearchBlurbsRequest; -import com.google.showcase.v1beta1.SearchBlurbsResponse; - -public class SyncSearchBlurbs { - - public static void main(String[] args) throws Exception { - syncSearchBlurbs(); - } - - public static void syncSearchBlurbs() 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 (MessagingClient messagingClient = MessagingClient.create()) { - SearchBlurbsRequest request = - SearchBlurbsRequest.newBuilder() - .setQuery("query107944136") - .setParent(ProfileName.of("[USER]").toString()) - .setPageSize(883849137) - .setPageToken("pageToken873572522") - .build(); - SearchBlurbsResponse response = messagingClient.searchBlurbsAsync(request).get(); - } - } -} -// [END localhost7469_v1beta1_generated_Messaging_SearchBlurbs_sync] diff --git a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messagingsettings/createroom/SyncCreateRoom.java b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messagingsettings/createroom/SyncCreateRoom.java deleted file mode 100644 index 2ab7cbe27e..0000000000 --- a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/messagingsettings/createroom/SyncCreateRoom.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * 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 - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1.samples; - -// [START localhost7469_v1beta1_generated_MessagingSettings_CreateRoom_sync] -import com.google.showcase.v1beta1.MessagingSettings; -import java.time.Duration; - -public class SyncCreateRoom { - - public static void main(String[] args) throws Exception { - syncCreateRoom(); - } - - public static void syncCreateRoom() 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 - MessagingSettings.Builder messagingSettingsBuilder = MessagingSettings.newBuilder(); - messagingSettingsBuilder - .createRoomSettings() - .setRetrySettings( - messagingSettingsBuilder - .createRoomSettings() - .getRetrySettings() - .toBuilder() - .setTotalTimeout(Duration.ofSeconds(30)) - .build()); - MessagingSettings messagingSettings = messagingSettingsBuilder.build(); - } -} -// [END localhost7469_v1beta1_generated_MessagingSettings_CreateRoom_sync] diff --git a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/sequenceservice/create/SyncCreateSetCredentialsProvider.java b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/sequenceservice/create/SyncCreateSetCredentialsProvider.java deleted file mode 100644 index b1c0a96894..0000000000 --- a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/sequenceservice/create/SyncCreateSetCredentialsProvider.java +++ /dev/null @@ -1,45 +0,0 @@ -/* - * 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 - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1.samples; - -// [START localhost7469_v1beta1_generated_SequenceService_Create_SetCredentialsProvider_sync] -import com.google.api.gax.core.FixedCredentialsProvider; -import com.google.showcase.v1beta1.SequenceServiceClient; -import com.google.showcase.v1beta1.SequenceServiceSettings; -import com.google.showcase.v1beta1.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 - SequenceServiceSettings sequenceServiceSettings = - SequenceServiceSettings.newBuilder() - .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials)) - .build(); - SequenceServiceClient sequenceServiceClient = - SequenceServiceClient.create(sequenceServiceSettings); - } -} -// [END localhost7469_v1beta1_generated_SequenceService_Create_SetCredentialsProvider_sync] diff --git a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/sequenceservice/create/SyncCreateSetCredentialsProvider1.java b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/sequenceservice/create/SyncCreateSetCredentialsProvider1.java deleted file mode 100644 index 5f6f2f63f8..0000000000 --- a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/sequenceservice/create/SyncCreateSetCredentialsProvider1.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * 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 - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1.samples; - -// [START localhost7469_v1beta1_generated_SequenceService_Create_SetCredentialsProvider1_sync] -import com.google.showcase.v1beta1.SequenceServiceClient; -import com.google.showcase.v1beta1.SequenceServiceSettings; - -public class SyncCreateSetCredentialsProvider1 { - - public static void main(String[] args) throws Exception { - syncCreateSetCredentialsProvider1(); - } - - public static void syncCreateSetCredentialsProvider1() 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 - SequenceServiceSettings sequenceServiceSettings = - SequenceServiceSettings.newHttpJsonBuilder().build(); - SequenceServiceClient sequenceServiceClient = - SequenceServiceClient.create(sequenceServiceSettings); - } -} -// [END localhost7469_v1beta1_generated_SequenceService_Create_SetCredentialsProvider1_sync] diff --git a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/sequenceservice/create/SyncCreateSetEndpoint.java b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/sequenceservice/create/SyncCreateSetEndpoint.java deleted file mode 100644 index 80d2a57c02..0000000000 --- a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/sequenceservice/create/SyncCreateSetEndpoint.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * 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 - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1.samples; - -// [START localhost7469_v1beta1_generated_SequenceService_Create_SetEndpoint_sync] -import com.google.showcase.v1beta1.SequenceServiceClient; -import com.google.showcase.v1beta1.SequenceServiceSettings; -import com.google.showcase.v1beta1.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 - SequenceServiceSettings sequenceServiceSettings = - SequenceServiceSettings.newBuilder().setEndpoint(myEndpoint).build(); - SequenceServiceClient sequenceServiceClient = - SequenceServiceClient.create(sequenceServiceSettings); - } -} -// [END localhost7469_v1beta1_generated_SequenceService_Create_SetEndpoint_sync] diff --git a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/sequenceservice/createsequence/SyncCreateSequence.java b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/sequenceservice/createsequence/SyncCreateSequence.java deleted file mode 100644 index b798739218..0000000000 --- a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/sequenceservice/createsequence/SyncCreateSequence.java +++ /dev/null @@ -1,43 +0,0 @@ -/* - * 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 - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1.samples; - -// [START localhost7469_v1beta1_generated_SequenceService_CreateSequence_sync] -import com.google.showcase.v1beta1.CreateSequenceRequest; -import com.google.showcase.v1beta1.Sequence; -import com.google.showcase.v1beta1.SequenceServiceClient; - -public class SyncCreateSequence { - - public static void main(String[] args) throws Exception { - syncCreateSequence(); - } - - public static void syncCreateSequence() 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 (SequenceServiceClient sequenceServiceClient = SequenceServiceClient.create()) { - CreateSequenceRequest request = - CreateSequenceRequest.newBuilder().setSequence(Sequence.newBuilder().build()).build(); - Sequence response = sequenceServiceClient.createSequence(request); - } - } -} -// [END localhost7469_v1beta1_generated_SequenceService_CreateSequence_sync] diff --git a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/sequenceservicesettings/createsequence/SyncCreateSequence.java b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/sequenceservicesettings/createsequence/SyncCreateSequence.java deleted file mode 100644 index d225414159..0000000000 --- a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/sequenceservicesettings/createsequence/SyncCreateSequence.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - * 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 - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1.samples; - -// [START localhost7469_v1beta1_generated_SequenceServiceSettings_CreateSequence_sync] -import com.google.showcase.v1beta1.SequenceServiceSettings; -import java.time.Duration; - -public class SyncCreateSequence { - - public static void main(String[] args) throws Exception { - syncCreateSequence(); - } - - public static void syncCreateSequence() 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 - SequenceServiceSettings.Builder sequenceServiceSettingsBuilder = - SequenceServiceSettings.newBuilder(); - sequenceServiceSettingsBuilder - .createSequenceSettings() - .setRetrySettings( - sequenceServiceSettingsBuilder - .createSequenceSettings() - .getRetrySettings() - .toBuilder() - .setTotalTimeout(Duration.ofSeconds(30)) - .build()); - SequenceServiceSettings sequenceServiceSettings = sequenceServiceSettingsBuilder.build(); - } -} -// [END localhost7469_v1beta1_generated_SequenceServiceSettings_CreateSequence_sync] diff --git a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/stub/compliancestubsettings/repeatdatabody/SyncRepeatDataBody.java b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/stub/compliancestubsettings/repeatdatabody/SyncRepeatDataBody.java deleted file mode 100644 index c0b9e53a5b..0000000000 --- a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/stub/compliancestubsettings/repeatdatabody/SyncRepeatDataBody.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * 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 - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1.stub.samples; - -// [START localhost7469_v1beta1_generated_ComplianceStubSettings_RepeatDataBody_sync] -import com.google.showcase.v1beta1.stub.ComplianceStubSettings; -import java.time.Duration; - -public class SyncRepeatDataBody { - - public static void main(String[] args) throws Exception { - syncRepeatDataBody(); - } - - public static void syncRepeatDataBody() 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 - ComplianceStubSettings.Builder complianceSettingsBuilder = ComplianceStubSettings.newBuilder(); - complianceSettingsBuilder - .repeatDataBodySettings() - .setRetrySettings( - complianceSettingsBuilder - .repeatDataBodySettings() - .getRetrySettings() - .toBuilder() - .setTotalTimeout(Duration.ofSeconds(30)) - .build()); - ComplianceStubSettings complianceSettings = complianceSettingsBuilder.build(); - } -} -// [END localhost7469_v1beta1_generated_ComplianceStubSettings_RepeatDataBody_sync] diff --git a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/stub/echostubsettings/echo/SyncEcho.java b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/stub/echostubsettings/echo/SyncEcho.java deleted file mode 100644 index a7a18faf48..0000000000 --- a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/stub/echostubsettings/echo/SyncEcho.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * 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 - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1.stub.samples; - -// [START localhost7469_v1beta1_generated_EchoStubSettings_Echo_sync] -import com.google.showcase.v1beta1.stub.EchoStubSettings; -import java.time.Duration; - -public class SyncEcho { - - public static void main(String[] args) throws Exception { - syncEcho(); - } - - public static void syncEcho() 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 - EchoStubSettings.Builder echoSettingsBuilder = EchoStubSettings.newBuilder(); - echoSettingsBuilder - .echoSettings() - .setRetrySettings( - echoSettingsBuilder - .echoSettings() - .getRetrySettings() - .toBuilder() - .setTotalTimeout(Duration.ofSeconds(30)) - .build()); - EchoStubSettings echoSettings = echoSettingsBuilder.build(); - } -} -// [END localhost7469_v1beta1_generated_EchoStubSettings_Echo_sync] diff --git a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/stub/identitystubsettings/createuser/SyncCreateUser.java b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/stub/identitystubsettings/createuser/SyncCreateUser.java deleted file mode 100644 index 0413eb47cd..0000000000 --- a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/stub/identitystubsettings/createuser/SyncCreateUser.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * 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 - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1.stub.samples; - -// [START localhost7469_v1beta1_generated_IdentityStubSettings_CreateUser_sync] -import com.google.showcase.v1beta1.stub.IdentityStubSettings; -import java.time.Duration; - -public class SyncCreateUser { - - public static void main(String[] args) throws Exception { - syncCreateUser(); - } - - public static void syncCreateUser() 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 - IdentityStubSettings.Builder identitySettingsBuilder = IdentityStubSettings.newBuilder(); - identitySettingsBuilder - .createUserSettings() - .setRetrySettings( - identitySettingsBuilder - .createUserSettings() - .getRetrySettings() - .toBuilder() - .setTotalTimeout(Duration.ofSeconds(30)) - .build()); - IdentityStubSettings identitySettings = identitySettingsBuilder.build(); - } -} -// [END localhost7469_v1beta1_generated_IdentityStubSettings_CreateUser_sync] diff --git a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/stub/messagingstubsettings/createroom/SyncCreateRoom.java b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/stub/messagingstubsettings/createroom/SyncCreateRoom.java deleted file mode 100644 index deffa23fc2..0000000000 --- a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/stub/messagingstubsettings/createroom/SyncCreateRoom.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * 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 - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1.stub.samples; - -// [START localhost7469_v1beta1_generated_MessagingStubSettings_CreateRoom_sync] -import com.google.showcase.v1beta1.stub.MessagingStubSettings; -import java.time.Duration; - -public class SyncCreateRoom { - - public static void main(String[] args) throws Exception { - syncCreateRoom(); - } - - public static void syncCreateRoom() 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 - MessagingStubSettings.Builder messagingSettingsBuilder = MessagingStubSettings.newBuilder(); - messagingSettingsBuilder - .createRoomSettings() - .setRetrySettings( - messagingSettingsBuilder - .createRoomSettings() - .getRetrySettings() - .toBuilder() - .setTotalTimeout(Duration.ofSeconds(30)) - .build()); - MessagingStubSettings messagingSettings = messagingSettingsBuilder.build(); - } -} -// [END localhost7469_v1beta1_generated_MessagingStubSettings_CreateRoom_sync] diff --git a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/stub/sequenceservicestubsettings/createsequence/SyncCreateSequence.java b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/stub/sequenceservicestubsettings/createsequence/SyncCreateSequence.java deleted file mode 100644 index c34917c717..0000000000 --- a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/stub/sequenceservicestubsettings/createsequence/SyncCreateSequence.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - * 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 - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1.stub.samples; - -// [START localhost7469_v1beta1_generated_SequenceServiceStubSettings_CreateSequence_sync] -import com.google.showcase.v1beta1.stub.SequenceServiceStubSettings; -import java.time.Duration; - -public class SyncCreateSequence { - - public static void main(String[] args) throws Exception { - syncCreateSequence(); - } - - public static void syncCreateSequence() 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 - SequenceServiceStubSettings.Builder sequenceServiceSettingsBuilder = - SequenceServiceStubSettings.newBuilder(); - sequenceServiceSettingsBuilder - .createSequenceSettings() - .setRetrySettings( - sequenceServiceSettingsBuilder - .createSequenceSettings() - .getRetrySettings() - .toBuilder() - .setTotalTimeout(Duration.ofSeconds(30)) - .build()); - SequenceServiceStubSettings sequenceServiceSettings = sequenceServiceSettingsBuilder.build(); - } -} -// [END localhost7469_v1beta1_generated_SequenceServiceStubSettings_CreateSequence_sync] diff --git a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/stub/testingstubsettings/createsession/SyncCreateSession.java b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/stub/testingstubsettings/createsession/SyncCreateSession.java deleted file mode 100644 index 0bac2ef097..0000000000 --- a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/stub/testingstubsettings/createsession/SyncCreateSession.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * 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 - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1.stub.samples; - -// [START localhost7469_v1beta1_generated_TestingStubSettings_CreateSession_sync] -import com.google.showcase.v1beta1.stub.TestingStubSettings; -import java.time.Duration; - -public class SyncCreateSession { - - public static void main(String[] args) throws Exception { - syncCreateSession(); - } - - public static void syncCreateSession() 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 - TestingStubSettings.Builder testingSettingsBuilder = TestingStubSettings.newBuilder(); - testingSettingsBuilder - .createSessionSettings() - .setRetrySettings( - testingSettingsBuilder - .createSessionSettings() - .getRetrySettings() - .toBuilder() - .setTotalTimeout(Duration.ofSeconds(30)) - .build()); - TestingStubSettings testingSettings = testingSettingsBuilder.build(); - } -} -// [END localhost7469_v1beta1_generated_TestingStubSettings_CreateSession_sync] diff --git a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/testing/create/SyncCreateSetCredentialsProvider.java b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/testing/create/SyncCreateSetCredentialsProvider.java deleted file mode 100644 index 54e8f745b6..0000000000 --- a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/testing/create/SyncCreateSetCredentialsProvider.java +++ /dev/null @@ -1,44 +0,0 @@ -/* - * 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 - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1.samples; - -// [START localhost7469_v1beta1_generated_Testing_Create_SetCredentialsProvider_sync] -import com.google.api.gax.core.FixedCredentialsProvider; -import com.google.showcase.v1beta1.TestingClient; -import com.google.showcase.v1beta1.TestingSettings; -import com.google.showcase.v1beta1.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 - TestingSettings testingSettings = - TestingSettings.newBuilder() - .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials)) - .build(); - TestingClient testingClient = TestingClient.create(testingSettings); - } -} -// [END localhost7469_v1beta1_generated_Testing_Create_SetCredentialsProvider_sync] diff --git a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/testing/create/SyncCreateSetCredentialsProvider1.java b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/testing/create/SyncCreateSetCredentialsProvider1.java deleted file mode 100644 index 98fb47f1f2..0000000000 --- a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/testing/create/SyncCreateSetCredentialsProvider1.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - * 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 - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1.samples; - -// [START localhost7469_v1beta1_generated_Testing_Create_SetCredentialsProvider1_sync] -import com.google.showcase.v1beta1.TestingClient; -import com.google.showcase.v1beta1.TestingSettings; - -public class SyncCreateSetCredentialsProvider1 { - - public static void main(String[] args) throws Exception { - syncCreateSetCredentialsProvider1(); - } - - public static void syncCreateSetCredentialsProvider1() 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 - TestingSettings testingSettings = TestingSettings.newHttpJsonBuilder().build(); - TestingClient testingClient = TestingClient.create(testingSettings); - } -} -// [END localhost7469_v1beta1_generated_Testing_Create_SetCredentialsProvider1_sync] diff --git a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/testing/create/SyncCreateSetEndpoint.java b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/testing/create/SyncCreateSetEndpoint.java deleted file mode 100644 index 31d2c2a00c..0000000000 --- a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/testing/create/SyncCreateSetEndpoint.java +++ /dev/null @@ -1,40 +0,0 @@ -/* - * 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 - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1.samples; - -// [START localhost7469_v1beta1_generated_Testing_Create_SetEndpoint_sync] -import com.google.showcase.v1beta1.TestingClient; -import com.google.showcase.v1beta1.TestingSettings; -import com.google.showcase.v1beta1.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 - TestingSettings testingSettings = TestingSettings.newBuilder().setEndpoint(myEndpoint).build(); - TestingClient testingClient = TestingClient.create(testingSettings); - } -} -// [END localhost7469_v1beta1_generated_Testing_Create_SetEndpoint_sync] diff --git a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/testing/createsession/SyncCreateSession.java b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/testing/createsession/SyncCreateSession.java deleted file mode 100644 index 1e155623d0..0000000000 --- a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/testing/createsession/SyncCreateSession.java +++ /dev/null @@ -1,43 +0,0 @@ -/* - * 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 - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1.samples; - -// [START localhost7469_v1beta1_generated_Testing_CreateSession_sync] -import com.google.showcase.v1beta1.CreateSessionRequest; -import com.google.showcase.v1beta1.Session; -import com.google.showcase.v1beta1.TestingClient; - -public class SyncCreateSession { - - public static void main(String[] args) throws Exception { - syncCreateSession(); - } - - public static void syncCreateSession() 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 (TestingClient testingClient = TestingClient.create()) { - CreateSessionRequest request = - CreateSessionRequest.newBuilder().setSession(Session.newBuilder().build()).build(); - Session response = testingClient.createSession(request); - } - } -} -// [END localhost7469_v1beta1_generated_Testing_CreateSession_sync] diff --git a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/testingsettings/createsession/SyncCreateSession.java b/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/testingsettings/createsession/SyncCreateSession.java deleted file mode 100644 index 9fd60bceb9..0000000000 --- a/showcase/gapic-showcase/samples/snippets/generated/src/main/java/com/google/showcase/v1beta1/testingsettings/createsession/SyncCreateSession.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * 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 - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1.samples; - -// [START localhost7469_v1beta1_generated_TestingSettings_CreateSession_sync] -import com.google.showcase.v1beta1.TestingSettings; -import java.time.Duration; - -public class SyncCreateSession { - - public static void main(String[] args) throws Exception { - syncCreateSession(); - } - - public static void syncCreateSession() 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 - TestingSettings.Builder testingSettingsBuilder = TestingSettings.newBuilder(); - testingSettingsBuilder - .createSessionSettings() - .setRetrySettings( - testingSettingsBuilder - .createSessionSettings() - .getRetrySettings() - .toBuilder() - .setTotalTimeout(Duration.ofSeconds(30)) - .build()); - TestingSettings testingSettings = testingSettingsBuilder.build(); - } -} -// [END localhost7469_v1beta1_generated_TestingSettings_CreateSession_sync] diff --git a/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/ComplianceClient.java b/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/ComplianceClient.java deleted file mode 100644 index 266f562e23..0000000000 --- a/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/ComplianceClient.java +++ /dev/null @@ -1,946 +0,0 @@ -/* - * 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 - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1; - -import com.google.api.core.BetaApi; -import com.google.api.gax.core.BackgroundResource; -import com.google.api.gax.rpc.UnaryCallable; -import com.google.showcase.v1beta1.stub.ComplianceStub; -import com.google.showcase.v1beta1.stub.ComplianceStubSettings; -import java.io.IOException; -import java.util.concurrent.TimeUnit; -import javax.annotation.Generated; - -// AUTO-GENERATED DOCUMENTATION AND CLASS. -/** - * Service Description: This service is used to test that GAPICs implement various REST-related - * features correctly. This mostly means transcoding proto3 requests to REST format correctly for - * various types of HTTP annotations, but it also includes verifying that unknown (numeric) enums - * received by clients can be round-tripped correctly. - * - *

        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 (ComplianceClient complianceClient = ComplianceClient.create()) {
        - *   RepeatRequest request =
        - *       RepeatRequest.newBuilder()
        - *           .setName("name3373707")
        - *           .setInfo(ComplianceData.newBuilder().build())
        - *           .setServerVerify(true)
        - *           .setIntendedBindingUri("intendedBindingUri780142386")
        - *           .setFInt32(-1143775883)
        - *           .setFInt64(-1143775788)
        - *           .setFDouble(-1239459382)
        - *           .setPInt32(-858673665)
        - *           .setPInt64(-858673570)
        - *           .setPDouble(-991225216)
        - *           .build();
        - *   RepeatResponse response = complianceClient.repeatDataBody(request);
        - * }
        - * }
        - * - *

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

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

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

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

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

        This class can be customized by passing in a custom instance of ComplianceSettings 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
        - * ComplianceSettings complianceSettings =
        - *     ComplianceSettings.newBuilder()
        - *         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
        - *         .build();
        - * ComplianceClient complianceClient = ComplianceClient.create(complianceSettings);
        - * }
        - * - *

        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
        - * ComplianceSettings complianceSettings =
        - *     ComplianceSettings.newBuilder().setEndpoint(myEndpoint).build();
        - * ComplianceClient complianceClient = ComplianceClient.create(complianceSettings);
        - * }
        - * - *

        To use REST (HTTP1.1/JSON) transport (instead of gRPC) for sending and receiving requests over - * the wire: - * - *

        {@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
        - * ComplianceSettings complianceSettings = ComplianceSettings.newHttpJsonBuilder().build();
        - * ComplianceClient complianceClient = ComplianceClient.create(complianceSettings);
        - * }
        - * - *

        Please refer to the GitHub repository's samples for more quickstart code snippets. - */ -@BetaApi -@Generated("by gapic-generator-java") -public class ComplianceClient implements BackgroundResource { - private final ComplianceSettings settings; - private final ComplianceStub stub; - - /** Constructs an instance of ComplianceClient with default settings. */ - public static final ComplianceClient create() throws IOException { - return create(ComplianceSettings.newBuilder().build()); - } - - /** - * Constructs an instance of ComplianceClient, 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 ComplianceClient create(ComplianceSettings settings) throws IOException { - return new ComplianceClient(settings); - } - - /** - * Constructs an instance of ComplianceClient, using the given stub for making calls. This is for - * advanced usage - prefer using create(ComplianceSettings). - */ - public static final ComplianceClient create(ComplianceStub stub) { - return new ComplianceClient(stub); - } - - /** - * Constructs an instance of ComplianceClient, 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 ComplianceClient(ComplianceSettings settings) throws IOException { - this.settings = settings; - this.stub = ((ComplianceStubSettings) settings.getStubSettings()).createStub(); - } - - protected ComplianceClient(ComplianceStub stub) { - this.settings = null; - this.stub = stub; - } - - public final ComplianceSettings getSettings() { - return settings; - } - - public ComplianceStub getStub() { - return stub; - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * This method echoes the ComplianceData request. This method exercises sending the entire request - * object in the REST body. - * - *

        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 (ComplianceClient complianceClient = ComplianceClient.create()) {
        -   *   RepeatRequest request =
        -   *       RepeatRequest.newBuilder()
        -   *           .setName("name3373707")
        -   *           .setInfo(ComplianceData.newBuilder().build())
        -   *           .setServerVerify(true)
        -   *           .setIntendedBindingUri("intendedBindingUri780142386")
        -   *           .setFInt32(-1143775883)
        -   *           .setFInt64(-1143775788)
        -   *           .setFDouble(-1239459382)
        -   *           .setPInt32(-858673665)
        -   *           .setPInt64(-858673570)
        -   *           .setPDouble(-991225216)
        -   *           .build();
        -   *   RepeatResponse response = complianceClient.repeatDataBody(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 RepeatResponse repeatDataBody(RepeatRequest request) { - return repeatDataBodyCallable().call(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * This method echoes the ComplianceData request. This method exercises sending the entire request - * object in the REST body. - * - *

        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 (ComplianceClient complianceClient = ComplianceClient.create()) {
        -   *   RepeatRequest request =
        -   *       RepeatRequest.newBuilder()
        -   *           .setName("name3373707")
        -   *           .setInfo(ComplianceData.newBuilder().build())
        -   *           .setServerVerify(true)
        -   *           .setIntendedBindingUri("intendedBindingUri780142386")
        -   *           .setFInt32(-1143775883)
        -   *           .setFInt64(-1143775788)
        -   *           .setFDouble(-1239459382)
        -   *           .setPInt32(-858673665)
        -   *           .setPInt64(-858673570)
        -   *           .setPDouble(-991225216)
        -   *           .build();
        -   *   ApiFuture future =
        -   *       complianceClient.repeatDataBodyCallable().futureCall(request);
        -   *   // Do something.
        -   *   RepeatResponse response = future.get();
        -   * }
        -   * }
        - */ - public final UnaryCallable repeatDataBodyCallable() { - return stub.repeatDataBodyCallable(); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * This method echoes the ComplianceData request. This method exercises sending the a message-type - * field in the REST body. Per AIP-127, only top-level, non-repeated fields can be sent this way. - * - *

        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 (ComplianceClient complianceClient = ComplianceClient.create()) {
        -   *   RepeatRequest request =
        -   *       RepeatRequest.newBuilder()
        -   *           .setName("name3373707")
        -   *           .setInfo(ComplianceData.newBuilder().build())
        -   *           .setServerVerify(true)
        -   *           .setIntendedBindingUri("intendedBindingUri780142386")
        -   *           .setFInt32(-1143775883)
        -   *           .setFInt64(-1143775788)
        -   *           .setFDouble(-1239459382)
        -   *           .setPInt32(-858673665)
        -   *           .setPInt64(-858673570)
        -   *           .setPDouble(-991225216)
        -   *           .build();
        -   *   RepeatResponse response = complianceClient.repeatDataBodyInfo(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 RepeatResponse repeatDataBodyInfo(RepeatRequest request) { - return repeatDataBodyInfoCallable().call(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * This method echoes the ComplianceData request. This method exercises sending the a message-type - * field in the REST body. Per AIP-127, only top-level, non-repeated fields can be sent this way. - * - *

        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 (ComplianceClient complianceClient = ComplianceClient.create()) {
        -   *   RepeatRequest request =
        -   *       RepeatRequest.newBuilder()
        -   *           .setName("name3373707")
        -   *           .setInfo(ComplianceData.newBuilder().build())
        -   *           .setServerVerify(true)
        -   *           .setIntendedBindingUri("intendedBindingUri780142386")
        -   *           .setFInt32(-1143775883)
        -   *           .setFInt64(-1143775788)
        -   *           .setFDouble(-1239459382)
        -   *           .setPInt32(-858673665)
        -   *           .setPInt64(-858673570)
        -   *           .setPDouble(-991225216)
        -   *           .build();
        -   *   ApiFuture future =
        -   *       complianceClient.repeatDataBodyInfoCallable().futureCall(request);
        -   *   // Do something.
        -   *   RepeatResponse response = future.get();
        -   * }
        -   * }
        - */ - public final UnaryCallable repeatDataBodyInfoCallable() { - return stub.repeatDataBodyInfoCallable(); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * This method echoes the ComplianceData request. This method exercises sending all request fields - * as query parameters. - * - *

        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 (ComplianceClient complianceClient = ComplianceClient.create()) {
        -   *   RepeatRequest request =
        -   *       RepeatRequest.newBuilder()
        -   *           .setName("name3373707")
        -   *           .setInfo(ComplianceData.newBuilder().build())
        -   *           .setServerVerify(true)
        -   *           .setIntendedBindingUri("intendedBindingUri780142386")
        -   *           .setFInt32(-1143775883)
        -   *           .setFInt64(-1143775788)
        -   *           .setFDouble(-1239459382)
        -   *           .setPInt32(-858673665)
        -   *           .setPInt64(-858673570)
        -   *           .setPDouble(-991225216)
        -   *           .build();
        -   *   RepeatResponse response = complianceClient.repeatDataQuery(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 RepeatResponse repeatDataQuery(RepeatRequest request) { - return repeatDataQueryCallable().call(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * This method echoes the ComplianceData request. This method exercises sending all request fields - * as query parameters. - * - *

        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 (ComplianceClient complianceClient = ComplianceClient.create()) {
        -   *   RepeatRequest request =
        -   *       RepeatRequest.newBuilder()
        -   *           .setName("name3373707")
        -   *           .setInfo(ComplianceData.newBuilder().build())
        -   *           .setServerVerify(true)
        -   *           .setIntendedBindingUri("intendedBindingUri780142386")
        -   *           .setFInt32(-1143775883)
        -   *           .setFInt64(-1143775788)
        -   *           .setFDouble(-1239459382)
        -   *           .setPInt32(-858673665)
        -   *           .setPInt64(-858673570)
        -   *           .setPDouble(-991225216)
        -   *           .build();
        -   *   ApiFuture future =
        -   *       complianceClient.repeatDataQueryCallable().futureCall(request);
        -   *   // Do something.
        -   *   RepeatResponse response = future.get();
        -   * }
        -   * }
        - */ - public final UnaryCallable repeatDataQueryCallable() { - return stub.repeatDataQueryCallable(); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * This method echoes the ComplianceData request. This method exercises sending some parameters as - * "simple" path variables (i.e., of the form "/bar/{foo}" rather than "/{foo=bar/*}"), and - * the rest as query parameters. - * - *

        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 (ComplianceClient complianceClient = ComplianceClient.create()) {
        -   *   RepeatRequest request =
        -   *       RepeatRequest.newBuilder()
        -   *           .setName("name3373707")
        -   *           .setInfo(ComplianceData.newBuilder().build())
        -   *           .setServerVerify(true)
        -   *           .setIntendedBindingUri("intendedBindingUri780142386")
        -   *           .setFInt32(-1143775883)
        -   *           .setFInt64(-1143775788)
        -   *           .setFDouble(-1239459382)
        -   *           .setPInt32(-858673665)
        -   *           .setPInt64(-858673570)
        -   *           .setPDouble(-991225216)
        -   *           .build();
        -   *   RepeatResponse response = complianceClient.repeatDataSimplePath(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 RepeatResponse repeatDataSimplePath(RepeatRequest request) { - return repeatDataSimplePathCallable().call(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * This method echoes the ComplianceData request. This method exercises sending some parameters as - * "simple" path variables (i.e., of the form "/bar/{foo}" rather than "/{foo=bar/*}"), and - * the rest as query parameters. - * - *

        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 (ComplianceClient complianceClient = ComplianceClient.create()) {
        -   *   RepeatRequest request =
        -   *       RepeatRequest.newBuilder()
        -   *           .setName("name3373707")
        -   *           .setInfo(ComplianceData.newBuilder().build())
        -   *           .setServerVerify(true)
        -   *           .setIntendedBindingUri("intendedBindingUri780142386")
        -   *           .setFInt32(-1143775883)
        -   *           .setFInt64(-1143775788)
        -   *           .setFDouble(-1239459382)
        -   *           .setPInt32(-858673665)
        -   *           .setPInt64(-858673570)
        -   *           .setPDouble(-991225216)
        -   *           .build();
        -   *   ApiFuture future =
        -   *       complianceClient.repeatDataSimplePathCallable().futureCall(request);
        -   *   // Do something.
        -   *   RepeatResponse response = future.get();
        -   * }
        -   * }
        - */ - public final UnaryCallable repeatDataSimplePathCallable() { - return stub.repeatDataSimplePathCallable(); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Same as RepeatDataSimplePath, but with a path 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 (ComplianceClient complianceClient = ComplianceClient.create()) {
        -   *   RepeatRequest request =
        -   *       RepeatRequest.newBuilder()
        -   *           .setName("name3373707")
        -   *           .setInfo(ComplianceData.newBuilder().build())
        -   *           .setServerVerify(true)
        -   *           .setIntendedBindingUri("intendedBindingUri780142386")
        -   *           .setFInt32(-1143775883)
        -   *           .setFInt64(-1143775788)
        -   *           .setFDouble(-1239459382)
        -   *           .setPInt32(-858673665)
        -   *           .setPInt64(-858673570)
        -   *           .setPDouble(-991225216)
        -   *           .build();
        -   *   RepeatResponse response = complianceClient.repeatDataPathResource(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 RepeatResponse repeatDataPathResource(RepeatRequest request) { - return repeatDataPathResourceCallable().call(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Same as RepeatDataSimplePath, but with a path 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 (ComplianceClient complianceClient = ComplianceClient.create()) {
        -   *   RepeatRequest request =
        -   *       RepeatRequest.newBuilder()
        -   *           .setName("name3373707")
        -   *           .setInfo(ComplianceData.newBuilder().build())
        -   *           .setServerVerify(true)
        -   *           .setIntendedBindingUri("intendedBindingUri780142386")
        -   *           .setFInt32(-1143775883)
        -   *           .setFInt64(-1143775788)
        -   *           .setFDouble(-1239459382)
        -   *           .setPInt32(-858673665)
        -   *           .setPInt64(-858673570)
        -   *           .setPDouble(-991225216)
        -   *           .build();
        -   *   ApiFuture future =
        -   *       complianceClient.repeatDataPathResourceCallable().futureCall(request);
        -   *   // Do something.
        -   *   RepeatResponse response = future.get();
        -   * }
        -   * }
        - */ - public final UnaryCallable repeatDataPathResourceCallable() { - return stub.repeatDataPathResourceCallable(); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Same as RepeatDataSimplePath, but with a trailing 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 (ComplianceClient complianceClient = ComplianceClient.create()) {
        -   *   RepeatRequest request =
        -   *       RepeatRequest.newBuilder()
        -   *           .setName("name3373707")
        -   *           .setInfo(ComplianceData.newBuilder().build())
        -   *           .setServerVerify(true)
        -   *           .setIntendedBindingUri("intendedBindingUri780142386")
        -   *           .setFInt32(-1143775883)
        -   *           .setFInt64(-1143775788)
        -   *           .setFDouble(-1239459382)
        -   *           .setPInt32(-858673665)
        -   *           .setPInt64(-858673570)
        -   *           .setPDouble(-991225216)
        -   *           .build();
        -   *   RepeatResponse response = complianceClient.repeatDataPathTrailingResource(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 RepeatResponse repeatDataPathTrailingResource(RepeatRequest request) { - return repeatDataPathTrailingResourceCallable().call(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Same as RepeatDataSimplePath, but with a trailing 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 (ComplianceClient complianceClient = ComplianceClient.create()) {
        -   *   RepeatRequest request =
        -   *       RepeatRequest.newBuilder()
        -   *           .setName("name3373707")
        -   *           .setInfo(ComplianceData.newBuilder().build())
        -   *           .setServerVerify(true)
        -   *           .setIntendedBindingUri("intendedBindingUri780142386")
        -   *           .setFInt32(-1143775883)
        -   *           .setFInt64(-1143775788)
        -   *           .setFDouble(-1239459382)
        -   *           .setPInt32(-858673665)
        -   *           .setPInt64(-858673570)
        -   *           .setPDouble(-991225216)
        -   *           .build();
        -   *   ApiFuture future =
        -   *       complianceClient.repeatDataPathTrailingResourceCallable().futureCall(request);
        -   *   // Do something.
        -   *   RepeatResponse response = future.get();
        -   * }
        -   * }
        - */ - public final UnaryCallable - repeatDataPathTrailingResourceCallable() { - return stub.repeatDataPathTrailingResourceCallable(); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * This method echoes the ComplianceData request, using the HTTP PUT method. - * - *

        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 (ComplianceClient complianceClient = ComplianceClient.create()) {
        -   *   RepeatRequest request =
        -   *       RepeatRequest.newBuilder()
        -   *           .setName("name3373707")
        -   *           .setInfo(ComplianceData.newBuilder().build())
        -   *           .setServerVerify(true)
        -   *           .setIntendedBindingUri("intendedBindingUri780142386")
        -   *           .setFInt32(-1143775883)
        -   *           .setFInt64(-1143775788)
        -   *           .setFDouble(-1239459382)
        -   *           .setPInt32(-858673665)
        -   *           .setPInt64(-858673570)
        -   *           .setPDouble(-991225216)
        -   *           .build();
        -   *   RepeatResponse response = complianceClient.repeatDataBodyPut(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 RepeatResponse repeatDataBodyPut(RepeatRequest request) { - return repeatDataBodyPutCallable().call(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * This method echoes the ComplianceData request, using the HTTP PUT method. - * - *

        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 (ComplianceClient complianceClient = ComplianceClient.create()) {
        -   *   RepeatRequest request =
        -   *       RepeatRequest.newBuilder()
        -   *           .setName("name3373707")
        -   *           .setInfo(ComplianceData.newBuilder().build())
        -   *           .setServerVerify(true)
        -   *           .setIntendedBindingUri("intendedBindingUri780142386")
        -   *           .setFInt32(-1143775883)
        -   *           .setFInt64(-1143775788)
        -   *           .setFDouble(-1239459382)
        -   *           .setPInt32(-858673665)
        -   *           .setPInt64(-858673570)
        -   *           .setPDouble(-991225216)
        -   *           .build();
        -   *   ApiFuture future =
        -   *       complianceClient.repeatDataBodyPutCallable().futureCall(request);
        -   *   // Do something.
        -   *   RepeatResponse response = future.get();
        -   * }
        -   * }
        - */ - public final UnaryCallable repeatDataBodyPutCallable() { - return stub.repeatDataBodyPutCallable(); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * This method echoes the ComplianceData request, using the HTTP PATCH method. - * - *

        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 (ComplianceClient complianceClient = ComplianceClient.create()) {
        -   *   RepeatRequest request =
        -   *       RepeatRequest.newBuilder()
        -   *           .setName("name3373707")
        -   *           .setInfo(ComplianceData.newBuilder().build())
        -   *           .setServerVerify(true)
        -   *           .setIntendedBindingUri("intendedBindingUri780142386")
        -   *           .setFInt32(-1143775883)
        -   *           .setFInt64(-1143775788)
        -   *           .setFDouble(-1239459382)
        -   *           .setPInt32(-858673665)
        -   *           .setPInt64(-858673570)
        -   *           .setPDouble(-991225216)
        -   *           .build();
        -   *   RepeatResponse response = complianceClient.repeatDataBodyPatch(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 RepeatResponse repeatDataBodyPatch(RepeatRequest request) { - return repeatDataBodyPatchCallable().call(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * This method echoes the ComplianceData request, using the HTTP PATCH method. - * - *

        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 (ComplianceClient complianceClient = ComplianceClient.create()) {
        -   *   RepeatRequest request =
        -   *       RepeatRequest.newBuilder()
        -   *           .setName("name3373707")
        -   *           .setInfo(ComplianceData.newBuilder().build())
        -   *           .setServerVerify(true)
        -   *           .setIntendedBindingUri("intendedBindingUri780142386")
        -   *           .setFInt32(-1143775883)
        -   *           .setFInt64(-1143775788)
        -   *           .setFDouble(-1239459382)
        -   *           .setPInt32(-858673665)
        -   *           .setPInt64(-858673570)
        -   *           .setPDouble(-991225216)
        -   *           .build();
        -   *   ApiFuture future =
        -   *       complianceClient.repeatDataBodyPatchCallable().futureCall(request);
        -   *   // Do something.
        -   *   RepeatResponse response = future.get();
        -   * }
        -   * }
        - */ - public final UnaryCallable repeatDataBodyPatchCallable() { - return stub.repeatDataBodyPatchCallable(); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * This method requests an enum value from the server. Depending on the contents of EnumRequest, - * the enum value returned will be a known enum declared in the .proto file, or a made-up enum - * value the is unknown to the client. To verify that clients can round-trip unknown enum vaues - * they receive, use the response from this RPC as the request to VerifyEnum() - * - *

        The values of enums sent by the server when a known or unknown value is requested will be - * the same within a single Showcase server run (this is needed for VerifyEnum() to work) but are - * not guaranteed to be the same across separate Showcase server runs. - * - *

        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 (ComplianceClient complianceClient = ComplianceClient.create()) {
        -   *   EnumRequest request = EnumRequest.newBuilder().setUnknownEnum(true).build();
        -   *   EnumResponse response = complianceClient.getEnum(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 EnumResponse getEnum(EnumRequest request) { - return getEnumCallable().call(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * This method requests an enum value from the server. Depending on the contents of EnumRequest, - * the enum value returned will be a known enum declared in the .proto file, or a made-up enum - * value the is unknown to the client. To verify that clients can round-trip unknown enum vaues - * they receive, use the response from this RPC as the request to VerifyEnum() - * - *

        The values of enums sent by the server when a known or unknown value is requested will be - * the same within a single Showcase server run (this is needed for VerifyEnum() to work) but are - * not guaranteed to be the same across separate Showcase server runs. - * - *

        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 (ComplianceClient complianceClient = ComplianceClient.create()) {
        -   *   EnumRequest request = EnumRequest.newBuilder().setUnknownEnum(true).build();
        -   *   ApiFuture future = complianceClient.getEnumCallable().futureCall(request);
        -   *   // Do something.
        -   *   EnumResponse response = future.get();
        -   * }
        -   * }
        - */ - public final UnaryCallable getEnumCallable() { - return stub.getEnumCallable(); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * This method is used to verify that clients can round-trip enum values, which is particularly - * important for unknown enum values over REST. VerifyEnum() verifies that its request, which is - * presumably the response that the client previously got to a GetEnum(), contains the correct - * data. If so, it responds with the same EnumResponse; otherwise, the RPC errors. - * - *

        This works because the values of enums sent by the server when a known or unknown value is - * requested will be the same within a single Showcase server run, although they are not - * guaranteed to be the same across separate Showcase server runs. - * - *

        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 (ComplianceClient complianceClient = ComplianceClient.create()) {
        -   *   EnumResponse request =
        -   *       EnumResponse.newBuilder()
        -   *           .setRequest(EnumRequest.newBuilder().build())
        -   *           .setContinent(Continent.forNumber(0))
        -   *           .build();
        -   *   EnumResponse response = complianceClient.verifyEnum(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 EnumResponse verifyEnum(EnumResponse request) { - return verifyEnumCallable().call(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * This method is used to verify that clients can round-trip enum values, which is particularly - * important for unknown enum values over REST. VerifyEnum() verifies that its request, which is - * presumably the response that the client previously got to a GetEnum(), contains the correct - * data. If so, it responds with the same EnumResponse; otherwise, the RPC errors. - * - *

        This works because the values of enums sent by the server when a known or unknown value is - * requested will be the same within a single Showcase server run, although they are not - * guaranteed to be the same across separate Showcase server runs. - * - *

        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 (ComplianceClient complianceClient = ComplianceClient.create()) {
        -   *   EnumResponse request =
        -   *       EnumResponse.newBuilder()
        -   *           .setRequest(EnumRequest.newBuilder().build())
        -   *           .setContinent(Continent.forNumber(0))
        -   *           .build();
        -   *   ApiFuture future = complianceClient.verifyEnumCallable().futureCall(request);
        -   *   // Do something.
        -   *   EnumResponse response = future.get();
        -   * }
        -   * }
        - */ - public final UnaryCallable verifyEnumCallable() { - return stub.verifyEnumCallable(); - } - - @Override - public final void close() { - stub.close(); - } - - @Override - public void shutdown() { - stub.shutdown(); - } - - @Override - public boolean isShutdown() { - return stub.isShutdown(); - } - - @Override - public boolean isTerminated() { - return stub.isTerminated(); - } - - @Override - public void shutdownNow() { - stub.shutdownNow(); - } - - @Override - public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { - return stub.awaitTermination(duration, unit); - } -} diff --git a/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/ComplianceSettings.java b/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/ComplianceSettings.java deleted file mode 100644 index 8b562e3999..0000000000 --- a/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/ComplianceSettings.java +++ /dev/null @@ -1,297 +0,0 @@ -/* - * 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 - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1; - -import com.google.api.core.ApiFunction; -import com.google.api.core.BetaApi; -import com.google.api.gax.core.GoogleCredentialsProvider; -import com.google.api.gax.core.InstantiatingExecutorProvider; -import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; -import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; -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.StubSettings; -import com.google.api.gax.rpc.TransportChannelProvider; -import com.google.api.gax.rpc.UnaryCallSettings; -import com.google.showcase.v1beta1.stub.ComplianceStubSettings; -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 ComplianceClient}. - * - *

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

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

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

        For example, to set the total timeout of repeatDataBody to 30 seconds: - * - *

        {@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
        - * ComplianceSettings.Builder complianceSettingsBuilder = ComplianceSettings.newBuilder();
        - * complianceSettingsBuilder
        - *     .repeatDataBodySettings()
        - *     .setRetrySettings(
        - *         complianceSettingsBuilder
        - *             .repeatDataBodySettings()
        - *             .getRetrySettings()
        - *             .toBuilder()
        - *             .setTotalTimeout(Duration.ofSeconds(30))
        - *             .build());
        - * ComplianceSettings complianceSettings = complianceSettingsBuilder.build();
        - * }
        - */ -@BetaApi -@Generated("by gapic-generator-java") -public class ComplianceSettings extends ClientSettings { - - /** Returns the object with the settings used for calls to repeatDataBody. */ - public UnaryCallSettings repeatDataBodySettings() { - return ((ComplianceStubSettings) getStubSettings()).repeatDataBodySettings(); - } - - /** Returns the object with the settings used for calls to repeatDataBodyInfo. */ - public UnaryCallSettings repeatDataBodyInfoSettings() { - return ((ComplianceStubSettings) getStubSettings()).repeatDataBodyInfoSettings(); - } - - /** Returns the object with the settings used for calls to repeatDataQuery. */ - public UnaryCallSettings repeatDataQuerySettings() { - return ((ComplianceStubSettings) getStubSettings()).repeatDataQuerySettings(); - } - - /** Returns the object with the settings used for calls to repeatDataSimplePath. */ - public UnaryCallSettings repeatDataSimplePathSettings() { - return ((ComplianceStubSettings) getStubSettings()).repeatDataSimplePathSettings(); - } - - /** Returns the object with the settings used for calls to repeatDataPathResource. */ - public UnaryCallSettings repeatDataPathResourceSettings() { - return ((ComplianceStubSettings) getStubSettings()).repeatDataPathResourceSettings(); - } - - /** Returns the object with the settings used for calls to repeatDataPathTrailingResource. */ - public UnaryCallSettings repeatDataPathTrailingResourceSettings() { - return ((ComplianceStubSettings) getStubSettings()).repeatDataPathTrailingResourceSettings(); - } - - /** Returns the object with the settings used for calls to repeatDataBodyPut. */ - public UnaryCallSettings repeatDataBodyPutSettings() { - return ((ComplianceStubSettings) getStubSettings()).repeatDataBodyPutSettings(); - } - - /** Returns the object with the settings used for calls to repeatDataBodyPatch. */ - public UnaryCallSettings repeatDataBodyPatchSettings() { - return ((ComplianceStubSettings) getStubSettings()).repeatDataBodyPatchSettings(); - } - - /** Returns the object with the settings used for calls to getEnum. */ - public UnaryCallSettings getEnumSettings() { - return ((ComplianceStubSettings) getStubSettings()).getEnumSettings(); - } - - /** Returns the object with the settings used for calls to verifyEnum. */ - public UnaryCallSettings verifyEnumSettings() { - return ((ComplianceStubSettings) getStubSettings()).verifyEnumSettings(); - } - - public static final ComplianceSettings create(ComplianceStubSettings stub) throws IOException { - return new ComplianceSettings.Builder(stub.toBuilder()).build(); - } - - /** Returns a builder for the default ExecutorProvider for this service. */ - public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { - return ComplianceStubSettings.defaultExecutorProviderBuilder(); - } - - /** Returns the default service endpoint. */ - public static String getDefaultEndpoint() { - return ComplianceStubSettings.getDefaultEndpoint(); - } - - /** Returns the default service scopes. */ - public static List getDefaultServiceScopes() { - return ComplianceStubSettings.getDefaultServiceScopes(); - } - - /** Returns a builder for the default credentials for this service. */ - public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { - return ComplianceStubSettings.defaultCredentialsProviderBuilder(); - } - - /** Returns a builder for the default gRPC ChannelProvider for this service. */ - public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { - return ComplianceStubSettings.defaultGrpcTransportProviderBuilder(); - } - - /** Returns a builder for the default REST ChannelProvider for this service. */ - @BetaApi - public static InstantiatingHttpJsonChannelProvider.Builder - defaultHttpJsonTransportProviderBuilder() { - return ComplianceStubSettings.defaultHttpJsonTransportProviderBuilder(); - } - - public static TransportChannelProvider defaultTransportChannelProvider() { - return ComplianceStubSettings.defaultTransportChannelProvider(); - } - - @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") - public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { - return ComplianceStubSettings.defaultApiClientHeaderProviderBuilder(); - } - - /** Returns a new gRPC builder for this class. */ - public static Builder newBuilder() { - return Builder.createDefault(); - } - - /** Returns a new REST builder for this class. */ - @BetaApi - public static Builder newHttpJsonBuilder() { - return Builder.createHttpJsonDefault(); - } - - /** 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 ComplianceSettings(Builder settingsBuilder) throws IOException { - super(settingsBuilder); - } - - /** Builder for ComplianceSettings. */ - public static class Builder extends ClientSettings.Builder { - - protected Builder() throws IOException { - this(((ClientContext) null)); - } - - protected Builder(ClientContext clientContext) { - super(ComplianceStubSettings.newBuilder(clientContext)); - } - - protected Builder(ComplianceSettings settings) { - super(settings.getStubSettings().toBuilder()); - } - - protected Builder(ComplianceStubSettings.Builder stubSettings) { - super(stubSettings); - } - - private static Builder createDefault() { - return new Builder(ComplianceStubSettings.newBuilder()); - } - - @BetaApi - private static Builder createHttpJsonDefault() { - return new Builder(ComplianceStubSettings.newHttpJsonBuilder()); - } - - public ComplianceStubSettings.Builder getStubSettingsBuilder() { - return ((ComplianceStubSettings.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 repeatDataBody. */ - public UnaryCallSettings.Builder repeatDataBodySettings() { - return getStubSettingsBuilder().repeatDataBodySettings(); - } - - /** Returns the builder for the settings used for calls to repeatDataBodyInfo. */ - public UnaryCallSettings.Builder repeatDataBodyInfoSettings() { - return getStubSettingsBuilder().repeatDataBodyInfoSettings(); - } - - /** Returns the builder for the settings used for calls to repeatDataQuery. */ - public UnaryCallSettings.Builder repeatDataQuerySettings() { - return getStubSettingsBuilder().repeatDataQuerySettings(); - } - - /** Returns the builder for the settings used for calls to repeatDataSimplePath. */ - public UnaryCallSettings.Builder repeatDataSimplePathSettings() { - return getStubSettingsBuilder().repeatDataSimplePathSettings(); - } - - /** Returns the builder for the settings used for calls to repeatDataPathResource. */ - public UnaryCallSettings.Builder - repeatDataPathResourceSettings() { - return getStubSettingsBuilder().repeatDataPathResourceSettings(); - } - - /** Returns the builder for the settings used for calls to repeatDataPathTrailingResource. */ - public UnaryCallSettings.Builder - repeatDataPathTrailingResourceSettings() { - return getStubSettingsBuilder().repeatDataPathTrailingResourceSettings(); - } - - /** Returns the builder for the settings used for calls to repeatDataBodyPut. */ - public UnaryCallSettings.Builder repeatDataBodyPutSettings() { - return getStubSettingsBuilder().repeatDataBodyPutSettings(); - } - - /** Returns the builder for the settings used for calls to repeatDataBodyPatch. */ - public UnaryCallSettings.Builder repeatDataBodyPatchSettings() { - return getStubSettingsBuilder().repeatDataBodyPatchSettings(); - } - - /** Returns the builder for the settings used for calls to getEnum. */ - public UnaryCallSettings.Builder getEnumSettings() { - return getStubSettingsBuilder().getEnumSettings(); - } - - /** Returns the builder for the settings used for calls to verifyEnum. */ - public UnaryCallSettings.Builder verifyEnumSettings() { - return getStubSettingsBuilder().verifyEnumSettings(); - } - - @Override - public ComplianceSettings build() throws IOException { - return new ComplianceSettings(this); - } - } -} diff --git a/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/EchoClient.java b/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/EchoClient.java deleted file mode 100644 index 43d886930d..0000000000 --- a/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/EchoClient.java +++ /dev/null @@ -1,999 +0,0 @@ -/* - * 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 - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1; - -import com.google.api.core.ApiFuture; -import com.google.api.core.ApiFutures; -import com.google.api.core.BetaApi; -import com.google.api.gax.core.BackgroundResource; -import com.google.api.gax.httpjson.longrunning.OperationsClient; -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.BidiStreamingCallable; -import com.google.api.gax.rpc.ClientStreamingCallable; -import com.google.api.gax.rpc.OperationCallable; -import com.google.api.gax.rpc.PageContext; -import com.google.api.gax.rpc.ServerStreamingCallable; -import com.google.api.gax.rpc.UnaryCallable; -import com.google.common.util.concurrent.MoreExecutors; -import com.google.longrunning.Operation; -import com.google.showcase.v1beta1.stub.EchoStub; -import com.google.showcase.v1beta1.stub.EchoStubSettings; -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: This service is used showcase the four main types of rpcs - unary, server - * side streaming, client side streaming, and bidirectional streaming. This service also exposes - * methods that explicitly implement server delay, and paginated calls. Set the 'showcase-trailer' - * metadata key on any method to have the values echoed in the response trailers. Set the - * 'x-goog-request-params' metadata key on any method to have the values echoed in the response - * headers. - * - *

        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 (EchoClient echoClient = EchoClient.create()) {
        - *   EchoRequest request =
        - *       EchoRequest.newBuilder()
        - *           .setSeverity(Severity.forNumber(0))
        - *           .setHeader("header-1221270899")
        - *           .setOtherHeader("otherHeader-2026585667")
        - *           .build();
        - *   EchoResponse response = echoClient.echo(request);
        - * }
        - * }
        - * - *

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

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

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

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

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

        This class can be customized by passing in a custom instance of EchoSettings 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
        - * EchoSettings echoSettings =
        - *     EchoSettings.newBuilder()
        - *         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
        - *         .build();
        - * EchoClient echoClient = EchoClient.create(echoSettings);
        - * }
        - * - *

        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
        - * EchoSettings echoSettings = EchoSettings.newBuilder().setEndpoint(myEndpoint).build();
        - * EchoClient echoClient = EchoClient.create(echoSettings);
        - * }
        - * - *

        To use REST (HTTP1.1/JSON) transport (instead of gRPC) for sending and receiving requests over - * the wire: - * - *

        {@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
        - * EchoSettings echoSettings = EchoSettings.newHttpJsonBuilder().build();
        - * EchoClient echoClient = EchoClient.create(echoSettings);
        - * }
        - * - *

        Please refer to the GitHub repository's samples for more quickstart code snippets. - */ -@BetaApi -@Generated("by gapic-generator-java") -public class EchoClient implements BackgroundResource { - private final EchoSettings settings; - private final EchoStub stub; - private final OperationsClient httpJsonOperationsClient; - private final com.google.longrunning.OperationsClient operationsClient; - - /** Constructs an instance of EchoClient with default settings. */ - public static final EchoClient create() throws IOException { - return create(EchoSettings.newBuilder().build()); - } - - /** - * Constructs an instance of EchoClient, 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 EchoClient create(EchoSettings settings) throws IOException { - return new EchoClient(settings); - } - - /** - * Constructs an instance of EchoClient, using the given stub for making calls. This is for - * advanced usage - prefer using create(EchoSettings). - */ - public static final EchoClient create(EchoStub stub) { - return new EchoClient(stub); - } - - /** - * Constructs an instance of EchoClient, 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 EchoClient(EchoSettings settings) throws IOException { - this.settings = settings; - this.stub = ((EchoStubSettings) settings.getStubSettings()).createStub(); - this.operationsClient = - com.google.longrunning.OperationsClient.create(this.stub.getOperationsStub()); - this.httpJsonOperationsClient = OperationsClient.create(this.stub.getHttpJsonOperationsStub()); - } - - protected EchoClient(EchoStub stub) { - this.settings = null; - this.stub = stub; - this.operationsClient = - com.google.longrunning.OperationsClient.create(this.stub.getOperationsStub()); - this.httpJsonOperationsClient = OperationsClient.create(this.stub.getHttpJsonOperationsStub()); - } - - public final EchoSettings getSettings() { - return settings; - } - - public EchoStub 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 com.google.longrunning.OperationsClient getOperationsClient() { - return operationsClient; - } - - /** - * Returns the OperationsClient that can be used to query the status of a long-running operation - * returned by another API method call. - */ - @BetaApi - public final OperationsClient getHttpJsonOperationsClient() { - return httpJsonOperationsClient; - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * This method simply echoes the request. This method showcases unary RPCs. - * - *

        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 (EchoClient echoClient = EchoClient.create()) {
        -   *   EchoRequest request =
        -   *       EchoRequest.newBuilder()
        -   *           .setSeverity(Severity.forNumber(0))
        -   *           .setHeader("header-1221270899")
        -   *           .setOtherHeader("otherHeader-2026585667")
        -   *           .build();
        -   *   EchoResponse response = echoClient.echo(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 EchoResponse echo(EchoRequest request) { - return echoCallable().call(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * This method simply echoes the request. This method showcases unary RPCs. - * - *

        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 (EchoClient echoClient = EchoClient.create()) {
        -   *   EchoRequest request =
        -   *       EchoRequest.newBuilder()
        -   *           .setSeverity(Severity.forNumber(0))
        -   *           .setHeader("header-1221270899")
        -   *           .setOtherHeader("otherHeader-2026585667")
        -   *           .build();
        -   *   ApiFuture future = echoClient.echoCallable().futureCall(request);
        -   *   // Do something.
        -   *   EchoResponse response = future.get();
        -   * }
        -   * }
        - */ - public final UnaryCallable echoCallable() { - return stub.echoCallable(); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * This method splits the given content into words and will pass each word back through the - * stream. This method showcases server-side streaming RPCs. - * - *

        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 (EchoClient echoClient = EchoClient.create()) {
        -   *   ExpandRequest request =
        -   *       ExpandRequest.newBuilder()
        -   *           .setContent("content951530617")
        -   *           .setError(Status.newBuilder().build())
        -   *           .build();
        -   *   ServerStream stream = echoClient.expandCallable().call(request);
        -   *   for (EchoResponse response : stream) {
        -   *     // Do something when a response is received.
        -   *   }
        -   * }
        -   * }
        - */ - public final ServerStreamingCallable expandCallable() { - return stub.expandCallable(); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * This method will collect the words given to it. When the stream is closed by the client, this - * method will return the a concatenation of the strings passed to it. This method showcases - * client-side streaming RPCs. - * - *

        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 (EchoClient echoClient = EchoClient.create()) {
        -   *   ApiStreamObserver responseObserver =
        -   *       new ApiStreamObserver() {
        -   *         {@literal @}Override
        -   *         public void onNext(EchoResponse response) {
        -   *           // Do something when a response is received.
        -   *         }
        -   *
        -   *         {@literal @}Override
        -   *         public void onError(Throwable t) {
        -   *           // Add error-handling
        -   *         }
        -   *
        -   *         {@literal @}Override
        -   *         public void onCompleted() {
        -   *           // Do something when complete.
        -   *         }
        -   *       };
        -   *   ApiStreamObserver requestObserver =
        -   *       echoClient.collect().clientStreamingCall(responseObserver);
        -   *   EchoRequest request =
        -   *       EchoRequest.newBuilder()
        -   *           .setSeverity(Severity.forNumber(0))
        -   *           .setHeader("header-1221270899")
        -   *           .setOtherHeader("otherHeader-2026585667")
        -   *           .build();
        -   *   requestObserver.onNext(request);
        -   * }
        -   * }
        - */ - public final ClientStreamingCallable collectCallable() { - return stub.collectCallable(); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * This method, upon receiving a request on the stream, will pass the same content back on the - * stream. This method showcases bidirectional streaming RPCs. - * - *

        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 (EchoClient echoClient = EchoClient.create()) {
        -   *   BidiStream bidiStream = echoClient.chatCallable().call();
        -   *   EchoRequest request =
        -   *       EchoRequest.newBuilder()
        -   *           .setSeverity(Severity.forNumber(0))
        -   *           .setHeader("header-1221270899")
        -   *           .setOtherHeader("otherHeader-2026585667")
        -   *           .build();
        -   *   bidiStream.send(request);
        -   *   for (EchoResponse response : bidiStream) {
        -   *     // Do something when a response is received.
        -   *   }
        -   * }
        -   * }
        - */ - public final BidiStreamingCallable chatCallable() { - return stub.chatCallable(); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * This is similar to the Expand method but instead of returning a stream of expanded words, this - * method returns a paged list of expanded words. - * - *

        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 (EchoClient echoClient = EchoClient.create()) {
        -   *   PagedExpandRequest request =
        -   *       PagedExpandRequest.newBuilder()
        -   *           .setContent("content951530617")
        -   *           .setPageSize(883849137)
        -   *           .setPageToken("pageToken873572522")
        -   *           .build();
        -   *   for (EchoResponse element : echoClient.pagedExpand(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 PagedExpandPagedResponse pagedExpand(PagedExpandRequest request) { - return pagedExpandPagedCallable().call(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * This is similar to the Expand method but instead of returning a stream of expanded words, this - * method returns a paged list of expanded words. - * - *

        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 (EchoClient echoClient = EchoClient.create()) {
        -   *   PagedExpandRequest request =
        -   *       PagedExpandRequest.newBuilder()
        -   *           .setContent("content951530617")
        -   *           .setPageSize(883849137)
        -   *           .setPageToken("pageToken873572522")
        -   *           .build();
        -   *   ApiFuture future = echoClient.pagedExpandPagedCallable().futureCall(request);
        -   *   // Do something.
        -   *   for (EchoResponse element : future.get().iterateAll()) {
        -   *     // doThingsWith(element);
        -   *   }
        -   * }
        -   * }
        - */ - public final UnaryCallable - pagedExpandPagedCallable() { - return stub.pagedExpandPagedCallable(); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * This is similar to the Expand method but instead of returning a stream of expanded words, this - * method returns a paged list of expanded words. - * - *

        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 (EchoClient echoClient = EchoClient.create()) {
        -   *   PagedExpandRequest request =
        -   *       PagedExpandRequest.newBuilder()
        -   *           .setContent("content951530617")
        -   *           .setPageSize(883849137)
        -   *           .setPageToken("pageToken873572522")
        -   *           .build();
        -   *   while (true) {
        -   *     PagedExpandResponse response = echoClient.pagedExpandCallable().call(request);
        -   *     for (EchoResponse element : response.getResponsesList()) {
        -   *       // doThingsWith(element);
        -   *     }
        -   *     String nextPageToken = response.getNextPageToken();
        -   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
        -   *       request = request.toBuilder().setPageToken(nextPageToken).build();
        -   *     } else {
        -   *       break;
        -   *     }
        -   *   }
        -   * }
        -   * }
        - */ - public final UnaryCallable pagedExpandCallable() { - return stub.pagedExpandCallable(); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * This is similar to the PagedExpand except that it uses max_results instead of page_size, as - * some legacy APIs still do. New APIs should NOT use this pattern. - * - *

        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 (EchoClient echoClient = EchoClient.create()) {
        -   *   PagedExpandLegacyRequest request =
        -   *       PagedExpandLegacyRequest.newBuilder()
        -   *           .setContent("content951530617")
        -   *           .setMaxResults(1128457243)
        -   *           .setPageToken("pageToken873572522")
        -   *           .build();
        -   *   PagedExpandResponse response = echoClient.pagedExpandLegacy(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 PagedExpandResponse pagedExpandLegacy(PagedExpandLegacyRequest request) { - return pagedExpandLegacyCallable().call(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * This is similar to the PagedExpand except that it uses max_results instead of page_size, as - * some legacy APIs still do. New APIs should NOT use this pattern. - * - *

        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 (EchoClient echoClient = EchoClient.create()) {
        -   *   PagedExpandLegacyRequest request =
        -   *       PagedExpandLegacyRequest.newBuilder()
        -   *           .setContent("content951530617")
        -   *           .setMaxResults(1128457243)
        -   *           .setPageToken("pageToken873572522")
        -   *           .build();
        -   *   ApiFuture future =
        -   *       echoClient.pagedExpandLegacyCallable().futureCall(request);
        -   *   // Do something.
        -   *   PagedExpandResponse response = future.get();
        -   * }
        -   * }
        - */ - public final UnaryCallable - pagedExpandLegacyCallable() { - return stub.pagedExpandLegacyCallable(); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * This method returns a map containing lists of words that appear in the input, keyed by their - * initial character. The only words returned are the ones included in the current page, as - * determined by page_token and page_size, which both refer to the word indices in the input. This - * paging result consisting of a map of lists is a pattern used by some legacy APIs. New APIs - * should NOT use this pattern. - * - *

        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 (EchoClient echoClient = EchoClient.create()) {
        -   *   PagedExpandRequest request =
        -   *       PagedExpandRequest.newBuilder()
        -   *           .setContent("content951530617")
        -   *           .setPageSize(883849137)
        -   *           .setPageToken("pageToken873572522")
        -   *           .build();
        -   *   for (Map.Entry element :
        -   *       echoClient.pagedExpandLegacyMapped(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 PagedExpandLegacyMappedPagedResponse pagedExpandLegacyMapped( - PagedExpandRequest request) { - return pagedExpandLegacyMappedPagedCallable().call(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * This method returns a map containing lists of words that appear in the input, keyed by their - * initial character. The only words returned are the ones included in the current page, as - * determined by page_token and page_size, which both refer to the word indices in the input. This - * paging result consisting of a map of lists is a pattern used by some legacy APIs. New APIs - * should NOT use this pattern. - * - *

        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 (EchoClient echoClient = EchoClient.create()) {
        -   *   PagedExpandRequest request =
        -   *       PagedExpandRequest.newBuilder()
        -   *           .setContent("content951530617")
        -   *           .setPageSize(883849137)
        -   *           .setPageToken("pageToken873572522")
        -   *           .build();
        -   *   ApiFuture> future =
        -   *       echoClient.pagedExpandLegacyMappedPagedCallable().futureCall(request);
        -   *   // Do something.
        -   *   for (Map.Entry element : future.get().iterateAll()) {
        -   *     // doThingsWith(element);
        -   *   }
        -   * }
        -   * }
        - */ - public final UnaryCallable - pagedExpandLegacyMappedPagedCallable() { - return stub.pagedExpandLegacyMappedPagedCallable(); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * This method returns a map containing lists of words that appear in the input, keyed by their - * initial character. The only words returned are the ones included in the current page, as - * determined by page_token and page_size, which both refer to the word indices in the input. This - * paging result consisting of a map of lists is a pattern used by some legacy APIs. New APIs - * should NOT use this pattern. - * - *

        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 (EchoClient echoClient = EchoClient.create()) {
        -   *   PagedExpandRequest request =
        -   *       PagedExpandRequest.newBuilder()
        -   *           .setContent("content951530617")
        -   *           .setPageSize(883849137)
        -   *           .setPageToken("pageToken873572522")
        -   *           .build();
        -   *   while (true) {
        -   *     PagedExpandLegacyMappedResponse response =
        -   *         echoClient.pagedExpandLegacyMappedCallable().call(request);
        -   *     for (Map.Entry element : response.getAlphabetizedList()) {
        -   *       // doThingsWith(element);
        -   *     }
        -   *     String nextPageToken = response.getNextPageToken();
        -   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
        -   *       request = request.toBuilder().setPageToken(nextPageToken).build();
        -   *     } else {
        -   *       break;
        -   *     }
        -   *   }
        -   * }
        -   * }
        - */ - public final UnaryCallable - pagedExpandLegacyMappedCallable() { - return stub.pagedExpandLegacyMappedCallable(); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * This method will wait for the requested amount of time and then return. This method showcases - * how a client handles a request timeout. - * - *

        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 (EchoClient echoClient = EchoClient.create()) {
        -   *   WaitRequest request = WaitRequest.newBuilder().build();
        -   *   WaitResponse response = echoClient.waitAsync(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 waitAsync(WaitRequest request) { - return waitOperationCallable().futureCall(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * This method will wait for the requested amount of time and then return. This method showcases - * how a client handles a request timeout. - * - *

        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 (EchoClient echoClient = EchoClient.create()) {
        -   *   WaitRequest request = WaitRequest.newBuilder().build();
        -   *   OperationFuture future =
        -   *       echoClient.waitOperationCallable().futureCall(request);
        -   *   // Do something.
        -   *   WaitResponse response = future.get();
        -   * }
        -   * }
        - */ - public final OperationCallable waitOperationCallable() { - return stub.waitOperationCallable(); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * This method will wait for the requested amount of time and then return. This method showcases - * how a client handles a request timeout. - * - *

        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 (EchoClient echoClient = EchoClient.create()) {
        -   *   WaitRequest request = WaitRequest.newBuilder().build();
        -   *   ApiFuture future = echoClient.waitCallable().futureCall(request);
        -   *   // Do something.
        -   *   Operation response = future.get();
        -   * }
        -   * }
        - */ - public final UnaryCallable waitCallable() { - return stub.waitCallable(); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * This method will block (wait) for the requested amount of time and then return the response or - * error. This method showcases how a client handles delays or retries. - * - *

        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 (EchoClient echoClient = EchoClient.create()) {
        -   *   BlockRequest request =
        -   *       BlockRequest.newBuilder().setResponseDelay(Duration.newBuilder().build()).build();
        -   *   BlockResponse response = echoClient.block(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 BlockResponse block(BlockRequest request) { - return blockCallable().call(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * This method will block (wait) for the requested amount of time and then return the response or - * error. This method showcases how a client handles delays or retries. - * - *

        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 (EchoClient echoClient = EchoClient.create()) {
        -   *   BlockRequest request =
        -   *       BlockRequest.newBuilder().setResponseDelay(Duration.newBuilder().build()).build();
        -   *   ApiFuture future = echoClient.blockCallable().futureCall(request);
        -   *   // Do something.
        -   *   BlockResponse response = future.get();
        -   * }
        -   * }
        - */ - public final UnaryCallable blockCallable() { - return stub.blockCallable(); - } - - @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 PagedExpandPagedResponse - extends AbstractPagedListResponse< - PagedExpandRequest, - PagedExpandResponse, - EchoResponse, - PagedExpandPage, - PagedExpandFixedSizeCollection> { - - public static ApiFuture createAsync( - PageContext context, - ApiFuture futureResponse) { - ApiFuture futurePage = - PagedExpandPage.createEmptyPage().createPageAsync(context, futureResponse); - return ApiFutures.transform( - futurePage, input -> new PagedExpandPagedResponse(input), MoreExecutors.directExecutor()); - } - - private PagedExpandPagedResponse(PagedExpandPage page) { - super(page, PagedExpandFixedSizeCollection.createEmptyCollection()); - } - } - - public static class PagedExpandPage - extends AbstractPage { - - private PagedExpandPage( - PageContext context, - PagedExpandResponse response) { - super(context, response); - } - - private static PagedExpandPage createEmptyPage() { - return new PagedExpandPage(null, null); - } - - @Override - protected PagedExpandPage createPage( - PageContext context, - PagedExpandResponse response) { - return new PagedExpandPage(context, response); - } - - @Override - public ApiFuture createPageAsync( - PageContext context, - ApiFuture futureResponse) { - return super.createPageAsync(context, futureResponse); - } - } - - public static class PagedExpandFixedSizeCollection - extends AbstractFixedSizeCollection< - PagedExpandRequest, - PagedExpandResponse, - EchoResponse, - PagedExpandPage, - PagedExpandFixedSizeCollection> { - - private PagedExpandFixedSizeCollection(List pages, int collectionSize) { - super(pages, collectionSize); - } - - private static PagedExpandFixedSizeCollection createEmptyCollection() { - return new PagedExpandFixedSizeCollection(null, 0); - } - - @Override - protected PagedExpandFixedSizeCollection createCollection( - List pages, int collectionSize) { - return new PagedExpandFixedSizeCollection(pages, collectionSize); - } - } - - public static class PagedExpandLegacyMappedPagedResponse - extends AbstractPagedListResponse< - PagedExpandRequest, - PagedExpandLegacyMappedResponse, - Map.Entry, - PagedExpandLegacyMappedPage, - PagedExpandLegacyMappedFixedSizeCollection> { - - public static ApiFuture createAsync( - PageContext< - PagedExpandRequest, - PagedExpandLegacyMappedResponse, - Map.Entry> - context, - ApiFuture futureResponse) { - ApiFuture futurePage = - PagedExpandLegacyMappedPage.createEmptyPage().createPageAsync(context, futureResponse); - return ApiFutures.transform( - futurePage, - input -> new PagedExpandLegacyMappedPagedResponse(input), - MoreExecutors.directExecutor()); - } - - private PagedExpandLegacyMappedPagedResponse(PagedExpandLegacyMappedPage page) { - super(page, PagedExpandLegacyMappedFixedSizeCollection.createEmptyCollection()); - } - } - - public static class PagedExpandLegacyMappedPage - extends AbstractPage< - PagedExpandRequest, - PagedExpandLegacyMappedResponse, - Map.Entry, - PagedExpandLegacyMappedPage> { - - private PagedExpandLegacyMappedPage( - PageContext< - PagedExpandRequest, - PagedExpandLegacyMappedResponse, - Map.Entry> - context, - PagedExpandLegacyMappedResponse response) { - super(context, response); - } - - private static PagedExpandLegacyMappedPage createEmptyPage() { - return new PagedExpandLegacyMappedPage(null, null); - } - - @Override - protected PagedExpandLegacyMappedPage createPage( - PageContext< - PagedExpandRequest, - PagedExpandLegacyMappedResponse, - Map.Entry> - context, - PagedExpandLegacyMappedResponse response) { - return new PagedExpandLegacyMappedPage(context, response); - } - - @Override - public ApiFuture createPageAsync( - PageContext< - PagedExpandRequest, - PagedExpandLegacyMappedResponse, - Map.Entry> - context, - ApiFuture futureResponse) { - return super.createPageAsync(context, futureResponse); - } - } - - public static class PagedExpandLegacyMappedFixedSizeCollection - extends AbstractFixedSizeCollection< - PagedExpandRequest, - PagedExpandLegacyMappedResponse, - Map.Entry, - PagedExpandLegacyMappedPage, - PagedExpandLegacyMappedFixedSizeCollection> { - - private PagedExpandLegacyMappedFixedSizeCollection( - List pages, int collectionSize) { - super(pages, collectionSize); - } - - private static PagedExpandLegacyMappedFixedSizeCollection createEmptyCollection() { - return new PagedExpandLegacyMappedFixedSizeCollection(null, 0); - } - - @Override - protected PagedExpandLegacyMappedFixedSizeCollection createCollection( - List pages, int collectionSize) { - return new PagedExpandLegacyMappedFixedSizeCollection(pages, collectionSize); - } - } -} diff --git a/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/EchoSettings.java b/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/EchoSettings.java deleted file mode 100644 index b8c1785ef0..0000000000 --- a/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/EchoSettings.java +++ /dev/null @@ -1,315 +0,0 @@ -/* - * 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 - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1; - -import static com.google.showcase.v1beta1.EchoClient.PagedExpandLegacyMappedPagedResponse; -import static com.google.showcase.v1beta1.EchoClient.PagedExpandPagedResponse; - -import com.google.api.core.ApiFunction; -import com.google.api.core.BetaApi; -import com.google.api.gax.core.GoogleCredentialsProvider; -import com.google.api.gax.core.InstantiatingExecutorProvider; -import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; -import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; -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.ServerStreamingCallSettings; -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.longrunning.Operation; -import com.google.showcase.v1beta1.stub.EchoStubSettings; -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 EchoClient}. - * - *

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

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

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

        For example, to set the total timeout of echo to 30 seconds: - * - *

        {@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
        - * EchoSettings.Builder echoSettingsBuilder = EchoSettings.newBuilder();
        - * echoSettingsBuilder
        - *     .echoSettings()
        - *     .setRetrySettings(
        - *         echoSettingsBuilder
        - *             .echoSettings()
        - *             .getRetrySettings()
        - *             .toBuilder()
        - *             .setTotalTimeout(Duration.ofSeconds(30))
        - *             .build());
        - * EchoSettings echoSettings = echoSettingsBuilder.build();
        - * }
        - */ -@BetaApi -@Generated("by gapic-generator-java") -public class EchoSettings extends ClientSettings { - - /** Returns the object with the settings used for calls to echo. */ - public UnaryCallSettings echoSettings() { - return ((EchoStubSettings) getStubSettings()).echoSettings(); - } - - /** Returns the object with the settings used for calls to expand. */ - public ServerStreamingCallSettings expandSettings() { - return ((EchoStubSettings) getStubSettings()).expandSettings(); - } - - /** Returns the object with the settings used for calls to collect. */ - public StreamingCallSettings collectSettings() { - return ((EchoStubSettings) getStubSettings()).collectSettings(); - } - - /** Returns the object with the settings used for calls to chat. */ - public StreamingCallSettings chatSettings() { - return ((EchoStubSettings) getStubSettings()).chatSettings(); - } - - /** Returns the object with the settings used for calls to pagedExpand. */ - public PagedCallSettings - pagedExpandSettings() { - return ((EchoStubSettings) getStubSettings()).pagedExpandSettings(); - } - - /** Returns the object with the settings used for calls to pagedExpandLegacy. */ - public UnaryCallSettings - pagedExpandLegacySettings() { - return ((EchoStubSettings) getStubSettings()).pagedExpandLegacySettings(); - } - - /** Returns the object with the settings used for calls to pagedExpandLegacyMapped. */ - public PagedCallSettings< - PagedExpandRequest, PagedExpandLegacyMappedResponse, PagedExpandLegacyMappedPagedResponse> - pagedExpandLegacyMappedSettings() { - return ((EchoStubSettings) getStubSettings()).pagedExpandLegacyMappedSettings(); - } - - /** Returns the object with the settings used for calls to wait. */ - public UnaryCallSettings waitSettings() { - return ((EchoStubSettings) getStubSettings()).waitSettings(); - } - - /** Returns the object with the settings used for calls to wait. */ - public OperationCallSettings waitOperationSettings() { - return ((EchoStubSettings) getStubSettings()).waitOperationSettings(); - } - - /** Returns the object with the settings used for calls to block. */ - public UnaryCallSettings blockSettings() { - return ((EchoStubSettings) getStubSettings()).blockSettings(); - } - - public static final EchoSettings create(EchoStubSettings stub) throws IOException { - return new EchoSettings.Builder(stub.toBuilder()).build(); - } - - /** Returns a builder for the default ExecutorProvider for this service. */ - public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { - return EchoStubSettings.defaultExecutorProviderBuilder(); - } - - /** Returns the default service endpoint. */ - public static String getDefaultEndpoint() { - return EchoStubSettings.getDefaultEndpoint(); - } - - /** Returns the default service scopes. */ - public static List getDefaultServiceScopes() { - return EchoStubSettings.getDefaultServiceScopes(); - } - - /** Returns a builder for the default credentials for this service. */ - public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { - return EchoStubSettings.defaultCredentialsProviderBuilder(); - } - - /** Returns a builder for the default gRPC ChannelProvider for this service. */ - public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { - return EchoStubSettings.defaultGrpcTransportProviderBuilder(); - } - - /** Returns a builder for the default REST ChannelProvider for this service. */ - @BetaApi - public static InstantiatingHttpJsonChannelProvider.Builder - defaultHttpJsonTransportProviderBuilder() { - return EchoStubSettings.defaultHttpJsonTransportProviderBuilder(); - } - - public static TransportChannelProvider defaultTransportChannelProvider() { - return EchoStubSettings.defaultTransportChannelProvider(); - } - - @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") - public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { - return EchoStubSettings.defaultApiClientHeaderProviderBuilder(); - } - - /** Returns a new gRPC builder for this class. */ - public static Builder newBuilder() { - return Builder.createDefault(); - } - - /** Returns a new REST builder for this class. */ - @BetaApi - public static Builder newHttpJsonBuilder() { - return Builder.createHttpJsonDefault(); - } - - /** 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 EchoSettings(Builder settingsBuilder) throws IOException { - super(settingsBuilder); - } - - /** Builder for EchoSettings. */ - public static class Builder extends ClientSettings.Builder { - - protected Builder() throws IOException { - this(((ClientContext) null)); - } - - protected Builder(ClientContext clientContext) { - super(EchoStubSettings.newBuilder(clientContext)); - } - - protected Builder(EchoSettings settings) { - super(settings.getStubSettings().toBuilder()); - } - - protected Builder(EchoStubSettings.Builder stubSettings) { - super(stubSettings); - } - - private static Builder createDefault() { - return new Builder(EchoStubSettings.newBuilder()); - } - - @BetaApi - private static Builder createHttpJsonDefault() { - return new Builder(EchoStubSettings.newHttpJsonBuilder()); - } - - public EchoStubSettings.Builder getStubSettingsBuilder() { - return ((EchoStubSettings.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 echo. */ - public UnaryCallSettings.Builder echoSettings() { - return getStubSettingsBuilder().echoSettings(); - } - - /** Returns the builder for the settings used for calls to expand. */ - public ServerStreamingCallSettings.Builder expandSettings() { - return getStubSettingsBuilder().expandSettings(); - } - - /** Returns the builder for the settings used for calls to collect. */ - public StreamingCallSettings.Builder collectSettings() { - return getStubSettingsBuilder().collectSettings(); - } - - /** Returns the builder for the settings used for calls to chat. */ - public StreamingCallSettings.Builder chatSettings() { - return getStubSettingsBuilder().chatSettings(); - } - - /** Returns the builder for the settings used for calls to pagedExpand. */ - public PagedCallSettings.Builder< - PagedExpandRequest, PagedExpandResponse, PagedExpandPagedResponse> - pagedExpandSettings() { - return getStubSettingsBuilder().pagedExpandSettings(); - } - - /** Returns the builder for the settings used for calls to pagedExpandLegacy. */ - public UnaryCallSettings.Builder - pagedExpandLegacySettings() { - return getStubSettingsBuilder().pagedExpandLegacySettings(); - } - - /** Returns the builder for the settings used for calls to pagedExpandLegacyMapped. */ - public PagedCallSettings.Builder< - PagedExpandRequest, - PagedExpandLegacyMappedResponse, - PagedExpandLegacyMappedPagedResponse> - pagedExpandLegacyMappedSettings() { - return getStubSettingsBuilder().pagedExpandLegacyMappedSettings(); - } - - /** Returns the builder for the settings used for calls to wait. */ - public UnaryCallSettings.Builder waitSettings() { - return getStubSettingsBuilder().waitSettings(); - } - - /** Returns the builder for the settings used for calls to wait. */ - public OperationCallSettings.Builder - waitOperationSettings() { - return getStubSettingsBuilder().waitOperationSettings(); - } - - /** Returns the builder for the settings used for calls to block. */ - public UnaryCallSettings.Builder blockSettings() { - return getStubSettingsBuilder().blockSettings(); - } - - @Override - public EchoSettings build() throws IOException { - return new EchoSettings(this); - } - } -} diff --git a/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/IdentityClient.java b/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/IdentityClient.java deleted file mode 100644 index b50159d6fc..0000000000 --- a/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/IdentityClient.java +++ /dev/null @@ -1,774 +0,0 @@ -/* - * 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 - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1; - -import com.google.api.core.ApiFuture; -import com.google.api.core.ApiFutures; -import com.google.api.core.BetaApi; -import com.google.api.gax.core.BackgroundResource; -import com.google.api.gax.paging.AbstractFixedSizeCollection; -import com.google.api.gax.paging.AbstractPage; -import com.google.api.gax.paging.AbstractPagedListResponse; -import com.google.api.gax.rpc.PageContext; -import com.google.api.gax.rpc.UnaryCallable; -import com.google.common.util.concurrent.MoreExecutors; -import com.google.protobuf.Empty; -import com.google.showcase.v1beta1.stub.IdentityStub; -import com.google.showcase.v1beta1.stub.IdentityStubSettings; -import java.io.IOException; -import java.util.List; -import java.util.concurrent.TimeUnit; -import javax.annotation.Generated; - -// AUTO-GENERATED DOCUMENTATION AND CLASS. -/** - * Service Description: A simple identity service. - * - *

        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 (IdentityClient identityClient = IdentityClient.create()) {
        - *   String displayName = "displayName1714148973";
        - *   String email = "email96619420";
        - *   User response = identityClient.createUser(displayName, email);
        - * }
        - * }
        - * - *

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

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

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

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

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

        This class can be customized by passing in a custom instance of IdentitySettings 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
        - * IdentitySettings identitySettings =
        - *     IdentitySettings.newBuilder()
        - *         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
        - *         .build();
        - * IdentityClient identityClient = IdentityClient.create(identitySettings);
        - * }
        - * - *

        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
        - * IdentitySettings identitySettings =
        - *     IdentitySettings.newBuilder().setEndpoint(myEndpoint).build();
        - * IdentityClient identityClient = IdentityClient.create(identitySettings);
        - * }
        - * - *

        To use REST (HTTP1.1/JSON) transport (instead of gRPC) for sending and receiving requests over - * the wire: - * - *

        {@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
        - * IdentitySettings identitySettings = IdentitySettings.newHttpJsonBuilder().build();
        - * IdentityClient identityClient = IdentityClient.create(identitySettings);
        - * }
        - * - *

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

        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 (IdentityClient identityClient = IdentityClient.create()) {
        -   *   String displayName = "displayName1714148973";
        -   *   String email = "email96619420";
        -   *   User response = identityClient.createUser(displayName, email);
        -   * }
        -   * }
        - * - * @param displayName The display_name of the user. - * @param email The email address of the user. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final User createUser(String displayName, String email) { - CreateUserRequest request = - CreateUserRequest.newBuilder() - .setUser(User.newBuilder().setDisplayName(displayName).setEmail(email).build()) - .build(); - return createUser(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Creates a user. - * - *

        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 (IdentityClient identityClient = IdentityClient.create()) {
        -   *   String displayName = "displayName1714148973";
        -   *   String email = "email96619420";
        -   *   int age = 96511;
        -   *   String nickname = "nickname70690926";
        -   *   boolean enableNotifications = true;
        -   *   double heightFeet = -1032737338;
        -   *   User response =
        -   *       identityClient.createUser(
        -   *           displayName, email, age, nickname, enableNotifications, heightFeet);
        -   * }
        -   * }
        - * - * @param displayName The display_name of the user. - * @param email The email address of the user. - * @param age The age of the user in years. - * @param nickname The nickname of the user. - *

        (-- aip.dev/not-precedent: An empty string is a valid nickname. Ordinarily, - * proto3_optional should not be used on a `string` field. --) - * @param enableNotifications Enables the receiving of notifications. The default is true if - * unset. - *

        (-- aip.dev/not-precedent: The default for the feature is true. Ordinarily, the default - * for a `bool` field should be false. --) - * @param heightFeet The height of the user in feet. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final User createUser( - String displayName, - String email, - int age, - String nickname, - boolean enableNotifications, - double heightFeet) { - CreateUserRequest request = - CreateUserRequest.newBuilder() - .setUser( - User.newBuilder() - .setDisplayName(displayName) - .setEmail(email) - .setAge(age) - .setNickname(nickname) - .setEnableNotifications(enableNotifications) - .setHeightFeet(heightFeet) - .build()) - .build(); - return createUser(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Creates a user. - * - *

        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 (IdentityClient identityClient = IdentityClient.create()) {
        -   *   CreateUserRequest request =
        -   *       CreateUserRequest.newBuilder().setUser(User.newBuilder().build()).build();
        -   *   User response = identityClient.createUser(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 User createUser(CreateUserRequest request) { - return createUserCallable().call(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Creates a user. - * - *

        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 (IdentityClient identityClient = IdentityClient.create()) {
        -   *   CreateUserRequest request =
        -   *       CreateUserRequest.newBuilder().setUser(User.newBuilder().build()).build();
        -   *   ApiFuture future = identityClient.createUserCallable().futureCall(request);
        -   *   // Do something.
        -   *   User response = future.get();
        -   * }
        -   * }
        - */ - public final UnaryCallable createUserCallable() { - return stub.createUserCallable(); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Retrieves the User with the given uri. - * - *

        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 (IdentityClient identityClient = IdentityClient.create()) {
        -   *   UserName name = UserName.of("[USER]");
        -   *   User response = identityClient.getUser(name);
        -   * }
        -   * }
        - * - * @param name The resource name of the requested user. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final User getUser(UserName name) { - GetUserRequest request = - GetUserRequest.newBuilder().setName(name == null ? null : name.toString()).build(); - return getUser(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Retrieves the User with the given uri. - * - *

        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 (IdentityClient identityClient = IdentityClient.create()) {
        -   *   String name = UserName.of("[USER]").toString();
        -   *   User response = identityClient.getUser(name);
        -   * }
        -   * }
        - * - * @param name The resource name of the requested user. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final User getUser(String name) { - GetUserRequest request = GetUserRequest.newBuilder().setName(name).build(); - return getUser(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Retrieves the User with the given uri. - * - *

        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 (IdentityClient identityClient = IdentityClient.create()) {
        -   *   GetUserRequest request =
        -   *       GetUserRequest.newBuilder().setName(UserName.of("[USER]").toString()).build();
        -   *   User response = identityClient.getUser(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 User getUser(GetUserRequest request) { - return getUserCallable().call(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Retrieves the User with the given uri. - * - *

        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 (IdentityClient identityClient = IdentityClient.create()) {
        -   *   GetUserRequest request =
        -   *       GetUserRequest.newBuilder().setName(UserName.of("[USER]").toString()).build();
        -   *   ApiFuture future = identityClient.getUserCallable().futureCall(request);
        -   *   // Do something.
        -   *   User response = future.get();
        -   * }
        -   * }
        - */ - public final UnaryCallable getUserCallable() { - return stub.getUserCallable(); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Updates a user. - * - *

        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 (IdentityClient identityClient = IdentityClient.create()) {
        -   *   UpdateUserRequest request =
        -   *       UpdateUserRequest.newBuilder()
        -   *           .setUser(User.newBuilder().build())
        -   *           .setUpdateMask(FieldMask.newBuilder().build())
        -   *           .build();
        -   *   User response = identityClient.updateUser(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 User updateUser(UpdateUserRequest request) { - return updateUserCallable().call(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Updates a user. - * - *

        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 (IdentityClient identityClient = IdentityClient.create()) {
        -   *   UpdateUserRequest request =
        -   *       UpdateUserRequest.newBuilder()
        -   *           .setUser(User.newBuilder().build())
        -   *           .setUpdateMask(FieldMask.newBuilder().build())
        -   *           .build();
        -   *   ApiFuture future = identityClient.updateUserCallable().futureCall(request);
        -   *   // Do something.
        -   *   User response = future.get();
        -   * }
        -   * }
        - */ - public final UnaryCallable updateUserCallable() { - return stub.updateUserCallable(); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Deletes a user, their profile, and all of their authored messages. - * - *

        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 (IdentityClient identityClient = IdentityClient.create()) {
        -   *   UserName name = UserName.of("[USER]");
        -   *   identityClient.deleteUser(name);
        -   * }
        -   * }
        - * - * @param name The resource name of the user to delete. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final void deleteUser(UserName name) { - DeleteUserRequest request = - DeleteUserRequest.newBuilder().setName(name == null ? null : name.toString()).build(); - deleteUser(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Deletes a user, their profile, and all of their authored messages. - * - *

        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 (IdentityClient identityClient = IdentityClient.create()) {
        -   *   String name = UserName.of("[USER]").toString();
        -   *   identityClient.deleteUser(name);
        -   * }
        -   * }
        - * - * @param name The resource name of the user to delete. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final void deleteUser(String name) { - DeleteUserRequest request = DeleteUserRequest.newBuilder().setName(name).build(); - deleteUser(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Deletes a user, their profile, and all of their authored messages. - * - *

        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 (IdentityClient identityClient = IdentityClient.create()) {
        -   *   DeleteUserRequest request =
        -   *       DeleteUserRequest.newBuilder().setName(UserName.of("[USER]").toString()).build();
        -   *   identityClient.deleteUser(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 deleteUser(DeleteUserRequest request) { - deleteUserCallable().call(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Deletes a user, their profile, and all of their authored messages. - * - *

        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 (IdentityClient identityClient = IdentityClient.create()) {
        -   *   DeleteUserRequest request =
        -   *       DeleteUserRequest.newBuilder().setName(UserName.of("[USER]").toString()).build();
        -   *   ApiFuture future = identityClient.deleteUserCallable().futureCall(request);
        -   *   // Do something.
        -   *   future.get();
        -   * }
        -   * }
        - */ - public final UnaryCallable deleteUserCallable() { - return stub.deleteUserCallable(); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Lists all users. - * - *

        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 (IdentityClient identityClient = IdentityClient.create()) {
        -   *   ListUsersRequest request =
        -   *       ListUsersRequest.newBuilder()
        -   *           .setPageSize(883849137)
        -   *           .setPageToken("pageToken873572522")
        -   *           .build();
        -   *   for (User element : identityClient.listUsers(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 ListUsersPagedResponse listUsers(ListUsersRequest request) { - return listUsersPagedCallable().call(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Lists all users. - * - *

        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 (IdentityClient identityClient = IdentityClient.create()) {
        -   *   ListUsersRequest request =
        -   *       ListUsersRequest.newBuilder()
        -   *           .setPageSize(883849137)
        -   *           .setPageToken("pageToken873572522")
        -   *           .build();
        -   *   ApiFuture future = identityClient.listUsersPagedCallable().futureCall(request);
        -   *   // Do something.
        -   *   for (User element : future.get().iterateAll()) {
        -   *     // doThingsWith(element);
        -   *   }
        -   * }
        -   * }
        - */ - public final UnaryCallable listUsersPagedCallable() { - return stub.listUsersPagedCallable(); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Lists all users. - * - *

        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 (IdentityClient identityClient = IdentityClient.create()) {
        -   *   ListUsersRequest request =
        -   *       ListUsersRequest.newBuilder()
        -   *           .setPageSize(883849137)
        -   *           .setPageToken("pageToken873572522")
        -   *           .build();
        -   *   while (true) {
        -   *     ListUsersResponse response = identityClient.listUsersCallable().call(request);
        -   *     for (User element : response.getUsersList()) {
        -   *       // doThingsWith(element);
        -   *     }
        -   *     String nextPageToken = response.getNextPageToken();
        -   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
        -   *       request = request.toBuilder().setPageToken(nextPageToken).build();
        -   *     } else {
        -   *       break;
        -   *     }
        -   *   }
        -   * }
        -   * }
        - */ - public final UnaryCallable listUsersCallable() { - return stub.listUsersCallable(); - } - - @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 ListUsersPagedResponse - extends AbstractPagedListResponse< - ListUsersRequest, ListUsersResponse, User, ListUsersPage, ListUsersFixedSizeCollection> { - - public static ApiFuture createAsync( - PageContext context, - ApiFuture futureResponse) { - ApiFuture futurePage = - ListUsersPage.createEmptyPage().createPageAsync(context, futureResponse); - return ApiFutures.transform( - futurePage, input -> new ListUsersPagedResponse(input), MoreExecutors.directExecutor()); - } - - private ListUsersPagedResponse(ListUsersPage page) { - super(page, ListUsersFixedSizeCollection.createEmptyCollection()); - } - } - - public static class ListUsersPage - extends AbstractPage { - - private ListUsersPage( - PageContext context, - ListUsersResponse response) { - super(context, response); - } - - private static ListUsersPage createEmptyPage() { - return new ListUsersPage(null, null); - } - - @Override - protected ListUsersPage createPage( - PageContext context, - ListUsersResponse response) { - return new ListUsersPage(context, response); - } - - @Override - public ApiFuture createPageAsync( - PageContext context, - ApiFuture futureResponse) { - return super.createPageAsync(context, futureResponse); - } - } - - public static class ListUsersFixedSizeCollection - extends AbstractFixedSizeCollection< - ListUsersRequest, ListUsersResponse, User, ListUsersPage, ListUsersFixedSizeCollection> { - - private ListUsersFixedSizeCollection(List pages, int collectionSize) { - super(pages, collectionSize); - } - - private static ListUsersFixedSizeCollection createEmptyCollection() { - return new ListUsersFixedSizeCollection(null, 0); - } - - @Override - protected ListUsersFixedSizeCollection createCollection( - List pages, int collectionSize) { - return new ListUsersFixedSizeCollection(pages, collectionSize); - } - } -} diff --git a/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/IdentitySettings.java b/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/IdentitySettings.java deleted file mode 100644 index f4db5be8a8..0000000000 --- a/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/IdentitySettings.java +++ /dev/null @@ -1,251 +0,0 @@ -/* - * 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 - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1; - -import static com.google.showcase.v1beta1.IdentityClient.ListUsersPagedResponse; - -import com.google.api.core.ApiFunction; -import com.google.api.core.BetaApi; -import com.google.api.gax.core.GoogleCredentialsProvider; -import com.google.api.gax.core.InstantiatingExecutorProvider; -import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; -import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; -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.StubSettings; -import com.google.api.gax.rpc.TransportChannelProvider; -import com.google.api.gax.rpc.UnaryCallSettings; -import com.google.protobuf.Empty; -import com.google.showcase.v1beta1.stub.IdentityStubSettings; -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 IdentityClient}. - * - *

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

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

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

        For example, to set the total timeout of createUser to 30 seconds: - * - *

        {@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
        - * IdentitySettings.Builder identitySettingsBuilder = IdentitySettings.newBuilder();
        - * identitySettingsBuilder
        - *     .createUserSettings()
        - *     .setRetrySettings(
        - *         identitySettingsBuilder
        - *             .createUserSettings()
        - *             .getRetrySettings()
        - *             .toBuilder()
        - *             .setTotalTimeout(Duration.ofSeconds(30))
        - *             .build());
        - * IdentitySettings identitySettings = identitySettingsBuilder.build();
        - * }
        - */ -@BetaApi -@Generated("by gapic-generator-java") -public class IdentitySettings extends ClientSettings { - - /** Returns the object with the settings used for calls to createUser. */ - public UnaryCallSettings createUserSettings() { - return ((IdentityStubSettings) getStubSettings()).createUserSettings(); - } - - /** Returns the object with the settings used for calls to getUser. */ - public UnaryCallSettings getUserSettings() { - return ((IdentityStubSettings) getStubSettings()).getUserSettings(); - } - - /** Returns the object with the settings used for calls to updateUser. */ - public UnaryCallSettings updateUserSettings() { - return ((IdentityStubSettings) getStubSettings()).updateUserSettings(); - } - - /** Returns the object with the settings used for calls to deleteUser. */ - public UnaryCallSettings deleteUserSettings() { - return ((IdentityStubSettings) getStubSettings()).deleteUserSettings(); - } - - /** Returns the object with the settings used for calls to listUsers. */ - public PagedCallSettings - listUsersSettings() { - return ((IdentityStubSettings) getStubSettings()).listUsersSettings(); - } - - public static final IdentitySettings create(IdentityStubSettings stub) throws IOException { - return new IdentitySettings.Builder(stub.toBuilder()).build(); - } - - /** Returns a builder for the default ExecutorProvider for this service. */ - public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { - return IdentityStubSettings.defaultExecutorProviderBuilder(); - } - - /** Returns the default service endpoint. */ - public static String getDefaultEndpoint() { - return IdentityStubSettings.getDefaultEndpoint(); - } - - /** Returns the default service scopes. */ - public static List getDefaultServiceScopes() { - return IdentityStubSettings.getDefaultServiceScopes(); - } - - /** Returns a builder for the default credentials for this service. */ - public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { - return IdentityStubSettings.defaultCredentialsProviderBuilder(); - } - - /** Returns a builder for the default gRPC ChannelProvider for this service. */ - public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { - return IdentityStubSettings.defaultGrpcTransportProviderBuilder(); - } - - /** Returns a builder for the default REST ChannelProvider for this service. */ - @BetaApi - public static InstantiatingHttpJsonChannelProvider.Builder - defaultHttpJsonTransportProviderBuilder() { - return IdentityStubSettings.defaultHttpJsonTransportProviderBuilder(); - } - - public static TransportChannelProvider defaultTransportChannelProvider() { - return IdentityStubSettings.defaultTransportChannelProvider(); - } - - @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") - public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { - return IdentityStubSettings.defaultApiClientHeaderProviderBuilder(); - } - - /** Returns a new gRPC builder for this class. */ - public static Builder newBuilder() { - return Builder.createDefault(); - } - - /** Returns a new REST builder for this class. */ - @BetaApi - public static Builder newHttpJsonBuilder() { - return Builder.createHttpJsonDefault(); - } - - /** 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 IdentitySettings(Builder settingsBuilder) throws IOException { - super(settingsBuilder); - } - - /** Builder for IdentitySettings. */ - public static class Builder extends ClientSettings.Builder { - - protected Builder() throws IOException { - this(((ClientContext) null)); - } - - protected Builder(ClientContext clientContext) { - super(IdentityStubSettings.newBuilder(clientContext)); - } - - protected Builder(IdentitySettings settings) { - super(settings.getStubSettings().toBuilder()); - } - - protected Builder(IdentityStubSettings.Builder stubSettings) { - super(stubSettings); - } - - private static Builder createDefault() { - return new Builder(IdentityStubSettings.newBuilder()); - } - - @BetaApi - private static Builder createHttpJsonDefault() { - return new Builder(IdentityStubSettings.newHttpJsonBuilder()); - } - - public IdentityStubSettings.Builder getStubSettingsBuilder() { - return ((IdentityStubSettings.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 createUser. */ - public UnaryCallSettings.Builder createUserSettings() { - return getStubSettingsBuilder().createUserSettings(); - } - - /** Returns the builder for the settings used for calls to getUser. */ - public UnaryCallSettings.Builder getUserSettings() { - return getStubSettingsBuilder().getUserSettings(); - } - - /** Returns the builder for the settings used for calls to updateUser. */ - public UnaryCallSettings.Builder updateUserSettings() { - return getStubSettingsBuilder().updateUserSettings(); - } - - /** Returns the builder for the settings used for calls to deleteUser. */ - public UnaryCallSettings.Builder deleteUserSettings() { - return getStubSettingsBuilder().deleteUserSettings(); - } - - /** Returns the builder for the settings used for calls to listUsers. */ - public PagedCallSettings.Builder - listUsersSettings() { - return getStubSettingsBuilder().listUsersSettings(); - } - - @Override - public IdentitySettings build() throws IOException { - return new IdentitySettings(this); - } - } -} diff --git a/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/MessagingClient.java b/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/MessagingClient.java deleted file mode 100644 index e19a62a25b..0000000000 --- a/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/MessagingClient.java +++ /dev/null @@ -1,2117 +0,0 @@ -/* - * 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 - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1; - -import com.google.api.core.ApiFuture; -import com.google.api.core.ApiFutures; -import com.google.api.core.BetaApi; -import com.google.api.gax.core.BackgroundResource; -import com.google.api.gax.httpjson.longrunning.OperationsClient; -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.BidiStreamingCallable; -import com.google.api.gax.rpc.ClientStreamingCallable; -import com.google.api.gax.rpc.OperationCallable; -import com.google.api.gax.rpc.PageContext; -import com.google.api.gax.rpc.ServerStreamingCallable; -import com.google.api.gax.rpc.UnaryCallable; -import com.google.common.util.concurrent.MoreExecutors; -import com.google.longrunning.Operation; -import com.google.protobuf.ByteString; -import com.google.protobuf.Empty; -import com.google.showcase.v1beta1.stub.MessagingStub; -import com.google.showcase.v1beta1.stub.MessagingStubSettings; -import java.io.IOException; -import java.util.List; -import java.util.concurrent.TimeUnit; -import javax.annotation.Generated; - -// AUTO-GENERATED DOCUMENTATION AND CLASS. -/** - * Service Description: A simple messaging service that implements chat rooms and profile posts. - * - *

        This messaging service showcases the features that API clients generated by gapic-generators - * implement. - * - *

        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 (MessagingClient messagingClient = MessagingClient.create()) {
        - *   String displayName = "displayName1714148973";
        - *   String description = "description-1724546052";
        - *   Room response = messagingClient.createRoom(displayName, description);
        - * }
        - * }
        - * - *

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

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

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

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

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

        This class can be customized by passing in a custom instance of MessagingSettings 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
        - * MessagingSettings messagingSettings =
        - *     MessagingSettings.newBuilder()
        - *         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
        - *         .build();
        - * MessagingClient messagingClient = MessagingClient.create(messagingSettings);
        - * }
        - * - *

        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
        - * MessagingSettings messagingSettings =
        - *     MessagingSettings.newBuilder().setEndpoint(myEndpoint).build();
        - * MessagingClient messagingClient = MessagingClient.create(messagingSettings);
        - * }
        - * - *

        To use REST (HTTP1.1/JSON) transport (instead of gRPC) for sending and receiving requests over - * the wire: - * - *

        {@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
        - * MessagingSettings messagingSettings = MessagingSettings.newHttpJsonBuilder().build();
        - * MessagingClient messagingClient = MessagingClient.create(messagingSettings);
        - * }
        - * - *

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

        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 (MessagingClient messagingClient = MessagingClient.create()) {
        -   *   String displayName = "displayName1714148973";
        -   *   String description = "description-1724546052";
        -   *   Room response = messagingClient.createRoom(displayName, description);
        -   * }
        -   * }
        - * - * @param displayName The human readable name of the chat room. - * @param description The description of the chat room. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final Room createRoom(String displayName, String description) { - CreateRoomRequest request = - CreateRoomRequest.newBuilder() - .setRoom( - Room.newBuilder().setDisplayName(displayName).setDescription(description).build()) - .build(); - return createRoom(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Creates a room. - * - *

        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 (MessagingClient messagingClient = MessagingClient.create()) {
        -   *   CreateRoomRequest request =
        -   *       CreateRoomRequest.newBuilder().setRoom(Room.newBuilder().build()).build();
        -   *   Room response = messagingClient.createRoom(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 Room createRoom(CreateRoomRequest request) { - return createRoomCallable().call(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Creates a room. - * - *

        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 (MessagingClient messagingClient = MessagingClient.create()) {
        -   *   CreateRoomRequest request =
        -   *       CreateRoomRequest.newBuilder().setRoom(Room.newBuilder().build()).build();
        -   *   ApiFuture future = messagingClient.createRoomCallable().futureCall(request);
        -   *   // Do something.
        -   *   Room response = future.get();
        -   * }
        -   * }
        - */ - public final UnaryCallable createRoomCallable() { - return stub.createRoomCallable(); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Retrieves the Room with the given resource name. - * - *

        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 (MessagingClient messagingClient = MessagingClient.create()) {
        -   *   RoomName name = RoomName.of("[ROOM]");
        -   *   Room response = messagingClient.getRoom(name);
        -   * }
        -   * }
        - * - * @param name The resource name of the requested room. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final Room getRoom(RoomName name) { - GetRoomRequest request = - GetRoomRequest.newBuilder().setName(name == null ? null : name.toString()).build(); - return getRoom(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Retrieves the Room with the given resource name. - * - *

        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 (MessagingClient messagingClient = MessagingClient.create()) {
        -   *   String name = RoomName.of("[ROOM]").toString();
        -   *   Room response = messagingClient.getRoom(name);
        -   * }
        -   * }
        - * - * @param name The resource name of the requested room. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final Room getRoom(String name) { - GetRoomRequest request = GetRoomRequest.newBuilder().setName(name).build(); - return getRoom(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Retrieves the Room with the given resource name. - * - *

        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 (MessagingClient messagingClient = MessagingClient.create()) {
        -   *   GetRoomRequest request =
        -   *       GetRoomRequest.newBuilder().setName(RoomName.of("[ROOM]").toString()).build();
        -   *   Room response = messagingClient.getRoom(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 Room getRoom(GetRoomRequest request) { - return getRoomCallable().call(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Retrieves the Room with the given resource name. - * - *

        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 (MessagingClient messagingClient = MessagingClient.create()) {
        -   *   GetRoomRequest request =
        -   *       GetRoomRequest.newBuilder().setName(RoomName.of("[ROOM]").toString()).build();
        -   *   ApiFuture future = messagingClient.getRoomCallable().futureCall(request);
        -   *   // Do something.
        -   *   Room response = future.get();
        -   * }
        -   * }
        - */ - public final UnaryCallable getRoomCallable() { - return stub.getRoomCallable(); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Updates a room. - * - *

        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 (MessagingClient messagingClient = MessagingClient.create()) {
        -   *   UpdateRoomRequest request =
        -   *       UpdateRoomRequest.newBuilder()
        -   *           .setRoom(Room.newBuilder().build())
        -   *           .setUpdateMask(FieldMask.newBuilder().build())
        -   *           .build();
        -   *   Room response = messagingClient.updateRoom(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 Room updateRoom(UpdateRoomRequest request) { - return updateRoomCallable().call(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Updates a room. - * - *

        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 (MessagingClient messagingClient = MessagingClient.create()) {
        -   *   UpdateRoomRequest request =
        -   *       UpdateRoomRequest.newBuilder()
        -   *           .setRoom(Room.newBuilder().build())
        -   *           .setUpdateMask(FieldMask.newBuilder().build())
        -   *           .build();
        -   *   ApiFuture future = messagingClient.updateRoomCallable().futureCall(request);
        -   *   // Do something.
        -   *   Room response = future.get();
        -   * }
        -   * }
        - */ - public final UnaryCallable updateRoomCallable() { - return stub.updateRoomCallable(); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Deletes a room and all of its blurbs. - * - *

        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 (MessagingClient messagingClient = MessagingClient.create()) {
        -   *   RoomName name = RoomName.of("[ROOM]");
        -   *   messagingClient.deleteRoom(name);
        -   * }
        -   * }
        - * - * @param name The resource name of the requested room. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final void deleteRoom(RoomName name) { - DeleteRoomRequest request = - DeleteRoomRequest.newBuilder().setName(name == null ? null : name.toString()).build(); - deleteRoom(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Deletes a room and all of its blurbs. - * - *

        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 (MessagingClient messagingClient = MessagingClient.create()) {
        -   *   String name = RoomName.of("[ROOM]").toString();
        -   *   messagingClient.deleteRoom(name);
        -   * }
        -   * }
        - * - * @param name The resource name of the requested room. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final void deleteRoom(String name) { - DeleteRoomRequest request = DeleteRoomRequest.newBuilder().setName(name).build(); - deleteRoom(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Deletes a room and all of its blurbs. - * - *

        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 (MessagingClient messagingClient = MessagingClient.create()) {
        -   *   DeleteRoomRequest request =
        -   *       DeleteRoomRequest.newBuilder().setName(RoomName.of("[ROOM]").toString()).build();
        -   *   messagingClient.deleteRoom(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 deleteRoom(DeleteRoomRequest request) { - deleteRoomCallable().call(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Deletes a room and all of its blurbs. - * - *

        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 (MessagingClient messagingClient = MessagingClient.create()) {
        -   *   DeleteRoomRequest request =
        -   *       DeleteRoomRequest.newBuilder().setName(RoomName.of("[ROOM]").toString()).build();
        -   *   ApiFuture future = messagingClient.deleteRoomCallable().futureCall(request);
        -   *   // Do something.
        -   *   future.get();
        -   * }
        -   * }
        - */ - public final UnaryCallable deleteRoomCallable() { - return stub.deleteRoomCallable(); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Lists all chat rooms. - * - *

        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 (MessagingClient messagingClient = MessagingClient.create()) {
        -   *   ListRoomsRequest request =
        -   *       ListRoomsRequest.newBuilder()
        -   *           .setPageSize(883849137)
        -   *           .setPageToken("pageToken873572522")
        -   *           .build();
        -   *   for (Room element : messagingClient.listRooms(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 ListRoomsPagedResponse listRooms(ListRoomsRequest request) { - return listRoomsPagedCallable().call(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Lists all chat rooms. - * - *

        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 (MessagingClient messagingClient = MessagingClient.create()) {
        -   *   ListRoomsRequest request =
        -   *       ListRoomsRequest.newBuilder()
        -   *           .setPageSize(883849137)
        -   *           .setPageToken("pageToken873572522")
        -   *           .build();
        -   *   ApiFuture future = messagingClient.listRoomsPagedCallable().futureCall(request);
        -   *   // Do something.
        -   *   for (Room element : future.get().iterateAll()) {
        -   *     // doThingsWith(element);
        -   *   }
        -   * }
        -   * }
        - */ - public final UnaryCallable listRoomsPagedCallable() { - return stub.listRoomsPagedCallable(); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Lists all chat rooms. - * - *

        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 (MessagingClient messagingClient = MessagingClient.create()) {
        -   *   ListRoomsRequest request =
        -   *       ListRoomsRequest.newBuilder()
        -   *           .setPageSize(883849137)
        -   *           .setPageToken("pageToken873572522")
        -   *           .build();
        -   *   while (true) {
        -   *     ListRoomsResponse response = messagingClient.listRoomsCallable().call(request);
        -   *     for (Room element : response.getRoomsList()) {
        -   *       // doThingsWith(element);
        -   *     }
        -   *     String nextPageToken = response.getNextPageToken();
        -   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
        -   *       request = request.toBuilder().setPageToken(nextPageToken).build();
        -   *     } else {
        -   *       break;
        -   *     }
        -   *   }
        -   * }
        -   * }
        - */ - public final UnaryCallable listRoomsCallable() { - return stub.listRoomsCallable(); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Creates a blurb. If the parent is a room, the blurb is understood to be a message in that room. - * If the parent is a profile, the blurb is understood to be a post on the profile. - * - *

        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 (MessagingClient messagingClient = MessagingClient.create()) {
        -   *   ProfileName parent = ProfileName.of("[USER]");
        -   *   UserName user = UserName.of("[USER]");
        -   *   ByteString image = ByteString.EMPTY;
        -   *   Blurb response = messagingClient.createBlurb(parent, user, image);
        -   * }
        -   * }
        - * - * @param parent The resource name of the chat room or user profile that this blurb will be tied - * to. - * @param user The resource name of the blurb's author. - * @param image The image content of this blurb. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final Blurb createBlurb(ProfileName parent, UserName user, ByteString image) { - CreateBlurbRequest request = - CreateBlurbRequest.newBuilder() - .setParent(parent == null ? null : parent.toString()) - .setBlurb( - Blurb.newBuilder() - .setUser(user == null ? null : user.toString()) - .setImage(image) - .build()) - .build(); - return createBlurb(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Creates a blurb. If the parent is a room, the blurb is understood to be a message in that room. - * If the parent is a profile, the blurb is understood to be a post on the profile. - * - *

        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 (MessagingClient messagingClient = MessagingClient.create()) {
        -   *   ProfileName parent = ProfileName.of("[USER]");
        -   *   UserName user = UserName.of("[USER]");
        -   *   String text = "text3556653";
        -   *   Blurb response = messagingClient.createBlurb(parent, user, text);
        -   * }
        -   * }
        - * - * @param parent The resource name of the chat room or user profile that this blurb will be tied - * to. - * @param user The resource name of the blurb's author. - * @param text The textual content of this blurb. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final Blurb createBlurb(ProfileName parent, UserName user, String text) { - CreateBlurbRequest request = - CreateBlurbRequest.newBuilder() - .setParent(parent == null ? null : parent.toString()) - .setBlurb( - Blurb.newBuilder() - .setUser(user == null ? null : user.toString()) - .setText(text) - .build()) - .build(); - return createBlurb(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Creates a blurb. If the parent is a room, the blurb is understood to be a message in that room. - * If the parent is a profile, the blurb is understood to be a post on the profile. - * - *

        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 (MessagingClient messagingClient = MessagingClient.create()) {
        -   *   ProfileName parent = ProfileName.of("[USER]");
        -   *   String user = UserName.of("[USER]").toString();
        -   *   ByteString image = ByteString.EMPTY;
        -   *   Blurb response = messagingClient.createBlurb(parent, user, image);
        -   * }
        -   * }
        - * - * @param parent The resource name of the chat room or user profile that this blurb will be tied - * to. - * @param user The resource name of the blurb's author. - * @param image The image content of this blurb. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final Blurb createBlurb(ProfileName parent, String user, ByteString image) { - CreateBlurbRequest request = - CreateBlurbRequest.newBuilder() - .setParent(parent == null ? null : parent.toString()) - .setBlurb(Blurb.newBuilder().setUser(user).setImage(image).build()) - .build(); - return createBlurb(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Creates a blurb. If the parent is a room, the blurb is understood to be a message in that room. - * If the parent is a profile, the blurb is understood to be a post on the profile. - * - *

        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 (MessagingClient messagingClient = MessagingClient.create()) {
        -   *   ProfileName parent = ProfileName.of("[USER]");
        -   *   String user = UserName.of("[USER]").toString();
        -   *   String text = "text3556653";
        -   *   Blurb response = messagingClient.createBlurb(parent, user, text);
        -   * }
        -   * }
        - * - * @param parent The resource name of the chat room or user profile that this blurb will be tied - * to. - * @param user The resource name of the blurb's author. - * @param text The textual content of this blurb. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final Blurb createBlurb(ProfileName parent, String user, String text) { - CreateBlurbRequest request = - CreateBlurbRequest.newBuilder() - .setParent(parent == null ? null : parent.toString()) - .setBlurb(Blurb.newBuilder().setUser(user).setText(text).build()) - .build(); - return createBlurb(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Creates a blurb. If the parent is a room, the blurb is understood to be a message in that room. - * If the parent is a profile, the blurb is understood to be a post on the profile. - * - *

        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 (MessagingClient messagingClient = MessagingClient.create()) {
        -   *   RoomName parent = RoomName.of("[ROOM]");
        -   *   UserName user = UserName.of("[USER]");
        -   *   ByteString image = ByteString.EMPTY;
        -   *   Blurb response = messagingClient.createBlurb(parent, user, image);
        -   * }
        -   * }
        - * - * @param parent The resource name of the chat room or user profile that this blurb will be tied - * to. - * @param user The resource name of the blurb's author. - * @param image The image content of this blurb. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final Blurb createBlurb(RoomName parent, UserName user, ByteString image) { - CreateBlurbRequest request = - CreateBlurbRequest.newBuilder() - .setParent(parent == null ? null : parent.toString()) - .setBlurb( - Blurb.newBuilder() - .setUser(user == null ? null : user.toString()) - .setImage(image) - .build()) - .build(); - return createBlurb(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Creates a blurb. If the parent is a room, the blurb is understood to be a message in that room. - * If the parent is a profile, the blurb is understood to be a post on the profile. - * - *

        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 (MessagingClient messagingClient = MessagingClient.create()) {
        -   *   RoomName parent = RoomName.of("[ROOM]");
        -   *   UserName user = UserName.of("[USER]");
        -   *   String text = "text3556653";
        -   *   Blurb response = messagingClient.createBlurb(parent, user, text);
        -   * }
        -   * }
        - * - * @param parent The resource name of the chat room or user profile that this blurb will be tied - * to. - * @param user The resource name of the blurb's author. - * @param text The textual content of this blurb. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final Blurb createBlurb(RoomName parent, UserName user, String text) { - CreateBlurbRequest request = - CreateBlurbRequest.newBuilder() - .setParent(parent == null ? null : parent.toString()) - .setBlurb( - Blurb.newBuilder() - .setUser(user == null ? null : user.toString()) - .setText(text) - .build()) - .build(); - return createBlurb(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Creates a blurb. If the parent is a room, the blurb is understood to be a message in that room. - * If the parent is a profile, the blurb is understood to be a post on the profile. - * - *

        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 (MessagingClient messagingClient = MessagingClient.create()) {
        -   *   RoomName parent = RoomName.of("[ROOM]");
        -   *   String user = UserName.of("[USER]").toString();
        -   *   ByteString image = ByteString.EMPTY;
        -   *   Blurb response = messagingClient.createBlurb(parent, user, image);
        -   * }
        -   * }
        - * - * @param parent The resource name of the chat room or user profile that this blurb will be tied - * to. - * @param user The resource name of the blurb's author. - * @param image The image content of this blurb. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final Blurb createBlurb(RoomName parent, String user, ByteString image) { - CreateBlurbRequest request = - CreateBlurbRequest.newBuilder() - .setParent(parent == null ? null : parent.toString()) - .setBlurb(Blurb.newBuilder().setUser(user).setImage(image).build()) - .build(); - return createBlurb(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Creates a blurb. If the parent is a room, the blurb is understood to be a message in that room. - * If the parent is a profile, the blurb is understood to be a post on the profile. - * - *

        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 (MessagingClient messagingClient = MessagingClient.create()) {
        -   *   RoomName parent = RoomName.of("[ROOM]");
        -   *   String user = UserName.of("[USER]").toString();
        -   *   String text = "text3556653";
        -   *   Blurb response = messagingClient.createBlurb(parent, user, text);
        -   * }
        -   * }
        - * - * @param parent The resource name of the chat room or user profile that this blurb will be tied - * to. - * @param user The resource name of the blurb's author. - * @param text The textual content of this blurb. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final Blurb createBlurb(RoomName parent, String user, String text) { - CreateBlurbRequest request = - CreateBlurbRequest.newBuilder() - .setParent(parent == null ? null : parent.toString()) - .setBlurb(Blurb.newBuilder().setUser(user).setText(text).build()) - .build(); - return createBlurb(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Creates a blurb. If the parent is a room, the blurb is understood to be a message in that room. - * If the parent is a profile, the blurb is understood to be a post on the profile. - * - *

        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 (MessagingClient messagingClient = MessagingClient.create()) {
        -   *   String parent = ProfileName.of("[USER]").toString();
        -   *   UserName user = UserName.of("[USER]");
        -   *   ByteString image = ByteString.EMPTY;
        -   *   Blurb response = messagingClient.createBlurb(parent, user, image);
        -   * }
        -   * }
        - * - * @param parent The resource name of the chat room or user profile that this blurb will be tied - * to. - * @param user The resource name of the blurb's author. - * @param image The image content of this blurb. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final Blurb createBlurb(String parent, UserName user, ByteString image) { - CreateBlurbRequest request = - CreateBlurbRequest.newBuilder() - .setParent(parent) - .setBlurb( - Blurb.newBuilder() - .setUser(user == null ? null : user.toString()) - .setImage(image) - .build()) - .build(); - return createBlurb(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Creates a blurb. If the parent is a room, the blurb is understood to be a message in that room. - * If the parent is a profile, the blurb is understood to be a post on the profile. - * - *

        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 (MessagingClient messagingClient = MessagingClient.create()) {
        -   *   String parent = ProfileName.of("[USER]").toString();
        -   *   UserName user = UserName.of("[USER]");
        -   *   String text = "text3556653";
        -   *   Blurb response = messagingClient.createBlurb(parent, user, text);
        -   * }
        -   * }
        - * - * @param parent The resource name of the chat room or user profile that this blurb will be tied - * to. - * @param user The resource name of the blurb's author. - * @param text The textual content of this blurb. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final Blurb createBlurb(String parent, UserName user, String text) { - CreateBlurbRequest request = - CreateBlurbRequest.newBuilder() - .setParent(parent) - .setBlurb( - Blurb.newBuilder() - .setUser(user == null ? null : user.toString()) - .setText(text) - .build()) - .build(); - return createBlurb(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Creates a blurb. If the parent is a room, the blurb is understood to be a message in that room. - * If the parent is a profile, the blurb is understood to be a post on the profile. - * - *

        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 (MessagingClient messagingClient = MessagingClient.create()) {
        -   *   String parent = ProfileName.of("[USER]").toString();
        -   *   String user = UserName.of("[USER]").toString();
        -   *   ByteString image = ByteString.EMPTY;
        -   *   Blurb response = messagingClient.createBlurb(parent, user, image);
        -   * }
        -   * }
        - * - * @param parent The resource name of the chat room or user profile that this blurb will be tied - * to. - * @param user The resource name of the blurb's author. - * @param image The image content of this blurb. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final Blurb createBlurb(String parent, String user, ByteString image) { - CreateBlurbRequest request = - CreateBlurbRequest.newBuilder() - .setParent(parent) - .setBlurb(Blurb.newBuilder().setUser(user).setImage(image).build()) - .build(); - return createBlurb(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Creates a blurb. If the parent is a room, the blurb is understood to be a message in that room. - * If the parent is a profile, the blurb is understood to be a post on the profile. - * - *

        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 (MessagingClient messagingClient = MessagingClient.create()) {
        -   *   String parent = ProfileName.of("[USER]").toString();
        -   *   String user = UserName.of("[USER]").toString();
        -   *   String text = "text3556653";
        -   *   Blurb response = messagingClient.createBlurb(parent, user, text);
        -   * }
        -   * }
        - * - * @param parent The resource name of the chat room or user profile that this blurb will be tied - * to. - * @param user The resource name of the blurb's author. - * @param text The textual content of this blurb. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final Blurb createBlurb(String parent, String user, String text) { - CreateBlurbRequest request = - CreateBlurbRequest.newBuilder() - .setParent(parent) - .setBlurb(Blurb.newBuilder().setUser(user).setText(text).build()) - .build(); - return createBlurb(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Creates a blurb. If the parent is a room, the blurb is understood to be a message in that room. - * If the parent is a profile, the blurb is understood to be a post on the profile. - * - *

        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 (MessagingClient messagingClient = MessagingClient.create()) {
        -   *   CreateBlurbRequest request =
        -   *       CreateBlurbRequest.newBuilder()
        -   *           .setParent(ProfileName.of("[USER]").toString())
        -   *           .setBlurb(Blurb.newBuilder().build())
        -   *           .build();
        -   *   Blurb response = messagingClient.createBlurb(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 Blurb createBlurb(CreateBlurbRequest request) { - return createBlurbCallable().call(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Creates a blurb. If the parent is a room, the blurb is understood to be a message in that room. - * If the parent is a profile, the blurb is understood to be a post on the profile. - * - *

        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 (MessagingClient messagingClient = MessagingClient.create()) {
        -   *   CreateBlurbRequest request =
        -   *       CreateBlurbRequest.newBuilder()
        -   *           .setParent(ProfileName.of("[USER]").toString())
        -   *           .setBlurb(Blurb.newBuilder().build())
        -   *           .build();
        -   *   ApiFuture future = messagingClient.createBlurbCallable().futureCall(request);
        -   *   // Do something.
        -   *   Blurb response = future.get();
        -   * }
        -   * }
        - */ - public final UnaryCallable createBlurbCallable() { - return stub.createBlurbCallable(); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Retrieves the Blurb with the given resource name. - * - *

        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 (MessagingClient messagingClient = MessagingClient.create()) {
        -   *   BlurbName name = BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]");
        -   *   Blurb response = messagingClient.getBlurb(name);
        -   * }
        -   * }
        - * - * @param name The resource name of the requested blurb. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final Blurb getBlurb(BlurbName name) { - GetBlurbRequest request = - GetBlurbRequest.newBuilder().setName(name == null ? null : name.toString()).build(); - return getBlurb(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Retrieves the Blurb with the given resource name. - * - *

        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 (MessagingClient messagingClient = MessagingClient.create()) {
        -   *   String name =
        -   *       BlurbName.ofUserLegacyUserBlurbName("[USER]", "[LEGACY_USER]", "[BLURB]").toString();
        -   *   Blurb response = messagingClient.getBlurb(name);
        -   * }
        -   * }
        - * - * @param name The resource name of the requested blurb. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final Blurb getBlurb(String name) { - GetBlurbRequest request = GetBlurbRequest.newBuilder().setName(name).build(); - return getBlurb(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Retrieves the Blurb with the given resource name. - * - *

        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 (MessagingClient messagingClient = MessagingClient.create()) {
        -   *   GetBlurbRequest request =
        -   *       GetBlurbRequest.newBuilder()
        -   *           .setName(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString())
        -   *           .build();
        -   *   Blurb response = messagingClient.getBlurb(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 Blurb getBlurb(GetBlurbRequest request) { - return getBlurbCallable().call(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Retrieves the Blurb with the given resource name. - * - *

        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 (MessagingClient messagingClient = MessagingClient.create()) {
        -   *   GetBlurbRequest request =
        -   *       GetBlurbRequest.newBuilder()
        -   *           .setName(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString())
        -   *           .build();
        -   *   ApiFuture future = messagingClient.getBlurbCallable().futureCall(request);
        -   *   // Do something.
        -   *   Blurb response = future.get();
        -   * }
        -   * }
        - */ - public final UnaryCallable getBlurbCallable() { - return stub.getBlurbCallable(); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Updates a blurb. - * - *

        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 (MessagingClient messagingClient = MessagingClient.create()) {
        -   *   UpdateBlurbRequest request =
        -   *       UpdateBlurbRequest.newBuilder()
        -   *           .setBlurb(Blurb.newBuilder().build())
        -   *           .setUpdateMask(FieldMask.newBuilder().build())
        -   *           .build();
        -   *   Blurb response = messagingClient.updateBlurb(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 Blurb updateBlurb(UpdateBlurbRequest request) { - return updateBlurbCallable().call(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Updates a blurb. - * - *

        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 (MessagingClient messagingClient = MessagingClient.create()) {
        -   *   UpdateBlurbRequest request =
        -   *       UpdateBlurbRequest.newBuilder()
        -   *           .setBlurb(Blurb.newBuilder().build())
        -   *           .setUpdateMask(FieldMask.newBuilder().build())
        -   *           .build();
        -   *   ApiFuture future = messagingClient.updateBlurbCallable().futureCall(request);
        -   *   // Do something.
        -   *   Blurb response = future.get();
        -   * }
        -   * }
        - */ - public final UnaryCallable updateBlurbCallable() { - return stub.updateBlurbCallable(); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Deletes a blurb. - * - *

        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 (MessagingClient messagingClient = MessagingClient.create()) {
        -   *   BlurbName name = BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]");
        -   *   messagingClient.deleteBlurb(name);
        -   * }
        -   * }
        - * - * @param name The resource name of the requested blurb. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final void deleteBlurb(BlurbName name) { - DeleteBlurbRequest request = - DeleteBlurbRequest.newBuilder().setName(name == null ? null : name.toString()).build(); - deleteBlurb(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Deletes a blurb. - * - *

        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 (MessagingClient messagingClient = MessagingClient.create()) {
        -   *   String name =
        -   *       BlurbName.ofUserLegacyUserBlurbName("[USER]", "[LEGACY_USER]", "[BLURB]").toString();
        -   *   messagingClient.deleteBlurb(name);
        -   * }
        -   * }
        - * - * @param name The resource name of the requested blurb. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final void deleteBlurb(String name) { - DeleteBlurbRequest request = DeleteBlurbRequest.newBuilder().setName(name).build(); - deleteBlurb(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Deletes a blurb. - * - *

        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 (MessagingClient messagingClient = MessagingClient.create()) {
        -   *   DeleteBlurbRequest request =
        -   *       DeleteBlurbRequest.newBuilder()
        -   *           .setName(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString())
        -   *           .build();
        -   *   messagingClient.deleteBlurb(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 deleteBlurb(DeleteBlurbRequest request) { - deleteBlurbCallable().call(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Deletes a blurb. - * - *

        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 (MessagingClient messagingClient = MessagingClient.create()) {
        -   *   DeleteBlurbRequest request =
        -   *       DeleteBlurbRequest.newBuilder()
        -   *           .setName(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString())
        -   *           .build();
        -   *   ApiFuture future = messagingClient.deleteBlurbCallable().futureCall(request);
        -   *   // Do something.
        -   *   future.get();
        -   * }
        -   * }
        - */ - public final UnaryCallable deleteBlurbCallable() { - return stub.deleteBlurbCallable(); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Lists blurbs for a specific chat room or user profile depending on the parent resource name. - * - *

        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 (MessagingClient messagingClient = MessagingClient.create()) {
        -   *   ProfileName parent = ProfileName.of("[USER]");
        -   *   for (Blurb element : messagingClient.listBlurbs(parent).iterateAll()) {
        -   *     // doThingsWith(element);
        -   *   }
        -   * }
        -   * }
        - * - * @param parent The resource name of the requested room or profile whos blurbs to list. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final ListBlurbsPagedResponse listBlurbs(ProfileName parent) { - ListBlurbsRequest request = - ListBlurbsRequest.newBuilder().setParent(parent == null ? null : parent.toString()).build(); - return listBlurbs(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Lists blurbs for a specific chat room or user profile depending on the parent resource name. - * - *

        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 (MessagingClient messagingClient = MessagingClient.create()) {
        -   *   RoomName parent = RoomName.of("[ROOM]");
        -   *   for (Blurb element : messagingClient.listBlurbs(parent).iterateAll()) {
        -   *     // doThingsWith(element);
        -   *   }
        -   * }
        -   * }
        - * - * @param parent The resource name of the requested room or profile whos blurbs to list. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final ListBlurbsPagedResponse listBlurbs(RoomName parent) { - ListBlurbsRequest request = - ListBlurbsRequest.newBuilder().setParent(parent == null ? null : parent.toString()).build(); - return listBlurbs(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Lists blurbs for a specific chat room or user profile depending on the parent resource name. - * - *

        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 (MessagingClient messagingClient = MessagingClient.create()) {
        -   *   String parent = ProfileName.of("[USER]").toString();
        -   *   for (Blurb element : messagingClient.listBlurbs(parent).iterateAll()) {
        -   *     // doThingsWith(element);
        -   *   }
        -   * }
        -   * }
        - * - * @param parent The resource name of the requested room or profile whos blurbs to list. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final ListBlurbsPagedResponse listBlurbs(String parent) { - ListBlurbsRequest request = ListBlurbsRequest.newBuilder().setParent(parent).build(); - return listBlurbs(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Lists blurbs for a specific chat room or user profile depending on the parent resource name. - * - *

        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 (MessagingClient messagingClient = MessagingClient.create()) {
        -   *   ListBlurbsRequest request =
        -   *       ListBlurbsRequest.newBuilder()
        -   *           .setParent(ProfileName.of("[USER]").toString())
        -   *           .setPageSize(883849137)
        -   *           .setPageToken("pageToken873572522")
        -   *           .build();
        -   *   for (Blurb element : messagingClient.listBlurbs(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 ListBlurbsPagedResponse listBlurbs(ListBlurbsRequest request) { - return listBlurbsPagedCallable().call(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Lists blurbs for a specific chat room or user profile depending on the parent resource name. - * - *

        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 (MessagingClient messagingClient = MessagingClient.create()) {
        -   *   ListBlurbsRequest request =
        -   *       ListBlurbsRequest.newBuilder()
        -   *           .setParent(ProfileName.of("[USER]").toString())
        -   *           .setPageSize(883849137)
        -   *           .setPageToken("pageToken873572522")
        -   *           .build();
        -   *   ApiFuture future = messagingClient.listBlurbsPagedCallable().futureCall(request);
        -   *   // Do something.
        -   *   for (Blurb element : future.get().iterateAll()) {
        -   *     // doThingsWith(element);
        -   *   }
        -   * }
        -   * }
        - */ - public final UnaryCallable listBlurbsPagedCallable() { - return stub.listBlurbsPagedCallable(); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Lists blurbs for a specific chat room or user profile depending on the parent resource name. - * - *

        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 (MessagingClient messagingClient = MessagingClient.create()) {
        -   *   ListBlurbsRequest request =
        -   *       ListBlurbsRequest.newBuilder()
        -   *           .setParent(ProfileName.of("[USER]").toString())
        -   *           .setPageSize(883849137)
        -   *           .setPageToken("pageToken873572522")
        -   *           .build();
        -   *   while (true) {
        -   *     ListBlurbsResponse response = messagingClient.listBlurbsCallable().call(request);
        -   *     for (Blurb element : response.getBlurbsList()) {
        -   *       // doThingsWith(element);
        -   *     }
        -   *     String nextPageToken = response.getNextPageToken();
        -   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
        -   *       request = request.toBuilder().setPageToken(nextPageToken).build();
        -   *     } else {
        -   *       break;
        -   *     }
        -   *   }
        -   * }
        -   * }
        - */ - public final UnaryCallable listBlurbsCallable() { - return stub.listBlurbsCallable(); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * This method searches through all blurbs across all rooms and profiles for blurbs containing to - * words found in the query. Only posts that contain an exact match of a queried word will be - * returned. - * - *

        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 (MessagingClient messagingClient = MessagingClient.create()) {
        -   *   ProfileName parent = ProfileName.of("[USER]");
        -   *   String query = "query107944136";
        -   *   SearchBlurbsResponse response = messagingClient.searchBlurbsAsync(parent, query).get();
        -   * }
        -   * }
        - * - * @param parent The rooms or profiles to search. If unset, `SearchBlurbs` will search all rooms - * and all profiles. - * @param query The query used to search for blurbs containing to words of this string. Only posts - * that contain an exact match of a queried word will be returned. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final OperationFuture searchBlurbsAsync( - ProfileName parent, String query) { - SearchBlurbsRequest request = - SearchBlurbsRequest.newBuilder() - .setParent(parent == null ? null : parent.toString()) - .setQuery(query) - .build(); - return searchBlurbsAsync(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * This method searches through all blurbs across all rooms and profiles for blurbs containing to - * words found in the query. Only posts that contain an exact match of a queried word will be - * returned. - * - *

        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 (MessagingClient messagingClient = MessagingClient.create()) {
        -   *   RoomName parent = RoomName.of("[ROOM]");
        -   *   String query = "query107944136";
        -   *   SearchBlurbsResponse response = messagingClient.searchBlurbsAsync(parent, query).get();
        -   * }
        -   * }
        - * - * @param parent The rooms or profiles to search. If unset, `SearchBlurbs` will search all rooms - * and all profiles. - * @param query The query used to search for blurbs containing to words of this string. Only posts - * that contain an exact match of a queried word will be returned. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final OperationFuture searchBlurbsAsync( - RoomName parent, String query) { - SearchBlurbsRequest request = - SearchBlurbsRequest.newBuilder() - .setParent(parent == null ? null : parent.toString()) - .setQuery(query) - .build(); - return searchBlurbsAsync(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * This method searches through all blurbs across all rooms and profiles for blurbs containing to - * words found in the query. Only posts that contain an exact match of a queried word will be - * returned. - * - *

        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 (MessagingClient messagingClient = MessagingClient.create()) {
        -   *   String parent = ProfileName.of("[USER]").toString();
        -   *   String query = "query107944136";
        -   *   SearchBlurbsResponse response = messagingClient.searchBlurbsAsync(parent, query).get();
        -   * }
        -   * }
        - * - * @param parent The rooms or profiles to search. If unset, `SearchBlurbs` will search all rooms - * and all profiles. - * @param query The query used to search for blurbs containing to words of this string. Only posts - * that contain an exact match of a queried word will be returned. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final OperationFuture searchBlurbsAsync( - String parent, String query) { - SearchBlurbsRequest request = - SearchBlurbsRequest.newBuilder().setParent(parent).setQuery(query).build(); - return searchBlurbsAsync(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * This method searches through all blurbs across all rooms and profiles for blurbs containing to - * words found in the query. Only posts that contain an exact match of a queried word will be - * returned. - * - *

        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 (MessagingClient messagingClient = MessagingClient.create()) {
        -   *   SearchBlurbsRequest request =
        -   *       SearchBlurbsRequest.newBuilder()
        -   *           .setQuery("query107944136")
        -   *           .setParent(ProfileName.of("[USER]").toString())
        -   *           .setPageSize(883849137)
        -   *           .setPageToken("pageToken873572522")
        -   *           .build();
        -   *   SearchBlurbsResponse response = messagingClient.searchBlurbsAsync(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 searchBlurbsAsync( - SearchBlurbsRequest request) { - return searchBlurbsOperationCallable().futureCall(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * This method searches through all blurbs across all rooms and profiles for blurbs containing to - * words found in the query. Only posts that contain an exact match of a queried word will be - * returned. - * - *

        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 (MessagingClient messagingClient = MessagingClient.create()) {
        -   *   SearchBlurbsRequest request =
        -   *       SearchBlurbsRequest.newBuilder()
        -   *           .setQuery("query107944136")
        -   *           .setParent(ProfileName.of("[USER]").toString())
        -   *           .setPageSize(883849137)
        -   *           .setPageToken("pageToken873572522")
        -   *           .build();
        -   *   OperationFuture future =
        -   *       messagingClient.searchBlurbsOperationCallable().futureCall(request);
        -   *   // Do something.
        -   *   SearchBlurbsResponse response = future.get();
        -   * }
        -   * }
        - */ - public final OperationCallable - searchBlurbsOperationCallable() { - return stub.searchBlurbsOperationCallable(); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * This method searches through all blurbs across all rooms and profiles for blurbs containing to - * words found in the query. Only posts that contain an exact match of a queried word will be - * returned. - * - *

        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 (MessagingClient messagingClient = MessagingClient.create()) {
        -   *   SearchBlurbsRequest request =
        -   *       SearchBlurbsRequest.newBuilder()
        -   *           .setQuery("query107944136")
        -   *           .setParent(ProfileName.of("[USER]").toString())
        -   *           .setPageSize(883849137)
        -   *           .setPageToken("pageToken873572522")
        -   *           .build();
        -   *   ApiFuture future = messagingClient.searchBlurbsCallable().futureCall(request);
        -   *   // Do something.
        -   *   Operation response = future.get();
        -   * }
        -   * }
        - */ - public final UnaryCallable searchBlurbsCallable() { - return stub.searchBlurbsCallable(); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * This returns a stream that emits the blurbs that are created for a particular chat room or user - * profile. - * - *

        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 (MessagingClient messagingClient = MessagingClient.create()) {
        -   *   StreamBlurbsRequest request =
        -   *       StreamBlurbsRequest.newBuilder()
        -   *           .setName(ProfileName.of("[USER]").toString())
        -   *           .setExpireTime(Timestamp.newBuilder().build())
        -   *           .build();
        -   *   ServerStream stream =
        -   *       messagingClient.streamBlurbsCallable().call(request);
        -   *   for (StreamBlurbsResponse response : stream) {
        -   *     // Do something when a response is received.
        -   *   }
        -   * }
        -   * }
        - */ - public final ServerStreamingCallable - streamBlurbsCallable() { - return stub.streamBlurbsCallable(); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * This is a stream to create multiple blurbs. If an invalid blurb is requested to be created, the - * stream will close with an error. - * - *

        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 (MessagingClient messagingClient = MessagingClient.create()) {
        -   *   ApiStreamObserver responseObserver =
        -   *       new ApiStreamObserver() {
        -   *         {@literal @}Override
        -   *         public void onNext(SendBlurbsResponse response) {
        -   *           // Do something when a response is received.
        -   *         }
        -   *
        -   *         {@literal @}Override
        -   *         public void onError(Throwable t) {
        -   *           // Add error-handling
        -   *         }
        -   *
        -   *         {@literal @}Override
        -   *         public void onCompleted() {
        -   *           // Do something when complete.
        -   *         }
        -   *       };
        -   *   ApiStreamObserver requestObserver =
        -   *       messagingClient.sendBlurbs().clientStreamingCall(responseObserver);
        -   *   CreateBlurbRequest request =
        -   *       CreateBlurbRequest.newBuilder()
        -   *           .setParent(ProfileName.of("[USER]").toString())
        -   *           .setBlurb(Blurb.newBuilder().build())
        -   *           .build();
        -   *   requestObserver.onNext(request);
        -   * }
        -   * }
        - */ - public final ClientStreamingCallable - sendBlurbsCallable() { - return stub.sendBlurbsCallable(); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * This method starts a bidirectional stream that receives all blurbs that are being created after - * the stream has started and sends requests to create blurbs. If an invalid blurb is requested to - * be created, the stream will close with an error. - * - *

        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 (MessagingClient messagingClient = MessagingClient.create()) {
        -   *   BidiStream bidiStream =
        -   *       messagingClient.connectCallable().call();
        -   *   ConnectRequest request = ConnectRequest.newBuilder().build();
        -   *   bidiStream.send(request);
        -   *   for (StreamBlurbsResponse response : bidiStream) {
        -   *     // Do something when a response is received.
        -   *   }
        -   * }
        -   * }
        - */ - public final BidiStreamingCallable connectCallable() { - return stub.connectCallable(); - } - - @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 ListRoomsPagedResponse - extends AbstractPagedListResponse< - ListRoomsRequest, ListRoomsResponse, Room, ListRoomsPage, ListRoomsFixedSizeCollection> { - - public static ApiFuture createAsync( - PageContext context, - ApiFuture futureResponse) { - ApiFuture futurePage = - ListRoomsPage.createEmptyPage().createPageAsync(context, futureResponse); - return ApiFutures.transform( - futurePage, input -> new ListRoomsPagedResponse(input), MoreExecutors.directExecutor()); - } - - private ListRoomsPagedResponse(ListRoomsPage page) { - super(page, ListRoomsFixedSizeCollection.createEmptyCollection()); - } - } - - public static class ListRoomsPage - extends AbstractPage { - - private ListRoomsPage( - PageContext context, - ListRoomsResponse response) { - super(context, response); - } - - private static ListRoomsPage createEmptyPage() { - return new ListRoomsPage(null, null); - } - - @Override - protected ListRoomsPage createPage( - PageContext context, - ListRoomsResponse response) { - return new ListRoomsPage(context, response); - } - - @Override - public ApiFuture createPageAsync( - PageContext context, - ApiFuture futureResponse) { - return super.createPageAsync(context, futureResponse); - } - } - - public static class ListRoomsFixedSizeCollection - extends AbstractFixedSizeCollection< - ListRoomsRequest, ListRoomsResponse, Room, ListRoomsPage, ListRoomsFixedSizeCollection> { - - private ListRoomsFixedSizeCollection(List pages, int collectionSize) { - super(pages, collectionSize); - } - - private static ListRoomsFixedSizeCollection createEmptyCollection() { - return new ListRoomsFixedSizeCollection(null, 0); - } - - @Override - protected ListRoomsFixedSizeCollection createCollection( - List pages, int collectionSize) { - return new ListRoomsFixedSizeCollection(pages, collectionSize); - } - } - - public static class ListBlurbsPagedResponse - extends AbstractPagedListResponse< - ListBlurbsRequest, - ListBlurbsResponse, - Blurb, - ListBlurbsPage, - ListBlurbsFixedSizeCollection> { - - public static ApiFuture createAsync( - PageContext context, - ApiFuture futureResponse) { - ApiFuture futurePage = - ListBlurbsPage.createEmptyPage().createPageAsync(context, futureResponse); - return ApiFutures.transform( - futurePage, input -> new ListBlurbsPagedResponse(input), MoreExecutors.directExecutor()); - } - - private ListBlurbsPagedResponse(ListBlurbsPage page) { - super(page, ListBlurbsFixedSizeCollection.createEmptyCollection()); - } - } - - public static class ListBlurbsPage - extends AbstractPage { - - private ListBlurbsPage( - PageContext context, - ListBlurbsResponse response) { - super(context, response); - } - - private static ListBlurbsPage createEmptyPage() { - return new ListBlurbsPage(null, null); - } - - @Override - protected ListBlurbsPage createPage( - PageContext context, - ListBlurbsResponse response) { - return new ListBlurbsPage(context, response); - } - - @Override - public ApiFuture createPageAsync( - PageContext context, - ApiFuture futureResponse) { - return super.createPageAsync(context, futureResponse); - } - } - - public static class ListBlurbsFixedSizeCollection - extends AbstractFixedSizeCollection< - ListBlurbsRequest, - ListBlurbsResponse, - Blurb, - ListBlurbsPage, - ListBlurbsFixedSizeCollection> { - - private ListBlurbsFixedSizeCollection(List pages, int collectionSize) { - super(pages, collectionSize); - } - - private static ListBlurbsFixedSizeCollection createEmptyCollection() { - return new ListBlurbsFixedSizeCollection(null, 0); - } - - @Override - protected ListBlurbsFixedSizeCollection createCollection( - List pages, int collectionSize) { - return new ListBlurbsFixedSizeCollection(pages, collectionSize); - } - } -} diff --git a/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/MessagingSettings.java b/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/MessagingSettings.java deleted file mode 100644 index 2196181ea3..0000000000 --- a/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/MessagingSettings.java +++ /dev/null @@ -1,364 +0,0 @@ -/* - * 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 - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1; - -import static com.google.showcase.v1beta1.MessagingClient.ListBlurbsPagedResponse; -import static com.google.showcase.v1beta1.MessagingClient.ListRoomsPagedResponse; - -import com.google.api.core.ApiFunction; -import com.google.api.core.BetaApi; -import com.google.api.gax.core.GoogleCredentialsProvider; -import com.google.api.gax.core.InstantiatingExecutorProvider; -import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; -import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; -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.ServerStreamingCallSettings; -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.longrunning.Operation; -import com.google.protobuf.Empty; -import com.google.showcase.v1beta1.stub.MessagingStubSettings; -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 MessagingClient}. - * - *

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

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

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

        For example, to set the total timeout of createRoom to 30 seconds: - * - *

        {@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
        - * MessagingSettings.Builder messagingSettingsBuilder = MessagingSettings.newBuilder();
        - * messagingSettingsBuilder
        - *     .createRoomSettings()
        - *     .setRetrySettings(
        - *         messagingSettingsBuilder
        - *             .createRoomSettings()
        - *             .getRetrySettings()
        - *             .toBuilder()
        - *             .setTotalTimeout(Duration.ofSeconds(30))
        - *             .build());
        - * MessagingSettings messagingSettings = messagingSettingsBuilder.build();
        - * }
        - */ -@BetaApi -@Generated("by gapic-generator-java") -public class MessagingSettings extends ClientSettings { - - /** Returns the object with the settings used for calls to createRoom. */ - public UnaryCallSettings createRoomSettings() { - return ((MessagingStubSettings) getStubSettings()).createRoomSettings(); - } - - /** Returns the object with the settings used for calls to getRoom. */ - public UnaryCallSettings getRoomSettings() { - return ((MessagingStubSettings) getStubSettings()).getRoomSettings(); - } - - /** Returns the object with the settings used for calls to updateRoom. */ - public UnaryCallSettings updateRoomSettings() { - return ((MessagingStubSettings) getStubSettings()).updateRoomSettings(); - } - - /** Returns the object with the settings used for calls to deleteRoom. */ - public UnaryCallSettings deleteRoomSettings() { - return ((MessagingStubSettings) getStubSettings()).deleteRoomSettings(); - } - - /** Returns the object with the settings used for calls to listRooms. */ - public PagedCallSettings - listRoomsSettings() { - return ((MessagingStubSettings) getStubSettings()).listRoomsSettings(); - } - - /** Returns the object with the settings used for calls to createBlurb. */ - public UnaryCallSettings createBlurbSettings() { - return ((MessagingStubSettings) getStubSettings()).createBlurbSettings(); - } - - /** Returns the object with the settings used for calls to getBlurb. */ - public UnaryCallSettings getBlurbSettings() { - return ((MessagingStubSettings) getStubSettings()).getBlurbSettings(); - } - - /** Returns the object with the settings used for calls to updateBlurb. */ - public UnaryCallSettings updateBlurbSettings() { - return ((MessagingStubSettings) getStubSettings()).updateBlurbSettings(); - } - - /** Returns the object with the settings used for calls to deleteBlurb. */ - public UnaryCallSettings deleteBlurbSettings() { - return ((MessagingStubSettings) getStubSettings()).deleteBlurbSettings(); - } - - /** Returns the object with the settings used for calls to listBlurbs. */ - public PagedCallSettings - listBlurbsSettings() { - return ((MessagingStubSettings) getStubSettings()).listBlurbsSettings(); - } - - /** Returns the object with the settings used for calls to searchBlurbs. */ - public UnaryCallSettings searchBlurbsSettings() { - return ((MessagingStubSettings) getStubSettings()).searchBlurbsSettings(); - } - - /** Returns the object with the settings used for calls to searchBlurbs. */ - public OperationCallSettings - searchBlurbsOperationSettings() { - return ((MessagingStubSettings) getStubSettings()).searchBlurbsOperationSettings(); - } - - /** Returns the object with the settings used for calls to streamBlurbs. */ - public ServerStreamingCallSettings - streamBlurbsSettings() { - return ((MessagingStubSettings) getStubSettings()).streamBlurbsSettings(); - } - - /** Returns the object with the settings used for calls to sendBlurbs. */ - public StreamingCallSettings sendBlurbsSettings() { - return ((MessagingStubSettings) getStubSettings()).sendBlurbsSettings(); - } - - /** Returns the object with the settings used for calls to connect. */ - public StreamingCallSettings connectSettings() { - return ((MessagingStubSettings) getStubSettings()).connectSettings(); - } - - public static final MessagingSettings create(MessagingStubSettings stub) throws IOException { - return new MessagingSettings.Builder(stub.toBuilder()).build(); - } - - /** Returns a builder for the default ExecutorProvider for this service. */ - public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { - return MessagingStubSettings.defaultExecutorProviderBuilder(); - } - - /** Returns the default service endpoint. */ - public static String getDefaultEndpoint() { - return MessagingStubSettings.getDefaultEndpoint(); - } - - /** Returns the default service scopes. */ - public static List getDefaultServiceScopes() { - return MessagingStubSettings.getDefaultServiceScopes(); - } - - /** Returns a builder for the default credentials for this service. */ - public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { - return MessagingStubSettings.defaultCredentialsProviderBuilder(); - } - - /** Returns a builder for the default gRPC ChannelProvider for this service. */ - public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { - return MessagingStubSettings.defaultGrpcTransportProviderBuilder(); - } - - /** Returns a builder for the default REST ChannelProvider for this service. */ - @BetaApi - public static InstantiatingHttpJsonChannelProvider.Builder - defaultHttpJsonTransportProviderBuilder() { - return MessagingStubSettings.defaultHttpJsonTransportProviderBuilder(); - } - - public static TransportChannelProvider defaultTransportChannelProvider() { - return MessagingStubSettings.defaultTransportChannelProvider(); - } - - @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") - public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { - return MessagingStubSettings.defaultApiClientHeaderProviderBuilder(); - } - - /** Returns a new gRPC builder for this class. */ - public static Builder newBuilder() { - return Builder.createDefault(); - } - - /** Returns a new REST builder for this class. */ - @BetaApi - public static Builder newHttpJsonBuilder() { - return Builder.createHttpJsonDefault(); - } - - /** 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 MessagingSettings(Builder settingsBuilder) throws IOException { - super(settingsBuilder); - } - - /** Builder for MessagingSettings. */ - public static class Builder extends ClientSettings.Builder { - - protected Builder() throws IOException { - this(((ClientContext) null)); - } - - protected Builder(ClientContext clientContext) { - super(MessagingStubSettings.newBuilder(clientContext)); - } - - protected Builder(MessagingSettings settings) { - super(settings.getStubSettings().toBuilder()); - } - - protected Builder(MessagingStubSettings.Builder stubSettings) { - super(stubSettings); - } - - private static Builder createDefault() { - return new Builder(MessagingStubSettings.newBuilder()); - } - - @BetaApi - private static Builder createHttpJsonDefault() { - return new Builder(MessagingStubSettings.newHttpJsonBuilder()); - } - - public MessagingStubSettings.Builder getStubSettingsBuilder() { - return ((MessagingStubSettings.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 createRoom. */ - public UnaryCallSettings.Builder createRoomSettings() { - return getStubSettingsBuilder().createRoomSettings(); - } - - /** Returns the builder for the settings used for calls to getRoom. */ - public UnaryCallSettings.Builder getRoomSettings() { - return getStubSettingsBuilder().getRoomSettings(); - } - - /** Returns the builder for the settings used for calls to updateRoom. */ - public UnaryCallSettings.Builder updateRoomSettings() { - return getStubSettingsBuilder().updateRoomSettings(); - } - - /** Returns the builder for the settings used for calls to deleteRoom. */ - public UnaryCallSettings.Builder deleteRoomSettings() { - return getStubSettingsBuilder().deleteRoomSettings(); - } - - /** Returns the builder for the settings used for calls to listRooms. */ - public PagedCallSettings.Builder - listRoomsSettings() { - return getStubSettingsBuilder().listRoomsSettings(); - } - - /** Returns the builder for the settings used for calls to createBlurb. */ - public UnaryCallSettings.Builder createBlurbSettings() { - return getStubSettingsBuilder().createBlurbSettings(); - } - - /** Returns the builder for the settings used for calls to getBlurb. */ - public UnaryCallSettings.Builder getBlurbSettings() { - return getStubSettingsBuilder().getBlurbSettings(); - } - - /** Returns the builder for the settings used for calls to updateBlurb. */ - public UnaryCallSettings.Builder updateBlurbSettings() { - return getStubSettingsBuilder().updateBlurbSettings(); - } - - /** Returns the builder for the settings used for calls to deleteBlurb. */ - public UnaryCallSettings.Builder deleteBlurbSettings() { - return getStubSettingsBuilder().deleteBlurbSettings(); - } - - /** Returns the builder for the settings used for calls to listBlurbs. */ - public PagedCallSettings.Builder - listBlurbsSettings() { - return getStubSettingsBuilder().listBlurbsSettings(); - } - - /** Returns the builder for the settings used for calls to searchBlurbs. */ - public UnaryCallSettings.Builder searchBlurbsSettings() { - return getStubSettingsBuilder().searchBlurbsSettings(); - } - - /** Returns the builder for the settings used for calls to searchBlurbs. */ - public OperationCallSettings.Builder< - SearchBlurbsRequest, SearchBlurbsResponse, SearchBlurbsMetadata> - searchBlurbsOperationSettings() { - return getStubSettingsBuilder().searchBlurbsOperationSettings(); - } - - /** Returns the builder for the settings used for calls to streamBlurbs. */ - public ServerStreamingCallSettings.Builder - streamBlurbsSettings() { - return getStubSettingsBuilder().streamBlurbsSettings(); - } - - /** Returns the builder for the settings used for calls to sendBlurbs. */ - public StreamingCallSettings.Builder - sendBlurbsSettings() { - return getStubSettingsBuilder().sendBlurbsSettings(); - } - - /** Returns the builder for the settings used for calls to connect. */ - public StreamingCallSettings.Builder connectSettings() { - return getStubSettingsBuilder().connectSettings(); - } - - @Override - public MessagingSettings build() throws IOException { - return new MessagingSettings(this); - } - } -} diff --git a/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/SequenceServiceClient.java b/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/SequenceServiceClient.java deleted file mode 100644 index 3a5221b5ef..0000000000 --- a/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/SequenceServiceClient.java +++ /dev/null @@ -1,498 +0,0 @@ -/* - * 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 - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1; - -import com.google.api.core.BetaApi; -import com.google.api.gax.core.BackgroundResource; -import com.google.api.gax.rpc.UnaryCallable; -import com.google.protobuf.Empty; -import com.google.showcase.v1beta1.stub.SequenceServiceStub; -import com.google.showcase.v1beta1.stub.SequenceServiceStubSettings; -import java.io.IOException; -import java.util.concurrent.TimeUnit; -import javax.annotation.Generated; - -// AUTO-GENERATED DOCUMENTATION AND CLASS. -/** - * 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 (SequenceServiceClient sequenceServiceClient = SequenceServiceClient.create()) {
        - *   Sequence sequence = Sequence.newBuilder().build();
        - *   Sequence response = sequenceServiceClient.createSequence(sequence);
        - * }
        - * }
        - * - *

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

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

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

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

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

        This class can be customized by passing in a custom instance of SequenceServiceSettings 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
        - * SequenceServiceSettings sequenceServiceSettings =
        - *     SequenceServiceSettings.newBuilder()
        - *         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
        - *         .build();
        - * SequenceServiceClient sequenceServiceClient =
        - *     SequenceServiceClient.create(sequenceServiceSettings);
        - * }
        - * - *

        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
        - * SequenceServiceSettings sequenceServiceSettings =
        - *     SequenceServiceSettings.newBuilder().setEndpoint(myEndpoint).build();
        - * SequenceServiceClient sequenceServiceClient =
        - *     SequenceServiceClient.create(sequenceServiceSettings);
        - * }
        - * - *

        To use REST (HTTP1.1/JSON) transport (instead of gRPC) for sending and receiving requests over - * the wire: - * - *

        {@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
        - * SequenceServiceSettings sequenceServiceSettings =
        - *     SequenceServiceSettings.newHttpJsonBuilder().build();
        - * SequenceServiceClient sequenceServiceClient =
        - *     SequenceServiceClient.create(sequenceServiceSettings);
        - * }
        - * - *

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

        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 (SequenceServiceClient sequenceServiceClient = SequenceServiceClient.create()) {
        -   *   Sequence sequence = Sequence.newBuilder().build();
        -   *   Sequence response = sequenceServiceClient.createSequence(sequence);
        -   * }
        -   * }
        - * - * @param sequence - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final Sequence createSequence(Sequence sequence) { - CreateSequenceRequest request = - CreateSequenceRequest.newBuilder().setSequence(sequence).build(); - return createSequence(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Creates a sequence. - * - *

        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 (SequenceServiceClient sequenceServiceClient = SequenceServiceClient.create()) {
        -   *   CreateSequenceRequest request =
        -   *       CreateSequenceRequest.newBuilder().setSequence(Sequence.newBuilder().build()).build();
        -   *   Sequence response = sequenceServiceClient.createSequence(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 Sequence createSequence(CreateSequenceRequest request) { - return createSequenceCallable().call(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Creates a sequence. - * - *

        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 (SequenceServiceClient sequenceServiceClient = SequenceServiceClient.create()) {
        -   *   CreateSequenceRequest request =
        -   *       CreateSequenceRequest.newBuilder().setSequence(Sequence.newBuilder().build()).build();
        -   *   ApiFuture future =
        -   *       sequenceServiceClient.createSequenceCallable().futureCall(request);
        -   *   // Do something.
        -   *   Sequence response = future.get();
        -   * }
        -   * }
        - */ - public final UnaryCallable createSequenceCallable() { - return stub.createSequenceCallable(); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Retrieves a sequence. - * - *

        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 (SequenceServiceClient sequenceServiceClient = SequenceServiceClient.create()) {
        -   *   SequenceReportName name = SequenceReportName.of("[SEQUENCE]");
        -   *   SequenceReport response = sequenceServiceClient.getSequenceReport(name);
        -   * }
        -   * }
        - * - * @param name - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final SequenceReport getSequenceReport(SequenceReportName name) { - GetSequenceReportRequest request = - GetSequenceReportRequest.newBuilder() - .setName(name == null ? null : name.toString()) - .build(); - return getSequenceReport(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Retrieves a sequence. - * - *

        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 (SequenceServiceClient sequenceServiceClient = SequenceServiceClient.create()) {
        -   *   String name = SequenceReportName.of("[SEQUENCE]").toString();
        -   *   SequenceReport response = sequenceServiceClient.getSequenceReport(name);
        -   * }
        -   * }
        - * - * @param name - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final SequenceReport getSequenceReport(String name) { - GetSequenceReportRequest request = GetSequenceReportRequest.newBuilder().setName(name).build(); - return getSequenceReport(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Retrieves a sequence. - * - *

        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 (SequenceServiceClient sequenceServiceClient = SequenceServiceClient.create()) {
        -   *   GetSequenceReportRequest request =
        -   *       GetSequenceReportRequest.newBuilder()
        -   *           .setName(SequenceReportName.of("[SEQUENCE]").toString())
        -   *           .build();
        -   *   SequenceReport response = sequenceServiceClient.getSequenceReport(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 SequenceReport getSequenceReport(GetSequenceReportRequest request) { - return getSequenceReportCallable().call(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Retrieves a sequence. - * - *

        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 (SequenceServiceClient sequenceServiceClient = SequenceServiceClient.create()) {
        -   *   GetSequenceReportRequest request =
        -   *       GetSequenceReportRequest.newBuilder()
        -   *           .setName(SequenceReportName.of("[SEQUENCE]").toString())
        -   *           .build();
        -   *   ApiFuture future =
        -   *       sequenceServiceClient.getSequenceReportCallable().futureCall(request);
        -   *   // Do something.
        -   *   SequenceReport response = future.get();
        -   * }
        -   * }
        - */ - public final UnaryCallable getSequenceReportCallable() { - return stub.getSequenceReportCallable(); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Attempts a sequence. - * - *

        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 (SequenceServiceClient sequenceServiceClient = SequenceServiceClient.create()) {
        -   *   SequenceName name = SequenceName.of("[SEQUENCE]");
        -   *   sequenceServiceClient.attemptSequence(name);
        -   * }
        -   * }
        - * - * @param name - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final void attemptSequence(SequenceName name) { - AttemptSequenceRequest request = - AttemptSequenceRequest.newBuilder().setName(name == null ? null : name.toString()).build(); - attemptSequence(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Attempts a sequence. - * - *

        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 (SequenceServiceClient sequenceServiceClient = SequenceServiceClient.create()) {
        -   *   String name = SequenceName.of("[SEQUENCE]").toString();
        -   *   sequenceServiceClient.attemptSequence(name);
        -   * }
        -   * }
        - * - * @param name - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final void attemptSequence(String name) { - AttemptSequenceRequest request = AttemptSequenceRequest.newBuilder().setName(name).build(); - attemptSequence(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Attempts a sequence. - * - *

        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 (SequenceServiceClient sequenceServiceClient = SequenceServiceClient.create()) {
        -   *   AttemptSequenceRequest request =
        -   *       AttemptSequenceRequest.newBuilder()
        -   *           .setName(SequenceName.of("[SEQUENCE]").toString())
        -   *           .build();
        -   *   sequenceServiceClient.attemptSequence(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 attemptSequence(AttemptSequenceRequest request) { - attemptSequenceCallable().call(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Attempts a sequence. - * - *

        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 (SequenceServiceClient sequenceServiceClient = SequenceServiceClient.create()) {
        -   *   AttemptSequenceRequest request =
        -   *       AttemptSequenceRequest.newBuilder()
        -   *           .setName(SequenceName.of("[SEQUENCE]").toString())
        -   *           .build();
        -   *   ApiFuture future = sequenceServiceClient.attemptSequenceCallable().futureCall(request);
        -   *   // Do something.
        -   *   future.get();
        -   * }
        -   * }
        - */ - public final UnaryCallable attemptSequenceCallable() { - return stub.attemptSequenceCallable(); - } - - @Override - public final void close() { - stub.close(); - } - - @Override - public void shutdown() { - stub.shutdown(); - } - - @Override - public boolean isShutdown() { - return stub.isShutdown(); - } - - @Override - public boolean isTerminated() { - return stub.isTerminated(); - } - - @Override - public void shutdownNow() { - stub.shutdownNow(); - } - - @Override - public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { - return stub.awaitTermination(duration, unit); - } -} diff --git a/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/SequenceServiceSettings.java b/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/SequenceServiceSettings.java deleted file mode 100644 index 7b6225a1ee..0000000000 --- a/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/SequenceServiceSettings.java +++ /dev/null @@ -1,229 +0,0 @@ -/* - * 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 - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1; - -import com.google.api.core.ApiFunction; -import com.google.api.core.BetaApi; -import com.google.api.gax.core.GoogleCredentialsProvider; -import com.google.api.gax.core.InstantiatingExecutorProvider; -import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; -import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; -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.StubSettings; -import com.google.api.gax.rpc.TransportChannelProvider; -import com.google.api.gax.rpc.UnaryCallSettings; -import com.google.protobuf.Empty; -import com.google.showcase.v1beta1.stub.SequenceServiceStubSettings; -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 SequenceServiceClient}. - * - *

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

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

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

        For example, to set the total timeout of createSequence to 30 seconds: - * - *

        {@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
        - * SequenceServiceSettings.Builder sequenceServiceSettingsBuilder =
        - *     SequenceServiceSettings.newBuilder();
        - * sequenceServiceSettingsBuilder
        - *     .createSequenceSettings()
        - *     .setRetrySettings(
        - *         sequenceServiceSettingsBuilder
        - *             .createSequenceSettings()
        - *             .getRetrySettings()
        - *             .toBuilder()
        - *             .setTotalTimeout(Duration.ofSeconds(30))
        - *             .build());
        - * SequenceServiceSettings sequenceServiceSettings = sequenceServiceSettingsBuilder.build();
        - * }
        - */ -@BetaApi -@Generated("by gapic-generator-java") -public class SequenceServiceSettings extends ClientSettings { - - /** Returns the object with the settings used for calls to createSequence. */ - public UnaryCallSettings createSequenceSettings() { - return ((SequenceServiceStubSettings) getStubSettings()).createSequenceSettings(); - } - - /** Returns the object with the settings used for calls to getSequenceReport. */ - public UnaryCallSettings getSequenceReportSettings() { - return ((SequenceServiceStubSettings) getStubSettings()).getSequenceReportSettings(); - } - - /** Returns the object with the settings used for calls to attemptSequence. */ - public UnaryCallSettings attemptSequenceSettings() { - return ((SequenceServiceStubSettings) getStubSettings()).attemptSequenceSettings(); - } - - public static final SequenceServiceSettings create(SequenceServiceStubSettings stub) - throws IOException { - return new SequenceServiceSettings.Builder(stub.toBuilder()).build(); - } - - /** Returns a builder for the default ExecutorProvider for this service. */ - public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { - return SequenceServiceStubSettings.defaultExecutorProviderBuilder(); - } - - /** Returns the default service endpoint. */ - public static String getDefaultEndpoint() { - return SequenceServiceStubSettings.getDefaultEndpoint(); - } - - /** Returns the default service scopes. */ - public static List getDefaultServiceScopes() { - return SequenceServiceStubSettings.getDefaultServiceScopes(); - } - - /** Returns a builder for the default credentials for this service. */ - public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { - return SequenceServiceStubSettings.defaultCredentialsProviderBuilder(); - } - - /** Returns a builder for the default gRPC ChannelProvider for this service. */ - public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { - return SequenceServiceStubSettings.defaultGrpcTransportProviderBuilder(); - } - - /** Returns a builder for the default REST ChannelProvider for this service. */ - @BetaApi - public static InstantiatingHttpJsonChannelProvider.Builder - defaultHttpJsonTransportProviderBuilder() { - return SequenceServiceStubSettings.defaultHttpJsonTransportProviderBuilder(); - } - - public static TransportChannelProvider defaultTransportChannelProvider() { - return SequenceServiceStubSettings.defaultTransportChannelProvider(); - } - - @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") - public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { - return SequenceServiceStubSettings.defaultApiClientHeaderProviderBuilder(); - } - - /** Returns a new gRPC builder for this class. */ - public static Builder newBuilder() { - return Builder.createDefault(); - } - - /** Returns a new REST builder for this class. */ - @BetaApi - public static Builder newHttpJsonBuilder() { - return Builder.createHttpJsonDefault(); - } - - /** 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 SequenceServiceSettings(Builder settingsBuilder) throws IOException { - super(settingsBuilder); - } - - /** Builder for SequenceServiceSettings. */ - public static class Builder extends ClientSettings.Builder { - - protected Builder() throws IOException { - this(((ClientContext) null)); - } - - protected Builder(ClientContext clientContext) { - super(SequenceServiceStubSettings.newBuilder(clientContext)); - } - - protected Builder(SequenceServiceSettings settings) { - super(settings.getStubSettings().toBuilder()); - } - - protected Builder(SequenceServiceStubSettings.Builder stubSettings) { - super(stubSettings); - } - - private static Builder createDefault() { - return new Builder(SequenceServiceStubSettings.newBuilder()); - } - - @BetaApi - private static Builder createHttpJsonDefault() { - return new Builder(SequenceServiceStubSettings.newHttpJsonBuilder()); - } - - public SequenceServiceStubSettings.Builder getStubSettingsBuilder() { - return ((SequenceServiceStubSettings.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 createSequence. */ - public UnaryCallSettings.Builder createSequenceSettings() { - return getStubSettingsBuilder().createSequenceSettings(); - } - - /** Returns the builder for the settings used for calls to getSequenceReport. */ - public UnaryCallSettings.Builder - getSequenceReportSettings() { - return getStubSettingsBuilder().getSequenceReportSettings(); - } - - /** Returns the builder for the settings used for calls to attemptSequence. */ - public UnaryCallSettings.Builder attemptSequenceSettings() { - return getStubSettingsBuilder().attemptSequenceSettings(); - } - - @Override - public SequenceServiceSettings build() throws IOException { - return new SequenceServiceSettings(this); - } - } -} diff --git a/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/TestingClient.java b/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/TestingClient.java deleted file mode 100644 index 9cf8b16a13..0000000000 --- a/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/TestingClient.java +++ /dev/null @@ -1,880 +0,0 @@ -/* - * 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 - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1; - -import com.google.api.core.ApiFuture; -import com.google.api.core.ApiFutures; -import com.google.api.core.BetaApi; -import com.google.api.gax.core.BackgroundResource; -import com.google.api.gax.paging.AbstractFixedSizeCollection; -import com.google.api.gax.paging.AbstractPage; -import com.google.api.gax.paging.AbstractPagedListResponse; -import com.google.api.gax.rpc.PageContext; -import com.google.api.gax.rpc.UnaryCallable; -import com.google.common.util.concurrent.MoreExecutors; -import com.google.protobuf.Empty; -import com.google.showcase.v1beta1.stub.TestingStub; -import com.google.showcase.v1beta1.stub.TestingStubSettings; -import java.io.IOException; -import java.util.List; -import java.util.concurrent.TimeUnit; -import javax.annotation.Generated; - -// AUTO-GENERATED DOCUMENTATION AND CLASS. -/** - * Service Description: A service to facilitate running discrete sets of tests against Showcase. - * - *

        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 (TestingClient testingClient = TestingClient.create()) {
        - *   CreateSessionRequest request =
        - *       CreateSessionRequest.newBuilder().setSession(Session.newBuilder().build()).build();
        - *   Session response = testingClient.createSession(request);
        - * }
        - * }
        - * - *

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

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

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

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

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

        This class can be customized by passing in a custom instance of TestingSettings 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
        - * TestingSettings testingSettings =
        - *     TestingSettings.newBuilder()
        - *         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
        - *         .build();
        - * TestingClient testingClient = TestingClient.create(testingSettings);
        - * }
        - * - *

        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
        - * TestingSettings testingSettings = TestingSettings.newBuilder().setEndpoint(myEndpoint).build();
        - * TestingClient testingClient = TestingClient.create(testingSettings);
        - * }
        - * - *

        To use REST (HTTP1.1/JSON) transport (instead of gRPC) for sending and receiving requests over - * the wire: - * - *

        {@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
        - * TestingSettings testingSettings = TestingSettings.newHttpJsonBuilder().build();
        - * TestingClient testingClient = TestingClient.create(testingSettings);
        - * }
        - * - *

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

        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 (TestingClient testingClient = TestingClient.create()) {
        -   *   CreateSessionRequest request =
        -   *       CreateSessionRequest.newBuilder().setSession(Session.newBuilder().build()).build();
        -   *   Session response = testingClient.createSession(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 Session createSession(CreateSessionRequest request) { - return createSessionCallable().call(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Creates a new testing session. - * - *

        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 (TestingClient testingClient = TestingClient.create()) {
        -   *   CreateSessionRequest request =
        -   *       CreateSessionRequest.newBuilder().setSession(Session.newBuilder().build()).build();
        -   *   ApiFuture future = testingClient.createSessionCallable().futureCall(request);
        -   *   // Do something.
        -   *   Session response = future.get();
        -   * }
        -   * }
        - */ - public final UnaryCallable createSessionCallable() { - return stub.createSessionCallable(); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Gets a testing session. - * - *

        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 (TestingClient testingClient = TestingClient.create()) {
        -   *   GetSessionRequest request =
        -   *       GetSessionRequest.newBuilder().setName(SessionName.of("[SESSION]").toString()).build();
        -   *   Session response = testingClient.getSession(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 Session getSession(GetSessionRequest request) { - return getSessionCallable().call(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Gets a testing session. - * - *

        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 (TestingClient testingClient = TestingClient.create()) {
        -   *   GetSessionRequest request =
        -   *       GetSessionRequest.newBuilder().setName(SessionName.of("[SESSION]").toString()).build();
        -   *   ApiFuture future = testingClient.getSessionCallable().futureCall(request);
        -   *   // Do something.
        -   *   Session response = future.get();
        -   * }
        -   * }
        - */ - public final UnaryCallable getSessionCallable() { - return stub.getSessionCallable(); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Lists the current test sessions. - * - *

        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 (TestingClient testingClient = TestingClient.create()) {
        -   *   ListSessionsRequest request =
        -   *       ListSessionsRequest.newBuilder()
        -   *           .setPageSize(883849137)
        -   *           .setPageToken("pageToken873572522")
        -   *           .build();
        -   *   for (Session element : testingClient.listSessions(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 ListSessionsPagedResponse listSessions(ListSessionsRequest request) { - return listSessionsPagedCallable().call(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Lists the current test sessions. - * - *

        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 (TestingClient testingClient = TestingClient.create()) {
        -   *   ListSessionsRequest request =
        -   *       ListSessionsRequest.newBuilder()
        -   *           .setPageSize(883849137)
        -   *           .setPageToken("pageToken873572522")
        -   *           .build();
        -   *   ApiFuture future = testingClient.listSessionsPagedCallable().futureCall(request);
        -   *   // Do something.
        -   *   for (Session element : future.get().iterateAll()) {
        -   *     // doThingsWith(element);
        -   *   }
        -   * }
        -   * }
        - */ - public final UnaryCallable - listSessionsPagedCallable() { - return stub.listSessionsPagedCallable(); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Lists the current test sessions. - * - *

        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 (TestingClient testingClient = TestingClient.create()) {
        -   *   ListSessionsRequest request =
        -   *       ListSessionsRequest.newBuilder()
        -   *           .setPageSize(883849137)
        -   *           .setPageToken("pageToken873572522")
        -   *           .build();
        -   *   while (true) {
        -   *     ListSessionsResponse response = testingClient.listSessionsCallable().call(request);
        -   *     for (Session element : response.getSessionsList()) {
        -   *       // doThingsWith(element);
        -   *     }
        -   *     String nextPageToken = response.getNextPageToken();
        -   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
        -   *       request = request.toBuilder().setPageToken(nextPageToken).build();
        -   *     } else {
        -   *       break;
        -   *     }
        -   *   }
        -   * }
        -   * }
        - */ - public final UnaryCallable listSessionsCallable() { - return stub.listSessionsCallable(); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Delete a test session. - * - *

        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 (TestingClient testingClient = TestingClient.create()) {
        -   *   DeleteSessionRequest request =
        -   *       DeleteSessionRequest.newBuilder().setName(SessionName.of("[SESSION]").toString()).build();
        -   *   testingClient.deleteSession(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 deleteSession(DeleteSessionRequest request) { - deleteSessionCallable().call(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Delete a test session. - * - *

        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 (TestingClient testingClient = TestingClient.create()) {
        -   *   DeleteSessionRequest request =
        -   *       DeleteSessionRequest.newBuilder().setName(SessionName.of("[SESSION]").toString()).build();
        -   *   ApiFuture future = testingClient.deleteSessionCallable().futureCall(request);
        -   *   // Do something.
        -   *   future.get();
        -   * }
        -   * }
        - */ - public final UnaryCallable deleteSessionCallable() { - return stub.deleteSessionCallable(); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Report on the status of a session. This generates a report detailing which tests have been - * completed, and an overall rollup. - * - *

        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 (TestingClient testingClient = TestingClient.create()) {
        -   *   ReportSessionRequest request =
        -   *       ReportSessionRequest.newBuilder().setName(SessionName.of("[SESSION]").toString()).build();
        -   *   ReportSessionResponse response = testingClient.reportSession(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 ReportSessionResponse reportSession(ReportSessionRequest request) { - return reportSessionCallable().call(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Report on the status of a session. This generates a report detailing which tests have been - * completed, and an overall rollup. - * - *

        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 (TestingClient testingClient = TestingClient.create()) {
        -   *   ReportSessionRequest request =
        -   *       ReportSessionRequest.newBuilder().setName(SessionName.of("[SESSION]").toString()).build();
        -   *   ApiFuture future =
        -   *       testingClient.reportSessionCallable().futureCall(request);
        -   *   // Do something.
        -   *   ReportSessionResponse response = future.get();
        -   * }
        -   * }
        - */ - public final UnaryCallable reportSessionCallable() { - return stub.reportSessionCallable(); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * List the tests of a sessesion. - * - *

        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 (TestingClient testingClient = TestingClient.create()) {
        -   *   ListTestsRequest request =
        -   *       ListTestsRequest.newBuilder()
        -   *           .setParent(SessionName.of("[SESSION]").toString())
        -   *           .setPageSize(883849137)
        -   *           .setPageToken("pageToken873572522")
        -   *           .build();
        -   *   for (Test element : testingClient.listTests(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 ListTestsPagedResponse listTests(ListTestsRequest request) { - return listTestsPagedCallable().call(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * List the tests of a sessesion. - * - *

        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 (TestingClient testingClient = TestingClient.create()) {
        -   *   ListTestsRequest request =
        -   *       ListTestsRequest.newBuilder()
        -   *           .setParent(SessionName.of("[SESSION]").toString())
        -   *           .setPageSize(883849137)
        -   *           .setPageToken("pageToken873572522")
        -   *           .build();
        -   *   ApiFuture future = testingClient.listTestsPagedCallable().futureCall(request);
        -   *   // Do something.
        -   *   for (Test element : future.get().iterateAll()) {
        -   *     // doThingsWith(element);
        -   *   }
        -   * }
        -   * }
        - */ - public final UnaryCallable listTestsPagedCallable() { - return stub.listTestsPagedCallable(); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * List the tests of a sessesion. - * - *

        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 (TestingClient testingClient = TestingClient.create()) {
        -   *   ListTestsRequest request =
        -   *       ListTestsRequest.newBuilder()
        -   *           .setParent(SessionName.of("[SESSION]").toString())
        -   *           .setPageSize(883849137)
        -   *           .setPageToken("pageToken873572522")
        -   *           .build();
        -   *   while (true) {
        -   *     ListTestsResponse response = testingClient.listTestsCallable().call(request);
        -   *     for (Test element : response.getTestsList()) {
        -   *       // doThingsWith(element);
        -   *     }
        -   *     String nextPageToken = response.getNextPageToken();
        -   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
        -   *       request = request.toBuilder().setPageToken(nextPageToken).build();
        -   *     } else {
        -   *       break;
        -   *     }
        -   *   }
        -   * }
        -   * }
        - */ - public final UnaryCallable listTestsCallable() { - return stub.listTestsCallable(); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Explicitly decline to implement a test. - * - *

        This removes the test from subsequent `ListTests` calls, and attempting to do the test will - * error. - * - *

        This method will error if attempting to delete a required test. - * - *

        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 (TestingClient testingClient = TestingClient.create()) {
        -   *   DeleteTestRequest request =
        -   *       DeleteTestRequest.newBuilder()
        -   *           .setName(TestName.of("[SESSION]", "[TEST]").toString())
        -   *           .build();
        -   *   testingClient.deleteTest(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 deleteTest(DeleteTestRequest request) { - deleteTestCallable().call(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Explicitly decline to implement a test. - * - *

        This removes the test from subsequent `ListTests` calls, and attempting to do the test will - * error. - * - *

        This method will error if attempting to delete a required test. - * - *

        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 (TestingClient testingClient = TestingClient.create()) {
        -   *   DeleteTestRequest request =
        -   *       DeleteTestRequest.newBuilder()
        -   *           .setName(TestName.of("[SESSION]", "[TEST]").toString())
        -   *           .build();
        -   *   ApiFuture future = testingClient.deleteTestCallable().futureCall(request);
        -   *   // Do something.
        -   *   future.get();
        -   * }
        -   * }
        - */ - public final UnaryCallable deleteTestCallable() { - return stub.deleteTestCallable(); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Register a response to a test. - * - *

        In cases where a test involves registering a final answer at the end of the test, this - * method provides the means to do so. - * - *

        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 (TestingClient testingClient = TestingClient.create()) {
        -   *   VerifyTestRequest request =
        -   *       VerifyTestRequest.newBuilder()
        -   *           .setName(TestName.of("[SESSION]", "[TEST]").toString())
        -   *           .setAnswer(ByteString.EMPTY)
        -   *           .addAllAnswers(new ArrayList())
        -   *           .build();
        -   *   VerifyTestResponse response = testingClient.verifyTest(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 VerifyTestResponse verifyTest(VerifyTestRequest request) { - return verifyTestCallable().call(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Register a response to a test. - * - *

        In cases where a test involves registering a final answer at the end of the test, this - * method provides the means to do so. - * - *

        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 (TestingClient testingClient = TestingClient.create()) {
        -   *   VerifyTestRequest request =
        -   *       VerifyTestRequest.newBuilder()
        -   *           .setName(TestName.of("[SESSION]", "[TEST]").toString())
        -   *           .setAnswer(ByteString.EMPTY)
        -   *           .addAllAnswers(new ArrayList())
        -   *           .build();
        -   *   ApiFuture future = testingClient.verifyTestCallable().futureCall(request);
        -   *   // Do something.
        -   *   VerifyTestResponse response = future.get();
        -   * }
        -   * }
        - */ - public final UnaryCallable verifyTestCallable() { - return stub.verifyTestCallable(); - } - - @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 ListSessionsPagedResponse - extends AbstractPagedListResponse< - ListSessionsRequest, - ListSessionsResponse, - Session, - ListSessionsPage, - ListSessionsFixedSizeCollection> { - - public static ApiFuture createAsync( - PageContext context, - ApiFuture futureResponse) { - ApiFuture futurePage = - ListSessionsPage.createEmptyPage().createPageAsync(context, futureResponse); - return ApiFutures.transform( - futurePage, - input -> new ListSessionsPagedResponse(input), - MoreExecutors.directExecutor()); - } - - private ListSessionsPagedResponse(ListSessionsPage page) { - super(page, ListSessionsFixedSizeCollection.createEmptyCollection()); - } - } - - public static class ListSessionsPage - extends AbstractPage { - - private ListSessionsPage( - PageContext context, - ListSessionsResponse response) { - super(context, response); - } - - private static ListSessionsPage createEmptyPage() { - return new ListSessionsPage(null, null); - } - - @Override - protected ListSessionsPage createPage( - PageContext context, - ListSessionsResponse response) { - return new ListSessionsPage(context, response); - } - - @Override - public ApiFuture createPageAsync( - PageContext context, - ApiFuture futureResponse) { - return super.createPageAsync(context, futureResponse); - } - } - - public static class ListSessionsFixedSizeCollection - extends AbstractFixedSizeCollection< - ListSessionsRequest, - ListSessionsResponse, - Session, - ListSessionsPage, - ListSessionsFixedSizeCollection> { - - private ListSessionsFixedSizeCollection(List pages, int collectionSize) { - super(pages, collectionSize); - } - - private static ListSessionsFixedSizeCollection createEmptyCollection() { - return new ListSessionsFixedSizeCollection(null, 0); - } - - @Override - protected ListSessionsFixedSizeCollection createCollection( - List pages, int collectionSize) { - return new ListSessionsFixedSizeCollection(pages, collectionSize); - } - } - - public static class ListTestsPagedResponse - extends AbstractPagedListResponse< - ListTestsRequest, ListTestsResponse, Test, ListTestsPage, ListTestsFixedSizeCollection> { - - public static ApiFuture createAsync( - PageContext context, - ApiFuture futureResponse) { - ApiFuture futurePage = - ListTestsPage.createEmptyPage().createPageAsync(context, futureResponse); - return ApiFutures.transform( - futurePage, input -> new ListTestsPagedResponse(input), MoreExecutors.directExecutor()); - } - - private ListTestsPagedResponse(ListTestsPage page) { - super(page, ListTestsFixedSizeCollection.createEmptyCollection()); - } - } - - public static class ListTestsPage - extends AbstractPage { - - private ListTestsPage( - PageContext context, - ListTestsResponse response) { - super(context, response); - } - - private static ListTestsPage createEmptyPage() { - return new ListTestsPage(null, null); - } - - @Override - protected ListTestsPage createPage( - PageContext context, - ListTestsResponse response) { - return new ListTestsPage(context, response); - } - - @Override - public ApiFuture createPageAsync( - PageContext context, - ApiFuture futureResponse) { - return super.createPageAsync(context, futureResponse); - } - } - - public static class ListTestsFixedSizeCollection - extends AbstractFixedSizeCollection< - ListTestsRequest, ListTestsResponse, Test, ListTestsPage, ListTestsFixedSizeCollection> { - - private ListTestsFixedSizeCollection(List pages, int collectionSize) { - super(pages, collectionSize); - } - - private static ListTestsFixedSizeCollection createEmptyCollection() { - return new ListTestsFixedSizeCollection(null, 0); - } - - @Override - protected ListTestsFixedSizeCollection createCollection( - List pages, int collectionSize) { - return new ListTestsFixedSizeCollection(pages, collectionSize); - } - } -} diff --git a/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/TestingSettings.java b/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/TestingSettings.java deleted file mode 100644 index 0a59e67a92..0000000000 --- a/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/TestingSettings.java +++ /dev/null @@ -1,286 +0,0 @@ -/* - * 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 - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1; - -import static com.google.showcase.v1beta1.TestingClient.ListSessionsPagedResponse; -import static com.google.showcase.v1beta1.TestingClient.ListTestsPagedResponse; - -import com.google.api.core.ApiFunction; -import com.google.api.core.BetaApi; -import com.google.api.gax.core.GoogleCredentialsProvider; -import com.google.api.gax.core.InstantiatingExecutorProvider; -import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; -import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; -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.StubSettings; -import com.google.api.gax.rpc.TransportChannelProvider; -import com.google.api.gax.rpc.UnaryCallSettings; -import com.google.protobuf.Empty; -import com.google.showcase.v1beta1.stub.TestingStubSettings; -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 TestingClient}. - * - *

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

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

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

        For example, to set the total timeout of createSession to 30 seconds: - * - *

        {@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
        - * TestingSettings.Builder testingSettingsBuilder = TestingSettings.newBuilder();
        - * testingSettingsBuilder
        - *     .createSessionSettings()
        - *     .setRetrySettings(
        - *         testingSettingsBuilder
        - *             .createSessionSettings()
        - *             .getRetrySettings()
        - *             .toBuilder()
        - *             .setTotalTimeout(Duration.ofSeconds(30))
        - *             .build());
        - * TestingSettings testingSettings = testingSettingsBuilder.build();
        - * }
        - */ -@BetaApi -@Generated("by gapic-generator-java") -public class TestingSettings extends ClientSettings { - - /** Returns the object with the settings used for calls to createSession. */ - public UnaryCallSettings createSessionSettings() { - return ((TestingStubSettings) getStubSettings()).createSessionSettings(); - } - - /** Returns the object with the settings used for calls to getSession. */ - public UnaryCallSettings getSessionSettings() { - return ((TestingStubSettings) getStubSettings()).getSessionSettings(); - } - - /** Returns the object with the settings used for calls to listSessions. */ - public PagedCallSettings - listSessionsSettings() { - return ((TestingStubSettings) getStubSettings()).listSessionsSettings(); - } - - /** Returns the object with the settings used for calls to deleteSession. */ - public UnaryCallSettings deleteSessionSettings() { - return ((TestingStubSettings) getStubSettings()).deleteSessionSettings(); - } - - /** Returns the object with the settings used for calls to reportSession. */ - public UnaryCallSettings reportSessionSettings() { - return ((TestingStubSettings) getStubSettings()).reportSessionSettings(); - } - - /** Returns the object with the settings used for calls to listTests. */ - public PagedCallSettings - listTestsSettings() { - return ((TestingStubSettings) getStubSettings()).listTestsSettings(); - } - - /** Returns the object with the settings used for calls to deleteTest. */ - public UnaryCallSettings deleteTestSettings() { - return ((TestingStubSettings) getStubSettings()).deleteTestSettings(); - } - - /** Returns the object with the settings used for calls to verifyTest. */ - public UnaryCallSettings verifyTestSettings() { - return ((TestingStubSettings) getStubSettings()).verifyTestSettings(); - } - - public static final TestingSettings create(TestingStubSettings stub) throws IOException { - return new TestingSettings.Builder(stub.toBuilder()).build(); - } - - /** Returns a builder for the default ExecutorProvider for this service. */ - public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { - return TestingStubSettings.defaultExecutorProviderBuilder(); - } - - /** Returns the default service endpoint. */ - public static String getDefaultEndpoint() { - return TestingStubSettings.getDefaultEndpoint(); - } - - /** Returns the default service scopes. */ - public static List getDefaultServiceScopes() { - return TestingStubSettings.getDefaultServiceScopes(); - } - - /** Returns a builder for the default credentials for this service. */ - public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { - return TestingStubSettings.defaultCredentialsProviderBuilder(); - } - - /** Returns a builder for the default gRPC ChannelProvider for this service. */ - public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { - return TestingStubSettings.defaultGrpcTransportProviderBuilder(); - } - - /** Returns a builder for the default REST ChannelProvider for this service. */ - @BetaApi - public static InstantiatingHttpJsonChannelProvider.Builder - defaultHttpJsonTransportProviderBuilder() { - return TestingStubSettings.defaultHttpJsonTransportProviderBuilder(); - } - - public static TransportChannelProvider defaultTransportChannelProvider() { - return TestingStubSettings.defaultTransportChannelProvider(); - } - - @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") - public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { - return TestingStubSettings.defaultApiClientHeaderProviderBuilder(); - } - - /** Returns a new gRPC builder for this class. */ - public static Builder newBuilder() { - return Builder.createDefault(); - } - - /** Returns a new REST builder for this class. */ - @BetaApi - public static Builder newHttpJsonBuilder() { - return Builder.createHttpJsonDefault(); - } - - /** 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 TestingSettings(Builder settingsBuilder) throws IOException { - super(settingsBuilder); - } - - /** Builder for TestingSettings. */ - public static class Builder extends ClientSettings.Builder { - - protected Builder() throws IOException { - this(((ClientContext) null)); - } - - protected Builder(ClientContext clientContext) { - super(TestingStubSettings.newBuilder(clientContext)); - } - - protected Builder(TestingSettings settings) { - super(settings.getStubSettings().toBuilder()); - } - - protected Builder(TestingStubSettings.Builder stubSettings) { - super(stubSettings); - } - - private static Builder createDefault() { - return new Builder(TestingStubSettings.newBuilder()); - } - - @BetaApi - private static Builder createHttpJsonDefault() { - return new Builder(TestingStubSettings.newHttpJsonBuilder()); - } - - public TestingStubSettings.Builder getStubSettingsBuilder() { - return ((TestingStubSettings.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 createSession. */ - public UnaryCallSettings.Builder createSessionSettings() { - return getStubSettingsBuilder().createSessionSettings(); - } - - /** Returns the builder for the settings used for calls to getSession. */ - public UnaryCallSettings.Builder getSessionSettings() { - return getStubSettingsBuilder().getSessionSettings(); - } - - /** Returns the builder for the settings used for calls to listSessions. */ - public PagedCallSettings.Builder< - ListSessionsRequest, ListSessionsResponse, ListSessionsPagedResponse> - listSessionsSettings() { - return getStubSettingsBuilder().listSessionsSettings(); - } - - /** Returns the builder for the settings used for calls to deleteSession. */ - public UnaryCallSettings.Builder deleteSessionSettings() { - return getStubSettingsBuilder().deleteSessionSettings(); - } - - /** Returns the builder for the settings used for calls to reportSession. */ - public UnaryCallSettings.Builder - reportSessionSettings() { - return getStubSettingsBuilder().reportSessionSettings(); - } - - /** Returns the builder for the settings used for calls to listTests. */ - public PagedCallSettings.Builder - listTestsSettings() { - return getStubSettingsBuilder().listTestsSettings(); - } - - /** Returns the builder for the settings used for calls to deleteTest. */ - public UnaryCallSettings.Builder deleteTestSettings() { - return getStubSettingsBuilder().deleteTestSettings(); - } - - /** Returns the builder for the settings used for calls to verifyTest. */ - public UnaryCallSettings.Builder verifyTestSettings() { - return getStubSettingsBuilder().verifyTestSettings(); - } - - @Override - public TestingSettings build() throws IOException { - return new TestingSettings(this); - } - } -} diff --git a/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/gapic_metadata.json b/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/gapic_metadata.json deleted file mode 100644 index 31f51f17ef..0000000000 --- a/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/gapic_metadata.json +++ /dev/null @@ -1,210 +0,0 @@ -{ - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", - "language": "java", - "protoPackage": "google.showcase.v1beta1", - "libraryPackage": "com.google.showcase.v1beta1", - "services": { - "Compliance": { - "clients": { - "grpc": { - "libraryClient": "ComplianceClient", - "rpcs": { - "GetEnum": { - "methods": ["getEnum", "getEnumCallable"] - }, - "RepeatDataBody": { - "methods": ["repeatDataBody", "repeatDataBodyCallable"] - }, - "RepeatDataBodyInfo": { - "methods": ["repeatDataBodyInfo", "repeatDataBodyInfoCallable"] - }, - "RepeatDataBodyPatch": { - "methods": ["repeatDataBodyPatch", "repeatDataBodyPatchCallable"] - }, - "RepeatDataBodyPut": { - "methods": ["repeatDataBodyPut", "repeatDataBodyPutCallable"] - }, - "RepeatDataPathResource": { - "methods": ["repeatDataPathResource", "repeatDataPathResourceCallable"] - }, - "RepeatDataPathTrailingResource": { - "methods": ["repeatDataPathTrailingResource", "repeatDataPathTrailingResourceCallable"] - }, - "RepeatDataQuery": { - "methods": ["repeatDataQuery", "repeatDataQueryCallable"] - }, - "RepeatDataSimplePath": { - "methods": ["repeatDataSimplePath", "repeatDataSimplePathCallable"] - }, - "VerifyEnum": { - "methods": ["verifyEnum", "verifyEnumCallable"] - } - } - } - } - }, - "Echo": { - "clients": { - "grpc": { - "libraryClient": "EchoClient", - "rpcs": { - "Block": { - "methods": ["block", "blockCallable"] - }, - "Chat": { - "methods": ["chatCallable"] - }, - "Collect": { - "methods": ["collectCallable"] - }, - "Echo": { - "methods": ["echo", "echoCallable"] - }, - "Expand": { - "methods": ["expandCallable"] - }, - "PagedExpand": { - "methods": ["pagedExpand", "pagedExpandPagedCallable", "pagedExpandCallable"] - }, - "PagedExpandLegacy": { - "methods": ["pagedExpandLegacy", "pagedExpandLegacyCallable"] - }, - "PagedExpandLegacyMapped": { - "methods": ["pagedExpandLegacyMapped", "pagedExpandLegacyMappedPagedCallable", "pagedExpandLegacyMappedCallable"] - }, - "Wait": { - "methods": ["waitAsync", "waitOperationCallable", "waitCallable"] - } - } - } - } - }, - "Identity": { - "clients": { - "grpc": { - "libraryClient": "IdentityClient", - "rpcs": { - "CreateUser": { - "methods": ["createUser", "createUser", "createUser", "createUserCallable"] - }, - "DeleteUser": { - "methods": ["deleteUser", "deleteUser", "deleteUser", "deleteUserCallable"] - }, - "GetUser": { - "methods": ["getUser", "getUser", "getUser", "getUserCallable"] - }, - "ListUsers": { - "methods": ["listUsers", "listUsersPagedCallable", "listUsersCallable"] - }, - "UpdateUser": { - "methods": ["updateUser", "updateUserCallable"] - } - } - } - } - }, - "Messaging": { - "clients": { - "grpc": { - "libraryClient": "MessagingClient", - "rpcs": { - "Connect": { - "methods": ["connectCallable"] - }, - "CreateBlurb": { - "methods": ["createBlurb", "createBlurb", "createBlurb", "createBlurb", "createBlurb", "createBlurb", "createBlurb", "createBlurb", "createBlurb", "createBlurb", "createBlurb", "createBlurb", "createBlurb", "createBlurbCallable"] - }, - "CreateRoom": { - "methods": ["createRoom", "createRoom", "createRoomCallable"] - }, - "DeleteBlurb": { - "methods": ["deleteBlurb", "deleteBlurb", "deleteBlurb", "deleteBlurbCallable"] - }, - "DeleteRoom": { - "methods": ["deleteRoom", "deleteRoom", "deleteRoom", "deleteRoomCallable"] - }, - "GetBlurb": { - "methods": ["getBlurb", "getBlurb", "getBlurb", "getBlurbCallable"] - }, - "GetRoom": { - "methods": ["getRoom", "getRoom", "getRoom", "getRoomCallable"] - }, - "ListBlurbs": { - "methods": ["listBlurbs", "listBlurbs", "listBlurbs", "listBlurbs", "listBlurbsPagedCallable", "listBlurbsCallable"] - }, - "ListRooms": { - "methods": ["listRooms", "listRoomsPagedCallable", "listRoomsCallable"] - }, - "SearchBlurbs": { - "methods": ["searchBlurbsAsync", "searchBlurbsAsync", "searchBlurbsAsync", "searchBlurbsAsync", "searchBlurbsOperationCallable", "searchBlurbsCallable"] - }, - "SendBlurbs": { - "methods": ["sendBlurbsCallable"] - }, - "StreamBlurbs": { - "methods": ["streamBlurbsCallable"] - }, - "UpdateBlurb": { - "methods": ["updateBlurb", "updateBlurbCallable"] - }, - "UpdateRoom": { - "methods": ["updateRoom", "updateRoomCallable"] - } - } - } - } - }, - "SequenceService": { - "clients": { - "grpc": { - "libraryClient": "SequenceServiceClient", - "rpcs": { - "AttemptSequence": { - "methods": ["attemptSequence", "attemptSequence", "attemptSequence", "attemptSequenceCallable"] - }, - "CreateSequence": { - "methods": ["createSequence", "createSequence", "createSequenceCallable"] - }, - "GetSequenceReport": { - "methods": ["getSequenceReport", "getSequenceReport", "getSequenceReport", "getSequenceReportCallable"] - } - } - } - } - }, - "Testing": { - "clients": { - "grpc": { - "libraryClient": "TestingClient", - "rpcs": { - "CreateSession": { - "methods": ["createSession", "createSessionCallable"] - }, - "DeleteSession": { - "methods": ["deleteSession", "deleteSessionCallable"] - }, - "DeleteTest": { - "methods": ["deleteTest", "deleteTestCallable"] - }, - "GetSession": { - "methods": ["getSession", "getSessionCallable"] - }, - "ListSessions": { - "methods": ["listSessions", "listSessionsPagedCallable", "listSessionsCallable"] - }, - "ListTests": { - "methods": ["listTests", "listTestsPagedCallable", "listTestsCallable"] - }, - "ReportSession": { - "methods": ["reportSession", "reportSessionCallable"] - }, - "VerifyTest": { - "methods": ["verifyTest", "verifyTestCallable"] - } - } - } - } - } - } -} \ No newline at end of file diff --git a/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/package-info.java b/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/package-info.java deleted file mode 100644 index be1926a090..0000000000 --- a/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/package-info.java +++ /dev/null @@ -1,162 +0,0 @@ -/* - * 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 - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT 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 Client Libraries Showcase API - * - *

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

        ======================= ComplianceClient ======================= - * - *

        Service Description: This service is used to test that GAPICs implement various REST-related - * features correctly. This mostly means transcoding proto3 requests to REST format correctly for - * various types of HTTP annotations, but it also includes verifying that unknown (numeric) enums - * received by clients can be round-tripped correctly. - * - *

        Sample for ComplianceClient: - * - *

        {@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 (ComplianceClient complianceClient = ComplianceClient.create()) {
        - *   RepeatRequest request =
        - *       RepeatRequest.newBuilder()
        - *           .setName("name3373707")
        - *           .setInfo(ComplianceData.newBuilder().build())
        - *           .setServerVerify(true)
        - *           .setIntendedBindingUri("intendedBindingUri780142386")
        - *           .setFInt32(-1143775883)
        - *           .setFInt64(-1143775788)
        - *           .setFDouble(-1239459382)
        - *           .setPInt32(-858673665)
        - *           .setPInt64(-858673570)
        - *           .setPDouble(-991225216)
        - *           .build();
        - *   RepeatResponse response = complianceClient.repeatDataBody(request);
        - * }
        - * }
        - * - *

        ======================= EchoClient ======================= - * - *

        Service Description: This service is used showcase the four main types of rpcs - unary, server - * side streaming, client side streaming, and bidirectional streaming. This service also exposes - * methods that explicitly implement server delay, and paginated calls. Set the 'showcase-trailer' - * metadata key on any method to have the values echoed in the response trailers. Set the - * 'x-goog-request-params' metadata key on any method to have the values echoed in the response - * headers. - * - *

        Sample for EchoClient: - * - *

        {@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 (EchoClient echoClient = EchoClient.create()) {
        - *   EchoRequest request =
        - *       EchoRequest.newBuilder()
        - *           .setSeverity(Severity.forNumber(0))
        - *           .setHeader("header-1221270899")
        - *           .setOtherHeader("otherHeader-2026585667")
        - *           .build();
        - *   EchoResponse response = echoClient.echo(request);
        - * }
        - * }
        - * - *

        ======================= IdentityClient ======================= - * - *

        Service Description: A simple identity service. - * - *

        Sample for IdentityClient: - * - *

        {@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 (IdentityClient identityClient = IdentityClient.create()) {
        - *   String displayName = "displayName1714148973";
        - *   String email = "email96619420";
        - *   User response = identityClient.createUser(displayName, email);
        - * }
        - * }
        - * - *

        ======================= MessagingClient ======================= - * - *

        Service Description: A simple messaging service that implements chat rooms and profile posts. - * - *

        This messaging service showcases the features that API clients generated by gapic-generators - * implement. - * - *

        Sample for MessagingClient: - * - *

        {@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 (MessagingClient messagingClient = MessagingClient.create()) {
        - *   String displayName = "displayName1714148973";
        - *   String description = "description-1724546052";
        - *   Room response = messagingClient.createRoom(displayName, description);
        - * }
        - * }
        - * - *

        ======================= SequenceServiceClient ======================= - * - *

        Sample for SequenceServiceClient: - * - *

        {@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 (SequenceServiceClient sequenceServiceClient = SequenceServiceClient.create()) {
        - *   Sequence sequence = Sequence.newBuilder().build();
        - *   Sequence response = sequenceServiceClient.createSequence(sequence);
        - * }
        - * }
        - * - *

        ======================= TestingClient ======================= - * - *

        Service Description: A service to facilitate running discrete sets of tests against Showcase. - * - *

        Sample for TestingClient: - * - *

        {@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 (TestingClient testingClient = TestingClient.create()) {
        - *   CreateSessionRequest request =
        - *       CreateSessionRequest.newBuilder().setSession(Session.newBuilder().build()).build();
        - *   Session response = testingClient.createSession(request);
        - * }
        - * }
        - */ -@Generated("by gapic-generator-java") -package com.google.showcase.v1beta1; - -import javax.annotation.Generated; diff --git a/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/ComplianceStub.java b/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/ComplianceStub.java deleted file mode 100644 index c4f54eb557..0000000000 --- a/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/ComplianceStub.java +++ /dev/null @@ -1,81 +0,0 @@ -/* - * 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 - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1.stub; - -import com.google.api.core.BetaApi; -import com.google.api.gax.core.BackgroundResource; -import com.google.api.gax.rpc.UnaryCallable; -import com.google.showcase.v1beta1.EnumRequest; -import com.google.showcase.v1beta1.EnumResponse; -import com.google.showcase.v1beta1.RepeatRequest; -import com.google.showcase.v1beta1.RepeatResponse; -import javax.annotation.Generated; - -// AUTO-GENERATED DOCUMENTATION AND CLASS. -/** - * Base stub class for the Compliance service API. - * - *

        This class is for advanced usage and reflects the underlying API directly. - */ -@BetaApi -@Generated("by gapic-generator-java") -public abstract class ComplianceStub implements BackgroundResource { - - public UnaryCallable repeatDataBodyCallable() { - throw new UnsupportedOperationException("Not implemented: repeatDataBodyCallable()"); - } - - public UnaryCallable repeatDataBodyInfoCallable() { - throw new UnsupportedOperationException("Not implemented: repeatDataBodyInfoCallable()"); - } - - public UnaryCallable repeatDataQueryCallable() { - throw new UnsupportedOperationException("Not implemented: repeatDataQueryCallable()"); - } - - public UnaryCallable repeatDataSimplePathCallable() { - throw new UnsupportedOperationException("Not implemented: repeatDataSimplePathCallable()"); - } - - public UnaryCallable repeatDataPathResourceCallable() { - throw new UnsupportedOperationException("Not implemented: repeatDataPathResourceCallable()"); - } - - public UnaryCallable repeatDataPathTrailingResourceCallable() { - throw new UnsupportedOperationException( - "Not implemented: repeatDataPathTrailingResourceCallable()"); - } - - public UnaryCallable repeatDataBodyPutCallable() { - throw new UnsupportedOperationException("Not implemented: repeatDataBodyPutCallable()"); - } - - public UnaryCallable repeatDataBodyPatchCallable() { - throw new UnsupportedOperationException("Not implemented: repeatDataBodyPatchCallable()"); - } - - public UnaryCallable getEnumCallable() { - throw new UnsupportedOperationException("Not implemented: getEnumCallable()"); - } - - public UnaryCallable verifyEnumCallable() { - throw new UnsupportedOperationException("Not implemented: verifyEnumCallable()"); - } - - @Override - public abstract void close(); -} diff --git a/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/ComplianceStubSettings.java b/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/ComplianceStubSettings.java deleted file mode 100644 index 67b16b6fac..0000000000 --- a/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/ComplianceStubSettings.java +++ /dev/null @@ -1,526 +0,0 @@ -/* - * 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 - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1.stub; - -import com.google.api.core.ApiFunction; -import com.google.api.core.BetaApi; -import com.google.api.gax.core.GaxProperties; -import com.google.api.gax.core.GoogleCredentialsProvider; -import com.google.api.gax.core.InstantiatingExecutorProvider; -import com.google.api.gax.grpc.GaxGrpcProperties; -import com.google.api.gax.grpc.GrpcTransportChannel; -import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; -import com.google.api.gax.httpjson.GaxHttpJsonProperties; -import com.google.api.gax.httpjson.HttpJsonTransportChannel; -import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; -import com.google.api.gax.retrying.RetrySettings; -import com.google.api.gax.rpc.ApiClientHeaderProvider; -import com.google.api.gax.rpc.ClientContext; -import com.google.api.gax.rpc.StatusCode; -import com.google.api.gax.rpc.StubSettings; -import com.google.api.gax.rpc.TransportChannelProvider; -import com.google.api.gax.rpc.UnaryCallSettings; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import com.google.common.collect.ImmutableSet; -import com.google.common.collect.Lists; -import com.google.showcase.v1beta1.EnumRequest; -import com.google.showcase.v1beta1.EnumResponse; -import com.google.showcase.v1beta1.RepeatRequest; -import com.google.showcase.v1beta1.RepeatResponse; -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 ComplianceStub}. - * - *

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

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

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

        For example, to set the total timeout of repeatDataBody to 30 seconds: - * - *

        {@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
        - * ComplianceStubSettings.Builder complianceSettingsBuilder = ComplianceStubSettings.newBuilder();
        - * complianceSettingsBuilder
        - *     .repeatDataBodySettings()
        - *     .setRetrySettings(
        - *         complianceSettingsBuilder
        - *             .repeatDataBodySettings()
        - *             .getRetrySettings()
        - *             .toBuilder()
        - *             .setTotalTimeout(Duration.ofSeconds(30))
        - *             .build());
        - * ComplianceStubSettings complianceSettings = complianceSettingsBuilder.build();
        - * }
        - */ -@BetaApi -@Generated("by gapic-generator-java") -public class ComplianceStubSettings extends StubSettings { - /** The default scopes of the service. */ - private static final ImmutableList DEFAULT_SERVICE_SCOPES = - ImmutableList.builder().build(); - - private final UnaryCallSettings repeatDataBodySettings; - private final UnaryCallSettings repeatDataBodyInfoSettings; - private final UnaryCallSettings repeatDataQuerySettings; - private final UnaryCallSettings repeatDataSimplePathSettings; - private final UnaryCallSettings repeatDataPathResourceSettings; - private final UnaryCallSettings - repeatDataPathTrailingResourceSettings; - private final UnaryCallSettings repeatDataBodyPutSettings; - private final UnaryCallSettings repeatDataBodyPatchSettings; - private final UnaryCallSettings getEnumSettings; - private final UnaryCallSettings verifyEnumSettings; - - /** Returns the object with the settings used for calls to repeatDataBody. */ - public UnaryCallSettings repeatDataBodySettings() { - return repeatDataBodySettings; - } - - /** Returns the object with the settings used for calls to repeatDataBodyInfo. */ - public UnaryCallSettings repeatDataBodyInfoSettings() { - return repeatDataBodyInfoSettings; - } - - /** Returns the object with the settings used for calls to repeatDataQuery. */ - public UnaryCallSettings repeatDataQuerySettings() { - return repeatDataQuerySettings; - } - - /** Returns the object with the settings used for calls to repeatDataSimplePath. */ - public UnaryCallSettings repeatDataSimplePathSettings() { - return repeatDataSimplePathSettings; - } - - /** Returns the object with the settings used for calls to repeatDataPathResource. */ - public UnaryCallSettings repeatDataPathResourceSettings() { - return repeatDataPathResourceSettings; - } - - /** Returns the object with the settings used for calls to repeatDataPathTrailingResource. */ - public UnaryCallSettings repeatDataPathTrailingResourceSettings() { - return repeatDataPathTrailingResourceSettings; - } - - /** Returns the object with the settings used for calls to repeatDataBodyPut. */ - public UnaryCallSettings repeatDataBodyPutSettings() { - return repeatDataBodyPutSettings; - } - - /** Returns the object with the settings used for calls to repeatDataBodyPatch. */ - public UnaryCallSettings repeatDataBodyPatchSettings() { - return repeatDataBodyPatchSettings; - } - - /** Returns the object with the settings used for calls to getEnum. */ - public UnaryCallSettings getEnumSettings() { - return getEnumSettings; - } - - /** Returns the object with the settings used for calls to verifyEnum. */ - public UnaryCallSettings verifyEnumSettings() { - return verifyEnumSettings; - } - - public ComplianceStub createStub() throws IOException { - if (getTransportChannelProvider() - .getTransportName() - .equals(GrpcTransportChannel.getGrpcTransportName())) { - return GrpcComplianceStub.create(this); - } - if (getTransportChannelProvider() - .getTransportName() - .equals(HttpJsonTransportChannel.getHttpJsonTransportName())) { - return HttpJsonComplianceStub.create(this); - } - throw new UnsupportedOperationException( - String.format( - "Transport not supported: %s", getTransportChannelProvider().getTransportName())); - } - - /** Returns a builder for the default ExecutorProvider for this service. */ - public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { - return InstantiatingExecutorProvider.newBuilder(); - } - - /** Returns the default service endpoint. */ - public static String getDefaultEndpoint() { - return "localhost:7469"; - } - - /** Returns the default mTLS service endpoint. */ - public static String getDefaultMtlsEndpoint() { - return "localhost:7469"; - } - - /** 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 gRPC ChannelProvider for this service. */ - public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { - return InstantiatingGrpcChannelProvider.newBuilder() - .setMaxInboundMessageSize(Integer.MAX_VALUE); - } - - /** Returns a builder for the default REST ChannelProvider for this service. */ - @BetaApi - public static InstantiatingHttpJsonChannelProvider.Builder - defaultHttpJsonTransportProviderBuilder() { - return InstantiatingHttpJsonChannelProvider.newBuilder(); - } - - public static TransportChannelProvider defaultTransportChannelProvider() { - return defaultGrpcTransportProviderBuilder().build(); - } - - @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") - public static ApiClientHeaderProvider.Builder defaultGrpcApiClientHeaderProviderBuilder() { - return ApiClientHeaderProvider.newBuilder() - .setGeneratedLibToken( - "gapic", GaxProperties.getLibraryVersion(ComplianceStubSettings.class)) - .setTransportToken( - GaxGrpcProperties.getGrpcTokenName(), GaxGrpcProperties.getGrpcVersion()); - } - - @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") - public static ApiClientHeaderProvider.Builder defaultHttpJsonApiClientHeaderProviderBuilder() { - return ApiClientHeaderProvider.newBuilder() - .setGeneratedLibToken( - "gapic", GaxProperties.getLibraryVersion(ComplianceStubSettings.class)) - .setTransportToken( - GaxHttpJsonProperties.getHttpJsonTokenName(), - GaxHttpJsonProperties.getHttpJsonVersion()); - } - - public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { - return ComplianceStubSettings.defaultGrpcApiClientHeaderProviderBuilder(); - } - - /** Returns a new gRPC builder for this class. */ - public static Builder newBuilder() { - return Builder.createDefault(); - } - - /** Returns a new REST builder for this class. */ - public static Builder newHttpJsonBuilder() { - return Builder.createHttpJsonDefault(); - } - - /** 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 ComplianceStubSettings(Builder settingsBuilder) throws IOException { - super(settingsBuilder); - - repeatDataBodySettings = settingsBuilder.repeatDataBodySettings().build(); - repeatDataBodyInfoSettings = settingsBuilder.repeatDataBodyInfoSettings().build(); - repeatDataQuerySettings = settingsBuilder.repeatDataQuerySettings().build(); - repeatDataSimplePathSettings = settingsBuilder.repeatDataSimplePathSettings().build(); - repeatDataPathResourceSettings = settingsBuilder.repeatDataPathResourceSettings().build(); - repeatDataPathTrailingResourceSettings = - settingsBuilder.repeatDataPathTrailingResourceSettings().build(); - repeatDataBodyPutSettings = settingsBuilder.repeatDataBodyPutSettings().build(); - repeatDataBodyPatchSettings = settingsBuilder.repeatDataBodyPatchSettings().build(); - getEnumSettings = settingsBuilder.getEnumSettings().build(); - verifyEnumSettings = settingsBuilder.verifyEnumSettings().build(); - } - - /** Builder for ComplianceStubSettings. */ - public static class Builder extends StubSettings.Builder { - private final ImmutableList> unaryMethodSettingsBuilders; - private final UnaryCallSettings.Builder repeatDataBodySettings; - private final UnaryCallSettings.Builder - repeatDataBodyInfoSettings; - private final UnaryCallSettings.Builder repeatDataQuerySettings; - private final UnaryCallSettings.Builder - repeatDataSimplePathSettings; - private final UnaryCallSettings.Builder - repeatDataPathResourceSettings; - private final UnaryCallSettings.Builder - repeatDataPathTrailingResourceSettings; - private final UnaryCallSettings.Builder - repeatDataBodyPutSettings; - private final UnaryCallSettings.Builder - repeatDataBodyPatchSettings; - private final UnaryCallSettings.Builder getEnumSettings; - private final UnaryCallSettings.Builder verifyEnumSettings; - private static final ImmutableMap> - RETRYABLE_CODE_DEFINITIONS; - - static { - ImmutableMap.Builder> definitions = - ImmutableMap.builder(); - definitions.put("no_retry_codes", ImmutableSet.copyOf(Lists.newArrayList())); - RETRYABLE_CODE_DEFINITIONS = definitions.build(); - } - - private static final ImmutableMap RETRY_PARAM_DEFINITIONS; - - static { - ImmutableMap.Builder definitions = ImmutableMap.builder(); - RetrySettings settings = null; - settings = RetrySettings.newBuilder().setRpcTimeoutMultiplier(1.0).build(); - definitions.put("no_retry_params", settings); - RETRY_PARAM_DEFINITIONS = definitions.build(); - } - - protected Builder() { - this(((ClientContext) null)); - } - - protected Builder(ClientContext clientContext) { - super(clientContext); - - repeatDataBodySettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); - repeatDataBodyInfoSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); - repeatDataQuerySettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); - repeatDataSimplePathSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); - repeatDataPathResourceSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); - repeatDataPathTrailingResourceSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); - repeatDataBodyPutSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); - repeatDataBodyPatchSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); - getEnumSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); - verifyEnumSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); - - unaryMethodSettingsBuilders = - ImmutableList.>of( - repeatDataBodySettings, - repeatDataBodyInfoSettings, - repeatDataQuerySettings, - repeatDataSimplePathSettings, - repeatDataPathResourceSettings, - repeatDataPathTrailingResourceSettings, - repeatDataBodyPutSettings, - repeatDataBodyPatchSettings, - getEnumSettings, - verifyEnumSettings); - initDefaults(this); - } - - protected Builder(ComplianceStubSettings settings) { - super(settings); - - repeatDataBodySettings = settings.repeatDataBodySettings.toBuilder(); - repeatDataBodyInfoSettings = settings.repeatDataBodyInfoSettings.toBuilder(); - repeatDataQuerySettings = settings.repeatDataQuerySettings.toBuilder(); - repeatDataSimplePathSettings = settings.repeatDataSimplePathSettings.toBuilder(); - repeatDataPathResourceSettings = settings.repeatDataPathResourceSettings.toBuilder(); - repeatDataPathTrailingResourceSettings = - settings.repeatDataPathTrailingResourceSettings.toBuilder(); - repeatDataBodyPutSettings = settings.repeatDataBodyPutSettings.toBuilder(); - repeatDataBodyPatchSettings = settings.repeatDataBodyPatchSettings.toBuilder(); - getEnumSettings = settings.getEnumSettings.toBuilder(); - verifyEnumSettings = settings.verifyEnumSettings.toBuilder(); - - unaryMethodSettingsBuilders = - ImmutableList.>of( - repeatDataBodySettings, - repeatDataBodyInfoSettings, - repeatDataQuerySettings, - repeatDataSimplePathSettings, - repeatDataPathResourceSettings, - repeatDataPathTrailingResourceSettings, - repeatDataBodyPutSettings, - repeatDataBodyPatchSettings, - getEnumSettings, - verifyEnumSettings); - } - - private static Builder createDefault() { - Builder builder = new Builder(((ClientContext) null)); - - builder.setTransportChannelProvider(defaultTransportChannelProvider()); - builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); - builder.setInternalHeaderProvider(defaultApiClientHeaderProviderBuilder().build()); - builder.setEndpoint(getDefaultEndpoint()); - builder.setMtlsEndpoint(getDefaultMtlsEndpoint()); - builder.setSwitchToMtlsEndpointAllowed(true); - - return initDefaults(builder); - } - - private static Builder createHttpJsonDefault() { - Builder builder = new Builder(((ClientContext) null)); - - builder.setTransportChannelProvider(defaultHttpJsonTransportProviderBuilder().build()); - builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); - builder.setInternalHeaderProvider(defaultHttpJsonApiClientHeaderProviderBuilder().build()); - builder.setEndpoint(getDefaultEndpoint()); - builder.setMtlsEndpoint(getDefaultMtlsEndpoint()); - builder.setSwitchToMtlsEndpointAllowed(true); - - return initDefaults(builder); - } - - private static Builder initDefaults(Builder builder) { - builder - .repeatDataBodySettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); - - builder - .repeatDataBodyInfoSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); - - builder - .repeatDataQuerySettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); - - builder - .repeatDataSimplePathSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); - - builder - .repeatDataPathResourceSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); - - builder - .repeatDataPathTrailingResourceSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); - - builder - .repeatDataBodyPutSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); - - builder - .repeatDataBodyPatchSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); - - builder - .getEnumSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); - - builder - .verifyEnumSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_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 repeatDataBody. */ - public UnaryCallSettings.Builder repeatDataBodySettings() { - return repeatDataBodySettings; - } - - /** Returns the builder for the settings used for calls to repeatDataBodyInfo. */ - public UnaryCallSettings.Builder repeatDataBodyInfoSettings() { - return repeatDataBodyInfoSettings; - } - - /** Returns the builder for the settings used for calls to repeatDataQuery. */ - public UnaryCallSettings.Builder repeatDataQuerySettings() { - return repeatDataQuerySettings; - } - - /** Returns the builder for the settings used for calls to repeatDataSimplePath. */ - public UnaryCallSettings.Builder repeatDataSimplePathSettings() { - return repeatDataSimplePathSettings; - } - - /** Returns the builder for the settings used for calls to repeatDataPathResource. */ - public UnaryCallSettings.Builder - repeatDataPathResourceSettings() { - return repeatDataPathResourceSettings; - } - - /** Returns the builder for the settings used for calls to repeatDataPathTrailingResource. */ - public UnaryCallSettings.Builder - repeatDataPathTrailingResourceSettings() { - return repeatDataPathTrailingResourceSettings; - } - - /** Returns the builder for the settings used for calls to repeatDataBodyPut. */ - public UnaryCallSettings.Builder repeatDataBodyPutSettings() { - return repeatDataBodyPutSettings; - } - - /** Returns the builder for the settings used for calls to repeatDataBodyPatch. */ - public UnaryCallSettings.Builder repeatDataBodyPatchSettings() { - return repeatDataBodyPatchSettings; - } - - /** Returns the builder for the settings used for calls to getEnum. */ - public UnaryCallSettings.Builder getEnumSettings() { - return getEnumSettings; - } - - /** Returns the builder for the settings used for calls to verifyEnum. */ - public UnaryCallSettings.Builder verifyEnumSettings() { - return verifyEnumSettings; - } - - @Override - public ComplianceStubSettings build() throws IOException { - return new ComplianceStubSettings(this); - } - } -} diff --git a/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/EchoStub.java b/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/EchoStub.java deleted file mode 100644 index be6b33ec95..0000000000 --- a/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/EchoStub.java +++ /dev/null @@ -1,116 +0,0 @@ -/* - * 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 - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1.stub; - -import static com.google.showcase.v1beta1.EchoClient.PagedExpandLegacyMappedPagedResponse; -import static com.google.showcase.v1beta1.EchoClient.PagedExpandPagedResponse; - -import com.google.api.core.BetaApi; -import com.google.api.gax.core.BackgroundResource; -import com.google.api.gax.rpc.BidiStreamingCallable; -import com.google.api.gax.rpc.ClientStreamingCallable; -import com.google.api.gax.rpc.OperationCallable; -import com.google.api.gax.rpc.ServerStreamingCallable; -import com.google.api.gax.rpc.UnaryCallable; -import com.google.longrunning.Operation; -import com.google.longrunning.stub.OperationsStub; -import com.google.showcase.v1beta1.BlockRequest; -import com.google.showcase.v1beta1.BlockResponse; -import com.google.showcase.v1beta1.EchoRequest; -import com.google.showcase.v1beta1.EchoResponse; -import com.google.showcase.v1beta1.ExpandRequest; -import com.google.showcase.v1beta1.PagedExpandLegacyMappedResponse; -import com.google.showcase.v1beta1.PagedExpandLegacyRequest; -import com.google.showcase.v1beta1.PagedExpandRequest; -import com.google.showcase.v1beta1.PagedExpandResponse; -import com.google.showcase.v1beta1.WaitMetadata; -import com.google.showcase.v1beta1.WaitRequest; -import com.google.showcase.v1beta1.WaitResponse; -import javax.annotation.Generated; - -// AUTO-GENERATED DOCUMENTATION AND CLASS. -/** - * Base stub class for the Echo service API. - * - *

        This class is for advanced usage and reflects the underlying API directly. - */ -@BetaApi -@Generated("by gapic-generator-java") -public abstract class EchoStub implements BackgroundResource { - - public OperationsStub getOperationsStub() { - return null; - } - - public com.google.api.gax.httpjson.longrunning.stub.OperationsStub getHttpJsonOperationsStub() { - return null; - } - - public UnaryCallable echoCallable() { - throw new UnsupportedOperationException("Not implemented: echoCallable()"); - } - - public ServerStreamingCallable expandCallable() { - throw new UnsupportedOperationException("Not implemented: expandCallable()"); - } - - public ClientStreamingCallable collectCallable() { - throw new UnsupportedOperationException("Not implemented: collectCallable()"); - } - - public BidiStreamingCallable chatCallable() { - throw new UnsupportedOperationException("Not implemented: chatCallable()"); - } - - public UnaryCallable pagedExpandPagedCallable() { - throw new UnsupportedOperationException("Not implemented: pagedExpandPagedCallable()"); - } - - public UnaryCallable pagedExpandCallable() { - throw new UnsupportedOperationException("Not implemented: pagedExpandCallable()"); - } - - public UnaryCallable pagedExpandLegacyCallable() { - throw new UnsupportedOperationException("Not implemented: pagedExpandLegacyCallable()"); - } - - public UnaryCallable - pagedExpandLegacyMappedPagedCallable() { - throw new UnsupportedOperationException( - "Not implemented: pagedExpandLegacyMappedPagedCallable()"); - } - - public UnaryCallable - pagedExpandLegacyMappedCallable() { - throw new UnsupportedOperationException("Not implemented: pagedExpandLegacyMappedCallable()"); - } - - public OperationCallable waitOperationCallable() { - throw new UnsupportedOperationException("Not implemented: waitOperationCallable()"); - } - - public UnaryCallable waitCallable() { - throw new UnsupportedOperationException("Not implemented: waitCallable()"); - } - - public UnaryCallable blockCallable() { - throw new UnsupportedOperationException("Not implemented: blockCallable()"); - } - - @Override - public abstract void close(); -} diff --git a/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/EchoStubSettings.java b/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/EchoStubSettings.java deleted file mode 100644 index d4d038ddd4..0000000000 --- a/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/EchoStubSettings.java +++ /dev/null @@ -1,713 +0,0 @@ -/* - * 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 - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1.stub; - -import static com.google.showcase.v1beta1.EchoClient.PagedExpandLegacyMappedPagedResponse; -import static com.google.showcase.v1beta1.EchoClient.PagedExpandPagedResponse; - -import com.google.api.core.ApiFunction; -import com.google.api.core.ApiFuture; -import com.google.api.core.BetaApi; -import com.google.api.gax.core.GaxProperties; -import com.google.api.gax.core.GoogleCredentialsProvider; -import com.google.api.gax.core.InstantiatingExecutorProvider; -import com.google.api.gax.grpc.GaxGrpcProperties; -import com.google.api.gax.grpc.GrpcTransportChannel; -import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; -import com.google.api.gax.grpc.ProtoOperationTransformers; -import com.google.api.gax.httpjson.GaxHttpJsonProperties; -import com.google.api.gax.httpjson.HttpJsonTransportChannel; -import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; -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.ServerStreamingCallSettings; -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.longrunning.Operation; -import com.google.showcase.v1beta1.BlockRequest; -import com.google.showcase.v1beta1.BlockResponse; -import com.google.showcase.v1beta1.EchoRequest; -import com.google.showcase.v1beta1.EchoResponse; -import com.google.showcase.v1beta1.ExpandRequest; -import com.google.showcase.v1beta1.PagedExpandLegacyMappedResponse; -import com.google.showcase.v1beta1.PagedExpandLegacyRequest; -import com.google.showcase.v1beta1.PagedExpandRequest; -import com.google.showcase.v1beta1.PagedExpandResponse; -import com.google.showcase.v1beta1.PagedExpandResponseList; -import com.google.showcase.v1beta1.WaitMetadata; -import com.google.showcase.v1beta1.WaitRequest; -import com.google.showcase.v1beta1.WaitResponse; -import java.io.IOException; -import java.util.Collections; -import java.util.List; -import java.util.Map; -import javax.annotation.Generated; -import org.threeten.bp.Duration; - -// AUTO-GENERATED DOCUMENTATION AND CLASS. -/** - * Settings class to configure an instance of {@link EchoStub}. - * - *

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

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

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

        For example, to set the total timeout of echo to 30 seconds: - * - *

        {@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
        - * EchoStubSettings.Builder echoSettingsBuilder = EchoStubSettings.newBuilder();
        - * echoSettingsBuilder
        - *     .echoSettings()
        - *     .setRetrySettings(
        - *         echoSettingsBuilder
        - *             .echoSettings()
        - *             .getRetrySettings()
        - *             .toBuilder()
        - *             .setTotalTimeout(Duration.ofSeconds(30))
        - *             .build());
        - * EchoStubSettings echoSettings = echoSettingsBuilder.build();
        - * }
        - */ -@BetaApi -@Generated("by gapic-generator-java") -public class EchoStubSettings extends StubSettings { - /** The default scopes of the service. */ - private static final ImmutableList DEFAULT_SERVICE_SCOPES = - ImmutableList.builder().build(); - - private final UnaryCallSettings echoSettings; - private final ServerStreamingCallSettings expandSettings; - private final StreamingCallSettings collectSettings; - private final StreamingCallSettings chatSettings; - private final PagedCallSettings - pagedExpandSettings; - private final UnaryCallSettings - pagedExpandLegacySettings; - private final PagedCallSettings< - PagedExpandRequest, PagedExpandLegacyMappedResponse, PagedExpandLegacyMappedPagedResponse> - pagedExpandLegacyMappedSettings; - private final UnaryCallSettings waitSettings; - private final OperationCallSettings - waitOperationSettings; - private final UnaryCallSettings blockSettings; - - private static final PagedListDescriptor - PAGED_EXPAND_PAGE_STR_DESC = - new PagedListDescriptor() { - @Override - public String emptyToken() { - return ""; - } - - @Override - public PagedExpandRequest injectToken(PagedExpandRequest payload, String token) { - return PagedExpandRequest.newBuilder(payload).setPageToken(token).build(); - } - - @Override - public PagedExpandRequest injectPageSize(PagedExpandRequest payload, int pageSize) { - return PagedExpandRequest.newBuilder(payload).setPageSize(pageSize).build(); - } - - @Override - public Integer extractPageSize(PagedExpandRequest payload) { - return payload.getPageSize(); - } - - @Override - public String extractNextToken(PagedExpandResponse payload) { - return payload.getNextPageToken(); - } - - @Override - public Iterable extractResources(PagedExpandResponse payload) { - return payload.getResponsesList() == null - ? ImmutableList.of() - : payload.getResponsesList(); - } - }; - - private static final PagedListDescriptor< - PagedExpandRequest, - PagedExpandLegacyMappedResponse, - Map.Entry> - PAGED_EXPAND_LEGACY_MAPPED_PAGE_STR_DESC = - new PagedListDescriptor< - PagedExpandRequest, - PagedExpandLegacyMappedResponse, - Map.Entry>() { - @Override - public String emptyToken() { - return ""; - } - - @Override - public PagedExpandRequest injectToken(PagedExpandRequest payload, String token) { - return PagedExpandRequest.newBuilder(payload).setPageToken(token).build(); - } - - @Override - public PagedExpandRequest injectPageSize(PagedExpandRequest payload, int pageSize) { - return PagedExpandRequest.newBuilder(payload).setPageSize(pageSize).build(); - } - - @Override - public Integer extractPageSize(PagedExpandRequest payload) { - return payload.getPageSize(); - } - - @Override - public String extractNextToken(PagedExpandLegacyMappedResponse payload) { - return payload.getNextPageToken(); - } - - @Override - public Iterable> extractResources( - PagedExpandLegacyMappedResponse payload) { - return payload.getAlphabetizedMap() == null - ? Collections.>emptySet() - : payload.getAlphabetizedMap().entrySet(); - } - }; - - private static final PagedListResponseFactory< - PagedExpandRequest, PagedExpandResponse, PagedExpandPagedResponse> - PAGED_EXPAND_PAGE_STR_FACT = - new PagedListResponseFactory< - PagedExpandRequest, PagedExpandResponse, PagedExpandPagedResponse>() { - @Override - public ApiFuture getFuturePagedResponse( - UnaryCallable callable, - PagedExpandRequest request, - ApiCallContext context, - ApiFuture futureResponse) { - PageContext pageContext = - PageContext.create(callable, PAGED_EXPAND_PAGE_STR_DESC, request, context); - return PagedExpandPagedResponse.createAsync(pageContext, futureResponse); - } - }; - - private static final PagedListResponseFactory< - PagedExpandRequest, PagedExpandLegacyMappedResponse, PagedExpandLegacyMappedPagedResponse> - PAGED_EXPAND_LEGACY_MAPPED_PAGE_STR_FACT = - new PagedListResponseFactory< - PagedExpandRequest, - PagedExpandLegacyMappedResponse, - PagedExpandLegacyMappedPagedResponse>() { - @Override - public ApiFuture getFuturePagedResponse( - UnaryCallable callable, - PagedExpandRequest request, - ApiCallContext context, - ApiFuture futureResponse) { - PageContext< - PagedExpandRequest, - PagedExpandLegacyMappedResponse, - Map.Entry> - pageContext = - PageContext.create( - callable, PAGED_EXPAND_LEGACY_MAPPED_PAGE_STR_DESC, request, context); - return PagedExpandLegacyMappedPagedResponse.createAsync(pageContext, futureResponse); - } - }; - - /** Returns the object with the settings used for calls to echo. */ - public UnaryCallSettings echoSettings() { - return echoSettings; - } - - /** Returns the object with the settings used for calls to expand. */ - public ServerStreamingCallSettings expandSettings() { - return expandSettings; - } - - /** Returns the object with the settings used for calls to collect. */ - public StreamingCallSettings collectSettings() { - return collectSettings; - } - - /** Returns the object with the settings used for calls to chat. */ - public StreamingCallSettings chatSettings() { - return chatSettings; - } - - /** Returns the object with the settings used for calls to pagedExpand. */ - public PagedCallSettings - pagedExpandSettings() { - return pagedExpandSettings; - } - - /** Returns the object with the settings used for calls to pagedExpandLegacy. */ - public UnaryCallSettings - pagedExpandLegacySettings() { - return pagedExpandLegacySettings; - } - - /** Returns the object with the settings used for calls to pagedExpandLegacyMapped. */ - public PagedCallSettings< - PagedExpandRequest, PagedExpandLegacyMappedResponse, PagedExpandLegacyMappedPagedResponse> - pagedExpandLegacyMappedSettings() { - return pagedExpandLegacyMappedSettings; - } - - /** Returns the object with the settings used for calls to wait. */ - public UnaryCallSettings waitSettings() { - return waitSettings; - } - - /** Returns the object with the settings used for calls to wait. */ - public OperationCallSettings waitOperationSettings() { - return waitOperationSettings; - } - - /** Returns the object with the settings used for calls to block. */ - public UnaryCallSettings blockSettings() { - return blockSettings; - } - - public EchoStub createStub() throws IOException { - if (getTransportChannelProvider() - .getTransportName() - .equals(GrpcTransportChannel.getGrpcTransportName())) { - return GrpcEchoStub.create(this); - } - if (getTransportChannelProvider() - .getTransportName() - .equals(HttpJsonTransportChannel.getHttpJsonTransportName())) { - return HttpJsonEchoStub.create(this); - } - throw new UnsupportedOperationException( - String.format( - "Transport not supported: %s", getTransportChannelProvider().getTransportName())); - } - - /** Returns a builder for the default ExecutorProvider for this service. */ - public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { - return InstantiatingExecutorProvider.newBuilder(); - } - - /** Returns the default service endpoint. */ - public static String getDefaultEndpoint() { - return "localhost:7469"; - } - - /** Returns the default mTLS service endpoint. */ - public static String getDefaultMtlsEndpoint() { - return "localhost:7469"; - } - - /** 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 gRPC ChannelProvider for this service. */ - public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { - return InstantiatingGrpcChannelProvider.newBuilder() - .setMaxInboundMessageSize(Integer.MAX_VALUE); - } - - /** Returns a builder for the default REST ChannelProvider for this service. */ - @BetaApi - public static InstantiatingHttpJsonChannelProvider.Builder - defaultHttpJsonTransportProviderBuilder() { - return InstantiatingHttpJsonChannelProvider.newBuilder(); - } - - public static TransportChannelProvider defaultTransportChannelProvider() { - return defaultGrpcTransportProviderBuilder().build(); - } - - @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") - public static ApiClientHeaderProvider.Builder defaultGrpcApiClientHeaderProviderBuilder() { - return ApiClientHeaderProvider.newBuilder() - .setGeneratedLibToken("gapic", GaxProperties.getLibraryVersion(EchoStubSettings.class)) - .setTransportToken( - GaxGrpcProperties.getGrpcTokenName(), GaxGrpcProperties.getGrpcVersion()); - } - - @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") - public static ApiClientHeaderProvider.Builder defaultHttpJsonApiClientHeaderProviderBuilder() { - return ApiClientHeaderProvider.newBuilder() - .setGeneratedLibToken("gapic", GaxProperties.getLibraryVersion(EchoStubSettings.class)) - .setTransportToken( - GaxHttpJsonProperties.getHttpJsonTokenName(), - GaxHttpJsonProperties.getHttpJsonVersion()); - } - - public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { - return EchoStubSettings.defaultGrpcApiClientHeaderProviderBuilder(); - } - - /** Returns a new gRPC builder for this class. */ - public static Builder newBuilder() { - return Builder.createDefault(); - } - - /** Returns a new REST builder for this class. */ - public static Builder newHttpJsonBuilder() { - return Builder.createHttpJsonDefault(); - } - - /** 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 EchoStubSettings(Builder settingsBuilder) throws IOException { - super(settingsBuilder); - - echoSettings = settingsBuilder.echoSettings().build(); - expandSettings = settingsBuilder.expandSettings().build(); - collectSettings = settingsBuilder.collectSettings().build(); - chatSettings = settingsBuilder.chatSettings().build(); - pagedExpandSettings = settingsBuilder.pagedExpandSettings().build(); - pagedExpandLegacySettings = settingsBuilder.pagedExpandLegacySettings().build(); - pagedExpandLegacyMappedSettings = settingsBuilder.pagedExpandLegacyMappedSettings().build(); - waitSettings = settingsBuilder.waitSettings().build(); - waitOperationSettings = settingsBuilder.waitOperationSettings().build(); - blockSettings = settingsBuilder.blockSettings().build(); - } - - /** Builder for EchoStubSettings. */ - public static class Builder extends StubSettings.Builder { - private final ImmutableList> unaryMethodSettingsBuilders; - private final UnaryCallSettings.Builder echoSettings; - private final ServerStreamingCallSettings.Builder expandSettings; - private final StreamingCallSettings.Builder collectSettings; - private final StreamingCallSettings.Builder chatSettings; - private final PagedCallSettings.Builder< - PagedExpandRequest, PagedExpandResponse, PagedExpandPagedResponse> - pagedExpandSettings; - private final UnaryCallSettings.Builder - pagedExpandLegacySettings; - private final PagedCallSettings.Builder< - PagedExpandRequest, - PagedExpandLegacyMappedResponse, - PagedExpandLegacyMappedPagedResponse> - pagedExpandLegacyMappedSettings; - private final UnaryCallSettings.Builder waitSettings; - private final OperationCallSettings.Builder - waitOperationSettings; - private final UnaryCallSettings.Builder blockSettings; - 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.UNAVAILABLE, StatusCode.Code.UNKNOWN))); - 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() - .setInitialRetryDelay(Duration.ofMillis(100L)) - .setRetryDelayMultiplier(2.0) - .setMaxRetryDelay(Duration.ofMillis(3000L)) - .setInitialRpcTimeout(Duration.ofMillis(10000L)) - .setRpcTimeoutMultiplier(1.0) - .setMaxRpcTimeout(Duration.ofMillis(10000L)) - .setTotalTimeout(Duration.ofMillis(10000L)) - .build(); - definitions.put("retry_policy_1_params", settings); - settings = - RetrySettings.newBuilder() - .setInitialRpcTimeout(Duration.ofMillis(5000L)) - .setRpcTimeoutMultiplier(1.0) - .setMaxRpcTimeout(Duration.ofMillis(5000L)) - .setTotalTimeout(Duration.ofMillis(5000L)) - .build(); - definitions.put("no_retry_0_params", settings); - RETRY_PARAM_DEFINITIONS = definitions.build(); - } - - protected Builder() { - this(((ClientContext) null)); - } - - protected Builder(ClientContext clientContext) { - super(clientContext); - - echoSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); - expandSettings = ServerStreamingCallSettings.newBuilder(); - collectSettings = StreamingCallSettings.newBuilder(); - chatSettings = StreamingCallSettings.newBuilder(); - pagedExpandSettings = PagedCallSettings.newBuilder(PAGED_EXPAND_PAGE_STR_FACT); - pagedExpandLegacySettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); - pagedExpandLegacyMappedSettings = - PagedCallSettings.newBuilder(PAGED_EXPAND_LEGACY_MAPPED_PAGE_STR_FACT); - waitSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); - waitOperationSettings = OperationCallSettings.newBuilder(); - blockSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); - - unaryMethodSettingsBuilders = - ImmutableList.>of( - echoSettings, - pagedExpandSettings, - pagedExpandLegacySettings, - pagedExpandLegacyMappedSettings, - waitSettings, - blockSettings); - initDefaults(this); - } - - protected Builder(EchoStubSettings settings) { - super(settings); - - echoSettings = settings.echoSettings.toBuilder(); - expandSettings = settings.expandSettings.toBuilder(); - collectSettings = settings.collectSettings.toBuilder(); - chatSettings = settings.chatSettings.toBuilder(); - pagedExpandSettings = settings.pagedExpandSettings.toBuilder(); - pagedExpandLegacySettings = settings.pagedExpandLegacySettings.toBuilder(); - pagedExpandLegacyMappedSettings = settings.pagedExpandLegacyMappedSettings.toBuilder(); - waitSettings = settings.waitSettings.toBuilder(); - waitOperationSettings = settings.waitOperationSettings.toBuilder(); - blockSettings = settings.blockSettings.toBuilder(); - - unaryMethodSettingsBuilders = - ImmutableList.>of( - echoSettings, - pagedExpandSettings, - pagedExpandLegacySettings, - pagedExpandLegacyMappedSettings, - waitSettings, - blockSettings); - } - - private static Builder createDefault() { - Builder builder = new Builder(((ClientContext) null)); - - builder.setTransportChannelProvider(defaultTransportChannelProvider()); - builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); - builder.setInternalHeaderProvider(defaultApiClientHeaderProviderBuilder().build()); - builder.setEndpoint(getDefaultEndpoint()); - builder.setMtlsEndpoint(getDefaultMtlsEndpoint()); - builder.setSwitchToMtlsEndpointAllowed(true); - - return initDefaults(builder); - } - - private static Builder createHttpJsonDefault() { - Builder builder = new Builder(((ClientContext) null)); - - builder.setTransportChannelProvider(defaultHttpJsonTransportProviderBuilder().build()); - builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); - builder.setInternalHeaderProvider(defaultHttpJsonApiClientHeaderProviderBuilder().build()); - builder.setEndpoint(getDefaultEndpoint()); - builder.setMtlsEndpoint(getDefaultMtlsEndpoint()); - builder.setSwitchToMtlsEndpointAllowed(true); - - return initDefaults(builder); - } - - private static Builder initDefaults(Builder builder) { - builder - .echoSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")); - - builder - .expandSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")); - - builder - .pagedExpandSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")); - - builder - .pagedExpandLegacySettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); - - builder - .pagedExpandLegacyMappedSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); - - builder - .waitSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); - - builder - .blockSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); - - builder - .waitOperationSettings() - .setInitialCallSettings( - UnaryCallSettings.newUnaryCallSettingsBuilder() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")) - .build()) - .setResponseTransformer( - ProtoOperationTransformers.ResponseTransformer.create(WaitResponse.class)) - .setMetadataTransformer( - ProtoOperationTransformers.MetadataTransformer.create(WaitMetadata.class)) - .setPollingAlgorithm( - OperationTimedPollAlgorithm.create( - RetrySettings.newBuilder() - .setInitialRetryDelay(Duration.ofMillis(5000L)) - .setRetryDelayMultiplier(1.5) - .setMaxRetryDelay(Duration.ofMillis(45000L)) - .setInitialRpcTimeout(Duration.ZERO) - .setRpcTimeoutMultiplier(1.0) - .setMaxRpcTimeout(Duration.ZERO) - .setTotalTimeout(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 echo. */ - public UnaryCallSettings.Builder echoSettings() { - return echoSettings; - } - - /** Returns the builder for the settings used for calls to expand. */ - public ServerStreamingCallSettings.Builder expandSettings() { - return expandSettings; - } - - /** Returns the builder for the settings used for calls to collect. */ - public StreamingCallSettings.Builder collectSettings() { - return collectSettings; - } - - /** Returns the builder for the settings used for calls to chat. */ - public StreamingCallSettings.Builder chatSettings() { - return chatSettings; - } - - /** Returns the builder for the settings used for calls to pagedExpand. */ - public PagedCallSettings.Builder< - PagedExpandRequest, PagedExpandResponse, PagedExpandPagedResponse> - pagedExpandSettings() { - return pagedExpandSettings; - } - - /** Returns the builder for the settings used for calls to pagedExpandLegacy. */ - public UnaryCallSettings.Builder - pagedExpandLegacySettings() { - return pagedExpandLegacySettings; - } - - /** Returns the builder for the settings used for calls to pagedExpandLegacyMapped. */ - public PagedCallSettings.Builder< - PagedExpandRequest, - PagedExpandLegacyMappedResponse, - PagedExpandLegacyMappedPagedResponse> - pagedExpandLegacyMappedSettings() { - return pagedExpandLegacyMappedSettings; - } - - /** Returns the builder for the settings used for calls to wait. */ - public UnaryCallSettings.Builder waitSettings() { - return waitSettings; - } - - /** Returns the builder for the settings used for calls to wait. */ - @BetaApi( - "The surface for use by generated code is not stable yet and may change in the future.") - public OperationCallSettings.Builder - waitOperationSettings() { - return waitOperationSettings; - } - - /** Returns the builder for the settings used for calls to block. */ - public UnaryCallSettings.Builder blockSettings() { - return blockSettings; - } - - @Override - public EchoStubSettings build() throws IOException { - return new EchoStubSettings(this); - } - } -} diff --git a/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/GrpcComplianceCallableFactory.java b/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/GrpcComplianceCallableFactory.java deleted file mode 100644 index 953ca5555b..0000000000 --- a/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/GrpcComplianceCallableFactory.java +++ /dev/null @@ -1,115 +0,0 @@ -/* - * 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 - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1.stub; - -import com.google.api.core.BetaApi; -import com.google.api.gax.grpc.GrpcCallSettings; -import com.google.api.gax.grpc.GrpcCallableFactory; -import com.google.api.gax.grpc.GrpcStubCallableFactory; -import com.google.api.gax.rpc.BatchingCallSettings; -import com.google.api.gax.rpc.BidiStreamingCallable; -import com.google.api.gax.rpc.ClientContext; -import com.google.api.gax.rpc.ClientStreamingCallable; -import com.google.api.gax.rpc.OperationCallSettings; -import com.google.api.gax.rpc.OperationCallable; -import com.google.api.gax.rpc.PagedCallSettings; -import com.google.api.gax.rpc.ServerStreamingCallSettings; -import com.google.api.gax.rpc.ServerStreamingCallable; -import com.google.api.gax.rpc.StreamingCallSettings; -import com.google.api.gax.rpc.UnaryCallSettings; -import com.google.api.gax.rpc.UnaryCallable; -import com.google.longrunning.Operation; -import com.google.longrunning.stub.OperationsStub; -import javax.annotation.Generated; - -// AUTO-GENERATED DOCUMENTATION AND CLASS. -/** - * gRPC callable factory implementation for the Compliance service API. - * - *

        This class is for advanced usage. - */ -@BetaApi -@Generated("by gapic-generator-java") -public class GrpcComplianceCallableFactory 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/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/GrpcComplianceStub.java b/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/GrpcComplianceStub.java deleted file mode 100644 index 116d0fa5cb..0000000000 --- a/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/GrpcComplianceStub.java +++ /dev/null @@ -1,397 +0,0 @@ -/* - * 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 - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1.stub; - -import com.google.api.core.BetaApi; -import com.google.api.gax.core.BackgroundResource; -import com.google.api.gax.core.BackgroundResourceAggregation; -import com.google.api.gax.grpc.GrpcCallSettings; -import com.google.api.gax.grpc.GrpcStubCallableFactory; -import com.google.api.gax.rpc.ClientContext; -import com.google.api.gax.rpc.UnaryCallable; -import com.google.common.collect.ImmutableMap; -import com.google.longrunning.stub.GrpcOperationsStub; -import com.google.showcase.v1beta1.EnumRequest; -import com.google.showcase.v1beta1.EnumResponse; -import com.google.showcase.v1beta1.RepeatRequest; -import com.google.showcase.v1beta1.RepeatResponse; -import io.grpc.MethodDescriptor; -import io.grpc.protobuf.ProtoUtils; -import java.io.IOException; -import java.util.Map; -import java.util.concurrent.TimeUnit; -import javax.annotation.Generated; - -// AUTO-GENERATED DOCUMENTATION AND CLASS. -/** - * gRPC stub implementation for the Compliance service API. - * - *

        This class is for advanced usage and reflects the underlying API directly. - */ -@BetaApi -@Generated("by gapic-generator-java") -public class GrpcComplianceStub extends ComplianceStub { - private static final MethodDescriptor - repeatDataBodyMethodDescriptor = - MethodDescriptor.newBuilder() - .setType(MethodDescriptor.MethodType.UNARY) - .setFullMethodName("google.showcase.v1beta1.Compliance/RepeatDataBody") - .setRequestMarshaller(ProtoUtils.marshaller(RepeatRequest.getDefaultInstance())) - .setResponseMarshaller(ProtoUtils.marshaller(RepeatResponse.getDefaultInstance())) - .build(); - - private static final MethodDescriptor - repeatDataBodyInfoMethodDescriptor = - MethodDescriptor.newBuilder() - .setType(MethodDescriptor.MethodType.UNARY) - .setFullMethodName("google.showcase.v1beta1.Compliance/RepeatDataBodyInfo") - .setRequestMarshaller(ProtoUtils.marshaller(RepeatRequest.getDefaultInstance())) - .setResponseMarshaller(ProtoUtils.marshaller(RepeatResponse.getDefaultInstance())) - .build(); - - private static final MethodDescriptor - repeatDataQueryMethodDescriptor = - MethodDescriptor.newBuilder() - .setType(MethodDescriptor.MethodType.UNARY) - .setFullMethodName("google.showcase.v1beta1.Compliance/RepeatDataQuery") - .setRequestMarshaller(ProtoUtils.marshaller(RepeatRequest.getDefaultInstance())) - .setResponseMarshaller(ProtoUtils.marshaller(RepeatResponse.getDefaultInstance())) - .build(); - - private static final MethodDescriptor - repeatDataSimplePathMethodDescriptor = - MethodDescriptor.newBuilder() - .setType(MethodDescriptor.MethodType.UNARY) - .setFullMethodName("google.showcase.v1beta1.Compliance/RepeatDataSimplePath") - .setRequestMarshaller(ProtoUtils.marshaller(RepeatRequest.getDefaultInstance())) - .setResponseMarshaller(ProtoUtils.marshaller(RepeatResponse.getDefaultInstance())) - .build(); - - private static final MethodDescriptor - repeatDataPathResourceMethodDescriptor = - MethodDescriptor.newBuilder() - .setType(MethodDescriptor.MethodType.UNARY) - .setFullMethodName("google.showcase.v1beta1.Compliance/RepeatDataPathResource") - .setRequestMarshaller(ProtoUtils.marshaller(RepeatRequest.getDefaultInstance())) - .setResponseMarshaller(ProtoUtils.marshaller(RepeatResponse.getDefaultInstance())) - .build(); - - private static final MethodDescriptor - repeatDataPathTrailingResourceMethodDescriptor = - MethodDescriptor.newBuilder() - .setType(MethodDescriptor.MethodType.UNARY) - .setFullMethodName( - "google.showcase.v1beta1.Compliance/RepeatDataPathTrailingResource") - .setRequestMarshaller(ProtoUtils.marshaller(RepeatRequest.getDefaultInstance())) - .setResponseMarshaller(ProtoUtils.marshaller(RepeatResponse.getDefaultInstance())) - .build(); - - private static final MethodDescriptor - repeatDataBodyPutMethodDescriptor = - MethodDescriptor.newBuilder() - .setType(MethodDescriptor.MethodType.UNARY) - .setFullMethodName("google.showcase.v1beta1.Compliance/RepeatDataBodyPut") - .setRequestMarshaller(ProtoUtils.marshaller(RepeatRequest.getDefaultInstance())) - .setResponseMarshaller(ProtoUtils.marshaller(RepeatResponse.getDefaultInstance())) - .build(); - - private static final MethodDescriptor - repeatDataBodyPatchMethodDescriptor = - MethodDescriptor.newBuilder() - .setType(MethodDescriptor.MethodType.UNARY) - .setFullMethodName("google.showcase.v1beta1.Compliance/RepeatDataBodyPatch") - .setRequestMarshaller(ProtoUtils.marshaller(RepeatRequest.getDefaultInstance())) - .setResponseMarshaller(ProtoUtils.marshaller(RepeatResponse.getDefaultInstance())) - .build(); - - private static final MethodDescriptor getEnumMethodDescriptor = - MethodDescriptor.newBuilder() - .setType(MethodDescriptor.MethodType.UNARY) - .setFullMethodName("google.showcase.v1beta1.Compliance/GetEnum") - .setRequestMarshaller(ProtoUtils.marshaller(EnumRequest.getDefaultInstance())) - .setResponseMarshaller(ProtoUtils.marshaller(EnumResponse.getDefaultInstance())) - .build(); - - private static final MethodDescriptor verifyEnumMethodDescriptor = - MethodDescriptor.newBuilder() - .setType(MethodDescriptor.MethodType.UNARY) - .setFullMethodName("google.showcase.v1beta1.Compliance/VerifyEnum") - .setRequestMarshaller(ProtoUtils.marshaller(EnumResponse.getDefaultInstance())) - .setResponseMarshaller(ProtoUtils.marshaller(EnumResponse.getDefaultInstance())) - .build(); - - private final UnaryCallable repeatDataBodyCallable; - private final UnaryCallable repeatDataBodyInfoCallable; - private final UnaryCallable repeatDataQueryCallable; - private final UnaryCallable repeatDataSimplePathCallable; - private final UnaryCallable repeatDataPathResourceCallable; - private final UnaryCallable repeatDataPathTrailingResourceCallable; - private final UnaryCallable repeatDataBodyPutCallable; - private final UnaryCallable repeatDataBodyPatchCallable; - private final UnaryCallable getEnumCallable; - private final UnaryCallable verifyEnumCallable; - - private final BackgroundResource backgroundResources; - private final GrpcOperationsStub operationsStub; - private final GrpcStubCallableFactory callableFactory; - - public static final GrpcComplianceStub create(ComplianceStubSettings settings) - throws IOException { - return new GrpcComplianceStub(settings, ClientContext.create(settings)); - } - - public static final GrpcComplianceStub create(ClientContext clientContext) throws IOException { - return new GrpcComplianceStub(ComplianceStubSettings.newBuilder().build(), clientContext); - } - - public static final GrpcComplianceStub create( - ClientContext clientContext, GrpcStubCallableFactory callableFactory) throws IOException { - return new GrpcComplianceStub( - ComplianceStubSettings.newBuilder().build(), clientContext, callableFactory); - } - - /** - * Constructs an instance of GrpcComplianceStub, 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 GrpcComplianceStub(ComplianceStubSettings settings, ClientContext clientContext) - throws IOException { - this(settings, clientContext, new GrpcComplianceCallableFactory()); - } - - /** - * Constructs an instance of GrpcComplianceStub, 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 GrpcComplianceStub( - ComplianceStubSettings settings, - ClientContext clientContext, - GrpcStubCallableFactory callableFactory) - throws IOException { - this.callableFactory = callableFactory; - this.operationsStub = GrpcOperationsStub.create(clientContext, callableFactory); - - GrpcCallSettings repeatDataBodyTransportSettings = - GrpcCallSettings.newBuilder() - .setMethodDescriptor(repeatDataBodyMethodDescriptor) - .build(); - GrpcCallSettings repeatDataBodyInfoTransportSettings = - GrpcCallSettings.newBuilder() - .setMethodDescriptor(repeatDataBodyInfoMethodDescriptor) - .build(); - GrpcCallSettings repeatDataQueryTransportSettings = - GrpcCallSettings.newBuilder() - .setMethodDescriptor(repeatDataQueryMethodDescriptor) - .build(); - GrpcCallSettings repeatDataSimplePathTransportSettings = - GrpcCallSettings.newBuilder() - .setMethodDescriptor(repeatDataSimplePathMethodDescriptor) - .setParamsExtractor( - request -> { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("info.f_bool", String.valueOf(request.getInfo().getFBool())); - params.put("info.f_double", String.valueOf(request.getInfo().getFDouble())); - params.put("info.f_int32", String.valueOf(request.getInfo().getFInt32())); - params.put("info.f_kingdom", String.valueOf(request.getInfo().getFKingdom())); - params.put("info.f_string", String.valueOf(request.getInfo().getFString())); - return params.build(); - }) - .build(); - GrpcCallSettings repeatDataPathResourceTransportSettings = - GrpcCallSettings.newBuilder() - .setMethodDescriptor(repeatDataPathResourceMethodDescriptor) - .setParamsExtractor( - request -> { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("info.f_bool", String.valueOf(request.getInfo().getFBool())); - params.put( - "info.f_child.f_string", - String.valueOf(request.getInfo().getFChild().getFString())); - params.put("info.f_string", String.valueOf(request.getInfo().getFString())); - return params.build(); - }) - .build(); - GrpcCallSettings - repeatDataPathTrailingResourceTransportSettings = - GrpcCallSettings.newBuilder() - .setMethodDescriptor(repeatDataPathTrailingResourceMethodDescriptor) - .setParamsExtractor( - request -> { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put( - "info.f_child.f_string", - String.valueOf(request.getInfo().getFChild().getFString())); - params.put("info.f_string", String.valueOf(request.getInfo().getFString())); - return params.build(); - }) - .build(); - GrpcCallSettings repeatDataBodyPutTransportSettings = - GrpcCallSettings.newBuilder() - .setMethodDescriptor(repeatDataBodyPutMethodDescriptor) - .build(); - GrpcCallSettings repeatDataBodyPatchTransportSettings = - GrpcCallSettings.newBuilder() - .setMethodDescriptor(repeatDataBodyPatchMethodDescriptor) - .build(); - GrpcCallSettings getEnumTransportSettings = - GrpcCallSettings.newBuilder() - .setMethodDescriptor(getEnumMethodDescriptor) - .build(); - GrpcCallSettings verifyEnumTransportSettings = - GrpcCallSettings.newBuilder() - .setMethodDescriptor(verifyEnumMethodDescriptor) - .build(); - - this.repeatDataBodyCallable = - callableFactory.createUnaryCallable( - repeatDataBodyTransportSettings, settings.repeatDataBodySettings(), clientContext); - this.repeatDataBodyInfoCallable = - callableFactory.createUnaryCallable( - repeatDataBodyInfoTransportSettings, - settings.repeatDataBodyInfoSettings(), - clientContext); - this.repeatDataQueryCallable = - callableFactory.createUnaryCallable( - repeatDataQueryTransportSettings, settings.repeatDataQuerySettings(), clientContext); - this.repeatDataSimplePathCallable = - callableFactory.createUnaryCallable( - repeatDataSimplePathTransportSettings, - settings.repeatDataSimplePathSettings(), - clientContext); - this.repeatDataPathResourceCallable = - callableFactory.createUnaryCallable( - repeatDataPathResourceTransportSettings, - settings.repeatDataPathResourceSettings(), - clientContext); - this.repeatDataPathTrailingResourceCallable = - callableFactory.createUnaryCallable( - repeatDataPathTrailingResourceTransportSettings, - settings.repeatDataPathTrailingResourceSettings(), - clientContext); - this.repeatDataBodyPutCallable = - callableFactory.createUnaryCallable( - repeatDataBodyPutTransportSettings, - settings.repeatDataBodyPutSettings(), - clientContext); - this.repeatDataBodyPatchCallable = - callableFactory.createUnaryCallable( - repeatDataBodyPatchTransportSettings, - settings.repeatDataBodyPatchSettings(), - clientContext); - this.getEnumCallable = - callableFactory.createUnaryCallable( - getEnumTransportSettings, settings.getEnumSettings(), clientContext); - this.verifyEnumCallable = - callableFactory.createUnaryCallable( - verifyEnumTransportSettings, settings.verifyEnumSettings(), clientContext); - - this.backgroundResources = - new BackgroundResourceAggregation(clientContext.getBackgroundResources()); - } - - public GrpcOperationsStub getOperationsStub() { - return operationsStub; - } - - @Override - public UnaryCallable repeatDataBodyCallable() { - return repeatDataBodyCallable; - } - - @Override - public UnaryCallable repeatDataBodyInfoCallable() { - return repeatDataBodyInfoCallable; - } - - @Override - public UnaryCallable repeatDataQueryCallable() { - return repeatDataQueryCallable; - } - - @Override - public UnaryCallable repeatDataSimplePathCallable() { - return repeatDataSimplePathCallable; - } - - @Override - public UnaryCallable repeatDataPathResourceCallable() { - return repeatDataPathResourceCallable; - } - - @Override - public UnaryCallable repeatDataPathTrailingResourceCallable() { - return repeatDataPathTrailingResourceCallable; - } - - @Override - public UnaryCallable repeatDataBodyPutCallable() { - return repeatDataBodyPutCallable; - } - - @Override - public UnaryCallable repeatDataBodyPatchCallable() { - return repeatDataBodyPatchCallable; - } - - @Override - public UnaryCallable getEnumCallable() { - return getEnumCallable; - } - - @Override - public UnaryCallable verifyEnumCallable() { - return verifyEnumCallable; - } - - @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/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/GrpcEchoCallableFactory.java b/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/GrpcEchoCallableFactory.java deleted file mode 100644 index 3306812933..0000000000 --- a/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/GrpcEchoCallableFactory.java +++ /dev/null @@ -1,115 +0,0 @@ -/* - * 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 - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1.stub; - -import com.google.api.core.BetaApi; -import com.google.api.gax.grpc.GrpcCallSettings; -import com.google.api.gax.grpc.GrpcCallableFactory; -import com.google.api.gax.grpc.GrpcStubCallableFactory; -import com.google.api.gax.rpc.BatchingCallSettings; -import com.google.api.gax.rpc.BidiStreamingCallable; -import com.google.api.gax.rpc.ClientContext; -import com.google.api.gax.rpc.ClientStreamingCallable; -import com.google.api.gax.rpc.OperationCallSettings; -import com.google.api.gax.rpc.OperationCallable; -import com.google.api.gax.rpc.PagedCallSettings; -import com.google.api.gax.rpc.ServerStreamingCallSettings; -import com.google.api.gax.rpc.ServerStreamingCallable; -import com.google.api.gax.rpc.StreamingCallSettings; -import com.google.api.gax.rpc.UnaryCallSettings; -import com.google.api.gax.rpc.UnaryCallable; -import com.google.longrunning.Operation; -import com.google.longrunning.stub.OperationsStub; -import javax.annotation.Generated; - -// AUTO-GENERATED DOCUMENTATION AND CLASS. -/** - * gRPC callable factory implementation for the Echo service API. - * - *

        This class is for advanced usage. - */ -@BetaApi -@Generated("by gapic-generator-java") -public class GrpcEchoCallableFactory 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/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/GrpcEchoStub.java b/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/GrpcEchoStub.java deleted file mode 100644 index 3e8a99d5b2..0000000000 --- a/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/GrpcEchoStub.java +++ /dev/null @@ -1,413 +0,0 @@ -/* - * 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 - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1.stub; - -import static com.google.showcase.v1beta1.EchoClient.PagedExpandLegacyMappedPagedResponse; -import static com.google.showcase.v1beta1.EchoClient.PagedExpandPagedResponse; - -import com.google.api.core.BetaApi; -import com.google.api.gax.core.BackgroundResource; -import com.google.api.gax.core.BackgroundResourceAggregation; -import com.google.api.gax.grpc.GrpcCallSettings; -import com.google.api.gax.grpc.GrpcStubCallableFactory; -import com.google.api.gax.rpc.BidiStreamingCallable; -import com.google.api.gax.rpc.ClientContext; -import com.google.api.gax.rpc.ClientStreamingCallable; -import com.google.api.gax.rpc.OperationCallable; -import com.google.api.gax.rpc.RequestParamsBuilder; -import com.google.api.gax.rpc.ServerStreamingCallable; -import com.google.api.gax.rpc.UnaryCallable; -import com.google.api.pathtemplate.PathTemplate; -import com.google.longrunning.Operation; -import com.google.longrunning.stub.GrpcOperationsStub; -import com.google.showcase.v1beta1.BlockRequest; -import com.google.showcase.v1beta1.BlockResponse; -import com.google.showcase.v1beta1.EchoRequest; -import com.google.showcase.v1beta1.EchoResponse; -import com.google.showcase.v1beta1.ExpandRequest; -import com.google.showcase.v1beta1.PagedExpandLegacyMappedResponse; -import com.google.showcase.v1beta1.PagedExpandLegacyRequest; -import com.google.showcase.v1beta1.PagedExpandRequest; -import com.google.showcase.v1beta1.PagedExpandResponse; -import com.google.showcase.v1beta1.WaitMetadata; -import com.google.showcase.v1beta1.WaitRequest; -import com.google.showcase.v1beta1.WaitResponse; -import io.grpc.MethodDescriptor; -import io.grpc.protobuf.ProtoUtils; -import java.io.IOException; -import java.util.Map; -import java.util.concurrent.TimeUnit; -import javax.annotation.Generated; - -// AUTO-GENERATED DOCUMENTATION AND CLASS. -/** - * gRPC stub implementation for the Echo service API. - * - *

        This class is for advanced usage and reflects the underlying API directly. - */ -@BetaApi -@Generated("by gapic-generator-java") -public class GrpcEchoStub extends EchoStub { - private static final MethodDescriptor echoMethodDescriptor = - MethodDescriptor.newBuilder() - .setType(MethodDescriptor.MethodType.UNARY) - .setFullMethodName("google.showcase.v1beta1.Echo/Echo") - .setRequestMarshaller(ProtoUtils.marshaller(EchoRequest.getDefaultInstance())) - .setResponseMarshaller(ProtoUtils.marshaller(EchoResponse.getDefaultInstance())) - .build(); - - private static final MethodDescriptor expandMethodDescriptor = - MethodDescriptor.newBuilder() - .setType(MethodDescriptor.MethodType.SERVER_STREAMING) - .setFullMethodName("google.showcase.v1beta1.Echo/Expand") - .setRequestMarshaller(ProtoUtils.marshaller(ExpandRequest.getDefaultInstance())) - .setResponseMarshaller(ProtoUtils.marshaller(EchoResponse.getDefaultInstance())) - .build(); - - private static final MethodDescriptor collectMethodDescriptor = - MethodDescriptor.newBuilder() - .setType(MethodDescriptor.MethodType.CLIENT_STREAMING) - .setFullMethodName("google.showcase.v1beta1.Echo/Collect") - .setRequestMarshaller(ProtoUtils.marshaller(EchoRequest.getDefaultInstance())) - .setResponseMarshaller(ProtoUtils.marshaller(EchoResponse.getDefaultInstance())) - .build(); - - private static final MethodDescriptor chatMethodDescriptor = - MethodDescriptor.newBuilder() - .setType(MethodDescriptor.MethodType.BIDI_STREAMING) - .setFullMethodName("google.showcase.v1beta1.Echo/Chat") - .setRequestMarshaller(ProtoUtils.marshaller(EchoRequest.getDefaultInstance())) - .setResponseMarshaller(ProtoUtils.marshaller(EchoResponse.getDefaultInstance())) - .build(); - - private static final MethodDescriptor - pagedExpandMethodDescriptor = - MethodDescriptor.newBuilder() - .setType(MethodDescriptor.MethodType.UNARY) - .setFullMethodName("google.showcase.v1beta1.Echo/PagedExpand") - .setRequestMarshaller(ProtoUtils.marshaller(PagedExpandRequest.getDefaultInstance())) - .setResponseMarshaller( - ProtoUtils.marshaller(PagedExpandResponse.getDefaultInstance())) - .build(); - - private static final MethodDescriptor - pagedExpandLegacyMethodDescriptor = - MethodDescriptor.newBuilder() - .setType(MethodDescriptor.MethodType.UNARY) - .setFullMethodName("google.showcase.v1beta1.Echo/PagedExpandLegacy") - .setRequestMarshaller( - ProtoUtils.marshaller(PagedExpandLegacyRequest.getDefaultInstance())) - .setResponseMarshaller( - ProtoUtils.marshaller(PagedExpandResponse.getDefaultInstance())) - .build(); - - private static final MethodDescriptor - pagedExpandLegacyMappedMethodDescriptor = - MethodDescriptor.newBuilder() - .setType(MethodDescriptor.MethodType.UNARY) - .setFullMethodName("google.showcase.v1beta1.Echo/PagedExpandLegacyMapped") - .setRequestMarshaller(ProtoUtils.marshaller(PagedExpandRequest.getDefaultInstance())) - .setResponseMarshaller( - ProtoUtils.marshaller(PagedExpandLegacyMappedResponse.getDefaultInstance())) - .build(); - - private static final MethodDescriptor waitMethodDescriptor = - MethodDescriptor.newBuilder() - .setType(MethodDescriptor.MethodType.UNARY) - .setFullMethodName("google.showcase.v1beta1.Echo/Wait") - .setRequestMarshaller(ProtoUtils.marshaller(WaitRequest.getDefaultInstance())) - .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) - .build(); - - private static final MethodDescriptor blockMethodDescriptor = - MethodDescriptor.newBuilder() - .setType(MethodDescriptor.MethodType.UNARY) - .setFullMethodName("google.showcase.v1beta1.Echo/Block") - .setRequestMarshaller(ProtoUtils.marshaller(BlockRequest.getDefaultInstance())) - .setResponseMarshaller(ProtoUtils.marshaller(BlockResponse.getDefaultInstance())) - .build(); - - private final UnaryCallable echoCallable; - private final ServerStreamingCallable expandCallable; - private final ClientStreamingCallable collectCallable; - private final BidiStreamingCallable chatCallable; - private final UnaryCallable pagedExpandCallable; - private final UnaryCallable - pagedExpandPagedCallable; - private final UnaryCallable - pagedExpandLegacyCallable; - private final UnaryCallable - pagedExpandLegacyMappedCallable; - private final UnaryCallable - pagedExpandLegacyMappedPagedCallable; - private final UnaryCallable waitCallable; - private final OperationCallable waitOperationCallable; - private final UnaryCallable blockCallable; - - private final BackgroundResource backgroundResources; - private final GrpcOperationsStub operationsStub; - private final GrpcStubCallableFactory callableFactory; - - private static final PathTemplate ECHO_0_PATH_TEMPLATE = PathTemplate.create("{header=**}"); - private static final PathTemplate ECHO_1_PATH_TEMPLATE = PathTemplate.create("{routing_id=**}"); - private static final PathTemplate ECHO_2_PATH_TEMPLATE = - PathTemplate.create("{table_name=regions/*/zones/*/**}"); - private static final PathTemplate ECHO_3_PATH_TEMPLATE = - PathTemplate.create("{super_id=projects/*}/**"); - private static final PathTemplate ECHO_4_PATH_TEMPLATE = - PathTemplate.create("{table_name=projects/*/instances/*/**}"); - private static final PathTemplate ECHO_5_PATH_TEMPLATE = - PathTemplate.create("projects/*/{instance_id=instances/*}/**"); - private static final PathTemplate ECHO_6_PATH_TEMPLATE = PathTemplate.create("{baz=**}"); - private static final PathTemplate ECHO_7_PATH_TEMPLATE = - PathTemplate.create("{qux=projects/*}/**"); - - public static final GrpcEchoStub create(EchoStubSettings settings) throws IOException { - return new GrpcEchoStub(settings, ClientContext.create(settings)); - } - - public static final GrpcEchoStub create(ClientContext clientContext) throws IOException { - return new GrpcEchoStub(EchoStubSettings.newBuilder().build(), clientContext); - } - - public static final GrpcEchoStub create( - ClientContext clientContext, GrpcStubCallableFactory callableFactory) throws IOException { - return new GrpcEchoStub(EchoStubSettings.newBuilder().build(), clientContext, callableFactory); - } - - /** - * Constructs an instance of GrpcEchoStub, 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 GrpcEchoStub(EchoStubSettings settings, ClientContext clientContext) - throws IOException { - this(settings, clientContext, new GrpcEchoCallableFactory()); - } - - /** - * Constructs an instance of GrpcEchoStub, 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 GrpcEchoStub( - EchoStubSettings settings, - ClientContext clientContext, - GrpcStubCallableFactory callableFactory) - throws IOException { - this.callableFactory = callableFactory; - this.operationsStub = GrpcOperationsStub.create(clientContext, callableFactory); - - GrpcCallSettings echoTransportSettings = - GrpcCallSettings.newBuilder() - .setMethodDescriptor(echoMethodDescriptor) - .setParamsExtractor( - request -> { - RequestParamsBuilder builder = RequestParamsBuilder.create(); - builder.add(request.getHeader(), "header", ECHO_0_PATH_TEMPLATE); - builder.add(request.getHeader(), "routing_id", ECHO_1_PATH_TEMPLATE); - builder.add(request.getHeader(), "table_name", ECHO_2_PATH_TEMPLATE); - builder.add(request.getHeader(), "super_id", ECHO_3_PATH_TEMPLATE); - builder.add(request.getHeader(), "table_name", ECHO_4_PATH_TEMPLATE); - builder.add(request.getHeader(), "instance_id", ECHO_5_PATH_TEMPLATE); - builder.add(request.getOtherHeader(), "baz", ECHO_6_PATH_TEMPLATE); - builder.add(request.getOtherHeader(), "qux", ECHO_7_PATH_TEMPLATE); - return builder.build(); - }) - .build(); - GrpcCallSettings expandTransportSettings = - GrpcCallSettings.newBuilder() - .setMethodDescriptor(expandMethodDescriptor) - .build(); - GrpcCallSettings collectTransportSettings = - GrpcCallSettings.newBuilder() - .setMethodDescriptor(collectMethodDescriptor) - .build(); - GrpcCallSettings chatTransportSettings = - GrpcCallSettings.newBuilder() - .setMethodDescriptor(chatMethodDescriptor) - .build(); - GrpcCallSettings pagedExpandTransportSettings = - GrpcCallSettings.newBuilder() - .setMethodDescriptor(pagedExpandMethodDescriptor) - .build(); - GrpcCallSettings - pagedExpandLegacyTransportSettings = - GrpcCallSettings.newBuilder() - .setMethodDescriptor(pagedExpandLegacyMethodDescriptor) - .build(); - GrpcCallSettings - pagedExpandLegacyMappedTransportSettings = - GrpcCallSettings.newBuilder() - .setMethodDescriptor(pagedExpandLegacyMappedMethodDescriptor) - .build(); - GrpcCallSettings waitTransportSettings = - GrpcCallSettings.newBuilder() - .setMethodDescriptor(waitMethodDescriptor) - .build(); - GrpcCallSettings blockTransportSettings = - GrpcCallSettings.newBuilder() - .setMethodDescriptor(blockMethodDescriptor) - .build(); - - this.echoCallable = - callableFactory.createUnaryCallable( - echoTransportSettings, settings.echoSettings(), clientContext); - this.expandCallable = - callableFactory.createServerStreamingCallable( - expandTransportSettings, settings.expandSettings(), clientContext); - this.collectCallable = - callableFactory.createClientStreamingCallable( - collectTransportSettings, settings.collectSettings(), clientContext); - this.chatCallable = - callableFactory.createBidiStreamingCallable( - chatTransportSettings, settings.chatSettings(), clientContext); - this.pagedExpandCallable = - callableFactory.createUnaryCallable( - pagedExpandTransportSettings, settings.pagedExpandSettings(), clientContext); - this.pagedExpandPagedCallable = - callableFactory.createPagedCallable( - pagedExpandTransportSettings, settings.pagedExpandSettings(), clientContext); - this.pagedExpandLegacyCallable = - callableFactory.createUnaryCallable( - pagedExpandLegacyTransportSettings, - settings.pagedExpandLegacySettings(), - clientContext); - this.pagedExpandLegacyMappedCallable = - callableFactory.createUnaryCallable( - pagedExpandLegacyMappedTransportSettings, - settings.pagedExpandLegacyMappedSettings(), - clientContext); - this.pagedExpandLegacyMappedPagedCallable = - callableFactory.createPagedCallable( - pagedExpandLegacyMappedTransportSettings, - settings.pagedExpandLegacyMappedSettings(), - clientContext); - this.waitCallable = - callableFactory.createUnaryCallable( - waitTransportSettings, settings.waitSettings(), clientContext); - this.waitOperationCallable = - callableFactory.createOperationCallable( - waitTransportSettings, settings.waitOperationSettings(), clientContext, operationsStub); - this.blockCallable = - callableFactory.createUnaryCallable( - blockTransportSettings, settings.blockSettings(), clientContext); - - this.backgroundResources = - new BackgroundResourceAggregation(clientContext.getBackgroundResources()); - } - - public GrpcOperationsStub getOperationsStub() { - return operationsStub; - } - - @Override - public UnaryCallable echoCallable() { - return echoCallable; - } - - @Override - public ServerStreamingCallable expandCallable() { - return expandCallable; - } - - @Override - public ClientStreamingCallable collectCallable() { - return collectCallable; - } - - @Override - public BidiStreamingCallable chatCallable() { - return chatCallable; - } - - @Override - public UnaryCallable pagedExpandCallable() { - return pagedExpandCallable; - } - - @Override - public UnaryCallable pagedExpandPagedCallable() { - return pagedExpandPagedCallable; - } - - @Override - public UnaryCallable pagedExpandLegacyCallable() { - return pagedExpandLegacyCallable; - } - - @Override - public UnaryCallable - pagedExpandLegacyMappedCallable() { - return pagedExpandLegacyMappedCallable; - } - - @Override - public UnaryCallable - pagedExpandLegacyMappedPagedCallable() { - return pagedExpandLegacyMappedPagedCallable; - } - - @Override - public UnaryCallable waitCallable() { - return waitCallable; - } - - @Override - public OperationCallable waitOperationCallable() { - return waitOperationCallable; - } - - @Override - public UnaryCallable blockCallable() { - return blockCallable; - } - - @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/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/GrpcIdentityCallableFactory.java b/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/GrpcIdentityCallableFactory.java deleted file mode 100644 index 313391c0ee..0000000000 --- a/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/GrpcIdentityCallableFactory.java +++ /dev/null @@ -1,115 +0,0 @@ -/* - * 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 - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1.stub; - -import com.google.api.core.BetaApi; -import com.google.api.gax.grpc.GrpcCallSettings; -import com.google.api.gax.grpc.GrpcCallableFactory; -import com.google.api.gax.grpc.GrpcStubCallableFactory; -import com.google.api.gax.rpc.BatchingCallSettings; -import com.google.api.gax.rpc.BidiStreamingCallable; -import com.google.api.gax.rpc.ClientContext; -import com.google.api.gax.rpc.ClientStreamingCallable; -import com.google.api.gax.rpc.OperationCallSettings; -import com.google.api.gax.rpc.OperationCallable; -import com.google.api.gax.rpc.PagedCallSettings; -import com.google.api.gax.rpc.ServerStreamingCallSettings; -import com.google.api.gax.rpc.ServerStreamingCallable; -import com.google.api.gax.rpc.StreamingCallSettings; -import com.google.api.gax.rpc.UnaryCallSettings; -import com.google.api.gax.rpc.UnaryCallable; -import com.google.longrunning.Operation; -import com.google.longrunning.stub.OperationsStub; -import javax.annotation.Generated; - -// AUTO-GENERATED DOCUMENTATION AND CLASS. -/** - * gRPC callable factory implementation for the Identity service API. - * - *

        This class is for advanced usage. - */ -@BetaApi -@Generated("by gapic-generator-java") -public class GrpcIdentityCallableFactory 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/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/GrpcIdentityStub.java b/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/GrpcIdentityStub.java deleted file mode 100644 index 516fe97b2b..0000000000 --- a/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/GrpcIdentityStub.java +++ /dev/null @@ -1,272 +0,0 @@ -/* - * 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 - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1.stub; - -import static com.google.showcase.v1beta1.IdentityClient.ListUsersPagedResponse; - -import com.google.api.core.BetaApi; -import com.google.api.gax.core.BackgroundResource; -import com.google.api.gax.core.BackgroundResourceAggregation; -import com.google.api.gax.grpc.GrpcCallSettings; -import com.google.api.gax.grpc.GrpcStubCallableFactory; -import com.google.api.gax.rpc.ClientContext; -import com.google.api.gax.rpc.UnaryCallable; -import com.google.common.collect.ImmutableMap; -import com.google.longrunning.stub.GrpcOperationsStub; -import com.google.protobuf.Empty; -import com.google.showcase.v1beta1.CreateUserRequest; -import com.google.showcase.v1beta1.DeleteUserRequest; -import com.google.showcase.v1beta1.GetUserRequest; -import com.google.showcase.v1beta1.ListUsersRequest; -import com.google.showcase.v1beta1.ListUsersResponse; -import com.google.showcase.v1beta1.UpdateUserRequest; -import com.google.showcase.v1beta1.User; -import io.grpc.MethodDescriptor; -import io.grpc.protobuf.ProtoUtils; -import java.io.IOException; -import java.util.Map; -import java.util.concurrent.TimeUnit; -import javax.annotation.Generated; - -// AUTO-GENERATED DOCUMENTATION AND CLASS. -/** - * gRPC stub implementation for the Identity service API. - * - *

        This class is for advanced usage and reflects the underlying API directly. - */ -@BetaApi -@Generated("by gapic-generator-java") -public class GrpcIdentityStub extends IdentityStub { - private static final MethodDescriptor createUserMethodDescriptor = - MethodDescriptor.newBuilder() - .setType(MethodDescriptor.MethodType.UNARY) - .setFullMethodName("google.showcase.v1beta1.Identity/CreateUser") - .setRequestMarshaller(ProtoUtils.marshaller(CreateUserRequest.getDefaultInstance())) - .setResponseMarshaller(ProtoUtils.marshaller(User.getDefaultInstance())) - .build(); - - private static final MethodDescriptor getUserMethodDescriptor = - MethodDescriptor.newBuilder() - .setType(MethodDescriptor.MethodType.UNARY) - .setFullMethodName("google.showcase.v1beta1.Identity/GetUser") - .setRequestMarshaller(ProtoUtils.marshaller(GetUserRequest.getDefaultInstance())) - .setResponseMarshaller(ProtoUtils.marshaller(User.getDefaultInstance())) - .build(); - - private static final MethodDescriptor updateUserMethodDescriptor = - MethodDescriptor.newBuilder() - .setType(MethodDescriptor.MethodType.UNARY) - .setFullMethodName("google.showcase.v1beta1.Identity/UpdateUser") - .setRequestMarshaller(ProtoUtils.marshaller(UpdateUserRequest.getDefaultInstance())) - .setResponseMarshaller(ProtoUtils.marshaller(User.getDefaultInstance())) - .build(); - - private static final MethodDescriptor deleteUserMethodDescriptor = - MethodDescriptor.newBuilder() - .setType(MethodDescriptor.MethodType.UNARY) - .setFullMethodName("google.showcase.v1beta1.Identity/DeleteUser") - .setRequestMarshaller(ProtoUtils.marshaller(DeleteUserRequest.getDefaultInstance())) - .setResponseMarshaller(ProtoUtils.marshaller(Empty.getDefaultInstance())) - .build(); - - private static final MethodDescriptor - listUsersMethodDescriptor = - MethodDescriptor.newBuilder() - .setType(MethodDescriptor.MethodType.UNARY) - .setFullMethodName("google.showcase.v1beta1.Identity/ListUsers") - .setRequestMarshaller(ProtoUtils.marshaller(ListUsersRequest.getDefaultInstance())) - .setResponseMarshaller(ProtoUtils.marshaller(ListUsersResponse.getDefaultInstance())) - .build(); - - private final UnaryCallable createUserCallable; - private final UnaryCallable getUserCallable; - private final UnaryCallable updateUserCallable; - private final UnaryCallable deleteUserCallable; - private final UnaryCallable listUsersCallable; - private final UnaryCallable listUsersPagedCallable; - - private final BackgroundResource backgroundResources; - private final GrpcOperationsStub operationsStub; - private final GrpcStubCallableFactory callableFactory; - - public static final GrpcIdentityStub create(IdentityStubSettings settings) throws IOException { - return new GrpcIdentityStub(settings, ClientContext.create(settings)); - } - - public static final GrpcIdentityStub create(ClientContext clientContext) throws IOException { - return new GrpcIdentityStub(IdentityStubSettings.newBuilder().build(), clientContext); - } - - public static final GrpcIdentityStub create( - ClientContext clientContext, GrpcStubCallableFactory callableFactory) throws IOException { - return new GrpcIdentityStub( - IdentityStubSettings.newBuilder().build(), clientContext, callableFactory); - } - - /** - * Constructs an instance of GrpcIdentityStub, 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 GrpcIdentityStub(IdentityStubSettings settings, ClientContext clientContext) - throws IOException { - this(settings, clientContext, new GrpcIdentityCallableFactory()); - } - - /** - * Constructs an instance of GrpcIdentityStub, 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 GrpcIdentityStub( - IdentityStubSettings settings, - ClientContext clientContext, - GrpcStubCallableFactory callableFactory) - throws IOException { - this.callableFactory = callableFactory; - this.operationsStub = GrpcOperationsStub.create(clientContext, callableFactory); - - GrpcCallSettings createUserTransportSettings = - GrpcCallSettings.newBuilder() - .setMethodDescriptor(createUserMethodDescriptor) - .build(); - GrpcCallSettings getUserTransportSettings = - GrpcCallSettings.newBuilder() - .setMethodDescriptor(getUserMethodDescriptor) - .setParamsExtractor( - request -> { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("name", String.valueOf(request.getName())); - return params.build(); - }) - .build(); - GrpcCallSettings updateUserTransportSettings = - GrpcCallSettings.newBuilder() - .setMethodDescriptor(updateUserMethodDescriptor) - .setParamsExtractor( - request -> { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("user.name", String.valueOf(request.getUser().getName())); - return params.build(); - }) - .build(); - GrpcCallSettings deleteUserTransportSettings = - GrpcCallSettings.newBuilder() - .setMethodDescriptor(deleteUserMethodDescriptor) - .setParamsExtractor( - request -> { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("name", String.valueOf(request.getName())); - return params.build(); - }) - .build(); - GrpcCallSettings listUsersTransportSettings = - GrpcCallSettings.newBuilder() - .setMethodDescriptor(listUsersMethodDescriptor) - .build(); - - this.createUserCallable = - callableFactory.createUnaryCallable( - createUserTransportSettings, settings.createUserSettings(), clientContext); - this.getUserCallable = - callableFactory.createUnaryCallable( - getUserTransportSettings, settings.getUserSettings(), clientContext); - this.updateUserCallable = - callableFactory.createUnaryCallable( - updateUserTransportSettings, settings.updateUserSettings(), clientContext); - this.deleteUserCallable = - callableFactory.createUnaryCallable( - deleteUserTransportSettings, settings.deleteUserSettings(), clientContext); - this.listUsersCallable = - callableFactory.createUnaryCallable( - listUsersTransportSettings, settings.listUsersSettings(), clientContext); - this.listUsersPagedCallable = - callableFactory.createPagedCallable( - listUsersTransportSettings, settings.listUsersSettings(), clientContext); - - this.backgroundResources = - new BackgroundResourceAggregation(clientContext.getBackgroundResources()); - } - - public GrpcOperationsStub getOperationsStub() { - return operationsStub; - } - - @Override - public UnaryCallable createUserCallable() { - return createUserCallable; - } - - @Override - public UnaryCallable getUserCallable() { - return getUserCallable; - } - - @Override - public UnaryCallable updateUserCallable() { - return updateUserCallable; - } - - @Override - public UnaryCallable deleteUserCallable() { - return deleteUserCallable; - } - - @Override - public UnaryCallable listUsersCallable() { - return listUsersCallable; - } - - @Override - public UnaryCallable listUsersPagedCallable() { - return listUsersPagedCallable; - } - - @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/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/GrpcMessagingCallableFactory.java b/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/GrpcMessagingCallableFactory.java deleted file mode 100644 index 82e36cdcdf..0000000000 --- a/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/GrpcMessagingCallableFactory.java +++ /dev/null @@ -1,115 +0,0 @@ -/* - * 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 - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1.stub; - -import com.google.api.core.BetaApi; -import com.google.api.gax.grpc.GrpcCallSettings; -import com.google.api.gax.grpc.GrpcCallableFactory; -import com.google.api.gax.grpc.GrpcStubCallableFactory; -import com.google.api.gax.rpc.BatchingCallSettings; -import com.google.api.gax.rpc.BidiStreamingCallable; -import com.google.api.gax.rpc.ClientContext; -import com.google.api.gax.rpc.ClientStreamingCallable; -import com.google.api.gax.rpc.OperationCallSettings; -import com.google.api.gax.rpc.OperationCallable; -import com.google.api.gax.rpc.PagedCallSettings; -import com.google.api.gax.rpc.ServerStreamingCallSettings; -import com.google.api.gax.rpc.ServerStreamingCallable; -import com.google.api.gax.rpc.StreamingCallSettings; -import com.google.api.gax.rpc.UnaryCallSettings; -import com.google.api.gax.rpc.UnaryCallable; -import com.google.longrunning.Operation; -import com.google.longrunning.stub.OperationsStub; -import javax.annotation.Generated; - -// AUTO-GENERATED DOCUMENTATION AND CLASS. -/** - * gRPC callable factory implementation for the Messaging service API. - * - *

        This class is for advanced usage. - */ -@BetaApi -@Generated("by gapic-generator-java") -public class GrpcMessagingCallableFactory 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/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/GrpcMessagingStub.java b/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/GrpcMessagingStub.java deleted file mode 100644 index 91be592df1..0000000000 --- a/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/GrpcMessagingStub.java +++ /dev/null @@ -1,562 +0,0 @@ -/* - * 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 - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1.stub; - -import static com.google.showcase.v1beta1.MessagingClient.ListBlurbsPagedResponse; -import static com.google.showcase.v1beta1.MessagingClient.ListRoomsPagedResponse; - -import com.google.api.core.BetaApi; -import com.google.api.gax.core.BackgroundResource; -import com.google.api.gax.core.BackgroundResourceAggregation; -import com.google.api.gax.grpc.GrpcCallSettings; -import com.google.api.gax.grpc.GrpcStubCallableFactory; -import com.google.api.gax.rpc.BidiStreamingCallable; -import com.google.api.gax.rpc.ClientContext; -import com.google.api.gax.rpc.ClientStreamingCallable; -import com.google.api.gax.rpc.OperationCallable; -import com.google.api.gax.rpc.ServerStreamingCallable; -import com.google.api.gax.rpc.UnaryCallable; -import com.google.common.collect.ImmutableMap; -import com.google.longrunning.Operation; -import com.google.longrunning.stub.GrpcOperationsStub; -import com.google.protobuf.Empty; -import com.google.showcase.v1beta1.Blurb; -import com.google.showcase.v1beta1.ConnectRequest; -import com.google.showcase.v1beta1.CreateBlurbRequest; -import com.google.showcase.v1beta1.CreateRoomRequest; -import com.google.showcase.v1beta1.DeleteBlurbRequest; -import com.google.showcase.v1beta1.DeleteRoomRequest; -import com.google.showcase.v1beta1.GetBlurbRequest; -import com.google.showcase.v1beta1.GetRoomRequest; -import com.google.showcase.v1beta1.ListBlurbsRequest; -import com.google.showcase.v1beta1.ListBlurbsResponse; -import com.google.showcase.v1beta1.ListRoomsRequest; -import com.google.showcase.v1beta1.ListRoomsResponse; -import com.google.showcase.v1beta1.Room; -import com.google.showcase.v1beta1.SearchBlurbsMetadata; -import com.google.showcase.v1beta1.SearchBlurbsRequest; -import com.google.showcase.v1beta1.SearchBlurbsResponse; -import com.google.showcase.v1beta1.SendBlurbsResponse; -import com.google.showcase.v1beta1.StreamBlurbsRequest; -import com.google.showcase.v1beta1.StreamBlurbsResponse; -import com.google.showcase.v1beta1.UpdateBlurbRequest; -import com.google.showcase.v1beta1.UpdateRoomRequest; -import io.grpc.MethodDescriptor; -import io.grpc.protobuf.ProtoUtils; -import java.io.IOException; -import java.util.Map; -import java.util.concurrent.TimeUnit; -import javax.annotation.Generated; - -// AUTO-GENERATED DOCUMENTATION AND CLASS. -/** - * gRPC stub implementation for the Messaging service API. - * - *

        This class is for advanced usage and reflects the underlying API directly. - */ -@BetaApi -@Generated("by gapic-generator-java") -public class GrpcMessagingStub extends MessagingStub { - private static final MethodDescriptor createRoomMethodDescriptor = - MethodDescriptor.newBuilder() - .setType(MethodDescriptor.MethodType.UNARY) - .setFullMethodName("google.showcase.v1beta1.Messaging/CreateRoom") - .setRequestMarshaller(ProtoUtils.marshaller(CreateRoomRequest.getDefaultInstance())) - .setResponseMarshaller(ProtoUtils.marshaller(Room.getDefaultInstance())) - .build(); - - private static final MethodDescriptor getRoomMethodDescriptor = - MethodDescriptor.newBuilder() - .setType(MethodDescriptor.MethodType.UNARY) - .setFullMethodName("google.showcase.v1beta1.Messaging/GetRoom") - .setRequestMarshaller(ProtoUtils.marshaller(GetRoomRequest.getDefaultInstance())) - .setResponseMarshaller(ProtoUtils.marshaller(Room.getDefaultInstance())) - .build(); - - private static final MethodDescriptor updateRoomMethodDescriptor = - MethodDescriptor.newBuilder() - .setType(MethodDescriptor.MethodType.UNARY) - .setFullMethodName("google.showcase.v1beta1.Messaging/UpdateRoom") - .setRequestMarshaller(ProtoUtils.marshaller(UpdateRoomRequest.getDefaultInstance())) - .setResponseMarshaller(ProtoUtils.marshaller(Room.getDefaultInstance())) - .build(); - - private static final MethodDescriptor deleteRoomMethodDescriptor = - MethodDescriptor.newBuilder() - .setType(MethodDescriptor.MethodType.UNARY) - .setFullMethodName("google.showcase.v1beta1.Messaging/DeleteRoom") - .setRequestMarshaller(ProtoUtils.marshaller(DeleteRoomRequest.getDefaultInstance())) - .setResponseMarshaller(ProtoUtils.marshaller(Empty.getDefaultInstance())) - .build(); - - private static final MethodDescriptor - listRoomsMethodDescriptor = - MethodDescriptor.newBuilder() - .setType(MethodDescriptor.MethodType.UNARY) - .setFullMethodName("google.showcase.v1beta1.Messaging/ListRooms") - .setRequestMarshaller(ProtoUtils.marshaller(ListRoomsRequest.getDefaultInstance())) - .setResponseMarshaller(ProtoUtils.marshaller(ListRoomsResponse.getDefaultInstance())) - .build(); - - private static final MethodDescriptor createBlurbMethodDescriptor = - MethodDescriptor.newBuilder() - .setType(MethodDescriptor.MethodType.UNARY) - .setFullMethodName("google.showcase.v1beta1.Messaging/CreateBlurb") - .setRequestMarshaller(ProtoUtils.marshaller(CreateBlurbRequest.getDefaultInstance())) - .setResponseMarshaller(ProtoUtils.marshaller(Blurb.getDefaultInstance())) - .build(); - - private static final MethodDescriptor getBlurbMethodDescriptor = - MethodDescriptor.newBuilder() - .setType(MethodDescriptor.MethodType.UNARY) - .setFullMethodName("google.showcase.v1beta1.Messaging/GetBlurb") - .setRequestMarshaller(ProtoUtils.marshaller(GetBlurbRequest.getDefaultInstance())) - .setResponseMarshaller(ProtoUtils.marshaller(Blurb.getDefaultInstance())) - .build(); - - private static final MethodDescriptor updateBlurbMethodDescriptor = - MethodDescriptor.newBuilder() - .setType(MethodDescriptor.MethodType.UNARY) - .setFullMethodName("google.showcase.v1beta1.Messaging/UpdateBlurb") - .setRequestMarshaller(ProtoUtils.marshaller(UpdateBlurbRequest.getDefaultInstance())) - .setResponseMarshaller(ProtoUtils.marshaller(Blurb.getDefaultInstance())) - .build(); - - private static final MethodDescriptor deleteBlurbMethodDescriptor = - MethodDescriptor.newBuilder() - .setType(MethodDescriptor.MethodType.UNARY) - .setFullMethodName("google.showcase.v1beta1.Messaging/DeleteBlurb") - .setRequestMarshaller(ProtoUtils.marshaller(DeleteBlurbRequest.getDefaultInstance())) - .setResponseMarshaller(ProtoUtils.marshaller(Empty.getDefaultInstance())) - .build(); - - private static final MethodDescriptor - listBlurbsMethodDescriptor = - MethodDescriptor.newBuilder() - .setType(MethodDescriptor.MethodType.UNARY) - .setFullMethodName("google.showcase.v1beta1.Messaging/ListBlurbs") - .setRequestMarshaller(ProtoUtils.marshaller(ListBlurbsRequest.getDefaultInstance())) - .setResponseMarshaller(ProtoUtils.marshaller(ListBlurbsResponse.getDefaultInstance())) - .build(); - - private static final MethodDescriptor - searchBlurbsMethodDescriptor = - MethodDescriptor.newBuilder() - .setType(MethodDescriptor.MethodType.UNARY) - .setFullMethodName("google.showcase.v1beta1.Messaging/SearchBlurbs") - .setRequestMarshaller(ProtoUtils.marshaller(SearchBlurbsRequest.getDefaultInstance())) - .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) - .build(); - - private static final MethodDescriptor - streamBlurbsMethodDescriptor = - MethodDescriptor.newBuilder() - .setType(MethodDescriptor.MethodType.SERVER_STREAMING) - .setFullMethodName("google.showcase.v1beta1.Messaging/StreamBlurbs") - .setRequestMarshaller(ProtoUtils.marshaller(StreamBlurbsRequest.getDefaultInstance())) - .setResponseMarshaller( - ProtoUtils.marshaller(StreamBlurbsResponse.getDefaultInstance())) - .build(); - - private static final MethodDescriptor - sendBlurbsMethodDescriptor = - MethodDescriptor.newBuilder() - .setType(MethodDescriptor.MethodType.CLIENT_STREAMING) - .setFullMethodName("google.showcase.v1beta1.Messaging/SendBlurbs") - .setRequestMarshaller(ProtoUtils.marshaller(CreateBlurbRequest.getDefaultInstance())) - .setResponseMarshaller(ProtoUtils.marshaller(SendBlurbsResponse.getDefaultInstance())) - .build(); - - private static final MethodDescriptor - connectMethodDescriptor = - MethodDescriptor.newBuilder() - .setType(MethodDescriptor.MethodType.BIDI_STREAMING) - .setFullMethodName("google.showcase.v1beta1.Messaging/Connect") - .setRequestMarshaller(ProtoUtils.marshaller(ConnectRequest.getDefaultInstance())) - .setResponseMarshaller( - ProtoUtils.marshaller(StreamBlurbsResponse.getDefaultInstance())) - .build(); - - private final UnaryCallable createRoomCallable; - private final UnaryCallable getRoomCallable; - private final UnaryCallable updateRoomCallable; - private final UnaryCallable deleteRoomCallable; - private final UnaryCallable listRoomsCallable; - private final UnaryCallable listRoomsPagedCallable; - private final UnaryCallable createBlurbCallable; - private final UnaryCallable getBlurbCallable; - private final UnaryCallable updateBlurbCallable; - private final UnaryCallable deleteBlurbCallable; - private final UnaryCallable listBlurbsCallable; - private final UnaryCallable listBlurbsPagedCallable; - private final UnaryCallable searchBlurbsCallable; - private final OperationCallable - searchBlurbsOperationCallable; - private final ServerStreamingCallable - streamBlurbsCallable; - private final ClientStreamingCallable sendBlurbsCallable; - private final BidiStreamingCallable connectCallable; - - private final BackgroundResource backgroundResources; - private final GrpcOperationsStub operationsStub; - private final GrpcStubCallableFactory callableFactory; - - public static final GrpcMessagingStub create(MessagingStubSettings settings) throws IOException { - return new GrpcMessagingStub(settings, ClientContext.create(settings)); - } - - public static final GrpcMessagingStub create(ClientContext clientContext) throws IOException { - return new GrpcMessagingStub(MessagingStubSettings.newBuilder().build(), clientContext); - } - - public static final GrpcMessagingStub create( - ClientContext clientContext, GrpcStubCallableFactory callableFactory) throws IOException { - return new GrpcMessagingStub( - MessagingStubSettings.newBuilder().build(), clientContext, callableFactory); - } - - /** - * Constructs an instance of GrpcMessagingStub, 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 GrpcMessagingStub(MessagingStubSettings settings, ClientContext clientContext) - throws IOException { - this(settings, clientContext, new GrpcMessagingCallableFactory()); - } - - /** - * Constructs an instance of GrpcMessagingStub, 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 GrpcMessagingStub( - MessagingStubSettings settings, - ClientContext clientContext, - GrpcStubCallableFactory callableFactory) - throws IOException { - this.callableFactory = callableFactory; - this.operationsStub = GrpcOperationsStub.create(clientContext, callableFactory); - - GrpcCallSettings createRoomTransportSettings = - GrpcCallSettings.newBuilder() - .setMethodDescriptor(createRoomMethodDescriptor) - .build(); - GrpcCallSettings getRoomTransportSettings = - GrpcCallSettings.newBuilder() - .setMethodDescriptor(getRoomMethodDescriptor) - .setParamsExtractor( - request -> { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("name", String.valueOf(request.getName())); - return params.build(); - }) - .build(); - GrpcCallSettings updateRoomTransportSettings = - GrpcCallSettings.newBuilder() - .setMethodDescriptor(updateRoomMethodDescriptor) - .setParamsExtractor( - request -> { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("room.name", String.valueOf(request.getRoom().getName())); - return params.build(); - }) - .build(); - GrpcCallSettings deleteRoomTransportSettings = - GrpcCallSettings.newBuilder() - .setMethodDescriptor(deleteRoomMethodDescriptor) - .setParamsExtractor( - request -> { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("name", String.valueOf(request.getName())); - return params.build(); - }) - .build(); - GrpcCallSettings listRoomsTransportSettings = - GrpcCallSettings.newBuilder() - .setMethodDescriptor(listRoomsMethodDescriptor) - .build(); - GrpcCallSettings createBlurbTransportSettings = - GrpcCallSettings.newBuilder() - .setMethodDescriptor(createBlurbMethodDescriptor) - .setParamsExtractor( - request -> { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("parent", String.valueOf(request.getParent())); - return params.build(); - }) - .build(); - GrpcCallSettings getBlurbTransportSettings = - GrpcCallSettings.newBuilder() - .setMethodDescriptor(getBlurbMethodDescriptor) - .setParamsExtractor( - request -> { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("name", String.valueOf(request.getName())); - return params.build(); - }) - .build(); - GrpcCallSettings updateBlurbTransportSettings = - GrpcCallSettings.newBuilder() - .setMethodDescriptor(updateBlurbMethodDescriptor) - .setParamsExtractor( - request -> { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("blurb.name", String.valueOf(request.getBlurb().getName())); - return params.build(); - }) - .build(); - GrpcCallSettings deleteBlurbTransportSettings = - GrpcCallSettings.newBuilder() - .setMethodDescriptor(deleteBlurbMethodDescriptor) - .setParamsExtractor( - request -> { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("name", String.valueOf(request.getName())); - return params.build(); - }) - .build(); - GrpcCallSettings listBlurbsTransportSettings = - GrpcCallSettings.newBuilder() - .setMethodDescriptor(listBlurbsMethodDescriptor) - .setParamsExtractor( - request -> { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("parent", String.valueOf(request.getParent())); - return params.build(); - }) - .build(); - GrpcCallSettings searchBlurbsTransportSettings = - GrpcCallSettings.newBuilder() - .setMethodDescriptor(searchBlurbsMethodDescriptor) - .setParamsExtractor( - request -> { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("parent", String.valueOf(request.getParent())); - return params.build(); - }) - .build(); - GrpcCallSettings streamBlurbsTransportSettings = - GrpcCallSettings.newBuilder() - .setMethodDescriptor(streamBlurbsMethodDescriptor) - .setParamsExtractor( - request -> { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("name", String.valueOf(request.getName())); - return params.build(); - }) - .build(); - GrpcCallSettings sendBlurbsTransportSettings = - GrpcCallSettings.newBuilder() - .setMethodDescriptor(sendBlurbsMethodDescriptor) - .setParamsExtractor( - request -> { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("parent", String.valueOf(request.getParent())); - return params.build(); - }) - .build(); - GrpcCallSettings connectTransportSettings = - GrpcCallSettings.newBuilder() - .setMethodDescriptor(connectMethodDescriptor) - .build(); - - this.createRoomCallable = - callableFactory.createUnaryCallable( - createRoomTransportSettings, settings.createRoomSettings(), clientContext); - this.getRoomCallable = - callableFactory.createUnaryCallable( - getRoomTransportSettings, settings.getRoomSettings(), clientContext); - this.updateRoomCallable = - callableFactory.createUnaryCallable( - updateRoomTransportSettings, settings.updateRoomSettings(), clientContext); - this.deleteRoomCallable = - callableFactory.createUnaryCallable( - deleteRoomTransportSettings, settings.deleteRoomSettings(), clientContext); - this.listRoomsCallable = - callableFactory.createUnaryCallable( - listRoomsTransportSettings, settings.listRoomsSettings(), clientContext); - this.listRoomsPagedCallable = - callableFactory.createPagedCallable( - listRoomsTransportSettings, settings.listRoomsSettings(), clientContext); - this.createBlurbCallable = - callableFactory.createUnaryCallable( - createBlurbTransportSettings, settings.createBlurbSettings(), clientContext); - this.getBlurbCallable = - callableFactory.createUnaryCallable( - getBlurbTransportSettings, settings.getBlurbSettings(), clientContext); - this.updateBlurbCallable = - callableFactory.createUnaryCallable( - updateBlurbTransportSettings, settings.updateBlurbSettings(), clientContext); - this.deleteBlurbCallable = - callableFactory.createUnaryCallable( - deleteBlurbTransportSettings, settings.deleteBlurbSettings(), clientContext); - this.listBlurbsCallable = - callableFactory.createUnaryCallable( - listBlurbsTransportSettings, settings.listBlurbsSettings(), clientContext); - this.listBlurbsPagedCallable = - callableFactory.createPagedCallable( - listBlurbsTransportSettings, settings.listBlurbsSettings(), clientContext); - this.searchBlurbsCallable = - callableFactory.createUnaryCallable( - searchBlurbsTransportSettings, settings.searchBlurbsSettings(), clientContext); - this.searchBlurbsOperationCallable = - callableFactory.createOperationCallable( - searchBlurbsTransportSettings, - settings.searchBlurbsOperationSettings(), - clientContext, - operationsStub); - this.streamBlurbsCallable = - callableFactory.createServerStreamingCallable( - streamBlurbsTransportSettings, settings.streamBlurbsSettings(), clientContext); - this.sendBlurbsCallable = - callableFactory.createClientStreamingCallable( - sendBlurbsTransportSettings, settings.sendBlurbsSettings(), clientContext); - this.connectCallable = - callableFactory.createBidiStreamingCallable( - connectTransportSettings, settings.connectSettings(), clientContext); - - this.backgroundResources = - new BackgroundResourceAggregation(clientContext.getBackgroundResources()); - } - - public GrpcOperationsStub getOperationsStub() { - return operationsStub; - } - - @Override - public UnaryCallable createRoomCallable() { - return createRoomCallable; - } - - @Override - public UnaryCallable getRoomCallable() { - return getRoomCallable; - } - - @Override - public UnaryCallable updateRoomCallable() { - return updateRoomCallable; - } - - @Override - public UnaryCallable deleteRoomCallable() { - return deleteRoomCallable; - } - - @Override - public UnaryCallable listRoomsCallable() { - return listRoomsCallable; - } - - @Override - public UnaryCallable listRoomsPagedCallable() { - return listRoomsPagedCallable; - } - - @Override - public UnaryCallable createBlurbCallable() { - return createBlurbCallable; - } - - @Override - public UnaryCallable getBlurbCallable() { - return getBlurbCallable; - } - - @Override - public UnaryCallable updateBlurbCallable() { - return updateBlurbCallable; - } - - @Override - public UnaryCallable deleteBlurbCallable() { - return deleteBlurbCallable; - } - - @Override - public UnaryCallable listBlurbsCallable() { - return listBlurbsCallable; - } - - @Override - public UnaryCallable listBlurbsPagedCallable() { - return listBlurbsPagedCallable; - } - - @Override - public UnaryCallable searchBlurbsCallable() { - return searchBlurbsCallable; - } - - @Override - public OperationCallable - searchBlurbsOperationCallable() { - return searchBlurbsOperationCallable; - } - - @Override - public ServerStreamingCallable streamBlurbsCallable() { - return streamBlurbsCallable; - } - - @Override - public ClientStreamingCallable sendBlurbsCallable() { - return sendBlurbsCallable; - } - - @Override - public BidiStreamingCallable connectCallable() { - return connectCallable; - } - - @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/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/GrpcSequenceServiceCallableFactory.java b/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/GrpcSequenceServiceCallableFactory.java deleted file mode 100644 index b7ed163bf7..0000000000 --- a/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/GrpcSequenceServiceCallableFactory.java +++ /dev/null @@ -1,115 +0,0 @@ -/* - * 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 - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1.stub; - -import com.google.api.core.BetaApi; -import com.google.api.gax.grpc.GrpcCallSettings; -import com.google.api.gax.grpc.GrpcCallableFactory; -import com.google.api.gax.grpc.GrpcStubCallableFactory; -import com.google.api.gax.rpc.BatchingCallSettings; -import com.google.api.gax.rpc.BidiStreamingCallable; -import com.google.api.gax.rpc.ClientContext; -import com.google.api.gax.rpc.ClientStreamingCallable; -import com.google.api.gax.rpc.OperationCallSettings; -import com.google.api.gax.rpc.OperationCallable; -import com.google.api.gax.rpc.PagedCallSettings; -import com.google.api.gax.rpc.ServerStreamingCallSettings; -import com.google.api.gax.rpc.ServerStreamingCallable; -import com.google.api.gax.rpc.StreamingCallSettings; -import com.google.api.gax.rpc.UnaryCallSettings; -import com.google.api.gax.rpc.UnaryCallable; -import com.google.longrunning.Operation; -import com.google.longrunning.stub.OperationsStub; -import javax.annotation.Generated; - -// AUTO-GENERATED DOCUMENTATION AND CLASS. -/** - * gRPC callable factory implementation for the SequenceService service API. - * - *

        This class is for advanced usage. - */ -@BetaApi -@Generated("by gapic-generator-java") -public class GrpcSequenceServiceCallableFactory 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/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/GrpcSequenceServiceStub.java b/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/GrpcSequenceServiceStub.java deleted file mode 100644 index 9f34118467..0000000000 --- a/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/GrpcSequenceServiceStub.java +++ /dev/null @@ -1,223 +0,0 @@ -/* - * 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 - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1.stub; - -import com.google.api.core.BetaApi; -import com.google.api.gax.core.BackgroundResource; -import com.google.api.gax.core.BackgroundResourceAggregation; -import com.google.api.gax.grpc.GrpcCallSettings; -import com.google.api.gax.grpc.GrpcStubCallableFactory; -import com.google.api.gax.rpc.ClientContext; -import com.google.api.gax.rpc.UnaryCallable; -import com.google.common.collect.ImmutableMap; -import com.google.longrunning.stub.GrpcOperationsStub; -import com.google.protobuf.Empty; -import com.google.showcase.v1beta1.AttemptSequenceRequest; -import com.google.showcase.v1beta1.CreateSequenceRequest; -import com.google.showcase.v1beta1.GetSequenceReportRequest; -import com.google.showcase.v1beta1.Sequence; -import com.google.showcase.v1beta1.SequenceReport; -import io.grpc.MethodDescriptor; -import io.grpc.protobuf.ProtoUtils; -import java.io.IOException; -import java.util.Map; -import java.util.concurrent.TimeUnit; -import javax.annotation.Generated; - -// AUTO-GENERATED DOCUMENTATION AND CLASS. -/** - * gRPC stub implementation for the SequenceService service API. - * - *

        This class is for advanced usage and reflects the underlying API directly. - */ -@BetaApi -@Generated("by gapic-generator-java") -public class GrpcSequenceServiceStub extends SequenceServiceStub { - private static final MethodDescriptor - createSequenceMethodDescriptor = - MethodDescriptor.newBuilder() - .setType(MethodDescriptor.MethodType.UNARY) - .setFullMethodName("google.showcase.v1beta1.SequenceService/CreateSequence") - .setRequestMarshaller( - ProtoUtils.marshaller(CreateSequenceRequest.getDefaultInstance())) - .setResponseMarshaller(ProtoUtils.marshaller(Sequence.getDefaultInstance())) - .build(); - - private static final MethodDescriptor - getSequenceReportMethodDescriptor = - MethodDescriptor.newBuilder() - .setType(MethodDescriptor.MethodType.UNARY) - .setFullMethodName("google.showcase.v1beta1.SequenceService/GetSequenceReport") - .setRequestMarshaller( - ProtoUtils.marshaller(GetSequenceReportRequest.getDefaultInstance())) - .setResponseMarshaller(ProtoUtils.marshaller(SequenceReport.getDefaultInstance())) - .build(); - - private static final MethodDescriptor - attemptSequenceMethodDescriptor = - MethodDescriptor.newBuilder() - .setType(MethodDescriptor.MethodType.UNARY) - .setFullMethodName("google.showcase.v1beta1.SequenceService/AttemptSequence") - .setRequestMarshaller( - ProtoUtils.marshaller(AttemptSequenceRequest.getDefaultInstance())) - .setResponseMarshaller(ProtoUtils.marshaller(Empty.getDefaultInstance())) - .build(); - - private final UnaryCallable createSequenceCallable; - private final UnaryCallable getSequenceReportCallable; - private final UnaryCallable attemptSequenceCallable; - - private final BackgroundResource backgroundResources; - private final GrpcOperationsStub operationsStub; - private final GrpcStubCallableFactory callableFactory; - - public static final GrpcSequenceServiceStub create(SequenceServiceStubSettings settings) - throws IOException { - return new GrpcSequenceServiceStub(settings, ClientContext.create(settings)); - } - - public static final GrpcSequenceServiceStub create(ClientContext clientContext) - throws IOException { - return new GrpcSequenceServiceStub( - SequenceServiceStubSettings.newBuilder().build(), clientContext); - } - - public static final GrpcSequenceServiceStub create( - ClientContext clientContext, GrpcStubCallableFactory callableFactory) throws IOException { - return new GrpcSequenceServiceStub( - SequenceServiceStubSettings.newBuilder().build(), clientContext, callableFactory); - } - - /** - * Constructs an instance of GrpcSequenceServiceStub, 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 GrpcSequenceServiceStub( - SequenceServiceStubSettings settings, ClientContext clientContext) throws IOException { - this(settings, clientContext, new GrpcSequenceServiceCallableFactory()); - } - - /** - * Constructs an instance of GrpcSequenceServiceStub, 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 GrpcSequenceServiceStub( - SequenceServiceStubSettings settings, - ClientContext clientContext, - GrpcStubCallableFactory callableFactory) - throws IOException { - this.callableFactory = callableFactory; - this.operationsStub = GrpcOperationsStub.create(clientContext, callableFactory); - - GrpcCallSettings createSequenceTransportSettings = - GrpcCallSettings.newBuilder() - .setMethodDescriptor(createSequenceMethodDescriptor) - .build(); - GrpcCallSettings getSequenceReportTransportSettings = - GrpcCallSettings.newBuilder() - .setMethodDescriptor(getSequenceReportMethodDescriptor) - .setParamsExtractor( - request -> { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("name", String.valueOf(request.getName())); - return params.build(); - }) - .build(); - GrpcCallSettings attemptSequenceTransportSettings = - GrpcCallSettings.newBuilder() - .setMethodDescriptor(attemptSequenceMethodDescriptor) - .setParamsExtractor( - request -> { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("name", String.valueOf(request.getName())); - return params.build(); - }) - .build(); - - this.createSequenceCallable = - callableFactory.createUnaryCallable( - createSequenceTransportSettings, settings.createSequenceSettings(), clientContext); - this.getSequenceReportCallable = - callableFactory.createUnaryCallable( - getSequenceReportTransportSettings, - settings.getSequenceReportSettings(), - clientContext); - this.attemptSequenceCallable = - callableFactory.createUnaryCallable( - attemptSequenceTransportSettings, settings.attemptSequenceSettings(), clientContext); - - this.backgroundResources = - new BackgroundResourceAggregation(clientContext.getBackgroundResources()); - } - - public GrpcOperationsStub getOperationsStub() { - return operationsStub; - } - - @Override - public UnaryCallable createSequenceCallable() { - return createSequenceCallable; - } - - @Override - public UnaryCallable getSequenceReportCallable() { - return getSequenceReportCallable; - } - - @Override - public UnaryCallable attemptSequenceCallable() { - return attemptSequenceCallable; - } - - @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/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/GrpcTestingCallableFactory.java b/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/GrpcTestingCallableFactory.java deleted file mode 100644 index d117701765..0000000000 --- a/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/GrpcTestingCallableFactory.java +++ /dev/null @@ -1,115 +0,0 @@ -/* - * 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 - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1.stub; - -import com.google.api.core.BetaApi; -import com.google.api.gax.grpc.GrpcCallSettings; -import com.google.api.gax.grpc.GrpcCallableFactory; -import com.google.api.gax.grpc.GrpcStubCallableFactory; -import com.google.api.gax.rpc.BatchingCallSettings; -import com.google.api.gax.rpc.BidiStreamingCallable; -import com.google.api.gax.rpc.ClientContext; -import com.google.api.gax.rpc.ClientStreamingCallable; -import com.google.api.gax.rpc.OperationCallSettings; -import com.google.api.gax.rpc.OperationCallable; -import com.google.api.gax.rpc.PagedCallSettings; -import com.google.api.gax.rpc.ServerStreamingCallSettings; -import com.google.api.gax.rpc.ServerStreamingCallable; -import com.google.api.gax.rpc.StreamingCallSettings; -import com.google.api.gax.rpc.UnaryCallSettings; -import com.google.api.gax.rpc.UnaryCallable; -import com.google.longrunning.Operation; -import com.google.longrunning.stub.OperationsStub; -import javax.annotation.Generated; - -// AUTO-GENERATED DOCUMENTATION AND CLASS. -/** - * gRPC callable factory implementation for the Testing service API. - * - *

        This class is for advanced usage. - */ -@BetaApi -@Generated("by gapic-generator-java") -public class GrpcTestingCallableFactory 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/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/GrpcTestingStub.java b/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/GrpcTestingStub.java deleted file mode 100644 index 0787a31179..0000000000 --- a/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/GrpcTestingStub.java +++ /dev/null @@ -1,378 +0,0 @@ -/* - * 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 - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1.stub; - -import static com.google.showcase.v1beta1.TestingClient.ListSessionsPagedResponse; -import static com.google.showcase.v1beta1.TestingClient.ListTestsPagedResponse; - -import com.google.api.core.BetaApi; -import com.google.api.gax.core.BackgroundResource; -import com.google.api.gax.core.BackgroundResourceAggregation; -import com.google.api.gax.grpc.GrpcCallSettings; -import com.google.api.gax.grpc.GrpcStubCallableFactory; -import com.google.api.gax.rpc.ClientContext; -import com.google.api.gax.rpc.UnaryCallable; -import com.google.common.collect.ImmutableMap; -import com.google.longrunning.stub.GrpcOperationsStub; -import com.google.protobuf.Empty; -import com.google.showcase.v1beta1.CreateSessionRequest; -import com.google.showcase.v1beta1.DeleteSessionRequest; -import com.google.showcase.v1beta1.DeleteTestRequest; -import com.google.showcase.v1beta1.GetSessionRequest; -import com.google.showcase.v1beta1.ListSessionsRequest; -import com.google.showcase.v1beta1.ListSessionsResponse; -import com.google.showcase.v1beta1.ListTestsRequest; -import com.google.showcase.v1beta1.ListTestsResponse; -import com.google.showcase.v1beta1.ReportSessionRequest; -import com.google.showcase.v1beta1.ReportSessionResponse; -import com.google.showcase.v1beta1.Session; -import com.google.showcase.v1beta1.VerifyTestRequest; -import com.google.showcase.v1beta1.VerifyTestResponse; -import io.grpc.MethodDescriptor; -import io.grpc.protobuf.ProtoUtils; -import java.io.IOException; -import java.util.Map; -import java.util.concurrent.TimeUnit; -import javax.annotation.Generated; - -// AUTO-GENERATED DOCUMENTATION AND CLASS. -/** - * gRPC stub implementation for the Testing service API. - * - *

        This class is for advanced usage and reflects the underlying API directly. - */ -@BetaApi -@Generated("by gapic-generator-java") -public class GrpcTestingStub extends TestingStub { - private static final MethodDescriptor - createSessionMethodDescriptor = - MethodDescriptor.newBuilder() - .setType(MethodDescriptor.MethodType.UNARY) - .setFullMethodName("google.showcase.v1beta1.Testing/CreateSession") - .setRequestMarshaller( - ProtoUtils.marshaller(CreateSessionRequest.getDefaultInstance())) - .setResponseMarshaller(ProtoUtils.marshaller(Session.getDefaultInstance())) - .build(); - - private static final MethodDescriptor getSessionMethodDescriptor = - MethodDescriptor.newBuilder() - .setType(MethodDescriptor.MethodType.UNARY) - .setFullMethodName("google.showcase.v1beta1.Testing/GetSession") - .setRequestMarshaller(ProtoUtils.marshaller(GetSessionRequest.getDefaultInstance())) - .setResponseMarshaller(ProtoUtils.marshaller(Session.getDefaultInstance())) - .build(); - - private static final MethodDescriptor - listSessionsMethodDescriptor = - MethodDescriptor.newBuilder() - .setType(MethodDescriptor.MethodType.UNARY) - .setFullMethodName("google.showcase.v1beta1.Testing/ListSessions") - .setRequestMarshaller(ProtoUtils.marshaller(ListSessionsRequest.getDefaultInstance())) - .setResponseMarshaller( - ProtoUtils.marshaller(ListSessionsResponse.getDefaultInstance())) - .build(); - - private static final MethodDescriptor deleteSessionMethodDescriptor = - MethodDescriptor.newBuilder() - .setType(MethodDescriptor.MethodType.UNARY) - .setFullMethodName("google.showcase.v1beta1.Testing/DeleteSession") - .setRequestMarshaller(ProtoUtils.marshaller(DeleteSessionRequest.getDefaultInstance())) - .setResponseMarshaller(ProtoUtils.marshaller(Empty.getDefaultInstance())) - .build(); - - private static final MethodDescriptor - reportSessionMethodDescriptor = - MethodDescriptor.newBuilder() - .setType(MethodDescriptor.MethodType.UNARY) - .setFullMethodName("google.showcase.v1beta1.Testing/ReportSession") - .setRequestMarshaller( - ProtoUtils.marshaller(ReportSessionRequest.getDefaultInstance())) - .setResponseMarshaller( - ProtoUtils.marshaller(ReportSessionResponse.getDefaultInstance())) - .build(); - - private static final MethodDescriptor - listTestsMethodDescriptor = - MethodDescriptor.newBuilder() - .setType(MethodDescriptor.MethodType.UNARY) - .setFullMethodName("google.showcase.v1beta1.Testing/ListTests") - .setRequestMarshaller(ProtoUtils.marshaller(ListTestsRequest.getDefaultInstance())) - .setResponseMarshaller(ProtoUtils.marshaller(ListTestsResponse.getDefaultInstance())) - .build(); - - private static final MethodDescriptor deleteTestMethodDescriptor = - MethodDescriptor.newBuilder() - .setType(MethodDescriptor.MethodType.UNARY) - .setFullMethodName("google.showcase.v1beta1.Testing/DeleteTest") - .setRequestMarshaller(ProtoUtils.marshaller(DeleteTestRequest.getDefaultInstance())) - .setResponseMarshaller(ProtoUtils.marshaller(Empty.getDefaultInstance())) - .build(); - - private static final MethodDescriptor - verifyTestMethodDescriptor = - MethodDescriptor.newBuilder() - .setType(MethodDescriptor.MethodType.UNARY) - .setFullMethodName("google.showcase.v1beta1.Testing/VerifyTest") - .setRequestMarshaller(ProtoUtils.marshaller(VerifyTestRequest.getDefaultInstance())) - .setResponseMarshaller(ProtoUtils.marshaller(VerifyTestResponse.getDefaultInstance())) - .build(); - - private final UnaryCallable createSessionCallable; - private final UnaryCallable getSessionCallable; - private final UnaryCallable listSessionsCallable; - private final UnaryCallable - listSessionsPagedCallable; - private final UnaryCallable deleteSessionCallable; - private final UnaryCallable reportSessionCallable; - private final UnaryCallable listTestsCallable; - private final UnaryCallable listTestsPagedCallable; - private final UnaryCallable deleteTestCallable; - private final UnaryCallable verifyTestCallable; - - private final BackgroundResource backgroundResources; - private final GrpcOperationsStub operationsStub; - private final GrpcStubCallableFactory callableFactory; - - public static final GrpcTestingStub create(TestingStubSettings settings) throws IOException { - return new GrpcTestingStub(settings, ClientContext.create(settings)); - } - - public static final GrpcTestingStub create(ClientContext clientContext) throws IOException { - return new GrpcTestingStub(TestingStubSettings.newBuilder().build(), clientContext); - } - - public static final GrpcTestingStub create( - ClientContext clientContext, GrpcStubCallableFactory callableFactory) throws IOException { - return new GrpcTestingStub( - TestingStubSettings.newBuilder().build(), clientContext, callableFactory); - } - - /** - * Constructs an instance of GrpcTestingStub, 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 GrpcTestingStub(TestingStubSettings settings, ClientContext clientContext) - throws IOException { - this(settings, clientContext, new GrpcTestingCallableFactory()); - } - - /** - * Constructs an instance of GrpcTestingStub, 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 GrpcTestingStub( - TestingStubSettings settings, - ClientContext clientContext, - GrpcStubCallableFactory callableFactory) - throws IOException { - this.callableFactory = callableFactory; - this.operationsStub = GrpcOperationsStub.create(clientContext, callableFactory); - - GrpcCallSettings createSessionTransportSettings = - GrpcCallSettings.newBuilder() - .setMethodDescriptor(createSessionMethodDescriptor) - .build(); - GrpcCallSettings getSessionTransportSettings = - GrpcCallSettings.newBuilder() - .setMethodDescriptor(getSessionMethodDescriptor) - .setParamsExtractor( - request -> { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("name", String.valueOf(request.getName())); - return params.build(); - }) - .build(); - GrpcCallSettings listSessionsTransportSettings = - GrpcCallSettings.newBuilder() - .setMethodDescriptor(listSessionsMethodDescriptor) - .build(); - GrpcCallSettings deleteSessionTransportSettings = - GrpcCallSettings.newBuilder() - .setMethodDescriptor(deleteSessionMethodDescriptor) - .setParamsExtractor( - request -> { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("name", String.valueOf(request.getName())); - return params.build(); - }) - .build(); - GrpcCallSettings reportSessionTransportSettings = - GrpcCallSettings.newBuilder() - .setMethodDescriptor(reportSessionMethodDescriptor) - .setParamsExtractor( - request -> { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("name", String.valueOf(request.getName())); - return params.build(); - }) - .build(); - GrpcCallSettings listTestsTransportSettings = - GrpcCallSettings.newBuilder() - .setMethodDescriptor(listTestsMethodDescriptor) - .setParamsExtractor( - request -> { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("parent", String.valueOf(request.getParent())); - return params.build(); - }) - .build(); - GrpcCallSettings deleteTestTransportSettings = - GrpcCallSettings.newBuilder() - .setMethodDescriptor(deleteTestMethodDescriptor) - .setParamsExtractor( - request -> { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("name", String.valueOf(request.getName())); - return params.build(); - }) - .build(); - GrpcCallSettings verifyTestTransportSettings = - GrpcCallSettings.newBuilder() - .setMethodDescriptor(verifyTestMethodDescriptor) - .setParamsExtractor( - request -> { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("name", String.valueOf(request.getName())); - return params.build(); - }) - .build(); - - this.createSessionCallable = - callableFactory.createUnaryCallable( - createSessionTransportSettings, settings.createSessionSettings(), clientContext); - this.getSessionCallable = - callableFactory.createUnaryCallable( - getSessionTransportSettings, settings.getSessionSettings(), clientContext); - this.listSessionsCallable = - callableFactory.createUnaryCallable( - listSessionsTransportSettings, settings.listSessionsSettings(), clientContext); - this.listSessionsPagedCallable = - callableFactory.createPagedCallable( - listSessionsTransportSettings, settings.listSessionsSettings(), clientContext); - this.deleteSessionCallable = - callableFactory.createUnaryCallable( - deleteSessionTransportSettings, settings.deleteSessionSettings(), clientContext); - this.reportSessionCallable = - callableFactory.createUnaryCallable( - reportSessionTransportSettings, settings.reportSessionSettings(), clientContext); - this.listTestsCallable = - callableFactory.createUnaryCallable( - listTestsTransportSettings, settings.listTestsSettings(), clientContext); - this.listTestsPagedCallable = - callableFactory.createPagedCallable( - listTestsTransportSettings, settings.listTestsSettings(), clientContext); - this.deleteTestCallable = - callableFactory.createUnaryCallable( - deleteTestTransportSettings, settings.deleteTestSettings(), clientContext); - this.verifyTestCallable = - callableFactory.createUnaryCallable( - verifyTestTransportSettings, settings.verifyTestSettings(), clientContext); - - this.backgroundResources = - new BackgroundResourceAggregation(clientContext.getBackgroundResources()); - } - - public GrpcOperationsStub getOperationsStub() { - return operationsStub; - } - - @Override - public UnaryCallable createSessionCallable() { - return createSessionCallable; - } - - @Override - public UnaryCallable getSessionCallable() { - return getSessionCallable; - } - - @Override - public UnaryCallable listSessionsCallable() { - return listSessionsCallable; - } - - @Override - public UnaryCallable listSessionsPagedCallable() { - return listSessionsPagedCallable; - } - - @Override - public UnaryCallable deleteSessionCallable() { - return deleteSessionCallable; - } - - @Override - public UnaryCallable reportSessionCallable() { - return reportSessionCallable; - } - - @Override - public UnaryCallable listTestsCallable() { - return listTestsCallable; - } - - @Override - public UnaryCallable listTestsPagedCallable() { - return listTestsPagedCallable; - } - - @Override - public UnaryCallable deleteTestCallable() { - return deleteTestCallable; - } - - @Override - public UnaryCallable verifyTestCallable() { - return verifyTestCallable; - } - - @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/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/HttpJsonComplianceCallableFactory.java b/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/HttpJsonComplianceCallableFactory.java deleted file mode 100644 index ae83f1e131..0000000000 --- a/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/HttpJsonComplianceCallableFactory.java +++ /dev/null @@ -1,105 +0,0 @@ -/* - * 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 - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1.stub; - -import com.google.api.core.BetaApi; -import com.google.api.gax.httpjson.HttpJsonCallSettings; -import com.google.api.gax.httpjson.HttpJsonCallableFactory; -import com.google.api.gax.httpjson.HttpJsonOperationSnapshotCallable; -import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; -import com.google.api.gax.httpjson.longrunning.stub.OperationsStub; -import com.google.api.gax.rpc.BatchingCallSettings; -import com.google.api.gax.rpc.ClientContext; -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.UnaryCallSettings; -import com.google.api.gax.rpc.UnaryCallable; -import com.google.longrunning.Operation; -import javax.annotation.Generated; - -// AUTO-GENERATED DOCUMENTATION AND CLASS. -/** - * REST callable factory implementation for the Compliance service API. - * - *

        This class is for advanced usage. - */ -@BetaApi -@Generated("by gapic-generator-java") -public class HttpJsonComplianceCallableFactory - implements HttpJsonStubCallableFactory { - - @Override - public UnaryCallable createUnaryCallable( - HttpJsonCallSettings httpJsonCallSettings, - UnaryCallSettings callSettings, - ClientContext clientContext) { - return HttpJsonCallableFactory.createUnaryCallable( - httpJsonCallSettings, callSettings, clientContext); - } - - @Override - public - UnaryCallable createPagedCallable( - HttpJsonCallSettings httpJsonCallSettings, - PagedCallSettings callSettings, - ClientContext clientContext) { - return HttpJsonCallableFactory.createPagedCallable( - httpJsonCallSettings, callSettings, clientContext); - } - - @Override - public UnaryCallable createBatchingCallable( - HttpJsonCallSettings httpJsonCallSettings, - BatchingCallSettings callSettings, - ClientContext clientContext) { - return HttpJsonCallableFactory.createBatchingCallable( - httpJsonCallSettings, callSettings, clientContext); - } - - @BetaApi( - "The surface for long-running operations is not stable yet and may change in the future.") - @Override - public - OperationCallable createOperationCallable( - HttpJsonCallSettings httpJsonCallSettings, - OperationCallSettings callSettings, - ClientContext clientContext, - OperationsStub operationsStub) { - UnaryCallable innerCallable = - HttpJsonCallableFactory.createBaseUnaryCallable( - httpJsonCallSettings, callSettings.getInitialCallSettings(), clientContext); - HttpJsonOperationSnapshotCallable initialCallable = - new HttpJsonOperationSnapshotCallable( - innerCallable, - httpJsonCallSettings.getMethodDescriptor().getOperationSnapshotFactory()); - return HttpJsonCallableFactory.createOperationCallable( - callSettings, clientContext, operationsStub.longRunningClient(), initialCallable); - } - - @Override - public - ServerStreamingCallable createServerStreamingCallable( - HttpJsonCallSettings httpJsonCallSettings, - ServerStreamingCallSettings callSettings, - ClientContext clientContext) { - return HttpJsonCallableFactory.createServerStreamingCallable( - httpJsonCallSettings, callSettings, clientContext); - } -} diff --git a/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/HttpJsonComplianceStub.java b/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/HttpJsonComplianceStub.java deleted file mode 100644 index 5fd2556f89..0000000000 --- a/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/HttpJsonComplianceStub.java +++ /dev/null @@ -1,772 +0,0 @@ -/* - * 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 - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1.stub; - -import com.google.api.core.BetaApi; -import com.google.api.core.InternalApi; -import com.google.api.gax.core.BackgroundResource; -import com.google.api.gax.core.BackgroundResourceAggregation; -import com.google.api.gax.httpjson.ApiMethodDescriptor; -import com.google.api.gax.httpjson.HttpJsonCallSettings; -import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; -import com.google.api.gax.httpjson.ProtoMessageRequestFormatter; -import com.google.api.gax.httpjson.ProtoMessageResponseParser; -import com.google.api.gax.httpjson.ProtoRestSerializer; -import com.google.api.gax.rpc.ClientContext; -import com.google.api.gax.rpc.UnaryCallable; -import com.google.protobuf.TypeRegistry; -import com.google.showcase.v1beta1.EnumRequest; -import com.google.showcase.v1beta1.EnumResponse; -import com.google.showcase.v1beta1.RepeatRequest; -import com.google.showcase.v1beta1.RepeatResponse; -import java.io.IOException; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.concurrent.TimeUnit; -import javax.annotation.Generated; - -// AUTO-GENERATED DOCUMENTATION AND CLASS. -/** - * REST stub implementation for the Compliance service API. - * - *

        This class is for advanced usage and reflects the underlying API directly. - */ -@BetaApi -@Generated("by gapic-generator-java") -public class HttpJsonComplianceStub extends ComplianceStub { - private static final TypeRegistry typeRegistry = TypeRegistry.newBuilder().build(); - - private static final ApiMethodDescriptor - repeatDataBodyMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("google.showcase.v1beta1.Compliance/RepeatDataBody") - .setHttpMethod("POST") - .setType(ApiMethodDescriptor.MethodType.UNARY) - .setRequestFormatter( - ProtoMessageRequestFormatter.newBuilder() - .setPath( - "/v1beta1/repeat:body", - request -> { - Map fields = new HashMap<>(); - ProtoRestSerializer serializer = - ProtoRestSerializer.create(); - return fields; - }) - .setQueryParamsExtractor( - request -> { - Map> fields = new HashMap<>(); - ProtoRestSerializer serializer = - ProtoRestSerializer.create(); - serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); - return fields; - }) - .setRequestBodyExtractor( - request -> - ProtoRestSerializer.create() - .toBody("*", request.toBuilder().build(), true)) - .build()) - .setResponseParser( - ProtoMessageResponseParser.newBuilder() - .setDefaultInstance(RepeatResponse.getDefaultInstance()) - .setDefaultTypeRegistry(typeRegistry) - .build()) - .build(); - - private static final ApiMethodDescriptor - repeatDataBodyInfoMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("google.showcase.v1beta1.Compliance/RepeatDataBodyInfo") - .setHttpMethod("POST") - .setType(ApiMethodDescriptor.MethodType.UNARY) - .setRequestFormatter( - ProtoMessageRequestFormatter.newBuilder() - .setPath( - "/v1beta1/repeat:bodyinfo", - request -> { - Map fields = new HashMap<>(); - ProtoRestSerializer serializer = - ProtoRestSerializer.create(); - return fields; - }) - .setQueryParamsExtractor( - request -> { - Map> fields = new HashMap<>(); - ProtoRestSerializer serializer = - ProtoRestSerializer.create(); - serializer.putQueryParam(fields, "fDouble", request.getFDouble()); - serializer.putQueryParam(fields, "fInt32", request.getFInt32()); - serializer.putQueryParam(fields, "fInt64", request.getFInt64()); - if (request.hasIntendedBindingUri()) { - serializer.putQueryParam( - fields, "intendedBindingUri", request.getIntendedBindingUri()); - } - serializer.putQueryParam(fields, "name", request.getName()); - if (request.hasPDouble()) { - serializer.putQueryParam(fields, "pDouble", request.getPDouble()); - } - if (request.hasPInt32()) { - serializer.putQueryParam(fields, "pInt32", request.getPInt32()); - } - if (request.hasPInt64()) { - serializer.putQueryParam(fields, "pInt64", request.getPInt64()); - } - serializer.putQueryParam( - fields, "serverVerify", request.getServerVerify()); - serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); - return fields; - }) - .setRequestBodyExtractor( - request -> - ProtoRestSerializer.create().toBody("info", request.getInfo(), true)) - .build()) - .setResponseParser( - ProtoMessageResponseParser.newBuilder() - .setDefaultInstance(RepeatResponse.getDefaultInstance()) - .setDefaultTypeRegistry(typeRegistry) - .build()) - .build(); - - private static final ApiMethodDescriptor - repeatDataQueryMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("google.showcase.v1beta1.Compliance/RepeatDataQuery") - .setHttpMethod("GET") - .setType(ApiMethodDescriptor.MethodType.UNARY) - .setRequestFormatter( - ProtoMessageRequestFormatter.newBuilder() - .setPath( - "/v1beta1/repeat:query", - request -> { - Map fields = new HashMap<>(); - ProtoRestSerializer serializer = - ProtoRestSerializer.create(); - return fields; - }) - .setQueryParamsExtractor( - request -> { - Map> fields = new HashMap<>(); - ProtoRestSerializer serializer = - ProtoRestSerializer.create(); - serializer.putQueryParam(fields, "fDouble", request.getFDouble()); - serializer.putQueryParam(fields, "fInt32", request.getFInt32()); - serializer.putQueryParam(fields, "fInt64", request.getFInt64()); - serializer.putQueryParam(fields, "info", request.getInfo()); - if (request.hasIntendedBindingUri()) { - serializer.putQueryParam( - fields, "intendedBindingUri", request.getIntendedBindingUri()); - } - serializer.putQueryParam(fields, "name", request.getName()); - if (request.hasPDouble()) { - serializer.putQueryParam(fields, "pDouble", request.getPDouble()); - } - if (request.hasPInt32()) { - serializer.putQueryParam(fields, "pInt32", request.getPInt32()); - } - if (request.hasPInt64()) { - serializer.putQueryParam(fields, "pInt64", request.getPInt64()); - } - serializer.putQueryParam( - fields, "serverVerify", request.getServerVerify()); - serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); - return fields; - }) - .setRequestBodyExtractor(request -> null) - .build()) - .setResponseParser( - ProtoMessageResponseParser.newBuilder() - .setDefaultInstance(RepeatResponse.getDefaultInstance()) - .setDefaultTypeRegistry(typeRegistry) - .build()) - .build(); - - private static final ApiMethodDescriptor - repeatDataSimplePathMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("google.showcase.v1beta1.Compliance/RepeatDataSimplePath") - .setHttpMethod("GET") - .setType(ApiMethodDescriptor.MethodType.UNARY) - .setRequestFormatter( - ProtoMessageRequestFormatter.newBuilder() - .setPath( - "/v1beta1/repeat/{info.fString}/{info.fInt32}/{info.fDouble}/{info.fBool}/{info.fKingdom}:simplepath", - request -> { - Map fields = new HashMap<>(); - ProtoRestSerializer serializer = - ProtoRestSerializer.create(); - serializer.putPathParam( - fields, "info.fBool", request.getInfo().getFBool()); - serializer.putPathParam( - fields, "info.fDouble", request.getInfo().getFDouble()); - serializer.putPathParam( - fields, "info.fInt32", request.getInfo().getFInt32()); - serializer.putPathParam( - fields, "info.fKingdom", request.getInfo().getFKingdomValue()); - serializer.putPathParam( - fields, "info.fString", request.getInfo().getFString()); - return fields; - }) - .setQueryParamsExtractor( - request -> { - Map> fields = new HashMap<>(); - ProtoRestSerializer serializer = - ProtoRestSerializer.create(); - serializer.putQueryParam(fields, "fDouble", request.getFDouble()); - serializer.putQueryParam(fields, "fInt32", request.getFInt32()); - serializer.putQueryParam(fields, "fInt64", request.getFInt64()); - serializer.putQueryParam(fields, "info", request.getInfo()); - if (request.hasIntendedBindingUri()) { - serializer.putQueryParam( - fields, "intendedBindingUri", request.getIntendedBindingUri()); - } - serializer.putQueryParam(fields, "name", request.getName()); - if (request.hasPDouble()) { - serializer.putQueryParam(fields, "pDouble", request.getPDouble()); - } - if (request.hasPInt32()) { - serializer.putQueryParam(fields, "pInt32", request.getPInt32()); - } - if (request.hasPInt64()) { - serializer.putQueryParam(fields, "pInt64", request.getPInt64()); - } - serializer.putQueryParam( - fields, "serverVerify", request.getServerVerify()); - serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); - return fields; - }) - .setRequestBodyExtractor(request -> null) - .build()) - .setResponseParser( - ProtoMessageResponseParser.newBuilder() - .setDefaultInstance(RepeatResponse.getDefaultInstance()) - .setDefaultTypeRegistry(typeRegistry) - .build()) - .build(); - - private static final ApiMethodDescriptor - repeatDataPathResourceMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("google.showcase.v1beta1.Compliance/RepeatDataPathResource") - .setHttpMethod("GET") - .setType(ApiMethodDescriptor.MethodType.UNARY) - .setRequestFormatter( - ProtoMessageRequestFormatter.newBuilder() - .setPath( - "/v1beta1/repeat/{info.fString=first/*}/{info.fChild.fString=second/*}/bool/{info.fBool}:pathresource", - request -> { - Map fields = new HashMap<>(); - ProtoRestSerializer serializer = - ProtoRestSerializer.create(); - serializer.putPathParam( - fields, "info.fBool", request.getInfo().getFBool()); - serializer.putPathParam( - fields, - "info.fChild.fString", - request.getInfo().getFChild().getFString()); - serializer.putPathParam( - fields, "info.fString", request.getInfo().getFString()); - return fields; - }) - .setAdditionalPaths( - "/v1beta1/repeat/{info.fChild.fString=first/*}/{info.fString=second/*}/bool/{info.fBool}:childfirstpathresource") - .setQueryParamsExtractor( - request -> { - Map> fields = new HashMap<>(); - ProtoRestSerializer serializer = - ProtoRestSerializer.create(); - serializer.putQueryParam(fields, "fDouble", request.getFDouble()); - serializer.putQueryParam(fields, "fInt32", request.getFInt32()); - serializer.putQueryParam(fields, "fInt64", request.getFInt64()); - serializer.putQueryParam(fields, "info", request.getInfo()); - if (request.hasIntendedBindingUri()) { - serializer.putQueryParam( - fields, "intendedBindingUri", request.getIntendedBindingUri()); - } - serializer.putQueryParam(fields, "name", request.getName()); - if (request.hasPDouble()) { - serializer.putQueryParam(fields, "pDouble", request.getPDouble()); - } - if (request.hasPInt32()) { - serializer.putQueryParam(fields, "pInt32", request.getPInt32()); - } - if (request.hasPInt64()) { - serializer.putQueryParam(fields, "pInt64", request.getPInt64()); - } - serializer.putQueryParam( - fields, "serverVerify", request.getServerVerify()); - serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); - return fields; - }) - .setRequestBodyExtractor(request -> null) - .build()) - .setResponseParser( - ProtoMessageResponseParser.newBuilder() - .setDefaultInstance(RepeatResponse.getDefaultInstance()) - .setDefaultTypeRegistry(typeRegistry) - .build()) - .build(); - - private static final ApiMethodDescriptor - repeatDataPathTrailingResourceMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName( - "google.showcase.v1beta1.Compliance/RepeatDataPathTrailingResource") - .setHttpMethod("GET") - .setType(ApiMethodDescriptor.MethodType.UNARY) - .setRequestFormatter( - ProtoMessageRequestFormatter.newBuilder() - .setPath( - "/v1beta1/repeat/{info.fString=first/*}/{info.fChild.fString=second/**}:pathtrailingresource", - request -> { - Map fields = new HashMap<>(); - ProtoRestSerializer serializer = - ProtoRestSerializer.create(); - serializer.putPathParam( - fields, - "info.fChild.fString", - request.getInfo().getFChild().getFString()); - serializer.putPathParam( - fields, "info.fString", request.getInfo().getFString()); - return fields; - }) - .setQueryParamsExtractor( - request -> { - Map> fields = new HashMap<>(); - ProtoRestSerializer serializer = - ProtoRestSerializer.create(); - serializer.putQueryParam(fields, "fDouble", request.getFDouble()); - serializer.putQueryParam(fields, "fInt32", request.getFInt32()); - serializer.putQueryParam(fields, "fInt64", request.getFInt64()); - serializer.putQueryParam(fields, "info", request.getInfo()); - if (request.hasIntendedBindingUri()) { - serializer.putQueryParam( - fields, "intendedBindingUri", request.getIntendedBindingUri()); - } - serializer.putQueryParam(fields, "name", request.getName()); - if (request.hasPDouble()) { - serializer.putQueryParam(fields, "pDouble", request.getPDouble()); - } - if (request.hasPInt32()) { - serializer.putQueryParam(fields, "pInt32", request.getPInt32()); - } - if (request.hasPInt64()) { - serializer.putQueryParam(fields, "pInt64", request.getPInt64()); - } - serializer.putQueryParam( - fields, "serverVerify", request.getServerVerify()); - serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); - return fields; - }) - .setRequestBodyExtractor(request -> null) - .build()) - .setResponseParser( - ProtoMessageResponseParser.newBuilder() - .setDefaultInstance(RepeatResponse.getDefaultInstance()) - .setDefaultTypeRegistry(typeRegistry) - .build()) - .build(); - - private static final ApiMethodDescriptor - repeatDataBodyPutMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("google.showcase.v1beta1.Compliance/RepeatDataBodyPut") - .setHttpMethod("PUT") - .setType(ApiMethodDescriptor.MethodType.UNARY) - .setRequestFormatter( - ProtoMessageRequestFormatter.newBuilder() - .setPath( - "/v1beta1/repeat:bodyput", - request -> { - Map fields = new HashMap<>(); - ProtoRestSerializer serializer = - ProtoRestSerializer.create(); - return fields; - }) - .setQueryParamsExtractor( - request -> { - Map> fields = new HashMap<>(); - ProtoRestSerializer serializer = - ProtoRestSerializer.create(); - serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); - return fields; - }) - .setRequestBodyExtractor( - request -> - ProtoRestSerializer.create() - .toBody("*", request.toBuilder().build(), true)) - .build()) - .setResponseParser( - ProtoMessageResponseParser.newBuilder() - .setDefaultInstance(RepeatResponse.getDefaultInstance()) - .setDefaultTypeRegistry(typeRegistry) - .build()) - .build(); - - private static final ApiMethodDescriptor - repeatDataBodyPatchMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("google.showcase.v1beta1.Compliance/RepeatDataBodyPatch") - .setHttpMethod("PATCH") - .setType(ApiMethodDescriptor.MethodType.UNARY) - .setRequestFormatter( - ProtoMessageRequestFormatter.newBuilder() - .setPath( - "/v1beta1/repeat:bodypatch", - request -> { - Map fields = new HashMap<>(); - ProtoRestSerializer serializer = - ProtoRestSerializer.create(); - return fields; - }) - .setQueryParamsExtractor( - request -> { - Map> fields = new HashMap<>(); - ProtoRestSerializer serializer = - ProtoRestSerializer.create(); - serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); - return fields; - }) - .setRequestBodyExtractor( - request -> - ProtoRestSerializer.create() - .toBody("*", request.toBuilder().build(), true)) - .build()) - .setResponseParser( - ProtoMessageResponseParser.newBuilder() - .setDefaultInstance(RepeatResponse.getDefaultInstance()) - .setDefaultTypeRegistry(typeRegistry) - .build()) - .build(); - - private static final ApiMethodDescriptor getEnumMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("google.showcase.v1beta1.Compliance/GetEnum") - .setHttpMethod("GET") - .setType(ApiMethodDescriptor.MethodType.UNARY) - .setRequestFormatter( - ProtoMessageRequestFormatter.newBuilder() - .setPath( - "/v1beta1/compliance/enum", - request -> { - Map fields = new HashMap<>(); - ProtoRestSerializer serializer = ProtoRestSerializer.create(); - return fields; - }) - .setQueryParamsExtractor( - request -> { - Map> fields = new HashMap<>(); - ProtoRestSerializer serializer = ProtoRestSerializer.create(); - serializer.putQueryParam(fields, "unknownEnum", request.getUnknownEnum()); - serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); - return fields; - }) - .setRequestBodyExtractor(request -> null) - .build()) - .setResponseParser( - ProtoMessageResponseParser.newBuilder() - .setDefaultInstance(EnumResponse.getDefaultInstance()) - .setDefaultTypeRegistry(typeRegistry) - .build()) - .build(); - - private static final ApiMethodDescriptor verifyEnumMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("google.showcase.v1beta1.Compliance/VerifyEnum") - .setHttpMethod("POST") - .setType(ApiMethodDescriptor.MethodType.UNARY) - .setRequestFormatter( - ProtoMessageRequestFormatter.newBuilder() - .setPath( - "/v1beta1/compliance/enum", - request -> { - Map fields = new HashMap<>(); - ProtoRestSerializer serializer = ProtoRestSerializer.create(); - return fields; - }) - .setQueryParamsExtractor( - request -> { - Map> fields = new HashMap<>(); - ProtoRestSerializer serializer = ProtoRestSerializer.create(); - serializer.putQueryParam(fields, "continent", request.getContinentValue()); - serializer.putQueryParam(fields, "request", request.getRequest()); - serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); - return fields; - }) - .setRequestBodyExtractor(request -> null) - .build()) - .setResponseParser( - ProtoMessageResponseParser.newBuilder() - .setDefaultInstance(EnumResponse.getDefaultInstance()) - .setDefaultTypeRegistry(typeRegistry) - .build()) - .build(); - - private final UnaryCallable repeatDataBodyCallable; - private final UnaryCallable repeatDataBodyInfoCallable; - private final UnaryCallable repeatDataQueryCallable; - private final UnaryCallable repeatDataSimplePathCallable; - private final UnaryCallable repeatDataPathResourceCallable; - private final UnaryCallable repeatDataPathTrailingResourceCallable; - private final UnaryCallable repeatDataBodyPutCallable; - private final UnaryCallable repeatDataBodyPatchCallable; - private final UnaryCallable getEnumCallable; - private final UnaryCallable verifyEnumCallable; - - private final BackgroundResource backgroundResources; - private final HttpJsonStubCallableFactory callableFactory; - - public static final HttpJsonComplianceStub create(ComplianceStubSettings settings) - throws IOException { - return new HttpJsonComplianceStub(settings, ClientContext.create(settings)); - } - - public static final HttpJsonComplianceStub create(ClientContext clientContext) - throws IOException { - return new HttpJsonComplianceStub( - ComplianceStubSettings.newHttpJsonBuilder().build(), clientContext); - } - - public static final HttpJsonComplianceStub create( - ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { - return new HttpJsonComplianceStub( - ComplianceStubSettings.newHttpJsonBuilder().build(), clientContext, callableFactory); - } - - /** - * Constructs an instance of HttpJsonComplianceStub, 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 HttpJsonComplianceStub(ComplianceStubSettings settings, ClientContext clientContext) - throws IOException { - this(settings, clientContext, new HttpJsonComplianceCallableFactory()); - } - - /** - * Constructs an instance of HttpJsonComplianceStub, 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 HttpJsonComplianceStub( - ComplianceStubSettings settings, - ClientContext clientContext, - HttpJsonStubCallableFactory callableFactory) - throws IOException { - this.callableFactory = callableFactory; - - HttpJsonCallSettings repeatDataBodyTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(repeatDataBodyMethodDescriptor) - .setTypeRegistry(typeRegistry) - .build(); - HttpJsonCallSettings repeatDataBodyInfoTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(repeatDataBodyInfoMethodDescriptor) - .setTypeRegistry(typeRegistry) - .build(); - HttpJsonCallSettings repeatDataQueryTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(repeatDataQueryMethodDescriptor) - .setTypeRegistry(typeRegistry) - .build(); - HttpJsonCallSettings repeatDataSimplePathTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(repeatDataSimplePathMethodDescriptor) - .setTypeRegistry(typeRegistry) - .build(); - HttpJsonCallSettings repeatDataPathResourceTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(repeatDataPathResourceMethodDescriptor) - .setTypeRegistry(typeRegistry) - .build(); - HttpJsonCallSettings - repeatDataPathTrailingResourceTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(repeatDataPathTrailingResourceMethodDescriptor) - .setTypeRegistry(typeRegistry) - .build(); - HttpJsonCallSettings repeatDataBodyPutTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(repeatDataBodyPutMethodDescriptor) - .setTypeRegistry(typeRegistry) - .build(); - HttpJsonCallSettings repeatDataBodyPatchTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(repeatDataBodyPatchMethodDescriptor) - .setTypeRegistry(typeRegistry) - .build(); - HttpJsonCallSettings getEnumTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(getEnumMethodDescriptor) - .setTypeRegistry(typeRegistry) - .build(); - HttpJsonCallSettings verifyEnumTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(verifyEnumMethodDescriptor) - .setTypeRegistry(typeRegistry) - .build(); - - this.repeatDataBodyCallable = - callableFactory.createUnaryCallable( - repeatDataBodyTransportSettings, settings.repeatDataBodySettings(), clientContext); - this.repeatDataBodyInfoCallable = - callableFactory.createUnaryCallable( - repeatDataBodyInfoTransportSettings, - settings.repeatDataBodyInfoSettings(), - clientContext); - this.repeatDataQueryCallable = - callableFactory.createUnaryCallable( - repeatDataQueryTransportSettings, settings.repeatDataQuerySettings(), clientContext); - this.repeatDataSimplePathCallable = - callableFactory.createUnaryCallable( - repeatDataSimplePathTransportSettings, - settings.repeatDataSimplePathSettings(), - clientContext); - this.repeatDataPathResourceCallable = - callableFactory.createUnaryCallable( - repeatDataPathResourceTransportSettings, - settings.repeatDataPathResourceSettings(), - clientContext); - this.repeatDataPathTrailingResourceCallable = - callableFactory.createUnaryCallable( - repeatDataPathTrailingResourceTransportSettings, - settings.repeatDataPathTrailingResourceSettings(), - clientContext); - this.repeatDataBodyPutCallable = - callableFactory.createUnaryCallable( - repeatDataBodyPutTransportSettings, - settings.repeatDataBodyPutSettings(), - clientContext); - this.repeatDataBodyPatchCallable = - callableFactory.createUnaryCallable( - repeatDataBodyPatchTransportSettings, - settings.repeatDataBodyPatchSettings(), - clientContext); - this.getEnumCallable = - callableFactory.createUnaryCallable( - getEnumTransportSettings, settings.getEnumSettings(), clientContext); - this.verifyEnumCallable = - callableFactory.createUnaryCallable( - verifyEnumTransportSettings, settings.verifyEnumSettings(), clientContext); - - this.backgroundResources = - new BackgroundResourceAggregation(clientContext.getBackgroundResources()); - } - - @InternalApi - public static List getMethodDescriptors() { - List methodDescriptors = new ArrayList<>(); - methodDescriptors.add(repeatDataBodyMethodDescriptor); - methodDescriptors.add(repeatDataBodyInfoMethodDescriptor); - methodDescriptors.add(repeatDataQueryMethodDescriptor); - methodDescriptors.add(repeatDataSimplePathMethodDescriptor); - methodDescriptors.add(repeatDataPathResourceMethodDescriptor); - methodDescriptors.add(repeatDataPathTrailingResourceMethodDescriptor); - methodDescriptors.add(repeatDataBodyPutMethodDescriptor); - methodDescriptors.add(repeatDataBodyPatchMethodDescriptor); - methodDescriptors.add(getEnumMethodDescriptor); - methodDescriptors.add(verifyEnumMethodDescriptor); - return methodDescriptors; - } - - @Override - public UnaryCallable repeatDataBodyCallable() { - return repeatDataBodyCallable; - } - - @Override - public UnaryCallable repeatDataBodyInfoCallable() { - return repeatDataBodyInfoCallable; - } - - @Override - public UnaryCallable repeatDataQueryCallable() { - return repeatDataQueryCallable; - } - - @Override - public UnaryCallable repeatDataSimplePathCallable() { - return repeatDataSimplePathCallable; - } - - @Override - public UnaryCallable repeatDataPathResourceCallable() { - return repeatDataPathResourceCallable; - } - - @Override - public UnaryCallable repeatDataPathTrailingResourceCallable() { - return repeatDataPathTrailingResourceCallable; - } - - @Override - public UnaryCallable repeatDataBodyPutCallable() { - return repeatDataBodyPutCallable; - } - - @Override - public UnaryCallable repeatDataBodyPatchCallable() { - return repeatDataBodyPatchCallable; - } - - @Override - public UnaryCallable getEnumCallable() { - return getEnumCallable; - } - - @Override - public UnaryCallable verifyEnumCallable() { - return verifyEnumCallable; - } - - @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/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/HttpJsonEchoCallableFactory.java b/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/HttpJsonEchoCallableFactory.java deleted file mode 100644 index 0702689af2..0000000000 --- a/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/HttpJsonEchoCallableFactory.java +++ /dev/null @@ -1,105 +0,0 @@ -/* - * 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 - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1.stub; - -import com.google.api.core.BetaApi; -import com.google.api.gax.httpjson.HttpJsonCallSettings; -import com.google.api.gax.httpjson.HttpJsonCallableFactory; -import com.google.api.gax.httpjson.HttpJsonOperationSnapshotCallable; -import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; -import com.google.api.gax.httpjson.longrunning.stub.OperationsStub; -import com.google.api.gax.rpc.BatchingCallSettings; -import com.google.api.gax.rpc.ClientContext; -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.UnaryCallSettings; -import com.google.api.gax.rpc.UnaryCallable; -import com.google.longrunning.Operation; -import javax.annotation.Generated; - -// AUTO-GENERATED DOCUMENTATION AND CLASS. -/** - * REST callable factory implementation for the Echo service API. - * - *

        This class is for advanced usage. - */ -@BetaApi -@Generated("by gapic-generator-java") -public class HttpJsonEchoCallableFactory - implements HttpJsonStubCallableFactory { - - @Override - public UnaryCallable createUnaryCallable( - HttpJsonCallSettings httpJsonCallSettings, - UnaryCallSettings callSettings, - ClientContext clientContext) { - return HttpJsonCallableFactory.createUnaryCallable( - httpJsonCallSettings, callSettings, clientContext); - } - - @Override - public - UnaryCallable createPagedCallable( - HttpJsonCallSettings httpJsonCallSettings, - PagedCallSettings callSettings, - ClientContext clientContext) { - return HttpJsonCallableFactory.createPagedCallable( - httpJsonCallSettings, callSettings, clientContext); - } - - @Override - public UnaryCallable createBatchingCallable( - HttpJsonCallSettings httpJsonCallSettings, - BatchingCallSettings callSettings, - ClientContext clientContext) { - return HttpJsonCallableFactory.createBatchingCallable( - httpJsonCallSettings, callSettings, clientContext); - } - - @BetaApi( - "The surface for long-running operations is not stable yet and may change in the future.") - @Override - public - OperationCallable createOperationCallable( - HttpJsonCallSettings httpJsonCallSettings, - OperationCallSettings callSettings, - ClientContext clientContext, - OperationsStub operationsStub) { - UnaryCallable innerCallable = - HttpJsonCallableFactory.createBaseUnaryCallable( - httpJsonCallSettings, callSettings.getInitialCallSettings(), clientContext); - HttpJsonOperationSnapshotCallable initialCallable = - new HttpJsonOperationSnapshotCallable( - innerCallable, - httpJsonCallSettings.getMethodDescriptor().getOperationSnapshotFactory()); - return HttpJsonCallableFactory.createOperationCallable( - callSettings, clientContext, operationsStub.longRunningClient(), initialCallable); - } - - @Override - public - ServerStreamingCallable createServerStreamingCallable( - HttpJsonCallSettings httpJsonCallSettings, - ServerStreamingCallSettings callSettings, - ClientContext clientContext) { - return HttpJsonCallableFactory.createServerStreamingCallable( - httpJsonCallSettings, callSettings, clientContext); - } -} diff --git a/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/HttpJsonEchoStub.java b/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/HttpJsonEchoStub.java deleted file mode 100644 index 3ddb5d3570..0000000000 --- a/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/HttpJsonEchoStub.java +++ /dev/null @@ -1,562 +0,0 @@ -/* - * 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 - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1.stub; - -import static com.google.showcase.v1beta1.EchoClient.PagedExpandLegacyMappedPagedResponse; -import static com.google.showcase.v1beta1.EchoClient.PagedExpandPagedResponse; - -import com.google.api.core.BetaApi; -import com.google.api.core.InternalApi; -import com.google.api.gax.core.BackgroundResource; -import com.google.api.gax.core.BackgroundResourceAggregation; -import com.google.api.gax.httpjson.ApiMethodDescriptor; -import com.google.api.gax.httpjson.HttpJsonCallSettings; -import com.google.api.gax.httpjson.HttpJsonOperationSnapshot; -import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; -import com.google.api.gax.httpjson.ProtoMessageRequestFormatter; -import com.google.api.gax.httpjson.ProtoMessageResponseParser; -import com.google.api.gax.httpjson.ProtoRestSerializer; -import com.google.api.gax.httpjson.longrunning.stub.HttpJsonOperationsStub; -import com.google.api.gax.longrunning.OperationSnapshot; -import com.google.api.gax.rpc.ClientContext; -import com.google.api.gax.rpc.OperationCallable; -import com.google.api.gax.rpc.ServerStreamingCallable; -import com.google.api.gax.rpc.UnaryCallable; -import com.google.longrunning.Operation; -import com.google.protobuf.TypeRegistry; -import com.google.showcase.v1beta1.BlockRequest; -import com.google.showcase.v1beta1.BlockResponse; -import com.google.showcase.v1beta1.EchoRequest; -import com.google.showcase.v1beta1.EchoResponse; -import com.google.showcase.v1beta1.ExpandRequest; -import com.google.showcase.v1beta1.PagedExpandLegacyMappedResponse; -import com.google.showcase.v1beta1.PagedExpandLegacyRequest; -import com.google.showcase.v1beta1.PagedExpandRequest; -import com.google.showcase.v1beta1.PagedExpandResponse; -import com.google.showcase.v1beta1.WaitMetadata; -import com.google.showcase.v1beta1.WaitRequest; -import com.google.showcase.v1beta1.WaitResponse; -import java.io.IOException; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.concurrent.TimeUnit; -import javax.annotation.Generated; - -// AUTO-GENERATED DOCUMENTATION AND CLASS. -/** - * REST stub implementation for the Echo service API. - * - *

        This class is for advanced usage and reflects the underlying API directly. - */ -@BetaApi -@Generated("by gapic-generator-java") -public class HttpJsonEchoStub extends EchoStub { - private static final TypeRegistry typeRegistry = - TypeRegistry.newBuilder() - .add(WaitResponse.getDescriptor()) - .add(WaitMetadata.getDescriptor()) - .build(); - - private static final ApiMethodDescriptor echoMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("google.showcase.v1beta1.Echo/Echo") - .setHttpMethod("POST") - .setType(ApiMethodDescriptor.MethodType.UNARY) - .setRequestFormatter( - ProtoMessageRequestFormatter.newBuilder() - .setPath( - "/v1beta1/echo:echo", - request -> { - Map fields = new HashMap<>(); - ProtoRestSerializer serializer = ProtoRestSerializer.create(); - return fields; - }) - .setQueryParamsExtractor( - request -> { - Map> fields = new HashMap<>(); - ProtoRestSerializer serializer = ProtoRestSerializer.create(); - serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); - return fields; - }) - .setRequestBodyExtractor( - request -> - ProtoRestSerializer.create() - .toBody("*", request.toBuilder().build(), true)) - .build()) - .setResponseParser( - ProtoMessageResponseParser.newBuilder() - .setDefaultInstance(EchoResponse.getDefaultInstance()) - .setDefaultTypeRegistry(typeRegistry) - .build()) - .build(); - - private static final ApiMethodDescriptor expandMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("google.showcase.v1beta1.Echo/Expand") - .setHttpMethod("POST") - .setType(ApiMethodDescriptor.MethodType.SERVER_STREAMING) - .setRequestFormatter( - ProtoMessageRequestFormatter.newBuilder() - .setPath( - "/v1beta1/echo:expand", - request -> { - Map fields = new HashMap<>(); - ProtoRestSerializer serializer = - ProtoRestSerializer.create(); - return fields; - }) - .setQueryParamsExtractor( - request -> { - Map> fields = new HashMap<>(); - ProtoRestSerializer serializer = - ProtoRestSerializer.create(); - serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); - return fields; - }) - .setRequestBodyExtractor( - request -> - ProtoRestSerializer.create() - .toBody("*", request.toBuilder().build(), true)) - .build()) - .setResponseParser( - ProtoMessageResponseParser.newBuilder() - .setDefaultInstance(EchoResponse.getDefaultInstance()) - .setDefaultTypeRegistry(typeRegistry) - .build()) - .build(); - - private static final ApiMethodDescriptor - pagedExpandMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("google.showcase.v1beta1.Echo/PagedExpand") - .setHttpMethod("POST") - .setType(ApiMethodDescriptor.MethodType.UNARY) - .setRequestFormatter( - ProtoMessageRequestFormatter.newBuilder() - .setPath( - "/v1beta1/echo:pagedExpand", - request -> { - Map fields = new HashMap<>(); - ProtoRestSerializer serializer = - ProtoRestSerializer.create(); - return fields; - }) - .setQueryParamsExtractor( - request -> { - Map> fields = new HashMap<>(); - ProtoRestSerializer serializer = - ProtoRestSerializer.create(); - serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); - return fields; - }) - .setRequestBodyExtractor( - request -> - ProtoRestSerializer.create() - .toBody("*", request.toBuilder().build(), true)) - .build()) - .setResponseParser( - ProtoMessageResponseParser.newBuilder() - .setDefaultInstance(PagedExpandResponse.getDefaultInstance()) - .setDefaultTypeRegistry(typeRegistry) - .build()) - .build(); - - private static final ApiMethodDescriptor - pagedExpandLegacyMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("google.showcase.v1beta1.Echo/PagedExpandLegacy") - .setHttpMethod("POST") - .setType(ApiMethodDescriptor.MethodType.UNARY) - .setRequestFormatter( - ProtoMessageRequestFormatter.newBuilder() - .setPath( - "/v1beta1/echo:pagedExpandLegacy", - request -> { - Map fields = new HashMap<>(); - ProtoRestSerializer serializer = - ProtoRestSerializer.create(); - return fields; - }) - .setQueryParamsExtractor( - request -> { - Map> fields = new HashMap<>(); - ProtoRestSerializer serializer = - ProtoRestSerializer.create(); - serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); - return fields; - }) - .setRequestBodyExtractor( - request -> - ProtoRestSerializer.create() - .toBody("*", request.toBuilder().build(), true)) - .build()) - .setResponseParser( - ProtoMessageResponseParser.newBuilder() - .setDefaultInstance(PagedExpandResponse.getDefaultInstance()) - .setDefaultTypeRegistry(typeRegistry) - .build()) - .build(); - - private static final ApiMethodDescriptor - pagedExpandLegacyMappedMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("google.showcase.v1beta1.Echo/PagedExpandLegacyMapped") - .setHttpMethod("POST") - .setType(ApiMethodDescriptor.MethodType.UNARY) - .setRequestFormatter( - ProtoMessageRequestFormatter.newBuilder() - .setPath( - "/v1beta1/echo:pagedExpandLegacyMapped", - request -> { - Map fields = new HashMap<>(); - ProtoRestSerializer serializer = - ProtoRestSerializer.create(); - return fields; - }) - .setQueryParamsExtractor( - request -> { - Map> fields = new HashMap<>(); - ProtoRestSerializer serializer = - ProtoRestSerializer.create(); - serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); - return fields; - }) - .setRequestBodyExtractor( - request -> - ProtoRestSerializer.create() - .toBody("*", request.toBuilder().build(), true)) - .build()) - .setResponseParser( - ProtoMessageResponseParser.newBuilder() - .setDefaultInstance(PagedExpandLegacyMappedResponse.getDefaultInstance()) - .setDefaultTypeRegistry(typeRegistry) - .build()) - .build(); - - private static final ApiMethodDescriptor waitMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("google.showcase.v1beta1.Echo/Wait") - .setHttpMethod("POST") - .setType(ApiMethodDescriptor.MethodType.UNARY) - .setRequestFormatter( - ProtoMessageRequestFormatter.newBuilder() - .setPath( - "/v1beta1/echo:wait", - request -> { - Map fields = new HashMap<>(); - ProtoRestSerializer serializer = ProtoRestSerializer.create(); - return fields; - }) - .setQueryParamsExtractor( - request -> { - Map> fields = new HashMap<>(); - ProtoRestSerializer serializer = ProtoRestSerializer.create(); - serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); - return fields; - }) - .setRequestBodyExtractor( - request -> - ProtoRestSerializer.create() - .toBody("*", request.toBuilder().build(), true)) - .build()) - .setResponseParser( - ProtoMessageResponseParser.newBuilder() - .setDefaultInstance(Operation.getDefaultInstance()) - .setDefaultTypeRegistry(typeRegistry) - .build()) - .setOperationSnapshotFactory( - (WaitRequest request, Operation response) -> - HttpJsonOperationSnapshot.create(response)) - .build(); - - private static final ApiMethodDescriptor blockMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("google.showcase.v1beta1.Echo/Block") - .setHttpMethod("POST") - .setType(ApiMethodDescriptor.MethodType.UNARY) - .setRequestFormatter( - ProtoMessageRequestFormatter.newBuilder() - .setPath( - "/v1beta1/echo:block", - request -> { - Map fields = new HashMap<>(); - ProtoRestSerializer serializer = ProtoRestSerializer.create(); - return fields; - }) - .setQueryParamsExtractor( - request -> { - Map> fields = new HashMap<>(); - ProtoRestSerializer serializer = ProtoRestSerializer.create(); - serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); - return fields; - }) - .setRequestBodyExtractor( - request -> - ProtoRestSerializer.create() - .toBody("*", request.toBuilder().build(), true)) - .build()) - .setResponseParser( - ProtoMessageResponseParser.newBuilder() - .setDefaultInstance(BlockResponse.getDefaultInstance()) - .setDefaultTypeRegistry(typeRegistry) - .build()) - .build(); - - private final UnaryCallable echoCallable; - private final ServerStreamingCallable expandCallable; - private final UnaryCallable pagedExpandCallable; - private final UnaryCallable - pagedExpandPagedCallable; - private final UnaryCallable - pagedExpandLegacyCallable; - private final UnaryCallable - pagedExpandLegacyMappedCallable; - private final UnaryCallable - pagedExpandLegacyMappedPagedCallable; - private final UnaryCallable waitCallable; - private final OperationCallable waitOperationCallable; - private final UnaryCallable blockCallable; - - private final BackgroundResource backgroundResources; - private final HttpJsonOperationsStub httpJsonOperationsStub; - private final HttpJsonStubCallableFactory callableFactory; - - public static final HttpJsonEchoStub create(EchoStubSettings settings) throws IOException { - return new HttpJsonEchoStub(settings, ClientContext.create(settings)); - } - - public static final HttpJsonEchoStub create(ClientContext clientContext) throws IOException { - return new HttpJsonEchoStub(EchoStubSettings.newHttpJsonBuilder().build(), clientContext); - } - - public static final HttpJsonEchoStub create( - ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { - return new HttpJsonEchoStub( - EchoStubSettings.newHttpJsonBuilder().build(), clientContext, callableFactory); - } - - /** - * Constructs an instance of HttpJsonEchoStub, 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 HttpJsonEchoStub(EchoStubSettings settings, ClientContext clientContext) - throws IOException { - this(settings, clientContext, new HttpJsonEchoCallableFactory()); - } - - /** - * Constructs an instance of HttpJsonEchoStub, 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 HttpJsonEchoStub( - EchoStubSettings settings, - ClientContext clientContext, - HttpJsonStubCallableFactory callableFactory) - throws IOException { - this.callableFactory = callableFactory; - this.httpJsonOperationsStub = - HttpJsonOperationsStub.create(clientContext, callableFactory, typeRegistry); - - HttpJsonCallSettings echoTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(echoMethodDescriptor) - .setTypeRegistry(typeRegistry) - .build(); - HttpJsonCallSettings expandTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(expandMethodDescriptor) - .setTypeRegistry(typeRegistry) - .build(); - HttpJsonCallSettings pagedExpandTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(pagedExpandMethodDescriptor) - .setTypeRegistry(typeRegistry) - .build(); - HttpJsonCallSettings - pagedExpandLegacyTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(pagedExpandLegacyMethodDescriptor) - .setTypeRegistry(typeRegistry) - .build(); - HttpJsonCallSettings - pagedExpandLegacyMappedTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(pagedExpandLegacyMappedMethodDescriptor) - .setTypeRegistry(typeRegistry) - .build(); - HttpJsonCallSettings waitTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(waitMethodDescriptor) - .setTypeRegistry(typeRegistry) - .build(); - HttpJsonCallSettings blockTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(blockMethodDescriptor) - .setTypeRegistry(typeRegistry) - .build(); - - this.echoCallable = - callableFactory.createUnaryCallable( - echoTransportSettings, settings.echoSettings(), clientContext); - this.expandCallable = - callableFactory.createServerStreamingCallable( - expandTransportSettings, settings.expandSettings(), clientContext); - this.pagedExpandCallable = - callableFactory.createUnaryCallable( - pagedExpandTransportSettings, settings.pagedExpandSettings(), clientContext); - this.pagedExpandPagedCallable = - callableFactory.createPagedCallable( - pagedExpandTransportSettings, settings.pagedExpandSettings(), clientContext); - this.pagedExpandLegacyCallable = - callableFactory.createUnaryCallable( - pagedExpandLegacyTransportSettings, - settings.pagedExpandLegacySettings(), - clientContext); - this.pagedExpandLegacyMappedCallable = - callableFactory.createUnaryCallable( - pagedExpandLegacyMappedTransportSettings, - settings.pagedExpandLegacyMappedSettings(), - clientContext); - this.pagedExpandLegacyMappedPagedCallable = - callableFactory.createPagedCallable( - pagedExpandLegacyMappedTransportSettings, - settings.pagedExpandLegacyMappedSettings(), - clientContext); - this.waitCallable = - callableFactory.createUnaryCallable( - waitTransportSettings, settings.waitSettings(), clientContext); - this.waitOperationCallable = - callableFactory.createOperationCallable( - waitTransportSettings, - settings.waitOperationSettings(), - clientContext, - httpJsonOperationsStub); - this.blockCallable = - callableFactory.createUnaryCallable( - blockTransportSettings, settings.blockSettings(), clientContext); - - this.backgroundResources = - new BackgroundResourceAggregation(clientContext.getBackgroundResources()); - } - - @InternalApi - public static List getMethodDescriptors() { - List methodDescriptors = new ArrayList<>(); - methodDescriptors.add(echoMethodDescriptor); - methodDescriptors.add(expandMethodDescriptor); - methodDescriptors.add(pagedExpandMethodDescriptor); - methodDescriptors.add(pagedExpandLegacyMethodDescriptor); - methodDescriptors.add(pagedExpandLegacyMappedMethodDescriptor); - methodDescriptors.add(waitMethodDescriptor); - methodDescriptors.add(blockMethodDescriptor); - return methodDescriptors; - } - - public HttpJsonOperationsStub getHttpJsonOperationsStub() { - return httpJsonOperationsStub; - } - - @Override - public UnaryCallable echoCallable() { - return echoCallable; - } - - @Override - public ServerStreamingCallable expandCallable() { - return expandCallable; - } - - @Override - public UnaryCallable pagedExpandCallable() { - return pagedExpandCallable; - } - - @Override - public UnaryCallable pagedExpandPagedCallable() { - return pagedExpandPagedCallable; - } - - @Override - public UnaryCallable pagedExpandLegacyCallable() { - return pagedExpandLegacyCallable; - } - - @Override - public UnaryCallable - pagedExpandLegacyMappedCallable() { - return pagedExpandLegacyMappedCallable; - } - - @Override - public UnaryCallable - pagedExpandLegacyMappedPagedCallable() { - return pagedExpandLegacyMappedPagedCallable; - } - - @Override - public UnaryCallable waitCallable() { - return waitCallable; - } - - @Override - public OperationCallable waitOperationCallable() { - return waitOperationCallable; - } - - @Override - public UnaryCallable blockCallable() { - return blockCallable; - } - - @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/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/HttpJsonIdentityCallableFactory.java b/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/HttpJsonIdentityCallableFactory.java deleted file mode 100644 index b8766ddbcd..0000000000 --- a/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/HttpJsonIdentityCallableFactory.java +++ /dev/null @@ -1,105 +0,0 @@ -/* - * 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 - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1.stub; - -import com.google.api.core.BetaApi; -import com.google.api.gax.httpjson.HttpJsonCallSettings; -import com.google.api.gax.httpjson.HttpJsonCallableFactory; -import com.google.api.gax.httpjson.HttpJsonOperationSnapshotCallable; -import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; -import com.google.api.gax.httpjson.longrunning.stub.OperationsStub; -import com.google.api.gax.rpc.BatchingCallSettings; -import com.google.api.gax.rpc.ClientContext; -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.UnaryCallSettings; -import com.google.api.gax.rpc.UnaryCallable; -import com.google.longrunning.Operation; -import javax.annotation.Generated; - -// AUTO-GENERATED DOCUMENTATION AND CLASS. -/** - * REST callable factory implementation for the Identity service API. - * - *

        This class is for advanced usage. - */ -@BetaApi -@Generated("by gapic-generator-java") -public class HttpJsonIdentityCallableFactory - implements HttpJsonStubCallableFactory { - - @Override - public UnaryCallable createUnaryCallable( - HttpJsonCallSettings httpJsonCallSettings, - UnaryCallSettings callSettings, - ClientContext clientContext) { - return HttpJsonCallableFactory.createUnaryCallable( - httpJsonCallSettings, callSettings, clientContext); - } - - @Override - public - UnaryCallable createPagedCallable( - HttpJsonCallSettings httpJsonCallSettings, - PagedCallSettings callSettings, - ClientContext clientContext) { - return HttpJsonCallableFactory.createPagedCallable( - httpJsonCallSettings, callSettings, clientContext); - } - - @Override - public UnaryCallable createBatchingCallable( - HttpJsonCallSettings httpJsonCallSettings, - BatchingCallSettings callSettings, - ClientContext clientContext) { - return HttpJsonCallableFactory.createBatchingCallable( - httpJsonCallSettings, callSettings, clientContext); - } - - @BetaApi( - "The surface for long-running operations is not stable yet and may change in the future.") - @Override - public - OperationCallable createOperationCallable( - HttpJsonCallSettings httpJsonCallSettings, - OperationCallSettings callSettings, - ClientContext clientContext, - OperationsStub operationsStub) { - UnaryCallable innerCallable = - HttpJsonCallableFactory.createBaseUnaryCallable( - httpJsonCallSettings, callSettings.getInitialCallSettings(), clientContext); - HttpJsonOperationSnapshotCallable initialCallable = - new HttpJsonOperationSnapshotCallable( - innerCallable, - httpJsonCallSettings.getMethodDescriptor().getOperationSnapshotFactory()); - return HttpJsonCallableFactory.createOperationCallable( - callSettings, clientContext, operationsStub.longRunningClient(), initialCallable); - } - - @Override - public - ServerStreamingCallable createServerStreamingCallable( - HttpJsonCallSettings httpJsonCallSettings, - ServerStreamingCallSettings callSettings, - ClientContext clientContext) { - return HttpJsonCallableFactory.createServerStreamingCallable( - httpJsonCallSettings, callSettings, clientContext); - } -} diff --git a/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/HttpJsonIdentityStub.java b/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/HttpJsonIdentityStub.java deleted file mode 100644 index 528858e711..0000000000 --- a/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/HttpJsonIdentityStub.java +++ /dev/null @@ -1,406 +0,0 @@ -/* - * 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 - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1.stub; - -import static com.google.showcase.v1beta1.IdentityClient.ListUsersPagedResponse; - -import com.google.api.core.BetaApi; -import com.google.api.core.InternalApi; -import com.google.api.gax.core.BackgroundResource; -import com.google.api.gax.core.BackgroundResourceAggregation; -import com.google.api.gax.httpjson.ApiMethodDescriptor; -import com.google.api.gax.httpjson.HttpJsonCallSettings; -import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; -import com.google.api.gax.httpjson.ProtoMessageRequestFormatter; -import com.google.api.gax.httpjson.ProtoMessageResponseParser; -import com.google.api.gax.httpjson.ProtoRestSerializer; -import com.google.api.gax.rpc.ClientContext; -import com.google.api.gax.rpc.UnaryCallable; -import com.google.protobuf.Empty; -import com.google.protobuf.TypeRegistry; -import com.google.showcase.v1beta1.CreateUserRequest; -import com.google.showcase.v1beta1.DeleteUserRequest; -import com.google.showcase.v1beta1.GetUserRequest; -import com.google.showcase.v1beta1.ListUsersRequest; -import com.google.showcase.v1beta1.ListUsersResponse; -import com.google.showcase.v1beta1.UpdateUserRequest; -import com.google.showcase.v1beta1.User; -import java.io.IOException; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.concurrent.TimeUnit; -import javax.annotation.Generated; - -// AUTO-GENERATED DOCUMENTATION AND CLASS. -/** - * REST stub implementation for the Identity service API. - * - *

        This class is for advanced usage and reflects the underlying API directly. - */ -@BetaApi -@Generated("by gapic-generator-java") -public class HttpJsonIdentityStub extends IdentityStub { - private static final TypeRegistry typeRegistry = TypeRegistry.newBuilder().build(); - - private static final ApiMethodDescriptor createUserMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("google.showcase.v1beta1.Identity/CreateUser") - .setHttpMethod("POST") - .setType(ApiMethodDescriptor.MethodType.UNARY) - .setRequestFormatter( - ProtoMessageRequestFormatter.newBuilder() - .setPath( - "/v1beta1/users", - request -> { - Map fields = new HashMap<>(); - ProtoRestSerializer serializer = - ProtoRestSerializer.create(); - return fields; - }) - .setQueryParamsExtractor( - request -> { - Map> fields = new HashMap<>(); - ProtoRestSerializer serializer = - ProtoRestSerializer.create(); - serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); - return fields; - }) - .setRequestBodyExtractor( - request -> - ProtoRestSerializer.create() - .toBody("*", request.toBuilder().build(), true)) - .build()) - .setResponseParser( - ProtoMessageResponseParser.newBuilder() - .setDefaultInstance(User.getDefaultInstance()) - .setDefaultTypeRegistry(typeRegistry) - .build()) - .build(); - - private static final ApiMethodDescriptor getUserMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("google.showcase.v1beta1.Identity/GetUser") - .setHttpMethod("GET") - .setType(ApiMethodDescriptor.MethodType.UNARY) - .setRequestFormatter( - ProtoMessageRequestFormatter.newBuilder() - .setPath( - "/v1beta1/{name=users/*}", - request -> { - Map fields = new HashMap<>(); - ProtoRestSerializer serializer = - ProtoRestSerializer.create(); - serializer.putPathParam(fields, "name", request.getName()); - return fields; - }) - .setQueryParamsExtractor( - request -> { - Map> fields = new HashMap<>(); - ProtoRestSerializer serializer = - ProtoRestSerializer.create(); - serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); - return fields; - }) - .setRequestBodyExtractor(request -> null) - .build()) - .setResponseParser( - ProtoMessageResponseParser.newBuilder() - .setDefaultInstance(User.getDefaultInstance()) - .setDefaultTypeRegistry(typeRegistry) - .build()) - .build(); - - private static final ApiMethodDescriptor updateUserMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("google.showcase.v1beta1.Identity/UpdateUser") - .setHttpMethod("PATCH") - .setType(ApiMethodDescriptor.MethodType.UNARY) - .setRequestFormatter( - ProtoMessageRequestFormatter.newBuilder() - .setPath( - "/v1beta1/{user.name=users/*}", - request -> { - Map fields = new HashMap<>(); - ProtoRestSerializer serializer = - ProtoRestSerializer.create(); - serializer.putPathParam(fields, "user.name", request.getUser().getName()); - return fields; - }) - .setQueryParamsExtractor( - request -> { - Map> fields = new HashMap<>(); - ProtoRestSerializer serializer = - ProtoRestSerializer.create(); - serializer.putQueryParam(fields, "updateMask", request.getUpdateMask()); - serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); - return fields; - }) - .setRequestBodyExtractor( - request -> - ProtoRestSerializer.create().toBody("user", request.getUser(), true)) - .build()) - .setResponseParser( - ProtoMessageResponseParser.newBuilder() - .setDefaultInstance(User.getDefaultInstance()) - .setDefaultTypeRegistry(typeRegistry) - .build()) - .build(); - - private static final ApiMethodDescriptor deleteUserMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("google.showcase.v1beta1.Identity/DeleteUser") - .setHttpMethod("DELETE") - .setType(ApiMethodDescriptor.MethodType.UNARY) - .setRequestFormatter( - ProtoMessageRequestFormatter.newBuilder() - .setPath( - "/v1beta1/{name=users/*}", - request -> { - Map fields = new HashMap<>(); - ProtoRestSerializer serializer = - ProtoRestSerializer.create(); - serializer.putPathParam(fields, "name", request.getName()); - return fields; - }) - .setQueryParamsExtractor( - request -> { - Map> fields = new HashMap<>(); - ProtoRestSerializer serializer = - ProtoRestSerializer.create(); - serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); - return fields; - }) - .setRequestBodyExtractor(request -> null) - .build()) - .setResponseParser( - ProtoMessageResponseParser.newBuilder() - .setDefaultInstance(Empty.getDefaultInstance()) - .setDefaultTypeRegistry(typeRegistry) - .build()) - .build(); - - private static final ApiMethodDescriptor - listUsersMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("google.showcase.v1beta1.Identity/ListUsers") - .setHttpMethod("GET") - .setType(ApiMethodDescriptor.MethodType.UNARY) - .setRequestFormatter( - ProtoMessageRequestFormatter.newBuilder() - .setPath( - "/v1beta1/users", - request -> { - Map fields = new HashMap<>(); - ProtoRestSerializer serializer = - ProtoRestSerializer.create(); - return fields; - }) - .setQueryParamsExtractor( - request -> { - Map> fields = new HashMap<>(); - ProtoRestSerializer serializer = - ProtoRestSerializer.create(); - serializer.putQueryParam(fields, "pageSize", request.getPageSize()); - serializer.putQueryParam(fields, "pageToken", request.getPageToken()); - serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); - return fields; - }) - .setRequestBodyExtractor(request -> null) - .build()) - .setResponseParser( - ProtoMessageResponseParser.newBuilder() - .setDefaultInstance(ListUsersResponse.getDefaultInstance()) - .setDefaultTypeRegistry(typeRegistry) - .build()) - .build(); - - private final UnaryCallable createUserCallable; - private final UnaryCallable getUserCallable; - private final UnaryCallable updateUserCallable; - private final UnaryCallable deleteUserCallable; - private final UnaryCallable listUsersCallable; - private final UnaryCallable listUsersPagedCallable; - - private final BackgroundResource backgroundResources; - private final HttpJsonStubCallableFactory callableFactory; - - public static final HttpJsonIdentityStub create(IdentityStubSettings settings) - throws IOException { - return new HttpJsonIdentityStub(settings, ClientContext.create(settings)); - } - - public static final HttpJsonIdentityStub create(ClientContext clientContext) throws IOException { - return new HttpJsonIdentityStub( - IdentityStubSettings.newHttpJsonBuilder().build(), clientContext); - } - - public static final HttpJsonIdentityStub create( - ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { - return new HttpJsonIdentityStub( - IdentityStubSettings.newHttpJsonBuilder().build(), clientContext, callableFactory); - } - - /** - * Constructs an instance of HttpJsonIdentityStub, 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 HttpJsonIdentityStub(IdentityStubSettings settings, ClientContext clientContext) - throws IOException { - this(settings, clientContext, new HttpJsonIdentityCallableFactory()); - } - - /** - * Constructs an instance of HttpJsonIdentityStub, 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 HttpJsonIdentityStub( - IdentityStubSettings settings, - ClientContext clientContext, - HttpJsonStubCallableFactory callableFactory) - throws IOException { - this.callableFactory = callableFactory; - - HttpJsonCallSettings createUserTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(createUserMethodDescriptor) - .setTypeRegistry(typeRegistry) - .build(); - HttpJsonCallSettings getUserTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(getUserMethodDescriptor) - .setTypeRegistry(typeRegistry) - .build(); - HttpJsonCallSettings updateUserTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(updateUserMethodDescriptor) - .setTypeRegistry(typeRegistry) - .build(); - HttpJsonCallSettings deleteUserTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(deleteUserMethodDescriptor) - .setTypeRegistry(typeRegistry) - .build(); - HttpJsonCallSettings listUsersTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(listUsersMethodDescriptor) - .setTypeRegistry(typeRegistry) - .build(); - - this.createUserCallable = - callableFactory.createUnaryCallable( - createUserTransportSettings, settings.createUserSettings(), clientContext); - this.getUserCallable = - callableFactory.createUnaryCallable( - getUserTransportSettings, settings.getUserSettings(), clientContext); - this.updateUserCallable = - callableFactory.createUnaryCallable( - updateUserTransportSettings, settings.updateUserSettings(), clientContext); - this.deleteUserCallable = - callableFactory.createUnaryCallable( - deleteUserTransportSettings, settings.deleteUserSettings(), clientContext); - this.listUsersCallable = - callableFactory.createUnaryCallable( - listUsersTransportSettings, settings.listUsersSettings(), clientContext); - this.listUsersPagedCallable = - callableFactory.createPagedCallable( - listUsersTransportSettings, settings.listUsersSettings(), clientContext); - - this.backgroundResources = - new BackgroundResourceAggregation(clientContext.getBackgroundResources()); - } - - @InternalApi - public static List getMethodDescriptors() { - List methodDescriptors = new ArrayList<>(); - methodDescriptors.add(createUserMethodDescriptor); - methodDescriptors.add(getUserMethodDescriptor); - methodDescriptors.add(updateUserMethodDescriptor); - methodDescriptors.add(deleteUserMethodDescriptor); - methodDescriptors.add(listUsersMethodDescriptor); - return methodDescriptors; - } - - @Override - public UnaryCallable createUserCallable() { - return createUserCallable; - } - - @Override - public UnaryCallable getUserCallable() { - return getUserCallable; - } - - @Override - public UnaryCallable updateUserCallable() { - return updateUserCallable; - } - - @Override - public UnaryCallable deleteUserCallable() { - return deleteUserCallable; - } - - @Override - public UnaryCallable listUsersCallable() { - return listUsersCallable; - } - - @Override - public UnaryCallable listUsersPagedCallable() { - return listUsersPagedCallable; - } - - @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/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/HttpJsonMessagingCallableFactory.java b/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/HttpJsonMessagingCallableFactory.java deleted file mode 100644 index f56157bdd4..0000000000 --- a/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/HttpJsonMessagingCallableFactory.java +++ /dev/null @@ -1,105 +0,0 @@ -/* - * 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 - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1.stub; - -import com.google.api.core.BetaApi; -import com.google.api.gax.httpjson.HttpJsonCallSettings; -import com.google.api.gax.httpjson.HttpJsonCallableFactory; -import com.google.api.gax.httpjson.HttpJsonOperationSnapshotCallable; -import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; -import com.google.api.gax.httpjson.longrunning.stub.OperationsStub; -import com.google.api.gax.rpc.BatchingCallSettings; -import com.google.api.gax.rpc.ClientContext; -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.UnaryCallSettings; -import com.google.api.gax.rpc.UnaryCallable; -import com.google.longrunning.Operation; -import javax.annotation.Generated; - -// AUTO-GENERATED DOCUMENTATION AND CLASS. -/** - * REST callable factory implementation for the Messaging service API. - * - *

        This class is for advanced usage. - */ -@BetaApi -@Generated("by gapic-generator-java") -public class HttpJsonMessagingCallableFactory - implements HttpJsonStubCallableFactory { - - @Override - public UnaryCallable createUnaryCallable( - HttpJsonCallSettings httpJsonCallSettings, - UnaryCallSettings callSettings, - ClientContext clientContext) { - return HttpJsonCallableFactory.createUnaryCallable( - httpJsonCallSettings, callSettings, clientContext); - } - - @Override - public - UnaryCallable createPagedCallable( - HttpJsonCallSettings httpJsonCallSettings, - PagedCallSettings callSettings, - ClientContext clientContext) { - return HttpJsonCallableFactory.createPagedCallable( - httpJsonCallSettings, callSettings, clientContext); - } - - @Override - public UnaryCallable createBatchingCallable( - HttpJsonCallSettings httpJsonCallSettings, - BatchingCallSettings callSettings, - ClientContext clientContext) { - return HttpJsonCallableFactory.createBatchingCallable( - httpJsonCallSettings, callSettings, clientContext); - } - - @BetaApi( - "The surface for long-running operations is not stable yet and may change in the future.") - @Override - public - OperationCallable createOperationCallable( - HttpJsonCallSettings httpJsonCallSettings, - OperationCallSettings callSettings, - ClientContext clientContext, - OperationsStub operationsStub) { - UnaryCallable innerCallable = - HttpJsonCallableFactory.createBaseUnaryCallable( - httpJsonCallSettings, callSettings.getInitialCallSettings(), clientContext); - HttpJsonOperationSnapshotCallable initialCallable = - new HttpJsonOperationSnapshotCallable( - innerCallable, - httpJsonCallSettings.getMethodDescriptor().getOperationSnapshotFactory()); - return HttpJsonCallableFactory.createOperationCallable( - callSettings, clientContext, operationsStub.longRunningClient(), initialCallable); - } - - @Override - public - ServerStreamingCallable createServerStreamingCallable( - HttpJsonCallSettings httpJsonCallSettings, - ServerStreamingCallSettings callSettings, - ClientContext clientContext) { - return HttpJsonCallableFactory.createServerStreamingCallable( - httpJsonCallSettings, callSettings, clientContext); - } -} diff --git a/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/HttpJsonMessagingStub.java b/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/HttpJsonMessagingStub.java deleted file mode 100644 index 41ac603817..0000000000 --- a/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/HttpJsonMessagingStub.java +++ /dev/null @@ -1,823 +0,0 @@ -/* - * 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 - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1.stub; - -import static com.google.showcase.v1beta1.MessagingClient.ListBlurbsPagedResponse; -import static com.google.showcase.v1beta1.MessagingClient.ListRoomsPagedResponse; - -import com.google.api.core.BetaApi; -import com.google.api.core.InternalApi; -import com.google.api.gax.core.BackgroundResource; -import com.google.api.gax.core.BackgroundResourceAggregation; -import com.google.api.gax.httpjson.ApiMethodDescriptor; -import com.google.api.gax.httpjson.HttpJsonCallSettings; -import com.google.api.gax.httpjson.HttpJsonOperationSnapshot; -import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; -import com.google.api.gax.httpjson.ProtoMessageRequestFormatter; -import com.google.api.gax.httpjson.ProtoMessageResponseParser; -import com.google.api.gax.httpjson.ProtoRestSerializer; -import com.google.api.gax.httpjson.longrunning.stub.HttpJsonOperationsStub; -import com.google.api.gax.longrunning.OperationSnapshot; -import com.google.api.gax.rpc.ClientContext; -import com.google.api.gax.rpc.OperationCallable; -import com.google.api.gax.rpc.ServerStreamingCallable; -import com.google.api.gax.rpc.UnaryCallable; -import com.google.longrunning.Operation; -import com.google.protobuf.Empty; -import com.google.protobuf.TypeRegistry; -import com.google.showcase.v1beta1.Blurb; -import com.google.showcase.v1beta1.CreateBlurbRequest; -import com.google.showcase.v1beta1.CreateRoomRequest; -import com.google.showcase.v1beta1.DeleteBlurbRequest; -import com.google.showcase.v1beta1.DeleteRoomRequest; -import com.google.showcase.v1beta1.GetBlurbRequest; -import com.google.showcase.v1beta1.GetRoomRequest; -import com.google.showcase.v1beta1.ListBlurbsRequest; -import com.google.showcase.v1beta1.ListBlurbsResponse; -import com.google.showcase.v1beta1.ListRoomsRequest; -import com.google.showcase.v1beta1.ListRoomsResponse; -import com.google.showcase.v1beta1.Room; -import com.google.showcase.v1beta1.SearchBlurbsMetadata; -import com.google.showcase.v1beta1.SearchBlurbsRequest; -import com.google.showcase.v1beta1.SearchBlurbsResponse; -import com.google.showcase.v1beta1.StreamBlurbsRequest; -import com.google.showcase.v1beta1.StreamBlurbsResponse; -import com.google.showcase.v1beta1.UpdateBlurbRequest; -import com.google.showcase.v1beta1.UpdateRoomRequest; -import java.io.IOException; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.concurrent.TimeUnit; -import javax.annotation.Generated; - -// AUTO-GENERATED DOCUMENTATION AND CLASS. -/** - * REST stub implementation for the Messaging service API. - * - *

        This class is for advanced usage and reflects the underlying API directly. - */ -@BetaApi -@Generated("by gapic-generator-java") -public class HttpJsonMessagingStub extends MessagingStub { - private static final TypeRegistry typeRegistry = - TypeRegistry.newBuilder() - .add(SearchBlurbsResponse.getDescriptor()) - .add(SearchBlurbsMetadata.getDescriptor()) - .build(); - - private static final ApiMethodDescriptor createRoomMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("google.showcase.v1beta1.Messaging/CreateRoom") - .setHttpMethod("POST") - .setType(ApiMethodDescriptor.MethodType.UNARY) - .setRequestFormatter( - ProtoMessageRequestFormatter.newBuilder() - .setPath( - "/v1beta1/rooms", - request -> { - Map fields = new HashMap<>(); - ProtoRestSerializer serializer = - ProtoRestSerializer.create(); - return fields; - }) - .setQueryParamsExtractor( - request -> { - Map> fields = new HashMap<>(); - ProtoRestSerializer serializer = - ProtoRestSerializer.create(); - serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); - return fields; - }) - .setRequestBodyExtractor( - request -> - ProtoRestSerializer.create() - .toBody("*", request.toBuilder().build(), true)) - .build()) - .setResponseParser( - ProtoMessageResponseParser.newBuilder() - .setDefaultInstance(Room.getDefaultInstance()) - .setDefaultTypeRegistry(typeRegistry) - .build()) - .build(); - - private static final ApiMethodDescriptor getRoomMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("google.showcase.v1beta1.Messaging/GetRoom") - .setHttpMethod("GET") - .setType(ApiMethodDescriptor.MethodType.UNARY) - .setRequestFormatter( - ProtoMessageRequestFormatter.newBuilder() - .setPath( - "/v1beta1/{name=rooms/*}", - request -> { - Map fields = new HashMap<>(); - ProtoRestSerializer serializer = - ProtoRestSerializer.create(); - serializer.putPathParam(fields, "name", request.getName()); - return fields; - }) - .setQueryParamsExtractor( - request -> { - Map> fields = new HashMap<>(); - ProtoRestSerializer serializer = - ProtoRestSerializer.create(); - serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); - return fields; - }) - .setRequestBodyExtractor(request -> null) - .build()) - .setResponseParser( - ProtoMessageResponseParser.newBuilder() - .setDefaultInstance(Room.getDefaultInstance()) - .setDefaultTypeRegistry(typeRegistry) - .build()) - .build(); - - private static final ApiMethodDescriptor updateRoomMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("google.showcase.v1beta1.Messaging/UpdateRoom") - .setHttpMethod("PATCH") - .setType(ApiMethodDescriptor.MethodType.UNARY) - .setRequestFormatter( - ProtoMessageRequestFormatter.newBuilder() - .setPath( - "/v1beta1/{room.name=rooms/*}", - request -> { - Map fields = new HashMap<>(); - ProtoRestSerializer serializer = - ProtoRestSerializer.create(); - serializer.putPathParam(fields, "room.name", request.getRoom().getName()); - return fields; - }) - .setQueryParamsExtractor( - request -> { - Map> fields = new HashMap<>(); - ProtoRestSerializer serializer = - ProtoRestSerializer.create(); - serializer.putQueryParam(fields, "updateMask", request.getUpdateMask()); - serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); - return fields; - }) - .setRequestBodyExtractor( - request -> - ProtoRestSerializer.create().toBody("room", request.getRoom(), true)) - .build()) - .setResponseParser( - ProtoMessageResponseParser.newBuilder() - .setDefaultInstance(Room.getDefaultInstance()) - .setDefaultTypeRegistry(typeRegistry) - .build()) - .build(); - - private static final ApiMethodDescriptor deleteRoomMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("google.showcase.v1beta1.Messaging/DeleteRoom") - .setHttpMethod("DELETE") - .setType(ApiMethodDescriptor.MethodType.UNARY) - .setRequestFormatter( - ProtoMessageRequestFormatter.newBuilder() - .setPath( - "/v1beta1/{name=rooms/*}", - request -> { - Map fields = new HashMap<>(); - ProtoRestSerializer serializer = - ProtoRestSerializer.create(); - serializer.putPathParam(fields, "name", request.getName()); - return fields; - }) - .setQueryParamsExtractor( - request -> { - Map> fields = new HashMap<>(); - ProtoRestSerializer serializer = - ProtoRestSerializer.create(); - serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); - return fields; - }) - .setRequestBodyExtractor(request -> null) - .build()) - .setResponseParser( - ProtoMessageResponseParser.newBuilder() - .setDefaultInstance(Empty.getDefaultInstance()) - .setDefaultTypeRegistry(typeRegistry) - .build()) - .build(); - - private static final ApiMethodDescriptor - listRoomsMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("google.showcase.v1beta1.Messaging/ListRooms") - .setHttpMethod("GET") - .setType(ApiMethodDescriptor.MethodType.UNARY) - .setRequestFormatter( - ProtoMessageRequestFormatter.newBuilder() - .setPath( - "/v1beta1/rooms", - request -> { - Map fields = new HashMap<>(); - ProtoRestSerializer serializer = - ProtoRestSerializer.create(); - return fields; - }) - .setQueryParamsExtractor( - request -> { - Map> fields = new HashMap<>(); - ProtoRestSerializer serializer = - ProtoRestSerializer.create(); - serializer.putQueryParam(fields, "pageSize", request.getPageSize()); - serializer.putQueryParam(fields, "pageToken", request.getPageToken()); - serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); - return fields; - }) - .setRequestBodyExtractor(request -> null) - .build()) - .setResponseParser( - ProtoMessageResponseParser.newBuilder() - .setDefaultInstance(ListRoomsResponse.getDefaultInstance()) - .setDefaultTypeRegistry(typeRegistry) - .build()) - .build(); - - private static final ApiMethodDescriptor createBlurbMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("google.showcase.v1beta1.Messaging/CreateBlurb") - .setHttpMethod("POST") - .setType(ApiMethodDescriptor.MethodType.UNARY) - .setRequestFormatter( - ProtoMessageRequestFormatter.newBuilder() - .setPath( - "/v1beta1/{parent=rooms/*}/blurbs", - request -> { - Map fields = new HashMap<>(); - ProtoRestSerializer serializer = - ProtoRestSerializer.create(); - serializer.putPathParam(fields, "parent", request.getParent()); - return fields; - }) - .setAdditionalPaths("/v1beta1/{parent=users/*/profile}/blurbs") - .setQueryParamsExtractor( - request -> { - Map> fields = new HashMap<>(); - ProtoRestSerializer serializer = - ProtoRestSerializer.create(); - serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); - return fields; - }) - .setRequestBodyExtractor( - request -> - ProtoRestSerializer.create() - .toBody("*", request.toBuilder().clearParent().build(), true)) - .build()) - .setResponseParser( - ProtoMessageResponseParser.newBuilder() - .setDefaultInstance(Blurb.getDefaultInstance()) - .setDefaultTypeRegistry(typeRegistry) - .build()) - .build(); - - private static final ApiMethodDescriptor getBlurbMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("google.showcase.v1beta1.Messaging/GetBlurb") - .setHttpMethod("GET") - .setType(ApiMethodDescriptor.MethodType.UNARY) - .setRequestFormatter( - ProtoMessageRequestFormatter.newBuilder() - .setPath( - "/v1beta1/{name=rooms/*/blurbs/*}", - request -> { - Map fields = new HashMap<>(); - ProtoRestSerializer serializer = - ProtoRestSerializer.create(); - serializer.putPathParam(fields, "name", request.getName()); - return fields; - }) - .setAdditionalPaths("/v1beta1/{name=users/*/profile/blurbs/*}") - .setQueryParamsExtractor( - request -> { - Map> fields = new HashMap<>(); - ProtoRestSerializer serializer = - ProtoRestSerializer.create(); - serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); - return fields; - }) - .setRequestBodyExtractor(request -> null) - .build()) - .setResponseParser( - ProtoMessageResponseParser.newBuilder() - .setDefaultInstance(Blurb.getDefaultInstance()) - .setDefaultTypeRegistry(typeRegistry) - .build()) - .build(); - - private static final ApiMethodDescriptor updateBlurbMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("google.showcase.v1beta1.Messaging/UpdateBlurb") - .setHttpMethod("PATCH") - .setType(ApiMethodDescriptor.MethodType.UNARY) - .setRequestFormatter( - ProtoMessageRequestFormatter.newBuilder() - .setPath( - "/v1beta1/{blurb.name=rooms/*/blurbs/*}", - request -> { - Map fields = new HashMap<>(); - ProtoRestSerializer serializer = - ProtoRestSerializer.create(); - serializer.putPathParam(fields, "blurb.name", request.getBlurb().getName()); - return fields; - }) - .setAdditionalPaths("/v1beta1/{blurb.name=users/*/profile/blurbs/*}") - .setQueryParamsExtractor( - request -> { - Map> fields = new HashMap<>(); - ProtoRestSerializer serializer = - ProtoRestSerializer.create(); - serializer.putQueryParam(fields, "updateMask", request.getUpdateMask()); - serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); - return fields; - }) - .setRequestBodyExtractor( - request -> - ProtoRestSerializer.create().toBody("blurb", request.getBlurb(), true)) - .build()) - .setResponseParser( - ProtoMessageResponseParser.newBuilder() - .setDefaultInstance(Blurb.getDefaultInstance()) - .setDefaultTypeRegistry(typeRegistry) - .build()) - .build(); - - private static final ApiMethodDescriptor deleteBlurbMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("google.showcase.v1beta1.Messaging/DeleteBlurb") - .setHttpMethod("DELETE") - .setType(ApiMethodDescriptor.MethodType.UNARY) - .setRequestFormatter( - ProtoMessageRequestFormatter.newBuilder() - .setPath( - "/v1beta1/{name=rooms/*/blurbs/*}", - request -> { - Map fields = new HashMap<>(); - ProtoRestSerializer serializer = - ProtoRestSerializer.create(); - serializer.putPathParam(fields, "name", request.getName()); - return fields; - }) - .setAdditionalPaths("/v1beta1/{name=users/*/profile/blurbs/*}") - .setQueryParamsExtractor( - request -> { - Map> fields = new HashMap<>(); - ProtoRestSerializer serializer = - ProtoRestSerializer.create(); - serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); - return fields; - }) - .setRequestBodyExtractor(request -> null) - .build()) - .setResponseParser( - ProtoMessageResponseParser.newBuilder() - .setDefaultInstance(Empty.getDefaultInstance()) - .setDefaultTypeRegistry(typeRegistry) - .build()) - .build(); - - private static final ApiMethodDescriptor - listBlurbsMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("google.showcase.v1beta1.Messaging/ListBlurbs") - .setHttpMethod("GET") - .setType(ApiMethodDescriptor.MethodType.UNARY) - .setRequestFormatter( - ProtoMessageRequestFormatter.newBuilder() - .setPath( - "/v1beta1/{parent=rooms/*}/blurbs", - request -> { - Map fields = new HashMap<>(); - ProtoRestSerializer serializer = - ProtoRestSerializer.create(); - serializer.putPathParam(fields, "parent", request.getParent()); - return fields; - }) - .setAdditionalPaths("/v1beta1/{parent=users/*/profile}/blurbs") - .setQueryParamsExtractor( - request -> { - Map> fields = new HashMap<>(); - ProtoRestSerializer serializer = - ProtoRestSerializer.create(); - serializer.putQueryParam(fields, "pageSize", request.getPageSize()); - serializer.putQueryParam(fields, "pageToken", request.getPageToken()); - serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); - return fields; - }) - .setRequestBodyExtractor(request -> null) - .build()) - .setResponseParser( - ProtoMessageResponseParser.newBuilder() - .setDefaultInstance(ListBlurbsResponse.getDefaultInstance()) - .setDefaultTypeRegistry(typeRegistry) - .build()) - .build(); - - private static final ApiMethodDescriptor - searchBlurbsMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("google.showcase.v1beta1.Messaging/SearchBlurbs") - .setHttpMethod("POST") - .setType(ApiMethodDescriptor.MethodType.UNARY) - .setRequestFormatter( - ProtoMessageRequestFormatter.newBuilder() - .setPath( - "/v1beta1/{parent=rooms/*}/blurbs:search", - request -> { - Map fields = new HashMap<>(); - ProtoRestSerializer serializer = - ProtoRestSerializer.create(); - serializer.putPathParam(fields, "parent", request.getParent()); - return fields; - }) - .setAdditionalPaths("/v1beta1/{parent=users/*/profile}/blurbs:search") - .setQueryParamsExtractor( - request -> { - Map> fields = new HashMap<>(); - ProtoRestSerializer serializer = - ProtoRestSerializer.create(); - serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); - return fields; - }) - .setRequestBodyExtractor( - request -> - ProtoRestSerializer.create() - .toBody("*", request.toBuilder().clearParent().build(), true)) - .build()) - .setResponseParser( - ProtoMessageResponseParser.newBuilder() - .setDefaultInstance(Operation.getDefaultInstance()) - .setDefaultTypeRegistry(typeRegistry) - .build()) - .setOperationSnapshotFactory( - (SearchBlurbsRequest request, Operation response) -> - HttpJsonOperationSnapshot.create(response)) - .build(); - - private static final ApiMethodDescriptor - streamBlurbsMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("google.showcase.v1beta1.Messaging/StreamBlurbs") - .setHttpMethod("POST") - .setType(ApiMethodDescriptor.MethodType.SERVER_STREAMING) - .setRequestFormatter( - ProtoMessageRequestFormatter.newBuilder() - .setPath( - "/v1beta1/{name=rooms/*}/blurbs:stream", - request -> { - Map fields = new HashMap<>(); - ProtoRestSerializer serializer = - ProtoRestSerializer.create(); - serializer.putPathParam(fields, "name", request.getName()); - return fields; - }) - .setAdditionalPaths("/v1beta1/{name=users/*/profile}/blurbs:stream") - .setQueryParamsExtractor( - request -> { - Map> fields = new HashMap<>(); - ProtoRestSerializer serializer = - ProtoRestSerializer.create(); - serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); - return fields; - }) - .setRequestBodyExtractor( - request -> - ProtoRestSerializer.create() - .toBody("*", request.toBuilder().clearName().build(), true)) - .build()) - .setResponseParser( - ProtoMessageResponseParser.newBuilder() - .setDefaultInstance(StreamBlurbsResponse.getDefaultInstance()) - .setDefaultTypeRegistry(typeRegistry) - .build()) - .build(); - - private final UnaryCallable createRoomCallable; - private final UnaryCallable getRoomCallable; - private final UnaryCallable updateRoomCallable; - private final UnaryCallable deleteRoomCallable; - private final UnaryCallable listRoomsCallable; - private final UnaryCallable listRoomsPagedCallable; - private final UnaryCallable createBlurbCallable; - private final UnaryCallable getBlurbCallable; - private final UnaryCallable updateBlurbCallable; - private final UnaryCallable deleteBlurbCallable; - private final UnaryCallable listBlurbsCallable; - private final UnaryCallable listBlurbsPagedCallable; - private final UnaryCallable searchBlurbsCallable; - private final OperationCallable - searchBlurbsOperationCallable; - private final ServerStreamingCallable - streamBlurbsCallable; - - private final BackgroundResource backgroundResources; - private final HttpJsonOperationsStub httpJsonOperationsStub; - private final HttpJsonStubCallableFactory callableFactory; - - public static final HttpJsonMessagingStub create(MessagingStubSettings settings) - throws IOException { - return new HttpJsonMessagingStub(settings, ClientContext.create(settings)); - } - - public static final HttpJsonMessagingStub create(ClientContext clientContext) throws IOException { - return new HttpJsonMessagingStub( - MessagingStubSettings.newHttpJsonBuilder().build(), clientContext); - } - - public static final HttpJsonMessagingStub create( - ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { - return new HttpJsonMessagingStub( - MessagingStubSettings.newHttpJsonBuilder().build(), clientContext, callableFactory); - } - - /** - * Constructs an instance of HttpJsonMessagingStub, 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 HttpJsonMessagingStub(MessagingStubSettings settings, ClientContext clientContext) - throws IOException { - this(settings, clientContext, new HttpJsonMessagingCallableFactory()); - } - - /** - * Constructs an instance of HttpJsonMessagingStub, 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 HttpJsonMessagingStub( - MessagingStubSettings settings, - ClientContext clientContext, - HttpJsonStubCallableFactory callableFactory) - throws IOException { - this.callableFactory = callableFactory; - this.httpJsonOperationsStub = - HttpJsonOperationsStub.create(clientContext, callableFactory, typeRegistry); - - HttpJsonCallSettings createRoomTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(createRoomMethodDescriptor) - .setTypeRegistry(typeRegistry) - .build(); - HttpJsonCallSettings getRoomTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(getRoomMethodDescriptor) - .setTypeRegistry(typeRegistry) - .build(); - HttpJsonCallSettings updateRoomTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(updateRoomMethodDescriptor) - .setTypeRegistry(typeRegistry) - .build(); - HttpJsonCallSettings deleteRoomTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(deleteRoomMethodDescriptor) - .setTypeRegistry(typeRegistry) - .build(); - HttpJsonCallSettings listRoomsTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(listRoomsMethodDescriptor) - .setTypeRegistry(typeRegistry) - .build(); - HttpJsonCallSettings createBlurbTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(createBlurbMethodDescriptor) - .setTypeRegistry(typeRegistry) - .build(); - HttpJsonCallSettings getBlurbTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(getBlurbMethodDescriptor) - .setTypeRegistry(typeRegistry) - .build(); - HttpJsonCallSettings updateBlurbTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(updateBlurbMethodDescriptor) - .setTypeRegistry(typeRegistry) - .build(); - HttpJsonCallSettings deleteBlurbTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(deleteBlurbMethodDescriptor) - .setTypeRegistry(typeRegistry) - .build(); - HttpJsonCallSettings listBlurbsTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(listBlurbsMethodDescriptor) - .setTypeRegistry(typeRegistry) - .build(); - HttpJsonCallSettings searchBlurbsTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(searchBlurbsMethodDescriptor) - .setTypeRegistry(typeRegistry) - .build(); - HttpJsonCallSettings streamBlurbsTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(streamBlurbsMethodDescriptor) - .setTypeRegistry(typeRegistry) - .build(); - - this.createRoomCallable = - callableFactory.createUnaryCallable( - createRoomTransportSettings, settings.createRoomSettings(), clientContext); - this.getRoomCallable = - callableFactory.createUnaryCallable( - getRoomTransportSettings, settings.getRoomSettings(), clientContext); - this.updateRoomCallable = - callableFactory.createUnaryCallable( - updateRoomTransportSettings, settings.updateRoomSettings(), clientContext); - this.deleteRoomCallable = - callableFactory.createUnaryCallable( - deleteRoomTransportSettings, settings.deleteRoomSettings(), clientContext); - this.listRoomsCallable = - callableFactory.createUnaryCallable( - listRoomsTransportSettings, settings.listRoomsSettings(), clientContext); - this.listRoomsPagedCallable = - callableFactory.createPagedCallable( - listRoomsTransportSettings, settings.listRoomsSettings(), clientContext); - this.createBlurbCallable = - callableFactory.createUnaryCallable( - createBlurbTransportSettings, settings.createBlurbSettings(), clientContext); - this.getBlurbCallable = - callableFactory.createUnaryCallable( - getBlurbTransportSettings, settings.getBlurbSettings(), clientContext); - this.updateBlurbCallable = - callableFactory.createUnaryCallable( - updateBlurbTransportSettings, settings.updateBlurbSettings(), clientContext); - this.deleteBlurbCallable = - callableFactory.createUnaryCallable( - deleteBlurbTransportSettings, settings.deleteBlurbSettings(), clientContext); - this.listBlurbsCallable = - callableFactory.createUnaryCallable( - listBlurbsTransportSettings, settings.listBlurbsSettings(), clientContext); - this.listBlurbsPagedCallable = - callableFactory.createPagedCallable( - listBlurbsTransportSettings, settings.listBlurbsSettings(), clientContext); - this.searchBlurbsCallable = - callableFactory.createUnaryCallable( - searchBlurbsTransportSettings, settings.searchBlurbsSettings(), clientContext); - this.searchBlurbsOperationCallable = - callableFactory.createOperationCallable( - searchBlurbsTransportSettings, - settings.searchBlurbsOperationSettings(), - clientContext, - httpJsonOperationsStub); - this.streamBlurbsCallable = - callableFactory.createServerStreamingCallable( - streamBlurbsTransportSettings, settings.streamBlurbsSettings(), clientContext); - - this.backgroundResources = - new BackgroundResourceAggregation(clientContext.getBackgroundResources()); - } - - @InternalApi - public static List getMethodDescriptors() { - List methodDescriptors = new ArrayList<>(); - methodDescriptors.add(createRoomMethodDescriptor); - methodDescriptors.add(getRoomMethodDescriptor); - methodDescriptors.add(updateRoomMethodDescriptor); - methodDescriptors.add(deleteRoomMethodDescriptor); - methodDescriptors.add(listRoomsMethodDescriptor); - methodDescriptors.add(createBlurbMethodDescriptor); - methodDescriptors.add(getBlurbMethodDescriptor); - methodDescriptors.add(updateBlurbMethodDescriptor); - methodDescriptors.add(deleteBlurbMethodDescriptor); - methodDescriptors.add(listBlurbsMethodDescriptor); - methodDescriptors.add(searchBlurbsMethodDescriptor); - methodDescriptors.add(streamBlurbsMethodDescriptor); - return methodDescriptors; - } - - public HttpJsonOperationsStub getHttpJsonOperationsStub() { - return httpJsonOperationsStub; - } - - @Override - public UnaryCallable createRoomCallable() { - return createRoomCallable; - } - - @Override - public UnaryCallable getRoomCallable() { - return getRoomCallable; - } - - @Override - public UnaryCallable updateRoomCallable() { - return updateRoomCallable; - } - - @Override - public UnaryCallable deleteRoomCallable() { - return deleteRoomCallable; - } - - @Override - public UnaryCallable listRoomsCallable() { - return listRoomsCallable; - } - - @Override - public UnaryCallable listRoomsPagedCallable() { - return listRoomsPagedCallable; - } - - @Override - public UnaryCallable createBlurbCallable() { - return createBlurbCallable; - } - - @Override - public UnaryCallable getBlurbCallable() { - return getBlurbCallable; - } - - @Override - public UnaryCallable updateBlurbCallable() { - return updateBlurbCallable; - } - - @Override - public UnaryCallable deleteBlurbCallable() { - return deleteBlurbCallable; - } - - @Override - public UnaryCallable listBlurbsCallable() { - return listBlurbsCallable; - } - - @Override - public UnaryCallable listBlurbsPagedCallable() { - return listBlurbsPagedCallable; - } - - @Override - public UnaryCallable searchBlurbsCallable() { - return searchBlurbsCallable; - } - - @Override - public OperationCallable - searchBlurbsOperationCallable() { - return searchBlurbsOperationCallable; - } - - @Override - public ServerStreamingCallable streamBlurbsCallable() { - return streamBlurbsCallable; - } - - @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/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/HttpJsonSequenceServiceCallableFactory.java b/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/HttpJsonSequenceServiceCallableFactory.java deleted file mode 100644 index dc37c46e8a..0000000000 --- a/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/HttpJsonSequenceServiceCallableFactory.java +++ /dev/null @@ -1,105 +0,0 @@ -/* - * 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 - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1.stub; - -import com.google.api.core.BetaApi; -import com.google.api.gax.httpjson.HttpJsonCallSettings; -import com.google.api.gax.httpjson.HttpJsonCallableFactory; -import com.google.api.gax.httpjson.HttpJsonOperationSnapshotCallable; -import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; -import com.google.api.gax.httpjson.longrunning.stub.OperationsStub; -import com.google.api.gax.rpc.BatchingCallSettings; -import com.google.api.gax.rpc.ClientContext; -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.UnaryCallSettings; -import com.google.api.gax.rpc.UnaryCallable; -import com.google.longrunning.Operation; -import javax.annotation.Generated; - -// AUTO-GENERATED DOCUMENTATION AND CLASS. -/** - * REST callable factory implementation for the SequenceService service API. - * - *

        This class is for advanced usage. - */ -@BetaApi -@Generated("by gapic-generator-java") -public class HttpJsonSequenceServiceCallableFactory - implements HttpJsonStubCallableFactory { - - @Override - public UnaryCallable createUnaryCallable( - HttpJsonCallSettings httpJsonCallSettings, - UnaryCallSettings callSettings, - ClientContext clientContext) { - return HttpJsonCallableFactory.createUnaryCallable( - httpJsonCallSettings, callSettings, clientContext); - } - - @Override - public - UnaryCallable createPagedCallable( - HttpJsonCallSettings httpJsonCallSettings, - PagedCallSettings callSettings, - ClientContext clientContext) { - return HttpJsonCallableFactory.createPagedCallable( - httpJsonCallSettings, callSettings, clientContext); - } - - @Override - public UnaryCallable createBatchingCallable( - HttpJsonCallSettings httpJsonCallSettings, - BatchingCallSettings callSettings, - ClientContext clientContext) { - return HttpJsonCallableFactory.createBatchingCallable( - httpJsonCallSettings, callSettings, clientContext); - } - - @BetaApi( - "The surface for long-running operations is not stable yet and may change in the future.") - @Override - public - OperationCallable createOperationCallable( - HttpJsonCallSettings httpJsonCallSettings, - OperationCallSettings callSettings, - ClientContext clientContext, - OperationsStub operationsStub) { - UnaryCallable innerCallable = - HttpJsonCallableFactory.createBaseUnaryCallable( - httpJsonCallSettings, callSettings.getInitialCallSettings(), clientContext); - HttpJsonOperationSnapshotCallable initialCallable = - new HttpJsonOperationSnapshotCallable( - innerCallable, - httpJsonCallSettings.getMethodDescriptor().getOperationSnapshotFactory()); - return HttpJsonCallableFactory.createOperationCallable( - callSettings, clientContext, operationsStub.longRunningClient(), initialCallable); - } - - @Override - public - ServerStreamingCallable createServerStreamingCallable( - HttpJsonCallSettings httpJsonCallSettings, - ServerStreamingCallSettings callSettings, - ClientContext clientContext) { - return HttpJsonCallableFactory.createServerStreamingCallable( - httpJsonCallSettings, callSettings, clientContext); - } -} diff --git a/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/HttpJsonSequenceServiceStub.java b/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/HttpJsonSequenceServiceStub.java deleted file mode 100644 index c2522b9648..0000000000 --- a/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/HttpJsonSequenceServiceStub.java +++ /dev/null @@ -1,302 +0,0 @@ -/* - * 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 - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1.stub; - -import com.google.api.core.BetaApi; -import com.google.api.core.InternalApi; -import com.google.api.gax.core.BackgroundResource; -import com.google.api.gax.core.BackgroundResourceAggregation; -import com.google.api.gax.httpjson.ApiMethodDescriptor; -import com.google.api.gax.httpjson.HttpJsonCallSettings; -import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; -import com.google.api.gax.httpjson.ProtoMessageRequestFormatter; -import com.google.api.gax.httpjson.ProtoMessageResponseParser; -import com.google.api.gax.httpjson.ProtoRestSerializer; -import com.google.api.gax.rpc.ClientContext; -import com.google.api.gax.rpc.UnaryCallable; -import com.google.protobuf.Empty; -import com.google.protobuf.TypeRegistry; -import com.google.showcase.v1beta1.AttemptSequenceRequest; -import com.google.showcase.v1beta1.CreateSequenceRequest; -import com.google.showcase.v1beta1.GetSequenceReportRequest; -import com.google.showcase.v1beta1.Sequence; -import com.google.showcase.v1beta1.SequenceReport; -import java.io.IOException; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.concurrent.TimeUnit; -import javax.annotation.Generated; - -// AUTO-GENERATED DOCUMENTATION AND CLASS. -/** - * REST stub implementation for the SequenceService service API. - * - *

        This class is for advanced usage and reflects the underlying API directly. - */ -@BetaApi -@Generated("by gapic-generator-java") -public class HttpJsonSequenceServiceStub extends SequenceServiceStub { - private static final TypeRegistry typeRegistry = TypeRegistry.newBuilder().build(); - - private static final ApiMethodDescriptor - createSequenceMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("google.showcase.v1beta1.SequenceService/CreateSequence") - .setHttpMethod("POST") - .setType(ApiMethodDescriptor.MethodType.UNARY) - .setRequestFormatter( - ProtoMessageRequestFormatter.newBuilder() - .setPath( - "/v1beta1/sequences", - request -> { - Map fields = new HashMap<>(); - ProtoRestSerializer serializer = - ProtoRestSerializer.create(); - return fields; - }) - .setQueryParamsExtractor( - request -> { - Map> fields = new HashMap<>(); - ProtoRestSerializer serializer = - ProtoRestSerializer.create(); - serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); - return fields; - }) - .setRequestBodyExtractor( - request -> - ProtoRestSerializer.create() - .toBody("sequence", request.getSequence(), true)) - .build()) - .setResponseParser( - ProtoMessageResponseParser.newBuilder() - .setDefaultInstance(Sequence.getDefaultInstance()) - .setDefaultTypeRegistry(typeRegistry) - .build()) - .build(); - - private static final ApiMethodDescriptor - getSequenceReportMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("google.showcase.v1beta1.SequenceService/GetSequenceReport") - .setHttpMethod("GET") - .setType(ApiMethodDescriptor.MethodType.UNARY) - .setRequestFormatter( - ProtoMessageRequestFormatter.newBuilder() - .setPath( - "/v1beta1/{name=sequences/*/sequenceReport}", - request -> { - Map fields = new HashMap<>(); - ProtoRestSerializer serializer = - ProtoRestSerializer.create(); - serializer.putPathParam(fields, "name", request.getName()); - return fields; - }) - .setQueryParamsExtractor( - request -> { - Map> fields = new HashMap<>(); - ProtoRestSerializer serializer = - ProtoRestSerializer.create(); - serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); - return fields; - }) - .setRequestBodyExtractor(request -> null) - .build()) - .setResponseParser( - ProtoMessageResponseParser.newBuilder() - .setDefaultInstance(SequenceReport.getDefaultInstance()) - .setDefaultTypeRegistry(typeRegistry) - .build()) - .build(); - - private static final ApiMethodDescriptor - attemptSequenceMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("google.showcase.v1beta1.SequenceService/AttemptSequence") - .setHttpMethod("POST") - .setType(ApiMethodDescriptor.MethodType.UNARY) - .setRequestFormatter( - ProtoMessageRequestFormatter.newBuilder() - .setPath( - "/v1beta1/{name=sequences/*}", - request -> { - Map fields = new HashMap<>(); - ProtoRestSerializer serializer = - ProtoRestSerializer.create(); - serializer.putPathParam(fields, "name", request.getName()); - return fields; - }) - .setQueryParamsExtractor( - request -> { - Map> fields = new HashMap<>(); - ProtoRestSerializer serializer = - ProtoRestSerializer.create(); - serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); - return fields; - }) - .setRequestBodyExtractor( - request -> - ProtoRestSerializer.create() - .toBody("*", request.toBuilder().clearName().build(), true)) - .build()) - .setResponseParser( - ProtoMessageResponseParser.newBuilder() - .setDefaultInstance(Empty.getDefaultInstance()) - .setDefaultTypeRegistry(typeRegistry) - .build()) - .build(); - - private final UnaryCallable createSequenceCallable; - private final UnaryCallable getSequenceReportCallable; - private final UnaryCallable attemptSequenceCallable; - - private final BackgroundResource backgroundResources; - private final HttpJsonStubCallableFactory callableFactory; - - public static final HttpJsonSequenceServiceStub create(SequenceServiceStubSettings settings) - throws IOException { - return new HttpJsonSequenceServiceStub(settings, ClientContext.create(settings)); - } - - public static final HttpJsonSequenceServiceStub create(ClientContext clientContext) - throws IOException { - return new HttpJsonSequenceServiceStub( - SequenceServiceStubSettings.newHttpJsonBuilder().build(), clientContext); - } - - public static final HttpJsonSequenceServiceStub create( - ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { - return new HttpJsonSequenceServiceStub( - SequenceServiceStubSettings.newHttpJsonBuilder().build(), clientContext, callableFactory); - } - - /** - * Constructs an instance of HttpJsonSequenceServiceStub, 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 HttpJsonSequenceServiceStub( - SequenceServiceStubSettings settings, ClientContext clientContext) throws IOException { - this(settings, clientContext, new HttpJsonSequenceServiceCallableFactory()); - } - - /** - * Constructs an instance of HttpJsonSequenceServiceStub, 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 HttpJsonSequenceServiceStub( - SequenceServiceStubSettings settings, - ClientContext clientContext, - HttpJsonStubCallableFactory callableFactory) - throws IOException { - this.callableFactory = callableFactory; - - HttpJsonCallSettings createSequenceTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(createSequenceMethodDescriptor) - .setTypeRegistry(typeRegistry) - .build(); - HttpJsonCallSettings - getSequenceReportTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(getSequenceReportMethodDescriptor) - .setTypeRegistry(typeRegistry) - .build(); - HttpJsonCallSettings attemptSequenceTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(attemptSequenceMethodDescriptor) - .setTypeRegistry(typeRegistry) - .build(); - - this.createSequenceCallable = - callableFactory.createUnaryCallable( - createSequenceTransportSettings, settings.createSequenceSettings(), clientContext); - this.getSequenceReportCallable = - callableFactory.createUnaryCallable( - getSequenceReportTransportSettings, - settings.getSequenceReportSettings(), - clientContext); - this.attemptSequenceCallable = - callableFactory.createUnaryCallable( - attemptSequenceTransportSettings, settings.attemptSequenceSettings(), clientContext); - - this.backgroundResources = - new BackgroundResourceAggregation(clientContext.getBackgroundResources()); - } - - @InternalApi - public static List getMethodDescriptors() { - List methodDescriptors = new ArrayList<>(); - methodDescriptors.add(createSequenceMethodDescriptor); - methodDescriptors.add(getSequenceReportMethodDescriptor); - methodDescriptors.add(attemptSequenceMethodDescriptor); - return methodDescriptors; - } - - @Override - public UnaryCallable createSequenceCallable() { - return createSequenceCallable; - } - - @Override - public UnaryCallable getSequenceReportCallable() { - return getSequenceReportCallable; - } - - @Override - public UnaryCallable attemptSequenceCallable() { - return attemptSequenceCallable; - } - - @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/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/HttpJsonTestingCallableFactory.java b/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/HttpJsonTestingCallableFactory.java deleted file mode 100644 index c33422c6ae..0000000000 --- a/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/HttpJsonTestingCallableFactory.java +++ /dev/null @@ -1,105 +0,0 @@ -/* - * 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 - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1.stub; - -import com.google.api.core.BetaApi; -import com.google.api.gax.httpjson.HttpJsonCallSettings; -import com.google.api.gax.httpjson.HttpJsonCallableFactory; -import com.google.api.gax.httpjson.HttpJsonOperationSnapshotCallable; -import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; -import com.google.api.gax.httpjson.longrunning.stub.OperationsStub; -import com.google.api.gax.rpc.BatchingCallSettings; -import com.google.api.gax.rpc.ClientContext; -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.UnaryCallSettings; -import com.google.api.gax.rpc.UnaryCallable; -import com.google.longrunning.Operation; -import javax.annotation.Generated; - -// AUTO-GENERATED DOCUMENTATION AND CLASS. -/** - * REST callable factory implementation for the Testing service API. - * - *

        This class is for advanced usage. - */ -@BetaApi -@Generated("by gapic-generator-java") -public class HttpJsonTestingCallableFactory - implements HttpJsonStubCallableFactory { - - @Override - public UnaryCallable createUnaryCallable( - HttpJsonCallSettings httpJsonCallSettings, - UnaryCallSettings callSettings, - ClientContext clientContext) { - return HttpJsonCallableFactory.createUnaryCallable( - httpJsonCallSettings, callSettings, clientContext); - } - - @Override - public - UnaryCallable createPagedCallable( - HttpJsonCallSettings httpJsonCallSettings, - PagedCallSettings callSettings, - ClientContext clientContext) { - return HttpJsonCallableFactory.createPagedCallable( - httpJsonCallSettings, callSettings, clientContext); - } - - @Override - public UnaryCallable createBatchingCallable( - HttpJsonCallSettings httpJsonCallSettings, - BatchingCallSettings callSettings, - ClientContext clientContext) { - return HttpJsonCallableFactory.createBatchingCallable( - httpJsonCallSettings, callSettings, clientContext); - } - - @BetaApi( - "The surface for long-running operations is not stable yet and may change in the future.") - @Override - public - OperationCallable createOperationCallable( - HttpJsonCallSettings httpJsonCallSettings, - OperationCallSettings callSettings, - ClientContext clientContext, - OperationsStub operationsStub) { - UnaryCallable innerCallable = - HttpJsonCallableFactory.createBaseUnaryCallable( - httpJsonCallSettings, callSettings.getInitialCallSettings(), clientContext); - HttpJsonOperationSnapshotCallable initialCallable = - new HttpJsonOperationSnapshotCallable( - innerCallable, - httpJsonCallSettings.getMethodDescriptor().getOperationSnapshotFactory()); - return HttpJsonCallableFactory.createOperationCallable( - callSettings, clientContext, operationsStub.longRunningClient(), initialCallable); - } - - @Override - public - ServerStreamingCallable createServerStreamingCallable( - HttpJsonCallSettings httpJsonCallSettings, - ServerStreamingCallSettings callSettings, - ClientContext clientContext) { - return HttpJsonCallableFactory.createServerStreamingCallable( - httpJsonCallSettings, callSettings, clientContext); - } -} diff --git a/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/HttpJsonTestingStub.java b/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/HttpJsonTestingStub.java deleted file mode 100644 index eb1a664bb0..0000000000 --- a/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/HttpJsonTestingStub.java +++ /dev/null @@ -1,572 +0,0 @@ -/* - * 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 - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1.stub; - -import static com.google.showcase.v1beta1.TestingClient.ListSessionsPagedResponse; -import static com.google.showcase.v1beta1.TestingClient.ListTestsPagedResponse; - -import com.google.api.core.BetaApi; -import com.google.api.core.InternalApi; -import com.google.api.gax.core.BackgroundResource; -import com.google.api.gax.core.BackgroundResourceAggregation; -import com.google.api.gax.httpjson.ApiMethodDescriptor; -import com.google.api.gax.httpjson.HttpJsonCallSettings; -import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; -import com.google.api.gax.httpjson.ProtoMessageRequestFormatter; -import com.google.api.gax.httpjson.ProtoMessageResponseParser; -import com.google.api.gax.httpjson.ProtoRestSerializer; -import com.google.api.gax.rpc.ClientContext; -import com.google.api.gax.rpc.UnaryCallable; -import com.google.protobuf.Empty; -import com.google.protobuf.TypeRegistry; -import com.google.showcase.v1beta1.CreateSessionRequest; -import com.google.showcase.v1beta1.DeleteSessionRequest; -import com.google.showcase.v1beta1.DeleteTestRequest; -import com.google.showcase.v1beta1.GetSessionRequest; -import com.google.showcase.v1beta1.ListSessionsRequest; -import com.google.showcase.v1beta1.ListSessionsResponse; -import com.google.showcase.v1beta1.ListTestsRequest; -import com.google.showcase.v1beta1.ListTestsResponse; -import com.google.showcase.v1beta1.ReportSessionRequest; -import com.google.showcase.v1beta1.ReportSessionResponse; -import com.google.showcase.v1beta1.Session; -import com.google.showcase.v1beta1.VerifyTestRequest; -import com.google.showcase.v1beta1.VerifyTestResponse; -import java.io.IOException; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.concurrent.TimeUnit; -import javax.annotation.Generated; - -// AUTO-GENERATED DOCUMENTATION AND CLASS. -/** - * REST stub implementation for the Testing service API. - * - *

        This class is for advanced usage and reflects the underlying API directly. - */ -@BetaApi -@Generated("by gapic-generator-java") -public class HttpJsonTestingStub extends TestingStub { - private static final TypeRegistry typeRegistry = TypeRegistry.newBuilder().build(); - - private static final ApiMethodDescriptor - createSessionMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("google.showcase.v1beta1.Testing/CreateSession") - .setHttpMethod("POST") - .setType(ApiMethodDescriptor.MethodType.UNARY) - .setRequestFormatter( - ProtoMessageRequestFormatter.newBuilder() - .setPath( - "/v1beta1/sessions", - request -> { - Map fields = new HashMap<>(); - ProtoRestSerializer serializer = - ProtoRestSerializer.create(); - return fields; - }) - .setQueryParamsExtractor( - request -> { - Map> fields = new HashMap<>(); - ProtoRestSerializer serializer = - ProtoRestSerializer.create(); - serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); - return fields; - }) - .setRequestBodyExtractor( - request -> - ProtoRestSerializer.create() - .toBody("session", request.getSession(), true)) - .build()) - .setResponseParser( - ProtoMessageResponseParser.newBuilder() - .setDefaultInstance(Session.getDefaultInstance()) - .setDefaultTypeRegistry(typeRegistry) - .build()) - .build(); - - private static final ApiMethodDescriptor getSessionMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("google.showcase.v1beta1.Testing/GetSession") - .setHttpMethod("GET") - .setType(ApiMethodDescriptor.MethodType.UNARY) - .setRequestFormatter( - ProtoMessageRequestFormatter.newBuilder() - .setPath( - "/v1beta1/{name=sessions/*}", - request -> { - Map fields = new HashMap<>(); - ProtoRestSerializer serializer = - ProtoRestSerializer.create(); - serializer.putPathParam(fields, "name", request.getName()); - return fields; - }) - .setQueryParamsExtractor( - request -> { - Map> fields = new HashMap<>(); - ProtoRestSerializer serializer = - ProtoRestSerializer.create(); - serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); - return fields; - }) - .setRequestBodyExtractor(request -> null) - .build()) - .setResponseParser( - ProtoMessageResponseParser.newBuilder() - .setDefaultInstance(Session.getDefaultInstance()) - .setDefaultTypeRegistry(typeRegistry) - .build()) - .build(); - - private static final ApiMethodDescriptor - listSessionsMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("google.showcase.v1beta1.Testing/ListSessions") - .setHttpMethod("GET") - .setType(ApiMethodDescriptor.MethodType.UNARY) - .setRequestFormatter( - ProtoMessageRequestFormatter.newBuilder() - .setPath( - "/v1beta1/sessions", - request -> { - Map fields = new HashMap<>(); - ProtoRestSerializer serializer = - ProtoRestSerializer.create(); - return fields; - }) - .setQueryParamsExtractor( - request -> { - Map> fields = new HashMap<>(); - ProtoRestSerializer serializer = - ProtoRestSerializer.create(); - serializer.putQueryParam(fields, "pageSize", request.getPageSize()); - serializer.putQueryParam(fields, "pageToken", request.getPageToken()); - serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); - return fields; - }) - .setRequestBodyExtractor(request -> null) - .build()) - .setResponseParser( - ProtoMessageResponseParser.newBuilder() - .setDefaultInstance(ListSessionsResponse.getDefaultInstance()) - .setDefaultTypeRegistry(typeRegistry) - .build()) - .build(); - - private static final ApiMethodDescriptor - deleteSessionMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("google.showcase.v1beta1.Testing/DeleteSession") - .setHttpMethod("DELETE") - .setType(ApiMethodDescriptor.MethodType.UNARY) - .setRequestFormatter( - ProtoMessageRequestFormatter.newBuilder() - .setPath( - "/v1beta1/{name=sessions/*}", - request -> { - Map fields = new HashMap<>(); - ProtoRestSerializer serializer = - ProtoRestSerializer.create(); - serializer.putPathParam(fields, "name", request.getName()); - return fields; - }) - .setQueryParamsExtractor( - request -> { - Map> fields = new HashMap<>(); - ProtoRestSerializer serializer = - ProtoRestSerializer.create(); - serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); - return fields; - }) - .setRequestBodyExtractor(request -> null) - .build()) - .setResponseParser( - ProtoMessageResponseParser.newBuilder() - .setDefaultInstance(Empty.getDefaultInstance()) - .setDefaultTypeRegistry(typeRegistry) - .build()) - .build(); - - private static final ApiMethodDescriptor - reportSessionMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("google.showcase.v1beta1.Testing/ReportSession") - .setHttpMethod("POST") - .setType(ApiMethodDescriptor.MethodType.UNARY) - .setRequestFormatter( - ProtoMessageRequestFormatter.newBuilder() - .setPath( - "/v1beta1/{name=sessions/*}:report", - request -> { - Map fields = new HashMap<>(); - ProtoRestSerializer serializer = - ProtoRestSerializer.create(); - serializer.putPathParam(fields, "name", request.getName()); - return fields; - }) - .setQueryParamsExtractor( - request -> { - Map> fields = new HashMap<>(); - ProtoRestSerializer serializer = - ProtoRestSerializer.create(); - serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); - return fields; - }) - .setRequestBodyExtractor(request -> null) - .build()) - .setResponseParser( - ProtoMessageResponseParser.newBuilder() - .setDefaultInstance(ReportSessionResponse.getDefaultInstance()) - .setDefaultTypeRegistry(typeRegistry) - .build()) - .build(); - - private static final ApiMethodDescriptor - listTestsMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("google.showcase.v1beta1.Testing/ListTests") - .setHttpMethod("GET") - .setType(ApiMethodDescriptor.MethodType.UNARY) - .setRequestFormatter( - ProtoMessageRequestFormatter.newBuilder() - .setPath( - "/v1beta1/{parent=sessions/*}/tests", - request -> { - Map fields = new HashMap<>(); - ProtoRestSerializer serializer = - ProtoRestSerializer.create(); - serializer.putPathParam(fields, "parent", request.getParent()); - return fields; - }) - .setQueryParamsExtractor( - request -> { - Map> fields = new HashMap<>(); - ProtoRestSerializer serializer = - ProtoRestSerializer.create(); - serializer.putQueryParam(fields, "pageSize", request.getPageSize()); - serializer.putQueryParam(fields, "pageToken", request.getPageToken()); - serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); - return fields; - }) - .setRequestBodyExtractor(request -> null) - .build()) - .setResponseParser( - ProtoMessageResponseParser.newBuilder() - .setDefaultInstance(ListTestsResponse.getDefaultInstance()) - .setDefaultTypeRegistry(typeRegistry) - .build()) - .build(); - - private static final ApiMethodDescriptor deleteTestMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("google.showcase.v1beta1.Testing/DeleteTest") - .setHttpMethod("DELETE") - .setType(ApiMethodDescriptor.MethodType.UNARY) - .setRequestFormatter( - ProtoMessageRequestFormatter.newBuilder() - .setPath( - "/v1beta1/{name=sessions/*/tests/*}", - request -> { - Map fields = new HashMap<>(); - ProtoRestSerializer serializer = - ProtoRestSerializer.create(); - serializer.putPathParam(fields, "name", request.getName()); - return fields; - }) - .setQueryParamsExtractor( - request -> { - Map> fields = new HashMap<>(); - ProtoRestSerializer serializer = - ProtoRestSerializer.create(); - serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); - return fields; - }) - .setRequestBodyExtractor(request -> null) - .build()) - .setResponseParser( - ProtoMessageResponseParser.newBuilder() - .setDefaultInstance(Empty.getDefaultInstance()) - .setDefaultTypeRegistry(typeRegistry) - .build()) - .build(); - - private static final ApiMethodDescriptor - verifyTestMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("google.showcase.v1beta1.Testing/VerifyTest") - .setHttpMethod("POST") - .setType(ApiMethodDescriptor.MethodType.UNARY) - .setRequestFormatter( - ProtoMessageRequestFormatter.newBuilder() - .setPath( - "/v1beta1/{name=sessions/*/tests/*}:check", - request -> { - Map fields = new HashMap<>(); - ProtoRestSerializer serializer = - ProtoRestSerializer.create(); - serializer.putPathParam(fields, "name", request.getName()); - return fields; - }) - .setQueryParamsExtractor( - request -> { - Map> fields = new HashMap<>(); - ProtoRestSerializer serializer = - ProtoRestSerializer.create(); - serializer.putQueryParam(fields, "answer", request.getAnswer()); - serializer.putQueryParam(fields, "answers", request.getAnswersList()); - serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); - return fields; - }) - .setRequestBodyExtractor(request -> null) - .build()) - .setResponseParser( - ProtoMessageResponseParser.newBuilder() - .setDefaultInstance(VerifyTestResponse.getDefaultInstance()) - .setDefaultTypeRegistry(typeRegistry) - .build()) - .build(); - - private final UnaryCallable createSessionCallable; - private final UnaryCallable getSessionCallable; - private final UnaryCallable listSessionsCallable; - private final UnaryCallable - listSessionsPagedCallable; - private final UnaryCallable deleteSessionCallable; - private final UnaryCallable reportSessionCallable; - private final UnaryCallable listTestsCallable; - private final UnaryCallable listTestsPagedCallable; - private final UnaryCallable deleteTestCallable; - private final UnaryCallable verifyTestCallable; - - private final BackgroundResource backgroundResources; - private final HttpJsonStubCallableFactory callableFactory; - - public static final HttpJsonTestingStub create(TestingStubSettings settings) throws IOException { - return new HttpJsonTestingStub(settings, ClientContext.create(settings)); - } - - public static final HttpJsonTestingStub create(ClientContext clientContext) throws IOException { - return new HttpJsonTestingStub(TestingStubSettings.newHttpJsonBuilder().build(), clientContext); - } - - public static final HttpJsonTestingStub create( - ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { - return new HttpJsonTestingStub( - TestingStubSettings.newHttpJsonBuilder().build(), clientContext, callableFactory); - } - - /** - * Constructs an instance of HttpJsonTestingStub, 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 HttpJsonTestingStub(TestingStubSettings settings, ClientContext clientContext) - throws IOException { - this(settings, clientContext, new HttpJsonTestingCallableFactory()); - } - - /** - * Constructs an instance of HttpJsonTestingStub, 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 HttpJsonTestingStub( - TestingStubSettings settings, - ClientContext clientContext, - HttpJsonStubCallableFactory callableFactory) - throws IOException { - this.callableFactory = callableFactory; - - HttpJsonCallSettings createSessionTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(createSessionMethodDescriptor) - .setTypeRegistry(typeRegistry) - .build(); - HttpJsonCallSettings getSessionTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(getSessionMethodDescriptor) - .setTypeRegistry(typeRegistry) - .build(); - HttpJsonCallSettings listSessionsTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(listSessionsMethodDescriptor) - .setTypeRegistry(typeRegistry) - .build(); - HttpJsonCallSettings deleteSessionTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(deleteSessionMethodDescriptor) - .setTypeRegistry(typeRegistry) - .build(); - HttpJsonCallSettings - reportSessionTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(reportSessionMethodDescriptor) - .setTypeRegistry(typeRegistry) - .build(); - HttpJsonCallSettings listTestsTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(listTestsMethodDescriptor) - .setTypeRegistry(typeRegistry) - .build(); - HttpJsonCallSettings deleteTestTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(deleteTestMethodDescriptor) - .setTypeRegistry(typeRegistry) - .build(); - HttpJsonCallSettings verifyTestTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(verifyTestMethodDescriptor) - .setTypeRegistry(typeRegistry) - .build(); - - this.createSessionCallable = - callableFactory.createUnaryCallable( - createSessionTransportSettings, settings.createSessionSettings(), clientContext); - this.getSessionCallable = - callableFactory.createUnaryCallable( - getSessionTransportSettings, settings.getSessionSettings(), clientContext); - this.listSessionsCallable = - callableFactory.createUnaryCallable( - listSessionsTransportSettings, settings.listSessionsSettings(), clientContext); - this.listSessionsPagedCallable = - callableFactory.createPagedCallable( - listSessionsTransportSettings, settings.listSessionsSettings(), clientContext); - this.deleteSessionCallable = - callableFactory.createUnaryCallable( - deleteSessionTransportSettings, settings.deleteSessionSettings(), clientContext); - this.reportSessionCallable = - callableFactory.createUnaryCallable( - reportSessionTransportSettings, settings.reportSessionSettings(), clientContext); - this.listTestsCallable = - callableFactory.createUnaryCallable( - listTestsTransportSettings, settings.listTestsSettings(), clientContext); - this.listTestsPagedCallable = - callableFactory.createPagedCallable( - listTestsTransportSettings, settings.listTestsSettings(), clientContext); - this.deleteTestCallable = - callableFactory.createUnaryCallable( - deleteTestTransportSettings, settings.deleteTestSettings(), clientContext); - this.verifyTestCallable = - callableFactory.createUnaryCallable( - verifyTestTransportSettings, settings.verifyTestSettings(), clientContext); - - this.backgroundResources = - new BackgroundResourceAggregation(clientContext.getBackgroundResources()); - } - - @InternalApi - public static List getMethodDescriptors() { - List methodDescriptors = new ArrayList<>(); - methodDescriptors.add(createSessionMethodDescriptor); - methodDescriptors.add(getSessionMethodDescriptor); - methodDescriptors.add(listSessionsMethodDescriptor); - methodDescriptors.add(deleteSessionMethodDescriptor); - methodDescriptors.add(reportSessionMethodDescriptor); - methodDescriptors.add(listTestsMethodDescriptor); - methodDescriptors.add(deleteTestMethodDescriptor); - methodDescriptors.add(verifyTestMethodDescriptor); - return methodDescriptors; - } - - @Override - public UnaryCallable createSessionCallable() { - return createSessionCallable; - } - - @Override - public UnaryCallable getSessionCallable() { - return getSessionCallable; - } - - @Override - public UnaryCallable listSessionsCallable() { - return listSessionsCallable; - } - - @Override - public UnaryCallable listSessionsPagedCallable() { - return listSessionsPagedCallable; - } - - @Override - public UnaryCallable deleteSessionCallable() { - return deleteSessionCallable; - } - - @Override - public UnaryCallable reportSessionCallable() { - return reportSessionCallable; - } - - @Override - public UnaryCallable listTestsCallable() { - return listTestsCallable; - } - - @Override - public UnaryCallable listTestsPagedCallable() { - return listTestsPagedCallable; - } - - @Override - public UnaryCallable deleteTestCallable() { - return deleteTestCallable; - } - - @Override - public UnaryCallable verifyTestCallable() { - return verifyTestCallable; - } - - @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/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/IdentityStub.java b/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/IdentityStub.java deleted file mode 100644 index b09d5c635e..0000000000 --- a/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/IdentityStub.java +++ /dev/null @@ -1,70 +0,0 @@ -/* - * 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 - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1.stub; - -import static com.google.showcase.v1beta1.IdentityClient.ListUsersPagedResponse; - -import com.google.api.core.BetaApi; -import com.google.api.gax.core.BackgroundResource; -import com.google.api.gax.rpc.UnaryCallable; -import com.google.protobuf.Empty; -import com.google.showcase.v1beta1.CreateUserRequest; -import com.google.showcase.v1beta1.DeleteUserRequest; -import com.google.showcase.v1beta1.GetUserRequest; -import com.google.showcase.v1beta1.ListUsersRequest; -import com.google.showcase.v1beta1.ListUsersResponse; -import com.google.showcase.v1beta1.UpdateUserRequest; -import com.google.showcase.v1beta1.User; -import javax.annotation.Generated; - -// AUTO-GENERATED DOCUMENTATION AND CLASS. -/** - * Base stub class for the Identity service API. - * - *

        This class is for advanced usage and reflects the underlying API directly. - */ -@BetaApi -@Generated("by gapic-generator-java") -public abstract class IdentityStub implements BackgroundResource { - - public UnaryCallable createUserCallable() { - throw new UnsupportedOperationException("Not implemented: createUserCallable()"); - } - - public UnaryCallable getUserCallable() { - throw new UnsupportedOperationException("Not implemented: getUserCallable()"); - } - - public UnaryCallable updateUserCallable() { - throw new UnsupportedOperationException("Not implemented: updateUserCallable()"); - } - - public UnaryCallable deleteUserCallable() { - throw new UnsupportedOperationException("Not implemented: deleteUserCallable()"); - } - - public UnaryCallable listUsersPagedCallable() { - throw new UnsupportedOperationException("Not implemented: listUsersPagedCallable()"); - } - - public UnaryCallable listUsersCallable() { - throw new UnsupportedOperationException("Not implemented: listUsersCallable()"); - } - - @Override - public abstract void close(); -} diff --git a/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/IdentityStubSettings.java b/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/IdentityStubSettings.java deleted file mode 100644 index 92aaa1133d..0000000000 --- a/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/IdentityStubSettings.java +++ /dev/null @@ -1,491 +0,0 @@ -/* - * 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 - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1.stub; - -import static com.google.showcase.v1beta1.IdentityClient.ListUsersPagedResponse; - -import com.google.api.core.ApiFunction; -import com.google.api.core.ApiFuture; -import com.google.api.core.BetaApi; -import com.google.api.gax.core.GaxProperties; -import com.google.api.gax.core.GoogleCredentialsProvider; -import com.google.api.gax.core.InstantiatingExecutorProvider; -import com.google.api.gax.grpc.GaxGrpcProperties; -import com.google.api.gax.grpc.GrpcTransportChannel; -import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; -import com.google.api.gax.httpjson.GaxHttpJsonProperties; -import com.google.api.gax.httpjson.HttpJsonTransportChannel; -import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; -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.protobuf.Empty; -import com.google.showcase.v1beta1.CreateUserRequest; -import com.google.showcase.v1beta1.DeleteUserRequest; -import com.google.showcase.v1beta1.GetUserRequest; -import com.google.showcase.v1beta1.ListUsersRequest; -import com.google.showcase.v1beta1.ListUsersResponse; -import com.google.showcase.v1beta1.UpdateUserRequest; -import com.google.showcase.v1beta1.User; -import java.io.IOException; -import java.util.List; -import javax.annotation.Generated; -import org.threeten.bp.Duration; - -// AUTO-GENERATED DOCUMENTATION AND CLASS. -/** - * Settings class to configure an instance of {@link IdentityStub}. - * - *

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

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

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

        For example, to set the total timeout of createUser to 30 seconds: - * - *

        {@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
        - * IdentityStubSettings.Builder identitySettingsBuilder = IdentityStubSettings.newBuilder();
        - * identitySettingsBuilder
        - *     .createUserSettings()
        - *     .setRetrySettings(
        - *         identitySettingsBuilder
        - *             .createUserSettings()
        - *             .getRetrySettings()
        - *             .toBuilder()
        - *             .setTotalTimeout(Duration.ofSeconds(30))
        - *             .build());
        - * IdentityStubSettings identitySettings = identitySettingsBuilder.build();
        - * }
        - */ -@BetaApi -@Generated("by gapic-generator-java") -public class IdentityStubSettings extends StubSettings { - /** The default scopes of the service. */ - private static final ImmutableList DEFAULT_SERVICE_SCOPES = - ImmutableList.builder().build(); - - private final UnaryCallSettings createUserSettings; - private final UnaryCallSettings getUserSettings; - private final UnaryCallSettings updateUserSettings; - private final UnaryCallSettings deleteUserSettings; - private final PagedCallSettings - listUsersSettings; - - private static final PagedListDescriptor - LIST_USERS_PAGE_STR_DESC = - new PagedListDescriptor() { - @Override - public String emptyToken() { - return ""; - } - - @Override - public ListUsersRequest injectToken(ListUsersRequest payload, String token) { - return ListUsersRequest.newBuilder(payload).setPageToken(token).build(); - } - - @Override - public ListUsersRequest injectPageSize(ListUsersRequest payload, int pageSize) { - return ListUsersRequest.newBuilder(payload).setPageSize(pageSize).build(); - } - - @Override - public Integer extractPageSize(ListUsersRequest payload) { - return payload.getPageSize(); - } - - @Override - public String extractNextToken(ListUsersResponse payload) { - return payload.getNextPageToken(); - } - - @Override - public Iterable extractResources(ListUsersResponse payload) { - return payload.getUsersList() == null - ? ImmutableList.of() - : payload.getUsersList(); - } - }; - - private static final PagedListResponseFactory< - ListUsersRequest, ListUsersResponse, ListUsersPagedResponse> - LIST_USERS_PAGE_STR_FACT = - new PagedListResponseFactory< - ListUsersRequest, ListUsersResponse, ListUsersPagedResponse>() { - @Override - public ApiFuture getFuturePagedResponse( - UnaryCallable callable, - ListUsersRequest request, - ApiCallContext context, - ApiFuture futureResponse) { - PageContext pageContext = - PageContext.create(callable, LIST_USERS_PAGE_STR_DESC, request, context); - return ListUsersPagedResponse.createAsync(pageContext, futureResponse); - } - }; - - /** Returns the object with the settings used for calls to createUser. */ - public UnaryCallSettings createUserSettings() { - return createUserSettings; - } - - /** Returns the object with the settings used for calls to getUser. */ - public UnaryCallSettings getUserSettings() { - return getUserSettings; - } - - /** Returns the object with the settings used for calls to updateUser. */ - public UnaryCallSettings updateUserSettings() { - return updateUserSettings; - } - - /** Returns the object with the settings used for calls to deleteUser. */ - public UnaryCallSettings deleteUserSettings() { - return deleteUserSettings; - } - - /** Returns the object with the settings used for calls to listUsers. */ - public PagedCallSettings - listUsersSettings() { - return listUsersSettings; - } - - public IdentityStub createStub() throws IOException { - if (getTransportChannelProvider() - .getTransportName() - .equals(GrpcTransportChannel.getGrpcTransportName())) { - return GrpcIdentityStub.create(this); - } - if (getTransportChannelProvider() - .getTransportName() - .equals(HttpJsonTransportChannel.getHttpJsonTransportName())) { - return HttpJsonIdentityStub.create(this); - } - throw new UnsupportedOperationException( - String.format( - "Transport not supported: %s", getTransportChannelProvider().getTransportName())); - } - - /** Returns a builder for the default ExecutorProvider for this service. */ - public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { - return InstantiatingExecutorProvider.newBuilder(); - } - - /** Returns the default service endpoint. */ - public static String getDefaultEndpoint() { - return "localhost:7469"; - } - - /** Returns the default mTLS service endpoint. */ - public static String getDefaultMtlsEndpoint() { - return "localhost:7469"; - } - - /** 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 gRPC ChannelProvider for this service. */ - public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { - return InstantiatingGrpcChannelProvider.newBuilder() - .setMaxInboundMessageSize(Integer.MAX_VALUE); - } - - /** Returns a builder for the default REST ChannelProvider for this service. */ - @BetaApi - public static InstantiatingHttpJsonChannelProvider.Builder - defaultHttpJsonTransportProviderBuilder() { - return InstantiatingHttpJsonChannelProvider.newBuilder(); - } - - public static TransportChannelProvider defaultTransportChannelProvider() { - return defaultGrpcTransportProviderBuilder().build(); - } - - @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") - public static ApiClientHeaderProvider.Builder defaultGrpcApiClientHeaderProviderBuilder() { - return ApiClientHeaderProvider.newBuilder() - .setGeneratedLibToken("gapic", GaxProperties.getLibraryVersion(IdentityStubSettings.class)) - .setTransportToken( - GaxGrpcProperties.getGrpcTokenName(), GaxGrpcProperties.getGrpcVersion()); - } - - @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") - public static ApiClientHeaderProvider.Builder defaultHttpJsonApiClientHeaderProviderBuilder() { - return ApiClientHeaderProvider.newBuilder() - .setGeneratedLibToken("gapic", GaxProperties.getLibraryVersion(IdentityStubSettings.class)) - .setTransportToken( - GaxHttpJsonProperties.getHttpJsonTokenName(), - GaxHttpJsonProperties.getHttpJsonVersion()); - } - - public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { - return IdentityStubSettings.defaultGrpcApiClientHeaderProviderBuilder(); - } - - /** Returns a new gRPC builder for this class. */ - public static Builder newBuilder() { - return Builder.createDefault(); - } - - /** Returns a new REST builder for this class. */ - public static Builder newHttpJsonBuilder() { - return Builder.createHttpJsonDefault(); - } - - /** 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 IdentityStubSettings(Builder settingsBuilder) throws IOException { - super(settingsBuilder); - - createUserSettings = settingsBuilder.createUserSettings().build(); - getUserSettings = settingsBuilder.getUserSettings().build(); - updateUserSettings = settingsBuilder.updateUserSettings().build(); - deleteUserSettings = settingsBuilder.deleteUserSettings().build(); - listUsersSettings = settingsBuilder.listUsersSettings().build(); - } - - /** Builder for IdentityStubSettings. */ - public static class Builder extends StubSettings.Builder { - private final ImmutableList> unaryMethodSettingsBuilders; - private final UnaryCallSettings.Builder createUserSettings; - private final UnaryCallSettings.Builder getUserSettings; - private final UnaryCallSettings.Builder updateUserSettings; - private final UnaryCallSettings.Builder deleteUserSettings; - private final PagedCallSettings.Builder< - ListUsersRequest, ListUsersResponse, ListUsersPagedResponse> - listUsersSettings; - 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_2_codes", - ImmutableSet.copyOf( - Lists.newArrayList( - StatusCode.Code.UNAVAILABLE, StatusCode.Code.UNKNOWN))); - 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() - .setInitialRetryDelay(Duration.ofMillis(200L)) - .setRetryDelayMultiplier(2.0) - .setMaxRetryDelay(Duration.ofMillis(3000L)) - .setInitialRpcTimeout(Duration.ofMillis(5000L)) - .setRpcTimeoutMultiplier(1.0) - .setMaxRpcTimeout(Duration.ofMillis(5000L)) - .setTotalTimeout(Duration.ofMillis(5000L)) - .build(); - definitions.put("retry_policy_2_params", settings); - RETRY_PARAM_DEFINITIONS = definitions.build(); - } - - protected Builder() { - this(((ClientContext) null)); - } - - protected Builder(ClientContext clientContext) { - super(clientContext); - - createUserSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); - getUserSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); - updateUserSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); - deleteUserSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); - listUsersSettings = PagedCallSettings.newBuilder(LIST_USERS_PAGE_STR_FACT); - - unaryMethodSettingsBuilders = - ImmutableList.>of( - createUserSettings, - getUserSettings, - updateUserSettings, - deleteUserSettings, - listUsersSettings); - initDefaults(this); - } - - protected Builder(IdentityStubSettings settings) { - super(settings); - - createUserSettings = settings.createUserSettings.toBuilder(); - getUserSettings = settings.getUserSettings.toBuilder(); - updateUserSettings = settings.updateUserSettings.toBuilder(); - deleteUserSettings = settings.deleteUserSettings.toBuilder(); - listUsersSettings = settings.listUsersSettings.toBuilder(); - - unaryMethodSettingsBuilders = - ImmutableList.>of( - createUserSettings, - getUserSettings, - updateUserSettings, - deleteUserSettings, - listUsersSettings); - } - - private static Builder createDefault() { - Builder builder = new Builder(((ClientContext) null)); - - builder.setTransportChannelProvider(defaultTransportChannelProvider()); - builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); - builder.setInternalHeaderProvider(defaultApiClientHeaderProviderBuilder().build()); - builder.setEndpoint(getDefaultEndpoint()); - builder.setMtlsEndpoint(getDefaultMtlsEndpoint()); - builder.setSwitchToMtlsEndpointAllowed(true); - - return initDefaults(builder); - } - - private static Builder createHttpJsonDefault() { - Builder builder = new Builder(((ClientContext) null)); - - builder.setTransportChannelProvider(defaultHttpJsonTransportProviderBuilder().build()); - builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); - builder.setInternalHeaderProvider(defaultHttpJsonApiClientHeaderProviderBuilder().build()); - builder.setEndpoint(getDefaultEndpoint()); - builder.setMtlsEndpoint(getDefaultMtlsEndpoint()); - builder.setSwitchToMtlsEndpointAllowed(true); - - return initDefaults(builder); - } - - private static Builder initDefaults(Builder builder) { - builder - .createUserSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); - - builder - .getUserSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_2_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_2_params")); - - builder - .updateUserSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); - - builder - .deleteUserSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); - - builder - .listUsersSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_2_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_2_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 createUser. */ - public UnaryCallSettings.Builder createUserSettings() { - return createUserSettings; - } - - /** Returns the builder for the settings used for calls to getUser. */ - public UnaryCallSettings.Builder getUserSettings() { - return getUserSettings; - } - - /** Returns the builder for the settings used for calls to updateUser. */ - public UnaryCallSettings.Builder updateUserSettings() { - return updateUserSettings; - } - - /** Returns the builder for the settings used for calls to deleteUser. */ - public UnaryCallSettings.Builder deleteUserSettings() { - return deleteUserSettings; - } - - /** Returns the builder for the settings used for calls to listUsers. */ - public PagedCallSettings.Builder - listUsersSettings() { - return listUsersSettings; - } - - @Override - public IdentityStubSettings build() throws IOException { - return new IdentityStubSettings(this); - } - } -} diff --git a/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/MessagingStub.java b/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/MessagingStub.java deleted file mode 100644 index 50372c599b..0000000000 --- a/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/MessagingStub.java +++ /dev/null @@ -1,144 +0,0 @@ -/* - * 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 - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1.stub; - -import static com.google.showcase.v1beta1.MessagingClient.ListBlurbsPagedResponse; -import static com.google.showcase.v1beta1.MessagingClient.ListRoomsPagedResponse; - -import com.google.api.core.BetaApi; -import com.google.api.gax.core.BackgroundResource; -import com.google.api.gax.rpc.BidiStreamingCallable; -import com.google.api.gax.rpc.ClientStreamingCallable; -import com.google.api.gax.rpc.OperationCallable; -import com.google.api.gax.rpc.ServerStreamingCallable; -import com.google.api.gax.rpc.UnaryCallable; -import com.google.longrunning.Operation; -import com.google.longrunning.stub.OperationsStub; -import com.google.protobuf.Empty; -import com.google.showcase.v1beta1.Blurb; -import com.google.showcase.v1beta1.ConnectRequest; -import com.google.showcase.v1beta1.CreateBlurbRequest; -import com.google.showcase.v1beta1.CreateRoomRequest; -import com.google.showcase.v1beta1.DeleteBlurbRequest; -import com.google.showcase.v1beta1.DeleteRoomRequest; -import com.google.showcase.v1beta1.GetBlurbRequest; -import com.google.showcase.v1beta1.GetRoomRequest; -import com.google.showcase.v1beta1.ListBlurbsRequest; -import com.google.showcase.v1beta1.ListBlurbsResponse; -import com.google.showcase.v1beta1.ListRoomsRequest; -import com.google.showcase.v1beta1.ListRoomsResponse; -import com.google.showcase.v1beta1.Room; -import com.google.showcase.v1beta1.SearchBlurbsMetadata; -import com.google.showcase.v1beta1.SearchBlurbsRequest; -import com.google.showcase.v1beta1.SearchBlurbsResponse; -import com.google.showcase.v1beta1.SendBlurbsResponse; -import com.google.showcase.v1beta1.StreamBlurbsRequest; -import com.google.showcase.v1beta1.StreamBlurbsResponse; -import com.google.showcase.v1beta1.UpdateBlurbRequest; -import com.google.showcase.v1beta1.UpdateRoomRequest; -import javax.annotation.Generated; - -// AUTO-GENERATED DOCUMENTATION AND CLASS. -/** - * Base stub class for the Messaging service API. - * - *

        This class is for advanced usage and reflects the underlying API directly. - */ -@BetaApi -@Generated("by gapic-generator-java") -public abstract class MessagingStub implements BackgroundResource { - - public OperationsStub getOperationsStub() { - return null; - } - - public com.google.api.gax.httpjson.longrunning.stub.OperationsStub getHttpJsonOperationsStub() { - return null; - } - - public UnaryCallable createRoomCallable() { - throw new UnsupportedOperationException("Not implemented: createRoomCallable()"); - } - - public UnaryCallable getRoomCallable() { - throw new UnsupportedOperationException("Not implemented: getRoomCallable()"); - } - - public UnaryCallable updateRoomCallable() { - throw new UnsupportedOperationException("Not implemented: updateRoomCallable()"); - } - - public UnaryCallable deleteRoomCallable() { - throw new UnsupportedOperationException("Not implemented: deleteRoomCallable()"); - } - - public UnaryCallable listRoomsPagedCallable() { - throw new UnsupportedOperationException("Not implemented: listRoomsPagedCallable()"); - } - - public UnaryCallable listRoomsCallable() { - throw new UnsupportedOperationException("Not implemented: listRoomsCallable()"); - } - - public UnaryCallable createBlurbCallable() { - throw new UnsupportedOperationException("Not implemented: createBlurbCallable()"); - } - - public UnaryCallable getBlurbCallable() { - throw new UnsupportedOperationException("Not implemented: getBlurbCallable()"); - } - - public UnaryCallable updateBlurbCallable() { - throw new UnsupportedOperationException("Not implemented: updateBlurbCallable()"); - } - - public UnaryCallable deleteBlurbCallable() { - throw new UnsupportedOperationException("Not implemented: deleteBlurbCallable()"); - } - - public UnaryCallable listBlurbsPagedCallable() { - throw new UnsupportedOperationException("Not implemented: listBlurbsPagedCallable()"); - } - - public UnaryCallable listBlurbsCallable() { - throw new UnsupportedOperationException("Not implemented: listBlurbsCallable()"); - } - - public OperationCallable - searchBlurbsOperationCallable() { - throw new UnsupportedOperationException("Not implemented: searchBlurbsOperationCallable()"); - } - - public UnaryCallable searchBlurbsCallable() { - throw new UnsupportedOperationException("Not implemented: searchBlurbsCallable()"); - } - - public ServerStreamingCallable streamBlurbsCallable() { - throw new UnsupportedOperationException("Not implemented: streamBlurbsCallable()"); - } - - public ClientStreamingCallable sendBlurbsCallable() { - throw new UnsupportedOperationException("Not implemented: sendBlurbsCallable()"); - } - - public BidiStreamingCallable connectCallable() { - throw new UnsupportedOperationException("Not implemented: connectCallable()"); - } - - @Override - public abstract void close(); -} diff --git a/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/MessagingStubSettings.java b/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/MessagingStubSettings.java deleted file mode 100644 index 326883942f..0000000000 --- a/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/MessagingStubSettings.java +++ /dev/null @@ -1,815 +0,0 @@ -/* - * 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 - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1.stub; - -import static com.google.showcase.v1beta1.MessagingClient.ListBlurbsPagedResponse; -import static com.google.showcase.v1beta1.MessagingClient.ListRoomsPagedResponse; - -import com.google.api.core.ApiFunction; -import com.google.api.core.ApiFuture; -import com.google.api.core.BetaApi; -import com.google.api.gax.core.GaxProperties; -import com.google.api.gax.core.GoogleCredentialsProvider; -import com.google.api.gax.core.InstantiatingExecutorProvider; -import com.google.api.gax.grpc.GaxGrpcProperties; -import com.google.api.gax.grpc.GrpcTransportChannel; -import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; -import com.google.api.gax.grpc.ProtoOperationTransformers; -import com.google.api.gax.httpjson.GaxHttpJsonProperties; -import com.google.api.gax.httpjson.HttpJsonTransportChannel; -import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; -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.ServerStreamingCallSettings; -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.longrunning.Operation; -import com.google.protobuf.Empty; -import com.google.showcase.v1beta1.Blurb; -import com.google.showcase.v1beta1.ConnectRequest; -import com.google.showcase.v1beta1.CreateBlurbRequest; -import com.google.showcase.v1beta1.CreateRoomRequest; -import com.google.showcase.v1beta1.DeleteBlurbRequest; -import com.google.showcase.v1beta1.DeleteRoomRequest; -import com.google.showcase.v1beta1.GetBlurbRequest; -import com.google.showcase.v1beta1.GetRoomRequest; -import com.google.showcase.v1beta1.ListBlurbsRequest; -import com.google.showcase.v1beta1.ListBlurbsResponse; -import com.google.showcase.v1beta1.ListRoomsRequest; -import com.google.showcase.v1beta1.ListRoomsResponse; -import com.google.showcase.v1beta1.Room; -import com.google.showcase.v1beta1.SearchBlurbsMetadata; -import com.google.showcase.v1beta1.SearchBlurbsRequest; -import com.google.showcase.v1beta1.SearchBlurbsResponse; -import com.google.showcase.v1beta1.SendBlurbsResponse; -import com.google.showcase.v1beta1.StreamBlurbsRequest; -import com.google.showcase.v1beta1.StreamBlurbsResponse; -import com.google.showcase.v1beta1.UpdateBlurbRequest; -import com.google.showcase.v1beta1.UpdateRoomRequest; -import java.io.IOException; -import java.util.List; -import javax.annotation.Generated; -import org.threeten.bp.Duration; - -// AUTO-GENERATED DOCUMENTATION AND CLASS. -/** - * Settings class to configure an instance of {@link MessagingStub}. - * - *

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

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

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

        For example, to set the total timeout of createRoom to 30 seconds: - * - *

        {@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
        - * MessagingStubSettings.Builder messagingSettingsBuilder = MessagingStubSettings.newBuilder();
        - * messagingSettingsBuilder
        - *     .createRoomSettings()
        - *     .setRetrySettings(
        - *         messagingSettingsBuilder
        - *             .createRoomSettings()
        - *             .getRetrySettings()
        - *             .toBuilder()
        - *             .setTotalTimeout(Duration.ofSeconds(30))
        - *             .build());
        - * MessagingStubSettings messagingSettings = messagingSettingsBuilder.build();
        - * }
        - */ -@BetaApi -@Generated("by gapic-generator-java") -public class MessagingStubSettings extends StubSettings { - /** The default scopes of the service. */ - private static final ImmutableList DEFAULT_SERVICE_SCOPES = - ImmutableList.builder().build(); - - private final UnaryCallSettings createRoomSettings; - private final UnaryCallSettings getRoomSettings; - private final UnaryCallSettings updateRoomSettings; - private final UnaryCallSettings deleteRoomSettings; - private final PagedCallSettings - listRoomsSettings; - private final UnaryCallSettings createBlurbSettings; - private final UnaryCallSettings getBlurbSettings; - private final UnaryCallSettings updateBlurbSettings; - private final UnaryCallSettings deleteBlurbSettings; - private final PagedCallSettings - listBlurbsSettings; - private final UnaryCallSettings searchBlurbsSettings; - private final OperationCallSettings< - SearchBlurbsRequest, SearchBlurbsResponse, SearchBlurbsMetadata> - searchBlurbsOperationSettings; - private final ServerStreamingCallSettings - streamBlurbsSettings; - private final StreamingCallSettings sendBlurbsSettings; - private final StreamingCallSettings connectSettings; - - private static final PagedListDescriptor - LIST_ROOMS_PAGE_STR_DESC = - new PagedListDescriptor() { - @Override - public String emptyToken() { - return ""; - } - - @Override - public ListRoomsRequest injectToken(ListRoomsRequest payload, String token) { - return ListRoomsRequest.newBuilder(payload).setPageToken(token).build(); - } - - @Override - public ListRoomsRequest injectPageSize(ListRoomsRequest payload, int pageSize) { - return ListRoomsRequest.newBuilder(payload).setPageSize(pageSize).build(); - } - - @Override - public Integer extractPageSize(ListRoomsRequest payload) { - return payload.getPageSize(); - } - - @Override - public String extractNextToken(ListRoomsResponse payload) { - return payload.getNextPageToken(); - } - - @Override - public Iterable extractResources(ListRoomsResponse payload) { - return payload.getRoomsList() == null - ? ImmutableList.of() - : payload.getRoomsList(); - } - }; - - private static final PagedListDescriptor - LIST_BLURBS_PAGE_STR_DESC = - new PagedListDescriptor() { - @Override - public String emptyToken() { - return ""; - } - - @Override - public ListBlurbsRequest injectToken(ListBlurbsRequest payload, String token) { - return ListBlurbsRequest.newBuilder(payload).setPageToken(token).build(); - } - - @Override - public ListBlurbsRequest injectPageSize(ListBlurbsRequest payload, int pageSize) { - return ListBlurbsRequest.newBuilder(payload).setPageSize(pageSize).build(); - } - - @Override - public Integer extractPageSize(ListBlurbsRequest payload) { - return payload.getPageSize(); - } - - @Override - public String extractNextToken(ListBlurbsResponse payload) { - return payload.getNextPageToken(); - } - - @Override - public Iterable extractResources(ListBlurbsResponse payload) { - return payload.getBlurbsList() == null - ? ImmutableList.of() - : payload.getBlurbsList(); - } - }; - - private static final PagedListResponseFactory< - ListRoomsRequest, ListRoomsResponse, ListRoomsPagedResponse> - LIST_ROOMS_PAGE_STR_FACT = - new PagedListResponseFactory< - ListRoomsRequest, ListRoomsResponse, ListRoomsPagedResponse>() { - @Override - public ApiFuture getFuturePagedResponse( - UnaryCallable callable, - ListRoomsRequest request, - ApiCallContext context, - ApiFuture futureResponse) { - PageContext pageContext = - PageContext.create(callable, LIST_ROOMS_PAGE_STR_DESC, request, context); - return ListRoomsPagedResponse.createAsync(pageContext, futureResponse); - } - }; - - private static final PagedListResponseFactory< - ListBlurbsRequest, ListBlurbsResponse, ListBlurbsPagedResponse> - LIST_BLURBS_PAGE_STR_FACT = - new PagedListResponseFactory< - ListBlurbsRequest, ListBlurbsResponse, ListBlurbsPagedResponse>() { - @Override - public ApiFuture getFuturePagedResponse( - UnaryCallable callable, - ListBlurbsRequest request, - ApiCallContext context, - ApiFuture futureResponse) { - PageContext pageContext = - PageContext.create(callable, LIST_BLURBS_PAGE_STR_DESC, request, context); - return ListBlurbsPagedResponse.createAsync(pageContext, futureResponse); - } - }; - - /** Returns the object with the settings used for calls to createRoom. */ - public UnaryCallSettings createRoomSettings() { - return createRoomSettings; - } - - /** Returns the object with the settings used for calls to getRoom. */ - public UnaryCallSettings getRoomSettings() { - return getRoomSettings; - } - - /** Returns the object with the settings used for calls to updateRoom. */ - public UnaryCallSettings updateRoomSettings() { - return updateRoomSettings; - } - - /** Returns the object with the settings used for calls to deleteRoom. */ - public UnaryCallSettings deleteRoomSettings() { - return deleteRoomSettings; - } - - /** Returns the object with the settings used for calls to listRooms. */ - public PagedCallSettings - listRoomsSettings() { - return listRoomsSettings; - } - - /** Returns the object with the settings used for calls to createBlurb. */ - public UnaryCallSettings createBlurbSettings() { - return createBlurbSettings; - } - - /** Returns the object with the settings used for calls to getBlurb. */ - public UnaryCallSettings getBlurbSettings() { - return getBlurbSettings; - } - - /** Returns the object with the settings used for calls to updateBlurb. */ - public UnaryCallSettings updateBlurbSettings() { - return updateBlurbSettings; - } - - /** Returns the object with the settings used for calls to deleteBlurb. */ - public UnaryCallSettings deleteBlurbSettings() { - return deleteBlurbSettings; - } - - /** Returns the object with the settings used for calls to listBlurbs. */ - public PagedCallSettings - listBlurbsSettings() { - return listBlurbsSettings; - } - - /** Returns the object with the settings used for calls to searchBlurbs. */ - public UnaryCallSettings searchBlurbsSettings() { - return searchBlurbsSettings; - } - - /** Returns the object with the settings used for calls to searchBlurbs. */ - public OperationCallSettings - searchBlurbsOperationSettings() { - return searchBlurbsOperationSettings; - } - - /** Returns the object with the settings used for calls to streamBlurbs. */ - public ServerStreamingCallSettings - streamBlurbsSettings() { - return streamBlurbsSettings; - } - - /** Returns the object with the settings used for calls to sendBlurbs. */ - public StreamingCallSettings sendBlurbsSettings() { - return sendBlurbsSettings; - } - - /** Returns the object with the settings used for calls to connect. */ - public StreamingCallSettings connectSettings() { - return connectSettings; - } - - public MessagingStub createStub() throws IOException { - if (getTransportChannelProvider() - .getTransportName() - .equals(GrpcTransportChannel.getGrpcTransportName())) { - return GrpcMessagingStub.create(this); - } - if (getTransportChannelProvider() - .getTransportName() - .equals(HttpJsonTransportChannel.getHttpJsonTransportName())) { - return HttpJsonMessagingStub.create(this); - } - throw new UnsupportedOperationException( - String.format( - "Transport not supported: %s", getTransportChannelProvider().getTransportName())); - } - - /** Returns a builder for the default ExecutorProvider for this service. */ - public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { - return InstantiatingExecutorProvider.newBuilder(); - } - - /** Returns the default service endpoint. */ - public static String getDefaultEndpoint() { - return "localhost:7469"; - } - - /** Returns the default mTLS service endpoint. */ - public static String getDefaultMtlsEndpoint() { - return "localhost:7469"; - } - - /** 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 gRPC ChannelProvider for this service. */ - public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { - return InstantiatingGrpcChannelProvider.newBuilder() - .setMaxInboundMessageSize(Integer.MAX_VALUE); - } - - /** Returns a builder for the default REST ChannelProvider for this service. */ - @BetaApi - public static InstantiatingHttpJsonChannelProvider.Builder - defaultHttpJsonTransportProviderBuilder() { - return InstantiatingHttpJsonChannelProvider.newBuilder(); - } - - public static TransportChannelProvider defaultTransportChannelProvider() { - return defaultGrpcTransportProviderBuilder().build(); - } - - @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") - public static ApiClientHeaderProvider.Builder defaultGrpcApiClientHeaderProviderBuilder() { - return ApiClientHeaderProvider.newBuilder() - .setGeneratedLibToken("gapic", GaxProperties.getLibraryVersion(MessagingStubSettings.class)) - .setTransportToken( - GaxGrpcProperties.getGrpcTokenName(), GaxGrpcProperties.getGrpcVersion()); - } - - @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") - public static ApiClientHeaderProvider.Builder defaultHttpJsonApiClientHeaderProviderBuilder() { - return ApiClientHeaderProvider.newBuilder() - .setGeneratedLibToken("gapic", GaxProperties.getLibraryVersion(MessagingStubSettings.class)) - .setTransportToken( - GaxHttpJsonProperties.getHttpJsonTokenName(), - GaxHttpJsonProperties.getHttpJsonVersion()); - } - - public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { - return MessagingStubSettings.defaultGrpcApiClientHeaderProviderBuilder(); - } - - /** Returns a new gRPC builder for this class. */ - public static Builder newBuilder() { - return Builder.createDefault(); - } - - /** Returns a new REST builder for this class. */ - public static Builder newHttpJsonBuilder() { - return Builder.createHttpJsonDefault(); - } - - /** 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 MessagingStubSettings(Builder settingsBuilder) throws IOException { - super(settingsBuilder); - - createRoomSettings = settingsBuilder.createRoomSettings().build(); - getRoomSettings = settingsBuilder.getRoomSettings().build(); - updateRoomSettings = settingsBuilder.updateRoomSettings().build(); - deleteRoomSettings = settingsBuilder.deleteRoomSettings().build(); - listRoomsSettings = settingsBuilder.listRoomsSettings().build(); - createBlurbSettings = settingsBuilder.createBlurbSettings().build(); - getBlurbSettings = settingsBuilder.getBlurbSettings().build(); - updateBlurbSettings = settingsBuilder.updateBlurbSettings().build(); - deleteBlurbSettings = settingsBuilder.deleteBlurbSettings().build(); - listBlurbsSettings = settingsBuilder.listBlurbsSettings().build(); - searchBlurbsSettings = settingsBuilder.searchBlurbsSettings().build(); - searchBlurbsOperationSettings = settingsBuilder.searchBlurbsOperationSettings().build(); - streamBlurbsSettings = settingsBuilder.streamBlurbsSettings().build(); - sendBlurbsSettings = settingsBuilder.sendBlurbsSettings().build(); - connectSettings = settingsBuilder.connectSettings().build(); - } - - /** Builder for MessagingStubSettings. */ - public static class Builder extends StubSettings.Builder { - private final ImmutableList> unaryMethodSettingsBuilders; - private final UnaryCallSettings.Builder createRoomSettings; - private final UnaryCallSettings.Builder getRoomSettings; - private final UnaryCallSettings.Builder updateRoomSettings; - private final UnaryCallSettings.Builder deleteRoomSettings; - private final PagedCallSettings.Builder< - ListRoomsRequest, ListRoomsResponse, ListRoomsPagedResponse> - listRoomsSettings; - private final UnaryCallSettings.Builder createBlurbSettings; - private final UnaryCallSettings.Builder getBlurbSettings; - private final UnaryCallSettings.Builder updateBlurbSettings; - private final UnaryCallSettings.Builder deleteBlurbSettings; - private final PagedCallSettings.Builder< - ListBlurbsRequest, ListBlurbsResponse, ListBlurbsPagedResponse> - listBlurbsSettings; - private final UnaryCallSettings.Builder searchBlurbsSettings; - private final OperationCallSettings.Builder< - SearchBlurbsRequest, SearchBlurbsResponse, SearchBlurbsMetadata> - searchBlurbsOperationSettings; - private final ServerStreamingCallSettings.Builder - streamBlurbsSettings; - private final StreamingCallSettings.Builder - sendBlurbsSettings; - private final StreamingCallSettings.Builder - connectSettings; - private static final ImmutableMap> - RETRYABLE_CODE_DEFINITIONS; - - static { - ImmutableMap.Builder> definitions = - ImmutableMap.builder(); - definitions.put( - "no_retry_0_codes", ImmutableSet.copyOf(Lists.newArrayList())); - definitions.put( - "retry_policy_1_codes", - ImmutableSet.copyOf( - Lists.newArrayList( - StatusCode.Code.UNAVAILABLE, StatusCode.Code.UNKNOWN))); - RETRYABLE_CODE_DEFINITIONS = definitions.build(); - } - - private static final ImmutableMap RETRY_PARAM_DEFINITIONS; - - static { - ImmutableMap.Builder definitions = ImmutableMap.builder(); - RetrySettings settings = null; - settings = - RetrySettings.newBuilder() - .setInitialRpcTimeout(Duration.ofMillis(5000L)) - .setRpcTimeoutMultiplier(1.0) - .setMaxRpcTimeout(Duration.ofMillis(5000L)) - .setTotalTimeout(Duration.ofMillis(5000L)) - .build(); - definitions.put("no_retry_0_params", settings); - settings = - RetrySettings.newBuilder() - .setInitialRetryDelay(Duration.ofMillis(100L)) - .setRetryDelayMultiplier(2.0) - .setMaxRetryDelay(Duration.ofMillis(3000L)) - .setInitialRpcTimeout(Duration.ofMillis(10000L)) - .setRpcTimeoutMultiplier(1.0) - .setMaxRpcTimeout(Duration.ofMillis(10000L)) - .setTotalTimeout(Duration.ofMillis(10000L)) - .build(); - definitions.put("retry_policy_1_params", settings); - RETRY_PARAM_DEFINITIONS = definitions.build(); - } - - protected Builder() { - this(((ClientContext) null)); - } - - protected Builder(ClientContext clientContext) { - super(clientContext); - - createRoomSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); - getRoomSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); - updateRoomSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); - deleteRoomSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); - listRoomsSettings = PagedCallSettings.newBuilder(LIST_ROOMS_PAGE_STR_FACT); - createBlurbSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); - getBlurbSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); - updateBlurbSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); - deleteBlurbSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); - listBlurbsSettings = PagedCallSettings.newBuilder(LIST_BLURBS_PAGE_STR_FACT); - searchBlurbsSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); - searchBlurbsOperationSettings = OperationCallSettings.newBuilder(); - streamBlurbsSettings = ServerStreamingCallSettings.newBuilder(); - sendBlurbsSettings = StreamingCallSettings.newBuilder(); - connectSettings = StreamingCallSettings.newBuilder(); - - unaryMethodSettingsBuilders = - ImmutableList.>of( - createRoomSettings, - getRoomSettings, - updateRoomSettings, - deleteRoomSettings, - listRoomsSettings, - createBlurbSettings, - getBlurbSettings, - updateBlurbSettings, - deleteBlurbSettings, - listBlurbsSettings, - searchBlurbsSettings); - initDefaults(this); - } - - protected Builder(MessagingStubSettings settings) { - super(settings); - - createRoomSettings = settings.createRoomSettings.toBuilder(); - getRoomSettings = settings.getRoomSettings.toBuilder(); - updateRoomSettings = settings.updateRoomSettings.toBuilder(); - deleteRoomSettings = settings.deleteRoomSettings.toBuilder(); - listRoomsSettings = settings.listRoomsSettings.toBuilder(); - createBlurbSettings = settings.createBlurbSettings.toBuilder(); - getBlurbSettings = settings.getBlurbSettings.toBuilder(); - updateBlurbSettings = settings.updateBlurbSettings.toBuilder(); - deleteBlurbSettings = settings.deleteBlurbSettings.toBuilder(); - listBlurbsSettings = settings.listBlurbsSettings.toBuilder(); - searchBlurbsSettings = settings.searchBlurbsSettings.toBuilder(); - searchBlurbsOperationSettings = settings.searchBlurbsOperationSettings.toBuilder(); - streamBlurbsSettings = settings.streamBlurbsSettings.toBuilder(); - sendBlurbsSettings = settings.sendBlurbsSettings.toBuilder(); - connectSettings = settings.connectSettings.toBuilder(); - - unaryMethodSettingsBuilders = - ImmutableList.>of( - createRoomSettings, - getRoomSettings, - updateRoomSettings, - deleteRoomSettings, - listRoomsSettings, - createBlurbSettings, - getBlurbSettings, - updateBlurbSettings, - deleteBlurbSettings, - listBlurbsSettings, - searchBlurbsSettings); - } - - private static Builder createDefault() { - Builder builder = new Builder(((ClientContext) null)); - - builder.setTransportChannelProvider(defaultTransportChannelProvider()); - builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); - builder.setInternalHeaderProvider(defaultApiClientHeaderProviderBuilder().build()); - builder.setEndpoint(getDefaultEndpoint()); - builder.setMtlsEndpoint(getDefaultMtlsEndpoint()); - builder.setSwitchToMtlsEndpointAllowed(true); - - return initDefaults(builder); - } - - private static Builder createHttpJsonDefault() { - Builder builder = new Builder(((ClientContext) null)); - - builder.setTransportChannelProvider(defaultHttpJsonTransportProviderBuilder().build()); - builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); - builder.setInternalHeaderProvider(defaultHttpJsonApiClientHeaderProviderBuilder().build()); - builder.setEndpoint(getDefaultEndpoint()); - builder.setMtlsEndpoint(getDefaultMtlsEndpoint()); - builder.setSwitchToMtlsEndpointAllowed(true); - - return initDefaults(builder); - } - - private static Builder initDefaults(Builder builder) { - builder - .createRoomSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); - - builder - .getRoomSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")); - - builder - .updateRoomSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); - - builder - .deleteRoomSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); - - builder - .listRoomsSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")); - - builder - .createBlurbSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); - - builder - .getBlurbSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")); - - builder - .updateBlurbSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); - - builder - .deleteBlurbSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); - - builder - .listBlurbsSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")); - - builder - .searchBlurbsSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")); - - builder - .streamBlurbsSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); - - builder - .searchBlurbsOperationSettings() - .setInitialCallSettings( - UnaryCallSettings - .newUnaryCallSettingsBuilder() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")) - .build()) - .setResponseTransformer( - ProtoOperationTransformers.ResponseTransformer.create(SearchBlurbsResponse.class)) - .setMetadataTransformer( - ProtoOperationTransformers.MetadataTransformer.create(SearchBlurbsMetadata.class)) - .setPollingAlgorithm( - OperationTimedPollAlgorithm.create( - RetrySettings.newBuilder() - .setInitialRetryDelay(Duration.ofMillis(5000L)) - .setRetryDelayMultiplier(1.5) - .setMaxRetryDelay(Duration.ofMillis(45000L)) - .setInitialRpcTimeout(Duration.ZERO) - .setRpcTimeoutMultiplier(1.0) - .setMaxRpcTimeout(Duration.ZERO) - .setTotalTimeout(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 createRoom. */ - public UnaryCallSettings.Builder createRoomSettings() { - return createRoomSettings; - } - - /** Returns the builder for the settings used for calls to getRoom. */ - public UnaryCallSettings.Builder getRoomSettings() { - return getRoomSettings; - } - - /** Returns the builder for the settings used for calls to updateRoom. */ - public UnaryCallSettings.Builder updateRoomSettings() { - return updateRoomSettings; - } - - /** Returns the builder for the settings used for calls to deleteRoom. */ - public UnaryCallSettings.Builder deleteRoomSettings() { - return deleteRoomSettings; - } - - /** Returns the builder for the settings used for calls to listRooms. */ - public PagedCallSettings.Builder - listRoomsSettings() { - return listRoomsSettings; - } - - /** Returns the builder for the settings used for calls to createBlurb. */ - public UnaryCallSettings.Builder createBlurbSettings() { - return createBlurbSettings; - } - - /** Returns the builder for the settings used for calls to getBlurb. */ - public UnaryCallSettings.Builder getBlurbSettings() { - return getBlurbSettings; - } - - /** Returns the builder for the settings used for calls to updateBlurb. */ - public UnaryCallSettings.Builder updateBlurbSettings() { - return updateBlurbSettings; - } - - /** Returns the builder for the settings used for calls to deleteBlurb. */ - public UnaryCallSettings.Builder deleteBlurbSettings() { - return deleteBlurbSettings; - } - - /** Returns the builder for the settings used for calls to listBlurbs. */ - public PagedCallSettings.Builder - listBlurbsSettings() { - return listBlurbsSettings; - } - - /** Returns the builder for the settings used for calls to searchBlurbs. */ - public UnaryCallSettings.Builder searchBlurbsSettings() { - return searchBlurbsSettings; - } - - /** Returns the builder for the settings used for calls to searchBlurbs. */ - @BetaApi( - "The surface for use by generated code is not stable yet and may change in the future.") - public OperationCallSettings.Builder< - SearchBlurbsRequest, SearchBlurbsResponse, SearchBlurbsMetadata> - searchBlurbsOperationSettings() { - return searchBlurbsOperationSettings; - } - - /** Returns the builder for the settings used for calls to streamBlurbs. */ - public ServerStreamingCallSettings.Builder - streamBlurbsSettings() { - return streamBlurbsSettings; - } - - /** Returns the builder for the settings used for calls to sendBlurbs. */ - public StreamingCallSettings.Builder - sendBlurbsSettings() { - return sendBlurbsSettings; - } - - /** Returns the builder for the settings used for calls to connect. */ - public StreamingCallSettings.Builder connectSettings() { - return connectSettings; - } - - @Override - public MessagingStubSettings build() throws IOException { - return new MessagingStubSettings(this); - } - } -} diff --git a/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/SequenceServiceStub.java b/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/SequenceServiceStub.java deleted file mode 100644 index 7b2f12a463..0000000000 --- a/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/SequenceServiceStub.java +++ /dev/null @@ -1,54 +0,0 @@ -/* - * 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 - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1.stub; - -import com.google.api.core.BetaApi; -import com.google.api.gax.core.BackgroundResource; -import com.google.api.gax.rpc.UnaryCallable; -import com.google.protobuf.Empty; -import com.google.showcase.v1beta1.AttemptSequenceRequest; -import com.google.showcase.v1beta1.CreateSequenceRequest; -import com.google.showcase.v1beta1.GetSequenceReportRequest; -import com.google.showcase.v1beta1.Sequence; -import com.google.showcase.v1beta1.SequenceReport; -import javax.annotation.Generated; - -// AUTO-GENERATED DOCUMENTATION AND CLASS. -/** - * Base stub class for the SequenceService service API. - * - *

        This class is for advanced usage and reflects the underlying API directly. - */ -@BetaApi -@Generated("by gapic-generator-java") -public abstract class SequenceServiceStub implements BackgroundResource { - - public UnaryCallable createSequenceCallable() { - throw new UnsupportedOperationException("Not implemented: createSequenceCallable()"); - } - - public UnaryCallable getSequenceReportCallable() { - throw new UnsupportedOperationException("Not implemented: getSequenceReportCallable()"); - } - - public UnaryCallable attemptSequenceCallable() { - throw new UnsupportedOperationException("Not implemented: attemptSequenceCallable()"); - } - - @Override - public abstract void close(); -} diff --git a/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/SequenceServiceStubSettings.java b/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/SequenceServiceStubSettings.java deleted file mode 100644 index 8a4e8b0151..0000000000 --- a/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/SequenceServiceStubSettings.java +++ /dev/null @@ -1,387 +0,0 @@ -/* - * 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 - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1.stub; - -import com.google.api.core.ApiFunction; -import com.google.api.core.BetaApi; -import com.google.api.gax.core.GaxProperties; -import com.google.api.gax.core.GoogleCredentialsProvider; -import com.google.api.gax.core.InstantiatingExecutorProvider; -import com.google.api.gax.grpc.GaxGrpcProperties; -import com.google.api.gax.grpc.GrpcTransportChannel; -import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; -import com.google.api.gax.httpjson.GaxHttpJsonProperties; -import com.google.api.gax.httpjson.HttpJsonTransportChannel; -import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; -import com.google.api.gax.retrying.RetrySettings; -import com.google.api.gax.rpc.ApiClientHeaderProvider; -import com.google.api.gax.rpc.ClientContext; -import com.google.api.gax.rpc.StatusCode; -import com.google.api.gax.rpc.StubSettings; -import com.google.api.gax.rpc.TransportChannelProvider; -import com.google.api.gax.rpc.UnaryCallSettings; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import com.google.common.collect.ImmutableSet; -import com.google.common.collect.Lists; -import com.google.protobuf.Empty; -import com.google.showcase.v1beta1.AttemptSequenceRequest; -import com.google.showcase.v1beta1.CreateSequenceRequest; -import com.google.showcase.v1beta1.GetSequenceReportRequest; -import com.google.showcase.v1beta1.Sequence; -import com.google.showcase.v1beta1.SequenceReport; -import java.io.IOException; -import java.util.List; -import javax.annotation.Generated; -import org.threeten.bp.Duration; - -// AUTO-GENERATED DOCUMENTATION AND CLASS. -/** - * Settings class to configure an instance of {@link SequenceServiceStub}. - * - *

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

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

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

        For example, to set the total timeout of createSequence to 30 seconds: - * - *

        {@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
        - * SequenceServiceStubSettings.Builder sequenceServiceSettingsBuilder =
        - *     SequenceServiceStubSettings.newBuilder();
        - * sequenceServiceSettingsBuilder
        - *     .createSequenceSettings()
        - *     .setRetrySettings(
        - *         sequenceServiceSettingsBuilder
        - *             .createSequenceSettings()
        - *             .getRetrySettings()
        - *             .toBuilder()
        - *             .setTotalTimeout(Duration.ofSeconds(30))
        - *             .build());
        - * SequenceServiceStubSettings sequenceServiceSettings = sequenceServiceSettingsBuilder.build();
        - * }
        - */ -@BetaApi -@Generated("by gapic-generator-java") -public class SequenceServiceStubSettings extends StubSettings { - /** The default scopes of the service. */ - private static final ImmutableList DEFAULT_SERVICE_SCOPES = - ImmutableList.builder().build(); - - private final UnaryCallSettings createSequenceSettings; - private final UnaryCallSettings - getSequenceReportSettings; - private final UnaryCallSettings attemptSequenceSettings; - - /** Returns the object with the settings used for calls to createSequence. */ - public UnaryCallSettings createSequenceSettings() { - return createSequenceSettings; - } - - /** Returns the object with the settings used for calls to getSequenceReport. */ - public UnaryCallSettings getSequenceReportSettings() { - return getSequenceReportSettings; - } - - /** Returns the object with the settings used for calls to attemptSequence. */ - public UnaryCallSettings attemptSequenceSettings() { - return attemptSequenceSettings; - } - - public SequenceServiceStub createStub() throws IOException { - if (getTransportChannelProvider() - .getTransportName() - .equals(GrpcTransportChannel.getGrpcTransportName())) { - return GrpcSequenceServiceStub.create(this); - } - if (getTransportChannelProvider() - .getTransportName() - .equals(HttpJsonTransportChannel.getHttpJsonTransportName())) { - return HttpJsonSequenceServiceStub.create(this); - } - throw new UnsupportedOperationException( - String.format( - "Transport not supported: %s", getTransportChannelProvider().getTransportName())); - } - - /** Returns a builder for the default ExecutorProvider for this service. */ - public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { - return InstantiatingExecutorProvider.newBuilder(); - } - - /** Returns the default service endpoint. */ - public static String getDefaultEndpoint() { - return "localhost:7469"; - } - - /** Returns the default mTLS service endpoint. */ - public static String getDefaultMtlsEndpoint() { - return "localhost:7469"; - } - - /** 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 gRPC ChannelProvider for this service. */ - public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { - return InstantiatingGrpcChannelProvider.newBuilder() - .setMaxInboundMessageSize(Integer.MAX_VALUE); - } - - /** Returns a builder for the default REST ChannelProvider for this service. */ - @BetaApi - public static InstantiatingHttpJsonChannelProvider.Builder - defaultHttpJsonTransportProviderBuilder() { - return InstantiatingHttpJsonChannelProvider.newBuilder(); - } - - public static TransportChannelProvider defaultTransportChannelProvider() { - return defaultGrpcTransportProviderBuilder().build(); - } - - @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") - public static ApiClientHeaderProvider.Builder defaultGrpcApiClientHeaderProviderBuilder() { - return ApiClientHeaderProvider.newBuilder() - .setGeneratedLibToken( - "gapic", GaxProperties.getLibraryVersion(SequenceServiceStubSettings.class)) - .setTransportToken( - GaxGrpcProperties.getGrpcTokenName(), GaxGrpcProperties.getGrpcVersion()); - } - - @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") - public static ApiClientHeaderProvider.Builder defaultHttpJsonApiClientHeaderProviderBuilder() { - return ApiClientHeaderProvider.newBuilder() - .setGeneratedLibToken( - "gapic", GaxProperties.getLibraryVersion(SequenceServiceStubSettings.class)) - .setTransportToken( - GaxHttpJsonProperties.getHttpJsonTokenName(), - GaxHttpJsonProperties.getHttpJsonVersion()); - } - - public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { - return SequenceServiceStubSettings.defaultGrpcApiClientHeaderProviderBuilder(); - } - - /** Returns a new gRPC builder for this class. */ - public static Builder newBuilder() { - return Builder.createDefault(); - } - - /** Returns a new REST builder for this class. */ - public static Builder newHttpJsonBuilder() { - return Builder.createHttpJsonDefault(); - } - - /** 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 SequenceServiceStubSettings(Builder settingsBuilder) throws IOException { - super(settingsBuilder); - - createSequenceSettings = settingsBuilder.createSequenceSettings().build(); - getSequenceReportSettings = settingsBuilder.getSequenceReportSettings().build(); - attemptSequenceSettings = settingsBuilder.attemptSequenceSettings().build(); - } - - /** Builder for SequenceServiceStubSettings. */ - public static class Builder extends StubSettings.Builder { - private final ImmutableList> unaryMethodSettingsBuilders; - private final UnaryCallSettings.Builder createSequenceSettings; - private final UnaryCallSettings.Builder - getSequenceReportSettings; - private final UnaryCallSettings.Builder attemptSequenceSettings; - private static final ImmutableMap> - RETRYABLE_CODE_DEFINITIONS; - - static { - ImmutableMap.Builder> definitions = - ImmutableMap.builder(); - definitions.put( - "no_retry_0_codes", ImmutableSet.copyOf(Lists.newArrayList())); - definitions.put( - "retry_policy_1_codes", - ImmutableSet.copyOf( - Lists.newArrayList( - StatusCode.Code.UNAVAILABLE, StatusCode.Code.UNKNOWN))); - RETRYABLE_CODE_DEFINITIONS = definitions.build(); - } - - private static final ImmutableMap RETRY_PARAM_DEFINITIONS; - - static { - ImmutableMap.Builder definitions = ImmutableMap.builder(); - RetrySettings settings = null; - settings = - RetrySettings.newBuilder() - .setInitialRpcTimeout(Duration.ofMillis(5000L)) - .setRpcTimeoutMultiplier(1.0) - .setMaxRpcTimeout(Duration.ofMillis(5000L)) - .setTotalTimeout(Duration.ofMillis(5000L)) - .build(); - definitions.put("no_retry_0_params", settings); - settings = - RetrySettings.newBuilder() - .setInitialRetryDelay(Duration.ofMillis(100L)) - .setRetryDelayMultiplier(2.0) - .setMaxRetryDelay(Duration.ofMillis(3000L)) - .setInitialRpcTimeout(Duration.ofMillis(10000L)) - .setRpcTimeoutMultiplier(1.0) - .setMaxRpcTimeout(Duration.ofMillis(10000L)) - .setTotalTimeout(Duration.ofMillis(10000L)) - .build(); - definitions.put("retry_policy_1_params", settings); - RETRY_PARAM_DEFINITIONS = definitions.build(); - } - - protected Builder() { - this(((ClientContext) null)); - } - - protected Builder(ClientContext clientContext) { - super(clientContext); - - createSequenceSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); - getSequenceReportSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); - attemptSequenceSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); - - unaryMethodSettingsBuilders = - ImmutableList.>of( - createSequenceSettings, getSequenceReportSettings, attemptSequenceSettings); - initDefaults(this); - } - - protected Builder(SequenceServiceStubSettings settings) { - super(settings); - - createSequenceSettings = settings.createSequenceSettings.toBuilder(); - getSequenceReportSettings = settings.getSequenceReportSettings.toBuilder(); - attemptSequenceSettings = settings.attemptSequenceSettings.toBuilder(); - - unaryMethodSettingsBuilders = - ImmutableList.>of( - createSequenceSettings, getSequenceReportSettings, attemptSequenceSettings); - } - - private static Builder createDefault() { - Builder builder = new Builder(((ClientContext) null)); - - builder.setTransportChannelProvider(defaultTransportChannelProvider()); - builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); - builder.setInternalHeaderProvider(defaultApiClientHeaderProviderBuilder().build()); - builder.setEndpoint(getDefaultEndpoint()); - builder.setMtlsEndpoint(getDefaultMtlsEndpoint()); - builder.setSwitchToMtlsEndpointAllowed(true); - - return initDefaults(builder); - } - - private static Builder createHttpJsonDefault() { - Builder builder = new Builder(((ClientContext) null)); - - builder.setTransportChannelProvider(defaultHttpJsonTransportProviderBuilder().build()); - builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); - builder.setInternalHeaderProvider(defaultHttpJsonApiClientHeaderProviderBuilder().build()); - builder.setEndpoint(getDefaultEndpoint()); - builder.setMtlsEndpoint(getDefaultMtlsEndpoint()); - builder.setSwitchToMtlsEndpointAllowed(true); - - return initDefaults(builder); - } - - private static Builder initDefaults(Builder builder) { - builder - .createSequenceSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); - - builder - .getSequenceReportSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); - - builder - .attemptSequenceSettings() - .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 createSequence. */ - public UnaryCallSettings.Builder createSequenceSettings() { - return createSequenceSettings; - } - - /** Returns the builder for the settings used for calls to getSequenceReport. */ - public UnaryCallSettings.Builder - getSequenceReportSettings() { - return getSequenceReportSettings; - } - - /** Returns the builder for the settings used for calls to attemptSequence. */ - public UnaryCallSettings.Builder attemptSequenceSettings() { - return attemptSequenceSettings; - } - - @Override - public SequenceServiceStubSettings build() throws IOException { - return new SequenceServiceStubSettings(this); - } - } -} diff --git a/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/TestingStub.java b/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/TestingStub.java deleted file mode 100644 index 5a79303508..0000000000 --- a/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/TestingStub.java +++ /dev/null @@ -1,93 +0,0 @@ -/* - * 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 - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1.stub; - -import static com.google.showcase.v1beta1.TestingClient.ListSessionsPagedResponse; -import static com.google.showcase.v1beta1.TestingClient.ListTestsPagedResponse; - -import com.google.api.core.BetaApi; -import com.google.api.gax.core.BackgroundResource; -import com.google.api.gax.rpc.UnaryCallable; -import com.google.protobuf.Empty; -import com.google.showcase.v1beta1.CreateSessionRequest; -import com.google.showcase.v1beta1.DeleteSessionRequest; -import com.google.showcase.v1beta1.DeleteTestRequest; -import com.google.showcase.v1beta1.GetSessionRequest; -import com.google.showcase.v1beta1.ListSessionsRequest; -import com.google.showcase.v1beta1.ListSessionsResponse; -import com.google.showcase.v1beta1.ListTestsRequest; -import com.google.showcase.v1beta1.ListTestsResponse; -import com.google.showcase.v1beta1.ReportSessionRequest; -import com.google.showcase.v1beta1.ReportSessionResponse; -import com.google.showcase.v1beta1.Session; -import com.google.showcase.v1beta1.VerifyTestRequest; -import com.google.showcase.v1beta1.VerifyTestResponse; -import javax.annotation.Generated; - -// AUTO-GENERATED DOCUMENTATION AND CLASS. -/** - * Base stub class for the Testing service API. - * - *

        This class is for advanced usage and reflects the underlying API directly. - */ -@BetaApi -@Generated("by gapic-generator-java") -public abstract class TestingStub implements BackgroundResource { - - public UnaryCallable createSessionCallable() { - throw new UnsupportedOperationException("Not implemented: createSessionCallable()"); - } - - public UnaryCallable getSessionCallable() { - throw new UnsupportedOperationException("Not implemented: getSessionCallable()"); - } - - public UnaryCallable listSessionsPagedCallable() { - throw new UnsupportedOperationException("Not implemented: listSessionsPagedCallable()"); - } - - public UnaryCallable listSessionsCallable() { - throw new UnsupportedOperationException("Not implemented: listSessionsCallable()"); - } - - public UnaryCallable deleteSessionCallable() { - throw new UnsupportedOperationException("Not implemented: deleteSessionCallable()"); - } - - public UnaryCallable reportSessionCallable() { - throw new UnsupportedOperationException("Not implemented: reportSessionCallable()"); - } - - public UnaryCallable listTestsPagedCallable() { - throw new UnsupportedOperationException("Not implemented: listTestsPagedCallable()"); - } - - public UnaryCallable listTestsCallable() { - throw new UnsupportedOperationException("Not implemented: listTestsCallable()"); - } - - public UnaryCallable deleteTestCallable() { - throw new UnsupportedOperationException("Not implemented: deleteTestCallable()"); - } - - public UnaryCallable verifyTestCallable() { - throw new UnsupportedOperationException("Not implemented: verifyTestCallable()"); - } - - @Override - public abstract void close(); -} diff --git a/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/TestingStubSettings.java b/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/TestingStubSettings.java deleted file mode 100644 index 9c22b1ce81..0000000000 --- a/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/TestingStubSettings.java +++ /dev/null @@ -1,612 +0,0 @@ -/* - * 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 - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1.stub; - -import static com.google.showcase.v1beta1.TestingClient.ListSessionsPagedResponse; -import static com.google.showcase.v1beta1.TestingClient.ListTestsPagedResponse; - -import com.google.api.core.ApiFunction; -import com.google.api.core.ApiFuture; -import com.google.api.core.BetaApi; -import com.google.api.gax.core.GaxProperties; -import com.google.api.gax.core.GoogleCredentialsProvider; -import com.google.api.gax.core.InstantiatingExecutorProvider; -import com.google.api.gax.grpc.GaxGrpcProperties; -import com.google.api.gax.grpc.GrpcTransportChannel; -import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; -import com.google.api.gax.httpjson.GaxHttpJsonProperties; -import com.google.api.gax.httpjson.HttpJsonTransportChannel; -import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; -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.protobuf.Empty; -import com.google.showcase.v1beta1.CreateSessionRequest; -import com.google.showcase.v1beta1.DeleteSessionRequest; -import com.google.showcase.v1beta1.DeleteTestRequest; -import com.google.showcase.v1beta1.GetSessionRequest; -import com.google.showcase.v1beta1.ListSessionsRequest; -import com.google.showcase.v1beta1.ListSessionsResponse; -import com.google.showcase.v1beta1.ListTestsRequest; -import com.google.showcase.v1beta1.ListTestsResponse; -import com.google.showcase.v1beta1.ReportSessionRequest; -import com.google.showcase.v1beta1.ReportSessionResponse; -import com.google.showcase.v1beta1.Session; -import com.google.showcase.v1beta1.Test; -import com.google.showcase.v1beta1.VerifyTestRequest; -import com.google.showcase.v1beta1.VerifyTestResponse; -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 TestingStub}. - * - *

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

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

        The builder of this class is recursive, so contained classes are themselves builders. When - * build() is called, the tree of builders is called to create the complete settings object. - * - *

        For example, to set the total timeout of createSession to 30 seconds: - * - *

        {@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
        - * TestingStubSettings.Builder testingSettingsBuilder = TestingStubSettings.newBuilder();
        - * testingSettingsBuilder
        - *     .createSessionSettings()
        - *     .setRetrySettings(
        - *         testingSettingsBuilder
        - *             .createSessionSettings()
        - *             .getRetrySettings()
        - *             .toBuilder()
        - *             .setTotalTimeout(Duration.ofSeconds(30))
        - *             .build());
        - * TestingStubSettings testingSettings = testingSettingsBuilder.build();
        - * }
        - */ -@BetaApi -@Generated("by gapic-generator-java") -public class TestingStubSettings extends StubSettings { - /** The default scopes of the service. */ - private static final ImmutableList DEFAULT_SERVICE_SCOPES = - ImmutableList.builder().build(); - - private final UnaryCallSettings createSessionSettings; - private final UnaryCallSettings getSessionSettings; - private final PagedCallSettings< - ListSessionsRequest, ListSessionsResponse, ListSessionsPagedResponse> - listSessionsSettings; - private final UnaryCallSettings deleteSessionSettings; - private final UnaryCallSettings - reportSessionSettings; - private final PagedCallSettings - listTestsSettings; - private final UnaryCallSettings deleteTestSettings; - private final UnaryCallSettings verifyTestSettings; - - private static final PagedListDescriptor - LIST_SESSIONS_PAGE_STR_DESC = - new PagedListDescriptor() { - @Override - public String emptyToken() { - return ""; - } - - @Override - public ListSessionsRequest injectToken(ListSessionsRequest payload, String token) { - return ListSessionsRequest.newBuilder(payload).setPageToken(token).build(); - } - - @Override - public ListSessionsRequest injectPageSize(ListSessionsRequest payload, int pageSize) { - return ListSessionsRequest.newBuilder(payload).setPageSize(pageSize).build(); - } - - @Override - public Integer extractPageSize(ListSessionsRequest payload) { - return payload.getPageSize(); - } - - @Override - public String extractNextToken(ListSessionsResponse payload) { - return payload.getNextPageToken(); - } - - @Override - public Iterable extractResources(ListSessionsResponse payload) { - return payload.getSessionsList() == null - ? ImmutableList.of() - : payload.getSessionsList(); - } - }; - - private static final PagedListDescriptor - LIST_TESTS_PAGE_STR_DESC = - new PagedListDescriptor() { - @Override - public String emptyToken() { - return ""; - } - - @Override - public ListTestsRequest injectToken(ListTestsRequest payload, String token) { - return ListTestsRequest.newBuilder(payload).setPageToken(token).build(); - } - - @Override - public ListTestsRequest injectPageSize(ListTestsRequest payload, int pageSize) { - return ListTestsRequest.newBuilder(payload).setPageSize(pageSize).build(); - } - - @Override - public Integer extractPageSize(ListTestsRequest payload) { - return payload.getPageSize(); - } - - @Override - public String extractNextToken(ListTestsResponse payload) { - return payload.getNextPageToken(); - } - - @Override - public Iterable extractResources(ListTestsResponse payload) { - return payload.getTestsList() == null - ? ImmutableList.of() - : payload.getTestsList(); - } - }; - - private static final PagedListResponseFactory< - ListSessionsRequest, ListSessionsResponse, ListSessionsPagedResponse> - LIST_SESSIONS_PAGE_STR_FACT = - new PagedListResponseFactory< - ListSessionsRequest, ListSessionsResponse, ListSessionsPagedResponse>() { - @Override - public ApiFuture getFuturePagedResponse( - UnaryCallable callable, - ListSessionsRequest request, - ApiCallContext context, - ApiFuture futureResponse) { - PageContext pageContext = - PageContext.create(callable, LIST_SESSIONS_PAGE_STR_DESC, request, context); - return ListSessionsPagedResponse.createAsync(pageContext, futureResponse); - } - }; - - private static final PagedListResponseFactory< - ListTestsRequest, ListTestsResponse, ListTestsPagedResponse> - LIST_TESTS_PAGE_STR_FACT = - new PagedListResponseFactory< - ListTestsRequest, ListTestsResponse, ListTestsPagedResponse>() { - @Override - public ApiFuture getFuturePagedResponse( - UnaryCallable callable, - ListTestsRequest request, - ApiCallContext context, - ApiFuture futureResponse) { - PageContext pageContext = - PageContext.create(callable, LIST_TESTS_PAGE_STR_DESC, request, context); - return ListTestsPagedResponse.createAsync(pageContext, futureResponse); - } - }; - - /** Returns the object with the settings used for calls to createSession. */ - public UnaryCallSettings createSessionSettings() { - return createSessionSettings; - } - - /** Returns the object with the settings used for calls to getSession. */ - public UnaryCallSettings getSessionSettings() { - return getSessionSettings; - } - - /** Returns the object with the settings used for calls to listSessions. */ - public PagedCallSettings - listSessionsSettings() { - return listSessionsSettings; - } - - /** Returns the object with the settings used for calls to deleteSession. */ - public UnaryCallSettings deleteSessionSettings() { - return deleteSessionSettings; - } - - /** Returns the object with the settings used for calls to reportSession. */ - public UnaryCallSettings reportSessionSettings() { - return reportSessionSettings; - } - - /** Returns the object with the settings used for calls to listTests. */ - public PagedCallSettings - listTestsSettings() { - return listTestsSettings; - } - - /** Returns the object with the settings used for calls to deleteTest. */ - public UnaryCallSettings deleteTestSettings() { - return deleteTestSettings; - } - - /** Returns the object with the settings used for calls to verifyTest. */ - public UnaryCallSettings verifyTestSettings() { - return verifyTestSettings; - } - - public TestingStub createStub() throws IOException { - if (getTransportChannelProvider() - .getTransportName() - .equals(GrpcTransportChannel.getGrpcTransportName())) { - return GrpcTestingStub.create(this); - } - if (getTransportChannelProvider() - .getTransportName() - .equals(HttpJsonTransportChannel.getHttpJsonTransportName())) { - return HttpJsonTestingStub.create(this); - } - throw new UnsupportedOperationException( - String.format( - "Transport not supported: %s", getTransportChannelProvider().getTransportName())); - } - - /** Returns a builder for the default ExecutorProvider for this service. */ - public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { - return InstantiatingExecutorProvider.newBuilder(); - } - - /** Returns the default service endpoint. */ - public static String getDefaultEndpoint() { - return "localhost:7469"; - } - - /** Returns the default mTLS service endpoint. */ - public static String getDefaultMtlsEndpoint() { - return "localhost:7469"; - } - - /** 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 gRPC ChannelProvider for this service. */ - public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { - return InstantiatingGrpcChannelProvider.newBuilder() - .setMaxInboundMessageSize(Integer.MAX_VALUE); - } - - /** Returns a builder for the default REST ChannelProvider for this service. */ - @BetaApi - public static InstantiatingHttpJsonChannelProvider.Builder - defaultHttpJsonTransportProviderBuilder() { - return InstantiatingHttpJsonChannelProvider.newBuilder(); - } - - public static TransportChannelProvider defaultTransportChannelProvider() { - return defaultGrpcTransportProviderBuilder().build(); - } - - @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") - public static ApiClientHeaderProvider.Builder defaultGrpcApiClientHeaderProviderBuilder() { - return ApiClientHeaderProvider.newBuilder() - .setGeneratedLibToken("gapic", GaxProperties.getLibraryVersion(TestingStubSettings.class)) - .setTransportToken( - GaxGrpcProperties.getGrpcTokenName(), GaxGrpcProperties.getGrpcVersion()); - } - - @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") - public static ApiClientHeaderProvider.Builder defaultHttpJsonApiClientHeaderProviderBuilder() { - return ApiClientHeaderProvider.newBuilder() - .setGeneratedLibToken("gapic", GaxProperties.getLibraryVersion(TestingStubSettings.class)) - .setTransportToken( - GaxHttpJsonProperties.getHttpJsonTokenName(), - GaxHttpJsonProperties.getHttpJsonVersion()); - } - - public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { - return TestingStubSettings.defaultGrpcApiClientHeaderProviderBuilder(); - } - - /** Returns a new gRPC builder for this class. */ - public static Builder newBuilder() { - return Builder.createDefault(); - } - - /** Returns a new REST builder for this class. */ - public static Builder newHttpJsonBuilder() { - return Builder.createHttpJsonDefault(); - } - - /** 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 TestingStubSettings(Builder settingsBuilder) throws IOException { - super(settingsBuilder); - - createSessionSettings = settingsBuilder.createSessionSettings().build(); - getSessionSettings = settingsBuilder.getSessionSettings().build(); - listSessionsSettings = settingsBuilder.listSessionsSettings().build(); - deleteSessionSettings = settingsBuilder.deleteSessionSettings().build(); - reportSessionSettings = settingsBuilder.reportSessionSettings().build(); - listTestsSettings = settingsBuilder.listTestsSettings().build(); - deleteTestSettings = settingsBuilder.deleteTestSettings().build(); - verifyTestSettings = settingsBuilder.verifyTestSettings().build(); - } - - /** Builder for TestingStubSettings. */ - public static class Builder extends StubSettings.Builder { - private final ImmutableList> unaryMethodSettingsBuilders; - private final UnaryCallSettings.Builder createSessionSettings; - private final UnaryCallSettings.Builder getSessionSettings; - private final PagedCallSettings.Builder< - ListSessionsRequest, ListSessionsResponse, ListSessionsPagedResponse> - listSessionsSettings; - private final UnaryCallSettings.Builder deleteSessionSettings; - private final UnaryCallSettings.Builder - reportSessionSettings; - private final PagedCallSettings.Builder< - ListTestsRequest, ListTestsResponse, ListTestsPagedResponse> - listTestsSettings; - private final UnaryCallSettings.Builder deleteTestSettings; - private final UnaryCallSettings.Builder - verifyTestSettings; - private static final ImmutableMap> - RETRYABLE_CODE_DEFINITIONS; - - static { - ImmutableMap.Builder> definitions = - ImmutableMap.builder(); - definitions.put("no_retry_codes", ImmutableSet.copyOf(Lists.newArrayList())); - RETRYABLE_CODE_DEFINITIONS = definitions.build(); - } - - private static final ImmutableMap RETRY_PARAM_DEFINITIONS; - - static { - ImmutableMap.Builder definitions = ImmutableMap.builder(); - RetrySettings settings = null; - settings = RetrySettings.newBuilder().setRpcTimeoutMultiplier(1.0).build(); - definitions.put("no_retry_params", settings); - RETRY_PARAM_DEFINITIONS = definitions.build(); - } - - protected Builder() { - this(((ClientContext) null)); - } - - protected Builder(ClientContext clientContext) { - super(clientContext); - - createSessionSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); - getSessionSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); - listSessionsSettings = PagedCallSettings.newBuilder(LIST_SESSIONS_PAGE_STR_FACT); - deleteSessionSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); - reportSessionSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); - listTestsSettings = PagedCallSettings.newBuilder(LIST_TESTS_PAGE_STR_FACT); - deleteTestSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); - verifyTestSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); - - unaryMethodSettingsBuilders = - ImmutableList.>of( - createSessionSettings, - getSessionSettings, - listSessionsSettings, - deleteSessionSettings, - reportSessionSettings, - listTestsSettings, - deleteTestSettings, - verifyTestSettings); - initDefaults(this); - } - - protected Builder(TestingStubSettings settings) { - super(settings); - - createSessionSettings = settings.createSessionSettings.toBuilder(); - getSessionSettings = settings.getSessionSettings.toBuilder(); - listSessionsSettings = settings.listSessionsSettings.toBuilder(); - deleteSessionSettings = settings.deleteSessionSettings.toBuilder(); - reportSessionSettings = settings.reportSessionSettings.toBuilder(); - listTestsSettings = settings.listTestsSettings.toBuilder(); - deleteTestSettings = settings.deleteTestSettings.toBuilder(); - verifyTestSettings = settings.verifyTestSettings.toBuilder(); - - unaryMethodSettingsBuilders = - ImmutableList.>of( - createSessionSettings, - getSessionSettings, - listSessionsSettings, - deleteSessionSettings, - reportSessionSettings, - listTestsSettings, - deleteTestSettings, - verifyTestSettings); - } - - private static Builder createDefault() { - Builder builder = new Builder(((ClientContext) null)); - - builder.setTransportChannelProvider(defaultTransportChannelProvider()); - builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); - builder.setInternalHeaderProvider(defaultApiClientHeaderProviderBuilder().build()); - builder.setEndpoint(getDefaultEndpoint()); - builder.setMtlsEndpoint(getDefaultMtlsEndpoint()); - builder.setSwitchToMtlsEndpointAllowed(true); - - return initDefaults(builder); - } - - private static Builder createHttpJsonDefault() { - Builder builder = new Builder(((ClientContext) null)); - - builder.setTransportChannelProvider(defaultHttpJsonTransportProviderBuilder().build()); - builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); - builder.setInternalHeaderProvider(defaultHttpJsonApiClientHeaderProviderBuilder().build()); - builder.setEndpoint(getDefaultEndpoint()); - builder.setMtlsEndpoint(getDefaultMtlsEndpoint()); - builder.setSwitchToMtlsEndpointAllowed(true); - - return initDefaults(builder); - } - - private static Builder initDefaults(Builder builder) { - builder - .createSessionSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); - - builder - .getSessionSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); - - builder - .listSessionsSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); - - builder - .deleteSessionSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); - - builder - .reportSessionSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); - - builder - .listTestsSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); - - builder - .deleteTestSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); - - builder - .verifyTestSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_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 createSession. */ - public UnaryCallSettings.Builder createSessionSettings() { - return createSessionSettings; - } - - /** Returns the builder for the settings used for calls to getSession. */ - public UnaryCallSettings.Builder getSessionSettings() { - return getSessionSettings; - } - - /** Returns the builder for the settings used for calls to listSessions. */ - public PagedCallSettings.Builder< - ListSessionsRequest, ListSessionsResponse, ListSessionsPagedResponse> - listSessionsSettings() { - return listSessionsSettings; - } - - /** Returns the builder for the settings used for calls to deleteSession. */ - public UnaryCallSettings.Builder deleteSessionSettings() { - return deleteSessionSettings; - } - - /** Returns the builder for the settings used for calls to reportSession. */ - public UnaryCallSettings.Builder - reportSessionSettings() { - return reportSessionSettings; - } - - /** Returns the builder for the settings used for calls to listTests. */ - public PagedCallSettings.Builder - listTestsSettings() { - return listTestsSettings; - } - - /** Returns the builder for the settings used for calls to deleteTest. */ - public UnaryCallSettings.Builder deleteTestSettings() { - return deleteTestSettings; - } - - /** Returns the builder for the settings used for calls to verifyTest. */ - public UnaryCallSettings.Builder verifyTestSettings() { - return verifyTestSettings; - } - - @Override - public TestingStubSettings build() throws IOException { - return new TestingStubSettings(this); - } - } -} diff --git a/showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/ComplianceClientHttpJsonTest.java b/showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/ComplianceClientHttpJsonTest.java deleted file mode 100644 index e2498246af..0000000000 --- a/showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/ComplianceClientHttpJsonTest.java +++ /dev/null @@ -1,917 +0,0 @@ -/* - * 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 - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1; - -import com.google.api.gax.core.NoCredentialsProvider; -import com.google.api.gax.httpjson.GaxHttpJsonProperties; -import com.google.api.gax.httpjson.testing.MockHttpService; -import com.google.api.gax.rpc.ApiClientHeaderProvider; -import com.google.api.gax.rpc.ApiException; -import com.google.api.gax.rpc.ApiExceptionFactory; -import com.google.api.gax.rpc.InvalidArgumentException; -import com.google.api.gax.rpc.StatusCode; -import com.google.api.gax.rpc.testing.FakeStatusCode; -import com.google.protobuf.ByteString; -import com.google.showcase.v1beta1.stub.HttpJsonComplianceStub; -import java.io.IOException; -import java.util.List; -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 ComplianceClientHttpJsonTest { - private static MockHttpService mockService; - private static ComplianceClient client; - - @BeforeClass - public static void startStaticServer() throws IOException { - mockService = - new MockHttpService( - HttpJsonComplianceStub.getMethodDescriptors(), ComplianceSettings.getDefaultEndpoint()); - ComplianceSettings settings = - ComplianceSettings.newHttpJsonBuilder() - .setTransportChannelProvider( - ComplianceSettings.defaultHttpJsonTransportProviderBuilder() - .setHttpTransport(mockService) - .build()) - .setCredentialsProvider(NoCredentialsProvider.create()) - .build(); - client = ComplianceClient.create(settings); - } - - @AfterClass - public static void stopServer() { - client.close(); - } - - @Before - public void setUp() {} - - @After - public void tearDown() throws Exception { - mockService.reset(); - } - - @Test - public void repeatDataBodyTest() throws Exception { - RepeatResponse expectedResponse = - RepeatResponse.newBuilder() - .setRequest(RepeatRequest.newBuilder().build()) - .setBindingUri("bindingUri1514820775") - .build(); - mockService.addResponse(expectedResponse); - - RepeatRequest request = - RepeatRequest.newBuilder() - .setName("name3373707") - .setInfo(ComplianceData.newBuilder().build()) - .setServerVerify(true) - .setIntendedBindingUri("intendedBindingUri780142386") - .setFInt32(-1143775883) - .setFInt64(-1143775788) - .setFDouble(-1239459382) - .setPInt32(-858673665) - .setPInt64(-858673570) - .setPDouble(-991225216) - .build(); - - RepeatResponse actualResponse = client.repeatDataBody(request); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockService.getRequestPaths(); - Assert.assertEquals(1, actualRequests.size()); - - String apiClientHeaderKey = - mockService - .getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) - .iterator() - .next(); - Assert.assertTrue( - GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey) - .matches()); - } - - @Test - public void repeatDataBodyExceptionTest() throws Exception { - ApiException exception = - ApiExceptionFactory.createException( - new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); - mockService.addException(exception); - - try { - RepeatRequest request = - RepeatRequest.newBuilder() - .setName("name3373707") - .setInfo(ComplianceData.newBuilder().build()) - .setServerVerify(true) - .setIntendedBindingUri("intendedBindingUri780142386") - .setFInt32(-1143775883) - .setFInt64(-1143775788) - .setFDouble(-1239459382) - .setPInt32(-858673665) - .setPInt64(-858673570) - .setPDouble(-991225216) - .build(); - client.repeatDataBody(request); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void repeatDataBodyInfoTest() throws Exception { - RepeatResponse expectedResponse = - RepeatResponse.newBuilder() - .setRequest(RepeatRequest.newBuilder().build()) - .setBindingUri("bindingUri1514820775") - .build(); - mockService.addResponse(expectedResponse); - - RepeatRequest request = - RepeatRequest.newBuilder() - .setName("name3373707") - .setInfo(ComplianceData.newBuilder().build()) - .setServerVerify(true) - .setIntendedBindingUri("intendedBindingUri780142386") - .setFInt32(-1143775883) - .setFInt64(-1143775788) - .setFDouble(-1239459382) - .setPInt32(-858673665) - .setPInt64(-858673570) - .setPDouble(-991225216) - .build(); - - RepeatResponse actualResponse = client.repeatDataBodyInfo(request); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockService.getRequestPaths(); - Assert.assertEquals(1, actualRequests.size()); - - String apiClientHeaderKey = - mockService - .getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) - .iterator() - .next(); - Assert.assertTrue( - GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey) - .matches()); - } - - @Test - public void repeatDataBodyInfoExceptionTest() throws Exception { - ApiException exception = - ApiExceptionFactory.createException( - new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); - mockService.addException(exception); - - try { - RepeatRequest request = - RepeatRequest.newBuilder() - .setName("name3373707") - .setInfo(ComplianceData.newBuilder().build()) - .setServerVerify(true) - .setIntendedBindingUri("intendedBindingUri780142386") - .setFInt32(-1143775883) - .setFInt64(-1143775788) - .setFDouble(-1239459382) - .setPInt32(-858673665) - .setPInt64(-858673570) - .setPDouble(-991225216) - .build(); - client.repeatDataBodyInfo(request); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void repeatDataQueryTest() throws Exception { - RepeatResponse expectedResponse = - RepeatResponse.newBuilder() - .setRequest(RepeatRequest.newBuilder().build()) - .setBindingUri("bindingUri1514820775") - .build(); - mockService.addResponse(expectedResponse); - - RepeatRequest request = - RepeatRequest.newBuilder() - .setName("name3373707") - .setInfo(ComplianceData.newBuilder().build()) - .setServerVerify(true) - .setIntendedBindingUri("intendedBindingUri780142386") - .setFInt32(-1143775883) - .setFInt64(-1143775788) - .setFDouble(-1239459382) - .setPInt32(-858673665) - .setPInt64(-858673570) - .setPDouble(-991225216) - .build(); - - RepeatResponse actualResponse = client.repeatDataQuery(request); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockService.getRequestPaths(); - Assert.assertEquals(1, actualRequests.size()); - - String apiClientHeaderKey = - mockService - .getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) - .iterator() - .next(); - Assert.assertTrue( - GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey) - .matches()); - } - - @Test - public void repeatDataQueryExceptionTest() throws Exception { - ApiException exception = - ApiExceptionFactory.createException( - new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); - mockService.addException(exception); - - try { - RepeatRequest request = - RepeatRequest.newBuilder() - .setName("name3373707") - .setInfo(ComplianceData.newBuilder().build()) - .setServerVerify(true) - .setIntendedBindingUri("intendedBindingUri780142386") - .setFInt32(-1143775883) - .setFInt64(-1143775788) - .setFDouble(-1239459382) - .setPInt32(-858673665) - .setPInt64(-858673570) - .setPDouble(-991225216) - .build(); - client.repeatDataQuery(request); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void repeatDataSimplePathTest() throws Exception { - RepeatResponse expectedResponse = - RepeatResponse.newBuilder() - .setRequest(RepeatRequest.newBuilder().build()) - .setBindingUri("bindingUri1514820775") - .build(); - mockService.addResponse(expectedResponse); - - RepeatRequest request = - RepeatRequest.newBuilder() - .setName("name3373707") - .setInfo( - ComplianceData.newBuilder() - .setFString("fString-9139") - .setFInt32(-1143775883) - .setFSint32(-815756300) - .setFSfixed32(-763212615) - .setFUint32(-758497998) - .setFFixed32(1837548026) - .setFInt64(-1143775788) - .setFSint64(-815756205) - .setFSfixed64(-763212520) - .setFUint64(-758497903) - .setFFixed64(1837548121) - .setFDouble(-1239459382) - .setFFloat(-1146609341) - .setFBool(true) - .setFBytes(ByteString.EMPTY) - .setFChild(ComplianceDataChild.newBuilder().build()) - .setPString("pString-1191954271") - .setPInt32(-858673665) - .setPDouble(-991225216) - .setPBool(true) - .setPChild(ComplianceDataChild.newBuilder().build()) - .build()) - .setServerVerify(true) - .setIntendedBindingUri("intendedBindingUri780142386") - .setFInt32(-1143775883) - .setFInt64(-1143775788) - .setFDouble(-1239459382) - .setPInt32(-858673665) - .setPInt64(-858673570) - .setPDouble(-991225216) - .build(); - - RepeatResponse actualResponse = client.repeatDataSimplePath(request); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockService.getRequestPaths(); - Assert.assertEquals(1, actualRequests.size()); - - String apiClientHeaderKey = - mockService - .getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) - .iterator() - .next(); - Assert.assertTrue( - GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey) - .matches()); - } - - @Test - public void repeatDataSimplePathExceptionTest() throws Exception { - ApiException exception = - ApiExceptionFactory.createException( - new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); - mockService.addException(exception); - - try { - RepeatRequest request = - RepeatRequest.newBuilder() - .setName("name3373707") - .setInfo( - ComplianceData.newBuilder() - .setFString("fString-9139") - .setFInt32(-1143775883) - .setFSint32(-815756300) - .setFSfixed32(-763212615) - .setFUint32(-758497998) - .setFFixed32(1837548026) - .setFInt64(-1143775788) - .setFSint64(-815756205) - .setFSfixed64(-763212520) - .setFUint64(-758497903) - .setFFixed64(1837548121) - .setFDouble(-1239459382) - .setFFloat(-1146609341) - .setFBool(true) - .setFBytes(ByteString.EMPTY) - .setFChild(ComplianceDataChild.newBuilder().build()) - .setPString("pString-1191954271") - .setPInt32(-858673665) - .setPDouble(-991225216) - .setPBool(true) - .setPChild(ComplianceDataChild.newBuilder().build()) - .build()) - .setServerVerify(true) - .setIntendedBindingUri("intendedBindingUri780142386") - .setFInt32(-1143775883) - .setFInt64(-1143775788) - .setFDouble(-1239459382) - .setPInt32(-858673665) - .setPInt64(-858673570) - .setPDouble(-991225216) - .build(); - client.repeatDataSimplePath(request); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void repeatDataPathResourceTest() throws Exception { - RepeatResponse expectedResponse = - RepeatResponse.newBuilder() - .setRequest(RepeatRequest.newBuilder().build()) - .setBindingUri("bindingUri1514820775") - .build(); - mockService.addResponse(expectedResponse); - - RepeatRequest request = - RepeatRequest.newBuilder() - .setName("name3373707") - .setInfo( - ComplianceData.newBuilder() - .setFString("first/firs-9148") - .setFInt32(-1143775883) - .setFSint32(-815756300) - .setFSfixed32(-763212615) - .setFUint32(-758497998) - .setFFixed32(1837548026) - .setFInt64(-1143775788) - .setFSint64(-815756205) - .setFSfixed64(-763212520) - .setFUint64(-758497903) - .setFFixed64(1837548121) - .setFDouble(-1239459382) - .setFFloat(-1146609341) - .setFBool(true) - .setFBytes(ByteString.EMPTY) - .setFChild( - ComplianceDataChild.newBuilder() - .setFString("second/secon-5446") - .setFFloat(-1146609341) - .setFDouble(-1239459382) - .setFBool(true) - .setFContinent(Continent.forNumber(0)) - .setFChild(ComplianceDataGrandchild.newBuilder().build()) - .setPString("pString-1191954271") - .setPFloat(-861507123) - .setPDouble(-991225216) - .setPBool(true) - .setPContinent(Continent.forNumber(0)) - .setPChild(ComplianceDataGrandchild.newBuilder().build()) - .build()) - .setPString("pString-1191954271") - .setPInt32(-858673665) - .setPDouble(-991225216) - .setPBool(true) - .setPChild(ComplianceDataChild.newBuilder().build()) - .build()) - .setServerVerify(true) - .setIntendedBindingUri("intendedBindingUri780142386") - .setFInt32(-1143775883) - .setFInt64(-1143775788) - .setFDouble(-1239459382) - .setPInt32(-858673665) - .setPInt64(-858673570) - .setPDouble(-991225216) - .build(); - - RepeatResponse actualResponse = client.repeatDataPathResource(request); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockService.getRequestPaths(); - Assert.assertEquals(1, actualRequests.size()); - - String apiClientHeaderKey = - mockService - .getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) - .iterator() - .next(); - Assert.assertTrue( - GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey) - .matches()); - } - - @Test - public void repeatDataPathResourceExceptionTest() throws Exception { - ApiException exception = - ApiExceptionFactory.createException( - new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); - mockService.addException(exception); - - try { - RepeatRequest request = - RepeatRequest.newBuilder() - .setName("name3373707") - .setInfo( - ComplianceData.newBuilder() - .setFString("first/firs-9148") - .setFInt32(-1143775883) - .setFSint32(-815756300) - .setFSfixed32(-763212615) - .setFUint32(-758497998) - .setFFixed32(1837548026) - .setFInt64(-1143775788) - .setFSint64(-815756205) - .setFSfixed64(-763212520) - .setFUint64(-758497903) - .setFFixed64(1837548121) - .setFDouble(-1239459382) - .setFFloat(-1146609341) - .setFBool(true) - .setFBytes(ByteString.EMPTY) - .setFChild( - ComplianceDataChild.newBuilder() - .setFString("second/secon-5446") - .setFFloat(-1146609341) - .setFDouble(-1239459382) - .setFBool(true) - .setFContinent(Continent.forNumber(0)) - .setFChild(ComplianceDataGrandchild.newBuilder().build()) - .setPString("pString-1191954271") - .setPFloat(-861507123) - .setPDouble(-991225216) - .setPBool(true) - .setPContinent(Continent.forNumber(0)) - .setPChild(ComplianceDataGrandchild.newBuilder().build()) - .build()) - .setPString("pString-1191954271") - .setPInt32(-858673665) - .setPDouble(-991225216) - .setPBool(true) - .setPChild(ComplianceDataChild.newBuilder().build()) - .build()) - .setServerVerify(true) - .setIntendedBindingUri("intendedBindingUri780142386") - .setFInt32(-1143775883) - .setFInt64(-1143775788) - .setFDouble(-1239459382) - .setPInt32(-858673665) - .setPInt64(-858673570) - .setPDouble(-991225216) - .build(); - client.repeatDataPathResource(request); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void repeatDataPathTrailingResourceTest() throws Exception { - RepeatResponse expectedResponse = - RepeatResponse.newBuilder() - .setRequest(RepeatRequest.newBuilder().build()) - .setBindingUri("bindingUri1514820775") - .build(); - mockService.addResponse(expectedResponse); - - RepeatRequest request = - RepeatRequest.newBuilder() - .setName("name3373707") - .setInfo( - ComplianceData.newBuilder() - .setFString("first/firs-9148") - .setFInt32(-1143775883) - .setFSint32(-815756300) - .setFSfixed32(-763212615) - .setFUint32(-758497998) - .setFFixed32(1837548026) - .setFInt64(-1143775788) - .setFSint64(-815756205) - .setFSfixed64(-763212520) - .setFUint64(-758497903) - .setFFixed64(1837548121) - .setFDouble(-1239459382) - .setFFloat(-1146609341) - .setFBool(true) - .setFBytes(ByteString.EMPTY) - .setFChild( - ComplianceDataChild.newBuilder() - .setFString("second/secon-3276") - .setFFloat(-1146609341) - .setFDouble(-1239459382) - .setFBool(true) - .setFContinent(Continent.forNumber(0)) - .setFChild(ComplianceDataGrandchild.newBuilder().build()) - .setPString("pString-1191954271") - .setPFloat(-861507123) - .setPDouble(-991225216) - .setPBool(true) - .setPContinent(Continent.forNumber(0)) - .setPChild(ComplianceDataGrandchild.newBuilder().build()) - .build()) - .setPString("pString-1191954271") - .setPInt32(-858673665) - .setPDouble(-991225216) - .setPBool(true) - .setPChild(ComplianceDataChild.newBuilder().build()) - .build()) - .setServerVerify(true) - .setIntendedBindingUri("intendedBindingUri780142386") - .setFInt32(-1143775883) - .setFInt64(-1143775788) - .setFDouble(-1239459382) - .setPInt32(-858673665) - .setPInt64(-858673570) - .setPDouble(-991225216) - .build(); - - RepeatResponse actualResponse = client.repeatDataPathTrailingResource(request); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockService.getRequestPaths(); - Assert.assertEquals(1, actualRequests.size()); - - String apiClientHeaderKey = - mockService - .getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) - .iterator() - .next(); - Assert.assertTrue( - GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey) - .matches()); - } - - @Test - public void repeatDataPathTrailingResourceExceptionTest() throws Exception { - ApiException exception = - ApiExceptionFactory.createException( - new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); - mockService.addException(exception); - - try { - RepeatRequest request = - RepeatRequest.newBuilder() - .setName("name3373707") - .setInfo( - ComplianceData.newBuilder() - .setFString("first/firs-9148") - .setFInt32(-1143775883) - .setFSint32(-815756300) - .setFSfixed32(-763212615) - .setFUint32(-758497998) - .setFFixed32(1837548026) - .setFInt64(-1143775788) - .setFSint64(-815756205) - .setFSfixed64(-763212520) - .setFUint64(-758497903) - .setFFixed64(1837548121) - .setFDouble(-1239459382) - .setFFloat(-1146609341) - .setFBool(true) - .setFBytes(ByteString.EMPTY) - .setFChild( - ComplianceDataChild.newBuilder() - .setFString("second/secon-3276") - .setFFloat(-1146609341) - .setFDouble(-1239459382) - .setFBool(true) - .setFContinent(Continent.forNumber(0)) - .setFChild(ComplianceDataGrandchild.newBuilder().build()) - .setPString("pString-1191954271") - .setPFloat(-861507123) - .setPDouble(-991225216) - .setPBool(true) - .setPContinent(Continent.forNumber(0)) - .setPChild(ComplianceDataGrandchild.newBuilder().build()) - .build()) - .setPString("pString-1191954271") - .setPInt32(-858673665) - .setPDouble(-991225216) - .setPBool(true) - .setPChild(ComplianceDataChild.newBuilder().build()) - .build()) - .setServerVerify(true) - .setIntendedBindingUri("intendedBindingUri780142386") - .setFInt32(-1143775883) - .setFInt64(-1143775788) - .setFDouble(-1239459382) - .setPInt32(-858673665) - .setPInt64(-858673570) - .setPDouble(-991225216) - .build(); - client.repeatDataPathTrailingResource(request); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void repeatDataBodyPutTest() throws Exception { - RepeatResponse expectedResponse = - RepeatResponse.newBuilder() - .setRequest(RepeatRequest.newBuilder().build()) - .setBindingUri("bindingUri1514820775") - .build(); - mockService.addResponse(expectedResponse); - - RepeatRequest request = - RepeatRequest.newBuilder() - .setName("name3373707") - .setInfo(ComplianceData.newBuilder().build()) - .setServerVerify(true) - .setIntendedBindingUri("intendedBindingUri780142386") - .setFInt32(-1143775883) - .setFInt64(-1143775788) - .setFDouble(-1239459382) - .setPInt32(-858673665) - .setPInt64(-858673570) - .setPDouble(-991225216) - .build(); - - RepeatResponse actualResponse = client.repeatDataBodyPut(request); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockService.getRequestPaths(); - Assert.assertEquals(1, actualRequests.size()); - - String apiClientHeaderKey = - mockService - .getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) - .iterator() - .next(); - Assert.assertTrue( - GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey) - .matches()); - } - - @Test - public void repeatDataBodyPutExceptionTest() throws Exception { - ApiException exception = - ApiExceptionFactory.createException( - new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); - mockService.addException(exception); - - try { - RepeatRequest request = - RepeatRequest.newBuilder() - .setName("name3373707") - .setInfo(ComplianceData.newBuilder().build()) - .setServerVerify(true) - .setIntendedBindingUri("intendedBindingUri780142386") - .setFInt32(-1143775883) - .setFInt64(-1143775788) - .setFDouble(-1239459382) - .setPInt32(-858673665) - .setPInt64(-858673570) - .setPDouble(-991225216) - .build(); - client.repeatDataBodyPut(request); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void repeatDataBodyPatchTest() throws Exception { - RepeatResponse expectedResponse = - RepeatResponse.newBuilder() - .setRequest(RepeatRequest.newBuilder().build()) - .setBindingUri("bindingUri1514820775") - .build(); - mockService.addResponse(expectedResponse); - - RepeatRequest request = - RepeatRequest.newBuilder() - .setName("name3373707") - .setInfo(ComplianceData.newBuilder().build()) - .setServerVerify(true) - .setIntendedBindingUri("intendedBindingUri780142386") - .setFInt32(-1143775883) - .setFInt64(-1143775788) - .setFDouble(-1239459382) - .setPInt32(-858673665) - .setPInt64(-858673570) - .setPDouble(-991225216) - .build(); - - RepeatResponse actualResponse = client.repeatDataBodyPatch(request); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockService.getRequestPaths(); - Assert.assertEquals(1, actualRequests.size()); - - String apiClientHeaderKey = - mockService - .getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) - .iterator() - .next(); - Assert.assertTrue( - GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey) - .matches()); - } - - @Test - public void repeatDataBodyPatchExceptionTest() throws Exception { - ApiException exception = - ApiExceptionFactory.createException( - new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); - mockService.addException(exception); - - try { - RepeatRequest request = - RepeatRequest.newBuilder() - .setName("name3373707") - .setInfo(ComplianceData.newBuilder().build()) - .setServerVerify(true) - .setIntendedBindingUri("intendedBindingUri780142386") - .setFInt32(-1143775883) - .setFInt64(-1143775788) - .setFDouble(-1239459382) - .setPInt32(-858673665) - .setPInt64(-858673570) - .setPDouble(-991225216) - .build(); - client.repeatDataBodyPatch(request); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void getEnumTest() throws Exception { - EnumResponse expectedResponse = - EnumResponse.newBuilder() - .setRequest(EnumRequest.newBuilder().build()) - .setContinent(Continent.forNumber(0)) - .build(); - mockService.addResponse(expectedResponse); - - EnumRequest request = EnumRequest.newBuilder().setUnknownEnum(true).build(); - - EnumResponse actualResponse = client.getEnum(request); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockService.getRequestPaths(); - Assert.assertEquals(1, actualRequests.size()); - - String apiClientHeaderKey = - mockService - .getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) - .iterator() - .next(); - Assert.assertTrue( - GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey) - .matches()); - } - - @Test - public void getEnumExceptionTest() throws Exception { - ApiException exception = - ApiExceptionFactory.createException( - new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); - mockService.addException(exception); - - try { - EnumRequest request = EnumRequest.newBuilder().setUnknownEnum(true).build(); - client.getEnum(request); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void verifyEnumTest() throws Exception { - EnumResponse expectedResponse = - EnumResponse.newBuilder() - .setRequest(EnumRequest.newBuilder().build()) - .setContinent(Continent.forNumber(0)) - .build(); - mockService.addResponse(expectedResponse); - - EnumResponse request = - EnumResponse.newBuilder() - .setRequest(EnumRequest.newBuilder().build()) - .setContinent(Continent.forNumber(0)) - .build(); - - EnumResponse actualResponse = client.verifyEnum(request); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockService.getRequestPaths(); - Assert.assertEquals(1, actualRequests.size()); - - String apiClientHeaderKey = - mockService - .getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) - .iterator() - .next(); - Assert.assertTrue( - GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey) - .matches()); - } - - @Test - public void verifyEnumExceptionTest() throws Exception { - ApiException exception = - ApiExceptionFactory.createException( - new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); - mockService.addException(exception); - - try { - EnumResponse request = - EnumResponse.newBuilder() - .setRequest(EnumRequest.newBuilder().build()) - .setContinent(Continent.forNumber(0)) - .build(); - client.verifyEnum(request); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } -} diff --git a/showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/ComplianceClientTest.java b/showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/ComplianceClientTest.java deleted file mode 100644 index 219b1c3712..0000000000 --- a/showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/ComplianceClientTest.java +++ /dev/null @@ -1,740 +0,0 @@ -/* - * 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 - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1; - -import com.google.api.gax.core.NoCredentialsProvider; -import com.google.api.gax.grpc.GaxGrpcProperties; -import com.google.api.gax.grpc.testing.LocalChannelProvider; -import com.google.api.gax.grpc.testing.MockGrpcService; -import com.google.api.gax.grpc.testing.MockServiceHelper; -import com.google.api.gax.rpc.ApiClientHeaderProvider; -import com.google.api.gax.rpc.InvalidArgumentException; -import com.google.protobuf.AbstractMessage; -import io.grpc.StatusRuntimeException; -import java.io.IOException; -import java.util.Arrays; -import java.util.List; -import java.util.UUID; -import javax.annotation.Generated; -import org.junit.After; -import org.junit.AfterClass; -import org.junit.Assert; -import org.junit.Before; -import org.junit.BeforeClass; -import org.junit.Test; - -@Generated("by gapic-generator-java") -public class ComplianceClientTest { - private static MockCompliance mockCompliance; - private static MockServiceHelper mockServiceHelper; - private LocalChannelProvider channelProvider; - private ComplianceClient client; - - @BeforeClass - public static void startStaticServer() { - mockCompliance = new MockCompliance(); - mockServiceHelper = - new MockServiceHelper( - UUID.randomUUID().toString(), Arrays.asList(mockCompliance)); - mockServiceHelper.start(); - } - - @AfterClass - public static void stopServer() { - mockServiceHelper.stop(); - } - - @Before - public void setUp() throws IOException { - mockServiceHelper.reset(); - channelProvider = mockServiceHelper.createChannelProvider(); - ComplianceSettings settings = - ComplianceSettings.newBuilder() - .setTransportChannelProvider(channelProvider) - .setCredentialsProvider(NoCredentialsProvider.create()) - .build(); - client = ComplianceClient.create(settings); - } - - @After - public void tearDown() throws Exception { - client.close(); - } - - @Test - public void repeatDataBodyTest() throws Exception { - RepeatResponse expectedResponse = - RepeatResponse.newBuilder() - .setRequest(RepeatRequest.newBuilder().build()) - .setBindingUri("bindingUri1514820775") - .build(); - mockCompliance.addResponse(expectedResponse); - - RepeatRequest request = - RepeatRequest.newBuilder() - .setName("name3373707") - .setInfo(ComplianceData.newBuilder().build()) - .setServerVerify(true) - .setIntendedBindingUri("intendedBindingUri780142386") - .setFInt32(-1143775883) - .setFInt64(-1143775788) - .setFDouble(-1239459382) - .setPInt32(-858673665) - .setPInt64(-858673570) - .setPDouble(-991225216) - .build(); - - RepeatResponse actualResponse = client.repeatDataBody(request); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockCompliance.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - RepeatRequest actualRequest = ((RepeatRequest) actualRequests.get(0)); - - Assert.assertEquals(request.getName(), actualRequest.getName()); - Assert.assertEquals(request.getInfo(), actualRequest.getInfo()); - Assert.assertEquals(request.getServerVerify(), actualRequest.getServerVerify()); - Assert.assertEquals(request.getIntendedBindingUri(), actualRequest.getIntendedBindingUri()); - Assert.assertEquals(request.getFInt32(), actualRequest.getFInt32()); - Assert.assertEquals(request.getFInt64(), actualRequest.getFInt64()); - Assert.assertEquals(request.getFDouble(), actualRequest.getFDouble(), 0.0001); - Assert.assertEquals(request.getPInt32(), actualRequest.getPInt32()); - Assert.assertEquals(request.getPInt64(), actualRequest.getPInt64()); - Assert.assertEquals(request.getPDouble(), actualRequest.getPDouble(), 0.0001); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - public void repeatDataBodyExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); - mockCompliance.addException(exception); - - try { - RepeatRequest request = - RepeatRequest.newBuilder() - .setName("name3373707") - .setInfo(ComplianceData.newBuilder().build()) - .setServerVerify(true) - .setIntendedBindingUri("intendedBindingUri780142386") - .setFInt32(-1143775883) - .setFInt64(-1143775788) - .setFDouble(-1239459382) - .setPInt32(-858673665) - .setPInt64(-858673570) - .setPDouble(-991225216) - .build(); - client.repeatDataBody(request); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void repeatDataBodyInfoTest() throws Exception { - RepeatResponse expectedResponse = - RepeatResponse.newBuilder() - .setRequest(RepeatRequest.newBuilder().build()) - .setBindingUri("bindingUri1514820775") - .build(); - mockCompliance.addResponse(expectedResponse); - - RepeatRequest request = - RepeatRequest.newBuilder() - .setName("name3373707") - .setInfo(ComplianceData.newBuilder().build()) - .setServerVerify(true) - .setIntendedBindingUri("intendedBindingUri780142386") - .setFInt32(-1143775883) - .setFInt64(-1143775788) - .setFDouble(-1239459382) - .setPInt32(-858673665) - .setPInt64(-858673570) - .setPDouble(-991225216) - .build(); - - RepeatResponse actualResponse = client.repeatDataBodyInfo(request); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockCompliance.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - RepeatRequest actualRequest = ((RepeatRequest) actualRequests.get(0)); - - Assert.assertEquals(request.getName(), actualRequest.getName()); - Assert.assertEquals(request.getInfo(), actualRequest.getInfo()); - Assert.assertEquals(request.getServerVerify(), actualRequest.getServerVerify()); - Assert.assertEquals(request.getIntendedBindingUri(), actualRequest.getIntendedBindingUri()); - Assert.assertEquals(request.getFInt32(), actualRequest.getFInt32()); - Assert.assertEquals(request.getFInt64(), actualRequest.getFInt64()); - Assert.assertEquals(request.getFDouble(), actualRequest.getFDouble(), 0.0001); - Assert.assertEquals(request.getPInt32(), actualRequest.getPInt32()); - Assert.assertEquals(request.getPInt64(), actualRequest.getPInt64()); - Assert.assertEquals(request.getPDouble(), actualRequest.getPDouble(), 0.0001); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - public void repeatDataBodyInfoExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); - mockCompliance.addException(exception); - - try { - RepeatRequest request = - RepeatRequest.newBuilder() - .setName("name3373707") - .setInfo(ComplianceData.newBuilder().build()) - .setServerVerify(true) - .setIntendedBindingUri("intendedBindingUri780142386") - .setFInt32(-1143775883) - .setFInt64(-1143775788) - .setFDouble(-1239459382) - .setPInt32(-858673665) - .setPInt64(-858673570) - .setPDouble(-991225216) - .build(); - client.repeatDataBodyInfo(request); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void repeatDataQueryTest() throws Exception { - RepeatResponse expectedResponse = - RepeatResponse.newBuilder() - .setRequest(RepeatRequest.newBuilder().build()) - .setBindingUri("bindingUri1514820775") - .build(); - mockCompliance.addResponse(expectedResponse); - - RepeatRequest request = - RepeatRequest.newBuilder() - .setName("name3373707") - .setInfo(ComplianceData.newBuilder().build()) - .setServerVerify(true) - .setIntendedBindingUri("intendedBindingUri780142386") - .setFInt32(-1143775883) - .setFInt64(-1143775788) - .setFDouble(-1239459382) - .setPInt32(-858673665) - .setPInt64(-858673570) - .setPDouble(-991225216) - .build(); - - RepeatResponse actualResponse = client.repeatDataQuery(request); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockCompliance.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - RepeatRequest actualRequest = ((RepeatRequest) actualRequests.get(0)); - - Assert.assertEquals(request.getName(), actualRequest.getName()); - Assert.assertEquals(request.getInfo(), actualRequest.getInfo()); - Assert.assertEquals(request.getServerVerify(), actualRequest.getServerVerify()); - Assert.assertEquals(request.getIntendedBindingUri(), actualRequest.getIntendedBindingUri()); - Assert.assertEquals(request.getFInt32(), actualRequest.getFInt32()); - Assert.assertEquals(request.getFInt64(), actualRequest.getFInt64()); - Assert.assertEquals(request.getFDouble(), actualRequest.getFDouble(), 0.0001); - Assert.assertEquals(request.getPInt32(), actualRequest.getPInt32()); - Assert.assertEquals(request.getPInt64(), actualRequest.getPInt64()); - Assert.assertEquals(request.getPDouble(), actualRequest.getPDouble(), 0.0001); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - public void repeatDataQueryExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); - mockCompliance.addException(exception); - - try { - RepeatRequest request = - RepeatRequest.newBuilder() - .setName("name3373707") - .setInfo(ComplianceData.newBuilder().build()) - .setServerVerify(true) - .setIntendedBindingUri("intendedBindingUri780142386") - .setFInt32(-1143775883) - .setFInt64(-1143775788) - .setFDouble(-1239459382) - .setPInt32(-858673665) - .setPInt64(-858673570) - .setPDouble(-991225216) - .build(); - client.repeatDataQuery(request); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void repeatDataSimplePathTest() throws Exception { - RepeatResponse expectedResponse = - RepeatResponse.newBuilder() - .setRequest(RepeatRequest.newBuilder().build()) - .setBindingUri("bindingUri1514820775") - .build(); - mockCompliance.addResponse(expectedResponse); - - RepeatRequest request = - RepeatRequest.newBuilder() - .setName("name3373707") - .setInfo(ComplianceData.newBuilder().build()) - .setServerVerify(true) - .setIntendedBindingUri("intendedBindingUri780142386") - .setFInt32(-1143775883) - .setFInt64(-1143775788) - .setFDouble(-1239459382) - .setPInt32(-858673665) - .setPInt64(-858673570) - .setPDouble(-991225216) - .build(); - - RepeatResponse actualResponse = client.repeatDataSimplePath(request); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockCompliance.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - RepeatRequest actualRequest = ((RepeatRequest) actualRequests.get(0)); - - Assert.assertEquals(request.getName(), actualRequest.getName()); - Assert.assertEquals(request.getInfo(), actualRequest.getInfo()); - Assert.assertEquals(request.getServerVerify(), actualRequest.getServerVerify()); - Assert.assertEquals(request.getIntendedBindingUri(), actualRequest.getIntendedBindingUri()); - Assert.assertEquals(request.getFInt32(), actualRequest.getFInt32()); - Assert.assertEquals(request.getFInt64(), actualRequest.getFInt64()); - Assert.assertEquals(request.getFDouble(), actualRequest.getFDouble(), 0.0001); - Assert.assertEquals(request.getPInt32(), actualRequest.getPInt32()); - Assert.assertEquals(request.getPInt64(), actualRequest.getPInt64()); - Assert.assertEquals(request.getPDouble(), actualRequest.getPDouble(), 0.0001); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - public void repeatDataSimplePathExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); - mockCompliance.addException(exception); - - try { - RepeatRequest request = - RepeatRequest.newBuilder() - .setName("name3373707") - .setInfo(ComplianceData.newBuilder().build()) - .setServerVerify(true) - .setIntendedBindingUri("intendedBindingUri780142386") - .setFInt32(-1143775883) - .setFInt64(-1143775788) - .setFDouble(-1239459382) - .setPInt32(-858673665) - .setPInt64(-858673570) - .setPDouble(-991225216) - .build(); - client.repeatDataSimplePath(request); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void repeatDataPathResourceTest() throws Exception { - RepeatResponse expectedResponse = - RepeatResponse.newBuilder() - .setRequest(RepeatRequest.newBuilder().build()) - .setBindingUri("bindingUri1514820775") - .build(); - mockCompliance.addResponse(expectedResponse); - - RepeatRequest request = - RepeatRequest.newBuilder() - .setName("name3373707") - .setInfo(ComplianceData.newBuilder().build()) - .setServerVerify(true) - .setIntendedBindingUri("intendedBindingUri780142386") - .setFInt32(-1143775883) - .setFInt64(-1143775788) - .setFDouble(-1239459382) - .setPInt32(-858673665) - .setPInt64(-858673570) - .setPDouble(-991225216) - .build(); - - RepeatResponse actualResponse = client.repeatDataPathResource(request); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockCompliance.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - RepeatRequest actualRequest = ((RepeatRequest) actualRequests.get(0)); - - Assert.assertEquals(request.getName(), actualRequest.getName()); - Assert.assertEquals(request.getInfo(), actualRequest.getInfo()); - Assert.assertEquals(request.getServerVerify(), actualRequest.getServerVerify()); - Assert.assertEquals(request.getIntendedBindingUri(), actualRequest.getIntendedBindingUri()); - Assert.assertEquals(request.getFInt32(), actualRequest.getFInt32()); - Assert.assertEquals(request.getFInt64(), actualRequest.getFInt64()); - Assert.assertEquals(request.getFDouble(), actualRequest.getFDouble(), 0.0001); - Assert.assertEquals(request.getPInt32(), actualRequest.getPInt32()); - Assert.assertEquals(request.getPInt64(), actualRequest.getPInt64()); - Assert.assertEquals(request.getPDouble(), actualRequest.getPDouble(), 0.0001); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - public void repeatDataPathResourceExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); - mockCompliance.addException(exception); - - try { - RepeatRequest request = - RepeatRequest.newBuilder() - .setName("name3373707") - .setInfo(ComplianceData.newBuilder().build()) - .setServerVerify(true) - .setIntendedBindingUri("intendedBindingUri780142386") - .setFInt32(-1143775883) - .setFInt64(-1143775788) - .setFDouble(-1239459382) - .setPInt32(-858673665) - .setPInt64(-858673570) - .setPDouble(-991225216) - .build(); - client.repeatDataPathResource(request); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void repeatDataPathTrailingResourceTest() throws Exception { - RepeatResponse expectedResponse = - RepeatResponse.newBuilder() - .setRequest(RepeatRequest.newBuilder().build()) - .setBindingUri("bindingUri1514820775") - .build(); - mockCompliance.addResponse(expectedResponse); - - RepeatRequest request = - RepeatRequest.newBuilder() - .setName("name3373707") - .setInfo(ComplianceData.newBuilder().build()) - .setServerVerify(true) - .setIntendedBindingUri("intendedBindingUri780142386") - .setFInt32(-1143775883) - .setFInt64(-1143775788) - .setFDouble(-1239459382) - .setPInt32(-858673665) - .setPInt64(-858673570) - .setPDouble(-991225216) - .build(); - - RepeatResponse actualResponse = client.repeatDataPathTrailingResource(request); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockCompliance.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - RepeatRequest actualRequest = ((RepeatRequest) actualRequests.get(0)); - - Assert.assertEquals(request.getName(), actualRequest.getName()); - Assert.assertEquals(request.getInfo(), actualRequest.getInfo()); - Assert.assertEquals(request.getServerVerify(), actualRequest.getServerVerify()); - Assert.assertEquals(request.getIntendedBindingUri(), actualRequest.getIntendedBindingUri()); - Assert.assertEquals(request.getFInt32(), actualRequest.getFInt32()); - Assert.assertEquals(request.getFInt64(), actualRequest.getFInt64()); - Assert.assertEquals(request.getFDouble(), actualRequest.getFDouble(), 0.0001); - Assert.assertEquals(request.getPInt32(), actualRequest.getPInt32()); - Assert.assertEquals(request.getPInt64(), actualRequest.getPInt64()); - Assert.assertEquals(request.getPDouble(), actualRequest.getPDouble(), 0.0001); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - public void repeatDataPathTrailingResourceExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); - mockCompliance.addException(exception); - - try { - RepeatRequest request = - RepeatRequest.newBuilder() - .setName("name3373707") - .setInfo(ComplianceData.newBuilder().build()) - .setServerVerify(true) - .setIntendedBindingUri("intendedBindingUri780142386") - .setFInt32(-1143775883) - .setFInt64(-1143775788) - .setFDouble(-1239459382) - .setPInt32(-858673665) - .setPInt64(-858673570) - .setPDouble(-991225216) - .build(); - client.repeatDataPathTrailingResource(request); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void repeatDataBodyPutTest() throws Exception { - RepeatResponse expectedResponse = - RepeatResponse.newBuilder() - .setRequest(RepeatRequest.newBuilder().build()) - .setBindingUri("bindingUri1514820775") - .build(); - mockCompliance.addResponse(expectedResponse); - - RepeatRequest request = - RepeatRequest.newBuilder() - .setName("name3373707") - .setInfo(ComplianceData.newBuilder().build()) - .setServerVerify(true) - .setIntendedBindingUri("intendedBindingUri780142386") - .setFInt32(-1143775883) - .setFInt64(-1143775788) - .setFDouble(-1239459382) - .setPInt32(-858673665) - .setPInt64(-858673570) - .setPDouble(-991225216) - .build(); - - RepeatResponse actualResponse = client.repeatDataBodyPut(request); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockCompliance.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - RepeatRequest actualRequest = ((RepeatRequest) actualRequests.get(0)); - - Assert.assertEquals(request.getName(), actualRequest.getName()); - Assert.assertEquals(request.getInfo(), actualRequest.getInfo()); - Assert.assertEquals(request.getServerVerify(), actualRequest.getServerVerify()); - Assert.assertEquals(request.getIntendedBindingUri(), actualRequest.getIntendedBindingUri()); - Assert.assertEquals(request.getFInt32(), actualRequest.getFInt32()); - Assert.assertEquals(request.getFInt64(), actualRequest.getFInt64()); - Assert.assertEquals(request.getFDouble(), actualRequest.getFDouble(), 0.0001); - Assert.assertEquals(request.getPInt32(), actualRequest.getPInt32()); - Assert.assertEquals(request.getPInt64(), actualRequest.getPInt64()); - Assert.assertEquals(request.getPDouble(), actualRequest.getPDouble(), 0.0001); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - public void repeatDataBodyPutExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); - mockCompliance.addException(exception); - - try { - RepeatRequest request = - RepeatRequest.newBuilder() - .setName("name3373707") - .setInfo(ComplianceData.newBuilder().build()) - .setServerVerify(true) - .setIntendedBindingUri("intendedBindingUri780142386") - .setFInt32(-1143775883) - .setFInt64(-1143775788) - .setFDouble(-1239459382) - .setPInt32(-858673665) - .setPInt64(-858673570) - .setPDouble(-991225216) - .build(); - client.repeatDataBodyPut(request); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void repeatDataBodyPatchTest() throws Exception { - RepeatResponse expectedResponse = - RepeatResponse.newBuilder() - .setRequest(RepeatRequest.newBuilder().build()) - .setBindingUri("bindingUri1514820775") - .build(); - mockCompliance.addResponse(expectedResponse); - - RepeatRequest request = - RepeatRequest.newBuilder() - .setName("name3373707") - .setInfo(ComplianceData.newBuilder().build()) - .setServerVerify(true) - .setIntendedBindingUri("intendedBindingUri780142386") - .setFInt32(-1143775883) - .setFInt64(-1143775788) - .setFDouble(-1239459382) - .setPInt32(-858673665) - .setPInt64(-858673570) - .setPDouble(-991225216) - .build(); - - RepeatResponse actualResponse = client.repeatDataBodyPatch(request); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockCompliance.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - RepeatRequest actualRequest = ((RepeatRequest) actualRequests.get(0)); - - Assert.assertEquals(request.getName(), actualRequest.getName()); - Assert.assertEquals(request.getInfo(), actualRequest.getInfo()); - Assert.assertEquals(request.getServerVerify(), actualRequest.getServerVerify()); - Assert.assertEquals(request.getIntendedBindingUri(), actualRequest.getIntendedBindingUri()); - Assert.assertEquals(request.getFInt32(), actualRequest.getFInt32()); - Assert.assertEquals(request.getFInt64(), actualRequest.getFInt64()); - Assert.assertEquals(request.getFDouble(), actualRequest.getFDouble(), 0.0001); - Assert.assertEquals(request.getPInt32(), actualRequest.getPInt32()); - Assert.assertEquals(request.getPInt64(), actualRequest.getPInt64()); - Assert.assertEquals(request.getPDouble(), actualRequest.getPDouble(), 0.0001); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - public void repeatDataBodyPatchExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); - mockCompliance.addException(exception); - - try { - RepeatRequest request = - RepeatRequest.newBuilder() - .setName("name3373707") - .setInfo(ComplianceData.newBuilder().build()) - .setServerVerify(true) - .setIntendedBindingUri("intendedBindingUri780142386") - .setFInt32(-1143775883) - .setFInt64(-1143775788) - .setFDouble(-1239459382) - .setPInt32(-858673665) - .setPInt64(-858673570) - .setPDouble(-991225216) - .build(); - client.repeatDataBodyPatch(request); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void getEnumTest() throws Exception { - EnumResponse expectedResponse = - EnumResponse.newBuilder() - .setRequest(EnumRequest.newBuilder().build()) - .setContinent(Continent.forNumber(0)) - .build(); - mockCompliance.addResponse(expectedResponse); - - EnumRequest request = EnumRequest.newBuilder().setUnknownEnum(true).build(); - - EnumResponse actualResponse = client.getEnum(request); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockCompliance.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - EnumRequest actualRequest = ((EnumRequest) actualRequests.get(0)); - - Assert.assertEquals(request.getUnknownEnum(), actualRequest.getUnknownEnum()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - public void getEnumExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); - mockCompliance.addException(exception); - - try { - EnumRequest request = EnumRequest.newBuilder().setUnknownEnum(true).build(); - client.getEnum(request); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void verifyEnumTest() throws Exception { - EnumResponse expectedResponse = - EnumResponse.newBuilder() - .setRequest(EnumRequest.newBuilder().build()) - .setContinent(Continent.forNumber(0)) - .build(); - mockCompliance.addResponse(expectedResponse); - - EnumResponse request = - EnumResponse.newBuilder() - .setRequest(EnumRequest.newBuilder().build()) - .setContinent(Continent.forNumber(0)) - .build(); - - EnumResponse actualResponse = client.verifyEnum(request); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockCompliance.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - EnumResponse actualRequest = ((EnumResponse) actualRequests.get(0)); - - Assert.assertEquals(request.getRequest(), actualRequest.getRequest()); - Assert.assertEquals(request.getContinent(), actualRequest.getContinent()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - public void verifyEnumExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); - mockCompliance.addException(exception); - - try { - EnumResponse request = - EnumResponse.newBuilder() - .setRequest(EnumRequest.newBuilder().build()) - .setContinent(Continent.forNumber(0)) - .build(); - client.verifyEnum(request); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } -} diff --git a/showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/EchoClientHttpJsonTest.java b/showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/EchoClientHttpJsonTest.java deleted file mode 100644 index c3084bda5f..0000000000 --- a/showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/EchoClientHttpJsonTest.java +++ /dev/null @@ -1,431 +0,0 @@ -/* - * 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 - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1; - -import static com.google.showcase.v1beta1.EchoClient.PagedExpandLegacyMappedPagedResponse; -import static com.google.showcase.v1beta1.EchoClient.PagedExpandPagedResponse; - -import com.google.api.gax.core.NoCredentialsProvider; -import com.google.api.gax.httpjson.GaxHttpJsonProperties; -import com.google.api.gax.httpjson.testing.MockHttpService; -import com.google.api.gax.rpc.ApiClientHeaderProvider; -import com.google.api.gax.rpc.ApiException; -import com.google.api.gax.rpc.ApiExceptionFactory; -import com.google.api.gax.rpc.InvalidArgumentException; -import com.google.api.gax.rpc.StatusCode; -import com.google.api.gax.rpc.testing.FakeStatusCode; -import com.google.common.collect.Lists; -import com.google.longrunning.Operation; -import com.google.protobuf.Any; -import com.google.protobuf.Duration; -import com.google.showcase.v1beta1.stub.HttpJsonEchoStub; -import java.io.IOException; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Collections; -import java.util.List; -import java.util.Map; -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 EchoClientHttpJsonTest { - private static MockHttpService mockService; - private static EchoClient client; - - @BeforeClass - public static void startStaticServer() throws IOException { - mockService = - new MockHttpService( - HttpJsonEchoStub.getMethodDescriptors(), EchoSettings.getDefaultEndpoint()); - EchoSettings settings = - EchoSettings.newHttpJsonBuilder() - .setTransportChannelProvider( - EchoSettings.defaultHttpJsonTransportProviderBuilder() - .setHttpTransport(mockService) - .build()) - .setCredentialsProvider(NoCredentialsProvider.create()) - .build(); - client = EchoClient.create(settings); - } - - @AfterClass - public static void stopServer() { - client.close(); - } - - @Before - public void setUp() {} - - @After - public void tearDown() throws Exception { - mockService.reset(); - } - - @Test - public void echoTest() throws Exception { - EchoResponse expectedResponse = - EchoResponse.newBuilder() - .setContent("content951530617") - .setSeverity(Severity.forNumber(0)) - .build(); - mockService.addResponse(expectedResponse); - - EchoRequest request = - EchoRequest.newBuilder() - .setSeverity(Severity.forNumber(0)) - .setHeader("header-1221270899") - .setOtherHeader("otherHeader-2026585667") - .build(); - - EchoResponse actualResponse = client.echo(request); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockService.getRequestPaths(); - Assert.assertEquals(1, actualRequests.size()); - - String apiClientHeaderKey = - mockService - .getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) - .iterator() - .next(); - Assert.assertTrue( - GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey) - .matches()); - } - - @Test - public void echoExceptionTest() throws Exception { - ApiException exception = - ApiExceptionFactory.createException( - new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); - mockService.addException(exception); - - try { - EchoRequest request = - EchoRequest.newBuilder() - .setSeverity(Severity.forNumber(0)) - .setHeader("header-1221270899") - .setOtherHeader("otherHeader-2026585667") - .build(); - client.echo(request); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void expandTest() throws Exception {} - - @Test - public void expandExceptionTest() throws Exception { - ApiException exception = - ApiExceptionFactory.createException( - new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); - mockService.addException(exception); - } - - @Test - public void collectUnsupportedMethodTest() throws Exception { - // The collect() method is not supported in REST transport. - // This empty test is generated for technical reasons. - } - - @Test - public void chatUnsupportedMethodTest() throws Exception { - // The chat() method is not supported in REST transport. - // This empty test is generated for technical reasons. - } - - @Test - public void pagedExpandTest() throws Exception { - EchoResponse responsesElement = EchoResponse.newBuilder().build(); - PagedExpandResponse expectedResponse = - PagedExpandResponse.newBuilder() - .setNextPageToken("") - .addAllResponses(Arrays.asList(responsesElement)) - .build(); - mockService.addResponse(expectedResponse); - - PagedExpandRequest request = - PagedExpandRequest.newBuilder() - .setContent("content951530617") - .setPageSize(883849137) - .setPageToken("pageToken873572522") - .build(); - - PagedExpandPagedResponse pagedListResponse = client.pagedExpand(request); - - List resources = Lists.newArrayList(pagedListResponse.iterateAll()); - - Assert.assertEquals(1, resources.size()); - Assert.assertEquals(expectedResponse.getResponsesList().get(0), resources.get(0)); - - List actualRequests = mockService.getRequestPaths(); - Assert.assertEquals(1, actualRequests.size()); - - String apiClientHeaderKey = - mockService - .getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) - .iterator() - .next(); - Assert.assertTrue( - GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey) - .matches()); - } - - @Test - public void pagedExpandExceptionTest() throws Exception { - ApiException exception = - ApiExceptionFactory.createException( - new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); - mockService.addException(exception); - - try { - PagedExpandRequest request = - PagedExpandRequest.newBuilder() - .setContent("content951530617") - .setPageSize(883849137) - .setPageToken("pageToken873572522") - .build(); - client.pagedExpand(request); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void pagedExpandLegacyTest() throws Exception { - PagedExpandResponse expectedResponse = - PagedExpandResponse.newBuilder() - .addAllResponses(new ArrayList()) - .setNextPageToken("nextPageToken-1386094857") - .build(); - mockService.addResponse(expectedResponse); - - PagedExpandLegacyRequest request = - PagedExpandLegacyRequest.newBuilder() - .setContent("content951530617") - .setMaxResults(1128457243) - .setPageToken("pageToken873572522") - .build(); - - PagedExpandResponse actualResponse = client.pagedExpandLegacy(request); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockService.getRequestPaths(); - Assert.assertEquals(1, actualRequests.size()); - - String apiClientHeaderKey = - mockService - .getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) - .iterator() - .next(); - Assert.assertTrue( - GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey) - .matches()); - } - - @Test - public void pagedExpandLegacyExceptionTest() throws Exception { - ApiException exception = - ApiExceptionFactory.createException( - new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); - mockService.addException(exception); - - try { - PagedExpandLegacyRequest request = - PagedExpandLegacyRequest.newBuilder() - .setContent("content951530617") - .setMaxResults(1128457243) - .setPageToken("pageToken873572522") - .build(); - client.pagedExpandLegacy(request); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void pagedExpandLegacyMappedTest() throws Exception { - PagedExpandResponseList responsesElement = PagedExpandResponseList.newBuilder().build(); - PagedExpandLegacyMappedResponse expectedResponse = - PagedExpandLegacyMappedResponse.newBuilder() - .setNextPageToken("") - .putAllAlphabetized(Collections.singletonMap("alphabetized", responsesElement)) - .build(); - mockService.addResponse(expectedResponse); - - PagedExpandRequest request = - PagedExpandRequest.newBuilder() - .setContent("content951530617") - .setPageSize(883849137) - .setPageToken("pageToken873572522") - .build(); - - PagedExpandLegacyMappedPagedResponse pagedListResponse = - client.pagedExpandLegacyMapped(request); - - List> resources = - Lists.newArrayList(pagedListResponse.iterateAll()); - - Assert.assertEquals(1, resources.size()); - Assert.assertEquals( - expectedResponse.getAlphabetizedMap().entrySet().iterator().next(), resources.get(0)); - - List actualRequests = mockService.getRequestPaths(); - Assert.assertEquals(1, actualRequests.size()); - - String apiClientHeaderKey = - mockService - .getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) - .iterator() - .next(); - Assert.assertTrue( - GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey) - .matches()); - } - - @Test - public void pagedExpandLegacyMappedExceptionTest() throws Exception { - ApiException exception = - ApiExceptionFactory.createException( - new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); - mockService.addException(exception); - - try { - PagedExpandRequest request = - PagedExpandRequest.newBuilder() - .setContent("content951530617") - .setPageSize(883849137) - .setPageToken("pageToken873572522") - .build(); - client.pagedExpandLegacyMapped(request); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void waitTest() throws Exception { - WaitResponse expectedResponse = - WaitResponse.newBuilder().setContent("content951530617").build(); - Operation resultOperation = - Operation.newBuilder() - .setName("waitTest") - .setDone(true) - .setResponse(Any.pack(expectedResponse)) - .build(); - mockService.addResponse(resultOperation); - - WaitRequest request = WaitRequest.newBuilder().build(); - - WaitResponse actualResponse = client.waitAsync(request).get(); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockService.getRequestPaths(); - Assert.assertEquals(1, actualRequests.size()); - - String apiClientHeaderKey = - mockService - .getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) - .iterator() - .next(); - Assert.assertTrue( - GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey) - .matches()); - } - - @Test - public void waitExceptionTest() throws Exception { - ApiException exception = - ApiExceptionFactory.createException( - new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); - mockService.addException(exception); - - try { - WaitRequest request = WaitRequest.newBuilder().build(); - client.waitAsync(request).get(); - Assert.fail("No exception raised"); - } catch (ExecutionException e) { - } - } - - @Test - public void blockTest() throws Exception { - BlockResponse expectedResponse = - BlockResponse.newBuilder().setContent("content951530617").build(); - mockService.addResponse(expectedResponse); - - BlockRequest request = - BlockRequest.newBuilder().setResponseDelay(Duration.newBuilder().build()).build(); - - BlockResponse actualResponse = client.block(request); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockService.getRequestPaths(); - Assert.assertEquals(1, actualRequests.size()); - - String apiClientHeaderKey = - mockService - .getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) - .iterator() - .next(); - Assert.assertTrue( - GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey) - .matches()); - } - - @Test - public void blockExceptionTest() throws Exception { - ApiException exception = - ApiExceptionFactory.createException( - new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); - mockService.addException(exception); - - try { - BlockRequest request = - BlockRequest.newBuilder().setResponseDelay(Duration.newBuilder().build()).build(); - client.block(request); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } -} diff --git a/showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/EchoClientTest.java b/showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/EchoClientTest.java deleted file mode 100644 index 9f6f7f128c..0000000000 --- a/showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/EchoClientTest.java +++ /dev/null @@ -1,562 +0,0 @@ -/* - * 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 - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1; - -import static com.google.showcase.v1beta1.EchoClient.PagedExpandLegacyMappedPagedResponse; -import static com.google.showcase.v1beta1.EchoClient.PagedExpandPagedResponse; - -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.ClientStreamingCallable; -import com.google.api.gax.rpc.InvalidArgumentException; -import com.google.api.gax.rpc.ServerStreamingCallable; -import com.google.api.gax.rpc.StatusCode; -import com.google.common.collect.Lists; -import com.google.longrunning.Operation; -import com.google.protobuf.AbstractMessage; -import com.google.protobuf.Any; -import com.google.protobuf.Duration; -import com.google.rpc.Status; -import io.grpc.StatusRuntimeException; -import java.io.IOException; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Collections; -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 EchoClientTest { - private static MockEcho mockEcho; - private static MockServiceHelper mockServiceHelper; - private LocalChannelProvider channelProvider; - private EchoClient client; - - @BeforeClass - public static void startStaticServer() { - mockEcho = new MockEcho(); - mockServiceHelper = - new MockServiceHelper( - UUID.randomUUID().toString(), Arrays.asList(mockEcho)); - mockServiceHelper.start(); - } - - @AfterClass - public static void stopServer() { - mockServiceHelper.stop(); - } - - @Before - public void setUp() throws IOException { - mockServiceHelper.reset(); - channelProvider = mockServiceHelper.createChannelProvider(); - EchoSettings settings = - EchoSettings.newBuilder() - .setTransportChannelProvider(channelProvider) - .setCredentialsProvider(NoCredentialsProvider.create()) - .build(); - client = EchoClient.create(settings); - } - - @After - public void tearDown() throws Exception { - client.close(); - } - - @Test - public void echoTest() throws Exception { - EchoResponse expectedResponse = - EchoResponse.newBuilder() - .setContent("content951530617") - .setSeverity(Severity.forNumber(0)) - .build(); - mockEcho.addResponse(expectedResponse); - - EchoRequest request = - EchoRequest.newBuilder() - .setSeverity(Severity.forNumber(0)) - .setHeader("header-1221270899") - .setOtherHeader("otherHeader-2026585667") - .build(); - - EchoResponse actualResponse = client.echo(request); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockEcho.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - EchoRequest actualRequest = ((EchoRequest) actualRequests.get(0)); - - Assert.assertEquals(request.getContent(), actualRequest.getContent()); - Assert.assertEquals(request.getError(), actualRequest.getError()); - Assert.assertEquals(request.getSeverity(), actualRequest.getSeverity()); - Assert.assertEquals(request.getHeader(), actualRequest.getHeader()); - Assert.assertEquals(request.getOtherHeader(), actualRequest.getOtherHeader()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - public void echoExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); - mockEcho.addException(exception); - - try { - EchoRequest request = - EchoRequest.newBuilder() - .setSeverity(Severity.forNumber(0)) - .setHeader("header-1221270899") - .setOtherHeader("otherHeader-2026585667") - .build(); - client.echo(request); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void expandTest() throws Exception { - EchoResponse expectedResponse = - EchoResponse.newBuilder() - .setContent("content951530617") - .setSeverity(Severity.forNumber(0)) - .build(); - mockEcho.addResponse(expectedResponse); - ExpandRequest request = - ExpandRequest.newBuilder() - .setContent("content951530617") - .setError(Status.newBuilder().build()) - .build(); - - MockStreamObserver responseObserver = new MockStreamObserver<>(); - - ServerStreamingCallable callable = client.expandCallable(); - callable.serverStreamingCall(request, responseObserver); - - List actualResponses = responseObserver.future().get(); - Assert.assertEquals(1, actualResponses.size()); - Assert.assertEquals(expectedResponse, actualResponses.get(0)); - } - - @Test - public void expandExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); - mockEcho.addException(exception); - ExpandRequest request = - ExpandRequest.newBuilder() - .setContent("content951530617") - .setError(Status.newBuilder().build()) - .build(); - - MockStreamObserver responseObserver = new MockStreamObserver<>(); - - ServerStreamingCallable callable = client.expandCallable(); - callable.serverStreamingCall(request, responseObserver); - - 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()); - } - } - - @Test - public void collectTest() throws Exception { - EchoResponse expectedResponse = - EchoResponse.newBuilder() - .setContent("content951530617") - .setSeverity(Severity.forNumber(0)) - .build(); - mockEcho.addResponse(expectedResponse); - EchoRequest request = - EchoRequest.newBuilder() - .setSeverity(Severity.forNumber(0)) - .setHeader("header-1221270899") - .setOtherHeader("otherHeader-2026585667") - .build(); - - MockStreamObserver responseObserver = new MockStreamObserver<>(); - - ClientStreamingCallable callable = client.collectCallable(); - ApiStreamObserver requestObserver = callable.clientStreamingCall(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 collectExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); - mockEcho.addException(exception); - EchoRequest request = - EchoRequest.newBuilder() - .setSeverity(Severity.forNumber(0)) - .setHeader("header-1221270899") - .setOtherHeader("otherHeader-2026585667") - .build(); - - MockStreamObserver responseObserver = new MockStreamObserver<>(); - - ClientStreamingCallable callable = client.collectCallable(); - ApiStreamObserver requestObserver = callable.clientStreamingCall(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()); - } - } - - @Test - public void chatTest() throws Exception { - EchoResponse expectedResponse = - EchoResponse.newBuilder() - .setContent("content951530617") - .setSeverity(Severity.forNumber(0)) - .build(); - mockEcho.addResponse(expectedResponse); - EchoRequest request = - EchoRequest.newBuilder() - .setSeverity(Severity.forNumber(0)) - .setHeader("header-1221270899") - .setOtherHeader("otherHeader-2026585667") - .build(); - - MockStreamObserver responseObserver = new MockStreamObserver<>(); - - BidiStreamingCallable callable = client.chatCallable(); - 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 chatExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); - mockEcho.addException(exception); - EchoRequest request = - EchoRequest.newBuilder() - .setSeverity(Severity.forNumber(0)) - .setHeader("header-1221270899") - .setOtherHeader("otherHeader-2026585667") - .build(); - - MockStreamObserver responseObserver = new MockStreamObserver<>(); - - BidiStreamingCallable callable = client.chatCallable(); - 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()); - } - } - - @Test - public void pagedExpandTest() throws Exception { - EchoResponse responsesElement = EchoResponse.newBuilder().build(); - PagedExpandResponse expectedResponse = - PagedExpandResponse.newBuilder() - .setNextPageToken("") - .addAllResponses(Arrays.asList(responsesElement)) - .build(); - mockEcho.addResponse(expectedResponse); - - PagedExpandRequest request = - PagedExpandRequest.newBuilder() - .setContent("content951530617") - .setPageSize(883849137) - .setPageToken("pageToken873572522") - .build(); - - PagedExpandPagedResponse pagedListResponse = client.pagedExpand(request); - - List resources = Lists.newArrayList(pagedListResponse.iterateAll()); - - Assert.assertEquals(1, resources.size()); - Assert.assertEquals(expectedResponse.getResponsesList().get(0), resources.get(0)); - - List actualRequests = mockEcho.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - PagedExpandRequest actualRequest = ((PagedExpandRequest) actualRequests.get(0)); - - Assert.assertEquals(request.getContent(), actualRequest.getContent()); - Assert.assertEquals(request.getPageSize(), actualRequest.getPageSize()); - Assert.assertEquals(request.getPageToken(), actualRequest.getPageToken()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - public void pagedExpandExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); - mockEcho.addException(exception); - - try { - PagedExpandRequest request = - PagedExpandRequest.newBuilder() - .setContent("content951530617") - .setPageSize(883849137) - .setPageToken("pageToken873572522") - .build(); - client.pagedExpand(request); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void pagedExpandLegacyTest() throws Exception { - PagedExpandResponse expectedResponse = - PagedExpandResponse.newBuilder() - .addAllResponses(new ArrayList()) - .setNextPageToken("nextPageToken-1386094857") - .build(); - mockEcho.addResponse(expectedResponse); - - PagedExpandLegacyRequest request = - PagedExpandLegacyRequest.newBuilder() - .setContent("content951530617") - .setMaxResults(1128457243) - .setPageToken("pageToken873572522") - .build(); - - PagedExpandResponse actualResponse = client.pagedExpandLegacy(request); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockEcho.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - PagedExpandLegacyRequest actualRequest = ((PagedExpandLegacyRequest) actualRequests.get(0)); - - Assert.assertEquals(request.getContent(), actualRequest.getContent()); - Assert.assertEquals(request.getMaxResults(), actualRequest.getMaxResults()); - Assert.assertEquals(request.getPageToken(), actualRequest.getPageToken()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - public void pagedExpandLegacyExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); - mockEcho.addException(exception); - - try { - PagedExpandLegacyRequest request = - PagedExpandLegacyRequest.newBuilder() - .setContent("content951530617") - .setMaxResults(1128457243) - .setPageToken("pageToken873572522") - .build(); - client.pagedExpandLegacy(request); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void pagedExpandLegacyMappedTest() throws Exception { - PagedExpandResponseList responsesElement = PagedExpandResponseList.newBuilder().build(); - PagedExpandLegacyMappedResponse expectedResponse = - PagedExpandLegacyMappedResponse.newBuilder() - .setNextPageToken("") - .putAllAlphabetized(Collections.singletonMap("alphabetized", responsesElement)) - .build(); - mockEcho.addResponse(expectedResponse); - - PagedExpandRequest request = - PagedExpandRequest.newBuilder() - .setContent("content951530617") - .setPageSize(883849137) - .setPageToken("pageToken873572522") - .build(); - - PagedExpandLegacyMappedPagedResponse pagedListResponse = - client.pagedExpandLegacyMapped(request); - - List> resources = - Lists.newArrayList(pagedListResponse.iterateAll()); - - Assert.assertEquals(1, resources.size()); - Assert.assertEquals( - expectedResponse.getAlphabetizedMap().entrySet().iterator().next(), resources.get(0)); - - List actualRequests = mockEcho.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - PagedExpandRequest actualRequest = ((PagedExpandRequest) actualRequests.get(0)); - - Assert.assertEquals(request.getContent(), actualRequest.getContent()); - Assert.assertEquals(request.getPageSize(), actualRequest.getPageSize()); - Assert.assertEquals(request.getPageToken(), actualRequest.getPageToken()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - public void pagedExpandLegacyMappedExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); - mockEcho.addException(exception); - - try { - PagedExpandRequest request = - PagedExpandRequest.newBuilder() - .setContent("content951530617") - .setPageSize(883849137) - .setPageToken("pageToken873572522") - .build(); - client.pagedExpandLegacyMapped(request); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void waitTest() throws Exception { - WaitResponse expectedResponse = - WaitResponse.newBuilder().setContent("content951530617").build(); - Operation resultOperation = - Operation.newBuilder() - .setName("waitTest") - .setDone(true) - .setResponse(Any.pack(expectedResponse)) - .build(); - mockEcho.addResponse(resultOperation); - - WaitRequest request = WaitRequest.newBuilder().build(); - - WaitResponse actualResponse = client.waitAsync(request).get(); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockEcho.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - WaitRequest actualRequest = ((WaitRequest) actualRequests.get(0)); - - Assert.assertEquals(request.getEndTime(), actualRequest.getEndTime()); - Assert.assertEquals(request.getTtl(), actualRequest.getTtl()); - Assert.assertEquals(request.getError(), actualRequest.getError()); - Assert.assertEquals(request.getSuccess(), actualRequest.getSuccess()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - public void waitExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); - mockEcho.addException(exception); - - try { - WaitRequest request = WaitRequest.newBuilder().build(); - client.waitAsync(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 blockTest() throws Exception { - BlockResponse expectedResponse = - BlockResponse.newBuilder().setContent("content951530617").build(); - mockEcho.addResponse(expectedResponse); - - BlockRequest request = - BlockRequest.newBuilder().setResponseDelay(Duration.newBuilder().build()).build(); - - BlockResponse actualResponse = client.block(request); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockEcho.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - BlockRequest actualRequest = ((BlockRequest) actualRequests.get(0)); - - Assert.assertEquals(request.getResponseDelay(), actualRequest.getResponseDelay()); - Assert.assertEquals(request.getError(), actualRequest.getError()); - Assert.assertEquals(request.getSuccess(), actualRequest.getSuccess()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - public void blockExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); - mockEcho.addException(exception); - - try { - BlockRequest request = - BlockRequest.newBuilder().setResponseDelay(Duration.newBuilder().build()).build(); - client.block(request); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } -} diff --git a/showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/IdentityClientHttpJsonTest.java b/showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/IdentityClientHttpJsonTest.java deleted file mode 100644 index 8928792040..0000000000 --- a/showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/IdentityClientHttpJsonTest.java +++ /dev/null @@ -1,520 +0,0 @@ -/* - * 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 - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1; - -import static com.google.showcase.v1beta1.IdentityClient.ListUsersPagedResponse; - -import com.google.api.gax.core.NoCredentialsProvider; -import com.google.api.gax.httpjson.GaxHttpJsonProperties; -import com.google.api.gax.httpjson.testing.MockHttpService; -import com.google.api.gax.rpc.ApiClientHeaderProvider; -import com.google.api.gax.rpc.ApiException; -import com.google.api.gax.rpc.ApiExceptionFactory; -import com.google.api.gax.rpc.InvalidArgumentException; -import com.google.api.gax.rpc.StatusCode; -import com.google.api.gax.rpc.testing.FakeStatusCode; -import com.google.common.collect.Lists; -import com.google.protobuf.Empty; -import com.google.protobuf.FieldMask; -import com.google.protobuf.Timestamp; -import com.google.showcase.v1beta1.stub.HttpJsonIdentityStub; -import java.io.IOException; -import java.util.Arrays; -import java.util.List; -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 IdentityClientHttpJsonTest { - private static MockHttpService mockService; - private static IdentityClient client; - - @BeforeClass - public static void startStaticServer() throws IOException { - mockService = - new MockHttpService( - HttpJsonIdentityStub.getMethodDescriptors(), IdentitySettings.getDefaultEndpoint()); - IdentitySettings settings = - IdentitySettings.newHttpJsonBuilder() - .setTransportChannelProvider( - IdentitySettings.defaultHttpJsonTransportProviderBuilder() - .setHttpTransport(mockService) - .build()) - .setCredentialsProvider(NoCredentialsProvider.create()) - .build(); - client = IdentityClient.create(settings); - } - - @AfterClass - public static void stopServer() { - client.close(); - } - - @Before - public void setUp() {} - - @After - public void tearDown() throws Exception { - mockService.reset(); - } - - @Test - public void createUserTest() throws Exception { - User expectedResponse = - User.newBuilder() - .setName(UserName.of("[USER]").toString()) - .setDisplayName("displayName1714148973") - .setEmail("email96619420") - .setCreateTime(Timestamp.newBuilder().build()) - .setUpdateTime(Timestamp.newBuilder().build()) - .setAge(96511) - .setHeightFeet(-1032737338) - .setNickname("nickname70690926") - .setEnableNotifications(true) - .build(); - mockService.addResponse(expectedResponse); - - String displayName = "displayName1714148973"; - String email = "email96619420"; - - User actualResponse = client.createUser(displayName, email); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockService.getRequestPaths(); - Assert.assertEquals(1, actualRequests.size()); - - String apiClientHeaderKey = - mockService - .getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) - .iterator() - .next(); - Assert.assertTrue( - GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey) - .matches()); - } - - @Test - public void createUserExceptionTest() throws Exception { - ApiException exception = - ApiExceptionFactory.createException( - new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); - mockService.addException(exception); - - try { - String displayName = "displayName1714148973"; - String email = "email96619420"; - client.createUser(displayName, email); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void createUserTest2() throws Exception { - User expectedResponse = - User.newBuilder() - .setName(UserName.of("[USER]").toString()) - .setDisplayName("displayName1714148973") - .setEmail("email96619420") - .setCreateTime(Timestamp.newBuilder().build()) - .setUpdateTime(Timestamp.newBuilder().build()) - .setAge(96511) - .setHeightFeet(-1032737338) - .setNickname("nickname70690926") - .setEnableNotifications(true) - .build(); - mockService.addResponse(expectedResponse); - - String displayName = "displayName1714148973"; - String email = "email96619420"; - int age = 96511; - String nickname = "nickname70690926"; - boolean enableNotifications = true; - double heightFeet = -1032737338; - - User actualResponse = - client.createUser(displayName, email, age, nickname, enableNotifications, heightFeet); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockService.getRequestPaths(); - Assert.assertEquals(1, actualRequests.size()); - - String apiClientHeaderKey = - mockService - .getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) - .iterator() - .next(); - Assert.assertTrue( - GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey) - .matches()); - } - - @Test - public void createUserExceptionTest2() throws Exception { - ApiException exception = - ApiExceptionFactory.createException( - new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); - mockService.addException(exception); - - try { - String displayName = "displayName1714148973"; - String email = "email96619420"; - int age = 96511; - String nickname = "nickname70690926"; - boolean enableNotifications = true; - double heightFeet = -1032737338; - client.createUser(displayName, email, age, nickname, enableNotifications, heightFeet); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void getUserTest() throws Exception { - User expectedResponse = - User.newBuilder() - .setName(UserName.of("[USER]").toString()) - .setDisplayName("displayName1714148973") - .setEmail("email96619420") - .setCreateTime(Timestamp.newBuilder().build()) - .setUpdateTime(Timestamp.newBuilder().build()) - .setAge(96511) - .setHeightFeet(-1032737338) - .setNickname("nickname70690926") - .setEnableNotifications(true) - .build(); - mockService.addResponse(expectedResponse); - - UserName name = UserName.of("[USER]"); - - User actualResponse = client.getUser(name); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockService.getRequestPaths(); - Assert.assertEquals(1, actualRequests.size()); - - String apiClientHeaderKey = - mockService - .getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) - .iterator() - .next(); - Assert.assertTrue( - GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey) - .matches()); - } - - @Test - public void getUserExceptionTest() throws Exception { - ApiException exception = - ApiExceptionFactory.createException( - new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); - mockService.addException(exception); - - try { - UserName name = UserName.of("[USER]"); - client.getUser(name); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void getUserTest2() throws Exception { - User expectedResponse = - User.newBuilder() - .setName(UserName.of("[USER]").toString()) - .setDisplayName("displayName1714148973") - .setEmail("email96619420") - .setCreateTime(Timestamp.newBuilder().build()) - .setUpdateTime(Timestamp.newBuilder().build()) - .setAge(96511) - .setHeightFeet(-1032737338) - .setNickname("nickname70690926") - .setEnableNotifications(true) - .build(); - mockService.addResponse(expectedResponse); - - String name = "users/user-6376"; - - User actualResponse = client.getUser(name); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockService.getRequestPaths(); - Assert.assertEquals(1, actualRequests.size()); - - String apiClientHeaderKey = - mockService - .getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) - .iterator() - .next(); - Assert.assertTrue( - GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey) - .matches()); - } - - @Test - public void getUserExceptionTest2() throws Exception { - ApiException exception = - ApiExceptionFactory.createException( - new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); - mockService.addException(exception); - - try { - String name = "users/user-6376"; - client.getUser(name); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void updateUserTest() throws Exception { - User expectedResponse = - User.newBuilder() - .setName(UserName.of("[USER]").toString()) - .setDisplayName("displayName1714148973") - .setEmail("email96619420") - .setCreateTime(Timestamp.newBuilder().build()) - .setUpdateTime(Timestamp.newBuilder().build()) - .setAge(96511) - .setHeightFeet(-1032737338) - .setNickname("nickname70690926") - .setEnableNotifications(true) - .build(); - mockService.addResponse(expectedResponse); - - UpdateUserRequest request = - UpdateUserRequest.newBuilder() - .setUser( - User.newBuilder() - .setName(UserName.of("[USER]").toString()) - .setDisplayName("displayName1714148973") - .setEmail("email96619420") - .setCreateTime(Timestamp.newBuilder().build()) - .setUpdateTime(Timestamp.newBuilder().build()) - .setAge(96511) - .setHeightFeet(-1032737338) - .setNickname("nickname70690926") - .setEnableNotifications(true) - .build()) - .setUpdateMask(FieldMask.newBuilder().build()) - .build(); - - User actualResponse = client.updateUser(request); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockService.getRequestPaths(); - Assert.assertEquals(1, actualRequests.size()); - - String apiClientHeaderKey = - mockService - .getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) - .iterator() - .next(); - Assert.assertTrue( - GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey) - .matches()); - } - - @Test - public void updateUserExceptionTest() throws Exception { - ApiException exception = - ApiExceptionFactory.createException( - new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); - mockService.addException(exception); - - try { - UpdateUserRequest request = - UpdateUserRequest.newBuilder() - .setUser( - User.newBuilder() - .setName(UserName.of("[USER]").toString()) - .setDisplayName("displayName1714148973") - .setEmail("email96619420") - .setCreateTime(Timestamp.newBuilder().build()) - .setUpdateTime(Timestamp.newBuilder().build()) - .setAge(96511) - .setHeightFeet(-1032737338) - .setNickname("nickname70690926") - .setEnableNotifications(true) - .build()) - .setUpdateMask(FieldMask.newBuilder().build()) - .build(); - client.updateUser(request); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void deleteUserTest() throws Exception { - Empty expectedResponse = Empty.newBuilder().build(); - mockService.addResponse(expectedResponse); - - UserName name = UserName.of("[USER]"); - - client.deleteUser(name); - - List actualRequests = mockService.getRequestPaths(); - Assert.assertEquals(1, actualRequests.size()); - - String apiClientHeaderKey = - mockService - .getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) - .iterator() - .next(); - Assert.assertTrue( - GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey) - .matches()); - } - - @Test - public void deleteUserExceptionTest() throws Exception { - ApiException exception = - ApiExceptionFactory.createException( - new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); - mockService.addException(exception); - - try { - UserName name = UserName.of("[USER]"); - client.deleteUser(name); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void deleteUserTest2() throws Exception { - Empty expectedResponse = Empty.newBuilder().build(); - mockService.addResponse(expectedResponse); - - String name = "users/user-6376"; - - client.deleteUser(name); - - List actualRequests = mockService.getRequestPaths(); - Assert.assertEquals(1, actualRequests.size()); - - String apiClientHeaderKey = - mockService - .getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) - .iterator() - .next(); - Assert.assertTrue( - GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey) - .matches()); - } - - @Test - public void deleteUserExceptionTest2() throws Exception { - ApiException exception = - ApiExceptionFactory.createException( - new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); - mockService.addException(exception); - - try { - String name = "users/user-6376"; - client.deleteUser(name); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void listUsersTest() throws Exception { - User responsesElement = User.newBuilder().build(); - ListUsersResponse expectedResponse = - ListUsersResponse.newBuilder() - .setNextPageToken("") - .addAllUsers(Arrays.asList(responsesElement)) - .build(); - mockService.addResponse(expectedResponse); - - ListUsersRequest request = - ListUsersRequest.newBuilder() - .setPageSize(883849137) - .setPageToken("pageToken873572522") - .build(); - - ListUsersPagedResponse pagedListResponse = client.listUsers(request); - - List resources = Lists.newArrayList(pagedListResponse.iterateAll()); - - Assert.assertEquals(1, resources.size()); - Assert.assertEquals(expectedResponse.getUsersList().get(0), resources.get(0)); - - List actualRequests = mockService.getRequestPaths(); - Assert.assertEquals(1, actualRequests.size()); - - String apiClientHeaderKey = - mockService - .getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) - .iterator() - .next(); - Assert.assertTrue( - GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey) - .matches()); - } - - @Test - public void listUsersExceptionTest() throws Exception { - ApiException exception = - ApiExceptionFactory.createException( - new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); - mockService.addException(exception); - - try { - ListUsersRequest request = - ListUsersRequest.newBuilder() - .setPageSize(883849137) - .setPageToken("pageToken873572522") - .build(); - client.listUsers(request); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } -} diff --git a/showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/IdentityClientTest.java b/showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/IdentityClientTest.java deleted file mode 100644 index acbfbedb75..0000000000 --- a/showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/IdentityClientTest.java +++ /dev/null @@ -1,462 +0,0 @@ -/* - * 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 - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1; - -import static com.google.showcase.v1beta1.IdentityClient.ListUsersPagedResponse; - -import com.google.api.gax.core.NoCredentialsProvider; -import com.google.api.gax.grpc.GaxGrpcProperties; -import com.google.api.gax.grpc.testing.LocalChannelProvider; -import com.google.api.gax.grpc.testing.MockGrpcService; -import com.google.api.gax.grpc.testing.MockServiceHelper; -import com.google.api.gax.rpc.ApiClientHeaderProvider; -import com.google.api.gax.rpc.InvalidArgumentException; -import com.google.common.collect.Lists; -import com.google.protobuf.AbstractMessage; -import com.google.protobuf.Empty; -import com.google.protobuf.FieldMask; -import com.google.protobuf.Timestamp; -import io.grpc.StatusRuntimeException; -import java.io.IOException; -import java.util.Arrays; -import java.util.List; -import java.util.UUID; -import javax.annotation.Generated; -import org.junit.After; -import org.junit.AfterClass; -import org.junit.Assert; -import org.junit.Before; -import org.junit.BeforeClass; -import org.junit.Test; - -@Generated("by gapic-generator-java") -public class IdentityClientTest { - private static MockIdentity mockIdentity; - private static MockServiceHelper mockServiceHelper; - private LocalChannelProvider channelProvider; - private IdentityClient client; - - @BeforeClass - public static void startStaticServer() { - mockIdentity = new MockIdentity(); - mockServiceHelper = - new MockServiceHelper( - UUID.randomUUID().toString(), Arrays.asList(mockIdentity)); - mockServiceHelper.start(); - } - - @AfterClass - public static void stopServer() { - mockServiceHelper.stop(); - } - - @Before - public void setUp() throws IOException { - mockServiceHelper.reset(); - channelProvider = mockServiceHelper.createChannelProvider(); - IdentitySettings settings = - IdentitySettings.newBuilder() - .setTransportChannelProvider(channelProvider) - .setCredentialsProvider(NoCredentialsProvider.create()) - .build(); - client = IdentityClient.create(settings); - } - - @After - public void tearDown() throws Exception { - client.close(); - } - - @Test - public void createUserTest() throws Exception { - User expectedResponse = - User.newBuilder() - .setName(UserName.of("[USER]").toString()) - .setDisplayName("displayName1714148973") - .setEmail("email96619420") - .setCreateTime(Timestamp.newBuilder().build()) - .setUpdateTime(Timestamp.newBuilder().build()) - .setAge(96511) - .setHeightFeet(-1032737338) - .setNickname("nickname70690926") - .setEnableNotifications(true) - .build(); - mockIdentity.addResponse(expectedResponse); - - String displayName = "displayName1714148973"; - String email = "email96619420"; - - User actualResponse = client.createUser(displayName, email); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockIdentity.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - CreateUserRequest actualRequest = ((CreateUserRequest) actualRequests.get(0)); - - Assert.assertEquals(displayName, actualRequest.getUser().getDisplayName()); - Assert.assertEquals(email, actualRequest.getUser().getEmail()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - public void createUserExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); - mockIdentity.addException(exception); - - try { - String displayName = "displayName1714148973"; - String email = "email96619420"; - client.createUser(displayName, email); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void createUserTest2() throws Exception { - User expectedResponse = - User.newBuilder() - .setName(UserName.of("[USER]").toString()) - .setDisplayName("displayName1714148973") - .setEmail("email96619420") - .setCreateTime(Timestamp.newBuilder().build()) - .setUpdateTime(Timestamp.newBuilder().build()) - .setAge(96511) - .setHeightFeet(-1032737338) - .setNickname("nickname70690926") - .setEnableNotifications(true) - .build(); - mockIdentity.addResponse(expectedResponse); - - String displayName = "displayName1714148973"; - String email = "email96619420"; - int age = 96511; - String nickname = "nickname70690926"; - boolean enableNotifications = true; - double heightFeet = -1032737338; - - User actualResponse = - client.createUser(displayName, email, age, nickname, enableNotifications, heightFeet); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockIdentity.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - CreateUserRequest actualRequest = ((CreateUserRequest) actualRequests.get(0)); - - Assert.assertEquals(displayName, actualRequest.getUser().getDisplayName()); - Assert.assertEquals(email, actualRequest.getUser().getEmail()); - Assert.assertEquals(age, actualRequest.getUser().getAge()); - Assert.assertEquals(nickname, actualRequest.getUser().getNickname()); - Assert.assertEquals(enableNotifications, actualRequest.getUser().getEnableNotifications()); - Assert.assertEquals(heightFeet, actualRequest.getUser().getHeightFeet(), 0.0001); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - public void createUserExceptionTest2() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); - mockIdentity.addException(exception); - - try { - String displayName = "displayName1714148973"; - String email = "email96619420"; - int age = 96511; - String nickname = "nickname70690926"; - boolean enableNotifications = true; - double heightFeet = -1032737338; - client.createUser(displayName, email, age, nickname, enableNotifications, heightFeet); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void getUserTest() throws Exception { - User expectedResponse = - User.newBuilder() - .setName(UserName.of("[USER]").toString()) - .setDisplayName("displayName1714148973") - .setEmail("email96619420") - .setCreateTime(Timestamp.newBuilder().build()) - .setUpdateTime(Timestamp.newBuilder().build()) - .setAge(96511) - .setHeightFeet(-1032737338) - .setNickname("nickname70690926") - .setEnableNotifications(true) - .build(); - mockIdentity.addResponse(expectedResponse); - - UserName name = UserName.of("[USER]"); - - User actualResponse = client.getUser(name); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockIdentity.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - GetUserRequest actualRequest = ((GetUserRequest) actualRequests.get(0)); - - Assert.assertEquals(name.toString(), actualRequest.getName()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - public void getUserExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); - mockIdentity.addException(exception); - - try { - UserName name = UserName.of("[USER]"); - client.getUser(name); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void getUserTest2() throws Exception { - User expectedResponse = - User.newBuilder() - .setName(UserName.of("[USER]").toString()) - .setDisplayName("displayName1714148973") - .setEmail("email96619420") - .setCreateTime(Timestamp.newBuilder().build()) - .setUpdateTime(Timestamp.newBuilder().build()) - .setAge(96511) - .setHeightFeet(-1032737338) - .setNickname("nickname70690926") - .setEnableNotifications(true) - .build(); - mockIdentity.addResponse(expectedResponse); - - String name = "name3373707"; - - User actualResponse = client.getUser(name); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockIdentity.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - GetUserRequest actualRequest = ((GetUserRequest) actualRequests.get(0)); - - Assert.assertEquals(name, actualRequest.getName()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - public void getUserExceptionTest2() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); - mockIdentity.addException(exception); - - try { - String name = "name3373707"; - client.getUser(name); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void updateUserTest() throws Exception { - User expectedResponse = - User.newBuilder() - .setName(UserName.of("[USER]").toString()) - .setDisplayName("displayName1714148973") - .setEmail("email96619420") - .setCreateTime(Timestamp.newBuilder().build()) - .setUpdateTime(Timestamp.newBuilder().build()) - .setAge(96511) - .setHeightFeet(-1032737338) - .setNickname("nickname70690926") - .setEnableNotifications(true) - .build(); - mockIdentity.addResponse(expectedResponse); - - UpdateUserRequest request = - UpdateUserRequest.newBuilder() - .setUser(User.newBuilder().build()) - .setUpdateMask(FieldMask.newBuilder().build()) - .build(); - - User actualResponse = client.updateUser(request); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockIdentity.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - UpdateUserRequest actualRequest = ((UpdateUserRequest) actualRequests.get(0)); - - Assert.assertEquals(request.getUser(), actualRequest.getUser()); - Assert.assertEquals(request.getUpdateMask(), actualRequest.getUpdateMask()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - public void updateUserExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); - mockIdentity.addException(exception); - - try { - UpdateUserRequest request = - UpdateUserRequest.newBuilder() - .setUser(User.newBuilder().build()) - .setUpdateMask(FieldMask.newBuilder().build()) - .build(); - client.updateUser(request); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void deleteUserTest() throws Exception { - Empty expectedResponse = Empty.newBuilder().build(); - mockIdentity.addResponse(expectedResponse); - - UserName name = UserName.of("[USER]"); - - client.deleteUser(name); - - List actualRequests = mockIdentity.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - DeleteUserRequest actualRequest = ((DeleteUserRequest) actualRequests.get(0)); - - Assert.assertEquals(name.toString(), actualRequest.getName()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - public void deleteUserExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); - mockIdentity.addException(exception); - - try { - UserName name = UserName.of("[USER]"); - client.deleteUser(name); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void deleteUserTest2() throws Exception { - Empty expectedResponse = Empty.newBuilder().build(); - mockIdentity.addResponse(expectedResponse); - - String name = "name3373707"; - - client.deleteUser(name); - - List actualRequests = mockIdentity.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - DeleteUserRequest actualRequest = ((DeleteUserRequest) actualRequests.get(0)); - - Assert.assertEquals(name, actualRequest.getName()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - public void deleteUserExceptionTest2() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); - mockIdentity.addException(exception); - - try { - String name = "name3373707"; - client.deleteUser(name); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void listUsersTest() throws Exception { - User responsesElement = User.newBuilder().build(); - ListUsersResponse expectedResponse = - ListUsersResponse.newBuilder() - .setNextPageToken("") - .addAllUsers(Arrays.asList(responsesElement)) - .build(); - mockIdentity.addResponse(expectedResponse); - - ListUsersRequest request = - ListUsersRequest.newBuilder() - .setPageSize(883849137) - .setPageToken("pageToken873572522") - .build(); - - ListUsersPagedResponse pagedListResponse = client.listUsers(request); - - List resources = Lists.newArrayList(pagedListResponse.iterateAll()); - - Assert.assertEquals(1, resources.size()); - Assert.assertEquals(expectedResponse.getUsersList().get(0), resources.get(0)); - - List actualRequests = mockIdentity.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - ListUsersRequest actualRequest = ((ListUsersRequest) 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 listUsersExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); - mockIdentity.addException(exception); - - try { - ListUsersRequest request = - ListUsersRequest.newBuilder() - .setPageSize(883849137) - .setPageToken("pageToken873572522") - .build(); - client.listUsers(request); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } -} diff --git a/showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/MessagingClientHttpJsonTest.java b/showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/MessagingClientHttpJsonTest.java deleted file mode 100644 index de062e07f3..0000000000 --- a/showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/MessagingClientHttpJsonTest.java +++ /dev/null @@ -1,1649 +0,0 @@ -/* - * 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 - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1; - -import static com.google.showcase.v1beta1.MessagingClient.ListBlurbsPagedResponse; -import static com.google.showcase.v1beta1.MessagingClient.ListRoomsPagedResponse; - -import com.google.api.gax.core.NoCredentialsProvider; -import com.google.api.gax.httpjson.GaxHttpJsonProperties; -import com.google.api.gax.httpjson.testing.MockHttpService; -import com.google.api.gax.rpc.ApiClientHeaderProvider; -import com.google.api.gax.rpc.ApiException; -import com.google.api.gax.rpc.ApiExceptionFactory; -import com.google.api.gax.rpc.InvalidArgumentException; -import com.google.api.gax.rpc.StatusCode; -import com.google.api.gax.rpc.testing.FakeStatusCode; -import com.google.common.collect.Lists; -import com.google.longrunning.Operation; -import com.google.protobuf.Any; -import com.google.protobuf.ByteString; -import com.google.protobuf.Empty; -import com.google.protobuf.FieldMask; -import com.google.protobuf.Timestamp; -import com.google.showcase.v1beta1.stub.HttpJsonMessagingStub; -import java.io.IOException; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; -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 MessagingClientHttpJsonTest { - private static MockHttpService mockService; - private static MessagingClient client; - - @BeforeClass - public static void startStaticServer() throws IOException { - mockService = - new MockHttpService( - HttpJsonMessagingStub.getMethodDescriptors(), MessagingSettings.getDefaultEndpoint()); - MessagingSettings settings = - MessagingSettings.newHttpJsonBuilder() - .setTransportChannelProvider( - MessagingSettings.defaultHttpJsonTransportProviderBuilder() - .setHttpTransport(mockService) - .build()) - .setCredentialsProvider(NoCredentialsProvider.create()) - .build(); - client = MessagingClient.create(settings); - } - - @AfterClass - public static void stopServer() { - client.close(); - } - - @Before - public void setUp() {} - - @After - public void tearDown() throws Exception { - mockService.reset(); - } - - @Test - public void createRoomTest() throws Exception { - Room expectedResponse = - Room.newBuilder() - .setName(RoomName.of("[ROOM]").toString()) - .setDisplayName("displayName1714148973") - .setDescription("description-1724546052") - .setCreateTime(Timestamp.newBuilder().build()) - .setUpdateTime(Timestamp.newBuilder().build()) - .build(); - mockService.addResponse(expectedResponse); - - String displayName = "displayName1714148973"; - String description = "description-1724546052"; - - Room actualResponse = client.createRoom(displayName, description); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockService.getRequestPaths(); - Assert.assertEquals(1, actualRequests.size()); - - String apiClientHeaderKey = - mockService - .getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) - .iterator() - .next(); - Assert.assertTrue( - GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey) - .matches()); - } - - @Test - public void createRoomExceptionTest() throws Exception { - ApiException exception = - ApiExceptionFactory.createException( - new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); - mockService.addException(exception); - - try { - String displayName = "displayName1714148973"; - String description = "description-1724546052"; - client.createRoom(displayName, description); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void getRoomTest() throws Exception { - Room expectedResponse = - Room.newBuilder() - .setName(RoomName.of("[ROOM]").toString()) - .setDisplayName("displayName1714148973") - .setDescription("description-1724546052") - .setCreateTime(Timestamp.newBuilder().build()) - .setUpdateTime(Timestamp.newBuilder().build()) - .build(); - mockService.addResponse(expectedResponse); - - RoomName name = RoomName.of("[ROOM]"); - - Room actualResponse = client.getRoom(name); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockService.getRequestPaths(); - Assert.assertEquals(1, actualRequests.size()); - - String apiClientHeaderKey = - mockService - .getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) - .iterator() - .next(); - Assert.assertTrue( - GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey) - .matches()); - } - - @Test - public void getRoomExceptionTest() throws Exception { - ApiException exception = - ApiExceptionFactory.createException( - new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); - mockService.addException(exception); - - try { - RoomName name = RoomName.of("[ROOM]"); - client.getRoom(name); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void getRoomTest2() throws Exception { - Room expectedResponse = - Room.newBuilder() - .setName(RoomName.of("[ROOM]").toString()) - .setDisplayName("displayName1714148973") - .setDescription("description-1724546052") - .setCreateTime(Timestamp.newBuilder().build()) - .setUpdateTime(Timestamp.newBuilder().build()) - .build(); - mockService.addResponse(expectedResponse); - - String name = "rooms/room-472"; - - Room actualResponse = client.getRoom(name); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockService.getRequestPaths(); - Assert.assertEquals(1, actualRequests.size()); - - String apiClientHeaderKey = - mockService - .getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) - .iterator() - .next(); - Assert.assertTrue( - GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey) - .matches()); - } - - @Test - public void getRoomExceptionTest2() throws Exception { - ApiException exception = - ApiExceptionFactory.createException( - new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); - mockService.addException(exception); - - try { - String name = "rooms/room-472"; - client.getRoom(name); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void updateRoomTest() throws Exception { - Room expectedResponse = - Room.newBuilder() - .setName(RoomName.of("[ROOM]").toString()) - .setDisplayName("displayName1714148973") - .setDescription("description-1724546052") - .setCreateTime(Timestamp.newBuilder().build()) - .setUpdateTime(Timestamp.newBuilder().build()) - .build(); - mockService.addResponse(expectedResponse); - - UpdateRoomRequest request = - UpdateRoomRequest.newBuilder() - .setRoom( - Room.newBuilder() - .setName(RoomName.of("[ROOM]").toString()) - .setDisplayName("displayName1714148973") - .setDescription("description-1724546052") - .setCreateTime(Timestamp.newBuilder().build()) - .setUpdateTime(Timestamp.newBuilder().build()) - .build()) - .setUpdateMask(FieldMask.newBuilder().build()) - .build(); - - Room actualResponse = client.updateRoom(request); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockService.getRequestPaths(); - Assert.assertEquals(1, actualRequests.size()); - - String apiClientHeaderKey = - mockService - .getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) - .iterator() - .next(); - Assert.assertTrue( - GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey) - .matches()); - } - - @Test - public void updateRoomExceptionTest() throws Exception { - ApiException exception = - ApiExceptionFactory.createException( - new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); - mockService.addException(exception); - - try { - UpdateRoomRequest request = - UpdateRoomRequest.newBuilder() - .setRoom( - Room.newBuilder() - .setName(RoomName.of("[ROOM]").toString()) - .setDisplayName("displayName1714148973") - .setDescription("description-1724546052") - .setCreateTime(Timestamp.newBuilder().build()) - .setUpdateTime(Timestamp.newBuilder().build()) - .build()) - .setUpdateMask(FieldMask.newBuilder().build()) - .build(); - client.updateRoom(request); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void deleteRoomTest() throws Exception { - Empty expectedResponse = Empty.newBuilder().build(); - mockService.addResponse(expectedResponse); - - RoomName name = RoomName.of("[ROOM]"); - - client.deleteRoom(name); - - List actualRequests = mockService.getRequestPaths(); - Assert.assertEquals(1, actualRequests.size()); - - String apiClientHeaderKey = - mockService - .getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) - .iterator() - .next(); - Assert.assertTrue( - GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey) - .matches()); - } - - @Test - public void deleteRoomExceptionTest() throws Exception { - ApiException exception = - ApiExceptionFactory.createException( - new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); - mockService.addException(exception); - - try { - RoomName name = RoomName.of("[ROOM]"); - client.deleteRoom(name); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void deleteRoomTest2() throws Exception { - Empty expectedResponse = Empty.newBuilder().build(); - mockService.addResponse(expectedResponse); - - String name = "rooms/room-472"; - - client.deleteRoom(name); - - List actualRequests = mockService.getRequestPaths(); - Assert.assertEquals(1, actualRequests.size()); - - String apiClientHeaderKey = - mockService - .getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) - .iterator() - .next(); - Assert.assertTrue( - GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey) - .matches()); - } - - @Test - public void deleteRoomExceptionTest2() throws Exception { - ApiException exception = - ApiExceptionFactory.createException( - new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); - mockService.addException(exception); - - try { - String name = "rooms/room-472"; - client.deleteRoom(name); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void listRoomsTest() throws Exception { - Room responsesElement = Room.newBuilder().build(); - ListRoomsResponse expectedResponse = - ListRoomsResponse.newBuilder() - .setNextPageToken("") - .addAllRooms(Arrays.asList(responsesElement)) - .build(); - mockService.addResponse(expectedResponse); - - ListRoomsRequest request = - ListRoomsRequest.newBuilder() - .setPageSize(883849137) - .setPageToken("pageToken873572522") - .build(); - - ListRoomsPagedResponse pagedListResponse = client.listRooms(request); - - List resources = Lists.newArrayList(pagedListResponse.iterateAll()); - - Assert.assertEquals(1, resources.size()); - Assert.assertEquals(expectedResponse.getRoomsList().get(0), resources.get(0)); - - List actualRequests = mockService.getRequestPaths(); - Assert.assertEquals(1, actualRequests.size()); - - String apiClientHeaderKey = - mockService - .getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) - .iterator() - .next(); - Assert.assertTrue( - GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey) - .matches()); - } - - @Test - public void listRoomsExceptionTest() throws Exception { - ApiException exception = - ApiExceptionFactory.createException( - new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); - mockService.addException(exception); - - try { - ListRoomsRequest request = - ListRoomsRequest.newBuilder() - .setPageSize(883849137) - .setPageToken("pageToken873572522") - .build(); - client.listRooms(request); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void createBlurbTest() throws Exception { - Blurb expectedResponse = - Blurb.newBuilder() - .setName( - BlurbName.ofUserLegacyUserBlurbName("[USER]", "[LEGACY_USER]", "[BLURB]") - .toString()) - .setUser(UserName.of("[USER]").toString()) - .setCreateTime(Timestamp.newBuilder().build()) - .setUpdateTime(Timestamp.newBuilder().build()) - .build(); - mockService.addResponse(expectedResponse); - - ProfileName parent = ProfileName.of("[USER]"); - UserName user = UserName.of("[USER]"); - ByteString image = ByteString.EMPTY; - - Blurb actualResponse = client.createBlurb(parent, user, image); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockService.getRequestPaths(); - Assert.assertEquals(1, actualRequests.size()); - - String apiClientHeaderKey = - mockService - .getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) - .iterator() - .next(); - Assert.assertTrue( - GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey) - .matches()); - } - - @Test - public void createBlurbExceptionTest() throws Exception { - ApiException exception = - ApiExceptionFactory.createException( - new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); - mockService.addException(exception); - - try { - ProfileName parent = ProfileName.of("[USER]"); - UserName user = UserName.of("[USER]"); - ByteString image = ByteString.EMPTY; - client.createBlurb(parent, user, image); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void createBlurbTest2() throws Exception { - Blurb expectedResponse = - Blurb.newBuilder() - .setName( - BlurbName.ofUserLegacyUserBlurbName("[USER]", "[LEGACY_USER]", "[BLURB]") - .toString()) - .setUser(UserName.of("[USER]").toString()) - .setCreateTime(Timestamp.newBuilder().build()) - .setUpdateTime(Timestamp.newBuilder().build()) - .build(); - mockService.addResponse(expectedResponse); - - ProfileName parent = ProfileName.of("[USER]"); - UserName user = UserName.of("[USER]"); - String text = "text3556653"; - - Blurb actualResponse = client.createBlurb(parent, user, text); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockService.getRequestPaths(); - Assert.assertEquals(1, actualRequests.size()); - - String apiClientHeaderKey = - mockService - .getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) - .iterator() - .next(); - Assert.assertTrue( - GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey) - .matches()); - } - - @Test - public void createBlurbExceptionTest2() throws Exception { - ApiException exception = - ApiExceptionFactory.createException( - new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); - mockService.addException(exception); - - try { - ProfileName parent = ProfileName.of("[USER]"); - UserName user = UserName.of("[USER]"); - String text = "text3556653"; - client.createBlurb(parent, user, text); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void createBlurbTest3() throws Exception { - Blurb expectedResponse = - Blurb.newBuilder() - .setName( - BlurbName.ofUserLegacyUserBlurbName("[USER]", "[LEGACY_USER]", "[BLURB]") - .toString()) - .setUser(UserName.of("[USER]").toString()) - .setCreateTime(Timestamp.newBuilder().build()) - .setUpdateTime(Timestamp.newBuilder().build()) - .build(); - mockService.addResponse(expectedResponse); - - ProfileName parent = ProfileName.of("[USER]"); - String user = "user3599307"; - ByteString image = ByteString.EMPTY; - - Blurb actualResponse = client.createBlurb(parent, user, image); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockService.getRequestPaths(); - Assert.assertEquals(1, actualRequests.size()); - - String apiClientHeaderKey = - mockService - .getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) - .iterator() - .next(); - Assert.assertTrue( - GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey) - .matches()); - } - - @Test - public void createBlurbExceptionTest3() throws Exception { - ApiException exception = - ApiExceptionFactory.createException( - new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); - mockService.addException(exception); - - try { - ProfileName parent = ProfileName.of("[USER]"); - String user = "user3599307"; - ByteString image = ByteString.EMPTY; - client.createBlurb(parent, user, image); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void createBlurbTest4() throws Exception { - Blurb expectedResponse = - Blurb.newBuilder() - .setName( - BlurbName.ofUserLegacyUserBlurbName("[USER]", "[LEGACY_USER]", "[BLURB]") - .toString()) - .setUser(UserName.of("[USER]").toString()) - .setCreateTime(Timestamp.newBuilder().build()) - .setUpdateTime(Timestamp.newBuilder().build()) - .build(); - mockService.addResponse(expectedResponse); - - ProfileName parent = ProfileName.of("[USER]"); - String user = "user3599307"; - String text = "text3556653"; - - Blurb actualResponse = client.createBlurb(parent, user, text); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockService.getRequestPaths(); - Assert.assertEquals(1, actualRequests.size()); - - String apiClientHeaderKey = - mockService - .getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) - .iterator() - .next(); - Assert.assertTrue( - GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey) - .matches()); - } - - @Test - public void createBlurbExceptionTest4() throws Exception { - ApiException exception = - ApiExceptionFactory.createException( - new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); - mockService.addException(exception); - - try { - ProfileName parent = ProfileName.of("[USER]"); - String user = "user3599307"; - String text = "text3556653"; - client.createBlurb(parent, user, text); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void createBlurbTest5() throws Exception { - Blurb expectedResponse = - Blurb.newBuilder() - .setName( - BlurbName.ofUserLegacyUserBlurbName("[USER]", "[LEGACY_USER]", "[BLURB]") - .toString()) - .setUser(UserName.of("[USER]").toString()) - .setCreateTime(Timestamp.newBuilder().build()) - .setUpdateTime(Timestamp.newBuilder().build()) - .build(); - mockService.addResponse(expectedResponse); - - RoomName parent = RoomName.of("[ROOM]"); - UserName user = UserName.of("[USER]"); - ByteString image = ByteString.EMPTY; - - Blurb actualResponse = client.createBlurb(parent, user, image); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockService.getRequestPaths(); - Assert.assertEquals(1, actualRequests.size()); - - String apiClientHeaderKey = - mockService - .getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) - .iterator() - .next(); - Assert.assertTrue( - GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey) - .matches()); - } - - @Test - public void createBlurbExceptionTest5() throws Exception { - ApiException exception = - ApiExceptionFactory.createException( - new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); - mockService.addException(exception); - - try { - RoomName parent = RoomName.of("[ROOM]"); - UserName user = UserName.of("[USER]"); - ByteString image = ByteString.EMPTY; - client.createBlurb(parent, user, image); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void createBlurbTest6() throws Exception { - Blurb expectedResponse = - Blurb.newBuilder() - .setName( - BlurbName.ofUserLegacyUserBlurbName("[USER]", "[LEGACY_USER]", "[BLURB]") - .toString()) - .setUser(UserName.of("[USER]").toString()) - .setCreateTime(Timestamp.newBuilder().build()) - .setUpdateTime(Timestamp.newBuilder().build()) - .build(); - mockService.addResponse(expectedResponse); - - RoomName parent = RoomName.of("[ROOM]"); - UserName user = UserName.of("[USER]"); - String text = "text3556653"; - - Blurb actualResponse = client.createBlurb(parent, user, text); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockService.getRequestPaths(); - Assert.assertEquals(1, actualRequests.size()); - - String apiClientHeaderKey = - mockService - .getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) - .iterator() - .next(); - Assert.assertTrue( - GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey) - .matches()); - } - - @Test - public void createBlurbExceptionTest6() throws Exception { - ApiException exception = - ApiExceptionFactory.createException( - new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); - mockService.addException(exception); - - try { - RoomName parent = RoomName.of("[ROOM]"); - UserName user = UserName.of("[USER]"); - String text = "text3556653"; - client.createBlurb(parent, user, text); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void createBlurbTest7() throws Exception { - Blurb expectedResponse = - Blurb.newBuilder() - .setName( - BlurbName.ofUserLegacyUserBlurbName("[USER]", "[LEGACY_USER]", "[BLURB]") - .toString()) - .setUser(UserName.of("[USER]").toString()) - .setCreateTime(Timestamp.newBuilder().build()) - .setUpdateTime(Timestamp.newBuilder().build()) - .build(); - mockService.addResponse(expectedResponse); - - RoomName parent = RoomName.of("[ROOM]"); - String user = "user3599307"; - ByteString image = ByteString.EMPTY; - - Blurb actualResponse = client.createBlurb(parent, user, image); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockService.getRequestPaths(); - Assert.assertEquals(1, actualRequests.size()); - - String apiClientHeaderKey = - mockService - .getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) - .iterator() - .next(); - Assert.assertTrue( - GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey) - .matches()); - } - - @Test - public void createBlurbExceptionTest7() throws Exception { - ApiException exception = - ApiExceptionFactory.createException( - new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); - mockService.addException(exception); - - try { - RoomName parent = RoomName.of("[ROOM]"); - String user = "user3599307"; - ByteString image = ByteString.EMPTY; - client.createBlurb(parent, user, image); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void createBlurbTest8() throws Exception { - Blurb expectedResponse = - Blurb.newBuilder() - .setName( - BlurbName.ofUserLegacyUserBlurbName("[USER]", "[LEGACY_USER]", "[BLURB]") - .toString()) - .setUser(UserName.of("[USER]").toString()) - .setCreateTime(Timestamp.newBuilder().build()) - .setUpdateTime(Timestamp.newBuilder().build()) - .build(); - mockService.addResponse(expectedResponse); - - RoomName parent = RoomName.of("[ROOM]"); - String user = "user3599307"; - String text = "text3556653"; - - Blurb actualResponse = client.createBlurb(parent, user, text); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockService.getRequestPaths(); - Assert.assertEquals(1, actualRequests.size()); - - String apiClientHeaderKey = - mockService - .getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) - .iterator() - .next(); - Assert.assertTrue( - GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey) - .matches()); - } - - @Test - public void createBlurbExceptionTest8() throws Exception { - ApiException exception = - ApiExceptionFactory.createException( - new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); - mockService.addException(exception); - - try { - RoomName parent = RoomName.of("[ROOM]"); - String user = "user3599307"; - String text = "text3556653"; - client.createBlurb(parent, user, text); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void createBlurbTest9() throws Exception { - Blurb expectedResponse = - Blurb.newBuilder() - .setName( - BlurbName.ofUserLegacyUserBlurbName("[USER]", "[LEGACY_USER]", "[BLURB]") - .toString()) - .setUser(UserName.of("[USER]").toString()) - .setCreateTime(Timestamp.newBuilder().build()) - .setUpdateTime(Timestamp.newBuilder().build()) - .build(); - mockService.addResponse(expectedResponse); - - String parent = "rooms/room-4889"; - UserName user = UserName.of("[USER]"); - ByteString image = ByteString.EMPTY; - - Blurb actualResponse = client.createBlurb(parent, user, image); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockService.getRequestPaths(); - Assert.assertEquals(1, actualRequests.size()); - - String apiClientHeaderKey = - mockService - .getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) - .iterator() - .next(); - Assert.assertTrue( - GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey) - .matches()); - } - - @Test - public void createBlurbExceptionTest9() throws Exception { - ApiException exception = - ApiExceptionFactory.createException( - new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); - mockService.addException(exception); - - try { - String parent = "rooms/room-4889"; - UserName user = UserName.of("[USER]"); - ByteString image = ByteString.EMPTY; - client.createBlurb(parent, user, image); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void createBlurbTest10() throws Exception { - Blurb expectedResponse = - Blurb.newBuilder() - .setName( - BlurbName.ofUserLegacyUserBlurbName("[USER]", "[LEGACY_USER]", "[BLURB]") - .toString()) - .setUser(UserName.of("[USER]").toString()) - .setCreateTime(Timestamp.newBuilder().build()) - .setUpdateTime(Timestamp.newBuilder().build()) - .build(); - mockService.addResponse(expectedResponse); - - String parent = "rooms/room-4889"; - UserName user = UserName.of("[USER]"); - String text = "text3556653"; - - Blurb actualResponse = client.createBlurb(parent, user, text); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockService.getRequestPaths(); - Assert.assertEquals(1, actualRequests.size()); - - String apiClientHeaderKey = - mockService - .getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) - .iterator() - .next(); - Assert.assertTrue( - GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey) - .matches()); - } - - @Test - public void createBlurbExceptionTest10() throws Exception { - ApiException exception = - ApiExceptionFactory.createException( - new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); - mockService.addException(exception); - - try { - String parent = "rooms/room-4889"; - UserName user = UserName.of("[USER]"); - String text = "text3556653"; - client.createBlurb(parent, user, text); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void createBlurbTest11() throws Exception { - Blurb expectedResponse = - Blurb.newBuilder() - .setName( - BlurbName.ofUserLegacyUserBlurbName("[USER]", "[LEGACY_USER]", "[BLURB]") - .toString()) - .setUser(UserName.of("[USER]").toString()) - .setCreateTime(Timestamp.newBuilder().build()) - .setUpdateTime(Timestamp.newBuilder().build()) - .build(); - mockService.addResponse(expectedResponse); - - String parent = "rooms/room-4889"; - String user = "user3599307"; - ByteString image = ByteString.EMPTY; - - Blurb actualResponse = client.createBlurb(parent, user, image); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockService.getRequestPaths(); - Assert.assertEquals(1, actualRequests.size()); - - String apiClientHeaderKey = - mockService - .getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) - .iterator() - .next(); - Assert.assertTrue( - GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey) - .matches()); - } - - @Test - public void createBlurbExceptionTest11() throws Exception { - ApiException exception = - ApiExceptionFactory.createException( - new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); - mockService.addException(exception); - - try { - String parent = "rooms/room-4889"; - String user = "user3599307"; - ByteString image = ByteString.EMPTY; - client.createBlurb(parent, user, image); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void createBlurbTest12() throws Exception { - Blurb expectedResponse = - Blurb.newBuilder() - .setName( - BlurbName.ofUserLegacyUserBlurbName("[USER]", "[LEGACY_USER]", "[BLURB]") - .toString()) - .setUser(UserName.of("[USER]").toString()) - .setCreateTime(Timestamp.newBuilder().build()) - .setUpdateTime(Timestamp.newBuilder().build()) - .build(); - mockService.addResponse(expectedResponse); - - String parent = "rooms/room-4889"; - String user = "user3599307"; - String text = "text3556653"; - - Blurb actualResponse = client.createBlurb(parent, user, text); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockService.getRequestPaths(); - Assert.assertEquals(1, actualRequests.size()); - - String apiClientHeaderKey = - mockService - .getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) - .iterator() - .next(); - Assert.assertTrue( - GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey) - .matches()); - } - - @Test - public void createBlurbExceptionTest12() throws Exception { - ApiException exception = - ApiExceptionFactory.createException( - new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); - mockService.addException(exception); - - try { - String parent = "rooms/room-4889"; - String user = "user3599307"; - String text = "text3556653"; - client.createBlurb(parent, user, text); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void getBlurbTest() throws Exception { - Blurb expectedResponse = - Blurb.newBuilder() - .setName(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString()) - .setUser(UserName.of("[USER]").toString()) - .setCreateTime(Timestamp.newBuilder().build()) - .setUpdateTime(Timestamp.newBuilder().build()) - .build(); - mockService.addResponse(expectedResponse); - - BlurbName name = BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]"); - - Blurb actualResponse = client.getBlurb(name); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockService.getRequestPaths(); - Assert.assertEquals(1, actualRequests.size()); - - String apiClientHeaderKey = - mockService - .getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) - .iterator() - .next(); - Assert.assertTrue( - GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey) - .matches()); - } - - @Test - public void getBlurbExceptionTest() throws Exception { - ApiException exception = - ApiExceptionFactory.createException( - new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); - mockService.addException(exception); - - try { - BlurbName name = BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]"); - client.getBlurb(name); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void getBlurbTest2() throws Exception { - Blurb expectedResponse = - Blurb.newBuilder() - .setName(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString()) - .setUser(UserName.of("[USER]").toString()) - .setCreateTime(Timestamp.newBuilder().build()) - .setUpdateTime(Timestamp.newBuilder().build()) - .build(); - mockService.addResponse(expectedResponse); - - String name = "rooms/room-9094/blurbs/blurb-9094"; - - Blurb actualResponse = client.getBlurb(name); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockService.getRequestPaths(); - Assert.assertEquals(1, actualRequests.size()); - - String apiClientHeaderKey = - mockService - .getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) - .iterator() - .next(); - Assert.assertTrue( - GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey) - .matches()); - } - - @Test - public void getBlurbExceptionTest2() throws Exception { - ApiException exception = - ApiExceptionFactory.createException( - new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); - mockService.addException(exception); - - try { - String name = "rooms/room-9094/blurbs/blurb-9094"; - client.getBlurb(name); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void updateBlurbTest() throws Exception { - Blurb expectedResponse = - Blurb.newBuilder() - .setName(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString()) - .setUser(UserName.of("[USER]").toString()) - .setCreateTime(Timestamp.newBuilder().build()) - .setUpdateTime(Timestamp.newBuilder().build()) - .build(); - mockService.addResponse(expectedResponse); - - UpdateBlurbRequest request = - UpdateBlurbRequest.newBuilder() - .setBlurb( - Blurb.newBuilder() - .setName( - BlurbName.ofUserLegacyUserBlurbName("[USER]", "[LEGACY_USER]", "[BLURB]") - .toString()) - .setUser(UserName.of("[USER]").toString()) - .setCreateTime(Timestamp.newBuilder().build()) - .setUpdateTime(Timestamp.newBuilder().build()) - .build()) - .setUpdateMask(FieldMask.newBuilder().build()) - .build(); - - Blurb actualResponse = client.updateBlurb(request); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockService.getRequestPaths(); - Assert.assertEquals(1, actualRequests.size()); - - String apiClientHeaderKey = - mockService - .getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) - .iterator() - .next(); - Assert.assertTrue( - GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey) - .matches()); - } - - @Test - public void updateBlurbExceptionTest() throws Exception { - ApiException exception = - ApiExceptionFactory.createException( - new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); - mockService.addException(exception); - - try { - UpdateBlurbRequest request = - UpdateBlurbRequest.newBuilder() - .setBlurb( - Blurb.newBuilder() - .setName( - BlurbName.ofUserLegacyUserBlurbName("[USER]", "[LEGACY_USER]", "[BLURB]") - .toString()) - .setUser(UserName.of("[USER]").toString()) - .setCreateTime(Timestamp.newBuilder().build()) - .setUpdateTime(Timestamp.newBuilder().build()) - .build()) - .setUpdateMask(FieldMask.newBuilder().build()) - .build(); - client.updateBlurb(request); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void deleteBlurbTest() throws Exception { - Empty expectedResponse = Empty.newBuilder().build(); - mockService.addResponse(expectedResponse); - - BlurbName name = BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]"); - - client.deleteBlurb(name); - - List actualRequests = mockService.getRequestPaths(); - Assert.assertEquals(1, actualRequests.size()); - - String apiClientHeaderKey = - mockService - .getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) - .iterator() - .next(); - Assert.assertTrue( - GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey) - .matches()); - } - - @Test - public void deleteBlurbExceptionTest() throws Exception { - ApiException exception = - ApiExceptionFactory.createException( - new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); - mockService.addException(exception); - - try { - BlurbName name = BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]"); - client.deleteBlurb(name); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void deleteBlurbTest2() throws Exception { - Empty expectedResponse = Empty.newBuilder().build(); - mockService.addResponse(expectedResponse); - - String name = "rooms/room-9094/blurbs/blurb-9094"; - - client.deleteBlurb(name); - - List actualRequests = mockService.getRequestPaths(); - Assert.assertEquals(1, actualRequests.size()); - - String apiClientHeaderKey = - mockService - .getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) - .iterator() - .next(); - Assert.assertTrue( - GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey) - .matches()); - } - - @Test - public void deleteBlurbExceptionTest2() throws Exception { - ApiException exception = - ApiExceptionFactory.createException( - new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); - mockService.addException(exception); - - try { - String name = "rooms/room-9094/blurbs/blurb-9094"; - client.deleteBlurb(name); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void listBlurbsTest() throws Exception { - Blurb responsesElement = Blurb.newBuilder().build(); - ListBlurbsResponse expectedResponse = - ListBlurbsResponse.newBuilder() - .setNextPageToken("") - .addAllBlurbs(Arrays.asList(responsesElement)) - .build(); - mockService.addResponse(expectedResponse); - - ProfileName parent = ProfileName.of("[USER]"); - - ListBlurbsPagedResponse pagedListResponse = client.listBlurbs(parent); - - List resources = Lists.newArrayList(pagedListResponse.iterateAll()); - - Assert.assertEquals(1, resources.size()); - Assert.assertEquals(expectedResponse.getBlurbsList().get(0), resources.get(0)); - - List actualRequests = mockService.getRequestPaths(); - Assert.assertEquals(1, actualRequests.size()); - - String apiClientHeaderKey = - mockService - .getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) - .iterator() - .next(); - Assert.assertTrue( - GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey) - .matches()); - } - - @Test - public void listBlurbsExceptionTest() throws Exception { - ApiException exception = - ApiExceptionFactory.createException( - new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); - mockService.addException(exception); - - try { - ProfileName parent = ProfileName.of("[USER]"); - client.listBlurbs(parent); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void listBlurbsTest2() throws Exception { - Blurb responsesElement = Blurb.newBuilder().build(); - ListBlurbsResponse expectedResponse = - ListBlurbsResponse.newBuilder() - .setNextPageToken("") - .addAllBlurbs(Arrays.asList(responsesElement)) - .build(); - mockService.addResponse(expectedResponse); - - RoomName parent = RoomName.of("[ROOM]"); - - ListBlurbsPagedResponse pagedListResponse = client.listBlurbs(parent); - - List resources = Lists.newArrayList(pagedListResponse.iterateAll()); - - Assert.assertEquals(1, resources.size()); - Assert.assertEquals(expectedResponse.getBlurbsList().get(0), resources.get(0)); - - List actualRequests = mockService.getRequestPaths(); - Assert.assertEquals(1, actualRequests.size()); - - String apiClientHeaderKey = - mockService - .getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) - .iterator() - .next(); - Assert.assertTrue( - GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey) - .matches()); - } - - @Test - public void listBlurbsExceptionTest2() throws Exception { - ApiException exception = - ApiExceptionFactory.createException( - new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); - mockService.addException(exception); - - try { - RoomName parent = RoomName.of("[ROOM]"); - client.listBlurbs(parent); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void listBlurbsTest3() throws Exception { - Blurb responsesElement = Blurb.newBuilder().build(); - ListBlurbsResponse expectedResponse = - ListBlurbsResponse.newBuilder() - .setNextPageToken("") - .addAllBlurbs(Arrays.asList(responsesElement)) - .build(); - mockService.addResponse(expectedResponse); - - String parent = "rooms/room-4889"; - - ListBlurbsPagedResponse pagedListResponse = client.listBlurbs(parent); - - List resources = Lists.newArrayList(pagedListResponse.iterateAll()); - - Assert.assertEquals(1, resources.size()); - Assert.assertEquals(expectedResponse.getBlurbsList().get(0), resources.get(0)); - - List actualRequests = mockService.getRequestPaths(); - Assert.assertEquals(1, actualRequests.size()); - - String apiClientHeaderKey = - mockService - .getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) - .iterator() - .next(); - Assert.assertTrue( - GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey) - .matches()); - } - - @Test - public void listBlurbsExceptionTest3() throws Exception { - ApiException exception = - ApiExceptionFactory.createException( - new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); - mockService.addException(exception); - - try { - String parent = "rooms/room-4889"; - client.listBlurbs(parent); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void searchBlurbsTest() throws Exception { - SearchBlurbsResponse expectedResponse = - SearchBlurbsResponse.newBuilder() - .addAllBlurbs(new ArrayList()) - .setNextPageToken("nextPageToken-1386094857") - .build(); - Operation resultOperation = - Operation.newBuilder() - .setName("searchBlurbsTest") - .setDone(true) - .setResponse(Any.pack(expectedResponse)) - .build(); - mockService.addResponse(resultOperation); - - ProfileName parent = ProfileName.of("[USER]"); - String query = "query107944136"; - - SearchBlurbsResponse actualResponse = client.searchBlurbsAsync(parent, query).get(); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockService.getRequestPaths(); - Assert.assertEquals(1, actualRequests.size()); - - String apiClientHeaderKey = - mockService - .getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) - .iterator() - .next(); - Assert.assertTrue( - GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey) - .matches()); - } - - @Test - public void searchBlurbsExceptionTest() throws Exception { - ApiException exception = - ApiExceptionFactory.createException( - new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); - mockService.addException(exception); - - try { - ProfileName parent = ProfileName.of("[USER]"); - String query = "query107944136"; - client.searchBlurbsAsync(parent, query).get(); - Assert.fail("No exception raised"); - } catch (ExecutionException e) { - } - } - - @Test - public void searchBlurbsTest2() throws Exception { - SearchBlurbsResponse expectedResponse = - SearchBlurbsResponse.newBuilder() - .addAllBlurbs(new ArrayList()) - .setNextPageToken("nextPageToken-1386094857") - .build(); - Operation resultOperation = - Operation.newBuilder() - .setName("searchBlurbsTest") - .setDone(true) - .setResponse(Any.pack(expectedResponse)) - .build(); - mockService.addResponse(resultOperation); - - RoomName parent = RoomName.of("[ROOM]"); - String query = "query107944136"; - - SearchBlurbsResponse actualResponse = client.searchBlurbsAsync(parent, query).get(); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockService.getRequestPaths(); - Assert.assertEquals(1, actualRequests.size()); - - String apiClientHeaderKey = - mockService - .getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) - .iterator() - .next(); - Assert.assertTrue( - GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey) - .matches()); - } - - @Test - public void searchBlurbsExceptionTest2() throws Exception { - ApiException exception = - ApiExceptionFactory.createException( - new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); - mockService.addException(exception); - - try { - RoomName parent = RoomName.of("[ROOM]"); - String query = "query107944136"; - client.searchBlurbsAsync(parent, query).get(); - Assert.fail("No exception raised"); - } catch (ExecutionException e) { - } - } - - @Test - public void searchBlurbsTest3() throws Exception { - SearchBlurbsResponse expectedResponse = - SearchBlurbsResponse.newBuilder() - .addAllBlurbs(new ArrayList()) - .setNextPageToken("nextPageToken-1386094857") - .build(); - Operation resultOperation = - Operation.newBuilder() - .setName("searchBlurbsTest") - .setDone(true) - .setResponse(Any.pack(expectedResponse)) - .build(); - mockService.addResponse(resultOperation); - - String parent = "rooms/room-4889"; - String query = "query107944136"; - - SearchBlurbsResponse actualResponse = client.searchBlurbsAsync(parent, query).get(); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockService.getRequestPaths(); - Assert.assertEquals(1, actualRequests.size()); - - String apiClientHeaderKey = - mockService - .getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) - .iterator() - .next(); - Assert.assertTrue( - GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey) - .matches()); - } - - @Test - public void searchBlurbsExceptionTest3() throws Exception { - ApiException exception = - ApiExceptionFactory.createException( - new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); - mockService.addException(exception); - - try { - String parent = "rooms/room-4889"; - String query = "query107944136"; - client.searchBlurbsAsync(parent, query).get(); - Assert.fail("No exception raised"); - } catch (ExecutionException e) { - } - } - - @Test - public void streamBlurbsTest() throws Exception {} - - @Test - public void streamBlurbsExceptionTest() throws Exception { - ApiException exception = - ApiExceptionFactory.createException( - new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); - mockService.addException(exception); - } - - @Test - public void sendBlurbsUnsupportedMethodTest() throws Exception { - // The sendBlurbs() method is not supported in REST transport. - // This empty test is generated for technical reasons. - } - - @Test - public void connectUnsupportedMethodTest() throws Exception { - // The connect() method is not supported in REST transport. - // This empty test is generated for technical reasons. - } -} diff --git a/showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/MessagingClientTest.java b/showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/MessagingClientTest.java deleted file mode 100644 index 0f4e531141..0000000000 --- a/showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/MessagingClientTest.java +++ /dev/null @@ -1,1614 +0,0 @@ -/* - * 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 - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1; - -import static com.google.showcase.v1beta1.MessagingClient.ListBlurbsPagedResponse; -import static com.google.showcase.v1beta1.MessagingClient.ListRoomsPagedResponse; - -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.ClientStreamingCallable; -import com.google.api.gax.rpc.InvalidArgumentException; -import com.google.api.gax.rpc.ServerStreamingCallable; -import com.google.api.gax.rpc.StatusCode; -import com.google.common.collect.Lists; -import com.google.longrunning.Operation; -import com.google.protobuf.AbstractMessage; -import com.google.protobuf.Any; -import com.google.protobuf.ByteString; -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 MessagingClientTest { - private static MockMessaging mockMessaging; - private static MockServiceHelper mockServiceHelper; - private LocalChannelProvider channelProvider; - private MessagingClient client; - - @BeforeClass - public static void startStaticServer() { - mockMessaging = new MockMessaging(); - mockServiceHelper = - new MockServiceHelper( - UUID.randomUUID().toString(), Arrays.asList(mockMessaging)); - mockServiceHelper.start(); - } - - @AfterClass - public static void stopServer() { - mockServiceHelper.stop(); - } - - @Before - public void setUp() throws IOException { - mockServiceHelper.reset(); - channelProvider = mockServiceHelper.createChannelProvider(); - MessagingSettings settings = - MessagingSettings.newBuilder() - .setTransportChannelProvider(channelProvider) - .setCredentialsProvider(NoCredentialsProvider.create()) - .build(); - client = MessagingClient.create(settings); - } - - @After - public void tearDown() throws Exception { - client.close(); - } - - @Test - public void createRoomTest() throws Exception { - Room expectedResponse = - Room.newBuilder() - .setName(RoomName.of("[ROOM]").toString()) - .setDisplayName("displayName1714148973") - .setDescription("description-1724546052") - .setCreateTime(Timestamp.newBuilder().build()) - .setUpdateTime(Timestamp.newBuilder().build()) - .build(); - mockMessaging.addResponse(expectedResponse); - - String displayName = "displayName1714148973"; - String description = "description-1724546052"; - - Room actualResponse = client.createRoom(displayName, description); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockMessaging.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - CreateRoomRequest actualRequest = ((CreateRoomRequest) actualRequests.get(0)); - - Assert.assertEquals(displayName, actualRequest.getRoom().getDisplayName()); - Assert.assertEquals(description, actualRequest.getRoom().getDescription()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - public void createRoomExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); - mockMessaging.addException(exception); - - try { - String displayName = "displayName1714148973"; - String description = "description-1724546052"; - client.createRoom(displayName, description); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void getRoomTest() throws Exception { - Room expectedResponse = - Room.newBuilder() - .setName(RoomName.of("[ROOM]").toString()) - .setDisplayName("displayName1714148973") - .setDescription("description-1724546052") - .setCreateTime(Timestamp.newBuilder().build()) - .setUpdateTime(Timestamp.newBuilder().build()) - .build(); - mockMessaging.addResponse(expectedResponse); - - RoomName name = RoomName.of("[ROOM]"); - - Room actualResponse = client.getRoom(name); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockMessaging.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - GetRoomRequest actualRequest = ((GetRoomRequest) actualRequests.get(0)); - - Assert.assertEquals(name.toString(), actualRequest.getName()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - public void getRoomExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); - mockMessaging.addException(exception); - - try { - RoomName name = RoomName.of("[ROOM]"); - client.getRoom(name); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void getRoomTest2() throws Exception { - Room expectedResponse = - Room.newBuilder() - .setName(RoomName.of("[ROOM]").toString()) - .setDisplayName("displayName1714148973") - .setDescription("description-1724546052") - .setCreateTime(Timestamp.newBuilder().build()) - .setUpdateTime(Timestamp.newBuilder().build()) - .build(); - mockMessaging.addResponse(expectedResponse); - - String name = "name3373707"; - - Room actualResponse = client.getRoom(name); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockMessaging.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - GetRoomRequest actualRequest = ((GetRoomRequest) actualRequests.get(0)); - - Assert.assertEquals(name, actualRequest.getName()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - public void getRoomExceptionTest2() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); - mockMessaging.addException(exception); - - try { - String name = "name3373707"; - client.getRoom(name); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void updateRoomTest() throws Exception { - Room expectedResponse = - Room.newBuilder() - .setName(RoomName.of("[ROOM]").toString()) - .setDisplayName("displayName1714148973") - .setDescription("description-1724546052") - .setCreateTime(Timestamp.newBuilder().build()) - .setUpdateTime(Timestamp.newBuilder().build()) - .build(); - mockMessaging.addResponse(expectedResponse); - - UpdateRoomRequest request = - UpdateRoomRequest.newBuilder() - .setRoom(Room.newBuilder().build()) - .setUpdateMask(FieldMask.newBuilder().build()) - .build(); - - Room actualResponse = client.updateRoom(request); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockMessaging.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - UpdateRoomRequest actualRequest = ((UpdateRoomRequest) actualRequests.get(0)); - - Assert.assertEquals(request.getRoom(), actualRequest.getRoom()); - Assert.assertEquals(request.getUpdateMask(), actualRequest.getUpdateMask()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - public void updateRoomExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); - mockMessaging.addException(exception); - - try { - UpdateRoomRequest request = - UpdateRoomRequest.newBuilder() - .setRoom(Room.newBuilder().build()) - .setUpdateMask(FieldMask.newBuilder().build()) - .build(); - client.updateRoom(request); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void deleteRoomTest() throws Exception { - Empty expectedResponse = Empty.newBuilder().build(); - mockMessaging.addResponse(expectedResponse); - - RoomName name = RoomName.of("[ROOM]"); - - client.deleteRoom(name); - - List actualRequests = mockMessaging.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - DeleteRoomRequest actualRequest = ((DeleteRoomRequest) actualRequests.get(0)); - - Assert.assertEquals(name.toString(), actualRequest.getName()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - public void deleteRoomExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); - mockMessaging.addException(exception); - - try { - RoomName name = RoomName.of("[ROOM]"); - client.deleteRoom(name); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void deleteRoomTest2() throws Exception { - Empty expectedResponse = Empty.newBuilder().build(); - mockMessaging.addResponse(expectedResponse); - - String name = "name3373707"; - - client.deleteRoom(name); - - List actualRequests = mockMessaging.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - DeleteRoomRequest actualRequest = ((DeleteRoomRequest) actualRequests.get(0)); - - Assert.assertEquals(name, actualRequest.getName()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - public void deleteRoomExceptionTest2() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); - mockMessaging.addException(exception); - - try { - String name = "name3373707"; - client.deleteRoom(name); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void listRoomsTest() throws Exception { - Room responsesElement = Room.newBuilder().build(); - ListRoomsResponse expectedResponse = - ListRoomsResponse.newBuilder() - .setNextPageToken("") - .addAllRooms(Arrays.asList(responsesElement)) - .build(); - mockMessaging.addResponse(expectedResponse); - - ListRoomsRequest request = - ListRoomsRequest.newBuilder() - .setPageSize(883849137) - .setPageToken("pageToken873572522") - .build(); - - ListRoomsPagedResponse pagedListResponse = client.listRooms(request); - - List resources = Lists.newArrayList(pagedListResponse.iterateAll()); - - Assert.assertEquals(1, resources.size()); - Assert.assertEquals(expectedResponse.getRoomsList().get(0), resources.get(0)); - - List actualRequests = mockMessaging.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - ListRoomsRequest actualRequest = ((ListRoomsRequest) 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 listRoomsExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); - mockMessaging.addException(exception); - - try { - ListRoomsRequest request = - ListRoomsRequest.newBuilder() - .setPageSize(883849137) - .setPageToken("pageToken873572522") - .build(); - client.listRooms(request); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void createBlurbTest() throws Exception { - Blurb expectedResponse = - Blurb.newBuilder() - .setName( - BlurbName.ofUserLegacyUserBlurbName("[USER]", "[LEGACY_USER]", "[BLURB]") - .toString()) - .setUser(UserName.of("[USER]").toString()) - .setCreateTime(Timestamp.newBuilder().build()) - .setUpdateTime(Timestamp.newBuilder().build()) - .build(); - mockMessaging.addResponse(expectedResponse); - - ProfileName parent = ProfileName.of("[USER]"); - UserName user = UserName.of("[USER]"); - ByteString image = ByteString.EMPTY; - - Blurb actualResponse = client.createBlurb(parent, user, image); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockMessaging.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - CreateBlurbRequest actualRequest = ((CreateBlurbRequest) actualRequests.get(0)); - - Assert.assertEquals(parent.toString(), actualRequest.getParent()); - Assert.assertEquals(user.toString(), actualRequest.getBlurb().getUser()); - Assert.assertEquals(image, actualRequest.getBlurb().getImage()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - public void createBlurbExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); - mockMessaging.addException(exception); - - try { - ProfileName parent = ProfileName.of("[USER]"); - UserName user = UserName.of("[USER]"); - ByteString image = ByteString.EMPTY; - client.createBlurb(parent, user, image); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void createBlurbTest2() throws Exception { - Blurb expectedResponse = - Blurb.newBuilder() - .setName( - BlurbName.ofUserLegacyUserBlurbName("[USER]", "[LEGACY_USER]", "[BLURB]") - .toString()) - .setUser(UserName.of("[USER]").toString()) - .setCreateTime(Timestamp.newBuilder().build()) - .setUpdateTime(Timestamp.newBuilder().build()) - .build(); - mockMessaging.addResponse(expectedResponse); - - ProfileName parent = ProfileName.of("[USER]"); - UserName user = UserName.of("[USER]"); - String text = "text3556653"; - - Blurb actualResponse = client.createBlurb(parent, user, text); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockMessaging.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - CreateBlurbRequest actualRequest = ((CreateBlurbRequest) actualRequests.get(0)); - - Assert.assertEquals(parent.toString(), actualRequest.getParent()); - Assert.assertEquals(user.toString(), actualRequest.getBlurb().getUser()); - Assert.assertEquals(text, actualRequest.getBlurb().getText()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - public void createBlurbExceptionTest2() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); - mockMessaging.addException(exception); - - try { - ProfileName parent = ProfileName.of("[USER]"); - UserName user = UserName.of("[USER]"); - String text = "text3556653"; - client.createBlurb(parent, user, text); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void createBlurbTest3() throws Exception { - Blurb expectedResponse = - Blurb.newBuilder() - .setName( - BlurbName.ofUserLegacyUserBlurbName("[USER]", "[LEGACY_USER]", "[BLURB]") - .toString()) - .setUser(UserName.of("[USER]").toString()) - .setCreateTime(Timestamp.newBuilder().build()) - .setUpdateTime(Timestamp.newBuilder().build()) - .build(); - mockMessaging.addResponse(expectedResponse); - - ProfileName parent = ProfileName.of("[USER]"); - String user = "user3599307"; - ByteString image = ByteString.EMPTY; - - Blurb actualResponse = client.createBlurb(parent, user, image); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockMessaging.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - CreateBlurbRequest actualRequest = ((CreateBlurbRequest) actualRequests.get(0)); - - Assert.assertEquals(parent.toString(), actualRequest.getParent()); - Assert.assertEquals(user, actualRequest.getBlurb().getUser()); - Assert.assertEquals(image, actualRequest.getBlurb().getImage()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - public void createBlurbExceptionTest3() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); - mockMessaging.addException(exception); - - try { - ProfileName parent = ProfileName.of("[USER]"); - String user = "user3599307"; - ByteString image = ByteString.EMPTY; - client.createBlurb(parent, user, image); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void createBlurbTest4() throws Exception { - Blurb expectedResponse = - Blurb.newBuilder() - .setName( - BlurbName.ofUserLegacyUserBlurbName("[USER]", "[LEGACY_USER]", "[BLURB]") - .toString()) - .setUser(UserName.of("[USER]").toString()) - .setCreateTime(Timestamp.newBuilder().build()) - .setUpdateTime(Timestamp.newBuilder().build()) - .build(); - mockMessaging.addResponse(expectedResponse); - - ProfileName parent = ProfileName.of("[USER]"); - String user = "user3599307"; - String text = "text3556653"; - - Blurb actualResponse = client.createBlurb(parent, user, text); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockMessaging.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - CreateBlurbRequest actualRequest = ((CreateBlurbRequest) actualRequests.get(0)); - - Assert.assertEquals(parent.toString(), actualRequest.getParent()); - Assert.assertEquals(user, actualRequest.getBlurb().getUser()); - Assert.assertEquals(text, actualRequest.getBlurb().getText()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - public void createBlurbExceptionTest4() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); - mockMessaging.addException(exception); - - try { - ProfileName parent = ProfileName.of("[USER]"); - String user = "user3599307"; - String text = "text3556653"; - client.createBlurb(parent, user, text); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void createBlurbTest5() throws Exception { - Blurb expectedResponse = - Blurb.newBuilder() - .setName( - BlurbName.ofUserLegacyUserBlurbName("[USER]", "[LEGACY_USER]", "[BLURB]") - .toString()) - .setUser(UserName.of("[USER]").toString()) - .setCreateTime(Timestamp.newBuilder().build()) - .setUpdateTime(Timestamp.newBuilder().build()) - .build(); - mockMessaging.addResponse(expectedResponse); - - RoomName parent = RoomName.of("[ROOM]"); - UserName user = UserName.of("[USER]"); - ByteString image = ByteString.EMPTY; - - Blurb actualResponse = client.createBlurb(parent, user, image); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockMessaging.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - CreateBlurbRequest actualRequest = ((CreateBlurbRequest) actualRequests.get(0)); - - Assert.assertEquals(parent.toString(), actualRequest.getParent()); - Assert.assertEquals(user.toString(), actualRequest.getBlurb().getUser()); - Assert.assertEquals(image, actualRequest.getBlurb().getImage()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - public void createBlurbExceptionTest5() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); - mockMessaging.addException(exception); - - try { - RoomName parent = RoomName.of("[ROOM]"); - UserName user = UserName.of("[USER]"); - ByteString image = ByteString.EMPTY; - client.createBlurb(parent, user, image); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void createBlurbTest6() throws Exception { - Blurb expectedResponse = - Blurb.newBuilder() - .setName( - BlurbName.ofUserLegacyUserBlurbName("[USER]", "[LEGACY_USER]", "[BLURB]") - .toString()) - .setUser(UserName.of("[USER]").toString()) - .setCreateTime(Timestamp.newBuilder().build()) - .setUpdateTime(Timestamp.newBuilder().build()) - .build(); - mockMessaging.addResponse(expectedResponse); - - RoomName parent = RoomName.of("[ROOM]"); - UserName user = UserName.of("[USER]"); - String text = "text3556653"; - - Blurb actualResponse = client.createBlurb(parent, user, text); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockMessaging.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - CreateBlurbRequest actualRequest = ((CreateBlurbRequest) actualRequests.get(0)); - - Assert.assertEquals(parent.toString(), actualRequest.getParent()); - Assert.assertEquals(user.toString(), actualRequest.getBlurb().getUser()); - Assert.assertEquals(text, actualRequest.getBlurb().getText()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - public void createBlurbExceptionTest6() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); - mockMessaging.addException(exception); - - try { - RoomName parent = RoomName.of("[ROOM]"); - UserName user = UserName.of("[USER]"); - String text = "text3556653"; - client.createBlurb(parent, user, text); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void createBlurbTest7() throws Exception { - Blurb expectedResponse = - Blurb.newBuilder() - .setName( - BlurbName.ofUserLegacyUserBlurbName("[USER]", "[LEGACY_USER]", "[BLURB]") - .toString()) - .setUser(UserName.of("[USER]").toString()) - .setCreateTime(Timestamp.newBuilder().build()) - .setUpdateTime(Timestamp.newBuilder().build()) - .build(); - mockMessaging.addResponse(expectedResponse); - - RoomName parent = RoomName.of("[ROOM]"); - String user = "user3599307"; - ByteString image = ByteString.EMPTY; - - Blurb actualResponse = client.createBlurb(parent, user, image); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockMessaging.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - CreateBlurbRequest actualRequest = ((CreateBlurbRequest) actualRequests.get(0)); - - Assert.assertEquals(parent.toString(), actualRequest.getParent()); - Assert.assertEquals(user, actualRequest.getBlurb().getUser()); - Assert.assertEquals(image, actualRequest.getBlurb().getImage()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - public void createBlurbExceptionTest7() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); - mockMessaging.addException(exception); - - try { - RoomName parent = RoomName.of("[ROOM]"); - String user = "user3599307"; - ByteString image = ByteString.EMPTY; - client.createBlurb(parent, user, image); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void createBlurbTest8() throws Exception { - Blurb expectedResponse = - Blurb.newBuilder() - .setName( - BlurbName.ofUserLegacyUserBlurbName("[USER]", "[LEGACY_USER]", "[BLURB]") - .toString()) - .setUser(UserName.of("[USER]").toString()) - .setCreateTime(Timestamp.newBuilder().build()) - .setUpdateTime(Timestamp.newBuilder().build()) - .build(); - mockMessaging.addResponse(expectedResponse); - - RoomName parent = RoomName.of("[ROOM]"); - String user = "user3599307"; - String text = "text3556653"; - - Blurb actualResponse = client.createBlurb(parent, user, text); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockMessaging.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - CreateBlurbRequest actualRequest = ((CreateBlurbRequest) actualRequests.get(0)); - - Assert.assertEquals(parent.toString(), actualRequest.getParent()); - Assert.assertEquals(user, actualRequest.getBlurb().getUser()); - Assert.assertEquals(text, actualRequest.getBlurb().getText()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - public void createBlurbExceptionTest8() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); - mockMessaging.addException(exception); - - try { - RoomName parent = RoomName.of("[ROOM]"); - String user = "user3599307"; - String text = "text3556653"; - client.createBlurb(parent, user, text); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void createBlurbTest9() throws Exception { - Blurb expectedResponse = - Blurb.newBuilder() - .setName( - BlurbName.ofUserLegacyUserBlurbName("[USER]", "[LEGACY_USER]", "[BLURB]") - .toString()) - .setUser(UserName.of("[USER]").toString()) - .setCreateTime(Timestamp.newBuilder().build()) - .setUpdateTime(Timestamp.newBuilder().build()) - .build(); - mockMessaging.addResponse(expectedResponse); - - String parent = "parent-995424086"; - UserName user = UserName.of("[USER]"); - ByteString image = ByteString.EMPTY; - - Blurb actualResponse = client.createBlurb(parent, user, image); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockMessaging.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - CreateBlurbRequest actualRequest = ((CreateBlurbRequest) actualRequests.get(0)); - - Assert.assertEquals(parent, actualRequest.getParent()); - Assert.assertEquals(user.toString(), actualRequest.getBlurb().getUser()); - Assert.assertEquals(image, actualRequest.getBlurb().getImage()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - public void createBlurbExceptionTest9() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); - mockMessaging.addException(exception); - - try { - String parent = "parent-995424086"; - UserName user = UserName.of("[USER]"); - ByteString image = ByteString.EMPTY; - client.createBlurb(parent, user, image); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void createBlurbTest10() throws Exception { - Blurb expectedResponse = - Blurb.newBuilder() - .setName( - BlurbName.ofUserLegacyUserBlurbName("[USER]", "[LEGACY_USER]", "[BLURB]") - .toString()) - .setUser(UserName.of("[USER]").toString()) - .setCreateTime(Timestamp.newBuilder().build()) - .setUpdateTime(Timestamp.newBuilder().build()) - .build(); - mockMessaging.addResponse(expectedResponse); - - String parent = "parent-995424086"; - UserName user = UserName.of("[USER]"); - String text = "text3556653"; - - Blurb actualResponse = client.createBlurb(parent, user, text); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockMessaging.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - CreateBlurbRequest actualRequest = ((CreateBlurbRequest) actualRequests.get(0)); - - Assert.assertEquals(parent, actualRequest.getParent()); - Assert.assertEquals(user.toString(), actualRequest.getBlurb().getUser()); - Assert.assertEquals(text, actualRequest.getBlurb().getText()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - public void createBlurbExceptionTest10() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); - mockMessaging.addException(exception); - - try { - String parent = "parent-995424086"; - UserName user = UserName.of("[USER]"); - String text = "text3556653"; - client.createBlurb(parent, user, text); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void createBlurbTest11() throws Exception { - Blurb expectedResponse = - Blurb.newBuilder() - .setName( - BlurbName.ofUserLegacyUserBlurbName("[USER]", "[LEGACY_USER]", "[BLURB]") - .toString()) - .setUser(UserName.of("[USER]").toString()) - .setCreateTime(Timestamp.newBuilder().build()) - .setUpdateTime(Timestamp.newBuilder().build()) - .build(); - mockMessaging.addResponse(expectedResponse); - - String parent = "parent-995424086"; - String user = "user3599307"; - ByteString image = ByteString.EMPTY; - - Blurb actualResponse = client.createBlurb(parent, user, image); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockMessaging.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - CreateBlurbRequest actualRequest = ((CreateBlurbRequest) actualRequests.get(0)); - - Assert.assertEquals(parent, actualRequest.getParent()); - Assert.assertEquals(user, actualRequest.getBlurb().getUser()); - Assert.assertEquals(image, actualRequest.getBlurb().getImage()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - public void createBlurbExceptionTest11() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); - mockMessaging.addException(exception); - - try { - String parent = "parent-995424086"; - String user = "user3599307"; - ByteString image = ByteString.EMPTY; - client.createBlurb(parent, user, image); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void createBlurbTest12() throws Exception { - Blurb expectedResponse = - Blurb.newBuilder() - .setName( - BlurbName.ofUserLegacyUserBlurbName("[USER]", "[LEGACY_USER]", "[BLURB]") - .toString()) - .setUser(UserName.of("[USER]").toString()) - .setCreateTime(Timestamp.newBuilder().build()) - .setUpdateTime(Timestamp.newBuilder().build()) - .build(); - mockMessaging.addResponse(expectedResponse); - - String parent = "parent-995424086"; - String user = "user3599307"; - String text = "text3556653"; - - Blurb actualResponse = client.createBlurb(parent, user, text); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockMessaging.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - CreateBlurbRequest actualRequest = ((CreateBlurbRequest) actualRequests.get(0)); - - Assert.assertEquals(parent, actualRequest.getParent()); - Assert.assertEquals(user, actualRequest.getBlurb().getUser()); - Assert.assertEquals(text, actualRequest.getBlurb().getText()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - public void createBlurbExceptionTest12() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); - mockMessaging.addException(exception); - - try { - String parent = "parent-995424086"; - String user = "user3599307"; - String text = "text3556653"; - client.createBlurb(parent, user, text); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void getBlurbTest() throws Exception { - Blurb expectedResponse = - Blurb.newBuilder() - .setName(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString()) - .setUser(UserName.of("[USER]").toString()) - .setCreateTime(Timestamp.newBuilder().build()) - .setUpdateTime(Timestamp.newBuilder().build()) - .build(); - mockMessaging.addResponse(expectedResponse); - - BlurbName name = BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]"); - - Blurb actualResponse = client.getBlurb(name); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockMessaging.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - GetBlurbRequest actualRequest = ((GetBlurbRequest) actualRequests.get(0)); - - Assert.assertEquals(name.toString(), actualRequest.getName()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - public void getBlurbExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); - mockMessaging.addException(exception); - - try { - BlurbName name = BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]"); - client.getBlurb(name); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void getBlurbTest2() throws Exception { - Blurb expectedResponse = - Blurb.newBuilder() - .setName(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString()) - .setUser(UserName.of("[USER]").toString()) - .setCreateTime(Timestamp.newBuilder().build()) - .setUpdateTime(Timestamp.newBuilder().build()) - .build(); - mockMessaging.addResponse(expectedResponse); - - String name = "name3373707"; - - Blurb actualResponse = client.getBlurb(name); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockMessaging.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - GetBlurbRequest actualRequest = ((GetBlurbRequest) actualRequests.get(0)); - - Assert.assertEquals(name, actualRequest.getName()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - public void getBlurbExceptionTest2() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); - mockMessaging.addException(exception); - - try { - String name = "name3373707"; - client.getBlurb(name); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void updateBlurbTest() throws Exception { - Blurb expectedResponse = - Blurb.newBuilder() - .setName(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString()) - .setUser(UserName.of("[USER]").toString()) - .setCreateTime(Timestamp.newBuilder().build()) - .setUpdateTime(Timestamp.newBuilder().build()) - .build(); - mockMessaging.addResponse(expectedResponse); - - UpdateBlurbRequest request = - UpdateBlurbRequest.newBuilder() - .setBlurb(Blurb.newBuilder().build()) - .setUpdateMask(FieldMask.newBuilder().build()) - .build(); - - Blurb actualResponse = client.updateBlurb(request); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockMessaging.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - UpdateBlurbRequest actualRequest = ((UpdateBlurbRequest) actualRequests.get(0)); - - Assert.assertEquals(request.getBlurb(), actualRequest.getBlurb()); - Assert.assertEquals(request.getUpdateMask(), actualRequest.getUpdateMask()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - public void updateBlurbExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); - mockMessaging.addException(exception); - - try { - UpdateBlurbRequest request = - UpdateBlurbRequest.newBuilder() - .setBlurb(Blurb.newBuilder().build()) - .setUpdateMask(FieldMask.newBuilder().build()) - .build(); - client.updateBlurb(request); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void deleteBlurbTest() throws Exception { - Empty expectedResponse = Empty.newBuilder().build(); - mockMessaging.addResponse(expectedResponse); - - BlurbName name = BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]"); - - client.deleteBlurb(name); - - List actualRequests = mockMessaging.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - DeleteBlurbRequest actualRequest = ((DeleteBlurbRequest) actualRequests.get(0)); - - Assert.assertEquals(name.toString(), actualRequest.getName()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - public void deleteBlurbExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); - mockMessaging.addException(exception); - - try { - BlurbName name = BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]"); - client.deleteBlurb(name); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void deleteBlurbTest2() throws Exception { - Empty expectedResponse = Empty.newBuilder().build(); - mockMessaging.addResponse(expectedResponse); - - String name = "name3373707"; - - client.deleteBlurb(name); - - List actualRequests = mockMessaging.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - DeleteBlurbRequest actualRequest = ((DeleteBlurbRequest) actualRequests.get(0)); - - Assert.assertEquals(name, actualRequest.getName()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - public void deleteBlurbExceptionTest2() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); - mockMessaging.addException(exception); - - try { - String name = "name3373707"; - client.deleteBlurb(name); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void listBlurbsTest() throws Exception { - Blurb responsesElement = Blurb.newBuilder().build(); - ListBlurbsResponse expectedResponse = - ListBlurbsResponse.newBuilder() - .setNextPageToken("") - .addAllBlurbs(Arrays.asList(responsesElement)) - .build(); - mockMessaging.addResponse(expectedResponse); - - ProfileName parent = ProfileName.of("[USER]"); - - ListBlurbsPagedResponse pagedListResponse = client.listBlurbs(parent); - - List resources = Lists.newArrayList(pagedListResponse.iterateAll()); - - Assert.assertEquals(1, resources.size()); - Assert.assertEquals(expectedResponse.getBlurbsList().get(0), resources.get(0)); - - List actualRequests = mockMessaging.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - ListBlurbsRequest actualRequest = ((ListBlurbsRequest) actualRequests.get(0)); - - Assert.assertEquals(parent.toString(), actualRequest.getParent()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - public void listBlurbsExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); - mockMessaging.addException(exception); - - try { - ProfileName parent = ProfileName.of("[USER]"); - client.listBlurbs(parent); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void listBlurbsTest2() throws Exception { - Blurb responsesElement = Blurb.newBuilder().build(); - ListBlurbsResponse expectedResponse = - ListBlurbsResponse.newBuilder() - .setNextPageToken("") - .addAllBlurbs(Arrays.asList(responsesElement)) - .build(); - mockMessaging.addResponse(expectedResponse); - - RoomName parent = RoomName.of("[ROOM]"); - - ListBlurbsPagedResponse pagedListResponse = client.listBlurbs(parent); - - List resources = Lists.newArrayList(pagedListResponse.iterateAll()); - - Assert.assertEquals(1, resources.size()); - Assert.assertEquals(expectedResponse.getBlurbsList().get(0), resources.get(0)); - - List actualRequests = mockMessaging.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - ListBlurbsRequest actualRequest = ((ListBlurbsRequest) actualRequests.get(0)); - - Assert.assertEquals(parent.toString(), actualRequest.getParent()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - public void listBlurbsExceptionTest2() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); - mockMessaging.addException(exception); - - try { - RoomName parent = RoomName.of("[ROOM]"); - client.listBlurbs(parent); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void listBlurbsTest3() throws Exception { - Blurb responsesElement = Blurb.newBuilder().build(); - ListBlurbsResponse expectedResponse = - ListBlurbsResponse.newBuilder() - .setNextPageToken("") - .addAllBlurbs(Arrays.asList(responsesElement)) - .build(); - mockMessaging.addResponse(expectedResponse); - - String parent = "parent-995424086"; - - ListBlurbsPagedResponse pagedListResponse = client.listBlurbs(parent); - - List resources = Lists.newArrayList(pagedListResponse.iterateAll()); - - Assert.assertEquals(1, resources.size()); - Assert.assertEquals(expectedResponse.getBlurbsList().get(0), resources.get(0)); - - List actualRequests = mockMessaging.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - ListBlurbsRequest actualRequest = ((ListBlurbsRequest) actualRequests.get(0)); - - Assert.assertEquals(parent, actualRequest.getParent()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - public void listBlurbsExceptionTest3() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); - mockMessaging.addException(exception); - - try { - String parent = "parent-995424086"; - client.listBlurbs(parent); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void searchBlurbsTest() throws Exception { - SearchBlurbsResponse expectedResponse = - SearchBlurbsResponse.newBuilder() - .addAllBlurbs(new ArrayList()) - .setNextPageToken("nextPageToken-1386094857") - .build(); - Operation resultOperation = - Operation.newBuilder() - .setName("searchBlurbsTest") - .setDone(true) - .setResponse(Any.pack(expectedResponse)) - .build(); - mockMessaging.addResponse(resultOperation); - - ProfileName parent = ProfileName.of("[USER]"); - String query = "query107944136"; - - SearchBlurbsResponse actualResponse = client.searchBlurbsAsync(parent, query).get(); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockMessaging.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - SearchBlurbsRequest actualRequest = ((SearchBlurbsRequest) actualRequests.get(0)); - - Assert.assertEquals(parent.toString(), actualRequest.getParent()); - Assert.assertEquals(query, actualRequest.getQuery()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - public void searchBlurbsExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); - mockMessaging.addException(exception); - - try { - ProfileName parent = ProfileName.of("[USER]"); - String query = "query107944136"; - client.searchBlurbsAsync(parent, query).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 searchBlurbsTest2() throws Exception { - SearchBlurbsResponse expectedResponse = - SearchBlurbsResponse.newBuilder() - .addAllBlurbs(new ArrayList()) - .setNextPageToken("nextPageToken-1386094857") - .build(); - Operation resultOperation = - Operation.newBuilder() - .setName("searchBlurbsTest") - .setDone(true) - .setResponse(Any.pack(expectedResponse)) - .build(); - mockMessaging.addResponse(resultOperation); - - RoomName parent = RoomName.of("[ROOM]"); - String query = "query107944136"; - - SearchBlurbsResponse actualResponse = client.searchBlurbsAsync(parent, query).get(); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockMessaging.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - SearchBlurbsRequest actualRequest = ((SearchBlurbsRequest) actualRequests.get(0)); - - Assert.assertEquals(parent.toString(), actualRequest.getParent()); - Assert.assertEquals(query, actualRequest.getQuery()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - public void searchBlurbsExceptionTest2() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); - mockMessaging.addException(exception); - - try { - RoomName parent = RoomName.of("[ROOM]"); - String query = "query107944136"; - client.searchBlurbsAsync(parent, query).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 searchBlurbsTest3() throws Exception { - SearchBlurbsResponse expectedResponse = - SearchBlurbsResponse.newBuilder() - .addAllBlurbs(new ArrayList()) - .setNextPageToken("nextPageToken-1386094857") - .build(); - Operation resultOperation = - Operation.newBuilder() - .setName("searchBlurbsTest") - .setDone(true) - .setResponse(Any.pack(expectedResponse)) - .build(); - mockMessaging.addResponse(resultOperation); - - String parent = "parent-995424086"; - String query = "query107944136"; - - SearchBlurbsResponse actualResponse = client.searchBlurbsAsync(parent, query).get(); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockMessaging.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - SearchBlurbsRequest actualRequest = ((SearchBlurbsRequest) actualRequests.get(0)); - - Assert.assertEquals(parent, actualRequest.getParent()); - Assert.assertEquals(query, actualRequest.getQuery()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - public void searchBlurbsExceptionTest3() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); - mockMessaging.addException(exception); - - try { - String parent = "parent-995424086"; - String query = "query107944136"; - client.searchBlurbsAsync(parent, query).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 streamBlurbsTest() throws Exception { - StreamBlurbsResponse expectedResponse = - StreamBlurbsResponse.newBuilder().setBlurb(Blurb.newBuilder().build()).build(); - mockMessaging.addResponse(expectedResponse); - StreamBlurbsRequest request = - StreamBlurbsRequest.newBuilder() - .setName(ProfileName.of("[USER]").toString()) - .setExpireTime(Timestamp.newBuilder().build()) - .build(); - - MockStreamObserver responseObserver = new MockStreamObserver<>(); - - ServerStreamingCallable callable = - client.streamBlurbsCallable(); - callable.serverStreamingCall(request, responseObserver); - - List actualResponses = responseObserver.future().get(); - Assert.assertEquals(1, actualResponses.size()); - Assert.assertEquals(expectedResponse, actualResponses.get(0)); - } - - @Test - public void streamBlurbsExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); - mockMessaging.addException(exception); - StreamBlurbsRequest request = - StreamBlurbsRequest.newBuilder() - .setName(ProfileName.of("[USER]").toString()) - .setExpireTime(Timestamp.newBuilder().build()) - .build(); - - MockStreamObserver responseObserver = new MockStreamObserver<>(); - - ServerStreamingCallable callable = - client.streamBlurbsCallable(); - callable.serverStreamingCall(request, responseObserver); - - 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()); - } - } - - @Test - public void sendBlurbsTest() throws Exception { - SendBlurbsResponse expectedResponse = - SendBlurbsResponse.newBuilder().addAllNames(new ArrayList()).build(); - mockMessaging.addResponse(expectedResponse); - CreateBlurbRequest request = - CreateBlurbRequest.newBuilder() - .setParent(ProfileName.of("[USER]").toString()) - .setBlurb(Blurb.newBuilder().build()) - .build(); - - MockStreamObserver responseObserver = new MockStreamObserver<>(); - - ClientStreamingCallable callable = - client.sendBlurbsCallable(); - ApiStreamObserver requestObserver = - callable.clientStreamingCall(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 sendBlurbsExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); - mockMessaging.addException(exception); - CreateBlurbRequest request = - CreateBlurbRequest.newBuilder() - .setParent(ProfileName.of("[USER]").toString()) - .setBlurb(Blurb.newBuilder().build()) - .build(); - - MockStreamObserver responseObserver = new MockStreamObserver<>(); - - ClientStreamingCallable callable = - client.sendBlurbsCallable(); - ApiStreamObserver requestObserver = - callable.clientStreamingCall(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()); - } - } - - @Test - public void connectTest() throws Exception { - StreamBlurbsResponse expectedResponse = - StreamBlurbsResponse.newBuilder().setBlurb(Blurb.newBuilder().build()).build(); - mockMessaging.addResponse(expectedResponse); - ConnectRequest request = ConnectRequest.newBuilder().build(); - - MockStreamObserver responseObserver = new MockStreamObserver<>(); - - BidiStreamingCallable callable = client.connectCallable(); - 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 connectExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); - mockMessaging.addException(exception); - ConnectRequest request = ConnectRequest.newBuilder().build(); - - MockStreamObserver responseObserver = new MockStreamObserver<>(); - - BidiStreamingCallable callable = client.connectCallable(); - 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/showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/MockCompliance.java b/showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/MockCompliance.java deleted file mode 100644 index 5c86c23a02..0000000000 --- a/showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/MockCompliance.java +++ /dev/null @@ -1,59 +0,0 @@ -/* - * 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 - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1; - -import com.google.api.core.BetaApi; -import com.google.api.gax.grpc.testing.MockGrpcService; -import com.google.protobuf.AbstractMessage; -import io.grpc.ServerServiceDefinition; -import java.util.List; -import javax.annotation.Generated; - -@BetaApi -@Generated("by gapic-generator-java") -public class MockCompliance implements MockGrpcService { - private final MockComplianceImpl serviceImpl; - - public MockCompliance() { - serviceImpl = new MockComplianceImpl(); - } - - @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/showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/MockComplianceImpl.java b/showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/MockComplianceImpl.java deleted file mode 100644 index 5d27cb09c2..0000000000 --- a/showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/MockComplianceImpl.java +++ /dev/null @@ -1,268 +0,0 @@ -/* - * 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 - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1; - -import com.google.api.core.BetaApi; -import com.google.protobuf.AbstractMessage; -import com.google.showcase.v1beta1.ComplianceGrpc.ComplianceImplBase; -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 MockComplianceImpl extends ComplianceImplBase { - private List requests; - private Queue responses; - - public MockComplianceImpl() { - 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 repeatDataBody( - RepeatRequest request, StreamObserver responseObserver) { - Object response = responses.poll(); - if (response instanceof RepeatResponse) { - requests.add(request); - responseObserver.onNext(((RepeatResponse) 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 RepeatDataBody, expected %s or %s", - response == null ? "null" : response.getClass().getName(), - RepeatResponse.class.getName(), - Exception.class.getName()))); - } - } - - @Override - public void repeatDataBodyInfo( - RepeatRequest request, StreamObserver responseObserver) { - Object response = responses.poll(); - if (response instanceof RepeatResponse) { - requests.add(request); - responseObserver.onNext(((RepeatResponse) 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 RepeatDataBodyInfo, expected %s or %s", - response == null ? "null" : response.getClass().getName(), - RepeatResponse.class.getName(), - Exception.class.getName()))); - } - } - - @Override - public void repeatDataQuery( - RepeatRequest request, StreamObserver responseObserver) { - Object response = responses.poll(); - if (response instanceof RepeatResponse) { - requests.add(request); - responseObserver.onNext(((RepeatResponse) 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 RepeatDataQuery, expected %s or %s", - response == null ? "null" : response.getClass().getName(), - RepeatResponse.class.getName(), - Exception.class.getName()))); - } - } - - @Override - public void repeatDataSimplePath( - RepeatRequest request, StreamObserver responseObserver) { - Object response = responses.poll(); - if (response instanceof RepeatResponse) { - requests.add(request); - responseObserver.onNext(((RepeatResponse) 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 RepeatDataSimplePath, expected %s or %s", - response == null ? "null" : response.getClass().getName(), - RepeatResponse.class.getName(), - Exception.class.getName()))); - } - } - - @Override - public void repeatDataPathResource( - RepeatRequest request, StreamObserver responseObserver) { - Object response = responses.poll(); - if (response instanceof RepeatResponse) { - requests.add(request); - responseObserver.onNext(((RepeatResponse) 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 RepeatDataPathResource, expected %s or %s", - response == null ? "null" : response.getClass().getName(), - RepeatResponse.class.getName(), - Exception.class.getName()))); - } - } - - @Override - public void repeatDataPathTrailingResource( - RepeatRequest request, StreamObserver responseObserver) { - Object response = responses.poll(); - if (response instanceof RepeatResponse) { - requests.add(request); - responseObserver.onNext(((RepeatResponse) 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 RepeatDataPathTrailingResource, expected %s or %s", - response == null ? "null" : response.getClass().getName(), - RepeatResponse.class.getName(), - Exception.class.getName()))); - } - } - - @Override - public void repeatDataBodyPut( - RepeatRequest request, StreamObserver responseObserver) { - Object response = responses.poll(); - if (response instanceof RepeatResponse) { - requests.add(request); - responseObserver.onNext(((RepeatResponse) 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 RepeatDataBodyPut, expected %s or %s", - response == null ? "null" : response.getClass().getName(), - RepeatResponse.class.getName(), - Exception.class.getName()))); - } - } - - @Override - public void repeatDataBodyPatch( - RepeatRequest request, StreamObserver responseObserver) { - Object response = responses.poll(); - if (response instanceof RepeatResponse) { - requests.add(request); - responseObserver.onNext(((RepeatResponse) 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 RepeatDataBodyPatch, expected %s or %s", - response == null ? "null" : response.getClass().getName(), - RepeatResponse.class.getName(), - Exception.class.getName()))); - } - } - - @Override - public void getEnum(EnumRequest request, StreamObserver responseObserver) { - Object response = responses.poll(); - if (response instanceof EnumResponse) { - requests.add(request); - responseObserver.onNext(((EnumResponse) 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 GetEnum, expected %s or %s", - response == null ? "null" : response.getClass().getName(), - EnumResponse.class.getName(), - Exception.class.getName()))); - } - } - - @Override - public void verifyEnum(EnumResponse request, StreamObserver responseObserver) { - Object response = responses.poll(); - if (response instanceof EnumResponse) { - requests.add(request); - responseObserver.onNext(((EnumResponse) 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 VerifyEnum, expected %s or %s", - response == null ? "null" : response.getClass().getName(), - EnumResponse.class.getName(), - Exception.class.getName()))); - } - } -} diff --git a/showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/MockEcho.java b/showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/MockEcho.java deleted file mode 100644 index 713524d540..0000000000 --- a/showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/MockEcho.java +++ /dev/null @@ -1,59 +0,0 @@ -/* - * 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 - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1; - -import com.google.api.core.BetaApi; -import com.google.api.gax.grpc.testing.MockGrpcService; -import com.google.protobuf.AbstractMessage; -import io.grpc.ServerServiceDefinition; -import java.util.List; -import javax.annotation.Generated; - -@BetaApi -@Generated("by gapic-generator-java") -public class MockEcho implements MockGrpcService { - private final MockEchoImpl serviceImpl; - - public MockEcho() { - serviceImpl = new MockEchoImpl(); - } - - @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/showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/MockEchoImpl.java b/showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/MockEchoImpl.java deleted file mode 100644 index ebb4bab00d..0000000000 --- a/showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/MockEchoImpl.java +++ /dev/null @@ -1,277 +0,0 @@ -/* - * 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 - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1; - -import com.google.api.core.BetaApi; -import com.google.longrunning.Operation; -import com.google.protobuf.AbstractMessage; -import com.google.showcase.v1beta1.EchoGrpc.EchoImplBase; -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 MockEchoImpl extends EchoImplBase { - private List requests; - private Queue responses; - - public MockEchoImpl() { - 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 echo(EchoRequest request, StreamObserver responseObserver) { - Object response = responses.poll(); - if (response instanceof EchoResponse) { - requests.add(request); - responseObserver.onNext(((EchoResponse) 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 Echo, expected %s or %s", - response == null ? "null" : response.getClass().getName(), - EchoResponse.class.getName(), - Exception.class.getName()))); - } - } - - @Override - public void expand(ExpandRequest request, StreamObserver responseObserver) { - Object response = responses.poll(); - if (response instanceof EchoResponse) { - requests.add(request); - responseObserver.onNext(((EchoResponse) 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 Expand, expected %s or %s", - response == null ? "null" : response.getClass().getName(), - EchoResponse.class.getName(), - Exception.class.getName()))); - } - } - - @Override - public StreamObserver collect(final StreamObserver responseObserver) { - StreamObserver requestObserver = - new StreamObserver() { - @Override - public void onNext(EchoRequest value) { - requests.add(value); - final Object response = responses.remove(); - if (response instanceof EchoResponse) { - responseObserver.onNext(((EchoResponse) response)); - } else if (response instanceof Exception) { - responseObserver.onError(((Exception) response)); - } else { - responseObserver.onError( - new IllegalArgumentException( - String.format( - "Unrecognized response type %s for method Collect, expected %s or %s", - response == null ? "null" : response.getClass().getName(), - EchoResponse.class.getName(), - Exception.class.getName()))); - } - } - - @Override - public void onError(Throwable t) { - responseObserver.onError(t); - } - - @Override - public void onCompleted() { - responseObserver.onCompleted(); - } - }; - return requestObserver; - } - - @Override - public StreamObserver chat(final StreamObserver responseObserver) { - StreamObserver requestObserver = - new StreamObserver() { - @Override - public void onNext(EchoRequest value) { - requests.add(value); - final Object response = responses.remove(); - if (response instanceof EchoResponse) { - responseObserver.onNext(((EchoResponse) response)); - } else if (response instanceof Exception) { - responseObserver.onError(((Exception) response)); - } else { - responseObserver.onError( - new IllegalArgumentException( - String.format( - "Unrecognized response type %s for method Chat, expected %s or %s", - response == null ? "null" : response.getClass().getName(), - EchoResponse.class.getName(), - Exception.class.getName()))); - } - } - - @Override - public void onError(Throwable t) { - responseObserver.onError(t); - } - - @Override - public void onCompleted() { - responseObserver.onCompleted(); - } - }; - return requestObserver; - } - - @Override - public void pagedExpand( - PagedExpandRequest request, StreamObserver responseObserver) { - Object response = responses.poll(); - if (response instanceof PagedExpandResponse) { - requests.add(request); - responseObserver.onNext(((PagedExpandResponse) 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 PagedExpand, expected %s or %s", - response == null ? "null" : response.getClass().getName(), - PagedExpandResponse.class.getName(), - Exception.class.getName()))); - } - } - - @Override - public void pagedExpandLegacy( - PagedExpandLegacyRequest request, StreamObserver responseObserver) { - Object response = responses.poll(); - if (response instanceof PagedExpandResponse) { - requests.add(request); - responseObserver.onNext(((PagedExpandResponse) 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 PagedExpandLegacy, expected %s or %s", - response == null ? "null" : response.getClass().getName(), - PagedExpandResponse.class.getName(), - Exception.class.getName()))); - } - } - - @Override - public void pagedExpandLegacyMapped( - PagedExpandRequest request, - StreamObserver responseObserver) { - Object response = responses.poll(); - if (response instanceof PagedExpandLegacyMappedResponse) { - requests.add(request); - responseObserver.onNext(((PagedExpandLegacyMappedResponse) 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 PagedExpandLegacyMapped, expected %s or %s", - response == null ? "null" : response.getClass().getName(), - PagedExpandLegacyMappedResponse.class.getName(), - Exception.class.getName()))); - } - } - - @Override - public void wait(WaitRequest 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 Wait, expected %s or %s", - response == null ? "null" : response.getClass().getName(), - Operation.class.getName(), - Exception.class.getName()))); - } - } - - @Override - public void block(BlockRequest request, StreamObserver responseObserver) { - Object response = responses.poll(); - if (response instanceof BlockResponse) { - requests.add(request); - responseObserver.onNext(((BlockResponse) 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 Block, expected %s or %s", - response == null ? "null" : response.getClass().getName(), - BlockResponse.class.getName(), - Exception.class.getName()))); - } - } -} diff --git a/showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/MockIdentity.java b/showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/MockIdentity.java deleted file mode 100644 index c1fa686113..0000000000 --- a/showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/MockIdentity.java +++ /dev/null @@ -1,59 +0,0 @@ -/* - * 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 - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1; - -import com.google.api.core.BetaApi; -import com.google.api.gax.grpc.testing.MockGrpcService; -import com.google.protobuf.AbstractMessage; -import io.grpc.ServerServiceDefinition; -import java.util.List; -import javax.annotation.Generated; - -@BetaApi -@Generated("by gapic-generator-java") -public class MockIdentity implements MockGrpcService { - private final MockIdentityImpl serviceImpl; - - public MockIdentity() { - serviceImpl = new MockIdentityImpl(); - } - - @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/showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/MockIdentityImpl.java b/showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/MockIdentityImpl.java deleted file mode 100644 index 508e333af6..0000000000 --- a/showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/MockIdentityImpl.java +++ /dev/null @@ -1,162 +0,0 @@ -/* - * 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 - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1; - -import com.google.api.core.BetaApi; -import com.google.protobuf.AbstractMessage; -import com.google.protobuf.Empty; -import com.google.showcase.v1beta1.IdentityGrpc.IdentityImplBase; -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 MockIdentityImpl extends IdentityImplBase { - private List requests; - private Queue responses; - - public MockIdentityImpl() { - 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 createUser(CreateUserRequest request, StreamObserver responseObserver) { - Object response = responses.poll(); - if (response instanceof User) { - requests.add(request); - responseObserver.onNext(((User) 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 CreateUser, expected %s or %s", - response == null ? "null" : response.getClass().getName(), - User.class.getName(), - Exception.class.getName()))); - } - } - - @Override - public void getUser(GetUserRequest request, StreamObserver responseObserver) { - Object response = responses.poll(); - if (response instanceof User) { - requests.add(request); - responseObserver.onNext(((User) 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 GetUser, expected %s or %s", - response == null ? "null" : response.getClass().getName(), - User.class.getName(), - Exception.class.getName()))); - } - } - - @Override - public void updateUser(UpdateUserRequest request, StreamObserver responseObserver) { - Object response = responses.poll(); - if (response instanceof User) { - requests.add(request); - responseObserver.onNext(((User) 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 UpdateUser, expected %s or %s", - response == null ? "null" : response.getClass().getName(), - User.class.getName(), - Exception.class.getName()))); - } - } - - @Override - public void deleteUser(DeleteUserRequest 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 DeleteUser, expected %s or %s", - response == null ? "null" : response.getClass().getName(), - Empty.class.getName(), - Exception.class.getName()))); - } - } - - @Override - public void listUsers( - ListUsersRequest request, StreamObserver responseObserver) { - Object response = responses.poll(); - if (response instanceof ListUsersResponse) { - requests.add(request); - responseObserver.onNext(((ListUsersResponse) 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 ListUsers, expected %s or %s", - response == null ? "null" : response.getClass().getName(), - ListUsersResponse.class.getName(), - Exception.class.getName()))); - } - } -} diff --git a/showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/MockMessaging.java b/showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/MockMessaging.java deleted file mode 100644 index 213a8982b8..0000000000 --- a/showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/MockMessaging.java +++ /dev/null @@ -1,59 +0,0 @@ -/* - * 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 - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1; - -import com.google.api.core.BetaApi; -import com.google.api.gax.grpc.testing.MockGrpcService; -import com.google.protobuf.AbstractMessage; -import io.grpc.ServerServiceDefinition; -import java.util.List; -import javax.annotation.Generated; - -@BetaApi -@Generated("by gapic-generator-java") -public class MockMessaging implements MockGrpcService { - private final MockMessagingImpl serviceImpl; - - public MockMessaging() { - serviceImpl = new MockMessagingImpl(); - } - - @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/showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/MockMessagingImpl.java b/showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/MockMessagingImpl.java deleted file mode 100644 index f14386051c..0000000000 --- a/showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/MockMessagingImpl.java +++ /dev/null @@ -1,380 +0,0 @@ -/* - * 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 - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1; - -import com.google.api.core.BetaApi; -import com.google.longrunning.Operation; -import com.google.protobuf.AbstractMessage; -import com.google.protobuf.Empty; -import com.google.showcase.v1beta1.MessagingGrpc.MessagingImplBase; -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 MockMessagingImpl extends MessagingImplBase { - private List requests; - private Queue responses; - - public MockMessagingImpl() { - 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 createRoom(CreateRoomRequest request, StreamObserver responseObserver) { - Object response = responses.poll(); - if (response instanceof Room) { - requests.add(request); - responseObserver.onNext(((Room) 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 CreateRoom, expected %s or %s", - response == null ? "null" : response.getClass().getName(), - Room.class.getName(), - Exception.class.getName()))); - } - } - - @Override - public void getRoom(GetRoomRequest request, StreamObserver responseObserver) { - Object response = responses.poll(); - if (response instanceof Room) { - requests.add(request); - responseObserver.onNext(((Room) 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 GetRoom, expected %s or %s", - response == null ? "null" : response.getClass().getName(), - Room.class.getName(), - Exception.class.getName()))); - } - } - - @Override - public void updateRoom(UpdateRoomRequest request, StreamObserver responseObserver) { - Object response = responses.poll(); - if (response instanceof Room) { - requests.add(request); - responseObserver.onNext(((Room) 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 UpdateRoom, expected %s or %s", - response == null ? "null" : response.getClass().getName(), - Room.class.getName(), - Exception.class.getName()))); - } - } - - @Override - public void deleteRoom(DeleteRoomRequest 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 DeleteRoom, expected %s or %s", - response == null ? "null" : response.getClass().getName(), - Empty.class.getName(), - Exception.class.getName()))); - } - } - - @Override - public void listRooms( - ListRoomsRequest request, StreamObserver responseObserver) { - Object response = responses.poll(); - if (response instanceof ListRoomsResponse) { - requests.add(request); - responseObserver.onNext(((ListRoomsResponse) 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 ListRooms, expected %s or %s", - response == null ? "null" : response.getClass().getName(), - ListRoomsResponse.class.getName(), - Exception.class.getName()))); - } - } - - @Override - public void createBlurb(CreateBlurbRequest request, StreamObserver responseObserver) { - Object response = responses.poll(); - if (response instanceof Blurb) { - requests.add(request); - responseObserver.onNext(((Blurb) 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 CreateBlurb, expected %s or %s", - response == null ? "null" : response.getClass().getName(), - Blurb.class.getName(), - Exception.class.getName()))); - } - } - - @Override - public void getBlurb(GetBlurbRequest request, StreamObserver responseObserver) { - Object response = responses.poll(); - if (response instanceof Blurb) { - requests.add(request); - responseObserver.onNext(((Blurb) 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 GetBlurb, expected %s or %s", - response == null ? "null" : response.getClass().getName(), - Blurb.class.getName(), - Exception.class.getName()))); - } - } - - @Override - public void updateBlurb(UpdateBlurbRequest request, StreamObserver responseObserver) { - Object response = responses.poll(); - if (response instanceof Blurb) { - requests.add(request); - responseObserver.onNext(((Blurb) 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 UpdateBlurb, expected %s or %s", - response == null ? "null" : response.getClass().getName(), - Blurb.class.getName(), - Exception.class.getName()))); - } - } - - @Override - public void deleteBlurb(DeleteBlurbRequest 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 DeleteBlurb, expected %s or %s", - response == null ? "null" : response.getClass().getName(), - Empty.class.getName(), - Exception.class.getName()))); - } - } - - @Override - public void listBlurbs( - ListBlurbsRequest request, StreamObserver responseObserver) { - Object response = responses.poll(); - if (response instanceof ListBlurbsResponse) { - requests.add(request); - responseObserver.onNext(((ListBlurbsResponse) 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 ListBlurbs, expected %s or %s", - response == null ? "null" : response.getClass().getName(), - ListBlurbsResponse.class.getName(), - Exception.class.getName()))); - } - } - - @Override - public void searchBlurbs( - SearchBlurbsRequest 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 SearchBlurbs, expected %s or %s", - response == null ? "null" : response.getClass().getName(), - Operation.class.getName(), - Exception.class.getName()))); - } - } - - @Override - public void streamBlurbs( - StreamBlurbsRequest request, StreamObserver responseObserver) { - Object response = responses.poll(); - if (response instanceof StreamBlurbsResponse) { - requests.add(request); - responseObserver.onNext(((StreamBlurbsResponse) 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 StreamBlurbs, expected %s or %s", - response == null ? "null" : response.getClass().getName(), - StreamBlurbsResponse.class.getName(), - Exception.class.getName()))); - } - } - - @Override - public StreamObserver sendBlurbs( - final StreamObserver responseObserver) { - StreamObserver requestObserver = - new StreamObserver() { - @Override - public void onNext(CreateBlurbRequest value) { - requests.add(value); - final Object response = responses.remove(); - if (response instanceof SendBlurbsResponse) { - responseObserver.onNext(((SendBlurbsResponse) response)); - } else if (response instanceof Exception) { - responseObserver.onError(((Exception) response)); - } else { - responseObserver.onError( - new IllegalArgumentException( - String.format( - "Unrecognized response type %s for method SendBlurbs, expected %s or %s", - response == null ? "null" : response.getClass().getName(), - SendBlurbsResponse.class.getName(), - Exception.class.getName()))); - } - } - - @Override - public void onError(Throwable t) { - responseObserver.onError(t); - } - - @Override - public void onCompleted() { - responseObserver.onCompleted(); - } - }; - return requestObserver; - } - - @Override - public StreamObserver connect( - final StreamObserver responseObserver) { - StreamObserver requestObserver = - new StreamObserver() { - @Override - public void onNext(ConnectRequest value) { - requests.add(value); - final Object response = responses.remove(); - if (response instanceof StreamBlurbsResponse) { - responseObserver.onNext(((StreamBlurbsResponse) response)); - } else if (response instanceof Exception) { - responseObserver.onError(((Exception) response)); - } else { - responseObserver.onError( - new IllegalArgumentException( - String.format( - "Unrecognized response type %s for method Connect, expected %s or %s", - response == null ? "null" : response.getClass().getName(), - StreamBlurbsResponse.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/showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/MockSequenceService.java b/showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/MockSequenceService.java deleted file mode 100644 index 6e7db409ff..0000000000 --- a/showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/MockSequenceService.java +++ /dev/null @@ -1,59 +0,0 @@ -/* - * 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 - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1; - -import com.google.api.core.BetaApi; -import com.google.api.gax.grpc.testing.MockGrpcService; -import com.google.protobuf.AbstractMessage; -import io.grpc.ServerServiceDefinition; -import java.util.List; -import javax.annotation.Generated; - -@BetaApi -@Generated("by gapic-generator-java") -public class MockSequenceService implements MockGrpcService { - private final MockSequenceServiceImpl serviceImpl; - - public MockSequenceService() { - serviceImpl = new MockSequenceServiceImpl(); - } - - @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/showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/MockSequenceServiceImpl.java b/showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/MockSequenceServiceImpl.java deleted file mode 100644 index a529856c95..0000000000 --- a/showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/MockSequenceServiceImpl.java +++ /dev/null @@ -1,124 +0,0 @@ -/* - * 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 - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1; - -import com.google.api.core.BetaApi; -import com.google.protobuf.AbstractMessage; -import com.google.protobuf.Empty; -import com.google.showcase.v1beta1.SequenceServiceGrpc.SequenceServiceImplBase; -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 MockSequenceServiceImpl extends SequenceServiceImplBase { - private List requests; - private Queue responses; - - public MockSequenceServiceImpl() { - 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 createSequence( - CreateSequenceRequest request, StreamObserver responseObserver) { - Object response = responses.poll(); - if (response instanceof Sequence) { - requests.add(request); - responseObserver.onNext(((Sequence) 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 CreateSequence, expected %s or %s", - response == null ? "null" : response.getClass().getName(), - Sequence.class.getName(), - Exception.class.getName()))); - } - } - - @Override - public void getSequenceReport( - GetSequenceReportRequest request, StreamObserver responseObserver) { - Object response = responses.poll(); - if (response instanceof SequenceReport) { - requests.add(request); - responseObserver.onNext(((SequenceReport) 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 GetSequenceReport, expected %s or %s", - response == null ? "null" : response.getClass().getName(), - SequenceReport.class.getName(), - Exception.class.getName()))); - } - } - - @Override - public void attemptSequence( - AttemptSequenceRequest 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 AttemptSequence, expected %s or %s", - response == null ? "null" : response.getClass().getName(), - Empty.class.getName(), - Exception.class.getName()))); - } - } -} diff --git a/showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/MockTesting.java b/showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/MockTesting.java deleted file mode 100644 index 07bf673623..0000000000 --- a/showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/MockTesting.java +++ /dev/null @@ -1,59 +0,0 @@ -/* - * 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 - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1; - -import com.google.api.core.BetaApi; -import com.google.api.gax.grpc.testing.MockGrpcService; -import com.google.protobuf.AbstractMessage; -import io.grpc.ServerServiceDefinition; -import java.util.List; -import javax.annotation.Generated; - -@BetaApi -@Generated("by gapic-generator-java") -public class MockTesting implements MockGrpcService { - private final MockTestingImpl serviceImpl; - - public MockTesting() { - serviceImpl = new MockTestingImpl(); - } - - @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/showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/MockTestingImpl.java b/showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/MockTestingImpl.java deleted file mode 100644 index 8bc492536e..0000000000 --- a/showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/MockTestingImpl.java +++ /dev/null @@ -1,226 +0,0 @@ -/* - * 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 - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1; - -import com.google.api.core.BetaApi; -import com.google.protobuf.AbstractMessage; -import com.google.protobuf.Empty; -import com.google.showcase.v1beta1.TestingGrpc.TestingImplBase; -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 MockTestingImpl extends TestingImplBase { - private List requests; - private Queue responses; - - public MockTestingImpl() { - 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 createSession( - CreateSessionRequest request, StreamObserver responseObserver) { - Object response = responses.poll(); - if (response instanceof Session) { - requests.add(request); - responseObserver.onNext(((Session) 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 CreateSession, expected %s or %s", - response == null ? "null" : response.getClass().getName(), - Session.class.getName(), - Exception.class.getName()))); - } - } - - @Override - public void getSession(GetSessionRequest request, StreamObserver responseObserver) { - Object response = responses.poll(); - if (response instanceof Session) { - requests.add(request); - responseObserver.onNext(((Session) 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 GetSession, expected %s or %s", - response == null ? "null" : response.getClass().getName(), - Session.class.getName(), - Exception.class.getName()))); - } - } - - @Override - public void listSessions( - ListSessionsRequest request, StreamObserver responseObserver) { - Object response = responses.poll(); - if (response instanceof ListSessionsResponse) { - requests.add(request); - responseObserver.onNext(((ListSessionsResponse) 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 ListSessions, expected %s or %s", - response == null ? "null" : response.getClass().getName(), - ListSessionsResponse.class.getName(), - Exception.class.getName()))); - } - } - - @Override - public void deleteSession(DeleteSessionRequest 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 DeleteSession, expected %s or %s", - response == null ? "null" : response.getClass().getName(), - Empty.class.getName(), - Exception.class.getName()))); - } - } - - @Override - public void reportSession( - ReportSessionRequest request, StreamObserver responseObserver) { - Object response = responses.poll(); - if (response instanceof ReportSessionResponse) { - requests.add(request); - responseObserver.onNext(((ReportSessionResponse) 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 ReportSession, expected %s or %s", - response == null ? "null" : response.getClass().getName(), - ReportSessionResponse.class.getName(), - Exception.class.getName()))); - } - } - - @Override - public void listTests( - ListTestsRequest request, StreamObserver responseObserver) { - Object response = responses.poll(); - if (response instanceof ListTestsResponse) { - requests.add(request); - responseObserver.onNext(((ListTestsResponse) 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 ListTests, expected %s or %s", - response == null ? "null" : response.getClass().getName(), - ListTestsResponse.class.getName(), - Exception.class.getName()))); - } - } - - @Override - public void deleteTest(DeleteTestRequest 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 DeleteTest, expected %s or %s", - response == null ? "null" : response.getClass().getName(), - Empty.class.getName(), - Exception.class.getName()))); - } - } - - @Override - public void verifyTest( - VerifyTestRequest request, StreamObserver responseObserver) { - Object response = responses.poll(); - if (response instanceof VerifyTestResponse) { - requests.add(request); - responseObserver.onNext(((VerifyTestResponse) 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 VerifyTest, expected %s or %s", - response == null ? "null" : response.getClass().getName(), - VerifyTestResponse.class.getName(), - Exception.class.getName()))); - } - } -} diff --git a/showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/SequenceServiceClientHttpJsonTest.java b/showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/SequenceServiceClientHttpJsonTest.java deleted file mode 100644 index 167002e8f2..0000000000 --- a/showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/SequenceServiceClientHttpJsonTest.java +++ /dev/null @@ -1,290 +0,0 @@ -/* - * 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 - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1; - -import com.google.api.gax.core.NoCredentialsProvider; -import com.google.api.gax.httpjson.GaxHttpJsonProperties; -import com.google.api.gax.httpjson.testing.MockHttpService; -import com.google.api.gax.rpc.ApiClientHeaderProvider; -import com.google.api.gax.rpc.ApiException; -import com.google.api.gax.rpc.ApiExceptionFactory; -import com.google.api.gax.rpc.InvalidArgumentException; -import com.google.api.gax.rpc.StatusCode; -import com.google.api.gax.rpc.testing.FakeStatusCode; -import com.google.protobuf.Empty; -import com.google.showcase.v1beta1.stub.HttpJsonSequenceServiceStub; -import java.io.IOException; -import java.util.ArrayList; -import java.util.List; -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 SequenceServiceClientHttpJsonTest { - private static MockHttpService mockService; - private static SequenceServiceClient client; - - @BeforeClass - public static void startStaticServer() throws IOException { - mockService = - new MockHttpService( - HttpJsonSequenceServiceStub.getMethodDescriptors(), - SequenceServiceSettings.getDefaultEndpoint()); - SequenceServiceSettings settings = - SequenceServiceSettings.newHttpJsonBuilder() - .setTransportChannelProvider( - SequenceServiceSettings.defaultHttpJsonTransportProviderBuilder() - .setHttpTransport(mockService) - .build()) - .setCredentialsProvider(NoCredentialsProvider.create()) - .build(); - client = SequenceServiceClient.create(settings); - } - - @AfterClass - public static void stopServer() { - client.close(); - } - - @Before - public void setUp() {} - - @After - public void tearDown() throws Exception { - mockService.reset(); - } - - @Test - public void createSequenceTest() throws Exception { - Sequence expectedResponse = - Sequence.newBuilder() - .setName(SequenceName.of("[SEQUENCE]").toString()) - .addAllResponses(new ArrayList()) - .build(); - mockService.addResponse(expectedResponse); - - Sequence sequence = Sequence.newBuilder().build(); - - Sequence actualResponse = client.createSequence(sequence); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockService.getRequestPaths(); - Assert.assertEquals(1, actualRequests.size()); - - String apiClientHeaderKey = - mockService - .getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) - .iterator() - .next(); - Assert.assertTrue( - GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey) - .matches()); - } - - @Test - public void createSequenceExceptionTest() throws Exception { - ApiException exception = - ApiExceptionFactory.createException( - new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); - mockService.addException(exception); - - try { - Sequence sequence = Sequence.newBuilder().build(); - client.createSequence(sequence); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void getSequenceReportTest() throws Exception { - SequenceReport expectedResponse = - SequenceReport.newBuilder() - .setName(SequenceReportName.of("[SEQUENCE]").toString()) - .addAllAttempts(new ArrayList()) - .build(); - mockService.addResponse(expectedResponse); - - SequenceReportName name = SequenceReportName.of("[SEQUENCE]"); - - SequenceReport actualResponse = client.getSequenceReport(name); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockService.getRequestPaths(); - Assert.assertEquals(1, actualRequests.size()); - - String apiClientHeaderKey = - mockService - .getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) - .iterator() - .next(); - Assert.assertTrue( - GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey) - .matches()); - } - - @Test - public void getSequenceReportExceptionTest() throws Exception { - ApiException exception = - ApiExceptionFactory.createException( - new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); - mockService.addException(exception); - - try { - SequenceReportName name = SequenceReportName.of("[SEQUENCE]"); - client.getSequenceReport(name); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void getSequenceReportTest2() throws Exception { - SequenceReport expectedResponse = - SequenceReport.newBuilder() - .setName(SequenceReportName.of("[SEQUENCE]").toString()) - .addAllAttempts(new ArrayList()) - .build(); - mockService.addResponse(expectedResponse); - - String name = "sequences/sequence-5566/sequenceReport"; - - SequenceReport actualResponse = client.getSequenceReport(name); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockService.getRequestPaths(); - Assert.assertEquals(1, actualRequests.size()); - - String apiClientHeaderKey = - mockService - .getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) - .iterator() - .next(); - Assert.assertTrue( - GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey) - .matches()); - } - - @Test - public void getSequenceReportExceptionTest2() throws Exception { - ApiException exception = - ApiExceptionFactory.createException( - new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); - mockService.addException(exception); - - try { - String name = "sequences/sequence-5566/sequenceReport"; - client.getSequenceReport(name); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void attemptSequenceTest() throws Exception { - Empty expectedResponse = Empty.newBuilder().build(); - mockService.addResponse(expectedResponse); - - SequenceName name = SequenceName.of("[SEQUENCE]"); - - client.attemptSequence(name); - - List actualRequests = mockService.getRequestPaths(); - Assert.assertEquals(1, actualRequests.size()); - - String apiClientHeaderKey = - mockService - .getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) - .iterator() - .next(); - Assert.assertTrue( - GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey) - .matches()); - } - - @Test - public void attemptSequenceExceptionTest() throws Exception { - ApiException exception = - ApiExceptionFactory.createException( - new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); - mockService.addException(exception); - - try { - SequenceName name = SequenceName.of("[SEQUENCE]"); - client.attemptSequence(name); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void attemptSequenceTest2() throws Exception { - Empty expectedResponse = Empty.newBuilder().build(); - mockService.addResponse(expectedResponse); - - String name = "sequences/sequence-9950"; - - client.attemptSequence(name); - - List actualRequests = mockService.getRequestPaths(); - Assert.assertEquals(1, actualRequests.size()); - - String apiClientHeaderKey = - mockService - .getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) - .iterator() - .next(); - Assert.assertTrue( - GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey) - .matches()); - } - - @Test - public void attemptSequenceExceptionTest2() throws Exception { - ApiException exception = - ApiExceptionFactory.createException( - new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); - mockService.addException(exception); - - try { - String name = "sequences/sequence-9950"; - client.attemptSequence(name); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } -} diff --git a/showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/SequenceServiceClientTest.java b/showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/SequenceServiceClientTest.java deleted file mode 100644 index 4b6f722827..0000000000 --- a/showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/SequenceServiceClientTest.java +++ /dev/null @@ -1,264 +0,0 @@ -/* - * 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 - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1; - -import com.google.api.gax.core.NoCredentialsProvider; -import com.google.api.gax.grpc.GaxGrpcProperties; -import com.google.api.gax.grpc.testing.LocalChannelProvider; -import com.google.api.gax.grpc.testing.MockGrpcService; -import com.google.api.gax.grpc.testing.MockServiceHelper; -import com.google.api.gax.rpc.ApiClientHeaderProvider; -import com.google.api.gax.rpc.InvalidArgumentException; -import com.google.protobuf.AbstractMessage; -import com.google.protobuf.Empty; -import io.grpc.StatusRuntimeException; -import java.io.IOException; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; -import java.util.UUID; -import javax.annotation.Generated; -import org.junit.After; -import org.junit.AfterClass; -import org.junit.Assert; -import org.junit.Before; -import org.junit.BeforeClass; -import org.junit.Test; - -@Generated("by gapic-generator-java") -public class SequenceServiceClientTest { - private static MockSequenceService mockSequenceService; - private static MockServiceHelper mockServiceHelper; - private LocalChannelProvider channelProvider; - private SequenceServiceClient client; - - @BeforeClass - public static void startStaticServer() { - mockSequenceService = new MockSequenceService(); - mockServiceHelper = - new MockServiceHelper( - UUID.randomUUID().toString(), Arrays.asList(mockSequenceService)); - mockServiceHelper.start(); - } - - @AfterClass - public static void stopServer() { - mockServiceHelper.stop(); - } - - @Before - public void setUp() throws IOException { - mockServiceHelper.reset(); - channelProvider = mockServiceHelper.createChannelProvider(); - SequenceServiceSettings settings = - SequenceServiceSettings.newBuilder() - .setTransportChannelProvider(channelProvider) - .setCredentialsProvider(NoCredentialsProvider.create()) - .build(); - client = SequenceServiceClient.create(settings); - } - - @After - public void tearDown() throws Exception { - client.close(); - } - - @Test - public void createSequenceTest() throws Exception { - Sequence expectedResponse = - Sequence.newBuilder() - .setName(SequenceName.of("[SEQUENCE]").toString()) - .addAllResponses(new ArrayList()) - .build(); - mockSequenceService.addResponse(expectedResponse); - - Sequence sequence = Sequence.newBuilder().build(); - - Sequence actualResponse = client.createSequence(sequence); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockSequenceService.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - CreateSequenceRequest actualRequest = ((CreateSequenceRequest) actualRequests.get(0)); - - Assert.assertEquals(sequence, actualRequest.getSequence()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - public void createSequenceExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); - mockSequenceService.addException(exception); - - try { - Sequence sequence = Sequence.newBuilder().build(); - client.createSequence(sequence); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void getSequenceReportTest() throws Exception { - SequenceReport expectedResponse = - SequenceReport.newBuilder() - .setName(SequenceReportName.of("[SEQUENCE]").toString()) - .addAllAttempts(new ArrayList()) - .build(); - mockSequenceService.addResponse(expectedResponse); - - SequenceReportName name = SequenceReportName.of("[SEQUENCE]"); - - SequenceReport actualResponse = client.getSequenceReport(name); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockSequenceService.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - GetSequenceReportRequest actualRequest = ((GetSequenceReportRequest) actualRequests.get(0)); - - Assert.assertEquals(name.toString(), actualRequest.getName()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - public void getSequenceReportExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); - mockSequenceService.addException(exception); - - try { - SequenceReportName name = SequenceReportName.of("[SEQUENCE]"); - client.getSequenceReport(name); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void getSequenceReportTest2() throws Exception { - SequenceReport expectedResponse = - SequenceReport.newBuilder() - .setName(SequenceReportName.of("[SEQUENCE]").toString()) - .addAllAttempts(new ArrayList()) - .build(); - mockSequenceService.addResponse(expectedResponse); - - String name = "name3373707"; - - SequenceReport actualResponse = client.getSequenceReport(name); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockSequenceService.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - GetSequenceReportRequest actualRequest = ((GetSequenceReportRequest) actualRequests.get(0)); - - Assert.assertEquals(name, actualRequest.getName()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - public void getSequenceReportExceptionTest2() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); - mockSequenceService.addException(exception); - - try { - String name = "name3373707"; - client.getSequenceReport(name); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void attemptSequenceTest() throws Exception { - Empty expectedResponse = Empty.newBuilder().build(); - mockSequenceService.addResponse(expectedResponse); - - SequenceName name = SequenceName.of("[SEQUENCE]"); - - client.attemptSequence(name); - - List actualRequests = mockSequenceService.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - AttemptSequenceRequest actualRequest = ((AttemptSequenceRequest) actualRequests.get(0)); - - Assert.assertEquals(name.toString(), actualRequest.getName()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - public void attemptSequenceExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); - mockSequenceService.addException(exception); - - try { - SequenceName name = SequenceName.of("[SEQUENCE]"); - client.attemptSequence(name); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void attemptSequenceTest2() throws Exception { - Empty expectedResponse = Empty.newBuilder().build(); - mockSequenceService.addResponse(expectedResponse); - - String name = "name3373707"; - - client.attemptSequence(name); - - List actualRequests = mockSequenceService.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - AttemptSequenceRequest actualRequest = ((AttemptSequenceRequest) actualRequests.get(0)); - - Assert.assertEquals(name, actualRequest.getName()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - public void attemptSequenceExceptionTest2() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); - mockSequenceService.addException(exception); - - try { - String name = "name3373707"; - client.attemptSequence(name); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } -} diff --git a/showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/TestingClientHttpJsonTest.java b/showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/TestingClientHttpJsonTest.java deleted file mode 100644 index b16824b565..0000000000 --- a/showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/TestingClientHttpJsonTest.java +++ /dev/null @@ -1,472 +0,0 @@ -/* - * 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 - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1; - -import static com.google.showcase.v1beta1.TestingClient.ListSessionsPagedResponse; -import static com.google.showcase.v1beta1.TestingClient.ListTestsPagedResponse; - -import com.google.api.gax.core.NoCredentialsProvider; -import com.google.api.gax.httpjson.GaxHttpJsonProperties; -import com.google.api.gax.httpjson.testing.MockHttpService; -import com.google.api.gax.rpc.ApiClientHeaderProvider; -import com.google.api.gax.rpc.ApiException; -import com.google.api.gax.rpc.ApiExceptionFactory; -import com.google.api.gax.rpc.InvalidArgumentException; -import com.google.api.gax.rpc.StatusCode; -import com.google.api.gax.rpc.testing.FakeStatusCode; -import com.google.common.collect.Lists; -import com.google.protobuf.ByteString; -import com.google.protobuf.Empty; -import com.google.showcase.v1beta1.stub.HttpJsonTestingStub; -import java.io.IOException; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; -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 TestingClientHttpJsonTest { - private static MockHttpService mockService; - private static TestingClient client; - - @BeforeClass - public static void startStaticServer() throws IOException { - mockService = - new MockHttpService( - HttpJsonTestingStub.getMethodDescriptors(), TestingSettings.getDefaultEndpoint()); - TestingSettings settings = - TestingSettings.newHttpJsonBuilder() - .setTransportChannelProvider( - TestingSettings.defaultHttpJsonTransportProviderBuilder() - .setHttpTransport(mockService) - .build()) - .setCredentialsProvider(NoCredentialsProvider.create()) - .build(); - client = TestingClient.create(settings); - } - - @AfterClass - public static void stopServer() { - client.close(); - } - - @Before - public void setUp() {} - - @After - public void tearDown() throws Exception { - mockService.reset(); - } - - @Test - public void createSessionTest() throws Exception { - Session expectedResponse = - Session.newBuilder().setName(SessionName.of("[SESSION]").toString()).build(); - mockService.addResponse(expectedResponse); - - CreateSessionRequest request = - CreateSessionRequest.newBuilder().setSession(Session.newBuilder().build()).build(); - - Session actualResponse = client.createSession(request); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockService.getRequestPaths(); - Assert.assertEquals(1, actualRequests.size()); - - String apiClientHeaderKey = - mockService - .getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) - .iterator() - .next(); - Assert.assertTrue( - GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey) - .matches()); - } - - @Test - public void createSessionExceptionTest() throws Exception { - ApiException exception = - ApiExceptionFactory.createException( - new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); - mockService.addException(exception); - - try { - CreateSessionRequest request = - CreateSessionRequest.newBuilder().setSession(Session.newBuilder().build()).build(); - client.createSession(request); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void getSessionTest() throws Exception { - Session expectedResponse = - Session.newBuilder().setName(SessionName.of("[SESSION]").toString()).build(); - mockService.addResponse(expectedResponse); - - GetSessionRequest request = - GetSessionRequest.newBuilder().setName(SessionName.of("[SESSION]").toString()).build(); - - Session actualResponse = client.getSession(request); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockService.getRequestPaths(); - Assert.assertEquals(1, actualRequests.size()); - - String apiClientHeaderKey = - mockService - .getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) - .iterator() - .next(); - Assert.assertTrue( - GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey) - .matches()); - } - - @Test - public void getSessionExceptionTest() throws Exception { - ApiException exception = - ApiExceptionFactory.createException( - new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); - mockService.addException(exception); - - try { - GetSessionRequest request = - GetSessionRequest.newBuilder().setName(SessionName.of("[SESSION]").toString()).build(); - client.getSession(request); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void listSessionsTest() throws Exception { - Session responsesElement = Session.newBuilder().build(); - ListSessionsResponse expectedResponse = - ListSessionsResponse.newBuilder() - .setNextPageToken("") - .addAllSessions(Arrays.asList(responsesElement)) - .build(); - mockService.addResponse(expectedResponse); - - ListSessionsRequest request = - ListSessionsRequest.newBuilder() - .setPageSize(883849137) - .setPageToken("pageToken873572522") - .build(); - - ListSessionsPagedResponse pagedListResponse = client.listSessions(request); - - List resources = Lists.newArrayList(pagedListResponse.iterateAll()); - - Assert.assertEquals(1, resources.size()); - Assert.assertEquals(expectedResponse.getSessionsList().get(0), resources.get(0)); - - List actualRequests = mockService.getRequestPaths(); - Assert.assertEquals(1, actualRequests.size()); - - String apiClientHeaderKey = - mockService - .getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) - .iterator() - .next(); - Assert.assertTrue( - GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey) - .matches()); - } - - @Test - public void listSessionsExceptionTest() throws Exception { - ApiException exception = - ApiExceptionFactory.createException( - new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); - mockService.addException(exception); - - try { - ListSessionsRequest request = - ListSessionsRequest.newBuilder() - .setPageSize(883849137) - .setPageToken("pageToken873572522") - .build(); - client.listSessions(request); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void deleteSessionTest() throws Exception { - Empty expectedResponse = Empty.newBuilder().build(); - mockService.addResponse(expectedResponse); - - DeleteSessionRequest request = - DeleteSessionRequest.newBuilder().setName(SessionName.of("[SESSION]").toString()).build(); - - client.deleteSession(request); - - List actualRequests = mockService.getRequestPaths(); - Assert.assertEquals(1, actualRequests.size()); - - String apiClientHeaderKey = - mockService - .getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) - .iterator() - .next(); - Assert.assertTrue( - GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey) - .matches()); - } - - @Test - public void deleteSessionExceptionTest() throws Exception { - ApiException exception = - ApiExceptionFactory.createException( - new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); - mockService.addException(exception); - - try { - DeleteSessionRequest request = - DeleteSessionRequest.newBuilder().setName(SessionName.of("[SESSION]").toString()).build(); - client.deleteSession(request); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void reportSessionTest() throws Exception { - ReportSessionResponse expectedResponse = - ReportSessionResponse.newBuilder().addAllTestRuns(new ArrayList()).build(); - mockService.addResponse(expectedResponse); - - ReportSessionRequest request = - ReportSessionRequest.newBuilder().setName(SessionName.of("[SESSION]").toString()).build(); - - ReportSessionResponse actualResponse = client.reportSession(request); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockService.getRequestPaths(); - Assert.assertEquals(1, actualRequests.size()); - - String apiClientHeaderKey = - mockService - .getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) - .iterator() - .next(); - Assert.assertTrue( - GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey) - .matches()); - } - - @Test - public void reportSessionExceptionTest() throws Exception { - ApiException exception = - ApiExceptionFactory.createException( - new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); - mockService.addException(exception); - - try { - ReportSessionRequest request = - ReportSessionRequest.newBuilder().setName(SessionName.of("[SESSION]").toString()).build(); - client.reportSession(request); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void listTestsTest() throws Exception { - com.google.showcase.v1beta1.Test responsesElement = - com.google.showcase.v1beta1.Test.newBuilder().build(); - ListTestsResponse expectedResponse = - ListTestsResponse.newBuilder() - .setNextPageToken("") - .addAllTests(Arrays.asList(responsesElement)) - .build(); - mockService.addResponse(expectedResponse); - - ListTestsRequest request = - ListTestsRequest.newBuilder() - .setParent(SessionName.of("[SESSION]").toString()) - .setPageSize(883849137) - .setPageToken("pageToken873572522") - .build(); - - ListTestsPagedResponse pagedListResponse = client.listTests(request); - - List resources = - Lists.newArrayList(pagedListResponse.iterateAll()); - - Assert.assertEquals(1, resources.size()); - Assert.assertEquals(expectedResponse.getTestsList().get(0), resources.get(0)); - - List actualRequests = mockService.getRequestPaths(); - Assert.assertEquals(1, actualRequests.size()); - - String apiClientHeaderKey = - mockService - .getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) - .iterator() - .next(); - Assert.assertTrue( - GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey) - .matches()); - } - - @Test - public void listTestsExceptionTest() throws Exception { - ApiException exception = - ApiExceptionFactory.createException( - new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); - mockService.addException(exception); - - try { - ListTestsRequest request = - ListTestsRequest.newBuilder() - .setParent(SessionName.of("[SESSION]").toString()) - .setPageSize(883849137) - .setPageToken("pageToken873572522") - .build(); - client.listTests(request); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void deleteTestTest() throws Exception { - Empty expectedResponse = Empty.newBuilder().build(); - mockService.addResponse(expectedResponse); - - DeleteTestRequest request = - DeleteTestRequest.newBuilder() - .setName(TestName.of("[SESSION]", "[TEST]").toString()) - .build(); - - client.deleteTest(request); - - List actualRequests = mockService.getRequestPaths(); - Assert.assertEquals(1, actualRequests.size()); - - String apiClientHeaderKey = - mockService - .getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) - .iterator() - .next(); - Assert.assertTrue( - GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey) - .matches()); - } - - @Test - public void deleteTestExceptionTest() throws Exception { - ApiException exception = - ApiExceptionFactory.createException( - new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); - mockService.addException(exception); - - try { - DeleteTestRequest request = - DeleteTestRequest.newBuilder() - .setName(TestName.of("[SESSION]", "[TEST]").toString()) - .build(); - client.deleteTest(request); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void verifyTestTest() throws Exception { - VerifyTestResponse expectedResponse = - VerifyTestResponse.newBuilder().setIssue(Issue.newBuilder().build()).build(); - mockService.addResponse(expectedResponse); - - VerifyTestRequest request = - VerifyTestRequest.newBuilder() - .setName(TestName.of("[SESSION]", "[TEST]").toString()) - .setAnswer(ByteString.EMPTY) - .addAllAnswers(new ArrayList()) - .build(); - - VerifyTestResponse actualResponse = client.verifyTest(request); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockService.getRequestPaths(); - Assert.assertEquals(1, actualRequests.size()); - - String apiClientHeaderKey = - mockService - .getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) - .iterator() - .next(); - Assert.assertTrue( - GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey) - .matches()); - } - - @Test - public void verifyTestExceptionTest() throws Exception { - ApiException exception = - ApiExceptionFactory.createException( - new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); - mockService.addException(exception); - - try { - VerifyTestRequest request = - VerifyTestRequest.newBuilder() - .setName(TestName.of("[SESSION]", "[TEST]").toString()) - .setAnswer(ByteString.EMPTY) - .addAllAnswers(new ArrayList()) - .build(); - client.verifyTest(request); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } -} diff --git a/showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/TestingClientTest.java b/showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/TestingClientTest.java deleted file mode 100644 index 27ac6b9632..0000000000 --- a/showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/TestingClientTest.java +++ /dev/null @@ -1,433 +0,0 @@ -/* - * 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 - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1; - -import static com.google.showcase.v1beta1.TestingClient.ListSessionsPagedResponse; -import static com.google.showcase.v1beta1.TestingClient.ListTestsPagedResponse; - -import com.google.api.gax.core.NoCredentialsProvider; -import com.google.api.gax.grpc.GaxGrpcProperties; -import com.google.api.gax.grpc.testing.LocalChannelProvider; -import com.google.api.gax.grpc.testing.MockGrpcService; -import com.google.api.gax.grpc.testing.MockServiceHelper; -import com.google.api.gax.rpc.ApiClientHeaderProvider; -import com.google.api.gax.rpc.InvalidArgumentException; -import com.google.common.collect.Lists; -import com.google.protobuf.AbstractMessage; -import com.google.protobuf.ByteString; -import com.google.protobuf.Empty; -import io.grpc.StatusRuntimeException; -import java.io.IOException; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; -import java.util.UUID; -import javax.annotation.Generated; -import org.junit.After; -import org.junit.AfterClass; -import org.junit.Assert; -import org.junit.Before; -import org.junit.BeforeClass; -import org.junit.Test; - -@Generated("by gapic-generator-java") -public class TestingClientTest { - private static MockServiceHelper mockServiceHelper; - private static MockTesting mockTesting; - private LocalChannelProvider channelProvider; - private TestingClient client; - - @BeforeClass - public static void startStaticServer() { - mockTesting = new MockTesting(); - mockServiceHelper = - new MockServiceHelper( - UUID.randomUUID().toString(), Arrays.asList(mockTesting)); - mockServiceHelper.start(); - } - - @AfterClass - public static void stopServer() { - mockServiceHelper.stop(); - } - - @Before - public void setUp() throws IOException { - mockServiceHelper.reset(); - channelProvider = mockServiceHelper.createChannelProvider(); - TestingSettings settings = - TestingSettings.newBuilder() - .setTransportChannelProvider(channelProvider) - .setCredentialsProvider(NoCredentialsProvider.create()) - .build(); - client = TestingClient.create(settings); - } - - @After - public void tearDown() throws Exception { - client.close(); - } - - @Test - public void createSessionTest() throws Exception { - Session expectedResponse = - Session.newBuilder().setName(SessionName.of("[SESSION]").toString()).build(); - mockTesting.addResponse(expectedResponse); - - CreateSessionRequest request = - CreateSessionRequest.newBuilder().setSession(Session.newBuilder().build()).build(); - - Session actualResponse = client.createSession(request); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockTesting.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - CreateSessionRequest actualRequest = ((CreateSessionRequest) actualRequests.get(0)); - - Assert.assertEquals(request.getSession(), actualRequest.getSession()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - public void createSessionExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); - mockTesting.addException(exception); - - try { - CreateSessionRequest request = - CreateSessionRequest.newBuilder().setSession(Session.newBuilder().build()).build(); - client.createSession(request); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void getSessionTest() throws Exception { - Session expectedResponse = - Session.newBuilder().setName(SessionName.of("[SESSION]").toString()).build(); - mockTesting.addResponse(expectedResponse); - - GetSessionRequest request = - GetSessionRequest.newBuilder().setName(SessionName.of("[SESSION]").toString()).build(); - - Session actualResponse = client.getSession(request); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockTesting.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - GetSessionRequest actualRequest = ((GetSessionRequest) actualRequests.get(0)); - - Assert.assertEquals(request.getName(), actualRequest.getName()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - public void getSessionExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); - mockTesting.addException(exception); - - try { - GetSessionRequest request = - GetSessionRequest.newBuilder().setName(SessionName.of("[SESSION]").toString()).build(); - client.getSession(request); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void listSessionsTest() throws Exception { - Session responsesElement = Session.newBuilder().build(); - ListSessionsResponse expectedResponse = - ListSessionsResponse.newBuilder() - .setNextPageToken("") - .addAllSessions(Arrays.asList(responsesElement)) - .build(); - mockTesting.addResponse(expectedResponse); - - ListSessionsRequest request = - ListSessionsRequest.newBuilder() - .setPageSize(883849137) - .setPageToken("pageToken873572522") - .build(); - - ListSessionsPagedResponse pagedListResponse = client.listSessions(request); - - List resources = Lists.newArrayList(pagedListResponse.iterateAll()); - - Assert.assertEquals(1, resources.size()); - Assert.assertEquals(expectedResponse.getSessionsList().get(0), resources.get(0)); - - List actualRequests = mockTesting.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - ListSessionsRequest actualRequest = ((ListSessionsRequest) 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 listSessionsExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); - mockTesting.addException(exception); - - try { - ListSessionsRequest request = - ListSessionsRequest.newBuilder() - .setPageSize(883849137) - .setPageToken("pageToken873572522") - .build(); - client.listSessions(request); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void deleteSessionTest() throws Exception { - Empty expectedResponse = Empty.newBuilder().build(); - mockTesting.addResponse(expectedResponse); - - DeleteSessionRequest request = - DeleteSessionRequest.newBuilder().setName(SessionName.of("[SESSION]").toString()).build(); - - client.deleteSession(request); - - List actualRequests = mockTesting.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - DeleteSessionRequest actualRequest = ((DeleteSessionRequest) actualRequests.get(0)); - - Assert.assertEquals(request.getName(), actualRequest.getName()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - public void deleteSessionExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); - mockTesting.addException(exception); - - try { - DeleteSessionRequest request = - DeleteSessionRequest.newBuilder().setName(SessionName.of("[SESSION]").toString()).build(); - client.deleteSession(request); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void reportSessionTest() throws Exception { - ReportSessionResponse expectedResponse = - ReportSessionResponse.newBuilder().addAllTestRuns(new ArrayList()).build(); - mockTesting.addResponse(expectedResponse); - - ReportSessionRequest request = - ReportSessionRequest.newBuilder().setName(SessionName.of("[SESSION]").toString()).build(); - - ReportSessionResponse actualResponse = client.reportSession(request); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockTesting.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - ReportSessionRequest actualRequest = ((ReportSessionRequest) actualRequests.get(0)); - - Assert.assertEquals(request.getName(), actualRequest.getName()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - public void reportSessionExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); - mockTesting.addException(exception); - - try { - ReportSessionRequest request = - ReportSessionRequest.newBuilder().setName(SessionName.of("[SESSION]").toString()).build(); - client.reportSession(request); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void listTestsTest() throws Exception { - com.google.showcase.v1beta1.Test responsesElement = - com.google.showcase.v1beta1.Test.newBuilder().build(); - ListTestsResponse expectedResponse = - ListTestsResponse.newBuilder() - .setNextPageToken("") - .addAllTests(Arrays.asList(responsesElement)) - .build(); - mockTesting.addResponse(expectedResponse); - - ListTestsRequest request = - ListTestsRequest.newBuilder() - .setParent(SessionName.of("[SESSION]").toString()) - .setPageSize(883849137) - .setPageToken("pageToken873572522") - .build(); - - ListTestsPagedResponse pagedListResponse = client.listTests(request); - - List resources = - Lists.newArrayList(pagedListResponse.iterateAll()); - - Assert.assertEquals(1, resources.size()); - Assert.assertEquals(expectedResponse.getTestsList().get(0), resources.get(0)); - - List actualRequests = mockTesting.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - ListTestsRequest actualRequest = ((ListTestsRequest) actualRequests.get(0)); - - Assert.assertEquals(request.getParent(), actualRequest.getParent()); - Assert.assertEquals(request.getPageSize(), actualRequest.getPageSize()); - Assert.assertEquals(request.getPageToken(), actualRequest.getPageToken()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - public void listTestsExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); - mockTesting.addException(exception); - - try { - ListTestsRequest request = - ListTestsRequest.newBuilder() - .setParent(SessionName.of("[SESSION]").toString()) - .setPageSize(883849137) - .setPageToken("pageToken873572522") - .build(); - client.listTests(request); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void deleteTestTest() throws Exception { - Empty expectedResponse = Empty.newBuilder().build(); - mockTesting.addResponse(expectedResponse); - - DeleteTestRequest request = - DeleteTestRequest.newBuilder() - .setName(TestName.of("[SESSION]", "[TEST]").toString()) - .build(); - - client.deleteTest(request); - - List actualRequests = mockTesting.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - DeleteTestRequest actualRequest = ((DeleteTestRequest) actualRequests.get(0)); - - Assert.assertEquals(request.getName(), actualRequest.getName()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - public void deleteTestExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); - mockTesting.addException(exception); - - try { - DeleteTestRequest request = - DeleteTestRequest.newBuilder() - .setName(TestName.of("[SESSION]", "[TEST]").toString()) - .build(); - client.deleteTest(request); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void verifyTestTest() throws Exception { - VerifyTestResponse expectedResponse = - VerifyTestResponse.newBuilder().setIssue(Issue.newBuilder().build()).build(); - mockTesting.addResponse(expectedResponse); - - VerifyTestRequest request = - VerifyTestRequest.newBuilder() - .setName(TestName.of("[SESSION]", "[TEST]").toString()) - .setAnswer(ByteString.EMPTY) - .addAllAnswers(new ArrayList()) - .build(); - - VerifyTestResponse actualResponse = client.verifyTest(request); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockTesting.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - VerifyTestRequest actualRequest = ((VerifyTestRequest) actualRequests.get(0)); - - Assert.assertEquals(request.getName(), actualRequest.getName()); - Assert.assertEquals(request.getAnswer(), actualRequest.getAnswer()); - Assert.assertEquals(request.getAnswersList(), actualRequest.getAnswersList()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - public void verifyTestExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); - mockTesting.addException(exception); - - try { - VerifyTestRequest request = - VerifyTestRequest.newBuilder() - .setName(TestName.of("[SESSION]", "[TEST]").toString()) - .setAnswer(ByteString.EMPTY) - .addAllAnswers(new ArrayList()) - .build(); - client.verifyTest(request); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } -} diff --git a/showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/ITFirstHttp.java b/showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/ITFirstHttp.java deleted file mode 100644 index 02909527ca..0000000000 --- a/showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/ITFirstHttp.java +++ /dev/null @@ -1,77 +0,0 @@ -/* - * 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 - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1.it; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertThrows; - -import com.google.api.client.http.javanet.NetHttpTransport; -import com.google.api.gax.core.NoCredentialsProvider; -import com.google.api.gax.rpc.InvalidArgumentException; -import com.google.showcase.v1beta1.EchoClient; -import com.google.showcase.v1beta1.EchoRequest; -import com.google.showcase.v1beta1.EchoResponse; -import com.google.showcase.v1beta1.EchoSettings; -import java.io.IOException; -import java.security.GeneralSecurityException; -import org.junit.AfterClass; -import org.junit.BeforeClass; -import org.junit.Test; - -public class ITFirstHttp { - - private static EchoClient client; - - @BeforeClass - public static void createClient() throws IOException, GeneralSecurityException { - EchoSettings echoSettings = - EchoSettings.newBuilder() - .setCredentialsProvider(NoCredentialsProvider.create()) - .setTransportChannelProvider( - EchoSettings.defaultHttpJsonTransportProviderBuilder() - .setHttpTransport( - new NetHttpTransport.Builder().doNotValidateCertificate().build()) - .setEndpoint("http://localhost:7469") - .build()) - .build(); - - client = EchoClient.create(echoSettings); - } - - @AfterClass - public static void destroyClient() { - client.close(); - } - - // TODO(#1187): For 'throws' explanation, see - // https://github.com/googleapis/gapic-showcase/blob/v0.25.0/util/genrest/resttools/systemparam.go#L37-L46 - @Test - public void testEcho() { - assertThrows( - InvalidArgumentException.class, - () -> assertEquals("http-echo?", echo("http-echo?"))); - - assertThrows( - InvalidArgumentException.class, - () -> assertEquals("http-echo!", echo("http-echo!"))); - } - - private String echo(String value) { - EchoResponse response = client.echo(EchoRequest.newBuilder().setContent(value).build()); - return response.getContent(); - } -} \ No newline at end of file diff --git a/showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/ITFirstRpc.java b/showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/ITFirstRpc.java deleted file mode 100644 index 46e681bb86..0000000000 --- a/showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/ITFirstRpc.java +++ /dev/null @@ -1,75 +0,0 @@ -/* - * 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 - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1.it; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertTrue; - -import com.google.api.gax.core.NoCredentialsProvider; -import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; -import com.google.showcase.v1beta1.EchoClient; -import com.google.showcase.v1beta1.EchoRequest; -import com.google.showcase.v1beta1.EchoResponse; -import com.google.showcase.v1beta1.EchoSettings; -import io.grpc.ManagedChannelBuilder; -import java.io.IOException; -import org.junit.After; -import org.junit.Before; -import org.junit.Test; - -public class ITFirstRpc { - - private static EchoClient client; - - @Before - public void createClient() throws IOException { - EchoSettings echoSettings = - EchoSettings.newBuilder() - .setCredentialsProvider(NoCredentialsProvider.create()) - .setTransportChannelProvider( - InstantiatingGrpcChannelProvider.newBuilder() - .setChannelConfigurator(ManagedChannelBuilder::usePlaintext) - .build()) - .build(); - - client = EchoClient.create(echoSettings); - } - - @After - public void destroyClient() { - client.close(); - } - - @Test - public void testEcho() { - assertEquals("grpc-echo?", echo("grpc-echo?")); - assertEquals("grpc-echo!", echo("grpc-echo!")); - } - - @Test - public void testShutdown() { - assertFalse(client.isShutdown()); - client.shutdown(); - assertTrue(client.isShutdown()); - } - - private String echo(String value) { - EchoResponse response = client.echo(EchoRequest.newBuilder().setContent(value).build()); - return response.getContent(); - } -} \ No newline at end of file diff --git a/showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/ITNumericEnums.java b/showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/ITNumericEnums.java deleted file mode 100644 index 6c417ae87a..0000000000 --- a/showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/ITNumericEnums.java +++ /dev/null @@ -1,71 +0,0 @@ -/* - * 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 - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1.it; - -import static org.junit.Assert.assertThrows; - -import com.google.api.client.http.javanet.NetHttpTransport; -import com.google.api.gax.core.NoCredentialsProvider; -import com.google.api.gax.rpc.InvalidArgumentException; -import com.google.showcase.v1beta1.ComplianceClient; -import com.google.showcase.v1beta1.ComplianceSettings; -import com.google.showcase.v1beta1.EnumRequest; -import java.io.IOException; -import java.security.GeneralSecurityException; -import org.junit.After; -import org.junit.Before; -import org.junit.Test; - -public class ITNumericEnums { - - private ComplianceClient client; - - @Before - public void createClient() throws GeneralSecurityException, IOException { - ComplianceSettings complianceSettings = - ComplianceSettings.newHttpJsonBuilder() - .setCredentialsProvider(NoCredentialsProvider.create()) - .setTransportChannelProvider( - ComplianceSettings.defaultHttpJsonTransportProviderBuilder() - .setHttpTransport( - new NetHttpTransport.Builder().doNotValidateCertificate().build()) - .setEndpoint("http://localhost:7469") - .build()) - .build(); - client = ComplianceClient.create(complianceSettings); - } - - @After - public void destroyClient() { - client.close(); - } - - // TODO(#1187): For 'throws' explanation, see - // https://github.com/googleapis/gapic-showcase/blob/v0.25.0/util/genrest/resttools/systemparam.go#L37-L46 - @Test - public void verifyEnums() { - EnumRequest request = EnumRequest.newBuilder().setUnknownEnum(true).build(); - - // EnumResponse initialResponse = - assertThrows(InvalidArgumentException.class, () -> client.getEnum(request)); - - // EnumResponse verifiedResponse = client.verifyEnum(initialResponse); - // - // Assert.assertNotNull(initialResponse); - // Assert.assertEquals(initialResponse, verifiedResponse); - } -} \ No newline at end of file diff --git a/showcase/grpc-gapic-showcase-v1beta1/pom.xml b/showcase/grpc-gapic-showcase-v1beta1/pom.xml deleted file mode 100644 index 78881187c3..0000000000 --- a/showcase/grpc-gapic-showcase-v1beta1/pom.xml +++ /dev/null @@ -1,112 +0,0 @@ - - 4.0.0 - com.google.api.grpc - grpc-gapic-showcase-v1beta1 - 0.0.1-SNAPSHOT - grpc-gapic-showcase-v1beta1 - GRPC library for grpc-google-cloud-iot-v1 - - com.google.cloud - gapic-showcase-parent - 0.0.1-SNAPSHOT - - - - true - - - - - diff - - true - - - - - org.codehaus.mojo - exec-maven-plugin - 3.1.0 - - - verify-showcase - - exec - - test - - bazel - - run - //showcase:verify_grpc - - - - - - - - - - update - - - - org.codehaus.mojo - exec-maven-plugin - 3.1.0 - - - verify-showcase - - exec - - generate-sources - - bazelisk - - run - //showcase:update_grpc - - - - - - - - - - - - - io.grpc - grpc-api - - - io.grpc - grpc-stub - - - io.grpc - grpc-protobuf - - - com.google.protobuf - protobuf-java - - - com.google.api.grpc - proto-gapic-showcase-v1beta1 - - - com.google.api.grpc - proto-google-iam-v1 - - - com.google.guava - guava - - - diff --git a/showcase/grpc-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ComplianceGrpc.java b/showcase/grpc-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ComplianceGrpc.java deleted file mode 100644 index 31504f489d..0000000000 --- a/showcase/grpc-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ComplianceGrpc.java +++ /dev/null @@ -1,942 +0,0 @@ -package com.google.showcase.v1beta1; - -import static io.grpc.MethodDescriptor.generateFullMethodName; - -/** - */ -@javax.annotation.Generated( - value = "by gRPC proto compiler", - comments = "Source: schema/google/showcase/v1beta1/compliance.proto") -@io.grpc.stub.annotations.GrpcGenerated -public final class ComplianceGrpc { - - private ComplianceGrpc() {} - - public static final String SERVICE_NAME = "google.showcase.v1beta1.Compliance"; - - // Static method descriptors that strictly reflect the proto. - private static volatile io.grpc.MethodDescriptor getRepeatDataBodyMethod; - - @io.grpc.stub.annotations.RpcMethod( - fullMethodName = SERVICE_NAME + '/' + "RepeatDataBody", - requestType = com.google.showcase.v1beta1.RepeatRequest.class, - responseType = com.google.showcase.v1beta1.RepeatResponse.class, - methodType = io.grpc.MethodDescriptor.MethodType.UNARY) - public static io.grpc.MethodDescriptor getRepeatDataBodyMethod() { - io.grpc.MethodDescriptor getRepeatDataBodyMethod; - if ((getRepeatDataBodyMethod = ComplianceGrpc.getRepeatDataBodyMethod) == null) { - synchronized (ComplianceGrpc.class) { - if ((getRepeatDataBodyMethod = ComplianceGrpc.getRepeatDataBodyMethod) == null) { - ComplianceGrpc.getRepeatDataBodyMethod = getRepeatDataBodyMethod = - io.grpc.MethodDescriptor.newBuilder() - .setType(io.grpc.MethodDescriptor.MethodType.UNARY) - .setFullMethodName(generateFullMethodName(SERVICE_NAME, "RepeatDataBody")) - .setSampledToLocalTracing(true) - .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( - com.google.showcase.v1beta1.RepeatRequest.getDefaultInstance())) - .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( - com.google.showcase.v1beta1.RepeatResponse.getDefaultInstance())) - .setSchemaDescriptor(new ComplianceMethodDescriptorSupplier("RepeatDataBody")) - .build(); - } - } - } - return getRepeatDataBodyMethod; - } - - private static volatile io.grpc.MethodDescriptor getRepeatDataBodyInfoMethod; - - @io.grpc.stub.annotations.RpcMethod( - fullMethodName = SERVICE_NAME + '/' + "RepeatDataBodyInfo", - requestType = com.google.showcase.v1beta1.RepeatRequest.class, - responseType = com.google.showcase.v1beta1.RepeatResponse.class, - methodType = io.grpc.MethodDescriptor.MethodType.UNARY) - public static io.grpc.MethodDescriptor getRepeatDataBodyInfoMethod() { - io.grpc.MethodDescriptor getRepeatDataBodyInfoMethod; - if ((getRepeatDataBodyInfoMethod = ComplianceGrpc.getRepeatDataBodyInfoMethod) == null) { - synchronized (ComplianceGrpc.class) { - if ((getRepeatDataBodyInfoMethod = ComplianceGrpc.getRepeatDataBodyInfoMethod) == null) { - ComplianceGrpc.getRepeatDataBodyInfoMethod = getRepeatDataBodyInfoMethod = - io.grpc.MethodDescriptor.newBuilder() - .setType(io.grpc.MethodDescriptor.MethodType.UNARY) - .setFullMethodName(generateFullMethodName(SERVICE_NAME, "RepeatDataBodyInfo")) - .setSampledToLocalTracing(true) - .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( - com.google.showcase.v1beta1.RepeatRequest.getDefaultInstance())) - .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( - com.google.showcase.v1beta1.RepeatResponse.getDefaultInstance())) - .setSchemaDescriptor(new ComplianceMethodDescriptorSupplier("RepeatDataBodyInfo")) - .build(); - } - } - } - return getRepeatDataBodyInfoMethod; - } - - private static volatile io.grpc.MethodDescriptor getRepeatDataQueryMethod; - - @io.grpc.stub.annotations.RpcMethod( - fullMethodName = SERVICE_NAME + '/' + "RepeatDataQuery", - requestType = com.google.showcase.v1beta1.RepeatRequest.class, - responseType = com.google.showcase.v1beta1.RepeatResponse.class, - methodType = io.grpc.MethodDescriptor.MethodType.UNARY) - public static io.grpc.MethodDescriptor getRepeatDataQueryMethod() { - io.grpc.MethodDescriptor getRepeatDataQueryMethod; - if ((getRepeatDataQueryMethod = ComplianceGrpc.getRepeatDataQueryMethod) == null) { - synchronized (ComplianceGrpc.class) { - if ((getRepeatDataQueryMethod = ComplianceGrpc.getRepeatDataQueryMethod) == null) { - ComplianceGrpc.getRepeatDataQueryMethod = getRepeatDataQueryMethod = - io.grpc.MethodDescriptor.newBuilder() - .setType(io.grpc.MethodDescriptor.MethodType.UNARY) - .setFullMethodName(generateFullMethodName(SERVICE_NAME, "RepeatDataQuery")) - .setSampledToLocalTracing(true) - .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( - com.google.showcase.v1beta1.RepeatRequest.getDefaultInstance())) - .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( - com.google.showcase.v1beta1.RepeatResponse.getDefaultInstance())) - .setSchemaDescriptor(new ComplianceMethodDescriptorSupplier("RepeatDataQuery")) - .build(); - } - } - } - return getRepeatDataQueryMethod; - } - - private static volatile io.grpc.MethodDescriptor getRepeatDataSimplePathMethod; - - @io.grpc.stub.annotations.RpcMethod( - fullMethodName = SERVICE_NAME + '/' + "RepeatDataSimplePath", - requestType = com.google.showcase.v1beta1.RepeatRequest.class, - responseType = com.google.showcase.v1beta1.RepeatResponse.class, - methodType = io.grpc.MethodDescriptor.MethodType.UNARY) - public static io.grpc.MethodDescriptor getRepeatDataSimplePathMethod() { - io.grpc.MethodDescriptor getRepeatDataSimplePathMethod; - if ((getRepeatDataSimplePathMethod = ComplianceGrpc.getRepeatDataSimplePathMethod) == null) { - synchronized (ComplianceGrpc.class) { - if ((getRepeatDataSimplePathMethod = ComplianceGrpc.getRepeatDataSimplePathMethod) == null) { - ComplianceGrpc.getRepeatDataSimplePathMethod = getRepeatDataSimplePathMethod = - io.grpc.MethodDescriptor.newBuilder() - .setType(io.grpc.MethodDescriptor.MethodType.UNARY) - .setFullMethodName(generateFullMethodName(SERVICE_NAME, "RepeatDataSimplePath")) - .setSampledToLocalTracing(true) - .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( - com.google.showcase.v1beta1.RepeatRequest.getDefaultInstance())) - .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( - com.google.showcase.v1beta1.RepeatResponse.getDefaultInstance())) - .setSchemaDescriptor(new ComplianceMethodDescriptorSupplier("RepeatDataSimplePath")) - .build(); - } - } - } - return getRepeatDataSimplePathMethod; - } - - private static volatile io.grpc.MethodDescriptor getRepeatDataPathResourceMethod; - - @io.grpc.stub.annotations.RpcMethod( - fullMethodName = SERVICE_NAME + '/' + "RepeatDataPathResource", - requestType = com.google.showcase.v1beta1.RepeatRequest.class, - responseType = com.google.showcase.v1beta1.RepeatResponse.class, - methodType = io.grpc.MethodDescriptor.MethodType.UNARY) - public static io.grpc.MethodDescriptor getRepeatDataPathResourceMethod() { - io.grpc.MethodDescriptor getRepeatDataPathResourceMethod; - if ((getRepeatDataPathResourceMethod = ComplianceGrpc.getRepeatDataPathResourceMethod) == null) { - synchronized (ComplianceGrpc.class) { - if ((getRepeatDataPathResourceMethod = ComplianceGrpc.getRepeatDataPathResourceMethod) == null) { - ComplianceGrpc.getRepeatDataPathResourceMethod = getRepeatDataPathResourceMethod = - io.grpc.MethodDescriptor.newBuilder() - .setType(io.grpc.MethodDescriptor.MethodType.UNARY) - .setFullMethodName(generateFullMethodName(SERVICE_NAME, "RepeatDataPathResource")) - .setSampledToLocalTracing(true) - .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( - com.google.showcase.v1beta1.RepeatRequest.getDefaultInstance())) - .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( - com.google.showcase.v1beta1.RepeatResponse.getDefaultInstance())) - .setSchemaDescriptor(new ComplianceMethodDescriptorSupplier("RepeatDataPathResource")) - .build(); - } - } - } - return getRepeatDataPathResourceMethod; - } - - private static volatile io.grpc.MethodDescriptor getRepeatDataPathTrailingResourceMethod; - - @io.grpc.stub.annotations.RpcMethod( - fullMethodName = SERVICE_NAME + '/' + "RepeatDataPathTrailingResource", - requestType = com.google.showcase.v1beta1.RepeatRequest.class, - responseType = com.google.showcase.v1beta1.RepeatResponse.class, - methodType = io.grpc.MethodDescriptor.MethodType.UNARY) - public static io.grpc.MethodDescriptor getRepeatDataPathTrailingResourceMethod() { - io.grpc.MethodDescriptor getRepeatDataPathTrailingResourceMethod; - if ((getRepeatDataPathTrailingResourceMethod = ComplianceGrpc.getRepeatDataPathTrailingResourceMethod) == null) { - synchronized (ComplianceGrpc.class) { - if ((getRepeatDataPathTrailingResourceMethod = ComplianceGrpc.getRepeatDataPathTrailingResourceMethod) == null) { - ComplianceGrpc.getRepeatDataPathTrailingResourceMethod = getRepeatDataPathTrailingResourceMethod = - io.grpc.MethodDescriptor.newBuilder() - .setType(io.grpc.MethodDescriptor.MethodType.UNARY) - .setFullMethodName(generateFullMethodName(SERVICE_NAME, "RepeatDataPathTrailingResource")) - .setSampledToLocalTracing(true) - .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( - com.google.showcase.v1beta1.RepeatRequest.getDefaultInstance())) - .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( - com.google.showcase.v1beta1.RepeatResponse.getDefaultInstance())) - .setSchemaDescriptor(new ComplianceMethodDescriptorSupplier("RepeatDataPathTrailingResource")) - .build(); - } - } - } - return getRepeatDataPathTrailingResourceMethod; - } - - private static volatile io.grpc.MethodDescriptor getRepeatDataBodyPutMethod; - - @io.grpc.stub.annotations.RpcMethod( - fullMethodName = SERVICE_NAME + '/' + "RepeatDataBodyPut", - requestType = com.google.showcase.v1beta1.RepeatRequest.class, - responseType = com.google.showcase.v1beta1.RepeatResponse.class, - methodType = io.grpc.MethodDescriptor.MethodType.UNARY) - public static io.grpc.MethodDescriptor getRepeatDataBodyPutMethod() { - io.grpc.MethodDescriptor getRepeatDataBodyPutMethod; - if ((getRepeatDataBodyPutMethod = ComplianceGrpc.getRepeatDataBodyPutMethod) == null) { - synchronized (ComplianceGrpc.class) { - if ((getRepeatDataBodyPutMethod = ComplianceGrpc.getRepeatDataBodyPutMethod) == null) { - ComplianceGrpc.getRepeatDataBodyPutMethod = getRepeatDataBodyPutMethod = - io.grpc.MethodDescriptor.newBuilder() - .setType(io.grpc.MethodDescriptor.MethodType.UNARY) - .setFullMethodName(generateFullMethodName(SERVICE_NAME, "RepeatDataBodyPut")) - .setSampledToLocalTracing(true) - .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( - com.google.showcase.v1beta1.RepeatRequest.getDefaultInstance())) - .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( - com.google.showcase.v1beta1.RepeatResponse.getDefaultInstance())) - .setSchemaDescriptor(new ComplianceMethodDescriptorSupplier("RepeatDataBodyPut")) - .build(); - } - } - } - return getRepeatDataBodyPutMethod; - } - - private static volatile io.grpc.MethodDescriptor getRepeatDataBodyPatchMethod; - - @io.grpc.stub.annotations.RpcMethod( - fullMethodName = SERVICE_NAME + '/' + "RepeatDataBodyPatch", - requestType = com.google.showcase.v1beta1.RepeatRequest.class, - responseType = com.google.showcase.v1beta1.RepeatResponse.class, - methodType = io.grpc.MethodDescriptor.MethodType.UNARY) - public static io.grpc.MethodDescriptor getRepeatDataBodyPatchMethod() { - io.grpc.MethodDescriptor getRepeatDataBodyPatchMethod; - if ((getRepeatDataBodyPatchMethod = ComplianceGrpc.getRepeatDataBodyPatchMethod) == null) { - synchronized (ComplianceGrpc.class) { - if ((getRepeatDataBodyPatchMethod = ComplianceGrpc.getRepeatDataBodyPatchMethod) == null) { - ComplianceGrpc.getRepeatDataBodyPatchMethod = getRepeatDataBodyPatchMethod = - io.grpc.MethodDescriptor.newBuilder() - .setType(io.grpc.MethodDescriptor.MethodType.UNARY) - .setFullMethodName(generateFullMethodName(SERVICE_NAME, "RepeatDataBodyPatch")) - .setSampledToLocalTracing(true) - .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( - com.google.showcase.v1beta1.RepeatRequest.getDefaultInstance())) - .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( - com.google.showcase.v1beta1.RepeatResponse.getDefaultInstance())) - .setSchemaDescriptor(new ComplianceMethodDescriptorSupplier("RepeatDataBodyPatch")) - .build(); - } - } - } - return getRepeatDataBodyPatchMethod; - } - - private static volatile io.grpc.MethodDescriptor getGetEnumMethod; - - @io.grpc.stub.annotations.RpcMethod( - fullMethodName = SERVICE_NAME + '/' + "GetEnum", - requestType = com.google.showcase.v1beta1.EnumRequest.class, - responseType = com.google.showcase.v1beta1.EnumResponse.class, - methodType = io.grpc.MethodDescriptor.MethodType.UNARY) - public static io.grpc.MethodDescriptor getGetEnumMethod() { - io.grpc.MethodDescriptor getGetEnumMethod; - if ((getGetEnumMethod = ComplianceGrpc.getGetEnumMethod) == null) { - synchronized (ComplianceGrpc.class) { - if ((getGetEnumMethod = ComplianceGrpc.getGetEnumMethod) == null) { - ComplianceGrpc.getGetEnumMethod = getGetEnumMethod = - io.grpc.MethodDescriptor.newBuilder() - .setType(io.grpc.MethodDescriptor.MethodType.UNARY) - .setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetEnum")) - .setSampledToLocalTracing(true) - .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( - com.google.showcase.v1beta1.EnumRequest.getDefaultInstance())) - .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( - com.google.showcase.v1beta1.EnumResponse.getDefaultInstance())) - .setSchemaDescriptor(new ComplianceMethodDescriptorSupplier("GetEnum")) - .build(); - } - } - } - return getGetEnumMethod; - } - - private static volatile io.grpc.MethodDescriptor getVerifyEnumMethod; - - @io.grpc.stub.annotations.RpcMethod( - fullMethodName = SERVICE_NAME + '/' + "VerifyEnum", - requestType = com.google.showcase.v1beta1.EnumResponse.class, - responseType = com.google.showcase.v1beta1.EnumResponse.class, - methodType = io.grpc.MethodDescriptor.MethodType.UNARY) - public static io.grpc.MethodDescriptor getVerifyEnumMethod() { - io.grpc.MethodDescriptor getVerifyEnumMethod; - if ((getVerifyEnumMethod = ComplianceGrpc.getVerifyEnumMethod) == null) { - synchronized (ComplianceGrpc.class) { - if ((getVerifyEnumMethod = ComplianceGrpc.getVerifyEnumMethod) == null) { - ComplianceGrpc.getVerifyEnumMethod = getVerifyEnumMethod = - io.grpc.MethodDescriptor.newBuilder() - .setType(io.grpc.MethodDescriptor.MethodType.UNARY) - .setFullMethodName(generateFullMethodName(SERVICE_NAME, "VerifyEnum")) - .setSampledToLocalTracing(true) - .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( - com.google.showcase.v1beta1.EnumResponse.getDefaultInstance())) - .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( - com.google.showcase.v1beta1.EnumResponse.getDefaultInstance())) - .setSchemaDescriptor(new ComplianceMethodDescriptorSupplier("VerifyEnum")) - .build(); - } - } - } - return getVerifyEnumMethod; - } - - /** - * Creates a new async stub that supports all call types for the service - */ - public static ComplianceStub newStub(io.grpc.Channel channel) { - io.grpc.stub.AbstractStub.StubFactory factory = - new io.grpc.stub.AbstractStub.StubFactory() { - @java.lang.Override - public ComplianceStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { - return new ComplianceStub(channel, callOptions); - } - }; - return ComplianceStub.newStub(factory, channel); - } - - /** - * Creates a new blocking-style stub that supports unary and streaming output calls on the service - */ - public static ComplianceBlockingStub newBlockingStub( - io.grpc.Channel channel) { - io.grpc.stub.AbstractStub.StubFactory factory = - new io.grpc.stub.AbstractStub.StubFactory() { - @java.lang.Override - public ComplianceBlockingStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { - return new ComplianceBlockingStub(channel, callOptions); - } - }; - return ComplianceBlockingStub.newStub(factory, channel); - } - - /** - * Creates a new ListenableFuture-style stub that supports unary calls on the service - */ - public static ComplianceFutureStub newFutureStub( - io.grpc.Channel channel) { - io.grpc.stub.AbstractStub.StubFactory factory = - new io.grpc.stub.AbstractStub.StubFactory() { - @java.lang.Override - public ComplianceFutureStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { - return new ComplianceFutureStub(channel, callOptions); - } - }; - return ComplianceFutureStub.newStub(factory, channel); - } - - /** - */ - public static abstract class ComplianceImplBase implements io.grpc.BindableService { - - /** - */ - public void repeatDataBody(com.google.showcase.v1beta1.RepeatRequest request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getRepeatDataBodyMethod(), responseObserver); - } - - /** - */ - public void repeatDataBodyInfo(com.google.showcase.v1beta1.RepeatRequest request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getRepeatDataBodyInfoMethod(), responseObserver); - } - - /** - */ - public void repeatDataQuery(com.google.showcase.v1beta1.RepeatRequest request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getRepeatDataQueryMethod(), responseObserver); - } - - /** - */ - public void repeatDataSimplePath(com.google.showcase.v1beta1.RepeatRequest request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getRepeatDataSimplePathMethod(), responseObserver); - } - - /** - */ - public void repeatDataPathResource(com.google.showcase.v1beta1.RepeatRequest request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getRepeatDataPathResourceMethod(), responseObserver); - } - - /** - */ - public void repeatDataPathTrailingResource(com.google.showcase.v1beta1.RepeatRequest request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getRepeatDataPathTrailingResourceMethod(), responseObserver); - } - - /** - */ - public void repeatDataBodyPut(com.google.showcase.v1beta1.RepeatRequest request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getRepeatDataBodyPutMethod(), responseObserver); - } - - /** - */ - public void repeatDataBodyPatch(com.google.showcase.v1beta1.RepeatRequest request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getRepeatDataBodyPatchMethod(), responseObserver); - } - - /** - */ - public void getEnum(com.google.showcase.v1beta1.EnumRequest request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getGetEnumMethod(), responseObserver); - } - - /** - */ - public void verifyEnum(com.google.showcase.v1beta1.EnumResponse request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getVerifyEnumMethod(), responseObserver); - } - - @java.lang.Override public final io.grpc.ServerServiceDefinition bindService() { - return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) - .addMethod( - getRepeatDataBodyMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - com.google.showcase.v1beta1.RepeatRequest, - com.google.showcase.v1beta1.RepeatResponse>( - this, METHODID_REPEAT_DATA_BODY))) - .addMethod( - getRepeatDataBodyInfoMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - com.google.showcase.v1beta1.RepeatRequest, - com.google.showcase.v1beta1.RepeatResponse>( - this, METHODID_REPEAT_DATA_BODY_INFO))) - .addMethod( - getRepeatDataQueryMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - com.google.showcase.v1beta1.RepeatRequest, - com.google.showcase.v1beta1.RepeatResponse>( - this, METHODID_REPEAT_DATA_QUERY))) - .addMethod( - getRepeatDataSimplePathMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - com.google.showcase.v1beta1.RepeatRequest, - com.google.showcase.v1beta1.RepeatResponse>( - this, METHODID_REPEAT_DATA_SIMPLE_PATH))) - .addMethod( - getRepeatDataPathResourceMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - com.google.showcase.v1beta1.RepeatRequest, - com.google.showcase.v1beta1.RepeatResponse>( - this, METHODID_REPEAT_DATA_PATH_RESOURCE))) - .addMethod( - getRepeatDataPathTrailingResourceMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - com.google.showcase.v1beta1.RepeatRequest, - com.google.showcase.v1beta1.RepeatResponse>( - this, METHODID_REPEAT_DATA_PATH_TRAILING_RESOURCE))) - .addMethod( - getRepeatDataBodyPutMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - com.google.showcase.v1beta1.RepeatRequest, - com.google.showcase.v1beta1.RepeatResponse>( - this, METHODID_REPEAT_DATA_BODY_PUT))) - .addMethod( - getRepeatDataBodyPatchMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - com.google.showcase.v1beta1.RepeatRequest, - com.google.showcase.v1beta1.RepeatResponse>( - this, METHODID_REPEAT_DATA_BODY_PATCH))) - .addMethod( - getGetEnumMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - com.google.showcase.v1beta1.EnumRequest, - com.google.showcase.v1beta1.EnumResponse>( - this, METHODID_GET_ENUM))) - .addMethod( - getVerifyEnumMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - com.google.showcase.v1beta1.EnumResponse, - com.google.showcase.v1beta1.EnumResponse>( - this, METHODID_VERIFY_ENUM))) - .build(); - } - } - - /** - */ - public static final class ComplianceStub extends io.grpc.stub.AbstractAsyncStub { - private ComplianceStub( - io.grpc.Channel channel, io.grpc.CallOptions callOptions) { - super(channel, callOptions); - } - - @java.lang.Override - protected ComplianceStub build( - io.grpc.Channel channel, io.grpc.CallOptions callOptions) { - return new ComplianceStub(channel, callOptions); - } - - /** - */ - public void repeatDataBody(com.google.showcase.v1beta1.RepeatRequest request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ClientCalls.asyncUnaryCall( - getChannel().newCall(getRepeatDataBodyMethod(), getCallOptions()), request, responseObserver); - } - - /** - */ - public void repeatDataBodyInfo(com.google.showcase.v1beta1.RepeatRequest request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ClientCalls.asyncUnaryCall( - getChannel().newCall(getRepeatDataBodyInfoMethod(), getCallOptions()), request, responseObserver); - } - - /** - */ - public void repeatDataQuery(com.google.showcase.v1beta1.RepeatRequest request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ClientCalls.asyncUnaryCall( - getChannel().newCall(getRepeatDataQueryMethod(), getCallOptions()), request, responseObserver); - } - - /** - */ - public void repeatDataSimplePath(com.google.showcase.v1beta1.RepeatRequest request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ClientCalls.asyncUnaryCall( - getChannel().newCall(getRepeatDataSimplePathMethod(), getCallOptions()), request, responseObserver); - } - - /** - */ - public void repeatDataPathResource(com.google.showcase.v1beta1.RepeatRequest request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ClientCalls.asyncUnaryCall( - getChannel().newCall(getRepeatDataPathResourceMethod(), getCallOptions()), request, responseObserver); - } - - /** - */ - public void repeatDataPathTrailingResource(com.google.showcase.v1beta1.RepeatRequest request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ClientCalls.asyncUnaryCall( - getChannel().newCall(getRepeatDataPathTrailingResourceMethod(), getCallOptions()), request, responseObserver); - } - - /** - */ - public void repeatDataBodyPut(com.google.showcase.v1beta1.RepeatRequest request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ClientCalls.asyncUnaryCall( - getChannel().newCall(getRepeatDataBodyPutMethod(), getCallOptions()), request, responseObserver); - } - - /** - */ - public void repeatDataBodyPatch(com.google.showcase.v1beta1.RepeatRequest request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ClientCalls.asyncUnaryCall( - getChannel().newCall(getRepeatDataBodyPatchMethod(), getCallOptions()), request, responseObserver); - } - - /** - */ - public void getEnum(com.google.showcase.v1beta1.EnumRequest request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ClientCalls.asyncUnaryCall( - getChannel().newCall(getGetEnumMethod(), getCallOptions()), request, responseObserver); - } - - /** - */ - public void verifyEnum(com.google.showcase.v1beta1.EnumResponse request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ClientCalls.asyncUnaryCall( - getChannel().newCall(getVerifyEnumMethod(), getCallOptions()), request, responseObserver); - } - } - - /** - */ - public static final class ComplianceBlockingStub extends io.grpc.stub.AbstractBlockingStub { - private ComplianceBlockingStub( - io.grpc.Channel channel, io.grpc.CallOptions callOptions) { - super(channel, callOptions); - } - - @java.lang.Override - protected ComplianceBlockingStub build( - io.grpc.Channel channel, io.grpc.CallOptions callOptions) { - return new ComplianceBlockingStub(channel, callOptions); - } - - /** - */ - public com.google.showcase.v1beta1.RepeatResponse repeatDataBody(com.google.showcase.v1beta1.RepeatRequest request) { - return io.grpc.stub.ClientCalls.blockingUnaryCall( - getChannel(), getRepeatDataBodyMethod(), getCallOptions(), request); - } - - /** - */ - public com.google.showcase.v1beta1.RepeatResponse repeatDataBodyInfo(com.google.showcase.v1beta1.RepeatRequest request) { - return io.grpc.stub.ClientCalls.blockingUnaryCall( - getChannel(), getRepeatDataBodyInfoMethod(), getCallOptions(), request); - } - - /** - */ - public com.google.showcase.v1beta1.RepeatResponse repeatDataQuery(com.google.showcase.v1beta1.RepeatRequest request) { - return io.grpc.stub.ClientCalls.blockingUnaryCall( - getChannel(), getRepeatDataQueryMethod(), getCallOptions(), request); - } - - /** - */ - public com.google.showcase.v1beta1.RepeatResponse repeatDataSimplePath(com.google.showcase.v1beta1.RepeatRequest request) { - return io.grpc.stub.ClientCalls.blockingUnaryCall( - getChannel(), getRepeatDataSimplePathMethod(), getCallOptions(), request); - } - - /** - */ - public com.google.showcase.v1beta1.RepeatResponse repeatDataPathResource(com.google.showcase.v1beta1.RepeatRequest request) { - return io.grpc.stub.ClientCalls.blockingUnaryCall( - getChannel(), getRepeatDataPathResourceMethod(), getCallOptions(), request); - } - - /** - */ - public com.google.showcase.v1beta1.RepeatResponse repeatDataPathTrailingResource(com.google.showcase.v1beta1.RepeatRequest request) { - return io.grpc.stub.ClientCalls.blockingUnaryCall( - getChannel(), getRepeatDataPathTrailingResourceMethod(), getCallOptions(), request); - } - - /** - */ - public com.google.showcase.v1beta1.RepeatResponse repeatDataBodyPut(com.google.showcase.v1beta1.RepeatRequest request) { - return io.grpc.stub.ClientCalls.blockingUnaryCall( - getChannel(), getRepeatDataBodyPutMethod(), getCallOptions(), request); - } - - /** - */ - public com.google.showcase.v1beta1.RepeatResponse repeatDataBodyPatch(com.google.showcase.v1beta1.RepeatRequest request) { - return io.grpc.stub.ClientCalls.blockingUnaryCall( - getChannel(), getRepeatDataBodyPatchMethod(), getCallOptions(), request); - } - - /** - */ - public com.google.showcase.v1beta1.EnumResponse getEnum(com.google.showcase.v1beta1.EnumRequest request) { - return io.grpc.stub.ClientCalls.blockingUnaryCall( - getChannel(), getGetEnumMethod(), getCallOptions(), request); - } - - /** - */ - public com.google.showcase.v1beta1.EnumResponse verifyEnum(com.google.showcase.v1beta1.EnumResponse request) { - return io.grpc.stub.ClientCalls.blockingUnaryCall( - getChannel(), getVerifyEnumMethod(), getCallOptions(), request); - } - } - - /** - */ - public static final class ComplianceFutureStub extends io.grpc.stub.AbstractFutureStub { - private ComplianceFutureStub( - io.grpc.Channel channel, io.grpc.CallOptions callOptions) { - super(channel, callOptions); - } - - @java.lang.Override - protected ComplianceFutureStub build( - io.grpc.Channel channel, io.grpc.CallOptions callOptions) { - return new ComplianceFutureStub(channel, callOptions); - } - - /** - */ - public com.google.common.util.concurrent.ListenableFuture repeatDataBody( - com.google.showcase.v1beta1.RepeatRequest request) { - return io.grpc.stub.ClientCalls.futureUnaryCall( - getChannel().newCall(getRepeatDataBodyMethod(), getCallOptions()), request); - } - - /** - */ - public com.google.common.util.concurrent.ListenableFuture repeatDataBodyInfo( - com.google.showcase.v1beta1.RepeatRequest request) { - return io.grpc.stub.ClientCalls.futureUnaryCall( - getChannel().newCall(getRepeatDataBodyInfoMethod(), getCallOptions()), request); - } - - /** - */ - public com.google.common.util.concurrent.ListenableFuture repeatDataQuery( - com.google.showcase.v1beta1.RepeatRequest request) { - return io.grpc.stub.ClientCalls.futureUnaryCall( - getChannel().newCall(getRepeatDataQueryMethod(), getCallOptions()), request); - } - - /** - */ - public com.google.common.util.concurrent.ListenableFuture repeatDataSimplePath( - com.google.showcase.v1beta1.RepeatRequest request) { - return io.grpc.stub.ClientCalls.futureUnaryCall( - getChannel().newCall(getRepeatDataSimplePathMethod(), getCallOptions()), request); - } - - /** - */ - public com.google.common.util.concurrent.ListenableFuture repeatDataPathResource( - com.google.showcase.v1beta1.RepeatRequest request) { - return io.grpc.stub.ClientCalls.futureUnaryCall( - getChannel().newCall(getRepeatDataPathResourceMethod(), getCallOptions()), request); - } - - /** - */ - public com.google.common.util.concurrent.ListenableFuture repeatDataPathTrailingResource( - com.google.showcase.v1beta1.RepeatRequest request) { - return io.grpc.stub.ClientCalls.futureUnaryCall( - getChannel().newCall(getRepeatDataPathTrailingResourceMethod(), getCallOptions()), request); - } - - /** - */ - public com.google.common.util.concurrent.ListenableFuture repeatDataBodyPut( - com.google.showcase.v1beta1.RepeatRequest request) { - return io.grpc.stub.ClientCalls.futureUnaryCall( - getChannel().newCall(getRepeatDataBodyPutMethod(), getCallOptions()), request); - } - - /** - */ - public com.google.common.util.concurrent.ListenableFuture repeatDataBodyPatch( - com.google.showcase.v1beta1.RepeatRequest request) { - return io.grpc.stub.ClientCalls.futureUnaryCall( - getChannel().newCall(getRepeatDataBodyPatchMethod(), getCallOptions()), request); - } - - /** - */ - public com.google.common.util.concurrent.ListenableFuture getEnum( - com.google.showcase.v1beta1.EnumRequest request) { - return io.grpc.stub.ClientCalls.futureUnaryCall( - getChannel().newCall(getGetEnumMethod(), getCallOptions()), request); - } - - /** - */ - public com.google.common.util.concurrent.ListenableFuture verifyEnum( - com.google.showcase.v1beta1.EnumResponse request) { - return io.grpc.stub.ClientCalls.futureUnaryCall( - getChannel().newCall(getVerifyEnumMethod(), getCallOptions()), request); - } - } - - private static final int METHODID_REPEAT_DATA_BODY = 0; - private static final int METHODID_REPEAT_DATA_BODY_INFO = 1; - private static final int METHODID_REPEAT_DATA_QUERY = 2; - private static final int METHODID_REPEAT_DATA_SIMPLE_PATH = 3; - private static final int METHODID_REPEAT_DATA_PATH_RESOURCE = 4; - private static final int METHODID_REPEAT_DATA_PATH_TRAILING_RESOURCE = 5; - private static final int METHODID_REPEAT_DATA_BODY_PUT = 6; - private static final int METHODID_REPEAT_DATA_BODY_PATCH = 7; - private static final int METHODID_GET_ENUM = 8; - private static final int METHODID_VERIFY_ENUM = 9; - - 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 ComplianceImplBase serviceImpl; - private final int methodId; - - MethodHandlers(ComplianceImplBase 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_REPEAT_DATA_BODY: - serviceImpl.repeatDataBody((com.google.showcase.v1beta1.RepeatRequest) request, - (io.grpc.stub.StreamObserver) responseObserver); - break; - case METHODID_REPEAT_DATA_BODY_INFO: - serviceImpl.repeatDataBodyInfo((com.google.showcase.v1beta1.RepeatRequest) request, - (io.grpc.stub.StreamObserver) responseObserver); - break; - case METHODID_REPEAT_DATA_QUERY: - serviceImpl.repeatDataQuery((com.google.showcase.v1beta1.RepeatRequest) request, - (io.grpc.stub.StreamObserver) responseObserver); - break; - case METHODID_REPEAT_DATA_SIMPLE_PATH: - serviceImpl.repeatDataSimplePath((com.google.showcase.v1beta1.RepeatRequest) request, - (io.grpc.stub.StreamObserver) responseObserver); - break; - case METHODID_REPEAT_DATA_PATH_RESOURCE: - serviceImpl.repeatDataPathResource((com.google.showcase.v1beta1.RepeatRequest) request, - (io.grpc.stub.StreamObserver) responseObserver); - break; - case METHODID_REPEAT_DATA_PATH_TRAILING_RESOURCE: - serviceImpl.repeatDataPathTrailingResource((com.google.showcase.v1beta1.RepeatRequest) request, - (io.grpc.stub.StreamObserver) responseObserver); - break; - case METHODID_REPEAT_DATA_BODY_PUT: - serviceImpl.repeatDataBodyPut((com.google.showcase.v1beta1.RepeatRequest) request, - (io.grpc.stub.StreamObserver) responseObserver); - break; - case METHODID_REPEAT_DATA_BODY_PATCH: - serviceImpl.repeatDataBodyPatch((com.google.showcase.v1beta1.RepeatRequest) request, - (io.grpc.stub.StreamObserver) responseObserver); - break; - case METHODID_GET_ENUM: - serviceImpl.getEnum((com.google.showcase.v1beta1.EnumRequest) request, - (io.grpc.stub.StreamObserver) responseObserver); - break; - case METHODID_VERIFY_ENUM: - serviceImpl.verifyEnum((com.google.showcase.v1beta1.EnumResponse) request, - (io.grpc.stub.StreamObserver) responseObserver); - break; - default: - throw new AssertionError(); - } - } - - @java.lang.Override - @java.lang.SuppressWarnings("unchecked") - public io.grpc.stub.StreamObserver invoke( - io.grpc.stub.StreamObserver responseObserver) { - switch (methodId) { - default: - throw new AssertionError(); - } - } - } - - private static abstract class ComplianceBaseDescriptorSupplier - implements io.grpc.protobuf.ProtoFileDescriptorSupplier, io.grpc.protobuf.ProtoServiceDescriptorSupplier { - ComplianceBaseDescriptorSupplier() {} - - @java.lang.Override - public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() { - return com.google.showcase.v1beta1.ComplianceOuterClass.getDescriptor(); - } - - @java.lang.Override - public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() { - return getFileDescriptor().findServiceByName("Compliance"); - } - } - - private static final class ComplianceFileDescriptorSupplier - extends ComplianceBaseDescriptorSupplier { - ComplianceFileDescriptorSupplier() {} - } - - private static final class ComplianceMethodDescriptorSupplier - extends ComplianceBaseDescriptorSupplier - implements io.grpc.protobuf.ProtoMethodDescriptorSupplier { - private final String methodName; - - ComplianceMethodDescriptorSupplier(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 (ComplianceGrpc.class) { - result = serviceDescriptor; - if (result == null) { - serviceDescriptor = result = io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME) - .setSchemaDescriptor(new ComplianceFileDescriptorSupplier()) - .addMethod(getRepeatDataBodyMethod()) - .addMethod(getRepeatDataBodyInfoMethod()) - .addMethod(getRepeatDataQueryMethod()) - .addMethod(getRepeatDataSimplePathMethod()) - .addMethod(getRepeatDataPathResourceMethod()) - .addMethod(getRepeatDataPathTrailingResourceMethod()) - .addMethod(getRepeatDataBodyPutMethod()) - .addMethod(getRepeatDataBodyPatchMethod()) - .addMethod(getGetEnumMethod()) - .addMethod(getVerifyEnumMethod()) - .build(); - } - } - } - return result; - } -} diff --git a/showcase/grpc-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/EchoGrpc.java b/showcase/grpc-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/EchoGrpc.java deleted file mode 100644 index fb0405e1ec..0000000000 --- a/showcase/grpc-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/EchoGrpc.java +++ /dev/null @@ -1,829 +0,0 @@ -package com.google.showcase.v1beta1; - -import static io.grpc.MethodDescriptor.generateFullMethodName; - -/** - */ -@javax.annotation.Generated( - value = "by gRPC proto compiler", - comments = "Source: schema/google/showcase/v1beta1/echo.proto") -@io.grpc.stub.annotations.GrpcGenerated -public final class EchoGrpc { - - private EchoGrpc() {} - - public static final String SERVICE_NAME = "google.showcase.v1beta1.Echo"; - - // Static method descriptors that strictly reflect the proto. - private static volatile io.grpc.MethodDescriptor getEchoMethod; - - @io.grpc.stub.annotations.RpcMethod( - fullMethodName = SERVICE_NAME + '/' + "Echo", - requestType = com.google.showcase.v1beta1.EchoRequest.class, - responseType = com.google.showcase.v1beta1.EchoResponse.class, - methodType = io.grpc.MethodDescriptor.MethodType.UNARY) - public static io.grpc.MethodDescriptor getEchoMethod() { - io.grpc.MethodDescriptor getEchoMethod; - if ((getEchoMethod = EchoGrpc.getEchoMethod) == null) { - synchronized (EchoGrpc.class) { - if ((getEchoMethod = EchoGrpc.getEchoMethod) == null) { - EchoGrpc.getEchoMethod = getEchoMethod = - io.grpc.MethodDescriptor.newBuilder() - .setType(io.grpc.MethodDescriptor.MethodType.UNARY) - .setFullMethodName(generateFullMethodName(SERVICE_NAME, "Echo")) - .setSampledToLocalTracing(true) - .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( - com.google.showcase.v1beta1.EchoRequest.getDefaultInstance())) - .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( - com.google.showcase.v1beta1.EchoResponse.getDefaultInstance())) - .setSchemaDescriptor(new EchoMethodDescriptorSupplier("Echo")) - .build(); - } - } - } - return getEchoMethod; - } - - private static volatile io.grpc.MethodDescriptor getExpandMethod; - - @io.grpc.stub.annotations.RpcMethod( - fullMethodName = SERVICE_NAME + '/' + "Expand", - requestType = com.google.showcase.v1beta1.ExpandRequest.class, - responseType = com.google.showcase.v1beta1.EchoResponse.class, - methodType = io.grpc.MethodDescriptor.MethodType.SERVER_STREAMING) - public static io.grpc.MethodDescriptor getExpandMethod() { - io.grpc.MethodDescriptor getExpandMethod; - if ((getExpandMethod = EchoGrpc.getExpandMethod) == null) { - synchronized (EchoGrpc.class) { - if ((getExpandMethod = EchoGrpc.getExpandMethod) == null) { - EchoGrpc.getExpandMethod = getExpandMethod = - io.grpc.MethodDescriptor.newBuilder() - .setType(io.grpc.MethodDescriptor.MethodType.SERVER_STREAMING) - .setFullMethodName(generateFullMethodName(SERVICE_NAME, "Expand")) - .setSampledToLocalTracing(true) - .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( - com.google.showcase.v1beta1.ExpandRequest.getDefaultInstance())) - .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( - com.google.showcase.v1beta1.EchoResponse.getDefaultInstance())) - .setSchemaDescriptor(new EchoMethodDescriptorSupplier("Expand")) - .build(); - } - } - } - return getExpandMethod; - } - - private static volatile io.grpc.MethodDescriptor getCollectMethod; - - @io.grpc.stub.annotations.RpcMethod( - fullMethodName = SERVICE_NAME + '/' + "Collect", - requestType = com.google.showcase.v1beta1.EchoRequest.class, - responseType = com.google.showcase.v1beta1.EchoResponse.class, - methodType = io.grpc.MethodDescriptor.MethodType.CLIENT_STREAMING) - public static io.grpc.MethodDescriptor getCollectMethod() { - io.grpc.MethodDescriptor getCollectMethod; - if ((getCollectMethod = EchoGrpc.getCollectMethod) == null) { - synchronized (EchoGrpc.class) { - if ((getCollectMethod = EchoGrpc.getCollectMethod) == null) { - EchoGrpc.getCollectMethod = getCollectMethod = - io.grpc.MethodDescriptor.newBuilder() - .setType(io.grpc.MethodDescriptor.MethodType.CLIENT_STREAMING) - .setFullMethodName(generateFullMethodName(SERVICE_NAME, "Collect")) - .setSampledToLocalTracing(true) - .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( - com.google.showcase.v1beta1.EchoRequest.getDefaultInstance())) - .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( - com.google.showcase.v1beta1.EchoResponse.getDefaultInstance())) - .setSchemaDescriptor(new EchoMethodDescriptorSupplier("Collect")) - .build(); - } - } - } - return getCollectMethod; - } - - private static volatile io.grpc.MethodDescriptor getChatMethod; - - @io.grpc.stub.annotations.RpcMethod( - fullMethodName = SERVICE_NAME + '/' + "Chat", - requestType = com.google.showcase.v1beta1.EchoRequest.class, - responseType = com.google.showcase.v1beta1.EchoResponse.class, - methodType = io.grpc.MethodDescriptor.MethodType.BIDI_STREAMING) - public static io.grpc.MethodDescriptor getChatMethod() { - io.grpc.MethodDescriptor getChatMethod; - if ((getChatMethod = EchoGrpc.getChatMethod) == null) { - synchronized (EchoGrpc.class) { - if ((getChatMethod = EchoGrpc.getChatMethod) == null) { - EchoGrpc.getChatMethod = getChatMethod = - io.grpc.MethodDescriptor.newBuilder() - .setType(io.grpc.MethodDescriptor.MethodType.BIDI_STREAMING) - .setFullMethodName(generateFullMethodName(SERVICE_NAME, "Chat")) - .setSampledToLocalTracing(true) - .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( - com.google.showcase.v1beta1.EchoRequest.getDefaultInstance())) - .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( - com.google.showcase.v1beta1.EchoResponse.getDefaultInstance())) - .setSchemaDescriptor(new EchoMethodDescriptorSupplier("Chat")) - .build(); - } - } - } - return getChatMethod; - } - - private static volatile io.grpc.MethodDescriptor getPagedExpandMethod; - - @io.grpc.stub.annotations.RpcMethod( - fullMethodName = SERVICE_NAME + '/' + "PagedExpand", - requestType = com.google.showcase.v1beta1.PagedExpandRequest.class, - responseType = com.google.showcase.v1beta1.PagedExpandResponse.class, - methodType = io.grpc.MethodDescriptor.MethodType.UNARY) - public static io.grpc.MethodDescriptor getPagedExpandMethod() { - io.grpc.MethodDescriptor getPagedExpandMethod; - if ((getPagedExpandMethod = EchoGrpc.getPagedExpandMethod) == null) { - synchronized (EchoGrpc.class) { - if ((getPagedExpandMethod = EchoGrpc.getPagedExpandMethod) == null) { - EchoGrpc.getPagedExpandMethod = getPagedExpandMethod = - io.grpc.MethodDescriptor.newBuilder() - .setType(io.grpc.MethodDescriptor.MethodType.UNARY) - .setFullMethodName(generateFullMethodName(SERVICE_NAME, "PagedExpand")) - .setSampledToLocalTracing(true) - .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( - com.google.showcase.v1beta1.PagedExpandRequest.getDefaultInstance())) - .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( - com.google.showcase.v1beta1.PagedExpandResponse.getDefaultInstance())) - .setSchemaDescriptor(new EchoMethodDescriptorSupplier("PagedExpand")) - .build(); - } - } - } - return getPagedExpandMethod; - } - - private static volatile io.grpc.MethodDescriptor getPagedExpandLegacyMethod; - - @io.grpc.stub.annotations.RpcMethod( - fullMethodName = SERVICE_NAME + '/' + "PagedExpandLegacy", - requestType = com.google.showcase.v1beta1.PagedExpandLegacyRequest.class, - responseType = com.google.showcase.v1beta1.PagedExpandResponse.class, - methodType = io.grpc.MethodDescriptor.MethodType.UNARY) - public static io.grpc.MethodDescriptor getPagedExpandLegacyMethod() { - io.grpc.MethodDescriptor getPagedExpandLegacyMethod; - if ((getPagedExpandLegacyMethod = EchoGrpc.getPagedExpandLegacyMethod) == null) { - synchronized (EchoGrpc.class) { - if ((getPagedExpandLegacyMethod = EchoGrpc.getPagedExpandLegacyMethod) == null) { - EchoGrpc.getPagedExpandLegacyMethod = getPagedExpandLegacyMethod = - io.grpc.MethodDescriptor.newBuilder() - .setType(io.grpc.MethodDescriptor.MethodType.UNARY) - .setFullMethodName(generateFullMethodName(SERVICE_NAME, "PagedExpandLegacy")) - .setSampledToLocalTracing(true) - .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( - com.google.showcase.v1beta1.PagedExpandLegacyRequest.getDefaultInstance())) - .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( - com.google.showcase.v1beta1.PagedExpandResponse.getDefaultInstance())) - .setSchemaDescriptor(new EchoMethodDescriptorSupplier("PagedExpandLegacy")) - .build(); - } - } - } - return getPagedExpandLegacyMethod; - } - - private static volatile io.grpc.MethodDescriptor getPagedExpandLegacyMappedMethod; - - @io.grpc.stub.annotations.RpcMethod( - fullMethodName = SERVICE_NAME + '/' + "PagedExpandLegacyMapped", - requestType = com.google.showcase.v1beta1.PagedExpandRequest.class, - responseType = com.google.showcase.v1beta1.PagedExpandLegacyMappedResponse.class, - methodType = io.grpc.MethodDescriptor.MethodType.UNARY) - public static io.grpc.MethodDescriptor getPagedExpandLegacyMappedMethod() { - io.grpc.MethodDescriptor getPagedExpandLegacyMappedMethod; - if ((getPagedExpandLegacyMappedMethod = EchoGrpc.getPagedExpandLegacyMappedMethod) == null) { - synchronized (EchoGrpc.class) { - if ((getPagedExpandLegacyMappedMethod = EchoGrpc.getPagedExpandLegacyMappedMethod) == null) { - EchoGrpc.getPagedExpandLegacyMappedMethod = getPagedExpandLegacyMappedMethod = - io.grpc.MethodDescriptor.newBuilder() - .setType(io.grpc.MethodDescriptor.MethodType.UNARY) - .setFullMethodName(generateFullMethodName(SERVICE_NAME, "PagedExpandLegacyMapped")) - .setSampledToLocalTracing(true) - .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( - com.google.showcase.v1beta1.PagedExpandRequest.getDefaultInstance())) - .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( - com.google.showcase.v1beta1.PagedExpandLegacyMappedResponse.getDefaultInstance())) - .setSchemaDescriptor(new EchoMethodDescriptorSupplier("PagedExpandLegacyMapped")) - .build(); - } - } - } - return getPagedExpandLegacyMappedMethod; - } - - private static volatile io.grpc.MethodDescriptor getWaitMethod; - - @io.grpc.stub.annotations.RpcMethod( - fullMethodName = SERVICE_NAME + '/' + "Wait", - requestType = com.google.showcase.v1beta1.WaitRequest.class, - responseType = com.google.longrunning.Operation.class, - methodType = io.grpc.MethodDescriptor.MethodType.UNARY) - public static io.grpc.MethodDescriptor getWaitMethod() { - io.grpc.MethodDescriptor getWaitMethod; - if ((getWaitMethod = EchoGrpc.getWaitMethod) == null) { - synchronized (EchoGrpc.class) { - if ((getWaitMethod = EchoGrpc.getWaitMethod) == null) { - EchoGrpc.getWaitMethod = getWaitMethod = - io.grpc.MethodDescriptor.newBuilder() - .setType(io.grpc.MethodDescriptor.MethodType.UNARY) - .setFullMethodName(generateFullMethodName(SERVICE_NAME, "Wait")) - .setSampledToLocalTracing(true) - .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( - com.google.showcase.v1beta1.WaitRequest.getDefaultInstance())) - .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( - com.google.longrunning.Operation.getDefaultInstance())) - .setSchemaDescriptor(new EchoMethodDescriptorSupplier("Wait")) - .build(); - } - } - } - return getWaitMethod; - } - - private static volatile io.grpc.MethodDescriptor getBlockMethod; - - @io.grpc.stub.annotations.RpcMethod( - fullMethodName = SERVICE_NAME + '/' + "Block", - requestType = com.google.showcase.v1beta1.BlockRequest.class, - responseType = com.google.showcase.v1beta1.BlockResponse.class, - methodType = io.grpc.MethodDescriptor.MethodType.UNARY) - public static io.grpc.MethodDescriptor getBlockMethod() { - io.grpc.MethodDescriptor getBlockMethod; - if ((getBlockMethod = EchoGrpc.getBlockMethod) == null) { - synchronized (EchoGrpc.class) { - if ((getBlockMethod = EchoGrpc.getBlockMethod) == null) { - EchoGrpc.getBlockMethod = getBlockMethod = - io.grpc.MethodDescriptor.newBuilder() - .setType(io.grpc.MethodDescriptor.MethodType.UNARY) - .setFullMethodName(generateFullMethodName(SERVICE_NAME, "Block")) - .setSampledToLocalTracing(true) - .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( - com.google.showcase.v1beta1.BlockRequest.getDefaultInstance())) - .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( - com.google.showcase.v1beta1.BlockResponse.getDefaultInstance())) - .setSchemaDescriptor(new EchoMethodDescriptorSupplier("Block")) - .build(); - } - } - } - return getBlockMethod; - } - - /** - * Creates a new async stub that supports all call types for the service - */ - public static EchoStub newStub(io.grpc.Channel channel) { - io.grpc.stub.AbstractStub.StubFactory factory = - new io.grpc.stub.AbstractStub.StubFactory() { - @java.lang.Override - public EchoStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { - return new EchoStub(channel, callOptions); - } - }; - return EchoStub.newStub(factory, channel); - } - - /** - * Creates a new blocking-style stub that supports unary and streaming output calls on the service - */ - public static EchoBlockingStub newBlockingStub( - io.grpc.Channel channel) { - io.grpc.stub.AbstractStub.StubFactory factory = - new io.grpc.stub.AbstractStub.StubFactory() { - @java.lang.Override - public EchoBlockingStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { - return new EchoBlockingStub(channel, callOptions); - } - }; - return EchoBlockingStub.newStub(factory, channel); - } - - /** - * Creates a new ListenableFuture-style stub that supports unary calls on the service - */ - public static EchoFutureStub newFutureStub( - io.grpc.Channel channel) { - io.grpc.stub.AbstractStub.StubFactory factory = - new io.grpc.stub.AbstractStub.StubFactory() { - @java.lang.Override - public EchoFutureStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { - return new EchoFutureStub(channel, callOptions); - } - }; - return EchoFutureStub.newStub(factory, channel); - } - - /** - */ - public static abstract class EchoImplBase implements io.grpc.BindableService { - - /** - */ - public void echo(com.google.showcase.v1beta1.EchoRequest request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getEchoMethod(), responseObserver); - } - - /** - */ - public void expand(com.google.showcase.v1beta1.ExpandRequest request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getExpandMethod(), responseObserver); - } - - /** - */ - public io.grpc.stub.StreamObserver collect( - io.grpc.stub.StreamObserver responseObserver) { - return io.grpc.stub.ServerCalls.asyncUnimplementedStreamingCall(getCollectMethod(), responseObserver); - } - - /** - */ - public io.grpc.stub.StreamObserver chat( - io.grpc.stub.StreamObserver responseObserver) { - return io.grpc.stub.ServerCalls.asyncUnimplementedStreamingCall(getChatMethod(), responseObserver); - } - - /** - */ - public void pagedExpand(com.google.showcase.v1beta1.PagedExpandRequest request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getPagedExpandMethod(), responseObserver); - } - - /** - */ - public void pagedExpandLegacy(com.google.showcase.v1beta1.PagedExpandLegacyRequest request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getPagedExpandLegacyMethod(), responseObserver); - } - - /** - */ - public void pagedExpandLegacyMapped(com.google.showcase.v1beta1.PagedExpandRequest request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getPagedExpandLegacyMappedMethod(), responseObserver); - } - - /** - */ - public void wait(com.google.showcase.v1beta1.WaitRequest request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getWaitMethod(), responseObserver); - } - - /** - */ - public void block(com.google.showcase.v1beta1.BlockRequest request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getBlockMethod(), responseObserver); - } - - @java.lang.Override public final io.grpc.ServerServiceDefinition bindService() { - return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) - .addMethod( - getEchoMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - com.google.showcase.v1beta1.EchoRequest, - com.google.showcase.v1beta1.EchoResponse>( - this, METHODID_ECHO))) - .addMethod( - getExpandMethod(), - io.grpc.stub.ServerCalls.asyncServerStreamingCall( - new MethodHandlers< - com.google.showcase.v1beta1.ExpandRequest, - com.google.showcase.v1beta1.EchoResponse>( - this, METHODID_EXPAND))) - .addMethod( - getCollectMethod(), - io.grpc.stub.ServerCalls.asyncClientStreamingCall( - new MethodHandlers< - com.google.showcase.v1beta1.EchoRequest, - com.google.showcase.v1beta1.EchoResponse>( - this, METHODID_COLLECT))) - .addMethod( - getChatMethod(), - io.grpc.stub.ServerCalls.asyncBidiStreamingCall( - new MethodHandlers< - com.google.showcase.v1beta1.EchoRequest, - com.google.showcase.v1beta1.EchoResponse>( - this, METHODID_CHAT))) - .addMethod( - getPagedExpandMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - com.google.showcase.v1beta1.PagedExpandRequest, - com.google.showcase.v1beta1.PagedExpandResponse>( - this, METHODID_PAGED_EXPAND))) - .addMethod( - getPagedExpandLegacyMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - com.google.showcase.v1beta1.PagedExpandLegacyRequest, - com.google.showcase.v1beta1.PagedExpandResponse>( - this, METHODID_PAGED_EXPAND_LEGACY))) - .addMethod( - getPagedExpandLegacyMappedMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - com.google.showcase.v1beta1.PagedExpandRequest, - com.google.showcase.v1beta1.PagedExpandLegacyMappedResponse>( - this, METHODID_PAGED_EXPAND_LEGACY_MAPPED))) - .addMethod( - getWaitMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - com.google.showcase.v1beta1.WaitRequest, - com.google.longrunning.Operation>( - this, METHODID_WAIT))) - .addMethod( - getBlockMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - com.google.showcase.v1beta1.BlockRequest, - com.google.showcase.v1beta1.BlockResponse>( - this, METHODID_BLOCK))) - .build(); - } - } - - /** - */ - public static final class EchoStub extends io.grpc.stub.AbstractAsyncStub { - private EchoStub( - io.grpc.Channel channel, io.grpc.CallOptions callOptions) { - super(channel, callOptions); - } - - @java.lang.Override - protected EchoStub build( - io.grpc.Channel channel, io.grpc.CallOptions callOptions) { - return new EchoStub(channel, callOptions); - } - - /** - */ - public void echo(com.google.showcase.v1beta1.EchoRequest request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ClientCalls.asyncUnaryCall( - getChannel().newCall(getEchoMethod(), getCallOptions()), request, responseObserver); - } - - /** - */ - public void expand(com.google.showcase.v1beta1.ExpandRequest request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ClientCalls.asyncServerStreamingCall( - getChannel().newCall(getExpandMethod(), getCallOptions()), request, responseObserver); - } - - /** - */ - public io.grpc.stub.StreamObserver collect( - io.grpc.stub.StreamObserver responseObserver) { - return io.grpc.stub.ClientCalls.asyncClientStreamingCall( - getChannel().newCall(getCollectMethod(), getCallOptions()), responseObserver); - } - - /** - */ - public io.grpc.stub.StreamObserver chat( - io.grpc.stub.StreamObserver responseObserver) { - return io.grpc.stub.ClientCalls.asyncBidiStreamingCall( - getChannel().newCall(getChatMethod(), getCallOptions()), responseObserver); - } - - /** - */ - public void pagedExpand(com.google.showcase.v1beta1.PagedExpandRequest request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ClientCalls.asyncUnaryCall( - getChannel().newCall(getPagedExpandMethod(), getCallOptions()), request, responseObserver); - } - - /** - */ - public void pagedExpandLegacy(com.google.showcase.v1beta1.PagedExpandLegacyRequest request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ClientCalls.asyncUnaryCall( - getChannel().newCall(getPagedExpandLegacyMethod(), getCallOptions()), request, responseObserver); - } - - /** - */ - public void pagedExpandLegacyMapped(com.google.showcase.v1beta1.PagedExpandRequest request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ClientCalls.asyncUnaryCall( - getChannel().newCall(getPagedExpandLegacyMappedMethod(), getCallOptions()), request, responseObserver); - } - - /** - */ - public void wait(com.google.showcase.v1beta1.WaitRequest request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ClientCalls.asyncUnaryCall( - getChannel().newCall(getWaitMethod(), getCallOptions()), request, responseObserver); - } - - /** - */ - public void block(com.google.showcase.v1beta1.BlockRequest request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ClientCalls.asyncUnaryCall( - getChannel().newCall(getBlockMethod(), getCallOptions()), request, responseObserver); - } - } - - /** - */ - public static final class EchoBlockingStub extends io.grpc.stub.AbstractBlockingStub { - private EchoBlockingStub( - io.grpc.Channel channel, io.grpc.CallOptions callOptions) { - super(channel, callOptions); - } - - @java.lang.Override - protected EchoBlockingStub build( - io.grpc.Channel channel, io.grpc.CallOptions callOptions) { - return new EchoBlockingStub(channel, callOptions); - } - - /** - */ - public com.google.showcase.v1beta1.EchoResponse echo(com.google.showcase.v1beta1.EchoRequest request) { - return io.grpc.stub.ClientCalls.blockingUnaryCall( - getChannel(), getEchoMethod(), getCallOptions(), request); - } - - /** - */ - public java.util.Iterator expand( - com.google.showcase.v1beta1.ExpandRequest request) { - return io.grpc.stub.ClientCalls.blockingServerStreamingCall( - getChannel(), getExpandMethod(), getCallOptions(), request); - } - - /** - */ - public com.google.showcase.v1beta1.PagedExpandResponse pagedExpand(com.google.showcase.v1beta1.PagedExpandRequest request) { - return io.grpc.stub.ClientCalls.blockingUnaryCall( - getChannel(), getPagedExpandMethod(), getCallOptions(), request); - } - - /** - */ - public com.google.showcase.v1beta1.PagedExpandResponse pagedExpandLegacy(com.google.showcase.v1beta1.PagedExpandLegacyRequest request) { - return io.grpc.stub.ClientCalls.blockingUnaryCall( - getChannel(), getPagedExpandLegacyMethod(), getCallOptions(), request); - } - - /** - */ - public com.google.showcase.v1beta1.PagedExpandLegacyMappedResponse pagedExpandLegacyMapped(com.google.showcase.v1beta1.PagedExpandRequest request) { - return io.grpc.stub.ClientCalls.blockingUnaryCall( - getChannel(), getPagedExpandLegacyMappedMethod(), getCallOptions(), request); - } - - /** - */ - public com.google.longrunning.Operation wait(com.google.showcase.v1beta1.WaitRequest request) { - return io.grpc.stub.ClientCalls.blockingUnaryCall( - getChannel(), getWaitMethod(), getCallOptions(), request); - } - - /** - */ - public com.google.showcase.v1beta1.BlockResponse block(com.google.showcase.v1beta1.BlockRequest request) { - return io.grpc.stub.ClientCalls.blockingUnaryCall( - getChannel(), getBlockMethod(), getCallOptions(), request); - } - } - - /** - */ - public static final class EchoFutureStub extends io.grpc.stub.AbstractFutureStub { - private EchoFutureStub( - io.grpc.Channel channel, io.grpc.CallOptions callOptions) { - super(channel, callOptions); - } - - @java.lang.Override - protected EchoFutureStub build( - io.grpc.Channel channel, io.grpc.CallOptions callOptions) { - return new EchoFutureStub(channel, callOptions); - } - - /** - */ - public com.google.common.util.concurrent.ListenableFuture echo( - com.google.showcase.v1beta1.EchoRequest request) { - return io.grpc.stub.ClientCalls.futureUnaryCall( - getChannel().newCall(getEchoMethod(), getCallOptions()), request); - } - - /** - */ - public com.google.common.util.concurrent.ListenableFuture pagedExpand( - com.google.showcase.v1beta1.PagedExpandRequest request) { - return io.grpc.stub.ClientCalls.futureUnaryCall( - getChannel().newCall(getPagedExpandMethod(), getCallOptions()), request); - } - - /** - */ - public com.google.common.util.concurrent.ListenableFuture pagedExpandLegacy( - com.google.showcase.v1beta1.PagedExpandLegacyRequest request) { - return io.grpc.stub.ClientCalls.futureUnaryCall( - getChannel().newCall(getPagedExpandLegacyMethod(), getCallOptions()), request); - } - - /** - */ - public com.google.common.util.concurrent.ListenableFuture pagedExpandLegacyMapped( - com.google.showcase.v1beta1.PagedExpandRequest request) { - return io.grpc.stub.ClientCalls.futureUnaryCall( - getChannel().newCall(getPagedExpandLegacyMappedMethod(), getCallOptions()), request); - } - - /** - */ - public com.google.common.util.concurrent.ListenableFuture wait( - com.google.showcase.v1beta1.WaitRequest request) { - return io.grpc.stub.ClientCalls.futureUnaryCall( - getChannel().newCall(getWaitMethod(), getCallOptions()), request); - } - - /** - */ - public com.google.common.util.concurrent.ListenableFuture block( - com.google.showcase.v1beta1.BlockRequest request) { - return io.grpc.stub.ClientCalls.futureUnaryCall( - getChannel().newCall(getBlockMethod(), getCallOptions()), request); - } - } - - private static final int METHODID_ECHO = 0; - private static final int METHODID_EXPAND = 1; - private static final int METHODID_PAGED_EXPAND = 2; - private static final int METHODID_PAGED_EXPAND_LEGACY = 3; - private static final int METHODID_PAGED_EXPAND_LEGACY_MAPPED = 4; - private static final int METHODID_WAIT = 5; - private static final int METHODID_BLOCK = 6; - private static final int METHODID_COLLECT = 7; - private static final int METHODID_CHAT = 8; - - 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 EchoImplBase serviceImpl; - private final int methodId; - - MethodHandlers(EchoImplBase 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_ECHO: - serviceImpl.echo((com.google.showcase.v1beta1.EchoRequest) request, - (io.grpc.stub.StreamObserver) responseObserver); - break; - case METHODID_EXPAND: - serviceImpl.expand((com.google.showcase.v1beta1.ExpandRequest) request, - (io.grpc.stub.StreamObserver) responseObserver); - break; - case METHODID_PAGED_EXPAND: - serviceImpl.pagedExpand((com.google.showcase.v1beta1.PagedExpandRequest) request, - (io.grpc.stub.StreamObserver) responseObserver); - break; - case METHODID_PAGED_EXPAND_LEGACY: - serviceImpl.pagedExpandLegacy((com.google.showcase.v1beta1.PagedExpandLegacyRequest) request, - (io.grpc.stub.StreamObserver) responseObserver); - break; - case METHODID_PAGED_EXPAND_LEGACY_MAPPED: - serviceImpl.pagedExpandLegacyMapped((com.google.showcase.v1beta1.PagedExpandRequest) request, - (io.grpc.stub.StreamObserver) responseObserver); - break; - case METHODID_WAIT: - serviceImpl.wait((com.google.showcase.v1beta1.WaitRequest) request, - (io.grpc.stub.StreamObserver) responseObserver); - break; - case METHODID_BLOCK: - serviceImpl.block((com.google.showcase.v1beta1.BlockRequest) 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_COLLECT: - return (io.grpc.stub.StreamObserver) serviceImpl.collect( - (io.grpc.stub.StreamObserver) responseObserver); - case METHODID_CHAT: - return (io.grpc.stub.StreamObserver) serviceImpl.chat( - (io.grpc.stub.StreamObserver) responseObserver); - default: - throw new AssertionError(); - } - } - } - - private static abstract class EchoBaseDescriptorSupplier - implements io.grpc.protobuf.ProtoFileDescriptorSupplier, io.grpc.protobuf.ProtoServiceDescriptorSupplier { - EchoBaseDescriptorSupplier() {} - - @java.lang.Override - public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() { - return com.google.showcase.v1beta1.EchoOuterClass.getDescriptor(); - } - - @java.lang.Override - public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() { - return getFileDescriptor().findServiceByName("Echo"); - } - } - - private static final class EchoFileDescriptorSupplier - extends EchoBaseDescriptorSupplier { - EchoFileDescriptorSupplier() {} - } - - private static final class EchoMethodDescriptorSupplier - extends EchoBaseDescriptorSupplier - implements io.grpc.protobuf.ProtoMethodDescriptorSupplier { - private final String methodName; - - EchoMethodDescriptorSupplier(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 (EchoGrpc.class) { - result = serviceDescriptor; - if (result == null) { - serviceDescriptor = result = io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME) - .setSchemaDescriptor(new EchoFileDescriptorSupplier()) - .addMethod(getEchoMethod()) - .addMethod(getExpandMethod()) - .addMethod(getCollectMethod()) - .addMethod(getChatMethod()) - .addMethod(getPagedExpandMethod()) - .addMethod(getPagedExpandLegacyMethod()) - .addMethod(getPagedExpandLegacyMappedMethod()) - .addMethod(getWaitMethod()) - .addMethod(getBlockMethod()) - .build(); - } - } - } - return result; - } -} diff --git a/showcase/grpc-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/IdentityGrpc.java b/showcase/grpc-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/IdentityGrpc.java deleted file mode 100644 index bcfa37a663..0000000000 --- a/showcase/grpc-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/IdentityGrpc.java +++ /dev/null @@ -1,572 +0,0 @@ -package com.google.showcase.v1beta1; - -import static io.grpc.MethodDescriptor.generateFullMethodName; - -/** - */ -@javax.annotation.Generated( - value = "by gRPC proto compiler", - comments = "Source: schema/google/showcase/v1beta1/identity.proto") -@io.grpc.stub.annotations.GrpcGenerated -public final class IdentityGrpc { - - private IdentityGrpc() {} - - public static final String SERVICE_NAME = "google.showcase.v1beta1.Identity"; - - // Static method descriptors that strictly reflect the proto. - private static volatile io.grpc.MethodDescriptor getCreateUserMethod; - - @io.grpc.stub.annotations.RpcMethod( - fullMethodName = SERVICE_NAME + '/' + "CreateUser", - requestType = com.google.showcase.v1beta1.CreateUserRequest.class, - responseType = com.google.showcase.v1beta1.User.class, - methodType = io.grpc.MethodDescriptor.MethodType.UNARY) - public static io.grpc.MethodDescriptor getCreateUserMethod() { - io.grpc.MethodDescriptor getCreateUserMethod; - if ((getCreateUserMethod = IdentityGrpc.getCreateUserMethod) == null) { - synchronized (IdentityGrpc.class) { - if ((getCreateUserMethod = IdentityGrpc.getCreateUserMethod) == null) { - IdentityGrpc.getCreateUserMethod = getCreateUserMethod = - io.grpc.MethodDescriptor.newBuilder() - .setType(io.grpc.MethodDescriptor.MethodType.UNARY) - .setFullMethodName(generateFullMethodName(SERVICE_NAME, "CreateUser")) - .setSampledToLocalTracing(true) - .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( - com.google.showcase.v1beta1.CreateUserRequest.getDefaultInstance())) - .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( - com.google.showcase.v1beta1.User.getDefaultInstance())) - .setSchemaDescriptor(new IdentityMethodDescriptorSupplier("CreateUser")) - .build(); - } - } - } - return getCreateUserMethod; - } - - private static volatile io.grpc.MethodDescriptor getGetUserMethod; - - @io.grpc.stub.annotations.RpcMethod( - fullMethodName = SERVICE_NAME + '/' + "GetUser", - requestType = com.google.showcase.v1beta1.GetUserRequest.class, - responseType = com.google.showcase.v1beta1.User.class, - methodType = io.grpc.MethodDescriptor.MethodType.UNARY) - public static io.grpc.MethodDescriptor getGetUserMethod() { - io.grpc.MethodDescriptor getGetUserMethod; - if ((getGetUserMethod = IdentityGrpc.getGetUserMethod) == null) { - synchronized (IdentityGrpc.class) { - if ((getGetUserMethod = IdentityGrpc.getGetUserMethod) == null) { - IdentityGrpc.getGetUserMethod = getGetUserMethod = - io.grpc.MethodDescriptor.newBuilder() - .setType(io.grpc.MethodDescriptor.MethodType.UNARY) - .setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetUser")) - .setSampledToLocalTracing(true) - .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( - com.google.showcase.v1beta1.GetUserRequest.getDefaultInstance())) - .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( - com.google.showcase.v1beta1.User.getDefaultInstance())) - .setSchemaDescriptor(new IdentityMethodDescriptorSupplier("GetUser")) - .build(); - } - } - } - return getGetUserMethod; - } - - private static volatile io.grpc.MethodDescriptor getUpdateUserMethod; - - @io.grpc.stub.annotations.RpcMethod( - fullMethodName = SERVICE_NAME + '/' + "UpdateUser", - requestType = com.google.showcase.v1beta1.UpdateUserRequest.class, - responseType = com.google.showcase.v1beta1.User.class, - methodType = io.grpc.MethodDescriptor.MethodType.UNARY) - public static io.grpc.MethodDescriptor getUpdateUserMethod() { - io.grpc.MethodDescriptor getUpdateUserMethod; - if ((getUpdateUserMethod = IdentityGrpc.getUpdateUserMethod) == null) { - synchronized (IdentityGrpc.class) { - if ((getUpdateUserMethod = IdentityGrpc.getUpdateUserMethod) == null) { - IdentityGrpc.getUpdateUserMethod = getUpdateUserMethod = - io.grpc.MethodDescriptor.newBuilder() - .setType(io.grpc.MethodDescriptor.MethodType.UNARY) - .setFullMethodName(generateFullMethodName(SERVICE_NAME, "UpdateUser")) - .setSampledToLocalTracing(true) - .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( - com.google.showcase.v1beta1.UpdateUserRequest.getDefaultInstance())) - .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( - com.google.showcase.v1beta1.User.getDefaultInstance())) - .setSchemaDescriptor(new IdentityMethodDescriptorSupplier("UpdateUser")) - .build(); - } - } - } - return getUpdateUserMethod; - } - - private static volatile io.grpc.MethodDescriptor getDeleteUserMethod; - - @io.grpc.stub.annotations.RpcMethod( - fullMethodName = SERVICE_NAME + '/' + "DeleteUser", - requestType = com.google.showcase.v1beta1.DeleteUserRequest.class, - responseType = com.google.protobuf.Empty.class, - methodType = io.grpc.MethodDescriptor.MethodType.UNARY) - public static io.grpc.MethodDescriptor getDeleteUserMethod() { - io.grpc.MethodDescriptor getDeleteUserMethod; - if ((getDeleteUserMethod = IdentityGrpc.getDeleteUserMethod) == null) { - synchronized (IdentityGrpc.class) { - if ((getDeleteUserMethod = IdentityGrpc.getDeleteUserMethod) == null) { - IdentityGrpc.getDeleteUserMethod = getDeleteUserMethod = - io.grpc.MethodDescriptor.newBuilder() - .setType(io.grpc.MethodDescriptor.MethodType.UNARY) - .setFullMethodName(generateFullMethodName(SERVICE_NAME, "DeleteUser")) - .setSampledToLocalTracing(true) - .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( - com.google.showcase.v1beta1.DeleteUserRequest.getDefaultInstance())) - .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( - com.google.protobuf.Empty.getDefaultInstance())) - .setSchemaDescriptor(new IdentityMethodDescriptorSupplier("DeleteUser")) - .build(); - } - } - } - return getDeleteUserMethod; - } - - private static volatile io.grpc.MethodDescriptor getListUsersMethod; - - @io.grpc.stub.annotations.RpcMethod( - fullMethodName = SERVICE_NAME + '/' + "ListUsers", - requestType = com.google.showcase.v1beta1.ListUsersRequest.class, - responseType = com.google.showcase.v1beta1.ListUsersResponse.class, - methodType = io.grpc.MethodDescriptor.MethodType.UNARY) - public static io.grpc.MethodDescriptor getListUsersMethod() { - io.grpc.MethodDescriptor getListUsersMethod; - if ((getListUsersMethod = IdentityGrpc.getListUsersMethod) == null) { - synchronized (IdentityGrpc.class) { - if ((getListUsersMethod = IdentityGrpc.getListUsersMethod) == null) { - IdentityGrpc.getListUsersMethod = getListUsersMethod = - io.grpc.MethodDescriptor.newBuilder() - .setType(io.grpc.MethodDescriptor.MethodType.UNARY) - .setFullMethodName(generateFullMethodName(SERVICE_NAME, "ListUsers")) - .setSampledToLocalTracing(true) - .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( - com.google.showcase.v1beta1.ListUsersRequest.getDefaultInstance())) - .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( - com.google.showcase.v1beta1.ListUsersResponse.getDefaultInstance())) - .setSchemaDescriptor(new IdentityMethodDescriptorSupplier("ListUsers")) - .build(); - } - } - } - return getListUsersMethod; - } - - /** - * Creates a new async stub that supports all call types for the service - */ - public static IdentityStub newStub(io.grpc.Channel channel) { - io.grpc.stub.AbstractStub.StubFactory factory = - new io.grpc.stub.AbstractStub.StubFactory() { - @java.lang.Override - public IdentityStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { - return new IdentityStub(channel, callOptions); - } - }; - return IdentityStub.newStub(factory, channel); - } - - /** - * Creates a new blocking-style stub that supports unary and streaming output calls on the service - */ - public static IdentityBlockingStub newBlockingStub( - io.grpc.Channel channel) { - io.grpc.stub.AbstractStub.StubFactory factory = - new io.grpc.stub.AbstractStub.StubFactory() { - @java.lang.Override - public IdentityBlockingStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { - return new IdentityBlockingStub(channel, callOptions); - } - }; - return IdentityBlockingStub.newStub(factory, channel); - } - - /** - * Creates a new ListenableFuture-style stub that supports unary calls on the service - */ - public static IdentityFutureStub newFutureStub( - io.grpc.Channel channel) { - io.grpc.stub.AbstractStub.StubFactory factory = - new io.grpc.stub.AbstractStub.StubFactory() { - @java.lang.Override - public IdentityFutureStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { - return new IdentityFutureStub(channel, callOptions); - } - }; - return IdentityFutureStub.newStub(factory, channel); - } - - /** - */ - public static abstract class IdentityImplBase implements io.grpc.BindableService { - - /** - */ - public void createUser(com.google.showcase.v1beta1.CreateUserRequest request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getCreateUserMethod(), responseObserver); - } - - /** - */ - public void getUser(com.google.showcase.v1beta1.GetUserRequest request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getGetUserMethod(), responseObserver); - } - - /** - */ - public void updateUser(com.google.showcase.v1beta1.UpdateUserRequest request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getUpdateUserMethod(), responseObserver); - } - - /** - */ - public void deleteUser(com.google.showcase.v1beta1.DeleteUserRequest request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getDeleteUserMethod(), responseObserver); - } - - /** - */ - public void listUsers(com.google.showcase.v1beta1.ListUsersRequest request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getListUsersMethod(), responseObserver); - } - - @java.lang.Override public final io.grpc.ServerServiceDefinition bindService() { - return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) - .addMethod( - getCreateUserMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - com.google.showcase.v1beta1.CreateUserRequest, - com.google.showcase.v1beta1.User>( - this, METHODID_CREATE_USER))) - .addMethod( - getGetUserMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - com.google.showcase.v1beta1.GetUserRequest, - com.google.showcase.v1beta1.User>( - this, METHODID_GET_USER))) - .addMethod( - getUpdateUserMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - com.google.showcase.v1beta1.UpdateUserRequest, - com.google.showcase.v1beta1.User>( - this, METHODID_UPDATE_USER))) - .addMethod( - getDeleteUserMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - com.google.showcase.v1beta1.DeleteUserRequest, - com.google.protobuf.Empty>( - this, METHODID_DELETE_USER))) - .addMethod( - getListUsersMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - com.google.showcase.v1beta1.ListUsersRequest, - com.google.showcase.v1beta1.ListUsersResponse>( - this, METHODID_LIST_USERS))) - .build(); - } - } - - /** - */ - public static final class IdentityStub extends io.grpc.stub.AbstractAsyncStub { - private IdentityStub( - io.grpc.Channel channel, io.grpc.CallOptions callOptions) { - super(channel, callOptions); - } - - @java.lang.Override - protected IdentityStub build( - io.grpc.Channel channel, io.grpc.CallOptions callOptions) { - return new IdentityStub(channel, callOptions); - } - - /** - */ - public void createUser(com.google.showcase.v1beta1.CreateUserRequest request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ClientCalls.asyncUnaryCall( - getChannel().newCall(getCreateUserMethod(), getCallOptions()), request, responseObserver); - } - - /** - */ - public void getUser(com.google.showcase.v1beta1.GetUserRequest request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ClientCalls.asyncUnaryCall( - getChannel().newCall(getGetUserMethod(), getCallOptions()), request, responseObserver); - } - - /** - */ - public void updateUser(com.google.showcase.v1beta1.UpdateUserRequest request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ClientCalls.asyncUnaryCall( - getChannel().newCall(getUpdateUserMethod(), getCallOptions()), request, responseObserver); - } - - /** - */ - public void deleteUser(com.google.showcase.v1beta1.DeleteUserRequest request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ClientCalls.asyncUnaryCall( - getChannel().newCall(getDeleteUserMethod(), getCallOptions()), request, responseObserver); - } - - /** - */ - public void listUsers(com.google.showcase.v1beta1.ListUsersRequest request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ClientCalls.asyncUnaryCall( - getChannel().newCall(getListUsersMethod(), getCallOptions()), request, responseObserver); - } - } - - /** - */ - public static final class IdentityBlockingStub extends io.grpc.stub.AbstractBlockingStub { - private IdentityBlockingStub( - io.grpc.Channel channel, io.grpc.CallOptions callOptions) { - super(channel, callOptions); - } - - @java.lang.Override - protected IdentityBlockingStub build( - io.grpc.Channel channel, io.grpc.CallOptions callOptions) { - return new IdentityBlockingStub(channel, callOptions); - } - - /** - */ - public com.google.showcase.v1beta1.User createUser(com.google.showcase.v1beta1.CreateUserRequest request) { - return io.grpc.stub.ClientCalls.blockingUnaryCall( - getChannel(), getCreateUserMethod(), getCallOptions(), request); - } - - /** - */ - public com.google.showcase.v1beta1.User getUser(com.google.showcase.v1beta1.GetUserRequest request) { - return io.grpc.stub.ClientCalls.blockingUnaryCall( - getChannel(), getGetUserMethod(), getCallOptions(), request); - } - - /** - */ - public com.google.showcase.v1beta1.User updateUser(com.google.showcase.v1beta1.UpdateUserRequest request) { - return io.grpc.stub.ClientCalls.blockingUnaryCall( - getChannel(), getUpdateUserMethod(), getCallOptions(), request); - } - - /** - */ - public com.google.protobuf.Empty deleteUser(com.google.showcase.v1beta1.DeleteUserRequest request) { - return io.grpc.stub.ClientCalls.blockingUnaryCall( - getChannel(), getDeleteUserMethod(), getCallOptions(), request); - } - - /** - */ - public com.google.showcase.v1beta1.ListUsersResponse listUsers(com.google.showcase.v1beta1.ListUsersRequest request) { - return io.grpc.stub.ClientCalls.blockingUnaryCall( - getChannel(), getListUsersMethod(), getCallOptions(), request); - } - } - - /** - */ - public static final class IdentityFutureStub extends io.grpc.stub.AbstractFutureStub { - private IdentityFutureStub( - io.grpc.Channel channel, io.grpc.CallOptions callOptions) { - super(channel, callOptions); - } - - @java.lang.Override - protected IdentityFutureStub build( - io.grpc.Channel channel, io.grpc.CallOptions callOptions) { - return new IdentityFutureStub(channel, callOptions); - } - - /** - */ - public com.google.common.util.concurrent.ListenableFuture createUser( - com.google.showcase.v1beta1.CreateUserRequest request) { - return io.grpc.stub.ClientCalls.futureUnaryCall( - getChannel().newCall(getCreateUserMethod(), getCallOptions()), request); - } - - /** - */ - public com.google.common.util.concurrent.ListenableFuture getUser( - com.google.showcase.v1beta1.GetUserRequest request) { - return io.grpc.stub.ClientCalls.futureUnaryCall( - getChannel().newCall(getGetUserMethod(), getCallOptions()), request); - } - - /** - */ - public com.google.common.util.concurrent.ListenableFuture updateUser( - com.google.showcase.v1beta1.UpdateUserRequest request) { - return io.grpc.stub.ClientCalls.futureUnaryCall( - getChannel().newCall(getUpdateUserMethod(), getCallOptions()), request); - } - - /** - */ - public com.google.common.util.concurrent.ListenableFuture deleteUser( - com.google.showcase.v1beta1.DeleteUserRequest request) { - return io.grpc.stub.ClientCalls.futureUnaryCall( - getChannel().newCall(getDeleteUserMethod(), getCallOptions()), request); - } - - /** - */ - public com.google.common.util.concurrent.ListenableFuture listUsers( - com.google.showcase.v1beta1.ListUsersRequest request) { - return io.grpc.stub.ClientCalls.futureUnaryCall( - getChannel().newCall(getListUsersMethod(), getCallOptions()), request); - } - } - - private static final int METHODID_CREATE_USER = 0; - private static final int METHODID_GET_USER = 1; - private static final int METHODID_UPDATE_USER = 2; - private static final int METHODID_DELETE_USER = 3; - private static final int METHODID_LIST_USERS = 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 IdentityImplBase serviceImpl; - private final int methodId; - - MethodHandlers(IdentityImplBase 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_CREATE_USER: - serviceImpl.createUser((com.google.showcase.v1beta1.CreateUserRequest) request, - (io.grpc.stub.StreamObserver) responseObserver); - break; - case METHODID_GET_USER: - serviceImpl.getUser((com.google.showcase.v1beta1.GetUserRequest) request, - (io.grpc.stub.StreamObserver) responseObserver); - break; - case METHODID_UPDATE_USER: - serviceImpl.updateUser((com.google.showcase.v1beta1.UpdateUserRequest) request, - (io.grpc.stub.StreamObserver) responseObserver); - break; - case METHODID_DELETE_USER: - serviceImpl.deleteUser((com.google.showcase.v1beta1.DeleteUserRequest) request, - (io.grpc.stub.StreamObserver) responseObserver); - break; - case METHODID_LIST_USERS: - serviceImpl.listUsers((com.google.showcase.v1beta1.ListUsersRequest) request, - (io.grpc.stub.StreamObserver) responseObserver); - break; - default: - throw new AssertionError(); - } - } - - @java.lang.Override - @java.lang.SuppressWarnings("unchecked") - public io.grpc.stub.StreamObserver invoke( - io.grpc.stub.StreamObserver responseObserver) { - switch (methodId) { - default: - throw new AssertionError(); - } - } - } - - private static abstract class IdentityBaseDescriptorSupplier - implements io.grpc.protobuf.ProtoFileDescriptorSupplier, io.grpc.protobuf.ProtoServiceDescriptorSupplier { - IdentityBaseDescriptorSupplier() {} - - @java.lang.Override - public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() { - return com.google.showcase.v1beta1.IdentityOuterClass.getDescriptor(); - } - - @java.lang.Override - public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() { - return getFileDescriptor().findServiceByName("Identity"); - } - } - - private static final class IdentityFileDescriptorSupplier - extends IdentityBaseDescriptorSupplier { - IdentityFileDescriptorSupplier() {} - } - - private static final class IdentityMethodDescriptorSupplier - extends IdentityBaseDescriptorSupplier - implements io.grpc.protobuf.ProtoMethodDescriptorSupplier { - private final String methodName; - - IdentityMethodDescriptorSupplier(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 (IdentityGrpc.class) { - result = serviceDescriptor; - if (result == null) { - serviceDescriptor = result = io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME) - .setSchemaDescriptor(new IdentityFileDescriptorSupplier()) - .addMethod(getCreateUserMethod()) - .addMethod(getGetUserMethod()) - .addMethod(getUpdateUserMethod()) - .addMethod(getDeleteUserMethod()) - .addMethod(getListUsersMethod()) - .build(); - } - } - } - return result; - } -} diff --git a/showcase/grpc-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/MessagingGrpc.java b/showcase/grpc-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/MessagingGrpc.java deleted file mode 100644 index 906dfe779e..0000000000 --- a/showcase/grpc-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/MessagingGrpc.java +++ /dev/null @@ -1,1199 +0,0 @@ -package com.google.showcase.v1beta1; - -import static io.grpc.MethodDescriptor.generateFullMethodName; - -/** - */ -@javax.annotation.Generated( - value = "by gRPC proto compiler", - comments = "Source: schema/google/showcase/v1beta1/messaging.proto") -@io.grpc.stub.annotations.GrpcGenerated -public final class MessagingGrpc { - - private MessagingGrpc() {} - - public static final String SERVICE_NAME = "google.showcase.v1beta1.Messaging"; - - // Static method descriptors that strictly reflect the proto. - private static volatile io.grpc.MethodDescriptor getCreateRoomMethod; - - @io.grpc.stub.annotations.RpcMethod( - fullMethodName = SERVICE_NAME + '/' + "CreateRoom", - requestType = com.google.showcase.v1beta1.CreateRoomRequest.class, - responseType = com.google.showcase.v1beta1.Room.class, - methodType = io.grpc.MethodDescriptor.MethodType.UNARY) - public static io.grpc.MethodDescriptor getCreateRoomMethod() { - io.grpc.MethodDescriptor getCreateRoomMethod; - if ((getCreateRoomMethod = MessagingGrpc.getCreateRoomMethod) == null) { - synchronized (MessagingGrpc.class) { - if ((getCreateRoomMethod = MessagingGrpc.getCreateRoomMethod) == null) { - MessagingGrpc.getCreateRoomMethod = getCreateRoomMethod = - io.grpc.MethodDescriptor.newBuilder() - .setType(io.grpc.MethodDescriptor.MethodType.UNARY) - .setFullMethodName(generateFullMethodName(SERVICE_NAME, "CreateRoom")) - .setSampledToLocalTracing(true) - .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( - com.google.showcase.v1beta1.CreateRoomRequest.getDefaultInstance())) - .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( - com.google.showcase.v1beta1.Room.getDefaultInstance())) - .setSchemaDescriptor(new MessagingMethodDescriptorSupplier("CreateRoom")) - .build(); - } - } - } - return getCreateRoomMethod; - } - - private static volatile io.grpc.MethodDescriptor getGetRoomMethod; - - @io.grpc.stub.annotations.RpcMethod( - fullMethodName = SERVICE_NAME + '/' + "GetRoom", - requestType = com.google.showcase.v1beta1.GetRoomRequest.class, - responseType = com.google.showcase.v1beta1.Room.class, - methodType = io.grpc.MethodDescriptor.MethodType.UNARY) - public static io.grpc.MethodDescriptor getGetRoomMethod() { - io.grpc.MethodDescriptor getGetRoomMethod; - if ((getGetRoomMethod = MessagingGrpc.getGetRoomMethod) == null) { - synchronized (MessagingGrpc.class) { - if ((getGetRoomMethod = MessagingGrpc.getGetRoomMethod) == null) { - MessagingGrpc.getGetRoomMethod = getGetRoomMethod = - io.grpc.MethodDescriptor.newBuilder() - .setType(io.grpc.MethodDescriptor.MethodType.UNARY) - .setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetRoom")) - .setSampledToLocalTracing(true) - .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( - com.google.showcase.v1beta1.GetRoomRequest.getDefaultInstance())) - .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( - com.google.showcase.v1beta1.Room.getDefaultInstance())) - .setSchemaDescriptor(new MessagingMethodDescriptorSupplier("GetRoom")) - .build(); - } - } - } - return getGetRoomMethod; - } - - private static volatile io.grpc.MethodDescriptor getUpdateRoomMethod; - - @io.grpc.stub.annotations.RpcMethod( - fullMethodName = SERVICE_NAME + '/' + "UpdateRoom", - requestType = com.google.showcase.v1beta1.UpdateRoomRequest.class, - responseType = com.google.showcase.v1beta1.Room.class, - methodType = io.grpc.MethodDescriptor.MethodType.UNARY) - public static io.grpc.MethodDescriptor getUpdateRoomMethod() { - io.grpc.MethodDescriptor getUpdateRoomMethod; - if ((getUpdateRoomMethod = MessagingGrpc.getUpdateRoomMethod) == null) { - synchronized (MessagingGrpc.class) { - if ((getUpdateRoomMethod = MessagingGrpc.getUpdateRoomMethod) == null) { - MessagingGrpc.getUpdateRoomMethod = getUpdateRoomMethod = - io.grpc.MethodDescriptor.newBuilder() - .setType(io.grpc.MethodDescriptor.MethodType.UNARY) - .setFullMethodName(generateFullMethodName(SERVICE_NAME, "UpdateRoom")) - .setSampledToLocalTracing(true) - .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( - com.google.showcase.v1beta1.UpdateRoomRequest.getDefaultInstance())) - .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( - com.google.showcase.v1beta1.Room.getDefaultInstance())) - .setSchemaDescriptor(new MessagingMethodDescriptorSupplier("UpdateRoom")) - .build(); - } - } - } - return getUpdateRoomMethod; - } - - private static volatile io.grpc.MethodDescriptor getDeleteRoomMethod; - - @io.grpc.stub.annotations.RpcMethod( - fullMethodName = SERVICE_NAME + '/' + "DeleteRoom", - requestType = com.google.showcase.v1beta1.DeleteRoomRequest.class, - responseType = com.google.protobuf.Empty.class, - methodType = io.grpc.MethodDescriptor.MethodType.UNARY) - public static io.grpc.MethodDescriptor getDeleteRoomMethod() { - io.grpc.MethodDescriptor getDeleteRoomMethod; - if ((getDeleteRoomMethod = MessagingGrpc.getDeleteRoomMethod) == null) { - synchronized (MessagingGrpc.class) { - if ((getDeleteRoomMethod = MessagingGrpc.getDeleteRoomMethod) == null) { - MessagingGrpc.getDeleteRoomMethod = getDeleteRoomMethod = - io.grpc.MethodDescriptor.newBuilder() - .setType(io.grpc.MethodDescriptor.MethodType.UNARY) - .setFullMethodName(generateFullMethodName(SERVICE_NAME, "DeleteRoom")) - .setSampledToLocalTracing(true) - .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( - com.google.showcase.v1beta1.DeleteRoomRequest.getDefaultInstance())) - .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( - com.google.protobuf.Empty.getDefaultInstance())) - .setSchemaDescriptor(new MessagingMethodDescriptorSupplier("DeleteRoom")) - .build(); - } - } - } - return getDeleteRoomMethod; - } - - private static volatile io.grpc.MethodDescriptor getListRoomsMethod; - - @io.grpc.stub.annotations.RpcMethod( - fullMethodName = SERVICE_NAME + '/' + "ListRooms", - requestType = com.google.showcase.v1beta1.ListRoomsRequest.class, - responseType = com.google.showcase.v1beta1.ListRoomsResponse.class, - methodType = io.grpc.MethodDescriptor.MethodType.UNARY) - public static io.grpc.MethodDescriptor getListRoomsMethod() { - io.grpc.MethodDescriptor getListRoomsMethod; - if ((getListRoomsMethod = MessagingGrpc.getListRoomsMethod) == null) { - synchronized (MessagingGrpc.class) { - if ((getListRoomsMethod = MessagingGrpc.getListRoomsMethod) == null) { - MessagingGrpc.getListRoomsMethod = getListRoomsMethod = - io.grpc.MethodDescriptor.newBuilder() - .setType(io.grpc.MethodDescriptor.MethodType.UNARY) - .setFullMethodName(generateFullMethodName(SERVICE_NAME, "ListRooms")) - .setSampledToLocalTracing(true) - .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( - com.google.showcase.v1beta1.ListRoomsRequest.getDefaultInstance())) - .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( - com.google.showcase.v1beta1.ListRoomsResponse.getDefaultInstance())) - .setSchemaDescriptor(new MessagingMethodDescriptorSupplier("ListRooms")) - .build(); - } - } - } - return getListRoomsMethod; - } - - private static volatile io.grpc.MethodDescriptor getCreateBlurbMethod; - - @io.grpc.stub.annotations.RpcMethod( - fullMethodName = SERVICE_NAME + '/' + "CreateBlurb", - requestType = com.google.showcase.v1beta1.CreateBlurbRequest.class, - responseType = com.google.showcase.v1beta1.Blurb.class, - methodType = io.grpc.MethodDescriptor.MethodType.UNARY) - public static io.grpc.MethodDescriptor getCreateBlurbMethod() { - io.grpc.MethodDescriptor getCreateBlurbMethod; - if ((getCreateBlurbMethod = MessagingGrpc.getCreateBlurbMethod) == null) { - synchronized (MessagingGrpc.class) { - if ((getCreateBlurbMethod = MessagingGrpc.getCreateBlurbMethod) == null) { - MessagingGrpc.getCreateBlurbMethod = getCreateBlurbMethod = - io.grpc.MethodDescriptor.newBuilder() - .setType(io.grpc.MethodDescriptor.MethodType.UNARY) - .setFullMethodName(generateFullMethodName(SERVICE_NAME, "CreateBlurb")) - .setSampledToLocalTracing(true) - .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( - com.google.showcase.v1beta1.CreateBlurbRequest.getDefaultInstance())) - .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( - com.google.showcase.v1beta1.Blurb.getDefaultInstance())) - .setSchemaDescriptor(new MessagingMethodDescriptorSupplier("CreateBlurb")) - .build(); - } - } - } - return getCreateBlurbMethod; - } - - private static volatile io.grpc.MethodDescriptor getGetBlurbMethod; - - @io.grpc.stub.annotations.RpcMethod( - fullMethodName = SERVICE_NAME + '/' + "GetBlurb", - requestType = com.google.showcase.v1beta1.GetBlurbRequest.class, - responseType = com.google.showcase.v1beta1.Blurb.class, - methodType = io.grpc.MethodDescriptor.MethodType.UNARY) - public static io.grpc.MethodDescriptor getGetBlurbMethod() { - io.grpc.MethodDescriptor getGetBlurbMethod; - if ((getGetBlurbMethod = MessagingGrpc.getGetBlurbMethod) == null) { - synchronized (MessagingGrpc.class) { - if ((getGetBlurbMethod = MessagingGrpc.getGetBlurbMethod) == null) { - MessagingGrpc.getGetBlurbMethod = getGetBlurbMethod = - io.grpc.MethodDescriptor.newBuilder() - .setType(io.grpc.MethodDescriptor.MethodType.UNARY) - .setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetBlurb")) - .setSampledToLocalTracing(true) - .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( - com.google.showcase.v1beta1.GetBlurbRequest.getDefaultInstance())) - .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( - com.google.showcase.v1beta1.Blurb.getDefaultInstance())) - .setSchemaDescriptor(new MessagingMethodDescriptorSupplier("GetBlurb")) - .build(); - } - } - } - return getGetBlurbMethod; - } - - private static volatile io.grpc.MethodDescriptor getUpdateBlurbMethod; - - @io.grpc.stub.annotations.RpcMethod( - fullMethodName = SERVICE_NAME + '/' + "UpdateBlurb", - requestType = com.google.showcase.v1beta1.UpdateBlurbRequest.class, - responseType = com.google.showcase.v1beta1.Blurb.class, - methodType = io.grpc.MethodDescriptor.MethodType.UNARY) - public static io.grpc.MethodDescriptor getUpdateBlurbMethod() { - io.grpc.MethodDescriptor getUpdateBlurbMethod; - if ((getUpdateBlurbMethod = MessagingGrpc.getUpdateBlurbMethod) == null) { - synchronized (MessagingGrpc.class) { - if ((getUpdateBlurbMethod = MessagingGrpc.getUpdateBlurbMethod) == null) { - MessagingGrpc.getUpdateBlurbMethod = getUpdateBlurbMethod = - io.grpc.MethodDescriptor.newBuilder() - .setType(io.grpc.MethodDescriptor.MethodType.UNARY) - .setFullMethodName(generateFullMethodName(SERVICE_NAME, "UpdateBlurb")) - .setSampledToLocalTracing(true) - .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( - com.google.showcase.v1beta1.UpdateBlurbRequest.getDefaultInstance())) - .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( - com.google.showcase.v1beta1.Blurb.getDefaultInstance())) - .setSchemaDescriptor(new MessagingMethodDescriptorSupplier("UpdateBlurb")) - .build(); - } - } - } - return getUpdateBlurbMethod; - } - - private static volatile io.grpc.MethodDescriptor getDeleteBlurbMethod; - - @io.grpc.stub.annotations.RpcMethod( - fullMethodName = SERVICE_NAME + '/' + "DeleteBlurb", - requestType = com.google.showcase.v1beta1.DeleteBlurbRequest.class, - responseType = com.google.protobuf.Empty.class, - methodType = io.grpc.MethodDescriptor.MethodType.UNARY) - public static io.grpc.MethodDescriptor getDeleteBlurbMethod() { - io.grpc.MethodDescriptor getDeleteBlurbMethod; - if ((getDeleteBlurbMethod = MessagingGrpc.getDeleteBlurbMethod) == null) { - synchronized (MessagingGrpc.class) { - if ((getDeleteBlurbMethod = MessagingGrpc.getDeleteBlurbMethod) == null) { - MessagingGrpc.getDeleteBlurbMethod = getDeleteBlurbMethod = - io.grpc.MethodDescriptor.newBuilder() - .setType(io.grpc.MethodDescriptor.MethodType.UNARY) - .setFullMethodName(generateFullMethodName(SERVICE_NAME, "DeleteBlurb")) - .setSampledToLocalTracing(true) - .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( - com.google.showcase.v1beta1.DeleteBlurbRequest.getDefaultInstance())) - .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( - com.google.protobuf.Empty.getDefaultInstance())) - .setSchemaDescriptor(new MessagingMethodDescriptorSupplier("DeleteBlurb")) - .build(); - } - } - } - return getDeleteBlurbMethod; - } - - private static volatile io.grpc.MethodDescriptor getListBlurbsMethod; - - @io.grpc.stub.annotations.RpcMethod( - fullMethodName = SERVICE_NAME + '/' + "ListBlurbs", - requestType = com.google.showcase.v1beta1.ListBlurbsRequest.class, - responseType = com.google.showcase.v1beta1.ListBlurbsResponse.class, - methodType = io.grpc.MethodDescriptor.MethodType.UNARY) - public static io.grpc.MethodDescriptor getListBlurbsMethod() { - io.grpc.MethodDescriptor getListBlurbsMethod; - if ((getListBlurbsMethod = MessagingGrpc.getListBlurbsMethod) == null) { - synchronized (MessagingGrpc.class) { - if ((getListBlurbsMethod = MessagingGrpc.getListBlurbsMethod) == null) { - MessagingGrpc.getListBlurbsMethod = getListBlurbsMethod = - io.grpc.MethodDescriptor.newBuilder() - .setType(io.grpc.MethodDescriptor.MethodType.UNARY) - .setFullMethodName(generateFullMethodName(SERVICE_NAME, "ListBlurbs")) - .setSampledToLocalTracing(true) - .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( - com.google.showcase.v1beta1.ListBlurbsRequest.getDefaultInstance())) - .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( - com.google.showcase.v1beta1.ListBlurbsResponse.getDefaultInstance())) - .setSchemaDescriptor(new MessagingMethodDescriptorSupplier("ListBlurbs")) - .build(); - } - } - } - return getListBlurbsMethod; - } - - private static volatile io.grpc.MethodDescriptor getSearchBlurbsMethod; - - @io.grpc.stub.annotations.RpcMethod( - fullMethodName = SERVICE_NAME + '/' + "SearchBlurbs", - requestType = com.google.showcase.v1beta1.SearchBlurbsRequest.class, - responseType = com.google.longrunning.Operation.class, - methodType = io.grpc.MethodDescriptor.MethodType.UNARY) - public static io.grpc.MethodDescriptor getSearchBlurbsMethod() { - io.grpc.MethodDescriptor getSearchBlurbsMethod; - if ((getSearchBlurbsMethod = MessagingGrpc.getSearchBlurbsMethod) == null) { - synchronized (MessagingGrpc.class) { - if ((getSearchBlurbsMethod = MessagingGrpc.getSearchBlurbsMethod) == null) { - MessagingGrpc.getSearchBlurbsMethod = getSearchBlurbsMethod = - io.grpc.MethodDescriptor.newBuilder() - .setType(io.grpc.MethodDescriptor.MethodType.UNARY) - .setFullMethodName(generateFullMethodName(SERVICE_NAME, "SearchBlurbs")) - .setSampledToLocalTracing(true) - .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( - com.google.showcase.v1beta1.SearchBlurbsRequest.getDefaultInstance())) - .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( - com.google.longrunning.Operation.getDefaultInstance())) - .setSchemaDescriptor(new MessagingMethodDescriptorSupplier("SearchBlurbs")) - .build(); - } - } - } - return getSearchBlurbsMethod; - } - - private static volatile io.grpc.MethodDescriptor getStreamBlurbsMethod; - - @io.grpc.stub.annotations.RpcMethod( - fullMethodName = SERVICE_NAME + '/' + "StreamBlurbs", - requestType = com.google.showcase.v1beta1.StreamBlurbsRequest.class, - responseType = com.google.showcase.v1beta1.StreamBlurbsResponse.class, - methodType = io.grpc.MethodDescriptor.MethodType.SERVER_STREAMING) - public static io.grpc.MethodDescriptor getStreamBlurbsMethod() { - io.grpc.MethodDescriptor getStreamBlurbsMethod; - if ((getStreamBlurbsMethod = MessagingGrpc.getStreamBlurbsMethod) == null) { - synchronized (MessagingGrpc.class) { - if ((getStreamBlurbsMethod = MessagingGrpc.getStreamBlurbsMethod) == null) { - MessagingGrpc.getStreamBlurbsMethod = getStreamBlurbsMethod = - io.grpc.MethodDescriptor.newBuilder() - .setType(io.grpc.MethodDescriptor.MethodType.SERVER_STREAMING) - .setFullMethodName(generateFullMethodName(SERVICE_NAME, "StreamBlurbs")) - .setSampledToLocalTracing(true) - .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( - com.google.showcase.v1beta1.StreamBlurbsRequest.getDefaultInstance())) - .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( - com.google.showcase.v1beta1.StreamBlurbsResponse.getDefaultInstance())) - .setSchemaDescriptor(new MessagingMethodDescriptorSupplier("StreamBlurbs")) - .build(); - } - } - } - return getStreamBlurbsMethod; - } - - private static volatile io.grpc.MethodDescriptor getSendBlurbsMethod; - - @io.grpc.stub.annotations.RpcMethod( - fullMethodName = SERVICE_NAME + '/' + "SendBlurbs", - requestType = com.google.showcase.v1beta1.CreateBlurbRequest.class, - responseType = com.google.showcase.v1beta1.SendBlurbsResponse.class, - methodType = io.grpc.MethodDescriptor.MethodType.CLIENT_STREAMING) - public static io.grpc.MethodDescriptor getSendBlurbsMethod() { - io.grpc.MethodDescriptor getSendBlurbsMethod; - if ((getSendBlurbsMethod = MessagingGrpc.getSendBlurbsMethod) == null) { - synchronized (MessagingGrpc.class) { - if ((getSendBlurbsMethod = MessagingGrpc.getSendBlurbsMethod) == null) { - MessagingGrpc.getSendBlurbsMethod = getSendBlurbsMethod = - io.grpc.MethodDescriptor.newBuilder() - .setType(io.grpc.MethodDescriptor.MethodType.CLIENT_STREAMING) - .setFullMethodName(generateFullMethodName(SERVICE_NAME, "SendBlurbs")) - .setSampledToLocalTracing(true) - .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( - com.google.showcase.v1beta1.CreateBlurbRequest.getDefaultInstance())) - .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( - com.google.showcase.v1beta1.SendBlurbsResponse.getDefaultInstance())) - .setSchemaDescriptor(new MessagingMethodDescriptorSupplier("SendBlurbs")) - .build(); - } - } - } - return getSendBlurbsMethod; - } - - private static volatile io.grpc.MethodDescriptor getConnectMethod; - - @io.grpc.stub.annotations.RpcMethod( - fullMethodName = SERVICE_NAME + '/' + "Connect", - requestType = com.google.showcase.v1beta1.ConnectRequest.class, - responseType = com.google.showcase.v1beta1.StreamBlurbsResponse.class, - methodType = io.grpc.MethodDescriptor.MethodType.BIDI_STREAMING) - public static io.grpc.MethodDescriptor getConnectMethod() { - io.grpc.MethodDescriptor getConnectMethod; - if ((getConnectMethod = MessagingGrpc.getConnectMethod) == null) { - synchronized (MessagingGrpc.class) { - if ((getConnectMethod = MessagingGrpc.getConnectMethod) == null) { - MessagingGrpc.getConnectMethod = getConnectMethod = - io.grpc.MethodDescriptor.newBuilder() - .setType(io.grpc.MethodDescriptor.MethodType.BIDI_STREAMING) - .setFullMethodName(generateFullMethodName(SERVICE_NAME, "Connect")) - .setSampledToLocalTracing(true) - .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( - com.google.showcase.v1beta1.ConnectRequest.getDefaultInstance())) - .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( - com.google.showcase.v1beta1.StreamBlurbsResponse.getDefaultInstance())) - .setSchemaDescriptor(new MessagingMethodDescriptorSupplier("Connect")) - .build(); - } - } - } - return getConnectMethod; - } - - /** - * Creates a new async stub that supports all call types for the service - */ - public static MessagingStub newStub(io.grpc.Channel channel) { - io.grpc.stub.AbstractStub.StubFactory factory = - new io.grpc.stub.AbstractStub.StubFactory() { - @java.lang.Override - public MessagingStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { - return new MessagingStub(channel, callOptions); - } - }; - return MessagingStub.newStub(factory, channel); - } - - /** - * Creates a new blocking-style stub that supports unary and streaming output calls on the service - */ - public static MessagingBlockingStub newBlockingStub( - io.grpc.Channel channel) { - io.grpc.stub.AbstractStub.StubFactory factory = - new io.grpc.stub.AbstractStub.StubFactory() { - @java.lang.Override - public MessagingBlockingStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { - return new MessagingBlockingStub(channel, callOptions); - } - }; - return MessagingBlockingStub.newStub(factory, channel); - } - - /** - * Creates a new ListenableFuture-style stub that supports unary calls on the service - */ - public static MessagingFutureStub newFutureStub( - io.grpc.Channel channel) { - io.grpc.stub.AbstractStub.StubFactory factory = - new io.grpc.stub.AbstractStub.StubFactory() { - @java.lang.Override - public MessagingFutureStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { - return new MessagingFutureStub(channel, callOptions); - } - }; - return MessagingFutureStub.newStub(factory, channel); - } - - /** - */ - public static abstract class MessagingImplBase implements io.grpc.BindableService { - - /** - */ - public void createRoom(com.google.showcase.v1beta1.CreateRoomRequest request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getCreateRoomMethod(), responseObserver); - } - - /** - */ - public void getRoom(com.google.showcase.v1beta1.GetRoomRequest request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getGetRoomMethod(), responseObserver); - } - - /** - */ - public void updateRoom(com.google.showcase.v1beta1.UpdateRoomRequest request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getUpdateRoomMethod(), responseObserver); - } - - /** - */ - public void deleteRoom(com.google.showcase.v1beta1.DeleteRoomRequest request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getDeleteRoomMethod(), responseObserver); - } - - /** - */ - public void listRooms(com.google.showcase.v1beta1.ListRoomsRequest request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getListRoomsMethod(), responseObserver); - } - - /** - */ - public void createBlurb(com.google.showcase.v1beta1.CreateBlurbRequest request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getCreateBlurbMethod(), responseObserver); - } - - /** - */ - public void getBlurb(com.google.showcase.v1beta1.GetBlurbRequest request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getGetBlurbMethod(), responseObserver); - } - - /** - */ - public void updateBlurb(com.google.showcase.v1beta1.UpdateBlurbRequest request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getUpdateBlurbMethod(), responseObserver); - } - - /** - */ - public void deleteBlurb(com.google.showcase.v1beta1.DeleteBlurbRequest request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getDeleteBlurbMethod(), responseObserver); - } - - /** - */ - public void listBlurbs(com.google.showcase.v1beta1.ListBlurbsRequest request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getListBlurbsMethod(), responseObserver); - } - - /** - */ - public void searchBlurbs(com.google.showcase.v1beta1.SearchBlurbsRequest request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getSearchBlurbsMethod(), responseObserver); - } - - /** - */ - public void streamBlurbs(com.google.showcase.v1beta1.StreamBlurbsRequest request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getStreamBlurbsMethod(), responseObserver); - } - - /** - */ - public io.grpc.stub.StreamObserver sendBlurbs( - io.grpc.stub.StreamObserver responseObserver) { - return io.grpc.stub.ServerCalls.asyncUnimplementedStreamingCall(getSendBlurbsMethod(), responseObserver); - } - - /** - */ - public io.grpc.stub.StreamObserver connect( - io.grpc.stub.StreamObserver responseObserver) { - return io.grpc.stub.ServerCalls.asyncUnimplementedStreamingCall(getConnectMethod(), responseObserver); - } - - @java.lang.Override public final io.grpc.ServerServiceDefinition bindService() { - return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) - .addMethod( - getCreateRoomMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - com.google.showcase.v1beta1.CreateRoomRequest, - com.google.showcase.v1beta1.Room>( - this, METHODID_CREATE_ROOM))) - .addMethod( - getGetRoomMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - com.google.showcase.v1beta1.GetRoomRequest, - com.google.showcase.v1beta1.Room>( - this, METHODID_GET_ROOM))) - .addMethod( - getUpdateRoomMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - com.google.showcase.v1beta1.UpdateRoomRequest, - com.google.showcase.v1beta1.Room>( - this, METHODID_UPDATE_ROOM))) - .addMethod( - getDeleteRoomMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - com.google.showcase.v1beta1.DeleteRoomRequest, - com.google.protobuf.Empty>( - this, METHODID_DELETE_ROOM))) - .addMethod( - getListRoomsMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - com.google.showcase.v1beta1.ListRoomsRequest, - com.google.showcase.v1beta1.ListRoomsResponse>( - this, METHODID_LIST_ROOMS))) - .addMethod( - getCreateBlurbMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - com.google.showcase.v1beta1.CreateBlurbRequest, - com.google.showcase.v1beta1.Blurb>( - this, METHODID_CREATE_BLURB))) - .addMethod( - getGetBlurbMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - com.google.showcase.v1beta1.GetBlurbRequest, - com.google.showcase.v1beta1.Blurb>( - this, METHODID_GET_BLURB))) - .addMethod( - getUpdateBlurbMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - com.google.showcase.v1beta1.UpdateBlurbRequest, - com.google.showcase.v1beta1.Blurb>( - this, METHODID_UPDATE_BLURB))) - .addMethod( - getDeleteBlurbMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - com.google.showcase.v1beta1.DeleteBlurbRequest, - com.google.protobuf.Empty>( - this, METHODID_DELETE_BLURB))) - .addMethod( - getListBlurbsMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - com.google.showcase.v1beta1.ListBlurbsRequest, - com.google.showcase.v1beta1.ListBlurbsResponse>( - this, METHODID_LIST_BLURBS))) - .addMethod( - getSearchBlurbsMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - com.google.showcase.v1beta1.SearchBlurbsRequest, - com.google.longrunning.Operation>( - this, METHODID_SEARCH_BLURBS))) - .addMethod( - getStreamBlurbsMethod(), - io.grpc.stub.ServerCalls.asyncServerStreamingCall( - new MethodHandlers< - com.google.showcase.v1beta1.StreamBlurbsRequest, - com.google.showcase.v1beta1.StreamBlurbsResponse>( - this, METHODID_STREAM_BLURBS))) - .addMethod( - getSendBlurbsMethod(), - io.grpc.stub.ServerCalls.asyncClientStreamingCall( - new MethodHandlers< - com.google.showcase.v1beta1.CreateBlurbRequest, - com.google.showcase.v1beta1.SendBlurbsResponse>( - this, METHODID_SEND_BLURBS))) - .addMethod( - getConnectMethod(), - io.grpc.stub.ServerCalls.asyncBidiStreamingCall( - new MethodHandlers< - com.google.showcase.v1beta1.ConnectRequest, - com.google.showcase.v1beta1.StreamBlurbsResponse>( - this, METHODID_CONNECT))) - .build(); - } - } - - /** - */ - public static final class MessagingStub extends io.grpc.stub.AbstractAsyncStub { - private MessagingStub( - io.grpc.Channel channel, io.grpc.CallOptions callOptions) { - super(channel, callOptions); - } - - @java.lang.Override - protected MessagingStub build( - io.grpc.Channel channel, io.grpc.CallOptions callOptions) { - return new MessagingStub(channel, callOptions); - } - - /** - */ - public void createRoom(com.google.showcase.v1beta1.CreateRoomRequest request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ClientCalls.asyncUnaryCall( - getChannel().newCall(getCreateRoomMethod(), getCallOptions()), request, responseObserver); - } - - /** - */ - public void getRoom(com.google.showcase.v1beta1.GetRoomRequest request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ClientCalls.asyncUnaryCall( - getChannel().newCall(getGetRoomMethod(), getCallOptions()), request, responseObserver); - } - - /** - */ - public void updateRoom(com.google.showcase.v1beta1.UpdateRoomRequest request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ClientCalls.asyncUnaryCall( - getChannel().newCall(getUpdateRoomMethod(), getCallOptions()), request, responseObserver); - } - - /** - */ - public void deleteRoom(com.google.showcase.v1beta1.DeleteRoomRequest request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ClientCalls.asyncUnaryCall( - getChannel().newCall(getDeleteRoomMethod(), getCallOptions()), request, responseObserver); - } - - /** - */ - public void listRooms(com.google.showcase.v1beta1.ListRoomsRequest request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ClientCalls.asyncUnaryCall( - getChannel().newCall(getListRoomsMethod(), getCallOptions()), request, responseObserver); - } - - /** - */ - public void createBlurb(com.google.showcase.v1beta1.CreateBlurbRequest request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ClientCalls.asyncUnaryCall( - getChannel().newCall(getCreateBlurbMethod(), getCallOptions()), request, responseObserver); - } - - /** - */ - public void getBlurb(com.google.showcase.v1beta1.GetBlurbRequest request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ClientCalls.asyncUnaryCall( - getChannel().newCall(getGetBlurbMethod(), getCallOptions()), request, responseObserver); - } - - /** - */ - public void updateBlurb(com.google.showcase.v1beta1.UpdateBlurbRequest request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ClientCalls.asyncUnaryCall( - getChannel().newCall(getUpdateBlurbMethod(), getCallOptions()), request, responseObserver); - } - - /** - */ - public void deleteBlurb(com.google.showcase.v1beta1.DeleteBlurbRequest request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ClientCalls.asyncUnaryCall( - getChannel().newCall(getDeleteBlurbMethod(), getCallOptions()), request, responseObserver); - } - - /** - */ - public void listBlurbs(com.google.showcase.v1beta1.ListBlurbsRequest request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ClientCalls.asyncUnaryCall( - getChannel().newCall(getListBlurbsMethod(), getCallOptions()), request, responseObserver); - } - - /** - */ - public void searchBlurbs(com.google.showcase.v1beta1.SearchBlurbsRequest request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ClientCalls.asyncUnaryCall( - getChannel().newCall(getSearchBlurbsMethod(), getCallOptions()), request, responseObserver); - } - - /** - */ - public void streamBlurbs(com.google.showcase.v1beta1.StreamBlurbsRequest request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ClientCalls.asyncServerStreamingCall( - getChannel().newCall(getStreamBlurbsMethod(), getCallOptions()), request, responseObserver); - } - - /** - */ - public io.grpc.stub.StreamObserver sendBlurbs( - io.grpc.stub.StreamObserver responseObserver) { - return io.grpc.stub.ClientCalls.asyncClientStreamingCall( - getChannel().newCall(getSendBlurbsMethod(), getCallOptions()), responseObserver); - } - - /** - */ - public io.grpc.stub.StreamObserver connect( - io.grpc.stub.StreamObserver responseObserver) { - return io.grpc.stub.ClientCalls.asyncBidiStreamingCall( - getChannel().newCall(getConnectMethod(), getCallOptions()), responseObserver); - } - } - - /** - */ - public static final class MessagingBlockingStub extends io.grpc.stub.AbstractBlockingStub { - private MessagingBlockingStub( - io.grpc.Channel channel, io.grpc.CallOptions callOptions) { - super(channel, callOptions); - } - - @java.lang.Override - protected MessagingBlockingStub build( - io.grpc.Channel channel, io.grpc.CallOptions callOptions) { - return new MessagingBlockingStub(channel, callOptions); - } - - /** - */ - public com.google.showcase.v1beta1.Room createRoom(com.google.showcase.v1beta1.CreateRoomRequest request) { - return io.grpc.stub.ClientCalls.blockingUnaryCall( - getChannel(), getCreateRoomMethod(), getCallOptions(), request); - } - - /** - */ - public com.google.showcase.v1beta1.Room getRoom(com.google.showcase.v1beta1.GetRoomRequest request) { - return io.grpc.stub.ClientCalls.blockingUnaryCall( - getChannel(), getGetRoomMethod(), getCallOptions(), request); - } - - /** - */ - public com.google.showcase.v1beta1.Room updateRoom(com.google.showcase.v1beta1.UpdateRoomRequest request) { - return io.grpc.stub.ClientCalls.blockingUnaryCall( - getChannel(), getUpdateRoomMethod(), getCallOptions(), request); - } - - /** - */ - public com.google.protobuf.Empty deleteRoom(com.google.showcase.v1beta1.DeleteRoomRequest request) { - return io.grpc.stub.ClientCalls.blockingUnaryCall( - getChannel(), getDeleteRoomMethod(), getCallOptions(), request); - } - - /** - */ - public com.google.showcase.v1beta1.ListRoomsResponse listRooms(com.google.showcase.v1beta1.ListRoomsRequest request) { - return io.grpc.stub.ClientCalls.blockingUnaryCall( - getChannel(), getListRoomsMethod(), getCallOptions(), request); - } - - /** - */ - public com.google.showcase.v1beta1.Blurb createBlurb(com.google.showcase.v1beta1.CreateBlurbRequest request) { - return io.grpc.stub.ClientCalls.blockingUnaryCall( - getChannel(), getCreateBlurbMethod(), getCallOptions(), request); - } - - /** - */ - public com.google.showcase.v1beta1.Blurb getBlurb(com.google.showcase.v1beta1.GetBlurbRequest request) { - return io.grpc.stub.ClientCalls.blockingUnaryCall( - getChannel(), getGetBlurbMethod(), getCallOptions(), request); - } - - /** - */ - public com.google.showcase.v1beta1.Blurb updateBlurb(com.google.showcase.v1beta1.UpdateBlurbRequest request) { - return io.grpc.stub.ClientCalls.blockingUnaryCall( - getChannel(), getUpdateBlurbMethod(), getCallOptions(), request); - } - - /** - */ - public com.google.protobuf.Empty deleteBlurb(com.google.showcase.v1beta1.DeleteBlurbRequest request) { - return io.grpc.stub.ClientCalls.blockingUnaryCall( - getChannel(), getDeleteBlurbMethod(), getCallOptions(), request); - } - - /** - */ - public com.google.showcase.v1beta1.ListBlurbsResponse listBlurbs(com.google.showcase.v1beta1.ListBlurbsRequest request) { - return io.grpc.stub.ClientCalls.blockingUnaryCall( - getChannel(), getListBlurbsMethod(), getCallOptions(), request); - } - - /** - */ - public com.google.longrunning.Operation searchBlurbs(com.google.showcase.v1beta1.SearchBlurbsRequest request) { - return io.grpc.stub.ClientCalls.blockingUnaryCall( - getChannel(), getSearchBlurbsMethod(), getCallOptions(), request); - } - - /** - */ - public java.util.Iterator streamBlurbs( - com.google.showcase.v1beta1.StreamBlurbsRequest request) { - return io.grpc.stub.ClientCalls.blockingServerStreamingCall( - getChannel(), getStreamBlurbsMethod(), getCallOptions(), request); - } - } - - /** - */ - public static final class MessagingFutureStub extends io.grpc.stub.AbstractFutureStub { - private MessagingFutureStub( - io.grpc.Channel channel, io.grpc.CallOptions callOptions) { - super(channel, callOptions); - } - - @java.lang.Override - protected MessagingFutureStub build( - io.grpc.Channel channel, io.grpc.CallOptions callOptions) { - return new MessagingFutureStub(channel, callOptions); - } - - /** - */ - public com.google.common.util.concurrent.ListenableFuture createRoom( - com.google.showcase.v1beta1.CreateRoomRequest request) { - return io.grpc.stub.ClientCalls.futureUnaryCall( - getChannel().newCall(getCreateRoomMethod(), getCallOptions()), request); - } - - /** - */ - public com.google.common.util.concurrent.ListenableFuture getRoom( - com.google.showcase.v1beta1.GetRoomRequest request) { - return io.grpc.stub.ClientCalls.futureUnaryCall( - getChannel().newCall(getGetRoomMethod(), getCallOptions()), request); - } - - /** - */ - public com.google.common.util.concurrent.ListenableFuture updateRoom( - com.google.showcase.v1beta1.UpdateRoomRequest request) { - return io.grpc.stub.ClientCalls.futureUnaryCall( - getChannel().newCall(getUpdateRoomMethod(), getCallOptions()), request); - } - - /** - */ - public com.google.common.util.concurrent.ListenableFuture deleteRoom( - com.google.showcase.v1beta1.DeleteRoomRequest request) { - return io.grpc.stub.ClientCalls.futureUnaryCall( - getChannel().newCall(getDeleteRoomMethod(), getCallOptions()), request); - } - - /** - */ - public com.google.common.util.concurrent.ListenableFuture listRooms( - com.google.showcase.v1beta1.ListRoomsRequest request) { - return io.grpc.stub.ClientCalls.futureUnaryCall( - getChannel().newCall(getListRoomsMethod(), getCallOptions()), request); - } - - /** - */ - public com.google.common.util.concurrent.ListenableFuture createBlurb( - com.google.showcase.v1beta1.CreateBlurbRequest request) { - return io.grpc.stub.ClientCalls.futureUnaryCall( - getChannel().newCall(getCreateBlurbMethod(), getCallOptions()), request); - } - - /** - */ - public com.google.common.util.concurrent.ListenableFuture getBlurb( - com.google.showcase.v1beta1.GetBlurbRequest request) { - return io.grpc.stub.ClientCalls.futureUnaryCall( - getChannel().newCall(getGetBlurbMethod(), getCallOptions()), request); - } - - /** - */ - public com.google.common.util.concurrent.ListenableFuture updateBlurb( - com.google.showcase.v1beta1.UpdateBlurbRequest request) { - return io.grpc.stub.ClientCalls.futureUnaryCall( - getChannel().newCall(getUpdateBlurbMethod(), getCallOptions()), request); - } - - /** - */ - public com.google.common.util.concurrent.ListenableFuture deleteBlurb( - com.google.showcase.v1beta1.DeleteBlurbRequest request) { - return io.grpc.stub.ClientCalls.futureUnaryCall( - getChannel().newCall(getDeleteBlurbMethod(), getCallOptions()), request); - } - - /** - */ - public com.google.common.util.concurrent.ListenableFuture listBlurbs( - com.google.showcase.v1beta1.ListBlurbsRequest request) { - return io.grpc.stub.ClientCalls.futureUnaryCall( - getChannel().newCall(getListBlurbsMethod(), getCallOptions()), request); - } - - /** - */ - public com.google.common.util.concurrent.ListenableFuture searchBlurbs( - com.google.showcase.v1beta1.SearchBlurbsRequest request) { - return io.grpc.stub.ClientCalls.futureUnaryCall( - getChannel().newCall(getSearchBlurbsMethod(), getCallOptions()), request); - } - } - - private static final int METHODID_CREATE_ROOM = 0; - private static final int METHODID_GET_ROOM = 1; - private static final int METHODID_UPDATE_ROOM = 2; - private static final int METHODID_DELETE_ROOM = 3; - private static final int METHODID_LIST_ROOMS = 4; - private static final int METHODID_CREATE_BLURB = 5; - private static final int METHODID_GET_BLURB = 6; - private static final int METHODID_UPDATE_BLURB = 7; - private static final int METHODID_DELETE_BLURB = 8; - private static final int METHODID_LIST_BLURBS = 9; - private static final int METHODID_SEARCH_BLURBS = 10; - private static final int METHODID_STREAM_BLURBS = 11; - private static final int METHODID_SEND_BLURBS = 12; - private static final int METHODID_CONNECT = 13; - - 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 MessagingImplBase serviceImpl; - private final int methodId; - - MethodHandlers(MessagingImplBase 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_CREATE_ROOM: - serviceImpl.createRoom((com.google.showcase.v1beta1.CreateRoomRequest) request, - (io.grpc.stub.StreamObserver) responseObserver); - break; - case METHODID_GET_ROOM: - serviceImpl.getRoom((com.google.showcase.v1beta1.GetRoomRequest) request, - (io.grpc.stub.StreamObserver) responseObserver); - break; - case METHODID_UPDATE_ROOM: - serviceImpl.updateRoom((com.google.showcase.v1beta1.UpdateRoomRequest) request, - (io.grpc.stub.StreamObserver) responseObserver); - break; - case METHODID_DELETE_ROOM: - serviceImpl.deleteRoom((com.google.showcase.v1beta1.DeleteRoomRequest) request, - (io.grpc.stub.StreamObserver) responseObserver); - break; - case METHODID_LIST_ROOMS: - serviceImpl.listRooms((com.google.showcase.v1beta1.ListRoomsRequest) request, - (io.grpc.stub.StreamObserver) responseObserver); - break; - case METHODID_CREATE_BLURB: - serviceImpl.createBlurb((com.google.showcase.v1beta1.CreateBlurbRequest) request, - (io.grpc.stub.StreamObserver) responseObserver); - break; - case METHODID_GET_BLURB: - serviceImpl.getBlurb((com.google.showcase.v1beta1.GetBlurbRequest) request, - (io.grpc.stub.StreamObserver) responseObserver); - break; - case METHODID_UPDATE_BLURB: - serviceImpl.updateBlurb((com.google.showcase.v1beta1.UpdateBlurbRequest) request, - (io.grpc.stub.StreamObserver) responseObserver); - break; - case METHODID_DELETE_BLURB: - serviceImpl.deleteBlurb((com.google.showcase.v1beta1.DeleteBlurbRequest) request, - (io.grpc.stub.StreamObserver) responseObserver); - break; - case METHODID_LIST_BLURBS: - serviceImpl.listBlurbs((com.google.showcase.v1beta1.ListBlurbsRequest) request, - (io.grpc.stub.StreamObserver) responseObserver); - break; - case METHODID_SEARCH_BLURBS: - serviceImpl.searchBlurbs((com.google.showcase.v1beta1.SearchBlurbsRequest) request, - (io.grpc.stub.StreamObserver) responseObserver); - break; - case METHODID_STREAM_BLURBS: - serviceImpl.streamBlurbs((com.google.showcase.v1beta1.StreamBlurbsRequest) 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_SEND_BLURBS: - return (io.grpc.stub.StreamObserver) serviceImpl.sendBlurbs( - (io.grpc.stub.StreamObserver) responseObserver); - case METHODID_CONNECT: - return (io.grpc.stub.StreamObserver) serviceImpl.connect( - (io.grpc.stub.StreamObserver) responseObserver); - default: - throw new AssertionError(); - } - } - } - - private static abstract class MessagingBaseDescriptorSupplier - implements io.grpc.protobuf.ProtoFileDescriptorSupplier, io.grpc.protobuf.ProtoServiceDescriptorSupplier { - MessagingBaseDescriptorSupplier() {} - - @java.lang.Override - public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() { - return com.google.showcase.v1beta1.MessagingOuterClass.getDescriptor(); - } - - @java.lang.Override - public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() { - return getFileDescriptor().findServiceByName("Messaging"); - } - } - - private static final class MessagingFileDescriptorSupplier - extends MessagingBaseDescriptorSupplier { - MessagingFileDescriptorSupplier() {} - } - - private static final class MessagingMethodDescriptorSupplier - extends MessagingBaseDescriptorSupplier - implements io.grpc.protobuf.ProtoMethodDescriptorSupplier { - private final String methodName; - - MessagingMethodDescriptorSupplier(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 (MessagingGrpc.class) { - result = serviceDescriptor; - if (result == null) { - serviceDescriptor = result = io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME) - .setSchemaDescriptor(new MessagingFileDescriptorSupplier()) - .addMethod(getCreateRoomMethod()) - .addMethod(getGetRoomMethod()) - .addMethod(getUpdateRoomMethod()) - .addMethod(getDeleteRoomMethod()) - .addMethod(getListRoomsMethod()) - .addMethod(getCreateBlurbMethod()) - .addMethod(getGetBlurbMethod()) - .addMethod(getUpdateBlurbMethod()) - .addMethod(getDeleteBlurbMethod()) - .addMethod(getListBlurbsMethod()) - .addMethod(getSearchBlurbsMethod()) - .addMethod(getStreamBlurbsMethod()) - .addMethod(getSendBlurbsMethod()) - .addMethod(getConnectMethod()) - .build(); - } - } - } - return result; - } -} diff --git a/showcase/grpc-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/SequenceServiceGrpc.java b/showcase/grpc-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/SequenceServiceGrpc.java deleted file mode 100644 index 5c96630fef..0000000000 --- a/showcase/grpc-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/SequenceServiceGrpc.java +++ /dev/null @@ -1,424 +0,0 @@ -package com.google.showcase.v1beta1; - -import static io.grpc.MethodDescriptor.generateFullMethodName; - -/** - */ -@javax.annotation.Generated( - value = "by gRPC proto compiler", - comments = "Source: schema/google/showcase/v1beta1/sequence.proto") -@io.grpc.stub.annotations.GrpcGenerated -public final class SequenceServiceGrpc { - - private SequenceServiceGrpc() {} - - public static final String SERVICE_NAME = "google.showcase.v1beta1.SequenceService"; - - // Static method descriptors that strictly reflect the proto. - private static volatile io.grpc.MethodDescriptor getCreateSequenceMethod; - - @io.grpc.stub.annotations.RpcMethod( - fullMethodName = SERVICE_NAME + '/' + "CreateSequence", - requestType = com.google.showcase.v1beta1.CreateSequenceRequest.class, - responseType = com.google.showcase.v1beta1.Sequence.class, - methodType = io.grpc.MethodDescriptor.MethodType.UNARY) - public static io.grpc.MethodDescriptor getCreateSequenceMethod() { - io.grpc.MethodDescriptor getCreateSequenceMethod; - if ((getCreateSequenceMethod = SequenceServiceGrpc.getCreateSequenceMethod) == null) { - synchronized (SequenceServiceGrpc.class) { - if ((getCreateSequenceMethod = SequenceServiceGrpc.getCreateSequenceMethod) == null) { - SequenceServiceGrpc.getCreateSequenceMethod = getCreateSequenceMethod = - io.grpc.MethodDescriptor.newBuilder() - .setType(io.grpc.MethodDescriptor.MethodType.UNARY) - .setFullMethodName(generateFullMethodName(SERVICE_NAME, "CreateSequence")) - .setSampledToLocalTracing(true) - .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( - com.google.showcase.v1beta1.CreateSequenceRequest.getDefaultInstance())) - .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( - com.google.showcase.v1beta1.Sequence.getDefaultInstance())) - .setSchemaDescriptor(new SequenceServiceMethodDescriptorSupplier("CreateSequence")) - .build(); - } - } - } - return getCreateSequenceMethod; - } - - private static volatile io.grpc.MethodDescriptor getGetSequenceReportMethod; - - @io.grpc.stub.annotations.RpcMethod( - fullMethodName = SERVICE_NAME + '/' + "GetSequenceReport", - requestType = com.google.showcase.v1beta1.GetSequenceReportRequest.class, - responseType = com.google.showcase.v1beta1.SequenceReport.class, - methodType = io.grpc.MethodDescriptor.MethodType.UNARY) - public static io.grpc.MethodDescriptor getGetSequenceReportMethod() { - io.grpc.MethodDescriptor getGetSequenceReportMethod; - if ((getGetSequenceReportMethod = SequenceServiceGrpc.getGetSequenceReportMethod) == null) { - synchronized (SequenceServiceGrpc.class) { - if ((getGetSequenceReportMethod = SequenceServiceGrpc.getGetSequenceReportMethod) == null) { - SequenceServiceGrpc.getGetSequenceReportMethod = getGetSequenceReportMethod = - io.grpc.MethodDescriptor.newBuilder() - .setType(io.grpc.MethodDescriptor.MethodType.UNARY) - .setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetSequenceReport")) - .setSampledToLocalTracing(true) - .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( - com.google.showcase.v1beta1.GetSequenceReportRequest.getDefaultInstance())) - .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( - com.google.showcase.v1beta1.SequenceReport.getDefaultInstance())) - .setSchemaDescriptor(new SequenceServiceMethodDescriptorSupplier("GetSequenceReport")) - .build(); - } - } - } - return getGetSequenceReportMethod; - } - - private static volatile io.grpc.MethodDescriptor getAttemptSequenceMethod; - - @io.grpc.stub.annotations.RpcMethod( - fullMethodName = SERVICE_NAME + '/' + "AttemptSequence", - requestType = com.google.showcase.v1beta1.AttemptSequenceRequest.class, - responseType = com.google.protobuf.Empty.class, - methodType = io.grpc.MethodDescriptor.MethodType.UNARY) - public static io.grpc.MethodDescriptor getAttemptSequenceMethod() { - io.grpc.MethodDescriptor getAttemptSequenceMethod; - if ((getAttemptSequenceMethod = SequenceServiceGrpc.getAttemptSequenceMethod) == null) { - synchronized (SequenceServiceGrpc.class) { - if ((getAttemptSequenceMethod = SequenceServiceGrpc.getAttemptSequenceMethod) == null) { - SequenceServiceGrpc.getAttemptSequenceMethod = getAttemptSequenceMethod = - io.grpc.MethodDescriptor.newBuilder() - .setType(io.grpc.MethodDescriptor.MethodType.UNARY) - .setFullMethodName(generateFullMethodName(SERVICE_NAME, "AttemptSequence")) - .setSampledToLocalTracing(true) - .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( - com.google.showcase.v1beta1.AttemptSequenceRequest.getDefaultInstance())) - .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( - com.google.protobuf.Empty.getDefaultInstance())) - .setSchemaDescriptor(new SequenceServiceMethodDescriptorSupplier("AttemptSequence")) - .build(); - } - } - } - return getAttemptSequenceMethod; - } - - /** - * Creates a new async stub that supports all call types for the service - */ - public static SequenceServiceStub newStub(io.grpc.Channel channel) { - io.grpc.stub.AbstractStub.StubFactory factory = - new io.grpc.stub.AbstractStub.StubFactory() { - @java.lang.Override - public SequenceServiceStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { - return new SequenceServiceStub(channel, callOptions); - } - }; - return SequenceServiceStub.newStub(factory, channel); - } - - /** - * Creates a new blocking-style stub that supports unary and streaming output calls on the service - */ - public static SequenceServiceBlockingStub newBlockingStub( - io.grpc.Channel channel) { - io.grpc.stub.AbstractStub.StubFactory factory = - new io.grpc.stub.AbstractStub.StubFactory() { - @java.lang.Override - public SequenceServiceBlockingStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { - return new SequenceServiceBlockingStub(channel, callOptions); - } - }; - return SequenceServiceBlockingStub.newStub(factory, channel); - } - - /** - * Creates a new ListenableFuture-style stub that supports unary calls on the service - */ - public static SequenceServiceFutureStub newFutureStub( - io.grpc.Channel channel) { - io.grpc.stub.AbstractStub.StubFactory factory = - new io.grpc.stub.AbstractStub.StubFactory() { - @java.lang.Override - public SequenceServiceFutureStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { - return new SequenceServiceFutureStub(channel, callOptions); - } - }; - return SequenceServiceFutureStub.newStub(factory, channel); - } - - /** - */ - public static abstract class SequenceServiceImplBase implements io.grpc.BindableService { - - /** - */ - public void createSequence(com.google.showcase.v1beta1.CreateSequenceRequest request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getCreateSequenceMethod(), responseObserver); - } - - /** - */ - public void getSequenceReport(com.google.showcase.v1beta1.GetSequenceReportRequest request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getGetSequenceReportMethod(), responseObserver); - } - - /** - */ - public void attemptSequence(com.google.showcase.v1beta1.AttemptSequenceRequest request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getAttemptSequenceMethod(), responseObserver); - } - - @java.lang.Override public final io.grpc.ServerServiceDefinition bindService() { - return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) - .addMethod( - getCreateSequenceMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - com.google.showcase.v1beta1.CreateSequenceRequest, - com.google.showcase.v1beta1.Sequence>( - this, METHODID_CREATE_SEQUENCE))) - .addMethod( - getGetSequenceReportMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - com.google.showcase.v1beta1.GetSequenceReportRequest, - com.google.showcase.v1beta1.SequenceReport>( - this, METHODID_GET_SEQUENCE_REPORT))) - .addMethod( - getAttemptSequenceMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - com.google.showcase.v1beta1.AttemptSequenceRequest, - com.google.protobuf.Empty>( - this, METHODID_ATTEMPT_SEQUENCE))) - .build(); - } - } - - /** - */ - public static final class SequenceServiceStub extends io.grpc.stub.AbstractAsyncStub { - private SequenceServiceStub( - io.grpc.Channel channel, io.grpc.CallOptions callOptions) { - super(channel, callOptions); - } - - @java.lang.Override - protected SequenceServiceStub build( - io.grpc.Channel channel, io.grpc.CallOptions callOptions) { - return new SequenceServiceStub(channel, callOptions); - } - - /** - */ - public void createSequence(com.google.showcase.v1beta1.CreateSequenceRequest request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ClientCalls.asyncUnaryCall( - getChannel().newCall(getCreateSequenceMethod(), getCallOptions()), request, responseObserver); - } - - /** - */ - public void getSequenceReport(com.google.showcase.v1beta1.GetSequenceReportRequest request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ClientCalls.asyncUnaryCall( - getChannel().newCall(getGetSequenceReportMethod(), getCallOptions()), request, responseObserver); - } - - /** - */ - public void attemptSequence(com.google.showcase.v1beta1.AttemptSequenceRequest request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ClientCalls.asyncUnaryCall( - getChannel().newCall(getAttemptSequenceMethod(), getCallOptions()), request, responseObserver); - } - } - - /** - */ - public static final class SequenceServiceBlockingStub extends io.grpc.stub.AbstractBlockingStub { - private SequenceServiceBlockingStub( - io.grpc.Channel channel, io.grpc.CallOptions callOptions) { - super(channel, callOptions); - } - - @java.lang.Override - protected SequenceServiceBlockingStub build( - io.grpc.Channel channel, io.grpc.CallOptions callOptions) { - return new SequenceServiceBlockingStub(channel, callOptions); - } - - /** - */ - public com.google.showcase.v1beta1.Sequence createSequence(com.google.showcase.v1beta1.CreateSequenceRequest request) { - return io.grpc.stub.ClientCalls.blockingUnaryCall( - getChannel(), getCreateSequenceMethod(), getCallOptions(), request); - } - - /** - */ - public com.google.showcase.v1beta1.SequenceReport getSequenceReport(com.google.showcase.v1beta1.GetSequenceReportRequest request) { - return io.grpc.stub.ClientCalls.blockingUnaryCall( - getChannel(), getGetSequenceReportMethod(), getCallOptions(), request); - } - - /** - */ - public com.google.protobuf.Empty attemptSequence(com.google.showcase.v1beta1.AttemptSequenceRequest request) { - return io.grpc.stub.ClientCalls.blockingUnaryCall( - getChannel(), getAttemptSequenceMethod(), getCallOptions(), request); - } - } - - /** - */ - public static final class SequenceServiceFutureStub extends io.grpc.stub.AbstractFutureStub { - private SequenceServiceFutureStub( - io.grpc.Channel channel, io.grpc.CallOptions callOptions) { - super(channel, callOptions); - } - - @java.lang.Override - protected SequenceServiceFutureStub build( - io.grpc.Channel channel, io.grpc.CallOptions callOptions) { - return new SequenceServiceFutureStub(channel, callOptions); - } - - /** - */ - public com.google.common.util.concurrent.ListenableFuture createSequence( - com.google.showcase.v1beta1.CreateSequenceRequest request) { - return io.grpc.stub.ClientCalls.futureUnaryCall( - getChannel().newCall(getCreateSequenceMethod(), getCallOptions()), request); - } - - /** - */ - public com.google.common.util.concurrent.ListenableFuture getSequenceReport( - com.google.showcase.v1beta1.GetSequenceReportRequest request) { - return io.grpc.stub.ClientCalls.futureUnaryCall( - getChannel().newCall(getGetSequenceReportMethod(), getCallOptions()), request); - } - - /** - */ - public com.google.common.util.concurrent.ListenableFuture attemptSequence( - com.google.showcase.v1beta1.AttemptSequenceRequest request) { - return io.grpc.stub.ClientCalls.futureUnaryCall( - getChannel().newCall(getAttemptSequenceMethod(), getCallOptions()), request); - } - } - - private static final int METHODID_CREATE_SEQUENCE = 0; - private static final int METHODID_GET_SEQUENCE_REPORT = 1; - private static final int METHODID_ATTEMPT_SEQUENCE = 2; - - 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 SequenceServiceImplBase serviceImpl; - private final int methodId; - - MethodHandlers(SequenceServiceImplBase 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_CREATE_SEQUENCE: - serviceImpl.createSequence((com.google.showcase.v1beta1.CreateSequenceRequest) request, - (io.grpc.stub.StreamObserver) responseObserver); - break; - case METHODID_GET_SEQUENCE_REPORT: - serviceImpl.getSequenceReport((com.google.showcase.v1beta1.GetSequenceReportRequest) request, - (io.grpc.stub.StreamObserver) responseObserver); - break; - case METHODID_ATTEMPT_SEQUENCE: - serviceImpl.attemptSequence((com.google.showcase.v1beta1.AttemptSequenceRequest) request, - (io.grpc.stub.StreamObserver) responseObserver); - break; - default: - throw new AssertionError(); - } - } - - @java.lang.Override - @java.lang.SuppressWarnings("unchecked") - public io.grpc.stub.StreamObserver invoke( - io.grpc.stub.StreamObserver responseObserver) { - switch (methodId) { - default: - throw new AssertionError(); - } - } - } - - private static abstract class SequenceServiceBaseDescriptorSupplier - implements io.grpc.protobuf.ProtoFileDescriptorSupplier, io.grpc.protobuf.ProtoServiceDescriptorSupplier { - SequenceServiceBaseDescriptorSupplier() {} - - @java.lang.Override - public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() { - return com.google.showcase.v1beta1.SequenceOuterClass.getDescriptor(); - } - - @java.lang.Override - public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() { - return getFileDescriptor().findServiceByName("SequenceService"); - } - } - - private static final class SequenceServiceFileDescriptorSupplier - extends SequenceServiceBaseDescriptorSupplier { - SequenceServiceFileDescriptorSupplier() {} - } - - private static final class SequenceServiceMethodDescriptorSupplier - extends SequenceServiceBaseDescriptorSupplier - implements io.grpc.protobuf.ProtoMethodDescriptorSupplier { - private final String methodName; - - SequenceServiceMethodDescriptorSupplier(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 (SequenceServiceGrpc.class) { - result = serviceDescriptor; - if (result == null) { - serviceDescriptor = result = io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME) - .setSchemaDescriptor(new SequenceServiceFileDescriptorSupplier()) - .addMethod(getCreateSequenceMethod()) - .addMethod(getGetSequenceReportMethod()) - .addMethod(getAttemptSequenceMethod()) - .build(); - } - } - } - return result; - } -} diff --git a/showcase/grpc-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/TestingGrpc.java b/showcase/grpc-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/TestingGrpc.java deleted file mode 100644 index e238c85867..0000000000 --- a/showcase/grpc-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/TestingGrpc.java +++ /dev/null @@ -1,794 +0,0 @@ -package com.google.showcase.v1beta1; - -import static io.grpc.MethodDescriptor.generateFullMethodName; - -/** - */ -@javax.annotation.Generated( - value = "by gRPC proto compiler", - comments = "Source: schema/google/showcase/v1beta1/testing.proto") -@io.grpc.stub.annotations.GrpcGenerated -public final class TestingGrpc { - - private TestingGrpc() {} - - public static final String SERVICE_NAME = "google.showcase.v1beta1.Testing"; - - // Static method descriptors that strictly reflect the proto. - private static volatile io.grpc.MethodDescriptor getCreateSessionMethod; - - @io.grpc.stub.annotations.RpcMethod( - fullMethodName = SERVICE_NAME + '/' + "CreateSession", - requestType = com.google.showcase.v1beta1.CreateSessionRequest.class, - responseType = com.google.showcase.v1beta1.Session.class, - methodType = io.grpc.MethodDescriptor.MethodType.UNARY) - public static io.grpc.MethodDescriptor getCreateSessionMethod() { - io.grpc.MethodDescriptor getCreateSessionMethod; - if ((getCreateSessionMethod = TestingGrpc.getCreateSessionMethod) == null) { - synchronized (TestingGrpc.class) { - if ((getCreateSessionMethod = TestingGrpc.getCreateSessionMethod) == null) { - TestingGrpc.getCreateSessionMethod = getCreateSessionMethod = - io.grpc.MethodDescriptor.newBuilder() - .setType(io.grpc.MethodDescriptor.MethodType.UNARY) - .setFullMethodName(generateFullMethodName(SERVICE_NAME, "CreateSession")) - .setSampledToLocalTracing(true) - .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( - com.google.showcase.v1beta1.CreateSessionRequest.getDefaultInstance())) - .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( - com.google.showcase.v1beta1.Session.getDefaultInstance())) - .setSchemaDescriptor(new TestingMethodDescriptorSupplier("CreateSession")) - .build(); - } - } - } - return getCreateSessionMethod; - } - - private static volatile io.grpc.MethodDescriptor getGetSessionMethod; - - @io.grpc.stub.annotations.RpcMethod( - fullMethodName = SERVICE_NAME + '/' + "GetSession", - requestType = com.google.showcase.v1beta1.GetSessionRequest.class, - responseType = com.google.showcase.v1beta1.Session.class, - methodType = io.grpc.MethodDescriptor.MethodType.UNARY) - public static io.grpc.MethodDescriptor getGetSessionMethod() { - io.grpc.MethodDescriptor getGetSessionMethod; - if ((getGetSessionMethod = TestingGrpc.getGetSessionMethod) == null) { - synchronized (TestingGrpc.class) { - if ((getGetSessionMethod = TestingGrpc.getGetSessionMethod) == null) { - TestingGrpc.getGetSessionMethod = getGetSessionMethod = - io.grpc.MethodDescriptor.newBuilder() - .setType(io.grpc.MethodDescriptor.MethodType.UNARY) - .setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetSession")) - .setSampledToLocalTracing(true) - .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( - com.google.showcase.v1beta1.GetSessionRequest.getDefaultInstance())) - .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( - com.google.showcase.v1beta1.Session.getDefaultInstance())) - .setSchemaDescriptor(new TestingMethodDescriptorSupplier("GetSession")) - .build(); - } - } - } - return getGetSessionMethod; - } - - private static volatile io.grpc.MethodDescriptor getListSessionsMethod; - - @io.grpc.stub.annotations.RpcMethod( - fullMethodName = SERVICE_NAME + '/' + "ListSessions", - requestType = com.google.showcase.v1beta1.ListSessionsRequest.class, - responseType = com.google.showcase.v1beta1.ListSessionsResponse.class, - methodType = io.grpc.MethodDescriptor.MethodType.UNARY) - public static io.grpc.MethodDescriptor getListSessionsMethod() { - io.grpc.MethodDescriptor getListSessionsMethod; - if ((getListSessionsMethod = TestingGrpc.getListSessionsMethod) == null) { - synchronized (TestingGrpc.class) { - if ((getListSessionsMethod = TestingGrpc.getListSessionsMethod) == null) { - TestingGrpc.getListSessionsMethod = getListSessionsMethod = - io.grpc.MethodDescriptor.newBuilder() - .setType(io.grpc.MethodDescriptor.MethodType.UNARY) - .setFullMethodName(generateFullMethodName(SERVICE_NAME, "ListSessions")) - .setSampledToLocalTracing(true) - .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( - com.google.showcase.v1beta1.ListSessionsRequest.getDefaultInstance())) - .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( - com.google.showcase.v1beta1.ListSessionsResponse.getDefaultInstance())) - .setSchemaDescriptor(new TestingMethodDescriptorSupplier("ListSessions")) - .build(); - } - } - } - return getListSessionsMethod; - } - - private static volatile io.grpc.MethodDescriptor getDeleteSessionMethod; - - @io.grpc.stub.annotations.RpcMethod( - fullMethodName = SERVICE_NAME + '/' + "DeleteSession", - requestType = com.google.showcase.v1beta1.DeleteSessionRequest.class, - responseType = com.google.protobuf.Empty.class, - methodType = io.grpc.MethodDescriptor.MethodType.UNARY) - public static io.grpc.MethodDescriptor getDeleteSessionMethod() { - io.grpc.MethodDescriptor getDeleteSessionMethod; - if ((getDeleteSessionMethod = TestingGrpc.getDeleteSessionMethod) == null) { - synchronized (TestingGrpc.class) { - if ((getDeleteSessionMethod = TestingGrpc.getDeleteSessionMethod) == null) { - TestingGrpc.getDeleteSessionMethod = getDeleteSessionMethod = - io.grpc.MethodDescriptor.newBuilder() - .setType(io.grpc.MethodDescriptor.MethodType.UNARY) - .setFullMethodName(generateFullMethodName(SERVICE_NAME, "DeleteSession")) - .setSampledToLocalTracing(true) - .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( - com.google.showcase.v1beta1.DeleteSessionRequest.getDefaultInstance())) - .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( - com.google.protobuf.Empty.getDefaultInstance())) - .setSchemaDescriptor(new TestingMethodDescriptorSupplier("DeleteSession")) - .build(); - } - } - } - return getDeleteSessionMethod; - } - - private static volatile io.grpc.MethodDescriptor getReportSessionMethod; - - @io.grpc.stub.annotations.RpcMethod( - fullMethodName = SERVICE_NAME + '/' + "ReportSession", - requestType = com.google.showcase.v1beta1.ReportSessionRequest.class, - responseType = com.google.showcase.v1beta1.ReportSessionResponse.class, - methodType = io.grpc.MethodDescriptor.MethodType.UNARY) - public static io.grpc.MethodDescriptor getReportSessionMethod() { - io.grpc.MethodDescriptor getReportSessionMethod; - if ((getReportSessionMethod = TestingGrpc.getReportSessionMethod) == null) { - synchronized (TestingGrpc.class) { - if ((getReportSessionMethod = TestingGrpc.getReportSessionMethod) == null) { - TestingGrpc.getReportSessionMethod = getReportSessionMethod = - io.grpc.MethodDescriptor.newBuilder() - .setType(io.grpc.MethodDescriptor.MethodType.UNARY) - .setFullMethodName(generateFullMethodName(SERVICE_NAME, "ReportSession")) - .setSampledToLocalTracing(true) - .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( - com.google.showcase.v1beta1.ReportSessionRequest.getDefaultInstance())) - .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( - com.google.showcase.v1beta1.ReportSessionResponse.getDefaultInstance())) - .setSchemaDescriptor(new TestingMethodDescriptorSupplier("ReportSession")) - .build(); - } - } - } - return getReportSessionMethod; - } - - private static volatile io.grpc.MethodDescriptor getListTestsMethod; - - @io.grpc.stub.annotations.RpcMethod( - fullMethodName = SERVICE_NAME + '/' + "ListTests", - requestType = com.google.showcase.v1beta1.ListTestsRequest.class, - responseType = com.google.showcase.v1beta1.ListTestsResponse.class, - methodType = io.grpc.MethodDescriptor.MethodType.UNARY) - public static io.grpc.MethodDescriptor getListTestsMethod() { - io.grpc.MethodDescriptor getListTestsMethod; - if ((getListTestsMethod = TestingGrpc.getListTestsMethod) == null) { - synchronized (TestingGrpc.class) { - if ((getListTestsMethod = TestingGrpc.getListTestsMethod) == null) { - TestingGrpc.getListTestsMethod = getListTestsMethod = - io.grpc.MethodDescriptor.newBuilder() - .setType(io.grpc.MethodDescriptor.MethodType.UNARY) - .setFullMethodName(generateFullMethodName(SERVICE_NAME, "ListTests")) - .setSampledToLocalTracing(true) - .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( - com.google.showcase.v1beta1.ListTestsRequest.getDefaultInstance())) - .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( - com.google.showcase.v1beta1.ListTestsResponse.getDefaultInstance())) - .setSchemaDescriptor(new TestingMethodDescriptorSupplier("ListTests")) - .build(); - } - } - } - return getListTestsMethod; - } - - private static volatile io.grpc.MethodDescriptor getDeleteTestMethod; - - @io.grpc.stub.annotations.RpcMethod( - fullMethodName = SERVICE_NAME + '/' + "DeleteTest", - requestType = com.google.showcase.v1beta1.DeleteTestRequest.class, - responseType = com.google.protobuf.Empty.class, - methodType = io.grpc.MethodDescriptor.MethodType.UNARY) - public static io.grpc.MethodDescriptor getDeleteTestMethod() { - io.grpc.MethodDescriptor getDeleteTestMethod; - if ((getDeleteTestMethod = TestingGrpc.getDeleteTestMethod) == null) { - synchronized (TestingGrpc.class) { - if ((getDeleteTestMethod = TestingGrpc.getDeleteTestMethod) == null) { - TestingGrpc.getDeleteTestMethod = getDeleteTestMethod = - io.grpc.MethodDescriptor.newBuilder() - .setType(io.grpc.MethodDescriptor.MethodType.UNARY) - .setFullMethodName(generateFullMethodName(SERVICE_NAME, "DeleteTest")) - .setSampledToLocalTracing(true) - .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( - com.google.showcase.v1beta1.DeleteTestRequest.getDefaultInstance())) - .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( - com.google.protobuf.Empty.getDefaultInstance())) - .setSchemaDescriptor(new TestingMethodDescriptorSupplier("DeleteTest")) - .build(); - } - } - } - return getDeleteTestMethod; - } - - private static volatile io.grpc.MethodDescriptor getVerifyTestMethod; - - @io.grpc.stub.annotations.RpcMethod( - fullMethodName = SERVICE_NAME + '/' + "VerifyTest", - requestType = com.google.showcase.v1beta1.VerifyTestRequest.class, - responseType = com.google.showcase.v1beta1.VerifyTestResponse.class, - methodType = io.grpc.MethodDescriptor.MethodType.UNARY) - public static io.grpc.MethodDescriptor getVerifyTestMethod() { - io.grpc.MethodDescriptor getVerifyTestMethod; - if ((getVerifyTestMethod = TestingGrpc.getVerifyTestMethod) == null) { - synchronized (TestingGrpc.class) { - if ((getVerifyTestMethod = TestingGrpc.getVerifyTestMethod) == null) { - TestingGrpc.getVerifyTestMethod = getVerifyTestMethod = - io.grpc.MethodDescriptor.newBuilder() - .setType(io.grpc.MethodDescriptor.MethodType.UNARY) - .setFullMethodName(generateFullMethodName(SERVICE_NAME, "VerifyTest")) - .setSampledToLocalTracing(true) - .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( - com.google.showcase.v1beta1.VerifyTestRequest.getDefaultInstance())) - .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( - com.google.showcase.v1beta1.VerifyTestResponse.getDefaultInstance())) - .setSchemaDescriptor(new TestingMethodDescriptorSupplier("VerifyTest")) - .build(); - } - } - } - return getVerifyTestMethod; - } - - /** - * Creates a new async stub that supports all call types for the service - */ - public static TestingStub newStub(io.grpc.Channel channel) { - io.grpc.stub.AbstractStub.StubFactory factory = - new io.grpc.stub.AbstractStub.StubFactory() { - @java.lang.Override - public TestingStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { - return new TestingStub(channel, callOptions); - } - }; - return TestingStub.newStub(factory, channel); - } - - /** - * Creates a new blocking-style stub that supports unary and streaming output calls on the service - */ - public static TestingBlockingStub newBlockingStub( - io.grpc.Channel channel) { - io.grpc.stub.AbstractStub.StubFactory factory = - new io.grpc.stub.AbstractStub.StubFactory() { - @java.lang.Override - public TestingBlockingStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { - return new TestingBlockingStub(channel, callOptions); - } - }; - return TestingBlockingStub.newStub(factory, channel); - } - - /** - * Creates a new ListenableFuture-style stub that supports unary calls on the service - */ - public static TestingFutureStub newFutureStub( - io.grpc.Channel channel) { - io.grpc.stub.AbstractStub.StubFactory factory = - new io.grpc.stub.AbstractStub.StubFactory() { - @java.lang.Override - public TestingFutureStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { - return new TestingFutureStub(channel, callOptions); - } - }; - return TestingFutureStub.newStub(factory, channel); - } - - /** - */ - public static abstract class TestingImplBase implements io.grpc.BindableService { - - /** - */ - public void createSession(com.google.showcase.v1beta1.CreateSessionRequest request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getCreateSessionMethod(), responseObserver); - } - - /** - */ - public void getSession(com.google.showcase.v1beta1.GetSessionRequest request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getGetSessionMethod(), responseObserver); - } - - /** - */ - public void listSessions(com.google.showcase.v1beta1.ListSessionsRequest request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getListSessionsMethod(), responseObserver); - } - - /** - */ - public void deleteSession(com.google.showcase.v1beta1.DeleteSessionRequest request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getDeleteSessionMethod(), responseObserver); - } - - /** - */ - public void reportSession(com.google.showcase.v1beta1.ReportSessionRequest request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getReportSessionMethod(), responseObserver); - } - - /** - */ - public void listTests(com.google.showcase.v1beta1.ListTestsRequest request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getListTestsMethod(), responseObserver); - } - - /** - */ - public void deleteTest(com.google.showcase.v1beta1.DeleteTestRequest request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getDeleteTestMethod(), responseObserver); - } - - /** - */ - public void verifyTest(com.google.showcase.v1beta1.VerifyTestRequest request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getVerifyTestMethod(), responseObserver); - } - - @java.lang.Override public final io.grpc.ServerServiceDefinition bindService() { - return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) - .addMethod( - getCreateSessionMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - com.google.showcase.v1beta1.CreateSessionRequest, - com.google.showcase.v1beta1.Session>( - this, METHODID_CREATE_SESSION))) - .addMethod( - getGetSessionMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - com.google.showcase.v1beta1.GetSessionRequest, - com.google.showcase.v1beta1.Session>( - this, METHODID_GET_SESSION))) - .addMethod( - getListSessionsMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - com.google.showcase.v1beta1.ListSessionsRequest, - com.google.showcase.v1beta1.ListSessionsResponse>( - this, METHODID_LIST_SESSIONS))) - .addMethod( - getDeleteSessionMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - com.google.showcase.v1beta1.DeleteSessionRequest, - com.google.protobuf.Empty>( - this, METHODID_DELETE_SESSION))) - .addMethod( - getReportSessionMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - com.google.showcase.v1beta1.ReportSessionRequest, - com.google.showcase.v1beta1.ReportSessionResponse>( - this, METHODID_REPORT_SESSION))) - .addMethod( - getListTestsMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - com.google.showcase.v1beta1.ListTestsRequest, - com.google.showcase.v1beta1.ListTestsResponse>( - this, METHODID_LIST_TESTS))) - .addMethod( - getDeleteTestMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - com.google.showcase.v1beta1.DeleteTestRequest, - com.google.protobuf.Empty>( - this, METHODID_DELETE_TEST))) - .addMethod( - getVerifyTestMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - com.google.showcase.v1beta1.VerifyTestRequest, - com.google.showcase.v1beta1.VerifyTestResponse>( - this, METHODID_VERIFY_TEST))) - .build(); - } - } - - /** - */ - public static final class TestingStub extends io.grpc.stub.AbstractAsyncStub { - private TestingStub( - io.grpc.Channel channel, io.grpc.CallOptions callOptions) { - super(channel, callOptions); - } - - @java.lang.Override - protected TestingStub build( - io.grpc.Channel channel, io.grpc.CallOptions callOptions) { - return new TestingStub(channel, callOptions); - } - - /** - */ - public void createSession(com.google.showcase.v1beta1.CreateSessionRequest request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ClientCalls.asyncUnaryCall( - getChannel().newCall(getCreateSessionMethod(), getCallOptions()), request, responseObserver); - } - - /** - */ - public void getSession(com.google.showcase.v1beta1.GetSessionRequest request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ClientCalls.asyncUnaryCall( - getChannel().newCall(getGetSessionMethod(), getCallOptions()), request, responseObserver); - } - - /** - */ - public void listSessions(com.google.showcase.v1beta1.ListSessionsRequest request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ClientCalls.asyncUnaryCall( - getChannel().newCall(getListSessionsMethod(), getCallOptions()), request, responseObserver); - } - - /** - */ - public void deleteSession(com.google.showcase.v1beta1.DeleteSessionRequest request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ClientCalls.asyncUnaryCall( - getChannel().newCall(getDeleteSessionMethod(), getCallOptions()), request, responseObserver); - } - - /** - */ - public void reportSession(com.google.showcase.v1beta1.ReportSessionRequest request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ClientCalls.asyncUnaryCall( - getChannel().newCall(getReportSessionMethod(), getCallOptions()), request, responseObserver); - } - - /** - */ - public void listTests(com.google.showcase.v1beta1.ListTestsRequest request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ClientCalls.asyncUnaryCall( - getChannel().newCall(getListTestsMethod(), getCallOptions()), request, responseObserver); - } - - /** - */ - public void deleteTest(com.google.showcase.v1beta1.DeleteTestRequest request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ClientCalls.asyncUnaryCall( - getChannel().newCall(getDeleteTestMethod(), getCallOptions()), request, responseObserver); - } - - /** - */ - public void verifyTest(com.google.showcase.v1beta1.VerifyTestRequest request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ClientCalls.asyncUnaryCall( - getChannel().newCall(getVerifyTestMethod(), getCallOptions()), request, responseObserver); - } - } - - /** - */ - public static final class TestingBlockingStub extends io.grpc.stub.AbstractBlockingStub { - private TestingBlockingStub( - io.grpc.Channel channel, io.grpc.CallOptions callOptions) { - super(channel, callOptions); - } - - @java.lang.Override - protected TestingBlockingStub build( - io.grpc.Channel channel, io.grpc.CallOptions callOptions) { - return new TestingBlockingStub(channel, callOptions); - } - - /** - */ - public com.google.showcase.v1beta1.Session createSession(com.google.showcase.v1beta1.CreateSessionRequest request) { - return io.grpc.stub.ClientCalls.blockingUnaryCall( - getChannel(), getCreateSessionMethod(), getCallOptions(), request); - } - - /** - */ - public com.google.showcase.v1beta1.Session getSession(com.google.showcase.v1beta1.GetSessionRequest request) { - return io.grpc.stub.ClientCalls.blockingUnaryCall( - getChannel(), getGetSessionMethod(), getCallOptions(), request); - } - - /** - */ - public com.google.showcase.v1beta1.ListSessionsResponse listSessions(com.google.showcase.v1beta1.ListSessionsRequest request) { - return io.grpc.stub.ClientCalls.blockingUnaryCall( - getChannel(), getListSessionsMethod(), getCallOptions(), request); - } - - /** - */ - public com.google.protobuf.Empty deleteSession(com.google.showcase.v1beta1.DeleteSessionRequest request) { - return io.grpc.stub.ClientCalls.blockingUnaryCall( - getChannel(), getDeleteSessionMethod(), getCallOptions(), request); - } - - /** - */ - public com.google.showcase.v1beta1.ReportSessionResponse reportSession(com.google.showcase.v1beta1.ReportSessionRequest request) { - return io.grpc.stub.ClientCalls.blockingUnaryCall( - getChannel(), getReportSessionMethod(), getCallOptions(), request); - } - - /** - */ - public com.google.showcase.v1beta1.ListTestsResponse listTests(com.google.showcase.v1beta1.ListTestsRequest request) { - return io.grpc.stub.ClientCalls.blockingUnaryCall( - getChannel(), getListTestsMethod(), getCallOptions(), request); - } - - /** - */ - public com.google.protobuf.Empty deleteTest(com.google.showcase.v1beta1.DeleteTestRequest request) { - return io.grpc.stub.ClientCalls.blockingUnaryCall( - getChannel(), getDeleteTestMethod(), getCallOptions(), request); - } - - /** - */ - public com.google.showcase.v1beta1.VerifyTestResponse verifyTest(com.google.showcase.v1beta1.VerifyTestRequest request) { - return io.grpc.stub.ClientCalls.blockingUnaryCall( - getChannel(), getVerifyTestMethod(), getCallOptions(), request); - } - } - - /** - */ - public static final class TestingFutureStub extends io.grpc.stub.AbstractFutureStub { - private TestingFutureStub( - io.grpc.Channel channel, io.grpc.CallOptions callOptions) { - super(channel, callOptions); - } - - @java.lang.Override - protected TestingFutureStub build( - io.grpc.Channel channel, io.grpc.CallOptions callOptions) { - return new TestingFutureStub(channel, callOptions); - } - - /** - */ - public com.google.common.util.concurrent.ListenableFuture createSession( - com.google.showcase.v1beta1.CreateSessionRequest request) { - return io.grpc.stub.ClientCalls.futureUnaryCall( - getChannel().newCall(getCreateSessionMethod(), getCallOptions()), request); - } - - /** - */ - public com.google.common.util.concurrent.ListenableFuture getSession( - com.google.showcase.v1beta1.GetSessionRequest request) { - return io.grpc.stub.ClientCalls.futureUnaryCall( - getChannel().newCall(getGetSessionMethod(), getCallOptions()), request); - } - - /** - */ - public com.google.common.util.concurrent.ListenableFuture listSessions( - com.google.showcase.v1beta1.ListSessionsRequest request) { - return io.grpc.stub.ClientCalls.futureUnaryCall( - getChannel().newCall(getListSessionsMethod(), getCallOptions()), request); - } - - /** - */ - public com.google.common.util.concurrent.ListenableFuture deleteSession( - com.google.showcase.v1beta1.DeleteSessionRequest request) { - return io.grpc.stub.ClientCalls.futureUnaryCall( - getChannel().newCall(getDeleteSessionMethod(), getCallOptions()), request); - } - - /** - */ - public com.google.common.util.concurrent.ListenableFuture reportSession( - com.google.showcase.v1beta1.ReportSessionRequest request) { - return io.grpc.stub.ClientCalls.futureUnaryCall( - getChannel().newCall(getReportSessionMethod(), getCallOptions()), request); - } - - /** - */ - public com.google.common.util.concurrent.ListenableFuture listTests( - com.google.showcase.v1beta1.ListTestsRequest request) { - return io.grpc.stub.ClientCalls.futureUnaryCall( - getChannel().newCall(getListTestsMethod(), getCallOptions()), request); - } - - /** - */ - public com.google.common.util.concurrent.ListenableFuture deleteTest( - com.google.showcase.v1beta1.DeleteTestRequest request) { - return io.grpc.stub.ClientCalls.futureUnaryCall( - getChannel().newCall(getDeleteTestMethod(), getCallOptions()), request); - } - - /** - */ - public com.google.common.util.concurrent.ListenableFuture verifyTest( - com.google.showcase.v1beta1.VerifyTestRequest request) { - return io.grpc.stub.ClientCalls.futureUnaryCall( - getChannel().newCall(getVerifyTestMethod(), getCallOptions()), request); - } - } - - private static final int METHODID_CREATE_SESSION = 0; - private static final int METHODID_GET_SESSION = 1; - private static final int METHODID_LIST_SESSIONS = 2; - private static final int METHODID_DELETE_SESSION = 3; - private static final int METHODID_REPORT_SESSION = 4; - private static final int METHODID_LIST_TESTS = 5; - private static final int METHODID_DELETE_TEST = 6; - private static final int METHODID_VERIFY_TEST = 7; - - 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 TestingImplBase serviceImpl; - private final int methodId; - - MethodHandlers(TestingImplBase 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_CREATE_SESSION: - serviceImpl.createSession((com.google.showcase.v1beta1.CreateSessionRequest) request, - (io.grpc.stub.StreamObserver) responseObserver); - break; - case METHODID_GET_SESSION: - serviceImpl.getSession((com.google.showcase.v1beta1.GetSessionRequest) request, - (io.grpc.stub.StreamObserver) responseObserver); - break; - case METHODID_LIST_SESSIONS: - serviceImpl.listSessions((com.google.showcase.v1beta1.ListSessionsRequest) request, - (io.grpc.stub.StreamObserver) responseObserver); - break; - case METHODID_DELETE_SESSION: - serviceImpl.deleteSession((com.google.showcase.v1beta1.DeleteSessionRequest) request, - (io.grpc.stub.StreamObserver) responseObserver); - break; - case METHODID_REPORT_SESSION: - serviceImpl.reportSession((com.google.showcase.v1beta1.ReportSessionRequest) request, - (io.grpc.stub.StreamObserver) responseObserver); - break; - case METHODID_LIST_TESTS: - serviceImpl.listTests((com.google.showcase.v1beta1.ListTestsRequest) request, - (io.grpc.stub.StreamObserver) responseObserver); - break; - case METHODID_DELETE_TEST: - serviceImpl.deleteTest((com.google.showcase.v1beta1.DeleteTestRequest) request, - (io.grpc.stub.StreamObserver) responseObserver); - break; - case METHODID_VERIFY_TEST: - serviceImpl.verifyTest((com.google.showcase.v1beta1.VerifyTestRequest) request, - (io.grpc.stub.StreamObserver) responseObserver); - break; - default: - throw new AssertionError(); - } - } - - @java.lang.Override - @java.lang.SuppressWarnings("unchecked") - public io.grpc.stub.StreamObserver invoke( - io.grpc.stub.StreamObserver responseObserver) { - switch (methodId) { - default: - throw new AssertionError(); - } - } - } - - private static abstract class TestingBaseDescriptorSupplier - implements io.grpc.protobuf.ProtoFileDescriptorSupplier, io.grpc.protobuf.ProtoServiceDescriptorSupplier { - TestingBaseDescriptorSupplier() {} - - @java.lang.Override - public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() { - return com.google.showcase.v1beta1.TestingOuterClass.getDescriptor(); - } - - @java.lang.Override - public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() { - return getFileDescriptor().findServiceByName("Testing"); - } - } - - private static final class TestingFileDescriptorSupplier - extends TestingBaseDescriptorSupplier { - TestingFileDescriptorSupplier() {} - } - - private static final class TestingMethodDescriptorSupplier - extends TestingBaseDescriptorSupplier - implements io.grpc.protobuf.ProtoMethodDescriptorSupplier { - private final String methodName; - - TestingMethodDescriptorSupplier(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 (TestingGrpc.class) { - result = serviceDescriptor; - if (result == null) { - serviceDescriptor = result = io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME) - .setSchemaDescriptor(new TestingFileDescriptorSupplier()) - .addMethod(getCreateSessionMethod()) - .addMethod(getGetSessionMethod()) - .addMethod(getListSessionsMethod()) - .addMethod(getDeleteSessionMethod()) - .addMethod(getReportSessionMethod()) - .addMethod(getListTestsMethod()) - .addMethod(getDeleteTestMethod()) - .addMethod(getVerifyTestMethod()) - .build(); - } - } - } - return result; - } -} diff --git a/showcase/pom.xml b/showcase/pom.xml deleted file mode 100644 index 8fee74ead2..0000000000 --- a/showcase/pom.xml +++ /dev/null @@ -1,89 +0,0 @@ - - - 4.0.0 - com.google.cloud - gapic-showcase-parent - pom - 0.0.1-SNAPSHOT - GAPIC Showcase Client Core Parent - - Java idiomatic client for Google Cloud Platform services. - - - - com.google.api - gapic-generator-java-bom - 2.12.1-SNAPSHOT - ../gapic-generator-java-bom - - - - UTF-8 - UTF-8 - github - google-cloud-showcase-parent - true - true - true - true - - - - - - com.google.api.grpc - proto-gapic-showcase-v1beta1 - 0.0.1-SNAPSHOT - - - com.google.api.grpc - grpc-gapic-showcase-v1beta1 - 0.0.1-SNAPSHOT - - - com.google.cloud - gapic-showcase - 0.0.1-SNAPSHOT - - - - junit - junit - 4.13.2 - test - - - - - - gapic-showcase - grpc-gapic-showcase-v1beta1 - proto-gapic-showcase-v1beta1 - - - - - - org.apache.maven.plugins - maven-surefire-plugin - - ${skipUnitTests} - - - - org.apache.maven.plugins - maven-failsafe-plugin - - 1C - true - - - - org.codehaus.mojo - flatten-maven-plugin - - - - diff --git a/showcase/proto-gapic-showcase-v1beta1/pom.xml b/showcase/proto-gapic-showcase-v1beta1/pom.xml deleted file mode 100644 index 3202cf23bf..0000000000 --- a/showcase/proto-gapic-showcase-v1beta1/pom.xml +++ /dev/null @@ -1,104 +0,0 @@ - - 4.0.0 - com.google.api.grpc - proto-gapic-showcase-v1beta1 - 0.0.1-SNAPSHOT - proto-gapic-showcase-v1beta1 - PROTO library for proto-gapic-showcase-v1beta1 - - com.google.cloud - gapic-showcase-parent - 0.0.1-SNAPSHOT - - - - true - - - - - diff - - true - - - - - org.codehaus.mojo - exec-maven-plugin - 3.1.0 - - - verify-showcase - - exec - - test - - bazelisk - - run - //showcase:verify_proto - - - - - - - - - - update - - - - org.codehaus.mojo - exec-maven-plugin - 3.1.0 - - - verify-showcase - - exec - - generate-sources - - bazel - - run - //showcase:update_proto - - - - - - - - - - - - - com.google.protobuf - protobuf-java - - - com.google.api.grpc - proto-google-common-protos - - - com.google.api.grpc - proto-google-iam-v1 - - - com.google.api - api-common - - - com.google.guava - guava - - - diff --git a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/AttemptSequenceRequest.java b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/AttemptSequenceRequest.java deleted file mode 100644 index c3c458a4dc..0000000000 --- a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/AttemptSequenceRequest.java +++ /dev/null @@ -1,559 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: schema/google/showcase/v1beta1/sequence.proto - -package com.google.showcase.v1beta1; - -/** - * Protobuf type {@code google.showcase.v1beta1.AttemptSequenceRequest} - */ -public final class AttemptSequenceRequest extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.AttemptSequenceRequest) - AttemptSequenceRequestOrBuilder { -private static final long serialVersionUID = 0L; - // Use AttemptSequenceRequest.newBuilder() to construct. - private AttemptSequenceRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private AttemptSequenceRequest() { - name_ = ""; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new AttemptSequenceRequest(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private AttemptSequenceRequest( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: { - java.lang.String s = input.readStringRequireUtf8(); - - name_ = s; - break; - } - default: { - if (!parseUnknownField( - input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException( - e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.google.showcase.v1beta1.SequenceOuterClass.internal_static_google_showcase_v1beta1_AttemptSequenceRequest_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.showcase.v1beta1.SequenceOuterClass.internal_static_google_showcase_v1beta1_AttemptSequenceRequest_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.showcase.v1beta1.AttemptSequenceRequest.class, com.google.showcase.v1beta1.AttemptSequenceRequest.Builder.class); - } - - public static final int NAME_FIELD_NUMBER = 1; - private volatile java.lang.Object name_; - /** - * 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; - } - } - /** - * 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_); - } - unknownFields.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 += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof com.google.showcase.v1beta1.AttemptSequenceRequest)) { - return super.equals(obj); - } - com.google.showcase.v1beta1.AttemptSequenceRequest other = (com.google.showcase.v1beta1.AttemptSequenceRequest) obj; - - if (!getName() - .equals(other.getName())) return false; - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - hash = (37 * hash) + NAME_FIELD_NUMBER; - hash = (53 * hash) + getName().hashCode(); - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.showcase.v1beta1.AttemptSequenceRequest parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.showcase.v1beta1.AttemptSequenceRequest parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.showcase.v1beta1.AttemptSequenceRequest parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.showcase.v1beta1.AttemptSequenceRequest 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.showcase.v1beta1.AttemptSequenceRequest parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.showcase.v1beta1.AttemptSequenceRequest parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.showcase.v1beta1.AttemptSequenceRequest parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static com.google.showcase.v1beta1.AttemptSequenceRequest 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.showcase.v1beta1.AttemptSequenceRequest parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static com.google.showcase.v1beta1.AttemptSequenceRequest 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.showcase.v1beta1.AttemptSequenceRequest parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static com.google.showcase.v1beta1.AttemptSequenceRequest 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.showcase.v1beta1.AttemptSequenceRequest prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - @java.lang.Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - * Protobuf type {@code google.showcase.v1beta1.AttemptSequenceRequest} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.AttemptSequenceRequest) - com.google.showcase.v1beta1.AttemptSequenceRequestOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.google.showcase.v1beta1.SequenceOuterClass.internal_static_google_showcase_v1beta1_AttemptSequenceRequest_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.showcase.v1beta1.SequenceOuterClass.internal_static_google_showcase_v1beta1_AttemptSequenceRequest_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.showcase.v1beta1.AttemptSequenceRequest.class, com.google.showcase.v1beta1.AttemptSequenceRequest.Builder.class); - } - - // Construct using com.google.showcase.v1beta1.AttemptSequenceRequest.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { - } - } - @java.lang.Override - public Builder clear() { - super.clear(); - name_ = ""; - - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return com.google.showcase.v1beta1.SequenceOuterClass.internal_static_google_showcase_v1beta1_AttemptSequenceRequest_descriptor; - } - - @java.lang.Override - public com.google.showcase.v1beta1.AttemptSequenceRequest getDefaultInstanceForType() { - return com.google.showcase.v1beta1.AttemptSequenceRequest.getDefaultInstance(); - } - - @java.lang.Override - public com.google.showcase.v1beta1.AttemptSequenceRequest build() { - com.google.showcase.v1beta1.AttemptSequenceRequest result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.showcase.v1beta1.AttemptSequenceRequest buildPartial() { - com.google.showcase.v1beta1.AttemptSequenceRequest result = new com.google.showcase.v1beta1.AttemptSequenceRequest(this); - result.name_ = name_; - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.setField(field, value); - } - @java.lang.Override - public Builder clearField( - com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - @java.lang.Override - public Builder clearOneof( - com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.addRepeatedField(field, value); - } - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof com.google.showcase.v1beta1.AttemptSequenceRequest) { - return mergeFrom((com.google.showcase.v1beta1.AttemptSequenceRequest)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.showcase.v1beta1.AttemptSequenceRequest other) { - if (other == com.google.showcase.v1beta1.AttemptSequenceRequest.getDefaultInstance()) return this; - if (!other.getName().isEmpty()) { - name_ = other.name_; - onChanged(); - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - com.google.showcase.v1beta1.AttemptSequenceRequest parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (com.google.showcase.v1beta1.AttemptSequenceRequest) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private java.lang.Object name_ = ""; - /** - * 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; - } - } - /** - * 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; - } - } - /** - * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * @param value The name to set. - * @return This builder for chaining. - */ - public Builder setName( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - name_ = value; - onChanged(); - return this; - } - /** - * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * @return This builder for chaining. - */ - public Builder clearName() { - - name_ = getDefaultInstance().getName(); - onChanged(); - return this; - } - /** - * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * @param value The bytes for name to set. - * @return This builder for chaining. - */ - public Builder setNameBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - name_ = value; - onChanged(); - return this; - } - @java.lang.Override - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - - // @@protoc_insertion_point(builder_scope:google.showcase.v1beta1.AttemptSequenceRequest) - } - - // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.AttemptSequenceRequest) - private static final com.google.showcase.v1beta1.AttemptSequenceRequest DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new com.google.showcase.v1beta1.AttemptSequenceRequest(); - } - - public static com.google.showcase.v1beta1.AttemptSequenceRequest getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public AttemptSequenceRequest parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new AttemptSequenceRequest(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public com.google.showcase.v1beta1.AttemptSequenceRequest getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/AttemptSequenceRequestOrBuilder.java b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/AttemptSequenceRequestOrBuilder.java deleted file mode 100644 index 84a1590fb0..0000000000 --- a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/AttemptSequenceRequestOrBuilder.java +++ /dev/null @@ -1,21 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: schema/google/showcase/v1beta1/sequence.proto - -package com.google.showcase.v1beta1; - -public interface AttemptSequenceRequestOrBuilder extends - // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.AttemptSequenceRequest) - com.google.protobuf.MessageOrBuilder { - - /** - * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * @return The name. - */ - java.lang.String getName(); - /** - * 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/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/BlockRequest.java b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/BlockRequest.java deleted file mode 100644 index 3e4863a3be..0000000000 --- a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/BlockRequest.java +++ /dev/null @@ -1,1272 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: schema/google/showcase/v1beta1/echo.proto - -package com.google.showcase.v1beta1; - -/** - *
        - * The request for Block method.
        - * 
        - * - * Protobuf type {@code google.showcase.v1beta1.BlockRequest} - */ -public final class BlockRequest extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.BlockRequest) - BlockRequestOrBuilder { -private static final long serialVersionUID = 0L; - // Use BlockRequest.newBuilder() to construct. - private BlockRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private BlockRequest() { - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new BlockRequest(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private BlockRequest( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: { - com.google.protobuf.Duration.Builder subBuilder = null; - if (responseDelay_ != null) { - subBuilder = responseDelay_.toBuilder(); - } - responseDelay_ = input.readMessage(com.google.protobuf.Duration.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(responseDelay_); - responseDelay_ = subBuilder.buildPartial(); - } - - break; - } - case 18: { - com.google.rpc.Status.Builder subBuilder = null; - if (responseCase_ == 2) { - subBuilder = ((com.google.rpc.Status) response_).toBuilder(); - } - response_ = - input.readMessage(com.google.rpc.Status.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom((com.google.rpc.Status) response_); - response_ = subBuilder.buildPartial(); - } - responseCase_ = 2; - break; - } - case 26: { - com.google.showcase.v1beta1.BlockResponse.Builder subBuilder = null; - if (responseCase_ == 3) { - subBuilder = ((com.google.showcase.v1beta1.BlockResponse) response_).toBuilder(); - } - response_ = - input.readMessage(com.google.showcase.v1beta1.BlockResponse.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom((com.google.showcase.v1beta1.BlockResponse) response_); - response_ = subBuilder.buildPartial(); - } - responseCase_ = 3; - break; - } - default: { - if (!parseUnknownField( - input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException( - e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.google.showcase.v1beta1.EchoOuterClass.internal_static_google_showcase_v1beta1_BlockRequest_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.showcase.v1beta1.EchoOuterClass.internal_static_google_showcase_v1beta1_BlockRequest_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.showcase.v1beta1.BlockRequest.class, com.google.showcase.v1beta1.BlockRequest.Builder.class); - } - - private int responseCase_ = 0; - private java.lang.Object response_; - public enum ResponseCase - implements com.google.protobuf.Internal.EnumLite, - com.google.protobuf.AbstractMessage.InternalOneOfEnum { - ERROR(2), - SUCCESS(3), - RESPONSE_NOT_SET(0); - private final int value; - private ResponseCase(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 ResponseCase valueOf(int value) { - return forNumber(value); - } - - public static ResponseCase forNumber(int value) { - switch (value) { - case 2: return ERROR; - case 3: return SUCCESS; - case 0: return RESPONSE_NOT_SET; - default: return null; - } - } - public int getNumber() { - return this.value; - } - }; - - public ResponseCase - getResponseCase() { - return ResponseCase.forNumber( - responseCase_); - } - - public static final int RESPONSE_DELAY_FIELD_NUMBER = 1; - private com.google.protobuf.Duration responseDelay_; - /** - *
        -   * The amount of time to block before returning a response.
        -   * 
        - * - * .google.protobuf.Duration response_delay = 1; - * @return Whether the responseDelay field is set. - */ - @java.lang.Override - public boolean hasResponseDelay() { - return responseDelay_ != null; - } - /** - *
        -   * The amount of time to block before returning a response.
        -   * 
        - * - * .google.protobuf.Duration response_delay = 1; - * @return The responseDelay. - */ - @java.lang.Override - public com.google.protobuf.Duration getResponseDelay() { - return responseDelay_ == null ? com.google.protobuf.Duration.getDefaultInstance() : responseDelay_; - } - /** - *
        -   * The amount of time to block before returning a response.
        -   * 
        - * - * .google.protobuf.Duration response_delay = 1; - */ - @java.lang.Override - public com.google.protobuf.DurationOrBuilder getResponseDelayOrBuilder() { - return getResponseDelay(); - } - - public static final int ERROR_FIELD_NUMBER = 2; - /** - *
        -   * The error that will be returned by the server. If this code is specified
        -   * to be the OK rpc code, an empty response will be returned.
        -   * 
        - * - * .google.rpc.Status error = 2; - * @return Whether the error field is set. - */ - @java.lang.Override - public boolean hasError() { - return responseCase_ == 2; - } - /** - *
        -   * The error that will be returned by the server. If this code is specified
        -   * to be the OK rpc code, an empty response will be returned.
        -   * 
        - * - * .google.rpc.Status error = 2; - * @return The error. - */ - @java.lang.Override - public com.google.rpc.Status getError() { - if (responseCase_ == 2) { - return (com.google.rpc.Status) response_; - } - return com.google.rpc.Status.getDefaultInstance(); - } - /** - *
        -   * The error that will be returned by the server. If this code is specified
        -   * to be the OK rpc code, an empty response will be returned.
        -   * 
        - * - * .google.rpc.Status error = 2; - */ - @java.lang.Override - public com.google.rpc.StatusOrBuilder getErrorOrBuilder() { - if (responseCase_ == 2) { - return (com.google.rpc.Status) response_; - } - return com.google.rpc.Status.getDefaultInstance(); - } - - public static final int SUCCESS_FIELD_NUMBER = 3; - /** - *
        -   * The response to be returned that will signify successful method call.
        -   * 
        - * - * .google.showcase.v1beta1.BlockResponse success = 3; - * @return Whether the success field is set. - */ - @java.lang.Override - public boolean hasSuccess() { - return responseCase_ == 3; - } - /** - *
        -   * The response to be returned that will signify successful method call.
        -   * 
        - * - * .google.showcase.v1beta1.BlockResponse success = 3; - * @return The success. - */ - @java.lang.Override - public com.google.showcase.v1beta1.BlockResponse getSuccess() { - if (responseCase_ == 3) { - return (com.google.showcase.v1beta1.BlockResponse) response_; - } - return com.google.showcase.v1beta1.BlockResponse.getDefaultInstance(); - } - /** - *
        -   * The response to be returned that will signify successful method call.
        -   * 
        - * - * .google.showcase.v1beta1.BlockResponse success = 3; - */ - @java.lang.Override - public com.google.showcase.v1beta1.BlockResponseOrBuilder getSuccessOrBuilder() { - if (responseCase_ == 3) { - return (com.google.showcase.v1beta1.BlockResponse) response_; - } - return com.google.showcase.v1beta1.BlockResponse.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 (responseDelay_ != null) { - output.writeMessage(1, getResponseDelay()); - } - if (responseCase_ == 2) { - output.writeMessage(2, (com.google.rpc.Status) response_); - } - if (responseCase_ == 3) { - output.writeMessage(3, (com.google.showcase.v1beta1.BlockResponse) response_); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (responseDelay_ != null) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(1, getResponseDelay()); - } - if (responseCase_ == 2) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(2, (com.google.rpc.Status) response_); - } - if (responseCase_ == 3) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(3, (com.google.showcase.v1beta1.BlockResponse) response_); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof com.google.showcase.v1beta1.BlockRequest)) { - return super.equals(obj); - } - com.google.showcase.v1beta1.BlockRequest other = (com.google.showcase.v1beta1.BlockRequest) obj; - - if (hasResponseDelay() != other.hasResponseDelay()) return false; - if (hasResponseDelay()) { - if (!getResponseDelay() - .equals(other.getResponseDelay())) return false; - } - if (!getResponseCase().equals(other.getResponseCase())) return false; - switch (responseCase_) { - case 2: - if (!getError() - .equals(other.getError())) return false; - break; - case 3: - if (!getSuccess() - .equals(other.getSuccess())) return false; - break; - case 0: - default: - } - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - if (hasResponseDelay()) { - hash = (37 * hash) + RESPONSE_DELAY_FIELD_NUMBER; - hash = (53 * hash) + getResponseDelay().hashCode(); - } - switch (responseCase_) { - case 2: - hash = (37 * hash) + ERROR_FIELD_NUMBER; - hash = (53 * hash) + getError().hashCode(); - break; - case 3: - hash = (37 * hash) + SUCCESS_FIELD_NUMBER; - hash = (53 * hash) + getSuccess().hashCode(); - break; - case 0: - default: - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.showcase.v1beta1.BlockRequest parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.showcase.v1beta1.BlockRequest parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.showcase.v1beta1.BlockRequest parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.showcase.v1beta1.BlockRequest 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.showcase.v1beta1.BlockRequest parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.showcase.v1beta1.BlockRequest parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.showcase.v1beta1.BlockRequest parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static com.google.showcase.v1beta1.BlockRequest 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.showcase.v1beta1.BlockRequest parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static com.google.showcase.v1beta1.BlockRequest 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.showcase.v1beta1.BlockRequest parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static com.google.showcase.v1beta1.BlockRequest 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.showcase.v1beta1.BlockRequest 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 request for Block method.
        -   * 
        - * - * Protobuf type {@code google.showcase.v1beta1.BlockRequest} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.BlockRequest) - com.google.showcase.v1beta1.BlockRequestOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.google.showcase.v1beta1.EchoOuterClass.internal_static_google_showcase_v1beta1_BlockRequest_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.showcase.v1beta1.EchoOuterClass.internal_static_google_showcase_v1beta1_BlockRequest_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.showcase.v1beta1.BlockRequest.class, com.google.showcase.v1beta1.BlockRequest.Builder.class); - } - - // Construct using com.google.showcase.v1beta1.BlockRequest.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { - } - } - @java.lang.Override - public Builder clear() { - super.clear(); - if (responseDelayBuilder_ == null) { - responseDelay_ = null; - } else { - responseDelay_ = null; - responseDelayBuilder_ = null; - } - responseCase_ = 0; - response_ = null; - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return com.google.showcase.v1beta1.EchoOuterClass.internal_static_google_showcase_v1beta1_BlockRequest_descriptor; - } - - @java.lang.Override - public com.google.showcase.v1beta1.BlockRequest getDefaultInstanceForType() { - return com.google.showcase.v1beta1.BlockRequest.getDefaultInstance(); - } - - @java.lang.Override - public com.google.showcase.v1beta1.BlockRequest build() { - com.google.showcase.v1beta1.BlockRequest result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.showcase.v1beta1.BlockRequest buildPartial() { - com.google.showcase.v1beta1.BlockRequest result = new com.google.showcase.v1beta1.BlockRequest(this); - if (responseDelayBuilder_ == null) { - result.responseDelay_ = responseDelay_; - } else { - result.responseDelay_ = responseDelayBuilder_.build(); - } - if (responseCase_ == 2) { - if (errorBuilder_ == null) { - result.response_ = response_; - } else { - result.response_ = errorBuilder_.build(); - } - } - if (responseCase_ == 3) { - if (successBuilder_ == null) { - result.response_ = response_; - } else { - result.response_ = successBuilder_.build(); - } - } - result.responseCase_ = responseCase_; - 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.showcase.v1beta1.BlockRequest) { - return mergeFrom((com.google.showcase.v1beta1.BlockRequest)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.showcase.v1beta1.BlockRequest other) { - if (other == com.google.showcase.v1beta1.BlockRequest.getDefaultInstance()) return this; - if (other.hasResponseDelay()) { - mergeResponseDelay(other.getResponseDelay()); - } - switch (other.getResponseCase()) { - case ERROR: { - mergeError(other.getError()); - break; - } - case SUCCESS: { - mergeSuccess(other.getSuccess()); - break; - } - case RESPONSE_NOT_SET: { - break; - } - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - com.google.showcase.v1beta1.BlockRequest parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (com.google.showcase.v1beta1.BlockRequest) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - private int responseCase_ = 0; - private java.lang.Object response_; - public ResponseCase - getResponseCase() { - return ResponseCase.forNumber( - responseCase_); - } - - public Builder clearResponse() { - responseCase_ = 0; - response_ = null; - onChanged(); - return this; - } - - - private com.google.protobuf.Duration responseDelay_; - private com.google.protobuf.SingleFieldBuilderV3< - com.google.protobuf.Duration, com.google.protobuf.Duration.Builder, com.google.protobuf.DurationOrBuilder> responseDelayBuilder_; - /** - *
        -     * The amount of time to block before returning a response.
        -     * 
        - * - * .google.protobuf.Duration response_delay = 1; - * @return Whether the responseDelay field is set. - */ - public boolean hasResponseDelay() { - return responseDelayBuilder_ != null || responseDelay_ != null; - } - /** - *
        -     * The amount of time to block before returning a response.
        -     * 
        - * - * .google.protobuf.Duration response_delay = 1; - * @return The responseDelay. - */ - public com.google.protobuf.Duration getResponseDelay() { - if (responseDelayBuilder_ == null) { - return responseDelay_ == null ? com.google.protobuf.Duration.getDefaultInstance() : responseDelay_; - } else { - return responseDelayBuilder_.getMessage(); - } - } - /** - *
        -     * The amount of time to block before returning a response.
        -     * 
        - * - * .google.protobuf.Duration response_delay = 1; - */ - public Builder setResponseDelay(com.google.protobuf.Duration value) { - if (responseDelayBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - responseDelay_ = value; - onChanged(); - } else { - responseDelayBuilder_.setMessage(value); - } - - return this; - } - /** - *
        -     * The amount of time to block before returning a response.
        -     * 
        - * - * .google.protobuf.Duration response_delay = 1; - */ - public Builder setResponseDelay( - com.google.protobuf.Duration.Builder builderForValue) { - if (responseDelayBuilder_ == null) { - responseDelay_ = builderForValue.build(); - onChanged(); - } else { - responseDelayBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - *
        -     * The amount of time to block before returning a response.
        -     * 
        - * - * .google.protobuf.Duration response_delay = 1; - */ - public Builder mergeResponseDelay(com.google.protobuf.Duration value) { - if (responseDelayBuilder_ == null) { - if (responseDelay_ != null) { - responseDelay_ = - com.google.protobuf.Duration.newBuilder(responseDelay_).mergeFrom(value).buildPartial(); - } else { - responseDelay_ = value; - } - onChanged(); - } else { - responseDelayBuilder_.mergeFrom(value); - } - - return this; - } - /** - *
        -     * The amount of time to block before returning a response.
        -     * 
        - * - * .google.protobuf.Duration response_delay = 1; - */ - public Builder clearResponseDelay() { - if (responseDelayBuilder_ == null) { - responseDelay_ = null; - onChanged(); - } else { - responseDelay_ = null; - responseDelayBuilder_ = null; - } - - return this; - } - /** - *
        -     * The amount of time to block before returning a response.
        -     * 
        - * - * .google.protobuf.Duration response_delay = 1; - */ - public com.google.protobuf.Duration.Builder getResponseDelayBuilder() { - - onChanged(); - return getResponseDelayFieldBuilder().getBuilder(); - } - /** - *
        -     * The amount of time to block before returning a response.
        -     * 
        - * - * .google.protobuf.Duration response_delay = 1; - */ - public com.google.protobuf.DurationOrBuilder getResponseDelayOrBuilder() { - if (responseDelayBuilder_ != null) { - return responseDelayBuilder_.getMessageOrBuilder(); - } else { - return responseDelay_ == null ? - com.google.protobuf.Duration.getDefaultInstance() : responseDelay_; - } - } - /** - *
        -     * The amount of time to block before returning a response.
        -     * 
        - * - * .google.protobuf.Duration response_delay = 1; - */ - private com.google.protobuf.SingleFieldBuilderV3< - com.google.protobuf.Duration, com.google.protobuf.Duration.Builder, com.google.protobuf.DurationOrBuilder> - getResponseDelayFieldBuilder() { - if (responseDelayBuilder_ == null) { - responseDelayBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - com.google.protobuf.Duration, com.google.protobuf.Duration.Builder, com.google.protobuf.DurationOrBuilder>( - getResponseDelay(), - getParentForChildren(), - isClean()); - responseDelay_ = null; - } - return responseDelayBuilder_; - } - - private com.google.protobuf.SingleFieldBuilderV3< - com.google.rpc.Status, com.google.rpc.Status.Builder, com.google.rpc.StatusOrBuilder> errorBuilder_; - /** - *
        -     * The error that will be returned by the server. If this code is specified
        -     * to be the OK rpc code, an empty response will be returned.
        -     * 
        - * - * .google.rpc.Status error = 2; - * @return Whether the error field is set. - */ - @java.lang.Override - public boolean hasError() { - return responseCase_ == 2; - } - /** - *
        -     * The error that will be returned by the server. If this code is specified
        -     * to be the OK rpc code, an empty response will be returned.
        -     * 
        - * - * .google.rpc.Status error = 2; - * @return The error. - */ - @java.lang.Override - public com.google.rpc.Status getError() { - if (errorBuilder_ == null) { - if (responseCase_ == 2) { - return (com.google.rpc.Status) response_; - } - return com.google.rpc.Status.getDefaultInstance(); - } else { - if (responseCase_ == 2) { - return errorBuilder_.getMessage(); - } - return com.google.rpc.Status.getDefaultInstance(); - } - } - /** - *
        -     * The error that will be returned by the server. If this code is specified
        -     * to be the OK rpc code, an empty response will be returned.
        -     * 
        - * - * .google.rpc.Status error = 2; - */ - public Builder setError(com.google.rpc.Status value) { - if (errorBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - response_ = value; - onChanged(); - } else { - errorBuilder_.setMessage(value); - } - responseCase_ = 2; - return this; - } - /** - *
        -     * The error that will be returned by the server. If this code is specified
        -     * to be the OK rpc code, an empty response will be returned.
        -     * 
        - * - * .google.rpc.Status error = 2; - */ - public Builder setError( - com.google.rpc.Status.Builder builderForValue) { - if (errorBuilder_ == null) { - response_ = builderForValue.build(); - onChanged(); - } else { - errorBuilder_.setMessage(builderForValue.build()); - } - responseCase_ = 2; - return this; - } - /** - *
        -     * The error that will be returned by the server. If this code is specified
        -     * to be the OK rpc code, an empty response will be returned.
        -     * 
        - * - * .google.rpc.Status error = 2; - */ - public Builder mergeError(com.google.rpc.Status value) { - if (errorBuilder_ == null) { - if (responseCase_ == 2 && - response_ != com.google.rpc.Status.getDefaultInstance()) { - response_ = com.google.rpc.Status.newBuilder((com.google.rpc.Status) response_) - .mergeFrom(value).buildPartial(); - } else { - response_ = value; - } - onChanged(); - } else { - if (responseCase_ == 2) { - errorBuilder_.mergeFrom(value); - } else { - errorBuilder_.setMessage(value); - } - } - responseCase_ = 2; - return this; - } - /** - *
        -     * The error that will be returned by the server. If this code is specified
        -     * to be the OK rpc code, an empty response will be returned.
        -     * 
        - * - * .google.rpc.Status error = 2; - */ - public Builder clearError() { - if (errorBuilder_ == null) { - if (responseCase_ == 2) { - responseCase_ = 0; - response_ = null; - onChanged(); - } - } else { - if (responseCase_ == 2) { - responseCase_ = 0; - response_ = null; - } - errorBuilder_.clear(); - } - return this; - } - /** - *
        -     * The error that will be returned by the server. If this code is specified
        -     * to be the OK rpc code, an empty response will be returned.
        -     * 
        - * - * .google.rpc.Status error = 2; - */ - public com.google.rpc.Status.Builder getErrorBuilder() { - return getErrorFieldBuilder().getBuilder(); - } - /** - *
        -     * The error that will be returned by the server. If this code is specified
        -     * to be the OK rpc code, an empty response will be returned.
        -     * 
        - * - * .google.rpc.Status error = 2; - */ - @java.lang.Override - public com.google.rpc.StatusOrBuilder getErrorOrBuilder() { - if ((responseCase_ == 2) && (errorBuilder_ != null)) { - return errorBuilder_.getMessageOrBuilder(); - } else { - if (responseCase_ == 2) { - return (com.google.rpc.Status) response_; - } - return com.google.rpc.Status.getDefaultInstance(); - } - } - /** - *
        -     * The error that will be returned by the server. If this code is specified
        -     * to be the OK rpc code, an empty response will be returned.
        -     * 
        - * - * .google.rpc.Status error = 2; - */ - private com.google.protobuf.SingleFieldBuilderV3< - com.google.rpc.Status, com.google.rpc.Status.Builder, com.google.rpc.StatusOrBuilder> - getErrorFieldBuilder() { - if (errorBuilder_ == null) { - if (!(responseCase_ == 2)) { - response_ = com.google.rpc.Status.getDefaultInstance(); - } - errorBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - com.google.rpc.Status, com.google.rpc.Status.Builder, com.google.rpc.StatusOrBuilder>( - (com.google.rpc.Status) response_, - getParentForChildren(), - isClean()); - response_ = null; - } - responseCase_ = 2; - onChanged();; - return errorBuilder_; - } - - private com.google.protobuf.SingleFieldBuilderV3< - com.google.showcase.v1beta1.BlockResponse, com.google.showcase.v1beta1.BlockResponse.Builder, com.google.showcase.v1beta1.BlockResponseOrBuilder> successBuilder_; - /** - *
        -     * The response to be returned that will signify successful method call.
        -     * 
        - * - * .google.showcase.v1beta1.BlockResponse success = 3; - * @return Whether the success field is set. - */ - @java.lang.Override - public boolean hasSuccess() { - return responseCase_ == 3; - } - /** - *
        -     * The response to be returned that will signify successful method call.
        -     * 
        - * - * .google.showcase.v1beta1.BlockResponse success = 3; - * @return The success. - */ - @java.lang.Override - public com.google.showcase.v1beta1.BlockResponse getSuccess() { - if (successBuilder_ == null) { - if (responseCase_ == 3) { - return (com.google.showcase.v1beta1.BlockResponse) response_; - } - return com.google.showcase.v1beta1.BlockResponse.getDefaultInstance(); - } else { - if (responseCase_ == 3) { - return successBuilder_.getMessage(); - } - return com.google.showcase.v1beta1.BlockResponse.getDefaultInstance(); - } - } - /** - *
        -     * The response to be returned that will signify successful method call.
        -     * 
        - * - * .google.showcase.v1beta1.BlockResponse success = 3; - */ - public Builder setSuccess(com.google.showcase.v1beta1.BlockResponse value) { - if (successBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - response_ = value; - onChanged(); - } else { - successBuilder_.setMessage(value); - } - responseCase_ = 3; - return this; - } - /** - *
        -     * The response to be returned that will signify successful method call.
        -     * 
        - * - * .google.showcase.v1beta1.BlockResponse success = 3; - */ - public Builder setSuccess( - com.google.showcase.v1beta1.BlockResponse.Builder builderForValue) { - if (successBuilder_ == null) { - response_ = builderForValue.build(); - onChanged(); - } else { - successBuilder_.setMessage(builderForValue.build()); - } - responseCase_ = 3; - return this; - } - /** - *
        -     * The response to be returned that will signify successful method call.
        -     * 
        - * - * .google.showcase.v1beta1.BlockResponse success = 3; - */ - public Builder mergeSuccess(com.google.showcase.v1beta1.BlockResponse value) { - if (successBuilder_ == null) { - if (responseCase_ == 3 && - response_ != com.google.showcase.v1beta1.BlockResponse.getDefaultInstance()) { - response_ = com.google.showcase.v1beta1.BlockResponse.newBuilder((com.google.showcase.v1beta1.BlockResponse) response_) - .mergeFrom(value).buildPartial(); - } else { - response_ = value; - } - onChanged(); - } else { - if (responseCase_ == 3) { - successBuilder_.mergeFrom(value); - } else { - successBuilder_.setMessage(value); - } - } - responseCase_ = 3; - return this; - } - /** - *
        -     * The response to be returned that will signify successful method call.
        -     * 
        - * - * .google.showcase.v1beta1.BlockResponse success = 3; - */ - public Builder clearSuccess() { - if (successBuilder_ == null) { - if (responseCase_ == 3) { - responseCase_ = 0; - response_ = null; - onChanged(); - } - } else { - if (responseCase_ == 3) { - responseCase_ = 0; - response_ = null; - } - successBuilder_.clear(); - } - return this; - } - /** - *
        -     * The response to be returned that will signify successful method call.
        -     * 
        - * - * .google.showcase.v1beta1.BlockResponse success = 3; - */ - public com.google.showcase.v1beta1.BlockResponse.Builder getSuccessBuilder() { - return getSuccessFieldBuilder().getBuilder(); - } - /** - *
        -     * The response to be returned that will signify successful method call.
        -     * 
        - * - * .google.showcase.v1beta1.BlockResponse success = 3; - */ - @java.lang.Override - public com.google.showcase.v1beta1.BlockResponseOrBuilder getSuccessOrBuilder() { - if ((responseCase_ == 3) && (successBuilder_ != null)) { - return successBuilder_.getMessageOrBuilder(); - } else { - if (responseCase_ == 3) { - return (com.google.showcase.v1beta1.BlockResponse) response_; - } - return com.google.showcase.v1beta1.BlockResponse.getDefaultInstance(); - } - } - /** - *
        -     * The response to be returned that will signify successful method call.
        -     * 
        - * - * .google.showcase.v1beta1.BlockResponse success = 3; - */ - private com.google.protobuf.SingleFieldBuilderV3< - com.google.showcase.v1beta1.BlockResponse, com.google.showcase.v1beta1.BlockResponse.Builder, com.google.showcase.v1beta1.BlockResponseOrBuilder> - getSuccessFieldBuilder() { - if (successBuilder_ == null) { - if (!(responseCase_ == 3)) { - response_ = com.google.showcase.v1beta1.BlockResponse.getDefaultInstance(); - } - successBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - com.google.showcase.v1beta1.BlockResponse, com.google.showcase.v1beta1.BlockResponse.Builder, com.google.showcase.v1beta1.BlockResponseOrBuilder>( - (com.google.showcase.v1beta1.BlockResponse) response_, - getParentForChildren(), - isClean()); - response_ = null; - } - responseCase_ = 3; - onChanged();; - return successBuilder_; - } - @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.showcase.v1beta1.BlockRequest) - } - - // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.BlockRequest) - private static final com.google.showcase.v1beta1.BlockRequest DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new com.google.showcase.v1beta1.BlockRequest(); - } - - public static com.google.showcase.v1beta1.BlockRequest getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public BlockRequest parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new BlockRequest(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public com.google.showcase.v1beta1.BlockRequest getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/BlockRequestOrBuilder.java b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/BlockRequestOrBuilder.java deleted file mode 100644 index 81cce93799..0000000000 --- a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/BlockRequestOrBuilder.java +++ /dev/null @@ -1,95 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: schema/google/showcase/v1beta1/echo.proto - -package com.google.showcase.v1beta1; - -public interface BlockRequestOrBuilder extends - // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.BlockRequest) - com.google.protobuf.MessageOrBuilder { - - /** - *
        -   * The amount of time to block before returning a response.
        -   * 
        - * - * .google.protobuf.Duration response_delay = 1; - * @return Whether the responseDelay field is set. - */ - boolean hasResponseDelay(); - /** - *
        -   * The amount of time to block before returning a response.
        -   * 
        - * - * .google.protobuf.Duration response_delay = 1; - * @return The responseDelay. - */ - com.google.protobuf.Duration getResponseDelay(); - /** - *
        -   * The amount of time to block before returning a response.
        -   * 
        - * - * .google.protobuf.Duration response_delay = 1; - */ - com.google.protobuf.DurationOrBuilder getResponseDelayOrBuilder(); - - /** - *
        -   * The error that will be returned by the server. If this code is specified
        -   * to be the OK rpc code, an empty response will be returned.
        -   * 
        - * - * .google.rpc.Status error = 2; - * @return Whether the error field is set. - */ - boolean hasError(); - /** - *
        -   * The error that will be returned by the server. If this code is specified
        -   * to be the OK rpc code, an empty response will be returned.
        -   * 
        - * - * .google.rpc.Status error = 2; - * @return The error. - */ - com.google.rpc.Status getError(); - /** - *
        -   * The error that will be returned by the server. If this code is specified
        -   * to be the OK rpc code, an empty response will be returned.
        -   * 
        - * - * .google.rpc.Status error = 2; - */ - com.google.rpc.StatusOrBuilder getErrorOrBuilder(); - - /** - *
        -   * The response to be returned that will signify successful method call.
        -   * 
        - * - * .google.showcase.v1beta1.BlockResponse success = 3; - * @return Whether the success field is set. - */ - boolean hasSuccess(); - /** - *
        -   * The response to be returned that will signify successful method call.
        -   * 
        - * - * .google.showcase.v1beta1.BlockResponse success = 3; - * @return The success. - */ - com.google.showcase.v1beta1.BlockResponse getSuccess(); - /** - *
        -   * The response to be returned that will signify successful method call.
        -   * 
        - * - * .google.showcase.v1beta1.BlockResponse success = 3; - */ - com.google.showcase.v1beta1.BlockResponseOrBuilder getSuccessOrBuilder(); - - public com.google.showcase.v1beta1.BlockRequest.ResponseCase getResponseCase(); -} diff --git a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/BlockResponse.java b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/BlockResponse.java deleted file mode 100644 index 880c46c04f..0000000000 --- a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/BlockResponse.java +++ /dev/null @@ -1,602 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: schema/google/showcase/v1beta1/echo.proto - -package com.google.showcase.v1beta1; - -/** - *
        - * The response for Block method.
        - * 
        - * - * Protobuf type {@code google.showcase.v1beta1.BlockResponse} - */ -public final class BlockResponse extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.BlockResponse) - BlockResponseOrBuilder { -private static final long serialVersionUID = 0L; - // Use BlockResponse.newBuilder() to construct. - private BlockResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private BlockResponse() { - content_ = ""; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new BlockResponse(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private BlockResponse( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: { - java.lang.String s = input.readStringRequireUtf8(); - - content_ = s; - break; - } - default: { - if (!parseUnknownField( - input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException( - e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.google.showcase.v1beta1.EchoOuterClass.internal_static_google_showcase_v1beta1_BlockResponse_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.showcase.v1beta1.EchoOuterClass.internal_static_google_showcase_v1beta1_BlockResponse_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.showcase.v1beta1.BlockResponse.class, com.google.showcase.v1beta1.BlockResponse.Builder.class); - } - - public static final int CONTENT_FIELD_NUMBER = 1; - private volatile java.lang.Object content_; - /** - *
        -   * This content can contain anything, the server will not depend on a value
        -   * here.
        -   * 
        - * - * string content = 1; - * @return The content. - */ - @java.lang.Override - public java.lang.String getContent() { - java.lang.Object ref = content_; - 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(); - content_ = s; - return s; - } - } - /** - *
        -   * This content can contain anything, the server will not depend on a value
        -   * here.
        -   * 
        - * - * string content = 1; - * @return The bytes for content. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getContentBytes() { - java.lang.Object ref = content_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - content_ = 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(content_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, content_); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(content_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, content_); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof com.google.showcase.v1beta1.BlockResponse)) { - return super.equals(obj); - } - com.google.showcase.v1beta1.BlockResponse other = (com.google.showcase.v1beta1.BlockResponse) obj; - - if (!getContent() - .equals(other.getContent())) return false; - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - hash = (37 * hash) + CONTENT_FIELD_NUMBER; - hash = (53 * hash) + getContent().hashCode(); - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.showcase.v1beta1.BlockResponse parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.showcase.v1beta1.BlockResponse parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.showcase.v1beta1.BlockResponse parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.showcase.v1beta1.BlockResponse 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.showcase.v1beta1.BlockResponse parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.showcase.v1beta1.BlockResponse parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.showcase.v1beta1.BlockResponse parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static com.google.showcase.v1beta1.BlockResponse 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.showcase.v1beta1.BlockResponse parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static com.google.showcase.v1beta1.BlockResponse 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.showcase.v1beta1.BlockResponse parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static com.google.showcase.v1beta1.BlockResponse 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.showcase.v1beta1.BlockResponse 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 for Block method.
        -   * 
        - * - * Protobuf type {@code google.showcase.v1beta1.BlockResponse} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.BlockResponse) - com.google.showcase.v1beta1.BlockResponseOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.google.showcase.v1beta1.EchoOuterClass.internal_static_google_showcase_v1beta1_BlockResponse_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.showcase.v1beta1.EchoOuterClass.internal_static_google_showcase_v1beta1_BlockResponse_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.showcase.v1beta1.BlockResponse.class, com.google.showcase.v1beta1.BlockResponse.Builder.class); - } - - // Construct using com.google.showcase.v1beta1.BlockResponse.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { - } - } - @java.lang.Override - public Builder clear() { - super.clear(); - content_ = ""; - - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return com.google.showcase.v1beta1.EchoOuterClass.internal_static_google_showcase_v1beta1_BlockResponse_descriptor; - } - - @java.lang.Override - public com.google.showcase.v1beta1.BlockResponse getDefaultInstanceForType() { - return com.google.showcase.v1beta1.BlockResponse.getDefaultInstance(); - } - - @java.lang.Override - public com.google.showcase.v1beta1.BlockResponse build() { - com.google.showcase.v1beta1.BlockResponse result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.showcase.v1beta1.BlockResponse buildPartial() { - com.google.showcase.v1beta1.BlockResponse result = new com.google.showcase.v1beta1.BlockResponse(this); - result.content_ = content_; - 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.showcase.v1beta1.BlockResponse) { - return mergeFrom((com.google.showcase.v1beta1.BlockResponse)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.showcase.v1beta1.BlockResponse other) { - if (other == com.google.showcase.v1beta1.BlockResponse.getDefaultInstance()) return this; - if (!other.getContent().isEmpty()) { - content_ = other.content_; - onChanged(); - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - com.google.showcase.v1beta1.BlockResponse parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (com.google.showcase.v1beta1.BlockResponse) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private java.lang.Object content_ = ""; - /** - *
        -     * This content can contain anything, the server will not depend on a value
        -     * here.
        -     * 
        - * - * string content = 1; - * @return The content. - */ - public java.lang.String getContent() { - java.lang.Object ref = content_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - content_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - *
        -     * This content can contain anything, the server will not depend on a value
        -     * here.
        -     * 
        - * - * string content = 1; - * @return The bytes for content. - */ - public com.google.protobuf.ByteString - getContentBytes() { - java.lang.Object ref = content_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - content_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - *
        -     * This content can contain anything, the server will not depend on a value
        -     * here.
        -     * 
        - * - * string content = 1; - * @param value The content to set. - * @return This builder for chaining. - */ - public Builder setContent( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - content_ = value; - onChanged(); - return this; - } - /** - *
        -     * This content can contain anything, the server will not depend on a value
        -     * here.
        -     * 
        - * - * string content = 1; - * @return This builder for chaining. - */ - public Builder clearContent() { - - content_ = getDefaultInstance().getContent(); - onChanged(); - return this; - } - /** - *
        -     * This content can contain anything, the server will not depend on a value
        -     * here.
        -     * 
        - * - * string content = 1; - * @param value The bytes for content to set. - * @return This builder for chaining. - */ - public Builder setContentBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - content_ = value; - onChanged(); - return this; - } - @java.lang.Override - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - - // @@protoc_insertion_point(builder_scope:google.showcase.v1beta1.BlockResponse) - } - - // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.BlockResponse) - private static final com.google.showcase.v1beta1.BlockResponse DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new com.google.showcase.v1beta1.BlockResponse(); - } - - public static com.google.showcase.v1beta1.BlockResponse getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public BlockResponse parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new BlockResponse(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public com.google.showcase.v1beta1.BlockResponse getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/BlockResponseOrBuilder.java b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/BlockResponseOrBuilder.java deleted file mode 100644 index 4730394a4f..0000000000 --- a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/BlockResponseOrBuilder.java +++ /dev/null @@ -1,31 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: schema/google/showcase/v1beta1/echo.proto - -package com.google.showcase.v1beta1; - -public interface BlockResponseOrBuilder extends - // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.BlockResponse) - com.google.protobuf.MessageOrBuilder { - - /** - *
        -   * This content can contain anything, the server will not depend on a value
        -   * here.
        -   * 
        - * - * string content = 1; - * @return The content. - */ - java.lang.String getContent(); - /** - *
        -   * This content can contain anything, the server will not depend on a value
        -   * here.
        -   * 
        - * - * string content = 1; - * @return The bytes for content. - */ - com.google.protobuf.ByteString - getContentBytes(); -} diff --git a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/Blurb.java b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/Blurb.java deleted file mode 100644 index 8417d72fde..0000000000 --- a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/Blurb.java +++ /dev/null @@ -1,2177 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: schema/google/showcase/v1beta1/messaging.proto - -package com.google.showcase.v1beta1; - -/** - *
        - * This protocol buffer message represents a blurb sent to a chat room or
        - * posted on a user profile.
        - * 
        - * - * Protobuf type {@code google.showcase.v1beta1.Blurb} - */ -public final class Blurb extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.Blurb) - BlurbOrBuilder { -private static final long serialVersionUID = 0L; - // Use Blurb.newBuilder() to construct. - private Blurb(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private Blurb() { - name_ = ""; - user_ = ""; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new Blurb(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private Blurb( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: { - java.lang.String s = input.readStringRequireUtf8(); - - name_ = s; - break; - } - case 18: { - java.lang.String s = input.readStringRequireUtf8(); - - user_ = s; - break; - } - case 26: { - java.lang.String s = input.readStringRequireUtf8(); - contentCase_ = 3; - content_ = s; - break; - } - case 34: { - content_ = input.readBytes(); - contentCase_ = 4; - break; - } - case 42: { - com.google.protobuf.Timestamp.Builder subBuilder = null; - if (createTime_ != null) { - subBuilder = createTime_.toBuilder(); - } - createTime_ = input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(createTime_); - createTime_ = subBuilder.buildPartial(); - } - - break; - } - case 50: { - com.google.protobuf.Timestamp.Builder subBuilder = null; - if (updateTime_ != null) { - subBuilder = updateTime_.toBuilder(); - } - updateTime_ = input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(updateTime_); - updateTime_ = subBuilder.buildPartial(); - } - - break; - } - case 58: { - java.lang.String s = input.readStringRequireUtf8(); - legacyIdCase_ = 7; - legacyId_ = s; - break; - } - case 66: { - java.lang.String s = input.readStringRequireUtf8(); - legacyIdCase_ = 8; - legacyId_ = s; - break; - } - default: { - if (!parseUnknownField( - input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException( - e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.google.showcase.v1beta1.MessagingOuterClass.internal_static_google_showcase_v1beta1_Blurb_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.showcase.v1beta1.MessagingOuterClass.internal_static_google_showcase_v1beta1_Blurb_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.showcase.v1beta1.Blurb.class, com.google.showcase.v1beta1.Blurb.Builder.class); - } - - private int contentCase_ = 0; - private java.lang.Object content_; - public enum ContentCase - implements com.google.protobuf.Internal.EnumLite, - com.google.protobuf.AbstractMessage.InternalOneOfEnum { - TEXT(3), - IMAGE(4), - CONTENT_NOT_SET(0); - private final int value; - private ContentCase(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 ContentCase valueOf(int value) { - return forNumber(value); - } - - public static ContentCase forNumber(int value) { - switch (value) { - case 3: return TEXT; - case 4: return IMAGE; - case 0: return CONTENT_NOT_SET; - default: return null; - } - } - public int getNumber() { - return this.value; - } - }; - - public ContentCase - getContentCase() { - return ContentCase.forNumber( - contentCase_); - } - - private int legacyIdCase_ = 0; - private java.lang.Object legacyId_; - public enum LegacyIdCase - implements com.google.protobuf.Internal.EnumLite, - com.google.protobuf.AbstractMessage.InternalOneOfEnum { - LEGACY_ROOM_ID(7), - LEGACY_USER_ID(8), - LEGACYID_NOT_SET(0); - private final int value; - private LegacyIdCase(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 LegacyIdCase valueOf(int value) { - return forNumber(value); - } - - public static LegacyIdCase forNumber(int value) { - switch (value) { - case 7: return LEGACY_ROOM_ID; - case 8: return LEGACY_USER_ID; - case 0: return LEGACYID_NOT_SET; - default: return null; - } - } - public int getNumber() { - return this.value; - } - }; - - public LegacyIdCase - getLegacyIdCase() { - return LegacyIdCase.forNumber( - legacyIdCase_); - } - - public static final int NAME_FIELD_NUMBER = 1; - private volatile java.lang.Object name_; - /** - *
        -   * The resource name of the chat room.
        -   * 
        - * - * 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 chat room.
        -   * 
        - * - * 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 USER_FIELD_NUMBER = 2; - private volatile java.lang.Object user_; - /** - *
        -   * The resource name of the blurb's author.
        -   * 
        - * - * string user = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * @return The user. - */ - @java.lang.Override - public java.lang.String getUser() { - java.lang.Object ref = user_; - 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(); - user_ = s; - return s; - } - } - /** - *
        -   * The resource name of the blurb's author.
        -   * 
        - * - * string user = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * @return The bytes for user. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getUserBytes() { - java.lang.Object ref = user_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - user_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int TEXT_FIELD_NUMBER = 3; - /** - *
        -   * The textual content of this blurb.
        -   * 
        - * - * string text = 3; - * @return Whether the text field is set. - */ - public boolean hasText() { - return contentCase_ == 3; - } - /** - *
        -   * The textual content of this blurb.
        -   * 
        - * - * string text = 3; - * @return The text. - */ - public java.lang.String getText() { - java.lang.Object ref = ""; - if (contentCase_ == 3) { - ref = content_; - } - 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 (contentCase_ == 3) { - content_ = s; - } - return s; - } - } - /** - *
        -   * The textual content of this blurb.
        -   * 
        - * - * string text = 3; - * @return The bytes for text. - */ - public com.google.protobuf.ByteString - getTextBytes() { - java.lang.Object ref = ""; - if (contentCase_ == 3) { - ref = content_; - } - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - if (contentCase_ == 3) { - content_ = b; - } - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int IMAGE_FIELD_NUMBER = 4; - /** - *
        -   * The image content of this blurb.
        -   * 
        - * - * bytes image = 4; - * @return Whether the image field is set. - */ - @java.lang.Override - public boolean hasImage() { - return contentCase_ == 4; - } - /** - *
        -   * The image content of this blurb.
        -   * 
        - * - * bytes image = 4; - * @return The image. - */ - @java.lang.Override - public com.google.protobuf.ByteString getImage() { - if (contentCase_ == 4) { - return (com.google.protobuf.ByteString) content_; - } - return com.google.protobuf.ByteString.EMPTY; - } - - public static final int CREATE_TIME_FIELD_NUMBER = 5; - private com.google.protobuf.Timestamp createTime_; - /** - *
        -   * The timestamp at which the blurb was created.
        -   * 
        - * - * .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 createTime_ != null; - } - /** - *
        -   * The timestamp at which the blurb was created.
        -   * 
        - * - * .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_; - } - /** - *
        -   * The timestamp at which the blurb was created.
        -   * 
        - * - * .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - @java.lang.Override - public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { - return getCreateTime(); - } - - public static final int UPDATE_TIME_FIELD_NUMBER = 6; - private com.google.protobuf.Timestamp updateTime_; - /** - *
        -   * The latest timestamp at which the blurb was updated.
        -   * 
        - * - * .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 updateTime_ != null; - } - /** - *
        -   * The latest timestamp at which the blurb was updated.
        -   * 
        - * - * .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_; - } - /** - *
        -   * The latest timestamp at which the blurb was updated.
        -   * 
        - * - * .google.protobuf.Timestamp update_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - @java.lang.Override - public com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder() { - return getUpdateTime(); - } - - public static final int LEGACY_ROOM_ID_FIELD_NUMBER = 7; - /** - *
        -   * The legacy id of the room. This field is used to signal
        -   * the use of the compound resource pattern
        -   * `rooms/{room}/blurbs/legacy/{legacy_room}.{blurb}`
        -   * 
        - * - * string legacy_room_id = 7; - * @return Whether the legacyRoomId field is set. - */ - public boolean hasLegacyRoomId() { - return legacyIdCase_ == 7; - } - /** - *
        -   * The legacy id of the room. This field is used to signal
        -   * the use of the compound resource pattern
        -   * `rooms/{room}/blurbs/legacy/{legacy_room}.{blurb}`
        -   * 
        - * - * string legacy_room_id = 7; - * @return The legacyRoomId. - */ - public java.lang.String getLegacyRoomId() { - java.lang.Object ref = ""; - if (legacyIdCase_ == 7) { - ref = legacyId_; - } - 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 (legacyIdCase_ == 7) { - legacyId_ = s; - } - return s; - } - } - /** - *
        -   * The legacy id of the room. This field is used to signal
        -   * the use of the compound resource pattern
        -   * `rooms/{room}/blurbs/legacy/{legacy_room}.{blurb}`
        -   * 
        - * - * string legacy_room_id = 7; - * @return The bytes for legacyRoomId. - */ - public com.google.protobuf.ByteString - getLegacyRoomIdBytes() { - java.lang.Object ref = ""; - if (legacyIdCase_ == 7) { - ref = legacyId_; - } - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - if (legacyIdCase_ == 7) { - legacyId_ = b; - } - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int LEGACY_USER_ID_FIELD_NUMBER = 8; - /** - *
        -   * The legacy id of the user. This field is used to signal
        -   * the use of the compound resource pattern
        -   * `users/{user}/profile/blurbs/legacy/{legacy_user}~{blurb}`
        -   * 
        - * - * string legacy_user_id = 8; - * @return Whether the legacyUserId field is set. - */ - public boolean hasLegacyUserId() { - return legacyIdCase_ == 8; - } - /** - *
        -   * The legacy id of the user. This field is used to signal
        -   * the use of the compound resource pattern
        -   * `users/{user}/profile/blurbs/legacy/{legacy_user}~{blurb}`
        -   * 
        - * - * string legacy_user_id = 8; - * @return The legacyUserId. - */ - public java.lang.String getLegacyUserId() { - java.lang.Object ref = ""; - if (legacyIdCase_ == 8) { - ref = legacyId_; - } - 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 (legacyIdCase_ == 8) { - legacyId_ = s; - } - return s; - } - } - /** - *
        -   * The legacy id of the user. This field is used to signal
        -   * the use of the compound resource pattern
        -   * `users/{user}/profile/blurbs/legacy/{legacy_user}~{blurb}`
        -   * 
        - * - * string legacy_user_id = 8; - * @return The bytes for legacyUserId. - */ - public com.google.protobuf.ByteString - getLegacyUserIdBytes() { - java.lang.Object ref = ""; - if (legacyIdCase_ == 8) { - ref = legacyId_; - } - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - if (legacyIdCase_ == 8) { - legacyId_ = 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(user_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 2, user_); - } - if (contentCase_ == 3) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 3, content_); - } - if (contentCase_ == 4) { - output.writeBytes( - 4, (com.google.protobuf.ByteString) content_); - } - if (createTime_ != null) { - output.writeMessage(5, getCreateTime()); - } - if (updateTime_ != null) { - output.writeMessage(6, getUpdateTime()); - } - if (legacyIdCase_ == 7) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 7, legacyId_); - } - if (legacyIdCase_ == 8) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 8, legacyId_); - } - unknownFields.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(user_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, user_); - } - if (contentCase_ == 3) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, content_); - } - if (contentCase_ == 4) { - size += com.google.protobuf.CodedOutputStream - .computeBytesSize( - 4, (com.google.protobuf.ByteString) content_); - } - if (createTime_ != null) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(5, getCreateTime()); - } - if (updateTime_ != null) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(6, getUpdateTime()); - } - if (legacyIdCase_ == 7) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(7, legacyId_); - } - if (legacyIdCase_ == 8) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(8, legacyId_); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof com.google.showcase.v1beta1.Blurb)) { - return super.equals(obj); - } - com.google.showcase.v1beta1.Blurb other = (com.google.showcase.v1beta1.Blurb) obj; - - if (!getName() - .equals(other.getName())) return false; - if (!getUser() - .equals(other.getUser())) 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 (!getContentCase().equals(other.getContentCase())) return false; - switch (contentCase_) { - case 3: - if (!getText() - .equals(other.getText())) return false; - break; - case 4: - if (!getImage() - .equals(other.getImage())) return false; - break; - case 0: - default: - } - if (!getLegacyIdCase().equals(other.getLegacyIdCase())) return false; - switch (legacyIdCase_) { - case 7: - if (!getLegacyRoomId() - .equals(other.getLegacyRoomId())) return false; - break; - case 8: - if (!getLegacyUserId() - .equals(other.getLegacyUserId())) return false; - break; - case 0: - default: - } - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - hash = (37 * hash) + NAME_FIELD_NUMBER; - hash = (53 * hash) + getName().hashCode(); - hash = (37 * hash) + USER_FIELD_NUMBER; - hash = (53 * hash) + getUser().hashCode(); - if (hasCreateTime()) { - hash = (37 * hash) + CREATE_TIME_FIELD_NUMBER; - hash = (53 * hash) + getCreateTime().hashCode(); - } - if (hasUpdateTime()) { - hash = (37 * hash) + UPDATE_TIME_FIELD_NUMBER; - hash = (53 * hash) + getUpdateTime().hashCode(); - } - switch (contentCase_) { - case 3: - hash = (37 * hash) + TEXT_FIELD_NUMBER; - hash = (53 * hash) + getText().hashCode(); - break; - case 4: - hash = (37 * hash) + IMAGE_FIELD_NUMBER; - hash = (53 * hash) + getImage().hashCode(); - break; - case 0: - default: - } - switch (legacyIdCase_) { - case 7: - hash = (37 * hash) + LEGACY_ROOM_ID_FIELD_NUMBER; - hash = (53 * hash) + getLegacyRoomId().hashCode(); - break; - case 8: - hash = (37 * hash) + LEGACY_USER_ID_FIELD_NUMBER; - hash = (53 * hash) + getLegacyUserId().hashCode(); - break; - case 0: - default: - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.showcase.v1beta1.Blurb parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.showcase.v1beta1.Blurb parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.showcase.v1beta1.Blurb parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.showcase.v1beta1.Blurb 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.showcase.v1beta1.Blurb parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.showcase.v1beta1.Blurb parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.showcase.v1beta1.Blurb parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static com.google.showcase.v1beta1.Blurb 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.showcase.v1beta1.Blurb parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static com.google.showcase.v1beta1.Blurb 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.showcase.v1beta1.Blurb parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static com.google.showcase.v1beta1.Blurb 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.showcase.v1beta1.Blurb 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; - } - /** - *
        -   * This protocol buffer message represents a blurb sent to a chat room or
        -   * posted on a user profile.
        -   * 
        - * - * Protobuf type {@code google.showcase.v1beta1.Blurb} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.Blurb) - com.google.showcase.v1beta1.BlurbOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.google.showcase.v1beta1.MessagingOuterClass.internal_static_google_showcase_v1beta1_Blurb_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.showcase.v1beta1.MessagingOuterClass.internal_static_google_showcase_v1beta1_Blurb_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.showcase.v1beta1.Blurb.class, com.google.showcase.v1beta1.Blurb.Builder.class); - } - - // Construct using com.google.showcase.v1beta1.Blurb.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { - } - } - @java.lang.Override - public Builder clear() { - super.clear(); - name_ = ""; - - user_ = ""; - - if (createTimeBuilder_ == null) { - createTime_ = null; - } else { - createTime_ = null; - createTimeBuilder_ = null; - } - if (updateTimeBuilder_ == null) { - updateTime_ = null; - } else { - updateTime_ = null; - updateTimeBuilder_ = null; - } - contentCase_ = 0; - content_ = null; - legacyIdCase_ = 0; - legacyId_ = null; - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return com.google.showcase.v1beta1.MessagingOuterClass.internal_static_google_showcase_v1beta1_Blurb_descriptor; - } - - @java.lang.Override - public com.google.showcase.v1beta1.Blurb getDefaultInstanceForType() { - return com.google.showcase.v1beta1.Blurb.getDefaultInstance(); - } - - @java.lang.Override - public com.google.showcase.v1beta1.Blurb build() { - com.google.showcase.v1beta1.Blurb result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.showcase.v1beta1.Blurb buildPartial() { - com.google.showcase.v1beta1.Blurb result = new com.google.showcase.v1beta1.Blurb(this); - result.name_ = name_; - result.user_ = user_; - if (contentCase_ == 3) { - result.content_ = content_; - } - if (contentCase_ == 4) { - result.content_ = content_; - } - if (createTimeBuilder_ == null) { - result.createTime_ = createTime_; - } else { - result.createTime_ = createTimeBuilder_.build(); - } - if (updateTimeBuilder_ == null) { - result.updateTime_ = updateTime_; - } else { - result.updateTime_ = updateTimeBuilder_.build(); - } - if (legacyIdCase_ == 7) { - result.legacyId_ = legacyId_; - } - if (legacyIdCase_ == 8) { - result.legacyId_ = legacyId_; - } - result.contentCase_ = contentCase_; - result.legacyIdCase_ = legacyIdCase_; - 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.showcase.v1beta1.Blurb) { - return mergeFrom((com.google.showcase.v1beta1.Blurb)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.showcase.v1beta1.Blurb other) { - if (other == com.google.showcase.v1beta1.Blurb.getDefaultInstance()) return this; - if (!other.getName().isEmpty()) { - name_ = other.name_; - onChanged(); - } - if (!other.getUser().isEmpty()) { - user_ = other.user_; - onChanged(); - } - if (other.hasCreateTime()) { - mergeCreateTime(other.getCreateTime()); - } - if (other.hasUpdateTime()) { - mergeUpdateTime(other.getUpdateTime()); - } - switch (other.getContentCase()) { - case TEXT: { - contentCase_ = 3; - content_ = other.content_; - onChanged(); - break; - } - case IMAGE: { - setImage(other.getImage()); - break; - } - case CONTENT_NOT_SET: { - break; - } - } - switch (other.getLegacyIdCase()) { - case LEGACY_ROOM_ID: { - legacyIdCase_ = 7; - legacyId_ = other.legacyId_; - onChanged(); - break; - } - case LEGACY_USER_ID: { - legacyIdCase_ = 8; - legacyId_ = other.legacyId_; - onChanged(); - break; - } - case LEGACYID_NOT_SET: { - break; - } - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - com.google.showcase.v1beta1.Blurb parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (com.google.showcase.v1beta1.Blurb) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - private int contentCase_ = 0; - private java.lang.Object content_; - public ContentCase - getContentCase() { - return ContentCase.forNumber( - contentCase_); - } - - public Builder clearContent() { - contentCase_ = 0; - content_ = null; - onChanged(); - return this; - } - - private int legacyIdCase_ = 0; - private java.lang.Object legacyId_; - public LegacyIdCase - getLegacyIdCase() { - return LegacyIdCase.forNumber( - legacyIdCase_); - } - - public Builder clearLegacyId() { - legacyIdCase_ = 0; - legacyId_ = null; - onChanged(); - return this; - } - - - private java.lang.Object name_ = ""; - /** - *
        -     * The resource name of the chat room.
        -     * 
        - * - * 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 chat room.
        -     * 
        - * - * 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 chat room.
        -     * 
        - * - * string name = 1; - * @param value The name to set. - * @return This builder for chaining. - */ - public Builder setName( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - name_ = value; - onChanged(); - return this; - } - /** - *
        -     * The resource name of the chat room.
        -     * 
        - * - * string name = 1; - * @return This builder for chaining. - */ - public Builder clearName() { - - name_ = getDefaultInstance().getName(); - onChanged(); - return this; - } - /** - *
        -     * The resource name of the chat room.
        -     * 
        - * - * string name = 1; - * @param value The bytes for name to set. - * @return This builder for chaining. - */ - public Builder setNameBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - name_ = value; - onChanged(); - return this; - } - - private java.lang.Object user_ = ""; - /** - *
        -     * The resource name of the blurb's author.
        -     * 
        - * - * string user = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * @return The user. - */ - public java.lang.String getUser() { - java.lang.Object ref = user_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - user_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - *
        -     * The resource name of the blurb's author.
        -     * 
        - * - * string user = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * @return The bytes for user. - */ - public com.google.protobuf.ByteString - getUserBytes() { - java.lang.Object ref = user_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - user_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - *
        -     * The resource name of the blurb's author.
        -     * 
        - * - * string user = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * @param value The user to set. - * @return This builder for chaining. - */ - public Builder setUser( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - user_ = value; - onChanged(); - return this; - } - /** - *
        -     * The resource name of the blurb's author.
        -     * 
        - * - * string user = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * @return This builder for chaining. - */ - public Builder clearUser() { - - user_ = getDefaultInstance().getUser(); - onChanged(); - return this; - } - /** - *
        -     * The resource name of the blurb's author.
        -     * 
        - * - * string user = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * @param value The bytes for user to set. - * @return This builder for chaining. - */ - public Builder setUserBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - user_ = value; - onChanged(); - return this; - } - - /** - *
        -     * The textual content of this blurb.
        -     * 
        - * - * string text = 3; - * @return Whether the text field is set. - */ - @java.lang.Override - public boolean hasText() { - return contentCase_ == 3; - } - /** - *
        -     * The textual content of this blurb.
        -     * 
        - * - * string text = 3; - * @return The text. - */ - @java.lang.Override - public java.lang.String getText() { - java.lang.Object ref = ""; - if (contentCase_ == 3) { - ref = content_; - } - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - if (contentCase_ == 3) { - content_ = s; - } - return s; - } else { - return (java.lang.String) ref; - } - } - /** - *
        -     * The textual content of this blurb.
        -     * 
        - * - * string text = 3; - * @return The bytes for text. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getTextBytes() { - java.lang.Object ref = ""; - if (contentCase_ == 3) { - ref = content_; - } - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - if (contentCase_ == 3) { - content_ = b; - } - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - *
        -     * The textual content of this blurb.
        -     * 
        - * - * string text = 3; - * @param value The text to set. - * @return This builder for chaining. - */ - public Builder setText( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - contentCase_ = 3; - content_ = value; - onChanged(); - return this; - } - /** - *
        -     * The textual content of this blurb.
        -     * 
        - * - * string text = 3; - * @return This builder for chaining. - */ - public Builder clearText() { - if (contentCase_ == 3) { - contentCase_ = 0; - content_ = null; - onChanged(); - } - return this; - } - /** - *
        -     * The textual content of this blurb.
        -     * 
        - * - * string text = 3; - * @param value The bytes for text to set. - * @return This builder for chaining. - */ - public Builder setTextBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - contentCase_ = 3; - content_ = value; - onChanged(); - return this; - } - - /** - *
        -     * The image content of this blurb.
        -     * 
        - * - * bytes image = 4; - * @return Whether the image field is set. - */ - public boolean hasImage() { - return contentCase_ == 4; - } - /** - *
        -     * The image content of this blurb.
        -     * 
        - * - * bytes image = 4; - * @return The image. - */ - public com.google.protobuf.ByteString getImage() { - if (contentCase_ == 4) { - return (com.google.protobuf.ByteString) content_; - } - return com.google.protobuf.ByteString.EMPTY; - } - /** - *
        -     * The image content of this blurb.
        -     * 
        - * - * bytes image = 4; - * @param value The image to set. - * @return This builder for chaining. - */ - public Builder setImage(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - contentCase_ = 4; - content_ = value; - onChanged(); - return this; - } - /** - *
        -     * The image content of this blurb.
        -     * 
        - * - * bytes image = 4; - * @return This builder for chaining. - */ - public Builder clearImage() { - if (contentCase_ == 4) { - contentCase_ = 0; - content_ = null; - 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_; - /** - *
        -     * The timestamp at which the blurb was created.
        -     * 
        - * - * .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return Whether the createTime field is set. - */ - public boolean hasCreateTime() { - return createTimeBuilder_ != null || createTime_ != null; - } - /** - *
        -     * The timestamp at which the blurb was created.
        -     * 
        - * - * .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(); - } - } - /** - *
        -     * The timestamp at which the blurb was created.
        -     * 
        - * - * .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; - onChanged(); - } else { - createTimeBuilder_.setMessage(value); - } - - return this; - } - /** - *
        -     * The timestamp at which the blurb was created.
        -     * 
        - * - * .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(); - onChanged(); - } else { - createTimeBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - *
        -     * The timestamp at which the blurb was created.
        -     * 
        - * - * .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - public Builder mergeCreateTime(com.google.protobuf.Timestamp value) { - if (createTimeBuilder_ == null) { - if (createTime_ != null) { - createTime_ = - com.google.protobuf.Timestamp.newBuilder(createTime_).mergeFrom(value).buildPartial(); - } else { - createTime_ = value; - } - onChanged(); - } else { - createTimeBuilder_.mergeFrom(value); - } - - return this; - } - /** - *
        -     * The timestamp at which the blurb was created.
        -     * 
        - * - * .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - public Builder clearCreateTime() { - if (createTimeBuilder_ == null) { - createTime_ = null; - onChanged(); - } else { - createTime_ = null; - createTimeBuilder_ = null; - } - - return this; - } - /** - *
        -     * The timestamp at which the blurb was created.
        -     * 
        - * - * .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - public com.google.protobuf.Timestamp.Builder getCreateTimeBuilder() { - - onChanged(); - return getCreateTimeFieldBuilder().getBuilder(); - } - /** - *
        -     * The timestamp at which the blurb was created.
        -     * 
        - * - * .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_; - } - } - /** - *
        -     * The timestamp at which the blurb was created.
        -     * 
        - * - * .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_; - /** - *
        -     * The latest timestamp at which the blurb was updated.
        -     * 
        - * - * .google.protobuf.Timestamp update_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return Whether the updateTime field is set. - */ - public boolean hasUpdateTime() { - return updateTimeBuilder_ != null || updateTime_ != null; - } - /** - *
        -     * The latest timestamp at which the blurb was updated.
        -     * 
        - * - * .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(); - } - } - /** - *
        -     * The latest timestamp at which the blurb was updated.
        -     * 
        - * - * .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; - onChanged(); - } else { - updateTimeBuilder_.setMessage(value); - } - - return this; - } - /** - *
        -     * The latest timestamp at which the blurb was updated.
        -     * 
        - * - * .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(); - onChanged(); - } else { - updateTimeBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - *
        -     * The latest timestamp at which the blurb was updated.
        -     * 
        - * - * .google.protobuf.Timestamp update_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - public Builder mergeUpdateTime(com.google.protobuf.Timestamp value) { - if (updateTimeBuilder_ == null) { - if (updateTime_ != null) { - updateTime_ = - com.google.protobuf.Timestamp.newBuilder(updateTime_).mergeFrom(value).buildPartial(); - } else { - updateTime_ = value; - } - onChanged(); - } else { - updateTimeBuilder_.mergeFrom(value); - } - - return this; - } - /** - *
        -     * The latest timestamp at which the blurb was updated.
        -     * 
        - * - * .google.protobuf.Timestamp update_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - public Builder clearUpdateTime() { - if (updateTimeBuilder_ == null) { - updateTime_ = null; - onChanged(); - } else { - updateTime_ = null; - updateTimeBuilder_ = null; - } - - return this; - } - /** - *
        -     * The latest timestamp at which the blurb was updated.
        -     * 
        - * - * .google.protobuf.Timestamp update_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - public com.google.protobuf.Timestamp.Builder getUpdateTimeBuilder() { - - onChanged(); - return getUpdateTimeFieldBuilder().getBuilder(); - } - /** - *
        -     * The latest timestamp at which the blurb was updated.
        -     * 
        - * - * .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_; - } - } - /** - *
        -     * The latest timestamp at which the blurb was updated.
        -     * 
        - * - * .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_; - } - - /** - *
        -     * The legacy id of the room. This field is used to signal
        -     * the use of the compound resource pattern
        -     * `rooms/{room}/blurbs/legacy/{legacy_room}.{blurb}`
        -     * 
        - * - * string legacy_room_id = 7; - * @return Whether the legacyRoomId field is set. - */ - @java.lang.Override - public boolean hasLegacyRoomId() { - return legacyIdCase_ == 7; - } - /** - *
        -     * The legacy id of the room. This field is used to signal
        -     * the use of the compound resource pattern
        -     * `rooms/{room}/blurbs/legacy/{legacy_room}.{blurb}`
        -     * 
        - * - * string legacy_room_id = 7; - * @return The legacyRoomId. - */ - @java.lang.Override - public java.lang.String getLegacyRoomId() { - java.lang.Object ref = ""; - if (legacyIdCase_ == 7) { - ref = legacyId_; - } - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - if (legacyIdCase_ == 7) { - legacyId_ = s; - } - return s; - } else { - return (java.lang.String) ref; - } - } - /** - *
        -     * The legacy id of the room. This field is used to signal
        -     * the use of the compound resource pattern
        -     * `rooms/{room}/blurbs/legacy/{legacy_room}.{blurb}`
        -     * 
        - * - * string legacy_room_id = 7; - * @return The bytes for legacyRoomId. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getLegacyRoomIdBytes() { - java.lang.Object ref = ""; - if (legacyIdCase_ == 7) { - ref = legacyId_; - } - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - if (legacyIdCase_ == 7) { - legacyId_ = b; - } - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - *
        -     * The legacy id of the room. This field is used to signal
        -     * the use of the compound resource pattern
        -     * `rooms/{room}/blurbs/legacy/{legacy_room}.{blurb}`
        -     * 
        - * - * string legacy_room_id = 7; - * @param value The legacyRoomId to set. - * @return This builder for chaining. - */ - public Builder setLegacyRoomId( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - legacyIdCase_ = 7; - legacyId_ = value; - onChanged(); - return this; - } - /** - *
        -     * The legacy id of the room. This field is used to signal
        -     * the use of the compound resource pattern
        -     * `rooms/{room}/blurbs/legacy/{legacy_room}.{blurb}`
        -     * 
        - * - * string legacy_room_id = 7; - * @return This builder for chaining. - */ - public Builder clearLegacyRoomId() { - if (legacyIdCase_ == 7) { - legacyIdCase_ = 0; - legacyId_ = null; - onChanged(); - } - return this; - } - /** - *
        -     * The legacy id of the room. This field is used to signal
        -     * the use of the compound resource pattern
        -     * `rooms/{room}/blurbs/legacy/{legacy_room}.{blurb}`
        -     * 
        - * - * string legacy_room_id = 7; - * @param value The bytes for legacyRoomId to set. - * @return This builder for chaining. - */ - public Builder setLegacyRoomIdBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - legacyIdCase_ = 7; - legacyId_ = value; - onChanged(); - return this; - } - - /** - *
        -     * The legacy id of the user. This field is used to signal
        -     * the use of the compound resource pattern
        -     * `users/{user}/profile/blurbs/legacy/{legacy_user}~{blurb}`
        -     * 
        - * - * string legacy_user_id = 8; - * @return Whether the legacyUserId field is set. - */ - @java.lang.Override - public boolean hasLegacyUserId() { - return legacyIdCase_ == 8; - } - /** - *
        -     * The legacy id of the user. This field is used to signal
        -     * the use of the compound resource pattern
        -     * `users/{user}/profile/blurbs/legacy/{legacy_user}~{blurb}`
        -     * 
        - * - * string legacy_user_id = 8; - * @return The legacyUserId. - */ - @java.lang.Override - public java.lang.String getLegacyUserId() { - java.lang.Object ref = ""; - if (legacyIdCase_ == 8) { - ref = legacyId_; - } - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - if (legacyIdCase_ == 8) { - legacyId_ = s; - } - return s; - } else { - return (java.lang.String) ref; - } - } - /** - *
        -     * The legacy id of the user. This field is used to signal
        -     * the use of the compound resource pattern
        -     * `users/{user}/profile/blurbs/legacy/{legacy_user}~{blurb}`
        -     * 
        - * - * string legacy_user_id = 8; - * @return The bytes for legacyUserId. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getLegacyUserIdBytes() { - java.lang.Object ref = ""; - if (legacyIdCase_ == 8) { - ref = legacyId_; - } - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - if (legacyIdCase_ == 8) { - legacyId_ = b; - } - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - *
        -     * The legacy id of the user. This field is used to signal
        -     * the use of the compound resource pattern
        -     * `users/{user}/profile/blurbs/legacy/{legacy_user}~{blurb}`
        -     * 
        - * - * string legacy_user_id = 8; - * @param value The legacyUserId to set. - * @return This builder for chaining. - */ - public Builder setLegacyUserId( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - legacyIdCase_ = 8; - legacyId_ = value; - onChanged(); - return this; - } - /** - *
        -     * The legacy id of the user. This field is used to signal
        -     * the use of the compound resource pattern
        -     * `users/{user}/profile/blurbs/legacy/{legacy_user}~{blurb}`
        -     * 
        - * - * string legacy_user_id = 8; - * @return This builder for chaining. - */ - public Builder clearLegacyUserId() { - if (legacyIdCase_ == 8) { - legacyIdCase_ = 0; - legacyId_ = null; - onChanged(); - } - return this; - } - /** - *
        -     * The legacy id of the user. This field is used to signal
        -     * the use of the compound resource pattern
        -     * `users/{user}/profile/blurbs/legacy/{legacy_user}~{blurb}`
        -     * 
        - * - * string legacy_user_id = 8; - * @param value The bytes for legacyUserId to set. - * @return This builder for chaining. - */ - public Builder setLegacyUserIdBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - legacyIdCase_ = 8; - legacyId_ = value; - onChanged(); - return this; - } - @java.lang.Override - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - - // @@protoc_insertion_point(builder_scope:google.showcase.v1beta1.Blurb) - } - - // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.Blurb) - private static final com.google.showcase.v1beta1.Blurb DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new com.google.showcase.v1beta1.Blurb(); - } - - public static com.google.showcase.v1beta1.Blurb getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public Blurb parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new Blurb(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public com.google.showcase.v1beta1.Blurb getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/BlurbName.java b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/BlurbName.java deleted file mode 100644 index 32f3ed2380..0000000000 --- a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/BlurbName.java +++ /dev/null @@ -1,473 +0,0 @@ -/* - * 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 - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1; - -import com.google.api.core.BetaApi; -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 BlurbName implements ResourceName { - private static final PathTemplate USER_LEGACY_USER_BLURB = - PathTemplate.createWithoutUrlEncoding( - "users/{user}/profile/blurbs/legacy/{legacy_user}~{blurb}"); - private static final PathTemplate USER_BLURB = - PathTemplate.createWithoutUrlEncoding("users/{user}/profile/blurbs/{blurb}"); - private static final PathTemplate ROOM_BLURB = - PathTemplate.createWithoutUrlEncoding("rooms/{room}/blurbs/{blurb}"); - private static final PathTemplate ROOM_LEGACY_ROOM_BLURB = - PathTemplate.createWithoutUrlEncoding("rooms/{room}/blurbs/legacy/{legacy_room}.{blurb}"); - private volatile Map fieldValuesMap; - private PathTemplate pathTemplate; - private String fixedValue; - private final String user; - private final String legacyUser; - private final String blurb; - private final String room; - private final String legacyRoom; - - @Deprecated - protected BlurbName() { - user = null; - legacyUser = null; - blurb = null; - room = null; - legacyRoom = null; - } - - private BlurbName(Builder builder) { - user = Preconditions.checkNotNull(builder.getUser()); - legacyUser = Preconditions.checkNotNull(builder.getLegacyUser()); - blurb = Preconditions.checkNotNull(builder.getBlurb()); - room = null; - legacyRoom = null; - pathTemplate = USER_LEGACY_USER_BLURB; - } - - private BlurbName(UserBlurbBuilder builder) { - user = Preconditions.checkNotNull(builder.getUser()); - blurb = Preconditions.checkNotNull(builder.getBlurb()); - legacyUser = null; - room = null; - legacyRoom = null; - pathTemplate = USER_BLURB; - } - - private BlurbName(RoomBlurbBuilder builder) { - room = Preconditions.checkNotNull(builder.getRoom()); - blurb = Preconditions.checkNotNull(builder.getBlurb()); - user = null; - legacyUser = null; - legacyRoom = null; - pathTemplate = ROOM_BLURB; - } - - private BlurbName(RoomLegacyRoomBlurbBuilder builder) { - room = Preconditions.checkNotNull(builder.getRoom()); - legacyRoom = Preconditions.checkNotNull(builder.getLegacyRoom()); - blurb = Preconditions.checkNotNull(builder.getBlurb()); - user = null; - legacyUser = null; - pathTemplate = ROOM_LEGACY_ROOM_BLURB; - } - - public String getUser() { - return user; - } - - public String getLegacyUser() { - return legacyUser; - } - - public String getBlurb() { - return blurb; - } - - public String getRoom() { - return room; - } - - public String getLegacyRoom() { - return legacyRoom; - } - - public static Builder newBuilder() { - return new Builder(); - } - - @BetaApi("The per-pattern Builders are not stable yet and may be changed in the future.") - public static Builder newUserLegacyUserBlurbBuilder() { - return new Builder(); - } - - @BetaApi("The per-pattern Builders are not stable yet and may be changed in the future.") - public static UserBlurbBuilder newUserBlurbBuilder() { - return new UserBlurbBuilder(); - } - - @BetaApi("The per-pattern Builders are not stable yet and may be changed in the future.") - public static RoomBlurbBuilder newRoomBlurbBuilder() { - return new RoomBlurbBuilder(); - } - - @BetaApi("The per-pattern Builders are not stable yet and may be changed in the future.") - public static RoomLegacyRoomBlurbBuilder newRoomLegacyRoomBlurbBuilder() { - return new RoomLegacyRoomBlurbBuilder(); - } - - public Builder toBuilder() { - return new Builder(this); - } - - public static BlurbName of(String user, String legacyUser, String blurb) { - return newBuilder().setUser(user).setLegacyUser(legacyUser).setBlurb(blurb).build(); - } - - @BetaApi("The static create methods are not stable yet and may be changed in the future.") - public static BlurbName ofUserLegacyUserBlurbName(String user, String legacyUser, String blurb) { - return newBuilder().setUser(user).setLegacyUser(legacyUser).setBlurb(blurb).build(); - } - - @BetaApi("The static create methods are not stable yet and may be changed in the future.") - public static BlurbName ofUserBlurbName(String user, String blurb) { - return newUserBlurbBuilder().setUser(user).setBlurb(blurb).build(); - } - - @BetaApi("The static create methods are not stable yet and may be changed in the future.") - public static BlurbName ofRoomBlurbName(String room, String blurb) { - return newRoomBlurbBuilder().setRoom(room).setBlurb(blurb).build(); - } - - @BetaApi("The static create methods are not stable yet and may be changed in the future.") - public static BlurbName ofRoomLegacyRoomBlurbName(String room, String legacyRoom, String blurb) { - return newRoomLegacyRoomBlurbBuilder() - .setRoom(room) - .setLegacyRoom(legacyRoom) - .setBlurb(blurb) - .build(); - } - - public static String format(String user, String legacyUser, String blurb) { - return newBuilder().setUser(user).setLegacyUser(legacyUser).setBlurb(blurb).build().toString(); - } - - @BetaApi("The static format methods are not stable yet and may be changed in the future.") - public static String formatUserLegacyUserBlurbName(String user, String legacyUser, String blurb) { - return newBuilder().setUser(user).setLegacyUser(legacyUser).setBlurb(blurb).build().toString(); - } - - @BetaApi("The static format methods are not stable yet and may be changed in the future.") - public static String formatUserBlurbName(String user, String blurb) { - return newUserBlurbBuilder().setUser(user).setBlurb(blurb).build().toString(); - } - - @BetaApi("The static format methods are not stable yet and may be changed in the future.") - public static String formatRoomBlurbName(String room, String blurb) { - return newRoomBlurbBuilder().setRoom(room).setBlurb(blurb).build().toString(); - } - - @BetaApi("The static format methods are not stable yet and may be changed in the future.") - public static String formatRoomLegacyRoomBlurbName(String room, String legacyRoom, String blurb) { - return newRoomLegacyRoomBlurbBuilder() - .setRoom(room) - .setLegacyRoom(legacyRoom) - .setBlurb(blurb) - .build() - .toString(); - } - - public static BlurbName parse(String formattedString) { - if (formattedString.isEmpty()) { - return null; - } - if (USER_LEGACY_USER_BLURB.matches(formattedString)) { - Map matchMap = USER_LEGACY_USER_BLURB.match(formattedString); - return ofUserLegacyUserBlurbName( - matchMap.get("user"), matchMap.get("legacy_user"), matchMap.get("blurb")); - } else if (USER_BLURB.matches(formattedString)) { - Map matchMap = USER_BLURB.match(formattedString); - return ofUserBlurbName(matchMap.get("user"), matchMap.get("blurb")); - } else if (ROOM_BLURB.matches(formattedString)) { - Map matchMap = ROOM_BLURB.match(formattedString); - return ofRoomBlurbName(matchMap.get("room"), matchMap.get("blurb")); - } else if (ROOM_LEGACY_ROOM_BLURB.matches(formattedString)) { - Map matchMap = ROOM_LEGACY_ROOM_BLURB.match(formattedString); - return ofRoomLegacyRoomBlurbName( - matchMap.get("room"), matchMap.get("legacy_room"), matchMap.get("blurb")); - } - throw new ValidationException("BlurbName.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 (BlurbName value : values) { - if (value == null) { - list.add(""); - } else { - list.add(value.toString()); - } - } - return list; - } - - public static boolean isParsableFrom(String formattedString) { - return USER_LEGACY_USER_BLURB.matches(formattedString) - || USER_BLURB.matches(formattedString) - || ROOM_BLURB.matches(formattedString) - || ROOM_LEGACY_ROOM_BLURB.matches(formattedString); - } - - @Override - public Map getFieldValuesMap() { - if (fieldValuesMap == null) { - synchronized (this) { - if (fieldValuesMap == null) { - ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); - if (user != null) { - fieldMapBuilder.put("user", user); - } - if (legacyUser != null) { - fieldMapBuilder.put("legacy_user", legacyUser); - } - if (blurb != null) { - fieldMapBuilder.put("blurb", blurb); - } - if (room != null) { - fieldMapBuilder.put("room", room); - } - if (legacyRoom != null) { - fieldMapBuilder.put("legacy_room", legacyRoom); - } - 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()) { - BlurbName that = ((BlurbName) o); - return Objects.equals(this.user, that.user) - && Objects.equals(this.legacyUser, that.legacyUser) - && Objects.equals(this.blurb, that.blurb) - && Objects.equals(this.room, that.room) - && Objects.equals(this.legacyRoom, that.legacyRoom); - } - return false; - } - - @Override - public int hashCode() { - int h = 1; - h *= 1000003; - h ^= Objects.hashCode(fixedValue); - h *= 1000003; - h ^= Objects.hashCode(user); - h *= 1000003; - h ^= Objects.hashCode(legacyUser); - h *= 1000003; - h ^= Objects.hashCode(blurb); - h *= 1000003; - h ^= Objects.hashCode(room); - h *= 1000003; - h ^= Objects.hashCode(legacyRoom); - return h; - } - - /** Builder for users/{user}/profile/blurbs/legacy/{legacy_user}~{blurb}. */ - public static class Builder { - private String user; - private String legacyUser; - private String blurb; - - protected Builder() {} - - public String getUser() { - return user; - } - - public String getLegacyUser() { - return legacyUser; - } - - public String getBlurb() { - return blurb; - } - - public Builder setUser(String user) { - this.user = user; - return this; - } - - public Builder setLegacyUser(String legacyUser) { - this.legacyUser = legacyUser; - return this; - } - - public Builder setBlurb(String blurb) { - this.blurb = blurb; - return this; - } - - private Builder(BlurbName blurbName) { - Preconditions.checkArgument( - Objects.equals(blurbName.pathTemplate, USER_LEGACY_USER_BLURB), - "toBuilder is only supported when BlurbName has the pattern of users/{user}/profile/blurbs/legacy/{legacy_user}~{blurb}"); - this.user = blurbName.user; - this.legacyUser = blurbName.legacyUser; - this.blurb = blurbName.blurb; - } - - public BlurbName build() { - return new BlurbName(this); - } - } - - /** Builder for users/{user}/profile/blurbs/{blurb}. */ - @BetaApi("The per-pattern Builders are not stable yet and may be changed in the future.") - public static class UserBlurbBuilder { - private String user; - private String blurb; - - protected UserBlurbBuilder() {} - - public String getUser() { - return user; - } - - public String getBlurb() { - return blurb; - } - - public UserBlurbBuilder setUser(String user) { - this.user = user; - return this; - } - - public UserBlurbBuilder setBlurb(String blurb) { - this.blurb = blurb; - return this; - } - - public BlurbName build() { - return new BlurbName(this); - } - } - - /** Builder for rooms/{room}/blurbs/{blurb}. */ - @BetaApi("The per-pattern Builders are not stable yet and may be changed in the future.") - public static class RoomBlurbBuilder { - private String room; - private String blurb; - - protected RoomBlurbBuilder() {} - - public String getRoom() { - return room; - } - - public String getBlurb() { - return blurb; - } - - public RoomBlurbBuilder setRoom(String room) { - this.room = room; - return this; - } - - public RoomBlurbBuilder setBlurb(String blurb) { - this.blurb = blurb; - return this; - } - - public BlurbName build() { - return new BlurbName(this); - } - } - - /** Builder for rooms/{room}/blurbs/legacy/{legacy_room}.{blurb}. */ - @BetaApi("The per-pattern Builders are not stable yet and may be changed in the future.") - public static class RoomLegacyRoomBlurbBuilder { - private String room; - private String legacyRoom; - private String blurb; - - protected RoomLegacyRoomBlurbBuilder() {} - - public String getRoom() { - return room; - } - - public String getLegacyRoom() { - return legacyRoom; - } - - public String getBlurb() { - return blurb; - } - - public RoomLegacyRoomBlurbBuilder setRoom(String room) { - this.room = room; - return this; - } - - public RoomLegacyRoomBlurbBuilder setLegacyRoom(String legacyRoom) { - this.legacyRoom = legacyRoom; - return this; - } - - public RoomLegacyRoomBlurbBuilder setBlurb(String blurb) { - this.blurb = blurb; - return this; - } - - public BlurbName build() { - return new BlurbName(this); - } - } -} diff --git a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/BlurbOrBuilder.java b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/BlurbOrBuilder.java deleted file mode 100644 index 08af31258d..0000000000 --- a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/BlurbOrBuilder.java +++ /dev/null @@ -1,225 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: schema/google/showcase/v1beta1/messaging.proto - -package com.google.showcase.v1beta1; - -public interface BlurbOrBuilder extends - // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.Blurb) - com.google.protobuf.MessageOrBuilder { - - /** - *
        -   * The resource name of the chat room.
        -   * 
        - * - * string name = 1; - * @return The name. - */ - java.lang.String getName(); - /** - *
        -   * The resource name of the chat room.
        -   * 
        - * - * string name = 1; - * @return The bytes for name. - */ - com.google.protobuf.ByteString - getNameBytes(); - - /** - *
        -   * The resource name of the blurb's author.
        -   * 
        - * - * string user = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * @return The user. - */ - java.lang.String getUser(); - /** - *
        -   * The resource name of the blurb's author.
        -   * 
        - * - * string user = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * @return The bytes for user. - */ - com.google.protobuf.ByteString - getUserBytes(); - - /** - *
        -   * The textual content of this blurb.
        -   * 
        - * - * string text = 3; - * @return Whether the text field is set. - */ - boolean hasText(); - /** - *
        -   * The textual content of this blurb.
        -   * 
        - * - * string text = 3; - * @return The text. - */ - java.lang.String getText(); - /** - *
        -   * The textual content of this blurb.
        -   * 
        - * - * string text = 3; - * @return The bytes for text. - */ - com.google.protobuf.ByteString - getTextBytes(); - - /** - *
        -   * The image content of this blurb.
        -   * 
        - * - * bytes image = 4; - * @return Whether the image field is set. - */ - boolean hasImage(); - /** - *
        -   * The image content of this blurb.
        -   * 
        - * - * bytes image = 4; - * @return The image. - */ - com.google.protobuf.ByteString getImage(); - - /** - *
        -   * The timestamp at which the blurb was created.
        -   * 
        - * - * .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return Whether the createTime field is set. - */ - boolean hasCreateTime(); - /** - *
        -   * The timestamp at which the blurb was created.
        -   * 
        - * - * .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return The createTime. - */ - com.google.protobuf.Timestamp getCreateTime(); - /** - *
        -   * The timestamp at which the blurb was created.
        -   * 
        - * - * .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder(); - - /** - *
        -   * The latest timestamp at which the blurb was updated.
        -   * 
        - * - * .google.protobuf.Timestamp update_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return Whether the updateTime field is set. - */ - boolean hasUpdateTime(); - /** - *
        -   * The latest timestamp at which the blurb was updated.
        -   * 
        - * - * .google.protobuf.Timestamp update_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return The updateTime. - */ - com.google.protobuf.Timestamp getUpdateTime(); - /** - *
        -   * The latest timestamp at which the blurb was updated.
        -   * 
        - * - * .google.protobuf.Timestamp update_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder(); - - /** - *
        -   * The legacy id of the room. This field is used to signal
        -   * the use of the compound resource pattern
        -   * `rooms/{room}/blurbs/legacy/{legacy_room}.{blurb}`
        -   * 
        - * - * string legacy_room_id = 7; - * @return Whether the legacyRoomId field is set. - */ - boolean hasLegacyRoomId(); - /** - *
        -   * The legacy id of the room. This field is used to signal
        -   * the use of the compound resource pattern
        -   * `rooms/{room}/blurbs/legacy/{legacy_room}.{blurb}`
        -   * 
        - * - * string legacy_room_id = 7; - * @return The legacyRoomId. - */ - java.lang.String getLegacyRoomId(); - /** - *
        -   * The legacy id of the room. This field is used to signal
        -   * the use of the compound resource pattern
        -   * `rooms/{room}/blurbs/legacy/{legacy_room}.{blurb}`
        -   * 
        - * - * string legacy_room_id = 7; - * @return The bytes for legacyRoomId. - */ - com.google.protobuf.ByteString - getLegacyRoomIdBytes(); - - /** - *
        -   * The legacy id of the user. This field is used to signal
        -   * the use of the compound resource pattern
        -   * `users/{user}/profile/blurbs/legacy/{legacy_user}~{blurb}`
        -   * 
        - * - * string legacy_user_id = 8; - * @return Whether the legacyUserId field is set. - */ - boolean hasLegacyUserId(); - /** - *
        -   * The legacy id of the user. This field is used to signal
        -   * the use of the compound resource pattern
        -   * `users/{user}/profile/blurbs/legacy/{legacy_user}~{blurb}`
        -   * 
        - * - * string legacy_user_id = 8; - * @return The legacyUserId. - */ - java.lang.String getLegacyUserId(); - /** - *
        -   * The legacy id of the user. This field is used to signal
        -   * the use of the compound resource pattern
        -   * `users/{user}/profile/blurbs/legacy/{legacy_user}~{blurb}`
        -   * 
        - * - * string legacy_user_id = 8; - * @return The bytes for legacyUserId. - */ - com.google.protobuf.ByteString - getLegacyUserIdBytes(); - - public com.google.showcase.v1beta1.Blurb.ContentCase getContentCase(); - - public com.google.showcase.v1beta1.Blurb.LegacyIdCase getLegacyIdCase(); -} diff --git a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ComplianceData.java b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ComplianceData.java deleted file mode 100644 index 3d5de37762..0000000000 --- a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ComplianceData.java +++ /dev/null @@ -1,2662 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: schema/google/showcase/v1beta1/compliance.proto - -package com.google.showcase.v1beta1; - -/** - *
        - * ComplianceData is a message used for testing REST transcoding of
        - * different data types.
        - * 
        - * - * Protobuf type {@code google.showcase.v1beta1.ComplianceData} - */ -public final class ComplianceData extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.ComplianceData) - ComplianceDataOrBuilder { -private static final long serialVersionUID = 0L; - // Use ComplianceData.newBuilder() to construct. - private ComplianceData(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private ComplianceData() { - fString_ = ""; - fBytes_ = com.google.protobuf.ByteString.EMPTY; - fKingdom_ = 0; - pString_ = ""; - pKingdom_ = 0; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new ComplianceData(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private ComplianceData( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - int mutable_bitField0_ = 0; - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: { - java.lang.String s = input.readStringRequireUtf8(); - - fString_ = s; - break; - } - case 16: { - - fInt32_ = input.readInt32(); - break; - } - case 24: { - - fSint32_ = input.readSInt32(); - break; - } - case 37: { - - fSfixed32_ = input.readSFixed32(); - break; - } - case 40: { - - fUint32_ = input.readUInt32(); - break; - } - case 53: { - - fFixed32_ = input.readFixed32(); - break; - } - case 56: { - - fInt64_ = input.readInt64(); - break; - } - case 64: { - - fSint64_ = input.readSInt64(); - break; - } - case 73: { - - fSfixed64_ = input.readSFixed64(); - break; - } - case 80: { - - fUint64_ = input.readUInt64(); - break; - } - case 89: { - - fFixed64_ = input.readFixed64(); - break; - } - case 97: { - - fDouble_ = input.readDouble(); - break; - } - case 109: { - - fFloat_ = input.readFloat(); - break; - } - case 112: { - - fBool_ = input.readBool(); - break; - } - case 122: { - - fBytes_ = input.readBytes(); - break; - } - case 130: { - com.google.showcase.v1beta1.ComplianceDataChild.Builder subBuilder = null; - if (fChild_ != null) { - subBuilder = fChild_.toBuilder(); - } - fChild_ = input.readMessage(com.google.showcase.v1beta1.ComplianceDataChild.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(fChild_); - fChild_ = subBuilder.buildPartial(); - } - - break; - } - case 138: { - java.lang.String s = input.readStringRequireUtf8(); - bitField0_ |= 0x00000001; - pString_ = s; - break; - } - case 144: { - bitField0_ |= 0x00000002; - pInt32_ = input.readInt32(); - break; - } - case 153: { - bitField0_ |= 0x00000004; - pDouble_ = input.readDouble(); - break; - } - case 160: { - bitField0_ |= 0x00000008; - pBool_ = input.readBool(); - break; - } - case 170: { - com.google.showcase.v1beta1.ComplianceDataChild.Builder subBuilder = null; - if (((bitField0_ & 0x00000020) != 0)) { - subBuilder = pChild_.toBuilder(); - } - pChild_ = input.readMessage(com.google.showcase.v1beta1.ComplianceDataChild.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(pChild_); - pChild_ = subBuilder.buildPartial(); - } - bitField0_ |= 0x00000020; - break; - } - case 176: { - int rawValue = input.readEnum(); - - fKingdom_ = rawValue; - break; - } - case 184: { - int rawValue = input.readEnum(); - bitField0_ |= 0x00000010; - pKingdom_ = rawValue; - break; - } - default: { - if (!parseUnknownField( - input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException( - e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.google.showcase.v1beta1.ComplianceOuterClass.internal_static_google_showcase_v1beta1_ComplianceData_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.showcase.v1beta1.ComplianceOuterClass.internal_static_google_showcase_v1beta1_ComplianceData_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.showcase.v1beta1.ComplianceData.class, com.google.showcase.v1beta1.ComplianceData.Builder.class); - } - - /** - * Protobuf enum {@code google.showcase.v1beta1.ComplianceData.LifeKingdom} - */ - public enum LifeKingdom - implements com.google.protobuf.ProtocolMessageEnum { - /** - * LIFE_KINGDOM_UNSPECIFIED = 0; - */ - LIFE_KINGDOM_UNSPECIFIED(0), - /** - * ARCHAEBACTERIA = 1; - */ - ARCHAEBACTERIA(1), - /** - * EUBACTERIA = 2; - */ - EUBACTERIA(2), - /** - * PROTISTA = 3; - */ - PROTISTA(3), - /** - * FUNGI = 4; - */ - FUNGI(4), - /** - * PLANTAE = 5; - */ - PLANTAE(5), - /** - * ANIMALIA = 6; - */ - ANIMALIA(6), - UNRECOGNIZED(-1), - ; - - /** - * LIFE_KINGDOM_UNSPECIFIED = 0; - */ - public static final int LIFE_KINGDOM_UNSPECIFIED_VALUE = 0; - /** - * ARCHAEBACTERIA = 1; - */ - public static final int ARCHAEBACTERIA_VALUE = 1; - /** - * EUBACTERIA = 2; - */ - public static final int EUBACTERIA_VALUE = 2; - /** - * PROTISTA = 3; - */ - public static final int PROTISTA_VALUE = 3; - /** - * FUNGI = 4; - */ - public static final int FUNGI_VALUE = 4; - /** - * PLANTAE = 5; - */ - public static final int PLANTAE_VALUE = 5; - /** - * ANIMALIA = 6; - */ - public static final int ANIMALIA_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 LifeKingdom 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 LifeKingdom forNumber(int value) { - switch (value) { - case 0: return LIFE_KINGDOM_UNSPECIFIED; - case 1: return ARCHAEBACTERIA; - case 2: return EUBACTERIA; - case 3: return PROTISTA; - case 4: return FUNGI; - case 5: return PLANTAE; - case 6: return ANIMALIA; - default: return null; - } - } - - public static com.google.protobuf.Internal.EnumLiteMap - internalGetValueMap() { - return internalValueMap; - } - private static final com.google.protobuf.Internal.EnumLiteMap< - LifeKingdom> internalValueMap = - new com.google.protobuf.Internal.EnumLiteMap() { - public LifeKingdom findValueByNumber(int number) { - return LifeKingdom.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.showcase.v1beta1.ComplianceData.getDescriptor().getEnumTypes().get(0); - } - - private static final LifeKingdom[] VALUES = values(); - - public static LifeKingdom 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 LifeKingdom(int value) { - this.value = value; - } - - // @@protoc_insertion_point(enum_scope:google.showcase.v1beta1.ComplianceData.LifeKingdom) - } - - private int bitField0_; - public static final int F_STRING_FIELD_NUMBER = 1; - private volatile java.lang.Object fString_; - /** - * string f_string = 1; - * @return The fString. - */ - @java.lang.Override - public java.lang.String getFString() { - java.lang.Object ref = fString_; - 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(); - fString_ = s; - return s; - } - } - /** - * string f_string = 1; - * @return The bytes for fString. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getFStringBytes() { - java.lang.Object ref = fString_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - fString_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int F_INT32_FIELD_NUMBER = 2; - private int fInt32_; - /** - * int32 f_int32 = 2; - * @return The fInt32. - */ - @java.lang.Override - public int getFInt32() { - return fInt32_; - } - - public static final int F_SINT32_FIELD_NUMBER = 3; - private int fSint32_; - /** - * sint32 f_sint32 = 3; - * @return The fSint32. - */ - @java.lang.Override - public int getFSint32() { - return fSint32_; - } - - public static final int F_SFIXED32_FIELD_NUMBER = 4; - private int fSfixed32_; - /** - * sfixed32 f_sfixed32 = 4; - * @return The fSfixed32. - */ - @java.lang.Override - public int getFSfixed32() { - return fSfixed32_; - } - - public static final int F_UINT32_FIELD_NUMBER = 5; - private int fUint32_; - /** - * uint32 f_uint32 = 5; - * @return The fUint32. - */ - @java.lang.Override - public int getFUint32() { - return fUint32_; - } - - public static final int F_FIXED32_FIELD_NUMBER = 6; - private int fFixed32_; - /** - * fixed32 f_fixed32 = 6; - * @return The fFixed32. - */ - @java.lang.Override - public int getFFixed32() { - return fFixed32_; - } - - public static final int F_INT64_FIELD_NUMBER = 7; - private long fInt64_; - /** - * int64 f_int64 = 7; - * @return The fInt64. - */ - @java.lang.Override - public long getFInt64() { - return fInt64_; - } - - public static final int F_SINT64_FIELD_NUMBER = 8; - private long fSint64_; - /** - * sint64 f_sint64 = 8; - * @return The fSint64. - */ - @java.lang.Override - public long getFSint64() { - return fSint64_; - } - - public static final int F_SFIXED64_FIELD_NUMBER = 9; - private long fSfixed64_; - /** - * sfixed64 f_sfixed64 = 9; - * @return The fSfixed64. - */ - @java.lang.Override - public long getFSfixed64() { - return fSfixed64_; - } - - public static final int F_UINT64_FIELD_NUMBER = 10; - private long fUint64_; - /** - * uint64 f_uint64 = 10; - * @return The fUint64. - */ - @java.lang.Override - public long getFUint64() { - return fUint64_; - } - - public static final int F_FIXED64_FIELD_NUMBER = 11; - private long fFixed64_; - /** - * fixed64 f_fixed64 = 11; - * @return The fFixed64. - */ - @java.lang.Override - public long getFFixed64() { - return fFixed64_; - } - - public static final int F_DOUBLE_FIELD_NUMBER = 12; - private double fDouble_; - /** - * double f_double = 12; - * @return The fDouble. - */ - @java.lang.Override - public double getFDouble() { - return fDouble_; - } - - public static final int F_FLOAT_FIELD_NUMBER = 13; - private float fFloat_; - /** - * float f_float = 13; - * @return The fFloat. - */ - @java.lang.Override - public float getFFloat() { - return fFloat_; - } - - public static final int F_BOOL_FIELD_NUMBER = 14; - private boolean fBool_; - /** - * bool f_bool = 14; - * @return The fBool. - */ - @java.lang.Override - public boolean getFBool() { - return fBool_; - } - - public static final int F_BYTES_FIELD_NUMBER = 15; - private com.google.protobuf.ByteString fBytes_; - /** - * bytes f_bytes = 15; - * @return The fBytes. - */ - @java.lang.Override - public com.google.protobuf.ByteString getFBytes() { - return fBytes_; - } - - public static final int F_KINGDOM_FIELD_NUMBER = 22; - private int fKingdom_; - /** - * .google.showcase.v1beta1.ComplianceData.LifeKingdom f_kingdom = 22; - * @return The enum numeric value on the wire for fKingdom. - */ - @java.lang.Override public int getFKingdomValue() { - return fKingdom_; - } - /** - * .google.showcase.v1beta1.ComplianceData.LifeKingdom f_kingdom = 22; - * @return The fKingdom. - */ - @java.lang.Override public com.google.showcase.v1beta1.ComplianceData.LifeKingdom getFKingdom() { - @SuppressWarnings("deprecation") - com.google.showcase.v1beta1.ComplianceData.LifeKingdom result = com.google.showcase.v1beta1.ComplianceData.LifeKingdom.valueOf(fKingdom_); - return result == null ? com.google.showcase.v1beta1.ComplianceData.LifeKingdom.UNRECOGNIZED : result; - } - - public static final int F_CHILD_FIELD_NUMBER = 16; - private com.google.showcase.v1beta1.ComplianceDataChild fChild_; - /** - * .google.showcase.v1beta1.ComplianceDataChild f_child = 16; - * @return Whether the fChild field is set. - */ - @java.lang.Override - public boolean hasFChild() { - return fChild_ != null; - } - /** - * .google.showcase.v1beta1.ComplianceDataChild f_child = 16; - * @return The fChild. - */ - @java.lang.Override - public com.google.showcase.v1beta1.ComplianceDataChild getFChild() { - return fChild_ == null ? com.google.showcase.v1beta1.ComplianceDataChild.getDefaultInstance() : fChild_; - } - /** - * .google.showcase.v1beta1.ComplianceDataChild f_child = 16; - */ - @java.lang.Override - public com.google.showcase.v1beta1.ComplianceDataChildOrBuilder getFChildOrBuilder() { - return getFChild(); - } - - public static final int P_STRING_FIELD_NUMBER = 17; - private volatile java.lang.Object pString_; - /** - * optional string p_string = 17; - * @return Whether the pString field is set. - */ - @java.lang.Override - public boolean hasPString() { - return ((bitField0_ & 0x00000001) != 0); - } - /** - * optional string p_string = 17; - * @return The pString. - */ - @java.lang.Override - public java.lang.String getPString() { - java.lang.Object ref = pString_; - 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(); - pString_ = s; - return s; - } - } - /** - * optional string p_string = 17; - * @return The bytes for pString. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getPStringBytes() { - java.lang.Object ref = pString_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - pString_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int P_INT32_FIELD_NUMBER = 18; - private int pInt32_; - /** - * optional int32 p_int32 = 18; - * @return Whether the pInt32 field is set. - */ - @java.lang.Override - public boolean hasPInt32() { - return ((bitField0_ & 0x00000002) != 0); - } - /** - * optional int32 p_int32 = 18; - * @return The pInt32. - */ - @java.lang.Override - public int getPInt32() { - return pInt32_; - } - - public static final int P_DOUBLE_FIELD_NUMBER = 19; - private double pDouble_; - /** - * optional double p_double = 19; - * @return Whether the pDouble field is set. - */ - @java.lang.Override - public boolean hasPDouble() { - return ((bitField0_ & 0x00000004) != 0); - } - /** - * optional double p_double = 19; - * @return The pDouble. - */ - @java.lang.Override - public double getPDouble() { - return pDouble_; - } - - public static final int P_BOOL_FIELD_NUMBER = 20; - private boolean pBool_; - /** - * optional bool p_bool = 20; - * @return Whether the pBool field is set. - */ - @java.lang.Override - public boolean hasPBool() { - return ((bitField0_ & 0x00000008) != 0); - } - /** - * optional bool p_bool = 20; - * @return The pBool. - */ - @java.lang.Override - public boolean getPBool() { - return pBool_; - } - - public static final int P_KINGDOM_FIELD_NUMBER = 23; - private int pKingdom_; - /** - * optional .google.showcase.v1beta1.ComplianceData.LifeKingdom p_kingdom = 23; - * @return Whether the pKingdom field is set. - */ - @java.lang.Override public boolean hasPKingdom() { - return ((bitField0_ & 0x00000010) != 0); - } - /** - * optional .google.showcase.v1beta1.ComplianceData.LifeKingdom p_kingdom = 23; - * @return The enum numeric value on the wire for pKingdom. - */ - @java.lang.Override public int getPKingdomValue() { - return pKingdom_; - } - /** - * optional .google.showcase.v1beta1.ComplianceData.LifeKingdom p_kingdom = 23; - * @return The pKingdom. - */ - @java.lang.Override public com.google.showcase.v1beta1.ComplianceData.LifeKingdom getPKingdom() { - @SuppressWarnings("deprecation") - com.google.showcase.v1beta1.ComplianceData.LifeKingdom result = com.google.showcase.v1beta1.ComplianceData.LifeKingdom.valueOf(pKingdom_); - return result == null ? com.google.showcase.v1beta1.ComplianceData.LifeKingdom.UNRECOGNIZED : result; - } - - public static final int P_CHILD_FIELD_NUMBER = 21; - private com.google.showcase.v1beta1.ComplianceDataChild pChild_; - /** - * optional .google.showcase.v1beta1.ComplianceDataChild p_child = 21; - * @return Whether the pChild field is set. - */ - @java.lang.Override - public boolean hasPChild() { - return ((bitField0_ & 0x00000020) != 0); - } - /** - * optional .google.showcase.v1beta1.ComplianceDataChild p_child = 21; - * @return The pChild. - */ - @java.lang.Override - public com.google.showcase.v1beta1.ComplianceDataChild getPChild() { - return pChild_ == null ? com.google.showcase.v1beta1.ComplianceDataChild.getDefaultInstance() : pChild_; - } - /** - * optional .google.showcase.v1beta1.ComplianceDataChild p_child = 21; - */ - @java.lang.Override - public com.google.showcase.v1beta1.ComplianceDataChildOrBuilder getPChildOrBuilder() { - return pChild_ == null ? com.google.showcase.v1beta1.ComplianceDataChild.getDefaultInstance() : pChild_; - } - - 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(fString_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, fString_); - } - if (fInt32_ != 0) { - output.writeInt32(2, fInt32_); - } - if (fSint32_ != 0) { - output.writeSInt32(3, fSint32_); - } - if (fSfixed32_ != 0) { - output.writeSFixed32(4, fSfixed32_); - } - if (fUint32_ != 0) { - output.writeUInt32(5, fUint32_); - } - if (fFixed32_ != 0) { - output.writeFixed32(6, fFixed32_); - } - if (fInt64_ != 0L) { - output.writeInt64(7, fInt64_); - } - if (fSint64_ != 0L) { - output.writeSInt64(8, fSint64_); - } - if (fSfixed64_ != 0L) { - output.writeSFixed64(9, fSfixed64_); - } - if (fUint64_ != 0L) { - output.writeUInt64(10, fUint64_); - } - if (fFixed64_ != 0L) { - output.writeFixed64(11, fFixed64_); - } - if (java.lang.Double.doubleToRawLongBits(fDouble_) != 0) { - output.writeDouble(12, fDouble_); - } - if (java.lang.Float.floatToRawIntBits(fFloat_) != 0) { - output.writeFloat(13, fFloat_); - } - if (fBool_ != false) { - output.writeBool(14, fBool_); - } - if (!fBytes_.isEmpty()) { - output.writeBytes(15, fBytes_); - } - if (fChild_ != null) { - output.writeMessage(16, getFChild()); - } - if (((bitField0_ & 0x00000001) != 0)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 17, pString_); - } - if (((bitField0_ & 0x00000002) != 0)) { - output.writeInt32(18, pInt32_); - } - if (((bitField0_ & 0x00000004) != 0)) { - output.writeDouble(19, pDouble_); - } - if (((bitField0_ & 0x00000008) != 0)) { - output.writeBool(20, pBool_); - } - if (((bitField0_ & 0x00000020) != 0)) { - output.writeMessage(21, getPChild()); - } - if (fKingdom_ != com.google.showcase.v1beta1.ComplianceData.LifeKingdom.LIFE_KINGDOM_UNSPECIFIED.getNumber()) { - output.writeEnum(22, fKingdom_); - } - if (((bitField0_ & 0x00000010) != 0)) { - output.writeEnum(23, pKingdom_); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(fString_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, fString_); - } - if (fInt32_ != 0) { - size += com.google.protobuf.CodedOutputStream - .computeInt32Size(2, fInt32_); - } - if (fSint32_ != 0) { - size += com.google.protobuf.CodedOutputStream - .computeSInt32Size(3, fSint32_); - } - if (fSfixed32_ != 0) { - size += com.google.protobuf.CodedOutputStream - .computeSFixed32Size(4, fSfixed32_); - } - if (fUint32_ != 0) { - size += com.google.protobuf.CodedOutputStream - .computeUInt32Size(5, fUint32_); - } - if (fFixed32_ != 0) { - size += com.google.protobuf.CodedOutputStream - .computeFixed32Size(6, fFixed32_); - } - if (fInt64_ != 0L) { - size += com.google.protobuf.CodedOutputStream - .computeInt64Size(7, fInt64_); - } - if (fSint64_ != 0L) { - size += com.google.protobuf.CodedOutputStream - .computeSInt64Size(8, fSint64_); - } - if (fSfixed64_ != 0L) { - size += com.google.protobuf.CodedOutputStream - .computeSFixed64Size(9, fSfixed64_); - } - if (fUint64_ != 0L) { - size += com.google.protobuf.CodedOutputStream - .computeUInt64Size(10, fUint64_); - } - if (fFixed64_ != 0L) { - size += com.google.protobuf.CodedOutputStream - .computeFixed64Size(11, fFixed64_); - } - if (java.lang.Double.doubleToRawLongBits(fDouble_) != 0) { - size += com.google.protobuf.CodedOutputStream - .computeDoubleSize(12, fDouble_); - } - if (java.lang.Float.floatToRawIntBits(fFloat_) != 0) { - size += com.google.protobuf.CodedOutputStream - .computeFloatSize(13, fFloat_); - } - if (fBool_ != false) { - size += com.google.protobuf.CodedOutputStream - .computeBoolSize(14, fBool_); - } - if (!fBytes_.isEmpty()) { - size += com.google.protobuf.CodedOutputStream - .computeBytesSize(15, fBytes_); - } - if (fChild_ != null) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(16, getFChild()); - } - if (((bitField0_ & 0x00000001) != 0)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(17, pString_); - } - if (((bitField0_ & 0x00000002) != 0)) { - size += com.google.protobuf.CodedOutputStream - .computeInt32Size(18, pInt32_); - } - if (((bitField0_ & 0x00000004) != 0)) { - size += com.google.protobuf.CodedOutputStream - .computeDoubleSize(19, pDouble_); - } - if (((bitField0_ & 0x00000008) != 0)) { - size += com.google.protobuf.CodedOutputStream - .computeBoolSize(20, pBool_); - } - if (((bitField0_ & 0x00000020) != 0)) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(21, getPChild()); - } - if (fKingdom_ != com.google.showcase.v1beta1.ComplianceData.LifeKingdom.LIFE_KINGDOM_UNSPECIFIED.getNumber()) { - size += com.google.protobuf.CodedOutputStream - .computeEnumSize(22, fKingdom_); - } - if (((bitField0_ & 0x00000010) != 0)) { - size += com.google.protobuf.CodedOutputStream - .computeEnumSize(23, pKingdom_); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof com.google.showcase.v1beta1.ComplianceData)) { - return super.equals(obj); - } - com.google.showcase.v1beta1.ComplianceData other = (com.google.showcase.v1beta1.ComplianceData) obj; - - if (!getFString() - .equals(other.getFString())) return false; - if (getFInt32() - != other.getFInt32()) return false; - if (getFSint32() - != other.getFSint32()) return false; - if (getFSfixed32() - != other.getFSfixed32()) return false; - if (getFUint32() - != other.getFUint32()) return false; - if (getFFixed32() - != other.getFFixed32()) return false; - if (getFInt64() - != other.getFInt64()) return false; - if (getFSint64() - != other.getFSint64()) return false; - if (getFSfixed64() - != other.getFSfixed64()) return false; - if (getFUint64() - != other.getFUint64()) return false; - if (getFFixed64() - != other.getFFixed64()) return false; - if (java.lang.Double.doubleToLongBits(getFDouble()) - != java.lang.Double.doubleToLongBits( - other.getFDouble())) return false; - if (java.lang.Float.floatToIntBits(getFFloat()) - != java.lang.Float.floatToIntBits( - other.getFFloat())) return false; - if (getFBool() - != other.getFBool()) return false; - if (!getFBytes() - .equals(other.getFBytes())) return false; - if (fKingdom_ != other.fKingdom_) return false; - if (hasFChild() != other.hasFChild()) return false; - if (hasFChild()) { - if (!getFChild() - .equals(other.getFChild())) return false; - } - if (hasPString() != other.hasPString()) return false; - if (hasPString()) { - if (!getPString() - .equals(other.getPString())) return false; - } - if (hasPInt32() != other.hasPInt32()) return false; - if (hasPInt32()) { - if (getPInt32() - != other.getPInt32()) return false; - } - if (hasPDouble() != other.hasPDouble()) return false; - if (hasPDouble()) { - if (java.lang.Double.doubleToLongBits(getPDouble()) - != java.lang.Double.doubleToLongBits( - other.getPDouble())) return false; - } - if (hasPBool() != other.hasPBool()) return false; - if (hasPBool()) { - if (getPBool() - != other.getPBool()) return false; - } - if (hasPKingdom() != other.hasPKingdom()) return false; - if (hasPKingdom()) { - if (pKingdom_ != other.pKingdom_) return false; - } - if (hasPChild() != other.hasPChild()) return false; - if (hasPChild()) { - if (!getPChild() - .equals(other.getPChild())) return false; - } - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - hash = (37 * hash) + F_STRING_FIELD_NUMBER; - hash = (53 * hash) + getFString().hashCode(); - hash = (37 * hash) + F_INT32_FIELD_NUMBER; - hash = (53 * hash) + getFInt32(); - hash = (37 * hash) + F_SINT32_FIELD_NUMBER; - hash = (53 * hash) + getFSint32(); - hash = (37 * hash) + F_SFIXED32_FIELD_NUMBER; - hash = (53 * hash) + getFSfixed32(); - hash = (37 * hash) + F_UINT32_FIELD_NUMBER; - hash = (53 * hash) + getFUint32(); - hash = (37 * hash) + F_FIXED32_FIELD_NUMBER; - hash = (53 * hash) + getFFixed32(); - hash = (37 * hash) + F_INT64_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashLong( - getFInt64()); - hash = (37 * hash) + F_SINT64_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashLong( - getFSint64()); - hash = (37 * hash) + F_SFIXED64_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashLong( - getFSfixed64()); - hash = (37 * hash) + F_UINT64_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashLong( - getFUint64()); - hash = (37 * hash) + F_FIXED64_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashLong( - getFFixed64()); - hash = (37 * hash) + F_DOUBLE_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashLong( - java.lang.Double.doubleToLongBits(getFDouble())); - hash = (37 * hash) + F_FLOAT_FIELD_NUMBER; - hash = (53 * hash) + java.lang.Float.floatToIntBits( - getFFloat()); - hash = (37 * hash) + F_BOOL_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( - getFBool()); - hash = (37 * hash) + F_BYTES_FIELD_NUMBER; - hash = (53 * hash) + getFBytes().hashCode(); - hash = (37 * hash) + F_KINGDOM_FIELD_NUMBER; - hash = (53 * hash) + fKingdom_; - if (hasFChild()) { - hash = (37 * hash) + F_CHILD_FIELD_NUMBER; - hash = (53 * hash) + getFChild().hashCode(); - } - if (hasPString()) { - hash = (37 * hash) + P_STRING_FIELD_NUMBER; - hash = (53 * hash) + getPString().hashCode(); - } - if (hasPInt32()) { - hash = (37 * hash) + P_INT32_FIELD_NUMBER; - hash = (53 * hash) + getPInt32(); - } - if (hasPDouble()) { - hash = (37 * hash) + P_DOUBLE_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashLong( - java.lang.Double.doubleToLongBits(getPDouble())); - } - if (hasPBool()) { - hash = (37 * hash) + P_BOOL_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( - getPBool()); - } - if (hasPKingdom()) { - hash = (37 * hash) + P_KINGDOM_FIELD_NUMBER; - hash = (53 * hash) + pKingdom_; - } - if (hasPChild()) { - hash = (37 * hash) + P_CHILD_FIELD_NUMBER; - hash = (53 * hash) + getPChild().hashCode(); - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.showcase.v1beta1.ComplianceData parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.showcase.v1beta1.ComplianceData parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.showcase.v1beta1.ComplianceData parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.showcase.v1beta1.ComplianceData 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.showcase.v1beta1.ComplianceData parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.showcase.v1beta1.ComplianceData parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.showcase.v1beta1.ComplianceData parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static com.google.showcase.v1beta1.ComplianceData 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.showcase.v1beta1.ComplianceData parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static com.google.showcase.v1beta1.ComplianceData 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.showcase.v1beta1.ComplianceData parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static com.google.showcase.v1beta1.ComplianceData 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.showcase.v1beta1.ComplianceData 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; - } - /** - *
        -   * ComplianceData is a message used for testing REST transcoding of
        -   * different data types.
        -   * 
        - * - * Protobuf type {@code google.showcase.v1beta1.ComplianceData} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.ComplianceData) - com.google.showcase.v1beta1.ComplianceDataOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.google.showcase.v1beta1.ComplianceOuterClass.internal_static_google_showcase_v1beta1_ComplianceData_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.showcase.v1beta1.ComplianceOuterClass.internal_static_google_showcase_v1beta1_ComplianceData_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.showcase.v1beta1.ComplianceData.class, com.google.showcase.v1beta1.ComplianceData.Builder.class); - } - - // Construct using com.google.showcase.v1beta1.ComplianceData.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { - getPChildFieldBuilder(); - } - } - @java.lang.Override - public Builder clear() { - super.clear(); - fString_ = ""; - - fInt32_ = 0; - - fSint32_ = 0; - - fSfixed32_ = 0; - - fUint32_ = 0; - - fFixed32_ = 0; - - fInt64_ = 0L; - - fSint64_ = 0L; - - fSfixed64_ = 0L; - - fUint64_ = 0L; - - fFixed64_ = 0L; - - fDouble_ = 0D; - - fFloat_ = 0F; - - fBool_ = false; - - fBytes_ = com.google.protobuf.ByteString.EMPTY; - - fKingdom_ = 0; - - if (fChildBuilder_ == null) { - fChild_ = null; - } else { - fChild_ = null; - fChildBuilder_ = null; - } - pString_ = ""; - bitField0_ = (bitField0_ & ~0x00000001); - pInt32_ = 0; - bitField0_ = (bitField0_ & ~0x00000002); - pDouble_ = 0D; - bitField0_ = (bitField0_ & ~0x00000004); - pBool_ = false; - bitField0_ = (bitField0_ & ~0x00000008); - pKingdom_ = 0; - bitField0_ = (bitField0_ & ~0x00000010); - if (pChildBuilder_ == null) { - pChild_ = null; - } else { - pChildBuilder_.clear(); - } - bitField0_ = (bitField0_ & ~0x00000020); - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return com.google.showcase.v1beta1.ComplianceOuterClass.internal_static_google_showcase_v1beta1_ComplianceData_descriptor; - } - - @java.lang.Override - public com.google.showcase.v1beta1.ComplianceData getDefaultInstanceForType() { - return com.google.showcase.v1beta1.ComplianceData.getDefaultInstance(); - } - - @java.lang.Override - public com.google.showcase.v1beta1.ComplianceData build() { - com.google.showcase.v1beta1.ComplianceData result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.showcase.v1beta1.ComplianceData buildPartial() { - com.google.showcase.v1beta1.ComplianceData result = new com.google.showcase.v1beta1.ComplianceData(this); - int from_bitField0_ = bitField0_; - int to_bitField0_ = 0; - result.fString_ = fString_; - result.fInt32_ = fInt32_; - result.fSint32_ = fSint32_; - result.fSfixed32_ = fSfixed32_; - result.fUint32_ = fUint32_; - result.fFixed32_ = fFixed32_; - result.fInt64_ = fInt64_; - result.fSint64_ = fSint64_; - result.fSfixed64_ = fSfixed64_; - result.fUint64_ = fUint64_; - result.fFixed64_ = fFixed64_; - result.fDouble_ = fDouble_; - result.fFloat_ = fFloat_; - result.fBool_ = fBool_; - result.fBytes_ = fBytes_; - result.fKingdom_ = fKingdom_; - if (fChildBuilder_ == null) { - result.fChild_ = fChild_; - } else { - result.fChild_ = fChildBuilder_.build(); - } - if (((from_bitField0_ & 0x00000001) != 0)) { - to_bitField0_ |= 0x00000001; - } - result.pString_ = pString_; - if (((from_bitField0_ & 0x00000002) != 0)) { - result.pInt32_ = pInt32_; - to_bitField0_ |= 0x00000002; - } - if (((from_bitField0_ & 0x00000004) != 0)) { - result.pDouble_ = pDouble_; - to_bitField0_ |= 0x00000004; - } - if (((from_bitField0_ & 0x00000008) != 0)) { - result.pBool_ = pBool_; - to_bitField0_ |= 0x00000008; - } - if (((from_bitField0_ & 0x00000010) != 0)) { - to_bitField0_ |= 0x00000010; - } - result.pKingdom_ = pKingdom_; - if (((from_bitField0_ & 0x00000020) != 0)) { - if (pChildBuilder_ == null) { - result.pChild_ = pChild_; - } else { - result.pChild_ = pChildBuilder_.build(); - } - to_bitField0_ |= 0x00000020; - } - result.bitField0_ = to_bitField0_; - 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.showcase.v1beta1.ComplianceData) { - return mergeFrom((com.google.showcase.v1beta1.ComplianceData)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.showcase.v1beta1.ComplianceData other) { - if (other == com.google.showcase.v1beta1.ComplianceData.getDefaultInstance()) return this; - if (!other.getFString().isEmpty()) { - fString_ = other.fString_; - onChanged(); - } - if (other.getFInt32() != 0) { - setFInt32(other.getFInt32()); - } - if (other.getFSint32() != 0) { - setFSint32(other.getFSint32()); - } - if (other.getFSfixed32() != 0) { - setFSfixed32(other.getFSfixed32()); - } - if (other.getFUint32() != 0) { - setFUint32(other.getFUint32()); - } - if (other.getFFixed32() != 0) { - setFFixed32(other.getFFixed32()); - } - if (other.getFInt64() != 0L) { - setFInt64(other.getFInt64()); - } - if (other.getFSint64() != 0L) { - setFSint64(other.getFSint64()); - } - if (other.getFSfixed64() != 0L) { - setFSfixed64(other.getFSfixed64()); - } - if (other.getFUint64() != 0L) { - setFUint64(other.getFUint64()); - } - if (other.getFFixed64() != 0L) { - setFFixed64(other.getFFixed64()); - } - if (other.getFDouble() != 0D) { - setFDouble(other.getFDouble()); - } - if (other.getFFloat() != 0F) { - setFFloat(other.getFFloat()); - } - if (other.getFBool() != false) { - setFBool(other.getFBool()); - } - if (other.getFBytes() != com.google.protobuf.ByteString.EMPTY) { - setFBytes(other.getFBytes()); - } - if (other.fKingdom_ != 0) { - setFKingdomValue(other.getFKingdomValue()); - } - if (other.hasFChild()) { - mergeFChild(other.getFChild()); - } - if (other.hasPString()) { - bitField0_ |= 0x00000001; - pString_ = other.pString_; - onChanged(); - } - if (other.hasPInt32()) { - setPInt32(other.getPInt32()); - } - if (other.hasPDouble()) { - setPDouble(other.getPDouble()); - } - if (other.hasPBool()) { - setPBool(other.getPBool()); - } - if (other.hasPKingdom()) { - setPKingdom(other.getPKingdom()); - } - if (other.hasPChild()) { - mergePChild(other.getPChild()); - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - com.google.showcase.v1beta1.ComplianceData parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (com.google.showcase.v1beta1.ComplianceData) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - private int bitField0_; - - private java.lang.Object fString_ = ""; - /** - * string f_string = 1; - * @return The fString. - */ - public java.lang.String getFString() { - java.lang.Object ref = fString_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - fString_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * string f_string = 1; - * @return The bytes for fString. - */ - public com.google.protobuf.ByteString - getFStringBytes() { - java.lang.Object ref = fString_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - fString_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * string f_string = 1; - * @param value The fString to set. - * @return This builder for chaining. - */ - public Builder setFString( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - fString_ = value; - onChanged(); - return this; - } - /** - * string f_string = 1; - * @return This builder for chaining. - */ - public Builder clearFString() { - - fString_ = getDefaultInstance().getFString(); - onChanged(); - return this; - } - /** - * string f_string = 1; - * @param value The bytes for fString to set. - * @return This builder for chaining. - */ - public Builder setFStringBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - fString_ = value; - onChanged(); - return this; - } - - private int fInt32_ ; - /** - * int32 f_int32 = 2; - * @return The fInt32. - */ - @java.lang.Override - public int getFInt32() { - return fInt32_; - } - /** - * int32 f_int32 = 2; - * @param value The fInt32 to set. - * @return This builder for chaining. - */ - public Builder setFInt32(int value) { - - fInt32_ = value; - onChanged(); - return this; - } - /** - * int32 f_int32 = 2; - * @return This builder for chaining. - */ - public Builder clearFInt32() { - - fInt32_ = 0; - onChanged(); - return this; - } - - private int fSint32_ ; - /** - * sint32 f_sint32 = 3; - * @return The fSint32. - */ - @java.lang.Override - public int getFSint32() { - return fSint32_; - } - /** - * sint32 f_sint32 = 3; - * @param value The fSint32 to set. - * @return This builder for chaining. - */ - public Builder setFSint32(int value) { - - fSint32_ = value; - onChanged(); - return this; - } - /** - * sint32 f_sint32 = 3; - * @return This builder for chaining. - */ - public Builder clearFSint32() { - - fSint32_ = 0; - onChanged(); - return this; - } - - private int fSfixed32_ ; - /** - * sfixed32 f_sfixed32 = 4; - * @return The fSfixed32. - */ - @java.lang.Override - public int getFSfixed32() { - return fSfixed32_; - } - /** - * sfixed32 f_sfixed32 = 4; - * @param value The fSfixed32 to set. - * @return This builder for chaining. - */ - public Builder setFSfixed32(int value) { - - fSfixed32_ = value; - onChanged(); - return this; - } - /** - * sfixed32 f_sfixed32 = 4; - * @return This builder for chaining. - */ - public Builder clearFSfixed32() { - - fSfixed32_ = 0; - onChanged(); - return this; - } - - private int fUint32_ ; - /** - * uint32 f_uint32 = 5; - * @return The fUint32. - */ - @java.lang.Override - public int getFUint32() { - return fUint32_; - } - /** - * uint32 f_uint32 = 5; - * @param value The fUint32 to set. - * @return This builder for chaining. - */ - public Builder setFUint32(int value) { - - fUint32_ = value; - onChanged(); - return this; - } - /** - * uint32 f_uint32 = 5; - * @return This builder for chaining. - */ - public Builder clearFUint32() { - - fUint32_ = 0; - onChanged(); - return this; - } - - private int fFixed32_ ; - /** - * fixed32 f_fixed32 = 6; - * @return The fFixed32. - */ - @java.lang.Override - public int getFFixed32() { - return fFixed32_; - } - /** - * fixed32 f_fixed32 = 6; - * @param value The fFixed32 to set. - * @return This builder for chaining. - */ - public Builder setFFixed32(int value) { - - fFixed32_ = value; - onChanged(); - return this; - } - /** - * fixed32 f_fixed32 = 6; - * @return This builder for chaining. - */ - public Builder clearFFixed32() { - - fFixed32_ = 0; - onChanged(); - return this; - } - - private long fInt64_ ; - /** - * int64 f_int64 = 7; - * @return The fInt64. - */ - @java.lang.Override - public long getFInt64() { - return fInt64_; - } - /** - * int64 f_int64 = 7; - * @param value The fInt64 to set. - * @return This builder for chaining. - */ - public Builder setFInt64(long value) { - - fInt64_ = value; - onChanged(); - return this; - } - /** - * int64 f_int64 = 7; - * @return This builder for chaining. - */ - public Builder clearFInt64() { - - fInt64_ = 0L; - onChanged(); - return this; - } - - private long fSint64_ ; - /** - * sint64 f_sint64 = 8; - * @return The fSint64. - */ - @java.lang.Override - public long getFSint64() { - return fSint64_; - } - /** - * sint64 f_sint64 = 8; - * @param value The fSint64 to set. - * @return This builder for chaining. - */ - public Builder setFSint64(long value) { - - fSint64_ = value; - onChanged(); - return this; - } - /** - * sint64 f_sint64 = 8; - * @return This builder for chaining. - */ - public Builder clearFSint64() { - - fSint64_ = 0L; - onChanged(); - return this; - } - - private long fSfixed64_ ; - /** - * sfixed64 f_sfixed64 = 9; - * @return The fSfixed64. - */ - @java.lang.Override - public long getFSfixed64() { - return fSfixed64_; - } - /** - * sfixed64 f_sfixed64 = 9; - * @param value The fSfixed64 to set. - * @return This builder for chaining. - */ - public Builder setFSfixed64(long value) { - - fSfixed64_ = value; - onChanged(); - return this; - } - /** - * sfixed64 f_sfixed64 = 9; - * @return This builder for chaining. - */ - public Builder clearFSfixed64() { - - fSfixed64_ = 0L; - onChanged(); - return this; - } - - private long fUint64_ ; - /** - * uint64 f_uint64 = 10; - * @return The fUint64. - */ - @java.lang.Override - public long getFUint64() { - return fUint64_; - } - /** - * uint64 f_uint64 = 10; - * @param value The fUint64 to set. - * @return This builder for chaining. - */ - public Builder setFUint64(long value) { - - fUint64_ = value; - onChanged(); - return this; - } - /** - * uint64 f_uint64 = 10; - * @return This builder for chaining. - */ - public Builder clearFUint64() { - - fUint64_ = 0L; - onChanged(); - return this; - } - - private long fFixed64_ ; - /** - * fixed64 f_fixed64 = 11; - * @return The fFixed64. - */ - @java.lang.Override - public long getFFixed64() { - return fFixed64_; - } - /** - * fixed64 f_fixed64 = 11; - * @param value The fFixed64 to set. - * @return This builder for chaining. - */ - public Builder setFFixed64(long value) { - - fFixed64_ = value; - onChanged(); - return this; - } - /** - * fixed64 f_fixed64 = 11; - * @return This builder for chaining. - */ - public Builder clearFFixed64() { - - fFixed64_ = 0L; - onChanged(); - return this; - } - - private double fDouble_ ; - /** - * double f_double = 12; - * @return The fDouble. - */ - @java.lang.Override - public double getFDouble() { - return fDouble_; - } - /** - * double f_double = 12; - * @param value The fDouble to set. - * @return This builder for chaining. - */ - public Builder setFDouble(double value) { - - fDouble_ = value; - onChanged(); - return this; - } - /** - * double f_double = 12; - * @return This builder for chaining. - */ - public Builder clearFDouble() { - - fDouble_ = 0D; - onChanged(); - return this; - } - - private float fFloat_ ; - /** - * float f_float = 13; - * @return The fFloat. - */ - @java.lang.Override - public float getFFloat() { - return fFloat_; - } - /** - * float f_float = 13; - * @param value The fFloat to set. - * @return This builder for chaining. - */ - public Builder setFFloat(float value) { - - fFloat_ = value; - onChanged(); - return this; - } - /** - * float f_float = 13; - * @return This builder for chaining. - */ - public Builder clearFFloat() { - - fFloat_ = 0F; - onChanged(); - return this; - } - - private boolean fBool_ ; - /** - * bool f_bool = 14; - * @return The fBool. - */ - @java.lang.Override - public boolean getFBool() { - return fBool_; - } - /** - * bool f_bool = 14; - * @param value The fBool to set. - * @return This builder for chaining. - */ - public Builder setFBool(boolean value) { - - fBool_ = value; - onChanged(); - return this; - } - /** - * bool f_bool = 14; - * @return This builder for chaining. - */ - public Builder clearFBool() { - - fBool_ = false; - onChanged(); - return this; - } - - private com.google.protobuf.ByteString fBytes_ = com.google.protobuf.ByteString.EMPTY; - /** - * bytes f_bytes = 15; - * @return The fBytes. - */ - @java.lang.Override - public com.google.protobuf.ByteString getFBytes() { - return fBytes_; - } - /** - * bytes f_bytes = 15; - * @param value The fBytes to set. - * @return This builder for chaining. - */ - public Builder setFBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - - fBytes_ = value; - onChanged(); - return this; - } - /** - * bytes f_bytes = 15; - * @return This builder for chaining. - */ - public Builder clearFBytes() { - - fBytes_ = getDefaultInstance().getFBytes(); - onChanged(); - return this; - } - - private int fKingdom_ = 0; - /** - * .google.showcase.v1beta1.ComplianceData.LifeKingdom f_kingdom = 22; - * @return The enum numeric value on the wire for fKingdom. - */ - @java.lang.Override public int getFKingdomValue() { - return fKingdom_; - } - /** - * .google.showcase.v1beta1.ComplianceData.LifeKingdom f_kingdom = 22; - * @param value The enum numeric value on the wire for fKingdom to set. - * @return This builder for chaining. - */ - public Builder setFKingdomValue(int value) { - - fKingdom_ = value; - onChanged(); - return this; - } - /** - * .google.showcase.v1beta1.ComplianceData.LifeKingdom f_kingdom = 22; - * @return The fKingdom. - */ - @java.lang.Override - public com.google.showcase.v1beta1.ComplianceData.LifeKingdom getFKingdom() { - @SuppressWarnings("deprecation") - com.google.showcase.v1beta1.ComplianceData.LifeKingdom result = com.google.showcase.v1beta1.ComplianceData.LifeKingdom.valueOf(fKingdom_); - return result == null ? com.google.showcase.v1beta1.ComplianceData.LifeKingdom.UNRECOGNIZED : result; - } - /** - * .google.showcase.v1beta1.ComplianceData.LifeKingdom f_kingdom = 22; - * @param value The fKingdom to set. - * @return This builder for chaining. - */ - public Builder setFKingdom(com.google.showcase.v1beta1.ComplianceData.LifeKingdom value) { - if (value == null) { - throw new NullPointerException(); - } - - fKingdom_ = value.getNumber(); - onChanged(); - return this; - } - /** - * .google.showcase.v1beta1.ComplianceData.LifeKingdom f_kingdom = 22; - * @return This builder for chaining. - */ - public Builder clearFKingdom() { - - fKingdom_ = 0; - onChanged(); - return this; - } - - private com.google.showcase.v1beta1.ComplianceDataChild fChild_; - private com.google.protobuf.SingleFieldBuilderV3< - com.google.showcase.v1beta1.ComplianceDataChild, com.google.showcase.v1beta1.ComplianceDataChild.Builder, com.google.showcase.v1beta1.ComplianceDataChildOrBuilder> fChildBuilder_; - /** - * .google.showcase.v1beta1.ComplianceDataChild f_child = 16; - * @return Whether the fChild field is set. - */ - public boolean hasFChild() { - return fChildBuilder_ != null || fChild_ != null; - } - /** - * .google.showcase.v1beta1.ComplianceDataChild f_child = 16; - * @return The fChild. - */ - public com.google.showcase.v1beta1.ComplianceDataChild getFChild() { - if (fChildBuilder_ == null) { - return fChild_ == null ? com.google.showcase.v1beta1.ComplianceDataChild.getDefaultInstance() : fChild_; - } else { - return fChildBuilder_.getMessage(); - } - } - /** - * .google.showcase.v1beta1.ComplianceDataChild f_child = 16; - */ - public Builder setFChild(com.google.showcase.v1beta1.ComplianceDataChild value) { - if (fChildBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - fChild_ = value; - onChanged(); - } else { - fChildBuilder_.setMessage(value); - } - - return this; - } - /** - * .google.showcase.v1beta1.ComplianceDataChild f_child = 16; - */ - public Builder setFChild( - com.google.showcase.v1beta1.ComplianceDataChild.Builder builderForValue) { - if (fChildBuilder_ == null) { - fChild_ = builderForValue.build(); - onChanged(); - } else { - fChildBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - * .google.showcase.v1beta1.ComplianceDataChild f_child = 16; - */ - public Builder mergeFChild(com.google.showcase.v1beta1.ComplianceDataChild value) { - if (fChildBuilder_ == null) { - if (fChild_ != null) { - fChild_ = - com.google.showcase.v1beta1.ComplianceDataChild.newBuilder(fChild_).mergeFrom(value).buildPartial(); - } else { - fChild_ = value; - } - onChanged(); - } else { - fChildBuilder_.mergeFrom(value); - } - - return this; - } - /** - * .google.showcase.v1beta1.ComplianceDataChild f_child = 16; - */ - public Builder clearFChild() { - if (fChildBuilder_ == null) { - fChild_ = null; - onChanged(); - } else { - fChild_ = null; - fChildBuilder_ = null; - } - - return this; - } - /** - * .google.showcase.v1beta1.ComplianceDataChild f_child = 16; - */ - public com.google.showcase.v1beta1.ComplianceDataChild.Builder getFChildBuilder() { - - onChanged(); - return getFChildFieldBuilder().getBuilder(); - } - /** - * .google.showcase.v1beta1.ComplianceDataChild f_child = 16; - */ - public com.google.showcase.v1beta1.ComplianceDataChildOrBuilder getFChildOrBuilder() { - if (fChildBuilder_ != null) { - return fChildBuilder_.getMessageOrBuilder(); - } else { - return fChild_ == null ? - com.google.showcase.v1beta1.ComplianceDataChild.getDefaultInstance() : fChild_; - } - } - /** - * .google.showcase.v1beta1.ComplianceDataChild f_child = 16; - */ - private com.google.protobuf.SingleFieldBuilderV3< - com.google.showcase.v1beta1.ComplianceDataChild, com.google.showcase.v1beta1.ComplianceDataChild.Builder, com.google.showcase.v1beta1.ComplianceDataChildOrBuilder> - getFChildFieldBuilder() { - if (fChildBuilder_ == null) { - fChildBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - com.google.showcase.v1beta1.ComplianceDataChild, com.google.showcase.v1beta1.ComplianceDataChild.Builder, com.google.showcase.v1beta1.ComplianceDataChildOrBuilder>( - getFChild(), - getParentForChildren(), - isClean()); - fChild_ = null; - } - return fChildBuilder_; - } - - private java.lang.Object pString_ = ""; - /** - * optional string p_string = 17; - * @return Whether the pString field is set. - */ - public boolean hasPString() { - return ((bitField0_ & 0x00000001) != 0); - } - /** - * optional string p_string = 17; - * @return The pString. - */ - public java.lang.String getPString() { - java.lang.Object ref = pString_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - pString_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * optional string p_string = 17; - * @return The bytes for pString. - */ - public com.google.protobuf.ByteString - getPStringBytes() { - java.lang.Object ref = pString_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - pString_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * optional string p_string = 17; - * @param value The pString to set. - * @return This builder for chaining. - */ - public Builder setPString( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - bitField0_ |= 0x00000001; - pString_ = value; - onChanged(); - return this; - } - /** - * optional string p_string = 17; - * @return This builder for chaining. - */ - public Builder clearPString() { - bitField0_ = (bitField0_ & ~0x00000001); - pString_ = getDefaultInstance().getPString(); - onChanged(); - return this; - } - /** - * optional string p_string = 17; - * @param value The bytes for pString to set. - * @return This builder for chaining. - */ - public Builder setPStringBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - bitField0_ |= 0x00000001; - pString_ = value; - onChanged(); - return this; - } - - private int pInt32_ ; - /** - * optional int32 p_int32 = 18; - * @return Whether the pInt32 field is set. - */ - @java.lang.Override - public boolean hasPInt32() { - return ((bitField0_ & 0x00000002) != 0); - } - /** - * optional int32 p_int32 = 18; - * @return The pInt32. - */ - @java.lang.Override - public int getPInt32() { - return pInt32_; - } - /** - * optional int32 p_int32 = 18; - * @param value The pInt32 to set. - * @return This builder for chaining. - */ - public Builder setPInt32(int value) { - bitField0_ |= 0x00000002; - pInt32_ = value; - onChanged(); - return this; - } - /** - * optional int32 p_int32 = 18; - * @return This builder for chaining. - */ - public Builder clearPInt32() { - bitField0_ = (bitField0_ & ~0x00000002); - pInt32_ = 0; - onChanged(); - return this; - } - - private double pDouble_ ; - /** - * optional double p_double = 19; - * @return Whether the pDouble field is set. - */ - @java.lang.Override - public boolean hasPDouble() { - return ((bitField0_ & 0x00000004) != 0); - } - /** - * optional double p_double = 19; - * @return The pDouble. - */ - @java.lang.Override - public double getPDouble() { - return pDouble_; - } - /** - * optional double p_double = 19; - * @param value The pDouble to set. - * @return This builder for chaining. - */ - public Builder setPDouble(double value) { - bitField0_ |= 0x00000004; - pDouble_ = value; - onChanged(); - return this; - } - /** - * optional double p_double = 19; - * @return This builder for chaining. - */ - public Builder clearPDouble() { - bitField0_ = (bitField0_ & ~0x00000004); - pDouble_ = 0D; - onChanged(); - return this; - } - - private boolean pBool_ ; - /** - * optional bool p_bool = 20; - * @return Whether the pBool field is set. - */ - @java.lang.Override - public boolean hasPBool() { - return ((bitField0_ & 0x00000008) != 0); - } - /** - * optional bool p_bool = 20; - * @return The pBool. - */ - @java.lang.Override - public boolean getPBool() { - return pBool_; - } - /** - * optional bool p_bool = 20; - * @param value The pBool to set. - * @return This builder for chaining. - */ - public Builder setPBool(boolean value) { - bitField0_ |= 0x00000008; - pBool_ = value; - onChanged(); - return this; - } - /** - * optional bool p_bool = 20; - * @return This builder for chaining. - */ - public Builder clearPBool() { - bitField0_ = (bitField0_ & ~0x00000008); - pBool_ = false; - onChanged(); - return this; - } - - private int pKingdom_ = 0; - /** - * optional .google.showcase.v1beta1.ComplianceData.LifeKingdom p_kingdom = 23; - * @return Whether the pKingdom field is set. - */ - @java.lang.Override public boolean hasPKingdom() { - return ((bitField0_ & 0x00000010) != 0); - } - /** - * optional .google.showcase.v1beta1.ComplianceData.LifeKingdom p_kingdom = 23; - * @return The enum numeric value on the wire for pKingdom. - */ - @java.lang.Override public int getPKingdomValue() { - return pKingdom_; - } - /** - * optional .google.showcase.v1beta1.ComplianceData.LifeKingdom p_kingdom = 23; - * @param value The enum numeric value on the wire for pKingdom to set. - * @return This builder for chaining. - */ - public Builder setPKingdomValue(int value) { - bitField0_ |= 0x00000010; - pKingdom_ = value; - onChanged(); - return this; - } - /** - * optional .google.showcase.v1beta1.ComplianceData.LifeKingdom p_kingdom = 23; - * @return The pKingdom. - */ - @java.lang.Override - public com.google.showcase.v1beta1.ComplianceData.LifeKingdom getPKingdom() { - @SuppressWarnings("deprecation") - com.google.showcase.v1beta1.ComplianceData.LifeKingdom result = com.google.showcase.v1beta1.ComplianceData.LifeKingdom.valueOf(pKingdom_); - return result == null ? com.google.showcase.v1beta1.ComplianceData.LifeKingdom.UNRECOGNIZED : result; - } - /** - * optional .google.showcase.v1beta1.ComplianceData.LifeKingdom p_kingdom = 23; - * @param value The pKingdom to set. - * @return This builder for chaining. - */ - public Builder setPKingdom(com.google.showcase.v1beta1.ComplianceData.LifeKingdom value) { - if (value == null) { - throw new NullPointerException(); - } - bitField0_ |= 0x00000010; - pKingdom_ = value.getNumber(); - onChanged(); - return this; - } - /** - * optional .google.showcase.v1beta1.ComplianceData.LifeKingdom p_kingdom = 23; - * @return This builder for chaining. - */ - public Builder clearPKingdom() { - bitField0_ = (bitField0_ & ~0x00000010); - pKingdom_ = 0; - onChanged(); - return this; - } - - private com.google.showcase.v1beta1.ComplianceDataChild pChild_; - private com.google.protobuf.SingleFieldBuilderV3< - com.google.showcase.v1beta1.ComplianceDataChild, com.google.showcase.v1beta1.ComplianceDataChild.Builder, com.google.showcase.v1beta1.ComplianceDataChildOrBuilder> pChildBuilder_; - /** - * optional .google.showcase.v1beta1.ComplianceDataChild p_child = 21; - * @return Whether the pChild field is set. - */ - public boolean hasPChild() { - return ((bitField0_ & 0x00000020) != 0); - } - /** - * optional .google.showcase.v1beta1.ComplianceDataChild p_child = 21; - * @return The pChild. - */ - public com.google.showcase.v1beta1.ComplianceDataChild getPChild() { - if (pChildBuilder_ == null) { - return pChild_ == null ? com.google.showcase.v1beta1.ComplianceDataChild.getDefaultInstance() : pChild_; - } else { - return pChildBuilder_.getMessage(); - } - } - /** - * optional .google.showcase.v1beta1.ComplianceDataChild p_child = 21; - */ - public Builder setPChild(com.google.showcase.v1beta1.ComplianceDataChild value) { - if (pChildBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - pChild_ = value; - onChanged(); - } else { - pChildBuilder_.setMessage(value); - } - bitField0_ |= 0x00000020; - return this; - } - /** - * optional .google.showcase.v1beta1.ComplianceDataChild p_child = 21; - */ - public Builder setPChild( - com.google.showcase.v1beta1.ComplianceDataChild.Builder builderForValue) { - if (pChildBuilder_ == null) { - pChild_ = builderForValue.build(); - onChanged(); - } else { - pChildBuilder_.setMessage(builderForValue.build()); - } - bitField0_ |= 0x00000020; - return this; - } - /** - * optional .google.showcase.v1beta1.ComplianceDataChild p_child = 21; - */ - public Builder mergePChild(com.google.showcase.v1beta1.ComplianceDataChild value) { - if (pChildBuilder_ == null) { - if (((bitField0_ & 0x00000020) != 0) && - pChild_ != null && - pChild_ != com.google.showcase.v1beta1.ComplianceDataChild.getDefaultInstance()) { - pChild_ = - com.google.showcase.v1beta1.ComplianceDataChild.newBuilder(pChild_).mergeFrom(value).buildPartial(); - } else { - pChild_ = value; - } - onChanged(); - } else { - pChildBuilder_.mergeFrom(value); - } - bitField0_ |= 0x00000020; - return this; - } - /** - * optional .google.showcase.v1beta1.ComplianceDataChild p_child = 21; - */ - public Builder clearPChild() { - if (pChildBuilder_ == null) { - pChild_ = null; - onChanged(); - } else { - pChildBuilder_.clear(); - } - bitField0_ = (bitField0_ & ~0x00000020); - return this; - } - /** - * optional .google.showcase.v1beta1.ComplianceDataChild p_child = 21; - */ - public com.google.showcase.v1beta1.ComplianceDataChild.Builder getPChildBuilder() { - bitField0_ |= 0x00000020; - onChanged(); - return getPChildFieldBuilder().getBuilder(); - } - /** - * optional .google.showcase.v1beta1.ComplianceDataChild p_child = 21; - */ - public com.google.showcase.v1beta1.ComplianceDataChildOrBuilder getPChildOrBuilder() { - if (pChildBuilder_ != null) { - return pChildBuilder_.getMessageOrBuilder(); - } else { - return pChild_ == null ? - com.google.showcase.v1beta1.ComplianceDataChild.getDefaultInstance() : pChild_; - } - } - /** - * optional .google.showcase.v1beta1.ComplianceDataChild p_child = 21; - */ - private com.google.protobuf.SingleFieldBuilderV3< - com.google.showcase.v1beta1.ComplianceDataChild, com.google.showcase.v1beta1.ComplianceDataChild.Builder, com.google.showcase.v1beta1.ComplianceDataChildOrBuilder> - getPChildFieldBuilder() { - if (pChildBuilder_ == null) { - pChildBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - com.google.showcase.v1beta1.ComplianceDataChild, com.google.showcase.v1beta1.ComplianceDataChild.Builder, com.google.showcase.v1beta1.ComplianceDataChildOrBuilder>( - getPChild(), - getParentForChildren(), - isClean()); - pChild_ = null; - } - return pChildBuilder_; - } - @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.showcase.v1beta1.ComplianceData) - } - - // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.ComplianceData) - private static final com.google.showcase.v1beta1.ComplianceData DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new com.google.showcase.v1beta1.ComplianceData(); - } - - public static com.google.showcase.v1beta1.ComplianceData getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public ComplianceData parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new ComplianceData(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public com.google.showcase.v1beta1.ComplianceData getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ComplianceDataChild.java b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ComplianceDataChild.java deleted file mode 100644 index 0533611a6a..0000000000 --- a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ComplianceDataChild.java +++ /dev/null @@ -1,1766 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: schema/google/showcase/v1beta1/compliance.proto - -package com.google.showcase.v1beta1; - -/** - * Protobuf type {@code google.showcase.v1beta1.ComplianceDataChild} - */ -public final class ComplianceDataChild extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.ComplianceDataChild) - ComplianceDataChildOrBuilder { -private static final long serialVersionUID = 0L; - // Use ComplianceDataChild.newBuilder() to construct. - private ComplianceDataChild(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private ComplianceDataChild() { - fString_ = ""; - fContinent_ = 0; - pString_ = ""; - pContinent_ = 0; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new ComplianceDataChild(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private ComplianceDataChild( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - int mutable_bitField0_ = 0; - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: { - java.lang.String s = input.readStringRequireUtf8(); - - fString_ = s; - break; - } - case 21: { - - fFloat_ = input.readFloat(); - break; - } - case 25: { - - fDouble_ = input.readDouble(); - break; - } - case 32: { - - fBool_ = input.readBool(); - break; - } - case 42: { - com.google.showcase.v1beta1.ComplianceDataGrandchild.Builder subBuilder = null; - if (fChild_ != null) { - subBuilder = fChild_.toBuilder(); - } - fChild_ = input.readMessage(com.google.showcase.v1beta1.ComplianceDataGrandchild.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(fChild_); - fChild_ = subBuilder.buildPartial(); - } - - break; - } - case 50: { - java.lang.String s = input.readStringRequireUtf8(); - bitField0_ |= 0x00000001; - pString_ = s; - break; - } - case 61: { - bitField0_ |= 0x00000002; - pFloat_ = input.readFloat(); - break; - } - case 65: { - bitField0_ |= 0x00000004; - pDouble_ = input.readDouble(); - break; - } - case 72: { - bitField0_ |= 0x00000008; - pBool_ = input.readBool(); - break; - } - case 82: { - com.google.showcase.v1beta1.ComplianceDataGrandchild.Builder subBuilder = null; - if (((bitField0_ & 0x00000010) != 0)) { - subBuilder = pChild_.toBuilder(); - } - pChild_ = input.readMessage(com.google.showcase.v1beta1.ComplianceDataGrandchild.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(pChild_); - pChild_ = subBuilder.buildPartial(); - } - bitField0_ |= 0x00000010; - break; - } - case 88: { - int rawValue = input.readEnum(); - - fContinent_ = rawValue; - break; - } - case 96: { - int rawValue = input.readEnum(); - - pContinent_ = rawValue; - break; - } - default: { - if (!parseUnknownField( - input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException( - e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.google.showcase.v1beta1.ComplianceOuterClass.internal_static_google_showcase_v1beta1_ComplianceDataChild_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.showcase.v1beta1.ComplianceOuterClass.internal_static_google_showcase_v1beta1_ComplianceDataChild_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.showcase.v1beta1.ComplianceDataChild.class, com.google.showcase.v1beta1.ComplianceDataChild.Builder.class); - } - - private int bitField0_; - public static final int F_STRING_FIELD_NUMBER = 1; - private volatile java.lang.Object fString_; - /** - * string f_string = 1; - * @return The fString. - */ - @java.lang.Override - public java.lang.String getFString() { - java.lang.Object ref = fString_; - 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(); - fString_ = s; - return s; - } - } - /** - * string f_string = 1; - * @return The bytes for fString. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getFStringBytes() { - java.lang.Object ref = fString_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - fString_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int F_FLOAT_FIELD_NUMBER = 2; - private float fFloat_; - /** - * float f_float = 2; - * @return The fFloat. - */ - @java.lang.Override - public float getFFloat() { - return fFloat_; - } - - public static final int F_DOUBLE_FIELD_NUMBER = 3; - private double fDouble_; - /** - * double f_double = 3; - * @return The fDouble. - */ - @java.lang.Override - public double getFDouble() { - return fDouble_; - } - - public static final int F_BOOL_FIELD_NUMBER = 4; - private boolean fBool_; - /** - * bool f_bool = 4; - * @return The fBool. - */ - @java.lang.Override - public boolean getFBool() { - return fBool_; - } - - public static final int F_CONTINENT_FIELD_NUMBER = 11; - private int fContinent_; - /** - * .google.showcase.v1beta1.Continent f_continent = 11; - * @return The enum numeric value on the wire for fContinent. - */ - @java.lang.Override public int getFContinentValue() { - return fContinent_; - } - /** - * .google.showcase.v1beta1.Continent f_continent = 11; - * @return The fContinent. - */ - @java.lang.Override public com.google.showcase.v1beta1.Continent getFContinent() { - @SuppressWarnings("deprecation") - com.google.showcase.v1beta1.Continent result = com.google.showcase.v1beta1.Continent.valueOf(fContinent_); - return result == null ? com.google.showcase.v1beta1.Continent.UNRECOGNIZED : result; - } - - public static final int F_CHILD_FIELD_NUMBER = 5; - private com.google.showcase.v1beta1.ComplianceDataGrandchild fChild_; - /** - * .google.showcase.v1beta1.ComplianceDataGrandchild f_child = 5; - * @return Whether the fChild field is set. - */ - @java.lang.Override - public boolean hasFChild() { - return fChild_ != null; - } - /** - * .google.showcase.v1beta1.ComplianceDataGrandchild f_child = 5; - * @return The fChild. - */ - @java.lang.Override - public com.google.showcase.v1beta1.ComplianceDataGrandchild getFChild() { - return fChild_ == null ? com.google.showcase.v1beta1.ComplianceDataGrandchild.getDefaultInstance() : fChild_; - } - /** - * .google.showcase.v1beta1.ComplianceDataGrandchild f_child = 5; - */ - @java.lang.Override - public com.google.showcase.v1beta1.ComplianceDataGrandchildOrBuilder getFChildOrBuilder() { - return getFChild(); - } - - public static final int P_STRING_FIELD_NUMBER = 6; - private volatile java.lang.Object pString_; - /** - * optional string p_string = 6; - * @return Whether the pString field is set. - */ - @java.lang.Override - public boolean hasPString() { - return ((bitField0_ & 0x00000001) != 0); - } - /** - * optional string p_string = 6; - * @return The pString. - */ - @java.lang.Override - public java.lang.String getPString() { - java.lang.Object ref = pString_; - 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(); - pString_ = s; - return s; - } - } - /** - * optional string p_string = 6; - * @return The bytes for pString. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getPStringBytes() { - java.lang.Object ref = pString_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - pString_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int P_FLOAT_FIELD_NUMBER = 7; - private float pFloat_; - /** - * optional float p_float = 7; - * @return Whether the pFloat field is set. - */ - @java.lang.Override - public boolean hasPFloat() { - return ((bitField0_ & 0x00000002) != 0); - } - /** - * optional float p_float = 7; - * @return The pFloat. - */ - @java.lang.Override - public float getPFloat() { - return pFloat_; - } - - public static final int P_DOUBLE_FIELD_NUMBER = 8; - private double pDouble_; - /** - * optional double p_double = 8; - * @return Whether the pDouble field is set. - */ - @java.lang.Override - public boolean hasPDouble() { - return ((bitField0_ & 0x00000004) != 0); - } - /** - * optional double p_double = 8; - * @return The pDouble. - */ - @java.lang.Override - public double getPDouble() { - return pDouble_; - } - - public static final int P_BOOL_FIELD_NUMBER = 9; - private boolean pBool_; - /** - * optional bool p_bool = 9; - * @return Whether the pBool field is set. - */ - @java.lang.Override - public boolean hasPBool() { - return ((bitField0_ & 0x00000008) != 0); - } - /** - * optional bool p_bool = 9; - * @return The pBool. - */ - @java.lang.Override - public boolean getPBool() { - return pBool_; - } - - public static final int P_CONTINENT_FIELD_NUMBER = 12; - private int pContinent_; - /** - * .google.showcase.v1beta1.Continent p_continent = 12; - * @return The enum numeric value on the wire for pContinent. - */ - @java.lang.Override public int getPContinentValue() { - return pContinent_; - } - /** - * .google.showcase.v1beta1.Continent p_continent = 12; - * @return The pContinent. - */ - @java.lang.Override public com.google.showcase.v1beta1.Continent getPContinent() { - @SuppressWarnings("deprecation") - com.google.showcase.v1beta1.Continent result = com.google.showcase.v1beta1.Continent.valueOf(pContinent_); - return result == null ? com.google.showcase.v1beta1.Continent.UNRECOGNIZED : result; - } - - public static final int P_CHILD_FIELD_NUMBER = 10; - private com.google.showcase.v1beta1.ComplianceDataGrandchild pChild_; - /** - * optional .google.showcase.v1beta1.ComplianceDataGrandchild p_child = 10; - * @return Whether the pChild field is set. - */ - @java.lang.Override - public boolean hasPChild() { - return ((bitField0_ & 0x00000010) != 0); - } - /** - * optional .google.showcase.v1beta1.ComplianceDataGrandchild p_child = 10; - * @return The pChild. - */ - @java.lang.Override - public com.google.showcase.v1beta1.ComplianceDataGrandchild getPChild() { - return pChild_ == null ? com.google.showcase.v1beta1.ComplianceDataGrandchild.getDefaultInstance() : pChild_; - } - /** - * optional .google.showcase.v1beta1.ComplianceDataGrandchild p_child = 10; - */ - @java.lang.Override - public com.google.showcase.v1beta1.ComplianceDataGrandchildOrBuilder getPChildOrBuilder() { - return pChild_ == null ? com.google.showcase.v1beta1.ComplianceDataGrandchild.getDefaultInstance() : pChild_; - } - - 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(fString_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, fString_); - } - if (java.lang.Float.floatToRawIntBits(fFloat_) != 0) { - output.writeFloat(2, fFloat_); - } - if (java.lang.Double.doubleToRawLongBits(fDouble_) != 0) { - output.writeDouble(3, fDouble_); - } - if (fBool_ != false) { - output.writeBool(4, fBool_); - } - if (fChild_ != null) { - output.writeMessage(5, getFChild()); - } - if (((bitField0_ & 0x00000001) != 0)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 6, pString_); - } - if (((bitField0_ & 0x00000002) != 0)) { - output.writeFloat(7, pFloat_); - } - if (((bitField0_ & 0x00000004) != 0)) { - output.writeDouble(8, pDouble_); - } - if (((bitField0_ & 0x00000008) != 0)) { - output.writeBool(9, pBool_); - } - if (((bitField0_ & 0x00000010) != 0)) { - output.writeMessage(10, getPChild()); - } - if (fContinent_ != com.google.showcase.v1beta1.Continent.CONTINENT_UNSPECIFIED.getNumber()) { - output.writeEnum(11, fContinent_); - } - if (pContinent_ != com.google.showcase.v1beta1.Continent.CONTINENT_UNSPECIFIED.getNumber()) { - output.writeEnum(12, pContinent_); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(fString_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, fString_); - } - if (java.lang.Float.floatToRawIntBits(fFloat_) != 0) { - size += com.google.protobuf.CodedOutputStream - .computeFloatSize(2, fFloat_); - } - if (java.lang.Double.doubleToRawLongBits(fDouble_) != 0) { - size += com.google.protobuf.CodedOutputStream - .computeDoubleSize(3, fDouble_); - } - if (fBool_ != false) { - size += com.google.protobuf.CodedOutputStream - .computeBoolSize(4, fBool_); - } - if (fChild_ != null) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(5, getFChild()); - } - if (((bitField0_ & 0x00000001) != 0)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(6, pString_); - } - if (((bitField0_ & 0x00000002) != 0)) { - size += com.google.protobuf.CodedOutputStream - .computeFloatSize(7, pFloat_); - } - if (((bitField0_ & 0x00000004) != 0)) { - size += com.google.protobuf.CodedOutputStream - .computeDoubleSize(8, pDouble_); - } - if (((bitField0_ & 0x00000008) != 0)) { - size += com.google.protobuf.CodedOutputStream - .computeBoolSize(9, pBool_); - } - if (((bitField0_ & 0x00000010) != 0)) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(10, getPChild()); - } - if (fContinent_ != com.google.showcase.v1beta1.Continent.CONTINENT_UNSPECIFIED.getNumber()) { - size += com.google.protobuf.CodedOutputStream - .computeEnumSize(11, fContinent_); - } - if (pContinent_ != com.google.showcase.v1beta1.Continent.CONTINENT_UNSPECIFIED.getNumber()) { - size += com.google.protobuf.CodedOutputStream - .computeEnumSize(12, pContinent_); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof com.google.showcase.v1beta1.ComplianceDataChild)) { - return super.equals(obj); - } - com.google.showcase.v1beta1.ComplianceDataChild other = (com.google.showcase.v1beta1.ComplianceDataChild) obj; - - if (!getFString() - .equals(other.getFString())) return false; - if (java.lang.Float.floatToIntBits(getFFloat()) - != java.lang.Float.floatToIntBits( - other.getFFloat())) return false; - if (java.lang.Double.doubleToLongBits(getFDouble()) - != java.lang.Double.doubleToLongBits( - other.getFDouble())) return false; - if (getFBool() - != other.getFBool()) return false; - if (fContinent_ != other.fContinent_) return false; - if (hasFChild() != other.hasFChild()) return false; - if (hasFChild()) { - if (!getFChild() - .equals(other.getFChild())) return false; - } - if (hasPString() != other.hasPString()) return false; - if (hasPString()) { - if (!getPString() - .equals(other.getPString())) return false; - } - if (hasPFloat() != other.hasPFloat()) return false; - if (hasPFloat()) { - if (java.lang.Float.floatToIntBits(getPFloat()) - != java.lang.Float.floatToIntBits( - other.getPFloat())) return false; - } - if (hasPDouble() != other.hasPDouble()) return false; - if (hasPDouble()) { - if (java.lang.Double.doubleToLongBits(getPDouble()) - != java.lang.Double.doubleToLongBits( - other.getPDouble())) return false; - } - if (hasPBool() != other.hasPBool()) return false; - if (hasPBool()) { - if (getPBool() - != other.getPBool()) return false; - } - if (pContinent_ != other.pContinent_) return false; - if (hasPChild() != other.hasPChild()) return false; - if (hasPChild()) { - if (!getPChild() - .equals(other.getPChild())) return false; - } - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - hash = (37 * hash) + F_STRING_FIELD_NUMBER; - hash = (53 * hash) + getFString().hashCode(); - hash = (37 * hash) + F_FLOAT_FIELD_NUMBER; - hash = (53 * hash) + java.lang.Float.floatToIntBits( - getFFloat()); - hash = (37 * hash) + F_DOUBLE_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashLong( - java.lang.Double.doubleToLongBits(getFDouble())); - hash = (37 * hash) + F_BOOL_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( - getFBool()); - hash = (37 * hash) + F_CONTINENT_FIELD_NUMBER; - hash = (53 * hash) + fContinent_; - if (hasFChild()) { - hash = (37 * hash) + F_CHILD_FIELD_NUMBER; - hash = (53 * hash) + getFChild().hashCode(); - } - if (hasPString()) { - hash = (37 * hash) + P_STRING_FIELD_NUMBER; - hash = (53 * hash) + getPString().hashCode(); - } - if (hasPFloat()) { - hash = (37 * hash) + P_FLOAT_FIELD_NUMBER; - hash = (53 * hash) + java.lang.Float.floatToIntBits( - getPFloat()); - } - if (hasPDouble()) { - hash = (37 * hash) + P_DOUBLE_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashLong( - java.lang.Double.doubleToLongBits(getPDouble())); - } - if (hasPBool()) { - hash = (37 * hash) + P_BOOL_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( - getPBool()); - } - hash = (37 * hash) + P_CONTINENT_FIELD_NUMBER; - hash = (53 * hash) + pContinent_; - if (hasPChild()) { - hash = (37 * hash) + P_CHILD_FIELD_NUMBER; - hash = (53 * hash) + getPChild().hashCode(); - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.showcase.v1beta1.ComplianceDataChild parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.showcase.v1beta1.ComplianceDataChild parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.showcase.v1beta1.ComplianceDataChild parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.showcase.v1beta1.ComplianceDataChild 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.showcase.v1beta1.ComplianceDataChild parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.showcase.v1beta1.ComplianceDataChild parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.showcase.v1beta1.ComplianceDataChild parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static com.google.showcase.v1beta1.ComplianceDataChild 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.showcase.v1beta1.ComplianceDataChild parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static com.google.showcase.v1beta1.ComplianceDataChild 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.showcase.v1beta1.ComplianceDataChild parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static com.google.showcase.v1beta1.ComplianceDataChild 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.showcase.v1beta1.ComplianceDataChild prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - @java.lang.Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - * Protobuf type {@code google.showcase.v1beta1.ComplianceDataChild} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.ComplianceDataChild) - com.google.showcase.v1beta1.ComplianceDataChildOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.google.showcase.v1beta1.ComplianceOuterClass.internal_static_google_showcase_v1beta1_ComplianceDataChild_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.showcase.v1beta1.ComplianceOuterClass.internal_static_google_showcase_v1beta1_ComplianceDataChild_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.showcase.v1beta1.ComplianceDataChild.class, com.google.showcase.v1beta1.ComplianceDataChild.Builder.class); - } - - // Construct using com.google.showcase.v1beta1.ComplianceDataChild.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { - getPChildFieldBuilder(); - } - } - @java.lang.Override - public Builder clear() { - super.clear(); - fString_ = ""; - - fFloat_ = 0F; - - fDouble_ = 0D; - - fBool_ = false; - - fContinent_ = 0; - - if (fChildBuilder_ == null) { - fChild_ = null; - } else { - fChild_ = null; - fChildBuilder_ = null; - } - pString_ = ""; - bitField0_ = (bitField0_ & ~0x00000001); - pFloat_ = 0F; - bitField0_ = (bitField0_ & ~0x00000002); - pDouble_ = 0D; - bitField0_ = (bitField0_ & ~0x00000004); - pBool_ = false; - bitField0_ = (bitField0_ & ~0x00000008); - pContinent_ = 0; - - if (pChildBuilder_ == null) { - pChild_ = null; - } else { - pChildBuilder_.clear(); - } - bitField0_ = (bitField0_ & ~0x00000010); - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return com.google.showcase.v1beta1.ComplianceOuterClass.internal_static_google_showcase_v1beta1_ComplianceDataChild_descriptor; - } - - @java.lang.Override - public com.google.showcase.v1beta1.ComplianceDataChild getDefaultInstanceForType() { - return com.google.showcase.v1beta1.ComplianceDataChild.getDefaultInstance(); - } - - @java.lang.Override - public com.google.showcase.v1beta1.ComplianceDataChild build() { - com.google.showcase.v1beta1.ComplianceDataChild result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.showcase.v1beta1.ComplianceDataChild buildPartial() { - com.google.showcase.v1beta1.ComplianceDataChild result = new com.google.showcase.v1beta1.ComplianceDataChild(this); - int from_bitField0_ = bitField0_; - int to_bitField0_ = 0; - result.fString_ = fString_; - result.fFloat_ = fFloat_; - result.fDouble_ = fDouble_; - result.fBool_ = fBool_; - result.fContinent_ = fContinent_; - if (fChildBuilder_ == null) { - result.fChild_ = fChild_; - } else { - result.fChild_ = fChildBuilder_.build(); - } - if (((from_bitField0_ & 0x00000001) != 0)) { - to_bitField0_ |= 0x00000001; - } - result.pString_ = pString_; - if (((from_bitField0_ & 0x00000002) != 0)) { - result.pFloat_ = pFloat_; - to_bitField0_ |= 0x00000002; - } - if (((from_bitField0_ & 0x00000004) != 0)) { - result.pDouble_ = pDouble_; - to_bitField0_ |= 0x00000004; - } - if (((from_bitField0_ & 0x00000008) != 0)) { - result.pBool_ = pBool_; - to_bitField0_ |= 0x00000008; - } - result.pContinent_ = pContinent_; - if (((from_bitField0_ & 0x00000010) != 0)) { - if (pChildBuilder_ == null) { - result.pChild_ = pChild_; - } else { - result.pChild_ = pChildBuilder_.build(); - } - to_bitField0_ |= 0x00000010; - } - result.bitField0_ = to_bitField0_; - 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.showcase.v1beta1.ComplianceDataChild) { - return mergeFrom((com.google.showcase.v1beta1.ComplianceDataChild)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.showcase.v1beta1.ComplianceDataChild other) { - if (other == com.google.showcase.v1beta1.ComplianceDataChild.getDefaultInstance()) return this; - if (!other.getFString().isEmpty()) { - fString_ = other.fString_; - onChanged(); - } - if (other.getFFloat() != 0F) { - setFFloat(other.getFFloat()); - } - if (other.getFDouble() != 0D) { - setFDouble(other.getFDouble()); - } - if (other.getFBool() != false) { - setFBool(other.getFBool()); - } - if (other.fContinent_ != 0) { - setFContinentValue(other.getFContinentValue()); - } - if (other.hasFChild()) { - mergeFChild(other.getFChild()); - } - if (other.hasPString()) { - bitField0_ |= 0x00000001; - pString_ = other.pString_; - onChanged(); - } - if (other.hasPFloat()) { - setPFloat(other.getPFloat()); - } - if (other.hasPDouble()) { - setPDouble(other.getPDouble()); - } - if (other.hasPBool()) { - setPBool(other.getPBool()); - } - if (other.pContinent_ != 0) { - setPContinentValue(other.getPContinentValue()); - } - if (other.hasPChild()) { - mergePChild(other.getPChild()); - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - com.google.showcase.v1beta1.ComplianceDataChild parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (com.google.showcase.v1beta1.ComplianceDataChild) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - private int bitField0_; - - private java.lang.Object fString_ = ""; - /** - * string f_string = 1; - * @return The fString. - */ - public java.lang.String getFString() { - java.lang.Object ref = fString_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - fString_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * string f_string = 1; - * @return The bytes for fString. - */ - public com.google.protobuf.ByteString - getFStringBytes() { - java.lang.Object ref = fString_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - fString_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * string f_string = 1; - * @param value The fString to set. - * @return This builder for chaining. - */ - public Builder setFString( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - fString_ = value; - onChanged(); - return this; - } - /** - * string f_string = 1; - * @return This builder for chaining. - */ - public Builder clearFString() { - - fString_ = getDefaultInstance().getFString(); - onChanged(); - return this; - } - /** - * string f_string = 1; - * @param value The bytes for fString to set. - * @return This builder for chaining. - */ - public Builder setFStringBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - fString_ = value; - onChanged(); - return this; - } - - private float fFloat_ ; - /** - * float f_float = 2; - * @return The fFloat. - */ - @java.lang.Override - public float getFFloat() { - return fFloat_; - } - /** - * float f_float = 2; - * @param value The fFloat to set. - * @return This builder for chaining. - */ - public Builder setFFloat(float value) { - - fFloat_ = value; - onChanged(); - return this; - } - /** - * float f_float = 2; - * @return This builder for chaining. - */ - public Builder clearFFloat() { - - fFloat_ = 0F; - onChanged(); - return this; - } - - private double fDouble_ ; - /** - * double f_double = 3; - * @return The fDouble. - */ - @java.lang.Override - public double getFDouble() { - return fDouble_; - } - /** - * double f_double = 3; - * @param value The fDouble to set. - * @return This builder for chaining. - */ - public Builder setFDouble(double value) { - - fDouble_ = value; - onChanged(); - return this; - } - /** - * double f_double = 3; - * @return This builder for chaining. - */ - public Builder clearFDouble() { - - fDouble_ = 0D; - onChanged(); - return this; - } - - private boolean fBool_ ; - /** - * bool f_bool = 4; - * @return The fBool. - */ - @java.lang.Override - public boolean getFBool() { - return fBool_; - } - /** - * bool f_bool = 4; - * @param value The fBool to set. - * @return This builder for chaining. - */ - public Builder setFBool(boolean value) { - - fBool_ = value; - onChanged(); - return this; - } - /** - * bool f_bool = 4; - * @return This builder for chaining. - */ - public Builder clearFBool() { - - fBool_ = false; - onChanged(); - return this; - } - - private int fContinent_ = 0; - /** - * .google.showcase.v1beta1.Continent f_continent = 11; - * @return The enum numeric value on the wire for fContinent. - */ - @java.lang.Override public int getFContinentValue() { - return fContinent_; - } - /** - * .google.showcase.v1beta1.Continent f_continent = 11; - * @param value The enum numeric value on the wire for fContinent to set. - * @return This builder for chaining. - */ - public Builder setFContinentValue(int value) { - - fContinent_ = value; - onChanged(); - return this; - } - /** - * .google.showcase.v1beta1.Continent f_continent = 11; - * @return The fContinent. - */ - @java.lang.Override - public com.google.showcase.v1beta1.Continent getFContinent() { - @SuppressWarnings("deprecation") - com.google.showcase.v1beta1.Continent result = com.google.showcase.v1beta1.Continent.valueOf(fContinent_); - return result == null ? com.google.showcase.v1beta1.Continent.UNRECOGNIZED : result; - } - /** - * .google.showcase.v1beta1.Continent f_continent = 11; - * @param value The fContinent to set. - * @return This builder for chaining. - */ - public Builder setFContinent(com.google.showcase.v1beta1.Continent value) { - if (value == null) { - throw new NullPointerException(); - } - - fContinent_ = value.getNumber(); - onChanged(); - return this; - } - /** - * .google.showcase.v1beta1.Continent f_continent = 11; - * @return This builder for chaining. - */ - public Builder clearFContinent() { - - fContinent_ = 0; - onChanged(); - return this; - } - - private com.google.showcase.v1beta1.ComplianceDataGrandchild fChild_; - private com.google.protobuf.SingleFieldBuilderV3< - com.google.showcase.v1beta1.ComplianceDataGrandchild, com.google.showcase.v1beta1.ComplianceDataGrandchild.Builder, com.google.showcase.v1beta1.ComplianceDataGrandchildOrBuilder> fChildBuilder_; - /** - * .google.showcase.v1beta1.ComplianceDataGrandchild f_child = 5; - * @return Whether the fChild field is set. - */ - public boolean hasFChild() { - return fChildBuilder_ != null || fChild_ != null; - } - /** - * .google.showcase.v1beta1.ComplianceDataGrandchild f_child = 5; - * @return The fChild. - */ - public com.google.showcase.v1beta1.ComplianceDataGrandchild getFChild() { - if (fChildBuilder_ == null) { - return fChild_ == null ? com.google.showcase.v1beta1.ComplianceDataGrandchild.getDefaultInstance() : fChild_; - } else { - return fChildBuilder_.getMessage(); - } - } - /** - * .google.showcase.v1beta1.ComplianceDataGrandchild f_child = 5; - */ - public Builder setFChild(com.google.showcase.v1beta1.ComplianceDataGrandchild value) { - if (fChildBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - fChild_ = value; - onChanged(); - } else { - fChildBuilder_.setMessage(value); - } - - return this; - } - /** - * .google.showcase.v1beta1.ComplianceDataGrandchild f_child = 5; - */ - public Builder setFChild( - com.google.showcase.v1beta1.ComplianceDataGrandchild.Builder builderForValue) { - if (fChildBuilder_ == null) { - fChild_ = builderForValue.build(); - onChanged(); - } else { - fChildBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - * .google.showcase.v1beta1.ComplianceDataGrandchild f_child = 5; - */ - public Builder mergeFChild(com.google.showcase.v1beta1.ComplianceDataGrandchild value) { - if (fChildBuilder_ == null) { - if (fChild_ != null) { - fChild_ = - com.google.showcase.v1beta1.ComplianceDataGrandchild.newBuilder(fChild_).mergeFrom(value).buildPartial(); - } else { - fChild_ = value; - } - onChanged(); - } else { - fChildBuilder_.mergeFrom(value); - } - - return this; - } - /** - * .google.showcase.v1beta1.ComplianceDataGrandchild f_child = 5; - */ - public Builder clearFChild() { - if (fChildBuilder_ == null) { - fChild_ = null; - onChanged(); - } else { - fChild_ = null; - fChildBuilder_ = null; - } - - return this; - } - /** - * .google.showcase.v1beta1.ComplianceDataGrandchild f_child = 5; - */ - public com.google.showcase.v1beta1.ComplianceDataGrandchild.Builder getFChildBuilder() { - - onChanged(); - return getFChildFieldBuilder().getBuilder(); - } - /** - * .google.showcase.v1beta1.ComplianceDataGrandchild f_child = 5; - */ - public com.google.showcase.v1beta1.ComplianceDataGrandchildOrBuilder getFChildOrBuilder() { - if (fChildBuilder_ != null) { - return fChildBuilder_.getMessageOrBuilder(); - } else { - return fChild_ == null ? - com.google.showcase.v1beta1.ComplianceDataGrandchild.getDefaultInstance() : fChild_; - } - } - /** - * .google.showcase.v1beta1.ComplianceDataGrandchild f_child = 5; - */ - private com.google.protobuf.SingleFieldBuilderV3< - com.google.showcase.v1beta1.ComplianceDataGrandchild, com.google.showcase.v1beta1.ComplianceDataGrandchild.Builder, com.google.showcase.v1beta1.ComplianceDataGrandchildOrBuilder> - getFChildFieldBuilder() { - if (fChildBuilder_ == null) { - fChildBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - com.google.showcase.v1beta1.ComplianceDataGrandchild, com.google.showcase.v1beta1.ComplianceDataGrandchild.Builder, com.google.showcase.v1beta1.ComplianceDataGrandchildOrBuilder>( - getFChild(), - getParentForChildren(), - isClean()); - fChild_ = null; - } - return fChildBuilder_; - } - - private java.lang.Object pString_ = ""; - /** - * optional string p_string = 6; - * @return Whether the pString field is set. - */ - public boolean hasPString() { - return ((bitField0_ & 0x00000001) != 0); - } - /** - * optional string p_string = 6; - * @return The pString. - */ - public java.lang.String getPString() { - java.lang.Object ref = pString_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - pString_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * optional string p_string = 6; - * @return The bytes for pString. - */ - public com.google.protobuf.ByteString - getPStringBytes() { - java.lang.Object ref = pString_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - pString_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * optional string p_string = 6; - * @param value The pString to set. - * @return This builder for chaining. - */ - public Builder setPString( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - bitField0_ |= 0x00000001; - pString_ = value; - onChanged(); - return this; - } - /** - * optional string p_string = 6; - * @return This builder for chaining. - */ - public Builder clearPString() { - bitField0_ = (bitField0_ & ~0x00000001); - pString_ = getDefaultInstance().getPString(); - onChanged(); - return this; - } - /** - * optional string p_string = 6; - * @param value The bytes for pString to set. - * @return This builder for chaining. - */ - public Builder setPStringBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - bitField0_ |= 0x00000001; - pString_ = value; - onChanged(); - return this; - } - - private float pFloat_ ; - /** - * optional float p_float = 7; - * @return Whether the pFloat field is set. - */ - @java.lang.Override - public boolean hasPFloat() { - return ((bitField0_ & 0x00000002) != 0); - } - /** - * optional float p_float = 7; - * @return The pFloat. - */ - @java.lang.Override - public float getPFloat() { - return pFloat_; - } - /** - * optional float p_float = 7; - * @param value The pFloat to set. - * @return This builder for chaining. - */ - public Builder setPFloat(float value) { - bitField0_ |= 0x00000002; - pFloat_ = value; - onChanged(); - return this; - } - /** - * optional float p_float = 7; - * @return This builder for chaining. - */ - public Builder clearPFloat() { - bitField0_ = (bitField0_ & ~0x00000002); - pFloat_ = 0F; - onChanged(); - return this; - } - - private double pDouble_ ; - /** - * optional double p_double = 8; - * @return Whether the pDouble field is set. - */ - @java.lang.Override - public boolean hasPDouble() { - return ((bitField0_ & 0x00000004) != 0); - } - /** - * optional double p_double = 8; - * @return The pDouble. - */ - @java.lang.Override - public double getPDouble() { - return pDouble_; - } - /** - * optional double p_double = 8; - * @param value The pDouble to set. - * @return This builder for chaining. - */ - public Builder setPDouble(double value) { - bitField0_ |= 0x00000004; - pDouble_ = value; - onChanged(); - return this; - } - /** - * optional double p_double = 8; - * @return This builder for chaining. - */ - public Builder clearPDouble() { - bitField0_ = (bitField0_ & ~0x00000004); - pDouble_ = 0D; - onChanged(); - return this; - } - - private boolean pBool_ ; - /** - * optional bool p_bool = 9; - * @return Whether the pBool field is set. - */ - @java.lang.Override - public boolean hasPBool() { - return ((bitField0_ & 0x00000008) != 0); - } - /** - * optional bool p_bool = 9; - * @return The pBool. - */ - @java.lang.Override - public boolean getPBool() { - return pBool_; - } - /** - * optional bool p_bool = 9; - * @param value The pBool to set. - * @return This builder for chaining. - */ - public Builder setPBool(boolean value) { - bitField0_ |= 0x00000008; - pBool_ = value; - onChanged(); - return this; - } - /** - * optional bool p_bool = 9; - * @return This builder for chaining. - */ - public Builder clearPBool() { - bitField0_ = (bitField0_ & ~0x00000008); - pBool_ = false; - onChanged(); - return this; - } - - private int pContinent_ = 0; - /** - * .google.showcase.v1beta1.Continent p_continent = 12; - * @return The enum numeric value on the wire for pContinent. - */ - @java.lang.Override public int getPContinentValue() { - return pContinent_; - } - /** - * .google.showcase.v1beta1.Continent p_continent = 12; - * @param value The enum numeric value on the wire for pContinent to set. - * @return This builder for chaining. - */ - public Builder setPContinentValue(int value) { - - pContinent_ = value; - onChanged(); - return this; - } - /** - * .google.showcase.v1beta1.Continent p_continent = 12; - * @return The pContinent. - */ - @java.lang.Override - public com.google.showcase.v1beta1.Continent getPContinent() { - @SuppressWarnings("deprecation") - com.google.showcase.v1beta1.Continent result = com.google.showcase.v1beta1.Continent.valueOf(pContinent_); - return result == null ? com.google.showcase.v1beta1.Continent.UNRECOGNIZED : result; - } - /** - * .google.showcase.v1beta1.Continent p_continent = 12; - * @param value The pContinent to set. - * @return This builder for chaining. - */ - public Builder setPContinent(com.google.showcase.v1beta1.Continent value) { - if (value == null) { - throw new NullPointerException(); - } - - pContinent_ = value.getNumber(); - onChanged(); - return this; - } - /** - * .google.showcase.v1beta1.Continent p_continent = 12; - * @return This builder for chaining. - */ - public Builder clearPContinent() { - - pContinent_ = 0; - onChanged(); - return this; - } - - private com.google.showcase.v1beta1.ComplianceDataGrandchild pChild_; - private com.google.protobuf.SingleFieldBuilderV3< - com.google.showcase.v1beta1.ComplianceDataGrandchild, com.google.showcase.v1beta1.ComplianceDataGrandchild.Builder, com.google.showcase.v1beta1.ComplianceDataGrandchildOrBuilder> pChildBuilder_; - /** - * optional .google.showcase.v1beta1.ComplianceDataGrandchild p_child = 10; - * @return Whether the pChild field is set. - */ - public boolean hasPChild() { - return ((bitField0_ & 0x00000010) != 0); - } - /** - * optional .google.showcase.v1beta1.ComplianceDataGrandchild p_child = 10; - * @return The pChild. - */ - public com.google.showcase.v1beta1.ComplianceDataGrandchild getPChild() { - if (pChildBuilder_ == null) { - return pChild_ == null ? com.google.showcase.v1beta1.ComplianceDataGrandchild.getDefaultInstance() : pChild_; - } else { - return pChildBuilder_.getMessage(); - } - } - /** - * optional .google.showcase.v1beta1.ComplianceDataGrandchild p_child = 10; - */ - public Builder setPChild(com.google.showcase.v1beta1.ComplianceDataGrandchild value) { - if (pChildBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - pChild_ = value; - onChanged(); - } else { - pChildBuilder_.setMessage(value); - } - bitField0_ |= 0x00000010; - return this; - } - /** - * optional .google.showcase.v1beta1.ComplianceDataGrandchild p_child = 10; - */ - public Builder setPChild( - com.google.showcase.v1beta1.ComplianceDataGrandchild.Builder builderForValue) { - if (pChildBuilder_ == null) { - pChild_ = builderForValue.build(); - onChanged(); - } else { - pChildBuilder_.setMessage(builderForValue.build()); - } - bitField0_ |= 0x00000010; - return this; - } - /** - * optional .google.showcase.v1beta1.ComplianceDataGrandchild p_child = 10; - */ - public Builder mergePChild(com.google.showcase.v1beta1.ComplianceDataGrandchild value) { - if (pChildBuilder_ == null) { - if (((bitField0_ & 0x00000010) != 0) && - pChild_ != null && - pChild_ != com.google.showcase.v1beta1.ComplianceDataGrandchild.getDefaultInstance()) { - pChild_ = - com.google.showcase.v1beta1.ComplianceDataGrandchild.newBuilder(pChild_).mergeFrom(value).buildPartial(); - } else { - pChild_ = value; - } - onChanged(); - } else { - pChildBuilder_.mergeFrom(value); - } - bitField0_ |= 0x00000010; - return this; - } - /** - * optional .google.showcase.v1beta1.ComplianceDataGrandchild p_child = 10; - */ - public Builder clearPChild() { - if (pChildBuilder_ == null) { - pChild_ = null; - onChanged(); - } else { - pChildBuilder_.clear(); - } - bitField0_ = (bitField0_ & ~0x00000010); - return this; - } - /** - * optional .google.showcase.v1beta1.ComplianceDataGrandchild p_child = 10; - */ - public com.google.showcase.v1beta1.ComplianceDataGrandchild.Builder getPChildBuilder() { - bitField0_ |= 0x00000010; - onChanged(); - return getPChildFieldBuilder().getBuilder(); - } - /** - * optional .google.showcase.v1beta1.ComplianceDataGrandchild p_child = 10; - */ - public com.google.showcase.v1beta1.ComplianceDataGrandchildOrBuilder getPChildOrBuilder() { - if (pChildBuilder_ != null) { - return pChildBuilder_.getMessageOrBuilder(); - } else { - return pChild_ == null ? - com.google.showcase.v1beta1.ComplianceDataGrandchild.getDefaultInstance() : pChild_; - } - } - /** - * optional .google.showcase.v1beta1.ComplianceDataGrandchild p_child = 10; - */ - private com.google.protobuf.SingleFieldBuilderV3< - com.google.showcase.v1beta1.ComplianceDataGrandchild, com.google.showcase.v1beta1.ComplianceDataGrandchild.Builder, com.google.showcase.v1beta1.ComplianceDataGrandchildOrBuilder> - getPChildFieldBuilder() { - if (pChildBuilder_ == null) { - pChildBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - com.google.showcase.v1beta1.ComplianceDataGrandchild, com.google.showcase.v1beta1.ComplianceDataGrandchild.Builder, com.google.showcase.v1beta1.ComplianceDataGrandchildOrBuilder>( - getPChild(), - getParentForChildren(), - isClean()); - pChild_ = null; - } - return pChildBuilder_; - } - @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.showcase.v1beta1.ComplianceDataChild) - } - - // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.ComplianceDataChild) - private static final com.google.showcase.v1beta1.ComplianceDataChild DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new com.google.showcase.v1beta1.ComplianceDataChild(); - } - - public static com.google.showcase.v1beta1.ComplianceDataChild getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public ComplianceDataChild parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new ComplianceDataChild(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public com.google.showcase.v1beta1.ComplianceDataChild getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ComplianceDataChildOrBuilder.java b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ComplianceDataChildOrBuilder.java deleted file mode 100644 index d5b30a7ccc..0000000000 --- a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ComplianceDataChildOrBuilder.java +++ /dev/null @@ -1,141 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: schema/google/showcase/v1beta1/compliance.proto - -package com.google.showcase.v1beta1; - -public interface ComplianceDataChildOrBuilder extends - // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.ComplianceDataChild) - com.google.protobuf.MessageOrBuilder { - - /** - * string f_string = 1; - * @return The fString. - */ - java.lang.String getFString(); - /** - * string f_string = 1; - * @return The bytes for fString. - */ - com.google.protobuf.ByteString - getFStringBytes(); - - /** - * float f_float = 2; - * @return The fFloat. - */ - float getFFloat(); - - /** - * double f_double = 3; - * @return The fDouble. - */ - double getFDouble(); - - /** - * bool f_bool = 4; - * @return The fBool. - */ - boolean getFBool(); - - /** - * .google.showcase.v1beta1.Continent f_continent = 11; - * @return The enum numeric value on the wire for fContinent. - */ - int getFContinentValue(); - /** - * .google.showcase.v1beta1.Continent f_continent = 11; - * @return The fContinent. - */ - com.google.showcase.v1beta1.Continent getFContinent(); - - /** - * .google.showcase.v1beta1.ComplianceDataGrandchild f_child = 5; - * @return Whether the fChild field is set. - */ - boolean hasFChild(); - /** - * .google.showcase.v1beta1.ComplianceDataGrandchild f_child = 5; - * @return The fChild. - */ - com.google.showcase.v1beta1.ComplianceDataGrandchild getFChild(); - /** - * .google.showcase.v1beta1.ComplianceDataGrandchild f_child = 5; - */ - com.google.showcase.v1beta1.ComplianceDataGrandchildOrBuilder getFChildOrBuilder(); - - /** - * optional string p_string = 6; - * @return Whether the pString field is set. - */ - boolean hasPString(); - /** - * optional string p_string = 6; - * @return The pString. - */ - java.lang.String getPString(); - /** - * optional string p_string = 6; - * @return The bytes for pString. - */ - com.google.protobuf.ByteString - getPStringBytes(); - - /** - * optional float p_float = 7; - * @return Whether the pFloat field is set. - */ - boolean hasPFloat(); - /** - * optional float p_float = 7; - * @return The pFloat. - */ - float getPFloat(); - - /** - * optional double p_double = 8; - * @return Whether the pDouble field is set. - */ - boolean hasPDouble(); - /** - * optional double p_double = 8; - * @return The pDouble. - */ - double getPDouble(); - - /** - * optional bool p_bool = 9; - * @return Whether the pBool field is set. - */ - boolean hasPBool(); - /** - * optional bool p_bool = 9; - * @return The pBool. - */ - boolean getPBool(); - - /** - * .google.showcase.v1beta1.Continent p_continent = 12; - * @return The enum numeric value on the wire for pContinent. - */ - int getPContinentValue(); - /** - * .google.showcase.v1beta1.Continent p_continent = 12; - * @return The pContinent. - */ - com.google.showcase.v1beta1.Continent getPContinent(); - - /** - * optional .google.showcase.v1beta1.ComplianceDataGrandchild p_child = 10; - * @return Whether the pChild field is set. - */ - boolean hasPChild(); - /** - * optional .google.showcase.v1beta1.ComplianceDataGrandchild p_child = 10; - * @return The pChild. - */ - com.google.showcase.v1beta1.ComplianceDataGrandchild getPChild(); - /** - * optional .google.showcase.v1beta1.ComplianceDataGrandchild p_child = 10; - */ - com.google.showcase.v1beta1.ComplianceDataGrandchildOrBuilder getPChildOrBuilder(); -} diff --git a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ComplianceDataGrandchild.java b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ComplianceDataGrandchild.java deleted file mode 100644 index 87d2d1ab6c..0000000000 --- a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ComplianceDataGrandchild.java +++ /dev/null @@ -1,690 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: schema/google/showcase/v1beta1/compliance.proto - -package com.google.showcase.v1beta1; - -/** - * Protobuf type {@code google.showcase.v1beta1.ComplianceDataGrandchild} - */ -public final class ComplianceDataGrandchild extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.ComplianceDataGrandchild) - ComplianceDataGrandchildOrBuilder { -private static final long serialVersionUID = 0L; - // Use ComplianceDataGrandchild.newBuilder() to construct. - private ComplianceDataGrandchild(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private ComplianceDataGrandchild() { - fString_ = ""; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new ComplianceDataGrandchild(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private ComplianceDataGrandchild( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: { - java.lang.String s = input.readStringRequireUtf8(); - - fString_ = s; - break; - } - case 17: { - - fDouble_ = input.readDouble(); - break; - } - case 24: { - - fBool_ = input.readBool(); - break; - } - default: { - if (!parseUnknownField( - input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException( - e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.google.showcase.v1beta1.ComplianceOuterClass.internal_static_google_showcase_v1beta1_ComplianceDataGrandchild_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.showcase.v1beta1.ComplianceOuterClass.internal_static_google_showcase_v1beta1_ComplianceDataGrandchild_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.showcase.v1beta1.ComplianceDataGrandchild.class, com.google.showcase.v1beta1.ComplianceDataGrandchild.Builder.class); - } - - public static final int F_STRING_FIELD_NUMBER = 1; - private volatile java.lang.Object fString_; - /** - * string f_string = 1; - * @return The fString. - */ - @java.lang.Override - public java.lang.String getFString() { - java.lang.Object ref = fString_; - 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(); - fString_ = s; - return s; - } - } - /** - * string f_string = 1; - * @return The bytes for fString. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getFStringBytes() { - java.lang.Object ref = fString_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - fString_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int F_DOUBLE_FIELD_NUMBER = 2; - private double fDouble_; - /** - * double f_double = 2; - * @return The fDouble. - */ - @java.lang.Override - public double getFDouble() { - return fDouble_; - } - - public static final int F_BOOL_FIELD_NUMBER = 3; - private boolean fBool_; - /** - * bool f_bool = 3; - * @return The fBool. - */ - @java.lang.Override - public boolean getFBool() { - return fBool_; - } - - 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(fString_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, fString_); - } - if (java.lang.Double.doubleToRawLongBits(fDouble_) != 0) { - output.writeDouble(2, fDouble_); - } - if (fBool_ != false) { - output.writeBool(3, fBool_); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(fString_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, fString_); - } - if (java.lang.Double.doubleToRawLongBits(fDouble_) != 0) { - size += com.google.protobuf.CodedOutputStream - .computeDoubleSize(2, fDouble_); - } - if (fBool_ != false) { - size += com.google.protobuf.CodedOutputStream - .computeBoolSize(3, fBool_); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof com.google.showcase.v1beta1.ComplianceDataGrandchild)) { - return super.equals(obj); - } - com.google.showcase.v1beta1.ComplianceDataGrandchild other = (com.google.showcase.v1beta1.ComplianceDataGrandchild) obj; - - if (!getFString() - .equals(other.getFString())) return false; - if (java.lang.Double.doubleToLongBits(getFDouble()) - != java.lang.Double.doubleToLongBits( - other.getFDouble())) return false; - if (getFBool() - != other.getFBool()) return false; - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - hash = (37 * hash) + F_STRING_FIELD_NUMBER; - hash = (53 * hash) + getFString().hashCode(); - hash = (37 * hash) + F_DOUBLE_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashLong( - java.lang.Double.doubleToLongBits(getFDouble())); - hash = (37 * hash) + F_BOOL_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( - getFBool()); - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.showcase.v1beta1.ComplianceDataGrandchild parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.showcase.v1beta1.ComplianceDataGrandchild parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.showcase.v1beta1.ComplianceDataGrandchild parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.showcase.v1beta1.ComplianceDataGrandchild 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.showcase.v1beta1.ComplianceDataGrandchild parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.showcase.v1beta1.ComplianceDataGrandchild parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.showcase.v1beta1.ComplianceDataGrandchild parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static com.google.showcase.v1beta1.ComplianceDataGrandchild 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.showcase.v1beta1.ComplianceDataGrandchild parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static com.google.showcase.v1beta1.ComplianceDataGrandchild 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.showcase.v1beta1.ComplianceDataGrandchild parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static com.google.showcase.v1beta1.ComplianceDataGrandchild 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.showcase.v1beta1.ComplianceDataGrandchild prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - @java.lang.Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - * Protobuf type {@code google.showcase.v1beta1.ComplianceDataGrandchild} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.ComplianceDataGrandchild) - com.google.showcase.v1beta1.ComplianceDataGrandchildOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.google.showcase.v1beta1.ComplianceOuterClass.internal_static_google_showcase_v1beta1_ComplianceDataGrandchild_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.showcase.v1beta1.ComplianceOuterClass.internal_static_google_showcase_v1beta1_ComplianceDataGrandchild_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.showcase.v1beta1.ComplianceDataGrandchild.class, com.google.showcase.v1beta1.ComplianceDataGrandchild.Builder.class); - } - - // Construct using com.google.showcase.v1beta1.ComplianceDataGrandchild.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { - } - } - @java.lang.Override - public Builder clear() { - super.clear(); - fString_ = ""; - - fDouble_ = 0D; - - fBool_ = false; - - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return com.google.showcase.v1beta1.ComplianceOuterClass.internal_static_google_showcase_v1beta1_ComplianceDataGrandchild_descriptor; - } - - @java.lang.Override - public com.google.showcase.v1beta1.ComplianceDataGrandchild getDefaultInstanceForType() { - return com.google.showcase.v1beta1.ComplianceDataGrandchild.getDefaultInstance(); - } - - @java.lang.Override - public com.google.showcase.v1beta1.ComplianceDataGrandchild build() { - com.google.showcase.v1beta1.ComplianceDataGrandchild result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.showcase.v1beta1.ComplianceDataGrandchild buildPartial() { - com.google.showcase.v1beta1.ComplianceDataGrandchild result = new com.google.showcase.v1beta1.ComplianceDataGrandchild(this); - result.fString_ = fString_; - result.fDouble_ = fDouble_; - result.fBool_ = fBool_; - 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.showcase.v1beta1.ComplianceDataGrandchild) { - return mergeFrom((com.google.showcase.v1beta1.ComplianceDataGrandchild)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.showcase.v1beta1.ComplianceDataGrandchild other) { - if (other == com.google.showcase.v1beta1.ComplianceDataGrandchild.getDefaultInstance()) return this; - if (!other.getFString().isEmpty()) { - fString_ = other.fString_; - onChanged(); - } - if (other.getFDouble() != 0D) { - setFDouble(other.getFDouble()); - } - if (other.getFBool() != false) { - setFBool(other.getFBool()); - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - com.google.showcase.v1beta1.ComplianceDataGrandchild parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (com.google.showcase.v1beta1.ComplianceDataGrandchild) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private java.lang.Object fString_ = ""; - /** - * string f_string = 1; - * @return The fString. - */ - public java.lang.String getFString() { - java.lang.Object ref = fString_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - fString_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * string f_string = 1; - * @return The bytes for fString. - */ - public com.google.protobuf.ByteString - getFStringBytes() { - java.lang.Object ref = fString_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - fString_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * string f_string = 1; - * @param value The fString to set. - * @return This builder for chaining. - */ - public Builder setFString( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - fString_ = value; - onChanged(); - return this; - } - /** - * string f_string = 1; - * @return This builder for chaining. - */ - public Builder clearFString() { - - fString_ = getDefaultInstance().getFString(); - onChanged(); - return this; - } - /** - * string f_string = 1; - * @param value The bytes for fString to set. - * @return This builder for chaining. - */ - public Builder setFStringBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - fString_ = value; - onChanged(); - return this; - } - - private double fDouble_ ; - /** - * double f_double = 2; - * @return The fDouble. - */ - @java.lang.Override - public double getFDouble() { - return fDouble_; - } - /** - * double f_double = 2; - * @param value The fDouble to set. - * @return This builder for chaining. - */ - public Builder setFDouble(double value) { - - fDouble_ = value; - onChanged(); - return this; - } - /** - * double f_double = 2; - * @return This builder for chaining. - */ - public Builder clearFDouble() { - - fDouble_ = 0D; - onChanged(); - return this; - } - - private boolean fBool_ ; - /** - * bool f_bool = 3; - * @return The fBool. - */ - @java.lang.Override - public boolean getFBool() { - return fBool_; - } - /** - * bool f_bool = 3; - * @param value The fBool to set. - * @return This builder for chaining. - */ - public Builder setFBool(boolean value) { - - fBool_ = value; - onChanged(); - return this; - } - /** - * bool f_bool = 3; - * @return This builder for chaining. - */ - public Builder clearFBool() { - - fBool_ = 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.showcase.v1beta1.ComplianceDataGrandchild) - } - - // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.ComplianceDataGrandchild) - private static final com.google.showcase.v1beta1.ComplianceDataGrandchild DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new com.google.showcase.v1beta1.ComplianceDataGrandchild(); - } - - public static com.google.showcase.v1beta1.ComplianceDataGrandchild getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public ComplianceDataGrandchild parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new ComplianceDataGrandchild(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public com.google.showcase.v1beta1.ComplianceDataGrandchild getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ComplianceDataGrandchildOrBuilder.java b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ComplianceDataGrandchildOrBuilder.java deleted file mode 100644 index a18fa786f0..0000000000 --- a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ComplianceDataGrandchildOrBuilder.java +++ /dev/null @@ -1,33 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: schema/google/showcase/v1beta1/compliance.proto - -package com.google.showcase.v1beta1; - -public interface ComplianceDataGrandchildOrBuilder extends - // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.ComplianceDataGrandchild) - com.google.protobuf.MessageOrBuilder { - - /** - * string f_string = 1; - * @return The fString. - */ - java.lang.String getFString(); - /** - * string f_string = 1; - * @return The bytes for fString. - */ - com.google.protobuf.ByteString - getFStringBytes(); - - /** - * double f_double = 2; - * @return The fDouble. - */ - double getFDouble(); - - /** - * bool f_bool = 3; - * @return The fBool. - */ - boolean getFBool(); -} diff --git a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ComplianceDataOrBuilder.java b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ComplianceDataOrBuilder.java deleted file mode 100644 index 82dfdf52ab..0000000000 --- a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ComplianceDataOrBuilder.java +++ /dev/null @@ -1,212 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: schema/google/showcase/v1beta1/compliance.proto - -package com.google.showcase.v1beta1; - -public interface ComplianceDataOrBuilder extends - // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.ComplianceData) - com.google.protobuf.MessageOrBuilder { - - /** - * string f_string = 1; - * @return The fString. - */ - java.lang.String getFString(); - /** - * string f_string = 1; - * @return The bytes for fString. - */ - com.google.protobuf.ByteString - getFStringBytes(); - - /** - * int32 f_int32 = 2; - * @return The fInt32. - */ - int getFInt32(); - - /** - * sint32 f_sint32 = 3; - * @return The fSint32. - */ - int getFSint32(); - - /** - * sfixed32 f_sfixed32 = 4; - * @return The fSfixed32. - */ - int getFSfixed32(); - - /** - * uint32 f_uint32 = 5; - * @return The fUint32. - */ - int getFUint32(); - - /** - * fixed32 f_fixed32 = 6; - * @return The fFixed32. - */ - int getFFixed32(); - - /** - * int64 f_int64 = 7; - * @return The fInt64. - */ - long getFInt64(); - - /** - * sint64 f_sint64 = 8; - * @return The fSint64. - */ - long getFSint64(); - - /** - * sfixed64 f_sfixed64 = 9; - * @return The fSfixed64. - */ - long getFSfixed64(); - - /** - * uint64 f_uint64 = 10; - * @return The fUint64. - */ - long getFUint64(); - - /** - * fixed64 f_fixed64 = 11; - * @return The fFixed64. - */ - long getFFixed64(); - - /** - * double f_double = 12; - * @return The fDouble. - */ - double getFDouble(); - - /** - * float f_float = 13; - * @return The fFloat. - */ - float getFFloat(); - - /** - * bool f_bool = 14; - * @return The fBool. - */ - boolean getFBool(); - - /** - * bytes f_bytes = 15; - * @return The fBytes. - */ - com.google.protobuf.ByteString getFBytes(); - - /** - * .google.showcase.v1beta1.ComplianceData.LifeKingdom f_kingdom = 22; - * @return The enum numeric value on the wire for fKingdom. - */ - int getFKingdomValue(); - /** - * .google.showcase.v1beta1.ComplianceData.LifeKingdom f_kingdom = 22; - * @return The fKingdom. - */ - com.google.showcase.v1beta1.ComplianceData.LifeKingdom getFKingdom(); - - /** - * .google.showcase.v1beta1.ComplianceDataChild f_child = 16; - * @return Whether the fChild field is set. - */ - boolean hasFChild(); - /** - * .google.showcase.v1beta1.ComplianceDataChild f_child = 16; - * @return The fChild. - */ - com.google.showcase.v1beta1.ComplianceDataChild getFChild(); - /** - * .google.showcase.v1beta1.ComplianceDataChild f_child = 16; - */ - com.google.showcase.v1beta1.ComplianceDataChildOrBuilder getFChildOrBuilder(); - - /** - * optional string p_string = 17; - * @return Whether the pString field is set. - */ - boolean hasPString(); - /** - * optional string p_string = 17; - * @return The pString. - */ - java.lang.String getPString(); - /** - * optional string p_string = 17; - * @return The bytes for pString. - */ - com.google.protobuf.ByteString - getPStringBytes(); - - /** - * optional int32 p_int32 = 18; - * @return Whether the pInt32 field is set. - */ - boolean hasPInt32(); - /** - * optional int32 p_int32 = 18; - * @return The pInt32. - */ - int getPInt32(); - - /** - * optional double p_double = 19; - * @return Whether the pDouble field is set. - */ - boolean hasPDouble(); - /** - * optional double p_double = 19; - * @return The pDouble. - */ - double getPDouble(); - - /** - * optional bool p_bool = 20; - * @return Whether the pBool field is set. - */ - boolean hasPBool(); - /** - * optional bool p_bool = 20; - * @return The pBool. - */ - boolean getPBool(); - - /** - * optional .google.showcase.v1beta1.ComplianceData.LifeKingdom p_kingdom = 23; - * @return Whether the pKingdom field is set. - */ - boolean hasPKingdom(); - /** - * optional .google.showcase.v1beta1.ComplianceData.LifeKingdom p_kingdom = 23; - * @return The enum numeric value on the wire for pKingdom. - */ - int getPKingdomValue(); - /** - * optional .google.showcase.v1beta1.ComplianceData.LifeKingdom p_kingdom = 23; - * @return The pKingdom. - */ - com.google.showcase.v1beta1.ComplianceData.LifeKingdom getPKingdom(); - - /** - * optional .google.showcase.v1beta1.ComplianceDataChild p_child = 21; - * @return Whether the pChild field is set. - */ - boolean hasPChild(); - /** - * optional .google.showcase.v1beta1.ComplianceDataChild p_child = 21; - * @return The pChild. - */ - com.google.showcase.v1beta1.ComplianceDataChild getPChild(); - /** - * optional .google.showcase.v1beta1.ComplianceDataChild p_child = 21; - */ - com.google.showcase.v1beta1.ComplianceDataChildOrBuilder getPChildOrBuilder(); -} diff --git a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ComplianceGroup.java b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ComplianceGroup.java deleted file mode 100644 index 05bf124570..0000000000 --- a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ComplianceGroup.java +++ /dev/null @@ -1,1114 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: schema/google/showcase/v1beta1/compliance.proto - -package com.google.showcase.v1beta1; - -/** - *
        - * ComplianceGroups encapsulates a group of RPC requests to the Compliance
        - * server: one request for each combination of elements of `rpcs` and of
        - * `requests`.
        - * 
        - * - * Protobuf type {@code google.showcase.v1beta1.ComplianceGroup} - */ -public final class ComplianceGroup extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.ComplianceGroup) - ComplianceGroupOrBuilder { -private static final long serialVersionUID = 0L; - // Use ComplianceGroup.newBuilder() to construct. - private ComplianceGroup(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private ComplianceGroup() { - name_ = ""; - rpcs_ = com.google.protobuf.LazyStringArrayList.EMPTY; - requests_ = java.util.Collections.emptyList(); - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new ComplianceGroup(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private ComplianceGroup( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - int mutable_bitField0_ = 0; - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: { - java.lang.String s = input.readStringRequireUtf8(); - - name_ = s; - break; - } - case 18: { - java.lang.String s = input.readStringRequireUtf8(); - if (!((mutable_bitField0_ & 0x00000001) != 0)) { - rpcs_ = new com.google.protobuf.LazyStringArrayList(); - mutable_bitField0_ |= 0x00000001; - } - rpcs_.add(s); - break; - } - case 26: { - if (!((mutable_bitField0_ & 0x00000002) != 0)) { - requests_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000002; - } - requests_.add( - input.readMessage(com.google.showcase.v1beta1.RepeatRequest.parser(), extensionRegistry)); - break; - } - default: { - if (!parseUnknownField( - input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException( - e).setUnfinishedMessage(this); - } finally { - if (((mutable_bitField0_ & 0x00000001) != 0)) { - rpcs_ = rpcs_.getUnmodifiableView(); - } - if (((mutable_bitField0_ & 0x00000002) != 0)) { - requests_ = java.util.Collections.unmodifiableList(requests_); - } - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.google.showcase.v1beta1.ComplianceOuterClass.internal_static_google_showcase_v1beta1_ComplianceGroup_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.showcase.v1beta1.ComplianceOuterClass.internal_static_google_showcase_v1beta1_ComplianceGroup_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.showcase.v1beta1.ComplianceGroup.class, com.google.showcase.v1beta1.ComplianceGroup.Builder.class); - } - - public static final int NAME_FIELD_NUMBER = 1; - private volatile java.lang.Object name_; - /** - * 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; - } - } - /** - * 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 RPCS_FIELD_NUMBER = 2; - private com.google.protobuf.LazyStringList rpcs_; - /** - * repeated string rpcs = 2; - * @return A list containing the rpcs. - */ - public com.google.protobuf.ProtocolStringList - getRpcsList() { - return rpcs_; - } - /** - * repeated string rpcs = 2; - * @return The count of rpcs. - */ - public int getRpcsCount() { - return rpcs_.size(); - } - /** - * repeated string rpcs = 2; - * @param index The index of the element to return. - * @return The rpcs at the given index. - */ - public java.lang.String getRpcs(int index) { - return rpcs_.get(index); - } - /** - * repeated string rpcs = 2; - * @param index The index of the value to return. - * @return The bytes of the rpcs at the given index. - */ - public com.google.protobuf.ByteString - getRpcsBytes(int index) { - return rpcs_.getByteString(index); - } - - public static final int REQUESTS_FIELD_NUMBER = 3; - private java.util.List requests_; - /** - * repeated .google.showcase.v1beta1.RepeatRequest requests = 3; - */ - @java.lang.Override - public java.util.List getRequestsList() { - return requests_; - } - /** - * repeated .google.showcase.v1beta1.RepeatRequest requests = 3; - */ - @java.lang.Override - public java.util.List - getRequestsOrBuilderList() { - return requests_; - } - /** - * repeated .google.showcase.v1beta1.RepeatRequest requests = 3; - */ - @java.lang.Override - public int getRequestsCount() { - return requests_.size(); - } - /** - * repeated .google.showcase.v1beta1.RepeatRequest requests = 3; - */ - @java.lang.Override - public com.google.showcase.v1beta1.RepeatRequest getRequests(int index) { - return requests_.get(index); - } - /** - * repeated .google.showcase.v1beta1.RepeatRequest requests = 3; - */ - @java.lang.Override - public com.google.showcase.v1beta1.RepeatRequestOrBuilder getRequestsOrBuilder( - int index) { - return requests_.get(index); - } - - private byte memoizedIsInitialized = -1; - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); - } - for (int i = 0; i < rpcs_.size(); i++) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 2, rpcs_.getRaw(i)); - } - for (int i = 0; i < requests_.size(); i++) { - output.writeMessage(3, requests_.get(i)); - } - unknownFields.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_); - } - { - int dataSize = 0; - for (int i = 0; i < rpcs_.size(); i++) { - dataSize += computeStringSizeNoTag(rpcs_.getRaw(i)); - } - size += dataSize; - size += 1 * getRpcsList().size(); - } - for (int i = 0; i < requests_.size(); i++) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(3, requests_.get(i)); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof com.google.showcase.v1beta1.ComplianceGroup)) { - return super.equals(obj); - } - com.google.showcase.v1beta1.ComplianceGroup other = (com.google.showcase.v1beta1.ComplianceGroup) obj; - - if (!getName() - .equals(other.getName())) return false; - if (!getRpcsList() - .equals(other.getRpcsList())) return false; - if (!getRequestsList() - .equals(other.getRequestsList())) return false; - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - hash = (37 * hash) + NAME_FIELD_NUMBER; - hash = (53 * hash) + getName().hashCode(); - if (getRpcsCount() > 0) { - hash = (37 * hash) + RPCS_FIELD_NUMBER; - hash = (53 * hash) + getRpcsList().hashCode(); - } - if (getRequestsCount() > 0) { - hash = (37 * hash) + REQUESTS_FIELD_NUMBER; - hash = (53 * hash) + getRequestsList().hashCode(); - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.showcase.v1beta1.ComplianceGroup parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.showcase.v1beta1.ComplianceGroup parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.showcase.v1beta1.ComplianceGroup parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.showcase.v1beta1.ComplianceGroup 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.showcase.v1beta1.ComplianceGroup parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.showcase.v1beta1.ComplianceGroup parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.showcase.v1beta1.ComplianceGroup parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static com.google.showcase.v1beta1.ComplianceGroup 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.showcase.v1beta1.ComplianceGroup parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static com.google.showcase.v1beta1.ComplianceGroup 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.showcase.v1beta1.ComplianceGroup parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static com.google.showcase.v1beta1.ComplianceGroup 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.showcase.v1beta1.ComplianceGroup 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; - } - /** - *
        -   * ComplianceGroups encapsulates a group of RPC requests to the Compliance
        -   * server: one request for each combination of elements of `rpcs` and of
        -   * `requests`.
        -   * 
        - * - * Protobuf type {@code google.showcase.v1beta1.ComplianceGroup} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.ComplianceGroup) - com.google.showcase.v1beta1.ComplianceGroupOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.google.showcase.v1beta1.ComplianceOuterClass.internal_static_google_showcase_v1beta1_ComplianceGroup_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.showcase.v1beta1.ComplianceOuterClass.internal_static_google_showcase_v1beta1_ComplianceGroup_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.showcase.v1beta1.ComplianceGroup.class, com.google.showcase.v1beta1.ComplianceGroup.Builder.class); - } - - // Construct using com.google.showcase.v1beta1.ComplianceGroup.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { - getRequestsFieldBuilder(); - } - } - @java.lang.Override - public Builder clear() { - super.clear(); - name_ = ""; - - rpcs_ = com.google.protobuf.LazyStringArrayList.EMPTY; - bitField0_ = (bitField0_ & ~0x00000001); - if (requestsBuilder_ == null) { - requests_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000002); - } else { - requestsBuilder_.clear(); - } - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return com.google.showcase.v1beta1.ComplianceOuterClass.internal_static_google_showcase_v1beta1_ComplianceGroup_descriptor; - } - - @java.lang.Override - public com.google.showcase.v1beta1.ComplianceGroup getDefaultInstanceForType() { - return com.google.showcase.v1beta1.ComplianceGroup.getDefaultInstance(); - } - - @java.lang.Override - public com.google.showcase.v1beta1.ComplianceGroup build() { - com.google.showcase.v1beta1.ComplianceGroup result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.showcase.v1beta1.ComplianceGroup buildPartial() { - com.google.showcase.v1beta1.ComplianceGroup result = new com.google.showcase.v1beta1.ComplianceGroup(this); - int from_bitField0_ = bitField0_; - result.name_ = name_; - if (((bitField0_ & 0x00000001) != 0)) { - rpcs_ = rpcs_.getUnmodifiableView(); - bitField0_ = (bitField0_ & ~0x00000001); - } - result.rpcs_ = rpcs_; - if (requestsBuilder_ == null) { - if (((bitField0_ & 0x00000002) != 0)) { - requests_ = java.util.Collections.unmodifiableList(requests_); - bitField0_ = (bitField0_ & ~0x00000002); - } - result.requests_ = requests_; - } else { - result.requests_ = requestsBuilder_.build(); - } - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.setField(field, value); - } - @java.lang.Override - public Builder clearField( - com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - @java.lang.Override - public Builder clearOneof( - com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.addRepeatedField(field, value); - } - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof com.google.showcase.v1beta1.ComplianceGroup) { - return mergeFrom((com.google.showcase.v1beta1.ComplianceGroup)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.showcase.v1beta1.ComplianceGroup other) { - if (other == com.google.showcase.v1beta1.ComplianceGroup.getDefaultInstance()) return this; - if (!other.getName().isEmpty()) { - name_ = other.name_; - onChanged(); - } - if (!other.rpcs_.isEmpty()) { - if (rpcs_.isEmpty()) { - rpcs_ = other.rpcs_; - bitField0_ = (bitField0_ & ~0x00000001); - } else { - ensureRpcsIsMutable(); - rpcs_.addAll(other.rpcs_); - } - onChanged(); - } - if (requestsBuilder_ == null) { - if (!other.requests_.isEmpty()) { - if (requests_.isEmpty()) { - requests_ = other.requests_; - bitField0_ = (bitField0_ & ~0x00000002); - } else { - ensureRequestsIsMutable(); - requests_.addAll(other.requests_); - } - onChanged(); - } - } else { - if (!other.requests_.isEmpty()) { - if (requestsBuilder_.isEmpty()) { - requestsBuilder_.dispose(); - requestsBuilder_ = null; - requests_ = other.requests_; - bitField0_ = (bitField0_ & ~0x00000002); - requestsBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? - getRequestsFieldBuilder() : null; - } else { - requestsBuilder_.addAllMessages(other.requests_); - } - } - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - com.google.showcase.v1beta1.ComplianceGroup parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (com.google.showcase.v1beta1.ComplianceGroup) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - private int bitField0_; - - private java.lang.Object name_ = ""; - /** - * string name = 1; - * @return The name. - */ - public java.lang.String getName() { - java.lang.Object ref = name_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - name_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * 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; - } - } - /** - * string name = 1; - * @param value The name to set. - * @return This builder for chaining. - */ - public Builder setName( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - name_ = value; - onChanged(); - return this; - } - /** - * string name = 1; - * @return This builder for chaining. - */ - public Builder clearName() { - - name_ = getDefaultInstance().getName(); - onChanged(); - return this; - } - /** - * string name = 1; - * @param value The bytes for name to set. - * @return This builder for chaining. - */ - public Builder setNameBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - name_ = value; - onChanged(); - return this; - } - - private com.google.protobuf.LazyStringList rpcs_ = com.google.protobuf.LazyStringArrayList.EMPTY; - private void ensureRpcsIsMutable() { - if (!((bitField0_ & 0x00000001) != 0)) { - rpcs_ = new com.google.protobuf.LazyStringArrayList(rpcs_); - bitField0_ |= 0x00000001; - } - } - /** - * repeated string rpcs = 2; - * @return A list containing the rpcs. - */ - public com.google.protobuf.ProtocolStringList - getRpcsList() { - return rpcs_.getUnmodifiableView(); - } - /** - * repeated string rpcs = 2; - * @return The count of rpcs. - */ - public int getRpcsCount() { - return rpcs_.size(); - } - /** - * repeated string rpcs = 2; - * @param index The index of the element to return. - * @return The rpcs at the given index. - */ - public java.lang.String getRpcs(int index) { - return rpcs_.get(index); - } - /** - * repeated string rpcs = 2; - * @param index The index of the value to return. - * @return The bytes of the rpcs at the given index. - */ - public com.google.protobuf.ByteString - getRpcsBytes(int index) { - return rpcs_.getByteString(index); - } - /** - * repeated string rpcs = 2; - * @param index The index to set the value at. - * @param value The rpcs to set. - * @return This builder for chaining. - */ - public Builder setRpcs( - int index, java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - ensureRpcsIsMutable(); - rpcs_.set(index, value); - onChanged(); - return this; - } - /** - * repeated string rpcs = 2; - * @param value The rpcs to add. - * @return This builder for chaining. - */ - public Builder addRpcs( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - ensureRpcsIsMutable(); - rpcs_.add(value); - onChanged(); - return this; - } - /** - * repeated string rpcs = 2; - * @param values The rpcs to add. - * @return This builder for chaining. - */ - public Builder addAllRpcs( - java.lang.Iterable values) { - ensureRpcsIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, rpcs_); - onChanged(); - return this; - } - /** - * repeated string rpcs = 2; - * @return This builder for chaining. - */ - public Builder clearRpcs() { - rpcs_ = com.google.protobuf.LazyStringArrayList.EMPTY; - bitField0_ = (bitField0_ & ~0x00000001); - onChanged(); - return this; - } - /** - * repeated string rpcs = 2; - * @param value The bytes of the rpcs to add. - * @return This builder for chaining. - */ - public Builder addRpcsBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - ensureRpcsIsMutable(); - rpcs_.add(value); - onChanged(); - return this; - } - - private java.util.List requests_ = - java.util.Collections.emptyList(); - private void ensureRequestsIsMutable() { - if (!((bitField0_ & 0x00000002) != 0)) { - requests_ = new java.util.ArrayList(requests_); - bitField0_ |= 0x00000002; - } - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - com.google.showcase.v1beta1.RepeatRequest, com.google.showcase.v1beta1.RepeatRequest.Builder, com.google.showcase.v1beta1.RepeatRequestOrBuilder> requestsBuilder_; - - /** - * repeated .google.showcase.v1beta1.RepeatRequest requests = 3; - */ - public java.util.List getRequestsList() { - if (requestsBuilder_ == null) { - return java.util.Collections.unmodifiableList(requests_); - } else { - return requestsBuilder_.getMessageList(); - } - } - /** - * repeated .google.showcase.v1beta1.RepeatRequest requests = 3; - */ - public int getRequestsCount() { - if (requestsBuilder_ == null) { - return requests_.size(); - } else { - return requestsBuilder_.getCount(); - } - } - /** - * repeated .google.showcase.v1beta1.RepeatRequest requests = 3; - */ - public com.google.showcase.v1beta1.RepeatRequest getRequests(int index) { - if (requestsBuilder_ == null) { - return requests_.get(index); - } else { - return requestsBuilder_.getMessage(index); - } - } - /** - * repeated .google.showcase.v1beta1.RepeatRequest requests = 3; - */ - public Builder setRequests( - int index, com.google.showcase.v1beta1.RepeatRequest value) { - if (requestsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureRequestsIsMutable(); - requests_.set(index, value); - onChanged(); - } else { - requestsBuilder_.setMessage(index, value); - } - return this; - } - /** - * repeated .google.showcase.v1beta1.RepeatRequest requests = 3; - */ - public Builder setRequests( - int index, com.google.showcase.v1beta1.RepeatRequest.Builder builderForValue) { - if (requestsBuilder_ == null) { - ensureRequestsIsMutable(); - requests_.set(index, builderForValue.build()); - onChanged(); - } else { - requestsBuilder_.setMessage(index, builderForValue.build()); - } - return this; - } - /** - * repeated .google.showcase.v1beta1.RepeatRequest requests = 3; - */ - public Builder addRequests(com.google.showcase.v1beta1.RepeatRequest value) { - if (requestsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureRequestsIsMutable(); - requests_.add(value); - onChanged(); - } else { - requestsBuilder_.addMessage(value); - } - return this; - } - /** - * repeated .google.showcase.v1beta1.RepeatRequest requests = 3; - */ - public Builder addRequests( - int index, com.google.showcase.v1beta1.RepeatRequest value) { - if (requestsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureRequestsIsMutable(); - requests_.add(index, value); - onChanged(); - } else { - requestsBuilder_.addMessage(index, value); - } - return this; - } - /** - * repeated .google.showcase.v1beta1.RepeatRequest requests = 3; - */ - public Builder addRequests( - com.google.showcase.v1beta1.RepeatRequest.Builder builderForValue) { - if (requestsBuilder_ == null) { - ensureRequestsIsMutable(); - requests_.add(builderForValue.build()); - onChanged(); - } else { - requestsBuilder_.addMessage(builderForValue.build()); - } - return this; - } - /** - * repeated .google.showcase.v1beta1.RepeatRequest requests = 3; - */ - public Builder addRequests( - int index, com.google.showcase.v1beta1.RepeatRequest.Builder builderForValue) { - if (requestsBuilder_ == null) { - ensureRequestsIsMutable(); - requests_.add(index, builderForValue.build()); - onChanged(); - } else { - requestsBuilder_.addMessage(index, builderForValue.build()); - } - return this; - } - /** - * repeated .google.showcase.v1beta1.RepeatRequest requests = 3; - */ - public Builder addAllRequests( - java.lang.Iterable values) { - if (requestsBuilder_ == null) { - ensureRequestsIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, requests_); - onChanged(); - } else { - requestsBuilder_.addAllMessages(values); - } - return this; - } - /** - * repeated .google.showcase.v1beta1.RepeatRequest requests = 3; - */ - public Builder clearRequests() { - if (requestsBuilder_ == null) { - requests_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000002); - onChanged(); - } else { - requestsBuilder_.clear(); - } - return this; - } - /** - * repeated .google.showcase.v1beta1.RepeatRequest requests = 3; - */ - public Builder removeRequests(int index) { - if (requestsBuilder_ == null) { - ensureRequestsIsMutable(); - requests_.remove(index); - onChanged(); - } else { - requestsBuilder_.remove(index); - } - return this; - } - /** - * repeated .google.showcase.v1beta1.RepeatRequest requests = 3; - */ - public com.google.showcase.v1beta1.RepeatRequest.Builder getRequestsBuilder( - int index) { - return getRequestsFieldBuilder().getBuilder(index); - } - /** - * repeated .google.showcase.v1beta1.RepeatRequest requests = 3; - */ - public com.google.showcase.v1beta1.RepeatRequestOrBuilder getRequestsOrBuilder( - int index) { - if (requestsBuilder_ == null) { - return requests_.get(index); } else { - return requestsBuilder_.getMessageOrBuilder(index); - } - } - /** - * repeated .google.showcase.v1beta1.RepeatRequest requests = 3; - */ - public java.util.List - getRequestsOrBuilderList() { - if (requestsBuilder_ != null) { - return requestsBuilder_.getMessageOrBuilderList(); - } else { - return java.util.Collections.unmodifiableList(requests_); - } - } - /** - * repeated .google.showcase.v1beta1.RepeatRequest requests = 3; - */ - public com.google.showcase.v1beta1.RepeatRequest.Builder addRequestsBuilder() { - return getRequestsFieldBuilder().addBuilder( - com.google.showcase.v1beta1.RepeatRequest.getDefaultInstance()); - } - /** - * repeated .google.showcase.v1beta1.RepeatRequest requests = 3; - */ - public com.google.showcase.v1beta1.RepeatRequest.Builder addRequestsBuilder( - int index) { - return getRequestsFieldBuilder().addBuilder( - index, com.google.showcase.v1beta1.RepeatRequest.getDefaultInstance()); - } - /** - * repeated .google.showcase.v1beta1.RepeatRequest requests = 3; - */ - public java.util.List - getRequestsBuilderList() { - return getRequestsFieldBuilder().getBuilderList(); - } - private com.google.protobuf.RepeatedFieldBuilderV3< - com.google.showcase.v1beta1.RepeatRequest, com.google.showcase.v1beta1.RepeatRequest.Builder, com.google.showcase.v1beta1.RepeatRequestOrBuilder> - getRequestsFieldBuilder() { - if (requestsBuilder_ == null) { - requestsBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< - com.google.showcase.v1beta1.RepeatRequest, com.google.showcase.v1beta1.RepeatRequest.Builder, com.google.showcase.v1beta1.RepeatRequestOrBuilder>( - requests_, - ((bitField0_ & 0x00000002) != 0), - getParentForChildren(), - isClean()); - requests_ = null; - } - return requestsBuilder_; - } - @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.showcase.v1beta1.ComplianceGroup) - } - - // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.ComplianceGroup) - private static final com.google.showcase.v1beta1.ComplianceGroup DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new com.google.showcase.v1beta1.ComplianceGroup(); - } - - public static com.google.showcase.v1beta1.ComplianceGroup getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public ComplianceGroup parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new ComplianceGroup(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public com.google.showcase.v1beta1.ComplianceGroup getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ComplianceGroupOrBuilder.java b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ComplianceGroupOrBuilder.java deleted file mode 100644 index 71970f5bda..0000000000 --- a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ComplianceGroupOrBuilder.java +++ /dev/null @@ -1,70 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: schema/google/showcase/v1beta1/compliance.proto - -package com.google.showcase.v1beta1; - -public interface ComplianceGroupOrBuilder extends - // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.ComplianceGroup) - com.google.protobuf.MessageOrBuilder { - - /** - * string name = 1; - * @return The name. - */ - java.lang.String getName(); - /** - * string name = 1; - * @return The bytes for name. - */ - com.google.protobuf.ByteString - getNameBytes(); - - /** - * repeated string rpcs = 2; - * @return A list containing the rpcs. - */ - java.util.List - getRpcsList(); - /** - * repeated string rpcs = 2; - * @return The count of rpcs. - */ - int getRpcsCount(); - /** - * repeated string rpcs = 2; - * @param index The index of the element to return. - * @return The rpcs at the given index. - */ - java.lang.String getRpcs(int index); - /** - * repeated string rpcs = 2; - * @param index The index of the value to return. - * @return The bytes of the rpcs at the given index. - */ - com.google.protobuf.ByteString - getRpcsBytes(int index); - - /** - * repeated .google.showcase.v1beta1.RepeatRequest requests = 3; - */ - java.util.List - getRequestsList(); - /** - * repeated .google.showcase.v1beta1.RepeatRequest requests = 3; - */ - com.google.showcase.v1beta1.RepeatRequest getRequests(int index); - /** - * repeated .google.showcase.v1beta1.RepeatRequest requests = 3; - */ - int getRequestsCount(); - /** - * repeated .google.showcase.v1beta1.RepeatRequest requests = 3; - */ - java.util.List - getRequestsOrBuilderList(); - /** - * repeated .google.showcase.v1beta1.RepeatRequest requests = 3; - */ - com.google.showcase.v1beta1.RepeatRequestOrBuilder getRequestsOrBuilder( - int index); -} diff --git a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ComplianceOuterClass.java b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ComplianceOuterClass.java deleted file mode 100644 index a1cb63ee80..0000000000 --- a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ComplianceOuterClass.java +++ /dev/null @@ -1,252 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: schema/google/showcase/v1beta1/compliance.proto - -package com.google.showcase.v1beta1; - -public final class ComplianceOuterClass { - private ComplianceOuterClass() {} - 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_showcase_v1beta1_RepeatRequest_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_showcase_v1beta1_RepeatRequest_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_showcase_v1beta1_RepeatResponse_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_showcase_v1beta1_RepeatResponse_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_showcase_v1beta1_ComplianceSuite_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_showcase_v1beta1_ComplianceSuite_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_showcase_v1beta1_ComplianceGroup_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_showcase_v1beta1_ComplianceGroup_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_showcase_v1beta1_ComplianceData_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_showcase_v1beta1_ComplianceData_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_showcase_v1beta1_ComplianceDataChild_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_showcase_v1beta1_ComplianceDataChild_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_showcase_v1beta1_ComplianceDataGrandchild_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_showcase_v1beta1_ComplianceDataGrandchild_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_showcase_v1beta1_EnumRequest_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_showcase_v1beta1_EnumRequest_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_showcase_v1beta1_EnumResponse_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_showcase_v1beta1_EnumResponse_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/schema/google/showcase/v1beta1/complia" + - "nce.proto\022\027google.showcase.v1beta1\032\034goog" + - "le/api/annotations.proto\032\027google/api/cli" + - "ent.proto\"\303\002\n\rRepeatRequest\022\014\n\004name\030\001 \001(" + - "\t\0225\n\004info\030\002 \001(\0132\'.google.showcase.v1beta" + - "1.ComplianceData\022\025\n\rserver_verify\030\003 \001(\010\022" + - "!\n\024intended_binding_uri\030\n \001(\tH\000\210\001\001\022\017\n\007f_" + - "int32\030\004 \001(\005\022\017\n\007f_int64\030\005 \001(\003\022\020\n\010f_double" + - "\030\006 \001(\001\022\024\n\007p_int32\030\007 \001(\005H\001\210\001\001\022\024\n\007p_int64\030" + - "\010 \001(\003H\002\210\001\001\022\025\n\010p_double\030\t \001(\001H\003\210\001\001B\027\n\025_in" + - "tended_binding_uriB\n\n\010_p_int32B\n\n\010_p_int" + - "64B\013\n\t_p_double\"^\n\016RepeatResponse\0227\n\007req" + - "uest\030\001 \001(\0132&.google.showcase.v1beta1.Rep" + - "eatRequest\022\023\n\013binding_uri\030\002 \001(\t\"J\n\017Compl" + - "ianceSuite\0227\n\005group\030\001 \003(\0132(.google.showc" + - "ase.v1beta1.ComplianceGroup\"g\n\017Complianc" + - "eGroup\022\014\n\004name\030\001 \001(\t\022\014\n\004rpcs\030\002 \003(\t\0228\n\010re" + - "quests\030\003 \003(\0132&.google.showcase.v1beta1.R" + - "epeatRequest\"\340\006\n\016ComplianceData\022\020\n\010f_str" + - "ing\030\001 \001(\t\022\017\n\007f_int32\030\002 \001(\005\022\020\n\010f_sint32\030\003" + - " \001(\021\022\022\n\nf_sfixed32\030\004 \001(\017\022\020\n\010f_uint32\030\005 \001" + - "(\r\022\021\n\tf_fixed32\030\006 \001(\007\022\017\n\007f_int64\030\007 \001(\003\022\020" + - "\n\010f_sint64\030\010 \001(\022\022\022\n\nf_sfixed64\030\t \001(\020\022\020\n\010" + - "f_uint64\030\n \001(\004\022\021\n\tf_fixed64\030\013 \001(\006\022\020\n\010f_d" + - "ouble\030\014 \001(\001\022\017\n\007f_float\030\r \001(\002\022\016\n\006f_bool\030\016" + - " \001(\010\022\017\n\007f_bytes\030\017 \001(\014\022F\n\tf_kingdom\030\026 \001(\016" + - "23.google.showcase.v1beta1.ComplianceDat" + - "a.LifeKingdom\022=\n\007f_child\030\020 \001(\0132,.google." + - "showcase.v1beta1.ComplianceDataChild\022\025\n\010" + - "p_string\030\021 \001(\tH\000\210\001\001\022\024\n\007p_int32\030\022 \001(\005H\001\210\001" + - "\001\022\025\n\010p_double\030\023 \001(\001H\002\210\001\001\022\023\n\006p_bool\030\024 \001(\010" + - "H\003\210\001\001\022K\n\tp_kingdom\030\027 \001(\01623.google.showca" + - "se.v1beta1.ComplianceData.LifeKingdomH\004\210" + - "\001\001\022B\n\007p_child\030\025 \001(\0132,.google.showcase.v1" + - "beta1.ComplianceDataChildH\005\210\001\001\"\203\001\n\013LifeK" + - "ingdom\022\034\n\030LIFE_KINGDOM_UNSPECIFIED\020\000\022\022\n\016" + - "ARCHAEBACTERIA\020\001\022\016\n\nEUBACTERIA\020\002\022\014\n\010PROT" + - "ISTA\020\003\022\t\n\005FUNGI\020\004\022\013\n\007PLANTAE\020\005\022\014\n\010ANIMAL" + - "IA\020\006B\013\n\t_p_stringB\n\n\010_p_int32B\013\n\t_p_doub" + - "leB\t\n\007_p_boolB\014\n\n_p_kingdomB\n\n\010_p_child\"" + - "\357\003\n\023ComplianceDataChild\022\020\n\010f_string\030\001 \001(" + - "\t\022\017\n\007f_float\030\002 \001(\002\022\020\n\010f_double\030\003 \001(\001\022\016\n\006" + - "f_bool\030\004 \001(\010\0227\n\013f_continent\030\013 \001(\0162\".goog" + - "le.showcase.v1beta1.Continent\022B\n\007f_child" + - "\030\005 \001(\01321.google.showcase.v1beta1.Complia" + - "nceDataGrandchild\022\025\n\010p_string\030\006 \001(\tH\000\210\001\001" + - "\022\024\n\007p_float\030\007 \001(\002H\001\210\001\001\022\025\n\010p_double\030\010 \001(\001" + - "H\002\210\001\001\022\023\n\006p_bool\030\t \001(\010H\003\210\001\001\0227\n\013p_continen" + - "t\030\014 \001(\0162\".google.showcase.v1beta1.Contin" + - "ent\022G\n\007p_child\030\n \001(\01321.google.showcase.v" + - "1beta1.ComplianceDataGrandchildH\004\210\001\001B\013\n\t" + - "_p_stringB\n\n\010_p_floatB\013\n\t_p_doubleB\t\n\007_p" + - "_boolB\n\n\010_p_child\"N\n\030ComplianceDataGrand" + - "child\022\020\n\010f_string\030\001 \001(\t\022\020\n\010f_double\030\002 \001(" + - "\001\022\016\n\006f_bool\030\003 \001(\010\"#\n\013EnumRequest\022\024\n\014unkn" + - "own_enum\030\001 \001(\010\"|\n\014EnumResponse\0225\n\007reques" + - "t\030\001 \001(\0132$.google.showcase.v1beta1.EnumRe" + - "quest\0225\n\tcontinent\030\002 \001(\0162\".google.showca" + - "se.v1beta1.Continent*i\n\tContinent\022\031\n\025CON" + - "TINENT_UNSPECIFIED\020\000\022\n\n\006AFRICA\020\001\022\013\n\007AMER" + - "ICA\020\002\022\r\n\tANTARTICA\020\003\022\r\n\tAUSTRALIA\020\004\022\n\n\006E" + - "UROPE\020\0052\330\r\n\nCompliance\022\202\001\n\016RepeatDataBod" + - "y\022&.google.showcase.v1beta1.RepeatReques" + - "t\032\'.google.showcase.v1beta1.RepeatRespon" + - "se\"\037\202\323\344\223\002\031\"\024/v1beta1/repeat:body:\001*\022\215\001\n\022" + - "RepeatDataBodyInfo\022&.google.showcase.v1b" + - "eta1.RepeatRequest\032\'.google.showcase.v1b" + - "eta1.RepeatResponse\"&\202\323\344\223\002 \"\030/v1beta1/re" + - "peat:bodyinfo:\004info\022\201\001\n\017RepeatDataQuery\022" + - "&.google.showcase.v1beta1.RepeatRequest\032" + - "\'.google.showcase.v1beta1.RepeatResponse" + - "\"\035\202\323\344\223\002\027\022\025/v1beta1/repeat:query\022\331\001\n\024Repe" + - "atDataSimplePath\022&.google.showcase.v1bet" + - "a1.RepeatRequest\032\'.google.showcase.v1bet" + - "a1.RepeatResponse\"p\202\323\344\223\002j\022h/v1beta1/repe" + - "at/{info.f_string}/{info.f_int32}/{info." + - "f_double}/{info.f_bool}/{info.f_kingdom}" + - ":simplepath\022\323\002\n\026RepeatDataPathResource\022&" + - ".google.showcase.v1beta1.RepeatRequest\032\'" + - ".google.showcase.v1beta1.RepeatResponse\"" + - "\347\001\202\323\344\223\002\340\001\022h/v1beta1/repeat/{info.f_strin" + - "g=first/*}/{info.f_child.f_string=second" + - "/*}/bool/{info.f_bool}:pathresourceZt\022r/" + - "v1beta1/repeat/{info.f_child.f_string=fi" + - "rst/*}/{info.f_string=second/*}/bool/{in" + - "fo.f_bool}:childfirstpathresource\022\331\001\n\036Re" + - "peatDataPathTrailingResource\022&.google.sh" + - "owcase.v1beta1.RepeatRequest\032\'.google.sh" + - "owcase.v1beta1.RepeatResponse\"f\202\323\344\223\002`\022^/" + - "v1beta1/repeat/{info.f_string=first/*}/{" + - "info.f_child.f_string=second/**}:pathtra" + - "ilingresource\022\210\001\n\021RepeatDataBodyPut\022&.go" + - "ogle.showcase.v1beta1.RepeatRequest\032\'.go" + - "ogle.showcase.v1beta1.RepeatResponse\"\"\202\323" + - "\344\223\002\034\032\027/v1beta1/repeat:bodyput:\001*\022\214\001\n\023Rep" + - "eatDataBodyPatch\022&.google.showcase.v1bet" + - "a1.RepeatRequest\032\'.google.showcase.v1bet" + - "a1.RepeatResponse\"$\202\323\344\223\002\0362\031/v1beta1/repe" + - "at:bodypatch:\001*\022x\n\007GetEnum\022$.google.show" + - "case.v1beta1.EnumRequest\032%.google.showca" + - "se.v1beta1.EnumResponse\" \202\323\344\223\002\032\022\030/v1beta" + - "1/compliance/enum\022|\n\nVerifyEnum\022%.google" + - ".showcase.v1beta1.EnumResponse\032%.google." + - "showcase.v1beta1.EnumResponse\" \202\323\344\223\002\032\"\030/" + - "v1beta1/compliance/enum\032\021\312A\016localhost:74" + - "69Bq\n\033com.google.showcase.v1beta1P\001Z4git" + - "hub.com/googleapis/gapic-showcase/server" + - "/genproto\352\002\031Google::Showcase::V1beta1b\006p" + - "roto3" - }; - descriptor = com.google.protobuf.Descriptors.FileDescriptor - .internalBuildGeneratedFileFrom(descriptorData, - new com.google.protobuf.Descriptors.FileDescriptor[] { - com.google.api.AnnotationsProto.getDescriptor(), - com.google.api.ClientProto.getDescriptor(), - }); - internal_static_google_showcase_v1beta1_RepeatRequest_descriptor = - getDescriptor().getMessageTypes().get(0); - internal_static_google_showcase_v1beta1_RepeatRequest_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_google_showcase_v1beta1_RepeatRequest_descriptor, - new java.lang.String[] { "Name", "Info", "ServerVerify", "IntendedBindingUri", "FInt32", "FInt64", "FDouble", "PInt32", "PInt64", "PDouble", "IntendedBindingUri", "PInt32", "PInt64", "PDouble", }); - internal_static_google_showcase_v1beta1_RepeatResponse_descriptor = - getDescriptor().getMessageTypes().get(1); - internal_static_google_showcase_v1beta1_RepeatResponse_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_google_showcase_v1beta1_RepeatResponse_descriptor, - new java.lang.String[] { "Request", "BindingUri", }); - internal_static_google_showcase_v1beta1_ComplianceSuite_descriptor = - getDescriptor().getMessageTypes().get(2); - internal_static_google_showcase_v1beta1_ComplianceSuite_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_google_showcase_v1beta1_ComplianceSuite_descriptor, - new java.lang.String[] { "Group", }); - internal_static_google_showcase_v1beta1_ComplianceGroup_descriptor = - getDescriptor().getMessageTypes().get(3); - internal_static_google_showcase_v1beta1_ComplianceGroup_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_google_showcase_v1beta1_ComplianceGroup_descriptor, - new java.lang.String[] { "Name", "Rpcs", "Requests", }); - internal_static_google_showcase_v1beta1_ComplianceData_descriptor = - getDescriptor().getMessageTypes().get(4); - internal_static_google_showcase_v1beta1_ComplianceData_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_google_showcase_v1beta1_ComplianceData_descriptor, - new java.lang.String[] { "FString", "FInt32", "FSint32", "FSfixed32", "FUint32", "FFixed32", "FInt64", "FSint64", "FSfixed64", "FUint64", "FFixed64", "FDouble", "FFloat", "FBool", "FBytes", "FKingdom", "FChild", "PString", "PInt32", "PDouble", "PBool", "PKingdom", "PChild", "PString", "PInt32", "PDouble", "PBool", "PKingdom", "PChild", }); - internal_static_google_showcase_v1beta1_ComplianceDataChild_descriptor = - getDescriptor().getMessageTypes().get(5); - internal_static_google_showcase_v1beta1_ComplianceDataChild_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_google_showcase_v1beta1_ComplianceDataChild_descriptor, - new java.lang.String[] { "FString", "FFloat", "FDouble", "FBool", "FContinent", "FChild", "PString", "PFloat", "PDouble", "PBool", "PContinent", "PChild", "PString", "PFloat", "PDouble", "PBool", "PChild", }); - internal_static_google_showcase_v1beta1_ComplianceDataGrandchild_descriptor = - getDescriptor().getMessageTypes().get(6); - internal_static_google_showcase_v1beta1_ComplianceDataGrandchild_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_google_showcase_v1beta1_ComplianceDataGrandchild_descriptor, - new java.lang.String[] { "FString", "FDouble", "FBool", }); - internal_static_google_showcase_v1beta1_EnumRequest_descriptor = - getDescriptor().getMessageTypes().get(7); - internal_static_google_showcase_v1beta1_EnumRequest_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_google_showcase_v1beta1_EnumRequest_descriptor, - new java.lang.String[] { "UnknownEnum", }); - internal_static_google_showcase_v1beta1_EnumResponse_descriptor = - getDescriptor().getMessageTypes().get(8); - internal_static_google_showcase_v1beta1_EnumResponse_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_google_showcase_v1beta1_EnumResponse_descriptor, - new java.lang.String[] { "Request", "Continent", }); - com.google.protobuf.ExtensionRegistry registry = - com.google.protobuf.ExtensionRegistry.newInstance(); - registry.add(com.google.api.ClientProto.defaultHost); - registry.add(com.google.api.AnnotationsProto.http); - com.google.protobuf.Descriptors.FileDescriptor - .internalUpdateFileDescriptor(descriptor, registry); - com.google.api.AnnotationsProto.getDescriptor(); - com.google.api.ClientProto.getDescriptor(); - } - - // @@protoc_insertion_point(outer_class_scope) -} diff --git a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ComplianceSuite.java b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ComplianceSuite.java deleted file mode 100644 index e87565b059..0000000000 --- a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ComplianceSuite.java +++ /dev/null @@ -1,784 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: schema/google/showcase/v1beta1/compliance.proto - -package com.google.showcase.v1beta1; - -/** - *
        - * ComplianceSuite contains a set of requests that microgenerators should issue
        - * over REST to the Compliance service to test their gRPC-to-REST transcoding
        - * implementation.
        - * 
        - * - * Protobuf type {@code google.showcase.v1beta1.ComplianceSuite} - */ -public final class ComplianceSuite extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.ComplianceSuite) - ComplianceSuiteOrBuilder { -private static final long serialVersionUID = 0L; - // Use ComplianceSuite.newBuilder() to construct. - private ComplianceSuite(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private ComplianceSuite() { - group_ = java.util.Collections.emptyList(); - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new ComplianceSuite(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private ComplianceSuite( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - int mutable_bitField0_ = 0; - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: { - if (!((mutable_bitField0_ & 0x00000001) != 0)) { - group_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000001; - } - group_.add( - input.readMessage(com.google.showcase.v1beta1.ComplianceGroup.parser(), extensionRegistry)); - break; - } - default: { - if (!parseUnknownField( - input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException( - e).setUnfinishedMessage(this); - } finally { - if (((mutable_bitField0_ & 0x00000001) != 0)) { - group_ = java.util.Collections.unmodifiableList(group_); - } - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.google.showcase.v1beta1.ComplianceOuterClass.internal_static_google_showcase_v1beta1_ComplianceSuite_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.showcase.v1beta1.ComplianceOuterClass.internal_static_google_showcase_v1beta1_ComplianceSuite_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.showcase.v1beta1.ComplianceSuite.class, com.google.showcase.v1beta1.ComplianceSuite.Builder.class); - } - - public static final int GROUP_FIELD_NUMBER = 1; - private java.util.List group_; - /** - * repeated .google.showcase.v1beta1.ComplianceGroup group = 1; - */ - @java.lang.Override - public java.util.List getGroupList() { - return group_; - } - /** - * repeated .google.showcase.v1beta1.ComplianceGroup group = 1; - */ - @java.lang.Override - public java.util.List - getGroupOrBuilderList() { - return group_; - } - /** - * repeated .google.showcase.v1beta1.ComplianceGroup group = 1; - */ - @java.lang.Override - public int getGroupCount() { - return group_.size(); - } - /** - * repeated .google.showcase.v1beta1.ComplianceGroup group = 1; - */ - @java.lang.Override - public com.google.showcase.v1beta1.ComplianceGroup getGroup(int index) { - return group_.get(index); - } - /** - * repeated .google.showcase.v1beta1.ComplianceGroup group = 1; - */ - @java.lang.Override - public com.google.showcase.v1beta1.ComplianceGroupOrBuilder getGroupOrBuilder( - int index) { - return group_.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 < group_.size(); i++) { - output.writeMessage(1, group_.get(i)); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - for (int i = 0; i < group_.size(); i++) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(1, group_.get(i)); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof com.google.showcase.v1beta1.ComplianceSuite)) { - return super.equals(obj); - } - com.google.showcase.v1beta1.ComplianceSuite other = (com.google.showcase.v1beta1.ComplianceSuite) obj; - - if (!getGroupList() - .equals(other.getGroupList())) return false; - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - if (getGroupCount() > 0) { - hash = (37 * hash) + GROUP_FIELD_NUMBER; - hash = (53 * hash) + getGroupList().hashCode(); - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.showcase.v1beta1.ComplianceSuite parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.showcase.v1beta1.ComplianceSuite parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.showcase.v1beta1.ComplianceSuite parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.showcase.v1beta1.ComplianceSuite 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.showcase.v1beta1.ComplianceSuite parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.showcase.v1beta1.ComplianceSuite parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.showcase.v1beta1.ComplianceSuite parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static com.google.showcase.v1beta1.ComplianceSuite 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.showcase.v1beta1.ComplianceSuite parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static com.google.showcase.v1beta1.ComplianceSuite 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.showcase.v1beta1.ComplianceSuite parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static com.google.showcase.v1beta1.ComplianceSuite 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.showcase.v1beta1.ComplianceSuite 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; - } - /** - *
        -   * ComplianceSuite contains a set of requests that microgenerators should issue
        -   * over REST to the Compliance service to test their gRPC-to-REST transcoding
        -   * implementation.
        -   * 
        - * - * Protobuf type {@code google.showcase.v1beta1.ComplianceSuite} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.ComplianceSuite) - com.google.showcase.v1beta1.ComplianceSuiteOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.google.showcase.v1beta1.ComplianceOuterClass.internal_static_google_showcase_v1beta1_ComplianceSuite_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.showcase.v1beta1.ComplianceOuterClass.internal_static_google_showcase_v1beta1_ComplianceSuite_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.showcase.v1beta1.ComplianceSuite.class, com.google.showcase.v1beta1.ComplianceSuite.Builder.class); - } - - // Construct using com.google.showcase.v1beta1.ComplianceSuite.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { - getGroupFieldBuilder(); - } - } - @java.lang.Override - public Builder clear() { - super.clear(); - if (groupBuilder_ == null) { - group_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - } else { - groupBuilder_.clear(); - } - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return com.google.showcase.v1beta1.ComplianceOuterClass.internal_static_google_showcase_v1beta1_ComplianceSuite_descriptor; - } - - @java.lang.Override - public com.google.showcase.v1beta1.ComplianceSuite getDefaultInstanceForType() { - return com.google.showcase.v1beta1.ComplianceSuite.getDefaultInstance(); - } - - @java.lang.Override - public com.google.showcase.v1beta1.ComplianceSuite build() { - com.google.showcase.v1beta1.ComplianceSuite result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.showcase.v1beta1.ComplianceSuite buildPartial() { - com.google.showcase.v1beta1.ComplianceSuite result = new com.google.showcase.v1beta1.ComplianceSuite(this); - int from_bitField0_ = bitField0_; - if (groupBuilder_ == null) { - if (((bitField0_ & 0x00000001) != 0)) { - group_ = java.util.Collections.unmodifiableList(group_); - bitField0_ = (bitField0_ & ~0x00000001); - } - result.group_ = group_; - } else { - result.group_ = groupBuilder_.build(); - } - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.setField(field, value); - } - @java.lang.Override - public Builder clearField( - com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - @java.lang.Override - public Builder clearOneof( - com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.addRepeatedField(field, value); - } - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof com.google.showcase.v1beta1.ComplianceSuite) { - return mergeFrom((com.google.showcase.v1beta1.ComplianceSuite)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.showcase.v1beta1.ComplianceSuite other) { - if (other == com.google.showcase.v1beta1.ComplianceSuite.getDefaultInstance()) return this; - if (groupBuilder_ == null) { - if (!other.group_.isEmpty()) { - if (group_.isEmpty()) { - group_ = other.group_; - bitField0_ = (bitField0_ & ~0x00000001); - } else { - ensureGroupIsMutable(); - group_.addAll(other.group_); - } - onChanged(); - } - } else { - if (!other.group_.isEmpty()) { - if (groupBuilder_.isEmpty()) { - groupBuilder_.dispose(); - groupBuilder_ = null; - group_ = other.group_; - bitField0_ = (bitField0_ & ~0x00000001); - groupBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? - getGroupFieldBuilder() : null; - } else { - groupBuilder_.addAllMessages(other.group_); - } - } - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - com.google.showcase.v1beta1.ComplianceSuite parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (com.google.showcase.v1beta1.ComplianceSuite) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - private int bitField0_; - - private java.util.List group_ = - java.util.Collections.emptyList(); - private void ensureGroupIsMutable() { - if (!((bitField0_ & 0x00000001) != 0)) { - group_ = new java.util.ArrayList(group_); - bitField0_ |= 0x00000001; - } - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - com.google.showcase.v1beta1.ComplianceGroup, com.google.showcase.v1beta1.ComplianceGroup.Builder, com.google.showcase.v1beta1.ComplianceGroupOrBuilder> groupBuilder_; - - /** - * repeated .google.showcase.v1beta1.ComplianceGroup group = 1; - */ - public java.util.List getGroupList() { - if (groupBuilder_ == null) { - return java.util.Collections.unmodifiableList(group_); - } else { - return groupBuilder_.getMessageList(); - } - } - /** - * repeated .google.showcase.v1beta1.ComplianceGroup group = 1; - */ - public int getGroupCount() { - if (groupBuilder_ == null) { - return group_.size(); - } else { - return groupBuilder_.getCount(); - } - } - /** - * repeated .google.showcase.v1beta1.ComplianceGroup group = 1; - */ - public com.google.showcase.v1beta1.ComplianceGroup getGroup(int index) { - if (groupBuilder_ == null) { - return group_.get(index); - } else { - return groupBuilder_.getMessage(index); - } - } - /** - * repeated .google.showcase.v1beta1.ComplianceGroup group = 1; - */ - public Builder setGroup( - int index, com.google.showcase.v1beta1.ComplianceGroup value) { - if (groupBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureGroupIsMutable(); - group_.set(index, value); - onChanged(); - } else { - groupBuilder_.setMessage(index, value); - } - return this; - } - /** - * repeated .google.showcase.v1beta1.ComplianceGroup group = 1; - */ - public Builder setGroup( - int index, com.google.showcase.v1beta1.ComplianceGroup.Builder builderForValue) { - if (groupBuilder_ == null) { - ensureGroupIsMutable(); - group_.set(index, builderForValue.build()); - onChanged(); - } else { - groupBuilder_.setMessage(index, builderForValue.build()); - } - return this; - } - /** - * repeated .google.showcase.v1beta1.ComplianceGroup group = 1; - */ - public Builder addGroup(com.google.showcase.v1beta1.ComplianceGroup value) { - if (groupBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureGroupIsMutable(); - group_.add(value); - onChanged(); - } else { - groupBuilder_.addMessage(value); - } - return this; - } - /** - * repeated .google.showcase.v1beta1.ComplianceGroup group = 1; - */ - public Builder addGroup( - int index, com.google.showcase.v1beta1.ComplianceGroup value) { - if (groupBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureGroupIsMutable(); - group_.add(index, value); - onChanged(); - } else { - groupBuilder_.addMessage(index, value); - } - return this; - } - /** - * repeated .google.showcase.v1beta1.ComplianceGroup group = 1; - */ - public Builder addGroup( - com.google.showcase.v1beta1.ComplianceGroup.Builder builderForValue) { - if (groupBuilder_ == null) { - ensureGroupIsMutable(); - group_.add(builderForValue.build()); - onChanged(); - } else { - groupBuilder_.addMessage(builderForValue.build()); - } - return this; - } - /** - * repeated .google.showcase.v1beta1.ComplianceGroup group = 1; - */ - public Builder addGroup( - int index, com.google.showcase.v1beta1.ComplianceGroup.Builder builderForValue) { - if (groupBuilder_ == null) { - ensureGroupIsMutable(); - group_.add(index, builderForValue.build()); - onChanged(); - } else { - groupBuilder_.addMessage(index, builderForValue.build()); - } - return this; - } - /** - * repeated .google.showcase.v1beta1.ComplianceGroup group = 1; - */ - public Builder addAllGroup( - java.lang.Iterable values) { - if (groupBuilder_ == null) { - ensureGroupIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, group_); - onChanged(); - } else { - groupBuilder_.addAllMessages(values); - } - return this; - } - /** - * repeated .google.showcase.v1beta1.ComplianceGroup group = 1; - */ - public Builder clearGroup() { - if (groupBuilder_ == null) { - group_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - onChanged(); - } else { - groupBuilder_.clear(); - } - return this; - } - /** - * repeated .google.showcase.v1beta1.ComplianceGroup group = 1; - */ - public Builder removeGroup(int index) { - if (groupBuilder_ == null) { - ensureGroupIsMutable(); - group_.remove(index); - onChanged(); - } else { - groupBuilder_.remove(index); - } - return this; - } - /** - * repeated .google.showcase.v1beta1.ComplianceGroup group = 1; - */ - public com.google.showcase.v1beta1.ComplianceGroup.Builder getGroupBuilder( - int index) { - return getGroupFieldBuilder().getBuilder(index); - } - /** - * repeated .google.showcase.v1beta1.ComplianceGroup group = 1; - */ - public com.google.showcase.v1beta1.ComplianceGroupOrBuilder getGroupOrBuilder( - int index) { - if (groupBuilder_ == null) { - return group_.get(index); } else { - return groupBuilder_.getMessageOrBuilder(index); - } - } - /** - * repeated .google.showcase.v1beta1.ComplianceGroup group = 1; - */ - public java.util.List - getGroupOrBuilderList() { - if (groupBuilder_ != null) { - return groupBuilder_.getMessageOrBuilderList(); - } else { - return java.util.Collections.unmodifiableList(group_); - } - } - /** - * repeated .google.showcase.v1beta1.ComplianceGroup group = 1; - */ - public com.google.showcase.v1beta1.ComplianceGroup.Builder addGroupBuilder() { - return getGroupFieldBuilder().addBuilder( - com.google.showcase.v1beta1.ComplianceGroup.getDefaultInstance()); - } - /** - * repeated .google.showcase.v1beta1.ComplianceGroup group = 1; - */ - public com.google.showcase.v1beta1.ComplianceGroup.Builder addGroupBuilder( - int index) { - return getGroupFieldBuilder().addBuilder( - index, com.google.showcase.v1beta1.ComplianceGroup.getDefaultInstance()); - } - /** - * repeated .google.showcase.v1beta1.ComplianceGroup group = 1; - */ - public java.util.List - getGroupBuilderList() { - return getGroupFieldBuilder().getBuilderList(); - } - private com.google.protobuf.RepeatedFieldBuilderV3< - com.google.showcase.v1beta1.ComplianceGroup, com.google.showcase.v1beta1.ComplianceGroup.Builder, com.google.showcase.v1beta1.ComplianceGroupOrBuilder> - getGroupFieldBuilder() { - if (groupBuilder_ == null) { - groupBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< - com.google.showcase.v1beta1.ComplianceGroup, com.google.showcase.v1beta1.ComplianceGroup.Builder, com.google.showcase.v1beta1.ComplianceGroupOrBuilder>( - group_, - ((bitField0_ & 0x00000001) != 0), - getParentForChildren(), - isClean()); - group_ = null; - } - return groupBuilder_; - } - @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.showcase.v1beta1.ComplianceSuite) - } - - // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.ComplianceSuite) - private static final com.google.showcase.v1beta1.ComplianceSuite DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new com.google.showcase.v1beta1.ComplianceSuite(); - } - - public static com.google.showcase.v1beta1.ComplianceSuite getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public ComplianceSuite parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new ComplianceSuite(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public com.google.showcase.v1beta1.ComplianceSuite getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ComplianceSuiteOrBuilder.java b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ComplianceSuiteOrBuilder.java deleted file mode 100644 index 01f718e845..0000000000 --- a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ComplianceSuiteOrBuilder.java +++ /dev/null @@ -1,33 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: schema/google/showcase/v1beta1/compliance.proto - -package com.google.showcase.v1beta1; - -public interface ComplianceSuiteOrBuilder extends - // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.ComplianceSuite) - com.google.protobuf.MessageOrBuilder { - - /** - * repeated .google.showcase.v1beta1.ComplianceGroup group = 1; - */ - java.util.List - getGroupList(); - /** - * repeated .google.showcase.v1beta1.ComplianceGroup group = 1; - */ - com.google.showcase.v1beta1.ComplianceGroup getGroup(int index); - /** - * repeated .google.showcase.v1beta1.ComplianceGroup group = 1; - */ - int getGroupCount(); - /** - * repeated .google.showcase.v1beta1.ComplianceGroup group = 1; - */ - java.util.List - getGroupOrBuilderList(); - /** - * repeated .google.showcase.v1beta1.ComplianceGroup group = 1; - */ - com.google.showcase.v1beta1.ComplianceGroupOrBuilder getGroupOrBuilder( - int index); -} diff --git a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ConnectRequest.java b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ConnectRequest.java deleted file mode 100644 index ee58d0f26a..0000000000 --- a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ConnectRequest.java +++ /dev/null @@ -1,1644 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: schema/google/showcase/v1beta1/messaging.proto - -package com.google.showcase.v1beta1; - -/** - *
        - * The request message for the google.showcase.v1beta1.Messaging\Connect
        - * method.
        - * 
        - * - * Protobuf type {@code google.showcase.v1beta1.ConnectRequest} - */ -public final class ConnectRequest extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.ConnectRequest) - ConnectRequestOrBuilder { -private static final long serialVersionUID = 0L; - // Use ConnectRequest.newBuilder() to construct. - private ConnectRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private ConnectRequest() { - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new ConnectRequest(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private ConnectRequest( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: { - com.google.showcase.v1beta1.ConnectRequest.ConnectConfig.Builder subBuilder = null; - if (requestCase_ == 1) { - subBuilder = ((com.google.showcase.v1beta1.ConnectRequest.ConnectConfig) request_).toBuilder(); - } - request_ = - input.readMessage(com.google.showcase.v1beta1.ConnectRequest.ConnectConfig.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom((com.google.showcase.v1beta1.ConnectRequest.ConnectConfig) request_); - request_ = subBuilder.buildPartial(); - } - requestCase_ = 1; - break; - } - case 18: { - com.google.showcase.v1beta1.Blurb.Builder subBuilder = null; - if (requestCase_ == 2) { - subBuilder = ((com.google.showcase.v1beta1.Blurb) request_).toBuilder(); - } - request_ = - input.readMessage(com.google.showcase.v1beta1.Blurb.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom((com.google.showcase.v1beta1.Blurb) request_); - request_ = subBuilder.buildPartial(); - } - requestCase_ = 2; - break; - } - default: { - if (!parseUnknownField( - input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException( - e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.google.showcase.v1beta1.MessagingOuterClass.internal_static_google_showcase_v1beta1_ConnectRequest_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.showcase.v1beta1.MessagingOuterClass.internal_static_google_showcase_v1beta1_ConnectRequest_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.showcase.v1beta1.ConnectRequest.class, com.google.showcase.v1beta1.ConnectRequest.Builder.class); - } - - public interface ConnectConfigOrBuilder extends - // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.ConnectRequest.ConnectConfig) - com.google.protobuf.MessageOrBuilder { - - /** - *
        -     * The room or profile to follow and create messages for.
        -     * 
        - * - * string parent = 1 [(.google.api.resource_reference) = { ... } - * @return The parent. - */ - java.lang.String getParent(); - /** - *
        -     * The room or profile to follow and create messages for.
        -     * 
        - * - * string parent = 1 [(.google.api.resource_reference) = { ... } - * @return The bytes for parent. - */ - com.google.protobuf.ByteString - getParentBytes(); - } - /** - * Protobuf type {@code google.showcase.v1beta1.ConnectRequest.ConnectConfig} - */ - public static final class ConnectConfig extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.ConnectRequest.ConnectConfig) - ConnectConfigOrBuilder { - private static final long serialVersionUID = 0L; - // Use ConnectConfig.newBuilder() to construct. - private ConnectConfig(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private ConnectConfig() { - parent_ = ""; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new ConnectConfig(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private ConnectConfig( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: { - java.lang.String s = input.readStringRequireUtf8(); - - parent_ = s; - break; - } - default: { - if (!parseUnknownField( - input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException( - e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.google.showcase.v1beta1.MessagingOuterClass.internal_static_google_showcase_v1beta1_ConnectRequest_ConnectConfig_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.showcase.v1beta1.MessagingOuterClass.internal_static_google_showcase_v1beta1_ConnectRequest_ConnectConfig_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.showcase.v1beta1.ConnectRequest.ConnectConfig.class, com.google.showcase.v1beta1.ConnectRequest.ConnectConfig.Builder.class); - } - - public static final int PARENT_FIELD_NUMBER = 1; - private volatile java.lang.Object parent_; - /** - *
        -     * The room or profile to follow and create messages for.
        -     * 
        - * - * string parent = 1 [(.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; - } - } - /** - *
        -     * The room or profile to follow and create messages for.
        -     * 
        - * - * string parent = 1 [(.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; - } - } - - 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_); - } - unknownFields.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_); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof com.google.showcase.v1beta1.ConnectRequest.ConnectConfig)) { - return super.equals(obj); - } - com.google.showcase.v1beta1.ConnectRequest.ConnectConfig other = (com.google.showcase.v1beta1.ConnectRequest.ConnectConfig) obj; - - if (!getParent() - .equals(other.getParent())) return false; - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - hash = (37 * hash) + PARENT_FIELD_NUMBER; - hash = (53 * hash) + getParent().hashCode(); - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.showcase.v1beta1.ConnectRequest.ConnectConfig parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.showcase.v1beta1.ConnectRequest.ConnectConfig parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.showcase.v1beta1.ConnectRequest.ConnectConfig parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.showcase.v1beta1.ConnectRequest.ConnectConfig 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.showcase.v1beta1.ConnectRequest.ConnectConfig parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.showcase.v1beta1.ConnectRequest.ConnectConfig parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.showcase.v1beta1.ConnectRequest.ConnectConfig parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static com.google.showcase.v1beta1.ConnectRequest.ConnectConfig 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.showcase.v1beta1.ConnectRequest.ConnectConfig parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static com.google.showcase.v1beta1.ConnectRequest.ConnectConfig 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.showcase.v1beta1.ConnectRequest.ConnectConfig parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static com.google.showcase.v1beta1.ConnectRequest.ConnectConfig 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.showcase.v1beta1.ConnectRequest.ConnectConfig prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - @java.lang.Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - * Protobuf type {@code google.showcase.v1beta1.ConnectRequest.ConnectConfig} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.ConnectRequest.ConnectConfig) - com.google.showcase.v1beta1.ConnectRequest.ConnectConfigOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.google.showcase.v1beta1.MessagingOuterClass.internal_static_google_showcase_v1beta1_ConnectRequest_ConnectConfig_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.showcase.v1beta1.MessagingOuterClass.internal_static_google_showcase_v1beta1_ConnectRequest_ConnectConfig_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.showcase.v1beta1.ConnectRequest.ConnectConfig.class, com.google.showcase.v1beta1.ConnectRequest.ConnectConfig.Builder.class); - } - - // Construct using com.google.showcase.v1beta1.ConnectRequest.ConnectConfig.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { - } - } - @java.lang.Override - public Builder clear() { - super.clear(); - parent_ = ""; - - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return com.google.showcase.v1beta1.MessagingOuterClass.internal_static_google_showcase_v1beta1_ConnectRequest_ConnectConfig_descriptor; - } - - @java.lang.Override - public com.google.showcase.v1beta1.ConnectRequest.ConnectConfig getDefaultInstanceForType() { - return com.google.showcase.v1beta1.ConnectRequest.ConnectConfig.getDefaultInstance(); - } - - @java.lang.Override - public com.google.showcase.v1beta1.ConnectRequest.ConnectConfig build() { - com.google.showcase.v1beta1.ConnectRequest.ConnectConfig result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.showcase.v1beta1.ConnectRequest.ConnectConfig buildPartial() { - com.google.showcase.v1beta1.ConnectRequest.ConnectConfig result = new com.google.showcase.v1beta1.ConnectRequest.ConnectConfig(this); - result.parent_ = parent_; - 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.showcase.v1beta1.ConnectRequest.ConnectConfig) { - return mergeFrom((com.google.showcase.v1beta1.ConnectRequest.ConnectConfig)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.showcase.v1beta1.ConnectRequest.ConnectConfig other) { - if (other == com.google.showcase.v1beta1.ConnectRequest.ConnectConfig.getDefaultInstance()) return this; - if (!other.getParent().isEmpty()) { - parent_ = other.parent_; - onChanged(); - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - com.google.showcase.v1beta1.ConnectRequest.ConnectConfig parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (com.google.showcase.v1beta1.ConnectRequest.ConnectConfig) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private java.lang.Object parent_ = ""; - /** - *
        -       * The room or profile to follow and create messages for.
        -       * 
        - * - * string parent = 1 [(.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; - } - } - /** - *
        -       * The room or profile to follow and create messages for.
        -       * 
        - * - * string parent = 1 [(.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; - } - } - /** - *
        -       * The room or profile to follow and create messages for.
        -       * 
        - * - * string parent = 1 [(.google.api.resource_reference) = { ... } - * @param value The parent to set. - * @return This builder for chaining. - */ - public Builder setParent( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - parent_ = value; - onChanged(); - return this; - } - /** - *
        -       * The room or profile to follow and create messages for.
        -       * 
        - * - * string parent = 1 [(.google.api.resource_reference) = { ... } - * @return This builder for chaining. - */ - public Builder clearParent() { - - parent_ = getDefaultInstance().getParent(); - onChanged(); - return this; - } - /** - *
        -       * The room or profile to follow and create messages for.
        -       * 
        - * - * string parent = 1 [(.google.api.resource_reference) = { ... } - * @param value The bytes for parent to set. - * @return This builder for chaining. - */ - public Builder setParentBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - parent_ = value; - onChanged(); - return this; - } - @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.showcase.v1beta1.ConnectRequest.ConnectConfig) - } - - // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.ConnectRequest.ConnectConfig) - private static final com.google.showcase.v1beta1.ConnectRequest.ConnectConfig DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new com.google.showcase.v1beta1.ConnectRequest.ConnectConfig(); - } - - public static com.google.showcase.v1beta1.ConnectRequest.ConnectConfig getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public ConnectConfig parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new ConnectConfig(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public com.google.showcase.v1beta1.ConnectRequest.ConnectConfig getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - - } - - private int requestCase_ = 0; - private java.lang.Object request_; - public enum RequestCase - implements com.google.protobuf.Internal.EnumLite, - com.google.protobuf.AbstractMessage.InternalOneOfEnum { - CONFIG(1), - BLURB(2), - 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 1: return CONFIG; - case 2: return BLURB; - 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 CONFIG_FIELD_NUMBER = 1; - /** - *
        -   * Provides information that specifies how to process subsequent requests.
        -   * The first `ConnectRequest` message must contain a `config`  message.
        -   * 
        - * - * .google.showcase.v1beta1.ConnectRequest.ConnectConfig config = 1; - * @return Whether the config field is set. - */ - @java.lang.Override - public boolean hasConfig() { - return requestCase_ == 1; - } - /** - *
        -   * Provides information that specifies how to process subsequent requests.
        -   * The first `ConnectRequest` message must contain a `config`  message.
        -   * 
        - * - * .google.showcase.v1beta1.ConnectRequest.ConnectConfig config = 1; - * @return The config. - */ - @java.lang.Override - public com.google.showcase.v1beta1.ConnectRequest.ConnectConfig getConfig() { - if (requestCase_ == 1) { - return (com.google.showcase.v1beta1.ConnectRequest.ConnectConfig) request_; - } - return com.google.showcase.v1beta1.ConnectRequest.ConnectConfig.getDefaultInstance(); - } - /** - *
        -   * Provides information that specifies how to process subsequent requests.
        -   * The first `ConnectRequest` message must contain a `config`  message.
        -   * 
        - * - * .google.showcase.v1beta1.ConnectRequest.ConnectConfig config = 1; - */ - @java.lang.Override - public com.google.showcase.v1beta1.ConnectRequest.ConnectConfigOrBuilder getConfigOrBuilder() { - if (requestCase_ == 1) { - return (com.google.showcase.v1beta1.ConnectRequest.ConnectConfig) request_; - } - return com.google.showcase.v1beta1.ConnectRequest.ConnectConfig.getDefaultInstance(); - } - - public static final int BLURB_FIELD_NUMBER = 2; - /** - *
        -   * The blurb to be created.
        -   * 
        - * - * .google.showcase.v1beta1.Blurb blurb = 2; - * @return Whether the blurb field is set. - */ - @java.lang.Override - public boolean hasBlurb() { - return requestCase_ == 2; - } - /** - *
        -   * The blurb to be created.
        -   * 
        - * - * .google.showcase.v1beta1.Blurb blurb = 2; - * @return The blurb. - */ - @java.lang.Override - public com.google.showcase.v1beta1.Blurb getBlurb() { - if (requestCase_ == 2) { - return (com.google.showcase.v1beta1.Blurb) request_; - } - return com.google.showcase.v1beta1.Blurb.getDefaultInstance(); - } - /** - *
        -   * The blurb to be created.
        -   * 
        - * - * .google.showcase.v1beta1.Blurb blurb = 2; - */ - @java.lang.Override - public com.google.showcase.v1beta1.BlurbOrBuilder getBlurbOrBuilder() { - if (requestCase_ == 2) { - return (com.google.showcase.v1beta1.Blurb) request_; - } - return com.google.showcase.v1beta1.Blurb.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 (requestCase_ == 1) { - output.writeMessage(1, (com.google.showcase.v1beta1.ConnectRequest.ConnectConfig) request_); - } - if (requestCase_ == 2) { - output.writeMessage(2, (com.google.showcase.v1beta1.Blurb) request_); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (requestCase_ == 1) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(1, (com.google.showcase.v1beta1.ConnectRequest.ConnectConfig) request_); - } - if (requestCase_ == 2) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(2, (com.google.showcase.v1beta1.Blurb) request_); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof com.google.showcase.v1beta1.ConnectRequest)) { - return super.equals(obj); - } - com.google.showcase.v1beta1.ConnectRequest other = (com.google.showcase.v1beta1.ConnectRequest) obj; - - if (!getRequestCase().equals(other.getRequestCase())) return false; - switch (requestCase_) { - case 1: - if (!getConfig() - .equals(other.getConfig())) return false; - break; - case 2: - if (!getBlurb() - .equals(other.getBlurb())) return false; - break; - case 0: - default: - } - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - switch (requestCase_) { - case 1: - hash = (37 * hash) + CONFIG_FIELD_NUMBER; - hash = (53 * hash) + getConfig().hashCode(); - break; - case 2: - hash = (37 * hash) + BLURB_FIELD_NUMBER; - hash = (53 * hash) + getBlurb().hashCode(); - break; - case 0: - default: - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.showcase.v1beta1.ConnectRequest parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.showcase.v1beta1.ConnectRequest parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.showcase.v1beta1.ConnectRequest parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.showcase.v1beta1.ConnectRequest 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.showcase.v1beta1.ConnectRequest parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.showcase.v1beta1.ConnectRequest parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.showcase.v1beta1.ConnectRequest parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static com.google.showcase.v1beta1.ConnectRequest 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.showcase.v1beta1.ConnectRequest parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static com.google.showcase.v1beta1.ConnectRequest 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.showcase.v1beta1.ConnectRequest parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static com.google.showcase.v1beta1.ConnectRequest 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.showcase.v1beta1.ConnectRequest 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 request message for the google.showcase.v1beta1.Messaging\Connect
        -   * method.
        -   * 
        - * - * Protobuf type {@code google.showcase.v1beta1.ConnectRequest} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.ConnectRequest) - com.google.showcase.v1beta1.ConnectRequestOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.google.showcase.v1beta1.MessagingOuterClass.internal_static_google_showcase_v1beta1_ConnectRequest_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.showcase.v1beta1.MessagingOuterClass.internal_static_google_showcase_v1beta1_ConnectRequest_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.showcase.v1beta1.ConnectRequest.class, com.google.showcase.v1beta1.ConnectRequest.Builder.class); - } - - // Construct using com.google.showcase.v1beta1.ConnectRequest.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { - } - } - @java.lang.Override - public Builder clear() { - super.clear(); - requestCase_ = 0; - request_ = null; - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return com.google.showcase.v1beta1.MessagingOuterClass.internal_static_google_showcase_v1beta1_ConnectRequest_descriptor; - } - - @java.lang.Override - public com.google.showcase.v1beta1.ConnectRequest getDefaultInstanceForType() { - return com.google.showcase.v1beta1.ConnectRequest.getDefaultInstance(); - } - - @java.lang.Override - public com.google.showcase.v1beta1.ConnectRequest build() { - com.google.showcase.v1beta1.ConnectRequest result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.showcase.v1beta1.ConnectRequest buildPartial() { - com.google.showcase.v1beta1.ConnectRequest result = new com.google.showcase.v1beta1.ConnectRequest(this); - if (requestCase_ == 1) { - if (configBuilder_ == null) { - result.request_ = request_; - } else { - result.request_ = configBuilder_.build(); - } - } - if (requestCase_ == 2) { - if (blurbBuilder_ == null) { - result.request_ = request_; - } else { - result.request_ = blurbBuilder_.build(); - } - } - result.requestCase_ = requestCase_; - 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.showcase.v1beta1.ConnectRequest) { - return mergeFrom((com.google.showcase.v1beta1.ConnectRequest)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.showcase.v1beta1.ConnectRequest other) { - if (other == com.google.showcase.v1beta1.ConnectRequest.getDefaultInstance()) return this; - switch (other.getRequestCase()) { - case CONFIG: { - mergeConfig(other.getConfig()); - break; - } - case BLURB: { - mergeBlurb(other.getBlurb()); - break; - } - case REQUEST_NOT_SET: { - break; - } - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - com.google.showcase.v1beta1.ConnectRequest parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (com.google.showcase.v1beta1.ConnectRequest) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - 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 com.google.protobuf.SingleFieldBuilderV3< - com.google.showcase.v1beta1.ConnectRequest.ConnectConfig, com.google.showcase.v1beta1.ConnectRequest.ConnectConfig.Builder, com.google.showcase.v1beta1.ConnectRequest.ConnectConfigOrBuilder> configBuilder_; - /** - *
        -     * Provides information that specifies how to process subsequent requests.
        -     * The first `ConnectRequest` message must contain a `config`  message.
        -     * 
        - * - * .google.showcase.v1beta1.ConnectRequest.ConnectConfig config = 1; - * @return Whether the config field is set. - */ - @java.lang.Override - public boolean hasConfig() { - return requestCase_ == 1; - } - /** - *
        -     * Provides information that specifies how to process subsequent requests.
        -     * The first `ConnectRequest` message must contain a `config`  message.
        -     * 
        - * - * .google.showcase.v1beta1.ConnectRequest.ConnectConfig config = 1; - * @return The config. - */ - @java.lang.Override - public com.google.showcase.v1beta1.ConnectRequest.ConnectConfig getConfig() { - if (configBuilder_ == null) { - if (requestCase_ == 1) { - return (com.google.showcase.v1beta1.ConnectRequest.ConnectConfig) request_; - } - return com.google.showcase.v1beta1.ConnectRequest.ConnectConfig.getDefaultInstance(); - } else { - if (requestCase_ == 1) { - return configBuilder_.getMessage(); - } - return com.google.showcase.v1beta1.ConnectRequest.ConnectConfig.getDefaultInstance(); - } - } - /** - *
        -     * Provides information that specifies how to process subsequent requests.
        -     * The first `ConnectRequest` message must contain a `config`  message.
        -     * 
        - * - * .google.showcase.v1beta1.ConnectRequest.ConnectConfig config = 1; - */ - public Builder setConfig(com.google.showcase.v1beta1.ConnectRequest.ConnectConfig value) { - if (configBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - request_ = value; - onChanged(); - } else { - configBuilder_.setMessage(value); - } - requestCase_ = 1; - return this; - } - /** - *
        -     * Provides information that specifies how to process subsequent requests.
        -     * The first `ConnectRequest` message must contain a `config`  message.
        -     * 
        - * - * .google.showcase.v1beta1.ConnectRequest.ConnectConfig config = 1; - */ - public Builder setConfig( - com.google.showcase.v1beta1.ConnectRequest.ConnectConfig.Builder builderForValue) { - if (configBuilder_ == null) { - request_ = builderForValue.build(); - onChanged(); - } else { - configBuilder_.setMessage(builderForValue.build()); - } - requestCase_ = 1; - return this; - } - /** - *
        -     * Provides information that specifies how to process subsequent requests.
        -     * The first `ConnectRequest` message must contain a `config`  message.
        -     * 
        - * - * .google.showcase.v1beta1.ConnectRequest.ConnectConfig config = 1; - */ - public Builder mergeConfig(com.google.showcase.v1beta1.ConnectRequest.ConnectConfig value) { - if (configBuilder_ == null) { - if (requestCase_ == 1 && - request_ != com.google.showcase.v1beta1.ConnectRequest.ConnectConfig.getDefaultInstance()) { - request_ = com.google.showcase.v1beta1.ConnectRequest.ConnectConfig.newBuilder((com.google.showcase.v1beta1.ConnectRequest.ConnectConfig) request_) - .mergeFrom(value).buildPartial(); - } else { - request_ = value; - } - onChanged(); - } else { - if (requestCase_ == 1) { - configBuilder_.mergeFrom(value); - } else { - configBuilder_.setMessage(value); - } - } - requestCase_ = 1; - return this; - } - /** - *
        -     * Provides information that specifies how to process subsequent requests.
        -     * The first `ConnectRequest` message must contain a `config`  message.
        -     * 
        - * - * .google.showcase.v1beta1.ConnectRequest.ConnectConfig config = 1; - */ - public Builder clearConfig() { - if (configBuilder_ == null) { - if (requestCase_ == 1) { - requestCase_ = 0; - request_ = null; - onChanged(); - } - } else { - if (requestCase_ == 1) { - requestCase_ = 0; - request_ = null; - } - configBuilder_.clear(); - } - return this; - } - /** - *
        -     * Provides information that specifies how to process subsequent requests.
        -     * The first `ConnectRequest` message must contain a `config`  message.
        -     * 
        - * - * .google.showcase.v1beta1.ConnectRequest.ConnectConfig config = 1; - */ - public com.google.showcase.v1beta1.ConnectRequest.ConnectConfig.Builder getConfigBuilder() { - return getConfigFieldBuilder().getBuilder(); - } - /** - *
        -     * Provides information that specifies how to process subsequent requests.
        -     * The first `ConnectRequest` message must contain a `config`  message.
        -     * 
        - * - * .google.showcase.v1beta1.ConnectRequest.ConnectConfig config = 1; - */ - @java.lang.Override - public com.google.showcase.v1beta1.ConnectRequest.ConnectConfigOrBuilder getConfigOrBuilder() { - if ((requestCase_ == 1) && (configBuilder_ != null)) { - return configBuilder_.getMessageOrBuilder(); - } else { - if (requestCase_ == 1) { - return (com.google.showcase.v1beta1.ConnectRequest.ConnectConfig) request_; - } - return com.google.showcase.v1beta1.ConnectRequest.ConnectConfig.getDefaultInstance(); - } - } - /** - *
        -     * Provides information that specifies how to process subsequent requests.
        -     * The first `ConnectRequest` message must contain a `config`  message.
        -     * 
        - * - * .google.showcase.v1beta1.ConnectRequest.ConnectConfig config = 1; - */ - private com.google.protobuf.SingleFieldBuilderV3< - com.google.showcase.v1beta1.ConnectRequest.ConnectConfig, com.google.showcase.v1beta1.ConnectRequest.ConnectConfig.Builder, com.google.showcase.v1beta1.ConnectRequest.ConnectConfigOrBuilder> - getConfigFieldBuilder() { - if (configBuilder_ == null) { - if (!(requestCase_ == 1)) { - request_ = com.google.showcase.v1beta1.ConnectRequest.ConnectConfig.getDefaultInstance(); - } - configBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - com.google.showcase.v1beta1.ConnectRequest.ConnectConfig, com.google.showcase.v1beta1.ConnectRequest.ConnectConfig.Builder, com.google.showcase.v1beta1.ConnectRequest.ConnectConfigOrBuilder>( - (com.google.showcase.v1beta1.ConnectRequest.ConnectConfig) request_, - getParentForChildren(), - isClean()); - request_ = null; - } - requestCase_ = 1; - onChanged();; - return configBuilder_; - } - - private com.google.protobuf.SingleFieldBuilderV3< - com.google.showcase.v1beta1.Blurb, com.google.showcase.v1beta1.Blurb.Builder, com.google.showcase.v1beta1.BlurbOrBuilder> blurbBuilder_; - /** - *
        -     * The blurb to be created.
        -     * 
        - * - * .google.showcase.v1beta1.Blurb blurb = 2; - * @return Whether the blurb field is set. - */ - @java.lang.Override - public boolean hasBlurb() { - return requestCase_ == 2; - } - /** - *
        -     * The blurb to be created.
        -     * 
        - * - * .google.showcase.v1beta1.Blurb blurb = 2; - * @return The blurb. - */ - @java.lang.Override - public com.google.showcase.v1beta1.Blurb getBlurb() { - if (blurbBuilder_ == null) { - if (requestCase_ == 2) { - return (com.google.showcase.v1beta1.Blurb) request_; - } - return com.google.showcase.v1beta1.Blurb.getDefaultInstance(); - } else { - if (requestCase_ == 2) { - return blurbBuilder_.getMessage(); - } - return com.google.showcase.v1beta1.Blurb.getDefaultInstance(); - } - } - /** - *
        -     * The blurb to be created.
        -     * 
        - * - * .google.showcase.v1beta1.Blurb blurb = 2; - */ - public Builder setBlurb(com.google.showcase.v1beta1.Blurb value) { - if (blurbBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - request_ = value; - onChanged(); - } else { - blurbBuilder_.setMessage(value); - } - requestCase_ = 2; - return this; - } - /** - *
        -     * The blurb to be created.
        -     * 
        - * - * .google.showcase.v1beta1.Blurb blurb = 2; - */ - public Builder setBlurb( - com.google.showcase.v1beta1.Blurb.Builder builderForValue) { - if (blurbBuilder_ == null) { - request_ = builderForValue.build(); - onChanged(); - } else { - blurbBuilder_.setMessage(builderForValue.build()); - } - requestCase_ = 2; - return this; - } - /** - *
        -     * The blurb to be created.
        -     * 
        - * - * .google.showcase.v1beta1.Blurb blurb = 2; - */ - public Builder mergeBlurb(com.google.showcase.v1beta1.Blurb value) { - if (blurbBuilder_ == null) { - if (requestCase_ == 2 && - request_ != com.google.showcase.v1beta1.Blurb.getDefaultInstance()) { - request_ = com.google.showcase.v1beta1.Blurb.newBuilder((com.google.showcase.v1beta1.Blurb) request_) - .mergeFrom(value).buildPartial(); - } else { - request_ = value; - } - onChanged(); - } else { - if (requestCase_ == 2) { - blurbBuilder_.mergeFrom(value); - } else { - blurbBuilder_.setMessage(value); - } - } - requestCase_ = 2; - return this; - } - /** - *
        -     * The blurb to be created.
        -     * 
        - * - * .google.showcase.v1beta1.Blurb blurb = 2; - */ - public Builder clearBlurb() { - if (blurbBuilder_ == null) { - if (requestCase_ == 2) { - requestCase_ = 0; - request_ = null; - onChanged(); - } - } else { - if (requestCase_ == 2) { - requestCase_ = 0; - request_ = null; - } - blurbBuilder_.clear(); - } - return this; - } - /** - *
        -     * The blurb to be created.
        -     * 
        - * - * .google.showcase.v1beta1.Blurb blurb = 2; - */ - public com.google.showcase.v1beta1.Blurb.Builder getBlurbBuilder() { - return getBlurbFieldBuilder().getBuilder(); - } - /** - *
        -     * The blurb to be created.
        -     * 
        - * - * .google.showcase.v1beta1.Blurb blurb = 2; - */ - @java.lang.Override - public com.google.showcase.v1beta1.BlurbOrBuilder getBlurbOrBuilder() { - if ((requestCase_ == 2) && (blurbBuilder_ != null)) { - return blurbBuilder_.getMessageOrBuilder(); - } else { - if (requestCase_ == 2) { - return (com.google.showcase.v1beta1.Blurb) request_; - } - return com.google.showcase.v1beta1.Blurb.getDefaultInstance(); - } - } - /** - *
        -     * The blurb to be created.
        -     * 
        - * - * .google.showcase.v1beta1.Blurb blurb = 2; - */ - private com.google.protobuf.SingleFieldBuilderV3< - com.google.showcase.v1beta1.Blurb, com.google.showcase.v1beta1.Blurb.Builder, com.google.showcase.v1beta1.BlurbOrBuilder> - getBlurbFieldBuilder() { - if (blurbBuilder_ == null) { - if (!(requestCase_ == 2)) { - request_ = com.google.showcase.v1beta1.Blurb.getDefaultInstance(); - } - blurbBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - com.google.showcase.v1beta1.Blurb, com.google.showcase.v1beta1.Blurb.Builder, com.google.showcase.v1beta1.BlurbOrBuilder>( - (com.google.showcase.v1beta1.Blurb) request_, - getParentForChildren(), - isClean()); - request_ = null; - } - requestCase_ = 2; - onChanged();; - return blurbBuilder_; - } - @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.showcase.v1beta1.ConnectRequest) - } - - // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.ConnectRequest) - private static final com.google.showcase.v1beta1.ConnectRequest DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new com.google.showcase.v1beta1.ConnectRequest(); - } - - public static com.google.showcase.v1beta1.ConnectRequest getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public ConnectRequest parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new ConnectRequest(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public com.google.showcase.v1beta1.ConnectRequest getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ConnectRequestOrBuilder.java b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ConnectRequestOrBuilder.java deleted file mode 100644 index 69ed6fc296..0000000000 --- a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ConnectRequestOrBuilder.java +++ /dev/null @@ -1,68 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: schema/google/showcase/v1beta1/messaging.proto - -package com.google.showcase.v1beta1; - -public interface ConnectRequestOrBuilder extends - // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.ConnectRequest) - com.google.protobuf.MessageOrBuilder { - - /** - *
        -   * Provides information that specifies how to process subsequent requests.
        -   * The first `ConnectRequest` message must contain a `config`  message.
        -   * 
        - * - * .google.showcase.v1beta1.ConnectRequest.ConnectConfig config = 1; - * @return Whether the config field is set. - */ - boolean hasConfig(); - /** - *
        -   * Provides information that specifies how to process subsequent requests.
        -   * The first `ConnectRequest` message must contain a `config`  message.
        -   * 
        - * - * .google.showcase.v1beta1.ConnectRequest.ConnectConfig config = 1; - * @return The config. - */ - com.google.showcase.v1beta1.ConnectRequest.ConnectConfig getConfig(); - /** - *
        -   * Provides information that specifies how to process subsequent requests.
        -   * The first `ConnectRequest` message must contain a `config`  message.
        -   * 
        - * - * .google.showcase.v1beta1.ConnectRequest.ConnectConfig config = 1; - */ - com.google.showcase.v1beta1.ConnectRequest.ConnectConfigOrBuilder getConfigOrBuilder(); - - /** - *
        -   * The blurb to be created.
        -   * 
        - * - * .google.showcase.v1beta1.Blurb blurb = 2; - * @return Whether the blurb field is set. - */ - boolean hasBlurb(); - /** - *
        -   * The blurb to be created.
        -   * 
        - * - * .google.showcase.v1beta1.Blurb blurb = 2; - * @return The blurb. - */ - com.google.showcase.v1beta1.Blurb getBlurb(); - /** - *
        -   * The blurb to be created.
        -   * 
        - * - * .google.showcase.v1beta1.Blurb blurb = 2; - */ - com.google.showcase.v1beta1.BlurbOrBuilder getBlurbOrBuilder(); - - public com.google.showcase.v1beta1.ConnectRequest.RequestCase getRequestCase(); -} diff --git a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/Continent.java b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/Continent.java deleted file mode 100644 index 3d6c3396ca..0000000000 --- a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/Continent.java +++ /dev/null @@ -1,149 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: schema/google/showcase/v1beta1/compliance.proto - -package com.google.showcase.v1beta1; - -/** - * Protobuf enum {@code google.showcase.v1beta1.Continent} - */ -public enum Continent - implements com.google.protobuf.ProtocolMessageEnum { - /** - * CONTINENT_UNSPECIFIED = 0; - */ - CONTINENT_UNSPECIFIED(0), - /** - * AFRICA = 1; - */ - AFRICA(1), - /** - * AMERICA = 2; - */ - AMERICA(2), - /** - * ANTARTICA = 3; - */ - ANTARTICA(3), - /** - * AUSTRALIA = 4; - */ - AUSTRALIA(4), - /** - * EUROPE = 5; - */ - EUROPE(5), - UNRECOGNIZED(-1), - ; - - /** - * CONTINENT_UNSPECIFIED = 0; - */ - public static final int CONTINENT_UNSPECIFIED_VALUE = 0; - /** - * AFRICA = 1; - */ - public static final int AFRICA_VALUE = 1; - /** - * AMERICA = 2; - */ - public static final int AMERICA_VALUE = 2; - /** - * ANTARTICA = 3; - */ - public static final int ANTARTICA_VALUE = 3; - /** - * AUSTRALIA = 4; - */ - public static final int AUSTRALIA_VALUE = 4; - /** - * EUROPE = 5; - */ - public static final int EUROPE_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 Continent 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 Continent forNumber(int value) { - switch (value) { - case 0: return CONTINENT_UNSPECIFIED; - case 1: return AFRICA; - case 2: return AMERICA; - case 3: return ANTARTICA; - case 4: return AUSTRALIA; - case 5: return EUROPE; - default: return null; - } - } - - public static com.google.protobuf.Internal.EnumLiteMap - internalGetValueMap() { - return internalValueMap; - } - private static final com.google.protobuf.Internal.EnumLiteMap< - Continent> internalValueMap = - new com.google.protobuf.Internal.EnumLiteMap() { - public Continent findValueByNumber(int number) { - return Continent.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.showcase.v1beta1.ComplianceOuterClass.getDescriptor().getEnumTypes().get(0); - } - - private static final Continent[] VALUES = values(); - - public static Continent 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 Continent(int value) { - this.value = value; - } - - // @@protoc_insertion_point(enum_scope:google.showcase.v1beta1.Continent) -} - diff --git a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/CreateBlurbRequest.java b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/CreateBlurbRequest.java deleted file mode 100644 index 1fed27c664..0000000000 --- a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/CreateBlurbRequest.java +++ /dev/null @@ -1,840 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: schema/google/showcase/v1beta1/messaging.proto - -package com.google.showcase.v1beta1; - -/** - *
        - * The request message for the google.showcase.v1beta1.Messaging\CreateBlurb
        - * method.
        - * 
        - * - * Protobuf type {@code google.showcase.v1beta1.CreateBlurbRequest} - */ -public final class CreateBlurbRequest extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.CreateBlurbRequest) - CreateBlurbRequestOrBuilder { -private static final long serialVersionUID = 0L; - // Use CreateBlurbRequest.newBuilder() to construct. - private CreateBlurbRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private CreateBlurbRequest() { - parent_ = ""; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new CreateBlurbRequest(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private CreateBlurbRequest( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: { - java.lang.String s = input.readStringRequireUtf8(); - - parent_ = s; - break; - } - case 18: { - com.google.showcase.v1beta1.Blurb.Builder subBuilder = null; - if (blurb_ != null) { - subBuilder = blurb_.toBuilder(); - } - blurb_ = input.readMessage(com.google.showcase.v1beta1.Blurb.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(blurb_); - blurb_ = subBuilder.buildPartial(); - } - - break; - } - default: { - if (!parseUnknownField( - input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException( - e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.google.showcase.v1beta1.MessagingOuterClass.internal_static_google_showcase_v1beta1_CreateBlurbRequest_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.showcase.v1beta1.MessagingOuterClass.internal_static_google_showcase_v1beta1_CreateBlurbRequest_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.showcase.v1beta1.CreateBlurbRequest.class, com.google.showcase.v1beta1.CreateBlurbRequest.Builder.class); - } - - public static final int PARENT_FIELD_NUMBER = 1; - private volatile java.lang.Object parent_; - /** - *
        -   * The resource name of the chat room or user profile that this blurb will
        -   * be tied to.
        -   * 
        - * - * 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; - } - } - /** - *
        -   * The resource name of the chat room or user profile that this blurb will
        -   * be tied to.
        -   * 
        - * - * 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 BLURB_FIELD_NUMBER = 2; - private com.google.showcase.v1beta1.Blurb blurb_; - /** - *
        -   * The blurb to create.
        -   * 
        - * - * .google.showcase.v1beta1.Blurb blurb = 2; - * @return Whether the blurb field is set. - */ - @java.lang.Override - public boolean hasBlurb() { - return blurb_ != null; - } - /** - *
        -   * The blurb to create.
        -   * 
        - * - * .google.showcase.v1beta1.Blurb blurb = 2; - * @return The blurb. - */ - @java.lang.Override - public com.google.showcase.v1beta1.Blurb getBlurb() { - return blurb_ == null ? com.google.showcase.v1beta1.Blurb.getDefaultInstance() : blurb_; - } - /** - *
        -   * The blurb to create.
        -   * 
        - * - * .google.showcase.v1beta1.Blurb blurb = 2; - */ - @java.lang.Override - public com.google.showcase.v1beta1.BlurbOrBuilder getBlurbOrBuilder() { - return getBlurb(); - } - - 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 (blurb_ != null) { - output.writeMessage(2, getBlurb()); - } - unknownFields.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 (blurb_ != null) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(2, getBlurb()); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof com.google.showcase.v1beta1.CreateBlurbRequest)) { - return super.equals(obj); - } - com.google.showcase.v1beta1.CreateBlurbRequest other = (com.google.showcase.v1beta1.CreateBlurbRequest) obj; - - if (!getParent() - .equals(other.getParent())) return false; - if (hasBlurb() != other.hasBlurb()) return false; - if (hasBlurb()) { - if (!getBlurb() - .equals(other.getBlurb())) return false; - } - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - hash = (37 * hash) + PARENT_FIELD_NUMBER; - hash = (53 * hash) + getParent().hashCode(); - if (hasBlurb()) { - hash = (37 * hash) + BLURB_FIELD_NUMBER; - hash = (53 * hash) + getBlurb().hashCode(); - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.showcase.v1beta1.CreateBlurbRequest parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.showcase.v1beta1.CreateBlurbRequest parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.showcase.v1beta1.CreateBlurbRequest parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.showcase.v1beta1.CreateBlurbRequest 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.showcase.v1beta1.CreateBlurbRequest parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.showcase.v1beta1.CreateBlurbRequest parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.showcase.v1beta1.CreateBlurbRequest parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static com.google.showcase.v1beta1.CreateBlurbRequest 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.showcase.v1beta1.CreateBlurbRequest parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static com.google.showcase.v1beta1.CreateBlurbRequest 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.showcase.v1beta1.CreateBlurbRequest parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static com.google.showcase.v1beta1.CreateBlurbRequest 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.showcase.v1beta1.CreateBlurbRequest 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 request message for the google.showcase.v1beta1.Messaging\CreateBlurb
        -   * method.
        -   * 
        - * - * Protobuf type {@code google.showcase.v1beta1.CreateBlurbRequest} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.CreateBlurbRequest) - com.google.showcase.v1beta1.CreateBlurbRequestOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.google.showcase.v1beta1.MessagingOuterClass.internal_static_google_showcase_v1beta1_CreateBlurbRequest_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.showcase.v1beta1.MessagingOuterClass.internal_static_google_showcase_v1beta1_CreateBlurbRequest_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.showcase.v1beta1.CreateBlurbRequest.class, com.google.showcase.v1beta1.CreateBlurbRequest.Builder.class); - } - - // Construct using com.google.showcase.v1beta1.CreateBlurbRequest.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { - } - } - @java.lang.Override - public Builder clear() { - super.clear(); - parent_ = ""; - - if (blurbBuilder_ == null) { - blurb_ = null; - } else { - blurb_ = null; - blurbBuilder_ = null; - } - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return com.google.showcase.v1beta1.MessagingOuterClass.internal_static_google_showcase_v1beta1_CreateBlurbRequest_descriptor; - } - - @java.lang.Override - public com.google.showcase.v1beta1.CreateBlurbRequest getDefaultInstanceForType() { - return com.google.showcase.v1beta1.CreateBlurbRequest.getDefaultInstance(); - } - - @java.lang.Override - public com.google.showcase.v1beta1.CreateBlurbRequest build() { - com.google.showcase.v1beta1.CreateBlurbRequest result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.showcase.v1beta1.CreateBlurbRequest buildPartial() { - com.google.showcase.v1beta1.CreateBlurbRequest result = new com.google.showcase.v1beta1.CreateBlurbRequest(this); - result.parent_ = parent_; - if (blurbBuilder_ == null) { - result.blurb_ = blurb_; - } else { - result.blurb_ = blurbBuilder_.build(); - } - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.setField(field, value); - } - @java.lang.Override - public Builder clearField( - com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - @java.lang.Override - public Builder clearOneof( - com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.addRepeatedField(field, value); - } - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof com.google.showcase.v1beta1.CreateBlurbRequest) { - return mergeFrom((com.google.showcase.v1beta1.CreateBlurbRequest)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.showcase.v1beta1.CreateBlurbRequest other) { - if (other == com.google.showcase.v1beta1.CreateBlurbRequest.getDefaultInstance()) return this; - if (!other.getParent().isEmpty()) { - parent_ = other.parent_; - onChanged(); - } - if (other.hasBlurb()) { - mergeBlurb(other.getBlurb()); - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - com.google.showcase.v1beta1.CreateBlurbRequest parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (com.google.showcase.v1beta1.CreateBlurbRequest) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private java.lang.Object parent_ = ""; - /** - *
        -     * The resource name of the chat room or user profile that this blurb will
        -     * be tied to.
        -     * 
        - * - * 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; - } - } - /** - *
        -     * The resource name of the chat room or user profile that this blurb will
        -     * be tied to.
        -     * 
        - * - * 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; - } - } - /** - *
        -     * The resource name of the chat room or user profile that this blurb will
        -     * be tied to.
        -     * 
        - * - * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * @param value The parent to set. - * @return This builder for chaining. - */ - public Builder setParent( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - parent_ = value; - onChanged(); - return this; - } - /** - *
        -     * The resource name of the chat room or user profile that this blurb will
        -     * be tied to.
        -     * 
        - * - * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * @return This builder for chaining. - */ - public Builder clearParent() { - - parent_ = getDefaultInstance().getParent(); - onChanged(); - return this; - } - /** - *
        -     * The resource name of the chat room or user profile that this blurb will
        -     * be tied to.
        -     * 
        - * - * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * @param value The bytes for parent to set. - * @return This builder for chaining. - */ - public Builder setParentBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - parent_ = value; - onChanged(); - return this; - } - - private com.google.showcase.v1beta1.Blurb blurb_; - private com.google.protobuf.SingleFieldBuilderV3< - com.google.showcase.v1beta1.Blurb, com.google.showcase.v1beta1.Blurb.Builder, com.google.showcase.v1beta1.BlurbOrBuilder> blurbBuilder_; - /** - *
        -     * The blurb to create.
        -     * 
        - * - * .google.showcase.v1beta1.Blurb blurb = 2; - * @return Whether the blurb field is set. - */ - public boolean hasBlurb() { - return blurbBuilder_ != null || blurb_ != null; - } - /** - *
        -     * The blurb to create.
        -     * 
        - * - * .google.showcase.v1beta1.Blurb blurb = 2; - * @return The blurb. - */ - public com.google.showcase.v1beta1.Blurb getBlurb() { - if (blurbBuilder_ == null) { - return blurb_ == null ? com.google.showcase.v1beta1.Blurb.getDefaultInstance() : blurb_; - } else { - return blurbBuilder_.getMessage(); - } - } - /** - *
        -     * The blurb to create.
        -     * 
        - * - * .google.showcase.v1beta1.Blurb blurb = 2; - */ - public Builder setBlurb(com.google.showcase.v1beta1.Blurb value) { - if (blurbBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - blurb_ = value; - onChanged(); - } else { - blurbBuilder_.setMessage(value); - } - - return this; - } - /** - *
        -     * The blurb to create.
        -     * 
        - * - * .google.showcase.v1beta1.Blurb blurb = 2; - */ - public Builder setBlurb( - com.google.showcase.v1beta1.Blurb.Builder builderForValue) { - if (blurbBuilder_ == null) { - blurb_ = builderForValue.build(); - onChanged(); - } else { - blurbBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - *
        -     * The blurb to create.
        -     * 
        - * - * .google.showcase.v1beta1.Blurb blurb = 2; - */ - public Builder mergeBlurb(com.google.showcase.v1beta1.Blurb value) { - if (blurbBuilder_ == null) { - if (blurb_ != null) { - blurb_ = - com.google.showcase.v1beta1.Blurb.newBuilder(blurb_).mergeFrom(value).buildPartial(); - } else { - blurb_ = value; - } - onChanged(); - } else { - blurbBuilder_.mergeFrom(value); - } - - return this; - } - /** - *
        -     * The blurb to create.
        -     * 
        - * - * .google.showcase.v1beta1.Blurb blurb = 2; - */ - public Builder clearBlurb() { - if (blurbBuilder_ == null) { - blurb_ = null; - onChanged(); - } else { - blurb_ = null; - blurbBuilder_ = null; - } - - return this; - } - /** - *
        -     * The blurb to create.
        -     * 
        - * - * .google.showcase.v1beta1.Blurb blurb = 2; - */ - public com.google.showcase.v1beta1.Blurb.Builder getBlurbBuilder() { - - onChanged(); - return getBlurbFieldBuilder().getBuilder(); - } - /** - *
        -     * The blurb to create.
        -     * 
        - * - * .google.showcase.v1beta1.Blurb blurb = 2; - */ - public com.google.showcase.v1beta1.BlurbOrBuilder getBlurbOrBuilder() { - if (blurbBuilder_ != null) { - return blurbBuilder_.getMessageOrBuilder(); - } else { - return blurb_ == null ? - com.google.showcase.v1beta1.Blurb.getDefaultInstance() : blurb_; - } - } - /** - *
        -     * The blurb to create.
        -     * 
        - * - * .google.showcase.v1beta1.Blurb blurb = 2; - */ - private com.google.protobuf.SingleFieldBuilderV3< - com.google.showcase.v1beta1.Blurb, com.google.showcase.v1beta1.Blurb.Builder, com.google.showcase.v1beta1.BlurbOrBuilder> - getBlurbFieldBuilder() { - if (blurbBuilder_ == null) { - blurbBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - com.google.showcase.v1beta1.Blurb, com.google.showcase.v1beta1.Blurb.Builder, com.google.showcase.v1beta1.BlurbOrBuilder>( - getBlurb(), - getParentForChildren(), - isClean()); - blurb_ = null; - } - return blurbBuilder_; - } - @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.showcase.v1beta1.CreateBlurbRequest) - } - - // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.CreateBlurbRequest) - private static final com.google.showcase.v1beta1.CreateBlurbRequest DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new com.google.showcase.v1beta1.CreateBlurbRequest(); - } - - public static com.google.showcase.v1beta1.CreateBlurbRequest getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public CreateBlurbRequest parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new CreateBlurbRequest(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public com.google.showcase.v1beta1.CreateBlurbRequest getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/CreateBlurbRequestOrBuilder.java b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/CreateBlurbRequestOrBuilder.java deleted file mode 100644 index 53ed164793..0000000000 --- a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/CreateBlurbRequestOrBuilder.java +++ /dev/null @@ -1,58 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: schema/google/showcase/v1beta1/messaging.proto - -package com.google.showcase.v1beta1; - -public interface CreateBlurbRequestOrBuilder extends - // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.CreateBlurbRequest) - com.google.protobuf.MessageOrBuilder { - - /** - *
        -   * The resource name of the chat room or user profile that this blurb will
        -   * be tied to.
        -   * 
        - * - * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * @return The parent. - */ - java.lang.String getParent(); - /** - *
        -   * The resource name of the chat room or user profile that this blurb will
        -   * be tied to.
        -   * 
        - * - * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * @return The bytes for parent. - */ - com.google.protobuf.ByteString - getParentBytes(); - - /** - *
        -   * The blurb to create.
        -   * 
        - * - * .google.showcase.v1beta1.Blurb blurb = 2; - * @return Whether the blurb field is set. - */ - boolean hasBlurb(); - /** - *
        -   * The blurb to create.
        -   * 
        - * - * .google.showcase.v1beta1.Blurb blurb = 2; - * @return The blurb. - */ - com.google.showcase.v1beta1.Blurb getBlurb(); - /** - *
        -   * The blurb to create.
        -   * 
        - * - * .google.showcase.v1beta1.Blurb blurb = 2; - */ - com.google.showcase.v1beta1.BlurbOrBuilder getBlurbOrBuilder(); -} diff --git a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/CreateRoomRequest.java b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/CreateRoomRequest.java deleted file mode 100644 index 5982b2f59c..0000000000 --- a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/CreateRoomRequest.java +++ /dev/null @@ -1,667 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: schema/google/showcase/v1beta1/messaging.proto - -package com.google.showcase.v1beta1; - -/** - *
        - * The request message for the google.showcase.v1beta1.Messaging\CreateRoom
        - * method.
        - * 
        - * - * Protobuf type {@code google.showcase.v1beta1.CreateRoomRequest} - */ -public final class CreateRoomRequest extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.CreateRoomRequest) - CreateRoomRequestOrBuilder { -private static final long serialVersionUID = 0L; - // Use CreateRoomRequest.newBuilder() to construct. - private CreateRoomRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private CreateRoomRequest() { - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new CreateRoomRequest(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private CreateRoomRequest( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: { - com.google.showcase.v1beta1.Room.Builder subBuilder = null; - if (room_ != null) { - subBuilder = room_.toBuilder(); - } - room_ = input.readMessage(com.google.showcase.v1beta1.Room.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(room_); - room_ = subBuilder.buildPartial(); - } - - break; - } - default: { - if (!parseUnknownField( - input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException( - e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.google.showcase.v1beta1.MessagingOuterClass.internal_static_google_showcase_v1beta1_CreateRoomRequest_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.showcase.v1beta1.MessagingOuterClass.internal_static_google_showcase_v1beta1_CreateRoomRequest_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.showcase.v1beta1.CreateRoomRequest.class, com.google.showcase.v1beta1.CreateRoomRequest.Builder.class); - } - - public static final int ROOM_FIELD_NUMBER = 1; - private com.google.showcase.v1beta1.Room room_; - /** - *
        -   * The room to create.
        -   * 
        - * - * .google.showcase.v1beta1.Room room = 1; - * @return Whether the room field is set. - */ - @java.lang.Override - public boolean hasRoom() { - return room_ != null; - } - /** - *
        -   * The room to create.
        -   * 
        - * - * .google.showcase.v1beta1.Room room = 1; - * @return The room. - */ - @java.lang.Override - public com.google.showcase.v1beta1.Room getRoom() { - return room_ == null ? com.google.showcase.v1beta1.Room.getDefaultInstance() : room_; - } - /** - *
        -   * The room to create.
        -   * 
        - * - * .google.showcase.v1beta1.Room room = 1; - */ - @java.lang.Override - public com.google.showcase.v1beta1.RoomOrBuilder getRoomOrBuilder() { - return getRoom(); - } - - 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 (room_ != null) { - output.writeMessage(1, getRoom()); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (room_ != null) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(1, getRoom()); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof com.google.showcase.v1beta1.CreateRoomRequest)) { - return super.equals(obj); - } - com.google.showcase.v1beta1.CreateRoomRequest other = (com.google.showcase.v1beta1.CreateRoomRequest) obj; - - if (hasRoom() != other.hasRoom()) return false; - if (hasRoom()) { - if (!getRoom() - .equals(other.getRoom())) return false; - } - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - if (hasRoom()) { - hash = (37 * hash) + ROOM_FIELD_NUMBER; - hash = (53 * hash) + getRoom().hashCode(); - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.showcase.v1beta1.CreateRoomRequest parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.showcase.v1beta1.CreateRoomRequest parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.showcase.v1beta1.CreateRoomRequest parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.showcase.v1beta1.CreateRoomRequest 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.showcase.v1beta1.CreateRoomRequest parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.showcase.v1beta1.CreateRoomRequest parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.showcase.v1beta1.CreateRoomRequest parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static com.google.showcase.v1beta1.CreateRoomRequest 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.showcase.v1beta1.CreateRoomRequest parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static com.google.showcase.v1beta1.CreateRoomRequest 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.showcase.v1beta1.CreateRoomRequest parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static com.google.showcase.v1beta1.CreateRoomRequest 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.showcase.v1beta1.CreateRoomRequest 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 request message for the google.showcase.v1beta1.Messaging\CreateRoom
        -   * method.
        -   * 
        - * - * Protobuf type {@code google.showcase.v1beta1.CreateRoomRequest} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.CreateRoomRequest) - com.google.showcase.v1beta1.CreateRoomRequestOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.google.showcase.v1beta1.MessagingOuterClass.internal_static_google_showcase_v1beta1_CreateRoomRequest_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.showcase.v1beta1.MessagingOuterClass.internal_static_google_showcase_v1beta1_CreateRoomRequest_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.showcase.v1beta1.CreateRoomRequest.class, com.google.showcase.v1beta1.CreateRoomRequest.Builder.class); - } - - // Construct using com.google.showcase.v1beta1.CreateRoomRequest.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { - } - } - @java.lang.Override - public Builder clear() { - super.clear(); - if (roomBuilder_ == null) { - room_ = null; - } else { - room_ = null; - roomBuilder_ = null; - } - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return com.google.showcase.v1beta1.MessagingOuterClass.internal_static_google_showcase_v1beta1_CreateRoomRequest_descriptor; - } - - @java.lang.Override - public com.google.showcase.v1beta1.CreateRoomRequest getDefaultInstanceForType() { - return com.google.showcase.v1beta1.CreateRoomRequest.getDefaultInstance(); - } - - @java.lang.Override - public com.google.showcase.v1beta1.CreateRoomRequest build() { - com.google.showcase.v1beta1.CreateRoomRequest result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.showcase.v1beta1.CreateRoomRequest buildPartial() { - com.google.showcase.v1beta1.CreateRoomRequest result = new com.google.showcase.v1beta1.CreateRoomRequest(this); - if (roomBuilder_ == null) { - result.room_ = room_; - } else { - result.room_ = roomBuilder_.build(); - } - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.setField(field, value); - } - @java.lang.Override - public Builder clearField( - com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - @java.lang.Override - public Builder clearOneof( - com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.addRepeatedField(field, value); - } - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof com.google.showcase.v1beta1.CreateRoomRequest) { - return mergeFrom((com.google.showcase.v1beta1.CreateRoomRequest)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.showcase.v1beta1.CreateRoomRequest other) { - if (other == com.google.showcase.v1beta1.CreateRoomRequest.getDefaultInstance()) return this; - if (other.hasRoom()) { - mergeRoom(other.getRoom()); - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - com.google.showcase.v1beta1.CreateRoomRequest parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (com.google.showcase.v1beta1.CreateRoomRequest) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private com.google.showcase.v1beta1.Room room_; - private com.google.protobuf.SingleFieldBuilderV3< - com.google.showcase.v1beta1.Room, com.google.showcase.v1beta1.Room.Builder, com.google.showcase.v1beta1.RoomOrBuilder> roomBuilder_; - /** - *
        -     * The room to create.
        -     * 
        - * - * .google.showcase.v1beta1.Room room = 1; - * @return Whether the room field is set. - */ - public boolean hasRoom() { - return roomBuilder_ != null || room_ != null; - } - /** - *
        -     * The room to create.
        -     * 
        - * - * .google.showcase.v1beta1.Room room = 1; - * @return The room. - */ - public com.google.showcase.v1beta1.Room getRoom() { - if (roomBuilder_ == null) { - return room_ == null ? com.google.showcase.v1beta1.Room.getDefaultInstance() : room_; - } else { - return roomBuilder_.getMessage(); - } - } - /** - *
        -     * The room to create.
        -     * 
        - * - * .google.showcase.v1beta1.Room room = 1; - */ - public Builder setRoom(com.google.showcase.v1beta1.Room value) { - if (roomBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - room_ = value; - onChanged(); - } else { - roomBuilder_.setMessage(value); - } - - return this; - } - /** - *
        -     * The room to create.
        -     * 
        - * - * .google.showcase.v1beta1.Room room = 1; - */ - public Builder setRoom( - com.google.showcase.v1beta1.Room.Builder builderForValue) { - if (roomBuilder_ == null) { - room_ = builderForValue.build(); - onChanged(); - } else { - roomBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - *
        -     * The room to create.
        -     * 
        - * - * .google.showcase.v1beta1.Room room = 1; - */ - public Builder mergeRoom(com.google.showcase.v1beta1.Room value) { - if (roomBuilder_ == null) { - if (room_ != null) { - room_ = - com.google.showcase.v1beta1.Room.newBuilder(room_).mergeFrom(value).buildPartial(); - } else { - room_ = value; - } - onChanged(); - } else { - roomBuilder_.mergeFrom(value); - } - - return this; - } - /** - *
        -     * The room to create.
        -     * 
        - * - * .google.showcase.v1beta1.Room room = 1; - */ - public Builder clearRoom() { - if (roomBuilder_ == null) { - room_ = null; - onChanged(); - } else { - room_ = null; - roomBuilder_ = null; - } - - return this; - } - /** - *
        -     * The room to create.
        -     * 
        - * - * .google.showcase.v1beta1.Room room = 1; - */ - public com.google.showcase.v1beta1.Room.Builder getRoomBuilder() { - - onChanged(); - return getRoomFieldBuilder().getBuilder(); - } - /** - *
        -     * The room to create.
        -     * 
        - * - * .google.showcase.v1beta1.Room room = 1; - */ - public com.google.showcase.v1beta1.RoomOrBuilder getRoomOrBuilder() { - if (roomBuilder_ != null) { - return roomBuilder_.getMessageOrBuilder(); - } else { - return room_ == null ? - com.google.showcase.v1beta1.Room.getDefaultInstance() : room_; - } - } - /** - *
        -     * The room to create.
        -     * 
        - * - * .google.showcase.v1beta1.Room room = 1; - */ - private com.google.protobuf.SingleFieldBuilderV3< - com.google.showcase.v1beta1.Room, com.google.showcase.v1beta1.Room.Builder, com.google.showcase.v1beta1.RoomOrBuilder> - getRoomFieldBuilder() { - if (roomBuilder_ == null) { - roomBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - com.google.showcase.v1beta1.Room, com.google.showcase.v1beta1.Room.Builder, com.google.showcase.v1beta1.RoomOrBuilder>( - getRoom(), - getParentForChildren(), - isClean()); - room_ = null; - } - return roomBuilder_; - } - @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.showcase.v1beta1.CreateRoomRequest) - } - - // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.CreateRoomRequest) - private static final com.google.showcase.v1beta1.CreateRoomRequest DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new com.google.showcase.v1beta1.CreateRoomRequest(); - } - - public static com.google.showcase.v1beta1.CreateRoomRequest getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public CreateRoomRequest parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new CreateRoomRequest(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public com.google.showcase.v1beta1.CreateRoomRequest getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/CreateRoomRequestOrBuilder.java b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/CreateRoomRequestOrBuilder.java deleted file mode 100644 index c912301453..0000000000 --- a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/CreateRoomRequestOrBuilder.java +++ /dev/null @@ -1,36 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: schema/google/showcase/v1beta1/messaging.proto - -package com.google.showcase.v1beta1; - -public interface CreateRoomRequestOrBuilder extends - // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.CreateRoomRequest) - com.google.protobuf.MessageOrBuilder { - - /** - *
        -   * The room to create.
        -   * 
        - * - * .google.showcase.v1beta1.Room room = 1; - * @return Whether the room field is set. - */ - boolean hasRoom(); - /** - *
        -   * The room to create.
        -   * 
        - * - * .google.showcase.v1beta1.Room room = 1; - * @return The room. - */ - com.google.showcase.v1beta1.Room getRoom(); - /** - *
        -   * The room to create.
        -   * 
        - * - * .google.showcase.v1beta1.Room room = 1; - */ - com.google.showcase.v1beta1.RoomOrBuilder getRoomOrBuilder(); -} diff --git a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/CreateSequenceRequest.java b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/CreateSequenceRequest.java deleted file mode 100644 index 2f8b0a890f..0000000000 --- a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/CreateSequenceRequest.java +++ /dev/null @@ -1,609 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: schema/google/showcase/v1beta1/sequence.proto - -package com.google.showcase.v1beta1; - -/** - * Protobuf type {@code google.showcase.v1beta1.CreateSequenceRequest} - */ -public final class CreateSequenceRequest extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.CreateSequenceRequest) - CreateSequenceRequestOrBuilder { -private static final long serialVersionUID = 0L; - // Use CreateSequenceRequest.newBuilder() to construct. - private CreateSequenceRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private CreateSequenceRequest() { - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new CreateSequenceRequest(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private CreateSequenceRequest( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: { - com.google.showcase.v1beta1.Sequence.Builder subBuilder = null; - if (sequence_ != null) { - subBuilder = sequence_.toBuilder(); - } - sequence_ = input.readMessage(com.google.showcase.v1beta1.Sequence.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(sequence_); - sequence_ = subBuilder.buildPartial(); - } - - break; - } - default: { - if (!parseUnknownField( - input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException( - e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.google.showcase.v1beta1.SequenceOuterClass.internal_static_google_showcase_v1beta1_CreateSequenceRequest_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.showcase.v1beta1.SequenceOuterClass.internal_static_google_showcase_v1beta1_CreateSequenceRequest_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.showcase.v1beta1.CreateSequenceRequest.class, com.google.showcase.v1beta1.CreateSequenceRequest.Builder.class); - } - - public static final int SEQUENCE_FIELD_NUMBER = 1; - private com.google.showcase.v1beta1.Sequence sequence_; - /** - * .google.showcase.v1beta1.Sequence sequence = 1; - * @return Whether the sequence field is set. - */ - @java.lang.Override - public boolean hasSequence() { - return sequence_ != null; - } - /** - * .google.showcase.v1beta1.Sequence sequence = 1; - * @return The sequence. - */ - @java.lang.Override - public com.google.showcase.v1beta1.Sequence getSequence() { - return sequence_ == null ? com.google.showcase.v1beta1.Sequence.getDefaultInstance() : sequence_; - } - /** - * .google.showcase.v1beta1.Sequence sequence = 1; - */ - @java.lang.Override - public com.google.showcase.v1beta1.SequenceOrBuilder getSequenceOrBuilder() { - return getSequence(); - } - - 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 (sequence_ != null) { - output.writeMessage(1, getSequence()); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (sequence_ != null) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(1, getSequence()); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof com.google.showcase.v1beta1.CreateSequenceRequest)) { - return super.equals(obj); - } - com.google.showcase.v1beta1.CreateSequenceRequest other = (com.google.showcase.v1beta1.CreateSequenceRequest) obj; - - if (hasSequence() != other.hasSequence()) return false; - if (hasSequence()) { - if (!getSequence() - .equals(other.getSequence())) return false; - } - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - if (hasSequence()) { - hash = (37 * hash) + SEQUENCE_FIELD_NUMBER; - hash = (53 * hash) + getSequence().hashCode(); - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.showcase.v1beta1.CreateSequenceRequest parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.showcase.v1beta1.CreateSequenceRequest parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.showcase.v1beta1.CreateSequenceRequest parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.showcase.v1beta1.CreateSequenceRequest 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.showcase.v1beta1.CreateSequenceRequest parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.showcase.v1beta1.CreateSequenceRequest parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.showcase.v1beta1.CreateSequenceRequest parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static com.google.showcase.v1beta1.CreateSequenceRequest 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.showcase.v1beta1.CreateSequenceRequest parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static com.google.showcase.v1beta1.CreateSequenceRequest 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.showcase.v1beta1.CreateSequenceRequest parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static com.google.showcase.v1beta1.CreateSequenceRequest 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.showcase.v1beta1.CreateSequenceRequest prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - @java.lang.Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - * Protobuf type {@code google.showcase.v1beta1.CreateSequenceRequest} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.CreateSequenceRequest) - com.google.showcase.v1beta1.CreateSequenceRequestOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.google.showcase.v1beta1.SequenceOuterClass.internal_static_google_showcase_v1beta1_CreateSequenceRequest_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.showcase.v1beta1.SequenceOuterClass.internal_static_google_showcase_v1beta1_CreateSequenceRequest_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.showcase.v1beta1.CreateSequenceRequest.class, com.google.showcase.v1beta1.CreateSequenceRequest.Builder.class); - } - - // Construct using com.google.showcase.v1beta1.CreateSequenceRequest.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { - } - } - @java.lang.Override - public Builder clear() { - super.clear(); - if (sequenceBuilder_ == null) { - sequence_ = null; - } else { - sequence_ = null; - sequenceBuilder_ = null; - } - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return com.google.showcase.v1beta1.SequenceOuterClass.internal_static_google_showcase_v1beta1_CreateSequenceRequest_descriptor; - } - - @java.lang.Override - public com.google.showcase.v1beta1.CreateSequenceRequest getDefaultInstanceForType() { - return com.google.showcase.v1beta1.CreateSequenceRequest.getDefaultInstance(); - } - - @java.lang.Override - public com.google.showcase.v1beta1.CreateSequenceRequest build() { - com.google.showcase.v1beta1.CreateSequenceRequest result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.showcase.v1beta1.CreateSequenceRequest buildPartial() { - com.google.showcase.v1beta1.CreateSequenceRequest result = new com.google.showcase.v1beta1.CreateSequenceRequest(this); - if (sequenceBuilder_ == null) { - result.sequence_ = sequence_; - } else { - result.sequence_ = sequenceBuilder_.build(); - } - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.setField(field, value); - } - @java.lang.Override - public Builder clearField( - com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - @java.lang.Override - public Builder clearOneof( - com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.addRepeatedField(field, value); - } - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof com.google.showcase.v1beta1.CreateSequenceRequest) { - return mergeFrom((com.google.showcase.v1beta1.CreateSequenceRequest)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.showcase.v1beta1.CreateSequenceRequest other) { - if (other == com.google.showcase.v1beta1.CreateSequenceRequest.getDefaultInstance()) return this; - if (other.hasSequence()) { - mergeSequence(other.getSequence()); - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - com.google.showcase.v1beta1.CreateSequenceRequest parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (com.google.showcase.v1beta1.CreateSequenceRequest) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private com.google.showcase.v1beta1.Sequence sequence_; - private com.google.protobuf.SingleFieldBuilderV3< - com.google.showcase.v1beta1.Sequence, com.google.showcase.v1beta1.Sequence.Builder, com.google.showcase.v1beta1.SequenceOrBuilder> sequenceBuilder_; - /** - * .google.showcase.v1beta1.Sequence sequence = 1; - * @return Whether the sequence field is set. - */ - public boolean hasSequence() { - return sequenceBuilder_ != null || sequence_ != null; - } - /** - * .google.showcase.v1beta1.Sequence sequence = 1; - * @return The sequence. - */ - public com.google.showcase.v1beta1.Sequence getSequence() { - if (sequenceBuilder_ == null) { - return sequence_ == null ? com.google.showcase.v1beta1.Sequence.getDefaultInstance() : sequence_; - } else { - return sequenceBuilder_.getMessage(); - } - } - /** - * .google.showcase.v1beta1.Sequence sequence = 1; - */ - public Builder setSequence(com.google.showcase.v1beta1.Sequence value) { - if (sequenceBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - sequence_ = value; - onChanged(); - } else { - sequenceBuilder_.setMessage(value); - } - - return this; - } - /** - * .google.showcase.v1beta1.Sequence sequence = 1; - */ - public Builder setSequence( - com.google.showcase.v1beta1.Sequence.Builder builderForValue) { - if (sequenceBuilder_ == null) { - sequence_ = builderForValue.build(); - onChanged(); - } else { - sequenceBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - * .google.showcase.v1beta1.Sequence sequence = 1; - */ - public Builder mergeSequence(com.google.showcase.v1beta1.Sequence value) { - if (sequenceBuilder_ == null) { - if (sequence_ != null) { - sequence_ = - com.google.showcase.v1beta1.Sequence.newBuilder(sequence_).mergeFrom(value).buildPartial(); - } else { - sequence_ = value; - } - onChanged(); - } else { - sequenceBuilder_.mergeFrom(value); - } - - return this; - } - /** - * .google.showcase.v1beta1.Sequence sequence = 1; - */ - public Builder clearSequence() { - if (sequenceBuilder_ == null) { - sequence_ = null; - onChanged(); - } else { - sequence_ = null; - sequenceBuilder_ = null; - } - - return this; - } - /** - * .google.showcase.v1beta1.Sequence sequence = 1; - */ - public com.google.showcase.v1beta1.Sequence.Builder getSequenceBuilder() { - - onChanged(); - return getSequenceFieldBuilder().getBuilder(); - } - /** - * .google.showcase.v1beta1.Sequence sequence = 1; - */ - public com.google.showcase.v1beta1.SequenceOrBuilder getSequenceOrBuilder() { - if (sequenceBuilder_ != null) { - return sequenceBuilder_.getMessageOrBuilder(); - } else { - return sequence_ == null ? - com.google.showcase.v1beta1.Sequence.getDefaultInstance() : sequence_; - } - } - /** - * .google.showcase.v1beta1.Sequence sequence = 1; - */ - private com.google.protobuf.SingleFieldBuilderV3< - com.google.showcase.v1beta1.Sequence, com.google.showcase.v1beta1.Sequence.Builder, com.google.showcase.v1beta1.SequenceOrBuilder> - getSequenceFieldBuilder() { - if (sequenceBuilder_ == null) { - sequenceBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - com.google.showcase.v1beta1.Sequence, com.google.showcase.v1beta1.Sequence.Builder, com.google.showcase.v1beta1.SequenceOrBuilder>( - getSequence(), - getParentForChildren(), - isClean()); - sequence_ = null; - } - return sequenceBuilder_; - } - @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.showcase.v1beta1.CreateSequenceRequest) - } - - // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.CreateSequenceRequest) - private static final com.google.showcase.v1beta1.CreateSequenceRequest DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new com.google.showcase.v1beta1.CreateSequenceRequest(); - } - - public static com.google.showcase.v1beta1.CreateSequenceRequest getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public CreateSequenceRequest parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new CreateSequenceRequest(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public com.google.showcase.v1beta1.CreateSequenceRequest getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/CreateSequenceRequestOrBuilder.java b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/CreateSequenceRequestOrBuilder.java deleted file mode 100644 index 5f99147ab5..0000000000 --- a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/CreateSequenceRequestOrBuilder.java +++ /dev/null @@ -1,24 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: schema/google/showcase/v1beta1/sequence.proto - -package com.google.showcase.v1beta1; - -public interface CreateSequenceRequestOrBuilder extends - // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.CreateSequenceRequest) - com.google.protobuf.MessageOrBuilder { - - /** - * .google.showcase.v1beta1.Sequence sequence = 1; - * @return Whether the sequence field is set. - */ - boolean hasSequence(); - /** - * .google.showcase.v1beta1.Sequence sequence = 1; - * @return The sequence. - */ - com.google.showcase.v1beta1.Sequence getSequence(); - /** - * .google.showcase.v1beta1.Sequence sequence = 1; - */ - com.google.showcase.v1beta1.SequenceOrBuilder getSequenceOrBuilder(); -} diff --git a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/CreateSessionRequest.java b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/CreateSessionRequest.java deleted file mode 100644 index 2d2d8bfa81..0000000000 --- a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/CreateSessionRequest.java +++ /dev/null @@ -1,689 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: schema/google/showcase/v1beta1/testing.proto - -package com.google.showcase.v1beta1; - -/** - *
        - * The request for the CreateSession method.
        - * 
        - * - * Protobuf type {@code google.showcase.v1beta1.CreateSessionRequest} - */ -public final class CreateSessionRequest extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.CreateSessionRequest) - CreateSessionRequestOrBuilder { -private static final long serialVersionUID = 0L; - // Use CreateSessionRequest.newBuilder() to construct. - private CreateSessionRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private CreateSessionRequest() { - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new CreateSessionRequest(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private CreateSessionRequest( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: { - com.google.showcase.v1beta1.Session.Builder subBuilder = null; - if (session_ != null) { - subBuilder = session_.toBuilder(); - } - session_ = input.readMessage(com.google.showcase.v1beta1.Session.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(session_); - session_ = subBuilder.buildPartial(); - } - - break; - } - default: { - if (!parseUnknownField( - input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException( - e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.google.showcase.v1beta1.TestingOuterClass.internal_static_google_showcase_v1beta1_CreateSessionRequest_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.showcase.v1beta1.TestingOuterClass.internal_static_google_showcase_v1beta1_CreateSessionRequest_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.showcase.v1beta1.CreateSessionRequest.class, com.google.showcase.v1beta1.CreateSessionRequest.Builder.class); - } - - public static final int SESSION_FIELD_NUMBER = 1; - private com.google.showcase.v1beta1.Session session_; - /** - *
        -   * The session to be created.
        -   * Sessions are immutable once they are created (although they can
        -   * be deleted).
        -   * 
        - * - * .google.showcase.v1beta1.Session session = 1; - * @return Whether the session field is set. - */ - @java.lang.Override - public boolean hasSession() { - return session_ != null; - } - /** - *
        -   * The session to be created.
        -   * Sessions are immutable once they are created (although they can
        -   * be deleted).
        -   * 
        - * - * .google.showcase.v1beta1.Session session = 1; - * @return The session. - */ - @java.lang.Override - public com.google.showcase.v1beta1.Session getSession() { - return session_ == null ? com.google.showcase.v1beta1.Session.getDefaultInstance() : session_; - } - /** - *
        -   * The session to be created.
        -   * Sessions are immutable once they are created (although they can
        -   * be deleted).
        -   * 
        - * - * .google.showcase.v1beta1.Session session = 1; - */ - @java.lang.Override - public com.google.showcase.v1beta1.SessionOrBuilder getSessionOrBuilder() { - return getSession(); - } - - 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 (session_ != null) { - output.writeMessage(1, getSession()); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (session_ != null) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(1, getSession()); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof com.google.showcase.v1beta1.CreateSessionRequest)) { - return super.equals(obj); - } - com.google.showcase.v1beta1.CreateSessionRequest other = (com.google.showcase.v1beta1.CreateSessionRequest) obj; - - if (hasSession() != other.hasSession()) return false; - if (hasSession()) { - if (!getSession() - .equals(other.getSession())) return false; - } - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - if (hasSession()) { - hash = (37 * hash) + SESSION_FIELD_NUMBER; - hash = (53 * hash) + getSession().hashCode(); - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.showcase.v1beta1.CreateSessionRequest parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.showcase.v1beta1.CreateSessionRequest parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.showcase.v1beta1.CreateSessionRequest parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.showcase.v1beta1.CreateSessionRequest 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.showcase.v1beta1.CreateSessionRequest parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.showcase.v1beta1.CreateSessionRequest parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.showcase.v1beta1.CreateSessionRequest parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static com.google.showcase.v1beta1.CreateSessionRequest 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.showcase.v1beta1.CreateSessionRequest parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static com.google.showcase.v1beta1.CreateSessionRequest 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.showcase.v1beta1.CreateSessionRequest parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static com.google.showcase.v1beta1.CreateSessionRequest 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.showcase.v1beta1.CreateSessionRequest 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 request for the CreateSession method.
        -   * 
        - * - * Protobuf type {@code google.showcase.v1beta1.CreateSessionRequest} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.CreateSessionRequest) - com.google.showcase.v1beta1.CreateSessionRequestOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.google.showcase.v1beta1.TestingOuterClass.internal_static_google_showcase_v1beta1_CreateSessionRequest_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.showcase.v1beta1.TestingOuterClass.internal_static_google_showcase_v1beta1_CreateSessionRequest_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.showcase.v1beta1.CreateSessionRequest.class, com.google.showcase.v1beta1.CreateSessionRequest.Builder.class); - } - - // Construct using com.google.showcase.v1beta1.CreateSessionRequest.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { - } - } - @java.lang.Override - public Builder clear() { - super.clear(); - if (sessionBuilder_ == null) { - session_ = null; - } else { - session_ = null; - sessionBuilder_ = null; - } - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return com.google.showcase.v1beta1.TestingOuterClass.internal_static_google_showcase_v1beta1_CreateSessionRequest_descriptor; - } - - @java.lang.Override - public com.google.showcase.v1beta1.CreateSessionRequest getDefaultInstanceForType() { - return com.google.showcase.v1beta1.CreateSessionRequest.getDefaultInstance(); - } - - @java.lang.Override - public com.google.showcase.v1beta1.CreateSessionRequest build() { - com.google.showcase.v1beta1.CreateSessionRequest result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.showcase.v1beta1.CreateSessionRequest buildPartial() { - com.google.showcase.v1beta1.CreateSessionRequest result = new com.google.showcase.v1beta1.CreateSessionRequest(this); - if (sessionBuilder_ == null) { - result.session_ = session_; - } else { - result.session_ = sessionBuilder_.build(); - } - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.setField(field, value); - } - @java.lang.Override - public Builder clearField( - com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - @java.lang.Override - public Builder clearOneof( - com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.addRepeatedField(field, value); - } - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof com.google.showcase.v1beta1.CreateSessionRequest) { - return mergeFrom((com.google.showcase.v1beta1.CreateSessionRequest)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.showcase.v1beta1.CreateSessionRequest other) { - if (other == com.google.showcase.v1beta1.CreateSessionRequest.getDefaultInstance()) return this; - if (other.hasSession()) { - mergeSession(other.getSession()); - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - com.google.showcase.v1beta1.CreateSessionRequest parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (com.google.showcase.v1beta1.CreateSessionRequest) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private com.google.showcase.v1beta1.Session session_; - private com.google.protobuf.SingleFieldBuilderV3< - com.google.showcase.v1beta1.Session, com.google.showcase.v1beta1.Session.Builder, com.google.showcase.v1beta1.SessionOrBuilder> sessionBuilder_; - /** - *
        -     * The session to be created.
        -     * Sessions are immutable once they are created (although they can
        -     * be deleted).
        -     * 
        - * - * .google.showcase.v1beta1.Session session = 1; - * @return Whether the session field is set. - */ - public boolean hasSession() { - return sessionBuilder_ != null || session_ != null; - } - /** - *
        -     * The session to be created.
        -     * Sessions are immutable once they are created (although they can
        -     * be deleted).
        -     * 
        - * - * .google.showcase.v1beta1.Session session = 1; - * @return The session. - */ - public com.google.showcase.v1beta1.Session getSession() { - if (sessionBuilder_ == null) { - return session_ == null ? com.google.showcase.v1beta1.Session.getDefaultInstance() : session_; - } else { - return sessionBuilder_.getMessage(); - } - } - /** - *
        -     * The session to be created.
        -     * Sessions are immutable once they are created (although they can
        -     * be deleted).
        -     * 
        - * - * .google.showcase.v1beta1.Session session = 1; - */ - public Builder setSession(com.google.showcase.v1beta1.Session value) { - if (sessionBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - session_ = value; - onChanged(); - } else { - sessionBuilder_.setMessage(value); - } - - return this; - } - /** - *
        -     * The session to be created.
        -     * Sessions are immutable once they are created (although they can
        -     * be deleted).
        -     * 
        - * - * .google.showcase.v1beta1.Session session = 1; - */ - public Builder setSession( - com.google.showcase.v1beta1.Session.Builder builderForValue) { - if (sessionBuilder_ == null) { - session_ = builderForValue.build(); - onChanged(); - } else { - sessionBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - *
        -     * The session to be created.
        -     * Sessions are immutable once they are created (although they can
        -     * be deleted).
        -     * 
        - * - * .google.showcase.v1beta1.Session session = 1; - */ - public Builder mergeSession(com.google.showcase.v1beta1.Session value) { - if (sessionBuilder_ == null) { - if (session_ != null) { - session_ = - com.google.showcase.v1beta1.Session.newBuilder(session_).mergeFrom(value).buildPartial(); - } else { - session_ = value; - } - onChanged(); - } else { - sessionBuilder_.mergeFrom(value); - } - - return this; - } - /** - *
        -     * The session to be created.
        -     * Sessions are immutable once they are created (although they can
        -     * be deleted).
        -     * 
        - * - * .google.showcase.v1beta1.Session session = 1; - */ - public Builder clearSession() { - if (sessionBuilder_ == null) { - session_ = null; - onChanged(); - } else { - session_ = null; - sessionBuilder_ = null; - } - - return this; - } - /** - *
        -     * The session to be created.
        -     * Sessions are immutable once they are created (although they can
        -     * be deleted).
        -     * 
        - * - * .google.showcase.v1beta1.Session session = 1; - */ - public com.google.showcase.v1beta1.Session.Builder getSessionBuilder() { - - onChanged(); - return getSessionFieldBuilder().getBuilder(); - } - /** - *
        -     * The session to be created.
        -     * Sessions are immutable once they are created (although they can
        -     * be deleted).
        -     * 
        - * - * .google.showcase.v1beta1.Session session = 1; - */ - public com.google.showcase.v1beta1.SessionOrBuilder getSessionOrBuilder() { - if (sessionBuilder_ != null) { - return sessionBuilder_.getMessageOrBuilder(); - } else { - return session_ == null ? - com.google.showcase.v1beta1.Session.getDefaultInstance() : session_; - } - } - /** - *
        -     * The session to be created.
        -     * Sessions are immutable once they are created (although they can
        -     * be deleted).
        -     * 
        - * - * .google.showcase.v1beta1.Session session = 1; - */ - private com.google.protobuf.SingleFieldBuilderV3< - com.google.showcase.v1beta1.Session, com.google.showcase.v1beta1.Session.Builder, com.google.showcase.v1beta1.SessionOrBuilder> - getSessionFieldBuilder() { - if (sessionBuilder_ == null) { - sessionBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - com.google.showcase.v1beta1.Session, com.google.showcase.v1beta1.Session.Builder, com.google.showcase.v1beta1.SessionOrBuilder>( - getSession(), - getParentForChildren(), - isClean()); - session_ = null; - } - return sessionBuilder_; - } - @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.showcase.v1beta1.CreateSessionRequest) - } - - // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.CreateSessionRequest) - private static final com.google.showcase.v1beta1.CreateSessionRequest DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new com.google.showcase.v1beta1.CreateSessionRequest(); - } - - public static com.google.showcase.v1beta1.CreateSessionRequest getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public CreateSessionRequest parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new CreateSessionRequest(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public com.google.showcase.v1beta1.CreateSessionRequest getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/CreateSessionRequestOrBuilder.java b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/CreateSessionRequestOrBuilder.java deleted file mode 100644 index b4c5eacda6..0000000000 --- a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/CreateSessionRequestOrBuilder.java +++ /dev/null @@ -1,42 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: schema/google/showcase/v1beta1/testing.proto - -package com.google.showcase.v1beta1; - -public interface CreateSessionRequestOrBuilder extends - // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.CreateSessionRequest) - com.google.protobuf.MessageOrBuilder { - - /** - *
        -   * The session to be created.
        -   * Sessions are immutable once they are created (although they can
        -   * be deleted).
        -   * 
        - * - * .google.showcase.v1beta1.Session session = 1; - * @return Whether the session field is set. - */ - boolean hasSession(); - /** - *
        -   * The session to be created.
        -   * Sessions are immutable once they are created (although they can
        -   * be deleted).
        -   * 
        - * - * .google.showcase.v1beta1.Session session = 1; - * @return The session. - */ - com.google.showcase.v1beta1.Session getSession(); - /** - *
        -   * The session to be created.
        -   * Sessions are immutable once they are created (although they can
        -   * be deleted).
        -   * 
        - * - * .google.showcase.v1beta1.Session session = 1; - */ - com.google.showcase.v1beta1.SessionOrBuilder getSessionOrBuilder(); -} diff --git a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/CreateUserRequest.java b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/CreateUserRequest.java deleted file mode 100644 index 46ab7f0be0..0000000000 --- a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/CreateUserRequest.java +++ /dev/null @@ -1,667 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: schema/google/showcase/v1beta1/identity.proto - -package com.google.showcase.v1beta1; - -/** - *
        - * The request message for the google.showcase.v1beta1.Identity\CreateUser
        - * method.
        - * 
        - * - * Protobuf type {@code google.showcase.v1beta1.CreateUserRequest} - */ -public final class CreateUserRequest extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.CreateUserRequest) - CreateUserRequestOrBuilder { -private static final long serialVersionUID = 0L; - // Use CreateUserRequest.newBuilder() to construct. - private CreateUserRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private CreateUserRequest() { - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new CreateUserRequest(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private CreateUserRequest( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: { - com.google.showcase.v1beta1.User.Builder subBuilder = null; - if (user_ != null) { - subBuilder = user_.toBuilder(); - } - user_ = input.readMessage(com.google.showcase.v1beta1.User.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(user_); - user_ = subBuilder.buildPartial(); - } - - break; - } - default: { - if (!parseUnknownField( - input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException( - e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.google.showcase.v1beta1.IdentityOuterClass.internal_static_google_showcase_v1beta1_CreateUserRequest_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.showcase.v1beta1.IdentityOuterClass.internal_static_google_showcase_v1beta1_CreateUserRequest_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.showcase.v1beta1.CreateUserRequest.class, com.google.showcase.v1beta1.CreateUserRequest.Builder.class); - } - - public static final int USER_FIELD_NUMBER = 1; - private com.google.showcase.v1beta1.User user_; - /** - *
        -   * The user to create.
        -   * 
        - * - * .google.showcase.v1beta1.User user = 1; - * @return Whether the user field is set. - */ - @java.lang.Override - public boolean hasUser() { - return user_ != null; - } - /** - *
        -   * The user to create.
        -   * 
        - * - * .google.showcase.v1beta1.User user = 1; - * @return The user. - */ - @java.lang.Override - public com.google.showcase.v1beta1.User getUser() { - return user_ == null ? com.google.showcase.v1beta1.User.getDefaultInstance() : user_; - } - /** - *
        -   * The user to create.
        -   * 
        - * - * .google.showcase.v1beta1.User user = 1; - */ - @java.lang.Override - public com.google.showcase.v1beta1.UserOrBuilder getUserOrBuilder() { - return getUser(); - } - - 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 (user_ != null) { - output.writeMessage(1, getUser()); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (user_ != null) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(1, getUser()); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof com.google.showcase.v1beta1.CreateUserRequest)) { - return super.equals(obj); - } - com.google.showcase.v1beta1.CreateUserRequest other = (com.google.showcase.v1beta1.CreateUserRequest) obj; - - if (hasUser() != other.hasUser()) return false; - if (hasUser()) { - if (!getUser() - .equals(other.getUser())) return false; - } - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - if (hasUser()) { - hash = (37 * hash) + USER_FIELD_NUMBER; - hash = (53 * hash) + getUser().hashCode(); - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.showcase.v1beta1.CreateUserRequest parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.showcase.v1beta1.CreateUserRequest parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.showcase.v1beta1.CreateUserRequest parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.showcase.v1beta1.CreateUserRequest 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.showcase.v1beta1.CreateUserRequest parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.showcase.v1beta1.CreateUserRequest parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.showcase.v1beta1.CreateUserRequest parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static com.google.showcase.v1beta1.CreateUserRequest 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.showcase.v1beta1.CreateUserRequest parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static com.google.showcase.v1beta1.CreateUserRequest 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.showcase.v1beta1.CreateUserRequest parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static com.google.showcase.v1beta1.CreateUserRequest 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.showcase.v1beta1.CreateUserRequest 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 request message for the google.showcase.v1beta1.Identity\CreateUser
        -   * method.
        -   * 
        - * - * Protobuf type {@code google.showcase.v1beta1.CreateUserRequest} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.CreateUserRequest) - com.google.showcase.v1beta1.CreateUserRequestOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.google.showcase.v1beta1.IdentityOuterClass.internal_static_google_showcase_v1beta1_CreateUserRequest_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.showcase.v1beta1.IdentityOuterClass.internal_static_google_showcase_v1beta1_CreateUserRequest_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.showcase.v1beta1.CreateUserRequest.class, com.google.showcase.v1beta1.CreateUserRequest.Builder.class); - } - - // Construct using com.google.showcase.v1beta1.CreateUserRequest.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { - } - } - @java.lang.Override - public Builder clear() { - super.clear(); - if (userBuilder_ == null) { - user_ = null; - } else { - user_ = null; - userBuilder_ = null; - } - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return com.google.showcase.v1beta1.IdentityOuterClass.internal_static_google_showcase_v1beta1_CreateUserRequest_descriptor; - } - - @java.lang.Override - public com.google.showcase.v1beta1.CreateUserRequest getDefaultInstanceForType() { - return com.google.showcase.v1beta1.CreateUserRequest.getDefaultInstance(); - } - - @java.lang.Override - public com.google.showcase.v1beta1.CreateUserRequest build() { - com.google.showcase.v1beta1.CreateUserRequest result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.showcase.v1beta1.CreateUserRequest buildPartial() { - com.google.showcase.v1beta1.CreateUserRequest result = new com.google.showcase.v1beta1.CreateUserRequest(this); - if (userBuilder_ == null) { - result.user_ = user_; - } else { - result.user_ = userBuilder_.build(); - } - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.setField(field, value); - } - @java.lang.Override - public Builder clearField( - com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - @java.lang.Override - public Builder clearOneof( - com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.addRepeatedField(field, value); - } - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof com.google.showcase.v1beta1.CreateUserRequest) { - return mergeFrom((com.google.showcase.v1beta1.CreateUserRequest)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.showcase.v1beta1.CreateUserRequest other) { - if (other == com.google.showcase.v1beta1.CreateUserRequest.getDefaultInstance()) return this; - if (other.hasUser()) { - mergeUser(other.getUser()); - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - com.google.showcase.v1beta1.CreateUserRequest parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (com.google.showcase.v1beta1.CreateUserRequest) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private com.google.showcase.v1beta1.User user_; - private com.google.protobuf.SingleFieldBuilderV3< - com.google.showcase.v1beta1.User, com.google.showcase.v1beta1.User.Builder, com.google.showcase.v1beta1.UserOrBuilder> userBuilder_; - /** - *
        -     * The user to create.
        -     * 
        - * - * .google.showcase.v1beta1.User user = 1; - * @return Whether the user field is set. - */ - public boolean hasUser() { - return userBuilder_ != null || user_ != null; - } - /** - *
        -     * The user to create.
        -     * 
        - * - * .google.showcase.v1beta1.User user = 1; - * @return The user. - */ - public com.google.showcase.v1beta1.User getUser() { - if (userBuilder_ == null) { - return user_ == null ? com.google.showcase.v1beta1.User.getDefaultInstance() : user_; - } else { - return userBuilder_.getMessage(); - } - } - /** - *
        -     * The user to create.
        -     * 
        - * - * .google.showcase.v1beta1.User user = 1; - */ - public Builder setUser(com.google.showcase.v1beta1.User value) { - if (userBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - user_ = value; - onChanged(); - } else { - userBuilder_.setMessage(value); - } - - return this; - } - /** - *
        -     * The user to create.
        -     * 
        - * - * .google.showcase.v1beta1.User user = 1; - */ - public Builder setUser( - com.google.showcase.v1beta1.User.Builder builderForValue) { - if (userBuilder_ == null) { - user_ = builderForValue.build(); - onChanged(); - } else { - userBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - *
        -     * The user to create.
        -     * 
        - * - * .google.showcase.v1beta1.User user = 1; - */ - public Builder mergeUser(com.google.showcase.v1beta1.User value) { - if (userBuilder_ == null) { - if (user_ != null) { - user_ = - com.google.showcase.v1beta1.User.newBuilder(user_).mergeFrom(value).buildPartial(); - } else { - user_ = value; - } - onChanged(); - } else { - userBuilder_.mergeFrom(value); - } - - return this; - } - /** - *
        -     * The user to create.
        -     * 
        - * - * .google.showcase.v1beta1.User user = 1; - */ - public Builder clearUser() { - if (userBuilder_ == null) { - user_ = null; - onChanged(); - } else { - user_ = null; - userBuilder_ = null; - } - - return this; - } - /** - *
        -     * The user to create.
        -     * 
        - * - * .google.showcase.v1beta1.User user = 1; - */ - public com.google.showcase.v1beta1.User.Builder getUserBuilder() { - - onChanged(); - return getUserFieldBuilder().getBuilder(); - } - /** - *
        -     * The user to create.
        -     * 
        - * - * .google.showcase.v1beta1.User user = 1; - */ - public com.google.showcase.v1beta1.UserOrBuilder getUserOrBuilder() { - if (userBuilder_ != null) { - return userBuilder_.getMessageOrBuilder(); - } else { - return user_ == null ? - com.google.showcase.v1beta1.User.getDefaultInstance() : user_; - } - } - /** - *
        -     * The user to create.
        -     * 
        - * - * .google.showcase.v1beta1.User user = 1; - */ - private com.google.protobuf.SingleFieldBuilderV3< - com.google.showcase.v1beta1.User, com.google.showcase.v1beta1.User.Builder, com.google.showcase.v1beta1.UserOrBuilder> - getUserFieldBuilder() { - if (userBuilder_ == null) { - userBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - com.google.showcase.v1beta1.User, com.google.showcase.v1beta1.User.Builder, com.google.showcase.v1beta1.UserOrBuilder>( - getUser(), - getParentForChildren(), - isClean()); - user_ = null; - } - return userBuilder_; - } - @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.showcase.v1beta1.CreateUserRequest) - } - - // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.CreateUserRequest) - private static final com.google.showcase.v1beta1.CreateUserRequest DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new com.google.showcase.v1beta1.CreateUserRequest(); - } - - public static com.google.showcase.v1beta1.CreateUserRequest getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public CreateUserRequest parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new CreateUserRequest(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public com.google.showcase.v1beta1.CreateUserRequest getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/CreateUserRequestOrBuilder.java b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/CreateUserRequestOrBuilder.java deleted file mode 100644 index 04a4c2ee57..0000000000 --- a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/CreateUserRequestOrBuilder.java +++ /dev/null @@ -1,36 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: schema/google/showcase/v1beta1/identity.proto - -package com.google.showcase.v1beta1; - -public interface CreateUserRequestOrBuilder extends - // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.CreateUserRequest) - com.google.protobuf.MessageOrBuilder { - - /** - *
        -   * The user to create.
        -   * 
        - * - * .google.showcase.v1beta1.User user = 1; - * @return Whether the user field is set. - */ - boolean hasUser(); - /** - *
        -   * The user to create.
        -   * 
        - * - * .google.showcase.v1beta1.User user = 1; - * @return The user. - */ - com.google.showcase.v1beta1.User getUser(); - /** - *
        -   * The user to create.
        -   * 
        - * - * .google.showcase.v1beta1.User user = 1; - */ - com.google.showcase.v1beta1.UserOrBuilder getUserOrBuilder(); -} diff --git a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/DeleteBlurbRequest.java b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/DeleteBlurbRequest.java deleted file mode 100644 index 5d3da97880..0000000000 --- a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/DeleteBlurbRequest.java +++ /dev/null @@ -1,597 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: schema/google/showcase/v1beta1/messaging.proto - -package com.google.showcase.v1beta1; - -/** - *
        - * The request message for the google.showcase.v1beta1.Messaging\DeleteBlurb
        - * method.
        - * 
        - * - * Protobuf type {@code google.showcase.v1beta1.DeleteBlurbRequest} - */ -public final class DeleteBlurbRequest extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.DeleteBlurbRequest) - DeleteBlurbRequestOrBuilder { -private static final long serialVersionUID = 0L; - // Use DeleteBlurbRequest.newBuilder() to construct. - private DeleteBlurbRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private DeleteBlurbRequest() { - name_ = ""; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new DeleteBlurbRequest(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private DeleteBlurbRequest( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: { - java.lang.String s = input.readStringRequireUtf8(); - - name_ = s; - break; - } - default: { - if (!parseUnknownField( - input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException( - e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.google.showcase.v1beta1.MessagingOuterClass.internal_static_google_showcase_v1beta1_DeleteBlurbRequest_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.showcase.v1beta1.MessagingOuterClass.internal_static_google_showcase_v1beta1_DeleteBlurbRequest_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.showcase.v1beta1.DeleteBlurbRequest.class, com.google.showcase.v1beta1.DeleteBlurbRequest.Builder.class); - } - - public static final int NAME_FIELD_NUMBER = 1; - private volatile java.lang.Object name_; - /** - *
        -   * The resource name of the requested blurb.
        -   * 
        - * - * 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; - } - } - /** - *
        -   * The resource name of the requested blurb.
        -   * 
        - * - * 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_); - } - unknownFields.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 += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof com.google.showcase.v1beta1.DeleteBlurbRequest)) { - return super.equals(obj); - } - com.google.showcase.v1beta1.DeleteBlurbRequest other = (com.google.showcase.v1beta1.DeleteBlurbRequest) obj; - - if (!getName() - .equals(other.getName())) return false; - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - hash = (37 * hash) + NAME_FIELD_NUMBER; - hash = (53 * hash) + getName().hashCode(); - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.showcase.v1beta1.DeleteBlurbRequest parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.showcase.v1beta1.DeleteBlurbRequest parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.showcase.v1beta1.DeleteBlurbRequest parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.showcase.v1beta1.DeleteBlurbRequest 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.showcase.v1beta1.DeleteBlurbRequest parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.showcase.v1beta1.DeleteBlurbRequest parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.showcase.v1beta1.DeleteBlurbRequest parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static com.google.showcase.v1beta1.DeleteBlurbRequest 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.showcase.v1beta1.DeleteBlurbRequest parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static com.google.showcase.v1beta1.DeleteBlurbRequest 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.showcase.v1beta1.DeleteBlurbRequest parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static com.google.showcase.v1beta1.DeleteBlurbRequest 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.showcase.v1beta1.DeleteBlurbRequest 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 request message for the google.showcase.v1beta1.Messaging\DeleteBlurb
        -   * method.
        -   * 
        - * - * Protobuf type {@code google.showcase.v1beta1.DeleteBlurbRequest} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.DeleteBlurbRequest) - com.google.showcase.v1beta1.DeleteBlurbRequestOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.google.showcase.v1beta1.MessagingOuterClass.internal_static_google_showcase_v1beta1_DeleteBlurbRequest_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.showcase.v1beta1.MessagingOuterClass.internal_static_google_showcase_v1beta1_DeleteBlurbRequest_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.showcase.v1beta1.DeleteBlurbRequest.class, com.google.showcase.v1beta1.DeleteBlurbRequest.Builder.class); - } - - // Construct using com.google.showcase.v1beta1.DeleteBlurbRequest.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { - } - } - @java.lang.Override - public Builder clear() { - super.clear(); - name_ = ""; - - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return com.google.showcase.v1beta1.MessagingOuterClass.internal_static_google_showcase_v1beta1_DeleteBlurbRequest_descriptor; - } - - @java.lang.Override - public com.google.showcase.v1beta1.DeleteBlurbRequest getDefaultInstanceForType() { - return com.google.showcase.v1beta1.DeleteBlurbRequest.getDefaultInstance(); - } - - @java.lang.Override - public com.google.showcase.v1beta1.DeleteBlurbRequest build() { - com.google.showcase.v1beta1.DeleteBlurbRequest result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.showcase.v1beta1.DeleteBlurbRequest buildPartial() { - com.google.showcase.v1beta1.DeleteBlurbRequest result = new com.google.showcase.v1beta1.DeleteBlurbRequest(this); - result.name_ = name_; - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.setField(field, value); - } - @java.lang.Override - public Builder clearField( - com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - @java.lang.Override - public Builder clearOneof( - com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.addRepeatedField(field, value); - } - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof com.google.showcase.v1beta1.DeleteBlurbRequest) { - return mergeFrom((com.google.showcase.v1beta1.DeleteBlurbRequest)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.showcase.v1beta1.DeleteBlurbRequest other) { - if (other == com.google.showcase.v1beta1.DeleteBlurbRequest.getDefaultInstance()) return this; - if (!other.getName().isEmpty()) { - name_ = other.name_; - onChanged(); - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - com.google.showcase.v1beta1.DeleteBlurbRequest parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (com.google.showcase.v1beta1.DeleteBlurbRequest) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private java.lang.Object name_ = ""; - /** - *
        -     * The resource name of the requested blurb.
        -     * 
        - * - * 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; - } - } - /** - *
        -     * The resource name of the requested blurb.
        -     * 
        - * - * 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; - } - } - /** - *
        -     * The resource name of the requested blurb.
        -     * 
        - * - * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * @param value The name to set. - * @return This builder for chaining. - */ - public Builder setName( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - name_ = value; - onChanged(); - return this; - } - /** - *
        -     * The resource name of the requested blurb.
        -     * 
        - * - * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * @return This builder for chaining. - */ - public Builder clearName() { - - name_ = getDefaultInstance().getName(); - onChanged(); - return this; - } - /** - *
        -     * The resource name of the requested blurb.
        -     * 
        - * - * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * @param value The bytes for name to set. - * @return This builder for chaining. - */ - public Builder setNameBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - name_ = value; - onChanged(); - return this; - } - @java.lang.Override - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - - // @@protoc_insertion_point(builder_scope:google.showcase.v1beta1.DeleteBlurbRequest) - } - - // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.DeleteBlurbRequest) - private static final com.google.showcase.v1beta1.DeleteBlurbRequest DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new com.google.showcase.v1beta1.DeleteBlurbRequest(); - } - - public static com.google.showcase.v1beta1.DeleteBlurbRequest getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public DeleteBlurbRequest parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new DeleteBlurbRequest(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public com.google.showcase.v1beta1.DeleteBlurbRequest getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/DeleteBlurbRequestOrBuilder.java b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/DeleteBlurbRequestOrBuilder.java deleted file mode 100644 index 7a44659377..0000000000 --- a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/DeleteBlurbRequestOrBuilder.java +++ /dev/null @@ -1,29 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: schema/google/showcase/v1beta1/messaging.proto - -package com.google.showcase.v1beta1; - -public interface DeleteBlurbRequestOrBuilder extends - // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.DeleteBlurbRequest) - com.google.protobuf.MessageOrBuilder { - - /** - *
        -   * The resource name of the requested blurb.
        -   * 
        - * - * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * @return The name. - */ - java.lang.String getName(); - /** - *
        -   * The resource name of the requested blurb.
        -   * 
        - * - * 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/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/DeleteRoomRequest.java b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/DeleteRoomRequest.java deleted file mode 100644 index 2195ae35ea..0000000000 --- a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/DeleteRoomRequest.java +++ /dev/null @@ -1,597 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: schema/google/showcase/v1beta1/messaging.proto - -package com.google.showcase.v1beta1; - -/** - *
        - * The request message for the google.showcase.v1beta1.Messaging\DeleteRoom
        - * method.
        - * 
        - * - * Protobuf type {@code google.showcase.v1beta1.DeleteRoomRequest} - */ -public final class DeleteRoomRequest extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.DeleteRoomRequest) - DeleteRoomRequestOrBuilder { -private static final long serialVersionUID = 0L; - // Use DeleteRoomRequest.newBuilder() to construct. - private DeleteRoomRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private DeleteRoomRequest() { - name_ = ""; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new DeleteRoomRequest(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private DeleteRoomRequest( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: { - java.lang.String s = input.readStringRequireUtf8(); - - name_ = s; - break; - } - default: { - if (!parseUnknownField( - input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException( - e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.google.showcase.v1beta1.MessagingOuterClass.internal_static_google_showcase_v1beta1_DeleteRoomRequest_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.showcase.v1beta1.MessagingOuterClass.internal_static_google_showcase_v1beta1_DeleteRoomRequest_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.showcase.v1beta1.DeleteRoomRequest.class, com.google.showcase.v1beta1.DeleteRoomRequest.Builder.class); - } - - public static final int NAME_FIELD_NUMBER = 1; - private volatile java.lang.Object name_; - /** - *
        -   * The resource name of the requested room.
        -   * 
        - * - * 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; - } - } - /** - *
        -   * The resource name of the requested room.
        -   * 
        - * - * 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_); - } - unknownFields.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 += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof com.google.showcase.v1beta1.DeleteRoomRequest)) { - return super.equals(obj); - } - com.google.showcase.v1beta1.DeleteRoomRequest other = (com.google.showcase.v1beta1.DeleteRoomRequest) obj; - - if (!getName() - .equals(other.getName())) return false; - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - hash = (37 * hash) + NAME_FIELD_NUMBER; - hash = (53 * hash) + getName().hashCode(); - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.showcase.v1beta1.DeleteRoomRequest parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.showcase.v1beta1.DeleteRoomRequest parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.showcase.v1beta1.DeleteRoomRequest parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.showcase.v1beta1.DeleteRoomRequest 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.showcase.v1beta1.DeleteRoomRequest parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.showcase.v1beta1.DeleteRoomRequest parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.showcase.v1beta1.DeleteRoomRequest parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static com.google.showcase.v1beta1.DeleteRoomRequest 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.showcase.v1beta1.DeleteRoomRequest parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static com.google.showcase.v1beta1.DeleteRoomRequest 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.showcase.v1beta1.DeleteRoomRequest parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static com.google.showcase.v1beta1.DeleteRoomRequest 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.showcase.v1beta1.DeleteRoomRequest 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 request message for the google.showcase.v1beta1.Messaging\DeleteRoom
        -   * method.
        -   * 
        - * - * Protobuf type {@code google.showcase.v1beta1.DeleteRoomRequest} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.DeleteRoomRequest) - com.google.showcase.v1beta1.DeleteRoomRequestOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.google.showcase.v1beta1.MessagingOuterClass.internal_static_google_showcase_v1beta1_DeleteRoomRequest_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.showcase.v1beta1.MessagingOuterClass.internal_static_google_showcase_v1beta1_DeleteRoomRequest_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.showcase.v1beta1.DeleteRoomRequest.class, com.google.showcase.v1beta1.DeleteRoomRequest.Builder.class); - } - - // Construct using com.google.showcase.v1beta1.DeleteRoomRequest.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { - } - } - @java.lang.Override - public Builder clear() { - super.clear(); - name_ = ""; - - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return com.google.showcase.v1beta1.MessagingOuterClass.internal_static_google_showcase_v1beta1_DeleteRoomRequest_descriptor; - } - - @java.lang.Override - public com.google.showcase.v1beta1.DeleteRoomRequest getDefaultInstanceForType() { - return com.google.showcase.v1beta1.DeleteRoomRequest.getDefaultInstance(); - } - - @java.lang.Override - public com.google.showcase.v1beta1.DeleteRoomRequest build() { - com.google.showcase.v1beta1.DeleteRoomRequest result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.showcase.v1beta1.DeleteRoomRequest buildPartial() { - com.google.showcase.v1beta1.DeleteRoomRequest result = new com.google.showcase.v1beta1.DeleteRoomRequest(this); - result.name_ = name_; - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.setField(field, value); - } - @java.lang.Override - public Builder clearField( - com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - @java.lang.Override - public Builder clearOneof( - com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.addRepeatedField(field, value); - } - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof com.google.showcase.v1beta1.DeleteRoomRequest) { - return mergeFrom((com.google.showcase.v1beta1.DeleteRoomRequest)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.showcase.v1beta1.DeleteRoomRequest other) { - if (other == com.google.showcase.v1beta1.DeleteRoomRequest.getDefaultInstance()) return this; - if (!other.getName().isEmpty()) { - name_ = other.name_; - onChanged(); - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - com.google.showcase.v1beta1.DeleteRoomRequest parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (com.google.showcase.v1beta1.DeleteRoomRequest) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private java.lang.Object name_ = ""; - /** - *
        -     * The resource name of the requested room.
        -     * 
        - * - * 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; - } - } - /** - *
        -     * The resource name of the requested room.
        -     * 
        - * - * 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; - } - } - /** - *
        -     * The resource name of the requested room.
        -     * 
        - * - * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * @param value The name to set. - * @return This builder for chaining. - */ - public Builder setName( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - name_ = value; - onChanged(); - return this; - } - /** - *
        -     * The resource name of the requested room.
        -     * 
        - * - * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * @return This builder for chaining. - */ - public Builder clearName() { - - name_ = getDefaultInstance().getName(); - onChanged(); - return this; - } - /** - *
        -     * The resource name of the requested room.
        -     * 
        - * - * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * @param value The bytes for name to set. - * @return This builder for chaining. - */ - public Builder setNameBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - name_ = value; - onChanged(); - return this; - } - @java.lang.Override - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - - // @@protoc_insertion_point(builder_scope:google.showcase.v1beta1.DeleteRoomRequest) - } - - // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.DeleteRoomRequest) - private static final com.google.showcase.v1beta1.DeleteRoomRequest DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new com.google.showcase.v1beta1.DeleteRoomRequest(); - } - - public static com.google.showcase.v1beta1.DeleteRoomRequest getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public DeleteRoomRequest parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new DeleteRoomRequest(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public com.google.showcase.v1beta1.DeleteRoomRequest getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/DeleteRoomRequestOrBuilder.java b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/DeleteRoomRequestOrBuilder.java deleted file mode 100644 index 996f19d054..0000000000 --- a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/DeleteRoomRequestOrBuilder.java +++ /dev/null @@ -1,29 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: schema/google/showcase/v1beta1/messaging.proto - -package com.google.showcase.v1beta1; - -public interface DeleteRoomRequestOrBuilder extends - // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.DeleteRoomRequest) - com.google.protobuf.MessageOrBuilder { - - /** - *
        -   * The resource name of the requested room.
        -   * 
        - * - * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * @return The name. - */ - java.lang.String getName(); - /** - *
        -   * The resource name of the requested room.
        -   * 
        - * - * 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/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/DeleteSessionRequest.java b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/DeleteSessionRequest.java deleted file mode 100644 index c19f242654..0000000000 --- a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/DeleteSessionRequest.java +++ /dev/null @@ -1,595 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: schema/google/showcase/v1beta1/testing.proto - -package com.google.showcase.v1beta1; - -/** - *
        - * Request for the DeleteSession method.
        - * 
        - * - * Protobuf type {@code google.showcase.v1beta1.DeleteSessionRequest} - */ -public final class DeleteSessionRequest extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.DeleteSessionRequest) - DeleteSessionRequestOrBuilder { -private static final long serialVersionUID = 0L; - // Use DeleteSessionRequest.newBuilder() to construct. - private DeleteSessionRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private DeleteSessionRequest() { - name_ = ""; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new DeleteSessionRequest(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private DeleteSessionRequest( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: { - java.lang.String s = input.readStringRequireUtf8(); - - name_ = s; - break; - } - default: { - if (!parseUnknownField( - input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException( - e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.google.showcase.v1beta1.TestingOuterClass.internal_static_google_showcase_v1beta1_DeleteSessionRequest_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.showcase.v1beta1.TestingOuterClass.internal_static_google_showcase_v1beta1_DeleteSessionRequest_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.showcase.v1beta1.DeleteSessionRequest.class, com.google.showcase.v1beta1.DeleteSessionRequest.Builder.class); - } - - public static final int NAME_FIELD_NUMBER = 1; - private volatile java.lang.Object name_; - /** - *
        -   * The session to be deleted.
        -   * 
        - * - * string name = 1 [(.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; - } - } - /** - *
        -   * The session to be deleted.
        -   * 
        - * - * string name = 1 [(.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_); - } - unknownFields.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 += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof com.google.showcase.v1beta1.DeleteSessionRequest)) { - return super.equals(obj); - } - com.google.showcase.v1beta1.DeleteSessionRequest other = (com.google.showcase.v1beta1.DeleteSessionRequest) obj; - - if (!getName() - .equals(other.getName())) return false; - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - hash = (37 * hash) + NAME_FIELD_NUMBER; - hash = (53 * hash) + getName().hashCode(); - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.showcase.v1beta1.DeleteSessionRequest parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.showcase.v1beta1.DeleteSessionRequest parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.showcase.v1beta1.DeleteSessionRequest parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.showcase.v1beta1.DeleteSessionRequest 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.showcase.v1beta1.DeleteSessionRequest parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.showcase.v1beta1.DeleteSessionRequest parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.showcase.v1beta1.DeleteSessionRequest parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static com.google.showcase.v1beta1.DeleteSessionRequest 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.showcase.v1beta1.DeleteSessionRequest parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static com.google.showcase.v1beta1.DeleteSessionRequest 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.showcase.v1beta1.DeleteSessionRequest parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static com.google.showcase.v1beta1.DeleteSessionRequest 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.showcase.v1beta1.DeleteSessionRequest prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - @java.lang.Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - *
        -   * Request for the DeleteSession method.
        -   * 
        - * - * Protobuf type {@code google.showcase.v1beta1.DeleteSessionRequest} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.DeleteSessionRequest) - com.google.showcase.v1beta1.DeleteSessionRequestOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.google.showcase.v1beta1.TestingOuterClass.internal_static_google_showcase_v1beta1_DeleteSessionRequest_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.showcase.v1beta1.TestingOuterClass.internal_static_google_showcase_v1beta1_DeleteSessionRequest_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.showcase.v1beta1.DeleteSessionRequest.class, com.google.showcase.v1beta1.DeleteSessionRequest.Builder.class); - } - - // Construct using com.google.showcase.v1beta1.DeleteSessionRequest.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { - } - } - @java.lang.Override - public Builder clear() { - super.clear(); - name_ = ""; - - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return com.google.showcase.v1beta1.TestingOuterClass.internal_static_google_showcase_v1beta1_DeleteSessionRequest_descriptor; - } - - @java.lang.Override - public com.google.showcase.v1beta1.DeleteSessionRequest getDefaultInstanceForType() { - return com.google.showcase.v1beta1.DeleteSessionRequest.getDefaultInstance(); - } - - @java.lang.Override - public com.google.showcase.v1beta1.DeleteSessionRequest build() { - com.google.showcase.v1beta1.DeleteSessionRequest result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.showcase.v1beta1.DeleteSessionRequest buildPartial() { - com.google.showcase.v1beta1.DeleteSessionRequest result = new com.google.showcase.v1beta1.DeleteSessionRequest(this); - result.name_ = name_; - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.setField(field, value); - } - @java.lang.Override - public Builder clearField( - com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - @java.lang.Override - public Builder clearOneof( - com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.addRepeatedField(field, value); - } - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof com.google.showcase.v1beta1.DeleteSessionRequest) { - return mergeFrom((com.google.showcase.v1beta1.DeleteSessionRequest)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.showcase.v1beta1.DeleteSessionRequest other) { - if (other == com.google.showcase.v1beta1.DeleteSessionRequest.getDefaultInstance()) return this; - if (!other.getName().isEmpty()) { - name_ = other.name_; - onChanged(); - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - com.google.showcase.v1beta1.DeleteSessionRequest parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (com.google.showcase.v1beta1.DeleteSessionRequest) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private java.lang.Object name_ = ""; - /** - *
        -     * The session to be deleted.
        -     * 
        - * - * string name = 1 [(.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; - } - } - /** - *
        -     * The session to be deleted.
        -     * 
        - * - * string name = 1 [(.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; - } - } - /** - *
        -     * The session to be deleted.
        -     * 
        - * - * string name = 1 [(.google.api.resource_reference) = { ... } - * @param value The name to set. - * @return This builder for chaining. - */ - public Builder setName( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - name_ = value; - onChanged(); - return this; - } - /** - *
        -     * The session to be deleted.
        -     * 
        - * - * string name = 1 [(.google.api.resource_reference) = { ... } - * @return This builder for chaining. - */ - public Builder clearName() { - - name_ = getDefaultInstance().getName(); - onChanged(); - return this; - } - /** - *
        -     * The session to be deleted.
        -     * 
        - * - * string name = 1 [(.google.api.resource_reference) = { ... } - * @param value The bytes for name to set. - * @return This builder for chaining. - */ - public Builder setNameBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - name_ = value; - onChanged(); - return this; - } - @java.lang.Override - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - - // @@protoc_insertion_point(builder_scope:google.showcase.v1beta1.DeleteSessionRequest) - } - - // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.DeleteSessionRequest) - private static final com.google.showcase.v1beta1.DeleteSessionRequest DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new com.google.showcase.v1beta1.DeleteSessionRequest(); - } - - public static com.google.showcase.v1beta1.DeleteSessionRequest getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public DeleteSessionRequest parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new DeleteSessionRequest(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public com.google.showcase.v1beta1.DeleteSessionRequest getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/DeleteSessionRequestOrBuilder.java b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/DeleteSessionRequestOrBuilder.java deleted file mode 100644 index a4df0df04a..0000000000 --- a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/DeleteSessionRequestOrBuilder.java +++ /dev/null @@ -1,29 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: schema/google/showcase/v1beta1/testing.proto - -package com.google.showcase.v1beta1; - -public interface DeleteSessionRequestOrBuilder extends - // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.DeleteSessionRequest) - com.google.protobuf.MessageOrBuilder { - - /** - *
        -   * The session to be deleted.
        -   * 
        - * - * string name = 1 [(.google.api.resource_reference) = { ... } - * @return The name. - */ - java.lang.String getName(); - /** - *
        -   * The session to be deleted.
        -   * 
        - * - * string name = 1 [(.google.api.resource_reference) = { ... } - * @return The bytes for name. - */ - com.google.protobuf.ByteString - getNameBytes(); -} diff --git a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/DeleteTestRequest.java b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/DeleteTestRequest.java deleted file mode 100644 index 0375608a88..0000000000 --- a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/DeleteTestRequest.java +++ /dev/null @@ -1,595 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: schema/google/showcase/v1beta1/testing.proto - -package com.google.showcase.v1beta1; - -/** - *
        - * Request message for deleting a test.
        - * 
        - * - * Protobuf type {@code google.showcase.v1beta1.DeleteTestRequest} - */ -public final class DeleteTestRequest extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.DeleteTestRequest) - DeleteTestRequestOrBuilder { -private static final long serialVersionUID = 0L; - // Use DeleteTestRequest.newBuilder() to construct. - private DeleteTestRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private DeleteTestRequest() { - name_ = ""; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new DeleteTestRequest(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private DeleteTestRequest( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: { - java.lang.String s = input.readStringRequireUtf8(); - - name_ = s; - break; - } - default: { - if (!parseUnknownField( - input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException( - e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.google.showcase.v1beta1.TestingOuterClass.internal_static_google_showcase_v1beta1_DeleteTestRequest_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.showcase.v1beta1.TestingOuterClass.internal_static_google_showcase_v1beta1_DeleteTestRequest_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.showcase.v1beta1.DeleteTestRequest.class, com.google.showcase.v1beta1.DeleteTestRequest.Builder.class); - } - - public static final int NAME_FIELD_NUMBER = 1; - private volatile java.lang.Object name_; - /** - *
        -   * The test to be deleted.
        -   * 
        - * - * string name = 1 [(.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; - } - } - /** - *
        -   * The test to be deleted.
        -   * 
        - * - * string name = 1 [(.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_); - } - unknownFields.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 += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof com.google.showcase.v1beta1.DeleteTestRequest)) { - return super.equals(obj); - } - com.google.showcase.v1beta1.DeleteTestRequest other = (com.google.showcase.v1beta1.DeleteTestRequest) obj; - - if (!getName() - .equals(other.getName())) return false; - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - hash = (37 * hash) + NAME_FIELD_NUMBER; - hash = (53 * hash) + getName().hashCode(); - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.showcase.v1beta1.DeleteTestRequest parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.showcase.v1beta1.DeleteTestRequest parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.showcase.v1beta1.DeleteTestRequest parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.showcase.v1beta1.DeleteTestRequest 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.showcase.v1beta1.DeleteTestRequest parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.showcase.v1beta1.DeleteTestRequest parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.showcase.v1beta1.DeleteTestRequest parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static com.google.showcase.v1beta1.DeleteTestRequest 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.showcase.v1beta1.DeleteTestRequest parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static com.google.showcase.v1beta1.DeleteTestRequest 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.showcase.v1beta1.DeleteTestRequest parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static com.google.showcase.v1beta1.DeleteTestRequest 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.showcase.v1beta1.DeleteTestRequest prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - @java.lang.Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - *
        -   * Request message for deleting a test.
        -   * 
        - * - * Protobuf type {@code google.showcase.v1beta1.DeleteTestRequest} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.DeleteTestRequest) - com.google.showcase.v1beta1.DeleteTestRequestOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.google.showcase.v1beta1.TestingOuterClass.internal_static_google_showcase_v1beta1_DeleteTestRequest_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.showcase.v1beta1.TestingOuterClass.internal_static_google_showcase_v1beta1_DeleteTestRequest_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.showcase.v1beta1.DeleteTestRequest.class, com.google.showcase.v1beta1.DeleteTestRequest.Builder.class); - } - - // Construct using com.google.showcase.v1beta1.DeleteTestRequest.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { - } - } - @java.lang.Override - public Builder clear() { - super.clear(); - name_ = ""; - - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return com.google.showcase.v1beta1.TestingOuterClass.internal_static_google_showcase_v1beta1_DeleteTestRequest_descriptor; - } - - @java.lang.Override - public com.google.showcase.v1beta1.DeleteTestRequest getDefaultInstanceForType() { - return com.google.showcase.v1beta1.DeleteTestRequest.getDefaultInstance(); - } - - @java.lang.Override - public com.google.showcase.v1beta1.DeleteTestRequest build() { - com.google.showcase.v1beta1.DeleteTestRequest result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.showcase.v1beta1.DeleteTestRequest buildPartial() { - com.google.showcase.v1beta1.DeleteTestRequest result = new com.google.showcase.v1beta1.DeleteTestRequest(this); - result.name_ = name_; - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.setField(field, value); - } - @java.lang.Override - public Builder clearField( - com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - @java.lang.Override - public Builder clearOneof( - com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.addRepeatedField(field, value); - } - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof com.google.showcase.v1beta1.DeleteTestRequest) { - return mergeFrom((com.google.showcase.v1beta1.DeleteTestRequest)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.showcase.v1beta1.DeleteTestRequest other) { - if (other == com.google.showcase.v1beta1.DeleteTestRequest.getDefaultInstance()) return this; - if (!other.getName().isEmpty()) { - name_ = other.name_; - onChanged(); - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - com.google.showcase.v1beta1.DeleteTestRequest parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (com.google.showcase.v1beta1.DeleteTestRequest) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private java.lang.Object name_ = ""; - /** - *
        -     * The test to be deleted.
        -     * 
        - * - * string name = 1 [(.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; - } - } - /** - *
        -     * The test to be deleted.
        -     * 
        - * - * string name = 1 [(.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; - } - } - /** - *
        -     * The test to be deleted.
        -     * 
        - * - * string name = 1 [(.google.api.resource_reference) = { ... } - * @param value The name to set. - * @return This builder for chaining. - */ - public Builder setName( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - name_ = value; - onChanged(); - return this; - } - /** - *
        -     * The test to be deleted.
        -     * 
        - * - * string name = 1 [(.google.api.resource_reference) = { ... } - * @return This builder for chaining. - */ - public Builder clearName() { - - name_ = getDefaultInstance().getName(); - onChanged(); - return this; - } - /** - *
        -     * The test to be deleted.
        -     * 
        - * - * string name = 1 [(.google.api.resource_reference) = { ... } - * @param value The bytes for name to set. - * @return This builder for chaining. - */ - public Builder setNameBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - name_ = value; - onChanged(); - return this; - } - @java.lang.Override - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - - // @@protoc_insertion_point(builder_scope:google.showcase.v1beta1.DeleteTestRequest) - } - - // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.DeleteTestRequest) - private static final com.google.showcase.v1beta1.DeleteTestRequest DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new com.google.showcase.v1beta1.DeleteTestRequest(); - } - - public static com.google.showcase.v1beta1.DeleteTestRequest getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public DeleteTestRequest parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new DeleteTestRequest(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public com.google.showcase.v1beta1.DeleteTestRequest getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/DeleteTestRequestOrBuilder.java b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/DeleteTestRequestOrBuilder.java deleted file mode 100644 index c50480e596..0000000000 --- a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/DeleteTestRequestOrBuilder.java +++ /dev/null @@ -1,29 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: schema/google/showcase/v1beta1/testing.proto - -package com.google.showcase.v1beta1; - -public interface DeleteTestRequestOrBuilder extends - // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.DeleteTestRequest) - com.google.protobuf.MessageOrBuilder { - - /** - *
        -   * The test to be deleted.
        -   * 
        - * - * string name = 1 [(.google.api.resource_reference) = { ... } - * @return The name. - */ - java.lang.String getName(); - /** - *
        -   * The test to be deleted.
        -   * 
        - * - * string name = 1 [(.google.api.resource_reference) = { ... } - * @return The bytes for name. - */ - com.google.protobuf.ByteString - getNameBytes(); -} diff --git a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/DeleteUserRequest.java b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/DeleteUserRequest.java deleted file mode 100644 index c1726da0cd..0000000000 --- a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/DeleteUserRequest.java +++ /dev/null @@ -1,597 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: schema/google/showcase/v1beta1/identity.proto - -package com.google.showcase.v1beta1; - -/** - *
        - * The request message for the google.showcase.v1beta1.Identity\DeleteUser
        - * method.
        - * 
        - * - * Protobuf type {@code google.showcase.v1beta1.DeleteUserRequest} - */ -public final class DeleteUserRequest extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.DeleteUserRequest) - DeleteUserRequestOrBuilder { -private static final long serialVersionUID = 0L; - // Use DeleteUserRequest.newBuilder() to construct. - private DeleteUserRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private DeleteUserRequest() { - name_ = ""; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new DeleteUserRequest(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private DeleteUserRequest( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: { - java.lang.String s = input.readStringRequireUtf8(); - - name_ = s; - break; - } - default: { - if (!parseUnknownField( - input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException( - e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.google.showcase.v1beta1.IdentityOuterClass.internal_static_google_showcase_v1beta1_DeleteUserRequest_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.showcase.v1beta1.IdentityOuterClass.internal_static_google_showcase_v1beta1_DeleteUserRequest_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.showcase.v1beta1.DeleteUserRequest.class, com.google.showcase.v1beta1.DeleteUserRequest.Builder.class); - } - - public static final int NAME_FIELD_NUMBER = 1; - private volatile java.lang.Object name_; - /** - *
        -   * The resource name of the user to delete.
        -   * 
        - * - * 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; - } - } - /** - *
        -   * The resource name of the user to delete.
        -   * 
        - * - * 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_); - } - unknownFields.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 += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof com.google.showcase.v1beta1.DeleteUserRequest)) { - return super.equals(obj); - } - com.google.showcase.v1beta1.DeleteUserRequest other = (com.google.showcase.v1beta1.DeleteUserRequest) obj; - - if (!getName() - .equals(other.getName())) return false; - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - hash = (37 * hash) + NAME_FIELD_NUMBER; - hash = (53 * hash) + getName().hashCode(); - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.showcase.v1beta1.DeleteUserRequest parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.showcase.v1beta1.DeleteUserRequest parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.showcase.v1beta1.DeleteUserRequest parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.showcase.v1beta1.DeleteUserRequest 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.showcase.v1beta1.DeleteUserRequest parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.showcase.v1beta1.DeleteUserRequest parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.showcase.v1beta1.DeleteUserRequest parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static com.google.showcase.v1beta1.DeleteUserRequest 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.showcase.v1beta1.DeleteUserRequest parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static com.google.showcase.v1beta1.DeleteUserRequest 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.showcase.v1beta1.DeleteUserRequest parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static com.google.showcase.v1beta1.DeleteUserRequest 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.showcase.v1beta1.DeleteUserRequest 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 request message for the google.showcase.v1beta1.Identity\DeleteUser
        -   * method.
        -   * 
        - * - * Protobuf type {@code google.showcase.v1beta1.DeleteUserRequest} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.DeleteUserRequest) - com.google.showcase.v1beta1.DeleteUserRequestOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.google.showcase.v1beta1.IdentityOuterClass.internal_static_google_showcase_v1beta1_DeleteUserRequest_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.showcase.v1beta1.IdentityOuterClass.internal_static_google_showcase_v1beta1_DeleteUserRequest_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.showcase.v1beta1.DeleteUserRequest.class, com.google.showcase.v1beta1.DeleteUserRequest.Builder.class); - } - - // Construct using com.google.showcase.v1beta1.DeleteUserRequest.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { - } - } - @java.lang.Override - public Builder clear() { - super.clear(); - name_ = ""; - - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return com.google.showcase.v1beta1.IdentityOuterClass.internal_static_google_showcase_v1beta1_DeleteUserRequest_descriptor; - } - - @java.lang.Override - public com.google.showcase.v1beta1.DeleteUserRequest getDefaultInstanceForType() { - return com.google.showcase.v1beta1.DeleteUserRequest.getDefaultInstance(); - } - - @java.lang.Override - public com.google.showcase.v1beta1.DeleteUserRequest build() { - com.google.showcase.v1beta1.DeleteUserRequest result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.showcase.v1beta1.DeleteUserRequest buildPartial() { - com.google.showcase.v1beta1.DeleteUserRequest result = new com.google.showcase.v1beta1.DeleteUserRequest(this); - result.name_ = name_; - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.setField(field, value); - } - @java.lang.Override - public Builder clearField( - com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - @java.lang.Override - public Builder clearOneof( - com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.addRepeatedField(field, value); - } - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof com.google.showcase.v1beta1.DeleteUserRequest) { - return mergeFrom((com.google.showcase.v1beta1.DeleteUserRequest)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.showcase.v1beta1.DeleteUserRequest other) { - if (other == com.google.showcase.v1beta1.DeleteUserRequest.getDefaultInstance()) return this; - if (!other.getName().isEmpty()) { - name_ = other.name_; - onChanged(); - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - com.google.showcase.v1beta1.DeleteUserRequest parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (com.google.showcase.v1beta1.DeleteUserRequest) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private java.lang.Object name_ = ""; - /** - *
        -     * The resource name of the user to delete.
        -     * 
        - * - * 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; - } - } - /** - *
        -     * The resource name of the user to delete.
        -     * 
        - * - * 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; - } - } - /** - *
        -     * The resource name of the user to delete.
        -     * 
        - * - * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * @param value The name to set. - * @return This builder for chaining. - */ - public Builder setName( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - name_ = value; - onChanged(); - return this; - } - /** - *
        -     * The resource name of the user to delete.
        -     * 
        - * - * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * @return This builder for chaining. - */ - public Builder clearName() { - - name_ = getDefaultInstance().getName(); - onChanged(); - return this; - } - /** - *
        -     * The resource name of the user to delete.
        -     * 
        - * - * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * @param value The bytes for name to set. - * @return This builder for chaining. - */ - public Builder setNameBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - name_ = value; - onChanged(); - return this; - } - @java.lang.Override - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - - // @@protoc_insertion_point(builder_scope:google.showcase.v1beta1.DeleteUserRequest) - } - - // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.DeleteUserRequest) - private static final com.google.showcase.v1beta1.DeleteUserRequest DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new com.google.showcase.v1beta1.DeleteUserRequest(); - } - - public static com.google.showcase.v1beta1.DeleteUserRequest getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public DeleteUserRequest parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new DeleteUserRequest(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public com.google.showcase.v1beta1.DeleteUserRequest getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/DeleteUserRequestOrBuilder.java b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/DeleteUserRequestOrBuilder.java deleted file mode 100644 index 8589132d61..0000000000 --- a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/DeleteUserRequestOrBuilder.java +++ /dev/null @@ -1,29 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: schema/google/showcase/v1beta1/identity.proto - -package com.google.showcase.v1beta1; - -public interface DeleteUserRequestOrBuilder extends - // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.DeleteUserRequest) - com.google.protobuf.MessageOrBuilder { - - /** - *
        -   * The resource name of the user to delete.
        -   * 
        - * - * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * @return The name. - */ - java.lang.String getName(); - /** - *
        -   * The resource name of the user to delete.
        -   * 
        - * - * 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/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/EchoOuterClass.java b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/EchoOuterClass.java deleted file mode 100644 index 7f860781d4..0000000000 --- a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/EchoOuterClass.java +++ /dev/null @@ -1,301 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: schema/google/showcase/v1beta1/echo.proto - -package com.google.showcase.v1beta1; - -public final class EchoOuterClass { - private EchoOuterClass() {} - 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_showcase_v1beta1_EchoRequest_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_showcase_v1beta1_EchoRequest_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_showcase_v1beta1_EchoResponse_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_showcase_v1beta1_EchoResponse_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_showcase_v1beta1_ExpandRequest_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_showcase_v1beta1_ExpandRequest_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_showcase_v1beta1_PagedExpandRequest_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_showcase_v1beta1_PagedExpandRequest_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_showcase_v1beta1_PagedExpandLegacyRequest_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_showcase_v1beta1_PagedExpandLegacyRequest_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_showcase_v1beta1_PagedExpandResponse_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_showcase_v1beta1_PagedExpandResponse_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_showcase_v1beta1_PagedExpandResponseList_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_showcase_v1beta1_PagedExpandResponseList_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_showcase_v1beta1_PagedExpandLegacyMappedResponse_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_showcase_v1beta1_PagedExpandLegacyMappedResponse_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_showcase_v1beta1_PagedExpandLegacyMappedResponse_AlphabetizedEntry_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_showcase_v1beta1_PagedExpandLegacyMappedResponse_AlphabetizedEntry_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_showcase_v1beta1_WaitRequest_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_showcase_v1beta1_WaitRequest_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_showcase_v1beta1_WaitResponse_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_showcase_v1beta1_WaitResponse_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_showcase_v1beta1_WaitMetadata_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_showcase_v1beta1_WaitMetadata_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_showcase_v1beta1_BlockRequest_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_showcase_v1beta1_BlockRequest_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_showcase_v1beta1_BlockResponse_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_showcase_v1beta1_BlockResponse_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)schema/google/showcase/v1beta1/echo.pr" + - "oto\022\027google.showcase.v1beta1\032\034google/api" + - "/annotations.proto\032\027google/api/client.pr" + - "oto\032\037google/api/field_behavior.proto\032\030go" + - "ogle/api/routing.proto\032#google/longrunni" + - "ng/operations.proto\032\036google/protobuf/dur" + - "ation.proto\032\037google/protobuf/timestamp.p" + - "roto\032\027google/rpc/status.proto\"\254\001\n\013EchoRe" + - "quest\022\021\n\007content\030\001 \001(\tH\000\022#\n\005error\030\002 \001(\0132" + - "\022.google.rpc.StatusH\000\0223\n\010severity\030\003 \001(\0162" + - "!.google.showcase.v1beta1.Severity\022\016\n\006he" + - "ader\030\004 \001(\t\022\024\n\014other_header\030\005 \001(\tB\n\n\010resp" + - "onse\"T\n\014EchoResponse\022\017\n\007content\030\001 \001(\t\0223\n" + - "\010severity\030\002 \001(\0162!.google.showcase.v1beta" + - "1.Severity\"C\n\rExpandRequest\022\017\n\007content\030\001" + - " \001(\t\022!\n\005error\030\002 \001(\0132\022.google.rpc.Status\"" + - "Q\n\022PagedExpandRequest\022\024\n\007content\030\001 \001(\tB\003" + - "\340A\002\022\021\n\tpage_size\030\002 \001(\005\022\022\n\npage_token\030\003 \001" + - "(\t\"Y\n\030PagedExpandLegacyRequest\022\024\n\007conten" + - "t\030\001 \001(\tB\003\340A\002\022\023\n\013max_results\030\002 \001(\005\022\022\n\npag" + - "e_token\030\003 \001(\t\"h\n\023PagedExpandResponse\0228\n\t" + - "responses\030\001 \003(\0132%.google.showcase.v1beta" + - "1.EchoResponse\022\027\n\017next_page_token\030\002 \001(\t\"" + - "(\n\027PagedExpandResponseList\022\r\n\005words\030\001 \003(" + - "\t\"\203\002\n\037PagedExpandLegacyMappedResponse\022`\n" + - "\014alphabetized\030\001 \003(\0132J.google.showcase.v1" + - "beta1.PagedExpandLegacyMappedResponse.Al" + - "phabetizedEntry\022\027\n\017next_page_token\030\002 \001(\t" + - "\032e\n\021AlphabetizedEntry\022\013\n\003key\030\001 \001(\t\022?\n\005va" + - "lue\030\002 \001(\01320.google.showcase.v1beta1.Page" + - "dExpandResponseList:\0028\001\"\331\001\n\013WaitRequest\022" + - ".\n\010end_time\030\001 \001(\0132\032.google.protobuf.Time" + - "stampH\000\022(\n\003ttl\030\004 \001(\0132\031.google.protobuf.D" + - "urationH\000\022#\n\005error\030\002 \001(\0132\022.google.rpc.St" + - "atusH\001\0228\n\007success\030\003 \001(\0132%.google.showcas" + - "e.v1beta1.WaitResponseH\001B\005\n\003endB\n\n\010respo" + - "nse\"\037\n\014WaitResponse\022\017\n\007content\030\001 \001(\t\"<\n\014" + - "WaitMetadata\022,\n\010end_time\030\001 \001(\0132\032.google." + - "protobuf.Timestamp\"\255\001\n\014BlockRequest\0221\n\016r" + - "esponse_delay\030\001 \001(\0132\031.google.protobuf.Du" + - "ration\022#\n\005error\030\002 \001(\0132\022.google.rpc.Statu" + - "sH\000\0229\n\007success\030\003 \001(\0132&.google.showcase.v" + - "1beta1.BlockResponseH\000B\n\n\010response\" \n\rBl" + - "ockResponse\022\017\n\007content\030\001 \001(\t*D\n\010Severity" + - "\022\017\n\013UNNECESSARY\020\000\022\r\n\tNECESSARY\020\001\022\n\n\006URGE" + - "NT\020\002\022\014\n\010CRITICAL\020\0032\377\013\n\004Echo\022\224\003\n\004Echo\022$.g" + - "oogle.showcase.v1beta1.EchoRequest\032%.goo" + - "gle.showcase.v1beta1.EchoResponse\"\276\002\202\323\344\223" + - "\002\027\"\022/v1beta1/echo:echo:\001*\212\323\344\223\002\232\002\022\010\n\006head" + - "er\022\031\n\006header\022\017{routing_id=**}\022+\n\006header\022" + - "!{table_name=regions/*/zones/*/**}\022\"\n\006he" + - "ader\022\030{super_id=projects/*}/**\0220\n\006header" + - "\022&{table_name=projects/*/instances/*/**}" + - "\0221\n\006header\022\'projects/*/{instance_id=inst" + - "ances/*}/**\022\030\n\014other_header\022\010{baz=**}\022#\n" + - "\014other_header\022\023{qux=projects/*}/**\022\212\001\n\006E" + - "xpand\022&.google.showcase.v1beta1.ExpandRe" + - "quest\032%.google.showcase.v1beta1.EchoResp" + - "onse\"/\202\323\344\223\002\031\"\024/v1beta1/echo:expand:\001*\332A\r" + - "content,error0\001\022z\n\007Collect\022$.google.show" + - "case.v1beta1.EchoRequest\032%.google.showca" + - "se.v1beta1.EchoResponse\" \202\323\344\223\002\032\"\025/v1beta" + - "1/echo:collect:\001*(\001\022W\n\004Chat\022$.google.sho" + - "wcase.v1beta1.EchoRequest\032%.google.showc" + - "ase.v1beta1.EchoResponse(\0010\001\022\216\001\n\013PagedEx" + - "pand\022+.google.showcase.v1beta1.PagedExpa" + - "ndRequest\032,.google.showcase.v1beta1.Page" + - "dExpandResponse\"$\202\323\344\223\002\036\"\031/v1beta1/echo:p" + - "agedExpand:\001*\022\240\001\n\021PagedExpandLegacy\0221.go" + - "ogle.showcase.v1beta1.PagedExpandLegacyR" + - "equest\032,.google.showcase.v1beta1.PagedEx" + - "pandResponse\"*\202\323\344\223\002$\"\037/v1beta1/echo:page" + - "dExpandLegacy:\001*\022\262\001\n\027PagedExpandLegacyMa" + - "pped\022+.google.showcase.v1beta1.PagedExpa" + - "ndRequest\0328.google.showcase.v1beta1.Page" + - "dExpandLegacyMappedResponse\"0\202\323\344\223\002*\"%/v1" + - "beta1/echo:pagedExpandLegacyMapped:\001*\022\211\001" + - "\n\004Wait\022$.google.showcase.v1beta1.WaitReq" + - "uest\032\035.google.longrunning.Operation\"<\202\323\344" + - "\223\002\027\"\022/v1beta1/echo:wait:\001*\312A\034\n\014WaitRespo" + - "nse\022\014WaitMetadata\022v\n\005Block\022%.google.show" + - "case.v1beta1.BlockRequest\032&.google.showc" + - "ase.v1beta1.BlockResponse\"\036\202\323\344\223\002\030\"\023/v1be" + - "ta1/echo:block:\001*\032\021\312A\016localhost:7469Bq\n\033" + - "com.google.showcase.v1beta1P\001Z4github.co" + - "m/googleapis/gapic-showcase/server/genpr" + - "oto\352\002\031Google::Showcase::V1beta1b\006proto3" - }; - descriptor = com.google.protobuf.Descriptors.FileDescriptor - .internalBuildGeneratedFileFrom(descriptorData, - new com.google.protobuf.Descriptors.FileDescriptor[] { - com.google.api.AnnotationsProto.getDescriptor(), - com.google.api.ClientProto.getDescriptor(), - com.google.api.FieldBehaviorProto.getDescriptor(), - com.google.api.RoutingProto.getDescriptor(), - com.google.longrunning.OperationsProto.getDescriptor(), - com.google.protobuf.DurationProto.getDescriptor(), - com.google.protobuf.TimestampProto.getDescriptor(), - com.google.rpc.StatusProto.getDescriptor(), - }); - internal_static_google_showcase_v1beta1_EchoRequest_descriptor = - getDescriptor().getMessageTypes().get(0); - internal_static_google_showcase_v1beta1_EchoRequest_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_google_showcase_v1beta1_EchoRequest_descriptor, - new java.lang.String[] { "Content", "Error", "Severity", "Header", "OtherHeader", "Response", }); - internal_static_google_showcase_v1beta1_EchoResponse_descriptor = - getDescriptor().getMessageTypes().get(1); - internal_static_google_showcase_v1beta1_EchoResponse_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_google_showcase_v1beta1_EchoResponse_descriptor, - new java.lang.String[] { "Content", "Severity", }); - internal_static_google_showcase_v1beta1_ExpandRequest_descriptor = - getDescriptor().getMessageTypes().get(2); - internal_static_google_showcase_v1beta1_ExpandRequest_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_google_showcase_v1beta1_ExpandRequest_descriptor, - new java.lang.String[] { "Content", "Error", }); - internal_static_google_showcase_v1beta1_PagedExpandRequest_descriptor = - getDescriptor().getMessageTypes().get(3); - internal_static_google_showcase_v1beta1_PagedExpandRequest_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_google_showcase_v1beta1_PagedExpandRequest_descriptor, - new java.lang.String[] { "Content", "PageSize", "PageToken", }); - internal_static_google_showcase_v1beta1_PagedExpandLegacyRequest_descriptor = - getDescriptor().getMessageTypes().get(4); - internal_static_google_showcase_v1beta1_PagedExpandLegacyRequest_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_google_showcase_v1beta1_PagedExpandLegacyRequest_descriptor, - new java.lang.String[] { "Content", "MaxResults", "PageToken", }); - internal_static_google_showcase_v1beta1_PagedExpandResponse_descriptor = - getDescriptor().getMessageTypes().get(5); - internal_static_google_showcase_v1beta1_PagedExpandResponse_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_google_showcase_v1beta1_PagedExpandResponse_descriptor, - new java.lang.String[] { "Responses", "NextPageToken", }); - internal_static_google_showcase_v1beta1_PagedExpandResponseList_descriptor = - getDescriptor().getMessageTypes().get(6); - internal_static_google_showcase_v1beta1_PagedExpandResponseList_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_google_showcase_v1beta1_PagedExpandResponseList_descriptor, - new java.lang.String[] { "Words", }); - internal_static_google_showcase_v1beta1_PagedExpandLegacyMappedResponse_descriptor = - getDescriptor().getMessageTypes().get(7); - internal_static_google_showcase_v1beta1_PagedExpandLegacyMappedResponse_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_google_showcase_v1beta1_PagedExpandLegacyMappedResponse_descriptor, - new java.lang.String[] { "Alphabetized", "NextPageToken", }); - internal_static_google_showcase_v1beta1_PagedExpandLegacyMappedResponse_AlphabetizedEntry_descriptor = - internal_static_google_showcase_v1beta1_PagedExpandLegacyMappedResponse_descriptor.getNestedTypes().get(0); - internal_static_google_showcase_v1beta1_PagedExpandLegacyMappedResponse_AlphabetizedEntry_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_google_showcase_v1beta1_PagedExpandLegacyMappedResponse_AlphabetizedEntry_descriptor, - new java.lang.String[] { "Key", "Value", }); - internal_static_google_showcase_v1beta1_WaitRequest_descriptor = - getDescriptor().getMessageTypes().get(8); - internal_static_google_showcase_v1beta1_WaitRequest_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_google_showcase_v1beta1_WaitRequest_descriptor, - new java.lang.String[] { "EndTime", "Ttl", "Error", "Success", "End", "Response", }); - internal_static_google_showcase_v1beta1_WaitResponse_descriptor = - getDescriptor().getMessageTypes().get(9); - internal_static_google_showcase_v1beta1_WaitResponse_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_google_showcase_v1beta1_WaitResponse_descriptor, - new java.lang.String[] { "Content", }); - internal_static_google_showcase_v1beta1_WaitMetadata_descriptor = - getDescriptor().getMessageTypes().get(10); - internal_static_google_showcase_v1beta1_WaitMetadata_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_google_showcase_v1beta1_WaitMetadata_descriptor, - new java.lang.String[] { "EndTime", }); - internal_static_google_showcase_v1beta1_BlockRequest_descriptor = - getDescriptor().getMessageTypes().get(11); - internal_static_google_showcase_v1beta1_BlockRequest_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_google_showcase_v1beta1_BlockRequest_descriptor, - new java.lang.String[] { "ResponseDelay", "Error", "Success", "Response", }); - internal_static_google_showcase_v1beta1_BlockResponse_descriptor = - getDescriptor().getMessageTypes().get(12); - internal_static_google_showcase_v1beta1_BlockResponse_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_google_showcase_v1beta1_BlockResponse_descriptor, - new java.lang.String[] { "Content", }); - 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.RoutingProto.routing); - 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.RoutingProto.getDescriptor(); - com.google.longrunning.OperationsProto.getDescriptor(); - com.google.protobuf.DurationProto.getDescriptor(); - com.google.protobuf.TimestampProto.getDescriptor(); - com.google.rpc.StatusProto.getDescriptor(); - } - - // @@protoc_insertion_point(outer_class_scope) -} diff --git a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/EchoRequest.java b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/EchoRequest.java deleted file mode 100644 index 7fb30c11fe..0000000000 --- a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/EchoRequest.java +++ /dev/null @@ -1,1439 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: schema/google/showcase/v1beta1/echo.proto - -package com.google.showcase.v1beta1; - -/** - *
        - * The request message used for the Echo, Collect and Chat methods.
        - * If content or opt are set in this message then the request will succeed.
        - * If status is set in this message then the status will be returned as an
        - * error.
        - * 
        - * - * Protobuf type {@code google.showcase.v1beta1.EchoRequest} - */ -public final class EchoRequest extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.EchoRequest) - EchoRequestOrBuilder { -private static final long serialVersionUID = 0L; - // Use EchoRequest.newBuilder() to construct. - private EchoRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private EchoRequest() { - severity_ = 0; - header_ = ""; - otherHeader_ = ""; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new EchoRequest(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private EchoRequest( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: { - java.lang.String s = input.readStringRequireUtf8(); - responseCase_ = 1; - response_ = s; - break; - } - case 18: { - com.google.rpc.Status.Builder subBuilder = null; - if (responseCase_ == 2) { - subBuilder = ((com.google.rpc.Status) response_).toBuilder(); - } - response_ = - input.readMessage(com.google.rpc.Status.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom((com.google.rpc.Status) response_); - response_ = subBuilder.buildPartial(); - } - responseCase_ = 2; - break; - } - case 24: { - int rawValue = input.readEnum(); - - severity_ = rawValue; - break; - } - case 34: { - java.lang.String s = input.readStringRequireUtf8(); - - header_ = s; - break; - } - case 42: { - java.lang.String s = input.readStringRequireUtf8(); - - otherHeader_ = s; - break; - } - default: { - if (!parseUnknownField( - input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException( - e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.google.showcase.v1beta1.EchoOuterClass.internal_static_google_showcase_v1beta1_EchoRequest_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.showcase.v1beta1.EchoOuterClass.internal_static_google_showcase_v1beta1_EchoRequest_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.showcase.v1beta1.EchoRequest.class, com.google.showcase.v1beta1.EchoRequest.Builder.class); - } - - private int responseCase_ = 0; - private java.lang.Object response_; - public enum ResponseCase - implements com.google.protobuf.Internal.EnumLite, - com.google.protobuf.AbstractMessage.InternalOneOfEnum { - CONTENT(1), - ERROR(2), - RESPONSE_NOT_SET(0); - private final int value; - private ResponseCase(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 ResponseCase valueOf(int value) { - return forNumber(value); - } - - public static ResponseCase forNumber(int value) { - switch (value) { - case 1: return CONTENT; - case 2: return ERROR; - case 0: return RESPONSE_NOT_SET; - default: return null; - } - } - public int getNumber() { - return this.value; - } - }; - - public ResponseCase - getResponseCase() { - return ResponseCase.forNumber( - responseCase_); - } - - public static final int CONTENT_FIELD_NUMBER = 1; - /** - *
        -   * The content to be echoed by the server.
        -   * 
        - * - * string content = 1; - * @return Whether the content field is set. - */ - public boolean hasContent() { - return responseCase_ == 1; - } - /** - *
        -   * The content to be echoed by the server.
        -   * 
        - * - * string content = 1; - * @return The content. - */ - public java.lang.String getContent() { - java.lang.Object ref = ""; - if (responseCase_ == 1) { - ref = response_; - } - 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 (responseCase_ == 1) { - response_ = s; - } - return s; - } - } - /** - *
        -   * The content to be echoed by the server.
        -   * 
        - * - * string content = 1; - * @return The bytes for content. - */ - public com.google.protobuf.ByteString - getContentBytes() { - java.lang.Object ref = ""; - if (responseCase_ == 1) { - ref = response_; - } - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - if (responseCase_ == 1) { - response_ = b; - } - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int ERROR_FIELD_NUMBER = 2; - /** - *
        -   * The error to be thrown by the server.
        -   * 
        - * - * .google.rpc.Status error = 2; - * @return Whether the error field is set. - */ - @java.lang.Override - public boolean hasError() { - return responseCase_ == 2; - } - /** - *
        -   * The error to be thrown by the server.
        -   * 
        - * - * .google.rpc.Status error = 2; - * @return The error. - */ - @java.lang.Override - public com.google.rpc.Status getError() { - if (responseCase_ == 2) { - return (com.google.rpc.Status) response_; - } - return com.google.rpc.Status.getDefaultInstance(); - } - /** - *
        -   * The error to be thrown by the server.
        -   * 
        - * - * .google.rpc.Status error = 2; - */ - @java.lang.Override - public com.google.rpc.StatusOrBuilder getErrorOrBuilder() { - if (responseCase_ == 2) { - return (com.google.rpc.Status) response_; - } - return com.google.rpc.Status.getDefaultInstance(); - } - - public static final int SEVERITY_FIELD_NUMBER = 3; - private int severity_; - /** - *
        -   * The severity to be echoed by the server.
        -   * 
        - * - * .google.showcase.v1beta1.Severity severity = 3; - * @return The enum numeric value on the wire for severity. - */ - @java.lang.Override public int getSeverityValue() { - return severity_; - } - /** - *
        -   * The severity to be echoed by the server.
        -   * 
        - * - * .google.showcase.v1beta1.Severity severity = 3; - * @return The severity. - */ - @java.lang.Override public com.google.showcase.v1beta1.Severity getSeverity() { - @SuppressWarnings("deprecation") - com.google.showcase.v1beta1.Severity result = com.google.showcase.v1beta1.Severity.valueOf(severity_); - return result == null ? com.google.showcase.v1beta1.Severity.UNRECOGNIZED : result; - } - - public static final int HEADER_FIELD_NUMBER = 4; - private volatile java.lang.Object header_; - /** - *
        -   * Optional. This field can be set to test the routing annotation on the Echo method.
        -   * 
        - * - * string header = 4; - * @return The header. - */ - @java.lang.Override - public java.lang.String getHeader() { - java.lang.Object ref = header_; - 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(); - header_ = s; - return s; - } - } - /** - *
        -   * Optional. This field can be set to test the routing annotation on the Echo method.
        -   * 
        - * - * string header = 4; - * @return The bytes for header. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getHeaderBytes() { - java.lang.Object ref = header_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - header_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int OTHER_HEADER_FIELD_NUMBER = 5; - private volatile java.lang.Object otherHeader_; - /** - *
        -   * Optional. This field can be set to test the routing annotation on the Echo method.
        -   * 
        - * - * string other_header = 5; - * @return The otherHeader. - */ - @java.lang.Override - public java.lang.String getOtherHeader() { - java.lang.Object ref = otherHeader_; - 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(); - otherHeader_ = s; - return s; - } - } - /** - *
        -   * Optional. This field can be set to test the routing annotation on the Echo method.
        -   * 
        - * - * string other_header = 5; - * @return The bytes for otherHeader. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getOtherHeaderBytes() { - java.lang.Object ref = otherHeader_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - otherHeader_ = 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 (responseCase_ == 1) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, response_); - } - if (responseCase_ == 2) { - output.writeMessage(2, (com.google.rpc.Status) response_); - } - if (severity_ != com.google.showcase.v1beta1.Severity.UNNECESSARY.getNumber()) { - output.writeEnum(3, severity_); - } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(header_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 4, header_); - } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(otherHeader_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 5, otherHeader_); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (responseCase_ == 1) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, response_); - } - if (responseCase_ == 2) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(2, (com.google.rpc.Status) response_); - } - if (severity_ != com.google.showcase.v1beta1.Severity.UNNECESSARY.getNumber()) { - size += com.google.protobuf.CodedOutputStream - .computeEnumSize(3, severity_); - } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(header_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, header_); - } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(otherHeader_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, otherHeader_); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof com.google.showcase.v1beta1.EchoRequest)) { - return super.equals(obj); - } - com.google.showcase.v1beta1.EchoRequest other = (com.google.showcase.v1beta1.EchoRequest) obj; - - if (severity_ != other.severity_) return false; - if (!getHeader() - .equals(other.getHeader())) return false; - if (!getOtherHeader() - .equals(other.getOtherHeader())) return false; - if (!getResponseCase().equals(other.getResponseCase())) return false; - switch (responseCase_) { - case 1: - if (!getContent() - .equals(other.getContent())) return false; - break; - case 2: - if (!getError() - .equals(other.getError())) return false; - break; - case 0: - default: - } - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - hash = (37 * hash) + SEVERITY_FIELD_NUMBER; - hash = (53 * hash) + severity_; - hash = (37 * hash) + HEADER_FIELD_NUMBER; - hash = (53 * hash) + getHeader().hashCode(); - hash = (37 * hash) + OTHER_HEADER_FIELD_NUMBER; - hash = (53 * hash) + getOtherHeader().hashCode(); - switch (responseCase_) { - case 1: - hash = (37 * hash) + CONTENT_FIELD_NUMBER; - hash = (53 * hash) + getContent().hashCode(); - break; - case 2: - hash = (37 * hash) + ERROR_FIELD_NUMBER; - hash = (53 * hash) + getError().hashCode(); - break; - case 0: - default: - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.showcase.v1beta1.EchoRequest parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.showcase.v1beta1.EchoRequest parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.showcase.v1beta1.EchoRequest parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.showcase.v1beta1.EchoRequest 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.showcase.v1beta1.EchoRequest parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.showcase.v1beta1.EchoRequest parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.showcase.v1beta1.EchoRequest parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static com.google.showcase.v1beta1.EchoRequest 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.showcase.v1beta1.EchoRequest parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static com.google.showcase.v1beta1.EchoRequest 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.showcase.v1beta1.EchoRequest parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static com.google.showcase.v1beta1.EchoRequest 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.showcase.v1beta1.EchoRequest 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 request message used for the Echo, Collect and Chat methods.
        -   * If content or opt are set in this message then the request will succeed.
        -   * If status is set in this message then the status will be returned as an
        -   * error.
        -   * 
        - * - * Protobuf type {@code google.showcase.v1beta1.EchoRequest} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.EchoRequest) - com.google.showcase.v1beta1.EchoRequestOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.google.showcase.v1beta1.EchoOuterClass.internal_static_google_showcase_v1beta1_EchoRequest_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.showcase.v1beta1.EchoOuterClass.internal_static_google_showcase_v1beta1_EchoRequest_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.showcase.v1beta1.EchoRequest.class, com.google.showcase.v1beta1.EchoRequest.Builder.class); - } - - // Construct using com.google.showcase.v1beta1.EchoRequest.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { - } - } - @java.lang.Override - public Builder clear() { - super.clear(); - severity_ = 0; - - header_ = ""; - - otherHeader_ = ""; - - responseCase_ = 0; - response_ = null; - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return com.google.showcase.v1beta1.EchoOuterClass.internal_static_google_showcase_v1beta1_EchoRequest_descriptor; - } - - @java.lang.Override - public com.google.showcase.v1beta1.EchoRequest getDefaultInstanceForType() { - return com.google.showcase.v1beta1.EchoRequest.getDefaultInstance(); - } - - @java.lang.Override - public com.google.showcase.v1beta1.EchoRequest build() { - com.google.showcase.v1beta1.EchoRequest result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.showcase.v1beta1.EchoRequest buildPartial() { - com.google.showcase.v1beta1.EchoRequest result = new com.google.showcase.v1beta1.EchoRequest(this); - if (responseCase_ == 1) { - result.response_ = response_; - } - if (responseCase_ == 2) { - if (errorBuilder_ == null) { - result.response_ = response_; - } else { - result.response_ = errorBuilder_.build(); - } - } - result.severity_ = severity_; - result.header_ = header_; - result.otherHeader_ = otherHeader_; - result.responseCase_ = responseCase_; - 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.showcase.v1beta1.EchoRequest) { - return mergeFrom((com.google.showcase.v1beta1.EchoRequest)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.showcase.v1beta1.EchoRequest other) { - if (other == com.google.showcase.v1beta1.EchoRequest.getDefaultInstance()) return this; - if (other.severity_ != 0) { - setSeverityValue(other.getSeverityValue()); - } - if (!other.getHeader().isEmpty()) { - header_ = other.header_; - onChanged(); - } - if (!other.getOtherHeader().isEmpty()) { - otherHeader_ = other.otherHeader_; - onChanged(); - } - switch (other.getResponseCase()) { - case CONTENT: { - responseCase_ = 1; - response_ = other.response_; - onChanged(); - break; - } - case ERROR: { - mergeError(other.getError()); - break; - } - case RESPONSE_NOT_SET: { - break; - } - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - com.google.showcase.v1beta1.EchoRequest parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (com.google.showcase.v1beta1.EchoRequest) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - private int responseCase_ = 0; - private java.lang.Object response_; - public ResponseCase - getResponseCase() { - return ResponseCase.forNumber( - responseCase_); - } - - public Builder clearResponse() { - responseCase_ = 0; - response_ = null; - onChanged(); - return this; - } - - - /** - *
        -     * The content to be echoed by the server.
        -     * 
        - * - * string content = 1; - * @return Whether the content field is set. - */ - @java.lang.Override - public boolean hasContent() { - return responseCase_ == 1; - } - /** - *
        -     * The content to be echoed by the server.
        -     * 
        - * - * string content = 1; - * @return The content. - */ - @java.lang.Override - public java.lang.String getContent() { - java.lang.Object ref = ""; - if (responseCase_ == 1) { - ref = response_; - } - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - if (responseCase_ == 1) { - response_ = s; - } - return s; - } else { - return (java.lang.String) ref; - } - } - /** - *
        -     * The content to be echoed by the server.
        -     * 
        - * - * string content = 1; - * @return The bytes for content. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getContentBytes() { - java.lang.Object ref = ""; - if (responseCase_ == 1) { - ref = response_; - } - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - if (responseCase_ == 1) { - response_ = b; - } - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - *
        -     * The content to be echoed by the server.
        -     * 
        - * - * string content = 1; - * @param value The content to set. - * @return This builder for chaining. - */ - public Builder setContent( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - responseCase_ = 1; - response_ = value; - onChanged(); - return this; - } - /** - *
        -     * The content to be echoed by the server.
        -     * 
        - * - * string content = 1; - * @return This builder for chaining. - */ - public Builder clearContent() { - if (responseCase_ == 1) { - responseCase_ = 0; - response_ = null; - onChanged(); - } - return this; - } - /** - *
        -     * The content to be echoed by the server.
        -     * 
        - * - * string content = 1; - * @param value The bytes for content to set. - * @return This builder for chaining. - */ - public Builder setContentBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - responseCase_ = 1; - response_ = value; - onChanged(); - return this; - } - - private com.google.protobuf.SingleFieldBuilderV3< - com.google.rpc.Status, com.google.rpc.Status.Builder, com.google.rpc.StatusOrBuilder> errorBuilder_; - /** - *
        -     * The error to be thrown by the server.
        -     * 
        - * - * .google.rpc.Status error = 2; - * @return Whether the error field is set. - */ - @java.lang.Override - public boolean hasError() { - return responseCase_ == 2; - } - /** - *
        -     * The error to be thrown by the server.
        -     * 
        - * - * .google.rpc.Status error = 2; - * @return The error. - */ - @java.lang.Override - public com.google.rpc.Status getError() { - if (errorBuilder_ == null) { - if (responseCase_ == 2) { - return (com.google.rpc.Status) response_; - } - return com.google.rpc.Status.getDefaultInstance(); - } else { - if (responseCase_ == 2) { - return errorBuilder_.getMessage(); - } - return com.google.rpc.Status.getDefaultInstance(); - } - } - /** - *
        -     * The error to be thrown by the server.
        -     * 
        - * - * .google.rpc.Status error = 2; - */ - public Builder setError(com.google.rpc.Status value) { - if (errorBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - response_ = value; - onChanged(); - } else { - errorBuilder_.setMessage(value); - } - responseCase_ = 2; - return this; - } - /** - *
        -     * The error to be thrown by the server.
        -     * 
        - * - * .google.rpc.Status error = 2; - */ - public Builder setError( - com.google.rpc.Status.Builder builderForValue) { - if (errorBuilder_ == null) { - response_ = builderForValue.build(); - onChanged(); - } else { - errorBuilder_.setMessage(builderForValue.build()); - } - responseCase_ = 2; - return this; - } - /** - *
        -     * The error to be thrown by the server.
        -     * 
        - * - * .google.rpc.Status error = 2; - */ - public Builder mergeError(com.google.rpc.Status value) { - if (errorBuilder_ == null) { - if (responseCase_ == 2 && - response_ != com.google.rpc.Status.getDefaultInstance()) { - response_ = com.google.rpc.Status.newBuilder((com.google.rpc.Status) response_) - .mergeFrom(value).buildPartial(); - } else { - response_ = value; - } - onChanged(); - } else { - if (responseCase_ == 2) { - errorBuilder_.mergeFrom(value); - } else { - errorBuilder_.setMessage(value); - } - } - responseCase_ = 2; - return this; - } - /** - *
        -     * The error to be thrown by the server.
        -     * 
        - * - * .google.rpc.Status error = 2; - */ - public Builder clearError() { - if (errorBuilder_ == null) { - if (responseCase_ == 2) { - responseCase_ = 0; - response_ = null; - onChanged(); - } - } else { - if (responseCase_ == 2) { - responseCase_ = 0; - response_ = null; - } - errorBuilder_.clear(); - } - return this; - } - /** - *
        -     * The error to be thrown by the server.
        -     * 
        - * - * .google.rpc.Status error = 2; - */ - public com.google.rpc.Status.Builder getErrorBuilder() { - return getErrorFieldBuilder().getBuilder(); - } - /** - *
        -     * The error to be thrown by the server.
        -     * 
        - * - * .google.rpc.Status error = 2; - */ - @java.lang.Override - public com.google.rpc.StatusOrBuilder getErrorOrBuilder() { - if ((responseCase_ == 2) && (errorBuilder_ != null)) { - return errorBuilder_.getMessageOrBuilder(); - } else { - if (responseCase_ == 2) { - return (com.google.rpc.Status) response_; - } - return com.google.rpc.Status.getDefaultInstance(); - } - } - /** - *
        -     * The error to be thrown by the server.
        -     * 
        - * - * .google.rpc.Status error = 2; - */ - private com.google.protobuf.SingleFieldBuilderV3< - com.google.rpc.Status, com.google.rpc.Status.Builder, com.google.rpc.StatusOrBuilder> - getErrorFieldBuilder() { - if (errorBuilder_ == null) { - if (!(responseCase_ == 2)) { - response_ = com.google.rpc.Status.getDefaultInstance(); - } - errorBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - com.google.rpc.Status, com.google.rpc.Status.Builder, com.google.rpc.StatusOrBuilder>( - (com.google.rpc.Status) response_, - getParentForChildren(), - isClean()); - response_ = null; - } - responseCase_ = 2; - onChanged();; - return errorBuilder_; - } - - private int severity_ = 0; - /** - *
        -     * The severity to be echoed by the server.
        -     * 
        - * - * .google.showcase.v1beta1.Severity severity = 3; - * @return The enum numeric value on the wire for severity. - */ - @java.lang.Override public int getSeverityValue() { - return severity_; - } - /** - *
        -     * The severity to be echoed by the server.
        -     * 
        - * - * .google.showcase.v1beta1.Severity severity = 3; - * @param value The enum numeric value on the wire for severity to set. - * @return This builder for chaining. - */ - public Builder setSeverityValue(int value) { - - severity_ = value; - onChanged(); - return this; - } - /** - *
        -     * The severity to be echoed by the server.
        -     * 
        - * - * .google.showcase.v1beta1.Severity severity = 3; - * @return The severity. - */ - @java.lang.Override - public com.google.showcase.v1beta1.Severity getSeverity() { - @SuppressWarnings("deprecation") - com.google.showcase.v1beta1.Severity result = com.google.showcase.v1beta1.Severity.valueOf(severity_); - return result == null ? com.google.showcase.v1beta1.Severity.UNRECOGNIZED : result; - } - /** - *
        -     * The severity to be echoed by the server.
        -     * 
        - * - * .google.showcase.v1beta1.Severity severity = 3; - * @param value The severity to set. - * @return This builder for chaining. - */ - public Builder setSeverity(com.google.showcase.v1beta1.Severity value) { - if (value == null) { - throw new NullPointerException(); - } - - severity_ = value.getNumber(); - onChanged(); - return this; - } - /** - *
        -     * The severity to be echoed by the server.
        -     * 
        - * - * .google.showcase.v1beta1.Severity severity = 3; - * @return This builder for chaining. - */ - public Builder clearSeverity() { - - severity_ = 0; - onChanged(); - return this; - } - - private java.lang.Object header_ = ""; - /** - *
        -     * Optional. This field can be set to test the routing annotation on the Echo method.
        -     * 
        - * - * string header = 4; - * @return The header. - */ - public java.lang.String getHeader() { - java.lang.Object ref = header_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - header_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - *
        -     * Optional. This field can be set to test the routing annotation on the Echo method.
        -     * 
        - * - * string header = 4; - * @return The bytes for header. - */ - public com.google.protobuf.ByteString - getHeaderBytes() { - java.lang.Object ref = header_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - header_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - *
        -     * Optional. This field can be set to test the routing annotation on the Echo method.
        -     * 
        - * - * string header = 4; - * @param value The header to set. - * @return This builder for chaining. - */ - public Builder setHeader( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - header_ = value; - onChanged(); - return this; - } - /** - *
        -     * Optional. This field can be set to test the routing annotation on the Echo method.
        -     * 
        - * - * string header = 4; - * @return This builder for chaining. - */ - public Builder clearHeader() { - - header_ = getDefaultInstance().getHeader(); - onChanged(); - return this; - } - /** - *
        -     * Optional. This field can be set to test the routing annotation on the Echo method.
        -     * 
        - * - * string header = 4; - * @param value The bytes for header to set. - * @return This builder for chaining. - */ - public Builder setHeaderBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - header_ = value; - onChanged(); - return this; - } - - private java.lang.Object otherHeader_ = ""; - /** - *
        -     * Optional. This field can be set to test the routing annotation on the Echo method.
        -     * 
        - * - * string other_header = 5; - * @return The otherHeader. - */ - public java.lang.String getOtherHeader() { - java.lang.Object ref = otherHeader_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - otherHeader_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - *
        -     * Optional. This field can be set to test the routing annotation on the Echo method.
        -     * 
        - * - * string other_header = 5; - * @return The bytes for otherHeader. - */ - public com.google.protobuf.ByteString - getOtherHeaderBytes() { - java.lang.Object ref = otherHeader_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - otherHeader_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - *
        -     * Optional. This field can be set to test the routing annotation on the Echo method.
        -     * 
        - * - * string other_header = 5; - * @param value The otherHeader to set. - * @return This builder for chaining. - */ - public Builder setOtherHeader( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - otherHeader_ = value; - onChanged(); - return this; - } - /** - *
        -     * Optional. This field can be set to test the routing annotation on the Echo method.
        -     * 
        - * - * string other_header = 5; - * @return This builder for chaining. - */ - public Builder clearOtherHeader() { - - otherHeader_ = getDefaultInstance().getOtherHeader(); - onChanged(); - return this; - } - /** - *
        -     * Optional. This field can be set to test the routing annotation on the Echo method.
        -     * 
        - * - * string other_header = 5; - * @param value The bytes for otherHeader to set. - * @return This builder for chaining. - */ - public Builder setOtherHeaderBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - otherHeader_ = value; - onChanged(); - return this; - } - @java.lang.Override - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - - // @@protoc_insertion_point(builder_scope:google.showcase.v1beta1.EchoRequest) - } - - // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.EchoRequest) - private static final com.google.showcase.v1beta1.EchoRequest DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new com.google.showcase.v1beta1.EchoRequest(); - } - - public static com.google.showcase.v1beta1.EchoRequest getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public EchoRequest parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new EchoRequest(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public com.google.showcase.v1beta1.EchoRequest getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/EchoRequestOrBuilder.java b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/EchoRequestOrBuilder.java deleted file mode 100644 index 08bd7d605f..0000000000 --- a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/EchoRequestOrBuilder.java +++ /dev/null @@ -1,126 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: schema/google/showcase/v1beta1/echo.proto - -package com.google.showcase.v1beta1; - -public interface EchoRequestOrBuilder extends - // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.EchoRequest) - com.google.protobuf.MessageOrBuilder { - - /** - *
        -   * The content to be echoed by the server.
        -   * 
        - * - * string content = 1; - * @return Whether the content field is set. - */ - boolean hasContent(); - /** - *
        -   * The content to be echoed by the server.
        -   * 
        - * - * string content = 1; - * @return The content. - */ - java.lang.String getContent(); - /** - *
        -   * The content to be echoed by the server.
        -   * 
        - * - * string content = 1; - * @return The bytes for content. - */ - com.google.protobuf.ByteString - getContentBytes(); - - /** - *
        -   * The error to be thrown by the server.
        -   * 
        - * - * .google.rpc.Status error = 2; - * @return Whether the error field is set. - */ - boolean hasError(); - /** - *
        -   * The error to be thrown by the server.
        -   * 
        - * - * .google.rpc.Status error = 2; - * @return The error. - */ - com.google.rpc.Status getError(); - /** - *
        -   * The error to be thrown by the server.
        -   * 
        - * - * .google.rpc.Status error = 2; - */ - com.google.rpc.StatusOrBuilder getErrorOrBuilder(); - - /** - *
        -   * The severity to be echoed by the server.
        -   * 
        - * - * .google.showcase.v1beta1.Severity severity = 3; - * @return The enum numeric value on the wire for severity. - */ - int getSeverityValue(); - /** - *
        -   * The severity to be echoed by the server.
        -   * 
        - * - * .google.showcase.v1beta1.Severity severity = 3; - * @return The severity. - */ - com.google.showcase.v1beta1.Severity getSeverity(); - - /** - *
        -   * Optional. This field can be set to test the routing annotation on the Echo method.
        -   * 
        - * - * string header = 4; - * @return The header. - */ - java.lang.String getHeader(); - /** - *
        -   * Optional. This field can be set to test the routing annotation on the Echo method.
        -   * 
        - * - * string header = 4; - * @return The bytes for header. - */ - com.google.protobuf.ByteString - getHeaderBytes(); - - /** - *
        -   * Optional. This field can be set to test the routing annotation on the Echo method.
        -   * 
        - * - * string other_header = 5; - * @return The otherHeader. - */ - java.lang.String getOtherHeader(); - /** - *
        -   * Optional. This field can be set to test the routing annotation on the Echo method.
        -   * 
        - * - * string other_header = 5; - * @return The bytes for otherHeader. - */ - com.google.protobuf.ByteString - getOtherHeaderBytes(); - - public com.google.showcase.v1beta1.EchoRequest.ResponseCase getResponseCase(); -} diff --git a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/EchoResponse.java b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/EchoResponse.java deleted file mode 100644 index 7173d88f4b..0000000000 --- a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/EchoResponse.java +++ /dev/null @@ -1,719 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: schema/google/showcase/v1beta1/echo.proto - -package com.google.showcase.v1beta1; - -/** - *
        - * The response message for the Echo methods.
        - * 
        - * - * Protobuf type {@code google.showcase.v1beta1.EchoResponse} - */ -public final class EchoResponse extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.EchoResponse) - EchoResponseOrBuilder { -private static final long serialVersionUID = 0L; - // Use EchoResponse.newBuilder() to construct. - private EchoResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private EchoResponse() { - content_ = ""; - severity_ = 0; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new EchoResponse(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private EchoResponse( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: { - java.lang.String s = input.readStringRequireUtf8(); - - content_ = s; - break; - } - case 16: { - int rawValue = input.readEnum(); - - severity_ = rawValue; - break; - } - default: { - if (!parseUnknownField( - input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException( - e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.google.showcase.v1beta1.EchoOuterClass.internal_static_google_showcase_v1beta1_EchoResponse_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.showcase.v1beta1.EchoOuterClass.internal_static_google_showcase_v1beta1_EchoResponse_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.showcase.v1beta1.EchoResponse.class, com.google.showcase.v1beta1.EchoResponse.Builder.class); - } - - public static final int CONTENT_FIELD_NUMBER = 1; - private volatile java.lang.Object content_; - /** - *
        -   * The content specified in the request.
        -   * 
        - * - * string content = 1; - * @return The content. - */ - @java.lang.Override - public java.lang.String getContent() { - java.lang.Object ref = content_; - 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(); - content_ = s; - return s; - } - } - /** - *
        -   * The content specified in the request.
        -   * 
        - * - * string content = 1; - * @return The bytes for content. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getContentBytes() { - java.lang.Object ref = content_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - content_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int SEVERITY_FIELD_NUMBER = 2; - private int severity_; - /** - *
        -   * The severity specified in the request.
        -   * 
        - * - * .google.showcase.v1beta1.Severity severity = 2; - * @return The enum numeric value on the wire for severity. - */ - @java.lang.Override public int getSeverityValue() { - return severity_; - } - /** - *
        -   * The severity specified in the request.
        -   * 
        - * - * .google.showcase.v1beta1.Severity severity = 2; - * @return The severity. - */ - @java.lang.Override public com.google.showcase.v1beta1.Severity getSeverity() { - @SuppressWarnings("deprecation") - com.google.showcase.v1beta1.Severity result = com.google.showcase.v1beta1.Severity.valueOf(severity_); - return result == null ? com.google.showcase.v1beta1.Severity.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(content_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, content_); - } - if (severity_ != com.google.showcase.v1beta1.Severity.UNNECESSARY.getNumber()) { - output.writeEnum(2, severity_); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(content_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, content_); - } - if (severity_ != com.google.showcase.v1beta1.Severity.UNNECESSARY.getNumber()) { - size += com.google.protobuf.CodedOutputStream - .computeEnumSize(2, severity_); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof com.google.showcase.v1beta1.EchoResponse)) { - return super.equals(obj); - } - com.google.showcase.v1beta1.EchoResponse other = (com.google.showcase.v1beta1.EchoResponse) obj; - - if (!getContent() - .equals(other.getContent())) return false; - if (severity_ != other.severity_) return false; - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - hash = (37 * hash) + CONTENT_FIELD_NUMBER; - hash = (53 * hash) + getContent().hashCode(); - hash = (37 * hash) + SEVERITY_FIELD_NUMBER; - hash = (53 * hash) + severity_; - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.showcase.v1beta1.EchoResponse parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.showcase.v1beta1.EchoResponse parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.showcase.v1beta1.EchoResponse parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.showcase.v1beta1.EchoResponse 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.showcase.v1beta1.EchoResponse parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.showcase.v1beta1.EchoResponse parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.showcase.v1beta1.EchoResponse parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static com.google.showcase.v1beta1.EchoResponse 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.showcase.v1beta1.EchoResponse parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static com.google.showcase.v1beta1.EchoResponse 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.showcase.v1beta1.EchoResponse parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static com.google.showcase.v1beta1.EchoResponse 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.showcase.v1beta1.EchoResponse 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 message for the Echo methods.
        -   * 
        - * - * Protobuf type {@code google.showcase.v1beta1.EchoResponse} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.EchoResponse) - com.google.showcase.v1beta1.EchoResponseOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.google.showcase.v1beta1.EchoOuterClass.internal_static_google_showcase_v1beta1_EchoResponse_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.showcase.v1beta1.EchoOuterClass.internal_static_google_showcase_v1beta1_EchoResponse_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.showcase.v1beta1.EchoResponse.class, com.google.showcase.v1beta1.EchoResponse.Builder.class); - } - - // Construct using com.google.showcase.v1beta1.EchoResponse.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { - } - } - @java.lang.Override - public Builder clear() { - super.clear(); - content_ = ""; - - severity_ = 0; - - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return com.google.showcase.v1beta1.EchoOuterClass.internal_static_google_showcase_v1beta1_EchoResponse_descriptor; - } - - @java.lang.Override - public com.google.showcase.v1beta1.EchoResponse getDefaultInstanceForType() { - return com.google.showcase.v1beta1.EchoResponse.getDefaultInstance(); - } - - @java.lang.Override - public com.google.showcase.v1beta1.EchoResponse build() { - com.google.showcase.v1beta1.EchoResponse result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.showcase.v1beta1.EchoResponse buildPartial() { - com.google.showcase.v1beta1.EchoResponse result = new com.google.showcase.v1beta1.EchoResponse(this); - result.content_ = content_; - result.severity_ = severity_; - 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.showcase.v1beta1.EchoResponse) { - return mergeFrom((com.google.showcase.v1beta1.EchoResponse)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.showcase.v1beta1.EchoResponse other) { - if (other == com.google.showcase.v1beta1.EchoResponse.getDefaultInstance()) return this; - if (!other.getContent().isEmpty()) { - content_ = other.content_; - onChanged(); - } - if (other.severity_ != 0) { - setSeverityValue(other.getSeverityValue()); - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - com.google.showcase.v1beta1.EchoResponse parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (com.google.showcase.v1beta1.EchoResponse) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private java.lang.Object content_ = ""; - /** - *
        -     * The content specified in the request.
        -     * 
        - * - * string content = 1; - * @return The content. - */ - public java.lang.String getContent() { - java.lang.Object ref = content_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - content_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - *
        -     * The content specified in the request.
        -     * 
        - * - * string content = 1; - * @return The bytes for content. - */ - public com.google.protobuf.ByteString - getContentBytes() { - java.lang.Object ref = content_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - content_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - *
        -     * The content specified in the request.
        -     * 
        - * - * string content = 1; - * @param value The content to set. - * @return This builder for chaining. - */ - public Builder setContent( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - content_ = value; - onChanged(); - return this; - } - /** - *
        -     * The content specified in the request.
        -     * 
        - * - * string content = 1; - * @return This builder for chaining. - */ - public Builder clearContent() { - - content_ = getDefaultInstance().getContent(); - onChanged(); - return this; - } - /** - *
        -     * The content specified in the request.
        -     * 
        - * - * string content = 1; - * @param value The bytes for content to set. - * @return This builder for chaining. - */ - public Builder setContentBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - content_ = value; - onChanged(); - return this; - } - - private int severity_ = 0; - /** - *
        -     * The severity specified in the request.
        -     * 
        - * - * .google.showcase.v1beta1.Severity severity = 2; - * @return The enum numeric value on the wire for severity. - */ - @java.lang.Override public int getSeverityValue() { - return severity_; - } - /** - *
        -     * The severity specified in the request.
        -     * 
        - * - * .google.showcase.v1beta1.Severity severity = 2; - * @param value The enum numeric value on the wire for severity to set. - * @return This builder for chaining. - */ - public Builder setSeverityValue(int value) { - - severity_ = value; - onChanged(); - return this; - } - /** - *
        -     * The severity specified in the request.
        -     * 
        - * - * .google.showcase.v1beta1.Severity severity = 2; - * @return The severity. - */ - @java.lang.Override - public com.google.showcase.v1beta1.Severity getSeverity() { - @SuppressWarnings("deprecation") - com.google.showcase.v1beta1.Severity result = com.google.showcase.v1beta1.Severity.valueOf(severity_); - return result == null ? com.google.showcase.v1beta1.Severity.UNRECOGNIZED : result; - } - /** - *
        -     * The severity specified in the request.
        -     * 
        - * - * .google.showcase.v1beta1.Severity severity = 2; - * @param value The severity to set. - * @return This builder for chaining. - */ - public Builder setSeverity(com.google.showcase.v1beta1.Severity value) { - if (value == null) { - throw new NullPointerException(); - } - - severity_ = value.getNumber(); - onChanged(); - return this; - } - /** - *
        -     * The severity specified in the request.
        -     * 
        - * - * .google.showcase.v1beta1.Severity severity = 2; - * @return This builder for chaining. - */ - public Builder clearSeverity() { - - severity_ = 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.showcase.v1beta1.EchoResponse) - } - - // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.EchoResponse) - private static final com.google.showcase.v1beta1.EchoResponse DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new com.google.showcase.v1beta1.EchoResponse(); - } - - public static com.google.showcase.v1beta1.EchoResponse getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public EchoResponse parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new EchoResponse(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public com.google.showcase.v1beta1.EchoResponse getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/EchoResponseOrBuilder.java b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/EchoResponseOrBuilder.java deleted file mode 100644 index 5f4e56f2df..0000000000 --- a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/EchoResponseOrBuilder.java +++ /dev/null @@ -1,48 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: schema/google/showcase/v1beta1/echo.proto - -package com.google.showcase.v1beta1; - -public interface EchoResponseOrBuilder extends - // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.EchoResponse) - com.google.protobuf.MessageOrBuilder { - - /** - *
        -   * The content specified in the request.
        -   * 
        - * - * string content = 1; - * @return The content. - */ - java.lang.String getContent(); - /** - *
        -   * The content specified in the request.
        -   * 
        - * - * string content = 1; - * @return The bytes for content. - */ - com.google.protobuf.ByteString - getContentBytes(); - - /** - *
        -   * The severity specified in the request.
        -   * 
        - * - * .google.showcase.v1beta1.Severity severity = 2; - * @return The enum numeric value on the wire for severity. - */ - int getSeverityValue(); - /** - *
        -   * The severity specified in the request.
        -   * 
        - * - * .google.showcase.v1beta1.Severity severity = 2; - * @return The severity. - */ - com.google.showcase.v1beta1.Severity getSeverity(); -} diff --git a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/EnumRequest.java b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/EnumRequest.java deleted file mode 100644 index a24e5e4b9a..0000000000 --- a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/EnumRequest.java +++ /dev/null @@ -1,502 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: schema/google/showcase/v1beta1/compliance.proto - -package com.google.showcase.v1beta1; - -/** - * Protobuf type {@code google.showcase.v1beta1.EnumRequest} - */ -public final class EnumRequest extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.EnumRequest) - EnumRequestOrBuilder { -private static final long serialVersionUID = 0L; - // Use EnumRequest.newBuilder() to construct. - private EnumRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private EnumRequest() { - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new EnumRequest(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private EnumRequest( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 8: { - - unknownEnum_ = input.readBool(); - break; - } - default: { - if (!parseUnknownField( - input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException( - e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.google.showcase.v1beta1.ComplianceOuterClass.internal_static_google_showcase_v1beta1_EnumRequest_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.showcase.v1beta1.ComplianceOuterClass.internal_static_google_showcase_v1beta1_EnumRequest_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.showcase.v1beta1.EnumRequest.class, com.google.showcase.v1beta1.EnumRequest.Builder.class); - } - - public static final int UNKNOWN_ENUM_FIELD_NUMBER = 1; - private boolean unknownEnum_; - /** - *
        -   * Whether the client is requesting a new, unknown enum value or a known enum value already declard in this proto file.
        -   * 
        - * - * bool unknown_enum = 1; - * @return The unknownEnum. - */ - @java.lang.Override - public boolean getUnknownEnum() { - return unknownEnum_; - } - - 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 (unknownEnum_ != false) { - output.writeBool(1, unknownEnum_); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (unknownEnum_ != false) { - size += com.google.protobuf.CodedOutputStream - .computeBoolSize(1, unknownEnum_); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof com.google.showcase.v1beta1.EnumRequest)) { - return super.equals(obj); - } - com.google.showcase.v1beta1.EnumRequest other = (com.google.showcase.v1beta1.EnumRequest) obj; - - if (getUnknownEnum() - != other.getUnknownEnum()) return false; - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - hash = (37 * hash) + UNKNOWN_ENUM_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( - getUnknownEnum()); - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.showcase.v1beta1.EnumRequest parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.showcase.v1beta1.EnumRequest parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.showcase.v1beta1.EnumRequest parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.showcase.v1beta1.EnumRequest 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.showcase.v1beta1.EnumRequest parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.showcase.v1beta1.EnumRequest parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.showcase.v1beta1.EnumRequest parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static com.google.showcase.v1beta1.EnumRequest 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.showcase.v1beta1.EnumRequest parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static com.google.showcase.v1beta1.EnumRequest 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.showcase.v1beta1.EnumRequest parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static com.google.showcase.v1beta1.EnumRequest 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.showcase.v1beta1.EnumRequest prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - @java.lang.Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - * Protobuf type {@code google.showcase.v1beta1.EnumRequest} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.EnumRequest) - com.google.showcase.v1beta1.EnumRequestOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.google.showcase.v1beta1.ComplianceOuterClass.internal_static_google_showcase_v1beta1_EnumRequest_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.showcase.v1beta1.ComplianceOuterClass.internal_static_google_showcase_v1beta1_EnumRequest_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.showcase.v1beta1.EnumRequest.class, com.google.showcase.v1beta1.EnumRequest.Builder.class); - } - - // Construct using com.google.showcase.v1beta1.EnumRequest.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { - } - } - @java.lang.Override - public Builder clear() { - super.clear(); - unknownEnum_ = false; - - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return com.google.showcase.v1beta1.ComplianceOuterClass.internal_static_google_showcase_v1beta1_EnumRequest_descriptor; - } - - @java.lang.Override - public com.google.showcase.v1beta1.EnumRequest getDefaultInstanceForType() { - return com.google.showcase.v1beta1.EnumRequest.getDefaultInstance(); - } - - @java.lang.Override - public com.google.showcase.v1beta1.EnumRequest build() { - com.google.showcase.v1beta1.EnumRequest result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.showcase.v1beta1.EnumRequest buildPartial() { - com.google.showcase.v1beta1.EnumRequest result = new com.google.showcase.v1beta1.EnumRequest(this); - result.unknownEnum_ = unknownEnum_; - 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.showcase.v1beta1.EnumRequest) { - return mergeFrom((com.google.showcase.v1beta1.EnumRequest)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.showcase.v1beta1.EnumRequest other) { - if (other == com.google.showcase.v1beta1.EnumRequest.getDefaultInstance()) return this; - if (other.getUnknownEnum() != false) { - setUnknownEnum(other.getUnknownEnum()); - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - com.google.showcase.v1beta1.EnumRequest parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (com.google.showcase.v1beta1.EnumRequest) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private boolean unknownEnum_ ; - /** - *
        -     * Whether the client is requesting a new, unknown enum value or a known enum value already declard in this proto file.
        -     * 
        - * - * bool unknown_enum = 1; - * @return The unknownEnum. - */ - @java.lang.Override - public boolean getUnknownEnum() { - return unknownEnum_; - } - /** - *
        -     * Whether the client is requesting a new, unknown enum value or a known enum value already declard in this proto file.
        -     * 
        - * - * bool unknown_enum = 1; - * @param value The unknownEnum to set. - * @return This builder for chaining. - */ - public Builder setUnknownEnum(boolean value) { - - unknownEnum_ = value; - onChanged(); - return this; - } - /** - *
        -     * Whether the client is requesting a new, unknown enum value or a known enum value already declard in this proto file.
        -     * 
        - * - * bool unknown_enum = 1; - * @return This builder for chaining. - */ - public Builder clearUnknownEnum() { - - unknownEnum_ = 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.showcase.v1beta1.EnumRequest) - } - - // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.EnumRequest) - private static final com.google.showcase.v1beta1.EnumRequest DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new com.google.showcase.v1beta1.EnumRequest(); - } - - public static com.google.showcase.v1beta1.EnumRequest getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public EnumRequest parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new EnumRequest(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public com.google.showcase.v1beta1.EnumRequest getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/EnumRequestOrBuilder.java b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/EnumRequestOrBuilder.java deleted file mode 100644 index 2b83d2ac25..0000000000 --- a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/EnumRequestOrBuilder.java +++ /dev/null @@ -1,19 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: schema/google/showcase/v1beta1/compliance.proto - -package com.google.showcase.v1beta1; - -public interface EnumRequestOrBuilder extends - // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.EnumRequest) - com.google.protobuf.MessageOrBuilder { - - /** - *
        -   * Whether the client is requesting a new, unknown enum value or a known enum value already declard in this proto file.
        -   * 
        - * - * bool unknown_enum = 1; - * @return The unknownEnum. - */ - boolean getUnknownEnum(); -} diff --git a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/EnumResponse.java b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/EnumResponse.java deleted file mode 100644 index d3908f7a0b..0000000000 --- a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/EnumResponse.java +++ /dev/null @@ -1,781 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: schema/google/showcase/v1beta1/compliance.proto - -package com.google.showcase.v1beta1; - -/** - * Protobuf type {@code google.showcase.v1beta1.EnumResponse} - */ -public final class EnumResponse extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.EnumResponse) - EnumResponseOrBuilder { -private static final long serialVersionUID = 0L; - // Use EnumResponse.newBuilder() to construct. - private EnumResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private EnumResponse() { - continent_ = 0; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new EnumResponse(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private EnumResponse( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: { - com.google.showcase.v1beta1.EnumRequest.Builder subBuilder = null; - if (request_ != null) { - subBuilder = request_.toBuilder(); - } - request_ = input.readMessage(com.google.showcase.v1beta1.EnumRequest.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(request_); - request_ = subBuilder.buildPartial(); - } - - break; - } - case 16: { - int rawValue = input.readEnum(); - - continent_ = rawValue; - break; - } - default: { - if (!parseUnknownField( - input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException( - e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.google.showcase.v1beta1.ComplianceOuterClass.internal_static_google_showcase_v1beta1_EnumResponse_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.showcase.v1beta1.ComplianceOuterClass.internal_static_google_showcase_v1beta1_EnumResponse_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.showcase.v1beta1.EnumResponse.class, com.google.showcase.v1beta1.EnumResponse.Builder.class); - } - - public static final int REQUEST_FIELD_NUMBER = 1; - private com.google.showcase.v1beta1.EnumRequest request_; - /** - *
        -   * The original request for a known or unknown enum from the server.
        -   * 
        - * - * .google.showcase.v1beta1.EnumRequest request = 1; - * @return Whether the request field is set. - */ - @java.lang.Override - public boolean hasRequest() { - return request_ != null; - } - /** - *
        -   * The original request for a known or unknown enum from the server.
        -   * 
        - * - * .google.showcase.v1beta1.EnumRequest request = 1; - * @return The request. - */ - @java.lang.Override - public com.google.showcase.v1beta1.EnumRequest getRequest() { - return request_ == null ? com.google.showcase.v1beta1.EnumRequest.getDefaultInstance() : request_; - } - /** - *
        -   * The original request for a known or unknown enum from the server.
        -   * 
        - * - * .google.showcase.v1beta1.EnumRequest request = 1; - */ - @java.lang.Override - public com.google.showcase.v1beta1.EnumRequestOrBuilder getRequestOrBuilder() { - return getRequest(); - } - - public static final int CONTINENT_FIELD_NUMBER = 2; - private int continent_; - /** - *
        -   * The actual enum the server provided.
        -   * 
        - * - * .google.showcase.v1beta1.Continent continent = 2; - * @return The enum numeric value on the wire for continent. - */ - @java.lang.Override public int getContinentValue() { - return continent_; - } - /** - *
        -   * The actual enum the server provided.
        -   * 
        - * - * .google.showcase.v1beta1.Continent continent = 2; - * @return The continent. - */ - @java.lang.Override public com.google.showcase.v1beta1.Continent getContinent() { - @SuppressWarnings("deprecation") - com.google.showcase.v1beta1.Continent result = com.google.showcase.v1beta1.Continent.valueOf(continent_); - return result == null ? com.google.showcase.v1beta1.Continent.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 (request_ != null) { - output.writeMessage(1, getRequest()); - } - if (continent_ != com.google.showcase.v1beta1.Continent.CONTINENT_UNSPECIFIED.getNumber()) { - output.writeEnum(2, continent_); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (request_ != null) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(1, getRequest()); - } - if (continent_ != com.google.showcase.v1beta1.Continent.CONTINENT_UNSPECIFIED.getNumber()) { - size += com.google.protobuf.CodedOutputStream - .computeEnumSize(2, continent_); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof com.google.showcase.v1beta1.EnumResponse)) { - return super.equals(obj); - } - com.google.showcase.v1beta1.EnumResponse other = (com.google.showcase.v1beta1.EnumResponse) obj; - - if (hasRequest() != other.hasRequest()) return false; - if (hasRequest()) { - if (!getRequest() - .equals(other.getRequest())) return false; - } - if (continent_ != other.continent_) return false; - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - if (hasRequest()) { - hash = (37 * hash) + REQUEST_FIELD_NUMBER; - hash = (53 * hash) + getRequest().hashCode(); - } - hash = (37 * hash) + CONTINENT_FIELD_NUMBER; - hash = (53 * hash) + continent_; - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.showcase.v1beta1.EnumResponse parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.showcase.v1beta1.EnumResponse parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.showcase.v1beta1.EnumResponse parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.showcase.v1beta1.EnumResponse 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.showcase.v1beta1.EnumResponse parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.showcase.v1beta1.EnumResponse parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.showcase.v1beta1.EnumResponse parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static com.google.showcase.v1beta1.EnumResponse 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.showcase.v1beta1.EnumResponse parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static com.google.showcase.v1beta1.EnumResponse 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.showcase.v1beta1.EnumResponse parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static com.google.showcase.v1beta1.EnumResponse 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.showcase.v1beta1.EnumResponse prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - @java.lang.Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - * Protobuf type {@code google.showcase.v1beta1.EnumResponse} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.EnumResponse) - com.google.showcase.v1beta1.EnumResponseOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.google.showcase.v1beta1.ComplianceOuterClass.internal_static_google_showcase_v1beta1_EnumResponse_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.showcase.v1beta1.ComplianceOuterClass.internal_static_google_showcase_v1beta1_EnumResponse_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.showcase.v1beta1.EnumResponse.class, com.google.showcase.v1beta1.EnumResponse.Builder.class); - } - - // Construct using com.google.showcase.v1beta1.EnumResponse.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { - } - } - @java.lang.Override - public Builder clear() { - super.clear(); - if (requestBuilder_ == null) { - request_ = null; - } else { - request_ = null; - requestBuilder_ = null; - } - continent_ = 0; - - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return com.google.showcase.v1beta1.ComplianceOuterClass.internal_static_google_showcase_v1beta1_EnumResponse_descriptor; - } - - @java.lang.Override - public com.google.showcase.v1beta1.EnumResponse getDefaultInstanceForType() { - return com.google.showcase.v1beta1.EnumResponse.getDefaultInstance(); - } - - @java.lang.Override - public com.google.showcase.v1beta1.EnumResponse build() { - com.google.showcase.v1beta1.EnumResponse result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.showcase.v1beta1.EnumResponse buildPartial() { - com.google.showcase.v1beta1.EnumResponse result = new com.google.showcase.v1beta1.EnumResponse(this); - if (requestBuilder_ == null) { - result.request_ = request_; - } else { - result.request_ = requestBuilder_.build(); - } - result.continent_ = continent_; - 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.showcase.v1beta1.EnumResponse) { - return mergeFrom((com.google.showcase.v1beta1.EnumResponse)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.showcase.v1beta1.EnumResponse other) { - if (other == com.google.showcase.v1beta1.EnumResponse.getDefaultInstance()) return this; - if (other.hasRequest()) { - mergeRequest(other.getRequest()); - } - if (other.continent_ != 0) { - setContinentValue(other.getContinentValue()); - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - com.google.showcase.v1beta1.EnumResponse parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (com.google.showcase.v1beta1.EnumResponse) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private com.google.showcase.v1beta1.EnumRequest request_; - private com.google.protobuf.SingleFieldBuilderV3< - com.google.showcase.v1beta1.EnumRequest, com.google.showcase.v1beta1.EnumRequest.Builder, com.google.showcase.v1beta1.EnumRequestOrBuilder> requestBuilder_; - /** - *
        -     * The original request for a known or unknown enum from the server.
        -     * 
        - * - * .google.showcase.v1beta1.EnumRequest request = 1; - * @return Whether the request field is set. - */ - public boolean hasRequest() { - return requestBuilder_ != null || request_ != null; - } - /** - *
        -     * The original request for a known or unknown enum from the server.
        -     * 
        - * - * .google.showcase.v1beta1.EnumRequest request = 1; - * @return The request. - */ - public com.google.showcase.v1beta1.EnumRequest getRequest() { - if (requestBuilder_ == null) { - return request_ == null ? com.google.showcase.v1beta1.EnumRequest.getDefaultInstance() : request_; - } else { - return requestBuilder_.getMessage(); - } - } - /** - *
        -     * The original request for a known or unknown enum from the server.
        -     * 
        - * - * .google.showcase.v1beta1.EnumRequest request = 1; - */ - public Builder setRequest(com.google.showcase.v1beta1.EnumRequest value) { - if (requestBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - request_ = value; - onChanged(); - } else { - requestBuilder_.setMessage(value); - } - - return this; - } - /** - *
        -     * The original request for a known or unknown enum from the server.
        -     * 
        - * - * .google.showcase.v1beta1.EnumRequest request = 1; - */ - public Builder setRequest( - com.google.showcase.v1beta1.EnumRequest.Builder builderForValue) { - if (requestBuilder_ == null) { - request_ = builderForValue.build(); - onChanged(); - } else { - requestBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - *
        -     * The original request for a known or unknown enum from the server.
        -     * 
        - * - * .google.showcase.v1beta1.EnumRequest request = 1; - */ - public Builder mergeRequest(com.google.showcase.v1beta1.EnumRequest value) { - if (requestBuilder_ == null) { - if (request_ != null) { - request_ = - com.google.showcase.v1beta1.EnumRequest.newBuilder(request_).mergeFrom(value).buildPartial(); - } else { - request_ = value; - } - onChanged(); - } else { - requestBuilder_.mergeFrom(value); - } - - return this; - } - /** - *
        -     * The original request for a known or unknown enum from the server.
        -     * 
        - * - * .google.showcase.v1beta1.EnumRequest request = 1; - */ - public Builder clearRequest() { - if (requestBuilder_ == null) { - request_ = null; - onChanged(); - } else { - request_ = null; - requestBuilder_ = null; - } - - return this; - } - /** - *
        -     * The original request for a known or unknown enum from the server.
        -     * 
        - * - * .google.showcase.v1beta1.EnumRequest request = 1; - */ - public com.google.showcase.v1beta1.EnumRequest.Builder getRequestBuilder() { - - onChanged(); - return getRequestFieldBuilder().getBuilder(); - } - /** - *
        -     * The original request for a known or unknown enum from the server.
        -     * 
        - * - * .google.showcase.v1beta1.EnumRequest request = 1; - */ - public com.google.showcase.v1beta1.EnumRequestOrBuilder getRequestOrBuilder() { - if (requestBuilder_ != null) { - return requestBuilder_.getMessageOrBuilder(); - } else { - return request_ == null ? - com.google.showcase.v1beta1.EnumRequest.getDefaultInstance() : request_; - } - } - /** - *
        -     * The original request for a known or unknown enum from the server.
        -     * 
        - * - * .google.showcase.v1beta1.EnumRequest request = 1; - */ - private com.google.protobuf.SingleFieldBuilderV3< - com.google.showcase.v1beta1.EnumRequest, com.google.showcase.v1beta1.EnumRequest.Builder, com.google.showcase.v1beta1.EnumRequestOrBuilder> - getRequestFieldBuilder() { - if (requestBuilder_ == null) { - requestBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - com.google.showcase.v1beta1.EnumRequest, com.google.showcase.v1beta1.EnumRequest.Builder, com.google.showcase.v1beta1.EnumRequestOrBuilder>( - getRequest(), - getParentForChildren(), - isClean()); - request_ = null; - } - return requestBuilder_; - } - - private int continent_ = 0; - /** - *
        -     * The actual enum the server provided.
        -     * 
        - * - * .google.showcase.v1beta1.Continent continent = 2; - * @return The enum numeric value on the wire for continent. - */ - @java.lang.Override public int getContinentValue() { - return continent_; - } - /** - *
        -     * The actual enum the server provided.
        -     * 
        - * - * .google.showcase.v1beta1.Continent continent = 2; - * @param value The enum numeric value on the wire for continent to set. - * @return This builder for chaining. - */ - public Builder setContinentValue(int value) { - - continent_ = value; - onChanged(); - return this; - } - /** - *
        -     * The actual enum the server provided.
        -     * 
        - * - * .google.showcase.v1beta1.Continent continent = 2; - * @return The continent. - */ - @java.lang.Override - public com.google.showcase.v1beta1.Continent getContinent() { - @SuppressWarnings("deprecation") - com.google.showcase.v1beta1.Continent result = com.google.showcase.v1beta1.Continent.valueOf(continent_); - return result == null ? com.google.showcase.v1beta1.Continent.UNRECOGNIZED : result; - } - /** - *
        -     * The actual enum the server provided.
        -     * 
        - * - * .google.showcase.v1beta1.Continent continent = 2; - * @param value The continent to set. - * @return This builder for chaining. - */ - public Builder setContinent(com.google.showcase.v1beta1.Continent value) { - if (value == null) { - throw new NullPointerException(); - } - - continent_ = value.getNumber(); - onChanged(); - return this; - } - /** - *
        -     * The actual enum the server provided.
        -     * 
        - * - * .google.showcase.v1beta1.Continent continent = 2; - * @return This builder for chaining. - */ - public Builder clearContinent() { - - continent_ = 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.showcase.v1beta1.EnumResponse) - } - - // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.EnumResponse) - private static final com.google.showcase.v1beta1.EnumResponse DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new com.google.showcase.v1beta1.EnumResponse(); - } - - public static com.google.showcase.v1beta1.EnumResponse getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public EnumResponse parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new EnumResponse(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public com.google.showcase.v1beta1.EnumResponse getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/EnumResponseOrBuilder.java b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/EnumResponseOrBuilder.java deleted file mode 100644 index d202a6d4e6..0000000000 --- a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/EnumResponseOrBuilder.java +++ /dev/null @@ -1,55 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: schema/google/showcase/v1beta1/compliance.proto - -package com.google.showcase.v1beta1; - -public interface EnumResponseOrBuilder extends - // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.EnumResponse) - com.google.protobuf.MessageOrBuilder { - - /** - *
        -   * The original request for a known or unknown enum from the server.
        -   * 
        - * - * .google.showcase.v1beta1.EnumRequest request = 1; - * @return Whether the request field is set. - */ - boolean hasRequest(); - /** - *
        -   * The original request for a known or unknown enum from the server.
        -   * 
        - * - * .google.showcase.v1beta1.EnumRequest request = 1; - * @return The request. - */ - com.google.showcase.v1beta1.EnumRequest getRequest(); - /** - *
        -   * The original request for a known or unknown enum from the server.
        -   * 
        - * - * .google.showcase.v1beta1.EnumRequest request = 1; - */ - com.google.showcase.v1beta1.EnumRequestOrBuilder getRequestOrBuilder(); - - /** - *
        -   * The actual enum the server provided.
        -   * 
        - * - * .google.showcase.v1beta1.Continent continent = 2; - * @return The enum numeric value on the wire for continent. - */ - int getContinentValue(); - /** - *
        -   * The actual enum the server provided.
        -   * 
        - * - * .google.showcase.v1beta1.Continent continent = 2; - * @return The continent. - */ - com.google.showcase.v1beta1.Continent getContinent(); -} diff --git a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ExpandRequest.java b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ExpandRequest.java deleted file mode 100644 index 0ced33e1c2..0000000000 --- a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ExpandRequest.java +++ /dev/null @@ -1,831 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: schema/google/showcase/v1beta1/echo.proto - -package com.google.showcase.v1beta1; - -/** - *
        - * The request message for the Expand method.
        - * 
        - * - * Protobuf type {@code google.showcase.v1beta1.ExpandRequest} - */ -public final class ExpandRequest extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.ExpandRequest) - ExpandRequestOrBuilder { -private static final long serialVersionUID = 0L; - // Use ExpandRequest.newBuilder() to construct. - private ExpandRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private ExpandRequest() { - content_ = ""; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new ExpandRequest(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private ExpandRequest( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: { - java.lang.String s = input.readStringRequireUtf8(); - - content_ = s; - break; - } - case 18: { - com.google.rpc.Status.Builder subBuilder = null; - if (error_ != null) { - subBuilder = error_.toBuilder(); - } - error_ = input.readMessage(com.google.rpc.Status.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(error_); - error_ = subBuilder.buildPartial(); - } - - break; - } - default: { - if (!parseUnknownField( - input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException( - e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.google.showcase.v1beta1.EchoOuterClass.internal_static_google_showcase_v1beta1_ExpandRequest_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.showcase.v1beta1.EchoOuterClass.internal_static_google_showcase_v1beta1_ExpandRequest_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.showcase.v1beta1.ExpandRequest.class, com.google.showcase.v1beta1.ExpandRequest.Builder.class); - } - - public static final int CONTENT_FIELD_NUMBER = 1; - private volatile java.lang.Object content_; - /** - *
        -   * The content that will be split into words and returned on the stream.
        -   * 
        - * - * string content = 1; - * @return The content. - */ - @java.lang.Override - public java.lang.String getContent() { - java.lang.Object ref = content_; - 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(); - content_ = s; - return s; - } - } - /** - *
        -   * The content that will be split into words and returned on the stream.
        -   * 
        - * - * string content = 1; - * @return The bytes for content. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getContentBytes() { - java.lang.Object ref = content_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - content_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int ERROR_FIELD_NUMBER = 2; - private com.google.rpc.Status error_; - /** - *
        -   * The error that is thrown after all words are sent on the stream.
        -   * 
        - * - * .google.rpc.Status error = 2; - * @return Whether the error field is set. - */ - @java.lang.Override - public boolean hasError() { - return error_ != null; - } - /** - *
        -   * The error that is thrown after all words are sent on the stream.
        -   * 
        - * - * .google.rpc.Status error = 2; - * @return The error. - */ - @java.lang.Override - public com.google.rpc.Status getError() { - return error_ == null ? com.google.rpc.Status.getDefaultInstance() : error_; - } - /** - *
        -   * The error that is thrown after all words are sent on the stream.
        -   * 
        - * - * .google.rpc.Status error = 2; - */ - @java.lang.Override - public com.google.rpc.StatusOrBuilder getErrorOrBuilder() { - return getError(); - } - - 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(content_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, content_); - } - if (error_ != null) { - output.writeMessage(2, getError()); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(content_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, content_); - } - if (error_ != null) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(2, getError()); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof com.google.showcase.v1beta1.ExpandRequest)) { - return super.equals(obj); - } - com.google.showcase.v1beta1.ExpandRequest other = (com.google.showcase.v1beta1.ExpandRequest) obj; - - if (!getContent() - .equals(other.getContent())) return false; - if (hasError() != other.hasError()) return false; - if (hasError()) { - if (!getError() - .equals(other.getError())) return false; - } - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - hash = (37 * hash) + CONTENT_FIELD_NUMBER; - hash = (53 * hash) + getContent().hashCode(); - if (hasError()) { - hash = (37 * hash) + ERROR_FIELD_NUMBER; - hash = (53 * hash) + getError().hashCode(); - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.showcase.v1beta1.ExpandRequest parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.showcase.v1beta1.ExpandRequest parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.showcase.v1beta1.ExpandRequest parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.showcase.v1beta1.ExpandRequest 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.showcase.v1beta1.ExpandRequest parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.showcase.v1beta1.ExpandRequest parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.showcase.v1beta1.ExpandRequest parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static com.google.showcase.v1beta1.ExpandRequest 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.showcase.v1beta1.ExpandRequest parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static com.google.showcase.v1beta1.ExpandRequest 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.showcase.v1beta1.ExpandRequest parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static com.google.showcase.v1beta1.ExpandRequest 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.showcase.v1beta1.ExpandRequest 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 request message for the Expand method.
        -   * 
        - * - * Protobuf type {@code google.showcase.v1beta1.ExpandRequest} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.ExpandRequest) - com.google.showcase.v1beta1.ExpandRequestOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.google.showcase.v1beta1.EchoOuterClass.internal_static_google_showcase_v1beta1_ExpandRequest_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.showcase.v1beta1.EchoOuterClass.internal_static_google_showcase_v1beta1_ExpandRequest_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.showcase.v1beta1.ExpandRequest.class, com.google.showcase.v1beta1.ExpandRequest.Builder.class); - } - - // Construct using com.google.showcase.v1beta1.ExpandRequest.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { - } - } - @java.lang.Override - public Builder clear() { - super.clear(); - content_ = ""; - - if (errorBuilder_ == null) { - error_ = null; - } else { - error_ = null; - errorBuilder_ = null; - } - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return com.google.showcase.v1beta1.EchoOuterClass.internal_static_google_showcase_v1beta1_ExpandRequest_descriptor; - } - - @java.lang.Override - public com.google.showcase.v1beta1.ExpandRequest getDefaultInstanceForType() { - return com.google.showcase.v1beta1.ExpandRequest.getDefaultInstance(); - } - - @java.lang.Override - public com.google.showcase.v1beta1.ExpandRequest build() { - com.google.showcase.v1beta1.ExpandRequest result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.showcase.v1beta1.ExpandRequest buildPartial() { - com.google.showcase.v1beta1.ExpandRequest result = new com.google.showcase.v1beta1.ExpandRequest(this); - result.content_ = content_; - if (errorBuilder_ == null) { - result.error_ = error_; - } else { - result.error_ = errorBuilder_.build(); - } - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.setField(field, value); - } - @java.lang.Override - public Builder clearField( - com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - @java.lang.Override - public Builder clearOneof( - com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.addRepeatedField(field, value); - } - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof com.google.showcase.v1beta1.ExpandRequest) { - return mergeFrom((com.google.showcase.v1beta1.ExpandRequest)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.showcase.v1beta1.ExpandRequest other) { - if (other == com.google.showcase.v1beta1.ExpandRequest.getDefaultInstance()) return this; - if (!other.getContent().isEmpty()) { - content_ = other.content_; - onChanged(); - } - if (other.hasError()) { - mergeError(other.getError()); - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - com.google.showcase.v1beta1.ExpandRequest parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (com.google.showcase.v1beta1.ExpandRequest) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private java.lang.Object content_ = ""; - /** - *
        -     * The content that will be split into words and returned on the stream.
        -     * 
        - * - * string content = 1; - * @return The content. - */ - public java.lang.String getContent() { - java.lang.Object ref = content_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - content_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - *
        -     * The content that will be split into words and returned on the stream.
        -     * 
        - * - * string content = 1; - * @return The bytes for content. - */ - public com.google.protobuf.ByteString - getContentBytes() { - java.lang.Object ref = content_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - content_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - *
        -     * The content that will be split into words and returned on the stream.
        -     * 
        - * - * string content = 1; - * @param value The content to set. - * @return This builder for chaining. - */ - public Builder setContent( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - content_ = value; - onChanged(); - return this; - } - /** - *
        -     * The content that will be split into words and returned on the stream.
        -     * 
        - * - * string content = 1; - * @return This builder for chaining. - */ - public Builder clearContent() { - - content_ = getDefaultInstance().getContent(); - onChanged(); - return this; - } - /** - *
        -     * The content that will be split into words and returned on the stream.
        -     * 
        - * - * string content = 1; - * @param value The bytes for content to set. - * @return This builder for chaining. - */ - public Builder setContentBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - content_ = value; - onChanged(); - return this; - } - - private com.google.rpc.Status error_; - private com.google.protobuf.SingleFieldBuilderV3< - com.google.rpc.Status, com.google.rpc.Status.Builder, com.google.rpc.StatusOrBuilder> errorBuilder_; - /** - *
        -     * The error that is thrown after all words are sent on the stream.
        -     * 
        - * - * .google.rpc.Status error = 2; - * @return Whether the error field is set. - */ - public boolean hasError() { - return errorBuilder_ != null || error_ != null; - } - /** - *
        -     * The error that is thrown after all words are sent on the stream.
        -     * 
        - * - * .google.rpc.Status error = 2; - * @return The error. - */ - public com.google.rpc.Status getError() { - if (errorBuilder_ == null) { - return error_ == null ? com.google.rpc.Status.getDefaultInstance() : error_; - } else { - return errorBuilder_.getMessage(); - } - } - /** - *
        -     * The error that is thrown after all words are sent on the stream.
        -     * 
        - * - * .google.rpc.Status error = 2; - */ - public Builder setError(com.google.rpc.Status value) { - if (errorBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - error_ = value; - onChanged(); - } else { - errorBuilder_.setMessage(value); - } - - return this; - } - /** - *
        -     * The error that is thrown after all words are sent on the stream.
        -     * 
        - * - * .google.rpc.Status error = 2; - */ - public Builder setError( - com.google.rpc.Status.Builder builderForValue) { - if (errorBuilder_ == null) { - error_ = builderForValue.build(); - onChanged(); - } else { - errorBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - *
        -     * The error that is thrown after all words are sent on the stream.
        -     * 
        - * - * .google.rpc.Status error = 2; - */ - public Builder mergeError(com.google.rpc.Status value) { - if (errorBuilder_ == null) { - if (error_ != null) { - error_ = - com.google.rpc.Status.newBuilder(error_).mergeFrom(value).buildPartial(); - } else { - error_ = value; - } - onChanged(); - } else { - errorBuilder_.mergeFrom(value); - } - - return this; - } - /** - *
        -     * The error that is thrown after all words are sent on the stream.
        -     * 
        - * - * .google.rpc.Status error = 2; - */ - public Builder clearError() { - if (errorBuilder_ == null) { - error_ = null; - onChanged(); - } else { - error_ = null; - errorBuilder_ = null; - } - - return this; - } - /** - *
        -     * The error that is thrown after all words are sent on the stream.
        -     * 
        - * - * .google.rpc.Status error = 2; - */ - public com.google.rpc.Status.Builder getErrorBuilder() { - - onChanged(); - return getErrorFieldBuilder().getBuilder(); - } - /** - *
        -     * The error that is thrown after all words are sent on the stream.
        -     * 
        - * - * .google.rpc.Status error = 2; - */ - public com.google.rpc.StatusOrBuilder getErrorOrBuilder() { - if (errorBuilder_ != null) { - return errorBuilder_.getMessageOrBuilder(); - } else { - return error_ == null ? - com.google.rpc.Status.getDefaultInstance() : error_; - } - } - /** - *
        -     * The error that is thrown after all words are sent on the stream.
        -     * 
        - * - * .google.rpc.Status error = 2; - */ - private com.google.protobuf.SingleFieldBuilderV3< - com.google.rpc.Status, com.google.rpc.Status.Builder, com.google.rpc.StatusOrBuilder> - getErrorFieldBuilder() { - if (errorBuilder_ == null) { - errorBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - com.google.rpc.Status, com.google.rpc.Status.Builder, com.google.rpc.StatusOrBuilder>( - getError(), - getParentForChildren(), - isClean()); - error_ = null; - } - return errorBuilder_; - } - @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.showcase.v1beta1.ExpandRequest) - } - - // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.ExpandRequest) - private static final com.google.showcase.v1beta1.ExpandRequest DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new com.google.showcase.v1beta1.ExpandRequest(); - } - - public static com.google.showcase.v1beta1.ExpandRequest getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public ExpandRequest parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new ExpandRequest(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public com.google.showcase.v1beta1.ExpandRequest getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ExpandRequestOrBuilder.java b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ExpandRequestOrBuilder.java deleted file mode 100644 index 3286ec98c7..0000000000 --- a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ExpandRequestOrBuilder.java +++ /dev/null @@ -1,56 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: schema/google/showcase/v1beta1/echo.proto - -package com.google.showcase.v1beta1; - -public interface ExpandRequestOrBuilder extends - // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.ExpandRequest) - com.google.protobuf.MessageOrBuilder { - - /** - *
        -   * The content that will be split into words and returned on the stream.
        -   * 
        - * - * string content = 1; - * @return The content. - */ - java.lang.String getContent(); - /** - *
        -   * The content that will be split into words and returned on the stream.
        -   * 
        - * - * string content = 1; - * @return The bytes for content. - */ - com.google.protobuf.ByteString - getContentBytes(); - - /** - *
        -   * The error that is thrown after all words are sent on the stream.
        -   * 
        - * - * .google.rpc.Status error = 2; - * @return Whether the error field is set. - */ - boolean hasError(); - /** - *
        -   * The error that is thrown after all words are sent on the stream.
        -   * 
        - * - * .google.rpc.Status error = 2; - * @return The error. - */ - com.google.rpc.Status getError(); - /** - *
        -   * The error that is thrown after all words are sent on the stream.
        -   * 
        - * - * .google.rpc.Status error = 2; - */ - com.google.rpc.StatusOrBuilder getErrorOrBuilder(); -} diff --git a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/GetBlurbRequest.java b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/GetBlurbRequest.java deleted file mode 100644 index 0080047610..0000000000 --- a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/GetBlurbRequest.java +++ /dev/null @@ -1,597 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: schema/google/showcase/v1beta1/messaging.proto - -package com.google.showcase.v1beta1; - -/** - *
        - * The request message for the google.showcase.v1beta1.Messaging\GetBlurb
        - * method.
        - * 
        - * - * Protobuf type {@code google.showcase.v1beta1.GetBlurbRequest} - */ -public final class GetBlurbRequest extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.GetBlurbRequest) - GetBlurbRequestOrBuilder { -private static final long serialVersionUID = 0L; - // Use GetBlurbRequest.newBuilder() to construct. - private GetBlurbRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private GetBlurbRequest() { - name_ = ""; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new GetBlurbRequest(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private GetBlurbRequest( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: { - java.lang.String s = input.readStringRequireUtf8(); - - name_ = s; - break; - } - default: { - if (!parseUnknownField( - input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException( - e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.google.showcase.v1beta1.MessagingOuterClass.internal_static_google_showcase_v1beta1_GetBlurbRequest_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.showcase.v1beta1.MessagingOuterClass.internal_static_google_showcase_v1beta1_GetBlurbRequest_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.showcase.v1beta1.GetBlurbRequest.class, com.google.showcase.v1beta1.GetBlurbRequest.Builder.class); - } - - public static final int NAME_FIELD_NUMBER = 1; - private volatile java.lang.Object name_; - /** - *
        -   * The resource name of the requested blurb.
        -   * 
        - * - * 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; - } - } - /** - *
        -   * The resource name of the requested blurb.
        -   * 
        - * - * 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_); - } - unknownFields.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 += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof com.google.showcase.v1beta1.GetBlurbRequest)) { - return super.equals(obj); - } - com.google.showcase.v1beta1.GetBlurbRequest other = (com.google.showcase.v1beta1.GetBlurbRequest) obj; - - if (!getName() - .equals(other.getName())) return false; - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - hash = (37 * hash) + NAME_FIELD_NUMBER; - hash = (53 * hash) + getName().hashCode(); - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.showcase.v1beta1.GetBlurbRequest parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.showcase.v1beta1.GetBlurbRequest parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.showcase.v1beta1.GetBlurbRequest parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.showcase.v1beta1.GetBlurbRequest 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.showcase.v1beta1.GetBlurbRequest parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.showcase.v1beta1.GetBlurbRequest parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.showcase.v1beta1.GetBlurbRequest parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static com.google.showcase.v1beta1.GetBlurbRequest 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.showcase.v1beta1.GetBlurbRequest parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static com.google.showcase.v1beta1.GetBlurbRequest 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.showcase.v1beta1.GetBlurbRequest parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static com.google.showcase.v1beta1.GetBlurbRequest 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.showcase.v1beta1.GetBlurbRequest 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 request message for the google.showcase.v1beta1.Messaging\GetBlurb
        -   * method.
        -   * 
        - * - * Protobuf type {@code google.showcase.v1beta1.GetBlurbRequest} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.GetBlurbRequest) - com.google.showcase.v1beta1.GetBlurbRequestOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.google.showcase.v1beta1.MessagingOuterClass.internal_static_google_showcase_v1beta1_GetBlurbRequest_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.showcase.v1beta1.MessagingOuterClass.internal_static_google_showcase_v1beta1_GetBlurbRequest_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.showcase.v1beta1.GetBlurbRequest.class, com.google.showcase.v1beta1.GetBlurbRequest.Builder.class); - } - - // Construct using com.google.showcase.v1beta1.GetBlurbRequest.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { - } - } - @java.lang.Override - public Builder clear() { - super.clear(); - name_ = ""; - - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return com.google.showcase.v1beta1.MessagingOuterClass.internal_static_google_showcase_v1beta1_GetBlurbRequest_descriptor; - } - - @java.lang.Override - public com.google.showcase.v1beta1.GetBlurbRequest getDefaultInstanceForType() { - return com.google.showcase.v1beta1.GetBlurbRequest.getDefaultInstance(); - } - - @java.lang.Override - public com.google.showcase.v1beta1.GetBlurbRequest build() { - com.google.showcase.v1beta1.GetBlurbRequest result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.showcase.v1beta1.GetBlurbRequest buildPartial() { - com.google.showcase.v1beta1.GetBlurbRequest result = new com.google.showcase.v1beta1.GetBlurbRequest(this); - result.name_ = name_; - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.setField(field, value); - } - @java.lang.Override - public Builder clearField( - com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - @java.lang.Override - public Builder clearOneof( - com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.addRepeatedField(field, value); - } - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof com.google.showcase.v1beta1.GetBlurbRequest) { - return mergeFrom((com.google.showcase.v1beta1.GetBlurbRequest)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.showcase.v1beta1.GetBlurbRequest other) { - if (other == com.google.showcase.v1beta1.GetBlurbRequest.getDefaultInstance()) return this; - if (!other.getName().isEmpty()) { - name_ = other.name_; - onChanged(); - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - com.google.showcase.v1beta1.GetBlurbRequest parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (com.google.showcase.v1beta1.GetBlurbRequest) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private java.lang.Object name_ = ""; - /** - *
        -     * The resource name of the requested blurb.
        -     * 
        - * - * 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; - } - } - /** - *
        -     * The resource name of the requested blurb.
        -     * 
        - * - * 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; - } - } - /** - *
        -     * The resource name of the requested blurb.
        -     * 
        - * - * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * @param value The name to set. - * @return This builder for chaining. - */ - public Builder setName( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - name_ = value; - onChanged(); - return this; - } - /** - *
        -     * The resource name of the requested blurb.
        -     * 
        - * - * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * @return This builder for chaining. - */ - public Builder clearName() { - - name_ = getDefaultInstance().getName(); - onChanged(); - return this; - } - /** - *
        -     * The resource name of the requested blurb.
        -     * 
        - * - * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * @param value The bytes for name to set. - * @return This builder for chaining. - */ - public Builder setNameBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - name_ = value; - onChanged(); - return this; - } - @java.lang.Override - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - - // @@protoc_insertion_point(builder_scope:google.showcase.v1beta1.GetBlurbRequest) - } - - // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.GetBlurbRequest) - private static final com.google.showcase.v1beta1.GetBlurbRequest DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new com.google.showcase.v1beta1.GetBlurbRequest(); - } - - public static com.google.showcase.v1beta1.GetBlurbRequest getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public GetBlurbRequest parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new GetBlurbRequest(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public com.google.showcase.v1beta1.GetBlurbRequest getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/GetBlurbRequestOrBuilder.java b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/GetBlurbRequestOrBuilder.java deleted file mode 100644 index 0d6d925511..0000000000 --- a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/GetBlurbRequestOrBuilder.java +++ /dev/null @@ -1,29 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: schema/google/showcase/v1beta1/messaging.proto - -package com.google.showcase.v1beta1; - -public interface GetBlurbRequestOrBuilder extends - // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.GetBlurbRequest) - com.google.protobuf.MessageOrBuilder { - - /** - *
        -   * The resource name of the requested blurb.
        -   * 
        - * - * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * @return The name. - */ - java.lang.String getName(); - /** - *
        -   * The resource name of the requested blurb.
        -   * 
        - * - * 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/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/GetRoomRequest.java b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/GetRoomRequest.java deleted file mode 100644 index 742722b6cb..0000000000 --- a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/GetRoomRequest.java +++ /dev/null @@ -1,597 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: schema/google/showcase/v1beta1/messaging.proto - -package com.google.showcase.v1beta1; - -/** - *
        - * The request message for the google.showcase.v1beta1.Messaging\GetRoom
        - * method.
        - * 
        - * - * Protobuf type {@code google.showcase.v1beta1.GetRoomRequest} - */ -public final class GetRoomRequest extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.GetRoomRequest) - GetRoomRequestOrBuilder { -private static final long serialVersionUID = 0L; - // Use GetRoomRequest.newBuilder() to construct. - private GetRoomRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private GetRoomRequest() { - name_ = ""; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new GetRoomRequest(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private GetRoomRequest( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: { - java.lang.String s = input.readStringRequireUtf8(); - - name_ = s; - break; - } - default: { - if (!parseUnknownField( - input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException( - e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.google.showcase.v1beta1.MessagingOuterClass.internal_static_google_showcase_v1beta1_GetRoomRequest_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.showcase.v1beta1.MessagingOuterClass.internal_static_google_showcase_v1beta1_GetRoomRequest_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.showcase.v1beta1.GetRoomRequest.class, com.google.showcase.v1beta1.GetRoomRequest.Builder.class); - } - - public static final int NAME_FIELD_NUMBER = 1; - private volatile java.lang.Object name_; - /** - *
        -   * The resource name of the requested room.
        -   * 
        - * - * 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; - } - } - /** - *
        -   * The resource name of the requested room.
        -   * 
        - * - * 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_); - } - unknownFields.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 += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof com.google.showcase.v1beta1.GetRoomRequest)) { - return super.equals(obj); - } - com.google.showcase.v1beta1.GetRoomRequest other = (com.google.showcase.v1beta1.GetRoomRequest) obj; - - if (!getName() - .equals(other.getName())) return false; - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - hash = (37 * hash) + NAME_FIELD_NUMBER; - hash = (53 * hash) + getName().hashCode(); - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.showcase.v1beta1.GetRoomRequest parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.showcase.v1beta1.GetRoomRequest parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.showcase.v1beta1.GetRoomRequest parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.showcase.v1beta1.GetRoomRequest 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.showcase.v1beta1.GetRoomRequest parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.showcase.v1beta1.GetRoomRequest parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.showcase.v1beta1.GetRoomRequest parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static com.google.showcase.v1beta1.GetRoomRequest 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.showcase.v1beta1.GetRoomRequest parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static com.google.showcase.v1beta1.GetRoomRequest 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.showcase.v1beta1.GetRoomRequest parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static com.google.showcase.v1beta1.GetRoomRequest 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.showcase.v1beta1.GetRoomRequest 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 request message for the google.showcase.v1beta1.Messaging\GetRoom
        -   * method.
        -   * 
        - * - * Protobuf type {@code google.showcase.v1beta1.GetRoomRequest} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.GetRoomRequest) - com.google.showcase.v1beta1.GetRoomRequestOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.google.showcase.v1beta1.MessagingOuterClass.internal_static_google_showcase_v1beta1_GetRoomRequest_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.showcase.v1beta1.MessagingOuterClass.internal_static_google_showcase_v1beta1_GetRoomRequest_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.showcase.v1beta1.GetRoomRequest.class, com.google.showcase.v1beta1.GetRoomRequest.Builder.class); - } - - // Construct using com.google.showcase.v1beta1.GetRoomRequest.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { - } - } - @java.lang.Override - public Builder clear() { - super.clear(); - name_ = ""; - - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return com.google.showcase.v1beta1.MessagingOuterClass.internal_static_google_showcase_v1beta1_GetRoomRequest_descriptor; - } - - @java.lang.Override - public com.google.showcase.v1beta1.GetRoomRequest getDefaultInstanceForType() { - return com.google.showcase.v1beta1.GetRoomRequest.getDefaultInstance(); - } - - @java.lang.Override - public com.google.showcase.v1beta1.GetRoomRequest build() { - com.google.showcase.v1beta1.GetRoomRequest result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.showcase.v1beta1.GetRoomRequest buildPartial() { - com.google.showcase.v1beta1.GetRoomRequest result = new com.google.showcase.v1beta1.GetRoomRequest(this); - result.name_ = name_; - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.setField(field, value); - } - @java.lang.Override - public Builder clearField( - com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - @java.lang.Override - public Builder clearOneof( - com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.addRepeatedField(field, value); - } - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof com.google.showcase.v1beta1.GetRoomRequest) { - return mergeFrom((com.google.showcase.v1beta1.GetRoomRequest)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.showcase.v1beta1.GetRoomRequest other) { - if (other == com.google.showcase.v1beta1.GetRoomRequest.getDefaultInstance()) return this; - if (!other.getName().isEmpty()) { - name_ = other.name_; - onChanged(); - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - com.google.showcase.v1beta1.GetRoomRequest parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (com.google.showcase.v1beta1.GetRoomRequest) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private java.lang.Object name_ = ""; - /** - *
        -     * The resource name of the requested room.
        -     * 
        - * - * 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; - } - } - /** - *
        -     * The resource name of the requested room.
        -     * 
        - * - * 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; - } - } - /** - *
        -     * The resource name of the requested room.
        -     * 
        - * - * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * @param value The name to set. - * @return This builder for chaining. - */ - public Builder setName( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - name_ = value; - onChanged(); - return this; - } - /** - *
        -     * The resource name of the requested room.
        -     * 
        - * - * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * @return This builder for chaining. - */ - public Builder clearName() { - - name_ = getDefaultInstance().getName(); - onChanged(); - return this; - } - /** - *
        -     * The resource name of the requested room.
        -     * 
        - * - * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * @param value The bytes for name to set. - * @return This builder for chaining. - */ - public Builder setNameBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - name_ = value; - onChanged(); - return this; - } - @java.lang.Override - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - - // @@protoc_insertion_point(builder_scope:google.showcase.v1beta1.GetRoomRequest) - } - - // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.GetRoomRequest) - private static final com.google.showcase.v1beta1.GetRoomRequest DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new com.google.showcase.v1beta1.GetRoomRequest(); - } - - public static com.google.showcase.v1beta1.GetRoomRequest getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public GetRoomRequest parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new GetRoomRequest(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public com.google.showcase.v1beta1.GetRoomRequest getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/GetRoomRequestOrBuilder.java b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/GetRoomRequestOrBuilder.java deleted file mode 100644 index 72da927362..0000000000 --- a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/GetRoomRequestOrBuilder.java +++ /dev/null @@ -1,29 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: schema/google/showcase/v1beta1/messaging.proto - -package com.google.showcase.v1beta1; - -public interface GetRoomRequestOrBuilder extends - // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.GetRoomRequest) - com.google.protobuf.MessageOrBuilder { - - /** - *
        -   * The resource name of the requested room.
        -   * 
        - * - * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * @return The name. - */ - java.lang.String getName(); - /** - *
        -   * The resource name of the requested room.
        -   * 
        - * - * 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/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/GetSequenceReportRequest.java b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/GetSequenceReportRequest.java deleted file mode 100644 index 9864b1d455..0000000000 --- a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/GetSequenceReportRequest.java +++ /dev/null @@ -1,559 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: schema/google/showcase/v1beta1/sequence.proto - -package com.google.showcase.v1beta1; - -/** - * Protobuf type {@code google.showcase.v1beta1.GetSequenceReportRequest} - */ -public final class GetSequenceReportRequest extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.GetSequenceReportRequest) - GetSequenceReportRequestOrBuilder { -private static final long serialVersionUID = 0L; - // Use GetSequenceReportRequest.newBuilder() to construct. - private GetSequenceReportRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private GetSequenceReportRequest() { - name_ = ""; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new GetSequenceReportRequest(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private GetSequenceReportRequest( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: { - java.lang.String s = input.readStringRequireUtf8(); - - name_ = s; - break; - } - default: { - if (!parseUnknownField( - input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException( - e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.google.showcase.v1beta1.SequenceOuterClass.internal_static_google_showcase_v1beta1_GetSequenceReportRequest_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.showcase.v1beta1.SequenceOuterClass.internal_static_google_showcase_v1beta1_GetSequenceReportRequest_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.showcase.v1beta1.GetSequenceReportRequest.class, com.google.showcase.v1beta1.GetSequenceReportRequest.Builder.class); - } - - public static final int NAME_FIELD_NUMBER = 1; - private volatile java.lang.Object name_; - /** - * 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; - } - } - /** - * 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_); - } - unknownFields.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 += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof com.google.showcase.v1beta1.GetSequenceReportRequest)) { - return super.equals(obj); - } - com.google.showcase.v1beta1.GetSequenceReportRequest other = (com.google.showcase.v1beta1.GetSequenceReportRequest) obj; - - if (!getName() - .equals(other.getName())) return false; - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - hash = (37 * hash) + NAME_FIELD_NUMBER; - hash = (53 * hash) + getName().hashCode(); - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.showcase.v1beta1.GetSequenceReportRequest parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.showcase.v1beta1.GetSequenceReportRequest parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.showcase.v1beta1.GetSequenceReportRequest parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.showcase.v1beta1.GetSequenceReportRequest 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.showcase.v1beta1.GetSequenceReportRequest parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.showcase.v1beta1.GetSequenceReportRequest parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.showcase.v1beta1.GetSequenceReportRequest parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static com.google.showcase.v1beta1.GetSequenceReportRequest 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.showcase.v1beta1.GetSequenceReportRequest parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static com.google.showcase.v1beta1.GetSequenceReportRequest 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.showcase.v1beta1.GetSequenceReportRequest parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static com.google.showcase.v1beta1.GetSequenceReportRequest 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.showcase.v1beta1.GetSequenceReportRequest prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - @java.lang.Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - * Protobuf type {@code google.showcase.v1beta1.GetSequenceReportRequest} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.GetSequenceReportRequest) - com.google.showcase.v1beta1.GetSequenceReportRequestOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.google.showcase.v1beta1.SequenceOuterClass.internal_static_google_showcase_v1beta1_GetSequenceReportRequest_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.showcase.v1beta1.SequenceOuterClass.internal_static_google_showcase_v1beta1_GetSequenceReportRequest_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.showcase.v1beta1.GetSequenceReportRequest.class, com.google.showcase.v1beta1.GetSequenceReportRequest.Builder.class); - } - - // Construct using com.google.showcase.v1beta1.GetSequenceReportRequest.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { - } - } - @java.lang.Override - public Builder clear() { - super.clear(); - name_ = ""; - - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return com.google.showcase.v1beta1.SequenceOuterClass.internal_static_google_showcase_v1beta1_GetSequenceReportRequest_descriptor; - } - - @java.lang.Override - public com.google.showcase.v1beta1.GetSequenceReportRequest getDefaultInstanceForType() { - return com.google.showcase.v1beta1.GetSequenceReportRequest.getDefaultInstance(); - } - - @java.lang.Override - public com.google.showcase.v1beta1.GetSequenceReportRequest build() { - com.google.showcase.v1beta1.GetSequenceReportRequest result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.showcase.v1beta1.GetSequenceReportRequest buildPartial() { - com.google.showcase.v1beta1.GetSequenceReportRequest result = new com.google.showcase.v1beta1.GetSequenceReportRequest(this); - result.name_ = name_; - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.setField(field, value); - } - @java.lang.Override - public Builder clearField( - com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - @java.lang.Override - public Builder clearOneof( - com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.addRepeatedField(field, value); - } - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof com.google.showcase.v1beta1.GetSequenceReportRequest) { - return mergeFrom((com.google.showcase.v1beta1.GetSequenceReportRequest)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.showcase.v1beta1.GetSequenceReportRequest other) { - if (other == com.google.showcase.v1beta1.GetSequenceReportRequest.getDefaultInstance()) return this; - if (!other.getName().isEmpty()) { - name_ = other.name_; - onChanged(); - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - com.google.showcase.v1beta1.GetSequenceReportRequest parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (com.google.showcase.v1beta1.GetSequenceReportRequest) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private java.lang.Object name_ = ""; - /** - * 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; - } - } - /** - * 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; - } - } - /** - * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * @param value The name to set. - * @return This builder for chaining. - */ - public Builder setName( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - name_ = value; - onChanged(); - return this; - } - /** - * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * @return This builder for chaining. - */ - public Builder clearName() { - - name_ = getDefaultInstance().getName(); - onChanged(); - return this; - } - /** - * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * @param value The bytes for name to set. - * @return This builder for chaining. - */ - public Builder setNameBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - name_ = value; - onChanged(); - return this; - } - @java.lang.Override - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - - // @@protoc_insertion_point(builder_scope:google.showcase.v1beta1.GetSequenceReportRequest) - } - - // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.GetSequenceReportRequest) - private static final com.google.showcase.v1beta1.GetSequenceReportRequest DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new com.google.showcase.v1beta1.GetSequenceReportRequest(); - } - - public static com.google.showcase.v1beta1.GetSequenceReportRequest getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public GetSequenceReportRequest parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new GetSequenceReportRequest(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public com.google.showcase.v1beta1.GetSequenceReportRequest getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/GetSequenceReportRequestOrBuilder.java b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/GetSequenceReportRequestOrBuilder.java deleted file mode 100644 index e8f9cb6049..0000000000 --- a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/GetSequenceReportRequestOrBuilder.java +++ /dev/null @@ -1,21 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: schema/google/showcase/v1beta1/sequence.proto - -package com.google.showcase.v1beta1; - -public interface GetSequenceReportRequestOrBuilder extends - // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.GetSequenceReportRequest) - com.google.protobuf.MessageOrBuilder { - - /** - * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * @return The name. - */ - java.lang.String getName(); - /** - * 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/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/GetSessionRequest.java b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/GetSessionRequest.java deleted file mode 100644 index eaf565f7c4..0000000000 --- a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/GetSessionRequest.java +++ /dev/null @@ -1,595 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: schema/google/showcase/v1beta1/testing.proto - -package com.google.showcase.v1beta1; - -/** - *
        - * The request for the GetSession method.
        - * 
        - * - * Protobuf type {@code google.showcase.v1beta1.GetSessionRequest} - */ -public final class GetSessionRequest extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.GetSessionRequest) - GetSessionRequestOrBuilder { -private static final long serialVersionUID = 0L; - // Use GetSessionRequest.newBuilder() to construct. - private GetSessionRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private GetSessionRequest() { - name_ = ""; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new GetSessionRequest(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private GetSessionRequest( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: { - java.lang.String s = input.readStringRequireUtf8(); - - name_ = s; - break; - } - default: { - if (!parseUnknownField( - input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException( - e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.google.showcase.v1beta1.TestingOuterClass.internal_static_google_showcase_v1beta1_GetSessionRequest_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.showcase.v1beta1.TestingOuterClass.internal_static_google_showcase_v1beta1_GetSessionRequest_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.showcase.v1beta1.GetSessionRequest.class, com.google.showcase.v1beta1.GetSessionRequest.Builder.class); - } - - public static final int NAME_FIELD_NUMBER = 1; - private volatile java.lang.Object name_; - /** - *
        -   * The session to be retrieved.
        -   * 
        - * - * string name = 1 [(.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; - } - } - /** - *
        -   * The session to be retrieved.
        -   * 
        - * - * string name = 1 [(.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_); - } - unknownFields.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 += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof com.google.showcase.v1beta1.GetSessionRequest)) { - return super.equals(obj); - } - com.google.showcase.v1beta1.GetSessionRequest other = (com.google.showcase.v1beta1.GetSessionRequest) obj; - - if (!getName() - .equals(other.getName())) return false; - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - hash = (37 * hash) + NAME_FIELD_NUMBER; - hash = (53 * hash) + getName().hashCode(); - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.showcase.v1beta1.GetSessionRequest parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.showcase.v1beta1.GetSessionRequest parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.showcase.v1beta1.GetSessionRequest parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.showcase.v1beta1.GetSessionRequest 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.showcase.v1beta1.GetSessionRequest parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.showcase.v1beta1.GetSessionRequest parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.showcase.v1beta1.GetSessionRequest parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static com.google.showcase.v1beta1.GetSessionRequest 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.showcase.v1beta1.GetSessionRequest parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static com.google.showcase.v1beta1.GetSessionRequest 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.showcase.v1beta1.GetSessionRequest parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static com.google.showcase.v1beta1.GetSessionRequest 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.showcase.v1beta1.GetSessionRequest 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 request for the GetSession method.
        -   * 
        - * - * Protobuf type {@code google.showcase.v1beta1.GetSessionRequest} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.GetSessionRequest) - com.google.showcase.v1beta1.GetSessionRequestOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.google.showcase.v1beta1.TestingOuterClass.internal_static_google_showcase_v1beta1_GetSessionRequest_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.showcase.v1beta1.TestingOuterClass.internal_static_google_showcase_v1beta1_GetSessionRequest_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.showcase.v1beta1.GetSessionRequest.class, com.google.showcase.v1beta1.GetSessionRequest.Builder.class); - } - - // Construct using com.google.showcase.v1beta1.GetSessionRequest.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { - } - } - @java.lang.Override - public Builder clear() { - super.clear(); - name_ = ""; - - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return com.google.showcase.v1beta1.TestingOuterClass.internal_static_google_showcase_v1beta1_GetSessionRequest_descriptor; - } - - @java.lang.Override - public com.google.showcase.v1beta1.GetSessionRequest getDefaultInstanceForType() { - return com.google.showcase.v1beta1.GetSessionRequest.getDefaultInstance(); - } - - @java.lang.Override - public com.google.showcase.v1beta1.GetSessionRequest build() { - com.google.showcase.v1beta1.GetSessionRequest result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.showcase.v1beta1.GetSessionRequest buildPartial() { - com.google.showcase.v1beta1.GetSessionRequest result = new com.google.showcase.v1beta1.GetSessionRequest(this); - result.name_ = name_; - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.setField(field, value); - } - @java.lang.Override - public Builder clearField( - com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - @java.lang.Override - public Builder clearOneof( - com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.addRepeatedField(field, value); - } - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof com.google.showcase.v1beta1.GetSessionRequest) { - return mergeFrom((com.google.showcase.v1beta1.GetSessionRequest)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.showcase.v1beta1.GetSessionRequest other) { - if (other == com.google.showcase.v1beta1.GetSessionRequest.getDefaultInstance()) return this; - if (!other.getName().isEmpty()) { - name_ = other.name_; - onChanged(); - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - com.google.showcase.v1beta1.GetSessionRequest parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (com.google.showcase.v1beta1.GetSessionRequest) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private java.lang.Object name_ = ""; - /** - *
        -     * The session to be retrieved.
        -     * 
        - * - * string name = 1 [(.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; - } - } - /** - *
        -     * The session to be retrieved.
        -     * 
        - * - * string name = 1 [(.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; - } - } - /** - *
        -     * The session to be retrieved.
        -     * 
        - * - * string name = 1 [(.google.api.resource_reference) = { ... } - * @param value The name to set. - * @return This builder for chaining. - */ - public Builder setName( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - name_ = value; - onChanged(); - return this; - } - /** - *
        -     * The session to be retrieved.
        -     * 
        - * - * string name = 1 [(.google.api.resource_reference) = { ... } - * @return This builder for chaining. - */ - public Builder clearName() { - - name_ = getDefaultInstance().getName(); - onChanged(); - return this; - } - /** - *
        -     * The session to be retrieved.
        -     * 
        - * - * string name = 1 [(.google.api.resource_reference) = { ... } - * @param value The bytes for name to set. - * @return This builder for chaining. - */ - public Builder setNameBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - name_ = value; - onChanged(); - return this; - } - @java.lang.Override - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - - // @@protoc_insertion_point(builder_scope:google.showcase.v1beta1.GetSessionRequest) - } - - // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.GetSessionRequest) - private static final com.google.showcase.v1beta1.GetSessionRequest DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new com.google.showcase.v1beta1.GetSessionRequest(); - } - - public static com.google.showcase.v1beta1.GetSessionRequest getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public GetSessionRequest parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new GetSessionRequest(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public com.google.showcase.v1beta1.GetSessionRequest getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/GetSessionRequestOrBuilder.java b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/GetSessionRequestOrBuilder.java deleted file mode 100644 index b51b769709..0000000000 --- a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/GetSessionRequestOrBuilder.java +++ /dev/null @@ -1,29 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: schema/google/showcase/v1beta1/testing.proto - -package com.google.showcase.v1beta1; - -public interface GetSessionRequestOrBuilder extends - // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.GetSessionRequest) - com.google.protobuf.MessageOrBuilder { - - /** - *
        -   * The session to be retrieved.
        -   * 
        - * - * string name = 1 [(.google.api.resource_reference) = { ... } - * @return The name. - */ - java.lang.String getName(); - /** - *
        -   * The session to be retrieved.
        -   * 
        - * - * string name = 1 [(.google.api.resource_reference) = { ... } - * @return The bytes for name. - */ - com.google.protobuf.ByteString - getNameBytes(); -} diff --git a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/GetUserRequest.java b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/GetUserRequest.java deleted file mode 100644 index 8f950d71af..0000000000 --- a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/GetUserRequest.java +++ /dev/null @@ -1,597 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: schema/google/showcase/v1beta1/identity.proto - -package com.google.showcase.v1beta1; - -/** - *
        - * The request message for the google.showcase.v1beta1.Identity\GetUser
        - * method.
        - * 
        - * - * Protobuf type {@code google.showcase.v1beta1.GetUserRequest} - */ -public final class GetUserRequest extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.GetUserRequest) - GetUserRequestOrBuilder { -private static final long serialVersionUID = 0L; - // Use GetUserRequest.newBuilder() to construct. - private GetUserRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private GetUserRequest() { - name_ = ""; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new GetUserRequest(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private GetUserRequest( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: { - java.lang.String s = input.readStringRequireUtf8(); - - name_ = s; - break; - } - default: { - if (!parseUnknownField( - input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException( - e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.google.showcase.v1beta1.IdentityOuterClass.internal_static_google_showcase_v1beta1_GetUserRequest_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.showcase.v1beta1.IdentityOuterClass.internal_static_google_showcase_v1beta1_GetUserRequest_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.showcase.v1beta1.GetUserRequest.class, com.google.showcase.v1beta1.GetUserRequest.Builder.class); - } - - public static final int NAME_FIELD_NUMBER = 1; - private volatile java.lang.Object name_; - /** - *
        -   * The resource name of the requested user.
        -   * 
        - * - * 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; - } - } - /** - *
        -   * The resource name of the requested user.
        -   * 
        - * - * 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_); - } - unknownFields.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 += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof com.google.showcase.v1beta1.GetUserRequest)) { - return super.equals(obj); - } - com.google.showcase.v1beta1.GetUserRequest other = (com.google.showcase.v1beta1.GetUserRequest) obj; - - if (!getName() - .equals(other.getName())) return false; - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - hash = (37 * hash) + NAME_FIELD_NUMBER; - hash = (53 * hash) + getName().hashCode(); - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.showcase.v1beta1.GetUserRequest parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.showcase.v1beta1.GetUserRequest parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.showcase.v1beta1.GetUserRequest parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.showcase.v1beta1.GetUserRequest 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.showcase.v1beta1.GetUserRequest parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.showcase.v1beta1.GetUserRequest parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.showcase.v1beta1.GetUserRequest parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static com.google.showcase.v1beta1.GetUserRequest 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.showcase.v1beta1.GetUserRequest parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static com.google.showcase.v1beta1.GetUserRequest 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.showcase.v1beta1.GetUserRequest parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static com.google.showcase.v1beta1.GetUserRequest 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.showcase.v1beta1.GetUserRequest 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 request message for the google.showcase.v1beta1.Identity\GetUser
        -   * method.
        -   * 
        - * - * Protobuf type {@code google.showcase.v1beta1.GetUserRequest} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.GetUserRequest) - com.google.showcase.v1beta1.GetUserRequestOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.google.showcase.v1beta1.IdentityOuterClass.internal_static_google_showcase_v1beta1_GetUserRequest_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.showcase.v1beta1.IdentityOuterClass.internal_static_google_showcase_v1beta1_GetUserRequest_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.showcase.v1beta1.GetUserRequest.class, com.google.showcase.v1beta1.GetUserRequest.Builder.class); - } - - // Construct using com.google.showcase.v1beta1.GetUserRequest.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { - } - } - @java.lang.Override - public Builder clear() { - super.clear(); - name_ = ""; - - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return com.google.showcase.v1beta1.IdentityOuterClass.internal_static_google_showcase_v1beta1_GetUserRequest_descriptor; - } - - @java.lang.Override - public com.google.showcase.v1beta1.GetUserRequest getDefaultInstanceForType() { - return com.google.showcase.v1beta1.GetUserRequest.getDefaultInstance(); - } - - @java.lang.Override - public com.google.showcase.v1beta1.GetUserRequest build() { - com.google.showcase.v1beta1.GetUserRequest result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.showcase.v1beta1.GetUserRequest buildPartial() { - com.google.showcase.v1beta1.GetUserRequest result = new com.google.showcase.v1beta1.GetUserRequest(this); - result.name_ = name_; - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.setField(field, value); - } - @java.lang.Override - public Builder clearField( - com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - @java.lang.Override - public Builder clearOneof( - com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.addRepeatedField(field, value); - } - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof com.google.showcase.v1beta1.GetUserRequest) { - return mergeFrom((com.google.showcase.v1beta1.GetUserRequest)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.showcase.v1beta1.GetUserRequest other) { - if (other == com.google.showcase.v1beta1.GetUserRequest.getDefaultInstance()) return this; - if (!other.getName().isEmpty()) { - name_ = other.name_; - onChanged(); - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - com.google.showcase.v1beta1.GetUserRequest parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (com.google.showcase.v1beta1.GetUserRequest) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private java.lang.Object name_ = ""; - /** - *
        -     * The resource name of the requested user.
        -     * 
        - * - * 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; - } - } - /** - *
        -     * The resource name of the requested user.
        -     * 
        - * - * 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; - } - } - /** - *
        -     * The resource name of the requested user.
        -     * 
        - * - * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * @param value The name to set. - * @return This builder for chaining. - */ - public Builder setName( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - name_ = value; - onChanged(); - return this; - } - /** - *
        -     * The resource name of the requested user.
        -     * 
        - * - * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * @return This builder for chaining. - */ - public Builder clearName() { - - name_ = getDefaultInstance().getName(); - onChanged(); - return this; - } - /** - *
        -     * The resource name of the requested user.
        -     * 
        - * - * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * @param value The bytes for name to set. - * @return This builder for chaining. - */ - public Builder setNameBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - name_ = value; - onChanged(); - return this; - } - @java.lang.Override - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - - // @@protoc_insertion_point(builder_scope:google.showcase.v1beta1.GetUserRequest) - } - - // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.GetUserRequest) - private static final com.google.showcase.v1beta1.GetUserRequest DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new com.google.showcase.v1beta1.GetUserRequest(); - } - - public static com.google.showcase.v1beta1.GetUserRequest getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public GetUserRequest parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new GetUserRequest(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public com.google.showcase.v1beta1.GetUserRequest getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/GetUserRequestOrBuilder.java b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/GetUserRequestOrBuilder.java deleted file mode 100644 index d701822965..0000000000 --- a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/GetUserRequestOrBuilder.java +++ /dev/null @@ -1,29 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: schema/google/showcase/v1beta1/identity.proto - -package com.google.showcase.v1beta1; - -public interface GetUserRequestOrBuilder extends - // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.GetUserRequest) - com.google.protobuf.MessageOrBuilder { - - /** - *
        -   * The resource name of the requested user.
        -   * 
        - * - * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * @return The name. - */ - java.lang.String getName(); - /** - *
        -   * The resource name of the requested user.
        -   * 
        - * - * 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/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/IdentityOuterClass.java b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/IdentityOuterClass.java deleted file mode 100644 index 2e42ad5a01..0000000000 --- a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/IdentityOuterClass.java +++ /dev/null @@ -1,187 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: schema/google/showcase/v1beta1/identity.proto - -package com.google.showcase.v1beta1; - -public final class IdentityOuterClass { - private IdentityOuterClass() {} - 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_showcase_v1beta1_User_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_showcase_v1beta1_User_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_showcase_v1beta1_CreateUserRequest_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_showcase_v1beta1_CreateUserRequest_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_showcase_v1beta1_GetUserRequest_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_showcase_v1beta1_GetUserRequest_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_showcase_v1beta1_UpdateUserRequest_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_showcase_v1beta1_UpdateUserRequest_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_showcase_v1beta1_DeleteUserRequest_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_showcase_v1beta1_DeleteUserRequest_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_showcase_v1beta1_ListUsersRequest_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_showcase_v1beta1_ListUsersRequest_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_showcase_v1beta1_ListUsersResponse_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_showcase_v1beta1_ListUsersResponse_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-schema/google/showcase/v1beta1/identit" + - "y.proto\022\027google.showcase.v1beta1\032\034google" + - "/api/annotations.proto\032\027google/api/clien" + - "t.proto\032\037google/api/field_behavior.proto" + - "\032\031google/api/resource.proto\032\033google/prot" + - "obuf/empty.proto\032 google/protobuf/field_" + - "mask.proto\032\037google/protobuf/timestamp.pr" + - "oto\"\204\003\n\004User\022\014\n\004name\030\001 \001(\t\022\031\n\014display_na" + - "me\030\002 \001(\tB\003\340A\002\022\022\n\005email\030\003 \001(\tB\003\340A\002\0224\n\013cre" + - "ate_time\030\004 \001(\0132\032.google.protobuf.Timesta" + - "mpB\003\340A\003\0224\n\013update_time\030\005 \001(\0132\032.google.pr" + - "otobuf.TimestampB\003\340A\003\022\020\n\003age\030\006 \001(\005H\000\210\001\001\022" + - "\030\n\013height_feet\030\007 \001(\001H\001\210\001\001\022\025\n\010nickname\030\010 " + - "\001(\tH\002\210\001\001\022!\n\024enable_notifications\030\t \001(\010H\003" + - "\210\001\001:/\352A,\n\034showcase.googleapis.com/User\022\014" + - "users/{user}B\006\n\004_ageB\016\n\014_height_feetB\013\n\t" + - "_nicknameB\027\n\025_enable_notifications\"@\n\021Cr" + - "eateUserRequest\022+\n\004user\030\001 \001(\0132\035.google.s" + - "howcase.v1beta1.User\"D\n\016GetUserRequest\0222" + - "\n\004name\030\001 \001(\tB$\372A\036\n\034showcase.googleapis.c" + - "om/User\340A\002\"q\n\021UpdateUserRequest\022+\n\004user\030" + - "\001 \001(\0132\035.google.showcase.v1beta1.User\022/\n\013" + - "update_mask\030\002 \001(\0132\032.google.protobuf.Fiel" + - "dMask\"G\n\021DeleteUserRequest\0222\n\004name\030\001 \001(\t" + - "B$\372A\036\n\034showcase.googleapis.com/User\340A\002\"9" + - "\n\020ListUsersRequest\022\021\n\tpage_size\030\001 \001(\005\022\022\n" + - "\npage_token\030\002 \001(\t\"Z\n\021ListUsersResponse\022," + - "\n\005users\030\001 \003(\0132\035.google.showcase.v1beta1." + - "User\022\027\n\017next_page_token\030\002 \001(\t2\212\006\n\010Identi" + - "ty\022\363\001\n\nCreateUser\022*.google.showcase.v1be" + - "ta1.CreateUserRequest\032\035.google.showcase." + - "v1beta1.User\"\231\001\202\323\344\223\002\023\"\016/v1beta1/users:\001*" + - "\332A\034user.display_name,user.email\332A^user.d" + - "isplay_name,user.email,user.age,user.nic" + - "kname,user.enable_notifications,user.hei" + - "ght_feet\022y\n\007GetUser\022\'.google.showcase.v1" + - "beta1.GetUserRequest\032\035.google.showcase.v" + - "1beta1.User\"&\202\323\344\223\002\031\022\027/v1beta1/{name=user" + - "s/*}\332A\004name\022\203\001\n\nUpdateUser\022*.google.show" + - "case.v1beta1.UpdateUserRequest\032\035.google." + - "showcase.v1beta1.User\"*\202\323\344\223\002$2\034/v1beta1/" + - "{user.name=users/*}:\004user\022x\n\nDeleteUser\022" + - "*.google.showcase.v1beta1.DeleteUserRequ" + - "est\032\026.google.protobuf.Empty\"&\202\323\344\223\002\031*\027/v1" + - "beta1/{name=users/*}\332A\004name\022z\n\tListUsers" + - "\022).google.showcase.v1beta1.ListUsersRequ" + - "est\032*.google.showcase.v1beta1.ListUsersR" + - "esponse\"\026\202\323\344\223\002\020\022\016/v1beta1/users\032\021\312A\016loca" + - "lhost:7469Bq\n\033com.google.showcase.v1beta" + - "1P\001Z4github.com/googleapis/gapic-showcas" + - "e/server/genproto\352\002\031Google::Showcase::V1" + - "beta1b\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.protobuf.EmptyProto.getDescriptor(), - com.google.protobuf.FieldMaskProto.getDescriptor(), - com.google.protobuf.TimestampProto.getDescriptor(), - }); - internal_static_google_showcase_v1beta1_User_descriptor = - getDescriptor().getMessageTypes().get(0); - internal_static_google_showcase_v1beta1_User_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_google_showcase_v1beta1_User_descriptor, - new java.lang.String[] { "Name", "DisplayName", "Email", "CreateTime", "UpdateTime", "Age", "HeightFeet", "Nickname", "EnableNotifications", "Age", "HeightFeet", "Nickname", "EnableNotifications", }); - internal_static_google_showcase_v1beta1_CreateUserRequest_descriptor = - getDescriptor().getMessageTypes().get(1); - internal_static_google_showcase_v1beta1_CreateUserRequest_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_google_showcase_v1beta1_CreateUserRequest_descriptor, - new java.lang.String[] { "User", }); - internal_static_google_showcase_v1beta1_GetUserRequest_descriptor = - getDescriptor().getMessageTypes().get(2); - internal_static_google_showcase_v1beta1_GetUserRequest_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_google_showcase_v1beta1_GetUserRequest_descriptor, - new java.lang.String[] { "Name", }); - internal_static_google_showcase_v1beta1_UpdateUserRequest_descriptor = - getDescriptor().getMessageTypes().get(3); - internal_static_google_showcase_v1beta1_UpdateUserRequest_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_google_showcase_v1beta1_UpdateUserRequest_descriptor, - new java.lang.String[] { "User", "UpdateMask", }); - internal_static_google_showcase_v1beta1_DeleteUserRequest_descriptor = - getDescriptor().getMessageTypes().get(4); - internal_static_google_showcase_v1beta1_DeleteUserRequest_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_google_showcase_v1beta1_DeleteUserRequest_descriptor, - new java.lang.String[] { "Name", }); - internal_static_google_showcase_v1beta1_ListUsersRequest_descriptor = - getDescriptor().getMessageTypes().get(5); - internal_static_google_showcase_v1beta1_ListUsersRequest_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_google_showcase_v1beta1_ListUsersRequest_descriptor, - new java.lang.String[] { "PageSize", "PageToken", }); - internal_static_google_showcase_v1beta1_ListUsersResponse_descriptor = - getDescriptor().getMessageTypes().get(6); - internal_static_google_showcase_v1beta1_ListUsersResponse_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_google_showcase_v1beta1_ListUsersResponse_descriptor, - new java.lang.String[] { "Users", "NextPageToken", }); - 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.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.FieldBehaviorProto.getDescriptor(); - com.google.api.ResourceProto.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/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/Issue.java b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/Issue.java deleted file mode 100644 index 685fb2c112..0000000000 --- a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/Issue.java +++ /dev/null @@ -1,1136 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: schema/google/showcase/v1beta1/testing.proto - -package com.google.showcase.v1beta1; - -/** - *
        - * An issue found in the test.
        - * 
        - * - * Protobuf type {@code google.showcase.v1beta1.Issue} - */ -public final class Issue extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.Issue) - IssueOrBuilder { -private static final long serialVersionUID = 0L; - // Use Issue.newBuilder() to construct. - private Issue(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private Issue() { - type_ = 0; - severity_ = 0; - description_ = ""; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new Issue(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private Issue( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 8: { - int rawValue = input.readEnum(); - - type_ = rawValue; - break; - } - case 16: { - int rawValue = input.readEnum(); - - severity_ = rawValue; - break; - } - case 26: { - java.lang.String s = input.readStringRequireUtf8(); - - description_ = s; - break; - } - default: { - if (!parseUnknownField( - input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException( - e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.google.showcase.v1beta1.TestingOuterClass.internal_static_google_showcase_v1beta1_Issue_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.showcase.v1beta1.TestingOuterClass.internal_static_google_showcase_v1beta1_Issue_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.showcase.v1beta1.Issue.class, com.google.showcase.v1beta1.Issue.Builder.class); - } - - /** - *
        -   * The different potential types of issues.
        -   * 
        - * - * Protobuf enum {@code google.showcase.v1beta1.Issue.Type} - */ - public enum Type - implements com.google.protobuf.ProtocolMessageEnum { - /** - * TYPE_UNSPECIFIED = 0; - */ - TYPE_UNSPECIFIED(0), - /** - *
        -     * The test was never instrumented.
        -     * 
        - * - * SKIPPED = 1; - */ - SKIPPED(1), - /** - *
        -     * The test was started but never confirmed.
        -     * 
        - * - * PENDING = 2; - */ - PENDING(2), - /** - *
        -     * The test was instrumented, but Showcase got an unexpected
        -     * value when the generator tried to confirm success.
        -     * 
        - * - * INCORRECT_CONFIRMATION = 3; - */ - INCORRECT_CONFIRMATION(3), - UNRECOGNIZED(-1), - ; - - /** - * TYPE_UNSPECIFIED = 0; - */ - public static final int TYPE_UNSPECIFIED_VALUE = 0; - /** - *
        -     * The test was never instrumented.
        -     * 
        - * - * SKIPPED = 1; - */ - public static final int SKIPPED_VALUE = 1; - /** - *
        -     * The test was started but never confirmed.
        -     * 
        - * - * PENDING = 2; - */ - public static final int PENDING_VALUE = 2; - /** - *
        -     * The test was instrumented, but Showcase got an unexpected
        -     * value when the generator tried to confirm success.
        -     * 
        - * - * INCORRECT_CONFIRMATION = 3; - */ - public static final int INCORRECT_CONFIRMATION_VALUE = 3; - - - public final int getNumber() { - if (this == UNRECOGNIZED) { - throw new java.lang.IllegalArgumentException( - "Can't get the number of an unknown enum value."); - } - return value; - } - - /** - * @param value The numeric wire value of the corresponding enum entry. - * @return The enum associated with the given numeric wire value. - * @deprecated Use {@link #forNumber(int)} instead. - */ - @java.lang.Deprecated - public static Type valueOf(int value) { - return forNumber(value); - } - - /** - * @param value The numeric wire value of the corresponding enum entry. - * @return The enum associated with the given numeric wire value. - */ - public static Type forNumber(int value) { - switch (value) { - case 0: return TYPE_UNSPECIFIED; - case 1: return SKIPPED; - case 2: return PENDING; - case 3: return INCORRECT_CONFIRMATION; - default: return null; - } - } - - public static com.google.protobuf.Internal.EnumLiteMap - internalGetValueMap() { - return internalValueMap; - } - private static final com.google.protobuf.Internal.EnumLiteMap< - Type> internalValueMap = - new com.google.protobuf.Internal.EnumLiteMap() { - public Type findValueByNumber(int number) { - return Type.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.showcase.v1beta1.Issue.getDescriptor().getEnumTypes().get(0); - } - - private static final Type[] VALUES = values(); - - public static Type valueOf( - com.google.protobuf.Descriptors.EnumValueDescriptor desc) { - if (desc.getType() != getDescriptor()) { - throw new java.lang.IllegalArgumentException( - "EnumValueDescriptor is not for this type."); - } - if (desc.getIndex() == -1) { - return UNRECOGNIZED; - } - return VALUES[desc.getIndex()]; - } - - private final int value; - - private Type(int value) { - this.value = value; - } - - // @@protoc_insertion_point(enum_scope:google.showcase.v1beta1.Issue.Type) - } - - /** - *
        -   * Severity levels.
        -   * 
        - * - * Protobuf enum {@code google.showcase.v1beta1.Issue.Severity} - */ - public enum Severity - implements com.google.protobuf.ProtocolMessageEnum { - /** - * SEVERITY_UNSPECIFIED = 0; - */ - SEVERITY_UNSPECIFIED(0), - /** - *
        -     * Errors.
        -     * 
        - * - * ERROR = 1; - */ - ERROR(1), - /** - *
        -     * Warnings.
        -     * 
        - * - * WARNING = 2; - */ - WARNING(2), - UNRECOGNIZED(-1), - ; - - /** - * SEVERITY_UNSPECIFIED = 0; - */ - public static final int SEVERITY_UNSPECIFIED_VALUE = 0; - /** - *
        -     * Errors.
        -     * 
        - * - * ERROR = 1; - */ - public static final int ERROR_VALUE = 1; - /** - *
        -     * Warnings.
        -     * 
        - * - * WARNING = 2; - */ - public static final int WARNING_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 Severity 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 Severity forNumber(int value) { - switch (value) { - case 0: return SEVERITY_UNSPECIFIED; - case 1: return ERROR; - case 2: return WARNING; - default: return null; - } - } - - public static com.google.protobuf.Internal.EnumLiteMap - internalGetValueMap() { - return internalValueMap; - } - private static final com.google.protobuf.Internal.EnumLiteMap< - Severity> internalValueMap = - new com.google.protobuf.Internal.EnumLiteMap() { - public Severity findValueByNumber(int number) { - return Severity.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.showcase.v1beta1.Issue.getDescriptor().getEnumTypes().get(1); - } - - private static final Severity[] VALUES = values(); - - public static Severity 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 Severity(int value) { - this.value = value; - } - - // @@protoc_insertion_point(enum_scope:google.showcase.v1beta1.Issue.Severity) - } - - public static final int TYPE_FIELD_NUMBER = 1; - private int type_; - /** - *
        -   * The type of the issue.
        -   * 
        - * - * .google.showcase.v1beta1.Issue.Type type = 1; - * @return The enum numeric value on the wire for type. - */ - @java.lang.Override public int getTypeValue() { - return type_; - } - /** - *
        -   * The type of the issue.
        -   * 
        - * - * .google.showcase.v1beta1.Issue.Type type = 1; - * @return The type. - */ - @java.lang.Override public com.google.showcase.v1beta1.Issue.Type getType() { - @SuppressWarnings("deprecation") - com.google.showcase.v1beta1.Issue.Type result = com.google.showcase.v1beta1.Issue.Type.valueOf(type_); - return result == null ? com.google.showcase.v1beta1.Issue.Type.UNRECOGNIZED : result; - } - - public static final int SEVERITY_FIELD_NUMBER = 2; - private int severity_; - /** - *
        -   * The severity of the issue.
        -   * 
        - * - * .google.showcase.v1beta1.Issue.Severity severity = 2; - * @return The enum numeric value on the wire for severity. - */ - @java.lang.Override public int getSeverityValue() { - return severity_; - } - /** - *
        -   * The severity of the issue.
        -   * 
        - * - * .google.showcase.v1beta1.Issue.Severity severity = 2; - * @return The severity. - */ - @java.lang.Override public com.google.showcase.v1beta1.Issue.Severity getSeverity() { - @SuppressWarnings("deprecation") - com.google.showcase.v1beta1.Issue.Severity result = com.google.showcase.v1beta1.Issue.Severity.valueOf(severity_); - return result == null ? com.google.showcase.v1beta1.Issue.Severity.UNRECOGNIZED : result; - } - - public static final int DESCRIPTION_FIELD_NUMBER = 3; - private volatile java.lang.Object description_; - /** - *
        -   * A description of the issue.
        -   * 
        - * - * 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; - } - } - /** - *
        -   * A description of the issue.
        -   * 
        - * - * string description = 3; - * @return The bytes for description. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getDescriptionBytes() { - java.lang.Object ref = description_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - description_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - private byte memoizedIsInitialized = -1; - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - if (type_ != com.google.showcase.v1beta1.Issue.Type.TYPE_UNSPECIFIED.getNumber()) { - output.writeEnum(1, type_); - } - if (severity_ != com.google.showcase.v1beta1.Issue.Severity.SEVERITY_UNSPECIFIED.getNumber()) { - output.writeEnum(2, severity_); - } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(description_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 3, description_); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (type_ != com.google.showcase.v1beta1.Issue.Type.TYPE_UNSPECIFIED.getNumber()) { - size += com.google.protobuf.CodedOutputStream - .computeEnumSize(1, type_); - } - if (severity_ != com.google.showcase.v1beta1.Issue.Severity.SEVERITY_UNSPECIFIED.getNumber()) { - size += com.google.protobuf.CodedOutputStream - .computeEnumSize(2, severity_); - } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(description_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, description_); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof com.google.showcase.v1beta1.Issue)) { - return super.equals(obj); - } - com.google.showcase.v1beta1.Issue other = (com.google.showcase.v1beta1.Issue) obj; - - if (type_ != other.type_) return false; - if (severity_ != other.severity_) return false; - if (!getDescription() - .equals(other.getDescription())) return false; - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - hash = (37 * hash) + TYPE_FIELD_NUMBER; - hash = (53 * hash) + type_; - hash = (37 * hash) + SEVERITY_FIELD_NUMBER; - hash = (53 * hash) + severity_; - hash = (37 * hash) + DESCRIPTION_FIELD_NUMBER; - hash = (53 * hash) + getDescription().hashCode(); - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.showcase.v1beta1.Issue parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.showcase.v1beta1.Issue parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.showcase.v1beta1.Issue parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.showcase.v1beta1.Issue 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.showcase.v1beta1.Issue parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.showcase.v1beta1.Issue parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.showcase.v1beta1.Issue parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static com.google.showcase.v1beta1.Issue 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.showcase.v1beta1.Issue parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static com.google.showcase.v1beta1.Issue 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.showcase.v1beta1.Issue parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static com.google.showcase.v1beta1.Issue 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.showcase.v1beta1.Issue 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 issue found in the test.
        -   * 
        - * - * Protobuf type {@code google.showcase.v1beta1.Issue} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.Issue) - com.google.showcase.v1beta1.IssueOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.google.showcase.v1beta1.TestingOuterClass.internal_static_google_showcase_v1beta1_Issue_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.showcase.v1beta1.TestingOuterClass.internal_static_google_showcase_v1beta1_Issue_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.showcase.v1beta1.Issue.class, com.google.showcase.v1beta1.Issue.Builder.class); - } - - // Construct using com.google.showcase.v1beta1.Issue.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { - } - } - @java.lang.Override - public Builder clear() { - super.clear(); - type_ = 0; - - severity_ = 0; - - description_ = ""; - - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return com.google.showcase.v1beta1.TestingOuterClass.internal_static_google_showcase_v1beta1_Issue_descriptor; - } - - @java.lang.Override - public com.google.showcase.v1beta1.Issue getDefaultInstanceForType() { - return com.google.showcase.v1beta1.Issue.getDefaultInstance(); - } - - @java.lang.Override - public com.google.showcase.v1beta1.Issue build() { - com.google.showcase.v1beta1.Issue result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.showcase.v1beta1.Issue buildPartial() { - com.google.showcase.v1beta1.Issue result = new com.google.showcase.v1beta1.Issue(this); - result.type_ = type_; - result.severity_ = severity_; - result.description_ = description_; - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.setField(field, value); - } - @java.lang.Override - public Builder clearField( - com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - @java.lang.Override - public Builder clearOneof( - com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.addRepeatedField(field, value); - } - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof com.google.showcase.v1beta1.Issue) { - return mergeFrom((com.google.showcase.v1beta1.Issue)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.showcase.v1beta1.Issue other) { - if (other == com.google.showcase.v1beta1.Issue.getDefaultInstance()) return this; - if (other.type_ != 0) { - setTypeValue(other.getTypeValue()); - } - if (other.severity_ != 0) { - setSeverityValue(other.getSeverityValue()); - } - if (!other.getDescription().isEmpty()) { - description_ = other.description_; - onChanged(); - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - com.google.showcase.v1beta1.Issue parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (com.google.showcase.v1beta1.Issue) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private int type_ = 0; - /** - *
        -     * The type of the issue.
        -     * 
        - * - * .google.showcase.v1beta1.Issue.Type type = 1; - * @return The enum numeric value on the wire for type. - */ - @java.lang.Override public int getTypeValue() { - return type_; - } - /** - *
        -     * The type of the issue.
        -     * 
        - * - * .google.showcase.v1beta1.Issue.Type type = 1; - * @param value The enum numeric value on the wire for type to set. - * @return This builder for chaining. - */ - public Builder setTypeValue(int value) { - - type_ = value; - onChanged(); - return this; - } - /** - *
        -     * The type of the issue.
        -     * 
        - * - * .google.showcase.v1beta1.Issue.Type type = 1; - * @return The type. - */ - @java.lang.Override - public com.google.showcase.v1beta1.Issue.Type getType() { - @SuppressWarnings("deprecation") - com.google.showcase.v1beta1.Issue.Type result = com.google.showcase.v1beta1.Issue.Type.valueOf(type_); - return result == null ? com.google.showcase.v1beta1.Issue.Type.UNRECOGNIZED : result; - } - /** - *
        -     * The type of the issue.
        -     * 
        - * - * .google.showcase.v1beta1.Issue.Type type = 1; - * @param value The type to set. - * @return This builder for chaining. - */ - public Builder setType(com.google.showcase.v1beta1.Issue.Type value) { - if (value == null) { - throw new NullPointerException(); - } - - type_ = value.getNumber(); - onChanged(); - return this; - } - /** - *
        -     * The type of the issue.
        -     * 
        - * - * .google.showcase.v1beta1.Issue.Type type = 1; - * @return This builder for chaining. - */ - public Builder clearType() { - - type_ = 0; - onChanged(); - return this; - } - - private int severity_ = 0; - /** - *
        -     * The severity of the issue.
        -     * 
        - * - * .google.showcase.v1beta1.Issue.Severity severity = 2; - * @return The enum numeric value on the wire for severity. - */ - @java.lang.Override public int getSeverityValue() { - return severity_; - } - /** - *
        -     * The severity of the issue.
        -     * 
        - * - * .google.showcase.v1beta1.Issue.Severity severity = 2; - * @param value The enum numeric value on the wire for severity to set. - * @return This builder for chaining. - */ - public Builder setSeverityValue(int value) { - - severity_ = value; - onChanged(); - return this; - } - /** - *
        -     * The severity of the issue.
        -     * 
        - * - * .google.showcase.v1beta1.Issue.Severity severity = 2; - * @return The severity. - */ - @java.lang.Override - public com.google.showcase.v1beta1.Issue.Severity getSeverity() { - @SuppressWarnings("deprecation") - com.google.showcase.v1beta1.Issue.Severity result = com.google.showcase.v1beta1.Issue.Severity.valueOf(severity_); - return result == null ? com.google.showcase.v1beta1.Issue.Severity.UNRECOGNIZED : result; - } - /** - *
        -     * The severity of the issue.
        -     * 
        - * - * .google.showcase.v1beta1.Issue.Severity severity = 2; - * @param value The severity to set. - * @return This builder for chaining. - */ - public Builder setSeverity(com.google.showcase.v1beta1.Issue.Severity value) { - if (value == null) { - throw new NullPointerException(); - } - - severity_ = value.getNumber(); - onChanged(); - return this; - } - /** - *
        -     * The severity of the issue.
        -     * 
        - * - * .google.showcase.v1beta1.Issue.Severity severity = 2; - * @return This builder for chaining. - */ - public Builder clearSeverity() { - - severity_ = 0; - onChanged(); - return this; - } - - private java.lang.Object description_ = ""; - /** - *
        -     * A description of the issue.
        -     * 
        - * - * 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; - } - } - /** - *
        -     * A description of the issue.
        -     * 
        - * - * 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; - } - } - /** - *
        -     * A description of the issue.
        -     * 
        - * - * string description = 3; - * @param value The description to set. - * @return This builder for chaining. - */ - public Builder setDescription( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - description_ = value; - onChanged(); - return this; - } - /** - *
        -     * A description of the issue.
        -     * 
        - * - * string description = 3; - * @return This builder for chaining. - */ - public Builder clearDescription() { - - description_ = getDefaultInstance().getDescription(); - onChanged(); - return this; - } - /** - *
        -     * A description of the issue.
        -     * 
        - * - * string description = 3; - * @param value The bytes for description to set. - * @return This builder for chaining. - */ - public Builder setDescriptionBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - description_ = value; - onChanged(); - return this; - } - @java.lang.Override - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - - // @@protoc_insertion_point(builder_scope:google.showcase.v1beta1.Issue) - } - - // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.Issue) - private static final com.google.showcase.v1beta1.Issue DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new com.google.showcase.v1beta1.Issue(); - } - - public static com.google.showcase.v1beta1.Issue getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public Issue parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new Issue(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public com.google.showcase.v1beta1.Issue getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/IssueOrBuilder.java b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/IssueOrBuilder.java deleted file mode 100644 index 4371799dce..0000000000 --- a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/IssueOrBuilder.java +++ /dev/null @@ -1,67 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: schema/google/showcase/v1beta1/testing.proto - -package com.google.showcase.v1beta1; - -public interface IssueOrBuilder extends - // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.Issue) - com.google.protobuf.MessageOrBuilder { - - /** - *
        -   * The type of the issue.
        -   * 
        - * - * .google.showcase.v1beta1.Issue.Type type = 1; - * @return The enum numeric value on the wire for type. - */ - int getTypeValue(); - /** - *
        -   * The type of the issue.
        -   * 
        - * - * .google.showcase.v1beta1.Issue.Type type = 1; - * @return The type. - */ - com.google.showcase.v1beta1.Issue.Type getType(); - - /** - *
        -   * The severity of the issue.
        -   * 
        - * - * .google.showcase.v1beta1.Issue.Severity severity = 2; - * @return The enum numeric value on the wire for severity. - */ - int getSeverityValue(); - /** - *
        -   * The severity of the issue.
        -   * 
        - * - * .google.showcase.v1beta1.Issue.Severity severity = 2; - * @return The severity. - */ - com.google.showcase.v1beta1.Issue.Severity getSeverity(); - - /** - *
        -   * A description of the issue.
        -   * 
        - * - * string description = 3; - * @return The description. - */ - java.lang.String getDescription(); - /** - *
        -   * A description of the issue.
        -   * 
        - * - * string description = 3; - * @return The bytes for description. - */ - com.google.protobuf.ByteString - getDescriptionBytes(); -} diff --git a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListBlurbsRequest.java b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListBlurbsRequest.java deleted file mode 100644 index 1bf87e7a26..0000000000 --- a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListBlurbsRequest.java +++ /dev/null @@ -1,865 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: schema/google/showcase/v1beta1/messaging.proto - -package com.google.showcase.v1beta1; - -/** - *
        - * The request message for the google.showcase.v1beta1.Messaging\ListBlurbs
        - * method.
        - * 
        - * - * Protobuf type {@code google.showcase.v1beta1.ListBlurbsRequest} - */ -public final class ListBlurbsRequest extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.ListBlurbsRequest) - ListBlurbsRequestOrBuilder { -private static final long serialVersionUID = 0L; - // Use ListBlurbsRequest.newBuilder() to construct. - private ListBlurbsRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private ListBlurbsRequest() { - parent_ = ""; - pageToken_ = ""; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new ListBlurbsRequest(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private ListBlurbsRequest( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: { - java.lang.String s = input.readStringRequireUtf8(); - - parent_ = s; - break; - } - case 16: { - - pageSize_ = input.readInt32(); - break; - } - case 26: { - java.lang.String s = input.readStringRequireUtf8(); - - pageToken_ = s; - break; - } - default: { - if (!parseUnknownField( - input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException( - e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.google.showcase.v1beta1.MessagingOuterClass.internal_static_google_showcase_v1beta1_ListBlurbsRequest_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.showcase.v1beta1.MessagingOuterClass.internal_static_google_showcase_v1beta1_ListBlurbsRequest_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.showcase.v1beta1.ListBlurbsRequest.class, com.google.showcase.v1beta1.ListBlurbsRequest.Builder.class); - } - - public static final int PARENT_FIELD_NUMBER = 1; - private volatile java.lang.Object parent_; - /** - *
        -   * The resource name of the requested room or profile whos blurbs to list.
        -   * 
        - * - * 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; - } - } - /** - *
        -   * The resource name of the requested room or profile whos blurbs to list.
        -   * 
        - * - * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * @return The bytes for parent. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getParentBytes() { - java.lang.Object ref = parent_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - parent_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int PAGE_SIZE_FIELD_NUMBER = 2; - private int pageSize_; - /** - *
        -   * The maximum number of blurbs to return. Server may return fewer
        -   * blurbs than requested. If unspecified, server will pick an appropriate
        -   * default.
        -   * 
        - * - * int32 page_size = 2; - * @return The pageSize. - */ - @java.lang.Override - public int getPageSize() { - return pageSize_; - } - - public static final int PAGE_TOKEN_FIELD_NUMBER = 3; - private volatile java.lang.Object pageToken_; - /** - *
        -   * The value of google.showcase.v1beta1.ListBlurbsResponse.next_page_token
        -   * returned from the previous call to
        -   * `google.showcase.v1beta1.Messaging\ListBlurbs` method.
        -   * 
        - * - * string page_token = 3; - * @return The pageToken. - */ - @java.lang.Override - public java.lang.String getPageToken() { - java.lang.Object ref = pageToken_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - pageToken_ = s; - return s; - } - } - /** - *
        -   * The value of google.showcase.v1beta1.ListBlurbsResponse.next_page_token
        -   * returned from the previous call to
        -   * `google.showcase.v1beta1.Messaging\ListBlurbs` method.
        -   * 
        - * - * string page_token = 3; - * @return The bytes for pageToken. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getPageTokenBytes() { - java.lang.Object ref = pageToken_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - pageToken_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - private byte memoizedIsInitialized = -1; - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - if (!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_); - } - unknownFields.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_); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof com.google.showcase.v1beta1.ListBlurbsRequest)) { - return super.equals(obj); - } - com.google.showcase.v1beta1.ListBlurbsRequest other = (com.google.showcase.v1beta1.ListBlurbsRequest) obj; - - if (!getParent() - .equals(other.getParent())) return false; - if (getPageSize() - != other.getPageSize()) return false; - if (!getPageToken() - .equals(other.getPageToken())) return false; - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - hash = (37 * hash) + PARENT_FIELD_NUMBER; - hash = (53 * hash) + getParent().hashCode(); - hash = (37 * hash) + PAGE_SIZE_FIELD_NUMBER; - hash = (53 * hash) + getPageSize(); - hash = (37 * hash) + PAGE_TOKEN_FIELD_NUMBER; - hash = (53 * hash) + getPageToken().hashCode(); - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.showcase.v1beta1.ListBlurbsRequest parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.showcase.v1beta1.ListBlurbsRequest parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.showcase.v1beta1.ListBlurbsRequest parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.showcase.v1beta1.ListBlurbsRequest 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.showcase.v1beta1.ListBlurbsRequest parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.showcase.v1beta1.ListBlurbsRequest parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.showcase.v1beta1.ListBlurbsRequest parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static com.google.showcase.v1beta1.ListBlurbsRequest 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.showcase.v1beta1.ListBlurbsRequest parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static com.google.showcase.v1beta1.ListBlurbsRequest 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.showcase.v1beta1.ListBlurbsRequest parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static com.google.showcase.v1beta1.ListBlurbsRequest 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.showcase.v1beta1.ListBlurbsRequest 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 request message for the google.showcase.v1beta1.Messaging\ListBlurbs
        -   * method.
        -   * 
        - * - * Protobuf type {@code google.showcase.v1beta1.ListBlurbsRequest} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.ListBlurbsRequest) - com.google.showcase.v1beta1.ListBlurbsRequestOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.google.showcase.v1beta1.MessagingOuterClass.internal_static_google_showcase_v1beta1_ListBlurbsRequest_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.showcase.v1beta1.MessagingOuterClass.internal_static_google_showcase_v1beta1_ListBlurbsRequest_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.showcase.v1beta1.ListBlurbsRequest.class, com.google.showcase.v1beta1.ListBlurbsRequest.Builder.class); - } - - // Construct using com.google.showcase.v1beta1.ListBlurbsRequest.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { - } - } - @java.lang.Override - public Builder clear() { - super.clear(); - parent_ = ""; - - pageSize_ = 0; - - pageToken_ = ""; - - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return com.google.showcase.v1beta1.MessagingOuterClass.internal_static_google_showcase_v1beta1_ListBlurbsRequest_descriptor; - } - - @java.lang.Override - public com.google.showcase.v1beta1.ListBlurbsRequest getDefaultInstanceForType() { - return com.google.showcase.v1beta1.ListBlurbsRequest.getDefaultInstance(); - } - - @java.lang.Override - public com.google.showcase.v1beta1.ListBlurbsRequest build() { - com.google.showcase.v1beta1.ListBlurbsRequest result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.showcase.v1beta1.ListBlurbsRequest buildPartial() { - com.google.showcase.v1beta1.ListBlurbsRequest result = new com.google.showcase.v1beta1.ListBlurbsRequest(this); - result.parent_ = parent_; - result.pageSize_ = pageSize_; - result.pageToken_ = pageToken_; - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.setField(field, value); - } - @java.lang.Override - public Builder clearField( - com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - @java.lang.Override - public Builder clearOneof( - com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.addRepeatedField(field, value); - } - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof com.google.showcase.v1beta1.ListBlurbsRequest) { - return mergeFrom((com.google.showcase.v1beta1.ListBlurbsRequest)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.showcase.v1beta1.ListBlurbsRequest other) { - if (other == com.google.showcase.v1beta1.ListBlurbsRequest.getDefaultInstance()) return this; - if (!other.getParent().isEmpty()) { - parent_ = other.parent_; - onChanged(); - } - if (other.getPageSize() != 0) { - setPageSize(other.getPageSize()); - } - if (!other.getPageToken().isEmpty()) { - pageToken_ = other.pageToken_; - onChanged(); - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - com.google.showcase.v1beta1.ListBlurbsRequest parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (com.google.showcase.v1beta1.ListBlurbsRequest) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private java.lang.Object parent_ = ""; - /** - *
        -     * The resource name of the requested room or profile whos blurbs to list.
        -     * 
        - * - * 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; - } - } - /** - *
        -     * The resource name of the requested room or profile whos blurbs to list.
        -     * 
        - * - * 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; - } - } - /** - *
        -     * The resource name of the requested room or profile whos blurbs to list.
        -     * 
        - * - * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * @param value The parent to set. - * @return This builder for chaining. - */ - public Builder setParent( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - parent_ = value; - onChanged(); - return this; - } - /** - *
        -     * The resource name of the requested room or profile whos blurbs to list.
        -     * 
        - * - * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * @return This builder for chaining. - */ - public Builder clearParent() { - - parent_ = getDefaultInstance().getParent(); - onChanged(); - return this; - } - /** - *
        -     * The resource name of the requested room or profile whos blurbs to list.
        -     * 
        - * - * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * @param value The bytes for parent to set. - * @return This builder for chaining. - */ - public Builder setParentBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - parent_ = value; - onChanged(); - return this; - } - - private int pageSize_ ; - /** - *
        -     * The maximum number of blurbs to return. Server may return fewer
        -     * blurbs than requested. If unspecified, server will pick an appropriate
        -     * default.
        -     * 
        - * - * int32 page_size = 2; - * @return The pageSize. - */ - @java.lang.Override - public int getPageSize() { - return pageSize_; - } - /** - *
        -     * The maximum number of blurbs to return. Server may return fewer
        -     * blurbs than requested. If unspecified, server will pick an appropriate
        -     * default.
        -     * 
        - * - * int32 page_size = 2; - * @param value The pageSize to set. - * @return This builder for chaining. - */ - public Builder setPageSize(int value) { - - pageSize_ = value; - onChanged(); - return this; - } - /** - *
        -     * The maximum number of blurbs to return. Server may return fewer
        -     * blurbs than requested. If unspecified, server will pick an appropriate
        -     * default.
        -     * 
        - * - * int32 page_size = 2; - * @return This builder for chaining. - */ - public Builder clearPageSize() { - - pageSize_ = 0; - onChanged(); - return this; - } - - private java.lang.Object pageToken_ = ""; - /** - *
        -     * The value of google.showcase.v1beta1.ListBlurbsResponse.next_page_token
        -     * returned from the previous call to
        -     * `google.showcase.v1beta1.Messaging\ListBlurbs` method.
        -     * 
        - * - * string page_token = 3; - * @return The pageToken. - */ - public java.lang.String getPageToken() { - java.lang.Object ref = pageToken_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - pageToken_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - *
        -     * The value of google.showcase.v1beta1.ListBlurbsResponse.next_page_token
        -     * returned from the previous call to
        -     * `google.showcase.v1beta1.Messaging\ListBlurbs` method.
        -     * 
        - * - * string page_token = 3; - * @return The bytes for pageToken. - */ - public com.google.protobuf.ByteString - getPageTokenBytes() { - java.lang.Object ref = pageToken_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - pageToken_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - *
        -     * The value of google.showcase.v1beta1.ListBlurbsResponse.next_page_token
        -     * returned from the previous call to
        -     * `google.showcase.v1beta1.Messaging\ListBlurbs` method.
        -     * 
        - * - * string page_token = 3; - * @param value The pageToken to set. - * @return This builder for chaining. - */ - public Builder setPageToken( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - pageToken_ = value; - onChanged(); - return this; - } - /** - *
        -     * The value of google.showcase.v1beta1.ListBlurbsResponse.next_page_token
        -     * returned from the previous call to
        -     * `google.showcase.v1beta1.Messaging\ListBlurbs` method.
        -     * 
        - * - * string page_token = 3; - * @return This builder for chaining. - */ - public Builder clearPageToken() { - - pageToken_ = getDefaultInstance().getPageToken(); - onChanged(); - return this; - } - /** - *
        -     * The value of google.showcase.v1beta1.ListBlurbsResponse.next_page_token
        -     * returned from the previous call to
        -     * `google.showcase.v1beta1.Messaging\ListBlurbs` method.
        -     * 
        - * - * string page_token = 3; - * @param value The bytes for pageToken to set. - * @return This builder for chaining. - */ - public Builder setPageTokenBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - pageToken_ = value; - onChanged(); - return this; - } - @java.lang.Override - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - - // @@protoc_insertion_point(builder_scope:google.showcase.v1beta1.ListBlurbsRequest) - } - - // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.ListBlurbsRequest) - private static final com.google.showcase.v1beta1.ListBlurbsRequest DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new com.google.showcase.v1beta1.ListBlurbsRequest(); - } - - public static com.google.showcase.v1beta1.ListBlurbsRequest getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public ListBlurbsRequest parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new ListBlurbsRequest(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public com.google.showcase.v1beta1.ListBlurbsRequest getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListBlurbsRequestOrBuilder.java b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListBlurbsRequestOrBuilder.java deleted file mode 100644 index 4333751fab..0000000000 --- a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListBlurbsRequestOrBuilder.java +++ /dev/null @@ -1,65 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: schema/google/showcase/v1beta1/messaging.proto - -package com.google.showcase.v1beta1; - -public interface ListBlurbsRequestOrBuilder extends - // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.ListBlurbsRequest) - com.google.protobuf.MessageOrBuilder { - - /** - *
        -   * The resource name of the requested room or profile whos blurbs to list.
        -   * 
        - * - * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * @return The parent. - */ - java.lang.String getParent(); - /** - *
        -   * The resource name of the requested room or profile whos blurbs to list.
        -   * 
        - * - * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * @return The bytes for parent. - */ - com.google.protobuf.ByteString - getParentBytes(); - - /** - *
        -   * The maximum number of blurbs to return. Server may return fewer
        -   * blurbs than requested. If unspecified, server will pick an appropriate
        -   * default.
        -   * 
        - * - * int32 page_size = 2; - * @return The pageSize. - */ - int getPageSize(); - - /** - *
        -   * The value of google.showcase.v1beta1.ListBlurbsResponse.next_page_token
        -   * returned from the previous call to
        -   * `google.showcase.v1beta1.Messaging\ListBlurbs` method.
        -   * 
        - * - * string page_token = 3; - * @return The pageToken. - */ - java.lang.String getPageToken(); - /** - *
        -   * The value of google.showcase.v1beta1.ListBlurbsResponse.next_page_token
        -   * returned from the previous call to
        -   * `google.showcase.v1beta1.Messaging\ListBlurbs` method.
        -   * 
        - * - * string page_token = 3; - * @return The bytes for pageToken. - */ - com.google.protobuf.ByteString - getPageTokenBytes(); -} diff --git a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListBlurbsResponse.java b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListBlurbsResponse.java deleted file mode 100644 index 65e8c54f4b..0000000000 --- a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListBlurbsResponse.java +++ /dev/null @@ -1,1061 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: schema/google/showcase/v1beta1/messaging.proto - -package com.google.showcase.v1beta1; - -/** - *
        - * The response message for the google.showcase.v1beta1.Messaging\ListBlurbs
        - * method.
        - * 
        - * - * Protobuf type {@code google.showcase.v1beta1.ListBlurbsResponse} - */ -public final class ListBlurbsResponse extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.ListBlurbsResponse) - ListBlurbsResponseOrBuilder { -private static final long serialVersionUID = 0L; - // Use ListBlurbsResponse.newBuilder() to construct. - private ListBlurbsResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private ListBlurbsResponse() { - blurbs_ = java.util.Collections.emptyList(); - nextPageToken_ = ""; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new ListBlurbsResponse(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private ListBlurbsResponse( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - int mutable_bitField0_ = 0; - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: { - if (!((mutable_bitField0_ & 0x00000001) != 0)) { - blurbs_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000001; - } - blurbs_.add( - input.readMessage(com.google.showcase.v1beta1.Blurb.parser(), extensionRegistry)); - break; - } - case 18: { - java.lang.String s = input.readStringRequireUtf8(); - - nextPageToken_ = s; - break; - } - default: { - if (!parseUnknownField( - input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException( - e).setUnfinishedMessage(this); - } finally { - if (((mutable_bitField0_ & 0x00000001) != 0)) { - blurbs_ = java.util.Collections.unmodifiableList(blurbs_); - } - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.google.showcase.v1beta1.MessagingOuterClass.internal_static_google_showcase_v1beta1_ListBlurbsResponse_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.showcase.v1beta1.MessagingOuterClass.internal_static_google_showcase_v1beta1_ListBlurbsResponse_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.showcase.v1beta1.ListBlurbsResponse.class, com.google.showcase.v1beta1.ListBlurbsResponse.Builder.class); - } - - public static final int BLURBS_FIELD_NUMBER = 1; - private java.util.List blurbs_; - /** - *
        -   * The list of blurbs.
        -   * 
        - * - * repeated .google.showcase.v1beta1.Blurb blurbs = 1; - */ - @java.lang.Override - public java.util.List getBlurbsList() { - return blurbs_; - } - /** - *
        -   * The list of blurbs.
        -   * 
        - * - * repeated .google.showcase.v1beta1.Blurb blurbs = 1; - */ - @java.lang.Override - public java.util.List - getBlurbsOrBuilderList() { - return blurbs_; - } - /** - *
        -   * The list of blurbs.
        -   * 
        - * - * repeated .google.showcase.v1beta1.Blurb blurbs = 1; - */ - @java.lang.Override - public int getBlurbsCount() { - return blurbs_.size(); - } - /** - *
        -   * The list of blurbs.
        -   * 
        - * - * repeated .google.showcase.v1beta1.Blurb blurbs = 1; - */ - @java.lang.Override - public com.google.showcase.v1beta1.Blurb getBlurbs(int index) { - return blurbs_.get(index); - } - /** - *
        -   * The list of blurbs.
        -   * 
        - * - * repeated .google.showcase.v1beta1.Blurb blurbs = 1; - */ - @java.lang.Override - public com.google.showcase.v1beta1.BlurbOrBuilder getBlurbsOrBuilder( - int index) { - return blurbs_.get(index); - } - - public static final int NEXT_PAGE_TOKEN_FIELD_NUMBER = 2; - private volatile java.lang.Object nextPageToken_; - /** - *
        -   * A token to retrieve next page of results.
        -   * Pass this value in ListBlurbsRequest.page_token field in the subsequent
        -   * call to `google.showcase.v1beta1.Blurb\ListBlurbs` method to retrieve
        -   * the next page of results.
        -   * 
        - * - * string next_page_token = 2; - * @return The nextPageToken. - */ - @java.lang.Override - public java.lang.String getNextPageToken() { - java.lang.Object ref = nextPageToken_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - nextPageToken_ = s; - return s; - } - } - /** - *
        -   * A token to retrieve next page of results.
        -   * Pass this value in ListBlurbsRequest.page_token field in the subsequent
        -   * call to `google.showcase.v1beta1.Blurb\ListBlurbs` method to retrieve
        -   * the next page of results.
        -   * 
        - * - * string next_page_token = 2; - * @return The bytes for nextPageToken. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getNextPageTokenBytes() { - java.lang.Object ref = nextPageToken_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - nextPageToken_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - private byte memoizedIsInitialized = -1; - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - for (int i = 0; i < blurbs_.size(); i++) { - output.writeMessage(1, blurbs_.get(i)); - } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nextPageToken_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 2, nextPageToken_); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - for (int i = 0; i < blurbs_.size(); i++) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(1, blurbs_.get(i)); - } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nextPageToken_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, nextPageToken_); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof com.google.showcase.v1beta1.ListBlurbsResponse)) { - return super.equals(obj); - } - com.google.showcase.v1beta1.ListBlurbsResponse other = (com.google.showcase.v1beta1.ListBlurbsResponse) obj; - - if (!getBlurbsList() - .equals(other.getBlurbsList())) return false; - if (!getNextPageToken() - .equals(other.getNextPageToken())) return false; - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - if (getBlurbsCount() > 0) { - hash = (37 * hash) + BLURBS_FIELD_NUMBER; - hash = (53 * hash) + getBlurbsList().hashCode(); - } - hash = (37 * hash) + NEXT_PAGE_TOKEN_FIELD_NUMBER; - hash = (53 * hash) + getNextPageToken().hashCode(); - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.showcase.v1beta1.ListBlurbsResponse parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.showcase.v1beta1.ListBlurbsResponse parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.showcase.v1beta1.ListBlurbsResponse parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.showcase.v1beta1.ListBlurbsResponse 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.showcase.v1beta1.ListBlurbsResponse parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.showcase.v1beta1.ListBlurbsResponse parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.showcase.v1beta1.ListBlurbsResponse parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static com.google.showcase.v1beta1.ListBlurbsResponse 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.showcase.v1beta1.ListBlurbsResponse parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static com.google.showcase.v1beta1.ListBlurbsResponse 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.showcase.v1beta1.ListBlurbsResponse parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static com.google.showcase.v1beta1.ListBlurbsResponse 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.showcase.v1beta1.ListBlurbsResponse 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 message for the google.showcase.v1beta1.Messaging\ListBlurbs
        -   * method.
        -   * 
        - * - * Protobuf type {@code google.showcase.v1beta1.ListBlurbsResponse} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.ListBlurbsResponse) - com.google.showcase.v1beta1.ListBlurbsResponseOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.google.showcase.v1beta1.MessagingOuterClass.internal_static_google_showcase_v1beta1_ListBlurbsResponse_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.showcase.v1beta1.MessagingOuterClass.internal_static_google_showcase_v1beta1_ListBlurbsResponse_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.showcase.v1beta1.ListBlurbsResponse.class, com.google.showcase.v1beta1.ListBlurbsResponse.Builder.class); - } - - // Construct using com.google.showcase.v1beta1.ListBlurbsResponse.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { - getBlurbsFieldBuilder(); - } - } - @java.lang.Override - public Builder clear() { - super.clear(); - if (blurbsBuilder_ == null) { - blurbs_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - } else { - blurbsBuilder_.clear(); - } - nextPageToken_ = ""; - - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return com.google.showcase.v1beta1.MessagingOuterClass.internal_static_google_showcase_v1beta1_ListBlurbsResponse_descriptor; - } - - @java.lang.Override - public com.google.showcase.v1beta1.ListBlurbsResponse getDefaultInstanceForType() { - return com.google.showcase.v1beta1.ListBlurbsResponse.getDefaultInstance(); - } - - @java.lang.Override - public com.google.showcase.v1beta1.ListBlurbsResponse build() { - com.google.showcase.v1beta1.ListBlurbsResponse result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.showcase.v1beta1.ListBlurbsResponse buildPartial() { - com.google.showcase.v1beta1.ListBlurbsResponse result = new com.google.showcase.v1beta1.ListBlurbsResponse(this); - int from_bitField0_ = bitField0_; - if (blurbsBuilder_ == null) { - if (((bitField0_ & 0x00000001) != 0)) { - blurbs_ = java.util.Collections.unmodifiableList(blurbs_); - bitField0_ = (bitField0_ & ~0x00000001); - } - result.blurbs_ = blurbs_; - } else { - result.blurbs_ = blurbsBuilder_.build(); - } - result.nextPageToken_ = nextPageToken_; - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.setField(field, value); - } - @java.lang.Override - public Builder clearField( - com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - @java.lang.Override - public Builder clearOneof( - com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.addRepeatedField(field, value); - } - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof com.google.showcase.v1beta1.ListBlurbsResponse) { - return mergeFrom((com.google.showcase.v1beta1.ListBlurbsResponse)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.showcase.v1beta1.ListBlurbsResponse other) { - if (other == com.google.showcase.v1beta1.ListBlurbsResponse.getDefaultInstance()) return this; - if (blurbsBuilder_ == null) { - if (!other.blurbs_.isEmpty()) { - if (blurbs_.isEmpty()) { - blurbs_ = other.blurbs_; - bitField0_ = (bitField0_ & ~0x00000001); - } else { - ensureBlurbsIsMutable(); - blurbs_.addAll(other.blurbs_); - } - onChanged(); - } - } else { - if (!other.blurbs_.isEmpty()) { - if (blurbsBuilder_.isEmpty()) { - blurbsBuilder_.dispose(); - blurbsBuilder_ = null; - blurbs_ = other.blurbs_; - bitField0_ = (bitField0_ & ~0x00000001); - blurbsBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? - getBlurbsFieldBuilder() : null; - } else { - blurbsBuilder_.addAllMessages(other.blurbs_); - } - } - } - if (!other.getNextPageToken().isEmpty()) { - nextPageToken_ = other.nextPageToken_; - onChanged(); - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - com.google.showcase.v1beta1.ListBlurbsResponse parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (com.google.showcase.v1beta1.ListBlurbsResponse) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - private int bitField0_; - - private java.util.List blurbs_ = - java.util.Collections.emptyList(); - private void ensureBlurbsIsMutable() { - if (!((bitField0_ & 0x00000001) != 0)) { - blurbs_ = new java.util.ArrayList(blurbs_); - bitField0_ |= 0x00000001; - } - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - com.google.showcase.v1beta1.Blurb, com.google.showcase.v1beta1.Blurb.Builder, com.google.showcase.v1beta1.BlurbOrBuilder> blurbsBuilder_; - - /** - *
        -     * The list of blurbs.
        -     * 
        - * - * repeated .google.showcase.v1beta1.Blurb blurbs = 1; - */ - public java.util.List getBlurbsList() { - if (blurbsBuilder_ == null) { - return java.util.Collections.unmodifiableList(blurbs_); - } else { - return blurbsBuilder_.getMessageList(); - } - } - /** - *
        -     * The list of blurbs.
        -     * 
        - * - * repeated .google.showcase.v1beta1.Blurb blurbs = 1; - */ - public int getBlurbsCount() { - if (blurbsBuilder_ == null) { - return blurbs_.size(); - } else { - return blurbsBuilder_.getCount(); - } - } - /** - *
        -     * The list of blurbs.
        -     * 
        - * - * repeated .google.showcase.v1beta1.Blurb blurbs = 1; - */ - public com.google.showcase.v1beta1.Blurb getBlurbs(int index) { - if (blurbsBuilder_ == null) { - return blurbs_.get(index); - } else { - return blurbsBuilder_.getMessage(index); - } - } - /** - *
        -     * The list of blurbs.
        -     * 
        - * - * repeated .google.showcase.v1beta1.Blurb blurbs = 1; - */ - public Builder setBlurbs( - int index, com.google.showcase.v1beta1.Blurb value) { - if (blurbsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureBlurbsIsMutable(); - blurbs_.set(index, value); - onChanged(); - } else { - blurbsBuilder_.setMessage(index, value); - } - return this; - } - /** - *
        -     * The list of blurbs.
        -     * 
        - * - * repeated .google.showcase.v1beta1.Blurb blurbs = 1; - */ - public Builder setBlurbs( - int index, com.google.showcase.v1beta1.Blurb.Builder builderForValue) { - if (blurbsBuilder_ == null) { - ensureBlurbsIsMutable(); - blurbs_.set(index, builderForValue.build()); - onChanged(); - } else { - blurbsBuilder_.setMessage(index, builderForValue.build()); - } - return this; - } - /** - *
        -     * The list of blurbs.
        -     * 
        - * - * repeated .google.showcase.v1beta1.Blurb blurbs = 1; - */ - public Builder addBlurbs(com.google.showcase.v1beta1.Blurb value) { - if (blurbsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureBlurbsIsMutable(); - blurbs_.add(value); - onChanged(); - } else { - blurbsBuilder_.addMessage(value); - } - return this; - } - /** - *
        -     * The list of blurbs.
        -     * 
        - * - * repeated .google.showcase.v1beta1.Blurb blurbs = 1; - */ - public Builder addBlurbs( - int index, com.google.showcase.v1beta1.Blurb value) { - if (blurbsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureBlurbsIsMutable(); - blurbs_.add(index, value); - onChanged(); - } else { - blurbsBuilder_.addMessage(index, value); - } - return this; - } - /** - *
        -     * The list of blurbs.
        -     * 
        - * - * repeated .google.showcase.v1beta1.Blurb blurbs = 1; - */ - public Builder addBlurbs( - com.google.showcase.v1beta1.Blurb.Builder builderForValue) { - if (blurbsBuilder_ == null) { - ensureBlurbsIsMutable(); - blurbs_.add(builderForValue.build()); - onChanged(); - } else { - blurbsBuilder_.addMessage(builderForValue.build()); - } - return this; - } - /** - *
        -     * The list of blurbs.
        -     * 
        - * - * repeated .google.showcase.v1beta1.Blurb blurbs = 1; - */ - public Builder addBlurbs( - int index, com.google.showcase.v1beta1.Blurb.Builder builderForValue) { - if (blurbsBuilder_ == null) { - ensureBlurbsIsMutable(); - blurbs_.add(index, builderForValue.build()); - onChanged(); - } else { - blurbsBuilder_.addMessage(index, builderForValue.build()); - } - return this; - } - /** - *
        -     * The list of blurbs.
        -     * 
        - * - * repeated .google.showcase.v1beta1.Blurb blurbs = 1; - */ - public Builder addAllBlurbs( - java.lang.Iterable values) { - if (blurbsBuilder_ == null) { - ensureBlurbsIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, blurbs_); - onChanged(); - } else { - blurbsBuilder_.addAllMessages(values); - } - return this; - } - /** - *
        -     * The list of blurbs.
        -     * 
        - * - * repeated .google.showcase.v1beta1.Blurb blurbs = 1; - */ - public Builder clearBlurbs() { - if (blurbsBuilder_ == null) { - blurbs_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - onChanged(); - } else { - blurbsBuilder_.clear(); - } - return this; - } - /** - *
        -     * The list of blurbs.
        -     * 
        - * - * repeated .google.showcase.v1beta1.Blurb blurbs = 1; - */ - public Builder removeBlurbs(int index) { - if (blurbsBuilder_ == null) { - ensureBlurbsIsMutable(); - blurbs_.remove(index); - onChanged(); - } else { - blurbsBuilder_.remove(index); - } - return this; - } - /** - *
        -     * The list of blurbs.
        -     * 
        - * - * repeated .google.showcase.v1beta1.Blurb blurbs = 1; - */ - public com.google.showcase.v1beta1.Blurb.Builder getBlurbsBuilder( - int index) { - return getBlurbsFieldBuilder().getBuilder(index); - } - /** - *
        -     * The list of blurbs.
        -     * 
        - * - * repeated .google.showcase.v1beta1.Blurb blurbs = 1; - */ - public com.google.showcase.v1beta1.BlurbOrBuilder getBlurbsOrBuilder( - int index) { - if (blurbsBuilder_ == null) { - return blurbs_.get(index); } else { - return blurbsBuilder_.getMessageOrBuilder(index); - } - } - /** - *
        -     * The list of blurbs.
        -     * 
        - * - * repeated .google.showcase.v1beta1.Blurb blurbs = 1; - */ - public java.util.List - getBlurbsOrBuilderList() { - if (blurbsBuilder_ != null) { - return blurbsBuilder_.getMessageOrBuilderList(); - } else { - return java.util.Collections.unmodifiableList(blurbs_); - } - } - /** - *
        -     * The list of blurbs.
        -     * 
        - * - * repeated .google.showcase.v1beta1.Blurb blurbs = 1; - */ - public com.google.showcase.v1beta1.Blurb.Builder addBlurbsBuilder() { - return getBlurbsFieldBuilder().addBuilder( - com.google.showcase.v1beta1.Blurb.getDefaultInstance()); - } - /** - *
        -     * The list of blurbs.
        -     * 
        - * - * repeated .google.showcase.v1beta1.Blurb blurbs = 1; - */ - public com.google.showcase.v1beta1.Blurb.Builder addBlurbsBuilder( - int index) { - return getBlurbsFieldBuilder().addBuilder( - index, com.google.showcase.v1beta1.Blurb.getDefaultInstance()); - } - /** - *
        -     * The list of blurbs.
        -     * 
        - * - * repeated .google.showcase.v1beta1.Blurb blurbs = 1; - */ - public java.util.List - getBlurbsBuilderList() { - return getBlurbsFieldBuilder().getBuilderList(); - } - private com.google.protobuf.RepeatedFieldBuilderV3< - com.google.showcase.v1beta1.Blurb, com.google.showcase.v1beta1.Blurb.Builder, com.google.showcase.v1beta1.BlurbOrBuilder> - getBlurbsFieldBuilder() { - if (blurbsBuilder_ == null) { - blurbsBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< - com.google.showcase.v1beta1.Blurb, com.google.showcase.v1beta1.Blurb.Builder, com.google.showcase.v1beta1.BlurbOrBuilder>( - blurbs_, - ((bitField0_ & 0x00000001) != 0), - getParentForChildren(), - isClean()); - blurbs_ = null; - } - return blurbsBuilder_; - } - - private java.lang.Object nextPageToken_ = ""; - /** - *
        -     * A token to retrieve next page of results.
        -     * Pass this value in ListBlurbsRequest.page_token field in the subsequent
        -     * call to `google.showcase.v1beta1.Blurb\ListBlurbs` method to retrieve
        -     * the next page of results.
        -     * 
        - * - * string next_page_token = 2; - * @return The nextPageToken. - */ - public java.lang.String getNextPageToken() { - java.lang.Object ref = nextPageToken_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - nextPageToken_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - *
        -     * A token to retrieve next page of results.
        -     * Pass this value in ListBlurbsRequest.page_token field in the subsequent
        -     * call to `google.showcase.v1beta1.Blurb\ListBlurbs` method to retrieve
        -     * the next page of results.
        -     * 
        - * - * string next_page_token = 2; - * @return The bytes for nextPageToken. - */ - public com.google.protobuf.ByteString - getNextPageTokenBytes() { - java.lang.Object ref = nextPageToken_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - nextPageToken_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - *
        -     * A token to retrieve next page of results.
        -     * Pass this value in ListBlurbsRequest.page_token field in the subsequent
        -     * call to `google.showcase.v1beta1.Blurb\ListBlurbs` method to retrieve
        -     * the next page of results.
        -     * 
        - * - * string next_page_token = 2; - * @param value The nextPageToken to set. - * @return This builder for chaining. - */ - public Builder setNextPageToken( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - nextPageToken_ = value; - onChanged(); - return this; - } - /** - *
        -     * A token to retrieve next page of results.
        -     * Pass this value in ListBlurbsRequest.page_token field in the subsequent
        -     * call to `google.showcase.v1beta1.Blurb\ListBlurbs` method to retrieve
        -     * the next page of results.
        -     * 
        - * - * string next_page_token = 2; - * @return This builder for chaining. - */ - public Builder clearNextPageToken() { - - nextPageToken_ = getDefaultInstance().getNextPageToken(); - onChanged(); - return this; - } - /** - *
        -     * A token to retrieve next page of results.
        -     * Pass this value in ListBlurbsRequest.page_token field in the subsequent
        -     * call to `google.showcase.v1beta1.Blurb\ListBlurbs` method to retrieve
        -     * the next page of results.
        -     * 
        - * - * string next_page_token = 2; - * @param value The bytes for nextPageToken to set. - * @return This builder for chaining. - */ - public Builder setNextPageTokenBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - nextPageToken_ = value; - onChanged(); - return this; - } - @java.lang.Override - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - - // @@protoc_insertion_point(builder_scope:google.showcase.v1beta1.ListBlurbsResponse) - } - - // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.ListBlurbsResponse) - private static final com.google.showcase.v1beta1.ListBlurbsResponse DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new com.google.showcase.v1beta1.ListBlurbsResponse(); - } - - public static com.google.showcase.v1beta1.ListBlurbsResponse getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public ListBlurbsResponse parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new ListBlurbsResponse(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public com.google.showcase.v1beta1.ListBlurbsResponse getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListBlurbsResponseOrBuilder.java b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListBlurbsResponseOrBuilder.java deleted file mode 100644 index 45fe6f1c9f..0000000000 --- a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListBlurbsResponseOrBuilder.java +++ /dev/null @@ -1,79 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: schema/google/showcase/v1beta1/messaging.proto - -package com.google.showcase.v1beta1; - -public interface ListBlurbsResponseOrBuilder extends - // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.ListBlurbsResponse) - com.google.protobuf.MessageOrBuilder { - - /** - *
        -   * The list of blurbs.
        -   * 
        - * - * repeated .google.showcase.v1beta1.Blurb blurbs = 1; - */ - java.util.List - getBlurbsList(); - /** - *
        -   * The list of blurbs.
        -   * 
        - * - * repeated .google.showcase.v1beta1.Blurb blurbs = 1; - */ - com.google.showcase.v1beta1.Blurb getBlurbs(int index); - /** - *
        -   * The list of blurbs.
        -   * 
        - * - * repeated .google.showcase.v1beta1.Blurb blurbs = 1; - */ - int getBlurbsCount(); - /** - *
        -   * The list of blurbs.
        -   * 
        - * - * repeated .google.showcase.v1beta1.Blurb blurbs = 1; - */ - java.util.List - getBlurbsOrBuilderList(); - /** - *
        -   * The list of blurbs.
        -   * 
        - * - * repeated .google.showcase.v1beta1.Blurb blurbs = 1; - */ - com.google.showcase.v1beta1.BlurbOrBuilder getBlurbsOrBuilder( - int index); - - /** - *
        -   * A token to retrieve next page of results.
        -   * Pass this value in ListBlurbsRequest.page_token field in the subsequent
        -   * call to `google.showcase.v1beta1.Blurb\ListBlurbs` method to retrieve
        -   * the next page of results.
        -   * 
        - * - * string next_page_token = 2; - * @return The nextPageToken. - */ - java.lang.String getNextPageToken(); - /** - *
        -   * A token to retrieve next page of results.
        -   * Pass this value in ListBlurbsRequest.page_token field in the subsequent
        -   * call to `google.showcase.v1beta1.Blurb\ListBlurbs` method to retrieve
        -   * the next page of results.
        -   * 
        - * - * string next_page_token = 2; - * @return The bytes for nextPageToken. - */ - com.google.protobuf.ByteString - getNextPageTokenBytes(); -} diff --git a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListRoomsRequest.java b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListRoomsRequest.java deleted file mode 100644 index 379feac0dc..0000000000 --- a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListRoomsRequest.java +++ /dev/null @@ -1,695 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: schema/google/showcase/v1beta1/messaging.proto - -package com.google.showcase.v1beta1; - -/** - *
        - * The request message for the google.showcase.v1beta1.Messaging\ListRooms
        - * method.
        - * 
        - * - * Protobuf type {@code google.showcase.v1beta1.ListRoomsRequest} - */ -public final class ListRoomsRequest extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.ListRoomsRequest) - ListRoomsRequestOrBuilder { -private static final long serialVersionUID = 0L; - // Use ListRoomsRequest.newBuilder() to construct. - private ListRoomsRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private ListRoomsRequest() { - pageToken_ = ""; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new ListRoomsRequest(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private ListRoomsRequest( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 8: { - - pageSize_ = input.readInt32(); - break; - } - case 18: { - java.lang.String s = input.readStringRequireUtf8(); - - pageToken_ = s; - break; - } - default: { - if (!parseUnknownField( - input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException( - e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.google.showcase.v1beta1.MessagingOuterClass.internal_static_google_showcase_v1beta1_ListRoomsRequest_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.showcase.v1beta1.MessagingOuterClass.internal_static_google_showcase_v1beta1_ListRoomsRequest_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.showcase.v1beta1.ListRoomsRequest.class, com.google.showcase.v1beta1.ListRoomsRequest.Builder.class); - } - - public static final int PAGE_SIZE_FIELD_NUMBER = 1; - private int pageSize_; - /** - *
        -   * The maximum number of rooms return. Server may return fewer rooms
        -   * than requested. If unspecified, server will pick an appropriate default.
        -   * 
        - * - * int32 page_size = 1; - * @return The pageSize. - */ - @java.lang.Override - public int getPageSize() { - return pageSize_; - } - - public static final int PAGE_TOKEN_FIELD_NUMBER = 2; - private volatile java.lang.Object pageToken_; - /** - *
        -   * The value of google.showcase.v1beta1.ListRoomsResponse.next_page_token
        -   * returned from the previous call to
        -   * `google.showcase.v1beta1.Messaging\ListRooms` method.
        -   * 
        - * - * string page_token = 2; - * @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; - } - } - /** - *
        -   * The value of google.showcase.v1beta1.ListRoomsResponse.next_page_token
        -   * returned from the previous call to
        -   * `google.showcase.v1beta1.Messaging\ListRooms` method.
        -   * 
        - * - * string page_token = 2; - * @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_); - } - unknownFields.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 += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof com.google.showcase.v1beta1.ListRoomsRequest)) { - return super.equals(obj); - } - com.google.showcase.v1beta1.ListRoomsRequest other = (com.google.showcase.v1beta1.ListRoomsRequest) obj; - - if (getPageSize() - != other.getPageSize()) return false; - if (!getPageToken() - .equals(other.getPageToken())) return false; - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - hash = (37 * hash) + PAGE_SIZE_FIELD_NUMBER; - hash = (53 * hash) + getPageSize(); - hash = (37 * hash) + PAGE_TOKEN_FIELD_NUMBER; - hash = (53 * hash) + getPageToken().hashCode(); - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.showcase.v1beta1.ListRoomsRequest parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.showcase.v1beta1.ListRoomsRequest parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.showcase.v1beta1.ListRoomsRequest parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.showcase.v1beta1.ListRoomsRequest 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.showcase.v1beta1.ListRoomsRequest parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.showcase.v1beta1.ListRoomsRequest parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.showcase.v1beta1.ListRoomsRequest parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static com.google.showcase.v1beta1.ListRoomsRequest 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.showcase.v1beta1.ListRoomsRequest parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static com.google.showcase.v1beta1.ListRoomsRequest 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.showcase.v1beta1.ListRoomsRequest parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static com.google.showcase.v1beta1.ListRoomsRequest 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.showcase.v1beta1.ListRoomsRequest 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 request message for the google.showcase.v1beta1.Messaging\ListRooms
        -   * method.
        -   * 
        - * - * Protobuf type {@code google.showcase.v1beta1.ListRoomsRequest} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.ListRoomsRequest) - com.google.showcase.v1beta1.ListRoomsRequestOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.google.showcase.v1beta1.MessagingOuterClass.internal_static_google_showcase_v1beta1_ListRoomsRequest_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.showcase.v1beta1.MessagingOuterClass.internal_static_google_showcase_v1beta1_ListRoomsRequest_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.showcase.v1beta1.ListRoomsRequest.class, com.google.showcase.v1beta1.ListRoomsRequest.Builder.class); - } - - // Construct using com.google.showcase.v1beta1.ListRoomsRequest.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { - } - } - @java.lang.Override - public Builder clear() { - super.clear(); - pageSize_ = 0; - - pageToken_ = ""; - - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return com.google.showcase.v1beta1.MessagingOuterClass.internal_static_google_showcase_v1beta1_ListRoomsRequest_descriptor; - } - - @java.lang.Override - public com.google.showcase.v1beta1.ListRoomsRequest getDefaultInstanceForType() { - return com.google.showcase.v1beta1.ListRoomsRequest.getDefaultInstance(); - } - - @java.lang.Override - public com.google.showcase.v1beta1.ListRoomsRequest build() { - com.google.showcase.v1beta1.ListRoomsRequest result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.showcase.v1beta1.ListRoomsRequest buildPartial() { - com.google.showcase.v1beta1.ListRoomsRequest result = new com.google.showcase.v1beta1.ListRoomsRequest(this); - result.pageSize_ = pageSize_; - result.pageToken_ = pageToken_; - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.setField(field, value); - } - @java.lang.Override - public Builder clearField( - com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - @java.lang.Override - public Builder clearOneof( - com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.addRepeatedField(field, value); - } - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof com.google.showcase.v1beta1.ListRoomsRequest) { - return mergeFrom((com.google.showcase.v1beta1.ListRoomsRequest)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.showcase.v1beta1.ListRoomsRequest other) { - if (other == com.google.showcase.v1beta1.ListRoomsRequest.getDefaultInstance()) return this; - if (other.getPageSize() != 0) { - setPageSize(other.getPageSize()); - } - if (!other.getPageToken().isEmpty()) { - pageToken_ = other.pageToken_; - onChanged(); - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - com.google.showcase.v1beta1.ListRoomsRequest parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (com.google.showcase.v1beta1.ListRoomsRequest) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private int pageSize_ ; - /** - *
        -     * The maximum number of rooms return. Server may return fewer rooms
        -     * than requested. If unspecified, server will pick an appropriate default.
        -     * 
        - * - * int32 page_size = 1; - * @return The pageSize. - */ - @java.lang.Override - public int getPageSize() { - return pageSize_; - } - /** - *
        -     * The maximum number of rooms return. Server may return fewer rooms
        -     * than requested. If unspecified, server will pick an appropriate default.
        -     * 
        - * - * int32 page_size = 1; - * @param value The pageSize to set. - * @return This builder for chaining. - */ - public Builder setPageSize(int value) { - - pageSize_ = value; - onChanged(); - return this; - } - /** - *
        -     * The maximum number of rooms return. Server may return fewer rooms
        -     * than requested. If unspecified, server will pick an appropriate default.
        -     * 
        - * - * int32 page_size = 1; - * @return This builder for chaining. - */ - public Builder clearPageSize() { - - pageSize_ = 0; - onChanged(); - return this; - } - - private java.lang.Object pageToken_ = ""; - /** - *
        -     * The value of google.showcase.v1beta1.ListRoomsResponse.next_page_token
        -     * returned from the previous call to
        -     * `google.showcase.v1beta1.Messaging\ListRooms` method.
        -     * 
        - * - * string page_token = 2; - * @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; - } - } - /** - *
        -     * The value of google.showcase.v1beta1.ListRoomsResponse.next_page_token
        -     * returned from the previous call to
        -     * `google.showcase.v1beta1.Messaging\ListRooms` method.
        -     * 
        - * - * string page_token = 2; - * @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; - } - } - /** - *
        -     * The value of google.showcase.v1beta1.ListRoomsResponse.next_page_token
        -     * returned from the previous call to
        -     * `google.showcase.v1beta1.Messaging\ListRooms` method.
        -     * 
        - * - * string page_token = 2; - * @param value The pageToken to set. - * @return This builder for chaining. - */ - public Builder setPageToken( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - pageToken_ = value; - onChanged(); - return this; - } - /** - *
        -     * The value of google.showcase.v1beta1.ListRoomsResponse.next_page_token
        -     * returned from the previous call to
        -     * `google.showcase.v1beta1.Messaging\ListRooms` method.
        -     * 
        - * - * string page_token = 2; - * @return This builder for chaining. - */ - public Builder clearPageToken() { - - pageToken_ = getDefaultInstance().getPageToken(); - onChanged(); - return this; - } - /** - *
        -     * The value of google.showcase.v1beta1.ListRoomsResponse.next_page_token
        -     * returned from the previous call to
        -     * `google.showcase.v1beta1.Messaging\ListRooms` method.
        -     * 
        - * - * string page_token = 2; - * @param value The bytes for pageToken to set. - * @return This builder for chaining. - */ - public Builder setPageTokenBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - pageToken_ = value; - onChanged(); - return this; - } - @java.lang.Override - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - - // @@protoc_insertion_point(builder_scope:google.showcase.v1beta1.ListRoomsRequest) - } - - // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.ListRoomsRequest) - private static final com.google.showcase.v1beta1.ListRoomsRequest DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new com.google.showcase.v1beta1.ListRoomsRequest(); - } - - public static com.google.showcase.v1beta1.ListRoomsRequest getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public ListRoomsRequest parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new ListRoomsRequest(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public com.google.showcase.v1beta1.ListRoomsRequest getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListRoomsRequestOrBuilder.java b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListRoomsRequestOrBuilder.java deleted file mode 100644 index b385d4e3bc..0000000000 --- a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListRoomsRequestOrBuilder.java +++ /dev/null @@ -1,44 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: schema/google/showcase/v1beta1/messaging.proto - -package com.google.showcase.v1beta1; - -public interface ListRoomsRequestOrBuilder extends - // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.ListRoomsRequest) - com.google.protobuf.MessageOrBuilder { - - /** - *
        -   * The maximum number of rooms return. Server may return fewer rooms
        -   * than requested. If unspecified, server will pick an appropriate default.
        -   * 
        - * - * int32 page_size = 1; - * @return The pageSize. - */ - int getPageSize(); - - /** - *
        -   * The value of google.showcase.v1beta1.ListRoomsResponse.next_page_token
        -   * returned from the previous call to
        -   * `google.showcase.v1beta1.Messaging\ListRooms` method.
        -   * 
        - * - * string page_token = 2; - * @return The pageToken. - */ - java.lang.String getPageToken(); - /** - *
        -   * The value of google.showcase.v1beta1.ListRoomsResponse.next_page_token
        -   * returned from the previous call to
        -   * `google.showcase.v1beta1.Messaging\ListRooms` method.
        -   * 
        - * - * string page_token = 2; - * @return The bytes for pageToken. - */ - com.google.protobuf.ByteString - getPageTokenBytes(); -} diff --git a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListRoomsResponse.java b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListRoomsResponse.java deleted file mode 100644 index 647fdcf143..0000000000 --- a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListRoomsResponse.java +++ /dev/null @@ -1,1061 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: schema/google/showcase/v1beta1/messaging.proto - -package com.google.showcase.v1beta1; - -/** - *
        - * The response message for the google.showcase.v1beta1.Messaging\ListRooms
        - * method.
        - * 
        - * - * Protobuf type {@code google.showcase.v1beta1.ListRoomsResponse} - */ -public final class ListRoomsResponse extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.ListRoomsResponse) - ListRoomsResponseOrBuilder { -private static final long serialVersionUID = 0L; - // Use ListRoomsResponse.newBuilder() to construct. - private ListRoomsResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private ListRoomsResponse() { - rooms_ = java.util.Collections.emptyList(); - nextPageToken_ = ""; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new ListRoomsResponse(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private ListRoomsResponse( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - int mutable_bitField0_ = 0; - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: { - if (!((mutable_bitField0_ & 0x00000001) != 0)) { - rooms_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000001; - } - rooms_.add( - input.readMessage(com.google.showcase.v1beta1.Room.parser(), extensionRegistry)); - break; - } - case 18: { - java.lang.String s = input.readStringRequireUtf8(); - - nextPageToken_ = s; - break; - } - default: { - if (!parseUnknownField( - input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException( - e).setUnfinishedMessage(this); - } finally { - if (((mutable_bitField0_ & 0x00000001) != 0)) { - rooms_ = java.util.Collections.unmodifiableList(rooms_); - } - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.google.showcase.v1beta1.MessagingOuterClass.internal_static_google_showcase_v1beta1_ListRoomsResponse_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.showcase.v1beta1.MessagingOuterClass.internal_static_google_showcase_v1beta1_ListRoomsResponse_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.showcase.v1beta1.ListRoomsResponse.class, com.google.showcase.v1beta1.ListRoomsResponse.Builder.class); - } - - public static final int ROOMS_FIELD_NUMBER = 1; - private java.util.List rooms_; - /** - *
        -   * The list of rooms.
        -   * 
        - * - * repeated .google.showcase.v1beta1.Room rooms = 1; - */ - @java.lang.Override - public java.util.List getRoomsList() { - return rooms_; - } - /** - *
        -   * The list of rooms.
        -   * 
        - * - * repeated .google.showcase.v1beta1.Room rooms = 1; - */ - @java.lang.Override - public java.util.List - getRoomsOrBuilderList() { - return rooms_; - } - /** - *
        -   * The list of rooms.
        -   * 
        - * - * repeated .google.showcase.v1beta1.Room rooms = 1; - */ - @java.lang.Override - public int getRoomsCount() { - return rooms_.size(); - } - /** - *
        -   * The list of rooms.
        -   * 
        - * - * repeated .google.showcase.v1beta1.Room rooms = 1; - */ - @java.lang.Override - public com.google.showcase.v1beta1.Room getRooms(int index) { - return rooms_.get(index); - } - /** - *
        -   * The list of rooms.
        -   * 
        - * - * repeated .google.showcase.v1beta1.Room rooms = 1; - */ - @java.lang.Override - public com.google.showcase.v1beta1.RoomOrBuilder getRoomsOrBuilder( - int index) { - return rooms_.get(index); - } - - public static final int NEXT_PAGE_TOKEN_FIELD_NUMBER = 2; - private volatile java.lang.Object nextPageToken_; - /** - *
        -   * A token to retrieve next page of results.
        -   * Pass this value in ListRoomsRequest.page_token field in the subsequent
        -   * call to `google.showcase.v1beta1.Messaging\ListRooms` method to retrieve
        -   * the next page of results.
        -   * 
        - * - * string next_page_token = 2; - * @return The nextPageToken. - */ - @java.lang.Override - public java.lang.String getNextPageToken() { - java.lang.Object ref = nextPageToken_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - nextPageToken_ = s; - return s; - } - } - /** - *
        -   * A token to retrieve next page of results.
        -   * Pass this value in ListRoomsRequest.page_token field in the subsequent
        -   * call to `google.showcase.v1beta1.Messaging\ListRooms` method to retrieve
        -   * the next page of results.
        -   * 
        - * - * string next_page_token = 2; - * @return The bytes for nextPageToken. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getNextPageTokenBytes() { - java.lang.Object ref = nextPageToken_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - nextPageToken_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - private byte memoizedIsInitialized = -1; - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - for (int i = 0; i < rooms_.size(); i++) { - output.writeMessage(1, rooms_.get(i)); - } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nextPageToken_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 2, nextPageToken_); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - for (int i = 0; i < rooms_.size(); i++) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(1, rooms_.get(i)); - } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nextPageToken_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, nextPageToken_); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof com.google.showcase.v1beta1.ListRoomsResponse)) { - return super.equals(obj); - } - com.google.showcase.v1beta1.ListRoomsResponse other = (com.google.showcase.v1beta1.ListRoomsResponse) obj; - - if (!getRoomsList() - .equals(other.getRoomsList())) return false; - if (!getNextPageToken() - .equals(other.getNextPageToken())) return false; - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - if (getRoomsCount() > 0) { - hash = (37 * hash) + ROOMS_FIELD_NUMBER; - hash = (53 * hash) + getRoomsList().hashCode(); - } - hash = (37 * hash) + NEXT_PAGE_TOKEN_FIELD_NUMBER; - hash = (53 * hash) + getNextPageToken().hashCode(); - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.showcase.v1beta1.ListRoomsResponse parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.showcase.v1beta1.ListRoomsResponse parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.showcase.v1beta1.ListRoomsResponse parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.showcase.v1beta1.ListRoomsResponse 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.showcase.v1beta1.ListRoomsResponse parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.showcase.v1beta1.ListRoomsResponse parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.showcase.v1beta1.ListRoomsResponse parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static com.google.showcase.v1beta1.ListRoomsResponse 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.showcase.v1beta1.ListRoomsResponse parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static com.google.showcase.v1beta1.ListRoomsResponse 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.showcase.v1beta1.ListRoomsResponse parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static com.google.showcase.v1beta1.ListRoomsResponse 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.showcase.v1beta1.ListRoomsResponse 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 message for the google.showcase.v1beta1.Messaging\ListRooms
        -   * method.
        -   * 
        - * - * Protobuf type {@code google.showcase.v1beta1.ListRoomsResponse} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.ListRoomsResponse) - com.google.showcase.v1beta1.ListRoomsResponseOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.google.showcase.v1beta1.MessagingOuterClass.internal_static_google_showcase_v1beta1_ListRoomsResponse_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.showcase.v1beta1.MessagingOuterClass.internal_static_google_showcase_v1beta1_ListRoomsResponse_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.showcase.v1beta1.ListRoomsResponse.class, com.google.showcase.v1beta1.ListRoomsResponse.Builder.class); - } - - // Construct using com.google.showcase.v1beta1.ListRoomsResponse.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { - getRoomsFieldBuilder(); - } - } - @java.lang.Override - public Builder clear() { - super.clear(); - if (roomsBuilder_ == null) { - rooms_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - } else { - roomsBuilder_.clear(); - } - nextPageToken_ = ""; - - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return com.google.showcase.v1beta1.MessagingOuterClass.internal_static_google_showcase_v1beta1_ListRoomsResponse_descriptor; - } - - @java.lang.Override - public com.google.showcase.v1beta1.ListRoomsResponse getDefaultInstanceForType() { - return com.google.showcase.v1beta1.ListRoomsResponse.getDefaultInstance(); - } - - @java.lang.Override - public com.google.showcase.v1beta1.ListRoomsResponse build() { - com.google.showcase.v1beta1.ListRoomsResponse result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.showcase.v1beta1.ListRoomsResponse buildPartial() { - com.google.showcase.v1beta1.ListRoomsResponse result = new com.google.showcase.v1beta1.ListRoomsResponse(this); - int from_bitField0_ = bitField0_; - if (roomsBuilder_ == null) { - if (((bitField0_ & 0x00000001) != 0)) { - rooms_ = java.util.Collections.unmodifiableList(rooms_); - bitField0_ = (bitField0_ & ~0x00000001); - } - result.rooms_ = rooms_; - } else { - result.rooms_ = roomsBuilder_.build(); - } - result.nextPageToken_ = nextPageToken_; - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.setField(field, value); - } - @java.lang.Override - public Builder clearField( - com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - @java.lang.Override - public Builder clearOneof( - com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.addRepeatedField(field, value); - } - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof com.google.showcase.v1beta1.ListRoomsResponse) { - return mergeFrom((com.google.showcase.v1beta1.ListRoomsResponse)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.showcase.v1beta1.ListRoomsResponse other) { - if (other == com.google.showcase.v1beta1.ListRoomsResponse.getDefaultInstance()) return this; - if (roomsBuilder_ == null) { - if (!other.rooms_.isEmpty()) { - if (rooms_.isEmpty()) { - rooms_ = other.rooms_; - bitField0_ = (bitField0_ & ~0x00000001); - } else { - ensureRoomsIsMutable(); - rooms_.addAll(other.rooms_); - } - onChanged(); - } - } else { - if (!other.rooms_.isEmpty()) { - if (roomsBuilder_.isEmpty()) { - roomsBuilder_.dispose(); - roomsBuilder_ = null; - rooms_ = other.rooms_; - bitField0_ = (bitField0_ & ~0x00000001); - roomsBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? - getRoomsFieldBuilder() : null; - } else { - roomsBuilder_.addAllMessages(other.rooms_); - } - } - } - if (!other.getNextPageToken().isEmpty()) { - nextPageToken_ = other.nextPageToken_; - onChanged(); - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - com.google.showcase.v1beta1.ListRoomsResponse parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (com.google.showcase.v1beta1.ListRoomsResponse) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - private int bitField0_; - - private java.util.List rooms_ = - java.util.Collections.emptyList(); - private void ensureRoomsIsMutable() { - if (!((bitField0_ & 0x00000001) != 0)) { - rooms_ = new java.util.ArrayList(rooms_); - bitField0_ |= 0x00000001; - } - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - com.google.showcase.v1beta1.Room, com.google.showcase.v1beta1.Room.Builder, com.google.showcase.v1beta1.RoomOrBuilder> roomsBuilder_; - - /** - *
        -     * The list of rooms.
        -     * 
        - * - * repeated .google.showcase.v1beta1.Room rooms = 1; - */ - public java.util.List getRoomsList() { - if (roomsBuilder_ == null) { - return java.util.Collections.unmodifiableList(rooms_); - } else { - return roomsBuilder_.getMessageList(); - } - } - /** - *
        -     * The list of rooms.
        -     * 
        - * - * repeated .google.showcase.v1beta1.Room rooms = 1; - */ - public int getRoomsCount() { - if (roomsBuilder_ == null) { - return rooms_.size(); - } else { - return roomsBuilder_.getCount(); - } - } - /** - *
        -     * The list of rooms.
        -     * 
        - * - * repeated .google.showcase.v1beta1.Room rooms = 1; - */ - public com.google.showcase.v1beta1.Room getRooms(int index) { - if (roomsBuilder_ == null) { - return rooms_.get(index); - } else { - return roomsBuilder_.getMessage(index); - } - } - /** - *
        -     * The list of rooms.
        -     * 
        - * - * repeated .google.showcase.v1beta1.Room rooms = 1; - */ - public Builder setRooms( - int index, com.google.showcase.v1beta1.Room value) { - if (roomsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureRoomsIsMutable(); - rooms_.set(index, value); - onChanged(); - } else { - roomsBuilder_.setMessage(index, value); - } - return this; - } - /** - *
        -     * The list of rooms.
        -     * 
        - * - * repeated .google.showcase.v1beta1.Room rooms = 1; - */ - public Builder setRooms( - int index, com.google.showcase.v1beta1.Room.Builder builderForValue) { - if (roomsBuilder_ == null) { - ensureRoomsIsMutable(); - rooms_.set(index, builderForValue.build()); - onChanged(); - } else { - roomsBuilder_.setMessage(index, builderForValue.build()); - } - return this; - } - /** - *
        -     * The list of rooms.
        -     * 
        - * - * repeated .google.showcase.v1beta1.Room rooms = 1; - */ - public Builder addRooms(com.google.showcase.v1beta1.Room value) { - if (roomsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureRoomsIsMutable(); - rooms_.add(value); - onChanged(); - } else { - roomsBuilder_.addMessage(value); - } - return this; - } - /** - *
        -     * The list of rooms.
        -     * 
        - * - * repeated .google.showcase.v1beta1.Room rooms = 1; - */ - public Builder addRooms( - int index, com.google.showcase.v1beta1.Room value) { - if (roomsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureRoomsIsMutable(); - rooms_.add(index, value); - onChanged(); - } else { - roomsBuilder_.addMessage(index, value); - } - return this; - } - /** - *
        -     * The list of rooms.
        -     * 
        - * - * repeated .google.showcase.v1beta1.Room rooms = 1; - */ - public Builder addRooms( - com.google.showcase.v1beta1.Room.Builder builderForValue) { - if (roomsBuilder_ == null) { - ensureRoomsIsMutable(); - rooms_.add(builderForValue.build()); - onChanged(); - } else { - roomsBuilder_.addMessage(builderForValue.build()); - } - return this; - } - /** - *
        -     * The list of rooms.
        -     * 
        - * - * repeated .google.showcase.v1beta1.Room rooms = 1; - */ - public Builder addRooms( - int index, com.google.showcase.v1beta1.Room.Builder builderForValue) { - if (roomsBuilder_ == null) { - ensureRoomsIsMutable(); - rooms_.add(index, builderForValue.build()); - onChanged(); - } else { - roomsBuilder_.addMessage(index, builderForValue.build()); - } - return this; - } - /** - *
        -     * The list of rooms.
        -     * 
        - * - * repeated .google.showcase.v1beta1.Room rooms = 1; - */ - public Builder addAllRooms( - java.lang.Iterable values) { - if (roomsBuilder_ == null) { - ensureRoomsIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, rooms_); - onChanged(); - } else { - roomsBuilder_.addAllMessages(values); - } - return this; - } - /** - *
        -     * The list of rooms.
        -     * 
        - * - * repeated .google.showcase.v1beta1.Room rooms = 1; - */ - public Builder clearRooms() { - if (roomsBuilder_ == null) { - rooms_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - onChanged(); - } else { - roomsBuilder_.clear(); - } - return this; - } - /** - *
        -     * The list of rooms.
        -     * 
        - * - * repeated .google.showcase.v1beta1.Room rooms = 1; - */ - public Builder removeRooms(int index) { - if (roomsBuilder_ == null) { - ensureRoomsIsMutable(); - rooms_.remove(index); - onChanged(); - } else { - roomsBuilder_.remove(index); - } - return this; - } - /** - *
        -     * The list of rooms.
        -     * 
        - * - * repeated .google.showcase.v1beta1.Room rooms = 1; - */ - public com.google.showcase.v1beta1.Room.Builder getRoomsBuilder( - int index) { - return getRoomsFieldBuilder().getBuilder(index); - } - /** - *
        -     * The list of rooms.
        -     * 
        - * - * repeated .google.showcase.v1beta1.Room rooms = 1; - */ - public com.google.showcase.v1beta1.RoomOrBuilder getRoomsOrBuilder( - int index) { - if (roomsBuilder_ == null) { - return rooms_.get(index); } else { - return roomsBuilder_.getMessageOrBuilder(index); - } - } - /** - *
        -     * The list of rooms.
        -     * 
        - * - * repeated .google.showcase.v1beta1.Room rooms = 1; - */ - public java.util.List - getRoomsOrBuilderList() { - if (roomsBuilder_ != null) { - return roomsBuilder_.getMessageOrBuilderList(); - } else { - return java.util.Collections.unmodifiableList(rooms_); - } - } - /** - *
        -     * The list of rooms.
        -     * 
        - * - * repeated .google.showcase.v1beta1.Room rooms = 1; - */ - public com.google.showcase.v1beta1.Room.Builder addRoomsBuilder() { - return getRoomsFieldBuilder().addBuilder( - com.google.showcase.v1beta1.Room.getDefaultInstance()); - } - /** - *
        -     * The list of rooms.
        -     * 
        - * - * repeated .google.showcase.v1beta1.Room rooms = 1; - */ - public com.google.showcase.v1beta1.Room.Builder addRoomsBuilder( - int index) { - return getRoomsFieldBuilder().addBuilder( - index, com.google.showcase.v1beta1.Room.getDefaultInstance()); - } - /** - *
        -     * The list of rooms.
        -     * 
        - * - * repeated .google.showcase.v1beta1.Room rooms = 1; - */ - public java.util.List - getRoomsBuilderList() { - return getRoomsFieldBuilder().getBuilderList(); - } - private com.google.protobuf.RepeatedFieldBuilderV3< - com.google.showcase.v1beta1.Room, com.google.showcase.v1beta1.Room.Builder, com.google.showcase.v1beta1.RoomOrBuilder> - getRoomsFieldBuilder() { - if (roomsBuilder_ == null) { - roomsBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< - com.google.showcase.v1beta1.Room, com.google.showcase.v1beta1.Room.Builder, com.google.showcase.v1beta1.RoomOrBuilder>( - rooms_, - ((bitField0_ & 0x00000001) != 0), - getParentForChildren(), - isClean()); - rooms_ = null; - } - return roomsBuilder_; - } - - private java.lang.Object nextPageToken_ = ""; - /** - *
        -     * A token to retrieve next page of results.
        -     * Pass this value in ListRoomsRequest.page_token field in the subsequent
        -     * call to `google.showcase.v1beta1.Messaging\ListRooms` method to retrieve
        -     * the next page of results.
        -     * 
        - * - * string next_page_token = 2; - * @return The nextPageToken. - */ - public java.lang.String getNextPageToken() { - java.lang.Object ref = nextPageToken_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - nextPageToken_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - *
        -     * A token to retrieve next page of results.
        -     * Pass this value in ListRoomsRequest.page_token field in the subsequent
        -     * call to `google.showcase.v1beta1.Messaging\ListRooms` method to retrieve
        -     * the next page of results.
        -     * 
        - * - * string next_page_token = 2; - * @return The bytes for nextPageToken. - */ - public com.google.protobuf.ByteString - getNextPageTokenBytes() { - java.lang.Object ref = nextPageToken_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - nextPageToken_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - *
        -     * A token to retrieve next page of results.
        -     * Pass this value in ListRoomsRequest.page_token field in the subsequent
        -     * call to `google.showcase.v1beta1.Messaging\ListRooms` method to retrieve
        -     * the next page of results.
        -     * 
        - * - * string next_page_token = 2; - * @param value The nextPageToken to set. - * @return This builder for chaining. - */ - public Builder setNextPageToken( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - nextPageToken_ = value; - onChanged(); - return this; - } - /** - *
        -     * A token to retrieve next page of results.
        -     * Pass this value in ListRoomsRequest.page_token field in the subsequent
        -     * call to `google.showcase.v1beta1.Messaging\ListRooms` method to retrieve
        -     * the next page of results.
        -     * 
        - * - * string next_page_token = 2; - * @return This builder for chaining. - */ - public Builder clearNextPageToken() { - - nextPageToken_ = getDefaultInstance().getNextPageToken(); - onChanged(); - return this; - } - /** - *
        -     * A token to retrieve next page of results.
        -     * Pass this value in ListRoomsRequest.page_token field in the subsequent
        -     * call to `google.showcase.v1beta1.Messaging\ListRooms` method to retrieve
        -     * the next page of results.
        -     * 
        - * - * string next_page_token = 2; - * @param value The bytes for nextPageToken to set. - * @return This builder for chaining. - */ - public Builder setNextPageTokenBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - nextPageToken_ = value; - onChanged(); - return this; - } - @java.lang.Override - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - - // @@protoc_insertion_point(builder_scope:google.showcase.v1beta1.ListRoomsResponse) - } - - // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.ListRoomsResponse) - private static final com.google.showcase.v1beta1.ListRoomsResponse DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new com.google.showcase.v1beta1.ListRoomsResponse(); - } - - public static com.google.showcase.v1beta1.ListRoomsResponse getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public ListRoomsResponse parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new ListRoomsResponse(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public com.google.showcase.v1beta1.ListRoomsResponse getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListRoomsResponseOrBuilder.java b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListRoomsResponseOrBuilder.java deleted file mode 100644 index 5ce50752b3..0000000000 --- a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListRoomsResponseOrBuilder.java +++ /dev/null @@ -1,79 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: schema/google/showcase/v1beta1/messaging.proto - -package com.google.showcase.v1beta1; - -public interface ListRoomsResponseOrBuilder extends - // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.ListRoomsResponse) - com.google.protobuf.MessageOrBuilder { - - /** - *
        -   * The list of rooms.
        -   * 
        - * - * repeated .google.showcase.v1beta1.Room rooms = 1; - */ - java.util.List - getRoomsList(); - /** - *
        -   * The list of rooms.
        -   * 
        - * - * repeated .google.showcase.v1beta1.Room rooms = 1; - */ - com.google.showcase.v1beta1.Room getRooms(int index); - /** - *
        -   * The list of rooms.
        -   * 
        - * - * repeated .google.showcase.v1beta1.Room rooms = 1; - */ - int getRoomsCount(); - /** - *
        -   * The list of rooms.
        -   * 
        - * - * repeated .google.showcase.v1beta1.Room rooms = 1; - */ - java.util.List - getRoomsOrBuilderList(); - /** - *
        -   * The list of rooms.
        -   * 
        - * - * repeated .google.showcase.v1beta1.Room rooms = 1; - */ - com.google.showcase.v1beta1.RoomOrBuilder getRoomsOrBuilder( - int index); - - /** - *
        -   * A token to retrieve next page of results.
        -   * Pass this value in ListRoomsRequest.page_token field in the subsequent
        -   * call to `google.showcase.v1beta1.Messaging\ListRooms` method to retrieve
        -   * the next page of results.
        -   * 
        - * - * string next_page_token = 2; - * @return The nextPageToken. - */ - java.lang.String getNextPageToken(); - /** - *
        -   * A token to retrieve next page of results.
        -   * Pass this value in ListRoomsRequest.page_token field in the subsequent
        -   * call to `google.showcase.v1beta1.Messaging\ListRooms` method to retrieve
        -   * the next page of results.
        -   * 
        - * - * string next_page_token = 2; - * @return The bytes for nextPageToken. - */ - com.google.protobuf.ByteString - getNextPageTokenBytes(); -} diff --git a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListSessionsRequest.java b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListSessionsRequest.java deleted file mode 100644 index ed242c47e4..0000000000 --- a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListSessionsRequest.java +++ /dev/null @@ -1,675 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: schema/google/showcase/v1beta1/testing.proto - -package com.google.showcase.v1beta1; - -/** - *
        - * The request for the ListSessions method.
        - * 
        - * - * Protobuf type {@code google.showcase.v1beta1.ListSessionsRequest} - */ -public final class ListSessionsRequest extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.ListSessionsRequest) - ListSessionsRequestOrBuilder { -private static final long serialVersionUID = 0L; - // Use ListSessionsRequest.newBuilder() to construct. - private ListSessionsRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private ListSessionsRequest() { - pageToken_ = ""; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new ListSessionsRequest(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private ListSessionsRequest( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 8: { - - pageSize_ = input.readInt32(); - break; - } - case 18: { - java.lang.String s = input.readStringRequireUtf8(); - - pageToken_ = s; - break; - } - default: { - if (!parseUnknownField( - input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException( - e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.google.showcase.v1beta1.TestingOuterClass.internal_static_google_showcase_v1beta1_ListSessionsRequest_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.showcase.v1beta1.TestingOuterClass.internal_static_google_showcase_v1beta1_ListSessionsRequest_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.showcase.v1beta1.ListSessionsRequest.class, com.google.showcase.v1beta1.ListSessionsRequest.Builder.class); - } - - public static final int PAGE_SIZE_FIELD_NUMBER = 1; - private int pageSize_; - /** - *
        -   * The maximum number of sessions to return per page.
        -   * 
        - * - * int32 page_size = 1; - * @return The pageSize. - */ - @java.lang.Override - public int getPageSize() { - return pageSize_; - } - - public static final int PAGE_TOKEN_FIELD_NUMBER = 2; - private volatile java.lang.Object pageToken_; - /** - *
        -   * The page token, for retrieving subsequent pages.
        -   * 
        - * - * string page_token = 2; - * @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; - } - } - /** - *
        -   * The page token, for retrieving subsequent pages.
        -   * 
        - * - * string page_token = 2; - * @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_); - } - unknownFields.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 += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof com.google.showcase.v1beta1.ListSessionsRequest)) { - return super.equals(obj); - } - com.google.showcase.v1beta1.ListSessionsRequest other = (com.google.showcase.v1beta1.ListSessionsRequest) obj; - - if (getPageSize() - != other.getPageSize()) return false; - if (!getPageToken() - .equals(other.getPageToken())) return false; - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - hash = (37 * hash) + PAGE_SIZE_FIELD_NUMBER; - hash = (53 * hash) + getPageSize(); - hash = (37 * hash) + PAGE_TOKEN_FIELD_NUMBER; - hash = (53 * hash) + getPageToken().hashCode(); - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.showcase.v1beta1.ListSessionsRequest parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.showcase.v1beta1.ListSessionsRequest parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.showcase.v1beta1.ListSessionsRequest parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.showcase.v1beta1.ListSessionsRequest 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.showcase.v1beta1.ListSessionsRequest parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.showcase.v1beta1.ListSessionsRequest parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.showcase.v1beta1.ListSessionsRequest parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static com.google.showcase.v1beta1.ListSessionsRequest 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.showcase.v1beta1.ListSessionsRequest parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static com.google.showcase.v1beta1.ListSessionsRequest 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.showcase.v1beta1.ListSessionsRequest parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static com.google.showcase.v1beta1.ListSessionsRequest 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.showcase.v1beta1.ListSessionsRequest 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 request for the ListSessions method.
        -   * 
        - * - * Protobuf type {@code google.showcase.v1beta1.ListSessionsRequest} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.ListSessionsRequest) - com.google.showcase.v1beta1.ListSessionsRequestOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.google.showcase.v1beta1.TestingOuterClass.internal_static_google_showcase_v1beta1_ListSessionsRequest_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.showcase.v1beta1.TestingOuterClass.internal_static_google_showcase_v1beta1_ListSessionsRequest_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.showcase.v1beta1.ListSessionsRequest.class, com.google.showcase.v1beta1.ListSessionsRequest.Builder.class); - } - - // Construct using com.google.showcase.v1beta1.ListSessionsRequest.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { - } - } - @java.lang.Override - public Builder clear() { - super.clear(); - pageSize_ = 0; - - pageToken_ = ""; - - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return com.google.showcase.v1beta1.TestingOuterClass.internal_static_google_showcase_v1beta1_ListSessionsRequest_descriptor; - } - - @java.lang.Override - public com.google.showcase.v1beta1.ListSessionsRequest getDefaultInstanceForType() { - return com.google.showcase.v1beta1.ListSessionsRequest.getDefaultInstance(); - } - - @java.lang.Override - public com.google.showcase.v1beta1.ListSessionsRequest build() { - com.google.showcase.v1beta1.ListSessionsRequest result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.showcase.v1beta1.ListSessionsRequest buildPartial() { - com.google.showcase.v1beta1.ListSessionsRequest result = new com.google.showcase.v1beta1.ListSessionsRequest(this); - result.pageSize_ = pageSize_; - result.pageToken_ = pageToken_; - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.setField(field, value); - } - @java.lang.Override - public Builder clearField( - com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - @java.lang.Override - public Builder clearOneof( - com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.addRepeatedField(field, value); - } - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof com.google.showcase.v1beta1.ListSessionsRequest) { - return mergeFrom((com.google.showcase.v1beta1.ListSessionsRequest)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.showcase.v1beta1.ListSessionsRequest other) { - if (other == com.google.showcase.v1beta1.ListSessionsRequest.getDefaultInstance()) return this; - if (other.getPageSize() != 0) { - setPageSize(other.getPageSize()); - } - if (!other.getPageToken().isEmpty()) { - pageToken_ = other.pageToken_; - onChanged(); - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - com.google.showcase.v1beta1.ListSessionsRequest parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (com.google.showcase.v1beta1.ListSessionsRequest) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private int pageSize_ ; - /** - *
        -     * The maximum number of sessions to return per page.
        -     * 
        - * - * int32 page_size = 1; - * @return The pageSize. - */ - @java.lang.Override - public int getPageSize() { - return pageSize_; - } - /** - *
        -     * The maximum number of sessions to return per page.
        -     * 
        - * - * int32 page_size = 1; - * @param value The pageSize to set. - * @return This builder for chaining. - */ - public Builder setPageSize(int value) { - - pageSize_ = value; - onChanged(); - return this; - } - /** - *
        -     * The maximum number of sessions to return per page.
        -     * 
        - * - * int32 page_size = 1; - * @return This builder for chaining. - */ - public Builder clearPageSize() { - - pageSize_ = 0; - onChanged(); - return this; - } - - private java.lang.Object pageToken_ = ""; - /** - *
        -     * The page token, for retrieving subsequent pages.
        -     * 
        - * - * string page_token = 2; - * @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; - } - } - /** - *
        -     * The page token, for retrieving subsequent pages.
        -     * 
        - * - * string page_token = 2; - * @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; - } - } - /** - *
        -     * The page token, for retrieving subsequent pages.
        -     * 
        - * - * string page_token = 2; - * @param value The pageToken to set. - * @return This builder for chaining. - */ - public Builder setPageToken( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - pageToken_ = value; - onChanged(); - return this; - } - /** - *
        -     * The page token, for retrieving subsequent pages.
        -     * 
        - * - * string page_token = 2; - * @return This builder for chaining. - */ - public Builder clearPageToken() { - - pageToken_ = getDefaultInstance().getPageToken(); - onChanged(); - return this; - } - /** - *
        -     * The page token, for retrieving subsequent pages.
        -     * 
        - * - * string page_token = 2; - * @param value The bytes for pageToken to set. - * @return This builder for chaining. - */ - public Builder setPageTokenBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - pageToken_ = value; - onChanged(); - return this; - } - @java.lang.Override - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - - // @@protoc_insertion_point(builder_scope:google.showcase.v1beta1.ListSessionsRequest) - } - - // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.ListSessionsRequest) - private static final com.google.showcase.v1beta1.ListSessionsRequest DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new com.google.showcase.v1beta1.ListSessionsRequest(); - } - - public static com.google.showcase.v1beta1.ListSessionsRequest getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public ListSessionsRequest parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new ListSessionsRequest(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public com.google.showcase.v1beta1.ListSessionsRequest getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListSessionsRequestOrBuilder.java b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListSessionsRequestOrBuilder.java deleted file mode 100644 index 54042c6209..0000000000 --- a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListSessionsRequestOrBuilder.java +++ /dev/null @@ -1,39 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: schema/google/showcase/v1beta1/testing.proto - -package com.google.showcase.v1beta1; - -public interface ListSessionsRequestOrBuilder extends - // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.ListSessionsRequest) - com.google.protobuf.MessageOrBuilder { - - /** - *
        -   * The maximum number of sessions to return per page.
        -   * 
        - * - * int32 page_size = 1; - * @return The pageSize. - */ - int getPageSize(); - - /** - *
        -   * The page token, for retrieving subsequent pages.
        -   * 
        - * - * string page_token = 2; - * @return The pageToken. - */ - java.lang.String getPageToken(); - /** - *
        -   * The page token, for retrieving subsequent pages.
        -   * 
        - * - * string page_token = 2; - * @return The bytes for pageToken. - */ - com.google.protobuf.ByteString - getPageTokenBytes(); -} diff --git a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListSessionsResponse.java b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListSessionsResponse.java deleted file mode 100644 index 2ad961fbec..0000000000 --- a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListSessionsResponse.java +++ /dev/null @@ -1,1045 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: schema/google/showcase/v1beta1/testing.proto - -package com.google.showcase.v1beta1; - -/** - *
        - * Response for the ListSessions method.
        - * 
        - * - * Protobuf type {@code google.showcase.v1beta1.ListSessionsResponse} - */ -public final class ListSessionsResponse extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.ListSessionsResponse) - ListSessionsResponseOrBuilder { -private static final long serialVersionUID = 0L; - // Use ListSessionsResponse.newBuilder() to construct. - private ListSessionsResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private ListSessionsResponse() { - sessions_ = java.util.Collections.emptyList(); - nextPageToken_ = ""; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new ListSessionsResponse(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private ListSessionsResponse( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - int mutable_bitField0_ = 0; - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: { - if (!((mutable_bitField0_ & 0x00000001) != 0)) { - sessions_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000001; - } - sessions_.add( - input.readMessage(com.google.showcase.v1beta1.Session.parser(), extensionRegistry)); - break; - } - case 18: { - java.lang.String s = input.readStringRequireUtf8(); - - nextPageToken_ = s; - break; - } - default: { - if (!parseUnknownField( - input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException( - e).setUnfinishedMessage(this); - } finally { - if (((mutable_bitField0_ & 0x00000001) != 0)) { - sessions_ = java.util.Collections.unmodifiableList(sessions_); - } - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.google.showcase.v1beta1.TestingOuterClass.internal_static_google_showcase_v1beta1_ListSessionsResponse_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.showcase.v1beta1.TestingOuterClass.internal_static_google_showcase_v1beta1_ListSessionsResponse_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.showcase.v1beta1.ListSessionsResponse.class, com.google.showcase.v1beta1.ListSessionsResponse.Builder.class); - } - - public static final int SESSIONS_FIELD_NUMBER = 1; - private java.util.List sessions_; - /** - *
        -   * The sessions being returned.
        -   * 
        - * - * repeated .google.showcase.v1beta1.Session sessions = 1; - */ - @java.lang.Override - public java.util.List getSessionsList() { - return sessions_; - } - /** - *
        -   * The sessions being returned.
        -   * 
        - * - * repeated .google.showcase.v1beta1.Session sessions = 1; - */ - @java.lang.Override - public java.util.List - getSessionsOrBuilderList() { - return sessions_; - } - /** - *
        -   * The sessions being returned.
        -   * 
        - * - * repeated .google.showcase.v1beta1.Session sessions = 1; - */ - @java.lang.Override - public int getSessionsCount() { - return sessions_.size(); - } - /** - *
        -   * The sessions being returned.
        -   * 
        - * - * repeated .google.showcase.v1beta1.Session sessions = 1; - */ - @java.lang.Override - public com.google.showcase.v1beta1.Session getSessions(int index) { - return sessions_.get(index); - } - /** - *
        -   * The sessions being returned.
        -   * 
        - * - * repeated .google.showcase.v1beta1.Session sessions = 1; - */ - @java.lang.Override - public com.google.showcase.v1beta1.SessionOrBuilder getSessionsOrBuilder( - int index) { - return sessions_.get(index); - } - - public static final int NEXT_PAGE_TOKEN_FIELD_NUMBER = 2; - private volatile java.lang.Object nextPageToken_; - /** - *
        -   * The next page token, if any.
        -   * An empty value here means the last page has been reached.
        -   * 
        - * - * 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; - } - } - /** - *
        -   * The next page token, if any.
        -   * An empty value here means the last page has been reached.
        -   * 
        - * - * 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 < sessions_.size(); i++) { - output.writeMessage(1, sessions_.get(i)); - } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nextPageToken_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 2, nextPageToken_); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - for (int i = 0; i < sessions_.size(); i++) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(1, sessions_.get(i)); - } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nextPageToken_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, nextPageToken_); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof com.google.showcase.v1beta1.ListSessionsResponse)) { - return super.equals(obj); - } - com.google.showcase.v1beta1.ListSessionsResponse other = (com.google.showcase.v1beta1.ListSessionsResponse) obj; - - if (!getSessionsList() - .equals(other.getSessionsList())) return false; - if (!getNextPageToken() - .equals(other.getNextPageToken())) return false; - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - if (getSessionsCount() > 0) { - hash = (37 * hash) + SESSIONS_FIELD_NUMBER; - hash = (53 * hash) + getSessionsList().hashCode(); - } - hash = (37 * hash) + NEXT_PAGE_TOKEN_FIELD_NUMBER; - hash = (53 * hash) + getNextPageToken().hashCode(); - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.showcase.v1beta1.ListSessionsResponse parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.showcase.v1beta1.ListSessionsResponse parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.showcase.v1beta1.ListSessionsResponse parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.showcase.v1beta1.ListSessionsResponse 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.showcase.v1beta1.ListSessionsResponse parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.showcase.v1beta1.ListSessionsResponse parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.showcase.v1beta1.ListSessionsResponse parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static com.google.showcase.v1beta1.ListSessionsResponse 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.showcase.v1beta1.ListSessionsResponse parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static com.google.showcase.v1beta1.ListSessionsResponse 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.showcase.v1beta1.ListSessionsResponse parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static com.google.showcase.v1beta1.ListSessionsResponse 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.showcase.v1beta1.ListSessionsResponse 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 for the ListSessions method.
        -   * 
        - * - * Protobuf type {@code google.showcase.v1beta1.ListSessionsResponse} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.ListSessionsResponse) - com.google.showcase.v1beta1.ListSessionsResponseOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.google.showcase.v1beta1.TestingOuterClass.internal_static_google_showcase_v1beta1_ListSessionsResponse_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.showcase.v1beta1.TestingOuterClass.internal_static_google_showcase_v1beta1_ListSessionsResponse_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.showcase.v1beta1.ListSessionsResponse.class, com.google.showcase.v1beta1.ListSessionsResponse.Builder.class); - } - - // Construct using com.google.showcase.v1beta1.ListSessionsResponse.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { - getSessionsFieldBuilder(); - } - } - @java.lang.Override - public Builder clear() { - super.clear(); - if (sessionsBuilder_ == null) { - sessions_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - } else { - sessionsBuilder_.clear(); - } - nextPageToken_ = ""; - - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return com.google.showcase.v1beta1.TestingOuterClass.internal_static_google_showcase_v1beta1_ListSessionsResponse_descriptor; - } - - @java.lang.Override - public com.google.showcase.v1beta1.ListSessionsResponse getDefaultInstanceForType() { - return com.google.showcase.v1beta1.ListSessionsResponse.getDefaultInstance(); - } - - @java.lang.Override - public com.google.showcase.v1beta1.ListSessionsResponse build() { - com.google.showcase.v1beta1.ListSessionsResponse result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.showcase.v1beta1.ListSessionsResponse buildPartial() { - com.google.showcase.v1beta1.ListSessionsResponse result = new com.google.showcase.v1beta1.ListSessionsResponse(this); - int from_bitField0_ = bitField0_; - if (sessionsBuilder_ == null) { - if (((bitField0_ & 0x00000001) != 0)) { - sessions_ = java.util.Collections.unmodifiableList(sessions_); - bitField0_ = (bitField0_ & ~0x00000001); - } - result.sessions_ = sessions_; - } else { - result.sessions_ = sessionsBuilder_.build(); - } - result.nextPageToken_ = nextPageToken_; - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.setField(field, value); - } - @java.lang.Override - public Builder clearField( - com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - @java.lang.Override - public Builder clearOneof( - com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.addRepeatedField(field, value); - } - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof com.google.showcase.v1beta1.ListSessionsResponse) { - return mergeFrom((com.google.showcase.v1beta1.ListSessionsResponse)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.showcase.v1beta1.ListSessionsResponse other) { - if (other == com.google.showcase.v1beta1.ListSessionsResponse.getDefaultInstance()) return this; - if (sessionsBuilder_ == null) { - if (!other.sessions_.isEmpty()) { - if (sessions_.isEmpty()) { - sessions_ = other.sessions_; - bitField0_ = (bitField0_ & ~0x00000001); - } else { - ensureSessionsIsMutable(); - sessions_.addAll(other.sessions_); - } - onChanged(); - } - } else { - if (!other.sessions_.isEmpty()) { - if (sessionsBuilder_.isEmpty()) { - sessionsBuilder_.dispose(); - sessionsBuilder_ = null; - sessions_ = other.sessions_; - bitField0_ = (bitField0_ & ~0x00000001); - sessionsBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? - getSessionsFieldBuilder() : null; - } else { - sessionsBuilder_.addAllMessages(other.sessions_); - } - } - } - if (!other.getNextPageToken().isEmpty()) { - nextPageToken_ = other.nextPageToken_; - onChanged(); - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - com.google.showcase.v1beta1.ListSessionsResponse parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (com.google.showcase.v1beta1.ListSessionsResponse) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - private int bitField0_; - - private java.util.List sessions_ = - java.util.Collections.emptyList(); - private void ensureSessionsIsMutable() { - if (!((bitField0_ & 0x00000001) != 0)) { - sessions_ = new java.util.ArrayList(sessions_); - bitField0_ |= 0x00000001; - } - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - com.google.showcase.v1beta1.Session, com.google.showcase.v1beta1.Session.Builder, com.google.showcase.v1beta1.SessionOrBuilder> sessionsBuilder_; - - /** - *
        -     * The sessions being returned.
        -     * 
        - * - * repeated .google.showcase.v1beta1.Session sessions = 1; - */ - public java.util.List getSessionsList() { - if (sessionsBuilder_ == null) { - return java.util.Collections.unmodifiableList(sessions_); - } else { - return sessionsBuilder_.getMessageList(); - } - } - /** - *
        -     * The sessions being returned.
        -     * 
        - * - * repeated .google.showcase.v1beta1.Session sessions = 1; - */ - public int getSessionsCount() { - if (sessionsBuilder_ == null) { - return sessions_.size(); - } else { - return sessionsBuilder_.getCount(); - } - } - /** - *
        -     * The sessions being returned.
        -     * 
        - * - * repeated .google.showcase.v1beta1.Session sessions = 1; - */ - public com.google.showcase.v1beta1.Session getSessions(int index) { - if (sessionsBuilder_ == null) { - return sessions_.get(index); - } else { - return sessionsBuilder_.getMessage(index); - } - } - /** - *
        -     * The sessions being returned.
        -     * 
        - * - * repeated .google.showcase.v1beta1.Session sessions = 1; - */ - public Builder setSessions( - int index, com.google.showcase.v1beta1.Session value) { - if (sessionsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureSessionsIsMutable(); - sessions_.set(index, value); - onChanged(); - } else { - sessionsBuilder_.setMessage(index, value); - } - return this; - } - /** - *
        -     * The sessions being returned.
        -     * 
        - * - * repeated .google.showcase.v1beta1.Session sessions = 1; - */ - public Builder setSessions( - int index, com.google.showcase.v1beta1.Session.Builder builderForValue) { - if (sessionsBuilder_ == null) { - ensureSessionsIsMutable(); - sessions_.set(index, builderForValue.build()); - onChanged(); - } else { - sessionsBuilder_.setMessage(index, builderForValue.build()); - } - return this; - } - /** - *
        -     * The sessions being returned.
        -     * 
        - * - * repeated .google.showcase.v1beta1.Session sessions = 1; - */ - public Builder addSessions(com.google.showcase.v1beta1.Session value) { - if (sessionsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureSessionsIsMutable(); - sessions_.add(value); - onChanged(); - } else { - sessionsBuilder_.addMessage(value); - } - return this; - } - /** - *
        -     * The sessions being returned.
        -     * 
        - * - * repeated .google.showcase.v1beta1.Session sessions = 1; - */ - public Builder addSessions( - int index, com.google.showcase.v1beta1.Session value) { - if (sessionsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureSessionsIsMutable(); - sessions_.add(index, value); - onChanged(); - } else { - sessionsBuilder_.addMessage(index, value); - } - return this; - } - /** - *
        -     * The sessions being returned.
        -     * 
        - * - * repeated .google.showcase.v1beta1.Session sessions = 1; - */ - public Builder addSessions( - com.google.showcase.v1beta1.Session.Builder builderForValue) { - if (sessionsBuilder_ == null) { - ensureSessionsIsMutable(); - sessions_.add(builderForValue.build()); - onChanged(); - } else { - sessionsBuilder_.addMessage(builderForValue.build()); - } - return this; - } - /** - *
        -     * The sessions being returned.
        -     * 
        - * - * repeated .google.showcase.v1beta1.Session sessions = 1; - */ - public Builder addSessions( - int index, com.google.showcase.v1beta1.Session.Builder builderForValue) { - if (sessionsBuilder_ == null) { - ensureSessionsIsMutable(); - sessions_.add(index, builderForValue.build()); - onChanged(); - } else { - sessionsBuilder_.addMessage(index, builderForValue.build()); - } - return this; - } - /** - *
        -     * The sessions being returned.
        -     * 
        - * - * repeated .google.showcase.v1beta1.Session sessions = 1; - */ - public Builder addAllSessions( - java.lang.Iterable values) { - if (sessionsBuilder_ == null) { - ensureSessionsIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, sessions_); - onChanged(); - } else { - sessionsBuilder_.addAllMessages(values); - } - return this; - } - /** - *
        -     * The sessions being returned.
        -     * 
        - * - * repeated .google.showcase.v1beta1.Session sessions = 1; - */ - public Builder clearSessions() { - if (sessionsBuilder_ == null) { - sessions_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - onChanged(); - } else { - sessionsBuilder_.clear(); - } - return this; - } - /** - *
        -     * The sessions being returned.
        -     * 
        - * - * repeated .google.showcase.v1beta1.Session sessions = 1; - */ - public Builder removeSessions(int index) { - if (sessionsBuilder_ == null) { - ensureSessionsIsMutable(); - sessions_.remove(index); - onChanged(); - } else { - sessionsBuilder_.remove(index); - } - return this; - } - /** - *
        -     * The sessions being returned.
        -     * 
        - * - * repeated .google.showcase.v1beta1.Session sessions = 1; - */ - public com.google.showcase.v1beta1.Session.Builder getSessionsBuilder( - int index) { - return getSessionsFieldBuilder().getBuilder(index); - } - /** - *
        -     * The sessions being returned.
        -     * 
        - * - * repeated .google.showcase.v1beta1.Session sessions = 1; - */ - public com.google.showcase.v1beta1.SessionOrBuilder getSessionsOrBuilder( - int index) { - if (sessionsBuilder_ == null) { - return sessions_.get(index); } else { - return sessionsBuilder_.getMessageOrBuilder(index); - } - } - /** - *
        -     * The sessions being returned.
        -     * 
        - * - * repeated .google.showcase.v1beta1.Session sessions = 1; - */ - public java.util.List - getSessionsOrBuilderList() { - if (sessionsBuilder_ != null) { - return sessionsBuilder_.getMessageOrBuilderList(); - } else { - return java.util.Collections.unmodifiableList(sessions_); - } - } - /** - *
        -     * The sessions being returned.
        -     * 
        - * - * repeated .google.showcase.v1beta1.Session sessions = 1; - */ - public com.google.showcase.v1beta1.Session.Builder addSessionsBuilder() { - return getSessionsFieldBuilder().addBuilder( - com.google.showcase.v1beta1.Session.getDefaultInstance()); - } - /** - *
        -     * The sessions being returned.
        -     * 
        - * - * repeated .google.showcase.v1beta1.Session sessions = 1; - */ - public com.google.showcase.v1beta1.Session.Builder addSessionsBuilder( - int index) { - return getSessionsFieldBuilder().addBuilder( - index, com.google.showcase.v1beta1.Session.getDefaultInstance()); - } - /** - *
        -     * The sessions being returned.
        -     * 
        - * - * repeated .google.showcase.v1beta1.Session sessions = 1; - */ - public java.util.List - getSessionsBuilderList() { - return getSessionsFieldBuilder().getBuilderList(); - } - private com.google.protobuf.RepeatedFieldBuilderV3< - com.google.showcase.v1beta1.Session, com.google.showcase.v1beta1.Session.Builder, com.google.showcase.v1beta1.SessionOrBuilder> - getSessionsFieldBuilder() { - if (sessionsBuilder_ == null) { - sessionsBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< - com.google.showcase.v1beta1.Session, com.google.showcase.v1beta1.Session.Builder, com.google.showcase.v1beta1.SessionOrBuilder>( - sessions_, - ((bitField0_ & 0x00000001) != 0), - getParentForChildren(), - isClean()); - sessions_ = null; - } - return sessionsBuilder_; - } - - private java.lang.Object nextPageToken_ = ""; - /** - *
        -     * The next page token, if any.
        -     * An empty value here means the last page has been reached.
        -     * 
        - * - * 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; - } - } - /** - *
        -     * The next page token, if any.
        -     * An empty value here means the last page has been reached.
        -     * 
        - * - * 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; - } - } - /** - *
        -     * The next page token, if any.
        -     * An empty value here means the last page has been reached.
        -     * 
        - * - * string next_page_token = 2; - * @param value The nextPageToken to set. - * @return This builder for chaining. - */ - public Builder setNextPageToken( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - nextPageToken_ = value; - onChanged(); - return this; - } - /** - *
        -     * The next page token, if any.
        -     * An empty value here means the last page has been reached.
        -     * 
        - * - * string next_page_token = 2; - * @return This builder for chaining. - */ - public Builder clearNextPageToken() { - - nextPageToken_ = getDefaultInstance().getNextPageToken(); - onChanged(); - return this; - } - /** - *
        -     * The next page token, if any.
        -     * An empty value here means the last page has been reached.
        -     * 
        - * - * string next_page_token = 2; - * @param value The bytes for nextPageToken to set. - * @return This builder for chaining. - */ - public Builder setNextPageTokenBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - nextPageToken_ = value; - onChanged(); - return this; - } - @java.lang.Override - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - - // @@protoc_insertion_point(builder_scope:google.showcase.v1beta1.ListSessionsResponse) - } - - // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.ListSessionsResponse) - private static final com.google.showcase.v1beta1.ListSessionsResponse DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new com.google.showcase.v1beta1.ListSessionsResponse(); - } - - public static com.google.showcase.v1beta1.ListSessionsResponse getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public ListSessionsResponse parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new ListSessionsResponse(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public com.google.showcase.v1beta1.ListSessionsResponse getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListSessionsResponseOrBuilder.java b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListSessionsResponseOrBuilder.java deleted file mode 100644 index 2dbaa51602..0000000000 --- a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListSessionsResponseOrBuilder.java +++ /dev/null @@ -1,75 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: schema/google/showcase/v1beta1/testing.proto - -package com.google.showcase.v1beta1; - -public interface ListSessionsResponseOrBuilder extends - // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.ListSessionsResponse) - com.google.protobuf.MessageOrBuilder { - - /** - *
        -   * The sessions being returned.
        -   * 
        - * - * repeated .google.showcase.v1beta1.Session sessions = 1; - */ - java.util.List - getSessionsList(); - /** - *
        -   * The sessions being returned.
        -   * 
        - * - * repeated .google.showcase.v1beta1.Session sessions = 1; - */ - com.google.showcase.v1beta1.Session getSessions(int index); - /** - *
        -   * The sessions being returned.
        -   * 
        - * - * repeated .google.showcase.v1beta1.Session sessions = 1; - */ - int getSessionsCount(); - /** - *
        -   * The sessions being returned.
        -   * 
        - * - * repeated .google.showcase.v1beta1.Session sessions = 1; - */ - java.util.List - getSessionsOrBuilderList(); - /** - *
        -   * The sessions being returned.
        -   * 
        - * - * repeated .google.showcase.v1beta1.Session sessions = 1; - */ - com.google.showcase.v1beta1.SessionOrBuilder getSessionsOrBuilder( - int index); - - /** - *
        -   * The next page token, if any.
        -   * An empty value here means the last page has been reached.
        -   * 
        - * - * string next_page_token = 2; - * @return The nextPageToken. - */ - java.lang.String getNextPageToken(); - /** - *
        -   * The next page token, if any.
        -   * An empty value here means the last page has been reached.
        -   * 
        - * - * string next_page_token = 2; - * @return The bytes for nextPageToken. - */ - com.google.protobuf.ByteString - getNextPageTokenBytes(); -} diff --git a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListTestsRequest.java b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListTestsRequest.java deleted file mode 100644 index 90275331e6..0000000000 --- a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListTestsRequest.java +++ /dev/null @@ -1,841 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: schema/google/showcase/v1beta1/testing.proto - -package com.google.showcase.v1beta1; - -/** - *
        - * The request for the ListTests method.
        - * 
        - * - * Protobuf type {@code google.showcase.v1beta1.ListTestsRequest} - */ -public final class ListTestsRequest extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.ListTestsRequest) - ListTestsRequestOrBuilder { -private static final long serialVersionUID = 0L; - // Use ListTestsRequest.newBuilder() to construct. - private ListTestsRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private ListTestsRequest() { - parent_ = ""; - pageToken_ = ""; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new ListTestsRequest(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private ListTestsRequest( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: { - java.lang.String s = input.readStringRequireUtf8(); - - parent_ = s; - break; - } - case 16: { - - pageSize_ = input.readInt32(); - break; - } - case 26: { - java.lang.String s = input.readStringRequireUtf8(); - - pageToken_ = s; - break; - } - default: { - if (!parseUnknownField( - input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException( - e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.google.showcase.v1beta1.TestingOuterClass.internal_static_google_showcase_v1beta1_ListTestsRequest_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.showcase.v1beta1.TestingOuterClass.internal_static_google_showcase_v1beta1_ListTestsRequest_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.showcase.v1beta1.ListTestsRequest.class, com.google.showcase.v1beta1.ListTestsRequest.Builder.class); - } - - public static final int PARENT_FIELD_NUMBER = 1; - private volatile java.lang.Object parent_; - /** - *
        -   * The session.
        -   * 
        - * - * string parent = 1 [(.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; - } - } - /** - *
        -   * The session.
        -   * 
        - * - * string parent = 1 [(.google.api.resource_reference) = { ... } - * @return The bytes for parent. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getParentBytes() { - java.lang.Object ref = parent_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - parent_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int PAGE_SIZE_FIELD_NUMBER = 2; - private int pageSize_; - /** - *
        -   * The maximum number of tests to return per page.
        -   * 
        - * - * int32 page_size = 2; - * @return The pageSize. - */ - @java.lang.Override - public int getPageSize() { - return pageSize_; - } - - public static final int PAGE_TOKEN_FIELD_NUMBER = 3; - private volatile java.lang.Object pageToken_; - /** - *
        -   * The page token, for retrieving subsequent pages.
        -   * 
        - * - * string page_token = 3; - * @return The pageToken. - */ - @java.lang.Override - public java.lang.String getPageToken() { - java.lang.Object ref = pageToken_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - pageToken_ = s; - return s; - } - } - /** - *
        -   * The page token, for retrieving subsequent pages.
        -   * 
        - * - * string page_token = 3; - * @return The bytes for pageToken. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getPageTokenBytes() { - java.lang.Object ref = pageToken_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - pageToken_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - private byte memoizedIsInitialized = -1; - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - if (!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_); - } - unknownFields.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_); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof com.google.showcase.v1beta1.ListTestsRequest)) { - return super.equals(obj); - } - com.google.showcase.v1beta1.ListTestsRequest other = (com.google.showcase.v1beta1.ListTestsRequest) obj; - - if (!getParent() - .equals(other.getParent())) return false; - if (getPageSize() - != other.getPageSize()) return false; - if (!getPageToken() - .equals(other.getPageToken())) return false; - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - hash = (37 * hash) + PARENT_FIELD_NUMBER; - hash = (53 * hash) + getParent().hashCode(); - hash = (37 * hash) + PAGE_SIZE_FIELD_NUMBER; - hash = (53 * hash) + getPageSize(); - hash = (37 * hash) + PAGE_TOKEN_FIELD_NUMBER; - hash = (53 * hash) + getPageToken().hashCode(); - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.showcase.v1beta1.ListTestsRequest parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.showcase.v1beta1.ListTestsRequest parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.showcase.v1beta1.ListTestsRequest parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.showcase.v1beta1.ListTestsRequest 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.showcase.v1beta1.ListTestsRequest parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.showcase.v1beta1.ListTestsRequest parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.showcase.v1beta1.ListTestsRequest parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static com.google.showcase.v1beta1.ListTestsRequest 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.showcase.v1beta1.ListTestsRequest parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static com.google.showcase.v1beta1.ListTestsRequest 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.showcase.v1beta1.ListTestsRequest parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static com.google.showcase.v1beta1.ListTestsRequest 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.showcase.v1beta1.ListTestsRequest 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 request for the ListTests method.
        -   * 
        - * - * Protobuf type {@code google.showcase.v1beta1.ListTestsRequest} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.ListTestsRequest) - com.google.showcase.v1beta1.ListTestsRequestOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.google.showcase.v1beta1.TestingOuterClass.internal_static_google_showcase_v1beta1_ListTestsRequest_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.showcase.v1beta1.TestingOuterClass.internal_static_google_showcase_v1beta1_ListTestsRequest_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.showcase.v1beta1.ListTestsRequest.class, com.google.showcase.v1beta1.ListTestsRequest.Builder.class); - } - - // Construct using com.google.showcase.v1beta1.ListTestsRequest.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { - } - } - @java.lang.Override - public Builder clear() { - super.clear(); - parent_ = ""; - - pageSize_ = 0; - - pageToken_ = ""; - - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return com.google.showcase.v1beta1.TestingOuterClass.internal_static_google_showcase_v1beta1_ListTestsRequest_descriptor; - } - - @java.lang.Override - public com.google.showcase.v1beta1.ListTestsRequest getDefaultInstanceForType() { - return com.google.showcase.v1beta1.ListTestsRequest.getDefaultInstance(); - } - - @java.lang.Override - public com.google.showcase.v1beta1.ListTestsRequest build() { - com.google.showcase.v1beta1.ListTestsRequest result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.showcase.v1beta1.ListTestsRequest buildPartial() { - com.google.showcase.v1beta1.ListTestsRequest result = new com.google.showcase.v1beta1.ListTestsRequest(this); - result.parent_ = parent_; - result.pageSize_ = pageSize_; - result.pageToken_ = pageToken_; - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.setField(field, value); - } - @java.lang.Override - public Builder clearField( - com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - @java.lang.Override - public Builder clearOneof( - com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.addRepeatedField(field, value); - } - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof com.google.showcase.v1beta1.ListTestsRequest) { - return mergeFrom((com.google.showcase.v1beta1.ListTestsRequest)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.showcase.v1beta1.ListTestsRequest other) { - if (other == com.google.showcase.v1beta1.ListTestsRequest.getDefaultInstance()) return this; - if (!other.getParent().isEmpty()) { - parent_ = other.parent_; - onChanged(); - } - if (other.getPageSize() != 0) { - setPageSize(other.getPageSize()); - } - if (!other.getPageToken().isEmpty()) { - pageToken_ = other.pageToken_; - onChanged(); - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - com.google.showcase.v1beta1.ListTestsRequest parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (com.google.showcase.v1beta1.ListTestsRequest) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private java.lang.Object parent_ = ""; - /** - *
        -     * The session.
        -     * 
        - * - * string parent = 1 [(.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; - } - } - /** - *
        -     * The session.
        -     * 
        - * - * string parent = 1 [(.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; - } - } - /** - *
        -     * The session.
        -     * 
        - * - * string parent = 1 [(.google.api.resource_reference) = { ... } - * @param value The parent to set. - * @return This builder for chaining. - */ - public Builder setParent( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - parent_ = value; - onChanged(); - return this; - } - /** - *
        -     * The session.
        -     * 
        - * - * string parent = 1 [(.google.api.resource_reference) = { ... } - * @return This builder for chaining. - */ - public Builder clearParent() { - - parent_ = getDefaultInstance().getParent(); - onChanged(); - return this; - } - /** - *
        -     * The session.
        -     * 
        - * - * string parent = 1 [(.google.api.resource_reference) = { ... } - * @param value The bytes for parent to set. - * @return This builder for chaining. - */ - public Builder setParentBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - parent_ = value; - onChanged(); - return this; - } - - private int pageSize_ ; - /** - *
        -     * The maximum number of tests to return per page.
        -     * 
        - * - * int32 page_size = 2; - * @return The pageSize. - */ - @java.lang.Override - public int getPageSize() { - return pageSize_; - } - /** - *
        -     * The maximum number of tests to return per page.
        -     * 
        - * - * int32 page_size = 2; - * @param value The pageSize to set. - * @return This builder for chaining. - */ - public Builder setPageSize(int value) { - - pageSize_ = value; - onChanged(); - return this; - } - /** - *
        -     * The maximum number of tests to return per page.
        -     * 
        - * - * int32 page_size = 2; - * @return This builder for chaining. - */ - public Builder clearPageSize() { - - pageSize_ = 0; - onChanged(); - return this; - } - - private java.lang.Object pageToken_ = ""; - /** - *
        -     * The page token, for retrieving subsequent pages.
        -     * 
        - * - * string page_token = 3; - * @return The pageToken. - */ - public java.lang.String getPageToken() { - java.lang.Object ref = pageToken_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - pageToken_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - *
        -     * The page token, for retrieving subsequent pages.
        -     * 
        - * - * string page_token = 3; - * @return The bytes for pageToken. - */ - public com.google.protobuf.ByteString - getPageTokenBytes() { - java.lang.Object ref = pageToken_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - pageToken_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - *
        -     * The page token, for retrieving subsequent pages.
        -     * 
        - * - * string page_token = 3; - * @param value The pageToken to set. - * @return This builder for chaining. - */ - public Builder setPageToken( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - pageToken_ = value; - onChanged(); - return this; - } - /** - *
        -     * The page token, for retrieving subsequent pages.
        -     * 
        - * - * string page_token = 3; - * @return This builder for chaining. - */ - public Builder clearPageToken() { - - pageToken_ = getDefaultInstance().getPageToken(); - onChanged(); - return this; - } - /** - *
        -     * The page token, for retrieving subsequent pages.
        -     * 
        - * - * string page_token = 3; - * @param value The bytes for pageToken to set. - * @return This builder for chaining. - */ - public Builder setPageTokenBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - pageToken_ = value; - onChanged(); - return this; - } - @java.lang.Override - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - - // @@protoc_insertion_point(builder_scope:google.showcase.v1beta1.ListTestsRequest) - } - - // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.ListTestsRequest) - private static final com.google.showcase.v1beta1.ListTestsRequest DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new com.google.showcase.v1beta1.ListTestsRequest(); - } - - public static com.google.showcase.v1beta1.ListTestsRequest getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public ListTestsRequest parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new ListTestsRequest(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public com.google.showcase.v1beta1.ListTestsRequest getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListTestsRequestOrBuilder.java b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListTestsRequestOrBuilder.java deleted file mode 100644 index be84bb6248..0000000000 --- a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListTestsRequestOrBuilder.java +++ /dev/null @@ -1,59 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: schema/google/showcase/v1beta1/testing.proto - -package com.google.showcase.v1beta1; - -public interface ListTestsRequestOrBuilder extends - // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.ListTestsRequest) - com.google.protobuf.MessageOrBuilder { - - /** - *
        -   * The session.
        -   * 
        - * - * string parent = 1 [(.google.api.resource_reference) = { ... } - * @return The parent. - */ - java.lang.String getParent(); - /** - *
        -   * The session.
        -   * 
        - * - * string parent = 1 [(.google.api.resource_reference) = { ... } - * @return The bytes for parent. - */ - com.google.protobuf.ByteString - getParentBytes(); - - /** - *
        -   * The maximum number of tests to return per page.
        -   * 
        - * - * int32 page_size = 2; - * @return The pageSize. - */ - int getPageSize(); - - /** - *
        -   * The page token, for retrieving subsequent pages.
        -   * 
        - * - * string page_token = 3; - * @return The pageToken. - */ - java.lang.String getPageToken(); - /** - *
        -   * The page token, for retrieving subsequent pages.
        -   * 
        - * - * string page_token = 3; - * @return The bytes for pageToken. - */ - com.google.protobuf.ByteString - getPageTokenBytes(); -} diff --git a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListTestsResponse.java b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListTestsResponse.java deleted file mode 100644 index 7fa4dca4d8..0000000000 --- a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListTestsResponse.java +++ /dev/null @@ -1,1045 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: schema/google/showcase/v1beta1/testing.proto - -package com.google.showcase.v1beta1; - -/** - *
        - * The response for the ListTests method.
        - * 
        - * - * Protobuf type {@code google.showcase.v1beta1.ListTestsResponse} - */ -public final class ListTestsResponse extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.ListTestsResponse) - ListTestsResponseOrBuilder { -private static final long serialVersionUID = 0L; - // Use ListTestsResponse.newBuilder() to construct. - private ListTestsResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private ListTestsResponse() { - tests_ = java.util.Collections.emptyList(); - nextPageToken_ = ""; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new ListTestsResponse(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private ListTestsResponse( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - int mutable_bitField0_ = 0; - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: { - if (!((mutable_bitField0_ & 0x00000001) != 0)) { - tests_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000001; - } - tests_.add( - input.readMessage(com.google.showcase.v1beta1.Test.parser(), extensionRegistry)); - break; - } - case 18: { - java.lang.String s = input.readStringRequireUtf8(); - - nextPageToken_ = s; - break; - } - default: { - if (!parseUnknownField( - input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException( - e).setUnfinishedMessage(this); - } finally { - if (((mutable_bitField0_ & 0x00000001) != 0)) { - tests_ = java.util.Collections.unmodifiableList(tests_); - } - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.google.showcase.v1beta1.TestingOuterClass.internal_static_google_showcase_v1beta1_ListTestsResponse_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.showcase.v1beta1.TestingOuterClass.internal_static_google_showcase_v1beta1_ListTestsResponse_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.showcase.v1beta1.ListTestsResponse.class, com.google.showcase.v1beta1.ListTestsResponse.Builder.class); - } - - public static final int TESTS_FIELD_NUMBER = 1; - private java.util.List tests_; - /** - *
        -   * The tests being returned.
        -   * 
        - * - * repeated .google.showcase.v1beta1.Test tests = 1; - */ - @java.lang.Override - public java.util.List getTestsList() { - return tests_; - } - /** - *
        -   * The tests being returned.
        -   * 
        - * - * repeated .google.showcase.v1beta1.Test tests = 1; - */ - @java.lang.Override - public java.util.List - getTestsOrBuilderList() { - return tests_; - } - /** - *
        -   * The tests being returned.
        -   * 
        - * - * repeated .google.showcase.v1beta1.Test tests = 1; - */ - @java.lang.Override - public int getTestsCount() { - return tests_.size(); - } - /** - *
        -   * The tests being returned.
        -   * 
        - * - * repeated .google.showcase.v1beta1.Test tests = 1; - */ - @java.lang.Override - public com.google.showcase.v1beta1.Test getTests(int index) { - return tests_.get(index); - } - /** - *
        -   * The tests being returned.
        -   * 
        - * - * repeated .google.showcase.v1beta1.Test tests = 1; - */ - @java.lang.Override - public com.google.showcase.v1beta1.TestOrBuilder getTestsOrBuilder( - int index) { - return tests_.get(index); - } - - public static final int NEXT_PAGE_TOKEN_FIELD_NUMBER = 2; - private volatile java.lang.Object nextPageToken_; - /** - *
        -   * The next page token, if any.
        -   * An empty value here means the last page has been reached.
        -   * 
        - * - * 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; - } - } - /** - *
        -   * The next page token, if any.
        -   * An empty value here means the last page has been reached.
        -   * 
        - * - * 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 < tests_.size(); i++) { - output.writeMessage(1, tests_.get(i)); - } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nextPageToken_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 2, nextPageToken_); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - for (int i = 0; i < tests_.size(); i++) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(1, tests_.get(i)); - } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nextPageToken_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, nextPageToken_); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof com.google.showcase.v1beta1.ListTestsResponse)) { - return super.equals(obj); - } - com.google.showcase.v1beta1.ListTestsResponse other = (com.google.showcase.v1beta1.ListTestsResponse) obj; - - if (!getTestsList() - .equals(other.getTestsList())) return false; - if (!getNextPageToken() - .equals(other.getNextPageToken())) return false; - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - if (getTestsCount() > 0) { - hash = (37 * hash) + TESTS_FIELD_NUMBER; - hash = (53 * hash) + getTestsList().hashCode(); - } - hash = (37 * hash) + NEXT_PAGE_TOKEN_FIELD_NUMBER; - hash = (53 * hash) + getNextPageToken().hashCode(); - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.showcase.v1beta1.ListTestsResponse parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.showcase.v1beta1.ListTestsResponse parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.showcase.v1beta1.ListTestsResponse parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.showcase.v1beta1.ListTestsResponse 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.showcase.v1beta1.ListTestsResponse parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.showcase.v1beta1.ListTestsResponse parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.showcase.v1beta1.ListTestsResponse parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static com.google.showcase.v1beta1.ListTestsResponse 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.showcase.v1beta1.ListTestsResponse parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static com.google.showcase.v1beta1.ListTestsResponse 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.showcase.v1beta1.ListTestsResponse parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static com.google.showcase.v1beta1.ListTestsResponse 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.showcase.v1beta1.ListTestsResponse 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 for the ListTests method.
        -   * 
        - * - * Protobuf type {@code google.showcase.v1beta1.ListTestsResponse} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.ListTestsResponse) - com.google.showcase.v1beta1.ListTestsResponseOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.google.showcase.v1beta1.TestingOuterClass.internal_static_google_showcase_v1beta1_ListTestsResponse_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.showcase.v1beta1.TestingOuterClass.internal_static_google_showcase_v1beta1_ListTestsResponse_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.showcase.v1beta1.ListTestsResponse.class, com.google.showcase.v1beta1.ListTestsResponse.Builder.class); - } - - // Construct using com.google.showcase.v1beta1.ListTestsResponse.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { - getTestsFieldBuilder(); - } - } - @java.lang.Override - public Builder clear() { - super.clear(); - if (testsBuilder_ == null) { - tests_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - } else { - testsBuilder_.clear(); - } - nextPageToken_ = ""; - - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return com.google.showcase.v1beta1.TestingOuterClass.internal_static_google_showcase_v1beta1_ListTestsResponse_descriptor; - } - - @java.lang.Override - public com.google.showcase.v1beta1.ListTestsResponse getDefaultInstanceForType() { - return com.google.showcase.v1beta1.ListTestsResponse.getDefaultInstance(); - } - - @java.lang.Override - public com.google.showcase.v1beta1.ListTestsResponse build() { - com.google.showcase.v1beta1.ListTestsResponse result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.showcase.v1beta1.ListTestsResponse buildPartial() { - com.google.showcase.v1beta1.ListTestsResponse result = new com.google.showcase.v1beta1.ListTestsResponse(this); - int from_bitField0_ = bitField0_; - if (testsBuilder_ == null) { - if (((bitField0_ & 0x00000001) != 0)) { - tests_ = java.util.Collections.unmodifiableList(tests_); - bitField0_ = (bitField0_ & ~0x00000001); - } - result.tests_ = tests_; - } else { - result.tests_ = testsBuilder_.build(); - } - result.nextPageToken_ = nextPageToken_; - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.setField(field, value); - } - @java.lang.Override - public Builder clearField( - com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - @java.lang.Override - public Builder clearOneof( - com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.addRepeatedField(field, value); - } - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof com.google.showcase.v1beta1.ListTestsResponse) { - return mergeFrom((com.google.showcase.v1beta1.ListTestsResponse)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.showcase.v1beta1.ListTestsResponse other) { - if (other == com.google.showcase.v1beta1.ListTestsResponse.getDefaultInstance()) return this; - if (testsBuilder_ == null) { - if (!other.tests_.isEmpty()) { - if (tests_.isEmpty()) { - tests_ = other.tests_; - bitField0_ = (bitField0_ & ~0x00000001); - } else { - ensureTestsIsMutable(); - tests_.addAll(other.tests_); - } - onChanged(); - } - } else { - if (!other.tests_.isEmpty()) { - if (testsBuilder_.isEmpty()) { - testsBuilder_.dispose(); - testsBuilder_ = null; - tests_ = other.tests_; - bitField0_ = (bitField0_ & ~0x00000001); - testsBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? - getTestsFieldBuilder() : null; - } else { - testsBuilder_.addAllMessages(other.tests_); - } - } - } - if (!other.getNextPageToken().isEmpty()) { - nextPageToken_ = other.nextPageToken_; - onChanged(); - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - com.google.showcase.v1beta1.ListTestsResponse parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (com.google.showcase.v1beta1.ListTestsResponse) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - private int bitField0_; - - private java.util.List tests_ = - java.util.Collections.emptyList(); - private void ensureTestsIsMutable() { - if (!((bitField0_ & 0x00000001) != 0)) { - tests_ = new java.util.ArrayList(tests_); - bitField0_ |= 0x00000001; - } - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - com.google.showcase.v1beta1.Test, com.google.showcase.v1beta1.Test.Builder, com.google.showcase.v1beta1.TestOrBuilder> testsBuilder_; - - /** - *
        -     * The tests being returned.
        -     * 
        - * - * repeated .google.showcase.v1beta1.Test tests = 1; - */ - public java.util.List getTestsList() { - if (testsBuilder_ == null) { - return java.util.Collections.unmodifiableList(tests_); - } else { - return testsBuilder_.getMessageList(); - } - } - /** - *
        -     * The tests being returned.
        -     * 
        - * - * repeated .google.showcase.v1beta1.Test tests = 1; - */ - public int getTestsCount() { - if (testsBuilder_ == null) { - return tests_.size(); - } else { - return testsBuilder_.getCount(); - } - } - /** - *
        -     * The tests being returned.
        -     * 
        - * - * repeated .google.showcase.v1beta1.Test tests = 1; - */ - public com.google.showcase.v1beta1.Test getTests(int index) { - if (testsBuilder_ == null) { - return tests_.get(index); - } else { - return testsBuilder_.getMessage(index); - } - } - /** - *
        -     * The tests being returned.
        -     * 
        - * - * repeated .google.showcase.v1beta1.Test tests = 1; - */ - public Builder setTests( - int index, com.google.showcase.v1beta1.Test value) { - if (testsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureTestsIsMutable(); - tests_.set(index, value); - onChanged(); - } else { - testsBuilder_.setMessage(index, value); - } - return this; - } - /** - *
        -     * The tests being returned.
        -     * 
        - * - * repeated .google.showcase.v1beta1.Test tests = 1; - */ - public Builder setTests( - int index, com.google.showcase.v1beta1.Test.Builder builderForValue) { - if (testsBuilder_ == null) { - ensureTestsIsMutable(); - tests_.set(index, builderForValue.build()); - onChanged(); - } else { - testsBuilder_.setMessage(index, builderForValue.build()); - } - return this; - } - /** - *
        -     * The tests being returned.
        -     * 
        - * - * repeated .google.showcase.v1beta1.Test tests = 1; - */ - public Builder addTests(com.google.showcase.v1beta1.Test value) { - if (testsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureTestsIsMutable(); - tests_.add(value); - onChanged(); - } else { - testsBuilder_.addMessage(value); - } - return this; - } - /** - *
        -     * The tests being returned.
        -     * 
        - * - * repeated .google.showcase.v1beta1.Test tests = 1; - */ - public Builder addTests( - int index, com.google.showcase.v1beta1.Test value) { - if (testsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureTestsIsMutable(); - tests_.add(index, value); - onChanged(); - } else { - testsBuilder_.addMessage(index, value); - } - return this; - } - /** - *
        -     * The tests being returned.
        -     * 
        - * - * repeated .google.showcase.v1beta1.Test tests = 1; - */ - public Builder addTests( - com.google.showcase.v1beta1.Test.Builder builderForValue) { - if (testsBuilder_ == null) { - ensureTestsIsMutable(); - tests_.add(builderForValue.build()); - onChanged(); - } else { - testsBuilder_.addMessage(builderForValue.build()); - } - return this; - } - /** - *
        -     * The tests being returned.
        -     * 
        - * - * repeated .google.showcase.v1beta1.Test tests = 1; - */ - public Builder addTests( - int index, com.google.showcase.v1beta1.Test.Builder builderForValue) { - if (testsBuilder_ == null) { - ensureTestsIsMutable(); - tests_.add(index, builderForValue.build()); - onChanged(); - } else { - testsBuilder_.addMessage(index, builderForValue.build()); - } - return this; - } - /** - *
        -     * The tests being returned.
        -     * 
        - * - * repeated .google.showcase.v1beta1.Test tests = 1; - */ - public Builder addAllTests( - java.lang.Iterable values) { - if (testsBuilder_ == null) { - ensureTestsIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, tests_); - onChanged(); - } else { - testsBuilder_.addAllMessages(values); - } - return this; - } - /** - *
        -     * The tests being returned.
        -     * 
        - * - * repeated .google.showcase.v1beta1.Test tests = 1; - */ - public Builder clearTests() { - if (testsBuilder_ == null) { - tests_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - onChanged(); - } else { - testsBuilder_.clear(); - } - return this; - } - /** - *
        -     * The tests being returned.
        -     * 
        - * - * repeated .google.showcase.v1beta1.Test tests = 1; - */ - public Builder removeTests(int index) { - if (testsBuilder_ == null) { - ensureTestsIsMutable(); - tests_.remove(index); - onChanged(); - } else { - testsBuilder_.remove(index); - } - return this; - } - /** - *
        -     * The tests being returned.
        -     * 
        - * - * repeated .google.showcase.v1beta1.Test tests = 1; - */ - public com.google.showcase.v1beta1.Test.Builder getTestsBuilder( - int index) { - return getTestsFieldBuilder().getBuilder(index); - } - /** - *
        -     * The tests being returned.
        -     * 
        - * - * repeated .google.showcase.v1beta1.Test tests = 1; - */ - public com.google.showcase.v1beta1.TestOrBuilder getTestsOrBuilder( - int index) { - if (testsBuilder_ == null) { - return tests_.get(index); } else { - return testsBuilder_.getMessageOrBuilder(index); - } - } - /** - *
        -     * The tests being returned.
        -     * 
        - * - * repeated .google.showcase.v1beta1.Test tests = 1; - */ - public java.util.List - getTestsOrBuilderList() { - if (testsBuilder_ != null) { - return testsBuilder_.getMessageOrBuilderList(); - } else { - return java.util.Collections.unmodifiableList(tests_); - } - } - /** - *
        -     * The tests being returned.
        -     * 
        - * - * repeated .google.showcase.v1beta1.Test tests = 1; - */ - public com.google.showcase.v1beta1.Test.Builder addTestsBuilder() { - return getTestsFieldBuilder().addBuilder( - com.google.showcase.v1beta1.Test.getDefaultInstance()); - } - /** - *
        -     * The tests being returned.
        -     * 
        - * - * repeated .google.showcase.v1beta1.Test tests = 1; - */ - public com.google.showcase.v1beta1.Test.Builder addTestsBuilder( - int index) { - return getTestsFieldBuilder().addBuilder( - index, com.google.showcase.v1beta1.Test.getDefaultInstance()); - } - /** - *
        -     * The tests being returned.
        -     * 
        - * - * repeated .google.showcase.v1beta1.Test tests = 1; - */ - public java.util.List - getTestsBuilderList() { - return getTestsFieldBuilder().getBuilderList(); - } - private com.google.protobuf.RepeatedFieldBuilderV3< - com.google.showcase.v1beta1.Test, com.google.showcase.v1beta1.Test.Builder, com.google.showcase.v1beta1.TestOrBuilder> - getTestsFieldBuilder() { - if (testsBuilder_ == null) { - testsBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< - com.google.showcase.v1beta1.Test, com.google.showcase.v1beta1.Test.Builder, com.google.showcase.v1beta1.TestOrBuilder>( - tests_, - ((bitField0_ & 0x00000001) != 0), - getParentForChildren(), - isClean()); - tests_ = null; - } - return testsBuilder_; - } - - private java.lang.Object nextPageToken_ = ""; - /** - *
        -     * The next page token, if any.
        -     * An empty value here means the last page has been reached.
        -     * 
        - * - * 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; - } - } - /** - *
        -     * The next page token, if any.
        -     * An empty value here means the last page has been reached.
        -     * 
        - * - * 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; - } - } - /** - *
        -     * The next page token, if any.
        -     * An empty value here means the last page has been reached.
        -     * 
        - * - * string next_page_token = 2; - * @param value The nextPageToken to set. - * @return This builder for chaining. - */ - public Builder setNextPageToken( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - nextPageToken_ = value; - onChanged(); - return this; - } - /** - *
        -     * The next page token, if any.
        -     * An empty value here means the last page has been reached.
        -     * 
        - * - * string next_page_token = 2; - * @return This builder for chaining. - */ - public Builder clearNextPageToken() { - - nextPageToken_ = getDefaultInstance().getNextPageToken(); - onChanged(); - return this; - } - /** - *
        -     * The next page token, if any.
        -     * An empty value here means the last page has been reached.
        -     * 
        - * - * string next_page_token = 2; - * @param value The bytes for nextPageToken to set. - * @return This builder for chaining. - */ - public Builder setNextPageTokenBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - nextPageToken_ = value; - onChanged(); - return this; - } - @java.lang.Override - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - - // @@protoc_insertion_point(builder_scope:google.showcase.v1beta1.ListTestsResponse) - } - - // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.ListTestsResponse) - private static final com.google.showcase.v1beta1.ListTestsResponse DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new com.google.showcase.v1beta1.ListTestsResponse(); - } - - public static com.google.showcase.v1beta1.ListTestsResponse getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public ListTestsResponse parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new ListTestsResponse(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public com.google.showcase.v1beta1.ListTestsResponse getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListTestsResponseOrBuilder.java b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListTestsResponseOrBuilder.java deleted file mode 100644 index 81665ac3c3..0000000000 --- a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListTestsResponseOrBuilder.java +++ /dev/null @@ -1,75 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: schema/google/showcase/v1beta1/testing.proto - -package com.google.showcase.v1beta1; - -public interface ListTestsResponseOrBuilder extends - // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.ListTestsResponse) - com.google.protobuf.MessageOrBuilder { - - /** - *
        -   * The tests being returned.
        -   * 
        - * - * repeated .google.showcase.v1beta1.Test tests = 1; - */ - java.util.List - getTestsList(); - /** - *
        -   * The tests being returned.
        -   * 
        - * - * repeated .google.showcase.v1beta1.Test tests = 1; - */ - com.google.showcase.v1beta1.Test getTests(int index); - /** - *
        -   * The tests being returned.
        -   * 
        - * - * repeated .google.showcase.v1beta1.Test tests = 1; - */ - int getTestsCount(); - /** - *
        -   * The tests being returned.
        -   * 
        - * - * repeated .google.showcase.v1beta1.Test tests = 1; - */ - java.util.List - getTestsOrBuilderList(); - /** - *
        -   * The tests being returned.
        -   * 
        - * - * repeated .google.showcase.v1beta1.Test tests = 1; - */ - com.google.showcase.v1beta1.TestOrBuilder getTestsOrBuilder( - int index); - - /** - *
        -   * The next page token, if any.
        -   * An empty value here means the last page has been reached.
        -   * 
        - * - * string next_page_token = 2; - * @return The nextPageToken. - */ - java.lang.String getNextPageToken(); - /** - *
        -   * The next page token, if any.
        -   * An empty value here means the last page has been reached.
        -   * 
        - * - * string next_page_token = 2; - * @return The bytes for nextPageToken. - */ - com.google.protobuf.ByteString - getNextPageTokenBytes(); -} diff --git a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListUsersRequest.java b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListUsersRequest.java deleted file mode 100644 index 7f5da71c80..0000000000 --- a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListUsersRequest.java +++ /dev/null @@ -1,695 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: schema/google/showcase/v1beta1/identity.proto - -package com.google.showcase.v1beta1; - -/** - *
        - * The request message for the google.showcase.v1beta1.Identity\ListUsers
        - * method.
        - * 
        - * - * Protobuf type {@code google.showcase.v1beta1.ListUsersRequest} - */ -public final class ListUsersRequest extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.ListUsersRequest) - ListUsersRequestOrBuilder { -private static final long serialVersionUID = 0L; - // Use ListUsersRequest.newBuilder() to construct. - private ListUsersRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private ListUsersRequest() { - pageToken_ = ""; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new ListUsersRequest(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private ListUsersRequest( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 8: { - - pageSize_ = input.readInt32(); - break; - } - case 18: { - java.lang.String s = input.readStringRequireUtf8(); - - pageToken_ = s; - break; - } - default: { - if (!parseUnknownField( - input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException( - e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.google.showcase.v1beta1.IdentityOuterClass.internal_static_google_showcase_v1beta1_ListUsersRequest_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.showcase.v1beta1.IdentityOuterClass.internal_static_google_showcase_v1beta1_ListUsersRequest_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.showcase.v1beta1.ListUsersRequest.class, com.google.showcase.v1beta1.ListUsersRequest.Builder.class); - } - - public static final int PAGE_SIZE_FIELD_NUMBER = 1; - private int pageSize_; - /** - *
        -   * The maximum number of users to return. Server may return fewer users
        -   * than requested. If unspecified, server will pick an appropriate default.
        -   * 
        - * - * int32 page_size = 1; - * @return The pageSize. - */ - @java.lang.Override - public int getPageSize() { - return pageSize_; - } - - public static final int PAGE_TOKEN_FIELD_NUMBER = 2; - private volatile java.lang.Object pageToken_; - /** - *
        -   * The value of google.showcase.v1beta1.ListUsersResponse.next_page_token
        -   * returned from the previous call to
        -   * `google.showcase.v1beta1.Identity\ListUsers` method.
        -   * 
        - * - * string page_token = 2; - * @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; - } - } - /** - *
        -   * The value of google.showcase.v1beta1.ListUsersResponse.next_page_token
        -   * returned from the previous call to
        -   * `google.showcase.v1beta1.Identity\ListUsers` method.
        -   * 
        - * - * string page_token = 2; - * @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_); - } - unknownFields.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 += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof com.google.showcase.v1beta1.ListUsersRequest)) { - return super.equals(obj); - } - com.google.showcase.v1beta1.ListUsersRequest other = (com.google.showcase.v1beta1.ListUsersRequest) obj; - - if (getPageSize() - != other.getPageSize()) return false; - if (!getPageToken() - .equals(other.getPageToken())) return false; - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - hash = (37 * hash) + PAGE_SIZE_FIELD_NUMBER; - hash = (53 * hash) + getPageSize(); - hash = (37 * hash) + PAGE_TOKEN_FIELD_NUMBER; - hash = (53 * hash) + getPageToken().hashCode(); - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.showcase.v1beta1.ListUsersRequest parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.showcase.v1beta1.ListUsersRequest parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.showcase.v1beta1.ListUsersRequest parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.showcase.v1beta1.ListUsersRequest 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.showcase.v1beta1.ListUsersRequest parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.showcase.v1beta1.ListUsersRequest parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.showcase.v1beta1.ListUsersRequest parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static com.google.showcase.v1beta1.ListUsersRequest 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.showcase.v1beta1.ListUsersRequest parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static com.google.showcase.v1beta1.ListUsersRequest 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.showcase.v1beta1.ListUsersRequest parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static com.google.showcase.v1beta1.ListUsersRequest 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.showcase.v1beta1.ListUsersRequest 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 request message for the google.showcase.v1beta1.Identity\ListUsers
        -   * method.
        -   * 
        - * - * Protobuf type {@code google.showcase.v1beta1.ListUsersRequest} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.ListUsersRequest) - com.google.showcase.v1beta1.ListUsersRequestOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.google.showcase.v1beta1.IdentityOuterClass.internal_static_google_showcase_v1beta1_ListUsersRequest_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.showcase.v1beta1.IdentityOuterClass.internal_static_google_showcase_v1beta1_ListUsersRequest_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.showcase.v1beta1.ListUsersRequest.class, com.google.showcase.v1beta1.ListUsersRequest.Builder.class); - } - - // Construct using com.google.showcase.v1beta1.ListUsersRequest.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { - } - } - @java.lang.Override - public Builder clear() { - super.clear(); - pageSize_ = 0; - - pageToken_ = ""; - - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return com.google.showcase.v1beta1.IdentityOuterClass.internal_static_google_showcase_v1beta1_ListUsersRequest_descriptor; - } - - @java.lang.Override - public com.google.showcase.v1beta1.ListUsersRequest getDefaultInstanceForType() { - return com.google.showcase.v1beta1.ListUsersRequest.getDefaultInstance(); - } - - @java.lang.Override - public com.google.showcase.v1beta1.ListUsersRequest build() { - com.google.showcase.v1beta1.ListUsersRequest result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.showcase.v1beta1.ListUsersRequest buildPartial() { - com.google.showcase.v1beta1.ListUsersRequest result = new com.google.showcase.v1beta1.ListUsersRequest(this); - result.pageSize_ = pageSize_; - result.pageToken_ = pageToken_; - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.setField(field, value); - } - @java.lang.Override - public Builder clearField( - com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - @java.lang.Override - public Builder clearOneof( - com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.addRepeatedField(field, value); - } - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof com.google.showcase.v1beta1.ListUsersRequest) { - return mergeFrom((com.google.showcase.v1beta1.ListUsersRequest)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.showcase.v1beta1.ListUsersRequest other) { - if (other == com.google.showcase.v1beta1.ListUsersRequest.getDefaultInstance()) return this; - if (other.getPageSize() != 0) { - setPageSize(other.getPageSize()); - } - if (!other.getPageToken().isEmpty()) { - pageToken_ = other.pageToken_; - onChanged(); - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - com.google.showcase.v1beta1.ListUsersRequest parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (com.google.showcase.v1beta1.ListUsersRequest) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private int pageSize_ ; - /** - *
        -     * The maximum number of users to return. Server may return fewer users
        -     * than requested. If unspecified, server will pick an appropriate default.
        -     * 
        - * - * int32 page_size = 1; - * @return The pageSize. - */ - @java.lang.Override - public int getPageSize() { - return pageSize_; - } - /** - *
        -     * The maximum number of users to return. Server may return fewer users
        -     * than requested. If unspecified, server will pick an appropriate default.
        -     * 
        - * - * int32 page_size = 1; - * @param value The pageSize to set. - * @return This builder for chaining. - */ - public Builder setPageSize(int value) { - - pageSize_ = value; - onChanged(); - return this; - } - /** - *
        -     * The maximum number of users to return. Server may return fewer users
        -     * than requested. If unspecified, server will pick an appropriate default.
        -     * 
        - * - * int32 page_size = 1; - * @return This builder for chaining. - */ - public Builder clearPageSize() { - - pageSize_ = 0; - onChanged(); - return this; - } - - private java.lang.Object pageToken_ = ""; - /** - *
        -     * The value of google.showcase.v1beta1.ListUsersResponse.next_page_token
        -     * returned from the previous call to
        -     * `google.showcase.v1beta1.Identity\ListUsers` method.
        -     * 
        - * - * string page_token = 2; - * @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; - } - } - /** - *
        -     * The value of google.showcase.v1beta1.ListUsersResponse.next_page_token
        -     * returned from the previous call to
        -     * `google.showcase.v1beta1.Identity\ListUsers` method.
        -     * 
        - * - * string page_token = 2; - * @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; - } - } - /** - *
        -     * The value of google.showcase.v1beta1.ListUsersResponse.next_page_token
        -     * returned from the previous call to
        -     * `google.showcase.v1beta1.Identity\ListUsers` method.
        -     * 
        - * - * string page_token = 2; - * @param value The pageToken to set. - * @return This builder for chaining. - */ - public Builder setPageToken( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - pageToken_ = value; - onChanged(); - return this; - } - /** - *
        -     * The value of google.showcase.v1beta1.ListUsersResponse.next_page_token
        -     * returned from the previous call to
        -     * `google.showcase.v1beta1.Identity\ListUsers` method.
        -     * 
        - * - * string page_token = 2; - * @return This builder for chaining. - */ - public Builder clearPageToken() { - - pageToken_ = getDefaultInstance().getPageToken(); - onChanged(); - return this; - } - /** - *
        -     * The value of google.showcase.v1beta1.ListUsersResponse.next_page_token
        -     * returned from the previous call to
        -     * `google.showcase.v1beta1.Identity\ListUsers` method.
        -     * 
        - * - * string page_token = 2; - * @param value The bytes for pageToken to set. - * @return This builder for chaining. - */ - public Builder setPageTokenBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - pageToken_ = value; - onChanged(); - return this; - } - @java.lang.Override - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - - // @@protoc_insertion_point(builder_scope:google.showcase.v1beta1.ListUsersRequest) - } - - // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.ListUsersRequest) - private static final com.google.showcase.v1beta1.ListUsersRequest DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new com.google.showcase.v1beta1.ListUsersRequest(); - } - - public static com.google.showcase.v1beta1.ListUsersRequest getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public ListUsersRequest parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new ListUsersRequest(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public com.google.showcase.v1beta1.ListUsersRequest getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListUsersRequestOrBuilder.java b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListUsersRequestOrBuilder.java deleted file mode 100644 index 6785ca3661..0000000000 --- a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListUsersRequestOrBuilder.java +++ /dev/null @@ -1,44 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: schema/google/showcase/v1beta1/identity.proto - -package com.google.showcase.v1beta1; - -public interface ListUsersRequestOrBuilder extends - // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.ListUsersRequest) - com.google.protobuf.MessageOrBuilder { - - /** - *
        -   * The maximum number of users to return. Server may return fewer users
        -   * than requested. If unspecified, server will pick an appropriate default.
        -   * 
        - * - * int32 page_size = 1; - * @return The pageSize. - */ - int getPageSize(); - - /** - *
        -   * The value of google.showcase.v1beta1.ListUsersResponse.next_page_token
        -   * returned from the previous call to
        -   * `google.showcase.v1beta1.Identity\ListUsers` method.
        -   * 
        - * - * string page_token = 2; - * @return The pageToken. - */ - java.lang.String getPageToken(); - /** - *
        -   * The value of google.showcase.v1beta1.ListUsersResponse.next_page_token
        -   * returned from the previous call to
        -   * `google.showcase.v1beta1.Identity\ListUsers` method.
        -   * 
        - * - * string page_token = 2; - * @return The bytes for pageToken. - */ - com.google.protobuf.ByteString - getPageTokenBytes(); -} diff --git a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListUsersResponse.java b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListUsersResponse.java deleted file mode 100644 index 693eb1c2ca..0000000000 --- a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListUsersResponse.java +++ /dev/null @@ -1,1061 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: schema/google/showcase/v1beta1/identity.proto - -package com.google.showcase.v1beta1; - -/** - *
        - * The response message for the google.showcase.v1beta1.Identity\ListUsers
        - * method.
        - * 
        - * - * Protobuf type {@code google.showcase.v1beta1.ListUsersResponse} - */ -public final class ListUsersResponse extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.ListUsersResponse) - ListUsersResponseOrBuilder { -private static final long serialVersionUID = 0L; - // Use ListUsersResponse.newBuilder() to construct. - private ListUsersResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private ListUsersResponse() { - users_ = java.util.Collections.emptyList(); - nextPageToken_ = ""; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new ListUsersResponse(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private ListUsersResponse( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - int mutable_bitField0_ = 0; - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: { - if (!((mutable_bitField0_ & 0x00000001) != 0)) { - users_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000001; - } - users_.add( - input.readMessage(com.google.showcase.v1beta1.User.parser(), extensionRegistry)); - break; - } - case 18: { - java.lang.String s = input.readStringRequireUtf8(); - - nextPageToken_ = s; - break; - } - default: { - if (!parseUnknownField( - input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException( - e).setUnfinishedMessage(this); - } finally { - if (((mutable_bitField0_ & 0x00000001) != 0)) { - users_ = java.util.Collections.unmodifiableList(users_); - } - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.google.showcase.v1beta1.IdentityOuterClass.internal_static_google_showcase_v1beta1_ListUsersResponse_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.showcase.v1beta1.IdentityOuterClass.internal_static_google_showcase_v1beta1_ListUsersResponse_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.showcase.v1beta1.ListUsersResponse.class, com.google.showcase.v1beta1.ListUsersResponse.Builder.class); - } - - public static final int USERS_FIELD_NUMBER = 1; - private java.util.List users_; - /** - *
        -   * The list of users.
        -   * 
        - * - * repeated .google.showcase.v1beta1.User users = 1; - */ - @java.lang.Override - public java.util.List getUsersList() { - return users_; - } - /** - *
        -   * The list of users.
        -   * 
        - * - * repeated .google.showcase.v1beta1.User users = 1; - */ - @java.lang.Override - public java.util.List - getUsersOrBuilderList() { - return users_; - } - /** - *
        -   * The list of users.
        -   * 
        - * - * repeated .google.showcase.v1beta1.User users = 1; - */ - @java.lang.Override - public int getUsersCount() { - return users_.size(); - } - /** - *
        -   * The list of users.
        -   * 
        - * - * repeated .google.showcase.v1beta1.User users = 1; - */ - @java.lang.Override - public com.google.showcase.v1beta1.User getUsers(int index) { - return users_.get(index); - } - /** - *
        -   * The list of users.
        -   * 
        - * - * repeated .google.showcase.v1beta1.User users = 1; - */ - @java.lang.Override - public com.google.showcase.v1beta1.UserOrBuilder getUsersOrBuilder( - int index) { - return users_.get(index); - } - - public static final int NEXT_PAGE_TOKEN_FIELD_NUMBER = 2; - private volatile java.lang.Object nextPageToken_; - /** - *
        -   * A token to retrieve next page of results.
        -   * Pass this value in ListUsersRequest.page_token field in the subsequent
        -   * call to `google.showcase.v1beta1.Message\ListUsers` method to retrieve the
        -   * next page of results.
        -   * 
        - * - * string next_page_token = 2; - * @return The nextPageToken. - */ - @java.lang.Override - public java.lang.String getNextPageToken() { - java.lang.Object ref = nextPageToken_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - nextPageToken_ = s; - return s; - } - } - /** - *
        -   * A token to retrieve next page of results.
        -   * Pass this value in ListUsersRequest.page_token field in the subsequent
        -   * call to `google.showcase.v1beta1.Message\ListUsers` method to retrieve the
        -   * next page of results.
        -   * 
        - * - * string next_page_token = 2; - * @return The bytes for nextPageToken. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getNextPageTokenBytes() { - java.lang.Object ref = nextPageToken_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - nextPageToken_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - private byte memoizedIsInitialized = -1; - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - for (int i = 0; i < users_.size(); i++) { - output.writeMessage(1, users_.get(i)); - } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nextPageToken_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 2, nextPageToken_); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - for (int i = 0; i < users_.size(); i++) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(1, users_.get(i)); - } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nextPageToken_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, nextPageToken_); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof com.google.showcase.v1beta1.ListUsersResponse)) { - return super.equals(obj); - } - com.google.showcase.v1beta1.ListUsersResponse other = (com.google.showcase.v1beta1.ListUsersResponse) obj; - - if (!getUsersList() - .equals(other.getUsersList())) return false; - if (!getNextPageToken() - .equals(other.getNextPageToken())) return false; - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - if (getUsersCount() > 0) { - hash = (37 * hash) + USERS_FIELD_NUMBER; - hash = (53 * hash) + getUsersList().hashCode(); - } - hash = (37 * hash) + NEXT_PAGE_TOKEN_FIELD_NUMBER; - hash = (53 * hash) + getNextPageToken().hashCode(); - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.showcase.v1beta1.ListUsersResponse parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.showcase.v1beta1.ListUsersResponse parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.showcase.v1beta1.ListUsersResponse parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.showcase.v1beta1.ListUsersResponse 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.showcase.v1beta1.ListUsersResponse parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.showcase.v1beta1.ListUsersResponse parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.showcase.v1beta1.ListUsersResponse parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static com.google.showcase.v1beta1.ListUsersResponse 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.showcase.v1beta1.ListUsersResponse parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static com.google.showcase.v1beta1.ListUsersResponse 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.showcase.v1beta1.ListUsersResponse parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static com.google.showcase.v1beta1.ListUsersResponse 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.showcase.v1beta1.ListUsersResponse 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 message for the google.showcase.v1beta1.Identity\ListUsers
        -   * method.
        -   * 
        - * - * Protobuf type {@code google.showcase.v1beta1.ListUsersResponse} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.ListUsersResponse) - com.google.showcase.v1beta1.ListUsersResponseOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.google.showcase.v1beta1.IdentityOuterClass.internal_static_google_showcase_v1beta1_ListUsersResponse_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.showcase.v1beta1.IdentityOuterClass.internal_static_google_showcase_v1beta1_ListUsersResponse_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.showcase.v1beta1.ListUsersResponse.class, com.google.showcase.v1beta1.ListUsersResponse.Builder.class); - } - - // Construct using com.google.showcase.v1beta1.ListUsersResponse.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { - getUsersFieldBuilder(); - } - } - @java.lang.Override - public Builder clear() { - super.clear(); - if (usersBuilder_ == null) { - users_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - } else { - usersBuilder_.clear(); - } - nextPageToken_ = ""; - - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return com.google.showcase.v1beta1.IdentityOuterClass.internal_static_google_showcase_v1beta1_ListUsersResponse_descriptor; - } - - @java.lang.Override - public com.google.showcase.v1beta1.ListUsersResponse getDefaultInstanceForType() { - return com.google.showcase.v1beta1.ListUsersResponse.getDefaultInstance(); - } - - @java.lang.Override - public com.google.showcase.v1beta1.ListUsersResponse build() { - com.google.showcase.v1beta1.ListUsersResponse result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.showcase.v1beta1.ListUsersResponse buildPartial() { - com.google.showcase.v1beta1.ListUsersResponse result = new com.google.showcase.v1beta1.ListUsersResponse(this); - int from_bitField0_ = bitField0_; - if (usersBuilder_ == null) { - if (((bitField0_ & 0x00000001) != 0)) { - users_ = java.util.Collections.unmodifiableList(users_); - bitField0_ = (bitField0_ & ~0x00000001); - } - result.users_ = users_; - } else { - result.users_ = usersBuilder_.build(); - } - result.nextPageToken_ = nextPageToken_; - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.setField(field, value); - } - @java.lang.Override - public Builder clearField( - com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - @java.lang.Override - public Builder clearOneof( - com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.addRepeatedField(field, value); - } - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof com.google.showcase.v1beta1.ListUsersResponse) { - return mergeFrom((com.google.showcase.v1beta1.ListUsersResponse)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.showcase.v1beta1.ListUsersResponse other) { - if (other == com.google.showcase.v1beta1.ListUsersResponse.getDefaultInstance()) return this; - if (usersBuilder_ == null) { - if (!other.users_.isEmpty()) { - if (users_.isEmpty()) { - users_ = other.users_; - bitField0_ = (bitField0_ & ~0x00000001); - } else { - ensureUsersIsMutable(); - users_.addAll(other.users_); - } - onChanged(); - } - } else { - if (!other.users_.isEmpty()) { - if (usersBuilder_.isEmpty()) { - usersBuilder_.dispose(); - usersBuilder_ = null; - users_ = other.users_; - bitField0_ = (bitField0_ & ~0x00000001); - usersBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? - getUsersFieldBuilder() : null; - } else { - usersBuilder_.addAllMessages(other.users_); - } - } - } - if (!other.getNextPageToken().isEmpty()) { - nextPageToken_ = other.nextPageToken_; - onChanged(); - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - com.google.showcase.v1beta1.ListUsersResponse parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (com.google.showcase.v1beta1.ListUsersResponse) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - private int bitField0_; - - private java.util.List users_ = - java.util.Collections.emptyList(); - private void ensureUsersIsMutable() { - if (!((bitField0_ & 0x00000001) != 0)) { - users_ = new java.util.ArrayList(users_); - bitField0_ |= 0x00000001; - } - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - com.google.showcase.v1beta1.User, com.google.showcase.v1beta1.User.Builder, com.google.showcase.v1beta1.UserOrBuilder> usersBuilder_; - - /** - *
        -     * The list of users.
        -     * 
        - * - * repeated .google.showcase.v1beta1.User users = 1; - */ - public java.util.List getUsersList() { - if (usersBuilder_ == null) { - return java.util.Collections.unmodifiableList(users_); - } else { - return usersBuilder_.getMessageList(); - } - } - /** - *
        -     * The list of users.
        -     * 
        - * - * repeated .google.showcase.v1beta1.User users = 1; - */ - public int getUsersCount() { - if (usersBuilder_ == null) { - return users_.size(); - } else { - return usersBuilder_.getCount(); - } - } - /** - *
        -     * The list of users.
        -     * 
        - * - * repeated .google.showcase.v1beta1.User users = 1; - */ - public com.google.showcase.v1beta1.User getUsers(int index) { - if (usersBuilder_ == null) { - return users_.get(index); - } else { - return usersBuilder_.getMessage(index); - } - } - /** - *
        -     * The list of users.
        -     * 
        - * - * repeated .google.showcase.v1beta1.User users = 1; - */ - public Builder setUsers( - int index, com.google.showcase.v1beta1.User value) { - if (usersBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureUsersIsMutable(); - users_.set(index, value); - onChanged(); - } else { - usersBuilder_.setMessage(index, value); - } - return this; - } - /** - *
        -     * The list of users.
        -     * 
        - * - * repeated .google.showcase.v1beta1.User users = 1; - */ - public Builder setUsers( - int index, com.google.showcase.v1beta1.User.Builder builderForValue) { - if (usersBuilder_ == null) { - ensureUsersIsMutable(); - users_.set(index, builderForValue.build()); - onChanged(); - } else { - usersBuilder_.setMessage(index, builderForValue.build()); - } - return this; - } - /** - *
        -     * The list of users.
        -     * 
        - * - * repeated .google.showcase.v1beta1.User users = 1; - */ - public Builder addUsers(com.google.showcase.v1beta1.User value) { - if (usersBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureUsersIsMutable(); - users_.add(value); - onChanged(); - } else { - usersBuilder_.addMessage(value); - } - return this; - } - /** - *
        -     * The list of users.
        -     * 
        - * - * repeated .google.showcase.v1beta1.User users = 1; - */ - public Builder addUsers( - int index, com.google.showcase.v1beta1.User value) { - if (usersBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureUsersIsMutable(); - users_.add(index, value); - onChanged(); - } else { - usersBuilder_.addMessage(index, value); - } - return this; - } - /** - *
        -     * The list of users.
        -     * 
        - * - * repeated .google.showcase.v1beta1.User users = 1; - */ - public Builder addUsers( - com.google.showcase.v1beta1.User.Builder builderForValue) { - if (usersBuilder_ == null) { - ensureUsersIsMutable(); - users_.add(builderForValue.build()); - onChanged(); - } else { - usersBuilder_.addMessage(builderForValue.build()); - } - return this; - } - /** - *
        -     * The list of users.
        -     * 
        - * - * repeated .google.showcase.v1beta1.User users = 1; - */ - public Builder addUsers( - int index, com.google.showcase.v1beta1.User.Builder builderForValue) { - if (usersBuilder_ == null) { - ensureUsersIsMutable(); - users_.add(index, builderForValue.build()); - onChanged(); - } else { - usersBuilder_.addMessage(index, builderForValue.build()); - } - return this; - } - /** - *
        -     * The list of users.
        -     * 
        - * - * repeated .google.showcase.v1beta1.User users = 1; - */ - public Builder addAllUsers( - java.lang.Iterable values) { - if (usersBuilder_ == null) { - ensureUsersIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, users_); - onChanged(); - } else { - usersBuilder_.addAllMessages(values); - } - return this; - } - /** - *
        -     * The list of users.
        -     * 
        - * - * repeated .google.showcase.v1beta1.User users = 1; - */ - public Builder clearUsers() { - if (usersBuilder_ == null) { - users_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - onChanged(); - } else { - usersBuilder_.clear(); - } - return this; - } - /** - *
        -     * The list of users.
        -     * 
        - * - * repeated .google.showcase.v1beta1.User users = 1; - */ - public Builder removeUsers(int index) { - if (usersBuilder_ == null) { - ensureUsersIsMutable(); - users_.remove(index); - onChanged(); - } else { - usersBuilder_.remove(index); - } - return this; - } - /** - *
        -     * The list of users.
        -     * 
        - * - * repeated .google.showcase.v1beta1.User users = 1; - */ - public com.google.showcase.v1beta1.User.Builder getUsersBuilder( - int index) { - return getUsersFieldBuilder().getBuilder(index); - } - /** - *
        -     * The list of users.
        -     * 
        - * - * repeated .google.showcase.v1beta1.User users = 1; - */ - public com.google.showcase.v1beta1.UserOrBuilder getUsersOrBuilder( - int index) { - if (usersBuilder_ == null) { - return users_.get(index); } else { - return usersBuilder_.getMessageOrBuilder(index); - } - } - /** - *
        -     * The list of users.
        -     * 
        - * - * repeated .google.showcase.v1beta1.User users = 1; - */ - public java.util.List - getUsersOrBuilderList() { - if (usersBuilder_ != null) { - return usersBuilder_.getMessageOrBuilderList(); - } else { - return java.util.Collections.unmodifiableList(users_); - } - } - /** - *
        -     * The list of users.
        -     * 
        - * - * repeated .google.showcase.v1beta1.User users = 1; - */ - public com.google.showcase.v1beta1.User.Builder addUsersBuilder() { - return getUsersFieldBuilder().addBuilder( - com.google.showcase.v1beta1.User.getDefaultInstance()); - } - /** - *
        -     * The list of users.
        -     * 
        - * - * repeated .google.showcase.v1beta1.User users = 1; - */ - public com.google.showcase.v1beta1.User.Builder addUsersBuilder( - int index) { - return getUsersFieldBuilder().addBuilder( - index, com.google.showcase.v1beta1.User.getDefaultInstance()); - } - /** - *
        -     * The list of users.
        -     * 
        - * - * repeated .google.showcase.v1beta1.User users = 1; - */ - public java.util.List - getUsersBuilderList() { - return getUsersFieldBuilder().getBuilderList(); - } - private com.google.protobuf.RepeatedFieldBuilderV3< - com.google.showcase.v1beta1.User, com.google.showcase.v1beta1.User.Builder, com.google.showcase.v1beta1.UserOrBuilder> - getUsersFieldBuilder() { - if (usersBuilder_ == null) { - usersBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< - com.google.showcase.v1beta1.User, com.google.showcase.v1beta1.User.Builder, com.google.showcase.v1beta1.UserOrBuilder>( - users_, - ((bitField0_ & 0x00000001) != 0), - getParentForChildren(), - isClean()); - users_ = null; - } - return usersBuilder_; - } - - private java.lang.Object nextPageToken_ = ""; - /** - *
        -     * A token to retrieve next page of results.
        -     * Pass this value in ListUsersRequest.page_token field in the subsequent
        -     * call to `google.showcase.v1beta1.Message\ListUsers` method to retrieve the
        -     * next page of results.
        -     * 
        - * - * string next_page_token = 2; - * @return The nextPageToken. - */ - public java.lang.String getNextPageToken() { - java.lang.Object ref = nextPageToken_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - nextPageToken_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - *
        -     * A token to retrieve next page of results.
        -     * Pass this value in ListUsersRequest.page_token field in the subsequent
        -     * call to `google.showcase.v1beta1.Message\ListUsers` method to retrieve the
        -     * next page of results.
        -     * 
        - * - * string next_page_token = 2; - * @return The bytes for nextPageToken. - */ - public com.google.protobuf.ByteString - getNextPageTokenBytes() { - java.lang.Object ref = nextPageToken_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - nextPageToken_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - *
        -     * A token to retrieve next page of results.
        -     * Pass this value in ListUsersRequest.page_token field in the subsequent
        -     * call to `google.showcase.v1beta1.Message\ListUsers` method to retrieve the
        -     * next page of results.
        -     * 
        - * - * string next_page_token = 2; - * @param value The nextPageToken to set. - * @return This builder for chaining. - */ - public Builder setNextPageToken( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - nextPageToken_ = value; - onChanged(); - return this; - } - /** - *
        -     * A token to retrieve next page of results.
        -     * Pass this value in ListUsersRequest.page_token field in the subsequent
        -     * call to `google.showcase.v1beta1.Message\ListUsers` method to retrieve the
        -     * next page of results.
        -     * 
        - * - * string next_page_token = 2; - * @return This builder for chaining. - */ - public Builder clearNextPageToken() { - - nextPageToken_ = getDefaultInstance().getNextPageToken(); - onChanged(); - return this; - } - /** - *
        -     * A token to retrieve next page of results.
        -     * Pass this value in ListUsersRequest.page_token field in the subsequent
        -     * call to `google.showcase.v1beta1.Message\ListUsers` method to retrieve the
        -     * next page of results.
        -     * 
        - * - * string next_page_token = 2; - * @param value The bytes for nextPageToken to set. - * @return This builder for chaining. - */ - public Builder setNextPageTokenBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - nextPageToken_ = value; - onChanged(); - return this; - } - @java.lang.Override - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - - // @@protoc_insertion_point(builder_scope:google.showcase.v1beta1.ListUsersResponse) - } - - // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.ListUsersResponse) - private static final com.google.showcase.v1beta1.ListUsersResponse DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new com.google.showcase.v1beta1.ListUsersResponse(); - } - - public static com.google.showcase.v1beta1.ListUsersResponse getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public ListUsersResponse parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new ListUsersResponse(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public com.google.showcase.v1beta1.ListUsersResponse getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListUsersResponseOrBuilder.java b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListUsersResponseOrBuilder.java deleted file mode 100644 index 9326c4804f..0000000000 --- a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListUsersResponseOrBuilder.java +++ /dev/null @@ -1,79 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: schema/google/showcase/v1beta1/identity.proto - -package com.google.showcase.v1beta1; - -public interface ListUsersResponseOrBuilder extends - // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.ListUsersResponse) - com.google.protobuf.MessageOrBuilder { - - /** - *
        -   * The list of users.
        -   * 
        - * - * repeated .google.showcase.v1beta1.User users = 1; - */ - java.util.List - getUsersList(); - /** - *
        -   * The list of users.
        -   * 
        - * - * repeated .google.showcase.v1beta1.User users = 1; - */ - com.google.showcase.v1beta1.User getUsers(int index); - /** - *
        -   * The list of users.
        -   * 
        - * - * repeated .google.showcase.v1beta1.User users = 1; - */ - int getUsersCount(); - /** - *
        -   * The list of users.
        -   * 
        - * - * repeated .google.showcase.v1beta1.User users = 1; - */ - java.util.List - getUsersOrBuilderList(); - /** - *
        -   * The list of users.
        -   * 
        - * - * repeated .google.showcase.v1beta1.User users = 1; - */ - com.google.showcase.v1beta1.UserOrBuilder getUsersOrBuilder( - int index); - - /** - *
        -   * A token to retrieve next page of results.
        -   * Pass this value in ListUsersRequest.page_token field in the subsequent
        -   * call to `google.showcase.v1beta1.Message\ListUsers` method to retrieve the
        -   * next page of results.
        -   * 
        - * - * string next_page_token = 2; - * @return The nextPageToken. - */ - java.lang.String getNextPageToken(); - /** - *
        -   * A token to retrieve next page of results.
        -   * Pass this value in ListUsersRequest.page_token field in the subsequent
        -   * call to `google.showcase.v1beta1.Message\ListUsers` method to retrieve the
        -   * next page of results.
        -   * 
        - * - * string next_page_token = 2; - * @return The bytes for nextPageToken. - */ - com.google.protobuf.ByteString - getNextPageTokenBytes(); -} diff --git a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/MessagingOuterClass.java b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/MessagingOuterClass.java deleted file mode 100644 index 699e398079..0000000000 --- a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/MessagingOuterClass.java +++ /dev/null @@ -1,447 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: schema/google/showcase/v1beta1/messaging.proto - -package com.google.showcase.v1beta1; - -public final class MessagingOuterClass { - private MessagingOuterClass() {} - 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_showcase_v1beta1_Room_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_showcase_v1beta1_Room_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_showcase_v1beta1_CreateRoomRequest_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_showcase_v1beta1_CreateRoomRequest_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_showcase_v1beta1_GetRoomRequest_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_showcase_v1beta1_GetRoomRequest_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_showcase_v1beta1_UpdateRoomRequest_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_showcase_v1beta1_UpdateRoomRequest_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_showcase_v1beta1_DeleteRoomRequest_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_showcase_v1beta1_DeleteRoomRequest_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_showcase_v1beta1_ListRoomsRequest_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_showcase_v1beta1_ListRoomsRequest_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_showcase_v1beta1_ListRoomsResponse_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_showcase_v1beta1_ListRoomsResponse_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_showcase_v1beta1_Blurb_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_showcase_v1beta1_Blurb_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_showcase_v1beta1_CreateBlurbRequest_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_showcase_v1beta1_CreateBlurbRequest_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_showcase_v1beta1_GetBlurbRequest_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_showcase_v1beta1_GetBlurbRequest_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_showcase_v1beta1_UpdateBlurbRequest_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_showcase_v1beta1_UpdateBlurbRequest_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_showcase_v1beta1_DeleteBlurbRequest_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_showcase_v1beta1_DeleteBlurbRequest_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_showcase_v1beta1_ListBlurbsRequest_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_showcase_v1beta1_ListBlurbsRequest_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_showcase_v1beta1_ListBlurbsResponse_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_showcase_v1beta1_ListBlurbsResponse_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_showcase_v1beta1_SearchBlurbsRequest_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_showcase_v1beta1_SearchBlurbsRequest_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_showcase_v1beta1_SearchBlurbsMetadata_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_showcase_v1beta1_SearchBlurbsMetadata_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_showcase_v1beta1_SearchBlurbsResponse_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_showcase_v1beta1_SearchBlurbsResponse_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_showcase_v1beta1_StreamBlurbsRequest_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_showcase_v1beta1_StreamBlurbsRequest_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_showcase_v1beta1_StreamBlurbsResponse_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_showcase_v1beta1_StreamBlurbsResponse_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_showcase_v1beta1_SendBlurbsResponse_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_showcase_v1beta1_SendBlurbsResponse_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_showcase_v1beta1_ConnectRequest_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_showcase_v1beta1_ConnectRequest_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_showcase_v1beta1_ConnectRequest_ConnectConfig_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_showcase_v1beta1_ConnectRequest_ConnectConfig_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.schema/google/showcase/v1beta1/messagi" + - "ng.proto\022\027google.showcase.v1beta1\032\034googl" + - "e/api/annotations.proto\032\027google/api/clie" + - "nt.proto\032\037google/api/field_behavior.prot" + - "o\032\031google/api/resource.proto\032#google/lon" + - "grunning/operations.proto\032\033google/protob" + - "uf/empty.proto\032 google/protobuf/field_ma" + - "sk.proto\032\037google/protobuf/timestamp.prot" + - "o\032\036google/rpc/error_details.proto\"\341\001\n\004Ro" + - "om\022\014\n\004name\030\001 \001(\t\022\031\n\014display_name\030\002 \001(\tB\003" + - "\340A\002\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.Ti" + - "mestampB\003\340A\003:/\352A,\n\034showcase.googleapis.c" + - "om/Room\022\014rooms/{room}\"@\n\021CreateRoomReque" + - "st\022+\n\004room\030\001 \001(\0132\035.google.showcase.v1bet" + - "a1.Room\"D\n\016GetRoomRequest\0222\n\004name\030\001 \001(\tB" + - "$\372A\036\n\034showcase.googleapis.com/Room\340A\002\"q\n" + - "\021UpdateRoomRequest\022+\n\004room\030\001 \001(\0132\035.googl" + - "e.showcase.v1beta1.Room\022/\n\013update_mask\030\002" + - " \001(\0132\032.google.protobuf.FieldMask\"G\n\021Dele" + - "teRoomRequest\0222\n\004name\030\001 \001(\tB$\372A\036\n\034showca" + - "se.googleapis.com/Room\340A\002\"9\n\020ListRoomsRe" + - "quest\022\021\n\tpage_size\030\001 \001(\005\022\022\n\npage_token\030\002" + - " \001(\t\"Z\n\021ListRoomsResponse\022,\n\005rooms\030\001 \003(\013" + - "2\035.google.showcase.v1beta1.Room\022\027\n\017next_" + - "page_token\030\002 \001(\t\"\366\003\n\005Blurb\022\014\n\004name\030\001 \001(\t" + - "\0222\n\004user\030\002 \001(\tB$\372A\036\n\034showcase.googleapis" + - ".com/User\340A\002\022\016\n\004text\030\003 \001(\tH\000\022\017\n\005image\030\004 " + - "\001(\014H\000\0224\n\013create_time\030\005 \001(\0132\032.google.prot" + - "obuf.TimestampB\003\340A\003\0224\n\013update_time\030\006 \001(\013" + - "2\032.google.protobuf.TimestampB\003\340A\003\022\030\n\016leg" + - "acy_room_id\030\007 \001(\tH\001\022\030\n\016legacy_user_id\030\010 " + - "\001(\tH\001:\321\001\352A\315\001\n\035showcase.googleapis.com/Bl" + - "urb\0228users/{user}/profile/blurbs/legacy/" + - "{legacy_user}~{blurb}\022#users/{user}/prof" + - "ile/blurbs/{blurb}\022\033rooms/{room}/blurbs/" + - "{blurb}\0220rooms/{room}/blurbs/legacy/{leg" + - "acy_room}.{blurb}B\t\n\007contentB\013\n\tlegacy_i" + - "d\"z\n\022CreateBlurbRequest\0225\n\006parent\030\001 \001(\tB" + - "%\372A\037\022\035showcase.googleapis.com/Blurb\340A\002\022-" + - "\n\005blurb\030\002 \001(\0132\036.google.showcase.v1beta1." + - "Blurb\"F\n\017GetBlurbRequest\0223\n\004name\030\001 \001(\tB%" + - "\372A\037\n\035showcase.googleapis.com/Blurb\340A\002\"t\n" + - "\022UpdateBlurbRequest\022-\n\005blurb\030\001 \001(\0132\036.goo" + - "gle.showcase.v1beta1.Blurb\022/\n\013update_mas" + - "k\030\002 \001(\0132\032.google.protobuf.FieldMask\"I\n\022D" + - "eleteBlurbRequest\0223\n\004name\030\001 \001(\tB%\372A\037\n\035sh" + - "owcase.googleapis.com/Blurb\340A\002\"q\n\021ListBl" + - "urbsRequest\0225\n\006parent\030\001 \001(\tB%\372A\037\022\035showca" + - "se.googleapis.com/Blurb\340A\002\022\021\n\tpage_size\030" + - "\002 \001(\005\022\022\n\npage_token\030\003 \001(\t\"]\n\022ListBlurbsR" + - "esponse\022.\n\006blurbs\030\001 \003(\0132\036.google.showcas" + - "e.v1beta1.Blurb\022\027\n\017next_page_token\030\002 \001(\t" + - "\"\204\001\n\023SearchBlurbsRequest\022\022\n\005query\030\001 \001(\tB" + - "\003\340A\002\0222\n\006parent\030\002 \001(\tB\"\372A\037\022\035showcase.goog" + - "leapis.com/Blurb\022\021\n\tpage_size\030\003 \001(\005\022\022\n\np" + - "age_token\030\004 \001(\t\"A\n\024SearchBlurbsMetadata\022" + - ")\n\nretry_info\030\001 \001(\0132\025.google.rpc.RetryIn" + - "fo\"_\n\024SearchBlurbsResponse\022.\n\006blurbs\030\001 \003" + - "(\0132\036.google.showcase.v1beta1.Blurb\022\027\n\017ne" + - "xt_page_token\030\002 \001(\t\"\200\001\n\023StreamBlurbsRequ" + - "est\0223\n\004name\030\001 \001(\tB%\372A\037\022\035showcase.googlea" + - "pis.com/Blurb\340A\002\0224\n\013expire_time\030\002 \001(\0132\032." + - "google.protobuf.TimestampB\003\340A\002\"\321\001\n\024Strea" + - "mBlurbsResponse\022-\n\005blurb\030\001 \001(\0132\036.google." + - "showcase.v1beta1.Blurb\022D\n\006action\030\002 \001(\01624" + - ".google.showcase.v1beta1.StreamBlurbsRes" + - "ponse.Action\"D\n\006Action\022\026\n\022ACTION_UNSPECI" + - "FIED\020\000\022\n\n\006CREATE\020\001\022\n\n\006UPDATE\020\002\022\n\n\006DELETE" + - "\020\003\"#\n\022SendBlurbsResponse\022\r\n\005names\030\001 \003(\t\"" + - "\332\001\n\016ConnectRequest\022G\n\006config\030\001 \001(\01325.goo" + - "gle.showcase.v1beta1.ConnectRequest.Conn" + - "ectConfigH\000\022/\n\005blurb\030\002 \001(\0132\036.google.show" + - "case.v1beta1.BlurbH\000\032C\n\rConnectConfig\0222\n" + - "\006parent\030\001 \001(\tB\"\372A\037\022\035showcase.googleapis." + - "com/BlurbB\t\n\007request2\264\023\n\tMessaging\022\227\001\n\nC" + - "reateRoom\022*.google.showcase.v1beta1.Crea" + - "teRoomRequest\032\035.google.showcase.v1beta1." + - "Room\">\202\323\344\223\002\023\"\016/v1beta1/rooms:\001*\332A\"room.d" + - "isplay_name,room.description\022y\n\007GetRoom\022" + - "\'.google.showcase.v1beta1.GetRoomRequest" + - "\032\035.google.showcase.v1beta1.Room\"&\202\323\344\223\002\031\022" + - "\027/v1beta1/{name=rooms/*}\332A\004name\022\203\001\n\nUpda" + - "teRoom\022*.google.showcase.v1beta1.UpdateR" + - "oomRequest\032\035.google.showcase.v1beta1.Roo" + - "m\"*\202\323\344\223\002$2\034/v1beta1/{room.name=rooms/*}:" + - "\004room\022x\n\nDeleteRoom\022*.google.showcase.v1" + - "beta1.DeleteRoomRequest\032\026.google.protobu" + - "f.Empty\"&\202\323\344\223\002\031*\027/v1beta1/{name=rooms/*}" + - "\332A\004name\022z\n\tListRooms\022).google.showcase.v" + - "1beta1.ListRoomsRequest\032*.google.showcas" + - "e.v1beta1.ListRoomsResponse\"\026\202\323\344\223\002\020\022\016/v1" + - "beta1/rooms\022\366\001\n\013CreateBlurb\022+.google.sho" + - "wcase.v1beta1.CreateBlurbRequest\032\036.googl" + - "e.showcase.v1beta1.Blurb\"\231\001\202\323\344\223\002T\" /v1be" + - "ta1/{parent=rooms/*}/blurbs:\001*Z-\"(/v1bet" + - "a1/{parent=users/*/profile}/blurbs:\001*\332A\034" + - "parent,blurb.user,blurb.text\332A\035parent,bl" + - "urb.user,blurb.image\022\261\001\n\010GetBlurb\022(.goog" + - "le.showcase.v1beta1.GetBlurbRequest\032\036.go" + - "ogle.showcase.v1beta1.Blurb\"[\202\323\344\223\002N\022 /v1" + - "beta1/{name=rooms/*/blurbs/*}Z*\022(/v1beta" + - "1/{name=users/*/profile/blurbs/*}\332A\004name" + - "\022\312\001\n\013UpdateBlurb\022+.google.showcase.v1bet" + - "a1.UpdateBlurbRequest\032\036.google.showcase." + - "v1beta1.Blurb\"n\202\323\344\223\002h2&/v1beta1/{blurb.n" + - "ame=rooms/*/blurbs/*}:\005blurbZ72./v1beta1" + - "/{blurb.name=users/*/profile/blurbs/*}:\005" + - "blurb\022\257\001\n\013DeleteBlurb\022+.google.showcase." + - "v1beta1.DeleteBlurbRequest\032\026.google.prot" + - "obuf.Empty\"[\202\323\344\223\002N* /v1beta1/{name=rooms" + - "/*/blurbs/*}Z**(/v1beta1/{name=users/*/p" + - "rofile/blurbs/*}\332A\004name\022\304\001\n\nListBlurbs\022*" + - ".google.showcase.v1beta1.ListBlurbsReque" + - "st\032+.google.showcase.v1beta1.ListBlurbsR" + - "esponse\"]\202\323\344\223\002N\022 /v1beta1/{parent=rooms/" + - "*}/blurbsZ*\022(/v1beta1/{parent=users/*/pr" + - "ofile}/blurbs\332A\006parent\022\201\002\n\014SearchBlurbs\022" + - ",.google.showcase.v1beta1.SearchBlurbsRe" + - "quest\032\035.google.longrunning.Operation\"\243\001\202" + - "\323\344\223\002_\"\'/v1beta1/{parent=rooms/*}/blurbs:" + - "search:\001*Z1\"//v1beta1/{parent=users/*/pr" + - "ofile}/blurbs:search\312A,\n\024SearchBlurbsRes" + - "ponse\022\024SearchBlurbsMetadata\332A\014parent,que" + - "ry\022\323\001\n\014StreamBlurbs\022,.google.showcase.v1" + - "beta1.StreamBlurbsRequest\032-.google.showc" + - "ase.v1beta1.StreamBlurbsResponse\"d\202\323\344\223\002^" + - "\"%/v1beta1/{name=rooms/*}/blurbs:stream:" + - "\001*Z2\"-/v1beta1/{name=users/*/profile}/bl" + - "urbs:stream:\001*0\001\022\316\001\n\nSendBlurbs\022+.google" + - ".showcase.v1beta1.CreateBlurbRequest\032+.g" + - "oogle.showcase.v1beta1.SendBlurbsRespons" + - "e\"d\202\323\344\223\002^\"%/v1beta1/{parent=rooms/*}/blu" + - "rbs:send:\001*Z2\"-/v1beta1/{parent=users/*/" + - "profile}/blurbs:send:\001*(\001\022e\n\007Connect\022\'.g" + - "oogle.showcase.v1beta1.ConnectRequest\032-." + - "google.showcase.v1beta1.StreamBlurbsResp" + - "onse(\0010\001\032\021\312A\016localhost:7469Bq\n\033com.googl" + - "e.showcase.v1beta1P\001Z4github.com/googlea" + - "pis/gapic-showcase/server/genproto\352\002\031Goo" + - "gle::Showcase::V1beta1b\006proto3" - }; - descriptor = com.google.protobuf.Descriptors.FileDescriptor - .internalBuildGeneratedFileFrom(descriptorData, - new com.google.protobuf.Descriptors.FileDescriptor[] { - com.google.api.AnnotationsProto.getDescriptor(), - com.google.api.ClientProto.getDescriptor(), - com.google.api.FieldBehaviorProto.getDescriptor(), - com.google.api.ResourceProto.getDescriptor(), - com.google.longrunning.OperationsProto.getDescriptor(), - com.google.protobuf.EmptyProto.getDescriptor(), - com.google.protobuf.FieldMaskProto.getDescriptor(), - com.google.protobuf.TimestampProto.getDescriptor(), - com.google.rpc.ErrorDetailsProto.getDescriptor(), - }); - internal_static_google_showcase_v1beta1_Room_descriptor = - getDescriptor().getMessageTypes().get(0); - internal_static_google_showcase_v1beta1_Room_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_google_showcase_v1beta1_Room_descriptor, - new java.lang.String[] { "Name", "DisplayName", "Description", "CreateTime", "UpdateTime", }); - internal_static_google_showcase_v1beta1_CreateRoomRequest_descriptor = - getDescriptor().getMessageTypes().get(1); - internal_static_google_showcase_v1beta1_CreateRoomRequest_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_google_showcase_v1beta1_CreateRoomRequest_descriptor, - new java.lang.String[] { "Room", }); - internal_static_google_showcase_v1beta1_GetRoomRequest_descriptor = - getDescriptor().getMessageTypes().get(2); - internal_static_google_showcase_v1beta1_GetRoomRequest_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_google_showcase_v1beta1_GetRoomRequest_descriptor, - new java.lang.String[] { "Name", }); - internal_static_google_showcase_v1beta1_UpdateRoomRequest_descriptor = - getDescriptor().getMessageTypes().get(3); - internal_static_google_showcase_v1beta1_UpdateRoomRequest_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_google_showcase_v1beta1_UpdateRoomRequest_descriptor, - new java.lang.String[] { "Room", "UpdateMask", }); - internal_static_google_showcase_v1beta1_DeleteRoomRequest_descriptor = - getDescriptor().getMessageTypes().get(4); - internal_static_google_showcase_v1beta1_DeleteRoomRequest_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_google_showcase_v1beta1_DeleteRoomRequest_descriptor, - new java.lang.String[] { "Name", }); - internal_static_google_showcase_v1beta1_ListRoomsRequest_descriptor = - getDescriptor().getMessageTypes().get(5); - internal_static_google_showcase_v1beta1_ListRoomsRequest_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_google_showcase_v1beta1_ListRoomsRequest_descriptor, - new java.lang.String[] { "PageSize", "PageToken", }); - internal_static_google_showcase_v1beta1_ListRoomsResponse_descriptor = - getDescriptor().getMessageTypes().get(6); - internal_static_google_showcase_v1beta1_ListRoomsResponse_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_google_showcase_v1beta1_ListRoomsResponse_descriptor, - new java.lang.String[] { "Rooms", "NextPageToken", }); - internal_static_google_showcase_v1beta1_Blurb_descriptor = - getDescriptor().getMessageTypes().get(7); - internal_static_google_showcase_v1beta1_Blurb_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_google_showcase_v1beta1_Blurb_descriptor, - new java.lang.String[] { "Name", "User", "Text", "Image", "CreateTime", "UpdateTime", "LegacyRoomId", "LegacyUserId", "Content", "LegacyId", }); - internal_static_google_showcase_v1beta1_CreateBlurbRequest_descriptor = - getDescriptor().getMessageTypes().get(8); - internal_static_google_showcase_v1beta1_CreateBlurbRequest_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_google_showcase_v1beta1_CreateBlurbRequest_descriptor, - new java.lang.String[] { "Parent", "Blurb", }); - internal_static_google_showcase_v1beta1_GetBlurbRequest_descriptor = - getDescriptor().getMessageTypes().get(9); - internal_static_google_showcase_v1beta1_GetBlurbRequest_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_google_showcase_v1beta1_GetBlurbRequest_descriptor, - new java.lang.String[] { "Name", }); - internal_static_google_showcase_v1beta1_UpdateBlurbRequest_descriptor = - getDescriptor().getMessageTypes().get(10); - internal_static_google_showcase_v1beta1_UpdateBlurbRequest_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_google_showcase_v1beta1_UpdateBlurbRequest_descriptor, - new java.lang.String[] { "Blurb", "UpdateMask", }); - internal_static_google_showcase_v1beta1_DeleteBlurbRequest_descriptor = - getDescriptor().getMessageTypes().get(11); - internal_static_google_showcase_v1beta1_DeleteBlurbRequest_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_google_showcase_v1beta1_DeleteBlurbRequest_descriptor, - new java.lang.String[] { "Name", }); - internal_static_google_showcase_v1beta1_ListBlurbsRequest_descriptor = - getDescriptor().getMessageTypes().get(12); - internal_static_google_showcase_v1beta1_ListBlurbsRequest_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_google_showcase_v1beta1_ListBlurbsRequest_descriptor, - new java.lang.String[] { "Parent", "PageSize", "PageToken", }); - internal_static_google_showcase_v1beta1_ListBlurbsResponse_descriptor = - getDescriptor().getMessageTypes().get(13); - internal_static_google_showcase_v1beta1_ListBlurbsResponse_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_google_showcase_v1beta1_ListBlurbsResponse_descriptor, - new java.lang.String[] { "Blurbs", "NextPageToken", }); - internal_static_google_showcase_v1beta1_SearchBlurbsRequest_descriptor = - getDescriptor().getMessageTypes().get(14); - internal_static_google_showcase_v1beta1_SearchBlurbsRequest_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_google_showcase_v1beta1_SearchBlurbsRequest_descriptor, - new java.lang.String[] { "Query", "Parent", "PageSize", "PageToken", }); - internal_static_google_showcase_v1beta1_SearchBlurbsMetadata_descriptor = - getDescriptor().getMessageTypes().get(15); - internal_static_google_showcase_v1beta1_SearchBlurbsMetadata_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_google_showcase_v1beta1_SearchBlurbsMetadata_descriptor, - new java.lang.String[] { "RetryInfo", }); - internal_static_google_showcase_v1beta1_SearchBlurbsResponse_descriptor = - getDescriptor().getMessageTypes().get(16); - internal_static_google_showcase_v1beta1_SearchBlurbsResponse_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_google_showcase_v1beta1_SearchBlurbsResponse_descriptor, - new java.lang.String[] { "Blurbs", "NextPageToken", }); - internal_static_google_showcase_v1beta1_StreamBlurbsRequest_descriptor = - getDescriptor().getMessageTypes().get(17); - internal_static_google_showcase_v1beta1_StreamBlurbsRequest_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_google_showcase_v1beta1_StreamBlurbsRequest_descriptor, - new java.lang.String[] { "Name", "ExpireTime", }); - internal_static_google_showcase_v1beta1_StreamBlurbsResponse_descriptor = - getDescriptor().getMessageTypes().get(18); - internal_static_google_showcase_v1beta1_StreamBlurbsResponse_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_google_showcase_v1beta1_StreamBlurbsResponse_descriptor, - new java.lang.String[] { "Blurb", "Action", }); - internal_static_google_showcase_v1beta1_SendBlurbsResponse_descriptor = - getDescriptor().getMessageTypes().get(19); - internal_static_google_showcase_v1beta1_SendBlurbsResponse_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_google_showcase_v1beta1_SendBlurbsResponse_descriptor, - new java.lang.String[] { "Names", }); - internal_static_google_showcase_v1beta1_ConnectRequest_descriptor = - getDescriptor().getMessageTypes().get(20); - internal_static_google_showcase_v1beta1_ConnectRequest_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_google_showcase_v1beta1_ConnectRequest_descriptor, - new java.lang.String[] { "Config", "Blurb", "Request", }); - internal_static_google_showcase_v1beta1_ConnectRequest_ConnectConfig_descriptor = - internal_static_google_showcase_v1beta1_ConnectRequest_descriptor.getNestedTypes().get(0); - internal_static_google_showcase_v1beta1_ConnectRequest_ConnectConfig_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_google_showcase_v1beta1_ConnectRequest_ConnectConfig_descriptor, - new java.lang.String[] { "Parent", }); - 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.ResourceProto.resource); - 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(); - com.google.rpc.ErrorDetailsProto.getDescriptor(); - } - - // @@protoc_insertion_point(outer_class_scope) -} diff --git a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/PagedExpandLegacyMappedResponse.java b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/PagedExpandLegacyMappedResponse.java deleted file mode 100644 index ddef8cc042..0000000000 --- a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/PagedExpandLegacyMappedResponse.java +++ /dev/null @@ -1,942 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: schema/google/showcase/v1beta1/echo.proto - -package com.google.showcase.v1beta1; - -/** - * Protobuf type {@code google.showcase.v1beta1.PagedExpandLegacyMappedResponse} - */ -public final class PagedExpandLegacyMappedResponse extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.PagedExpandLegacyMappedResponse) - PagedExpandLegacyMappedResponseOrBuilder { -private static final long serialVersionUID = 0L; - // Use PagedExpandLegacyMappedResponse.newBuilder() to construct. - private PagedExpandLegacyMappedResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private PagedExpandLegacyMappedResponse() { - nextPageToken_ = ""; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new PagedExpandLegacyMappedResponse(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private PagedExpandLegacyMappedResponse( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - int mutable_bitField0_ = 0; - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: { - if (!((mutable_bitField0_ & 0x00000001) != 0)) { - alphabetized_ = com.google.protobuf.MapField.newMapField( - AlphabetizedDefaultEntryHolder.defaultEntry); - mutable_bitField0_ |= 0x00000001; - } - com.google.protobuf.MapEntry - alphabetized__ = input.readMessage( - AlphabetizedDefaultEntryHolder.defaultEntry.getParserForType(), extensionRegistry); - alphabetized_.getMutableMap().put( - alphabetized__.getKey(), alphabetized__.getValue()); - break; - } - case 18: { - java.lang.String s = input.readStringRequireUtf8(); - - nextPageToken_ = s; - break; - } - default: { - if (!parseUnknownField( - input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException( - e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.google.showcase.v1beta1.EchoOuterClass.internal_static_google_showcase_v1beta1_PagedExpandLegacyMappedResponse_descriptor; - } - - @SuppressWarnings({"rawtypes"}) - @java.lang.Override - protected com.google.protobuf.MapField internalGetMapField( - int number) { - switch (number) { - case 1: - return internalGetAlphabetized(); - default: - throw new RuntimeException( - "Invalid map field number: " + number); - } - } - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.showcase.v1beta1.EchoOuterClass.internal_static_google_showcase_v1beta1_PagedExpandLegacyMappedResponse_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.showcase.v1beta1.PagedExpandLegacyMappedResponse.class, com.google.showcase.v1beta1.PagedExpandLegacyMappedResponse.Builder.class); - } - - public static final int ALPHABETIZED_FIELD_NUMBER = 1; - private static final class AlphabetizedDefaultEntryHolder { - static final com.google.protobuf.MapEntry< - java.lang.String, com.google.showcase.v1beta1.PagedExpandResponseList> defaultEntry = - com.google.protobuf.MapEntry - .newDefaultInstance( - com.google.showcase.v1beta1.EchoOuterClass.internal_static_google_showcase_v1beta1_PagedExpandLegacyMappedResponse_AlphabetizedEntry_descriptor, - com.google.protobuf.WireFormat.FieldType.STRING, - "", - com.google.protobuf.WireFormat.FieldType.MESSAGE, - com.google.showcase.v1beta1.PagedExpandResponseList.getDefaultInstance()); - } - private com.google.protobuf.MapField< - java.lang.String, com.google.showcase.v1beta1.PagedExpandResponseList> alphabetized_; - private com.google.protobuf.MapField - internalGetAlphabetized() { - if (alphabetized_ == null) { - return com.google.protobuf.MapField.emptyMapField( - AlphabetizedDefaultEntryHolder.defaultEntry); - } - return alphabetized_; - } - - public int getAlphabetizedCount() { - return internalGetAlphabetized().getMap().size(); - } - /** - *
        -   * The words that were expanded, indexed by their initial character.
        -   * (-- aip.dev/not-precedent: This is a legacy, non-standard pattern that violates
        -   *     aip.dev/158. Ordinarily, this should be a `repeated` field, as in PagedExpandResponse. --)
        -   * 
        - * - * map<string, .google.showcase.v1beta1.PagedExpandResponseList> alphabetized = 1; - */ - - @java.lang.Override - public boolean containsAlphabetized( - java.lang.String key) { - if (key == null) { throw new NullPointerException("map key"); } - return internalGetAlphabetized().getMap().containsKey(key); - } - /** - * Use {@link #getAlphabetizedMap()} instead. - */ - @java.lang.Override - @java.lang.Deprecated - public java.util.Map getAlphabetized() { - return getAlphabetizedMap(); - } - /** - *
        -   * The words that were expanded, indexed by their initial character.
        -   * (-- aip.dev/not-precedent: This is a legacy, non-standard pattern that violates
        -   *     aip.dev/158. Ordinarily, this should be a `repeated` field, as in PagedExpandResponse. --)
        -   * 
        - * - * map<string, .google.showcase.v1beta1.PagedExpandResponseList> alphabetized = 1; - */ - @java.lang.Override - - public java.util.Map getAlphabetizedMap() { - return internalGetAlphabetized().getMap(); - } - /** - *
        -   * The words that were expanded, indexed by their initial character.
        -   * (-- aip.dev/not-precedent: This is a legacy, non-standard pattern that violates
        -   *     aip.dev/158. Ordinarily, this should be a `repeated` field, as in PagedExpandResponse. --)
        -   * 
        - * - * map<string, .google.showcase.v1beta1.PagedExpandResponseList> alphabetized = 1; - */ - @java.lang.Override - - public com.google.showcase.v1beta1.PagedExpandResponseList getAlphabetizedOrDefault( - java.lang.String key, - com.google.showcase.v1beta1.PagedExpandResponseList defaultValue) { - if (key == null) { throw new NullPointerException("map key"); } - java.util.Map map = - internalGetAlphabetized().getMap(); - return map.containsKey(key) ? map.get(key) : defaultValue; - } - /** - *
        -   * The words that were expanded, indexed by their initial character.
        -   * (-- aip.dev/not-precedent: This is a legacy, non-standard pattern that violates
        -   *     aip.dev/158. Ordinarily, this should be a `repeated` field, as in PagedExpandResponse. --)
        -   * 
        - * - * map<string, .google.showcase.v1beta1.PagedExpandResponseList> alphabetized = 1; - */ - @java.lang.Override - - public com.google.showcase.v1beta1.PagedExpandResponseList getAlphabetizedOrThrow( - java.lang.String key) { - if (key == null) { throw new NullPointerException("map key"); } - java.util.Map map = - internalGetAlphabetized().getMap(); - if (!map.containsKey(key)) { - throw new java.lang.IllegalArgumentException(); - } - return map.get(key); - } - - public static final int NEXT_PAGE_TOKEN_FIELD_NUMBER = 2; - private volatile java.lang.Object nextPageToken_; - /** - *
        -   * The next page token.
        -   * 
        - * - * 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; - } - } - /** - *
        -   * The next page token.
        -   * 
        - * - * 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 { - com.google.protobuf.GeneratedMessageV3 - .serializeStringMapTo( - output, - internalGetAlphabetized(), - AlphabetizedDefaultEntryHolder.defaultEntry, - 1); - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nextPageToken_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 2, nextPageToken_); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - for (java.util.Map.Entry entry - : internalGetAlphabetized().getMap().entrySet()) { - com.google.protobuf.MapEntry - alphabetized__ = AlphabetizedDefaultEntryHolder.defaultEntry.newBuilderForType() - .setKey(entry.getKey()) - .setValue(entry.getValue()) - .build(); - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(1, alphabetized__); - } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nextPageToken_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, nextPageToken_); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof com.google.showcase.v1beta1.PagedExpandLegacyMappedResponse)) { - return super.equals(obj); - } - com.google.showcase.v1beta1.PagedExpandLegacyMappedResponse other = (com.google.showcase.v1beta1.PagedExpandLegacyMappedResponse) obj; - - if (!internalGetAlphabetized().equals( - other.internalGetAlphabetized())) return false; - if (!getNextPageToken() - .equals(other.getNextPageToken())) return false; - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - if (!internalGetAlphabetized().getMap().isEmpty()) { - hash = (37 * hash) + ALPHABETIZED_FIELD_NUMBER; - hash = (53 * hash) + internalGetAlphabetized().hashCode(); - } - hash = (37 * hash) + NEXT_PAGE_TOKEN_FIELD_NUMBER; - hash = (53 * hash) + getNextPageToken().hashCode(); - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.showcase.v1beta1.PagedExpandLegacyMappedResponse parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.showcase.v1beta1.PagedExpandLegacyMappedResponse parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.showcase.v1beta1.PagedExpandLegacyMappedResponse parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.showcase.v1beta1.PagedExpandLegacyMappedResponse 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.showcase.v1beta1.PagedExpandLegacyMappedResponse parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.showcase.v1beta1.PagedExpandLegacyMappedResponse parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.showcase.v1beta1.PagedExpandLegacyMappedResponse parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static com.google.showcase.v1beta1.PagedExpandLegacyMappedResponse 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.showcase.v1beta1.PagedExpandLegacyMappedResponse parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static com.google.showcase.v1beta1.PagedExpandLegacyMappedResponse 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.showcase.v1beta1.PagedExpandLegacyMappedResponse parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static com.google.showcase.v1beta1.PagedExpandLegacyMappedResponse 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.showcase.v1beta1.PagedExpandLegacyMappedResponse prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - @java.lang.Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - * Protobuf type {@code google.showcase.v1beta1.PagedExpandLegacyMappedResponse} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.PagedExpandLegacyMappedResponse) - com.google.showcase.v1beta1.PagedExpandLegacyMappedResponseOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.google.showcase.v1beta1.EchoOuterClass.internal_static_google_showcase_v1beta1_PagedExpandLegacyMappedResponse_descriptor; - } - - @SuppressWarnings({"rawtypes"}) - protected com.google.protobuf.MapField internalGetMapField( - int number) { - switch (number) { - case 1: - return internalGetAlphabetized(); - default: - throw new RuntimeException( - "Invalid map field number: " + number); - } - } - @SuppressWarnings({"rawtypes"}) - protected com.google.protobuf.MapField internalGetMutableMapField( - int number) { - switch (number) { - case 1: - return internalGetMutableAlphabetized(); - default: - throw new RuntimeException( - "Invalid map field number: " + number); - } - } - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.showcase.v1beta1.EchoOuterClass.internal_static_google_showcase_v1beta1_PagedExpandLegacyMappedResponse_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.showcase.v1beta1.PagedExpandLegacyMappedResponse.class, com.google.showcase.v1beta1.PagedExpandLegacyMappedResponse.Builder.class); - } - - // Construct using com.google.showcase.v1beta1.PagedExpandLegacyMappedResponse.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { - } - } - @java.lang.Override - public Builder clear() { - super.clear(); - internalGetMutableAlphabetized().clear(); - nextPageToken_ = ""; - - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return com.google.showcase.v1beta1.EchoOuterClass.internal_static_google_showcase_v1beta1_PagedExpandLegacyMappedResponse_descriptor; - } - - @java.lang.Override - public com.google.showcase.v1beta1.PagedExpandLegacyMappedResponse getDefaultInstanceForType() { - return com.google.showcase.v1beta1.PagedExpandLegacyMappedResponse.getDefaultInstance(); - } - - @java.lang.Override - public com.google.showcase.v1beta1.PagedExpandLegacyMappedResponse build() { - com.google.showcase.v1beta1.PagedExpandLegacyMappedResponse result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.showcase.v1beta1.PagedExpandLegacyMappedResponse buildPartial() { - com.google.showcase.v1beta1.PagedExpandLegacyMappedResponse result = new com.google.showcase.v1beta1.PagedExpandLegacyMappedResponse(this); - int from_bitField0_ = bitField0_; - result.alphabetized_ = internalGetAlphabetized(); - result.alphabetized_.makeImmutable(); - result.nextPageToken_ = nextPageToken_; - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.setField(field, value); - } - @java.lang.Override - public Builder clearField( - com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - @java.lang.Override - public Builder clearOneof( - com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.addRepeatedField(field, value); - } - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof com.google.showcase.v1beta1.PagedExpandLegacyMappedResponse) { - return mergeFrom((com.google.showcase.v1beta1.PagedExpandLegacyMappedResponse)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.showcase.v1beta1.PagedExpandLegacyMappedResponse other) { - if (other == com.google.showcase.v1beta1.PagedExpandLegacyMappedResponse.getDefaultInstance()) return this; - internalGetMutableAlphabetized().mergeFrom( - other.internalGetAlphabetized()); - if (!other.getNextPageToken().isEmpty()) { - nextPageToken_ = other.nextPageToken_; - onChanged(); - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - com.google.showcase.v1beta1.PagedExpandLegacyMappedResponse parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (com.google.showcase.v1beta1.PagedExpandLegacyMappedResponse) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - private int bitField0_; - - private com.google.protobuf.MapField< - java.lang.String, com.google.showcase.v1beta1.PagedExpandResponseList> alphabetized_; - private com.google.protobuf.MapField - internalGetAlphabetized() { - if (alphabetized_ == null) { - return com.google.protobuf.MapField.emptyMapField( - AlphabetizedDefaultEntryHolder.defaultEntry); - } - return alphabetized_; - } - private com.google.protobuf.MapField - internalGetMutableAlphabetized() { - onChanged();; - if (alphabetized_ == null) { - alphabetized_ = com.google.protobuf.MapField.newMapField( - AlphabetizedDefaultEntryHolder.defaultEntry); - } - if (!alphabetized_.isMutable()) { - alphabetized_ = alphabetized_.copy(); - } - return alphabetized_; - } - - public int getAlphabetizedCount() { - return internalGetAlphabetized().getMap().size(); - } - /** - *
        -     * The words that were expanded, indexed by their initial character.
        -     * (-- aip.dev/not-precedent: This is a legacy, non-standard pattern that violates
        -     *     aip.dev/158. Ordinarily, this should be a `repeated` field, as in PagedExpandResponse. --)
        -     * 
        - * - * map<string, .google.showcase.v1beta1.PagedExpandResponseList> alphabetized = 1; - */ - - @java.lang.Override - public boolean containsAlphabetized( - java.lang.String key) { - if (key == null) { throw new NullPointerException("map key"); } - return internalGetAlphabetized().getMap().containsKey(key); - } - /** - * Use {@link #getAlphabetizedMap()} instead. - */ - @java.lang.Override - @java.lang.Deprecated - public java.util.Map getAlphabetized() { - return getAlphabetizedMap(); - } - /** - *
        -     * The words that were expanded, indexed by their initial character.
        -     * (-- aip.dev/not-precedent: This is a legacy, non-standard pattern that violates
        -     *     aip.dev/158. Ordinarily, this should be a `repeated` field, as in PagedExpandResponse. --)
        -     * 
        - * - * map<string, .google.showcase.v1beta1.PagedExpandResponseList> alphabetized = 1; - */ - @java.lang.Override - - public java.util.Map getAlphabetizedMap() { - return internalGetAlphabetized().getMap(); - } - /** - *
        -     * The words that were expanded, indexed by their initial character.
        -     * (-- aip.dev/not-precedent: This is a legacy, non-standard pattern that violates
        -     *     aip.dev/158. Ordinarily, this should be a `repeated` field, as in PagedExpandResponse. --)
        -     * 
        - * - * map<string, .google.showcase.v1beta1.PagedExpandResponseList> alphabetized = 1; - */ - @java.lang.Override - - public com.google.showcase.v1beta1.PagedExpandResponseList getAlphabetizedOrDefault( - java.lang.String key, - com.google.showcase.v1beta1.PagedExpandResponseList defaultValue) { - if (key == null) { throw new NullPointerException("map key"); } - java.util.Map map = - internalGetAlphabetized().getMap(); - return map.containsKey(key) ? map.get(key) : defaultValue; - } - /** - *
        -     * The words that were expanded, indexed by their initial character.
        -     * (-- aip.dev/not-precedent: This is a legacy, non-standard pattern that violates
        -     *     aip.dev/158. Ordinarily, this should be a `repeated` field, as in PagedExpandResponse. --)
        -     * 
        - * - * map<string, .google.showcase.v1beta1.PagedExpandResponseList> alphabetized = 1; - */ - @java.lang.Override - - public com.google.showcase.v1beta1.PagedExpandResponseList getAlphabetizedOrThrow( - java.lang.String key) { - if (key == null) { throw new NullPointerException("map key"); } - java.util.Map map = - internalGetAlphabetized().getMap(); - if (!map.containsKey(key)) { - throw new java.lang.IllegalArgumentException(); - } - return map.get(key); - } - - public Builder clearAlphabetized() { - internalGetMutableAlphabetized().getMutableMap() - .clear(); - return this; - } - /** - *
        -     * The words that were expanded, indexed by their initial character.
        -     * (-- aip.dev/not-precedent: This is a legacy, non-standard pattern that violates
        -     *     aip.dev/158. Ordinarily, this should be a `repeated` field, as in PagedExpandResponse. --)
        -     * 
        - * - * map<string, .google.showcase.v1beta1.PagedExpandResponseList> alphabetized = 1; - */ - - public Builder removeAlphabetized( - java.lang.String key) { - if (key == null) { throw new NullPointerException("map key"); } - internalGetMutableAlphabetized().getMutableMap() - .remove(key); - return this; - } - /** - * Use alternate mutation accessors instead. - */ - @java.lang.Deprecated - public java.util.Map - getMutableAlphabetized() { - return internalGetMutableAlphabetized().getMutableMap(); - } - /** - *
        -     * The words that were expanded, indexed by their initial character.
        -     * (-- aip.dev/not-precedent: This is a legacy, non-standard pattern that violates
        -     *     aip.dev/158. Ordinarily, this should be a `repeated` field, as in PagedExpandResponse. --)
        -     * 
        - * - * map<string, .google.showcase.v1beta1.PagedExpandResponseList> alphabetized = 1; - */ - public Builder putAlphabetized( - java.lang.String key, - com.google.showcase.v1beta1.PagedExpandResponseList value) { - if (key == null) { throw new NullPointerException("map key"); } - if (value == null) { - throw new NullPointerException("map value"); -} - - internalGetMutableAlphabetized().getMutableMap() - .put(key, value); - return this; - } - /** - *
        -     * The words that were expanded, indexed by their initial character.
        -     * (-- aip.dev/not-precedent: This is a legacy, non-standard pattern that violates
        -     *     aip.dev/158. Ordinarily, this should be a `repeated` field, as in PagedExpandResponse. --)
        -     * 
        - * - * map<string, .google.showcase.v1beta1.PagedExpandResponseList> alphabetized = 1; - */ - - public Builder putAllAlphabetized( - java.util.Map values) { - internalGetMutableAlphabetized().getMutableMap() - .putAll(values); - return this; - } - - private java.lang.Object nextPageToken_ = ""; - /** - *
        -     * The next page token.
        -     * 
        - * - * 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; - } - } - /** - *
        -     * The next page token.
        -     * 
        - * - * 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; - } - } - /** - *
        -     * The next page token.
        -     * 
        - * - * string next_page_token = 2; - * @param value The nextPageToken to set. - * @return This builder for chaining. - */ - public Builder setNextPageToken( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - nextPageToken_ = value; - onChanged(); - return this; - } - /** - *
        -     * The next page token.
        -     * 
        - * - * string next_page_token = 2; - * @return This builder for chaining. - */ - public Builder clearNextPageToken() { - - nextPageToken_ = getDefaultInstance().getNextPageToken(); - onChanged(); - return this; - } - /** - *
        -     * The next page token.
        -     * 
        - * - * string next_page_token = 2; - * @param value The bytes for nextPageToken to set. - * @return This builder for chaining. - */ - public Builder setNextPageTokenBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - nextPageToken_ = value; - onChanged(); - return this; - } - @java.lang.Override - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - - // @@protoc_insertion_point(builder_scope:google.showcase.v1beta1.PagedExpandLegacyMappedResponse) - } - - // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.PagedExpandLegacyMappedResponse) - private static final com.google.showcase.v1beta1.PagedExpandLegacyMappedResponse DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new com.google.showcase.v1beta1.PagedExpandLegacyMappedResponse(); - } - - public static com.google.showcase.v1beta1.PagedExpandLegacyMappedResponse getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public PagedExpandLegacyMappedResponse parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new PagedExpandLegacyMappedResponse(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public com.google.showcase.v1beta1.PagedExpandLegacyMappedResponse getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/PagedExpandLegacyMappedResponseOrBuilder.java b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/PagedExpandLegacyMappedResponseOrBuilder.java deleted file mode 100644 index 2d81d0ce10..0000000000 --- a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/PagedExpandLegacyMappedResponseOrBuilder.java +++ /dev/null @@ -1,95 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: schema/google/showcase/v1beta1/echo.proto - -package com.google.showcase.v1beta1; - -public interface PagedExpandLegacyMappedResponseOrBuilder extends - // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.PagedExpandLegacyMappedResponse) - com.google.protobuf.MessageOrBuilder { - - /** - *
        -   * The words that were expanded, indexed by their initial character.
        -   * (-- aip.dev/not-precedent: This is a legacy, non-standard pattern that violates
        -   *     aip.dev/158. Ordinarily, this should be a `repeated` field, as in PagedExpandResponse. --)
        -   * 
        - * - * map<string, .google.showcase.v1beta1.PagedExpandResponseList> alphabetized = 1; - */ - int getAlphabetizedCount(); - /** - *
        -   * The words that were expanded, indexed by their initial character.
        -   * (-- aip.dev/not-precedent: This is a legacy, non-standard pattern that violates
        -   *     aip.dev/158. Ordinarily, this should be a `repeated` field, as in PagedExpandResponse. --)
        -   * 
        - * - * map<string, .google.showcase.v1beta1.PagedExpandResponseList> alphabetized = 1; - */ - boolean containsAlphabetized( - java.lang.String key); - /** - * Use {@link #getAlphabetizedMap()} instead. - */ - @java.lang.Deprecated - java.util.Map - getAlphabetized(); - /** - *
        -   * The words that were expanded, indexed by their initial character.
        -   * (-- aip.dev/not-precedent: This is a legacy, non-standard pattern that violates
        -   *     aip.dev/158. Ordinarily, this should be a `repeated` field, as in PagedExpandResponse. --)
        -   * 
        - * - * map<string, .google.showcase.v1beta1.PagedExpandResponseList> alphabetized = 1; - */ - java.util.Map - getAlphabetizedMap(); - /** - *
        -   * The words that were expanded, indexed by their initial character.
        -   * (-- aip.dev/not-precedent: This is a legacy, non-standard pattern that violates
        -   *     aip.dev/158. Ordinarily, this should be a `repeated` field, as in PagedExpandResponse. --)
        -   * 
        - * - * map<string, .google.showcase.v1beta1.PagedExpandResponseList> alphabetized = 1; - */ - - /* nullable */ -com.google.showcase.v1beta1.PagedExpandResponseList getAlphabetizedOrDefault( - java.lang.String key, - /* nullable */ -com.google.showcase.v1beta1.PagedExpandResponseList defaultValue); - /** - *
        -   * The words that were expanded, indexed by their initial character.
        -   * (-- aip.dev/not-precedent: This is a legacy, non-standard pattern that violates
        -   *     aip.dev/158. Ordinarily, this should be a `repeated` field, as in PagedExpandResponse. --)
        -   * 
        - * - * map<string, .google.showcase.v1beta1.PagedExpandResponseList> alphabetized = 1; - */ - - com.google.showcase.v1beta1.PagedExpandResponseList getAlphabetizedOrThrow( - java.lang.String key); - - /** - *
        -   * The next page token.
        -   * 
        - * - * string next_page_token = 2; - * @return The nextPageToken. - */ - java.lang.String getNextPageToken(); - /** - *
        -   * The next page token.
        -   * 
        - * - * string next_page_token = 2; - * @return The bytes for nextPageToken. - */ - com.google.protobuf.ByteString - getNextPageTokenBytes(); -} diff --git a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/PagedExpandLegacyRequest.java b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/PagedExpandLegacyRequest.java deleted file mode 100644 index 5a0fecec07..0000000000 --- a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/PagedExpandLegacyRequest.java +++ /dev/null @@ -1,853 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: schema/google/showcase/v1beta1/echo.proto - -package com.google.showcase.v1beta1; - -/** - *
        - * The request for the PagedExpandLegacy method.  This is a pattern used by some legacy APIs. New
        - * APIs should NOT use this pattern, but rather something like PagedExpandRequest which conforms to
        - * aip.dev/158.
        - * 
        - * - * Protobuf type {@code google.showcase.v1beta1.PagedExpandLegacyRequest} - */ -public final class PagedExpandLegacyRequest extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.PagedExpandLegacyRequest) - PagedExpandLegacyRequestOrBuilder { -private static final long serialVersionUID = 0L; - // Use PagedExpandLegacyRequest.newBuilder() to construct. - private PagedExpandLegacyRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private PagedExpandLegacyRequest() { - content_ = ""; - pageToken_ = ""; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new PagedExpandLegacyRequest(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private PagedExpandLegacyRequest( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: { - java.lang.String s = input.readStringRequireUtf8(); - - content_ = s; - break; - } - case 16: { - - maxResults_ = input.readInt32(); - break; - } - case 26: { - java.lang.String s = input.readStringRequireUtf8(); - - pageToken_ = s; - break; - } - default: { - if (!parseUnknownField( - input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException( - e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.google.showcase.v1beta1.EchoOuterClass.internal_static_google_showcase_v1beta1_PagedExpandLegacyRequest_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.showcase.v1beta1.EchoOuterClass.internal_static_google_showcase_v1beta1_PagedExpandLegacyRequest_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.showcase.v1beta1.PagedExpandLegacyRequest.class, com.google.showcase.v1beta1.PagedExpandLegacyRequest.Builder.class); - } - - public static final int CONTENT_FIELD_NUMBER = 1; - private volatile java.lang.Object content_; - /** - *
        -   * The string to expand.
        -   * 
        - * - * string content = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return The content. - */ - @java.lang.Override - public java.lang.String getContent() { - java.lang.Object ref = content_; - 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(); - content_ = s; - return s; - } - } - /** - *
        -   * The string to expand.
        -   * 
        - * - * string content = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return The bytes for content. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getContentBytes() { - java.lang.Object ref = content_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - content_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int MAX_RESULTS_FIELD_NUMBER = 2; - private int maxResults_; - /** - *
        -   * The number of words to returned in each page.
        -   * (-- aip.dev/not-precedent: This is a legacy, non-standard pattern that
        -   *     violates aip.dev/158. Ordinarily, this should be page_size. --)
        -   * 
        - * - * int32 max_results = 2; - * @return The maxResults. - */ - @java.lang.Override - public int getMaxResults() { - return maxResults_; - } - - public static final int PAGE_TOKEN_FIELD_NUMBER = 3; - private volatile java.lang.Object pageToken_; - /** - *
        -   * The position of the page to be returned.
        -   * 
        - * - * string page_token = 3; - * @return The pageToken. - */ - @java.lang.Override - public java.lang.String getPageToken() { - java.lang.Object ref = pageToken_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - pageToken_ = s; - return s; - } - } - /** - *
        -   * The position of the page to be returned.
        -   * 
        - * - * string page_token = 3; - * @return The bytes for pageToken. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getPageTokenBytes() { - java.lang.Object ref = pageToken_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - pageToken_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - private byte memoizedIsInitialized = -1; - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(content_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, content_); - } - if (maxResults_ != 0) { - output.writeInt32(2, maxResults_); - } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(pageToken_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 3, pageToken_); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(content_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, content_); - } - if (maxResults_ != 0) { - size += com.google.protobuf.CodedOutputStream - .computeInt32Size(2, maxResults_); - } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(pageToken_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, pageToken_); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof com.google.showcase.v1beta1.PagedExpandLegacyRequest)) { - return super.equals(obj); - } - com.google.showcase.v1beta1.PagedExpandLegacyRequest other = (com.google.showcase.v1beta1.PagedExpandLegacyRequest) obj; - - if (!getContent() - .equals(other.getContent())) return false; - if (getMaxResults() - != other.getMaxResults()) return false; - if (!getPageToken() - .equals(other.getPageToken())) return false; - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - hash = (37 * hash) + CONTENT_FIELD_NUMBER; - hash = (53 * hash) + getContent().hashCode(); - hash = (37 * hash) + MAX_RESULTS_FIELD_NUMBER; - hash = (53 * hash) + getMaxResults(); - hash = (37 * hash) + PAGE_TOKEN_FIELD_NUMBER; - hash = (53 * hash) + getPageToken().hashCode(); - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.showcase.v1beta1.PagedExpandLegacyRequest parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.showcase.v1beta1.PagedExpandLegacyRequest parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.showcase.v1beta1.PagedExpandLegacyRequest parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.showcase.v1beta1.PagedExpandLegacyRequest 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.showcase.v1beta1.PagedExpandLegacyRequest parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.showcase.v1beta1.PagedExpandLegacyRequest parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.showcase.v1beta1.PagedExpandLegacyRequest parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static com.google.showcase.v1beta1.PagedExpandLegacyRequest 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.showcase.v1beta1.PagedExpandLegacyRequest parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static com.google.showcase.v1beta1.PagedExpandLegacyRequest 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.showcase.v1beta1.PagedExpandLegacyRequest parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static com.google.showcase.v1beta1.PagedExpandLegacyRequest 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.showcase.v1beta1.PagedExpandLegacyRequest 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 request for the PagedExpandLegacy method.  This is a pattern used by some legacy APIs. New
        -   * APIs should NOT use this pattern, but rather something like PagedExpandRequest which conforms to
        -   * aip.dev/158.
        -   * 
        - * - * Protobuf type {@code google.showcase.v1beta1.PagedExpandLegacyRequest} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.PagedExpandLegacyRequest) - com.google.showcase.v1beta1.PagedExpandLegacyRequestOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.google.showcase.v1beta1.EchoOuterClass.internal_static_google_showcase_v1beta1_PagedExpandLegacyRequest_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.showcase.v1beta1.EchoOuterClass.internal_static_google_showcase_v1beta1_PagedExpandLegacyRequest_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.showcase.v1beta1.PagedExpandLegacyRequest.class, com.google.showcase.v1beta1.PagedExpandLegacyRequest.Builder.class); - } - - // Construct using com.google.showcase.v1beta1.PagedExpandLegacyRequest.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { - } - } - @java.lang.Override - public Builder clear() { - super.clear(); - content_ = ""; - - maxResults_ = 0; - - pageToken_ = ""; - - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return com.google.showcase.v1beta1.EchoOuterClass.internal_static_google_showcase_v1beta1_PagedExpandLegacyRequest_descriptor; - } - - @java.lang.Override - public com.google.showcase.v1beta1.PagedExpandLegacyRequest getDefaultInstanceForType() { - return com.google.showcase.v1beta1.PagedExpandLegacyRequest.getDefaultInstance(); - } - - @java.lang.Override - public com.google.showcase.v1beta1.PagedExpandLegacyRequest build() { - com.google.showcase.v1beta1.PagedExpandLegacyRequest result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.showcase.v1beta1.PagedExpandLegacyRequest buildPartial() { - com.google.showcase.v1beta1.PagedExpandLegacyRequest result = new com.google.showcase.v1beta1.PagedExpandLegacyRequest(this); - result.content_ = content_; - result.maxResults_ = maxResults_; - result.pageToken_ = pageToken_; - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.setField(field, value); - } - @java.lang.Override - public Builder clearField( - com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - @java.lang.Override - public Builder clearOneof( - com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.addRepeatedField(field, value); - } - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof com.google.showcase.v1beta1.PagedExpandLegacyRequest) { - return mergeFrom((com.google.showcase.v1beta1.PagedExpandLegacyRequest)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.showcase.v1beta1.PagedExpandLegacyRequest other) { - if (other == com.google.showcase.v1beta1.PagedExpandLegacyRequest.getDefaultInstance()) return this; - if (!other.getContent().isEmpty()) { - content_ = other.content_; - onChanged(); - } - if (other.getMaxResults() != 0) { - setMaxResults(other.getMaxResults()); - } - if (!other.getPageToken().isEmpty()) { - pageToken_ = other.pageToken_; - onChanged(); - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - com.google.showcase.v1beta1.PagedExpandLegacyRequest parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (com.google.showcase.v1beta1.PagedExpandLegacyRequest) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private java.lang.Object content_ = ""; - /** - *
        -     * The string to expand.
        -     * 
        - * - * string content = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return The content. - */ - public java.lang.String getContent() { - java.lang.Object ref = content_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - content_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - *
        -     * The string to expand.
        -     * 
        - * - * string content = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return The bytes for content. - */ - public com.google.protobuf.ByteString - getContentBytes() { - java.lang.Object ref = content_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - content_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - *
        -     * The string to expand.
        -     * 
        - * - * string content = 1 [(.google.api.field_behavior) = REQUIRED]; - * @param value The content to set. - * @return This builder for chaining. - */ - public Builder setContent( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - content_ = value; - onChanged(); - return this; - } - /** - *
        -     * The string to expand.
        -     * 
        - * - * string content = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return This builder for chaining. - */ - public Builder clearContent() { - - content_ = getDefaultInstance().getContent(); - onChanged(); - return this; - } - /** - *
        -     * The string to expand.
        -     * 
        - * - * string content = 1 [(.google.api.field_behavior) = REQUIRED]; - * @param value The bytes for content to set. - * @return This builder for chaining. - */ - public Builder setContentBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - content_ = value; - onChanged(); - return this; - } - - private int maxResults_ ; - /** - *
        -     * The number of words to returned in each page.
        -     * (-- aip.dev/not-precedent: This is a legacy, non-standard pattern that
        -     *     violates aip.dev/158. Ordinarily, this should be page_size. --)
        -     * 
        - * - * int32 max_results = 2; - * @return The maxResults. - */ - @java.lang.Override - public int getMaxResults() { - return maxResults_; - } - /** - *
        -     * The number of words to returned in each page.
        -     * (-- aip.dev/not-precedent: This is a legacy, non-standard pattern that
        -     *     violates aip.dev/158. Ordinarily, this should be page_size. --)
        -     * 
        - * - * int32 max_results = 2; - * @param value The maxResults to set. - * @return This builder for chaining. - */ - public Builder setMaxResults(int value) { - - maxResults_ = value; - onChanged(); - return this; - } - /** - *
        -     * The number of words to returned in each page.
        -     * (-- aip.dev/not-precedent: This is a legacy, non-standard pattern that
        -     *     violates aip.dev/158. Ordinarily, this should be page_size. --)
        -     * 
        - * - * int32 max_results = 2; - * @return This builder for chaining. - */ - public Builder clearMaxResults() { - - maxResults_ = 0; - onChanged(); - return this; - } - - private java.lang.Object pageToken_ = ""; - /** - *
        -     * The position of the page to be returned.
        -     * 
        - * - * string page_token = 3; - * @return The pageToken. - */ - public java.lang.String getPageToken() { - java.lang.Object ref = pageToken_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - pageToken_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - *
        -     * The position of the page to be returned.
        -     * 
        - * - * string page_token = 3; - * @return The bytes for pageToken. - */ - public com.google.protobuf.ByteString - getPageTokenBytes() { - java.lang.Object ref = pageToken_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - pageToken_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - *
        -     * The position of the page to be returned.
        -     * 
        - * - * string page_token = 3; - * @param value The pageToken to set. - * @return This builder for chaining. - */ - public Builder setPageToken( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - pageToken_ = value; - onChanged(); - return this; - } - /** - *
        -     * The position of the page to be returned.
        -     * 
        - * - * string page_token = 3; - * @return This builder for chaining. - */ - public Builder clearPageToken() { - - pageToken_ = getDefaultInstance().getPageToken(); - onChanged(); - return this; - } - /** - *
        -     * The position of the page to be returned.
        -     * 
        - * - * string page_token = 3; - * @param value The bytes for pageToken to set. - * @return This builder for chaining. - */ - public Builder setPageTokenBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - pageToken_ = value; - onChanged(); - return this; - } - @java.lang.Override - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - - // @@protoc_insertion_point(builder_scope:google.showcase.v1beta1.PagedExpandLegacyRequest) - } - - // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.PagedExpandLegacyRequest) - private static final com.google.showcase.v1beta1.PagedExpandLegacyRequest DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new com.google.showcase.v1beta1.PagedExpandLegacyRequest(); - } - - public static com.google.showcase.v1beta1.PagedExpandLegacyRequest getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public PagedExpandLegacyRequest parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new PagedExpandLegacyRequest(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public com.google.showcase.v1beta1.PagedExpandLegacyRequest getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/PagedExpandLegacyRequestOrBuilder.java b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/PagedExpandLegacyRequestOrBuilder.java deleted file mode 100644 index 54a86448e2..0000000000 --- a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/PagedExpandLegacyRequestOrBuilder.java +++ /dev/null @@ -1,61 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: schema/google/showcase/v1beta1/echo.proto - -package com.google.showcase.v1beta1; - -public interface PagedExpandLegacyRequestOrBuilder extends - // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.PagedExpandLegacyRequest) - com.google.protobuf.MessageOrBuilder { - - /** - *
        -   * The string to expand.
        -   * 
        - * - * string content = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return The content. - */ - java.lang.String getContent(); - /** - *
        -   * The string to expand.
        -   * 
        - * - * string content = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return The bytes for content. - */ - com.google.protobuf.ByteString - getContentBytes(); - - /** - *
        -   * The number of words to returned in each page.
        -   * (-- aip.dev/not-precedent: This is a legacy, non-standard pattern that
        -   *     violates aip.dev/158. Ordinarily, this should be page_size. --)
        -   * 
        - * - * int32 max_results = 2; - * @return The maxResults. - */ - int getMaxResults(); - - /** - *
        -   * The position of the page to be returned.
        -   * 
        - * - * string page_token = 3; - * @return The pageToken. - */ - java.lang.String getPageToken(); - /** - *
        -   * The position of the page to be returned.
        -   * 
        - * - * string page_token = 3; - * @return The bytes for pageToken. - */ - com.google.protobuf.ByteString - getPageTokenBytes(); -} diff --git a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/PagedExpandRequest.java b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/PagedExpandRequest.java deleted file mode 100644 index 291ce47b8b..0000000000 --- a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/PagedExpandRequest.java +++ /dev/null @@ -1,841 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: schema/google/showcase/v1beta1/echo.proto - -package com.google.showcase.v1beta1; - -/** - *
        - * The request for the PagedExpand method.
        - * 
        - * - * Protobuf type {@code google.showcase.v1beta1.PagedExpandRequest} - */ -public final class PagedExpandRequest extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.PagedExpandRequest) - PagedExpandRequestOrBuilder { -private static final long serialVersionUID = 0L; - // Use PagedExpandRequest.newBuilder() to construct. - private PagedExpandRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private PagedExpandRequest() { - content_ = ""; - pageToken_ = ""; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new PagedExpandRequest(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private PagedExpandRequest( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: { - java.lang.String s = input.readStringRequireUtf8(); - - content_ = s; - break; - } - case 16: { - - pageSize_ = input.readInt32(); - break; - } - case 26: { - java.lang.String s = input.readStringRequireUtf8(); - - pageToken_ = s; - break; - } - default: { - if (!parseUnknownField( - input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException( - e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.google.showcase.v1beta1.EchoOuterClass.internal_static_google_showcase_v1beta1_PagedExpandRequest_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.showcase.v1beta1.EchoOuterClass.internal_static_google_showcase_v1beta1_PagedExpandRequest_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.showcase.v1beta1.PagedExpandRequest.class, com.google.showcase.v1beta1.PagedExpandRequest.Builder.class); - } - - public static final int CONTENT_FIELD_NUMBER = 1; - private volatile java.lang.Object content_; - /** - *
        -   * The string to expand.
        -   * 
        - * - * string content = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return The content. - */ - @java.lang.Override - public java.lang.String getContent() { - java.lang.Object ref = content_; - 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(); - content_ = s; - return s; - } - } - /** - *
        -   * The string to expand.
        -   * 
        - * - * string content = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return The bytes for content. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getContentBytes() { - java.lang.Object ref = content_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - content_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int PAGE_SIZE_FIELD_NUMBER = 2; - private int pageSize_; - /** - *
        -   * The number of words to returned in each page.
        -   * 
        - * - * int32 page_size = 2; - * @return The pageSize. - */ - @java.lang.Override - public int getPageSize() { - return pageSize_; - } - - public static final int PAGE_TOKEN_FIELD_NUMBER = 3; - private volatile java.lang.Object pageToken_; - /** - *
        -   * The position of the page to be returned.
        -   * 
        - * - * string page_token = 3; - * @return The pageToken. - */ - @java.lang.Override - public java.lang.String getPageToken() { - java.lang.Object ref = pageToken_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - pageToken_ = s; - return s; - } - } - /** - *
        -   * The position of the page to be returned.
        -   * 
        - * - * string page_token = 3; - * @return The bytes for pageToken. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getPageTokenBytes() { - java.lang.Object ref = pageToken_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - pageToken_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - private byte memoizedIsInitialized = -1; - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(content_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, content_); - } - if (pageSize_ != 0) { - output.writeInt32(2, pageSize_); - } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(pageToken_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 3, pageToken_); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(content_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, content_); - } - 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_); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof com.google.showcase.v1beta1.PagedExpandRequest)) { - return super.equals(obj); - } - com.google.showcase.v1beta1.PagedExpandRequest other = (com.google.showcase.v1beta1.PagedExpandRequest) obj; - - if (!getContent() - .equals(other.getContent())) return false; - if (getPageSize() - != other.getPageSize()) return false; - if (!getPageToken() - .equals(other.getPageToken())) return false; - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - hash = (37 * hash) + CONTENT_FIELD_NUMBER; - hash = (53 * hash) + getContent().hashCode(); - hash = (37 * hash) + PAGE_SIZE_FIELD_NUMBER; - hash = (53 * hash) + getPageSize(); - hash = (37 * hash) + PAGE_TOKEN_FIELD_NUMBER; - hash = (53 * hash) + getPageToken().hashCode(); - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.showcase.v1beta1.PagedExpandRequest parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.showcase.v1beta1.PagedExpandRequest parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.showcase.v1beta1.PagedExpandRequest parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.showcase.v1beta1.PagedExpandRequest 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.showcase.v1beta1.PagedExpandRequest parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.showcase.v1beta1.PagedExpandRequest parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.showcase.v1beta1.PagedExpandRequest parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static com.google.showcase.v1beta1.PagedExpandRequest 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.showcase.v1beta1.PagedExpandRequest parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static com.google.showcase.v1beta1.PagedExpandRequest 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.showcase.v1beta1.PagedExpandRequest parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static com.google.showcase.v1beta1.PagedExpandRequest 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.showcase.v1beta1.PagedExpandRequest 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 request for the PagedExpand method.
        -   * 
        - * - * Protobuf type {@code google.showcase.v1beta1.PagedExpandRequest} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.PagedExpandRequest) - com.google.showcase.v1beta1.PagedExpandRequestOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.google.showcase.v1beta1.EchoOuterClass.internal_static_google_showcase_v1beta1_PagedExpandRequest_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.showcase.v1beta1.EchoOuterClass.internal_static_google_showcase_v1beta1_PagedExpandRequest_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.showcase.v1beta1.PagedExpandRequest.class, com.google.showcase.v1beta1.PagedExpandRequest.Builder.class); - } - - // Construct using com.google.showcase.v1beta1.PagedExpandRequest.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { - } - } - @java.lang.Override - public Builder clear() { - super.clear(); - content_ = ""; - - pageSize_ = 0; - - pageToken_ = ""; - - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return com.google.showcase.v1beta1.EchoOuterClass.internal_static_google_showcase_v1beta1_PagedExpandRequest_descriptor; - } - - @java.lang.Override - public com.google.showcase.v1beta1.PagedExpandRequest getDefaultInstanceForType() { - return com.google.showcase.v1beta1.PagedExpandRequest.getDefaultInstance(); - } - - @java.lang.Override - public com.google.showcase.v1beta1.PagedExpandRequest build() { - com.google.showcase.v1beta1.PagedExpandRequest result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.showcase.v1beta1.PagedExpandRequest buildPartial() { - com.google.showcase.v1beta1.PagedExpandRequest result = new com.google.showcase.v1beta1.PagedExpandRequest(this); - result.content_ = content_; - result.pageSize_ = pageSize_; - result.pageToken_ = pageToken_; - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.setField(field, value); - } - @java.lang.Override - public Builder clearField( - com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - @java.lang.Override - public Builder clearOneof( - com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.addRepeatedField(field, value); - } - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof com.google.showcase.v1beta1.PagedExpandRequest) { - return mergeFrom((com.google.showcase.v1beta1.PagedExpandRequest)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.showcase.v1beta1.PagedExpandRequest other) { - if (other == com.google.showcase.v1beta1.PagedExpandRequest.getDefaultInstance()) return this; - if (!other.getContent().isEmpty()) { - content_ = other.content_; - onChanged(); - } - if (other.getPageSize() != 0) { - setPageSize(other.getPageSize()); - } - if (!other.getPageToken().isEmpty()) { - pageToken_ = other.pageToken_; - onChanged(); - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - com.google.showcase.v1beta1.PagedExpandRequest parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (com.google.showcase.v1beta1.PagedExpandRequest) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private java.lang.Object content_ = ""; - /** - *
        -     * The string to expand.
        -     * 
        - * - * string content = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return The content. - */ - public java.lang.String getContent() { - java.lang.Object ref = content_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - content_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - *
        -     * The string to expand.
        -     * 
        - * - * string content = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return The bytes for content. - */ - public com.google.protobuf.ByteString - getContentBytes() { - java.lang.Object ref = content_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - content_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - *
        -     * The string to expand.
        -     * 
        - * - * string content = 1 [(.google.api.field_behavior) = REQUIRED]; - * @param value The content to set. - * @return This builder for chaining. - */ - public Builder setContent( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - content_ = value; - onChanged(); - return this; - } - /** - *
        -     * The string to expand.
        -     * 
        - * - * string content = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return This builder for chaining. - */ - public Builder clearContent() { - - content_ = getDefaultInstance().getContent(); - onChanged(); - return this; - } - /** - *
        -     * The string to expand.
        -     * 
        - * - * string content = 1 [(.google.api.field_behavior) = REQUIRED]; - * @param value The bytes for content to set. - * @return This builder for chaining. - */ - public Builder setContentBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - content_ = value; - onChanged(); - return this; - } - - private int pageSize_ ; - /** - *
        -     * The number of words to returned in each page.
        -     * 
        - * - * int32 page_size = 2; - * @return The pageSize. - */ - @java.lang.Override - public int getPageSize() { - return pageSize_; - } - /** - *
        -     * The number of words to returned in each page.
        -     * 
        - * - * int32 page_size = 2; - * @param value The pageSize to set. - * @return This builder for chaining. - */ - public Builder setPageSize(int value) { - - pageSize_ = value; - onChanged(); - return this; - } - /** - *
        -     * The number of words to returned in each page.
        -     * 
        - * - * int32 page_size = 2; - * @return This builder for chaining. - */ - public Builder clearPageSize() { - - pageSize_ = 0; - onChanged(); - return this; - } - - private java.lang.Object pageToken_ = ""; - /** - *
        -     * The position of the page to be returned.
        -     * 
        - * - * string page_token = 3; - * @return The pageToken. - */ - public java.lang.String getPageToken() { - java.lang.Object ref = pageToken_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - pageToken_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - *
        -     * The position of the page to be returned.
        -     * 
        - * - * string page_token = 3; - * @return The bytes for pageToken. - */ - public com.google.protobuf.ByteString - getPageTokenBytes() { - java.lang.Object ref = pageToken_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - pageToken_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - *
        -     * The position of the page to be returned.
        -     * 
        - * - * string page_token = 3; - * @param value The pageToken to set. - * @return This builder for chaining. - */ - public Builder setPageToken( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - pageToken_ = value; - onChanged(); - return this; - } - /** - *
        -     * The position of the page to be returned.
        -     * 
        - * - * string page_token = 3; - * @return This builder for chaining. - */ - public Builder clearPageToken() { - - pageToken_ = getDefaultInstance().getPageToken(); - onChanged(); - return this; - } - /** - *
        -     * The position of the page to be returned.
        -     * 
        - * - * string page_token = 3; - * @param value The bytes for pageToken to set. - * @return This builder for chaining. - */ - public Builder setPageTokenBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - pageToken_ = value; - onChanged(); - return this; - } - @java.lang.Override - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - - // @@protoc_insertion_point(builder_scope:google.showcase.v1beta1.PagedExpandRequest) - } - - // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.PagedExpandRequest) - private static final com.google.showcase.v1beta1.PagedExpandRequest DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new com.google.showcase.v1beta1.PagedExpandRequest(); - } - - public static com.google.showcase.v1beta1.PagedExpandRequest getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public PagedExpandRequest parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new PagedExpandRequest(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public com.google.showcase.v1beta1.PagedExpandRequest getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/PagedExpandRequestOrBuilder.java b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/PagedExpandRequestOrBuilder.java deleted file mode 100644 index dc5b9a11b1..0000000000 --- a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/PagedExpandRequestOrBuilder.java +++ /dev/null @@ -1,59 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: schema/google/showcase/v1beta1/echo.proto - -package com.google.showcase.v1beta1; - -public interface PagedExpandRequestOrBuilder extends - // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.PagedExpandRequest) - com.google.protobuf.MessageOrBuilder { - - /** - *
        -   * The string to expand.
        -   * 
        - * - * string content = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return The content. - */ - java.lang.String getContent(); - /** - *
        -   * The string to expand.
        -   * 
        - * - * string content = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return The bytes for content. - */ - com.google.protobuf.ByteString - getContentBytes(); - - /** - *
        -   * The number of words to returned in each page.
        -   * 
        - * - * int32 page_size = 2; - * @return The pageSize. - */ - int getPageSize(); - - /** - *
        -   * The position of the page to be returned.
        -   * 
        - * - * string page_token = 3; - * @return The pageToken. - */ - java.lang.String getPageToken(); - /** - *
        -   * The position of the page to be returned.
        -   * 
        - * - * string page_token = 3; - * @return The bytes for pageToken. - */ - com.google.protobuf.ByteString - getPageTokenBytes(); -} diff --git a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/PagedExpandResponse.java b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/PagedExpandResponse.java deleted file mode 100644 index a0c8934c64..0000000000 --- a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/PagedExpandResponse.java +++ /dev/null @@ -1,1038 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: schema/google/showcase/v1beta1/echo.proto - -package com.google.showcase.v1beta1; - -/** - *
        - * The response for the PagedExpand method.
        - * 
        - * - * Protobuf type {@code google.showcase.v1beta1.PagedExpandResponse} - */ -public final class PagedExpandResponse extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.PagedExpandResponse) - PagedExpandResponseOrBuilder { -private static final long serialVersionUID = 0L; - // Use PagedExpandResponse.newBuilder() to construct. - private PagedExpandResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private PagedExpandResponse() { - responses_ = java.util.Collections.emptyList(); - nextPageToken_ = ""; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new PagedExpandResponse(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private PagedExpandResponse( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - int mutable_bitField0_ = 0; - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: { - if (!((mutable_bitField0_ & 0x00000001) != 0)) { - responses_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000001; - } - responses_.add( - input.readMessage(com.google.showcase.v1beta1.EchoResponse.parser(), extensionRegistry)); - break; - } - case 18: { - java.lang.String s = input.readStringRequireUtf8(); - - nextPageToken_ = s; - break; - } - default: { - if (!parseUnknownField( - input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException( - e).setUnfinishedMessage(this); - } finally { - if (((mutable_bitField0_ & 0x00000001) != 0)) { - responses_ = java.util.Collections.unmodifiableList(responses_); - } - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.google.showcase.v1beta1.EchoOuterClass.internal_static_google_showcase_v1beta1_PagedExpandResponse_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.showcase.v1beta1.EchoOuterClass.internal_static_google_showcase_v1beta1_PagedExpandResponse_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.showcase.v1beta1.PagedExpandResponse.class, com.google.showcase.v1beta1.PagedExpandResponse.Builder.class); - } - - public static final int RESPONSES_FIELD_NUMBER = 1; - private java.util.List responses_; - /** - *
        -   * The words that were expanded.
        -   * 
        - * - * repeated .google.showcase.v1beta1.EchoResponse responses = 1; - */ - @java.lang.Override - public java.util.List getResponsesList() { - return responses_; - } - /** - *
        -   * The words that were expanded.
        -   * 
        - * - * repeated .google.showcase.v1beta1.EchoResponse responses = 1; - */ - @java.lang.Override - public java.util.List - getResponsesOrBuilderList() { - return responses_; - } - /** - *
        -   * The words that were expanded.
        -   * 
        - * - * repeated .google.showcase.v1beta1.EchoResponse responses = 1; - */ - @java.lang.Override - public int getResponsesCount() { - return responses_.size(); - } - /** - *
        -   * The words that were expanded.
        -   * 
        - * - * repeated .google.showcase.v1beta1.EchoResponse responses = 1; - */ - @java.lang.Override - public com.google.showcase.v1beta1.EchoResponse getResponses(int index) { - return responses_.get(index); - } - /** - *
        -   * The words that were expanded.
        -   * 
        - * - * repeated .google.showcase.v1beta1.EchoResponse responses = 1; - */ - @java.lang.Override - public com.google.showcase.v1beta1.EchoResponseOrBuilder getResponsesOrBuilder( - int index) { - return responses_.get(index); - } - - public static final int NEXT_PAGE_TOKEN_FIELD_NUMBER = 2; - private volatile java.lang.Object nextPageToken_; - /** - *
        -   * The next page token.
        -   * 
        - * - * 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; - } - } - /** - *
        -   * The next page token.
        -   * 
        - * - * 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 < responses_.size(); i++) { - output.writeMessage(1, responses_.get(i)); - } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nextPageToken_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 2, nextPageToken_); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - for (int i = 0; i < responses_.size(); i++) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(1, responses_.get(i)); - } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nextPageToken_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, nextPageToken_); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof com.google.showcase.v1beta1.PagedExpandResponse)) { - return super.equals(obj); - } - com.google.showcase.v1beta1.PagedExpandResponse other = (com.google.showcase.v1beta1.PagedExpandResponse) obj; - - if (!getResponsesList() - .equals(other.getResponsesList())) return false; - if (!getNextPageToken() - .equals(other.getNextPageToken())) return false; - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - if (getResponsesCount() > 0) { - hash = (37 * hash) + RESPONSES_FIELD_NUMBER; - hash = (53 * hash) + getResponsesList().hashCode(); - } - hash = (37 * hash) + NEXT_PAGE_TOKEN_FIELD_NUMBER; - hash = (53 * hash) + getNextPageToken().hashCode(); - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.showcase.v1beta1.PagedExpandResponse parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.showcase.v1beta1.PagedExpandResponse parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.showcase.v1beta1.PagedExpandResponse parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.showcase.v1beta1.PagedExpandResponse 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.showcase.v1beta1.PagedExpandResponse parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.showcase.v1beta1.PagedExpandResponse parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.showcase.v1beta1.PagedExpandResponse parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static com.google.showcase.v1beta1.PagedExpandResponse 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.showcase.v1beta1.PagedExpandResponse parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static com.google.showcase.v1beta1.PagedExpandResponse 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.showcase.v1beta1.PagedExpandResponse parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static com.google.showcase.v1beta1.PagedExpandResponse 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.showcase.v1beta1.PagedExpandResponse 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 for the PagedExpand method.
        -   * 
        - * - * Protobuf type {@code google.showcase.v1beta1.PagedExpandResponse} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.PagedExpandResponse) - com.google.showcase.v1beta1.PagedExpandResponseOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.google.showcase.v1beta1.EchoOuterClass.internal_static_google_showcase_v1beta1_PagedExpandResponse_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.showcase.v1beta1.EchoOuterClass.internal_static_google_showcase_v1beta1_PagedExpandResponse_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.showcase.v1beta1.PagedExpandResponse.class, com.google.showcase.v1beta1.PagedExpandResponse.Builder.class); - } - - // Construct using com.google.showcase.v1beta1.PagedExpandResponse.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { - getResponsesFieldBuilder(); - } - } - @java.lang.Override - public Builder clear() { - super.clear(); - if (responsesBuilder_ == null) { - responses_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - } else { - responsesBuilder_.clear(); - } - nextPageToken_ = ""; - - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return com.google.showcase.v1beta1.EchoOuterClass.internal_static_google_showcase_v1beta1_PagedExpandResponse_descriptor; - } - - @java.lang.Override - public com.google.showcase.v1beta1.PagedExpandResponse getDefaultInstanceForType() { - return com.google.showcase.v1beta1.PagedExpandResponse.getDefaultInstance(); - } - - @java.lang.Override - public com.google.showcase.v1beta1.PagedExpandResponse build() { - com.google.showcase.v1beta1.PagedExpandResponse result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.showcase.v1beta1.PagedExpandResponse buildPartial() { - com.google.showcase.v1beta1.PagedExpandResponse result = new com.google.showcase.v1beta1.PagedExpandResponse(this); - int from_bitField0_ = bitField0_; - if (responsesBuilder_ == null) { - if (((bitField0_ & 0x00000001) != 0)) { - responses_ = java.util.Collections.unmodifiableList(responses_); - bitField0_ = (bitField0_ & ~0x00000001); - } - result.responses_ = responses_; - } else { - result.responses_ = responsesBuilder_.build(); - } - result.nextPageToken_ = nextPageToken_; - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.setField(field, value); - } - @java.lang.Override - public Builder clearField( - com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - @java.lang.Override - public Builder clearOneof( - com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.addRepeatedField(field, value); - } - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof com.google.showcase.v1beta1.PagedExpandResponse) { - return mergeFrom((com.google.showcase.v1beta1.PagedExpandResponse)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.showcase.v1beta1.PagedExpandResponse other) { - if (other == com.google.showcase.v1beta1.PagedExpandResponse.getDefaultInstance()) return this; - if (responsesBuilder_ == null) { - if (!other.responses_.isEmpty()) { - if (responses_.isEmpty()) { - responses_ = other.responses_; - bitField0_ = (bitField0_ & ~0x00000001); - } else { - ensureResponsesIsMutable(); - responses_.addAll(other.responses_); - } - onChanged(); - } - } else { - if (!other.responses_.isEmpty()) { - if (responsesBuilder_.isEmpty()) { - responsesBuilder_.dispose(); - responsesBuilder_ = null; - responses_ = other.responses_; - bitField0_ = (bitField0_ & ~0x00000001); - responsesBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? - getResponsesFieldBuilder() : null; - } else { - responsesBuilder_.addAllMessages(other.responses_); - } - } - } - if (!other.getNextPageToken().isEmpty()) { - nextPageToken_ = other.nextPageToken_; - onChanged(); - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - com.google.showcase.v1beta1.PagedExpandResponse parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (com.google.showcase.v1beta1.PagedExpandResponse) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - private int bitField0_; - - private java.util.List responses_ = - java.util.Collections.emptyList(); - private void ensureResponsesIsMutable() { - if (!((bitField0_ & 0x00000001) != 0)) { - responses_ = new java.util.ArrayList(responses_); - bitField0_ |= 0x00000001; - } - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - com.google.showcase.v1beta1.EchoResponse, com.google.showcase.v1beta1.EchoResponse.Builder, com.google.showcase.v1beta1.EchoResponseOrBuilder> responsesBuilder_; - - /** - *
        -     * The words that were expanded.
        -     * 
        - * - * repeated .google.showcase.v1beta1.EchoResponse responses = 1; - */ - public java.util.List getResponsesList() { - if (responsesBuilder_ == null) { - return java.util.Collections.unmodifiableList(responses_); - } else { - return responsesBuilder_.getMessageList(); - } - } - /** - *
        -     * The words that were expanded.
        -     * 
        - * - * repeated .google.showcase.v1beta1.EchoResponse responses = 1; - */ - public int getResponsesCount() { - if (responsesBuilder_ == null) { - return responses_.size(); - } else { - return responsesBuilder_.getCount(); - } - } - /** - *
        -     * The words that were expanded.
        -     * 
        - * - * repeated .google.showcase.v1beta1.EchoResponse responses = 1; - */ - public com.google.showcase.v1beta1.EchoResponse getResponses(int index) { - if (responsesBuilder_ == null) { - return responses_.get(index); - } else { - return responsesBuilder_.getMessage(index); - } - } - /** - *
        -     * The words that were expanded.
        -     * 
        - * - * repeated .google.showcase.v1beta1.EchoResponse responses = 1; - */ - public Builder setResponses( - int index, com.google.showcase.v1beta1.EchoResponse value) { - if (responsesBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureResponsesIsMutable(); - responses_.set(index, value); - onChanged(); - } else { - responsesBuilder_.setMessage(index, value); - } - return this; - } - /** - *
        -     * The words that were expanded.
        -     * 
        - * - * repeated .google.showcase.v1beta1.EchoResponse responses = 1; - */ - public Builder setResponses( - int index, com.google.showcase.v1beta1.EchoResponse.Builder builderForValue) { - if (responsesBuilder_ == null) { - ensureResponsesIsMutable(); - responses_.set(index, builderForValue.build()); - onChanged(); - } else { - responsesBuilder_.setMessage(index, builderForValue.build()); - } - return this; - } - /** - *
        -     * The words that were expanded.
        -     * 
        - * - * repeated .google.showcase.v1beta1.EchoResponse responses = 1; - */ - public Builder addResponses(com.google.showcase.v1beta1.EchoResponse value) { - if (responsesBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureResponsesIsMutable(); - responses_.add(value); - onChanged(); - } else { - responsesBuilder_.addMessage(value); - } - return this; - } - /** - *
        -     * The words that were expanded.
        -     * 
        - * - * repeated .google.showcase.v1beta1.EchoResponse responses = 1; - */ - public Builder addResponses( - int index, com.google.showcase.v1beta1.EchoResponse value) { - if (responsesBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureResponsesIsMutable(); - responses_.add(index, value); - onChanged(); - } else { - responsesBuilder_.addMessage(index, value); - } - return this; - } - /** - *
        -     * The words that were expanded.
        -     * 
        - * - * repeated .google.showcase.v1beta1.EchoResponse responses = 1; - */ - public Builder addResponses( - com.google.showcase.v1beta1.EchoResponse.Builder builderForValue) { - if (responsesBuilder_ == null) { - ensureResponsesIsMutable(); - responses_.add(builderForValue.build()); - onChanged(); - } else { - responsesBuilder_.addMessage(builderForValue.build()); - } - return this; - } - /** - *
        -     * The words that were expanded.
        -     * 
        - * - * repeated .google.showcase.v1beta1.EchoResponse responses = 1; - */ - public Builder addResponses( - int index, com.google.showcase.v1beta1.EchoResponse.Builder builderForValue) { - if (responsesBuilder_ == null) { - ensureResponsesIsMutable(); - responses_.add(index, builderForValue.build()); - onChanged(); - } else { - responsesBuilder_.addMessage(index, builderForValue.build()); - } - return this; - } - /** - *
        -     * The words that were expanded.
        -     * 
        - * - * repeated .google.showcase.v1beta1.EchoResponse responses = 1; - */ - public Builder addAllResponses( - java.lang.Iterable values) { - if (responsesBuilder_ == null) { - ensureResponsesIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, responses_); - onChanged(); - } else { - responsesBuilder_.addAllMessages(values); - } - return this; - } - /** - *
        -     * The words that were expanded.
        -     * 
        - * - * repeated .google.showcase.v1beta1.EchoResponse responses = 1; - */ - public Builder clearResponses() { - if (responsesBuilder_ == null) { - responses_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - onChanged(); - } else { - responsesBuilder_.clear(); - } - return this; - } - /** - *
        -     * The words that were expanded.
        -     * 
        - * - * repeated .google.showcase.v1beta1.EchoResponse responses = 1; - */ - public Builder removeResponses(int index) { - if (responsesBuilder_ == null) { - ensureResponsesIsMutable(); - responses_.remove(index); - onChanged(); - } else { - responsesBuilder_.remove(index); - } - return this; - } - /** - *
        -     * The words that were expanded.
        -     * 
        - * - * repeated .google.showcase.v1beta1.EchoResponse responses = 1; - */ - public com.google.showcase.v1beta1.EchoResponse.Builder getResponsesBuilder( - int index) { - return getResponsesFieldBuilder().getBuilder(index); - } - /** - *
        -     * The words that were expanded.
        -     * 
        - * - * repeated .google.showcase.v1beta1.EchoResponse responses = 1; - */ - public com.google.showcase.v1beta1.EchoResponseOrBuilder getResponsesOrBuilder( - int index) { - if (responsesBuilder_ == null) { - return responses_.get(index); } else { - return responsesBuilder_.getMessageOrBuilder(index); - } - } - /** - *
        -     * The words that were expanded.
        -     * 
        - * - * repeated .google.showcase.v1beta1.EchoResponse responses = 1; - */ - public java.util.List - getResponsesOrBuilderList() { - if (responsesBuilder_ != null) { - return responsesBuilder_.getMessageOrBuilderList(); - } else { - return java.util.Collections.unmodifiableList(responses_); - } - } - /** - *
        -     * The words that were expanded.
        -     * 
        - * - * repeated .google.showcase.v1beta1.EchoResponse responses = 1; - */ - public com.google.showcase.v1beta1.EchoResponse.Builder addResponsesBuilder() { - return getResponsesFieldBuilder().addBuilder( - com.google.showcase.v1beta1.EchoResponse.getDefaultInstance()); - } - /** - *
        -     * The words that were expanded.
        -     * 
        - * - * repeated .google.showcase.v1beta1.EchoResponse responses = 1; - */ - public com.google.showcase.v1beta1.EchoResponse.Builder addResponsesBuilder( - int index) { - return getResponsesFieldBuilder().addBuilder( - index, com.google.showcase.v1beta1.EchoResponse.getDefaultInstance()); - } - /** - *
        -     * The words that were expanded.
        -     * 
        - * - * repeated .google.showcase.v1beta1.EchoResponse responses = 1; - */ - public java.util.List - getResponsesBuilderList() { - return getResponsesFieldBuilder().getBuilderList(); - } - private com.google.protobuf.RepeatedFieldBuilderV3< - com.google.showcase.v1beta1.EchoResponse, com.google.showcase.v1beta1.EchoResponse.Builder, com.google.showcase.v1beta1.EchoResponseOrBuilder> - getResponsesFieldBuilder() { - if (responsesBuilder_ == null) { - responsesBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< - com.google.showcase.v1beta1.EchoResponse, com.google.showcase.v1beta1.EchoResponse.Builder, com.google.showcase.v1beta1.EchoResponseOrBuilder>( - responses_, - ((bitField0_ & 0x00000001) != 0), - getParentForChildren(), - isClean()); - responses_ = null; - } - return responsesBuilder_; - } - - private java.lang.Object nextPageToken_ = ""; - /** - *
        -     * The next page token.
        -     * 
        - * - * 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; - } - } - /** - *
        -     * The next page token.
        -     * 
        - * - * 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; - } - } - /** - *
        -     * The next page token.
        -     * 
        - * - * string next_page_token = 2; - * @param value The nextPageToken to set. - * @return This builder for chaining. - */ - public Builder setNextPageToken( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - nextPageToken_ = value; - onChanged(); - return this; - } - /** - *
        -     * The next page token.
        -     * 
        - * - * string next_page_token = 2; - * @return This builder for chaining. - */ - public Builder clearNextPageToken() { - - nextPageToken_ = getDefaultInstance().getNextPageToken(); - onChanged(); - return this; - } - /** - *
        -     * The next page token.
        -     * 
        - * - * string next_page_token = 2; - * @param value The bytes for nextPageToken to set. - * @return This builder for chaining. - */ - public Builder setNextPageTokenBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - nextPageToken_ = value; - onChanged(); - return this; - } - @java.lang.Override - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - - // @@protoc_insertion_point(builder_scope:google.showcase.v1beta1.PagedExpandResponse) - } - - // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.PagedExpandResponse) - private static final com.google.showcase.v1beta1.PagedExpandResponse DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new com.google.showcase.v1beta1.PagedExpandResponse(); - } - - public static com.google.showcase.v1beta1.PagedExpandResponse getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public PagedExpandResponse parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new PagedExpandResponse(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public com.google.showcase.v1beta1.PagedExpandResponse getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/PagedExpandResponseList.java b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/PagedExpandResponseList.java deleted file mode 100644 index 61a75fdeb1..0000000000 --- a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/PagedExpandResponseList.java +++ /dev/null @@ -1,624 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: schema/google/showcase/v1beta1/echo.proto - -package com.google.showcase.v1beta1; - -/** - *
        - * A list of words.
        - * 
        - * - * Protobuf type {@code google.showcase.v1beta1.PagedExpandResponseList} - */ -public final class PagedExpandResponseList extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.PagedExpandResponseList) - PagedExpandResponseListOrBuilder { -private static final long serialVersionUID = 0L; - // Use PagedExpandResponseList.newBuilder() to construct. - private PagedExpandResponseList(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private PagedExpandResponseList() { - words_ = com.google.protobuf.LazyStringArrayList.EMPTY; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new PagedExpandResponseList(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private PagedExpandResponseList( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - int mutable_bitField0_ = 0; - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: { - java.lang.String s = input.readStringRequireUtf8(); - if (!((mutable_bitField0_ & 0x00000001) != 0)) { - words_ = new com.google.protobuf.LazyStringArrayList(); - mutable_bitField0_ |= 0x00000001; - } - words_.add(s); - break; - } - default: { - if (!parseUnknownField( - input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException( - e).setUnfinishedMessage(this); - } finally { - if (((mutable_bitField0_ & 0x00000001) != 0)) { - words_ = words_.getUnmodifiableView(); - } - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.google.showcase.v1beta1.EchoOuterClass.internal_static_google_showcase_v1beta1_PagedExpandResponseList_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.showcase.v1beta1.EchoOuterClass.internal_static_google_showcase_v1beta1_PagedExpandResponseList_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.showcase.v1beta1.PagedExpandResponseList.class, com.google.showcase.v1beta1.PagedExpandResponseList.Builder.class); - } - - public static final int WORDS_FIELD_NUMBER = 1; - private com.google.protobuf.LazyStringList words_; - /** - * repeated string words = 1; - * @return A list containing the words. - */ - public com.google.protobuf.ProtocolStringList - getWordsList() { - return words_; - } - /** - * repeated string words = 1; - * @return The count of words. - */ - public int getWordsCount() { - return words_.size(); - } - /** - * repeated string words = 1; - * @param index The index of the element to return. - * @return The words at the given index. - */ - public java.lang.String getWords(int index) { - return words_.get(index); - } - /** - * repeated string words = 1; - * @param index The index of the value to return. - * @return The bytes of the words at the given index. - */ - public com.google.protobuf.ByteString - getWordsBytes(int index) { - return words_.getByteString(index); - } - - private byte memoizedIsInitialized = -1; - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - for (int i = 0; i < words_.size(); i++) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, words_.getRaw(i)); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - { - int dataSize = 0; - for (int i = 0; i < words_.size(); i++) { - dataSize += computeStringSizeNoTag(words_.getRaw(i)); - } - size += dataSize; - size += 1 * getWordsList().size(); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof com.google.showcase.v1beta1.PagedExpandResponseList)) { - return super.equals(obj); - } - com.google.showcase.v1beta1.PagedExpandResponseList other = (com.google.showcase.v1beta1.PagedExpandResponseList) obj; - - if (!getWordsList() - .equals(other.getWordsList())) return false; - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - if (getWordsCount() > 0) { - hash = (37 * hash) + WORDS_FIELD_NUMBER; - hash = (53 * hash) + getWordsList().hashCode(); - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.showcase.v1beta1.PagedExpandResponseList parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.showcase.v1beta1.PagedExpandResponseList parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.showcase.v1beta1.PagedExpandResponseList parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.showcase.v1beta1.PagedExpandResponseList 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.showcase.v1beta1.PagedExpandResponseList parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.showcase.v1beta1.PagedExpandResponseList parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.showcase.v1beta1.PagedExpandResponseList parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static com.google.showcase.v1beta1.PagedExpandResponseList 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.showcase.v1beta1.PagedExpandResponseList parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static com.google.showcase.v1beta1.PagedExpandResponseList 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.showcase.v1beta1.PagedExpandResponseList parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static com.google.showcase.v1beta1.PagedExpandResponseList 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.showcase.v1beta1.PagedExpandResponseList prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - @java.lang.Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - *
        -   * A list of words.
        -   * 
        - * - * Protobuf type {@code google.showcase.v1beta1.PagedExpandResponseList} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.PagedExpandResponseList) - com.google.showcase.v1beta1.PagedExpandResponseListOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.google.showcase.v1beta1.EchoOuterClass.internal_static_google_showcase_v1beta1_PagedExpandResponseList_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.showcase.v1beta1.EchoOuterClass.internal_static_google_showcase_v1beta1_PagedExpandResponseList_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.showcase.v1beta1.PagedExpandResponseList.class, com.google.showcase.v1beta1.PagedExpandResponseList.Builder.class); - } - - // Construct using com.google.showcase.v1beta1.PagedExpandResponseList.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { - } - } - @java.lang.Override - public Builder clear() { - super.clear(); - words_ = com.google.protobuf.LazyStringArrayList.EMPTY; - bitField0_ = (bitField0_ & ~0x00000001); - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return com.google.showcase.v1beta1.EchoOuterClass.internal_static_google_showcase_v1beta1_PagedExpandResponseList_descriptor; - } - - @java.lang.Override - public com.google.showcase.v1beta1.PagedExpandResponseList getDefaultInstanceForType() { - return com.google.showcase.v1beta1.PagedExpandResponseList.getDefaultInstance(); - } - - @java.lang.Override - public com.google.showcase.v1beta1.PagedExpandResponseList build() { - com.google.showcase.v1beta1.PagedExpandResponseList result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.showcase.v1beta1.PagedExpandResponseList buildPartial() { - com.google.showcase.v1beta1.PagedExpandResponseList result = new com.google.showcase.v1beta1.PagedExpandResponseList(this); - int from_bitField0_ = bitField0_; - if (((bitField0_ & 0x00000001) != 0)) { - words_ = words_.getUnmodifiableView(); - bitField0_ = (bitField0_ & ~0x00000001); - } - result.words_ = words_; - 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.showcase.v1beta1.PagedExpandResponseList) { - return mergeFrom((com.google.showcase.v1beta1.PagedExpandResponseList)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.showcase.v1beta1.PagedExpandResponseList other) { - if (other == com.google.showcase.v1beta1.PagedExpandResponseList.getDefaultInstance()) return this; - if (!other.words_.isEmpty()) { - if (words_.isEmpty()) { - words_ = other.words_; - bitField0_ = (bitField0_ & ~0x00000001); - } else { - ensureWordsIsMutable(); - words_.addAll(other.words_); - } - onChanged(); - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - com.google.showcase.v1beta1.PagedExpandResponseList parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (com.google.showcase.v1beta1.PagedExpandResponseList) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - private int bitField0_; - - private com.google.protobuf.LazyStringList words_ = com.google.protobuf.LazyStringArrayList.EMPTY; - private void ensureWordsIsMutable() { - if (!((bitField0_ & 0x00000001) != 0)) { - words_ = new com.google.protobuf.LazyStringArrayList(words_); - bitField0_ |= 0x00000001; - } - } - /** - * repeated string words = 1; - * @return A list containing the words. - */ - public com.google.protobuf.ProtocolStringList - getWordsList() { - return words_.getUnmodifiableView(); - } - /** - * repeated string words = 1; - * @return The count of words. - */ - public int getWordsCount() { - return words_.size(); - } - /** - * repeated string words = 1; - * @param index The index of the element to return. - * @return The words at the given index. - */ - public java.lang.String getWords(int index) { - return words_.get(index); - } - /** - * repeated string words = 1; - * @param index The index of the value to return. - * @return The bytes of the words at the given index. - */ - public com.google.protobuf.ByteString - getWordsBytes(int index) { - return words_.getByteString(index); - } - /** - * repeated string words = 1; - * @param index The index to set the value at. - * @param value The words to set. - * @return This builder for chaining. - */ - public Builder setWords( - int index, java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - ensureWordsIsMutable(); - words_.set(index, value); - onChanged(); - return this; - } - /** - * repeated string words = 1; - * @param value The words to add. - * @return This builder for chaining. - */ - public Builder addWords( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - ensureWordsIsMutable(); - words_.add(value); - onChanged(); - return this; - } - /** - * repeated string words = 1; - * @param values The words to add. - * @return This builder for chaining. - */ - public Builder addAllWords( - java.lang.Iterable values) { - ensureWordsIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, words_); - onChanged(); - return this; - } - /** - * repeated string words = 1; - * @return This builder for chaining. - */ - public Builder clearWords() { - words_ = com.google.protobuf.LazyStringArrayList.EMPTY; - bitField0_ = (bitField0_ & ~0x00000001); - onChanged(); - return this; - } - /** - * repeated string words = 1; - * @param value The bytes of the words to add. - * @return This builder for chaining. - */ - public Builder addWordsBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - ensureWordsIsMutable(); - words_.add(value); - onChanged(); - return this; - } - @java.lang.Override - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - - // @@protoc_insertion_point(builder_scope:google.showcase.v1beta1.PagedExpandResponseList) - } - - // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.PagedExpandResponseList) - private static final com.google.showcase.v1beta1.PagedExpandResponseList DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new com.google.showcase.v1beta1.PagedExpandResponseList(); - } - - public static com.google.showcase.v1beta1.PagedExpandResponseList getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public PagedExpandResponseList parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new PagedExpandResponseList(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public com.google.showcase.v1beta1.PagedExpandResponseList getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/PagedExpandResponseListOrBuilder.java b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/PagedExpandResponseListOrBuilder.java deleted file mode 100644 index 56c27b2f60..0000000000 --- a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/PagedExpandResponseListOrBuilder.java +++ /dev/null @@ -1,34 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: schema/google/showcase/v1beta1/echo.proto - -package com.google.showcase.v1beta1; - -public interface PagedExpandResponseListOrBuilder extends - // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.PagedExpandResponseList) - com.google.protobuf.MessageOrBuilder { - - /** - * repeated string words = 1; - * @return A list containing the words. - */ - java.util.List - getWordsList(); - /** - * repeated string words = 1; - * @return The count of words. - */ - int getWordsCount(); - /** - * repeated string words = 1; - * @param index The index of the element to return. - * @return The words at the given index. - */ - java.lang.String getWords(int index); - /** - * repeated string words = 1; - * @param index The index of the value to return. - * @return The bytes of the words at the given index. - */ - com.google.protobuf.ByteString - getWordsBytes(int index); -} diff --git a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/PagedExpandResponseOrBuilder.java b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/PagedExpandResponseOrBuilder.java deleted file mode 100644 index 613e7031bd..0000000000 --- a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/PagedExpandResponseOrBuilder.java +++ /dev/null @@ -1,73 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: schema/google/showcase/v1beta1/echo.proto - -package com.google.showcase.v1beta1; - -public interface PagedExpandResponseOrBuilder extends - // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.PagedExpandResponse) - com.google.protobuf.MessageOrBuilder { - - /** - *
        -   * The words that were expanded.
        -   * 
        - * - * repeated .google.showcase.v1beta1.EchoResponse responses = 1; - */ - java.util.List - getResponsesList(); - /** - *
        -   * The words that were expanded.
        -   * 
        - * - * repeated .google.showcase.v1beta1.EchoResponse responses = 1; - */ - com.google.showcase.v1beta1.EchoResponse getResponses(int index); - /** - *
        -   * The words that were expanded.
        -   * 
        - * - * repeated .google.showcase.v1beta1.EchoResponse responses = 1; - */ - int getResponsesCount(); - /** - *
        -   * The words that were expanded.
        -   * 
        - * - * repeated .google.showcase.v1beta1.EchoResponse responses = 1; - */ - java.util.List - getResponsesOrBuilderList(); - /** - *
        -   * The words that were expanded.
        -   * 
        - * - * repeated .google.showcase.v1beta1.EchoResponse responses = 1; - */ - com.google.showcase.v1beta1.EchoResponseOrBuilder getResponsesOrBuilder( - int index); - - /** - *
        -   * The next page token.
        -   * 
        - * - * string next_page_token = 2; - * @return The nextPageToken. - */ - java.lang.String getNextPageToken(); - /** - *
        -   * The next page token.
        -   * 
        - * - * string next_page_token = 2; - * @return The bytes for nextPageToken. - */ - com.google.protobuf.ByteString - getNextPageTokenBytes(); -} diff --git a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ProfileName.java b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ProfileName.java deleted file mode 100644 index b69500d0ae..0000000000 --- a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ProfileName.java +++ /dev/null @@ -1,168 +0,0 @@ -/* - * 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 - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1; - -import com.google.api.pathtemplate.PathTemplate; -import com.google.api.resourcenames.ResourceName; -import com.google.common.base.Preconditions; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import javax.annotation.Generated; - -// AUTO-GENERATED DOCUMENTATION AND CLASS. -@Generated("by gapic-generator-java") -public class ProfileName implements ResourceName { - private static final PathTemplate USER = - PathTemplate.createWithoutUrlEncoding("users/{user}/profile/blurbs"); - private volatile Map fieldValuesMap; - private final String user; - - @Deprecated - protected ProfileName() { - user = null; - } - - private ProfileName(Builder builder) { - user = Preconditions.checkNotNull(builder.getUser()); - } - - public String getUser() { - return user; - } - - public static Builder newBuilder() { - return new Builder(); - } - - public Builder toBuilder() { - return new Builder(this); - } - - public static ProfileName of(String user) { - return newBuilder().setUser(user).build(); - } - - public static String format(String user) { - return newBuilder().setUser(user).build().toString(); - } - - public static ProfileName parse(String formattedString) { - if (formattedString.isEmpty()) { - return null; - } - Map matchMap = - USER.validatedMatch( - formattedString, "ProfileName.parse: formattedString not in valid format"); - return of(matchMap.get("user")); - } - - 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 (ProfileName value : values) { - if (value == null) { - list.add(""); - } else { - list.add(value.toString()); - } - } - return list; - } - - public static boolean isParsableFrom(String formattedString) { - return USER.matches(formattedString); - } - - @Override - public Map getFieldValuesMap() { - if (fieldValuesMap == null) { - synchronized (this) { - if (fieldValuesMap == null) { - ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); - if (user != null) { - fieldMapBuilder.put("user", user); - } - fieldValuesMap = fieldMapBuilder.build(); - } - } - } - return fieldValuesMap; - } - - public String getFieldValue(String fieldName) { - return getFieldValuesMap().get(fieldName); - } - - @Override - public String toString() { - return USER.instantiate("user", user); - } - - @Override - public boolean equals(Object o) { - if (o == this) { - return true; - } - if (o != null || getClass() == o.getClass()) { - ProfileName that = ((ProfileName) o); - return Objects.equals(this.user, that.user); - } - return false; - } - - @Override - public int hashCode() { - int h = 1; - h *= 1000003; - h ^= Objects.hashCode(user); - return h; - } - - /** Builder for users/{user}/profile/blurbs. */ - public static class Builder { - private String user; - - protected Builder() {} - - public String getUser() { - return user; - } - - public Builder setUser(String user) { - this.user = user; - return this; - } - - private Builder(ProfileName profileName) { - this.user = profileName.user; - } - - public ProfileName build() { - return new ProfileName(this); - } - } -} diff --git a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/RepeatRequest.java b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/RepeatRequest.java deleted file mode 100644 index 3a22cdf230..0000000000 --- a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/RepeatRequest.java +++ /dev/null @@ -1,1518 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: schema/google/showcase/v1beta1/compliance.proto - -package com.google.showcase.v1beta1; - -/** - * Protobuf type {@code google.showcase.v1beta1.RepeatRequest} - */ -public final class RepeatRequest extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.RepeatRequest) - RepeatRequestOrBuilder { -private static final long serialVersionUID = 0L; - // Use RepeatRequest.newBuilder() to construct. - private RepeatRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private RepeatRequest() { - name_ = ""; - intendedBindingUri_ = ""; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new RepeatRequest(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private RepeatRequest( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - int mutable_bitField0_ = 0; - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: { - java.lang.String s = input.readStringRequireUtf8(); - - name_ = s; - break; - } - case 18: { - com.google.showcase.v1beta1.ComplianceData.Builder subBuilder = null; - if (info_ != null) { - subBuilder = info_.toBuilder(); - } - info_ = input.readMessage(com.google.showcase.v1beta1.ComplianceData.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(info_); - info_ = subBuilder.buildPartial(); - } - - break; - } - case 24: { - - serverVerify_ = input.readBool(); - break; - } - case 32: { - - fInt32_ = input.readInt32(); - break; - } - case 40: { - - fInt64_ = input.readInt64(); - break; - } - case 49: { - - fDouble_ = input.readDouble(); - break; - } - case 56: { - bitField0_ |= 0x00000002; - pInt32_ = input.readInt32(); - break; - } - case 64: { - bitField0_ |= 0x00000004; - pInt64_ = input.readInt64(); - break; - } - case 73: { - bitField0_ |= 0x00000008; - pDouble_ = input.readDouble(); - break; - } - case 82: { - java.lang.String s = input.readStringRequireUtf8(); - bitField0_ |= 0x00000001; - intendedBindingUri_ = s; - break; - } - default: { - if (!parseUnknownField( - input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException( - e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.google.showcase.v1beta1.ComplianceOuterClass.internal_static_google_showcase_v1beta1_RepeatRequest_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.showcase.v1beta1.ComplianceOuterClass.internal_static_google_showcase_v1beta1_RepeatRequest_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.showcase.v1beta1.RepeatRequest.class, com.google.showcase.v1beta1.RepeatRequest.Builder.class); - } - - private int bitField0_; - public static final int NAME_FIELD_NUMBER = 1; - private volatile java.lang.Object name_; - /** - * 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; - } - } - /** - * 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 INFO_FIELD_NUMBER = 2; - private com.google.showcase.v1beta1.ComplianceData info_; - /** - * .google.showcase.v1beta1.ComplianceData info = 2; - * @return Whether the info field is set. - */ - @java.lang.Override - public boolean hasInfo() { - return info_ != null; - } - /** - * .google.showcase.v1beta1.ComplianceData info = 2; - * @return The info. - */ - @java.lang.Override - public com.google.showcase.v1beta1.ComplianceData getInfo() { - return info_ == null ? com.google.showcase.v1beta1.ComplianceData.getDefaultInstance() : info_; - } - /** - * .google.showcase.v1beta1.ComplianceData info = 2; - */ - @java.lang.Override - public com.google.showcase.v1beta1.ComplianceDataOrBuilder getInfoOrBuilder() { - return getInfo(); - } - - public static final int SERVER_VERIFY_FIELD_NUMBER = 3; - private boolean serverVerify_; - /** - *
        -   * If true, the server will verify that the received request matches
        -   * the request with the same name in the compliance test suite.
        -   * 
        - * - * bool server_verify = 3; - * @return The serverVerify. - */ - @java.lang.Override - public boolean getServerVerify() { - return serverVerify_; - } - - public static final int INTENDED_BINDING_URI_FIELD_NUMBER = 10; - private volatile java.lang.Object intendedBindingUri_; - /** - *
        -   * The URI template this request is expected to be bound to server-side.
        -   * 
        - * - * optional string intended_binding_uri = 10; - * @return Whether the intendedBindingUri field is set. - */ - @java.lang.Override - public boolean hasIntendedBindingUri() { - return ((bitField0_ & 0x00000001) != 0); - } - /** - *
        -   * The URI template this request is expected to be bound to server-side.
        -   * 
        - * - * optional string intended_binding_uri = 10; - * @return The intendedBindingUri. - */ - @java.lang.Override - public java.lang.String getIntendedBindingUri() { - java.lang.Object ref = intendedBindingUri_; - 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(); - intendedBindingUri_ = s; - return s; - } - } - /** - *
        -   * The URI template this request is expected to be bound to server-side.
        -   * 
        - * - * optional string intended_binding_uri = 10; - * @return The bytes for intendedBindingUri. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getIntendedBindingUriBytes() { - java.lang.Object ref = intendedBindingUri_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - intendedBindingUri_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int F_INT32_FIELD_NUMBER = 4; - private int fInt32_; - /** - *
        -   * Some top level fields, to test that these are encoded correctly
        -   * in query params.
        -   * 
        - * - * int32 f_int32 = 4; - * @return The fInt32. - */ - @java.lang.Override - public int getFInt32() { - return fInt32_; - } - - public static final int F_INT64_FIELD_NUMBER = 5; - private long fInt64_; - /** - * int64 f_int64 = 5; - * @return The fInt64. - */ - @java.lang.Override - public long getFInt64() { - return fInt64_; - } - - public static final int F_DOUBLE_FIELD_NUMBER = 6; - private double fDouble_; - /** - * double f_double = 6; - * @return The fDouble. - */ - @java.lang.Override - public double getFDouble() { - return fDouble_; - } - - public static final int P_INT32_FIELD_NUMBER = 7; - private int pInt32_; - /** - * optional int32 p_int32 = 7; - * @return Whether the pInt32 field is set. - */ - @java.lang.Override - public boolean hasPInt32() { - return ((bitField0_ & 0x00000002) != 0); - } - /** - * optional int32 p_int32 = 7; - * @return The pInt32. - */ - @java.lang.Override - public int getPInt32() { - return pInt32_; - } - - public static final int P_INT64_FIELD_NUMBER = 8; - private long pInt64_; - /** - * optional int64 p_int64 = 8; - * @return Whether the pInt64 field is set. - */ - @java.lang.Override - public boolean hasPInt64() { - return ((bitField0_ & 0x00000004) != 0); - } - /** - * optional int64 p_int64 = 8; - * @return The pInt64. - */ - @java.lang.Override - public long getPInt64() { - return pInt64_; - } - - public static final int P_DOUBLE_FIELD_NUMBER = 9; - private double pDouble_; - /** - * optional double p_double = 9; - * @return Whether the pDouble field is set. - */ - @java.lang.Override - public boolean hasPDouble() { - return ((bitField0_ & 0x00000008) != 0); - } - /** - * optional double p_double = 9; - * @return The pDouble. - */ - @java.lang.Override - public double getPDouble() { - return pDouble_; - } - - 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 (info_ != null) { - output.writeMessage(2, getInfo()); - } - if (serverVerify_ != false) { - output.writeBool(3, serverVerify_); - } - if (fInt32_ != 0) { - output.writeInt32(4, fInt32_); - } - if (fInt64_ != 0L) { - output.writeInt64(5, fInt64_); - } - if (java.lang.Double.doubleToRawLongBits(fDouble_) != 0) { - output.writeDouble(6, fDouble_); - } - if (((bitField0_ & 0x00000002) != 0)) { - output.writeInt32(7, pInt32_); - } - if (((bitField0_ & 0x00000004) != 0)) { - output.writeInt64(8, pInt64_); - } - if (((bitField0_ & 0x00000008) != 0)) { - output.writeDouble(9, pDouble_); - } - if (((bitField0_ & 0x00000001) != 0)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 10, intendedBindingUri_); - } - unknownFields.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 (info_ != null) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(2, getInfo()); - } - if (serverVerify_ != false) { - size += com.google.protobuf.CodedOutputStream - .computeBoolSize(3, serverVerify_); - } - if (fInt32_ != 0) { - size += com.google.protobuf.CodedOutputStream - .computeInt32Size(4, fInt32_); - } - if (fInt64_ != 0L) { - size += com.google.protobuf.CodedOutputStream - .computeInt64Size(5, fInt64_); - } - if (java.lang.Double.doubleToRawLongBits(fDouble_) != 0) { - size += com.google.protobuf.CodedOutputStream - .computeDoubleSize(6, fDouble_); - } - if (((bitField0_ & 0x00000002) != 0)) { - size += com.google.protobuf.CodedOutputStream - .computeInt32Size(7, pInt32_); - } - if (((bitField0_ & 0x00000004) != 0)) { - size += com.google.protobuf.CodedOutputStream - .computeInt64Size(8, pInt64_); - } - if (((bitField0_ & 0x00000008) != 0)) { - size += com.google.protobuf.CodedOutputStream - .computeDoubleSize(9, pDouble_); - } - if (((bitField0_ & 0x00000001) != 0)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(10, intendedBindingUri_); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof com.google.showcase.v1beta1.RepeatRequest)) { - return super.equals(obj); - } - com.google.showcase.v1beta1.RepeatRequest other = (com.google.showcase.v1beta1.RepeatRequest) obj; - - if (!getName() - .equals(other.getName())) return false; - if (hasInfo() != other.hasInfo()) return false; - if (hasInfo()) { - if (!getInfo() - .equals(other.getInfo())) return false; - } - if (getServerVerify() - != other.getServerVerify()) return false; - if (hasIntendedBindingUri() != other.hasIntendedBindingUri()) return false; - if (hasIntendedBindingUri()) { - if (!getIntendedBindingUri() - .equals(other.getIntendedBindingUri())) return false; - } - if (getFInt32() - != other.getFInt32()) return false; - if (getFInt64() - != other.getFInt64()) return false; - if (java.lang.Double.doubleToLongBits(getFDouble()) - != java.lang.Double.doubleToLongBits( - other.getFDouble())) return false; - if (hasPInt32() != other.hasPInt32()) return false; - if (hasPInt32()) { - if (getPInt32() - != other.getPInt32()) return false; - } - if (hasPInt64() != other.hasPInt64()) return false; - if (hasPInt64()) { - if (getPInt64() - != other.getPInt64()) return false; - } - if (hasPDouble() != other.hasPDouble()) return false; - if (hasPDouble()) { - if (java.lang.Double.doubleToLongBits(getPDouble()) - != java.lang.Double.doubleToLongBits( - other.getPDouble())) return false; - } - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - hash = (37 * hash) + NAME_FIELD_NUMBER; - hash = (53 * hash) + getName().hashCode(); - if (hasInfo()) { - hash = (37 * hash) + INFO_FIELD_NUMBER; - hash = (53 * hash) + getInfo().hashCode(); - } - hash = (37 * hash) + SERVER_VERIFY_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( - getServerVerify()); - if (hasIntendedBindingUri()) { - hash = (37 * hash) + INTENDED_BINDING_URI_FIELD_NUMBER; - hash = (53 * hash) + getIntendedBindingUri().hashCode(); - } - hash = (37 * hash) + F_INT32_FIELD_NUMBER; - hash = (53 * hash) + getFInt32(); - hash = (37 * hash) + F_INT64_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashLong( - getFInt64()); - hash = (37 * hash) + F_DOUBLE_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashLong( - java.lang.Double.doubleToLongBits(getFDouble())); - if (hasPInt32()) { - hash = (37 * hash) + P_INT32_FIELD_NUMBER; - hash = (53 * hash) + getPInt32(); - } - if (hasPInt64()) { - hash = (37 * hash) + P_INT64_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashLong( - getPInt64()); - } - if (hasPDouble()) { - hash = (37 * hash) + P_DOUBLE_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashLong( - java.lang.Double.doubleToLongBits(getPDouble())); - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.showcase.v1beta1.RepeatRequest parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.showcase.v1beta1.RepeatRequest parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.showcase.v1beta1.RepeatRequest parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.showcase.v1beta1.RepeatRequest 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.showcase.v1beta1.RepeatRequest parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.showcase.v1beta1.RepeatRequest parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.showcase.v1beta1.RepeatRequest parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static com.google.showcase.v1beta1.RepeatRequest 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.showcase.v1beta1.RepeatRequest parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static com.google.showcase.v1beta1.RepeatRequest 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.showcase.v1beta1.RepeatRequest parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static com.google.showcase.v1beta1.RepeatRequest 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.showcase.v1beta1.RepeatRequest prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - @java.lang.Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - * Protobuf type {@code google.showcase.v1beta1.RepeatRequest} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.RepeatRequest) - com.google.showcase.v1beta1.RepeatRequestOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.google.showcase.v1beta1.ComplianceOuterClass.internal_static_google_showcase_v1beta1_RepeatRequest_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.showcase.v1beta1.ComplianceOuterClass.internal_static_google_showcase_v1beta1_RepeatRequest_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.showcase.v1beta1.RepeatRequest.class, com.google.showcase.v1beta1.RepeatRequest.Builder.class); - } - - // Construct using com.google.showcase.v1beta1.RepeatRequest.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { - } - } - @java.lang.Override - public Builder clear() { - super.clear(); - name_ = ""; - - if (infoBuilder_ == null) { - info_ = null; - } else { - info_ = null; - infoBuilder_ = null; - } - serverVerify_ = false; - - intendedBindingUri_ = ""; - bitField0_ = (bitField0_ & ~0x00000001); - fInt32_ = 0; - - fInt64_ = 0L; - - fDouble_ = 0D; - - pInt32_ = 0; - bitField0_ = (bitField0_ & ~0x00000002); - pInt64_ = 0L; - bitField0_ = (bitField0_ & ~0x00000004); - pDouble_ = 0D; - bitField0_ = (bitField0_ & ~0x00000008); - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return com.google.showcase.v1beta1.ComplianceOuterClass.internal_static_google_showcase_v1beta1_RepeatRequest_descriptor; - } - - @java.lang.Override - public com.google.showcase.v1beta1.RepeatRequest getDefaultInstanceForType() { - return com.google.showcase.v1beta1.RepeatRequest.getDefaultInstance(); - } - - @java.lang.Override - public com.google.showcase.v1beta1.RepeatRequest build() { - com.google.showcase.v1beta1.RepeatRequest result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.showcase.v1beta1.RepeatRequest buildPartial() { - com.google.showcase.v1beta1.RepeatRequest result = new com.google.showcase.v1beta1.RepeatRequest(this); - int from_bitField0_ = bitField0_; - int to_bitField0_ = 0; - result.name_ = name_; - if (infoBuilder_ == null) { - result.info_ = info_; - } else { - result.info_ = infoBuilder_.build(); - } - result.serverVerify_ = serverVerify_; - if (((from_bitField0_ & 0x00000001) != 0)) { - to_bitField0_ |= 0x00000001; - } - result.intendedBindingUri_ = intendedBindingUri_; - result.fInt32_ = fInt32_; - result.fInt64_ = fInt64_; - result.fDouble_ = fDouble_; - if (((from_bitField0_ & 0x00000002) != 0)) { - result.pInt32_ = pInt32_; - to_bitField0_ |= 0x00000002; - } - if (((from_bitField0_ & 0x00000004) != 0)) { - result.pInt64_ = pInt64_; - to_bitField0_ |= 0x00000004; - } - if (((from_bitField0_ & 0x00000008) != 0)) { - result.pDouble_ = pDouble_; - to_bitField0_ |= 0x00000008; - } - result.bitField0_ = to_bitField0_; - 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.showcase.v1beta1.RepeatRequest) { - return mergeFrom((com.google.showcase.v1beta1.RepeatRequest)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.showcase.v1beta1.RepeatRequest other) { - if (other == com.google.showcase.v1beta1.RepeatRequest.getDefaultInstance()) return this; - if (!other.getName().isEmpty()) { - name_ = other.name_; - onChanged(); - } - if (other.hasInfo()) { - mergeInfo(other.getInfo()); - } - if (other.getServerVerify() != false) { - setServerVerify(other.getServerVerify()); - } - if (other.hasIntendedBindingUri()) { - bitField0_ |= 0x00000001; - intendedBindingUri_ = other.intendedBindingUri_; - onChanged(); - } - if (other.getFInt32() != 0) { - setFInt32(other.getFInt32()); - } - if (other.getFInt64() != 0L) { - setFInt64(other.getFInt64()); - } - if (other.getFDouble() != 0D) { - setFDouble(other.getFDouble()); - } - if (other.hasPInt32()) { - setPInt32(other.getPInt32()); - } - if (other.hasPInt64()) { - setPInt64(other.getPInt64()); - } - if (other.hasPDouble()) { - setPDouble(other.getPDouble()); - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - com.google.showcase.v1beta1.RepeatRequest parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (com.google.showcase.v1beta1.RepeatRequest) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - private int bitField0_; - - private java.lang.Object name_ = ""; - /** - * string name = 1; - * @return The name. - */ - public java.lang.String getName() { - java.lang.Object ref = name_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - name_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * 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; - } - } - /** - * string name = 1; - * @param value The name to set. - * @return This builder for chaining. - */ - public Builder setName( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - name_ = value; - onChanged(); - return this; - } - /** - * string name = 1; - * @return This builder for chaining. - */ - public Builder clearName() { - - name_ = getDefaultInstance().getName(); - onChanged(); - return this; - } - /** - * string name = 1; - * @param value The bytes for name to set. - * @return This builder for chaining. - */ - public Builder setNameBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - name_ = value; - onChanged(); - return this; - } - - private com.google.showcase.v1beta1.ComplianceData info_; - private com.google.protobuf.SingleFieldBuilderV3< - com.google.showcase.v1beta1.ComplianceData, com.google.showcase.v1beta1.ComplianceData.Builder, com.google.showcase.v1beta1.ComplianceDataOrBuilder> infoBuilder_; - /** - * .google.showcase.v1beta1.ComplianceData info = 2; - * @return Whether the info field is set. - */ - public boolean hasInfo() { - return infoBuilder_ != null || info_ != null; - } - /** - * .google.showcase.v1beta1.ComplianceData info = 2; - * @return The info. - */ - public com.google.showcase.v1beta1.ComplianceData getInfo() { - if (infoBuilder_ == null) { - return info_ == null ? com.google.showcase.v1beta1.ComplianceData.getDefaultInstance() : info_; - } else { - return infoBuilder_.getMessage(); - } - } - /** - * .google.showcase.v1beta1.ComplianceData info = 2; - */ - public Builder setInfo(com.google.showcase.v1beta1.ComplianceData value) { - if (infoBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - info_ = value; - onChanged(); - } else { - infoBuilder_.setMessage(value); - } - - return this; - } - /** - * .google.showcase.v1beta1.ComplianceData info = 2; - */ - public Builder setInfo( - com.google.showcase.v1beta1.ComplianceData.Builder builderForValue) { - if (infoBuilder_ == null) { - info_ = builderForValue.build(); - onChanged(); - } else { - infoBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - * .google.showcase.v1beta1.ComplianceData info = 2; - */ - public Builder mergeInfo(com.google.showcase.v1beta1.ComplianceData value) { - if (infoBuilder_ == null) { - if (info_ != null) { - info_ = - com.google.showcase.v1beta1.ComplianceData.newBuilder(info_).mergeFrom(value).buildPartial(); - } else { - info_ = value; - } - onChanged(); - } else { - infoBuilder_.mergeFrom(value); - } - - return this; - } - /** - * .google.showcase.v1beta1.ComplianceData info = 2; - */ - public Builder clearInfo() { - if (infoBuilder_ == null) { - info_ = null; - onChanged(); - } else { - info_ = null; - infoBuilder_ = null; - } - - return this; - } - /** - * .google.showcase.v1beta1.ComplianceData info = 2; - */ - public com.google.showcase.v1beta1.ComplianceData.Builder getInfoBuilder() { - - onChanged(); - return getInfoFieldBuilder().getBuilder(); - } - /** - * .google.showcase.v1beta1.ComplianceData info = 2; - */ - public com.google.showcase.v1beta1.ComplianceDataOrBuilder getInfoOrBuilder() { - if (infoBuilder_ != null) { - return infoBuilder_.getMessageOrBuilder(); - } else { - return info_ == null ? - com.google.showcase.v1beta1.ComplianceData.getDefaultInstance() : info_; - } - } - /** - * .google.showcase.v1beta1.ComplianceData info = 2; - */ - private com.google.protobuf.SingleFieldBuilderV3< - com.google.showcase.v1beta1.ComplianceData, com.google.showcase.v1beta1.ComplianceData.Builder, com.google.showcase.v1beta1.ComplianceDataOrBuilder> - getInfoFieldBuilder() { - if (infoBuilder_ == null) { - infoBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - com.google.showcase.v1beta1.ComplianceData, com.google.showcase.v1beta1.ComplianceData.Builder, com.google.showcase.v1beta1.ComplianceDataOrBuilder>( - getInfo(), - getParentForChildren(), - isClean()); - info_ = null; - } - return infoBuilder_; - } - - private boolean serverVerify_ ; - /** - *
        -     * If true, the server will verify that the received request matches
        -     * the request with the same name in the compliance test suite.
        -     * 
        - * - * bool server_verify = 3; - * @return The serverVerify. - */ - @java.lang.Override - public boolean getServerVerify() { - return serverVerify_; - } - /** - *
        -     * If true, the server will verify that the received request matches
        -     * the request with the same name in the compliance test suite.
        -     * 
        - * - * bool server_verify = 3; - * @param value The serverVerify to set. - * @return This builder for chaining. - */ - public Builder setServerVerify(boolean value) { - - serverVerify_ = value; - onChanged(); - return this; - } - /** - *
        -     * If true, the server will verify that the received request matches
        -     * the request with the same name in the compliance test suite.
        -     * 
        - * - * bool server_verify = 3; - * @return This builder for chaining. - */ - public Builder clearServerVerify() { - - serverVerify_ = false; - onChanged(); - return this; - } - - private java.lang.Object intendedBindingUri_ = ""; - /** - *
        -     * The URI template this request is expected to be bound to server-side.
        -     * 
        - * - * optional string intended_binding_uri = 10; - * @return Whether the intendedBindingUri field is set. - */ - public boolean hasIntendedBindingUri() { - return ((bitField0_ & 0x00000001) != 0); - } - /** - *
        -     * The URI template this request is expected to be bound to server-side.
        -     * 
        - * - * optional string intended_binding_uri = 10; - * @return The intendedBindingUri. - */ - public java.lang.String getIntendedBindingUri() { - java.lang.Object ref = intendedBindingUri_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - intendedBindingUri_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - *
        -     * The URI template this request is expected to be bound to server-side.
        -     * 
        - * - * optional string intended_binding_uri = 10; - * @return The bytes for intendedBindingUri. - */ - public com.google.protobuf.ByteString - getIntendedBindingUriBytes() { - java.lang.Object ref = intendedBindingUri_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - intendedBindingUri_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - *
        -     * The URI template this request is expected to be bound to server-side.
        -     * 
        - * - * optional string intended_binding_uri = 10; - * @param value The intendedBindingUri to set. - * @return This builder for chaining. - */ - public Builder setIntendedBindingUri( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - bitField0_ |= 0x00000001; - intendedBindingUri_ = value; - onChanged(); - return this; - } - /** - *
        -     * The URI template this request is expected to be bound to server-side.
        -     * 
        - * - * optional string intended_binding_uri = 10; - * @return This builder for chaining. - */ - public Builder clearIntendedBindingUri() { - bitField0_ = (bitField0_ & ~0x00000001); - intendedBindingUri_ = getDefaultInstance().getIntendedBindingUri(); - onChanged(); - return this; - } - /** - *
        -     * The URI template this request is expected to be bound to server-side.
        -     * 
        - * - * optional string intended_binding_uri = 10; - * @param value The bytes for intendedBindingUri to set. - * @return This builder for chaining. - */ - public Builder setIntendedBindingUriBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - bitField0_ |= 0x00000001; - intendedBindingUri_ = value; - onChanged(); - return this; - } - - private int fInt32_ ; - /** - *
        -     * Some top level fields, to test that these are encoded correctly
        -     * in query params.
        -     * 
        - * - * int32 f_int32 = 4; - * @return The fInt32. - */ - @java.lang.Override - public int getFInt32() { - return fInt32_; - } - /** - *
        -     * Some top level fields, to test that these are encoded correctly
        -     * in query params.
        -     * 
        - * - * int32 f_int32 = 4; - * @param value The fInt32 to set. - * @return This builder for chaining. - */ - public Builder setFInt32(int value) { - - fInt32_ = value; - onChanged(); - return this; - } - /** - *
        -     * Some top level fields, to test that these are encoded correctly
        -     * in query params.
        -     * 
        - * - * int32 f_int32 = 4; - * @return This builder for chaining. - */ - public Builder clearFInt32() { - - fInt32_ = 0; - onChanged(); - return this; - } - - private long fInt64_ ; - /** - * int64 f_int64 = 5; - * @return The fInt64. - */ - @java.lang.Override - public long getFInt64() { - return fInt64_; - } - /** - * int64 f_int64 = 5; - * @param value The fInt64 to set. - * @return This builder for chaining. - */ - public Builder setFInt64(long value) { - - fInt64_ = value; - onChanged(); - return this; - } - /** - * int64 f_int64 = 5; - * @return This builder for chaining. - */ - public Builder clearFInt64() { - - fInt64_ = 0L; - onChanged(); - return this; - } - - private double fDouble_ ; - /** - * double f_double = 6; - * @return The fDouble. - */ - @java.lang.Override - public double getFDouble() { - return fDouble_; - } - /** - * double f_double = 6; - * @param value The fDouble to set. - * @return This builder for chaining. - */ - public Builder setFDouble(double value) { - - fDouble_ = value; - onChanged(); - return this; - } - /** - * double f_double = 6; - * @return This builder for chaining. - */ - public Builder clearFDouble() { - - fDouble_ = 0D; - onChanged(); - return this; - } - - private int pInt32_ ; - /** - * optional int32 p_int32 = 7; - * @return Whether the pInt32 field is set. - */ - @java.lang.Override - public boolean hasPInt32() { - return ((bitField0_ & 0x00000002) != 0); - } - /** - * optional int32 p_int32 = 7; - * @return The pInt32. - */ - @java.lang.Override - public int getPInt32() { - return pInt32_; - } - /** - * optional int32 p_int32 = 7; - * @param value The pInt32 to set. - * @return This builder for chaining. - */ - public Builder setPInt32(int value) { - bitField0_ |= 0x00000002; - pInt32_ = value; - onChanged(); - return this; - } - /** - * optional int32 p_int32 = 7; - * @return This builder for chaining. - */ - public Builder clearPInt32() { - bitField0_ = (bitField0_ & ~0x00000002); - pInt32_ = 0; - onChanged(); - return this; - } - - private long pInt64_ ; - /** - * optional int64 p_int64 = 8; - * @return Whether the pInt64 field is set. - */ - @java.lang.Override - public boolean hasPInt64() { - return ((bitField0_ & 0x00000004) != 0); - } - /** - * optional int64 p_int64 = 8; - * @return The pInt64. - */ - @java.lang.Override - public long getPInt64() { - return pInt64_; - } - /** - * optional int64 p_int64 = 8; - * @param value The pInt64 to set. - * @return This builder for chaining. - */ - public Builder setPInt64(long value) { - bitField0_ |= 0x00000004; - pInt64_ = value; - onChanged(); - return this; - } - /** - * optional int64 p_int64 = 8; - * @return This builder for chaining. - */ - public Builder clearPInt64() { - bitField0_ = (bitField0_ & ~0x00000004); - pInt64_ = 0L; - onChanged(); - return this; - } - - private double pDouble_ ; - /** - * optional double p_double = 9; - * @return Whether the pDouble field is set. - */ - @java.lang.Override - public boolean hasPDouble() { - return ((bitField0_ & 0x00000008) != 0); - } - /** - * optional double p_double = 9; - * @return The pDouble. - */ - @java.lang.Override - public double getPDouble() { - return pDouble_; - } - /** - * optional double p_double = 9; - * @param value The pDouble to set. - * @return This builder for chaining. - */ - public Builder setPDouble(double value) { - bitField0_ |= 0x00000008; - pDouble_ = value; - onChanged(); - return this; - } - /** - * optional double p_double = 9; - * @return This builder for chaining. - */ - public Builder clearPDouble() { - bitField0_ = (bitField0_ & ~0x00000008); - pDouble_ = 0D; - onChanged(); - return this; - } - @java.lang.Override - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - - // @@protoc_insertion_point(builder_scope:google.showcase.v1beta1.RepeatRequest) - } - - // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.RepeatRequest) - private static final com.google.showcase.v1beta1.RepeatRequest DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new com.google.showcase.v1beta1.RepeatRequest(); - } - - public static com.google.showcase.v1beta1.RepeatRequest getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public RepeatRequest parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new RepeatRequest(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public com.google.showcase.v1beta1.RepeatRequest getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/RepeatRequestOrBuilder.java b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/RepeatRequestOrBuilder.java deleted file mode 100644 index a95f03f773..0000000000 --- a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/RepeatRequestOrBuilder.java +++ /dev/null @@ -1,132 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: schema/google/showcase/v1beta1/compliance.proto - -package com.google.showcase.v1beta1; - -public interface RepeatRequestOrBuilder extends - // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.RepeatRequest) - com.google.protobuf.MessageOrBuilder { - - /** - * string name = 1; - * @return The name. - */ - java.lang.String getName(); - /** - * string name = 1; - * @return The bytes for name. - */ - com.google.protobuf.ByteString - getNameBytes(); - - /** - * .google.showcase.v1beta1.ComplianceData info = 2; - * @return Whether the info field is set. - */ - boolean hasInfo(); - /** - * .google.showcase.v1beta1.ComplianceData info = 2; - * @return The info. - */ - com.google.showcase.v1beta1.ComplianceData getInfo(); - /** - * .google.showcase.v1beta1.ComplianceData info = 2; - */ - com.google.showcase.v1beta1.ComplianceDataOrBuilder getInfoOrBuilder(); - - /** - *
        -   * If true, the server will verify that the received request matches
        -   * the request with the same name in the compliance test suite.
        -   * 
        - * - * bool server_verify = 3; - * @return The serverVerify. - */ - boolean getServerVerify(); - - /** - *
        -   * The URI template this request is expected to be bound to server-side.
        -   * 
        - * - * optional string intended_binding_uri = 10; - * @return Whether the intendedBindingUri field is set. - */ - boolean hasIntendedBindingUri(); - /** - *
        -   * The URI template this request is expected to be bound to server-side.
        -   * 
        - * - * optional string intended_binding_uri = 10; - * @return The intendedBindingUri. - */ - java.lang.String getIntendedBindingUri(); - /** - *
        -   * The URI template this request is expected to be bound to server-side.
        -   * 
        - * - * optional string intended_binding_uri = 10; - * @return The bytes for intendedBindingUri. - */ - com.google.protobuf.ByteString - getIntendedBindingUriBytes(); - - /** - *
        -   * Some top level fields, to test that these are encoded correctly
        -   * in query params.
        -   * 
        - * - * int32 f_int32 = 4; - * @return The fInt32. - */ - int getFInt32(); - - /** - * int64 f_int64 = 5; - * @return The fInt64. - */ - long getFInt64(); - - /** - * double f_double = 6; - * @return The fDouble. - */ - double getFDouble(); - - /** - * optional int32 p_int32 = 7; - * @return Whether the pInt32 field is set. - */ - boolean hasPInt32(); - /** - * optional int32 p_int32 = 7; - * @return The pInt32. - */ - int getPInt32(); - - /** - * optional int64 p_int64 = 8; - * @return Whether the pInt64 field is set. - */ - boolean hasPInt64(); - /** - * optional int64 p_int64 = 8; - * @return The pInt64. - */ - long getPInt64(); - - /** - * optional double p_double = 9; - * @return Whether the pDouble field is set. - */ - boolean hasPDouble(); - /** - * optional double p_double = 9; - * @return The pDouble. - */ - double getPDouble(); -} diff --git a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/RepeatResponse.java b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/RepeatResponse.java deleted file mode 100644 index 48b1ad96ac..0000000000 --- a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/RepeatResponse.java +++ /dev/null @@ -1,775 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: schema/google/showcase/v1beta1/compliance.proto - -package com.google.showcase.v1beta1; - -/** - * Protobuf type {@code google.showcase.v1beta1.RepeatResponse} - */ -public final class RepeatResponse extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.RepeatResponse) - RepeatResponseOrBuilder { -private static final long serialVersionUID = 0L; - // Use RepeatResponse.newBuilder() to construct. - private RepeatResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private RepeatResponse() { - bindingUri_ = ""; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new RepeatResponse(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private RepeatResponse( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: { - com.google.showcase.v1beta1.RepeatRequest.Builder subBuilder = null; - if (request_ != null) { - subBuilder = request_.toBuilder(); - } - request_ = input.readMessage(com.google.showcase.v1beta1.RepeatRequest.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(request_); - request_ = subBuilder.buildPartial(); - } - - break; - } - case 18: { - java.lang.String s = input.readStringRequireUtf8(); - - bindingUri_ = s; - break; - } - default: { - if (!parseUnknownField( - input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException( - e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.google.showcase.v1beta1.ComplianceOuterClass.internal_static_google_showcase_v1beta1_RepeatResponse_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.showcase.v1beta1.ComplianceOuterClass.internal_static_google_showcase_v1beta1_RepeatResponse_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.showcase.v1beta1.RepeatResponse.class, com.google.showcase.v1beta1.RepeatResponse.Builder.class); - } - - public static final int REQUEST_FIELD_NUMBER = 1; - private com.google.showcase.v1beta1.RepeatRequest request_; - /** - * .google.showcase.v1beta1.RepeatRequest request = 1; - * @return Whether the request field is set. - */ - @java.lang.Override - public boolean hasRequest() { - return request_ != null; - } - /** - * .google.showcase.v1beta1.RepeatRequest request = 1; - * @return The request. - */ - @java.lang.Override - public com.google.showcase.v1beta1.RepeatRequest getRequest() { - return request_ == null ? com.google.showcase.v1beta1.RepeatRequest.getDefaultInstance() : request_; - } - /** - * .google.showcase.v1beta1.RepeatRequest request = 1; - */ - @java.lang.Override - public com.google.showcase.v1beta1.RepeatRequestOrBuilder getRequestOrBuilder() { - return getRequest(); - } - - public static final int BINDING_URI_FIELD_NUMBER = 2; - private volatile java.lang.Object bindingUri_; - /** - *
        -   * The URI template the request was bound to server-side.
        -   * 
        - * - * string binding_uri = 2; - * @return The bindingUri. - */ - @java.lang.Override - public java.lang.String getBindingUri() { - java.lang.Object ref = bindingUri_; - 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(); - bindingUri_ = s; - return s; - } - } - /** - *
        -   * The URI template the request was bound to server-side.
        -   * 
        - * - * string binding_uri = 2; - * @return The bytes for bindingUri. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getBindingUriBytes() { - java.lang.Object ref = bindingUri_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - bindingUri_ = 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 (request_ != null) { - output.writeMessage(1, getRequest()); - } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(bindingUri_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 2, bindingUri_); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (request_ != null) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(1, getRequest()); - } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(bindingUri_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, bindingUri_); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof com.google.showcase.v1beta1.RepeatResponse)) { - return super.equals(obj); - } - com.google.showcase.v1beta1.RepeatResponse other = (com.google.showcase.v1beta1.RepeatResponse) obj; - - if (hasRequest() != other.hasRequest()) return false; - if (hasRequest()) { - if (!getRequest() - .equals(other.getRequest())) return false; - } - if (!getBindingUri() - .equals(other.getBindingUri())) return false; - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - if (hasRequest()) { - hash = (37 * hash) + REQUEST_FIELD_NUMBER; - hash = (53 * hash) + getRequest().hashCode(); - } - hash = (37 * hash) + BINDING_URI_FIELD_NUMBER; - hash = (53 * hash) + getBindingUri().hashCode(); - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.showcase.v1beta1.RepeatResponse parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.showcase.v1beta1.RepeatResponse parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.showcase.v1beta1.RepeatResponse parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.showcase.v1beta1.RepeatResponse 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.showcase.v1beta1.RepeatResponse parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.showcase.v1beta1.RepeatResponse parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.showcase.v1beta1.RepeatResponse parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static com.google.showcase.v1beta1.RepeatResponse 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.showcase.v1beta1.RepeatResponse parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static com.google.showcase.v1beta1.RepeatResponse 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.showcase.v1beta1.RepeatResponse parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static com.google.showcase.v1beta1.RepeatResponse 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.showcase.v1beta1.RepeatResponse prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - @java.lang.Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - * Protobuf type {@code google.showcase.v1beta1.RepeatResponse} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.RepeatResponse) - com.google.showcase.v1beta1.RepeatResponseOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.google.showcase.v1beta1.ComplianceOuterClass.internal_static_google_showcase_v1beta1_RepeatResponse_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.showcase.v1beta1.ComplianceOuterClass.internal_static_google_showcase_v1beta1_RepeatResponse_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.showcase.v1beta1.RepeatResponse.class, com.google.showcase.v1beta1.RepeatResponse.Builder.class); - } - - // Construct using com.google.showcase.v1beta1.RepeatResponse.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { - } - } - @java.lang.Override - public Builder clear() { - super.clear(); - if (requestBuilder_ == null) { - request_ = null; - } else { - request_ = null; - requestBuilder_ = null; - } - bindingUri_ = ""; - - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return com.google.showcase.v1beta1.ComplianceOuterClass.internal_static_google_showcase_v1beta1_RepeatResponse_descriptor; - } - - @java.lang.Override - public com.google.showcase.v1beta1.RepeatResponse getDefaultInstanceForType() { - return com.google.showcase.v1beta1.RepeatResponse.getDefaultInstance(); - } - - @java.lang.Override - public com.google.showcase.v1beta1.RepeatResponse build() { - com.google.showcase.v1beta1.RepeatResponse result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.showcase.v1beta1.RepeatResponse buildPartial() { - com.google.showcase.v1beta1.RepeatResponse result = new com.google.showcase.v1beta1.RepeatResponse(this); - if (requestBuilder_ == null) { - result.request_ = request_; - } else { - result.request_ = requestBuilder_.build(); - } - result.bindingUri_ = bindingUri_; - 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.showcase.v1beta1.RepeatResponse) { - return mergeFrom((com.google.showcase.v1beta1.RepeatResponse)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.showcase.v1beta1.RepeatResponse other) { - if (other == com.google.showcase.v1beta1.RepeatResponse.getDefaultInstance()) return this; - if (other.hasRequest()) { - mergeRequest(other.getRequest()); - } - if (!other.getBindingUri().isEmpty()) { - bindingUri_ = other.bindingUri_; - onChanged(); - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - com.google.showcase.v1beta1.RepeatResponse parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (com.google.showcase.v1beta1.RepeatResponse) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private com.google.showcase.v1beta1.RepeatRequest request_; - private com.google.protobuf.SingleFieldBuilderV3< - com.google.showcase.v1beta1.RepeatRequest, com.google.showcase.v1beta1.RepeatRequest.Builder, com.google.showcase.v1beta1.RepeatRequestOrBuilder> requestBuilder_; - /** - * .google.showcase.v1beta1.RepeatRequest request = 1; - * @return Whether the request field is set. - */ - public boolean hasRequest() { - return requestBuilder_ != null || request_ != null; - } - /** - * .google.showcase.v1beta1.RepeatRequest request = 1; - * @return The request. - */ - public com.google.showcase.v1beta1.RepeatRequest getRequest() { - if (requestBuilder_ == null) { - return request_ == null ? com.google.showcase.v1beta1.RepeatRequest.getDefaultInstance() : request_; - } else { - return requestBuilder_.getMessage(); - } - } - /** - * .google.showcase.v1beta1.RepeatRequest request = 1; - */ - public Builder setRequest(com.google.showcase.v1beta1.RepeatRequest value) { - if (requestBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - request_ = value; - onChanged(); - } else { - requestBuilder_.setMessage(value); - } - - return this; - } - /** - * .google.showcase.v1beta1.RepeatRequest request = 1; - */ - public Builder setRequest( - com.google.showcase.v1beta1.RepeatRequest.Builder builderForValue) { - if (requestBuilder_ == null) { - request_ = builderForValue.build(); - onChanged(); - } else { - requestBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - * .google.showcase.v1beta1.RepeatRequest request = 1; - */ - public Builder mergeRequest(com.google.showcase.v1beta1.RepeatRequest value) { - if (requestBuilder_ == null) { - if (request_ != null) { - request_ = - com.google.showcase.v1beta1.RepeatRequest.newBuilder(request_).mergeFrom(value).buildPartial(); - } else { - request_ = value; - } - onChanged(); - } else { - requestBuilder_.mergeFrom(value); - } - - return this; - } - /** - * .google.showcase.v1beta1.RepeatRequest request = 1; - */ - public Builder clearRequest() { - if (requestBuilder_ == null) { - request_ = null; - onChanged(); - } else { - request_ = null; - requestBuilder_ = null; - } - - return this; - } - /** - * .google.showcase.v1beta1.RepeatRequest request = 1; - */ - public com.google.showcase.v1beta1.RepeatRequest.Builder getRequestBuilder() { - - onChanged(); - return getRequestFieldBuilder().getBuilder(); - } - /** - * .google.showcase.v1beta1.RepeatRequest request = 1; - */ - public com.google.showcase.v1beta1.RepeatRequestOrBuilder getRequestOrBuilder() { - if (requestBuilder_ != null) { - return requestBuilder_.getMessageOrBuilder(); - } else { - return request_ == null ? - com.google.showcase.v1beta1.RepeatRequest.getDefaultInstance() : request_; - } - } - /** - * .google.showcase.v1beta1.RepeatRequest request = 1; - */ - private com.google.protobuf.SingleFieldBuilderV3< - com.google.showcase.v1beta1.RepeatRequest, com.google.showcase.v1beta1.RepeatRequest.Builder, com.google.showcase.v1beta1.RepeatRequestOrBuilder> - getRequestFieldBuilder() { - if (requestBuilder_ == null) { - requestBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - com.google.showcase.v1beta1.RepeatRequest, com.google.showcase.v1beta1.RepeatRequest.Builder, com.google.showcase.v1beta1.RepeatRequestOrBuilder>( - getRequest(), - getParentForChildren(), - isClean()); - request_ = null; - } - return requestBuilder_; - } - - private java.lang.Object bindingUri_ = ""; - /** - *
        -     * The URI template the request was bound to server-side.
        -     * 
        - * - * string binding_uri = 2; - * @return The bindingUri. - */ - public java.lang.String getBindingUri() { - java.lang.Object ref = bindingUri_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - bindingUri_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - *
        -     * The URI template the request was bound to server-side.
        -     * 
        - * - * string binding_uri = 2; - * @return The bytes for bindingUri. - */ - public com.google.protobuf.ByteString - getBindingUriBytes() { - java.lang.Object ref = bindingUri_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - bindingUri_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - *
        -     * The URI template the request was bound to server-side.
        -     * 
        - * - * string binding_uri = 2; - * @param value The bindingUri to set. - * @return This builder for chaining. - */ - public Builder setBindingUri( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - bindingUri_ = value; - onChanged(); - return this; - } - /** - *
        -     * The URI template the request was bound to server-side.
        -     * 
        - * - * string binding_uri = 2; - * @return This builder for chaining. - */ - public Builder clearBindingUri() { - - bindingUri_ = getDefaultInstance().getBindingUri(); - onChanged(); - return this; - } - /** - *
        -     * The URI template the request was bound to server-side.
        -     * 
        - * - * string binding_uri = 2; - * @param value The bytes for bindingUri to set. - * @return This builder for chaining. - */ - public Builder setBindingUriBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - bindingUri_ = value; - onChanged(); - return this; - } - @java.lang.Override - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - - // @@protoc_insertion_point(builder_scope:google.showcase.v1beta1.RepeatResponse) - } - - // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.RepeatResponse) - private static final com.google.showcase.v1beta1.RepeatResponse DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new com.google.showcase.v1beta1.RepeatResponse(); - } - - public static com.google.showcase.v1beta1.RepeatResponse getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public RepeatResponse parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new RepeatResponse(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public com.google.showcase.v1beta1.RepeatResponse getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/RepeatResponseOrBuilder.java b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/RepeatResponseOrBuilder.java deleted file mode 100644 index 9ddd20a4b4..0000000000 --- a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/RepeatResponseOrBuilder.java +++ /dev/null @@ -1,44 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: schema/google/showcase/v1beta1/compliance.proto - -package com.google.showcase.v1beta1; - -public interface RepeatResponseOrBuilder extends - // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.RepeatResponse) - com.google.protobuf.MessageOrBuilder { - - /** - * .google.showcase.v1beta1.RepeatRequest request = 1; - * @return Whether the request field is set. - */ - boolean hasRequest(); - /** - * .google.showcase.v1beta1.RepeatRequest request = 1; - * @return The request. - */ - com.google.showcase.v1beta1.RepeatRequest getRequest(); - /** - * .google.showcase.v1beta1.RepeatRequest request = 1; - */ - com.google.showcase.v1beta1.RepeatRequestOrBuilder getRequestOrBuilder(); - - /** - *
        -   * The URI template the request was bound to server-side.
        -   * 
        - * - * string binding_uri = 2; - * @return The bindingUri. - */ - java.lang.String getBindingUri(); - /** - *
        -   * The URI template the request was bound to server-side.
        -   * 
        - * - * string binding_uri = 2; - * @return The bytes for bindingUri. - */ - com.google.protobuf.ByteString - getBindingUriBytes(); -} diff --git a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ReportSessionRequest.java b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ReportSessionRequest.java deleted file mode 100644 index 397a926c8d..0000000000 --- a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ReportSessionRequest.java +++ /dev/null @@ -1,595 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: schema/google/showcase/v1beta1/testing.proto - -package com.google.showcase.v1beta1; - -/** - *
        - * Request message for reporting on a session.
        - * 
        - * - * Protobuf type {@code google.showcase.v1beta1.ReportSessionRequest} - */ -public final class ReportSessionRequest extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.ReportSessionRequest) - ReportSessionRequestOrBuilder { -private static final long serialVersionUID = 0L; - // Use ReportSessionRequest.newBuilder() to construct. - private ReportSessionRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private ReportSessionRequest() { - name_ = ""; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new ReportSessionRequest(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private ReportSessionRequest( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: { - java.lang.String s = input.readStringRequireUtf8(); - - name_ = s; - break; - } - default: { - if (!parseUnknownField( - input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException( - e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.google.showcase.v1beta1.TestingOuterClass.internal_static_google_showcase_v1beta1_ReportSessionRequest_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.showcase.v1beta1.TestingOuterClass.internal_static_google_showcase_v1beta1_ReportSessionRequest_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.showcase.v1beta1.ReportSessionRequest.class, com.google.showcase.v1beta1.ReportSessionRequest.Builder.class); - } - - public static final int NAME_FIELD_NUMBER = 1; - private volatile java.lang.Object name_; - /** - *
        -   * The session to be reported on.
        -   * 
        - * - * string name = 1 [(.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; - } - } - /** - *
        -   * The session to be reported on.
        -   * 
        - * - * string name = 1 [(.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_); - } - unknownFields.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 += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof com.google.showcase.v1beta1.ReportSessionRequest)) { - return super.equals(obj); - } - com.google.showcase.v1beta1.ReportSessionRequest other = (com.google.showcase.v1beta1.ReportSessionRequest) obj; - - if (!getName() - .equals(other.getName())) return false; - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - hash = (37 * hash) + NAME_FIELD_NUMBER; - hash = (53 * hash) + getName().hashCode(); - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.showcase.v1beta1.ReportSessionRequest parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.showcase.v1beta1.ReportSessionRequest parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.showcase.v1beta1.ReportSessionRequest parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.showcase.v1beta1.ReportSessionRequest 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.showcase.v1beta1.ReportSessionRequest parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.showcase.v1beta1.ReportSessionRequest parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.showcase.v1beta1.ReportSessionRequest parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static com.google.showcase.v1beta1.ReportSessionRequest 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.showcase.v1beta1.ReportSessionRequest parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static com.google.showcase.v1beta1.ReportSessionRequest 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.showcase.v1beta1.ReportSessionRequest parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static com.google.showcase.v1beta1.ReportSessionRequest 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.showcase.v1beta1.ReportSessionRequest prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - @java.lang.Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - *
        -   * Request message for reporting on a session.
        -   * 
        - * - * Protobuf type {@code google.showcase.v1beta1.ReportSessionRequest} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.ReportSessionRequest) - com.google.showcase.v1beta1.ReportSessionRequestOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.google.showcase.v1beta1.TestingOuterClass.internal_static_google_showcase_v1beta1_ReportSessionRequest_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.showcase.v1beta1.TestingOuterClass.internal_static_google_showcase_v1beta1_ReportSessionRequest_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.showcase.v1beta1.ReportSessionRequest.class, com.google.showcase.v1beta1.ReportSessionRequest.Builder.class); - } - - // Construct using com.google.showcase.v1beta1.ReportSessionRequest.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { - } - } - @java.lang.Override - public Builder clear() { - super.clear(); - name_ = ""; - - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return com.google.showcase.v1beta1.TestingOuterClass.internal_static_google_showcase_v1beta1_ReportSessionRequest_descriptor; - } - - @java.lang.Override - public com.google.showcase.v1beta1.ReportSessionRequest getDefaultInstanceForType() { - return com.google.showcase.v1beta1.ReportSessionRequest.getDefaultInstance(); - } - - @java.lang.Override - public com.google.showcase.v1beta1.ReportSessionRequest build() { - com.google.showcase.v1beta1.ReportSessionRequest result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.showcase.v1beta1.ReportSessionRequest buildPartial() { - com.google.showcase.v1beta1.ReportSessionRequest result = new com.google.showcase.v1beta1.ReportSessionRequest(this); - result.name_ = name_; - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.setField(field, value); - } - @java.lang.Override - public Builder clearField( - com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - @java.lang.Override - public Builder clearOneof( - com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.addRepeatedField(field, value); - } - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof com.google.showcase.v1beta1.ReportSessionRequest) { - return mergeFrom((com.google.showcase.v1beta1.ReportSessionRequest)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.showcase.v1beta1.ReportSessionRequest other) { - if (other == com.google.showcase.v1beta1.ReportSessionRequest.getDefaultInstance()) return this; - if (!other.getName().isEmpty()) { - name_ = other.name_; - onChanged(); - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - com.google.showcase.v1beta1.ReportSessionRequest parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (com.google.showcase.v1beta1.ReportSessionRequest) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private java.lang.Object name_ = ""; - /** - *
        -     * The session to be reported on.
        -     * 
        - * - * string name = 1 [(.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; - } - } - /** - *
        -     * The session to be reported on.
        -     * 
        - * - * string name = 1 [(.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; - } - } - /** - *
        -     * The session to be reported on.
        -     * 
        - * - * string name = 1 [(.google.api.resource_reference) = { ... } - * @param value The name to set. - * @return This builder for chaining. - */ - public Builder setName( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - name_ = value; - onChanged(); - return this; - } - /** - *
        -     * The session to be reported on.
        -     * 
        - * - * string name = 1 [(.google.api.resource_reference) = { ... } - * @return This builder for chaining. - */ - public Builder clearName() { - - name_ = getDefaultInstance().getName(); - onChanged(); - return this; - } - /** - *
        -     * The session to be reported on.
        -     * 
        - * - * string name = 1 [(.google.api.resource_reference) = { ... } - * @param value The bytes for name to set. - * @return This builder for chaining. - */ - public Builder setNameBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - name_ = value; - onChanged(); - return this; - } - @java.lang.Override - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - - // @@protoc_insertion_point(builder_scope:google.showcase.v1beta1.ReportSessionRequest) - } - - // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.ReportSessionRequest) - private static final com.google.showcase.v1beta1.ReportSessionRequest DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new com.google.showcase.v1beta1.ReportSessionRequest(); - } - - public static com.google.showcase.v1beta1.ReportSessionRequest getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public ReportSessionRequest parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new ReportSessionRequest(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public com.google.showcase.v1beta1.ReportSessionRequest getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ReportSessionRequestOrBuilder.java b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ReportSessionRequestOrBuilder.java deleted file mode 100644 index c27541bfbb..0000000000 --- a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ReportSessionRequestOrBuilder.java +++ /dev/null @@ -1,29 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: schema/google/showcase/v1beta1/testing.proto - -package com.google.showcase.v1beta1; - -public interface ReportSessionRequestOrBuilder extends - // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.ReportSessionRequest) - com.google.protobuf.MessageOrBuilder { - - /** - *
        -   * The session to be reported on.
        -   * 
        - * - * string name = 1 [(.google.api.resource_reference) = { ... } - * @return The name. - */ - java.lang.String getName(); - /** - *
        -   * The session to be reported on.
        -   * 
        - * - * string name = 1 [(.google.api.resource_reference) = { ... } - * @return The bytes for name. - */ - com.google.protobuf.ByteString - getNameBytes(); -} diff --git a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ReportSessionResponse.java b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ReportSessionResponse.java deleted file mode 100644 index 9b83e8a5d9..0000000000 --- a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ReportSessionResponse.java +++ /dev/null @@ -1,1150 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: schema/google/showcase/v1beta1/testing.proto - -package com.google.showcase.v1beta1; - -/** - *
        - * Response message for reporting on a session.
        - * 
        - * - * Protobuf type {@code google.showcase.v1beta1.ReportSessionResponse} - */ -public final class ReportSessionResponse extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.ReportSessionResponse) - ReportSessionResponseOrBuilder { -private static final long serialVersionUID = 0L; - // Use ReportSessionResponse.newBuilder() to construct. - private ReportSessionResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private ReportSessionResponse() { - result_ = 0; - testRuns_ = java.util.Collections.emptyList(); - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new ReportSessionResponse(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private ReportSessionResponse( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - int mutable_bitField0_ = 0; - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 8: { - int rawValue = input.readEnum(); - - result_ = rawValue; - break; - } - case 18: { - if (!((mutable_bitField0_ & 0x00000001) != 0)) { - testRuns_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000001; - } - testRuns_.add( - input.readMessage(com.google.showcase.v1beta1.TestRun.parser(), extensionRegistry)); - break; - } - default: { - if (!parseUnknownField( - input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException( - e).setUnfinishedMessage(this); - } finally { - if (((mutable_bitField0_ & 0x00000001) != 0)) { - testRuns_ = java.util.Collections.unmodifiableList(testRuns_); - } - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.google.showcase.v1beta1.TestingOuterClass.internal_static_google_showcase_v1beta1_ReportSessionResponse_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.showcase.v1beta1.TestingOuterClass.internal_static_google_showcase_v1beta1_ReportSessionResponse_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.showcase.v1beta1.ReportSessionResponse.class, com.google.showcase.v1beta1.ReportSessionResponse.Builder.class); - } - - /** - *
        -   * The topline state of the report.
        -   * 
        - * - * Protobuf enum {@code google.showcase.v1beta1.ReportSessionResponse.Result} - */ - public enum Result - implements com.google.protobuf.ProtocolMessageEnum { - /** - * RESULT_UNSPECIFIED = 0; - */ - RESULT_UNSPECIFIED(0), - /** - *
        -     * The session is complete, and everything passed.
        -     * 
        - * - * PASSED = 1; - */ - PASSED(1), - /** - *
        -     * The session had an explicit failure.
        -     * 
        - * - * FAILED = 2; - */ - FAILED(2), - /** - *
        -     * The session is incomplete. This is a failure response.
        -     * 
        - * - * INCOMPLETE = 3; - */ - INCOMPLETE(3), - UNRECOGNIZED(-1), - ; - - /** - * RESULT_UNSPECIFIED = 0; - */ - public static final int RESULT_UNSPECIFIED_VALUE = 0; - /** - *
        -     * The session is complete, and everything passed.
        -     * 
        - * - * PASSED = 1; - */ - public static final int PASSED_VALUE = 1; - /** - *
        -     * The session had an explicit failure.
        -     * 
        - * - * FAILED = 2; - */ - public static final int FAILED_VALUE = 2; - /** - *
        -     * The session is incomplete. This is a failure response.
        -     * 
        - * - * INCOMPLETE = 3; - */ - public static final int INCOMPLETE_VALUE = 3; - - - public final int getNumber() { - if (this == UNRECOGNIZED) { - throw new java.lang.IllegalArgumentException( - "Can't get the number of an unknown enum value."); - } - return value; - } - - /** - * @param value The numeric wire value of the corresponding enum entry. - * @return The enum associated with the given numeric wire value. - * @deprecated Use {@link #forNumber(int)} instead. - */ - @java.lang.Deprecated - public static Result 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 Result forNumber(int value) { - switch (value) { - case 0: return RESULT_UNSPECIFIED; - case 1: return PASSED; - case 2: return FAILED; - case 3: return INCOMPLETE; - default: return null; - } - } - - public static com.google.protobuf.Internal.EnumLiteMap - internalGetValueMap() { - return internalValueMap; - } - private static final com.google.protobuf.Internal.EnumLiteMap< - Result> internalValueMap = - new com.google.protobuf.Internal.EnumLiteMap() { - public Result findValueByNumber(int number) { - return Result.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.showcase.v1beta1.ReportSessionResponse.getDescriptor().getEnumTypes().get(0); - } - - private static final Result[] VALUES = values(); - - public static Result 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 Result(int value) { - this.value = value; - } - - // @@protoc_insertion_point(enum_scope:google.showcase.v1beta1.ReportSessionResponse.Result) - } - - public static final int RESULT_FIELD_NUMBER = 1; - private int result_; - /** - *
        -   * The state of the report.
        -   * 
        - * - * .google.showcase.v1beta1.ReportSessionResponse.Result result = 1; - * @return The enum numeric value on the wire for result. - */ - @java.lang.Override public int getResultValue() { - return result_; - } - /** - *
        -   * The state of the report.
        -   * 
        - * - * .google.showcase.v1beta1.ReportSessionResponse.Result result = 1; - * @return The result. - */ - @java.lang.Override public com.google.showcase.v1beta1.ReportSessionResponse.Result getResult() { - @SuppressWarnings("deprecation") - com.google.showcase.v1beta1.ReportSessionResponse.Result result = com.google.showcase.v1beta1.ReportSessionResponse.Result.valueOf(result_); - return result == null ? com.google.showcase.v1beta1.ReportSessionResponse.Result.UNRECOGNIZED : result; - } - - public static final int TEST_RUNS_FIELD_NUMBER = 2; - private java.util.List testRuns_; - /** - *
        -   * The test runs of this session.
        -   * 
        - * - * repeated .google.showcase.v1beta1.TestRun test_runs = 2; - */ - @java.lang.Override - public java.util.List getTestRunsList() { - return testRuns_; - } - /** - *
        -   * The test runs of this session.
        -   * 
        - * - * repeated .google.showcase.v1beta1.TestRun test_runs = 2; - */ - @java.lang.Override - public java.util.List - getTestRunsOrBuilderList() { - return testRuns_; - } - /** - *
        -   * The test runs of this session.
        -   * 
        - * - * repeated .google.showcase.v1beta1.TestRun test_runs = 2; - */ - @java.lang.Override - public int getTestRunsCount() { - return testRuns_.size(); - } - /** - *
        -   * The test runs of this session.
        -   * 
        - * - * repeated .google.showcase.v1beta1.TestRun test_runs = 2; - */ - @java.lang.Override - public com.google.showcase.v1beta1.TestRun getTestRuns(int index) { - return testRuns_.get(index); - } - /** - *
        -   * The test runs of this session.
        -   * 
        - * - * repeated .google.showcase.v1beta1.TestRun test_runs = 2; - */ - @java.lang.Override - public com.google.showcase.v1beta1.TestRunOrBuilder getTestRunsOrBuilder( - int index) { - return testRuns_.get(index); - } - - private byte memoizedIsInitialized = -1; - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - if (result_ != com.google.showcase.v1beta1.ReportSessionResponse.Result.RESULT_UNSPECIFIED.getNumber()) { - output.writeEnum(1, result_); - } - for (int i = 0; i < testRuns_.size(); i++) { - output.writeMessage(2, testRuns_.get(i)); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (result_ != com.google.showcase.v1beta1.ReportSessionResponse.Result.RESULT_UNSPECIFIED.getNumber()) { - size += com.google.protobuf.CodedOutputStream - .computeEnumSize(1, result_); - } - for (int i = 0; i < testRuns_.size(); i++) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(2, testRuns_.get(i)); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof com.google.showcase.v1beta1.ReportSessionResponse)) { - return super.equals(obj); - } - com.google.showcase.v1beta1.ReportSessionResponse other = (com.google.showcase.v1beta1.ReportSessionResponse) obj; - - if (result_ != other.result_) return false; - if (!getTestRunsList() - .equals(other.getTestRunsList())) return false; - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - hash = (37 * hash) + RESULT_FIELD_NUMBER; - hash = (53 * hash) + result_; - if (getTestRunsCount() > 0) { - hash = (37 * hash) + TEST_RUNS_FIELD_NUMBER; - hash = (53 * hash) + getTestRunsList().hashCode(); - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.showcase.v1beta1.ReportSessionResponse parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.showcase.v1beta1.ReportSessionResponse parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.showcase.v1beta1.ReportSessionResponse parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.showcase.v1beta1.ReportSessionResponse 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.showcase.v1beta1.ReportSessionResponse parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.showcase.v1beta1.ReportSessionResponse parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.showcase.v1beta1.ReportSessionResponse parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static com.google.showcase.v1beta1.ReportSessionResponse 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.showcase.v1beta1.ReportSessionResponse parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static com.google.showcase.v1beta1.ReportSessionResponse 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.showcase.v1beta1.ReportSessionResponse parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static com.google.showcase.v1beta1.ReportSessionResponse 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.showcase.v1beta1.ReportSessionResponse prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - @java.lang.Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - *
        -   * Response message for reporting on a session.
        -   * 
        - * - * Protobuf type {@code google.showcase.v1beta1.ReportSessionResponse} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.ReportSessionResponse) - com.google.showcase.v1beta1.ReportSessionResponseOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.google.showcase.v1beta1.TestingOuterClass.internal_static_google_showcase_v1beta1_ReportSessionResponse_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.showcase.v1beta1.TestingOuterClass.internal_static_google_showcase_v1beta1_ReportSessionResponse_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.showcase.v1beta1.ReportSessionResponse.class, com.google.showcase.v1beta1.ReportSessionResponse.Builder.class); - } - - // Construct using com.google.showcase.v1beta1.ReportSessionResponse.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { - getTestRunsFieldBuilder(); - } - } - @java.lang.Override - public Builder clear() { - super.clear(); - result_ = 0; - - if (testRunsBuilder_ == null) { - testRuns_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - } else { - testRunsBuilder_.clear(); - } - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return com.google.showcase.v1beta1.TestingOuterClass.internal_static_google_showcase_v1beta1_ReportSessionResponse_descriptor; - } - - @java.lang.Override - public com.google.showcase.v1beta1.ReportSessionResponse getDefaultInstanceForType() { - return com.google.showcase.v1beta1.ReportSessionResponse.getDefaultInstance(); - } - - @java.lang.Override - public com.google.showcase.v1beta1.ReportSessionResponse build() { - com.google.showcase.v1beta1.ReportSessionResponse result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.showcase.v1beta1.ReportSessionResponse buildPartial() { - com.google.showcase.v1beta1.ReportSessionResponse result = new com.google.showcase.v1beta1.ReportSessionResponse(this); - int from_bitField0_ = bitField0_; - result.result_ = result_; - if (testRunsBuilder_ == null) { - if (((bitField0_ & 0x00000001) != 0)) { - testRuns_ = java.util.Collections.unmodifiableList(testRuns_); - bitField0_ = (bitField0_ & ~0x00000001); - } - result.testRuns_ = testRuns_; - } else { - result.testRuns_ = testRunsBuilder_.build(); - } - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.setField(field, value); - } - @java.lang.Override - public Builder clearField( - com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - @java.lang.Override - public Builder clearOneof( - com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.addRepeatedField(field, value); - } - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof com.google.showcase.v1beta1.ReportSessionResponse) { - return mergeFrom((com.google.showcase.v1beta1.ReportSessionResponse)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.showcase.v1beta1.ReportSessionResponse other) { - if (other == com.google.showcase.v1beta1.ReportSessionResponse.getDefaultInstance()) return this; - if (other.result_ != 0) { - setResultValue(other.getResultValue()); - } - if (testRunsBuilder_ == null) { - if (!other.testRuns_.isEmpty()) { - if (testRuns_.isEmpty()) { - testRuns_ = other.testRuns_; - bitField0_ = (bitField0_ & ~0x00000001); - } else { - ensureTestRunsIsMutable(); - testRuns_.addAll(other.testRuns_); - } - onChanged(); - } - } else { - if (!other.testRuns_.isEmpty()) { - if (testRunsBuilder_.isEmpty()) { - testRunsBuilder_.dispose(); - testRunsBuilder_ = null; - testRuns_ = other.testRuns_; - bitField0_ = (bitField0_ & ~0x00000001); - testRunsBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? - getTestRunsFieldBuilder() : null; - } else { - testRunsBuilder_.addAllMessages(other.testRuns_); - } - } - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - com.google.showcase.v1beta1.ReportSessionResponse parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (com.google.showcase.v1beta1.ReportSessionResponse) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - private int bitField0_; - - private int result_ = 0; - /** - *
        -     * The state of the report.
        -     * 
        - * - * .google.showcase.v1beta1.ReportSessionResponse.Result result = 1; - * @return The enum numeric value on the wire for result. - */ - @java.lang.Override public int getResultValue() { - return result_; - } - /** - *
        -     * The state of the report.
        -     * 
        - * - * .google.showcase.v1beta1.ReportSessionResponse.Result result = 1; - * @param value The enum numeric value on the wire for result to set. - * @return This builder for chaining. - */ - public Builder setResultValue(int value) { - - result_ = value; - onChanged(); - return this; - } - /** - *
        -     * The state of the report.
        -     * 
        - * - * .google.showcase.v1beta1.ReportSessionResponse.Result result = 1; - * @return The result. - */ - @java.lang.Override - public com.google.showcase.v1beta1.ReportSessionResponse.Result getResult() { - @SuppressWarnings("deprecation") - com.google.showcase.v1beta1.ReportSessionResponse.Result result = com.google.showcase.v1beta1.ReportSessionResponse.Result.valueOf(result_); - return result == null ? com.google.showcase.v1beta1.ReportSessionResponse.Result.UNRECOGNIZED : result; - } - /** - *
        -     * The state of the report.
        -     * 
        - * - * .google.showcase.v1beta1.ReportSessionResponse.Result result = 1; - * @param value The result to set. - * @return This builder for chaining. - */ - public Builder setResult(com.google.showcase.v1beta1.ReportSessionResponse.Result value) { - if (value == null) { - throw new NullPointerException(); - } - - result_ = value.getNumber(); - onChanged(); - return this; - } - /** - *
        -     * The state of the report.
        -     * 
        - * - * .google.showcase.v1beta1.ReportSessionResponse.Result result = 1; - * @return This builder for chaining. - */ - public Builder clearResult() { - - result_ = 0; - onChanged(); - return this; - } - - private java.util.List testRuns_ = - java.util.Collections.emptyList(); - private void ensureTestRunsIsMutable() { - if (!((bitField0_ & 0x00000001) != 0)) { - testRuns_ = new java.util.ArrayList(testRuns_); - bitField0_ |= 0x00000001; - } - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - com.google.showcase.v1beta1.TestRun, com.google.showcase.v1beta1.TestRun.Builder, com.google.showcase.v1beta1.TestRunOrBuilder> testRunsBuilder_; - - /** - *
        -     * The test runs of this session.
        -     * 
        - * - * repeated .google.showcase.v1beta1.TestRun test_runs = 2; - */ - public java.util.List getTestRunsList() { - if (testRunsBuilder_ == null) { - return java.util.Collections.unmodifiableList(testRuns_); - } else { - return testRunsBuilder_.getMessageList(); - } - } - /** - *
        -     * The test runs of this session.
        -     * 
        - * - * repeated .google.showcase.v1beta1.TestRun test_runs = 2; - */ - public int getTestRunsCount() { - if (testRunsBuilder_ == null) { - return testRuns_.size(); - } else { - return testRunsBuilder_.getCount(); - } - } - /** - *
        -     * The test runs of this session.
        -     * 
        - * - * repeated .google.showcase.v1beta1.TestRun test_runs = 2; - */ - public com.google.showcase.v1beta1.TestRun getTestRuns(int index) { - if (testRunsBuilder_ == null) { - return testRuns_.get(index); - } else { - return testRunsBuilder_.getMessage(index); - } - } - /** - *
        -     * The test runs of this session.
        -     * 
        - * - * repeated .google.showcase.v1beta1.TestRun test_runs = 2; - */ - public Builder setTestRuns( - int index, com.google.showcase.v1beta1.TestRun value) { - if (testRunsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureTestRunsIsMutable(); - testRuns_.set(index, value); - onChanged(); - } else { - testRunsBuilder_.setMessage(index, value); - } - return this; - } - /** - *
        -     * The test runs of this session.
        -     * 
        - * - * repeated .google.showcase.v1beta1.TestRun test_runs = 2; - */ - public Builder setTestRuns( - int index, com.google.showcase.v1beta1.TestRun.Builder builderForValue) { - if (testRunsBuilder_ == null) { - ensureTestRunsIsMutable(); - testRuns_.set(index, builderForValue.build()); - onChanged(); - } else { - testRunsBuilder_.setMessage(index, builderForValue.build()); - } - return this; - } - /** - *
        -     * The test runs of this session.
        -     * 
        - * - * repeated .google.showcase.v1beta1.TestRun test_runs = 2; - */ - public Builder addTestRuns(com.google.showcase.v1beta1.TestRun value) { - if (testRunsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureTestRunsIsMutable(); - testRuns_.add(value); - onChanged(); - } else { - testRunsBuilder_.addMessage(value); - } - return this; - } - /** - *
        -     * The test runs of this session.
        -     * 
        - * - * repeated .google.showcase.v1beta1.TestRun test_runs = 2; - */ - public Builder addTestRuns( - int index, com.google.showcase.v1beta1.TestRun value) { - if (testRunsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureTestRunsIsMutable(); - testRuns_.add(index, value); - onChanged(); - } else { - testRunsBuilder_.addMessage(index, value); - } - return this; - } - /** - *
        -     * The test runs of this session.
        -     * 
        - * - * repeated .google.showcase.v1beta1.TestRun test_runs = 2; - */ - public Builder addTestRuns( - com.google.showcase.v1beta1.TestRun.Builder builderForValue) { - if (testRunsBuilder_ == null) { - ensureTestRunsIsMutable(); - testRuns_.add(builderForValue.build()); - onChanged(); - } else { - testRunsBuilder_.addMessage(builderForValue.build()); - } - return this; - } - /** - *
        -     * The test runs of this session.
        -     * 
        - * - * repeated .google.showcase.v1beta1.TestRun test_runs = 2; - */ - public Builder addTestRuns( - int index, com.google.showcase.v1beta1.TestRun.Builder builderForValue) { - if (testRunsBuilder_ == null) { - ensureTestRunsIsMutable(); - testRuns_.add(index, builderForValue.build()); - onChanged(); - } else { - testRunsBuilder_.addMessage(index, builderForValue.build()); - } - return this; - } - /** - *
        -     * The test runs of this session.
        -     * 
        - * - * repeated .google.showcase.v1beta1.TestRun test_runs = 2; - */ - public Builder addAllTestRuns( - java.lang.Iterable values) { - if (testRunsBuilder_ == null) { - ensureTestRunsIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, testRuns_); - onChanged(); - } else { - testRunsBuilder_.addAllMessages(values); - } - return this; - } - /** - *
        -     * The test runs of this session.
        -     * 
        - * - * repeated .google.showcase.v1beta1.TestRun test_runs = 2; - */ - public Builder clearTestRuns() { - if (testRunsBuilder_ == null) { - testRuns_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - onChanged(); - } else { - testRunsBuilder_.clear(); - } - return this; - } - /** - *
        -     * The test runs of this session.
        -     * 
        - * - * repeated .google.showcase.v1beta1.TestRun test_runs = 2; - */ - public Builder removeTestRuns(int index) { - if (testRunsBuilder_ == null) { - ensureTestRunsIsMutable(); - testRuns_.remove(index); - onChanged(); - } else { - testRunsBuilder_.remove(index); - } - return this; - } - /** - *
        -     * The test runs of this session.
        -     * 
        - * - * repeated .google.showcase.v1beta1.TestRun test_runs = 2; - */ - public com.google.showcase.v1beta1.TestRun.Builder getTestRunsBuilder( - int index) { - return getTestRunsFieldBuilder().getBuilder(index); - } - /** - *
        -     * The test runs of this session.
        -     * 
        - * - * repeated .google.showcase.v1beta1.TestRun test_runs = 2; - */ - public com.google.showcase.v1beta1.TestRunOrBuilder getTestRunsOrBuilder( - int index) { - if (testRunsBuilder_ == null) { - return testRuns_.get(index); } else { - return testRunsBuilder_.getMessageOrBuilder(index); - } - } - /** - *
        -     * The test runs of this session.
        -     * 
        - * - * repeated .google.showcase.v1beta1.TestRun test_runs = 2; - */ - public java.util.List - getTestRunsOrBuilderList() { - if (testRunsBuilder_ != null) { - return testRunsBuilder_.getMessageOrBuilderList(); - } else { - return java.util.Collections.unmodifiableList(testRuns_); - } - } - /** - *
        -     * The test runs of this session.
        -     * 
        - * - * repeated .google.showcase.v1beta1.TestRun test_runs = 2; - */ - public com.google.showcase.v1beta1.TestRun.Builder addTestRunsBuilder() { - return getTestRunsFieldBuilder().addBuilder( - com.google.showcase.v1beta1.TestRun.getDefaultInstance()); - } - /** - *
        -     * The test runs of this session.
        -     * 
        - * - * repeated .google.showcase.v1beta1.TestRun test_runs = 2; - */ - public com.google.showcase.v1beta1.TestRun.Builder addTestRunsBuilder( - int index) { - return getTestRunsFieldBuilder().addBuilder( - index, com.google.showcase.v1beta1.TestRun.getDefaultInstance()); - } - /** - *
        -     * The test runs of this session.
        -     * 
        - * - * repeated .google.showcase.v1beta1.TestRun test_runs = 2; - */ - public java.util.List - getTestRunsBuilderList() { - return getTestRunsFieldBuilder().getBuilderList(); - } - private com.google.protobuf.RepeatedFieldBuilderV3< - com.google.showcase.v1beta1.TestRun, com.google.showcase.v1beta1.TestRun.Builder, com.google.showcase.v1beta1.TestRunOrBuilder> - getTestRunsFieldBuilder() { - if (testRunsBuilder_ == null) { - testRunsBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< - com.google.showcase.v1beta1.TestRun, com.google.showcase.v1beta1.TestRun.Builder, com.google.showcase.v1beta1.TestRunOrBuilder>( - testRuns_, - ((bitField0_ & 0x00000001) != 0), - getParentForChildren(), - isClean()); - testRuns_ = null; - } - return testRunsBuilder_; - } - @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.showcase.v1beta1.ReportSessionResponse) - } - - // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.ReportSessionResponse) - private static final com.google.showcase.v1beta1.ReportSessionResponse DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new com.google.showcase.v1beta1.ReportSessionResponse(); - } - - public static com.google.showcase.v1beta1.ReportSessionResponse getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public ReportSessionResponse parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new ReportSessionResponse(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public com.google.showcase.v1beta1.ReportSessionResponse getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ReportSessionResponseOrBuilder.java b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ReportSessionResponseOrBuilder.java deleted file mode 100644 index 1b13563414..0000000000 --- a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ReportSessionResponseOrBuilder.java +++ /dev/null @@ -1,72 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: schema/google/showcase/v1beta1/testing.proto - -package com.google.showcase.v1beta1; - -public interface ReportSessionResponseOrBuilder extends - // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.ReportSessionResponse) - com.google.protobuf.MessageOrBuilder { - - /** - *
        -   * The state of the report.
        -   * 
        - * - * .google.showcase.v1beta1.ReportSessionResponse.Result result = 1; - * @return The enum numeric value on the wire for result. - */ - int getResultValue(); - /** - *
        -   * The state of the report.
        -   * 
        - * - * .google.showcase.v1beta1.ReportSessionResponse.Result result = 1; - * @return The result. - */ - com.google.showcase.v1beta1.ReportSessionResponse.Result getResult(); - - /** - *
        -   * The test runs of this session.
        -   * 
        - * - * repeated .google.showcase.v1beta1.TestRun test_runs = 2; - */ - java.util.List - getTestRunsList(); - /** - *
        -   * The test runs of this session.
        -   * 
        - * - * repeated .google.showcase.v1beta1.TestRun test_runs = 2; - */ - com.google.showcase.v1beta1.TestRun getTestRuns(int index); - /** - *
        -   * The test runs of this session.
        -   * 
        - * - * repeated .google.showcase.v1beta1.TestRun test_runs = 2; - */ - int getTestRunsCount(); - /** - *
        -   * The test runs of this session.
        -   * 
        - * - * repeated .google.showcase.v1beta1.TestRun test_runs = 2; - */ - java.util.List - getTestRunsOrBuilderList(); - /** - *
        -   * The test runs of this session.
        -   * 
        - * - * repeated .google.showcase.v1beta1.TestRun test_runs = 2; - */ - com.google.showcase.v1beta1.TestRunOrBuilder getTestRunsOrBuilder( - int index); -} diff --git a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/Room.java b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/Room.java deleted file mode 100644 index d03db19025..0000000000 --- a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/Room.java +++ /dev/null @@ -1,1399 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: schema/google/showcase/v1beta1/messaging.proto - -package com.google.showcase.v1beta1; - -/** - *
        - * A chat room.
        - * 
        - * - * Protobuf type {@code google.showcase.v1beta1.Room} - */ -public final class Room extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.Room) - RoomOrBuilder { -private static final long serialVersionUID = 0L; - // Use Room.newBuilder() to construct. - private Room(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private Room() { - name_ = ""; - displayName_ = ""; - description_ = ""; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new Room(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private Room( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: { - java.lang.String s = input.readStringRequireUtf8(); - - name_ = s; - break; - } - case 18: { - java.lang.String s = input.readStringRequireUtf8(); - - displayName_ = s; - break; - } - case 26: { - java.lang.String s = input.readStringRequireUtf8(); - - description_ = s; - break; - } - case 34: { - com.google.protobuf.Timestamp.Builder subBuilder = null; - if (createTime_ != null) { - subBuilder = createTime_.toBuilder(); - } - createTime_ = input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(createTime_); - createTime_ = subBuilder.buildPartial(); - } - - break; - } - case 42: { - com.google.protobuf.Timestamp.Builder subBuilder = null; - if (updateTime_ != null) { - subBuilder = updateTime_.toBuilder(); - } - updateTime_ = input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(updateTime_); - updateTime_ = subBuilder.buildPartial(); - } - - break; - } - default: { - if (!parseUnknownField( - input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException( - e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.google.showcase.v1beta1.MessagingOuterClass.internal_static_google_showcase_v1beta1_Room_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.showcase.v1beta1.MessagingOuterClass.internal_static_google_showcase_v1beta1_Room_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.showcase.v1beta1.Room.class, com.google.showcase.v1beta1.Room.Builder.class); - } - - public static final int NAME_FIELD_NUMBER = 1; - private volatile java.lang.Object name_; - /** - *
        -   * The resource name of the chat room.
        -   * 
        - * - * 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 chat room.
        -   * 
        - * - * 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 DISPLAY_NAME_FIELD_NUMBER = 2; - private volatile java.lang.Object displayName_; - /** - *
        -   * The human readable name of the chat room.
        -   * 
        - * - * string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return The displayName. - */ - @java.lang.Override - public java.lang.String getDisplayName() { - java.lang.Object ref = displayName_; - 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(); - displayName_ = s; - return s; - } - } - /** - *
        -   * The human readable name of the chat room.
        -   * 
        - * - * string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return The bytes for displayName. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getDisplayNameBytes() { - java.lang.Object ref = displayName_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - displayName_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int DESCRIPTION_FIELD_NUMBER = 3; - private volatile java.lang.Object description_; - /** - *
        -   * The description of the chat room.
        -   * 
        - * - * 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; - } - } - /** - *
        -   * The description of the chat room.
        -   * 
        - * - * 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_; - /** - *
        -   * The timestamp at which the room was created.
        -   * 
        - * - * .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 createTime_ != null; - } - /** - *
        -   * The timestamp at which the room was created.
        -   * 
        - * - * .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_; - } - /** - *
        -   * The timestamp at which the room was created.
        -   * 
        - * - * .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - @java.lang.Override - public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { - return getCreateTime(); - } - - public static final int UPDATE_TIME_FIELD_NUMBER = 5; - private com.google.protobuf.Timestamp updateTime_; - /** - *
        -   * The latest timestamp at which the room was updated.
        -   * 
        - * - * .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return Whether the updateTime field is set. - */ - @java.lang.Override - public boolean hasUpdateTime() { - return updateTime_ != null; - } - /** - *
        -   * The latest timestamp at which the room was updated.
        -   * 
        - * - * .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return The updateTime. - */ - @java.lang.Override - public com.google.protobuf.Timestamp getUpdateTime() { - return updateTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : updateTime_; - } - /** - *
        -   * The latest timestamp at which the room was updated.
        -   * 
        - * - * .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - @java.lang.Override - public com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder() { - return getUpdateTime(); - } - - private byte memoizedIsInitialized = -1; - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); - } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(displayName_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 2, displayName_); - } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(description_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 3, description_); - } - if (createTime_ != null) { - output.writeMessage(4, getCreateTime()); - } - if (updateTime_ != null) { - output.writeMessage(5, getUpdateTime()); - } - unknownFields.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(displayName_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, displayName_); - } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(description_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, description_); - } - if (createTime_ != null) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(4, getCreateTime()); - } - if (updateTime_ != null) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(5, getUpdateTime()); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof com.google.showcase.v1beta1.Room)) { - return super.equals(obj); - } - com.google.showcase.v1beta1.Room other = (com.google.showcase.v1beta1.Room) obj; - - if (!getName() - .equals(other.getName())) return false; - if (!getDisplayName() - .equals(other.getDisplayName())) 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 (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - hash = (37 * hash) + NAME_FIELD_NUMBER; - hash = (53 * hash) + getName().hashCode(); - hash = (37 * hash) + DISPLAY_NAME_FIELD_NUMBER; - hash = (53 * hash) + getDisplayName().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 = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.showcase.v1beta1.Room parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.showcase.v1beta1.Room parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.showcase.v1beta1.Room parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.showcase.v1beta1.Room 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.showcase.v1beta1.Room parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.showcase.v1beta1.Room parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.showcase.v1beta1.Room parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static com.google.showcase.v1beta1.Room 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.showcase.v1beta1.Room parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static com.google.showcase.v1beta1.Room 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.showcase.v1beta1.Room parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static com.google.showcase.v1beta1.Room 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.showcase.v1beta1.Room prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - @java.lang.Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - *
        -   * A chat room.
        -   * 
        - * - * Protobuf type {@code google.showcase.v1beta1.Room} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.Room) - com.google.showcase.v1beta1.RoomOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.google.showcase.v1beta1.MessagingOuterClass.internal_static_google_showcase_v1beta1_Room_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.showcase.v1beta1.MessagingOuterClass.internal_static_google_showcase_v1beta1_Room_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.showcase.v1beta1.Room.class, com.google.showcase.v1beta1.Room.Builder.class); - } - - // Construct using com.google.showcase.v1beta1.Room.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { - } - } - @java.lang.Override - public Builder clear() { - super.clear(); - name_ = ""; - - displayName_ = ""; - - description_ = ""; - - if (createTimeBuilder_ == null) { - createTime_ = null; - } else { - createTime_ = null; - createTimeBuilder_ = null; - } - if (updateTimeBuilder_ == null) { - updateTime_ = null; - } else { - updateTime_ = null; - updateTimeBuilder_ = null; - } - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return com.google.showcase.v1beta1.MessagingOuterClass.internal_static_google_showcase_v1beta1_Room_descriptor; - } - - @java.lang.Override - public com.google.showcase.v1beta1.Room getDefaultInstanceForType() { - return com.google.showcase.v1beta1.Room.getDefaultInstance(); - } - - @java.lang.Override - public com.google.showcase.v1beta1.Room build() { - com.google.showcase.v1beta1.Room result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.showcase.v1beta1.Room buildPartial() { - com.google.showcase.v1beta1.Room result = new com.google.showcase.v1beta1.Room(this); - result.name_ = name_; - result.displayName_ = displayName_; - result.description_ = description_; - if (createTimeBuilder_ == null) { - result.createTime_ = createTime_; - } else { - result.createTime_ = createTimeBuilder_.build(); - } - if (updateTimeBuilder_ == null) { - result.updateTime_ = updateTime_; - } else { - result.updateTime_ = updateTimeBuilder_.build(); - } - 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.showcase.v1beta1.Room) { - return mergeFrom((com.google.showcase.v1beta1.Room)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.showcase.v1beta1.Room other) { - if (other == com.google.showcase.v1beta1.Room.getDefaultInstance()) return this; - if (!other.getName().isEmpty()) { - name_ = other.name_; - onChanged(); - } - if (!other.getDisplayName().isEmpty()) { - displayName_ = other.displayName_; - onChanged(); - } - if (!other.getDescription().isEmpty()) { - description_ = other.description_; - onChanged(); - } - if (other.hasCreateTime()) { - mergeCreateTime(other.getCreateTime()); - } - if (other.hasUpdateTime()) { - mergeUpdateTime(other.getUpdateTime()); - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - com.google.showcase.v1beta1.Room parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (com.google.showcase.v1beta1.Room) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private java.lang.Object name_ = ""; - /** - *
        -     * The resource name of the chat room.
        -     * 
        - * - * 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 chat room.
        -     * 
        - * - * 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 chat room.
        -     * 
        - * - * string name = 1; - * @param value The name to set. - * @return This builder for chaining. - */ - public Builder setName( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - name_ = value; - onChanged(); - return this; - } - /** - *
        -     * The resource name of the chat room.
        -     * 
        - * - * string name = 1; - * @return This builder for chaining. - */ - public Builder clearName() { - - name_ = getDefaultInstance().getName(); - onChanged(); - return this; - } - /** - *
        -     * The resource name of the chat room.
        -     * 
        - * - * string name = 1; - * @param value The bytes for name to set. - * @return This builder for chaining. - */ - public Builder setNameBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - name_ = value; - onChanged(); - return this; - } - - private java.lang.Object displayName_ = ""; - /** - *
        -     * The human readable name of the chat room.
        -     * 
        - * - * string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return The displayName. - */ - public java.lang.String getDisplayName() { - java.lang.Object ref = displayName_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - displayName_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - *
        -     * The human readable name of the chat room.
        -     * 
        - * - * string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return The bytes for displayName. - */ - public com.google.protobuf.ByteString - getDisplayNameBytes() { - java.lang.Object ref = displayName_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - displayName_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - *
        -     * The human readable name of the chat room.
        -     * 
        - * - * string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; - * @param value The displayName to set. - * @return This builder for chaining. - */ - public Builder setDisplayName( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - displayName_ = value; - onChanged(); - return this; - } - /** - *
        -     * The human readable name of the chat room.
        -     * 
        - * - * string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return This builder for chaining. - */ - public Builder clearDisplayName() { - - displayName_ = getDefaultInstance().getDisplayName(); - onChanged(); - return this; - } - /** - *
        -     * The human readable name of the chat room.
        -     * 
        - * - * string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; - * @param value The bytes for displayName to set. - * @return This builder for chaining. - */ - public Builder setDisplayNameBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - displayName_ = value; - onChanged(); - return this; - } - - private java.lang.Object description_ = ""; - /** - *
        -     * The description of the chat room.
        -     * 
        - * - * 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; - } - } - /** - *
        -     * The description of the chat room.
        -     * 
        - * - * 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; - } - } - /** - *
        -     * The description of the chat room.
        -     * 
        - * - * string description = 3; - * @param value The description to set. - * @return This builder for chaining. - */ - public Builder setDescription( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - description_ = value; - onChanged(); - return this; - } - /** - *
        -     * The description of the chat room.
        -     * 
        - * - * string description = 3; - * @return This builder for chaining. - */ - public Builder clearDescription() { - - description_ = getDefaultInstance().getDescription(); - onChanged(); - return this; - } - /** - *
        -     * The description of the chat room.
        -     * 
        - * - * string description = 3; - * @param value The bytes for description to set. - * @return This builder for chaining. - */ - public Builder setDescriptionBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - description_ = value; - onChanged(); - return this; - } - - private com.google.protobuf.Timestamp createTime_; - private com.google.protobuf.SingleFieldBuilderV3< - com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder> createTimeBuilder_; - /** - *
        -     * The timestamp at which the room was created.
        -     * 
        - * - * .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return Whether the createTime field is set. - */ - public boolean hasCreateTime() { - return createTimeBuilder_ != null || createTime_ != null; - } - /** - *
        -     * The timestamp at which the room was created.
        -     * 
        - * - * .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(); - } - } - /** - *
        -     * The timestamp at which the room was created.
        -     * 
        - * - * .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; - onChanged(); - } else { - createTimeBuilder_.setMessage(value); - } - - return this; - } - /** - *
        -     * The timestamp at which the room was created.
        -     * 
        - * - * .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(); - onChanged(); - } else { - createTimeBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - *
        -     * The timestamp at which the room was created.
        -     * 
        - * - * .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - public Builder mergeCreateTime(com.google.protobuf.Timestamp value) { - if (createTimeBuilder_ == null) { - if (createTime_ != null) { - createTime_ = - com.google.protobuf.Timestamp.newBuilder(createTime_).mergeFrom(value).buildPartial(); - } else { - createTime_ = value; - } - onChanged(); - } else { - createTimeBuilder_.mergeFrom(value); - } - - return this; - } - /** - *
        -     * The timestamp at which the room was created.
        -     * 
        - * - * .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - public Builder clearCreateTime() { - if (createTimeBuilder_ == null) { - createTime_ = null; - onChanged(); - } else { - createTime_ = null; - createTimeBuilder_ = null; - } - - return this; - } - /** - *
        -     * The timestamp at which the room was created.
        -     * 
        - * - * .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - public com.google.protobuf.Timestamp.Builder getCreateTimeBuilder() { - - onChanged(); - return getCreateTimeFieldBuilder().getBuilder(); - } - /** - *
        -     * The timestamp at which the room was created.
        -     * 
        - * - * .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_; - } - } - /** - *
        -     * The timestamp at which the room was created.
        -     * 
        - * - * .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_; - /** - *
        -     * The latest timestamp at which the room was updated.
        -     * 
        - * - * .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return Whether the updateTime field is set. - */ - public boolean hasUpdateTime() { - return updateTimeBuilder_ != null || updateTime_ != null; - } - /** - *
        -     * The latest timestamp at which the room was updated.
        -     * 
        - * - * .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return The updateTime. - */ - public com.google.protobuf.Timestamp getUpdateTime() { - if (updateTimeBuilder_ == null) { - return updateTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : updateTime_; - } else { - return updateTimeBuilder_.getMessage(); - } - } - /** - *
        -     * The latest timestamp at which the room was updated.
        -     * 
        - * - * .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - public Builder setUpdateTime(com.google.protobuf.Timestamp value) { - if (updateTimeBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - updateTime_ = value; - onChanged(); - } else { - updateTimeBuilder_.setMessage(value); - } - - return this; - } - /** - *
        -     * The latest timestamp at which the room was updated.
        -     * 
        - * - * .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - public Builder setUpdateTime( - com.google.protobuf.Timestamp.Builder builderForValue) { - if (updateTimeBuilder_ == null) { - updateTime_ = builderForValue.build(); - onChanged(); - } else { - updateTimeBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - *
        -     * The latest timestamp at which the room was updated.
        -     * 
        - * - * .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - public Builder mergeUpdateTime(com.google.protobuf.Timestamp value) { - if (updateTimeBuilder_ == null) { - if (updateTime_ != null) { - updateTime_ = - com.google.protobuf.Timestamp.newBuilder(updateTime_).mergeFrom(value).buildPartial(); - } else { - updateTime_ = value; - } - onChanged(); - } else { - updateTimeBuilder_.mergeFrom(value); - } - - return this; - } - /** - *
        -     * The latest timestamp at which the room was updated.
        -     * 
        - * - * .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - public Builder clearUpdateTime() { - if (updateTimeBuilder_ == null) { - updateTime_ = null; - onChanged(); - } else { - updateTime_ = null; - updateTimeBuilder_ = null; - } - - return this; - } - /** - *
        -     * The latest timestamp at which the room was updated.
        -     * 
        - * - * .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - public com.google.protobuf.Timestamp.Builder getUpdateTimeBuilder() { - - onChanged(); - return getUpdateTimeFieldBuilder().getBuilder(); - } - /** - *
        -     * The latest timestamp at which the room was updated.
        -     * 
        - * - * .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - public com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder() { - if (updateTimeBuilder_ != null) { - return updateTimeBuilder_.getMessageOrBuilder(); - } else { - return updateTime_ == null ? - com.google.protobuf.Timestamp.getDefaultInstance() : updateTime_; - } - } - /** - *
        -     * The latest timestamp at which the room was updated.
        -     * 
        - * - * .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private com.google.protobuf.SingleFieldBuilderV3< - com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder> - getUpdateTimeFieldBuilder() { - if (updateTimeBuilder_ == null) { - updateTimeBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder>( - getUpdateTime(), - getParentForChildren(), - isClean()); - updateTime_ = null; - } - return updateTimeBuilder_; - } - @java.lang.Override - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - - // @@protoc_insertion_point(builder_scope:google.showcase.v1beta1.Room) - } - - // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.Room) - private static final com.google.showcase.v1beta1.Room DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new com.google.showcase.v1beta1.Room(); - } - - public static com.google.showcase.v1beta1.Room getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public Room parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new Room(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public com.google.showcase.v1beta1.Room getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/RoomName.java b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/RoomName.java deleted file mode 100644 index b7ebbbad5d..0000000000 --- a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/RoomName.java +++ /dev/null @@ -1,166 +0,0 @@ -/* - * 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 - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1; - -import com.google.api.pathtemplate.PathTemplate; -import com.google.api.resourcenames.ResourceName; -import com.google.common.base.Preconditions; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import javax.annotation.Generated; - -// AUTO-GENERATED DOCUMENTATION AND CLASS. -@Generated("by gapic-generator-java") -public class RoomName implements ResourceName { - private static final PathTemplate ROOM = PathTemplate.createWithoutUrlEncoding("rooms/{room}"); - private volatile Map fieldValuesMap; - private final String room; - - @Deprecated - protected RoomName() { - room = null; - } - - private RoomName(Builder builder) { - room = Preconditions.checkNotNull(builder.getRoom()); - } - - public String getRoom() { - return room; - } - - public static Builder newBuilder() { - return new Builder(); - } - - public Builder toBuilder() { - return new Builder(this); - } - - public static RoomName of(String room) { - return newBuilder().setRoom(room).build(); - } - - public static String format(String room) { - return newBuilder().setRoom(room).build().toString(); - } - - public static RoomName parse(String formattedString) { - if (formattedString.isEmpty()) { - return null; - } - Map matchMap = - ROOM.validatedMatch(formattedString, "RoomName.parse: formattedString not in valid format"); - return of(matchMap.get("room")); - } - - 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 (RoomName value : values) { - if (value == null) { - list.add(""); - } else { - list.add(value.toString()); - } - } - return list; - } - - public static boolean isParsableFrom(String formattedString) { - return ROOM.matches(formattedString); - } - - @Override - public Map getFieldValuesMap() { - if (fieldValuesMap == null) { - synchronized (this) { - if (fieldValuesMap == null) { - ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); - if (room != null) { - fieldMapBuilder.put("room", room); - } - fieldValuesMap = fieldMapBuilder.build(); - } - } - } - return fieldValuesMap; - } - - public String getFieldValue(String fieldName) { - return getFieldValuesMap().get(fieldName); - } - - @Override - public String toString() { - return ROOM.instantiate("room", room); - } - - @Override - public boolean equals(Object o) { - if (o == this) { - return true; - } - if (o != null || getClass() == o.getClass()) { - RoomName that = ((RoomName) o); - return Objects.equals(this.room, that.room); - } - return false; - } - - @Override - public int hashCode() { - int h = 1; - h *= 1000003; - h ^= Objects.hashCode(room); - return h; - } - - /** Builder for rooms/{room}. */ - public static class Builder { - private String room; - - protected Builder() {} - - public String getRoom() { - return room; - } - - public Builder setRoom(String room) { - this.room = room; - return this; - } - - private Builder(RoomName roomName) { - this.room = roomName.room; - } - - public RoomName build() { - return new RoomName(this); - } - } -} diff --git a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/RoomOrBuilder.java b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/RoomOrBuilder.java deleted file mode 100644 index 28cefbcd18..0000000000 --- a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/RoomOrBuilder.java +++ /dev/null @@ -1,123 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: schema/google/showcase/v1beta1/messaging.proto - -package com.google.showcase.v1beta1; - -public interface RoomOrBuilder extends - // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.Room) - com.google.protobuf.MessageOrBuilder { - - /** - *
        -   * The resource name of the chat room.
        -   * 
        - * - * string name = 1; - * @return The name. - */ - java.lang.String getName(); - /** - *
        -   * The resource name of the chat room.
        -   * 
        - * - * string name = 1; - * @return The bytes for name. - */ - com.google.protobuf.ByteString - getNameBytes(); - - /** - *
        -   * The human readable name of the chat room.
        -   * 
        - * - * string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return The displayName. - */ - java.lang.String getDisplayName(); - /** - *
        -   * The human readable name of the chat room.
        -   * 
        - * - * string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return The bytes for displayName. - */ - com.google.protobuf.ByteString - getDisplayNameBytes(); - - /** - *
        -   * The description of the chat room.
        -   * 
        - * - * string description = 3; - * @return The description. - */ - java.lang.String getDescription(); - /** - *
        -   * The description of the chat room.
        -   * 
        - * - * string description = 3; - * @return The bytes for description. - */ - com.google.protobuf.ByteString - getDescriptionBytes(); - - /** - *
        -   * The timestamp at which the room was created.
        -   * 
        - * - * .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return Whether the createTime field is set. - */ - boolean hasCreateTime(); - /** - *
        -   * The timestamp at which the room was created.
        -   * 
        - * - * .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return The createTime. - */ - com.google.protobuf.Timestamp getCreateTime(); - /** - *
        -   * The timestamp at which the room was created.
        -   * 
        - * - * .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder(); - - /** - *
        -   * The latest timestamp at which the room was updated.
        -   * 
        - * - * .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return Whether the updateTime field is set. - */ - boolean hasUpdateTime(); - /** - *
        -   * The latest timestamp at which the room was updated.
        -   * 
        - * - * .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return The updateTime. - */ - com.google.protobuf.Timestamp getUpdateTime(); - /** - *
        -   * The latest timestamp at which the room was updated.
        -   * 
        - * - * .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder(); -} diff --git a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/SearchBlurbsMetadata.java b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/SearchBlurbsMetadata.java deleted file mode 100644 index cb91d593a7..0000000000 --- a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/SearchBlurbsMetadata.java +++ /dev/null @@ -1,667 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: schema/google/showcase/v1beta1/messaging.proto - -package com.google.showcase.v1beta1; - -/** - *
        - * The operation metadata message for the
        - * google.showcase.v1beta1.Messaging\SearchBlurbs method.
        - * 
        - * - * Protobuf type {@code google.showcase.v1beta1.SearchBlurbsMetadata} - */ -public final class SearchBlurbsMetadata extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.SearchBlurbsMetadata) - SearchBlurbsMetadataOrBuilder { -private static final long serialVersionUID = 0L; - // Use SearchBlurbsMetadata.newBuilder() to construct. - private SearchBlurbsMetadata(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private SearchBlurbsMetadata() { - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new SearchBlurbsMetadata(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private SearchBlurbsMetadata( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: { - com.google.rpc.RetryInfo.Builder subBuilder = null; - if (retryInfo_ != null) { - subBuilder = retryInfo_.toBuilder(); - } - retryInfo_ = input.readMessage(com.google.rpc.RetryInfo.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(retryInfo_); - retryInfo_ = subBuilder.buildPartial(); - } - - break; - } - default: { - if (!parseUnknownField( - input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException( - e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.google.showcase.v1beta1.MessagingOuterClass.internal_static_google_showcase_v1beta1_SearchBlurbsMetadata_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.showcase.v1beta1.MessagingOuterClass.internal_static_google_showcase_v1beta1_SearchBlurbsMetadata_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.showcase.v1beta1.SearchBlurbsMetadata.class, com.google.showcase.v1beta1.SearchBlurbsMetadata.Builder.class); - } - - public static final int RETRY_INFO_FIELD_NUMBER = 1; - private com.google.rpc.RetryInfo retryInfo_; - /** - *
        -   * This signals to the client when to next poll for response.
        -   * 
        - * - * .google.rpc.RetryInfo retry_info = 1; - * @return Whether the retryInfo field is set. - */ - @java.lang.Override - public boolean hasRetryInfo() { - return retryInfo_ != null; - } - /** - *
        -   * This signals to the client when to next poll for response.
        -   * 
        - * - * .google.rpc.RetryInfo retry_info = 1; - * @return The retryInfo. - */ - @java.lang.Override - public com.google.rpc.RetryInfo getRetryInfo() { - return retryInfo_ == null ? com.google.rpc.RetryInfo.getDefaultInstance() : retryInfo_; - } - /** - *
        -   * This signals to the client when to next poll for response.
        -   * 
        - * - * .google.rpc.RetryInfo retry_info = 1; - */ - @java.lang.Override - public com.google.rpc.RetryInfoOrBuilder getRetryInfoOrBuilder() { - return getRetryInfo(); - } - - 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 (retryInfo_ != null) { - output.writeMessage(1, getRetryInfo()); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (retryInfo_ != null) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(1, getRetryInfo()); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof com.google.showcase.v1beta1.SearchBlurbsMetadata)) { - return super.equals(obj); - } - com.google.showcase.v1beta1.SearchBlurbsMetadata other = (com.google.showcase.v1beta1.SearchBlurbsMetadata) obj; - - if (hasRetryInfo() != other.hasRetryInfo()) return false; - if (hasRetryInfo()) { - if (!getRetryInfo() - .equals(other.getRetryInfo())) return false; - } - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - if (hasRetryInfo()) { - hash = (37 * hash) + RETRY_INFO_FIELD_NUMBER; - hash = (53 * hash) + getRetryInfo().hashCode(); - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.showcase.v1beta1.SearchBlurbsMetadata parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.showcase.v1beta1.SearchBlurbsMetadata parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.showcase.v1beta1.SearchBlurbsMetadata parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.showcase.v1beta1.SearchBlurbsMetadata 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.showcase.v1beta1.SearchBlurbsMetadata parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.showcase.v1beta1.SearchBlurbsMetadata parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.showcase.v1beta1.SearchBlurbsMetadata parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static com.google.showcase.v1beta1.SearchBlurbsMetadata 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.showcase.v1beta1.SearchBlurbsMetadata parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static com.google.showcase.v1beta1.SearchBlurbsMetadata 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.showcase.v1beta1.SearchBlurbsMetadata parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static com.google.showcase.v1beta1.SearchBlurbsMetadata 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.showcase.v1beta1.SearchBlurbsMetadata 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 operation metadata message for the
        -   * google.showcase.v1beta1.Messaging\SearchBlurbs method.
        -   * 
        - * - * Protobuf type {@code google.showcase.v1beta1.SearchBlurbsMetadata} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.SearchBlurbsMetadata) - com.google.showcase.v1beta1.SearchBlurbsMetadataOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.google.showcase.v1beta1.MessagingOuterClass.internal_static_google_showcase_v1beta1_SearchBlurbsMetadata_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.showcase.v1beta1.MessagingOuterClass.internal_static_google_showcase_v1beta1_SearchBlurbsMetadata_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.showcase.v1beta1.SearchBlurbsMetadata.class, com.google.showcase.v1beta1.SearchBlurbsMetadata.Builder.class); - } - - // Construct using com.google.showcase.v1beta1.SearchBlurbsMetadata.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { - } - } - @java.lang.Override - public Builder clear() { - super.clear(); - if (retryInfoBuilder_ == null) { - retryInfo_ = null; - } else { - retryInfo_ = null; - retryInfoBuilder_ = null; - } - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return com.google.showcase.v1beta1.MessagingOuterClass.internal_static_google_showcase_v1beta1_SearchBlurbsMetadata_descriptor; - } - - @java.lang.Override - public com.google.showcase.v1beta1.SearchBlurbsMetadata getDefaultInstanceForType() { - return com.google.showcase.v1beta1.SearchBlurbsMetadata.getDefaultInstance(); - } - - @java.lang.Override - public com.google.showcase.v1beta1.SearchBlurbsMetadata build() { - com.google.showcase.v1beta1.SearchBlurbsMetadata result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.showcase.v1beta1.SearchBlurbsMetadata buildPartial() { - com.google.showcase.v1beta1.SearchBlurbsMetadata result = new com.google.showcase.v1beta1.SearchBlurbsMetadata(this); - if (retryInfoBuilder_ == null) { - result.retryInfo_ = retryInfo_; - } else { - result.retryInfo_ = retryInfoBuilder_.build(); - } - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.setField(field, value); - } - @java.lang.Override - public Builder clearField( - com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - @java.lang.Override - public Builder clearOneof( - com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.addRepeatedField(field, value); - } - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof com.google.showcase.v1beta1.SearchBlurbsMetadata) { - return mergeFrom((com.google.showcase.v1beta1.SearchBlurbsMetadata)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.showcase.v1beta1.SearchBlurbsMetadata other) { - if (other == com.google.showcase.v1beta1.SearchBlurbsMetadata.getDefaultInstance()) return this; - if (other.hasRetryInfo()) { - mergeRetryInfo(other.getRetryInfo()); - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - com.google.showcase.v1beta1.SearchBlurbsMetadata parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (com.google.showcase.v1beta1.SearchBlurbsMetadata) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private com.google.rpc.RetryInfo retryInfo_; - private com.google.protobuf.SingleFieldBuilderV3< - com.google.rpc.RetryInfo, com.google.rpc.RetryInfo.Builder, com.google.rpc.RetryInfoOrBuilder> retryInfoBuilder_; - /** - *
        -     * This signals to the client when to next poll for response.
        -     * 
        - * - * .google.rpc.RetryInfo retry_info = 1; - * @return Whether the retryInfo field is set. - */ - public boolean hasRetryInfo() { - return retryInfoBuilder_ != null || retryInfo_ != null; - } - /** - *
        -     * This signals to the client when to next poll for response.
        -     * 
        - * - * .google.rpc.RetryInfo retry_info = 1; - * @return The retryInfo. - */ - public com.google.rpc.RetryInfo getRetryInfo() { - if (retryInfoBuilder_ == null) { - return retryInfo_ == null ? com.google.rpc.RetryInfo.getDefaultInstance() : retryInfo_; - } else { - return retryInfoBuilder_.getMessage(); - } - } - /** - *
        -     * This signals to the client when to next poll for response.
        -     * 
        - * - * .google.rpc.RetryInfo retry_info = 1; - */ - public Builder setRetryInfo(com.google.rpc.RetryInfo value) { - if (retryInfoBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - retryInfo_ = value; - onChanged(); - } else { - retryInfoBuilder_.setMessage(value); - } - - return this; - } - /** - *
        -     * This signals to the client when to next poll for response.
        -     * 
        - * - * .google.rpc.RetryInfo retry_info = 1; - */ - public Builder setRetryInfo( - com.google.rpc.RetryInfo.Builder builderForValue) { - if (retryInfoBuilder_ == null) { - retryInfo_ = builderForValue.build(); - onChanged(); - } else { - retryInfoBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - *
        -     * This signals to the client when to next poll for response.
        -     * 
        - * - * .google.rpc.RetryInfo retry_info = 1; - */ - public Builder mergeRetryInfo(com.google.rpc.RetryInfo value) { - if (retryInfoBuilder_ == null) { - if (retryInfo_ != null) { - retryInfo_ = - com.google.rpc.RetryInfo.newBuilder(retryInfo_).mergeFrom(value).buildPartial(); - } else { - retryInfo_ = value; - } - onChanged(); - } else { - retryInfoBuilder_.mergeFrom(value); - } - - return this; - } - /** - *
        -     * This signals to the client when to next poll for response.
        -     * 
        - * - * .google.rpc.RetryInfo retry_info = 1; - */ - public Builder clearRetryInfo() { - if (retryInfoBuilder_ == null) { - retryInfo_ = null; - onChanged(); - } else { - retryInfo_ = null; - retryInfoBuilder_ = null; - } - - return this; - } - /** - *
        -     * This signals to the client when to next poll for response.
        -     * 
        - * - * .google.rpc.RetryInfo retry_info = 1; - */ - public com.google.rpc.RetryInfo.Builder getRetryInfoBuilder() { - - onChanged(); - return getRetryInfoFieldBuilder().getBuilder(); - } - /** - *
        -     * This signals to the client when to next poll for response.
        -     * 
        - * - * .google.rpc.RetryInfo retry_info = 1; - */ - public com.google.rpc.RetryInfoOrBuilder getRetryInfoOrBuilder() { - if (retryInfoBuilder_ != null) { - return retryInfoBuilder_.getMessageOrBuilder(); - } else { - return retryInfo_ == null ? - com.google.rpc.RetryInfo.getDefaultInstance() : retryInfo_; - } - } - /** - *
        -     * This signals to the client when to next poll for response.
        -     * 
        - * - * .google.rpc.RetryInfo retry_info = 1; - */ - private com.google.protobuf.SingleFieldBuilderV3< - com.google.rpc.RetryInfo, com.google.rpc.RetryInfo.Builder, com.google.rpc.RetryInfoOrBuilder> - getRetryInfoFieldBuilder() { - if (retryInfoBuilder_ == null) { - retryInfoBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - com.google.rpc.RetryInfo, com.google.rpc.RetryInfo.Builder, com.google.rpc.RetryInfoOrBuilder>( - getRetryInfo(), - getParentForChildren(), - isClean()); - retryInfo_ = null; - } - return retryInfoBuilder_; - } - @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.showcase.v1beta1.SearchBlurbsMetadata) - } - - // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.SearchBlurbsMetadata) - private static final com.google.showcase.v1beta1.SearchBlurbsMetadata DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new com.google.showcase.v1beta1.SearchBlurbsMetadata(); - } - - public static com.google.showcase.v1beta1.SearchBlurbsMetadata getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public SearchBlurbsMetadata parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new SearchBlurbsMetadata(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public com.google.showcase.v1beta1.SearchBlurbsMetadata getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/SearchBlurbsMetadataOrBuilder.java b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/SearchBlurbsMetadataOrBuilder.java deleted file mode 100644 index d8bfeb513d..0000000000 --- a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/SearchBlurbsMetadataOrBuilder.java +++ /dev/null @@ -1,36 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: schema/google/showcase/v1beta1/messaging.proto - -package com.google.showcase.v1beta1; - -public interface SearchBlurbsMetadataOrBuilder extends - // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.SearchBlurbsMetadata) - com.google.protobuf.MessageOrBuilder { - - /** - *
        -   * This signals to the client when to next poll for response.
        -   * 
        - * - * .google.rpc.RetryInfo retry_info = 1; - * @return Whether the retryInfo field is set. - */ - boolean hasRetryInfo(); - /** - *
        -   * This signals to the client when to next poll for response.
        -   * 
        - * - * .google.rpc.RetryInfo retry_info = 1; - * @return The retryInfo. - */ - com.google.rpc.RetryInfo getRetryInfo(); - /** - *
        -   * This signals to the client when to next poll for response.
        -   * 
        - * - * .google.rpc.RetryInfo retry_info = 1; - */ - com.google.rpc.RetryInfoOrBuilder getRetryInfoOrBuilder(); -} diff --git a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/SearchBlurbsRequest.java b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/SearchBlurbsRequest.java deleted file mode 100644 index dffbdbea44..0000000000 --- a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/SearchBlurbsRequest.java +++ /dev/null @@ -1,1052 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: schema/google/showcase/v1beta1/messaging.proto - -package com.google.showcase.v1beta1; - -/** - *
        - * The request message for the google.showcase.v1beta1.Messaging\SearchBlurbs
        - * method.
        - * 
        - * - * Protobuf type {@code google.showcase.v1beta1.SearchBlurbsRequest} - */ -public final class SearchBlurbsRequest extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.SearchBlurbsRequest) - SearchBlurbsRequestOrBuilder { -private static final long serialVersionUID = 0L; - // Use SearchBlurbsRequest.newBuilder() to construct. - private SearchBlurbsRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private SearchBlurbsRequest() { - query_ = ""; - parent_ = ""; - pageToken_ = ""; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new SearchBlurbsRequest(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private SearchBlurbsRequest( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: { - java.lang.String s = input.readStringRequireUtf8(); - - query_ = s; - break; - } - case 18: { - java.lang.String s = input.readStringRequireUtf8(); - - parent_ = s; - break; - } - case 24: { - - pageSize_ = input.readInt32(); - break; - } - case 34: { - java.lang.String s = input.readStringRequireUtf8(); - - pageToken_ = s; - break; - } - default: { - if (!parseUnknownField( - input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException( - e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.google.showcase.v1beta1.MessagingOuterClass.internal_static_google_showcase_v1beta1_SearchBlurbsRequest_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.showcase.v1beta1.MessagingOuterClass.internal_static_google_showcase_v1beta1_SearchBlurbsRequest_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.showcase.v1beta1.SearchBlurbsRequest.class, com.google.showcase.v1beta1.SearchBlurbsRequest.Builder.class); - } - - public static final int QUERY_FIELD_NUMBER = 1; - private volatile java.lang.Object query_; - /** - *
        -   * The query used to search for blurbs containing to words of this string.
        -   * Only posts that contain an exact match of a queried word will be returned.
        -   * 
        - * - * string query = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return The query. - */ - @java.lang.Override - public java.lang.String getQuery() { - java.lang.Object ref = query_; - 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(); - query_ = s; - return s; - } - } - /** - *
        -   * The query used to search for blurbs containing to words of this string.
        -   * Only posts that contain an exact match of a queried word will be returned.
        -   * 
        - * - * string query = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return The bytes for query. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getQueryBytes() { - java.lang.Object ref = query_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - query_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int PARENT_FIELD_NUMBER = 2; - private volatile java.lang.Object parent_; - /** - *
        -   * The rooms or profiles to search. If unset, `SearchBlurbs` will search all
        -   * rooms and all profiles.
        -   * 
        - * - * string parent = 2 [(.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; - } - } - /** - *
        -   * The rooms or profiles to search. If unset, `SearchBlurbs` will search all
        -   * rooms and all profiles.
        -   * 
        - * - * string parent = 2 [(.google.api.resource_reference) = { ... } - * @return The bytes for parent. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getParentBytes() { - java.lang.Object ref = parent_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - parent_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int PAGE_SIZE_FIELD_NUMBER = 3; - private int pageSize_; - /** - *
        -   * The maximum number of blurbs return. Server may return fewer
        -   * blurbs than requested. If unspecified, server will pick an appropriate
        -   * default.
        -   * 
        - * - * int32 page_size = 3; - * @return The pageSize. - */ - @java.lang.Override - public int getPageSize() { - return pageSize_; - } - - public static final int PAGE_TOKEN_FIELD_NUMBER = 4; - private volatile java.lang.Object pageToken_; - /** - *
        -   * The value of
        -   * google.showcase.v1beta1.SearchBlurbsResponse.next_page_token
        -   * returned from the previous call to
        -   * `google.showcase.v1beta1.Messaging\SearchBlurbs` method.
        -   * 
        - * - * string page_token = 4; - * @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; - } - } - /** - *
        -   * The value of
        -   * google.showcase.v1beta1.SearchBlurbsResponse.next_page_token
        -   * returned from the previous call to
        -   * `google.showcase.v1beta1.Messaging\SearchBlurbs` method.
        -   * 
        - * - * string page_token = 4; - * @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(query_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, query_); - } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 2, parent_); - } - if (pageSize_ != 0) { - output.writeInt32(3, pageSize_); - } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(pageToken_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 4, pageToken_); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(query_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, query_); - } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, parent_); - } - if (pageSize_ != 0) { - size += com.google.protobuf.CodedOutputStream - .computeInt32Size(3, pageSize_); - } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(pageToken_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, pageToken_); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof com.google.showcase.v1beta1.SearchBlurbsRequest)) { - return super.equals(obj); - } - com.google.showcase.v1beta1.SearchBlurbsRequest other = (com.google.showcase.v1beta1.SearchBlurbsRequest) obj; - - if (!getQuery() - .equals(other.getQuery())) return false; - if (!getParent() - .equals(other.getParent())) return false; - if (getPageSize() - != other.getPageSize()) return false; - if (!getPageToken() - .equals(other.getPageToken())) return false; - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - hash = (37 * hash) + QUERY_FIELD_NUMBER; - hash = (53 * hash) + getQuery().hashCode(); - hash = (37 * hash) + PARENT_FIELD_NUMBER; - hash = (53 * hash) + getParent().hashCode(); - hash = (37 * hash) + PAGE_SIZE_FIELD_NUMBER; - hash = (53 * hash) + getPageSize(); - hash = (37 * hash) + PAGE_TOKEN_FIELD_NUMBER; - hash = (53 * hash) + getPageToken().hashCode(); - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.showcase.v1beta1.SearchBlurbsRequest parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.showcase.v1beta1.SearchBlurbsRequest parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.showcase.v1beta1.SearchBlurbsRequest parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.showcase.v1beta1.SearchBlurbsRequest 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.showcase.v1beta1.SearchBlurbsRequest parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.showcase.v1beta1.SearchBlurbsRequest parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.showcase.v1beta1.SearchBlurbsRequest parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static com.google.showcase.v1beta1.SearchBlurbsRequest 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.showcase.v1beta1.SearchBlurbsRequest parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static com.google.showcase.v1beta1.SearchBlurbsRequest 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.showcase.v1beta1.SearchBlurbsRequest parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static com.google.showcase.v1beta1.SearchBlurbsRequest 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.showcase.v1beta1.SearchBlurbsRequest 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 request message for the google.showcase.v1beta1.Messaging\SearchBlurbs
        -   * method.
        -   * 
        - * - * Protobuf type {@code google.showcase.v1beta1.SearchBlurbsRequest} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.SearchBlurbsRequest) - com.google.showcase.v1beta1.SearchBlurbsRequestOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.google.showcase.v1beta1.MessagingOuterClass.internal_static_google_showcase_v1beta1_SearchBlurbsRequest_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.showcase.v1beta1.MessagingOuterClass.internal_static_google_showcase_v1beta1_SearchBlurbsRequest_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.showcase.v1beta1.SearchBlurbsRequest.class, com.google.showcase.v1beta1.SearchBlurbsRequest.Builder.class); - } - - // Construct using com.google.showcase.v1beta1.SearchBlurbsRequest.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { - } - } - @java.lang.Override - public Builder clear() { - super.clear(); - query_ = ""; - - parent_ = ""; - - pageSize_ = 0; - - pageToken_ = ""; - - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return com.google.showcase.v1beta1.MessagingOuterClass.internal_static_google_showcase_v1beta1_SearchBlurbsRequest_descriptor; - } - - @java.lang.Override - public com.google.showcase.v1beta1.SearchBlurbsRequest getDefaultInstanceForType() { - return com.google.showcase.v1beta1.SearchBlurbsRequest.getDefaultInstance(); - } - - @java.lang.Override - public com.google.showcase.v1beta1.SearchBlurbsRequest build() { - com.google.showcase.v1beta1.SearchBlurbsRequest result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.showcase.v1beta1.SearchBlurbsRequest buildPartial() { - com.google.showcase.v1beta1.SearchBlurbsRequest result = new com.google.showcase.v1beta1.SearchBlurbsRequest(this); - result.query_ = query_; - result.parent_ = parent_; - result.pageSize_ = pageSize_; - result.pageToken_ = pageToken_; - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.setField(field, value); - } - @java.lang.Override - public Builder clearField( - com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - @java.lang.Override - public Builder clearOneof( - com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.addRepeatedField(field, value); - } - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof com.google.showcase.v1beta1.SearchBlurbsRequest) { - return mergeFrom((com.google.showcase.v1beta1.SearchBlurbsRequest)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.showcase.v1beta1.SearchBlurbsRequest other) { - if (other == com.google.showcase.v1beta1.SearchBlurbsRequest.getDefaultInstance()) return this; - if (!other.getQuery().isEmpty()) { - query_ = other.query_; - onChanged(); - } - if (!other.getParent().isEmpty()) { - parent_ = other.parent_; - onChanged(); - } - if (other.getPageSize() != 0) { - setPageSize(other.getPageSize()); - } - if (!other.getPageToken().isEmpty()) { - pageToken_ = other.pageToken_; - onChanged(); - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - com.google.showcase.v1beta1.SearchBlurbsRequest parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (com.google.showcase.v1beta1.SearchBlurbsRequest) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private java.lang.Object query_ = ""; - /** - *
        -     * The query used to search for blurbs containing to words of this string.
        -     * Only posts that contain an exact match of a queried word will be returned.
        -     * 
        - * - * string query = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return The query. - */ - public java.lang.String getQuery() { - java.lang.Object ref = query_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - query_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - *
        -     * The query used to search for blurbs containing to words of this string.
        -     * Only posts that contain an exact match of a queried word will be returned.
        -     * 
        - * - * string query = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return The bytes for query. - */ - public com.google.protobuf.ByteString - getQueryBytes() { - java.lang.Object ref = query_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - query_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - *
        -     * The query used to search for blurbs containing to words of this string.
        -     * Only posts that contain an exact match of a queried word will be returned.
        -     * 
        - * - * string query = 1 [(.google.api.field_behavior) = REQUIRED]; - * @param value The query to set. - * @return This builder for chaining. - */ - public Builder setQuery( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - query_ = value; - onChanged(); - return this; - } - /** - *
        -     * The query used to search for blurbs containing to words of this string.
        -     * Only posts that contain an exact match of a queried word will be returned.
        -     * 
        - * - * string query = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return This builder for chaining. - */ - public Builder clearQuery() { - - query_ = getDefaultInstance().getQuery(); - onChanged(); - return this; - } - /** - *
        -     * The query used to search for blurbs containing to words of this string.
        -     * Only posts that contain an exact match of a queried word will be returned.
        -     * 
        - * - * string query = 1 [(.google.api.field_behavior) = REQUIRED]; - * @param value The bytes for query to set. - * @return This builder for chaining. - */ - public Builder setQueryBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - query_ = value; - onChanged(); - return this; - } - - private java.lang.Object parent_ = ""; - /** - *
        -     * The rooms or profiles to search. If unset, `SearchBlurbs` will search all
        -     * rooms and all profiles.
        -     * 
        - * - * string parent = 2 [(.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; - } - } - /** - *
        -     * The rooms or profiles to search. If unset, `SearchBlurbs` will search all
        -     * rooms and all profiles.
        -     * 
        - * - * string parent = 2 [(.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; - } - } - /** - *
        -     * The rooms or profiles to search. If unset, `SearchBlurbs` will search all
        -     * rooms and all profiles.
        -     * 
        - * - * string parent = 2 [(.google.api.resource_reference) = { ... } - * @param value The parent to set. - * @return This builder for chaining. - */ - public Builder setParent( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - parent_ = value; - onChanged(); - return this; - } - /** - *
        -     * The rooms or profiles to search. If unset, `SearchBlurbs` will search all
        -     * rooms and all profiles.
        -     * 
        - * - * string parent = 2 [(.google.api.resource_reference) = { ... } - * @return This builder for chaining. - */ - public Builder clearParent() { - - parent_ = getDefaultInstance().getParent(); - onChanged(); - return this; - } - /** - *
        -     * The rooms or profiles to search. If unset, `SearchBlurbs` will search all
        -     * rooms and all profiles.
        -     * 
        - * - * string parent = 2 [(.google.api.resource_reference) = { ... } - * @param value The bytes for parent to set. - * @return This builder for chaining. - */ - public Builder setParentBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - parent_ = value; - onChanged(); - return this; - } - - private int pageSize_ ; - /** - *
        -     * The maximum number of blurbs return. Server may return fewer
        -     * blurbs than requested. If unspecified, server will pick an appropriate
        -     * default.
        -     * 
        - * - * int32 page_size = 3; - * @return The pageSize. - */ - @java.lang.Override - public int getPageSize() { - return pageSize_; - } - /** - *
        -     * The maximum number of blurbs return. Server may return fewer
        -     * blurbs than requested. If unspecified, server will pick an appropriate
        -     * default.
        -     * 
        - * - * int32 page_size = 3; - * @param value The pageSize to set. - * @return This builder for chaining. - */ - public Builder setPageSize(int value) { - - pageSize_ = value; - onChanged(); - return this; - } - /** - *
        -     * The maximum number of blurbs return. Server may return fewer
        -     * blurbs than requested. If unspecified, server will pick an appropriate
        -     * default.
        -     * 
        - * - * int32 page_size = 3; - * @return This builder for chaining. - */ - public Builder clearPageSize() { - - pageSize_ = 0; - onChanged(); - return this; - } - - private java.lang.Object pageToken_ = ""; - /** - *
        -     * The value of
        -     * google.showcase.v1beta1.SearchBlurbsResponse.next_page_token
        -     * returned from the previous call to
        -     * `google.showcase.v1beta1.Messaging\SearchBlurbs` method.
        -     * 
        - * - * string page_token = 4; - * @return The pageToken. - */ - public java.lang.String getPageToken() { - java.lang.Object ref = pageToken_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - pageToken_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - *
        -     * The value of
        -     * google.showcase.v1beta1.SearchBlurbsResponse.next_page_token
        -     * returned from the previous call to
        -     * `google.showcase.v1beta1.Messaging\SearchBlurbs` method.
        -     * 
        - * - * string page_token = 4; - * @return The bytes for pageToken. - */ - public com.google.protobuf.ByteString - getPageTokenBytes() { - java.lang.Object ref = pageToken_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - pageToken_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - *
        -     * The value of
        -     * google.showcase.v1beta1.SearchBlurbsResponse.next_page_token
        -     * returned from the previous call to
        -     * `google.showcase.v1beta1.Messaging\SearchBlurbs` method.
        -     * 
        - * - * string page_token = 4; - * @param value The pageToken to set. - * @return This builder for chaining. - */ - public Builder setPageToken( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - pageToken_ = value; - onChanged(); - return this; - } - /** - *
        -     * The value of
        -     * google.showcase.v1beta1.SearchBlurbsResponse.next_page_token
        -     * returned from the previous call to
        -     * `google.showcase.v1beta1.Messaging\SearchBlurbs` method.
        -     * 
        - * - * string page_token = 4; - * @return This builder for chaining. - */ - public Builder clearPageToken() { - - pageToken_ = getDefaultInstance().getPageToken(); - onChanged(); - return this; - } - /** - *
        -     * The value of
        -     * google.showcase.v1beta1.SearchBlurbsResponse.next_page_token
        -     * returned from the previous call to
        -     * `google.showcase.v1beta1.Messaging\SearchBlurbs` method.
        -     * 
        - * - * string page_token = 4; - * @param value The bytes for pageToken to set. - * @return This builder for chaining. - */ - public Builder setPageTokenBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - pageToken_ = value; - onChanged(); - return this; - } - @java.lang.Override - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - - // @@protoc_insertion_point(builder_scope:google.showcase.v1beta1.SearchBlurbsRequest) - } - - // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.SearchBlurbsRequest) - private static final com.google.showcase.v1beta1.SearchBlurbsRequest DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new com.google.showcase.v1beta1.SearchBlurbsRequest(); - } - - public static com.google.showcase.v1beta1.SearchBlurbsRequest getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public SearchBlurbsRequest parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new SearchBlurbsRequest(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public com.google.showcase.v1beta1.SearchBlurbsRequest getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/SearchBlurbsRequestOrBuilder.java b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/SearchBlurbsRequestOrBuilder.java deleted file mode 100644 index f3595e10a6..0000000000 --- a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/SearchBlurbsRequestOrBuilder.java +++ /dev/null @@ -1,91 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: schema/google/showcase/v1beta1/messaging.proto - -package com.google.showcase.v1beta1; - -public interface SearchBlurbsRequestOrBuilder extends - // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.SearchBlurbsRequest) - com.google.protobuf.MessageOrBuilder { - - /** - *
        -   * The query used to search for blurbs containing to words of this string.
        -   * Only posts that contain an exact match of a queried word will be returned.
        -   * 
        - * - * string query = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return The query. - */ - java.lang.String getQuery(); - /** - *
        -   * The query used to search for blurbs containing to words of this string.
        -   * Only posts that contain an exact match of a queried word will be returned.
        -   * 
        - * - * string query = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return The bytes for query. - */ - com.google.protobuf.ByteString - getQueryBytes(); - - /** - *
        -   * The rooms or profiles to search. If unset, `SearchBlurbs` will search all
        -   * rooms and all profiles.
        -   * 
        - * - * string parent = 2 [(.google.api.resource_reference) = { ... } - * @return The parent. - */ - java.lang.String getParent(); - /** - *
        -   * The rooms or profiles to search. If unset, `SearchBlurbs` will search all
        -   * rooms and all profiles.
        -   * 
        - * - * string parent = 2 [(.google.api.resource_reference) = { ... } - * @return The bytes for parent. - */ - com.google.protobuf.ByteString - getParentBytes(); - - /** - *
        -   * The maximum number of blurbs return. Server may return fewer
        -   * blurbs than requested. If unspecified, server will pick an appropriate
        -   * default.
        -   * 
        - * - * int32 page_size = 3; - * @return The pageSize. - */ - int getPageSize(); - - /** - *
        -   * The value of
        -   * google.showcase.v1beta1.SearchBlurbsResponse.next_page_token
        -   * returned from the previous call to
        -   * `google.showcase.v1beta1.Messaging\SearchBlurbs` method.
        -   * 
        - * - * string page_token = 4; - * @return The pageToken. - */ - java.lang.String getPageToken(); - /** - *
        -   * The value of
        -   * google.showcase.v1beta1.SearchBlurbsResponse.next_page_token
        -   * returned from the previous call to
        -   * `google.showcase.v1beta1.Messaging\SearchBlurbs` method.
        -   * 
        - * - * string page_token = 4; - * @return The bytes for pageToken. - */ - com.google.protobuf.ByteString - getPageTokenBytes(); -} diff --git a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/SearchBlurbsResponse.java b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/SearchBlurbsResponse.java deleted file mode 100644 index 92d87c30de..0000000000 --- a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/SearchBlurbsResponse.java +++ /dev/null @@ -1,1061 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: schema/google/showcase/v1beta1/messaging.proto - -package com.google.showcase.v1beta1; - -/** - *
        - * The operation response message for the
        - * google.showcase.v1beta1.Messaging\SearchBlurbs method.
        - * 
        - * - * Protobuf type {@code google.showcase.v1beta1.SearchBlurbsResponse} - */ -public final class SearchBlurbsResponse extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.SearchBlurbsResponse) - SearchBlurbsResponseOrBuilder { -private static final long serialVersionUID = 0L; - // Use SearchBlurbsResponse.newBuilder() to construct. - private SearchBlurbsResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private SearchBlurbsResponse() { - blurbs_ = java.util.Collections.emptyList(); - nextPageToken_ = ""; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new SearchBlurbsResponse(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private SearchBlurbsResponse( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - int mutable_bitField0_ = 0; - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: { - if (!((mutable_bitField0_ & 0x00000001) != 0)) { - blurbs_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000001; - } - blurbs_.add( - input.readMessage(com.google.showcase.v1beta1.Blurb.parser(), extensionRegistry)); - break; - } - case 18: { - java.lang.String s = input.readStringRequireUtf8(); - - nextPageToken_ = s; - break; - } - default: { - if (!parseUnknownField( - input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException( - e).setUnfinishedMessage(this); - } finally { - if (((mutable_bitField0_ & 0x00000001) != 0)) { - blurbs_ = java.util.Collections.unmodifiableList(blurbs_); - } - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.google.showcase.v1beta1.MessagingOuterClass.internal_static_google_showcase_v1beta1_SearchBlurbsResponse_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.showcase.v1beta1.MessagingOuterClass.internal_static_google_showcase_v1beta1_SearchBlurbsResponse_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.showcase.v1beta1.SearchBlurbsResponse.class, com.google.showcase.v1beta1.SearchBlurbsResponse.Builder.class); - } - - public static final int BLURBS_FIELD_NUMBER = 1; - private java.util.List blurbs_; - /** - *
        -   * Blurbs that matched the search query.
        -   * 
        - * - * repeated .google.showcase.v1beta1.Blurb blurbs = 1; - */ - @java.lang.Override - public java.util.List getBlurbsList() { - return blurbs_; - } - /** - *
        -   * Blurbs that matched the search query.
        -   * 
        - * - * repeated .google.showcase.v1beta1.Blurb blurbs = 1; - */ - @java.lang.Override - public java.util.List - getBlurbsOrBuilderList() { - return blurbs_; - } - /** - *
        -   * Blurbs that matched the search query.
        -   * 
        - * - * repeated .google.showcase.v1beta1.Blurb blurbs = 1; - */ - @java.lang.Override - public int getBlurbsCount() { - return blurbs_.size(); - } - /** - *
        -   * Blurbs that matched the search query.
        -   * 
        - * - * repeated .google.showcase.v1beta1.Blurb blurbs = 1; - */ - @java.lang.Override - public com.google.showcase.v1beta1.Blurb getBlurbs(int index) { - return blurbs_.get(index); - } - /** - *
        -   * Blurbs that matched the search query.
        -   * 
        - * - * repeated .google.showcase.v1beta1.Blurb blurbs = 1; - */ - @java.lang.Override - public com.google.showcase.v1beta1.BlurbOrBuilder getBlurbsOrBuilder( - int index) { - return blurbs_.get(index); - } - - public static final int NEXT_PAGE_TOKEN_FIELD_NUMBER = 2; - private volatile java.lang.Object nextPageToken_; - /** - *
        -   * A token to retrieve next page of results.
        -   * Pass this value in SearchBlurbsRequest.page_token field in the subsequent
        -   * call to `google.showcase.v1beta1.Blurb\SearchBlurbs` method to
        -   * retrieve the next page of results.
        -   * 
        - * - * string next_page_token = 2; - * @return The nextPageToken. - */ - @java.lang.Override - public java.lang.String getNextPageToken() { - java.lang.Object ref = nextPageToken_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - nextPageToken_ = s; - return s; - } - } - /** - *
        -   * A token to retrieve next page of results.
        -   * Pass this value in SearchBlurbsRequest.page_token field in the subsequent
        -   * call to `google.showcase.v1beta1.Blurb\SearchBlurbs` method to
        -   * retrieve the next page of results.
        -   * 
        - * - * string next_page_token = 2; - * @return The bytes for nextPageToken. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getNextPageTokenBytes() { - java.lang.Object ref = nextPageToken_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - nextPageToken_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - private byte memoizedIsInitialized = -1; - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - for (int i = 0; i < blurbs_.size(); i++) { - output.writeMessage(1, blurbs_.get(i)); - } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nextPageToken_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 2, nextPageToken_); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - for (int i = 0; i < blurbs_.size(); i++) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(1, blurbs_.get(i)); - } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nextPageToken_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, nextPageToken_); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof com.google.showcase.v1beta1.SearchBlurbsResponse)) { - return super.equals(obj); - } - com.google.showcase.v1beta1.SearchBlurbsResponse other = (com.google.showcase.v1beta1.SearchBlurbsResponse) obj; - - if (!getBlurbsList() - .equals(other.getBlurbsList())) return false; - if (!getNextPageToken() - .equals(other.getNextPageToken())) return false; - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - if (getBlurbsCount() > 0) { - hash = (37 * hash) + BLURBS_FIELD_NUMBER; - hash = (53 * hash) + getBlurbsList().hashCode(); - } - hash = (37 * hash) + NEXT_PAGE_TOKEN_FIELD_NUMBER; - hash = (53 * hash) + getNextPageToken().hashCode(); - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.showcase.v1beta1.SearchBlurbsResponse parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.showcase.v1beta1.SearchBlurbsResponse parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.showcase.v1beta1.SearchBlurbsResponse parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.showcase.v1beta1.SearchBlurbsResponse 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.showcase.v1beta1.SearchBlurbsResponse parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.showcase.v1beta1.SearchBlurbsResponse parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.showcase.v1beta1.SearchBlurbsResponse parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static com.google.showcase.v1beta1.SearchBlurbsResponse 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.showcase.v1beta1.SearchBlurbsResponse parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static com.google.showcase.v1beta1.SearchBlurbsResponse 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.showcase.v1beta1.SearchBlurbsResponse parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static com.google.showcase.v1beta1.SearchBlurbsResponse 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.showcase.v1beta1.SearchBlurbsResponse 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 operation response message for the
        -   * google.showcase.v1beta1.Messaging\SearchBlurbs method.
        -   * 
        - * - * Protobuf type {@code google.showcase.v1beta1.SearchBlurbsResponse} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.SearchBlurbsResponse) - com.google.showcase.v1beta1.SearchBlurbsResponseOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.google.showcase.v1beta1.MessagingOuterClass.internal_static_google_showcase_v1beta1_SearchBlurbsResponse_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.showcase.v1beta1.MessagingOuterClass.internal_static_google_showcase_v1beta1_SearchBlurbsResponse_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.showcase.v1beta1.SearchBlurbsResponse.class, com.google.showcase.v1beta1.SearchBlurbsResponse.Builder.class); - } - - // Construct using com.google.showcase.v1beta1.SearchBlurbsResponse.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { - getBlurbsFieldBuilder(); - } - } - @java.lang.Override - public Builder clear() { - super.clear(); - if (blurbsBuilder_ == null) { - blurbs_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - } else { - blurbsBuilder_.clear(); - } - nextPageToken_ = ""; - - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return com.google.showcase.v1beta1.MessagingOuterClass.internal_static_google_showcase_v1beta1_SearchBlurbsResponse_descriptor; - } - - @java.lang.Override - public com.google.showcase.v1beta1.SearchBlurbsResponse getDefaultInstanceForType() { - return com.google.showcase.v1beta1.SearchBlurbsResponse.getDefaultInstance(); - } - - @java.lang.Override - public com.google.showcase.v1beta1.SearchBlurbsResponse build() { - com.google.showcase.v1beta1.SearchBlurbsResponse result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.showcase.v1beta1.SearchBlurbsResponse buildPartial() { - com.google.showcase.v1beta1.SearchBlurbsResponse result = new com.google.showcase.v1beta1.SearchBlurbsResponse(this); - int from_bitField0_ = bitField0_; - if (blurbsBuilder_ == null) { - if (((bitField0_ & 0x00000001) != 0)) { - blurbs_ = java.util.Collections.unmodifiableList(blurbs_); - bitField0_ = (bitField0_ & ~0x00000001); - } - result.blurbs_ = blurbs_; - } else { - result.blurbs_ = blurbsBuilder_.build(); - } - result.nextPageToken_ = nextPageToken_; - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.setField(field, value); - } - @java.lang.Override - public Builder clearField( - com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - @java.lang.Override - public Builder clearOneof( - com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.addRepeatedField(field, value); - } - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof com.google.showcase.v1beta1.SearchBlurbsResponse) { - return mergeFrom((com.google.showcase.v1beta1.SearchBlurbsResponse)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.showcase.v1beta1.SearchBlurbsResponse other) { - if (other == com.google.showcase.v1beta1.SearchBlurbsResponse.getDefaultInstance()) return this; - if (blurbsBuilder_ == null) { - if (!other.blurbs_.isEmpty()) { - if (blurbs_.isEmpty()) { - blurbs_ = other.blurbs_; - bitField0_ = (bitField0_ & ~0x00000001); - } else { - ensureBlurbsIsMutable(); - blurbs_.addAll(other.blurbs_); - } - onChanged(); - } - } else { - if (!other.blurbs_.isEmpty()) { - if (blurbsBuilder_.isEmpty()) { - blurbsBuilder_.dispose(); - blurbsBuilder_ = null; - blurbs_ = other.blurbs_; - bitField0_ = (bitField0_ & ~0x00000001); - blurbsBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? - getBlurbsFieldBuilder() : null; - } else { - blurbsBuilder_.addAllMessages(other.blurbs_); - } - } - } - if (!other.getNextPageToken().isEmpty()) { - nextPageToken_ = other.nextPageToken_; - onChanged(); - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - com.google.showcase.v1beta1.SearchBlurbsResponse parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (com.google.showcase.v1beta1.SearchBlurbsResponse) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - private int bitField0_; - - private java.util.List blurbs_ = - java.util.Collections.emptyList(); - private void ensureBlurbsIsMutable() { - if (!((bitField0_ & 0x00000001) != 0)) { - blurbs_ = new java.util.ArrayList(blurbs_); - bitField0_ |= 0x00000001; - } - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - com.google.showcase.v1beta1.Blurb, com.google.showcase.v1beta1.Blurb.Builder, com.google.showcase.v1beta1.BlurbOrBuilder> blurbsBuilder_; - - /** - *
        -     * Blurbs that matched the search query.
        -     * 
        - * - * repeated .google.showcase.v1beta1.Blurb blurbs = 1; - */ - public java.util.List getBlurbsList() { - if (blurbsBuilder_ == null) { - return java.util.Collections.unmodifiableList(blurbs_); - } else { - return blurbsBuilder_.getMessageList(); - } - } - /** - *
        -     * Blurbs that matched the search query.
        -     * 
        - * - * repeated .google.showcase.v1beta1.Blurb blurbs = 1; - */ - public int getBlurbsCount() { - if (blurbsBuilder_ == null) { - return blurbs_.size(); - } else { - return blurbsBuilder_.getCount(); - } - } - /** - *
        -     * Blurbs that matched the search query.
        -     * 
        - * - * repeated .google.showcase.v1beta1.Blurb blurbs = 1; - */ - public com.google.showcase.v1beta1.Blurb getBlurbs(int index) { - if (blurbsBuilder_ == null) { - return blurbs_.get(index); - } else { - return blurbsBuilder_.getMessage(index); - } - } - /** - *
        -     * Blurbs that matched the search query.
        -     * 
        - * - * repeated .google.showcase.v1beta1.Blurb blurbs = 1; - */ - public Builder setBlurbs( - int index, com.google.showcase.v1beta1.Blurb value) { - if (blurbsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureBlurbsIsMutable(); - blurbs_.set(index, value); - onChanged(); - } else { - blurbsBuilder_.setMessage(index, value); - } - return this; - } - /** - *
        -     * Blurbs that matched the search query.
        -     * 
        - * - * repeated .google.showcase.v1beta1.Blurb blurbs = 1; - */ - public Builder setBlurbs( - int index, com.google.showcase.v1beta1.Blurb.Builder builderForValue) { - if (blurbsBuilder_ == null) { - ensureBlurbsIsMutable(); - blurbs_.set(index, builderForValue.build()); - onChanged(); - } else { - blurbsBuilder_.setMessage(index, builderForValue.build()); - } - return this; - } - /** - *
        -     * Blurbs that matched the search query.
        -     * 
        - * - * repeated .google.showcase.v1beta1.Blurb blurbs = 1; - */ - public Builder addBlurbs(com.google.showcase.v1beta1.Blurb value) { - if (blurbsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureBlurbsIsMutable(); - blurbs_.add(value); - onChanged(); - } else { - blurbsBuilder_.addMessage(value); - } - return this; - } - /** - *
        -     * Blurbs that matched the search query.
        -     * 
        - * - * repeated .google.showcase.v1beta1.Blurb blurbs = 1; - */ - public Builder addBlurbs( - int index, com.google.showcase.v1beta1.Blurb value) { - if (blurbsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureBlurbsIsMutable(); - blurbs_.add(index, value); - onChanged(); - } else { - blurbsBuilder_.addMessage(index, value); - } - return this; - } - /** - *
        -     * Blurbs that matched the search query.
        -     * 
        - * - * repeated .google.showcase.v1beta1.Blurb blurbs = 1; - */ - public Builder addBlurbs( - com.google.showcase.v1beta1.Blurb.Builder builderForValue) { - if (blurbsBuilder_ == null) { - ensureBlurbsIsMutable(); - blurbs_.add(builderForValue.build()); - onChanged(); - } else { - blurbsBuilder_.addMessage(builderForValue.build()); - } - return this; - } - /** - *
        -     * Blurbs that matched the search query.
        -     * 
        - * - * repeated .google.showcase.v1beta1.Blurb blurbs = 1; - */ - public Builder addBlurbs( - int index, com.google.showcase.v1beta1.Blurb.Builder builderForValue) { - if (blurbsBuilder_ == null) { - ensureBlurbsIsMutable(); - blurbs_.add(index, builderForValue.build()); - onChanged(); - } else { - blurbsBuilder_.addMessage(index, builderForValue.build()); - } - return this; - } - /** - *
        -     * Blurbs that matched the search query.
        -     * 
        - * - * repeated .google.showcase.v1beta1.Blurb blurbs = 1; - */ - public Builder addAllBlurbs( - java.lang.Iterable values) { - if (blurbsBuilder_ == null) { - ensureBlurbsIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, blurbs_); - onChanged(); - } else { - blurbsBuilder_.addAllMessages(values); - } - return this; - } - /** - *
        -     * Blurbs that matched the search query.
        -     * 
        - * - * repeated .google.showcase.v1beta1.Blurb blurbs = 1; - */ - public Builder clearBlurbs() { - if (blurbsBuilder_ == null) { - blurbs_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - onChanged(); - } else { - blurbsBuilder_.clear(); - } - return this; - } - /** - *
        -     * Blurbs that matched the search query.
        -     * 
        - * - * repeated .google.showcase.v1beta1.Blurb blurbs = 1; - */ - public Builder removeBlurbs(int index) { - if (blurbsBuilder_ == null) { - ensureBlurbsIsMutable(); - blurbs_.remove(index); - onChanged(); - } else { - blurbsBuilder_.remove(index); - } - return this; - } - /** - *
        -     * Blurbs that matched the search query.
        -     * 
        - * - * repeated .google.showcase.v1beta1.Blurb blurbs = 1; - */ - public com.google.showcase.v1beta1.Blurb.Builder getBlurbsBuilder( - int index) { - return getBlurbsFieldBuilder().getBuilder(index); - } - /** - *
        -     * Blurbs that matched the search query.
        -     * 
        - * - * repeated .google.showcase.v1beta1.Blurb blurbs = 1; - */ - public com.google.showcase.v1beta1.BlurbOrBuilder getBlurbsOrBuilder( - int index) { - if (blurbsBuilder_ == null) { - return blurbs_.get(index); } else { - return blurbsBuilder_.getMessageOrBuilder(index); - } - } - /** - *
        -     * Blurbs that matched the search query.
        -     * 
        - * - * repeated .google.showcase.v1beta1.Blurb blurbs = 1; - */ - public java.util.List - getBlurbsOrBuilderList() { - if (blurbsBuilder_ != null) { - return blurbsBuilder_.getMessageOrBuilderList(); - } else { - return java.util.Collections.unmodifiableList(blurbs_); - } - } - /** - *
        -     * Blurbs that matched the search query.
        -     * 
        - * - * repeated .google.showcase.v1beta1.Blurb blurbs = 1; - */ - public com.google.showcase.v1beta1.Blurb.Builder addBlurbsBuilder() { - return getBlurbsFieldBuilder().addBuilder( - com.google.showcase.v1beta1.Blurb.getDefaultInstance()); - } - /** - *
        -     * Blurbs that matched the search query.
        -     * 
        - * - * repeated .google.showcase.v1beta1.Blurb blurbs = 1; - */ - public com.google.showcase.v1beta1.Blurb.Builder addBlurbsBuilder( - int index) { - return getBlurbsFieldBuilder().addBuilder( - index, com.google.showcase.v1beta1.Blurb.getDefaultInstance()); - } - /** - *
        -     * Blurbs that matched the search query.
        -     * 
        - * - * repeated .google.showcase.v1beta1.Blurb blurbs = 1; - */ - public java.util.List - getBlurbsBuilderList() { - return getBlurbsFieldBuilder().getBuilderList(); - } - private com.google.protobuf.RepeatedFieldBuilderV3< - com.google.showcase.v1beta1.Blurb, com.google.showcase.v1beta1.Blurb.Builder, com.google.showcase.v1beta1.BlurbOrBuilder> - getBlurbsFieldBuilder() { - if (blurbsBuilder_ == null) { - blurbsBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< - com.google.showcase.v1beta1.Blurb, com.google.showcase.v1beta1.Blurb.Builder, com.google.showcase.v1beta1.BlurbOrBuilder>( - blurbs_, - ((bitField0_ & 0x00000001) != 0), - getParentForChildren(), - isClean()); - blurbs_ = null; - } - return blurbsBuilder_; - } - - private java.lang.Object nextPageToken_ = ""; - /** - *
        -     * A token to retrieve next page of results.
        -     * Pass this value in SearchBlurbsRequest.page_token field in the subsequent
        -     * call to `google.showcase.v1beta1.Blurb\SearchBlurbs` method to
        -     * retrieve the next page of results.
        -     * 
        - * - * string next_page_token = 2; - * @return The nextPageToken. - */ - public java.lang.String getNextPageToken() { - java.lang.Object ref = nextPageToken_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - nextPageToken_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - *
        -     * A token to retrieve next page of results.
        -     * Pass this value in SearchBlurbsRequest.page_token field in the subsequent
        -     * call to `google.showcase.v1beta1.Blurb\SearchBlurbs` method to
        -     * retrieve the next page of results.
        -     * 
        - * - * string next_page_token = 2; - * @return The bytes for nextPageToken. - */ - public com.google.protobuf.ByteString - getNextPageTokenBytes() { - java.lang.Object ref = nextPageToken_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - nextPageToken_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - *
        -     * A token to retrieve next page of results.
        -     * Pass this value in SearchBlurbsRequest.page_token field in the subsequent
        -     * call to `google.showcase.v1beta1.Blurb\SearchBlurbs` method to
        -     * retrieve the next page of results.
        -     * 
        - * - * string next_page_token = 2; - * @param value The nextPageToken to set. - * @return This builder for chaining. - */ - public Builder setNextPageToken( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - nextPageToken_ = value; - onChanged(); - return this; - } - /** - *
        -     * A token to retrieve next page of results.
        -     * Pass this value in SearchBlurbsRequest.page_token field in the subsequent
        -     * call to `google.showcase.v1beta1.Blurb\SearchBlurbs` method to
        -     * retrieve the next page of results.
        -     * 
        - * - * string next_page_token = 2; - * @return This builder for chaining. - */ - public Builder clearNextPageToken() { - - nextPageToken_ = getDefaultInstance().getNextPageToken(); - onChanged(); - return this; - } - /** - *
        -     * A token to retrieve next page of results.
        -     * Pass this value in SearchBlurbsRequest.page_token field in the subsequent
        -     * call to `google.showcase.v1beta1.Blurb\SearchBlurbs` method to
        -     * retrieve the next page of results.
        -     * 
        - * - * string next_page_token = 2; - * @param value The bytes for nextPageToken to set. - * @return This builder for chaining. - */ - public Builder setNextPageTokenBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - nextPageToken_ = value; - onChanged(); - return this; - } - @java.lang.Override - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - - // @@protoc_insertion_point(builder_scope:google.showcase.v1beta1.SearchBlurbsResponse) - } - - // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.SearchBlurbsResponse) - private static final com.google.showcase.v1beta1.SearchBlurbsResponse DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new com.google.showcase.v1beta1.SearchBlurbsResponse(); - } - - public static com.google.showcase.v1beta1.SearchBlurbsResponse getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public SearchBlurbsResponse parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new SearchBlurbsResponse(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public com.google.showcase.v1beta1.SearchBlurbsResponse getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/SearchBlurbsResponseOrBuilder.java b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/SearchBlurbsResponseOrBuilder.java deleted file mode 100644 index a7c08ee712..0000000000 --- a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/SearchBlurbsResponseOrBuilder.java +++ /dev/null @@ -1,79 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: schema/google/showcase/v1beta1/messaging.proto - -package com.google.showcase.v1beta1; - -public interface SearchBlurbsResponseOrBuilder extends - // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.SearchBlurbsResponse) - com.google.protobuf.MessageOrBuilder { - - /** - *
        -   * Blurbs that matched the search query.
        -   * 
        - * - * repeated .google.showcase.v1beta1.Blurb blurbs = 1; - */ - java.util.List - getBlurbsList(); - /** - *
        -   * Blurbs that matched the search query.
        -   * 
        - * - * repeated .google.showcase.v1beta1.Blurb blurbs = 1; - */ - com.google.showcase.v1beta1.Blurb getBlurbs(int index); - /** - *
        -   * Blurbs that matched the search query.
        -   * 
        - * - * repeated .google.showcase.v1beta1.Blurb blurbs = 1; - */ - int getBlurbsCount(); - /** - *
        -   * Blurbs that matched the search query.
        -   * 
        - * - * repeated .google.showcase.v1beta1.Blurb blurbs = 1; - */ - java.util.List - getBlurbsOrBuilderList(); - /** - *
        -   * Blurbs that matched the search query.
        -   * 
        - * - * repeated .google.showcase.v1beta1.Blurb blurbs = 1; - */ - com.google.showcase.v1beta1.BlurbOrBuilder getBlurbsOrBuilder( - int index); - - /** - *
        -   * A token to retrieve next page of results.
        -   * Pass this value in SearchBlurbsRequest.page_token field in the subsequent
        -   * call to `google.showcase.v1beta1.Blurb\SearchBlurbs` method to
        -   * retrieve the next page of results.
        -   * 
        - * - * string next_page_token = 2; - * @return The nextPageToken. - */ - java.lang.String getNextPageToken(); - /** - *
        -   * A token to retrieve next page of results.
        -   * Pass this value in SearchBlurbsRequest.page_token field in the subsequent
        -   * call to `google.showcase.v1beta1.Blurb\SearchBlurbs` method to
        -   * retrieve the next page of results.
        -   * 
        - * - * string next_page_token = 2; - * @return The bytes for nextPageToken. - */ - com.google.protobuf.ByteString - getNextPageTokenBytes(); -} diff --git a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/SendBlurbsResponse.java b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/SendBlurbsResponse.java deleted file mode 100644 index d00a32be06..0000000000 --- a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/SendBlurbsResponse.java +++ /dev/null @@ -1,678 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: schema/google/showcase/v1beta1/messaging.proto - -package com.google.showcase.v1beta1; - -/** - *
        - * The response message for the google.showcase.v1beta1.Messaging\SendBlurbs
        - * method.
        - * 
        - * - * Protobuf type {@code google.showcase.v1beta1.SendBlurbsResponse} - */ -public final class SendBlurbsResponse extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.SendBlurbsResponse) - SendBlurbsResponseOrBuilder { -private static final long serialVersionUID = 0L; - // Use SendBlurbsResponse.newBuilder() to construct. - private SendBlurbsResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private SendBlurbsResponse() { - names_ = com.google.protobuf.LazyStringArrayList.EMPTY; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new SendBlurbsResponse(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private SendBlurbsResponse( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - int mutable_bitField0_ = 0; - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: { - java.lang.String s = input.readStringRequireUtf8(); - if (!((mutable_bitField0_ & 0x00000001) != 0)) { - names_ = new com.google.protobuf.LazyStringArrayList(); - mutable_bitField0_ |= 0x00000001; - } - names_.add(s); - break; - } - default: { - if (!parseUnknownField( - input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException( - e).setUnfinishedMessage(this); - } finally { - if (((mutable_bitField0_ & 0x00000001) != 0)) { - names_ = names_.getUnmodifiableView(); - } - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.google.showcase.v1beta1.MessagingOuterClass.internal_static_google_showcase_v1beta1_SendBlurbsResponse_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.showcase.v1beta1.MessagingOuterClass.internal_static_google_showcase_v1beta1_SendBlurbsResponse_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.showcase.v1beta1.SendBlurbsResponse.class, com.google.showcase.v1beta1.SendBlurbsResponse.Builder.class); - } - - public static final int NAMES_FIELD_NUMBER = 1; - private com.google.protobuf.LazyStringList names_; - /** - *
        -   * The names of successful blurb creations.
        -   * 
        - * - * repeated string names = 1; - * @return A list containing the names. - */ - public com.google.protobuf.ProtocolStringList - getNamesList() { - return names_; - } - /** - *
        -   * The names of successful blurb creations.
        -   * 
        - * - * repeated string names = 1; - * @return The count of names. - */ - public int getNamesCount() { - return names_.size(); - } - /** - *
        -   * The names of successful blurb creations.
        -   * 
        - * - * repeated string names = 1; - * @param index The index of the element to return. - * @return The names at the given index. - */ - public java.lang.String getNames(int index) { - return names_.get(index); - } - /** - *
        -   * The names of successful blurb creations.
        -   * 
        - * - * repeated string names = 1; - * @param index The index of the value to return. - * @return The bytes of the names at the given index. - */ - public com.google.protobuf.ByteString - getNamesBytes(int index) { - return names_.getByteString(index); - } - - private byte memoizedIsInitialized = -1; - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - for (int i = 0; i < names_.size(); i++) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, names_.getRaw(i)); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - { - int dataSize = 0; - for (int i = 0; i < names_.size(); i++) { - dataSize += computeStringSizeNoTag(names_.getRaw(i)); - } - size += dataSize; - size += 1 * getNamesList().size(); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof com.google.showcase.v1beta1.SendBlurbsResponse)) { - return super.equals(obj); - } - com.google.showcase.v1beta1.SendBlurbsResponse other = (com.google.showcase.v1beta1.SendBlurbsResponse) obj; - - if (!getNamesList() - .equals(other.getNamesList())) return false; - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - if (getNamesCount() > 0) { - hash = (37 * hash) + NAMES_FIELD_NUMBER; - hash = (53 * hash) + getNamesList().hashCode(); - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.showcase.v1beta1.SendBlurbsResponse parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.showcase.v1beta1.SendBlurbsResponse parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.showcase.v1beta1.SendBlurbsResponse parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.showcase.v1beta1.SendBlurbsResponse 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.showcase.v1beta1.SendBlurbsResponse parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.showcase.v1beta1.SendBlurbsResponse parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.showcase.v1beta1.SendBlurbsResponse parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static com.google.showcase.v1beta1.SendBlurbsResponse 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.showcase.v1beta1.SendBlurbsResponse parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static com.google.showcase.v1beta1.SendBlurbsResponse 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.showcase.v1beta1.SendBlurbsResponse parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static com.google.showcase.v1beta1.SendBlurbsResponse 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.showcase.v1beta1.SendBlurbsResponse 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 message for the google.showcase.v1beta1.Messaging\SendBlurbs
        -   * method.
        -   * 
        - * - * Protobuf type {@code google.showcase.v1beta1.SendBlurbsResponse} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.SendBlurbsResponse) - com.google.showcase.v1beta1.SendBlurbsResponseOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.google.showcase.v1beta1.MessagingOuterClass.internal_static_google_showcase_v1beta1_SendBlurbsResponse_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.showcase.v1beta1.MessagingOuterClass.internal_static_google_showcase_v1beta1_SendBlurbsResponse_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.showcase.v1beta1.SendBlurbsResponse.class, com.google.showcase.v1beta1.SendBlurbsResponse.Builder.class); - } - - // Construct using com.google.showcase.v1beta1.SendBlurbsResponse.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { - } - } - @java.lang.Override - public Builder clear() { - super.clear(); - names_ = com.google.protobuf.LazyStringArrayList.EMPTY; - bitField0_ = (bitField0_ & ~0x00000001); - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return com.google.showcase.v1beta1.MessagingOuterClass.internal_static_google_showcase_v1beta1_SendBlurbsResponse_descriptor; - } - - @java.lang.Override - public com.google.showcase.v1beta1.SendBlurbsResponse getDefaultInstanceForType() { - return com.google.showcase.v1beta1.SendBlurbsResponse.getDefaultInstance(); - } - - @java.lang.Override - public com.google.showcase.v1beta1.SendBlurbsResponse build() { - com.google.showcase.v1beta1.SendBlurbsResponse result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.showcase.v1beta1.SendBlurbsResponse buildPartial() { - com.google.showcase.v1beta1.SendBlurbsResponse result = new com.google.showcase.v1beta1.SendBlurbsResponse(this); - int from_bitField0_ = bitField0_; - if (((bitField0_ & 0x00000001) != 0)) { - names_ = names_.getUnmodifiableView(); - bitField0_ = (bitField0_ & ~0x00000001); - } - result.names_ = names_; - 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.showcase.v1beta1.SendBlurbsResponse) { - return mergeFrom((com.google.showcase.v1beta1.SendBlurbsResponse)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.showcase.v1beta1.SendBlurbsResponse other) { - if (other == com.google.showcase.v1beta1.SendBlurbsResponse.getDefaultInstance()) return this; - if (!other.names_.isEmpty()) { - if (names_.isEmpty()) { - names_ = other.names_; - bitField0_ = (bitField0_ & ~0x00000001); - } else { - ensureNamesIsMutable(); - names_.addAll(other.names_); - } - onChanged(); - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - com.google.showcase.v1beta1.SendBlurbsResponse parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (com.google.showcase.v1beta1.SendBlurbsResponse) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - private int bitField0_; - - private com.google.protobuf.LazyStringList names_ = com.google.protobuf.LazyStringArrayList.EMPTY; - private void ensureNamesIsMutable() { - if (!((bitField0_ & 0x00000001) != 0)) { - names_ = new com.google.protobuf.LazyStringArrayList(names_); - bitField0_ |= 0x00000001; - } - } - /** - *
        -     * The names of successful blurb creations.
        -     * 
        - * - * repeated string names = 1; - * @return A list containing the names. - */ - public com.google.protobuf.ProtocolStringList - getNamesList() { - return names_.getUnmodifiableView(); - } - /** - *
        -     * The names of successful blurb creations.
        -     * 
        - * - * repeated string names = 1; - * @return The count of names. - */ - public int getNamesCount() { - return names_.size(); - } - /** - *
        -     * The names of successful blurb creations.
        -     * 
        - * - * repeated string names = 1; - * @param index The index of the element to return. - * @return The names at the given index. - */ - public java.lang.String getNames(int index) { - return names_.get(index); - } - /** - *
        -     * The names of successful blurb creations.
        -     * 
        - * - * repeated string names = 1; - * @param index The index of the value to return. - * @return The bytes of the names at the given index. - */ - public com.google.protobuf.ByteString - getNamesBytes(int index) { - return names_.getByteString(index); - } - /** - *
        -     * The names of successful blurb creations.
        -     * 
        - * - * repeated string names = 1; - * @param index The index to set the value at. - * @param value The names to set. - * @return This builder for chaining. - */ - public Builder setNames( - int index, java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - ensureNamesIsMutable(); - names_.set(index, value); - onChanged(); - return this; - } - /** - *
        -     * The names of successful blurb creations.
        -     * 
        - * - * repeated string names = 1; - * @param value The names to add. - * @return This builder for chaining. - */ - public Builder addNames( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - ensureNamesIsMutable(); - names_.add(value); - onChanged(); - return this; - } - /** - *
        -     * The names of successful blurb creations.
        -     * 
        - * - * repeated string names = 1; - * @param values The names to add. - * @return This builder for chaining. - */ - public Builder addAllNames( - java.lang.Iterable values) { - ensureNamesIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, names_); - onChanged(); - return this; - } - /** - *
        -     * The names of successful blurb creations.
        -     * 
        - * - * repeated string names = 1; - * @return This builder for chaining. - */ - public Builder clearNames() { - names_ = com.google.protobuf.LazyStringArrayList.EMPTY; - bitField0_ = (bitField0_ & ~0x00000001); - onChanged(); - return this; - } - /** - *
        -     * The names of successful blurb creations.
        -     * 
        - * - * repeated string names = 1; - * @param value The bytes of the names to add. - * @return This builder for chaining. - */ - public Builder addNamesBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - ensureNamesIsMutable(); - names_.add(value); - onChanged(); - return this; - } - @java.lang.Override - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - - // @@protoc_insertion_point(builder_scope:google.showcase.v1beta1.SendBlurbsResponse) - } - - // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.SendBlurbsResponse) - private static final com.google.showcase.v1beta1.SendBlurbsResponse DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new com.google.showcase.v1beta1.SendBlurbsResponse(); - } - - public static com.google.showcase.v1beta1.SendBlurbsResponse getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public SendBlurbsResponse parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new SendBlurbsResponse(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public com.google.showcase.v1beta1.SendBlurbsResponse getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/SendBlurbsResponseOrBuilder.java b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/SendBlurbsResponseOrBuilder.java deleted file mode 100644 index 3de7bfaad7..0000000000 --- a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/SendBlurbsResponseOrBuilder.java +++ /dev/null @@ -1,50 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: schema/google/showcase/v1beta1/messaging.proto - -package com.google.showcase.v1beta1; - -public interface SendBlurbsResponseOrBuilder extends - // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.SendBlurbsResponse) - com.google.protobuf.MessageOrBuilder { - - /** - *
        -   * The names of successful blurb creations.
        -   * 
        - * - * repeated string names = 1; - * @return A list containing the names. - */ - java.util.List - getNamesList(); - /** - *
        -   * The names of successful blurb creations.
        -   * 
        - * - * repeated string names = 1; - * @return The count of names. - */ - int getNamesCount(); - /** - *
        -   * The names of successful blurb creations.
        -   * 
        - * - * repeated string names = 1; - * @param index The index of the element to return. - * @return The names at the given index. - */ - java.lang.String getNames(int index); - /** - *
        -   * The names of successful blurb creations.
        -   * 
        - * - * repeated string names = 1; - * @param index The index of the value to return. - * @return The bytes of the names at the given index. - */ - com.google.protobuf.ByteString - getNamesBytes(int index); -} diff --git a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/Sequence.java b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/Sequence.java deleted file mode 100644 index d90689e15a..0000000000 --- a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/Sequence.java +++ /dev/null @@ -1,1979 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: schema/google/showcase/v1beta1/sequence.proto - -package com.google.showcase.v1beta1; - -/** - * Protobuf type {@code google.showcase.v1beta1.Sequence} - */ -public final class Sequence extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.Sequence) - SequenceOrBuilder { -private static final long serialVersionUID = 0L; - // Use Sequence.newBuilder() to construct. - private Sequence(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private Sequence() { - name_ = ""; - responses_ = java.util.Collections.emptyList(); - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new Sequence(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private Sequence( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - int mutable_bitField0_ = 0; - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: { - java.lang.String s = input.readStringRequireUtf8(); - - name_ = s; - break; - } - case 18: { - if (!((mutable_bitField0_ & 0x00000001) != 0)) { - responses_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000001; - } - responses_.add( - input.readMessage(com.google.showcase.v1beta1.Sequence.Response.parser(), extensionRegistry)); - break; - } - default: { - if (!parseUnknownField( - input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException( - e).setUnfinishedMessage(this); - } finally { - if (((mutable_bitField0_ & 0x00000001) != 0)) { - responses_ = java.util.Collections.unmodifiableList(responses_); - } - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.google.showcase.v1beta1.SequenceOuterClass.internal_static_google_showcase_v1beta1_Sequence_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.showcase.v1beta1.SequenceOuterClass.internal_static_google_showcase_v1beta1_Sequence_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.showcase.v1beta1.Sequence.class, com.google.showcase.v1beta1.Sequence.Builder.class); - } - - public interface ResponseOrBuilder extends - // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.Sequence.Response) - com.google.protobuf.MessageOrBuilder { - - /** - *
        -     * The status to return for an individual attempt.
        -     * 
        - * - * .google.rpc.Status status = 1; - * @return Whether the status field is set. - */ - boolean hasStatus(); - /** - *
        -     * The status to return for an individual attempt.
        -     * 
        - * - * .google.rpc.Status status = 1; - * @return The status. - */ - com.google.rpc.Status getStatus(); - /** - *
        -     * The status to return for an individual attempt.
        -     * 
        - * - * .google.rpc.Status status = 1; - */ - com.google.rpc.StatusOrBuilder getStatusOrBuilder(); - - /** - *
        -     * The amount of time to delay sending the response.
        -     * 
        - * - * .google.protobuf.Duration delay = 2; - * @return Whether the delay field is set. - */ - boolean hasDelay(); - /** - *
        -     * The amount of time to delay sending the response.
        -     * 
        - * - * .google.protobuf.Duration delay = 2; - * @return The delay. - */ - com.google.protobuf.Duration getDelay(); - /** - *
        -     * The amount of time to delay sending the response.
        -     * 
        - * - * .google.protobuf.Duration delay = 2; - */ - com.google.protobuf.DurationOrBuilder getDelayOrBuilder(); - } - /** - *
        -   * A server response to an RPC Attempt in a sequence.
        -   * 
        - * - * Protobuf type {@code google.showcase.v1beta1.Sequence.Response} - */ - public static final class Response extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.Sequence.Response) - ResponseOrBuilder { - private static final long serialVersionUID = 0L; - // Use Response.newBuilder() to construct. - private Response(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private Response() { - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new Response(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private Response( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: { - com.google.rpc.Status.Builder subBuilder = null; - if (status_ != null) { - subBuilder = status_.toBuilder(); - } - status_ = input.readMessage(com.google.rpc.Status.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(status_); - status_ = subBuilder.buildPartial(); - } - - break; - } - case 18: { - com.google.protobuf.Duration.Builder subBuilder = null; - if (delay_ != null) { - subBuilder = delay_.toBuilder(); - } - delay_ = input.readMessage(com.google.protobuf.Duration.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(delay_); - delay_ = subBuilder.buildPartial(); - } - - break; - } - default: { - if (!parseUnknownField( - input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException( - e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.google.showcase.v1beta1.SequenceOuterClass.internal_static_google_showcase_v1beta1_Sequence_Response_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.showcase.v1beta1.SequenceOuterClass.internal_static_google_showcase_v1beta1_Sequence_Response_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.showcase.v1beta1.Sequence.Response.class, com.google.showcase.v1beta1.Sequence.Response.Builder.class); - } - - public static final int STATUS_FIELD_NUMBER = 1; - private com.google.rpc.Status status_; - /** - *
        -     * The status to return for an individual attempt.
        -     * 
        - * - * .google.rpc.Status status = 1; - * @return Whether the status field is set. - */ - @java.lang.Override - public boolean hasStatus() { - return status_ != null; - } - /** - *
        -     * The status to return for an individual attempt.
        -     * 
        - * - * .google.rpc.Status status = 1; - * @return The status. - */ - @java.lang.Override - public com.google.rpc.Status getStatus() { - return status_ == null ? com.google.rpc.Status.getDefaultInstance() : status_; - } - /** - *
        -     * The status to return for an individual attempt.
        -     * 
        - * - * .google.rpc.Status status = 1; - */ - @java.lang.Override - public com.google.rpc.StatusOrBuilder getStatusOrBuilder() { - return getStatus(); - } - - public static final int DELAY_FIELD_NUMBER = 2; - private com.google.protobuf.Duration delay_; - /** - *
        -     * The amount of time to delay sending the response.
        -     * 
        - * - * .google.protobuf.Duration delay = 2; - * @return Whether the delay field is set. - */ - @java.lang.Override - public boolean hasDelay() { - return delay_ != null; - } - /** - *
        -     * The amount of time to delay sending the response.
        -     * 
        - * - * .google.protobuf.Duration delay = 2; - * @return The delay. - */ - @java.lang.Override - public com.google.protobuf.Duration getDelay() { - return delay_ == null ? com.google.protobuf.Duration.getDefaultInstance() : delay_; - } - /** - *
        -     * The amount of time to delay sending the response.
        -     * 
        - * - * .google.protobuf.Duration delay = 2; - */ - @java.lang.Override - public com.google.protobuf.DurationOrBuilder getDelayOrBuilder() { - return getDelay(); - } - - 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 (status_ != null) { - output.writeMessage(1, getStatus()); - } - if (delay_ != null) { - output.writeMessage(2, getDelay()); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (status_ != null) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(1, getStatus()); - } - if (delay_ != null) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(2, getDelay()); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof com.google.showcase.v1beta1.Sequence.Response)) { - return super.equals(obj); - } - com.google.showcase.v1beta1.Sequence.Response other = (com.google.showcase.v1beta1.Sequence.Response) obj; - - if (hasStatus() != other.hasStatus()) return false; - if (hasStatus()) { - if (!getStatus() - .equals(other.getStatus())) return false; - } - if (hasDelay() != other.hasDelay()) return false; - if (hasDelay()) { - if (!getDelay() - .equals(other.getDelay())) return false; - } - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - if (hasStatus()) { - hash = (37 * hash) + STATUS_FIELD_NUMBER; - hash = (53 * hash) + getStatus().hashCode(); - } - if (hasDelay()) { - hash = (37 * hash) + DELAY_FIELD_NUMBER; - hash = (53 * hash) + getDelay().hashCode(); - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.showcase.v1beta1.Sequence.Response parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.showcase.v1beta1.Sequence.Response parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.showcase.v1beta1.Sequence.Response parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.showcase.v1beta1.Sequence.Response 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.showcase.v1beta1.Sequence.Response parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.showcase.v1beta1.Sequence.Response parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.showcase.v1beta1.Sequence.Response parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static com.google.showcase.v1beta1.Sequence.Response 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.showcase.v1beta1.Sequence.Response parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static com.google.showcase.v1beta1.Sequence.Response 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.showcase.v1beta1.Sequence.Response parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static com.google.showcase.v1beta1.Sequence.Response 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.showcase.v1beta1.Sequence.Response prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - @java.lang.Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - *
        -     * A server response to an RPC Attempt in a sequence.
        -     * 
        - * - * Protobuf type {@code google.showcase.v1beta1.Sequence.Response} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.Sequence.Response) - com.google.showcase.v1beta1.Sequence.ResponseOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.google.showcase.v1beta1.SequenceOuterClass.internal_static_google_showcase_v1beta1_Sequence_Response_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.showcase.v1beta1.SequenceOuterClass.internal_static_google_showcase_v1beta1_Sequence_Response_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.showcase.v1beta1.Sequence.Response.class, com.google.showcase.v1beta1.Sequence.Response.Builder.class); - } - - // Construct using com.google.showcase.v1beta1.Sequence.Response.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { - } - } - @java.lang.Override - public Builder clear() { - super.clear(); - if (statusBuilder_ == null) { - status_ = null; - } else { - status_ = null; - statusBuilder_ = null; - } - if (delayBuilder_ == null) { - delay_ = null; - } else { - delay_ = null; - delayBuilder_ = null; - } - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return com.google.showcase.v1beta1.SequenceOuterClass.internal_static_google_showcase_v1beta1_Sequence_Response_descriptor; - } - - @java.lang.Override - public com.google.showcase.v1beta1.Sequence.Response getDefaultInstanceForType() { - return com.google.showcase.v1beta1.Sequence.Response.getDefaultInstance(); - } - - @java.lang.Override - public com.google.showcase.v1beta1.Sequence.Response build() { - com.google.showcase.v1beta1.Sequence.Response result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.showcase.v1beta1.Sequence.Response buildPartial() { - com.google.showcase.v1beta1.Sequence.Response result = new com.google.showcase.v1beta1.Sequence.Response(this); - if (statusBuilder_ == null) { - result.status_ = status_; - } else { - result.status_ = statusBuilder_.build(); - } - if (delayBuilder_ == null) { - result.delay_ = delay_; - } else { - result.delay_ = delayBuilder_.build(); - } - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.setField(field, value); - } - @java.lang.Override - public Builder clearField( - com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - @java.lang.Override - public Builder clearOneof( - com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.addRepeatedField(field, value); - } - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof com.google.showcase.v1beta1.Sequence.Response) { - return mergeFrom((com.google.showcase.v1beta1.Sequence.Response)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.showcase.v1beta1.Sequence.Response other) { - if (other == com.google.showcase.v1beta1.Sequence.Response.getDefaultInstance()) return this; - if (other.hasStatus()) { - mergeStatus(other.getStatus()); - } - if (other.hasDelay()) { - mergeDelay(other.getDelay()); - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - com.google.showcase.v1beta1.Sequence.Response parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (com.google.showcase.v1beta1.Sequence.Response) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private com.google.rpc.Status status_; - private com.google.protobuf.SingleFieldBuilderV3< - com.google.rpc.Status, com.google.rpc.Status.Builder, com.google.rpc.StatusOrBuilder> statusBuilder_; - /** - *
        -       * The status to return for an individual attempt.
        -       * 
        - * - * .google.rpc.Status status = 1; - * @return Whether the status field is set. - */ - public boolean hasStatus() { - return statusBuilder_ != null || status_ != null; - } - /** - *
        -       * The status to return for an individual attempt.
        -       * 
        - * - * .google.rpc.Status status = 1; - * @return The status. - */ - public com.google.rpc.Status getStatus() { - if (statusBuilder_ == null) { - return status_ == null ? com.google.rpc.Status.getDefaultInstance() : status_; - } else { - return statusBuilder_.getMessage(); - } - } - /** - *
        -       * The status to return for an individual attempt.
        -       * 
        - * - * .google.rpc.Status status = 1; - */ - public Builder setStatus(com.google.rpc.Status value) { - if (statusBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - status_ = value; - onChanged(); - } else { - statusBuilder_.setMessage(value); - } - - return this; - } - /** - *
        -       * The status to return for an individual attempt.
        -       * 
        - * - * .google.rpc.Status status = 1; - */ - public Builder setStatus( - com.google.rpc.Status.Builder builderForValue) { - if (statusBuilder_ == null) { - status_ = builderForValue.build(); - onChanged(); - } else { - statusBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - *
        -       * The status to return for an individual attempt.
        -       * 
        - * - * .google.rpc.Status status = 1; - */ - public Builder mergeStatus(com.google.rpc.Status value) { - if (statusBuilder_ == null) { - if (status_ != null) { - status_ = - com.google.rpc.Status.newBuilder(status_).mergeFrom(value).buildPartial(); - } else { - status_ = value; - } - onChanged(); - } else { - statusBuilder_.mergeFrom(value); - } - - return this; - } - /** - *
        -       * The status to return for an individual attempt.
        -       * 
        - * - * .google.rpc.Status status = 1; - */ - public Builder clearStatus() { - if (statusBuilder_ == null) { - status_ = null; - onChanged(); - } else { - status_ = null; - statusBuilder_ = null; - } - - return this; - } - /** - *
        -       * The status to return for an individual attempt.
        -       * 
        - * - * .google.rpc.Status status = 1; - */ - public com.google.rpc.Status.Builder getStatusBuilder() { - - onChanged(); - return getStatusFieldBuilder().getBuilder(); - } - /** - *
        -       * The status to return for an individual attempt.
        -       * 
        - * - * .google.rpc.Status status = 1; - */ - public com.google.rpc.StatusOrBuilder getStatusOrBuilder() { - if (statusBuilder_ != null) { - return statusBuilder_.getMessageOrBuilder(); - } else { - return status_ == null ? - com.google.rpc.Status.getDefaultInstance() : status_; - } - } - /** - *
        -       * The status to return for an individual attempt.
        -       * 
        - * - * .google.rpc.Status status = 1; - */ - private com.google.protobuf.SingleFieldBuilderV3< - com.google.rpc.Status, com.google.rpc.Status.Builder, com.google.rpc.StatusOrBuilder> - getStatusFieldBuilder() { - if (statusBuilder_ == null) { - statusBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - com.google.rpc.Status, com.google.rpc.Status.Builder, com.google.rpc.StatusOrBuilder>( - getStatus(), - getParentForChildren(), - isClean()); - status_ = null; - } - return statusBuilder_; - } - - private com.google.protobuf.Duration delay_; - private com.google.protobuf.SingleFieldBuilderV3< - com.google.protobuf.Duration, com.google.protobuf.Duration.Builder, com.google.protobuf.DurationOrBuilder> delayBuilder_; - /** - *
        -       * The amount of time to delay sending the response.
        -       * 
        - * - * .google.protobuf.Duration delay = 2; - * @return Whether the delay field is set. - */ - public boolean hasDelay() { - return delayBuilder_ != null || delay_ != null; - } - /** - *
        -       * The amount of time to delay sending the response.
        -       * 
        - * - * .google.protobuf.Duration delay = 2; - * @return The delay. - */ - public com.google.protobuf.Duration getDelay() { - if (delayBuilder_ == null) { - return delay_ == null ? com.google.protobuf.Duration.getDefaultInstance() : delay_; - } else { - return delayBuilder_.getMessage(); - } - } - /** - *
        -       * The amount of time to delay sending the response.
        -       * 
        - * - * .google.protobuf.Duration delay = 2; - */ - public Builder setDelay(com.google.protobuf.Duration value) { - if (delayBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - delay_ = value; - onChanged(); - } else { - delayBuilder_.setMessage(value); - } - - return this; - } - /** - *
        -       * The amount of time to delay sending the response.
        -       * 
        - * - * .google.protobuf.Duration delay = 2; - */ - public Builder setDelay( - com.google.protobuf.Duration.Builder builderForValue) { - if (delayBuilder_ == null) { - delay_ = builderForValue.build(); - onChanged(); - } else { - delayBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - *
        -       * The amount of time to delay sending the response.
        -       * 
        - * - * .google.protobuf.Duration delay = 2; - */ - public Builder mergeDelay(com.google.protobuf.Duration value) { - if (delayBuilder_ == null) { - if (delay_ != null) { - delay_ = - com.google.protobuf.Duration.newBuilder(delay_).mergeFrom(value).buildPartial(); - } else { - delay_ = value; - } - onChanged(); - } else { - delayBuilder_.mergeFrom(value); - } - - return this; - } - /** - *
        -       * The amount of time to delay sending the response.
        -       * 
        - * - * .google.protobuf.Duration delay = 2; - */ - public Builder clearDelay() { - if (delayBuilder_ == null) { - delay_ = null; - onChanged(); - } else { - delay_ = null; - delayBuilder_ = null; - } - - return this; - } - /** - *
        -       * The amount of time to delay sending the response.
        -       * 
        - * - * .google.protobuf.Duration delay = 2; - */ - public com.google.protobuf.Duration.Builder getDelayBuilder() { - - onChanged(); - return getDelayFieldBuilder().getBuilder(); - } - /** - *
        -       * The amount of time to delay sending the response.
        -       * 
        - * - * .google.protobuf.Duration delay = 2; - */ - public com.google.protobuf.DurationOrBuilder getDelayOrBuilder() { - if (delayBuilder_ != null) { - return delayBuilder_.getMessageOrBuilder(); - } else { - return delay_ == null ? - com.google.protobuf.Duration.getDefaultInstance() : delay_; - } - } - /** - *
        -       * The amount of time to delay sending the response.
        -       * 
        - * - * .google.protobuf.Duration delay = 2; - */ - private com.google.protobuf.SingleFieldBuilderV3< - com.google.protobuf.Duration, com.google.protobuf.Duration.Builder, com.google.protobuf.DurationOrBuilder> - getDelayFieldBuilder() { - if (delayBuilder_ == null) { - delayBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - com.google.protobuf.Duration, com.google.protobuf.Duration.Builder, com.google.protobuf.DurationOrBuilder>( - getDelay(), - getParentForChildren(), - isClean()); - delay_ = null; - } - return delayBuilder_; - } - @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.showcase.v1beta1.Sequence.Response) - } - - // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.Sequence.Response) - private static final com.google.showcase.v1beta1.Sequence.Response DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new com.google.showcase.v1beta1.Sequence.Response(); - } - - public static com.google.showcase.v1beta1.Sequence.Response getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public Response parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new Response(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public com.google.showcase.v1beta1.Sequence.Response getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - - } - - public static final int NAME_FIELD_NUMBER = 1; - private volatile java.lang.Object name_; - /** - * 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; - } - } - /** - * 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 RESPONSES_FIELD_NUMBER = 2; - private java.util.List responses_; - /** - *
        -   * Sequence of responses to return in order for each attempt. If empty, the
        -   * default response is an immediate OK.
        -   * 
        - * - * repeated .google.showcase.v1beta1.Sequence.Response responses = 2; - */ - @java.lang.Override - public java.util.List getResponsesList() { - return responses_; - } - /** - *
        -   * Sequence of responses to return in order for each attempt. If empty, the
        -   * default response is an immediate OK.
        -   * 
        - * - * repeated .google.showcase.v1beta1.Sequence.Response responses = 2; - */ - @java.lang.Override - public java.util.List - getResponsesOrBuilderList() { - return responses_; - } - /** - *
        -   * Sequence of responses to return in order for each attempt. If empty, the
        -   * default response is an immediate OK.
        -   * 
        - * - * repeated .google.showcase.v1beta1.Sequence.Response responses = 2; - */ - @java.lang.Override - public int getResponsesCount() { - return responses_.size(); - } - /** - *
        -   * Sequence of responses to return in order for each attempt. If empty, the
        -   * default response is an immediate OK.
        -   * 
        - * - * repeated .google.showcase.v1beta1.Sequence.Response responses = 2; - */ - @java.lang.Override - public com.google.showcase.v1beta1.Sequence.Response getResponses(int index) { - return responses_.get(index); - } - /** - *
        -   * Sequence of responses to return in order for each attempt. If empty, the
        -   * default response is an immediate OK.
        -   * 
        - * - * repeated .google.showcase.v1beta1.Sequence.Response responses = 2; - */ - @java.lang.Override - public com.google.showcase.v1beta1.Sequence.ResponseOrBuilder getResponsesOrBuilder( - int index) { - return responses_.get(index); - } - - private byte memoizedIsInitialized = -1; - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); - } - for (int i = 0; i < responses_.size(); i++) { - output.writeMessage(2, responses_.get(i)); - } - unknownFields.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_); - } - for (int i = 0; i < responses_.size(); i++) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(2, responses_.get(i)); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof com.google.showcase.v1beta1.Sequence)) { - return super.equals(obj); - } - com.google.showcase.v1beta1.Sequence other = (com.google.showcase.v1beta1.Sequence) obj; - - if (!getName() - .equals(other.getName())) return false; - if (!getResponsesList() - .equals(other.getResponsesList())) return false; - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - hash = (37 * hash) + NAME_FIELD_NUMBER; - hash = (53 * hash) + getName().hashCode(); - if (getResponsesCount() > 0) { - hash = (37 * hash) + RESPONSES_FIELD_NUMBER; - hash = (53 * hash) + getResponsesList().hashCode(); - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.showcase.v1beta1.Sequence parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.showcase.v1beta1.Sequence parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.showcase.v1beta1.Sequence parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.showcase.v1beta1.Sequence 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.showcase.v1beta1.Sequence parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.showcase.v1beta1.Sequence parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.showcase.v1beta1.Sequence parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static com.google.showcase.v1beta1.Sequence 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.showcase.v1beta1.Sequence parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static com.google.showcase.v1beta1.Sequence 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.showcase.v1beta1.Sequence parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static com.google.showcase.v1beta1.Sequence 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.showcase.v1beta1.Sequence prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - @java.lang.Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - * Protobuf type {@code google.showcase.v1beta1.Sequence} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.Sequence) - com.google.showcase.v1beta1.SequenceOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.google.showcase.v1beta1.SequenceOuterClass.internal_static_google_showcase_v1beta1_Sequence_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.showcase.v1beta1.SequenceOuterClass.internal_static_google_showcase_v1beta1_Sequence_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.showcase.v1beta1.Sequence.class, com.google.showcase.v1beta1.Sequence.Builder.class); - } - - // Construct using com.google.showcase.v1beta1.Sequence.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { - getResponsesFieldBuilder(); - } - } - @java.lang.Override - public Builder clear() { - super.clear(); - name_ = ""; - - if (responsesBuilder_ == null) { - responses_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - } else { - responsesBuilder_.clear(); - } - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return com.google.showcase.v1beta1.SequenceOuterClass.internal_static_google_showcase_v1beta1_Sequence_descriptor; - } - - @java.lang.Override - public com.google.showcase.v1beta1.Sequence getDefaultInstanceForType() { - return com.google.showcase.v1beta1.Sequence.getDefaultInstance(); - } - - @java.lang.Override - public com.google.showcase.v1beta1.Sequence build() { - com.google.showcase.v1beta1.Sequence result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.showcase.v1beta1.Sequence buildPartial() { - com.google.showcase.v1beta1.Sequence result = new com.google.showcase.v1beta1.Sequence(this); - int from_bitField0_ = bitField0_; - result.name_ = name_; - if (responsesBuilder_ == null) { - if (((bitField0_ & 0x00000001) != 0)) { - responses_ = java.util.Collections.unmodifiableList(responses_); - bitField0_ = (bitField0_ & ~0x00000001); - } - result.responses_ = responses_; - } else { - result.responses_ = responsesBuilder_.build(); - } - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.setField(field, value); - } - @java.lang.Override - public Builder clearField( - com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - @java.lang.Override - public Builder clearOneof( - com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.addRepeatedField(field, value); - } - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof com.google.showcase.v1beta1.Sequence) { - return mergeFrom((com.google.showcase.v1beta1.Sequence)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.showcase.v1beta1.Sequence other) { - if (other == com.google.showcase.v1beta1.Sequence.getDefaultInstance()) return this; - if (!other.getName().isEmpty()) { - name_ = other.name_; - onChanged(); - } - if (responsesBuilder_ == null) { - if (!other.responses_.isEmpty()) { - if (responses_.isEmpty()) { - responses_ = other.responses_; - bitField0_ = (bitField0_ & ~0x00000001); - } else { - ensureResponsesIsMutable(); - responses_.addAll(other.responses_); - } - onChanged(); - } - } else { - if (!other.responses_.isEmpty()) { - if (responsesBuilder_.isEmpty()) { - responsesBuilder_.dispose(); - responsesBuilder_ = null; - responses_ = other.responses_; - bitField0_ = (bitField0_ & ~0x00000001); - responsesBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? - getResponsesFieldBuilder() : null; - } else { - responsesBuilder_.addAllMessages(other.responses_); - } - } - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - com.google.showcase.v1beta1.Sequence parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (com.google.showcase.v1beta1.Sequence) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - private int bitField0_; - - private java.lang.Object name_ = ""; - /** - * 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; - } - } - /** - * 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; - } - } - /** - * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param value The name to set. - * @return This builder for chaining. - */ - public Builder setName( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - name_ = value; - onChanged(); - return this; - } - /** - * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return This builder for chaining. - */ - public Builder clearName() { - - name_ = getDefaultInstance().getName(); - onChanged(); - return this; - } - /** - * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param value The bytes for name to set. - * @return This builder for chaining. - */ - public Builder setNameBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - name_ = value; - onChanged(); - return this; - } - - private java.util.List responses_ = - java.util.Collections.emptyList(); - private void ensureResponsesIsMutable() { - if (!((bitField0_ & 0x00000001) != 0)) { - responses_ = new java.util.ArrayList(responses_); - bitField0_ |= 0x00000001; - } - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - com.google.showcase.v1beta1.Sequence.Response, com.google.showcase.v1beta1.Sequence.Response.Builder, com.google.showcase.v1beta1.Sequence.ResponseOrBuilder> responsesBuilder_; - - /** - *
        -     * Sequence of responses to return in order for each attempt. If empty, the
        -     * default response is an immediate OK.
        -     * 
        - * - * repeated .google.showcase.v1beta1.Sequence.Response responses = 2; - */ - public java.util.List getResponsesList() { - if (responsesBuilder_ == null) { - return java.util.Collections.unmodifiableList(responses_); - } else { - return responsesBuilder_.getMessageList(); - } - } - /** - *
        -     * Sequence of responses to return in order for each attempt. If empty, the
        -     * default response is an immediate OK.
        -     * 
        - * - * repeated .google.showcase.v1beta1.Sequence.Response responses = 2; - */ - public int getResponsesCount() { - if (responsesBuilder_ == null) { - return responses_.size(); - } else { - return responsesBuilder_.getCount(); - } - } - /** - *
        -     * Sequence of responses to return in order for each attempt. If empty, the
        -     * default response is an immediate OK.
        -     * 
        - * - * repeated .google.showcase.v1beta1.Sequence.Response responses = 2; - */ - public com.google.showcase.v1beta1.Sequence.Response getResponses(int index) { - if (responsesBuilder_ == null) { - return responses_.get(index); - } else { - return responsesBuilder_.getMessage(index); - } - } - /** - *
        -     * Sequence of responses to return in order for each attempt. If empty, the
        -     * default response is an immediate OK.
        -     * 
        - * - * repeated .google.showcase.v1beta1.Sequence.Response responses = 2; - */ - public Builder setResponses( - int index, com.google.showcase.v1beta1.Sequence.Response value) { - if (responsesBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureResponsesIsMutable(); - responses_.set(index, value); - onChanged(); - } else { - responsesBuilder_.setMessage(index, value); - } - return this; - } - /** - *
        -     * Sequence of responses to return in order for each attempt. If empty, the
        -     * default response is an immediate OK.
        -     * 
        - * - * repeated .google.showcase.v1beta1.Sequence.Response responses = 2; - */ - public Builder setResponses( - int index, com.google.showcase.v1beta1.Sequence.Response.Builder builderForValue) { - if (responsesBuilder_ == null) { - ensureResponsesIsMutable(); - responses_.set(index, builderForValue.build()); - onChanged(); - } else { - responsesBuilder_.setMessage(index, builderForValue.build()); - } - return this; - } - /** - *
        -     * Sequence of responses to return in order for each attempt. If empty, the
        -     * default response is an immediate OK.
        -     * 
        - * - * repeated .google.showcase.v1beta1.Sequence.Response responses = 2; - */ - public Builder addResponses(com.google.showcase.v1beta1.Sequence.Response value) { - if (responsesBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureResponsesIsMutable(); - responses_.add(value); - onChanged(); - } else { - responsesBuilder_.addMessage(value); - } - return this; - } - /** - *
        -     * Sequence of responses to return in order for each attempt. If empty, the
        -     * default response is an immediate OK.
        -     * 
        - * - * repeated .google.showcase.v1beta1.Sequence.Response responses = 2; - */ - public Builder addResponses( - int index, com.google.showcase.v1beta1.Sequence.Response value) { - if (responsesBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureResponsesIsMutable(); - responses_.add(index, value); - onChanged(); - } else { - responsesBuilder_.addMessage(index, value); - } - return this; - } - /** - *
        -     * Sequence of responses to return in order for each attempt. If empty, the
        -     * default response is an immediate OK.
        -     * 
        - * - * repeated .google.showcase.v1beta1.Sequence.Response responses = 2; - */ - public Builder addResponses( - com.google.showcase.v1beta1.Sequence.Response.Builder builderForValue) { - if (responsesBuilder_ == null) { - ensureResponsesIsMutable(); - responses_.add(builderForValue.build()); - onChanged(); - } else { - responsesBuilder_.addMessage(builderForValue.build()); - } - return this; - } - /** - *
        -     * Sequence of responses to return in order for each attempt. If empty, the
        -     * default response is an immediate OK.
        -     * 
        - * - * repeated .google.showcase.v1beta1.Sequence.Response responses = 2; - */ - public Builder addResponses( - int index, com.google.showcase.v1beta1.Sequence.Response.Builder builderForValue) { - if (responsesBuilder_ == null) { - ensureResponsesIsMutable(); - responses_.add(index, builderForValue.build()); - onChanged(); - } else { - responsesBuilder_.addMessage(index, builderForValue.build()); - } - return this; - } - /** - *
        -     * Sequence of responses to return in order for each attempt. If empty, the
        -     * default response is an immediate OK.
        -     * 
        - * - * repeated .google.showcase.v1beta1.Sequence.Response responses = 2; - */ - public Builder addAllResponses( - java.lang.Iterable values) { - if (responsesBuilder_ == null) { - ensureResponsesIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, responses_); - onChanged(); - } else { - responsesBuilder_.addAllMessages(values); - } - return this; - } - /** - *
        -     * Sequence of responses to return in order for each attempt. If empty, the
        -     * default response is an immediate OK.
        -     * 
        - * - * repeated .google.showcase.v1beta1.Sequence.Response responses = 2; - */ - public Builder clearResponses() { - if (responsesBuilder_ == null) { - responses_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - onChanged(); - } else { - responsesBuilder_.clear(); - } - return this; - } - /** - *
        -     * Sequence of responses to return in order for each attempt. If empty, the
        -     * default response is an immediate OK.
        -     * 
        - * - * repeated .google.showcase.v1beta1.Sequence.Response responses = 2; - */ - public Builder removeResponses(int index) { - if (responsesBuilder_ == null) { - ensureResponsesIsMutable(); - responses_.remove(index); - onChanged(); - } else { - responsesBuilder_.remove(index); - } - return this; - } - /** - *
        -     * Sequence of responses to return in order for each attempt. If empty, the
        -     * default response is an immediate OK.
        -     * 
        - * - * repeated .google.showcase.v1beta1.Sequence.Response responses = 2; - */ - public com.google.showcase.v1beta1.Sequence.Response.Builder getResponsesBuilder( - int index) { - return getResponsesFieldBuilder().getBuilder(index); - } - /** - *
        -     * Sequence of responses to return in order for each attempt. If empty, the
        -     * default response is an immediate OK.
        -     * 
        - * - * repeated .google.showcase.v1beta1.Sequence.Response responses = 2; - */ - public com.google.showcase.v1beta1.Sequence.ResponseOrBuilder getResponsesOrBuilder( - int index) { - if (responsesBuilder_ == null) { - return responses_.get(index); } else { - return responsesBuilder_.getMessageOrBuilder(index); - } - } - /** - *
        -     * Sequence of responses to return in order for each attempt. If empty, the
        -     * default response is an immediate OK.
        -     * 
        - * - * repeated .google.showcase.v1beta1.Sequence.Response responses = 2; - */ - public java.util.List - getResponsesOrBuilderList() { - if (responsesBuilder_ != null) { - return responsesBuilder_.getMessageOrBuilderList(); - } else { - return java.util.Collections.unmodifiableList(responses_); - } - } - /** - *
        -     * Sequence of responses to return in order for each attempt. If empty, the
        -     * default response is an immediate OK.
        -     * 
        - * - * repeated .google.showcase.v1beta1.Sequence.Response responses = 2; - */ - public com.google.showcase.v1beta1.Sequence.Response.Builder addResponsesBuilder() { - return getResponsesFieldBuilder().addBuilder( - com.google.showcase.v1beta1.Sequence.Response.getDefaultInstance()); - } - /** - *
        -     * Sequence of responses to return in order for each attempt. If empty, the
        -     * default response is an immediate OK.
        -     * 
        - * - * repeated .google.showcase.v1beta1.Sequence.Response responses = 2; - */ - public com.google.showcase.v1beta1.Sequence.Response.Builder addResponsesBuilder( - int index) { - return getResponsesFieldBuilder().addBuilder( - index, com.google.showcase.v1beta1.Sequence.Response.getDefaultInstance()); - } - /** - *
        -     * Sequence of responses to return in order for each attempt. If empty, the
        -     * default response is an immediate OK.
        -     * 
        - * - * repeated .google.showcase.v1beta1.Sequence.Response responses = 2; - */ - public java.util.List - getResponsesBuilderList() { - return getResponsesFieldBuilder().getBuilderList(); - } - private com.google.protobuf.RepeatedFieldBuilderV3< - com.google.showcase.v1beta1.Sequence.Response, com.google.showcase.v1beta1.Sequence.Response.Builder, com.google.showcase.v1beta1.Sequence.ResponseOrBuilder> - getResponsesFieldBuilder() { - if (responsesBuilder_ == null) { - responsesBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< - com.google.showcase.v1beta1.Sequence.Response, com.google.showcase.v1beta1.Sequence.Response.Builder, com.google.showcase.v1beta1.Sequence.ResponseOrBuilder>( - responses_, - ((bitField0_ & 0x00000001) != 0), - getParentForChildren(), - isClean()); - responses_ = null; - } - return responsesBuilder_; - } - @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.showcase.v1beta1.Sequence) - } - - // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.Sequence) - private static final com.google.showcase.v1beta1.Sequence DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new com.google.showcase.v1beta1.Sequence(); - } - - public static com.google.showcase.v1beta1.Sequence getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public Sequence parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new Sequence(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public com.google.showcase.v1beta1.Sequence getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/SequenceName.java b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/SequenceName.java deleted file mode 100644 index 067bb15adb..0000000000 --- a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/SequenceName.java +++ /dev/null @@ -1,168 +0,0 @@ -/* - * 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 - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1; - -import com.google.api.pathtemplate.PathTemplate; -import com.google.api.resourcenames.ResourceName; -import com.google.common.base.Preconditions; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import javax.annotation.Generated; - -// AUTO-GENERATED DOCUMENTATION AND CLASS. -@Generated("by gapic-generator-java") -public class SequenceName implements ResourceName { - private static final PathTemplate SEQUENCE = - PathTemplate.createWithoutUrlEncoding("sequences/{sequence}"); - private volatile Map fieldValuesMap; - private final String sequence; - - @Deprecated - protected SequenceName() { - sequence = null; - } - - private SequenceName(Builder builder) { - sequence = Preconditions.checkNotNull(builder.getSequence()); - } - - public String getSequence() { - return sequence; - } - - public static Builder newBuilder() { - return new Builder(); - } - - public Builder toBuilder() { - return new Builder(this); - } - - public static SequenceName of(String sequence) { - return newBuilder().setSequence(sequence).build(); - } - - public static String format(String sequence) { - return newBuilder().setSequence(sequence).build().toString(); - } - - public static SequenceName parse(String formattedString) { - if (formattedString.isEmpty()) { - return null; - } - Map matchMap = - SEQUENCE.validatedMatch( - formattedString, "SequenceName.parse: formattedString not in valid format"); - return of(matchMap.get("sequence")); - } - - 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 (SequenceName value : values) { - if (value == null) { - list.add(""); - } else { - list.add(value.toString()); - } - } - return list; - } - - public static boolean isParsableFrom(String formattedString) { - return SEQUENCE.matches(formattedString); - } - - @Override - public Map getFieldValuesMap() { - if (fieldValuesMap == null) { - synchronized (this) { - if (fieldValuesMap == null) { - ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); - if (sequence != null) { - fieldMapBuilder.put("sequence", sequence); - } - fieldValuesMap = fieldMapBuilder.build(); - } - } - } - return fieldValuesMap; - } - - public String getFieldValue(String fieldName) { - return getFieldValuesMap().get(fieldName); - } - - @Override - public String toString() { - return SEQUENCE.instantiate("sequence", sequence); - } - - @Override - public boolean equals(Object o) { - if (o == this) { - return true; - } - if (o != null || getClass() == o.getClass()) { - SequenceName that = ((SequenceName) o); - return Objects.equals(this.sequence, that.sequence); - } - return false; - } - - @Override - public int hashCode() { - int h = 1; - h *= 1000003; - h ^= Objects.hashCode(sequence); - return h; - } - - /** Builder for sequences/{sequence}. */ - public static class Builder { - private String sequence; - - protected Builder() {} - - public String getSequence() { - return sequence; - } - - public Builder setSequence(String sequence) { - this.sequence = sequence; - return this; - } - - private Builder(SequenceName sequenceName) { - this.sequence = sequenceName.sequence; - } - - public SequenceName build() { - return new SequenceName(this); - } - } -} diff --git a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/SequenceOrBuilder.java b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/SequenceOrBuilder.java deleted file mode 100644 index 9aa5beab37..0000000000 --- a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/SequenceOrBuilder.java +++ /dev/null @@ -1,70 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: schema/google/showcase/v1beta1/sequence.proto - -package com.google.showcase.v1beta1; - -public interface SequenceOrBuilder extends - // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.Sequence) - com.google.protobuf.MessageOrBuilder { - - /** - * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return The name. - */ - java.lang.String getName(); - /** - * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return The bytes for name. - */ - com.google.protobuf.ByteString - getNameBytes(); - - /** - *
        -   * Sequence of responses to return in order for each attempt. If empty, the
        -   * default response is an immediate OK.
        -   * 
        - * - * repeated .google.showcase.v1beta1.Sequence.Response responses = 2; - */ - java.util.List - getResponsesList(); - /** - *
        -   * Sequence of responses to return in order for each attempt. If empty, the
        -   * default response is an immediate OK.
        -   * 
        - * - * repeated .google.showcase.v1beta1.Sequence.Response responses = 2; - */ - com.google.showcase.v1beta1.Sequence.Response getResponses(int index); - /** - *
        -   * Sequence of responses to return in order for each attempt. If empty, the
        -   * default response is an immediate OK.
        -   * 
        - * - * repeated .google.showcase.v1beta1.Sequence.Response responses = 2; - */ - int getResponsesCount(); - /** - *
        -   * Sequence of responses to return in order for each attempt. If empty, the
        -   * default response is an immediate OK.
        -   * 
        - * - * repeated .google.showcase.v1beta1.Sequence.Response responses = 2; - */ - java.util.List - getResponsesOrBuilderList(); - /** - *
        -   * Sequence of responses to return in order for each attempt. If empty, the
        -   * default response is an immediate OK.
        -   * 
        - * - * repeated .google.showcase.v1beta1.Sequence.Response responses = 2; - */ - com.google.showcase.v1beta1.Sequence.ResponseOrBuilder getResponsesOrBuilder( - int index); -} diff --git a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/SequenceOuterClass.java b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/SequenceOuterClass.java deleted file mode 100644 index d3c0d424eb..0000000000 --- a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/SequenceOuterClass.java +++ /dev/null @@ -1,184 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: schema/google/showcase/v1beta1/sequence.proto - -package com.google.showcase.v1beta1; - -public final class SequenceOuterClass { - private SequenceOuterClass() {} - 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_showcase_v1beta1_Sequence_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_showcase_v1beta1_Sequence_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_showcase_v1beta1_Sequence_Response_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_showcase_v1beta1_Sequence_Response_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_showcase_v1beta1_SequenceReport_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_showcase_v1beta1_SequenceReport_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_showcase_v1beta1_SequenceReport_Attempt_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_showcase_v1beta1_SequenceReport_Attempt_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_showcase_v1beta1_CreateSequenceRequest_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_showcase_v1beta1_CreateSequenceRequest_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_showcase_v1beta1_AttemptSequenceRequest_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_showcase_v1beta1_AttemptSequenceRequest_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_showcase_v1beta1_GetSequenceReportRequest_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_showcase_v1beta1_GetSequenceReportRequest_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-schema/google/showcase/v1beta1/sequenc" + - "e.proto\022\027google.showcase.v1beta1\032\034google" + - "/api/annotations.proto\032\027google/api/clien" + - "t.proto\032\037google/api/field_behavior.proto" + - "\032\031google/api/resource.proto\032\036google/prot" + - "obuf/duration.proto\032\033google/protobuf/emp" + - "ty.proto\032\037google/protobuf/timestamp.prot" + - "o\032\027google/rpc/status.proto\"\363\001\n\010Sequence\022" + - "\021\n\004name\030\001 \001(\tB\003\340A\003\022=\n\tresponses\030\002 \003(\0132*." + - "google.showcase.v1beta1.Sequence.Respons" + - "e\032X\n\010Response\022\"\n\006status\030\001 \001(\0132\022.google.r" + - "pc.Status\022(\n\005delay\030\002 \001(\0132\031.google.protob" + - "uf.Duration:;\352A8\n showcase.googleapis.co" + - "m/Sequence\022\024sequences/{sequence}\"\233\003\n\016Seq" + - "uenceReport\022\021\n\004name\030\001 \001(\tB\003\340A\003\022A\n\010attemp" + - "ts\030\002 \003(\0132/.google.showcase.v1beta1.Seque" + - "nceReport.Attempt\032\340\001\n\007Attempt\022\026\n\016attempt" + - "_number\030\001 \001(\005\0224\n\020attempt_deadline\030\002 \001(\0132" + - "\032.google.protobuf.Timestamp\0221\n\rresponse_" + - "time\030\003 \001(\0132\032.google.protobuf.Timestamp\0220" + - "\n\rattempt_delay\030\004 \001(\0132\031.google.protobuf." + - "Duration\022\"\n\006status\030\005 \001(\0132\022.google.rpc.St" + - "atus:P\352AM\n&showcase.googleapis.com/Seque" + - "nceReport\022#sequences/{sequence}/sequence" + - "Report\"L\n\025CreateSequenceRequest\0223\n\010seque" + - "nce\030\001 \001(\0132!.google.showcase.v1beta1.Sequ" + - "ence\"P\n\026AttemptSequenceRequest\0226\n\004name\030\001" + - " \001(\tB(\372A\"\n showcase.googleapis.com/Seque" + - "nce\340A\002\"X\n\030GetSequenceReportRequest\022<\n\004na" + - "me\030\001 \001(\tB.\372A(\n&showcase.googleapis.com/S" + - "equenceReport\340A\0022\364\003\n\017SequenceService\022\224\001\n" + - "\016CreateSequence\022..google.showcase.v1beta" + - "1.CreateSequenceRequest\032!.google.showcas" + - "e.v1beta1.Sequence\"/\202\323\344\223\002\036\"\022/v1beta1/seq" + - "uences:\010sequence\332A\010sequence\022\252\001\n\021GetSeque" + - "nceReport\0221.google.showcase.v1beta1.GetS" + - "equenceReportRequest\032\'.google.showcase.v" + - "1beta1.SequenceReport\"9\202\323\344\223\002,\022*/v1beta1/" + - "{name=sequences/*/sequenceReport}\332A\004name" + - "\022\211\001\n\017AttemptSequence\022/.google.showcase.v" + - "1beta1.AttemptSequenceRequest\032\026.google.p" + - "rotobuf.Empty\"-\202\323\344\223\002 \"\033/v1beta1/{name=se" + - "quences/*}:\001*\332A\004name\032\021\312A\016localhost:7469B" + - "q\n\033com.google.showcase.v1beta1P\001Z4github" + - ".com/googleapis/gapic-showcase/server/ge" + - "nproto\352\002\031Google::Showcase::V1beta1b\006prot" + - "o3" - }; - 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.protobuf.DurationProto.getDescriptor(), - com.google.protobuf.EmptyProto.getDescriptor(), - com.google.protobuf.TimestampProto.getDescriptor(), - com.google.rpc.StatusProto.getDescriptor(), - }); - internal_static_google_showcase_v1beta1_Sequence_descriptor = - getDescriptor().getMessageTypes().get(0); - internal_static_google_showcase_v1beta1_Sequence_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_google_showcase_v1beta1_Sequence_descriptor, - new java.lang.String[] { "Name", "Responses", }); - internal_static_google_showcase_v1beta1_Sequence_Response_descriptor = - internal_static_google_showcase_v1beta1_Sequence_descriptor.getNestedTypes().get(0); - internal_static_google_showcase_v1beta1_Sequence_Response_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_google_showcase_v1beta1_Sequence_Response_descriptor, - new java.lang.String[] { "Status", "Delay", }); - internal_static_google_showcase_v1beta1_SequenceReport_descriptor = - getDescriptor().getMessageTypes().get(1); - internal_static_google_showcase_v1beta1_SequenceReport_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_google_showcase_v1beta1_SequenceReport_descriptor, - new java.lang.String[] { "Name", "Attempts", }); - internal_static_google_showcase_v1beta1_SequenceReport_Attempt_descriptor = - internal_static_google_showcase_v1beta1_SequenceReport_descriptor.getNestedTypes().get(0); - internal_static_google_showcase_v1beta1_SequenceReport_Attempt_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_google_showcase_v1beta1_SequenceReport_Attempt_descriptor, - new java.lang.String[] { "AttemptNumber", "AttemptDeadline", "ResponseTime", "AttemptDelay", "Status", }); - internal_static_google_showcase_v1beta1_CreateSequenceRequest_descriptor = - getDescriptor().getMessageTypes().get(2); - internal_static_google_showcase_v1beta1_CreateSequenceRequest_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_google_showcase_v1beta1_CreateSequenceRequest_descriptor, - new java.lang.String[] { "Sequence", }); - internal_static_google_showcase_v1beta1_AttemptSequenceRequest_descriptor = - getDescriptor().getMessageTypes().get(3); - internal_static_google_showcase_v1beta1_AttemptSequenceRequest_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_google_showcase_v1beta1_AttemptSequenceRequest_descriptor, - new java.lang.String[] { "Name", }); - internal_static_google_showcase_v1beta1_GetSequenceReportRequest_descriptor = - getDescriptor().getMessageTypes().get(4); - internal_static_google_showcase_v1beta1_GetSequenceReportRequest_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_google_showcase_v1beta1_GetSequenceReportRequest_descriptor, - new java.lang.String[] { "Name", }); - com.google.protobuf.ExtensionRegistry registry = - com.google.protobuf.ExtensionRegistry.newInstance(); - registry.add(com.google.api.ClientProto.defaultHost); - registry.add(com.google.api.FieldBehaviorProto.fieldBehavior); - registry.add(com.google.api.AnnotationsProto.http); - registry.add(com.google.api.ClientProto.methodSignature); - registry.add(com.google.api.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.FieldBehaviorProto.getDescriptor(); - com.google.api.ResourceProto.getDescriptor(); - com.google.protobuf.DurationProto.getDescriptor(); - com.google.protobuf.EmptyProto.getDescriptor(); - com.google.protobuf.TimestampProto.getDescriptor(); - com.google.rpc.StatusProto.getDescriptor(); - } - - // @@protoc_insertion_point(outer_class_scope) -} diff --git a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/SequenceReport.java b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/SequenceReport.java deleted file mode 100644 index 768c155ea3..0000000000 --- a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/SequenceReport.java +++ /dev/null @@ -1,2602 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: schema/google/showcase/v1beta1/sequence.proto - -package com.google.showcase.v1beta1; - -/** - * Protobuf type {@code google.showcase.v1beta1.SequenceReport} - */ -public final class SequenceReport extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.SequenceReport) - SequenceReportOrBuilder { -private static final long serialVersionUID = 0L; - // Use SequenceReport.newBuilder() to construct. - private SequenceReport(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private SequenceReport() { - name_ = ""; - attempts_ = java.util.Collections.emptyList(); - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new SequenceReport(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private SequenceReport( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - int mutable_bitField0_ = 0; - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: { - java.lang.String s = input.readStringRequireUtf8(); - - name_ = s; - break; - } - case 18: { - if (!((mutable_bitField0_ & 0x00000001) != 0)) { - attempts_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000001; - } - attempts_.add( - input.readMessage(com.google.showcase.v1beta1.SequenceReport.Attempt.parser(), extensionRegistry)); - break; - } - default: { - if (!parseUnknownField( - input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException( - e).setUnfinishedMessage(this); - } finally { - if (((mutable_bitField0_ & 0x00000001) != 0)) { - attempts_ = java.util.Collections.unmodifiableList(attempts_); - } - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.google.showcase.v1beta1.SequenceOuterClass.internal_static_google_showcase_v1beta1_SequenceReport_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.showcase.v1beta1.SequenceOuterClass.internal_static_google_showcase_v1beta1_SequenceReport_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.showcase.v1beta1.SequenceReport.class, com.google.showcase.v1beta1.SequenceReport.Builder.class); - } - - public interface AttemptOrBuilder extends - // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.SequenceReport.Attempt) - com.google.protobuf.MessageOrBuilder { - - /** - *
        -     * The attempt number - starting at 0.
        -     * 
        - * - * int32 attempt_number = 1; - * @return The attemptNumber. - */ - int getAttemptNumber(); - - /** - *
        -     * The deadline dictated by the attempt to the server.
        -     * 
        - * - * .google.protobuf.Timestamp attempt_deadline = 2; - * @return Whether the attemptDeadline field is set. - */ - boolean hasAttemptDeadline(); - /** - *
        -     * The deadline dictated by the attempt to the server.
        -     * 
        - * - * .google.protobuf.Timestamp attempt_deadline = 2; - * @return The attemptDeadline. - */ - com.google.protobuf.Timestamp getAttemptDeadline(); - /** - *
        -     * The deadline dictated by the attempt to the server.
        -     * 
        - * - * .google.protobuf.Timestamp attempt_deadline = 2; - */ - com.google.protobuf.TimestampOrBuilder getAttemptDeadlineOrBuilder(); - - /** - *
        -     * The time that the server responded to the RPC attempt. Used for
        -     * calculating attempt_delay.
        -     * 
        - * - * .google.protobuf.Timestamp response_time = 3; - * @return Whether the responseTime field is set. - */ - boolean hasResponseTime(); - /** - *
        -     * The time that the server responded to the RPC attempt. Used for
        -     * calculating attempt_delay.
        -     * 
        - * - * .google.protobuf.Timestamp response_time = 3; - * @return The responseTime. - */ - com.google.protobuf.Timestamp getResponseTime(); - /** - *
        -     * The time that the server responded to the RPC attempt. Used for
        -     * calculating attempt_delay.
        -     * 
        - * - * .google.protobuf.Timestamp response_time = 3; - */ - com.google.protobuf.TimestampOrBuilder getResponseTimeOrBuilder(); - - /** - *
        -     * The server perceived delay between sending the last response and
        -     * receiving this attempt. Used for validating attempt delay backoff.
        -     * 
        - * - * .google.protobuf.Duration attempt_delay = 4; - * @return Whether the attemptDelay field is set. - */ - boolean hasAttemptDelay(); - /** - *
        -     * The server perceived delay between sending the last response and
        -     * receiving this attempt. Used for validating attempt delay backoff.
        -     * 
        - * - * .google.protobuf.Duration attempt_delay = 4; - * @return The attemptDelay. - */ - com.google.protobuf.Duration getAttemptDelay(); - /** - *
        -     * The server perceived delay between sending the last response and
        -     * receiving this attempt. Used for validating attempt delay backoff.
        -     * 
        - * - * .google.protobuf.Duration attempt_delay = 4; - */ - com.google.protobuf.DurationOrBuilder getAttemptDelayOrBuilder(); - - /** - *
        -     * The status returned to the attempt.
        -     * 
        - * - * .google.rpc.Status status = 5; - * @return Whether the status field is set. - */ - boolean hasStatus(); - /** - *
        -     * The status returned to the attempt.
        -     * 
        - * - * .google.rpc.Status status = 5; - * @return The status. - */ - com.google.rpc.Status getStatus(); - /** - *
        -     * The status returned to the attempt.
        -     * 
        - * - * .google.rpc.Status status = 5; - */ - com.google.rpc.StatusOrBuilder getStatusOrBuilder(); - } - /** - *
        -   * Contains metrics on individual RPC Attempts in a sequence.
        -   * 
        - * - * Protobuf type {@code google.showcase.v1beta1.SequenceReport.Attempt} - */ - public static final class Attempt extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.SequenceReport.Attempt) - AttemptOrBuilder { - private static final long serialVersionUID = 0L; - // Use Attempt.newBuilder() to construct. - private Attempt(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private Attempt() { - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new Attempt(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private Attempt( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 8: { - - attemptNumber_ = input.readInt32(); - break; - } - case 18: { - com.google.protobuf.Timestamp.Builder subBuilder = null; - if (attemptDeadline_ != null) { - subBuilder = attemptDeadline_.toBuilder(); - } - attemptDeadline_ = input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(attemptDeadline_); - attemptDeadline_ = subBuilder.buildPartial(); - } - - break; - } - case 26: { - com.google.protobuf.Timestamp.Builder subBuilder = null; - if (responseTime_ != null) { - subBuilder = responseTime_.toBuilder(); - } - responseTime_ = input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(responseTime_); - responseTime_ = subBuilder.buildPartial(); - } - - break; - } - case 34: { - com.google.protobuf.Duration.Builder subBuilder = null; - if (attemptDelay_ != null) { - subBuilder = attemptDelay_.toBuilder(); - } - attemptDelay_ = input.readMessage(com.google.protobuf.Duration.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(attemptDelay_); - attemptDelay_ = subBuilder.buildPartial(); - } - - break; - } - case 42: { - com.google.rpc.Status.Builder subBuilder = null; - if (status_ != null) { - subBuilder = status_.toBuilder(); - } - status_ = input.readMessage(com.google.rpc.Status.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(status_); - status_ = subBuilder.buildPartial(); - } - - break; - } - default: { - if (!parseUnknownField( - input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException( - e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.google.showcase.v1beta1.SequenceOuterClass.internal_static_google_showcase_v1beta1_SequenceReport_Attempt_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.showcase.v1beta1.SequenceOuterClass.internal_static_google_showcase_v1beta1_SequenceReport_Attempt_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.showcase.v1beta1.SequenceReport.Attempt.class, com.google.showcase.v1beta1.SequenceReport.Attempt.Builder.class); - } - - public static final int ATTEMPT_NUMBER_FIELD_NUMBER = 1; - private int attemptNumber_; - /** - *
        -     * The attempt number - starting at 0.
        -     * 
        - * - * int32 attempt_number = 1; - * @return The attemptNumber. - */ - @java.lang.Override - public int getAttemptNumber() { - return attemptNumber_; - } - - public static final int ATTEMPT_DEADLINE_FIELD_NUMBER = 2; - private com.google.protobuf.Timestamp attemptDeadline_; - /** - *
        -     * The deadline dictated by the attempt to the server.
        -     * 
        - * - * .google.protobuf.Timestamp attempt_deadline = 2; - * @return Whether the attemptDeadline field is set. - */ - @java.lang.Override - public boolean hasAttemptDeadline() { - return attemptDeadline_ != null; - } - /** - *
        -     * The deadline dictated by the attempt to the server.
        -     * 
        - * - * .google.protobuf.Timestamp attempt_deadline = 2; - * @return The attemptDeadline. - */ - @java.lang.Override - public com.google.protobuf.Timestamp getAttemptDeadline() { - return attemptDeadline_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : attemptDeadline_; - } - /** - *
        -     * The deadline dictated by the attempt to the server.
        -     * 
        - * - * .google.protobuf.Timestamp attempt_deadline = 2; - */ - @java.lang.Override - public com.google.protobuf.TimestampOrBuilder getAttemptDeadlineOrBuilder() { - return getAttemptDeadline(); - } - - public static final int RESPONSE_TIME_FIELD_NUMBER = 3; - private com.google.protobuf.Timestamp responseTime_; - /** - *
        -     * The time that the server responded to the RPC attempt. Used for
        -     * calculating attempt_delay.
        -     * 
        - * - * .google.protobuf.Timestamp response_time = 3; - * @return Whether the responseTime field is set. - */ - @java.lang.Override - public boolean hasResponseTime() { - return responseTime_ != null; - } - /** - *
        -     * The time that the server responded to the RPC attempt. Used for
        -     * calculating attempt_delay.
        -     * 
        - * - * .google.protobuf.Timestamp response_time = 3; - * @return The responseTime. - */ - @java.lang.Override - public com.google.protobuf.Timestamp getResponseTime() { - return responseTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : responseTime_; - } - /** - *
        -     * The time that the server responded to the RPC attempt. Used for
        -     * calculating attempt_delay.
        -     * 
        - * - * .google.protobuf.Timestamp response_time = 3; - */ - @java.lang.Override - public com.google.protobuf.TimestampOrBuilder getResponseTimeOrBuilder() { - return getResponseTime(); - } - - public static final int ATTEMPT_DELAY_FIELD_NUMBER = 4; - private com.google.protobuf.Duration attemptDelay_; - /** - *
        -     * The server perceived delay between sending the last response and
        -     * receiving this attempt. Used for validating attempt delay backoff.
        -     * 
        - * - * .google.protobuf.Duration attempt_delay = 4; - * @return Whether the attemptDelay field is set. - */ - @java.lang.Override - public boolean hasAttemptDelay() { - return attemptDelay_ != null; - } - /** - *
        -     * The server perceived delay between sending the last response and
        -     * receiving this attempt. Used for validating attempt delay backoff.
        -     * 
        - * - * .google.protobuf.Duration attempt_delay = 4; - * @return The attemptDelay. - */ - @java.lang.Override - public com.google.protobuf.Duration getAttemptDelay() { - return attemptDelay_ == null ? com.google.protobuf.Duration.getDefaultInstance() : attemptDelay_; - } - /** - *
        -     * The server perceived delay between sending the last response and
        -     * receiving this attempt. Used for validating attempt delay backoff.
        -     * 
        - * - * .google.protobuf.Duration attempt_delay = 4; - */ - @java.lang.Override - public com.google.protobuf.DurationOrBuilder getAttemptDelayOrBuilder() { - return getAttemptDelay(); - } - - public static final int STATUS_FIELD_NUMBER = 5; - private com.google.rpc.Status status_; - /** - *
        -     * The status returned to the attempt.
        -     * 
        - * - * .google.rpc.Status status = 5; - * @return Whether the status field is set. - */ - @java.lang.Override - public boolean hasStatus() { - return status_ != null; - } - /** - *
        -     * The status returned to the attempt.
        -     * 
        - * - * .google.rpc.Status status = 5; - * @return The status. - */ - @java.lang.Override - public com.google.rpc.Status getStatus() { - return status_ == null ? com.google.rpc.Status.getDefaultInstance() : status_; - } - /** - *
        -     * The status returned to the attempt.
        -     * 
        - * - * .google.rpc.Status status = 5; - */ - @java.lang.Override - public com.google.rpc.StatusOrBuilder getStatusOrBuilder() { - return getStatus(); - } - - private byte memoizedIsInitialized = -1; - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - if (attemptNumber_ != 0) { - output.writeInt32(1, attemptNumber_); - } - if (attemptDeadline_ != null) { - output.writeMessage(2, getAttemptDeadline()); - } - if (responseTime_ != null) { - output.writeMessage(3, getResponseTime()); - } - if (attemptDelay_ != null) { - output.writeMessage(4, getAttemptDelay()); - } - if (status_ != null) { - output.writeMessage(5, getStatus()); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (attemptNumber_ != 0) { - size += com.google.protobuf.CodedOutputStream - .computeInt32Size(1, attemptNumber_); - } - if (attemptDeadline_ != null) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(2, getAttemptDeadline()); - } - if (responseTime_ != null) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(3, getResponseTime()); - } - if (attemptDelay_ != null) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(4, getAttemptDelay()); - } - if (status_ != null) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(5, getStatus()); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof com.google.showcase.v1beta1.SequenceReport.Attempt)) { - return super.equals(obj); - } - com.google.showcase.v1beta1.SequenceReport.Attempt other = (com.google.showcase.v1beta1.SequenceReport.Attempt) obj; - - if (getAttemptNumber() - != other.getAttemptNumber()) return false; - if (hasAttemptDeadline() != other.hasAttemptDeadline()) return false; - if (hasAttemptDeadline()) { - if (!getAttemptDeadline() - .equals(other.getAttemptDeadline())) return false; - } - if (hasResponseTime() != other.hasResponseTime()) return false; - if (hasResponseTime()) { - if (!getResponseTime() - .equals(other.getResponseTime())) return false; - } - if (hasAttemptDelay() != other.hasAttemptDelay()) return false; - if (hasAttemptDelay()) { - if (!getAttemptDelay() - .equals(other.getAttemptDelay())) return false; - } - if (hasStatus() != other.hasStatus()) return false; - if (hasStatus()) { - if (!getStatus() - .equals(other.getStatus())) return false; - } - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - hash = (37 * hash) + ATTEMPT_NUMBER_FIELD_NUMBER; - hash = (53 * hash) + getAttemptNumber(); - if (hasAttemptDeadline()) { - hash = (37 * hash) + ATTEMPT_DEADLINE_FIELD_NUMBER; - hash = (53 * hash) + getAttemptDeadline().hashCode(); - } - if (hasResponseTime()) { - hash = (37 * hash) + RESPONSE_TIME_FIELD_NUMBER; - hash = (53 * hash) + getResponseTime().hashCode(); - } - if (hasAttemptDelay()) { - hash = (37 * hash) + ATTEMPT_DELAY_FIELD_NUMBER; - hash = (53 * hash) + getAttemptDelay().hashCode(); - } - if (hasStatus()) { - hash = (37 * hash) + STATUS_FIELD_NUMBER; - hash = (53 * hash) + getStatus().hashCode(); - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.showcase.v1beta1.SequenceReport.Attempt parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.showcase.v1beta1.SequenceReport.Attempt parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.showcase.v1beta1.SequenceReport.Attempt parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.showcase.v1beta1.SequenceReport.Attempt 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.showcase.v1beta1.SequenceReport.Attempt parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.showcase.v1beta1.SequenceReport.Attempt parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.showcase.v1beta1.SequenceReport.Attempt parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static com.google.showcase.v1beta1.SequenceReport.Attempt 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.showcase.v1beta1.SequenceReport.Attempt parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static com.google.showcase.v1beta1.SequenceReport.Attempt 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.showcase.v1beta1.SequenceReport.Attempt parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static com.google.showcase.v1beta1.SequenceReport.Attempt 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.showcase.v1beta1.SequenceReport.Attempt prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - @java.lang.Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - *
        -     * Contains metrics on individual RPC Attempts in a sequence.
        -     * 
        - * - * Protobuf type {@code google.showcase.v1beta1.SequenceReport.Attempt} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.SequenceReport.Attempt) - com.google.showcase.v1beta1.SequenceReport.AttemptOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.google.showcase.v1beta1.SequenceOuterClass.internal_static_google_showcase_v1beta1_SequenceReport_Attempt_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.showcase.v1beta1.SequenceOuterClass.internal_static_google_showcase_v1beta1_SequenceReport_Attempt_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.showcase.v1beta1.SequenceReport.Attempt.class, com.google.showcase.v1beta1.SequenceReport.Attempt.Builder.class); - } - - // Construct using com.google.showcase.v1beta1.SequenceReport.Attempt.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { - } - } - @java.lang.Override - public Builder clear() { - super.clear(); - attemptNumber_ = 0; - - if (attemptDeadlineBuilder_ == null) { - attemptDeadline_ = null; - } else { - attemptDeadline_ = null; - attemptDeadlineBuilder_ = null; - } - if (responseTimeBuilder_ == null) { - responseTime_ = null; - } else { - responseTime_ = null; - responseTimeBuilder_ = null; - } - if (attemptDelayBuilder_ == null) { - attemptDelay_ = null; - } else { - attemptDelay_ = null; - attemptDelayBuilder_ = null; - } - if (statusBuilder_ == null) { - status_ = null; - } else { - status_ = null; - statusBuilder_ = null; - } - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return com.google.showcase.v1beta1.SequenceOuterClass.internal_static_google_showcase_v1beta1_SequenceReport_Attempt_descriptor; - } - - @java.lang.Override - public com.google.showcase.v1beta1.SequenceReport.Attempt getDefaultInstanceForType() { - return com.google.showcase.v1beta1.SequenceReport.Attempt.getDefaultInstance(); - } - - @java.lang.Override - public com.google.showcase.v1beta1.SequenceReport.Attempt build() { - com.google.showcase.v1beta1.SequenceReport.Attempt result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.showcase.v1beta1.SequenceReport.Attempt buildPartial() { - com.google.showcase.v1beta1.SequenceReport.Attempt result = new com.google.showcase.v1beta1.SequenceReport.Attempt(this); - result.attemptNumber_ = attemptNumber_; - if (attemptDeadlineBuilder_ == null) { - result.attemptDeadline_ = attemptDeadline_; - } else { - result.attemptDeadline_ = attemptDeadlineBuilder_.build(); - } - if (responseTimeBuilder_ == null) { - result.responseTime_ = responseTime_; - } else { - result.responseTime_ = responseTimeBuilder_.build(); - } - if (attemptDelayBuilder_ == null) { - result.attemptDelay_ = attemptDelay_; - } else { - result.attemptDelay_ = attemptDelayBuilder_.build(); - } - if (statusBuilder_ == null) { - result.status_ = status_; - } else { - result.status_ = statusBuilder_.build(); - } - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.setField(field, value); - } - @java.lang.Override - public Builder clearField( - com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - @java.lang.Override - public Builder clearOneof( - com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.addRepeatedField(field, value); - } - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof com.google.showcase.v1beta1.SequenceReport.Attempt) { - return mergeFrom((com.google.showcase.v1beta1.SequenceReport.Attempt)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.showcase.v1beta1.SequenceReport.Attempt other) { - if (other == com.google.showcase.v1beta1.SequenceReport.Attempt.getDefaultInstance()) return this; - if (other.getAttemptNumber() != 0) { - setAttemptNumber(other.getAttemptNumber()); - } - if (other.hasAttemptDeadline()) { - mergeAttemptDeadline(other.getAttemptDeadline()); - } - if (other.hasResponseTime()) { - mergeResponseTime(other.getResponseTime()); - } - if (other.hasAttemptDelay()) { - mergeAttemptDelay(other.getAttemptDelay()); - } - if (other.hasStatus()) { - mergeStatus(other.getStatus()); - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - com.google.showcase.v1beta1.SequenceReport.Attempt parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (com.google.showcase.v1beta1.SequenceReport.Attempt) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private int attemptNumber_ ; - /** - *
        -       * The attempt number - starting at 0.
        -       * 
        - * - * int32 attempt_number = 1; - * @return The attemptNumber. - */ - @java.lang.Override - public int getAttemptNumber() { - return attemptNumber_; - } - /** - *
        -       * The attempt number - starting at 0.
        -       * 
        - * - * int32 attempt_number = 1; - * @param value The attemptNumber to set. - * @return This builder for chaining. - */ - public Builder setAttemptNumber(int value) { - - attemptNumber_ = value; - onChanged(); - return this; - } - /** - *
        -       * The attempt number - starting at 0.
        -       * 
        - * - * int32 attempt_number = 1; - * @return This builder for chaining. - */ - public Builder clearAttemptNumber() { - - attemptNumber_ = 0; - onChanged(); - return this; - } - - private com.google.protobuf.Timestamp attemptDeadline_; - private com.google.protobuf.SingleFieldBuilderV3< - com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder> attemptDeadlineBuilder_; - /** - *
        -       * The deadline dictated by the attempt to the server.
        -       * 
        - * - * .google.protobuf.Timestamp attempt_deadline = 2; - * @return Whether the attemptDeadline field is set. - */ - public boolean hasAttemptDeadline() { - return attemptDeadlineBuilder_ != null || attemptDeadline_ != null; - } - /** - *
        -       * The deadline dictated by the attempt to the server.
        -       * 
        - * - * .google.protobuf.Timestamp attempt_deadline = 2; - * @return The attemptDeadline. - */ - public com.google.protobuf.Timestamp getAttemptDeadline() { - if (attemptDeadlineBuilder_ == null) { - return attemptDeadline_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : attemptDeadline_; - } else { - return attemptDeadlineBuilder_.getMessage(); - } - } - /** - *
        -       * The deadline dictated by the attempt to the server.
        -       * 
        - * - * .google.protobuf.Timestamp attempt_deadline = 2; - */ - public Builder setAttemptDeadline(com.google.protobuf.Timestamp value) { - if (attemptDeadlineBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - attemptDeadline_ = value; - onChanged(); - } else { - attemptDeadlineBuilder_.setMessage(value); - } - - return this; - } - /** - *
        -       * The deadline dictated by the attempt to the server.
        -       * 
        - * - * .google.protobuf.Timestamp attempt_deadline = 2; - */ - public Builder setAttemptDeadline( - com.google.protobuf.Timestamp.Builder builderForValue) { - if (attemptDeadlineBuilder_ == null) { - attemptDeadline_ = builderForValue.build(); - onChanged(); - } else { - attemptDeadlineBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - *
        -       * The deadline dictated by the attempt to the server.
        -       * 
        - * - * .google.protobuf.Timestamp attempt_deadline = 2; - */ - public Builder mergeAttemptDeadline(com.google.protobuf.Timestamp value) { - if (attemptDeadlineBuilder_ == null) { - if (attemptDeadline_ != null) { - attemptDeadline_ = - com.google.protobuf.Timestamp.newBuilder(attemptDeadline_).mergeFrom(value).buildPartial(); - } else { - attemptDeadline_ = value; - } - onChanged(); - } else { - attemptDeadlineBuilder_.mergeFrom(value); - } - - return this; - } - /** - *
        -       * The deadline dictated by the attempt to the server.
        -       * 
        - * - * .google.protobuf.Timestamp attempt_deadline = 2; - */ - public Builder clearAttemptDeadline() { - if (attemptDeadlineBuilder_ == null) { - attemptDeadline_ = null; - onChanged(); - } else { - attemptDeadline_ = null; - attemptDeadlineBuilder_ = null; - } - - return this; - } - /** - *
        -       * The deadline dictated by the attempt to the server.
        -       * 
        - * - * .google.protobuf.Timestamp attempt_deadline = 2; - */ - public com.google.protobuf.Timestamp.Builder getAttemptDeadlineBuilder() { - - onChanged(); - return getAttemptDeadlineFieldBuilder().getBuilder(); - } - /** - *
        -       * The deadline dictated by the attempt to the server.
        -       * 
        - * - * .google.protobuf.Timestamp attempt_deadline = 2; - */ - public com.google.protobuf.TimestampOrBuilder getAttemptDeadlineOrBuilder() { - if (attemptDeadlineBuilder_ != null) { - return attemptDeadlineBuilder_.getMessageOrBuilder(); - } else { - return attemptDeadline_ == null ? - com.google.protobuf.Timestamp.getDefaultInstance() : attemptDeadline_; - } - } - /** - *
        -       * The deadline dictated by the attempt to the server.
        -       * 
        - * - * .google.protobuf.Timestamp attempt_deadline = 2; - */ - private com.google.protobuf.SingleFieldBuilderV3< - com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder> - getAttemptDeadlineFieldBuilder() { - if (attemptDeadlineBuilder_ == null) { - attemptDeadlineBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder>( - getAttemptDeadline(), - getParentForChildren(), - isClean()); - attemptDeadline_ = null; - } - return attemptDeadlineBuilder_; - } - - private com.google.protobuf.Timestamp responseTime_; - private com.google.protobuf.SingleFieldBuilderV3< - com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder> responseTimeBuilder_; - /** - *
        -       * The time that the server responded to the RPC attempt. Used for
        -       * calculating attempt_delay.
        -       * 
        - * - * .google.protobuf.Timestamp response_time = 3; - * @return Whether the responseTime field is set. - */ - public boolean hasResponseTime() { - return responseTimeBuilder_ != null || responseTime_ != null; - } - /** - *
        -       * The time that the server responded to the RPC attempt. Used for
        -       * calculating attempt_delay.
        -       * 
        - * - * .google.protobuf.Timestamp response_time = 3; - * @return The responseTime. - */ - public com.google.protobuf.Timestamp getResponseTime() { - if (responseTimeBuilder_ == null) { - return responseTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : responseTime_; - } else { - return responseTimeBuilder_.getMessage(); - } - } - /** - *
        -       * The time that the server responded to the RPC attempt. Used for
        -       * calculating attempt_delay.
        -       * 
        - * - * .google.protobuf.Timestamp response_time = 3; - */ - public Builder setResponseTime(com.google.protobuf.Timestamp value) { - if (responseTimeBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - responseTime_ = value; - onChanged(); - } else { - responseTimeBuilder_.setMessage(value); - } - - return this; - } - /** - *
        -       * The time that the server responded to the RPC attempt. Used for
        -       * calculating attempt_delay.
        -       * 
        - * - * .google.protobuf.Timestamp response_time = 3; - */ - public Builder setResponseTime( - com.google.protobuf.Timestamp.Builder builderForValue) { - if (responseTimeBuilder_ == null) { - responseTime_ = builderForValue.build(); - onChanged(); - } else { - responseTimeBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - *
        -       * The time that the server responded to the RPC attempt. Used for
        -       * calculating attempt_delay.
        -       * 
        - * - * .google.protobuf.Timestamp response_time = 3; - */ - public Builder mergeResponseTime(com.google.protobuf.Timestamp value) { - if (responseTimeBuilder_ == null) { - if (responseTime_ != null) { - responseTime_ = - com.google.protobuf.Timestamp.newBuilder(responseTime_).mergeFrom(value).buildPartial(); - } else { - responseTime_ = value; - } - onChanged(); - } else { - responseTimeBuilder_.mergeFrom(value); - } - - return this; - } - /** - *
        -       * The time that the server responded to the RPC attempt. Used for
        -       * calculating attempt_delay.
        -       * 
        - * - * .google.protobuf.Timestamp response_time = 3; - */ - public Builder clearResponseTime() { - if (responseTimeBuilder_ == null) { - responseTime_ = null; - onChanged(); - } else { - responseTime_ = null; - responseTimeBuilder_ = null; - } - - return this; - } - /** - *
        -       * The time that the server responded to the RPC attempt. Used for
        -       * calculating attempt_delay.
        -       * 
        - * - * .google.protobuf.Timestamp response_time = 3; - */ - public com.google.protobuf.Timestamp.Builder getResponseTimeBuilder() { - - onChanged(); - return getResponseTimeFieldBuilder().getBuilder(); - } - /** - *
        -       * The time that the server responded to the RPC attempt. Used for
        -       * calculating attempt_delay.
        -       * 
        - * - * .google.protobuf.Timestamp response_time = 3; - */ - public com.google.protobuf.TimestampOrBuilder getResponseTimeOrBuilder() { - if (responseTimeBuilder_ != null) { - return responseTimeBuilder_.getMessageOrBuilder(); - } else { - return responseTime_ == null ? - com.google.protobuf.Timestamp.getDefaultInstance() : responseTime_; - } - } - /** - *
        -       * The time that the server responded to the RPC attempt. Used for
        -       * calculating attempt_delay.
        -       * 
        - * - * .google.protobuf.Timestamp response_time = 3; - */ - private com.google.protobuf.SingleFieldBuilderV3< - com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder> - getResponseTimeFieldBuilder() { - if (responseTimeBuilder_ == null) { - responseTimeBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder>( - getResponseTime(), - getParentForChildren(), - isClean()); - responseTime_ = null; - } - return responseTimeBuilder_; - } - - private com.google.protobuf.Duration attemptDelay_; - private com.google.protobuf.SingleFieldBuilderV3< - com.google.protobuf.Duration, com.google.protobuf.Duration.Builder, com.google.protobuf.DurationOrBuilder> attemptDelayBuilder_; - /** - *
        -       * The server perceived delay between sending the last response and
        -       * receiving this attempt. Used for validating attempt delay backoff.
        -       * 
        - * - * .google.protobuf.Duration attempt_delay = 4; - * @return Whether the attemptDelay field is set. - */ - public boolean hasAttemptDelay() { - return attemptDelayBuilder_ != null || attemptDelay_ != null; - } - /** - *
        -       * The server perceived delay between sending the last response and
        -       * receiving this attempt. Used for validating attempt delay backoff.
        -       * 
        - * - * .google.protobuf.Duration attempt_delay = 4; - * @return The attemptDelay. - */ - public com.google.protobuf.Duration getAttemptDelay() { - if (attemptDelayBuilder_ == null) { - return attemptDelay_ == null ? com.google.protobuf.Duration.getDefaultInstance() : attemptDelay_; - } else { - return attemptDelayBuilder_.getMessage(); - } - } - /** - *
        -       * The server perceived delay between sending the last response and
        -       * receiving this attempt. Used for validating attempt delay backoff.
        -       * 
        - * - * .google.protobuf.Duration attempt_delay = 4; - */ - public Builder setAttemptDelay(com.google.protobuf.Duration value) { - if (attemptDelayBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - attemptDelay_ = value; - onChanged(); - } else { - attemptDelayBuilder_.setMessage(value); - } - - return this; - } - /** - *
        -       * The server perceived delay between sending the last response and
        -       * receiving this attempt. Used for validating attempt delay backoff.
        -       * 
        - * - * .google.protobuf.Duration attempt_delay = 4; - */ - public Builder setAttemptDelay( - com.google.protobuf.Duration.Builder builderForValue) { - if (attemptDelayBuilder_ == null) { - attemptDelay_ = builderForValue.build(); - onChanged(); - } else { - attemptDelayBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - *
        -       * The server perceived delay between sending the last response and
        -       * receiving this attempt. Used for validating attempt delay backoff.
        -       * 
        - * - * .google.protobuf.Duration attempt_delay = 4; - */ - public Builder mergeAttemptDelay(com.google.protobuf.Duration value) { - if (attemptDelayBuilder_ == null) { - if (attemptDelay_ != null) { - attemptDelay_ = - com.google.protobuf.Duration.newBuilder(attemptDelay_).mergeFrom(value).buildPartial(); - } else { - attemptDelay_ = value; - } - onChanged(); - } else { - attemptDelayBuilder_.mergeFrom(value); - } - - return this; - } - /** - *
        -       * The server perceived delay between sending the last response and
        -       * receiving this attempt. Used for validating attempt delay backoff.
        -       * 
        - * - * .google.protobuf.Duration attempt_delay = 4; - */ - public Builder clearAttemptDelay() { - if (attemptDelayBuilder_ == null) { - attemptDelay_ = null; - onChanged(); - } else { - attemptDelay_ = null; - attemptDelayBuilder_ = null; - } - - return this; - } - /** - *
        -       * The server perceived delay between sending the last response and
        -       * receiving this attempt. Used for validating attempt delay backoff.
        -       * 
        - * - * .google.protobuf.Duration attempt_delay = 4; - */ - public com.google.protobuf.Duration.Builder getAttemptDelayBuilder() { - - onChanged(); - return getAttemptDelayFieldBuilder().getBuilder(); - } - /** - *
        -       * The server perceived delay between sending the last response and
        -       * receiving this attempt. Used for validating attempt delay backoff.
        -       * 
        - * - * .google.protobuf.Duration attempt_delay = 4; - */ - public com.google.protobuf.DurationOrBuilder getAttemptDelayOrBuilder() { - if (attemptDelayBuilder_ != null) { - return attemptDelayBuilder_.getMessageOrBuilder(); - } else { - return attemptDelay_ == null ? - com.google.protobuf.Duration.getDefaultInstance() : attemptDelay_; - } - } - /** - *
        -       * The server perceived delay between sending the last response and
        -       * receiving this attempt. Used for validating attempt delay backoff.
        -       * 
        - * - * .google.protobuf.Duration attempt_delay = 4; - */ - private com.google.protobuf.SingleFieldBuilderV3< - com.google.protobuf.Duration, com.google.protobuf.Duration.Builder, com.google.protobuf.DurationOrBuilder> - getAttemptDelayFieldBuilder() { - if (attemptDelayBuilder_ == null) { - attemptDelayBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - com.google.protobuf.Duration, com.google.protobuf.Duration.Builder, com.google.protobuf.DurationOrBuilder>( - getAttemptDelay(), - getParentForChildren(), - isClean()); - attemptDelay_ = null; - } - return attemptDelayBuilder_; - } - - private com.google.rpc.Status status_; - private com.google.protobuf.SingleFieldBuilderV3< - com.google.rpc.Status, com.google.rpc.Status.Builder, com.google.rpc.StatusOrBuilder> statusBuilder_; - /** - *
        -       * The status returned to the attempt.
        -       * 
        - * - * .google.rpc.Status status = 5; - * @return Whether the status field is set. - */ - public boolean hasStatus() { - return statusBuilder_ != null || status_ != null; - } - /** - *
        -       * The status returned to the attempt.
        -       * 
        - * - * .google.rpc.Status status = 5; - * @return The status. - */ - public com.google.rpc.Status getStatus() { - if (statusBuilder_ == null) { - return status_ == null ? com.google.rpc.Status.getDefaultInstance() : status_; - } else { - return statusBuilder_.getMessage(); - } - } - /** - *
        -       * The status returned to the attempt.
        -       * 
        - * - * .google.rpc.Status status = 5; - */ - public Builder setStatus(com.google.rpc.Status value) { - if (statusBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - status_ = value; - onChanged(); - } else { - statusBuilder_.setMessage(value); - } - - return this; - } - /** - *
        -       * The status returned to the attempt.
        -       * 
        - * - * .google.rpc.Status status = 5; - */ - public Builder setStatus( - com.google.rpc.Status.Builder builderForValue) { - if (statusBuilder_ == null) { - status_ = builderForValue.build(); - onChanged(); - } else { - statusBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - *
        -       * The status returned to the attempt.
        -       * 
        - * - * .google.rpc.Status status = 5; - */ - public Builder mergeStatus(com.google.rpc.Status value) { - if (statusBuilder_ == null) { - if (status_ != null) { - status_ = - com.google.rpc.Status.newBuilder(status_).mergeFrom(value).buildPartial(); - } else { - status_ = value; - } - onChanged(); - } else { - statusBuilder_.mergeFrom(value); - } - - return this; - } - /** - *
        -       * The status returned to the attempt.
        -       * 
        - * - * .google.rpc.Status status = 5; - */ - public Builder clearStatus() { - if (statusBuilder_ == null) { - status_ = null; - onChanged(); - } else { - status_ = null; - statusBuilder_ = null; - } - - return this; - } - /** - *
        -       * The status returned to the attempt.
        -       * 
        - * - * .google.rpc.Status status = 5; - */ - public com.google.rpc.Status.Builder getStatusBuilder() { - - onChanged(); - return getStatusFieldBuilder().getBuilder(); - } - /** - *
        -       * The status returned to the attempt.
        -       * 
        - * - * .google.rpc.Status status = 5; - */ - public com.google.rpc.StatusOrBuilder getStatusOrBuilder() { - if (statusBuilder_ != null) { - return statusBuilder_.getMessageOrBuilder(); - } else { - return status_ == null ? - com.google.rpc.Status.getDefaultInstance() : status_; - } - } - /** - *
        -       * The status returned to the attempt.
        -       * 
        - * - * .google.rpc.Status status = 5; - */ - private com.google.protobuf.SingleFieldBuilderV3< - com.google.rpc.Status, com.google.rpc.Status.Builder, com.google.rpc.StatusOrBuilder> - getStatusFieldBuilder() { - if (statusBuilder_ == null) { - statusBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - com.google.rpc.Status, com.google.rpc.Status.Builder, com.google.rpc.StatusOrBuilder>( - getStatus(), - getParentForChildren(), - isClean()); - status_ = null; - } - return statusBuilder_; - } - @java.lang.Override - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - - // @@protoc_insertion_point(builder_scope:google.showcase.v1beta1.SequenceReport.Attempt) - } - - // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.SequenceReport.Attempt) - private static final com.google.showcase.v1beta1.SequenceReport.Attempt DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new com.google.showcase.v1beta1.SequenceReport.Attempt(); - } - - public static com.google.showcase.v1beta1.SequenceReport.Attempt getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public Attempt parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new Attempt(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public com.google.showcase.v1beta1.SequenceReport.Attempt getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - - } - - public static final int NAME_FIELD_NUMBER = 1; - private volatile java.lang.Object name_; - /** - * 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; - } - } - /** - * 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 ATTEMPTS_FIELD_NUMBER = 2; - private java.util.List attempts_; - /** - *
        -   * The set of RPC attempts received by the server for a Sequence.
        -   * 
        - * - * repeated .google.showcase.v1beta1.SequenceReport.Attempt attempts = 2; - */ - @java.lang.Override - public java.util.List getAttemptsList() { - return attempts_; - } - /** - *
        -   * The set of RPC attempts received by the server for a Sequence.
        -   * 
        - * - * repeated .google.showcase.v1beta1.SequenceReport.Attempt attempts = 2; - */ - @java.lang.Override - public java.util.List - getAttemptsOrBuilderList() { - return attempts_; - } - /** - *
        -   * The set of RPC attempts received by the server for a Sequence.
        -   * 
        - * - * repeated .google.showcase.v1beta1.SequenceReport.Attempt attempts = 2; - */ - @java.lang.Override - public int getAttemptsCount() { - return attempts_.size(); - } - /** - *
        -   * The set of RPC attempts received by the server for a Sequence.
        -   * 
        - * - * repeated .google.showcase.v1beta1.SequenceReport.Attempt attempts = 2; - */ - @java.lang.Override - public com.google.showcase.v1beta1.SequenceReport.Attempt getAttempts(int index) { - return attempts_.get(index); - } - /** - *
        -   * The set of RPC attempts received by the server for a Sequence.
        -   * 
        - * - * repeated .google.showcase.v1beta1.SequenceReport.Attempt attempts = 2; - */ - @java.lang.Override - public com.google.showcase.v1beta1.SequenceReport.AttemptOrBuilder getAttemptsOrBuilder( - int index) { - return attempts_.get(index); - } - - private byte memoizedIsInitialized = -1; - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); - } - for (int i = 0; i < attempts_.size(); i++) { - output.writeMessage(2, attempts_.get(i)); - } - unknownFields.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_); - } - for (int i = 0; i < attempts_.size(); i++) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(2, attempts_.get(i)); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof com.google.showcase.v1beta1.SequenceReport)) { - return super.equals(obj); - } - com.google.showcase.v1beta1.SequenceReport other = (com.google.showcase.v1beta1.SequenceReport) obj; - - if (!getName() - .equals(other.getName())) return false; - if (!getAttemptsList() - .equals(other.getAttemptsList())) return false; - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - hash = (37 * hash) + NAME_FIELD_NUMBER; - hash = (53 * hash) + getName().hashCode(); - if (getAttemptsCount() > 0) { - hash = (37 * hash) + ATTEMPTS_FIELD_NUMBER; - hash = (53 * hash) + getAttemptsList().hashCode(); - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.showcase.v1beta1.SequenceReport parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.showcase.v1beta1.SequenceReport parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.showcase.v1beta1.SequenceReport parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.showcase.v1beta1.SequenceReport 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.showcase.v1beta1.SequenceReport parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.showcase.v1beta1.SequenceReport parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.showcase.v1beta1.SequenceReport parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static com.google.showcase.v1beta1.SequenceReport 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.showcase.v1beta1.SequenceReport parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static com.google.showcase.v1beta1.SequenceReport 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.showcase.v1beta1.SequenceReport parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static com.google.showcase.v1beta1.SequenceReport 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.showcase.v1beta1.SequenceReport prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - @java.lang.Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - * Protobuf type {@code google.showcase.v1beta1.SequenceReport} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.SequenceReport) - com.google.showcase.v1beta1.SequenceReportOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.google.showcase.v1beta1.SequenceOuterClass.internal_static_google_showcase_v1beta1_SequenceReport_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.showcase.v1beta1.SequenceOuterClass.internal_static_google_showcase_v1beta1_SequenceReport_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.showcase.v1beta1.SequenceReport.class, com.google.showcase.v1beta1.SequenceReport.Builder.class); - } - - // Construct using com.google.showcase.v1beta1.SequenceReport.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { - getAttemptsFieldBuilder(); - } - } - @java.lang.Override - public Builder clear() { - super.clear(); - name_ = ""; - - if (attemptsBuilder_ == null) { - attempts_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - } else { - attemptsBuilder_.clear(); - } - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return com.google.showcase.v1beta1.SequenceOuterClass.internal_static_google_showcase_v1beta1_SequenceReport_descriptor; - } - - @java.lang.Override - public com.google.showcase.v1beta1.SequenceReport getDefaultInstanceForType() { - return com.google.showcase.v1beta1.SequenceReport.getDefaultInstance(); - } - - @java.lang.Override - public com.google.showcase.v1beta1.SequenceReport build() { - com.google.showcase.v1beta1.SequenceReport result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.showcase.v1beta1.SequenceReport buildPartial() { - com.google.showcase.v1beta1.SequenceReport result = new com.google.showcase.v1beta1.SequenceReport(this); - int from_bitField0_ = bitField0_; - result.name_ = name_; - if (attemptsBuilder_ == null) { - if (((bitField0_ & 0x00000001) != 0)) { - attempts_ = java.util.Collections.unmodifiableList(attempts_); - bitField0_ = (bitField0_ & ~0x00000001); - } - result.attempts_ = attempts_; - } else { - result.attempts_ = attemptsBuilder_.build(); - } - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.setField(field, value); - } - @java.lang.Override - public Builder clearField( - com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - @java.lang.Override - public Builder clearOneof( - com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.addRepeatedField(field, value); - } - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof com.google.showcase.v1beta1.SequenceReport) { - return mergeFrom((com.google.showcase.v1beta1.SequenceReport)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.showcase.v1beta1.SequenceReport other) { - if (other == com.google.showcase.v1beta1.SequenceReport.getDefaultInstance()) return this; - if (!other.getName().isEmpty()) { - name_ = other.name_; - onChanged(); - } - if (attemptsBuilder_ == null) { - if (!other.attempts_.isEmpty()) { - if (attempts_.isEmpty()) { - attempts_ = other.attempts_; - bitField0_ = (bitField0_ & ~0x00000001); - } else { - ensureAttemptsIsMutable(); - attempts_.addAll(other.attempts_); - } - onChanged(); - } - } else { - if (!other.attempts_.isEmpty()) { - if (attemptsBuilder_.isEmpty()) { - attemptsBuilder_.dispose(); - attemptsBuilder_ = null; - attempts_ = other.attempts_; - bitField0_ = (bitField0_ & ~0x00000001); - attemptsBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? - getAttemptsFieldBuilder() : null; - } else { - attemptsBuilder_.addAllMessages(other.attempts_); - } - } - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - com.google.showcase.v1beta1.SequenceReport parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (com.google.showcase.v1beta1.SequenceReport) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - private int bitField0_; - - private java.lang.Object name_ = ""; - /** - * 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; - } - } - /** - * 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; - } - } - /** - * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param value The name to set. - * @return This builder for chaining. - */ - public Builder setName( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - name_ = value; - onChanged(); - return this; - } - /** - * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return This builder for chaining. - */ - public Builder clearName() { - - name_ = getDefaultInstance().getName(); - onChanged(); - return this; - } - /** - * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param value The bytes for name to set. - * @return This builder for chaining. - */ - public Builder setNameBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - name_ = value; - onChanged(); - return this; - } - - private java.util.List attempts_ = - java.util.Collections.emptyList(); - private void ensureAttemptsIsMutable() { - if (!((bitField0_ & 0x00000001) != 0)) { - attempts_ = new java.util.ArrayList(attempts_); - bitField0_ |= 0x00000001; - } - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - com.google.showcase.v1beta1.SequenceReport.Attempt, com.google.showcase.v1beta1.SequenceReport.Attempt.Builder, com.google.showcase.v1beta1.SequenceReport.AttemptOrBuilder> attemptsBuilder_; - - /** - *
        -     * The set of RPC attempts received by the server for a Sequence.
        -     * 
        - * - * repeated .google.showcase.v1beta1.SequenceReport.Attempt attempts = 2; - */ - public java.util.List getAttemptsList() { - if (attemptsBuilder_ == null) { - return java.util.Collections.unmodifiableList(attempts_); - } else { - return attemptsBuilder_.getMessageList(); - } - } - /** - *
        -     * The set of RPC attempts received by the server for a Sequence.
        -     * 
        - * - * repeated .google.showcase.v1beta1.SequenceReport.Attempt attempts = 2; - */ - public int getAttemptsCount() { - if (attemptsBuilder_ == null) { - return attempts_.size(); - } else { - return attemptsBuilder_.getCount(); - } - } - /** - *
        -     * The set of RPC attempts received by the server for a Sequence.
        -     * 
        - * - * repeated .google.showcase.v1beta1.SequenceReport.Attempt attempts = 2; - */ - public com.google.showcase.v1beta1.SequenceReport.Attempt getAttempts(int index) { - if (attemptsBuilder_ == null) { - return attempts_.get(index); - } else { - return attemptsBuilder_.getMessage(index); - } - } - /** - *
        -     * The set of RPC attempts received by the server for a Sequence.
        -     * 
        - * - * repeated .google.showcase.v1beta1.SequenceReport.Attempt attempts = 2; - */ - public Builder setAttempts( - int index, com.google.showcase.v1beta1.SequenceReport.Attempt value) { - if (attemptsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureAttemptsIsMutable(); - attempts_.set(index, value); - onChanged(); - } else { - attemptsBuilder_.setMessage(index, value); - } - return this; - } - /** - *
        -     * The set of RPC attempts received by the server for a Sequence.
        -     * 
        - * - * repeated .google.showcase.v1beta1.SequenceReport.Attempt attempts = 2; - */ - public Builder setAttempts( - int index, com.google.showcase.v1beta1.SequenceReport.Attempt.Builder builderForValue) { - if (attemptsBuilder_ == null) { - ensureAttemptsIsMutable(); - attempts_.set(index, builderForValue.build()); - onChanged(); - } else { - attemptsBuilder_.setMessage(index, builderForValue.build()); - } - return this; - } - /** - *
        -     * The set of RPC attempts received by the server for a Sequence.
        -     * 
        - * - * repeated .google.showcase.v1beta1.SequenceReport.Attempt attempts = 2; - */ - public Builder addAttempts(com.google.showcase.v1beta1.SequenceReport.Attempt value) { - if (attemptsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureAttemptsIsMutable(); - attempts_.add(value); - onChanged(); - } else { - attemptsBuilder_.addMessage(value); - } - return this; - } - /** - *
        -     * The set of RPC attempts received by the server for a Sequence.
        -     * 
        - * - * repeated .google.showcase.v1beta1.SequenceReport.Attempt attempts = 2; - */ - public Builder addAttempts( - int index, com.google.showcase.v1beta1.SequenceReport.Attempt value) { - if (attemptsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureAttemptsIsMutable(); - attempts_.add(index, value); - onChanged(); - } else { - attemptsBuilder_.addMessage(index, value); - } - return this; - } - /** - *
        -     * The set of RPC attempts received by the server for a Sequence.
        -     * 
        - * - * repeated .google.showcase.v1beta1.SequenceReport.Attempt attempts = 2; - */ - public Builder addAttempts( - com.google.showcase.v1beta1.SequenceReport.Attempt.Builder builderForValue) { - if (attemptsBuilder_ == null) { - ensureAttemptsIsMutable(); - attempts_.add(builderForValue.build()); - onChanged(); - } else { - attemptsBuilder_.addMessage(builderForValue.build()); - } - return this; - } - /** - *
        -     * The set of RPC attempts received by the server for a Sequence.
        -     * 
        - * - * repeated .google.showcase.v1beta1.SequenceReport.Attempt attempts = 2; - */ - public Builder addAttempts( - int index, com.google.showcase.v1beta1.SequenceReport.Attempt.Builder builderForValue) { - if (attemptsBuilder_ == null) { - ensureAttemptsIsMutable(); - attempts_.add(index, builderForValue.build()); - onChanged(); - } else { - attemptsBuilder_.addMessage(index, builderForValue.build()); - } - return this; - } - /** - *
        -     * The set of RPC attempts received by the server for a Sequence.
        -     * 
        - * - * repeated .google.showcase.v1beta1.SequenceReport.Attempt attempts = 2; - */ - public Builder addAllAttempts( - java.lang.Iterable values) { - if (attemptsBuilder_ == null) { - ensureAttemptsIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, attempts_); - onChanged(); - } else { - attemptsBuilder_.addAllMessages(values); - } - return this; - } - /** - *
        -     * The set of RPC attempts received by the server for a Sequence.
        -     * 
        - * - * repeated .google.showcase.v1beta1.SequenceReport.Attempt attempts = 2; - */ - public Builder clearAttempts() { - if (attemptsBuilder_ == null) { - attempts_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - onChanged(); - } else { - attemptsBuilder_.clear(); - } - return this; - } - /** - *
        -     * The set of RPC attempts received by the server for a Sequence.
        -     * 
        - * - * repeated .google.showcase.v1beta1.SequenceReport.Attempt attempts = 2; - */ - public Builder removeAttempts(int index) { - if (attemptsBuilder_ == null) { - ensureAttemptsIsMutable(); - attempts_.remove(index); - onChanged(); - } else { - attemptsBuilder_.remove(index); - } - return this; - } - /** - *
        -     * The set of RPC attempts received by the server for a Sequence.
        -     * 
        - * - * repeated .google.showcase.v1beta1.SequenceReport.Attempt attempts = 2; - */ - public com.google.showcase.v1beta1.SequenceReport.Attempt.Builder getAttemptsBuilder( - int index) { - return getAttemptsFieldBuilder().getBuilder(index); - } - /** - *
        -     * The set of RPC attempts received by the server for a Sequence.
        -     * 
        - * - * repeated .google.showcase.v1beta1.SequenceReport.Attempt attempts = 2; - */ - public com.google.showcase.v1beta1.SequenceReport.AttemptOrBuilder getAttemptsOrBuilder( - int index) { - if (attemptsBuilder_ == null) { - return attempts_.get(index); } else { - return attemptsBuilder_.getMessageOrBuilder(index); - } - } - /** - *
        -     * The set of RPC attempts received by the server for a Sequence.
        -     * 
        - * - * repeated .google.showcase.v1beta1.SequenceReport.Attempt attempts = 2; - */ - public java.util.List - getAttemptsOrBuilderList() { - if (attemptsBuilder_ != null) { - return attemptsBuilder_.getMessageOrBuilderList(); - } else { - return java.util.Collections.unmodifiableList(attempts_); - } - } - /** - *
        -     * The set of RPC attempts received by the server for a Sequence.
        -     * 
        - * - * repeated .google.showcase.v1beta1.SequenceReport.Attempt attempts = 2; - */ - public com.google.showcase.v1beta1.SequenceReport.Attempt.Builder addAttemptsBuilder() { - return getAttemptsFieldBuilder().addBuilder( - com.google.showcase.v1beta1.SequenceReport.Attempt.getDefaultInstance()); - } - /** - *
        -     * The set of RPC attempts received by the server for a Sequence.
        -     * 
        - * - * repeated .google.showcase.v1beta1.SequenceReport.Attempt attempts = 2; - */ - public com.google.showcase.v1beta1.SequenceReport.Attempt.Builder addAttemptsBuilder( - int index) { - return getAttemptsFieldBuilder().addBuilder( - index, com.google.showcase.v1beta1.SequenceReport.Attempt.getDefaultInstance()); - } - /** - *
        -     * The set of RPC attempts received by the server for a Sequence.
        -     * 
        - * - * repeated .google.showcase.v1beta1.SequenceReport.Attempt attempts = 2; - */ - public java.util.List - getAttemptsBuilderList() { - return getAttemptsFieldBuilder().getBuilderList(); - } - private com.google.protobuf.RepeatedFieldBuilderV3< - com.google.showcase.v1beta1.SequenceReport.Attempt, com.google.showcase.v1beta1.SequenceReport.Attempt.Builder, com.google.showcase.v1beta1.SequenceReport.AttemptOrBuilder> - getAttemptsFieldBuilder() { - if (attemptsBuilder_ == null) { - attemptsBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< - com.google.showcase.v1beta1.SequenceReport.Attempt, com.google.showcase.v1beta1.SequenceReport.Attempt.Builder, com.google.showcase.v1beta1.SequenceReport.AttemptOrBuilder>( - attempts_, - ((bitField0_ & 0x00000001) != 0), - getParentForChildren(), - isClean()); - attempts_ = null; - } - return attemptsBuilder_; - } - @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.showcase.v1beta1.SequenceReport) - } - - // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.SequenceReport) - private static final com.google.showcase.v1beta1.SequenceReport DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new com.google.showcase.v1beta1.SequenceReport(); - } - - public static com.google.showcase.v1beta1.SequenceReport getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public SequenceReport parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new SequenceReport(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public com.google.showcase.v1beta1.SequenceReport getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/SequenceReportName.java b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/SequenceReportName.java deleted file mode 100644 index 80742478a3..0000000000 --- a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/SequenceReportName.java +++ /dev/null @@ -1,168 +0,0 @@ -/* - * 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 - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1; - -import com.google.api.pathtemplate.PathTemplate; -import com.google.api.resourcenames.ResourceName; -import com.google.common.base.Preconditions; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import javax.annotation.Generated; - -// AUTO-GENERATED DOCUMENTATION AND CLASS. -@Generated("by gapic-generator-java") -public class SequenceReportName implements ResourceName { - private static final PathTemplate SEQUENCE = - PathTemplate.createWithoutUrlEncoding("sequences/{sequence}/sequenceReport"); - private volatile Map fieldValuesMap; - private final String sequence; - - @Deprecated - protected SequenceReportName() { - sequence = null; - } - - private SequenceReportName(Builder builder) { - sequence = Preconditions.checkNotNull(builder.getSequence()); - } - - public String getSequence() { - return sequence; - } - - public static Builder newBuilder() { - return new Builder(); - } - - public Builder toBuilder() { - return new Builder(this); - } - - public static SequenceReportName of(String sequence) { - return newBuilder().setSequence(sequence).build(); - } - - public static String format(String sequence) { - return newBuilder().setSequence(sequence).build().toString(); - } - - public static SequenceReportName parse(String formattedString) { - if (formattedString.isEmpty()) { - return null; - } - Map matchMap = - SEQUENCE.validatedMatch( - formattedString, "SequenceReportName.parse: formattedString not in valid format"); - return of(matchMap.get("sequence")); - } - - 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 (SequenceReportName value : values) { - if (value == null) { - list.add(""); - } else { - list.add(value.toString()); - } - } - return list; - } - - public static boolean isParsableFrom(String formattedString) { - return SEQUENCE.matches(formattedString); - } - - @Override - public Map getFieldValuesMap() { - if (fieldValuesMap == null) { - synchronized (this) { - if (fieldValuesMap == null) { - ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); - if (sequence != null) { - fieldMapBuilder.put("sequence", sequence); - } - fieldValuesMap = fieldMapBuilder.build(); - } - } - } - return fieldValuesMap; - } - - public String getFieldValue(String fieldName) { - return getFieldValuesMap().get(fieldName); - } - - @Override - public String toString() { - return SEQUENCE.instantiate("sequence", sequence); - } - - @Override - public boolean equals(Object o) { - if (o == this) { - return true; - } - if (o != null || getClass() == o.getClass()) { - SequenceReportName that = ((SequenceReportName) o); - return Objects.equals(this.sequence, that.sequence); - } - return false; - } - - @Override - public int hashCode() { - int h = 1; - h *= 1000003; - h ^= Objects.hashCode(sequence); - return h; - } - - /** Builder for sequences/{sequence}/sequenceReport. */ - public static class Builder { - private String sequence; - - protected Builder() {} - - public String getSequence() { - return sequence; - } - - public Builder setSequence(String sequence) { - this.sequence = sequence; - return this; - } - - private Builder(SequenceReportName sequenceReportName) { - this.sequence = sequenceReportName.sequence; - } - - public SequenceReportName build() { - return new SequenceReportName(this); - } - } -} diff --git a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/SequenceReportOrBuilder.java b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/SequenceReportOrBuilder.java deleted file mode 100644 index 287d6d4661..0000000000 --- a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/SequenceReportOrBuilder.java +++ /dev/null @@ -1,65 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: schema/google/showcase/v1beta1/sequence.proto - -package com.google.showcase.v1beta1; - -public interface SequenceReportOrBuilder extends - // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.SequenceReport) - com.google.protobuf.MessageOrBuilder { - - /** - * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return The name. - */ - java.lang.String getName(); - /** - * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return The bytes for name. - */ - com.google.protobuf.ByteString - getNameBytes(); - - /** - *
        -   * The set of RPC attempts received by the server for a Sequence.
        -   * 
        - * - * repeated .google.showcase.v1beta1.SequenceReport.Attempt attempts = 2; - */ - java.util.List - getAttemptsList(); - /** - *
        -   * The set of RPC attempts received by the server for a Sequence.
        -   * 
        - * - * repeated .google.showcase.v1beta1.SequenceReport.Attempt attempts = 2; - */ - com.google.showcase.v1beta1.SequenceReport.Attempt getAttempts(int index); - /** - *
        -   * The set of RPC attempts received by the server for a Sequence.
        -   * 
        - * - * repeated .google.showcase.v1beta1.SequenceReport.Attempt attempts = 2; - */ - int getAttemptsCount(); - /** - *
        -   * The set of RPC attempts received by the server for a Sequence.
        -   * 
        - * - * repeated .google.showcase.v1beta1.SequenceReport.Attempt attempts = 2; - */ - java.util.List - getAttemptsOrBuilderList(); - /** - *
        -   * The set of RPC attempts received by the server for a Sequence.
        -   * 
        - * - * repeated .google.showcase.v1beta1.SequenceReport.Attempt attempts = 2; - */ - com.google.showcase.v1beta1.SequenceReport.AttemptOrBuilder getAttemptsOrBuilder( - int index); -} diff --git a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/Session.java b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/Session.java deleted file mode 100644 index 3da8c29963..0000000000 --- a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/Session.java +++ /dev/null @@ -1,879 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: schema/google/showcase/v1beta1/testing.proto - -package com.google.showcase.v1beta1; - -/** - *
        - * A session is a suite of tests, generally being made in the context
        - * of testing code generation.
        - * A session defines tests it may expect, based on which version of the
        - * code generation spec is in use.
        - * 
        - * - * Protobuf type {@code google.showcase.v1beta1.Session} - */ -public final class Session extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.Session) - SessionOrBuilder { -private static final long serialVersionUID = 0L; - // Use Session.newBuilder() to construct. - private Session(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private Session() { - name_ = ""; - version_ = 0; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new Session(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private Session( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: { - java.lang.String s = input.readStringRequireUtf8(); - - name_ = s; - break; - } - case 16: { - int rawValue = input.readEnum(); - - version_ = rawValue; - break; - } - default: { - if (!parseUnknownField( - input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException( - e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.google.showcase.v1beta1.TestingOuterClass.internal_static_google_showcase_v1beta1_Session_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.showcase.v1beta1.TestingOuterClass.internal_static_google_showcase_v1beta1_Session_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.showcase.v1beta1.Session.class, com.google.showcase.v1beta1.Session.Builder.class); - } - - /** - *
        -   * The specification versions understood by Showcase.
        -   * 
        - * - * Protobuf enum {@code google.showcase.v1beta1.Session.Version} - */ - public enum Version - implements com.google.protobuf.ProtocolMessageEnum { - /** - *
        -     * Unspecified version. If passed on creation, the session will default
        -     * to using the latest stable release.
        -     * 
        - * - * VERSION_UNSPECIFIED = 0; - */ - VERSION_UNSPECIFIED(0), - /** - *
        -     * The latest v1. Currently, this is v1.0.
        -     * 
        - * - * V1_LATEST = 1; - */ - V1_LATEST(1), - /** - *
        -     * v1.0. (Until the spec is "GA", this will be a moving target.)
        -     * 
        - * - * V1_0 = 2; - */ - V1_0(2), - UNRECOGNIZED(-1), - ; - - /** - *
        -     * Unspecified version. If passed on creation, the session will default
        -     * to using the latest stable release.
        -     * 
        - * - * VERSION_UNSPECIFIED = 0; - */ - public static final int VERSION_UNSPECIFIED_VALUE = 0; - /** - *
        -     * The latest v1. Currently, this is v1.0.
        -     * 
        - * - * V1_LATEST = 1; - */ - public static final int V1_LATEST_VALUE = 1; - /** - *
        -     * v1.0. (Until the spec is "GA", this will be a moving target.)
        -     * 
        - * - * V1_0 = 2; - */ - public static final int V1_0_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 Version 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 Version forNumber(int value) { - switch (value) { - case 0: return VERSION_UNSPECIFIED; - case 1: return V1_LATEST; - case 2: return V1_0; - default: return null; - } - } - - public static com.google.protobuf.Internal.EnumLiteMap - internalGetValueMap() { - return internalValueMap; - } - private static final com.google.protobuf.Internal.EnumLiteMap< - Version> internalValueMap = - new com.google.protobuf.Internal.EnumLiteMap() { - public Version findValueByNumber(int number) { - return Version.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.showcase.v1beta1.Session.getDescriptor().getEnumTypes().get(0); - } - - private static final Version[] VALUES = values(); - - public static Version 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 Version(int value) { - this.value = value; - } - - // @@protoc_insertion_point(enum_scope:google.showcase.v1beta1.Session.Version) - } - - public static final int NAME_FIELD_NUMBER = 1; - private volatile java.lang.Object name_; - /** - *
        -   * The name of the session. The ID must conform to ^[a-z]+$
        -   * If this is not provided, Showcase chooses one at random.
        -   * 
        - * - * 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 name of the session. The ID must conform to ^[a-z]+$
        -   * If this is not provided, Showcase chooses one at random.
        -   * 
        - * - * 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 VERSION_FIELD_NUMBER = 2; - private int version_; - /** - *
        -   * Required. The version this session is using.
        -   * 
        - * - * .google.showcase.v1beta1.Session.Version version = 2; - * @return The enum numeric value on the wire for version. - */ - @java.lang.Override public int getVersionValue() { - return version_; - } - /** - *
        -   * Required. The version this session is using.
        -   * 
        - * - * .google.showcase.v1beta1.Session.Version version = 2; - * @return The version. - */ - @java.lang.Override public com.google.showcase.v1beta1.Session.Version getVersion() { - @SuppressWarnings("deprecation") - com.google.showcase.v1beta1.Session.Version result = com.google.showcase.v1beta1.Session.Version.valueOf(version_); - return result == null ? com.google.showcase.v1beta1.Session.Version.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 (version_ != com.google.showcase.v1beta1.Session.Version.VERSION_UNSPECIFIED.getNumber()) { - output.writeEnum(2, version_); - } - unknownFields.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 (version_ != com.google.showcase.v1beta1.Session.Version.VERSION_UNSPECIFIED.getNumber()) { - size += com.google.protobuf.CodedOutputStream - .computeEnumSize(2, version_); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof com.google.showcase.v1beta1.Session)) { - return super.equals(obj); - } - com.google.showcase.v1beta1.Session other = (com.google.showcase.v1beta1.Session) obj; - - if (!getName() - .equals(other.getName())) return false; - if (version_ != other.version_) return false; - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - hash = (37 * hash) + NAME_FIELD_NUMBER; - hash = (53 * hash) + getName().hashCode(); - hash = (37 * hash) + VERSION_FIELD_NUMBER; - hash = (53 * hash) + version_; - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.showcase.v1beta1.Session parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.showcase.v1beta1.Session parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.showcase.v1beta1.Session parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.showcase.v1beta1.Session 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.showcase.v1beta1.Session parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.showcase.v1beta1.Session parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.showcase.v1beta1.Session parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static com.google.showcase.v1beta1.Session 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.showcase.v1beta1.Session parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static com.google.showcase.v1beta1.Session 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.showcase.v1beta1.Session parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static com.google.showcase.v1beta1.Session 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.showcase.v1beta1.Session prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - @java.lang.Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - *
        -   * A session is a suite of tests, generally being made in the context
        -   * of testing code generation.
        -   * A session defines tests it may expect, based on which version of the
        -   * code generation spec is in use.
        -   * 
        - * - * Protobuf type {@code google.showcase.v1beta1.Session} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.Session) - com.google.showcase.v1beta1.SessionOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.google.showcase.v1beta1.TestingOuterClass.internal_static_google_showcase_v1beta1_Session_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.showcase.v1beta1.TestingOuterClass.internal_static_google_showcase_v1beta1_Session_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.showcase.v1beta1.Session.class, com.google.showcase.v1beta1.Session.Builder.class); - } - - // Construct using com.google.showcase.v1beta1.Session.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { - } - } - @java.lang.Override - public Builder clear() { - super.clear(); - name_ = ""; - - version_ = 0; - - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return com.google.showcase.v1beta1.TestingOuterClass.internal_static_google_showcase_v1beta1_Session_descriptor; - } - - @java.lang.Override - public com.google.showcase.v1beta1.Session getDefaultInstanceForType() { - return com.google.showcase.v1beta1.Session.getDefaultInstance(); - } - - @java.lang.Override - public com.google.showcase.v1beta1.Session build() { - com.google.showcase.v1beta1.Session result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.showcase.v1beta1.Session buildPartial() { - com.google.showcase.v1beta1.Session result = new com.google.showcase.v1beta1.Session(this); - result.name_ = name_; - result.version_ = version_; - 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.showcase.v1beta1.Session) { - return mergeFrom((com.google.showcase.v1beta1.Session)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.showcase.v1beta1.Session other) { - if (other == com.google.showcase.v1beta1.Session.getDefaultInstance()) return this; - if (!other.getName().isEmpty()) { - name_ = other.name_; - onChanged(); - } - if (other.version_ != 0) { - setVersionValue(other.getVersionValue()); - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - com.google.showcase.v1beta1.Session parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (com.google.showcase.v1beta1.Session) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private java.lang.Object name_ = ""; - /** - *
        -     * The name of the session. The ID must conform to ^[a-z]+$
        -     * If this is not provided, Showcase chooses one at random.
        -     * 
        - * - * 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 name of the session. The ID must conform to ^[a-z]+$
        -     * If this is not provided, Showcase chooses one at random.
        -     * 
        - * - * 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 name of the session. The ID must conform to ^[a-z]+$
        -     * If this is not provided, Showcase chooses one at random.
        -     * 
        - * - * string name = 1; - * @param value The name to set. - * @return This builder for chaining. - */ - public Builder setName( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - name_ = value; - onChanged(); - return this; - } - /** - *
        -     * The name of the session. The ID must conform to ^[a-z]+$
        -     * If this is not provided, Showcase chooses one at random.
        -     * 
        - * - * string name = 1; - * @return This builder for chaining. - */ - public Builder clearName() { - - name_ = getDefaultInstance().getName(); - onChanged(); - return this; - } - /** - *
        -     * The name of the session. The ID must conform to ^[a-z]+$
        -     * If this is not provided, Showcase chooses one at random.
        -     * 
        - * - * string name = 1; - * @param value The bytes for name to set. - * @return This builder for chaining. - */ - public Builder setNameBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - name_ = value; - onChanged(); - return this; - } - - private int version_ = 0; - /** - *
        -     * Required. The version this session is using.
        -     * 
        - * - * .google.showcase.v1beta1.Session.Version version = 2; - * @return The enum numeric value on the wire for version. - */ - @java.lang.Override public int getVersionValue() { - return version_; - } - /** - *
        -     * Required. The version this session is using.
        -     * 
        - * - * .google.showcase.v1beta1.Session.Version version = 2; - * @param value The enum numeric value on the wire for version to set. - * @return This builder for chaining. - */ - public Builder setVersionValue(int value) { - - version_ = value; - onChanged(); - return this; - } - /** - *
        -     * Required. The version this session is using.
        -     * 
        - * - * .google.showcase.v1beta1.Session.Version version = 2; - * @return The version. - */ - @java.lang.Override - public com.google.showcase.v1beta1.Session.Version getVersion() { - @SuppressWarnings("deprecation") - com.google.showcase.v1beta1.Session.Version result = com.google.showcase.v1beta1.Session.Version.valueOf(version_); - return result == null ? com.google.showcase.v1beta1.Session.Version.UNRECOGNIZED : result; - } - /** - *
        -     * Required. The version this session is using.
        -     * 
        - * - * .google.showcase.v1beta1.Session.Version version = 2; - * @param value The version to set. - * @return This builder for chaining. - */ - public Builder setVersion(com.google.showcase.v1beta1.Session.Version value) { - if (value == null) { - throw new NullPointerException(); - } - - version_ = value.getNumber(); - onChanged(); - return this; - } - /** - *
        -     * Required. The version this session is using.
        -     * 
        - * - * .google.showcase.v1beta1.Session.Version version = 2; - * @return This builder for chaining. - */ - public Builder clearVersion() { - - 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.showcase.v1beta1.Session) - } - - // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.Session) - private static final com.google.showcase.v1beta1.Session DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new com.google.showcase.v1beta1.Session(); - } - - public static com.google.showcase.v1beta1.Session getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public Session parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new Session(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public com.google.showcase.v1beta1.Session getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/SessionName.java b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/SessionName.java deleted file mode 100644 index a205c1272d..0000000000 --- a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/SessionName.java +++ /dev/null @@ -1,168 +0,0 @@ -/* - * 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 - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1; - -import com.google.api.pathtemplate.PathTemplate; -import com.google.api.resourcenames.ResourceName; -import com.google.common.base.Preconditions; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import javax.annotation.Generated; - -// AUTO-GENERATED DOCUMENTATION AND CLASS. -@Generated("by gapic-generator-java") -public class SessionName implements ResourceName { - private static final PathTemplate SESSION = - PathTemplate.createWithoutUrlEncoding("sessions/{session}"); - private volatile Map fieldValuesMap; - private final String session; - - @Deprecated - protected SessionName() { - session = null; - } - - private SessionName(Builder builder) { - session = Preconditions.checkNotNull(builder.getSession()); - } - - public String getSession() { - return session; - } - - public static Builder newBuilder() { - return new Builder(); - } - - public Builder toBuilder() { - return new Builder(this); - } - - public static SessionName of(String session) { - return newBuilder().setSession(session).build(); - } - - public static String format(String session) { - return newBuilder().setSession(session).build().toString(); - } - - public static SessionName parse(String formattedString) { - if (formattedString.isEmpty()) { - return null; - } - Map matchMap = - SESSION.validatedMatch( - formattedString, "SessionName.parse: formattedString not in valid format"); - return of(matchMap.get("session")); - } - - 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 (SessionName value : values) { - if (value == null) { - list.add(""); - } else { - list.add(value.toString()); - } - } - return list; - } - - public static boolean isParsableFrom(String formattedString) { - return SESSION.matches(formattedString); - } - - @Override - public Map getFieldValuesMap() { - if (fieldValuesMap == null) { - synchronized (this) { - if (fieldValuesMap == null) { - ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); - if (session != null) { - fieldMapBuilder.put("session", session); - } - fieldValuesMap = fieldMapBuilder.build(); - } - } - } - return fieldValuesMap; - } - - public String getFieldValue(String fieldName) { - return getFieldValuesMap().get(fieldName); - } - - @Override - public String toString() { - return SESSION.instantiate("session", session); - } - - @Override - public boolean equals(Object o) { - if (o == this) { - return true; - } - if (o != null || getClass() == o.getClass()) { - SessionName that = ((SessionName) o); - return Objects.equals(this.session, that.session); - } - return false; - } - - @Override - public int hashCode() { - int h = 1; - h *= 1000003; - h ^= Objects.hashCode(session); - return h; - } - - /** Builder for sessions/{session}. */ - public static class Builder { - private String session; - - protected Builder() {} - - public String getSession() { - return session; - } - - public Builder setSession(String session) { - this.session = session; - return this; - } - - private Builder(SessionName sessionName) { - this.session = sessionName.session; - } - - public SessionName build() { - return new SessionName(this); - } - } -} diff --git a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/SessionOrBuilder.java b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/SessionOrBuilder.java deleted file mode 100644 index bf0021843a..0000000000 --- a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/SessionOrBuilder.java +++ /dev/null @@ -1,50 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: schema/google/showcase/v1beta1/testing.proto - -package com.google.showcase.v1beta1; - -public interface SessionOrBuilder extends - // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.Session) - com.google.protobuf.MessageOrBuilder { - - /** - *
        -   * The name of the session. The ID must conform to ^[a-z]+$
        -   * If this is not provided, Showcase chooses one at random.
        -   * 
        - * - * string name = 1; - * @return The name. - */ - java.lang.String getName(); - /** - *
        -   * The name of the session. The ID must conform to ^[a-z]+$
        -   * If this is not provided, Showcase chooses one at random.
        -   * 
        - * - * string name = 1; - * @return The bytes for name. - */ - com.google.protobuf.ByteString - getNameBytes(); - - /** - *
        -   * Required. The version this session is using.
        -   * 
        - * - * .google.showcase.v1beta1.Session.Version version = 2; - * @return The enum numeric value on the wire for version. - */ - int getVersionValue(); - /** - *
        -   * Required. The version this session is using.
        -   * 
        - * - * .google.showcase.v1beta1.Session.Version version = 2; - * @return The version. - */ - com.google.showcase.v1beta1.Session.Version getVersion(); -} diff --git a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/Severity.java b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/Severity.java deleted file mode 100644 index 28d6564dcd..0000000000 --- a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/Severity.java +++ /dev/null @@ -1,135 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: schema/google/showcase/v1beta1/echo.proto - -package com.google.showcase.v1beta1; - -/** - *
        - * A severity enum used to test enum capabilities in GAPIC surfaces.
        - * 
        - * - * Protobuf enum {@code google.showcase.v1beta1.Severity} - */ -public enum Severity - implements com.google.protobuf.ProtocolMessageEnum { - /** - * UNNECESSARY = 0; - */ - UNNECESSARY(0), - /** - * NECESSARY = 1; - */ - NECESSARY(1), - /** - * URGENT = 2; - */ - URGENT(2), - /** - * CRITICAL = 3; - */ - CRITICAL(3), - UNRECOGNIZED(-1), - ; - - /** - * UNNECESSARY = 0; - */ - public static final int UNNECESSARY_VALUE = 0; - /** - * NECESSARY = 1; - */ - public static final int NECESSARY_VALUE = 1; - /** - * URGENT = 2; - */ - public static final int URGENT_VALUE = 2; - /** - * CRITICAL = 3; - */ - public static final int CRITICAL_VALUE = 3; - - - public final int getNumber() { - if (this == UNRECOGNIZED) { - throw new java.lang.IllegalArgumentException( - "Can't get the number of an unknown enum value."); - } - return value; - } - - /** - * @param value The numeric wire value of the corresponding enum entry. - * @return The enum associated with the given numeric wire value. - * @deprecated Use {@link #forNumber(int)} instead. - */ - @java.lang.Deprecated - public static Severity 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 Severity forNumber(int value) { - switch (value) { - case 0: return UNNECESSARY; - case 1: return NECESSARY; - case 2: return URGENT; - case 3: return CRITICAL; - default: return null; - } - } - - public static com.google.protobuf.Internal.EnumLiteMap - internalGetValueMap() { - return internalValueMap; - } - private static final com.google.protobuf.Internal.EnumLiteMap< - Severity> internalValueMap = - new com.google.protobuf.Internal.EnumLiteMap() { - public Severity findValueByNumber(int number) { - return Severity.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.showcase.v1beta1.EchoOuterClass.getDescriptor().getEnumTypes().get(0); - } - - private static final Severity[] VALUES = values(); - - public static Severity 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 Severity(int value) { - this.value = value; - } - - // @@protoc_insertion_point(enum_scope:google.showcase.v1beta1.Severity) -} - diff --git a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/StreamBlurbsRequest.java b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/StreamBlurbsRequest.java deleted file mode 100644 index 204ec91396..0000000000 --- a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/StreamBlurbsRequest.java +++ /dev/null @@ -1,833 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: schema/google/showcase/v1beta1/messaging.proto - -package com.google.showcase.v1beta1; - -/** - *
        - * The request message for the google.showcase.v1beta1.Messaging\StreamBlurbs
        - * method.
        - * 
        - * - * Protobuf type {@code google.showcase.v1beta1.StreamBlurbsRequest} - */ -public final class StreamBlurbsRequest extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.StreamBlurbsRequest) - StreamBlurbsRequestOrBuilder { -private static final long serialVersionUID = 0L; - // Use StreamBlurbsRequest.newBuilder() to construct. - private StreamBlurbsRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private StreamBlurbsRequest() { - name_ = ""; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new StreamBlurbsRequest(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private StreamBlurbsRequest( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: { - java.lang.String s = input.readStringRequireUtf8(); - - name_ = s; - break; - } - case 18: { - com.google.protobuf.Timestamp.Builder subBuilder = null; - if (expireTime_ != null) { - subBuilder = expireTime_.toBuilder(); - } - expireTime_ = input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(expireTime_); - expireTime_ = subBuilder.buildPartial(); - } - - break; - } - default: { - if (!parseUnknownField( - input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException( - e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.google.showcase.v1beta1.MessagingOuterClass.internal_static_google_showcase_v1beta1_StreamBlurbsRequest_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.showcase.v1beta1.MessagingOuterClass.internal_static_google_showcase_v1beta1_StreamBlurbsRequest_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.showcase.v1beta1.StreamBlurbsRequest.class, com.google.showcase.v1beta1.StreamBlurbsRequest.Builder.class); - } - - public static final int NAME_FIELD_NUMBER = 1; - private volatile java.lang.Object name_; - /** - *
        -   * The resource name of a chat room or user profile whose blurbs to stream.
        -   * 
        - * - * 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; - } - } - /** - *
        -   * The resource name of a chat room or user profile whose blurbs to stream.
        -   * 
        - * - * 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 EXPIRE_TIME_FIELD_NUMBER = 2; - private com.google.protobuf.Timestamp expireTime_; - /** - *
        -   * The time at which this stream will close.
        -   * 
        - * - * .google.protobuf.Timestamp expire_time = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return Whether the expireTime field is set. - */ - @java.lang.Override - public boolean hasExpireTime() { - return expireTime_ != null; - } - /** - *
        -   * The time at which this stream will close.
        -   * 
        - * - * .google.protobuf.Timestamp expire_time = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return The expireTime. - */ - @java.lang.Override - public com.google.protobuf.Timestamp getExpireTime() { - return expireTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : expireTime_; - } - /** - *
        -   * The time at which this stream will close.
        -   * 
        - * - * .google.protobuf.Timestamp expire_time = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - @java.lang.Override - public com.google.protobuf.TimestampOrBuilder getExpireTimeOrBuilder() { - return getExpireTime(); - } - - private byte memoizedIsInitialized = -1; - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); - } - if (expireTime_ != null) { - output.writeMessage(2, getExpireTime()); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); - } - if (expireTime_ != null) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(2, getExpireTime()); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof com.google.showcase.v1beta1.StreamBlurbsRequest)) { - return super.equals(obj); - } - com.google.showcase.v1beta1.StreamBlurbsRequest other = (com.google.showcase.v1beta1.StreamBlurbsRequest) obj; - - if (!getName() - .equals(other.getName())) return false; - if (hasExpireTime() != other.hasExpireTime()) return false; - if (hasExpireTime()) { - if (!getExpireTime() - .equals(other.getExpireTime())) return false; - } - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - hash = (37 * hash) + NAME_FIELD_NUMBER; - hash = (53 * hash) + getName().hashCode(); - if (hasExpireTime()) { - hash = (37 * hash) + EXPIRE_TIME_FIELD_NUMBER; - hash = (53 * hash) + getExpireTime().hashCode(); - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.showcase.v1beta1.StreamBlurbsRequest parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.showcase.v1beta1.StreamBlurbsRequest parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.showcase.v1beta1.StreamBlurbsRequest parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.showcase.v1beta1.StreamBlurbsRequest 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.showcase.v1beta1.StreamBlurbsRequest parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.showcase.v1beta1.StreamBlurbsRequest parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.showcase.v1beta1.StreamBlurbsRequest parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static com.google.showcase.v1beta1.StreamBlurbsRequest 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.showcase.v1beta1.StreamBlurbsRequest parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static com.google.showcase.v1beta1.StreamBlurbsRequest 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.showcase.v1beta1.StreamBlurbsRequest parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static com.google.showcase.v1beta1.StreamBlurbsRequest 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.showcase.v1beta1.StreamBlurbsRequest 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 request message for the google.showcase.v1beta1.Messaging\StreamBlurbs
        -   * method.
        -   * 
        - * - * Protobuf type {@code google.showcase.v1beta1.StreamBlurbsRequest} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.StreamBlurbsRequest) - com.google.showcase.v1beta1.StreamBlurbsRequestOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.google.showcase.v1beta1.MessagingOuterClass.internal_static_google_showcase_v1beta1_StreamBlurbsRequest_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.showcase.v1beta1.MessagingOuterClass.internal_static_google_showcase_v1beta1_StreamBlurbsRequest_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.showcase.v1beta1.StreamBlurbsRequest.class, com.google.showcase.v1beta1.StreamBlurbsRequest.Builder.class); - } - - // Construct using com.google.showcase.v1beta1.StreamBlurbsRequest.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { - } - } - @java.lang.Override - public Builder clear() { - super.clear(); - name_ = ""; - - if (expireTimeBuilder_ == null) { - expireTime_ = null; - } else { - expireTime_ = null; - expireTimeBuilder_ = null; - } - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return com.google.showcase.v1beta1.MessagingOuterClass.internal_static_google_showcase_v1beta1_StreamBlurbsRequest_descriptor; - } - - @java.lang.Override - public com.google.showcase.v1beta1.StreamBlurbsRequest getDefaultInstanceForType() { - return com.google.showcase.v1beta1.StreamBlurbsRequest.getDefaultInstance(); - } - - @java.lang.Override - public com.google.showcase.v1beta1.StreamBlurbsRequest build() { - com.google.showcase.v1beta1.StreamBlurbsRequest result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.showcase.v1beta1.StreamBlurbsRequest buildPartial() { - com.google.showcase.v1beta1.StreamBlurbsRequest result = new com.google.showcase.v1beta1.StreamBlurbsRequest(this); - result.name_ = name_; - if (expireTimeBuilder_ == null) { - result.expireTime_ = expireTime_; - } else { - result.expireTime_ = expireTimeBuilder_.build(); - } - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.setField(field, value); - } - @java.lang.Override - public Builder clearField( - com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - @java.lang.Override - public Builder clearOneof( - com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.addRepeatedField(field, value); - } - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof com.google.showcase.v1beta1.StreamBlurbsRequest) { - return mergeFrom((com.google.showcase.v1beta1.StreamBlurbsRequest)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.showcase.v1beta1.StreamBlurbsRequest other) { - if (other == com.google.showcase.v1beta1.StreamBlurbsRequest.getDefaultInstance()) return this; - if (!other.getName().isEmpty()) { - name_ = other.name_; - onChanged(); - } - if (other.hasExpireTime()) { - mergeExpireTime(other.getExpireTime()); - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - com.google.showcase.v1beta1.StreamBlurbsRequest parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (com.google.showcase.v1beta1.StreamBlurbsRequest) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private java.lang.Object name_ = ""; - /** - *
        -     * The resource name of a chat room or user profile whose blurbs to stream.
        -     * 
        - * - * 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; - } - } - /** - *
        -     * The resource name of a chat room or user profile whose blurbs to stream.
        -     * 
        - * - * 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; - } - } - /** - *
        -     * The resource name of a chat room or user profile whose blurbs to stream.
        -     * 
        - * - * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * @param value The name to set. - * @return This builder for chaining. - */ - public Builder setName( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - name_ = value; - onChanged(); - return this; - } - /** - *
        -     * The resource name of a chat room or user profile whose blurbs to stream.
        -     * 
        - * - * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * @return This builder for chaining. - */ - public Builder clearName() { - - name_ = getDefaultInstance().getName(); - onChanged(); - return this; - } - /** - *
        -     * The resource name of a chat room or user profile whose blurbs to stream.
        -     * 
        - * - * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * @param value The bytes for name to set. - * @return This builder for chaining. - */ - public Builder setNameBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - name_ = value; - onChanged(); - return this; - } - - private com.google.protobuf.Timestamp expireTime_; - private com.google.protobuf.SingleFieldBuilderV3< - com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder> expireTimeBuilder_; - /** - *
        -     * The time at which this stream will close.
        -     * 
        - * - * .google.protobuf.Timestamp expire_time = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return Whether the expireTime field is set. - */ - public boolean hasExpireTime() { - return expireTimeBuilder_ != null || expireTime_ != null; - } - /** - *
        -     * The time at which this stream will close.
        -     * 
        - * - * .google.protobuf.Timestamp expire_time = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return The expireTime. - */ - public com.google.protobuf.Timestamp getExpireTime() { - if (expireTimeBuilder_ == null) { - return expireTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : expireTime_; - } else { - return expireTimeBuilder_.getMessage(); - } - } - /** - *
        -     * The time at which this stream will close.
        -     * 
        - * - * .google.protobuf.Timestamp expire_time = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - public Builder setExpireTime(com.google.protobuf.Timestamp value) { - if (expireTimeBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - expireTime_ = value; - onChanged(); - } else { - expireTimeBuilder_.setMessage(value); - } - - return this; - } - /** - *
        -     * The time at which this stream will close.
        -     * 
        - * - * .google.protobuf.Timestamp expire_time = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - public Builder setExpireTime( - com.google.protobuf.Timestamp.Builder builderForValue) { - if (expireTimeBuilder_ == null) { - expireTime_ = builderForValue.build(); - onChanged(); - } else { - expireTimeBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - *
        -     * The time at which this stream will close.
        -     * 
        - * - * .google.protobuf.Timestamp expire_time = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - public Builder mergeExpireTime(com.google.protobuf.Timestamp value) { - if (expireTimeBuilder_ == null) { - if (expireTime_ != null) { - expireTime_ = - com.google.protobuf.Timestamp.newBuilder(expireTime_).mergeFrom(value).buildPartial(); - } else { - expireTime_ = value; - } - onChanged(); - } else { - expireTimeBuilder_.mergeFrom(value); - } - - return this; - } - /** - *
        -     * The time at which this stream will close.
        -     * 
        - * - * .google.protobuf.Timestamp expire_time = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - public Builder clearExpireTime() { - if (expireTimeBuilder_ == null) { - expireTime_ = null; - onChanged(); - } else { - expireTime_ = null; - expireTimeBuilder_ = null; - } - - return this; - } - /** - *
        -     * The time at which this stream will close.
        -     * 
        - * - * .google.protobuf.Timestamp expire_time = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - public com.google.protobuf.Timestamp.Builder getExpireTimeBuilder() { - - onChanged(); - return getExpireTimeFieldBuilder().getBuilder(); - } - /** - *
        -     * The time at which this stream will close.
        -     * 
        - * - * .google.protobuf.Timestamp expire_time = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - public com.google.protobuf.TimestampOrBuilder getExpireTimeOrBuilder() { - if (expireTimeBuilder_ != null) { - return expireTimeBuilder_.getMessageOrBuilder(); - } else { - return expireTime_ == null ? - com.google.protobuf.Timestamp.getDefaultInstance() : expireTime_; - } - } - /** - *
        -     * The time at which this stream will close.
        -     * 
        - * - * .google.protobuf.Timestamp expire_time = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - private com.google.protobuf.SingleFieldBuilderV3< - com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder> - getExpireTimeFieldBuilder() { - if (expireTimeBuilder_ == null) { - expireTimeBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder>( - getExpireTime(), - getParentForChildren(), - isClean()); - expireTime_ = null; - } - return expireTimeBuilder_; - } - @java.lang.Override - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - - // @@protoc_insertion_point(builder_scope:google.showcase.v1beta1.StreamBlurbsRequest) - } - - // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.StreamBlurbsRequest) - private static final com.google.showcase.v1beta1.StreamBlurbsRequest DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new com.google.showcase.v1beta1.StreamBlurbsRequest(); - } - - public static com.google.showcase.v1beta1.StreamBlurbsRequest getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public StreamBlurbsRequest parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new StreamBlurbsRequest(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public com.google.showcase.v1beta1.StreamBlurbsRequest getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/StreamBlurbsRequestOrBuilder.java b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/StreamBlurbsRequestOrBuilder.java deleted file mode 100644 index 27fdb34a7a..0000000000 --- a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/StreamBlurbsRequestOrBuilder.java +++ /dev/null @@ -1,56 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: schema/google/showcase/v1beta1/messaging.proto - -package com.google.showcase.v1beta1; - -public interface StreamBlurbsRequestOrBuilder extends - // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.StreamBlurbsRequest) - com.google.protobuf.MessageOrBuilder { - - /** - *
        -   * The resource name of a chat room or user profile whose blurbs to stream.
        -   * 
        - * - * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * @return The name. - */ - java.lang.String getName(); - /** - *
        -   * The resource name of a chat room or user profile whose blurbs to stream.
        -   * 
        - * - * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * @return The bytes for name. - */ - com.google.protobuf.ByteString - getNameBytes(); - - /** - *
        -   * The time at which this stream will close.
        -   * 
        - * - * .google.protobuf.Timestamp expire_time = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return Whether the expireTime field is set. - */ - boolean hasExpireTime(); - /** - *
        -   * The time at which this stream will close.
        -   * 
        - * - * .google.protobuf.Timestamp expire_time = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return The expireTime. - */ - com.google.protobuf.Timestamp getExpireTime(); - /** - *
        -   * The time at which this stream will close.
        -   * 
        - * - * .google.protobuf.Timestamp expire_time = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - com.google.protobuf.TimestampOrBuilder getExpireTimeOrBuilder(); -} diff --git a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/StreamBlurbsResponse.java b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/StreamBlurbsResponse.java deleted file mode 100644 index 5d3d9a5208..0000000000 --- a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/StreamBlurbsResponse.java +++ /dev/null @@ -1,945 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: schema/google/showcase/v1beta1/messaging.proto - -package com.google.showcase.v1beta1; - -/** - *
        - * The response message for the google.showcase.v1beta1.Messaging\StreamBlurbs
        - * method.
        - * 
        - * - * Protobuf type {@code google.showcase.v1beta1.StreamBlurbsResponse} - */ -public final class StreamBlurbsResponse extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.StreamBlurbsResponse) - StreamBlurbsResponseOrBuilder { -private static final long serialVersionUID = 0L; - // Use StreamBlurbsResponse.newBuilder() to construct. - private StreamBlurbsResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private StreamBlurbsResponse() { - action_ = 0; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new StreamBlurbsResponse(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private StreamBlurbsResponse( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: { - com.google.showcase.v1beta1.Blurb.Builder subBuilder = null; - if (blurb_ != null) { - subBuilder = blurb_.toBuilder(); - } - blurb_ = input.readMessage(com.google.showcase.v1beta1.Blurb.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(blurb_); - blurb_ = subBuilder.buildPartial(); - } - - break; - } - case 16: { - int rawValue = input.readEnum(); - - action_ = rawValue; - break; - } - default: { - if (!parseUnknownField( - input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException( - e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.google.showcase.v1beta1.MessagingOuterClass.internal_static_google_showcase_v1beta1_StreamBlurbsResponse_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.showcase.v1beta1.MessagingOuterClass.internal_static_google_showcase_v1beta1_StreamBlurbsResponse_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.showcase.v1beta1.StreamBlurbsResponse.class, com.google.showcase.v1beta1.StreamBlurbsResponse.Builder.class); - } - - /** - *
        -   * The action that triggered the blurb to be returned.
        -   * 
        - * - * Protobuf enum {@code google.showcase.v1beta1.StreamBlurbsResponse.Action} - */ - public enum Action - implements com.google.protobuf.ProtocolMessageEnum { - /** - * ACTION_UNSPECIFIED = 0; - */ - ACTION_UNSPECIFIED(0), - /** - *
        -     * Specifies that the blurb was created.
        -     * 
        - * - * CREATE = 1; - */ - CREATE(1), - /** - *
        -     * Specifies that the blurb was updated.
        -     * 
        - * - * UPDATE = 2; - */ - UPDATE(2), - /** - *
        -     * Specifies that the blurb was deleted.
        -     * 
        - * - * DELETE = 3; - */ - DELETE(3), - UNRECOGNIZED(-1), - ; - - /** - * ACTION_UNSPECIFIED = 0; - */ - public static final int ACTION_UNSPECIFIED_VALUE = 0; - /** - *
        -     * Specifies that the blurb was created.
        -     * 
        - * - * CREATE = 1; - */ - public static final int CREATE_VALUE = 1; - /** - *
        -     * Specifies that the blurb was updated.
        -     * 
        - * - * UPDATE = 2; - */ - public static final int UPDATE_VALUE = 2; - /** - *
        -     * Specifies that the blurb was deleted.
        -     * 
        - * - * DELETE = 3; - */ - public static final int DELETE_VALUE = 3; - - - public final int getNumber() { - if (this == UNRECOGNIZED) { - throw new java.lang.IllegalArgumentException( - "Can't get the number of an unknown enum value."); - } - return value; - } - - /** - * @param value The numeric wire value of the corresponding enum entry. - * @return The enum associated with the given numeric wire value. - * @deprecated Use {@link #forNumber(int)} instead. - */ - @java.lang.Deprecated - public static Action 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 Action forNumber(int value) { - switch (value) { - case 0: return ACTION_UNSPECIFIED; - case 1: return CREATE; - case 2: return UPDATE; - case 3: return DELETE; - default: return null; - } - } - - public static com.google.protobuf.Internal.EnumLiteMap - internalGetValueMap() { - return internalValueMap; - } - private static final com.google.protobuf.Internal.EnumLiteMap< - Action> internalValueMap = - new com.google.protobuf.Internal.EnumLiteMap() { - public Action findValueByNumber(int number) { - return Action.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.showcase.v1beta1.StreamBlurbsResponse.getDescriptor().getEnumTypes().get(0); - } - - private static final Action[] VALUES = values(); - - public static Action 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 Action(int value) { - this.value = value; - } - - // @@protoc_insertion_point(enum_scope:google.showcase.v1beta1.StreamBlurbsResponse.Action) - } - - public static final int BLURB_FIELD_NUMBER = 1; - private com.google.showcase.v1beta1.Blurb blurb_; - /** - *
        -   * The blurb that was either created, updated, or deleted.
        -   * 
        - * - * .google.showcase.v1beta1.Blurb blurb = 1; - * @return Whether the blurb field is set. - */ - @java.lang.Override - public boolean hasBlurb() { - return blurb_ != null; - } - /** - *
        -   * The blurb that was either created, updated, or deleted.
        -   * 
        - * - * .google.showcase.v1beta1.Blurb blurb = 1; - * @return The blurb. - */ - @java.lang.Override - public com.google.showcase.v1beta1.Blurb getBlurb() { - return blurb_ == null ? com.google.showcase.v1beta1.Blurb.getDefaultInstance() : blurb_; - } - /** - *
        -   * The blurb that was either created, updated, or deleted.
        -   * 
        - * - * .google.showcase.v1beta1.Blurb blurb = 1; - */ - @java.lang.Override - public com.google.showcase.v1beta1.BlurbOrBuilder getBlurbOrBuilder() { - return getBlurb(); - } - - public static final int ACTION_FIELD_NUMBER = 2; - private int action_; - /** - *
        -   * The action that triggered the blurb to be returned.
        -   * 
        - * - * .google.showcase.v1beta1.StreamBlurbsResponse.Action action = 2; - * @return The enum numeric value on the wire for action. - */ - @java.lang.Override public int getActionValue() { - return action_; - } - /** - *
        -   * The action that triggered the blurb to be returned.
        -   * 
        - * - * .google.showcase.v1beta1.StreamBlurbsResponse.Action action = 2; - * @return The action. - */ - @java.lang.Override public com.google.showcase.v1beta1.StreamBlurbsResponse.Action getAction() { - @SuppressWarnings("deprecation") - com.google.showcase.v1beta1.StreamBlurbsResponse.Action result = com.google.showcase.v1beta1.StreamBlurbsResponse.Action.valueOf(action_); - return result == null ? com.google.showcase.v1beta1.StreamBlurbsResponse.Action.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 (blurb_ != null) { - output.writeMessage(1, getBlurb()); - } - if (action_ != com.google.showcase.v1beta1.StreamBlurbsResponse.Action.ACTION_UNSPECIFIED.getNumber()) { - output.writeEnum(2, action_); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (blurb_ != null) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(1, getBlurb()); - } - if (action_ != com.google.showcase.v1beta1.StreamBlurbsResponse.Action.ACTION_UNSPECIFIED.getNumber()) { - size += com.google.protobuf.CodedOutputStream - .computeEnumSize(2, action_); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof com.google.showcase.v1beta1.StreamBlurbsResponse)) { - return super.equals(obj); - } - com.google.showcase.v1beta1.StreamBlurbsResponse other = (com.google.showcase.v1beta1.StreamBlurbsResponse) obj; - - if (hasBlurb() != other.hasBlurb()) return false; - if (hasBlurb()) { - if (!getBlurb() - .equals(other.getBlurb())) return false; - } - if (action_ != other.action_) return false; - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - if (hasBlurb()) { - hash = (37 * hash) + BLURB_FIELD_NUMBER; - hash = (53 * hash) + getBlurb().hashCode(); - } - hash = (37 * hash) + ACTION_FIELD_NUMBER; - hash = (53 * hash) + action_; - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.showcase.v1beta1.StreamBlurbsResponse parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.showcase.v1beta1.StreamBlurbsResponse parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.showcase.v1beta1.StreamBlurbsResponse parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.showcase.v1beta1.StreamBlurbsResponse 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.showcase.v1beta1.StreamBlurbsResponse parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.showcase.v1beta1.StreamBlurbsResponse parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.showcase.v1beta1.StreamBlurbsResponse parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static com.google.showcase.v1beta1.StreamBlurbsResponse 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.showcase.v1beta1.StreamBlurbsResponse parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static com.google.showcase.v1beta1.StreamBlurbsResponse 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.showcase.v1beta1.StreamBlurbsResponse parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static com.google.showcase.v1beta1.StreamBlurbsResponse 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.showcase.v1beta1.StreamBlurbsResponse 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 message for the google.showcase.v1beta1.Messaging\StreamBlurbs
        -   * method.
        -   * 
        - * - * Protobuf type {@code google.showcase.v1beta1.StreamBlurbsResponse} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.StreamBlurbsResponse) - com.google.showcase.v1beta1.StreamBlurbsResponseOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.google.showcase.v1beta1.MessagingOuterClass.internal_static_google_showcase_v1beta1_StreamBlurbsResponse_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.showcase.v1beta1.MessagingOuterClass.internal_static_google_showcase_v1beta1_StreamBlurbsResponse_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.showcase.v1beta1.StreamBlurbsResponse.class, com.google.showcase.v1beta1.StreamBlurbsResponse.Builder.class); - } - - // Construct using com.google.showcase.v1beta1.StreamBlurbsResponse.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { - } - } - @java.lang.Override - public Builder clear() { - super.clear(); - if (blurbBuilder_ == null) { - blurb_ = null; - } else { - blurb_ = null; - blurbBuilder_ = null; - } - action_ = 0; - - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return com.google.showcase.v1beta1.MessagingOuterClass.internal_static_google_showcase_v1beta1_StreamBlurbsResponse_descriptor; - } - - @java.lang.Override - public com.google.showcase.v1beta1.StreamBlurbsResponse getDefaultInstanceForType() { - return com.google.showcase.v1beta1.StreamBlurbsResponse.getDefaultInstance(); - } - - @java.lang.Override - public com.google.showcase.v1beta1.StreamBlurbsResponse build() { - com.google.showcase.v1beta1.StreamBlurbsResponse result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.showcase.v1beta1.StreamBlurbsResponse buildPartial() { - com.google.showcase.v1beta1.StreamBlurbsResponse result = new com.google.showcase.v1beta1.StreamBlurbsResponse(this); - if (blurbBuilder_ == null) { - result.blurb_ = blurb_; - } else { - result.blurb_ = blurbBuilder_.build(); - } - result.action_ = action_; - 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.showcase.v1beta1.StreamBlurbsResponse) { - return mergeFrom((com.google.showcase.v1beta1.StreamBlurbsResponse)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.showcase.v1beta1.StreamBlurbsResponse other) { - if (other == com.google.showcase.v1beta1.StreamBlurbsResponse.getDefaultInstance()) return this; - if (other.hasBlurb()) { - mergeBlurb(other.getBlurb()); - } - if (other.action_ != 0) { - setActionValue(other.getActionValue()); - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - com.google.showcase.v1beta1.StreamBlurbsResponse parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (com.google.showcase.v1beta1.StreamBlurbsResponse) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private com.google.showcase.v1beta1.Blurb blurb_; - private com.google.protobuf.SingleFieldBuilderV3< - com.google.showcase.v1beta1.Blurb, com.google.showcase.v1beta1.Blurb.Builder, com.google.showcase.v1beta1.BlurbOrBuilder> blurbBuilder_; - /** - *
        -     * The blurb that was either created, updated, or deleted.
        -     * 
        - * - * .google.showcase.v1beta1.Blurb blurb = 1; - * @return Whether the blurb field is set. - */ - public boolean hasBlurb() { - return blurbBuilder_ != null || blurb_ != null; - } - /** - *
        -     * The blurb that was either created, updated, or deleted.
        -     * 
        - * - * .google.showcase.v1beta1.Blurb blurb = 1; - * @return The blurb. - */ - public com.google.showcase.v1beta1.Blurb getBlurb() { - if (blurbBuilder_ == null) { - return blurb_ == null ? com.google.showcase.v1beta1.Blurb.getDefaultInstance() : blurb_; - } else { - return blurbBuilder_.getMessage(); - } - } - /** - *
        -     * The blurb that was either created, updated, or deleted.
        -     * 
        - * - * .google.showcase.v1beta1.Blurb blurb = 1; - */ - public Builder setBlurb(com.google.showcase.v1beta1.Blurb value) { - if (blurbBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - blurb_ = value; - onChanged(); - } else { - blurbBuilder_.setMessage(value); - } - - return this; - } - /** - *
        -     * The blurb that was either created, updated, or deleted.
        -     * 
        - * - * .google.showcase.v1beta1.Blurb blurb = 1; - */ - public Builder setBlurb( - com.google.showcase.v1beta1.Blurb.Builder builderForValue) { - if (blurbBuilder_ == null) { - blurb_ = builderForValue.build(); - onChanged(); - } else { - blurbBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - *
        -     * The blurb that was either created, updated, or deleted.
        -     * 
        - * - * .google.showcase.v1beta1.Blurb blurb = 1; - */ - public Builder mergeBlurb(com.google.showcase.v1beta1.Blurb value) { - if (blurbBuilder_ == null) { - if (blurb_ != null) { - blurb_ = - com.google.showcase.v1beta1.Blurb.newBuilder(blurb_).mergeFrom(value).buildPartial(); - } else { - blurb_ = value; - } - onChanged(); - } else { - blurbBuilder_.mergeFrom(value); - } - - return this; - } - /** - *
        -     * The blurb that was either created, updated, or deleted.
        -     * 
        - * - * .google.showcase.v1beta1.Blurb blurb = 1; - */ - public Builder clearBlurb() { - if (blurbBuilder_ == null) { - blurb_ = null; - onChanged(); - } else { - blurb_ = null; - blurbBuilder_ = null; - } - - return this; - } - /** - *
        -     * The blurb that was either created, updated, or deleted.
        -     * 
        - * - * .google.showcase.v1beta1.Blurb blurb = 1; - */ - public com.google.showcase.v1beta1.Blurb.Builder getBlurbBuilder() { - - onChanged(); - return getBlurbFieldBuilder().getBuilder(); - } - /** - *
        -     * The blurb that was either created, updated, or deleted.
        -     * 
        - * - * .google.showcase.v1beta1.Blurb blurb = 1; - */ - public com.google.showcase.v1beta1.BlurbOrBuilder getBlurbOrBuilder() { - if (blurbBuilder_ != null) { - return blurbBuilder_.getMessageOrBuilder(); - } else { - return blurb_ == null ? - com.google.showcase.v1beta1.Blurb.getDefaultInstance() : blurb_; - } - } - /** - *
        -     * The blurb that was either created, updated, or deleted.
        -     * 
        - * - * .google.showcase.v1beta1.Blurb blurb = 1; - */ - private com.google.protobuf.SingleFieldBuilderV3< - com.google.showcase.v1beta1.Blurb, com.google.showcase.v1beta1.Blurb.Builder, com.google.showcase.v1beta1.BlurbOrBuilder> - getBlurbFieldBuilder() { - if (blurbBuilder_ == null) { - blurbBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - com.google.showcase.v1beta1.Blurb, com.google.showcase.v1beta1.Blurb.Builder, com.google.showcase.v1beta1.BlurbOrBuilder>( - getBlurb(), - getParentForChildren(), - isClean()); - blurb_ = null; - } - return blurbBuilder_; - } - - private int action_ = 0; - /** - *
        -     * The action that triggered the blurb to be returned.
        -     * 
        - * - * .google.showcase.v1beta1.StreamBlurbsResponse.Action action = 2; - * @return The enum numeric value on the wire for action. - */ - @java.lang.Override public int getActionValue() { - return action_; - } - /** - *
        -     * The action that triggered the blurb to be returned.
        -     * 
        - * - * .google.showcase.v1beta1.StreamBlurbsResponse.Action action = 2; - * @param value The enum numeric value on the wire for action to set. - * @return This builder for chaining. - */ - public Builder setActionValue(int value) { - - action_ = value; - onChanged(); - return this; - } - /** - *
        -     * The action that triggered the blurb to be returned.
        -     * 
        - * - * .google.showcase.v1beta1.StreamBlurbsResponse.Action action = 2; - * @return The action. - */ - @java.lang.Override - public com.google.showcase.v1beta1.StreamBlurbsResponse.Action getAction() { - @SuppressWarnings("deprecation") - com.google.showcase.v1beta1.StreamBlurbsResponse.Action result = com.google.showcase.v1beta1.StreamBlurbsResponse.Action.valueOf(action_); - return result == null ? com.google.showcase.v1beta1.StreamBlurbsResponse.Action.UNRECOGNIZED : result; - } - /** - *
        -     * The action that triggered the blurb to be returned.
        -     * 
        - * - * .google.showcase.v1beta1.StreamBlurbsResponse.Action action = 2; - * @param value The action to set. - * @return This builder for chaining. - */ - public Builder setAction(com.google.showcase.v1beta1.StreamBlurbsResponse.Action value) { - if (value == null) { - throw new NullPointerException(); - } - - action_ = value.getNumber(); - onChanged(); - return this; - } - /** - *
        -     * The action that triggered the blurb to be returned.
        -     * 
        - * - * .google.showcase.v1beta1.StreamBlurbsResponse.Action action = 2; - * @return This builder for chaining. - */ - public Builder clearAction() { - - action_ = 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.showcase.v1beta1.StreamBlurbsResponse) - } - - // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.StreamBlurbsResponse) - private static final com.google.showcase.v1beta1.StreamBlurbsResponse DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new com.google.showcase.v1beta1.StreamBlurbsResponse(); - } - - public static com.google.showcase.v1beta1.StreamBlurbsResponse getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public StreamBlurbsResponse parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new StreamBlurbsResponse(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public com.google.showcase.v1beta1.StreamBlurbsResponse getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/StreamBlurbsResponseOrBuilder.java b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/StreamBlurbsResponseOrBuilder.java deleted file mode 100644 index d559b41956..0000000000 --- a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/StreamBlurbsResponseOrBuilder.java +++ /dev/null @@ -1,55 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: schema/google/showcase/v1beta1/messaging.proto - -package com.google.showcase.v1beta1; - -public interface StreamBlurbsResponseOrBuilder extends - // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.StreamBlurbsResponse) - com.google.protobuf.MessageOrBuilder { - - /** - *
        -   * The blurb that was either created, updated, or deleted.
        -   * 
        - * - * .google.showcase.v1beta1.Blurb blurb = 1; - * @return Whether the blurb field is set. - */ - boolean hasBlurb(); - /** - *
        -   * The blurb that was either created, updated, or deleted.
        -   * 
        - * - * .google.showcase.v1beta1.Blurb blurb = 1; - * @return The blurb. - */ - com.google.showcase.v1beta1.Blurb getBlurb(); - /** - *
        -   * The blurb that was either created, updated, or deleted.
        -   * 
        - * - * .google.showcase.v1beta1.Blurb blurb = 1; - */ - com.google.showcase.v1beta1.BlurbOrBuilder getBlurbOrBuilder(); - - /** - *
        -   * The action that triggered the blurb to be returned.
        -   * 
        - * - * .google.showcase.v1beta1.StreamBlurbsResponse.Action action = 2; - * @return The enum numeric value on the wire for action. - */ - int getActionValue(); - /** - *
        -   * The action that triggered the blurb to be returned.
        -   * 
        - * - * .google.showcase.v1beta1.StreamBlurbsResponse.Action action = 2; - * @return The action. - */ - com.google.showcase.v1beta1.StreamBlurbsResponse.Action getAction(); -} diff --git a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/Test.java b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/Test.java deleted file mode 100644 index 7199f69a27..0000000000 --- a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/Test.java +++ /dev/null @@ -1,3839 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: schema/google/showcase/v1beta1/testing.proto - -package com.google.showcase.v1beta1; - -/** - * Protobuf type {@code google.showcase.v1beta1.Test} - */ -public final class Test extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.Test) - TestOrBuilder { -private static final long serialVersionUID = 0L; - // Use Test.newBuilder() to construct. - private Test(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private Test() { - name_ = ""; - expectationLevel_ = 0; - description_ = ""; - blueprints_ = java.util.Collections.emptyList(); - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new Test(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private Test( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - int mutable_bitField0_ = 0; - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: { - java.lang.String s = input.readStringRequireUtf8(); - - name_ = s; - break; - } - case 16: { - int rawValue = input.readEnum(); - - expectationLevel_ = rawValue; - break; - } - case 26: { - java.lang.String s = input.readStringRequireUtf8(); - - description_ = s; - break; - } - case 34: { - if (!((mutable_bitField0_ & 0x00000001) != 0)) { - blueprints_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000001; - } - blueprints_.add( - input.readMessage(com.google.showcase.v1beta1.Test.Blueprint.parser(), extensionRegistry)); - break; - } - default: { - if (!parseUnknownField( - input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException( - e).setUnfinishedMessage(this); - } finally { - if (((mutable_bitField0_ & 0x00000001) != 0)) { - blueprints_ = java.util.Collections.unmodifiableList(blueprints_); - } - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.google.showcase.v1beta1.TestingOuterClass.internal_static_google_showcase_v1beta1_Test_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.showcase.v1beta1.TestingOuterClass.internal_static_google_showcase_v1beta1_Test_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.showcase.v1beta1.Test.class, com.google.showcase.v1beta1.Test.Builder.class); - } - - /** - *
        -   * Whether or not a test is required, recommended, or optional.
        -   * 
        - * - * Protobuf enum {@code google.showcase.v1beta1.Test.ExpectationLevel} - */ - public enum ExpectationLevel - implements com.google.protobuf.ProtocolMessageEnum { - /** - * EXPECTATION_LEVEL_UNSPECIFIED = 0; - */ - EXPECTATION_LEVEL_UNSPECIFIED(0), - /** - *
        -     * This test is strictly required.
        -     * 
        - * - * REQUIRED = 1; - */ - REQUIRED(1), - /** - *
        -     * This test is recommended.
        -     * If a generator explicitly ignores a recommended test (see `DeleteTest`),
        -     * then the report may still pass, but with a warning.
        -     * If a generator skips a recommended test and does not explicitly
        -     * express that intention, the report will fail.
        -     * 
        - * - * RECOMMENDED = 2; - */ - RECOMMENDED(2), - /** - *
        -     * This test is optional.
        -     * If a generator explicitly ignores an optional test (see `DeleteTest`),
        -     * then the report may still pass, and no warning will be issued.
        -     * If a generator skips an optional test and does not explicitly
        -     * express that intention, the report may still pass, but with a
        -     * warning.
        -     * 
        - * - * OPTIONAL = 3; - */ - OPTIONAL(3), - UNRECOGNIZED(-1), - ; - - /** - * EXPECTATION_LEVEL_UNSPECIFIED = 0; - */ - public static final int EXPECTATION_LEVEL_UNSPECIFIED_VALUE = 0; - /** - *
        -     * This test is strictly required.
        -     * 
        - * - * REQUIRED = 1; - */ - public static final int REQUIRED_VALUE = 1; - /** - *
        -     * This test is recommended.
        -     * If a generator explicitly ignores a recommended test (see `DeleteTest`),
        -     * then the report may still pass, but with a warning.
        -     * If a generator skips a recommended test and does not explicitly
        -     * express that intention, the report will fail.
        -     * 
        - * - * RECOMMENDED = 2; - */ - public static final int RECOMMENDED_VALUE = 2; - /** - *
        -     * This test is optional.
        -     * If a generator explicitly ignores an optional test (see `DeleteTest`),
        -     * then the report may still pass, and no warning will be issued.
        -     * If a generator skips an optional test and does not explicitly
        -     * express that intention, the report may still pass, but with a
        -     * warning.
        -     * 
        - * - * OPTIONAL = 3; - */ - public static final int OPTIONAL_VALUE = 3; - - - public final int getNumber() { - if (this == UNRECOGNIZED) { - throw new java.lang.IllegalArgumentException( - "Can't get the number of an unknown enum value."); - } - return value; - } - - /** - * @param value The numeric wire value of the corresponding enum entry. - * @return The enum associated with the given numeric wire value. - * @deprecated Use {@link #forNumber(int)} instead. - */ - @java.lang.Deprecated - public static ExpectationLevel 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 ExpectationLevel forNumber(int value) { - switch (value) { - case 0: return EXPECTATION_LEVEL_UNSPECIFIED; - case 1: return REQUIRED; - case 2: return RECOMMENDED; - case 3: return OPTIONAL; - default: return null; - } - } - - public static com.google.protobuf.Internal.EnumLiteMap - internalGetValueMap() { - return internalValueMap; - } - private static final com.google.protobuf.Internal.EnumLiteMap< - ExpectationLevel> internalValueMap = - new com.google.protobuf.Internal.EnumLiteMap() { - public ExpectationLevel findValueByNumber(int number) { - return ExpectationLevel.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.showcase.v1beta1.Test.getDescriptor().getEnumTypes().get(0); - } - - private static final ExpectationLevel[] VALUES = values(); - - public static ExpectationLevel 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 ExpectationLevel(int value) { - this.value = value; - } - - // @@protoc_insertion_point(enum_scope:google.showcase.v1beta1.Test.ExpectationLevel) - } - - public interface BlueprintOrBuilder extends - // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.Test.Blueprint) - com.google.protobuf.MessageOrBuilder { - - /** - *
        -     * The name of this blueprint.
        -     * 
        - * - * string name = 1; - * @return The name. - */ - java.lang.String getName(); - /** - *
        -     * The name of this blueprint.
        -     * 
        - * - * string name = 1; - * @return The bytes for name. - */ - com.google.protobuf.ByteString - getNameBytes(); - - /** - *
        -     * A description of this blueprint.
        -     * 
        - * - * string description = 2; - * @return The description. - */ - java.lang.String getDescription(); - /** - *
        -     * A description of this blueprint.
        -     * 
        - * - * string description = 2; - * @return The bytes for description. - */ - com.google.protobuf.ByteString - getDescriptionBytes(); - - /** - *
        -     * The initial request to trigger this test.
        -     * 
        - * - * .google.showcase.v1beta1.Test.Blueprint.Invocation request = 3; - * @return Whether the request field is set. - */ - boolean hasRequest(); - /** - *
        -     * The initial request to trigger this test.
        -     * 
        - * - * .google.showcase.v1beta1.Test.Blueprint.Invocation request = 3; - * @return The request. - */ - com.google.showcase.v1beta1.Test.Blueprint.Invocation getRequest(); - /** - *
        -     * The initial request to trigger this test.
        -     * 
        - * - * .google.showcase.v1beta1.Test.Blueprint.Invocation request = 3; - */ - com.google.showcase.v1beta1.Test.Blueprint.InvocationOrBuilder getRequestOrBuilder(); - - /** - *
        -     * An ordered list of method calls that can be called to trigger this test.
        -     * 
        - * - * repeated .google.showcase.v1beta1.Test.Blueprint.Invocation additional_requests = 4; - */ - java.util.List - getAdditionalRequestsList(); - /** - *
        -     * An ordered list of method calls that can be called to trigger this test.
        -     * 
        - * - * repeated .google.showcase.v1beta1.Test.Blueprint.Invocation additional_requests = 4; - */ - com.google.showcase.v1beta1.Test.Blueprint.Invocation getAdditionalRequests(int index); - /** - *
        -     * An ordered list of method calls that can be called to trigger this test.
        -     * 
        - * - * repeated .google.showcase.v1beta1.Test.Blueprint.Invocation additional_requests = 4; - */ - int getAdditionalRequestsCount(); - /** - *
        -     * An ordered list of method calls that can be called to trigger this test.
        -     * 
        - * - * repeated .google.showcase.v1beta1.Test.Blueprint.Invocation additional_requests = 4; - */ - java.util.List - getAdditionalRequestsOrBuilderList(); - /** - *
        -     * An ordered list of method calls that can be called to trigger this test.
        -     * 
        - * - * repeated .google.showcase.v1beta1.Test.Blueprint.Invocation additional_requests = 4; - */ - com.google.showcase.v1beta1.Test.Blueprint.InvocationOrBuilder getAdditionalRequestsOrBuilder( - int index); - } - /** - *
        -   * A blueprint is an explicit definition of methods and requests that are needed
        -   * to be made to test this specific test case. Ideally this would be represented
        -   * by something more robust like CEL, but as of writing this, I am unsure if CEL
        -   * is ready.
        -   * 
        - * - * Protobuf type {@code google.showcase.v1beta1.Test.Blueprint} - */ - public static final class Blueprint extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.Test.Blueprint) - BlueprintOrBuilder { - private static final long serialVersionUID = 0L; - // Use Blueprint.newBuilder() to construct. - private Blueprint(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private Blueprint() { - name_ = ""; - description_ = ""; - additionalRequests_ = java.util.Collections.emptyList(); - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new Blueprint(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private Blueprint( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - int mutable_bitField0_ = 0; - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: { - java.lang.String s = input.readStringRequireUtf8(); - - name_ = s; - break; - } - case 18: { - java.lang.String s = input.readStringRequireUtf8(); - - description_ = s; - break; - } - case 26: { - com.google.showcase.v1beta1.Test.Blueprint.Invocation.Builder subBuilder = null; - if (request_ != null) { - subBuilder = request_.toBuilder(); - } - request_ = input.readMessage(com.google.showcase.v1beta1.Test.Blueprint.Invocation.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(request_); - request_ = subBuilder.buildPartial(); - } - - break; - } - case 34: { - if (!((mutable_bitField0_ & 0x00000001) != 0)) { - additionalRequests_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000001; - } - additionalRequests_.add( - input.readMessage(com.google.showcase.v1beta1.Test.Blueprint.Invocation.parser(), extensionRegistry)); - break; - } - default: { - if (!parseUnknownField( - input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException( - e).setUnfinishedMessage(this); - } finally { - if (((mutable_bitField0_ & 0x00000001) != 0)) { - additionalRequests_ = java.util.Collections.unmodifiableList(additionalRequests_); - } - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.google.showcase.v1beta1.TestingOuterClass.internal_static_google_showcase_v1beta1_Test_Blueprint_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.showcase.v1beta1.TestingOuterClass.internal_static_google_showcase_v1beta1_Test_Blueprint_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.showcase.v1beta1.Test.Blueprint.class, com.google.showcase.v1beta1.Test.Blueprint.Builder.class); - } - - public interface InvocationOrBuilder extends - // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.Test.Blueprint.Invocation) - com.google.protobuf.MessageOrBuilder { - - /** - *
        -       * The fully qualified name of the showcase method to be invoked.
        -       * 
        - * - * string method = 1; - * @return The method. - */ - java.lang.String getMethod(); - /** - *
        -       * The fully qualified name of the showcase method to be invoked.
        -       * 
        - * - * string method = 1; - * @return The bytes for method. - */ - com.google.protobuf.ByteString - getMethodBytes(); - - /** - *
        -       * The request to be made if a specific request is necessary.
        -       * 
        - * - * bytes serialized_request = 2; - * @return The serializedRequest. - */ - com.google.protobuf.ByteString getSerializedRequest(); - } - /** - *
        -     * A message representing a method invocation.
        -     * 
        - * - * Protobuf type {@code google.showcase.v1beta1.Test.Blueprint.Invocation} - */ - public static final class Invocation extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.Test.Blueprint.Invocation) - InvocationOrBuilder { - private static final long serialVersionUID = 0L; - // Use Invocation.newBuilder() to construct. - private Invocation(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private Invocation() { - method_ = ""; - serializedRequest_ = com.google.protobuf.ByteString.EMPTY; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new Invocation(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private Invocation( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: { - java.lang.String s = input.readStringRequireUtf8(); - - method_ = s; - break; - } - case 18: { - - serializedRequest_ = input.readBytes(); - break; - } - default: { - if (!parseUnknownField( - input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException( - e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.google.showcase.v1beta1.TestingOuterClass.internal_static_google_showcase_v1beta1_Test_Blueprint_Invocation_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.showcase.v1beta1.TestingOuterClass.internal_static_google_showcase_v1beta1_Test_Blueprint_Invocation_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.showcase.v1beta1.Test.Blueprint.Invocation.class, com.google.showcase.v1beta1.Test.Blueprint.Invocation.Builder.class); - } - - public static final int METHOD_FIELD_NUMBER = 1; - private volatile java.lang.Object method_; - /** - *
        -       * The fully qualified name of the showcase method to be invoked.
        -       * 
        - * - * string method = 1; - * @return The method. - */ - @java.lang.Override - public java.lang.String getMethod() { - java.lang.Object ref = method_; - 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(); - method_ = s; - return s; - } - } - /** - *
        -       * The fully qualified name of the showcase method to be invoked.
        -       * 
        - * - * string method = 1; - * @return The bytes for method. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getMethodBytes() { - java.lang.Object ref = method_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - method_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int SERIALIZED_REQUEST_FIELD_NUMBER = 2; - private com.google.protobuf.ByteString serializedRequest_; - /** - *
        -       * The request to be made if a specific request is necessary.
        -       * 
        - * - * bytes serialized_request = 2; - * @return The serializedRequest. - */ - @java.lang.Override - public com.google.protobuf.ByteString getSerializedRequest() { - return serializedRequest_; - } - - 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(method_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, method_); - } - if (!serializedRequest_.isEmpty()) { - output.writeBytes(2, serializedRequest_); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(method_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, method_); - } - if (!serializedRequest_.isEmpty()) { - size += com.google.protobuf.CodedOutputStream - .computeBytesSize(2, serializedRequest_); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof com.google.showcase.v1beta1.Test.Blueprint.Invocation)) { - return super.equals(obj); - } - com.google.showcase.v1beta1.Test.Blueprint.Invocation other = (com.google.showcase.v1beta1.Test.Blueprint.Invocation) obj; - - if (!getMethod() - .equals(other.getMethod())) return false; - if (!getSerializedRequest() - .equals(other.getSerializedRequest())) return false; - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - hash = (37 * hash) + METHOD_FIELD_NUMBER; - hash = (53 * hash) + getMethod().hashCode(); - hash = (37 * hash) + SERIALIZED_REQUEST_FIELD_NUMBER; - hash = (53 * hash) + getSerializedRequest().hashCode(); - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.showcase.v1beta1.Test.Blueprint.Invocation parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.showcase.v1beta1.Test.Blueprint.Invocation parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.showcase.v1beta1.Test.Blueprint.Invocation parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.showcase.v1beta1.Test.Blueprint.Invocation 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.showcase.v1beta1.Test.Blueprint.Invocation parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.showcase.v1beta1.Test.Blueprint.Invocation parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.showcase.v1beta1.Test.Blueprint.Invocation parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static com.google.showcase.v1beta1.Test.Blueprint.Invocation 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.showcase.v1beta1.Test.Blueprint.Invocation parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static com.google.showcase.v1beta1.Test.Blueprint.Invocation 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.showcase.v1beta1.Test.Blueprint.Invocation parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static com.google.showcase.v1beta1.Test.Blueprint.Invocation 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.showcase.v1beta1.Test.Blueprint.Invocation prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - @java.lang.Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - *
        -       * A message representing a method invocation.
        -       * 
        - * - * Protobuf type {@code google.showcase.v1beta1.Test.Blueprint.Invocation} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.Test.Blueprint.Invocation) - com.google.showcase.v1beta1.Test.Blueprint.InvocationOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.google.showcase.v1beta1.TestingOuterClass.internal_static_google_showcase_v1beta1_Test_Blueprint_Invocation_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.showcase.v1beta1.TestingOuterClass.internal_static_google_showcase_v1beta1_Test_Blueprint_Invocation_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.showcase.v1beta1.Test.Blueprint.Invocation.class, com.google.showcase.v1beta1.Test.Blueprint.Invocation.Builder.class); - } - - // Construct using com.google.showcase.v1beta1.Test.Blueprint.Invocation.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { - } - } - @java.lang.Override - public Builder clear() { - super.clear(); - method_ = ""; - - serializedRequest_ = com.google.protobuf.ByteString.EMPTY; - - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return com.google.showcase.v1beta1.TestingOuterClass.internal_static_google_showcase_v1beta1_Test_Blueprint_Invocation_descriptor; - } - - @java.lang.Override - public com.google.showcase.v1beta1.Test.Blueprint.Invocation getDefaultInstanceForType() { - return com.google.showcase.v1beta1.Test.Blueprint.Invocation.getDefaultInstance(); - } - - @java.lang.Override - public com.google.showcase.v1beta1.Test.Blueprint.Invocation build() { - com.google.showcase.v1beta1.Test.Blueprint.Invocation result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.showcase.v1beta1.Test.Blueprint.Invocation buildPartial() { - com.google.showcase.v1beta1.Test.Blueprint.Invocation result = new com.google.showcase.v1beta1.Test.Blueprint.Invocation(this); - result.method_ = method_; - result.serializedRequest_ = serializedRequest_; - 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.showcase.v1beta1.Test.Blueprint.Invocation) { - return mergeFrom((com.google.showcase.v1beta1.Test.Blueprint.Invocation)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.showcase.v1beta1.Test.Blueprint.Invocation other) { - if (other == com.google.showcase.v1beta1.Test.Blueprint.Invocation.getDefaultInstance()) return this; - if (!other.getMethod().isEmpty()) { - method_ = other.method_; - onChanged(); - } - if (other.getSerializedRequest() != com.google.protobuf.ByteString.EMPTY) { - setSerializedRequest(other.getSerializedRequest()); - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - com.google.showcase.v1beta1.Test.Blueprint.Invocation parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (com.google.showcase.v1beta1.Test.Blueprint.Invocation) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private java.lang.Object method_ = ""; - /** - *
        -         * The fully qualified name of the showcase method to be invoked.
        -         * 
        - * - * string method = 1; - * @return The method. - */ - public java.lang.String getMethod() { - java.lang.Object ref = method_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - method_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - *
        -         * The fully qualified name of the showcase method to be invoked.
        -         * 
        - * - * string method = 1; - * @return The bytes for method. - */ - public com.google.protobuf.ByteString - getMethodBytes() { - java.lang.Object ref = method_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - method_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - *
        -         * The fully qualified name of the showcase method to be invoked.
        -         * 
        - * - * string method = 1; - * @param value The method to set. - * @return This builder for chaining. - */ - public Builder setMethod( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - method_ = value; - onChanged(); - return this; - } - /** - *
        -         * The fully qualified name of the showcase method to be invoked.
        -         * 
        - * - * string method = 1; - * @return This builder for chaining. - */ - public Builder clearMethod() { - - method_ = getDefaultInstance().getMethod(); - onChanged(); - return this; - } - /** - *
        -         * The fully qualified name of the showcase method to be invoked.
        -         * 
        - * - * string method = 1; - * @param value The bytes for method to set. - * @return This builder for chaining. - */ - public Builder setMethodBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - method_ = value; - onChanged(); - return this; - } - - private com.google.protobuf.ByteString serializedRequest_ = com.google.protobuf.ByteString.EMPTY; - /** - *
        -         * The request to be made if a specific request is necessary.
        -         * 
        - * - * bytes serialized_request = 2; - * @return The serializedRequest. - */ - @java.lang.Override - public com.google.protobuf.ByteString getSerializedRequest() { - return serializedRequest_; - } - /** - *
        -         * The request to be made if a specific request is necessary.
        -         * 
        - * - * bytes serialized_request = 2; - * @param value The serializedRequest to set. - * @return This builder for chaining. - */ - public Builder setSerializedRequest(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - - serializedRequest_ = value; - onChanged(); - return this; - } - /** - *
        -         * The request to be made if a specific request is necessary.
        -         * 
        - * - * bytes serialized_request = 2; - * @return This builder for chaining. - */ - public Builder clearSerializedRequest() { - - serializedRequest_ = getDefaultInstance().getSerializedRequest(); - 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.showcase.v1beta1.Test.Blueprint.Invocation) - } - - // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.Test.Blueprint.Invocation) - private static final com.google.showcase.v1beta1.Test.Blueprint.Invocation DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new com.google.showcase.v1beta1.Test.Blueprint.Invocation(); - } - - public static com.google.showcase.v1beta1.Test.Blueprint.Invocation getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public Invocation parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new Invocation(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public com.google.showcase.v1beta1.Test.Blueprint.Invocation getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - - } - - public static final int NAME_FIELD_NUMBER = 1; - private volatile java.lang.Object name_; - /** - *
        -     * The name of this blueprint.
        -     * 
        - * - * 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 name of this blueprint.
        -     * 
        - * - * 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; - private volatile java.lang.Object description_; - /** - *
        -     * A description of this blueprint.
        -     * 
        - * - * 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; - } - } - /** - *
        -     * A description of this blueprint.
        -     * 
        - * - * 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 REQUEST_FIELD_NUMBER = 3; - private com.google.showcase.v1beta1.Test.Blueprint.Invocation request_; - /** - *
        -     * The initial request to trigger this test.
        -     * 
        - * - * .google.showcase.v1beta1.Test.Blueprint.Invocation request = 3; - * @return Whether the request field is set. - */ - @java.lang.Override - public boolean hasRequest() { - return request_ != null; - } - /** - *
        -     * The initial request to trigger this test.
        -     * 
        - * - * .google.showcase.v1beta1.Test.Blueprint.Invocation request = 3; - * @return The request. - */ - @java.lang.Override - public com.google.showcase.v1beta1.Test.Blueprint.Invocation getRequest() { - return request_ == null ? com.google.showcase.v1beta1.Test.Blueprint.Invocation.getDefaultInstance() : request_; - } - /** - *
        -     * The initial request to trigger this test.
        -     * 
        - * - * .google.showcase.v1beta1.Test.Blueprint.Invocation request = 3; - */ - @java.lang.Override - public com.google.showcase.v1beta1.Test.Blueprint.InvocationOrBuilder getRequestOrBuilder() { - return getRequest(); - } - - public static final int ADDITIONAL_REQUESTS_FIELD_NUMBER = 4; - private java.util.List additionalRequests_; - /** - *
        -     * An ordered list of method calls that can be called to trigger this test.
        -     * 
        - * - * repeated .google.showcase.v1beta1.Test.Blueprint.Invocation additional_requests = 4; - */ - @java.lang.Override - public java.util.List getAdditionalRequestsList() { - return additionalRequests_; - } - /** - *
        -     * An ordered list of method calls that can be called to trigger this test.
        -     * 
        - * - * repeated .google.showcase.v1beta1.Test.Blueprint.Invocation additional_requests = 4; - */ - @java.lang.Override - public java.util.List - getAdditionalRequestsOrBuilderList() { - return additionalRequests_; - } - /** - *
        -     * An ordered list of method calls that can be called to trigger this test.
        -     * 
        - * - * repeated .google.showcase.v1beta1.Test.Blueprint.Invocation additional_requests = 4; - */ - @java.lang.Override - public int getAdditionalRequestsCount() { - return additionalRequests_.size(); - } - /** - *
        -     * An ordered list of method calls that can be called to trigger this test.
        -     * 
        - * - * repeated .google.showcase.v1beta1.Test.Blueprint.Invocation additional_requests = 4; - */ - @java.lang.Override - public com.google.showcase.v1beta1.Test.Blueprint.Invocation getAdditionalRequests(int index) { - return additionalRequests_.get(index); - } - /** - *
        -     * An ordered list of method calls that can be called to trigger this test.
        -     * 
        - * - * repeated .google.showcase.v1beta1.Test.Blueprint.Invocation additional_requests = 4; - */ - @java.lang.Override - public com.google.showcase.v1beta1.Test.Blueprint.InvocationOrBuilder getAdditionalRequestsOrBuilder( - int index) { - return additionalRequests_.get(index); - } - - private byte memoizedIsInitialized = -1; - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - if (!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 (request_ != null) { - output.writeMessage(3, getRequest()); - } - for (int i = 0; i < additionalRequests_.size(); i++) { - output.writeMessage(4, additionalRequests_.get(i)); - } - unknownFields.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 (request_ != null) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(3, getRequest()); - } - for (int i = 0; i < additionalRequests_.size(); i++) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(4, additionalRequests_.get(i)); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof com.google.showcase.v1beta1.Test.Blueprint)) { - return super.equals(obj); - } - com.google.showcase.v1beta1.Test.Blueprint other = (com.google.showcase.v1beta1.Test.Blueprint) obj; - - if (!getName() - .equals(other.getName())) return false; - if (!getDescription() - .equals(other.getDescription())) return false; - if (hasRequest() != other.hasRequest()) return false; - if (hasRequest()) { - if (!getRequest() - .equals(other.getRequest())) return false; - } - if (!getAdditionalRequestsList() - .equals(other.getAdditionalRequestsList())) return false; - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - hash = (37 * hash) + NAME_FIELD_NUMBER; - hash = (53 * hash) + getName().hashCode(); - hash = (37 * hash) + DESCRIPTION_FIELD_NUMBER; - hash = (53 * hash) + getDescription().hashCode(); - if (hasRequest()) { - hash = (37 * hash) + REQUEST_FIELD_NUMBER; - hash = (53 * hash) + getRequest().hashCode(); - } - if (getAdditionalRequestsCount() > 0) { - hash = (37 * hash) + ADDITIONAL_REQUESTS_FIELD_NUMBER; - hash = (53 * hash) + getAdditionalRequestsList().hashCode(); - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.showcase.v1beta1.Test.Blueprint parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.showcase.v1beta1.Test.Blueprint parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.showcase.v1beta1.Test.Blueprint parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.showcase.v1beta1.Test.Blueprint 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.showcase.v1beta1.Test.Blueprint parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.showcase.v1beta1.Test.Blueprint parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.showcase.v1beta1.Test.Blueprint parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static com.google.showcase.v1beta1.Test.Blueprint 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.showcase.v1beta1.Test.Blueprint parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static com.google.showcase.v1beta1.Test.Blueprint 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.showcase.v1beta1.Test.Blueprint parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static com.google.showcase.v1beta1.Test.Blueprint 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.showcase.v1beta1.Test.Blueprint prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - @java.lang.Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - *
        -     * A blueprint is an explicit definition of methods and requests that are needed
        -     * to be made to test this specific test case. Ideally this would be represented
        -     * by something more robust like CEL, but as of writing this, I am unsure if CEL
        -     * is ready.
        -     * 
        - * - * Protobuf type {@code google.showcase.v1beta1.Test.Blueprint} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.Test.Blueprint) - com.google.showcase.v1beta1.Test.BlueprintOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.google.showcase.v1beta1.TestingOuterClass.internal_static_google_showcase_v1beta1_Test_Blueprint_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.showcase.v1beta1.TestingOuterClass.internal_static_google_showcase_v1beta1_Test_Blueprint_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.showcase.v1beta1.Test.Blueprint.class, com.google.showcase.v1beta1.Test.Blueprint.Builder.class); - } - - // Construct using com.google.showcase.v1beta1.Test.Blueprint.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { - getAdditionalRequestsFieldBuilder(); - } - } - @java.lang.Override - public Builder clear() { - super.clear(); - name_ = ""; - - description_ = ""; - - if (requestBuilder_ == null) { - request_ = null; - } else { - request_ = null; - requestBuilder_ = null; - } - if (additionalRequestsBuilder_ == null) { - additionalRequests_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - } else { - additionalRequestsBuilder_.clear(); - } - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return com.google.showcase.v1beta1.TestingOuterClass.internal_static_google_showcase_v1beta1_Test_Blueprint_descriptor; - } - - @java.lang.Override - public com.google.showcase.v1beta1.Test.Blueprint getDefaultInstanceForType() { - return com.google.showcase.v1beta1.Test.Blueprint.getDefaultInstance(); - } - - @java.lang.Override - public com.google.showcase.v1beta1.Test.Blueprint build() { - com.google.showcase.v1beta1.Test.Blueprint result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.showcase.v1beta1.Test.Blueprint buildPartial() { - com.google.showcase.v1beta1.Test.Blueprint result = new com.google.showcase.v1beta1.Test.Blueprint(this); - int from_bitField0_ = bitField0_; - result.name_ = name_; - result.description_ = description_; - if (requestBuilder_ == null) { - result.request_ = request_; - } else { - result.request_ = requestBuilder_.build(); - } - if (additionalRequestsBuilder_ == null) { - if (((bitField0_ & 0x00000001) != 0)) { - additionalRequests_ = java.util.Collections.unmodifiableList(additionalRequests_); - bitField0_ = (bitField0_ & ~0x00000001); - } - result.additionalRequests_ = additionalRequests_; - } else { - result.additionalRequests_ = additionalRequestsBuilder_.build(); - } - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.setField(field, value); - } - @java.lang.Override - public Builder clearField( - com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - @java.lang.Override - public Builder clearOneof( - com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.addRepeatedField(field, value); - } - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof com.google.showcase.v1beta1.Test.Blueprint) { - return mergeFrom((com.google.showcase.v1beta1.Test.Blueprint)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.showcase.v1beta1.Test.Blueprint other) { - if (other == com.google.showcase.v1beta1.Test.Blueprint.getDefaultInstance()) return this; - if (!other.getName().isEmpty()) { - name_ = other.name_; - onChanged(); - } - if (!other.getDescription().isEmpty()) { - description_ = other.description_; - onChanged(); - } - if (other.hasRequest()) { - mergeRequest(other.getRequest()); - } - if (additionalRequestsBuilder_ == null) { - if (!other.additionalRequests_.isEmpty()) { - if (additionalRequests_.isEmpty()) { - additionalRequests_ = other.additionalRequests_; - bitField0_ = (bitField0_ & ~0x00000001); - } else { - ensureAdditionalRequestsIsMutable(); - additionalRequests_.addAll(other.additionalRequests_); - } - onChanged(); - } - } else { - if (!other.additionalRequests_.isEmpty()) { - if (additionalRequestsBuilder_.isEmpty()) { - additionalRequestsBuilder_.dispose(); - additionalRequestsBuilder_ = null; - additionalRequests_ = other.additionalRequests_; - bitField0_ = (bitField0_ & ~0x00000001); - additionalRequestsBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? - getAdditionalRequestsFieldBuilder() : null; - } else { - additionalRequestsBuilder_.addAllMessages(other.additionalRequests_); - } - } - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - com.google.showcase.v1beta1.Test.Blueprint parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (com.google.showcase.v1beta1.Test.Blueprint) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - private int bitField0_; - - private java.lang.Object name_ = ""; - /** - *
        -       * The name of this blueprint.
        -       * 
        - * - * 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 name of this blueprint.
        -       * 
        - * - * 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 name of this blueprint.
        -       * 
        - * - * string name = 1; - * @param value The name to set. - * @return This builder for chaining. - */ - public Builder setName( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - name_ = value; - onChanged(); - return this; - } - /** - *
        -       * The name of this blueprint.
        -       * 
        - * - * string name = 1; - * @return This builder for chaining. - */ - public Builder clearName() { - - name_ = getDefaultInstance().getName(); - onChanged(); - return this; - } - /** - *
        -       * The name of this blueprint.
        -       * 
        - * - * string name = 1; - * @param value The bytes for name to set. - * @return This builder for chaining. - */ - public Builder setNameBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - name_ = value; - onChanged(); - return this; - } - - private java.lang.Object description_ = ""; - /** - *
        -       * A description of this blueprint.
        -       * 
        - * - * 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; - } - } - /** - *
        -       * A description of this blueprint.
        -       * 
        - * - * 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; - } - } - /** - *
        -       * A description of this blueprint.
        -       * 
        - * - * 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; - onChanged(); - return this; - } - /** - *
        -       * A description of this blueprint.
        -       * 
        - * - * string description = 2; - * @return This builder for chaining. - */ - public Builder clearDescription() { - - description_ = getDefaultInstance().getDescription(); - onChanged(); - return this; - } - /** - *
        -       * A description of this blueprint.
        -       * 
        - * - * 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; - onChanged(); - return this; - } - - private com.google.showcase.v1beta1.Test.Blueprint.Invocation request_; - private com.google.protobuf.SingleFieldBuilderV3< - com.google.showcase.v1beta1.Test.Blueprint.Invocation, com.google.showcase.v1beta1.Test.Blueprint.Invocation.Builder, com.google.showcase.v1beta1.Test.Blueprint.InvocationOrBuilder> requestBuilder_; - /** - *
        -       * The initial request to trigger this test.
        -       * 
        - * - * .google.showcase.v1beta1.Test.Blueprint.Invocation request = 3; - * @return Whether the request field is set. - */ - public boolean hasRequest() { - return requestBuilder_ != null || request_ != null; - } - /** - *
        -       * The initial request to trigger this test.
        -       * 
        - * - * .google.showcase.v1beta1.Test.Blueprint.Invocation request = 3; - * @return The request. - */ - public com.google.showcase.v1beta1.Test.Blueprint.Invocation getRequest() { - if (requestBuilder_ == null) { - return request_ == null ? com.google.showcase.v1beta1.Test.Blueprint.Invocation.getDefaultInstance() : request_; - } else { - return requestBuilder_.getMessage(); - } - } - /** - *
        -       * The initial request to trigger this test.
        -       * 
        - * - * .google.showcase.v1beta1.Test.Blueprint.Invocation request = 3; - */ - public Builder setRequest(com.google.showcase.v1beta1.Test.Blueprint.Invocation value) { - if (requestBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - request_ = value; - onChanged(); - } else { - requestBuilder_.setMessage(value); - } - - return this; - } - /** - *
        -       * The initial request to trigger this test.
        -       * 
        - * - * .google.showcase.v1beta1.Test.Blueprint.Invocation request = 3; - */ - public Builder setRequest( - com.google.showcase.v1beta1.Test.Blueprint.Invocation.Builder builderForValue) { - if (requestBuilder_ == null) { - request_ = builderForValue.build(); - onChanged(); - } else { - requestBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - *
        -       * The initial request to trigger this test.
        -       * 
        - * - * .google.showcase.v1beta1.Test.Blueprint.Invocation request = 3; - */ - public Builder mergeRequest(com.google.showcase.v1beta1.Test.Blueprint.Invocation value) { - if (requestBuilder_ == null) { - if (request_ != null) { - request_ = - com.google.showcase.v1beta1.Test.Blueprint.Invocation.newBuilder(request_).mergeFrom(value).buildPartial(); - } else { - request_ = value; - } - onChanged(); - } else { - requestBuilder_.mergeFrom(value); - } - - return this; - } - /** - *
        -       * The initial request to trigger this test.
        -       * 
        - * - * .google.showcase.v1beta1.Test.Blueprint.Invocation request = 3; - */ - public Builder clearRequest() { - if (requestBuilder_ == null) { - request_ = null; - onChanged(); - } else { - request_ = null; - requestBuilder_ = null; - } - - return this; - } - /** - *
        -       * The initial request to trigger this test.
        -       * 
        - * - * .google.showcase.v1beta1.Test.Blueprint.Invocation request = 3; - */ - public com.google.showcase.v1beta1.Test.Blueprint.Invocation.Builder getRequestBuilder() { - - onChanged(); - return getRequestFieldBuilder().getBuilder(); - } - /** - *
        -       * The initial request to trigger this test.
        -       * 
        - * - * .google.showcase.v1beta1.Test.Blueprint.Invocation request = 3; - */ - public com.google.showcase.v1beta1.Test.Blueprint.InvocationOrBuilder getRequestOrBuilder() { - if (requestBuilder_ != null) { - return requestBuilder_.getMessageOrBuilder(); - } else { - return request_ == null ? - com.google.showcase.v1beta1.Test.Blueprint.Invocation.getDefaultInstance() : request_; - } - } - /** - *
        -       * The initial request to trigger this test.
        -       * 
        - * - * .google.showcase.v1beta1.Test.Blueprint.Invocation request = 3; - */ - private com.google.protobuf.SingleFieldBuilderV3< - com.google.showcase.v1beta1.Test.Blueprint.Invocation, com.google.showcase.v1beta1.Test.Blueprint.Invocation.Builder, com.google.showcase.v1beta1.Test.Blueprint.InvocationOrBuilder> - getRequestFieldBuilder() { - if (requestBuilder_ == null) { - requestBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - com.google.showcase.v1beta1.Test.Blueprint.Invocation, com.google.showcase.v1beta1.Test.Blueprint.Invocation.Builder, com.google.showcase.v1beta1.Test.Blueprint.InvocationOrBuilder>( - getRequest(), - getParentForChildren(), - isClean()); - request_ = null; - } - return requestBuilder_; - } - - private java.util.List additionalRequests_ = - java.util.Collections.emptyList(); - private void ensureAdditionalRequestsIsMutable() { - if (!((bitField0_ & 0x00000001) != 0)) { - additionalRequests_ = new java.util.ArrayList(additionalRequests_); - bitField0_ |= 0x00000001; - } - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - com.google.showcase.v1beta1.Test.Blueprint.Invocation, com.google.showcase.v1beta1.Test.Blueprint.Invocation.Builder, com.google.showcase.v1beta1.Test.Blueprint.InvocationOrBuilder> additionalRequestsBuilder_; - - /** - *
        -       * An ordered list of method calls that can be called to trigger this test.
        -       * 
        - * - * repeated .google.showcase.v1beta1.Test.Blueprint.Invocation additional_requests = 4; - */ - public java.util.List getAdditionalRequestsList() { - if (additionalRequestsBuilder_ == null) { - return java.util.Collections.unmodifiableList(additionalRequests_); - } else { - return additionalRequestsBuilder_.getMessageList(); - } - } - /** - *
        -       * An ordered list of method calls that can be called to trigger this test.
        -       * 
        - * - * repeated .google.showcase.v1beta1.Test.Blueprint.Invocation additional_requests = 4; - */ - public int getAdditionalRequestsCount() { - if (additionalRequestsBuilder_ == null) { - return additionalRequests_.size(); - } else { - return additionalRequestsBuilder_.getCount(); - } - } - /** - *
        -       * An ordered list of method calls that can be called to trigger this test.
        -       * 
        - * - * repeated .google.showcase.v1beta1.Test.Blueprint.Invocation additional_requests = 4; - */ - public com.google.showcase.v1beta1.Test.Blueprint.Invocation getAdditionalRequests(int index) { - if (additionalRequestsBuilder_ == null) { - return additionalRequests_.get(index); - } else { - return additionalRequestsBuilder_.getMessage(index); - } - } - /** - *
        -       * An ordered list of method calls that can be called to trigger this test.
        -       * 
        - * - * repeated .google.showcase.v1beta1.Test.Blueprint.Invocation additional_requests = 4; - */ - public Builder setAdditionalRequests( - int index, com.google.showcase.v1beta1.Test.Blueprint.Invocation value) { - if (additionalRequestsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureAdditionalRequestsIsMutable(); - additionalRequests_.set(index, value); - onChanged(); - } else { - additionalRequestsBuilder_.setMessage(index, value); - } - return this; - } - /** - *
        -       * An ordered list of method calls that can be called to trigger this test.
        -       * 
        - * - * repeated .google.showcase.v1beta1.Test.Blueprint.Invocation additional_requests = 4; - */ - public Builder setAdditionalRequests( - int index, com.google.showcase.v1beta1.Test.Blueprint.Invocation.Builder builderForValue) { - if (additionalRequestsBuilder_ == null) { - ensureAdditionalRequestsIsMutable(); - additionalRequests_.set(index, builderForValue.build()); - onChanged(); - } else { - additionalRequestsBuilder_.setMessage(index, builderForValue.build()); - } - return this; - } - /** - *
        -       * An ordered list of method calls that can be called to trigger this test.
        -       * 
        - * - * repeated .google.showcase.v1beta1.Test.Blueprint.Invocation additional_requests = 4; - */ - public Builder addAdditionalRequests(com.google.showcase.v1beta1.Test.Blueprint.Invocation value) { - if (additionalRequestsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureAdditionalRequestsIsMutable(); - additionalRequests_.add(value); - onChanged(); - } else { - additionalRequestsBuilder_.addMessage(value); - } - return this; - } - /** - *
        -       * An ordered list of method calls that can be called to trigger this test.
        -       * 
        - * - * repeated .google.showcase.v1beta1.Test.Blueprint.Invocation additional_requests = 4; - */ - public Builder addAdditionalRequests( - int index, com.google.showcase.v1beta1.Test.Blueprint.Invocation value) { - if (additionalRequestsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureAdditionalRequestsIsMutable(); - additionalRequests_.add(index, value); - onChanged(); - } else { - additionalRequestsBuilder_.addMessage(index, value); - } - return this; - } - /** - *
        -       * An ordered list of method calls that can be called to trigger this test.
        -       * 
        - * - * repeated .google.showcase.v1beta1.Test.Blueprint.Invocation additional_requests = 4; - */ - public Builder addAdditionalRequests( - com.google.showcase.v1beta1.Test.Blueprint.Invocation.Builder builderForValue) { - if (additionalRequestsBuilder_ == null) { - ensureAdditionalRequestsIsMutable(); - additionalRequests_.add(builderForValue.build()); - onChanged(); - } else { - additionalRequestsBuilder_.addMessage(builderForValue.build()); - } - return this; - } - /** - *
        -       * An ordered list of method calls that can be called to trigger this test.
        -       * 
        - * - * repeated .google.showcase.v1beta1.Test.Blueprint.Invocation additional_requests = 4; - */ - public Builder addAdditionalRequests( - int index, com.google.showcase.v1beta1.Test.Blueprint.Invocation.Builder builderForValue) { - if (additionalRequestsBuilder_ == null) { - ensureAdditionalRequestsIsMutable(); - additionalRequests_.add(index, builderForValue.build()); - onChanged(); - } else { - additionalRequestsBuilder_.addMessage(index, builderForValue.build()); - } - return this; - } - /** - *
        -       * An ordered list of method calls that can be called to trigger this test.
        -       * 
        - * - * repeated .google.showcase.v1beta1.Test.Blueprint.Invocation additional_requests = 4; - */ - public Builder addAllAdditionalRequests( - java.lang.Iterable values) { - if (additionalRequestsBuilder_ == null) { - ensureAdditionalRequestsIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, additionalRequests_); - onChanged(); - } else { - additionalRequestsBuilder_.addAllMessages(values); - } - return this; - } - /** - *
        -       * An ordered list of method calls that can be called to trigger this test.
        -       * 
        - * - * repeated .google.showcase.v1beta1.Test.Blueprint.Invocation additional_requests = 4; - */ - public Builder clearAdditionalRequests() { - if (additionalRequestsBuilder_ == null) { - additionalRequests_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - onChanged(); - } else { - additionalRequestsBuilder_.clear(); - } - return this; - } - /** - *
        -       * An ordered list of method calls that can be called to trigger this test.
        -       * 
        - * - * repeated .google.showcase.v1beta1.Test.Blueprint.Invocation additional_requests = 4; - */ - public Builder removeAdditionalRequests(int index) { - if (additionalRequestsBuilder_ == null) { - ensureAdditionalRequestsIsMutable(); - additionalRequests_.remove(index); - onChanged(); - } else { - additionalRequestsBuilder_.remove(index); - } - return this; - } - /** - *
        -       * An ordered list of method calls that can be called to trigger this test.
        -       * 
        - * - * repeated .google.showcase.v1beta1.Test.Blueprint.Invocation additional_requests = 4; - */ - public com.google.showcase.v1beta1.Test.Blueprint.Invocation.Builder getAdditionalRequestsBuilder( - int index) { - return getAdditionalRequestsFieldBuilder().getBuilder(index); - } - /** - *
        -       * An ordered list of method calls that can be called to trigger this test.
        -       * 
        - * - * repeated .google.showcase.v1beta1.Test.Blueprint.Invocation additional_requests = 4; - */ - public com.google.showcase.v1beta1.Test.Blueprint.InvocationOrBuilder getAdditionalRequestsOrBuilder( - int index) { - if (additionalRequestsBuilder_ == null) { - return additionalRequests_.get(index); } else { - return additionalRequestsBuilder_.getMessageOrBuilder(index); - } - } - /** - *
        -       * An ordered list of method calls that can be called to trigger this test.
        -       * 
        - * - * repeated .google.showcase.v1beta1.Test.Blueprint.Invocation additional_requests = 4; - */ - public java.util.List - getAdditionalRequestsOrBuilderList() { - if (additionalRequestsBuilder_ != null) { - return additionalRequestsBuilder_.getMessageOrBuilderList(); - } else { - return java.util.Collections.unmodifiableList(additionalRequests_); - } - } - /** - *
        -       * An ordered list of method calls that can be called to trigger this test.
        -       * 
        - * - * repeated .google.showcase.v1beta1.Test.Blueprint.Invocation additional_requests = 4; - */ - public com.google.showcase.v1beta1.Test.Blueprint.Invocation.Builder addAdditionalRequestsBuilder() { - return getAdditionalRequestsFieldBuilder().addBuilder( - com.google.showcase.v1beta1.Test.Blueprint.Invocation.getDefaultInstance()); - } - /** - *
        -       * An ordered list of method calls that can be called to trigger this test.
        -       * 
        - * - * repeated .google.showcase.v1beta1.Test.Blueprint.Invocation additional_requests = 4; - */ - public com.google.showcase.v1beta1.Test.Blueprint.Invocation.Builder addAdditionalRequestsBuilder( - int index) { - return getAdditionalRequestsFieldBuilder().addBuilder( - index, com.google.showcase.v1beta1.Test.Blueprint.Invocation.getDefaultInstance()); - } - /** - *
        -       * An ordered list of method calls that can be called to trigger this test.
        -       * 
        - * - * repeated .google.showcase.v1beta1.Test.Blueprint.Invocation additional_requests = 4; - */ - public java.util.List - getAdditionalRequestsBuilderList() { - return getAdditionalRequestsFieldBuilder().getBuilderList(); - } - private com.google.protobuf.RepeatedFieldBuilderV3< - com.google.showcase.v1beta1.Test.Blueprint.Invocation, com.google.showcase.v1beta1.Test.Blueprint.Invocation.Builder, com.google.showcase.v1beta1.Test.Blueprint.InvocationOrBuilder> - getAdditionalRequestsFieldBuilder() { - if (additionalRequestsBuilder_ == null) { - additionalRequestsBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< - com.google.showcase.v1beta1.Test.Blueprint.Invocation, com.google.showcase.v1beta1.Test.Blueprint.Invocation.Builder, com.google.showcase.v1beta1.Test.Blueprint.InvocationOrBuilder>( - additionalRequests_, - ((bitField0_ & 0x00000001) != 0), - getParentForChildren(), - isClean()); - additionalRequests_ = null; - } - return additionalRequestsBuilder_; - } - @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.showcase.v1beta1.Test.Blueprint) - } - - // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.Test.Blueprint) - private static final com.google.showcase.v1beta1.Test.Blueprint DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new com.google.showcase.v1beta1.Test.Blueprint(); - } - - public static com.google.showcase.v1beta1.Test.Blueprint getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public Blueprint parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new Blueprint(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public com.google.showcase.v1beta1.Test.Blueprint getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - - } - - public static final int NAME_FIELD_NUMBER = 1; - private volatile java.lang.Object name_; - /** - *
        -   * The name of the test.
        -   * The tests/* portion of the names are hard-coded, and do not change
        -   * from session to session.
        -   * 
        - * - * 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 name of the test.
        -   * The tests/* portion of the names are hard-coded, and do not change
        -   * from session to session.
        -   * 
        - * - * 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 EXPECTATION_LEVEL_FIELD_NUMBER = 2; - private int expectationLevel_; - /** - *
        -   * The expectation level for this test.
        -   * 
        - * - * .google.showcase.v1beta1.Test.ExpectationLevel expectation_level = 2; - * @return The enum numeric value on the wire for expectationLevel. - */ - @java.lang.Override public int getExpectationLevelValue() { - return expectationLevel_; - } - /** - *
        -   * The expectation level for this test.
        -   * 
        - * - * .google.showcase.v1beta1.Test.ExpectationLevel expectation_level = 2; - * @return The expectationLevel. - */ - @java.lang.Override public com.google.showcase.v1beta1.Test.ExpectationLevel getExpectationLevel() { - @SuppressWarnings("deprecation") - com.google.showcase.v1beta1.Test.ExpectationLevel result = com.google.showcase.v1beta1.Test.ExpectationLevel.valueOf(expectationLevel_); - return result == null ? com.google.showcase.v1beta1.Test.ExpectationLevel.UNRECOGNIZED : result; - } - - public static final int DESCRIPTION_FIELD_NUMBER = 3; - private volatile java.lang.Object description_; - /** - *
        -   * A description of the test.
        -   * 
        - * - * 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; - } - } - /** - *
        -   * A description of the test.
        -   * 
        - * - * 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 BLUEPRINTS_FIELD_NUMBER = 4; - private java.util.List blueprints_; - /** - *
        -   * The blueprints that will satisfy this test. There may be multiple blueprints
        -   * that can signal to the server that this test case is being exercised. Although
        -   * multiple blueprints are specified, only a single blueprint needs to be run to
        -   * signal that the test case was exercised.
        -   * 
        - * - * repeated .google.showcase.v1beta1.Test.Blueprint blueprints = 4; - */ - @java.lang.Override - public java.util.List getBlueprintsList() { - return blueprints_; - } - /** - *
        -   * The blueprints that will satisfy this test. There may be multiple blueprints
        -   * that can signal to the server that this test case is being exercised. Although
        -   * multiple blueprints are specified, only a single blueprint needs to be run to
        -   * signal that the test case was exercised.
        -   * 
        - * - * repeated .google.showcase.v1beta1.Test.Blueprint blueprints = 4; - */ - @java.lang.Override - public java.util.List - getBlueprintsOrBuilderList() { - return blueprints_; - } - /** - *
        -   * The blueprints that will satisfy this test. There may be multiple blueprints
        -   * that can signal to the server that this test case is being exercised. Although
        -   * multiple blueprints are specified, only a single blueprint needs to be run to
        -   * signal that the test case was exercised.
        -   * 
        - * - * repeated .google.showcase.v1beta1.Test.Blueprint blueprints = 4; - */ - @java.lang.Override - public int getBlueprintsCount() { - return blueprints_.size(); - } - /** - *
        -   * The blueprints that will satisfy this test. There may be multiple blueprints
        -   * that can signal to the server that this test case is being exercised. Although
        -   * multiple blueprints are specified, only a single blueprint needs to be run to
        -   * signal that the test case was exercised.
        -   * 
        - * - * repeated .google.showcase.v1beta1.Test.Blueprint blueprints = 4; - */ - @java.lang.Override - public com.google.showcase.v1beta1.Test.Blueprint getBlueprints(int index) { - return blueprints_.get(index); - } - /** - *
        -   * The blueprints that will satisfy this test. There may be multiple blueprints
        -   * that can signal to the server that this test case is being exercised. Although
        -   * multiple blueprints are specified, only a single blueprint needs to be run to
        -   * signal that the test case was exercised.
        -   * 
        - * - * repeated .google.showcase.v1beta1.Test.Blueprint blueprints = 4; - */ - @java.lang.Override - public com.google.showcase.v1beta1.Test.BlueprintOrBuilder getBlueprintsOrBuilder( - int index) { - return blueprints_.get(index); - } - - private byte memoizedIsInitialized = -1; - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); - } - if (expectationLevel_ != com.google.showcase.v1beta1.Test.ExpectationLevel.EXPECTATION_LEVEL_UNSPECIFIED.getNumber()) { - output.writeEnum(2, expectationLevel_); - } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(description_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 3, description_); - } - for (int i = 0; i < blueprints_.size(); i++) { - output.writeMessage(4, blueprints_.get(i)); - } - unknownFields.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 (expectationLevel_ != com.google.showcase.v1beta1.Test.ExpectationLevel.EXPECTATION_LEVEL_UNSPECIFIED.getNumber()) { - size += com.google.protobuf.CodedOutputStream - .computeEnumSize(2, expectationLevel_); - } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(description_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, description_); - } - for (int i = 0; i < blueprints_.size(); i++) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(4, blueprints_.get(i)); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof com.google.showcase.v1beta1.Test)) { - return super.equals(obj); - } - com.google.showcase.v1beta1.Test other = (com.google.showcase.v1beta1.Test) obj; - - if (!getName() - .equals(other.getName())) return false; - if (expectationLevel_ != other.expectationLevel_) return false; - if (!getDescription() - .equals(other.getDescription())) return false; - if (!getBlueprintsList() - .equals(other.getBlueprintsList())) return false; - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - hash = (37 * hash) + NAME_FIELD_NUMBER; - hash = (53 * hash) + getName().hashCode(); - hash = (37 * hash) + EXPECTATION_LEVEL_FIELD_NUMBER; - hash = (53 * hash) + expectationLevel_; - hash = (37 * hash) + DESCRIPTION_FIELD_NUMBER; - hash = (53 * hash) + getDescription().hashCode(); - if (getBlueprintsCount() > 0) { - hash = (37 * hash) + BLUEPRINTS_FIELD_NUMBER; - hash = (53 * hash) + getBlueprintsList().hashCode(); - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.showcase.v1beta1.Test parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.showcase.v1beta1.Test parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.showcase.v1beta1.Test parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.showcase.v1beta1.Test 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.showcase.v1beta1.Test parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.showcase.v1beta1.Test parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.showcase.v1beta1.Test parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static com.google.showcase.v1beta1.Test 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.showcase.v1beta1.Test parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static com.google.showcase.v1beta1.Test 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.showcase.v1beta1.Test parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static com.google.showcase.v1beta1.Test 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.showcase.v1beta1.Test prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - @java.lang.Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - * Protobuf type {@code google.showcase.v1beta1.Test} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.Test) - com.google.showcase.v1beta1.TestOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.google.showcase.v1beta1.TestingOuterClass.internal_static_google_showcase_v1beta1_Test_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.showcase.v1beta1.TestingOuterClass.internal_static_google_showcase_v1beta1_Test_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.showcase.v1beta1.Test.class, com.google.showcase.v1beta1.Test.Builder.class); - } - - // Construct using com.google.showcase.v1beta1.Test.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { - getBlueprintsFieldBuilder(); - } - } - @java.lang.Override - public Builder clear() { - super.clear(); - name_ = ""; - - expectationLevel_ = 0; - - description_ = ""; - - if (blueprintsBuilder_ == null) { - blueprints_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - } else { - blueprintsBuilder_.clear(); - } - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return com.google.showcase.v1beta1.TestingOuterClass.internal_static_google_showcase_v1beta1_Test_descriptor; - } - - @java.lang.Override - public com.google.showcase.v1beta1.Test getDefaultInstanceForType() { - return com.google.showcase.v1beta1.Test.getDefaultInstance(); - } - - @java.lang.Override - public com.google.showcase.v1beta1.Test build() { - com.google.showcase.v1beta1.Test result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.showcase.v1beta1.Test buildPartial() { - com.google.showcase.v1beta1.Test result = new com.google.showcase.v1beta1.Test(this); - int from_bitField0_ = bitField0_; - result.name_ = name_; - result.expectationLevel_ = expectationLevel_; - result.description_ = description_; - if (blueprintsBuilder_ == null) { - if (((bitField0_ & 0x00000001) != 0)) { - blueprints_ = java.util.Collections.unmodifiableList(blueprints_); - bitField0_ = (bitField0_ & ~0x00000001); - } - result.blueprints_ = blueprints_; - } else { - result.blueprints_ = blueprintsBuilder_.build(); - } - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.setField(field, value); - } - @java.lang.Override - public Builder clearField( - com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - @java.lang.Override - public Builder clearOneof( - com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.addRepeatedField(field, value); - } - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof com.google.showcase.v1beta1.Test) { - return mergeFrom((com.google.showcase.v1beta1.Test)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.showcase.v1beta1.Test other) { - if (other == com.google.showcase.v1beta1.Test.getDefaultInstance()) return this; - if (!other.getName().isEmpty()) { - name_ = other.name_; - onChanged(); - } - if (other.expectationLevel_ != 0) { - setExpectationLevelValue(other.getExpectationLevelValue()); - } - if (!other.getDescription().isEmpty()) { - description_ = other.description_; - onChanged(); - } - if (blueprintsBuilder_ == null) { - if (!other.blueprints_.isEmpty()) { - if (blueprints_.isEmpty()) { - blueprints_ = other.blueprints_; - bitField0_ = (bitField0_ & ~0x00000001); - } else { - ensureBlueprintsIsMutable(); - blueprints_.addAll(other.blueprints_); - } - onChanged(); - } - } else { - if (!other.blueprints_.isEmpty()) { - if (blueprintsBuilder_.isEmpty()) { - blueprintsBuilder_.dispose(); - blueprintsBuilder_ = null; - blueprints_ = other.blueprints_; - bitField0_ = (bitField0_ & ~0x00000001); - blueprintsBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? - getBlueprintsFieldBuilder() : null; - } else { - blueprintsBuilder_.addAllMessages(other.blueprints_); - } - } - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - com.google.showcase.v1beta1.Test parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (com.google.showcase.v1beta1.Test) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - private int bitField0_; - - private java.lang.Object name_ = ""; - /** - *
        -     * The name of the test.
        -     * The tests/* portion of the names are hard-coded, and do not change
        -     * from session to session.
        -     * 
        - * - * 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 name of the test.
        -     * The tests/* portion of the names are hard-coded, and do not change
        -     * from session to session.
        -     * 
        - * - * 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 name of the test.
        -     * The tests/* portion of the names are hard-coded, and do not change
        -     * from session to session.
        -     * 
        - * - * string name = 1; - * @param value The name to set. - * @return This builder for chaining. - */ - public Builder setName( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - name_ = value; - onChanged(); - return this; - } - /** - *
        -     * The name of the test.
        -     * The tests/* portion of the names are hard-coded, and do not change
        -     * from session to session.
        -     * 
        - * - * string name = 1; - * @return This builder for chaining. - */ - public Builder clearName() { - - name_ = getDefaultInstance().getName(); - onChanged(); - return this; - } - /** - *
        -     * The name of the test.
        -     * The tests/* portion of the names are hard-coded, and do not change
        -     * from session to session.
        -     * 
        - * - * string name = 1; - * @param value The bytes for name to set. - * @return This builder for chaining. - */ - public Builder setNameBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - name_ = value; - onChanged(); - return this; - } - - private int expectationLevel_ = 0; - /** - *
        -     * The expectation level for this test.
        -     * 
        - * - * .google.showcase.v1beta1.Test.ExpectationLevel expectation_level = 2; - * @return The enum numeric value on the wire for expectationLevel. - */ - @java.lang.Override public int getExpectationLevelValue() { - return expectationLevel_; - } - /** - *
        -     * The expectation level for this test.
        -     * 
        - * - * .google.showcase.v1beta1.Test.ExpectationLevel expectation_level = 2; - * @param value The enum numeric value on the wire for expectationLevel to set. - * @return This builder for chaining. - */ - public Builder setExpectationLevelValue(int value) { - - expectationLevel_ = value; - onChanged(); - return this; - } - /** - *
        -     * The expectation level for this test.
        -     * 
        - * - * .google.showcase.v1beta1.Test.ExpectationLevel expectation_level = 2; - * @return The expectationLevel. - */ - @java.lang.Override - public com.google.showcase.v1beta1.Test.ExpectationLevel getExpectationLevel() { - @SuppressWarnings("deprecation") - com.google.showcase.v1beta1.Test.ExpectationLevel result = com.google.showcase.v1beta1.Test.ExpectationLevel.valueOf(expectationLevel_); - return result == null ? com.google.showcase.v1beta1.Test.ExpectationLevel.UNRECOGNIZED : result; - } - /** - *
        -     * The expectation level for this test.
        -     * 
        - * - * .google.showcase.v1beta1.Test.ExpectationLevel expectation_level = 2; - * @param value The expectationLevel to set. - * @return This builder for chaining. - */ - public Builder setExpectationLevel(com.google.showcase.v1beta1.Test.ExpectationLevel value) { - if (value == null) { - throw new NullPointerException(); - } - - expectationLevel_ = value.getNumber(); - onChanged(); - return this; - } - /** - *
        -     * The expectation level for this test.
        -     * 
        - * - * .google.showcase.v1beta1.Test.ExpectationLevel expectation_level = 2; - * @return This builder for chaining. - */ - public Builder clearExpectationLevel() { - - expectationLevel_ = 0; - onChanged(); - return this; - } - - private java.lang.Object description_ = ""; - /** - *
        -     * A description of the test.
        -     * 
        - * - * 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; - } - } - /** - *
        -     * A description of the test.
        -     * 
        - * - * 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; - } - } - /** - *
        -     * A description of the test.
        -     * 
        - * - * string description = 3; - * @param value The description to set. - * @return This builder for chaining. - */ - public Builder setDescription( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - description_ = value; - onChanged(); - return this; - } - /** - *
        -     * A description of the test.
        -     * 
        - * - * string description = 3; - * @return This builder for chaining. - */ - public Builder clearDescription() { - - description_ = getDefaultInstance().getDescription(); - onChanged(); - return this; - } - /** - *
        -     * A description of the test.
        -     * 
        - * - * string description = 3; - * @param value The bytes for description to set. - * @return This builder for chaining. - */ - public Builder setDescriptionBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - description_ = value; - onChanged(); - return this; - } - - private java.util.List blueprints_ = - java.util.Collections.emptyList(); - private void ensureBlueprintsIsMutable() { - if (!((bitField0_ & 0x00000001) != 0)) { - blueprints_ = new java.util.ArrayList(blueprints_); - bitField0_ |= 0x00000001; - } - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - com.google.showcase.v1beta1.Test.Blueprint, com.google.showcase.v1beta1.Test.Blueprint.Builder, com.google.showcase.v1beta1.Test.BlueprintOrBuilder> blueprintsBuilder_; - - /** - *
        -     * The blueprints that will satisfy this test. There may be multiple blueprints
        -     * that can signal to the server that this test case is being exercised. Although
        -     * multiple blueprints are specified, only a single blueprint needs to be run to
        -     * signal that the test case was exercised.
        -     * 
        - * - * repeated .google.showcase.v1beta1.Test.Blueprint blueprints = 4; - */ - public java.util.List getBlueprintsList() { - if (blueprintsBuilder_ == null) { - return java.util.Collections.unmodifiableList(blueprints_); - } else { - return blueprintsBuilder_.getMessageList(); - } - } - /** - *
        -     * The blueprints that will satisfy this test. There may be multiple blueprints
        -     * that can signal to the server that this test case is being exercised. Although
        -     * multiple blueprints are specified, only a single blueprint needs to be run to
        -     * signal that the test case was exercised.
        -     * 
        - * - * repeated .google.showcase.v1beta1.Test.Blueprint blueprints = 4; - */ - public int getBlueprintsCount() { - if (blueprintsBuilder_ == null) { - return blueprints_.size(); - } else { - return blueprintsBuilder_.getCount(); - } - } - /** - *
        -     * The blueprints that will satisfy this test. There may be multiple blueprints
        -     * that can signal to the server that this test case is being exercised. Although
        -     * multiple blueprints are specified, only a single blueprint needs to be run to
        -     * signal that the test case was exercised.
        -     * 
        - * - * repeated .google.showcase.v1beta1.Test.Blueprint blueprints = 4; - */ - public com.google.showcase.v1beta1.Test.Blueprint getBlueprints(int index) { - if (blueprintsBuilder_ == null) { - return blueprints_.get(index); - } else { - return blueprintsBuilder_.getMessage(index); - } - } - /** - *
        -     * The blueprints that will satisfy this test. There may be multiple blueprints
        -     * that can signal to the server that this test case is being exercised. Although
        -     * multiple blueprints are specified, only a single blueprint needs to be run to
        -     * signal that the test case was exercised.
        -     * 
        - * - * repeated .google.showcase.v1beta1.Test.Blueprint blueprints = 4; - */ - public Builder setBlueprints( - int index, com.google.showcase.v1beta1.Test.Blueprint value) { - if (blueprintsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureBlueprintsIsMutable(); - blueprints_.set(index, value); - onChanged(); - } else { - blueprintsBuilder_.setMessage(index, value); - } - return this; - } - /** - *
        -     * The blueprints that will satisfy this test. There may be multiple blueprints
        -     * that can signal to the server that this test case is being exercised. Although
        -     * multiple blueprints are specified, only a single blueprint needs to be run to
        -     * signal that the test case was exercised.
        -     * 
        - * - * repeated .google.showcase.v1beta1.Test.Blueprint blueprints = 4; - */ - public Builder setBlueprints( - int index, com.google.showcase.v1beta1.Test.Blueprint.Builder builderForValue) { - if (blueprintsBuilder_ == null) { - ensureBlueprintsIsMutable(); - blueprints_.set(index, builderForValue.build()); - onChanged(); - } else { - blueprintsBuilder_.setMessage(index, builderForValue.build()); - } - return this; - } - /** - *
        -     * The blueprints that will satisfy this test. There may be multiple blueprints
        -     * that can signal to the server that this test case is being exercised. Although
        -     * multiple blueprints are specified, only a single blueprint needs to be run to
        -     * signal that the test case was exercised.
        -     * 
        - * - * repeated .google.showcase.v1beta1.Test.Blueprint blueprints = 4; - */ - public Builder addBlueprints(com.google.showcase.v1beta1.Test.Blueprint value) { - if (blueprintsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureBlueprintsIsMutable(); - blueprints_.add(value); - onChanged(); - } else { - blueprintsBuilder_.addMessage(value); - } - return this; - } - /** - *
        -     * The blueprints that will satisfy this test. There may be multiple blueprints
        -     * that can signal to the server that this test case is being exercised. Although
        -     * multiple blueprints are specified, only a single blueprint needs to be run to
        -     * signal that the test case was exercised.
        -     * 
        - * - * repeated .google.showcase.v1beta1.Test.Blueprint blueprints = 4; - */ - public Builder addBlueprints( - int index, com.google.showcase.v1beta1.Test.Blueprint value) { - if (blueprintsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureBlueprintsIsMutable(); - blueprints_.add(index, value); - onChanged(); - } else { - blueprintsBuilder_.addMessage(index, value); - } - return this; - } - /** - *
        -     * The blueprints that will satisfy this test. There may be multiple blueprints
        -     * that can signal to the server that this test case is being exercised. Although
        -     * multiple blueprints are specified, only a single blueprint needs to be run to
        -     * signal that the test case was exercised.
        -     * 
        - * - * repeated .google.showcase.v1beta1.Test.Blueprint blueprints = 4; - */ - public Builder addBlueprints( - com.google.showcase.v1beta1.Test.Blueprint.Builder builderForValue) { - if (blueprintsBuilder_ == null) { - ensureBlueprintsIsMutable(); - blueprints_.add(builderForValue.build()); - onChanged(); - } else { - blueprintsBuilder_.addMessage(builderForValue.build()); - } - return this; - } - /** - *
        -     * The blueprints that will satisfy this test. There may be multiple blueprints
        -     * that can signal to the server that this test case is being exercised. Although
        -     * multiple blueprints are specified, only a single blueprint needs to be run to
        -     * signal that the test case was exercised.
        -     * 
        - * - * repeated .google.showcase.v1beta1.Test.Blueprint blueprints = 4; - */ - public Builder addBlueprints( - int index, com.google.showcase.v1beta1.Test.Blueprint.Builder builderForValue) { - if (blueprintsBuilder_ == null) { - ensureBlueprintsIsMutable(); - blueprints_.add(index, builderForValue.build()); - onChanged(); - } else { - blueprintsBuilder_.addMessage(index, builderForValue.build()); - } - return this; - } - /** - *
        -     * The blueprints that will satisfy this test. There may be multiple blueprints
        -     * that can signal to the server that this test case is being exercised. Although
        -     * multiple blueprints are specified, only a single blueprint needs to be run to
        -     * signal that the test case was exercised.
        -     * 
        - * - * repeated .google.showcase.v1beta1.Test.Blueprint blueprints = 4; - */ - public Builder addAllBlueprints( - java.lang.Iterable values) { - if (blueprintsBuilder_ == null) { - ensureBlueprintsIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, blueprints_); - onChanged(); - } else { - blueprintsBuilder_.addAllMessages(values); - } - return this; - } - /** - *
        -     * The blueprints that will satisfy this test. There may be multiple blueprints
        -     * that can signal to the server that this test case is being exercised. Although
        -     * multiple blueprints are specified, only a single blueprint needs to be run to
        -     * signal that the test case was exercised.
        -     * 
        - * - * repeated .google.showcase.v1beta1.Test.Blueprint blueprints = 4; - */ - public Builder clearBlueprints() { - if (blueprintsBuilder_ == null) { - blueprints_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - onChanged(); - } else { - blueprintsBuilder_.clear(); - } - return this; - } - /** - *
        -     * The blueprints that will satisfy this test. There may be multiple blueprints
        -     * that can signal to the server that this test case is being exercised. Although
        -     * multiple blueprints are specified, only a single blueprint needs to be run to
        -     * signal that the test case was exercised.
        -     * 
        - * - * repeated .google.showcase.v1beta1.Test.Blueprint blueprints = 4; - */ - public Builder removeBlueprints(int index) { - if (blueprintsBuilder_ == null) { - ensureBlueprintsIsMutable(); - blueprints_.remove(index); - onChanged(); - } else { - blueprintsBuilder_.remove(index); - } - return this; - } - /** - *
        -     * The blueprints that will satisfy this test. There may be multiple blueprints
        -     * that can signal to the server that this test case is being exercised. Although
        -     * multiple blueprints are specified, only a single blueprint needs to be run to
        -     * signal that the test case was exercised.
        -     * 
        - * - * repeated .google.showcase.v1beta1.Test.Blueprint blueprints = 4; - */ - public com.google.showcase.v1beta1.Test.Blueprint.Builder getBlueprintsBuilder( - int index) { - return getBlueprintsFieldBuilder().getBuilder(index); - } - /** - *
        -     * The blueprints that will satisfy this test. There may be multiple blueprints
        -     * that can signal to the server that this test case is being exercised. Although
        -     * multiple blueprints are specified, only a single blueprint needs to be run to
        -     * signal that the test case was exercised.
        -     * 
        - * - * repeated .google.showcase.v1beta1.Test.Blueprint blueprints = 4; - */ - public com.google.showcase.v1beta1.Test.BlueprintOrBuilder getBlueprintsOrBuilder( - int index) { - if (blueprintsBuilder_ == null) { - return blueprints_.get(index); } else { - return blueprintsBuilder_.getMessageOrBuilder(index); - } - } - /** - *
        -     * The blueprints that will satisfy this test. There may be multiple blueprints
        -     * that can signal to the server that this test case is being exercised. Although
        -     * multiple blueprints are specified, only a single blueprint needs to be run to
        -     * signal that the test case was exercised.
        -     * 
        - * - * repeated .google.showcase.v1beta1.Test.Blueprint blueprints = 4; - */ - public java.util.List - getBlueprintsOrBuilderList() { - if (blueprintsBuilder_ != null) { - return blueprintsBuilder_.getMessageOrBuilderList(); - } else { - return java.util.Collections.unmodifiableList(blueprints_); - } - } - /** - *
        -     * The blueprints that will satisfy this test. There may be multiple blueprints
        -     * that can signal to the server that this test case is being exercised. Although
        -     * multiple blueprints are specified, only a single blueprint needs to be run to
        -     * signal that the test case was exercised.
        -     * 
        - * - * repeated .google.showcase.v1beta1.Test.Blueprint blueprints = 4; - */ - public com.google.showcase.v1beta1.Test.Blueprint.Builder addBlueprintsBuilder() { - return getBlueprintsFieldBuilder().addBuilder( - com.google.showcase.v1beta1.Test.Blueprint.getDefaultInstance()); - } - /** - *
        -     * The blueprints that will satisfy this test. There may be multiple blueprints
        -     * that can signal to the server that this test case is being exercised. Although
        -     * multiple blueprints are specified, only a single blueprint needs to be run to
        -     * signal that the test case was exercised.
        -     * 
        - * - * repeated .google.showcase.v1beta1.Test.Blueprint blueprints = 4; - */ - public com.google.showcase.v1beta1.Test.Blueprint.Builder addBlueprintsBuilder( - int index) { - return getBlueprintsFieldBuilder().addBuilder( - index, com.google.showcase.v1beta1.Test.Blueprint.getDefaultInstance()); - } - /** - *
        -     * The blueprints that will satisfy this test. There may be multiple blueprints
        -     * that can signal to the server that this test case is being exercised. Although
        -     * multiple blueprints are specified, only a single blueprint needs to be run to
        -     * signal that the test case was exercised.
        -     * 
        - * - * repeated .google.showcase.v1beta1.Test.Blueprint blueprints = 4; - */ - public java.util.List - getBlueprintsBuilderList() { - return getBlueprintsFieldBuilder().getBuilderList(); - } - private com.google.protobuf.RepeatedFieldBuilderV3< - com.google.showcase.v1beta1.Test.Blueprint, com.google.showcase.v1beta1.Test.Blueprint.Builder, com.google.showcase.v1beta1.Test.BlueprintOrBuilder> - getBlueprintsFieldBuilder() { - if (blueprintsBuilder_ == null) { - blueprintsBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< - com.google.showcase.v1beta1.Test.Blueprint, com.google.showcase.v1beta1.Test.Blueprint.Builder, com.google.showcase.v1beta1.Test.BlueprintOrBuilder>( - blueprints_, - ((bitField0_ & 0x00000001) != 0), - getParentForChildren(), - isClean()); - blueprints_ = null; - } - return blueprintsBuilder_; - } - @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.showcase.v1beta1.Test) - } - - // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.Test) - private static final com.google.showcase.v1beta1.Test DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new com.google.showcase.v1beta1.Test(); - } - - public static com.google.showcase.v1beta1.Test getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public Test parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new Test(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public com.google.showcase.v1beta1.Test getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/TestName.java b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/TestName.java deleted file mode 100644 index fb2855113a..0000000000 --- a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/TestName.java +++ /dev/null @@ -1,191 +0,0 @@ -/* - * 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 - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1; - -import com.google.api.pathtemplate.PathTemplate; -import com.google.api.resourcenames.ResourceName; -import com.google.common.base.Preconditions; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import javax.annotation.Generated; - -// AUTO-GENERATED DOCUMENTATION AND CLASS. -@Generated("by gapic-generator-java") -public class TestName implements ResourceName { - private static final PathTemplate SESSION_TEST = - PathTemplate.createWithoutUrlEncoding("sessions/{session}/tests/{test}"); - private volatile Map fieldValuesMap; - private final String session; - private final String test; - - @Deprecated - protected TestName() { - session = null; - test = null; - } - - private TestName(Builder builder) { - session = Preconditions.checkNotNull(builder.getSession()); - test = Preconditions.checkNotNull(builder.getTest()); - } - - public String getSession() { - return session; - } - - public String getTest() { - return test; - } - - public static Builder newBuilder() { - return new Builder(); - } - - public Builder toBuilder() { - return new Builder(this); - } - - public static TestName of(String session, String test) { - return newBuilder().setSession(session).setTest(test).build(); - } - - public static String format(String session, String test) { - return newBuilder().setSession(session).setTest(test).build().toString(); - } - - public static TestName parse(String formattedString) { - if (formattedString.isEmpty()) { - return null; - } - Map matchMap = - SESSION_TEST.validatedMatch( - formattedString, "TestName.parse: formattedString not in valid format"); - return of(matchMap.get("session"), matchMap.get("test")); - } - - 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 (TestName value : values) { - if (value == null) { - list.add(""); - } else { - list.add(value.toString()); - } - } - return list; - } - - public static boolean isParsableFrom(String formattedString) { - return SESSION_TEST.matches(formattedString); - } - - @Override - public Map getFieldValuesMap() { - if (fieldValuesMap == null) { - synchronized (this) { - if (fieldValuesMap == null) { - ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); - if (session != null) { - fieldMapBuilder.put("session", session); - } - if (test != null) { - fieldMapBuilder.put("test", test); - } - fieldValuesMap = fieldMapBuilder.build(); - } - } - } - return fieldValuesMap; - } - - public String getFieldValue(String fieldName) { - return getFieldValuesMap().get(fieldName); - } - - @Override - public String toString() { - return SESSION_TEST.instantiate("session", session, "test", test); - } - - @Override - public boolean equals(Object o) { - if (o == this) { - return true; - } - if (o != null || getClass() == o.getClass()) { - TestName that = ((TestName) o); - return Objects.equals(this.session, that.session) && Objects.equals(this.test, that.test); - } - return false; - } - - @Override - public int hashCode() { - int h = 1; - h *= 1000003; - h ^= Objects.hashCode(session); - h *= 1000003; - h ^= Objects.hashCode(test); - return h; - } - - /** Builder for sessions/{session}/tests/{test}. */ - public static class Builder { - private String session; - private String test; - - protected Builder() {} - - public String getSession() { - return session; - } - - public String getTest() { - return test; - } - - public Builder setSession(String session) { - this.session = session; - return this; - } - - public Builder setTest(String test) { - this.test = test; - return this; - } - - private Builder(TestName testName) { - this.session = testName.session; - this.test = testName.test; - } - - public TestName build() { - return new TestName(this); - } - } -} diff --git a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/TestOrBuilder.java b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/TestOrBuilder.java deleted file mode 100644 index 54a88bc62a..0000000000 --- a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/TestOrBuilder.java +++ /dev/null @@ -1,131 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: schema/google/showcase/v1beta1/testing.proto - -package com.google.showcase.v1beta1; - -public interface TestOrBuilder extends - // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.Test) - com.google.protobuf.MessageOrBuilder { - - /** - *
        -   * The name of the test.
        -   * The tests/* portion of the names are hard-coded, and do not change
        -   * from session to session.
        -   * 
        - * - * string name = 1; - * @return The name. - */ - java.lang.String getName(); - /** - *
        -   * The name of the test.
        -   * The tests/* portion of the names are hard-coded, and do not change
        -   * from session to session.
        -   * 
        - * - * string name = 1; - * @return The bytes for name. - */ - com.google.protobuf.ByteString - getNameBytes(); - - /** - *
        -   * The expectation level for this test.
        -   * 
        - * - * .google.showcase.v1beta1.Test.ExpectationLevel expectation_level = 2; - * @return The enum numeric value on the wire for expectationLevel. - */ - int getExpectationLevelValue(); - /** - *
        -   * The expectation level for this test.
        -   * 
        - * - * .google.showcase.v1beta1.Test.ExpectationLevel expectation_level = 2; - * @return The expectationLevel. - */ - com.google.showcase.v1beta1.Test.ExpectationLevel getExpectationLevel(); - - /** - *
        -   * A description of the test.
        -   * 
        - * - * string description = 3; - * @return The description. - */ - java.lang.String getDescription(); - /** - *
        -   * A description of the test.
        -   * 
        - * - * string description = 3; - * @return The bytes for description. - */ - com.google.protobuf.ByteString - getDescriptionBytes(); - - /** - *
        -   * The blueprints that will satisfy this test. There may be multiple blueprints
        -   * that can signal to the server that this test case is being exercised. Although
        -   * multiple blueprints are specified, only a single blueprint needs to be run to
        -   * signal that the test case was exercised.
        -   * 
        - * - * repeated .google.showcase.v1beta1.Test.Blueprint blueprints = 4; - */ - java.util.List - getBlueprintsList(); - /** - *
        -   * The blueprints that will satisfy this test. There may be multiple blueprints
        -   * that can signal to the server that this test case is being exercised. Although
        -   * multiple blueprints are specified, only a single blueprint needs to be run to
        -   * signal that the test case was exercised.
        -   * 
        - * - * repeated .google.showcase.v1beta1.Test.Blueprint blueprints = 4; - */ - com.google.showcase.v1beta1.Test.Blueprint getBlueprints(int index); - /** - *
        -   * The blueprints that will satisfy this test. There may be multiple blueprints
        -   * that can signal to the server that this test case is being exercised. Although
        -   * multiple blueprints are specified, only a single blueprint needs to be run to
        -   * signal that the test case was exercised.
        -   * 
        - * - * repeated .google.showcase.v1beta1.Test.Blueprint blueprints = 4; - */ - int getBlueprintsCount(); - /** - *
        -   * The blueprints that will satisfy this test. There may be multiple blueprints
        -   * that can signal to the server that this test case is being exercised. Although
        -   * multiple blueprints are specified, only a single blueprint needs to be run to
        -   * signal that the test case was exercised.
        -   * 
        - * - * repeated .google.showcase.v1beta1.Test.Blueprint blueprints = 4; - */ - java.util.List - getBlueprintsOrBuilderList(); - /** - *
        -   * The blueprints that will satisfy this test. There may be multiple blueprints
        -   * that can signal to the server that this test case is being exercised. Although
        -   * multiple blueprints are specified, only a single blueprint needs to be run to
        -   * signal that the test case was exercised.
        -   * 
        - * - * repeated .google.showcase.v1beta1.Test.Blueprint blueprints = 4; - */ - com.google.showcase.v1beta1.Test.BlueprintOrBuilder getBlueprintsOrBuilder( - int index); -} diff --git a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/TestRun.java b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/TestRun.java deleted file mode 100644 index f83126f72c..0000000000 --- a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/TestRun.java +++ /dev/null @@ -1,845 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: schema/google/showcase/v1beta1/testing.proto - -package com.google.showcase.v1beta1; - -/** - *
        - * A TestRun is the result of running a Test.
        - * 
        - * - * Protobuf type {@code google.showcase.v1beta1.TestRun} - */ -public final class TestRun extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.TestRun) - TestRunOrBuilder { -private static final long serialVersionUID = 0L; - // Use TestRun.newBuilder() to construct. - private TestRun(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private TestRun() { - test_ = ""; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new TestRun(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private TestRun( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: { - java.lang.String s = input.readStringRequireUtf8(); - - test_ = s; - break; - } - case 18: { - com.google.showcase.v1beta1.Issue.Builder subBuilder = null; - if (issue_ != null) { - subBuilder = issue_.toBuilder(); - } - issue_ = input.readMessage(com.google.showcase.v1beta1.Issue.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(issue_); - issue_ = subBuilder.buildPartial(); - } - - break; - } - default: { - if (!parseUnknownField( - input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException( - e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.google.showcase.v1beta1.TestingOuterClass.internal_static_google_showcase_v1beta1_TestRun_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.showcase.v1beta1.TestingOuterClass.internal_static_google_showcase_v1beta1_TestRun_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.showcase.v1beta1.TestRun.class, com.google.showcase.v1beta1.TestRun.Builder.class); - } - - public static final int TEST_FIELD_NUMBER = 1; - private volatile java.lang.Object test_; - /** - *
        -   * The name of the test.
        -   * The tests/* portion of the names are hard-coded, and do not change
        -   * from session to session.
        -   * 
        - * - * string test = 1 [(.google.api.resource_reference) = { ... } - * @return The test. - */ - @java.lang.Override - public java.lang.String getTest() { - java.lang.Object ref = test_; - 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(); - test_ = s; - return s; - } - } - /** - *
        -   * The name of the test.
        -   * The tests/* portion of the names are hard-coded, and do not change
        -   * from session to session.
        -   * 
        - * - * string test = 1 [(.google.api.resource_reference) = { ... } - * @return The bytes for test. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getTestBytes() { - java.lang.Object ref = test_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - test_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int ISSUE_FIELD_NUMBER = 2; - private com.google.showcase.v1beta1.Issue issue_; - /** - *
        -   * An issue found with the test run. If empty, this test run was successful.
        -   * 
        - * - * .google.showcase.v1beta1.Issue issue = 2; - * @return Whether the issue field is set. - */ - @java.lang.Override - public boolean hasIssue() { - return issue_ != null; - } - /** - *
        -   * An issue found with the test run. If empty, this test run was successful.
        -   * 
        - * - * .google.showcase.v1beta1.Issue issue = 2; - * @return The issue. - */ - @java.lang.Override - public com.google.showcase.v1beta1.Issue getIssue() { - return issue_ == null ? com.google.showcase.v1beta1.Issue.getDefaultInstance() : issue_; - } - /** - *
        -   * An issue found with the test run. If empty, this test run was successful.
        -   * 
        - * - * .google.showcase.v1beta1.Issue issue = 2; - */ - @java.lang.Override - public com.google.showcase.v1beta1.IssueOrBuilder getIssueOrBuilder() { - return getIssue(); - } - - 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(test_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, test_); - } - if (issue_ != null) { - output.writeMessage(2, getIssue()); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(test_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, test_); - } - if (issue_ != null) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(2, getIssue()); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof com.google.showcase.v1beta1.TestRun)) { - return super.equals(obj); - } - com.google.showcase.v1beta1.TestRun other = (com.google.showcase.v1beta1.TestRun) obj; - - if (!getTest() - .equals(other.getTest())) return false; - if (hasIssue() != other.hasIssue()) return false; - if (hasIssue()) { - if (!getIssue() - .equals(other.getIssue())) return false; - } - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - hash = (37 * hash) + TEST_FIELD_NUMBER; - hash = (53 * hash) + getTest().hashCode(); - if (hasIssue()) { - hash = (37 * hash) + ISSUE_FIELD_NUMBER; - hash = (53 * hash) + getIssue().hashCode(); - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.showcase.v1beta1.TestRun parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.showcase.v1beta1.TestRun parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.showcase.v1beta1.TestRun parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.showcase.v1beta1.TestRun 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.showcase.v1beta1.TestRun parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.showcase.v1beta1.TestRun parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.showcase.v1beta1.TestRun parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static com.google.showcase.v1beta1.TestRun 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.showcase.v1beta1.TestRun parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static com.google.showcase.v1beta1.TestRun 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.showcase.v1beta1.TestRun parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static com.google.showcase.v1beta1.TestRun 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.showcase.v1beta1.TestRun prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - @java.lang.Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - *
        -   * A TestRun is the result of running a Test.
        -   * 
        - * - * Protobuf type {@code google.showcase.v1beta1.TestRun} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.TestRun) - com.google.showcase.v1beta1.TestRunOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.google.showcase.v1beta1.TestingOuterClass.internal_static_google_showcase_v1beta1_TestRun_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.showcase.v1beta1.TestingOuterClass.internal_static_google_showcase_v1beta1_TestRun_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.showcase.v1beta1.TestRun.class, com.google.showcase.v1beta1.TestRun.Builder.class); - } - - // Construct using com.google.showcase.v1beta1.TestRun.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { - } - } - @java.lang.Override - public Builder clear() { - super.clear(); - test_ = ""; - - if (issueBuilder_ == null) { - issue_ = null; - } else { - issue_ = null; - issueBuilder_ = null; - } - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return com.google.showcase.v1beta1.TestingOuterClass.internal_static_google_showcase_v1beta1_TestRun_descriptor; - } - - @java.lang.Override - public com.google.showcase.v1beta1.TestRun getDefaultInstanceForType() { - return com.google.showcase.v1beta1.TestRun.getDefaultInstance(); - } - - @java.lang.Override - public com.google.showcase.v1beta1.TestRun build() { - com.google.showcase.v1beta1.TestRun result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.showcase.v1beta1.TestRun buildPartial() { - com.google.showcase.v1beta1.TestRun result = new com.google.showcase.v1beta1.TestRun(this); - result.test_ = test_; - if (issueBuilder_ == null) { - result.issue_ = issue_; - } else { - result.issue_ = issueBuilder_.build(); - } - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.setField(field, value); - } - @java.lang.Override - public Builder clearField( - com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - @java.lang.Override - public Builder clearOneof( - com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.addRepeatedField(field, value); - } - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof com.google.showcase.v1beta1.TestRun) { - return mergeFrom((com.google.showcase.v1beta1.TestRun)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.showcase.v1beta1.TestRun other) { - if (other == com.google.showcase.v1beta1.TestRun.getDefaultInstance()) return this; - if (!other.getTest().isEmpty()) { - test_ = other.test_; - onChanged(); - } - if (other.hasIssue()) { - mergeIssue(other.getIssue()); - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - com.google.showcase.v1beta1.TestRun parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (com.google.showcase.v1beta1.TestRun) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private java.lang.Object test_ = ""; - /** - *
        -     * The name of the test.
        -     * The tests/* portion of the names are hard-coded, and do not change
        -     * from session to session.
        -     * 
        - * - * string test = 1 [(.google.api.resource_reference) = { ... } - * @return The test. - */ - public java.lang.String getTest() { - java.lang.Object ref = test_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - test_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - *
        -     * The name of the test.
        -     * The tests/* portion of the names are hard-coded, and do not change
        -     * from session to session.
        -     * 
        - * - * string test = 1 [(.google.api.resource_reference) = { ... } - * @return The bytes for test. - */ - public com.google.protobuf.ByteString - getTestBytes() { - java.lang.Object ref = test_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - test_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - *
        -     * The name of the test.
        -     * The tests/* portion of the names are hard-coded, and do not change
        -     * from session to session.
        -     * 
        - * - * string test = 1 [(.google.api.resource_reference) = { ... } - * @param value The test to set. - * @return This builder for chaining. - */ - public Builder setTest( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - test_ = value; - onChanged(); - return this; - } - /** - *
        -     * The name of the test.
        -     * The tests/* portion of the names are hard-coded, and do not change
        -     * from session to session.
        -     * 
        - * - * string test = 1 [(.google.api.resource_reference) = { ... } - * @return This builder for chaining. - */ - public Builder clearTest() { - - test_ = getDefaultInstance().getTest(); - onChanged(); - return this; - } - /** - *
        -     * The name of the test.
        -     * The tests/* portion of the names are hard-coded, and do not change
        -     * from session to session.
        -     * 
        - * - * string test = 1 [(.google.api.resource_reference) = { ... } - * @param value The bytes for test to set. - * @return This builder for chaining. - */ - public Builder setTestBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - test_ = value; - onChanged(); - return this; - } - - private com.google.showcase.v1beta1.Issue issue_; - private com.google.protobuf.SingleFieldBuilderV3< - com.google.showcase.v1beta1.Issue, com.google.showcase.v1beta1.Issue.Builder, com.google.showcase.v1beta1.IssueOrBuilder> issueBuilder_; - /** - *
        -     * An issue found with the test run. If empty, this test run was successful.
        -     * 
        - * - * .google.showcase.v1beta1.Issue issue = 2; - * @return Whether the issue field is set. - */ - public boolean hasIssue() { - return issueBuilder_ != null || issue_ != null; - } - /** - *
        -     * An issue found with the test run. If empty, this test run was successful.
        -     * 
        - * - * .google.showcase.v1beta1.Issue issue = 2; - * @return The issue. - */ - public com.google.showcase.v1beta1.Issue getIssue() { - if (issueBuilder_ == null) { - return issue_ == null ? com.google.showcase.v1beta1.Issue.getDefaultInstance() : issue_; - } else { - return issueBuilder_.getMessage(); - } - } - /** - *
        -     * An issue found with the test run. If empty, this test run was successful.
        -     * 
        - * - * .google.showcase.v1beta1.Issue issue = 2; - */ - public Builder setIssue(com.google.showcase.v1beta1.Issue value) { - if (issueBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - issue_ = value; - onChanged(); - } else { - issueBuilder_.setMessage(value); - } - - return this; - } - /** - *
        -     * An issue found with the test run. If empty, this test run was successful.
        -     * 
        - * - * .google.showcase.v1beta1.Issue issue = 2; - */ - public Builder setIssue( - com.google.showcase.v1beta1.Issue.Builder builderForValue) { - if (issueBuilder_ == null) { - issue_ = builderForValue.build(); - onChanged(); - } else { - issueBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - *
        -     * An issue found with the test run. If empty, this test run was successful.
        -     * 
        - * - * .google.showcase.v1beta1.Issue issue = 2; - */ - public Builder mergeIssue(com.google.showcase.v1beta1.Issue value) { - if (issueBuilder_ == null) { - if (issue_ != null) { - issue_ = - com.google.showcase.v1beta1.Issue.newBuilder(issue_).mergeFrom(value).buildPartial(); - } else { - issue_ = value; - } - onChanged(); - } else { - issueBuilder_.mergeFrom(value); - } - - return this; - } - /** - *
        -     * An issue found with the test run. If empty, this test run was successful.
        -     * 
        - * - * .google.showcase.v1beta1.Issue issue = 2; - */ - public Builder clearIssue() { - if (issueBuilder_ == null) { - issue_ = null; - onChanged(); - } else { - issue_ = null; - issueBuilder_ = null; - } - - return this; - } - /** - *
        -     * An issue found with the test run. If empty, this test run was successful.
        -     * 
        - * - * .google.showcase.v1beta1.Issue issue = 2; - */ - public com.google.showcase.v1beta1.Issue.Builder getIssueBuilder() { - - onChanged(); - return getIssueFieldBuilder().getBuilder(); - } - /** - *
        -     * An issue found with the test run. If empty, this test run was successful.
        -     * 
        - * - * .google.showcase.v1beta1.Issue issue = 2; - */ - public com.google.showcase.v1beta1.IssueOrBuilder getIssueOrBuilder() { - if (issueBuilder_ != null) { - return issueBuilder_.getMessageOrBuilder(); - } else { - return issue_ == null ? - com.google.showcase.v1beta1.Issue.getDefaultInstance() : issue_; - } - } - /** - *
        -     * An issue found with the test run. If empty, this test run was successful.
        -     * 
        - * - * .google.showcase.v1beta1.Issue issue = 2; - */ - private com.google.protobuf.SingleFieldBuilderV3< - com.google.showcase.v1beta1.Issue, com.google.showcase.v1beta1.Issue.Builder, com.google.showcase.v1beta1.IssueOrBuilder> - getIssueFieldBuilder() { - if (issueBuilder_ == null) { - issueBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - com.google.showcase.v1beta1.Issue, com.google.showcase.v1beta1.Issue.Builder, com.google.showcase.v1beta1.IssueOrBuilder>( - getIssue(), - getParentForChildren(), - isClean()); - issue_ = null; - } - return issueBuilder_; - } - @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.showcase.v1beta1.TestRun) - } - - // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.TestRun) - private static final com.google.showcase.v1beta1.TestRun DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new com.google.showcase.v1beta1.TestRun(); - } - - public static com.google.showcase.v1beta1.TestRun getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public TestRun parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new TestRun(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public com.google.showcase.v1beta1.TestRun getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/TestRunOrBuilder.java b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/TestRunOrBuilder.java deleted file mode 100644 index e562eb82fc..0000000000 --- a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/TestRunOrBuilder.java +++ /dev/null @@ -1,60 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: schema/google/showcase/v1beta1/testing.proto - -package com.google.showcase.v1beta1; - -public interface TestRunOrBuilder extends - // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.TestRun) - com.google.protobuf.MessageOrBuilder { - - /** - *
        -   * The name of the test.
        -   * The tests/* portion of the names are hard-coded, and do not change
        -   * from session to session.
        -   * 
        - * - * string test = 1 [(.google.api.resource_reference) = { ... } - * @return The test. - */ - java.lang.String getTest(); - /** - *
        -   * The name of the test.
        -   * The tests/* portion of the names are hard-coded, and do not change
        -   * from session to session.
        -   * 
        - * - * string test = 1 [(.google.api.resource_reference) = { ... } - * @return The bytes for test. - */ - com.google.protobuf.ByteString - getTestBytes(); - - /** - *
        -   * An issue found with the test run. If empty, this test run was successful.
        -   * 
        - * - * .google.showcase.v1beta1.Issue issue = 2; - * @return Whether the issue field is set. - */ - boolean hasIssue(); - /** - *
        -   * An issue found with the test run. If empty, this test run was successful.
        -   * 
        - * - * .google.showcase.v1beta1.Issue issue = 2; - * @return The issue. - */ - com.google.showcase.v1beta1.Issue getIssue(); - /** - *
        -   * An issue found with the test run. If empty, this test run was successful.
        -   * 
        - * - * .google.showcase.v1beta1.Issue issue = 2; - */ - com.google.showcase.v1beta1.IssueOrBuilder getIssueOrBuilder(); -} diff --git a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/TestingOuterClass.java b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/TestingOuterClass.java deleted file mode 100644 index 1dde804ac5..0000000000 --- a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/TestingOuterClass.java +++ /dev/null @@ -1,345 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: schema/google/showcase/v1beta1/testing.proto - -package com.google.showcase.v1beta1; - -public final class TestingOuterClass { - private TestingOuterClass() {} - 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_showcase_v1beta1_Session_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_showcase_v1beta1_Session_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_showcase_v1beta1_CreateSessionRequest_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_showcase_v1beta1_CreateSessionRequest_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_showcase_v1beta1_GetSessionRequest_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_showcase_v1beta1_GetSessionRequest_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_showcase_v1beta1_ListSessionsRequest_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_showcase_v1beta1_ListSessionsRequest_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_showcase_v1beta1_ListSessionsResponse_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_showcase_v1beta1_ListSessionsResponse_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_showcase_v1beta1_DeleteSessionRequest_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_showcase_v1beta1_DeleteSessionRequest_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_showcase_v1beta1_ReportSessionRequest_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_showcase_v1beta1_ReportSessionRequest_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_showcase_v1beta1_ReportSessionResponse_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_showcase_v1beta1_ReportSessionResponse_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_showcase_v1beta1_Test_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_showcase_v1beta1_Test_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_showcase_v1beta1_Test_Blueprint_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_showcase_v1beta1_Test_Blueprint_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_showcase_v1beta1_Test_Blueprint_Invocation_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_showcase_v1beta1_Test_Blueprint_Invocation_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_showcase_v1beta1_Issue_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_showcase_v1beta1_Issue_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_showcase_v1beta1_ListTestsRequest_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_showcase_v1beta1_ListTestsRequest_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_showcase_v1beta1_ListTestsResponse_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_showcase_v1beta1_ListTestsResponse_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_showcase_v1beta1_TestRun_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_showcase_v1beta1_TestRun_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_showcase_v1beta1_DeleteTestRequest_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_showcase_v1beta1_DeleteTestRequest_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_showcase_v1beta1_VerifyTestRequest_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_showcase_v1beta1_VerifyTestRequest_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_showcase_v1beta1_VerifyTestResponse_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_showcase_v1beta1_VerifyTestResponse_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,schema/google/showcase/v1beta1/testing" + - ".proto\022\027google.showcase.v1beta1\032\034google/" + - "api/annotations.proto\032\027google/api/client" + - ".proto\032\031google/api/resource.proto\032\033googl" + - "e/protobuf/empty.proto\"\311\001\n\007Session\022\014\n\004na" + - "me\030\001 \001(\t\0229\n\007version\030\002 \001(\0162(.google.showc" + - "ase.v1beta1.Session.Version\";\n\007Version\022\027" + - "\n\023VERSION_UNSPECIFIED\020\000\022\r\n\tV1_LATEST\020\001\022\010" + - "\n\004V1_0\020\002:8\352A5\n\037showcase.googleapis.com/S" + - "ession\022\022sessions/{session}\"I\n\024CreateSess" + - "ionRequest\0221\n\007session\030\001 \001(\0132 .google.sho" + - "wcase.v1beta1.Session\"G\n\021GetSessionReque" + - "st\0222\n\004name\030\001 \001(\tB$\372A!\n\037showcase.googleap" + - "is.com/Session\"<\n\023ListSessionsRequest\022\021\n" + - "\tpage_size\030\001 \001(\005\022\022\n\npage_token\030\002 \001(\t\"c\n\024" + - "ListSessionsResponse\0222\n\010sessions\030\001 \003(\0132 " + - ".google.showcase.v1beta1.Session\022\027\n\017next" + - "_page_token\030\002 \001(\t\"J\n\024DeleteSessionReques" + - "t\0222\n\004name\030\001 \001(\tB$\372A!\n\037showcase.googleapi" + - "s.com/Session\"J\n\024ReportSessionRequest\0222\n" + - "\004name\030\001 \001(\tB$\372A!\n\037showcase.googleapis.co" + - "m/Session\"\335\001\n\025ReportSessionResponse\022E\n\006r" + - "esult\030\001 \001(\01625.google.showcase.v1beta1.Re" + - "portSessionResponse.Result\0223\n\ttest_runs\030" + - "\002 \003(\0132 .google.showcase.v1beta1.TestRun\"" + - "H\n\006Result\022\026\n\022RESULT_UNSPECIFIED\020\000\022\n\n\006PAS" + - "SED\020\001\022\n\n\006FAILED\020\002\022\016\n\nINCOMPLETE\020\003\"\272\005\n\004Te" + - "st\022\014\n\004name\030\001 \001(\t\022I\n\021expectation_level\030\002 " + - "\001(\0162..google.showcase.v1beta1.Test.Expec" + - "tationLevel\022\023\n\013description\030\003 \001(\t\022;\n\nblue" + - "prints\030\004 \003(\0132\'.google.showcase.v1beta1.T" + - "est.Blueprint\032\336\002\n\tBlueprint\022\014\n\004name\030\001 \001(" + - "\t\022\023\n\013description\030\002 \001(\t\022C\n\007request\030\003 \001(\0132" + - "2.google.showcase.v1beta1.Test.Blueprint" + - ".Invocation\022O\n\023additional_requests\030\004 \003(\013" + - "22.google.showcase.v1beta1.Test.Blueprin" + - "t.Invocation\0328\n\nInvocation\022\016\n\006method\030\001 \001" + - "(\t\022\032\n\022serialized_request\030\002 \001(\014:^\352A[\n!sho" + - "wcase.googleapis.com/Blueprint\0226sessions" + - "/{session}/tests/{test}/blueprints/{blue" + - "print}\"b\n\020ExpectationLevel\022!\n\035EXPECTATIO" + - "N_LEVEL_UNSPECIFIED\020\000\022\014\n\010REQUIRED\020\001\022\017\n\013R" + - "ECOMMENDED\020\002\022\014\n\010OPTIONAL\020\003:B\352A?\n\034showcas" + - "e.googleapis.com/Test\022\037sessions/{session" + - "}/tests/{test}\"\234\002\n\005Issue\0221\n\004type\030\001 \001(\0162#" + - ".google.showcase.v1beta1.Issue.Type\0229\n\010s" + - "everity\030\002 \001(\0162\'.google.showcase.v1beta1." + - "Issue.Severity\022\023\n\013description\030\003 \001(\t\"R\n\004T" + - "ype\022\024\n\020TYPE_UNSPECIFIED\020\000\022\013\n\007SKIPPED\020\001\022\013" + - "\n\007PENDING\020\002\022\032\n\026INCORRECT_CONFIRMATION\020\003\"" + - "<\n\010Severity\022\030\n\024SEVERITY_UNSPECIFIED\020\000\022\t\n" + - "\005ERROR\020\001\022\013\n\007WARNING\020\002\"o\n\020ListTestsReques" + - "t\0224\n\006parent\030\001 \001(\tB$\372A!\n\037showcase.googlea" + - "pis.com/Session\022\021\n\tpage_size\030\002 \001(\005\022\022\n\npa" + - "ge_token\030\003 \001(\t\"Z\n\021ListTestsResponse\022,\n\005t" + - "ests\030\001 \003(\0132\035.google.showcase.v1beta1.Tes" + - "t\022\027\n\017next_page_token\030\002 \001(\t\"i\n\007TestRun\022/\n" + - "\004test\030\001 \001(\tB!\372A\036\n\034showcase.googleapis.co" + - "m/Test\022-\n\005issue\030\002 \001(\0132\036.google.showcase." + - "v1beta1.Issue\"D\n\021DeleteTestRequest\022/\n\004na" + - "me\030\001 \001(\tB!\372A\036\n\034showcase.googleapis.com/T" + - "est\"e\n\021VerifyTestRequest\022/\n\004name\030\001 \001(\tB!" + - "\372A\036\n\034showcase.googleapis.com/Test\022\016\n\006ans" + - "wer\030\002 \001(\014\022\017\n\007answers\030\003 \003(\014\"C\n\022VerifyTest" + - "Response\022-\n\005issue\030\001 \001(\0132\036.google.showcas" + - "e.v1beta1.Issue2\355\010\n\007Testing\022\204\001\n\rCreateSe" + - "ssion\022-.google.showcase.v1beta1.CreateSe" + - "ssionRequest\032 .google.showcase.v1beta1.S" + - "ession\"\"\202\323\344\223\002\034\"\021/v1beta1/sessions:\007sessi" + - "on\022~\n\nGetSession\022*.google.showcase.v1bet" + - "a1.GetSessionRequest\032 .google.showcase.v" + - "1beta1.Session\"\"\202\323\344\223\002\034\022\032/v1beta1/{name=s" + - "essions/*}\022\206\001\n\014ListSessions\022,.google.sho" + - "wcase.v1beta1.ListSessionsRequest\032-.goog" + - "le.showcase.v1beta1.ListSessionsResponse" + - "\"\031\202\323\344\223\002\023\022\021/v1beta1/sessions\022z\n\rDeleteSes" + - "sion\022-.google.showcase.v1beta1.DeleteSes" + - "sionRequest\032\026.google.protobuf.Empty\"\"\202\323\344" + - "\223\002\034*\032/v1beta1/{name=sessions/*}\022\231\001\n\rRepo" + - "rtSession\022-.google.showcase.v1beta1.Repo" + - "rtSessionRequest\032..google.showcase.v1bet" + - "a1.ReportSessionResponse\")\202\323\344\223\002#\"!/v1bet" + - "a1/{name=sessions/*}:report\022\216\001\n\tListTest" + - "s\022).google.showcase.v1beta1.ListTestsReq" + - "uest\032*.google.showcase.v1beta1.ListTests" + - "Response\"*\202\323\344\223\002$\022\"/v1beta1/{parent=sessi" + - "ons/*}/tests\022|\n\nDeleteTest\022*.google.show" + - "case.v1beta1.DeleteTestRequest\032\026.google." + - "protobuf.Empty\"*\202\323\344\223\002$*\"/v1beta1/{name=s" + - "essions/*/tests/*}\022\227\001\n\nVerifyTest\022*.goog" + - "le.showcase.v1beta1.VerifyTestRequest\032+." + - "google.showcase.v1beta1.VerifyTestRespon" + - "se\"0\202\323\344\223\002*\"(/v1beta1/{name=sessions/*/te" + - "sts/*}:check\032\021\312A\016localhost:7469Bq\n\033com.g" + - "oogle.showcase.v1beta1P\001Z4github.com/goo" + - "gleapis/gapic-showcase/server/genproto\352\002" + - "\031Google::Showcase::V1beta1b\006proto3" - }; - descriptor = com.google.protobuf.Descriptors.FileDescriptor - .internalBuildGeneratedFileFrom(descriptorData, - new com.google.protobuf.Descriptors.FileDescriptor[] { - com.google.api.AnnotationsProto.getDescriptor(), - com.google.api.ClientProto.getDescriptor(), - com.google.api.ResourceProto.getDescriptor(), - com.google.protobuf.EmptyProto.getDescriptor(), - }); - internal_static_google_showcase_v1beta1_Session_descriptor = - getDescriptor().getMessageTypes().get(0); - internal_static_google_showcase_v1beta1_Session_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_google_showcase_v1beta1_Session_descriptor, - new java.lang.String[] { "Name", "Version", }); - internal_static_google_showcase_v1beta1_CreateSessionRequest_descriptor = - getDescriptor().getMessageTypes().get(1); - internal_static_google_showcase_v1beta1_CreateSessionRequest_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_google_showcase_v1beta1_CreateSessionRequest_descriptor, - new java.lang.String[] { "Session", }); - internal_static_google_showcase_v1beta1_GetSessionRequest_descriptor = - getDescriptor().getMessageTypes().get(2); - internal_static_google_showcase_v1beta1_GetSessionRequest_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_google_showcase_v1beta1_GetSessionRequest_descriptor, - new java.lang.String[] { "Name", }); - internal_static_google_showcase_v1beta1_ListSessionsRequest_descriptor = - getDescriptor().getMessageTypes().get(3); - internal_static_google_showcase_v1beta1_ListSessionsRequest_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_google_showcase_v1beta1_ListSessionsRequest_descriptor, - new java.lang.String[] { "PageSize", "PageToken", }); - internal_static_google_showcase_v1beta1_ListSessionsResponse_descriptor = - getDescriptor().getMessageTypes().get(4); - internal_static_google_showcase_v1beta1_ListSessionsResponse_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_google_showcase_v1beta1_ListSessionsResponse_descriptor, - new java.lang.String[] { "Sessions", "NextPageToken", }); - internal_static_google_showcase_v1beta1_DeleteSessionRequest_descriptor = - getDescriptor().getMessageTypes().get(5); - internal_static_google_showcase_v1beta1_DeleteSessionRequest_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_google_showcase_v1beta1_DeleteSessionRequest_descriptor, - new java.lang.String[] { "Name", }); - internal_static_google_showcase_v1beta1_ReportSessionRequest_descriptor = - getDescriptor().getMessageTypes().get(6); - internal_static_google_showcase_v1beta1_ReportSessionRequest_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_google_showcase_v1beta1_ReportSessionRequest_descriptor, - new java.lang.String[] { "Name", }); - internal_static_google_showcase_v1beta1_ReportSessionResponse_descriptor = - getDescriptor().getMessageTypes().get(7); - internal_static_google_showcase_v1beta1_ReportSessionResponse_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_google_showcase_v1beta1_ReportSessionResponse_descriptor, - new java.lang.String[] { "Result", "TestRuns", }); - internal_static_google_showcase_v1beta1_Test_descriptor = - getDescriptor().getMessageTypes().get(8); - internal_static_google_showcase_v1beta1_Test_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_google_showcase_v1beta1_Test_descriptor, - new java.lang.String[] { "Name", "ExpectationLevel", "Description", "Blueprints", }); - internal_static_google_showcase_v1beta1_Test_Blueprint_descriptor = - internal_static_google_showcase_v1beta1_Test_descriptor.getNestedTypes().get(0); - internal_static_google_showcase_v1beta1_Test_Blueprint_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_google_showcase_v1beta1_Test_Blueprint_descriptor, - new java.lang.String[] { "Name", "Description", "Request", "AdditionalRequests", }); - internal_static_google_showcase_v1beta1_Test_Blueprint_Invocation_descriptor = - internal_static_google_showcase_v1beta1_Test_Blueprint_descriptor.getNestedTypes().get(0); - internal_static_google_showcase_v1beta1_Test_Blueprint_Invocation_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_google_showcase_v1beta1_Test_Blueprint_Invocation_descriptor, - new java.lang.String[] { "Method", "SerializedRequest", }); - internal_static_google_showcase_v1beta1_Issue_descriptor = - getDescriptor().getMessageTypes().get(9); - internal_static_google_showcase_v1beta1_Issue_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_google_showcase_v1beta1_Issue_descriptor, - new java.lang.String[] { "Type", "Severity", "Description", }); - internal_static_google_showcase_v1beta1_ListTestsRequest_descriptor = - getDescriptor().getMessageTypes().get(10); - internal_static_google_showcase_v1beta1_ListTestsRequest_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_google_showcase_v1beta1_ListTestsRequest_descriptor, - new java.lang.String[] { "Parent", "PageSize", "PageToken", }); - internal_static_google_showcase_v1beta1_ListTestsResponse_descriptor = - getDescriptor().getMessageTypes().get(11); - internal_static_google_showcase_v1beta1_ListTestsResponse_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_google_showcase_v1beta1_ListTestsResponse_descriptor, - new java.lang.String[] { "Tests", "NextPageToken", }); - internal_static_google_showcase_v1beta1_TestRun_descriptor = - getDescriptor().getMessageTypes().get(12); - internal_static_google_showcase_v1beta1_TestRun_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_google_showcase_v1beta1_TestRun_descriptor, - new java.lang.String[] { "Test", "Issue", }); - internal_static_google_showcase_v1beta1_DeleteTestRequest_descriptor = - getDescriptor().getMessageTypes().get(13); - internal_static_google_showcase_v1beta1_DeleteTestRequest_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_google_showcase_v1beta1_DeleteTestRequest_descriptor, - new java.lang.String[] { "Name", }); - internal_static_google_showcase_v1beta1_VerifyTestRequest_descriptor = - getDescriptor().getMessageTypes().get(14); - internal_static_google_showcase_v1beta1_VerifyTestRequest_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_google_showcase_v1beta1_VerifyTestRequest_descriptor, - new java.lang.String[] { "Name", "Answer", "Answers", }); - internal_static_google_showcase_v1beta1_VerifyTestResponse_descriptor = - getDescriptor().getMessageTypes().get(15); - internal_static_google_showcase_v1beta1_VerifyTestResponse_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_google_showcase_v1beta1_VerifyTestResponse_descriptor, - new java.lang.String[] { "Issue", }); - com.google.protobuf.ExtensionRegistry registry = - com.google.protobuf.ExtensionRegistry.newInstance(); - registry.add(com.google.api.ClientProto.defaultHost); - registry.add(com.google.api.AnnotationsProto.http); - registry.add(com.google.api.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.ResourceProto.getDescriptor(); - com.google.protobuf.EmptyProto.getDescriptor(); - } - - // @@protoc_insertion_point(outer_class_scope) -} diff --git a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/UpdateBlurbRequest.java b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/UpdateBlurbRequest.java deleted file mode 100644 index 3a0e37969d..0000000000 --- a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/UpdateBlurbRequest.java +++ /dev/null @@ -1,915 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: schema/google/showcase/v1beta1/messaging.proto - -package com.google.showcase.v1beta1; - -/** - *
        - * The request message for the google.showcase.v1beta1.Messaging\UpdateBlurb
        - * method.
        - * 
        - * - * Protobuf type {@code google.showcase.v1beta1.UpdateBlurbRequest} - */ -public final class UpdateBlurbRequest extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.UpdateBlurbRequest) - UpdateBlurbRequestOrBuilder { -private static final long serialVersionUID = 0L; - // Use UpdateBlurbRequest.newBuilder() to construct. - private UpdateBlurbRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private UpdateBlurbRequest() { - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new UpdateBlurbRequest(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private UpdateBlurbRequest( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: { - com.google.showcase.v1beta1.Blurb.Builder subBuilder = null; - if (blurb_ != null) { - subBuilder = blurb_.toBuilder(); - } - blurb_ = input.readMessage(com.google.showcase.v1beta1.Blurb.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(blurb_); - blurb_ = subBuilder.buildPartial(); - } - - break; - } - case 18: { - com.google.protobuf.FieldMask.Builder subBuilder = null; - if (updateMask_ != null) { - subBuilder = updateMask_.toBuilder(); - } - updateMask_ = input.readMessage(com.google.protobuf.FieldMask.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(updateMask_); - updateMask_ = subBuilder.buildPartial(); - } - - break; - } - default: { - if (!parseUnknownField( - input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException( - e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.google.showcase.v1beta1.MessagingOuterClass.internal_static_google_showcase_v1beta1_UpdateBlurbRequest_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.showcase.v1beta1.MessagingOuterClass.internal_static_google_showcase_v1beta1_UpdateBlurbRequest_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.showcase.v1beta1.UpdateBlurbRequest.class, com.google.showcase.v1beta1.UpdateBlurbRequest.Builder.class); - } - - public static final int BLURB_FIELD_NUMBER = 1; - private com.google.showcase.v1beta1.Blurb blurb_; - /** - *
        -   * The blurb to update.
        -   * 
        - * - * .google.showcase.v1beta1.Blurb blurb = 1; - * @return Whether the blurb field is set. - */ - @java.lang.Override - public boolean hasBlurb() { - return blurb_ != null; - } - /** - *
        -   * The blurb to update.
        -   * 
        - * - * .google.showcase.v1beta1.Blurb blurb = 1; - * @return The blurb. - */ - @java.lang.Override - public com.google.showcase.v1beta1.Blurb getBlurb() { - return blurb_ == null ? com.google.showcase.v1beta1.Blurb.getDefaultInstance() : blurb_; - } - /** - *
        -   * The blurb to update.
        -   * 
        - * - * .google.showcase.v1beta1.Blurb blurb = 1; - */ - @java.lang.Override - public com.google.showcase.v1beta1.BlurbOrBuilder getBlurbOrBuilder() { - return getBlurb(); - } - - public static final int UPDATE_MASK_FIELD_NUMBER = 2; - private com.google.protobuf.FieldMask updateMask_; - /** - *
        -   * The field mask to determine wich fields are to be updated. If empty, the
        -   * server will assume all fields are to be updated.
        -   * 
        - * - * .google.protobuf.FieldMask update_mask = 2; - * @return Whether the updateMask field is set. - */ - @java.lang.Override - public boolean hasUpdateMask() { - return updateMask_ != null; - } - /** - *
        -   * The field mask to determine wich fields are to be updated. If empty, the
        -   * server will assume all fields are to be updated.
        -   * 
        - * - * .google.protobuf.FieldMask update_mask = 2; - * @return The updateMask. - */ - @java.lang.Override - public com.google.protobuf.FieldMask getUpdateMask() { - return updateMask_ == null ? com.google.protobuf.FieldMask.getDefaultInstance() : updateMask_; - } - /** - *
        -   * The field mask to determine wich fields are to be updated. If empty, the
        -   * server will assume all fields are to be updated.
        -   * 
        - * - * .google.protobuf.FieldMask update_mask = 2; - */ - @java.lang.Override - public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { - return getUpdateMask(); - } - - private byte memoizedIsInitialized = -1; - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - if (blurb_ != null) { - output.writeMessage(1, getBlurb()); - } - if (updateMask_ != null) { - output.writeMessage(2, getUpdateMask()); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (blurb_ != null) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(1, getBlurb()); - } - if (updateMask_ != null) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(2, getUpdateMask()); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof com.google.showcase.v1beta1.UpdateBlurbRequest)) { - return super.equals(obj); - } - com.google.showcase.v1beta1.UpdateBlurbRequest other = (com.google.showcase.v1beta1.UpdateBlurbRequest) obj; - - if (hasBlurb() != other.hasBlurb()) return false; - if (hasBlurb()) { - if (!getBlurb() - .equals(other.getBlurb())) return false; - } - if (hasUpdateMask() != other.hasUpdateMask()) return false; - if (hasUpdateMask()) { - if (!getUpdateMask() - .equals(other.getUpdateMask())) return false; - } - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - if (hasBlurb()) { - hash = (37 * hash) + BLURB_FIELD_NUMBER; - hash = (53 * hash) + getBlurb().hashCode(); - } - if (hasUpdateMask()) { - hash = (37 * hash) + UPDATE_MASK_FIELD_NUMBER; - hash = (53 * hash) + getUpdateMask().hashCode(); - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.showcase.v1beta1.UpdateBlurbRequest parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.showcase.v1beta1.UpdateBlurbRequest parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.showcase.v1beta1.UpdateBlurbRequest parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.showcase.v1beta1.UpdateBlurbRequest 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.showcase.v1beta1.UpdateBlurbRequest parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.showcase.v1beta1.UpdateBlurbRequest parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.showcase.v1beta1.UpdateBlurbRequest parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static com.google.showcase.v1beta1.UpdateBlurbRequest 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.showcase.v1beta1.UpdateBlurbRequest parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static com.google.showcase.v1beta1.UpdateBlurbRequest 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.showcase.v1beta1.UpdateBlurbRequest parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static com.google.showcase.v1beta1.UpdateBlurbRequest 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.showcase.v1beta1.UpdateBlurbRequest 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 request message for the google.showcase.v1beta1.Messaging\UpdateBlurb
        -   * method.
        -   * 
        - * - * Protobuf type {@code google.showcase.v1beta1.UpdateBlurbRequest} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.UpdateBlurbRequest) - com.google.showcase.v1beta1.UpdateBlurbRequestOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.google.showcase.v1beta1.MessagingOuterClass.internal_static_google_showcase_v1beta1_UpdateBlurbRequest_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.showcase.v1beta1.MessagingOuterClass.internal_static_google_showcase_v1beta1_UpdateBlurbRequest_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.showcase.v1beta1.UpdateBlurbRequest.class, com.google.showcase.v1beta1.UpdateBlurbRequest.Builder.class); - } - - // Construct using com.google.showcase.v1beta1.UpdateBlurbRequest.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { - } - } - @java.lang.Override - public Builder clear() { - super.clear(); - if (blurbBuilder_ == null) { - blurb_ = null; - } else { - blurb_ = null; - blurbBuilder_ = null; - } - if (updateMaskBuilder_ == null) { - updateMask_ = null; - } else { - updateMask_ = null; - updateMaskBuilder_ = null; - } - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return com.google.showcase.v1beta1.MessagingOuterClass.internal_static_google_showcase_v1beta1_UpdateBlurbRequest_descriptor; - } - - @java.lang.Override - public com.google.showcase.v1beta1.UpdateBlurbRequest getDefaultInstanceForType() { - return com.google.showcase.v1beta1.UpdateBlurbRequest.getDefaultInstance(); - } - - @java.lang.Override - public com.google.showcase.v1beta1.UpdateBlurbRequest build() { - com.google.showcase.v1beta1.UpdateBlurbRequest result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.showcase.v1beta1.UpdateBlurbRequest buildPartial() { - com.google.showcase.v1beta1.UpdateBlurbRequest result = new com.google.showcase.v1beta1.UpdateBlurbRequest(this); - if (blurbBuilder_ == null) { - result.blurb_ = blurb_; - } else { - result.blurb_ = blurbBuilder_.build(); - } - if (updateMaskBuilder_ == null) { - result.updateMask_ = updateMask_; - } else { - result.updateMask_ = updateMaskBuilder_.build(); - } - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.setField(field, value); - } - @java.lang.Override - public Builder clearField( - com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - @java.lang.Override - public Builder clearOneof( - com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.addRepeatedField(field, value); - } - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof com.google.showcase.v1beta1.UpdateBlurbRequest) { - return mergeFrom((com.google.showcase.v1beta1.UpdateBlurbRequest)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.showcase.v1beta1.UpdateBlurbRequest other) { - if (other == com.google.showcase.v1beta1.UpdateBlurbRequest.getDefaultInstance()) return this; - if (other.hasBlurb()) { - mergeBlurb(other.getBlurb()); - } - if (other.hasUpdateMask()) { - mergeUpdateMask(other.getUpdateMask()); - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - com.google.showcase.v1beta1.UpdateBlurbRequest parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (com.google.showcase.v1beta1.UpdateBlurbRequest) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private com.google.showcase.v1beta1.Blurb blurb_; - private com.google.protobuf.SingleFieldBuilderV3< - com.google.showcase.v1beta1.Blurb, com.google.showcase.v1beta1.Blurb.Builder, com.google.showcase.v1beta1.BlurbOrBuilder> blurbBuilder_; - /** - *
        -     * The blurb to update.
        -     * 
        - * - * .google.showcase.v1beta1.Blurb blurb = 1; - * @return Whether the blurb field is set. - */ - public boolean hasBlurb() { - return blurbBuilder_ != null || blurb_ != null; - } - /** - *
        -     * The blurb to update.
        -     * 
        - * - * .google.showcase.v1beta1.Blurb blurb = 1; - * @return The blurb. - */ - public com.google.showcase.v1beta1.Blurb getBlurb() { - if (blurbBuilder_ == null) { - return blurb_ == null ? com.google.showcase.v1beta1.Blurb.getDefaultInstance() : blurb_; - } else { - return blurbBuilder_.getMessage(); - } - } - /** - *
        -     * The blurb to update.
        -     * 
        - * - * .google.showcase.v1beta1.Blurb blurb = 1; - */ - public Builder setBlurb(com.google.showcase.v1beta1.Blurb value) { - if (blurbBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - blurb_ = value; - onChanged(); - } else { - blurbBuilder_.setMessage(value); - } - - return this; - } - /** - *
        -     * The blurb to update.
        -     * 
        - * - * .google.showcase.v1beta1.Blurb blurb = 1; - */ - public Builder setBlurb( - com.google.showcase.v1beta1.Blurb.Builder builderForValue) { - if (blurbBuilder_ == null) { - blurb_ = builderForValue.build(); - onChanged(); - } else { - blurbBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - *
        -     * The blurb to update.
        -     * 
        - * - * .google.showcase.v1beta1.Blurb blurb = 1; - */ - public Builder mergeBlurb(com.google.showcase.v1beta1.Blurb value) { - if (blurbBuilder_ == null) { - if (blurb_ != null) { - blurb_ = - com.google.showcase.v1beta1.Blurb.newBuilder(blurb_).mergeFrom(value).buildPartial(); - } else { - blurb_ = value; - } - onChanged(); - } else { - blurbBuilder_.mergeFrom(value); - } - - return this; - } - /** - *
        -     * The blurb to update.
        -     * 
        - * - * .google.showcase.v1beta1.Blurb blurb = 1; - */ - public Builder clearBlurb() { - if (blurbBuilder_ == null) { - blurb_ = null; - onChanged(); - } else { - blurb_ = null; - blurbBuilder_ = null; - } - - return this; - } - /** - *
        -     * The blurb to update.
        -     * 
        - * - * .google.showcase.v1beta1.Blurb blurb = 1; - */ - public com.google.showcase.v1beta1.Blurb.Builder getBlurbBuilder() { - - onChanged(); - return getBlurbFieldBuilder().getBuilder(); - } - /** - *
        -     * The blurb to update.
        -     * 
        - * - * .google.showcase.v1beta1.Blurb blurb = 1; - */ - public com.google.showcase.v1beta1.BlurbOrBuilder getBlurbOrBuilder() { - if (blurbBuilder_ != null) { - return blurbBuilder_.getMessageOrBuilder(); - } else { - return blurb_ == null ? - com.google.showcase.v1beta1.Blurb.getDefaultInstance() : blurb_; - } - } - /** - *
        -     * The blurb to update.
        -     * 
        - * - * .google.showcase.v1beta1.Blurb blurb = 1; - */ - private com.google.protobuf.SingleFieldBuilderV3< - com.google.showcase.v1beta1.Blurb, com.google.showcase.v1beta1.Blurb.Builder, com.google.showcase.v1beta1.BlurbOrBuilder> - getBlurbFieldBuilder() { - if (blurbBuilder_ == null) { - blurbBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - com.google.showcase.v1beta1.Blurb, com.google.showcase.v1beta1.Blurb.Builder, com.google.showcase.v1beta1.BlurbOrBuilder>( - getBlurb(), - getParentForChildren(), - isClean()); - blurb_ = null; - } - return blurbBuilder_; - } - - private com.google.protobuf.FieldMask updateMask_; - private com.google.protobuf.SingleFieldBuilderV3< - com.google.protobuf.FieldMask, com.google.protobuf.FieldMask.Builder, com.google.protobuf.FieldMaskOrBuilder> updateMaskBuilder_; - /** - *
        -     * The field mask to determine wich fields are to be updated. If empty, the
        -     * server will assume all fields are to be updated.
        -     * 
        - * - * .google.protobuf.FieldMask update_mask = 2; - * @return Whether the updateMask field is set. - */ - public boolean hasUpdateMask() { - return updateMaskBuilder_ != null || updateMask_ != null; - } - /** - *
        -     * The field mask to determine wich fields are to be updated. If empty, the
        -     * server will assume all fields are to be updated.
        -     * 
        - * - * .google.protobuf.FieldMask update_mask = 2; - * @return The updateMask. - */ - public com.google.protobuf.FieldMask getUpdateMask() { - if (updateMaskBuilder_ == null) { - return updateMask_ == null ? com.google.protobuf.FieldMask.getDefaultInstance() : updateMask_; - } else { - return updateMaskBuilder_.getMessage(); - } - } - /** - *
        -     * The field mask to determine wich fields are to be updated. If empty, the
        -     * server will assume all fields are to be updated.
        -     * 
        - * - * .google.protobuf.FieldMask update_mask = 2; - */ - public Builder setUpdateMask(com.google.protobuf.FieldMask value) { - if (updateMaskBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - updateMask_ = value; - onChanged(); - } else { - updateMaskBuilder_.setMessage(value); - } - - return this; - } - /** - *
        -     * The field mask to determine wich fields are to be updated. If empty, the
        -     * server will assume all fields are to be updated.
        -     * 
        - * - * .google.protobuf.FieldMask update_mask = 2; - */ - public Builder setUpdateMask( - com.google.protobuf.FieldMask.Builder builderForValue) { - if (updateMaskBuilder_ == null) { - updateMask_ = builderForValue.build(); - onChanged(); - } else { - updateMaskBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - *
        -     * The field mask to determine wich fields are to be updated. If empty, the
        -     * server will assume all fields are to be updated.
        -     * 
        - * - * .google.protobuf.FieldMask update_mask = 2; - */ - public Builder mergeUpdateMask(com.google.protobuf.FieldMask value) { - if (updateMaskBuilder_ == null) { - if (updateMask_ != null) { - updateMask_ = - com.google.protobuf.FieldMask.newBuilder(updateMask_).mergeFrom(value).buildPartial(); - } else { - updateMask_ = value; - } - onChanged(); - } else { - updateMaskBuilder_.mergeFrom(value); - } - - return this; - } - /** - *
        -     * The field mask to determine wich fields are to be updated. If empty, the
        -     * server will assume all fields are to be updated.
        -     * 
        - * - * .google.protobuf.FieldMask update_mask = 2; - */ - public Builder clearUpdateMask() { - if (updateMaskBuilder_ == null) { - updateMask_ = null; - onChanged(); - } else { - updateMask_ = null; - updateMaskBuilder_ = null; - } - - return this; - } - /** - *
        -     * The field mask to determine wich fields are to be updated. If empty, the
        -     * server will assume all fields are to be updated.
        -     * 
        - * - * .google.protobuf.FieldMask update_mask = 2; - */ - public com.google.protobuf.FieldMask.Builder getUpdateMaskBuilder() { - - onChanged(); - return getUpdateMaskFieldBuilder().getBuilder(); - } - /** - *
        -     * The field mask to determine wich fields are to be updated. If empty, the
        -     * server will assume all fields are to be updated.
        -     * 
        - * - * .google.protobuf.FieldMask update_mask = 2; - */ - public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { - if (updateMaskBuilder_ != null) { - return updateMaskBuilder_.getMessageOrBuilder(); - } else { - return updateMask_ == null ? - com.google.protobuf.FieldMask.getDefaultInstance() : updateMask_; - } - } - /** - *
        -     * The field mask to determine wich fields are to be updated. If empty, the
        -     * server will assume all fields are to be updated.
        -     * 
        - * - * .google.protobuf.FieldMask update_mask = 2; - */ - private com.google.protobuf.SingleFieldBuilderV3< - com.google.protobuf.FieldMask, com.google.protobuf.FieldMask.Builder, com.google.protobuf.FieldMaskOrBuilder> - getUpdateMaskFieldBuilder() { - if (updateMaskBuilder_ == null) { - updateMaskBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - com.google.protobuf.FieldMask, com.google.protobuf.FieldMask.Builder, com.google.protobuf.FieldMaskOrBuilder>( - getUpdateMask(), - getParentForChildren(), - isClean()); - updateMask_ = null; - } - return updateMaskBuilder_; - } - @java.lang.Override - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - - // @@protoc_insertion_point(builder_scope:google.showcase.v1beta1.UpdateBlurbRequest) - } - - // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.UpdateBlurbRequest) - private static final com.google.showcase.v1beta1.UpdateBlurbRequest DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new com.google.showcase.v1beta1.UpdateBlurbRequest(); - } - - public static com.google.showcase.v1beta1.UpdateBlurbRequest getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public UpdateBlurbRequest parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new UpdateBlurbRequest(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public com.google.showcase.v1beta1.UpdateBlurbRequest getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/UpdateBlurbRequestOrBuilder.java b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/UpdateBlurbRequestOrBuilder.java deleted file mode 100644 index 73cd144983..0000000000 --- a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/UpdateBlurbRequestOrBuilder.java +++ /dev/null @@ -1,66 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: schema/google/showcase/v1beta1/messaging.proto - -package com.google.showcase.v1beta1; - -public interface UpdateBlurbRequestOrBuilder extends - // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.UpdateBlurbRequest) - com.google.protobuf.MessageOrBuilder { - - /** - *
        -   * The blurb to update.
        -   * 
        - * - * .google.showcase.v1beta1.Blurb blurb = 1; - * @return Whether the blurb field is set. - */ - boolean hasBlurb(); - /** - *
        -   * The blurb to update.
        -   * 
        - * - * .google.showcase.v1beta1.Blurb blurb = 1; - * @return The blurb. - */ - com.google.showcase.v1beta1.Blurb getBlurb(); - /** - *
        -   * The blurb to update.
        -   * 
        - * - * .google.showcase.v1beta1.Blurb blurb = 1; - */ - com.google.showcase.v1beta1.BlurbOrBuilder getBlurbOrBuilder(); - - /** - *
        -   * The field mask to determine wich fields are to be updated. If empty, the
        -   * server will assume all fields are to be updated.
        -   * 
        - * - * .google.protobuf.FieldMask update_mask = 2; - * @return Whether the updateMask field is set. - */ - boolean hasUpdateMask(); - /** - *
        -   * The field mask to determine wich fields are to be updated. If empty, the
        -   * server will assume all fields are to be updated.
        -   * 
        - * - * .google.protobuf.FieldMask update_mask = 2; - * @return The updateMask. - */ - com.google.protobuf.FieldMask getUpdateMask(); - /** - *
        -   * The field mask to determine wich fields are to be updated. If empty, the
        -   * server will assume all fields are to be updated.
        -   * 
        - * - * .google.protobuf.FieldMask update_mask = 2; - */ - com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder(); -} diff --git a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/UpdateRoomRequest.java b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/UpdateRoomRequest.java deleted file mode 100644 index d3defe92cd..0000000000 --- a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/UpdateRoomRequest.java +++ /dev/null @@ -1,915 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: schema/google/showcase/v1beta1/messaging.proto - -package com.google.showcase.v1beta1; - -/** - *
        - * The request message for the google.showcase.v1beta1.Messaging\UpdateRoom
        - * method.
        - * 
        - * - * Protobuf type {@code google.showcase.v1beta1.UpdateRoomRequest} - */ -public final class UpdateRoomRequest extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.UpdateRoomRequest) - UpdateRoomRequestOrBuilder { -private static final long serialVersionUID = 0L; - // Use UpdateRoomRequest.newBuilder() to construct. - private UpdateRoomRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private UpdateRoomRequest() { - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new UpdateRoomRequest(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private UpdateRoomRequest( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: { - com.google.showcase.v1beta1.Room.Builder subBuilder = null; - if (room_ != null) { - subBuilder = room_.toBuilder(); - } - room_ = input.readMessage(com.google.showcase.v1beta1.Room.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(room_); - room_ = subBuilder.buildPartial(); - } - - break; - } - case 18: { - com.google.protobuf.FieldMask.Builder subBuilder = null; - if (updateMask_ != null) { - subBuilder = updateMask_.toBuilder(); - } - updateMask_ = input.readMessage(com.google.protobuf.FieldMask.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(updateMask_); - updateMask_ = subBuilder.buildPartial(); - } - - break; - } - default: { - if (!parseUnknownField( - input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException( - e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.google.showcase.v1beta1.MessagingOuterClass.internal_static_google_showcase_v1beta1_UpdateRoomRequest_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.showcase.v1beta1.MessagingOuterClass.internal_static_google_showcase_v1beta1_UpdateRoomRequest_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.showcase.v1beta1.UpdateRoomRequest.class, com.google.showcase.v1beta1.UpdateRoomRequest.Builder.class); - } - - public static final int ROOM_FIELD_NUMBER = 1; - private com.google.showcase.v1beta1.Room room_; - /** - *
        -   * The room to update.
        -   * 
        - * - * .google.showcase.v1beta1.Room room = 1; - * @return Whether the room field is set. - */ - @java.lang.Override - public boolean hasRoom() { - return room_ != null; - } - /** - *
        -   * The room to update.
        -   * 
        - * - * .google.showcase.v1beta1.Room room = 1; - * @return The room. - */ - @java.lang.Override - public com.google.showcase.v1beta1.Room getRoom() { - return room_ == null ? com.google.showcase.v1beta1.Room.getDefaultInstance() : room_; - } - /** - *
        -   * The room to update.
        -   * 
        - * - * .google.showcase.v1beta1.Room room = 1; - */ - @java.lang.Override - public com.google.showcase.v1beta1.RoomOrBuilder getRoomOrBuilder() { - return getRoom(); - } - - public static final int UPDATE_MASK_FIELD_NUMBER = 2; - private com.google.protobuf.FieldMask updateMask_; - /** - *
        -   * The field mask to determine which fields are to be updated. If empty, the
        -   * server will assume all fields are to be updated.
        -   * 
        - * - * .google.protobuf.FieldMask update_mask = 2; - * @return Whether the updateMask field is set. - */ - @java.lang.Override - public boolean hasUpdateMask() { - return updateMask_ != null; - } - /** - *
        -   * The field mask to determine which fields are to be updated. If empty, the
        -   * server will assume all fields are to be updated.
        -   * 
        - * - * .google.protobuf.FieldMask update_mask = 2; - * @return The updateMask. - */ - @java.lang.Override - public com.google.protobuf.FieldMask getUpdateMask() { - return updateMask_ == null ? com.google.protobuf.FieldMask.getDefaultInstance() : updateMask_; - } - /** - *
        -   * The field mask to determine which fields are to be updated. If empty, the
        -   * server will assume all fields are to be updated.
        -   * 
        - * - * .google.protobuf.FieldMask update_mask = 2; - */ - @java.lang.Override - public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { - return getUpdateMask(); - } - - private byte memoizedIsInitialized = -1; - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - if (room_ != null) { - output.writeMessage(1, getRoom()); - } - if (updateMask_ != null) { - output.writeMessage(2, getUpdateMask()); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (room_ != null) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(1, getRoom()); - } - if (updateMask_ != null) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(2, getUpdateMask()); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof com.google.showcase.v1beta1.UpdateRoomRequest)) { - return super.equals(obj); - } - com.google.showcase.v1beta1.UpdateRoomRequest other = (com.google.showcase.v1beta1.UpdateRoomRequest) obj; - - if (hasRoom() != other.hasRoom()) return false; - if (hasRoom()) { - if (!getRoom() - .equals(other.getRoom())) return false; - } - if (hasUpdateMask() != other.hasUpdateMask()) return false; - if (hasUpdateMask()) { - if (!getUpdateMask() - .equals(other.getUpdateMask())) return false; - } - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - if (hasRoom()) { - hash = (37 * hash) + ROOM_FIELD_NUMBER; - hash = (53 * hash) + getRoom().hashCode(); - } - if (hasUpdateMask()) { - hash = (37 * hash) + UPDATE_MASK_FIELD_NUMBER; - hash = (53 * hash) + getUpdateMask().hashCode(); - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.showcase.v1beta1.UpdateRoomRequest parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.showcase.v1beta1.UpdateRoomRequest parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.showcase.v1beta1.UpdateRoomRequest parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.showcase.v1beta1.UpdateRoomRequest 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.showcase.v1beta1.UpdateRoomRequest parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.showcase.v1beta1.UpdateRoomRequest parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.showcase.v1beta1.UpdateRoomRequest parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static com.google.showcase.v1beta1.UpdateRoomRequest 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.showcase.v1beta1.UpdateRoomRequest parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static com.google.showcase.v1beta1.UpdateRoomRequest 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.showcase.v1beta1.UpdateRoomRequest parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static com.google.showcase.v1beta1.UpdateRoomRequest 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.showcase.v1beta1.UpdateRoomRequest 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 request message for the google.showcase.v1beta1.Messaging\UpdateRoom
        -   * method.
        -   * 
        - * - * Protobuf type {@code google.showcase.v1beta1.UpdateRoomRequest} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.UpdateRoomRequest) - com.google.showcase.v1beta1.UpdateRoomRequestOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.google.showcase.v1beta1.MessagingOuterClass.internal_static_google_showcase_v1beta1_UpdateRoomRequest_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.showcase.v1beta1.MessagingOuterClass.internal_static_google_showcase_v1beta1_UpdateRoomRequest_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.showcase.v1beta1.UpdateRoomRequest.class, com.google.showcase.v1beta1.UpdateRoomRequest.Builder.class); - } - - // Construct using com.google.showcase.v1beta1.UpdateRoomRequest.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { - } - } - @java.lang.Override - public Builder clear() { - super.clear(); - if (roomBuilder_ == null) { - room_ = null; - } else { - room_ = null; - roomBuilder_ = null; - } - if (updateMaskBuilder_ == null) { - updateMask_ = null; - } else { - updateMask_ = null; - updateMaskBuilder_ = null; - } - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return com.google.showcase.v1beta1.MessagingOuterClass.internal_static_google_showcase_v1beta1_UpdateRoomRequest_descriptor; - } - - @java.lang.Override - public com.google.showcase.v1beta1.UpdateRoomRequest getDefaultInstanceForType() { - return com.google.showcase.v1beta1.UpdateRoomRequest.getDefaultInstance(); - } - - @java.lang.Override - public com.google.showcase.v1beta1.UpdateRoomRequest build() { - com.google.showcase.v1beta1.UpdateRoomRequest result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.showcase.v1beta1.UpdateRoomRequest buildPartial() { - com.google.showcase.v1beta1.UpdateRoomRequest result = new com.google.showcase.v1beta1.UpdateRoomRequest(this); - if (roomBuilder_ == null) { - result.room_ = room_; - } else { - result.room_ = roomBuilder_.build(); - } - if (updateMaskBuilder_ == null) { - result.updateMask_ = updateMask_; - } else { - result.updateMask_ = updateMaskBuilder_.build(); - } - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.setField(field, value); - } - @java.lang.Override - public Builder clearField( - com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - @java.lang.Override - public Builder clearOneof( - com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.addRepeatedField(field, value); - } - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof com.google.showcase.v1beta1.UpdateRoomRequest) { - return mergeFrom((com.google.showcase.v1beta1.UpdateRoomRequest)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.showcase.v1beta1.UpdateRoomRequest other) { - if (other == com.google.showcase.v1beta1.UpdateRoomRequest.getDefaultInstance()) return this; - if (other.hasRoom()) { - mergeRoom(other.getRoom()); - } - if (other.hasUpdateMask()) { - mergeUpdateMask(other.getUpdateMask()); - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - com.google.showcase.v1beta1.UpdateRoomRequest parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (com.google.showcase.v1beta1.UpdateRoomRequest) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private com.google.showcase.v1beta1.Room room_; - private com.google.protobuf.SingleFieldBuilderV3< - com.google.showcase.v1beta1.Room, com.google.showcase.v1beta1.Room.Builder, com.google.showcase.v1beta1.RoomOrBuilder> roomBuilder_; - /** - *
        -     * The room to update.
        -     * 
        - * - * .google.showcase.v1beta1.Room room = 1; - * @return Whether the room field is set. - */ - public boolean hasRoom() { - return roomBuilder_ != null || room_ != null; - } - /** - *
        -     * The room to update.
        -     * 
        - * - * .google.showcase.v1beta1.Room room = 1; - * @return The room. - */ - public com.google.showcase.v1beta1.Room getRoom() { - if (roomBuilder_ == null) { - return room_ == null ? com.google.showcase.v1beta1.Room.getDefaultInstance() : room_; - } else { - return roomBuilder_.getMessage(); - } - } - /** - *
        -     * The room to update.
        -     * 
        - * - * .google.showcase.v1beta1.Room room = 1; - */ - public Builder setRoom(com.google.showcase.v1beta1.Room value) { - if (roomBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - room_ = value; - onChanged(); - } else { - roomBuilder_.setMessage(value); - } - - return this; - } - /** - *
        -     * The room to update.
        -     * 
        - * - * .google.showcase.v1beta1.Room room = 1; - */ - public Builder setRoom( - com.google.showcase.v1beta1.Room.Builder builderForValue) { - if (roomBuilder_ == null) { - room_ = builderForValue.build(); - onChanged(); - } else { - roomBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - *
        -     * The room to update.
        -     * 
        - * - * .google.showcase.v1beta1.Room room = 1; - */ - public Builder mergeRoom(com.google.showcase.v1beta1.Room value) { - if (roomBuilder_ == null) { - if (room_ != null) { - room_ = - com.google.showcase.v1beta1.Room.newBuilder(room_).mergeFrom(value).buildPartial(); - } else { - room_ = value; - } - onChanged(); - } else { - roomBuilder_.mergeFrom(value); - } - - return this; - } - /** - *
        -     * The room to update.
        -     * 
        - * - * .google.showcase.v1beta1.Room room = 1; - */ - public Builder clearRoom() { - if (roomBuilder_ == null) { - room_ = null; - onChanged(); - } else { - room_ = null; - roomBuilder_ = null; - } - - return this; - } - /** - *
        -     * The room to update.
        -     * 
        - * - * .google.showcase.v1beta1.Room room = 1; - */ - public com.google.showcase.v1beta1.Room.Builder getRoomBuilder() { - - onChanged(); - return getRoomFieldBuilder().getBuilder(); - } - /** - *
        -     * The room to update.
        -     * 
        - * - * .google.showcase.v1beta1.Room room = 1; - */ - public com.google.showcase.v1beta1.RoomOrBuilder getRoomOrBuilder() { - if (roomBuilder_ != null) { - return roomBuilder_.getMessageOrBuilder(); - } else { - return room_ == null ? - com.google.showcase.v1beta1.Room.getDefaultInstance() : room_; - } - } - /** - *
        -     * The room to update.
        -     * 
        - * - * .google.showcase.v1beta1.Room room = 1; - */ - private com.google.protobuf.SingleFieldBuilderV3< - com.google.showcase.v1beta1.Room, com.google.showcase.v1beta1.Room.Builder, com.google.showcase.v1beta1.RoomOrBuilder> - getRoomFieldBuilder() { - if (roomBuilder_ == null) { - roomBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - com.google.showcase.v1beta1.Room, com.google.showcase.v1beta1.Room.Builder, com.google.showcase.v1beta1.RoomOrBuilder>( - getRoom(), - getParentForChildren(), - isClean()); - room_ = null; - } - return roomBuilder_; - } - - private com.google.protobuf.FieldMask updateMask_; - private com.google.protobuf.SingleFieldBuilderV3< - com.google.protobuf.FieldMask, com.google.protobuf.FieldMask.Builder, com.google.protobuf.FieldMaskOrBuilder> updateMaskBuilder_; - /** - *
        -     * The field mask to determine which fields are to be updated. If empty, the
        -     * server will assume all fields are to be updated.
        -     * 
        - * - * .google.protobuf.FieldMask update_mask = 2; - * @return Whether the updateMask field is set. - */ - public boolean hasUpdateMask() { - return updateMaskBuilder_ != null || updateMask_ != null; - } - /** - *
        -     * The field mask to determine which fields are to be updated. If empty, the
        -     * server will assume all fields are to be updated.
        -     * 
        - * - * .google.protobuf.FieldMask update_mask = 2; - * @return The updateMask. - */ - public com.google.protobuf.FieldMask getUpdateMask() { - if (updateMaskBuilder_ == null) { - return updateMask_ == null ? com.google.protobuf.FieldMask.getDefaultInstance() : updateMask_; - } else { - return updateMaskBuilder_.getMessage(); - } - } - /** - *
        -     * The field mask to determine which fields are to be updated. If empty, the
        -     * server will assume all fields are to be updated.
        -     * 
        - * - * .google.protobuf.FieldMask update_mask = 2; - */ - public Builder setUpdateMask(com.google.protobuf.FieldMask value) { - if (updateMaskBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - updateMask_ = value; - onChanged(); - } else { - updateMaskBuilder_.setMessage(value); - } - - return this; - } - /** - *
        -     * The field mask to determine which fields are to be updated. If empty, the
        -     * server will assume all fields are to be updated.
        -     * 
        - * - * .google.protobuf.FieldMask update_mask = 2; - */ - public Builder setUpdateMask( - com.google.protobuf.FieldMask.Builder builderForValue) { - if (updateMaskBuilder_ == null) { - updateMask_ = builderForValue.build(); - onChanged(); - } else { - updateMaskBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - *
        -     * The field mask to determine which fields are to be updated. If empty, the
        -     * server will assume all fields are to be updated.
        -     * 
        - * - * .google.protobuf.FieldMask update_mask = 2; - */ - public Builder mergeUpdateMask(com.google.protobuf.FieldMask value) { - if (updateMaskBuilder_ == null) { - if (updateMask_ != null) { - updateMask_ = - com.google.protobuf.FieldMask.newBuilder(updateMask_).mergeFrom(value).buildPartial(); - } else { - updateMask_ = value; - } - onChanged(); - } else { - updateMaskBuilder_.mergeFrom(value); - } - - return this; - } - /** - *
        -     * The field mask to determine which fields are to be updated. If empty, the
        -     * server will assume all fields are to be updated.
        -     * 
        - * - * .google.protobuf.FieldMask update_mask = 2; - */ - public Builder clearUpdateMask() { - if (updateMaskBuilder_ == null) { - updateMask_ = null; - onChanged(); - } else { - updateMask_ = null; - updateMaskBuilder_ = null; - } - - return this; - } - /** - *
        -     * The field mask to determine which fields are to be updated. If empty, the
        -     * server will assume all fields are to be updated.
        -     * 
        - * - * .google.protobuf.FieldMask update_mask = 2; - */ - public com.google.protobuf.FieldMask.Builder getUpdateMaskBuilder() { - - onChanged(); - return getUpdateMaskFieldBuilder().getBuilder(); - } - /** - *
        -     * The field mask to determine which fields are to be updated. If empty, the
        -     * server will assume all fields are to be updated.
        -     * 
        - * - * .google.protobuf.FieldMask update_mask = 2; - */ - public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { - if (updateMaskBuilder_ != null) { - return updateMaskBuilder_.getMessageOrBuilder(); - } else { - return updateMask_ == null ? - com.google.protobuf.FieldMask.getDefaultInstance() : updateMask_; - } - } - /** - *
        -     * The field mask to determine which fields are to be updated. If empty, the
        -     * server will assume all fields are to be updated.
        -     * 
        - * - * .google.protobuf.FieldMask update_mask = 2; - */ - private com.google.protobuf.SingleFieldBuilderV3< - com.google.protobuf.FieldMask, com.google.protobuf.FieldMask.Builder, com.google.protobuf.FieldMaskOrBuilder> - getUpdateMaskFieldBuilder() { - if (updateMaskBuilder_ == null) { - updateMaskBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - com.google.protobuf.FieldMask, com.google.protobuf.FieldMask.Builder, com.google.protobuf.FieldMaskOrBuilder>( - getUpdateMask(), - getParentForChildren(), - isClean()); - updateMask_ = null; - } - return updateMaskBuilder_; - } - @java.lang.Override - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - - // @@protoc_insertion_point(builder_scope:google.showcase.v1beta1.UpdateRoomRequest) - } - - // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.UpdateRoomRequest) - private static final com.google.showcase.v1beta1.UpdateRoomRequest DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new com.google.showcase.v1beta1.UpdateRoomRequest(); - } - - public static com.google.showcase.v1beta1.UpdateRoomRequest getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public UpdateRoomRequest parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new UpdateRoomRequest(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public com.google.showcase.v1beta1.UpdateRoomRequest getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/UpdateRoomRequestOrBuilder.java b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/UpdateRoomRequestOrBuilder.java deleted file mode 100644 index fdd96ea574..0000000000 --- a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/UpdateRoomRequestOrBuilder.java +++ /dev/null @@ -1,66 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: schema/google/showcase/v1beta1/messaging.proto - -package com.google.showcase.v1beta1; - -public interface UpdateRoomRequestOrBuilder extends - // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.UpdateRoomRequest) - com.google.protobuf.MessageOrBuilder { - - /** - *
        -   * The room to update.
        -   * 
        - * - * .google.showcase.v1beta1.Room room = 1; - * @return Whether the room field is set. - */ - boolean hasRoom(); - /** - *
        -   * The room to update.
        -   * 
        - * - * .google.showcase.v1beta1.Room room = 1; - * @return The room. - */ - com.google.showcase.v1beta1.Room getRoom(); - /** - *
        -   * The room to update.
        -   * 
        - * - * .google.showcase.v1beta1.Room room = 1; - */ - com.google.showcase.v1beta1.RoomOrBuilder getRoomOrBuilder(); - - /** - *
        -   * The field mask to determine which fields are to be updated. If empty, the
        -   * server will assume all fields are to be updated.
        -   * 
        - * - * .google.protobuf.FieldMask update_mask = 2; - * @return Whether the updateMask field is set. - */ - boolean hasUpdateMask(); - /** - *
        -   * The field mask to determine which fields are to be updated. If empty, the
        -   * server will assume all fields are to be updated.
        -   * 
        - * - * .google.protobuf.FieldMask update_mask = 2; - * @return The updateMask. - */ - com.google.protobuf.FieldMask getUpdateMask(); - /** - *
        -   * The field mask to determine which fields are to be updated. If empty, the
        -   * server will assume all fields are to be updated.
        -   * 
        - * - * .google.protobuf.FieldMask update_mask = 2; - */ - com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder(); -} diff --git a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/UpdateUserRequest.java b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/UpdateUserRequest.java deleted file mode 100644 index 68d8b179a1..0000000000 --- a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/UpdateUserRequest.java +++ /dev/null @@ -1,915 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: schema/google/showcase/v1beta1/identity.proto - -package com.google.showcase.v1beta1; - -/** - *
        - * The request message for the google.showcase.v1beta1.Identity\UpdateUser
        - * method.
        - * 
        - * - * Protobuf type {@code google.showcase.v1beta1.UpdateUserRequest} - */ -public final class UpdateUserRequest extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.UpdateUserRequest) - UpdateUserRequestOrBuilder { -private static final long serialVersionUID = 0L; - // Use UpdateUserRequest.newBuilder() to construct. - private UpdateUserRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private UpdateUserRequest() { - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new UpdateUserRequest(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private UpdateUserRequest( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: { - com.google.showcase.v1beta1.User.Builder subBuilder = null; - if (user_ != null) { - subBuilder = user_.toBuilder(); - } - user_ = input.readMessage(com.google.showcase.v1beta1.User.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(user_); - user_ = subBuilder.buildPartial(); - } - - break; - } - case 18: { - com.google.protobuf.FieldMask.Builder subBuilder = null; - if (updateMask_ != null) { - subBuilder = updateMask_.toBuilder(); - } - updateMask_ = input.readMessage(com.google.protobuf.FieldMask.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(updateMask_); - updateMask_ = subBuilder.buildPartial(); - } - - break; - } - default: { - if (!parseUnknownField( - input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException( - e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.google.showcase.v1beta1.IdentityOuterClass.internal_static_google_showcase_v1beta1_UpdateUserRequest_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.showcase.v1beta1.IdentityOuterClass.internal_static_google_showcase_v1beta1_UpdateUserRequest_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.showcase.v1beta1.UpdateUserRequest.class, com.google.showcase.v1beta1.UpdateUserRequest.Builder.class); - } - - public static final int USER_FIELD_NUMBER = 1; - private com.google.showcase.v1beta1.User user_; - /** - *
        -   * The user to update.
        -   * 
        - * - * .google.showcase.v1beta1.User user = 1; - * @return Whether the user field is set. - */ - @java.lang.Override - public boolean hasUser() { - return user_ != null; - } - /** - *
        -   * The user to update.
        -   * 
        - * - * .google.showcase.v1beta1.User user = 1; - * @return The user. - */ - @java.lang.Override - public com.google.showcase.v1beta1.User getUser() { - return user_ == null ? com.google.showcase.v1beta1.User.getDefaultInstance() : user_; - } - /** - *
        -   * The user to update.
        -   * 
        - * - * .google.showcase.v1beta1.User user = 1; - */ - @java.lang.Override - public com.google.showcase.v1beta1.UserOrBuilder getUserOrBuilder() { - return getUser(); - } - - public static final int UPDATE_MASK_FIELD_NUMBER = 2; - private com.google.protobuf.FieldMask updateMask_; - /** - *
        -   * The field mask to determine which fields are to be updated. If empty, the
        -   * server will assume all fields are to be updated.
        -   * 
        - * - * .google.protobuf.FieldMask update_mask = 2; - * @return Whether the updateMask field is set. - */ - @java.lang.Override - public boolean hasUpdateMask() { - return updateMask_ != null; - } - /** - *
        -   * The field mask to determine which fields are to be updated. If empty, the
        -   * server will assume all fields are to be updated.
        -   * 
        - * - * .google.protobuf.FieldMask update_mask = 2; - * @return The updateMask. - */ - @java.lang.Override - public com.google.protobuf.FieldMask getUpdateMask() { - return updateMask_ == null ? com.google.protobuf.FieldMask.getDefaultInstance() : updateMask_; - } - /** - *
        -   * The field mask to determine which fields are to be updated. If empty, the
        -   * server will assume all fields are to be updated.
        -   * 
        - * - * .google.protobuf.FieldMask update_mask = 2; - */ - @java.lang.Override - public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { - return getUpdateMask(); - } - - private byte memoizedIsInitialized = -1; - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - if (user_ != null) { - output.writeMessage(1, getUser()); - } - if (updateMask_ != null) { - output.writeMessage(2, getUpdateMask()); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (user_ != null) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(1, getUser()); - } - if (updateMask_ != null) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(2, getUpdateMask()); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof com.google.showcase.v1beta1.UpdateUserRequest)) { - return super.equals(obj); - } - com.google.showcase.v1beta1.UpdateUserRequest other = (com.google.showcase.v1beta1.UpdateUserRequest) obj; - - if (hasUser() != other.hasUser()) return false; - if (hasUser()) { - if (!getUser() - .equals(other.getUser())) return false; - } - if (hasUpdateMask() != other.hasUpdateMask()) return false; - if (hasUpdateMask()) { - if (!getUpdateMask() - .equals(other.getUpdateMask())) return false; - } - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - if (hasUser()) { - hash = (37 * hash) + USER_FIELD_NUMBER; - hash = (53 * hash) + getUser().hashCode(); - } - if (hasUpdateMask()) { - hash = (37 * hash) + UPDATE_MASK_FIELD_NUMBER; - hash = (53 * hash) + getUpdateMask().hashCode(); - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.showcase.v1beta1.UpdateUserRequest parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.showcase.v1beta1.UpdateUserRequest parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.showcase.v1beta1.UpdateUserRequest parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.showcase.v1beta1.UpdateUserRequest 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.showcase.v1beta1.UpdateUserRequest parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.showcase.v1beta1.UpdateUserRequest parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.showcase.v1beta1.UpdateUserRequest parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static com.google.showcase.v1beta1.UpdateUserRequest 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.showcase.v1beta1.UpdateUserRequest parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static com.google.showcase.v1beta1.UpdateUserRequest 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.showcase.v1beta1.UpdateUserRequest parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static com.google.showcase.v1beta1.UpdateUserRequest 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.showcase.v1beta1.UpdateUserRequest 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 request message for the google.showcase.v1beta1.Identity\UpdateUser
        -   * method.
        -   * 
        - * - * Protobuf type {@code google.showcase.v1beta1.UpdateUserRequest} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.UpdateUserRequest) - com.google.showcase.v1beta1.UpdateUserRequestOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.google.showcase.v1beta1.IdentityOuterClass.internal_static_google_showcase_v1beta1_UpdateUserRequest_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.showcase.v1beta1.IdentityOuterClass.internal_static_google_showcase_v1beta1_UpdateUserRequest_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.showcase.v1beta1.UpdateUserRequest.class, com.google.showcase.v1beta1.UpdateUserRequest.Builder.class); - } - - // Construct using com.google.showcase.v1beta1.UpdateUserRequest.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { - } - } - @java.lang.Override - public Builder clear() { - super.clear(); - if (userBuilder_ == null) { - user_ = null; - } else { - user_ = null; - userBuilder_ = null; - } - if (updateMaskBuilder_ == null) { - updateMask_ = null; - } else { - updateMask_ = null; - updateMaskBuilder_ = null; - } - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return com.google.showcase.v1beta1.IdentityOuterClass.internal_static_google_showcase_v1beta1_UpdateUserRequest_descriptor; - } - - @java.lang.Override - public com.google.showcase.v1beta1.UpdateUserRequest getDefaultInstanceForType() { - return com.google.showcase.v1beta1.UpdateUserRequest.getDefaultInstance(); - } - - @java.lang.Override - public com.google.showcase.v1beta1.UpdateUserRequest build() { - com.google.showcase.v1beta1.UpdateUserRequest result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.showcase.v1beta1.UpdateUserRequest buildPartial() { - com.google.showcase.v1beta1.UpdateUserRequest result = new com.google.showcase.v1beta1.UpdateUserRequest(this); - if (userBuilder_ == null) { - result.user_ = user_; - } else { - result.user_ = userBuilder_.build(); - } - if (updateMaskBuilder_ == null) { - result.updateMask_ = updateMask_; - } else { - result.updateMask_ = updateMaskBuilder_.build(); - } - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.setField(field, value); - } - @java.lang.Override - public Builder clearField( - com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - @java.lang.Override - public Builder clearOneof( - com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.addRepeatedField(field, value); - } - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof com.google.showcase.v1beta1.UpdateUserRequest) { - return mergeFrom((com.google.showcase.v1beta1.UpdateUserRequest)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.showcase.v1beta1.UpdateUserRequest other) { - if (other == com.google.showcase.v1beta1.UpdateUserRequest.getDefaultInstance()) return this; - if (other.hasUser()) { - mergeUser(other.getUser()); - } - if (other.hasUpdateMask()) { - mergeUpdateMask(other.getUpdateMask()); - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - com.google.showcase.v1beta1.UpdateUserRequest parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (com.google.showcase.v1beta1.UpdateUserRequest) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private com.google.showcase.v1beta1.User user_; - private com.google.protobuf.SingleFieldBuilderV3< - com.google.showcase.v1beta1.User, com.google.showcase.v1beta1.User.Builder, com.google.showcase.v1beta1.UserOrBuilder> userBuilder_; - /** - *
        -     * The user to update.
        -     * 
        - * - * .google.showcase.v1beta1.User user = 1; - * @return Whether the user field is set. - */ - public boolean hasUser() { - return userBuilder_ != null || user_ != null; - } - /** - *
        -     * The user to update.
        -     * 
        - * - * .google.showcase.v1beta1.User user = 1; - * @return The user. - */ - public com.google.showcase.v1beta1.User getUser() { - if (userBuilder_ == null) { - return user_ == null ? com.google.showcase.v1beta1.User.getDefaultInstance() : user_; - } else { - return userBuilder_.getMessage(); - } - } - /** - *
        -     * The user to update.
        -     * 
        - * - * .google.showcase.v1beta1.User user = 1; - */ - public Builder setUser(com.google.showcase.v1beta1.User value) { - if (userBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - user_ = value; - onChanged(); - } else { - userBuilder_.setMessage(value); - } - - return this; - } - /** - *
        -     * The user to update.
        -     * 
        - * - * .google.showcase.v1beta1.User user = 1; - */ - public Builder setUser( - com.google.showcase.v1beta1.User.Builder builderForValue) { - if (userBuilder_ == null) { - user_ = builderForValue.build(); - onChanged(); - } else { - userBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - *
        -     * The user to update.
        -     * 
        - * - * .google.showcase.v1beta1.User user = 1; - */ - public Builder mergeUser(com.google.showcase.v1beta1.User value) { - if (userBuilder_ == null) { - if (user_ != null) { - user_ = - com.google.showcase.v1beta1.User.newBuilder(user_).mergeFrom(value).buildPartial(); - } else { - user_ = value; - } - onChanged(); - } else { - userBuilder_.mergeFrom(value); - } - - return this; - } - /** - *
        -     * The user to update.
        -     * 
        - * - * .google.showcase.v1beta1.User user = 1; - */ - public Builder clearUser() { - if (userBuilder_ == null) { - user_ = null; - onChanged(); - } else { - user_ = null; - userBuilder_ = null; - } - - return this; - } - /** - *
        -     * The user to update.
        -     * 
        - * - * .google.showcase.v1beta1.User user = 1; - */ - public com.google.showcase.v1beta1.User.Builder getUserBuilder() { - - onChanged(); - return getUserFieldBuilder().getBuilder(); - } - /** - *
        -     * The user to update.
        -     * 
        - * - * .google.showcase.v1beta1.User user = 1; - */ - public com.google.showcase.v1beta1.UserOrBuilder getUserOrBuilder() { - if (userBuilder_ != null) { - return userBuilder_.getMessageOrBuilder(); - } else { - return user_ == null ? - com.google.showcase.v1beta1.User.getDefaultInstance() : user_; - } - } - /** - *
        -     * The user to update.
        -     * 
        - * - * .google.showcase.v1beta1.User user = 1; - */ - private com.google.protobuf.SingleFieldBuilderV3< - com.google.showcase.v1beta1.User, com.google.showcase.v1beta1.User.Builder, com.google.showcase.v1beta1.UserOrBuilder> - getUserFieldBuilder() { - if (userBuilder_ == null) { - userBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - com.google.showcase.v1beta1.User, com.google.showcase.v1beta1.User.Builder, com.google.showcase.v1beta1.UserOrBuilder>( - getUser(), - getParentForChildren(), - isClean()); - user_ = null; - } - return userBuilder_; - } - - private com.google.protobuf.FieldMask updateMask_; - private com.google.protobuf.SingleFieldBuilderV3< - com.google.protobuf.FieldMask, com.google.protobuf.FieldMask.Builder, com.google.protobuf.FieldMaskOrBuilder> updateMaskBuilder_; - /** - *
        -     * The field mask to determine which fields are to be updated. If empty, the
        -     * server will assume all fields are to be updated.
        -     * 
        - * - * .google.protobuf.FieldMask update_mask = 2; - * @return Whether the updateMask field is set. - */ - public boolean hasUpdateMask() { - return updateMaskBuilder_ != null || updateMask_ != null; - } - /** - *
        -     * The field mask to determine which fields are to be updated. If empty, the
        -     * server will assume all fields are to be updated.
        -     * 
        - * - * .google.protobuf.FieldMask update_mask = 2; - * @return The updateMask. - */ - public com.google.protobuf.FieldMask getUpdateMask() { - if (updateMaskBuilder_ == null) { - return updateMask_ == null ? com.google.protobuf.FieldMask.getDefaultInstance() : updateMask_; - } else { - return updateMaskBuilder_.getMessage(); - } - } - /** - *
        -     * The field mask to determine which fields are to be updated. If empty, the
        -     * server will assume all fields are to be updated.
        -     * 
        - * - * .google.protobuf.FieldMask update_mask = 2; - */ - public Builder setUpdateMask(com.google.protobuf.FieldMask value) { - if (updateMaskBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - updateMask_ = value; - onChanged(); - } else { - updateMaskBuilder_.setMessage(value); - } - - return this; - } - /** - *
        -     * The field mask to determine which fields are to be updated. If empty, the
        -     * server will assume all fields are to be updated.
        -     * 
        - * - * .google.protobuf.FieldMask update_mask = 2; - */ - public Builder setUpdateMask( - com.google.protobuf.FieldMask.Builder builderForValue) { - if (updateMaskBuilder_ == null) { - updateMask_ = builderForValue.build(); - onChanged(); - } else { - updateMaskBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - *
        -     * The field mask to determine which fields are to be updated. If empty, the
        -     * server will assume all fields are to be updated.
        -     * 
        - * - * .google.protobuf.FieldMask update_mask = 2; - */ - public Builder mergeUpdateMask(com.google.protobuf.FieldMask value) { - if (updateMaskBuilder_ == null) { - if (updateMask_ != null) { - updateMask_ = - com.google.protobuf.FieldMask.newBuilder(updateMask_).mergeFrom(value).buildPartial(); - } else { - updateMask_ = value; - } - onChanged(); - } else { - updateMaskBuilder_.mergeFrom(value); - } - - return this; - } - /** - *
        -     * The field mask to determine which fields are to be updated. If empty, the
        -     * server will assume all fields are to be updated.
        -     * 
        - * - * .google.protobuf.FieldMask update_mask = 2; - */ - public Builder clearUpdateMask() { - if (updateMaskBuilder_ == null) { - updateMask_ = null; - onChanged(); - } else { - updateMask_ = null; - updateMaskBuilder_ = null; - } - - return this; - } - /** - *
        -     * The field mask to determine which fields are to be updated. If empty, the
        -     * server will assume all fields are to be updated.
        -     * 
        - * - * .google.protobuf.FieldMask update_mask = 2; - */ - public com.google.protobuf.FieldMask.Builder getUpdateMaskBuilder() { - - onChanged(); - return getUpdateMaskFieldBuilder().getBuilder(); - } - /** - *
        -     * The field mask to determine which fields are to be updated. If empty, the
        -     * server will assume all fields are to be updated.
        -     * 
        - * - * .google.protobuf.FieldMask update_mask = 2; - */ - public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { - if (updateMaskBuilder_ != null) { - return updateMaskBuilder_.getMessageOrBuilder(); - } else { - return updateMask_ == null ? - com.google.protobuf.FieldMask.getDefaultInstance() : updateMask_; - } - } - /** - *
        -     * The field mask to determine which fields are to be updated. If empty, the
        -     * server will assume all fields are to be updated.
        -     * 
        - * - * .google.protobuf.FieldMask update_mask = 2; - */ - private com.google.protobuf.SingleFieldBuilderV3< - com.google.protobuf.FieldMask, com.google.protobuf.FieldMask.Builder, com.google.protobuf.FieldMaskOrBuilder> - getUpdateMaskFieldBuilder() { - if (updateMaskBuilder_ == null) { - updateMaskBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - com.google.protobuf.FieldMask, com.google.protobuf.FieldMask.Builder, com.google.protobuf.FieldMaskOrBuilder>( - getUpdateMask(), - getParentForChildren(), - isClean()); - updateMask_ = null; - } - return updateMaskBuilder_; - } - @java.lang.Override - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - - // @@protoc_insertion_point(builder_scope:google.showcase.v1beta1.UpdateUserRequest) - } - - // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.UpdateUserRequest) - private static final com.google.showcase.v1beta1.UpdateUserRequest DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new com.google.showcase.v1beta1.UpdateUserRequest(); - } - - public static com.google.showcase.v1beta1.UpdateUserRequest getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public UpdateUserRequest parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new UpdateUserRequest(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public com.google.showcase.v1beta1.UpdateUserRequest getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/UpdateUserRequestOrBuilder.java b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/UpdateUserRequestOrBuilder.java deleted file mode 100644 index ff5768e239..0000000000 --- a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/UpdateUserRequestOrBuilder.java +++ /dev/null @@ -1,66 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: schema/google/showcase/v1beta1/identity.proto - -package com.google.showcase.v1beta1; - -public interface UpdateUserRequestOrBuilder extends - // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.UpdateUserRequest) - com.google.protobuf.MessageOrBuilder { - - /** - *
        -   * The user to update.
        -   * 
        - * - * .google.showcase.v1beta1.User user = 1; - * @return Whether the user field is set. - */ - boolean hasUser(); - /** - *
        -   * The user to update.
        -   * 
        - * - * .google.showcase.v1beta1.User user = 1; - * @return The user. - */ - com.google.showcase.v1beta1.User getUser(); - /** - *
        -   * The user to update.
        -   * 
        - * - * .google.showcase.v1beta1.User user = 1; - */ - com.google.showcase.v1beta1.UserOrBuilder getUserOrBuilder(); - - /** - *
        -   * The field mask to determine which fields are to be updated. If empty, the
        -   * server will assume all fields are to be updated.
        -   * 
        - * - * .google.protobuf.FieldMask update_mask = 2; - * @return Whether the updateMask field is set. - */ - boolean hasUpdateMask(); - /** - *
        -   * The field mask to determine which fields are to be updated. If empty, the
        -   * server will assume all fields are to be updated.
        -   * 
        - * - * .google.protobuf.FieldMask update_mask = 2; - * @return The updateMask. - */ - com.google.protobuf.FieldMask getUpdateMask(); - /** - *
        -   * The field mask to determine which fields are to be updated. If empty, the
        -   * server will assume all fields are to be updated.
        -   * 
        - * - * .google.protobuf.FieldMask update_mask = 2; - */ - com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder(); -} diff --git a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/User.java b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/User.java deleted file mode 100644 index 5eb29fdbbb..0000000000 --- a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/User.java +++ /dev/null @@ -1,1972 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: schema/google/showcase/v1beta1/identity.proto - -package com.google.showcase.v1beta1; - -/** - *
        - * A user.
        - * 
        - * - * Protobuf type {@code google.showcase.v1beta1.User} - */ -public final class User extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.User) - UserOrBuilder { -private static final long serialVersionUID = 0L; - // Use User.newBuilder() to construct. - private User(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private User() { - name_ = ""; - displayName_ = ""; - email_ = ""; - nickname_ = ""; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new User(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private User( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - int mutable_bitField0_ = 0; - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: { - java.lang.String s = input.readStringRequireUtf8(); - - name_ = s; - break; - } - case 18: { - java.lang.String s = input.readStringRequireUtf8(); - - displayName_ = s; - break; - } - case 26: { - java.lang.String s = input.readStringRequireUtf8(); - - email_ = s; - break; - } - case 34: { - com.google.protobuf.Timestamp.Builder subBuilder = null; - if (createTime_ != null) { - subBuilder = createTime_.toBuilder(); - } - createTime_ = input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(createTime_); - createTime_ = subBuilder.buildPartial(); - } - - break; - } - case 42: { - com.google.protobuf.Timestamp.Builder subBuilder = null; - if (updateTime_ != null) { - subBuilder = updateTime_.toBuilder(); - } - updateTime_ = input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(updateTime_); - updateTime_ = subBuilder.buildPartial(); - } - - break; - } - case 48: { - bitField0_ |= 0x00000001; - age_ = input.readInt32(); - break; - } - case 57: { - bitField0_ |= 0x00000002; - heightFeet_ = input.readDouble(); - break; - } - case 66: { - java.lang.String s = input.readStringRequireUtf8(); - bitField0_ |= 0x00000004; - nickname_ = s; - break; - } - case 72: { - bitField0_ |= 0x00000008; - enableNotifications_ = input.readBool(); - break; - } - default: { - if (!parseUnknownField( - input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException( - e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.google.showcase.v1beta1.IdentityOuterClass.internal_static_google_showcase_v1beta1_User_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.showcase.v1beta1.IdentityOuterClass.internal_static_google_showcase_v1beta1_User_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.showcase.v1beta1.User.class, com.google.showcase.v1beta1.User.Builder.class); - } - - private int bitField0_; - public static final int NAME_FIELD_NUMBER = 1; - private volatile java.lang.Object name_; - /** - *
        -   * The resource name of the user.
        -   * 
        - * - * 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 user.
        -   * 
        - * - * 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 DISPLAY_NAME_FIELD_NUMBER = 2; - private volatile java.lang.Object displayName_; - /** - *
        -   * The display_name of the user.
        -   * 
        - * - * string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return The displayName. - */ - @java.lang.Override - public java.lang.String getDisplayName() { - java.lang.Object ref = displayName_; - 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(); - displayName_ = s; - return s; - } - } - /** - *
        -   * The display_name of the user.
        -   * 
        - * - * string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return The bytes for displayName. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getDisplayNameBytes() { - java.lang.Object ref = displayName_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - displayName_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int EMAIL_FIELD_NUMBER = 3; - private volatile java.lang.Object email_; - /** - *
        -   * The email address of the user.
        -   * 
        - * - * string email = 3 [(.google.api.field_behavior) = REQUIRED]; - * @return The email. - */ - @java.lang.Override - public java.lang.String getEmail() { - java.lang.Object ref = email_; - 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(); - email_ = s; - return s; - } - } - /** - *
        -   * The email address of the user.
        -   * 
        - * - * string email = 3 [(.google.api.field_behavior) = REQUIRED]; - * @return The bytes for email. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getEmailBytes() { - java.lang.Object ref = email_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - email_ = 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_; - /** - *
        -   * The timestamp at which the user was created.
        -   * 
        - * - * .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 createTime_ != null; - } - /** - *
        -   * The timestamp at which the user was created.
        -   * 
        - * - * .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_; - } - /** - *
        -   * The timestamp at which the user was created.
        -   * 
        - * - * .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - @java.lang.Override - public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { - return getCreateTime(); - } - - public static final int UPDATE_TIME_FIELD_NUMBER = 5; - private com.google.protobuf.Timestamp updateTime_; - /** - *
        -   * The latest timestamp at which the user was updated.
        -   * 
        - * - * .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return Whether the updateTime field is set. - */ - @java.lang.Override - public boolean hasUpdateTime() { - return updateTime_ != null; - } - /** - *
        -   * The latest timestamp at which the user was updated.
        -   * 
        - * - * .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return The updateTime. - */ - @java.lang.Override - public com.google.protobuf.Timestamp getUpdateTime() { - return updateTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : updateTime_; - } - /** - *
        -   * The latest timestamp at which the user was updated.
        -   * 
        - * - * .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - @java.lang.Override - public com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder() { - return getUpdateTime(); - } - - public static final int AGE_FIELD_NUMBER = 6; - private int age_; - /** - *
        -   * The age of the user in years.
        -   * 
        - * - * optional int32 age = 6; - * @return Whether the age field is set. - */ - @java.lang.Override - public boolean hasAge() { - return ((bitField0_ & 0x00000001) != 0); - } - /** - *
        -   * The age of the user in years.
        -   * 
        - * - * optional int32 age = 6; - * @return The age. - */ - @java.lang.Override - public int getAge() { - return age_; - } - - public static final int HEIGHT_FEET_FIELD_NUMBER = 7; - private double heightFeet_; - /** - *
        -   * The height of the user in feet.
        -   * 
        - * - * optional double height_feet = 7; - * @return Whether the heightFeet field is set. - */ - @java.lang.Override - public boolean hasHeightFeet() { - return ((bitField0_ & 0x00000002) != 0); - } - /** - *
        -   * The height of the user in feet.
        -   * 
        - * - * optional double height_feet = 7; - * @return The heightFeet. - */ - @java.lang.Override - public double getHeightFeet() { - return heightFeet_; - } - - public static final int NICKNAME_FIELD_NUMBER = 8; - private volatile java.lang.Object nickname_; - /** - *
        -   * The nickname of the user.
        -   * (-- aip.dev/not-precedent: An empty string is a valid nickname.
        -   *     Ordinarily, proto3_optional should not be used on a `string` field. --)
        -   * 
        - * - * optional string nickname = 8; - * @return Whether the nickname field is set. - */ - @java.lang.Override - public boolean hasNickname() { - return ((bitField0_ & 0x00000004) != 0); - } - /** - *
        -   * The nickname of the user.
        -   * (-- aip.dev/not-precedent: An empty string is a valid nickname.
        -   *     Ordinarily, proto3_optional should not be used on a `string` field. --)
        -   * 
        - * - * optional string nickname = 8; - * @return The nickname. - */ - @java.lang.Override - public java.lang.String getNickname() { - java.lang.Object ref = nickname_; - 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(); - nickname_ = s; - return s; - } - } - /** - *
        -   * The nickname of the user.
        -   * (-- aip.dev/not-precedent: An empty string is a valid nickname.
        -   *     Ordinarily, proto3_optional should not be used on a `string` field. --)
        -   * 
        - * - * optional string nickname = 8; - * @return The bytes for nickname. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getNicknameBytes() { - java.lang.Object ref = nickname_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - nickname_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int ENABLE_NOTIFICATIONS_FIELD_NUMBER = 9; - private boolean enableNotifications_; - /** - *
        -   * Enables the receiving of notifications. The default is true if unset.
        -   * (-- aip.dev/not-precedent: The default for the feature is true.
        -   *     Ordinarily, the default for a `bool` field should be false. --)
        -   * 
        - * - * optional bool enable_notifications = 9; - * @return Whether the enableNotifications field is set. - */ - @java.lang.Override - public boolean hasEnableNotifications() { - return ((bitField0_ & 0x00000008) != 0); - } - /** - *
        -   * Enables the receiving of notifications. The default is true if unset.
        -   * (-- aip.dev/not-precedent: The default for the feature is true.
        -   *     Ordinarily, the default for a `bool` field should be false. --)
        -   * 
        - * - * optional bool enable_notifications = 9; - * @return The enableNotifications. - */ - @java.lang.Override - public boolean getEnableNotifications() { - return enableNotifications_; - } - - 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(displayName_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 2, displayName_); - } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(email_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 3, email_); - } - if (createTime_ != null) { - output.writeMessage(4, getCreateTime()); - } - if (updateTime_ != null) { - output.writeMessage(5, getUpdateTime()); - } - if (((bitField0_ & 0x00000001) != 0)) { - output.writeInt32(6, age_); - } - if (((bitField0_ & 0x00000002) != 0)) { - output.writeDouble(7, heightFeet_); - } - if (((bitField0_ & 0x00000004) != 0)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 8, nickname_); - } - if (((bitField0_ & 0x00000008) != 0)) { - output.writeBool(9, enableNotifications_); - } - unknownFields.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(displayName_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, displayName_); - } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(email_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, email_); - } - if (createTime_ != null) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(4, getCreateTime()); - } - if (updateTime_ != null) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(5, getUpdateTime()); - } - if (((bitField0_ & 0x00000001) != 0)) { - size += com.google.protobuf.CodedOutputStream - .computeInt32Size(6, age_); - } - if (((bitField0_ & 0x00000002) != 0)) { - size += com.google.protobuf.CodedOutputStream - .computeDoubleSize(7, heightFeet_); - } - if (((bitField0_ & 0x00000004) != 0)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(8, nickname_); - } - if (((bitField0_ & 0x00000008) != 0)) { - size += com.google.protobuf.CodedOutputStream - .computeBoolSize(9, enableNotifications_); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof com.google.showcase.v1beta1.User)) { - return super.equals(obj); - } - com.google.showcase.v1beta1.User other = (com.google.showcase.v1beta1.User) obj; - - if (!getName() - .equals(other.getName())) return false; - if (!getDisplayName() - .equals(other.getDisplayName())) return false; - if (!getEmail() - .equals(other.getEmail())) 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 (hasAge() != other.hasAge()) return false; - if (hasAge()) { - if (getAge() - != other.getAge()) return false; - } - if (hasHeightFeet() != other.hasHeightFeet()) return false; - if (hasHeightFeet()) { - if (java.lang.Double.doubleToLongBits(getHeightFeet()) - != java.lang.Double.doubleToLongBits( - other.getHeightFeet())) return false; - } - if (hasNickname() != other.hasNickname()) return false; - if (hasNickname()) { - if (!getNickname() - .equals(other.getNickname())) return false; - } - if (hasEnableNotifications() != other.hasEnableNotifications()) return false; - if (hasEnableNotifications()) { - if (getEnableNotifications() - != other.getEnableNotifications()) return false; - } - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - hash = (37 * hash) + NAME_FIELD_NUMBER; - hash = (53 * hash) + getName().hashCode(); - hash = (37 * hash) + DISPLAY_NAME_FIELD_NUMBER; - hash = (53 * hash) + getDisplayName().hashCode(); - hash = (37 * hash) + EMAIL_FIELD_NUMBER; - hash = (53 * hash) + getEmail().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(); - } - if (hasAge()) { - hash = (37 * hash) + AGE_FIELD_NUMBER; - hash = (53 * hash) + getAge(); - } - if (hasHeightFeet()) { - hash = (37 * hash) + HEIGHT_FEET_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashLong( - java.lang.Double.doubleToLongBits(getHeightFeet())); - } - if (hasNickname()) { - hash = (37 * hash) + NICKNAME_FIELD_NUMBER; - hash = (53 * hash) + getNickname().hashCode(); - } - if (hasEnableNotifications()) { - hash = (37 * hash) + ENABLE_NOTIFICATIONS_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( - getEnableNotifications()); - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.showcase.v1beta1.User parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.showcase.v1beta1.User parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.showcase.v1beta1.User parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.showcase.v1beta1.User 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.showcase.v1beta1.User parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.showcase.v1beta1.User parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.showcase.v1beta1.User parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static com.google.showcase.v1beta1.User 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.showcase.v1beta1.User parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static com.google.showcase.v1beta1.User 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.showcase.v1beta1.User parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static com.google.showcase.v1beta1.User 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.showcase.v1beta1.User prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - @java.lang.Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - *
        -   * A user.
        -   * 
        - * - * Protobuf type {@code google.showcase.v1beta1.User} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.User) - com.google.showcase.v1beta1.UserOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.google.showcase.v1beta1.IdentityOuterClass.internal_static_google_showcase_v1beta1_User_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.showcase.v1beta1.IdentityOuterClass.internal_static_google_showcase_v1beta1_User_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.showcase.v1beta1.User.class, com.google.showcase.v1beta1.User.Builder.class); - } - - // Construct using com.google.showcase.v1beta1.User.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { - } - } - @java.lang.Override - public Builder clear() { - super.clear(); - name_ = ""; - - displayName_ = ""; - - email_ = ""; - - if (createTimeBuilder_ == null) { - createTime_ = null; - } else { - createTime_ = null; - createTimeBuilder_ = null; - } - if (updateTimeBuilder_ == null) { - updateTime_ = null; - } else { - updateTime_ = null; - updateTimeBuilder_ = null; - } - age_ = 0; - bitField0_ = (bitField0_ & ~0x00000001); - heightFeet_ = 0D; - bitField0_ = (bitField0_ & ~0x00000002); - nickname_ = ""; - bitField0_ = (bitField0_ & ~0x00000004); - enableNotifications_ = false; - bitField0_ = (bitField0_ & ~0x00000008); - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return com.google.showcase.v1beta1.IdentityOuterClass.internal_static_google_showcase_v1beta1_User_descriptor; - } - - @java.lang.Override - public com.google.showcase.v1beta1.User getDefaultInstanceForType() { - return com.google.showcase.v1beta1.User.getDefaultInstance(); - } - - @java.lang.Override - public com.google.showcase.v1beta1.User build() { - com.google.showcase.v1beta1.User result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.showcase.v1beta1.User buildPartial() { - com.google.showcase.v1beta1.User result = new com.google.showcase.v1beta1.User(this); - int from_bitField0_ = bitField0_; - int to_bitField0_ = 0; - result.name_ = name_; - result.displayName_ = displayName_; - result.email_ = email_; - if (createTimeBuilder_ == null) { - result.createTime_ = createTime_; - } else { - result.createTime_ = createTimeBuilder_.build(); - } - if (updateTimeBuilder_ == null) { - result.updateTime_ = updateTime_; - } else { - result.updateTime_ = updateTimeBuilder_.build(); - } - if (((from_bitField0_ & 0x00000001) != 0)) { - result.age_ = age_; - to_bitField0_ |= 0x00000001; - } - if (((from_bitField0_ & 0x00000002) != 0)) { - result.heightFeet_ = heightFeet_; - to_bitField0_ |= 0x00000002; - } - if (((from_bitField0_ & 0x00000004) != 0)) { - to_bitField0_ |= 0x00000004; - } - result.nickname_ = nickname_; - if (((from_bitField0_ & 0x00000008) != 0)) { - result.enableNotifications_ = enableNotifications_; - to_bitField0_ |= 0x00000008; - } - result.bitField0_ = to_bitField0_; - 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.showcase.v1beta1.User) { - return mergeFrom((com.google.showcase.v1beta1.User)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.showcase.v1beta1.User other) { - if (other == com.google.showcase.v1beta1.User.getDefaultInstance()) return this; - if (!other.getName().isEmpty()) { - name_ = other.name_; - onChanged(); - } - if (!other.getDisplayName().isEmpty()) { - displayName_ = other.displayName_; - onChanged(); - } - if (!other.getEmail().isEmpty()) { - email_ = other.email_; - onChanged(); - } - if (other.hasCreateTime()) { - mergeCreateTime(other.getCreateTime()); - } - if (other.hasUpdateTime()) { - mergeUpdateTime(other.getUpdateTime()); - } - if (other.hasAge()) { - setAge(other.getAge()); - } - if (other.hasHeightFeet()) { - setHeightFeet(other.getHeightFeet()); - } - if (other.hasNickname()) { - bitField0_ |= 0x00000004; - nickname_ = other.nickname_; - onChanged(); - } - if (other.hasEnableNotifications()) { - setEnableNotifications(other.getEnableNotifications()); - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - com.google.showcase.v1beta1.User parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (com.google.showcase.v1beta1.User) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - private int bitField0_; - - private java.lang.Object name_ = ""; - /** - *
        -     * The resource name of the user.
        -     * 
        - * - * 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 user.
        -     * 
        - * - * 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 user.
        -     * 
        - * - * string name = 1; - * @param value The name to set. - * @return This builder for chaining. - */ - public Builder setName( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - name_ = value; - onChanged(); - return this; - } - /** - *
        -     * The resource name of the user.
        -     * 
        - * - * string name = 1; - * @return This builder for chaining. - */ - public Builder clearName() { - - name_ = getDefaultInstance().getName(); - onChanged(); - return this; - } - /** - *
        -     * The resource name of the user.
        -     * 
        - * - * string name = 1; - * @param value The bytes for name to set. - * @return This builder for chaining. - */ - public Builder setNameBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - name_ = value; - onChanged(); - return this; - } - - private java.lang.Object displayName_ = ""; - /** - *
        -     * The display_name of the user.
        -     * 
        - * - * string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return The displayName. - */ - public java.lang.String getDisplayName() { - java.lang.Object ref = displayName_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - displayName_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - *
        -     * The display_name of the user.
        -     * 
        - * - * string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return The bytes for displayName. - */ - public com.google.protobuf.ByteString - getDisplayNameBytes() { - java.lang.Object ref = displayName_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - displayName_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - *
        -     * The display_name of the user.
        -     * 
        - * - * string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; - * @param value The displayName to set. - * @return This builder for chaining. - */ - public Builder setDisplayName( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - displayName_ = value; - onChanged(); - return this; - } - /** - *
        -     * The display_name of the user.
        -     * 
        - * - * string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return This builder for chaining. - */ - public Builder clearDisplayName() { - - displayName_ = getDefaultInstance().getDisplayName(); - onChanged(); - return this; - } - /** - *
        -     * The display_name of the user.
        -     * 
        - * - * string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; - * @param value The bytes for displayName to set. - * @return This builder for chaining. - */ - public Builder setDisplayNameBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - displayName_ = value; - onChanged(); - return this; - } - - private java.lang.Object email_ = ""; - /** - *
        -     * The email address of the user.
        -     * 
        - * - * string email = 3 [(.google.api.field_behavior) = REQUIRED]; - * @return The email. - */ - public java.lang.String getEmail() { - java.lang.Object ref = email_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - email_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - *
        -     * The email address of the user.
        -     * 
        - * - * string email = 3 [(.google.api.field_behavior) = REQUIRED]; - * @return The bytes for email. - */ - public com.google.protobuf.ByteString - getEmailBytes() { - java.lang.Object ref = email_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - email_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - *
        -     * The email address of the user.
        -     * 
        - * - * string email = 3 [(.google.api.field_behavior) = REQUIRED]; - * @param value The email to set. - * @return This builder for chaining. - */ - public Builder setEmail( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - email_ = value; - onChanged(); - return this; - } - /** - *
        -     * The email address of the user.
        -     * 
        - * - * string email = 3 [(.google.api.field_behavior) = REQUIRED]; - * @return This builder for chaining. - */ - public Builder clearEmail() { - - email_ = getDefaultInstance().getEmail(); - onChanged(); - return this; - } - /** - *
        -     * The email address of the user.
        -     * 
        - * - * string email = 3 [(.google.api.field_behavior) = REQUIRED]; - * @param value The bytes for email to set. - * @return This builder for chaining. - */ - public Builder setEmailBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - email_ = value; - onChanged(); - return this; - } - - private com.google.protobuf.Timestamp createTime_; - private com.google.protobuf.SingleFieldBuilderV3< - com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder> createTimeBuilder_; - /** - *
        -     * The timestamp at which the user was created.
        -     * 
        - * - * .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return Whether the createTime field is set. - */ - public boolean hasCreateTime() { - return createTimeBuilder_ != null || createTime_ != null; - } - /** - *
        -     * The timestamp at which the user was created.
        -     * 
        - * - * .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(); - } - } - /** - *
        -     * The timestamp at which the user was created.
        -     * 
        - * - * .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; - onChanged(); - } else { - createTimeBuilder_.setMessage(value); - } - - return this; - } - /** - *
        -     * The timestamp at which the user was created.
        -     * 
        - * - * .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(); - onChanged(); - } else { - createTimeBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - *
        -     * The timestamp at which the user was created.
        -     * 
        - * - * .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - public Builder mergeCreateTime(com.google.protobuf.Timestamp value) { - if (createTimeBuilder_ == null) { - if (createTime_ != null) { - createTime_ = - com.google.protobuf.Timestamp.newBuilder(createTime_).mergeFrom(value).buildPartial(); - } else { - createTime_ = value; - } - onChanged(); - } else { - createTimeBuilder_.mergeFrom(value); - } - - return this; - } - /** - *
        -     * The timestamp at which the user was created.
        -     * 
        - * - * .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - public Builder clearCreateTime() { - if (createTimeBuilder_ == null) { - createTime_ = null; - onChanged(); - } else { - createTime_ = null; - createTimeBuilder_ = null; - } - - return this; - } - /** - *
        -     * The timestamp at which the user was created.
        -     * 
        - * - * .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - public com.google.protobuf.Timestamp.Builder getCreateTimeBuilder() { - - onChanged(); - return getCreateTimeFieldBuilder().getBuilder(); - } - /** - *
        -     * The timestamp at which the user was created.
        -     * 
        - * - * .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_; - } - } - /** - *
        -     * The timestamp at which the user was created.
        -     * 
        - * - * .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_; - /** - *
        -     * The latest timestamp at which the user was updated.
        -     * 
        - * - * .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return Whether the updateTime field is set. - */ - public boolean hasUpdateTime() { - return updateTimeBuilder_ != null || updateTime_ != null; - } - /** - *
        -     * The latest timestamp at which the user was updated.
        -     * 
        - * - * .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return The updateTime. - */ - public com.google.protobuf.Timestamp getUpdateTime() { - if (updateTimeBuilder_ == null) { - return updateTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : updateTime_; - } else { - return updateTimeBuilder_.getMessage(); - } - } - /** - *
        -     * The latest timestamp at which the user was updated.
        -     * 
        - * - * .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - public Builder setUpdateTime(com.google.protobuf.Timestamp value) { - if (updateTimeBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - updateTime_ = value; - onChanged(); - } else { - updateTimeBuilder_.setMessage(value); - } - - return this; - } - /** - *
        -     * The latest timestamp at which the user was updated.
        -     * 
        - * - * .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - public Builder setUpdateTime( - com.google.protobuf.Timestamp.Builder builderForValue) { - if (updateTimeBuilder_ == null) { - updateTime_ = builderForValue.build(); - onChanged(); - } else { - updateTimeBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - *
        -     * The latest timestamp at which the user was updated.
        -     * 
        - * - * .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - public Builder mergeUpdateTime(com.google.protobuf.Timestamp value) { - if (updateTimeBuilder_ == null) { - if (updateTime_ != null) { - updateTime_ = - com.google.protobuf.Timestamp.newBuilder(updateTime_).mergeFrom(value).buildPartial(); - } else { - updateTime_ = value; - } - onChanged(); - } else { - updateTimeBuilder_.mergeFrom(value); - } - - return this; - } - /** - *
        -     * The latest timestamp at which the user was updated.
        -     * 
        - * - * .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - public Builder clearUpdateTime() { - if (updateTimeBuilder_ == null) { - updateTime_ = null; - onChanged(); - } else { - updateTime_ = null; - updateTimeBuilder_ = null; - } - - return this; - } - /** - *
        -     * The latest timestamp at which the user was updated.
        -     * 
        - * - * .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - public com.google.protobuf.Timestamp.Builder getUpdateTimeBuilder() { - - onChanged(); - return getUpdateTimeFieldBuilder().getBuilder(); - } - /** - *
        -     * The latest timestamp at which the user was updated.
        -     * 
        - * - * .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - public com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder() { - if (updateTimeBuilder_ != null) { - return updateTimeBuilder_.getMessageOrBuilder(); - } else { - return updateTime_ == null ? - com.google.protobuf.Timestamp.getDefaultInstance() : updateTime_; - } - } - /** - *
        -     * The latest timestamp at which the user was updated.
        -     * 
        - * - * .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private com.google.protobuf.SingleFieldBuilderV3< - com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder> - getUpdateTimeFieldBuilder() { - if (updateTimeBuilder_ == null) { - updateTimeBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder>( - getUpdateTime(), - getParentForChildren(), - isClean()); - updateTime_ = null; - } - return updateTimeBuilder_; - } - - private int age_ ; - /** - *
        -     * The age of the user in years.
        -     * 
        - * - * optional int32 age = 6; - * @return Whether the age field is set. - */ - @java.lang.Override - public boolean hasAge() { - return ((bitField0_ & 0x00000001) != 0); - } - /** - *
        -     * The age of the user in years.
        -     * 
        - * - * optional int32 age = 6; - * @return The age. - */ - @java.lang.Override - public int getAge() { - return age_; - } - /** - *
        -     * The age of the user in years.
        -     * 
        - * - * optional int32 age = 6; - * @param value The age to set. - * @return This builder for chaining. - */ - public Builder setAge(int value) { - bitField0_ |= 0x00000001; - age_ = value; - onChanged(); - return this; - } - /** - *
        -     * The age of the user in years.
        -     * 
        - * - * optional int32 age = 6; - * @return This builder for chaining. - */ - public Builder clearAge() { - bitField0_ = (bitField0_ & ~0x00000001); - age_ = 0; - onChanged(); - return this; - } - - private double heightFeet_ ; - /** - *
        -     * The height of the user in feet.
        -     * 
        - * - * optional double height_feet = 7; - * @return Whether the heightFeet field is set. - */ - @java.lang.Override - public boolean hasHeightFeet() { - return ((bitField0_ & 0x00000002) != 0); - } - /** - *
        -     * The height of the user in feet.
        -     * 
        - * - * optional double height_feet = 7; - * @return The heightFeet. - */ - @java.lang.Override - public double getHeightFeet() { - return heightFeet_; - } - /** - *
        -     * The height of the user in feet.
        -     * 
        - * - * optional double height_feet = 7; - * @param value The heightFeet to set. - * @return This builder for chaining. - */ - public Builder setHeightFeet(double value) { - bitField0_ |= 0x00000002; - heightFeet_ = value; - onChanged(); - return this; - } - /** - *
        -     * The height of the user in feet.
        -     * 
        - * - * optional double height_feet = 7; - * @return This builder for chaining. - */ - public Builder clearHeightFeet() { - bitField0_ = (bitField0_ & ~0x00000002); - heightFeet_ = 0D; - onChanged(); - return this; - } - - private java.lang.Object nickname_ = ""; - /** - *
        -     * The nickname of the user.
        -     * (-- aip.dev/not-precedent: An empty string is a valid nickname.
        -     *     Ordinarily, proto3_optional should not be used on a `string` field. --)
        -     * 
        - * - * optional string nickname = 8; - * @return Whether the nickname field is set. - */ - public boolean hasNickname() { - return ((bitField0_ & 0x00000004) != 0); - } - /** - *
        -     * The nickname of the user.
        -     * (-- aip.dev/not-precedent: An empty string is a valid nickname.
        -     *     Ordinarily, proto3_optional should not be used on a `string` field. --)
        -     * 
        - * - * optional string nickname = 8; - * @return The nickname. - */ - public java.lang.String getNickname() { - java.lang.Object ref = nickname_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - nickname_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - *
        -     * The nickname of the user.
        -     * (-- aip.dev/not-precedent: An empty string is a valid nickname.
        -     *     Ordinarily, proto3_optional should not be used on a `string` field. --)
        -     * 
        - * - * optional string nickname = 8; - * @return The bytes for nickname. - */ - public com.google.protobuf.ByteString - getNicknameBytes() { - java.lang.Object ref = nickname_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - nickname_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - *
        -     * The nickname of the user.
        -     * (-- aip.dev/not-precedent: An empty string is a valid nickname.
        -     *     Ordinarily, proto3_optional should not be used on a `string` field. --)
        -     * 
        - * - * optional string nickname = 8; - * @param value The nickname to set. - * @return This builder for chaining. - */ - public Builder setNickname( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - bitField0_ |= 0x00000004; - nickname_ = value; - onChanged(); - return this; - } - /** - *
        -     * The nickname of the user.
        -     * (-- aip.dev/not-precedent: An empty string is a valid nickname.
        -     *     Ordinarily, proto3_optional should not be used on a `string` field. --)
        -     * 
        - * - * optional string nickname = 8; - * @return This builder for chaining. - */ - public Builder clearNickname() { - bitField0_ = (bitField0_ & ~0x00000004); - nickname_ = getDefaultInstance().getNickname(); - onChanged(); - return this; - } - /** - *
        -     * The nickname of the user.
        -     * (-- aip.dev/not-precedent: An empty string is a valid nickname.
        -     *     Ordinarily, proto3_optional should not be used on a `string` field. --)
        -     * 
        - * - * optional string nickname = 8; - * @param value The bytes for nickname to set. - * @return This builder for chaining. - */ - public Builder setNicknameBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - bitField0_ |= 0x00000004; - nickname_ = value; - onChanged(); - return this; - } - - private boolean enableNotifications_ ; - /** - *
        -     * Enables the receiving of notifications. The default is true if unset.
        -     * (-- aip.dev/not-precedent: The default for the feature is true.
        -     *     Ordinarily, the default for a `bool` field should be false. --)
        -     * 
        - * - * optional bool enable_notifications = 9; - * @return Whether the enableNotifications field is set. - */ - @java.lang.Override - public boolean hasEnableNotifications() { - return ((bitField0_ & 0x00000008) != 0); - } - /** - *
        -     * Enables the receiving of notifications. The default is true if unset.
        -     * (-- aip.dev/not-precedent: The default for the feature is true.
        -     *     Ordinarily, the default for a `bool` field should be false. --)
        -     * 
        - * - * optional bool enable_notifications = 9; - * @return The enableNotifications. - */ - @java.lang.Override - public boolean getEnableNotifications() { - return enableNotifications_; - } - /** - *
        -     * Enables the receiving of notifications. The default is true if unset.
        -     * (-- aip.dev/not-precedent: The default for the feature is true.
        -     *     Ordinarily, the default for a `bool` field should be false. --)
        -     * 
        - * - * optional bool enable_notifications = 9; - * @param value The enableNotifications to set. - * @return This builder for chaining. - */ - public Builder setEnableNotifications(boolean value) { - bitField0_ |= 0x00000008; - enableNotifications_ = value; - onChanged(); - return this; - } - /** - *
        -     * Enables the receiving of notifications. The default is true if unset.
        -     * (-- aip.dev/not-precedent: The default for the feature is true.
        -     *     Ordinarily, the default for a `bool` field should be false. --)
        -     * 
        - * - * optional bool enable_notifications = 9; - * @return This builder for chaining. - */ - public Builder clearEnableNotifications() { - bitField0_ = (bitField0_ & ~0x00000008); - enableNotifications_ = 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.showcase.v1beta1.User) - } - - // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.User) - private static final com.google.showcase.v1beta1.User DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new com.google.showcase.v1beta1.User(); - } - - public static com.google.showcase.v1beta1.User getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public User parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new User(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public com.google.showcase.v1beta1.User getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/UserName.java b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/UserName.java deleted file mode 100644 index df5a3618b7..0000000000 --- a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/UserName.java +++ /dev/null @@ -1,166 +0,0 @@ -/* - * 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 - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.showcase.v1beta1; - -import com.google.api.pathtemplate.PathTemplate; -import com.google.api.resourcenames.ResourceName; -import com.google.common.base.Preconditions; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import javax.annotation.Generated; - -// AUTO-GENERATED DOCUMENTATION AND CLASS. -@Generated("by gapic-generator-java") -public class UserName implements ResourceName { - private static final PathTemplate USER = PathTemplate.createWithoutUrlEncoding("users/{user}"); - private volatile Map fieldValuesMap; - private final String user; - - @Deprecated - protected UserName() { - user = null; - } - - private UserName(Builder builder) { - user = Preconditions.checkNotNull(builder.getUser()); - } - - public String getUser() { - return user; - } - - public static Builder newBuilder() { - return new Builder(); - } - - public Builder toBuilder() { - return new Builder(this); - } - - public static UserName of(String user) { - return newBuilder().setUser(user).build(); - } - - public static String format(String user) { - return newBuilder().setUser(user).build().toString(); - } - - public static UserName parse(String formattedString) { - if (formattedString.isEmpty()) { - return null; - } - Map matchMap = - USER.validatedMatch(formattedString, "UserName.parse: formattedString not in valid format"); - return of(matchMap.get("user")); - } - - 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 (UserName value : values) { - if (value == null) { - list.add(""); - } else { - list.add(value.toString()); - } - } - return list; - } - - public static boolean isParsableFrom(String formattedString) { - return USER.matches(formattedString); - } - - @Override - public Map getFieldValuesMap() { - if (fieldValuesMap == null) { - synchronized (this) { - if (fieldValuesMap == null) { - ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); - if (user != null) { - fieldMapBuilder.put("user", user); - } - fieldValuesMap = fieldMapBuilder.build(); - } - } - } - return fieldValuesMap; - } - - public String getFieldValue(String fieldName) { - return getFieldValuesMap().get(fieldName); - } - - @Override - public String toString() { - return USER.instantiate("user", user); - } - - @Override - public boolean equals(Object o) { - if (o == this) { - return true; - } - if (o != null || getClass() == o.getClass()) { - UserName that = ((UserName) o); - return Objects.equals(this.user, that.user); - } - return false; - } - - @Override - public int hashCode() { - int h = 1; - h *= 1000003; - h ^= Objects.hashCode(user); - return h; - } - - /** Builder for users/{user}. */ - public static class Builder { - private String user; - - protected Builder() {} - - public String getUser() { - return user; - } - - public Builder setUser(String user) { - this.user = user; - return this; - } - - private Builder(UserName userName) { - this.user = userName.user; - } - - public UserName build() { - return new UserName(this); - } - } -} diff --git a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/UserOrBuilder.java b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/UserOrBuilder.java deleted file mode 100644 index 25f08bb513..0000000000 --- a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/UserOrBuilder.java +++ /dev/null @@ -1,219 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: schema/google/showcase/v1beta1/identity.proto - -package com.google.showcase.v1beta1; - -public interface UserOrBuilder extends - // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.User) - com.google.protobuf.MessageOrBuilder { - - /** - *
        -   * The resource name of the user.
        -   * 
        - * - * string name = 1; - * @return The name. - */ - java.lang.String getName(); - /** - *
        -   * The resource name of the user.
        -   * 
        - * - * string name = 1; - * @return The bytes for name. - */ - com.google.protobuf.ByteString - getNameBytes(); - - /** - *
        -   * The display_name of the user.
        -   * 
        - * - * string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return The displayName. - */ - java.lang.String getDisplayName(); - /** - *
        -   * The display_name of the user.
        -   * 
        - * - * string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return The bytes for displayName. - */ - com.google.protobuf.ByteString - getDisplayNameBytes(); - - /** - *
        -   * The email address of the user.
        -   * 
        - * - * string email = 3 [(.google.api.field_behavior) = REQUIRED]; - * @return The email. - */ - java.lang.String getEmail(); - /** - *
        -   * The email address of the user.
        -   * 
        - * - * string email = 3 [(.google.api.field_behavior) = REQUIRED]; - * @return The bytes for email. - */ - com.google.protobuf.ByteString - getEmailBytes(); - - /** - *
        -   * The timestamp at which the user was created.
        -   * 
        - * - * .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return Whether the createTime field is set. - */ - boolean hasCreateTime(); - /** - *
        -   * The timestamp at which the user was created.
        -   * 
        - * - * .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return The createTime. - */ - com.google.protobuf.Timestamp getCreateTime(); - /** - *
        -   * The timestamp at which the user was created.
        -   * 
        - * - * .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder(); - - /** - *
        -   * The latest timestamp at which the user was updated.
        -   * 
        - * - * .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return Whether the updateTime field is set. - */ - boolean hasUpdateTime(); - /** - *
        -   * The latest timestamp at which the user was updated.
        -   * 
        - * - * .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return The updateTime. - */ - com.google.protobuf.Timestamp getUpdateTime(); - /** - *
        -   * The latest timestamp at which the user was updated.
        -   * 
        - * - * .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder(); - - /** - *
        -   * The age of the user in years.
        -   * 
        - * - * optional int32 age = 6; - * @return Whether the age field is set. - */ - boolean hasAge(); - /** - *
        -   * The age of the user in years.
        -   * 
        - * - * optional int32 age = 6; - * @return The age. - */ - int getAge(); - - /** - *
        -   * The height of the user in feet.
        -   * 
        - * - * optional double height_feet = 7; - * @return Whether the heightFeet field is set. - */ - boolean hasHeightFeet(); - /** - *
        -   * The height of the user in feet.
        -   * 
        - * - * optional double height_feet = 7; - * @return The heightFeet. - */ - double getHeightFeet(); - - /** - *
        -   * The nickname of the user.
        -   * (-- aip.dev/not-precedent: An empty string is a valid nickname.
        -   *     Ordinarily, proto3_optional should not be used on a `string` field. --)
        -   * 
        - * - * optional string nickname = 8; - * @return Whether the nickname field is set. - */ - boolean hasNickname(); - /** - *
        -   * The nickname of the user.
        -   * (-- aip.dev/not-precedent: An empty string is a valid nickname.
        -   *     Ordinarily, proto3_optional should not be used on a `string` field. --)
        -   * 
        - * - * optional string nickname = 8; - * @return The nickname. - */ - java.lang.String getNickname(); - /** - *
        -   * The nickname of the user.
        -   * (-- aip.dev/not-precedent: An empty string is a valid nickname.
        -   *     Ordinarily, proto3_optional should not be used on a `string` field. --)
        -   * 
        - * - * optional string nickname = 8; - * @return The bytes for nickname. - */ - com.google.protobuf.ByteString - getNicknameBytes(); - - /** - *
        -   * Enables the receiving of notifications. The default is true if unset.
        -   * (-- aip.dev/not-precedent: The default for the feature is true.
        -   *     Ordinarily, the default for a `bool` field should be false. --)
        -   * 
        - * - * optional bool enable_notifications = 9; - * @return Whether the enableNotifications field is set. - */ - boolean hasEnableNotifications(); - /** - *
        -   * Enables the receiving of notifications. The default is true if unset.
        -   * (-- aip.dev/not-precedent: The default for the feature is true.
        -   *     Ordinarily, the default for a `bool` field should be false. --)
        -   * 
        - * - * optional bool enable_notifications = 9; - * @return The enableNotifications. - */ - boolean getEnableNotifications(); -} diff --git a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/VerifyTestRequest.java b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/VerifyTestRequest.java deleted file mode 100644 index f2dd6332e6..0000000000 --- a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/VerifyTestRequest.java +++ /dev/null @@ -1,873 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: schema/google/showcase/v1beta1/testing.proto - -package com.google.showcase.v1beta1; - -/** - * Protobuf type {@code google.showcase.v1beta1.VerifyTestRequest} - */ -public final class VerifyTestRequest extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.VerifyTestRequest) - VerifyTestRequestOrBuilder { -private static final long serialVersionUID = 0L; - // Use VerifyTestRequest.newBuilder() to construct. - private VerifyTestRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private VerifyTestRequest() { - name_ = ""; - answer_ = com.google.protobuf.ByteString.EMPTY; - answers_ = java.util.Collections.emptyList(); - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new VerifyTestRequest(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private VerifyTestRequest( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - int mutable_bitField0_ = 0; - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: { - java.lang.String s = input.readStringRequireUtf8(); - - name_ = s; - break; - } - case 18: { - - answer_ = input.readBytes(); - break; - } - case 26: { - if (!((mutable_bitField0_ & 0x00000001) != 0)) { - answers_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000001; - } - answers_.add(input.readBytes()); - break; - } - default: { - if (!parseUnknownField( - input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException( - e).setUnfinishedMessage(this); - } finally { - if (((mutable_bitField0_ & 0x00000001) != 0)) { - answers_ = java.util.Collections.unmodifiableList(answers_); // C - } - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.google.showcase.v1beta1.TestingOuterClass.internal_static_google_showcase_v1beta1_VerifyTestRequest_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.showcase.v1beta1.TestingOuterClass.internal_static_google_showcase_v1beta1_VerifyTestRequest_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.showcase.v1beta1.VerifyTestRequest.class, com.google.showcase.v1beta1.VerifyTestRequest.Builder.class); - } - - public static final int NAME_FIELD_NUMBER = 1; - private volatile java.lang.Object name_; - /** - *
        -   * The test to have an answer registered to it.
        -   * 
        - * - * string name = 1 [(.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; - } - } - /** - *
        -   * The test to have an answer registered to it.
        -   * 
        - * - * string name = 1 [(.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 ANSWER_FIELD_NUMBER = 2; - private com.google.protobuf.ByteString answer_; - /** - *
        -   * The answer from the test.
        -   * 
        - * - * bytes answer = 2; - * @return The answer. - */ - @java.lang.Override - public com.google.protobuf.ByteString getAnswer() { - return answer_; - } - - public static final int ANSWERS_FIELD_NUMBER = 3; - private java.util.List answers_; - /** - *
        -   * The answers from the test if multiple are to be checked
        -   * 
        - * - * repeated bytes answers = 3; - * @return A list containing the answers. - */ - @java.lang.Override - public java.util.List - getAnswersList() { - return answers_; - } - /** - *
        -   * The answers from the test if multiple are to be checked
        -   * 
        - * - * repeated bytes answers = 3; - * @return The count of answers. - */ - public int getAnswersCount() { - return answers_.size(); - } - /** - *
        -   * The answers from the test if multiple are to be checked
        -   * 
        - * - * repeated bytes answers = 3; - * @param index The index of the element to return. - * @return The answers at the given index. - */ - public com.google.protobuf.ByteString getAnswers(int index) { - return answers_.get(index); - } - - private byte memoizedIsInitialized = -1; - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); - } - if (!answer_.isEmpty()) { - output.writeBytes(2, answer_); - } - for (int i = 0; i < answers_.size(); i++) { - output.writeBytes(3, answers_.get(i)); - } - unknownFields.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 (!answer_.isEmpty()) { - size += com.google.protobuf.CodedOutputStream - .computeBytesSize(2, answer_); - } - { - int dataSize = 0; - for (int i = 0; i < answers_.size(); i++) { - dataSize += com.google.protobuf.CodedOutputStream - .computeBytesSizeNoTag(answers_.get(i)); - } - size += dataSize; - size += 1 * getAnswersList().size(); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof com.google.showcase.v1beta1.VerifyTestRequest)) { - return super.equals(obj); - } - com.google.showcase.v1beta1.VerifyTestRequest other = (com.google.showcase.v1beta1.VerifyTestRequest) obj; - - if (!getName() - .equals(other.getName())) return false; - if (!getAnswer() - .equals(other.getAnswer())) return false; - if (!getAnswersList() - .equals(other.getAnswersList())) return false; - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - hash = (37 * hash) + NAME_FIELD_NUMBER; - hash = (53 * hash) + getName().hashCode(); - hash = (37 * hash) + ANSWER_FIELD_NUMBER; - hash = (53 * hash) + getAnswer().hashCode(); - if (getAnswersCount() > 0) { - hash = (37 * hash) + ANSWERS_FIELD_NUMBER; - hash = (53 * hash) + getAnswersList().hashCode(); - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.showcase.v1beta1.VerifyTestRequest parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.showcase.v1beta1.VerifyTestRequest parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.showcase.v1beta1.VerifyTestRequest parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.showcase.v1beta1.VerifyTestRequest 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.showcase.v1beta1.VerifyTestRequest parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.showcase.v1beta1.VerifyTestRequest parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.showcase.v1beta1.VerifyTestRequest parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static com.google.showcase.v1beta1.VerifyTestRequest 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.showcase.v1beta1.VerifyTestRequest parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static com.google.showcase.v1beta1.VerifyTestRequest 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.showcase.v1beta1.VerifyTestRequest parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static com.google.showcase.v1beta1.VerifyTestRequest 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.showcase.v1beta1.VerifyTestRequest prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - @java.lang.Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - * Protobuf type {@code google.showcase.v1beta1.VerifyTestRequest} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.VerifyTestRequest) - com.google.showcase.v1beta1.VerifyTestRequestOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.google.showcase.v1beta1.TestingOuterClass.internal_static_google_showcase_v1beta1_VerifyTestRequest_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.showcase.v1beta1.TestingOuterClass.internal_static_google_showcase_v1beta1_VerifyTestRequest_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.showcase.v1beta1.VerifyTestRequest.class, com.google.showcase.v1beta1.VerifyTestRequest.Builder.class); - } - - // Construct using com.google.showcase.v1beta1.VerifyTestRequest.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { - } - } - @java.lang.Override - public Builder clear() { - super.clear(); - name_ = ""; - - answer_ = com.google.protobuf.ByteString.EMPTY; - - answers_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return com.google.showcase.v1beta1.TestingOuterClass.internal_static_google_showcase_v1beta1_VerifyTestRequest_descriptor; - } - - @java.lang.Override - public com.google.showcase.v1beta1.VerifyTestRequest getDefaultInstanceForType() { - return com.google.showcase.v1beta1.VerifyTestRequest.getDefaultInstance(); - } - - @java.lang.Override - public com.google.showcase.v1beta1.VerifyTestRequest build() { - com.google.showcase.v1beta1.VerifyTestRequest result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.showcase.v1beta1.VerifyTestRequest buildPartial() { - com.google.showcase.v1beta1.VerifyTestRequest result = new com.google.showcase.v1beta1.VerifyTestRequest(this); - int from_bitField0_ = bitField0_; - result.name_ = name_; - result.answer_ = answer_; - if (((bitField0_ & 0x00000001) != 0)) { - answers_ = java.util.Collections.unmodifiableList(answers_); - bitField0_ = (bitField0_ & ~0x00000001); - } - result.answers_ = answers_; - 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.showcase.v1beta1.VerifyTestRequest) { - return mergeFrom((com.google.showcase.v1beta1.VerifyTestRequest)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.showcase.v1beta1.VerifyTestRequest other) { - if (other == com.google.showcase.v1beta1.VerifyTestRequest.getDefaultInstance()) return this; - if (!other.getName().isEmpty()) { - name_ = other.name_; - onChanged(); - } - if (other.getAnswer() != com.google.protobuf.ByteString.EMPTY) { - setAnswer(other.getAnswer()); - } - if (!other.answers_.isEmpty()) { - if (answers_.isEmpty()) { - answers_ = other.answers_; - bitField0_ = (bitField0_ & ~0x00000001); - } else { - ensureAnswersIsMutable(); - answers_.addAll(other.answers_); - } - onChanged(); - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - com.google.showcase.v1beta1.VerifyTestRequest parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (com.google.showcase.v1beta1.VerifyTestRequest) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - private int bitField0_; - - private java.lang.Object name_ = ""; - /** - *
        -     * The test to have an answer registered to it.
        -     * 
        - * - * string name = 1 [(.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; - } - } - /** - *
        -     * The test to have an answer registered to it.
        -     * 
        - * - * string name = 1 [(.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; - } - } - /** - *
        -     * The test to have an answer registered to it.
        -     * 
        - * - * string name = 1 [(.google.api.resource_reference) = { ... } - * @param value The name to set. - * @return This builder for chaining. - */ - public Builder setName( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - name_ = value; - onChanged(); - return this; - } - /** - *
        -     * The test to have an answer registered to it.
        -     * 
        - * - * string name = 1 [(.google.api.resource_reference) = { ... } - * @return This builder for chaining. - */ - public Builder clearName() { - - name_ = getDefaultInstance().getName(); - onChanged(); - return this; - } - /** - *
        -     * The test to have an answer registered to it.
        -     * 
        - * - * string name = 1 [(.google.api.resource_reference) = { ... } - * @param value The bytes for name to set. - * @return This builder for chaining. - */ - public Builder setNameBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - name_ = value; - onChanged(); - return this; - } - - private com.google.protobuf.ByteString answer_ = com.google.protobuf.ByteString.EMPTY; - /** - *
        -     * The answer from the test.
        -     * 
        - * - * bytes answer = 2; - * @return The answer. - */ - @java.lang.Override - public com.google.protobuf.ByteString getAnswer() { - return answer_; - } - /** - *
        -     * The answer from the test.
        -     * 
        - * - * bytes answer = 2; - * @param value The answer to set. - * @return This builder for chaining. - */ - public Builder setAnswer(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - - answer_ = value; - onChanged(); - return this; - } - /** - *
        -     * The answer from the test.
        -     * 
        - * - * bytes answer = 2; - * @return This builder for chaining. - */ - public Builder clearAnswer() { - - answer_ = getDefaultInstance().getAnswer(); - onChanged(); - return this; - } - - private java.util.List answers_ = java.util.Collections.emptyList(); - private void ensureAnswersIsMutable() { - if (!((bitField0_ & 0x00000001) != 0)) { - answers_ = new java.util.ArrayList(answers_); - bitField0_ |= 0x00000001; - } - } - /** - *
        -     * The answers from the test if multiple are to be checked
        -     * 
        - * - * repeated bytes answers = 3; - * @return A list containing the answers. - */ - public java.util.List - getAnswersList() { - return ((bitField0_ & 0x00000001) != 0) ? - java.util.Collections.unmodifiableList(answers_) : answers_; - } - /** - *
        -     * The answers from the test if multiple are to be checked
        -     * 
        - * - * repeated bytes answers = 3; - * @return The count of answers. - */ - public int getAnswersCount() { - return answers_.size(); - } - /** - *
        -     * The answers from the test if multiple are to be checked
        -     * 
        - * - * repeated bytes answers = 3; - * @param index The index of the element to return. - * @return The answers at the given index. - */ - public com.google.protobuf.ByteString getAnswers(int index) { - return answers_.get(index); - } - /** - *
        -     * The answers from the test if multiple are to be checked
        -     * 
        - * - * repeated bytes answers = 3; - * @param index The index to set the value at. - * @param value The answers to set. - * @return This builder for chaining. - */ - public Builder setAnswers( - int index, com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - ensureAnswersIsMutable(); - answers_.set(index, value); - onChanged(); - return this; - } - /** - *
        -     * The answers from the test if multiple are to be checked
        -     * 
        - * - * repeated bytes answers = 3; - * @param value The answers to add. - * @return This builder for chaining. - */ - public Builder addAnswers(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - ensureAnswersIsMutable(); - answers_.add(value); - onChanged(); - return this; - } - /** - *
        -     * The answers from the test if multiple are to be checked
        -     * 
        - * - * repeated bytes answers = 3; - * @param values The answers to add. - * @return This builder for chaining. - */ - public Builder addAllAnswers( - java.lang.Iterable values) { - ensureAnswersIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, answers_); - onChanged(); - return this; - } - /** - *
        -     * The answers from the test if multiple are to be checked
        -     * 
        - * - * repeated bytes answers = 3; - * @return This builder for chaining. - */ - public Builder clearAnswers() { - answers_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - onChanged(); - return this; - } - @java.lang.Override - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - - // @@protoc_insertion_point(builder_scope:google.showcase.v1beta1.VerifyTestRequest) - } - - // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.VerifyTestRequest) - private static final com.google.showcase.v1beta1.VerifyTestRequest DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new com.google.showcase.v1beta1.VerifyTestRequest(); - } - - public static com.google.showcase.v1beta1.VerifyTestRequest getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public VerifyTestRequest parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new VerifyTestRequest(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public com.google.showcase.v1beta1.VerifyTestRequest getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/VerifyTestRequestOrBuilder.java b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/VerifyTestRequestOrBuilder.java deleted file mode 100644 index 5684e2d672..0000000000 --- a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/VerifyTestRequestOrBuilder.java +++ /dev/null @@ -1,68 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: schema/google/showcase/v1beta1/testing.proto - -package com.google.showcase.v1beta1; - -public interface VerifyTestRequestOrBuilder extends - // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.VerifyTestRequest) - com.google.protobuf.MessageOrBuilder { - - /** - *
        -   * The test to have an answer registered to it.
        -   * 
        - * - * string name = 1 [(.google.api.resource_reference) = { ... } - * @return The name. - */ - java.lang.String getName(); - /** - *
        -   * The test to have an answer registered to it.
        -   * 
        - * - * string name = 1 [(.google.api.resource_reference) = { ... } - * @return The bytes for name. - */ - com.google.protobuf.ByteString - getNameBytes(); - - /** - *
        -   * The answer from the test.
        -   * 
        - * - * bytes answer = 2; - * @return The answer. - */ - com.google.protobuf.ByteString getAnswer(); - - /** - *
        -   * The answers from the test if multiple are to be checked
        -   * 
        - * - * repeated bytes answers = 3; - * @return A list containing the answers. - */ - java.util.List getAnswersList(); - /** - *
        -   * The answers from the test if multiple are to be checked
        -   * 
        - * - * repeated bytes answers = 3; - * @return The count of answers. - */ - int getAnswersCount(); - /** - *
        -   * The answers from the test if multiple are to be checked
        -   * 
        - * - * repeated bytes answers = 3; - * @param index The index of the element to return. - * @return The answers at the given index. - */ - com.google.protobuf.ByteString getAnswers(int index); -} diff --git a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/VerifyTestResponse.java b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/VerifyTestResponse.java deleted file mode 100644 index d32e612271..0000000000 --- a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/VerifyTestResponse.java +++ /dev/null @@ -1,657 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: schema/google/showcase/v1beta1/testing.proto - -package com.google.showcase.v1beta1; - -/** - * Protobuf type {@code google.showcase.v1beta1.VerifyTestResponse} - */ -public final class VerifyTestResponse extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.VerifyTestResponse) - VerifyTestResponseOrBuilder { -private static final long serialVersionUID = 0L; - // Use VerifyTestResponse.newBuilder() to construct. - private VerifyTestResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private VerifyTestResponse() { - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new VerifyTestResponse(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private VerifyTestResponse( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: { - com.google.showcase.v1beta1.Issue.Builder subBuilder = null; - if (issue_ != null) { - subBuilder = issue_.toBuilder(); - } - issue_ = input.readMessage(com.google.showcase.v1beta1.Issue.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(issue_); - issue_ = subBuilder.buildPartial(); - } - - break; - } - default: { - if (!parseUnknownField( - input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException( - e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.google.showcase.v1beta1.TestingOuterClass.internal_static_google_showcase_v1beta1_VerifyTestResponse_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.showcase.v1beta1.TestingOuterClass.internal_static_google_showcase_v1beta1_VerifyTestResponse_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.showcase.v1beta1.VerifyTestResponse.class, com.google.showcase.v1beta1.VerifyTestResponse.Builder.class); - } - - public static final int ISSUE_FIELD_NUMBER = 1; - private com.google.showcase.v1beta1.Issue issue_; - /** - *
        -   * An issue if check answer was unsuccessful. This will be empty if the check answer succeeded.
        -   * 
        - * - * .google.showcase.v1beta1.Issue issue = 1; - * @return Whether the issue field is set. - */ - @java.lang.Override - public boolean hasIssue() { - return issue_ != null; - } - /** - *
        -   * An issue if check answer was unsuccessful. This will be empty if the check answer succeeded.
        -   * 
        - * - * .google.showcase.v1beta1.Issue issue = 1; - * @return The issue. - */ - @java.lang.Override - public com.google.showcase.v1beta1.Issue getIssue() { - return issue_ == null ? com.google.showcase.v1beta1.Issue.getDefaultInstance() : issue_; - } - /** - *
        -   * An issue if check answer was unsuccessful. This will be empty if the check answer succeeded.
        -   * 
        - * - * .google.showcase.v1beta1.Issue issue = 1; - */ - @java.lang.Override - public com.google.showcase.v1beta1.IssueOrBuilder getIssueOrBuilder() { - return getIssue(); - } - - 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 (issue_ != null) { - output.writeMessage(1, getIssue()); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (issue_ != null) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(1, getIssue()); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof com.google.showcase.v1beta1.VerifyTestResponse)) { - return super.equals(obj); - } - com.google.showcase.v1beta1.VerifyTestResponse other = (com.google.showcase.v1beta1.VerifyTestResponse) obj; - - if (hasIssue() != other.hasIssue()) return false; - if (hasIssue()) { - if (!getIssue() - .equals(other.getIssue())) return false; - } - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - if (hasIssue()) { - hash = (37 * hash) + ISSUE_FIELD_NUMBER; - hash = (53 * hash) + getIssue().hashCode(); - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.showcase.v1beta1.VerifyTestResponse parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.showcase.v1beta1.VerifyTestResponse parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.showcase.v1beta1.VerifyTestResponse parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.showcase.v1beta1.VerifyTestResponse 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.showcase.v1beta1.VerifyTestResponse parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.showcase.v1beta1.VerifyTestResponse parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.showcase.v1beta1.VerifyTestResponse parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static com.google.showcase.v1beta1.VerifyTestResponse 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.showcase.v1beta1.VerifyTestResponse parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static com.google.showcase.v1beta1.VerifyTestResponse 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.showcase.v1beta1.VerifyTestResponse parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static com.google.showcase.v1beta1.VerifyTestResponse 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.showcase.v1beta1.VerifyTestResponse prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - @java.lang.Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - * Protobuf type {@code google.showcase.v1beta1.VerifyTestResponse} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.VerifyTestResponse) - com.google.showcase.v1beta1.VerifyTestResponseOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.google.showcase.v1beta1.TestingOuterClass.internal_static_google_showcase_v1beta1_VerifyTestResponse_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.showcase.v1beta1.TestingOuterClass.internal_static_google_showcase_v1beta1_VerifyTestResponse_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.showcase.v1beta1.VerifyTestResponse.class, com.google.showcase.v1beta1.VerifyTestResponse.Builder.class); - } - - // Construct using com.google.showcase.v1beta1.VerifyTestResponse.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { - } - } - @java.lang.Override - public Builder clear() { - super.clear(); - if (issueBuilder_ == null) { - issue_ = null; - } else { - issue_ = null; - issueBuilder_ = null; - } - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return com.google.showcase.v1beta1.TestingOuterClass.internal_static_google_showcase_v1beta1_VerifyTestResponse_descriptor; - } - - @java.lang.Override - public com.google.showcase.v1beta1.VerifyTestResponse getDefaultInstanceForType() { - return com.google.showcase.v1beta1.VerifyTestResponse.getDefaultInstance(); - } - - @java.lang.Override - public com.google.showcase.v1beta1.VerifyTestResponse build() { - com.google.showcase.v1beta1.VerifyTestResponse result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.showcase.v1beta1.VerifyTestResponse buildPartial() { - com.google.showcase.v1beta1.VerifyTestResponse result = new com.google.showcase.v1beta1.VerifyTestResponse(this); - if (issueBuilder_ == null) { - result.issue_ = issue_; - } else { - result.issue_ = issueBuilder_.build(); - } - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.setField(field, value); - } - @java.lang.Override - public Builder clearField( - com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - @java.lang.Override - public Builder clearOneof( - com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.addRepeatedField(field, value); - } - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof com.google.showcase.v1beta1.VerifyTestResponse) { - return mergeFrom((com.google.showcase.v1beta1.VerifyTestResponse)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.showcase.v1beta1.VerifyTestResponse other) { - if (other == com.google.showcase.v1beta1.VerifyTestResponse.getDefaultInstance()) return this; - if (other.hasIssue()) { - mergeIssue(other.getIssue()); - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - com.google.showcase.v1beta1.VerifyTestResponse parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (com.google.showcase.v1beta1.VerifyTestResponse) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private com.google.showcase.v1beta1.Issue issue_; - private com.google.protobuf.SingleFieldBuilderV3< - com.google.showcase.v1beta1.Issue, com.google.showcase.v1beta1.Issue.Builder, com.google.showcase.v1beta1.IssueOrBuilder> issueBuilder_; - /** - *
        -     * An issue if check answer was unsuccessful. This will be empty if the check answer succeeded.
        -     * 
        - * - * .google.showcase.v1beta1.Issue issue = 1; - * @return Whether the issue field is set. - */ - public boolean hasIssue() { - return issueBuilder_ != null || issue_ != null; - } - /** - *
        -     * An issue if check answer was unsuccessful. This will be empty if the check answer succeeded.
        -     * 
        - * - * .google.showcase.v1beta1.Issue issue = 1; - * @return The issue. - */ - public com.google.showcase.v1beta1.Issue getIssue() { - if (issueBuilder_ == null) { - return issue_ == null ? com.google.showcase.v1beta1.Issue.getDefaultInstance() : issue_; - } else { - return issueBuilder_.getMessage(); - } - } - /** - *
        -     * An issue if check answer was unsuccessful. This will be empty if the check answer succeeded.
        -     * 
        - * - * .google.showcase.v1beta1.Issue issue = 1; - */ - public Builder setIssue(com.google.showcase.v1beta1.Issue value) { - if (issueBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - issue_ = value; - onChanged(); - } else { - issueBuilder_.setMessage(value); - } - - return this; - } - /** - *
        -     * An issue if check answer was unsuccessful. This will be empty if the check answer succeeded.
        -     * 
        - * - * .google.showcase.v1beta1.Issue issue = 1; - */ - public Builder setIssue( - com.google.showcase.v1beta1.Issue.Builder builderForValue) { - if (issueBuilder_ == null) { - issue_ = builderForValue.build(); - onChanged(); - } else { - issueBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - *
        -     * An issue if check answer was unsuccessful. This will be empty if the check answer succeeded.
        -     * 
        - * - * .google.showcase.v1beta1.Issue issue = 1; - */ - public Builder mergeIssue(com.google.showcase.v1beta1.Issue value) { - if (issueBuilder_ == null) { - if (issue_ != null) { - issue_ = - com.google.showcase.v1beta1.Issue.newBuilder(issue_).mergeFrom(value).buildPartial(); - } else { - issue_ = value; - } - onChanged(); - } else { - issueBuilder_.mergeFrom(value); - } - - return this; - } - /** - *
        -     * An issue if check answer was unsuccessful. This will be empty if the check answer succeeded.
        -     * 
        - * - * .google.showcase.v1beta1.Issue issue = 1; - */ - public Builder clearIssue() { - if (issueBuilder_ == null) { - issue_ = null; - onChanged(); - } else { - issue_ = null; - issueBuilder_ = null; - } - - return this; - } - /** - *
        -     * An issue if check answer was unsuccessful. This will be empty if the check answer succeeded.
        -     * 
        - * - * .google.showcase.v1beta1.Issue issue = 1; - */ - public com.google.showcase.v1beta1.Issue.Builder getIssueBuilder() { - - onChanged(); - return getIssueFieldBuilder().getBuilder(); - } - /** - *
        -     * An issue if check answer was unsuccessful. This will be empty if the check answer succeeded.
        -     * 
        - * - * .google.showcase.v1beta1.Issue issue = 1; - */ - public com.google.showcase.v1beta1.IssueOrBuilder getIssueOrBuilder() { - if (issueBuilder_ != null) { - return issueBuilder_.getMessageOrBuilder(); - } else { - return issue_ == null ? - com.google.showcase.v1beta1.Issue.getDefaultInstance() : issue_; - } - } - /** - *
        -     * An issue if check answer was unsuccessful. This will be empty if the check answer succeeded.
        -     * 
        - * - * .google.showcase.v1beta1.Issue issue = 1; - */ - private com.google.protobuf.SingleFieldBuilderV3< - com.google.showcase.v1beta1.Issue, com.google.showcase.v1beta1.Issue.Builder, com.google.showcase.v1beta1.IssueOrBuilder> - getIssueFieldBuilder() { - if (issueBuilder_ == null) { - issueBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - com.google.showcase.v1beta1.Issue, com.google.showcase.v1beta1.Issue.Builder, com.google.showcase.v1beta1.IssueOrBuilder>( - getIssue(), - getParentForChildren(), - isClean()); - issue_ = null; - } - return issueBuilder_; - } - @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.showcase.v1beta1.VerifyTestResponse) - } - - // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.VerifyTestResponse) - private static final com.google.showcase.v1beta1.VerifyTestResponse DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new com.google.showcase.v1beta1.VerifyTestResponse(); - } - - public static com.google.showcase.v1beta1.VerifyTestResponse getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public VerifyTestResponse parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new VerifyTestResponse(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public com.google.showcase.v1beta1.VerifyTestResponse getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/VerifyTestResponseOrBuilder.java b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/VerifyTestResponseOrBuilder.java deleted file mode 100644 index 60f479d81e..0000000000 --- a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/VerifyTestResponseOrBuilder.java +++ /dev/null @@ -1,36 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: schema/google/showcase/v1beta1/testing.proto - -package com.google.showcase.v1beta1; - -public interface VerifyTestResponseOrBuilder extends - // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.VerifyTestResponse) - com.google.protobuf.MessageOrBuilder { - - /** - *
        -   * An issue if check answer was unsuccessful. This will be empty if the check answer succeeded.
        -   * 
        - * - * .google.showcase.v1beta1.Issue issue = 1; - * @return Whether the issue field is set. - */ - boolean hasIssue(); - /** - *
        -   * An issue if check answer was unsuccessful. This will be empty if the check answer succeeded.
        -   * 
        - * - * .google.showcase.v1beta1.Issue issue = 1; - * @return The issue. - */ - com.google.showcase.v1beta1.Issue getIssue(); - /** - *
        -   * An issue if check answer was unsuccessful. This will be empty if the check answer succeeded.
        -   * 
        - * - * .google.showcase.v1beta1.Issue issue = 1; - */ - com.google.showcase.v1beta1.IssueOrBuilder getIssueOrBuilder(); -} diff --git a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/WaitMetadata.java b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/WaitMetadata.java deleted file mode 100644 index 260e24d7b6..0000000000 --- a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/WaitMetadata.java +++ /dev/null @@ -1,665 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: schema/google/showcase/v1beta1/echo.proto - -package com.google.showcase.v1beta1; - -/** - *
        - * The metadata for Wait operation.
        - * 
        - * - * Protobuf type {@code google.showcase.v1beta1.WaitMetadata} - */ -public final class WaitMetadata extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.WaitMetadata) - WaitMetadataOrBuilder { -private static final long serialVersionUID = 0L; - // Use WaitMetadata.newBuilder() to construct. - private WaitMetadata(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private WaitMetadata() { - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new WaitMetadata(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private WaitMetadata( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: { - com.google.protobuf.Timestamp.Builder subBuilder = null; - if (endTime_ != null) { - subBuilder = endTime_.toBuilder(); - } - endTime_ = input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(endTime_); - endTime_ = subBuilder.buildPartial(); - } - - break; - } - default: { - if (!parseUnknownField( - input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException( - e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.google.showcase.v1beta1.EchoOuterClass.internal_static_google_showcase_v1beta1_WaitMetadata_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.showcase.v1beta1.EchoOuterClass.internal_static_google_showcase_v1beta1_WaitMetadata_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.showcase.v1beta1.WaitMetadata.class, com.google.showcase.v1beta1.WaitMetadata.Builder.class); - } - - public static final int END_TIME_FIELD_NUMBER = 1; - private com.google.protobuf.Timestamp endTime_; - /** - *
        -   * The time that this operation will complete.
        -   * 
        - * - * .google.protobuf.Timestamp end_time = 1; - * @return Whether the endTime field is set. - */ - @java.lang.Override - public boolean hasEndTime() { - return endTime_ != null; - } - /** - *
        -   * The time that this operation will complete.
        -   * 
        - * - * .google.protobuf.Timestamp end_time = 1; - * @return The endTime. - */ - @java.lang.Override - public com.google.protobuf.Timestamp getEndTime() { - return endTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : endTime_; - } - /** - *
        -   * The time that this operation will complete.
        -   * 
        - * - * .google.protobuf.Timestamp end_time = 1; - */ - @java.lang.Override - public com.google.protobuf.TimestampOrBuilder getEndTimeOrBuilder() { - return getEndTime(); - } - - 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 (endTime_ != null) { - output.writeMessage(1, getEndTime()); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (endTime_ != null) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(1, getEndTime()); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof com.google.showcase.v1beta1.WaitMetadata)) { - return super.equals(obj); - } - com.google.showcase.v1beta1.WaitMetadata other = (com.google.showcase.v1beta1.WaitMetadata) obj; - - if (hasEndTime() != other.hasEndTime()) return false; - if (hasEndTime()) { - if (!getEndTime() - .equals(other.getEndTime())) return false; - } - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - if (hasEndTime()) { - hash = (37 * hash) + END_TIME_FIELD_NUMBER; - hash = (53 * hash) + getEndTime().hashCode(); - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.showcase.v1beta1.WaitMetadata parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.showcase.v1beta1.WaitMetadata parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.showcase.v1beta1.WaitMetadata parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.showcase.v1beta1.WaitMetadata 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.showcase.v1beta1.WaitMetadata parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.showcase.v1beta1.WaitMetadata parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.showcase.v1beta1.WaitMetadata parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static com.google.showcase.v1beta1.WaitMetadata 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.showcase.v1beta1.WaitMetadata parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static com.google.showcase.v1beta1.WaitMetadata 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.showcase.v1beta1.WaitMetadata parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static com.google.showcase.v1beta1.WaitMetadata 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.showcase.v1beta1.WaitMetadata 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 metadata for Wait operation.
        -   * 
        - * - * Protobuf type {@code google.showcase.v1beta1.WaitMetadata} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.WaitMetadata) - com.google.showcase.v1beta1.WaitMetadataOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.google.showcase.v1beta1.EchoOuterClass.internal_static_google_showcase_v1beta1_WaitMetadata_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.showcase.v1beta1.EchoOuterClass.internal_static_google_showcase_v1beta1_WaitMetadata_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.showcase.v1beta1.WaitMetadata.class, com.google.showcase.v1beta1.WaitMetadata.Builder.class); - } - - // Construct using com.google.showcase.v1beta1.WaitMetadata.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { - } - } - @java.lang.Override - public Builder clear() { - super.clear(); - if (endTimeBuilder_ == null) { - endTime_ = null; - } else { - endTime_ = null; - endTimeBuilder_ = null; - } - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return com.google.showcase.v1beta1.EchoOuterClass.internal_static_google_showcase_v1beta1_WaitMetadata_descriptor; - } - - @java.lang.Override - public com.google.showcase.v1beta1.WaitMetadata getDefaultInstanceForType() { - return com.google.showcase.v1beta1.WaitMetadata.getDefaultInstance(); - } - - @java.lang.Override - public com.google.showcase.v1beta1.WaitMetadata build() { - com.google.showcase.v1beta1.WaitMetadata result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.showcase.v1beta1.WaitMetadata buildPartial() { - com.google.showcase.v1beta1.WaitMetadata result = new com.google.showcase.v1beta1.WaitMetadata(this); - if (endTimeBuilder_ == null) { - result.endTime_ = endTime_; - } else { - result.endTime_ = endTimeBuilder_.build(); - } - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.setField(field, value); - } - @java.lang.Override - public Builder clearField( - com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - @java.lang.Override - public Builder clearOneof( - com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.addRepeatedField(field, value); - } - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof com.google.showcase.v1beta1.WaitMetadata) { - return mergeFrom((com.google.showcase.v1beta1.WaitMetadata)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.showcase.v1beta1.WaitMetadata other) { - if (other == com.google.showcase.v1beta1.WaitMetadata.getDefaultInstance()) return this; - if (other.hasEndTime()) { - mergeEndTime(other.getEndTime()); - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - com.google.showcase.v1beta1.WaitMetadata parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (com.google.showcase.v1beta1.WaitMetadata) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - 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 time that this operation will complete.
        -     * 
        - * - * .google.protobuf.Timestamp end_time = 1; - * @return Whether the endTime field is set. - */ - public boolean hasEndTime() { - return endTimeBuilder_ != null || endTime_ != null; - } - /** - *
        -     * The time that this operation will complete.
        -     * 
        - * - * .google.protobuf.Timestamp end_time = 1; - * @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 time that this operation will complete.
        -     * 
        - * - * .google.protobuf.Timestamp end_time = 1; - */ - public Builder setEndTime(com.google.protobuf.Timestamp value) { - if (endTimeBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - endTime_ = value; - onChanged(); - } else { - endTimeBuilder_.setMessage(value); - } - - return this; - } - /** - *
        -     * The time that this operation will complete.
        -     * 
        - * - * .google.protobuf.Timestamp end_time = 1; - */ - public Builder setEndTime( - com.google.protobuf.Timestamp.Builder builderForValue) { - if (endTimeBuilder_ == null) { - endTime_ = builderForValue.build(); - onChanged(); - } else { - endTimeBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - *
        -     * The time that this operation will complete.
        -     * 
        - * - * .google.protobuf.Timestamp end_time = 1; - */ - public Builder mergeEndTime(com.google.protobuf.Timestamp value) { - if (endTimeBuilder_ == null) { - if (endTime_ != null) { - endTime_ = - com.google.protobuf.Timestamp.newBuilder(endTime_).mergeFrom(value).buildPartial(); - } else { - endTime_ = value; - } - onChanged(); - } else { - endTimeBuilder_.mergeFrom(value); - } - - return this; - } - /** - *
        -     * The time that this operation will complete.
        -     * 
        - * - * .google.protobuf.Timestamp end_time = 1; - */ - public Builder clearEndTime() { - if (endTimeBuilder_ == null) { - endTime_ = null; - onChanged(); - } else { - endTime_ = null; - endTimeBuilder_ = null; - } - - return this; - } - /** - *
        -     * The time that this operation will complete.
        -     * 
        - * - * .google.protobuf.Timestamp end_time = 1; - */ - public com.google.protobuf.Timestamp.Builder getEndTimeBuilder() { - - onChanged(); - return getEndTimeFieldBuilder().getBuilder(); - } - /** - *
        -     * The time that this operation will complete.
        -     * 
        - * - * .google.protobuf.Timestamp end_time = 1; - */ - public com.google.protobuf.TimestampOrBuilder getEndTimeOrBuilder() { - if (endTimeBuilder_ != null) { - return endTimeBuilder_.getMessageOrBuilder(); - } else { - return endTime_ == null ? - com.google.protobuf.Timestamp.getDefaultInstance() : endTime_; - } - } - /** - *
        -     * The time that this operation will complete.
        -     * 
        - * - * .google.protobuf.Timestamp end_time = 1; - */ - 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_; - } - @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.showcase.v1beta1.WaitMetadata) - } - - // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.WaitMetadata) - private static final com.google.showcase.v1beta1.WaitMetadata DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new com.google.showcase.v1beta1.WaitMetadata(); - } - - public static com.google.showcase.v1beta1.WaitMetadata getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public WaitMetadata parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new WaitMetadata(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public com.google.showcase.v1beta1.WaitMetadata getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/WaitMetadataOrBuilder.java b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/WaitMetadataOrBuilder.java deleted file mode 100644 index c672abe3f4..0000000000 --- a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/WaitMetadataOrBuilder.java +++ /dev/null @@ -1,36 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: schema/google/showcase/v1beta1/echo.proto - -package com.google.showcase.v1beta1; - -public interface WaitMetadataOrBuilder extends - // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.WaitMetadata) - com.google.protobuf.MessageOrBuilder { - - /** - *
        -   * The time that this operation will complete.
        -   * 
        - * - * .google.protobuf.Timestamp end_time = 1; - * @return Whether the endTime field is set. - */ - boolean hasEndTime(); - /** - *
        -   * The time that this operation will complete.
        -   * 
        - * - * .google.protobuf.Timestamp end_time = 1; - * @return The endTime. - */ - com.google.protobuf.Timestamp getEndTime(); - /** - *
        -   * The time that this operation will complete.
        -   * 
        - * - * .google.protobuf.Timestamp end_time = 1; - */ - com.google.protobuf.TimestampOrBuilder getEndTimeOrBuilder(); -} diff --git a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/WaitRequest.java b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/WaitRequest.java deleted file mode 100644 index 97d4d2413c..0000000000 --- a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/WaitRequest.java +++ /dev/null @@ -1,1631 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: schema/google/showcase/v1beta1/echo.proto - -package com.google.showcase.v1beta1; - -/** - *
        - * The request for Wait method.
        - * 
        - * - * Protobuf type {@code google.showcase.v1beta1.WaitRequest} - */ -public final class WaitRequest extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.WaitRequest) - WaitRequestOrBuilder { -private static final long serialVersionUID = 0L; - // Use WaitRequest.newBuilder() to construct. - private WaitRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private WaitRequest() { - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new WaitRequest(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private WaitRequest( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: { - com.google.protobuf.Timestamp.Builder subBuilder = null; - if (endCase_ == 1) { - subBuilder = ((com.google.protobuf.Timestamp) end_).toBuilder(); - } - end_ = - input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom((com.google.protobuf.Timestamp) end_); - end_ = subBuilder.buildPartial(); - } - endCase_ = 1; - break; - } - case 18: { - com.google.rpc.Status.Builder subBuilder = null; - if (responseCase_ == 2) { - subBuilder = ((com.google.rpc.Status) response_).toBuilder(); - } - response_ = - input.readMessage(com.google.rpc.Status.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom((com.google.rpc.Status) response_); - response_ = subBuilder.buildPartial(); - } - responseCase_ = 2; - break; - } - case 26: { - com.google.showcase.v1beta1.WaitResponse.Builder subBuilder = null; - if (responseCase_ == 3) { - subBuilder = ((com.google.showcase.v1beta1.WaitResponse) response_).toBuilder(); - } - response_ = - input.readMessage(com.google.showcase.v1beta1.WaitResponse.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom((com.google.showcase.v1beta1.WaitResponse) response_); - response_ = subBuilder.buildPartial(); - } - responseCase_ = 3; - break; - } - case 34: { - com.google.protobuf.Duration.Builder subBuilder = null; - if (endCase_ == 4) { - subBuilder = ((com.google.protobuf.Duration) end_).toBuilder(); - } - end_ = - input.readMessage(com.google.protobuf.Duration.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom((com.google.protobuf.Duration) end_); - end_ = subBuilder.buildPartial(); - } - endCase_ = 4; - break; - } - default: { - if (!parseUnknownField( - input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException( - e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.google.showcase.v1beta1.EchoOuterClass.internal_static_google_showcase_v1beta1_WaitRequest_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.showcase.v1beta1.EchoOuterClass.internal_static_google_showcase_v1beta1_WaitRequest_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.showcase.v1beta1.WaitRequest.class, com.google.showcase.v1beta1.WaitRequest.Builder.class); - } - - private int endCase_ = 0; - private java.lang.Object end_; - public enum EndCase - implements com.google.protobuf.Internal.EnumLite, - com.google.protobuf.AbstractMessage.InternalOneOfEnum { - END_TIME(1), - TTL(4), - END_NOT_SET(0); - private final int value; - private EndCase(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 EndCase valueOf(int value) { - return forNumber(value); - } - - public static EndCase forNumber(int value) { - switch (value) { - case 1: return END_TIME; - case 4: return TTL; - case 0: return END_NOT_SET; - default: return null; - } - } - public int getNumber() { - return this.value; - } - }; - - public EndCase - getEndCase() { - return EndCase.forNumber( - endCase_); - } - - private int responseCase_ = 0; - private java.lang.Object response_; - public enum ResponseCase - implements com.google.protobuf.Internal.EnumLite, - com.google.protobuf.AbstractMessage.InternalOneOfEnum { - ERROR(2), - SUCCESS(3), - RESPONSE_NOT_SET(0); - private final int value; - private ResponseCase(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 ResponseCase valueOf(int value) { - return forNumber(value); - } - - public static ResponseCase forNumber(int value) { - switch (value) { - case 2: return ERROR; - case 3: return SUCCESS; - case 0: return RESPONSE_NOT_SET; - default: return null; - } - } - public int getNumber() { - return this.value; - } - }; - - public ResponseCase - getResponseCase() { - return ResponseCase.forNumber( - responseCase_); - } - - public static final int END_TIME_FIELD_NUMBER = 1; - /** - *
        -   * The time that this operation will complete.
        -   * 
        - * - * .google.protobuf.Timestamp end_time = 1; - * @return Whether the endTime field is set. - */ - @java.lang.Override - public boolean hasEndTime() { - return endCase_ == 1; - } - /** - *
        -   * The time that this operation will complete.
        -   * 
        - * - * .google.protobuf.Timestamp end_time = 1; - * @return The endTime. - */ - @java.lang.Override - public com.google.protobuf.Timestamp getEndTime() { - if (endCase_ == 1) { - return (com.google.protobuf.Timestamp) end_; - } - return com.google.protobuf.Timestamp.getDefaultInstance(); - } - /** - *
        -   * The time that this operation will complete.
        -   * 
        - * - * .google.protobuf.Timestamp end_time = 1; - */ - @java.lang.Override - public com.google.protobuf.TimestampOrBuilder getEndTimeOrBuilder() { - if (endCase_ == 1) { - return (com.google.protobuf.Timestamp) end_; - } - return com.google.protobuf.Timestamp.getDefaultInstance(); - } - - public static final int TTL_FIELD_NUMBER = 4; - /** - *
        -   * The duration of this operation.
        -   * 
        - * - * .google.protobuf.Duration ttl = 4; - * @return Whether the ttl field is set. - */ - @java.lang.Override - public boolean hasTtl() { - return endCase_ == 4; - } - /** - *
        -   * The duration of this operation.
        -   * 
        - * - * .google.protobuf.Duration ttl = 4; - * @return The ttl. - */ - @java.lang.Override - public com.google.protobuf.Duration getTtl() { - if (endCase_ == 4) { - return (com.google.protobuf.Duration) end_; - } - return com.google.protobuf.Duration.getDefaultInstance(); - } - /** - *
        -   * The duration of this operation.
        -   * 
        - * - * .google.protobuf.Duration ttl = 4; - */ - @java.lang.Override - public com.google.protobuf.DurationOrBuilder getTtlOrBuilder() { - if (endCase_ == 4) { - return (com.google.protobuf.Duration) end_; - } - return com.google.protobuf.Duration.getDefaultInstance(); - } - - public static final int ERROR_FIELD_NUMBER = 2; - /** - *
        -   * The error that will be returned by the server. If this code is specified
        -   * to be the OK rpc code, an empty response will be returned.
        -   * 
        - * - * .google.rpc.Status error = 2; - * @return Whether the error field is set. - */ - @java.lang.Override - public boolean hasError() { - return responseCase_ == 2; - } - /** - *
        -   * The error that will be returned by the server. If this code is specified
        -   * to be the OK rpc code, an empty response will be returned.
        -   * 
        - * - * .google.rpc.Status error = 2; - * @return The error. - */ - @java.lang.Override - public com.google.rpc.Status getError() { - if (responseCase_ == 2) { - return (com.google.rpc.Status) response_; - } - return com.google.rpc.Status.getDefaultInstance(); - } - /** - *
        -   * The error that will be returned by the server. If this code is specified
        -   * to be the OK rpc code, an empty response will be returned.
        -   * 
        - * - * .google.rpc.Status error = 2; - */ - @java.lang.Override - public com.google.rpc.StatusOrBuilder getErrorOrBuilder() { - if (responseCase_ == 2) { - return (com.google.rpc.Status) response_; - } - return com.google.rpc.Status.getDefaultInstance(); - } - - public static final int SUCCESS_FIELD_NUMBER = 3; - /** - *
        -   * The response to be returned on operation completion.
        -   * 
        - * - * .google.showcase.v1beta1.WaitResponse success = 3; - * @return Whether the success field is set. - */ - @java.lang.Override - public boolean hasSuccess() { - return responseCase_ == 3; - } - /** - *
        -   * The response to be returned on operation completion.
        -   * 
        - * - * .google.showcase.v1beta1.WaitResponse success = 3; - * @return The success. - */ - @java.lang.Override - public com.google.showcase.v1beta1.WaitResponse getSuccess() { - if (responseCase_ == 3) { - return (com.google.showcase.v1beta1.WaitResponse) response_; - } - return com.google.showcase.v1beta1.WaitResponse.getDefaultInstance(); - } - /** - *
        -   * The response to be returned on operation completion.
        -   * 
        - * - * .google.showcase.v1beta1.WaitResponse success = 3; - */ - @java.lang.Override - public com.google.showcase.v1beta1.WaitResponseOrBuilder getSuccessOrBuilder() { - if (responseCase_ == 3) { - return (com.google.showcase.v1beta1.WaitResponse) response_; - } - return com.google.showcase.v1beta1.WaitResponse.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 (endCase_ == 1) { - output.writeMessage(1, (com.google.protobuf.Timestamp) end_); - } - if (responseCase_ == 2) { - output.writeMessage(2, (com.google.rpc.Status) response_); - } - if (responseCase_ == 3) { - output.writeMessage(3, (com.google.showcase.v1beta1.WaitResponse) response_); - } - if (endCase_ == 4) { - output.writeMessage(4, (com.google.protobuf.Duration) end_); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (endCase_ == 1) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(1, (com.google.protobuf.Timestamp) end_); - } - if (responseCase_ == 2) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(2, (com.google.rpc.Status) response_); - } - if (responseCase_ == 3) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(3, (com.google.showcase.v1beta1.WaitResponse) response_); - } - if (endCase_ == 4) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(4, (com.google.protobuf.Duration) end_); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof com.google.showcase.v1beta1.WaitRequest)) { - return super.equals(obj); - } - com.google.showcase.v1beta1.WaitRequest other = (com.google.showcase.v1beta1.WaitRequest) obj; - - if (!getEndCase().equals(other.getEndCase())) return false; - switch (endCase_) { - case 1: - if (!getEndTime() - .equals(other.getEndTime())) return false; - break; - case 4: - if (!getTtl() - .equals(other.getTtl())) return false; - break; - case 0: - default: - } - if (!getResponseCase().equals(other.getResponseCase())) return false; - switch (responseCase_) { - case 2: - if (!getError() - .equals(other.getError())) return false; - break; - case 3: - if (!getSuccess() - .equals(other.getSuccess())) return false; - break; - case 0: - default: - } - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - switch (endCase_) { - case 1: - hash = (37 * hash) + END_TIME_FIELD_NUMBER; - hash = (53 * hash) + getEndTime().hashCode(); - break; - case 4: - hash = (37 * hash) + TTL_FIELD_NUMBER; - hash = (53 * hash) + getTtl().hashCode(); - break; - case 0: - default: - } - switch (responseCase_) { - case 2: - hash = (37 * hash) + ERROR_FIELD_NUMBER; - hash = (53 * hash) + getError().hashCode(); - break; - case 3: - hash = (37 * hash) + SUCCESS_FIELD_NUMBER; - hash = (53 * hash) + getSuccess().hashCode(); - break; - case 0: - default: - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.showcase.v1beta1.WaitRequest parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.showcase.v1beta1.WaitRequest parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.showcase.v1beta1.WaitRequest parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.showcase.v1beta1.WaitRequest 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.showcase.v1beta1.WaitRequest parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.showcase.v1beta1.WaitRequest parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.showcase.v1beta1.WaitRequest parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static com.google.showcase.v1beta1.WaitRequest 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.showcase.v1beta1.WaitRequest parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static com.google.showcase.v1beta1.WaitRequest 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.showcase.v1beta1.WaitRequest parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static com.google.showcase.v1beta1.WaitRequest 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.showcase.v1beta1.WaitRequest 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 request for Wait method.
        -   * 
        - * - * Protobuf type {@code google.showcase.v1beta1.WaitRequest} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.WaitRequest) - com.google.showcase.v1beta1.WaitRequestOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.google.showcase.v1beta1.EchoOuterClass.internal_static_google_showcase_v1beta1_WaitRequest_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.showcase.v1beta1.EchoOuterClass.internal_static_google_showcase_v1beta1_WaitRequest_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.showcase.v1beta1.WaitRequest.class, com.google.showcase.v1beta1.WaitRequest.Builder.class); - } - - // Construct using com.google.showcase.v1beta1.WaitRequest.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { - } - } - @java.lang.Override - public Builder clear() { - super.clear(); - endCase_ = 0; - end_ = null; - responseCase_ = 0; - response_ = null; - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return com.google.showcase.v1beta1.EchoOuterClass.internal_static_google_showcase_v1beta1_WaitRequest_descriptor; - } - - @java.lang.Override - public com.google.showcase.v1beta1.WaitRequest getDefaultInstanceForType() { - return com.google.showcase.v1beta1.WaitRequest.getDefaultInstance(); - } - - @java.lang.Override - public com.google.showcase.v1beta1.WaitRequest build() { - com.google.showcase.v1beta1.WaitRequest result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.showcase.v1beta1.WaitRequest buildPartial() { - com.google.showcase.v1beta1.WaitRequest result = new com.google.showcase.v1beta1.WaitRequest(this); - if (endCase_ == 1) { - if (endTimeBuilder_ == null) { - result.end_ = end_; - } else { - result.end_ = endTimeBuilder_.build(); - } - } - if (endCase_ == 4) { - if (ttlBuilder_ == null) { - result.end_ = end_; - } else { - result.end_ = ttlBuilder_.build(); - } - } - if (responseCase_ == 2) { - if (errorBuilder_ == null) { - result.response_ = response_; - } else { - result.response_ = errorBuilder_.build(); - } - } - if (responseCase_ == 3) { - if (successBuilder_ == null) { - result.response_ = response_; - } else { - result.response_ = successBuilder_.build(); - } - } - result.endCase_ = endCase_; - result.responseCase_ = responseCase_; - 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.showcase.v1beta1.WaitRequest) { - return mergeFrom((com.google.showcase.v1beta1.WaitRequest)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.showcase.v1beta1.WaitRequest other) { - if (other == com.google.showcase.v1beta1.WaitRequest.getDefaultInstance()) return this; - switch (other.getEndCase()) { - case END_TIME: { - mergeEndTime(other.getEndTime()); - break; - } - case TTL: { - mergeTtl(other.getTtl()); - break; - } - case END_NOT_SET: { - break; - } - } - switch (other.getResponseCase()) { - case ERROR: { - mergeError(other.getError()); - break; - } - case SUCCESS: { - mergeSuccess(other.getSuccess()); - break; - } - case RESPONSE_NOT_SET: { - break; - } - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - com.google.showcase.v1beta1.WaitRequest parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (com.google.showcase.v1beta1.WaitRequest) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - private int endCase_ = 0; - private java.lang.Object end_; - public EndCase - getEndCase() { - return EndCase.forNumber( - endCase_); - } - - public Builder clearEnd() { - endCase_ = 0; - end_ = null; - onChanged(); - return this; - } - - private int responseCase_ = 0; - private java.lang.Object response_; - public ResponseCase - getResponseCase() { - return ResponseCase.forNumber( - responseCase_); - } - - public Builder clearResponse() { - responseCase_ = 0; - response_ = null; - onChanged(); - return this; - } - - - private com.google.protobuf.SingleFieldBuilderV3< - com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder> endTimeBuilder_; - /** - *
        -     * The time that this operation will complete.
        -     * 
        - * - * .google.protobuf.Timestamp end_time = 1; - * @return Whether the endTime field is set. - */ - @java.lang.Override - public boolean hasEndTime() { - return endCase_ == 1; - } - /** - *
        -     * The time that this operation will complete.
        -     * 
        - * - * .google.protobuf.Timestamp end_time = 1; - * @return The endTime. - */ - @java.lang.Override - public com.google.protobuf.Timestamp getEndTime() { - if (endTimeBuilder_ == null) { - if (endCase_ == 1) { - return (com.google.protobuf.Timestamp) end_; - } - return com.google.protobuf.Timestamp.getDefaultInstance(); - } else { - if (endCase_ == 1) { - return endTimeBuilder_.getMessage(); - } - return com.google.protobuf.Timestamp.getDefaultInstance(); - } - } - /** - *
        -     * The time that this operation will complete.
        -     * 
        - * - * .google.protobuf.Timestamp end_time = 1; - */ - public Builder setEndTime(com.google.protobuf.Timestamp value) { - if (endTimeBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - end_ = value; - onChanged(); - } else { - endTimeBuilder_.setMessage(value); - } - endCase_ = 1; - return this; - } - /** - *
        -     * The time that this operation will complete.
        -     * 
        - * - * .google.protobuf.Timestamp end_time = 1; - */ - public Builder setEndTime( - com.google.protobuf.Timestamp.Builder builderForValue) { - if (endTimeBuilder_ == null) { - end_ = builderForValue.build(); - onChanged(); - } else { - endTimeBuilder_.setMessage(builderForValue.build()); - } - endCase_ = 1; - return this; - } - /** - *
        -     * The time that this operation will complete.
        -     * 
        - * - * .google.protobuf.Timestamp end_time = 1; - */ - public Builder mergeEndTime(com.google.protobuf.Timestamp value) { - if (endTimeBuilder_ == null) { - if (endCase_ == 1 && - end_ != com.google.protobuf.Timestamp.getDefaultInstance()) { - end_ = com.google.protobuf.Timestamp.newBuilder((com.google.protobuf.Timestamp) end_) - .mergeFrom(value).buildPartial(); - } else { - end_ = value; - } - onChanged(); - } else { - if (endCase_ == 1) { - endTimeBuilder_.mergeFrom(value); - } else { - endTimeBuilder_.setMessage(value); - } - } - endCase_ = 1; - return this; - } - /** - *
        -     * The time that this operation will complete.
        -     * 
        - * - * .google.protobuf.Timestamp end_time = 1; - */ - public Builder clearEndTime() { - if (endTimeBuilder_ == null) { - if (endCase_ == 1) { - endCase_ = 0; - end_ = null; - onChanged(); - } - } else { - if (endCase_ == 1) { - endCase_ = 0; - end_ = null; - } - endTimeBuilder_.clear(); - } - return this; - } - /** - *
        -     * The time that this operation will complete.
        -     * 
        - * - * .google.protobuf.Timestamp end_time = 1; - */ - public com.google.protobuf.Timestamp.Builder getEndTimeBuilder() { - return getEndTimeFieldBuilder().getBuilder(); - } - /** - *
        -     * The time that this operation will complete.
        -     * 
        - * - * .google.protobuf.Timestamp end_time = 1; - */ - @java.lang.Override - public com.google.protobuf.TimestampOrBuilder getEndTimeOrBuilder() { - if ((endCase_ == 1) && (endTimeBuilder_ != null)) { - return endTimeBuilder_.getMessageOrBuilder(); - } else { - if (endCase_ == 1) { - return (com.google.protobuf.Timestamp) end_; - } - return com.google.protobuf.Timestamp.getDefaultInstance(); - } - } - /** - *
        -     * The time that this operation will complete.
        -     * 
        - * - * .google.protobuf.Timestamp end_time = 1; - */ - private com.google.protobuf.SingleFieldBuilderV3< - com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder> - getEndTimeFieldBuilder() { - if (endTimeBuilder_ == null) { - if (!(endCase_ == 1)) { - end_ = com.google.protobuf.Timestamp.getDefaultInstance(); - } - endTimeBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder>( - (com.google.protobuf.Timestamp) end_, - getParentForChildren(), - isClean()); - end_ = null; - } - endCase_ = 1; - onChanged();; - return endTimeBuilder_; - } - - private com.google.protobuf.SingleFieldBuilderV3< - com.google.protobuf.Duration, com.google.protobuf.Duration.Builder, com.google.protobuf.DurationOrBuilder> ttlBuilder_; - /** - *
        -     * The duration of this operation.
        -     * 
        - * - * .google.protobuf.Duration ttl = 4; - * @return Whether the ttl field is set. - */ - @java.lang.Override - public boolean hasTtl() { - return endCase_ == 4; - } - /** - *
        -     * The duration of this operation.
        -     * 
        - * - * .google.protobuf.Duration ttl = 4; - * @return The ttl. - */ - @java.lang.Override - public com.google.protobuf.Duration getTtl() { - if (ttlBuilder_ == null) { - if (endCase_ == 4) { - return (com.google.protobuf.Duration) end_; - } - return com.google.protobuf.Duration.getDefaultInstance(); - } else { - if (endCase_ == 4) { - return ttlBuilder_.getMessage(); - } - return com.google.protobuf.Duration.getDefaultInstance(); - } - } - /** - *
        -     * The duration of this operation.
        -     * 
        - * - * .google.protobuf.Duration ttl = 4; - */ - public Builder setTtl(com.google.protobuf.Duration value) { - if (ttlBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - end_ = value; - onChanged(); - } else { - ttlBuilder_.setMessage(value); - } - endCase_ = 4; - return this; - } - /** - *
        -     * The duration of this operation.
        -     * 
        - * - * .google.protobuf.Duration ttl = 4; - */ - public Builder setTtl( - com.google.protobuf.Duration.Builder builderForValue) { - if (ttlBuilder_ == null) { - end_ = builderForValue.build(); - onChanged(); - } else { - ttlBuilder_.setMessage(builderForValue.build()); - } - endCase_ = 4; - return this; - } - /** - *
        -     * The duration of this operation.
        -     * 
        - * - * .google.protobuf.Duration ttl = 4; - */ - public Builder mergeTtl(com.google.protobuf.Duration value) { - if (ttlBuilder_ == null) { - if (endCase_ == 4 && - end_ != com.google.protobuf.Duration.getDefaultInstance()) { - end_ = com.google.protobuf.Duration.newBuilder((com.google.protobuf.Duration) end_) - .mergeFrom(value).buildPartial(); - } else { - end_ = value; - } - onChanged(); - } else { - if (endCase_ == 4) { - ttlBuilder_.mergeFrom(value); - } else { - ttlBuilder_.setMessage(value); - } - } - endCase_ = 4; - return this; - } - /** - *
        -     * The duration of this operation.
        -     * 
        - * - * .google.protobuf.Duration ttl = 4; - */ - public Builder clearTtl() { - if (ttlBuilder_ == null) { - if (endCase_ == 4) { - endCase_ = 0; - end_ = null; - onChanged(); - } - } else { - if (endCase_ == 4) { - endCase_ = 0; - end_ = null; - } - ttlBuilder_.clear(); - } - return this; - } - /** - *
        -     * The duration of this operation.
        -     * 
        - * - * .google.protobuf.Duration ttl = 4; - */ - public com.google.protobuf.Duration.Builder getTtlBuilder() { - return getTtlFieldBuilder().getBuilder(); - } - /** - *
        -     * The duration of this operation.
        -     * 
        - * - * .google.protobuf.Duration ttl = 4; - */ - @java.lang.Override - public com.google.protobuf.DurationOrBuilder getTtlOrBuilder() { - if ((endCase_ == 4) && (ttlBuilder_ != null)) { - return ttlBuilder_.getMessageOrBuilder(); - } else { - if (endCase_ == 4) { - return (com.google.protobuf.Duration) end_; - } - return com.google.protobuf.Duration.getDefaultInstance(); - } - } - /** - *
        -     * The duration of this operation.
        -     * 
        - * - * .google.protobuf.Duration ttl = 4; - */ - private com.google.protobuf.SingleFieldBuilderV3< - com.google.protobuf.Duration, com.google.protobuf.Duration.Builder, com.google.protobuf.DurationOrBuilder> - getTtlFieldBuilder() { - if (ttlBuilder_ == null) { - if (!(endCase_ == 4)) { - end_ = com.google.protobuf.Duration.getDefaultInstance(); - } - ttlBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - com.google.protobuf.Duration, com.google.protobuf.Duration.Builder, com.google.protobuf.DurationOrBuilder>( - (com.google.protobuf.Duration) end_, - getParentForChildren(), - isClean()); - end_ = null; - } - endCase_ = 4; - onChanged();; - return ttlBuilder_; - } - - private com.google.protobuf.SingleFieldBuilderV3< - com.google.rpc.Status, com.google.rpc.Status.Builder, com.google.rpc.StatusOrBuilder> errorBuilder_; - /** - *
        -     * The error that will be returned by the server. If this code is specified
        -     * to be the OK rpc code, an empty response will be returned.
        -     * 
        - * - * .google.rpc.Status error = 2; - * @return Whether the error field is set. - */ - @java.lang.Override - public boolean hasError() { - return responseCase_ == 2; - } - /** - *
        -     * The error that will be returned by the server. If this code is specified
        -     * to be the OK rpc code, an empty response will be returned.
        -     * 
        - * - * .google.rpc.Status error = 2; - * @return The error. - */ - @java.lang.Override - public com.google.rpc.Status getError() { - if (errorBuilder_ == null) { - if (responseCase_ == 2) { - return (com.google.rpc.Status) response_; - } - return com.google.rpc.Status.getDefaultInstance(); - } else { - if (responseCase_ == 2) { - return errorBuilder_.getMessage(); - } - return com.google.rpc.Status.getDefaultInstance(); - } - } - /** - *
        -     * The error that will be returned by the server. If this code is specified
        -     * to be the OK rpc code, an empty response will be returned.
        -     * 
        - * - * .google.rpc.Status error = 2; - */ - public Builder setError(com.google.rpc.Status value) { - if (errorBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - response_ = value; - onChanged(); - } else { - errorBuilder_.setMessage(value); - } - responseCase_ = 2; - return this; - } - /** - *
        -     * The error that will be returned by the server. If this code is specified
        -     * to be the OK rpc code, an empty response will be returned.
        -     * 
        - * - * .google.rpc.Status error = 2; - */ - public Builder setError( - com.google.rpc.Status.Builder builderForValue) { - if (errorBuilder_ == null) { - response_ = builderForValue.build(); - onChanged(); - } else { - errorBuilder_.setMessage(builderForValue.build()); - } - responseCase_ = 2; - return this; - } - /** - *
        -     * The error that will be returned by the server. If this code is specified
        -     * to be the OK rpc code, an empty response will be returned.
        -     * 
        - * - * .google.rpc.Status error = 2; - */ - public Builder mergeError(com.google.rpc.Status value) { - if (errorBuilder_ == null) { - if (responseCase_ == 2 && - response_ != com.google.rpc.Status.getDefaultInstance()) { - response_ = com.google.rpc.Status.newBuilder((com.google.rpc.Status) response_) - .mergeFrom(value).buildPartial(); - } else { - response_ = value; - } - onChanged(); - } else { - if (responseCase_ == 2) { - errorBuilder_.mergeFrom(value); - } else { - errorBuilder_.setMessage(value); - } - } - responseCase_ = 2; - return this; - } - /** - *
        -     * The error that will be returned by the server. If this code is specified
        -     * to be the OK rpc code, an empty response will be returned.
        -     * 
        - * - * .google.rpc.Status error = 2; - */ - public Builder clearError() { - if (errorBuilder_ == null) { - if (responseCase_ == 2) { - responseCase_ = 0; - response_ = null; - onChanged(); - } - } else { - if (responseCase_ == 2) { - responseCase_ = 0; - response_ = null; - } - errorBuilder_.clear(); - } - return this; - } - /** - *
        -     * The error that will be returned by the server. If this code is specified
        -     * to be the OK rpc code, an empty response will be returned.
        -     * 
        - * - * .google.rpc.Status error = 2; - */ - public com.google.rpc.Status.Builder getErrorBuilder() { - return getErrorFieldBuilder().getBuilder(); - } - /** - *
        -     * The error that will be returned by the server. If this code is specified
        -     * to be the OK rpc code, an empty response will be returned.
        -     * 
        - * - * .google.rpc.Status error = 2; - */ - @java.lang.Override - public com.google.rpc.StatusOrBuilder getErrorOrBuilder() { - if ((responseCase_ == 2) && (errorBuilder_ != null)) { - return errorBuilder_.getMessageOrBuilder(); - } else { - if (responseCase_ == 2) { - return (com.google.rpc.Status) response_; - } - return com.google.rpc.Status.getDefaultInstance(); - } - } - /** - *
        -     * The error that will be returned by the server. If this code is specified
        -     * to be the OK rpc code, an empty response will be returned.
        -     * 
        - * - * .google.rpc.Status error = 2; - */ - private com.google.protobuf.SingleFieldBuilderV3< - com.google.rpc.Status, com.google.rpc.Status.Builder, com.google.rpc.StatusOrBuilder> - getErrorFieldBuilder() { - if (errorBuilder_ == null) { - if (!(responseCase_ == 2)) { - response_ = com.google.rpc.Status.getDefaultInstance(); - } - errorBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - com.google.rpc.Status, com.google.rpc.Status.Builder, com.google.rpc.StatusOrBuilder>( - (com.google.rpc.Status) response_, - getParentForChildren(), - isClean()); - response_ = null; - } - responseCase_ = 2; - onChanged();; - return errorBuilder_; - } - - private com.google.protobuf.SingleFieldBuilderV3< - com.google.showcase.v1beta1.WaitResponse, com.google.showcase.v1beta1.WaitResponse.Builder, com.google.showcase.v1beta1.WaitResponseOrBuilder> successBuilder_; - /** - *
        -     * The response to be returned on operation completion.
        -     * 
        - * - * .google.showcase.v1beta1.WaitResponse success = 3; - * @return Whether the success field is set. - */ - @java.lang.Override - public boolean hasSuccess() { - return responseCase_ == 3; - } - /** - *
        -     * The response to be returned on operation completion.
        -     * 
        - * - * .google.showcase.v1beta1.WaitResponse success = 3; - * @return The success. - */ - @java.lang.Override - public com.google.showcase.v1beta1.WaitResponse getSuccess() { - if (successBuilder_ == null) { - if (responseCase_ == 3) { - return (com.google.showcase.v1beta1.WaitResponse) response_; - } - return com.google.showcase.v1beta1.WaitResponse.getDefaultInstance(); - } else { - if (responseCase_ == 3) { - return successBuilder_.getMessage(); - } - return com.google.showcase.v1beta1.WaitResponse.getDefaultInstance(); - } - } - /** - *
        -     * The response to be returned on operation completion.
        -     * 
        - * - * .google.showcase.v1beta1.WaitResponse success = 3; - */ - public Builder setSuccess(com.google.showcase.v1beta1.WaitResponse value) { - if (successBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - response_ = value; - onChanged(); - } else { - successBuilder_.setMessage(value); - } - responseCase_ = 3; - return this; - } - /** - *
        -     * The response to be returned on operation completion.
        -     * 
        - * - * .google.showcase.v1beta1.WaitResponse success = 3; - */ - public Builder setSuccess( - com.google.showcase.v1beta1.WaitResponse.Builder builderForValue) { - if (successBuilder_ == null) { - response_ = builderForValue.build(); - onChanged(); - } else { - successBuilder_.setMessage(builderForValue.build()); - } - responseCase_ = 3; - return this; - } - /** - *
        -     * The response to be returned on operation completion.
        -     * 
        - * - * .google.showcase.v1beta1.WaitResponse success = 3; - */ - public Builder mergeSuccess(com.google.showcase.v1beta1.WaitResponse value) { - if (successBuilder_ == null) { - if (responseCase_ == 3 && - response_ != com.google.showcase.v1beta1.WaitResponse.getDefaultInstance()) { - response_ = com.google.showcase.v1beta1.WaitResponse.newBuilder((com.google.showcase.v1beta1.WaitResponse) response_) - .mergeFrom(value).buildPartial(); - } else { - response_ = value; - } - onChanged(); - } else { - if (responseCase_ == 3) { - successBuilder_.mergeFrom(value); - } else { - successBuilder_.setMessage(value); - } - } - responseCase_ = 3; - return this; - } - /** - *
        -     * The response to be returned on operation completion.
        -     * 
        - * - * .google.showcase.v1beta1.WaitResponse success = 3; - */ - public Builder clearSuccess() { - if (successBuilder_ == null) { - if (responseCase_ == 3) { - responseCase_ = 0; - response_ = null; - onChanged(); - } - } else { - if (responseCase_ == 3) { - responseCase_ = 0; - response_ = null; - } - successBuilder_.clear(); - } - return this; - } - /** - *
        -     * The response to be returned on operation completion.
        -     * 
        - * - * .google.showcase.v1beta1.WaitResponse success = 3; - */ - public com.google.showcase.v1beta1.WaitResponse.Builder getSuccessBuilder() { - return getSuccessFieldBuilder().getBuilder(); - } - /** - *
        -     * The response to be returned on operation completion.
        -     * 
        - * - * .google.showcase.v1beta1.WaitResponse success = 3; - */ - @java.lang.Override - public com.google.showcase.v1beta1.WaitResponseOrBuilder getSuccessOrBuilder() { - if ((responseCase_ == 3) && (successBuilder_ != null)) { - return successBuilder_.getMessageOrBuilder(); - } else { - if (responseCase_ == 3) { - return (com.google.showcase.v1beta1.WaitResponse) response_; - } - return com.google.showcase.v1beta1.WaitResponse.getDefaultInstance(); - } - } - /** - *
        -     * The response to be returned on operation completion.
        -     * 
        - * - * .google.showcase.v1beta1.WaitResponse success = 3; - */ - private com.google.protobuf.SingleFieldBuilderV3< - com.google.showcase.v1beta1.WaitResponse, com.google.showcase.v1beta1.WaitResponse.Builder, com.google.showcase.v1beta1.WaitResponseOrBuilder> - getSuccessFieldBuilder() { - if (successBuilder_ == null) { - if (!(responseCase_ == 3)) { - response_ = com.google.showcase.v1beta1.WaitResponse.getDefaultInstance(); - } - successBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - com.google.showcase.v1beta1.WaitResponse, com.google.showcase.v1beta1.WaitResponse.Builder, com.google.showcase.v1beta1.WaitResponseOrBuilder>( - (com.google.showcase.v1beta1.WaitResponse) response_, - getParentForChildren(), - isClean()); - response_ = null; - } - responseCase_ = 3; - onChanged();; - return successBuilder_; - } - @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.showcase.v1beta1.WaitRequest) - } - - // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.WaitRequest) - private static final com.google.showcase.v1beta1.WaitRequest DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new com.google.showcase.v1beta1.WaitRequest(); - } - - public static com.google.showcase.v1beta1.WaitRequest getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public WaitRequest parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new WaitRequest(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public com.google.showcase.v1beta1.WaitRequest getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/WaitRequestOrBuilder.java b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/WaitRequestOrBuilder.java deleted file mode 100644 index 1050530f9c..0000000000 --- a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/WaitRequestOrBuilder.java +++ /dev/null @@ -1,124 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: schema/google/showcase/v1beta1/echo.proto - -package com.google.showcase.v1beta1; - -public interface WaitRequestOrBuilder extends - // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.WaitRequest) - com.google.protobuf.MessageOrBuilder { - - /** - *
        -   * The time that this operation will complete.
        -   * 
        - * - * .google.protobuf.Timestamp end_time = 1; - * @return Whether the endTime field is set. - */ - boolean hasEndTime(); - /** - *
        -   * The time that this operation will complete.
        -   * 
        - * - * .google.protobuf.Timestamp end_time = 1; - * @return The endTime. - */ - com.google.protobuf.Timestamp getEndTime(); - /** - *
        -   * The time that this operation will complete.
        -   * 
        - * - * .google.protobuf.Timestamp end_time = 1; - */ - com.google.protobuf.TimestampOrBuilder getEndTimeOrBuilder(); - - /** - *
        -   * The duration of this operation.
        -   * 
        - * - * .google.protobuf.Duration ttl = 4; - * @return Whether the ttl field is set. - */ - boolean hasTtl(); - /** - *
        -   * The duration of this operation.
        -   * 
        - * - * .google.protobuf.Duration ttl = 4; - * @return The ttl. - */ - com.google.protobuf.Duration getTtl(); - /** - *
        -   * The duration of this operation.
        -   * 
        - * - * .google.protobuf.Duration ttl = 4; - */ - com.google.protobuf.DurationOrBuilder getTtlOrBuilder(); - - /** - *
        -   * The error that will be returned by the server. If this code is specified
        -   * to be the OK rpc code, an empty response will be returned.
        -   * 
        - * - * .google.rpc.Status error = 2; - * @return Whether the error field is set. - */ - boolean hasError(); - /** - *
        -   * The error that will be returned by the server. If this code is specified
        -   * to be the OK rpc code, an empty response will be returned.
        -   * 
        - * - * .google.rpc.Status error = 2; - * @return The error. - */ - com.google.rpc.Status getError(); - /** - *
        -   * The error that will be returned by the server. If this code is specified
        -   * to be the OK rpc code, an empty response will be returned.
        -   * 
        - * - * .google.rpc.Status error = 2; - */ - com.google.rpc.StatusOrBuilder getErrorOrBuilder(); - - /** - *
        -   * The response to be returned on operation completion.
        -   * 
        - * - * .google.showcase.v1beta1.WaitResponse success = 3; - * @return Whether the success field is set. - */ - boolean hasSuccess(); - /** - *
        -   * The response to be returned on operation completion.
        -   * 
        - * - * .google.showcase.v1beta1.WaitResponse success = 3; - * @return The success. - */ - com.google.showcase.v1beta1.WaitResponse getSuccess(); - /** - *
        -   * The response to be returned on operation completion.
        -   * 
        - * - * .google.showcase.v1beta1.WaitResponse success = 3; - */ - com.google.showcase.v1beta1.WaitResponseOrBuilder getSuccessOrBuilder(); - - public com.google.showcase.v1beta1.WaitRequest.EndCase getEndCase(); - - public com.google.showcase.v1beta1.WaitRequest.ResponseCase getResponseCase(); -} diff --git a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/WaitResponse.java b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/WaitResponse.java deleted file mode 100644 index d992163846..0000000000 --- a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/WaitResponse.java +++ /dev/null @@ -1,595 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: schema/google/showcase/v1beta1/echo.proto - -package com.google.showcase.v1beta1; - -/** - *
        - * The result of the Wait operation.
        - * 
        - * - * Protobuf type {@code google.showcase.v1beta1.WaitResponse} - */ -public final class WaitResponse extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.WaitResponse) - WaitResponseOrBuilder { -private static final long serialVersionUID = 0L; - // Use WaitResponse.newBuilder() to construct. - private WaitResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private WaitResponse() { - content_ = ""; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new WaitResponse(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private WaitResponse( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: { - java.lang.String s = input.readStringRequireUtf8(); - - content_ = s; - break; - } - default: { - if (!parseUnknownField( - input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException( - e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.google.showcase.v1beta1.EchoOuterClass.internal_static_google_showcase_v1beta1_WaitResponse_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.showcase.v1beta1.EchoOuterClass.internal_static_google_showcase_v1beta1_WaitResponse_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.showcase.v1beta1.WaitResponse.class, com.google.showcase.v1beta1.WaitResponse.Builder.class); - } - - public static final int CONTENT_FIELD_NUMBER = 1; - private volatile java.lang.Object content_; - /** - *
        -   * This content of the result.
        -   * 
        - * - * string content = 1; - * @return The content. - */ - @java.lang.Override - public java.lang.String getContent() { - java.lang.Object ref = content_; - 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(); - content_ = s; - return s; - } - } - /** - *
        -   * This content of the result.
        -   * 
        - * - * string content = 1; - * @return The bytes for content. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getContentBytes() { - java.lang.Object ref = content_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - content_ = 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(content_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, content_); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(content_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, content_); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof com.google.showcase.v1beta1.WaitResponse)) { - return super.equals(obj); - } - com.google.showcase.v1beta1.WaitResponse other = (com.google.showcase.v1beta1.WaitResponse) obj; - - if (!getContent() - .equals(other.getContent())) return false; - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - hash = (37 * hash) + CONTENT_FIELD_NUMBER; - hash = (53 * hash) + getContent().hashCode(); - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.showcase.v1beta1.WaitResponse parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.showcase.v1beta1.WaitResponse parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.showcase.v1beta1.WaitResponse parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.showcase.v1beta1.WaitResponse 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.showcase.v1beta1.WaitResponse parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.showcase.v1beta1.WaitResponse parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.showcase.v1beta1.WaitResponse parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static com.google.showcase.v1beta1.WaitResponse 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.showcase.v1beta1.WaitResponse parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static com.google.showcase.v1beta1.WaitResponse 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.showcase.v1beta1.WaitResponse parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static com.google.showcase.v1beta1.WaitResponse 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.showcase.v1beta1.WaitResponse 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 result of the Wait operation.
        -   * 
        - * - * Protobuf type {@code google.showcase.v1beta1.WaitResponse} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.WaitResponse) - com.google.showcase.v1beta1.WaitResponseOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.google.showcase.v1beta1.EchoOuterClass.internal_static_google_showcase_v1beta1_WaitResponse_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.showcase.v1beta1.EchoOuterClass.internal_static_google_showcase_v1beta1_WaitResponse_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.showcase.v1beta1.WaitResponse.class, com.google.showcase.v1beta1.WaitResponse.Builder.class); - } - - // Construct using com.google.showcase.v1beta1.WaitResponse.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { - } - } - @java.lang.Override - public Builder clear() { - super.clear(); - content_ = ""; - - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return com.google.showcase.v1beta1.EchoOuterClass.internal_static_google_showcase_v1beta1_WaitResponse_descriptor; - } - - @java.lang.Override - public com.google.showcase.v1beta1.WaitResponse getDefaultInstanceForType() { - return com.google.showcase.v1beta1.WaitResponse.getDefaultInstance(); - } - - @java.lang.Override - public com.google.showcase.v1beta1.WaitResponse build() { - com.google.showcase.v1beta1.WaitResponse result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.showcase.v1beta1.WaitResponse buildPartial() { - com.google.showcase.v1beta1.WaitResponse result = new com.google.showcase.v1beta1.WaitResponse(this); - result.content_ = content_; - 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.showcase.v1beta1.WaitResponse) { - return mergeFrom((com.google.showcase.v1beta1.WaitResponse)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.showcase.v1beta1.WaitResponse other) { - if (other == com.google.showcase.v1beta1.WaitResponse.getDefaultInstance()) return this; - if (!other.getContent().isEmpty()) { - content_ = other.content_; - onChanged(); - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - com.google.showcase.v1beta1.WaitResponse parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (com.google.showcase.v1beta1.WaitResponse) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private java.lang.Object content_ = ""; - /** - *
        -     * This content of the result.
        -     * 
        - * - * string content = 1; - * @return The content. - */ - public java.lang.String getContent() { - java.lang.Object ref = content_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - content_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - *
        -     * This content of the result.
        -     * 
        - * - * string content = 1; - * @return The bytes for content. - */ - public com.google.protobuf.ByteString - getContentBytes() { - java.lang.Object ref = content_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - content_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - *
        -     * This content of the result.
        -     * 
        - * - * string content = 1; - * @param value The content to set. - * @return This builder for chaining. - */ - public Builder setContent( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - content_ = value; - onChanged(); - return this; - } - /** - *
        -     * This content of the result.
        -     * 
        - * - * string content = 1; - * @return This builder for chaining. - */ - public Builder clearContent() { - - content_ = getDefaultInstance().getContent(); - onChanged(); - return this; - } - /** - *
        -     * This content of the result.
        -     * 
        - * - * string content = 1; - * @param value The bytes for content to set. - * @return This builder for chaining. - */ - public Builder setContentBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - content_ = value; - onChanged(); - return this; - } - @java.lang.Override - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - - // @@protoc_insertion_point(builder_scope:google.showcase.v1beta1.WaitResponse) - } - - // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.WaitResponse) - private static final com.google.showcase.v1beta1.WaitResponse DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new com.google.showcase.v1beta1.WaitResponse(); - } - - public static com.google.showcase.v1beta1.WaitResponse getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public WaitResponse parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new WaitResponse(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public com.google.showcase.v1beta1.WaitResponse getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/WaitResponseOrBuilder.java b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/WaitResponseOrBuilder.java deleted file mode 100644 index 8c2a127d9a..0000000000 --- a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/WaitResponseOrBuilder.java +++ /dev/null @@ -1,29 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: schema/google/showcase/v1beta1/echo.proto - -package com.google.showcase.v1beta1; - -public interface WaitResponseOrBuilder extends - // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.WaitResponse) - com.google.protobuf.MessageOrBuilder { - - /** - *
        -   * This content of the result.
        -   * 
        - * - * string content = 1; - * @return The content. - */ - java.lang.String getContent(); - /** - *
        -   * This content of the result.
        -   * 
        - * - * string content = 1; - * @return The bytes for content. - */ - com.google.protobuf.ByteString - getContentBytes(); -} diff --git a/showcase/scripts/BUILD.bazel b/showcase/scripts/BUILD.bazel deleted file mode 100644 index 504a2a6198..0000000000 --- a/showcase/scripts/BUILD.bazel +++ /dev/null @@ -1,6 +0,0 @@ -package(default_visibility = ["//showcase:update"]) - -exports_files([ - "update.sh", - "verify.sh", -]) diff --git a/showcase/scripts/update.sh b/showcase/scripts/update.sh deleted file mode 100755 index b5da568f65..0000000000 --- a/showcase/scripts/update.sh +++ /dev/null @@ -1,67 +0,0 @@ -#!/bin/sh -# This script is executed by ../BUILD.bazel as a final post-generation step. - -set -o errexit -BAZEL_ROOT=$PWD - -clear_existing() { - cd "$BUILD_WORKSPACE_DIRECTORY/showcase/$1" - find . -name '*.java' -not -path '*/it/*' -delete - find . -name 'gapic_metadata.json' -delete - cd - -} -create_unpack_dir() { - cd "$BAZEL_ROOT" - rm -rf "$1" - mkdir "$1" - cd "$1" -} -delete_unneeded() { - find . -name '.DS_Store' -delete - find . -name 'PlaceholderFile.java' -delete - find . -type d -empty -delete -} - -case $1 in - proto) - PROTO_PROJECT_DIR=proto-gapic-showcase-v1beta1 - PROTO_ARCHIVE=$(find . -name 'proto-google-cloud-showcase-v1beta1-java.tar.gz') - clear_existing $PROTO_PROJECT_DIR - create_unpack_dir proto_unpacked - PROTO_UNPACK_DIR=$PWD - - tar -xzf "../$PROTO_ARCHIVE" - delete_unneeded - cd "$BUILD_WORKSPACE_DIRECTORY/showcase/$PROTO_PROJECT_DIR" - mkdir -p ./src - cp -r "$PROTO_UNPACK_DIR"/proto-google-cloud-showcase-v1beta1-java/src/* ./src - ;; - - grpc) - GRPC_PROJECT_DIR=grpc-gapic-showcase-v1beta1 - GRPC_JAR=$(find . -name 'libshowcase_java_grpc-src.jar') - clear_existing $GRPC_PROJECT_DIR - create_unpack_dir grpc_unpacked - GRPC_UNPACK_DIR=$PWD - - jar xf "../$GRPC_JAR" - cd "$BUILD_WORKSPACE_DIRECTORY/showcase/$GRPC_PROJECT_DIR" - mkdir -p ./src/main/java/com - cp -r "$GRPC_UNPACK_DIR"/com/* ./src/main/java/com - ;; - - gapic) - GAPIC_PROJECT_DIR=gapic-showcase - GAPIC_JAR=$(find . -name 'showcase_java_gapic_srcjar_raw.srcjar') - clear_existing $GAPIC_PROJECT_DIR - create_unpack_dir gapic_unpacked - GAPIC_UNPACK_DIR=$PWD - - unzip -q -c "../$GAPIC_JAR" temp-codegen.srcjar | jar x - cd "$BUILD_WORKSPACE_DIRECTORY/showcase/$GAPIC_PROJECT_DIR" - cp -r "$GAPIC_UNPACK_DIR"/* ./ - ;; -esac - -cd "${BUILD_WORKSPACE_DIRECTORY}/showcase" -delete_unneeded diff --git a/showcase/scripts/verify.sh b/showcase/scripts/verify.sh deleted file mode 100755 index ae6ffb4d35..0000000000 --- a/showcase/scripts/verify.sh +++ /dev/null @@ -1,60 +0,0 @@ -#!/bin/sh -# This script is executed by ../BUILD.bazel as a final post-generation step. - -set -o errexit -BAZEL_ROOT=$PWD -SHOWCASE_DIR="$BUILD_WORKSPACE_DIRECTORY/showcase" - -clear_existing() { - cd "$SHOWCASE_DIR/$1" - find . -name '*.java' -not -path '*/it/*' -delete - find . -name 'gapic_metadata.json' -delete - cd - -} -create_unpack_dir() { - cd "$BAZEL_ROOT" - rm -rf "$1" - mkdir "$1" - cd "$1" -} -delete_unneeded() { - find . -name '.DS_Store' -delete - find . -name 'PlaceholderFile.java' -delete - find . -type d -empty -delete -} - -case $1 in - proto) - PROTO_PROJECT_DIR=proto-gapic-showcase-v1beta1 - PROTO_ARCHIVE_NAME=proto-google-cloud-showcase-v1beta1-java - PROTO_ARCHIVE=$(find . -name "$PROTO_ARCHIVE_NAME.tar.gz") - create_unpack_dir proto_unpacked - PROTO_UNPACK_DIR=$PWD - - tar -xzf "../$PROTO_ARCHIVE" - delete_unneeded - diff -ru "$SHOWCASE_DIR/$PROTO_PROJECT_DIR"/src/main/java "$PROTO_UNPACK_DIR/$PROTO_ARCHIVE_NAME"/src/main/java - ;; - - grpc) - GRPC_PROJECT_DIR=grpc-gapic-showcase-v1beta1 - GRPC_JAR=$(find . -name 'libshowcase_java_grpc-src.jar') - create_unpack_dir grpc_unpacked - GRPC_UNPACK_DIR=$PWD - - jar xf "../$GRPC_JAR" - delete_unneeded - diff -ru "$SHOWCASE_DIR/$GRPC_PROJECT_DIR"/src/main/java/com "$GRPC_UNPACK_DIR"/com - ;; - - gapic) - GAPIC_PROJECT_DIR=gapic-showcase - GAPIC_JAR=$(find . -name 'showcase_java_gapic_srcjar_raw.srcjar') - create_unpack_dir gapic_unpacked - GAPIC_UNPACK_DIR=$PWD - - unzip -q -c "../$GAPIC_JAR" temp-codegen.srcjar | jar x - delete_unneeded - diff -ru "$SHOWCASE_DIR/$GAPIC_PROJECT_DIR"/src "$GAPIC_UNPACK_DIR"/src --exclude=it - ;; -esac diff --git a/test/integration/BUILD.bazel b/test/integration/BUILD.bazel index 57cd8b2210..4a3409aa0e 100644 --- a/test/integration/BUILD.bazel +++ b/test/integration/BUILD.bazel @@ -34,6 +34,8 @@ API_GAPIC_TARGETS = { "compute": "@com_google_googleapis//google/cloud/compute/v1small:compute_small_java_gapic", # Routing headers. "bigtable": "@com_google_googleapis//google/bigtable/v2:bigtable_java_gapic", + # REGAPIC REST Client Generation + "apigeeconnect": "@com_google_googleapis//google/cloud/apigeeconnect/v1:apigeeconnect_java_gapic", } [filegroup( @@ -135,6 +137,13 @@ java_gapic_test( runtime_deps = ["@com_google_googleapis//google/bigtable/v2:bigtable_java_gapic_test"], ) +# Apigee Connect V1 API +java_gapic_test( + name = "apigeeconnect_java_gapic_test_suite", + test_classes = [], + runtime_deps = ["@com_google_googleapis//google/cloud/apigeeconnect/v1:apigeeconnect_java_gapic_test"], +) + # IAM (for a standalone mixed-in API). java_gapic_library( name = "iam_java_gapic", diff --git a/test/integration/goldens/README.md b/test/integration/goldens/README.md index fef261a881..a797bdac4f 100644 --- a/test/integration/goldens/README.md +++ b/test/integration/goldens/README.md @@ -1,30 +1,38 @@ # Goldens Files For Integration Test This folder contains goldens files that are expected to be generated from Java Microgenerator -against different APIs. For example `redis` folder has all the Java source files in the generated +against different APIs. For example `redis` folder has all the Java source files in the generated Redis client library. They are all actual Java files, but used as goldens. ## Purpose -When running integration test for the Java Microgenerator using the below command, -the goldens files in this folder will be used to compare with the actual generated Java source files. +When running integration test for the Java Microgenerator using the below command, +the goldens files in this folder will be used to compare with the actual generated Java source +files. If they are not identical, then the integration test will fail. ```sh -bazel test //test/integration:redis +bazelisk test //test/integration:redis ``` ## How To Update Goldens If the actual generated Java source files are not identical with the goldens files, and we want to -update the goldens using source files. Run the command below to overwrite the goldens files in `redis` folder. +update the goldens using source files. Run the command below to overwrite the goldens files +in `redis` folder. ```sh -bazel run //test/integration:update_redis +# In repository's root directory +mvn clean install -DskipTests +bazelisk run //test/integration:update_redis ``` ## Adding new integration tests -If you are adding a new API for integration testing, be sure to add it in the `BUILD.bazel` under the `Integration Test Rules` and add the `java_gapic_test` rules for the new API under the `API Library Rules` section. +If you are adding a new API for integration testing, be sure to add it in the `BUILD.bazel` under +the `Integration Test Rules` and add the `java_gapic_test` rules for the new API under +the `API Library Rules` section. -You need to manually create a new directory for your new API under the `test/integration/goldens` with the same name you've used for the `Integration Test Rules`. Then when you run the command to update goldens (above), it will automatically create the goldens needed. +You need to manually create a new directory for your new API under the `test/integration/goldens` +with the same name you've used for the `Integration Test Rules`. Then when you run the command to +update goldens (above), it will automatically create the goldens needed. diff --git a/test/integration/goldens/apigeeconnect/samples/snippets/generated/main/java/com/google/cloud/apigeeconnect/v1/connectionservice/create/SyncCreateSetCredentialsProvider.java b/test/integration/goldens/apigeeconnect/samples/snippets/generated/main/java/com/google/cloud/apigeeconnect/v1/connectionservice/create/SyncCreateSetCredentialsProvider.java new file mode 100644 index 0000000000..6b97bdb97b --- /dev/null +++ b/test/integration/goldens/apigeeconnect/samples/snippets/generated/main/java/com/google/cloud/apigeeconnect/v1/connectionservice/create/SyncCreateSetCredentialsProvider.java @@ -0,0 +1,45 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS 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.apigeeconnect.v1.samples; + +// [START apigeeconnect_v1_generated_ConnectionService_Create_SetCredentialsProvider_sync] +import com.google.api.gax.core.FixedCredentialsProvider; +import com.google.cloud.apigeeconnect.v1.ConnectionServiceClient; +import com.google.cloud.apigeeconnect.v1.ConnectionServiceSettings; +import com.google.cloud.apigeeconnect.v1.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 + ConnectionServiceSettings connectionServiceSettings = + ConnectionServiceSettings.newBuilder() + .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials)) + .build(); + ConnectionServiceClient connectionServiceClient = + ConnectionServiceClient.create(connectionServiceSettings); + } +} +// [END apigeeconnect_v1_generated_ConnectionService_Create_SetCredentialsProvider_sync] diff --git a/test/integration/goldens/apigeeconnect/samples/snippets/generated/main/java/com/google/cloud/apigeeconnect/v1/connectionservice/create/SyncCreateSetEndpoint.java b/test/integration/goldens/apigeeconnect/samples/snippets/generated/main/java/com/google/cloud/apigeeconnect/v1/connectionservice/create/SyncCreateSetEndpoint.java new file mode 100644 index 0000000000..39b07f3dac --- /dev/null +++ b/test/integration/goldens/apigeeconnect/samples/snippets/generated/main/java/com/google/cloud/apigeeconnect/v1/connectionservice/create/SyncCreateSetEndpoint.java @@ -0,0 +1,42 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS 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.apigeeconnect.v1.samples; + +// [START apigeeconnect_v1_generated_ConnectionService_Create_SetEndpoint_sync] +import com.google.cloud.apigeeconnect.v1.ConnectionServiceClient; +import com.google.cloud.apigeeconnect.v1.ConnectionServiceSettings; +import com.google.cloud.apigeeconnect.v1.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 + ConnectionServiceSettings connectionServiceSettings = + ConnectionServiceSettings.newBuilder().setEndpoint(myEndpoint).build(); + ConnectionServiceClient connectionServiceClient = + ConnectionServiceClient.create(connectionServiceSettings); + } +} +// [END apigeeconnect_v1_generated_ConnectionService_Create_SetEndpoint_sync] diff --git a/test/integration/goldens/apigeeconnect/samples/snippets/generated/main/java/com/google/cloud/apigeeconnect/v1/connectionservice/create/SyncCreateUseHttpJsonTransport.java b/test/integration/goldens/apigeeconnect/samples/snippets/generated/main/java/com/google/cloud/apigeeconnect/v1/connectionservice/create/SyncCreateUseHttpJsonTransport.java new file mode 100644 index 0000000000..35090796b9 --- /dev/null +++ b/test/integration/goldens/apigeeconnect/samples/snippets/generated/main/java/com/google/cloud/apigeeconnect/v1/connectionservice/create/SyncCreateUseHttpJsonTransport.java @@ -0,0 +1,41 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS 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.apigeeconnect.v1.samples; + +// [START apigeeconnect_v1_generated_ConnectionService_Create_UseHttpJsonTransport_sync] +import com.google.cloud.apigeeconnect.v1.ConnectionServiceClient; +import com.google.cloud.apigeeconnect.v1.ConnectionServiceSettings; + +public class SyncCreateUseHttpJsonTransport { + + public static void main(String[] args) throws Exception { + syncCreateUseHttpJsonTransport(); + } + + public static void syncCreateUseHttpJsonTransport() 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 + ConnectionServiceSettings connectionServiceSettings = + ConnectionServiceSettings.newHttpJsonBuilder().build(); + ConnectionServiceClient connectionServiceClient = + ConnectionServiceClient.create(connectionServiceSettings); + } +} +// [END apigeeconnect_v1_generated_ConnectionService_Create_UseHttpJsonTransport_sync] diff --git a/test/integration/goldens/apigeeconnect/samples/snippets/generated/main/java/com/google/cloud/apigeeconnect/v1/connectionservice/listconnections/AsyncListConnections.java b/test/integration/goldens/apigeeconnect/samples/snippets/generated/main/java/com/google/cloud/apigeeconnect/v1/connectionservice/listconnections/AsyncListConnections.java new file mode 100644 index 0000000000..a22cc5f86f --- /dev/null +++ b/test/integration/goldens/apigeeconnect/samples/snippets/generated/main/java/com/google/cloud/apigeeconnect/v1/connectionservice/listconnections/AsyncListConnections.java @@ -0,0 +1,54 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS 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.apigeeconnect.v1.samples; + +// [START apigeeconnect_v1_generated_ConnectionService_ListConnections_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.apigeeconnect.v1.Connection; +import com.google.cloud.apigeeconnect.v1.ConnectionServiceClient; +import com.google.cloud.apigeeconnect.v1.EndpointName; +import com.google.cloud.apigeeconnect.v1.ListConnectionsRequest; + +public class AsyncListConnections { + + public static void main(String[] args) throws Exception { + asyncListConnections(); + } + + public static void asyncListConnections() 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 (ConnectionServiceClient connectionServiceClient = ConnectionServiceClient.create()) { + ListConnectionsRequest request = + ListConnectionsRequest.newBuilder() + .setParent(EndpointName.of("[PROJECT]", "[ENDPOINT]").toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + ApiFuture future = + connectionServiceClient.listConnectionsPagedCallable().futureCall(request); + // Do something. + for (Connection element : future.get().iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END apigeeconnect_v1_generated_ConnectionService_ListConnections_async] diff --git a/test/integration/goldens/apigeeconnect/samples/snippets/generated/main/java/com/google/cloud/apigeeconnect/v1/connectionservice/listconnections/AsyncListConnectionsPaged.java b/test/integration/goldens/apigeeconnect/samples/snippets/generated/main/java/com/google/cloud/apigeeconnect/v1/connectionservice/listconnections/AsyncListConnectionsPaged.java new file mode 100644 index 0000000000..66dd55cc1d --- /dev/null +++ b/test/integration/goldens/apigeeconnect/samples/snippets/generated/main/java/com/google/cloud/apigeeconnect/v1/connectionservice/listconnections/AsyncListConnectionsPaged.java @@ -0,0 +1,62 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS 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.apigeeconnect.v1.samples; + +// [START apigeeconnect_v1_generated_ConnectionService_ListConnections_Paged_async] +import com.google.cloud.apigeeconnect.v1.Connection; +import com.google.cloud.apigeeconnect.v1.ConnectionServiceClient; +import com.google.cloud.apigeeconnect.v1.EndpointName; +import com.google.cloud.apigeeconnect.v1.ListConnectionsRequest; +import com.google.cloud.apigeeconnect.v1.ListConnectionsResponse; +import com.google.common.base.Strings; + +public class AsyncListConnectionsPaged { + + public static void main(String[] args) throws Exception { + asyncListConnectionsPaged(); + } + + public static void asyncListConnectionsPaged() 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 (ConnectionServiceClient connectionServiceClient = ConnectionServiceClient.create()) { + ListConnectionsRequest request = + ListConnectionsRequest.newBuilder() + .setParent(EndpointName.of("[PROJECT]", "[ENDPOINT]").toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + while (true) { + ListConnectionsResponse response = + connectionServiceClient.listConnectionsCallable().call(request); + for (Connection element : response.getConnectionsList()) { + // doThingsWith(element); + } + String nextPageToken = response.getNextPageToken(); + if (!Strings.isNullOrEmpty(nextPageToken)) { + request = request.toBuilder().setPageToken(nextPageToken).build(); + } else { + break; + } + } + } + } +} +// [END apigeeconnect_v1_generated_ConnectionService_ListConnections_Paged_async] diff --git a/test/integration/goldens/apigeeconnect/samples/snippets/generated/main/java/com/google/cloud/apigeeconnect/v1/connectionservice/listconnections/SyncListConnections.java b/test/integration/goldens/apigeeconnect/samples/snippets/generated/main/java/com/google/cloud/apigeeconnect/v1/connectionservice/listconnections/SyncListConnections.java new file mode 100644 index 0000000000..aeb37a7a68 --- /dev/null +++ b/test/integration/goldens/apigeeconnect/samples/snippets/generated/main/java/com/google/cloud/apigeeconnect/v1/connectionservice/listconnections/SyncListConnections.java @@ -0,0 +1,50 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS 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.apigeeconnect.v1.samples; + +// [START apigeeconnect_v1_generated_ConnectionService_ListConnections_sync] +import com.google.cloud.apigeeconnect.v1.Connection; +import com.google.cloud.apigeeconnect.v1.ConnectionServiceClient; +import com.google.cloud.apigeeconnect.v1.EndpointName; +import com.google.cloud.apigeeconnect.v1.ListConnectionsRequest; + +public class SyncListConnections { + + public static void main(String[] args) throws Exception { + syncListConnections(); + } + + public static void syncListConnections() 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 (ConnectionServiceClient connectionServiceClient = ConnectionServiceClient.create()) { + ListConnectionsRequest request = + ListConnectionsRequest.newBuilder() + .setParent(EndpointName.of("[PROJECT]", "[ENDPOINT]").toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + for (Connection element : connectionServiceClient.listConnections(request).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END apigeeconnect_v1_generated_ConnectionService_ListConnections_sync] diff --git a/test/integration/goldens/apigeeconnect/samples/snippets/generated/main/java/com/google/cloud/apigeeconnect/v1/connectionservice/listconnections/SyncListConnectionsEndpointname.java b/test/integration/goldens/apigeeconnect/samples/snippets/generated/main/java/com/google/cloud/apigeeconnect/v1/connectionservice/listconnections/SyncListConnectionsEndpointname.java new file mode 100644 index 0000000000..038115c151 --- /dev/null +++ b/test/integration/goldens/apigeeconnect/samples/snippets/generated/main/java/com/google/cloud/apigeeconnect/v1/connectionservice/listconnections/SyncListConnectionsEndpointname.java @@ -0,0 +1,44 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS 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.apigeeconnect.v1.samples; + +// [START apigeeconnect_v1_generated_ConnectionService_ListConnections_Endpointname_sync] +import com.google.cloud.apigeeconnect.v1.Connection; +import com.google.cloud.apigeeconnect.v1.ConnectionServiceClient; +import com.google.cloud.apigeeconnect.v1.EndpointName; + +public class SyncListConnectionsEndpointname { + + public static void main(String[] args) throws Exception { + syncListConnectionsEndpointname(); + } + + public static void syncListConnectionsEndpointname() 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 (ConnectionServiceClient connectionServiceClient = ConnectionServiceClient.create()) { + EndpointName parent = EndpointName.of("[PROJECT]", "[ENDPOINT]"); + for (Connection element : connectionServiceClient.listConnections(parent).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END apigeeconnect_v1_generated_ConnectionService_ListConnections_Endpointname_sync] diff --git a/test/integration/goldens/apigeeconnect/samples/snippets/generated/main/java/com/google/cloud/apigeeconnect/v1/connectionservice/listconnections/SyncListConnectionsString.java b/test/integration/goldens/apigeeconnect/samples/snippets/generated/main/java/com/google/cloud/apigeeconnect/v1/connectionservice/listconnections/SyncListConnectionsString.java new file mode 100644 index 0000000000..f041d297b7 --- /dev/null +++ b/test/integration/goldens/apigeeconnect/samples/snippets/generated/main/java/com/google/cloud/apigeeconnect/v1/connectionservice/listconnections/SyncListConnectionsString.java @@ -0,0 +1,44 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS 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.apigeeconnect.v1.samples; + +// [START apigeeconnect_v1_generated_ConnectionService_ListConnections_String_sync] +import com.google.cloud.apigeeconnect.v1.Connection; +import com.google.cloud.apigeeconnect.v1.ConnectionServiceClient; +import com.google.cloud.apigeeconnect.v1.EndpointName; + +public class SyncListConnectionsString { + + public static void main(String[] args) throws Exception { + syncListConnectionsString(); + } + + public static void syncListConnectionsString() 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 (ConnectionServiceClient connectionServiceClient = ConnectionServiceClient.create()) { + String parent = EndpointName.of("[PROJECT]", "[ENDPOINT]").toString(); + for (Connection element : connectionServiceClient.listConnections(parent).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END apigeeconnect_v1_generated_ConnectionService_ListConnections_String_sync] diff --git a/test/integration/goldens/apigeeconnect/samples/snippets/generated/main/java/com/google/cloud/apigeeconnect/v1/connectionservicesettings/listconnections/SyncListConnections.java b/test/integration/goldens/apigeeconnect/samples/snippets/generated/main/java/com/google/cloud/apigeeconnect/v1/connectionservicesettings/listconnections/SyncListConnections.java new file mode 100644 index 0000000000..aa40ecd19e --- /dev/null +++ b/test/integration/goldens/apigeeconnect/samples/snippets/generated/main/java/com/google/cloud/apigeeconnect/v1/connectionservicesettings/listconnections/SyncListConnections.java @@ -0,0 +1,56 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS 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.apigeeconnect.v1.samples; + +// [START apigeeconnect_v1_generated_ConnectionServiceSettings_ListConnections_sync] +import com.google.cloud.apigeeconnect.v1.ConnectionServiceSettings; +import java.time.Duration; + +public class SyncListConnections { + + public static void main(String[] args) throws Exception { + syncListConnections(); + } + + public static void syncListConnections() 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 + ConnectionServiceSettings.Builder connectionServiceSettingsBuilder = + ConnectionServiceSettings.newBuilder(); + connectionServiceSettingsBuilder + .listConnectionsSettings() + .setRetrySettings( + connectionServiceSettingsBuilder + .listConnectionsSettings() + .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()); + ConnectionServiceSettings connectionServiceSettings = connectionServiceSettingsBuilder.build(); + } +} +// [END apigeeconnect_v1_generated_ConnectionServiceSettings_ListConnections_sync] diff --git a/test/integration/goldens/apigeeconnect/samples/snippets/generated/main/java/com/google/cloud/apigeeconnect/v1/stub/connectionservicestubsettings/listconnections/SyncListConnections.java b/test/integration/goldens/apigeeconnect/samples/snippets/generated/main/java/com/google/cloud/apigeeconnect/v1/stub/connectionservicestubsettings/listconnections/SyncListConnections.java new file mode 100644 index 0000000000..e37f2d5575 --- /dev/null +++ b/test/integration/goldens/apigeeconnect/samples/snippets/generated/main/java/com/google/cloud/apigeeconnect/v1/stub/connectionservicestubsettings/listconnections/SyncListConnections.java @@ -0,0 +1,57 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS 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.apigeeconnect.v1.stub.samples; + +// [START apigeeconnect_v1_generated_ConnectionServiceStubSettings_ListConnections_sync] +import com.google.cloud.apigeeconnect.v1.stub.ConnectionServiceStubSettings; +import java.time.Duration; + +public class SyncListConnections { + + public static void main(String[] args) throws Exception { + syncListConnections(); + } + + public static void syncListConnections() 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 + ConnectionServiceStubSettings.Builder connectionServiceSettingsBuilder = + ConnectionServiceStubSettings.newBuilder(); + connectionServiceSettingsBuilder + .listConnectionsSettings() + .setRetrySettings( + connectionServiceSettingsBuilder + .listConnectionsSettings() + .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()); + ConnectionServiceStubSettings connectionServiceSettings = + connectionServiceSettingsBuilder.build(); + } +} +// [END apigeeconnect_v1_generated_ConnectionServiceStubSettings_ListConnections_sync] diff --git a/test/integration/goldens/apigeeconnect/samples/snippets/generated/main/java/com/google/cloud/apigeeconnect/v1/stub/tetherstubsettings/egress/SyncEgress.java b/test/integration/goldens/apigeeconnect/samples/snippets/generated/main/java/com/google/cloud/apigeeconnect/v1/stub/tetherstubsettings/egress/SyncEgress.java new file mode 100644 index 0000000000..e896d782dd --- /dev/null +++ b/test/integration/goldens/apigeeconnect/samples/snippets/generated/main/java/com/google/cloud/apigeeconnect/v1/stub/tetherstubsettings/egress/SyncEgress.java @@ -0,0 +1,55 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS 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.apigeeconnect.v1.stub.samples; + +// [START apigeeconnect_v1_generated_TetherStubSettings_Egress_sync] +import com.google.cloud.apigeeconnect.v1.stub.TetherStubSettings; +import java.time.Duration; + +public class SyncEgress { + + public static void main(String[] args) throws Exception { + syncEgress(); + } + + public static void syncEgress() 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 + TetherStubSettings.Builder tetherSettingsBuilder = TetherStubSettings.newBuilder(); + tetherSettingsBuilder + .egressSettings() + .setRetrySettings( + tetherSettingsBuilder + .egressSettings() + .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()); + TetherStubSettings tetherSettings = tetherSettingsBuilder.build(); + } +} +// [END apigeeconnect_v1_generated_TetherStubSettings_Egress_sync] diff --git a/test/integration/goldens/apigeeconnect/samples/snippets/generated/main/java/com/google/cloud/apigeeconnect/v1/tether/create/SyncCreateSetCredentialsProvider.java b/test/integration/goldens/apigeeconnect/samples/snippets/generated/main/java/com/google/cloud/apigeeconnect/v1/tether/create/SyncCreateSetCredentialsProvider.java new file mode 100644 index 0000000000..f032aa5d4f --- /dev/null +++ b/test/integration/goldens/apigeeconnect/samples/snippets/generated/main/java/com/google/cloud/apigeeconnect/v1/tether/create/SyncCreateSetCredentialsProvider.java @@ -0,0 +1,44 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS 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.apigeeconnect.v1.samples; + +// [START apigeeconnect_v1_generated_Tether_Create_SetCredentialsProvider_sync] +import com.google.api.gax.core.FixedCredentialsProvider; +import com.google.cloud.apigeeconnect.v1.TetherClient; +import com.google.cloud.apigeeconnect.v1.TetherSettings; +import com.google.cloud.apigeeconnect.v1.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 + TetherSettings tetherSettings = + TetherSettings.newBuilder() + .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials)) + .build(); + TetherClient tetherClient = TetherClient.create(tetherSettings); + } +} +// [END apigeeconnect_v1_generated_Tether_Create_SetCredentialsProvider_sync] diff --git a/test/integration/goldens/apigeeconnect/samples/snippets/generated/main/java/com/google/cloud/apigeeconnect/v1/tether/create/SyncCreateSetEndpoint.java b/test/integration/goldens/apigeeconnect/samples/snippets/generated/main/java/com/google/cloud/apigeeconnect/v1/tether/create/SyncCreateSetEndpoint.java new file mode 100644 index 0000000000..e71f551c6c --- /dev/null +++ b/test/integration/goldens/apigeeconnect/samples/snippets/generated/main/java/com/google/cloud/apigeeconnect/v1/tether/create/SyncCreateSetEndpoint.java @@ -0,0 +1,40 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS 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.apigeeconnect.v1.samples; + +// [START apigeeconnect_v1_generated_Tether_Create_SetEndpoint_sync] +import com.google.cloud.apigeeconnect.v1.TetherClient; +import com.google.cloud.apigeeconnect.v1.TetherSettings; +import com.google.cloud.apigeeconnect.v1.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 + TetherSettings tetherSettings = TetherSettings.newBuilder().setEndpoint(myEndpoint).build(); + TetherClient tetherClient = TetherClient.create(tetherSettings); + } +} +// [END apigeeconnect_v1_generated_Tether_Create_SetEndpoint_sync] diff --git a/test/integration/goldens/apigeeconnect/samples/snippets/generated/main/java/com/google/cloud/apigeeconnect/v1/tether/egress/AsyncEgress.java b/test/integration/goldens/apigeeconnect/samples/snippets/generated/main/java/com/google/cloud/apigeeconnect/v1/tether/egress/AsyncEgress.java new file mode 100644 index 0000000000..25a7fd6a41 --- /dev/null +++ b/test/integration/goldens/apigeeconnect/samples/snippets/generated/main/java/com/google/cloud/apigeeconnect/v1/tether/egress/AsyncEgress.java @@ -0,0 +1,59 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS 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.apigeeconnect.v1.samples; + +// [START apigeeconnect_v1_generated_Tether_Egress_async] +import com.google.api.gax.rpc.BidiStream; +import com.google.cloud.apigeeconnect.v1.EgressRequest; +import com.google.cloud.apigeeconnect.v1.EgressResponse; +import com.google.cloud.apigeeconnect.v1.HttpResponse; +import com.google.cloud.apigeeconnect.v1.TetherClient; +import com.google.cloud.apigeeconnect.v1.TetherEndpoint; +import com.google.rpc.Status; + +public class AsyncEgress { + + public static void main(String[] args) throws Exception { + asyncEgress(); + } + + public static void asyncEgress() 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 (TetherClient tetherClient = TetherClient.create()) { + BidiStream bidiStream = tetherClient.egressCallable().call(); + EgressResponse request = + EgressResponse.newBuilder() + .setId("id3355") + .setHttpResponse(HttpResponse.newBuilder().build()) + .setStatus(Status.newBuilder().build()) + .setProject("project-309310695") + .setTraceId("traceId-1067401920") + .setEndpoint(TetherEndpoint.forNumber(0)) + .setName("name3373707") + .build(); + bidiStream.send(request); + for (EgressRequest response : bidiStream) { + // Do something when a response is received. + } + } + } +} +// [END apigeeconnect_v1_generated_Tether_Egress_async] diff --git a/test/integration/goldens/apigeeconnect/samples/snippets/generated/main/java/com/google/cloud/apigeeconnect/v1/tethersettings/egress/SyncEgress.java b/test/integration/goldens/apigeeconnect/samples/snippets/generated/main/java/com/google/cloud/apigeeconnect/v1/tethersettings/egress/SyncEgress.java new file mode 100644 index 0000000000..fd928692c1 --- /dev/null +++ b/test/integration/goldens/apigeeconnect/samples/snippets/generated/main/java/com/google/cloud/apigeeconnect/v1/tethersettings/egress/SyncEgress.java @@ -0,0 +1,55 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS 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.apigeeconnect.v1.samples; + +// [START apigeeconnect_v1_generated_TetherSettings_Egress_sync] +import com.google.cloud.apigeeconnect.v1.TetherSettings; +import java.time.Duration; + +public class SyncEgress { + + public static void main(String[] args) throws Exception { + syncEgress(); + } + + public static void syncEgress() 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 + TetherSettings.Builder tetherSettingsBuilder = TetherSettings.newBuilder(); + tetherSettingsBuilder + .egressSettings() + .setRetrySettings( + tetherSettingsBuilder + .egressSettings() + .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()); + TetherSettings tetherSettings = tetherSettingsBuilder.build(); + } +} +// [END apigeeconnect_v1_generated_TetherSettings_Egress_sync] diff --git a/test/integration/goldens/apigeeconnect/src/META-INF/native-image/com.google.cloud.apigeeconnect.v1/reflect-config.json b/test/integration/goldens/apigeeconnect/src/META-INF/native-image/com.google.cloud.apigeeconnect.v1/reflect-config.json new file mode 100644 index 0000000000..d9775aca65 --- /dev/null +++ b/test/integration/goldens/apigeeconnect/src/META-INF/native-image/com.google.cloud.apigeeconnect.v1/reflect-config.json @@ -0,0 +1,1406 @@ +[ + { + "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.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.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.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.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.cloud.apigeeconnect.v1.Action", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.apigeeconnect.v1.Cluster", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.apigeeconnect.v1.Cluster$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.apigeeconnect.v1.Connection", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.apigeeconnect.v1.Connection$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.apigeeconnect.v1.EgressRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.apigeeconnect.v1.EgressRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.apigeeconnect.v1.EgressResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.apigeeconnect.v1.EgressResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.apigeeconnect.v1.Header", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.apigeeconnect.v1.Header$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.apigeeconnect.v1.HttpRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.apigeeconnect.v1.HttpRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.apigeeconnect.v1.HttpResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.apigeeconnect.v1.HttpResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.apigeeconnect.v1.ListConnectionsRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.apigeeconnect.v1.ListConnectionsRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.apigeeconnect.v1.ListConnectionsResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.apigeeconnect.v1.ListConnectionsResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.apigeeconnect.v1.Payload", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.apigeeconnect.v1.Payload$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.apigeeconnect.v1.Scheme", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.apigeeconnect.v1.StreamInfo", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.apigeeconnect.v1.StreamInfo$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.apigeeconnect.v1.TetherEndpoint", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.apigeeconnect.v1.Url", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.apigeeconnect.v1.Url$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.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/test/integration/goldens/apigeeconnect/src/com/google/cloud/apigeeconnect/v1/ConnectionServiceClient.java b/test/integration/goldens/apigeeconnect/src/com/google/cloud/apigeeconnect/v1/ConnectionServiceClient.java new file mode 100644 index 0000000000..e9e1cef5dd --- /dev/null +++ b/test/integration/goldens/apigeeconnect/src/com/google/cloud/apigeeconnect/v1/ConnectionServiceClient.java @@ -0,0 +1,467 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS 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.apigeeconnect.v1; + +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.apigeeconnect.v1.stub.ConnectionServiceStub; +import com.google.cloud.apigeeconnect.v1.stub.ConnectionServiceStubSettings; +import com.google.common.util.concurrent.MoreExecutors; +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 Interface for the Apigee Connect connection management APIs. + * + *

        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 (ConnectionServiceClient connectionServiceClient = ConnectionServiceClient.create()) {
        + *   EndpointName parent = EndpointName.of("[PROJECT]", "[ENDPOINT]");
        + *   for (Connection element : connectionServiceClient.listConnections(parent).iterateAll()) {
        + *     // doThingsWith(element);
        + *   }
        + * }
        + * }
        + * + *

        Note: close() needs to be called on the ConnectionServiceClient object to clean up resources + * such as threads. In the example above, try-with-resources is used, which automatically calls + * close(). + * + * + * + * + * + * + * + * + * + * + * + * + * + *
        Methods
        MethodDescriptionMethod Variants

        ListConnections

        Lists connections that are currently active for the given Apigee Connect endpoint.

        + *

        Request object method variants only take one parameter, a request object, which must be constructed before the call.

        + *
          + *
        • listConnections(ListConnectionsRequest request) + *

        + *

        "Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

        + *
          + *
        • listConnections(EndpointName parent) + *

        • listConnections(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.

        + *
          + *
        • listConnectionsPagedCallable() + *

        • listConnectionsCallable() + *

        + *
        + * + *

        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 ConnectionServiceSettings 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
        + * ConnectionServiceSettings connectionServiceSettings =
        + *     ConnectionServiceSettings.newBuilder()
        + *         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
        + *         .build();
        + * ConnectionServiceClient connectionServiceClient =
        + *     ConnectionServiceClient.create(connectionServiceSettings);
        + * }
        + * + *

        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
        + * ConnectionServiceSettings connectionServiceSettings =
        + *     ConnectionServiceSettings.newBuilder().setEndpoint(myEndpoint).build();
        + * ConnectionServiceClient connectionServiceClient =
        + *     ConnectionServiceClient.create(connectionServiceSettings);
        + * }
        + * + *

        To use REST (HTTP1.1/JSON) transport (instead of gRPC) for sending and receiving requests over + * the wire: + * + *

        {@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
        + * ConnectionServiceSettings connectionServiceSettings =
        + *     ConnectionServiceSettings.newHttpJsonBuilder().build();
        + * ConnectionServiceClient connectionServiceClient =
        + *     ConnectionServiceClient.create(connectionServiceSettings);
        + * }
        + * + *

        Please refer to the GitHub repository's samples for more quickstart code snippets. + */ +@Generated("by gapic-generator-java") +public class ConnectionServiceClient implements BackgroundResource { + private final ConnectionServiceSettings settings; + private final ConnectionServiceStub stub; + + /** Constructs an instance of ConnectionServiceClient with default settings. */ + public static final ConnectionServiceClient create() throws IOException { + return create(ConnectionServiceSettings.newBuilder().build()); + } + + /** + * Constructs an instance of ConnectionServiceClient, 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 ConnectionServiceClient create(ConnectionServiceSettings settings) + throws IOException { + return new ConnectionServiceClient(settings); + } + + /** + * Constructs an instance of ConnectionServiceClient, using the given stub for making calls. This + * is for advanced usage - prefer using create(ConnectionServiceSettings). + */ + public static final ConnectionServiceClient create(ConnectionServiceStub stub) { + return new ConnectionServiceClient(stub); + } + + /** + * Constructs an instance of ConnectionServiceClient, 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 ConnectionServiceClient(ConnectionServiceSettings settings) throws IOException { + this.settings = settings; + this.stub = ((ConnectionServiceStubSettings) settings.getStubSettings()).createStub(); + } + + protected ConnectionServiceClient(ConnectionServiceStub stub) { + this.settings = null; + this.stub = stub; + } + + public final ConnectionServiceSettings getSettings() { + return settings; + } + + public ConnectionServiceStub getStub() { + return stub; + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists connections that are currently active for the given Apigee Connect endpoint. + * + *

        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 (ConnectionServiceClient connectionServiceClient = ConnectionServiceClient.create()) {
        +   *   EndpointName parent = EndpointName.of("[PROJECT]", "[ENDPOINT]");
        +   *   for (Connection element : connectionServiceClient.listConnections(parent).iterateAll()) {
        +   *     // doThingsWith(element);
        +   *   }
        +   * }
        +   * }
        + * + * @param parent Required. Parent name of the form: `projects/{project_number or + * project_id}/endpoints/{endpoint}`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListConnectionsPagedResponse listConnections(EndpointName parent) { + ListConnectionsRequest request = + ListConnectionsRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .build(); + return listConnections(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists connections that are currently active for the given Apigee Connect endpoint. + * + *

        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 (ConnectionServiceClient connectionServiceClient = ConnectionServiceClient.create()) {
        +   *   String parent = EndpointName.of("[PROJECT]", "[ENDPOINT]").toString();
        +   *   for (Connection element : connectionServiceClient.listConnections(parent).iterateAll()) {
        +   *     // doThingsWith(element);
        +   *   }
        +   * }
        +   * }
        + * + * @param parent Required. Parent name of the form: `projects/{project_number or + * project_id}/endpoints/{endpoint}`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListConnectionsPagedResponse listConnections(String parent) { + ListConnectionsRequest request = ListConnectionsRequest.newBuilder().setParent(parent).build(); + return listConnections(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists connections that are currently active for the given Apigee Connect endpoint. + * + *

        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 (ConnectionServiceClient connectionServiceClient = ConnectionServiceClient.create()) {
        +   *   ListConnectionsRequest request =
        +   *       ListConnectionsRequest.newBuilder()
        +   *           .setParent(EndpointName.of("[PROJECT]", "[ENDPOINT]").toString())
        +   *           .setPageSize(883849137)
        +   *           .setPageToken("pageToken873572522")
        +   *           .build();
        +   *   for (Connection element : connectionServiceClient.listConnections(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 ListConnectionsPagedResponse listConnections(ListConnectionsRequest request) { + return listConnectionsPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists connections that are currently active for the given Apigee Connect endpoint. + * + *

        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 (ConnectionServiceClient connectionServiceClient = ConnectionServiceClient.create()) {
        +   *   ListConnectionsRequest request =
        +   *       ListConnectionsRequest.newBuilder()
        +   *           .setParent(EndpointName.of("[PROJECT]", "[ENDPOINT]").toString())
        +   *           .setPageSize(883849137)
        +   *           .setPageToken("pageToken873572522")
        +   *           .build();
        +   *   ApiFuture future =
        +   *       connectionServiceClient.listConnectionsPagedCallable().futureCall(request);
        +   *   // Do something.
        +   *   for (Connection element : future.get().iterateAll()) {
        +   *     // doThingsWith(element);
        +   *   }
        +   * }
        +   * }
        + */ + public final UnaryCallable + listConnectionsPagedCallable() { + return stub.listConnectionsPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists connections that are currently active for the given Apigee Connect endpoint. + * + *

        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 (ConnectionServiceClient connectionServiceClient = ConnectionServiceClient.create()) {
        +   *   ListConnectionsRequest request =
        +   *       ListConnectionsRequest.newBuilder()
        +   *           .setParent(EndpointName.of("[PROJECT]", "[ENDPOINT]").toString())
        +   *           .setPageSize(883849137)
        +   *           .setPageToken("pageToken873572522")
        +   *           .build();
        +   *   while (true) {
        +   *     ListConnectionsResponse response =
        +   *         connectionServiceClient.listConnectionsCallable().call(request);
        +   *     for (Connection element : response.getConnectionsList()) {
        +   *       // doThingsWith(element);
        +   *     }
        +   *     String nextPageToken = response.getNextPageToken();
        +   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
        +   *       request = request.toBuilder().setPageToken(nextPageToken).build();
        +   *     } else {
        +   *       break;
        +   *     }
        +   *   }
        +   * }
        +   * }
        + */ + public final UnaryCallable + listConnectionsCallable() { + return stub.listConnectionsCallable(); + } + + @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 ListConnectionsPagedResponse + extends AbstractPagedListResponse< + ListConnectionsRequest, + ListConnectionsResponse, + Connection, + ListConnectionsPage, + ListConnectionsFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListConnectionsPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + input -> new ListConnectionsPagedResponse(input), + MoreExecutors.directExecutor()); + } + + private ListConnectionsPagedResponse(ListConnectionsPage page) { + super(page, ListConnectionsFixedSizeCollection.createEmptyCollection()); + } + } + + public static class ListConnectionsPage + extends AbstractPage< + ListConnectionsRequest, ListConnectionsResponse, Connection, ListConnectionsPage> { + + private ListConnectionsPage( + PageContext context, + ListConnectionsResponse response) { + super(context, response); + } + + private static ListConnectionsPage createEmptyPage() { + return new ListConnectionsPage(null, null); + } + + @Override + protected ListConnectionsPage createPage( + PageContext context, + ListConnectionsResponse response) { + return new ListConnectionsPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class ListConnectionsFixedSizeCollection + extends AbstractFixedSizeCollection< + ListConnectionsRequest, + ListConnectionsResponse, + Connection, + ListConnectionsPage, + ListConnectionsFixedSizeCollection> { + + private ListConnectionsFixedSizeCollection( + List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListConnectionsFixedSizeCollection createEmptyCollection() { + return new ListConnectionsFixedSizeCollection(null, 0); + } + + @Override + protected ListConnectionsFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListConnectionsFixedSizeCollection(pages, collectionSize); + } + } +} diff --git a/test/integration/goldens/apigeeconnect/src/com/google/cloud/apigeeconnect/v1/ConnectionServiceClientHttpJsonTest.java b/test/integration/goldens/apigeeconnect/src/com/google/cloud/apigeeconnect/v1/ConnectionServiceClientHttpJsonTest.java new file mode 100644 index 0000000000..8b797c7de2 --- /dev/null +++ b/test/integration/goldens/apigeeconnect/src/com/google/cloud/apigeeconnect/v1/ConnectionServiceClientHttpJsonTest.java @@ -0,0 +1,177 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS 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.apigeeconnect.v1; + +import static com.google.cloud.apigeeconnect.v1.ConnectionServiceClient.ListConnectionsPagedResponse; + +import com.google.api.gax.core.NoCredentialsProvider; +import com.google.api.gax.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.testing.MockHttpService; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ApiException; +import com.google.api.gax.rpc.ApiExceptionFactory; +import com.google.api.gax.rpc.InvalidArgumentException; +import com.google.api.gax.rpc.StatusCode; +import com.google.api.gax.rpc.testing.FakeStatusCode; +import com.google.cloud.apigeeconnect.v1.stub.HttpJsonConnectionServiceStub; +import com.google.common.collect.Lists; +import java.io.IOException; +import java.util.Arrays; +import java.util.List; +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 ConnectionServiceClientHttpJsonTest { + private static MockHttpService mockService; + private static ConnectionServiceClient client; + + @BeforeClass + public static void startStaticServer() throws IOException { + mockService = + new MockHttpService( + HttpJsonConnectionServiceStub.getMethodDescriptors(), + ConnectionServiceSettings.getDefaultEndpoint()); + ConnectionServiceSettings settings = + ConnectionServiceSettings.newHttpJsonBuilder() + .setTransportChannelProvider( + ConnectionServiceSettings.defaultHttpJsonTransportProviderBuilder() + .setHttpTransport(mockService) + .build()) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = ConnectionServiceClient.create(settings); + } + + @AfterClass + public static void stopServer() { + client.close(); + } + + @Before + public void setUp() {} + + @After + public void tearDown() throws Exception { + mockService.reset(); + } + + @Test + public void listConnectionsTest() throws Exception { + Connection responsesElement = Connection.newBuilder().build(); + ListConnectionsResponse expectedResponse = + ListConnectionsResponse.newBuilder() + .setNextPageToken("") + .addAllConnections(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + EndpointName parent = EndpointName.of("[PROJECT]", "[ENDPOINT]"); + + ListConnectionsPagedResponse pagedListResponse = client.listConnections(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getConnectionsList().get(0), resources.get(0)); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void listConnectionsExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + EndpointName parent = EndpointName.of("[PROJECT]", "[ENDPOINT]"); + client.listConnections(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listConnectionsTest2() throws Exception { + Connection responsesElement = Connection.newBuilder().build(); + ListConnectionsResponse expectedResponse = + ListConnectionsResponse.newBuilder() + .setNextPageToken("") + .addAllConnections(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + String parent = "projects/project-7865/endpoints/endpoint-7865"; + + ListConnectionsPagedResponse pagedListResponse = client.listConnections(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getConnectionsList().get(0), resources.get(0)); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void listConnectionsExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String parent = "projects/project-7865/endpoints/endpoint-7865"; + client.listConnections(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } +} diff --git a/test/integration/goldens/apigeeconnect/src/com/google/cloud/apigeeconnect/v1/ConnectionServiceClientTest.java b/test/integration/goldens/apigeeconnect/src/com/google/cloud/apigeeconnect/v1/ConnectionServiceClientTest.java new file mode 100644 index 0000000000..daa3a2db27 --- /dev/null +++ b/test/integration/goldens/apigeeconnect/src/com/google/cloud/apigeeconnect/v1/ConnectionServiceClientTest.java @@ -0,0 +1,168 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS 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.apigeeconnect.v1; + +import static com.google.cloud.apigeeconnect.v1.ConnectionServiceClient.ListConnectionsPagedResponse; + +import com.google.api.gax.core.NoCredentialsProvider; +import com.google.api.gax.grpc.GaxGrpcProperties; +import com.google.api.gax.grpc.testing.LocalChannelProvider; +import com.google.api.gax.grpc.testing.MockGrpcService; +import com.google.api.gax.grpc.testing.MockServiceHelper; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.InvalidArgumentException; +import com.google.common.collect.Lists; +import com.google.protobuf.AbstractMessage; +import io.grpc.StatusRuntimeException; +import java.io.IOException; +import java.util.Arrays; +import java.util.List; +import java.util.UUID; +import javax.annotation.Generated; +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Assert; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; + +@Generated("by gapic-generator-java") +public class ConnectionServiceClientTest { + private static MockConnectionService mockConnectionService; + private static MockServiceHelper mockServiceHelper; + private LocalChannelProvider channelProvider; + private ConnectionServiceClient client; + + @BeforeClass + public static void startStaticServer() { + mockConnectionService = new MockConnectionService(); + mockServiceHelper = + new MockServiceHelper( + UUID.randomUUID().toString(), Arrays.asList(mockConnectionService)); + mockServiceHelper.start(); + } + + @AfterClass + public static void stopServer() { + mockServiceHelper.stop(); + } + + @Before + public void setUp() throws IOException { + mockServiceHelper.reset(); + channelProvider = mockServiceHelper.createChannelProvider(); + ConnectionServiceSettings settings = + ConnectionServiceSettings.newBuilder() + .setTransportChannelProvider(channelProvider) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = ConnectionServiceClient.create(settings); + } + + @After + public void tearDown() throws Exception { + client.close(); + } + + @Test + public void listConnectionsTest() throws Exception { + Connection responsesElement = Connection.newBuilder().build(); + ListConnectionsResponse expectedResponse = + ListConnectionsResponse.newBuilder() + .setNextPageToken("") + .addAllConnections(Arrays.asList(responsesElement)) + .build(); + mockConnectionService.addResponse(expectedResponse); + + EndpointName parent = EndpointName.of("[PROJECT]", "[ENDPOINT]"); + + ListConnectionsPagedResponse pagedListResponse = client.listConnections(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getConnectionsList().get(0), resources.get(0)); + + List actualRequests = mockConnectionService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListConnectionsRequest actualRequest = ((ListConnectionsRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listConnectionsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockConnectionService.addException(exception); + + try { + EndpointName parent = EndpointName.of("[PROJECT]", "[ENDPOINT]"); + client.listConnections(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listConnectionsTest2() throws Exception { + Connection responsesElement = Connection.newBuilder().build(); + ListConnectionsResponse expectedResponse = + ListConnectionsResponse.newBuilder() + .setNextPageToken("") + .addAllConnections(Arrays.asList(responsesElement)) + .build(); + mockConnectionService.addResponse(expectedResponse); + + String parent = "parent-995424086"; + + ListConnectionsPagedResponse pagedListResponse = client.listConnections(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getConnectionsList().get(0), resources.get(0)); + + List actualRequests = mockConnectionService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListConnectionsRequest actualRequest = ((ListConnectionsRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listConnectionsExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockConnectionService.addException(exception); + + try { + String parent = "parent-995424086"; + client.listConnections(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } +} diff --git a/test/integration/goldens/apigeeconnect/src/com/google/cloud/apigeeconnect/v1/ConnectionServiceSettings.java b/test/integration/goldens/apigeeconnect/src/com/google/cloud/apigeeconnect/v1/ConnectionServiceSettings.java new file mode 100644 index 0000000000..335e0f4be3 --- /dev/null +++ b/test/integration/goldens/apigeeconnect/src/com/google/cloud/apigeeconnect/v1/ConnectionServiceSettings.java @@ -0,0 +1,223 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS 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.apigeeconnect.v1; + +import static com.google.cloud.apigeeconnect.v1.ConnectionServiceClient.ListConnectionsPagedResponse; + +import com.google.api.core.ApiFunction; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; +import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; +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.StubSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.cloud.apigeeconnect.v1.stub.ConnectionServiceStubSettings; +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 ConnectionServiceClient}. + * + *

        The default instance has everything set to sensible defaults: + * + *

          + *
        • The default service address (apigeeconnect.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 listConnections: + * + *

        {@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
        + * ConnectionServiceSettings.Builder connectionServiceSettingsBuilder =
        + *     ConnectionServiceSettings.newBuilder();
        + * connectionServiceSettingsBuilder
        + *     .listConnectionsSettings()
        + *     .setRetrySettings(
        + *         connectionServiceSettingsBuilder
        + *             .listConnectionsSettings()
        + *             .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());
        + * ConnectionServiceSettings connectionServiceSettings = connectionServiceSettingsBuilder.build();
        + * }
        + * + * Please refer to the [Client Side Retry + * Guide](https://docs.cloud.google.com/java/docs/client-retries) for additional support in setting + * retries. + */ +@Generated("by gapic-generator-java") +public class ConnectionServiceSettings extends ClientSettings { + + /** Returns the object with the settings used for calls to listConnections. */ + public PagedCallSettings< + ListConnectionsRequest, ListConnectionsResponse, ListConnectionsPagedResponse> + listConnectionsSettings() { + return ((ConnectionServiceStubSettings) getStubSettings()).listConnectionsSettings(); + } + + public static final ConnectionServiceSettings create(ConnectionServiceStubSettings stub) + throws IOException { + return new ConnectionServiceSettings.Builder(stub.toBuilder()).build(); + } + + /** Returns a builder for the default ExecutorProvider for this service. */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return ConnectionServiceStubSettings.defaultExecutorProviderBuilder(); + } + + /** Returns the default service endpoint. */ + public static String getDefaultEndpoint() { + return ConnectionServiceStubSettings.getDefaultEndpoint(); + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return ConnectionServiceStubSettings.getDefaultServiceScopes(); + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return ConnectionServiceStubSettings.defaultCredentialsProviderBuilder(); + } + + /** Returns a builder for the default gRPC ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return ConnectionServiceStubSettings.defaultGrpcTransportProviderBuilder(); + } + + /** Returns a builder for the default REST ChannelProvider for this service. */ + @BetaApi + public static InstantiatingHttpJsonChannelProvider.Builder + defaultHttpJsonTransportProviderBuilder() { + return ConnectionServiceStubSettings.defaultHttpJsonTransportProviderBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return ConnectionServiceStubSettings.defaultTransportChannelProvider(); + } + + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return ConnectionServiceStubSettings.defaultApiClientHeaderProviderBuilder(); + } + + /** Returns a new gRPC builder for this class. */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** Returns a new REST builder for this class. */ + public static Builder newHttpJsonBuilder() { + return Builder.createHttpJsonDefault(); + } + + /** 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 ConnectionServiceSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + } + + /** Builder for ConnectionServiceSettings. */ + public static class Builder extends ClientSettings.Builder { + + protected Builder() throws IOException { + this(((ClientContext) null)); + } + + protected Builder(ClientContext clientContext) { + super(ConnectionServiceStubSettings.newBuilder(clientContext)); + } + + protected Builder(ConnectionServiceSettings settings) { + super(settings.getStubSettings().toBuilder()); + } + + protected Builder(ConnectionServiceStubSettings.Builder stubSettings) { + super(stubSettings); + } + + private static Builder createDefault() { + return new Builder(ConnectionServiceStubSettings.newBuilder()); + } + + private static Builder createHttpJsonDefault() { + return new Builder(ConnectionServiceStubSettings.newHttpJsonBuilder()); + } + + public ConnectionServiceStubSettings.Builder getStubSettingsBuilder() { + return ((ConnectionServiceStubSettings.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 listConnections. */ + public PagedCallSettings.Builder< + ListConnectionsRequest, ListConnectionsResponse, ListConnectionsPagedResponse> + listConnectionsSettings() { + return getStubSettingsBuilder().listConnectionsSettings(); + } + + @Override + public ConnectionServiceSettings build() throws IOException { + return new ConnectionServiceSettings(this); + } + } +} diff --git a/test/integration/goldens/apigeeconnect/src/com/google/cloud/apigeeconnect/v1/EndpointName.java b/test/integration/goldens/apigeeconnect/src/com/google/cloud/apigeeconnect/v1/EndpointName.java new file mode 100644 index 0000000000..16bf12e163 --- /dev/null +++ b/test/integration/goldens/apigeeconnect/src/com/google/cloud/apigeeconnect/v1/EndpointName.java @@ -0,0 +1,192 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS 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.apigeeconnect.v1; + +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 EndpointName implements ResourceName { + private static final PathTemplate PROJECT_ENDPOINT = + PathTemplate.createWithoutUrlEncoding("projects/{project}/endpoints/{endpoint}"); + private volatile Map fieldValuesMap; + private final String project; + private final String endpoint; + + @Deprecated + protected EndpointName() { + project = null; + endpoint = null; + } + + private EndpointName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + endpoint = Preconditions.checkNotNull(builder.getEndpoint()); + } + + public String getProject() { + return project; + } + + public String getEndpoint() { + return endpoint; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + public static EndpointName of(String project, String endpoint) { + return newBuilder().setProject(project).setEndpoint(endpoint).build(); + } + + public static String format(String project, String endpoint) { + return newBuilder().setProject(project).setEndpoint(endpoint).build().toString(); + } + + public static EndpointName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + PROJECT_ENDPOINT.validatedMatch( + formattedString, "EndpointName.parse: formattedString not in valid format"); + return of(matchMap.get("project"), matchMap.get("endpoint")); + } + + 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 (EndpointName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return PROJECT_ENDPOINT.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 (endpoint != null) { + fieldMapBuilder.put("endpoint", endpoint); + } + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return PROJECT_ENDPOINT.instantiate("project", project, "endpoint", endpoint); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o != null && getClass() == o.getClass()) { + EndpointName that = ((EndpointName) o); + return Objects.equals(this.project, that.project) + && Objects.equals(this.endpoint, that.endpoint); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= Objects.hashCode(project); + h *= 1000003; + h ^= Objects.hashCode(endpoint); + return h; + } + + /** Builder for projects/{project}/endpoints/{endpoint}. */ + public static class Builder { + private String project; + private String endpoint; + + protected Builder() {} + + public String getProject() { + return project; + } + + public String getEndpoint() { + return endpoint; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + public Builder setEndpoint(String endpoint) { + this.endpoint = endpoint; + return this; + } + + private Builder(EndpointName endpointName) { + this.project = endpointName.project; + this.endpoint = endpointName.endpoint; + } + + public EndpointName build() { + return new EndpointName(this); + } + } +} diff --git a/test/integration/goldens/apigeeconnect/src/com/google/cloud/apigeeconnect/v1/MockConnectionService.java b/test/integration/goldens/apigeeconnect/src/com/google/cloud/apigeeconnect/v1/MockConnectionService.java new file mode 100644 index 0000000000..3546e1b2d0 --- /dev/null +++ b/test/integration/goldens/apigeeconnect/src/com/google/cloud/apigeeconnect/v1/MockConnectionService.java @@ -0,0 +1,59 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS 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.apigeeconnect.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.grpc.testing.MockGrpcService; +import com.google.protobuf.AbstractMessage; +import io.grpc.ServerServiceDefinition; +import java.util.List; +import javax.annotation.Generated; + +@BetaApi +@Generated("by gapic-generator-java") +public class MockConnectionService implements MockGrpcService { + private final MockConnectionServiceImpl serviceImpl; + + public MockConnectionService() { + serviceImpl = new MockConnectionServiceImpl(); + } + + @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/test/integration/goldens/apigeeconnect/src/com/google/cloud/apigeeconnect/v1/MockConnectionServiceImpl.java b/test/integration/goldens/apigeeconnect/src/com/google/cloud/apigeeconnect/v1/MockConnectionServiceImpl.java new file mode 100644 index 0000000000..2d7d9bd98e --- /dev/null +++ b/test/integration/goldens/apigeeconnect/src/com/google/cloud/apigeeconnect/v1/MockConnectionServiceImpl.java @@ -0,0 +1,81 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS 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.apigeeconnect.v1; + +import com.google.api.core.BetaApi; +import com.google.cloud.apigeeconnect.v1.ConnectionServiceGrpc.ConnectionServiceImplBase; +import com.google.protobuf.AbstractMessage; +import io.grpc.stub.StreamObserver; +import java.util.ArrayList; +import java.util.LinkedList; +import java.util.List; +import java.util.Queue; +import javax.annotation.Generated; + +@BetaApi +@Generated("by gapic-generator-java") +public class MockConnectionServiceImpl extends ConnectionServiceImplBase { + private List requests; + private Queue responses; + + public MockConnectionServiceImpl() { + 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 listConnections( + ListConnectionsRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof ListConnectionsResponse) { + requests.add(request); + responseObserver.onNext(((ListConnectionsResponse) 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 ListConnections, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + ListConnectionsResponse.class.getName(), + Exception.class.getName()))); + } + } +} diff --git a/test/integration/goldens/apigeeconnect/src/com/google/cloud/apigeeconnect/v1/MockTether.java b/test/integration/goldens/apigeeconnect/src/com/google/cloud/apigeeconnect/v1/MockTether.java new file mode 100644 index 0000000000..fa2de3231c --- /dev/null +++ b/test/integration/goldens/apigeeconnect/src/com/google/cloud/apigeeconnect/v1/MockTether.java @@ -0,0 +1,59 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS 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.apigeeconnect.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.grpc.testing.MockGrpcService; +import com.google.protobuf.AbstractMessage; +import io.grpc.ServerServiceDefinition; +import java.util.List; +import javax.annotation.Generated; + +@BetaApi +@Generated("by gapic-generator-java") +public class MockTether implements MockGrpcService { + private final MockTetherImpl serviceImpl; + + public MockTether() { + serviceImpl = new MockTetherImpl(); + } + + @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/test/integration/goldens/apigeeconnect/src/com/google/cloud/apigeeconnect/v1/MockTetherImpl.java b/test/integration/goldens/apigeeconnect/src/com/google/cloud/apigeeconnect/v1/MockTetherImpl.java new file mode 100644 index 0000000000..3a350e0fe0 --- /dev/null +++ b/test/integration/goldens/apigeeconnect/src/com/google/cloud/apigeeconnect/v1/MockTetherImpl.java @@ -0,0 +1,97 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS 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.apigeeconnect.v1; + +import com.google.api.core.BetaApi; +import com.google.cloud.apigeeconnect.v1.TetherGrpc.TetherImplBase; +import com.google.protobuf.AbstractMessage; +import io.grpc.stub.StreamObserver; +import java.util.ArrayList; +import java.util.LinkedList; +import java.util.List; +import java.util.Queue; +import javax.annotation.Generated; + +@BetaApi +@Generated("by gapic-generator-java") +public class MockTetherImpl extends TetherImplBase { + private List requests; + private Queue responses; + + public MockTetherImpl() { + 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 StreamObserver egress( + final StreamObserver responseObserver) { + StreamObserver requestObserver = + new StreamObserver() { + @Override + public void onNext(EgressResponse value) { + requests.add(value); + final Object response = responses.remove(); + if (response instanceof EgressRequest) { + responseObserver.onNext(((EgressRequest) response)); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method Egress, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + EgressRequest.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/test/integration/goldens/apigeeconnect/src/com/google/cloud/apigeeconnect/v1/TetherClient.java b/test/integration/goldens/apigeeconnect/src/com/google/cloud/apigeeconnect/v1/TetherClient.java new file mode 100644 index 0000000000..f3cd1b0dc6 --- /dev/null +++ b/test/integration/goldens/apigeeconnect/src/com/google/cloud/apigeeconnect/v1/TetherClient.java @@ -0,0 +1,237 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS 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.apigeeconnect.v1; + +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.rpc.BidiStreamingCallable; +import com.google.cloud.apigeeconnect.v1.stub.TetherStub; +import com.google.cloud.apigeeconnect.v1.stub.TetherStubSettings; +import java.io.IOException; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Service Description: Tether provides a way for the control plane to send HTTP API requests to + * services in data planes that runs in a remote datacenter without requiring customers to open + * firewalls on their runtime plane. + * + *

        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 (TetherClient tetherClient = TetherClient.create()) {
        + *   BidiStream bidiStream = tetherClient.egressCallable().call();
        + *   EgressResponse request =
        + *       EgressResponse.newBuilder()
        + *           .setId("id3355")
        + *           .setHttpResponse(HttpResponse.newBuilder().build())
        + *           .setStatus(Status.newBuilder().build())
        + *           .setProject("project-309310695")
        + *           .setTraceId("traceId-1067401920")
        + *           .setEndpoint(TetherEndpoint.forNumber(0))
        + *           .setName("name3373707")
        + *           .build();
        + *   bidiStream.send(request);
        + *   for (EgressRequest response : bidiStream) {
        + *     // Do something when a response is received.
        + *   }
        + * }
        + * }
        + * + *

        Note: close() needs to be called on the TetherClient object to clean up resources such as + * threads. In the example above, try-with-resources is used, which automatically calls close(). + * + * + * + * + * + * + * + * + * + * + * + * + * + *
        Methods
        MethodDescriptionMethod Variants

        Egress

        Egress streams egress requests and responses. Logically, this is not actually a streaming request, but uses streaming as a mechanism to flip the client-server relationship of gRPC so that the server can act as a client. The listener, the RPC server, accepts connections from the dialer, the RPC client. The listener streams http requests and the dialer streams http responses.

        + *

        Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

        + *
          + *
        • egressCallable() + *

        + *
        + * + *

        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 TetherSettings 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
        + * TetherSettings tetherSettings =
        + *     TetherSettings.newBuilder()
        + *         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
        + *         .build();
        + * TetherClient tetherClient = TetherClient.create(tetherSettings);
        + * }
        + * + *

        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
        + * TetherSettings tetherSettings = TetherSettings.newBuilder().setEndpoint(myEndpoint).build();
        + * TetherClient tetherClient = TetherClient.create(tetherSettings);
        + * }
        + * + *

        Please refer to the GitHub repository's samples for more quickstart code snippets. + */ +@Generated("by gapic-generator-java") +public class TetherClient implements BackgroundResource { + private final TetherSettings settings; + private final TetherStub stub; + + /** Constructs an instance of TetherClient with default settings. */ + public static final TetherClient create() throws IOException { + return create(TetherSettings.newBuilder().build()); + } + + /** + * Constructs an instance of TetherClient, 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 TetherClient create(TetherSettings settings) throws IOException { + return new TetherClient(settings); + } + + /** + * Constructs an instance of TetherClient, using the given stub for making calls. This is for + * advanced usage - prefer using create(TetherSettings). + */ + public static final TetherClient create(TetherStub stub) { + return new TetherClient(stub); + } + + /** + * Constructs an instance of TetherClient, 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 TetherClient(TetherSettings settings) throws IOException { + this.settings = settings; + this.stub = ((TetherStubSettings) settings.getStubSettings()).createStub(); + } + + protected TetherClient(TetherStub stub) { + this.settings = null; + this.stub = stub; + } + + public final TetherSettings getSettings() { + return settings; + } + + public TetherStub getStub() { + return stub; + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Egress streams egress requests and responses. Logically, this is not actually a streaming + * request, but uses streaming as a mechanism to flip the client-server relationship of gRPC so + * that the server can act as a client. The listener, the RPC server, accepts connections from the + * dialer, the RPC client. The listener streams http requests and the dialer streams http + * responses. + * + *

        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 (TetherClient tetherClient = TetherClient.create()) {
        +   *   BidiStream bidiStream = tetherClient.egressCallable().call();
        +   *   EgressResponse request =
        +   *       EgressResponse.newBuilder()
        +   *           .setId("id3355")
        +   *           .setHttpResponse(HttpResponse.newBuilder().build())
        +   *           .setStatus(Status.newBuilder().build())
        +   *           .setProject("project-309310695")
        +   *           .setTraceId("traceId-1067401920")
        +   *           .setEndpoint(TetherEndpoint.forNumber(0))
        +   *           .setName("name3373707")
        +   *           .build();
        +   *   bidiStream.send(request);
        +   *   for (EgressRequest response : bidiStream) {
        +   *     // Do something when a response is received.
        +   *   }
        +   * }
        +   * }
        + */ + public final BidiStreamingCallable egressCallable() { + return stub.egressCallable(); + } + + @Override + public final void close() { + stub.close(); + } + + @Override + public void shutdown() { + stub.shutdown(); + } + + @Override + public boolean isShutdown() { + return stub.isShutdown(); + } + + @Override + public boolean isTerminated() { + return stub.isTerminated(); + } + + @Override + public void shutdownNow() { + stub.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return stub.awaitTermination(duration, unit); + } +} diff --git a/test/integration/goldens/apigeeconnect/src/com/google/cloud/apigeeconnect/v1/TetherClientTest.java b/test/integration/goldens/apigeeconnect/src/com/google/cloud/apigeeconnect/v1/TetherClientTest.java new file mode 100644 index 0000000000..32427e9a43 --- /dev/null +++ b/test/integration/goldens/apigeeconnect/src/com/google/cloud/apigeeconnect/v1/TetherClientTest.java @@ -0,0 +1,151 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS 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.apigeeconnect.v1; + +import com.google.api.gax.core.NoCredentialsProvider; +import com.google.api.gax.grpc.testing.LocalChannelProvider; +import com.google.api.gax.grpc.testing.MockGrpcService; +import com.google.api.gax.grpc.testing.MockServiceHelper; +import com.google.api.gax.grpc.testing.MockStreamObserver; +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.protobuf.Duration; +import com.google.rpc.Status; +import io.grpc.StatusRuntimeException; +import java.io.IOException; +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 TetherClientTest { + private static MockServiceHelper mockServiceHelper; + private static MockTether mockTether; + private LocalChannelProvider channelProvider; + private TetherClient client; + + @BeforeClass + public static void startStaticServer() { + mockTether = new MockTether(); + mockServiceHelper = + new MockServiceHelper( + UUID.randomUUID().toString(), Arrays.asList(mockTether)); + mockServiceHelper.start(); + } + + @AfterClass + public static void stopServer() { + mockServiceHelper.stop(); + } + + @Before + public void setUp() throws IOException { + mockServiceHelper.reset(); + channelProvider = mockServiceHelper.createChannelProvider(); + TetherSettings settings = + TetherSettings.newBuilder() + .setTransportChannelProvider(channelProvider) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = TetherClient.create(settings); + } + + @After + public void tearDown() throws Exception { + client.close(); + } + + @Test + public void egressTest() throws Exception { + EgressRequest expectedResponse = + EgressRequest.newBuilder() + .setId("id3355") + .setPayload(Payload.newBuilder().build()) + .setEndpoint(TetherEndpoint.forNumber(0)) + .setProject("project-309310695") + .setTraceId("traceId-1067401920") + .setTimeout(Duration.newBuilder().build()) + .build(); + mockTether.addResponse(expectedResponse); + EgressResponse request = + EgressResponse.newBuilder() + .setId("id3355") + .setHttpResponse(HttpResponse.newBuilder().build()) + .setStatus(Status.newBuilder().build()) + .setProject("project-309310695") + .setTraceId("traceId-1067401920") + .setEndpoint(TetherEndpoint.forNumber(0)) + .setName("name3373707") + .build(); + + MockStreamObserver responseObserver = new MockStreamObserver<>(); + + BidiStreamingCallable callable = client.egressCallable(); + 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 egressExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockTether.addException(exception); + EgressResponse request = + EgressResponse.newBuilder() + .setId("id3355") + .setHttpResponse(HttpResponse.newBuilder().build()) + .setStatus(Status.newBuilder().build()) + .setProject("project-309310695") + .setTraceId("traceId-1067401920") + .setEndpoint(TetherEndpoint.forNumber(0)) + .setName("name3373707") + .build(); + + MockStreamObserver responseObserver = new MockStreamObserver<>(); + + BidiStreamingCallable callable = client.egressCallable(); + 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/test/integration/goldens/apigeeconnect/src/com/google/cloud/apigeeconnect/v1/TetherSettings.java b/test/integration/goldens/apigeeconnect/src/com/google/cloud/apigeeconnect/v1/TetherSettings.java new file mode 100644 index 0000000000..5c941f005e --- /dev/null +++ b/test/integration/goldens/apigeeconnect/src/com/google/cloud/apigeeconnect/v1/TetherSettings.java @@ -0,0 +1,197 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS 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.apigeeconnect.v1; + +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.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.cloud.apigeeconnect.v1.stub.TetherStubSettings; +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 TetherClient}. + * + *

        The default instance has everything set to sensible defaults: + * + *

          + *
        • The default service address (apigeeconnect.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 egress: + * + *

        {@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
        + * TetherSettings.Builder tetherSettingsBuilder = TetherSettings.newBuilder();
        + * tetherSettingsBuilder
        + *     .egressSettings()
        + *     .setRetrySettings(
        + *         tetherSettingsBuilder
        + *             .egressSettings()
        + *             .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());
        + * TetherSettings tetherSettings = tetherSettingsBuilder.build();
        + * }
        + * + * Please refer to the [Client Side Retry + * Guide](https://docs.cloud.google.com/java/docs/client-retries) for additional support in setting + * retries. + */ +@Generated("by gapic-generator-java") +public class TetherSettings extends ClientSettings { + + /** Returns the object with the settings used for calls to egress. */ + public StreamingCallSettings egressSettings() { + return ((TetherStubSettings) getStubSettings()).egressSettings(); + } + + public static final TetherSettings create(TetherStubSettings stub) throws IOException { + return new TetherSettings.Builder(stub.toBuilder()).build(); + } + + /** Returns a builder for the default ExecutorProvider for this service. */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return TetherStubSettings.defaultExecutorProviderBuilder(); + } + + /** Returns the default service endpoint. */ + public static String getDefaultEndpoint() { + return TetherStubSettings.getDefaultEndpoint(); + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return TetherStubSettings.getDefaultServiceScopes(); + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return TetherStubSettings.defaultCredentialsProviderBuilder(); + } + + /** Returns a builder for the default gRPC ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return TetherStubSettings.defaultGrpcTransportProviderBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return TetherStubSettings.defaultTransportChannelProvider(); + } + + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return TetherStubSettings.defaultApiClientHeaderProviderBuilder(); + } + + /** Returns a new gRPC 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 TetherSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + } + + /** Builder for TetherSettings. */ + public static class Builder extends ClientSettings.Builder { + + protected Builder() throws IOException { + this(((ClientContext) null)); + } + + protected Builder(ClientContext clientContext) { + super(TetherStubSettings.newBuilder(clientContext)); + } + + protected Builder(TetherSettings settings) { + super(settings.getStubSettings().toBuilder()); + } + + protected Builder(TetherStubSettings.Builder stubSettings) { + super(stubSettings); + } + + private static Builder createDefault() { + return new Builder(TetherStubSettings.newBuilder()); + } + + public TetherStubSettings.Builder getStubSettingsBuilder() { + return ((TetherStubSettings.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 egress. */ + public StreamingCallSettings.Builder egressSettings() { + return getStubSettingsBuilder().egressSettings(); + } + + @Override + public TetherSettings build() throws IOException { + return new TetherSettings(this); + } + } +} diff --git a/test/integration/goldens/apigeeconnect/src/com/google/cloud/apigeeconnect/v1/gapic_metadata.json b/test/integration/goldens/apigeeconnect/src/com/google/cloud/apigeeconnect/v1/gapic_metadata.json new file mode 100644 index 0000000000..3a2757f4ca --- /dev/null +++ b/test/integration/goldens/apigeeconnect/src/com/google/cloud/apigeeconnect/v1/gapic_metadata.json @@ -0,0 +1,33 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "java", + "protoPackage": "google.cloud.apigeeconnect.v1", + "libraryPackage": "com.google.cloud.apigeeconnect.v1", + "services": { + "ConnectionService": { + "clients": { + "grpc": { + "libraryClient": "ConnectionServiceClient", + "rpcs": { + "ListConnections": { + "methods": ["listConnections", "listConnections", "listConnections", "listConnectionsPagedCallable", "listConnectionsCallable"] + } + } + } + } + }, + "Tether": { + "clients": { + "grpc": { + "libraryClient": "TetherClient", + "rpcs": { + "Egress": { + "methods": ["egressCallable"] + } + } + } + } + } + } +} \ No newline at end of file diff --git a/test/integration/goldens/apigeeconnect/src/com/google/cloud/apigeeconnect/v1/package-info.java b/test/integration/goldens/apigeeconnect/src/com/google/cloud/apigeeconnect/v1/package-info.java new file mode 100644 index 0000000000..cde6e632f2 --- /dev/null +++ b/test/integration/goldens/apigeeconnect/src/com/google/cloud/apigeeconnect/v1/package-info.java @@ -0,0 +1,76 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * The interfaces provided are listed below, along with usage samples. + * + *

        ======================= ConnectionServiceClient ======================= + * + *

        Service Description: Service Interface for the Apigee Connect connection management APIs. + * + *

        Sample for ConnectionServiceClient: + * + *

        {@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 (ConnectionServiceClient connectionServiceClient = ConnectionServiceClient.create()) {
        + *   EndpointName parent = EndpointName.of("[PROJECT]", "[ENDPOINT]");
        + *   for (Connection element : connectionServiceClient.listConnections(parent).iterateAll()) {
        + *     // doThingsWith(element);
        + *   }
        + * }
        + * }
        + * + *

        ======================= TetherClient ======================= + * + *

        Service Description: Tether provides a way for the control plane to send HTTP API requests to + * services in data planes that runs in a remote datacenter without requiring customers to open + * firewalls on their runtime plane. + * + *

        Sample for TetherClient: + * + *

        {@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 (TetherClient tetherClient = TetherClient.create()) {
        + *   BidiStream bidiStream = tetherClient.egressCallable().call();
        + *   EgressResponse request =
        + *       EgressResponse.newBuilder()
        + *           .setId("id3355")
        + *           .setHttpResponse(HttpResponse.newBuilder().build())
        + *           .setStatus(Status.newBuilder().build())
        + *           .setProject("project-309310695")
        + *           .setTraceId("traceId-1067401920")
        + *           .setEndpoint(TetherEndpoint.forNumber(0))
        + *           .setName("name3373707")
        + *           .build();
        + *   bidiStream.send(request);
        + *   for (EgressRequest response : bidiStream) {
        + *     // Do something when a response is received.
        + *   }
        + * }
        + * }
        + */ +@Generated("by gapic-generator-java") +package com.google.cloud.apigeeconnect.v1; + +import javax.annotation.Generated; diff --git a/test/integration/goldens/apigeeconnect/src/com/google/cloud/apigeeconnect/v1/stub/ConnectionServiceStub.java b/test/integration/goldens/apigeeconnect/src/com/google/cloud/apigeeconnect/v1/stub/ConnectionServiceStub.java new file mode 100644 index 0000000000..c1235c1836 --- /dev/null +++ b/test/integration/goldens/apigeeconnect/src/com/google/cloud/apigeeconnect/v1/stub/ConnectionServiceStub.java @@ -0,0 +1,47 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS 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.apigeeconnect.v1.stub; + +import static com.google.cloud.apigeeconnect.v1.ConnectionServiceClient.ListConnectionsPagedResponse; + +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.apigeeconnect.v1.ListConnectionsRequest; +import com.google.cloud.apigeeconnect.v1.ListConnectionsResponse; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Base stub class for the ConnectionService service API. + * + *

        This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by gapic-generator-java") +public abstract class ConnectionServiceStub implements BackgroundResource { + + public UnaryCallable + listConnectionsPagedCallable() { + throw new UnsupportedOperationException("Not implemented: listConnectionsPagedCallable()"); + } + + public UnaryCallable listConnectionsCallable() { + throw new UnsupportedOperationException("Not implemented: listConnectionsCallable()"); + } + + @Override + public abstract void close(); +} diff --git a/test/integration/goldens/apigeeconnect/src/com/google/cloud/apigeeconnect/v1/stub/ConnectionServiceStubSettings.java b/test/integration/goldens/apigeeconnect/src/com/google/cloud/apigeeconnect/v1/stub/ConnectionServiceStubSettings.java new file mode 100644 index 0000000000..b603e4ed4a --- /dev/null +++ b/test/integration/goldens/apigeeconnect/src/com/google/cloud/apigeeconnect/v1/stub/ConnectionServiceStubSettings.java @@ -0,0 +1,424 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS 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.apigeeconnect.v1.stub; + +import static com.google.cloud.apigeeconnect.v1.ConnectionServiceClient.ListConnectionsPagedResponse; + +import com.google.api.core.ApiFunction; +import com.google.api.core.ApiFuture; +import com.google.api.core.BetaApi; +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.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.HttpJsonTransportChannel; +import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; +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.LibraryMetadata; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.PagedListDescriptor; +import com.google.api.gax.rpc.PagedListResponseFactory; +import com.google.api.gax.rpc.StatusCode; +import com.google.api.gax.rpc.StubSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.apigeeconnect.v1.Connection; +import com.google.cloud.apigeeconnect.v1.ListConnectionsRequest; +import com.google.cloud.apigeeconnect.v1.ListConnectionsResponse; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.ImmutableSet; +import com.google.common.collect.Lists; +import java.io.IOException; +import java.time.Duration; +import java.util.List; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Settings class to configure an instance of {@link ConnectionServiceStub}. + * + *

        The default instance has everything set to sensible defaults: + * + *

          + *
        • The default service address (apigeeconnect.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 listConnections: + * + *

        {@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
        + * ConnectionServiceStubSettings.Builder connectionServiceSettingsBuilder =
        + *     ConnectionServiceStubSettings.newBuilder();
        + * connectionServiceSettingsBuilder
        + *     .listConnectionsSettings()
        + *     .setRetrySettings(
        + *         connectionServiceSettingsBuilder
        + *             .listConnectionsSettings()
        + *             .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());
        + * ConnectionServiceStubSettings connectionServiceSettings =
        + *     connectionServiceSettingsBuilder.build();
        + * }
        + * + * Please refer to the [Client Side Retry + * Guide](https://docs.cloud.google.com/java/docs/client-retries) for additional support in setting + * retries. + */ +@Generated("by gapic-generator-java") +@SuppressWarnings("CanonicalDuration") +public class ConnectionServiceStubSettings extends StubSettings { + /** The default scopes of the service. */ + private static final ImmutableList DEFAULT_SERVICE_SCOPES = + ImmutableList.builder().add("https://www.googleapis.com/auth/cloud-platform").build(); + + private final PagedCallSettings< + ListConnectionsRequest, ListConnectionsResponse, ListConnectionsPagedResponse> + listConnectionsSettings; + + private static final PagedListDescriptor< + ListConnectionsRequest, ListConnectionsResponse, Connection> + LIST_CONNECTIONS_PAGE_STR_DESC = + new PagedListDescriptor() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public ListConnectionsRequest injectToken( + ListConnectionsRequest payload, String token) { + return ListConnectionsRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public ListConnectionsRequest injectPageSize( + ListConnectionsRequest payload, int pageSize) { + return ListConnectionsRequest.newBuilder(payload).setPageSize(pageSize).build(); + } + + @Override + public Integer extractPageSize(ListConnectionsRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(ListConnectionsResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources(ListConnectionsResponse payload) { + return payload.getConnectionsList(); + } + }; + + private static final PagedListResponseFactory< + ListConnectionsRequest, ListConnectionsResponse, ListConnectionsPagedResponse> + LIST_CONNECTIONS_PAGE_STR_FACT = + new PagedListResponseFactory< + ListConnectionsRequest, ListConnectionsResponse, ListConnectionsPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListConnectionsRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext pageContext = + PageContext.create(callable, LIST_CONNECTIONS_PAGE_STR_DESC, request, context); + return ListConnectionsPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + /** Returns the object with the settings used for calls to listConnections. */ + public PagedCallSettings< + ListConnectionsRequest, ListConnectionsResponse, ListConnectionsPagedResponse> + listConnectionsSettings() { + return listConnectionsSettings; + } + + public ConnectionServiceStub createStub() throws IOException { + if (getTransportChannelProvider() + .getTransportName() + .equals(GrpcTransportChannel.getGrpcTransportName())) { + return GrpcConnectionServiceStub.create(this); + } + if (getTransportChannelProvider() + .getTransportName() + .equals(HttpJsonTransportChannel.getHttpJsonTransportName())) { + return HttpJsonConnectionServiceStub.create(this); + } + throw new UnsupportedOperationException( + String.format( + "Transport not supported: %s", getTransportChannelProvider().getTransportName())); + } + + /** Returns the default service name. */ + @Override + public String getServiceName() { + return "apigeeconnect"; + } + + /** 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 "apigeeconnect.googleapis.com:443"; + } + + /** Returns the default mTLS service endpoint. */ + public static String getDefaultMtlsEndpoint() { + return "apigeeconnect.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 gRPC ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return InstantiatingGrpcChannelProvider.newBuilder() + .setMaxInboundMessageSize(Integer.MAX_VALUE); + } + + /** Returns a builder for the default REST ChannelProvider for this service. */ + @BetaApi + public static InstantiatingHttpJsonChannelProvider.Builder + defaultHttpJsonTransportProviderBuilder() { + return InstantiatingHttpJsonChannelProvider.newBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return defaultGrpcTransportProviderBuilder().build(); + } + + public static ApiClientHeaderProvider.Builder defaultGrpcApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken( + "gapic", GaxProperties.getLibraryVersion(ConnectionServiceStubSettings.class)) + .setTransportToken( + GaxGrpcProperties.getGrpcTokenName(), GaxGrpcProperties.getGrpcVersion()); + } + + public static ApiClientHeaderProvider.Builder defaultHttpJsonApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken( + "gapic", GaxProperties.getLibraryVersion(ConnectionServiceStubSettings.class)) + .setTransportToken( + GaxHttpJsonProperties.getHttpJsonTokenName(), + GaxHttpJsonProperties.getHttpJsonVersion()); + } + + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return ConnectionServiceStubSettings.defaultGrpcApiClientHeaderProviderBuilder(); + } + + /** Returns a new gRPC builder for this class. */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** Returns a new REST builder for this class. */ + public static Builder newHttpJsonBuilder() { + return Builder.createHttpJsonDefault(); + } + + /** 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 ConnectionServiceStubSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + + listConnectionsSettings = settingsBuilder.listConnectionsSettings().build(); + } + + @Override + protected LibraryMetadata getLibraryMetadata() { + return LibraryMetadata.newBuilder().setVersion(Version.VERSION).build(); + } + + /** Builder for ConnectionServiceStubSettings. */ + public static class Builder extends StubSettings.Builder { + private final ImmutableList> unaryMethodSettingsBuilders; + private final PagedCallSettings.Builder< + ListConnectionsRequest, ListConnectionsResponse, ListConnectionsPagedResponse> + listConnectionsSettings; + private static final ImmutableMap> + RETRYABLE_CODE_DEFINITIONS; + + static { + ImmutableMap.Builder> definitions = + ImmutableMap.builder(); + definitions.put( + "retry_policy_0_codes", + ImmutableSet.copyOf( + Lists.newArrayList( + StatusCode.Code.UNAVAILABLE, StatusCode.Code.UNKNOWN))); + 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(1000L)) + .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_0_params", settings); + RETRY_PARAM_DEFINITIONS = definitions.build(); + } + + protected Builder() { + this(((ClientContext) null)); + } + + protected Builder(ClientContext clientContext) { + super(clientContext); + + listConnectionsSettings = PagedCallSettings.newBuilder(LIST_CONNECTIONS_PAGE_STR_FACT); + + unaryMethodSettingsBuilders = + ImmutableList.>of(listConnectionsSettings); + initDefaults(this); + } + + protected Builder(ConnectionServiceStubSettings settings) { + super(settings); + + listConnectionsSettings = settings.listConnectionsSettings.toBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of(listConnectionsSettings); + } + + 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 createHttpJsonDefault() { + Builder builder = new Builder(((ClientContext) null)); + + builder.setTransportChannelProvider(defaultHttpJsonTransportProviderBuilder().build()); + builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); + builder.setInternalHeaderProvider(defaultHttpJsonApiClientHeaderProviderBuilder().build()); + builder.setMtlsEndpoint(getDefaultMtlsEndpoint()); + builder.setSwitchToMtlsEndpointAllowed(true); + + return initDefaults(builder); + } + + private static Builder initDefaults(Builder builder) { + builder + .listConnectionsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + + return builder; + } + + /** + * Applies the given settings updater function to all of the unary API methods in this service. + * + *

        Note: This method does not support applying settings to streaming methods. + */ + public Builder applyToAllUnaryMethods( + ApiFunction, Void> settingsUpdater) { + super.applyToAllUnaryMethods(unaryMethodSettingsBuilders, settingsUpdater); + return this; + } + + public ImmutableList> unaryMethodSettingsBuilders() { + return unaryMethodSettingsBuilders; + } + + /** Returns the builder for the settings used for calls to listConnections. */ + public PagedCallSettings.Builder< + ListConnectionsRequest, ListConnectionsResponse, ListConnectionsPagedResponse> + listConnectionsSettings() { + return listConnectionsSettings; + } + + @Override + public ConnectionServiceStubSettings build() throws IOException { + return new ConnectionServiceStubSettings(this); + } + } +} diff --git a/test/integration/goldens/apigeeconnect/src/com/google/cloud/apigeeconnect/v1/stub/GrpcConnectionServiceCallableFactory.java b/test/integration/goldens/apigeeconnect/src/com/google/cloud/apigeeconnect/v1/stub/GrpcConnectionServiceCallableFactory.java new file mode 100644 index 0000000000..5bbbfc3b1a --- /dev/null +++ b/test/integration/goldens/apigeeconnect/src/com/google/cloud/apigeeconnect/v1/stub/GrpcConnectionServiceCallableFactory.java @@ -0,0 +1,113 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS 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.apigeeconnect.v1.stub; + +import com.google.api.gax.grpc.GrpcCallSettings; +import com.google.api.gax.grpc.GrpcCallableFactory; +import com.google.api.gax.grpc.GrpcStubCallableFactory; +import com.google.api.gax.rpc.BatchingCallSettings; +import com.google.api.gax.rpc.BidiStreamingCallable; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientStreamingCallable; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.api.gax.rpc.StreamingCallSettings; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.longrunning.Operation; +import com.google.longrunning.stub.OperationsStub; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * gRPC callable factory implementation for the ConnectionService service API. + * + *

        This class is for advanced usage. + */ +@Generated("by gapic-generator-java") +public class GrpcConnectionServiceCallableFactory 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/test/integration/goldens/apigeeconnect/src/com/google/cloud/apigeeconnect/v1/stub/GrpcConnectionServiceStub.java b/test/integration/goldens/apigeeconnect/src/com/google/cloud/apigeeconnect/v1/stub/GrpcConnectionServiceStub.java new file mode 100644 index 0000000000..6e453159f7 --- /dev/null +++ b/test/integration/goldens/apigeeconnect/src/com/google/cloud/apigeeconnect/v1/stub/GrpcConnectionServiceStub.java @@ -0,0 +1,181 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS 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.apigeeconnect.v1.stub; + +import static com.google.cloud.apigeeconnect.v1.ConnectionServiceClient.ListConnectionsPagedResponse; + +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.cloud.apigeeconnect.v1.ListConnectionsRequest; +import com.google.cloud.apigeeconnect.v1.ListConnectionsResponse; +import com.google.longrunning.stub.GrpcOperationsStub; +import io.grpc.MethodDescriptor; +import io.grpc.protobuf.ProtoUtils; +import java.io.IOException; +import java.util.Map; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * gRPC stub implementation for the ConnectionService service API. + * + *

        This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by gapic-generator-java") +public class GrpcConnectionServiceStub extends ConnectionServiceStub { + private static final MethodDescriptor + listConnectionsMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.apigeeconnect.v1.ConnectionService/ListConnections") + .setRequestMarshaller( + ProtoUtils.marshaller(ListConnectionsRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(ListConnectionsResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private final UnaryCallable + listConnectionsCallable; + private final UnaryCallable + listConnectionsPagedCallable; + + private final BackgroundResource backgroundResources; + private final GrpcOperationsStub operationsStub; + private final GrpcStubCallableFactory callableFactory; + + public static final GrpcConnectionServiceStub create(ConnectionServiceStubSettings settings) + throws IOException { + return new GrpcConnectionServiceStub(settings, ClientContext.create(settings)); + } + + public static final GrpcConnectionServiceStub create(ClientContext clientContext) + throws IOException { + return new GrpcConnectionServiceStub( + ConnectionServiceStubSettings.newBuilder().build(), clientContext); + } + + public static final GrpcConnectionServiceStub create( + ClientContext clientContext, GrpcStubCallableFactory callableFactory) throws IOException { + return new GrpcConnectionServiceStub( + ConnectionServiceStubSettings.newBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of GrpcConnectionServiceStub, 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 GrpcConnectionServiceStub( + ConnectionServiceStubSettings settings, ClientContext clientContext) throws IOException { + this(settings, clientContext, new GrpcConnectionServiceCallableFactory()); + } + + /** + * Constructs an instance of GrpcConnectionServiceStub, 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 GrpcConnectionServiceStub( + ConnectionServiceStubSettings settings, + ClientContext clientContext, + GrpcStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + this.operationsStub = GrpcOperationsStub.create(clientContext, callableFactory); + + GrpcCallSettings + listConnectionsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(listConnectionsMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .setResourceNameExtractor(request -> request.getParent()) + .build(); + + this.listConnectionsCallable = + callableFactory.createUnaryCallable( + listConnectionsTransportSettings, settings.listConnectionsSettings(), clientContext); + this.listConnectionsPagedCallable = + callableFactory.createPagedCallable( + listConnectionsTransportSettings, settings.listConnectionsSettings(), clientContext); + + this.backgroundResources = + new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + public GrpcOperationsStub getOperationsStub() { + return operationsStub; + } + + @Override + public UnaryCallable listConnectionsCallable() { + return listConnectionsCallable; + } + + @Override + public UnaryCallable + listConnectionsPagedCallable() { + return listConnectionsPagedCallable; + } + + @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/test/integration/goldens/apigeeconnect/src/com/google/cloud/apigeeconnect/v1/stub/GrpcTetherCallableFactory.java b/test/integration/goldens/apigeeconnect/src/com/google/cloud/apigeeconnect/v1/stub/GrpcTetherCallableFactory.java new file mode 100644 index 0000000000..e9720bc945 --- /dev/null +++ b/test/integration/goldens/apigeeconnect/src/com/google/cloud/apigeeconnect/v1/stub/GrpcTetherCallableFactory.java @@ -0,0 +1,113 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS 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.apigeeconnect.v1.stub; + +import com.google.api.gax.grpc.GrpcCallSettings; +import com.google.api.gax.grpc.GrpcCallableFactory; +import com.google.api.gax.grpc.GrpcStubCallableFactory; +import com.google.api.gax.rpc.BatchingCallSettings; +import com.google.api.gax.rpc.BidiStreamingCallable; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientStreamingCallable; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.api.gax.rpc.StreamingCallSettings; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.longrunning.Operation; +import com.google.longrunning.stub.OperationsStub; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * gRPC callable factory implementation for the Tether service API. + * + *

        This class is for advanced usage. + */ +@Generated("by gapic-generator-java") +public class GrpcTetherCallableFactory 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/test/integration/goldens/apigeeconnect/src/com/google/cloud/apigeeconnect/v1/stub/GrpcTetherStub.java b/test/integration/goldens/apigeeconnect/src/com/google/cloud/apigeeconnect/v1/stub/GrpcTetherStub.java new file mode 100644 index 0000000000..396579ae68 --- /dev/null +++ b/test/integration/goldens/apigeeconnect/src/com/google/cloud/apigeeconnect/v1/stub/GrpcTetherStub.java @@ -0,0 +1,149 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS 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.apigeeconnect.v1.stub; + +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.grpc.GrpcCallSettings; +import com.google.api.gax.grpc.GrpcStubCallableFactory; +import com.google.api.gax.rpc.BidiStreamingCallable; +import com.google.api.gax.rpc.ClientContext; +import com.google.cloud.apigeeconnect.v1.EgressRequest; +import com.google.cloud.apigeeconnect.v1.EgressResponse; +import com.google.longrunning.stub.GrpcOperationsStub; +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 Tether service API. + * + *

        This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by gapic-generator-java") +public class GrpcTetherStub extends TetherStub { + private static final MethodDescriptor egressMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.BIDI_STREAMING) + .setFullMethodName("google.cloud.apigeeconnect.v1.Tether/Egress") + .setRequestMarshaller(ProtoUtils.marshaller(EgressResponse.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(EgressRequest.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private final BidiStreamingCallable egressCallable; + + private final BackgroundResource backgroundResources; + private final GrpcOperationsStub operationsStub; + private final GrpcStubCallableFactory callableFactory; + + public static final GrpcTetherStub create(TetherStubSettings settings) throws IOException { + return new GrpcTetherStub(settings, ClientContext.create(settings)); + } + + public static final GrpcTetherStub create(ClientContext clientContext) throws IOException { + return new GrpcTetherStub(TetherStubSettings.newBuilder().build(), clientContext); + } + + public static final GrpcTetherStub create( + ClientContext clientContext, GrpcStubCallableFactory callableFactory) throws IOException { + return new GrpcTetherStub( + TetherStubSettings.newBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of GrpcTetherStub, 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 GrpcTetherStub(TetherStubSettings settings, ClientContext clientContext) + throws IOException { + this(settings, clientContext, new GrpcTetherCallableFactory()); + } + + /** + * Constructs an instance of GrpcTetherStub, 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 GrpcTetherStub( + TetherStubSettings settings, + ClientContext clientContext, + GrpcStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + this.operationsStub = GrpcOperationsStub.create(clientContext, callableFactory); + + GrpcCallSettings egressTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(egressMethodDescriptor) + .build(); + + this.egressCallable = + callableFactory.createBidiStreamingCallable( + egressTransportSettings, settings.egressSettings(), clientContext); + + this.backgroundResources = + new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + public GrpcOperationsStub getOperationsStub() { + return operationsStub; + } + + @Override + public BidiStreamingCallable egressCallable() { + return egressCallable; + } + + @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/test/integration/goldens/apigeeconnect/src/com/google/cloud/apigeeconnect/v1/stub/HttpJsonConnectionServiceCallableFactory.java b/test/integration/goldens/apigeeconnect/src/com/google/cloud/apigeeconnect/v1/stub/HttpJsonConnectionServiceCallableFactory.java new file mode 100644 index 0000000000..06e53d47b7 --- /dev/null +++ b/test/integration/goldens/apigeeconnect/src/com/google/cloud/apigeeconnect/v1/stub/HttpJsonConnectionServiceCallableFactory.java @@ -0,0 +1,101 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS 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.apigeeconnect.v1.stub; + +import com.google.api.gax.httpjson.HttpJsonCallSettings; +import com.google.api.gax.httpjson.HttpJsonCallableFactory; +import com.google.api.gax.httpjson.HttpJsonOperationSnapshotCallable; +import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; +import com.google.api.gax.httpjson.longrunning.stub.OperationsStub; +import com.google.api.gax.rpc.BatchingCallSettings; +import com.google.api.gax.rpc.ClientContext; +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.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.longrunning.Operation; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * REST callable factory implementation for the ConnectionService service API. + * + *

        This class is for advanced usage. + */ +@Generated("by gapic-generator-java") +public class HttpJsonConnectionServiceCallableFactory + implements HttpJsonStubCallableFactory { + + @Override + public UnaryCallable createUnaryCallable( + HttpJsonCallSettings httpJsonCallSettings, + UnaryCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createUnaryCallable( + httpJsonCallSettings, callSettings, clientContext); + } + + @Override + public + UnaryCallable createPagedCallable( + HttpJsonCallSettings httpJsonCallSettings, + PagedCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createPagedCallable( + httpJsonCallSettings, callSettings, clientContext); + } + + @Override + public UnaryCallable createBatchingCallable( + HttpJsonCallSettings httpJsonCallSettings, + BatchingCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createBatchingCallable( + httpJsonCallSettings, callSettings, clientContext); + } + + @Override + public + OperationCallable createOperationCallable( + HttpJsonCallSettings httpJsonCallSettings, + OperationCallSettings callSettings, + ClientContext clientContext, + OperationsStub operationsStub) { + UnaryCallable innerCallable = + HttpJsonCallableFactory.createBaseUnaryCallable( + httpJsonCallSettings, callSettings.getInitialCallSettings(), clientContext); + HttpJsonOperationSnapshotCallable initialCallable = + new HttpJsonOperationSnapshotCallable( + innerCallable, + httpJsonCallSettings.getMethodDescriptor().getOperationSnapshotFactory()); + return HttpJsonCallableFactory.createOperationCallable( + callSettings, clientContext, operationsStub.longRunningClient(), initialCallable); + } + + @Override + public + ServerStreamingCallable createServerStreamingCallable( + HttpJsonCallSettings httpJsonCallSettings, + ServerStreamingCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createServerStreamingCallable( + httpJsonCallSettings, callSettings, clientContext); + } +} diff --git a/test/integration/goldens/apigeeconnect/src/com/google/cloud/apigeeconnect/v1/stub/HttpJsonConnectionServiceStub.java b/test/integration/goldens/apigeeconnect/src/com/google/cloud/apigeeconnect/v1/stub/HttpJsonConnectionServiceStub.java new file mode 100644 index 0000000000..3cf8a205a4 --- /dev/null +++ b/test/integration/goldens/apigeeconnect/src/com/google/cloud/apigeeconnect/v1/stub/HttpJsonConnectionServiceStub.java @@ -0,0 +1,215 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS 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.apigeeconnect.v1.stub; + +import static com.google.cloud.apigeeconnect.v1.ConnectionServiceClient.ListConnectionsPagedResponse; + +import com.google.api.core.InternalApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.httpjson.ApiMethodDescriptor; +import com.google.api.gax.httpjson.HttpJsonCallSettings; +import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; +import com.google.api.gax.httpjson.ProtoMessageRequestFormatter; +import com.google.api.gax.httpjson.ProtoMessageResponseParser; +import com.google.api.gax.httpjson.ProtoRestSerializer; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.RequestParamsBuilder; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.apigeeconnect.v1.ListConnectionsRequest; +import com.google.cloud.apigeeconnect.v1.ListConnectionsResponse; +import com.google.protobuf.TypeRegistry; +import java.io.IOException; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * REST stub implementation for the ConnectionService service API. + * + *

        This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by gapic-generator-java") +public class HttpJsonConnectionServiceStub extends ConnectionServiceStub { + private static final TypeRegistry typeRegistry = TypeRegistry.newBuilder().build(); + + private static final ApiMethodDescriptor + listConnectionsMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.apigeeconnect.v1.ConnectionService/ListConnections") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{parent=projects/*/endpoints/*}/connections", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "parent", request.getParent()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "pageSize", request.getPageSize()); + serializer.putQueryParam(fields, "pageToken", request.getPageToken()); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(ListConnectionsResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private final UnaryCallable + listConnectionsCallable; + private final UnaryCallable + listConnectionsPagedCallable; + + private final BackgroundResource backgroundResources; + private final HttpJsonStubCallableFactory callableFactory; + + public static final HttpJsonConnectionServiceStub create(ConnectionServiceStubSettings settings) + throws IOException { + return new HttpJsonConnectionServiceStub(settings, ClientContext.create(settings)); + } + + public static final HttpJsonConnectionServiceStub create(ClientContext clientContext) + throws IOException { + return new HttpJsonConnectionServiceStub( + ConnectionServiceStubSettings.newHttpJsonBuilder().build(), clientContext); + } + + public static final HttpJsonConnectionServiceStub create( + ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { + return new HttpJsonConnectionServiceStub( + ConnectionServiceStubSettings.newHttpJsonBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of HttpJsonConnectionServiceStub, 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 HttpJsonConnectionServiceStub( + ConnectionServiceStubSettings settings, ClientContext clientContext) throws IOException { + this(settings, clientContext, new HttpJsonConnectionServiceCallableFactory()); + } + + /** + * Constructs an instance of HttpJsonConnectionServiceStub, 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 HttpJsonConnectionServiceStub( + ConnectionServiceStubSettings settings, + ClientContext clientContext, + HttpJsonStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + + HttpJsonCallSettings + listConnectionsTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(listConnectionsMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .setResourceNameExtractor(request -> request.getParent()) + .build(); + + this.listConnectionsCallable = + callableFactory.createUnaryCallable( + listConnectionsTransportSettings, settings.listConnectionsSettings(), clientContext); + this.listConnectionsPagedCallable = + callableFactory.createPagedCallable( + listConnectionsTransportSettings, settings.listConnectionsSettings(), clientContext); + + this.backgroundResources = + new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + @InternalApi + public static List getMethodDescriptors() { + List methodDescriptors = new ArrayList<>(); + methodDescriptors.add(listConnectionsMethodDescriptor); + return methodDescriptors; + } + + @Override + public UnaryCallable listConnectionsCallable() { + return listConnectionsCallable; + } + + @Override + public UnaryCallable + listConnectionsPagedCallable() { + return listConnectionsPagedCallable; + } + + @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/test/integration/goldens/apigeeconnect/src/com/google/cloud/apigeeconnect/v1/stub/TetherStub.java b/test/integration/goldens/apigeeconnect/src/com/google/cloud/apigeeconnect/v1/stub/TetherStub.java new file mode 100644 index 0000000000..affda077ba --- /dev/null +++ b/test/integration/goldens/apigeeconnect/src/com/google/cloud/apigeeconnect/v1/stub/TetherStub.java @@ -0,0 +1,40 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS 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.apigeeconnect.v1.stub; + +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.rpc.BidiStreamingCallable; +import com.google.cloud.apigeeconnect.v1.EgressRequest; +import com.google.cloud.apigeeconnect.v1.EgressResponse; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Base stub class for the Tether service API. + * + *

        This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by gapic-generator-java") +public abstract class TetherStub implements BackgroundResource { + + public BidiStreamingCallable egressCallable() { + throw new UnsupportedOperationException("Not implemented: egressCallable()"); + } + + @Override + public abstract void close(); +} diff --git a/test/integration/goldens/apigeeconnect/src/com/google/cloud/apigeeconnect/v1/stub/TetherStubSettings.java b/test/integration/goldens/apigeeconnect/src/com/google/cloud/apigeeconnect/v1/stub/TetherStubSettings.java new file mode 100644 index 0000000000..22d8803b31 --- /dev/null +++ b/test/integration/goldens/apigeeconnect/src/com/google/cloud/apigeeconnect/v1/stub/TetherStubSettings.java @@ -0,0 +1,287 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS 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.apigeeconnect.v1.stub; + +import com.google.api.core.ApiFunction; +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.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.LibraryMetadata; +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.cloud.apigeeconnect.v1.EgressRequest; +import com.google.cloud.apigeeconnect.v1.EgressResponse; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.ImmutableSet; +import com.google.common.collect.Lists; +import java.io.IOException; +import java.util.List; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Settings class to configure an instance of {@link TetherStub}. + * + *

        The default instance has everything set to sensible defaults: + * + *

          + *
        • The default service address (apigeeconnect.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 egress: + * + *

        {@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
        + * TetherStubSettings.Builder tetherSettingsBuilder = TetherStubSettings.newBuilder();
        + * tetherSettingsBuilder
        + *     .egressSettings()
        + *     .setRetrySettings(
        + *         tetherSettingsBuilder
        + *             .egressSettings()
        + *             .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());
        + * TetherStubSettings tetherSettings = tetherSettingsBuilder.build();
        + * }
        + * + * Please refer to the [Client Side Retry + * Guide](https://docs.cloud.google.com/java/docs/client-retries) for additional support in setting + * retries. + */ +@Generated("by gapic-generator-java") +@SuppressWarnings("CanonicalDuration") +public class TetherStubSettings extends StubSettings { + /** The default scopes of the service. */ + private static final ImmutableList DEFAULT_SERVICE_SCOPES = + ImmutableList.builder().add("https://www.googleapis.com/auth/cloud-platform").build(); + + private final StreamingCallSettings egressSettings; + + /** Returns the object with the settings used for calls to egress. */ + public StreamingCallSettings egressSettings() { + return egressSettings; + } + + public TetherStub createStub() throws IOException { + if (getTransportChannelProvider() + .getTransportName() + .equals(GrpcTransportChannel.getGrpcTransportName())) { + return GrpcTetherStub.create(this); + } + throw new UnsupportedOperationException( + String.format( + "Transport not supported: %s", getTransportChannelProvider().getTransportName())); + } + + /** Returns the default service name. */ + @Override + public String getServiceName() { + return "apigeeconnect"; + } + + /** 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 "apigeeconnect.googleapis.com:443"; + } + + /** Returns the default mTLS service endpoint. */ + public static String getDefaultMtlsEndpoint() { + return "apigeeconnect.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 gRPC 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 defaultGrpcApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken("gapic", GaxProperties.getLibraryVersion(TetherStubSettings.class)) + .setTransportToken( + GaxGrpcProperties.getGrpcTokenName(), GaxGrpcProperties.getGrpcVersion()); + } + + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return TetherStubSettings.defaultGrpcApiClientHeaderProviderBuilder(); + } + + /** Returns a new gRPC 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 TetherStubSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + + egressSettings = settingsBuilder.egressSettings().build(); + } + + @Override + protected LibraryMetadata getLibraryMetadata() { + return LibraryMetadata.newBuilder().setVersion(Version.VERSION).build(); + } + + /** Builder for TetherStubSettings. */ + public static class Builder extends StubSettings.Builder { + private final ImmutableList> unaryMethodSettingsBuilders; + private final StreamingCallSettings.Builder egressSettings; + private static final ImmutableMap> + RETRYABLE_CODE_DEFINITIONS; + + static { + ImmutableMap.Builder> definitions = + ImmutableMap.builder(); + definitions.put("no_retry_codes", ImmutableSet.copyOf(Lists.newArrayList())); + RETRYABLE_CODE_DEFINITIONS = definitions.build(); + } + + private static final ImmutableMap RETRY_PARAM_DEFINITIONS; + + static { + ImmutableMap.Builder definitions = ImmutableMap.builder(); + RetrySettings settings = null; + settings = RetrySettings.newBuilder().setRpcTimeoutMultiplier(1.0).build(); + definitions.put("no_retry_params", settings); + RETRY_PARAM_DEFINITIONS = definitions.build(); + } + + protected Builder() { + this(((ClientContext) null)); + } + + protected Builder(ClientContext clientContext) { + super(clientContext); + + egressSettings = StreamingCallSettings.newBuilder(); + + unaryMethodSettingsBuilders = ImmutableList.>of(); + initDefaults(this); + } + + protected Builder(TetherStubSettings settings) { + super(settings); + + egressSettings = settings.egressSettings.toBuilder(); + + unaryMethodSettingsBuilders = ImmutableList.>of(); + } + + 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) { + 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 egress. */ + public StreamingCallSettings.Builder egressSettings() { + return egressSettings; + } + + @Override + public TetherStubSettings build() throws IOException { + return new TetherStubSettings(this); + } + } +} diff --git a/test/integration/goldens/apigeeconnect/src/com/google/cloud/apigeeconnect/v1/stub/Version.java b/test/integration/goldens/apigeeconnect/src/com/google/cloud/apigeeconnect/v1/stub/Version.java new file mode 100644 index 0000000000..4b240da5e8 --- /dev/null +++ b/test/integration/goldens/apigeeconnect/src/com/google/cloud/apigeeconnect/v1/stub/Version.java @@ -0,0 +1,27 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS 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.apigeeconnect.v1.stub; + +import com.google.api.core.InternalApi; + +@InternalApi("For internal use only") +final class Version { + // {x-version-update-start:null:current} + static final String VERSION = "0.0.0-SNAPSHOT"; + // {x-version-update-end} + +} diff --git a/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetservice/analyzeiampolicy/AsyncAnalyzeIamPolicy.java b/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetservice/analyzeiampolicy/AsyncAnalyzeIamPolicy.java index 481d648922..e403dc7fcb 100644 --- a/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetservice/analyzeiampolicy/AsyncAnalyzeIamPolicy.java +++ b/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetservice/analyzeiampolicy/AsyncAnalyzeIamPolicy.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -40,6 +40,7 @@ public static void asyncAnalyzeIamPolicy() throws Exception { AnalyzeIamPolicyRequest request = AnalyzeIamPolicyRequest.newBuilder() .setAnalysisQuery(IamPolicyAnalysisQuery.newBuilder().build()) + .setSavedAnalysisQuery("savedAnalysisQuery376058885") .setExecutionTimeout(Duration.newBuilder().build()) .build(); ApiFuture future = diff --git a/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetservice/analyzeiampolicy/SyncAnalyzeIamPolicy.java b/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetservice/analyzeiampolicy/SyncAnalyzeIamPolicy.java index c12b5a21e4..681ae70747 100644 --- a/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetservice/analyzeiampolicy/SyncAnalyzeIamPolicy.java +++ b/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetservice/analyzeiampolicy/SyncAnalyzeIamPolicy.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -39,6 +39,7 @@ public static void syncAnalyzeIamPolicy() throws Exception { AnalyzeIamPolicyRequest request = AnalyzeIamPolicyRequest.newBuilder() .setAnalysisQuery(IamPolicyAnalysisQuery.newBuilder().build()) + .setSavedAnalysisQuery("savedAnalysisQuery376058885") .setExecutionTimeout(Duration.newBuilder().build()) .build(); AnalyzeIamPolicyResponse response = assetServiceClient.analyzeIamPolicy(request); diff --git a/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetservice/analyzeiampolicylongrunning/AsyncAnalyzeIamPolicyLongrunning.java b/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetservice/analyzeiampolicylongrunning/AsyncAnalyzeIamPolicyLongrunning.java index b7aa241702..e7cf12087f 100644 --- a/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetservice/analyzeiampolicylongrunning/AsyncAnalyzeIamPolicyLongrunning.java +++ b/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetservice/analyzeiampolicylongrunning/AsyncAnalyzeIamPolicyLongrunning.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -40,6 +40,7 @@ public static void asyncAnalyzeIamPolicyLongrunning() throws Exception { AnalyzeIamPolicyLongrunningRequest request = AnalyzeIamPolicyLongrunningRequest.newBuilder() .setAnalysisQuery(IamPolicyAnalysisQuery.newBuilder().build()) + .setSavedAnalysisQuery("savedAnalysisQuery376058885") .setOutputConfig(IamPolicyAnalysisOutputConfig.newBuilder().build()) .build(); ApiFuture future = diff --git a/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetservice/analyzeiampolicylongrunning/AsyncAnalyzeIamPolicyLongrunningLRO.java b/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetservice/analyzeiampolicylongrunning/AsyncAnalyzeIamPolicyLongrunningLRO.java index 1cdfa54f62..fa5178e866 100644 --- a/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetservice/analyzeiampolicylongrunning/AsyncAnalyzeIamPolicyLongrunningLRO.java +++ b/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetservice/analyzeiampolicylongrunning/AsyncAnalyzeIamPolicyLongrunningLRO.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -41,6 +41,7 @@ public static void asyncAnalyzeIamPolicyLongrunningLRO() throws Exception { AnalyzeIamPolicyLongrunningRequest request = AnalyzeIamPolicyLongrunningRequest.newBuilder() .setAnalysisQuery(IamPolicyAnalysisQuery.newBuilder().build()) + .setSavedAnalysisQuery("savedAnalysisQuery376058885") .setOutputConfig(IamPolicyAnalysisOutputConfig.newBuilder().build()) .build(); OperationFuture diff --git a/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetservice/analyzeiampolicylongrunning/SyncAnalyzeIamPolicyLongrunning.java b/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetservice/analyzeiampolicylongrunning/SyncAnalyzeIamPolicyLongrunning.java index 713f7e80bf..2b2e7d0891 100644 --- a/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetservice/analyzeiampolicylongrunning/SyncAnalyzeIamPolicyLongrunning.java +++ b/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetservice/analyzeiampolicylongrunning/SyncAnalyzeIamPolicyLongrunning.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -39,6 +39,7 @@ public static void syncAnalyzeIamPolicyLongrunning() throws Exception { AnalyzeIamPolicyLongrunningRequest request = AnalyzeIamPolicyLongrunningRequest.newBuilder() .setAnalysisQuery(IamPolicyAnalysisQuery.newBuilder().build()) + .setSavedAnalysisQuery("savedAnalysisQuery376058885") .setOutputConfig(IamPolicyAnalysisOutputConfig.newBuilder().build()) .build(); AnalyzeIamPolicyLongrunningResponse response = diff --git a/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetservice/analyzemove/AsyncAnalyzeMove.java b/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetservice/analyzemove/AsyncAnalyzeMove.java index f0d93d7947..f2f5239d58 100644 --- a/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetservice/analyzemove/AsyncAnalyzeMove.java +++ b/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetservice/analyzemove/AsyncAnalyzeMove.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetservice/analyzemove/SyncAnalyzeMove.java b/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetservice/analyzemove/SyncAnalyzeMove.java index be0348481f..3f370f436a 100644 --- a/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetservice/analyzemove/SyncAnalyzeMove.java +++ b/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetservice/analyzemove/SyncAnalyzeMove.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetservice/batchgetassetshistory/AsyncBatchGetAssetsHistory.java b/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetservice/batchgetassetshistory/AsyncBatchGetAssetsHistory.java index d031b2073b..c8d153a952 100644 --- a/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetservice/batchgetassetshistory/AsyncBatchGetAssetsHistory.java +++ b/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetservice/batchgetassetshistory/AsyncBatchGetAssetsHistory.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -22,6 +22,7 @@ import com.google.cloud.asset.v1.BatchGetAssetsHistoryRequest; import com.google.cloud.asset.v1.BatchGetAssetsHistoryResponse; import com.google.cloud.asset.v1.ContentType; +import com.google.cloud.asset.v1.FolderName; import com.google.cloud.asset.v1.TimeWindow; import java.util.ArrayList; @@ -40,7 +41,7 @@ public static void asyncBatchGetAssetsHistory() throws Exception { try (AssetServiceClient assetServiceClient = AssetServiceClient.create()) { BatchGetAssetsHistoryRequest request = BatchGetAssetsHistoryRequest.newBuilder() - .setParent("BatchGetAssetsHistoryRequest1575208378".toString()) + .setParent(FolderName.of("[FOLDER]").toString()) .addAllAssetNames(new ArrayList()) .setContentType(ContentType.forNumber(0)) .setReadTimeWindow(TimeWindow.newBuilder().build()) diff --git a/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetservice/batchgetassetshistory/SyncBatchGetAssetsHistory.java b/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetservice/batchgetassetshistory/SyncBatchGetAssetsHistory.java index 06719a2b83..b372f5e48b 100644 --- a/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetservice/batchgetassetshistory/SyncBatchGetAssetsHistory.java +++ b/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetservice/batchgetassetshistory/SyncBatchGetAssetsHistory.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -21,6 +21,7 @@ import com.google.cloud.asset.v1.BatchGetAssetsHistoryRequest; import com.google.cloud.asset.v1.BatchGetAssetsHistoryResponse; import com.google.cloud.asset.v1.ContentType; +import com.google.cloud.asset.v1.FolderName; import com.google.cloud.asset.v1.TimeWindow; import java.util.ArrayList; @@ -39,7 +40,7 @@ public static void syncBatchGetAssetsHistory() throws Exception { try (AssetServiceClient assetServiceClient = AssetServiceClient.create()) { BatchGetAssetsHistoryRequest request = BatchGetAssetsHistoryRequest.newBuilder() - .setParent("BatchGetAssetsHistoryRequest1575208378".toString()) + .setParent(FolderName.of("[FOLDER]").toString()) .addAllAssetNames(new ArrayList()) .setContentType(ContentType.forNumber(0)) .setReadTimeWindow(TimeWindow.newBuilder().build()) diff --git a/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetservice/batchgeteffectiveiampolicies/AsyncBatchGetEffectiveIamPolicies.java b/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetservice/batchgeteffectiveiampolicies/AsyncBatchGetEffectiveIamPolicies.java new file mode 100644 index 0000000000..6c799bb49a --- /dev/null +++ b/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetservice/batchgeteffectiveiampolicies/AsyncBatchGetEffectiveIamPolicies.java @@ -0,0 +1,52 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS 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.asset.v1.samples; + +// [START cloudasset_v1_generated_AssetService_BatchGetEffectiveIamPolicies_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.asset.v1.AssetServiceClient; +import com.google.cloud.asset.v1.BatchGetEffectiveIamPoliciesRequest; +import com.google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse; +import com.google.cloud.asset.v1.FolderName; +import java.util.ArrayList; + +public class AsyncBatchGetEffectiveIamPolicies { + + public static void main(String[] args) throws Exception { + asyncBatchGetEffectiveIamPolicies(); + } + + public static void asyncBatchGetEffectiveIamPolicies() 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 (AssetServiceClient assetServiceClient = AssetServiceClient.create()) { + BatchGetEffectiveIamPoliciesRequest request = + BatchGetEffectiveIamPoliciesRequest.newBuilder() + .setScope(FolderName.of("[FOLDER]").toString()) + .addAllNames(new ArrayList()) + .build(); + ApiFuture future = + assetServiceClient.batchGetEffectiveIamPoliciesCallable().futureCall(request); + // Do something. + BatchGetEffectiveIamPoliciesResponse response = future.get(); + } + } +} +// [END cloudasset_v1_generated_AssetService_BatchGetEffectiveIamPolicies_async] diff --git a/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetservice/batchgeteffectiveiampolicies/SyncBatchGetEffectiveIamPolicies.java b/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetservice/batchgeteffectiveiampolicies/SyncBatchGetEffectiveIamPolicies.java new file mode 100644 index 0000000000..9d73ce0a81 --- /dev/null +++ b/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetservice/batchgeteffectiveiampolicies/SyncBatchGetEffectiveIamPolicies.java @@ -0,0 +1,49 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS 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.asset.v1.samples; + +// [START cloudasset_v1_generated_AssetService_BatchGetEffectiveIamPolicies_sync] +import com.google.cloud.asset.v1.AssetServiceClient; +import com.google.cloud.asset.v1.BatchGetEffectiveIamPoliciesRequest; +import com.google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse; +import com.google.cloud.asset.v1.FolderName; +import java.util.ArrayList; + +public class SyncBatchGetEffectiveIamPolicies { + + public static void main(String[] args) throws Exception { + syncBatchGetEffectiveIamPolicies(); + } + + public static void syncBatchGetEffectiveIamPolicies() 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 (AssetServiceClient assetServiceClient = AssetServiceClient.create()) { + BatchGetEffectiveIamPoliciesRequest request = + BatchGetEffectiveIamPoliciesRequest.newBuilder() + .setScope(FolderName.of("[FOLDER]").toString()) + .addAllNames(new ArrayList()) + .build(); + BatchGetEffectiveIamPoliciesResponse response = + assetServiceClient.batchGetEffectiveIamPolicies(request); + } + } +} +// [END cloudasset_v1_generated_AssetService_BatchGetEffectiveIamPolicies_sync] diff --git a/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetservice/create/SyncCreateSetCredentialsProvider.java b/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetservice/create/SyncCreateSetCredentialsProvider.java index 00ad2cefc5..b8529b5d87 100644 --- a/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetservice/create/SyncCreateSetCredentialsProvider.java +++ b/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetservice/create/SyncCreateSetCredentialsProvider.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetservice/create/SyncCreateSetEndpoint.java b/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetservice/create/SyncCreateSetEndpoint.java index 5ede353237..218f2ed731 100644 --- a/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetservice/create/SyncCreateSetEndpoint.java +++ b/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetservice/create/SyncCreateSetEndpoint.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetservice/create/SyncCreateUseHttpJsonTransport.java b/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetservice/create/SyncCreateUseHttpJsonTransport.java new file mode 100644 index 0000000000..7f72f4c325 --- /dev/null +++ b/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetservice/create/SyncCreateUseHttpJsonTransport.java @@ -0,0 +1,39 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS 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.asset.v1.samples; + +// [START cloudasset_v1_generated_AssetService_Create_UseHttpJsonTransport_sync] +import com.google.cloud.asset.v1.AssetServiceClient; +import com.google.cloud.asset.v1.AssetServiceSettings; + +public class SyncCreateUseHttpJsonTransport { + + public static void main(String[] args) throws Exception { + syncCreateUseHttpJsonTransport(); + } + + public static void syncCreateUseHttpJsonTransport() 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 + AssetServiceSettings assetServiceSettings = AssetServiceSettings.newHttpJsonBuilder().build(); + AssetServiceClient assetServiceClient = AssetServiceClient.create(assetServiceSettings); + } +} +// [END cloudasset_v1_generated_AssetService_Create_UseHttpJsonTransport_sync] diff --git a/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetservice/createfeed/AsyncCreateFeed.java b/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetservice/createfeed/AsyncCreateFeed.java index f33ae5d4c0..a00cc5106a 100644 --- a/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetservice/createfeed/AsyncCreateFeed.java +++ b/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetservice/createfeed/AsyncCreateFeed.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetservice/createfeed/SyncCreateFeed.java b/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetservice/createfeed/SyncCreateFeed.java index cd83f15a3b..111570f250 100644 --- a/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetservice/createfeed/SyncCreateFeed.java +++ b/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetservice/createfeed/SyncCreateFeed.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetservice/createfeed/SyncCreateFeedString.java b/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetservice/createfeed/SyncCreateFeedString.java index f6fc682365..f33b9d049c 100644 --- a/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetservice/createfeed/SyncCreateFeedString.java +++ b/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetservice/createfeed/SyncCreateFeedString.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetservice/createsavedquery/AsyncCreateSavedQuery.java b/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetservice/createsavedquery/AsyncCreateSavedQuery.java new file mode 100644 index 0000000000..80b71efeeb --- /dev/null +++ b/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetservice/createsavedquery/AsyncCreateSavedQuery.java @@ -0,0 +1,52 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS 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.asset.v1.samples; + +// [START cloudasset_v1_generated_AssetService_CreateSavedQuery_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.asset.v1.AssetServiceClient; +import com.google.cloud.asset.v1.CreateSavedQueryRequest; +import com.google.cloud.asset.v1.ProjectName; +import com.google.cloud.asset.v1.SavedQuery; + +public class AsyncCreateSavedQuery { + + public static void main(String[] args) throws Exception { + asyncCreateSavedQuery(); + } + + public static void asyncCreateSavedQuery() 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 (AssetServiceClient assetServiceClient = AssetServiceClient.create()) { + CreateSavedQueryRequest request = + CreateSavedQueryRequest.newBuilder() + .setParent(ProjectName.of("[PROJECT]").toString()) + .setSavedQuery(SavedQuery.newBuilder().build()) + .setSavedQueryId("savedQueryId378086268") + .build(); + ApiFuture future = + assetServiceClient.createSavedQueryCallable().futureCall(request); + // Do something. + SavedQuery response = future.get(); + } + } +} +// [END cloudasset_v1_generated_AssetService_CreateSavedQuery_async] diff --git a/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetservice/createsavedquery/SyncCreateSavedQuery.java b/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetservice/createsavedquery/SyncCreateSavedQuery.java new file mode 100644 index 0000000000..4520051064 --- /dev/null +++ b/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetservice/createsavedquery/SyncCreateSavedQuery.java @@ -0,0 +1,48 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS 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.asset.v1.samples; + +// [START cloudasset_v1_generated_AssetService_CreateSavedQuery_sync] +import com.google.cloud.asset.v1.AssetServiceClient; +import com.google.cloud.asset.v1.CreateSavedQueryRequest; +import com.google.cloud.asset.v1.ProjectName; +import com.google.cloud.asset.v1.SavedQuery; + +public class SyncCreateSavedQuery { + + public static void main(String[] args) throws Exception { + syncCreateSavedQuery(); + } + + public static void syncCreateSavedQuery() 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 (AssetServiceClient assetServiceClient = AssetServiceClient.create()) { + CreateSavedQueryRequest request = + CreateSavedQueryRequest.newBuilder() + .setParent(ProjectName.of("[PROJECT]").toString()) + .setSavedQuery(SavedQuery.newBuilder().build()) + .setSavedQueryId("savedQueryId378086268") + .build(); + SavedQuery response = assetServiceClient.createSavedQuery(request); + } + } +} +// [END cloudasset_v1_generated_AssetService_CreateSavedQuery_sync] diff --git a/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetservice/createsavedquery/SyncCreateSavedQueryFoldernameSavedqueryString.java b/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetservice/createsavedquery/SyncCreateSavedQueryFoldernameSavedqueryString.java new file mode 100644 index 0000000000..6f8abc590a --- /dev/null +++ b/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetservice/createsavedquery/SyncCreateSavedQueryFoldernameSavedqueryString.java @@ -0,0 +1,44 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS 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.asset.v1.samples; + +// [START cloudasset_v1_generated_AssetService_CreateSavedQuery_FoldernameSavedqueryString_sync] +import com.google.cloud.asset.v1.AssetServiceClient; +import com.google.cloud.asset.v1.FolderName; +import com.google.cloud.asset.v1.SavedQuery; + +public class SyncCreateSavedQueryFoldernameSavedqueryString { + + public static void main(String[] args) throws Exception { + syncCreateSavedQueryFoldernameSavedqueryString(); + } + + public static void syncCreateSavedQueryFoldernameSavedqueryString() 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 (AssetServiceClient assetServiceClient = AssetServiceClient.create()) { + FolderName parent = FolderName.of("[FOLDER]"); + SavedQuery savedQuery = SavedQuery.newBuilder().build(); + String savedQueryId = "savedQueryId378086268"; + SavedQuery response = assetServiceClient.createSavedQuery(parent, savedQuery, savedQueryId); + } + } +} +// [END cloudasset_v1_generated_AssetService_CreateSavedQuery_FoldernameSavedqueryString_sync] diff --git a/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetservice/createsavedquery/SyncCreateSavedQueryOrganizationnameSavedqueryString.java b/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetservice/createsavedquery/SyncCreateSavedQueryOrganizationnameSavedqueryString.java new file mode 100644 index 0000000000..e50cbd7758 --- /dev/null +++ b/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetservice/createsavedquery/SyncCreateSavedQueryOrganizationnameSavedqueryString.java @@ -0,0 +1,44 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS 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.asset.v1.samples; + +// [START cloudasset_v1_generated_AssetService_CreateSavedQuery_OrganizationnameSavedqueryString_sync] +import com.google.cloud.asset.v1.AssetServiceClient; +import com.google.cloud.asset.v1.OrganizationName; +import com.google.cloud.asset.v1.SavedQuery; + +public class SyncCreateSavedQueryOrganizationnameSavedqueryString { + + public static void main(String[] args) throws Exception { + syncCreateSavedQueryOrganizationnameSavedqueryString(); + } + + public static void syncCreateSavedQueryOrganizationnameSavedqueryString() 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 (AssetServiceClient assetServiceClient = AssetServiceClient.create()) { + OrganizationName parent = OrganizationName.of("[ORGANIZATION]"); + SavedQuery savedQuery = SavedQuery.newBuilder().build(); + String savedQueryId = "savedQueryId378086268"; + SavedQuery response = assetServiceClient.createSavedQuery(parent, savedQuery, savedQueryId); + } + } +} +// [END cloudasset_v1_generated_AssetService_CreateSavedQuery_OrganizationnameSavedqueryString_sync] diff --git a/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetservice/createsavedquery/SyncCreateSavedQueryProjectnameSavedqueryString.java b/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetservice/createsavedquery/SyncCreateSavedQueryProjectnameSavedqueryString.java new file mode 100644 index 0000000000..74f63b8a1c --- /dev/null +++ b/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetservice/createsavedquery/SyncCreateSavedQueryProjectnameSavedqueryString.java @@ -0,0 +1,44 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS 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.asset.v1.samples; + +// [START cloudasset_v1_generated_AssetService_CreateSavedQuery_ProjectnameSavedqueryString_sync] +import com.google.cloud.asset.v1.AssetServiceClient; +import com.google.cloud.asset.v1.ProjectName; +import com.google.cloud.asset.v1.SavedQuery; + +public class SyncCreateSavedQueryProjectnameSavedqueryString { + + public static void main(String[] args) throws Exception { + syncCreateSavedQueryProjectnameSavedqueryString(); + } + + public static void syncCreateSavedQueryProjectnameSavedqueryString() 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 (AssetServiceClient assetServiceClient = AssetServiceClient.create()) { + ProjectName parent = ProjectName.of("[PROJECT]"); + SavedQuery savedQuery = SavedQuery.newBuilder().build(); + String savedQueryId = "savedQueryId378086268"; + SavedQuery response = assetServiceClient.createSavedQuery(parent, savedQuery, savedQueryId); + } + } +} +// [END cloudasset_v1_generated_AssetService_CreateSavedQuery_ProjectnameSavedqueryString_sync] diff --git a/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetservice/createsavedquery/SyncCreateSavedQueryStringSavedqueryString.java b/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetservice/createsavedquery/SyncCreateSavedQueryStringSavedqueryString.java new file mode 100644 index 0000000000..0b61392032 --- /dev/null +++ b/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetservice/createsavedquery/SyncCreateSavedQueryStringSavedqueryString.java @@ -0,0 +1,44 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS 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.asset.v1.samples; + +// [START cloudasset_v1_generated_AssetService_CreateSavedQuery_StringSavedqueryString_sync] +import com.google.cloud.asset.v1.AssetServiceClient; +import com.google.cloud.asset.v1.ProjectName; +import com.google.cloud.asset.v1.SavedQuery; + +public class SyncCreateSavedQueryStringSavedqueryString { + + public static void main(String[] args) throws Exception { + syncCreateSavedQueryStringSavedqueryString(); + } + + public static void syncCreateSavedQueryStringSavedqueryString() 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 (AssetServiceClient assetServiceClient = AssetServiceClient.create()) { + String parent = ProjectName.of("[PROJECT]").toString(); + SavedQuery savedQuery = SavedQuery.newBuilder().build(); + String savedQueryId = "savedQueryId378086268"; + SavedQuery response = assetServiceClient.createSavedQuery(parent, savedQuery, savedQueryId); + } + } +} +// [END cloudasset_v1_generated_AssetService_CreateSavedQuery_StringSavedqueryString_sync] diff --git a/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetservice/deletefeed/AsyncDeleteFeed.java b/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetservice/deletefeed/AsyncDeleteFeed.java index f37354d875..0177969eda 100644 --- a/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetservice/deletefeed/AsyncDeleteFeed.java +++ b/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetservice/deletefeed/AsyncDeleteFeed.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetservice/deletefeed/SyncDeleteFeed.java b/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetservice/deletefeed/SyncDeleteFeed.java index 051f44738c..f04f933523 100644 --- a/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetservice/deletefeed/SyncDeleteFeed.java +++ b/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetservice/deletefeed/SyncDeleteFeed.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetservice/deletefeed/SyncDeleteFeedFeedname.java b/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetservice/deletefeed/SyncDeleteFeedFeedname.java index ca8460944c..985197a14b 100644 --- a/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetservice/deletefeed/SyncDeleteFeedFeedname.java +++ b/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetservice/deletefeed/SyncDeleteFeedFeedname.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetservice/deletefeed/SyncDeleteFeedString.java b/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetservice/deletefeed/SyncDeleteFeedString.java index 7430704233..eee6405723 100644 --- a/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetservice/deletefeed/SyncDeleteFeedString.java +++ b/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetservice/deletefeed/SyncDeleteFeedString.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetservice/deletesavedquery/AsyncDeleteSavedQuery.java b/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetservice/deletesavedquery/AsyncDeleteSavedQuery.java new file mode 100644 index 0000000000..0dc14db23b --- /dev/null +++ b/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetservice/deletesavedquery/AsyncDeleteSavedQuery.java @@ -0,0 +1,50 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS 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.asset.v1.samples; + +// [START cloudasset_v1_generated_AssetService_DeleteSavedQuery_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.asset.v1.AssetServiceClient; +import com.google.cloud.asset.v1.DeleteSavedQueryRequest; +import com.google.cloud.asset.v1.SavedQueryName; +import com.google.protobuf.Empty; + +public class AsyncDeleteSavedQuery { + + public static void main(String[] args) throws Exception { + asyncDeleteSavedQuery(); + } + + public static void asyncDeleteSavedQuery() 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 (AssetServiceClient assetServiceClient = AssetServiceClient.create()) { + DeleteSavedQueryRequest request = + DeleteSavedQueryRequest.newBuilder() + .setName( + SavedQueryName.ofProjectSavedQueryName("[PROJECT]", "[SAVED_QUERY]").toString()) + .build(); + ApiFuture future = assetServiceClient.deleteSavedQueryCallable().futureCall(request); + // Do something. + future.get(); + } + } +} +// [END cloudasset_v1_generated_AssetService_DeleteSavedQuery_async] diff --git a/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetservice/deletesavedquery/SyncDeleteSavedQuery.java b/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetservice/deletesavedquery/SyncDeleteSavedQuery.java new file mode 100644 index 0000000000..38d7b361e0 --- /dev/null +++ b/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetservice/deletesavedquery/SyncDeleteSavedQuery.java @@ -0,0 +1,47 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS 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.asset.v1.samples; + +// [START cloudasset_v1_generated_AssetService_DeleteSavedQuery_sync] +import com.google.cloud.asset.v1.AssetServiceClient; +import com.google.cloud.asset.v1.DeleteSavedQueryRequest; +import com.google.cloud.asset.v1.SavedQueryName; +import com.google.protobuf.Empty; + +public class SyncDeleteSavedQuery { + + public static void main(String[] args) throws Exception { + syncDeleteSavedQuery(); + } + + public static void syncDeleteSavedQuery() 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 (AssetServiceClient assetServiceClient = AssetServiceClient.create()) { + DeleteSavedQueryRequest request = + DeleteSavedQueryRequest.newBuilder() + .setName( + SavedQueryName.ofProjectSavedQueryName("[PROJECT]", "[SAVED_QUERY]").toString()) + .build(); + assetServiceClient.deleteSavedQuery(request); + } + } +} +// [END cloudasset_v1_generated_AssetService_DeleteSavedQuery_sync] diff --git a/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetservice/deletesavedquery/SyncDeleteSavedQuerySavedqueryname.java b/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetservice/deletesavedquery/SyncDeleteSavedQuerySavedqueryname.java new file mode 100644 index 0000000000..a507da6ca4 --- /dev/null +++ b/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetservice/deletesavedquery/SyncDeleteSavedQuerySavedqueryname.java @@ -0,0 +1,42 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS 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.asset.v1.samples; + +// [START cloudasset_v1_generated_AssetService_DeleteSavedQuery_Savedqueryname_sync] +import com.google.cloud.asset.v1.AssetServiceClient; +import com.google.cloud.asset.v1.SavedQueryName; +import com.google.protobuf.Empty; + +public class SyncDeleteSavedQuerySavedqueryname { + + public static void main(String[] args) throws Exception { + syncDeleteSavedQuerySavedqueryname(); + } + + public static void syncDeleteSavedQuerySavedqueryname() 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 (AssetServiceClient assetServiceClient = AssetServiceClient.create()) { + SavedQueryName name = SavedQueryName.ofProjectSavedQueryName("[PROJECT]", "[SAVED_QUERY]"); + assetServiceClient.deleteSavedQuery(name); + } + } +} +// [END cloudasset_v1_generated_AssetService_DeleteSavedQuery_Savedqueryname_sync] diff --git a/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetservice/deletesavedquery/SyncDeleteSavedQueryString.java b/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetservice/deletesavedquery/SyncDeleteSavedQueryString.java new file mode 100644 index 0000000000..4d6bd4a5b6 --- /dev/null +++ b/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetservice/deletesavedquery/SyncDeleteSavedQueryString.java @@ -0,0 +1,42 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS 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.asset.v1.samples; + +// [START cloudasset_v1_generated_AssetService_DeleteSavedQuery_String_sync] +import com.google.cloud.asset.v1.AssetServiceClient; +import com.google.cloud.asset.v1.SavedQueryName; +import com.google.protobuf.Empty; + +public class SyncDeleteSavedQueryString { + + public static void main(String[] args) throws Exception { + syncDeleteSavedQueryString(); + } + + public static void syncDeleteSavedQueryString() 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 (AssetServiceClient assetServiceClient = AssetServiceClient.create()) { + String name = SavedQueryName.ofProjectSavedQueryName("[PROJECT]", "[SAVED_QUERY]").toString(); + assetServiceClient.deleteSavedQuery(name); + } + } +} +// [END cloudasset_v1_generated_AssetService_DeleteSavedQuery_String_sync] diff --git a/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetservice/exportassets/AsyncExportAssets.java b/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetservice/exportassets/AsyncExportAssets.java index db5d626354..c75391a9d0 100644 --- a/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetservice/exportassets/AsyncExportAssets.java +++ b/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetservice/exportassets/AsyncExportAssets.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -21,6 +21,7 @@ import com.google.cloud.asset.v1.AssetServiceClient; import com.google.cloud.asset.v1.ContentType; import com.google.cloud.asset.v1.ExportAssetsRequest; +import com.google.cloud.asset.v1.FolderName; import com.google.cloud.asset.v1.OutputConfig; import com.google.longrunning.Operation; import com.google.protobuf.Timestamp; @@ -41,7 +42,7 @@ public static void asyncExportAssets() throws Exception { try (AssetServiceClient assetServiceClient = AssetServiceClient.create()) { ExportAssetsRequest request = ExportAssetsRequest.newBuilder() - .setParent("ExportAssetsRequest-846449128".toString()) + .setParent(FolderName.of("[FOLDER]").toString()) .setReadTime(Timestamp.newBuilder().build()) .addAllAssetTypes(new ArrayList()) .setContentType(ContentType.forNumber(0)) diff --git a/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetservice/exportassets/AsyncExportAssetsLRO.java b/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetservice/exportassets/AsyncExportAssetsLRO.java index 09d797bd50..a38f656f0a 100644 --- a/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetservice/exportassets/AsyncExportAssetsLRO.java +++ b/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetservice/exportassets/AsyncExportAssetsLRO.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -22,6 +22,7 @@ import com.google.cloud.asset.v1.ContentType; import com.google.cloud.asset.v1.ExportAssetsRequest; import com.google.cloud.asset.v1.ExportAssetsResponse; +import com.google.cloud.asset.v1.FolderName; import com.google.cloud.asset.v1.OutputConfig; import com.google.protobuf.Timestamp; import java.util.ArrayList; @@ -41,7 +42,7 @@ public static void asyncExportAssetsLRO() throws Exception { try (AssetServiceClient assetServiceClient = AssetServiceClient.create()) { ExportAssetsRequest request = ExportAssetsRequest.newBuilder() - .setParent("ExportAssetsRequest-846449128".toString()) + .setParent(FolderName.of("[FOLDER]").toString()) .setReadTime(Timestamp.newBuilder().build()) .addAllAssetTypes(new ArrayList()) .setContentType(ContentType.forNumber(0)) diff --git a/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetservice/exportassets/SyncExportAssets.java b/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetservice/exportassets/SyncExportAssets.java index 60b9bc4434..59724c7c1a 100644 --- a/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetservice/exportassets/SyncExportAssets.java +++ b/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetservice/exportassets/SyncExportAssets.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -21,6 +21,7 @@ import com.google.cloud.asset.v1.ContentType; import com.google.cloud.asset.v1.ExportAssetsRequest; import com.google.cloud.asset.v1.ExportAssetsResponse; +import com.google.cloud.asset.v1.FolderName; import com.google.cloud.asset.v1.OutputConfig; import com.google.protobuf.Timestamp; import java.util.ArrayList; @@ -40,7 +41,7 @@ public static void syncExportAssets() throws Exception { try (AssetServiceClient assetServiceClient = AssetServiceClient.create()) { ExportAssetsRequest request = ExportAssetsRequest.newBuilder() - .setParent("ExportAssetsRequest-846449128".toString()) + .setParent(FolderName.of("[FOLDER]").toString()) .setReadTime(Timestamp.newBuilder().build()) .addAllAssetTypes(new ArrayList()) .setContentType(ContentType.forNumber(0)) diff --git a/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetservice/getfeed/AsyncGetFeed.java b/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetservice/getfeed/AsyncGetFeed.java index 8acd1e2b02..1af189e65e 100644 --- a/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetservice/getfeed/AsyncGetFeed.java +++ b/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetservice/getfeed/AsyncGetFeed.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetservice/getfeed/SyncGetFeed.java b/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetservice/getfeed/SyncGetFeed.java index f6813afc5f..4a63ba6953 100644 --- a/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetservice/getfeed/SyncGetFeed.java +++ b/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetservice/getfeed/SyncGetFeed.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetservice/getfeed/SyncGetFeedFeedname.java b/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetservice/getfeed/SyncGetFeedFeedname.java index 978518747f..3bb34ad47a 100644 --- a/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetservice/getfeed/SyncGetFeedFeedname.java +++ b/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetservice/getfeed/SyncGetFeedFeedname.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetservice/getfeed/SyncGetFeedString.java b/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetservice/getfeed/SyncGetFeedString.java index e85a2f8f77..550c45c3ea 100644 --- a/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetservice/getfeed/SyncGetFeedString.java +++ b/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetservice/getfeed/SyncGetFeedString.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetservice/getsavedquery/AsyncGetSavedQuery.java b/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetservice/getsavedquery/AsyncGetSavedQuery.java new file mode 100644 index 0000000000..d81993c1d7 --- /dev/null +++ b/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetservice/getsavedquery/AsyncGetSavedQuery.java @@ -0,0 +1,50 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS 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.asset.v1.samples; + +// [START cloudasset_v1_generated_AssetService_GetSavedQuery_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.asset.v1.AssetServiceClient; +import com.google.cloud.asset.v1.GetSavedQueryRequest; +import com.google.cloud.asset.v1.SavedQuery; +import com.google.cloud.asset.v1.SavedQueryName; + +public class AsyncGetSavedQuery { + + public static void main(String[] args) throws Exception { + asyncGetSavedQuery(); + } + + public static void asyncGetSavedQuery() 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 (AssetServiceClient assetServiceClient = AssetServiceClient.create()) { + GetSavedQueryRequest request = + GetSavedQueryRequest.newBuilder() + .setName( + SavedQueryName.ofProjectSavedQueryName("[PROJECT]", "[SAVED_QUERY]").toString()) + .build(); + ApiFuture future = assetServiceClient.getSavedQueryCallable().futureCall(request); + // Do something. + SavedQuery response = future.get(); + } + } +} +// [END cloudasset_v1_generated_AssetService_GetSavedQuery_async] diff --git a/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetservice/getsavedquery/SyncGetSavedQuery.java b/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetservice/getsavedquery/SyncGetSavedQuery.java new file mode 100644 index 0000000000..84e71a8cf3 --- /dev/null +++ b/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetservice/getsavedquery/SyncGetSavedQuery.java @@ -0,0 +1,47 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS 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.asset.v1.samples; + +// [START cloudasset_v1_generated_AssetService_GetSavedQuery_sync] +import com.google.cloud.asset.v1.AssetServiceClient; +import com.google.cloud.asset.v1.GetSavedQueryRequest; +import com.google.cloud.asset.v1.SavedQuery; +import com.google.cloud.asset.v1.SavedQueryName; + +public class SyncGetSavedQuery { + + public static void main(String[] args) throws Exception { + syncGetSavedQuery(); + } + + public static void syncGetSavedQuery() 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 (AssetServiceClient assetServiceClient = AssetServiceClient.create()) { + GetSavedQueryRequest request = + GetSavedQueryRequest.newBuilder() + .setName( + SavedQueryName.ofProjectSavedQueryName("[PROJECT]", "[SAVED_QUERY]").toString()) + .build(); + SavedQuery response = assetServiceClient.getSavedQuery(request); + } + } +} +// [END cloudasset_v1_generated_AssetService_GetSavedQuery_sync] diff --git a/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetservice/getsavedquery/SyncGetSavedQuerySavedqueryname.java b/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetservice/getsavedquery/SyncGetSavedQuerySavedqueryname.java new file mode 100644 index 0000000000..47bd4ec445 --- /dev/null +++ b/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetservice/getsavedquery/SyncGetSavedQuerySavedqueryname.java @@ -0,0 +1,42 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS 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.asset.v1.samples; + +// [START cloudasset_v1_generated_AssetService_GetSavedQuery_Savedqueryname_sync] +import com.google.cloud.asset.v1.AssetServiceClient; +import com.google.cloud.asset.v1.SavedQuery; +import com.google.cloud.asset.v1.SavedQueryName; + +public class SyncGetSavedQuerySavedqueryname { + + public static void main(String[] args) throws Exception { + syncGetSavedQuerySavedqueryname(); + } + + public static void syncGetSavedQuerySavedqueryname() 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 (AssetServiceClient assetServiceClient = AssetServiceClient.create()) { + SavedQueryName name = SavedQueryName.ofProjectSavedQueryName("[PROJECT]", "[SAVED_QUERY]"); + SavedQuery response = assetServiceClient.getSavedQuery(name); + } + } +} +// [END cloudasset_v1_generated_AssetService_GetSavedQuery_Savedqueryname_sync] diff --git a/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetservice/getsavedquery/SyncGetSavedQueryString.java b/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetservice/getsavedquery/SyncGetSavedQueryString.java new file mode 100644 index 0000000000..acbf7ee951 --- /dev/null +++ b/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetservice/getsavedquery/SyncGetSavedQueryString.java @@ -0,0 +1,42 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS 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.asset.v1.samples; + +// [START cloudasset_v1_generated_AssetService_GetSavedQuery_String_sync] +import com.google.cloud.asset.v1.AssetServiceClient; +import com.google.cloud.asset.v1.SavedQuery; +import com.google.cloud.asset.v1.SavedQueryName; + +public class SyncGetSavedQueryString { + + public static void main(String[] args) throws Exception { + syncGetSavedQueryString(); + } + + public static void syncGetSavedQueryString() 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 (AssetServiceClient assetServiceClient = AssetServiceClient.create()) { + String name = SavedQueryName.ofProjectSavedQueryName("[PROJECT]", "[SAVED_QUERY]").toString(); + SavedQuery response = assetServiceClient.getSavedQuery(name); + } + } +} +// [END cloudasset_v1_generated_AssetService_GetSavedQuery_String_sync] diff --git a/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetservice/listassets/AsyncListAssets.java b/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetservice/listassets/AsyncListAssets.java index d20f247b00..18f6fc9839 100644 --- a/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetservice/listassets/AsyncListAssets.java +++ b/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetservice/listassets/AsyncListAssets.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -21,6 +21,7 @@ import com.google.cloud.asset.v1.Asset; import com.google.cloud.asset.v1.AssetServiceClient; import com.google.cloud.asset.v1.ContentType; +import com.google.cloud.asset.v1.FolderName; import com.google.cloud.asset.v1.ListAssetsRequest; import com.google.protobuf.Timestamp; import java.util.ArrayList; @@ -40,7 +41,7 @@ public static void asyncListAssets() throws Exception { try (AssetServiceClient assetServiceClient = AssetServiceClient.create()) { ListAssetsRequest request = ListAssetsRequest.newBuilder() - .setParent("ListAssetsRequest-221586066".toString()) + .setParent(FolderName.of("[FOLDER]").toString()) .setReadTime(Timestamp.newBuilder().build()) .addAllAssetTypes(new ArrayList()) .setContentType(ContentType.forNumber(0)) diff --git a/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetservice/listassets/AsyncListAssetsPaged.java b/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetservice/listassets/AsyncListAssetsPaged.java index ff9fb130ea..5d80c0d0de 100644 --- a/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetservice/listassets/AsyncListAssetsPaged.java +++ b/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetservice/listassets/AsyncListAssetsPaged.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -20,6 +20,7 @@ import com.google.cloud.asset.v1.Asset; import com.google.cloud.asset.v1.AssetServiceClient; import com.google.cloud.asset.v1.ContentType; +import com.google.cloud.asset.v1.FolderName; import com.google.cloud.asset.v1.ListAssetsRequest; import com.google.cloud.asset.v1.ListAssetsResponse; import com.google.common.base.Strings; @@ -41,7 +42,7 @@ public static void asyncListAssetsPaged() throws Exception { try (AssetServiceClient assetServiceClient = AssetServiceClient.create()) { ListAssetsRequest request = ListAssetsRequest.newBuilder() - .setParent("ListAssetsRequest-221586066".toString()) + .setParent(FolderName.of("[FOLDER]").toString()) .setReadTime(Timestamp.newBuilder().build()) .addAllAssetTypes(new ArrayList()) .setContentType(ContentType.forNumber(0)) diff --git a/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetservice/listassets/SyncListAssets.java b/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetservice/listassets/SyncListAssets.java index ce3f71caa0..ae0e2cef3d 100644 --- a/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetservice/listassets/SyncListAssets.java +++ b/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetservice/listassets/SyncListAssets.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -20,6 +20,7 @@ import com.google.cloud.asset.v1.Asset; import com.google.cloud.asset.v1.AssetServiceClient; import com.google.cloud.asset.v1.ContentType; +import com.google.cloud.asset.v1.FolderName; import com.google.cloud.asset.v1.ListAssetsRequest; import com.google.protobuf.Timestamp; import java.util.ArrayList; @@ -39,7 +40,7 @@ public static void syncListAssets() throws Exception { try (AssetServiceClient assetServiceClient = AssetServiceClient.create()) { ListAssetsRequest request = ListAssetsRequest.newBuilder() - .setParent("ListAssetsRequest-221586066".toString()) + .setParent(FolderName.of("[FOLDER]").toString()) .setReadTime(Timestamp.newBuilder().build()) .addAllAssetTypes(new ArrayList()) .setContentType(ContentType.forNumber(0)) diff --git a/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetservice/listassets/SyncListAssetsResourcename.java b/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetservice/listassets/SyncListAssetsResourcename.java index bef9f5c125..dd327e31bd 100644 --- a/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetservice/listassets/SyncListAssetsResourcename.java +++ b/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetservice/listassets/SyncListAssetsResourcename.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -20,8 +20,7 @@ import com.google.api.resourcenames.ResourceName; import com.google.cloud.asset.v1.Asset; import com.google.cloud.asset.v1.AssetServiceClient; -import java.util.HashMap; -import java.util.Map; +import com.google.cloud.asset.v1.FolderName; public class SyncListAssetsResourcename { @@ -36,25 +35,7 @@ public static void syncListAssetsResourcename() throws Exception { // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (AssetServiceClient assetServiceClient = AssetServiceClient.create()) { - ResourceName parent = - new ResourceName() { - @Override - public Map getFieldValuesMap() { - Map fieldValuesMap = new HashMap<>(); - fieldValuesMap.put("parent", "parent-4715/parent-4715"); - return fieldValuesMap; - } - - @Override - public String getFieldValue(String fieldName) { - return getFieldValuesMap().get(fieldName); - } - - @Override - public String toString() { - return "parent-4715/parent-4715"; - } - }; + ResourceName parent = FolderName.of("[FOLDER]"); for (Asset element : assetServiceClient.listAssets(parent).iterateAll()) { // doThingsWith(element); } diff --git a/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetservice/listassets/SyncListAssetsString.java b/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetservice/listassets/SyncListAssetsString.java index 6c87901659..97c3352233 100644 --- a/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetservice/listassets/SyncListAssetsString.java +++ b/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetservice/listassets/SyncListAssetsString.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetservice/listfeeds/AsyncListFeeds.java b/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetservice/listfeeds/AsyncListFeeds.java index 4207a2ba55..ddfc45d545 100644 --- a/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetservice/listfeeds/AsyncListFeeds.java +++ b/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetservice/listfeeds/AsyncListFeeds.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetservice/listfeeds/SyncListFeeds.java b/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetservice/listfeeds/SyncListFeeds.java index 8f4c9daa94..862f006511 100644 --- a/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetservice/listfeeds/SyncListFeeds.java +++ b/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetservice/listfeeds/SyncListFeeds.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetservice/listfeeds/SyncListFeedsString.java b/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetservice/listfeeds/SyncListFeedsString.java index 3c94affab0..b1380583d0 100644 --- a/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetservice/listfeeds/SyncListFeedsString.java +++ b/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetservice/listfeeds/SyncListFeedsString.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetservice/listsavedqueries/AsyncListSavedQueries.java b/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetservice/listsavedqueries/AsyncListSavedQueries.java new file mode 100644 index 0000000000..f1d75339a5 --- /dev/null +++ b/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetservice/listsavedqueries/AsyncListSavedQueries.java @@ -0,0 +1,55 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS 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.asset.v1.samples; + +// [START cloudasset_v1_generated_AssetService_ListSavedQueries_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.asset.v1.AssetServiceClient; +import com.google.cloud.asset.v1.ListSavedQueriesRequest; +import com.google.cloud.asset.v1.ProjectName; +import com.google.cloud.asset.v1.SavedQuery; + +public class AsyncListSavedQueries { + + public static void main(String[] args) throws Exception { + asyncListSavedQueries(); + } + + public static void asyncListSavedQueries() 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 (AssetServiceClient assetServiceClient = AssetServiceClient.create()) { + ListSavedQueriesRequest request = + ListSavedQueriesRequest.newBuilder() + .setParent(ProjectName.of("[PROJECT]").toString()) + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + ApiFuture future = + assetServiceClient.listSavedQueriesPagedCallable().futureCall(request); + // Do something. + for (SavedQuery element : future.get().iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END cloudasset_v1_generated_AssetService_ListSavedQueries_async] diff --git a/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetservice/listsavedqueries/AsyncListSavedQueriesPaged.java b/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetservice/listsavedqueries/AsyncListSavedQueriesPaged.java new file mode 100644 index 0000000000..6a9ccc996e --- /dev/null +++ b/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetservice/listsavedqueries/AsyncListSavedQueriesPaged.java @@ -0,0 +1,63 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS 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.asset.v1.samples; + +// [START cloudasset_v1_generated_AssetService_ListSavedQueries_Paged_async] +import com.google.cloud.asset.v1.AssetServiceClient; +import com.google.cloud.asset.v1.ListSavedQueriesRequest; +import com.google.cloud.asset.v1.ListSavedQueriesResponse; +import com.google.cloud.asset.v1.ProjectName; +import com.google.cloud.asset.v1.SavedQuery; +import com.google.common.base.Strings; + +public class AsyncListSavedQueriesPaged { + + public static void main(String[] args) throws Exception { + asyncListSavedQueriesPaged(); + } + + public static void asyncListSavedQueriesPaged() 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 (AssetServiceClient assetServiceClient = AssetServiceClient.create()) { + ListSavedQueriesRequest request = + ListSavedQueriesRequest.newBuilder() + .setParent(ProjectName.of("[PROJECT]").toString()) + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + while (true) { + ListSavedQueriesResponse response = + assetServiceClient.listSavedQueriesCallable().call(request); + for (SavedQuery element : response.getSavedQueriesList()) { + // doThingsWith(element); + } + String nextPageToken = response.getNextPageToken(); + if (!Strings.isNullOrEmpty(nextPageToken)) { + request = request.toBuilder().setPageToken(nextPageToken).build(); + } else { + break; + } + } + } + } +} +// [END cloudasset_v1_generated_AssetService_ListSavedQueries_Paged_async] diff --git a/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetservice/listsavedqueries/SyncListSavedQueries.java b/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetservice/listsavedqueries/SyncListSavedQueries.java new file mode 100644 index 0000000000..833fd46be5 --- /dev/null +++ b/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetservice/listsavedqueries/SyncListSavedQueries.java @@ -0,0 +1,51 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS 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.asset.v1.samples; + +// [START cloudasset_v1_generated_AssetService_ListSavedQueries_sync] +import com.google.cloud.asset.v1.AssetServiceClient; +import com.google.cloud.asset.v1.ListSavedQueriesRequest; +import com.google.cloud.asset.v1.ProjectName; +import com.google.cloud.asset.v1.SavedQuery; + +public class SyncListSavedQueries { + + public static void main(String[] args) throws Exception { + syncListSavedQueries(); + } + + public static void syncListSavedQueries() 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 (AssetServiceClient assetServiceClient = AssetServiceClient.create()) { + ListSavedQueriesRequest request = + ListSavedQueriesRequest.newBuilder() + .setParent(ProjectName.of("[PROJECT]").toString()) + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + for (SavedQuery element : assetServiceClient.listSavedQueries(request).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END cloudasset_v1_generated_AssetService_ListSavedQueries_sync] diff --git a/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetservice/listsavedqueries/SyncListSavedQueriesFoldername.java b/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetservice/listsavedqueries/SyncListSavedQueriesFoldername.java new file mode 100644 index 0000000000..f0149c7100 --- /dev/null +++ b/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetservice/listsavedqueries/SyncListSavedQueriesFoldername.java @@ -0,0 +1,44 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS 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.asset.v1.samples; + +// [START cloudasset_v1_generated_AssetService_ListSavedQueries_Foldername_sync] +import com.google.cloud.asset.v1.AssetServiceClient; +import com.google.cloud.asset.v1.FolderName; +import com.google.cloud.asset.v1.SavedQuery; + +public class SyncListSavedQueriesFoldername { + + public static void main(String[] args) throws Exception { + syncListSavedQueriesFoldername(); + } + + public static void syncListSavedQueriesFoldername() 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 (AssetServiceClient assetServiceClient = AssetServiceClient.create()) { + FolderName parent = FolderName.of("[FOLDER]"); + for (SavedQuery element : assetServiceClient.listSavedQueries(parent).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END cloudasset_v1_generated_AssetService_ListSavedQueries_Foldername_sync] diff --git a/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetservice/listsavedqueries/SyncListSavedQueriesOrganizationname.java b/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetservice/listsavedqueries/SyncListSavedQueriesOrganizationname.java new file mode 100644 index 0000000000..04c9d50759 --- /dev/null +++ b/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetservice/listsavedqueries/SyncListSavedQueriesOrganizationname.java @@ -0,0 +1,44 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS 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.asset.v1.samples; + +// [START cloudasset_v1_generated_AssetService_ListSavedQueries_Organizationname_sync] +import com.google.cloud.asset.v1.AssetServiceClient; +import com.google.cloud.asset.v1.OrganizationName; +import com.google.cloud.asset.v1.SavedQuery; + +public class SyncListSavedQueriesOrganizationname { + + public static void main(String[] args) throws Exception { + syncListSavedQueriesOrganizationname(); + } + + public static void syncListSavedQueriesOrganizationname() 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 (AssetServiceClient assetServiceClient = AssetServiceClient.create()) { + OrganizationName parent = OrganizationName.of("[ORGANIZATION]"); + for (SavedQuery element : assetServiceClient.listSavedQueries(parent).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END cloudasset_v1_generated_AssetService_ListSavedQueries_Organizationname_sync] diff --git a/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetservice/listsavedqueries/SyncListSavedQueriesProjectname.java b/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetservice/listsavedqueries/SyncListSavedQueriesProjectname.java new file mode 100644 index 0000000000..99fbd7618d --- /dev/null +++ b/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetservice/listsavedqueries/SyncListSavedQueriesProjectname.java @@ -0,0 +1,44 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS 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.asset.v1.samples; + +// [START cloudasset_v1_generated_AssetService_ListSavedQueries_Projectname_sync] +import com.google.cloud.asset.v1.AssetServiceClient; +import com.google.cloud.asset.v1.ProjectName; +import com.google.cloud.asset.v1.SavedQuery; + +public class SyncListSavedQueriesProjectname { + + public static void main(String[] args) throws Exception { + syncListSavedQueriesProjectname(); + } + + public static void syncListSavedQueriesProjectname() 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 (AssetServiceClient assetServiceClient = AssetServiceClient.create()) { + ProjectName parent = ProjectName.of("[PROJECT]"); + for (SavedQuery element : assetServiceClient.listSavedQueries(parent).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END cloudasset_v1_generated_AssetService_ListSavedQueries_Projectname_sync] diff --git a/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetservice/listsavedqueries/SyncListSavedQueriesString.java b/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetservice/listsavedqueries/SyncListSavedQueriesString.java new file mode 100644 index 0000000000..52392252e0 --- /dev/null +++ b/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetservice/listsavedqueries/SyncListSavedQueriesString.java @@ -0,0 +1,44 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS 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.asset.v1.samples; + +// [START cloudasset_v1_generated_AssetService_ListSavedQueries_String_sync] +import com.google.cloud.asset.v1.AssetServiceClient; +import com.google.cloud.asset.v1.ProjectName; +import com.google.cloud.asset.v1.SavedQuery; + +public class SyncListSavedQueriesString { + + public static void main(String[] args) throws Exception { + syncListSavedQueriesString(); + } + + public static void syncListSavedQueriesString() 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 (AssetServiceClient assetServiceClient = AssetServiceClient.create()) { + String parent = ProjectName.of("[PROJECT]").toString(); + for (SavedQuery element : assetServiceClient.listSavedQueries(parent).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END cloudasset_v1_generated_AssetService_ListSavedQueries_String_sync] diff --git a/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetservice/queryassets/AsyncQueryAssets.java b/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetservice/queryassets/AsyncQueryAssets.java new file mode 100644 index 0000000000..d7c23a8eed --- /dev/null +++ b/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetservice/queryassets/AsyncQueryAssets.java @@ -0,0 +1,56 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS 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.asset.v1.samples; + +// [START cloudasset_v1_generated_AssetService_QueryAssets_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.asset.v1.AssetServiceClient; +import com.google.cloud.asset.v1.FolderName; +import com.google.cloud.asset.v1.QueryAssetsOutputConfig; +import com.google.cloud.asset.v1.QueryAssetsRequest; +import com.google.cloud.asset.v1.QueryAssetsResponse; +import com.google.protobuf.Duration; + +public class AsyncQueryAssets { + + public static void main(String[] args) throws Exception { + asyncQueryAssets(); + } + + public static void asyncQueryAssets() 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 (AssetServiceClient assetServiceClient = AssetServiceClient.create()) { + QueryAssetsRequest request = + QueryAssetsRequest.newBuilder() + .setParent(FolderName.of("[FOLDER]").toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .setTimeout(Duration.newBuilder().build()) + .setOutputConfig(QueryAssetsOutputConfig.newBuilder().build()) + .build(); + ApiFuture future = + assetServiceClient.queryAssetsCallable().futureCall(request); + // Do something. + QueryAssetsResponse response = future.get(); + } + } +} +// [END cloudasset_v1_generated_AssetService_QueryAssets_async] diff --git a/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetservice/queryassets/SyncQueryAssets.java b/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetservice/queryassets/SyncQueryAssets.java new file mode 100644 index 0000000000..c6c1044cfe --- /dev/null +++ b/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetservice/queryassets/SyncQueryAssets.java @@ -0,0 +1,52 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS 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.asset.v1.samples; + +// [START cloudasset_v1_generated_AssetService_QueryAssets_sync] +import com.google.cloud.asset.v1.AssetServiceClient; +import com.google.cloud.asset.v1.FolderName; +import com.google.cloud.asset.v1.QueryAssetsOutputConfig; +import com.google.cloud.asset.v1.QueryAssetsRequest; +import com.google.cloud.asset.v1.QueryAssetsResponse; +import com.google.protobuf.Duration; + +public class SyncQueryAssets { + + public static void main(String[] args) throws Exception { + syncQueryAssets(); + } + + public static void syncQueryAssets() 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 (AssetServiceClient assetServiceClient = AssetServiceClient.create()) { + QueryAssetsRequest request = + QueryAssetsRequest.newBuilder() + .setParent(FolderName.of("[FOLDER]").toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .setTimeout(Duration.newBuilder().build()) + .setOutputConfig(QueryAssetsOutputConfig.newBuilder().build()) + .build(); + QueryAssetsResponse response = assetServiceClient.queryAssets(request); + } + } +} +// [END cloudasset_v1_generated_AssetService_QueryAssets_sync] diff --git a/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetservice/searchalliampolicies/AsyncSearchAllIamPolicies.java b/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetservice/searchalliampolicies/AsyncSearchAllIamPolicies.java index 12d0a7e183..6b7cf21137 100644 --- a/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetservice/searchalliampolicies/AsyncSearchAllIamPolicies.java +++ b/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetservice/searchalliampolicies/AsyncSearchAllIamPolicies.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetservice/searchalliampolicies/AsyncSearchAllIamPoliciesPaged.java b/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetservice/searchalliampolicies/AsyncSearchAllIamPoliciesPaged.java index 73e3439862..fa43447b62 100644 --- a/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetservice/searchalliampolicies/AsyncSearchAllIamPoliciesPaged.java +++ b/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetservice/searchalliampolicies/AsyncSearchAllIamPoliciesPaged.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetservice/searchalliampolicies/SyncSearchAllIamPolicies.java b/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetservice/searchalliampolicies/SyncSearchAllIamPolicies.java index 76c9f0f56b..bc9b9dabe4 100644 --- a/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetservice/searchalliampolicies/SyncSearchAllIamPolicies.java +++ b/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetservice/searchalliampolicies/SyncSearchAllIamPolicies.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetservice/searchalliampolicies/SyncSearchAllIamPoliciesStringString.java b/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetservice/searchalliampolicies/SyncSearchAllIamPoliciesStringString.java index 61af31efa3..eef9e3c0b0 100644 --- a/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetservice/searchalliampolicies/SyncSearchAllIamPoliciesStringString.java +++ b/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetservice/searchalliampolicies/SyncSearchAllIamPoliciesStringString.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetservice/searchallresources/AsyncSearchAllResources.java b/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetservice/searchallresources/AsyncSearchAllResources.java index 7fb2de5a48..3b8f76b96b 100644 --- a/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetservice/searchallresources/AsyncSearchAllResources.java +++ b/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetservice/searchallresources/AsyncSearchAllResources.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetservice/searchallresources/AsyncSearchAllResourcesPaged.java b/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetservice/searchallresources/AsyncSearchAllResourcesPaged.java index 06586914a2..68e53f516c 100644 --- a/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetservice/searchallresources/AsyncSearchAllResourcesPaged.java +++ b/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetservice/searchallresources/AsyncSearchAllResourcesPaged.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetservice/searchallresources/SyncSearchAllResources.java b/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetservice/searchallresources/SyncSearchAllResources.java index 5f8724fe34..3c1ac52b33 100644 --- a/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetservice/searchallresources/SyncSearchAllResources.java +++ b/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetservice/searchallresources/SyncSearchAllResources.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetservice/searchallresources/SyncSearchAllResourcesStringStringListstring.java b/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetservice/searchallresources/SyncSearchAllResourcesStringStringListstring.java index b62bcc4348..acd6d54e2b 100644 --- a/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetservice/searchallresources/SyncSearchAllResourcesStringStringListstring.java +++ b/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetservice/searchallresources/SyncSearchAllResourcesStringStringListstring.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetservice/updatefeed/AsyncUpdateFeed.java b/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetservice/updatefeed/AsyncUpdateFeed.java index 8a0a05656f..c9ed76a108 100644 --- a/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetservice/updatefeed/AsyncUpdateFeed.java +++ b/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetservice/updatefeed/AsyncUpdateFeed.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetservice/updatefeed/SyncUpdateFeed.java b/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetservice/updatefeed/SyncUpdateFeed.java index b209292a95..2e1c54932b 100644 --- a/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetservice/updatefeed/SyncUpdateFeed.java +++ b/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetservice/updatefeed/SyncUpdateFeed.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetservice/updatefeed/SyncUpdateFeedFeed.java b/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetservice/updatefeed/SyncUpdateFeedFeed.java index bdf9957e77..8a7d6efb4f 100644 --- a/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetservice/updatefeed/SyncUpdateFeedFeed.java +++ b/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetservice/updatefeed/SyncUpdateFeedFeed.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetservice/updatesavedquery/AsyncUpdateSavedQuery.java b/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetservice/updatesavedquery/AsyncUpdateSavedQuery.java new file mode 100644 index 0000000000..cd3bb1627c --- /dev/null +++ b/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetservice/updatesavedquery/AsyncUpdateSavedQuery.java @@ -0,0 +1,51 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS 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.asset.v1.samples; + +// [START cloudasset_v1_generated_AssetService_UpdateSavedQuery_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.asset.v1.AssetServiceClient; +import com.google.cloud.asset.v1.SavedQuery; +import com.google.cloud.asset.v1.UpdateSavedQueryRequest; +import com.google.protobuf.FieldMask; + +public class AsyncUpdateSavedQuery { + + public static void main(String[] args) throws Exception { + asyncUpdateSavedQuery(); + } + + public static void asyncUpdateSavedQuery() 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 (AssetServiceClient assetServiceClient = AssetServiceClient.create()) { + UpdateSavedQueryRequest request = + UpdateSavedQueryRequest.newBuilder() + .setSavedQuery(SavedQuery.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .build(); + ApiFuture future = + assetServiceClient.updateSavedQueryCallable().futureCall(request); + // Do something. + SavedQuery response = future.get(); + } + } +} +// [END cloudasset_v1_generated_AssetService_UpdateSavedQuery_async] diff --git a/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetservice/updatesavedquery/SyncUpdateSavedQuery.java b/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetservice/updatesavedquery/SyncUpdateSavedQuery.java new file mode 100644 index 0000000000..874320f385 --- /dev/null +++ b/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetservice/updatesavedquery/SyncUpdateSavedQuery.java @@ -0,0 +1,47 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS 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.asset.v1.samples; + +// [START cloudasset_v1_generated_AssetService_UpdateSavedQuery_sync] +import com.google.cloud.asset.v1.AssetServiceClient; +import com.google.cloud.asset.v1.SavedQuery; +import com.google.cloud.asset.v1.UpdateSavedQueryRequest; +import com.google.protobuf.FieldMask; + +public class SyncUpdateSavedQuery { + + public static void main(String[] args) throws Exception { + syncUpdateSavedQuery(); + } + + public static void syncUpdateSavedQuery() 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 (AssetServiceClient assetServiceClient = AssetServiceClient.create()) { + UpdateSavedQueryRequest request = + UpdateSavedQueryRequest.newBuilder() + .setSavedQuery(SavedQuery.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .build(); + SavedQuery response = assetServiceClient.updateSavedQuery(request); + } + } +} +// [END cloudasset_v1_generated_AssetService_UpdateSavedQuery_sync] diff --git a/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetservice/updatesavedquery/SyncUpdateSavedQuerySavedqueryFieldmask.java b/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetservice/updatesavedquery/SyncUpdateSavedQuerySavedqueryFieldmask.java new file mode 100644 index 0000000000..f68d41bd8b --- /dev/null +++ b/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetservice/updatesavedquery/SyncUpdateSavedQuerySavedqueryFieldmask.java @@ -0,0 +1,43 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS 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.asset.v1.samples; + +// [START cloudasset_v1_generated_AssetService_UpdateSavedQuery_SavedqueryFieldmask_sync] +import com.google.cloud.asset.v1.AssetServiceClient; +import com.google.cloud.asset.v1.SavedQuery; +import com.google.protobuf.FieldMask; + +public class SyncUpdateSavedQuerySavedqueryFieldmask { + + public static void main(String[] args) throws Exception { + syncUpdateSavedQuerySavedqueryFieldmask(); + } + + public static void syncUpdateSavedQuerySavedqueryFieldmask() 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 (AssetServiceClient assetServiceClient = AssetServiceClient.create()) { + SavedQuery savedQuery = SavedQuery.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + SavedQuery response = assetServiceClient.updateSavedQuery(savedQuery, updateMask); + } + } +} +// [END cloudasset_v1_generated_AssetService_UpdateSavedQuery_SavedqueryFieldmask_sync] diff --git a/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetservicesettings/batchgetassetshistory/SyncBatchGetAssetsHistory.java b/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetservicesettings/batchgetassetshistory/SyncBatchGetAssetsHistory.java index 02f4b3c771..110b54d85e 100644 --- a/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetservicesettings/batchgetassetshistory/SyncBatchGetAssetsHistory.java +++ b/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetservicesettings/batchgetassetshistory/SyncBatchGetAssetsHistory.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -40,7 +40,14 @@ public static void syncBatchGetAssetsHistory() throws Exception { .batchGetAssetsHistorySettings() .getRetrySettings() .toBuilder() - .setTotalTimeout(Duration.ofSeconds(30)) + .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()); AssetServiceSettings assetServiceSettings = assetServiceSettingsBuilder.build(); } diff --git a/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetservicesettings/exportassets/SyncExportAssets.java b/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetservicesettings/exportassets/SyncExportAssets.java new file mode 100644 index 0000000000..784e4052a0 --- /dev/null +++ b/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetservicesettings/exportassets/SyncExportAssets.java @@ -0,0 +1,53 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS 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.asset.v1.samples; + +// [START cloudasset_v1_generated_AssetServiceSettings_ExportAssets_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.asset.v1.AssetServiceSettings; +import java.time.Duration; + +public class SyncExportAssets { + + public static void main(String[] args) throws Exception { + syncExportAssets(); + } + + public static void syncExportAssets() 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 + AssetServiceSettings.Builder assetServiceSettingsBuilder = AssetServiceSettings.newBuilder(); + TimedRetryAlgorithm timedRetryAlgorithm = + OperationalTimedPollAlgorithm.create( + RetrySettings.newBuilder() + .setInitialRetryDelayDuration(Duration.ofMillis(500)) + .setRetryDelayMultiplier(1.5) + .setMaxRetryDelayDuration(Duration.ofMillis(5000)) + .setTotalTimeoutDuration(Duration.ofHours(24)) + .build()); + assetServiceSettingsBuilder + .createClusterOperationSettings() + .setPollingAlgorithm(timedRetryAlgorithm) + .build(); + } +} +// [END cloudasset_v1_generated_AssetServiceSettings_ExportAssets_sync] diff --git a/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/stub/assetservicestubsettings/batchgetassetshistory/SyncBatchGetAssetsHistory.java b/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/stub/assetservicestubsettings/batchgetassetshistory/SyncBatchGetAssetsHistory.java index 31de0fc591..c05389d70c 100644 --- a/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/stub/assetservicestubsettings/batchgetassetshistory/SyncBatchGetAssetsHistory.java +++ b/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/stub/assetservicestubsettings/batchgetassetshistory/SyncBatchGetAssetsHistory.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -41,7 +41,14 @@ public static void syncBatchGetAssetsHistory() throws Exception { .batchGetAssetsHistorySettings() .getRetrySettings() .toBuilder() - .setTotalTimeout(Duration.ofSeconds(30)) + .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()); AssetServiceStubSettings assetServiceSettings = assetServiceSettingsBuilder.build(); } diff --git a/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/stub/assetservicestubsettings/exportassets/SyncExportAssets.java b/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/stub/assetservicestubsettings/exportassets/SyncExportAssets.java new file mode 100644 index 0000000000..76b4d59604 --- /dev/null +++ b/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/stub/assetservicestubsettings/exportassets/SyncExportAssets.java @@ -0,0 +1,54 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS 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.asset.v1.stub.samples; + +// [START cloudasset_v1_generated_AssetServiceStubSettings_ExportAssets_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.asset.v1.stub.AssetServiceStubSettings; +import java.time.Duration; + +public class SyncExportAssets { + + public static void main(String[] args) throws Exception { + syncExportAssets(); + } + + public static void syncExportAssets() 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 + AssetServiceStubSettings.Builder assetServiceSettingsBuilder = + AssetServiceStubSettings.newBuilder(); + TimedRetryAlgorithm timedRetryAlgorithm = + OperationalTimedPollAlgorithm.create( + RetrySettings.newBuilder() + .setInitialRetryDelayDuration(Duration.ofMillis(500)) + .setRetryDelayMultiplier(1.5) + .setMaxRetryDelayDuration(Duration.ofMillis(5000)) + .setTotalTimeoutDuration(Duration.ofHours(24)) + .build()); + assetServiceSettingsBuilder + .createClusterOperationSettings() + .setPollingAlgorithm(timedRetryAlgorithm) + .build(); + } +} +// [END cloudasset_v1_generated_AssetServiceStubSettings_ExportAssets_sync] diff --git a/test/integration/goldens/asset/src/META-INF/native-image/com.google.cloud.asset.v1/reflect-config.json b/test/integration/goldens/asset/src/META-INF/native-image/com.google.cloud.asset.v1/reflect-config.json new file mode 100644 index 0000000000..6b6252809a --- /dev/null +++ b/test/integration/goldens/asset/src/META-INF/native-image/com.google.cloud.asset.v1/reflect-config.json @@ -0,0 +1,3998 @@ +[ + { + "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.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.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.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.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.cloud.asset.v1.AnalyzeIamPolicyLongrunningMetadata", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.asset.v1.AnalyzeIamPolicyLongrunningMetadata$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.asset.v1.AnalyzeIamPolicyLongrunningRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.asset.v1.AnalyzeIamPolicyLongrunningRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.asset.v1.AnalyzeIamPolicyLongrunningResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.asset.v1.AnalyzeIamPolicyLongrunningResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.asset.v1.AnalyzeIamPolicyRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.asset.v1.AnalyzeIamPolicyRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.asset.v1.AnalyzeIamPolicyResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.asset.v1.AnalyzeIamPolicyResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.asset.v1.AnalyzeIamPolicyResponse$IamPolicyAnalysis", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.asset.v1.AnalyzeIamPolicyResponse$IamPolicyAnalysis$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.asset.v1.AnalyzeMoveRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.asset.v1.AnalyzeMoveRequest$AnalysisView", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.asset.v1.AnalyzeMoveRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.asset.v1.AnalyzeMoveResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.asset.v1.AnalyzeMoveResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.asset.v1.Asset", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.asset.v1.Asset$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.asset.v1.AttachedResource", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.asset.v1.AttachedResource$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.asset.v1.BatchGetAssetsHistoryRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.asset.v1.BatchGetAssetsHistoryRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.asset.v1.BatchGetAssetsHistoryResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.asset.v1.BatchGetAssetsHistoryResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.asset.v1.BatchGetEffectiveIamPoliciesRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.asset.v1.BatchGetEffectiveIamPoliciesRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse$EffectiveIamPolicy", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse$EffectiveIamPolicy$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse$EffectiveIamPolicy$PolicyInfo", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse$EffectiveIamPolicy$PolicyInfo$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.asset.v1.BigQueryDestination", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.asset.v1.BigQueryDestination$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.asset.v1.ConditionEvaluation", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.asset.v1.ConditionEvaluation$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.asset.v1.ConditionEvaluation$EvaluationValue", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.asset.v1.ContentType", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.asset.v1.CreateFeedRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.asset.v1.CreateFeedRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.asset.v1.CreateSavedQueryRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.asset.v1.CreateSavedQueryRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.asset.v1.DeleteFeedRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.asset.v1.DeleteFeedRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.asset.v1.DeleteSavedQueryRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.asset.v1.DeleteSavedQueryRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.asset.v1.ExportAssetsRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.asset.v1.ExportAssetsRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.asset.v1.ExportAssetsResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.asset.v1.ExportAssetsResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.asset.v1.Feed", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.asset.v1.Feed$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.asset.v1.FeedOutputConfig", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.asset.v1.FeedOutputConfig$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.asset.v1.GcsDestination", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.asset.v1.GcsDestination$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.asset.v1.GcsOutputResult", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.asset.v1.GcsOutputResult$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.asset.v1.GetFeedRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.asset.v1.GetFeedRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.asset.v1.GetSavedQueryRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.asset.v1.GetSavedQueryRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.asset.v1.IamPolicyAnalysisOutputConfig", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.asset.v1.IamPolicyAnalysisOutputConfig$BigQueryDestination", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.asset.v1.IamPolicyAnalysisOutputConfig$BigQueryDestination$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.asset.v1.IamPolicyAnalysisOutputConfig$BigQueryDestination$PartitionKey", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.asset.v1.IamPolicyAnalysisOutputConfig$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.asset.v1.IamPolicyAnalysisOutputConfig$GcsDestination", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.asset.v1.IamPolicyAnalysisOutputConfig$GcsDestination$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.asset.v1.IamPolicyAnalysisQuery", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.asset.v1.IamPolicyAnalysisQuery$AccessSelector", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.asset.v1.IamPolicyAnalysisQuery$AccessSelector$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.asset.v1.IamPolicyAnalysisQuery$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.asset.v1.IamPolicyAnalysisQuery$ConditionContext", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.asset.v1.IamPolicyAnalysisQuery$ConditionContext$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.asset.v1.IamPolicyAnalysisQuery$IdentitySelector", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.asset.v1.IamPolicyAnalysisQuery$IdentitySelector$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.asset.v1.IamPolicyAnalysisQuery$Options", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.asset.v1.IamPolicyAnalysisQuery$Options$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.asset.v1.IamPolicyAnalysisQuery$ResourceSelector", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.asset.v1.IamPolicyAnalysisQuery$ResourceSelector$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.asset.v1.IamPolicyAnalysisResult", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.asset.v1.IamPolicyAnalysisResult$Access", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.asset.v1.IamPolicyAnalysisResult$Access$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.asset.v1.IamPolicyAnalysisResult$AccessControlList", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.asset.v1.IamPolicyAnalysisResult$AccessControlList$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.asset.v1.IamPolicyAnalysisResult$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.asset.v1.IamPolicyAnalysisResult$Edge", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.asset.v1.IamPolicyAnalysisResult$Edge$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.asset.v1.IamPolicyAnalysisResult$Identity", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.asset.v1.IamPolicyAnalysisResult$Identity$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.asset.v1.IamPolicyAnalysisResult$IdentityList", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.asset.v1.IamPolicyAnalysisResult$IdentityList$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.asset.v1.IamPolicyAnalysisResult$Resource", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.asset.v1.IamPolicyAnalysisResult$Resource$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.asset.v1.IamPolicyAnalysisState", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.asset.v1.IamPolicyAnalysisState$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.asset.v1.IamPolicySearchResult", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.asset.v1.IamPolicySearchResult$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.asset.v1.IamPolicySearchResult$Explanation", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.asset.v1.IamPolicySearchResult$Explanation$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.asset.v1.IamPolicySearchResult$Explanation$Permissions", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.asset.v1.IamPolicySearchResult$Explanation$Permissions$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.asset.v1.ListAssetsRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.asset.v1.ListAssetsRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.asset.v1.ListAssetsResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.asset.v1.ListAssetsResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.asset.v1.ListFeedsRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.asset.v1.ListFeedsRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.asset.v1.ListFeedsResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.asset.v1.ListFeedsResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.asset.v1.ListSavedQueriesRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.asset.v1.ListSavedQueriesRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.asset.v1.ListSavedQueriesResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.asset.v1.ListSavedQueriesResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.asset.v1.MoveAnalysis", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.asset.v1.MoveAnalysis$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.asset.v1.MoveAnalysisResult", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.asset.v1.MoveAnalysisResult$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.asset.v1.MoveImpact", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.asset.v1.MoveImpact$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.asset.v1.OutputConfig", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.asset.v1.OutputConfig$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.asset.v1.OutputResult", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.asset.v1.OutputResult$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.asset.v1.PartitionSpec", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.asset.v1.PartitionSpec$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.asset.v1.PartitionSpec$PartitionKey", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.asset.v1.PubsubDestination", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.asset.v1.PubsubDestination$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.asset.v1.QueryAssetsOutputConfig", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.asset.v1.QueryAssetsOutputConfig$BigQueryDestination", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.asset.v1.QueryAssetsOutputConfig$BigQueryDestination$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.asset.v1.QueryAssetsOutputConfig$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.asset.v1.QueryAssetsRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.asset.v1.QueryAssetsRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.asset.v1.QueryAssetsResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.asset.v1.QueryAssetsResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.asset.v1.QueryResult", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.asset.v1.QueryResult$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.asset.v1.RelatedAsset", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.asset.v1.RelatedAsset$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.asset.v1.RelatedAssets", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.asset.v1.RelatedAssets$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.asset.v1.RelatedResource", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.asset.v1.RelatedResource$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.asset.v1.RelatedResources", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.asset.v1.RelatedResources$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.asset.v1.RelationshipAttributes", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.asset.v1.RelationshipAttributes$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.asset.v1.Resource", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.asset.v1.Resource$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.asset.v1.ResourceSearchResult", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.asset.v1.ResourceSearchResult$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.asset.v1.SavedQuery", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.asset.v1.SavedQuery$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.asset.v1.SavedQuery$QueryContent", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.asset.v1.SavedQuery$QueryContent$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.asset.v1.SearchAllIamPoliciesRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.asset.v1.SearchAllIamPoliciesRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.asset.v1.SearchAllIamPoliciesResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.asset.v1.SearchAllIamPoliciesResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.asset.v1.SearchAllResourcesRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.asset.v1.SearchAllResourcesRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.asset.v1.SearchAllResourcesResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.asset.v1.SearchAllResourcesResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.asset.v1.TableFieldSchema", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.asset.v1.TableFieldSchema$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.asset.v1.TableSchema", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.asset.v1.TableSchema$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.asset.v1.TemporalAsset", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.asset.v1.TemporalAsset$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.asset.v1.TemporalAsset$PriorAssetState", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.asset.v1.TimeWindow", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.asset.v1.TimeWindow$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.asset.v1.UpdateFeedRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.asset.v1.UpdateFeedRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.asset.v1.UpdateSavedQueryRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.asset.v1.UpdateSavedQueryRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.asset.v1.VersionedResource", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.asset.v1.VersionedResource$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.orgpolicy.v1.Policy", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.orgpolicy.v1.Policy$BooleanPolicy", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.orgpolicy.v1.Policy$BooleanPolicy$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.orgpolicy.v1.Policy$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.orgpolicy.v1.Policy$ListPolicy", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.orgpolicy.v1.Policy$ListPolicy$AllValues", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.orgpolicy.v1.Policy$ListPolicy$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.orgpolicy.v1.Policy$RestoreDefault", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.orgpolicy.v1.Policy$RestoreDefault$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.osconfig.v1.GetInventoryRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.osconfig.v1.GetInventoryRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.osconfig.v1.Inventory", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.osconfig.v1.Inventory$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.osconfig.v1.Inventory$Item", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.osconfig.v1.Inventory$Item$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.osconfig.v1.Inventory$Item$OriginType", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.osconfig.v1.Inventory$Item$Type", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.osconfig.v1.Inventory$OsInfo", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.osconfig.v1.Inventory$OsInfo$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.osconfig.v1.Inventory$SoftwarePackage", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.osconfig.v1.Inventory$SoftwarePackage$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.osconfig.v1.Inventory$VersionedPackage", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.osconfig.v1.Inventory$VersionedPackage$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.osconfig.v1.Inventory$WindowsApplication", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.osconfig.v1.Inventory$WindowsApplication$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.osconfig.v1.Inventory$WindowsQuickFixEngineeringPackage", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.osconfig.v1.Inventory$WindowsQuickFixEngineeringPackage$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.osconfig.v1.Inventory$WindowsUpdatePackage", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.osconfig.v1.Inventory$WindowsUpdatePackage$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.osconfig.v1.Inventory$WindowsUpdatePackage$WindowsUpdateCategory", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.osconfig.v1.Inventory$WindowsUpdatePackage$WindowsUpdateCategory$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.osconfig.v1.Inventory$ZypperPatch", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.osconfig.v1.Inventory$ZypperPatch$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.osconfig.v1.InventoryView", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.osconfig.v1.ListInventoriesRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.osconfig.v1.ListInventoriesRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.osconfig.v1.ListInventoriesResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.osconfig.v1.ListInventoriesResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.iam.v1.AuditConfig", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.iam.v1.AuditConfig$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.iam.v1.AuditConfigDelta", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.iam.v1.AuditConfigDelta$Action", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.iam.v1.AuditConfigDelta$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.iam.v1.AuditLogConfig", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.iam.v1.AuditLogConfig$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.iam.v1.AuditLogConfig$LogType", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.iam.v1.Binding", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.iam.v1.Binding$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.iam.v1.BindingDelta", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.iam.v1.BindingDelta$Action", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.iam.v1.BindingDelta$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.iam.v1.Policy", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.iam.v1.Policy$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.iam.v1.PolicyDelta", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.iam.v1.PolicyDelta$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.identity.accesscontextmanager.type.DeviceEncryptionStatus", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.identity.accesscontextmanager.type.DeviceManagementLevel", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.identity.accesscontextmanager.type.OsType", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.identity.accesscontextmanager.v1.AccessLevel", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.identity.accesscontextmanager.v1.AccessLevel$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.identity.accesscontextmanager.v1.AccessPolicy", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.identity.accesscontextmanager.v1.AccessPolicy$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.identity.accesscontextmanager.v1.BasicLevel", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.identity.accesscontextmanager.v1.BasicLevel$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.identity.accesscontextmanager.v1.BasicLevel$ConditionCombiningFunction", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.identity.accesscontextmanager.v1.Condition", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.identity.accesscontextmanager.v1.Condition$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.identity.accesscontextmanager.v1.CustomLevel", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.identity.accesscontextmanager.v1.CustomLevel$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.identity.accesscontextmanager.v1.DevicePolicy", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.identity.accesscontextmanager.v1.DevicePolicy$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.identity.accesscontextmanager.v1.OsConstraint", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.identity.accesscontextmanager.v1.OsConstraint$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.identity.accesscontextmanager.v1.ServicePerimeter", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.identity.accesscontextmanager.v1.ServicePerimeter$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.identity.accesscontextmanager.v1.ServicePerimeter$PerimeterType", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.identity.accesscontextmanager.v1.ServicePerimeterConfig", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.identity.accesscontextmanager.v1.ServicePerimeterConfig$ApiOperation", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.identity.accesscontextmanager.v1.ServicePerimeterConfig$ApiOperation$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.identity.accesscontextmanager.v1.ServicePerimeterConfig$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.identity.accesscontextmanager.v1.ServicePerimeterConfig$EgressFrom", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.identity.accesscontextmanager.v1.ServicePerimeterConfig$EgressFrom$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.identity.accesscontextmanager.v1.ServicePerimeterConfig$EgressPolicy", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.identity.accesscontextmanager.v1.ServicePerimeterConfig$EgressPolicy$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.identity.accesscontextmanager.v1.ServicePerimeterConfig$EgressTo", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.identity.accesscontextmanager.v1.ServicePerimeterConfig$EgressTo$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.identity.accesscontextmanager.v1.ServicePerimeterConfig$IdentityType", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.identity.accesscontextmanager.v1.ServicePerimeterConfig$IngressFrom", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.identity.accesscontextmanager.v1.ServicePerimeterConfig$IngressFrom$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.identity.accesscontextmanager.v1.ServicePerimeterConfig$IngressPolicy", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.identity.accesscontextmanager.v1.ServicePerimeterConfig$IngressPolicy$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.identity.accesscontextmanager.v1.ServicePerimeterConfig$IngressSource", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.identity.accesscontextmanager.v1.ServicePerimeterConfig$IngressSource$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.identity.accesscontextmanager.v1.ServicePerimeterConfig$IngressTo", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.identity.accesscontextmanager.v1.ServicePerimeterConfig$IngressTo$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.identity.accesscontextmanager.v1.ServicePerimeterConfig$MethodSelector", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.identity.accesscontextmanager.v1.ServicePerimeterConfig$MethodSelector$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.identity.accesscontextmanager.v1.ServicePerimeterConfig$VpcAccessibleServices", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.identity.accesscontextmanager.v1.ServicePerimeterConfig$VpcAccessibleServices$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.Code", + "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 + }, + { + "name": "com.google.type.Date", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.type.Date$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.type.Expr", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.type.Expr$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + } +] \ No newline at end of file diff --git a/test/integration/goldens/asset/src/com/google/cloud/asset/v1/AssetServiceClient.java b/test/integration/goldens/asset/src/com/google/cloud/asset/v1/AssetServiceClient.java index ec0e81a812..a7841addfd 100644 --- a/test/integration/goldens/asset/src/com/google/cloud/asset/v1/AssetServiceClient.java +++ b/test/integration/goldens/asset/src/com/google/cloud/asset/v1/AssetServiceClient.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -18,7 +18,9 @@ import com.google.api.core.ApiFuture; import com.google.api.core.ApiFutures; +import com.google.api.core.BetaApi; import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.httpjson.longrunning.OperationsClient; import com.google.api.gax.longrunning.OperationFuture; import com.google.api.gax.paging.AbstractFixedSizeCollection; import com.google.api.gax.paging.AbstractPage; @@ -31,8 +33,8 @@ import com.google.cloud.asset.v1.stub.AssetServiceStubSettings; import com.google.common.util.concurrent.MoreExecutors; 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; @@ -54,7 +56,7 @@ * try (AssetServiceClient assetServiceClient = AssetServiceClient.create()) { * BatchGetAssetsHistoryRequest request = * BatchGetAssetsHistoryRequest.newBuilder() - * .setParent("BatchGetAssetsHistoryRequest1575208378".toString()) + * .setParent(FolderName.of("[FOLDER]").toString()) * .addAllAssetNames(new ArrayList()) * .setContentType(ContentType.forNumber(0)) * .setReadTimeWindow(TimeWindow.newBuilder().build()) @@ -67,19 +69,366 @@ *

        Note: close() needs to be called on the AssetServiceClient object to clean up resources such * as threads. In the example above, try-with-resources is used, which automatically calls close(). * - *

        The surface of this class includes several types of Java methods for each of the API's - * methods: - * - *

          - *
        1. A "flattened" method. With this type of method, the fields of the request type have been - * converted into function parameters. It may be the case that not all fields are available as - * parameters, and not every API method will have a flattened method entry point. - *
        2. A "request object" method. This type of method only takes one parameter, a request object, - * which must be constructed before the call. Not every API method will have a request object - * method. - *
        3. A "callable" method. This type of method takes no parameters and returns an immutable API - * callable object, which can be used to initiate calls to the service. - *
        + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + *
        Methods
        MethodDescriptionMethod Variants

        ExportAssets

        Exports assets with time and resource types to a given Cloud Storage location/BigQuery table. For Cloud Storage location destinations, the output format is newline-delimited JSON. Each line represents a [google.cloud.asset.v1.Asset][google.cloud.asset.v1.Asset] in the JSON format; for BigQuery table destinations, the output table stores the fields in asset Protobuf as columns. This API implements the [google.longrunning.Operation][google.longrunning.Operation] API, which allows you to keep track of the export. We recommend intervals of at least 2 seconds with exponential retry to poll the export operation result. For regular-size resource parent, the export operation usually finishes within 5 minutes.

        + *

        Request object method variants only take one parameter, a request object, which must be constructed before the call.

        + *
          + *
        • exportAssetsAsync(ExportAssetsRequest request) + *

        + *

        Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

        + *
          + *
        • exportAssetsOperationCallable() + *

        • exportAssetsCallable() + *

        + *

        ListAssets

        Lists assets with time and resource types and returns paged results in response.

        + *

        Request object method variants only take one parameter, a request object, which must be constructed before the call.

        + *
          + *
        • listAssets(ListAssetsRequest request) + *

        + *

        "Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

        + *
          + *
        • listAssets(ResourceName parent) + *

        • listAssets(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.

        + *
          + *
        • listAssetsPagedCallable() + *

        • listAssetsCallable() + *

        + *

        BatchGetAssetsHistory

        Batch gets the update history of assets that overlap a time window. For IAM_POLICY content, this API outputs history when the asset and its attached IAM POLICY both exist. This can create gaps in the output history. Otherwise, this API outputs history with asset in both non-delete or deleted status. If a specified asset does not exist, this API returns an INVALID_ARGUMENT error.

        + *

        Request object method variants only take one parameter, a request object, which must be constructed before the call.

        + *
          + *
        • batchGetAssetsHistory(BatchGetAssetsHistoryRequest request) + *

        + *

        Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

        + *
          + *
        • batchGetAssetsHistoryCallable() + *

        + *

        CreateFeed

        Creates a feed in a parent project/folder/organization to listen to its asset updates.

        + *

        Request object method variants only take one parameter, a request object, which must be constructed before the call.

        + *
          + *
        • createFeed(CreateFeedRequest request) + *

        + *

        "Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

        + *
          + *
        • createFeed(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.

        + *
          + *
        • createFeedCallable() + *

        + *

        GetFeed

        Gets details about an asset feed.

        + *

        Request object method variants only take one parameter, a request object, which must be constructed before the call.

        + *
          + *
        • getFeed(GetFeedRequest request) + *

        + *

        "Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

        + *
          + *
        • getFeed(FeedName name) + *

        • getFeed(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.

        + *
          + *
        • getFeedCallable() + *

        + *

        ListFeeds

        Lists all asset feeds in a parent project/folder/organization.

        + *

        Request object method variants only take one parameter, a request object, which must be constructed before the call.

        + *
          + *
        • listFeeds(ListFeedsRequest request) + *

        + *

        "Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

        + *
          + *
        • listFeeds(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.

        + *
          + *
        • listFeedsCallable() + *

        + *

        UpdateFeed

        Updates an asset feed configuration.

        + *

        Request object method variants only take one parameter, a request object, which must be constructed before the call.

        + *
          + *
        • updateFeed(UpdateFeedRequest request) + *

        + *

        "Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

        + *
          + *
        • updateFeed(Feed feed) + *

        + *

        Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

        + *
          + *
        • updateFeedCallable() + *

        + *

        DeleteFeed

        Deletes an asset feed.

        + *

        Request object method variants only take one parameter, a request object, which must be constructed before the call.

        + *
          + *
        • deleteFeed(DeleteFeedRequest request) + *

        + *

        "Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

        + *
          + *
        • deleteFeed(FeedName name) + *

        • deleteFeed(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.

        + *
          + *
        • deleteFeedCallable() + *

        + *

        SearchAllResources

        Searches all Cloud resources within the specified scope, such as a project, folder, or organization. The caller must be granted the `cloudasset.assets.searchAllResources` permission on the desired scope, otherwise the request will be rejected.

        + *

        Request object method variants only take one parameter, a request object, which must be constructed before the call.

        + *
          + *
        • searchAllResources(SearchAllResourcesRequest request) + *

        + *

        "Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

        + *
          + *
        • searchAllResources(String scope, String query, List<String> assetTypes) + *

        + *

        Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

        + *
          + *
        • searchAllResourcesPagedCallable() + *

        • searchAllResourcesCallable() + *

        + *

        SearchAllIamPolicies

        Searches all IAM policies within the specified scope, such as a project, folder, or organization. The caller must be granted the `cloudasset.assets.searchAllIamPolicies` permission on the desired scope, otherwise the request will be rejected.

        + *

        Request object method variants only take one parameter, a request object, which must be constructed before the call.

        + *
          + *
        • searchAllIamPolicies(SearchAllIamPoliciesRequest request) + *

        + *

        "Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

        + *
          + *
        • searchAllIamPolicies(String scope, String query) + *

        + *

        Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

        + *
          + *
        • searchAllIamPoliciesPagedCallable() + *

        • searchAllIamPoliciesCallable() + *

        + *

        AnalyzeIamPolicy

        Analyzes IAM policies to answer which identities have what accesses on which resources.

        + *

        Request object method variants only take one parameter, a request object, which must be constructed before the call.

        + *
          + *
        • analyzeIamPolicy(AnalyzeIamPolicyRequest request) + *

        + *

        Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

        + *
          + *
        • analyzeIamPolicyCallable() + *

        + *

        AnalyzeIamPolicyLongrunning

        Analyzes IAM policies asynchronously to answer which identities have what accesses on which resources, and writes the analysis results to a Google Cloud Storage or a BigQuery destination. For Cloud Storage destination, the output format is the JSON format that represents a [AnalyzeIamPolicyResponse][google.cloud.asset.v1.AnalyzeIamPolicyResponse]. This method implements the [google.longrunning.Operation][google.longrunning.Operation], which allows you to track the operation status. We recommend intervals of at least 2 seconds with exponential backoff retry to poll the operation result. The metadata contains the metadata for the long-running operation.

        + *

        Request object method variants only take one parameter, a request object, which must be constructed before the call.

        + *
          + *
        • analyzeIamPolicyLongrunningAsync(AnalyzeIamPolicyLongrunningRequest request) + *

        + *

        Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

        + *
          + *
        • analyzeIamPolicyLongrunningOperationCallable() + *

        • analyzeIamPolicyLongrunningCallable() + *

        + *

        AnalyzeMove

        Analyze moving a resource to a specified destination without kicking off the actual move. The analysis is best effort depending on the user's permissions of viewing different hierarchical policies and configurations. The policies and configuration are subject to change before the actual resource migration takes place.

        + *

        Request object method variants only take one parameter, a request object, which must be constructed before the call.

        + *
          + *
        • analyzeMove(AnalyzeMoveRequest request) + *

        + *

        Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

        + *
          + *
        • analyzeMoveCallable() + *

        + *

        QueryAssets

        Issue a job that queries assets using a SQL statement compatible with [BigQuery Standard SQL](http://cloud/bigquery/docs/reference/standard-sql/enabling-standard-sql). + *

        If the query execution finishes within timeout and there's no pagination, the full query results will be returned in the `QueryAssetsResponse`. + *

        Otherwise, full query results can be obtained by issuing extra requests with the `job_reference` from the a previous `QueryAssets` call. + *

        Note, the query result has approximately 10 GB limitation enforced by BigQuery https://cloud.google.com/bigquery/docs/best-practices-performance-output, queries return larger results will result in errors.

        + *

        Request object method variants only take one parameter, a request object, which must be constructed before the call.

        + *
          + *
        • queryAssets(QueryAssetsRequest request) + *

        + *

        Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

        + *
          + *
        • queryAssetsCallable() + *

        + *

        CreateSavedQuery

        Creates a saved query in a parent project/folder/organization.

        + *

        Request object method variants only take one parameter, a request object, which must be constructed before the call.

        + *
          + *
        • createSavedQuery(CreateSavedQueryRequest request) + *

        + *

        "Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

        + *
          + *
        • createSavedQuery(FolderName parent, SavedQuery savedQuery, String savedQueryId) + *

        • createSavedQuery(OrganizationName parent, SavedQuery savedQuery, String savedQueryId) + *

        • createSavedQuery(ProjectName parent, SavedQuery savedQuery, String savedQueryId) + *

        • createSavedQuery(String parent, SavedQuery savedQuery, String savedQueryId) + *

        + *

        Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

        + *
          + *
        • createSavedQueryCallable() + *

        + *

        GetSavedQuery

        Gets details about a saved query.

        + *

        Request object method variants only take one parameter, a request object, which must be constructed before the call.

        + *
          + *
        • getSavedQuery(GetSavedQueryRequest request) + *

        + *

        "Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

        + *
          + *
        • getSavedQuery(SavedQueryName name) + *

        • getSavedQuery(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.

        + *
          + *
        • getSavedQueryCallable() + *

        + *

        ListSavedQueries

        Lists all saved queries in a parent project/folder/organization.

        + *

        Request object method variants only take one parameter, a request object, which must be constructed before the call.

        + *
          + *
        • listSavedQueries(ListSavedQueriesRequest request) + *

        + *

        "Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

        + *
          + *
        • listSavedQueries(FolderName parent) + *

        • listSavedQueries(OrganizationName parent) + *

        • listSavedQueries(ProjectName parent) + *

        • listSavedQueries(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.

        + *
          + *
        • listSavedQueriesPagedCallable() + *

        • listSavedQueriesCallable() + *

        + *

        UpdateSavedQuery

        Updates a saved query.

        + *

        Request object method variants only take one parameter, a request object, which must be constructed before the call.

        + *
          + *
        • updateSavedQuery(UpdateSavedQueryRequest request) + *

        + *

        "Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

        + *
          + *
        • updateSavedQuery(SavedQuery savedQuery, 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.

        + *
          + *
        • updateSavedQueryCallable() + *

        + *

        DeleteSavedQuery

        Deletes a saved query.

        + *

        Request object method variants only take one parameter, a request object, which must be constructed before the call.

        + *
          + *
        • deleteSavedQuery(DeleteSavedQueryRequest request) + *

        + *

        "Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

        + *
          + *
        • deleteSavedQuery(SavedQueryName name) + *

        • deleteSavedQuery(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.

        + *
          + *
        • deleteSavedQueryCallable() + *

        + *

        BatchGetEffectiveIamPolicies

        Gets effective IAM policies for a batch of resources.

        + *

        Request object method variants only take one parameter, a request object, which must be constructed before the call.

        + *
          + *
        • batchGetEffectiveIamPolicies(BatchGetEffectiveIamPoliciesRequest request) + *

        + *

        Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

        + *
          + *
        • batchGetEffectiveIamPoliciesCallable() + *

        + *
        * *

        See the individual methods for example code. * @@ -118,13 +467,27 @@ * AssetServiceClient assetServiceClient = AssetServiceClient.create(assetServiceSettings); * } * + *

        To use REST (HTTP1.1/JSON) transport (instead of gRPC) for sending and receiving requests over + * the wire: + * + *

        {@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
        + * AssetServiceSettings assetServiceSettings = AssetServiceSettings.newHttpJsonBuilder().build();
        + * AssetServiceClient assetServiceClient = AssetServiceClient.create(assetServiceSettings);
        + * }
        + * *

        Please refer to the GitHub repository's samples for more quickstart code snippets. */ @Generated("by gapic-generator-java") public class AssetServiceClient implements BackgroundResource { private final AssetServiceSettings settings; private final AssetServiceStub stub; - private final OperationsClient operationsClient; + private final OperationsClient httpJsonOperationsClient; + private final com.google.longrunning.OperationsClient operationsClient; /** Constructs an instance of AssetServiceClient with default settings. */ public static final AssetServiceClient create() throws IOException { @@ -155,13 +518,17 @@ public static final AssetServiceClient create(AssetServiceStub stub) { protected AssetServiceClient(AssetServiceSettings settings) throws IOException { this.settings = settings; this.stub = ((AssetServiceStubSettings) settings.getStubSettings()).createStub(); - this.operationsClient = OperationsClient.create(this.stub.getOperationsStub()); + this.operationsClient = + com.google.longrunning.OperationsClient.create(this.stub.getOperationsStub()); + this.httpJsonOperationsClient = OperationsClient.create(this.stub.getHttpJsonOperationsStub()); } protected AssetServiceClient(AssetServiceStub stub) { this.settings = null; this.stub = stub; - this.operationsClient = OperationsClient.create(this.stub.getOperationsStub()); + this.operationsClient = + com.google.longrunning.OperationsClient.create(this.stub.getOperationsStub()); + this.httpJsonOperationsClient = OperationsClient.create(this.stub.getHttpJsonOperationsStub()); } public final AssetServiceSettings getSettings() { @@ -176,17 +543,26 @@ public AssetServiceStub getStub() { * 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() { + public final com.google.longrunning.OperationsClient getOperationsClient() { return operationsClient; } + /** + * Returns the OperationsClient that can be used to query the status of a long-running operation + * returned by another API method call. + */ + @BetaApi + public final OperationsClient getHttpJsonOperationsClient() { + return httpJsonOperationsClient; + } + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Exports assets with time and resource types to a given Cloud Storage location/BigQuery table. * For Cloud Storage location destinations, the output format is newline-delimited JSON. Each line * represents a [google.cloud.asset.v1.Asset][google.cloud.asset.v1.Asset] in the JSON format; for - * BigQuery table destinations, the output table stores the fields in asset proto as columns. This - * API implements the [google.longrunning.Operation][google.longrunning.Operation] API , which + * BigQuery table destinations, the output table stores the fields in asset Protobuf as columns. + * This API implements the [google.longrunning.Operation][google.longrunning.Operation] API, which * allows you to keep track of the export. We recommend intervals of at least 2 seconds with * exponential retry to poll the export operation result. For regular-size resource parent, the * export operation usually finishes within 5 minutes. @@ -202,7 +578,7 @@ public final OperationsClient getOperationsClient() { * try (AssetServiceClient assetServiceClient = AssetServiceClient.create()) { * ExportAssetsRequest request = * ExportAssetsRequest.newBuilder() - * .setParent("ExportAssetsRequest-846449128".toString()) + * .setParent(FolderName.of("[FOLDER]").toString()) * .setReadTime(Timestamp.newBuilder().build()) * .addAllAssetTypes(new ArrayList()) * .setContentType(ContentType.forNumber(0)) @@ -226,8 +602,8 @@ public final OperationFuture exportAs * Exports assets with time and resource types to a given Cloud Storage location/BigQuery table. * For Cloud Storage location destinations, the output format is newline-delimited JSON. Each line * represents a [google.cloud.asset.v1.Asset][google.cloud.asset.v1.Asset] in the JSON format; for - * BigQuery table destinations, the output table stores the fields in asset proto as columns. This - * API implements the [google.longrunning.Operation][google.longrunning.Operation] API , which + * BigQuery table destinations, the output table stores the fields in asset Protobuf as columns. + * This API implements the [google.longrunning.Operation][google.longrunning.Operation] API, which * allows you to keep track of the export. We recommend intervals of at least 2 seconds with * exponential retry to poll the export operation result. For regular-size resource parent, the * export operation usually finishes within 5 minutes. @@ -243,7 +619,7 @@ public final OperationFuture exportAs * try (AssetServiceClient assetServiceClient = AssetServiceClient.create()) { * ExportAssetsRequest request = * ExportAssetsRequest.newBuilder() - * .setParent("ExportAssetsRequest-846449128".toString()) + * .setParent(FolderName.of("[FOLDER]").toString()) * .setReadTime(Timestamp.newBuilder().build()) * .addAllAssetTypes(new ArrayList()) * .setContentType(ContentType.forNumber(0)) @@ -267,8 +643,8 @@ public final OperationFuture exportAs * Exports assets with time and resource types to a given Cloud Storage location/BigQuery table. * For Cloud Storage location destinations, the output format is newline-delimited JSON. Each line * represents a [google.cloud.asset.v1.Asset][google.cloud.asset.v1.Asset] in the JSON format; for - * BigQuery table destinations, the output table stores the fields in asset proto as columns. This - * API implements the [google.longrunning.Operation][google.longrunning.Operation] API , which + * BigQuery table destinations, the output table stores the fields in asset Protobuf as columns. + * This API implements the [google.longrunning.Operation][google.longrunning.Operation] API, which * allows you to keep track of the export. We recommend intervals of at least 2 seconds with * exponential retry to poll the export operation result. For regular-size resource parent, the * export operation usually finishes within 5 minutes. @@ -284,7 +660,7 @@ public final OperationFuture exportAs * try (AssetServiceClient assetServiceClient = AssetServiceClient.create()) { * ExportAssetsRequest request = * ExportAssetsRequest.newBuilder() - * .setParent("ExportAssetsRequest-846449128".toString()) + * .setParent(FolderName.of("[FOLDER]").toString()) * .setReadTime(Timestamp.newBuilder().build()) * .addAllAssetTypes(new ArrayList()) * .setContentType(ContentType.forNumber(0)) @@ -314,35 +690,17 @@ public final UnaryCallable exportAssetsCallable( * // - It may require specifying regional endpoints when creating the service client as shown in * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library * try (AssetServiceClient assetServiceClient = AssetServiceClient.create()) { - * ResourceName parent = - * new ResourceName() { - * {@literal @}Override - * public Map getFieldValuesMap() { - * Map fieldValuesMap = new HashMap<>(); - * fieldValuesMap.put("parent", "parent-4715/parent-4715"); - * return fieldValuesMap; - * } - * - * {@literal @}Override - * public String getFieldValue(String fieldName) { - * return getFieldValuesMap().get(fieldName); - * } - * - * {@literal @}Override - * public String toString() { - * return "parent-4715/parent-4715"; - * } - * }; + * ResourceName parent = FolderName.of("[FOLDER]"); * for (Asset element : assetServiceClient.listAssets(parent).iterateAll()) { * // doThingsWith(element); * } * } * } * - * @param parent Required. Name of the organization or project the assets belong to. Format: - * "organizations/[organization-number]" (such as "organizations/123"), - * "projects/[project-id]" (such as "projects/my-project-id"), or "projects/[project-number]" - * (such as "projects/12345"). + * @param parent Required. Name of the organization, folder, or project the assets belong to. + * Format: "organizations/[organization-number]" (such as "organizations/123"), + * "projects/[project-id]" (such as "projects/my-project-id"), "projects/[project-number]" + * (such as "projects/12345"), or "folders/[folder-number]" (such as "folders/12345"). * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final ListAssetsPagedResponse listAssets(ResourceName parent) { @@ -371,10 +729,10 @@ public final ListAssetsPagedResponse listAssets(ResourceName parent) { * } * } * - * @param parent Required. Name of the organization or project the assets belong to. Format: - * "organizations/[organization-number]" (such as "organizations/123"), - * "projects/[project-id]" (such as "projects/my-project-id"), or "projects/[project-number]" - * (such as "projects/12345"). + * @param parent Required. Name of the organization, folder, or project the assets belong to. + * Format: "organizations/[organization-number]" (such as "organizations/123"), + * "projects/[project-id]" (such as "projects/my-project-id"), "projects/[project-number]" + * (such as "projects/12345"), or "folders/[folder-number]" (such as "folders/12345"). * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final ListAssetsPagedResponse listAssets(String parent) { @@ -397,7 +755,7 @@ public final ListAssetsPagedResponse listAssets(String parent) { * try (AssetServiceClient assetServiceClient = AssetServiceClient.create()) { * ListAssetsRequest request = * ListAssetsRequest.newBuilder() - * .setParent("ListAssetsRequest-221586066".toString()) + * .setParent(FolderName.of("[FOLDER]").toString()) * .setReadTime(Timestamp.newBuilder().build()) * .addAllAssetTypes(new ArrayList()) * .setContentType(ContentType.forNumber(0)) @@ -433,7 +791,7 @@ public final ListAssetsPagedResponse listAssets(ListAssetsRequest request) { * try (AssetServiceClient assetServiceClient = AssetServiceClient.create()) { * ListAssetsRequest request = * ListAssetsRequest.newBuilder() - * .setParent("ListAssetsRequest-221586066".toString()) + * .setParent(FolderName.of("[FOLDER]").toString()) * .setReadTime(Timestamp.newBuilder().build()) * .addAllAssetTypes(new ArrayList()) * .setContentType(ContentType.forNumber(0)) @@ -468,7 +826,7 @@ public final UnaryCallable listAsset * try (AssetServiceClient assetServiceClient = AssetServiceClient.create()) { * ListAssetsRequest request = * ListAssetsRequest.newBuilder() - * .setParent("ListAssetsRequest-221586066".toString()) + * .setParent(FolderName.of("[FOLDER]").toString()) * .setReadTime(Timestamp.newBuilder().build()) * .addAllAssetTypes(new ArrayList()) * .setContentType(ContentType.forNumber(0)) @@ -514,7 +872,7 @@ public final UnaryCallable listAssetsCall * try (AssetServiceClient assetServiceClient = AssetServiceClient.create()) { * BatchGetAssetsHistoryRequest request = * BatchGetAssetsHistoryRequest.newBuilder() - * .setParent("BatchGetAssetsHistoryRequest1575208378".toString()) + * .setParent(FolderName.of("[FOLDER]").toString()) * .addAllAssetNames(new ArrayList()) * .setContentType(ContentType.forNumber(0)) * .setReadTimeWindow(TimeWindow.newBuilder().build()) @@ -551,7 +909,7 @@ public final BatchGetAssetsHistoryResponse batchGetAssetsHistory( * try (AssetServiceClient assetServiceClient = AssetServiceClient.create()) { * BatchGetAssetsHistoryRequest request = * BatchGetAssetsHistoryRequest.newBuilder() - * .setParent("BatchGetAssetsHistoryRequest1575208378".toString()) + * .setParent(FolderName.of("[FOLDER]").toString()) * .addAllAssetNames(new ArrayList()) * .setContentType(ContentType.forNumber(0)) * .setReadTimeWindow(TimeWindow.newBuilder().build()) @@ -1100,7 +1458,17 @@ public final UnaryCallable deleteFeedCallable() { * "prod". *

      • `labels.env:*` to find Cloud resources that have a label "env". *
      • `kmsKey:key` to find Cloud resources encrypted with a customer-managed encryption key + * whose name contains "key" as a word. This field is deprecated. Please use the + * `kmsKeys` field to retrieve KMS key information. + *
      • `kmsKeys:key` to find Cloud resources encrypted with customer-managed encryption keys * whose name contains the word "key". + *
      • `relationships:instance-group-1` to find Cloud resources that have relationships with + * "instance-group-1" in the related resource name. + *
      • `relationships:INSTANCE_TO_INSTANCEGROUP` to find compute instances that have + * relationships of type "INSTANCE_TO_INSTANCEGROUP". + *
      • `relationships.INSTANCE_TO_INSTANCEGROUP:instance-group-1` to find compute instances + * that have relationships with "instance-group-1" in the compute instance group + * resource name, for relationship type "INSTANCE_TO_INSTANCEGROUP". *
      • `state:ACTIVE` to find Cloud resources whose state contains "ACTIVE" as a word. *
      • `NOT state:ACTIVE` to find Cloud resources whose state doesn't contain "ACTIVE" as a * word. @@ -1310,10 +1678,10 @@ public final SearchAllResourcesPagedResponse searchAllResources( * query](https://cloud.google.com/asset-inventory/docs/searching-iam-policies#how_to_construct_a_query) * for more information. If not specified or empty, it will search all the IAM policies within * the specified `scope`. Note that the query string is compared against each Cloud IAM policy - * binding, including its members, roles, and Cloud IAM conditions. The returned Cloud IAM + * binding, including its principals, roles, and Cloud IAM conditions. The returned Cloud IAM * policies will only contain the bindings that match your query. To learn more about the IAM - * policy structure, see [IAM policy - * doc](https://cloud.google.com/iam/docs/policies#structure). + * policy structure, see the [IAM policy + * documentation](https://cloud.google.com/iam/help/allow-policies/structure). *

        Examples: *

          *
        • `policy:amy{@literal @}gmail.com` to find IAM policy bindings that specify user @@ -1340,7 +1708,8 @@ public final SearchAllResourcesPagedResponse searchAllResources( * set on resources "instance1" or "instance2" and also specify user "amy". *
        • `roles:roles/compute.admin` to find IAM policy bindings that specify the Compute * Admin role. - *
        • `memberTypes:user` to find IAM policy bindings that contain the "user" member type. + *
        • `memberTypes:user` to find IAM policy bindings that contain the principal type + * "user". *
        * * @throws com.google.api.gax.rpc.ApiException if the remote call fails @@ -1489,6 +1858,7 @@ public final SearchAllIamPoliciesPagedResponse searchAllIamPolicies( * AnalyzeIamPolicyRequest request = * AnalyzeIamPolicyRequest.newBuilder() * .setAnalysisQuery(IamPolicyAnalysisQuery.newBuilder().build()) + * .setSavedAnalysisQuery("savedAnalysisQuery376058885") * .setExecutionTimeout(Duration.newBuilder().build()) * .build(); * AnalyzeIamPolicyResponse response = assetServiceClient.analyzeIamPolicy(request); @@ -1518,6 +1888,7 @@ public final AnalyzeIamPolicyResponse analyzeIamPolicy(AnalyzeIamPolicyRequest r * AnalyzeIamPolicyRequest request = * AnalyzeIamPolicyRequest.newBuilder() * .setAnalysisQuery(IamPolicyAnalysisQuery.newBuilder().build()) + * .setSavedAnalysisQuery("savedAnalysisQuery376058885") * .setExecutionTimeout(Duration.newBuilder().build()) * .build(); * ApiFuture future = @@ -1555,6 +1926,7 @@ public final AnalyzeIamPolicyResponse analyzeIamPolicy(AnalyzeIamPolicyRequest r * AnalyzeIamPolicyLongrunningRequest request = * AnalyzeIamPolicyLongrunningRequest.newBuilder() * .setAnalysisQuery(IamPolicyAnalysisQuery.newBuilder().build()) + * .setSavedAnalysisQuery("savedAnalysisQuery376058885") * .setOutputConfig(IamPolicyAnalysisOutputConfig.newBuilder().build()) * .build(); * AnalyzeIamPolicyLongrunningResponse response = @@ -1594,6 +1966,7 @@ public final AnalyzeIamPolicyResponse analyzeIamPolicy(AnalyzeIamPolicyRequest r * AnalyzeIamPolicyLongrunningRequest request = * AnalyzeIamPolicyLongrunningRequest.newBuilder() * .setAnalysisQuery(IamPolicyAnalysisQuery.newBuilder().build()) + * .setSavedAnalysisQuery("savedAnalysisQuery376058885") * .setOutputConfig(IamPolicyAnalysisOutputConfig.newBuilder().build()) * .build(); * OperationFuture @@ -1635,6 +2008,7 @@ public final AnalyzeIamPolicyResponse analyzeIamPolicy(AnalyzeIamPolicyRequest r * AnalyzeIamPolicyLongrunningRequest request = * AnalyzeIamPolicyLongrunningRequest.newBuilder() * .setAnalysisQuery(IamPolicyAnalysisQuery.newBuilder().build()) + * .setSavedAnalysisQuery("savedAnalysisQuery376058885") * .setOutputConfig(IamPolicyAnalysisOutputConfig.newBuilder().build()) * .build(); * ApiFuture future = @@ -1713,63 +2087,1027 @@ public final UnaryCallable analyzeMoveC return stub.analyzeMoveCallable(); } - @Override - public final void close() { - stub.close(); + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Issue a job that queries assets using a SQL statement compatible with [BigQuery Standard + * SQL](http://cloud/bigquery/docs/reference/standard-sql/enabling-standard-sql). + * + *

        If the query execution finishes within timeout and there's no pagination, the full query + * results will be returned in the `QueryAssetsResponse`. + * + *

        Otherwise, full query results can be obtained by issuing extra requests with the + * `job_reference` from the a previous `QueryAssets` call. + * + *

        Note, the query result has approximately 10 GB limitation enforced by BigQuery + * https://cloud.google.com/bigquery/docs/best-practices-performance-output, queries return larger + * results will result in errors. + * + *

        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 (AssetServiceClient assetServiceClient = AssetServiceClient.create()) {
        +   *   QueryAssetsRequest request =
        +   *       QueryAssetsRequest.newBuilder()
        +   *           .setParent(FolderName.of("[FOLDER]").toString())
        +   *           .setPageSize(883849137)
        +   *           .setPageToken("pageToken873572522")
        +   *           .setTimeout(Duration.newBuilder().build())
        +   *           .setOutputConfig(QueryAssetsOutputConfig.newBuilder().build())
        +   *           .build();
        +   *   QueryAssetsResponse response = assetServiceClient.queryAssets(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 QueryAssetsResponse queryAssets(QueryAssetsRequest request) { + return queryAssetsCallable().call(request); } - @Override - public void shutdown() { - stub.shutdown(); + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Issue a job that queries assets using a SQL statement compatible with [BigQuery Standard + * SQL](http://cloud/bigquery/docs/reference/standard-sql/enabling-standard-sql). + * + *

        If the query execution finishes within timeout and there's no pagination, the full query + * results will be returned in the `QueryAssetsResponse`. + * + *

        Otherwise, full query results can be obtained by issuing extra requests with the + * `job_reference` from the a previous `QueryAssets` call. + * + *

        Note, the query result has approximately 10 GB limitation enforced by BigQuery + * https://cloud.google.com/bigquery/docs/best-practices-performance-output, queries return larger + * results will result in errors. + * + *

        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 (AssetServiceClient assetServiceClient = AssetServiceClient.create()) {
        +   *   QueryAssetsRequest request =
        +   *       QueryAssetsRequest.newBuilder()
        +   *           .setParent(FolderName.of("[FOLDER]").toString())
        +   *           .setPageSize(883849137)
        +   *           .setPageToken("pageToken873572522")
        +   *           .setTimeout(Duration.newBuilder().build())
        +   *           .setOutputConfig(QueryAssetsOutputConfig.newBuilder().build())
        +   *           .build();
        +   *   ApiFuture future =
        +   *       assetServiceClient.queryAssetsCallable().futureCall(request);
        +   *   // Do something.
        +   *   QueryAssetsResponse response = future.get();
        +   * }
        +   * }
        + */ + public final UnaryCallable queryAssetsCallable() { + return stub.queryAssetsCallable(); } - @Override - public boolean isShutdown() { - return stub.isShutdown(); + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a saved query in a parent project/folder/organization. + * + *

        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 (AssetServiceClient assetServiceClient = AssetServiceClient.create()) {
        +   *   FolderName parent = FolderName.of("[FOLDER]");
        +   *   SavedQuery savedQuery = SavedQuery.newBuilder().build();
        +   *   String savedQueryId = "savedQueryId378086268";
        +   *   SavedQuery response = assetServiceClient.createSavedQuery(parent, savedQuery, savedQueryId);
        +   * }
        +   * }
        + * + * @param parent Required. The name of the project/folder/organization where this saved_query + * should be created in. It can only be an organization number (such as "organizations/123"), + * a folder number (such as "folders/123"), a project ID (such as "projects/my-project-id")", + * or a project number (such as "projects/12345"). + * @param savedQuery Required. The saved_query details. The `name` field must be empty as it will + * be generated based on the parent and saved_query_id. + * @param savedQueryId Required. The ID to use for the saved query, which must be unique in the + * specified parent. It will become the final component of the saved query's resource name. + *

        This value should be 4-63 characters, and valid characters are /[a-z][0-9]-/. + *

        Notice that this field is required in the saved query creation, and the `name` field of + * the `saved_query` will be ignored. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final SavedQuery createSavedQuery( + FolderName parent, SavedQuery savedQuery, String savedQueryId) { + CreateSavedQueryRequest request = + CreateSavedQueryRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .setSavedQuery(savedQuery) + .setSavedQueryId(savedQueryId) + .build(); + return createSavedQuery(request); } - @Override - public boolean isTerminated() { - return stub.isTerminated(); + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a saved query in a parent project/folder/organization. + * + *

        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 (AssetServiceClient assetServiceClient = AssetServiceClient.create()) {
        +   *   OrganizationName parent = OrganizationName.of("[ORGANIZATION]");
        +   *   SavedQuery savedQuery = SavedQuery.newBuilder().build();
        +   *   String savedQueryId = "savedQueryId378086268";
        +   *   SavedQuery response = assetServiceClient.createSavedQuery(parent, savedQuery, savedQueryId);
        +   * }
        +   * }
        + * + * @param parent Required. The name of the project/folder/organization where this saved_query + * should be created in. It can only be an organization number (such as "organizations/123"), + * a folder number (such as "folders/123"), a project ID (such as "projects/my-project-id")", + * or a project number (such as "projects/12345"). + * @param savedQuery Required. The saved_query details. The `name` field must be empty as it will + * be generated based on the parent and saved_query_id. + * @param savedQueryId Required. The ID to use for the saved query, which must be unique in the + * specified parent. It will become the final component of the saved query's resource name. + *

        This value should be 4-63 characters, and valid characters are /[a-z][0-9]-/. + *

        Notice that this field is required in the saved query creation, and the `name` field of + * the `saved_query` will be ignored. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final SavedQuery createSavedQuery( + OrganizationName parent, SavedQuery savedQuery, String savedQueryId) { + CreateSavedQueryRequest request = + CreateSavedQueryRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .setSavedQuery(savedQuery) + .setSavedQueryId(savedQueryId) + .build(); + return createSavedQuery(request); } - @Override - public void shutdownNow() { - stub.shutdownNow(); + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a saved query in a parent project/folder/organization. + * + *

        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 (AssetServiceClient assetServiceClient = AssetServiceClient.create()) {
        +   *   ProjectName parent = ProjectName.of("[PROJECT]");
        +   *   SavedQuery savedQuery = SavedQuery.newBuilder().build();
        +   *   String savedQueryId = "savedQueryId378086268";
        +   *   SavedQuery response = assetServiceClient.createSavedQuery(parent, savedQuery, savedQueryId);
        +   * }
        +   * }
        + * + * @param parent Required. The name of the project/folder/organization where this saved_query + * should be created in. It can only be an organization number (such as "organizations/123"), + * a folder number (such as "folders/123"), a project ID (such as "projects/my-project-id")", + * or a project number (such as "projects/12345"). + * @param savedQuery Required. The saved_query details. The `name` field must be empty as it will + * be generated based on the parent and saved_query_id. + * @param savedQueryId Required. The ID to use for the saved query, which must be unique in the + * specified parent. It will become the final component of the saved query's resource name. + *

        This value should be 4-63 characters, and valid characters are /[a-z][0-9]-/. + *

        Notice that this field is required in the saved query creation, and the `name` field of + * the `saved_query` will be ignored. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final SavedQuery createSavedQuery( + ProjectName parent, SavedQuery savedQuery, String savedQueryId) { + CreateSavedQueryRequest request = + CreateSavedQueryRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .setSavedQuery(savedQuery) + .setSavedQueryId(savedQueryId) + .build(); + return createSavedQuery(request); } - @Override - public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { - return stub.awaitTermination(duration, unit); + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a saved query in a parent project/folder/organization. + * + *

        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 (AssetServiceClient assetServiceClient = AssetServiceClient.create()) {
        +   *   String parent = ProjectName.of("[PROJECT]").toString();
        +   *   SavedQuery savedQuery = SavedQuery.newBuilder().build();
        +   *   String savedQueryId = "savedQueryId378086268";
        +   *   SavedQuery response = assetServiceClient.createSavedQuery(parent, savedQuery, savedQueryId);
        +   * }
        +   * }
        + * + * @param parent Required. The name of the project/folder/organization where this saved_query + * should be created in. It can only be an organization number (such as "organizations/123"), + * a folder number (such as "folders/123"), a project ID (such as "projects/my-project-id")", + * or a project number (such as "projects/12345"). + * @param savedQuery Required. The saved_query details. The `name` field must be empty as it will + * be generated based on the parent and saved_query_id. + * @param savedQueryId Required. The ID to use for the saved query, which must be unique in the + * specified parent. It will become the final component of the saved query's resource name. + *

        This value should be 4-63 characters, and valid characters are /[a-z][0-9]-/. + *

        Notice that this field is required in the saved query creation, and the `name` field of + * the `saved_query` will be ignored. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final SavedQuery createSavedQuery( + String parent, SavedQuery savedQuery, String savedQueryId) { + CreateSavedQueryRequest request = + CreateSavedQueryRequest.newBuilder() + .setParent(parent) + .setSavedQuery(savedQuery) + .setSavedQueryId(savedQueryId) + .build(); + return createSavedQuery(request); } - public static class ListAssetsPagedResponse - extends AbstractPagedListResponse< - ListAssetsRequest, - ListAssetsResponse, - Asset, - ListAssetsPage, - ListAssetsFixedSizeCollection> { + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a saved query in a parent project/folder/organization. + * + *

        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 (AssetServiceClient assetServiceClient = AssetServiceClient.create()) {
        +   *   CreateSavedQueryRequest request =
        +   *       CreateSavedQueryRequest.newBuilder()
        +   *           .setParent(ProjectName.of("[PROJECT]").toString())
        +   *           .setSavedQuery(SavedQuery.newBuilder().build())
        +   *           .setSavedQueryId("savedQueryId378086268")
        +   *           .build();
        +   *   SavedQuery response = assetServiceClient.createSavedQuery(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 SavedQuery createSavedQuery(CreateSavedQueryRequest request) { + return createSavedQueryCallable().call(request); + } - public static ApiFuture createAsync( - PageContext context, - ApiFuture futureResponse) { - ApiFuture futurePage = - ListAssetsPage.createEmptyPage().createPageAsync(context, futureResponse); - return ApiFutures.transform( - futurePage, input -> new ListAssetsPagedResponse(input), MoreExecutors.directExecutor()); - } + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a saved query in a parent project/folder/organization. + * + *

        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 (AssetServiceClient assetServiceClient = AssetServiceClient.create()) {
        +   *   CreateSavedQueryRequest request =
        +   *       CreateSavedQueryRequest.newBuilder()
        +   *           .setParent(ProjectName.of("[PROJECT]").toString())
        +   *           .setSavedQuery(SavedQuery.newBuilder().build())
        +   *           .setSavedQueryId("savedQueryId378086268")
        +   *           .build();
        +   *   ApiFuture future =
        +   *       assetServiceClient.createSavedQueryCallable().futureCall(request);
        +   *   // Do something.
        +   *   SavedQuery response = future.get();
        +   * }
        +   * }
        + */ + public final UnaryCallable createSavedQueryCallable() { + return stub.createSavedQueryCallable(); + } - private ListAssetsPagedResponse(ListAssetsPage page) { - super(page, ListAssetsFixedSizeCollection.createEmptyCollection()); - } + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets details about a saved query. + * + *

        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 (AssetServiceClient assetServiceClient = AssetServiceClient.create()) {
        +   *   SavedQueryName name = SavedQueryName.ofProjectSavedQueryName("[PROJECT]", "[SAVED_QUERY]");
        +   *   SavedQuery response = assetServiceClient.getSavedQuery(name);
        +   * }
        +   * }
        + * + * @param name Required. The name of the saved query and it must be in the format of: + *
          + *
        • projects/project_number/savedQueries/saved_query_id + *
        • folders/folder_number/savedQueries/saved_query_id + *
        • organizations/organization_number/savedQueries/saved_query_id + *
        + * + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final SavedQuery getSavedQuery(SavedQueryName name) { + GetSavedQueryRequest request = + GetSavedQueryRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + return getSavedQuery(request); } - public static class ListAssetsPage - extends AbstractPage { + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets details about a saved query. + * + *

        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 (AssetServiceClient assetServiceClient = AssetServiceClient.create()) {
        +   *   String name = SavedQueryName.ofProjectSavedQueryName("[PROJECT]", "[SAVED_QUERY]").toString();
        +   *   SavedQuery response = assetServiceClient.getSavedQuery(name);
        +   * }
        +   * }
        + * + * @param name Required. The name of the saved query and it must be in the format of: + *
          + *
        • projects/project_number/savedQueries/saved_query_id + *
        • folders/folder_number/savedQueries/saved_query_id + *
        • organizations/organization_number/savedQueries/saved_query_id + *
        + * + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final SavedQuery getSavedQuery(String name) { + GetSavedQueryRequest request = GetSavedQueryRequest.newBuilder().setName(name).build(); + return getSavedQuery(request); + } - private ListAssetsPage( - PageContext context, + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets details about a saved query. + * + *

        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 (AssetServiceClient assetServiceClient = AssetServiceClient.create()) {
        +   *   GetSavedQueryRequest request =
        +   *       GetSavedQueryRequest.newBuilder()
        +   *           .setName(
        +   *               SavedQueryName.ofProjectSavedQueryName("[PROJECT]", "[SAVED_QUERY]").toString())
        +   *           .build();
        +   *   SavedQuery response = assetServiceClient.getSavedQuery(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 SavedQuery getSavedQuery(GetSavedQueryRequest request) { + return getSavedQueryCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets details about a saved query. + * + *

        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 (AssetServiceClient assetServiceClient = AssetServiceClient.create()) {
        +   *   GetSavedQueryRequest request =
        +   *       GetSavedQueryRequest.newBuilder()
        +   *           .setName(
        +   *               SavedQueryName.ofProjectSavedQueryName("[PROJECT]", "[SAVED_QUERY]").toString())
        +   *           .build();
        +   *   ApiFuture future = assetServiceClient.getSavedQueryCallable().futureCall(request);
        +   *   // Do something.
        +   *   SavedQuery response = future.get();
        +   * }
        +   * }
        + */ + public final UnaryCallable getSavedQueryCallable() { + return stub.getSavedQueryCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists all saved queries in a parent project/folder/organization. + * + *

        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 (AssetServiceClient assetServiceClient = AssetServiceClient.create()) {
        +   *   FolderName parent = FolderName.of("[FOLDER]");
        +   *   for (SavedQuery element : assetServiceClient.listSavedQueries(parent).iterateAll()) {
        +   *     // doThingsWith(element);
        +   *   }
        +   * }
        +   * }
        + * + * @param parent Required. The parent project/folder/organization whose savedQueries are to be + * listed. It can only be using project/folder/organization number (such as "folders/12345")", + * or a project ID (such as "projects/my-project-id"). + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListSavedQueriesPagedResponse listSavedQueries(FolderName parent) { + ListSavedQueriesRequest request = + ListSavedQueriesRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .build(); + return listSavedQueries(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists all saved queries in a parent project/folder/organization. + * + *

        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 (AssetServiceClient assetServiceClient = AssetServiceClient.create()) {
        +   *   OrganizationName parent = OrganizationName.of("[ORGANIZATION]");
        +   *   for (SavedQuery element : assetServiceClient.listSavedQueries(parent).iterateAll()) {
        +   *     // doThingsWith(element);
        +   *   }
        +   * }
        +   * }
        + * + * @param parent Required. The parent project/folder/organization whose savedQueries are to be + * listed. It can only be using project/folder/organization number (such as "folders/12345")", + * or a project ID (such as "projects/my-project-id"). + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListSavedQueriesPagedResponse listSavedQueries(OrganizationName parent) { + ListSavedQueriesRequest request = + ListSavedQueriesRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .build(); + return listSavedQueries(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists all saved queries in a parent project/folder/organization. + * + *

        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 (AssetServiceClient assetServiceClient = AssetServiceClient.create()) {
        +   *   ProjectName parent = ProjectName.of("[PROJECT]");
        +   *   for (SavedQuery element : assetServiceClient.listSavedQueries(parent).iterateAll()) {
        +   *     // doThingsWith(element);
        +   *   }
        +   * }
        +   * }
        + * + * @param parent Required. The parent project/folder/organization whose savedQueries are to be + * listed. It can only be using project/folder/organization number (such as "folders/12345")", + * or a project ID (such as "projects/my-project-id"). + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListSavedQueriesPagedResponse listSavedQueries(ProjectName parent) { + ListSavedQueriesRequest request = + ListSavedQueriesRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .build(); + return listSavedQueries(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists all saved queries in a parent project/folder/organization. + * + *

        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 (AssetServiceClient assetServiceClient = AssetServiceClient.create()) {
        +   *   String parent = ProjectName.of("[PROJECT]").toString();
        +   *   for (SavedQuery element : assetServiceClient.listSavedQueries(parent).iterateAll()) {
        +   *     // doThingsWith(element);
        +   *   }
        +   * }
        +   * }
        + * + * @param parent Required. The parent project/folder/organization whose savedQueries are to be + * listed. It can only be using project/folder/organization number (such as "folders/12345")", + * or a project ID (such as "projects/my-project-id"). + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListSavedQueriesPagedResponse listSavedQueries(String parent) { + ListSavedQueriesRequest request = + ListSavedQueriesRequest.newBuilder().setParent(parent).build(); + return listSavedQueries(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists all saved queries in a parent project/folder/organization. + * + *

        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 (AssetServiceClient assetServiceClient = AssetServiceClient.create()) {
        +   *   ListSavedQueriesRequest request =
        +   *       ListSavedQueriesRequest.newBuilder()
        +   *           .setParent(ProjectName.of("[PROJECT]").toString())
        +   *           .setFilter("filter-1274492040")
        +   *           .setPageSize(883849137)
        +   *           .setPageToken("pageToken873572522")
        +   *           .build();
        +   *   for (SavedQuery element : assetServiceClient.listSavedQueries(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 ListSavedQueriesPagedResponse listSavedQueries(ListSavedQueriesRequest request) { + return listSavedQueriesPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists all saved queries in a parent project/folder/organization. + * + *

        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 (AssetServiceClient assetServiceClient = AssetServiceClient.create()) {
        +   *   ListSavedQueriesRequest request =
        +   *       ListSavedQueriesRequest.newBuilder()
        +   *           .setParent(ProjectName.of("[PROJECT]").toString())
        +   *           .setFilter("filter-1274492040")
        +   *           .setPageSize(883849137)
        +   *           .setPageToken("pageToken873572522")
        +   *           .build();
        +   *   ApiFuture future =
        +   *       assetServiceClient.listSavedQueriesPagedCallable().futureCall(request);
        +   *   // Do something.
        +   *   for (SavedQuery element : future.get().iterateAll()) {
        +   *     // doThingsWith(element);
        +   *   }
        +   * }
        +   * }
        + */ + public final UnaryCallable + listSavedQueriesPagedCallable() { + return stub.listSavedQueriesPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists all saved queries in a parent project/folder/organization. + * + *

        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 (AssetServiceClient assetServiceClient = AssetServiceClient.create()) {
        +   *   ListSavedQueriesRequest request =
        +   *       ListSavedQueriesRequest.newBuilder()
        +   *           .setParent(ProjectName.of("[PROJECT]").toString())
        +   *           .setFilter("filter-1274492040")
        +   *           .setPageSize(883849137)
        +   *           .setPageToken("pageToken873572522")
        +   *           .build();
        +   *   while (true) {
        +   *     ListSavedQueriesResponse response =
        +   *         assetServiceClient.listSavedQueriesCallable().call(request);
        +   *     for (SavedQuery element : response.getSavedQueriesList()) {
        +   *       // doThingsWith(element);
        +   *     }
        +   *     String nextPageToken = response.getNextPageToken();
        +   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
        +   *       request = request.toBuilder().setPageToken(nextPageToken).build();
        +   *     } else {
        +   *       break;
        +   *     }
        +   *   }
        +   * }
        +   * }
        + */ + public final UnaryCallable + listSavedQueriesCallable() { + return stub.listSavedQueriesCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates a saved query. + * + *

        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 (AssetServiceClient assetServiceClient = AssetServiceClient.create()) {
        +   *   SavedQuery savedQuery = SavedQuery.newBuilder().build();
        +   *   FieldMask updateMask = FieldMask.newBuilder().build();
        +   *   SavedQuery response = assetServiceClient.updateSavedQuery(savedQuery, updateMask);
        +   * }
        +   * }
        + * + * @param savedQuery Required. The saved query to update. + *

        The saved query's `name` field is used to identify the one to update, which has format + * as below: + *

          + *
        • projects/project_number/savedQueries/saved_query_id + *
        • folders/folder_number/savedQueries/saved_query_id + *
        • organizations/organization_number/savedQueries/saved_query_id + *
        + * + * @param updateMask Required. The list of fields to update. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final SavedQuery updateSavedQuery(SavedQuery savedQuery, FieldMask updateMask) { + UpdateSavedQueryRequest request = + UpdateSavedQueryRequest.newBuilder() + .setSavedQuery(savedQuery) + .setUpdateMask(updateMask) + .build(); + return updateSavedQuery(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates a saved query. + * + *

        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 (AssetServiceClient assetServiceClient = AssetServiceClient.create()) {
        +   *   UpdateSavedQueryRequest request =
        +   *       UpdateSavedQueryRequest.newBuilder()
        +   *           .setSavedQuery(SavedQuery.newBuilder().build())
        +   *           .setUpdateMask(FieldMask.newBuilder().build())
        +   *           .build();
        +   *   SavedQuery response = assetServiceClient.updateSavedQuery(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 SavedQuery updateSavedQuery(UpdateSavedQueryRequest request) { + return updateSavedQueryCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates a saved query. + * + *

        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 (AssetServiceClient assetServiceClient = AssetServiceClient.create()) {
        +   *   UpdateSavedQueryRequest request =
        +   *       UpdateSavedQueryRequest.newBuilder()
        +   *           .setSavedQuery(SavedQuery.newBuilder().build())
        +   *           .setUpdateMask(FieldMask.newBuilder().build())
        +   *           .build();
        +   *   ApiFuture future =
        +   *       assetServiceClient.updateSavedQueryCallable().futureCall(request);
        +   *   // Do something.
        +   *   SavedQuery response = future.get();
        +   * }
        +   * }
        + */ + public final UnaryCallable updateSavedQueryCallable() { + return stub.updateSavedQueryCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a saved query. + * + *

        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 (AssetServiceClient assetServiceClient = AssetServiceClient.create()) {
        +   *   SavedQueryName name = SavedQueryName.ofProjectSavedQueryName("[PROJECT]", "[SAVED_QUERY]");
        +   *   assetServiceClient.deleteSavedQuery(name);
        +   * }
        +   * }
        + * + * @param name Required. The name of the saved query to delete. It must be in the format of: + *
          + *
        • projects/project_number/savedQueries/saved_query_id + *
        • folders/folder_number/savedQueries/saved_query_id + *
        • organizations/organization_number/savedQueries/saved_query_id + *
        + * + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final void deleteSavedQuery(SavedQueryName name) { + DeleteSavedQueryRequest request = + DeleteSavedQueryRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + deleteSavedQuery(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a saved query. + * + *

        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 (AssetServiceClient assetServiceClient = AssetServiceClient.create()) {
        +   *   String name = SavedQueryName.ofProjectSavedQueryName("[PROJECT]", "[SAVED_QUERY]").toString();
        +   *   assetServiceClient.deleteSavedQuery(name);
        +   * }
        +   * }
        + * + * @param name Required. The name of the saved query to delete. It must be in the format of: + *
          + *
        • projects/project_number/savedQueries/saved_query_id + *
        • folders/folder_number/savedQueries/saved_query_id + *
        • organizations/organization_number/savedQueries/saved_query_id + *
        + * + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final void deleteSavedQuery(String name) { + DeleteSavedQueryRequest request = DeleteSavedQueryRequest.newBuilder().setName(name).build(); + deleteSavedQuery(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a saved query. + * + *

        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 (AssetServiceClient assetServiceClient = AssetServiceClient.create()) {
        +   *   DeleteSavedQueryRequest request =
        +   *       DeleteSavedQueryRequest.newBuilder()
        +   *           .setName(
        +   *               SavedQueryName.ofProjectSavedQueryName("[PROJECT]", "[SAVED_QUERY]").toString())
        +   *           .build();
        +   *   assetServiceClient.deleteSavedQuery(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 deleteSavedQuery(DeleteSavedQueryRequest request) { + deleteSavedQueryCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a saved query. + * + *

        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 (AssetServiceClient assetServiceClient = AssetServiceClient.create()) {
        +   *   DeleteSavedQueryRequest request =
        +   *       DeleteSavedQueryRequest.newBuilder()
        +   *           .setName(
        +   *               SavedQueryName.ofProjectSavedQueryName("[PROJECT]", "[SAVED_QUERY]").toString())
        +   *           .build();
        +   *   ApiFuture future = assetServiceClient.deleteSavedQueryCallable().futureCall(request);
        +   *   // Do something.
        +   *   future.get();
        +   * }
        +   * }
        + */ + public final UnaryCallable deleteSavedQueryCallable() { + return stub.deleteSavedQueryCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets effective IAM policies for a batch of resources. + * + *

        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 (AssetServiceClient assetServiceClient = AssetServiceClient.create()) {
        +   *   BatchGetEffectiveIamPoliciesRequest request =
        +   *       BatchGetEffectiveIamPoliciesRequest.newBuilder()
        +   *           .setScope(FolderName.of("[FOLDER]").toString())
        +   *           .addAllNames(new ArrayList())
        +   *           .build();
        +   *   BatchGetEffectiveIamPoliciesResponse response =
        +   *       assetServiceClient.batchGetEffectiveIamPolicies(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 BatchGetEffectiveIamPoliciesResponse batchGetEffectiveIamPolicies( + BatchGetEffectiveIamPoliciesRequest request) { + return batchGetEffectiveIamPoliciesCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets effective IAM policies for a batch of resources. + * + *

        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 (AssetServiceClient assetServiceClient = AssetServiceClient.create()) {
        +   *   BatchGetEffectiveIamPoliciesRequest request =
        +   *       BatchGetEffectiveIamPoliciesRequest.newBuilder()
        +   *           .setScope(FolderName.of("[FOLDER]").toString())
        +   *           .addAllNames(new ArrayList())
        +   *           .build();
        +   *   ApiFuture future =
        +   *       assetServiceClient.batchGetEffectiveIamPoliciesCallable().futureCall(request);
        +   *   // Do something.
        +   *   BatchGetEffectiveIamPoliciesResponse response = future.get();
        +   * }
        +   * }
        + */ + public final UnaryCallable< + BatchGetEffectiveIamPoliciesRequest, BatchGetEffectiveIamPoliciesResponse> + batchGetEffectiveIamPoliciesCallable() { + return stub.batchGetEffectiveIamPoliciesCallable(); + } + + @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 ListAssetsPagedResponse + extends AbstractPagedListResponse< + ListAssetsRequest, + ListAssetsResponse, + Asset, + ListAssetsPage, + ListAssetsFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListAssetsPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, input -> new ListAssetsPagedResponse(input), MoreExecutors.directExecutor()); + } + + private ListAssetsPagedResponse(ListAssetsPage page) { + super(page, ListAssetsFixedSizeCollection.createEmptyCollection()); + } + } + + public static class ListAssetsPage + extends AbstractPage { + + private ListAssetsPage( + PageContext context, ListAssetsResponse response) { super(context, response); } @@ -1987,4 +3325,81 @@ protected SearchAllIamPoliciesFixedSizeCollection createCollection( return new SearchAllIamPoliciesFixedSizeCollection(pages, collectionSize); } } + + public static class ListSavedQueriesPagedResponse + extends AbstractPagedListResponse< + ListSavedQueriesRequest, + ListSavedQueriesResponse, + SavedQuery, + ListSavedQueriesPage, + ListSavedQueriesFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListSavedQueriesPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + input -> new ListSavedQueriesPagedResponse(input), + MoreExecutors.directExecutor()); + } + + private ListSavedQueriesPagedResponse(ListSavedQueriesPage page) { + super(page, ListSavedQueriesFixedSizeCollection.createEmptyCollection()); + } + } + + public static class ListSavedQueriesPage + extends AbstractPage< + ListSavedQueriesRequest, ListSavedQueriesResponse, SavedQuery, ListSavedQueriesPage> { + + private ListSavedQueriesPage( + PageContext context, + ListSavedQueriesResponse response) { + super(context, response); + } + + private static ListSavedQueriesPage createEmptyPage() { + return new ListSavedQueriesPage(null, null); + } + + @Override + protected ListSavedQueriesPage createPage( + PageContext context, + ListSavedQueriesResponse response) { + return new ListSavedQueriesPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class ListSavedQueriesFixedSizeCollection + extends AbstractFixedSizeCollection< + ListSavedQueriesRequest, + ListSavedQueriesResponse, + SavedQuery, + ListSavedQueriesPage, + ListSavedQueriesFixedSizeCollection> { + + private ListSavedQueriesFixedSizeCollection( + List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListSavedQueriesFixedSizeCollection createEmptyCollection() { + return new ListSavedQueriesFixedSizeCollection(null, 0); + } + + @Override + protected ListSavedQueriesFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListSavedQueriesFixedSizeCollection(pages, collectionSize); + } + } } diff --git a/test/integration/goldens/asset/src/com/google/cloud/asset/v1/AssetServiceClientHttpJsonTest.java b/test/integration/goldens/asset/src/com/google/cloud/asset/v1/AssetServiceClientHttpJsonTest.java new file mode 100644 index 0000000000..5f957206eb --- /dev/null +++ b/test/integration/goldens/asset/src/com/google/cloud/asset/v1/AssetServiceClientHttpJsonTest.java @@ -0,0 +1,1769 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS 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.asset.v1; + +import static com.google.cloud.asset.v1.AssetServiceClient.ListAssetsPagedResponse; +import static com.google.cloud.asset.v1.AssetServiceClient.ListSavedQueriesPagedResponse; +import static com.google.cloud.asset.v1.AssetServiceClient.SearchAllIamPoliciesPagedResponse; +import static com.google.cloud.asset.v1.AssetServiceClient.SearchAllResourcesPagedResponse; + +import com.google.api.gax.core.NoCredentialsProvider; +import com.google.api.gax.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.testing.MockHttpService; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ApiException; +import com.google.api.gax.rpc.ApiExceptionFactory; +import com.google.api.gax.rpc.InvalidArgumentException; +import com.google.api.gax.rpc.StatusCode; +import com.google.api.gax.rpc.testing.FakeStatusCode; +import com.google.api.resourcenames.ResourceName; +import com.google.cloud.asset.v1.stub.HttpJsonAssetServiceStub; +import com.google.common.collect.Lists; +import com.google.longrunning.Operation; +import com.google.protobuf.Any; +import com.google.protobuf.Duration; +import com.google.protobuf.Empty; +import com.google.protobuf.FieldMask; +import com.google.protobuf.Timestamp; +import com.google.type.Expr; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +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 AssetServiceClientHttpJsonTest { + private static MockHttpService mockService; + private static AssetServiceClient client; + + @BeforeClass + public static void startStaticServer() throws IOException { + mockService = + new MockHttpService( + HttpJsonAssetServiceStub.getMethodDescriptors(), + AssetServiceSettings.getDefaultEndpoint()); + AssetServiceSettings settings = + AssetServiceSettings.newHttpJsonBuilder() + .setTransportChannelProvider( + AssetServiceSettings.defaultHttpJsonTransportProviderBuilder() + .setHttpTransport(mockService) + .build()) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = AssetServiceClient.create(settings); + } + + @AfterClass + public static void stopServer() { + client.close(); + } + + @Before + public void setUp() {} + + @After + public void tearDown() throws Exception { + mockService.reset(); + } + + @Test + public void exportAssetsTest() throws Exception { + ExportAssetsResponse expectedResponse = + ExportAssetsResponse.newBuilder() + .setReadTime(Timestamp.newBuilder().build()) + .setOutputConfig(OutputConfig.newBuilder().build()) + .setOutputResult(OutputResult.newBuilder().build()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("exportAssetsTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockService.addResponse(resultOperation); + + ExportAssetsRequest request = + ExportAssetsRequest.newBuilder() + .setParent(FolderName.of("[FOLDER]").toString()) + .setReadTime(Timestamp.newBuilder().build()) + .addAllAssetTypes(new ArrayList()) + .setContentType(ContentType.forNumber(0)) + .setOutputConfig(OutputConfig.newBuilder().build()) + .addAllRelationshipTypes(new ArrayList()) + .build(); + + ExportAssetsResponse actualResponse = client.exportAssetsAsync(request).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void exportAssetsExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ExportAssetsRequest request = + ExportAssetsRequest.newBuilder() + .setParent(FolderName.of("[FOLDER]").toString()) + .setReadTime(Timestamp.newBuilder().build()) + .addAllAssetTypes(new ArrayList()) + .setContentType(ContentType.forNumber(0)) + .setOutputConfig(OutputConfig.newBuilder().build()) + .addAllRelationshipTypes(new ArrayList()) + .build(); + client.exportAssetsAsync(request).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + } + } + + @Test + public void listAssetsTest() throws Exception { + Asset responsesElement = Asset.newBuilder().build(); + ListAssetsResponse expectedResponse = + ListAssetsResponse.newBuilder() + .setNextPageToken("") + .addAllAssets(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + ResourceName parent = FolderName.of("[FOLDER]"); + + ListAssetsPagedResponse pagedListResponse = client.listAssets(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getAssetsList().get(0), resources.get(0)); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void listAssetsExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ResourceName parent = FolderName.of("[FOLDER]"); + client.listAssets(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listAssetsTest2() throws Exception { + Asset responsesElement = Asset.newBuilder().build(); + ListAssetsResponse expectedResponse = + ListAssetsResponse.newBuilder() + .setNextPageToken("") + .addAllAssets(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + String parent = "parent-4715/parent-4715"; + + ListAssetsPagedResponse pagedListResponse = client.listAssets(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getAssetsList().get(0), resources.get(0)); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void listAssetsExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String parent = "parent-4715/parent-4715"; + client.listAssets(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void batchGetAssetsHistoryTest() throws Exception { + BatchGetAssetsHistoryResponse expectedResponse = + BatchGetAssetsHistoryResponse.newBuilder() + .addAllAssets(new ArrayList()) + .build(); + mockService.addResponse(expectedResponse); + + BatchGetAssetsHistoryRequest request = + BatchGetAssetsHistoryRequest.newBuilder() + .setParent(FolderName.of("[FOLDER]").toString()) + .addAllAssetNames(new ArrayList()) + .setContentType(ContentType.forNumber(0)) + .setReadTimeWindow(TimeWindow.newBuilder().build()) + .addAllRelationshipTypes(new ArrayList()) + .build(); + + BatchGetAssetsHistoryResponse actualResponse = client.batchGetAssetsHistory(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void batchGetAssetsHistoryExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + BatchGetAssetsHistoryRequest request = + BatchGetAssetsHistoryRequest.newBuilder() + .setParent(FolderName.of("[FOLDER]").toString()) + .addAllAssetNames(new ArrayList()) + .setContentType(ContentType.forNumber(0)) + .setReadTimeWindow(TimeWindow.newBuilder().build()) + .addAllRelationshipTypes(new ArrayList()) + .build(); + client.batchGetAssetsHistory(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createFeedTest() throws Exception { + Feed expectedResponse = + Feed.newBuilder() + .setName(FeedName.ofProjectFeedName("[PROJECT]", "[FEED]").toString()) + .addAllAssetNames(new ArrayList()) + .addAllAssetTypes(new ArrayList()) + .setContentType(ContentType.forNumber(0)) + .setFeedOutputConfig(FeedOutputConfig.newBuilder().build()) + .setCondition(Expr.newBuilder().build()) + .addAllRelationshipTypes(new ArrayList()) + .build(); + mockService.addResponse(expectedResponse); + + String parent = "parent-4715/parent-4715"; + + Feed actualResponse = client.createFeed(parent); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void createFeedExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String parent = "parent-4715/parent-4715"; + client.createFeed(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getFeedTest() throws Exception { + Feed expectedResponse = + Feed.newBuilder() + .setName(FeedName.ofProjectFeedName("[PROJECT]", "[FEED]").toString()) + .addAllAssetNames(new ArrayList()) + .addAllAssetTypes(new ArrayList()) + .setContentType(ContentType.forNumber(0)) + .setFeedOutputConfig(FeedOutputConfig.newBuilder().build()) + .setCondition(Expr.newBuilder().build()) + .addAllRelationshipTypes(new ArrayList()) + .build(); + mockService.addResponse(expectedResponse); + + FeedName name = FeedName.ofProjectFeedName("[PROJECT]", "[FEED]"); + + Feed actualResponse = client.getFeed(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void getFeedExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + FeedName name = FeedName.ofProjectFeedName("[PROJECT]", "[FEED]"); + client.getFeed(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getFeedTest2() throws Exception { + Feed expectedResponse = + Feed.newBuilder() + .setName(FeedName.ofProjectFeedName("[PROJECT]", "[FEED]").toString()) + .addAllAssetNames(new ArrayList()) + .addAllAssetTypes(new ArrayList()) + .setContentType(ContentType.forNumber(0)) + .setFeedOutputConfig(FeedOutputConfig.newBuilder().build()) + .setCondition(Expr.newBuilder().build()) + .addAllRelationshipTypes(new ArrayList()) + .build(); + mockService.addResponse(expectedResponse); + + String name = "name-2459/name-2459/feeds/feed-2459"; + + Feed actualResponse = client.getFeed(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void getFeedExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String name = "name-2459/name-2459/feeds/feed-2459"; + client.getFeed(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listFeedsTest() throws Exception { + ListFeedsResponse expectedResponse = + ListFeedsResponse.newBuilder().addAllFeeds(new ArrayList()).build(); + mockService.addResponse(expectedResponse); + + String parent = "parent-4715/parent-4715"; + + ListFeedsResponse actualResponse = client.listFeeds(parent); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void listFeedsExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String parent = "parent-4715/parent-4715"; + client.listFeeds(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void updateFeedTest() throws Exception { + Feed expectedResponse = + Feed.newBuilder() + .setName(FeedName.ofProjectFeedName("[PROJECT]", "[FEED]").toString()) + .addAllAssetNames(new ArrayList()) + .addAllAssetTypes(new ArrayList()) + .setContentType(ContentType.forNumber(0)) + .setFeedOutputConfig(FeedOutputConfig.newBuilder().build()) + .setCondition(Expr.newBuilder().build()) + .addAllRelationshipTypes(new ArrayList()) + .build(); + mockService.addResponse(expectedResponse); + + Feed feed = + Feed.newBuilder() + .setName(FeedName.ofProjectFeedName("[PROJECT]", "[FEED]").toString()) + .addAllAssetNames(new ArrayList()) + .addAllAssetTypes(new ArrayList()) + .setContentType(ContentType.forNumber(0)) + .setFeedOutputConfig(FeedOutputConfig.newBuilder().build()) + .setCondition(Expr.newBuilder().build()) + .addAllRelationshipTypes(new ArrayList()) + .build(); + + Feed actualResponse = client.updateFeed(feed); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void updateFeedExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + Feed feed = + Feed.newBuilder() + .setName(FeedName.ofProjectFeedName("[PROJECT]", "[FEED]").toString()) + .addAllAssetNames(new ArrayList()) + .addAllAssetTypes(new ArrayList()) + .setContentType(ContentType.forNumber(0)) + .setFeedOutputConfig(FeedOutputConfig.newBuilder().build()) + .setCondition(Expr.newBuilder().build()) + .addAllRelationshipTypes(new ArrayList()) + .build(); + client.updateFeed(feed); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void deleteFeedTest() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockService.addResponse(expectedResponse); + + FeedName name = FeedName.ofProjectFeedName("[PROJECT]", "[FEED]"); + + client.deleteFeed(name); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void deleteFeedExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + FeedName name = FeedName.ofProjectFeedName("[PROJECT]", "[FEED]"); + client.deleteFeed(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void deleteFeedTest2() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockService.addResponse(expectedResponse); + + String name = "name-2459/name-2459/feeds/feed-2459"; + + client.deleteFeed(name); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void deleteFeedExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String name = "name-2459/name-2459/feeds/feed-2459"; + client.deleteFeed(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void searchAllResourcesTest() throws Exception { + ResourceSearchResult responsesElement = ResourceSearchResult.newBuilder().build(); + SearchAllResourcesResponse expectedResponse = + SearchAllResourcesResponse.newBuilder() + .setNextPageToken("") + .addAllResults(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + String scope = "scope-2319/scope-2319"; + String query = "query107944136"; + List assetTypes = new ArrayList<>(); + + SearchAllResourcesPagedResponse pagedListResponse = + client.searchAllResources(scope, query, assetTypes); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getResultsList().get(0), resources.get(0)); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void searchAllResourcesExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String scope = "scope-2319/scope-2319"; + String query = "query107944136"; + List assetTypes = new ArrayList<>(); + client.searchAllResources(scope, query, assetTypes); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void searchAllIamPoliciesTest() throws Exception { + IamPolicySearchResult responsesElement = IamPolicySearchResult.newBuilder().build(); + SearchAllIamPoliciesResponse expectedResponse = + SearchAllIamPoliciesResponse.newBuilder() + .setNextPageToken("") + .addAllResults(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + String scope = "scope-2319/scope-2319"; + String query = "query107944136"; + + SearchAllIamPoliciesPagedResponse pagedListResponse = client.searchAllIamPolicies(scope, query); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getResultsList().get(0), resources.get(0)); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void searchAllIamPoliciesExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String scope = "scope-2319/scope-2319"; + String query = "query107944136"; + client.searchAllIamPolicies(scope, query); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void analyzeIamPolicyTest() throws Exception { + AnalyzeIamPolicyResponse expectedResponse = + AnalyzeIamPolicyResponse.newBuilder() + .setMainAnalysis(AnalyzeIamPolicyResponse.IamPolicyAnalysis.newBuilder().build()) + .addAllServiceAccountImpersonationAnalysis( + new ArrayList()) + .setFullyExplored(true) + .build(); + mockService.addResponse(expectedResponse); + + AnalyzeIamPolicyRequest request = + AnalyzeIamPolicyRequest.newBuilder() + .setAnalysisQuery( + IamPolicyAnalysisQuery.newBuilder() + .setScope("scope-2319/scope-2319") + .setResourceSelector( + IamPolicyAnalysisQuery.ResourceSelector.newBuilder().build()) + .setIdentitySelector( + IamPolicyAnalysisQuery.IdentitySelector.newBuilder().build()) + .setAccessSelector(IamPolicyAnalysisQuery.AccessSelector.newBuilder().build()) + .setOptions(IamPolicyAnalysisQuery.Options.newBuilder().build()) + .setConditionContext( + IamPolicyAnalysisQuery.ConditionContext.newBuilder().build()) + .build()) + .setSavedAnalysisQuery("savedAnalysisQuery376058885") + .setExecutionTimeout(Duration.newBuilder().build()) + .build(); + + AnalyzeIamPolicyResponse actualResponse = client.analyzeIamPolicy(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void analyzeIamPolicyExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + AnalyzeIamPolicyRequest request = + AnalyzeIamPolicyRequest.newBuilder() + .setAnalysisQuery( + IamPolicyAnalysisQuery.newBuilder() + .setScope("scope-2319/scope-2319") + .setResourceSelector( + IamPolicyAnalysisQuery.ResourceSelector.newBuilder().build()) + .setIdentitySelector( + IamPolicyAnalysisQuery.IdentitySelector.newBuilder().build()) + .setAccessSelector(IamPolicyAnalysisQuery.AccessSelector.newBuilder().build()) + .setOptions(IamPolicyAnalysisQuery.Options.newBuilder().build()) + .setConditionContext( + IamPolicyAnalysisQuery.ConditionContext.newBuilder().build()) + .build()) + .setSavedAnalysisQuery("savedAnalysisQuery376058885") + .setExecutionTimeout(Duration.newBuilder().build()) + .build(); + client.analyzeIamPolicy(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void analyzeIamPolicyLongrunningTest() throws Exception { + AnalyzeIamPolicyLongrunningResponse expectedResponse = + AnalyzeIamPolicyLongrunningResponse.newBuilder().build(); + Operation resultOperation = + Operation.newBuilder() + .setName("analyzeIamPolicyLongrunningTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockService.addResponse(resultOperation); + + AnalyzeIamPolicyLongrunningRequest request = + AnalyzeIamPolicyLongrunningRequest.newBuilder() + .setAnalysisQuery( + IamPolicyAnalysisQuery.newBuilder() + .setScope("scope-2319/scope-2319") + .setResourceSelector( + IamPolicyAnalysisQuery.ResourceSelector.newBuilder().build()) + .setIdentitySelector( + IamPolicyAnalysisQuery.IdentitySelector.newBuilder().build()) + .setAccessSelector(IamPolicyAnalysisQuery.AccessSelector.newBuilder().build()) + .setOptions(IamPolicyAnalysisQuery.Options.newBuilder().build()) + .setConditionContext( + IamPolicyAnalysisQuery.ConditionContext.newBuilder().build()) + .build()) + .setSavedAnalysisQuery("savedAnalysisQuery376058885") + .setOutputConfig(IamPolicyAnalysisOutputConfig.newBuilder().build()) + .build(); + + AnalyzeIamPolicyLongrunningResponse actualResponse = + client.analyzeIamPolicyLongrunningAsync(request).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void analyzeIamPolicyLongrunningExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + AnalyzeIamPolicyLongrunningRequest request = + AnalyzeIamPolicyLongrunningRequest.newBuilder() + .setAnalysisQuery( + IamPolicyAnalysisQuery.newBuilder() + .setScope("scope-2319/scope-2319") + .setResourceSelector( + IamPolicyAnalysisQuery.ResourceSelector.newBuilder().build()) + .setIdentitySelector( + IamPolicyAnalysisQuery.IdentitySelector.newBuilder().build()) + .setAccessSelector(IamPolicyAnalysisQuery.AccessSelector.newBuilder().build()) + .setOptions(IamPolicyAnalysisQuery.Options.newBuilder().build()) + .setConditionContext( + IamPolicyAnalysisQuery.ConditionContext.newBuilder().build()) + .build()) + .setSavedAnalysisQuery("savedAnalysisQuery376058885") + .setOutputConfig(IamPolicyAnalysisOutputConfig.newBuilder().build()) + .build(); + client.analyzeIamPolicyLongrunningAsync(request).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + } + } + + @Test + public void analyzeMoveTest() throws Exception { + AnalyzeMoveResponse expectedResponse = + AnalyzeMoveResponse.newBuilder().addAllMoveAnalysis(new ArrayList()).build(); + mockService.addResponse(expectedResponse); + + AnalyzeMoveRequest request = + AnalyzeMoveRequest.newBuilder() + .setResource("resource-4407/resource-4407") + .setDestinationParent("destinationParent-1733659048") + .build(); + + AnalyzeMoveResponse actualResponse = client.analyzeMove(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void analyzeMoveExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + AnalyzeMoveRequest request = + AnalyzeMoveRequest.newBuilder() + .setResource("resource-4407/resource-4407") + .setDestinationParent("destinationParent-1733659048") + .build(); + client.analyzeMove(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void queryAssetsTest() throws Exception { + QueryAssetsResponse expectedResponse = + QueryAssetsResponse.newBuilder() + .setJobReference("jobReference-2094880754") + .setDone(true) + .build(); + mockService.addResponse(expectedResponse); + + QueryAssetsRequest request = + QueryAssetsRequest.newBuilder() + .setParent(FolderName.of("[FOLDER]").toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .setTimeout(Duration.newBuilder().build()) + .setOutputConfig(QueryAssetsOutputConfig.newBuilder().build()) + .build(); + + QueryAssetsResponse actualResponse = client.queryAssets(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void queryAssetsExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + QueryAssetsRequest request = + QueryAssetsRequest.newBuilder() + .setParent(FolderName.of("[FOLDER]").toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .setTimeout(Duration.newBuilder().build()) + .setOutputConfig(QueryAssetsOutputConfig.newBuilder().build()) + .build(); + client.queryAssets(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createSavedQueryTest() throws Exception { + SavedQuery expectedResponse = + SavedQuery.newBuilder() + .setName( + SavedQueryName.ofProjectSavedQueryName("[PROJECT]", "[SAVED_QUERY]").toString()) + .setDescription("description-1724546052") + .setCreateTime(Timestamp.newBuilder().build()) + .setCreator("creator1028554796") + .setLastUpdateTime(Timestamp.newBuilder().build()) + .setLastUpdater("lastUpdater1649733971") + .putAllLabels(new HashMap()) + .setContent(SavedQuery.QueryContent.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + FolderName parent = FolderName.of("[FOLDER]"); + SavedQuery savedQuery = SavedQuery.newBuilder().build(); + String savedQueryId = "savedQueryId378086268"; + + SavedQuery actualResponse = client.createSavedQuery(parent, savedQuery, savedQueryId); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void createSavedQueryExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + FolderName parent = FolderName.of("[FOLDER]"); + SavedQuery savedQuery = SavedQuery.newBuilder().build(); + String savedQueryId = "savedQueryId378086268"; + client.createSavedQuery(parent, savedQuery, savedQueryId); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createSavedQueryTest2() throws Exception { + SavedQuery expectedResponse = + SavedQuery.newBuilder() + .setName( + SavedQueryName.ofProjectSavedQueryName("[PROJECT]", "[SAVED_QUERY]").toString()) + .setDescription("description-1724546052") + .setCreateTime(Timestamp.newBuilder().build()) + .setCreator("creator1028554796") + .setLastUpdateTime(Timestamp.newBuilder().build()) + .setLastUpdater("lastUpdater1649733971") + .putAllLabels(new HashMap()) + .setContent(SavedQuery.QueryContent.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + OrganizationName parent = OrganizationName.of("[ORGANIZATION]"); + SavedQuery savedQuery = SavedQuery.newBuilder().build(); + String savedQueryId = "savedQueryId378086268"; + + SavedQuery actualResponse = client.createSavedQuery(parent, savedQuery, savedQueryId); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void createSavedQueryExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + OrganizationName parent = OrganizationName.of("[ORGANIZATION]"); + SavedQuery savedQuery = SavedQuery.newBuilder().build(); + String savedQueryId = "savedQueryId378086268"; + client.createSavedQuery(parent, savedQuery, savedQueryId); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createSavedQueryTest3() throws Exception { + SavedQuery expectedResponse = + SavedQuery.newBuilder() + .setName( + SavedQueryName.ofProjectSavedQueryName("[PROJECT]", "[SAVED_QUERY]").toString()) + .setDescription("description-1724546052") + .setCreateTime(Timestamp.newBuilder().build()) + .setCreator("creator1028554796") + .setLastUpdateTime(Timestamp.newBuilder().build()) + .setLastUpdater("lastUpdater1649733971") + .putAllLabels(new HashMap()) + .setContent(SavedQuery.QueryContent.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + ProjectName parent = ProjectName.of("[PROJECT]"); + SavedQuery savedQuery = SavedQuery.newBuilder().build(); + String savedQueryId = "savedQueryId378086268"; + + SavedQuery actualResponse = client.createSavedQuery(parent, savedQuery, savedQueryId); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void createSavedQueryExceptionTest3() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ProjectName parent = ProjectName.of("[PROJECT]"); + SavedQuery savedQuery = SavedQuery.newBuilder().build(); + String savedQueryId = "savedQueryId378086268"; + client.createSavedQuery(parent, savedQuery, savedQueryId); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createSavedQueryTest4() throws Exception { + SavedQuery expectedResponse = + SavedQuery.newBuilder() + .setName( + SavedQueryName.ofProjectSavedQueryName("[PROJECT]", "[SAVED_QUERY]").toString()) + .setDescription("description-1724546052") + .setCreateTime(Timestamp.newBuilder().build()) + .setCreator("creator1028554796") + .setLastUpdateTime(Timestamp.newBuilder().build()) + .setLastUpdater("lastUpdater1649733971") + .putAllLabels(new HashMap()) + .setContent(SavedQuery.QueryContent.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + String parent = "parent-4715/parent-4715"; + SavedQuery savedQuery = SavedQuery.newBuilder().build(); + String savedQueryId = "savedQueryId378086268"; + + SavedQuery actualResponse = client.createSavedQuery(parent, savedQuery, savedQueryId); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void createSavedQueryExceptionTest4() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String parent = "parent-4715/parent-4715"; + SavedQuery savedQuery = SavedQuery.newBuilder().build(); + String savedQueryId = "savedQueryId378086268"; + client.createSavedQuery(parent, savedQuery, savedQueryId); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getSavedQueryTest() throws Exception { + SavedQuery expectedResponse = + SavedQuery.newBuilder() + .setName( + SavedQueryName.ofProjectSavedQueryName("[PROJECT]", "[SAVED_QUERY]").toString()) + .setDescription("description-1724546052") + .setCreateTime(Timestamp.newBuilder().build()) + .setCreator("creator1028554796") + .setLastUpdateTime(Timestamp.newBuilder().build()) + .setLastUpdater("lastUpdater1649733971") + .putAllLabels(new HashMap()) + .setContent(SavedQuery.QueryContent.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + SavedQueryName name = SavedQueryName.ofProjectSavedQueryName("[PROJECT]", "[SAVED_QUERY]"); + + SavedQuery actualResponse = client.getSavedQuery(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void getSavedQueryExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + SavedQueryName name = SavedQueryName.ofProjectSavedQueryName("[PROJECT]", "[SAVED_QUERY]"); + client.getSavedQuery(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getSavedQueryTest2() throws Exception { + SavedQuery expectedResponse = + SavedQuery.newBuilder() + .setName( + SavedQueryName.ofProjectSavedQueryName("[PROJECT]", "[SAVED_QUERY]").toString()) + .setDescription("description-1724546052") + .setCreateTime(Timestamp.newBuilder().build()) + .setCreator("creator1028554796") + .setLastUpdateTime(Timestamp.newBuilder().build()) + .setLastUpdater("lastUpdater1649733971") + .putAllLabels(new HashMap()) + .setContent(SavedQuery.QueryContent.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + String name = "name-3263/name-3263/savedQueries/savedQuerie-3263"; + + SavedQuery actualResponse = client.getSavedQuery(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void getSavedQueryExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String name = "name-3263/name-3263/savedQueries/savedQuerie-3263"; + client.getSavedQuery(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listSavedQueriesTest() throws Exception { + SavedQuery responsesElement = SavedQuery.newBuilder().build(); + ListSavedQueriesResponse expectedResponse = + ListSavedQueriesResponse.newBuilder() + .setNextPageToken("") + .addAllSavedQueries(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + FolderName parent = FolderName.of("[FOLDER]"); + + ListSavedQueriesPagedResponse pagedListResponse = client.listSavedQueries(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getSavedQueriesList().get(0), resources.get(0)); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void listSavedQueriesExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + FolderName parent = FolderName.of("[FOLDER]"); + client.listSavedQueries(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listSavedQueriesTest2() throws Exception { + SavedQuery responsesElement = SavedQuery.newBuilder().build(); + ListSavedQueriesResponse expectedResponse = + ListSavedQueriesResponse.newBuilder() + .setNextPageToken("") + .addAllSavedQueries(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + OrganizationName parent = OrganizationName.of("[ORGANIZATION]"); + + ListSavedQueriesPagedResponse pagedListResponse = client.listSavedQueries(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getSavedQueriesList().get(0), resources.get(0)); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void listSavedQueriesExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + OrganizationName parent = OrganizationName.of("[ORGANIZATION]"); + client.listSavedQueries(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listSavedQueriesTest3() throws Exception { + SavedQuery responsesElement = SavedQuery.newBuilder().build(); + ListSavedQueriesResponse expectedResponse = + ListSavedQueriesResponse.newBuilder() + .setNextPageToken("") + .addAllSavedQueries(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + ProjectName parent = ProjectName.of("[PROJECT]"); + + ListSavedQueriesPagedResponse pagedListResponse = client.listSavedQueries(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getSavedQueriesList().get(0), resources.get(0)); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void listSavedQueriesExceptionTest3() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ProjectName parent = ProjectName.of("[PROJECT]"); + client.listSavedQueries(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listSavedQueriesTest4() throws Exception { + SavedQuery responsesElement = SavedQuery.newBuilder().build(); + ListSavedQueriesResponse expectedResponse = + ListSavedQueriesResponse.newBuilder() + .setNextPageToken("") + .addAllSavedQueries(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + String parent = "parent-4715/parent-4715"; + + ListSavedQueriesPagedResponse pagedListResponse = client.listSavedQueries(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getSavedQueriesList().get(0), resources.get(0)); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void listSavedQueriesExceptionTest4() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String parent = "parent-4715/parent-4715"; + client.listSavedQueries(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void updateSavedQueryTest() throws Exception { + SavedQuery expectedResponse = + SavedQuery.newBuilder() + .setName( + SavedQueryName.ofProjectSavedQueryName("[PROJECT]", "[SAVED_QUERY]").toString()) + .setDescription("description-1724546052") + .setCreateTime(Timestamp.newBuilder().build()) + .setCreator("creator1028554796") + .setLastUpdateTime(Timestamp.newBuilder().build()) + .setLastUpdater("lastUpdater1649733971") + .putAllLabels(new HashMap()) + .setContent(SavedQuery.QueryContent.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + SavedQuery savedQuery = + SavedQuery.newBuilder() + .setName( + SavedQueryName.ofProjectSavedQueryName("[PROJECT]", "[SAVED_QUERY]").toString()) + .setDescription("description-1724546052") + .setCreateTime(Timestamp.newBuilder().build()) + .setCreator("creator1028554796") + .setLastUpdateTime(Timestamp.newBuilder().build()) + .setLastUpdater("lastUpdater1649733971") + .putAllLabels(new HashMap()) + .setContent(SavedQuery.QueryContent.newBuilder().build()) + .build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + + SavedQuery actualResponse = client.updateSavedQuery(savedQuery, updateMask); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void updateSavedQueryExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + SavedQuery savedQuery = + SavedQuery.newBuilder() + .setName( + SavedQueryName.ofProjectSavedQueryName("[PROJECT]", "[SAVED_QUERY]").toString()) + .setDescription("description-1724546052") + .setCreateTime(Timestamp.newBuilder().build()) + .setCreator("creator1028554796") + .setLastUpdateTime(Timestamp.newBuilder().build()) + .setLastUpdater("lastUpdater1649733971") + .putAllLabels(new HashMap()) + .setContent(SavedQuery.QueryContent.newBuilder().build()) + .build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + client.updateSavedQuery(savedQuery, updateMask); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void deleteSavedQueryTest() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockService.addResponse(expectedResponse); + + SavedQueryName name = SavedQueryName.ofProjectSavedQueryName("[PROJECT]", "[SAVED_QUERY]"); + + client.deleteSavedQuery(name); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void deleteSavedQueryExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + SavedQueryName name = SavedQueryName.ofProjectSavedQueryName("[PROJECT]", "[SAVED_QUERY]"); + client.deleteSavedQuery(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void deleteSavedQueryTest2() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockService.addResponse(expectedResponse); + + String name = "name-3263/name-3263/savedQueries/savedQuerie-3263"; + + client.deleteSavedQuery(name); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void deleteSavedQueryExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String name = "name-3263/name-3263/savedQueries/savedQuerie-3263"; + client.deleteSavedQuery(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void batchGetEffectiveIamPoliciesTest() throws Exception { + BatchGetEffectiveIamPoliciesResponse expectedResponse = + BatchGetEffectiveIamPoliciesResponse.newBuilder() + .addAllPolicyResults( + new ArrayList()) + .build(); + mockService.addResponse(expectedResponse); + + BatchGetEffectiveIamPoliciesRequest request = + BatchGetEffectiveIamPoliciesRequest.newBuilder() + .setScope(FolderName.of("[FOLDER]").toString()) + .addAllNames(new ArrayList()) + .build(); + + BatchGetEffectiveIamPoliciesResponse actualResponse = + client.batchGetEffectiveIamPolicies(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void batchGetEffectiveIamPoliciesExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + BatchGetEffectiveIamPoliciesRequest request = + BatchGetEffectiveIamPoliciesRequest.newBuilder() + .setScope(FolderName.of("[FOLDER]").toString()) + .addAllNames(new ArrayList()) + .build(); + client.batchGetEffectiveIamPolicies(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } +} diff --git a/test/integration/goldens/asset/src/com/google/cloud/asset/v1/AssetServiceClientTest.java b/test/integration/goldens/asset/src/com/google/cloud/asset/v1/AssetServiceClientTest.java index 2abc938bc1..8d32be988d 100644 --- a/test/integration/goldens/asset/src/com/google/cloud/asset/v1/AssetServiceClientTest.java +++ b/test/integration/goldens/asset/src/com/google/cloud/asset/v1/AssetServiceClientTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -17,6 +17,7 @@ package com.google.cloud.asset.v1; import static com.google.cloud.asset.v1.AssetServiceClient.ListAssetsPagedResponse; +import static com.google.cloud.asset.v1.AssetServiceClient.ListSavedQueriesPagedResponse; import static com.google.cloud.asset.v1.AssetServiceClient.SearchAllIamPoliciesPagedResponse; import static com.google.cloud.asset.v1.AssetServiceClient.SearchAllResourcesPagedResponse; @@ -35,6 +36,7 @@ import com.google.protobuf.Any; import com.google.protobuf.Duration; import com.google.protobuf.Empty; +import com.google.protobuf.FieldMask; import com.google.protobuf.Timestamp; import com.google.type.Expr; import io.grpc.StatusRuntimeException; @@ -43,7 +45,6 @@ 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; @@ -110,7 +111,7 @@ public void exportAssetsTest() throws Exception { ExportAssetsRequest request = ExportAssetsRequest.newBuilder() - .setParent("ExportAssetsRequest-846449128".toString()) + .setParent(FolderName.of("[FOLDER]").toString()) .setReadTime(Timestamp.newBuilder().build()) .addAllAssetTypes(new ArrayList()) .setContentType(ContentType.forNumber(0)) @@ -146,7 +147,7 @@ public void exportAssetsExceptionTest() throws Exception { try { ExportAssetsRequest request = ExportAssetsRequest.newBuilder() - .setParent("ExportAssetsRequest-846449128".toString()) + .setParent(FolderName.of("[FOLDER]").toString()) .setReadTime(Timestamp.newBuilder().build()) .addAllAssetTypes(new ArrayList()) .setContentType(ContentType.forNumber(0)) @@ -172,25 +173,7 @@ public void listAssetsTest() throws Exception { .build(); mockAssetService.addResponse(expectedResponse); - ResourceName parent = - new ResourceName() { - @Override - public Map getFieldValuesMap() { - Map fieldValuesMap = new HashMap<>(); - fieldValuesMap.put("parent", "parent-4715/parent-4715"); - return fieldValuesMap; - } - - @Override - public String getFieldValue(String fieldName) { - return getFieldValuesMap().get(fieldName); - } - - @Override - public String toString() { - return "parent-4715/parent-4715"; - } - }; + ResourceName parent = FolderName.of("[FOLDER]"); ListAssetsPagedResponse pagedListResponse = client.listAssets(parent); @@ -216,25 +199,7 @@ public void listAssetsExceptionTest() throws Exception { mockAssetService.addException(exception); try { - ResourceName parent = - new ResourceName() { - @Override - public Map getFieldValuesMap() { - Map fieldValuesMap = new HashMap<>(); - fieldValuesMap.put("parent", "parent-4715/parent-4715"); - return fieldValuesMap; - } - - @Override - public String getFieldValue(String fieldName) { - return getFieldValuesMap().get(fieldName); - } - - @Override - public String toString() { - return "parent-4715/parent-4715"; - } - }; + ResourceName parent = FolderName.of("[FOLDER]"); client.listAssets(parent); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { @@ -296,7 +261,7 @@ public void batchGetAssetsHistoryTest() throws Exception { BatchGetAssetsHistoryRequest request = BatchGetAssetsHistoryRequest.newBuilder() - .setParent("BatchGetAssetsHistoryRequest1575208378".toString()) + .setParent(FolderName.of("[FOLDER]").toString()) .addAllAssetNames(new ArrayList()) .setContentType(ContentType.forNumber(0)) .setReadTimeWindow(TimeWindow.newBuilder().build()) @@ -331,7 +296,7 @@ public void batchGetAssetsHistoryExceptionTest() throws Exception { try { BatchGetAssetsHistoryRequest request = BatchGetAssetsHistoryRequest.newBuilder() - .setParent("BatchGetAssetsHistoryRequest1575208378".toString()) + .setParent(FolderName.of("[FOLDER]").toString()) .addAllAssetNames(new ArrayList()) .setContentType(ContentType.forNumber(0)) .setReadTimeWindow(TimeWindow.newBuilder().build()) @@ -737,6 +702,7 @@ public void analyzeIamPolicyTest() throws Exception { AnalyzeIamPolicyRequest request = AnalyzeIamPolicyRequest.newBuilder() .setAnalysisQuery(IamPolicyAnalysisQuery.newBuilder().build()) + .setSavedAnalysisQuery("savedAnalysisQuery376058885") .setExecutionTimeout(Duration.newBuilder().build()) .build(); @@ -748,6 +714,7 @@ public void analyzeIamPolicyTest() throws Exception { AnalyzeIamPolicyRequest actualRequest = ((AnalyzeIamPolicyRequest) actualRequests.get(0)); Assert.assertEquals(request.getAnalysisQuery(), actualRequest.getAnalysisQuery()); + Assert.assertEquals(request.getSavedAnalysisQuery(), actualRequest.getSavedAnalysisQuery()); Assert.assertEquals(request.getExecutionTimeout(), actualRequest.getExecutionTimeout()); Assert.assertTrue( channelProvider.isHeaderSent( @@ -764,6 +731,7 @@ public void analyzeIamPolicyExceptionTest() throws Exception { AnalyzeIamPolicyRequest request = AnalyzeIamPolicyRequest.newBuilder() .setAnalysisQuery(IamPolicyAnalysisQuery.newBuilder().build()) + .setSavedAnalysisQuery("savedAnalysisQuery376058885") .setExecutionTimeout(Duration.newBuilder().build()) .build(); client.analyzeIamPolicy(request); @@ -788,6 +756,7 @@ public void analyzeIamPolicyLongrunningTest() throws Exception { AnalyzeIamPolicyLongrunningRequest request = AnalyzeIamPolicyLongrunningRequest.newBuilder() .setAnalysisQuery(IamPolicyAnalysisQuery.newBuilder().build()) + .setSavedAnalysisQuery("savedAnalysisQuery376058885") .setOutputConfig(IamPolicyAnalysisOutputConfig.newBuilder().build()) .build(); @@ -801,6 +770,7 @@ public void analyzeIamPolicyLongrunningTest() throws Exception { ((AnalyzeIamPolicyLongrunningRequest) actualRequests.get(0)); Assert.assertEquals(request.getAnalysisQuery(), actualRequest.getAnalysisQuery()); + Assert.assertEquals(request.getSavedAnalysisQuery(), actualRequest.getSavedAnalysisQuery()); Assert.assertEquals(request.getOutputConfig(), actualRequest.getOutputConfig()); Assert.assertTrue( channelProvider.isHeaderSent( @@ -817,6 +787,7 @@ public void analyzeIamPolicyLongrunningExceptionTest() throws Exception { AnalyzeIamPolicyLongrunningRequest request = AnalyzeIamPolicyLongrunningRequest.newBuilder() .setAnalysisQuery(IamPolicyAnalysisQuery.newBuilder().build()) + .setSavedAnalysisQuery("savedAnalysisQuery376058885") .setOutputConfig(IamPolicyAnalysisOutputConfig.newBuilder().build()) .build(); client.analyzeIamPolicyLongrunningAsync(request).get(); @@ -873,4 +844,708 @@ public void analyzeMoveExceptionTest() throws Exception { // Expected exception. } } + + @Test + public void queryAssetsTest() throws Exception { + QueryAssetsResponse expectedResponse = + QueryAssetsResponse.newBuilder() + .setJobReference("jobReference-2094880754") + .setDone(true) + .build(); + mockAssetService.addResponse(expectedResponse); + + QueryAssetsRequest request = + QueryAssetsRequest.newBuilder() + .setParent(FolderName.of("[FOLDER]").toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .setTimeout(Duration.newBuilder().build()) + .setOutputConfig(QueryAssetsOutputConfig.newBuilder().build()) + .build(); + + QueryAssetsResponse actualResponse = client.queryAssets(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockAssetService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + QueryAssetsRequest actualRequest = ((QueryAssetsRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getParent(), actualRequest.getParent()); + Assert.assertEquals(request.getStatement(), actualRequest.getStatement()); + Assert.assertEquals(request.getJobReference(), actualRequest.getJobReference()); + Assert.assertEquals(request.getPageSize(), actualRequest.getPageSize()); + Assert.assertEquals(request.getPageToken(), actualRequest.getPageToken()); + Assert.assertEquals(request.getTimeout(), actualRequest.getTimeout()); + Assert.assertEquals(request.getReadTimeWindow(), actualRequest.getReadTimeWindow()); + Assert.assertEquals(request.getReadTime(), actualRequest.getReadTime()); + Assert.assertEquals(request.getOutputConfig(), actualRequest.getOutputConfig()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void queryAssetsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockAssetService.addException(exception); + + try { + QueryAssetsRequest request = + QueryAssetsRequest.newBuilder() + .setParent(FolderName.of("[FOLDER]").toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .setTimeout(Duration.newBuilder().build()) + .setOutputConfig(QueryAssetsOutputConfig.newBuilder().build()) + .build(); + client.queryAssets(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createSavedQueryTest() throws Exception { + SavedQuery expectedResponse = + SavedQuery.newBuilder() + .setName( + SavedQueryName.ofProjectSavedQueryName("[PROJECT]", "[SAVED_QUERY]").toString()) + .setDescription("description-1724546052") + .setCreateTime(Timestamp.newBuilder().build()) + .setCreator("creator1028554796") + .setLastUpdateTime(Timestamp.newBuilder().build()) + .setLastUpdater("lastUpdater1649733971") + .putAllLabels(new HashMap()) + .setContent(SavedQuery.QueryContent.newBuilder().build()) + .build(); + mockAssetService.addResponse(expectedResponse); + + FolderName parent = FolderName.of("[FOLDER]"); + SavedQuery savedQuery = SavedQuery.newBuilder().build(); + String savedQueryId = "savedQueryId378086268"; + + SavedQuery actualResponse = client.createSavedQuery(parent, savedQuery, savedQueryId); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockAssetService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateSavedQueryRequest actualRequest = ((CreateSavedQueryRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertEquals(savedQuery, actualRequest.getSavedQuery()); + Assert.assertEquals(savedQueryId, actualRequest.getSavedQueryId()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void createSavedQueryExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockAssetService.addException(exception); + + try { + FolderName parent = FolderName.of("[FOLDER]"); + SavedQuery savedQuery = SavedQuery.newBuilder().build(); + String savedQueryId = "savedQueryId378086268"; + client.createSavedQuery(parent, savedQuery, savedQueryId); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createSavedQueryTest2() throws Exception { + SavedQuery expectedResponse = + SavedQuery.newBuilder() + .setName( + SavedQueryName.ofProjectSavedQueryName("[PROJECT]", "[SAVED_QUERY]").toString()) + .setDescription("description-1724546052") + .setCreateTime(Timestamp.newBuilder().build()) + .setCreator("creator1028554796") + .setLastUpdateTime(Timestamp.newBuilder().build()) + .setLastUpdater("lastUpdater1649733971") + .putAllLabels(new HashMap()) + .setContent(SavedQuery.QueryContent.newBuilder().build()) + .build(); + mockAssetService.addResponse(expectedResponse); + + OrganizationName parent = OrganizationName.of("[ORGANIZATION]"); + SavedQuery savedQuery = SavedQuery.newBuilder().build(); + String savedQueryId = "savedQueryId378086268"; + + SavedQuery actualResponse = client.createSavedQuery(parent, savedQuery, savedQueryId); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockAssetService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateSavedQueryRequest actualRequest = ((CreateSavedQueryRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertEquals(savedQuery, actualRequest.getSavedQuery()); + Assert.assertEquals(savedQueryId, actualRequest.getSavedQueryId()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void createSavedQueryExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockAssetService.addException(exception); + + try { + OrganizationName parent = OrganizationName.of("[ORGANIZATION]"); + SavedQuery savedQuery = SavedQuery.newBuilder().build(); + String savedQueryId = "savedQueryId378086268"; + client.createSavedQuery(parent, savedQuery, savedQueryId); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createSavedQueryTest3() throws Exception { + SavedQuery expectedResponse = + SavedQuery.newBuilder() + .setName( + SavedQueryName.ofProjectSavedQueryName("[PROJECT]", "[SAVED_QUERY]").toString()) + .setDescription("description-1724546052") + .setCreateTime(Timestamp.newBuilder().build()) + .setCreator("creator1028554796") + .setLastUpdateTime(Timestamp.newBuilder().build()) + .setLastUpdater("lastUpdater1649733971") + .putAllLabels(new HashMap()) + .setContent(SavedQuery.QueryContent.newBuilder().build()) + .build(); + mockAssetService.addResponse(expectedResponse); + + ProjectName parent = ProjectName.of("[PROJECT]"); + SavedQuery savedQuery = SavedQuery.newBuilder().build(); + String savedQueryId = "savedQueryId378086268"; + + SavedQuery actualResponse = client.createSavedQuery(parent, savedQuery, savedQueryId); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockAssetService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateSavedQueryRequest actualRequest = ((CreateSavedQueryRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertEquals(savedQuery, actualRequest.getSavedQuery()); + Assert.assertEquals(savedQueryId, actualRequest.getSavedQueryId()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void createSavedQueryExceptionTest3() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockAssetService.addException(exception); + + try { + ProjectName parent = ProjectName.of("[PROJECT]"); + SavedQuery savedQuery = SavedQuery.newBuilder().build(); + String savedQueryId = "savedQueryId378086268"; + client.createSavedQuery(parent, savedQuery, savedQueryId); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createSavedQueryTest4() throws Exception { + SavedQuery expectedResponse = + SavedQuery.newBuilder() + .setName( + SavedQueryName.ofProjectSavedQueryName("[PROJECT]", "[SAVED_QUERY]").toString()) + .setDescription("description-1724546052") + .setCreateTime(Timestamp.newBuilder().build()) + .setCreator("creator1028554796") + .setLastUpdateTime(Timestamp.newBuilder().build()) + .setLastUpdater("lastUpdater1649733971") + .putAllLabels(new HashMap()) + .setContent(SavedQuery.QueryContent.newBuilder().build()) + .build(); + mockAssetService.addResponse(expectedResponse); + + String parent = "parent-995424086"; + SavedQuery savedQuery = SavedQuery.newBuilder().build(); + String savedQueryId = "savedQueryId378086268"; + + SavedQuery actualResponse = client.createSavedQuery(parent, savedQuery, savedQueryId); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockAssetService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateSavedQueryRequest actualRequest = ((CreateSavedQueryRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertEquals(savedQuery, actualRequest.getSavedQuery()); + Assert.assertEquals(savedQueryId, actualRequest.getSavedQueryId()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void createSavedQueryExceptionTest4() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockAssetService.addException(exception); + + try { + String parent = "parent-995424086"; + SavedQuery savedQuery = SavedQuery.newBuilder().build(); + String savedQueryId = "savedQueryId378086268"; + client.createSavedQuery(parent, savedQuery, savedQueryId); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getSavedQueryTest() throws Exception { + SavedQuery expectedResponse = + SavedQuery.newBuilder() + .setName( + SavedQueryName.ofProjectSavedQueryName("[PROJECT]", "[SAVED_QUERY]").toString()) + .setDescription("description-1724546052") + .setCreateTime(Timestamp.newBuilder().build()) + .setCreator("creator1028554796") + .setLastUpdateTime(Timestamp.newBuilder().build()) + .setLastUpdater("lastUpdater1649733971") + .putAllLabels(new HashMap()) + .setContent(SavedQuery.QueryContent.newBuilder().build()) + .build(); + mockAssetService.addResponse(expectedResponse); + + SavedQueryName name = SavedQueryName.ofProjectSavedQueryName("[PROJECT]", "[SAVED_QUERY]"); + + SavedQuery actualResponse = client.getSavedQuery(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockAssetService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetSavedQueryRequest actualRequest = ((GetSavedQueryRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getSavedQueryExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockAssetService.addException(exception); + + try { + SavedQueryName name = SavedQueryName.ofProjectSavedQueryName("[PROJECT]", "[SAVED_QUERY]"); + client.getSavedQuery(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getSavedQueryTest2() throws Exception { + SavedQuery expectedResponse = + SavedQuery.newBuilder() + .setName( + SavedQueryName.ofProjectSavedQueryName("[PROJECT]", "[SAVED_QUERY]").toString()) + .setDescription("description-1724546052") + .setCreateTime(Timestamp.newBuilder().build()) + .setCreator("creator1028554796") + .setLastUpdateTime(Timestamp.newBuilder().build()) + .setLastUpdater("lastUpdater1649733971") + .putAllLabels(new HashMap()) + .setContent(SavedQuery.QueryContent.newBuilder().build()) + .build(); + mockAssetService.addResponse(expectedResponse); + + String name = "name3373707"; + + SavedQuery actualResponse = client.getSavedQuery(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockAssetService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetSavedQueryRequest actualRequest = ((GetSavedQueryRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getSavedQueryExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockAssetService.addException(exception); + + try { + String name = "name3373707"; + client.getSavedQuery(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listSavedQueriesTest() throws Exception { + SavedQuery responsesElement = SavedQuery.newBuilder().build(); + ListSavedQueriesResponse expectedResponse = + ListSavedQueriesResponse.newBuilder() + .setNextPageToken("") + .addAllSavedQueries(Arrays.asList(responsesElement)) + .build(); + mockAssetService.addResponse(expectedResponse); + + FolderName parent = FolderName.of("[FOLDER]"); + + ListSavedQueriesPagedResponse pagedListResponse = client.listSavedQueries(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getSavedQueriesList().get(0), resources.get(0)); + + List actualRequests = mockAssetService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListSavedQueriesRequest actualRequest = ((ListSavedQueriesRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listSavedQueriesExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockAssetService.addException(exception); + + try { + FolderName parent = FolderName.of("[FOLDER]"); + client.listSavedQueries(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listSavedQueriesTest2() throws Exception { + SavedQuery responsesElement = SavedQuery.newBuilder().build(); + ListSavedQueriesResponse expectedResponse = + ListSavedQueriesResponse.newBuilder() + .setNextPageToken("") + .addAllSavedQueries(Arrays.asList(responsesElement)) + .build(); + mockAssetService.addResponse(expectedResponse); + + OrganizationName parent = OrganizationName.of("[ORGANIZATION]"); + + ListSavedQueriesPagedResponse pagedListResponse = client.listSavedQueries(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getSavedQueriesList().get(0), resources.get(0)); + + List actualRequests = mockAssetService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListSavedQueriesRequest actualRequest = ((ListSavedQueriesRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listSavedQueriesExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockAssetService.addException(exception); + + try { + OrganizationName parent = OrganizationName.of("[ORGANIZATION]"); + client.listSavedQueries(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listSavedQueriesTest3() throws Exception { + SavedQuery responsesElement = SavedQuery.newBuilder().build(); + ListSavedQueriesResponse expectedResponse = + ListSavedQueriesResponse.newBuilder() + .setNextPageToken("") + .addAllSavedQueries(Arrays.asList(responsesElement)) + .build(); + mockAssetService.addResponse(expectedResponse); + + ProjectName parent = ProjectName.of("[PROJECT]"); + + ListSavedQueriesPagedResponse pagedListResponse = client.listSavedQueries(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getSavedQueriesList().get(0), resources.get(0)); + + List actualRequests = mockAssetService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListSavedQueriesRequest actualRequest = ((ListSavedQueriesRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listSavedQueriesExceptionTest3() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockAssetService.addException(exception); + + try { + ProjectName parent = ProjectName.of("[PROJECT]"); + client.listSavedQueries(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listSavedQueriesTest4() throws Exception { + SavedQuery responsesElement = SavedQuery.newBuilder().build(); + ListSavedQueriesResponse expectedResponse = + ListSavedQueriesResponse.newBuilder() + .setNextPageToken("") + .addAllSavedQueries(Arrays.asList(responsesElement)) + .build(); + mockAssetService.addResponse(expectedResponse); + + String parent = "parent-995424086"; + + ListSavedQueriesPagedResponse pagedListResponse = client.listSavedQueries(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getSavedQueriesList().get(0), resources.get(0)); + + List actualRequests = mockAssetService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListSavedQueriesRequest actualRequest = ((ListSavedQueriesRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listSavedQueriesExceptionTest4() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockAssetService.addException(exception); + + try { + String parent = "parent-995424086"; + client.listSavedQueries(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void updateSavedQueryTest() throws Exception { + SavedQuery expectedResponse = + SavedQuery.newBuilder() + .setName( + SavedQueryName.ofProjectSavedQueryName("[PROJECT]", "[SAVED_QUERY]").toString()) + .setDescription("description-1724546052") + .setCreateTime(Timestamp.newBuilder().build()) + .setCreator("creator1028554796") + .setLastUpdateTime(Timestamp.newBuilder().build()) + .setLastUpdater("lastUpdater1649733971") + .putAllLabels(new HashMap()) + .setContent(SavedQuery.QueryContent.newBuilder().build()) + .build(); + mockAssetService.addResponse(expectedResponse); + + SavedQuery savedQuery = SavedQuery.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + + SavedQuery actualResponse = client.updateSavedQuery(savedQuery, updateMask); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockAssetService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + UpdateSavedQueryRequest actualRequest = ((UpdateSavedQueryRequest) actualRequests.get(0)); + + Assert.assertEquals(savedQuery, actualRequest.getSavedQuery()); + Assert.assertEquals(updateMask, actualRequest.getUpdateMask()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void updateSavedQueryExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockAssetService.addException(exception); + + try { + SavedQuery savedQuery = SavedQuery.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + client.updateSavedQuery(savedQuery, updateMask); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void deleteSavedQueryTest() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockAssetService.addResponse(expectedResponse); + + SavedQueryName name = SavedQueryName.ofProjectSavedQueryName("[PROJECT]", "[SAVED_QUERY]"); + + client.deleteSavedQuery(name); + + List actualRequests = mockAssetService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeleteSavedQueryRequest actualRequest = ((DeleteSavedQueryRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void deleteSavedQueryExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockAssetService.addException(exception); + + try { + SavedQueryName name = SavedQueryName.ofProjectSavedQueryName("[PROJECT]", "[SAVED_QUERY]"); + client.deleteSavedQuery(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void deleteSavedQueryTest2() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockAssetService.addResponse(expectedResponse); + + String name = "name3373707"; + + client.deleteSavedQuery(name); + + List actualRequests = mockAssetService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeleteSavedQueryRequest actualRequest = ((DeleteSavedQueryRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void deleteSavedQueryExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockAssetService.addException(exception); + + try { + String name = "name3373707"; + client.deleteSavedQuery(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void batchGetEffectiveIamPoliciesTest() throws Exception { + BatchGetEffectiveIamPoliciesResponse expectedResponse = + BatchGetEffectiveIamPoliciesResponse.newBuilder() + .addAllPolicyResults( + new ArrayList()) + .build(); + mockAssetService.addResponse(expectedResponse); + + BatchGetEffectiveIamPoliciesRequest request = + BatchGetEffectiveIamPoliciesRequest.newBuilder() + .setScope(FolderName.of("[FOLDER]").toString()) + .addAllNames(new ArrayList()) + .build(); + + BatchGetEffectiveIamPoliciesResponse actualResponse = + client.batchGetEffectiveIamPolicies(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockAssetService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + BatchGetEffectiveIamPoliciesRequest actualRequest = + ((BatchGetEffectiveIamPoliciesRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getScope(), actualRequest.getScope()); + Assert.assertEquals(request.getNamesList(), actualRequest.getNamesList()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void batchGetEffectiveIamPoliciesExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockAssetService.addException(exception); + + try { + BatchGetEffectiveIamPoliciesRequest request = + BatchGetEffectiveIamPoliciesRequest.newBuilder() + .setScope(FolderName.of("[FOLDER]").toString()) + .addAllNames(new ArrayList()) + .build(); + client.batchGetEffectiveIamPolicies(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } } diff --git a/test/integration/goldens/asset/src/com/google/cloud/asset/v1/AssetServiceSettings.java b/test/integration/goldens/asset/src/com/google/cloud/asset/v1/AssetServiceSettings.java index 3fb0d9dd35..2319d4ff41 100644 --- a/test/integration/goldens/asset/src/com/google/cloud/asset/v1/AssetServiceSettings.java +++ b/test/integration/goldens/asset/src/com/google/cloud/asset/v1/AssetServiceSettings.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -17,6 +17,7 @@ package com.google.cloud.asset.v1; import static com.google.cloud.asset.v1.AssetServiceClient.ListAssetsPagedResponse; +import static com.google.cloud.asset.v1.AssetServiceClient.ListSavedQueriesPagedResponse; import static com.google.cloud.asset.v1.AssetServiceClient.SearchAllIamPoliciesPagedResponse; import static com.google.cloud.asset.v1.AssetServiceClient.SearchAllResourcesPagedResponse; @@ -25,6 +26,7 @@ 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.httpjson.InstantiatingHttpJsonChannelProvider; import com.google.api.gax.rpc.ApiClientHeaderProvider; import com.google.api.gax.rpc.ClientContext; import com.google.api.gax.rpc.ClientSettings; @@ -55,7 +57,9 @@ *

        The builder of this class is recursive, so contained classes are themselves builders. When * build() is called, the tree of builders is called to create the complete settings object. * - *

        For example, to set the total timeout of batchGetAssetsHistory to 30 seconds: + *

        For example, to set the + * [RetrySettings](https://cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.retrying.RetrySettings) + * of batchGetAssetsHistory: * *

        {@code
          * // This snippet has been automatically generated and should be regarded as a code template only.
        @@ -71,10 +75,46 @@
          *             .batchGetAssetsHistorySettings()
          *             .getRetrySettings()
          *             .toBuilder()
        - *             .setTotalTimeout(Duration.ofSeconds(30))
        + *             .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());
          * AssetServiceSettings assetServiceSettings = assetServiceSettingsBuilder.build();
          * }
        + * + * Please refer to the [Client Side Retry + * Guide](https://docs.cloud.google.com/java/docs/client-retries) 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 exportAssets: + * + *

        {@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
        + * AssetServiceSettings.Builder assetServiceSettingsBuilder = AssetServiceSettings.newBuilder();
        + * TimedRetryAlgorithm timedRetryAlgorithm =
        + *     OperationalTimedPollAlgorithm.create(
        + *         RetrySettings.newBuilder()
        + *             .setInitialRetryDelayDuration(Duration.ofMillis(500))
        + *             .setRetryDelayMultiplier(1.5)
        + *             .setMaxRetryDelayDuration(Duration.ofMillis(5000))
        + *             .setTotalTimeoutDuration(Duration.ofHours(24))
        + *             .build());
        + * assetServiceSettingsBuilder
        + *     .createClusterOperationSettings()
        + *     .setPollingAlgorithm(timedRetryAlgorithm)
        + *     .build();
        + * }
        */ @Generated("by gapic-generator-java") public class AssetServiceSettings extends ClientSettings { @@ -170,6 +210,45 @@ public UnaryCallSettings analyzeMoveSet return ((AssetServiceStubSettings) getStubSettings()).analyzeMoveSettings(); } + /** Returns the object with the settings used for calls to queryAssets. */ + public UnaryCallSettings queryAssetsSettings() { + return ((AssetServiceStubSettings) getStubSettings()).queryAssetsSettings(); + } + + /** Returns the object with the settings used for calls to createSavedQuery. */ + public UnaryCallSettings createSavedQuerySettings() { + return ((AssetServiceStubSettings) getStubSettings()).createSavedQuerySettings(); + } + + /** Returns the object with the settings used for calls to getSavedQuery. */ + public UnaryCallSettings getSavedQuerySettings() { + return ((AssetServiceStubSettings) getStubSettings()).getSavedQuerySettings(); + } + + /** Returns the object with the settings used for calls to listSavedQueries. */ + public PagedCallSettings< + ListSavedQueriesRequest, ListSavedQueriesResponse, ListSavedQueriesPagedResponse> + listSavedQueriesSettings() { + return ((AssetServiceStubSettings) getStubSettings()).listSavedQueriesSettings(); + } + + /** Returns the object with the settings used for calls to updateSavedQuery. */ + public UnaryCallSettings updateSavedQuerySettings() { + return ((AssetServiceStubSettings) getStubSettings()).updateSavedQuerySettings(); + } + + /** Returns the object with the settings used for calls to deleteSavedQuery. */ + public UnaryCallSettings deleteSavedQuerySettings() { + return ((AssetServiceStubSettings) getStubSettings()).deleteSavedQuerySettings(); + } + + /** Returns the object with the settings used for calls to batchGetEffectiveIamPolicies. */ + public UnaryCallSettings< + BatchGetEffectiveIamPoliciesRequest, BatchGetEffectiveIamPoliciesResponse> + batchGetEffectiveIamPoliciesSettings() { + return ((AssetServiceStubSettings) getStubSettings()).batchGetEffectiveIamPoliciesSettings(); + } + public static final AssetServiceSettings create(AssetServiceStubSettings stub) throws IOException { return new AssetServiceSettings.Builder(stub.toBuilder()).build(); @@ -195,25 +274,36 @@ public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilde return AssetServiceStubSettings.defaultCredentialsProviderBuilder(); } - /** Returns a builder for the default ChannelProvider for this service. */ + /** Returns a builder for the default gRPC ChannelProvider for this service. */ public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { return AssetServiceStubSettings.defaultGrpcTransportProviderBuilder(); } + /** Returns a builder for the default REST ChannelProvider for this service. */ + @BetaApi + public static InstantiatingHttpJsonChannelProvider.Builder + defaultHttpJsonTransportProviderBuilder() { + return AssetServiceStubSettings.defaultHttpJsonTransportProviderBuilder(); + } + public static TransportChannelProvider defaultTransportChannelProvider() { return AssetServiceStubSettings.defaultTransportChannelProvider(); } - @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { return AssetServiceStubSettings.defaultApiClientHeaderProviderBuilder(); } - /** Returns a new builder for this class. */ + /** Returns a new gRPC builder for this class. */ public static Builder newBuilder() { return Builder.createDefault(); } + /** Returns a new REST builder for this class. */ + public static Builder newHttpJsonBuilder() { + return Builder.createHttpJsonDefault(); + } + /** Returns a new builder for this class. */ public static Builder newBuilder(ClientContext clientContext) { return new Builder(clientContext); @@ -251,6 +341,10 @@ private static Builder createDefault() { return new Builder(AssetServiceStubSettings.newBuilder()); } + private static Builder createHttpJsonDefault() { + return new Builder(AssetServiceStubSettings.newHttpJsonBuilder()); + } + public AssetServiceStubSettings.Builder getStubSettingsBuilder() { return ((AssetServiceStubSettings.Builder) getStubSettings()); } @@ -359,6 +453,48 @@ public UnaryCallSettings.Builder deleteFeedSettings() return getStubSettingsBuilder().analyzeMoveSettings(); } + /** Returns the builder for the settings used for calls to queryAssets. */ + public UnaryCallSettings.Builder + queryAssetsSettings() { + return getStubSettingsBuilder().queryAssetsSettings(); + } + + /** Returns the builder for the settings used for calls to createSavedQuery. */ + public UnaryCallSettings.Builder + createSavedQuerySettings() { + return getStubSettingsBuilder().createSavedQuerySettings(); + } + + /** Returns the builder for the settings used for calls to getSavedQuery. */ + public UnaryCallSettings.Builder getSavedQuerySettings() { + return getStubSettingsBuilder().getSavedQuerySettings(); + } + + /** Returns the builder for the settings used for calls to listSavedQueries. */ + public PagedCallSettings.Builder< + ListSavedQueriesRequest, ListSavedQueriesResponse, ListSavedQueriesPagedResponse> + listSavedQueriesSettings() { + return getStubSettingsBuilder().listSavedQueriesSettings(); + } + + /** Returns the builder for the settings used for calls to updateSavedQuery. */ + public UnaryCallSettings.Builder + updateSavedQuerySettings() { + return getStubSettingsBuilder().updateSavedQuerySettings(); + } + + /** Returns the builder for the settings used for calls to deleteSavedQuery. */ + public UnaryCallSettings.Builder deleteSavedQuerySettings() { + return getStubSettingsBuilder().deleteSavedQuerySettings(); + } + + /** Returns the builder for the settings used for calls to batchGetEffectiveIamPolicies. */ + public UnaryCallSettings.Builder< + BatchGetEffectiveIamPoliciesRequest, BatchGetEffectiveIamPoliciesResponse> + batchGetEffectiveIamPoliciesSettings() { + return getStubSettingsBuilder().batchGetEffectiveIamPoliciesSettings(); + } + @Override public AssetServiceSettings build() throws IOException { return new AssetServiceSettings(this); diff --git a/test/integration/goldens/asset/src/com/google/cloud/asset/v1/FeedName.java b/test/integration/goldens/asset/src/com/google/cloud/asset/v1/FeedName.java index 7257fbdabe..b66fee5933 100644 --- a/test/integration/goldens/asset/src/com/google/cloud/asset/v1/FeedName.java +++ b/test/integration/goldens/asset/src/com/google/cloud/asset/v1/FeedName.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,7 +16,6 @@ package com.google.cloud.asset.v1; -import com.google.api.core.BetaApi; import com.google.api.pathtemplate.PathTemplate; import com.google.api.pathtemplate.ValidationException; import com.google.api.resourcenames.ResourceName; @@ -97,17 +96,14 @@ public static Builder newBuilder() { return new Builder(); } - @BetaApi("The per-pattern Builders are not stable yet and may be changed in the future.") public static Builder newProjectFeedBuilder() { return new Builder(); } - @BetaApi("The per-pattern Builders are not stable yet and may be changed in the future.") public static FolderFeedBuilder newFolderFeedBuilder() { return new FolderFeedBuilder(); } - @BetaApi("The per-pattern Builders are not stable yet and may be changed in the future.") public static OrganizationFeedBuilder newOrganizationFeedBuilder() { return new OrganizationFeedBuilder(); } @@ -120,17 +116,14 @@ public static FeedName of(String project, String feed) { return newBuilder().setProject(project).setFeed(feed).build(); } - @BetaApi("The static create methods are not stable yet and may be changed in the future.") public static FeedName ofProjectFeedName(String project, String feed) { return newBuilder().setProject(project).setFeed(feed).build(); } - @BetaApi("The static create methods are not stable yet and may be changed in the future.") public static FeedName ofFolderFeedName(String folder, String feed) { return newFolderFeedBuilder().setFolder(folder).setFeed(feed).build(); } - @BetaApi("The static create methods are not stable yet and may be changed in the future.") public static FeedName ofOrganizationFeedName(String organization, String feed) { return newOrganizationFeedBuilder().setOrganization(organization).setFeed(feed).build(); } @@ -139,17 +132,14 @@ public static String format(String project, String feed) { return newBuilder().setProject(project).setFeed(feed).build().toString(); } - @BetaApi("The static format methods are not stable yet and may be changed in the future.") public static String formatProjectFeedName(String project, String feed) { return newBuilder().setProject(project).setFeed(feed).build().toString(); } - @BetaApi("The static format methods are not stable yet and may be changed in the future.") public static String formatFolderFeedName(String folder, String feed) { return newFolderFeedBuilder().setFolder(folder).setFeed(feed).build().toString(); } - @BetaApi("The static format methods are not stable yet and may be changed in the future.") public static String formatOrganizationFeedName(String organization, String feed) { return newOrganizationFeedBuilder() .setOrganization(organization) @@ -240,7 +230,7 @@ public boolean equals(Object o) { if (o == this) { return true; } - if (o != null || getClass() == o.getClass()) { + if (o != null && getClass() == o.getClass()) { FeedName that = ((FeedName) o); return Objects.equals(this.project, that.project) && Objects.equals(this.feed, that.feed) @@ -305,7 +295,6 @@ public FeedName build() { } /** Builder for folders/{folder}/feeds/{feed}. */ - @BetaApi("The per-pattern Builders are not stable yet and may be changed in the future.") public static class FolderFeedBuilder { private String folder; private String feed; @@ -336,7 +325,6 @@ public FeedName build() { } /** Builder for organizations/{organization}/feeds/{feed}. */ - @BetaApi("The per-pattern Builders are not stable yet and may be changed in the future.") public static class OrganizationFeedBuilder { private String organization; private String feed; diff --git a/test/integration/goldens/asset/src/com/google/cloud/asset/v1/FolderName.java b/test/integration/goldens/asset/src/com/google/cloud/asset/v1/FolderName.java new file mode 100644 index 0000000000..41c31e946a --- /dev/null +++ b/test/integration/goldens/asset/src/com/google/cloud/asset/v1/FolderName.java @@ -0,0 +1,168 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS 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.asset.v1; + +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/test/integration/goldens/asset/src/com/google/cloud/asset/v1/MockAssetService.java b/test/integration/goldens/asset/src/com/google/cloud/asset/v1/MockAssetService.java index 304f002778..b7ef0e0bb3 100644 --- a/test/integration/goldens/asset/src/com/google/cloud/asset/v1/MockAssetService.java +++ b/test/integration/goldens/asset/src/com/google/cloud/asset/v1/MockAssetService.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/asset/src/com/google/cloud/asset/v1/MockAssetServiceImpl.java b/test/integration/goldens/asset/src/com/google/cloud/asset/v1/MockAssetServiceImpl.java index e48002f784..b84f3a6960 100644 --- a/test/integration/goldens/asset/src/com/google/cloud/asset/v1/MockAssetServiceImpl.java +++ b/test/integration/goldens/asset/src/com/google/cloud/asset/v1/MockAssetServiceImpl.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -331,4 +331,152 @@ public void analyzeMove( Exception.class.getName()))); } } + + @Override + public void queryAssets( + QueryAssetsRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof QueryAssetsResponse) { + requests.add(request); + responseObserver.onNext(((QueryAssetsResponse) 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 QueryAssets, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + QueryAssetsResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void createSavedQuery( + CreateSavedQueryRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof SavedQuery) { + requests.add(request); + responseObserver.onNext(((SavedQuery) 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 CreateSavedQuery, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + SavedQuery.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void getSavedQuery( + GetSavedQueryRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof SavedQuery) { + requests.add(request); + responseObserver.onNext(((SavedQuery) 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 GetSavedQuery, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + SavedQuery.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void listSavedQueries( + ListSavedQueriesRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof ListSavedQueriesResponse) { + requests.add(request); + responseObserver.onNext(((ListSavedQueriesResponse) 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 ListSavedQueries, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + ListSavedQueriesResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void updateSavedQuery( + UpdateSavedQueryRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof SavedQuery) { + requests.add(request); + responseObserver.onNext(((SavedQuery) 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 UpdateSavedQuery, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + SavedQuery.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void deleteSavedQuery( + DeleteSavedQueryRequest 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 DeleteSavedQuery, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Empty.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void batchGetEffectiveIamPolicies( + BatchGetEffectiveIamPoliciesRequest request, + StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof BatchGetEffectiveIamPoliciesResponse) { + requests.add(request); + responseObserver.onNext(((BatchGetEffectiveIamPoliciesResponse) 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 BatchGetEffectiveIamPolicies, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + BatchGetEffectiveIamPoliciesResponse.class.getName(), + Exception.class.getName()))); + } + } } diff --git a/test/integration/goldens/asset/src/com/google/cloud/asset/v1/OrganizationName.java b/test/integration/goldens/asset/src/com/google/cloud/asset/v1/OrganizationName.java new file mode 100644 index 0000000000..7ceca6182a --- /dev/null +++ b/test/integration/goldens/asset/src/com/google/cloud/asset/v1/OrganizationName.java @@ -0,0 +1,168 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS 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.asset.v1; + +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/test/integration/goldens/asset/src/com/google/cloud/asset/v1/ProjectName.java b/test/integration/goldens/asset/src/com/google/cloud/asset/v1/ProjectName.java new file mode 100644 index 0000000000..7e9b79905a --- /dev/null +++ b/test/integration/goldens/asset/src/com/google/cloud/asset/v1/ProjectName.java @@ -0,0 +1,168 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS 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.asset.v1; + +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/test/integration/goldens/asset/src/com/google/cloud/asset/v1/SavedQueryName.java b/test/integration/goldens/asset/src/com/google/cloud/asset/v1/SavedQueryName.java new file mode 100644 index 0000000000..d2c3bc7663 --- /dev/null +++ b/test/integration/goldens/asset/src/com/google/cloud/asset/v1/SavedQueryName.java @@ -0,0 +1,366 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS 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.asset.v1; + +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 SavedQueryName implements ResourceName { + private static final PathTemplate PROJECT_SAVED_QUERY = + PathTemplate.createWithoutUrlEncoding("projects/{project}/savedQueries/{saved_query}"); + private static final PathTemplate FOLDER_SAVED_QUERY = + PathTemplate.createWithoutUrlEncoding("folders/{folder}/savedQueries/{saved_query}"); + private static final PathTemplate ORGANIZATION_SAVED_QUERY = + PathTemplate.createWithoutUrlEncoding( + "organizations/{organization}/savedQueries/{saved_query}"); + private volatile Map fieldValuesMap; + private PathTemplate pathTemplate; + private String fixedValue; + private final String project; + private final String savedQuery; + private final String folder; + private final String organization; + + @Deprecated + protected SavedQueryName() { + project = null; + savedQuery = null; + folder = null; + organization = null; + } + + private SavedQueryName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + savedQuery = Preconditions.checkNotNull(builder.getSavedQuery()); + folder = null; + organization = null; + pathTemplate = PROJECT_SAVED_QUERY; + } + + private SavedQueryName(FolderSavedQueryBuilder builder) { + folder = Preconditions.checkNotNull(builder.getFolder()); + savedQuery = Preconditions.checkNotNull(builder.getSavedQuery()); + project = null; + organization = null; + pathTemplate = FOLDER_SAVED_QUERY; + } + + private SavedQueryName(OrganizationSavedQueryBuilder builder) { + organization = Preconditions.checkNotNull(builder.getOrganization()); + savedQuery = Preconditions.checkNotNull(builder.getSavedQuery()); + project = null; + folder = null; + pathTemplate = ORGANIZATION_SAVED_QUERY; + } + + public String getProject() { + return project; + } + + public String getSavedQuery() { + return savedQuery; + } + + public String getFolder() { + return folder; + } + + public String getOrganization() { + return organization; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public static Builder newProjectSavedQueryBuilder() { + return new Builder(); + } + + public static FolderSavedQueryBuilder newFolderSavedQueryBuilder() { + return new FolderSavedQueryBuilder(); + } + + public static OrganizationSavedQueryBuilder newOrganizationSavedQueryBuilder() { + return new OrganizationSavedQueryBuilder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + public static SavedQueryName of(String project, String savedQuery) { + return newBuilder().setProject(project).setSavedQuery(savedQuery).build(); + } + + public static SavedQueryName ofProjectSavedQueryName(String project, String savedQuery) { + return newBuilder().setProject(project).setSavedQuery(savedQuery).build(); + } + + public static SavedQueryName ofFolderSavedQueryName(String folder, String savedQuery) { + return newFolderSavedQueryBuilder().setFolder(folder).setSavedQuery(savedQuery).build(); + } + + public static SavedQueryName ofOrganizationSavedQueryName( + String organization, String savedQuery) { + return newOrganizationSavedQueryBuilder() + .setOrganization(organization) + .setSavedQuery(savedQuery) + .build(); + } + + public static String format(String project, String savedQuery) { + return newBuilder().setProject(project).setSavedQuery(savedQuery).build().toString(); + } + + public static String formatProjectSavedQueryName(String project, String savedQuery) { + return newBuilder().setProject(project).setSavedQuery(savedQuery).build().toString(); + } + + public static String formatFolderSavedQueryName(String folder, String savedQuery) { + return newFolderSavedQueryBuilder() + .setFolder(folder) + .setSavedQuery(savedQuery) + .build() + .toString(); + } + + public static String formatOrganizationSavedQueryName(String organization, String savedQuery) { + return newOrganizationSavedQueryBuilder() + .setOrganization(organization) + .setSavedQuery(savedQuery) + .build() + .toString(); + } + + public static SavedQueryName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + if (PROJECT_SAVED_QUERY.matches(formattedString)) { + Map matchMap = PROJECT_SAVED_QUERY.match(formattedString); + return ofProjectSavedQueryName(matchMap.get("project"), matchMap.get("saved_query")); + } else if (FOLDER_SAVED_QUERY.matches(formattedString)) { + Map matchMap = FOLDER_SAVED_QUERY.match(formattedString); + return ofFolderSavedQueryName(matchMap.get("folder"), matchMap.get("saved_query")); + } else if (ORGANIZATION_SAVED_QUERY.matches(formattedString)) { + Map matchMap = ORGANIZATION_SAVED_QUERY.match(formattedString); + return ofOrganizationSavedQueryName( + matchMap.get("organization"), matchMap.get("saved_query")); + } + throw new ValidationException("SavedQueryName.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 (SavedQueryName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return PROJECT_SAVED_QUERY.matches(formattedString) + || FOLDER_SAVED_QUERY.matches(formattedString) + || ORGANIZATION_SAVED_QUERY.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 (savedQuery != null) { + fieldMapBuilder.put("saved_query", savedQuery); + } + if (folder != null) { + fieldMapBuilder.put("folder", folder); + } + 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 fixedValue != null ? fixedValue : pathTemplate.instantiate(getFieldValuesMap()); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o != null && getClass() == o.getClass()) { + SavedQueryName that = ((SavedQueryName) o); + return Objects.equals(this.project, that.project) + && Objects.equals(this.savedQuery, that.savedQuery) + && Objects.equals(this.folder, that.folder) + && Objects.equals(this.organization, that.organization); + } + 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(savedQuery); + h *= 1000003; + h ^= Objects.hashCode(folder); + h *= 1000003; + h ^= Objects.hashCode(organization); + return h; + } + + /** Builder for projects/{project}/savedQueries/{saved_query}. */ + public static class Builder { + private String project; + private String savedQuery; + + protected Builder() {} + + public String getProject() { + return project; + } + + public String getSavedQuery() { + return savedQuery; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + public Builder setSavedQuery(String savedQuery) { + this.savedQuery = savedQuery; + return this; + } + + private Builder(SavedQueryName savedQueryName) { + Preconditions.checkArgument( + Objects.equals(savedQueryName.pathTemplate, PROJECT_SAVED_QUERY), + "toBuilder is only supported when SavedQueryName has the pattern of projects/{project}/savedQueries/{saved_query}"); + this.project = savedQueryName.project; + this.savedQuery = savedQueryName.savedQuery; + } + + public SavedQueryName build() { + return new SavedQueryName(this); + } + } + + /** Builder for folders/{folder}/savedQueries/{saved_query}. */ + public static class FolderSavedQueryBuilder { + private String folder; + private String savedQuery; + + protected FolderSavedQueryBuilder() {} + + public String getFolder() { + return folder; + } + + public String getSavedQuery() { + return savedQuery; + } + + public FolderSavedQueryBuilder setFolder(String folder) { + this.folder = folder; + return this; + } + + public FolderSavedQueryBuilder setSavedQuery(String savedQuery) { + this.savedQuery = savedQuery; + return this; + } + + public SavedQueryName build() { + return new SavedQueryName(this); + } + } + + /** Builder for organizations/{organization}/savedQueries/{saved_query}. */ + public static class OrganizationSavedQueryBuilder { + private String organization; + private String savedQuery; + + protected OrganizationSavedQueryBuilder() {} + + public String getOrganization() { + return organization; + } + + public String getSavedQuery() { + return savedQuery; + } + + public OrganizationSavedQueryBuilder setOrganization(String organization) { + this.organization = organization; + return this; + } + + public OrganizationSavedQueryBuilder setSavedQuery(String savedQuery) { + this.savedQuery = savedQuery; + return this; + } + + public SavedQueryName build() { + return new SavedQueryName(this); + } + } +} diff --git a/test/integration/goldens/asset/src/com/google/cloud/asset/v1/gapic_metadata.json b/test/integration/goldens/asset/src/com/google/cloud/asset/v1/gapic_metadata.json index 05ba5ae5ea..b3f61cf6ee 100644 --- a/test/integration/goldens/asset/src/com/google/cloud/asset/v1/gapic_metadata.json +++ b/test/integration/goldens/asset/src/com/google/cloud/asset/v1/gapic_metadata.json @@ -22,24 +22,42 @@ "BatchGetAssetsHistory": { "methods": ["batchGetAssetsHistory", "batchGetAssetsHistoryCallable"] }, + "BatchGetEffectiveIamPolicies": { + "methods": ["batchGetEffectiveIamPolicies", "batchGetEffectiveIamPoliciesCallable"] + }, "CreateFeed": { "methods": ["createFeed", "createFeed", "createFeedCallable"] }, + "CreateSavedQuery": { + "methods": ["createSavedQuery", "createSavedQuery", "createSavedQuery", "createSavedQuery", "createSavedQuery", "createSavedQueryCallable"] + }, "DeleteFeed": { "methods": ["deleteFeed", "deleteFeed", "deleteFeed", "deleteFeedCallable"] }, + "DeleteSavedQuery": { + "methods": ["deleteSavedQuery", "deleteSavedQuery", "deleteSavedQuery", "deleteSavedQueryCallable"] + }, "ExportAssets": { "methods": ["exportAssetsAsync", "exportAssetsOperationCallable", "exportAssetsCallable"] }, "GetFeed": { "methods": ["getFeed", "getFeed", "getFeed", "getFeedCallable"] }, + "GetSavedQuery": { + "methods": ["getSavedQuery", "getSavedQuery", "getSavedQuery", "getSavedQueryCallable"] + }, "ListAssets": { "methods": ["listAssets", "listAssets", "listAssets", "listAssetsPagedCallable", "listAssetsCallable"] }, "ListFeeds": { "methods": ["listFeeds", "listFeeds", "listFeedsCallable"] }, + "ListSavedQueries": { + "methods": ["listSavedQueries", "listSavedQueries", "listSavedQueries", "listSavedQueries", "listSavedQueries", "listSavedQueriesPagedCallable", "listSavedQueriesCallable"] + }, + "QueryAssets": { + "methods": ["queryAssets", "queryAssetsCallable"] + }, "SearchAllIamPolicies": { "methods": ["searchAllIamPolicies", "searchAllIamPolicies", "searchAllIamPoliciesPagedCallable", "searchAllIamPoliciesCallable"] }, @@ -48,6 +66,9 @@ }, "UpdateFeed": { "methods": ["updateFeed", "updateFeed", "updateFeedCallable"] + }, + "UpdateSavedQuery": { + "methods": ["updateSavedQuery", "updateSavedQuery", "updateSavedQueryCallable"] } } } diff --git a/test/integration/goldens/asset/src/com/google/cloud/asset/v1/package-info.java b/test/integration/goldens/asset/src/com/google/cloud/asset/v1/package-info.java index 7ac072c156..f74bf6e67d 100644 --- a/test/integration/goldens/asset/src/com/google/cloud/asset/v1/package-info.java +++ b/test/integration/goldens/asset/src/com/google/cloud/asset/v1/package-info.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/asset/src/com/google/cloud/asset/v1/stub/AssetServiceStub.java b/test/integration/goldens/asset/src/com/google/cloud/asset/v1/stub/AssetServiceStub.java index 73cb255473..442d706592 100644 --- a/test/integration/goldens/asset/src/com/google/cloud/asset/v1/stub/AssetServiceStub.java +++ b/test/integration/goldens/asset/src/com/google/cloud/asset/v1/stub/AssetServiceStub.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -17,6 +17,7 @@ package com.google.cloud.asset.v1.stub; import static com.google.cloud.asset.v1.AssetServiceClient.ListAssetsPagedResponse; +import static com.google.cloud.asset.v1.AssetServiceClient.ListSavedQueriesPagedResponse; import static com.google.cloud.asset.v1.AssetServiceClient.SearchAllIamPoliciesPagedResponse; import static com.google.cloud.asset.v1.AssetServiceClient.SearchAllResourcesPagedResponse; @@ -32,21 +33,32 @@ import com.google.cloud.asset.v1.AnalyzeMoveResponse; import com.google.cloud.asset.v1.BatchGetAssetsHistoryRequest; import com.google.cloud.asset.v1.BatchGetAssetsHistoryResponse; +import com.google.cloud.asset.v1.BatchGetEffectiveIamPoliciesRequest; +import com.google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse; import com.google.cloud.asset.v1.CreateFeedRequest; +import com.google.cloud.asset.v1.CreateSavedQueryRequest; import com.google.cloud.asset.v1.DeleteFeedRequest; +import com.google.cloud.asset.v1.DeleteSavedQueryRequest; import com.google.cloud.asset.v1.ExportAssetsRequest; import com.google.cloud.asset.v1.ExportAssetsResponse; import com.google.cloud.asset.v1.Feed; import com.google.cloud.asset.v1.GetFeedRequest; +import com.google.cloud.asset.v1.GetSavedQueryRequest; import com.google.cloud.asset.v1.ListAssetsRequest; import com.google.cloud.asset.v1.ListAssetsResponse; import com.google.cloud.asset.v1.ListFeedsRequest; import com.google.cloud.asset.v1.ListFeedsResponse; +import com.google.cloud.asset.v1.ListSavedQueriesRequest; +import com.google.cloud.asset.v1.ListSavedQueriesResponse; +import com.google.cloud.asset.v1.QueryAssetsRequest; +import com.google.cloud.asset.v1.QueryAssetsResponse; +import com.google.cloud.asset.v1.SavedQuery; import com.google.cloud.asset.v1.SearchAllIamPoliciesRequest; import com.google.cloud.asset.v1.SearchAllIamPoliciesResponse; import com.google.cloud.asset.v1.SearchAllResourcesRequest; import com.google.cloud.asset.v1.SearchAllResourcesResponse; import com.google.cloud.asset.v1.UpdateFeedRequest; +import com.google.cloud.asset.v1.UpdateSavedQueryRequest; import com.google.longrunning.Operation; import com.google.longrunning.stub.OperationsStub; import com.google.protobuf.Empty; @@ -62,7 +74,11 @@ public abstract class AssetServiceStub implements BackgroundResource { public OperationsStub getOperationsStub() { - throw new UnsupportedOperationException("Not implemented: getOperationsStub()"); + return null; + } + + public com.google.api.gax.httpjson.longrunning.stub.OperationsStub getHttpJsonOperationsStub() { + return null; } public OperationCallable @@ -151,6 +167,42 @@ public UnaryCallable analyzeMoveCallabl throw new UnsupportedOperationException("Not implemented: analyzeMoveCallable()"); } + public UnaryCallable queryAssetsCallable() { + throw new UnsupportedOperationException("Not implemented: queryAssetsCallable()"); + } + + public UnaryCallable createSavedQueryCallable() { + throw new UnsupportedOperationException("Not implemented: createSavedQueryCallable()"); + } + + public UnaryCallable getSavedQueryCallable() { + throw new UnsupportedOperationException("Not implemented: getSavedQueryCallable()"); + } + + public UnaryCallable + listSavedQueriesPagedCallable() { + throw new UnsupportedOperationException("Not implemented: listSavedQueriesPagedCallable()"); + } + + public UnaryCallable + listSavedQueriesCallable() { + throw new UnsupportedOperationException("Not implemented: listSavedQueriesCallable()"); + } + + public UnaryCallable updateSavedQueryCallable() { + throw new UnsupportedOperationException("Not implemented: updateSavedQueryCallable()"); + } + + public UnaryCallable deleteSavedQueryCallable() { + throw new UnsupportedOperationException("Not implemented: deleteSavedQueryCallable()"); + } + + public UnaryCallable + batchGetEffectiveIamPoliciesCallable() { + throw new UnsupportedOperationException( + "Not implemented: batchGetEffectiveIamPoliciesCallable()"); + } + @Override public abstract void close(); } diff --git a/test/integration/goldens/asset/src/com/google/cloud/asset/v1/stub/AssetServiceStubSettings.java b/test/integration/goldens/asset/src/com/google/cloud/asset/v1/stub/AssetServiceStubSettings.java index 8c27a3bafa..61865afb31 100644 --- a/test/integration/goldens/asset/src/com/google/cloud/asset/v1/stub/AssetServiceStubSettings.java +++ b/test/integration/goldens/asset/src/com/google/cloud/asset/v1/stub/AssetServiceStubSettings.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -17,12 +17,14 @@ package com.google.cloud.asset.v1.stub; import static com.google.cloud.asset.v1.AssetServiceClient.ListAssetsPagedResponse; +import static com.google.cloud.asset.v1.AssetServiceClient.ListSavedQueriesPagedResponse; import static com.google.cloud.asset.v1.AssetServiceClient.SearchAllIamPoliciesPagedResponse; import static com.google.cloud.asset.v1.AssetServiceClient.SearchAllResourcesPagedResponse; import com.google.api.core.ApiFunction; import com.google.api.core.ApiFuture; import com.google.api.core.BetaApi; +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; @@ -30,12 +32,16 @@ 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.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.HttpJsonTransportChannel; +import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; 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.LibraryMetadata; import com.google.api.gax.rpc.OperationCallSettings; import com.google.api.gax.rpc.PageContext; import com.google.api.gax.rpc.PagedCallSettings; @@ -56,23 +62,34 @@ import com.google.cloud.asset.v1.Asset; import com.google.cloud.asset.v1.BatchGetAssetsHistoryRequest; import com.google.cloud.asset.v1.BatchGetAssetsHistoryResponse; +import com.google.cloud.asset.v1.BatchGetEffectiveIamPoliciesRequest; +import com.google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse; import com.google.cloud.asset.v1.CreateFeedRequest; +import com.google.cloud.asset.v1.CreateSavedQueryRequest; import com.google.cloud.asset.v1.DeleteFeedRequest; +import com.google.cloud.asset.v1.DeleteSavedQueryRequest; import com.google.cloud.asset.v1.ExportAssetsRequest; import com.google.cloud.asset.v1.ExportAssetsResponse; import com.google.cloud.asset.v1.Feed; import com.google.cloud.asset.v1.GetFeedRequest; +import com.google.cloud.asset.v1.GetSavedQueryRequest; import com.google.cloud.asset.v1.IamPolicySearchResult; import com.google.cloud.asset.v1.ListAssetsRequest; import com.google.cloud.asset.v1.ListAssetsResponse; import com.google.cloud.asset.v1.ListFeedsRequest; import com.google.cloud.asset.v1.ListFeedsResponse; +import com.google.cloud.asset.v1.ListSavedQueriesRequest; +import com.google.cloud.asset.v1.ListSavedQueriesResponse; +import com.google.cloud.asset.v1.QueryAssetsRequest; +import com.google.cloud.asset.v1.QueryAssetsResponse; import com.google.cloud.asset.v1.ResourceSearchResult; +import com.google.cloud.asset.v1.SavedQuery; import com.google.cloud.asset.v1.SearchAllIamPoliciesRequest; import com.google.cloud.asset.v1.SearchAllIamPoliciesResponse; import com.google.cloud.asset.v1.SearchAllResourcesRequest; import com.google.cloud.asset.v1.SearchAllResourcesResponse; import com.google.cloud.asset.v1.UpdateFeedRequest; +import com.google.cloud.asset.v1.UpdateSavedQueryRequest; import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; import com.google.common.collect.ImmutableSet; @@ -80,9 +97,9 @@ 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; -import org.threeten.bp.Duration; // AUTO-GENERATED DOCUMENTATION AND CLASS. /** @@ -99,7 +116,9 @@ *

        The builder of this class is recursive, so contained classes are themselves builders. When * build() is called, the tree of builders is called to create the complete settings object. * - *

        For example, to set the total timeout of batchGetAssetsHistory to 30 seconds: + *

        For example, to set the + * [RetrySettings](https://cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.retrying.RetrySettings) + * of batchGetAssetsHistory: * *

        {@code
          * // This snippet has been automatically generated and should be regarded as a code template only.
        @@ -116,12 +135,50 @@
          *             .batchGetAssetsHistorySettings()
          *             .getRetrySettings()
          *             .toBuilder()
        - *             .setTotalTimeout(Duration.ofSeconds(30))
        + *             .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());
          * AssetServiceStubSettings assetServiceSettings = assetServiceSettingsBuilder.build();
          * }
        + * + * Please refer to the [Client Side Retry + * Guide](https://docs.cloud.google.com/java/docs/client-retries) 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 exportAssets: + * + *

        {@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
        + * AssetServiceStubSettings.Builder assetServiceSettingsBuilder =
        + *     AssetServiceStubSettings.newBuilder();
        + * TimedRetryAlgorithm timedRetryAlgorithm =
        + *     OperationalTimedPollAlgorithm.create(
        + *         RetrySettings.newBuilder()
        + *             .setInitialRetryDelayDuration(Duration.ofMillis(500))
        + *             .setRetryDelayMultiplier(1.5)
        + *             .setMaxRetryDelayDuration(Duration.ofMillis(5000))
        + *             .setTotalTimeoutDuration(Duration.ofHours(24))
        + *             .build());
        + * assetServiceSettingsBuilder
        + *     .createClusterOperationSettings()
        + *     .setPollingAlgorithm(timedRetryAlgorithm)
        + *     .build();
        + * }
        */ @Generated("by gapic-generator-java") +@SuppressWarnings("CanonicalDuration") public class AssetServiceStubSettings extends StubSettings { /** The default scopes of the service. */ private static final ImmutableList DEFAULT_SERVICE_SCOPES = @@ -158,6 +215,17 @@ public class AssetServiceStubSettings extends StubSettings analyzeIamPolicyLongrunningOperationSettings; private final UnaryCallSettings analyzeMoveSettings; + private final UnaryCallSettings queryAssetsSettings; + private final UnaryCallSettings createSavedQuerySettings; + private final UnaryCallSettings getSavedQuerySettings; + private final PagedCallSettings< + ListSavedQueriesRequest, ListSavedQueriesResponse, ListSavedQueriesPagedResponse> + listSavedQueriesSettings; + private final UnaryCallSettings updateSavedQuerySettings; + private final UnaryCallSettings deleteSavedQuerySettings; + private final UnaryCallSettings< + BatchGetEffectiveIamPoliciesRequest, BatchGetEffectiveIamPoliciesResponse> + batchGetEffectiveIamPoliciesSettings; private static final PagedListDescriptor LIST_ASSETS_PAGE_STR_DESC = @@ -189,9 +257,7 @@ public String extractNextToken(ListAssetsResponse payload) { @Override public Iterable extractResources(ListAssetsResponse payload) { - return payload.getAssetsList() == null - ? ImmutableList.of() - : payload.getAssetsList(); + return payload.getAssetsList(); } }; @@ -230,9 +296,7 @@ public String extractNextToken(SearchAllResourcesResponse payload) { @Override public Iterable extractResources( SearchAllResourcesResponse payload) { - return payload.getResultsList() == null - ? ImmutableList.of() - : payload.getResultsList(); + return payload.getResultsList(); } }; @@ -271,9 +335,44 @@ public String extractNextToken(SearchAllIamPoliciesResponse payload) { @Override public Iterable extractResources( SearchAllIamPoliciesResponse payload) { - return payload.getResultsList() == null - ? ImmutableList.of() - : payload.getResultsList(); + return payload.getResultsList(); + } + }; + + private static final PagedListDescriptor< + ListSavedQueriesRequest, ListSavedQueriesResponse, SavedQuery> + LIST_SAVED_QUERIES_PAGE_STR_DESC = + new PagedListDescriptor() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public ListSavedQueriesRequest injectToken( + ListSavedQueriesRequest payload, String token) { + return ListSavedQueriesRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public ListSavedQueriesRequest injectPageSize( + ListSavedQueriesRequest payload, int pageSize) { + return ListSavedQueriesRequest.newBuilder(payload).setPageSize(pageSize).build(); + } + + @Override + public Integer extractPageSize(ListSavedQueriesRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(ListSavedQueriesResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources(ListSavedQueriesResponse payload) { + return payload.getSavedQueriesList(); } }; @@ -342,6 +441,25 @@ public ApiFuture getFuturePagedResponse( } }; + private static final PagedListResponseFactory< + ListSavedQueriesRequest, ListSavedQueriesResponse, ListSavedQueriesPagedResponse> + LIST_SAVED_QUERIES_PAGE_STR_FACT = + new PagedListResponseFactory< + ListSavedQueriesRequest, ListSavedQueriesResponse, ListSavedQueriesPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListSavedQueriesRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext + pageContext = + PageContext.create( + callable, LIST_SAVED_QUERIES_PAGE_STR_DESC, request, context); + return ListSavedQueriesPagedResponse.createAsync(pageContext, futureResponse); + } + }; + /** Returns the object with the settings used for calls to exportAssets. */ public UnaryCallSettings exportAssetsSettings() { return exportAssetsSettings; @@ -432,23 +550,74 @@ public UnaryCallSettings analyzeMoveSet return analyzeMoveSettings; } + /** Returns the object with the settings used for calls to queryAssets. */ + public UnaryCallSettings queryAssetsSettings() { + return queryAssetsSettings; + } + + /** Returns the object with the settings used for calls to createSavedQuery. */ + public UnaryCallSettings createSavedQuerySettings() { + return createSavedQuerySettings; + } + + /** Returns the object with the settings used for calls to getSavedQuery. */ + public UnaryCallSettings getSavedQuerySettings() { + return getSavedQuerySettings; + } + + /** Returns the object with the settings used for calls to listSavedQueries. */ + public PagedCallSettings< + ListSavedQueriesRequest, ListSavedQueriesResponse, ListSavedQueriesPagedResponse> + listSavedQueriesSettings() { + return listSavedQueriesSettings; + } + + /** Returns the object with the settings used for calls to updateSavedQuery. */ + public UnaryCallSettings updateSavedQuerySettings() { + return updateSavedQuerySettings; + } + + /** Returns the object with the settings used for calls to deleteSavedQuery. */ + public UnaryCallSettings deleteSavedQuerySettings() { + return deleteSavedQuerySettings; + } + + /** Returns the object with the settings used for calls to batchGetEffectiveIamPolicies. */ + public UnaryCallSettings< + BatchGetEffectiveIamPoliciesRequest, BatchGetEffectiveIamPoliciesResponse> + batchGetEffectiveIamPoliciesSettings() { + return batchGetEffectiveIamPoliciesSettings; + } + public AssetServiceStub createStub() throws IOException { if (getTransportChannelProvider() .getTransportName() .equals(GrpcTransportChannel.getGrpcTransportName())) { return GrpcAssetServiceStub.create(this); } + if (getTransportChannelProvider() + .getTransportName() + .equals(HttpJsonTransportChannel.getHttpJsonTransportName())) { + return HttpJsonAssetServiceStub.create(this); + } throw new UnsupportedOperationException( String.format( "Transport not supported: %s", getTransportChannelProvider().getTransportName())); } + /** Returns the default service name. */ + @Override + public String getServiceName() { + return "cloudasset"; + } + /** 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 "cloudasset.googleapis.com:443"; } @@ -470,18 +639,24 @@ public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilde .setUseJwtAccessWithScope(true); } - /** Returns a builder for the default ChannelProvider for this service. */ + /** Returns a builder for the default gRPC ChannelProvider for this service. */ public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { return InstantiatingGrpcChannelProvider.newBuilder() .setMaxInboundMessageSize(Integer.MAX_VALUE); } + /** Returns a builder for the default REST ChannelProvider for this service. */ + @BetaApi + public static InstantiatingHttpJsonChannelProvider.Builder + defaultHttpJsonTransportProviderBuilder() { + return InstantiatingHttpJsonChannelProvider.newBuilder(); + } + public static TransportChannelProvider defaultTransportChannelProvider() { return defaultGrpcTransportProviderBuilder().build(); } - @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") - public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + public static ApiClientHeaderProvider.Builder defaultGrpcApiClientHeaderProviderBuilder() { return ApiClientHeaderProvider.newBuilder() .setGeneratedLibToken( "gapic", GaxProperties.getLibraryVersion(AssetServiceStubSettings.class)) @@ -489,11 +664,29 @@ public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuil GaxGrpcProperties.getGrpcTokenName(), GaxGrpcProperties.getGrpcVersion()); } - /** Returns a new builder for this class. */ + public static ApiClientHeaderProvider.Builder defaultHttpJsonApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken( + "gapic", GaxProperties.getLibraryVersion(AssetServiceStubSettings.class)) + .setTransportToken( + GaxHttpJsonProperties.getHttpJsonTokenName(), + GaxHttpJsonProperties.getHttpJsonVersion()); + } + + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return AssetServiceStubSettings.defaultGrpcApiClientHeaderProviderBuilder(); + } + + /** Returns a new gRPC builder for this class. */ public static Builder newBuilder() { return Builder.createDefault(); } + /** Returns a new REST builder for this class. */ + public static Builder newHttpJsonBuilder() { + return Builder.createHttpJsonDefault(); + } + /** Returns a new builder for this class. */ public static Builder newBuilder(ClientContext clientContext) { return new Builder(clientContext); @@ -524,6 +717,19 @@ protected AssetServiceStubSettings(Builder settingsBuilder) throws IOException { analyzeIamPolicyLongrunningOperationSettings = settingsBuilder.analyzeIamPolicyLongrunningOperationSettings().build(); analyzeMoveSettings = settingsBuilder.analyzeMoveSettings().build(); + queryAssetsSettings = settingsBuilder.queryAssetsSettings().build(); + createSavedQuerySettings = settingsBuilder.createSavedQuerySettings().build(); + getSavedQuerySettings = settingsBuilder.getSavedQuerySettings().build(); + listSavedQueriesSettings = settingsBuilder.listSavedQueriesSettings().build(); + updateSavedQuerySettings = settingsBuilder.updateSavedQuerySettings().build(); + deleteSavedQuerySettings = settingsBuilder.deleteSavedQuerySettings().build(); + batchGetEffectiveIamPoliciesSettings = + settingsBuilder.batchGetEffectiveIamPoliciesSettings().build(); + } + + @Override + protected LibraryMetadata getLibraryMetadata() { + return LibraryMetadata.newBuilder().setVersion(Version.VERSION).build(); } /** Builder for AssetServiceStubSettings. */ @@ -563,6 +769,21 @@ public static class Builder extends StubSettings.Builder analyzeMoveSettings; + private final UnaryCallSettings.Builder + queryAssetsSettings; + private final UnaryCallSettings.Builder + createSavedQuerySettings; + private final UnaryCallSettings.Builder getSavedQuerySettings; + private final PagedCallSettings.Builder< + ListSavedQueriesRequest, ListSavedQueriesResponse, ListSavedQueriesPagedResponse> + listSavedQueriesSettings; + private final UnaryCallSettings.Builder + updateSavedQuerySettings; + private final UnaryCallSettings.Builder + deleteSavedQuerySettings; + private final UnaryCallSettings.Builder< + BatchGetEffectiveIamPoliciesRequest, BatchGetEffectiveIamPoliciesResponse> + batchGetEffectiveIamPoliciesSettings; private static final ImmutableMap> RETRYABLE_CODE_DEFINITIONS; @@ -583,6 +804,12 @@ public static class Builder extends StubSettings.BuildernewArrayList(StatusCode.Code.UNAVAILABLE))); definitions.put("no_retry_codes", ImmutableSet.copyOf(Lists.newArrayList())); + definitions.put( + "retry_policy_4_codes", + ImmutableSet.copyOf(Lists.newArrayList(StatusCode.Code.UNAVAILABLE))); + definitions.put( + "retry_policy_6_codes", + ImmutableSet.copyOf(Lists.newArrayList(StatusCode.Code.UNAVAILABLE))); RETRYABLE_CODE_DEFINITIONS = definitions.build(); } @@ -593,47 +820,69 @@ public static class Builder extends StubSettings.Builder>of( @@ -675,7 +931,14 @@ protected Builder(ClientContext clientContext) { searchAllIamPoliciesSettings, analyzeIamPolicySettings, analyzeIamPolicyLongrunningSettings, - analyzeMoveSettings); + analyzeMoveSettings, + queryAssetsSettings, + createSavedQuerySettings, + getSavedQuerySettings, + listSavedQueriesSettings, + updateSavedQuerySettings, + deleteSavedQuerySettings, + batchGetEffectiveIamPoliciesSettings); initDefaults(this); } @@ -699,6 +962,14 @@ protected Builder(AssetServiceStubSettings settings) { analyzeIamPolicyLongrunningOperationSettings = settings.analyzeIamPolicyLongrunningOperationSettings.toBuilder(); analyzeMoveSettings = settings.analyzeMoveSettings.toBuilder(); + queryAssetsSettings = settings.queryAssetsSettings.toBuilder(); + createSavedQuerySettings = settings.createSavedQuerySettings.toBuilder(); + getSavedQuerySettings = settings.getSavedQuerySettings.toBuilder(); + listSavedQueriesSettings = settings.listSavedQueriesSettings.toBuilder(); + updateSavedQuerySettings = settings.updateSavedQuerySettings.toBuilder(); + deleteSavedQuerySettings = settings.deleteSavedQuerySettings.toBuilder(); + batchGetEffectiveIamPoliciesSettings = + settings.batchGetEffectiveIamPoliciesSettings.toBuilder(); unaryMethodSettingsBuilders = ImmutableList.>of( @@ -714,7 +985,14 @@ protected Builder(AssetServiceStubSettings settings) { searchAllIamPoliciesSettings, analyzeIamPolicySettings, analyzeIamPolicyLongrunningSettings, - analyzeMoveSettings); + analyzeMoveSettings, + queryAssetsSettings, + createSavedQuerySettings, + getSavedQuerySettings, + listSavedQueriesSettings, + updateSavedQuerySettings, + deleteSavedQuerySettings, + batchGetEffectiveIamPoliciesSettings); } private static Builder createDefault() { @@ -723,7 +1001,18 @@ private static Builder createDefault() { builder.setTransportChannelProvider(defaultTransportChannelProvider()); builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); builder.setInternalHeaderProvider(defaultApiClientHeaderProviderBuilder().build()); - builder.setEndpoint(getDefaultEndpoint()); + builder.setMtlsEndpoint(getDefaultMtlsEndpoint()); + builder.setSwitchToMtlsEndpointAllowed(true); + + return initDefaults(builder); + } + + private static Builder createHttpJsonDefault() { + Builder builder = new Builder(((ClientContext) null)); + + builder.setTransportChannelProvider(defaultHttpJsonTransportProviderBuilder().build()); + builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); + builder.setInternalHeaderProvider(defaultHttpJsonApiClientHeaderProviderBuilder().build()); builder.setMtlsEndpoint(getDefaultMtlsEndpoint()); builder.setSwitchToMtlsEndpointAllowed(true); @@ -796,6 +1085,41 @@ private static Builder initDefaults(Builder builder) { .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + builder + .queryAssetsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_4_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_4_params")); + + builder + .createSavedQuerySettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + + builder + .getSavedQuerySettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")); + + builder + .listSavedQueriesSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")); + + builder + .updateSavedQuerySettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + + builder + .deleteSavedQuerySettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")); + + builder + .batchGetEffectiveIamPoliciesSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_6_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_6_params")); + builder .exportAssetsOperationSettings() .setInitialCallSettings( @@ -811,13 +1135,13 @@ private static Builder initDefaults(Builder builder) { .setPollingAlgorithm( OperationTimedPollAlgorithm.create( RetrySettings.newBuilder() - .setInitialRetryDelay(Duration.ofMillis(5000L)) + .setInitialRetryDelayDuration(Duration.ofMillis(5000L)) .setRetryDelayMultiplier(1.5) - .setMaxRetryDelay(Duration.ofMillis(45000L)) - .setInitialRpcTimeout(Duration.ZERO) + .setMaxRetryDelayDuration(Duration.ofMillis(45000L)) + .setInitialRpcTimeoutDuration(Duration.ZERO) .setRpcTimeoutMultiplier(1.0) - .setMaxRpcTimeout(Duration.ZERO) - .setTotalTimeout(Duration.ofMillis(300000L)) + .setMaxRpcTimeoutDuration(Duration.ZERO) + .setTotalTimeoutDuration(Duration.ofMillis(300000L)) .build())); builder @@ -838,13 +1162,13 @@ private static Builder initDefaults(Builder builder) { .setPollingAlgorithm( OperationTimedPollAlgorithm.create( RetrySettings.newBuilder() - .setInitialRetryDelay(Duration.ofMillis(5000L)) + .setInitialRetryDelayDuration(Duration.ofMillis(5000L)) .setRetryDelayMultiplier(1.5) - .setMaxRetryDelay(Duration.ofMillis(45000L)) - .setInitialRpcTimeout(Duration.ZERO) + .setMaxRetryDelayDuration(Duration.ofMillis(45000L)) + .setInitialRpcTimeoutDuration(Duration.ZERO) .setRpcTimeoutMultiplier(1.0) - .setMaxRpcTimeout(Duration.ZERO) - .setTotalTimeout(Duration.ofMillis(300000L)) + .setMaxRpcTimeoutDuration(Duration.ZERO) + .setTotalTimeoutDuration(Duration.ofMillis(300000L)) .build())); return builder; @@ -871,8 +1195,6 @@ public UnaryCallSettings.Builder exportAssetsSet } /** Returns the builder for the settings used for calls to exportAssets. */ - @BetaApi( - "The surface for use by generated code is not stable yet and may change in the future.") public OperationCallSettings.Builder< ExportAssetsRequest, ExportAssetsResponse, ExportAssetsRequest> exportAssetsOperationSettings() { @@ -945,8 +1267,6 @@ public UnaryCallSettings.Builder deleteFeedSettings() } /** Returns the builder for the settings used for calls to analyzeIamPolicyLongrunning. */ - @BetaApi( - "The surface for use by generated code is not stable yet and may change in the future.") public OperationCallSettings.Builder< AnalyzeIamPolicyLongrunningRequest, AnalyzeIamPolicyLongrunningResponse, @@ -961,6 +1281,48 @@ public UnaryCallSettings.Builder deleteFeedSettings() return analyzeMoveSettings; } + /** Returns the builder for the settings used for calls to queryAssets. */ + public UnaryCallSettings.Builder + queryAssetsSettings() { + return queryAssetsSettings; + } + + /** Returns the builder for the settings used for calls to createSavedQuery. */ + public UnaryCallSettings.Builder + createSavedQuerySettings() { + return createSavedQuerySettings; + } + + /** Returns the builder for the settings used for calls to getSavedQuery. */ + public UnaryCallSettings.Builder getSavedQuerySettings() { + return getSavedQuerySettings; + } + + /** Returns the builder for the settings used for calls to listSavedQueries. */ + public PagedCallSettings.Builder< + ListSavedQueriesRequest, ListSavedQueriesResponse, ListSavedQueriesPagedResponse> + listSavedQueriesSettings() { + return listSavedQueriesSettings; + } + + /** Returns the builder for the settings used for calls to updateSavedQuery. */ + public UnaryCallSettings.Builder + updateSavedQuerySettings() { + return updateSavedQuerySettings; + } + + /** Returns the builder for the settings used for calls to deleteSavedQuery. */ + public UnaryCallSettings.Builder deleteSavedQuerySettings() { + return deleteSavedQuerySettings; + } + + /** Returns the builder for the settings used for calls to batchGetEffectiveIamPolicies. */ + public UnaryCallSettings.Builder< + BatchGetEffectiveIamPoliciesRequest, BatchGetEffectiveIamPoliciesResponse> + batchGetEffectiveIamPoliciesSettings() { + return batchGetEffectiveIamPoliciesSettings; + } + @Override public AssetServiceStubSettings build() throws IOException { return new AssetServiceStubSettings(this); diff --git a/test/integration/goldens/asset/src/com/google/cloud/asset/v1/stub/GrpcAssetServiceCallableFactory.java b/test/integration/goldens/asset/src/com/google/cloud/asset/v1/stub/GrpcAssetServiceCallableFactory.java index bdd77c3c5e..242acd7db3 100644 --- a/test/integration/goldens/asset/src/com/google/cloud/asset/v1/stub/GrpcAssetServiceCallableFactory.java +++ b/test/integration/goldens/asset/src/com/google/cloud/asset/v1/stub/GrpcAssetServiceCallableFactory.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/asset/src/com/google/cloud/asset/v1/stub/GrpcAssetServiceStub.java b/test/integration/goldens/asset/src/com/google/cloud/asset/v1/stub/GrpcAssetServiceStub.java index 3c8af19ad3..cf4e9beb89 100644 --- a/test/integration/goldens/asset/src/com/google/cloud/asset/v1/stub/GrpcAssetServiceStub.java +++ b/test/integration/goldens/asset/src/com/google/cloud/asset/v1/stub/GrpcAssetServiceStub.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -17,6 +17,7 @@ package com.google.cloud.asset.v1.stub; import static com.google.cloud.asset.v1.AssetServiceClient.ListAssetsPagedResponse; +import static com.google.cloud.asset.v1.AssetServiceClient.ListSavedQueriesPagedResponse; import static com.google.cloud.asset.v1.AssetServiceClient.SearchAllIamPoliciesPagedResponse; import static com.google.cloud.asset.v1.AssetServiceClient.SearchAllResourcesPagedResponse; @@ -26,6 +27,7 @@ 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.cloud.asset.v1.AnalyzeIamPolicyLongrunningMetadata; import com.google.cloud.asset.v1.AnalyzeIamPolicyLongrunningRequest; @@ -36,22 +38,32 @@ import com.google.cloud.asset.v1.AnalyzeMoveResponse; import com.google.cloud.asset.v1.BatchGetAssetsHistoryRequest; import com.google.cloud.asset.v1.BatchGetAssetsHistoryResponse; +import com.google.cloud.asset.v1.BatchGetEffectiveIamPoliciesRequest; +import com.google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse; import com.google.cloud.asset.v1.CreateFeedRequest; +import com.google.cloud.asset.v1.CreateSavedQueryRequest; import com.google.cloud.asset.v1.DeleteFeedRequest; +import com.google.cloud.asset.v1.DeleteSavedQueryRequest; import com.google.cloud.asset.v1.ExportAssetsRequest; import com.google.cloud.asset.v1.ExportAssetsResponse; import com.google.cloud.asset.v1.Feed; import com.google.cloud.asset.v1.GetFeedRequest; +import com.google.cloud.asset.v1.GetSavedQueryRequest; import com.google.cloud.asset.v1.ListAssetsRequest; import com.google.cloud.asset.v1.ListAssetsResponse; import com.google.cloud.asset.v1.ListFeedsRequest; import com.google.cloud.asset.v1.ListFeedsResponse; +import com.google.cloud.asset.v1.ListSavedQueriesRequest; +import com.google.cloud.asset.v1.ListSavedQueriesResponse; +import com.google.cloud.asset.v1.QueryAssetsRequest; +import com.google.cloud.asset.v1.QueryAssetsResponse; +import com.google.cloud.asset.v1.SavedQuery; import com.google.cloud.asset.v1.SearchAllIamPoliciesRequest; import com.google.cloud.asset.v1.SearchAllIamPoliciesResponse; import com.google.cloud.asset.v1.SearchAllResourcesRequest; import com.google.cloud.asset.v1.SearchAllResourcesResponse; import com.google.cloud.asset.v1.UpdateFeedRequest; -import com.google.common.collect.ImmutableMap; +import com.google.cloud.asset.v1.UpdateSavedQueryRequest; import com.google.longrunning.Operation; import com.google.longrunning.stub.GrpcOperationsStub; import com.google.protobuf.Empty; @@ -77,6 +89,7 @@ public class GrpcAssetServiceStub extends AssetServiceStub { .setFullMethodName("google.cloud.asset.v1.AssetService/ExportAssets") .setRequestMarshaller(ProtoUtils.marshaller(ExportAssetsRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .setSampledToLocalTracing(true) .build(); private static final MethodDescriptor @@ -86,6 +99,7 @@ public class GrpcAssetServiceStub extends AssetServiceStub { .setFullMethodName("google.cloud.asset.v1.AssetService/ListAssets") .setRequestMarshaller(ProtoUtils.marshaller(ListAssetsRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(ListAssetsResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) .build(); private static final MethodDescriptor @@ -97,6 +111,7 @@ public class GrpcAssetServiceStub extends AssetServiceStub { ProtoUtils.marshaller(BatchGetAssetsHistoryRequest.getDefaultInstance())) .setResponseMarshaller( ProtoUtils.marshaller(BatchGetAssetsHistoryResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) .build(); private static final MethodDescriptor createFeedMethodDescriptor = @@ -105,6 +120,7 @@ public class GrpcAssetServiceStub extends AssetServiceStub { .setFullMethodName("google.cloud.asset.v1.AssetService/CreateFeed") .setRequestMarshaller(ProtoUtils.marshaller(CreateFeedRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(Feed.getDefaultInstance())) + .setSampledToLocalTracing(true) .build(); private static final MethodDescriptor getFeedMethodDescriptor = @@ -113,6 +129,7 @@ public class GrpcAssetServiceStub extends AssetServiceStub { .setFullMethodName("google.cloud.asset.v1.AssetService/GetFeed") .setRequestMarshaller(ProtoUtils.marshaller(GetFeedRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(Feed.getDefaultInstance())) + .setSampledToLocalTracing(true) .build(); private static final MethodDescriptor @@ -122,6 +139,7 @@ public class GrpcAssetServiceStub extends AssetServiceStub { .setFullMethodName("google.cloud.asset.v1.AssetService/ListFeeds") .setRequestMarshaller(ProtoUtils.marshaller(ListFeedsRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(ListFeedsResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) .build(); private static final MethodDescriptor updateFeedMethodDescriptor = @@ -130,6 +148,7 @@ public class GrpcAssetServiceStub extends AssetServiceStub { .setFullMethodName("google.cloud.asset.v1.AssetService/UpdateFeed") .setRequestMarshaller(ProtoUtils.marshaller(UpdateFeedRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(Feed.getDefaultInstance())) + .setSampledToLocalTracing(true) .build(); private static final MethodDescriptor deleteFeedMethodDescriptor = @@ -138,6 +157,7 @@ public class GrpcAssetServiceStub extends AssetServiceStub { .setFullMethodName("google.cloud.asset.v1.AssetService/DeleteFeed") .setRequestMarshaller(ProtoUtils.marshaller(DeleteFeedRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(Empty.getDefaultInstance())) + .setSampledToLocalTracing(true) .build(); private static final MethodDescriptor @@ -149,6 +169,7 @@ public class GrpcAssetServiceStub extends AssetServiceStub { ProtoUtils.marshaller(SearchAllResourcesRequest.getDefaultInstance())) .setResponseMarshaller( ProtoUtils.marshaller(SearchAllResourcesResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) .build(); private static final MethodDescriptor @@ -160,6 +181,7 @@ public class GrpcAssetServiceStub extends AssetServiceStub { ProtoUtils.marshaller(SearchAllIamPoliciesRequest.getDefaultInstance())) .setResponseMarshaller( ProtoUtils.marshaller(SearchAllIamPoliciesResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) .build(); private static final MethodDescriptor @@ -171,6 +193,7 @@ public class GrpcAssetServiceStub extends AssetServiceStub { ProtoUtils.marshaller(AnalyzeIamPolicyRequest.getDefaultInstance())) .setResponseMarshaller( ProtoUtils.marshaller(AnalyzeIamPolicyResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) .build(); private static final MethodDescriptor @@ -181,6 +204,7 @@ public class GrpcAssetServiceStub extends AssetServiceStub { .setRequestMarshaller( ProtoUtils.marshaller(AnalyzeIamPolicyLongrunningRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .setSampledToLocalTracing(true) .build(); private static final MethodDescriptor @@ -191,6 +215,89 @@ public class GrpcAssetServiceStub extends AssetServiceStub { .setRequestMarshaller(ProtoUtils.marshaller(AnalyzeMoveRequest.getDefaultInstance())) .setResponseMarshaller( ProtoUtils.marshaller(AnalyzeMoveResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor + queryAssetsMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.asset.v1.AssetService/QueryAssets") + .setRequestMarshaller(ProtoUtils.marshaller(QueryAssetsRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(QueryAssetsResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor + createSavedQueryMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.asset.v1.AssetService/CreateSavedQuery") + .setRequestMarshaller( + ProtoUtils.marshaller(CreateSavedQueryRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(SavedQuery.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor + getSavedQueryMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.asset.v1.AssetService/GetSavedQuery") + .setRequestMarshaller( + ProtoUtils.marshaller(GetSavedQueryRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(SavedQuery.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor + listSavedQueriesMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.asset.v1.AssetService/ListSavedQueries") + .setRequestMarshaller( + ProtoUtils.marshaller(ListSavedQueriesRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(ListSavedQueriesResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor + updateSavedQueryMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.asset.v1.AssetService/UpdateSavedQuery") + .setRequestMarshaller( + ProtoUtils.marshaller(UpdateSavedQueryRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(SavedQuery.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor + deleteSavedQueryMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.asset.v1.AssetService/DeleteSavedQuery") + .setRequestMarshaller( + ProtoUtils.marshaller(DeleteSavedQueryRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Empty.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor< + BatchGetEffectiveIamPoliciesRequest, BatchGetEffectiveIamPoliciesResponse> + batchGetEffectiveIamPoliciesMethodDescriptor = + MethodDescriptor + . + newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.asset.v1.AssetService/BatchGetEffectiveIamPolicies") + .setRequestMarshaller( + ProtoUtils.marshaller(BatchGetEffectiveIamPoliciesRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(BatchGetEffectiveIamPoliciesResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) .build(); private final UnaryCallable exportAssetsCallable; @@ -223,6 +330,18 @@ public class GrpcAssetServiceStub extends AssetServiceStub { AnalyzeIamPolicyLongrunningMetadata> analyzeIamPolicyLongrunningOperationCallable; private final UnaryCallable analyzeMoveCallable; + private final UnaryCallable queryAssetsCallable; + private final UnaryCallable createSavedQueryCallable; + private final UnaryCallable getSavedQueryCallable; + private final UnaryCallable + listSavedQueriesCallable; + private final UnaryCallable + listSavedQueriesPagedCallable; + private final UnaryCallable updateSavedQueryCallable; + private final UnaryCallable deleteSavedQueryCallable; + private final UnaryCallable< + BatchGetEffectiveIamPoliciesRequest, BatchGetEffectiveIamPoliciesResponse> + batchGetEffectiveIamPoliciesCallable; private final BackgroundResource backgroundResources; private final GrpcOperationsStub operationsStub; @@ -271,20 +390,22 @@ protected GrpcAssetServiceStub( .setMethodDescriptor(exportAssetsMethodDescriptor) .setParamsExtractor( request -> { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("parent", String.valueOf(request.getParent())); - return params.build(); + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); }) + .setResourceNameExtractor(request -> request.getParent()) .build(); GrpcCallSettings listAssetsTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(listAssetsMethodDescriptor) .setParamsExtractor( request -> { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("parent", String.valueOf(request.getParent())); - return params.build(); + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); }) + .setResourceNameExtractor(request -> request.getParent()) .build(); GrpcCallSettings batchGetAssetsHistoryTransportSettings = @@ -293,19 +414,20 @@ protected GrpcAssetServiceStub( .setMethodDescriptor(batchGetAssetsHistoryMethodDescriptor) .setParamsExtractor( request -> { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("parent", String.valueOf(request.getParent())); - return params.build(); + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); }) + .setResourceNameExtractor(request -> request.getParent()) .build(); GrpcCallSettings createFeedTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(createFeedMethodDescriptor) .setParamsExtractor( request -> { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("parent", String.valueOf(request.getParent())); - return params.build(); + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); }) .build(); GrpcCallSettings getFeedTransportSettings = @@ -313,19 +435,20 @@ protected GrpcAssetServiceStub( .setMethodDescriptor(getFeedMethodDescriptor) .setParamsExtractor( request -> { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("name", String.valueOf(request.getName())); - return params.build(); + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); }) + .setResourceNameExtractor(request -> request.getName()) .build(); GrpcCallSettings listFeedsTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(listFeedsMethodDescriptor) .setParamsExtractor( request -> { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("parent", String.valueOf(request.getParent())); - return params.build(); + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); }) .build(); GrpcCallSettings updateFeedTransportSettings = @@ -333,9 +456,9 @@ protected GrpcAssetServiceStub( .setMethodDescriptor(updateFeedMethodDescriptor) .setParamsExtractor( request -> { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("feed.name", String.valueOf(request.getFeed().getName())); - return params.build(); + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("feed.name", String.valueOf(request.getFeed().getName())); + return builder.build(); }) .build(); GrpcCallSettings deleteFeedTransportSettings = @@ -343,10 +466,11 @@ protected GrpcAssetServiceStub( .setMethodDescriptor(deleteFeedMethodDescriptor) .setParamsExtractor( request -> { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("name", String.valueOf(request.getName())); - return params.build(); + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); }) + .setResourceNameExtractor(request -> request.getName()) .build(); GrpcCallSettings searchAllResourcesTransportSettings = @@ -354,9 +478,9 @@ protected GrpcAssetServiceStub( .setMethodDescriptor(searchAllResourcesMethodDescriptor) .setParamsExtractor( request -> { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("scope", String.valueOf(request.getScope())); - return params.build(); + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("scope", String.valueOf(request.getScope())); + return builder.build(); }) .build(); GrpcCallSettings @@ -365,9 +489,9 @@ protected GrpcAssetServiceStub( .setMethodDescriptor(searchAllIamPoliciesMethodDescriptor) .setParamsExtractor( request -> { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("scope", String.valueOf(request.getScope())); - return params.build(); + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("scope", String.valueOf(request.getScope())); + return builder.build(); }) .build(); GrpcCallSettings @@ -376,11 +500,11 @@ protected GrpcAssetServiceStub( .setMethodDescriptor(analyzeIamPolicyMethodDescriptor) .setParamsExtractor( request -> { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put( + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add( "analysis_query.scope", String.valueOf(request.getAnalysisQuery().getScope())); - return params.build(); + return builder.build(); }) .build(); GrpcCallSettings @@ -389,11 +513,11 @@ protected GrpcAssetServiceStub( .setMethodDescriptor(analyzeIamPolicyLongrunningMethodDescriptor) .setParamsExtractor( request -> { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put( + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add( "analysis_query.scope", String.valueOf(request.getAnalysisQuery().getScope())); - return params.build(); + return builder.build(); }) .build(); GrpcCallSettings analyzeMoveTransportSettings = @@ -401,11 +525,92 @@ protected GrpcAssetServiceStub( .setMethodDescriptor(analyzeMoveMethodDescriptor) .setParamsExtractor( request -> { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("resource", String.valueOf(request.getResource())); - return params.build(); + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("resource", String.valueOf(request.getResource())); + return builder.build(); + }) + .build(); + GrpcCallSettings queryAssetsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(queryAssetsMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .setResourceNameExtractor(request -> request.getParent()) + .build(); + GrpcCallSettings createSavedQueryTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(createSavedQueryMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .setResourceNameExtractor(request -> request.getParent()) + .build(); + GrpcCallSettings getSavedQueryTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getSavedQueryMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .setResourceNameExtractor(request -> request.getName()) + .build(); + GrpcCallSettings + listSavedQueriesTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(listSavedQueriesMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .setResourceNameExtractor(request -> request.getParent()) + .build(); + GrpcCallSettings updateSavedQueryTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(updateSavedQueryMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add( + "saved_query.name", String.valueOf(request.getSavedQuery().getName())); + return builder.build(); + }) + .build(); + GrpcCallSettings deleteSavedQueryTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(deleteSavedQueryMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); }) + .setResourceNameExtractor(request -> request.getName()) .build(); + GrpcCallSettings + batchGetEffectiveIamPoliciesTransportSettings = + GrpcCallSettings + . + newBuilder() + .setMethodDescriptor(batchGetEffectiveIamPoliciesMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("scope", String.valueOf(request.getScope())); + return builder.build(); + }) + .setResourceNameExtractor(request -> request.getScope()) + .build(); this.exportAssetsCallable = callableFactory.createUnaryCallable( @@ -479,6 +684,32 @@ protected GrpcAssetServiceStub( this.analyzeMoveCallable = callableFactory.createUnaryCallable( analyzeMoveTransportSettings, settings.analyzeMoveSettings(), clientContext); + this.queryAssetsCallable = + callableFactory.createUnaryCallable( + queryAssetsTransportSettings, settings.queryAssetsSettings(), clientContext); + this.createSavedQueryCallable = + callableFactory.createUnaryCallable( + createSavedQueryTransportSettings, settings.createSavedQuerySettings(), clientContext); + this.getSavedQueryCallable = + callableFactory.createUnaryCallable( + getSavedQueryTransportSettings, settings.getSavedQuerySettings(), clientContext); + this.listSavedQueriesCallable = + callableFactory.createUnaryCallable( + listSavedQueriesTransportSettings, settings.listSavedQueriesSettings(), clientContext); + this.listSavedQueriesPagedCallable = + callableFactory.createPagedCallable( + listSavedQueriesTransportSettings, settings.listSavedQueriesSettings(), clientContext); + this.updateSavedQueryCallable = + callableFactory.createUnaryCallable( + updateSavedQueryTransportSettings, settings.updateSavedQuerySettings(), clientContext); + this.deleteSavedQueryCallable = + callableFactory.createUnaryCallable( + deleteSavedQueryTransportSettings, settings.deleteSavedQuerySettings(), clientContext); + this.batchGetEffectiveIamPoliciesCallable = + callableFactory.createUnaryCallable( + batchGetEffectiveIamPoliciesTransportSettings, + settings.batchGetEffectiveIamPoliciesSettings(), + clientContext); this.backgroundResources = new BackgroundResourceAggregation(clientContext.getBackgroundResources()); @@ -590,6 +821,49 @@ public UnaryCallable analyzeMoveCallabl return analyzeMoveCallable; } + @Override + public UnaryCallable queryAssetsCallable() { + return queryAssetsCallable; + } + + @Override + public UnaryCallable createSavedQueryCallable() { + return createSavedQueryCallable; + } + + @Override + public UnaryCallable getSavedQueryCallable() { + return getSavedQueryCallable; + } + + @Override + public UnaryCallable + listSavedQueriesCallable() { + return listSavedQueriesCallable; + } + + @Override + public UnaryCallable + listSavedQueriesPagedCallable() { + return listSavedQueriesPagedCallable; + } + + @Override + public UnaryCallable updateSavedQueryCallable() { + return updateSavedQueryCallable; + } + + @Override + public UnaryCallable deleteSavedQueryCallable() { + return deleteSavedQueryCallable; + } + + @Override + public UnaryCallable + batchGetEffectiveIamPoliciesCallable() { + return batchGetEffectiveIamPoliciesCallable; + } + @Override public final void close() { try { diff --git a/test/integration/goldens/asset/src/com/google/cloud/asset/v1/stub/HttpJsonAssetServiceCallableFactory.java b/test/integration/goldens/asset/src/com/google/cloud/asset/v1/stub/HttpJsonAssetServiceCallableFactory.java new file mode 100644 index 0000000000..3e0878845a --- /dev/null +++ b/test/integration/goldens/asset/src/com/google/cloud/asset/v1/stub/HttpJsonAssetServiceCallableFactory.java @@ -0,0 +1,101 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS 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.asset.v1.stub; + +import com.google.api.gax.httpjson.HttpJsonCallSettings; +import com.google.api.gax.httpjson.HttpJsonCallableFactory; +import com.google.api.gax.httpjson.HttpJsonOperationSnapshotCallable; +import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; +import com.google.api.gax.httpjson.longrunning.stub.OperationsStub; +import com.google.api.gax.rpc.BatchingCallSettings; +import com.google.api.gax.rpc.ClientContext; +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.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.longrunning.Operation; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * REST callable factory implementation for the AssetService service API. + * + *

        This class is for advanced usage. + */ +@Generated("by gapic-generator-java") +public class HttpJsonAssetServiceCallableFactory + implements HttpJsonStubCallableFactory { + + @Override + public UnaryCallable createUnaryCallable( + HttpJsonCallSettings httpJsonCallSettings, + UnaryCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createUnaryCallable( + httpJsonCallSettings, callSettings, clientContext); + } + + @Override + public + UnaryCallable createPagedCallable( + HttpJsonCallSettings httpJsonCallSettings, + PagedCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createPagedCallable( + httpJsonCallSettings, callSettings, clientContext); + } + + @Override + public UnaryCallable createBatchingCallable( + HttpJsonCallSettings httpJsonCallSettings, + BatchingCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createBatchingCallable( + httpJsonCallSettings, callSettings, clientContext); + } + + @Override + public + OperationCallable createOperationCallable( + HttpJsonCallSettings httpJsonCallSettings, + OperationCallSettings callSettings, + ClientContext clientContext, + OperationsStub operationsStub) { + UnaryCallable innerCallable = + HttpJsonCallableFactory.createBaseUnaryCallable( + httpJsonCallSettings, callSettings.getInitialCallSettings(), clientContext); + HttpJsonOperationSnapshotCallable initialCallable = + new HttpJsonOperationSnapshotCallable( + innerCallable, + httpJsonCallSettings.getMethodDescriptor().getOperationSnapshotFactory()); + return HttpJsonCallableFactory.createOperationCallable( + callSettings, clientContext, operationsStub.longRunningClient(), initialCallable); + } + + @Override + public + ServerStreamingCallable createServerStreamingCallable( + HttpJsonCallSettings httpJsonCallSettings, + ServerStreamingCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createServerStreamingCallable( + httpJsonCallSettings, callSettings, clientContext); + } +} diff --git a/test/integration/goldens/asset/src/com/google/cloud/asset/v1/stub/HttpJsonAssetServiceStub.java b/test/integration/goldens/asset/src/com/google/cloud/asset/v1/stub/HttpJsonAssetServiceStub.java new file mode 100644 index 0000000000..9c6b1aa24e --- /dev/null +++ b/test/integration/goldens/asset/src/com/google/cloud/asset/v1/stub/HttpJsonAssetServiceStub.java @@ -0,0 +1,1514 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS 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.asset.v1.stub; + +import static com.google.cloud.asset.v1.AssetServiceClient.ListAssetsPagedResponse; +import static com.google.cloud.asset.v1.AssetServiceClient.ListSavedQueriesPagedResponse; +import static com.google.cloud.asset.v1.AssetServiceClient.SearchAllIamPoliciesPagedResponse; +import static com.google.cloud.asset.v1.AssetServiceClient.SearchAllResourcesPagedResponse; + +import com.google.api.core.InternalApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.httpjson.ApiMethodDescriptor; +import com.google.api.gax.httpjson.HttpJsonCallSettings; +import com.google.api.gax.httpjson.HttpJsonOperationSnapshot; +import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; +import com.google.api.gax.httpjson.ProtoMessageRequestFormatter; +import com.google.api.gax.httpjson.ProtoMessageResponseParser; +import com.google.api.gax.httpjson.ProtoRestSerializer; +import com.google.api.gax.httpjson.longrunning.stub.HttpJsonOperationsStub; +import com.google.api.gax.longrunning.OperationSnapshot; +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.cloud.asset.v1.AnalyzeIamPolicyLongrunningMetadata; +import com.google.cloud.asset.v1.AnalyzeIamPolicyLongrunningRequest; +import com.google.cloud.asset.v1.AnalyzeIamPolicyLongrunningResponse; +import com.google.cloud.asset.v1.AnalyzeIamPolicyRequest; +import com.google.cloud.asset.v1.AnalyzeIamPolicyResponse; +import com.google.cloud.asset.v1.AnalyzeMoveRequest; +import com.google.cloud.asset.v1.AnalyzeMoveResponse; +import com.google.cloud.asset.v1.BatchGetAssetsHistoryRequest; +import com.google.cloud.asset.v1.BatchGetAssetsHistoryResponse; +import com.google.cloud.asset.v1.BatchGetEffectiveIamPoliciesRequest; +import com.google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse; +import com.google.cloud.asset.v1.CreateFeedRequest; +import com.google.cloud.asset.v1.CreateSavedQueryRequest; +import com.google.cloud.asset.v1.DeleteFeedRequest; +import com.google.cloud.asset.v1.DeleteSavedQueryRequest; +import com.google.cloud.asset.v1.ExportAssetsRequest; +import com.google.cloud.asset.v1.ExportAssetsResponse; +import com.google.cloud.asset.v1.Feed; +import com.google.cloud.asset.v1.GetFeedRequest; +import com.google.cloud.asset.v1.GetSavedQueryRequest; +import com.google.cloud.asset.v1.ListAssetsRequest; +import com.google.cloud.asset.v1.ListAssetsResponse; +import com.google.cloud.asset.v1.ListFeedsRequest; +import com.google.cloud.asset.v1.ListFeedsResponse; +import com.google.cloud.asset.v1.ListSavedQueriesRequest; +import com.google.cloud.asset.v1.ListSavedQueriesResponse; +import com.google.cloud.asset.v1.QueryAssetsRequest; +import com.google.cloud.asset.v1.QueryAssetsResponse; +import com.google.cloud.asset.v1.SavedQuery; +import com.google.cloud.asset.v1.SearchAllIamPoliciesRequest; +import com.google.cloud.asset.v1.SearchAllIamPoliciesResponse; +import com.google.cloud.asset.v1.SearchAllResourcesRequest; +import com.google.cloud.asset.v1.SearchAllResourcesResponse; +import com.google.cloud.asset.v1.UpdateFeedRequest; +import com.google.cloud.asset.v1.UpdateSavedQueryRequest; +import com.google.longrunning.Operation; +import com.google.protobuf.Empty; +import com.google.protobuf.TypeRegistry; +import java.io.IOException; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * REST stub implementation for the AssetService service API. + * + *

        This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by gapic-generator-java") +public class HttpJsonAssetServiceStub extends AssetServiceStub { + private static final TypeRegistry typeRegistry = + TypeRegistry.newBuilder() + .add(AnalyzeIamPolicyLongrunningMetadata.getDescriptor()) + .add(ExportAssetsResponse.getDescriptor()) + .add(AnalyzeIamPolicyLongrunningResponse.getDescriptor()) + .add(ExportAssetsRequest.getDescriptor()) + .build(); + + private static final ApiMethodDescriptor + exportAssetsMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.asset.v1.AssetService/ExportAssets") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{parent=*/*}:exportAssets", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "parent", request.getParent()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("*", request.toBuilder().clearParent().build(), true)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Operation.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .setOperationSnapshotFactory( + (ExportAssetsRequest request, Operation response) -> + HttpJsonOperationSnapshot.create(response)) + .build(); + + private static final ApiMethodDescriptor + listAssetsMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.asset.v1.AssetService/ListAssets") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{parent=*/*}/assets", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "parent", request.getParent()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam( + fields, "assetTypes", request.getAssetTypesList()); + serializer.putQueryParam( + fields, "contentType", request.getContentTypeValue()); + serializer.putQueryParam(fields, "pageSize", request.getPageSize()); + serializer.putQueryParam(fields, "pageToken", request.getPageToken()); + serializer.putQueryParam(fields, "readTime", request.getReadTime()); + serializer.putQueryParam( + fields, "relationshipTypes", request.getRelationshipTypesList()); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(ListAssetsResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor< + BatchGetAssetsHistoryRequest, BatchGetAssetsHistoryResponse> + batchGetAssetsHistoryMethodDescriptor = + ApiMethodDescriptor + .newBuilder() + .setFullMethodName("google.cloud.asset.v1.AssetService/BatchGetAssetsHistory") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{parent=*/*}:batchGetAssetsHistory", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "parent", request.getParent()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam( + fields, "assetNames", request.getAssetNamesList()); + serializer.putQueryParam( + fields, "contentType", request.getContentTypeValue()); + serializer.putQueryParam( + fields, "readTimeWindow", request.getReadTimeWindow()); + serializer.putQueryParam( + fields, "relationshipTypes", request.getRelationshipTypesList()); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(BatchGetAssetsHistoryResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor createFeedMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.asset.v1.AssetService/CreateFeed") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{parent=*/*}/feeds", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "parent", request.getParent()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("*", request.toBuilder().clearParent().build(), true)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Feed.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor getFeedMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.asset.v1.AssetService/GetFeed") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{name=*/*/feeds/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Feed.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + listFeedsMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.asset.v1.AssetService/ListFeeds") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{parent=*/*}/feeds", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "parent", request.getParent()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(ListFeedsResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor updateFeedMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.asset.v1.AssetService/UpdateFeed") + .setHttpMethod("PATCH") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{feed.name=*/*/feeds/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "feed.name", request.getFeed().getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("*", request.toBuilder().build(), true)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Feed.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor deleteFeedMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.asset.v1.AssetService/DeleteFeed") + .setHttpMethod("DELETE") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{name=*/*/feeds/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Empty.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + searchAllResourcesMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.asset.v1.AssetService/SearchAllResources") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{scope=*/*}:searchAllResources", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "scope", request.getScope()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam( + fields, "assetTypes", request.getAssetTypesList()); + serializer.putQueryParam(fields, "orderBy", request.getOrderBy()); + serializer.putQueryParam(fields, "pageSize", request.getPageSize()); + serializer.putQueryParam(fields, "pageToken", request.getPageToken()); + serializer.putQueryParam(fields, "query", request.getQuery()); + serializer.putQueryParam(fields, "readMask", request.getReadMask()); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(SearchAllResourcesResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor< + SearchAllIamPoliciesRequest, SearchAllIamPoliciesResponse> + searchAllIamPoliciesMethodDescriptor = + ApiMethodDescriptor + .newBuilder() + .setFullMethodName("google.cloud.asset.v1.AssetService/SearchAllIamPolicies") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{scope=*/*}:searchAllIamPolicies", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "scope", request.getScope()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam( + fields, "assetTypes", request.getAssetTypesList()); + serializer.putQueryParam(fields, "orderBy", request.getOrderBy()); + serializer.putQueryParam(fields, "pageSize", request.getPageSize()); + serializer.putQueryParam(fields, "pageToken", request.getPageToken()); + serializer.putQueryParam(fields, "query", request.getQuery()); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(SearchAllIamPoliciesResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + analyzeIamPolicyMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.asset.v1.AssetService/AnalyzeIamPolicy") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{analysisQuery.scope=*/*}:analyzeIamPolicy", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam( + fields, + "analysisQuery.scope", + request.getAnalysisQuery().getScope()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam( + fields, "analysisQuery", request.getAnalysisQuery()); + serializer.putQueryParam( + fields, "executionTimeout", request.getExecutionTimeout()); + serializer.putQueryParam( + fields, "savedAnalysisQuery", request.getSavedAnalysisQuery()); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(AnalyzeIamPolicyResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + analyzeIamPolicyLongrunningMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.asset.v1.AssetService/AnalyzeIamPolicyLongrunning") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{analysisQuery.scope=*/*}:analyzeIamPolicyLongrunning", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam( + fields, + "analysisQuery.scope", + request.getAnalysisQuery().getScope()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("*", request.toBuilder().build(), true)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Operation.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .setOperationSnapshotFactory( + (AnalyzeIamPolicyLongrunningRequest request, Operation response) -> + HttpJsonOperationSnapshot.create(response)) + .build(); + + private static final ApiMethodDescriptor + analyzeMoveMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.asset.v1.AssetService/AnalyzeMove") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{resource=*/*}:analyzeMove", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "resource", request.getResource()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam( + fields, "destinationParent", request.getDestinationParent()); + serializer.putQueryParam(fields, "view", request.getViewValue()); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(AnalyzeMoveResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + queryAssetsMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.asset.v1.AssetService/QueryAssets") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{parent=*/*}:queryAssets", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "parent", request.getParent()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("*", request.toBuilder().clearParent().build(), true)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(QueryAssetsResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + createSavedQueryMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.asset.v1.AssetService/CreateSavedQuery") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{parent=*/*}/savedQueries", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "parent", request.getParent()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam( + fields, "savedQueryId", request.getSavedQueryId()); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("savedQuery", request.getSavedQuery(), true)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(SavedQuery.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + getSavedQueryMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.asset.v1.AssetService/GetSavedQuery") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{name=*/*/savedQueries/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(SavedQuery.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + listSavedQueriesMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.asset.v1.AssetService/ListSavedQueries") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{parent=*/*}/savedQueries", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "parent", request.getParent()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "filter", request.getFilter()); + serializer.putQueryParam(fields, "pageSize", request.getPageSize()); + serializer.putQueryParam(fields, "pageToken", request.getPageToken()); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(ListSavedQueriesResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + updateSavedQueryMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.asset.v1.AssetService/UpdateSavedQuery") + .setHttpMethod("PATCH") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{savedQuery.name=*/*/savedQueries/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam( + fields, "savedQuery.name", request.getSavedQuery().getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "updateMask", request.getUpdateMask()); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("savedQuery", request.getSavedQuery(), true)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(SavedQuery.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + deleteSavedQueryMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.asset.v1.AssetService/DeleteSavedQuery") + .setHttpMethod("DELETE") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{name=*/*/savedQueries/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Empty.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor< + BatchGetEffectiveIamPoliciesRequest, BatchGetEffectiveIamPoliciesResponse> + batchGetEffectiveIamPoliciesMethodDescriptor = + ApiMethodDescriptor + . + newBuilder() + .setFullMethodName("google.cloud.asset.v1.AssetService/BatchGetEffectiveIamPolicies") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{scope=*/*}/effectiveIamPolicies:batchGet", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "scope", request.getScope()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "names", request.getNamesList()); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(BatchGetEffectiveIamPoliciesResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private final UnaryCallable exportAssetsCallable; + private final OperationCallable + exportAssetsOperationCallable; + private final UnaryCallable listAssetsCallable; + private final UnaryCallable listAssetsPagedCallable; + private final UnaryCallable + batchGetAssetsHistoryCallable; + private final UnaryCallable createFeedCallable; + private final UnaryCallable getFeedCallable; + private final UnaryCallable listFeedsCallable; + private final UnaryCallable updateFeedCallable; + private final UnaryCallable deleteFeedCallable; + private final UnaryCallable + searchAllResourcesCallable; + private final UnaryCallable + searchAllResourcesPagedCallable; + private final UnaryCallable + searchAllIamPoliciesCallable; + private final UnaryCallable + searchAllIamPoliciesPagedCallable; + private final UnaryCallable + analyzeIamPolicyCallable; + private final UnaryCallable + analyzeIamPolicyLongrunningCallable; + private final OperationCallable< + AnalyzeIamPolicyLongrunningRequest, + AnalyzeIamPolicyLongrunningResponse, + AnalyzeIamPolicyLongrunningMetadata> + analyzeIamPolicyLongrunningOperationCallable; + private final UnaryCallable analyzeMoveCallable; + private final UnaryCallable queryAssetsCallable; + private final UnaryCallable createSavedQueryCallable; + private final UnaryCallable getSavedQueryCallable; + private final UnaryCallable + listSavedQueriesCallable; + private final UnaryCallable + listSavedQueriesPagedCallable; + private final UnaryCallable updateSavedQueryCallable; + private final UnaryCallable deleteSavedQueryCallable; + private final UnaryCallable< + BatchGetEffectiveIamPoliciesRequest, BatchGetEffectiveIamPoliciesResponse> + batchGetEffectiveIamPoliciesCallable; + + private final BackgroundResource backgroundResources; + private final HttpJsonOperationsStub httpJsonOperationsStub; + private final HttpJsonStubCallableFactory callableFactory; + + public static final HttpJsonAssetServiceStub create(AssetServiceStubSettings settings) + throws IOException { + return new HttpJsonAssetServiceStub(settings, ClientContext.create(settings)); + } + + public static final HttpJsonAssetServiceStub create(ClientContext clientContext) + throws IOException { + return new HttpJsonAssetServiceStub( + AssetServiceStubSettings.newHttpJsonBuilder().build(), clientContext); + } + + public static final HttpJsonAssetServiceStub create( + ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { + return new HttpJsonAssetServiceStub( + AssetServiceStubSettings.newHttpJsonBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of HttpJsonAssetServiceStub, 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 HttpJsonAssetServiceStub(AssetServiceStubSettings settings, ClientContext clientContext) + throws IOException { + this(settings, clientContext, new HttpJsonAssetServiceCallableFactory()); + } + + /** + * Constructs an instance of HttpJsonAssetServiceStub, 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 HttpJsonAssetServiceStub( + AssetServiceStubSettings settings, + ClientContext clientContext, + HttpJsonStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + this.httpJsonOperationsStub = + HttpJsonOperationsStub.create(clientContext, callableFactory, typeRegistry); + + HttpJsonCallSettings exportAssetsTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(exportAssetsMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .setResourceNameExtractor(request -> request.getParent()) + .build(); + HttpJsonCallSettings listAssetsTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(listAssetsMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .setResourceNameExtractor(request -> request.getParent()) + .build(); + HttpJsonCallSettings + batchGetAssetsHistoryTransportSettings = + HttpJsonCallSettings + .newBuilder() + .setMethodDescriptor(batchGetAssetsHistoryMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .setResourceNameExtractor(request -> request.getParent()) + .build(); + HttpJsonCallSettings createFeedTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(createFeedMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings getFeedTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getFeedMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .setResourceNameExtractor(request -> request.getName()) + .build(); + HttpJsonCallSettings listFeedsTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(listFeedsMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings updateFeedTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(updateFeedMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("feed.name", String.valueOf(request.getFeed().getName())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings deleteFeedTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(deleteFeedMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .setResourceNameExtractor(request -> request.getName()) + .build(); + HttpJsonCallSettings + searchAllResourcesTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(searchAllResourcesMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("scope", String.valueOf(request.getScope())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings + searchAllIamPoliciesTransportSettings = + HttpJsonCallSettings + .newBuilder() + .setMethodDescriptor(searchAllIamPoliciesMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("scope", String.valueOf(request.getScope())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings + analyzeIamPolicyTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(analyzeIamPolicyMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add( + "analysis_query.scope", + String.valueOf(request.getAnalysisQuery().getScope())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings + analyzeIamPolicyLongrunningTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(analyzeIamPolicyLongrunningMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add( + "analysis_query.scope", + String.valueOf(request.getAnalysisQuery().getScope())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings analyzeMoveTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(analyzeMoveMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("resource", String.valueOf(request.getResource())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings queryAssetsTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(queryAssetsMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .setResourceNameExtractor(request -> request.getParent()) + .build(); + HttpJsonCallSettings createSavedQueryTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(createSavedQueryMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .setResourceNameExtractor(request -> request.getParent()) + .build(); + HttpJsonCallSettings getSavedQueryTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getSavedQueryMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .setResourceNameExtractor(request -> request.getName()) + .build(); + HttpJsonCallSettings + listSavedQueriesTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(listSavedQueriesMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .setResourceNameExtractor(request -> request.getParent()) + .build(); + HttpJsonCallSettings updateSavedQueryTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(updateSavedQueryMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add( + "saved_query.name", String.valueOf(request.getSavedQuery().getName())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings deleteSavedQueryTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(deleteSavedQueryMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .setResourceNameExtractor(request -> request.getName()) + .build(); + HttpJsonCallSettings + batchGetEffectiveIamPoliciesTransportSettings = + HttpJsonCallSettings + . + newBuilder() + .setMethodDescriptor(batchGetEffectiveIamPoliciesMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("scope", String.valueOf(request.getScope())); + return builder.build(); + }) + .setResourceNameExtractor(request -> request.getScope()) + .build(); + + this.exportAssetsCallable = + callableFactory.createUnaryCallable( + exportAssetsTransportSettings, settings.exportAssetsSettings(), clientContext); + this.exportAssetsOperationCallable = + callableFactory.createOperationCallable( + exportAssetsTransportSettings, + settings.exportAssetsOperationSettings(), + clientContext, + httpJsonOperationsStub); + this.listAssetsCallable = + callableFactory.createUnaryCallable( + listAssetsTransportSettings, settings.listAssetsSettings(), clientContext); + this.listAssetsPagedCallable = + callableFactory.createPagedCallable( + listAssetsTransportSettings, settings.listAssetsSettings(), clientContext); + this.batchGetAssetsHistoryCallable = + callableFactory.createUnaryCallable( + batchGetAssetsHistoryTransportSettings, + settings.batchGetAssetsHistorySettings(), + clientContext); + this.createFeedCallable = + callableFactory.createUnaryCallable( + createFeedTransportSettings, settings.createFeedSettings(), clientContext); + this.getFeedCallable = + callableFactory.createUnaryCallable( + getFeedTransportSettings, settings.getFeedSettings(), clientContext); + this.listFeedsCallable = + callableFactory.createUnaryCallable( + listFeedsTransportSettings, settings.listFeedsSettings(), clientContext); + this.updateFeedCallable = + callableFactory.createUnaryCallable( + updateFeedTransportSettings, settings.updateFeedSettings(), clientContext); + this.deleteFeedCallable = + callableFactory.createUnaryCallable( + deleteFeedTransportSettings, settings.deleteFeedSettings(), clientContext); + this.searchAllResourcesCallable = + callableFactory.createUnaryCallable( + searchAllResourcesTransportSettings, + settings.searchAllResourcesSettings(), + clientContext); + this.searchAllResourcesPagedCallable = + callableFactory.createPagedCallable( + searchAllResourcesTransportSettings, + settings.searchAllResourcesSettings(), + clientContext); + this.searchAllIamPoliciesCallable = + callableFactory.createUnaryCallable( + searchAllIamPoliciesTransportSettings, + settings.searchAllIamPoliciesSettings(), + clientContext); + this.searchAllIamPoliciesPagedCallable = + callableFactory.createPagedCallable( + searchAllIamPoliciesTransportSettings, + settings.searchAllIamPoliciesSettings(), + clientContext); + this.analyzeIamPolicyCallable = + callableFactory.createUnaryCallable( + analyzeIamPolicyTransportSettings, settings.analyzeIamPolicySettings(), clientContext); + this.analyzeIamPolicyLongrunningCallable = + callableFactory.createUnaryCallable( + analyzeIamPolicyLongrunningTransportSettings, + settings.analyzeIamPolicyLongrunningSettings(), + clientContext); + this.analyzeIamPolicyLongrunningOperationCallable = + callableFactory.createOperationCallable( + analyzeIamPolicyLongrunningTransportSettings, + settings.analyzeIamPolicyLongrunningOperationSettings(), + clientContext, + httpJsonOperationsStub); + this.analyzeMoveCallable = + callableFactory.createUnaryCallable( + analyzeMoveTransportSettings, settings.analyzeMoveSettings(), clientContext); + this.queryAssetsCallable = + callableFactory.createUnaryCallable( + queryAssetsTransportSettings, settings.queryAssetsSettings(), clientContext); + this.createSavedQueryCallable = + callableFactory.createUnaryCallable( + createSavedQueryTransportSettings, settings.createSavedQuerySettings(), clientContext); + this.getSavedQueryCallable = + callableFactory.createUnaryCallable( + getSavedQueryTransportSettings, settings.getSavedQuerySettings(), clientContext); + this.listSavedQueriesCallable = + callableFactory.createUnaryCallable( + listSavedQueriesTransportSettings, settings.listSavedQueriesSettings(), clientContext); + this.listSavedQueriesPagedCallable = + callableFactory.createPagedCallable( + listSavedQueriesTransportSettings, settings.listSavedQueriesSettings(), clientContext); + this.updateSavedQueryCallable = + callableFactory.createUnaryCallable( + updateSavedQueryTransportSettings, settings.updateSavedQuerySettings(), clientContext); + this.deleteSavedQueryCallable = + callableFactory.createUnaryCallable( + deleteSavedQueryTransportSettings, settings.deleteSavedQuerySettings(), clientContext); + this.batchGetEffectiveIamPoliciesCallable = + callableFactory.createUnaryCallable( + batchGetEffectiveIamPoliciesTransportSettings, + settings.batchGetEffectiveIamPoliciesSettings(), + clientContext); + + this.backgroundResources = + new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + @InternalApi + public static List getMethodDescriptors() { + List methodDescriptors = new ArrayList<>(); + methodDescriptors.add(exportAssetsMethodDescriptor); + methodDescriptors.add(listAssetsMethodDescriptor); + methodDescriptors.add(batchGetAssetsHistoryMethodDescriptor); + methodDescriptors.add(createFeedMethodDescriptor); + methodDescriptors.add(getFeedMethodDescriptor); + methodDescriptors.add(listFeedsMethodDescriptor); + methodDescriptors.add(updateFeedMethodDescriptor); + methodDescriptors.add(deleteFeedMethodDescriptor); + methodDescriptors.add(searchAllResourcesMethodDescriptor); + methodDescriptors.add(searchAllIamPoliciesMethodDescriptor); + methodDescriptors.add(analyzeIamPolicyMethodDescriptor); + methodDescriptors.add(analyzeIamPolicyLongrunningMethodDescriptor); + methodDescriptors.add(analyzeMoveMethodDescriptor); + methodDescriptors.add(queryAssetsMethodDescriptor); + methodDescriptors.add(createSavedQueryMethodDescriptor); + methodDescriptors.add(getSavedQueryMethodDescriptor); + methodDescriptors.add(listSavedQueriesMethodDescriptor); + methodDescriptors.add(updateSavedQueryMethodDescriptor); + methodDescriptors.add(deleteSavedQueryMethodDescriptor); + methodDescriptors.add(batchGetEffectiveIamPoliciesMethodDescriptor); + return methodDescriptors; + } + + public HttpJsonOperationsStub getHttpJsonOperationsStub() { + return httpJsonOperationsStub; + } + + @Override + public UnaryCallable exportAssetsCallable() { + return exportAssetsCallable; + } + + @Override + public OperationCallable + exportAssetsOperationCallable() { + return exportAssetsOperationCallable; + } + + @Override + public UnaryCallable listAssetsCallable() { + return listAssetsCallable; + } + + @Override + public UnaryCallable listAssetsPagedCallable() { + return listAssetsPagedCallable; + } + + @Override + public UnaryCallable + batchGetAssetsHistoryCallable() { + return batchGetAssetsHistoryCallable; + } + + @Override + public UnaryCallable createFeedCallable() { + return createFeedCallable; + } + + @Override + public UnaryCallable getFeedCallable() { + return getFeedCallable; + } + + @Override + public UnaryCallable listFeedsCallable() { + return listFeedsCallable; + } + + @Override + public UnaryCallable updateFeedCallable() { + return updateFeedCallable; + } + + @Override + public UnaryCallable deleteFeedCallable() { + return deleteFeedCallable; + } + + @Override + public UnaryCallable + searchAllResourcesCallable() { + return searchAllResourcesCallable; + } + + @Override + public UnaryCallable + searchAllResourcesPagedCallable() { + return searchAllResourcesPagedCallable; + } + + @Override + public UnaryCallable + searchAllIamPoliciesCallable() { + return searchAllIamPoliciesCallable; + } + + @Override + public UnaryCallable + searchAllIamPoliciesPagedCallable() { + return searchAllIamPoliciesPagedCallable; + } + + @Override + public UnaryCallable + analyzeIamPolicyCallable() { + return analyzeIamPolicyCallable; + } + + @Override + public UnaryCallable + analyzeIamPolicyLongrunningCallable() { + return analyzeIamPolicyLongrunningCallable; + } + + @Override + public OperationCallable< + AnalyzeIamPolicyLongrunningRequest, + AnalyzeIamPolicyLongrunningResponse, + AnalyzeIamPolicyLongrunningMetadata> + analyzeIamPolicyLongrunningOperationCallable() { + return analyzeIamPolicyLongrunningOperationCallable; + } + + @Override + public UnaryCallable analyzeMoveCallable() { + return analyzeMoveCallable; + } + + @Override + public UnaryCallable queryAssetsCallable() { + return queryAssetsCallable; + } + + @Override + public UnaryCallable createSavedQueryCallable() { + return createSavedQueryCallable; + } + + @Override + public UnaryCallable getSavedQueryCallable() { + return getSavedQueryCallable; + } + + @Override + public UnaryCallable + listSavedQueriesCallable() { + return listSavedQueriesCallable; + } + + @Override + public UnaryCallable + listSavedQueriesPagedCallable() { + return listSavedQueriesPagedCallable; + } + + @Override + public UnaryCallable updateSavedQueryCallable() { + return updateSavedQueryCallable; + } + + @Override + public UnaryCallable deleteSavedQueryCallable() { + return deleteSavedQueryCallable; + } + + @Override + public UnaryCallable + batchGetEffectiveIamPoliciesCallable() { + return batchGetEffectiveIamPoliciesCallable; + } + + @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/test/integration/goldens/asset/src/com/google/cloud/asset/v1/stub/Version.java b/test/integration/goldens/asset/src/com/google/cloud/asset/v1/stub/Version.java new file mode 100644 index 0000000000..b62c82a4ce --- /dev/null +++ b/test/integration/goldens/asset/src/com/google/cloud/asset/v1/stub/Version.java @@ -0,0 +1,27 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS 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.asset.v1.stub; + +import com.google.api.core.InternalApi; + +@InternalApi("For internal use only") +final class Version { + // {x-version-update-start:null:current} + static final String VERSION = "0.0.0-SNAPSHOT"; + // {x-version-update-end} + +} diff --git a/test/integration/goldens/bigtable/samples/snippets/generated/main/java/com/google/cloud/bigtable/data/v2/basebigtabledatasettings/mutaterow/SyncMutateRow.java b/test/integration/goldens/bigtable/samples/snippets/generated/main/java/com/google/cloud/bigtable/data/v2/basebigtabledatasettings/mutaterow/SyncMutateRow.java index 9b3ac3557e..ea2084511a 100644 --- a/test/integration/goldens/bigtable/samples/snippets/generated/main/java/com/google/cloud/bigtable/data/v2/basebigtabledatasettings/mutaterow/SyncMutateRow.java +++ b/test/integration/goldens/bigtable/samples/snippets/generated/main/java/com/google/cloud/bigtable/data/v2/basebigtabledatasettings/mutaterow/SyncMutateRow.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -41,7 +41,14 @@ public static void syncMutateRow() throws Exception { .mutateRowSettings() .getRetrySettings() .toBuilder() - .setTotalTimeout(Duration.ofSeconds(30)) + .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()); BaseBigtableDataSettings baseBigtableDataSettings = baseBigtableDataSettingsBuilder.build(); } diff --git a/test/integration/goldens/bigtable/samples/snippets/generated/main/java/com/google/cloud/bigtable/data/v2/bigtable/checkandmutaterow/AsyncCheckAndMutateRow.java b/test/integration/goldens/bigtable/samples/snippets/generated/main/java/com/google/cloud/bigtable/data/v2/bigtable/checkandmutaterow/AsyncCheckAndMutateRow.java index d7d8937ff7..7873e61bc6 100644 --- a/test/integration/goldens/bigtable/samples/snippets/generated/main/java/com/google/cloud/bigtable/data/v2/bigtable/checkandmutaterow/AsyncCheckAndMutateRow.java +++ b/test/integration/goldens/bigtable/samples/snippets/generated/main/java/com/google/cloud/bigtable/data/v2/bigtable/checkandmutaterow/AsyncCheckAndMutateRow.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/bigtable/samples/snippets/generated/main/java/com/google/cloud/bigtable/data/v2/bigtable/checkandmutaterow/SyncCheckAndMutateRow.java b/test/integration/goldens/bigtable/samples/snippets/generated/main/java/com/google/cloud/bigtable/data/v2/bigtable/checkandmutaterow/SyncCheckAndMutateRow.java index cf3eb73ece..bff0500218 100644 --- a/test/integration/goldens/bigtable/samples/snippets/generated/main/java/com/google/cloud/bigtable/data/v2/bigtable/checkandmutaterow/SyncCheckAndMutateRow.java +++ b/test/integration/goldens/bigtable/samples/snippets/generated/main/java/com/google/cloud/bigtable/data/v2/bigtable/checkandmutaterow/SyncCheckAndMutateRow.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/bigtable/samples/snippets/generated/main/java/com/google/cloud/bigtable/data/v2/bigtable/checkandmutaterow/SyncCheckAndMutateRowStringBytestringRowfilterListmutationListmutation.java b/test/integration/goldens/bigtable/samples/snippets/generated/main/java/com/google/cloud/bigtable/data/v2/bigtable/checkandmutaterow/SyncCheckAndMutateRowStringBytestringRowfilterListmutationListmutation.java index 1951fd7be8..68899c34d2 100644 --- a/test/integration/goldens/bigtable/samples/snippets/generated/main/java/com/google/cloud/bigtable/data/v2/bigtable/checkandmutaterow/SyncCheckAndMutateRowStringBytestringRowfilterListmutationListmutation.java +++ b/test/integration/goldens/bigtable/samples/snippets/generated/main/java/com/google/cloud/bigtable/data/v2/bigtable/checkandmutaterow/SyncCheckAndMutateRowStringBytestringRowfilterListmutationListmutation.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/bigtable/samples/snippets/generated/main/java/com/google/cloud/bigtable/data/v2/bigtable/checkandmutaterow/SyncCheckAndMutateRowStringBytestringRowfilterListmutationListmutationString.java b/test/integration/goldens/bigtable/samples/snippets/generated/main/java/com/google/cloud/bigtable/data/v2/bigtable/checkandmutaterow/SyncCheckAndMutateRowStringBytestringRowfilterListmutationListmutationString.java index 7999251391..5fa9b6e0ae 100644 --- a/test/integration/goldens/bigtable/samples/snippets/generated/main/java/com/google/cloud/bigtable/data/v2/bigtable/checkandmutaterow/SyncCheckAndMutateRowStringBytestringRowfilterListmutationListmutationString.java +++ b/test/integration/goldens/bigtable/samples/snippets/generated/main/java/com/google/cloud/bigtable/data/v2/bigtable/checkandmutaterow/SyncCheckAndMutateRowStringBytestringRowfilterListmutationListmutationString.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/bigtable/samples/snippets/generated/main/java/com/google/cloud/bigtable/data/v2/bigtable/checkandmutaterow/SyncCheckAndMutateRowTablenameBytestringRowfilterListmutationListmutation.java b/test/integration/goldens/bigtable/samples/snippets/generated/main/java/com/google/cloud/bigtable/data/v2/bigtable/checkandmutaterow/SyncCheckAndMutateRowTablenameBytestringRowfilterListmutationListmutation.java index 94b3498d56..4c110f43c0 100644 --- a/test/integration/goldens/bigtable/samples/snippets/generated/main/java/com/google/cloud/bigtable/data/v2/bigtable/checkandmutaterow/SyncCheckAndMutateRowTablenameBytestringRowfilterListmutationListmutation.java +++ b/test/integration/goldens/bigtable/samples/snippets/generated/main/java/com/google/cloud/bigtable/data/v2/bigtable/checkandmutaterow/SyncCheckAndMutateRowTablenameBytestringRowfilterListmutationListmutation.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/bigtable/samples/snippets/generated/main/java/com/google/cloud/bigtable/data/v2/bigtable/checkandmutaterow/SyncCheckAndMutateRowTablenameBytestringRowfilterListmutationListmutationString.java b/test/integration/goldens/bigtable/samples/snippets/generated/main/java/com/google/cloud/bigtable/data/v2/bigtable/checkandmutaterow/SyncCheckAndMutateRowTablenameBytestringRowfilterListmutationListmutationString.java index ae5cef236b..9ed5f5dfa4 100644 --- a/test/integration/goldens/bigtable/samples/snippets/generated/main/java/com/google/cloud/bigtable/data/v2/bigtable/checkandmutaterow/SyncCheckAndMutateRowTablenameBytestringRowfilterListmutationListmutationString.java +++ b/test/integration/goldens/bigtable/samples/snippets/generated/main/java/com/google/cloud/bigtable/data/v2/bigtable/checkandmutaterow/SyncCheckAndMutateRowTablenameBytestringRowfilterListmutationListmutationString.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/bigtable/samples/snippets/generated/main/java/com/google/cloud/bigtable/data/v2/bigtable/create/SyncCreateSetCredentialsProvider.java b/test/integration/goldens/bigtable/samples/snippets/generated/main/java/com/google/cloud/bigtable/data/v2/bigtable/create/SyncCreateSetCredentialsProvider.java index 7f26aef4f9..2f378d0c8c 100644 --- a/test/integration/goldens/bigtable/samples/snippets/generated/main/java/com/google/cloud/bigtable/data/v2/bigtable/create/SyncCreateSetCredentialsProvider.java +++ b/test/integration/goldens/bigtable/samples/snippets/generated/main/java/com/google/cloud/bigtable/data/v2/bigtable/create/SyncCreateSetCredentialsProvider.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/bigtable/samples/snippets/generated/main/java/com/google/cloud/bigtable/data/v2/bigtable/create/SyncCreateSetEndpoint.java b/test/integration/goldens/bigtable/samples/snippets/generated/main/java/com/google/cloud/bigtable/data/v2/bigtable/create/SyncCreateSetEndpoint.java index c1a6d75ae8..1d50f8f743 100644 --- a/test/integration/goldens/bigtable/samples/snippets/generated/main/java/com/google/cloud/bigtable/data/v2/bigtable/create/SyncCreateSetEndpoint.java +++ b/test/integration/goldens/bigtable/samples/snippets/generated/main/java/com/google/cloud/bigtable/data/v2/bigtable/create/SyncCreateSetEndpoint.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/bigtable/samples/snippets/generated/main/java/com/google/cloud/bigtable/data/v2/bigtable/mutaterow/AsyncMutateRow.java b/test/integration/goldens/bigtable/samples/snippets/generated/main/java/com/google/cloud/bigtable/data/v2/bigtable/mutaterow/AsyncMutateRow.java index 7475c57d0a..e992b3fed0 100644 --- a/test/integration/goldens/bigtable/samples/snippets/generated/main/java/com/google/cloud/bigtable/data/v2/bigtable/mutaterow/AsyncMutateRow.java +++ b/test/integration/goldens/bigtable/samples/snippets/generated/main/java/com/google/cloud/bigtable/data/v2/bigtable/mutaterow/AsyncMutateRow.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/bigtable/samples/snippets/generated/main/java/com/google/cloud/bigtable/data/v2/bigtable/mutaterow/SyncMutateRow.java b/test/integration/goldens/bigtable/samples/snippets/generated/main/java/com/google/cloud/bigtable/data/v2/bigtable/mutaterow/SyncMutateRow.java index 1d7439c6ca..61a9c1a812 100644 --- a/test/integration/goldens/bigtable/samples/snippets/generated/main/java/com/google/cloud/bigtable/data/v2/bigtable/mutaterow/SyncMutateRow.java +++ b/test/integration/goldens/bigtable/samples/snippets/generated/main/java/com/google/cloud/bigtable/data/v2/bigtable/mutaterow/SyncMutateRow.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/bigtable/samples/snippets/generated/main/java/com/google/cloud/bigtable/data/v2/bigtable/mutaterow/SyncMutateRowStringBytestringListmutation.java b/test/integration/goldens/bigtable/samples/snippets/generated/main/java/com/google/cloud/bigtable/data/v2/bigtable/mutaterow/SyncMutateRowStringBytestringListmutation.java index 03d7191440..c1269a7a90 100644 --- a/test/integration/goldens/bigtable/samples/snippets/generated/main/java/com/google/cloud/bigtable/data/v2/bigtable/mutaterow/SyncMutateRowStringBytestringListmutation.java +++ b/test/integration/goldens/bigtable/samples/snippets/generated/main/java/com/google/cloud/bigtable/data/v2/bigtable/mutaterow/SyncMutateRowStringBytestringListmutation.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/bigtable/samples/snippets/generated/main/java/com/google/cloud/bigtable/data/v2/bigtable/mutaterow/SyncMutateRowStringBytestringListmutationString.java b/test/integration/goldens/bigtable/samples/snippets/generated/main/java/com/google/cloud/bigtable/data/v2/bigtable/mutaterow/SyncMutateRowStringBytestringListmutationString.java index dc2ce87b85..f520e247cb 100644 --- a/test/integration/goldens/bigtable/samples/snippets/generated/main/java/com/google/cloud/bigtable/data/v2/bigtable/mutaterow/SyncMutateRowStringBytestringListmutationString.java +++ b/test/integration/goldens/bigtable/samples/snippets/generated/main/java/com/google/cloud/bigtable/data/v2/bigtable/mutaterow/SyncMutateRowStringBytestringListmutationString.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/bigtable/samples/snippets/generated/main/java/com/google/cloud/bigtable/data/v2/bigtable/mutaterow/SyncMutateRowTablenameBytestringListmutation.java b/test/integration/goldens/bigtable/samples/snippets/generated/main/java/com/google/cloud/bigtable/data/v2/bigtable/mutaterow/SyncMutateRowTablenameBytestringListmutation.java index bab53b1aa9..1326ab953e 100644 --- a/test/integration/goldens/bigtable/samples/snippets/generated/main/java/com/google/cloud/bigtable/data/v2/bigtable/mutaterow/SyncMutateRowTablenameBytestringListmutation.java +++ b/test/integration/goldens/bigtable/samples/snippets/generated/main/java/com/google/cloud/bigtable/data/v2/bigtable/mutaterow/SyncMutateRowTablenameBytestringListmutation.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/bigtable/samples/snippets/generated/main/java/com/google/cloud/bigtable/data/v2/bigtable/mutaterow/SyncMutateRowTablenameBytestringListmutationString.java b/test/integration/goldens/bigtable/samples/snippets/generated/main/java/com/google/cloud/bigtable/data/v2/bigtable/mutaterow/SyncMutateRowTablenameBytestringListmutationString.java index 3802b87ef1..f7a6467f0c 100644 --- a/test/integration/goldens/bigtable/samples/snippets/generated/main/java/com/google/cloud/bigtable/data/v2/bigtable/mutaterow/SyncMutateRowTablenameBytestringListmutationString.java +++ b/test/integration/goldens/bigtable/samples/snippets/generated/main/java/com/google/cloud/bigtable/data/v2/bigtable/mutaterow/SyncMutateRowTablenameBytestringListmutationString.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/bigtable/samples/snippets/generated/main/java/com/google/cloud/bigtable/data/v2/bigtable/mutaterows/AsyncMutateRows.java b/test/integration/goldens/bigtable/samples/snippets/generated/main/java/com/google/cloud/bigtable/data/v2/bigtable/mutaterows/AsyncMutateRows.java index 452920dccf..51b4a59dc4 100644 --- a/test/integration/goldens/bigtable/samples/snippets/generated/main/java/com/google/cloud/bigtable/data/v2/bigtable/mutaterows/AsyncMutateRows.java +++ b/test/integration/goldens/bigtable/samples/snippets/generated/main/java/com/google/cloud/bigtable/data/v2/bigtable/mutaterows/AsyncMutateRows.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/bigtable/samples/snippets/generated/main/java/com/google/cloud/bigtable/data/v2/bigtable/pingandwarm/AsyncPingAndWarm.java b/test/integration/goldens/bigtable/samples/snippets/generated/main/java/com/google/cloud/bigtable/data/v2/bigtable/pingandwarm/AsyncPingAndWarm.java new file mode 100644 index 0000000000..8541385886 --- /dev/null +++ b/test/integration/goldens/bigtable/samples/snippets/generated/main/java/com/google/cloud/bigtable/data/v2/bigtable/pingandwarm/AsyncPingAndWarm.java @@ -0,0 +1,51 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS 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.bigtable.data.v2.samples; + +// [START bigtable_v2_generated_Bigtable_PingAndWarm_async] +import com.google.api.core.ApiFuture; +import com.google.bigtable.v2.InstanceName; +import com.google.bigtable.v2.PingAndWarmRequest; +import com.google.bigtable.v2.PingAndWarmResponse; +import com.google.cloud.bigtable.data.v2.BaseBigtableDataClient; + +public class AsyncPingAndWarm { + + public static void main(String[] args) throws Exception { + asyncPingAndWarm(); + } + + public static void asyncPingAndWarm() 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 (BaseBigtableDataClient baseBigtableDataClient = BaseBigtableDataClient.create()) { + PingAndWarmRequest request = + PingAndWarmRequest.newBuilder() + .setName(InstanceName.of("[PROJECT]", "[INSTANCE]").toString()) + .setAppProfileId("appProfileId704923523") + .build(); + ApiFuture future = + baseBigtableDataClient.pingAndWarmCallable().futureCall(request); + // Do something. + PingAndWarmResponse response = future.get(); + } + } +} +// [END bigtable_v2_generated_Bigtable_PingAndWarm_async] diff --git a/test/integration/goldens/bigtable/samples/snippets/generated/main/java/com/google/cloud/bigtable/data/v2/bigtable/pingandwarm/SyncPingAndWarm.java b/test/integration/goldens/bigtable/samples/snippets/generated/main/java/com/google/cloud/bigtable/data/v2/bigtable/pingandwarm/SyncPingAndWarm.java new file mode 100644 index 0000000000..eb1bb0720d --- /dev/null +++ b/test/integration/goldens/bigtable/samples/snippets/generated/main/java/com/google/cloud/bigtable/data/v2/bigtable/pingandwarm/SyncPingAndWarm.java @@ -0,0 +1,47 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS 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.bigtable.data.v2.samples; + +// [START bigtable_v2_generated_Bigtable_PingAndWarm_sync] +import com.google.bigtable.v2.InstanceName; +import com.google.bigtable.v2.PingAndWarmRequest; +import com.google.bigtable.v2.PingAndWarmResponse; +import com.google.cloud.bigtable.data.v2.BaseBigtableDataClient; + +public class SyncPingAndWarm { + + public static void main(String[] args) throws Exception { + syncPingAndWarm(); + } + + public static void syncPingAndWarm() 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 (BaseBigtableDataClient baseBigtableDataClient = BaseBigtableDataClient.create()) { + PingAndWarmRequest request = + PingAndWarmRequest.newBuilder() + .setName(InstanceName.of("[PROJECT]", "[INSTANCE]").toString()) + .setAppProfileId("appProfileId704923523") + .build(); + PingAndWarmResponse response = baseBigtableDataClient.pingAndWarm(request); + } + } +} +// [END bigtable_v2_generated_Bigtable_PingAndWarm_sync] diff --git a/test/integration/goldens/bigtable/samples/snippets/generated/main/java/com/google/cloud/bigtable/data/v2/bigtable/pingandwarm/SyncPingAndWarmInstancename.java b/test/integration/goldens/bigtable/samples/snippets/generated/main/java/com/google/cloud/bigtable/data/v2/bigtable/pingandwarm/SyncPingAndWarmInstancename.java new file mode 100644 index 0000000000..5c9181e335 --- /dev/null +++ b/test/integration/goldens/bigtable/samples/snippets/generated/main/java/com/google/cloud/bigtable/data/v2/bigtable/pingandwarm/SyncPingAndWarmInstancename.java @@ -0,0 +1,42 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS 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.bigtable.data.v2.samples; + +// [START bigtable_v2_generated_Bigtable_PingAndWarm_Instancename_sync] +import com.google.bigtable.v2.InstanceName; +import com.google.bigtable.v2.PingAndWarmResponse; +import com.google.cloud.bigtable.data.v2.BaseBigtableDataClient; + +public class SyncPingAndWarmInstancename { + + public static void main(String[] args) throws Exception { + syncPingAndWarmInstancename(); + } + + public static void syncPingAndWarmInstancename() 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 (BaseBigtableDataClient baseBigtableDataClient = BaseBigtableDataClient.create()) { + InstanceName name = InstanceName.of("[PROJECT]", "[INSTANCE]"); + PingAndWarmResponse response = baseBigtableDataClient.pingAndWarm(name); + } + } +} +// [END bigtable_v2_generated_Bigtable_PingAndWarm_Instancename_sync] diff --git a/test/integration/goldens/bigtable/samples/snippets/generated/main/java/com/google/cloud/bigtable/data/v2/bigtable/pingandwarm/SyncPingAndWarmInstancenameString.java b/test/integration/goldens/bigtable/samples/snippets/generated/main/java/com/google/cloud/bigtable/data/v2/bigtable/pingandwarm/SyncPingAndWarmInstancenameString.java new file mode 100644 index 0000000000..a1d51263d9 --- /dev/null +++ b/test/integration/goldens/bigtable/samples/snippets/generated/main/java/com/google/cloud/bigtable/data/v2/bigtable/pingandwarm/SyncPingAndWarmInstancenameString.java @@ -0,0 +1,43 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS 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.bigtable.data.v2.samples; + +// [START bigtable_v2_generated_Bigtable_PingAndWarm_InstancenameString_sync] +import com.google.bigtable.v2.InstanceName; +import com.google.bigtable.v2.PingAndWarmResponse; +import com.google.cloud.bigtable.data.v2.BaseBigtableDataClient; + +public class SyncPingAndWarmInstancenameString { + + public static void main(String[] args) throws Exception { + syncPingAndWarmInstancenameString(); + } + + public static void syncPingAndWarmInstancenameString() 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 (BaseBigtableDataClient baseBigtableDataClient = BaseBigtableDataClient.create()) { + InstanceName name = InstanceName.of("[PROJECT]", "[INSTANCE]"); + String appProfileId = "appProfileId704923523"; + PingAndWarmResponse response = baseBigtableDataClient.pingAndWarm(name, appProfileId); + } + } +} +// [END bigtable_v2_generated_Bigtable_PingAndWarm_InstancenameString_sync] diff --git a/test/integration/goldens/bigtable/samples/snippets/generated/main/java/com/google/cloud/bigtable/data/v2/bigtable/pingandwarm/SyncPingAndWarmString.java b/test/integration/goldens/bigtable/samples/snippets/generated/main/java/com/google/cloud/bigtable/data/v2/bigtable/pingandwarm/SyncPingAndWarmString.java new file mode 100644 index 0000000000..e9b5a22ec1 --- /dev/null +++ b/test/integration/goldens/bigtable/samples/snippets/generated/main/java/com/google/cloud/bigtable/data/v2/bigtable/pingandwarm/SyncPingAndWarmString.java @@ -0,0 +1,42 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS 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.bigtable.data.v2.samples; + +// [START bigtable_v2_generated_Bigtable_PingAndWarm_String_sync] +import com.google.bigtable.v2.InstanceName; +import com.google.bigtable.v2.PingAndWarmResponse; +import com.google.cloud.bigtable.data.v2.BaseBigtableDataClient; + +public class SyncPingAndWarmString { + + public static void main(String[] args) throws Exception { + syncPingAndWarmString(); + } + + public static void syncPingAndWarmString() 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 (BaseBigtableDataClient baseBigtableDataClient = BaseBigtableDataClient.create()) { + String name = InstanceName.of("[PROJECT]", "[INSTANCE]").toString(); + PingAndWarmResponse response = baseBigtableDataClient.pingAndWarm(name); + } + } +} +// [END bigtable_v2_generated_Bigtable_PingAndWarm_String_sync] diff --git a/test/integration/goldens/bigtable/samples/snippets/generated/main/java/com/google/cloud/bigtable/data/v2/bigtable/pingandwarm/SyncPingAndWarmStringString.java b/test/integration/goldens/bigtable/samples/snippets/generated/main/java/com/google/cloud/bigtable/data/v2/bigtable/pingandwarm/SyncPingAndWarmStringString.java new file mode 100644 index 0000000000..afd6096f6e --- /dev/null +++ b/test/integration/goldens/bigtable/samples/snippets/generated/main/java/com/google/cloud/bigtable/data/v2/bigtable/pingandwarm/SyncPingAndWarmStringString.java @@ -0,0 +1,43 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS 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.bigtable.data.v2.samples; + +// [START bigtable_v2_generated_Bigtable_PingAndWarm_StringString_sync] +import com.google.bigtable.v2.InstanceName; +import com.google.bigtable.v2.PingAndWarmResponse; +import com.google.cloud.bigtable.data.v2.BaseBigtableDataClient; + +public class SyncPingAndWarmStringString { + + public static void main(String[] args) throws Exception { + syncPingAndWarmStringString(); + } + + public static void syncPingAndWarmStringString() 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 (BaseBigtableDataClient baseBigtableDataClient = BaseBigtableDataClient.create()) { + String name = InstanceName.of("[PROJECT]", "[INSTANCE]").toString(); + String appProfileId = "appProfileId704923523"; + PingAndWarmResponse response = baseBigtableDataClient.pingAndWarm(name, appProfileId); + } + } +} +// [END bigtable_v2_generated_Bigtable_PingAndWarm_StringString_sync] diff --git a/test/integration/goldens/bigtable/samples/snippets/generated/main/java/com/google/cloud/bigtable/data/v2/bigtable/readmodifywriterow/AsyncReadModifyWriteRow.java b/test/integration/goldens/bigtable/samples/snippets/generated/main/java/com/google/cloud/bigtable/data/v2/bigtable/readmodifywriterow/AsyncReadModifyWriteRow.java index 8ff05b78fb..628ceb3245 100644 --- a/test/integration/goldens/bigtable/samples/snippets/generated/main/java/com/google/cloud/bigtable/data/v2/bigtable/readmodifywriterow/AsyncReadModifyWriteRow.java +++ b/test/integration/goldens/bigtable/samples/snippets/generated/main/java/com/google/cloud/bigtable/data/v2/bigtable/readmodifywriterow/AsyncReadModifyWriteRow.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/bigtable/samples/snippets/generated/main/java/com/google/cloud/bigtable/data/v2/bigtable/readmodifywriterow/SyncReadModifyWriteRow.java b/test/integration/goldens/bigtable/samples/snippets/generated/main/java/com/google/cloud/bigtable/data/v2/bigtable/readmodifywriterow/SyncReadModifyWriteRow.java index 4fc565753f..e23fdb641f 100644 --- a/test/integration/goldens/bigtable/samples/snippets/generated/main/java/com/google/cloud/bigtable/data/v2/bigtable/readmodifywriterow/SyncReadModifyWriteRow.java +++ b/test/integration/goldens/bigtable/samples/snippets/generated/main/java/com/google/cloud/bigtable/data/v2/bigtable/readmodifywriterow/SyncReadModifyWriteRow.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/bigtable/samples/snippets/generated/main/java/com/google/cloud/bigtable/data/v2/bigtable/readmodifywriterow/SyncReadModifyWriteRowStringBytestringListreadmodifywriterule.java b/test/integration/goldens/bigtable/samples/snippets/generated/main/java/com/google/cloud/bigtable/data/v2/bigtable/readmodifywriterow/SyncReadModifyWriteRowStringBytestringListreadmodifywriterule.java index 0d065192e7..34c0fff37f 100644 --- a/test/integration/goldens/bigtable/samples/snippets/generated/main/java/com/google/cloud/bigtable/data/v2/bigtable/readmodifywriterow/SyncReadModifyWriteRowStringBytestringListreadmodifywriterule.java +++ b/test/integration/goldens/bigtable/samples/snippets/generated/main/java/com/google/cloud/bigtable/data/v2/bigtable/readmodifywriterow/SyncReadModifyWriteRowStringBytestringListreadmodifywriterule.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/bigtable/samples/snippets/generated/main/java/com/google/cloud/bigtable/data/v2/bigtable/readmodifywriterow/SyncReadModifyWriteRowStringBytestringListreadmodifywriteruleString.java b/test/integration/goldens/bigtable/samples/snippets/generated/main/java/com/google/cloud/bigtable/data/v2/bigtable/readmodifywriterow/SyncReadModifyWriteRowStringBytestringListreadmodifywriteruleString.java index 958365977e..44219c5541 100644 --- a/test/integration/goldens/bigtable/samples/snippets/generated/main/java/com/google/cloud/bigtable/data/v2/bigtable/readmodifywriterow/SyncReadModifyWriteRowStringBytestringListreadmodifywriteruleString.java +++ b/test/integration/goldens/bigtable/samples/snippets/generated/main/java/com/google/cloud/bigtable/data/v2/bigtable/readmodifywriterow/SyncReadModifyWriteRowStringBytestringListreadmodifywriteruleString.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/bigtable/samples/snippets/generated/main/java/com/google/cloud/bigtable/data/v2/bigtable/readmodifywriterow/SyncReadModifyWriteRowTablenameBytestringListreadmodifywriterule.java b/test/integration/goldens/bigtable/samples/snippets/generated/main/java/com/google/cloud/bigtable/data/v2/bigtable/readmodifywriterow/SyncReadModifyWriteRowTablenameBytestringListreadmodifywriterule.java index 9369754dfa..be5a4624f1 100644 --- a/test/integration/goldens/bigtable/samples/snippets/generated/main/java/com/google/cloud/bigtable/data/v2/bigtable/readmodifywriterow/SyncReadModifyWriteRowTablenameBytestringListreadmodifywriterule.java +++ b/test/integration/goldens/bigtable/samples/snippets/generated/main/java/com/google/cloud/bigtable/data/v2/bigtable/readmodifywriterow/SyncReadModifyWriteRowTablenameBytestringListreadmodifywriterule.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/bigtable/samples/snippets/generated/main/java/com/google/cloud/bigtable/data/v2/bigtable/readmodifywriterow/SyncReadModifyWriteRowTablenameBytestringListreadmodifywriteruleString.java b/test/integration/goldens/bigtable/samples/snippets/generated/main/java/com/google/cloud/bigtable/data/v2/bigtable/readmodifywriterow/SyncReadModifyWriteRowTablenameBytestringListreadmodifywriteruleString.java index db2d6d950b..85d34885ae 100644 --- a/test/integration/goldens/bigtable/samples/snippets/generated/main/java/com/google/cloud/bigtable/data/v2/bigtable/readmodifywriterow/SyncReadModifyWriteRowTablenameBytestringListreadmodifywriteruleString.java +++ b/test/integration/goldens/bigtable/samples/snippets/generated/main/java/com/google/cloud/bigtable/data/v2/bigtable/readmodifywriterow/SyncReadModifyWriteRowTablenameBytestringListreadmodifywriteruleString.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/bigtable/samples/snippets/generated/main/java/com/google/cloud/bigtable/data/v2/bigtable/readrows/AsyncReadRows.java b/test/integration/goldens/bigtable/samples/snippets/generated/main/java/com/google/cloud/bigtable/data/v2/bigtable/readrows/AsyncReadRows.java index 3228987659..9185c4f69a 100644 --- a/test/integration/goldens/bigtable/samples/snippets/generated/main/java/com/google/cloud/bigtable/data/v2/bigtable/readrows/AsyncReadRows.java +++ b/test/integration/goldens/bigtable/samples/snippets/generated/main/java/com/google/cloud/bigtable/data/v2/bigtable/readrows/AsyncReadRows.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/bigtable/samples/snippets/generated/main/java/com/google/cloud/bigtable/data/v2/bigtable/samplerowkeys/AsyncSampleRowKeys.java b/test/integration/goldens/bigtable/samples/snippets/generated/main/java/com/google/cloud/bigtable/data/v2/bigtable/samplerowkeys/AsyncSampleRowKeys.java index 113942be30..089fdc9b22 100644 --- a/test/integration/goldens/bigtable/samples/snippets/generated/main/java/com/google/cloud/bigtable/data/v2/bigtable/samplerowkeys/AsyncSampleRowKeys.java +++ b/test/integration/goldens/bigtable/samples/snippets/generated/main/java/com/google/cloud/bigtable/data/v2/bigtable/samplerowkeys/AsyncSampleRowKeys.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/bigtable/samples/snippets/generated/main/java/com/google/cloud/bigtable/data/v2/stub/bigtablestubsettings/mutaterow/SyncMutateRow.java b/test/integration/goldens/bigtable/samples/snippets/generated/main/java/com/google/cloud/bigtable/data/v2/stub/bigtablestubsettings/mutaterow/SyncMutateRow.java index 3194f8487c..0e73dda8d0 100644 --- a/test/integration/goldens/bigtable/samples/snippets/generated/main/java/com/google/cloud/bigtable/data/v2/stub/bigtablestubsettings/mutaterow/SyncMutateRow.java +++ b/test/integration/goldens/bigtable/samples/snippets/generated/main/java/com/google/cloud/bigtable/data/v2/stub/bigtablestubsettings/mutaterow/SyncMutateRow.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -41,7 +41,14 @@ public static void syncMutateRow() throws Exception { .mutateRowSettings() .getRetrySettings() .toBuilder() - .setTotalTimeout(Duration.ofSeconds(30)) + .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()); BigtableStubSettings baseBigtableDataSettings = baseBigtableDataSettingsBuilder.build(); } diff --git a/test/integration/goldens/bigtable/src/META-INF/native-image/com.google.cloud.bigtable.data.v2/reflect-config.json b/test/integration/goldens/bigtable/src/META-INF/native-image/com.google.cloud.bigtable.data.v2/reflect-config.json new file mode 100644 index 0000000000..50a35ac453 --- /dev/null +++ b/test/integration/goldens/bigtable/src/META-INF/native-image/com.google.cloud.bigtable.data.v2/reflect-config.json @@ -0,0 +1,2108 @@ +[ + { + "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.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.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.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.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.RoutingParameter", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.RoutingParameter$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.RoutingRule", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.RoutingRule$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.bigtable.v2.Cell", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.Cell$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.CheckAndMutateRowRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.CheckAndMutateRowRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.CheckAndMutateRowResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.CheckAndMutateRowResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.Column", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.Column$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.ColumnRange", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.ColumnRange$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.Family", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.Family$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.FullReadStatsView", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.FullReadStatsView$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.MutateRowRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.MutateRowRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.MutateRowResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.MutateRowResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.MutateRowsRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.MutateRowsRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.MutateRowsRequest$Entry", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.MutateRowsRequest$Entry$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.MutateRowsResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.MutateRowsResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.MutateRowsResponse$Entry", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.MutateRowsResponse$Entry$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.Mutation", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.Mutation$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.Mutation$DeleteFromColumn", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.Mutation$DeleteFromColumn$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.Mutation$DeleteFromFamily", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.Mutation$DeleteFromFamily$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.Mutation$DeleteFromRow", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.Mutation$DeleteFromRow$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.Mutation$SetCell", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.Mutation$SetCell$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.PingAndWarmRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.PingAndWarmRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.PingAndWarmResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.PingAndWarmResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.ReadIterationStats", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.ReadIterationStats$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.ReadModifyWriteRowRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.ReadModifyWriteRowRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.ReadModifyWriteRowResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.ReadModifyWriteRowResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.ReadModifyWriteRule", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.ReadModifyWriteRule$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.ReadRowsRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.ReadRowsRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.ReadRowsRequest$RequestStatsView", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.ReadRowsResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.ReadRowsResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.ReadRowsResponse$CellChunk", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.ReadRowsResponse$CellChunk$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.RequestLatencyStats", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.RequestLatencyStats$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.RequestStats", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.RequestStats$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.ResponseParams", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.ResponseParams$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.Row", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.Row$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.RowFilter", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.RowFilter$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.RowFilter$Chain", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.RowFilter$Chain$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.RowFilter$Condition", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.RowFilter$Condition$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.RowFilter$Interleave", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.RowFilter$Interleave$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.RowRange", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.RowRange$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.RowSet", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.RowSet$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.SampleRowKeysRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.SampleRowKeysRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.SampleRowKeysResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.SampleRowKeysResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.TimestampRange", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.TimestampRange$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.ValueRange", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.bigtable.v2.ValueRange$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.BoolValue", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.BoolValue$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.BytesValue", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.BytesValue$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.DoubleValue", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DoubleValue$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.FloatValue", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.FloatValue$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.Int32Value", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.Int32Value$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.Int64Value", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.Int64Value$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.StringValue", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.StringValue$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.UInt32Value", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.UInt32Value$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.UInt64Value", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.UInt64Value$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/test/integration/goldens/bigtable/src/com/google/bigtable/v2/InstanceName.java b/test/integration/goldens/bigtable/src/com/google/bigtable/v2/InstanceName.java new file mode 100644 index 0000000000..d36d4f04c1 --- /dev/null +++ b/test/integration/goldens/bigtable/src/com/google/bigtable/v2/InstanceName.java @@ -0,0 +1,192 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.bigtable.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 InstanceName implements ResourceName { + private static final PathTemplate PROJECT_INSTANCE = + PathTemplate.createWithoutUrlEncoding("projects/{project}/instances/{instance}"); + private volatile Map fieldValuesMap; + private final String project; + private final String instance; + + @Deprecated + protected InstanceName() { + project = null; + instance = null; + } + + private InstanceName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + instance = Preconditions.checkNotNull(builder.getInstance()); + } + + public String getProject() { + return project; + } + + public String getInstance() { + return instance; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + public static InstanceName of(String project, String instance) { + return newBuilder().setProject(project).setInstance(instance).build(); + } + + public static String format(String project, String instance) { + return newBuilder().setProject(project).setInstance(instance).build().toString(); + } + + public static InstanceName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + PROJECT_INSTANCE.validatedMatch( + formattedString, "InstanceName.parse: formattedString not in valid format"); + return of(matchMap.get("project"), matchMap.get("instance")); + } + + 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 (InstanceName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return PROJECT_INSTANCE.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 (instance != null) { + fieldMapBuilder.put("instance", instance); + } + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return PROJECT_INSTANCE.instantiate("project", project, "instance", instance); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o != null && getClass() == o.getClass()) { + InstanceName that = ((InstanceName) o); + return Objects.equals(this.project, that.project) + && Objects.equals(this.instance, that.instance); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= Objects.hashCode(project); + h *= 1000003; + h ^= Objects.hashCode(instance); + return h; + } + + /** Builder for projects/{project}/instances/{instance}. */ + public static class Builder { + private String project; + private String instance; + + protected Builder() {} + + public String getProject() { + return project; + } + + public String getInstance() { + return instance; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + public Builder setInstance(String instance) { + this.instance = instance; + return this; + } + + private Builder(InstanceName instanceName) { + this.project = instanceName.project; + this.instance = instanceName.instance; + } + + public InstanceName build() { + return new InstanceName(this); + } + } +} diff --git a/test/integration/goldens/bigtable/src/com/google/bigtable/v2/TableName.java b/test/integration/goldens/bigtable/src/com/google/bigtable/v2/TableName.java index 6ac2f5c1ef..b616cb8488 100644 --- a/test/integration/goldens/bigtable/src/com/google/bigtable/v2/TableName.java +++ b/test/integration/goldens/bigtable/src/com/google/bigtable/v2/TableName.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -154,7 +154,7 @@ public boolean equals(Object o) { if (o == this) { return true; } - if (o != null || getClass() == o.getClass()) { + if (o != null && getClass() == o.getClass()) { TableName that = ((TableName) o); return Objects.equals(this.project, that.project) && Objects.equals(this.instance, that.instance) diff --git a/test/integration/goldens/bigtable/src/com/google/cloud/bigtable/data/v2/BaseBigtableDataClient.java b/test/integration/goldens/bigtable/src/com/google/cloud/bigtable/data/v2/BaseBigtableDataClient.java index b8f8819dd0..66354a487f 100644 --- a/test/integration/goldens/bigtable/src/com/google/cloud/bigtable/data/v2/BaseBigtableDataClient.java +++ b/test/integration/goldens/bigtable/src/com/google/cloud/bigtable/data/v2/BaseBigtableDataClient.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -21,11 +21,14 @@ import com.google.api.gax.rpc.UnaryCallable; import com.google.bigtable.v2.CheckAndMutateRowRequest; import com.google.bigtable.v2.CheckAndMutateRowResponse; +import com.google.bigtable.v2.InstanceName; import com.google.bigtable.v2.MutateRowRequest; import com.google.bigtable.v2.MutateRowResponse; import com.google.bigtable.v2.MutateRowsRequest; import com.google.bigtable.v2.MutateRowsResponse; import com.google.bigtable.v2.Mutation; +import com.google.bigtable.v2.PingAndWarmRequest; +import com.google.bigtable.v2.PingAndWarmResponse; import com.google.bigtable.v2.ReadModifyWriteRowRequest; import com.google.bigtable.v2.ReadModifyWriteRowResponse; import com.google.bigtable.v2.ReadModifyWriteRule; @@ -68,19 +71,128 @@ * such as threads. In the example above, try-with-resources is used, which automatically calls * close(). * - *

        The surface of this class includes several types of Java methods for each of the API's - * methods: - * - *

          - *
        1. A "flattened" method. With this type of method, the fields of the request type have been - * converted into function parameters. It may be the case that not all fields are available as - * parameters, and not every API method will have a flattened method entry point. - *
        2. A "request object" method. This type of method only takes one parameter, a request object, - * which must be constructed before the call. Not every API method will have a request object - * method. - *
        3. A "callable" method. This type of method takes no parameters and returns an immutable API - * callable object, which can be used to initiate calls to the service. - *
        + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + *
        Methods
        MethodDescriptionMethod Variants

        ReadRows

        Streams back the contents of all requested rows in key order, optionally applying the same Reader filter to each. Depending on their size, rows and cells may be broken up across multiple responses, but atomicity of each row will still be preserved. See the ReadRowsResponse documentation for details.

        + *

        Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

        + *
          + *
        • readRowsCallable() + *

        + *

        SampleRowKeys

        Returns a sample of row keys in the table. The returned row keys will delimit contiguous sections of the table of approximately equal size, which can be used to break up the data for distributed tasks like mapreduces.

        + *

        Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

        + *
          + *
        • sampleRowKeysCallable() + *

        + *

        MutateRow

        Mutates a row atomically. Cells already present in the row are left unchanged unless explicitly changed by `mutation`.

        + *

        Request object method variants only take one parameter, a request object, which must be constructed before the call.

        + *
          + *
        • mutateRow(MutateRowRequest request) + *

        + *

        "Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

        + *
          + *
        • mutateRow(TableName tableName, ByteString rowKey, List<Mutation> mutations) + *

        • mutateRow(String tableName, ByteString rowKey, List<Mutation> mutations) + *

        • mutateRow(TableName tableName, ByteString rowKey, List<Mutation> mutations, String appProfileId) + *

        • mutateRow(String tableName, ByteString rowKey, List<Mutation> mutations, String appProfileId) + *

        + *

        Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

        + *
          + *
        • mutateRowCallable() + *

        + *

        MutateRows

        Mutates multiple rows in a batch. Each individual row is mutated atomically as in MutateRow, but the entire batch is not executed atomically.

        + *

        Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

        + *
          + *
        • mutateRowsCallable() + *

        + *

        CheckAndMutateRow

        Mutates a row atomically based on the output of a predicate Reader filter.

        + *

        Request object method variants only take one parameter, a request object, which must be constructed before the call.

        + *
          + *
        • checkAndMutateRow(CheckAndMutateRowRequest request) + *

        + *

        "Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

        + *
          + *
        • checkAndMutateRow(TableName tableName, ByteString rowKey, RowFilter predicateFilter, List<Mutation> trueMutations, List<Mutation> falseMutations) + *

        • checkAndMutateRow(String tableName, ByteString rowKey, RowFilter predicateFilter, List<Mutation> trueMutations, List<Mutation> falseMutations) + *

        • checkAndMutateRow(TableName tableName, ByteString rowKey, RowFilter predicateFilter, List<Mutation> trueMutations, List<Mutation> falseMutations, String appProfileId) + *

        • checkAndMutateRow(String tableName, ByteString rowKey, RowFilter predicateFilter, List<Mutation> trueMutations, List<Mutation> falseMutations, String appProfileId) + *

        + *

        Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

        + *
          + *
        • checkAndMutateRowCallable() + *

        + *

        PingAndWarm

        Warm up associated instance metadata for this connection. This call is not required but may be useful for connection keep-alive.

        + *

        Request object method variants only take one parameter, a request object, which must be constructed before the call.

        + *
          + *
        • pingAndWarm(PingAndWarmRequest request) + *

        + *

        "Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

        + *
          + *
        • pingAndWarm(InstanceName name) + *

        • pingAndWarm(String name) + *

        • pingAndWarm(InstanceName name, String appProfileId) + *

        • pingAndWarm(String name, String appProfileId) + *

        + *

        Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

        + *
          + *
        • pingAndWarmCallable() + *

        + *

        ReadModifyWriteRow

        Modifies a row atomically on the server. The method reads the latest existing timestamp and value from the specified columns and writes a new entry based on pre-defined read/modify/write rules. The new value for the timestamp is the greater of the existing timestamp or the current server time. The method returns the new contents of all modified cells.

        + *

        Request object method variants only take one parameter, a request object, which must be constructed before the call.

        + *
          + *
        • readModifyWriteRow(ReadModifyWriteRowRequest request) + *

        + *

        "Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

        + *
          + *
        • readModifyWriteRow(TableName tableName, ByteString rowKey, List<ReadModifyWriteRule> rules) + *

        • readModifyWriteRow(String tableName, ByteString rowKey, List<ReadModifyWriteRule> rules) + *

        • readModifyWriteRow(TableName tableName, ByteString rowKey, List<ReadModifyWriteRule> rules, String appProfileId) + *

        • readModifyWriteRow(String tableName, ByteString rowKey, List<ReadModifyWriteRule> rules, String appProfileId) + *

        + *

        Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

        + *
          + *
        • readModifyWriteRowCallable() + *

        + *
        * *

        See the individual methods for example code. * @@ -821,6 +933,190 @@ public final CheckAndMutateRowResponse checkAndMutateRow(CheckAndMutateRowReques return stub.checkAndMutateRowCallable(); } + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Warm up associated instance metadata for this connection. This call is not required but may be + * useful for connection keep-alive. + * + *

        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 (BaseBigtableDataClient baseBigtableDataClient = BaseBigtableDataClient.create()) {
        +   *   InstanceName name = InstanceName.of("[PROJECT]", "[INSTANCE]");
        +   *   PingAndWarmResponse response = baseBigtableDataClient.pingAndWarm(name);
        +   * }
        +   * }
        + * + * @param name Required. The unique name of the instance to check permissions for as well as + * respond. Values are of the form `projects/<project>/instances/<instance>`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final PingAndWarmResponse pingAndWarm(InstanceName name) { + PingAndWarmRequest request = + PingAndWarmRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + return pingAndWarm(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Warm up associated instance metadata for this connection. This call is not required but may be + * useful for connection keep-alive. + * + *

        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 (BaseBigtableDataClient baseBigtableDataClient = BaseBigtableDataClient.create()) {
        +   *   String name = InstanceName.of("[PROJECT]", "[INSTANCE]").toString();
        +   *   PingAndWarmResponse response = baseBigtableDataClient.pingAndWarm(name);
        +   * }
        +   * }
        + * + * @param name Required. The unique name of the instance to check permissions for as well as + * respond. Values are of the form `projects/<project>/instances/<instance>`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final PingAndWarmResponse pingAndWarm(String name) { + PingAndWarmRequest request = PingAndWarmRequest.newBuilder().setName(name).build(); + return pingAndWarm(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Warm up associated instance metadata for this connection. This call is not required but may be + * useful for connection keep-alive. + * + *

        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 (BaseBigtableDataClient baseBigtableDataClient = BaseBigtableDataClient.create()) {
        +   *   InstanceName name = InstanceName.of("[PROJECT]", "[INSTANCE]");
        +   *   String appProfileId = "appProfileId704923523";
        +   *   PingAndWarmResponse response = baseBigtableDataClient.pingAndWarm(name, appProfileId);
        +   * }
        +   * }
        + * + * @param name Required. The unique name of the instance to check permissions for as well as + * respond. Values are of the form `projects/<project>/instances/<instance>`. + * @param appProfileId This value specifies routing for replication. If not specified, the + * "default" application profile will be used. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final PingAndWarmResponse pingAndWarm(InstanceName name, String appProfileId) { + PingAndWarmRequest request = + PingAndWarmRequest.newBuilder() + .setName(name == null ? null : name.toString()) + .setAppProfileId(appProfileId) + .build(); + return pingAndWarm(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Warm up associated instance metadata for this connection. This call is not required but may be + * useful for connection keep-alive. + * + *

        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 (BaseBigtableDataClient baseBigtableDataClient = BaseBigtableDataClient.create()) {
        +   *   String name = InstanceName.of("[PROJECT]", "[INSTANCE]").toString();
        +   *   String appProfileId = "appProfileId704923523";
        +   *   PingAndWarmResponse response = baseBigtableDataClient.pingAndWarm(name, appProfileId);
        +   * }
        +   * }
        + * + * @param name Required. The unique name of the instance to check permissions for as well as + * respond. Values are of the form `projects/<project>/instances/<instance>`. + * @param appProfileId This value specifies routing for replication. If not specified, the + * "default" application profile will be used. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final PingAndWarmResponse pingAndWarm(String name, String appProfileId) { + PingAndWarmRequest request = + PingAndWarmRequest.newBuilder().setName(name).setAppProfileId(appProfileId).build(); + return pingAndWarm(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Warm up associated instance metadata for this connection. This call is not required but may be + * useful for connection keep-alive. + * + *

        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 (BaseBigtableDataClient baseBigtableDataClient = BaseBigtableDataClient.create()) {
        +   *   PingAndWarmRequest request =
        +   *       PingAndWarmRequest.newBuilder()
        +   *           .setName(InstanceName.of("[PROJECT]", "[INSTANCE]").toString())
        +   *           .setAppProfileId("appProfileId704923523")
        +   *           .build();
        +   *   PingAndWarmResponse response = baseBigtableDataClient.pingAndWarm(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 PingAndWarmResponse pingAndWarm(PingAndWarmRequest request) { + return pingAndWarmCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Warm up associated instance metadata for this connection. This call is not required but may be + * useful for connection keep-alive. + * + *

        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 (BaseBigtableDataClient baseBigtableDataClient = BaseBigtableDataClient.create()) {
        +   *   PingAndWarmRequest request =
        +   *       PingAndWarmRequest.newBuilder()
        +   *           .setName(InstanceName.of("[PROJECT]", "[INSTANCE]").toString())
        +   *           .setAppProfileId("appProfileId704923523")
        +   *           .build();
        +   *   ApiFuture future =
        +   *       baseBigtableDataClient.pingAndWarmCallable().futureCall(request);
        +   *   // Do something.
        +   *   PingAndWarmResponse response = future.get();
        +   * }
        +   * }
        + */ + public final UnaryCallable pingAndWarmCallable() { + return stub.pingAndWarmCallable(); + } + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Modifies a row atomically on the server. The method reads the latest existing timestamp and diff --git a/test/integration/goldens/bigtable/src/com/google/cloud/bigtable/data/v2/BaseBigtableDataClientTest.java b/test/integration/goldens/bigtable/src/com/google/cloud/bigtable/data/v2/BaseBigtableDataClientTest.java index 378547bee2..9580c8e726 100644 --- a/test/integration/goldens/bigtable/src/com/google/cloud/bigtable/data/v2/BaseBigtableDataClientTest.java +++ b/test/integration/goldens/bigtable/src/com/google/cloud/bigtable/data/v2/BaseBigtableDataClientTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -28,16 +28,20 @@ import com.google.api.gax.rpc.StatusCode; import com.google.bigtable.v2.CheckAndMutateRowRequest; import com.google.bigtable.v2.CheckAndMutateRowResponse; +import com.google.bigtable.v2.InstanceName; import com.google.bigtable.v2.MutateRowRequest; import com.google.bigtable.v2.MutateRowResponse; import com.google.bigtable.v2.MutateRowsRequest; import com.google.bigtable.v2.MutateRowsResponse; import com.google.bigtable.v2.Mutation; +import com.google.bigtable.v2.PingAndWarmRequest; +import com.google.bigtable.v2.PingAndWarmResponse; import com.google.bigtable.v2.ReadModifyWriteRowRequest; import com.google.bigtable.v2.ReadModifyWriteRowResponse; import com.google.bigtable.v2.ReadModifyWriteRule; import com.google.bigtable.v2.ReadRowsRequest; import com.google.bigtable.v2.ReadRowsResponse; +import com.google.bigtable.v2.RequestStats; import com.google.bigtable.v2.Row; import com.google.bigtable.v2.RowFilter; import com.google.bigtable.v2.RowSet; @@ -105,6 +109,7 @@ public void readRowsTest() throws Exception { ReadRowsResponse.newBuilder() .addAllChunks(new ArrayList()) .setLastScannedRowKey(ByteString.EMPTY) + .setRequestStats(RequestStats.newBuilder().build()) .build(); mockBigtable.addResponse(expectedResponse); ReadRowsRequest request = @@ -633,6 +638,152 @@ public void checkAndMutateRowExceptionTest4() throws Exception { } } + @Test + public void pingAndWarmTest() throws Exception { + PingAndWarmResponse expectedResponse = PingAndWarmResponse.newBuilder().build(); + mockBigtable.addResponse(expectedResponse); + + InstanceName name = InstanceName.of("[PROJECT]", "[INSTANCE]"); + + PingAndWarmResponse actualResponse = client.pingAndWarm(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockBigtable.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + PingAndWarmRequest actualRequest = ((PingAndWarmRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void pingAndWarmExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockBigtable.addException(exception); + + try { + InstanceName name = InstanceName.of("[PROJECT]", "[INSTANCE]"); + client.pingAndWarm(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void pingAndWarmTest2() throws Exception { + PingAndWarmResponse expectedResponse = PingAndWarmResponse.newBuilder().build(); + mockBigtable.addResponse(expectedResponse); + + String name = "name3373707"; + + PingAndWarmResponse actualResponse = client.pingAndWarm(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockBigtable.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + PingAndWarmRequest actualRequest = ((PingAndWarmRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void pingAndWarmExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockBigtable.addException(exception); + + try { + String name = "name3373707"; + client.pingAndWarm(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void pingAndWarmTest3() throws Exception { + PingAndWarmResponse expectedResponse = PingAndWarmResponse.newBuilder().build(); + mockBigtable.addResponse(expectedResponse); + + InstanceName name = InstanceName.of("[PROJECT]", "[INSTANCE]"); + String appProfileId = "appProfileId704923523"; + + PingAndWarmResponse actualResponse = client.pingAndWarm(name, appProfileId); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockBigtable.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + PingAndWarmRequest actualRequest = ((PingAndWarmRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertEquals(appProfileId, actualRequest.getAppProfileId()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void pingAndWarmExceptionTest3() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockBigtable.addException(exception); + + try { + InstanceName name = InstanceName.of("[PROJECT]", "[INSTANCE]"); + String appProfileId = "appProfileId704923523"; + client.pingAndWarm(name, appProfileId); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void pingAndWarmTest4() throws Exception { + PingAndWarmResponse expectedResponse = PingAndWarmResponse.newBuilder().build(); + mockBigtable.addResponse(expectedResponse); + + String name = "name3373707"; + String appProfileId = "appProfileId704923523"; + + PingAndWarmResponse actualResponse = client.pingAndWarm(name, appProfileId); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockBigtable.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + PingAndWarmRequest actualRequest = ((PingAndWarmRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertEquals(appProfileId, actualRequest.getAppProfileId()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void pingAndWarmExceptionTest4() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockBigtable.addException(exception); + + try { + String name = "name3373707"; + String appProfileId = "appProfileId704923523"; + client.pingAndWarm(name, appProfileId); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + @Test public void readModifyWriteRowTest() throws Exception { ReadModifyWriteRowResponse expectedResponse = diff --git a/test/integration/goldens/bigtable/src/com/google/cloud/bigtable/data/v2/BaseBigtableDataSettings.java b/test/integration/goldens/bigtable/src/com/google/cloud/bigtable/data/v2/BaseBigtableDataSettings.java index 4568393328..9c85d1d69a 100644 --- a/test/integration/goldens/bigtable/src/com/google/cloud/bigtable/data/v2/BaseBigtableDataSettings.java +++ b/test/integration/goldens/bigtable/src/com/google/cloud/bigtable/data/v2/BaseBigtableDataSettings.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -17,7 +17,6 @@ package com.google.cloud.bigtable.data.v2; import com.google.api.core.ApiFunction; -import com.google.api.core.BetaApi; import com.google.api.gax.core.GoogleCredentialsProvider; import com.google.api.gax.core.InstantiatingExecutorProvider; import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; @@ -34,6 +33,8 @@ import com.google.bigtable.v2.MutateRowResponse; import com.google.bigtable.v2.MutateRowsRequest; import com.google.bigtable.v2.MutateRowsResponse; +import com.google.bigtable.v2.PingAndWarmRequest; +import com.google.bigtable.v2.PingAndWarmResponse; import com.google.bigtable.v2.ReadModifyWriteRowRequest; import com.google.bigtable.v2.ReadModifyWriteRowResponse; import com.google.bigtable.v2.ReadRowsRequest; @@ -60,7 +61,9 @@ *

        The builder of this class is recursive, so contained classes are themselves builders. When * build() is called, the tree of builders is called to create the complete settings object. * - *

        For example, to set the total timeout of mutateRow to 30 seconds: + *

        For example, to set the + * [RetrySettings](https://cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.retrying.RetrySettings) + * of mutateRow: * *

        {@code
          * // This snippet has been automatically generated and should be regarded as a code template only.
        @@ -77,10 +80,21 @@
          *             .mutateRowSettings()
          *             .getRetrySettings()
          *             .toBuilder()
        - *             .setTotalTimeout(Duration.ofSeconds(30))
        + *             .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());
          * BaseBigtableDataSettings baseBigtableDataSettings = baseBigtableDataSettingsBuilder.build();
          * }
        + * + * Please refer to the [Client Side Retry + * Guide](https://docs.cloud.google.com/java/docs/client-retries) for additional support in setting + * retries. */ @Generated("by gapic-generator-java") public class BaseBigtableDataSettings extends ClientSettings { @@ -112,6 +126,11 @@ public ServerStreamingCallSettings mutate return ((BigtableStubSettings) getStubSettings()).checkAndMutateRowSettings(); } + /** Returns the object with the settings used for calls to pingAndWarm. */ + public UnaryCallSettings pingAndWarmSettings() { + return ((BigtableStubSettings) getStubSettings()).pingAndWarmSettings(); + } + /** Returns the object with the settings used for calls to readModifyWriteRow. */ public UnaryCallSettings readModifyWriteRowSettings() { @@ -152,7 +171,6 @@ public static TransportChannelProvider defaultTransportChannelProvider() { return BigtableStubSettings.defaultTransportChannelProvider(); } - @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { return BigtableStubSettings.defaultApiClientHeaderProviderBuilder(); } @@ -244,6 +262,12 @@ public UnaryCallSettings.Builder mutateRowS return getStubSettingsBuilder().checkAndMutateRowSettings(); } + /** Returns the builder for the settings used for calls to pingAndWarm. */ + public UnaryCallSettings.Builder + pingAndWarmSettings() { + return getStubSettingsBuilder().pingAndWarmSettings(); + } + /** Returns the builder for the settings used for calls to readModifyWriteRow. */ public UnaryCallSettings.Builder readModifyWriteRowSettings() { diff --git a/test/integration/goldens/bigtable/src/com/google/cloud/bigtable/data/v2/MockBigtable.java b/test/integration/goldens/bigtable/src/com/google/cloud/bigtable/data/v2/MockBigtable.java index 56c8ba8470..fe9e25ecea 100644 --- a/test/integration/goldens/bigtable/src/com/google/cloud/bigtable/data/v2/MockBigtable.java +++ b/test/integration/goldens/bigtable/src/com/google/cloud/bigtable/data/v2/MockBigtable.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/bigtable/src/com/google/cloud/bigtable/data/v2/MockBigtableImpl.java b/test/integration/goldens/bigtable/src/com/google/cloud/bigtable/data/v2/MockBigtableImpl.java index 15d424c503..ae19a2c7ef 100644 --- a/test/integration/goldens/bigtable/src/com/google/cloud/bigtable/data/v2/MockBigtableImpl.java +++ b/test/integration/goldens/bigtable/src/com/google/cloud/bigtable/data/v2/MockBigtableImpl.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -24,6 +24,8 @@ import com.google.bigtable.v2.MutateRowResponse; import com.google.bigtable.v2.MutateRowsRequest; import com.google.bigtable.v2.MutateRowsResponse; +import com.google.bigtable.v2.PingAndWarmRequest; +import com.google.bigtable.v2.PingAndWarmResponse; import com.google.bigtable.v2.ReadModifyWriteRowRequest; import com.google.bigtable.v2.ReadModifyWriteRowResponse; import com.google.bigtable.v2.ReadRowsRequest; @@ -175,6 +177,27 @@ public void checkAndMutateRow( } } + @Override + public void pingAndWarm( + PingAndWarmRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof PingAndWarmResponse) { + requests.add(request); + responseObserver.onNext(((PingAndWarmResponse) 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 PingAndWarm, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + PingAndWarmResponse.class.getName(), + Exception.class.getName()))); + } + } + @Override public void readModifyWriteRow( ReadModifyWriteRowRequest request, diff --git a/test/integration/goldens/bigtable/src/com/google/cloud/bigtable/data/v2/gapic_metadata.json b/test/integration/goldens/bigtable/src/com/google/cloud/bigtable/data/v2/gapic_metadata.json index 0891b90455..77b50a1f50 100644 --- a/test/integration/goldens/bigtable/src/com/google/cloud/bigtable/data/v2/gapic_metadata.json +++ b/test/integration/goldens/bigtable/src/com/google/cloud/bigtable/data/v2/gapic_metadata.json @@ -19,6 +19,9 @@ "MutateRows": { "methods": ["mutateRowsCallable"] }, + "PingAndWarm": { + "methods": ["pingAndWarm", "pingAndWarm", "pingAndWarm", "pingAndWarm", "pingAndWarm", "pingAndWarmCallable"] + }, "ReadModifyWriteRow": { "methods": ["readModifyWriteRow", "readModifyWriteRow", "readModifyWriteRow", "readModifyWriteRow", "readModifyWriteRow", "readModifyWriteRowCallable"] }, diff --git a/test/integration/goldens/bigtable/src/com/google/cloud/bigtable/data/v2/package-info.java b/test/integration/goldens/bigtable/src/com/google/cloud/bigtable/data/v2/package-info.java index 39cea2b479..ff64e80bbf 100644 --- a/test/integration/goldens/bigtable/src/com/google/cloud/bigtable/data/v2/package-info.java +++ b/test/integration/goldens/bigtable/src/com/google/cloud/bigtable/data/v2/package-info.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/bigtable/src/com/google/cloud/bigtable/data/v2/stub/BigtableStub.java b/test/integration/goldens/bigtable/src/com/google/cloud/bigtable/data/v2/stub/BigtableStub.java index e97f71c3eb..3560cde528 100644 --- a/test/integration/goldens/bigtable/src/com/google/cloud/bigtable/data/v2/stub/BigtableStub.java +++ b/test/integration/goldens/bigtable/src/com/google/cloud/bigtable/data/v2/stub/BigtableStub.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -25,6 +25,8 @@ import com.google.bigtable.v2.MutateRowResponse; import com.google.bigtable.v2.MutateRowsRequest; import com.google.bigtable.v2.MutateRowsResponse; +import com.google.bigtable.v2.PingAndWarmRequest; +import com.google.bigtable.v2.PingAndWarmResponse; import com.google.bigtable.v2.ReadModifyWriteRowRequest; import com.google.bigtable.v2.ReadModifyWriteRowResponse; import com.google.bigtable.v2.ReadRowsRequest; @@ -64,6 +66,10 @@ public ServerStreamingCallable mutateRows throw new UnsupportedOperationException("Not implemented: checkAndMutateRowCallable()"); } + public UnaryCallable pingAndWarmCallable() { + throw new UnsupportedOperationException("Not implemented: pingAndWarmCallable()"); + } + public UnaryCallable readModifyWriteRowCallable() { throw new UnsupportedOperationException("Not implemented: readModifyWriteRowCallable()"); diff --git a/test/integration/goldens/bigtable/src/com/google/cloud/bigtable/data/v2/stub/BigtableStubSettings.java b/test/integration/goldens/bigtable/src/com/google/cloud/bigtable/data/v2/stub/BigtableStubSettings.java index 79b5ad18eb..93e179072d 100644 --- a/test/integration/goldens/bigtable/src/com/google/cloud/bigtable/data/v2/stub/BigtableStubSettings.java +++ b/test/integration/goldens/bigtable/src/com/google/cloud/bigtable/data/v2/stub/BigtableStubSettings.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -17,7 +17,7 @@ package com.google.cloud.bigtable.data.v2.stub; import com.google.api.core.ApiFunction; -import com.google.api.core.BetaApi; +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; @@ -27,6 +27,7 @@ import com.google.api.gax.retrying.RetrySettings; import com.google.api.gax.rpc.ApiClientHeaderProvider; import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.LibraryMetadata; import com.google.api.gax.rpc.ServerStreamingCallSettings; import com.google.api.gax.rpc.StatusCode; import com.google.api.gax.rpc.StubSettings; @@ -38,6 +39,8 @@ import com.google.bigtable.v2.MutateRowResponse; import com.google.bigtable.v2.MutateRowsRequest; import com.google.bigtable.v2.MutateRowsResponse; +import com.google.bigtable.v2.PingAndWarmRequest; +import com.google.bigtable.v2.PingAndWarmResponse; import com.google.bigtable.v2.ReadModifyWriteRowRequest; import com.google.bigtable.v2.ReadModifyWriteRowResponse; import com.google.bigtable.v2.ReadRowsRequest; @@ -49,9 +52,9 @@ import com.google.common.collect.ImmutableSet; import com.google.common.collect.Lists; import java.io.IOException; +import java.time.Duration; import java.util.List; import javax.annotation.Generated; -import org.threeten.bp.Duration; // AUTO-GENERATED DOCUMENTATION AND CLASS. /** @@ -68,7 +71,9 @@ *

        The builder of this class is recursive, so contained classes are themselves builders. When * build() is called, the tree of builders is called to create the complete settings object. * - *

        For example, to set the total timeout of mutateRow to 30 seconds: + *

        For example, to set the + * [RetrySettings](https://cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.retrying.RetrySettings) + * of mutateRow: * *

        {@code
          * // This snippet has been automatically generated and should be regarded as a code template only.
        @@ -85,12 +90,24 @@
          *             .mutateRowSettings()
          *             .getRetrySettings()
          *             .toBuilder()
        - *             .setTotalTimeout(Duration.ofSeconds(30))
        + *             .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());
          * BigtableStubSettings baseBigtableDataSettings = baseBigtableDataSettingsBuilder.build();
          * }
        + * + * Please refer to the [Client Side Retry + * Guide](https://docs.cloud.google.com/java/docs/client-retries) for additional support in setting + * retries. */ @Generated("by gapic-generator-java") +@SuppressWarnings("CanonicalDuration") public class BigtableStubSettings extends StubSettings { /** The default scopes of the service. */ private static final ImmutableList DEFAULT_SERVICE_SCOPES = @@ -111,6 +128,7 @@ public class BigtableStubSettings extends StubSettings { mutateRowsSettings; private final UnaryCallSettings checkAndMutateRowSettings; + private final UnaryCallSettings pingAndWarmSettings; private final UnaryCallSettings readModifyWriteRowSettings; @@ -141,6 +159,11 @@ public ServerStreamingCallSettings mutate return checkAndMutateRowSettings; } + /** Returns the object with the settings used for calls to pingAndWarm. */ + public UnaryCallSettings pingAndWarmSettings() { + return pingAndWarmSettings; + } + /** Returns the object with the settings used for calls to readModifyWriteRow. */ public UnaryCallSettings readModifyWriteRowSettings() { @@ -158,12 +181,19 @@ public BigtableStub createStub() throws IOException { "Transport not supported: %s", getTransportChannelProvider().getTransportName())); } + /** Returns the default service name. */ + @Override + public String getServiceName() { + return "bigtable"; + } + /** 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 "bigtable.googleapis.com:443"; } @@ -195,7 +225,6 @@ public static TransportChannelProvider defaultTransportChannelProvider() { return defaultGrpcTransportProviderBuilder().build(); } - @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { return ApiClientHeaderProvider.newBuilder() .setGeneratedLibToken("gapic", GaxProperties.getLibraryVersion(BigtableStubSettings.class)) @@ -226,9 +255,15 @@ protected BigtableStubSettings(Builder settingsBuilder) throws IOException { mutateRowSettings = settingsBuilder.mutateRowSettings().build(); mutateRowsSettings = settingsBuilder.mutateRowsSettings().build(); checkAndMutateRowSettings = settingsBuilder.checkAndMutateRowSettings().build(); + pingAndWarmSettings = settingsBuilder.pingAndWarmSettings().build(); readModifyWriteRowSettings = settingsBuilder.readModifyWriteRowSettings().build(); } + @Override + protected LibraryMetadata getLibraryMetadata() { + return LibraryMetadata.newBuilder().setVersion(Version.VERSION).build(); + } + /** Builder for BigtableStubSettings. */ public static class Builder extends StubSettings.Builder { private final ImmutableList> unaryMethodSettingsBuilders; @@ -241,6 +276,8 @@ public static class Builder extends StubSettings.Builder checkAndMutateRowSettings; + private final UnaryCallSettings.Builder + pingAndWarmSettings; private final UnaryCallSettings.Builder readModifyWriteRowSettings; private static final ImmutableMap> @@ -250,18 +287,19 @@ public static class Builder extends StubSettings.Builder> definitions = ImmutableMap.builder(); definitions.put( - "retry_policy_3_codes", ImmutableSet.copyOf(Lists.newArrayList())); + "no_retry_3_codes", ImmutableSet.copyOf(Lists.newArrayList())); definitions.put( - "retry_policy_1_codes", ImmutableSet.copyOf(Lists.newArrayList())); + "no_retry_1_codes", ImmutableSet.copyOf(Lists.newArrayList())); definitions.put( "retry_policy_4_codes", ImmutableSet.copyOf( Lists.newArrayList( StatusCode.Code.UNAVAILABLE, StatusCode.Code.DEADLINE_EXCEEDED))); definitions.put( - "retry_policy_2_codes", ImmutableSet.copyOf(Lists.newArrayList())); + "no_retry_2_codes", ImmutableSet.copyOf(Lists.newArrayList())); definitions.put( - "retry_policy_0_codes", ImmutableSet.copyOf(Lists.newArrayList())); + "no_retry_0_codes", ImmutableSet.copyOf(Lists.newArrayList())); + definitions.put("no_retry_codes", ImmutableSet.copyOf(Lists.newArrayList())); RETRYABLE_CODE_DEFINITIONS = definitions.build(); } @@ -272,59 +310,49 @@ public static class Builder extends StubSettings.Builder>of( - mutateRowSettings, checkAndMutateRowSettings, readModifyWriteRowSettings); + mutateRowSettings, + checkAndMutateRowSettings, + pingAndWarmSettings, + readModifyWriteRowSettings); initDefaults(this); } @@ -356,11 +388,15 @@ protected Builder(BigtableStubSettings settings) { mutateRowSettings = settings.mutateRowSettings.toBuilder(); mutateRowsSettings = settings.mutateRowsSettings.toBuilder(); checkAndMutateRowSettings = settings.checkAndMutateRowSettings.toBuilder(); + pingAndWarmSettings = settings.pingAndWarmSettings.toBuilder(); readModifyWriteRowSettings = settings.readModifyWriteRowSettings.toBuilder(); unaryMethodSettingsBuilders = ImmutableList.>of( - mutateRowSettings, checkAndMutateRowSettings, readModifyWriteRowSettings); + mutateRowSettings, + checkAndMutateRowSettings, + pingAndWarmSettings, + readModifyWriteRowSettings); } private static Builder createDefault() { @@ -369,7 +405,6 @@ private static Builder createDefault() { builder.setTransportChannelProvider(defaultTransportChannelProvider()); builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); builder.setInternalHeaderProvider(defaultApiClientHeaderProviderBuilder().build()); - builder.setEndpoint(getDefaultEndpoint()); builder.setMtlsEndpoint(getDefaultMtlsEndpoint()); builder.setSwitchToMtlsEndpointAllowed(true); @@ -379,13 +414,13 @@ private static Builder createDefault() { private static Builder initDefaults(Builder builder) { builder .readRowsSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_3_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_3_params")); + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_3_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_3_params")); builder .sampleRowKeysSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")); + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")); builder .mutateRowSettings() @@ -394,18 +429,23 @@ private static Builder initDefaults(Builder builder) { builder .mutateRowsSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_2_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_2_params")); + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_2_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_2_params")); builder .checkAndMutateRowSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + + builder + .pingAndWarmSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); builder .readModifyWriteRowSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); return builder; } @@ -454,6 +494,12 @@ public UnaryCallSettings.Builder mutateRowS return checkAndMutateRowSettings; } + /** Returns the builder for the settings used for calls to pingAndWarm. */ + public UnaryCallSettings.Builder + pingAndWarmSettings() { + return pingAndWarmSettings; + } + /** Returns the builder for the settings used for calls to readModifyWriteRow. */ public UnaryCallSettings.Builder readModifyWriteRowSettings() { diff --git a/test/integration/goldens/bigtable/src/com/google/cloud/bigtable/data/v2/stub/GrpcBigtableCallableFactory.java b/test/integration/goldens/bigtable/src/com/google/cloud/bigtable/data/v2/stub/GrpcBigtableCallableFactory.java index b35383e6e8..a7be4becd9 100644 --- a/test/integration/goldens/bigtable/src/com/google/cloud/bigtable/data/v2/stub/GrpcBigtableCallableFactory.java +++ b/test/integration/goldens/bigtable/src/com/google/cloud/bigtable/data/v2/stub/GrpcBigtableCallableFactory.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/bigtable/src/com/google/cloud/bigtable/data/v2/stub/GrpcBigtableStub.java b/test/integration/goldens/bigtable/src/com/google/cloud/bigtable/data/v2/stub/GrpcBigtableStub.java index 5a74be13b9..81a698650b 100644 --- a/test/integration/goldens/bigtable/src/com/google/cloud/bigtable/data/v2/stub/GrpcBigtableStub.java +++ b/test/integration/goldens/bigtable/src/com/google/cloud/bigtable/data/v2/stub/GrpcBigtableStub.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -31,6 +31,8 @@ import com.google.bigtable.v2.MutateRowResponse; import com.google.bigtable.v2.MutateRowsRequest; import com.google.bigtable.v2.MutateRowsResponse; +import com.google.bigtable.v2.PingAndWarmRequest; +import com.google.bigtable.v2.PingAndWarmResponse; import com.google.bigtable.v2.ReadModifyWriteRowRequest; import com.google.bigtable.v2.ReadModifyWriteRowResponse; import com.google.bigtable.v2.ReadRowsRequest; @@ -60,6 +62,7 @@ public class GrpcBigtableStub extends BigtableStub { .setFullMethodName("google.bigtable.v2.Bigtable/ReadRows") .setRequestMarshaller(ProtoUtils.marshaller(ReadRowsRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(ReadRowsResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) .build(); private static final MethodDescriptor @@ -71,6 +74,7 @@ public class GrpcBigtableStub extends BigtableStub { ProtoUtils.marshaller(SampleRowKeysRequest.getDefaultInstance())) .setResponseMarshaller( ProtoUtils.marshaller(SampleRowKeysResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) .build(); private static final MethodDescriptor @@ -80,6 +84,7 @@ public class GrpcBigtableStub extends BigtableStub { .setFullMethodName("google.bigtable.v2.Bigtable/MutateRow") .setRequestMarshaller(ProtoUtils.marshaller(MutateRowRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(MutateRowResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) .build(); private static final MethodDescriptor @@ -89,6 +94,7 @@ public class GrpcBigtableStub extends BigtableStub { .setFullMethodName("google.bigtable.v2.Bigtable/MutateRows") .setRequestMarshaller(ProtoUtils.marshaller(MutateRowsRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(MutateRowsResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) .build(); private static final MethodDescriptor @@ -100,6 +106,18 @@ public class GrpcBigtableStub extends BigtableStub { ProtoUtils.marshaller(CheckAndMutateRowRequest.getDefaultInstance())) .setResponseMarshaller( ProtoUtils.marshaller(CheckAndMutateRowResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor + pingAndWarmMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.bigtable.v2.Bigtable/PingAndWarm") + .setRequestMarshaller(ProtoUtils.marshaller(PingAndWarmRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(PingAndWarmResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) .build(); private static final MethodDescriptor @@ -111,6 +129,7 @@ public class GrpcBigtableStub extends BigtableStub { ProtoUtils.marshaller(ReadModifyWriteRowRequest.getDefaultInstance())) .setResponseMarshaller( ProtoUtils.marshaller(ReadModifyWriteRowResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) .build(); private final ServerStreamingCallable readRowsCallable; @@ -120,6 +139,7 @@ public class GrpcBigtableStub extends BigtableStub { private final ServerStreamingCallable mutateRowsCallable; private final UnaryCallable checkAndMutateRowCallable; + private final UnaryCallable pingAndWarmCallable; private final UnaryCallable readModifyWriteRowCallable; @@ -147,6 +167,10 @@ public class GrpcBigtableStub extends BigtableStub { PathTemplate.create("{table_name=projects/*/instances/*/tables/*}"); private static final PathTemplate CHECK_AND_MUTATE_ROW_1_PATH_TEMPLATE = PathTemplate.create("{app_profile_id=**}"); + private static final PathTemplate PING_AND_WARM_0_PATH_TEMPLATE = + PathTemplate.create("{name=projects/*/instances/*}"); + private static final PathTemplate PING_AND_WARM_1_PATH_TEMPLATE = + PathTemplate.create("{app_profile_id=**}"); private static final PathTemplate READ_MODIFY_WRITE_ROW_0_PATH_TEMPLATE = PathTemplate.create("{table_name=projects/*/instances/*/tables/*}"); private static final PathTemplate READ_MODIFY_WRITE_ROW_1_PATH_TEMPLATE = @@ -198,6 +222,7 @@ protected GrpcBigtableStub( request.getAppProfileId(), "app_profile_id", READ_ROWS_1_PATH_TEMPLATE); return builder.build(); }) + .setResourceNameExtractor(request -> request.getTableName()) .build(); GrpcCallSettings sampleRowKeysTransportSettings = GrpcCallSettings.newBuilder() @@ -211,6 +236,7 @@ protected GrpcBigtableStub( request.getAppProfileId(), "app_profile_id", SAMPLE_ROW_KEYS_1_PATH_TEMPLATE); return builder.build(); }) + .setResourceNameExtractor(request -> request.getTableName()) .build(); GrpcCallSettings mutateRowTransportSettings = GrpcCallSettings.newBuilder() @@ -223,6 +249,7 @@ protected GrpcBigtableStub( request.getAppProfileId(), "app_profile_id", MUTATE_ROW_1_PATH_TEMPLATE); return builder.build(); }) + .setResourceNameExtractor(request -> request.getTableName()) .build(); GrpcCallSettings mutateRowsTransportSettings = GrpcCallSettings.newBuilder() @@ -235,6 +262,7 @@ protected GrpcBigtableStub( request.getAppProfileId(), "app_profile_id", MUTATE_ROWS_1_PATH_TEMPLATE); return builder.build(); }) + .setResourceNameExtractor(request -> request.getTableName()) .build(); GrpcCallSettings checkAndMutateRowTransportSettings = @@ -253,7 +281,21 @@ protected GrpcBigtableStub( CHECK_AND_MUTATE_ROW_1_PATH_TEMPLATE); return builder.build(); }) + .setResourceNameExtractor(request -> request.getTableName()) .build(); + GrpcCallSettings pingAndWarmTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(pingAndWarmMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add(request.getName(), "name", PING_AND_WARM_0_PATH_TEMPLATE); + builder.add( + request.getAppProfileId(), "app_profile_id", PING_AND_WARM_1_PATH_TEMPLATE); + return builder.build(); + }) + .setResourceNameExtractor(request -> request.getName()) + .build(); GrpcCallSettings readModifyWriteRowTransportSettings = GrpcCallSettings.newBuilder() @@ -271,6 +313,7 @@ protected GrpcBigtableStub( READ_MODIFY_WRITE_ROW_1_PATH_TEMPLATE); return builder.build(); }) + .setResourceNameExtractor(request -> request.getTableName()) .build(); this.readRowsCallable = @@ -290,6 +333,9 @@ protected GrpcBigtableStub( checkAndMutateRowTransportSettings, settings.checkAndMutateRowSettings(), clientContext); + this.pingAndWarmCallable = + callableFactory.createUnaryCallable( + pingAndWarmTransportSettings, settings.pingAndWarmSettings(), clientContext); this.readModifyWriteRowCallable = callableFactory.createUnaryCallable( readModifyWriteRowTransportSettings, @@ -331,6 +377,11 @@ public ServerStreamingCallable mutateRows return checkAndMutateRowCallable; } + @Override + public UnaryCallable pingAndWarmCallable() { + return pingAndWarmCallable; + } + @Override public UnaryCallable readModifyWriteRowCallable() { diff --git a/test/integration/goldens/bigtable/src/com/google/cloud/bigtable/data/v2/stub/Version.java b/test/integration/goldens/bigtable/src/com/google/cloud/bigtable/data/v2/stub/Version.java new file mode 100644 index 0000000000..b5dc9e1686 --- /dev/null +++ b/test/integration/goldens/bigtable/src/com/google/cloud/bigtable/data/v2/stub/Version.java @@ -0,0 +1,27 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS 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.bigtable.data.v2.stub; + +import com.google.api.core.InternalApi; + +@InternalApi("For internal use only") +final class Version { + // {x-version-update-start:null:current} + static final String VERSION = "0.0.0-SNAPSHOT"; + // {x-version-update-end} + +} diff --git a/test/integration/goldens/compute/samples/snippets/generated/main/java/com/google/cloud/compute/v1small/addresses/aggregatedlist/AsyncAggregatedList.java b/test/integration/goldens/compute/samples/snippets/generated/main/java/com/google/cloud/compute/v1small/addresses/aggregatedlist/AsyncAggregatedList.java index fd623a44bf..f13a8437eb 100644 --- a/test/integration/goldens/compute/samples/snippets/generated/main/java/com/google/cloud/compute/v1small/addresses/aggregatedlist/AsyncAggregatedList.java +++ b/test/integration/goldens/compute/samples/snippets/generated/main/java/com/google/cloud/compute/v1small/addresses/aggregatedlist/AsyncAggregatedList.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/compute/samples/snippets/generated/main/java/com/google/cloud/compute/v1small/addresses/aggregatedlist/AsyncAggregatedListPaged.java b/test/integration/goldens/compute/samples/snippets/generated/main/java/com/google/cloud/compute/v1small/addresses/aggregatedlist/AsyncAggregatedListPaged.java index 333c757c68..c665e8d1db 100644 --- a/test/integration/goldens/compute/samples/snippets/generated/main/java/com/google/cloud/compute/v1small/addresses/aggregatedlist/AsyncAggregatedListPaged.java +++ b/test/integration/goldens/compute/samples/snippets/generated/main/java/com/google/cloud/compute/v1small/addresses/aggregatedlist/AsyncAggregatedListPaged.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/compute/samples/snippets/generated/main/java/com/google/cloud/compute/v1small/addresses/aggregatedlist/SyncAggregatedList.java b/test/integration/goldens/compute/samples/snippets/generated/main/java/com/google/cloud/compute/v1small/addresses/aggregatedlist/SyncAggregatedList.java index 21afc1d2c0..5aa295e795 100644 --- a/test/integration/goldens/compute/samples/snippets/generated/main/java/com/google/cloud/compute/v1small/addresses/aggregatedlist/SyncAggregatedList.java +++ b/test/integration/goldens/compute/samples/snippets/generated/main/java/com/google/cloud/compute/v1small/addresses/aggregatedlist/SyncAggregatedList.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/compute/samples/snippets/generated/main/java/com/google/cloud/compute/v1small/addresses/aggregatedlist/SyncAggregatedListString.java b/test/integration/goldens/compute/samples/snippets/generated/main/java/com/google/cloud/compute/v1small/addresses/aggregatedlist/SyncAggregatedListString.java index 0320dc1970..cc2a3e25af 100644 --- a/test/integration/goldens/compute/samples/snippets/generated/main/java/com/google/cloud/compute/v1small/addresses/aggregatedlist/SyncAggregatedListString.java +++ b/test/integration/goldens/compute/samples/snippets/generated/main/java/com/google/cloud/compute/v1small/addresses/aggregatedlist/SyncAggregatedListString.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/compute/samples/snippets/generated/main/java/com/google/cloud/compute/v1small/addresses/create/SyncCreateSetCredentialsProvider.java b/test/integration/goldens/compute/samples/snippets/generated/main/java/com/google/cloud/compute/v1small/addresses/create/SyncCreateSetCredentialsProvider.java index ee626b3833..ee94dee6c0 100644 --- a/test/integration/goldens/compute/samples/snippets/generated/main/java/com/google/cloud/compute/v1small/addresses/create/SyncCreateSetCredentialsProvider.java +++ b/test/integration/goldens/compute/samples/snippets/generated/main/java/com/google/cloud/compute/v1small/addresses/create/SyncCreateSetCredentialsProvider.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/compute/samples/snippets/generated/main/java/com/google/cloud/compute/v1small/addresses/create/SyncCreateSetEndpoint.java b/test/integration/goldens/compute/samples/snippets/generated/main/java/com/google/cloud/compute/v1small/addresses/create/SyncCreateSetEndpoint.java index 49a9b34bf3..f0ce15c6f3 100644 --- a/test/integration/goldens/compute/samples/snippets/generated/main/java/com/google/cloud/compute/v1small/addresses/create/SyncCreateSetEndpoint.java +++ b/test/integration/goldens/compute/samples/snippets/generated/main/java/com/google/cloud/compute/v1small/addresses/create/SyncCreateSetEndpoint.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/compute/samples/snippets/generated/main/java/com/google/cloud/compute/v1small/addresses/delete/AsyncDelete.java b/test/integration/goldens/compute/samples/snippets/generated/main/java/com/google/cloud/compute/v1small/addresses/delete/AsyncDelete.java index 53a63b72eb..5be10f1389 100644 --- a/test/integration/goldens/compute/samples/snippets/generated/main/java/com/google/cloud/compute/v1small/addresses/delete/AsyncDelete.java +++ b/test/integration/goldens/compute/samples/snippets/generated/main/java/com/google/cloud/compute/v1small/addresses/delete/AsyncDelete.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/compute/samples/snippets/generated/main/java/com/google/cloud/compute/v1small/addresses/delete/AsyncDeleteLRO.java b/test/integration/goldens/compute/samples/snippets/generated/main/java/com/google/cloud/compute/v1small/addresses/delete/AsyncDeleteLRO.java index 86c2dc5992..3a2a5f6429 100644 --- a/test/integration/goldens/compute/samples/snippets/generated/main/java/com/google/cloud/compute/v1small/addresses/delete/AsyncDeleteLRO.java +++ b/test/integration/goldens/compute/samples/snippets/generated/main/java/com/google/cloud/compute/v1small/addresses/delete/AsyncDeleteLRO.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/compute/samples/snippets/generated/main/java/com/google/cloud/compute/v1small/addresses/delete/SyncDelete.java b/test/integration/goldens/compute/samples/snippets/generated/main/java/com/google/cloud/compute/v1small/addresses/delete/SyncDelete.java index 8cc976a9a1..428d6c5ac3 100644 --- a/test/integration/goldens/compute/samples/snippets/generated/main/java/com/google/cloud/compute/v1small/addresses/delete/SyncDelete.java +++ b/test/integration/goldens/compute/samples/snippets/generated/main/java/com/google/cloud/compute/v1small/addresses/delete/SyncDelete.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/compute/samples/snippets/generated/main/java/com/google/cloud/compute/v1small/addresses/delete/SyncDeleteStringStringString.java b/test/integration/goldens/compute/samples/snippets/generated/main/java/com/google/cloud/compute/v1small/addresses/delete/SyncDeleteStringStringString.java index d9152c6c41..27d36eadb2 100644 --- a/test/integration/goldens/compute/samples/snippets/generated/main/java/com/google/cloud/compute/v1small/addresses/delete/SyncDeleteStringStringString.java +++ b/test/integration/goldens/compute/samples/snippets/generated/main/java/com/google/cloud/compute/v1small/addresses/delete/SyncDeleteStringStringString.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/compute/samples/snippets/generated/main/java/com/google/cloud/compute/v1small/addresses/insert/AsyncInsert.java b/test/integration/goldens/compute/samples/snippets/generated/main/java/com/google/cloud/compute/v1small/addresses/insert/AsyncInsert.java index c4004a223d..f3b3bc1247 100644 --- a/test/integration/goldens/compute/samples/snippets/generated/main/java/com/google/cloud/compute/v1small/addresses/insert/AsyncInsert.java +++ b/test/integration/goldens/compute/samples/snippets/generated/main/java/com/google/cloud/compute/v1small/addresses/insert/AsyncInsert.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/compute/samples/snippets/generated/main/java/com/google/cloud/compute/v1small/addresses/insert/AsyncInsertLRO.java b/test/integration/goldens/compute/samples/snippets/generated/main/java/com/google/cloud/compute/v1small/addresses/insert/AsyncInsertLRO.java index 4e70ce04b1..1f7528a207 100644 --- a/test/integration/goldens/compute/samples/snippets/generated/main/java/com/google/cloud/compute/v1small/addresses/insert/AsyncInsertLRO.java +++ b/test/integration/goldens/compute/samples/snippets/generated/main/java/com/google/cloud/compute/v1small/addresses/insert/AsyncInsertLRO.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/compute/samples/snippets/generated/main/java/com/google/cloud/compute/v1small/addresses/insert/SyncInsert.java b/test/integration/goldens/compute/samples/snippets/generated/main/java/com/google/cloud/compute/v1small/addresses/insert/SyncInsert.java index 3c38ab50fb..dbfe72f854 100644 --- a/test/integration/goldens/compute/samples/snippets/generated/main/java/com/google/cloud/compute/v1small/addresses/insert/SyncInsert.java +++ b/test/integration/goldens/compute/samples/snippets/generated/main/java/com/google/cloud/compute/v1small/addresses/insert/SyncInsert.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/compute/samples/snippets/generated/main/java/com/google/cloud/compute/v1small/addresses/insert/SyncInsertStringStringAddress.java b/test/integration/goldens/compute/samples/snippets/generated/main/java/com/google/cloud/compute/v1small/addresses/insert/SyncInsertStringStringAddress.java index 3f6d001f75..b35149f01c 100644 --- a/test/integration/goldens/compute/samples/snippets/generated/main/java/com/google/cloud/compute/v1small/addresses/insert/SyncInsertStringStringAddress.java +++ b/test/integration/goldens/compute/samples/snippets/generated/main/java/com/google/cloud/compute/v1small/addresses/insert/SyncInsertStringStringAddress.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/compute/samples/snippets/generated/main/java/com/google/cloud/compute/v1small/addresses/list/AsyncList.java b/test/integration/goldens/compute/samples/snippets/generated/main/java/com/google/cloud/compute/v1small/addresses/list/AsyncList.java index 89088a5a04..d6e0c5efdd 100644 --- a/test/integration/goldens/compute/samples/snippets/generated/main/java/com/google/cloud/compute/v1small/addresses/list/AsyncList.java +++ b/test/integration/goldens/compute/samples/snippets/generated/main/java/com/google/cloud/compute/v1small/addresses/list/AsyncList.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/compute/samples/snippets/generated/main/java/com/google/cloud/compute/v1small/addresses/list/AsyncListPaged.java b/test/integration/goldens/compute/samples/snippets/generated/main/java/com/google/cloud/compute/v1small/addresses/list/AsyncListPaged.java index e749bc7595..fba399cb18 100644 --- a/test/integration/goldens/compute/samples/snippets/generated/main/java/com/google/cloud/compute/v1small/addresses/list/AsyncListPaged.java +++ b/test/integration/goldens/compute/samples/snippets/generated/main/java/com/google/cloud/compute/v1small/addresses/list/AsyncListPaged.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/compute/samples/snippets/generated/main/java/com/google/cloud/compute/v1small/addresses/list/SyncList.java b/test/integration/goldens/compute/samples/snippets/generated/main/java/com/google/cloud/compute/v1small/addresses/list/SyncList.java index 3c105181a7..249d07d997 100644 --- a/test/integration/goldens/compute/samples/snippets/generated/main/java/com/google/cloud/compute/v1small/addresses/list/SyncList.java +++ b/test/integration/goldens/compute/samples/snippets/generated/main/java/com/google/cloud/compute/v1small/addresses/list/SyncList.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/compute/samples/snippets/generated/main/java/com/google/cloud/compute/v1small/addresses/list/SyncListStringStringString.java b/test/integration/goldens/compute/samples/snippets/generated/main/java/com/google/cloud/compute/v1small/addresses/list/SyncListStringStringString.java index bc47d773c9..025b481dfd 100644 --- a/test/integration/goldens/compute/samples/snippets/generated/main/java/com/google/cloud/compute/v1small/addresses/list/SyncListStringStringString.java +++ b/test/integration/goldens/compute/samples/snippets/generated/main/java/com/google/cloud/compute/v1small/addresses/list/SyncListStringStringString.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/compute/samples/snippets/generated/main/java/com/google/cloud/compute/v1small/addressessettings/aggregatedlist/SyncAggregatedList.java b/test/integration/goldens/compute/samples/snippets/generated/main/java/com/google/cloud/compute/v1small/addressessettings/aggregatedlist/SyncAggregatedList.java index fa405f919b..4efdf48c84 100644 --- a/test/integration/goldens/compute/samples/snippets/generated/main/java/com/google/cloud/compute/v1small/addressessettings/aggregatedlist/SyncAggregatedList.java +++ b/test/integration/goldens/compute/samples/snippets/generated/main/java/com/google/cloud/compute/v1small/addressessettings/aggregatedlist/SyncAggregatedList.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -40,7 +40,14 @@ public static void syncAggregatedList() throws Exception { .aggregatedListSettings() .getRetrySettings() .toBuilder() - .setTotalTimeout(Duration.ofSeconds(30)) + .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()); AddressesSettings addressesSettings = addressesSettingsBuilder.build(); } diff --git a/test/integration/goldens/compute/samples/snippets/generated/main/java/com/google/cloud/compute/v1small/addressessettings/delete/SyncDelete.java b/test/integration/goldens/compute/samples/snippets/generated/main/java/com/google/cloud/compute/v1small/addressessettings/delete/SyncDelete.java new file mode 100644 index 0000000000..23bdd2ffac --- /dev/null +++ b/test/integration/goldens/compute/samples/snippets/generated/main/java/com/google/cloud/compute/v1small/addressessettings/delete/SyncDelete.java @@ -0,0 +1,53 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS 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.compute.v1small.samples; + +// [START compute_v1small_generated_AddressesSettings_Delete_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.compute.v1small.AddressesSettings; +import java.time.Duration; + +public class SyncDelete { + + public static void main(String[] args) throws Exception { + syncDelete(); + } + + public static void syncDelete() 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 + AddressesSettings.Builder addressesSettingsBuilder = AddressesSettings.newBuilder(); + TimedRetryAlgorithm timedRetryAlgorithm = + OperationalTimedPollAlgorithm.create( + RetrySettings.newBuilder() + .setInitialRetryDelayDuration(Duration.ofMillis(500)) + .setRetryDelayMultiplier(1.5) + .setMaxRetryDelayDuration(Duration.ofMillis(5000)) + .setTotalTimeoutDuration(Duration.ofHours(24)) + .build()); + addressesSettingsBuilder + .createClusterOperationSettings() + .setPollingAlgorithm(timedRetryAlgorithm) + .build(); + } +} +// [END compute_v1small_generated_AddressesSettings_Delete_sync] diff --git a/test/integration/goldens/compute/samples/snippets/generated/main/java/com/google/cloud/compute/v1small/regionoperations/create/SyncCreateSetCredentialsProvider.java b/test/integration/goldens/compute/samples/snippets/generated/main/java/com/google/cloud/compute/v1small/regionoperations/create/SyncCreateSetCredentialsProvider.java index 2768ddd357..b6f79a2f71 100644 --- a/test/integration/goldens/compute/samples/snippets/generated/main/java/com/google/cloud/compute/v1small/regionoperations/create/SyncCreateSetCredentialsProvider.java +++ b/test/integration/goldens/compute/samples/snippets/generated/main/java/com/google/cloud/compute/v1small/regionoperations/create/SyncCreateSetCredentialsProvider.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/compute/samples/snippets/generated/main/java/com/google/cloud/compute/v1small/regionoperations/create/SyncCreateSetEndpoint.java b/test/integration/goldens/compute/samples/snippets/generated/main/java/com/google/cloud/compute/v1small/regionoperations/create/SyncCreateSetEndpoint.java index d8bbb778d7..97fa903fd1 100644 --- a/test/integration/goldens/compute/samples/snippets/generated/main/java/com/google/cloud/compute/v1small/regionoperations/create/SyncCreateSetEndpoint.java +++ b/test/integration/goldens/compute/samples/snippets/generated/main/java/com/google/cloud/compute/v1small/regionoperations/create/SyncCreateSetEndpoint.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/compute/samples/snippets/generated/main/java/com/google/cloud/compute/v1small/regionoperations/get/AsyncGet.java b/test/integration/goldens/compute/samples/snippets/generated/main/java/com/google/cloud/compute/v1small/regionoperations/get/AsyncGet.java index ab424fc0c1..2467d918fa 100644 --- a/test/integration/goldens/compute/samples/snippets/generated/main/java/com/google/cloud/compute/v1small/regionoperations/get/AsyncGet.java +++ b/test/integration/goldens/compute/samples/snippets/generated/main/java/com/google/cloud/compute/v1small/regionoperations/get/AsyncGet.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/compute/samples/snippets/generated/main/java/com/google/cloud/compute/v1small/regionoperations/get/SyncGet.java b/test/integration/goldens/compute/samples/snippets/generated/main/java/com/google/cloud/compute/v1small/regionoperations/get/SyncGet.java index 59138ed2e8..e07dcc781b 100644 --- a/test/integration/goldens/compute/samples/snippets/generated/main/java/com/google/cloud/compute/v1small/regionoperations/get/SyncGet.java +++ b/test/integration/goldens/compute/samples/snippets/generated/main/java/com/google/cloud/compute/v1small/regionoperations/get/SyncGet.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/compute/samples/snippets/generated/main/java/com/google/cloud/compute/v1small/regionoperations/get/SyncGetStringStringString.java b/test/integration/goldens/compute/samples/snippets/generated/main/java/com/google/cloud/compute/v1small/regionoperations/get/SyncGetStringStringString.java index 00ebf2a01e..37cb3ff17b 100644 --- a/test/integration/goldens/compute/samples/snippets/generated/main/java/com/google/cloud/compute/v1small/regionoperations/get/SyncGetStringStringString.java +++ b/test/integration/goldens/compute/samples/snippets/generated/main/java/com/google/cloud/compute/v1small/regionoperations/get/SyncGetStringStringString.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/compute/samples/snippets/generated/main/java/com/google/cloud/compute/v1small/regionoperations/wait/AsyncWait.java b/test/integration/goldens/compute/samples/snippets/generated/main/java/com/google/cloud/compute/v1small/regionoperations/wait/AsyncWait.java index f02fcb2fad..8e588696d1 100644 --- a/test/integration/goldens/compute/samples/snippets/generated/main/java/com/google/cloud/compute/v1small/regionoperations/wait/AsyncWait.java +++ b/test/integration/goldens/compute/samples/snippets/generated/main/java/com/google/cloud/compute/v1small/regionoperations/wait/AsyncWait.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/compute/samples/snippets/generated/main/java/com/google/cloud/compute/v1small/regionoperations/wait/SyncWait.java b/test/integration/goldens/compute/samples/snippets/generated/main/java/com/google/cloud/compute/v1small/regionoperations/wait/SyncWait.java index 41c9b22574..54d61addaa 100644 --- a/test/integration/goldens/compute/samples/snippets/generated/main/java/com/google/cloud/compute/v1small/regionoperations/wait/SyncWait.java +++ b/test/integration/goldens/compute/samples/snippets/generated/main/java/com/google/cloud/compute/v1small/regionoperations/wait/SyncWait.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/compute/samples/snippets/generated/main/java/com/google/cloud/compute/v1small/regionoperations/wait/SyncWaitStringStringString.java b/test/integration/goldens/compute/samples/snippets/generated/main/java/com/google/cloud/compute/v1small/regionoperations/wait/SyncWaitStringStringString.java index 791fdfe170..1beb8d6fb5 100644 --- a/test/integration/goldens/compute/samples/snippets/generated/main/java/com/google/cloud/compute/v1small/regionoperations/wait/SyncWaitStringStringString.java +++ b/test/integration/goldens/compute/samples/snippets/generated/main/java/com/google/cloud/compute/v1small/regionoperations/wait/SyncWaitStringStringString.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/compute/samples/snippets/generated/main/java/com/google/cloud/compute/v1small/regionoperationssettings/get/SyncGet.java b/test/integration/goldens/compute/samples/snippets/generated/main/java/com/google/cloud/compute/v1small/regionoperationssettings/get/SyncGet.java index 87bb6ca330..59526ed3f1 100644 --- a/test/integration/goldens/compute/samples/snippets/generated/main/java/com/google/cloud/compute/v1small/regionoperationssettings/get/SyncGet.java +++ b/test/integration/goldens/compute/samples/snippets/generated/main/java/com/google/cloud/compute/v1small/regionoperationssettings/get/SyncGet.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -41,7 +41,14 @@ public static void syncGet() throws Exception { .getSettings() .getRetrySettings() .toBuilder() - .setTotalTimeout(Duration.ofSeconds(30)) + .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()); RegionOperationsSettings regionOperationsSettings = regionOperationsSettingsBuilder.build(); } diff --git a/test/integration/goldens/compute/samples/snippets/generated/main/java/com/google/cloud/compute/v1small/stub/addressesstubsettings/aggregatedlist/SyncAggregatedList.java b/test/integration/goldens/compute/samples/snippets/generated/main/java/com/google/cloud/compute/v1small/stub/addressesstubsettings/aggregatedlist/SyncAggregatedList.java index 4d7ea1ee76..ae2038fdb4 100644 --- a/test/integration/goldens/compute/samples/snippets/generated/main/java/com/google/cloud/compute/v1small/stub/addressesstubsettings/aggregatedlist/SyncAggregatedList.java +++ b/test/integration/goldens/compute/samples/snippets/generated/main/java/com/google/cloud/compute/v1small/stub/addressesstubsettings/aggregatedlist/SyncAggregatedList.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -40,7 +40,14 @@ public static void syncAggregatedList() throws Exception { .aggregatedListSettings() .getRetrySettings() .toBuilder() - .setTotalTimeout(Duration.ofSeconds(30)) + .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()); AddressesStubSettings addressesSettings = addressesSettingsBuilder.build(); } diff --git a/test/integration/goldens/compute/samples/snippets/generated/main/java/com/google/cloud/compute/v1small/stub/addressesstubsettings/delete/SyncDelete.java b/test/integration/goldens/compute/samples/snippets/generated/main/java/com/google/cloud/compute/v1small/stub/addressesstubsettings/delete/SyncDelete.java new file mode 100644 index 0000000000..6476316e84 --- /dev/null +++ b/test/integration/goldens/compute/samples/snippets/generated/main/java/com/google/cloud/compute/v1small/stub/addressesstubsettings/delete/SyncDelete.java @@ -0,0 +1,53 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS 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.compute.v1small.stub.samples; + +// [START compute_v1small_generated_AddressesStubSettings_Delete_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.compute.v1small.stub.AddressesStubSettings; +import java.time.Duration; + +public class SyncDelete { + + public static void main(String[] args) throws Exception { + syncDelete(); + } + + public static void syncDelete() 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 + AddressesStubSettings.Builder addressesSettingsBuilder = AddressesStubSettings.newBuilder(); + TimedRetryAlgorithm timedRetryAlgorithm = + OperationalTimedPollAlgorithm.create( + RetrySettings.newBuilder() + .setInitialRetryDelayDuration(Duration.ofMillis(500)) + .setRetryDelayMultiplier(1.5) + .setMaxRetryDelayDuration(Duration.ofMillis(5000)) + .setTotalTimeoutDuration(Duration.ofHours(24)) + .build()); + addressesSettingsBuilder + .createClusterOperationSettings() + .setPollingAlgorithm(timedRetryAlgorithm) + .build(); + } +} +// [END compute_v1small_generated_AddressesStubSettings_Delete_sync] diff --git a/test/integration/goldens/compute/samples/snippets/generated/main/java/com/google/cloud/compute/v1small/stub/regionoperationsstubsettings/get/SyncGet.java b/test/integration/goldens/compute/samples/snippets/generated/main/java/com/google/cloud/compute/v1small/stub/regionoperationsstubsettings/get/SyncGet.java index 4e2e67f189..1facdf51f4 100644 --- a/test/integration/goldens/compute/samples/snippets/generated/main/java/com/google/cloud/compute/v1small/stub/regionoperationsstubsettings/get/SyncGet.java +++ b/test/integration/goldens/compute/samples/snippets/generated/main/java/com/google/cloud/compute/v1small/stub/regionoperationsstubsettings/get/SyncGet.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -41,7 +41,14 @@ public static void syncGet() throws Exception { .getSettings() .getRetrySettings() .toBuilder() - .setTotalTimeout(Duration.ofSeconds(30)) + .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()); RegionOperationsStubSettings regionOperationsSettings = regionOperationsSettingsBuilder.build(); } diff --git a/test/integration/goldens/compute/src/META-INF/native-image/com.google.cloud.compute.v1small/reflect-config.json b/test/integration/goldens/compute/src/META-INF/native-image/com.google.cloud.compute.v1small/reflect-config.json new file mode 100644 index 0000000000..f74a92695c --- /dev/null +++ b/test/integration/goldens/compute/src/META-INF/native-image/com.google.cloud.compute.v1small/reflect-config.json @@ -0,0 +1,1496 @@ +[ + { + "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.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.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.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.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.cloud.OperationResponseMapping", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.compute.v1small.Address", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.compute.v1small.Address$AddressType", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.compute.v1small.Address$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.compute.v1small.Address$IpVersion", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.compute.v1small.Address$NetworkTier", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.compute.v1small.Address$Purpose", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.compute.v1small.Address$Status", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.compute.v1small.AddressAggregatedList", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.compute.v1small.AddressAggregatedList$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.compute.v1small.AddressList", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.compute.v1small.AddressList$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.compute.v1small.AddressesScopedList", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.compute.v1small.AddressesScopedList$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.compute.v1small.AggregatedListAddressesRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.compute.v1small.AggregatedListAddressesRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.compute.v1small.Data", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.compute.v1small.Data$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.compute.v1small.DeleteAddressRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.compute.v1small.DeleteAddressRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.compute.v1small.Error", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.compute.v1small.Error$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.compute.v1small.Errors", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.compute.v1small.Errors$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.compute.v1small.GetRegionOperationRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.compute.v1small.GetRegionOperationRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.compute.v1small.InsertAddressRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.compute.v1small.InsertAddressRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.compute.v1small.ListAddressesRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.compute.v1small.ListAddressesRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.compute.v1small.Operation", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.compute.v1small.Operation$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.compute.v1small.Operation$Status", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.compute.v1small.WaitRegionOperationRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.compute.v1small.WaitRegionOperationRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.compute.v1small.Warning", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.compute.v1small.Warning$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.compute.v1small.Warning$Code", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.compute.v1small.Warnings", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.compute.v1small.Warnings$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.compute.v1small.Warnings$Code", + "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 + } +] \ No newline at end of file diff --git a/test/integration/goldens/compute/src/com/google/cloud/compute/v1small/AddressesClient.java b/test/integration/goldens/compute/src/com/google/cloud/compute/v1small/AddressesClient.java index 97c16997d7..4807e593af 100644 --- a/test/integration/goldens/compute/src/com/google/cloud/compute/v1small/AddressesClient.java +++ b/test/integration/goldens/compute/src/com/google/cloud/compute/v1small/AddressesClient.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -18,7 +18,6 @@ import com.google.api.core.ApiFuture; import com.google.api.core.ApiFutures; -import com.google.api.core.BetaApi; import com.google.api.gax.core.BackgroundResource; import com.google.api.gax.longrunning.OperationFuture; import com.google.api.gax.paging.AbstractFixedSizeCollection; @@ -63,19 +62,90 @@ *

        Note: close() needs to be called on the AddressesClient object to clean up resources such as * threads. In the example above, try-with-resources is used, which automatically calls close(). * - *

        The surface of this class includes several types of Java methods for each of the API's - * methods: - * - *

          - *
        1. A "flattened" method. With this type of method, the fields of the request type have been - * converted into function parameters. It may be the case that not all fields are available as - * parameters, and not every API method will have a flattened method entry point. - *
        2. A "request object" method. This type of method only takes one parameter, a request object, - * which must be constructed before the call. Not every API method will have a request object - * method. - *
        3. A "callable" method. This type of method takes no parameters and returns an immutable API - * callable object, which can be used to initiate calls to the service. - *
        + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + *
        Methods
        MethodDescriptionMethod Variants

        AggregatedList

        Retrieves an aggregated list of addresses.

        + *

        Request object method variants only take one parameter, a request object, which must be constructed before the call.

        + *
          + *
        • aggregatedList(AggregatedListAddressesRequest request) + *

        + *

        "Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

        + *
          + *
        • aggregatedList(String project) + *

        + *

        Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

        + *
          + *
        • aggregatedListPagedCallable() + *

        • aggregatedListCallable() + *

        + *

        Delete

        Deletes the specified address resource.

        + *

        Request object method variants only take one parameter, a request object, which must be constructed before the call.

        + *
          + *
        • deleteAsync(DeleteAddressRequest request) + *

        + *

        Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.

        + *
          + *
        • deleteAsync(String project, String region, String address) + *

        + *

        Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

        + *
          + *
        • deleteOperationCallable() + *

        • deleteCallable() + *

        + *

        Insert

        Creates an address resource in the specified project by using the data included in the request.

        + *

        Request object method variants only take one parameter, a request object, which must be constructed before the call.

        + *
          + *
        • insertAsync(InsertAddressRequest request) + *

        + *

        Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.

        + *
          + *
        • insertAsync(String project, String region, Address addressResource) + *

        + *

        Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

        + *
          + *
        • insertOperationCallable() + *

        • insertCallable() + *

        + *

        List

        Retrieves a list of addresses contained within the specified region.

        + *

        Request object method variants only take one parameter, a request object, which must be constructed before the call.

        + *
          + *
        • list(ListAddressesRequest request) + *

        + *

        "Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

        + *
          + *
        • list(String project, String region, 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.

        + *
          + *
        • listPagedCallable() + *

        • listCallable() + *

        + *
        * *

        See the individual methods for example code. * @@ -371,8 +441,6 @@ public final OperationFuture deleteAsync( * @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 */ - @BetaApi( - "The surface for long-running operations is not stable yet and may change in the future.") public final OperationFuture deleteAsync(DeleteAddressRequest request) { return deleteOperationCallable().futureCall(request); } @@ -502,8 +570,6 @@ public final OperationFuture insertAsync( * @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 */ - @BetaApi( - "The surface for long-running operations is not stable yet and may change in the future.") public final OperationFuture insertAsync(InsertAddressRequest request) { return insertOperationCallable().futureCall(request); } diff --git a/test/integration/goldens/compute/src/com/google/cloud/compute/v1small/AddressesClientTest.java b/test/integration/goldens/compute/src/com/google/cloud/compute/v1small/AddressesClientTest.java index 4703ae2a5d..39726de4ce 100644 --- a/test/integration/goldens/compute/src/com/google/cloud/compute/v1small/AddressesClientTest.java +++ b/test/integration/goldens/compute/src/com/google/cloud/compute/v1small/AddressesClientTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/compute/src/com/google/cloud/compute/v1small/AddressesSettings.java b/test/integration/goldens/compute/src/com/google/cloud/compute/v1small/AddressesSettings.java index 2d0e5499e0..9a69837dd3 100644 --- a/test/integration/goldens/compute/src/com/google/cloud/compute/v1small/AddressesSettings.java +++ b/test/integration/goldens/compute/src/com/google/cloud/compute/v1small/AddressesSettings.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -20,7 +20,6 @@ import static com.google.cloud.compute.v1small.AddressesClient.ListPagedResponse; import com.google.api.core.ApiFunction; -import com.google.api.core.BetaApi; import com.google.api.gax.core.GoogleCredentialsProvider; import com.google.api.gax.core.InstantiatingExecutorProvider; import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; @@ -52,7 +51,9 @@ *

        The builder of this class is recursive, so contained classes are themselves builders. When * build() is called, the tree of builders is called to create the complete settings object. * - *

        For example, to set the total timeout of aggregatedList to 30 seconds: + *

        For example, to set the + * [RetrySettings](https://cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.retrying.RetrySettings) + * of aggregatedList: * *

        {@code
          * // This snippet has been automatically generated and should be regarded as a code template only.
        @@ -68,10 +69,46 @@
          *             .aggregatedListSettings()
          *             .getRetrySettings()
          *             .toBuilder()
        - *             .setTotalTimeout(Duration.ofSeconds(30))
        + *             .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());
          * AddressesSettings addressesSettings = addressesSettingsBuilder.build();
          * }
        + * + * Please refer to the [Client Side Retry + * Guide](https://docs.cloud.google.com/java/docs/client-retries) 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 delete: + * + *

        {@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
        + * AddressesSettings.Builder addressesSettingsBuilder = AddressesSettings.newBuilder();
        + * TimedRetryAlgorithm timedRetryAlgorithm =
        + *     OperationalTimedPollAlgorithm.create(
        + *         RetrySettings.newBuilder()
        + *             .setInitialRetryDelayDuration(Duration.ofMillis(500))
        + *             .setRetryDelayMultiplier(1.5)
        + *             .setMaxRetryDelayDuration(Duration.ofMillis(5000))
        + *             .setTotalTimeoutDuration(Duration.ofHours(24))
        + *             .build());
        + * addressesSettingsBuilder
        + *     .createClusterOperationSettings()
        + *     .setPollingAlgorithm(timedRetryAlgorithm)
        + *     .build();
        + * }
        */ @Generated("by gapic-generator-java") public class AddressesSettings extends ClientSettings { @@ -144,7 +181,6 @@ public static TransportChannelProvider defaultTransportChannelProvider() { return AddressesStubSettings.defaultTransportChannelProvider(); } - @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { return AddressesStubSettings.defaultApiClientHeaderProviderBuilder(); } diff --git a/test/integration/goldens/compute/src/com/google/cloud/compute/v1small/RegionOperationsClient.java b/test/integration/goldens/compute/src/com/google/cloud/compute/v1small/RegionOperationsClient.java index fd4d467126..fa6c2a73cc 100644 --- a/test/integration/goldens/compute/src/com/google/cloud/compute/v1small/RegionOperationsClient.java +++ b/test/integration/goldens/compute/src/com/google/cloud/compute/v1small/RegionOperationsClient.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -49,19 +49,51 @@ * such as threads. In the example above, try-with-resources is used, which automatically calls * close(). * - *

        The surface of this class includes several types of Java methods for each of the API's - * methods: - * - *

          - *
        1. A "flattened" method. With this type of method, the fields of the request type have been - * converted into function parameters. It may be the case that not all fields are available as - * parameters, and not every API method will have a flattened method entry point. - *
        2. A "request object" method. This type of method only takes one parameter, a request object, - * which must be constructed before the call. Not every API method will have a request object - * method. - *
        3. A "callable" method. This type of method takes no parameters and returns an immutable API - * callable object, which can be used to initiate calls to the service. - *
        + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + *
        Methods
        MethodDescriptionMethod Variants

        Get

        Retrieves the specified region-specific Operations resource.

        + *

        Request object method variants only take one parameter, a request object, which must be constructed before the call.

        + *
          + *
        • get(GetRegionOperationRequest request) + *

        + *

        "Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

        + *
          + *
        • get(String project, String region, String operation) + *

        + *

        Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

        + *
          + *
        • getCallable() + *

        + *

        Wait

        Waits for the specified Operation resource to return as `DONE` or for the request to approach the 2 minute deadline, and retrieves the specified Operation resource. This method differs from the `GET` method in that it waits for no more than the default deadline (2 minutes) and then returns the current state of the operation, which might be `DONE` or still in progress. + *

        This method is called on a best-effort basis. Specifically: - In uncommon cases, when the server is overloaded, the request might return before the default deadline is reached, or might return after zero seconds. - If the default deadline is reached, there is no guarantee that the operation is actually done when the method returns. Be prepared to retry if the operation is not `DONE`.

        + *

        Request object method variants only take one parameter, a request object, which must be constructed before the call.

        + *
          + *
        • wait(WaitRegionOperationRequest request) + *

        + *

        "Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

        + *
          + *
        • wait(String project, String region, String operation) + *

        + *

        Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

        + *
          + *
        • waitCallable() + *

        + *
        * *

        See the individual methods for example code. * diff --git a/test/integration/goldens/compute/src/com/google/cloud/compute/v1small/RegionOperationsClientTest.java b/test/integration/goldens/compute/src/com/google/cloud/compute/v1small/RegionOperationsClientTest.java index 38b94860a3..c1181c1c70 100644 --- a/test/integration/goldens/compute/src/com/google/cloud/compute/v1small/RegionOperationsClientTest.java +++ b/test/integration/goldens/compute/src/com/google/cloud/compute/v1small/RegionOperationsClientTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/compute/src/com/google/cloud/compute/v1small/RegionOperationsSettings.java b/test/integration/goldens/compute/src/com/google/cloud/compute/v1small/RegionOperationsSettings.java index fa048fc7bb..670ba5b3d1 100644 --- a/test/integration/goldens/compute/src/com/google/cloud/compute/v1small/RegionOperationsSettings.java +++ b/test/integration/goldens/compute/src/com/google/cloud/compute/v1small/RegionOperationsSettings.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -17,7 +17,6 @@ package com.google.cloud.compute.v1small; import com.google.api.core.ApiFunction; -import com.google.api.core.BetaApi; import com.google.api.gax.core.GoogleCredentialsProvider; import com.google.api.gax.core.InstantiatingExecutorProvider; import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; @@ -47,7 +46,9 @@ *

        The builder of this class is recursive, so contained classes are themselves builders. When * build() is called, the tree of builders is called to create the complete settings object. * - *

        For example, to set the total timeout of get to 30 seconds: + *

        For example, to set the + * [RetrySettings](https://cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.retrying.RetrySettings) + * of get: * *

        {@code
          * // This snippet has been automatically generated and should be regarded as a code template only.
        @@ -64,10 +65,21 @@
          *             .getSettings()
          *             .getRetrySettings()
          *             .toBuilder()
        - *             .setTotalTimeout(Duration.ofSeconds(30))
        + *             .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());
          * RegionOperationsSettings regionOperationsSettings = regionOperationsSettingsBuilder.build();
          * }
        + * + * Please refer to the [Client Side Retry + * Guide](https://docs.cloud.google.com/java/docs/client-retries) for additional support in setting + * retries. */ @Generated("by gapic-generator-java") public class RegionOperationsSettings extends ClientSettings { @@ -117,7 +129,6 @@ public static TransportChannelProvider defaultTransportChannelProvider() { return RegionOperationsStubSettings.defaultTransportChannelProvider(); } - @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { return RegionOperationsStubSettings.defaultApiClientHeaderProviderBuilder(); } diff --git a/test/integration/goldens/compute/src/com/google/cloud/compute/v1small/package-info.java b/test/integration/goldens/compute/src/com/google/cloud/compute/v1small/package-info.java index ff8f7aa749..d6014d7e17 100644 --- a/test/integration/goldens/compute/src/com/google/cloud/compute/v1small/package-info.java +++ b/test/integration/goldens/compute/src/com/google/cloud/compute/v1small/package-info.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/compute/src/com/google/cloud/compute/v1small/stub/AddressesStub.java b/test/integration/goldens/compute/src/com/google/cloud/compute/v1small/stub/AddressesStub.java index d4b084b0e9..c053936613 100644 --- a/test/integration/goldens/compute/src/com/google/cloud/compute/v1small/stub/AddressesStub.java +++ b/test/integration/goldens/compute/src/com/google/cloud/compute/v1small/stub/AddressesStub.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/compute/src/com/google/cloud/compute/v1small/stub/AddressesStubSettings.java b/test/integration/goldens/compute/src/com/google/cloud/compute/v1small/stub/AddressesStubSettings.java index 5930ca3b99..046706b2c8 100644 --- a/test/integration/goldens/compute/src/com/google/cloud/compute/v1small/stub/AddressesStubSettings.java +++ b/test/integration/goldens/compute/src/com/google/cloud/compute/v1small/stub/AddressesStubSettings.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -21,7 +21,7 @@ import com.google.api.core.ApiFunction; import com.google.api.core.ApiFuture; -import com.google.api.core.BetaApi; +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; @@ -35,6 +35,7 @@ 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.LibraryMetadata; import com.google.api.gax.rpc.OperationCallSettings; import com.google.api.gax.rpc.PageContext; import com.google.api.gax.rpc.PagedCallSettings; @@ -59,11 +60,10 @@ import com.google.common.collect.ImmutableSet; import com.google.common.collect.Lists; import java.io.IOException; -import java.util.Collections; +import java.time.Duration; import java.util.List; import java.util.Map; import javax.annotation.Generated; -import org.threeten.bp.Duration; // AUTO-GENERATED DOCUMENTATION AND CLASS. /** @@ -80,7 +80,9 @@ *

        The builder of this class is recursive, so contained classes are themselves builders. When * build() is called, the tree of builders is called to create the complete settings object. * - *

        For example, to set the total timeout of aggregatedList to 30 seconds: + *

        For example, to set the + * [RetrySettings](https://cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.retrying.RetrySettings) + * of aggregatedList: * *

        {@code
          * // This snippet has been automatically generated and should be regarded as a code template only.
        @@ -96,12 +98,49 @@
          *             .aggregatedListSettings()
          *             .getRetrySettings()
          *             .toBuilder()
        - *             .setTotalTimeout(Duration.ofSeconds(30))
        + *             .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());
          * AddressesStubSettings addressesSettings = addressesSettingsBuilder.build();
          * }
        + * + * Please refer to the [Client Side Retry + * Guide](https://docs.cloud.google.com/java/docs/client-retries) 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 delete: + * + *

        {@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
        + * AddressesStubSettings.Builder addressesSettingsBuilder = AddressesStubSettings.newBuilder();
        + * TimedRetryAlgorithm timedRetryAlgorithm =
        + *     OperationalTimedPollAlgorithm.create(
        + *         RetrySettings.newBuilder()
        + *             .setInitialRetryDelayDuration(Duration.ofMillis(500))
        + *             .setRetryDelayMultiplier(1.5)
        + *             .setMaxRetryDelayDuration(Duration.ofMillis(5000))
        + *             .setTotalTimeoutDuration(Duration.ofHours(24))
        + *             .build());
        + * addressesSettingsBuilder
        + *     .createClusterOperationSettings()
        + *     .setPollingAlgorithm(timedRetryAlgorithm)
        + *     .build();
        + * }
        */ @Generated("by gapic-generator-java") +@SuppressWarnings("CanonicalDuration") public class AddressesStubSettings extends StubSettings { /** The default scopes of the service. */ private static final ImmutableList DEFAULT_SERVICE_SCOPES = @@ -163,9 +202,7 @@ public String extractNextToken(AddressAggregatedList payload) { @Override public Iterable> extractResources( AddressAggregatedList payload) { - return payload.getItemsMap() == null - ? Collections.>emptySet() - : payload.getItemsMap().entrySet(); + return payload.getItemsMap().entrySet(); } }; @@ -199,9 +236,7 @@ public String extractNextToken(AddressList payload) { @Override public Iterable
        extractResources(AddressList payload) { - return payload.getItemsList() == null - ? ImmutableList.
        of() - : payload.getItemsList(); + return payload.getItemsList(); } }; @@ -289,12 +324,19 @@ public AddressesStub createStub() throws IOException { "Transport not supported: %s", getTransportChannelProvider().getTransportName())); } + /** Returns the default service name. */ + @Override + public String getServiceName() { + return "compute"; + } + /** 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 "compute.googleapis.com:443"; } @@ -326,7 +368,6 @@ public static TransportChannelProvider defaultTransportChannelProvider() { return defaultHttpJsonTransportProviderBuilder().build(); } - @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { return ApiClientHeaderProvider.newBuilder() .setGeneratedLibToken("gapic", GaxProperties.getLibraryVersion(AddressesStubSettings.class)) @@ -361,6 +402,11 @@ protected AddressesStubSettings(Builder settingsBuilder) throws IOException { listSettings = settingsBuilder.listSettings().build(); } + @Override + protected LibraryMetadata getLibraryMetadata() { + return LibraryMetadata.newBuilder().setVersion(Version.VERSION).build(); + } + /** Builder for AddressesStubSettings. */ public static class Builder extends StubSettings.Builder { private final ImmutableList> unaryMethodSettingsBuilders; @@ -398,21 +444,21 @@ public static class Builder extends StubSettings.Builder deleteSettings } /** Returns the builder for the settings used for calls to delete. */ - @BetaApi( - "The surface for use by generated code is not stable yet and may change in the future.") public OperationCallSettings.Builder deleteOperationSettings() { return deleteOperationSettings; @@ -579,8 +622,6 @@ public UnaryCallSettings.Builder insertSettings } /** Returns the builder for the settings used for calls to insert. */ - @BetaApi( - "The surface for use by generated code is not stable yet and may change in the future.") public OperationCallSettings.Builder insertOperationSettings() { return insertOperationSettings; diff --git a/test/integration/goldens/compute/src/com/google/cloud/compute/v1small/stub/HttpJsonAddressesCallableFactory.java b/test/integration/goldens/compute/src/com/google/cloud/compute/v1small/stub/HttpJsonAddressesCallableFactory.java index 2a43474a4b..82c30e674a 100644 --- a/test/integration/goldens/compute/src/com/google/cloud/compute/v1small/stub/HttpJsonAddressesCallableFactory.java +++ b/test/integration/goldens/compute/src/com/google/cloud/compute/v1small/stub/HttpJsonAddressesCallableFactory.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,7 +16,6 @@ package com.google.cloud.compute.v1small.stub; -import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.HttpJsonCallSettings; import com.google.api.gax.httpjson.HttpJsonCallableFactory; import com.google.api.gax.httpjson.HttpJsonOperationSnapshotCallable; @@ -40,7 +39,6 @@ *

        This class is for advanced usage. */ @Generated("by gapic-generator-java") -@BetaApi public class HttpJsonAddressesCallableFactory implements HttpJsonStubCallableFactory { @@ -72,8 +70,6 @@ public UnaryCallable createBatchingCa httpJsonCallSettings, callSettings, clientContext); } - @BetaApi( - "The surface for long-running operations is not stable yet and may change in the future.") @Override public OperationCallable createOperationCallable( diff --git a/test/integration/goldens/compute/src/com/google/cloud/compute/v1small/stub/HttpJsonAddressesStub.java b/test/integration/goldens/compute/src/com/google/cloud/compute/v1small/stub/HttpJsonAddressesStub.java index b040b1a5d8..9bb9f6c181 100644 --- a/test/integration/goldens/compute/src/com/google/cloud/compute/v1small/stub/HttpJsonAddressesStub.java +++ b/test/integration/goldens/compute/src/com/google/cloud/compute/v1small/stub/HttpJsonAddressesStub.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -19,7 +19,6 @@ import static com.google.cloud.compute.v1small.AddressesClient.AggregatedListPagedResponse; import static com.google.cloud.compute.v1small.AddressesClient.ListPagedResponse; -import com.google.api.core.BetaApi; import com.google.api.core.InternalApi; import com.google.api.gax.core.BackgroundResource; import com.google.api.gax.core.BackgroundResourceAggregation; @@ -33,6 +32,7 @@ import com.google.api.gax.longrunning.OperationSnapshot; 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.cloud.compute.v1small.AddressAggregatedList; import com.google.cloud.compute.v1small.AddressList; @@ -58,7 +58,6 @@ *

        This class is for advanced usage and reflects the underlying API directly. */ @Generated("by gapic-generator-java") -@BetaApi public class HttpJsonAddressesStub extends AddressesStub { private static final TypeRegistry typeRegistry = TypeRegistry.newBuilder().add(Operation.getDescriptor()).build(); @@ -319,21 +318,49 @@ protected HttpJsonAddressesStub( HttpJsonCallSettings.newBuilder() .setMethodDescriptor(aggregatedListMethodDescriptor) .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("project", String.valueOf(request.getProject())); + return builder.build(); + }) .build(); HttpJsonCallSettings deleteTransportSettings = HttpJsonCallSettings.newBuilder() .setMethodDescriptor(deleteMethodDescriptor) .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("address", String.valueOf(request.getAddress())); + builder.add("project", String.valueOf(request.getProject())); + builder.add("region", String.valueOf(request.getRegion())); + return builder.build(); + }) .build(); HttpJsonCallSettings insertTransportSettings = HttpJsonCallSettings.newBuilder() .setMethodDescriptor(insertMethodDescriptor) .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("project", String.valueOf(request.getProject())); + builder.add("region", String.valueOf(request.getRegion())); + return builder.build(); + }) .build(); HttpJsonCallSettings listTransportSettings = HttpJsonCallSettings.newBuilder() .setMethodDescriptor(listMethodDescriptor) .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("project", String.valueOf(request.getProject())); + builder.add("region", String.valueOf(request.getRegion())); + return builder.build(); + }) .build(); this.aggregatedListCallable = diff --git a/test/integration/goldens/compute/src/com/google/cloud/compute/v1small/stub/HttpJsonRegionOperationsCallableFactory.java b/test/integration/goldens/compute/src/com/google/cloud/compute/v1small/stub/HttpJsonRegionOperationsCallableFactory.java index d1c106b52c..fd5187b104 100644 --- a/test/integration/goldens/compute/src/com/google/cloud/compute/v1small/stub/HttpJsonRegionOperationsCallableFactory.java +++ b/test/integration/goldens/compute/src/com/google/cloud/compute/v1small/stub/HttpJsonRegionOperationsCallableFactory.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,7 +16,6 @@ package com.google.cloud.compute.v1small.stub; -import com.google.api.core.BetaApi; import com.google.api.gax.httpjson.HttpJsonCallSettings; import com.google.api.gax.httpjson.HttpJsonCallableFactory; import com.google.api.gax.httpjson.HttpJsonOperationSnapshotCallable; @@ -41,7 +40,6 @@ *

        This class is for advanced usage. */ @Generated("by gapic-generator-java") -@BetaApi public class HttpJsonRegionOperationsCallableFactory implements HttpJsonStubCallableFactory { @@ -73,8 +71,6 @@ public UnaryCallable createBatchingCa httpJsonCallSettings, callSettings, clientContext); } - @BetaApi( - "The surface for long-running operations is not stable yet and may change in the future.") @Override public OperationCallable createOperationCallable( diff --git a/test/integration/goldens/compute/src/com/google/cloud/compute/v1small/stub/HttpJsonRegionOperationsStub.java b/test/integration/goldens/compute/src/com/google/cloud/compute/v1small/stub/HttpJsonRegionOperationsStub.java index 9e3ae4468e..e9e339169f 100644 --- a/test/integration/goldens/compute/src/com/google/cloud/compute/v1small/stub/HttpJsonRegionOperationsStub.java +++ b/test/integration/goldens/compute/src/com/google/cloud/compute/v1small/stub/HttpJsonRegionOperationsStub.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,7 +16,6 @@ package com.google.cloud.compute.v1small.stub; -import com.google.api.core.BetaApi; import com.google.api.core.InternalApi; import com.google.api.gax.core.BackgroundResource; import com.google.api.gax.core.BackgroundResourceAggregation; @@ -31,6 +30,7 @@ import com.google.api.gax.longrunning.OperationSnapshot; import com.google.api.gax.rpc.ClientContext; import com.google.api.gax.rpc.LongRunningClient; +import com.google.api.gax.rpc.RequestParamsBuilder; import com.google.api.gax.rpc.UnaryCallable; import com.google.cloud.compute.v1small.GetRegionOperationRequest; import com.google.cloud.compute.v1small.Operation; @@ -53,7 +53,6 @@ *

        This class is for advanced usage and reflects the underlying API directly. */ @Generated("by gapic-generator-java") -@BetaApi public class HttpJsonRegionOperationsStub extends RegionOperationsStub { private static final TypeRegistry typeRegistry = TypeRegistry.newBuilder().build(); @@ -197,11 +196,27 @@ protected HttpJsonRegionOperationsStub( HttpJsonCallSettings.newBuilder() .setMethodDescriptor(getMethodDescriptor) .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("operation", String.valueOf(request.getOperation())); + builder.add("project", String.valueOf(request.getProject())); + builder.add("region", String.valueOf(request.getRegion())); + return builder.build(); + }) .build(); HttpJsonCallSettings waitTransportSettings = HttpJsonCallSettings.newBuilder() .setMethodDescriptor(waitMethodDescriptor) .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("operation", String.valueOf(request.getOperation())); + builder.add("project", String.valueOf(request.getProject())); + builder.add("region", String.valueOf(request.getRegion())); + return builder.build(); + }) .build(); this.getCallable = diff --git a/test/integration/goldens/compute/src/com/google/cloud/compute/v1small/stub/RegionOperationsStub.java b/test/integration/goldens/compute/src/com/google/cloud/compute/v1small/stub/RegionOperationsStub.java index 1449fd94c9..94ac7ea0a8 100644 --- a/test/integration/goldens/compute/src/com/google/cloud/compute/v1small/stub/RegionOperationsStub.java +++ b/test/integration/goldens/compute/src/com/google/cloud/compute/v1small/stub/RegionOperationsStub.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,7 +16,6 @@ package com.google.cloud.compute.v1small.stub; -import com.google.api.core.BetaApi; import com.google.api.gax.core.BackgroundResource; import com.google.api.gax.rpc.LongRunningClient; import com.google.api.gax.rpc.UnaryCallable; @@ -34,7 +33,6 @@ @Generated("by gapic-generator-java") public abstract class RegionOperationsStub implements BackgroundResource { - @BetaApi public LongRunningClient longRunningClient() { throw new UnsupportedOperationException("Not implemented: longRunningClient()"); } diff --git a/test/integration/goldens/compute/src/com/google/cloud/compute/v1small/stub/RegionOperationsStubSettings.java b/test/integration/goldens/compute/src/com/google/cloud/compute/v1small/stub/RegionOperationsStubSettings.java index 5809c6a686..b3dbfe2957 100644 --- a/test/integration/goldens/compute/src/com/google/cloud/compute/v1small/stub/RegionOperationsStubSettings.java +++ b/test/integration/goldens/compute/src/com/google/cloud/compute/v1small/stub/RegionOperationsStubSettings.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -17,7 +17,7 @@ package com.google.cloud.compute.v1small.stub; import com.google.api.core.ApiFunction; -import com.google.api.core.BetaApi; +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; @@ -27,6 +27,7 @@ import com.google.api.gax.retrying.RetrySettings; import com.google.api.gax.rpc.ApiClientHeaderProvider; import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.LibraryMetadata; import com.google.api.gax.rpc.StatusCode; import com.google.api.gax.rpc.StubSettings; import com.google.api.gax.rpc.TransportChannelProvider; @@ -39,9 +40,9 @@ import com.google.common.collect.ImmutableSet; import com.google.common.collect.Lists; import java.io.IOException; +import java.time.Duration; import java.util.List; import javax.annotation.Generated; -import org.threeten.bp.Duration; // AUTO-GENERATED DOCUMENTATION AND CLASS. /** @@ -58,7 +59,9 @@ *

        The builder of this class is recursive, so contained classes are themselves builders. When * build() is called, the tree of builders is called to create the complete settings object. * - *

        For example, to set the total timeout of get to 30 seconds: + *

        For example, to set the + * [RetrySettings](https://cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.retrying.RetrySettings) + * of get: * *

        {@code
          * // This snippet has been automatically generated and should be regarded as a code template only.
        @@ -75,12 +78,24 @@
          *             .getSettings()
          *             .getRetrySettings()
          *             .toBuilder()
        - *             .setTotalTimeout(Duration.ofSeconds(30))
        + *             .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());
          * RegionOperationsStubSettings regionOperationsSettings = regionOperationsSettingsBuilder.build();
          * }
        + * + * Please refer to the [Client Side Retry + * Guide](https://docs.cloud.google.com/java/docs/client-retries) for additional support in setting + * retries. */ @Generated("by gapic-generator-java") +@SuppressWarnings("CanonicalDuration") public class RegionOperationsStubSettings extends StubSettings { /** The default scopes of the service. */ private static final ImmutableList DEFAULT_SERVICE_SCOPES = @@ -114,12 +129,19 @@ public RegionOperationsStub createStub() throws IOException { "Transport not supported: %s", getTransportChannelProvider().getTransportName())); } + /** Returns the default service name. */ + @Override + public String getServiceName() { + return "compute"; + } + /** 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 "compute.googleapis.com:443"; } @@ -151,7 +173,6 @@ public static TransportChannelProvider defaultTransportChannelProvider() { return defaultHttpJsonTransportProviderBuilder().build(); } - @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { return ApiClientHeaderProvider.newBuilder() .setGeneratedLibToken( @@ -183,6 +204,11 @@ protected RegionOperationsStubSettings(Builder settingsBuilder) throws IOExcepti waitSettings = settingsBuilder.waitSettings().build(); } + @Override + protected LibraryMetadata getLibraryMetadata() { + return LibraryMetadata.newBuilder().setVersion(Version.VERSION).build(); + } + /** Builder for RegionOperationsStubSettings. */ public static class Builder extends StubSettings.Builder { private final ImmutableList> unaryMethodSettingsBuilders; @@ -211,21 +237,21 @@ public static class Builder extends StubSettings.Builder delegates = new ArrayList<>(); + List scope = new ArrayList<>(); + Duration lifetime = Duration.newBuilder().build(); + + GenerateAccessTokenResponse actualResponse = + client.generateAccessToken(name, delegates, scope, lifetime); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void generateAccessTokenExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ServiceAccountName name = ServiceAccountName.of("[PROJECT]", "[SERVICE_ACCOUNT]"); + List delegates = new ArrayList<>(); + List scope = new ArrayList<>(); + Duration lifetime = Duration.newBuilder().build(); + client.generateAccessToken(name, delegates, scope, lifetime); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void generateAccessTokenTest2() throws Exception { + GenerateAccessTokenResponse expectedResponse = + GenerateAccessTokenResponse.newBuilder() + .setAccessToken("accessToken-1042689291") + .setExpireTime(Timestamp.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + String name = "projects/project-217/serviceAccounts/serviceAccount-217"; + List delegates = new ArrayList<>(); + List scope = new ArrayList<>(); + Duration lifetime = Duration.newBuilder().build(); + + GenerateAccessTokenResponse actualResponse = + client.generateAccessToken(name, delegates, scope, lifetime); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void generateAccessTokenExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String name = "projects/project-217/serviceAccounts/serviceAccount-217"; + List delegates = new ArrayList<>(); + List scope = new ArrayList<>(); + Duration lifetime = Duration.newBuilder().build(); + client.generateAccessToken(name, delegates, scope, lifetime); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void generateIdTokenTest() throws Exception { + GenerateIdTokenResponse expectedResponse = + GenerateIdTokenResponse.newBuilder().setToken("token110541305").build(); + mockService.addResponse(expectedResponse); + + ServiceAccountName name = ServiceAccountName.of("[PROJECT]", "[SERVICE_ACCOUNT]"); + List delegates = new ArrayList<>(); + String audience = "audience975628804"; + boolean includeEmail = true; + + GenerateIdTokenResponse actualResponse = + client.generateIdToken(name, delegates, audience, includeEmail); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void generateIdTokenExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ServiceAccountName name = ServiceAccountName.of("[PROJECT]", "[SERVICE_ACCOUNT]"); + List delegates = new ArrayList<>(); + String audience = "audience975628804"; + boolean includeEmail = true; + client.generateIdToken(name, delegates, audience, includeEmail); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void generateIdTokenTest2() throws Exception { + GenerateIdTokenResponse expectedResponse = + GenerateIdTokenResponse.newBuilder().setToken("token110541305").build(); + mockService.addResponse(expectedResponse); + + String name = "projects/project-217/serviceAccounts/serviceAccount-217"; + List delegates = new ArrayList<>(); + String audience = "audience975628804"; + boolean includeEmail = true; + + GenerateIdTokenResponse actualResponse = + client.generateIdToken(name, delegates, audience, includeEmail); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void generateIdTokenExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String name = "projects/project-217/serviceAccounts/serviceAccount-217"; + List delegates = new ArrayList<>(); + String audience = "audience975628804"; + boolean includeEmail = true; + client.generateIdToken(name, delegates, audience, includeEmail); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void signBlobTest() throws Exception { + SignBlobResponse expectedResponse = + SignBlobResponse.newBuilder() + .setKeyId("keyId101944282") + .setSignedBlob(ByteString.EMPTY) + .build(); + mockService.addResponse(expectedResponse); + + ServiceAccountName name = ServiceAccountName.of("[PROJECT]", "[SERVICE_ACCOUNT]"); + List delegates = new ArrayList<>(); + ByteString payload = ByteString.EMPTY; + + SignBlobResponse actualResponse = client.signBlob(name, delegates, payload); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void signBlobExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ServiceAccountName name = ServiceAccountName.of("[PROJECT]", "[SERVICE_ACCOUNT]"); + List delegates = new ArrayList<>(); + ByteString payload = ByteString.EMPTY; + client.signBlob(name, delegates, payload); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void signBlobTest2() throws Exception { + SignBlobResponse expectedResponse = + SignBlobResponse.newBuilder() + .setKeyId("keyId101944282") + .setSignedBlob(ByteString.EMPTY) + .build(); + mockService.addResponse(expectedResponse); + + String name = "projects/project-217/serviceAccounts/serviceAccount-217"; + List delegates = new ArrayList<>(); + ByteString payload = ByteString.EMPTY; + + SignBlobResponse actualResponse = client.signBlob(name, delegates, payload); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void signBlobExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String name = "projects/project-217/serviceAccounts/serviceAccount-217"; + List delegates = new ArrayList<>(); + ByteString payload = ByteString.EMPTY; + client.signBlob(name, delegates, payload); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void signJwtTest() throws Exception { + SignJwtResponse expectedResponse = + SignJwtResponse.newBuilder() + .setKeyId("keyId101944282") + .setSignedJwt("signedJwt1076760587") + .build(); + mockService.addResponse(expectedResponse); + + ServiceAccountName name = ServiceAccountName.of("[PROJECT]", "[SERVICE_ACCOUNT]"); + List delegates = new ArrayList<>(); + String payload = "payload-786701938"; + + SignJwtResponse actualResponse = client.signJwt(name, delegates, payload); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void signJwtExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ServiceAccountName name = ServiceAccountName.of("[PROJECT]", "[SERVICE_ACCOUNT]"); + List delegates = new ArrayList<>(); + String payload = "payload-786701938"; + client.signJwt(name, delegates, payload); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void signJwtTest2() throws Exception { + SignJwtResponse expectedResponse = + SignJwtResponse.newBuilder() + .setKeyId("keyId101944282") + .setSignedJwt("signedJwt1076760587") + .build(); + mockService.addResponse(expectedResponse); + + String name = "projects/project-217/serviceAccounts/serviceAccount-217"; + List delegates = new ArrayList<>(); + String payload = "payload-786701938"; + + SignJwtResponse actualResponse = client.signJwt(name, delegates, payload); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void signJwtExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String name = "projects/project-217/serviceAccounts/serviceAccount-217"; + List delegates = new ArrayList<>(); + String payload = "payload-786701938"; + client.signJwt(name, delegates, payload); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } +} diff --git a/test/integration/goldens/credentials/src/com/google/cloud/iam/credentials/v1/IAMCredentialsClientTest.java b/test/integration/goldens/credentials/src/com/google/cloud/iam/credentials/v1/IAMCredentialsClientTest.java index 645c5d35f2..29a3a55022 100644 --- a/test/integration/goldens/credentials/src/com/google/cloud/iam/credentials/v1/IAMCredentialsClientTest.java +++ b/test/integration/goldens/credentials/src/com/google/cloud/iam/credentials/v1/IAMCredentialsClientTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/credentials/src/com/google/cloud/iam/credentials/v1/IamCredentialsClient.java b/test/integration/goldens/credentials/src/com/google/cloud/iam/credentials/v1/IamCredentialsClient.java index 88c527025f..9480ea267a 100644 --- a/test/integration/goldens/credentials/src/com/google/cloud/iam/credentials/v1/IamCredentialsClient.java +++ b/test/integration/goldens/credentials/src/com/google/cloud/iam/credentials/v1/IamCredentialsClient.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -60,19 +60,90 @@ *

        Note: close() needs to be called on the IamCredentialsClient object to clean up resources such * as threads. In the example above, try-with-resources is used, which automatically calls close(). * - *

        The surface of this class includes several types of Java methods for each of the API's - * methods: - * - *

          - *
        1. A "flattened" method. With this type of method, the fields of the request type have been - * converted into function parameters. It may be the case that not all fields are available as - * parameters, and not every API method will have a flattened method entry point. - *
        2. A "request object" method. This type of method only takes one parameter, a request object, - * which must be constructed before the call. Not every API method will have a request object - * method. - *
        3. A "callable" method. This type of method takes no parameters and returns an immutable API - * callable object, which can be used to initiate calls to the service. - *
        + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + *
        Methods
        MethodDescriptionMethod Variants

        GenerateAccessToken

        Generates an OAuth 2.0 access token for a service account.

        + *

        Request object method variants only take one parameter, a request object, which must be constructed before the call.

        + *
          + *
        • generateAccessToken(GenerateAccessTokenRequest request) + *

        + *

        "Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

        + *
          + *
        • generateAccessToken(ServiceAccountName name, List<String> delegates, List<String> scope, Duration lifetime) + *

        • generateAccessToken(String name, List<String> delegates, List<String> scope, Duration lifetime) + *

        + *

        Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

        + *
          + *
        • generateAccessTokenCallable() + *

        + *

        GenerateIdToken

        Generates an OpenID Connect ID token for a service account.

        + *

        Request object method variants only take one parameter, a request object, which must be constructed before the call.

        + *
          + *
        • generateIdToken(GenerateIdTokenRequest request) + *

        + *

        "Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

        + *
          + *
        • generateIdToken(ServiceAccountName name, List<String> delegates, String audience, boolean includeEmail) + *

        • generateIdToken(String name, List<String> delegates, String audience, boolean includeEmail) + *

        + *

        Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

        + *
          + *
        • generateIdTokenCallable() + *

        + *

        SignBlob

        Signs a blob using a service account's system-managed private key.

        + *

        Request object method variants only take one parameter, a request object, which must be constructed before the call.

        + *
          + *
        • signBlob(SignBlobRequest request) + *

        + *

        "Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

        + *
          + *
        • signBlob(ServiceAccountName name, List<String> delegates, ByteString payload) + *

        • signBlob(String name, List<String> delegates, ByteString payload) + *

        + *

        Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

        + *
          + *
        • signBlobCallable() + *

        + *

        SignJwt

        Signs a JWT using a service account's system-managed private key.

        + *

        Request object method variants only take one parameter, a request object, which must be constructed before the call.

        + *
          + *
        • signJwt(SignJwtRequest request) + *

        + *

        "Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

        + *
          + *
        • signJwt(ServiceAccountName name, List<String> delegates, String payload) + *

        • signJwt(String name, List<String> delegates, String payload) + *

        + *

        Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

        + *
          + *
        • signJwtCallable() + *

        + *
        * *

        See the individual methods for example code. * @@ -111,6 +182,20 @@ * IamCredentialsClient iamCredentialsClient = IamCredentialsClient.create(iamCredentialsSettings); * } * + *

        To use REST (HTTP1.1/JSON) transport (instead of gRPC) for sending and receiving requests over + * the wire: + * + *

        {@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
        + * IamCredentialsSettings iamCredentialsSettings =
        + *     IamCredentialsSettings.newHttpJsonBuilder().build();
        + * IamCredentialsClient iamCredentialsClient = IamCredentialsClient.create(iamCredentialsSettings);
        + * }
        + * *

        Please refer to the GitHub repository's samples for more quickstart code snippets. */ @Generated("by gapic-generator-java") diff --git a/test/integration/goldens/credentials/src/com/google/cloud/iam/credentials/v1/IamCredentialsSettings.java b/test/integration/goldens/credentials/src/com/google/cloud/iam/credentials/v1/IamCredentialsSettings.java index 39fc7508ee..6a91546f37 100644 --- a/test/integration/goldens/credentials/src/com/google/cloud/iam/credentials/v1/IamCredentialsSettings.java +++ b/test/integration/goldens/credentials/src/com/google/cloud/iam/credentials/v1/IamCredentialsSettings.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -21,6 +21,7 @@ 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.httpjson.InstantiatingHttpJsonChannelProvider; import com.google.api.gax.rpc.ApiClientHeaderProvider; import com.google.api.gax.rpc.ClientContext; import com.google.api.gax.rpc.ClientSettings; @@ -48,7 +49,9 @@ *

        The builder of this class is recursive, so contained classes are themselves builders. When * build() is called, the tree of builders is called to create the complete settings object. * - *

        For example, to set the total timeout of generateAccessToken to 30 seconds: + *

        For example, to set the + * [RetrySettings](https://cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.retrying.RetrySettings) + * of generateAccessToken: * *

        {@code
          * // This snippet has been automatically generated and should be regarded as a code template only.
        @@ -65,10 +68,21 @@
          *             .generateAccessTokenSettings()
          *             .getRetrySettings()
          *             .toBuilder()
        - *             .setTotalTimeout(Duration.ofSeconds(30))
        + *             .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());
          * IamCredentialsSettings iamCredentialsSettings = iamCredentialsSettingsBuilder.build();
          * }
        + * + * Please refer to the [Client Side Retry + * Guide](https://docs.cloud.google.com/java/docs/client-retries) for additional support in setting + * retries. */ @Generated("by gapic-generator-java") public class IamCredentialsSettings extends ClientSettings { @@ -120,25 +134,36 @@ public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilde return IamCredentialsStubSettings.defaultCredentialsProviderBuilder(); } - /** Returns a builder for the default ChannelProvider for this service. */ + /** Returns a builder for the default gRPC ChannelProvider for this service. */ public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { return IamCredentialsStubSettings.defaultGrpcTransportProviderBuilder(); } + /** Returns a builder for the default REST ChannelProvider for this service. */ + @BetaApi + public static InstantiatingHttpJsonChannelProvider.Builder + defaultHttpJsonTransportProviderBuilder() { + return IamCredentialsStubSettings.defaultHttpJsonTransportProviderBuilder(); + } + public static TransportChannelProvider defaultTransportChannelProvider() { return IamCredentialsStubSettings.defaultTransportChannelProvider(); } - @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { return IamCredentialsStubSettings.defaultApiClientHeaderProviderBuilder(); } - /** Returns a new builder for this class. */ + /** Returns a new gRPC builder for this class. */ public static Builder newBuilder() { return Builder.createDefault(); } + /** Returns a new REST builder for this class. */ + public static Builder newHttpJsonBuilder() { + return Builder.createHttpJsonDefault(); + } + /** Returns a new builder for this class. */ public static Builder newBuilder(ClientContext clientContext) { return new Builder(clientContext); @@ -176,6 +201,10 @@ private static Builder createDefault() { return new Builder(IamCredentialsStubSettings.newBuilder()); } + private static Builder createHttpJsonDefault() { + return new Builder(IamCredentialsStubSettings.newHttpJsonBuilder()); + } + public IamCredentialsStubSettings.Builder getStubSettingsBuilder() { return ((IamCredentialsStubSettings.Builder) getStubSettings()); } diff --git a/test/integration/goldens/credentials/src/com/google/cloud/iam/credentials/v1/MockIAMCredentials.java b/test/integration/goldens/credentials/src/com/google/cloud/iam/credentials/v1/MockIAMCredentials.java index c6c2043b77..4a9ee47a2d 100644 --- a/test/integration/goldens/credentials/src/com/google/cloud/iam/credentials/v1/MockIAMCredentials.java +++ b/test/integration/goldens/credentials/src/com/google/cloud/iam/credentials/v1/MockIAMCredentials.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/credentials/src/com/google/cloud/iam/credentials/v1/MockIAMCredentialsImpl.java b/test/integration/goldens/credentials/src/com/google/cloud/iam/credentials/v1/MockIAMCredentialsImpl.java index 8d07b9c0e9..f368267fa9 100644 --- a/test/integration/goldens/credentials/src/com/google/cloud/iam/credentials/v1/MockIAMCredentialsImpl.java +++ b/test/integration/goldens/credentials/src/com/google/cloud/iam/credentials/v1/MockIAMCredentialsImpl.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/credentials/src/com/google/cloud/iam/credentials/v1/ServiceAccountName.java b/test/integration/goldens/credentials/src/com/google/cloud/iam/credentials/v1/ServiceAccountName.java index 8b33ba87f7..d538857c2a 100644 --- a/test/integration/goldens/credentials/src/com/google/cloud/iam/credentials/v1/ServiceAccountName.java +++ b/test/integration/goldens/credentials/src/com/google/cloud/iam/credentials/v1/ServiceAccountName.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -138,7 +138,7 @@ public boolean equals(Object o) { if (o == this) { return true; } - if (o != null || getClass() == o.getClass()) { + if (o != null && getClass() == o.getClass()) { ServiceAccountName that = ((ServiceAccountName) o); return Objects.equals(this.project, that.project) && Objects.equals(this.serviceAccount, that.serviceAccount); diff --git a/test/integration/goldens/credentials/src/com/google/cloud/iam/credentials/v1/package-info.java b/test/integration/goldens/credentials/src/com/google/cloud/iam/credentials/v1/package-info.java index ab0c43dcfc..66ec3078f4 100644 --- a/test/integration/goldens/credentials/src/com/google/cloud/iam/credentials/v1/package-info.java +++ b/test/integration/goldens/credentials/src/com/google/cloud/iam/credentials/v1/package-info.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/credentials/src/com/google/cloud/iam/credentials/v1/stub/GrpcIamCredentialsCallableFactory.java b/test/integration/goldens/credentials/src/com/google/cloud/iam/credentials/v1/stub/GrpcIamCredentialsCallableFactory.java index a72a202220..719369a4a7 100644 --- a/test/integration/goldens/credentials/src/com/google/cloud/iam/credentials/v1/stub/GrpcIamCredentialsCallableFactory.java +++ b/test/integration/goldens/credentials/src/com/google/cloud/iam/credentials/v1/stub/GrpcIamCredentialsCallableFactory.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/credentials/src/com/google/cloud/iam/credentials/v1/stub/GrpcIamCredentialsStub.java b/test/integration/goldens/credentials/src/com/google/cloud/iam/credentials/v1/stub/GrpcIamCredentialsStub.java index f0086734a9..7bcb37dd59 100644 --- a/test/integration/goldens/credentials/src/com/google/cloud/iam/credentials/v1/stub/GrpcIamCredentialsStub.java +++ b/test/integration/goldens/credentials/src/com/google/cloud/iam/credentials/v1/stub/GrpcIamCredentialsStub.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -21,6 +21,7 @@ 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.cloud.iam.credentials.v1.GenerateAccessTokenRequest; import com.google.cloud.iam.credentials.v1.GenerateAccessTokenResponse; @@ -30,7 +31,6 @@ import com.google.cloud.iam.credentials.v1.SignBlobResponse; import com.google.cloud.iam.credentials.v1.SignJwtRequest; import com.google.cloud.iam.credentials.v1.SignJwtResponse; -import com.google.common.collect.ImmutableMap; import com.google.longrunning.stub.GrpcOperationsStub; import io.grpc.MethodDescriptor; import io.grpc.protobuf.ProtoUtils; @@ -56,6 +56,7 @@ public class GrpcIamCredentialsStub extends IamCredentialsStub { ProtoUtils.marshaller(GenerateAccessTokenRequest.getDefaultInstance())) .setResponseMarshaller( ProtoUtils.marshaller(GenerateAccessTokenResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) .build(); private static final MethodDescriptor @@ -67,6 +68,7 @@ public class GrpcIamCredentialsStub extends IamCredentialsStub { ProtoUtils.marshaller(GenerateIdTokenRequest.getDefaultInstance())) .setResponseMarshaller( ProtoUtils.marshaller(GenerateIdTokenResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) .build(); private static final MethodDescriptor @@ -76,6 +78,7 @@ public class GrpcIamCredentialsStub extends IamCredentialsStub { .setFullMethodName("google.iam.credentials.v1.IAMCredentials/SignBlob") .setRequestMarshaller(ProtoUtils.marshaller(SignBlobRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(SignBlobResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) .build(); private static final MethodDescriptor signJwtMethodDescriptor = @@ -84,6 +87,7 @@ public class GrpcIamCredentialsStub extends IamCredentialsStub { .setFullMethodName("google.iam.credentials.v1.IAMCredentials/SignJwt") .setRequestMarshaller(ProtoUtils.marshaller(SignJwtRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(SignJwtResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) .build(); private final UnaryCallable @@ -143,10 +147,11 @@ protected GrpcIamCredentialsStub( .setMethodDescriptor(generateAccessTokenMethodDescriptor) .setParamsExtractor( request -> { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("name", String.valueOf(request.getName())); - return params.build(); + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); }) + .setResourceNameExtractor(request -> request.getName()) .build(); GrpcCallSettings generateIdTokenTransportSettings = @@ -154,30 +159,33 @@ protected GrpcIamCredentialsStub( .setMethodDescriptor(generateIdTokenMethodDescriptor) .setParamsExtractor( request -> { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("name", String.valueOf(request.getName())); - return params.build(); + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); }) + .setResourceNameExtractor(request -> request.getName()) .build(); GrpcCallSettings signBlobTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(signBlobMethodDescriptor) .setParamsExtractor( request -> { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("name", String.valueOf(request.getName())); - return params.build(); + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); }) + .setResourceNameExtractor(request -> request.getName()) .build(); GrpcCallSettings signJwtTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(signJwtMethodDescriptor) .setParamsExtractor( request -> { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("name", String.valueOf(request.getName())); - return params.build(); + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); }) + .setResourceNameExtractor(request -> request.getName()) .build(); this.generateAccessTokenCallable = diff --git a/test/integration/goldens/credentials/src/com/google/cloud/iam/credentials/v1/stub/HttpJsonIamCredentialsCallableFactory.java b/test/integration/goldens/credentials/src/com/google/cloud/iam/credentials/v1/stub/HttpJsonIamCredentialsCallableFactory.java new file mode 100644 index 0000000000..fcd9f51b7a --- /dev/null +++ b/test/integration/goldens/credentials/src/com/google/cloud/iam/credentials/v1/stub/HttpJsonIamCredentialsCallableFactory.java @@ -0,0 +1,101 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS 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.iam.credentials.v1.stub; + +import com.google.api.gax.httpjson.HttpJsonCallSettings; +import com.google.api.gax.httpjson.HttpJsonCallableFactory; +import com.google.api.gax.httpjson.HttpJsonOperationSnapshotCallable; +import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; +import com.google.api.gax.httpjson.longrunning.stub.OperationsStub; +import com.google.api.gax.rpc.BatchingCallSettings; +import com.google.api.gax.rpc.ClientContext; +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.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.longrunning.Operation; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * REST callable factory implementation for the IAMCredentials service API. + * + *

        This class is for advanced usage. + */ +@Generated("by gapic-generator-java") +public class HttpJsonIamCredentialsCallableFactory + implements HttpJsonStubCallableFactory { + + @Override + public UnaryCallable createUnaryCallable( + HttpJsonCallSettings httpJsonCallSettings, + UnaryCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createUnaryCallable( + httpJsonCallSettings, callSettings, clientContext); + } + + @Override + public + UnaryCallable createPagedCallable( + HttpJsonCallSettings httpJsonCallSettings, + PagedCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createPagedCallable( + httpJsonCallSettings, callSettings, clientContext); + } + + @Override + public UnaryCallable createBatchingCallable( + HttpJsonCallSettings httpJsonCallSettings, + BatchingCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createBatchingCallable( + httpJsonCallSettings, callSettings, clientContext); + } + + @Override + public + OperationCallable createOperationCallable( + HttpJsonCallSettings httpJsonCallSettings, + OperationCallSettings callSettings, + ClientContext clientContext, + OperationsStub operationsStub) { + UnaryCallable innerCallable = + HttpJsonCallableFactory.createBaseUnaryCallable( + httpJsonCallSettings, callSettings.getInitialCallSettings(), clientContext); + HttpJsonOperationSnapshotCallable initialCallable = + new HttpJsonOperationSnapshotCallable( + innerCallable, + httpJsonCallSettings.getMethodDescriptor().getOperationSnapshotFactory()); + return HttpJsonCallableFactory.createOperationCallable( + callSettings, clientContext, operationsStub.longRunningClient(), initialCallable); + } + + @Override + public + ServerStreamingCallable createServerStreamingCallable( + HttpJsonCallSettings httpJsonCallSettings, + ServerStreamingCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createServerStreamingCallable( + httpJsonCallSettings, callSettings, clientContext); + } +} diff --git a/test/integration/goldens/credentials/src/com/google/cloud/iam/credentials/v1/stub/HttpJsonIamCredentialsStub.java b/test/integration/goldens/credentials/src/com/google/cloud/iam/credentials/v1/stub/HttpJsonIamCredentialsStub.java new file mode 100644 index 0000000000..979fd23d11 --- /dev/null +++ b/test/integration/goldens/credentials/src/com/google/cloud/iam/credentials/v1/stub/HttpJsonIamCredentialsStub.java @@ -0,0 +1,392 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS 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.iam.credentials.v1.stub; + +import com.google.api.core.InternalApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.httpjson.ApiMethodDescriptor; +import com.google.api.gax.httpjson.HttpJsonCallSettings; +import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; +import com.google.api.gax.httpjson.ProtoMessageRequestFormatter; +import com.google.api.gax.httpjson.ProtoMessageResponseParser; +import com.google.api.gax.httpjson.ProtoRestSerializer; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.RequestParamsBuilder; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.iam.credentials.v1.GenerateAccessTokenRequest; +import com.google.cloud.iam.credentials.v1.GenerateAccessTokenResponse; +import com.google.cloud.iam.credentials.v1.GenerateIdTokenRequest; +import com.google.cloud.iam.credentials.v1.GenerateIdTokenResponse; +import com.google.cloud.iam.credentials.v1.SignBlobRequest; +import com.google.cloud.iam.credentials.v1.SignBlobResponse; +import com.google.cloud.iam.credentials.v1.SignJwtRequest; +import com.google.cloud.iam.credentials.v1.SignJwtResponse; +import com.google.protobuf.TypeRegistry; +import java.io.IOException; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * REST stub implementation for the IAMCredentials service API. + * + *

        This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by gapic-generator-java") +public class HttpJsonIamCredentialsStub extends IamCredentialsStub { + private static final TypeRegistry typeRegistry = TypeRegistry.newBuilder().build(); + + private static final ApiMethodDescriptor + generateAccessTokenMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.iam.credentials.v1.IAMCredentials/GenerateAccessToken") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{name=projects/*/serviceAccounts/*}:generateAccessToken", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("*", request.toBuilder().clearName().build(), true)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(GenerateAccessTokenResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + generateIdTokenMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.iam.credentials.v1.IAMCredentials/GenerateIdToken") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{name=projects/*/serviceAccounts/*}:generateIdToken", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("*", request.toBuilder().clearName().build(), true)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(GenerateIdTokenResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + signBlobMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.iam.credentials.v1.IAMCredentials/SignBlob") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{name=projects/*/serviceAccounts/*}:signBlob", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("*", request.toBuilder().clearName().build(), true)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(SignBlobResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + signJwtMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.iam.credentials.v1.IAMCredentials/SignJwt") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{name=projects/*/serviceAccounts/*}:signJwt", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("*", request.toBuilder().clearName().build(), true)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(SignJwtResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private final UnaryCallable + generateAccessTokenCallable; + private final UnaryCallable + generateIdTokenCallable; + private final UnaryCallable signBlobCallable; + private final UnaryCallable signJwtCallable; + + private final BackgroundResource backgroundResources; + private final HttpJsonStubCallableFactory callableFactory; + + public static final HttpJsonIamCredentialsStub create(IamCredentialsStubSettings settings) + throws IOException { + return new HttpJsonIamCredentialsStub(settings, ClientContext.create(settings)); + } + + public static final HttpJsonIamCredentialsStub create(ClientContext clientContext) + throws IOException { + return new HttpJsonIamCredentialsStub( + IamCredentialsStubSettings.newHttpJsonBuilder().build(), clientContext); + } + + public static final HttpJsonIamCredentialsStub create( + ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { + return new HttpJsonIamCredentialsStub( + IamCredentialsStubSettings.newHttpJsonBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of HttpJsonIamCredentialsStub, 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 HttpJsonIamCredentialsStub( + IamCredentialsStubSettings settings, ClientContext clientContext) throws IOException { + this(settings, clientContext, new HttpJsonIamCredentialsCallableFactory()); + } + + /** + * Constructs an instance of HttpJsonIamCredentialsStub, 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 HttpJsonIamCredentialsStub( + IamCredentialsStubSettings settings, + ClientContext clientContext, + HttpJsonStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + + HttpJsonCallSettings + generateAccessTokenTransportSettings = + HttpJsonCallSettings + .newBuilder() + .setMethodDescriptor(generateAccessTokenMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .setResourceNameExtractor(request -> request.getName()) + .build(); + HttpJsonCallSettings + generateIdTokenTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(generateIdTokenMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .setResourceNameExtractor(request -> request.getName()) + .build(); + HttpJsonCallSettings signBlobTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(signBlobMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .setResourceNameExtractor(request -> request.getName()) + .build(); + HttpJsonCallSettings signJwtTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(signJwtMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .setResourceNameExtractor(request -> request.getName()) + .build(); + + this.generateAccessTokenCallable = + callableFactory.createUnaryCallable( + generateAccessTokenTransportSettings, + settings.generateAccessTokenSettings(), + clientContext); + this.generateIdTokenCallable = + callableFactory.createUnaryCallable( + generateIdTokenTransportSettings, settings.generateIdTokenSettings(), clientContext); + this.signBlobCallable = + callableFactory.createUnaryCallable( + signBlobTransportSettings, settings.signBlobSettings(), clientContext); + this.signJwtCallable = + callableFactory.createUnaryCallable( + signJwtTransportSettings, settings.signJwtSettings(), clientContext); + + this.backgroundResources = + new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + @InternalApi + public static List getMethodDescriptors() { + List methodDescriptors = new ArrayList<>(); + methodDescriptors.add(generateAccessTokenMethodDescriptor); + methodDescriptors.add(generateIdTokenMethodDescriptor); + methodDescriptors.add(signBlobMethodDescriptor); + methodDescriptors.add(signJwtMethodDescriptor); + return methodDescriptors; + } + + @Override + public UnaryCallable + generateAccessTokenCallable() { + return generateAccessTokenCallable; + } + + @Override + public UnaryCallable generateIdTokenCallable() { + return generateIdTokenCallable; + } + + @Override + public UnaryCallable signBlobCallable() { + return signBlobCallable; + } + + @Override + public UnaryCallable signJwtCallable() { + return signJwtCallable; + } + + @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/test/integration/goldens/credentials/src/com/google/cloud/iam/credentials/v1/stub/IamCredentialsStub.java b/test/integration/goldens/credentials/src/com/google/cloud/iam/credentials/v1/stub/IamCredentialsStub.java index 82f5375e2a..e7a22e224f 100644 --- a/test/integration/goldens/credentials/src/com/google/cloud/iam/credentials/v1/stub/IamCredentialsStub.java +++ b/test/integration/goldens/credentials/src/com/google/cloud/iam/credentials/v1/stub/IamCredentialsStub.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/credentials/src/com/google/cloud/iam/credentials/v1/stub/IamCredentialsStubSettings.java b/test/integration/goldens/credentials/src/com/google/cloud/iam/credentials/v1/stub/IamCredentialsStubSettings.java index ffee6a4577..679064dd4c 100644 --- a/test/integration/goldens/credentials/src/com/google/cloud/iam/credentials/v1/stub/IamCredentialsStubSettings.java +++ b/test/integration/goldens/credentials/src/com/google/cloud/iam/credentials/v1/stub/IamCredentialsStubSettings.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -18,15 +18,20 @@ import com.google.api.core.ApiFunction; import com.google.api.core.BetaApi; +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.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.HttpJsonTransportChannel; +import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; import com.google.api.gax.retrying.RetrySettings; import com.google.api.gax.rpc.ApiClientHeaderProvider; import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.LibraryMetadata; import com.google.api.gax.rpc.StatusCode; import com.google.api.gax.rpc.StubSettings; import com.google.api.gax.rpc.TransportChannelProvider; @@ -44,9 +49,9 @@ import com.google.common.collect.ImmutableSet; import com.google.common.collect.Lists; import java.io.IOException; +import java.time.Duration; import java.util.List; import javax.annotation.Generated; -import org.threeten.bp.Duration; // AUTO-GENERATED DOCUMENTATION AND CLASS. /** @@ -64,7 +69,9 @@ *

        The builder of this class is recursive, so contained classes are themselves builders. When * build() is called, the tree of builders is called to create the complete settings object. * - *

        For example, to set the total timeout of generateAccessToken to 30 seconds: + *

        For example, to set the + * [RetrySettings](https://cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.retrying.RetrySettings) + * of generateAccessToken: * *

        {@code
          * // This snippet has been automatically generated and should be regarded as a code template only.
        @@ -81,12 +88,24 @@
          *             .generateAccessTokenSettings()
          *             .getRetrySettings()
          *             .toBuilder()
        - *             .setTotalTimeout(Duration.ofSeconds(30))
        + *             .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());
          * IamCredentialsStubSettings iamCredentialsSettings = iamCredentialsSettingsBuilder.build();
          * }
        + * + * Please refer to the [Client Side Retry + * Guide](https://docs.cloud.google.com/java/docs/client-retries) for additional support in setting + * retries. */ @Generated("by gapic-generator-java") +@SuppressWarnings("CanonicalDuration") public class IamCredentialsStubSettings extends StubSettings { /** The default scopes of the service. */ private static final ImmutableList DEFAULT_SERVICE_SCOPES = @@ -127,17 +146,29 @@ public IamCredentialsStub createStub() throws IOException { .equals(GrpcTransportChannel.getGrpcTransportName())) { return GrpcIamCredentialsStub.create(this); } + if (getTransportChannelProvider() + .getTransportName() + .equals(HttpJsonTransportChannel.getHttpJsonTransportName())) { + return HttpJsonIamCredentialsStub.create(this); + } throw new UnsupportedOperationException( String.format( "Transport not supported: %s", getTransportChannelProvider().getTransportName())); } + /** Returns the default service name. */ + @Override + public String getServiceName() { + return "iamcredentials"; + } + /** 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 "iamcredentials.googleapis.com:443"; } @@ -159,18 +190,24 @@ public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilde .setUseJwtAccessWithScope(true); } - /** Returns a builder for the default ChannelProvider for this service. */ + /** Returns a builder for the default gRPC ChannelProvider for this service. */ public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { return InstantiatingGrpcChannelProvider.newBuilder() .setMaxInboundMessageSize(Integer.MAX_VALUE); } + /** Returns a builder for the default REST ChannelProvider for this service. */ + @BetaApi + public static InstantiatingHttpJsonChannelProvider.Builder + defaultHttpJsonTransportProviderBuilder() { + return InstantiatingHttpJsonChannelProvider.newBuilder(); + } + public static TransportChannelProvider defaultTransportChannelProvider() { return defaultGrpcTransportProviderBuilder().build(); } - @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") - public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + public static ApiClientHeaderProvider.Builder defaultGrpcApiClientHeaderProviderBuilder() { return ApiClientHeaderProvider.newBuilder() .setGeneratedLibToken( "gapic", GaxProperties.getLibraryVersion(IamCredentialsStubSettings.class)) @@ -178,11 +215,29 @@ public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuil GaxGrpcProperties.getGrpcTokenName(), GaxGrpcProperties.getGrpcVersion()); } - /** Returns a new builder for this class. */ + public static ApiClientHeaderProvider.Builder defaultHttpJsonApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken( + "gapic", GaxProperties.getLibraryVersion(IamCredentialsStubSettings.class)) + .setTransportToken( + GaxHttpJsonProperties.getHttpJsonTokenName(), + GaxHttpJsonProperties.getHttpJsonVersion()); + } + + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return IamCredentialsStubSettings.defaultGrpcApiClientHeaderProviderBuilder(); + } + + /** Returns a new gRPC builder for this class. */ public static Builder newBuilder() { return Builder.createDefault(); } + /** Returns a new REST builder for this class. */ + public static Builder newHttpJsonBuilder() { + return Builder.createHttpJsonDefault(); + } + /** Returns a new builder for this class. */ public static Builder newBuilder(ClientContext clientContext) { return new Builder(clientContext); @@ -202,6 +257,11 @@ protected IamCredentialsStubSettings(Builder settingsBuilder) throws IOException signJwtSettings = settingsBuilder.signJwtSettings().build(); } + @Override + protected LibraryMetadata getLibraryMetadata() { + return LibraryMetadata.newBuilder().setVersion(Version.VERSION).build(); + } + /** Builder for IamCredentialsStubSettings. */ public static class Builder extends StubSettings.Builder { private final ImmutableList> unaryMethodSettingsBuilders; @@ -232,13 +292,13 @@ public static class Builder extends StubSettings.Builder future = iAMPolicyClient.setIamPolicyCallable().futureCall(request); // Do something. diff --git a/test/integration/goldens/iam/samples/snippets/generated/main/java/com/google/iam/v1/iampolicy/setiampolicy/SyncSetIamPolicy.java b/test/integration/goldens/iam/samples/snippets/generated/main/java/com/google/iam/v1/iampolicy/setiampolicy/SyncSetIamPolicy.java index 55d362db48..213646a79f 100644 --- a/test/integration/goldens/iam/samples/snippets/generated/main/java/com/google/iam/v1/iampolicy/setiampolicy/SyncSetIamPolicy.java +++ b/test/integration/goldens/iam/samples/snippets/generated/main/java/com/google/iam/v1/iampolicy/setiampolicy/SyncSetIamPolicy.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -20,6 +20,7 @@ import com.google.iam.v1.IAMPolicyClient; import com.google.iam.v1.Policy; import com.google.iam.v1.SetIamPolicyRequest; +import com.google.protobuf.FieldMask; public class SyncSetIamPolicy { @@ -38,6 +39,7 @@ public static void syncSetIamPolicy() throws Exception { SetIamPolicyRequest.newBuilder() .setResource("SetIamPolicyRequest1223629066".toString()) .setPolicy(Policy.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) .build(); Policy response = iAMPolicyClient.setIamPolicy(request); } diff --git a/test/integration/goldens/iam/samples/snippets/generated/main/java/com/google/iam/v1/iampolicy/testiampermissions/AsyncTestIamPermissions.java b/test/integration/goldens/iam/samples/snippets/generated/main/java/com/google/iam/v1/iampolicy/testiampermissions/AsyncTestIamPermissions.java index ebaa1ba351..ee5a700df8 100644 --- a/test/integration/goldens/iam/samples/snippets/generated/main/java/com/google/iam/v1/iampolicy/testiampermissions/AsyncTestIamPermissions.java +++ b/test/integration/goldens/iam/samples/snippets/generated/main/java/com/google/iam/v1/iampolicy/testiampermissions/AsyncTestIamPermissions.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/iam/samples/snippets/generated/main/java/com/google/iam/v1/iampolicy/testiampermissions/SyncTestIamPermissions.java b/test/integration/goldens/iam/samples/snippets/generated/main/java/com/google/iam/v1/iampolicy/testiampermissions/SyncTestIamPermissions.java index 70921f8b0f..f76b7e39b1 100644 --- a/test/integration/goldens/iam/samples/snippets/generated/main/java/com/google/iam/v1/iampolicy/testiampermissions/SyncTestIamPermissions.java +++ b/test/integration/goldens/iam/samples/snippets/generated/main/java/com/google/iam/v1/iampolicy/testiampermissions/SyncTestIamPermissions.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/iam/samples/snippets/generated/main/java/com/google/iam/v1/iampolicysettings/setiampolicy/SyncSetIamPolicy.java b/test/integration/goldens/iam/samples/snippets/generated/main/java/com/google/iam/v1/iampolicysettings/setiampolicy/SyncSetIamPolicy.java index f97670d70b..0cafa15517 100644 --- a/test/integration/goldens/iam/samples/snippets/generated/main/java/com/google/iam/v1/iampolicysettings/setiampolicy/SyncSetIamPolicy.java +++ b/test/integration/goldens/iam/samples/snippets/generated/main/java/com/google/iam/v1/iampolicysettings/setiampolicy/SyncSetIamPolicy.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -40,7 +40,14 @@ public static void syncSetIamPolicy() throws Exception { .setIamPolicySettings() .getRetrySettings() .toBuilder() - .setTotalTimeout(Duration.ofSeconds(30)) + .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()); IAMPolicySettings iAMPolicySettings = iAMPolicySettingsBuilder.build(); } diff --git a/test/integration/goldens/iam/samples/snippets/generated/main/java/com/google/iam/v1/stub/iampolicystubsettings/setiampolicy/SyncSetIamPolicy.java b/test/integration/goldens/iam/samples/snippets/generated/main/java/com/google/iam/v1/stub/iampolicystubsettings/setiampolicy/SyncSetIamPolicy.java index 326c24a6dc..770229bd0b 100644 --- a/test/integration/goldens/iam/samples/snippets/generated/main/java/com/google/iam/v1/stub/iampolicystubsettings/setiampolicy/SyncSetIamPolicy.java +++ b/test/integration/goldens/iam/samples/snippets/generated/main/java/com/google/iam/v1/stub/iampolicystubsettings/setiampolicy/SyncSetIamPolicy.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -40,7 +40,14 @@ public static void syncSetIamPolicy() throws Exception { .setIamPolicySettings() .getRetrySettings() .toBuilder() - .setTotalTimeout(Duration.ofSeconds(30)) + .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()); IAMPolicyStubSettings iAMPolicySettings = iAMPolicySettingsBuilder.build(); } diff --git a/test/integration/goldens/iam/src/META-INF/native-image/com.google.iam.v1/reflect-config.json b/test/integration/goldens/iam/src/META-INF/native-image/com.google.iam.v1/reflect-config.json new file mode 100644 index 0000000000..131ec90017 --- /dev/null +++ b/test/integration/goldens/iam/src/META-INF/native-image/com.google.iam.v1/reflect-config.json @@ -0,0 +1,1406 @@ +[ + { + "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.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.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.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.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.iam.v1.AuditConfig", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.iam.v1.AuditConfig$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.iam.v1.AuditConfigDelta", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.iam.v1.AuditConfigDelta$Action", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.iam.v1.AuditConfigDelta$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.iam.v1.AuditLogConfig", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.iam.v1.AuditLogConfig$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.iam.v1.AuditLogConfig$LogType", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.iam.v1.Binding", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.iam.v1.Binding$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.iam.v1.BindingDelta", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.iam.v1.BindingDelta$Action", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.iam.v1.BindingDelta$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.iam.v1.GetIamPolicyRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.iam.v1.GetIamPolicyRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.iam.v1.GetPolicyOptions", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.iam.v1.GetPolicyOptions$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.iam.v1.Policy", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.iam.v1.Policy$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.iam.v1.PolicyDelta", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.iam.v1.PolicyDelta$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.iam.v1.SetIamPolicyRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.iam.v1.SetIamPolicyRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.iam.v1.TestIamPermissionsRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.iam.v1.TestIamPermissionsRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.iam.v1.TestIamPermissionsResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.iam.v1.TestIamPermissionsResponse$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.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.type.Expr", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.type.Expr$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + } +] \ No newline at end of file diff --git a/test/integration/goldens/iam/src/com/google/iam/v1/IAMPolicyClient.java b/test/integration/goldens/iam/src/com/google/iam/v1/IAMPolicyClient.java index 83f9baa309..2e72baf90e 100644 --- a/test/integration/goldens/iam/src/com/google/iam/v1/IAMPolicyClient.java +++ b/test/integration/goldens/iam/src/com/google/iam/v1/IAMPolicyClient.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -26,7 +26,7 @@ // AUTO-GENERATED DOCUMENTATION AND CLASS. /** - * Service Description: ## API Overview + * Service Description: API Overview * *

        Manages Identity and Access Management (IAM) policies. * @@ -63,6 +63,7 @@ * SetIamPolicyRequest.newBuilder() * .setResource("SetIamPolicyRequest1223629066".toString()) * .setPolicy(Policy.newBuilder().build()) + * .setUpdateMask(FieldMask.newBuilder().build()) * .build(); * Policy response = iAMPolicyClient.setIamPolicy(request); * } @@ -71,19 +72,58 @@ *

        Note: close() needs to be called on the IAMPolicyClient object to clean up resources such as * threads. In the example above, try-with-resources is used, which automatically calls close(). * - *

        The surface of this class includes several types of Java methods for each of the API's - * methods: - * - *

          - *
        1. A "flattened" method. With this type of method, the fields of the request type have been - * converted into function parameters. It may be the case that not all fields are available as - * parameters, and not every API method will have a flattened method entry point. - *
        2. A "request object" method. This type of method only takes one parameter, a request object, - * which must be constructed before the call. Not every API method will have a request object - * method. - *
        3. A "callable" method. This type of method takes no parameters and returns an immutable API - * callable object, which can be used to initiate calls to the service. - *
        + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + *
        Methods
        MethodDescriptionMethod Variants

        SetIamPolicy

        Sets the access control policy on the specified resource. Replaces any existing policy. + *

        Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED` errors.

        + *

        Request object method variants only take one parameter, a request object, which must be constructed before the call.

        + *
          + *
        • setIamPolicy(SetIamPolicyRequest request) + *

        + *

        Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

        + *
          + *
        • setIamPolicyCallable() + *

        + *

        GetIamPolicy

        Gets the access control policy for a resource. Returns an empty policy if the resource exists and does not have a policy set.

        + *

        Request object method variants only take one parameter, a request object, which must be constructed before the call.

        + *
          + *
        • getIamPolicy(GetIamPolicyRequest request) + *

        + *

        Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

        + *
          + *
        • getIamPolicyCallable() + *

        + *

        TestIamPermissions

        Returns permissions that a caller has on the specified resource. If the resource does not exist, this will return an empty set of permissions, not a `NOT_FOUND` error. + *

        Note: This operation is designed to be used for building permission-aware UIs and command-line tools, not for authorization checking. This operation may "fail open" without warning.

        + *

        Request object method variants only take one parameter, a request object, which must be constructed before the call.

        + *
          + *
        • testIamPermissions(TestIamPermissionsRequest request) + *

        + *

        Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

        + *
          + *
        • testIamPermissionsCallable() + *

        + *
        * *

        See the individual methods for example code. * @@ -176,6 +216,8 @@ public IAMPolicyStub getStub() { /** * Sets the access control policy on the specified resource. Replaces any existing policy. * + *

        Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED` errors. + * *

        Sample code: * *

        {@code
        @@ -189,6 +231,7 @@ public IAMPolicyStub getStub() {
            *       SetIamPolicyRequest.newBuilder()
            *           .setResource("SetIamPolicyRequest1223629066".toString())
            *           .setPolicy(Policy.newBuilder().build())
        +   *           .setUpdateMask(FieldMask.newBuilder().build())
            *           .build();
            *   Policy response = iAMPolicyClient.setIamPolicy(request);
            * }
        @@ -205,6 +248,8 @@ public final Policy setIamPolicy(SetIamPolicyRequest request) {
           /**
            * Sets the access control policy on the specified resource. Replaces any existing policy.
            *
        +   * 

        Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED` errors. + * *

        Sample code: * *

        {@code
        @@ -218,6 +263,7 @@ public final Policy setIamPolicy(SetIamPolicyRequest request) {
            *       SetIamPolicyRequest.newBuilder()
            *           .setResource("SetIamPolicyRequest1223629066".toString())
            *           .setPolicy(Policy.newBuilder().build())
        +   *           .setUpdateMask(FieldMask.newBuilder().build())
            *           .build();
            *   ApiFuture future = iAMPolicyClient.setIamPolicyCallable().futureCall(request);
            *   // Do something.
        @@ -291,7 +337,7 @@ public final UnaryCallable getIamPolicyCallable() {
           // AUTO-GENERATED DOCUMENTATION AND METHOD.
           /**
            * Returns permissions that a caller has on the specified resource. If the resource does not
        -   * exist, this will return an empty set of permissions, not a NOT_FOUND error.
        +   * exist, this will return an empty set of permissions, not a `NOT_FOUND` error.
            *
            * 

        Note: This operation is designed to be used for building permission-aware UIs and * command-line tools, not for authorization checking. This operation may "fail open" without @@ -325,7 +371,7 @@ public final TestIamPermissionsResponse testIamPermissions(TestIamPermissionsReq // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Returns permissions that a caller has on the specified resource. If the resource does not - * exist, this will return an empty set of permissions, not a NOT_FOUND error. + * exist, this will return an empty set of permissions, not a `NOT_FOUND` error. * *

        Note: This operation is designed to be used for building permission-aware UIs and * command-line tools, not for authorization checking. This operation may "fail open" without diff --git a/test/integration/goldens/iam/src/com/google/iam/v1/IAMPolicyClientTest.java b/test/integration/goldens/iam/src/com/google/iam/v1/IAMPolicyClientTest.java index 95c8ce15a5..1c516f247c 100644 --- a/test/integration/goldens/iam/src/com/google/iam/v1/IAMPolicyClientTest.java +++ b/test/integration/goldens/iam/src/com/google/iam/v1/IAMPolicyClientTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -25,6 +25,7 @@ import com.google.api.gax.rpc.InvalidArgumentException; import com.google.protobuf.AbstractMessage; import com.google.protobuf.ByteString; +import com.google.protobuf.FieldMask; import io.grpc.StatusRuntimeException; import java.io.IOException; import java.util.ArrayList; @@ -83,6 +84,7 @@ public void setIamPolicyTest() throws Exception { Policy.newBuilder() .setVersion(351608024) .addAllBindings(new ArrayList()) + .addAllAuditConfigs(new ArrayList()) .setEtag(ByteString.EMPTY) .build(); mockIAMPolicy.addResponse(expectedResponse); @@ -91,6 +93,7 @@ public void setIamPolicyTest() throws Exception { SetIamPolicyRequest.newBuilder() .setResource("SetIamPolicyRequest1223629066".toString()) .setPolicy(Policy.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) .build(); Policy actualResponse = client.setIamPolicy(request); @@ -102,6 +105,7 @@ public void setIamPolicyTest() throws Exception { Assert.assertEquals(request.getResource(), actualRequest.getResource()); Assert.assertEquals(request.getPolicy(), actualRequest.getPolicy()); + Assert.assertEquals(request.getUpdateMask(), actualRequest.getUpdateMask()); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), @@ -118,6 +122,7 @@ public void setIamPolicyExceptionTest() throws Exception { SetIamPolicyRequest.newBuilder() .setResource("SetIamPolicyRequest1223629066".toString()) .setPolicy(Policy.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) .build(); client.setIamPolicy(request); Assert.fail("No exception raised"); @@ -132,6 +137,7 @@ public void getIamPolicyTest() throws Exception { Policy.newBuilder() .setVersion(351608024) .addAllBindings(new ArrayList()) + .addAllAuditConfigs(new ArrayList()) .setEtag(ByteString.EMPTY) .build(); mockIAMPolicy.addResponse(expectedResponse); diff --git a/test/integration/goldens/iam/src/com/google/iam/v1/IAMPolicySettings.java b/test/integration/goldens/iam/src/com/google/iam/v1/IAMPolicySettings.java index f9c75c136d..560c59690c 100644 --- a/test/integration/goldens/iam/src/com/google/iam/v1/IAMPolicySettings.java +++ b/test/integration/goldens/iam/src/com/google/iam/v1/IAMPolicySettings.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -17,7 +17,6 @@ package com.google.iam.v1; import com.google.api.core.ApiFunction; -import com.google.api.core.BetaApi; import com.google.api.gax.core.GoogleCredentialsProvider; import com.google.api.gax.core.InstantiatingExecutorProvider; import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; @@ -47,7 +46,9 @@ *

        The builder of this class is recursive, so contained classes are themselves builders. When * build() is called, the tree of builders is called to create the complete settings object. * - *

        For example, to set the total timeout of setIamPolicy to 30 seconds: + *

        For example, to set the + * [RetrySettings](https://cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.retrying.RetrySettings) + * of setIamPolicy: * *

        {@code
          * // This snippet has been automatically generated and should be regarded as a code template only.
        @@ -63,10 +64,21 @@
          *             .setIamPolicySettings()
          *             .getRetrySettings()
          *             .toBuilder()
        - *             .setTotalTimeout(Duration.ofSeconds(30))
        + *             .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());
          * IAMPolicySettings iAMPolicySettings = iAMPolicySettingsBuilder.build();
          * }
        + * + * Please refer to the [Client Side Retry + * Guide](https://docs.cloud.google.com/java/docs/client-retries) for additional support in setting + * retries. */ @Generated("by gapic-generator-java") public class IAMPolicySettings extends ClientSettings { @@ -120,7 +132,6 @@ public static TransportChannelProvider defaultTransportChannelProvider() { return IAMPolicyStubSettings.defaultTransportChannelProvider(); } - @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { return IAMPolicyStubSettings.defaultApiClientHeaderProviderBuilder(); } diff --git a/test/integration/goldens/iam/src/com/google/iam/v1/MockIAMPolicy.java b/test/integration/goldens/iam/src/com/google/iam/v1/MockIAMPolicy.java index 3d7859824b..5502a8d661 100644 --- a/test/integration/goldens/iam/src/com/google/iam/v1/MockIAMPolicy.java +++ b/test/integration/goldens/iam/src/com/google/iam/v1/MockIAMPolicy.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/iam/src/com/google/iam/v1/MockIAMPolicyImpl.java b/test/integration/goldens/iam/src/com/google/iam/v1/MockIAMPolicyImpl.java index 6da0eedc93..ba2bfe691f 100644 --- a/test/integration/goldens/iam/src/com/google/iam/v1/MockIAMPolicyImpl.java +++ b/test/integration/goldens/iam/src/com/google/iam/v1/MockIAMPolicyImpl.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/iam/src/com/google/iam/v1/package-info.java b/test/integration/goldens/iam/src/com/google/iam/v1/package-info.java index 622ee7de77..2a98d3f35a 100644 --- a/test/integration/goldens/iam/src/com/google/iam/v1/package-info.java +++ b/test/integration/goldens/iam/src/com/google/iam/v1/package-info.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -19,7 +19,7 @@ * *

        ======================= IAMPolicyClient ======================= * - *

        Service Description: ## API Overview + *

        Service Description: API Overview * *

        Manages Identity and Access Management (IAM) policies. * @@ -55,6 +55,7 @@ * SetIamPolicyRequest.newBuilder() * .setResource("resource-341064690") * .setPolicy(Policy.newBuilder().build()) + * .setUpdateMask(FieldMask.newBuilder().build()) * .build(); * Policy response = iAMPolicyClient.setIamPolicy(request); * } diff --git a/test/integration/goldens/iam/src/com/google/iam/v1/stub/GrpcIAMPolicyCallableFactory.java b/test/integration/goldens/iam/src/com/google/iam/v1/stub/GrpcIAMPolicyCallableFactory.java index a98734ff4e..3335d37bae 100644 --- a/test/integration/goldens/iam/src/com/google/iam/v1/stub/GrpcIAMPolicyCallableFactory.java +++ b/test/integration/goldens/iam/src/com/google/iam/v1/stub/GrpcIAMPolicyCallableFactory.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/iam/src/com/google/iam/v1/stub/GrpcIAMPolicyStub.java b/test/integration/goldens/iam/src/com/google/iam/v1/stub/GrpcIAMPolicyStub.java index 310f021378..4bee05992b 100644 --- a/test/integration/goldens/iam/src/com/google/iam/v1/stub/GrpcIAMPolicyStub.java +++ b/test/integration/goldens/iam/src/com/google/iam/v1/stub/GrpcIAMPolicyStub.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -21,8 +21,8 @@ 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.common.collect.ImmutableMap; import com.google.iam.v1.GetIamPolicyRequest; import com.google.iam.v1.Policy; import com.google.iam.v1.SetIamPolicyRequest; @@ -50,6 +50,7 @@ public class GrpcIAMPolicyStub extends IAMPolicyStub { .setFullMethodName("google.iam.v1.IAMPolicy/SetIamPolicy") .setRequestMarshaller(ProtoUtils.marshaller(SetIamPolicyRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(Policy.getDefaultInstance())) + .setSampledToLocalTracing(true) .build(); private static final MethodDescriptor getIamPolicyMethodDescriptor = @@ -58,6 +59,7 @@ public class GrpcIAMPolicyStub extends IAMPolicyStub { .setFullMethodName("google.iam.v1.IAMPolicy/GetIamPolicy") .setRequestMarshaller(ProtoUtils.marshaller(GetIamPolicyRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(Policy.getDefaultInstance())) + .setSampledToLocalTracing(true) .build(); private static final MethodDescriptor @@ -69,6 +71,7 @@ public class GrpcIAMPolicyStub extends IAMPolicyStub { ProtoUtils.marshaller(TestIamPermissionsRequest.getDefaultInstance())) .setResponseMarshaller( ProtoUtils.marshaller(TestIamPermissionsResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) .build(); private final UnaryCallable setIamPolicyCallable; @@ -122,20 +125,22 @@ protected GrpcIAMPolicyStub( .setMethodDescriptor(setIamPolicyMethodDescriptor) .setParamsExtractor( request -> { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("resource", String.valueOf(request.getResource())); - return params.build(); + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("resource", String.valueOf(request.getResource())); + return builder.build(); }) + .setResourceNameExtractor(request -> request.getResource()) .build(); GrpcCallSettings getIamPolicyTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(getIamPolicyMethodDescriptor) .setParamsExtractor( request -> { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("resource", String.valueOf(request.getResource())); - return params.build(); + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("resource", String.valueOf(request.getResource())); + return builder.build(); }) + .setResourceNameExtractor(request -> request.getResource()) .build(); GrpcCallSettings testIamPermissionsTransportSettings = @@ -143,10 +148,11 @@ protected GrpcIAMPolicyStub( .setMethodDescriptor(testIamPermissionsMethodDescriptor) .setParamsExtractor( request -> { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("resource", String.valueOf(request.getResource())); - return params.build(); + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("resource", String.valueOf(request.getResource())); + return builder.build(); }) + .setResourceNameExtractor(request -> request.getResource()) .build(); this.setIamPolicyCallable = diff --git a/test/integration/goldens/iam/src/com/google/iam/v1/stub/IAMPolicyStub.java b/test/integration/goldens/iam/src/com/google/iam/v1/stub/IAMPolicyStub.java index f7fe9b9524..1c4324ca87 100644 --- a/test/integration/goldens/iam/src/com/google/iam/v1/stub/IAMPolicyStub.java +++ b/test/integration/goldens/iam/src/com/google/iam/v1/stub/IAMPolicyStub.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/iam/src/com/google/iam/v1/stub/IAMPolicyStubSettings.java b/test/integration/goldens/iam/src/com/google/iam/v1/stub/IAMPolicyStubSettings.java index 0996e5b64e..673791070b 100644 --- a/test/integration/goldens/iam/src/com/google/iam/v1/stub/IAMPolicyStubSettings.java +++ b/test/integration/goldens/iam/src/com/google/iam/v1/stub/IAMPolicyStubSettings.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -17,7 +17,7 @@ package com.google.iam.v1.stub; import com.google.api.core.ApiFunction; -import com.google.api.core.BetaApi; +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; @@ -27,6 +27,7 @@ import com.google.api.gax.retrying.RetrySettings; import com.google.api.gax.rpc.ApiClientHeaderProvider; import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.LibraryMetadata; import com.google.api.gax.rpc.StatusCode; import com.google.api.gax.rpc.StubSettings; import com.google.api.gax.rpc.TransportChannelProvider; @@ -41,9 +42,9 @@ import com.google.iam.v1.TestIamPermissionsRequest; import com.google.iam.v1.TestIamPermissionsResponse; import java.io.IOException; +import java.time.Duration; import java.util.List; import javax.annotation.Generated; -import org.threeten.bp.Duration; // AUTO-GENERATED DOCUMENTATION AND CLASS. /** @@ -60,7 +61,9 @@ *

        The builder of this class is recursive, so contained classes are themselves builders. When * build() is called, the tree of builders is called to create the complete settings object. * - *

        For example, to set the total timeout of setIamPolicy to 30 seconds: + *

        For example, to set the + * [RetrySettings](https://cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.retrying.RetrySettings) + * of setIamPolicy: * *

        {@code
          * // This snippet has been automatically generated and should be regarded as a code template only.
        @@ -76,12 +79,24 @@
          *             .setIamPolicySettings()
          *             .getRetrySettings()
          *             .toBuilder()
        - *             .setTotalTimeout(Duration.ofSeconds(30))
        + *             .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());
          * IAMPolicyStubSettings iAMPolicySettings = iAMPolicySettingsBuilder.build();
          * }
        + * + * Please refer to the [Client Side Retry + * Guide](https://docs.cloud.google.com/java/docs/client-retries) for additional support in setting + * retries. */ @Generated("by gapic-generator-java") +@SuppressWarnings("CanonicalDuration") public class IAMPolicyStubSettings extends StubSettings { /** The default scopes of the service. */ private static final ImmutableList DEFAULT_SERVICE_SCOPES = @@ -119,12 +134,19 @@ public IAMPolicyStub createStub() throws IOException { "Transport not supported: %s", getTransportChannelProvider().getTransportName())); } + /** Returns the default service name. */ + @Override + public String getServiceName() { + return "iam-meta-api"; + } + /** 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 "iam-meta-api.googleapis.com:443"; } @@ -156,7 +178,6 @@ public static TransportChannelProvider defaultTransportChannelProvider() { return defaultGrpcTransportProviderBuilder().build(); } - @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { return ApiClientHeaderProvider.newBuilder() .setGeneratedLibToken("gapic", GaxProperties.getLibraryVersion(IAMPolicyStubSettings.class)) @@ -187,6 +208,11 @@ protected IAMPolicyStubSettings(Builder settingsBuilder) throws IOException { testIamPermissionsSettings = settingsBuilder.testIamPermissionsSettings().build(); } + @Override + protected LibraryMetadata getLibraryMetadata() { + return LibraryMetadata.newBuilder().setVersion(Version.VERSION).build(); + } + /** Builder for IAMPolicyStubSettings. */ public static class Builder extends StubSettings.Builder { private final ImmutableList> unaryMethodSettingsBuilders; @@ -213,13 +239,13 @@ public static class Builder extends StubSettings.BuilderThe surface of this class includes several types of Java methods for each of the API's - * methods: - * - *
          - *
        1. A "flattened" method. With this type of method, the fields of the request type have been - * converted into function parameters. It may be the case that not all fields are available as - * parameters, and not every API method will have a flattened method entry point. - *
        2. A "request object" method. This type of method only takes one parameter, a request object, - * which must be constructed before the call. Not every API method will have a request object - * method. - *
        3. A "callable" method. This type of method takes no parameters and returns an immutable API - * callable object, which can be used to initiate calls to the service. - *
        + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + *
        Methods
        MethodDescriptionMethod Variants

        ListKeyRings

        Lists [KeyRings][google.cloud.kms.v1.KeyRing].

        + *

        Request object method variants only take one parameter, a request object, which must be constructed before the call.

        + *
          + *
        • listKeyRings(ListKeyRingsRequest request) + *

        + *

        "Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

        + *
          + *
        • listKeyRings(LocationName parent) + *

        • listKeyRings(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.

        + *
          + *
        • listKeyRingsPagedCallable() + *

        • listKeyRingsCallable() + *

        + *

        ListCryptoKeys

        Lists [CryptoKeys][google.cloud.kms.v1.CryptoKey].

        + *

        Request object method variants only take one parameter, a request object, which must be constructed before the call.

        + *
          + *
        • listCryptoKeys(ListCryptoKeysRequest request) + *

        + *

        "Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

        + *
          + *
        • listCryptoKeys(KeyRingName parent) + *

        • listCryptoKeys(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.

        + *
          + *
        • listCryptoKeysPagedCallable() + *

        • listCryptoKeysCallable() + *

        + *

        ListCryptoKeyVersions

        Lists [CryptoKeyVersions][google.cloud.kms.v1.CryptoKeyVersion].

        + *

        Request object method variants only take one parameter, a request object, which must be constructed before the call.

        + *
          + *
        • listCryptoKeyVersions(ListCryptoKeyVersionsRequest request) + *

        + *

        "Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

        + *
          + *
        • listCryptoKeyVersions(CryptoKeyName parent) + *

        • listCryptoKeyVersions(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.

        + *
          + *
        • listCryptoKeyVersionsPagedCallable() + *

        • listCryptoKeyVersionsCallable() + *

        + *

        ListImportJobs

        Lists [ImportJobs][google.cloud.kms.v1.ImportJob].

        + *

        Request object method variants only take one parameter, a request object, which must be constructed before the call.

        + *
          + *
        • listImportJobs(ListImportJobsRequest request) + *

        + *

        "Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

        + *
          + *
        • listImportJobs(KeyRingName parent) + *

        • listImportJobs(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.

        + *
          + *
        • listImportJobsPagedCallable() + *

        • listImportJobsCallable() + *

        + *

        GetKeyRing

        Returns metadata for a given [KeyRing][google.cloud.kms.v1.KeyRing].

        + *

        Request object method variants only take one parameter, a request object, which must be constructed before the call.

        + *
          + *
        • getKeyRing(GetKeyRingRequest request) + *

        + *

        "Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

        + *
          + *
        • getKeyRing(KeyRingName name) + *

        • getKeyRing(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.

        + *
          + *
        • getKeyRingCallable() + *

        + *

        GetCryptoKey

        Returns metadata for a given [CryptoKey][google.cloud.kms.v1.CryptoKey], as well as its [primary][google.cloud.kms.v1.CryptoKey.primary] [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion].

        + *

        Request object method variants only take one parameter, a request object, which must be constructed before the call.

        + *
          + *
        • getCryptoKey(GetCryptoKeyRequest request) + *

        + *

        "Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

        + *
          + *
        • getCryptoKey(CryptoKeyName name) + *

        • getCryptoKey(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.

        + *
          + *
        • getCryptoKeyCallable() + *

        + *

        GetCryptoKeyVersion

        Returns metadata for a given [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion].

        + *

        Request object method variants only take one parameter, a request object, which must be constructed before the call.

        + *
          + *
        • getCryptoKeyVersion(GetCryptoKeyVersionRequest request) + *

        + *

        "Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

        + *
          + *
        • getCryptoKeyVersion(CryptoKeyVersionName name) + *

        • getCryptoKeyVersion(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.

        + *
          + *
        • getCryptoKeyVersionCallable() + *

        + *

        GetPublicKey

        Returns the public key for the given [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion]. The [CryptoKey.purpose][google.cloud.kms.v1.CryptoKey.purpose] must be [ASYMMETRIC_SIGN][google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose.ASYMMETRIC_SIGN] or [ASYMMETRIC_DECRYPT][google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose.ASYMMETRIC_DECRYPT].

        + *

        Request object method variants only take one parameter, a request object, which must be constructed before the call.

        + *
          + *
        • getPublicKey(GetPublicKeyRequest request) + *

        + *

        "Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

        + *
          + *
        • getPublicKey(CryptoKeyVersionName name) + *

        • getPublicKey(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.

        + *
          + *
        • getPublicKeyCallable() + *

        + *

        GetImportJob

        Returns metadata for a given [ImportJob][google.cloud.kms.v1.ImportJob].

        + *

        Request object method variants only take one parameter, a request object, which must be constructed before the call.

        + *
          + *
        • getImportJob(GetImportJobRequest request) + *

        + *

        "Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

        + *
          + *
        • getImportJob(ImportJobName name) + *

        • getImportJob(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.

        + *
          + *
        • getImportJobCallable() + *

        + *

        CreateKeyRing

        Create a new [KeyRing][google.cloud.kms.v1.KeyRing] in a given Project and Location.

        + *

        Request object method variants only take one parameter, a request object, which must be constructed before the call.

        + *
          + *
        • createKeyRing(CreateKeyRingRequest request) + *

        + *

        "Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

        + *
          + *
        • createKeyRing(LocationName parent, String keyRingId, KeyRing keyRing) + *

        • createKeyRing(String parent, String keyRingId, KeyRing keyRing) + *

        + *

        Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

        + *
          + *
        • createKeyRingCallable() + *

        + *

        CreateCryptoKey

        Create a new [CryptoKey][google.cloud.kms.v1.CryptoKey] within a [KeyRing][google.cloud.kms.v1.KeyRing]. + *

        [CryptoKey.purpose][google.cloud.kms.v1.CryptoKey.purpose] and [CryptoKey.version_template.algorithm][google.cloud.kms.v1.CryptoKeyVersionTemplate.algorithm] are required.

        + *

        Request object method variants only take one parameter, a request object, which must be constructed before the call.

        + *
          + *
        • createCryptoKey(CreateCryptoKeyRequest request) + *

        + *

        "Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

        + *
          + *
        • createCryptoKey(KeyRingName parent, String cryptoKeyId, CryptoKey cryptoKey) + *

        • createCryptoKey(String parent, String cryptoKeyId, CryptoKey cryptoKey) + *

        + *

        Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

        + *
          + *
        • createCryptoKeyCallable() + *

        + *

        CreateCryptoKeyVersion

        Create a new [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] in a [CryptoKey][google.cloud.kms.v1.CryptoKey]. + *

        The server will assign the next sequential id. If unset, [state][google.cloud.kms.v1.CryptoKeyVersion.state] will be set to [ENABLED][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState.ENABLED].

        + *

        Request object method variants only take one parameter, a request object, which must be constructed before the call.

        + *
          + *
        • createCryptoKeyVersion(CreateCryptoKeyVersionRequest request) + *

        + *

        "Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

        + *
          + *
        • createCryptoKeyVersion(CryptoKeyName parent, CryptoKeyVersion cryptoKeyVersion) + *

        • createCryptoKeyVersion(String parent, CryptoKeyVersion cryptoKeyVersion) + *

        + *

        Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

        + *
          + *
        • createCryptoKeyVersionCallable() + *

        + *

        ImportCryptoKeyVersion

        Imports a new [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] into an existing [CryptoKey][google.cloud.kms.v1.CryptoKey] using the wrapped key material provided in the request. + *

        The version ID will be assigned the next sequential id within the [CryptoKey][google.cloud.kms.v1.CryptoKey].

        + *

        Request object method variants only take one parameter, a request object, which must be constructed before the call.

        + *
          + *
        • importCryptoKeyVersion(ImportCryptoKeyVersionRequest request) + *

        + *

        Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

        + *
          + *
        • importCryptoKeyVersionCallable() + *

        + *

        CreateImportJob

        Create a new [ImportJob][google.cloud.kms.v1.ImportJob] within a [KeyRing][google.cloud.kms.v1.KeyRing]. + *

        [ImportJob.import_method][google.cloud.kms.v1.ImportJob.import_method] is required.

        + *

        Request object method variants only take one parameter, a request object, which must be constructed before the call.

        + *
          + *
        • createImportJob(CreateImportJobRequest request) + *

        + *

        "Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

        + *
          + *
        • createImportJob(KeyRingName parent, String importJobId, ImportJob importJob) + *

        • createImportJob(String parent, String importJobId, ImportJob importJob) + *

        + *

        Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

        + *
          + *
        • createImportJobCallable() + *

        + *

        UpdateCryptoKey

        Update a [CryptoKey][google.cloud.kms.v1.CryptoKey].

        + *

        Request object method variants only take one parameter, a request object, which must be constructed before the call.

        + *
          + *
        • updateCryptoKey(UpdateCryptoKeyRequest request) + *

        + *

        "Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

        + *
          + *
        • updateCryptoKey(CryptoKey cryptoKey, 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.

        + *
          + *
        • updateCryptoKeyCallable() + *

        + *

        UpdateCryptoKeyVersion

        Update a [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion]'s metadata. + *

        [state][google.cloud.kms.v1.CryptoKeyVersion.state] may be changed between [ENABLED][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState.ENABLED] and [DISABLED][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState.DISABLED] using this method. See [DestroyCryptoKeyVersion][google.cloud.kms.v1.KeyManagementService.DestroyCryptoKeyVersion] and [RestoreCryptoKeyVersion][google.cloud.kms.v1.KeyManagementService.RestoreCryptoKeyVersion] to move between other states.

        + *

        Request object method variants only take one parameter, a request object, which must be constructed before the call.

        + *
          + *
        • updateCryptoKeyVersion(UpdateCryptoKeyVersionRequest request) + *

        + *

        "Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

        + *
          + *
        • updateCryptoKeyVersion(CryptoKeyVersion cryptoKeyVersion, 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.

        + *
          + *
        • updateCryptoKeyVersionCallable() + *

        + *

        Encrypt

        Encrypts data, so that it can only be recovered by a call to [Decrypt][google.cloud.kms.v1.KeyManagementService.Decrypt]. The [CryptoKey.purpose][google.cloud.kms.v1.CryptoKey.purpose] must be [ENCRYPT_DECRYPT][google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose.ENCRYPT_DECRYPT].

        + *

        Request object method variants only take one parameter, a request object, which must be constructed before the call.

        + *
          + *
        • encrypt(EncryptRequest request) + *

        + *

        "Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

        + *
          + *
        • encrypt(ResourceName name, ByteString plaintext) + *

        • encrypt(String name, ByteString plaintext) + *

        + *

        Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

        + *
          + *
        • encryptCallable() + *

        + *

        Decrypt

        Decrypts data that was protected by [Encrypt][google.cloud.kms.v1.KeyManagementService.Encrypt]. The [CryptoKey.purpose][google.cloud.kms.v1.CryptoKey.purpose] must be [ENCRYPT_DECRYPT][google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose.ENCRYPT_DECRYPT].

        + *

        Request object method variants only take one parameter, a request object, which must be constructed before the call.

        + *
          + *
        • decrypt(DecryptRequest request) + *

        + *

        "Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

        + *
          + *
        • decrypt(CryptoKeyName name, ByteString ciphertext) + *

        • decrypt(String name, ByteString ciphertext) + *

        + *

        Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

        + *
          + *
        • decryptCallable() + *

        + *

        AsymmetricSign

        Signs data using a [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] with [CryptoKey.purpose][google.cloud.kms.v1.CryptoKey.purpose] ASYMMETRIC_SIGN, producing a signature that can be verified with the public key retrieved from [GetPublicKey][google.cloud.kms.v1.KeyManagementService.GetPublicKey].

        + *

        Request object method variants only take one parameter, a request object, which must be constructed before the call.

        + *
          + *
        • asymmetricSign(AsymmetricSignRequest request) + *

        + *

        "Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

        + *
          + *
        • asymmetricSign(CryptoKeyVersionName name, Digest digest) + *

        • asymmetricSign(String name, Digest digest) + *

        + *

        Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

        + *
          + *
        • asymmetricSignCallable() + *

        + *

        AsymmetricDecrypt

        Decrypts data that was encrypted with a public key retrieved from [GetPublicKey][google.cloud.kms.v1.KeyManagementService.GetPublicKey] corresponding to a [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] with [CryptoKey.purpose][google.cloud.kms.v1.CryptoKey.purpose] ASYMMETRIC_DECRYPT.

        + *

        Request object method variants only take one parameter, a request object, which must be constructed before the call.

        + *
          + *
        • asymmetricDecrypt(AsymmetricDecryptRequest request) + *

        + *

        "Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

        + *
          + *
        • asymmetricDecrypt(CryptoKeyVersionName name, ByteString ciphertext) + *

        • asymmetricDecrypt(String name, ByteString ciphertext) + *

        + *

        Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

        + *
          + *
        • asymmetricDecryptCallable() + *

        + *

        UpdateCryptoKeyPrimaryVersion

        Update the version of a [CryptoKey][google.cloud.kms.v1.CryptoKey] that will be used in [Encrypt][google.cloud.kms.v1.KeyManagementService.Encrypt]. + *

        Returns an error if called on an asymmetric key.

        + *

        Request object method variants only take one parameter, a request object, which must be constructed before the call.

        + *
          + *
        • updateCryptoKeyPrimaryVersion(UpdateCryptoKeyPrimaryVersionRequest request) + *

        + *

        "Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

        + *
          + *
        • updateCryptoKeyPrimaryVersion(CryptoKeyName name, String cryptoKeyVersionId) + *

        • updateCryptoKeyPrimaryVersion(String name, String cryptoKeyVersionId) + *

        + *

        Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

        + *
          + *
        • updateCryptoKeyPrimaryVersionCallable() + *

        + *

        DestroyCryptoKeyVersion

        Schedule a [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] for destruction. + *

        Upon calling this method, [CryptoKeyVersion.state][google.cloud.kms.v1.CryptoKeyVersion.state] will be set to [DESTROY_SCHEDULED][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState.DESTROY_SCHEDULED] and [destroy_time][google.cloud.kms.v1.CryptoKeyVersion.destroy_time] will be set to a time 24 hours in the future, at which point the [state][google.cloud.kms.v1.CryptoKeyVersion.state] will be changed to [DESTROYED][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState.DESTROYED], and the key material will be irrevocably destroyed. + *

        Before the [destroy_time][google.cloud.kms.v1.CryptoKeyVersion.destroy_time] is reached, [RestoreCryptoKeyVersion][google.cloud.kms.v1.KeyManagementService.RestoreCryptoKeyVersion] may be called to reverse the process.

        + *

        Request object method variants only take one parameter, a request object, which must be constructed before the call.

        + *
          + *
        • destroyCryptoKeyVersion(DestroyCryptoKeyVersionRequest request) + *

        + *

        "Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

        + *
          + *
        • destroyCryptoKeyVersion(CryptoKeyVersionName name) + *

        • destroyCryptoKeyVersion(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.

        + *
          + *
        • destroyCryptoKeyVersionCallable() + *

        + *

        RestoreCryptoKeyVersion

        Restore a [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] in the [DESTROY_SCHEDULED][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState.DESTROY_SCHEDULED] state. + *

        Upon restoration of the CryptoKeyVersion, [state][google.cloud.kms.v1.CryptoKeyVersion.state] will be set to [DISABLED][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState.DISABLED], and [destroy_time][google.cloud.kms.v1.CryptoKeyVersion.destroy_time] will be cleared.

        + *

        Request object method variants only take one parameter, a request object, which must be constructed before the call.

        + *
          + *
        • restoreCryptoKeyVersion(RestoreCryptoKeyVersionRequest request) + *

        + *

        "Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

        + *
          + *
        • restoreCryptoKeyVersion(CryptoKeyVersionName name) + *

        • restoreCryptoKeyVersion(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.

        + *
          + *
        • restoreCryptoKeyVersionCallable() + *

        + *

        GetIamPolicy

        Gets the access control policy for a resource. ADDED ONLY FOR MIXIN TESTS. Returns an empty policy if the resource exists and does not have a policy set.

        + *

        Request object method variants only take one parameter, a request object, which must be constructed before the call.

        + *
          + *
        • getIamPolicy(GetIamPolicyRequest request) + *

        + *

        Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

        + *
          + *
        • getIamPolicyCallable() + *

        + *

        ListLocations

        Lists information about the supported locations for this service.

        + *

        Request object method variants only take one parameter, a request object, which must be constructed before the call.

        + *
          + *
        • listLocations(ListLocationsRequest request) + *

        + *

        Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

        + *
          + *
        • listLocationsPagedCallable() + *

        • listLocationsCallable() + *

        + *

        GetLocation

        Gets information about a location.

        + *

        Request object method variants only take one parameter, a request object, which must be constructed before the call.

        + *
          + *
        • getLocation(GetLocationRequest request) + *

        + *

        Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

        + *
          + *
        • getLocationCallable() + *

        + *

        TestIamPermissions

        This is a different comment for TestIamPermissions in the yaml file that should clobber the documentation in iam_policy.proto.

        + *

        Request object method variants only take one parameter, a request object, which must be constructed before the call.

        + *
          + *
        • testIamPermissions(TestIamPermissionsRequest request) + *

        + *

        Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

        + *
          + *
        • testIamPermissionsCallable() + *

        + *
        * *

        See the individual methods for example code. * diff --git a/test/integration/goldens/kms/src/com/google/cloud/kms/v1/KeyManagementServiceClientTest.java b/test/integration/goldens/kms/src/com/google/cloud/kms/v1/KeyManagementServiceClientTest.java index 52969cf34d..03c7757066 100644 --- a/test/integration/goldens/kms/src/com/google/cloud/kms/v1/KeyManagementServiceClientTest.java +++ b/test/integration/goldens/kms/src/com/google/cloud/kms/v1/KeyManagementServiceClientTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -35,6 +35,7 @@ import com.google.cloud.location.ListLocationsResponse; import com.google.cloud.location.Location; import com.google.common.collect.Lists; +import com.google.iam.v1.AuditConfig; import com.google.iam.v1.Binding; import com.google.iam.v1.GetIamPolicyRequest; import com.google.iam.v1.GetPolicyOptions; @@ -2213,6 +2214,7 @@ public void getIamPolicyTest() throws Exception { Policy.newBuilder() .setVersion(351608024) .addAllBindings(new ArrayList()) + .addAllAuditConfigs(new ArrayList()) .setEtag(ByteString.EMPTY) .build(); mockKeyManagementService.addResponse(expectedResponse); diff --git a/test/integration/goldens/kms/src/com/google/cloud/kms/v1/KeyManagementServiceSettings.java b/test/integration/goldens/kms/src/com/google/cloud/kms/v1/KeyManagementServiceSettings.java index 8839772cec..e838a395e3 100644 --- a/test/integration/goldens/kms/src/com/google/cloud/kms/v1/KeyManagementServiceSettings.java +++ b/test/integration/goldens/kms/src/com/google/cloud/kms/v1/KeyManagementServiceSettings.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -23,7 +23,6 @@ import static com.google.cloud.kms.v1.KeyManagementServiceClient.ListLocationsPagedResponse; import com.google.api.core.ApiFunction; -import com.google.api.core.BetaApi; import com.google.api.gax.core.GoogleCredentialsProvider; import com.google.api.gax.core.InstantiatingExecutorProvider; import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; @@ -62,7 +61,9 @@ *

        The builder of this class is recursive, so contained classes are themselves builders. When * build() is called, the tree of builders is called to create the complete settings object. * - *

        For example, to set the total timeout of getKeyRing to 30 seconds: + *

        For example, to set the + * [RetrySettings](https://cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.retrying.RetrySettings) + * of getKeyRing: * *

        {@code
          * // This snippet has been automatically generated and should be regarded as a code template only.
        @@ -79,11 +80,22 @@
          *             .getKeyRingSettings()
          *             .getRetrySettings()
          *             .toBuilder()
        - *             .setTotalTimeout(Duration.ofSeconds(30))
        + *             .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());
          * KeyManagementServiceSettings keyManagementServiceSettings =
          *     keyManagementServiceSettingsBuilder.build();
          * }
        + * + * Please refer to the [Client Side Retry + * Guide](https://docs.cloud.google.com/java/docs/client-retries) for additional support in setting + * retries. */ @Generated("by gapic-generator-java") public class KeyManagementServiceSettings extends ClientSettings { @@ -277,7 +289,6 @@ public static TransportChannelProvider defaultTransportChannelProvider() { return KeyManagementServiceStubSettings.defaultTransportChannelProvider(); } - @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { return KeyManagementServiceStubSettings.defaultApiClientHeaderProviderBuilder(); } diff --git a/test/integration/goldens/kms/src/com/google/cloud/kms/v1/KeyRingName.java b/test/integration/goldens/kms/src/com/google/cloud/kms/v1/KeyRingName.java index 6663468fb6..d2ec54cdcf 100644 --- a/test/integration/goldens/kms/src/com/google/cloud/kms/v1/KeyRingName.java +++ b/test/integration/goldens/kms/src/com/google/cloud/kms/v1/KeyRingName.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -154,7 +154,7 @@ public boolean equals(Object o) { if (o == this) { return true; } - if (o != null || getClass() == o.getClass()) { + if (o != null && getClass() == o.getClass()) { KeyRingName that = ((KeyRingName) o); return Objects.equals(this.project, that.project) && Objects.equals(this.location, that.location) diff --git a/test/integration/goldens/kms/src/com/google/cloud/kms/v1/LocationName.java b/test/integration/goldens/kms/src/com/google/cloud/kms/v1/LocationName.java index 3c76f221c1..7c0935ae37 100644 --- a/test/integration/goldens/kms/src/com/google/cloud/kms/v1/LocationName.java +++ b/test/integration/goldens/kms/src/com/google/cloud/kms/v1/LocationName.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -137,7 +137,7 @@ public boolean equals(Object o) { if (o == this) { return true; } - if (o != null || getClass() == o.getClass()) { + if (o != null && getClass() == o.getClass()) { LocationName that = ((LocationName) o); return Objects.equals(this.project, that.project) && Objects.equals(this.location, that.location); diff --git a/test/integration/goldens/kms/src/com/google/cloud/kms/v1/MockIAMPolicy.java b/test/integration/goldens/kms/src/com/google/cloud/kms/v1/MockIAMPolicy.java index 829e78d2d3..c948ceff39 100644 --- a/test/integration/goldens/kms/src/com/google/cloud/kms/v1/MockIAMPolicy.java +++ b/test/integration/goldens/kms/src/com/google/cloud/kms/v1/MockIAMPolicy.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/kms/src/com/google/cloud/kms/v1/MockIAMPolicyImpl.java b/test/integration/goldens/kms/src/com/google/cloud/kms/v1/MockIAMPolicyImpl.java index a944265e4c..63f06bdff1 100644 --- a/test/integration/goldens/kms/src/com/google/cloud/kms/v1/MockIAMPolicyImpl.java +++ b/test/integration/goldens/kms/src/com/google/cloud/kms/v1/MockIAMPolicyImpl.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/kms/src/com/google/cloud/kms/v1/MockKeyManagementService.java b/test/integration/goldens/kms/src/com/google/cloud/kms/v1/MockKeyManagementService.java index 10fb060ed8..0db7c8139c 100644 --- a/test/integration/goldens/kms/src/com/google/cloud/kms/v1/MockKeyManagementService.java +++ b/test/integration/goldens/kms/src/com/google/cloud/kms/v1/MockKeyManagementService.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/kms/src/com/google/cloud/kms/v1/MockKeyManagementServiceImpl.java b/test/integration/goldens/kms/src/com/google/cloud/kms/v1/MockKeyManagementServiceImpl.java index c9c217d612..1b0cf415a8 100644 --- a/test/integration/goldens/kms/src/com/google/cloud/kms/v1/MockKeyManagementServiceImpl.java +++ b/test/integration/goldens/kms/src/com/google/cloud/kms/v1/MockKeyManagementServiceImpl.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/kms/src/com/google/cloud/kms/v1/MockLocations.java b/test/integration/goldens/kms/src/com/google/cloud/kms/v1/MockLocations.java index d025927eab..f8b4dcdbe8 100644 --- a/test/integration/goldens/kms/src/com/google/cloud/kms/v1/MockLocations.java +++ b/test/integration/goldens/kms/src/com/google/cloud/kms/v1/MockLocations.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/kms/src/com/google/cloud/kms/v1/MockLocationsImpl.java b/test/integration/goldens/kms/src/com/google/cloud/kms/v1/MockLocationsImpl.java index 340e0a3df3..43b58c7190 100644 --- a/test/integration/goldens/kms/src/com/google/cloud/kms/v1/MockLocationsImpl.java +++ b/test/integration/goldens/kms/src/com/google/cloud/kms/v1/MockLocationsImpl.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/kms/src/com/google/cloud/kms/v1/package-info.java b/test/integration/goldens/kms/src/com/google/cloud/kms/v1/package-info.java index 648574c088..2a0ab7a48d 100644 --- a/test/integration/goldens/kms/src/com/google/cloud/kms/v1/package-info.java +++ b/test/integration/goldens/kms/src/com/google/cloud/kms/v1/package-info.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/kms/src/com/google/cloud/kms/v1/stub/GrpcKeyManagementServiceCallableFactory.java b/test/integration/goldens/kms/src/com/google/cloud/kms/v1/stub/GrpcKeyManagementServiceCallableFactory.java index 72cb7f8589..fe3fa2622b 100644 --- a/test/integration/goldens/kms/src/com/google/cloud/kms/v1/stub/GrpcKeyManagementServiceCallableFactory.java +++ b/test/integration/goldens/kms/src/com/google/cloud/kms/v1/stub/GrpcKeyManagementServiceCallableFactory.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/kms/src/com/google/cloud/kms/v1/stub/GrpcKeyManagementServiceStub.java b/test/integration/goldens/kms/src/com/google/cloud/kms/v1/stub/GrpcKeyManagementServiceStub.java index c793994494..d88a498dd1 100644 --- a/test/integration/goldens/kms/src/com/google/cloud/kms/v1/stub/GrpcKeyManagementServiceStub.java +++ b/test/integration/goldens/kms/src/com/google/cloud/kms/v1/stub/GrpcKeyManagementServiceStub.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -27,6 +27,7 @@ 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.cloud.kms.v1.AsymmetricDecryptRequest; import com.google.cloud.kms.v1.AsymmetricDecryptResponse; @@ -68,7 +69,6 @@ import com.google.cloud.location.ListLocationsRequest; import com.google.cloud.location.ListLocationsResponse; import com.google.cloud.location.Location; -import com.google.common.collect.ImmutableMap; import com.google.iam.v1.GetIamPolicyRequest; import com.google.iam.v1.Policy; import com.google.iam.v1.TestIamPermissionsRequest; @@ -97,6 +97,7 @@ public class GrpcKeyManagementServiceStub extends KeyManagementServiceStub { .setRequestMarshaller(ProtoUtils.marshaller(ListKeyRingsRequest.getDefaultInstance())) .setResponseMarshaller( ProtoUtils.marshaller(ListKeyRingsResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) .build(); private static final MethodDescriptor @@ -108,6 +109,7 @@ public class GrpcKeyManagementServiceStub extends KeyManagementServiceStub { ProtoUtils.marshaller(ListCryptoKeysRequest.getDefaultInstance())) .setResponseMarshaller( ProtoUtils.marshaller(ListCryptoKeysResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) .build(); private static final MethodDescriptor @@ -119,6 +121,7 @@ public class GrpcKeyManagementServiceStub extends KeyManagementServiceStub { ProtoUtils.marshaller(ListCryptoKeyVersionsRequest.getDefaultInstance())) .setResponseMarshaller( ProtoUtils.marshaller(ListCryptoKeyVersionsResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) .build(); private static final MethodDescriptor @@ -130,6 +133,7 @@ public class GrpcKeyManagementServiceStub extends KeyManagementServiceStub { ProtoUtils.marshaller(ListImportJobsRequest.getDefaultInstance())) .setResponseMarshaller( ProtoUtils.marshaller(ListImportJobsResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) .build(); private static final MethodDescriptor getKeyRingMethodDescriptor = @@ -138,6 +142,7 @@ public class GrpcKeyManagementServiceStub extends KeyManagementServiceStub { .setFullMethodName("google.cloud.kms.v1.KeyManagementService/GetKeyRing") .setRequestMarshaller(ProtoUtils.marshaller(GetKeyRingRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(KeyRing.getDefaultInstance())) + .setSampledToLocalTracing(true) .build(); private static final MethodDescriptor @@ -147,6 +152,7 @@ public class GrpcKeyManagementServiceStub extends KeyManagementServiceStub { .setFullMethodName("google.cloud.kms.v1.KeyManagementService/GetCryptoKey") .setRequestMarshaller(ProtoUtils.marshaller(GetCryptoKeyRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(CryptoKey.getDefaultInstance())) + .setSampledToLocalTracing(true) .build(); private static final MethodDescriptor @@ -157,6 +163,7 @@ public class GrpcKeyManagementServiceStub extends KeyManagementServiceStub { .setRequestMarshaller( ProtoUtils.marshaller(GetCryptoKeyVersionRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(CryptoKeyVersion.getDefaultInstance())) + .setSampledToLocalTracing(true) .build(); private static final MethodDescriptor @@ -166,6 +173,7 @@ public class GrpcKeyManagementServiceStub extends KeyManagementServiceStub { .setFullMethodName("google.cloud.kms.v1.KeyManagementService/GetPublicKey") .setRequestMarshaller(ProtoUtils.marshaller(GetPublicKeyRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(PublicKey.getDefaultInstance())) + .setSampledToLocalTracing(true) .build(); private static final MethodDescriptor @@ -175,6 +183,7 @@ public class GrpcKeyManagementServiceStub extends KeyManagementServiceStub { .setFullMethodName("google.cloud.kms.v1.KeyManagementService/GetImportJob") .setRequestMarshaller(ProtoUtils.marshaller(GetImportJobRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(ImportJob.getDefaultInstance())) + .setSampledToLocalTracing(true) .build(); private static final MethodDescriptor @@ -185,6 +194,7 @@ public class GrpcKeyManagementServiceStub extends KeyManagementServiceStub { .setRequestMarshaller( ProtoUtils.marshaller(CreateKeyRingRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(KeyRing.getDefaultInstance())) + .setSampledToLocalTracing(true) .build(); private static final MethodDescriptor @@ -195,6 +205,7 @@ public class GrpcKeyManagementServiceStub extends KeyManagementServiceStub { .setRequestMarshaller( ProtoUtils.marshaller(CreateCryptoKeyRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(CryptoKey.getDefaultInstance())) + .setSampledToLocalTracing(true) .build(); private static final MethodDescriptor @@ -205,6 +216,7 @@ public class GrpcKeyManagementServiceStub extends KeyManagementServiceStub { .setRequestMarshaller( ProtoUtils.marshaller(CreateCryptoKeyVersionRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(CryptoKeyVersion.getDefaultInstance())) + .setSampledToLocalTracing(true) .build(); private static final MethodDescriptor @@ -215,6 +227,7 @@ public class GrpcKeyManagementServiceStub extends KeyManagementServiceStub { .setRequestMarshaller( ProtoUtils.marshaller(ImportCryptoKeyVersionRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(CryptoKeyVersion.getDefaultInstance())) + .setSampledToLocalTracing(true) .build(); private static final MethodDescriptor @@ -225,6 +238,7 @@ public class GrpcKeyManagementServiceStub extends KeyManagementServiceStub { .setRequestMarshaller( ProtoUtils.marshaller(CreateImportJobRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(ImportJob.getDefaultInstance())) + .setSampledToLocalTracing(true) .build(); private static final MethodDescriptor @@ -235,6 +249,7 @@ public class GrpcKeyManagementServiceStub extends KeyManagementServiceStub { .setRequestMarshaller( ProtoUtils.marshaller(UpdateCryptoKeyRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(CryptoKey.getDefaultInstance())) + .setSampledToLocalTracing(true) .build(); private static final MethodDescriptor @@ -245,6 +260,7 @@ public class GrpcKeyManagementServiceStub extends KeyManagementServiceStub { .setRequestMarshaller( ProtoUtils.marshaller(UpdateCryptoKeyVersionRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(CryptoKeyVersion.getDefaultInstance())) + .setSampledToLocalTracing(true) .build(); private static final MethodDescriptor encryptMethodDescriptor = @@ -253,6 +269,7 @@ public class GrpcKeyManagementServiceStub extends KeyManagementServiceStub { .setFullMethodName("google.cloud.kms.v1.KeyManagementService/Encrypt") .setRequestMarshaller(ProtoUtils.marshaller(EncryptRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(EncryptResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) .build(); private static final MethodDescriptor decryptMethodDescriptor = @@ -261,6 +278,7 @@ public class GrpcKeyManagementServiceStub extends KeyManagementServiceStub { .setFullMethodName("google.cloud.kms.v1.KeyManagementService/Decrypt") .setRequestMarshaller(ProtoUtils.marshaller(DecryptRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(DecryptResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) .build(); private static final MethodDescriptor @@ -272,6 +290,7 @@ public class GrpcKeyManagementServiceStub extends KeyManagementServiceStub { ProtoUtils.marshaller(AsymmetricSignRequest.getDefaultInstance())) .setResponseMarshaller( ProtoUtils.marshaller(AsymmetricSignResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) .build(); private static final MethodDescriptor @@ -283,6 +302,7 @@ public class GrpcKeyManagementServiceStub extends KeyManagementServiceStub { ProtoUtils.marshaller(AsymmetricDecryptRequest.getDefaultInstance())) .setResponseMarshaller( ProtoUtils.marshaller(AsymmetricDecryptResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) .build(); private static final MethodDescriptor @@ -294,6 +314,7 @@ public class GrpcKeyManagementServiceStub extends KeyManagementServiceStub { .setRequestMarshaller( ProtoUtils.marshaller(UpdateCryptoKeyPrimaryVersionRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(CryptoKey.getDefaultInstance())) + .setSampledToLocalTracing(true) .build(); private static final MethodDescriptor @@ -304,6 +325,7 @@ public class GrpcKeyManagementServiceStub extends KeyManagementServiceStub { .setRequestMarshaller( ProtoUtils.marshaller(DestroyCryptoKeyVersionRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(CryptoKeyVersion.getDefaultInstance())) + .setSampledToLocalTracing(true) .build(); private static final MethodDescriptor @@ -314,6 +336,7 @@ public class GrpcKeyManagementServiceStub extends KeyManagementServiceStub { .setRequestMarshaller( ProtoUtils.marshaller(RestoreCryptoKeyVersionRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(CryptoKeyVersion.getDefaultInstance())) + .setSampledToLocalTracing(true) .build(); private static final MethodDescriptor getIamPolicyMethodDescriptor = @@ -322,6 +345,7 @@ public class GrpcKeyManagementServiceStub extends KeyManagementServiceStub { .setFullMethodName("google.cloud.kms.v1.KeyManagementService/GetIamPolicy") .setRequestMarshaller(ProtoUtils.marshaller(GetIamPolicyRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(Policy.getDefaultInstance())) + .setSampledToLocalTracing(true) .build(); private static final MethodDescriptor @@ -333,6 +357,7 @@ public class GrpcKeyManagementServiceStub extends KeyManagementServiceStub { ProtoUtils.marshaller(ListLocationsRequest.getDefaultInstance())) .setResponseMarshaller( ProtoUtils.marshaller(ListLocationsResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) .build(); private static final MethodDescriptor getLocationMethodDescriptor = @@ -341,6 +366,7 @@ public class GrpcKeyManagementServiceStub extends KeyManagementServiceStub { .setFullMethodName("google.cloud.location.Locations/GetLocation") .setRequestMarshaller(ProtoUtils.marshaller(GetLocationRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(Location.getDefaultInstance())) + .setSampledToLocalTracing(true) .build(); private static final MethodDescriptor @@ -352,6 +378,7 @@ public class GrpcKeyManagementServiceStub extends KeyManagementServiceStub { ProtoUtils.marshaller(TestIamPermissionsRequest.getDefaultInstance())) .setResponseMarshaller( ProtoUtils.marshaller(TestIamPermissionsResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) .build(); private final UnaryCallable listKeyRingsCallable; @@ -451,10 +478,11 @@ protected GrpcKeyManagementServiceStub( .setMethodDescriptor(listKeyRingsMethodDescriptor) .setParamsExtractor( request -> { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("parent", String.valueOf(request.getParent())); - return params.build(); + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); }) + .setResourceNameExtractor(request -> request.getParent()) .build(); GrpcCallSettings listCryptoKeysTransportSettings = @@ -462,10 +490,11 @@ protected GrpcKeyManagementServiceStub( .setMethodDescriptor(listCryptoKeysMethodDescriptor) .setParamsExtractor( request -> { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("parent", String.valueOf(request.getParent())); - return params.build(); + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); }) + .setResourceNameExtractor(request -> request.getParent()) .build(); GrpcCallSettings listCryptoKeyVersionsTransportSettings = @@ -474,10 +503,11 @@ protected GrpcKeyManagementServiceStub( .setMethodDescriptor(listCryptoKeyVersionsMethodDescriptor) .setParamsExtractor( request -> { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("parent", String.valueOf(request.getParent())); - return params.build(); + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); }) + .setResourceNameExtractor(request -> request.getParent()) .build(); GrpcCallSettings listImportJobsTransportSettings = @@ -485,30 +515,33 @@ protected GrpcKeyManagementServiceStub( .setMethodDescriptor(listImportJobsMethodDescriptor) .setParamsExtractor( request -> { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("parent", String.valueOf(request.getParent())); - return params.build(); + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); }) + .setResourceNameExtractor(request -> request.getParent()) .build(); GrpcCallSettings getKeyRingTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(getKeyRingMethodDescriptor) .setParamsExtractor( request -> { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("name", String.valueOf(request.getName())); - return params.build(); + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); }) + .setResourceNameExtractor(request -> request.getName()) .build(); GrpcCallSettings getCryptoKeyTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(getCryptoKeyMethodDescriptor) .setParamsExtractor( request -> { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("name", String.valueOf(request.getName())); - return params.build(); + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); }) + .setResourceNameExtractor(request -> request.getName()) .build(); GrpcCallSettings getCryptoKeyVersionTransportSettings = @@ -516,50 +549,55 @@ protected GrpcKeyManagementServiceStub( .setMethodDescriptor(getCryptoKeyVersionMethodDescriptor) .setParamsExtractor( request -> { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("name", String.valueOf(request.getName())); - return params.build(); + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); }) + .setResourceNameExtractor(request -> request.getName()) .build(); GrpcCallSettings getPublicKeyTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(getPublicKeyMethodDescriptor) .setParamsExtractor( request -> { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("name", String.valueOf(request.getName())); - return params.build(); + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); }) + .setResourceNameExtractor(request -> request.getName()) .build(); GrpcCallSettings getImportJobTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(getImportJobMethodDescriptor) .setParamsExtractor( request -> { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("name", String.valueOf(request.getName())); - return params.build(); + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); }) + .setResourceNameExtractor(request -> request.getName()) .build(); GrpcCallSettings createKeyRingTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(createKeyRingMethodDescriptor) .setParamsExtractor( request -> { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("parent", String.valueOf(request.getParent())); - return params.build(); + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); }) + .setResourceNameExtractor(request -> request.getParent()) .build(); GrpcCallSettings createCryptoKeyTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(createCryptoKeyMethodDescriptor) .setParamsExtractor( request -> { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("parent", String.valueOf(request.getParent())); - return params.build(); + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); }) + .setResourceNameExtractor(request -> request.getParent()) .build(); GrpcCallSettings createCryptoKeyVersionTransportSettings = @@ -567,10 +605,11 @@ protected GrpcKeyManagementServiceStub( .setMethodDescriptor(createCryptoKeyVersionMethodDescriptor) .setParamsExtractor( request -> { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("parent", String.valueOf(request.getParent())); - return params.build(); + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); }) + .setResourceNameExtractor(request -> request.getParent()) .build(); GrpcCallSettings importCryptoKeyVersionTransportSettings = @@ -578,29 +617,31 @@ protected GrpcKeyManagementServiceStub( .setMethodDescriptor(importCryptoKeyVersionMethodDescriptor) .setParamsExtractor( request -> { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("parent", String.valueOf(request.getParent())); - return params.build(); + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); }) + .setResourceNameExtractor(request -> request.getParent()) .build(); GrpcCallSettings createImportJobTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(createImportJobMethodDescriptor) .setParamsExtractor( request -> { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("parent", String.valueOf(request.getParent())); - return params.build(); + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); }) + .setResourceNameExtractor(request -> request.getParent()) .build(); GrpcCallSettings updateCryptoKeyTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(updateCryptoKeyMethodDescriptor) .setParamsExtractor( request -> { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("crypto_key.name", String.valueOf(request.getCryptoKey().getName())); - return params.build(); + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("crypto_key.name", String.valueOf(request.getCryptoKey().getName())); + return builder.build(); }) .build(); GrpcCallSettings @@ -609,11 +650,11 @@ protected GrpcKeyManagementServiceStub( .setMethodDescriptor(updateCryptoKeyVersionMethodDescriptor) .setParamsExtractor( request -> { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put( + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add( "crypto_key_version.name", String.valueOf(request.getCryptoKeyVersion().getName())); - return params.build(); + return builder.build(); }) .build(); GrpcCallSettings encryptTransportSettings = @@ -621,20 +662,22 @@ protected GrpcKeyManagementServiceStub( .setMethodDescriptor(encryptMethodDescriptor) .setParamsExtractor( request -> { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("name", String.valueOf(request.getName())); - return params.build(); + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); }) + .setResourceNameExtractor(request -> request.getName()) .build(); GrpcCallSettings decryptTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(decryptMethodDescriptor) .setParamsExtractor( request -> { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("name", String.valueOf(request.getName())); - return params.build(); + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); }) + .setResourceNameExtractor(request -> request.getName()) .build(); GrpcCallSettings asymmetricSignTransportSettings = @@ -642,10 +685,11 @@ protected GrpcKeyManagementServiceStub( .setMethodDescriptor(asymmetricSignMethodDescriptor) .setParamsExtractor( request -> { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("name", String.valueOf(request.getName())); - return params.build(); + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); }) + .setResourceNameExtractor(request -> request.getName()) .build(); GrpcCallSettings asymmetricDecryptTransportSettings = @@ -653,10 +697,11 @@ protected GrpcKeyManagementServiceStub( .setMethodDescriptor(asymmetricDecryptMethodDescriptor) .setParamsExtractor( request -> { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("name", String.valueOf(request.getName())); - return params.build(); + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); }) + .setResourceNameExtractor(request -> request.getName()) .build(); GrpcCallSettings updateCryptoKeyPrimaryVersionTransportSettings = @@ -664,10 +709,11 @@ protected GrpcKeyManagementServiceStub( .setMethodDescriptor(updateCryptoKeyPrimaryVersionMethodDescriptor) .setParamsExtractor( request -> { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("name", String.valueOf(request.getName())); - return params.build(); + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); }) + .setResourceNameExtractor(request -> request.getName()) .build(); GrpcCallSettings destroyCryptoKeyVersionTransportSettings = @@ -675,10 +721,11 @@ protected GrpcKeyManagementServiceStub( .setMethodDescriptor(destroyCryptoKeyVersionMethodDescriptor) .setParamsExtractor( request -> { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("name", String.valueOf(request.getName())); - return params.build(); + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); }) + .setResourceNameExtractor(request -> request.getName()) .build(); GrpcCallSettings restoreCryptoKeyVersionTransportSettings = @@ -686,30 +733,32 @@ protected GrpcKeyManagementServiceStub( .setMethodDescriptor(restoreCryptoKeyVersionMethodDescriptor) .setParamsExtractor( request -> { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("name", String.valueOf(request.getName())); - return params.build(); + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); }) + .setResourceNameExtractor(request -> request.getName()) .build(); GrpcCallSettings getIamPolicyTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(getIamPolicyMethodDescriptor) .setParamsExtractor( request -> { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("resource", String.valueOf(request.getResource())); - return params.build(); + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("resource", String.valueOf(request.getResource())); + return builder.build(); }) + .setResourceNameExtractor(request -> request.getResource()) .build(); GrpcCallSettings listLocationsTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(listLocationsMethodDescriptor) .setParamsExtractor( request -> { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("filter", String.valueOf(request.getFilter())); - params.put("page_size", String.valueOf(request.getPageSize())); - return params.build(); + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("filter", String.valueOf(request.getFilter())); + builder.add("page_size", String.valueOf(request.getPageSize())); + return builder.build(); }) .build(); GrpcCallSettings getLocationTransportSettings = @@ -717,9 +766,9 @@ protected GrpcKeyManagementServiceStub( .setMethodDescriptor(getLocationMethodDescriptor) .setParamsExtractor( request -> { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("name", String.valueOf(request.getName())); - return params.build(); + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); }) .build(); GrpcCallSettings @@ -728,10 +777,11 @@ protected GrpcKeyManagementServiceStub( .setMethodDescriptor(testIamPermissionsMethodDescriptor) .setParamsExtractor( request -> { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("resource", String.valueOf(request.getResource())); - return params.build(); + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("resource", String.valueOf(request.getResource())); + return builder.build(); }) + .setResourceNameExtractor(request -> request.getResource()) .build(); this.listKeyRingsCallable = diff --git a/test/integration/goldens/kms/src/com/google/cloud/kms/v1/stub/KeyManagementServiceStub.java b/test/integration/goldens/kms/src/com/google/cloud/kms/v1/stub/KeyManagementServiceStub.java index 53dd2d9b02..b23cdac854 100644 --- a/test/integration/goldens/kms/src/com/google/cloud/kms/v1/stub/KeyManagementServiceStub.java +++ b/test/integration/goldens/kms/src/com/google/cloud/kms/v1/stub/KeyManagementServiceStub.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/kms/src/com/google/cloud/kms/v1/stub/KeyManagementServiceStubSettings.java b/test/integration/goldens/kms/src/com/google/cloud/kms/v1/stub/KeyManagementServiceStubSettings.java index 319425e612..850140cc82 100644 --- a/test/integration/goldens/kms/src/com/google/cloud/kms/v1/stub/KeyManagementServiceStubSettings.java +++ b/test/integration/goldens/kms/src/com/google/cloud/kms/v1/stub/KeyManagementServiceStubSettings.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -24,7 +24,7 @@ import com.google.api.core.ApiFunction; import com.google.api.core.ApiFuture; -import com.google.api.core.BetaApi; +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; @@ -35,6 +35,7 @@ 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.LibraryMetadata; import com.google.api.gax.rpc.PageContext; import com.google.api.gax.rpc.PagedCallSettings; import com.google.api.gax.rpc.PagedListDescriptor; @@ -93,9 +94,9 @@ import com.google.iam.v1.TestIamPermissionsRequest; import com.google.iam.v1.TestIamPermissionsResponse; import java.io.IOException; +import java.time.Duration; import java.util.List; import javax.annotation.Generated; -import org.threeten.bp.Duration; // AUTO-GENERATED DOCUMENTATION AND CLASS. /** @@ -112,7 +113,9 @@ *

        The builder of this class is recursive, so contained classes are themselves builders. When * build() is called, the tree of builders is called to create the complete settings object. * - *

        For example, to set the total timeout of getKeyRing to 30 seconds: + *

        For example, to set the + * [RetrySettings](https://cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.retrying.RetrySettings) + * of getKeyRing: * *

        {@code
          * // This snippet has been automatically generated and should be regarded as a code template only.
        @@ -129,13 +132,25 @@
          *             .getKeyRingSettings()
          *             .getRetrySettings()
          *             .toBuilder()
        - *             .setTotalTimeout(Duration.ofSeconds(30))
        + *             .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());
          * KeyManagementServiceStubSettings keyManagementServiceSettings =
          *     keyManagementServiceSettingsBuilder.build();
          * }
        + * + * Please refer to the [Client Side Retry + * Guide](https://docs.cloud.google.com/java/docs/client-retries) for additional support in setting + * retries. */ @Generated("by gapic-generator-java") +@SuppressWarnings("CanonicalDuration") public class KeyManagementServiceStubSettings extends StubSettings { /** The default scopes of the service. */ @@ -225,9 +240,7 @@ public String extractNextToken(ListKeyRingsResponse payload) { @Override public Iterable extractResources(ListKeyRingsResponse payload) { - return payload.getKeyRingsList() == null - ? ImmutableList.of() - : payload.getKeyRingsList(); + return payload.getKeyRingsList(); } }; @@ -262,9 +275,7 @@ public String extractNextToken(ListCryptoKeysResponse payload) { @Override public Iterable extractResources(ListCryptoKeysResponse payload) { - return payload.getCryptoKeysList() == null - ? ImmutableList.of() - : payload.getCryptoKeysList(); + return payload.getCryptoKeysList(); } }; @@ -303,9 +314,7 @@ public String extractNextToken(ListCryptoKeyVersionsResponse payload) { @Override public Iterable extractResources( ListCryptoKeyVersionsResponse payload) { - return payload.getCryptoKeyVersionsList() == null - ? ImmutableList.of() - : payload.getCryptoKeyVersionsList(); + return payload.getCryptoKeyVersionsList(); } }; @@ -340,9 +349,7 @@ public String extractNextToken(ListImportJobsResponse payload) { @Override public Iterable extractResources(ListImportJobsResponse payload) { - return payload.getImportJobsList() == null - ? ImmutableList.of() - : payload.getImportJobsList(); + return payload.getImportJobsList(); } }; @@ -376,9 +383,7 @@ public String extractNextToken(ListLocationsResponse payload) { @Override public Iterable extractResources(ListLocationsResponse payload) { - return payload.getLocationsList() == null - ? ImmutableList.of() - : payload.getLocationsList(); + return payload.getLocationsList(); } }; @@ -639,12 +644,19 @@ public KeyManagementServiceStub createStub() throws IOException { "Transport not supported: %s", getTransportChannelProvider().getTransportName())); } + /** Returns the default service name. */ + @Override + public String getServiceName() { + return "cloudkms"; + } + /** 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 "cloudkms.googleapis.com:443"; } @@ -676,7 +688,6 @@ public static TransportChannelProvider defaultTransportChannelProvider() { return defaultGrpcTransportProviderBuilder().build(); } - @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { return ApiClientHeaderProvider.newBuilder() .setGeneratedLibToken( @@ -733,6 +744,11 @@ protected KeyManagementServiceStubSettings(Builder settingsBuilder) throws IOExc testIamPermissionsSettings = settingsBuilder.testIamPermissionsSettings().build(); } + @Override + protected LibraryMetadata getLibraryMetadata() { + return LibraryMetadata.newBuilder().setVersion(Version.VERSION).build(); + } + /** Builder for KeyManagementServiceStubSettings. */ public static class Builder extends StubSettings.Builder { @@ -813,21 +829,21 @@ public static class Builder RetrySettings settings = null; settings = RetrySettings.newBuilder() - .setInitialRetryDelay(Duration.ofMillis(100L)) + .setInitialRetryDelayDuration(Duration.ofMillis(100L)) .setRetryDelayMultiplier(1.3) - .setMaxRetryDelay(Duration.ofMillis(60000L)) - .setInitialRpcTimeout(Duration.ofMillis(60000L)) + .setMaxRetryDelayDuration(Duration.ofMillis(60000L)) + .setInitialRpcTimeoutDuration(Duration.ofMillis(60000L)) .setRpcTimeoutMultiplier(1.0) - .setMaxRpcTimeout(Duration.ofMillis(60000L)) - .setTotalTimeout(Duration.ofMillis(60000L)) + .setMaxRpcTimeoutDuration(Duration.ofMillis(60000L)) + .setTotalTimeoutDuration(Duration.ofMillis(60000L)) .build(); definitions.put("retry_policy_1_params", settings); settings = RetrySettings.newBuilder() - .setInitialRpcTimeout(Duration.ofMillis(60000L)) + .setInitialRpcTimeoutDuration(Duration.ofMillis(60000L)) .setRpcTimeoutMultiplier(1.0) - .setMaxRpcTimeout(Duration.ofMillis(60000L)) - .setTotalTimeout(Duration.ofMillis(60000L)) + .setMaxRpcTimeoutDuration(Duration.ofMillis(60000L)) + .setTotalTimeoutDuration(Duration.ofMillis(60000L)) .build(); definitions.put("no_retry_0_params", settings); settings = RetrySettings.newBuilder().setRpcTimeoutMultiplier(1.0).build(); @@ -972,7 +988,6 @@ private static Builder createDefault() { builder.setTransportChannelProvider(defaultTransportChannelProvider()); builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); builder.setInternalHeaderProvider(defaultApiClientHeaderProviderBuilder().build()); - builder.setEndpoint(getDefaultEndpoint()); builder.setMtlsEndpoint(getDefaultMtlsEndpoint()); builder.setSwitchToMtlsEndpointAllowed(true); diff --git a/test/integration/goldens/kms/src/com/google/cloud/kms/v1/stub/Version.java b/test/integration/goldens/kms/src/com/google/cloud/kms/v1/stub/Version.java new file mode 100644 index 0000000000..0bca6dc5ab --- /dev/null +++ b/test/integration/goldens/kms/src/com/google/cloud/kms/v1/stub/Version.java @@ -0,0 +1,27 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS 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.kms.v1.stub; + +import com.google.api.core.InternalApi; + +@InternalApi("For internal use only") +final class Version { + // {x-version-update-start:null:current} + static final String VERSION = "0.0.0-SNAPSHOT"; + // {x-version-update-end} + +} diff --git a/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryservice/create/SyncCreateSetCredentialsProvider.java b/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryservice/create/SyncCreateSetCredentialsProvider.java index 0a449701a1..db91f48c7b 100644 --- a/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryservice/create/SyncCreateSetCredentialsProvider.java +++ b/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryservice/create/SyncCreateSetCredentialsProvider.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryservice/create/SyncCreateSetEndpoint.java b/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryservice/create/SyncCreateSetEndpoint.java index 1ed4230d03..7b6bd43f20 100644 --- a/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryservice/create/SyncCreateSetEndpoint.java +++ b/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryservice/create/SyncCreateSetEndpoint.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryservice/create/SyncCreateUseHttpJsonTransport.java b/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryservice/create/SyncCreateUseHttpJsonTransport.java new file mode 100644 index 0000000000..dc05b26bb3 --- /dev/null +++ b/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryservice/create/SyncCreateUseHttpJsonTransport.java @@ -0,0 +1,40 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS 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.example.library.v1.samples; + +// [START example_v1_generated_LibraryService_Create_UseHttpJsonTransport_sync] +import com.google.cloud.example.library.v1.LibraryServiceClient; +import com.google.cloud.example.library.v1.LibraryServiceSettings; + +public class SyncCreateUseHttpJsonTransport { + + public static void main(String[] args) throws Exception { + syncCreateUseHttpJsonTransport(); + } + + public static void syncCreateUseHttpJsonTransport() 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 + LibraryServiceSettings libraryServiceSettings = + LibraryServiceSettings.newHttpJsonBuilder().build(); + LibraryServiceClient libraryServiceClient = LibraryServiceClient.create(libraryServiceSettings); + } +} +// [END example_v1_generated_LibraryService_Create_UseHttpJsonTransport_sync] diff --git a/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryservice/createbook/AsyncCreateBook.java b/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryservice/createbook/AsyncCreateBook.java index d58d7c2ca5..6268137fb5 100644 --- a/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryservice/createbook/AsyncCreateBook.java +++ b/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryservice/createbook/AsyncCreateBook.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryservice/createbook/SyncCreateBook.java b/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryservice/createbook/SyncCreateBook.java index 206c7673f5..3973df4aba 100644 --- a/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryservice/createbook/SyncCreateBook.java +++ b/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryservice/createbook/SyncCreateBook.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryservice/createbook/SyncCreateBookShelfnameBook.java b/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryservice/createbook/SyncCreateBookShelfnameBook.java index 5cd834c754..9acba7393a 100644 --- a/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryservice/createbook/SyncCreateBookShelfnameBook.java +++ b/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryservice/createbook/SyncCreateBookShelfnameBook.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryservice/createbook/SyncCreateBookStringBook.java b/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryservice/createbook/SyncCreateBookStringBook.java index 97a22b457a..b09cf7ee0c 100644 --- a/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryservice/createbook/SyncCreateBookStringBook.java +++ b/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryservice/createbook/SyncCreateBookStringBook.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryservice/createshelf/AsyncCreateShelf.java b/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryservice/createshelf/AsyncCreateShelf.java index a6707d3f05..640ccadf0d 100644 --- a/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryservice/createshelf/AsyncCreateShelf.java +++ b/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryservice/createshelf/AsyncCreateShelf.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryservice/createshelf/SyncCreateShelf.java b/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryservice/createshelf/SyncCreateShelf.java index b1017b8894..a3167e7a8b 100644 --- a/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryservice/createshelf/SyncCreateShelf.java +++ b/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryservice/createshelf/SyncCreateShelf.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryservice/createshelf/SyncCreateShelfShelf.java b/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryservice/createshelf/SyncCreateShelfShelf.java index d594994378..dd7ec9f273 100644 --- a/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryservice/createshelf/SyncCreateShelfShelf.java +++ b/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryservice/createshelf/SyncCreateShelfShelf.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryservice/deletebook/AsyncDeleteBook.java b/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryservice/deletebook/AsyncDeleteBook.java index 1402bdeb2b..0f2f63ac2b 100644 --- a/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryservice/deletebook/AsyncDeleteBook.java +++ b/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryservice/deletebook/AsyncDeleteBook.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryservice/deletebook/SyncDeleteBook.java b/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryservice/deletebook/SyncDeleteBook.java index ce5f72f7d4..96137345bf 100644 --- a/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryservice/deletebook/SyncDeleteBook.java +++ b/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryservice/deletebook/SyncDeleteBook.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryservice/deletebook/SyncDeleteBookBookname.java b/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryservice/deletebook/SyncDeleteBookBookname.java index 4984014875..6da9dce704 100644 --- a/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryservice/deletebook/SyncDeleteBookBookname.java +++ b/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryservice/deletebook/SyncDeleteBookBookname.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryservice/deletebook/SyncDeleteBookString.java b/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryservice/deletebook/SyncDeleteBookString.java index 2747919b8c..3fdb9c7cea 100644 --- a/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryservice/deletebook/SyncDeleteBookString.java +++ b/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryservice/deletebook/SyncDeleteBookString.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryservice/deleteshelf/AsyncDeleteShelf.java b/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryservice/deleteshelf/AsyncDeleteShelf.java index 00960baafe..f0dba7ed4d 100644 --- a/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryservice/deleteshelf/AsyncDeleteShelf.java +++ b/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryservice/deleteshelf/AsyncDeleteShelf.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryservice/deleteshelf/SyncDeleteShelf.java b/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryservice/deleteshelf/SyncDeleteShelf.java index 737844b638..b4fa396669 100644 --- a/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryservice/deleteshelf/SyncDeleteShelf.java +++ b/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryservice/deleteshelf/SyncDeleteShelf.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryservice/deleteshelf/SyncDeleteShelfShelfname.java b/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryservice/deleteshelf/SyncDeleteShelfShelfname.java index 5b9a49da88..628d2499f2 100644 --- a/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryservice/deleteshelf/SyncDeleteShelfShelfname.java +++ b/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryservice/deleteshelf/SyncDeleteShelfShelfname.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryservice/deleteshelf/SyncDeleteShelfString.java b/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryservice/deleteshelf/SyncDeleteShelfString.java index 6a1bc22c88..e8f9e75165 100644 --- a/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryservice/deleteshelf/SyncDeleteShelfString.java +++ b/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryservice/deleteshelf/SyncDeleteShelfString.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryservice/getbook/AsyncGetBook.java b/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryservice/getbook/AsyncGetBook.java index 19f18d0b29..17908d9f05 100644 --- a/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryservice/getbook/AsyncGetBook.java +++ b/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryservice/getbook/AsyncGetBook.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryservice/getbook/SyncGetBook.java b/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryservice/getbook/SyncGetBook.java index 31858147ef..80bf2776de 100644 --- a/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryservice/getbook/SyncGetBook.java +++ b/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryservice/getbook/SyncGetBook.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryservice/getbook/SyncGetBookBookname.java b/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryservice/getbook/SyncGetBookBookname.java index 718395228e..b31c7acef6 100644 --- a/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryservice/getbook/SyncGetBookBookname.java +++ b/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryservice/getbook/SyncGetBookBookname.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryservice/getbook/SyncGetBookString.java b/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryservice/getbook/SyncGetBookString.java index 5c7f398a5e..8f93bd16c4 100644 --- a/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryservice/getbook/SyncGetBookString.java +++ b/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryservice/getbook/SyncGetBookString.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryservice/getshelf/AsyncGetShelf.java b/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryservice/getshelf/AsyncGetShelf.java index 0d7d770f7c..604bccb334 100644 --- a/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryservice/getshelf/AsyncGetShelf.java +++ b/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryservice/getshelf/AsyncGetShelf.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryservice/getshelf/SyncGetShelf.java b/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryservice/getshelf/SyncGetShelf.java index b6ddbfd368..905503b31b 100644 --- a/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryservice/getshelf/SyncGetShelf.java +++ b/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryservice/getshelf/SyncGetShelf.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryservice/getshelf/SyncGetShelfShelfname.java b/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryservice/getshelf/SyncGetShelfShelfname.java index 7d6955a5f7..7f3fc2febd 100644 --- a/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryservice/getshelf/SyncGetShelfShelfname.java +++ b/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryservice/getshelf/SyncGetShelfShelfname.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryservice/getshelf/SyncGetShelfString.java b/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryservice/getshelf/SyncGetShelfString.java index 9f4e413306..7a8939d099 100644 --- a/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryservice/getshelf/SyncGetShelfString.java +++ b/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryservice/getshelf/SyncGetShelfString.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryservice/listbooks/AsyncListBooks.java b/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryservice/listbooks/AsyncListBooks.java index b5b4237d8b..b0e8e41c80 100644 --- a/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryservice/listbooks/AsyncListBooks.java +++ b/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryservice/listbooks/AsyncListBooks.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryservice/listbooks/AsyncListBooksPaged.java b/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryservice/listbooks/AsyncListBooksPaged.java index 243f5c6525..08d417576f 100644 --- a/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryservice/listbooks/AsyncListBooksPaged.java +++ b/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryservice/listbooks/AsyncListBooksPaged.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryservice/listbooks/SyncListBooks.java b/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryservice/listbooks/SyncListBooks.java index 34a171a818..64dccb1bbf 100644 --- a/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryservice/listbooks/SyncListBooks.java +++ b/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryservice/listbooks/SyncListBooks.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryservice/listbooks/SyncListBooksShelfname.java b/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryservice/listbooks/SyncListBooksShelfname.java index fc80b4f278..d132baebb2 100644 --- a/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryservice/listbooks/SyncListBooksShelfname.java +++ b/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryservice/listbooks/SyncListBooksShelfname.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryservice/listbooks/SyncListBooksString.java b/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryservice/listbooks/SyncListBooksString.java index e1b8889824..3560f96854 100644 --- a/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryservice/listbooks/SyncListBooksString.java +++ b/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryservice/listbooks/SyncListBooksString.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryservice/listshelves/AsyncListShelves.java b/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryservice/listshelves/AsyncListShelves.java index a211012179..da7699b9f1 100644 --- a/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryservice/listshelves/AsyncListShelves.java +++ b/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryservice/listshelves/AsyncListShelves.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryservice/listshelves/AsyncListShelvesPaged.java b/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryservice/listshelves/AsyncListShelvesPaged.java index b4c6b47d3e..e1317114c9 100644 --- a/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryservice/listshelves/AsyncListShelvesPaged.java +++ b/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryservice/listshelves/AsyncListShelvesPaged.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryservice/listshelves/SyncListShelves.java b/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryservice/listshelves/SyncListShelves.java index 05a25be7c7..a5bd5d78c5 100644 --- a/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryservice/listshelves/SyncListShelves.java +++ b/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryservice/listshelves/SyncListShelves.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryservice/mergeshelves/AsyncMergeShelves.java b/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryservice/mergeshelves/AsyncMergeShelves.java index c987d1f46a..af5d01e796 100644 --- a/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryservice/mergeshelves/AsyncMergeShelves.java +++ b/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryservice/mergeshelves/AsyncMergeShelves.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryservice/mergeshelves/SyncMergeShelves.java b/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryservice/mergeshelves/SyncMergeShelves.java index 789de5490d..e3c621a6dc 100644 --- a/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryservice/mergeshelves/SyncMergeShelves.java +++ b/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryservice/mergeshelves/SyncMergeShelves.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryservice/mergeshelves/SyncMergeShelvesShelfnameShelfname.java b/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryservice/mergeshelves/SyncMergeShelvesShelfnameShelfname.java index db19cd564f..10bc2792b7 100644 --- a/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryservice/mergeshelves/SyncMergeShelvesShelfnameShelfname.java +++ b/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryservice/mergeshelves/SyncMergeShelvesShelfnameShelfname.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryservice/mergeshelves/SyncMergeShelvesShelfnameString.java b/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryservice/mergeshelves/SyncMergeShelvesShelfnameString.java index e0d1e6e92e..e618593ad4 100644 --- a/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryservice/mergeshelves/SyncMergeShelvesShelfnameString.java +++ b/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryservice/mergeshelves/SyncMergeShelvesShelfnameString.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryservice/mergeshelves/SyncMergeShelvesStringShelfname.java b/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryservice/mergeshelves/SyncMergeShelvesStringShelfname.java index 069e1c53a9..daa0008766 100644 --- a/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryservice/mergeshelves/SyncMergeShelvesStringShelfname.java +++ b/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryservice/mergeshelves/SyncMergeShelvesStringShelfname.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryservice/mergeshelves/SyncMergeShelvesStringString.java b/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryservice/mergeshelves/SyncMergeShelvesStringString.java index a43b537dff..bf8adae76d 100644 --- a/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryservice/mergeshelves/SyncMergeShelvesStringString.java +++ b/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryservice/mergeshelves/SyncMergeShelvesStringString.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryservice/movebook/AsyncMoveBook.java b/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryservice/movebook/AsyncMoveBook.java index d708cf7261..09b0fdafc0 100644 --- a/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryservice/movebook/AsyncMoveBook.java +++ b/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryservice/movebook/AsyncMoveBook.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryservice/movebook/SyncMoveBook.java b/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryservice/movebook/SyncMoveBook.java index f6550c13c4..0bc90cb641 100644 --- a/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryservice/movebook/SyncMoveBook.java +++ b/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryservice/movebook/SyncMoveBook.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryservice/movebook/SyncMoveBookBooknameShelfname.java b/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryservice/movebook/SyncMoveBookBooknameShelfname.java index 99c1fd34f9..e37ac87bb5 100644 --- a/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryservice/movebook/SyncMoveBookBooknameShelfname.java +++ b/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryservice/movebook/SyncMoveBookBooknameShelfname.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryservice/movebook/SyncMoveBookBooknameString.java b/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryservice/movebook/SyncMoveBookBooknameString.java index c9054e654d..a5cb4c45ad 100644 --- a/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryservice/movebook/SyncMoveBookBooknameString.java +++ b/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryservice/movebook/SyncMoveBookBooknameString.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryservice/movebook/SyncMoveBookStringShelfname.java b/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryservice/movebook/SyncMoveBookStringShelfname.java index be18f93ee6..78e106a08f 100644 --- a/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryservice/movebook/SyncMoveBookStringShelfname.java +++ b/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryservice/movebook/SyncMoveBookStringShelfname.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryservice/movebook/SyncMoveBookStringString.java b/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryservice/movebook/SyncMoveBookStringString.java index f138247526..7cbf6c4c41 100644 --- a/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryservice/movebook/SyncMoveBookStringString.java +++ b/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryservice/movebook/SyncMoveBookStringString.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryservice/updatebook/AsyncUpdateBook.java b/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryservice/updatebook/AsyncUpdateBook.java index f2d4c0b210..c4f093d594 100644 --- a/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryservice/updatebook/AsyncUpdateBook.java +++ b/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryservice/updatebook/AsyncUpdateBook.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryservice/updatebook/SyncUpdateBook.java b/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryservice/updatebook/SyncUpdateBook.java index cf7e3d0518..85c89c684b 100644 --- a/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryservice/updatebook/SyncUpdateBook.java +++ b/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryservice/updatebook/SyncUpdateBook.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryservice/updatebook/SyncUpdateBookBookFieldmask.java b/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryservice/updatebook/SyncUpdateBookBookFieldmask.java index d35550ea87..ee81af0335 100644 --- a/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryservice/updatebook/SyncUpdateBookBookFieldmask.java +++ b/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryservice/updatebook/SyncUpdateBookBookFieldmask.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryservicesettings/createshelf/SyncCreateShelf.java b/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryservicesettings/createshelf/SyncCreateShelf.java index f308ba1d66..b216eb70fb 100644 --- a/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryservicesettings/createshelf/SyncCreateShelf.java +++ b/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryservicesettings/createshelf/SyncCreateShelf.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -41,7 +41,14 @@ public static void syncCreateShelf() throws Exception { .createShelfSettings() .getRetrySettings() .toBuilder() - .setTotalTimeout(Duration.ofSeconds(30)) + .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()); LibraryServiceSettings libraryServiceSettings = libraryServiceSettingsBuilder.build(); } diff --git a/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/stub/libraryservicestubsettings/createshelf/SyncCreateShelf.java b/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/stub/libraryservicestubsettings/createshelf/SyncCreateShelf.java index 0634f4ea7c..758fffdb68 100644 --- a/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/stub/libraryservicestubsettings/createshelf/SyncCreateShelf.java +++ b/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/stub/libraryservicestubsettings/createshelf/SyncCreateShelf.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -41,7 +41,14 @@ public static void syncCreateShelf() throws Exception { .createShelfSettings() .getRetrySettings() .toBuilder() - .setTotalTimeout(Duration.ofSeconds(30)) + .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()); LibraryServiceStubSettings libraryServiceSettings = libraryServiceSettingsBuilder.build(); } diff --git a/test/integration/goldens/library/src/META-INF/native-image/com.google.cloud.example.library.v1/reflect-config.json b/test/integration/goldens/library/src/META-INF/native-image/com.google.cloud.example.library.v1/reflect-config.json new file mode 100644 index 0000000000..19bbd67f8a --- /dev/null +++ b/test/integration/goldens/library/src/META-INF/native-image/com.google.cloud.example.library.v1/reflect-config.json @@ -0,0 +1,1433 @@ +[ + { + "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.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.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.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.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.example.library.v1.Book", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.example.library.v1.Book$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.example.library.v1.CreateBookRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.example.library.v1.CreateBookRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.example.library.v1.CreateShelfRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.example.library.v1.CreateShelfRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.example.library.v1.DeleteBookRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.example.library.v1.DeleteBookRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.example.library.v1.DeleteShelfRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.example.library.v1.DeleteShelfRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.example.library.v1.GetBookRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.example.library.v1.GetBookRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.example.library.v1.GetShelfRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.example.library.v1.GetShelfRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.example.library.v1.ListBooksRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.example.library.v1.ListBooksRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.example.library.v1.ListBooksResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.example.library.v1.ListBooksResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.example.library.v1.ListShelvesRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.example.library.v1.ListShelvesRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.example.library.v1.ListShelvesResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.example.library.v1.ListShelvesResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.example.library.v1.MergeShelvesRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.example.library.v1.MergeShelvesRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.example.library.v1.MoveBookRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.example.library.v1.MoveBookRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.example.library.v1.Shelf", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.example.library.v1.Shelf$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.example.library.v1.UpdateBookRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.example.library.v1.UpdateBookRequest$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 + } +] \ No newline at end of file diff --git a/test/integration/goldens/library/src/com/google/cloud/example/library/v1/LibraryServiceClient.java b/test/integration/goldens/library/src/com/google/cloud/example/library/v1/LibraryServiceClient.java index ca741d1d1f..9dcad15023 100644 --- a/test/integration/goldens/library/src/com/google/cloud/example/library/v1/LibraryServiceClient.java +++ b/test/integration/goldens/library/src/com/google/cloud/example/library/v1/LibraryServiceClient.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -80,19 +80,223 @@ *

        Note: close() needs to be called on the LibraryServiceClient object to clean up resources such * as threads. In the example above, try-with-resources is used, which automatically calls close(). * - *

        The surface of this class includes several types of Java methods for each of the API's - * methods: - * - *

          - *
        1. A "flattened" method. With this type of method, the fields of the request type have been - * converted into function parameters. It may be the case that not all fields are available as - * parameters, and not every API method will have a flattened method entry point. - *
        2. A "request object" method. This type of method only takes one parameter, a request object, - * which must be constructed before the call. Not every API method will have a request object - * method. - *
        3. A "callable" method. This type of method takes no parameters and returns an immutable API - * callable object, which can be used to initiate calls to the service. - *
        + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + *
        Methods
        MethodDescriptionMethod Variants

        CreateShelf

        Creates a shelf, and returns the new Shelf.

        + *

        Request object method variants only take one parameter, a request object, which must be constructed before the call.

        + *
          + *
        • createShelf(CreateShelfRequest request) + *

        + *

        "Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

        + *
          + *
        • createShelf(Shelf shelf) + *

        + *

        Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

        + *
          + *
        • createShelfCallable() + *

        + *

        GetShelf

        Gets a shelf. Returns NOT_FOUND if the shelf does not exist.

        + *

        Request object method variants only take one parameter, a request object, which must be constructed before the call.

        + *
          + *
        • getShelf(GetShelfRequest request) + *

        + *

        "Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

        + *
          + *
        • getShelf(ShelfName name) + *

        • getShelf(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.

        + *
          + *
        • getShelfCallable() + *

        + *

        ListShelves

        Lists shelves. The order is unspecified but deterministic. Newly created shelves will not necessarily be added to the end of this list.

        + *

        Request object method variants only take one parameter, a request object, which must be constructed before the call.

        + *
          + *
        • listShelves(ListShelvesRequest request) + *

        + *

        Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

        + *
          + *
        • listShelvesPagedCallable() + *

        • listShelvesCallable() + *

        + *

        DeleteShelf

        Deletes a shelf. Returns NOT_FOUND if the shelf does not exist.

        + *

        Request object method variants only take one parameter, a request object, which must be constructed before the call.

        + *
          + *
        • deleteShelf(DeleteShelfRequest request) + *

        + *

        "Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

        + *
          + *
        • deleteShelf(ShelfName name) + *

        • deleteShelf(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.

        + *
          + *
        • deleteShelfCallable() + *

        + *

        MergeShelves

        Merges two shelves by adding all books from the shelf named `other_shelf_name` to shelf `name`, and deletes `other_shelf_name`. Returns the updated shelf. The book ids of the moved books may not be the same as the original books. + *

        Returns NOT_FOUND if either shelf does not exist. This call is a no-op if the specified shelves are the same.

        + *

        Request object method variants only take one parameter, a request object, which must be constructed before the call.

        + *
          + *
        • mergeShelves(MergeShelvesRequest request) + *

        + *

        "Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

        + *
          + *
        • mergeShelves(ShelfName name, ShelfName otherShelf) + *

        • mergeShelves(ShelfName name, String otherShelf) + *

        • mergeShelves(String name, ShelfName otherShelf) + *

        • mergeShelves(String name, String otherShelf) + *

        + *

        Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

        + *
          + *
        • mergeShelvesCallable() + *

        + *

        CreateBook

        Creates a book, and returns the new Book.

        + *

        Request object method variants only take one parameter, a request object, which must be constructed before the call.

        + *
          + *
        • createBook(CreateBookRequest request) + *

        + *

        "Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

        + *
          + *
        • createBook(ShelfName parent, Book book) + *

        • createBook(String parent, Book book) + *

        + *

        Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

        + *
          + *
        • createBookCallable() + *

        + *

        GetBook

        Gets a book. Returns NOT_FOUND if the book does not exist.

        + *

        Request object method variants only take one parameter, a request object, which must be constructed before the call.

        + *
          + *
        • getBook(GetBookRequest request) + *

        + *

        "Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

        + *
          + *
        • getBook(BookName name) + *

        • getBook(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.

        + *
          + *
        • getBookCallable() + *

        + *

        ListBooks

        Lists books in a shelf. The order is unspecified but deterministic. Newly created books will not necessarily be added to the end of this list. Returns NOT_FOUND if the shelf does not exist.

        + *

        Request object method variants only take one parameter, a request object, which must be constructed before the call.

        + *
          + *
        • listBooks(ListBooksRequest request) + *

        + *

        "Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

        + *
          + *
        • listBooks(ShelfName parent) + *

        • listBooks(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.

        + *
          + *
        • listBooksPagedCallable() + *

        • listBooksCallable() + *

        + *

        DeleteBook

        Deletes a book. Returns NOT_FOUND if the book does not exist.

        + *

        Request object method variants only take one parameter, a request object, which must be constructed before the call.

        + *
          + *
        • deleteBook(DeleteBookRequest request) + *

        + *

        "Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

        + *
          + *
        • deleteBook(BookName name) + *

        • deleteBook(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.

        + *
          + *
        • deleteBookCallable() + *

        + *

        UpdateBook

        Updates a book. Returns INVALID_ARGUMENT if the name of the book is non-empty and does not equal the existing name.

        + *

        Request object method variants only take one parameter, a request object, which must be constructed before the call.

        + *
          + *
        • updateBook(UpdateBookRequest request) + *

        + *

        "Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

        + *
          + *
        • updateBook(Book book, 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.

        + *
          + *
        • updateBookCallable() + *

        + *

        MoveBook

        Moves a book to another shelf, and returns the new book. The book id of the new book may not be the same as the original book.

        + *

        Request object method variants only take one parameter, a request object, which must be constructed before the call.

        + *
          + *
        • moveBook(MoveBookRequest request) + *

        + *

        "Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

        + *
          + *
        • moveBook(BookName name, ShelfName otherShelfName) + *

        • moveBook(BookName name, String otherShelfName) + *

        • moveBook(String name, ShelfName otherShelfName) + *

        • moveBook(String name, String otherShelfName) + *

        + *

        Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

        + *
          + *
        • moveBookCallable() + *

        + *
        * *

        See the individual methods for example code. * @@ -131,6 +335,20 @@ * LibraryServiceClient libraryServiceClient = LibraryServiceClient.create(libraryServiceSettings); * }

        * + *

        To use REST (HTTP1.1/JSON) transport (instead of gRPC) for sending and receiving requests over + * the wire: + * + *

        {@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
        + * LibraryServiceSettings libraryServiceSettings =
        + *     LibraryServiceSettings.newHttpJsonBuilder().build();
        + * LibraryServiceClient libraryServiceClient = LibraryServiceClient.create(libraryServiceSettings);
        + * }
        + * *

        Please refer to the GitHub repository's samples for more quickstart code snippets. */ @Generated("by gapic-generator-java") diff --git a/test/integration/goldens/library/src/com/google/cloud/example/library/v1/LibraryServiceClientHttpJsonTest.java b/test/integration/goldens/library/src/com/google/cloud/example/library/v1/LibraryServiceClientHttpJsonTest.java new file mode 100644 index 0000000000..fa982f4bc7 --- /dev/null +++ b/test/integration/goldens/library/src/com/google/cloud/example/library/v1/LibraryServiceClientHttpJsonTest.java @@ -0,0 +1,1177 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS 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.example.library.v1; + +import static com.google.cloud.example.library.v1.LibraryServiceClient.ListBooksPagedResponse; +import static com.google.cloud.example.library.v1.LibraryServiceClient.ListShelvesPagedResponse; + +import com.google.api.gax.core.NoCredentialsProvider; +import com.google.api.gax.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.testing.MockHttpService; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ApiException; +import com.google.api.gax.rpc.ApiExceptionFactory; +import com.google.api.gax.rpc.InvalidArgumentException; +import com.google.api.gax.rpc.StatusCode; +import com.google.api.gax.rpc.testing.FakeStatusCode; +import com.google.cloud.example.library.v1.stub.HttpJsonLibraryServiceStub; +import com.google.common.collect.Lists; +import com.google.example.library.v1.Book; +import com.google.example.library.v1.BookName; +import com.google.example.library.v1.ListBooksResponse; +import com.google.example.library.v1.ListShelvesRequest; +import com.google.example.library.v1.ListShelvesResponse; +import com.google.example.library.v1.Shelf; +import com.google.example.library.v1.ShelfName; +import com.google.protobuf.Empty; +import com.google.protobuf.FieldMask; +import java.io.IOException; +import java.util.Arrays; +import java.util.List; +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 LibraryServiceClientHttpJsonTest { + private static MockHttpService mockService; + private static LibraryServiceClient client; + + @BeforeClass + public static void startStaticServer() throws IOException { + mockService = + new MockHttpService( + HttpJsonLibraryServiceStub.getMethodDescriptors(), + LibraryServiceSettings.getDefaultEndpoint()); + LibraryServiceSettings settings = + LibraryServiceSettings.newHttpJsonBuilder() + .setTransportChannelProvider( + LibraryServiceSettings.defaultHttpJsonTransportProviderBuilder() + .setHttpTransport(mockService) + .build()) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = LibraryServiceClient.create(settings); + } + + @AfterClass + public static void stopServer() { + client.close(); + } + + @Before + public void setUp() {} + + @After + public void tearDown() throws Exception { + mockService.reset(); + } + + @Test + public void createShelfTest() throws Exception { + Shelf expectedResponse = + Shelf.newBuilder() + .setName(ShelfName.of("[SHELF_ID]").toString()) + .setTheme("theme110327241") + .build(); + mockService.addResponse(expectedResponse); + + Shelf shelf = Shelf.newBuilder().build(); + + Shelf actualResponse = client.createShelf(shelf); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void createShelfExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + Shelf shelf = Shelf.newBuilder().build(); + client.createShelf(shelf); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getShelfTest() throws Exception { + Shelf expectedResponse = + Shelf.newBuilder() + .setName(ShelfName.of("[SHELF_ID]").toString()) + .setTheme("theme110327241") + .build(); + mockService.addResponse(expectedResponse); + + ShelfName name = ShelfName.of("[SHELF_ID]"); + + Shelf actualResponse = client.getShelf(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void getShelfExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ShelfName name = ShelfName.of("[SHELF_ID]"); + client.getShelf(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getShelfTest2() throws Exception { + Shelf expectedResponse = + Shelf.newBuilder() + .setName(ShelfName.of("[SHELF_ID]").toString()) + .setTheme("theme110327241") + .build(); + mockService.addResponse(expectedResponse); + + String name = "shelves/shelve-6552"; + + Shelf actualResponse = client.getShelf(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void getShelfExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String name = "shelves/shelve-6552"; + client.getShelf(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listShelvesTest() throws Exception { + Shelf responsesElement = Shelf.newBuilder().build(); + ListShelvesResponse expectedResponse = + ListShelvesResponse.newBuilder() + .setNextPageToken("") + .addAllShelves(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + ListShelvesRequest request = + ListShelvesRequest.newBuilder() + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + + ListShelvesPagedResponse pagedListResponse = client.listShelves(request); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getShelvesList().get(0), resources.get(0)); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void listShelvesExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ListShelvesRequest request = + ListShelvesRequest.newBuilder() + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + client.listShelves(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void deleteShelfTest() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockService.addResponse(expectedResponse); + + ShelfName name = ShelfName.of("[SHELF_ID]"); + + client.deleteShelf(name); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void deleteShelfExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ShelfName name = ShelfName.of("[SHELF_ID]"); + client.deleteShelf(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void deleteShelfTest2() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockService.addResponse(expectedResponse); + + String name = "shelves/shelve-6552"; + + client.deleteShelf(name); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void deleteShelfExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String name = "shelves/shelve-6552"; + client.deleteShelf(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void mergeShelvesTest() throws Exception { + Shelf expectedResponse = + Shelf.newBuilder() + .setName(ShelfName.of("[SHELF_ID]").toString()) + .setTheme("theme110327241") + .build(); + mockService.addResponse(expectedResponse); + + ShelfName name = ShelfName.of("[SHELF_ID]"); + ShelfName otherShelf = ShelfName.of("[SHELF_ID]"); + + Shelf actualResponse = client.mergeShelves(name, otherShelf); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void mergeShelvesExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ShelfName name = ShelfName.of("[SHELF_ID]"); + ShelfName otherShelf = ShelfName.of("[SHELF_ID]"); + client.mergeShelves(name, otherShelf); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void mergeShelvesTest2() throws Exception { + Shelf expectedResponse = + Shelf.newBuilder() + .setName(ShelfName.of("[SHELF_ID]").toString()) + .setTheme("theme110327241") + .build(); + mockService.addResponse(expectedResponse); + + ShelfName name = ShelfName.of("[SHELF_ID]"); + String otherShelf = "otherShelf-193668870"; + + Shelf actualResponse = client.mergeShelves(name, otherShelf); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void mergeShelvesExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ShelfName name = ShelfName.of("[SHELF_ID]"); + String otherShelf = "otherShelf-193668870"; + client.mergeShelves(name, otherShelf); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void mergeShelvesTest3() throws Exception { + Shelf expectedResponse = + Shelf.newBuilder() + .setName(ShelfName.of("[SHELF_ID]").toString()) + .setTheme("theme110327241") + .build(); + mockService.addResponse(expectedResponse); + + String name = "shelves/shelve-6552"; + ShelfName otherShelf = ShelfName.of("[SHELF_ID]"); + + Shelf actualResponse = client.mergeShelves(name, otherShelf); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void mergeShelvesExceptionTest3() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String name = "shelves/shelve-6552"; + ShelfName otherShelf = ShelfName.of("[SHELF_ID]"); + client.mergeShelves(name, otherShelf); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void mergeShelvesTest4() throws Exception { + Shelf expectedResponse = + Shelf.newBuilder() + .setName(ShelfName.of("[SHELF_ID]").toString()) + .setTheme("theme110327241") + .build(); + mockService.addResponse(expectedResponse); + + String name = "shelves/shelve-6552"; + String otherShelf = "otherShelf-193668870"; + + Shelf actualResponse = client.mergeShelves(name, otherShelf); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void mergeShelvesExceptionTest4() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String name = "shelves/shelve-6552"; + String otherShelf = "otherShelf-193668870"; + client.mergeShelves(name, otherShelf); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createBookTest() throws Exception { + Book expectedResponse = + Book.newBuilder() + .setName(BookName.of("[SHELF]", "[BOOK]").toString()) + .setAuthor("author-1406328437") + .setTitle("title110371416") + .setRead(true) + .build(); + mockService.addResponse(expectedResponse); + + ShelfName parent = ShelfName.of("[SHELF_ID]"); + Book book = Book.newBuilder().build(); + + Book actualResponse = client.createBook(parent, book); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void createBookExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ShelfName parent = ShelfName.of("[SHELF_ID]"); + Book book = Book.newBuilder().build(); + client.createBook(parent, book); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createBookTest2() throws Exception { + Book expectedResponse = + Book.newBuilder() + .setName(BookName.of("[SHELF]", "[BOOK]").toString()) + .setAuthor("author-1406328437") + .setTitle("title110371416") + .setRead(true) + .build(); + mockService.addResponse(expectedResponse); + + String parent = "shelves/shelve-4649"; + Book book = Book.newBuilder().build(); + + Book actualResponse = client.createBook(parent, book); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void createBookExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String parent = "shelves/shelve-4649"; + Book book = Book.newBuilder().build(); + client.createBook(parent, book); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getBookTest() throws Exception { + Book expectedResponse = + Book.newBuilder() + .setName(BookName.of("[SHELF]", "[BOOK]").toString()) + .setAuthor("author-1406328437") + .setTitle("title110371416") + .setRead(true) + .build(); + mockService.addResponse(expectedResponse); + + BookName name = BookName.of("[SHELF]", "[BOOK]"); + + Book actualResponse = client.getBook(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void getBookExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + BookName name = BookName.of("[SHELF]", "[BOOK]"); + client.getBook(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getBookTest2() throws Exception { + Book expectedResponse = + Book.newBuilder() + .setName(BookName.of("[SHELF]", "[BOOK]").toString()) + .setAuthor("author-1406328437") + .setTitle("title110371416") + .setRead(true) + .build(); + mockService.addResponse(expectedResponse); + + String name = "shelves/shelve-382/books/book-382"; + + Book actualResponse = client.getBook(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void getBookExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String name = "shelves/shelve-382/books/book-382"; + client.getBook(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listBooksTest() throws Exception { + Book responsesElement = Book.newBuilder().build(); + ListBooksResponse expectedResponse = + ListBooksResponse.newBuilder() + .setNextPageToken("") + .addAllBooks(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + ShelfName parent = ShelfName.of("[SHELF_ID]"); + + ListBooksPagedResponse pagedListResponse = client.listBooks(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getBooksList().get(0), resources.get(0)); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void listBooksExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ShelfName parent = ShelfName.of("[SHELF_ID]"); + client.listBooks(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listBooksTest2() throws Exception { + Book responsesElement = Book.newBuilder().build(); + ListBooksResponse expectedResponse = + ListBooksResponse.newBuilder() + .setNextPageToken("") + .addAllBooks(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + String parent = "shelves/shelve-4649"; + + ListBooksPagedResponse pagedListResponse = client.listBooks(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getBooksList().get(0), resources.get(0)); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void listBooksExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String parent = "shelves/shelve-4649"; + client.listBooks(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void deleteBookTest() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockService.addResponse(expectedResponse); + + BookName name = BookName.of("[SHELF]", "[BOOK]"); + + client.deleteBook(name); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void deleteBookExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + BookName name = BookName.of("[SHELF]", "[BOOK]"); + client.deleteBook(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void deleteBookTest2() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockService.addResponse(expectedResponse); + + String name = "shelves/shelve-382/books/book-382"; + + client.deleteBook(name); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void deleteBookExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String name = "shelves/shelve-382/books/book-382"; + client.deleteBook(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void updateBookTest() throws Exception { + Book expectedResponse = + Book.newBuilder() + .setName(BookName.of("[SHELF]", "[BOOK]").toString()) + .setAuthor("author-1406328437") + .setTitle("title110371416") + .setRead(true) + .build(); + mockService.addResponse(expectedResponse); + + Book book = + Book.newBuilder() + .setName(BookName.of("[SHELF]", "[BOOK]").toString()) + .setAuthor("author-1406328437") + .setTitle("title110371416") + .setRead(true) + .build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + + Book actualResponse = client.updateBook(book, updateMask); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void updateBookExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + Book book = + Book.newBuilder() + .setName(BookName.of("[SHELF]", "[BOOK]").toString()) + .setAuthor("author-1406328437") + .setTitle("title110371416") + .setRead(true) + .build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + client.updateBook(book, updateMask); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void moveBookTest() throws Exception { + Book expectedResponse = + Book.newBuilder() + .setName(BookName.of("[SHELF]", "[BOOK]").toString()) + .setAuthor("author-1406328437") + .setTitle("title110371416") + .setRead(true) + .build(); + mockService.addResponse(expectedResponse); + + BookName name = BookName.of("[SHELF]", "[BOOK]"); + ShelfName otherShelfName = ShelfName.of("[SHELF_ID]"); + + Book actualResponse = client.moveBook(name, otherShelfName); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void moveBookExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + BookName name = BookName.of("[SHELF]", "[BOOK]"); + ShelfName otherShelfName = ShelfName.of("[SHELF_ID]"); + client.moveBook(name, otherShelfName); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void moveBookTest2() throws Exception { + Book expectedResponse = + Book.newBuilder() + .setName(BookName.of("[SHELF]", "[BOOK]").toString()) + .setAuthor("author-1406328437") + .setTitle("title110371416") + .setRead(true) + .build(); + mockService.addResponse(expectedResponse); + + BookName name = BookName.of("[SHELF]", "[BOOK]"); + String otherShelfName = "otherShelfName-1942963547"; + + Book actualResponse = client.moveBook(name, otherShelfName); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void moveBookExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + BookName name = BookName.of("[SHELF]", "[BOOK]"); + String otherShelfName = "otherShelfName-1942963547"; + client.moveBook(name, otherShelfName); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void moveBookTest3() throws Exception { + Book expectedResponse = + Book.newBuilder() + .setName(BookName.of("[SHELF]", "[BOOK]").toString()) + .setAuthor("author-1406328437") + .setTitle("title110371416") + .setRead(true) + .build(); + mockService.addResponse(expectedResponse); + + String name = "shelves/shelve-382/books/book-382"; + ShelfName otherShelfName = ShelfName.of("[SHELF_ID]"); + + Book actualResponse = client.moveBook(name, otherShelfName); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void moveBookExceptionTest3() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String name = "shelves/shelve-382/books/book-382"; + ShelfName otherShelfName = ShelfName.of("[SHELF_ID]"); + client.moveBook(name, otherShelfName); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void moveBookTest4() throws Exception { + Book expectedResponse = + Book.newBuilder() + .setName(BookName.of("[SHELF]", "[BOOK]").toString()) + .setAuthor("author-1406328437") + .setTitle("title110371416") + .setRead(true) + .build(); + mockService.addResponse(expectedResponse); + + String name = "shelves/shelve-382/books/book-382"; + String otherShelfName = "otherShelfName-1942963547"; + + Book actualResponse = client.moveBook(name, otherShelfName); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void moveBookExceptionTest4() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String name = "shelves/shelve-382/books/book-382"; + String otherShelfName = "otherShelfName-1942963547"; + client.moveBook(name, otherShelfName); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } +} diff --git a/test/integration/goldens/library/src/com/google/cloud/example/library/v1/LibraryServiceClientTest.java b/test/integration/goldens/library/src/com/google/cloud/example/library/v1/LibraryServiceClientTest.java index 4e6065325a..cbe1e215cf 100644 --- a/test/integration/goldens/library/src/com/google/cloud/example/library/v1/LibraryServiceClientTest.java +++ b/test/integration/goldens/library/src/com/google/cloud/example/library/v1/LibraryServiceClientTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/library/src/com/google/cloud/example/library/v1/LibraryServiceSettings.java b/test/integration/goldens/library/src/com/google/cloud/example/library/v1/LibraryServiceSettings.java index fce77044b0..20bd7f01c5 100644 --- a/test/integration/goldens/library/src/com/google/cloud/example/library/v1/LibraryServiceSettings.java +++ b/test/integration/goldens/library/src/com/google/cloud/example/library/v1/LibraryServiceSettings.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -24,6 +24,7 @@ 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.httpjson.InstantiatingHttpJsonChannelProvider; import com.google.api.gax.rpc.ApiClientHeaderProvider; import com.google.api.gax.rpc.ClientContext; import com.google.api.gax.rpc.ClientSettings; @@ -68,7 +69,9 @@ *

        The builder of this class is recursive, so contained classes are themselves builders. When * build() is called, the tree of builders is called to create the complete settings object. * - *

        For example, to set the total timeout of createShelf to 30 seconds: + *

        For example, to set the + * [RetrySettings](https://cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.retrying.RetrySettings) + * of createShelf: * *

        {@code
          * // This snippet has been automatically generated and should be regarded as a code template only.
        @@ -85,10 +88,21 @@
          *             .createShelfSettings()
          *             .getRetrySettings()
          *             .toBuilder()
        - *             .setTotalTimeout(Duration.ofSeconds(30))
        + *             .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());
          * LibraryServiceSettings libraryServiceSettings = libraryServiceSettingsBuilder.build();
          * }
        + * + * Please refer to the [Client Side Retry + * Guide](https://docs.cloud.google.com/java/docs/client-retries) for additional support in setting + * retries. */ @Generated("by gapic-generator-java") public class LibraryServiceSettings extends ClientSettings { @@ -175,25 +189,36 @@ public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilde return LibraryServiceStubSettings.defaultCredentialsProviderBuilder(); } - /** Returns a builder for the default ChannelProvider for this service. */ + /** Returns a builder for the default gRPC ChannelProvider for this service. */ public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { return LibraryServiceStubSettings.defaultGrpcTransportProviderBuilder(); } + /** Returns a builder for the default REST ChannelProvider for this service. */ + @BetaApi + public static InstantiatingHttpJsonChannelProvider.Builder + defaultHttpJsonTransportProviderBuilder() { + return LibraryServiceStubSettings.defaultHttpJsonTransportProviderBuilder(); + } + public static TransportChannelProvider defaultTransportChannelProvider() { return LibraryServiceStubSettings.defaultTransportChannelProvider(); } - @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { return LibraryServiceStubSettings.defaultApiClientHeaderProviderBuilder(); } - /** Returns a new builder for this class. */ + /** Returns a new gRPC builder for this class. */ public static Builder newBuilder() { return Builder.createDefault(); } + /** Returns a new REST builder for this class. */ + public static Builder newHttpJsonBuilder() { + return Builder.createHttpJsonDefault(); + } + /** Returns a new builder for this class. */ public static Builder newBuilder(ClientContext clientContext) { return new Builder(clientContext); @@ -231,6 +256,10 @@ private static Builder createDefault() { return new Builder(LibraryServiceStubSettings.newBuilder()); } + private static Builder createHttpJsonDefault() { + return new Builder(LibraryServiceStubSettings.newHttpJsonBuilder()); + } + public LibraryServiceStubSettings.Builder getStubSettingsBuilder() { return ((LibraryServiceStubSettings.Builder) getStubSettings()); } diff --git a/test/integration/goldens/library/src/com/google/cloud/example/library/v1/MockLibraryService.java b/test/integration/goldens/library/src/com/google/cloud/example/library/v1/MockLibraryService.java index a5fd111f9a..10b0e85ca2 100644 --- a/test/integration/goldens/library/src/com/google/cloud/example/library/v1/MockLibraryService.java +++ b/test/integration/goldens/library/src/com/google/cloud/example/library/v1/MockLibraryService.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/library/src/com/google/cloud/example/library/v1/MockLibraryServiceImpl.java b/test/integration/goldens/library/src/com/google/cloud/example/library/v1/MockLibraryServiceImpl.java index 5e7a2ba81f..d054877b7e 100644 --- a/test/integration/goldens/library/src/com/google/cloud/example/library/v1/MockLibraryServiceImpl.java +++ b/test/integration/goldens/library/src/com/google/cloud/example/library/v1/MockLibraryServiceImpl.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/library/src/com/google/cloud/example/library/v1/package-info.java b/test/integration/goldens/library/src/com/google/cloud/example/library/v1/package-info.java index 677d1ff309..ba1917bb87 100644 --- a/test/integration/goldens/library/src/com/google/cloud/example/library/v1/package-info.java +++ b/test/integration/goldens/library/src/com/google/cloud/example/library/v1/package-info.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/library/src/com/google/cloud/example/library/v1/stub/GrpcLibraryServiceCallableFactory.java b/test/integration/goldens/library/src/com/google/cloud/example/library/v1/stub/GrpcLibraryServiceCallableFactory.java index b0d4f2bbfe..5c3abfedf0 100644 --- a/test/integration/goldens/library/src/com/google/cloud/example/library/v1/stub/GrpcLibraryServiceCallableFactory.java +++ b/test/integration/goldens/library/src/com/google/cloud/example/library/v1/stub/GrpcLibraryServiceCallableFactory.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/library/src/com/google/cloud/example/library/v1/stub/GrpcLibraryServiceStub.java b/test/integration/goldens/library/src/com/google/cloud/example/library/v1/stub/GrpcLibraryServiceStub.java index 9cfb034f16..fdf5212589 100644 --- a/test/integration/goldens/library/src/com/google/cloud/example/library/v1/stub/GrpcLibraryServiceStub.java +++ b/test/integration/goldens/library/src/com/google/cloud/example/library/v1/stub/GrpcLibraryServiceStub.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -24,8 +24,8 @@ 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.common.collect.ImmutableMap; import com.google.example.library.v1.Book; import com.google.example.library.v1.CreateBookRequest; import com.google.example.library.v1.CreateShelfRequest; @@ -64,6 +64,7 @@ public class GrpcLibraryServiceStub extends LibraryServiceStub { .setFullMethodName("google.example.library.v1.LibraryService/CreateShelf") .setRequestMarshaller(ProtoUtils.marshaller(CreateShelfRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(Shelf.getDefaultInstance())) + .setSampledToLocalTracing(true) .build(); private static final MethodDescriptor getShelfMethodDescriptor = @@ -72,6 +73,7 @@ public class GrpcLibraryServiceStub extends LibraryServiceStub { .setFullMethodName("google.example.library.v1.LibraryService/GetShelf") .setRequestMarshaller(ProtoUtils.marshaller(GetShelfRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(Shelf.getDefaultInstance())) + .setSampledToLocalTracing(true) .build(); private static final MethodDescriptor @@ -82,6 +84,7 @@ public class GrpcLibraryServiceStub extends LibraryServiceStub { .setRequestMarshaller(ProtoUtils.marshaller(ListShelvesRequest.getDefaultInstance())) .setResponseMarshaller( ProtoUtils.marshaller(ListShelvesResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) .build(); private static final MethodDescriptor deleteShelfMethodDescriptor = @@ -90,6 +93,7 @@ public class GrpcLibraryServiceStub extends LibraryServiceStub { .setFullMethodName("google.example.library.v1.LibraryService/DeleteShelf") .setRequestMarshaller(ProtoUtils.marshaller(DeleteShelfRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(Empty.getDefaultInstance())) + .setSampledToLocalTracing(true) .build(); private static final MethodDescriptor mergeShelvesMethodDescriptor = @@ -98,6 +102,7 @@ public class GrpcLibraryServiceStub extends LibraryServiceStub { .setFullMethodName("google.example.library.v1.LibraryService/MergeShelves") .setRequestMarshaller(ProtoUtils.marshaller(MergeShelvesRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(Shelf.getDefaultInstance())) + .setSampledToLocalTracing(true) .build(); private static final MethodDescriptor createBookMethodDescriptor = @@ -106,6 +111,7 @@ public class GrpcLibraryServiceStub extends LibraryServiceStub { .setFullMethodName("google.example.library.v1.LibraryService/CreateBook") .setRequestMarshaller(ProtoUtils.marshaller(CreateBookRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(Book.getDefaultInstance())) + .setSampledToLocalTracing(true) .build(); private static final MethodDescriptor getBookMethodDescriptor = @@ -114,6 +120,7 @@ public class GrpcLibraryServiceStub extends LibraryServiceStub { .setFullMethodName("google.example.library.v1.LibraryService/GetBook") .setRequestMarshaller(ProtoUtils.marshaller(GetBookRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(Book.getDefaultInstance())) + .setSampledToLocalTracing(true) .build(); private static final MethodDescriptor @@ -123,6 +130,7 @@ public class GrpcLibraryServiceStub extends LibraryServiceStub { .setFullMethodName("google.example.library.v1.LibraryService/ListBooks") .setRequestMarshaller(ProtoUtils.marshaller(ListBooksRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(ListBooksResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) .build(); private static final MethodDescriptor deleteBookMethodDescriptor = @@ -131,6 +139,7 @@ public class GrpcLibraryServiceStub extends LibraryServiceStub { .setFullMethodName("google.example.library.v1.LibraryService/DeleteBook") .setRequestMarshaller(ProtoUtils.marshaller(DeleteBookRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(Empty.getDefaultInstance())) + .setSampledToLocalTracing(true) .build(); private static final MethodDescriptor updateBookMethodDescriptor = @@ -139,6 +148,7 @@ public class GrpcLibraryServiceStub extends LibraryServiceStub { .setFullMethodName("google.example.library.v1.LibraryService/UpdateBook") .setRequestMarshaller(ProtoUtils.marshaller(UpdateBookRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(Book.getDefaultInstance())) + .setSampledToLocalTracing(true) .build(); private static final MethodDescriptor moveBookMethodDescriptor = @@ -147,6 +157,7 @@ public class GrpcLibraryServiceStub extends LibraryServiceStub { .setFullMethodName("google.example.library.v1.LibraryService/MoveBook") .setRequestMarshaller(ProtoUtils.marshaller(MoveBookRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(Book.getDefaultInstance())) + .setSampledToLocalTracing(true) .build(); private final UnaryCallable createShelfCallable; @@ -217,10 +228,11 @@ protected GrpcLibraryServiceStub( .setMethodDescriptor(getShelfMethodDescriptor) .setParamsExtractor( request -> { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("name", String.valueOf(request.getName())); - return params.build(); + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); }) + .setResourceNameExtractor(request -> request.getName()) .build(); GrpcCallSettings listShelvesTransportSettings = GrpcCallSettings.newBuilder() @@ -231,69 +243,75 @@ protected GrpcLibraryServiceStub( .setMethodDescriptor(deleteShelfMethodDescriptor) .setParamsExtractor( request -> { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("name", String.valueOf(request.getName())); - return params.build(); + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); }) + .setResourceNameExtractor(request -> request.getName()) .build(); GrpcCallSettings mergeShelvesTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(mergeShelvesMethodDescriptor) .setParamsExtractor( request -> { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("name", String.valueOf(request.getName())); - return params.build(); + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); }) + .setResourceNameExtractor(request -> request.getName()) .build(); GrpcCallSettings createBookTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(createBookMethodDescriptor) .setParamsExtractor( request -> { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("parent", String.valueOf(request.getParent())); - return params.build(); + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); }) + .setResourceNameExtractor(request -> request.getParent()) .build(); GrpcCallSettings getBookTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(getBookMethodDescriptor) .setParamsExtractor( request -> { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("name", String.valueOf(request.getName())); - return params.build(); + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); }) + .setResourceNameExtractor(request -> request.getName()) .build(); GrpcCallSettings listBooksTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(listBooksMethodDescriptor) .setParamsExtractor( request -> { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("parent", String.valueOf(request.getParent())); - return params.build(); + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); }) + .setResourceNameExtractor(request -> request.getParent()) .build(); GrpcCallSettings deleteBookTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(deleteBookMethodDescriptor) .setParamsExtractor( request -> { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("name", String.valueOf(request.getName())); - return params.build(); + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); }) + .setResourceNameExtractor(request -> request.getName()) .build(); GrpcCallSettings updateBookTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(updateBookMethodDescriptor) .setParamsExtractor( request -> { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("book.name", String.valueOf(request.getBook().getName())); - return params.build(); + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("book.name", String.valueOf(request.getBook().getName())); + return builder.build(); }) .build(); GrpcCallSettings moveBookTransportSettings = @@ -301,10 +319,11 @@ protected GrpcLibraryServiceStub( .setMethodDescriptor(moveBookMethodDescriptor) .setParamsExtractor( request -> { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("name", String.valueOf(request.getName())); - return params.build(); + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); }) + .setResourceNameExtractor(request -> request.getName()) .build(); this.createShelfCallable = diff --git a/test/integration/goldens/library/src/com/google/cloud/example/library/v1/stub/HttpJsonLibraryServiceCallableFactory.java b/test/integration/goldens/library/src/com/google/cloud/example/library/v1/stub/HttpJsonLibraryServiceCallableFactory.java new file mode 100644 index 0000000000..9607f81ea1 --- /dev/null +++ b/test/integration/goldens/library/src/com/google/cloud/example/library/v1/stub/HttpJsonLibraryServiceCallableFactory.java @@ -0,0 +1,101 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS 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.example.library.v1.stub; + +import com.google.api.gax.httpjson.HttpJsonCallSettings; +import com.google.api.gax.httpjson.HttpJsonCallableFactory; +import com.google.api.gax.httpjson.HttpJsonOperationSnapshotCallable; +import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; +import com.google.api.gax.httpjson.longrunning.stub.OperationsStub; +import com.google.api.gax.rpc.BatchingCallSettings; +import com.google.api.gax.rpc.ClientContext; +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.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.longrunning.Operation; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * REST callable factory implementation for the LibraryService service API. + * + *

        This class is for advanced usage. + */ +@Generated("by gapic-generator-java") +public class HttpJsonLibraryServiceCallableFactory + implements HttpJsonStubCallableFactory { + + @Override + public UnaryCallable createUnaryCallable( + HttpJsonCallSettings httpJsonCallSettings, + UnaryCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createUnaryCallable( + httpJsonCallSettings, callSettings, clientContext); + } + + @Override + public + UnaryCallable createPagedCallable( + HttpJsonCallSettings httpJsonCallSettings, + PagedCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createPagedCallable( + httpJsonCallSettings, callSettings, clientContext); + } + + @Override + public UnaryCallable createBatchingCallable( + HttpJsonCallSettings httpJsonCallSettings, + BatchingCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createBatchingCallable( + httpJsonCallSettings, callSettings, clientContext); + } + + @Override + public + OperationCallable createOperationCallable( + HttpJsonCallSettings httpJsonCallSettings, + OperationCallSettings callSettings, + ClientContext clientContext, + OperationsStub operationsStub) { + UnaryCallable innerCallable = + HttpJsonCallableFactory.createBaseUnaryCallable( + httpJsonCallSettings, callSettings.getInitialCallSettings(), clientContext); + HttpJsonOperationSnapshotCallable initialCallable = + new HttpJsonOperationSnapshotCallable( + innerCallable, + httpJsonCallSettings.getMethodDescriptor().getOperationSnapshotFactory()); + return HttpJsonCallableFactory.createOperationCallable( + callSettings, clientContext, operationsStub.longRunningClient(), initialCallable); + } + + @Override + public + ServerStreamingCallable createServerStreamingCallable( + HttpJsonCallSettings httpJsonCallSettings, + ServerStreamingCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createServerStreamingCallable( + httpJsonCallSettings, callSettings, clientContext); + } +} diff --git a/test/integration/goldens/library/src/com/google/cloud/example/library/v1/stub/HttpJsonLibraryServiceStub.java b/test/integration/goldens/library/src/com/google/cloud/example/library/v1/stub/HttpJsonLibraryServiceStub.java new file mode 100644 index 0000000000..ff6f398386 --- /dev/null +++ b/test/integration/goldens/library/src/com/google/cloud/example/library/v1/stub/HttpJsonLibraryServiceStub.java @@ -0,0 +1,786 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS 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.example.library.v1.stub; + +import static com.google.cloud.example.library.v1.LibraryServiceClient.ListBooksPagedResponse; +import static com.google.cloud.example.library.v1.LibraryServiceClient.ListShelvesPagedResponse; + +import com.google.api.core.InternalApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.httpjson.ApiMethodDescriptor; +import com.google.api.gax.httpjson.HttpJsonCallSettings; +import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; +import com.google.api.gax.httpjson.ProtoMessageRequestFormatter; +import com.google.api.gax.httpjson.ProtoMessageResponseParser; +import com.google.api.gax.httpjson.ProtoRestSerializer; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.RequestParamsBuilder; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.example.library.v1.Book; +import com.google.example.library.v1.CreateBookRequest; +import com.google.example.library.v1.CreateShelfRequest; +import com.google.example.library.v1.DeleteBookRequest; +import com.google.example.library.v1.DeleteShelfRequest; +import com.google.example.library.v1.GetBookRequest; +import com.google.example.library.v1.GetShelfRequest; +import com.google.example.library.v1.ListBooksRequest; +import com.google.example.library.v1.ListBooksResponse; +import com.google.example.library.v1.ListShelvesRequest; +import com.google.example.library.v1.ListShelvesResponse; +import com.google.example.library.v1.MergeShelvesRequest; +import com.google.example.library.v1.MoveBookRequest; +import com.google.example.library.v1.Shelf; +import com.google.example.library.v1.UpdateBookRequest; +import com.google.protobuf.Empty; +import com.google.protobuf.TypeRegistry; +import java.io.IOException; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * REST stub implementation for the LibraryService service API. + * + *

        This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by gapic-generator-java") +public class HttpJsonLibraryServiceStub extends LibraryServiceStub { + private static final TypeRegistry typeRegistry = TypeRegistry.newBuilder().build(); + + private static final ApiMethodDescriptor createShelfMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.example.library.v1.LibraryService/CreateShelf") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/shelves", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create().toBody("shelf", request.getShelf(), true)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Shelf.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor getShelfMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.example.library.v1.LibraryService/GetShelf") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{name=shelves/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Shelf.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + listShelvesMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.example.library.v1.LibraryService/ListShelves") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/shelves", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "pageSize", request.getPageSize()); + serializer.putQueryParam(fields, "pageToken", request.getPageToken()); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(ListShelvesResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor deleteShelfMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.example.library.v1.LibraryService/DeleteShelf") + .setHttpMethod("DELETE") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{name=shelves/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Empty.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + mergeShelvesMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.example.library.v1.LibraryService/MergeShelves") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{name=shelves/*}:merge", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("*", request.toBuilder().clearName().build(), true)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Shelf.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor createBookMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.example.library.v1.LibraryService/CreateBook") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{parent=shelves/*}/books", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "parent", request.getParent()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create().toBody("book", request.getBook(), true)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Book.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor getBookMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.example.library.v1.LibraryService/GetBook") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{name=shelves/*/books/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Book.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + listBooksMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.example.library.v1.LibraryService/ListBooks") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{parent=shelves/*}/books", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "parent", request.getParent()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "pageSize", request.getPageSize()); + serializer.putQueryParam(fields, "pageToken", request.getPageToken()); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(ListBooksResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor deleteBookMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.example.library.v1.LibraryService/DeleteBook") + .setHttpMethod("DELETE") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{name=shelves/*/books/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Empty.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor updateBookMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.example.library.v1.LibraryService/UpdateBook") + .setHttpMethod("PATCH") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{book.name=shelves/*/books/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "book.name", request.getBook().getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "updateMask", request.getUpdateMask()); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create().toBody("book", request.getBook(), true)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Book.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor moveBookMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.example.library.v1.LibraryService/MoveBook") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{name=shelves/*/books/*}:move", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("*", request.toBuilder().clearName().build(), true)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Book.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private final UnaryCallable createShelfCallable; + private final UnaryCallable getShelfCallable; + private final UnaryCallable listShelvesCallable; + private final UnaryCallable + listShelvesPagedCallable; + private final UnaryCallable deleteShelfCallable; + private final UnaryCallable mergeShelvesCallable; + private final UnaryCallable createBookCallable; + private final UnaryCallable getBookCallable; + private final UnaryCallable listBooksCallable; + private final UnaryCallable listBooksPagedCallable; + private final UnaryCallable deleteBookCallable; + private final UnaryCallable updateBookCallable; + private final UnaryCallable moveBookCallable; + + private final BackgroundResource backgroundResources; + private final HttpJsonStubCallableFactory callableFactory; + + public static final HttpJsonLibraryServiceStub create(LibraryServiceStubSettings settings) + throws IOException { + return new HttpJsonLibraryServiceStub(settings, ClientContext.create(settings)); + } + + public static final HttpJsonLibraryServiceStub create(ClientContext clientContext) + throws IOException { + return new HttpJsonLibraryServiceStub( + LibraryServiceStubSettings.newHttpJsonBuilder().build(), clientContext); + } + + public static final HttpJsonLibraryServiceStub create( + ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { + return new HttpJsonLibraryServiceStub( + LibraryServiceStubSettings.newHttpJsonBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of HttpJsonLibraryServiceStub, 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 HttpJsonLibraryServiceStub( + LibraryServiceStubSettings settings, ClientContext clientContext) throws IOException { + this(settings, clientContext, new HttpJsonLibraryServiceCallableFactory()); + } + + /** + * Constructs an instance of HttpJsonLibraryServiceStub, 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 HttpJsonLibraryServiceStub( + LibraryServiceStubSettings settings, + ClientContext clientContext, + HttpJsonStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + + HttpJsonCallSettings createShelfTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(createShelfMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings getShelfTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getShelfMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .setResourceNameExtractor(request -> request.getName()) + .build(); + HttpJsonCallSettings listShelvesTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(listShelvesMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings deleteShelfTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(deleteShelfMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .setResourceNameExtractor(request -> request.getName()) + .build(); + HttpJsonCallSettings mergeShelvesTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(mergeShelvesMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .setResourceNameExtractor(request -> request.getName()) + .build(); + HttpJsonCallSettings createBookTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(createBookMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .setResourceNameExtractor(request -> request.getParent()) + .build(); + HttpJsonCallSettings getBookTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getBookMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .setResourceNameExtractor(request -> request.getName()) + .build(); + HttpJsonCallSettings listBooksTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(listBooksMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .setResourceNameExtractor(request -> request.getParent()) + .build(); + HttpJsonCallSettings deleteBookTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(deleteBookMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .setResourceNameExtractor(request -> request.getName()) + .build(); + HttpJsonCallSettings updateBookTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(updateBookMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("book.name", String.valueOf(request.getBook().getName())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings moveBookTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(moveBookMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .setResourceNameExtractor(request -> request.getName()) + .build(); + + this.createShelfCallable = + callableFactory.createUnaryCallable( + createShelfTransportSettings, settings.createShelfSettings(), clientContext); + this.getShelfCallable = + callableFactory.createUnaryCallable( + getShelfTransportSettings, settings.getShelfSettings(), clientContext); + this.listShelvesCallable = + callableFactory.createUnaryCallable( + listShelvesTransportSettings, settings.listShelvesSettings(), clientContext); + this.listShelvesPagedCallable = + callableFactory.createPagedCallable( + listShelvesTransportSettings, settings.listShelvesSettings(), clientContext); + this.deleteShelfCallable = + callableFactory.createUnaryCallable( + deleteShelfTransportSettings, settings.deleteShelfSettings(), clientContext); + this.mergeShelvesCallable = + callableFactory.createUnaryCallable( + mergeShelvesTransportSettings, settings.mergeShelvesSettings(), clientContext); + this.createBookCallable = + callableFactory.createUnaryCallable( + createBookTransportSettings, settings.createBookSettings(), clientContext); + this.getBookCallable = + callableFactory.createUnaryCallable( + getBookTransportSettings, settings.getBookSettings(), clientContext); + this.listBooksCallable = + callableFactory.createUnaryCallable( + listBooksTransportSettings, settings.listBooksSettings(), clientContext); + this.listBooksPagedCallable = + callableFactory.createPagedCallable( + listBooksTransportSettings, settings.listBooksSettings(), clientContext); + this.deleteBookCallable = + callableFactory.createUnaryCallable( + deleteBookTransportSettings, settings.deleteBookSettings(), clientContext); + this.updateBookCallable = + callableFactory.createUnaryCallable( + updateBookTransportSettings, settings.updateBookSettings(), clientContext); + this.moveBookCallable = + callableFactory.createUnaryCallable( + moveBookTransportSettings, settings.moveBookSettings(), clientContext); + + this.backgroundResources = + new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + @InternalApi + public static List getMethodDescriptors() { + List methodDescriptors = new ArrayList<>(); + methodDescriptors.add(createShelfMethodDescriptor); + methodDescriptors.add(getShelfMethodDescriptor); + methodDescriptors.add(listShelvesMethodDescriptor); + methodDescriptors.add(deleteShelfMethodDescriptor); + methodDescriptors.add(mergeShelvesMethodDescriptor); + methodDescriptors.add(createBookMethodDescriptor); + methodDescriptors.add(getBookMethodDescriptor); + methodDescriptors.add(listBooksMethodDescriptor); + methodDescriptors.add(deleteBookMethodDescriptor); + methodDescriptors.add(updateBookMethodDescriptor); + methodDescriptors.add(moveBookMethodDescriptor); + return methodDescriptors; + } + + @Override + public UnaryCallable createShelfCallable() { + return createShelfCallable; + } + + @Override + public UnaryCallable getShelfCallable() { + return getShelfCallable; + } + + @Override + public UnaryCallable listShelvesCallable() { + return listShelvesCallable; + } + + @Override + public UnaryCallable listShelvesPagedCallable() { + return listShelvesPagedCallable; + } + + @Override + public UnaryCallable deleteShelfCallable() { + return deleteShelfCallable; + } + + @Override + public UnaryCallable mergeShelvesCallable() { + return mergeShelvesCallable; + } + + @Override + public UnaryCallable createBookCallable() { + return createBookCallable; + } + + @Override + public UnaryCallable getBookCallable() { + return getBookCallable; + } + + @Override + public UnaryCallable listBooksCallable() { + return listBooksCallable; + } + + @Override + public UnaryCallable listBooksPagedCallable() { + return listBooksPagedCallable; + } + + @Override + public UnaryCallable deleteBookCallable() { + return deleteBookCallable; + } + + @Override + public UnaryCallable updateBookCallable() { + return updateBookCallable; + } + + @Override + public UnaryCallable moveBookCallable() { + return moveBookCallable; + } + + @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/test/integration/goldens/library/src/com/google/cloud/example/library/v1/stub/LibraryServiceStub.java b/test/integration/goldens/library/src/com/google/cloud/example/library/v1/stub/LibraryServiceStub.java index 6976c36bfb..e1a94b7f25 100644 --- a/test/integration/goldens/library/src/com/google/cloud/example/library/v1/stub/LibraryServiceStub.java +++ b/test/integration/goldens/library/src/com/google/cloud/example/library/v1/stub/LibraryServiceStub.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/library/src/com/google/cloud/example/library/v1/stub/LibraryServiceStubSettings.java b/test/integration/goldens/library/src/com/google/cloud/example/library/v1/stub/LibraryServiceStubSettings.java index d222a4dc4e..23c398f5ad 100644 --- a/test/integration/goldens/library/src/com/google/cloud/example/library/v1/stub/LibraryServiceStubSettings.java +++ b/test/integration/goldens/library/src/com/google/cloud/example/library/v1/stub/LibraryServiceStubSettings.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -22,16 +22,21 @@ import com.google.api.core.ApiFunction; import com.google.api.core.ApiFuture; import com.google.api.core.BetaApi; +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.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.HttpJsonTransportChannel; +import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; 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.LibraryMetadata; import com.google.api.gax.rpc.PageContext; import com.google.api.gax.rpc.PagedCallSettings; import com.google.api.gax.rpc.PagedListDescriptor; @@ -62,9 +67,9 @@ import com.google.example.library.v1.UpdateBookRequest; import com.google.protobuf.Empty; import java.io.IOException; +import java.time.Duration; import java.util.List; import javax.annotation.Generated; -import org.threeten.bp.Duration; // AUTO-GENERATED DOCUMENTATION AND CLASS. /** @@ -82,7 +87,9 @@ *

        The builder of this class is recursive, so contained classes are themselves builders. When * build() is called, the tree of builders is called to create the complete settings object. * - *

        For example, to set the total timeout of createShelf to 30 seconds: + *

        For example, to set the + * [RetrySettings](https://cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.retrying.RetrySettings) + * of createShelf: * *

        {@code
          * // This snippet has been automatically generated and should be regarded as a code template only.
        @@ -99,12 +106,24 @@
          *             .createShelfSettings()
          *             .getRetrySettings()
          *             .toBuilder()
        - *             .setTotalTimeout(Duration.ofSeconds(30))
        + *             .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());
          * LibraryServiceStubSettings libraryServiceSettings = libraryServiceSettingsBuilder.build();
          * }
        + * + * Please refer to the [Client Side Retry + * Guide](https://docs.cloud.google.com/java/docs/client-retries) for additional support in setting + * retries. */ @Generated("by gapic-generator-java") +@SuppressWarnings("CanonicalDuration") public class LibraryServiceStubSettings extends StubSettings { /** The default scopes of the service. */ private static final ImmutableList DEFAULT_SERVICE_SCOPES = @@ -154,9 +173,7 @@ public String extractNextToken(ListShelvesResponse payload) { @Override public Iterable extractResources(ListShelvesResponse payload) { - return payload.getShelvesList() == null - ? ImmutableList.of() - : payload.getShelvesList(); + return payload.getShelvesList(); } }; @@ -190,9 +207,7 @@ public String extractNextToken(ListBooksResponse payload) { @Override public Iterable extractResources(ListBooksResponse payload) { - return payload.getBooksList() == null - ? ImmutableList.of() - : payload.getBooksList(); + return payload.getBooksList(); } }; @@ -293,17 +308,29 @@ public LibraryServiceStub createStub() throws IOException { .equals(GrpcTransportChannel.getGrpcTransportName())) { return GrpcLibraryServiceStub.create(this); } + if (getTransportChannelProvider() + .getTransportName() + .equals(HttpJsonTransportChannel.getHttpJsonTransportName())) { + return HttpJsonLibraryServiceStub.create(this); + } throw new UnsupportedOperationException( String.format( "Transport not supported: %s", getTransportChannelProvider().getTransportName())); } + /** Returns the default service name. */ + @Override + public String getServiceName() { + return "library-example"; + } + /** 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 "library-example.googleapis.com:443"; } @@ -325,18 +352,24 @@ public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilde .setUseJwtAccessWithScope(true); } - /** Returns a builder for the default ChannelProvider for this service. */ + /** Returns a builder for the default gRPC ChannelProvider for this service. */ public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { return InstantiatingGrpcChannelProvider.newBuilder() .setMaxInboundMessageSize(Integer.MAX_VALUE); } + /** Returns a builder for the default REST ChannelProvider for this service. */ + @BetaApi + public static InstantiatingHttpJsonChannelProvider.Builder + defaultHttpJsonTransportProviderBuilder() { + return InstantiatingHttpJsonChannelProvider.newBuilder(); + } + public static TransportChannelProvider defaultTransportChannelProvider() { return defaultGrpcTransportProviderBuilder().build(); } - @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") - public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + public static ApiClientHeaderProvider.Builder defaultGrpcApiClientHeaderProviderBuilder() { return ApiClientHeaderProvider.newBuilder() .setGeneratedLibToken( "gapic", GaxProperties.getLibraryVersion(LibraryServiceStubSettings.class)) @@ -344,11 +377,29 @@ public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuil GaxGrpcProperties.getGrpcTokenName(), GaxGrpcProperties.getGrpcVersion()); } - /** Returns a new builder for this class. */ + public static ApiClientHeaderProvider.Builder defaultHttpJsonApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken( + "gapic", GaxProperties.getLibraryVersion(LibraryServiceStubSettings.class)) + .setTransportToken( + GaxHttpJsonProperties.getHttpJsonTokenName(), + GaxHttpJsonProperties.getHttpJsonVersion()); + } + + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return LibraryServiceStubSettings.defaultGrpcApiClientHeaderProviderBuilder(); + } + + /** Returns a new gRPC builder for this class. */ public static Builder newBuilder() { return Builder.createDefault(); } + /** Returns a new REST builder for this class. */ + public static Builder newHttpJsonBuilder() { + return Builder.createHttpJsonDefault(); + } + /** Returns a new builder for this class. */ public static Builder newBuilder(ClientContext clientContext) { return new Builder(clientContext); @@ -375,6 +426,11 @@ protected LibraryServiceStubSettings(Builder settingsBuilder) throws IOException moveBookSettings = settingsBuilder.moveBookSettings().build(); } + @Override + protected LibraryMetadata getLibraryMetadata() { + return LibraryMetadata.newBuilder().setVersion(Version.VERSION).build(); + } + /** Builder for LibraryServiceStubSettings. */ public static class Builder extends StubSettings.Builder { private final ImmutableList> unaryMethodSettingsBuilders; @@ -416,24 +472,24 @@ public static class Builder extends StubSettings.Builder future = configClient.copyLogEntriesCallable().futureCall(request); + // Do something. + Operation response = future.get(); + } + } +} +// [END logging_v2_generated_ConfigServiceV2_CopyLogEntries_async] diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/copylogentries/AsyncCopyLogEntriesLRO.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/copylogentries/AsyncCopyLogEntriesLRO.java new file mode 100644 index 0000000000..6d21fefafa --- /dev/null +++ b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/copylogentries/AsyncCopyLogEntriesLRO.java @@ -0,0 +1,52 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS 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/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/copylogentries/SyncCopyLogEntries.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/copylogentries/SyncCopyLogEntries.java new file mode 100644 index 0000000000..3a19c58a21 --- /dev/null +++ b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/copylogentries/SyncCopyLogEntries.java @@ -0,0 +1,47 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS 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/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/create/SyncCreateSetCredentialsProvider.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/create/SyncCreateSetCredentialsProvider.java index 0ede8778f3..dc276e19b8 100644 --- a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/create/SyncCreateSetCredentialsProvider.java +++ b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/create/SyncCreateSetCredentialsProvider.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/create/SyncCreateSetEndpoint.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/create/SyncCreateSetEndpoint.java index 37429d4a67..4dd85dfb11 100644 --- a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/create/SyncCreateSetEndpoint.java +++ b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/create/SyncCreateSetEndpoint.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/createbucket/AsyncCreateBucket.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/createbucket/AsyncCreateBucket.java index 9f9c69a77d..7a1453b456 100644 --- a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/createbucket/AsyncCreateBucket.java +++ b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/createbucket/AsyncCreateBucket.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/createbucket/SyncCreateBucket.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/createbucket/SyncCreateBucket.java index 5cc7bc15b2..ad05046d5c 100644 --- a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/createbucket/SyncCreateBucket.java +++ b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/createbucket/SyncCreateBucket.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/createexclusion/AsyncCreateExclusion.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/createexclusion/AsyncCreateExclusion.java index b196b21eaf..d975d1719c 100644 --- a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/createexclusion/AsyncCreateExclusion.java +++ b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/createexclusion/AsyncCreateExclusion.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/createexclusion/SyncCreateExclusion.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/createexclusion/SyncCreateExclusion.java index f2a6dce03c..c096580368 100644 --- a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/createexclusion/SyncCreateExclusion.java +++ b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/createexclusion/SyncCreateExclusion.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/createexclusion/SyncCreateExclusionBillingaccountnameLogexclusion.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/createexclusion/SyncCreateExclusionBillingaccountnameLogexclusion.java index 145ed771c3..213a6f1e22 100644 --- a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/createexclusion/SyncCreateExclusionBillingaccountnameLogexclusion.java +++ b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/createexclusion/SyncCreateExclusionBillingaccountnameLogexclusion.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/createexclusion/SyncCreateExclusionFoldernameLogexclusion.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/createexclusion/SyncCreateExclusionFoldernameLogexclusion.java index 3d2be77d9d..983e270790 100644 --- a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/createexclusion/SyncCreateExclusionFoldernameLogexclusion.java +++ b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/createexclusion/SyncCreateExclusionFoldernameLogexclusion.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/createexclusion/SyncCreateExclusionOrganizationnameLogexclusion.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/createexclusion/SyncCreateExclusionOrganizationnameLogexclusion.java index e4198831ce..cd874952f2 100644 --- a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/createexclusion/SyncCreateExclusionOrganizationnameLogexclusion.java +++ b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/createexclusion/SyncCreateExclusionOrganizationnameLogexclusion.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/createexclusion/SyncCreateExclusionProjectnameLogexclusion.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/createexclusion/SyncCreateExclusionProjectnameLogexclusion.java index ef4e209480..cb22b5be40 100644 --- a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/createexclusion/SyncCreateExclusionProjectnameLogexclusion.java +++ b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/createexclusion/SyncCreateExclusionProjectnameLogexclusion.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/createexclusion/SyncCreateExclusionStringLogexclusion.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/createexclusion/SyncCreateExclusionStringLogexclusion.java index 301ea7dcb3..9355e3c734 100644 --- a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/createexclusion/SyncCreateExclusionStringLogexclusion.java +++ b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/createexclusion/SyncCreateExclusionStringLogexclusion.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/createsink/AsyncCreateSink.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/createsink/AsyncCreateSink.java index 88e10b4b70..0333746ebd 100644 --- a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/createsink/AsyncCreateSink.java +++ b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/createsink/AsyncCreateSink.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/createsink/SyncCreateSink.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/createsink/SyncCreateSink.java index 35e03311e3..a6c1b419ba 100644 --- a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/createsink/SyncCreateSink.java +++ b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/createsink/SyncCreateSink.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/createsink/SyncCreateSinkBillingaccountnameLogsink.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/createsink/SyncCreateSinkBillingaccountnameLogsink.java index 76950150a9..5cd3e12deb 100644 --- a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/createsink/SyncCreateSinkBillingaccountnameLogsink.java +++ b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/createsink/SyncCreateSinkBillingaccountnameLogsink.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/createsink/SyncCreateSinkFoldernameLogsink.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/createsink/SyncCreateSinkFoldernameLogsink.java index 935f2132c8..1695b8e69e 100644 --- a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/createsink/SyncCreateSinkFoldernameLogsink.java +++ b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/createsink/SyncCreateSinkFoldernameLogsink.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/createsink/SyncCreateSinkOrganizationnameLogsink.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/createsink/SyncCreateSinkOrganizationnameLogsink.java index 428ae218be..105a566506 100644 --- a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/createsink/SyncCreateSinkOrganizationnameLogsink.java +++ b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/createsink/SyncCreateSinkOrganizationnameLogsink.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/createsink/SyncCreateSinkProjectnameLogsink.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/createsink/SyncCreateSinkProjectnameLogsink.java index f8bec0d167..fdb9948ded 100644 --- a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/createsink/SyncCreateSinkProjectnameLogsink.java +++ b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/createsink/SyncCreateSinkProjectnameLogsink.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/createsink/SyncCreateSinkStringLogsink.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/createsink/SyncCreateSinkStringLogsink.java index 1a840db162..6724d79f02 100644 --- a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/createsink/SyncCreateSinkStringLogsink.java +++ b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/createsink/SyncCreateSinkStringLogsink.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/createview/AsyncCreateView.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/createview/AsyncCreateView.java index b762e49489..c47fc44ff3 100644 --- a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/createview/AsyncCreateView.java +++ b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/createview/AsyncCreateView.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/createview/SyncCreateView.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/createview/SyncCreateView.java index 5f5ef37cb6..909f48e6a0 100644 --- a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/createview/SyncCreateView.java +++ b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/createview/SyncCreateView.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/deletebucket/AsyncDeleteBucket.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/deletebucket/AsyncDeleteBucket.java index 5c587bdefd..b911f6a395 100644 --- a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/deletebucket/AsyncDeleteBucket.java +++ b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/deletebucket/AsyncDeleteBucket.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/deletebucket/SyncDeleteBucket.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/deletebucket/SyncDeleteBucket.java index d3aa6996c2..b105cb40a6 100644 --- a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/deletebucket/SyncDeleteBucket.java +++ b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/deletebucket/SyncDeleteBucket.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/deleteexclusion/AsyncDeleteExclusion.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/deleteexclusion/AsyncDeleteExclusion.java index 506e711260..8959074196 100644 --- a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/deleteexclusion/AsyncDeleteExclusion.java +++ b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/deleteexclusion/AsyncDeleteExclusion.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/deleteexclusion/SyncDeleteExclusion.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/deleteexclusion/SyncDeleteExclusion.java index eea1f9c310..ae46d6237c 100644 --- a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/deleteexclusion/SyncDeleteExclusion.java +++ b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/deleteexclusion/SyncDeleteExclusion.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/deleteexclusion/SyncDeleteExclusionLogexclusionname.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/deleteexclusion/SyncDeleteExclusionLogexclusionname.java index cb6123be51..b5bd4121ac 100644 --- a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/deleteexclusion/SyncDeleteExclusionLogexclusionname.java +++ b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/deleteexclusion/SyncDeleteExclusionLogexclusionname.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/deleteexclusion/SyncDeleteExclusionString.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/deleteexclusion/SyncDeleteExclusionString.java index 701c940ef7..254fbf7a5a 100644 --- a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/deleteexclusion/SyncDeleteExclusionString.java +++ b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/deleteexclusion/SyncDeleteExclusionString.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/deletesink/AsyncDeleteSink.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/deletesink/AsyncDeleteSink.java index 56a4d9dc1a..a60ef1a8fd 100644 --- a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/deletesink/AsyncDeleteSink.java +++ b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/deletesink/AsyncDeleteSink.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/deletesink/SyncDeleteSink.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/deletesink/SyncDeleteSink.java index 19759e39ca..979b398b1b 100644 --- a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/deletesink/SyncDeleteSink.java +++ b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/deletesink/SyncDeleteSink.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/deletesink/SyncDeleteSinkLogsinkname.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/deletesink/SyncDeleteSinkLogsinkname.java index eb9d8c45af..fdeb1cb94d 100644 --- a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/deletesink/SyncDeleteSinkLogsinkname.java +++ b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/deletesink/SyncDeleteSinkLogsinkname.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/deletesink/SyncDeleteSinkString.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/deletesink/SyncDeleteSinkString.java index 19ccef5c23..a9cfbe5885 100644 --- a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/deletesink/SyncDeleteSinkString.java +++ b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/deletesink/SyncDeleteSinkString.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/deleteview/AsyncDeleteView.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/deleteview/AsyncDeleteView.java index 8b92bebeb7..e990d6eb86 100644 --- a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/deleteview/AsyncDeleteView.java +++ b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/deleteview/AsyncDeleteView.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/deleteview/SyncDeleteView.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/deleteview/SyncDeleteView.java index fe09d90db1..fcbd336c67 100644 --- a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/deleteview/SyncDeleteView.java +++ b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/deleteview/SyncDeleteView.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/getbucket/AsyncGetBucket.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/getbucket/AsyncGetBucket.java index 4e0599b144..0d24b83ee5 100644 --- a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/getbucket/AsyncGetBucket.java +++ b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/getbucket/AsyncGetBucket.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/getbucket/SyncGetBucket.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/getbucket/SyncGetBucket.java index 996d6d8d0a..0b1f91edb9 100644 --- a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/getbucket/SyncGetBucket.java +++ b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/getbucket/SyncGetBucket.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/getcmeksettings/AsyncGetCmekSettings.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/getcmeksettings/AsyncGetCmekSettings.java index ad161fa1cd..e0cb2ba5ae 100644 --- a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/getcmeksettings/AsyncGetCmekSettings.java +++ b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/getcmeksettings/AsyncGetCmekSettings.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/getcmeksettings/SyncGetCmekSettings.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/getcmeksettings/SyncGetCmekSettings.java index d1cc6edb97..080fcc5f07 100644 --- a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/getcmeksettings/SyncGetCmekSettings.java +++ b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/getcmeksettings/SyncGetCmekSettings.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/getexclusion/AsyncGetExclusion.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/getexclusion/AsyncGetExclusion.java index cd68cdbd23..e3b30192ed 100644 --- a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/getexclusion/AsyncGetExclusion.java +++ b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/getexclusion/AsyncGetExclusion.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/getexclusion/SyncGetExclusion.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/getexclusion/SyncGetExclusion.java index 02526a974e..c8de617113 100644 --- a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/getexclusion/SyncGetExclusion.java +++ b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/getexclusion/SyncGetExclusion.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/getexclusion/SyncGetExclusionLogexclusionname.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/getexclusion/SyncGetExclusionLogexclusionname.java index 7007f21027..ec11a10b38 100644 --- a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/getexclusion/SyncGetExclusionLogexclusionname.java +++ b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/getexclusion/SyncGetExclusionLogexclusionname.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/getexclusion/SyncGetExclusionString.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/getexclusion/SyncGetExclusionString.java index 9644892476..14cbd575c9 100644 --- a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/getexclusion/SyncGetExclusionString.java +++ b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/getexclusion/SyncGetExclusionString.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/getsettings/AsyncGetSettings.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/getsettings/AsyncGetSettings.java new file mode 100644 index 0000000000..e7542853b9 --- /dev/null +++ b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/getsettings/AsyncGetSettings.java @@ -0,0 +1,49 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS 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/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/getsettings/SyncGetSettings.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/getsettings/SyncGetSettings.java new file mode 100644 index 0000000000..af727e814b --- /dev/null +++ b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/getsettings/SyncGetSettings.java @@ -0,0 +1,46 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS 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/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/getsettings/SyncGetSettingsSettingsname.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/getsettings/SyncGetSettingsSettingsname.java new file mode 100644 index 0000000000..c129f3d8ad --- /dev/null +++ b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/getsettings/SyncGetSettingsSettingsname.java @@ -0,0 +1,42 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS 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/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/getsettings/SyncGetSettingsString.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/getsettings/SyncGetSettingsString.java new file mode 100644 index 0000000000..e4ab97bd9f --- /dev/null +++ b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/getsettings/SyncGetSettingsString.java @@ -0,0 +1,42 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS 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/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/getsink/AsyncGetSink.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/getsink/AsyncGetSink.java index 5741024009..3a901d28e3 100644 --- a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/getsink/AsyncGetSink.java +++ b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/getsink/AsyncGetSink.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/getsink/SyncGetSink.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/getsink/SyncGetSink.java index 5a204ee514..4ea7c96e90 100644 --- a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/getsink/SyncGetSink.java +++ b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/getsink/SyncGetSink.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/getsink/SyncGetSinkLogsinkname.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/getsink/SyncGetSinkLogsinkname.java index 69624dd227..daed042274 100644 --- a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/getsink/SyncGetSinkLogsinkname.java +++ b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/getsink/SyncGetSinkLogsinkname.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/getsink/SyncGetSinkString.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/getsink/SyncGetSinkString.java index d60d3e89fa..1a65ffcfcd 100644 --- a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/getsink/SyncGetSinkString.java +++ b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/getsink/SyncGetSinkString.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/getview/AsyncGetView.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/getview/AsyncGetView.java index fca576b053..99d1da6760 100644 --- a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/getview/AsyncGetView.java +++ b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/getview/AsyncGetView.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/getview/SyncGetView.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/getview/SyncGetView.java index 6162982ac0..7c9b42b9ec 100644 --- a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/getview/SyncGetView.java +++ b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/getview/SyncGetView.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/listbuckets/AsyncListBuckets.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/listbuckets/AsyncListBuckets.java index 4a415a51e4..e7a7a084bd 100644 --- a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/listbuckets/AsyncListBuckets.java +++ b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/listbuckets/AsyncListBuckets.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/listbuckets/AsyncListBucketsPaged.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/listbuckets/AsyncListBucketsPaged.java index abd004d18a..40e752d9cf 100644 --- a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/listbuckets/AsyncListBucketsPaged.java +++ b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/listbuckets/AsyncListBucketsPaged.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/listbuckets/SyncListBuckets.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/listbuckets/SyncListBuckets.java index cced74307b..44e0819b8c 100644 --- a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/listbuckets/SyncListBuckets.java +++ b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/listbuckets/SyncListBuckets.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/listbuckets/SyncListBucketsBillingaccountlocationname.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/listbuckets/SyncListBucketsBillingaccountlocationname.java index 210f92506a..126118a4d3 100644 --- a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/listbuckets/SyncListBucketsBillingaccountlocationname.java +++ b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/listbuckets/SyncListBucketsBillingaccountlocationname.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/listbuckets/SyncListBucketsFolderlocationname.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/listbuckets/SyncListBucketsFolderlocationname.java index 9b964e318c..cd903aba72 100644 --- a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/listbuckets/SyncListBucketsFolderlocationname.java +++ b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/listbuckets/SyncListBucketsFolderlocationname.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/listbuckets/SyncListBucketsLocationname.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/listbuckets/SyncListBucketsLocationname.java index 6eb3c8dccb..2b8e3d27d6 100644 --- a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/listbuckets/SyncListBucketsLocationname.java +++ b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/listbuckets/SyncListBucketsLocationname.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/listbuckets/SyncListBucketsOrganizationlocationname.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/listbuckets/SyncListBucketsOrganizationlocationname.java index a8c3d488b5..614125e8ca 100644 --- a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/listbuckets/SyncListBucketsOrganizationlocationname.java +++ b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/listbuckets/SyncListBucketsOrganizationlocationname.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/listbuckets/SyncListBucketsString.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/listbuckets/SyncListBucketsString.java index e12f7e109d..c56e730d7e 100644 --- a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/listbuckets/SyncListBucketsString.java +++ b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/listbuckets/SyncListBucketsString.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/listexclusions/AsyncListExclusions.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/listexclusions/AsyncListExclusions.java index 9962b6b147..036d7e189a 100644 --- a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/listexclusions/AsyncListExclusions.java +++ b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/listexclusions/AsyncListExclusions.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/listexclusions/AsyncListExclusionsPaged.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/listexclusions/AsyncListExclusionsPaged.java index 34a44b8418..8a1eb053a8 100644 --- a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/listexclusions/AsyncListExclusionsPaged.java +++ b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/listexclusions/AsyncListExclusionsPaged.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/listexclusions/SyncListExclusions.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/listexclusions/SyncListExclusions.java index 57efa08b83..f101faaa42 100644 --- a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/listexclusions/SyncListExclusions.java +++ b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/listexclusions/SyncListExclusions.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/listexclusions/SyncListExclusionsBillingaccountname.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/listexclusions/SyncListExclusionsBillingaccountname.java index 053d366a89..1533f3ee70 100644 --- a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/listexclusions/SyncListExclusionsBillingaccountname.java +++ b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/listexclusions/SyncListExclusionsBillingaccountname.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/listexclusions/SyncListExclusionsFoldername.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/listexclusions/SyncListExclusionsFoldername.java index e9a73d3f4f..dab46c93f9 100644 --- a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/listexclusions/SyncListExclusionsFoldername.java +++ b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/listexclusions/SyncListExclusionsFoldername.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/listexclusions/SyncListExclusionsOrganizationname.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/listexclusions/SyncListExclusionsOrganizationname.java index db670ab3e1..98a6808899 100644 --- a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/listexclusions/SyncListExclusionsOrganizationname.java +++ b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/listexclusions/SyncListExclusionsOrganizationname.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/listexclusions/SyncListExclusionsProjectname.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/listexclusions/SyncListExclusionsProjectname.java index 27142979e0..746e887430 100644 --- a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/listexclusions/SyncListExclusionsProjectname.java +++ b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/listexclusions/SyncListExclusionsProjectname.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/listexclusions/SyncListExclusionsString.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/listexclusions/SyncListExclusionsString.java index 6f2889389b..cd9830c5ac 100644 --- a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/listexclusions/SyncListExclusionsString.java +++ b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/listexclusions/SyncListExclusionsString.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/listsinks/AsyncListSinks.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/listsinks/AsyncListSinks.java index bab6ac1100..f2a56f2eb3 100644 --- a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/listsinks/AsyncListSinks.java +++ b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/listsinks/AsyncListSinks.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/listsinks/AsyncListSinksPaged.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/listsinks/AsyncListSinksPaged.java index 8221ed0e47..c241657bce 100644 --- a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/listsinks/AsyncListSinksPaged.java +++ b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/listsinks/AsyncListSinksPaged.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/listsinks/SyncListSinks.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/listsinks/SyncListSinks.java index 665b6f1e39..d7ae411c86 100644 --- a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/listsinks/SyncListSinks.java +++ b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/listsinks/SyncListSinks.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/listsinks/SyncListSinksBillingaccountname.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/listsinks/SyncListSinksBillingaccountname.java index 41c8f681ef..5c2b104bf9 100644 --- a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/listsinks/SyncListSinksBillingaccountname.java +++ b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/listsinks/SyncListSinksBillingaccountname.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/listsinks/SyncListSinksFoldername.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/listsinks/SyncListSinksFoldername.java index 2b7d35ab97..25066d6ec8 100644 --- a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/listsinks/SyncListSinksFoldername.java +++ b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/listsinks/SyncListSinksFoldername.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/listsinks/SyncListSinksOrganizationname.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/listsinks/SyncListSinksOrganizationname.java index 264990af48..36efeeec66 100644 --- a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/listsinks/SyncListSinksOrganizationname.java +++ b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/listsinks/SyncListSinksOrganizationname.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/listsinks/SyncListSinksProjectname.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/listsinks/SyncListSinksProjectname.java index e44b6205ca..556c536d58 100644 --- a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/listsinks/SyncListSinksProjectname.java +++ b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/listsinks/SyncListSinksProjectname.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/listsinks/SyncListSinksString.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/listsinks/SyncListSinksString.java index 52585a2f61..6471e711d0 100644 --- a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/listsinks/SyncListSinksString.java +++ b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/listsinks/SyncListSinksString.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/listviews/AsyncListViews.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/listviews/AsyncListViews.java index 2f50413e92..515724331e 100644 --- a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/listviews/AsyncListViews.java +++ b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/listviews/AsyncListViews.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/listviews/AsyncListViewsPaged.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/listviews/AsyncListViewsPaged.java index c11f0129e6..5fcb93775f 100644 --- a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/listviews/AsyncListViewsPaged.java +++ b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/listviews/AsyncListViewsPaged.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/listviews/SyncListViews.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/listviews/SyncListViews.java index b47aa44bce..698b16ac4c 100644 --- a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/listviews/SyncListViews.java +++ b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/listviews/SyncListViews.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/listviews/SyncListViewsString.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/listviews/SyncListViewsString.java index e4375e0440..b21cffa293 100644 --- a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/listviews/SyncListViewsString.java +++ b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/listviews/SyncListViewsString.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/undeletebucket/AsyncUndeleteBucket.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/undeletebucket/AsyncUndeleteBucket.java index bbc765fad4..bcfd7e6fd4 100644 --- a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/undeletebucket/AsyncUndeleteBucket.java +++ b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/undeletebucket/AsyncUndeleteBucket.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/undeletebucket/SyncUndeleteBucket.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/undeletebucket/SyncUndeleteBucket.java index a701841e37..90da3d502e 100644 --- a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/undeletebucket/SyncUndeleteBucket.java +++ b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/undeletebucket/SyncUndeleteBucket.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/updatebucket/AsyncUpdateBucket.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/updatebucket/AsyncUpdateBucket.java index 3b41eca05a..3f14758f76 100644 --- a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/updatebucket/AsyncUpdateBucket.java +++ b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/updatebucket/AsyncUpdateBucket.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/updatebucket/SyncUpdateBucket.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/updatebucket/SyncUpdateBucket.java index a869306187..1767b7a7a1 100644 --- a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/updatebucket/SyncUpdateBucket.java +++ b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/updatebucket/SyncUpdateBucket.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/updatecmeksettings/AsyncUpdateCmekSettings.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/updatecmeksettings/AsyncUpdateCmekSettings.java index fd173d5072..19953cc840 100644 --- a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/updatecmeksettings/AsyncUpdateCmekSettings.java +++ b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/updatecmeksettings/AsyncUpdateCmekSettings.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/updatecmeksettings/SyncUpdateCmekSettings.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/updatecmeksettings/SyncUpdateCmekSettings.java index f0c7feb985..760bbd9b35 100644 --- a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/updatecmeksettings/SyncUpdateCmekSettings.java +++ b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/updatecmeksettings/SyncUpdateCmekSettings.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/updateexclusion/AsyncUpdateExclusion.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/updateexclusion/AsyncUpdateExclusion.java index 7b24e77c6f..31491ae4d7 100644 --- a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/updateexclusion/AsyncUpdateExclusion.java +++ b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/updateexclusion/AsyncUpdateExclusion.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/updateexclusion/SyncUpdateExclusion.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/updateexclusion/SyncUpdateExclusion.java index 5599414833..5976564b56 100644 --- a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/updateexclusion/SyncUpdateExclusion.java +++ b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/updateexclusion/SyncUpdateExclusion.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/updateexclusion/SyncUpdateExclusionLogexclusionnameLogexclusionFieldmask.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/updateexclusion/SyncUpdateExclusionLogexclusionnameLogexclusionFieldmask.java index bc402ea94c..b9f4b71a3a 100644 --- a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/updateexclusion/SyncUpdateExclusionLogexclusionnameLogexclusionFieldmask.java +++ b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/updateexclusion/SyncUpdateExclusionLogexclusionnameLogexclusionFieldmask.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/updateexclusion/SyncUpdateExclusionStringLogexclusionFieldmask.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/updateexclusion/SyncUpdateExclusionStringLogexclusionFieldmask.java index 8e20f45a0b..b797c6bcc8 100644 --- a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/updateexclusion/SyncUpdateExclusionStringLogexclusionFieldmask.java +++ b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/updateexclusion/SyncUpdateExclusionStringLogexclusionFieldmask.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/updatesettings/AsyncUpdateSettings.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/updatesettings/AsyncUpdateSettings.java new file mode 100644 index 0000000000..5237c72104 --- /dev/null +++ b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/updatesettings/AsyncUpdateSettings.java @@ -0,0 +1,51 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS 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/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/updatesettings/SyncUpdateSettings.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/updatesettings/SyncUpdateSettings.java new file mode 100644 index 0000000000..f36c94ff83 --- /dev/null +++ b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/updatesettings/SyncUpdateSettings.java @@ -0,0 +1,48 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS 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/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/updatesettings/SyncUpdateSettingsSettingsFieldmask.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/updatesettings/SyncUpdateSettingsSettingsFieldmask.java new file mode 100644 index 0000000000..8b692b18d1 --- /dev/null +++ b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/updatesettings/SyncUpdateSettingsSettingsFieldmask.java @@ -0,0 +1,43 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS 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/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/updatesink/AsyncUpdateSink.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/updatesink/AsyncUpdateSink.java index e4d5c91e85..8d6fc7e3a0 100644 --- a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/updatesink/AsyncUpdateSink.java +++ b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/updatesink/AsyncUpdateSink.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/updatesink/SyncUpdateSink.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/updatesink/SyncUpdateSink.java index af470dcb04..f9b88699e2 100644 --- a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/updatesink/SyncUpdateSink.java +++ b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/updatesink/SyncUpdateSink.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/updatesink/SyncUpdateSinkLogsinknameLogsink.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/updatesink/SyncUpdateSinkLogsinknameLogsink.java index f74d2c33de..9258ae827a 100644 --- a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/updatesink/SyncUpdateSinkLogsinknameLogsink.java +++ b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/updatesink/SyncUpdateSinkLogsinknameLogsink.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/updatesink/SyncUpdateSinkLogsinknameLogsinkFieldmask.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/updatesink/SyncUpdateSinkLogsinknameLogsinkFieldmask.java index aec9fbcd1f..18a78b8764 100644 --- a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/updatesink/SyncUpdateSinkLogsinknameLogsinkFieldmask.java +++ b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/updatesink/SyncUpdateSinkLogsinknameLogsinkFieldmask.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/updatesink/SyncUpdateSinkStringLogsink.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/updatesink/SyncUpdateSinkStringLogsink.java index 902dc0926a..1484c1a934 100644 --- a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/updatesink/SyncUpdateSinkStringLogsink.java +++ b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/updatesink/SyncUpdateSinkStringLogsink.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/updatesink/SyncUpdateSinkStringLogsinkFieldmask.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/updatesink/SyncUpdateSinkStringLogsinkFieldmask.java index ff275027c0..7ba06355c6 100644 --- a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/updatesink/SyncUpdateSinkStringLogsinkFieldmask.java +++ b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/updatesink/SyncUpdateSinkStringLogsinkFieldmask.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/updateview/AsyncUpdateView.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/updateview/AsyncUpdateView.java index 15c5e06efe..e02fda3ff3 100644 --- a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/updateview/AsyncUpdateView.java +++ b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/updateview/AsyncUpdateView.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/updateview/SyncUpdateView.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/updateview/SyncUpdateView.java index fbe179a735..544fb436e9 100644 --- a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/updateview/SyncUpdateView.java +++ b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configservicev2/updateview/SyncUpdateView.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configsettings/copylogentries/SyncCopyLogEntries.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configsettings/copylogentries/SyncCopyLogEntries.java new file mode 100644 index 0000000000..81fa576fe3 --- /dev/null +++ b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configsettings/copylogentries/SyncCopyLogEntries.java @@ -0,0 +1,53 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS 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_CopyLogEntries_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 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 + 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_CopyLogEntries_sync] diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configsettings/getbucket/SyncGetBucket.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configsettings/getbucket/SyncGetBucket.java index 4ce5011311..67039032df 100644 --- a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configsettings/getbucket/SyncGetBucket.java +++ b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configsettings/getbucket/SyncGetBucket.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -40,7 +40,14 @@ public static void syncGetBucket() throws Exception { .getBucketSettings() .getRetrySettings() .toBuilder() - .setTotalTimeout(Duration.ofSeconds(30)) + .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(); } diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/loggingservicev2/create/SyncCreateSetCredentialsProvider.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/loggingservicev2/create/SyncCreateSetCredentialsProvider.java index e816fa00c0..68ddccc7a7 100644 --- a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/loggingservicev2/create/SyncCreateSetCredentialsProvider.java +++ b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/loggingservicev2/create/SyncCreateSetCredentialsProvider.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/loggingservicev2/create/SyncCreateSetEndpoint.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/loggingservicev2/create/SyncCreateSetEndpoint.java index 8f45174e6d..f0fed5b345 100644 --- a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/loggingservicev2/create/SyncCreateSetEndpoint.java +++ b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/loggingservicev2/create/SyncCreateSetEndpoint.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/loggingservicev2/deletelog/AsyncDeleteLog.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/loggingservicev2/deletelog/AsyncDeleteLog.java index ddfc69170c..6ddcb32d89 100644 --- a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/loggingservicev2/deletelog/AsyncDeleteLog.java +++ b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/loggingservicev2/deletelog/AsyncDeleteLog.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/loggingservicev2/deletelog/SyncDeleteLog.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/loggingservicev2/deletelog/SyncDeleteLog.java index 0f4b8d4815..7404cdddf0 100644 --- a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/loggingservicev2/deletelog/SyncDeleteLog.java +++ b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/loggingservicev2/deletelog/SyncDeleteLog.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/loggingservicev2/deletelog/SyncDeleteLogLogname.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/loggingservicev2/deletelog/SyncDeleteLogLogname.java index 58768449fc..bca64e6e35 100644 --- a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/loggingservicev2/deletelog/SyncDeleteLogLogname.java +++ b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/loggingservicev2/deletelog/SyncDeleteLogLogname.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/loggingservicev2/deletelog/SyncDeleteLogString.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/loggingservicev2/deletelog/SyncDeleteLogString.java index 6322f88684..af1a553664 100644 --- a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/loggingservicev2/deletelog/SyncDeleteLogString.java +++ b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/loggingservicev2/deletelog/SyncDeleteLogString.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/loggingservicev2/listlogentries/AsyncListLogEntries.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/loggingservicev2/listlogentries/AsyncListLogEntries.java index 882c03d6ad..de1cba1e4a 100644 --- a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/loggingservicev2/listlogentries/AsyncListLogEntries.java +++ b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/loggingservicev2/listlogentries/AsyncListLogEntries.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/loggingservicev2/listlogentries/AsyncListLogEntriesPaged.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/loggingservicev2/listlogentries/AsyncListLogEntriesPaged.java index f018b6932d..266d5295d0 100644 --- a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/loggingservicev2/listlogentries/AsyncListLogEntriesPaged.java +++ b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/loggingservicev2/listlogentries/AsyncListLogEntriesPaged.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/loggingservicev2/listlogentries/SyncListLogEntries.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/loggingservicev2/listlogentries/SyncListLogEntries.java index 0809ee3bae..edc5783072 100644 --- a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/loggingservicev2/listlogentries/SyncListLogEntries.java +++ b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/loggingservicev2/listlogentries/SyncListLogEntries.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/loggingservicev2/listlogentries/SyncListLogEntriesListstringStringString.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/loggingservicev2/listlogentries/SyncListLogEntriesListstringStringString.java index 0362f54077..090a412d65 100644 --- a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/loggingservicev2/listlogentries/SyncListLogEntriesListstringStringString.java +++ b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/loggingservicev2/listlogentries/SyncListLogEntriesListstringStringString.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/loggingservicev2/listlogs/AsyncListLogs.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/loggingservicev2/listlogs/AsyncListLogs.java index f953d535ba..288a559d0a 100644 --- a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/loggingservicev2/listlogs/AsyncListLogs.java +++ b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/loggingservicev2/listlogs/AsyncListLogs.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/loggingservicev2/listlogs/AsyncListLogsPaged.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/loggingservicev2/listlogs/AsyncListLogsPaged.java index 8f1861dbc7..277282ce15 100644 --- a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/loggingservicev2/listlogs/AsyncListLogsPaged.java +++ b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/loggingservicev2/listlogs/AsyncListLogsPaged.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/loggingservicev2/listlogs/SyncListLogs.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/loggingservicev2/listlogs/SyncListLogs.java index c3f2710ac0..6083fe0c04 100644 --- a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/loggingservicev2/listlogs/SyncListLogs.java +++ b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/loggingservicev2/listlogs/SyncListLogs.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/loggingservicev2/listlogs/SyncListLogsBillingaccountname.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/loggingservicev2/listlogs/SyncListLogsBillingaccountname.java index 873f35192b..ad9ef7e4f6 100644 --- a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/loggingservicev2/listlogs/SyncListLogsBillingaccountname.java +++ b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/loggingservicev2/listlogs/SyncListLogsBillingaccountname.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/loggingservicev2/listlogs/SyncListLogsFoldername.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/loggingservicev2/listlogs/SyncListLogsFoldername.java index 21f7c3d8f1..9ec1e6441b 100644 --- a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/loggingservicev2/listlogs/SyncListLogsFoldername.java +++ b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/loggingservicev2/listlogs/SyncListLogsFoldername.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/loggingservicev2/listlogs/SyncListLogsOrganizationname.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/loggingservicev2/listlogs/SyncListLogsOrganizationname.java index 482880b0ea..2bd1f92d52 100644 --- a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/loggingservicev2/listlogs/SyncListLogsOrganizationname.java +++ b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/loggingservicev2/listlogs/SyncListLogsOrganizationname.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/loggingservicev2/listlogs/SyncListLogsProjectname.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/loggingservicev2/listlogs/SyncListLogsProjectname.java index 56ae4bede8..520afc5874 100644 --- a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/loggingservicev2/listlogs/SyncListLogsProjectname.java +++ b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/loggingservicev2/listlogs/SyncListLogsProjectname.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/loggingservicev2/listlogs/SyncListLogsString.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/loggingservicev2/listlogs/SyncListLogsString.java index 72be8ea87b..8cd129d082 100644 --- a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/loggingservicev2/listlogs/SyncListLogsString.java +++ b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/loggingservicev2/listlogs/SyncListLogsString.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/loggingservicev2/listmonitoredresourcedescriptors/AsyncListMonitoredResourceDescriptors.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/loggingservicev2/listmonitoredresourcedescriptors/AsyncListMonitoredResourceDescriptors.java index 7280fad4e7..bdc08109f9 100644 --- a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/loggingservicev2/listmonitoredresourcedescriptors/AsyncListMonitoredResourceDescriptors.java +++ b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/loggingservicev2/listmonitoredresourcedescriptors/AsyncListMonitoredResourceDescriptors.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/loggingservicev2/listmonitoredresourcedescriptors/AsyncListMonitoredResourceDescriptorsPaged.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/loggingservicev2/listmonitoredresourcedescriptors/AsyncListMonitoredResourceDescriptorsPaged.java index cfc6c077af..02a0d33754 100644 --- a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/loggingservicev2/listmonitoredresourcedescriptors/AsyncListMonitoredResourceDescriptorsPaged.java +++ b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/loggingservicev2/listmonitoredresourcedescriptors/AsyncListMonitoredResourceDescriptorsPaged.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/loggingservicev2/listmonitoredresourcedescriptors/SyncListMonitoredResourceDescriptors.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/loggingservicev2/listmonitoredresourcedescriptors/SyncListMonitoredResourceDescriptors.java index 14cc45dc9c..267d23b8a7 100644 --- a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/loggingservicev2/listmonitoredresourcedescriptors/SyncListMonitoredResourceDescriptors.java +++ b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/loggingservicev2/listmonitoredresourcedescriptors/SyncListMonitoredResourceDescriptors.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/loggingservicev2/taillogentries/AsyncTailLogEntries.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/loggingservicev2/taillogentries/AsyncTailLogEntries.java index cc2ea957f7..0d3164ccd2 100644 --- a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/loggingservicev2/taillogentries/AsyncTailLogEntries.java +++ b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/loggingservicev2/taillogentries/AsyncTailLogEntries.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/loggingservicev2/writelogentries/AsyncWriteLogEntries.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/loggingservicev2/writelogentries/AsyncWriteLogEntries.java index 35a3265911..fd6e2fe274 100644 --- a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/loggingservicev2/writelogentries/AsyncWriteLogEntries.java +++ b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/loggingservicev2/writelogentries/AsyncWriteLogEntries.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/loggingservicev2/writelogentries/SyncWriteLogEntries.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/loggingservicev2/writelogentries/SyncWriteLogEntries.java index 8d0b01bf25..c48ccaf6c7 100644 --- a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/loggingservicev2/writelogentries/SyncWriteLogEntries.java +++ b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/loggingservicev2/writelogentries/SyncWriteLogEntries.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/loggingservicev2/writelogentries/SyncWriteLogEntriesLognameMonitoredresourceMapstringstringListlogentry.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/loggingservicev2/writelogentries/SyncWriteLogEntriesLognameMonitoredresourceMapstringstringListlogentry.java index bd79f3dd2e..f4ec24cb72 100644 --- a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/loggingservicev2/writelogentries/SyncWriteLogEntriesLognameMonitoredresourceMapstringstringListlogentry.java +++ b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/loggingservicev2/writelogentries/SyncWriteLogEntriesLognameMonitoredresourceMapstringstringListlogentry.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/loggingservicev2/writelogentries/SyncWriteLogEntriesStringMonitoredresourceMapstringstringListlogentry.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/loggingservicev2/writelogentries/SyncWriteLogEntriesStringMonitoredresourceMapstringstringListlogentry.java index 830f5c9594..290592fd7d 100644 --- a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/loggingservicev2/writelogentries/SyncWriteLogEntriesStringMonitoredresourceMapstringstringListlogentry.java +++ b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/loggingservicev2/writelogentries/SyncWriteLogEntriesStringMonitoredresourceMapstringstringListlogentry.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/loggingsettings/deletelog/SyncDeleteLog.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/loggingsettings/deletelog/SyncDeleteLog.java index 11841688ba..b62d8280df 100644 --- a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/loggingsettings/deletelog/SyncDeleteLog.java +++ b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/loggingsettings/deletelog/SyncDeleteLog.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -40,7 +40,14 @@ public static void syncDeleteLog() throws Exception { .deleteLogSettings() .getRetrySettings() .toBuilder() - .setTotalTimeout(Duration.ofSeconds(30)) + .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(); } diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/metricsservicev2/create/SyncCreateSetCredentialsProvider.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/metricsservicev2/create/SyncCreateSetCredentialsProvider.java index 01738692f9..b066dbb641 100644 --- a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/metricsservicev2/create/SyncCreateSetCredentialsProvider.java +++ b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/metricsservicev2/create/SyncCreateSetCredentialsProvider.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/metricsservicev2/create/SyncCreateSetEndpoint.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/metricsservicev2/create/SyncCreateSetEndpoint.java index 34cf57f15c..0b3146424c 100644 --- a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/metricsservicev2/create/SyncCreateSetEndpoint.java +++ b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/metricsservicev2/create/SyncCreateSetEndpoint.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/metricsservicev2/createlogmetric/AsyncCreateLogMetric.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/metricsservicev2/createlogmetric/AsyncCreateLogMetric.java index 4de99d41be..556f8d812f 100644 --- a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/metricsservicev2/createlogmetric/AsyncCreateLogMetric.java +++ b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/metricsservicev2/createlogmetric/AsyncCreateLogMetric.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/metricsservicev2/createlogmetric/SyncCreateLogMetric.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/metricsservicev2/createlogmetric/SyncCreateLogMetric.java index 1d7b15926b..b93538585b 100644 --- a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/metricsservicev2/createlogmetric/SyncCreateLogMetric.java +++ b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/metricsservicev2/createlogmetric/SyncCreateLogMetric.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/metricsservicev2/createlogmetric/SyncCreateLogMetricProjectnameLogmetric.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/metricsservicev2/createlogmetric/SyncCreateLogMetricProjectnameLogmetric.java index a6b645e580..0c0dc15de5 100644 --- a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/metricsservicev2/createlogmetric/SyncCreateLogMetricProjectnameLogmetric.java +++ b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/metricsservicev2/createlogmetric/SyncCreateLogMetricProjectnameLogmetric.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/metricsservicev2/createlogmetric/SyncCreateLogMetricStringLogmetric.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/metricsservicev2/createlogmetric/SyncCreateLogMetricStringLogmetric.java index 55f0d05910..b24e8e7b1c 100644 --- a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/metricsservicev2/createlogmetric/SyncCreateLogMetricStringLogmetric.java +++ b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/metricsservicev2/createlogmetric/SyncCreateLogMetricStringLogmetric.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/metricsservicev2/deletelogmetric/AsyncDeleteLogMetric.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/metricsservicev2/deletelogmetric/AsyncDeleteLogMetric.java index 9eaddcee33..e75f7e6cd2 100644 --- a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/metricsservicev2/deletelogmetric/AsyncDeleteLogMetric.java +++ b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/metricsservicev2/deletelogmetric/AsyncDeleteLogMetric.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/metricsservicev2/deletelogmetric/SyncDeleteLogMetric.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/metricsservicev2/deletelogmetric/SyncDeleteLogMetric.java index a0af69c351..a4d00e9416 100644 --- a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/metricsservicev2/deletelogmetric/SyncDeleteLogMetric.java +++ b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/metricsservicev2/deletelogmetric/SyncDeleteLogMetric.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/metricsservicev2/deletelogmetric/SyncDeleteLogMetricLogmetricname.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/metricsservicev2/deletelogmetric/SyncDeleteLogMetricLogmetricname.java index 033de053ff..c245be78c8 100644 --- a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/metricsservicev2/deletelogmetric/SyncDeleteLogMetricLogmetricname.java +++ b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/metricsservicev2/deletelogmetric/SyncDeleteLogMetricLogmetricname.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/metricsservicev2/deletelogmetric/SyncDeleteLogMetricString.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/metricsservicev2/deletelogmetric/SyncDeleteLogMetricString.java index 69d8ab2df7..d0cf2b898d 100644 --- a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/metricsservicev2/deletelogmetric/SyncDeleteLogMetricString.java +++ b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/metricsservicev2/deletelogmetric/SyncDeleteLogMetricString.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/metricsservicev2/getlogmetric/AsyncGetLogMetric.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/metricsservicev2/getlogmetric/AsyncGetLogMetric.java index 8bc22db42e..eea739994a 100644 --- a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/metricsservicev2/getlogmetric/AsyncGetLogMetric.java +++ b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/metricsservicev2/getlogmetric/AsyncGetLogMetric.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/metricsservicev2/getlogmetric/SyncGetLogMetric.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/metricsservicev2/getlogmetric/SyncGetLogMetric.java index c3054b8c91..1926e2f2f1 100644 --- a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/metricsservicev2/getlogmetric/SyncGetLogMetric.java +++ b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/metricsservicev2/getlogmetric/SyncGetLogMetric.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/metricsservicev2/getlogmetric/SyncGetLogMetricLogmetricname.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/metricsservicev2/getlogmetric/SyncGetLogMetricLogmetricname.java index be1612c929..acd302a0ec 100644 --- a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/metricsservicev2/getlogmetric/SyncGetLogMetricLogmetricname.java +++ b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/metricsservicev2/getlogmetric/SyncGetLogMetricLogmetricname.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/metricsservicev2/getlogmetric/SyncGetLogMetricString.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/metricsservicev2/getlogmetric/SyncGetLogMetricString.java index 8d28e37eb5..16356a8348 100644 --- a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/metricsservicev2/getlogmetric/SyncGetLogMetricString.java +++ b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/metricsservicev2/getlogmetric/SyncGetLogMetricString.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/metricsservicev2/listlogmetrics/AsyncListLogMetrics.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/metricsservicev2/listlogmetrics/AsyncListLogMetrics.java index 517656c0ec..7e4047259f 100644 --- a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/metricsservicev2/listlogmetrics/AsyncListLogMetrics.java +++ b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/metricsservicev2/listlogmetrics/AsyncListLogMetrics.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/metricsservicev2/listlogmetrics/AsyncListLogMetricsPaged.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/metricsservicev2/listlogmetrics/AsyncListLogMetricsPaged.java index 1cc0315ef1..15198dfd19 100644 --- a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/metricsservicev2/listlogmetrics/AsyncListLogMetricsPaged.java +++ b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/metricsservicev2/listlogmetrics/AsyncListLogMetricsPaged.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/metricsservicev2/listlogmetrics/SyncListLogMetrics.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/metricsservicev2/listlogmetrics/SyncListLogMetrics.java index d32b3af8e1..d77f0163f2 100644 --- a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/metricsservicev2/listlogmetrics/SyncListLogMetrics.java +++ b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/metricsservicev2/listlogmetrics/SyncListLogMetrics.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/metricsservicev2/listlogmetrics/SyncListLogMetricsProjectname.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/metricsservicev2/listlogmetrics/SyncListLogMetricsProjectname.java index f9da7ecb78..33eff50be4 100644 --- a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/metricsservicev2/listlogmetrics/SyncListLogMetricsProjectname.java +++ b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/metricsservicev2/listlogmetrics/SyncListLogMetricsProjectname.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/metricsservicev2/listlogmetrics/SyncListLogMetricsString.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/metricsservicev2/listlogmetrics/SyncListLogMetricsString.java index a3e327bf56..a980cf7744 100644 --- a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/metricsservicev2/listlogmetrics/SyncListLogMetricsString.java +++ b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/metricsservicev2/listlogmetrics/SyncListLogMetricsString.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/metricsservicev2/updatelogmetric/AsyncUpdateLogMetric.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/metricsservicev2/updatelogmetric/AsyncUpdateLogMetric.java index d2c0ac2d2f..e92997d13b 100644 --- a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/metricsservicev2/updatelogmetric/AsyncUpdateLogMetric.java +++ b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/metricsservicev2/updatelogmetric/AsyncUpdateLogMetric.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/metricsservicev2/updatelogmetric/SyncUpdateLogMetric.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/metricsservicev2/updatelogmetric/SyncUpdateLogMetric.java index dd2f105604..a1f6fba87b 100644 --- a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/metricsservicev2/updatelogmetric/SyncUpdateLogMetric.java +++ b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/metricsservicev2/updatelogmetric/SyncUpdateLogMetric.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/metricsservicev2/updatelogmetric/SyncUpdateLogMetricLogmetricnameLogmetric.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/metricsservicev2/updatelogmetric/SyncUpdateLogMetricLogmetricnameLogmetric.java index 656195a4f8..7cab27ad83 100644 --- a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/metricsservicev2/updatelogmetric/SyncUpdateLogMetricLogmetricnameLogmetric.java +++ b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/metricsservicev2/updatelogmetric/SyncUpdateLogMetricLogmetricnameLogmetric.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/metricsservicev2/updatelogmetric/SyncUpdateLogMetricStringLogmetric.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/metricsservicev2/updatelogmetric/SyncUpdateLogMetricStringLogmetric.java index c3a8f822d2..42c3b324bd 100644 --- a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/metricsservicev2/updatelogmetric/SyncUpdateLogMetricStringLogmetric.java +++ b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/metricsservicev2/updatelogmetric/SyncUpdateLogMetricStringLogmetric.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/metricssettings/getlogmetric/SyncGetLogMetric.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/metricssettings/getlogmetric/SyncGetLogMetric.java index 7827c8c0a8..96a3bade1b 100644 --- a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/metricssettings/getlogmetric/SyncGetLogMetric.java +++ b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/metricssettings/getlogmetric/SyncGetLogMetric.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -40,7 +40,14 @@ public static void syncGetLogMetric() throws Exception { .getLogMetricSettings() .getRetrySettings() .toBuilder() - .setTotalTimeout(Duration.ofSeconds(30)) + .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(); } diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/stub/configservicev2stubsettings/copylogentries/SyncCopyLogEntries.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/stub/configservicev2stubsettings/copylogentries/SyncCopyLogEntries.java new file mode 100644 index 0000000000..5c3e75c7ee --- /dev/null +++ b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/stub/configservicev2stubsettings/copylogentries/SyncCopyLogEntries.java @@ -0,0 +1,54 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS 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_CopyLogEntries_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 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 + 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_CopyLogEntries_sync] diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/stub/configservicev2stubsettings/getbucket/SyncGetBucket.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/stub/configservicev2stubsettings/getbucket/SyncGetBucket.java index cf43da01a2..244417536f 100644 --- a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/stub/configservicev2stubsettings/getbucket/SyncGetBucket.java +++ b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/stub/configservicev2stubsettings/getbucket/SyncGetBucket.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -41,7 +41,14 @@ public static void syncGetBucket() throws Exception { .getBucketSettings() .getRetrySettings() .toBuilder() - .setTotalTimeout(Duration.ofSeconds(30)) + .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(); } diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/stub/loggingservicev2stubsettings/deletelog/SyncDeleteLog.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/stub/loggingservicev2stubsettings/deletelog/SyncDeleteLog.java index 9dbb84f39f..69fc40245f 100644 --- a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/stub/loggingservicev2stubsettings/deletelog/SyncDeleteLog.java +++ b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/stub/loggingservicev2stubsettings/deletelog/SyncDeleteLog.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -41,7 +41,14 @@ public static void syncDeleteLog() throws Exception { .deleteLogSettings() .getRetrySettings() .toBuilder() - .setTotalTimeout(Duration.ofSeconds(30)) + .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(); } diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/stub/metricsservicev2stubsettings/getlogmetric/SyncGetLogMetric.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/stub/metricsservicev2stubsettings/getlogmetric/SyncGetLogMetric.java index be68fa6143..0a4264f8f8 100644 --- a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/stub/metricsservicev2stubsettings/getlogmetric/SyncGetLogMetric.java +++ b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/stub/metricsservicev2stubsettings/getlogmetric/SyncGetLogMetric.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -41,7 +41,14 @@ public static void syncGetLogMetric() throws Exception { .getLogMetricSettings() .getRetrySettings() .toBuilder() - .setTotalTimeout(Duration.ofSeconds(30)) + .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(); } diff --git a/test/integration/goldens/logging/src/META-INF/native-image/com.google.cloud.logging.v2/reflect-config.json b/test/integration/goldens/logging/src/META-INF/native-image/com.google.cloud.logging.v2/reflect-config.json new file mode 100644 index 0000000000..6a63ae7ef9 --- /dev/null +++ b/test/integration/goldens/logging/src/META-INF/native-image/com.google.cloud.logging.v2/reflect-config.json @@ -0,0 +1,2909 @@ +[ + { + "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$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.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.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.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.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.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.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.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.LifecycleState", + "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.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.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/test/integration/goldens/logging/src/com/google/cloud/logging/v2/ConfigClient.java b/test/integration/goldens/logging/src/com/google/cloud/logging/v2/ConfigClient.java index edb8bb11a7..3ac4f9af12 100644 --- a/test/integration/goldens/logging/src/com/google/cloud/logging/v2/ConfigClient.java +++ b/test/integration/goldens/logging/src/com/google/cloud/logging/v2/ConfigClient.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -19,9 +19,11 @@ 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; @@ -30,6 +32,9 @@ import com.google.logging.v2.BillingAccountLocationName; import com.google.logging.v2.BillingAccountName; 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.CreateSinkRequest; @@ -43,6 +48,7 @@ import com.google.logging.v2.GetBucketRequest; import com.google.logging.v2.GetCmekSettingsRequest; import com.google.logging.v2.GetExclusionRequest; +import com.google.logging.v2.GetSettingsRequest; import com.google.logging.v2.GetSinkRequest; import com.google.logging.v2.GetViewRequest; import com.google.logging.v2.ListBucketsRequest; @@ -63,12 +69,17 @@ 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; @@ -103,19 +114,483 @@ *

        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(). * - *

        The surface of this class includes several types of Java methods for each of the API's - * methods: - * - *

          - *
        1. A "flattened" method. With this type of method, the fields of the request type have been - * converted into function parameters. It may be the case that not all fields are available as - * parameters, and not every API method will have a flattened method entry point. - *
        2. A "request object" method. This type of method only takes one parameter, a request object, - * which must be constructed before the call. Not every API method will have a request object - * method. - *
        3. A "callable" method. This type of method takes no parameters and returns an immutable API - * callable object, which can be used to initiate calls to the service. - *
        + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + *
        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() + *

        + *

        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. This method replaces the following fields in the existing bucket with values from the new bucket: `retention_period` + *

        If the retention period is decreased and the bucket is locked, `FAILED_PRECONDITION` will be returned. + *

        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() + *

        + *

        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. * @@ -159,6 +634,7 @@ 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 { @@ -188,11 +664,13 @@ public static final ConfigClient create(ConfigServiceV2Stub stub) { 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() { @@ -203,9 +681,17 @@ 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 buckets. + * Lists log buckets. * *

        Sample code: * @@ -243,7 +729,7 @@ public final ListBucketsPagedResponse listBuckets(BillingAccountLocationName par // AUTO-GENERATED DOCUMENTATION AND METHOD. /** - * Lists buckets. + * Lists log buckets. * *

        Sample code: * @@ -280,7 +766,7 @@ public final ListBucketsPagedResponse listBuckets(FolderLocationName parent) { // AUTO-GENERATED DOCUMENTATION AND METHOD. /** - * Lists buckets. + * Lists log buckets. * *

        Sample code: * @@ -317,7 +803,7 @@ public final ListBucketsPagedResponse listBuckets(LocationName parent) { // AUTO-GENERATED DOCUMENTATION AND METHOD. /** - * Lists buckets. + * Lists log buckets. * *

        Sample code: * @@ -354,7 +840,7 @@ public final ListBucketsPagedResponse listBuckets(OrganizationLocationName paren // AUTO-GENERATED DOCUMENTATION AND METHOD. /** - * Lists buckets. + * Lists log buckets. * *

        Sample code: * @@ -388,7 +874,7 @@ public final ListBucketsPagedResponse listBuckets(String parent) { // AUTO-GENERATED DOCUMENTATION AND METHOD. /** - * Lists buckets. + * Lists log buckets. * *

        Sample code: * @@ -420,7 +906,7 @@ public final ListBucketsPagedResponse listBuckets(ListBucketsRequest request) { // AUTO-GENERATED DOCUMENTATION AND METHOD. /** - * Lists buckets. + * Lists log buckets. * *

        Sample code: * @@ -452,7 +938,7 @@ public final ListBucketsPagedResponse listBuckets(ListBucketsRequest request) { // AUTO-GENERATED DOCUMENTATION AND METHOD. /** - * Lists buckets. + * Lists log buckets. * *

        Sample code: * @@ -490,7 +976,7 @@ public final UnaryCallable listBucketsC // AUTO-GENERATED DOCUMENTATION AND METHOD. /** - * Gets a bucket. + * Gets a log bucket. * *

        Sample code: * @@ -520,7 +1006,7 @@ public final LogBucket getBucket(GetBucketRequest request) { // AUTO-GENERATED DOCUMENTATION AND METHOD. /** - * Gets a bucket. + * Gets a log bucket. * *

        Sample code: * @@ -549,8 +1035,8 @@ public final UnaryCallable getBucketCallable() { // AUTO-GENERATED DOCUMENTATION AND METHOD. /** - * Creates a bucket that can be used to store log entries. Once a bucket has been created, the - * region cannot be changed. + * 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: * @@ -580,8 +1066,8 @@ public final LogBucket createBucket(CreateBucketRequest request) { // AUTO-GENERATED DOCUMENTATION AND METHOD. /** - * Creates a bucket that can be used to store log entries. Once a bucket has been created, the - * region cannot be changed. + * 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: * @@ -610,16 +1096,16 @@ public final UnaryCallable createBucketCallable( // AUTO-GENERATED DOCUMENTATION AND METHOD. /** - * Updates a bucket. This method replaces the following fields in the existing bucket with values - * from the new bucket: `retention_period` + * Updates a log bucket. This method replaces the following fields in the existing bucket with + * values from the new bucket: `retention_period` * - *

        If the retention period is decreased and the bucket is locked, FAILED_PRECONDITION will be + *

        If the retention period is decreased and the bucket is locked, `FAILED_PRECONDITION` will be * returned. * - *

        If the bucket has a LifecycleState of DELETE_REQUESTED, FAILED_PRECONDITION will be - * returned. + *

        If the bucket has a `lifecycle_state` of `DELETE_REQUESTED`, then `FAILED_PRECONDITION` will + * be returned. * - *

        A buckets region may not be modified after it is created. + *

        After a bucket has been created, the bucket's location cannot be changed. * *

        Sample code: * @@ -651,16 +1137,16 @@ public final LogBucket updateBucket(UpdateBucketRequest request) { // AUTO-GENERATED DOCUMENTATION AND METHOD. /** - * Updates a bucket. This method replaces the following fields in the existing bucket with values - * from the new bucket: `retention_period` + * Updates a log bucket. This method replaces the following fields in the existing bucket with + * values from the new bucket: `retention_period` * - *

        If the retention period is decreased and the bucket is locked, FAILED_PRECONDITION will be + *

        If the retention period is decreased and the bucket is locked, `FAILED_PRECONDITION` will be * returned. * - *

        If the bucket has a LifecycleState of DELETE_REQUESTED, FAILED_PRECONDITION will be - * returned. + *

        If the bucket has a `lifecycle_state` of `DELETE_REQUESTED`, then `FAILED_PRECONDITION` will + * be returned. * - *

        A buckets region may not be modified after it is created. + *

        After a bucket has been created, the bucket's location cannot be changed. * *

        Sample code: * @@ -691,8 +1177,10 @@ public final UnaryCallable updateBucketCallable( // AUTO-GENERATED DOCUMENTATION AND METHOD. /** - * Deletes a bucket. Moves the bucket to the DELETE_REQUESTED state. After 7 days, the bucket will - * be purged and all logs in the bucket will be permanently deleted. + * 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: * @@ -722,8 +1210,10 @@ public final void deleteBucket(DeleteBucketRequest request) { // AUTO-GENERATED DOCUMENTATION AND METHOD. /** - * Deletes a bucket. Moves the bucket to the DELETE_REQUESTED state. After 7 days, the bucket will - * be purged and all logs in the bucket will be permanently deleted. + * 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: * @@ -752,8 +1242,8 @@ public final UnaryCallable deleteBucketCallable() { // AUTO-GENERATED DOCUMENTATION AND METHOD. /** - * Undeletes a bucket. A bucket that has been deleted may be undeleted within the grace period of - * 7 days. + * Undeletes a log bucket. A bucket that has been deleted can be undeleted within the grace period + * of 7 days. * *

        Sample code: * @@ -783,8 +1273,8 @@ public final void undeleteBucket(UndeleteBucketRequest request) { // AUTO-GENERATED DOCUMENTATION AND METHOD. /** - * Undeletes a bucket. A bucket that has been deleted may be undeleted within the grace period of - * 7 days. + * Undeletes a log bucket. A bucket that has been deleted can be undeleted within the grace period + * of 7 days. * *

        Sample code: * @@ -813,7 +1303,7 @@ public final UnaryCallable undeleteBucketCallable( // AUTO-GENERATED DOCUMENTATION AND METHOD. /** - * Lists views on a bucket. + * Lists views on a log bucket. * *

        Sample code: * @@ -842,7 +1332,7 @@ public final ListViewsPagedResponse listViews(String parent) { // AUTO-GENERATED DOCUMENTATION AND METHOD. /** - * Lists views on a bucket. + * Lists views on a log bucket. * *

        Sample code: * @@ -874,7 +1364,7 @@ public final ListViewsPagedResponse listViews(ListViewsRequest request) { // AUTO-GENERATED DOCUMENTATION AND METHOD. /** - * Lists views on a bucket. + * Lists views on a log bucket. * *

        Sample code: * @@ -905,7 +1395,7 @@ public final UnaryCallable listViewsPa // AUTO-GENERATED DOCUMENTATION AND METHOD. /** - * Lists views on a bucket. + * Lists views on a log bucket. * *

        Sample code: * @@ -943,7 +1433,7 @@ public final UnaryCallable listViewsCallabl // AUTO-GENERATED DOCUMENTATION AND METHOD. /** - * Gets a view. + * Gets a view on a log bucket.. * *

        Sample code: * @@ -974,7 +1464,7 @@ public final LogView getView(GetViewRequest request) { // AUTO-GENERATED DOCUMENTATION AND METHOD. /** - * Gets a view. + * Gets a view on a log bucket.. * *

        Sample code: * @@ -1004,7 +1494,7 @@ public final UnaryCallable getViewCallable() { // AUTO-GENERATED DOCUMENTATION AND METHOD. /** - * Creates a view over logs in a bucket. A bucket may contain a maximum of 50 views. + * Creates a view over log entries in a log bucket. A bucket may contain a maximum of 30 views. * *

        Sample code: * @@ -1034,7 +1524,7 @@ public final LogView createView(CreateViewRequest request) { // AUTO-GENERATED DOCUMENTATION AND METHOD. /** - * Creates a view over logs in a bucket. A bucket may contain a maximum of 50 views. + * Creates a view over log entries in a log bucket. A bucket may contain a maximum of 30 views. * *

        Sample code: * @@ -1063,8 +1553,10 @@ public final UnaryCallable createViewCallable() { // AUTO-GENERATED DOCUMENTATION AND METHOD. /** - * Updates a view. This method replaces the following fields in the existing view with values from - * the new view: `filter`. + * 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: * @@ -1094,8 +1586,10 @@ public final LogView updateView(UpdateViewRequest request) { // AUTO-GENERATED DOCUMENTATION AND METHOD. /** - * Updates a view. This method replaces the following fields in the existing view with values from - * the new view: `filter`. + * 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: * @@ -1124,7 +1618,9 @@ public final UnaryCallable updateViewCallable() { // AUTO-GENERATED DOCUMENTATION AND METHOD. /** - * Deletes a view from a bucket. + * 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: * @@ -1155,7 +1651,9 @@ public final void deleteView(DeleteViewRequest request) { // AUTO-GENERATED DOCUMENTATION AND METHOD. /** - * Deletes a view from a bucket. + * 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: * @@ -1461,7 +1959,8 @@ public final UnaryCallable listSinksCallabl * "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]" * "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]" * "folders/[FOLDER_ID]/sinks/[SINK_ID]" - *

        Example: `"projects/my-project-id/sinks/my-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) { @@ -1495,7 +1994,8 @@ public final LogSink getSink(LogSinkName sinkName) { * "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]" * "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]" * "folders/[FOLDER_ID]/sinks/[SINK_ID]" - *

        Example: `"projects/my-project-id/sinks/my-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) { @@ -1583,7 +2083,8 @@ public final UnaryCallable getSinkCallable() { * @param parent Required. The resource in which to create the sink: *

        "projects/[PROJECT_ID]" "organizations/[ORGANIZATION_ID]" * "billingAccounts/[BILLING_ACCOUNT_ID]" "folders/[FOLDER_ID]" - *

        Examples: `"projects/my-logging-project"`, `"organizations/123456789"`. + *

        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 @@ -1622,7 +2123,8 @@ public final LogSink createSink(BillingAccountName parent, LogSink 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]" - *

        Examples: `"projects/my-logging-project"`, `"organizations/123456789"`. + *

        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 @@ -1661,7 +2163,8 @@ public final LogSink createSink(FolderName parent, LogSink 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]" - *

        Examples: `"projects/my-logging-project"`, `"organizations/123456789"`. + *

        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 @@ -1700,7 +2203,8 @@ public final LogSink createSink(OrganizationName parent, LogSink 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]" - *

        Examples: `"projects/my-logging-project"`, `"organizations/123456789"`. + *

        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 @@ -1739,7 +2243,8 @@ public final LogSink createSink(ProjectName parent, LogSink 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]" - *

        Examples: `"projects/my-logging-project"`, `"organizations/123456789"`. + *

        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 @@ -1844,7 +2349,8 @@ public final UnaryCallable createSinkCallable() { * "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]" * "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]" * "folders/[FOLDER_ID]/sinks/[SINK_ID]" - *

        Example: `"projects/my-project-id/sinks/my-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 @@ -1887,7 +2393,8 @@ public final LogSink updateSink(LogSinkName sinkName, LogSink sink) { * "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]" * "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]" * "folders/[FOLDER_ID]/sinks/[SINK_ID]" - *

        Example: `"projects/my-project-id/sinks/my-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 @@ -1928,18 +2435,21 @@ public final LogSink updateSink(String sinkName, LogSink sink) { * "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]" * "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]" * "folders/[FOLDER_ID]/sinks/[SINK_ID]" - *

        Example: `"projects/my-project-id/sinks/my-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. + *

        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 - *

        Example: `updateMask=filter`. + *

        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) { @@ -1982,18 +2492,21 @@ public final LogSink updateSink(LogSinkName sinkName, LogSink sink, FieldMask up * "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]" * "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]" * "folders/[FOLDER_ID]/sinks/[SINK_ID]" - *

        Example: `"projects/my-project-id/sinks/my-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. + *

        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 - *

        Example: `updateMask=filter`. + *

        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) { @@ -2100,7 +2613,8 @@ public final UnaryCallable updateSinkCallable() { * "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]" * "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]" * "folders/[FOLDER_ID]/sinks/[SINK_ID]" - *

        Example: `"projects/my-project-id/sinks/my-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) { @@ -2136,7 +2650,8 @@ public final void deleteSink(LogSinkName sinkName) { * "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]" * "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]" * "folders/[FOLDER_ID]/sinks/[SINK_ID]" - *

        Example: `"projects/my-project-id/sinks/my-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) { @@ -2203,7 +2718,7 @@ public final UnaryCallable deleteSinkCallable() { // AUTO-GENERATED DOCUMENTATION AND METHOD. /** - * Lists all the exclusions in a parent resource. + * Lists all the exclusions on the _Default sink in a parent resource. * *

        Sample code: * @@ -2236,7 +2751,7 @@ public final ListExclusionsPagedResponse listExclusions(BillingAccountName paren // AUTO-GENERATED DOCUMENTATION AND METHOD. /** - * Lists all the exclusions in a parent resource. + * Lists all the exclusions on the _Default sink in a parent resource. * *

        Sample code: * @@ -2269,7 +2784,7 @@ public final ListExclusionsPagedResponse listExclusions(FolderName parent) { // AUTO-GENERATED DOCUMENTATION AND METHOD. /** - * Lists all the exclusions in a parent resource. + * Lists all the exclusions on the _Default sink in a parent resource. * *

        Sample code: * @@ -2302,7 +2817,7 @@ public final ListExclusionsPagedResponse listExclusions(OrganizationName parent) // AUTO-GENERATED DOCUMENTATION AND METHOD. /** - * Lists all the exclusions in a parent resource. + * Lists all the exclusions on the _Default sink in a parent resource. * *

        Sample code: * @@ -2335,7 +2850,7 @@ public final ListExclusionsPagedResponse listExclusions(ProjectName parent) { // AUTO-GENERATED DOCUMENTATION AND METHOD. /** - * Lists all the exclusions in a parent resource. + * Lists all the exclusions on the _Default sink in a parent resource. * *

        Sample code: * @@ -2365,7 +2880,7 @@ public final ListExclusionsPagedResponse listExclusions(String parent) { // AUTO-GENERATED DOCUMENTATION AND METHOD. /** - * Lists all the exclusions in a parent resource. + * Lists all the exclusions on the _Default sink in a parent resource. * *

        Sample code: * @@ -2397,7 +2912,7 @@ public final ListExclusionsPagedResponse listExclusions(ListExclusionsRequest re // AUTO-GENERATED DOCUMENTATION AND METHOD. /** - * Lists all the exclusions in a parent resource. + * Lists all the exclusions on the _Default sink in a parent resource. * *

        Sample code: * @@ -2430,7 +2945,7 @@ public final ListExclusionsPagedResponse listExclusions(ListExclusionsRequest re // AUTO-GENERATED DOCUMENTATION AND METHOD. /** - * Lists all the exclusions in a parent resource. + * Lists all the exclusions on the _Default sink in a parent resource. * *

        Sample code: * @@ -2469,7 +2984,7 @@ public final ListExclusionsPagedResponse listExclusions(ListExclusionsRequest re // AUTO-GENERATED DOCUMENTATION AND METHOD. /** - * Gets the description of an exclusion. + * Gets the description of an exclusion in the _Default sink. * *

        Sample code: * @@ -2490,7 +3005,8 @@ public final ListExclusionsPagedResponse listExclusions(ListExclusionsRequest re * "organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]" * "billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]" * "folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]" - *

        Example: `"projects/my-project-id/exclusions/my-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) { @@ -2501,7 +3017,7 @@ public final LogExclusion getExclusion(LogExclusionName name) { // AUTO-GENERATED DOCUMENTATION AND METHOD. /** - * Gets the description of an exclusion. + * Gets the description of an exclusion in the _Default sink. * *

        Sample code: * @@ -2522,7 +3038,8 @@ public final LogExclusion getExclusion(LogExclusionName name) { * "organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]" * "billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]" * "folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]" - *

        Example: `"projects/my-project-id/exclusions/my-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) { @@ -2532,7 +3049,7 @@ public final LogExclusion getExclusion(String name) { // AUTO-GENERATED DOCUMENTATION AND METHOD. /** - * Gets the description of an exclusion. + * Gets the description of an exclusion in the _Default sink. * *

        Sample code: * @@ -2561,7 +3078,7 @@ public final LogExclusion getExclusion(GetExclusionRequest request) { // AUTO-GENERATED DOCUMENTATION AND METHOD. /** - * Gets the description of an exclusion. + * Gets the description of an exclusion in the _Default sink. * *

        Sample code: * @@ -2589,8 +3106,8 @@ public final UnaryCallable getExclusionCallab // AUTO-GENERATED DOCUMENTATION AND METHOD. /** - * Creates a new exclusion 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. + * 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: * @@ -2610,7 +3127,8 @@ public final UnaryCallable getExclusionCallab * @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]" - *

        Examples: `"projects/my-logging-project"`, `"organizations/123456789"`. + *

        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 @@ -2626,8 +3144,8 @@ public final LogExclusion createExclusion(BillingAccountName parent, LogExclusio // AUTO-GENERATED DOCUMENTATION AND METHOD. /** - * Creates a new exclusion 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. + * 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: * @@ -2647,7 +3165,8 @@ public final LogExclusion createExclusion(BillingAccountName parent, LogExclusio * @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]" - *

        Examples: `"projects/my-logging-project"`, `"organizations/123456789"`. + *

        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 @@ -2663,8 +3182,8 @@ public final LogExclusion createExclusion(FolderName parent, LogExclusion exclus // AUTO-GENERATED DOCUMENTATION AND METHOD. /** - * Creates a new exclusion 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. + * 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: * @@ -2684,7 +3203,8 @@ public final LogExclusion createExclusion(FolderName parent, LogExclusion exclus * @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]" - *

        Examples: `"projects/my-logging-project"`, `"organizations/123456789"`. + *

        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 @@ -2700,8 +3220,8 @@ public final LogExclusion createExclusion(OrganizationName parent, LogExclusion // AUTO-GENERATED DOCUMENTATION AND METHOD. /** - * Creates a new exclusion 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. + * 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: * @@ -2721,7 +3241,8 @@ public final LogExclusion createExclusion(OrganizationName parent, LogExclusion * @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]" - *

        Examples: `"projects/my-logging-project"`, `"organizations/123456789"`. + *

        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 @@ -2737,8 +3258,8 @@ public final LogExclusion createExclusion(ProjectName parent, LogExclusion exclu // AUTO-GENERATED DOCUMENTATION AND METHOD. /** - * Creates a new exclusion 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. + * 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: * @@ -2758,7 +3279,8 @@ public final LogExclusion createExclusion(ProjectName parent, LogExclusion exclu * @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]" - *

        Examples: `"projects/my-logging-project"`, `"organizations/123456789"`. + *

        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 @@ -2771,8 +3293,8 @@ public final LogExclusion createExclusion(String parent, LogExclusion exclusion) // AUTO-GENERATED DOCUMENTATION AND METHOD. /** - * Creates a new exclusion 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. + * 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: * @@ -2801,8 +3323,8 @@ public final LogExclusion createExclusion(CreateExclusionRequest request) { // AUTO-GENERATED DOCUMENTATION AND METHOD. /** - * Creates a new exclusion 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. + * 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: * @@ -2830,7 +3352,7 @@ public final UnaryCallable createExclusion // AUTO-GENERATED DOCUMENTATION AND METHOD. /** - * Changes one or more properties of an existing exclusion. + * Changes one or more properties of an existing exclusion in the _Default sink. * *

        Sample code: * @@ -2853,7 +3375,8 @@ public final UnaryCallable createExclusion * "organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]" * "billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]" * "folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]" - *

        Example: `"projects/my-project-id/exclusions/my-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 @@ -2877,7 +3400,7 @@ public final LogExclusion updateExclusion( // AUTO-GENERATED DOCUMENTATION AND METHOD. /** - * Changes one or more properties of an existing exclusion. + * Changes one or more properties of an existing exclusion in the _Default sink. * *

        Sample code: * @@ -2900,7 +3423,8 @@ public final LogExclusion updateExclusion( * "organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]" * "billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]" * "folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]" - *

        Example: `"projects/my-project-id/exclusions/my-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 @@ -2924,7 +3448,7 @@ public final LogExclusion updateExclusion( // AUTO-GENERATED DOCUMENTATION AND METHOD. /** - * Changes one or more properties of an existing exclusion. + * Changes one or more properties of an existing exclusion in the _Default sink. * *

        Sample code: * @@ -2955,7 +3479,7 @@ public final LogExclusion updateExclusion(UpdateExclusionRequest request) { // AUTO-GENERATED DOCUMENTATION AND METHOD. /** - * Changes one or more properties of an existing exclusion. + * Changes one or more properties of an existing exclusion in the _Default sink. * *

        Sample code: * @@ -2985,7 +3509,7 @@ public final UnaryCallable updateExclusion // AUTO-GENERATED DOCUMENTATION AND METHOD. /** - * Deletes an exclusion. + * Deletes an exclusion in the _Default sink. * *

        Sample code: * @@ -3006,7 +3530,8 @@ public final UnaryCallable updateExclusion * "organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]" * "billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]" * "folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]" - *

        Example: `"projects/my-project-id/exclusions/my-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) { @@ -3017,7 +3542,7 @@ public final void deleteExclusion(LogExclusionName name) { // AUTO-GENERATED DOCUMENTATION AND METHOD. /** - * Deletes an exclusion. + * Deletes an exclusion in the _Default sink. * *

        Sample code: * @@ -3038,7 +3563,8 @@ public final void deleteExclusion(LogExclusionName name) { * "organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]" * "billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]" * "folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]" - *

        Example: `"projects/my-project-id/exclusions/my-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) { @@ -3048,7 +3574,7 @@ public final void deleteExclusion(String name) { // AUTO-GENERATED DOCUMENTATION AND METHOD. /** - * Deletes an exclusion. + * Deletes an exclusion in the _Default sink. * *

        Sample code: * @@ -3077,7 +3603,7 @@ public final void deleteExclusion(DeleteExclusionRequest request) { // AUTO-GENERATED DOCUMENTATION AND METHOD. /** - * Deletes an exclusion. + * Deletes an exclusion in the _Default sink. * *

        Sample code: * @@ -3105,12 +3631,13 @@ public final UnaryCallable deleteExclusionCallabl // AUTO-GENERATED DOCUMENTATION AND METHOD. /** - * Gets the Logs Router CMEK settings for the given resource. + * Gets the Logging CMEK settings for the given resource. * - *

        Note: CMEK for the Logs Router can currently only be configured for GCP organizations. Once - * configured, it applies to all projects and folders in the GCP organization. + *

        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 Logs + *

        See [Enabling CMEK for Log * Router](https://cloud.google.com/logging/docs/routing/managed-encryption) for more information. * *

        Sample code: @@ -3139,12 +3666,13 @@ public final CmekSettings getCmekSettings(GetCmekSettingsRequest request) { // AUTO-GENERATED DOCUMENTATION AND METHOD. /** - * Gets the Logs Router CMEK settings for the given resource. + * Gets the Logging CMEK settings for the given resource. * - *

        Note: CMEK for the Logs Router can currently only be configured for GCP organizations. Once - * configured, it applies to all projects and folders in the GCP organization. + *

        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 Logs + *

        See [Enabling CMEK for Log * Router](https://cloud.google.com/logging/docs/routing/managed-encryption) for more information. * *

        Sample code: @@ -3172,17 +3700,18 @@ public final UnaryCallable getCmekSettings // AUTO-GENERATED DOCUMENTATION AND METHOD. /** - * Updates the Logs Router CMEK settings for the given resource. + * Updates the Log Router CMEK settings for the given resource. * - *

        Note: CMEK for the Logs Router can currently only be configured for GCP organizations. Once - * configured, it applies to all projects and folders in the GCP organization. + *

        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 Logs + *

        See [Enabling CMEK for Log * Router](https://cloud.google.com/logging/docs/routing/managed-encryption) for more information. * *

        Sample code: @@ -3213,17 +3742,18 @@ public final CmekSettings updateCmekSettings(UpdateCmekSettingsRequest request) // AUTO-GENERATED DOCUMENTATION AND METHOD. /** - * Updates the Logs Router CMEK settings for the given resource. + * Updates the Log Router CMEK settings for the given resource. * - *

        Note: CMEK for the Logs Router can currently only be configured for GCP organizations. Once - * configured, it applies to all projects and folders in the GCP organization. + *

        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 Logs + *

        See [Enabling CMEK for Log * Router](https://cloud.google.com/logging/docs/routing/managed-encryption) for more information. * *

        Sample code: @@ -3252,6 +3782,385 @@ public final UnaryCallable updateCmekSe 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(); diff --git a/test/integration/goldens/logging/src/com/google/cloud/logging/v2/ConfigClientTest.java b/test/integration/goldens/logging/src/com/google/cloud/logging/v2/ConfigClientTest.java index 58d2e21d97..7824eeb74a 100644 --- a/test/integration/goldens/logging/src/com/google/cloud/logging/v2/ConfigClientTest.java +++ b/test/integration/goldens/logging/src/com/google/cloud/logging/v2/ConfigClientTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -28,11 +28,14 @@ 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.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.CreateSinkRequest; @@ -46,6 +49,7 @@ import com.google.logging.v2.GetBucketRequest; import com.google.logging.v2.GetCmekSettingsRequest; import com.google.logging.v2.GetExclusionRequest; +import com.google.logging.v2.GetSettingsRequest; import com.google.logging.v2.GetSinkRequest; import com.google.logging.v2.GetViewRequest; import com.google.logging.v2.LifecycleState; @@ -69,13 +73,18 @@ 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; @@ -85,6 +94,7 @@ 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; @@ -366,6 +376,8 @@ public void getBucketTest() throws Exception { .setRetentionDays(1544391896) .setLocked(true) .setLifecycleState(LifecycleState.forNumber(0)) + .addAllRestrictedFields(new ArrayList()) + .setCmekSettings(CmekSettings.newBuilder().build()) .build(); mockConfigServiceV2.addResponse(expectedResponse); @@ -422,6 +434,8 @@ public void createBucketTest() throws Exception { .setRetentionDays(1544391896) .setLocked(true) .setLifecycleState(LifecycleState.forNumber(0)) + .addAllRestrictedFields(new ArrayList()) + .setCmekSettings(CmekSettings.newBuilder().build()) .build(); mockConfigServiceV2.addResponse(expectedResponse); @@ -480,6 +494,8 @@ public void updateBucketTest() throws Exception { .setRetentionDays(1544391896) .setLocked(true) .setLifecycleState(LifecycleState.forNumber(0)) + .addAllRestrictedFields(new ArrayList()) + .setCmekSettings(CmekSettings.newBuilder().build()) .build(); mockConfigServiceV2.addResponse(expectedResponse); @@ -2515,4 +2531,189 @@ public void updateCmekSettingsExceptionTest() throws Exception { // 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/test/integration/goldens/logging/src/com/google/cloud/logging/v2/ConfigSettings.java b/test/integration/goldens/logging/src/com/google/cloud/logging/v2/ConfigSettings.java index b1a42c2c57..7dbd629d5f 100644 --- a/test/integration/goldens/logging/src/com/google/cloud/logging/v2/ConfigSettings.java +++ b/test/integration/goldens/logging/src/com/google/cloud/logging/v2/ConfigSettings.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -22,19 +22,22 @@ import static com.google.cloud.logging.v2.ConfigClient.ListViewsPagedResponse; import com.google.api.core.ApiFunction; -import com.google.api.core.BetaApi; import com.google.api.gax.core.GoogleCredentialsProvider; import com.google.api.gax.core.InstantiatingExecutorProvider; import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; import com.google.api.gax.rpc.ApiClientHeaderProvider; import com.google.api.gax.rpc.ClientContext; import com.google.api.gax.rpc.ClientSettings; +import com.google.api.gax.rpc.OperationCallSettings; import com.google.api.gax.rpc.PagedCallSettings; import com.google.api.gax.rpc.StubSettings; 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.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.CreateSinkRequest; @@ -46,6 +49,7 @@ import com.google.logging.v2.GetBucketRequest; import com.google.logging.v2.GetCmekSettingsRequest; import com.google.logging.v2.GetExclusionRequest; +import com.google.logging.v2.GetSettingsRequest; import com.google.logging.v2.GetSinkRequest; import com.google.logging.v2.GetViewRequest; import com.google.logging.v2.ListBucketsRequest; @@ -60,12 +64,15 @@ 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; @@ -86,7 +93,9 @@ *

        The builder of this class is recursive, so contained classes are themselves builders. When * build() is called, the tree of builders is called to create the complete settings object. * - *

        For example, to set the total timeout of getBucket to 30 seconds: + *

        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.
        @@ -102,10 +111,46 @@
          *             .getBucketSettings()
          *             .getRetrySettings()
          *             .toBuilder()
        - *             .setTotalTimeout(Duration.ofSeconds(30))
        + *             .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://docs.cloud.google.com/java/docs/client-retries) 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 copyLogEntries: + * + *

        {@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 { @@ -230,6 +275,28 @@ public UnaryCallSettings updateCmekSett 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(); } @@ -263,7 +330,6 @@ public static TransportChannelProvider defaultTransportChannelProvider() { return ConfigServiceV2StubSettings.defaultTransportChannelProvider(); } - @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { return ConfigServiceV2StubSettings.defaultApiClientHeaderProviderBuilder(); } @@ -451,6 +517,28 @@ public UnaryCallSettings.Builder deleteExclusionS 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/test/integration/goldens/logging/src/com/google/cloud/logging/v2/LoggingClient.java b/test/integration/goldens/logging/src/com/google/cloud/logging/v2/LoggingClient.java index c67e1072fe..9390d279af 100644 --- a/test/integration/goldens/logging/src/com/google/cloud/logging/v2/LoggingClient.java +++ b/test/integration/goldens/logging/src/com/google/cloud/logging/v2/LoggingClient.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -76,19 +76,119 @@ *

        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(). * - *

        The surface of this class includes several types of Java methods for each of the API's - * methods: - * - *

          - *
        1. A "flattened" method. With this type of method, the fields of the request type have been - * converted into function parameters. It may be the case that not all fields are available as - * parameters, and not every API method will have a flattened method entry point. - *
        2. A "request object" method. This type of method only takes one parameter, a request object, - * which must be constructed before the call. Not every API method will have a request object - * method. - *
        3. A "callable" method. This type of method takes no parameters and returns an immutable API - * callable object, which can be used to initiate calls to the service. - *
        + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + *
        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. * @@ -178,9 +278,10 @@ public LoggingServiceV2Stub getStub() { // AUTO-GENERATED DOCUMENTATION AND METHOD. /** - * Deletes all the log entries in a log. 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. + * 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: * @@ -197,11 +298,15 @@ public LoggingServiceV2Stub getStub() { * }

        * * @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]" + *

          + *
        • `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/1234567890/logs/cloudresourcemanager.googleapis.com%2Factivity"`. For more - * information about log names, see [LogEntry][google.logging.v2.LogEntry]. + * `"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) { @@ -214,9 +319,10 @@ public final void deleteLog(LogName logName) { // AUTO-GENERATED DOCUMENTATION AND METHOD. /** - * Deletes all the log entries in a log. 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. + * 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: * @@ -233,11 +339,15 @@ public final void deleteLog(LogName 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]" + *

          + *
        • `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/1234567890/logs/cloudresourcemanager.googleapis.com%2Factivity"`. For more - * information about log names, see [LogEntry][google.logging.v2.LogEntry]. + * `"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) { @@ -247,9 +357,10 @@ public final void deleteLog(String logName) { // AUTO-GENERATED DOCUMENTATION AND METHOD. /** - * Deletes all the log entries in a log. 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. + * 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: * @@ -277,9 +388,10 @@ public final void deleteLog(DeleteLogRequest request) { // AUTO-GENERATED DOCUMENTATION AND METHOD. /** - * Deletes all the log entries in a log. 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. + * 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: * @@ -331,11 +443,15 @@ public final UnaryCallable deleteLogCallable() { * * @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]" + *

          + *
        • `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/1234567890/logs/cloudresourcemanager.googleapis.com%2Factivity" + * "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. @@ -359,14 +475,14 @@ public final UnaryCallable deleteLogCallable() { * 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/quota-policy) 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 + * 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/quota-policy) 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. + * 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( @@ -411,11 +527,15 @@ public final WriteLogEntriesResponse writeLogEntries( * * @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]" + *

          + *
        • `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/1234567890/logs/cloudresourcemanager.googleapis.com%2Factivity" + * "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. @@ -439,14 +559,14 @@ public final WriteLogEntriesResponse writeLogEntries( * 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/quota-policy) 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 + * 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/quota-policy) 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. + * 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( @@ -564,13 +684,19 @@ public final WriteLogEntriesResponse writeLogEntries(WriteLogEntriesRequest requ * * @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] - * organization/[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/[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. * @param filter Optional. A filter that chooses which log entries to return. See [Advanced Logs * Queries](https://cloud.google.com/logging/docs/view/advanced-queries). Only log entries @@ -839,8 +965,13 @@ public final ListMonitoredResourceDescriptorsPagedResponse listMonitoredResource * } * * @param parent Required. The resource name that owns the logs: - *

        "projects/[PROJECT_ID]" "organizations/[ORGANIZATION_ID]" - * "billingAccounts/[BILLING_ACCOUNT_ID]" "folders/[FOLDER_ID]" + *

          + *
        • `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) { @@ -871,8 +1002,13 @@ public final ListLogsPagedResponse listLogs(BillingAccountName parent) { * } * * @param parent Required. The resource name that owns the logs: - *

        "projects/[PROJECT_ID]" "organizations/[ORGANIZATION_ID]" - * "billingAccounts/[BILLING_ACCOUNT_ID]" "folders/[FOLDER_ID]" + *

          + *
        • `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) { @@ -903,8 +1039,13 @@ public final ListLogsPagedResponse listLogs(FolderName parent) { * } * * @param parent Required. The resource name that owns the logs: - *

        "projects/[PROJECT_ID]" "organizations/[ORGANIZATION_ID]" - * "billingAccounts/[BILLING_ACCOUNT_ID]" "folders/[FOLDER_ID]" + *

          + *
        • `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) { @@ -935,8 +1076,13 @@ public final ListLogsPagedResponse listLogs(OrganizationName parent) { * } * * @param parent Required. The resource name that owns the logs: - *

        "projects/[PROJECT_ID]" "organizations/[ORGANIZATION_ID]" - * "billingAccounts/[BILLING_ACCOUNT_ID]" "folders/[FOLDER_ID]" + *

          + *
        • `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) { @@ -967,8 +1113,13 @@ public final ListLogsPagedResponse listLogs(ProjectName parent) { * } * * @param parent Required. The resource name that owns the logs: - *

        "projects/[PROJECT_ID]" "organizations/[ORGANIZATION_ID]" - * "billingAccounts/[BILLING_ACCOUNT_ID]" "folders/[FOLDER_ID]" + *

          + *
        • `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) { diff --git a/test/integration/goldens/logging/src/com/google/cloud/logging/v2/LoggingClientTest.java b/test/integration/goldens/logging/src/com/google/cloud/logging/v2/LoggingClientTest.java index 61703421ae..da2bff393b 100644 --- a/test/integration/goldens/logging/src/com/google/cloud/logging/v2/LoggingClientTest.java +++ b/test/integration/goldens/logging/src/com/google/cloud/logging/v2/LoggingClientTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/logging/src/com/google/cloud/logging/v2/LoggingSettings.java b/test/integration/goldens/logging/src/com/google/cloud/logging/v2/LoggingSettings.java index 6d0d9a3091..1a740d51f0 100644 --- a/test/integration/goldens/logging/src/com/google/cloud/logging/v2/LoggingSettings.java +++ b/test/integration/goldens/logging/src/com/google/cloud/logging/v2/LoggingSettings.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -21,7 +21,6 @@ import static com.google.cloud.logging.v2.LoggingClient.ListMonitoredResourceDescriptorsPagedResponse; import com.google.api.core.ApiFunction; -import com.google.api.core.BetaApi; import com.google.api.gax.core.GoogleCredentialsProvider; import com.google.api.gax.core.InstantiatingExecutorProvider; import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; @@ -66,7 +65,9 @@ *

        The builder of this class is recursive, so contained classes are themselves builders. When * build() is called, the tree of builders is called to create the complete settings object. * - *

        For example, to set the total timeout of deleteLog to 30 seconds: + *

        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.
        @@ -82,10 +83,21 @@
          *             .deleteLogSettings()
          *             .getRetrySettings()
          *             .toBuilder()
        - *             .setTotalTimeout(Duration.ofSeconds(30))
        + *             .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://docs.cloud.google.com/java/docs/client-retries) for additional support in setting + * retries. */ @Generated("by gapic-generator-java") public class LoggingSettings extends ClientSettings { @@ -163,7 +175,6 @@ public static TransportChannelProvider defaultTransportChannelProvider() { return LoggingServiceV2StubSettings.defaultTransportChannelProvider(); } - @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { return LoggingServiceV2StubSettings.defaultApiClientHeaderProviderBuilder(); } diff --git a/test/integration/goldens/logging/src/com/google/cloud/logging/v2/MetricsClient.java b/test/integration/goldens/logging/src/com/google/cloud/logging/v2/MetricsClient.java index 067ea58e90..8ee3f62074 100644 --- a/test/integration/goldens/logging/src/com/google/cloud/logging/v2/MetricsClient.java +++ b/test/integration/goldens/logging/src/com/google/cloud/logging/v2/MetricsClient.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -64,19 +64,110 @@ *

        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(). * - *

        The surface of this class includes several types of Java methods for each of the API's - * methods: - * - *

          - *
        1. A "flattened" method. With this type of method, the fields of the request type have been - * converted into function parameters. It may be the case that not all fields are available as - * parameters, and not every API method will have a flattened method entry point. - *
        2. A "request object" method. This type of method only takes one parameter, a request object, - * which must be constructed before the call. Not every API method will have a request object - * method. - *
        3. A "callable" method. This type of method takes no parameters and returns an immutable API - * callable object, which can be used to initiate calls to the service. - *
        + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + *
        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. * diff --git a/test/integration/goldens/logging/src/com/google/cloud/logging/v2/MetricsClientTest.java b/test/integration/goldens/logging/src/com/google/cloud/logging/v2/MetricsClientTest.java index 8fad9fa8cf..9451a27f6e 100644 --- a/test/integration/goldens/logging/src/com/google/cloud/logging/v2/MetricsClientTest.java +++ b/test/integration/goldens/logging/src/com/google/cloud/logging/v2/MetricsClientTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -187,6 +187,7 @@ public void getLogMetricTest() throws Exception { .setName(LogMetricName.of("[PROJECT]", "[METRIC]").toString()) .setDescription("description-1724546052") .setFilter("filter-1274492040") + .setDisabled(true) .setMetricDescriptor(MetricDescriptor.newBuilder().build()) .setValueExtractor("valueExtractor-1867420749") .putAllLabelExtractors(new HashMap()) @@ -233,6 +234,7 @@ public void getLogMetricTest2() throws Exception { .setName(LogMetricName.of("[PROJECT]", "[METRIC]").toString()) .setDescription("description-1724546052") .setFilter("filter-1274492040") + .setDisabled(true) .setMetricDescriptor(MetricDescriptor.newBuilder().build()) .setValueExtractor("valueExtractor-1867420749") .putAllLabelExtractors(new HashMap()) @@ -279,6 +281,7 @@ public void createLogMetricTest() throws Exception { .setName(LogMetricName.of("[PROJECT]", "[METRIC]").toString()) .setDescription("description-1724546052") .setFilter("filter-1274492040") + .setDisabled(true) .setMetricDescriptor(MetricDescriptor.newBuilder().build()) .setValueExtractor("valueExtractor-1867420749") .putAllLabelExtractors(new HashMap()) @@ -328,6 +331,7 @@ public void createLogMetricTest2() throws Exception { .setName(LogMetricName.of("[PROJECT]", "[METRIC]").toString()) .setDescription("description-1724546052") .setFilter("filter-1274492040") + .setDisabled(true) .setMetricDescriptor(MetricDescriptor.newBuilder().build()) .setValueExtractor("valueExtractor-1867420749") .putAllLabelExtractors(new HashMap()) @@ -377,6 +381,7 @@ public void updateLogMetricTest() throws Exception { .setName(LogMetricName.of("[PROJECT]", "[METRIC]").toString()) .setDescription("description-1724546052") .setFilter("filter-1274492040") + .setDisabled(true) .setMetricDescriptor(MetricDescriptor.newBuilder().build()) .setValueExtractor("valueExtractor-1867420749") .putAllLabelExtractors(new HashMap()) @@ -426,6 +431,7 @@ public void updateLogMetricTest2() throws Exception { .setName(LogMetricName.of("[PROJECT]", "[METRIC]").toString()) .setDescription("description-1724546052") .setFilter("filter-1274492040") + .setDisabled(true) .setMetricDescriptor(MetricDescriptor.newBuilder().build()) .setValueExtractor("valueExtractor-1867420749") .putAllLabelExtractors(new HashMap()) diff --git a/test/integration/goldens/logging/src/com/google/cloud/logging/v2/MetricsSettings.java b/test/integration/goldens/logging/src/com/google/cloud/logging/v2/MetricsSettings.java index 867d57d2e7..2176a3c1e1 100644 --- a/test/integration/goldens/logging/src/com/google/cloud/logging/v2/MetricsSettings.java +++ b/test/integration/goldens/logging/src/com/google/cloud/logging/v2/MetricsSettings.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -19,7 +19,6 @@ import static com.google.cloud.logging.v2.MetricsClient.ListLogMetricsPagedResponse; import com.google.api.core.ApiFunction; -import com.google.api.core.BetaApi; import com.google.api.gax.core.GoogleCredentialsProvider; import com.google.api.gax.core.InstantiatingExecutorProvider; import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; @@ -58,7 +57,9 @@ *

        The builder of this class is recursive, so contained classes are themselves builders. When * build() is called, the tree of builders is called to create the complete settings object. * - *

        For example, to set the total timeout of getLogMetric to 30 seconds: + *

        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.
        @@ -74,10 +75,21 @@
          *             .getLogMetricSettings()
          *             .getRetrySettings()
          *             .toBuilder()
        - *             .setTotalTimeout(Duration.ofSeconds(30))
        + *             .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://docs.cloud.google.com/java/docs/client-retries) for additional support in setting + * retries. */ @Generated("by gapic-generator-java") public class MetricsSettings extends ClientSettings { @@ -142,7 +154,6 @@ public static TransportChannelProvider defaultTransportChannelProvider() { return MetricsServiceV2StubSettings.defaultTransportChannelProvider(); } - @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { return MetricsServiceV2StubSettings.defaultApiClientHeaderProviderBuilder(); } diff --git a/test/integration/goldens/logging/src/com/google/cloud/logging/v2/MockConfigServiceV2.java b/test/integration/goldens/logging/src/com/google/cloud/logging/v2/MockConfigServiceV2.java index cb64ac5a2a..c7ebe0ffe3 100644 --- a/test/integration/goldens/logging/src/com/google/cloud/logging/v2/MockConfigServiceV2.java +++ b/test/integration/goldens/logging/src/com/google/cloud/logging/v2/MockConfigServiceV2.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/logging/src/com/google/cloud/logging/v2/MockConfigServiceV2Impl.java b/test/integration/goldens/logging/src/com/google/cloud/logging/v2/MockConfigServiceV2Impl.java index 1a5b82d72e..aa425064c3 100644 --- a/test/integration/goldens/logging/src/com/google/cloud/logging/v2/MockConfigServiceV2Impl.java +++ b/test/integration/goldens/logging/src/com/google/cloud/logging/v2/MockConfigServiceV2Impl.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -19,6 +19,7 @@ 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.CreateSinkRequest; @@ -30,6 +31,7 @@ import com.google.logging.v2.GetBucketRequest; import com.google.logging.v2.GetCmekSettingsRequest; import com.google.logging.v2.GetExclusionRequest; +import com.google.logging.v2.GetSettingsRequest; import com.google.logging.v2.GetSinkRequest; import com.google.logging.v2.GetViewRequest; import com.google.logging.v2.ListBucketsRequest; @@ -44,12 +46,15 @@ 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; @@ -563,4 +568,66 @@ public void updateCmekSettings( 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/test/integration/goldens/logging/src/com/google/cloud/logging/v2/MockLoggingServiceV2.java b/test/integration/goldens/logging/src/com/google/cloud/logging/v2/MockLoggingServiceV2.java index 73bed218b1..566b2df325 100644 --- a/test/integration/goldens/logging/src/com/google/cloud/logging/v2/MockLoggingServiceV2.java +++ b/test/integration/goldens/logging/src/com/google/cloud/logging/v2/MockLoggingServiceV2.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/logging/src/com/google/cloud/logging/v2/MockLoggingServiceV2Impl.java b/test/integration/goldens/logging/src/com/google/cloud/logging/v2/MockLoggingServiceV2Impl.java index 8f56264bea..a70879ab03 100644 --- a/test/integration/goldens/logging/src/com/google/cloud/logging/v2/MockLoggingServiceV2Impl.java +++ b/test/integration/goldens/logging/src/com/google/cloud/logging/v2/MockLoggingServiceV2Impl.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/logging/src/com/google/cloud/logging/v2/MockMetricsServiceV2.java b/test/integration/goldens/logging/src/com/google/cloud/logging/v2/MockMetricsServiceV2.java index 340c8328ea..75cb84fb9c 100644 --- a/test/integration/goldens/logging/src/com/google/cloud/logging/v2/MockMetricsServiceV2.java +++ b/test/integration/goldens/logging/src/com/google/cloud/logging/v2/MockMetricsServiceV2.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/logging/src/com/google/cloud/logging/v2/MockMetricsServiceV2Impl.java b/test/integration/goldens/logging/src/com/google/cloud/logging/v2/MockMetricsServiceV2Impl.java index 35187863e3..2e322e1da6 100644 --- a/test/integration/goldens/logging/src/com/google/cloud/logging/v2/MockMetricsServiceV2Impl.java +++ b/test/integration/goldens/logging/src/com/google/cloud/logging/v2/MockMetricsServiceV2Impl.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/logging/src/com/google/cloud/logging/v2/gapic_metadata.json b/test/integration/goldens/logging/src/com/google/cloud/logging/v2/gapic_metadata.json index 19d23c6761..3f7d36cb85 100644 --- a/test/integration/goldens/logging/src/com/google/cloud/logging/v2/gapic_metadata.json +++ b/test/integration/goldens/logging/src/com/google/cloud/logging/v2/gapic_metadata.json @@ -37,6 +37,9 @@ "grpc": { "libraryClient": "ConfigClient", "rpcs": { + "CopyLogEntries": { + "methods": ["copyLogEntriesAsync", "copyLogEntriesOperationCallable", "copyLogEntriesCallable"] + }, "CreateBucket": { "methods": ["createBucket", "createBucketCallable"] }, @@ -70,6 +73,9 @@ "GetExclusion": { "methods": ["getExclusion", "getExclusion", "getExclusion", "getExclusionCallable"] }, + "GetSettings": { + "methods": ["getSettings", "getSettings", "getSettings", "getSettingsCallable"] + }, "GetSink": { "methods": ["getSink", "getSink", "getSink", "getSinkCallable"] }, @@ -100,6 +106,9 @@ "UpdateExclusion": { "methods": ["updateExclusion", "updateExclusion", "updateExclusion", "updateExclusionCallable"] }, + "UpdateSettings": { + "methods": ["updateSettings", "updateSettings", "updateSettingsCallable"] + }, "UpdateSink": { "methods": ["updateSink", "updateSink", "updateSink", "updateSink", "updateSink", "updateSinkCallable"] }, diff --git a/test/integration/goldens/logging/src/com/google/cloud/logging/v2/package-info.java b/test/integration/goldens/logging/src/com/google/cloud/logging/v2/package-info.java index 6f71d583a8..0295367127 100644 --- a/test/integration/goldens/logging/src/com/google/cloud/logging/v2/package-info.java +++ b/test/integration/goldens/logging/src/com/google/cloud/logging/v2/package-info.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,7 +15,9 @@ */ /** - * The interfaces provided are listed below, along with usage samples. + * A client to Cloud Logging API + * + *

        The interfaces provided are listed below, along with usage samples. * *

        ======================= LoggingClient ======================= * diff --git a/test/integration/goldens/logging/src/com/google/cloud/logging/v2/stub/ConfigServiceV2Stub.java b/test/integration/goldens/logging/src/com/google/cloud/logging/v2/stub/ConfigServiceV2Stub.java index dfb8040457..87d63ca97d 100644 --- a/test/integration/goldens/logging/src/com/google/cloud/logging/v2/stub/ConfigServiceV2Stub.java +++ b/test/integration/goldens/logging/src/com/google/cloud/logging/v2/stub/ConfigServiceV2Stub.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -22,8 +22,12 @@ 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.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.CreateSinkRequest; @@ -35,6 +39,7 @@ import com.google.logging.v2.GetBucketRequest; import com.google.logging.v2.GetCmekSettingsRequest; import com.google.logging.v2.GetExclusionRequest; +import com.google.logging.v2.GetSettingsRequest; import com.google.logging.v2.GetSinkRequest; import com.google.logging.v2.GetViewRequest; import com.google.logging.v2.ListBucketsRequest; @@ -49,12 +54,16 @@ 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; @@ -67,6 +76,10 @@ @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()"); } @@ -176,6 +189,23 @@ public UnaryCallable updateCmekSettings 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/test/integration/goldens/logging/src/com/google/cloud/logging/v2/stub/ConfigServiceV2StubSettings.java b/test/integration/goldens/logging/src/com/google/cloud/logging/v2/stub/ConfigServiceV2StubSettings.java index 87580db564..d96599c8aa 100644 --- a/test/integration/goldens/logging/src/com/google/cloud/logging/v2/stub/ConfigServiceV2StubSettings.java +++ b/test/integration/goldens/logging/src/com/google/cloud/logging/v2/stub/ConfigServiceV2StubSettings.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -23,17 +23,22 @@ import com.google.api.core.ApiFunction; import com.google.api.core.ApiFuture; -import com.google.api.core.BetaApi; +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.LibraryMetadata; +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; @@ -48,6 +53,9 @@ import com.google.common.collect.ImmutableSet; import com.google.common.collect.Lists; 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.CreateSinkRequest; @@ -59,6 +67,7 @@ import com.google.logging.v2.GetBucketRequest; import com.google.logging.v2.GetCmekSettingsRequest; import com.google.logging.v2.GetExclusionRequest; +import com.google.logging.v2.GetSettingsRequest; import com.google.logging.v2.GetSinkRequest; import com.google.logging.v2.GetViewRequest; import com.google.logging.v2.ListBucketsRequest; @@ -73,17 +82,20 @@ 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; -import org.threeten.bp.Duration; // AUTO-GENERATED DOCUMENTATION AND CLASS. /** @@ -100,7 +112,9 @@ *

        The builder of this class is recursive, so contained classes are themselves builders. When * build() is called, the tree of builders is called to create the complete settings object. * - *

        For example, to set the total timeout of getBucket to 30 seconds: + *

        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.
        @@ -117,12 +131,50 @@
          *             .getBucketSettings()
          *             .getRetrySettings()
          *             .toBuilder()
        - *             .setTotalTimeout(Duration.ofSeconds(30))
        + *             .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://docs.cloud.google.com/java/docs/client-retries) 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 copyLogEntries: + * + *

        {@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") +@SuppressWarnings("CanonicalDuration") public class ConfigServiceV2StubSettings extends StubSettings { /** The default scopes of the service. */ private static final ImmutableList DEFAULT_SERVICE_SCOPES = @@ -162,6 +214,12 @@ public class ConfigServiceV2StubSettings extends StubSettings 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 = @@ -193,9 +251,7 @@ public String extractNextToken(ListBucketsResponse payload) { @Override public Iterable extractResources(ListBucketsResponse payload) { - return payload.getBucketsList() == null - ? ImmutableList.of() - : payload.getBucketsList(); + return payload.getBucketsList(); } }; @@ -229,9 +285,7 @@ public String extractNextToken(ListViewsResponse payload) { @Override public Iterable extractResources(ListViewsResponse payload) { - return payload.getViewsList() == null - ? ImmutableList.of() - : payload.getViewsList(); + return payload.getViewsList(); } }; @@ -265,9 +319,7 @@ public String extractNextToken(ListSinksResponse payload) { @Override public Iterable extractResources(ListSinksResponse payload) { - return payload.getSinksList() == null - ? ImmutableList.of() - : payload.getSinksList(); + return payload.getSinksList(); } }; @@ -303,9 +355,7 @@ public String extractNextToken(ListExclusionsResponse payload) { @Override public Iterable extractResources(ListExclusionsResponse payload) { - return payload.getExclusionsList() == null - ? ImmutableList.of() - : payload.getExclusionsList(); + return payload.getExclusionsList(); } }; @@ -497,6 +547,28 @@ public UnaryCallSettings updateCmekSett 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() @@ -508,12 +580,19 @@ public ConfigServiceV2Stub createStub() throws IOException { "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"; } @@ -545,7 +624,6 @@ public static TransportChannelProvider defaultTransportChannelProvider() { return defaultGrpcTransportProviderBuilder().build(); } - @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { return ApiClientHeaderProvider.newBuilder() .setGeneratedLibToken( @@ -595,6 +673,15 @@ protected ConfigServiceV2StubSettings(Builder settingsBuilder) throws IOExceptio 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(); + } + + @Override + protected LibraryMetadata getLibraryMetadata() { + return LibraryMetadata.newBuilder().setVersion(Version.VERSION).build(); } /** Builder for ConfigServiceV2StubSettings. */ @@ -635,6 +722,13 @@ public static class Builder extends StubSettings.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; @@ -663,21 +757,21 @@ public static class Builder extends StubSettings.Builder>of( @@ -738,7 +836,10 @@ protected Builder(ClientContext clientContext) { updateExclusionSettings, deleteExclusionSettings, getCmekSettingsSettings, - updateCmekSettingsSettings); + updateCmekSettingsSettings, + getSettingsSettings, + updateSettingsSettings, + copyLogEntriesSettings); initDefaults(this); } @@ -768,6 +869,10 @@ protected Builder(ConfigServiceV2StubSettings settings) { 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( @@ -793,7 +898,10 @@ protected Builder(ConfigServiceV2StubSettings settings) { updateExclusionSettings, deleteExclusionSettings, getCmekSettingsSettings, - updateCmekSettingsSettings); + updateCmekSettingsSettings, + getSettingsSettings, + updateSettingsSettings, + copyLogEntriesSettings); } private static Builder createDefault() { @@ -802,7 +910,6 @@ private static Builder createDefault() { builder.setTransportChannelProvider(defaultTransportChannelProvider()); builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); builder.setInternalHeaderProvider(defaultApiClientHeaderProviderBuilder().build()); - builder.setEndpoint(getDefaultEndpoint()); builder.setMtlsEndpoint(getDefaultMtlsEndpoint()); builder.setSwitchToMtlsEndpointAllowed(true); @@ -925,6 +1032,45 @@ private static Builder initDefaults(Builder builder) { .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 + .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; } @@ -1068,6 +1214,28 @@ public UnaryCallSettings.Builder deleteExclusionS 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/test/integration/goldens/logging/src/com/google/cloud/logging/v2/stub/GrpcConfigServiceV2CallableFactory.java b/test/integration/goldens/logging/src/com/google/cloud/logging/v2/stub/GrpcConfigServiceV2CallableFactory.java index 024b57a415..e37c3746ba 100644 --- a/test/integration/goldens/logging/src/com/google/cloud/logging/v2/stub/GrpcConfigServiceV2CallableFactory.java +++ b/test/integration/goldens/logging/src/com/google/cloud/logging/v2/stub/GrpcConfigServiceV2CallableFactory.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/logging/src/com/google/cloud/logging/v2/stub/GrpcConfigServiceV2Stub.java b/test/integration/goldens/logging/src/com/google/cloud/logging/v2/stub/GrpcConfigServiceV2Stub.java index 89bfa0872d..424b550eec 100644 --- a/test/integration/goldens/logging/src/com/google/cloud/logging/v2/stub/GrpcConfigServiceV2Stub.java +++ b/test/integration/goldens/logging/src/com/google/cloud/logging/v2/stub/GrpcConfigServiceV2Stub.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -26,9 +26,13 @@ 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.common.collect.ImmutableMap; 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.CreateSinkRequest; @@ -40,6 +44,7 @@ import com.google.logging.v2.GetBucketRequest; import com.google.logging.v2.GetCmekSettingsRequest; import com.google.logging.v2.GetExclusionRequest; +import com.google.logging.v2.GetSettingsRequest; import com.google.logging.v2.GetSinkRequest; import com.google.logging.v2.GetViewRequest; import com.google.logging.v2.ListBucketsRequest; @@ -54,12 +59,15 @@ 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; @@ -85,6 +93,7 @@ public class GrpcConfigServiceV2Stub extends ConfigServiceV2Stub { .setRequestMarshaller(ProtoUtils.marshaller(ListBucketsRequest.getDefaultInstance())) .setResponseMarshaller( ProtoUtils.marshaller(ListBucketsResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) .build(); private static final MethodDescriptor getBucketMethodDescriptor = @@ -93,6 +102,7 @@ public class GrpcConfigServiceV2Stub extends ConfigServiceV2Stub { .setFullMethodName("google.logging.v2.ConfigServiceV2/GetBucket") .setRequestMarshaller(ProtoUtils.marshaller(GetBucketRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(LogBucket.getDefaultInstance())) + .setSampledToLocalTracing(true) .build(); private static final MethodDescriptor @@ -102,6 +112,7 @@ public class GrpcConfigServiceV2Stub extends ConfigServiceV2Stub { .setFullMethodName("google.logging.v2.ConfigServiceV2/CreateBucket") .setRequestMarshaller(ProtoUtils.marshaller(CreateBucketRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(LogBucket.getDefaultInstance())) + .setSampledToLocalTracing(true) .build(); private static final MethodDescriptor @@ -111,6 +122,7 @@ public class GrpcConfigServiceV2Stub extends ConfigServiceV2Stub { .setFullMethodName("google.logging.v2.ConfigServiceV2/UpdateBucket") .setRequestMarshaller(ProtoUtils.marshaller(UpdateBucketRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(LogBucket.getDefaultInstance())) + .setSampledToLocalTracing(true) .build(); private static final MethodDescriptor deleteBucketMethodDescriptor = @@ -119,6 +131,7 @@ public class GrpcConfigServiceV2Stub extends ConfigServiceV2Stub { .setFullMethodName("google.logging.v2.ConfigServiceV2/DeleteBucket") .setRequestMarshaller(ProtoUtils.marshaller(DeleteBucketRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(Empty.getDefaultInstance())) + .setSampledToLocalTracing(true) .build(); private static final MethodDescriptor @@ -129,6 +142,7 @@ public class GrpcConfigServiceV2Stub extends ConfigServiceV2Stub { .setRequestMarshaller( ProtoUtils.marshaller(UndeleteBucketRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(Empty.getDefaultInstance())) + .setSampledToLocalTracing(true) .build(); private static final MethodDescriptor @@ -138,6 +152,7 @@ public class GrpcConfigServiceV2Stub extends ConfigServiceV2Stub { .setFullMethodName("google.logging.v2.ConfigServiceV2/ListViews") .setRequestMarshaller(ProtoUtils.marshaller(ListViewsRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(ListViewsResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) .build(); private static final MethodDescriptor getViewMethodDescriptor = @@ -146,6 +161,7 @@ public class GrpcConfigServiceV2Stub extends ConfigServiceV2Stub { .setFullMethodName("google.logging.v2.ConfigServiceV2/GetView") .setRequestMarshaller(ProtoUtils.marshaller(GetViewRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(LogView.getDefaultInstance())) + .setSampledToLocalTracing(true) .build(); private static final MethodDescriptor createViewMethodDescriptor = @@ -154,6 +170,7 @@ public class GrpcConfigServiceV2Stub extends ConfigServiceV2Stub { .setFullMethodName("google.logging.v2.ConfigServiceV2/CreateView") .setRequestMarshaller(ProtoUtils.marshaller(CreateViewRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(LogView.getDefaultInstance())) + .setSampledToLocalTracing(true) .build(); private static final MethodDescriptor updateViewMethodDescriptor = @@ -162,6 +179,7 @@ public class GrpcConfigServiceV2Stub extends ConfigServiceV2Stub { .setFullMethodName("google.logging.v2.ConfigServiceV2/UpdateView") .setRequestMarshaller(ProtoUtils.marshaller(UpdateViewRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(LogView.getDefaultInstance())) + .setSampledToLocalTracing(true) .build(); private static final MethodDescriptor deleteViewMethodDescriptor = @@ -170,6 +188,7 @@ public class GrpcConfigServiceV2Stub extends ConfigServiceV2Stub { .setFullMethodName("google.logging.v2.ConfigServiceV2/DeleteView") .setRequestMarshaller(ProtoUtils.marshaller(DeleteViewRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(Empty.getDefaultInstance())) + .setSampledToLocalTracing(true) .build(); private static final MethodDescriptor @@ -179,6 +198,7 @@ public class GrpcConfigServiceV2Stub extends ConfigServiceV2Stub { .setFullMethodName("google.logging.v2.ConfigServiceV2/ListSinks") .setRequestMarshaller(ProtoUtils.marshaller(ListSinksRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(ListSinksResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) .build(); private static final MethodDescriptor getSinkMethodDescriptor = @@ -187,6 +207,7 @@ public class GrpcConfigServiceV2Stub extends ConfigServiceV2Stub { .setFullMethodName("google.logging.v2.ConfigServiceV2/GetSink") .setRequestMarshaller(ProtoUtils.marshaller(GetSinkRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(LogSink.getDefaultInstance())) + .setSampledToLocalTracing(true) .build(); private static final MethodDescriptor createSinkMethodDescriptor = @@ -195,6 +216,7 @@ public class GrpcConfigServiceV2Stub extends ConfigServiceV2Stub { .setFullMethodName("google.logging.v2.ConfigServiceV2/CreateSink") .setRequestMarshaller(ProtoUtils.marshaller(CreateSinkRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(LogSink.getDefaultInstance())) + .setSampledToLocalTracing(true) .build(); private static final MethodDescriptor updateSinkMethodDescriptor = @@ -203,6 +225,7 @@ public class GrpcConfigServiceV2Stub extends ConfigServiceV2Stub { .setFullMethodName("google.logging.v2.ConfigServiceV2/UpdateSink") .setRequestMarshaller(ProtoUtils.marshaller(UpdateSinkRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(LogSink.getDefaultInstance())) + .setSampledToLocalTracing(true) .build(); private static final MethodDescriptor deleteSinkMethodDescriptor = @@ -211,6 +234,7 @@ public class GrpcConfigServiceV2Stub extends ConfigServiceV2Stub { .setFullMethodName("google.logging.v2.ConfigServiceV2/DeleteSink") .setRequestMarshaller(ProtoUtils.marshaller(DeleteSinkRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(Empty.getDefaultInstance())) + .setSampledToLocalTracing(true) .build(); private static final MethodDescriptor @@ -222,6 +246,7 @@ public class GrpcConfigServiceV2Stub extends ConfigServiceV2Stub { ProtoUtils.marshaller(ListExclusionsRequest.getDefaultInstance())) .setResponseMarshaller( ProtoUtils.marshaller(ListExclusionsResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) .build(); private static final MethodDescriptor @@ -231,6 +256,7 @@ public class GrpcConfigServiceV2Stub extends ConfigServiceV2Stub { .setFullMethodName("google.logging.v2.ConfigServiceV2/GetExclusion") .setRequestMarshaller(ProtoUtils.marshaller(GetExclusionRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(LogExclusion.getDefaultInstance())) + .setSampledToLocalTracing(true) .build(); private static final MethodDescriptor @@ -241,6 +267,7 @@ public class GrpcConfigServiceV2Stub extends ConfigServiceV2Stub { .setRequestMarshaller( ProtoUtils.marshaller(CreateExclusionRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(LogExclusion.getDefaultInstance())) + .setSampledToLocalTracing(true) .build(); private static final MethodDescriptor @@ -251,6 +278,7 @@ public class GrpcConfigServiceV2Stub extends ConfigServiceV2Stub { .setRequestMarshaller( ProtoUtils.marshaller(UpdateExclusionRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(LogExclusion.getDefaultInstance())) + .setSampledToLocalTracing(true) .build(); private static final MethodDescriptor @@ -261,6 +289,7 @@ public class GrpcConfigServiceV2Stub extends ConfigServiceV2Stub { .setRequestMarshaller( ProtoUtils.marshaller(DeleteExclusionRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(Empty.getDefaultInstance())) + .setSampledToLocalTracing(true) .build(); private static final MethodDescriptor @@ -271,6 +300,7 @@ public class GrpcConfigServiceV2Stub extends ConfigServiceV2Stub { .setRequestMarshaller( ProtoUtils.marshaller(GetCmekSettingsRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(CmekSettings.getDefaultInstance())) + .setSampledToLocalTracing(true) .build(); private static final MethodDescriptor @@ -281,6 +311,38 @@ public class GrpcConfigServiceV2Stub extends ConfigServiceV2Stub { .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; @@ -312,6 +374,12 @@ public class GrpcConfigServiceV2Stub extends ConfigServiceV2Stub { 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; @@ -362,69 +430,75 @@ protected GrpcConfigServiceV2Stub( .setMethodDescriptor(listBucketsMethodDescriptor) .setParamsExtractor( request -> { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("parent", String.valueOf(request.getParent())); - return params.build(); + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); }) + .setResourceNameExtractor(request -> request.getParent()) .build(); GrpcCallSettings getBucketTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(getBucketMethodDescriptor) .setParamsExtractor( request -> { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("name", String.valueOf(request.getName())); - return params.build(); + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); }) + .setResourceNameExtractor(request -> request.getName()) .build(); GrpcCallSettings createBucketTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(createBucketMethodDescriptor) .setParamsExtractor( request -> { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("parent", String.valueOf(request.getParent())); - return params.build(); + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); }) + .setResourceNameExtractor(request -> request.getParent()) .build(); GrpcCallSettings updateBucketTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(updateBucketMethodDescriptor) .setParamsExtractor( request -> { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("name", String.valueOf(request.getName())); - return params.build(); + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); }) + .setResourceNameExtractor(request -> request.getName()) .build(); GrpcCallSettings deleteBucketTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(deleteBucketMethodDescriptor) .setParamsExtractor( request -> { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("name", String.valueOf(request.getName())); - return params.build(); + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); }) + .setResourceNameExtractor(request -> request.getName()) .build(); GrpcCallSettings undeleteBucketTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(undeleteBucketMethodDescriptor) .setParamsExtractor( request -> { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("name", String.valueOf(request.getName())); - return params.build(); + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); }) + .setResourceNameExtractor(request -> request.getName()) .build(); GrpcCallSettings listViewsTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(listViewsMethodDescriptor) .setParamsExtractor( request -> { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("parent", String.valueOf(request.getParent())); - return params.build(); + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); }) .build(); GrpcCallSettings getViewTransportSettings = @@ -432,19 +506,20 @@ protected GrpcConfigServiceV2Stub( .setMethodDescriptor(getViewMethodDescriptor) .setParamsExtractor( request -> { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("name", String.valueOf(request.getName())); - return params.build(); + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); }) + .setResourceNameExtractor(request -> request.getName()) .build(); GrpcCallSettings createViewTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(createViewMethodDescriptor) .setParamsExtractor( request -> { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("parent", String.valueOf(request.getParent())); - return params.build(); + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); }) .build(); GrpcCallSettings updateViewTransportSettings = @@ -452,9 +527,9 @@ protected GrpcConfigServiceV2Stub( .setMethodDescriptor(updateViewMethodDescriptor) .setParamsExtractor( request -> { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("name", String.valueOf(request.getName())); - return params.build(); + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); }) .build(); GrpcCallSettings deleteViewTransportSettings = @@ -462,60 +537,66 @@ protected GrpcConfigServiceV2Stub( .setMethodDescriptor(deleteViewMethodDescriptor) .setParamsExtractor( request -> { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("name", String.valueOf(request.getName())); - return params.build(); + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); }) + .setResourceNameExtractor(request -> request.getName()) .build(); GrpcCallSettings listSinksTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(listSinksMethodDescriptor) .setParamsExtractor( request -> { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("parent", String.valueOf(request.getParent())); - return params.build(); + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); }) + .setResourceNameExtractor(request -> request.getParent()) .build(); GrpcCallSettings getSinkTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(getSinkMethodDescriptor) .setParamsExtractor( request -> { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("sink_name", String.valueOf(request.getSinkName())); - return params.build(); + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("sink_name", String.valueOf(request.getSinkName())); + return builder.build(); }) + .setResourceNameExtractor(request -> request.getSinkName()) .build(); GrpcCallSettings createSinkTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(createSinkMethodDescriptor) .setParamsExtractor( request -> { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("parent", String.valueOf(request.getParent())); - return params.build(); + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); }) + .setResourceNameExtractor(request -> request.getParent()) .build(); GrpcCallSettings updateSinkTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(updateSinkMethodDescriptor) .setParamsExtractor( request -> { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("sink_name", String.valueOf(request.getSinkName())); - return params.build(); + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("sink_name", String.valueOf(request.getSinkName())); + return builder.build(); }) + .setResourceNameExtractor(request -> request.getSinkName()) .build(); GrpcCallSettings deleteSinkTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(deleteSinkMethodDescriptor) .setParamsExtractor( request -> { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("sink_name", String.valueOf(request.getSinkName())); - return params.build(); + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("sink_name", String.valueOf(request.getSinkName())); + return builder.build(); }) + .setResourceNameExtractor(request -> request.getSinkName()) .build(); GrpcCallSettings listExclusionsTransportSettings = @@ -523,71 +604,102 @@ protected GrpcConfigServiceV2Stub( .setMethodDescriptor(listExclusionsMethodDescriptor) .setParamsExtractor( request -> { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("parent", String.valueOf(request.getParent())); - return params.build(); + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); }) + .setResourceNameExtractor(request -> request.getParent()) .build(); GrpcCallSettings getExclusionTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(getExclusionMethodDescriptor) .setParamsExtractor( request -> { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("name", String.valueOf(request.getName())); - return params.build(); + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); }) + .setResourceNameExtractor(request -> request.getName()) .build(); GrpcCallSettings createExclusionTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(createExclusionMethodDescriptor) .setParamsExtractor( request -> { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("parent", String.valueOf(request.getParent())); - return params.build(); + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); }) + .setResourceNameExtractor(request -> request.getParent()) .build(); GrpcCallSettings updateExclusionTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(updateExclusionMethodDescriptor) .setParamsExtractor( request -> { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("name", String.valueOf(request.getName())); - return params.build(); + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); }) + .setResourceNameExtractor(request -> request.getName()) .build(); GrpcCallSettings deleteExclusionTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(deleteExclusionMethodDescriptor) .setParamsExtractor( request -> { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("name", String.valueOf(request.getName())); - return params.build(); + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); }) + .setResourceNameExtractor(request -> request.getName()) .build(); GrpcCallSettings getCmekSettingsTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(getCmekSettingsMethodDescriptor) .setParamsExtractor( request -> { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("name", String.valueOf(request.getName())); - return params.build(); + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); }) + .setResourceNameExtractor(request -> request.getName()) .build(); GrpcCallSettings updateCmekSettingsTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(updateCmekSettingsMethodDescriptor) .setParamsExtractor( request -> { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("name", String.valueOf(request.getName())); - return params.build(); + 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(); + }) + .setResourceNameExtractor(request -> request.getName()) + .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( @@ -672,6 +784,21 @@ protected GrpcConfigServiceV2Stub( 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()); @@ -817,6 +944,27 @@ public UnaryCallable updateCmekSettings 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 { diff --git a/test/integration/goldens/logging/src/com/google/cloud/logging/v2/stub/GrpcLoggingServiceV2CallableFactory.java b/test/integration/goldens/logging/src/com/google/cloud/logging/v2/stub/GrpcLoggingServiceV2CallableFactory.java index 3a24803de5..2ea721e819 100644 --- a/test/integration/goldens/logging/src/com/google/cloud/logging/v2/stub/GrpcLoggingServiceV2CallableFactory.java +++ b/test/integration/goldens/logging/src/com/google/cloud/logging/v2/stub/GrpcLoggingServiceV2CallableFactory.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/logging/src/com/google/cloud/logging/v2/stub/GrpcLoggingServiceV2Stub.java b/test/integration/goldens/logging/src/com/google/cloud/logging/v2/stub/GrpcLoggingServiceV2Stub.java index 25f05280f4..4506485188 100644 --- a/test/integration/goldens/logging/src/com/google/cloud/logging/v2/stub/GrpcLoggingServiceV2Stub.java +++ b/test/integration/goldens/logging/src/com/google/cloud/logging/v2/stub/GrpcLoggingServiceV2Stub.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -26,8 +26,8 @@ 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.common.collect.ImmutableMap; import com.google.logging.v2.DeleteLogRequest; import com.google.logging.v2.ListLogEntriesRequest; import com.google.logging.v2.ListLogEntriesResponse; @@ -62,6 +62,7 @@ public class GrpcLoggingServiceV2Stub extends LoggingServiceV2Stub { .setFullMethodName("google.logging.v2.LoggingServiceV2/DeleteLog") .setRequestMarshaller(ProtoUtils.marshaller(DeleteLogRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(Empty.getDefaultInstance())) + .setSampledToLocalTracing(true) .build(); private static final MethodDescriptor @@ -73,6 +74,7 @@ public class GrpcLoggingServiceV2Stub extends LoggingServiceV2Stub { ProtoUtils.marshaller(WriteLogEntriesRequest.getDefaultInstance())) .setResponseMarshaller( ProtoUtils.marshaller(WriteLogEntriesResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) .build(); private static final MethodDescriptor @@ -84,6 +86,7 @@ public class GrpcLoggingServiceV2Stub extends LoggingServiceV2Stub { ProtoUtils.marshaller(ListLogEntriesRequest.getDefaultInstance())) .setResponseMarshaller( ProtoUtils.marshaller(ListLogEntriesResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) .build(); private static final MethodDescriptor< @@ -101,6 +104,7 @@ public class GrpcLoggingServiceV2Stub extends LoggingServiceV2Stub { .setResponseMarshaller( ProtoUtils.marshaller( ListMonitoredResourceDescriptorsResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) .build(); private static final MethodDescriptor @@ -110,6 +114,7 @@ public class GrpcLoggingServiceV2Stub extends LoggingServiceV2Stub { .setFullMethodName("google.logging.v2.LoggingServiceV2/ListLogs") .setRequestMarshaller(ProtoUtils.marshaller(ListLogsRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(ListLogsResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) .build(); private static final MethodDescriptor @@ -121,6 +126,7 @@ public class GrpcLoggingServiceV2Stub extends LoggingServiceV2Stub { ProtoUtils.marshaller(TailLogEntriesRequest.getDefaultInstance())) .setResponseMarshaller( ProtoUtils.marshaller(TailLogEntriesResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) .build(); private final UnaryCallable deleteLogCallable; @@ -189,15 +195,17 @@ protected GrpcLoggingServiceV2Stub( .setMethodDescriptor(deleteLogMethodDescriptor) .setParamsExtractor( request -> { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("log_name", String.valueOf(request.getLogName())); - return params.build(); + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("log_name", String.valueOf(request.getLogName())); + return builder.build(); }) + .setResourceNameExtractor(request -> request.getLogName()) .build(); GrpcCallSettings writeLogEntriesTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(writeLogEntriesMethodDescriptor) + .setResourceNameExtractor(request -> request.getLogName()) .build(); GrpcCallSettings listLogEntriesTransportSettings = @@ -217,10 +225,11 @@ protected GrpcLoggingServiceV2Stub( .setMethodDescriptor(listLogsMethodDescriptor) .setParamsExtractor( request -> { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("parent", String.valueOf(request.getParent())); - return params.build(); + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); }) + .setResourceNameExtractor(request -> request.getParent()) .build(); GrpcCallSettings tailLogEntriesTransportSettings = diff --git a/test/integration/goldens/logging/src/com/google/cloud/logging/v2/stub/GrpcMetricsServiceV2CallableFactory.java b/test/integration/goldens/logging/src/com/google/cloud/logging/v2/stub/GrpcMetricsServiceV2CallableFactory.java index 1cfb536625..d64bb1b3fb 100644 --- a/test/integration/goldens/logging/src/com/google/cloud/logging/v2/stub/GrpcMetricsServiceV2CallableFactory.java +++ b/test/integration/goldens/logging/src/com/google/cloud/logging/v2/stub/GrpcMetricsServiceV2CallableFactory.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/logging/src/com/google/cloud/logging/v2/stub/GrpcMetricsServiceV2Stub.java b/test/integration/goldens/logging/src/com/google/cloud/logging/v2/stub/GrpcMetricsServiceV2Stub.java index 326cdebca6..5d8e5dfcd3 100644 --- a/test/integration/goldens/logging/src/com/google/cloud/logging/v2/stub/GrpcMetricsServiceV2Stub.java +++ b/test/integration/goldens/logging/src/com/google/cloud/logging/v2/stub/GrpcMetricsServiceV2Stub.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -23,8 +23,8 @@ 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.common.collect.ImmutableMap; import com.google.logging.v2.CreateLogMetricRequest; import com.google.logging.v2.DeleteLogMetricRequest; import com.google.logging.v2.GetLogMetricRequest; @@ -58,6 +58,7 @@ public class GrpcMetricsServiceV2Stub extends MetricsServiceV2Stub { ProtoUtils.marshaller(ListLogMetricsRequest.getDefaultInstance())) .setResponseMarshaller( ProtoUtils.marshaller(ListLogMetricsResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) .build(); private static final MethodDescriptor @@ -67,6 +68,7 @@ public class GrpcMetricsServiceV2Stub extends MetricsServiceV2Stub { .setFullMethodName("google.logging.v2.MetricsServiceV2/GetLogMetric") .setRequestMarshaller(ProtoUtils.marshaller(GetLogMetricRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(LogMetric.getDefaultInstance())) + .setSampledToLocalTracing(true) .build(); private static final MethodDescriptor @@ -77,6 +79,7 @@ public class GrpcMetricsServiceV2Stub extends MetricsServiceV2Stub { .setRequestMarshaller( ProtoUtils.marshaller(CreateLogMetricRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(LogMetric.getDefaultInstance())) + .setSampledToLocalTracing(true) .build(); private static final MethodDescriptor @@ -87,6 +90,7 @@ public class GrpcMetricsServiceV2Stub extends MetricsServiceV2Stub { .setRequestMarshaller( ProtoUtils.marshaller(UpdateLogMetricRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(LogMetric.getDefaultInstance())) + .setSampledToLocalTracing(true) .build(); private static final MethodDescriptor @@ -97,6 +101,7 @@ public class GrpcMetricsServiceV2Stub extends MetricsServiceV2Stub { .setRequestMarshaller( ProtoUtils.marshaller(DeleteLogMetricRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(Empty.getDefaultInstance())) + .setSampledToLocalTracing(true) .build(); private final UnaryCallable listLogMetricsCallable; @@ -157,50 +162,55 @@ protected GrpcMetricsServiceV2Stub( .setMethodDescriptor(listLogMetricsMethodDescriptor) .setParamsExtractor( request -> { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("parent", String.valueOf(request.getParent())); - return params.build(); + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); }) + .setResourceNameExtractor(request -> request.getParent()) .build(); GrpcCallSettings getLogMetricTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(getLogMetricMethodDescriptor) .setParamsExtractor( request -> { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("metric_name", String.valueOf(request.getMetricName())); - return params.build(); + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("metric_name", String.valueOf(request.getMetricName())); + return builder.build(); }) + .setResourceNameExtractor(request -> request.getMetricName()) .build(); GrpcCallSettings createLogMetricTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(createLogMetricMethodDescriptor) .setParamsExtractor( request -> { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("parent", String.valueOf(request.getParent())); - return params.build(); + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); }) + .setResourceNameExtractor(request -> request.getParent()) .build(); GrpcCallSettings updateLogMetricTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(updateLogMetricMethodDescriptor) .setParamsExtractor( request -> { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("metric_name", String.valueOf(request.getMetricName())); - return params.build(); + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("metric_name", String.valueOf(request.getMetricName())); + return builder.build(); }) + .setResourceNameExtractor(request -> request.getMetricName()) .build(); GrpcCallSettings deleteLogMetricTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(deleteLogMetricMethodDescriptor) .setParamsExtractor( request -> { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("metric_name", String.valueOf(request.getMetricName())); - return params.build(); + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("metric_name", String.valueOf(request.getMetricName())); + return builder.build(); }) + .setResourceNameExtractor(request -> request.getMetricName()) .build(); this.listLogMetricsCallable = diff --git a/test/integration/goldens/logging/src/com/google/cloud/logging/v2/stub/LoggingServiceV2Stub.java b/test/integration/goldens/logging/src/com/google/cloud/logging/v2/stub/LoggingServiceV2Stub.java index 06d1b34d9f..5e2830d0e3 100644 --- a/test/integration/goldens/logging/src/com/google/cloud/logging/v2/stub/LoggingServiceV2Stub.java +++ b/test/integration/goldens/logging/src/com/google/cloud/logging/v2/stub/LoggingServiceV2Stub.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/logging/src/com/google/cloud/logging/v2/stub/LoggingServiceV2StubSettings.java b/test/integration/goldens/logging/src/com/google/cloud/logging/v2/stub/LoggingServiceV2StubSettings.java index d01030e25e..6010757c6a 100644 --- a/test/integration/goldens/logging/src/com/google/cloud/logging/v2/stub/LoggingServiceV2StubSettings.java +++ b/test/integration/goldens/logging/src/com/google/cloud/logging/v2/stub/LoggingServiceV2StubSettings.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -23,7 +23,7 @@ import com.google.api.MonitoredResourceDescriptor; import com.google.api.core.ApiFunction; import com.google.api.core.ApiFuture; -import com.google.api.core.BetaApi; +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; @@ -42,6 +42,7 @@ 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.LibraryMetadata; import com.google.api.gax.rpc.PageContext; import com.google.api.gax.rpc.PagedCallSettings; import com.google.api.gax.rpc.PagedListDescriptor; @@ -70,10 +71,10 @@ 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; -import org.threeten.bp.Duration; // AUTO-GENERATED DOCUMENTATION AND CLASS. /** @@ -90,7 +91,9 @@ *

        The builder of this class is recursive, so contained classes are themselves builders. When * build() is called, the tree of builders is called to create the complete settings object. * - *

        For example, to set the total timeout of deleteLog to 30 seconds: + *

        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.
        @@ -107,12 +110,24 @@
          *             .deleteLogSettings()
          *             .getRetrySettings()
          *             .toBuilder()
        - *             .setTotalTimeout(Duration.ofSeconds(30))
        + *             .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://docs.cloud.google.com/java/docs/client-retries) for additional support in setting + * retries. */ @Generated("by gapic-generator-java") +@SuppressWarnings("CanonicalDuration") public class LoggingServiceV2StubSettings extends StubSettings { /** The default scopes of the service. */ private static final ImmutableList DEFAULT_SERVICE_SCOPES = @@ -171,9 +186,7 @@ public String extractNextToken(ListLogEntriesResponse payload) { @Override public Iterable extractResources(ListLogEntriesResponse payload) { - return payload.getEntriesList() == null - ? ImmutableList.of() - : payload.getEntriesList(); + return payload.getEntriesList(); } }; @@ -220,9 +233,7 @@ public String extractNextToken(ListMonitoredResourceDescriptorsResponse payload) @Override public Iterable extractResources( ListMonitoredResourceDescriptorsResponse payload) { - return payload.getResourceDescriptorsList() == null - ? ImmutableList.of() - : payload.getResourceDescriptorsList(); + return payload.getResourceDescriptorsList(); } }; @@ -256,9 +267,7 @@ public String extractNextToken(ListLogsResponse payload) { @Override public Iterable extractResources(ListLogsResponse payload) { - return payload.getLogNamesList() == null - ? ImmutableList.of() - : payload.getLogNamesList(); + return payload.getLogNamesList(); } }; @@ -438,12 +447,19 @@ public LoggingServiceV2Stub createStub() throws IOException { "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"; } @@ -475,7 +491,6 @@ public static TransportChannelProvider defaultTransportChannelProvider() { return defaultGrpcTransportProviderBuilder().build(); } - @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { return ApiClientHeaderProvider.newBuilder() .setGeneratedLibToken( @@ -511,6 +526,11 @@ protected LoggingServiceV2StubSettings(Builder settingsBuilder) throws IOExcepti tailLogEntriesSettings = settingsBuilder.tailLogEntriesSettings().build(); } + @Override + protected LibraryMetadata getLibraryMetadata() { + return LibraryMetadata.newBuilder().setVersion(Version.VERSION).build(); + } + /** Builder for LoggingServiceV2StubSettings. */ public static class Builder extends StubSettings.Builder { private final ImmutableList> unaryMethodSettingsBuilders; @@ -560,24 +580,24 @@ public static class Builder extends StubSettings.BuilderThe builder of this class is recursive, so contained classes are themselves builders. When * build() is called, the tree of builders is called to create the complete settings object. * - *

        For example, to set the total timeout of getLogMetric to 30 seconds: + *

        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.
        @@ -89,12 +92,24 @@
          *             .getLogMetricSettings()
          *             .getRetrySettings()
          *             .toBuilder()
        - *             .setTotalTimeout(Duration.ofSeconds(30))
        + *             .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://docs.cloud.google.com/java/docs/client-retries) for additional support in setting + * retries. */ @Generated("by gapic-generator-java") +@SuppressWarnings("CanonicalDuration") public class MetricsServiceV2StubSettings extends StubSettings { /** The default scopes of the service. */ private static final ImmutableList DEFAULT_SERVICE_SCOPES = @@ -145,9 +160,7 @@ public String extractNextToken(ListLogMetricsResponse payload) { @Override public Iterable extractResources(ListLogMetricsResponse payload) { - return payload.getMetricsList() == null - ? ImmutableList.of() - : payload.getMetricsList(); + return payload.getMetricsList(); } }; @@ -206,12 +219,19 @@ public MetricsServiceV2Stub createStub() throws IOException { "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"; } @@ -243,7 +263,6 @@ public static TransportChannelProvider defaultTransportChannelProvider() { return defaultGrpcTransportProviderBuilder().build(); } - @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { return ApiClientHeaderProvider.newBuilder() .setGeneratedLibToken( @@ -277,6 +296,11 @@ protected MetricsServiceV2StubSettings(Builder settingsBuilder) throws IOExcepti deleteLogMetricSettings = settingsBuilder.deleteLogMetricSettings().build(); } + @Override + protected LibraryMetadata getLibraryMetadata() { + return LibraryMetadata.newBuilder().setVersion(Version.VERSION).build(); + } + /** Builder for MetricsServiceV2StubSettings. */ public static class Builder extends StubSettings.Builder { private final ImmutableList> unaryMethodSettingsBuilders; @@ -314,21 +338,21 @@ public static class Builder extends StubSettings.Builder 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/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/publisher/create/SyncCreateSetCredentialsProvider.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/publisher/create/SyncCreateSetCredentialsProvider.java index 47792ee22d..20257e85ab 100644 --- a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/publisher/create/SyncCreateSetCredentialsProvider.java +++ b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/publisher/create/SyncCreateSetCredentialsProvider.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/publisher/create/SyncCreateSetEndpoint.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/publisher/create/SyncCreateSetEndpoint.java index 19398974d1..7e5fff185f 100644 --- a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/publisher/create/SyncCreateSetEndpoint.java +++ b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/publisher/create/SyncCreateSetEndpoint.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/publisher/createtopic/AsyncCreateTopic.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/publisher/createtopic/AsyncCreateTopic.java index 74621080e4..9b31810716 100644 --- a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/publisher/createtopic/AsyncCreateTopic.java +++ b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/publisher/createtopic/AsyncCreateTopic.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/publisher/createtopic/SyncCreateTopic.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/publisher/createtopic/SyncCreateTopic.java index a4b5de14e9..4c4be8cead 100644 --- a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/publisher/createtopic/SyncCreateTopic.java +++ b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/publisher/createtopic/SyncCreateTopic.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/publisher/createtopic/SyncCreateTopicString.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/publisher/createtopic/SyncCreateTopicString.java index c5d7bf9bc2..b0dd0064a1 100644 --- a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/publisher/createtopic/SyncCreateTopicString.java +++ b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/publisher/createtopic/SyncCreateTopicString.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/publisher/createtopic/SyncCreateTopicTopicname.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/publisher/createtopic/SyncCreateTopicTopicname.java index 3fe1d8d1ce..4509f8d50a 100644 --- a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/publisher/createtopic/SyncCreateTopicTopicname.java +++ b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/publisher/createtopic/SyncCreateTopicTopicname.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/publisher/deletetopic/AsyncDeleteTopic.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/publisher/deletetopic/AsyncDeleteTopic.java index 7333b31068..ea86760ecd 100644 --- a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/publisher/deletetopic/AsyncDeleteTopic.java +++ b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/publisher/deletetopic/AsyncDeleteTopic.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/publisher/deletetopic/SyncDeleteTopic.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/publisher/deletetopic/SyncDeleteTopic.java index 592d02f1e2..5b58f9e1b4 100644 --- a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/publisher/deletetopic/SyncDeleteTopic.java +++ b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/publisher/deletetopic/SyncDeleteTopic.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/publisher/deletetopic/SyncDeleteTopicString.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/publisher/deletetopic/SyncDeleteTopicString.java index e38c29ba6c..56334dbc25 100644 --- a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/publisher/deletetopic/SyncDeleteTopicString.java +++ b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/publisher/deletetopic/SyncDeleteTopicString.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/publisher/deletetopic/SyncDeleteTopicTopicname.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/publisher/deletetopic/SyncDeleteTopicTopicname.java index d7e2b5ecfb..6b901c4723 100644 --- a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/publisher/deletetopic/SyncDeleteTopicTopicname.java +++ b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/publisher/deletetopic/SyncDeleteTopicTopicname.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/publisher/detachsubscription/AsyncDetachSubscription.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/publisher/detachsubscription/AsyncDetachSubscription.java index 6f476688b0..4cef5718f3 100644 --- a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/publisher/detachsubscription/AsyncDetachSubscription.java +++ b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/publisher/detachsubscription/AsyncDetachSubscription.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/publisher/detachsubscription/SyncDetachSubscription.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/publisher/detachsubscription/SyncDetachSubscription.java index d246600768..6c2caf41f5 100644 --- a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/publisher/detachsubscription/SyncDetachSubscription.java +++ b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/publisher/detachsubscription/SyncDetachSubscription.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/publisher/getiampolicy/AsyncGetIamPolicy.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/publisher/getiampolicy/AsyncGetIamPolicy.java index 7811b64d9b..7d5e36e54c 100644 --- a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/publisher/getiampolicy/AsyncGetIamPolicy.java +++ b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/publisher/getiampolicy/AsyncGetIamPolicy.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/publisher/getiampolicy/SyncGetIamPolicy.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/publisher/getiampolicy/SyncGetIamPolicy.java index 22b082ae1d..e15bbefcc8 100644 --- a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/publisher/getiampolicy/SyncGetIamPolicy.java +++ b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/publisher/getiampolicy/SyncGetIamPolicy.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/publisher/gettopic/AsyncGetTopic.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/publisher/gettopic/AsyncGetTopic.java index 6186bbc7f2..006a7c6e26 100644 --- a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/publisher/gettopic/AsyncGetTopic.java +++ b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/publisher/gettopic/AsyncGetTopic.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/publisher/gettopic/SyncGetTopic.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/publisher/gettopic/SyncGetTopic.java index dae908367f..48ded65998 100644 --- a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/publisher/gettopic/SyncGetTopic.java +++ b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/publisher/gettopic/SyncGetTopic.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/publisher/gettopic/SyncGetTopicString.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/publisher/gettopic/SyncGetTopicString.java index 880d718804..4dfd647114 100644 --- a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/publisher/gettopic/SyncGetTopicString.java +++ b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/publisher/gettopic/SyncGetTopicString.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/publisher/gettopic/SyncGetTopicTopicname.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/publisher/gettopic/SyncGetTopicTopicname.java index f1b638ad0c..39a08a6fe7 100644 --- a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/publisher/gettopic/SyncGetTopicTopicname.java +++ b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/publisher/gettopic/SyncGetTopicTopicname.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/publisher/listtopics/AsyncListTopics.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/publisher/listtopics/AsyncListTopics.java index bb5c209e76..6f9a19da69 100644 --- a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/publisher/listtopics/AsyncListTopics.java +++ b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/publisher/listtopics/AsyncListTopics.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/publisher/listtopics/AsyncListTopicsPaged.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/publisher/listtopics/AsyncListTopicsPaged.java index bc408435bb..ab9c5f6a79 100644 --- a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/publisher/listtopics/AsyncListTopicsPaged.java +++ b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/publisher/listtopics/AsyncListTopicsPaged.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/publisher/listtopics/SyncListTopics.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/publisher/listtopics/SyncListTopics.java index ef06991673..e387931a7c 100644 --- a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/publisher/listtopics/SyncListTopics.java +++ b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/publisher/listtopics/SyncListTopics.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/publisher/listtopics/SyncListTopicsProjectname.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/publisher/listtopics/SyncListTopicsProjectname.java index 81bc425073..f3d938bd2b 100644 --- a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/publisher/listtopics/SyncListTopicsProjectname.java +++ b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/publisher/listtopics/SyncListTopicsProjectname.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/publisher/listtopics/SyncListTopicsString.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/publisher/listtopics/SyncListTopicsString.java index 99bcc8bf29..8664dd2ca2 100644 --- a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/publisher/listtopics/SyncListTopicsString.java +++ b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/publisher/listtopics/SyncListTopicsString.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/publisher/listtopicsnapshots/AsyncListTopicSnapshots.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/publisher/listtopicsnapshots/AsyncListTopicSnapshots.java index d443239958..60719a923b 100644 --- a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/publisher/listtopicsnapshots/AsyncListTopicSnapshots.java +++ b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/publisher/listtopicsnapshots/AsyncListTopicSnapshots.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/publisher/listtopicsnapshots/AsyncListTopicSnapshotsPaged.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/publisher/listtopicsnapshots/AsyncListTopicSnapshotsPaged.java index 70abfdafec..80c2797cf3 100644 --- a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/publisher/listtopicsnapshots/AsyncListTopicSnapshotsPaged.java +++ b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/publisher/listtopicsnapshots/AsyncListTopicSnapshotsPaged.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/publisher/listtopicsnapshots/SyncListTopicSnapshots.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/publisher/listtopicsnapshots/SyncListTopicSnapshots.java index c09b9310f2..9ca11226ad 100644 --- a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/publisher/listtopicsnapshots/SyncListTopicSnapshots.java +++ b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/publisher/listtopicsnapshots/SyncListTopicSnapshots.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/publisher/listtopicsnapshots/SyncListTopicSnapshotsString.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/publisher/listtopicsnapshots/SyncListTopicSnapshotsString.java index 6b1af0211a..9d8d10eed5 100644 --- a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/publisher/listtopicsnapshots/SyncListTopicSnapshotsString.java +++ b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/publisher/listtopicsnapshots/SyncListTopicSnapshotsString.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/publisher/listtopicsnapshots/SyncListTopicSnapshotsTopicname.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/publisher/listtopicsnapshots/SyncListTopicSnapshotsTopicname.java index b049daf378..73fa15682f 100644 --- a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/publisher/listtopicsnapshots/SyncListTopicSnapshotsTopicname.java +++ b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/publisher/listtopicsnapshots/SyncListTopicSnapshotsTopicname.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/publisher/listtopicsubscriptions/AsyncListTopicSubscriptions.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/publisher/listtopicsubscriptions/AsyncListTopicSubscriptions.java index b4e989dd9d..a16a5c4290 100644 --- a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/publisher/listtopicsubscriptions/AsyncListTopicSubscriptions.java +++ b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/publisher/listtopicsubscriptions/AsyncListTopicSubscriptions.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/publisher/listtopicsubscriptions/AsyncListTopicSubscriptionsPaged.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/publisher/listtopicsubscriptions/AsyncListTopicSubscriptionsPaged.java index f58ba30e98..a5534b9378 100644 --- a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/publisher/listtopicsubscriptions/AsyncListTopicSubscriptionsPaged.java +++ b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/publisher/listtopicsubscriptions/AsyncListTopicSubscriptionsPaged.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/publisher/listtopicsubscriptions/SyncListTopicSubscriptions.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/publisher/listtopicsubscriptions/SyncListTopicSubscriptions.java index acbe537c50..f44962c65d 100644 --- a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/publisher/listtopicsubscriptions/SyncListTopicSubscriptions.java +++ b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/publisher/listtopicsubscriptions/SyncListTopicSubscriptions.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/publisher/listtopicsubscriptions/SyncListTopicSubscriptionsString.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/publisher/listtopicsubscriptions/SyncListTopicSubscriptionsString.java index 51cc955ab3..e39d7dec39 100644 --- a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/publisher/listtopicsubscriptions/SyncListTopicSubscriptionsString.java +++ b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/publisher/listtopicsubscriptions/SyncListTopicSubscriptionsString.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/publisher/listtopicsubscriptions/SyncListTopicSubscriptionsTopicname.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/publisher/listtopicsubscriptions/SyncListTopicSubscriptionsTopicname.java index c9ca4db89c..fdcf7d9397 100644 --- a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/publisher/listtopicsubscriptions/SyncListTopicSubscriptionsTopicname.java +++ b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/publisher/listtopicsubscriptions/SyncListTopicSubscriptionsTopicname.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/publisher/publish/AsyncPublish.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/publisher/publish/AsyncPublish.java index 5923a643cc..7564850920 100644 --- a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/publisher/publish/AsyncPublish.java +++ b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/publisher/publish/AsyncPublish.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/publisher/publish/SyncPublish.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/publisher/publish/SyncPublish.java index a38c98b0be..c75290cfdb 100644 --- a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/publisher/publish/SyncPublish.java +++ b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/publisher/publish/SyncPublish.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/publisher/publish/SyncPublishStringListpubsubmessage.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/publisher/publish/SyncPublishStringListpubsubmessage.java index af9f822ea4..fa4afa1f10 100644 --- a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/publisher/publish/SyncPublishStringListpubsubmessage.java +++ b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/publisher/publish/SyncPublishStringListpubsubmessage.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/publisher/publish/SyncPublishTopicnameListpubsubmessage.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/publisher/publish/SyncPublishTopicnameListpubsubmessage.java index 8f4cac5379..3eb778a0a4 100644 --- a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/publisher/publish/SyncPublishTopicnameListpubsubmessage.java +++ b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/publisher/publish/SyncPublishTopicnameListpubsubmessage.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/publisher/setiampolicy/AsyncSetIamPolicy.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/publisher/setiampolicy/AsyncSetIamPolicy.java index 7532610f06..0cf99f79f7 100644 --- a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/publisher/setiampolicy/AsyncSetIamPolicy.java +++ b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/publisher/setiampolicy/AsyncSetIamPolicy.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -21,6 +21,7 @@ import com.google.cloud.pubsub.v1.TopicAdminClient; import com.google.iam.v1.Policy; import com.google.iam.v1.SetIamPolicyRequest; +import com.google.protobuf.FieldMask; import com.google.pubsub.v1.SnapshotName; public class AsyncSetIamPolicy { @@ -40,6 +41,7 @@ public static void asyncSetIamPolicy() throws Exception { SetIamPolicyRequest.newBuilder() .setResource(SnapshotName.of("[PROJECT]", "[SNAPSHOT]").toString()) .setPolicy(Policy.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) .build(); ApiFuture future = topicAdminClient.setIamPolicyCallable().futureCall(request); // Do something. diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/publisher/setiampolicy/SyncSetIamPolicy.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/publisher/setiampolicy/SyncSetIamPolicy.java index 9bade67c6b..6ce6ac21d8 100644 --- a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/publisher/setiampolicy/SyncSetIamPolicy.java +++ b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/publisher/setiampolicy/SyncSetIamPolicy.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -20,6 +20,7 @@ import com.google.cloud.pubsub.v1.TopicAdminClient; import com.google.iam.v1.Policy; import com.google.iam.v1.SetIamPolicyRequest; +import com.google.protobuf.FieldMask; import com.google.pubsub.v1.SnapshotName; public class SyncSetIamPolicy { @@ -39,6 +40,7 @@ public static void syncSetIamPolicy() throws Exception { SetIamPolicyRequest.newBuilder() .setResource(SnapshotName.of("[PROJECT]", "[SNAPSHOT]").toString()) .setPolicy(Policy.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) .build(); Policy response = topicAdminClient.setIamPolicy(request); } diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/publisher/testiampermissions/AsyncTestIamPermissions.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/publisher/testiampermissions/AsyncTestIamPermissions.java index c2718a9def..e6b238f9ef 100644 --- a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/publisher/testiampermissions/AsyncTestIamPermissions.java +++ b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/publisher/testiampermissions/AsyncTestIamPermissions.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/publisher/testiampermissions/SyncTestIamPermissions.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/publisher/testiampermissions/SyncTestIamPermissions.java index ab708587bc..3438faef43 100644 --- a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/publisher/testiampermissions/SyncTestIamPermissions.java +++ b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/publisher/testiampermissions/SyncTestIamPermissions.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/publisher/updatetopic/AsyncUpdateTopic.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/publisher/updatetopic/AsyncUpdateTopic.java index b9aa104687..8e5e70803f 100644 --- a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/publisher/updatetopic/AsyncUpdateTopic.java +++ b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/publisher/updatetopic/AsyncUpdateTopic.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/publisher/updatetopic/SyncUpdateTopic.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/publisher/updatetopic/SyncUpdateTopic.java index 83ca0b9f16..5e0c69f60c 100644 --- a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/publisher/updatetopic/SyncUpdateTopic.java +++ b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/publisher/updatetopic/SyncUpdateTopic.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaservice/commitschema/AsyncCommitSchema.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaservice/commitschema/AsyncCommitSchema.java new file mode 100644 index 0000000000..5f4b3131b7 --- /dev/null +++ b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaservice/commitschema/AsyncCommitSchema.java @@ -0,0 +1,50 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS 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.pubsub.v1.samples; + +// [START pubsub_v1_generated_SchemaService_CommitSchema_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.pubsub.v1.SchemaServiceClient; +import com.google.pubsub.v1.CommitSchemaRequest; +import com.google.pubsub.v1.Schema; +import com.google.pubsub.v1.SchemaName; + +public class AsyncCommitSchema { + + public static void main(String[] args) throws Exception { + asyncCommitSchema(); + } + + public static void asyncCommitSchema() 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 (SchemaServiceClient schemaServiceClient = SchemaServiceClient.create()) { + CommitSchemaRequest request = + CommitSchemaRequest.newBuilder() + .setName(SchemaName.of("[PROJECT]", "[SCHEMA]").toString()) + .setSchema(Schema.newBuilder().build()) + .build(); + ApiFuture future = schemaServiceClient.commitSchemaCallable().futureCall(request); + // Do something. + Schema response = future.get(); + } + } +} +// [END pubsub_v1_generated_SchemaService_CommitSchema_async] diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaservice/commitschema/SyncCommitSchema.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaservice/commitschema/SyncCommitSchema.java new file mode 100644 index 0000000000..7674c7ee2e --- /dev/null +++ b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaservice/commitschema/SyncCommitSchema.java @@ -0,0 +1,47 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS 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.pubsub.v1.samples; + +// [START pubsub_v1_generated_SchemaService_CommitSchema_sync] +import com.google.cloud.pubsub.v1.SchemaServiceClient; +import com.google.pubsub.v1.CommitSchemaRequest; +import com.google.pubsub.v1.Schema; +import com.google.pubsub.v1.SchemaName; + +public class SyncCommitSchema { + + public static void main(String[] args) throws Exception { + syncCommitSchema(); + } + + public static void syncCommitSchema() 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 (SchemaServiceClient schemaServiceClient = SchemaServiceClient.create()) { + CommitSchemaRequest request = + CommitSchemaRequest.newBuilder() + .setName(SchemaName.of("[PROJECT]", "[SCHEMA]").toString()) + .setSchema(Schema.newBuilder().build()) + .build(); + Schema response = schemaServiceClient.commitSchema(request); + } + } +} +// [END pubsub_v1_generated_SchemaService_CommitSchema_sync] diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaservice/commitschema/SyncCommitSchemaSchemanameSchema.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaservice/commitschema/SyncCommitSchemaSchemanameSchema.java new file mode 100644 index 0000000000..e0ee2e8fc1 --- /dev/null +++ b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaservice/commitschema/SyncCommitSchemaSchemanameSchema.java @@ -0,0 +1,43 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS 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.pubsub.v1.samples; + +// [START pubsub_v1_generated_SchemaService_CommitSchema_SchemanameSchema_sync] +import com.google.cloud.pubsub.v1.SchemaServiceClient; +import com.google.pubsub.v1.Schema; +import com.google.pubsub.v1.SchemaName; + +public class SyncCommitSchemaSchemanameSchema { + + public static void main(String[] args) throws Exception { + syncCommitSchemaSchemanameSchema(); + } + + public static void syncCommitSchemaSchemanameSchema() 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 (SchemaServiceClient schemaServiceClient = SchemaServiceClient.create()) { + SchemaName name = SchemaName.of("[PROJECT]", "[SCHEMA]"); + Schema schema = Schema.newBuilder().build(); + Schema response = schemaServiceClient.commitSchema(name, schema); + } + } +} +// [END pubsub_v1_generated_SchemaService_CommitSchema_SchemanameSchema_sync] diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaservice/commitschema/SyncCommitSchemaStringSchema.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaservice/commitschema/SyncCommitSchemaStringSchema.java new file mode 100644 index 0000000000..16706d8998 --- /dev/null +++ b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaservice/commitschema/SyncCommitSchemaStringSchema.java @@ -0,0 +1,43 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS 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.pubsub.v1.samples; + +// [START pubsub_v1_generated_SchemaService_CommitSchema_StringSchema_sync] +import com.google.cloud.pubsub.v1.SchemaServiceClient; +import com.google.pubsub.v1.Schema; +import com.google.pubsub.v1.SchemaName; + +public class SyncCommitSchemaStringSchema { + + public static void main(String[] args) throws Exception { + syncCommitSchemaStringSchema(); + } + + public static void syncCommitSchemaStringSchema() 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 (SchemaServiceClient schemaServiceClient = SchemaServiceClient.create()) { + String name = SchemaName.of("[PROJECT]", "[SCHEMA]").toString(); + Schema schema = Schema.newBuilder().build(); + Schema response = schemaServiceClient.commitSchema(name, schema); + } + } +} +// [END pubsub_v1_generated_SchemaService_CommitSchema_StringSchema_sync] diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaservice/create/SyncCreateSetCredentialsProvider.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaservice/create/SyncCreateSetCredentialsProvider.java index f66d3eb280..59a716fdca 100644 --- a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaservice/create/SyncCreateSetCredentialsProvider.java +++ b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaservice/create/SyncCreateSetCredentialsProvider.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaservice/create/SyncCreateSetEndpoint.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaservice/create/SyncCreateSetEndpoint.java index 6fef477696..96d66c03f4 100644 --- a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaservice/create/SyncCreateSetEndpoint.java +++ b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaservice/create/SyncCreateSetEndpoint.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaservice/createschema/AsyncCreateSchema.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaservice/createschema/AsyncCreateSchema.java index 8177b54efe..397e9a106e 100644 --- a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaservice/createschema/AsyncCreateSchema.java +++ b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaservice/createschema/AsyncCreateSchema.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaservice/createschema/SyncCreateSchema.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaservice/createschema/SyncCreateSchema.java index 6318c403b5..0fac7eac77 100644 --- a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaservice/createschema/SyncCreateSchema.java +++ b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaservice/createschema/SyncCreateSchema.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaservice/createschema/SyncCreateSchemaProjectnameSchemaString.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaservice/createschema/SyncCreateSchemaProjectnameSchemaString.java index 63d1ec61c0..4e0846e3fa 100644 --- a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaservice/createschema/SyncCreateSchemaProjectnameSchemaString.java +++ b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaservice/createschema/SyncCreateSchemaProjectnameSchemaString.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaservice/createschema/SyncCreateSchemaStringSchemaString.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaservice/createschema/SyncCreateSchemaStringSchemaString.java index e1e42c77df..569367c41a 100644 --- a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaservice/createschema/SyncCreateSchemaStringSchemaString.java +++ b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaservice/createschema/SyncCreateSchemaStringSchemaString.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaservice/deleteschema/AsyncDeleteSchema.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaservice/deleteschema/AsyncDeleteSchema.java index e278448b05..96c8e36d78 100644 --- a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaservice/deleteschema/AsyncDeleteSchema.java +++ b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaservice/deleteschema/AsyncDeleteSchema.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaservice/deleteschema/SyncDeleteSchema.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaservice/deleteschema/SyncDeleteSchema.java index b7e421a8a8..b6340159fb 100644 --- a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaservice/deleteschema/SyncDeleteSchema.java +++ b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaservice/deleteschema/SyncDeleteSchema.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaservice/deleteschema/SyncDeleteSchemaSchemaname.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaservice/deleteschema/SyncDeleteSchemaSchemaname.java index af400a0849..3413e70028 100644 --- a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaservice/deleteschema/SyncDeleteSchemaSchemaname.java +++ b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaservice/deleteschema/SyncDeleteSchemaSchemaname.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaservice/deleteschema/SyncDeleteSchemaString.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaservice/deleteschema/SyncDeleteSchemaString.java index 52af2a9a27..7d50062654 100644 --- a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaservice/deleteschema/SyncDeleteSchemaString.java +++ b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaservice/deleteschema/SyncDeleteSchemaString.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaservice/deleteschemarevision/AsyncDeleteSchemaRevision.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaservice/deleteschemarevision/AsyncDeleteSchemaRevision.java new file mode 100644 index 0000000000..ae11ddb00d --- /dev/null +++ b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaservice/deleteschemarevision/AsyncDeleteSchemaRevision.java @@ -0,0 +1,51 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS 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.pubsub.v1.samples; + +// [START pubsub_v1_generated_SchemaService_DeleteSchemaRevision_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.pubsub.v1.SchemaServiceClient; +import com.google.pubsub.v1.DeleteSchemaRevisionRequest; +import com.google.pubsub.v1.Schema; +import com.google.pubsub.v1.SchemaName; + +public class AsyncDeleteSchemaRevision { + + public static void main(String[] args) throws Exception { + asyncDeleteSchemaRevision(); + } + + public static void asyncDeleteSchemaRevision() 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 (SchemaServiceClient schemaServiceClient = SchemaServiceClient.create()) { + DeleteSchemaRevisionRequest request = + DeleteSchemaRevisionRequest.newBuilder() + .setName(SchemaName.of("[PROJECT]", "[SCHEMA]").toString()) + .setRevisionId("revisionId-1507445162") + .build(); + ApiFuture future = + schemaServiceClient.deleteSchemaRevisionCallable().futureCall(request); + // Do something. + Schema response = future.get(); + } + } +} +// [END pubsub_v1_generated_SchemaService_DeleteSchemaRevision_async] diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaservice/deleteschemarevision/SyncDeleteSchemaRevision.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaservice/deleteschemarevision/SyncDeleteSchemaRevision.java new file mode 100644 index 0000000000..8d6e168ad6 --- /dev/null +++ b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaservice/deleteschemarevision/SyncDeleteSchemaRevision.java @@ -0,0 +1,47 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS 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.pubsub.v1.samples; + +// [START pubsub_v1_generated_SchemaService_DeleteSchemaRevision_sync] +import com.google.cloud.pubsub.v1.SchemaServiceClient; +import com.google.pubsub.v1.DeleteSchemaRevisionRequest; +import com.google.pubsub.v1.Schema; +import com.google.pubsub.v1.SchemaName; + +public class SyncDeleteSchemaRevision { + + public static void main(String[] args) throws Exception { + syncDeleteSchemaRevision(); + } + + public static void syncDeleteSchemaRevision() 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 (SchemaServiceClient schemaServiceClient = SchemaServiceClient.create()) { + DeleteSchemaRevisionRequest request = + DeleteSchemaRevisionRequest.newBuilder() + .setName(SchemaName.of("[PROJECT]", "[SCHEMA]").toString()) + .setRevisionId("revisionId-1507445162") + .build(); + Schema response = schemaServiceClient.deleteSchemaRevision(request); + } + } +} +// [END pubsub_v1_generated_SchemaService_DeleteSchemaRevision_sync] diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaservice/deleteschemarevision/SyncDeleteSchemaRevisionSchemanameString.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaservice/deleteschemarevision/SyncDeleteSchemaRevisionSchemanameString.java new file mode 100644 index 0000000000..73fd6bcb07 --- /dev/null +++ b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaservice/deleteschemarevision/SyncDeleteSchemaRevisionSchemanameString.java @@ -0,0 +1,43 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS 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.pubsub.v1.samples; + +// [START pubsub_v1_generated_SchemaService_DeleteSchemaRevision_SchemanameString_sync] +import com.google.cloud.pubsub.v1.SchemaServiceClient; +import com.google.pubsub.v1.Schema; +import com.google.pubsub.v1.SchemaName; + +public class SyncDeleteSchemaRevisionSchemanameString { + + public static void main(String[] args) throws Exception { + syncDeleteSchemaRevisionSchemanameString(); + } + + public static void syncDeleteSchemaRevisionSchemanameString() 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 (SchemaServiceClient schemaServiceClient = SchemaServiceClient.create()) { + SchemaName name = SchemaName.of("[PROJECT]", "[SCHEMA]"); + String revisionId = "revisionId-1507445162"; + Schema response = schemaServiceClient.deleteSchemaRevision(name, revisionId); + } + } +} +// [END pubsub_v1_generated_SchemaService_DeleteSchemaRevision_SchemanameString_sync] diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaservice/deleteschemarevision/SyncDeleteSchemaRevisionStringString.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaservice/deleteschemarevision/SyncDeleteSchemaRevisionStringString.java new file mode 100644 index 0000000000..2ad63ae98f --- /dev/null +++ b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaservice/deleteschemarevision/SyncDeleteSchemaRevisionStringString.java @@ -0,0 +1,43 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS 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.pubsub.v1.samples; + +// [START pubsub_v1_generated_SchemaService_DeleteSchemaRevision_StringString_sync] +import com.google.cloud.pubsub.v1.SchemaServiceClient; +import com.google.pubsub.v1.Schema; +import com.google.pubsub.v1.SchemaName; + +public class SyncDeleteSchemaRevisionStringString { + + public static void main(String[] args) throws Exception { + syncDeleteSchemaRevisionStringString(); + } + + public static void syncDeleteSchemaRevisionStringString() 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 (SchemaServiceClient schemaServiceClient = SchemaServiceClient.create()) { + String name = SchemaName.of("[PROJECT]", "[SCHEMA]").toString(); + String revisionId = "revisionId-1507445162"; + Schema response = schemaServiceClient.deleteSchemaRevision(name, revisionId); + } + } +} +// [END pubsub_v1_generated_SchemaService_DeleteSchemaRevision_StringString_sync] diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaservice/getiampolicy/AsyncGetIamPolicy.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaservice/getiampolicy/AsyncGetIamPolicy.java index 17b5095bd3..1b52280901 100644 --- a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaservice/getiampolicy/AsyncGetIamPolicy.java +++ b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaservice/getiampolicy/AsyncGetIamPolicy.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaservice/getiampolicy/SyncGetIamPolicy.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaservice/getiampolicy/SyncGetIamPolicy.java index 9490015035..e38f69af2e 100644 --- a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaservice/getiampolicy/SyncGetIamPolicy.java +++ b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaservice/getiampolicy/SyncGetIamPolicy.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaservice/getschema/AsyncGetSchema.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaservice/getschema/AsyncGetSchema.java index 6ffacc689a..e29cbb9ac8 100644 --- a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaservice/getschema/AsyncGetSchema.java +++ b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaservice/getschema/AsyncGetSchema.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaservice/getschema/SyncGetSchema.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaservice/getschema/SyncGetSchema.java index 5daf4351de..6a0e295396 100644 --- a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaservice/getschema/SyncGetSchema.java +++ b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaservice/getschema/SyncGetSchema.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaservice/getschema/SyncGetSchemaSchemaname.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaservice/getschema/SyncGetSchemaSchemaname.java index c0a7730113..6320f7cd51 100644 --- a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaservice/getschema/SyncGetSchemaSchemaname.java +++ b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaservice/getschema/SyncGetSchemaSchemaname.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaservice/getschema/SyncGetSchemaString.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaservice/getschema/SyncGetSchemaString.java index bc666dbc1c..d492c0c8c6 100644 --- a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaservice/getschema/SyncGetSchemaString.java +++ b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaservice/getschema/SyncGetSchemaString.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaservice/listschemarevisions/AsyncListSchemaRevisions.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaservice/listschemarevisions/AsyncListSchemaRevisions.java new file mode 100644 index 0000000000..0a70d5e2c9 --- /dev/null +++ b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaservice/listschemarevisions/AsyncListSchemaRevisions.java @@ -0,0 +1,56 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS 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.pubsub.v1.samples; + +// [START pubsub_v1_generated_SchemaService_ListSchemaRevisions_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.pubsub.v1.SchemaServiceClient; +import com.google.pubsub.v1.ListSchemaRevisionsRequest; +import com.google.pubsub.v1.Schema; +import com.google.pubsub.v1.SchemaName; +import com.google.pubsub.v1.SchemaView; + +public class AsyncListSchemaRevisions { + + public static void main(String[] args) throws Exception { + asyncListSchemaRevisions(); + } + + public static void asyncListSchemaRevisions() 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 (SchemaServiceClient schemaServiceClient = SchemaServiceClient.create()) { + ListSchemaRevisionsRequest request = + ListSchemaRevisionsRequest.newBuilder() + .setName(SchemaName.of("[PROJECT]", "[SCHEMA]").toString()) + .setView(SchemaView.forNumber(0)) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + ApiFuture future = + schemaServiceClient.listSchemaRevisionsPagedCallable().futureCall(request); + // Do something. + for (Schema element : future.get().iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END pubsub_v1_generated_SchemaService_ListSchemaRevisions_async] diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaservice/listschemarevisions/AsyncListSchemaRevisionsPaged.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaservice/listschemarevisions/AsyncListSchemaRevisionsPaged.java new file mode 100644 index 0000000000..67b11b6de6 --- /dev/null +++ b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaservice/listschemarevisions/AsyncListSchemaRevisionsPaged.java @@ -0,0 +1,64 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS 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.pubsub.v1.samples; + +// [START pubsub_v1_generated_SchemaService_ListSchemaRevisions_Paged_async] +import com.google.cloud.pubsub.v1.SchemaServiceClient; +import com.google.common.base.Strings; +import com.google.pubsub.v1.ListSchemaRevisionsRequest; +import com.google.pubsub.v1.ListSchemaRevisionsResponse; +import com.google.pubsub.v1.Schema; +import com.google.pubsub.v1.SchemaName; +import com.google.pubsub.v1.SchemaView; + +public class AsyncListSchemaRevisionsPaged { + + public static void main(String[] args) throws Exception { + asyncListSchemaRevisionsPaged(); + } + + public static void asyncListSchemaRevisionsPaged() 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 (SchemaServiceClient schemaServiceClient = SchemaServiceClient.create()) { + ListSchemaRevisionsRequest request = + ListSchemaRevisionsRequest.newBuilder() + .setName(SchemaName.of("[PROJECT]", "[SCHEMA]").toString()) + .setView(SchemaView.forNumber(0)) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + while (true) { + ListSchemaRevisionsResponse response = + schemaServiceClient.listSchemaRevisionsCallable().call(request); + for (Schema element : response.getSchemasList()) { + // doThingsWith(element); + } + String nextPageToken = response.getNextPageToken(); + if (!Strings.isNullOrEmpty(nextPageToken)) { + request = request.toBuilder().setPageToken(nextPageToken).build(); + } else { + break; + } + } + } + } +} +// [END pubsub_v1_generated_SchemaService_ListSchemaRevisions_Paged_async] diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaservice/listschemarevisions/SyncListSchemaRevisions.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaservice/listschemarevisions/SyncListSchemaRevisions.java new file mode 100644 index 0000000000..3c618013b0 --- /dev/null +++ b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaservice/listschemarevisions/SyncListSchemaRevisions.java @@ -0,0 +1,52 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS 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.pubsub.v1.samples; + +// [START pubsub_v1_generated_SchemaService_ListSchemaRevisions_sync] +import com.google.cloud.pubsub.v1.SchemaServiceClient; +import com.google.pubsub.v1.ListSchemaRevisionsRequest; +import com.google.pubsub.v1.Schema; +import com.google.pubsub.v1.SchemaName; +import com.google.pubsub.v1.SchemaView; + +public class SyncListSchemaRevisions { + + public static void main(String[] args) throws Exception { + syncListSchemaRevisions(); + } + + public static void syncListSchemaRevisions() 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 (SchemaServiceClient schemaServiceClient = SchemaServiceClient.create()) { + ListSchemaRevisionsRequest request = + ListSchemaRevisionsRequest.newBuilder() + .setName(SchemaName.of("[PROJECT]", "[SCHEMA]").toString()) + .setView(SchemaView.forNumber(0)) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + for (Schema element : schemaServiceClient.listSchemaRevisions(request).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END pubsub_v1_generated_SchemaService_ListSchemaRevisions_sync] diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaservice/listschemarevisions/SyncListSchemaRevisionsSchemaname.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaservice/listschemarevisions/SyncListSchemaRevisionsSchemaname.java new file mode 100644 index 0000000000..46c6fe533f --- /dev/null +++ b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaservice/listschemarevisions/SyncListSchemaRevisionsSchemaname.java @@ -0,0 +1,44 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS 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.pubsub.v1.samples; + +// [START pubsub_v1_generated_SchemaService_ListSchemaRevisions_Schemaname_sync] +import com.google.cloud.pubsub.v1.SchemaServiceClient; +import com.google.pubsub.v1.Schema; +import com.google.pubsub.v1.SchemaName; + +public class SyncListSchemaRevisionsSchemaname { + + public static void main(String[] args) throws Exception { + syncListSchemaRevisionsSchemaname(); + } + + public static void syncListSchemaRevisionsSchemaname() 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 (SchemaServiceClient schemaServiceClient = SchemaServiceClient.create()) { + SchemaName name = SchemaName.of("[PROJECT]", "[SCHEMA]"); + for (Schema element : schemaServiceClient.listSchemaRevisions(name).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END pubsub_v1_generated_SchemaService_ListSchemaRevisions_Schemaname_sync] diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaservice/listschemarevisions/SyncListSchemaRevisionsString.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaservice/listschemarevisions/SyncListSchemaRevisionsString.java new file mode 100644 index 0000000000..3e94c3f673 --- /dev/null +++ b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaservice/listschemarevisions/SyncListSchemaRevisionsString.java @@ -0,0 +1,44 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS 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.pubsub.v1.samples; + +// [START pubsub_v1_generated_SchemaService_ListSchemaRevisions_String_sync] +import com.google.cloud.pubsub.v1.SchemaServiceClient; +import com.google.pubsub.v1.Schema; +import com.google.pubsub.v1.SchemaName; + +public class SyncListSchemaRevisionsString { + + public static void main(String[] args) throws Exception { + syncListSchemaRevisionsString(); + } + + public static void syncListSchemaRevisionsString() 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 (SchemaServiceClient schemaServiceClient = SchemaServiceClient.create()) { + String name = SchemaName.of("[PROJECT]", "[SCHEMA]").toString(); + for (Schema element : schemaServiceClient.listSchemaRevisions(name).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END pubsub_v1_generated_SchemaService_ListSchemaRevisions_String_sync] diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaservice/listschemas/AsyncListSchemas.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaservice/listschemas/AsyncListSchemas.java index b32fd480b5..c1e26eed32 100644 --- a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaservice/listschemas/AsyncListSchemas.java +++ b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaservice/listschemas/AsyncListSchemas.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaservice/listschemas/AsyncListSchemasPaged.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaservice/listschemas/AsyncListSchemasPaged.java index 6076b5e966..b0f10d1ff0 100644 --- a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaservice/listschemas/AsyncListSchemasPaged.java +++ b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaservice/listschemas/AsyncListSchemasPaged.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaservice/listschemas/SyncListSchemas.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaservice/listschemas/SyncListSchemas.java index 705545481f..66844df00a 100644 --- a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaservice/listschemas/SyncListSchemas.java +++ b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaservice/listschemas/SyncListSchemas.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaservice/listschemas/SyncListSchemasProjectname.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaservice/listschemas/SyncListSchemasProjectname.java index d8508321ea..332ef309c1 100644 --- a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaservice/listschemas/SyncListSchemasProjectname.java +++ b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaservice/listschemas/SyncListSchemasProjectname.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaservice/listschemas/SyncListSchemasString.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaservice/listschemas/SyncListSchemasString.java index 51ece993eb..2729622465 100644 --- a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaservice/listschemas/SyncListSchemasString.java +++ b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaservice/listschemas/SyncListSchemasString.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaservice/rollbackschema/AsyncRollbackSchema.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaservice/rollbackschema/AsyncRollbackSchema.java new file mode 100644 index 0000000000..4fec4225aa --- /dev/null +++ b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaservice/rollbackschema/AsyncRollbackSchema.java @@ -0,0 +1,50 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS 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.pubsub.v1.samples; + +// [START pubsub_v1_generated_SchemaService_RollbackSchema_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.pubsub.v1.SchemaServiceClient; +import com.google.pubsub.v1.RollbackSchemaRequest; +import com.google.pubsub.v1.Schema; +import com.google.pubsub.v1.SchemaName; + +public class AsyncRollbackSchema { + + public static void main(String[] args) throws Exception { + asyncRollbackSchema(); + } + + public static void asyncRollbackSchema() 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 (SchemaServiceClient schemaServiceClient = SchemaServiceClient.create()) { + RollbackSchemaRequest request = + RollbackSchemaRequest.newBuilder() + .setName(SchemaName.of("[PROJECT]", "[SCHEMA]").toString()) + .setRevisionId("revisionId-1507445162") + .build(); + ApiFuture future = schemaServiceClient.rollbackSchemaCallable().futureCall(request); + // Do something. + Schema response = future.get(); + } + } +} +// [END pubsub_v1_generated_SchemaService_RollbackSchema_async] diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaservice/rollbackschema/SyncRollbackSchema.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaservice/rollbackschema/SyncRollbackSchema.java new file mode 100644 index 0000000000..e33de46ad6 --- /dev/null +++ b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaservice/rollbackschema/SyncRollbackSchema.java @@ -0,0 +1,47 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS 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.pubsub.v1.samples; + +// [START pubsub_v1_generated_SchemaService_RollbackSchema_sync] +import com.google.cloud.pubsub.v1.SchemaServiceClient; +import com.google.pubsub.v1.RollbackSchemaRequest; +import com.google.pubsub.v1.Schema; +import com.google.pubsub.v1.SchemaName; + +public class SyncRollbackSchema { + + public static void main(String[] args) throws Exception { + syncRollbackSchema(); + } + + public static void syncRollbackSchema() 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 (SchemaServiceClient schemaServiceClient = SchemaServiceClient.create()) { + RollbackSchemaRequest request = + RollbackSchemaRequest.newBuilder() + .setName(SchemaName.of("[PROJECT]", "[SCHEMA]").toString()) + .setRevisionId("revisionId-1507445162") + .build(); + Schema response = schemaServiceClient.rollbackSchema(request); + } + } +} +// [END pubsub_v1_generated_SchemaService_RollbackSchema_sync] diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaservice/rollbackschema/SyncRollbackSchemaSchemanameString.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaservice/rollbackschema/SyncRollbackSchemaSchemanameString.java new file mode 100644 index 0000000000..4af07be919 --- /dev/null +++ b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaservice/rollbackschema/SyncRollbackSchemaSchemanameString.java @@ -0,0 +1,43 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS 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.pubsub.v1.samples; + +// [START pubsub_v1_generated_SchemaService_RollbackSchema_SchemanameString_sync] +import com.google.cloud.pubsub.v1.SchemaServiceClient; +import com.google.pubsub.v1.Schema; +import com.google.pubsub.v1.SchemaName; + +public class SyncRollbackSchemaSchemanameString { + + public static void main(String[] args) throws Exception { + syncRollbackSchemaSchemanameString(); + } + + public static void syncRollbackSchemaSchemanameString() 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 (SchemaServiceClient schemaServiceClient = SchemaServiceClient.create()) { + SchemaName name = SchemaName.of("[PROJECT]", "[SCHEMA]"); + String revisionId = "revisionId-1507445162"; + Schema response = schemaServiceClient.rollbackSchema(name, revisionId); + } + } +} +// [END pubsub_v1_generated_SchemaService_RollbackSchema_SchemanameString_sync] diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaservice/rollbackschema/SyncRollbackSchemaStringString.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaservice/rollbackschema/SyncRollbackSchemaStringString.java new file mode 100644 index 0000000000..50bc6104db --- /dev/null +++ b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaservice/rollbackschema/SyncRollbackSchemaStringString.java @@ -0,0 +1,43 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS 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.pubsub.v1.samples; + +// [START pubsub_v1_generated_SchemaService_RollbackSchema_StringString_sync] +import com.google.cloud.pubsub.v1.SchemaServiceClient; +import com.google.pubsub.v1.Schema; +import com.google.pubsub.v1.SchemaName; + +public class SyncRollbackSchemaStringString { + + public static void main(String[] args) throws Exception { + syncRollbackSchemaStringString(); + } + + public static void syncRollbackSchemaStringString() 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 (SchemaServiceClient schemaServiceClient = SchemaServiceClient.create()) { + String name = SchemaName.of("[PROJECT]", "[SCHEMA]").toString(); + String revisionId = "revisionId-1507445162"; + Schema response = schemaServiceClient.rollbackSchema(name, revisionId); + } + } +} +// [END pubsub_v1_generated_SchemaService_RollbackSchema_StringString_sync] diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaservice/setiampolicy/AsyncSetIamPolicy.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaservice/setiampolicy/AsyncSetIamPolicy.java index 2ed22cb875..84d1399ae3 100644 --- a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaservice/setiampolicy/AsyncSetIamPolicy.java +++ b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaservice/setiampolicy/AsyncSetIamPolicy.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -21,6 +21,7 @@ import com.google.cloud.pubsub.v1.SchemaServiceClient; import com.google.iam.v1.Policy; import com.google.iam.v1.SetIamPolicyRequest; +import com.google.protobuf.FieldMask; import com.google.pubsub.v1.SnapshotName; public class AsyncSetIamPolicy { @@ -40,6 +41,7 @@ public static void asyncSetIamPolicy() throws Exception { SetIamPolicyRequest.newBuilder() .setResource(SnapshotName.of("[PROJECT]", "[SNAPSHOT]").toString()) .setPolicy(Policy.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) .build(); ApiFuture future = schemaServiceClient.setIamPolicyCallable().futureCall(request); // Do something. diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaservice/setiampolicy/SyncSetIamPolicy.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaservice/setiampolicy/SyncSetIamPolicy.java index e5bd624781..6d08aa7645 100644 --- a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaservice/setiampolicy/SyncSetIamPolicy.java +++ b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaservice/setiampolicy/SyncSetIamPolicy.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -20,6 +20,7 @@ import com.google.cloud.pubsub.v1.SchemaServiceClient; import com.google.iam.v1.Policy; import com.google.iam.v1.SetIamPolicyRequest; +import com.google.protobuf.FieldMask; import com.google.pubsub.v1.SnapshotName; public class SyncSetIamPolicy { @@ -39,6 +40,7 @@ public static void syncSetIamPolicy() throws Exception { SetIamPolicyRequest.newBuilder() .setResource(SnapshotName.of("[PROJECT]", "[SNAPSHOT]").toString()) .setPolicy(Policy.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) .build(); Policy response = schemaServiceClient.setIamPolicy(request); } diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaservice/testiampermissions/AsyncTestIamPermissions.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaservice/testiampermissions/AsyncTestIamPermissions.java index f90e406a06..aa88f626df 100644 --- a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaservice/testiampermissions/AsyncTestIamPermissions.java +++ b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaservice/testiampermissions/AsyncTestIamPermissions.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaservice/testiampermissions/SyncTestIamPermissions.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaservice/testiampermissions/SyncTestIamPermissions.java index 2cc276ac72..8ad75c6508 100644 --- a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaservice/testiampermissions/SyncTestIamPermissions.java +++ b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaservice/testiampermissions/SyncTestIamPermissions.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaservice/validatemessage/AsyncValidateMessage.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaservice/validatemessage/AsyncValidateMessage.java index 9e14354d7b..356e68b51b 100644 --- a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaservice/validatemessage/AsyncValidateMessage.java +++ b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaservice/validatemessage/AsyncValidateMessage.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaservice/validatemessage/SyncValidateMessage.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaservice/validatemessage/SyncValidateMessage.java index 639b29346b..a7f0c433ef 100644 --- a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaservice/validatemessage/SyncValidateMessage.java +++ b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaservice/validatemessage/SyncValidateMessage.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaservice/validateschema/AsyncValidateSchema.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaservice/validateschema/AsyncValidateSchema.java index ff299bad22..d268f795ec 100644 --- a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaservice/validateschema/AsyncValidateSchema.java +++ b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaservice/validateschema/AsyncValidateSchema.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaservice/validateschema/SyncValidateSchema.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaservice/validateschema/SyncValidateSchema.java index 4855420298..8aef9a1fc4 100644 --- a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaservice/validateschema/SyncValidateSchema.java +++ b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaservice/validateschema/SyncValidateSchema.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaservice/validateschema/SyncValidateSchemaProjectnameSchema.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaservice/validateschema/SyncValidateSchemaProjectnameSchema.java index 02e4cd0c20..43c57f73c6 100644 --- a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaservice/validateschema/SyncValidateSchemaProjectnameSchema.java +++ b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaservice/validateschema/SyncValidateSchemaProjectnameSchema.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaservice/validateschema/SyncValidateSchemaStringSchema.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaservice/validateschema/SyncValidateSchemaStringSchema.java index 0b99145866..3800c993be 100644 --- a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaservice/validateschema/SyncValidateSchemaStringSchema.java +++ b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaservice/validateschema/SyncValidateSchemaStringSchema.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaservicesettings/createschema/SyncCreateSchema.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaservicesettings/createschema/SyncCreateSchema.java index b19fdbf7fb..35fa726aa8 100644 --- a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaservicesettings/createschema/SyncCreateSchema.java +++ b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaservicesettings/createschema/SyncCreateSchema.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -40,7 +40,14 @@ public static void syncCreateSchema() throws Exception { .createSchemaSettings() .getRetrySettings() .toBuilder() - .setTotalTimeout(Duration.ofSeconds(30)) + .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()); SchemaServiceSettings schemaServiceSettings = schemaServiceSettingsBuilder.build(); } diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/stub/publisherstubsettings/createtopic/SyncCreateTopic.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/stub/publisherstubsettings/createtopic/SyncCreateTopic.java index df62a5021b..786b8ecb65 100644 --- a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/stub/publisherstubsettings/createtopic/SyncCreateTopic.java +++ b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/stub/publisherstubsettings/createtopic/SyncCreateTopic.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -40,7 +40,14 @@ public static void syncCreateTopic() throws Exception { .createTopicSettings() .getRetrySettings() .toBuilder() - .setTotalTimeout(Duration.ofSeconds(30)) + .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()); PublisherStubSettings topicAdminSettings = topicAdminSettingsBuilder.build(); } diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/stub/schemaservicestubsettings/createschema/SyncCreateSchema.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/stub/schemaservicestubsettings/createschema/SyncCreateSchema.java index 5f9bbe406f..0d79c7337b 100644 --- a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/stub/schemaservicestubsettings/createschema/SyncCreateSchema.java +++ b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/stub/schemaservicestubsettings/createschema/SyncCreateSchema.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -41,7 +41,14 @@ public static void syncCreateSchema() throws Exception { .createSchemaSettings() .getRetrySettings() .toBuilder() - .setTotalTimeout(Duration.ofSeconds(30)) + .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()); SchemaServiceStubSettings schemaServiceSettings = schemaServiceSettingsBuilder.build(); } diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/stub/subscriberstubsettings/createsubscription/SyncCreateSubscription.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/stub/subscriberstubsettings/createsubscription/SyncCreateSubscription.java index ea4083396e..febf7ed6e3 100644 --- a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/stub/subscriberstubsettings/createsubscription/SyncCreateSubscription.java +++ b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/stub/subscriberstubsettings/createsubscription/SyncCreateSubscription.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -41,7 +41,14 @@ public static void syncCreateSubscription() throws Exception { .createSubscriptionSettings() .getRetrySettings() .toBuilder() - .setTotalTimeout(Duration.ofSeconds(30)) + .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()); SubscriberStubSettings subscriptionAdminSettings = subscriptionAdminSettingsBuilder.build(); } diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriber/acknowledge/AsyncAcknowledge.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriber/acknowledge/AsyncAcknowledge.java index b61fc7b2c6..2ba52b0cea 100644 --- a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriber/acknowledge/AsyncAcknowledge.java +++ b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriber/acknowledge/AsyncAcknowledge.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriber/acknowledge/SyncAcknowledge.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriber/acknowledge/SyncAcknowledge.java index 5a9ffe0368..7b89b31cce 100644 --- a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriber/acknowledge/SyncAcknowledge.java +++ b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriber/acknowledge/SyncAcknowledge.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriber/acknowledge/SyncAcknowledgeStringListstring.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriber/acknowledge/SyncAcknowledgeStringListstring.java index 71ca1c00ca..6c22663b14 100644 --- a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriber/acknowledge/SyncAcknowledgeStringListstring.java +++ b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriber/acknowledge/SyncAcknowledgeStringListstring.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriber/acknowledge/SyncAcknowledgeSubscriptionnameListstring.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriber/acknowledge/SyncAcknowledgeSubscriptionnameListstring.java index 23eb8043f2..3605d635ab 100644 --- a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriber/acknowledge/SyncAcknowledgeSubscriptionnameListstring.java +++ b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriber/acknowledge/SyncAcknowledgeSubscriptionnameListstring.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriber/create/SyncCreateSetCredentialsProvider.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriber/create/SyncCreateSetCredentialsProvider.java index c97f801f0b..704dd146c3 100644 --- a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriber/create/SyncCreateSetCredentialsProvider.java +++ b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriber/create/SyncCreateSetCredentialsProvider.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriber/create/SyncCreateSetEndpoint.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriber/create/SyncCreateSetEndpoint.java index f8b340ee5f..0d1f097f30 100644 --- a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriber/create/SyncCreateSetEndpoint.java +++ b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriber/create/SyncCreateSetEndpoint.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriber/createsnapshot/AsyncCreateSnapshot.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriber/createsnapshot/AsyncCreateSnapshot.java index 268d565f18..adb7f93efd 100644 --- a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriber/createsnapshot/AsyncCreateSnapshot.java +++ b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriber/createsnapshot/AsyncCreateSnapshot.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriber/createsnapshot/SyncCreateSnapshot.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriber/createsnapshot/SyncCreateSnapshot.java index f1025baa61..93b13de5bf 100644 --- a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriber/createsnapshot/SyncCreateSnapshot.java +++ b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriber/createsnapshot/SyncCreateSnapshot.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriber/createsnapshot/SyncCreateSnapshotSnapshotnameString.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriber/createsnapshot/SyncCreateSnapshotSnapshotnameString.java index 7fe500754d..05107090e8 100644 --- a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriber/createsnapshot/SyncCreateSnapshotSnapshotnameString.java +++ b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriber/createsnapshot/SyncCreateSnapshotSnapshotnameString.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriber/createsnapshot/SyncCreateSnapshotSnapshotnameSubscriptionname.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriber/createsnapshot/SyncCreateSnapshotSnapshotnameSubscriptionname.java index cae1578959..e0bed40e53 100644 --- a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriber/createsnapshot/SyncCreateSnapshotSnapshotnameSubscriptionname.java +++ b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriber/createsnapshot/SyncCreateSnapshotSnapshotnameSubscriptionname.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriber/createsnapshot/SyncCreateSnapshotStringString.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriber/createsnapshot/SyncCreateSnapshotStringString.java index fdf6b8daec..0ae3fd92b7 100644 --- a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriber/createsnapshot/SyncCreateSnapshotStringString.java +++ b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriber/createsnapshot/SyncCreateSnapshotStringString.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriber/createsnapshot/SyncCreateSnapshotStringSubscriptionname.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriber/createsnapshot/SyncCreateSnapshotStringSubscriptionname.java index 15bd89cb28..a1397bc665 100644 --- a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriber/createsnapshot/SyncCreateSnapshotStringSubscriptionname.java +++ b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriber/createsnapshot/SyncCreateSnapshotStringSubscriptionname.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriber/createsubscription/AsyncCreateSubscription.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriber/createsubscription/AsyncCreateSubscription.java index 80d4398dcc..3387666495 100644 --- a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriber/createsubscription/AsyncCreateSubscription.java +++ b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriber/createsubscription/AsyncCreateSubscription.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -20,6 +20,7 @@ import com.google.api.core.ApiFuture; import com.google.cloud.pubsub.v1.SubscriptionAdminClient; import com.google.protobuf.Duration; +import com.google.pubsub.v1.BigQueryConfig; import com.google.pubsub.v1.DeadLetterPolicy; import com.google.pubsub.v1.ExpirationPolicy; import com.google.pubsub.v1.PushConfig; @@ -47,6 +48,7 @@ public static void asyncCreateSubscription() throws Exception { .setName(SubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]").toString()) .setTopic(TopicName.ofProjectTopicName("[PROJECT]", "[TOPIC]").toString()) .setPushConfig(PushConfig.newBuilder().build()) + .setBigqueryConfig(BigQueryConfig.newBuilder().build()) .setAckDeadlineSeconds(2135351438) .setRetainAckedMessages(true) .setMessageRetentionDuration(Duration.newBuilder().build()) diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriber/createsubscription/SyncCreateSubscription.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriber/createsubscription/SyncCreateSubscription.java index 6f7d3845b6..bb61b0050a 100644 --- a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriber/createsubscription/SyncCreateSubscription.java +++ b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriber/createsubscription/SyncCreateSubscription.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -19,6 +19,7 @@ // [START pubsub_v1_generated_Subscriber_CreateSubscription_sync] import com.google.cloud.pubsub.v1.SubscriptionAdminClient; import com.google.protobuf.Duration; +import com.google.pubsub.v1.BigQueryConfig; import com.google.pubsub.v1.DeadLetterPolicy; import com.google.pubsub.v1.ExpirationPolicy; import com.google.pubsub.v1.PushConfig; @@ -46,6 +47,7 @@ public static void syncCreateSubscription() throws Exception { .setName(SubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]").toString()) .setTopic(TopicName.ofProjectTopicName("[PROJECT]", "[TOPIC]").toString()) .setPushConfig(PushConfig.newBuilder().build()) + .setBigqueryConfig(BigQueryConfig.newBuilder().build()) .setAckDeadlineSeconds(2135351438) .setRetainAckedMessages(true) .setMessageRetentionDuration(Duration.newBuilder().build()) diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriber/createsubscription/SyncCreateSubscriptionStringStringPushconfigInt.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriber/createsubscription/SyncCreateSubscriptionStringStringPushconfigInt.java index 92fa5bfd3e..3248a268c6 100644 --- a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriber/createsubscription/SyncCreateSubscriptionStringStringPushconfigInt.java +++ b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriber/createsubscription/SyncCreateSubscriptionStringStringPushconfigInt.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriber/createsubscription/SyncCreateSubscriptionStringTopicnamePushconfigInt.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriber/createsubscription/SyncCreateSubscriptionStringTopicnamePushconfigInt.java index 141563b0a6..91de43f338 100644 --- a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriber/createsubscription/SyncCreateSubscriptionStringTopicnamePushconfigInt.java +++ b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriber/createsubscription/SyncCreateSubscriptionStringTopicnamePushconfigInt.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriber/createsubscription/SyncCreateSubscriptionSubscriptionnameStringPushconfigInt.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriber/createsubscription/SyncCreateSubscriptionSubscriptionnameStringPushconfigInt.java index bfd8ba0ad2..a867e0839d 100644 --- a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriber/createsubscription/SyncCreateSubscriptionSubscriptionnameStringPushconfigInt.java +++ b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriber/createsubscription/SyncCreateSubscriptionSubscriptionnameStringPushconfigInt.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriber/createsubscription/SyncCreateSubscriptionSubscriptionnameTopicnamePushconfigInt.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriber/createsubscription/SyncCreateSubscriptionSubscriptionnameTopicnamePushconfigInt.java index 7028163a76..be22fc0713 100644 --- a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriber/createsubscription/SyncCreateSubscriptionSubscriptionnameTopicnamePushconfigInt.java +++ b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriber/createsubscription/SyncCreateSubscriptionSubscriptionnameTopicnamePushconfigInt.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriber/deletesnapshot/AsyncDeleteSnapshot.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriber/deletesnapshot/AsyncDeleteSnapshot.java index c85d0f4b06..b8f665c141 100644 --- a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriber/deletesnapshot/AsyncDeleteSnapshot.java +++ b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriber/deletesnapshot/AsyncDeleteSnapshot.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriber/deletesnapshot/SyncDeleteSnapshot.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriber/deletesnapshot/SyncDeleteSnapshot.java index a807d55be0..a64be8c948 100644 --- a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriber/deletesnapshot/SyncDeleteSnapshot.java +++ b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriber/deletesnapshot/SyncDeleteSnapshot.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriber/deletesnapshot/SyncDeleteSnapshotSnapshotname.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriber/deletesnapshot/SyncDeleteSnapshotSnapshotname.java index 5a53e2cf88..30534df174 100644 --- a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriber/deletesnapshot/SyncDeleteSnapshotSnapshotname.java +++ b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriber/deletesnapshot/SyncDeleteSnapshotSnapshotname.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriber/deletesnapshot/SyncDeleteSnapshotString.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriber/deletesnapshot/SyncDeleteSnapshotString.java index a995d22f73..96c42d4c6f 100644 --- a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriber/deletesnapshot/SyncDeleteSnapshotString.java +++ b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriber/deletesnapshot/SyncDeleteSnapshotString.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriber/deletesubscription/AsyncDeleteSubscription.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriber/deletesubscription/AsyncDeleteSubscription.java index 60c66767e6..9c1013ec89 100644 --- a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriber/deletesubscription/AsyncDeleteSubscription.java +++ b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriber/deletesubscription/AsyncDeleteSubscription.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriber/deletesubscription/SyncDeleteSubscription.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriber/deletesubscription/SyncDeleteSubscription.java index 5eba50c9e9..386bc2606a 100644 --- a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriber/deletesubscription/SyncDeleteSubscription.java +++ b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriber/deletesubscription/SyncDeleteSubscription.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriber/deletesubscription/SyncDeleteSubscriptionString.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriber/deletesubscription/SyncDeleteSubscriptionString.java index 95ba167c91..d304d5ba61 100644 --- a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriber/deletesubscription/SyncDeleteSubscriptionString.java +++ b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriber/deletesubscription/SyncDeleteSubscriptionString.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriber/deletesubscription/SyncDeleteSubscriptionSubscriptionname.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriber/deletesubscription/SyncDeleteSubscriptionSubscriptionname.java index b9af13c79c..f9981ab857 100644 --- a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriber/deletesubscription/SyncDeleteSubscriptionSubscriptionname.java +++ b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriber/deletesubscription/SyncDeleteSubscriptionSubscriptionname.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriber/getiampolicy/AsyncGetIamPolicy.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriber/getiampolicy/AsyncGetIamPolicy.java index 454c352c44..660f91c1be 100644 --- a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriber/getiampolicy/AsyncGetIamPolicy.java +++ b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriber/getiampolicy/AsyncGetIamPolicy.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriber/getiampolicy/SyncGetIamPolicy.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriber/getiampolicy/SyncGetIamPolicy.java index 2a0442533e..6178a50841 100644 --- a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriber/getiampolicy/SyncGetIamPolicy.java +++ b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriber/getiampolicy/SyncGetIamPolicy.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriber/getsnapshot/AsyncGetSnapshot.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriber/getsnapshot/AsyncGetSnapshot.java index 3683548922..b40977e4f4 100644 --- a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriber/getsnapshot/AsyncGetSnapshot.java +++ b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriber/getsnapshot/AsyncGetSnapshot.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriber/getsnapshot/SyncGetSnapshot.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriber/getsnapshot/SyncGetSnapshot.java index c3e3815562..9ad1268e48 100644 --- a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriber/getsnapshot/SyncGetSnapshot.java +++ b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriber/getsnapshot/SyncGetSnapshot.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriber/getsnapshot/SyncGetSnapshotSnapshotname.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriber/getsnapshot/SyncGetSnapshotSnapshotname.java index c31158a3ab..b9a93739fe 100644 --- a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriber/getsnapshot/SyncGetSnapshotSnapshotname.java +++ b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriber/getsnapshot/SyncGetSnapshotSnapshotname.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriber/getsnapshot/SyncGetSnapshotString.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriber/getsnapshot/SyncGetSnapshotString.java index 66ef4b7d19..1f2b192858 100644 --- a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriber/getsnapshot/SyncGetSnapshotString.java +++ b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriber/getsnapshot/SyncGetSnapshotString.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriber/getsubscription/AsyncGetSubscription.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriber/getsubscription/AsyncGetSubscription.java index a6ff85a1fe..730f46f01d 100644 --- a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriber/getsubscription/AsyncGetSubscription.java +++ b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriber/getsubscription/AsyncGetSubscription.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriber/getsubscription/SyncGetSubscription.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriber/getsubscription/SyncGetSubscription.java index a49256c431..14190bf3e1 100644 --- a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriber/getsubscription/SyncGetSubscription.java +++ b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriber/getsubscription/SyncGetSubscription.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriber/getsubscription/SyncGetSubscriptionString.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriber/getsubscription/SyncGetSubscriptionString.java index 311862d3aa..004be232ae 100644 --- a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriber/getsubscription/SyncGetSubscriptionString.java +++ b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriber/getsubscription/SyncGetSubscriptionString.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriber/getsubscription/SyncGetSubscriptionSubscriptionname.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriber/getsubscription/SyncGetSubscriptionSubscriptionname.java index 7cb6dc3a8d..0ab97f1011 100644 --- a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriber/getsubscription/SyncGetSubscriptionSubscriptionname.java +++ b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriber/getsubscription/SyncGetSubscriptionSubscriptionname.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriber/listsnapshots/AsyncListSnapshots.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriber/listsnapshots/AsyncListSnapshots.java index 945a3c564b..e1399fcc03 100644 --- a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriber/listsnapshots/AsyncListSnapshots.java +++ b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriber/listsnapshots/AsyncListSnapshots.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriber/listsnapshots/AsyncListSnapshotsPaged.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriber/listsnapshots/AsyncListSnapshotsPaged.java index 6baa3920b1..03dd9f893a 100644 --- a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriber/listsnapshots/AsyncListSnapshotsPaged.java +++ b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriber/listsnapshots/AsyncListSnapshotsPaged.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriber/listsnapshots/SyncListSnapshots.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriber/listsnapshots/SyncListSnapshots.java index 56a4755df7..e18ad85edf 100644 --- a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriber/listsnapshots/SyncListSnapshots.java +++ b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriber/listsnapshots/SyncListSnapshots.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriber/listsnapshots/SyncListSnapshotsProjectname.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriber/listsnapshots/SyncListSnapshotsProjectname.java index ae798c14e5..960fc91ec8 100644 --- a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriber/listsnapshots/SyncListSnapshotsProjectname.java +++ b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriber/listsnapshots/SyncListSnapshotsProjectname.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriber/listsnapshots/SyncListSnapshotsString.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriber/listsnapshots/SyncListSnapshotsString.java index 25651fb030..1708cf30f5 100644 --- a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriber/listsnapshots/SyncListSnapshotsString.java +++ b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriber/listsnapshots/SyncListSnapshotsString.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriber/listsubscriptions/AsyncListSubscriptions.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriber/listsubscriptions/AsyncListSubscriptions.java index a6bca38708..bdb1c08a56 100644 --- a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriber/listsubscriptions/AsyncListSubscriptions.java +++ b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriber/listsubscriptions/AsyncListSubscriptions.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriber/listsubscriptions/AsyncListSubscriptionsPaged.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriber/listsubscriptions/AsyncListSubscriptionsPaged.java index c07bfa442a..8ea74de42b 100644 --- a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriber/listsubscriptions/AsyncListSubscriptionsPaged.java +++ b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriber/listsubscriptions/AsyncListSubscriptionsPaged.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriber/listsubscriptions/SyncListSubscriptions.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriber/listsubscriptions/SyncListSubscriptions.java index efa610bb8c..74c6531596 100644 --- a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriber/listsubscriptions/SyncListSubscriptions.java +++ b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriber/listsubscriptions/SyncListSubscriptions.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriber/listsubscriptions/SyncListSubscriptionsProjectname.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriber/listsubscriptions/SyncListSubscriptionsProjectname.java index bce6aabc30..7d2e7f8f85 100644 --- a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriber/listsubscriptions/SyncListSubscriptionsProjectname.java +++ b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriber/listsubscriptions/SyncListSubscriptionsProjectname.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriber/listsubscriptions/SyncListSubscriptionsString.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriber/listsubscriptions/SyncListSubscriptionsString.java index d11b3fefc3..6644890d5a 100644 --- a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriber/listsubscriptions/SyncListSubscriptionsString.java +++ b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriber/listsubscriptions/SyncListSubscriptionsString.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriber/modifyackdeadline/AsyncModifyAckDeadline.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriber/modifyackdeadline/AsyncModifyAckDeadline.java index 2c80fe321a..b268db7800 100644 --- a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriber/modifyackdeadline/AsyncModifyAckDeadline.java +++ b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriber/modifyackdeadline/AsyncModifyAckDeadline.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriber/modifyackdeadline/SyncModifyAckDeadline.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriber/modifyackdeadline/SyncModifyAckDeadline.java index b3462d25da..51ad45101b 100644 --- a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriber/modifyackdeadline/SyncModifyAckDeadline.java +++ b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriber/modifyackdeadline/SyncModifyAckDeadline.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriber/modifyackdeadline/SyncModifyAckDeadlineStringListstringInt.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriber/modifyackdeadline/SyncModifyAckDeadlineStringListstringInt.java index 50afc17d80..98cbb3e290 100644 --- a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriber/modifyackdeadline/SyncModifyAckDeadlineStringListstringInt.java +++ b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriber/modifyackdeadline/SyncModifyAckDeadlineStringListstringInt.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriber/modifyackdeadline/SyncModifyAckDeadlineSubscriptionnameListstringInt.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriber/modifyackdeadline/SyncModifyAckDeadlineSubscriptionnameListstringInt.java index 9508d6080c..4c8d98ea9a 100644 --- a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriber/modifyackdeadline/SyncModifyAckDeadlineSubscriptionnameListstringInt.java +++ b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriber/modifyackdeadline/SyncModifyAckDeadlineSubscriptionnameListstringInt.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriber/modifypushconfig/AsyncModifyPushConfig.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriber/modifypushconfig/AsyncModifyPushConfig.java index aa51e8dc59..f2c21ac1a1 100644 --- a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriber/modifypushconfig/AsyncModifyPushConfig.java +++ b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriber/modifypushconfig/AsyncModifyPushConfig.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriber/modifypushconfig/SyncModifyPushConfig.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriber/modifypushconfig/SyncModifyPushConfig.java index a6fbb2a8de..fbdb11d593 100644 --- a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriber/modifypushconfig/SyncModifyPushConfig.java +++ b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriber/modifypushconfig/SyncModifyPushConfig.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriber/modifypushconfig/SyncModifyPushConfigStringPushconfig.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriber/modifypushconfig/SyncModifyPushConfigStringPushconfig.java index 71642d3a42..b105f22d2e 100644 --- a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriber/modifypushconfig/SyncModifyPushConfigStringPushconfig.java +++ b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriber/modifypushconfig/SyncModifyPushConfigStringPushconfig.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriber/modifypushconfig/SyncModifyPushConfigSubscriptionnamePushconfig.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriber/modifypushconfig/SyncModifyPushConfigSubscriptionnamePushconfig.java index f65ac93e46..6b135a87d3 100644 --- a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriber/modifypushconfig/SyncModifyPushConfigSubscriptionnamePushconfig.java +++ b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriber/modifypushconfig/SyncModifyPushConfigSubscriptionnamePushconfig.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriber/pull/AsyncPull.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriber/pull/AsyncPull.java index 4ab60d852d..1563a58d5d 100644 --- a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriber/pull/AsyncPull.java +++ b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriber/pull/AsyncPull.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriber/pull/SyncPull.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriber/pull/SyncPull.java index 8bed94fe25..9946f0e725 100644 --- a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriber/pull/SyncPull.java +++ b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriber/pull/SyncPull.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriber/pull/SyncPullStringBooleanInt.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriber/pull/SyncPullStringBooleanInt.java index ae23e170c9..f324690cf6 100644 --- a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriber/pull/SyncPullStringBooleanInt.java +++ b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriber/pull/SyncPullStringBooleanInt.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriber/pull/SyncPullStringInt.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriber/pull/SyncPullStringInt.java index 19bb1784a2..54e517ed9f 100644 --- a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriber/pull/SyncPullStringInt.java +++ b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriber/pull/SyncPullStringInt.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriber/pull/SyncPullSubscriptionnameBooleanInt.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriber/pull/SyncPullSubscriptionnameBooleanInt.java index 9ade351b72..d047a1d404 100644 --- a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriber/pull/SyncPullSubscriptionnameBooleanInt.java +++ b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriber/pull/SyncPullSubscriptionnameBooleanInt.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriber/pull/SyncPullSubscriptionnameInt.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriber/pull/SyncPullSubscriptionnameInt.java index 61a62b6a2f..a6d91ac067 100644 --- a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriber/pull/SyncPullSubscriptionnameInt.java +++ b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriber/pull/SyncPullSubscriptionnameInt.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriber/seek/AsyncSeek.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriber/seek/AsyncSeek.java index c3641d8473..b62f64c087 100644 --- a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriber/seek/AsyncSeek.java +++ b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriber/seek/AsyncSeek.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriber/seek/SyncSeek.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriber/seek/SyncSeek.java index 6ff5634e7f..df0c8f5adc 100644 --- a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriber/seek/SyncSeek.java +++ b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriber/seek/SyncSeek.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriber/setiampolicy/AsyncSetIamPolicy.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriber/setiampolicy/AsyncSetIamPolicy.java index d24e119bbd..33dd87a349 100644 --- a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriber/setiampolicy/AsyncSetIamPolicy.java +++ b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriber/setiampolicy/AsyncSetIamPolicy.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -21,6 +21,7 @@ import com.google.cloud.pubsub.v1.SubscriptionAdminClient; import com.google.iam.v1.Policy; import com.google.iam.v1.SetIamPolicyRequest; +import com.google.protobuf.FieldMask; import com.google.pubsub.v1.SnapshotName; public class AsyncSetIamPolicy { @@ -40,6 +41,7 @@ public static void asyncSetIamPolicy() throws Exception { SetIamPolicyRequest.newBuilder() .setResource(SnapshotName.of("[PROJECT]", "[SNAPSHOT]").toString()) .setPolicy(Policy.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) .build(); ApiFuture future = subscriptionAdminClient.setIamPolicyCallable().futureCall(request); // Do something. diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriber/setiampolicy/SyncSetIamPolicy.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriber/setiampolicy/SyncSetIamPolicy.java index 9c3b9b27e2..1a35334a0f 100644 --- a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriber/setiampolicy/SyncSetIamPolicy.java +++ b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriber/setiampolicy/SyncSetIamPolicy.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -20,6 +20,7 @@ import com.google.cloud.pubsub.v1.SubscriptionAdminClient; import com.google.iam.v1.Policy; import com.google.iam.v1.SetIamPolicyRequest; +import com.google.protobuf.FieldMask; import com.google.pubsub.v1.SnapshotName; public class SyncSetIamPolicy { @@ -39,6 +40,7 @@ public static void syncSetIamPolicy() throws Exception { SetIamPolicyRequest.newBuilder() .setResource(SnapshotName.of("[PROJECT]", "[SNAPSHOT]").toString()) .setPolicy(Policy.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) .build(); Policy response = subscriptionAdminClient.setIamPolicy(request); } diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriber/streamingpull/AsyncStreamingPull.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriber/streamingpull/AsyncStreamingPull.java index eac398483f..758d75c72d 100644 --- a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriber/streamingpull/AsyncStreamingPull.java +++ b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriber/streamingpull/AsyncStreamingPull.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriber/testiampermissions/AsyncTestIamPermissions.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriber/testiampermissions/AsyncTestIamPermissions.java index 2060857ad6..411957b30b 100644 --- a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriber/testiampermissions/AsyncTestIamPermissions.java +++ b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriber/testiampermissions/AsyncTestIamPermissions.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriber/testiampermissions/SyncTestIamPermissions.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriber/testiampermissions/SyncTestIamPermissions.java index e25ec0d84b..e23a8308b5 100644 --- a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriber/testiampermissions/SyncTestIamPermissions.java +++ b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriber/testiampermissions/SyncTestIamPermissions.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriber/updatesnapshot/AsyncUpdateSnapshot.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriber/updatesnapshot/AsyncUpdateSnapshot.java index 16fadb5d46..2b0c27b14b 100644 --- a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriber/updatesnapshot/AsyncUpdateSnapshot.java +++ b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriber/updatesnapshot/AsyncUpdateSnapshot.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriber/updatesnapshot/SyncUpdateSnapshot.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriber/updatesnapshot/SyncUpdateSnapshot.java index fce6a9df70..de6b2a9e3a 100644 --- a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriber/updatesnapshot/SyncUpdateSnapshot.java +++ b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriber/updatesnapshot/SyncUpdateSnapshot.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriber/updatesubscription/AsyncUpdateSubscription.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriber/updatesubscription/AsyncUpdateSubscription.java index 1e3fbd18f2..287ead24fd 100644 --- a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriber/updatesubscription/AsyncUpdateSubscription.java +++ b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriber/updatesubscription/AsyncUpdateSubscription.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriber/updatesubscription/SyncUpdateSubscription.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriber/updatesubscription/SyncUpdateSubscription.java index 517495e7a4..25fb59b2ec 100644 --- a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriber/updatesubscription/SyncUpdateSubscription.java +++ b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriber/updatesubscription/SyncUpdateSubscription.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminsettings/createsubscription/SyncCreateSubscription.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminsettings/createsubscription/SyncCreateSubscription.java index 4b8fc85b52..ebaf88610d 100644 --- a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminsettings/createsubscription/SyncCreateSubscription.java +++ b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminsettings/createsubscription/SyncCreateSubscription.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -41,7 +41,14 @@ public static void syncCreateSubscription() throws Exception { .createSubscriptionSettings() .getRetrySettings() .toBuilder() - .setTotalTimeout(Duration.ofSeconds(30)) + .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()); SubscriptionAdminSettings subscriptionAdminSettings = subscriptionAdminSettingsBuilder.build(); } diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/topicadminsettings/createtopic/SyncCreateTopic.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/topicadminsettings/createtopic/SyncCreateTopic.java index e716aca1df..0bfbbbb48e 100644 --- a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/topicadminsettings/createtopic/SyncCreateTopic.java +++ b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/topicadminsettings/createtopic/SyncCreateTopic.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -40,7 +40,14 @@ public static void syncCreateTopic() throws Exception { .createTopicSettings() .getRetrySettings() .toBuilder() - .setTotalTimeout(Duration.ofSeconds(30)) + .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()); TopicAdminSettings topicAdminSettings = topicAdminSettingsBuilder.build(); } diff --git a/test/integration/goldens/pubsub/src/META-INF/native-image/com.google.cloud.pubsub.v1/reflect-config.json b/test/integration/goldens/pubsub/src/META-INF/native-image/com.google.cloud.pubsub.v1/reflect-config.json new file mode 100644 index 0000000000..859b4ee7bc --- /dev/null +++ b/test/integration/goldens/pubsub/src/META-INF/native-image/com.google.cloud.pubsub.v1/reflect-config.json @@ -0,0 +1,2639 @@ +[ + { + "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.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.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.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.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.iam.v1.AuditConfig", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.iam.v1.AuditConfig$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.iam.v1.AuditConfigDelta", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.iam.v1.AuditConfigDelta$Action", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.iam.v1.AuditConfigDelta$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.iam.v1.AuditLogConfig", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.iam.v1.AuditLogConfig$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.iam.v1.AuditLogConfig$LogType", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.iam.v1.Binding", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.iam.v1.Binding$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.iam.v1.BindingDelta", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.iam.v1.BindingDelta$Action", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.iam.v1.BindingDelta$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.iam.v1.GetIamPolicyRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.iam.v1.GetIamPolicyRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.iam.v1.GetPolicyOptions", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.iam.v1.GetPolicyOptions$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.iam.v1.Policy", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.iam.v1.Policy$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.iam.v1.PolicyDelta", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.iam.v1.PolicyDelta$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.iam.v1.SetIamPolicyRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.iam.v1.SetIamPolicyRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.iam.v1.TestIamPermissionsRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.iam.v1.TestIamPermissionsRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.iam.v1.TestIamPermissionsResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.iam.v1.TestIamPermissionsResponse$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.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.pubsub.v1.AcknowledgeRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.pubsub.v1.AcknowledgeRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.pubsub.v1.BigQueryConfig", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.pubsub.v1.BigQueryConfig$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.pubsub.v1.BigQueryConfig$State", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.pubsub.v1.CommitSchemaRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.pubsub.v1.CommitSchemaRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.pubsub.v1.CreateSchemaRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.pubsub.v1.CreateSchemaRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.pubsub.v1.CreateSnapshotRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.pubsub.v1.CreateSnapshotRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.pubsub.v1.DeadLetterPolicy", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.pubsub.v1.DeadLetterPolicy$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.pubsub.v1.DeleteSchemaRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.pubsub.v1.DeleteSchemaRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.pubsub.v1.DeleteSchemaRevisionRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.pubsub.v1.DeleteSchemaRevisionRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.pubsub.v1.DeleteSnapshotRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.pubsub.v1.DeleteSnapshotRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.pubsub.v1.DeleteSubscriptionRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.pubsub.v1.DeleteSubscriptionRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.pubsub.v1.DeleteTopicRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.pubsub.v1.DeleteTopicRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.pubsub.v1.DetachSubscriptionRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.pubsub.v1.DetachSubscriptionRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.pubsub.v1.DetachSubscriptionResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.pubsub.v1.DetachSubscriptionResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.pubsub.v1.Encoding", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.pubsub.v1.ExpirationPolicy", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.pubsub.v1.ExpirationPolicy$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.pubsub.v1.GetSchemaRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.pubsub.v1.GetSchemaRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.pubsub.v1.GetSnapshotRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.pubsub.v1.GetSnapshotRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.pubsub.v1.GetSubscriptionRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.pubsub.v1.GetSubscriptionRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.pubsub.v1.GetTopicRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.pubsub.v1.GetTopicRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.pubsub.v1.ListSchemaRevisionsRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.pubsub.v1.ListSchemaRevisionsRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.pubsub.v1.ListSchemaRevisionsResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.pubsub.v1.ListSchemaRevisionsResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.pubsub.v1.ListSchemasRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.pubsub.v1.ListSchemasRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.pubsub.v1.ListSchemasResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.pubsub.v1.ListSchemasResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.pubsub.v1.ListSnapshotsRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.pubsub.v1.ListSnapshotsRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.pubsub.v1.ListSnapshotsResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.pubsub.v1.ListSnapshotsResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.pubsub.v1.ListSubscriptionsRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.pubsub.v1.ListSubscriptionsRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.pubsub.v1.ListSubscriptionsResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.pubsub.v1.ListSubscriptionsResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.pubsub.v1.ListTopicSnapshotsRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.pubsub.v1.ListTopicSnapshotsRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.pubsub.v1.ListTopicSnapshotsResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.pubsub.v1.ListTopicSnapshotsResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.pubsub.v1.ListTopicSubscriptionsRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.pubsub.v1.ListTopicSubscriptionsRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.pubsub.v1.ListTopicSubscriptionsResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.pubsub.v1.ListTopicSubscriptionsResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.pubsub.v1.ListTopicsRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.pubsub.v1.ListTopicsRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.pubsub.v1.ListTopicsResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.pubsub.v1.ListTopicsResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.pubsub.v1.MessageStoragePolicy", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.pubsub.v1.MessageStoragePolicy$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.pubsub.v1.ModifyAckDeadlineRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.pubsub.v1.ModifyAckDeadlineRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.pubsub.v1.ModifyPushConfigRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.pubsub.v1.ModifyPushConfigRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.pubsub.v1.PublishRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.pubsub.v1.PublishRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.pubsub.v1.PublishResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.pubsub.v1.PublishResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.pubsub.v1.PubsubMessage", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.pubsub.v1.PubsubMessage$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.pubsub.v1.PullRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.pubsub.v1.PullRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.pubsub.v1.PullResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.pubsub.v1.PullResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.pubsub.v1.PushConfig", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.pubsub.v1.PushConfig$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.pubsub.v1.PushConfig$OidcToken", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.pubsub.v1.PushConfig$OidcToken$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.pubsub.v1.ReceivedMessage", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.pubsub.v1.ReceivedMessage$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.pubsub.v1.RetryPolicy", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.pubsub.v1.RetryPolicy$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.pubsub.v1.RollbackSchemaRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.pubsub.v1.RollbackSchemaRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.pubsub.v1.Schema", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.pubsub.v1.Schema$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.pubsub.v1.Schema$Type", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.pubsub.v1.SchemaSettings", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.pubsub.v1.SchemaSettings$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.pubsub.v1.SchemaView", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.pubsub.v1.SeekRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.pubsub.v1.SeekRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.pubsub.v1.SeekResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.pubsub.v1.SeekResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.pubsub.v1.Snapshot", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.pubsub.v1.Snapshot$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.pubsub.v1.StreamingPullRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.pubsub.v1.StreamingPullRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.pubsub.v1.StreamingPullResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.pubsub.v1.StreamingPullResponse$AcknowledgeConfirmation", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.pubsub.v1.StreamingPullResponse$AcknowledgeConfirmation$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.pubsub.v1.StreamingPullResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.pubsub.v1.StreamingPullResponse$ModifyAckDeadlineConfirmation", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.pubsub.v1.StreamingPullResponse$ModifyAckDeadlineConfirmation$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.pubsub.v1.StreamingPullResponse$SubscriptionProperties", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.pubsub.v1.StreamingPullResponse$SubscriptionProperties$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.pubsub.v1.Subscription", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.pubsub.v1.Subscription$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.pubsub.v1.Subscription$State", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.pubsub.v1.Topic", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.pubsub.v1.Topic$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.pubsub.v1.UpdateSnapshotRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.pubsub.v1.UpdateSnapshotRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.pubsub.v1.UpdateSubscriptionRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.pubsub.v1.UpdateSubscriptionRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.pubsub.v1.UpdateTopicRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.pubsub.v1.UpdateTopicRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.pubsub.v1.ValidateMessageRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.pubsub.v1.ValidateMessageRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.pubsub.v1.ValidateMessageResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.pubsub.v1.ValidateMessageResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.pubsub.v1.ValidateSchemaRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.pubsub.v1.ValidateSchemaRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.pubsub.v1.ValidateSchemaResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.pubsub.v1.ValidateSchemaResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.type.Expr", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.type.Expr$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + } +] \ No newline at end of file diff --git a/test/integration/goldens/pubsub/src/com/google/cloud/pubsub/v1/MockIAMPolicy.java b/test/integration/goldens/pubsub/src/com/google/cloud/pubsub/v1/MockIAMPolicy.java index 85c3e07a01..3c447fc4f4 100644 --- a/test/integration/goldens/pubsub/src/com/google/cloud/pubsub/v1/MockIAMPolicy.java +++ b/test/integration/goldens/pubsub/src/com/google/cloud/pubsub/v1/MockIAMPolicy.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/pubsub/src/com/google/cloud/pubsub/v1/MockIAMPolicyImpl.java b/test/integration/goldens/pubsub/src/com/google/cloud/pubsub/v1/MockIAMPolicyImpl.java index 089b0b380a..9b3838e1f1 100644 --- a/test/integration/goldens/pubsub/src/com/google/cloud/pubsub/v1/MockIAMPolicyImpl.java +++ b/test/integration/goldens/pubsub/src/com/google/cloud/pubsub/v1/MockIAMPolicyImpl.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/pubsub/src/com/google/cloud/pubsub/v1/MockPublisher.java b/test/integration/goldens/pubsub/src/com/google/cloud/pubsub/v1/MockPublisher.java index 31d2b2b095..f992f4bbab 100644 --- a/test/integration/goldens/pubsub/src/com/google/cloud/pubsub/v1/MockPublisher.java +++ b/test/integration/goldens/pubsub/src/com/google/cloud/pubsub/v1/MockPublisher.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/pubsub/src/com/google/cloud/pubsub/v1/MockPublisherImpl.java b/test/integration/goldens/pubsub/src/com/google/cloud/pubsub/v1/MockPublisherImpl.java index 53f88cfe65..a5128d13e9 100644 --- a/test/integration/goldens/pubsub/src/com/google/cloud/pubsub/v1/MockPublisherImpl.java +++ b/test/integration/goldens/pubsub/src/com/google/cloud/pubsub/v1/MockPublisherImpl.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/pubsub/src/com/google/cloud/pubsub/v1/MockSchemaService.java b/test/integration/goldens/pubsub/src/com/google/cloud/pubsub/v1/MockSchemaService.java index 4ebffafed7..e986b7ed54 100644 --- a/test/integration/goldens/pubsub/src/com/google/cloud/pubsub/v1/MockSchemaService.java +++ b/test/integration/goldens/pubsub/src/com/google/cloud/pubsub/v1/MockSchemaService.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/pubsub/src/com/google/cloud/pubsub/v1/MockSchemaServiceImpl.java b/test/integration/goldens/pubsub/src/com/google/cloud/pubsub/v1/MockSchemaServiceImpl.java index 6124aab4d3..be433751eb 100644 --- a/test/integration/goldens/pubsub/src/com/google/cloud/pubsub/v1/MockSchemaServiceImpl.java +++ b/test/integration/goldens/pubsub/src/com/google/cloud/pubsub/v1/MockSchemaServiceImpl.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -19,11 +19,16 @@ import com.google.api.core.BetaApi; import com.google.protobuf.AbstractMessage; import com.google.protobuf.Empty; +import com.google.pubsub.v1.CommitSchemaRequest; import com.google.pubsub.v1.CreateSchemaRequest; import com.google.pubsub.v1.DeleteSchemaRequest; +import com.google.pubsub.v1.DeleteSchemaRevisionRequest; import com.google.pubsub.v1.GetSchemaRequest; +import com.google.pubsub.v1.ListSchemaRevisionsRequest; +import com.google.pubsub.v1.ListSchemaRevisionsResponse; import com.google.pubsub.v1.ListSchemasRequest; import com.google.pubsub.v1.ListSchemasResponse; +import com.google.pubsub.v1.RollbackSchemaRequest; import com.google.pubsub.v1.Schema; import com.google.pubsub.v1.SchemaServiceGrpc.SchemaServiceImplBase; import com.google.pubsub.v1.ValidateMessageRequest; @@ -130,6 +135,90 @@ public void listSchemas( } } + @Override + public void listSchemaRevisions( + ListSchemaRevisionsRequest request, + StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof ListSchemaRevisionsResponse) { + requests.add(request); + responseObserver.onNext(((ListSchemaRevisionsResponse) 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 ListSchemaRevisions, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + ListSchemaRevisionsResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void commitSchema(CommitSchemaRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Schema) { + requests.add(request); + responseObserver.onNext(((Schema) 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 CommitSchema, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Schema.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void rollbackSchema( + RollbackSchemaRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Schema) { + requests.add(request); + responseObserver.onNext(((Schema) 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 RollbackSchema, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Schema.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void deleteSchemaRevision( + DeleteSchemaRevisionRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Schema) { + requests.add(request); + responseObserver.onNext(((Schema) 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 DeleteSchemaRevision, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Schema.class.getName(), + Exception.class.getName()))); + } + } + @Override public void deleteSchema(DeleteSchemaRequest request, StreamObserver responseObserver) { Object response = responses.poll(); diff --git a/test/integration/goldens/pubsub/src/com/google/cloud/pubsub/v1/MockSubscriber.java b/test/integration/goldens/pubsub/src/com/google/cloud/pubsub/v1/MockSubscriber.java index 2615733f7d..a0547f660e 100644 --- a/test/integration/goldens/pubsub/src/com/google/cloud/pubsub/v1/MockSubscriber.java +++ b/test/integration/goldens/pubsub/src/com/google/cloud/pubsub/v1/MockSubscriber.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/pubsub/src/com/google/cloud/pubsub/v1/MockSubscriberImpl.java b/test/integration/goldens/pubsub/src/com/google/cloud/pubsub/v1/MockSubscriberImpl.java index 9747d2ca04..6282ef2d97 100644 --- a/test/integration/goldens/pubsub/src/com/google/cloud/pubsub/v1/MockSubscriberImpl.java +++ b/test/integration/goldens/pubsub/src/com/google/cloud/pubsub/v1/MockSubscriberImpl.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/pubsub/src/com/google/cloud/pubsub/v1/SchemaServiceClient.java b/test/integration/goldens/pubsub/src/com/google/cloud/pubsub/v1/SchemaServiceClient.java index 78442b355b..859ae29a5f 100644 --- a/test/integration/goldens/pubsub/src/com/google/cloud/pubsub/v1/SchemaServiceClient.java +++ b/test/integration/goldens/pubsub/src/com/google/cloud/pubsub/v1/SchemaServiceClient.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -33,12 +33,17 @@ import com.google.iam.v1.TestIamPermissionsRequest; import com.google.iam.v1.TestIamPermissionsResponse; import com.google.protobuf.Empty; +import com.google.pubsub.v1.CommitSchemaRequest; import com.google.pubsub.v1.CreateSchemaRequest; import com.google.pubsub.v1.DeleteSchemaRequest; +import com.google.pubsub.v1.DeleteSchemaRevisionRequest; import com.google.pubsub.v1.GetSchemaRequest; +import com.google.pubsub.v1.ListSchemaRevisionsRequest; +import com.google.pubsub.v1.ListSchemaRevisionsResponse; import com.google.pubsub.v1.ListSchemasRequest; import com.google.pubsub.v1.ListSchemasResponse; import com.google.pubsub.v1.ProjectName; +import com.google.pubsub.v1.RollbackSchemaRequest; import com.google.pubsub.v1.Schema; import com.google.pubsub.v1.SchemaName; import com.google.pubsub.v1.ValidateMessageRequest; @@ -74,19 +79,245 @@ *

        Note: close() needs to be called on the SchemaServiceClient object to clean up resources such * as threads. In the example above, try-with-resources is used, which automatically calls close(). * - *

        The surface of this class includes several types of Java methods for each of the API's - * methods: - * - *

          - *
        1. A "flattened" method. With this type of method, the fields of the request type have been - * converted into function parameters. It may be the case that not all fields are available as - * parameters, and not every API method will have a flattened method entry point. - *
        2. A "request object" method. This type of method only takes one parameter, a request object, - * which must be constructed before the call. Not every API method will have a request object - * method. - *
        3. A "callable" method. This type of method takes no parameters and returns an immutable API - * callable object, which can be used to initiate calls to the service. - *
        + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + *
        Methods
        MethodDescriptionMethod Variants

        CreateSchema

        Creates a schema.

        + *

        Request object method variants only take one parameter, a request object, which must be constructed before the call.

        + *
          + *
        • createSchema(CreateSchemaRequest request) + *

        + *

        "Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

        + *
          + *
        • createSchema(ProjectName parent, Schema schema, String schemaId) + *

        • createSchema(String parent, Schema schema, String schemaId) + *

        + *

        Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

        + *
          + *
        • createSchemaCallable() + *

        + *

        GetSchema

        Gets a schema.

        + *

        Request object method variants only take one parameter, a request object, which must be constructed before the call.

        + *
          + *
        • getSchema(GetSchemaRequest request) + *

        + *

        "Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

        + *
          + *
        • getSchema(SchemaName name) + *

        • getSchema(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.

        + *
          + *
        • getSchemaCallable() + *

        + *

        ListSchemas

        Lists schemas in a project.

        + *

        Request object method variants only take one parameter, a request object, which must be constructed before the call.

        + *
          + *
        • listSchemas(ListSchemasRequest request) + *

        + *

        "Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

        + *
          + *
        • listSchemas(ProjectName parent) + *

        • listSchemas(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.

        + *
          + *
        • listSchemasPagedCallable() + *

        • listSchemasCallable() + *

        + *

        ListSchemaRevisions

        Lists all schema revisions for the named schema.

        + *

        Request object method variants only take one parameter, a request object, which must be constructed before the call.

        + *
          + *
        • listSchemaRevisions(ListSchemaRevisionsRequest request) + *

        + *

        "Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

        + *
          + *
        • listSchemaRevisions(SchemaName name) + *

        • listSchemaRevisions(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.

        + *
          + *
        • listSchemaRevisionsPagedCallable() + *

        • listSchemaRevisionsCallable() + *

        + *

        CommitSchema

        Commits a new schema revision to an existing schema.

        + *

        Request object method variants only take one parameter, a request object, which must be constructed before the call.

        + *
          + *
        • commitSchema(CommitSchemaRequest request) + *

        + *

        "Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

        + *
          + *
        • commitSchema(SchemaName name, Schema schema) + *

        • commitSchema(String name, Schema schema) + *

        + *

        Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

        + *
          + *
        • commitSchemaCallable() + *

        + *

        RollbackSchema

        Creates a new schema revision that is a copy of the provided revision_id.

        + *

        Request object method variants only take one parameter, a request object, which must be constructed before the call.

        + *
          + *
        • rollbackSchema(RollbackSchemaRequest request) + *

        + *

        "Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

        + *
          + *
        • rollbackSchema(SchemaName name, String revisionId) + *

        • rollbackSchema(String name, String revisionId) + *

        + *

        Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

        + *
          + *
        • rollbackSchemaCallable() + *

        + *

        DeleteSchemaRevision

        Deletes a specific schema revision.

        + *

        Request object method variants only take one parameter, a request object, which must be constructed before the call.

        + *
          + *
        • deleteSchemaRevision(DeleteSchemaRevisionRequest request) + *

        + *

        "Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

        + *
          + *
        • deleteSchemaRevision(SchemaName name, String revisionId) + *

        • deleteSchemaRevision(String name, String revisionId) + *

        + *

        Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

        + *
          + *
        • deleteSchemaRevisionCallable() + *

        + *

        DeleteSchema

        Deletes a schema.

        + *

        Request object method variants only take one parameter, a request object, which must be constructed before the call.

        + *
          + *
        • deleteSchema(DeleteSchemaRequest request) + *

        + *

        "Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

        + *
          + *
        • deleteSchema(SchemaName name) + *

        • deleteSchema(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.

        + *
          + *
        • deleteSchemaCallable() + *

        + *

        ValidateSchema

        Validates a schema.

        + *

        Request object method variants only take one parameter, a request object, which must be constructed before the call.

        + *
          + *
        • validateSchema(ValidateSchemaRequest request) + *

        + *

        "Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

        + *
          + *
        • validateSchema(ProjectName parent, Schema schema) + *

        • validateSchema(String parent, Schema schema) + *

        + *

        Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

        + *
          + *
        • validateSchemaCallable() + *

        + *

        ValidateMessage

        Validates a message against a schema.

        + *

        Request object method variants only take one parameter, a request object, which must be constructed before the call.

        + *
          + *
        • validateMessage(ValidateMessageRequest request) + *

        + *

        Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

        + *
          + *
        • validateMessageCallable() + *

        + *

        SetIamPolicy

        Sets the access control policy on the specified resource. Replacesany existing policy. + *

        Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED`errors.

        + *

        Request object method variants only take one parameter, a request object, which must be constructed before the call.

        + *
          + *
        • setIamPolicy(SetIamPolicyRequest request) + *

        + *

        Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

        + *
          + *
        • setIamPolicyCallable() + *

        + *

        GetIamPolicy

        Gets the access control policy for a resource. Returns an empty policyif the resource exists and does not have a policy set.

        + *

        Request object method variants only take one parameter, a request object, which must be constructed before the call.

        + *
          + *
        • getIamPolicy(GetIamPolicyRequest request) + *

        + *

        Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

        + *
          + *
        • getIamPolicyCallable() + *

        + *

        TestIamPermissions

        Returns permissions that a caller has on the specified resource. If theresource does not exist, this will return an empty set ofpermissions, not a `NOT_FOUND` error. + *

        Note: This operation is designed to be used for buildingpermission-aware UIs and command-line tools, not for authorizationchecking. This operation may "fail open" without warning.

        + *

        Request object method variants only take one parameter, a request object, which must be constructed before the call.

        + *
          + *
        • testIamPermissions(TestIamPermissionsRequest request) + *

        + *

        Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

        + *
          + *
        • testIamPermissionsCallable() + *

        + *
        * *

        See the individual methods for example code. * @@ -596,6 +827,544 @@ public final UnaryCallable listSchemasC return stub.listSchemasCallable(); } + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists all schema revisions for the named schema. + * + *

        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 (SchemaServiceClient schemaServiceClient = SchemaServiceClient.create()) {
        +   *   SchemaName name = SchemaName.of("[PROJECT]", "[SCHEMA]");
        +   *   for (Schema element : schemaServiceClient.listSchemaRevisions(name).iterateAll()) {
        +   *     // doThingsWith(element);
        +   *   }
        +   * }
        +   * }
        + * + * @param name Required. The name of the schema to list revisions for. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListSchemaRevisionsPagedResponse listSchemaRevisions(SchemaName name) { + ListSchemaRevisionsRequest request = + ListSchemaRevisionsRequest.newBuilder() + .setName(name == null ? null : name.toString()) + .build(); + return listSchemaRevisions(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists all schema revisions for the named schema. + * + *

        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 (SchemaServiceClient schemaServiceClient = SchemaServiceClient.create()) {
        +   *   String name = SchemaName.of("[PROJECT]", "[SCHEMA]").toString();
        +   *   for (Schema element : schemaServiceClient.listSchemaRevisions(name).iterateAll()) {
        +   *     // doThingsWith(element);
        +   *   }
        +   * }
        +   * }
        + * + * @param name Required. The name of the schema to list revisions for. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListSchemaRevisionsPagedResponse listSchemaRevisions(String name) { + ListSchemaRevisionsRequest request = + ListSchemaRevisionsRequest.newBuilder().setName(name).build(); + return listSchemaRevisions(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists all schema revisions for the named schema. + * + *

        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 (SchemaServiceClient schemaServiceClient = SchemaServiceClient.create()) {
        +   *   ListSchemaRevisionsRequest request =
        +   *       ListSchemaRevisionsRequest.newBuilder()
        +   *           .setName(SchemaName.of("[PROJECT]", "[SCHEMA]").toString())
        +   *           .setView(SchemaView.forNumber(0))
        +   *           .setPageSize(883849137)
        +   *           .setPageToken("pageToken873572522")
        +   *           .build();
        +   *   for (Schema element : schemaServiceClient.listSchemaRevisions(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 ListSchemaRevisionsPagedResponse listSchemaRevisions( + ListSchemaRevisionsRequest request) { + return listSchemaRevisionsPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists all schema revisions for the named schema. + * + *

        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 (SchemaServiceClient schemaServiceClient = SchemaServiceClient.create()) {
        +   *   ListSchemaRevisionsRequest request =
        +   *       ListSchemaRevisionsRequest.newBuilder()
        +   *           .setName(SchemaName.of("[PROJECT]", "[SCHEMA]").toString())
        +   *           .setView(SchemaView.forNumber(0))
        +   *           .setPageSize(883849137)
        +   *           .setPageToken("pageToken873572522")
        +   *           .build();
        +   *   ApiFuture future =
        +   *       schemaServiceClient.listSchemaRevisionsPagedCallable().futureCall(request);
        +   *   // Do something.
        +   *   for (Schema element : future.get().iterateAll()) {
        +   *     // doThingsWith(element);
        +   *   }
        +   * }
        +   * }
        + */ + public final UnaryCallable + listSchemaRevisionsPagedCallable() { + return stub.listSchemaRevisionsPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists all schema revisions for the named schema. + * + *

        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 (SchemaServiceClient schemaServiceClient = SchemaServiceClient.create()) {
        +   *   ListSchemaRevisionsRequest request =
        +   *       ListSchemaRevisionsRequest.newBuilder()
        +   *           .setName(SchemaName.of("[PROJECT]", "[SCHEMA]").toString())
        +   *           .setView(SchemaView.forNumber(0))
        +   *           .setPageSize(883849137)
        +   *           .setPageToken("pageToken873572522")
        +   *           .build();
        +   *   while (true) {
        +   *     ListSchemaRevisionsResponse response =
        +   *         schemaServiceClient.listSchemaRevisionsCallable().call(request);
        +   *     for (Schema element : response.getSchemasList()) {
        +   *       // doThingsWith(element);
        +   *     }
        +   *     String nextPageToken = response.getNextPageToken();
        +   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
        +   *       request = request.toBuilder().setPageToken(nextPageToken).build();
        +   *     } else {
        +   *       break;
        +   *     }
        +   *   }
        +   * }
        +   * }
        + */ + public final UnaryCallable + listSchemaRevisionsCallable() { + return stub.listSchemaRevisionsCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Commits a new schema revision to an existing schema. + * + *

        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 (SchemaServiceClient schemaServiceClient = SchemaServiceClient.create()) {
        +   *   SchemaName name = SchemaName.of("[PROJECT]", "[SCHEMA]");
        +   *   Schema schema = Schema.newBuilder().build();
        +   *   Schema response = schemaServiceClient.commitSchema(name, schema);
        +   * }
        +   * }
        + * + * @param name Required. The name of the schema we are revising. Format is + * `projects/{project}/schemas/{schema}`. + * @param schema Required. The schema revision to commit. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Schema commitSchema(SchemaName name, Schema schema) { + CommitSchemaRequest request = + CommitSchemaRequest.newBuilder() + .setName(name == null ? null : name.toString()) + .setSchema(schema) + .build(); + return commitSchema(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Commits a new schema revision to an existing schema. + * + *

        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 (SchemaServiceClient schemaServiceClient = SchemaServiceClient.create()) {
        +   *   String name = SchemaName.of("[PROJECT]", "[SCHEMA]").toString();
        +   *   Schema schema = Schema.newBuilder().build();
        +   *   Schema response = schemaServiceClient.commitSchema(name, schema);
        +   * }
        +   * }
        + * + * @param name Required. The name of the schema we are revising. Format is + * `projects/{project}/schemas/{schema}`. + * @param schema Required. The schema revision to commit. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Schema commitSchema(String name, Schema schema) { + CommitSchemaRequest request = + CommitSchemaRequest.newBuilder().setName(name).setSchema(schema).build(); + return commitSchema(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Commits a new schema revision to an existing schema. + * + *

        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 (SchemaServiceClient schemaServiceClient = SchemaServiceClient.create()) {
        +   *   CommitSchemaRequest request =
        +   *       CommitSchemaRequest.newBuilder()
        +   *           .setName(SchemaName.of("[PROJECT]", "[SCHEMA]").toString())
        +   *           .setSchema(Schema.newBuilder().build())
        +   *           .build();
        +   *   Schema response = schemaServiceClient.commitSchema(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 Schema commitSchema(CommitSchemaRequest request) { + return commitSchemaCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Commits a new schema revision to an existing schema. + * + *

        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 (SchemaServiceClient schemaServiceClient = SchemaServiceClient.create()) {
        +   *   CommitSchemaRequest request =
        +   *       CommitSchemaRequest.newBuilder()
        +   *           .setName(SchemaName.of("[PROJECT]", "[SCHEMA]").toString())
        +   *           .setSchema(Schema.newBuilder().build())
        +   *           .build();
        +   *   ApiFuture future = schemaServiceClient.commitSchemaCallable().futureCall(request);
        +   *   // Do something.
        +   *   Schema response = future.get();
        +   * }
        +   * }
        + */ + public final UnaryCallable commitSchemaCallable() { + return stub.commitSchemaCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a new schema revision that is a copy of the provided revision_id. + * + *

        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 (SchemaServiceClient schemaServiceClient = SchemaServiceClient.create()) {
        +   *   SchemaName name = SchemaName.of("[PROJECT]", "[SCHEMA]");
        +   *   String revisionId = "revisionId-1507445162";
        +   *   Schema response = schemaServiceClient.rollbackSchema(name, revisionId);
        +   * }
        +   * }
        + * + * @param name Required. The schema being rolled back with revision id. + * @param revisionId Required. The revision ID to roll back to. It must be a revision of the same + * schema. + *

        Example: c7cfa2a8 + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Schema rollbackSchema(SchemaName name, String revisionId) { + RollbackSchemaRequest request = + RollbackSchemaRequest.newBuilder() + .setName(name == null ? null : name.toString()) + .setRevisionId(revisionId) + .build(); + return rollbackSchema(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a new schema revision that is a copy of the provided revision_id. + * + *

        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 (SchemaServiceClient schemaServiceClient = SchemaServiceClient.create()) {
        +   *   String name = SchemaName.of("[PROJECT]", "[SCHEMA]").toString();
        +   *   String revisionId = "revisionId-1507445162";
        +   *   Schema response = schemaServiceClient.rollbackSchema(name, revisionId);
        +   * }
        +   * }
        + * + * @param name Required. The schema being rolled back with revision id. + * @param revisionId Required. The revision ID to roll back to. It must be a revision of the same + * schema. + *

        Example: c7cfa2a8 + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Schema rollbackSchema(String name, String revisionId) { + RollbackSchemaRequest request = + RollbackSchemaRequest.newBuilder().setName(name).setRevisionId(revisionId).build(); + return rollbackSchema(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a new schema revision that is a copy of the provided revision_id. + * + *

        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 (SchemaServiceClient schemaServiceClient = SchemaServiceClient.create()) {
        +   *   RollbackSchemaRequest request =
        +   *       RollbackSchemaRequest.newBuilder()
        +   *           .setName(SchemaName.of("[PROJECT]", "[SCHEMA]").toString())
        +   *           .setRevisionId("revisionId-1507445162")
        +   *           .build();
        +   *   Schema response = schemaServiceClient.rollbackSchema(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 Schema rollbackSchema(RollbackSchemaRequest request) { + return rollbackSchemaCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a new schema revision that is a copy of the provided revision_id. + * + *

        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 (SchemaServiceClient schemaServiceClient = SchemaServiceClient.create()) {
        +   *   RollbackSchemaRequest request =
        +   *       RollbackSchemaRequest.newBuilder()
        +   *           .setName(SchemaName.of("[PROJECT]", "[SCHEMA]").toString())
        +   *           .setRevisionId("revisionId-1507445162")
        +   *           .build();
        +   *   ApiFuture future = schemaServiceClient.rollbackSchemaCallable().futureCall(request);
        +   *   // Do something.
        +   *   Schema response = future.get();
        +   * }
        +   * }
        + */ + public final UnaryCallable rollbackSchemaCallable() { + return stub.rollbackSchemaCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a specific schema revision. + * + *

        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 (SchemaServiceClient schemaServiceClient = SchemaServiceClient.create()) {
        +   *   SchemaName name = SchemaName.of("[PROJECT]", "[SCHEMA]");
        +   *   String revisionId = "revisionId-1507445162";
        +   *   Schema response = schemaServiceClient.deleteSchemaRevision(name, revisionId);
        +   * }
        +   * }
        + * + * @param name Required. The name of the schema revision to be deleted, with a revision ID + * explicitly included. + *

        Example: projects/123/schemas/my-schema{@literal @}c7cfa2a8 + * @param revisionId Required. The revision ID to roll back to. It must be a revision of the same + * schema. + *

        Example: c7cfa2a8 + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Schema deleteSchemaRevision(SchemaName name, String revisionId) { + DeleteSchemaRevisionRequest request = + DeleteSchemaRevisionRequest.newBuilder() + .setName(name == null ? null : name.toString()) + .setRevisionId(revisionId) + .build(); + return deleteSchemaRevision(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a specific schema revision. + * + *

        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 (SchemaServiceClient schemaServiceClient = SchemaServiceClient.create()) {
        +   *   String name = SchemaName.of("[PROJECT]", "[SCHEMA]").toString();
        +   *   String revisionId = "revisionId-1507445162";
        +   *   Schema response = schemaServiceClient.deleteSchemaRevision(name, revisionId);
        +   * }
        +   * }
        + * + * @param name Required. The name of the schema revision to be deleted, with a revision ID + * explicitly included. + *

        Example: projects/123/schemas/my-schema{@literal @}c7cfa2a8 + * @param revisionId Required. The revision ID to roll back to. It must be a revision of the same + * schema. + *

        Example: c7cfa2a8 + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Schema deleteSchemaRevision(String name, String revisionId) { + DeleteSchemaRevisionRequest request = + DeleteSchemaRevisionRequest.newBuilder().setName(name).setRevisionId(revisionId).build(); + return deleteSchemaRevision(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a specific schema revision. + * + *

        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 (SchemaServiceClient schemaServiceClient = SchemaServiceClient.create()) {
        +   *   DeleteSchemaRevisionRequest request =
        +   *       DeleteSchemaRevisionRequest.newBuilder()
        +   *           .setName(SchemaName.of("[PROJECT]", "[SCHEMA]").toString())
        +   *           .setRevisionId("revisionId-1507445162")
        +   *           .build();
        +   *   Schema response = schemaServiceClient.deleteSchemaRevision(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 Schema deleteSchemaRevision(DeleteSchemaRevisionRequest request) { + return deleteSchemaRevisionCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a specific schema revision. + * + *

        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 (SchemaServiceClient schemaServiceClient = SchemaServiceClient.create()) {
        +   *   DeleteSchemaRevisionRequest request =
        +   *       DeleteSchemaRevisionRequest.newBuilder()
        +   *           .setName(SchemaName.of("[PROJECT]", "[SCHEMA]").toString())
        +   *           .setRevisionId("revisionId-1507445162")
        +   *           .build();
        +   *   ApiFuture future =
        +   *       schemaServiceClient.deleteSchemaRevisionCallable().futureCall(request);
        +   *   // Do something.
        +   *   Schema response = future.get();
        +   * }
        +   * }
        + */ + public final UnaryCallable deleteSchemaRevisionCallable() { + return stub.deleteSchemaRevisionCallable(); + } + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Deletes a schema. @@ -908,6 +1677,7 @@ public final ValidateMessageResponse validateMessage(ValidateMessageRequest requ * SetIamPolicyRequest.newBuilder() * .setResource(SnapshotName.of("[PROJECT]", "[SNAPSHOT]").toString()) * .setPolicy(Policy.newBuilder().build()) + * .setUpdateMask(FieldMask.newBuilder().build()) * .build(); * Policy response = schemaServiceClient.setIamPolicy(request); * } @@ -939,6 +1709,7 @@ public final Policy setIamPolicy(SetIamPolicyRequest request) { * SetIamPolicyRequest.newBuilder() * .setResource(SnapshotName.of("[PROJECT]", "[SNAPSHOT]").toString()) * .setPolicy(Policy.newBuilder().build()) + * .setUpdateMask(FieldMask.newBuilder().build()) * .build(); * ApiFuture future = schemaServiceClient.setIamPolicyCallable().futureCall(request); * // Do something. @@ -1180,4 +1951,84 @@ protected ListSchemasFixedSizeCollection createCollection( return new ListSchemasFixedSizeCollection(pages, collectionSize); } } + + public static class ListSchemaRevisionsPagedResponse + extends AbstractPagedListResponse< + ListSchemaRevisionsRequest, + ListSchemaRevisionsResponse, + Schema, + ListSchemaRevisionsPage, + ListSchemaRevisionsFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListSchemaRevisionsPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + input -> new ListSchemaRevisionsPagedResponse(input), + MoreExecutors.directExecutor()); + } + + private ListSchemaRevisionsPagedResponse(ListSchemaRevisionsPage page) { + super(page, ListSchemaRevisionsFixedSizeCollection.createEmptyCollection()); + } + } + + public static class ListSchemaRevisionsPage + extends AbstractPage< + ListSchemaRevisionsRequest, + ListSchemaRevisionsResponse, + Schema, + ListSchemaRevisionsPage> { + + private ListSchemaRevisionsPage( + PageContext context, + ListSchemaRevisionsResponse response) { + super(context, response); + } + + private static ListSchemaRevisionsPage createEmptyPage() { + return new ListSchemaRevisionsPage(null, null); + } + + @Override + protected ListSchemaRevisionsPage createPage( + PageContext context, + ListSchemaRevisionsResponse response) { + return new ListSchemaRevisionsPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class ListSchemaRevisionsFixedSizeCollection + extends AbstractFixedSizeCollection< + ListSchemaRevisionsRequest, + ListSchemaRevisionsResponse, + Schema, + ListSchemaRevisionsPage, + ListSchemaRevisionsFixedSizeCollection> { + + private ListSchemaRevisionsFixedSizeCollection( + List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListSchemaRevisionsFixedSizeCollection createEmptyCollection() { + return new ListSchemaRevisionsFixedSizeCollection(null, 0); + } + + @Override + protected ListSchemaRevisionsFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListSchemaRevisionsFixedSizeCollection(pages, collectionSize); + } + } } diff --git a/test/integration/goldens/pubsub/src/com/google/cloud/pubsub/v1/SchemaServiceClientTest.java b/test/integration/goldens/pubsub/src/com/google/cloud/pubsub/v1/SchemaServiceClientTest.java index fbd7388094..f7bc653b18 100644 --- a/test/integration/goldens/pubsub/src/com/google/cloud/pubsub/v1/SchemaServiceClientTest.java +++ b/test/integration/goldens/pubsub/src/com/google/cloud/pubsub/v1/SchemaServiceClientTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,6 +16,7 @@ package com.google.cloud.pubsub.v1; +import static com.google.cloud.pubsub.v1.SchemaServiceClient.ListSchemaRevisionsPagedResponse; import static com.google.cloud.pubsub.v1.SchemaServiceClient.ListSchemasPagedResponse; import com.google.api.gax.core.NoCredentialsProvider; @@ -26,6 +27,7 @@ import com.google.api.gax.rpc.ApiClientHeaderProvider; import com.google.api.gax.rpc.InvalidArgumentException; import com.google.common.collect.Lists; +import com.google.iam.v1.AuditConfig; import com.google.iam.v1.Binding; import com.google.iam.v1.GetIamPolicyRequest; import com.google.iam.v1.GetPolicyOptions; @@ -36,13 +38,20 @@ import com.google.protobuf.AbstractMessage; import com.google.protobuf.ByteString; import com.google.protobuf.Empty; +import com.google.protobuf.FieldMask; +import com.google.protobuf.Timestamp; +import com.google.pubsub.v1.CommitSchemaRequest; import com.google.pubsub.v1.CreateSchemaRequest; import com.google.pubsub.v1.DeleteSchemaRequest; +import com.google.pubsub.v1.DeleteSchemaRevisionRequest; import com.google.pubsub.v1.Encoding; import com.google.pubsub.v1.GetSchemaRequest; +import com.google.pubsub.v1.ListSchemaRevisionsRequest; +import com.google.pubsub.v1.ListSchemaRevisionsResponse; import com.google.pubsub.v1.ListSchemasRequest; import com.google.pubsub.v1.ListSchemasResponse; import com.google.pubsub.v1.ProjectName; +import com.google.pubsub.v1.RollbackSchemaRequest; import com.google.pubsub.v1.Schema; import com.google.pubsub.v1.SchemaName; import com.google.pubsub.v1.SnapshotName; @@ -111,6 +120,8 @@ public void createSchemaTest() throws Exception { Schema.newBuilder() .setName(SchemaName.of("[PROJECT]", "[SCHEMA]").toString()) .setDefinition("definition-1014418093") + .setRevisionId("revisionId-1507445162") + .setRevisionCreateTime(Timestamp.newBuilder().build()) .build(); mockSchemaService.addResponse(expectedResponse); @@ -156,6 +167,8 @@ public void createSchemaTest2() throws Exception { Schema.newBuilder() .setName(SchemaName.of("[PROJECT]", "[SCHEMA]").toString()) .setDefinition("definition-1014418093") + .setRevisionId("revisionId-1507445162") + .setRevisionCreateTime(Timestamp.newBuilder().build()) .build(); mockSchemaService.addResponse(expectedResponse); @@ -201,6 +214,8 @@ public void getSchemaTest() throws Exception { Schema.newBuilder() .setName(SchemaName.of("[PROJECT]", "[SCHEMA]").toString()) .setDefinition("definition-1014418093") + .setRevisionId("revisionId-1507445162") + .setRevisionCreateTime(Timestamp.newBuilder().build()) .build(); mockSchemaService.addResponse(expectedResponse); @@ -240,6 +255,8 @@ public void getSchemaTest2() throws Exception { Schema.newBuilder() .setName(SchemaName.of("[PROJECT]", "[SCHEMA]").toString()) .setDefinition("definition-1014418093") + .setRevisionId("revisionId-1507445162") + .setRevisionCreateTime(Timestamp.newBuilder().build()) .build(); mockSchemaService.addResponse(expectedResponse); @@ -361,6 +378,360 @@ public void listSchemasExceptionTest2() throws Exception { } } + @Test + public void listSchemaRevisionsTest() throws Exception { + Schema responsesElement = Schema.newBuilder().build(); + ListSchemaRevisionsResponse expectedResponse = + ListSchemaRevisionsResponse.newBuilder() + .setNextPageToken("") + .addAllSchemas(Arrays.asList(responsesElement)) + .build(); + mockSchemaService.addResponse(expectedResponse); + + SchemaName name = SchemaName.of("[PROJECT]", "[SCHEMA]"); + + ListSchemaRevisionsPagedResponse pagedListResponse = client.listSchemaRevisions(name); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getSchemasList().get(0), resources.get(0)); + + List actualRequests = mockSchemaService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListSchemaRevisionsRequest actualRequest = ((ListSchemaRevisionsRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listSchemaRevisionsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockSchemaService.addException(exception); + + try { + SchemaName name = SchemaName.of("[PROJECT]", "[SCHEMA]"); + client.listSchemaRevisions(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listSchemaRevisionsTest2() throws Exception { + Schema responsesElement = Schema.newBuilder().build(); + ListSchemaRevisionsResponse expectedResponse = + ListSchemaRevisionsResponse.newBuilder() + .setNextPageToken("") + .addAllSchemas(Arrays.asList(responsesElement)) + .build(); + mockSchemaService.addResponse(expectedResponse); + + String name = "name3373707"; + + ListSchemaRevisionsPagedResponse pagedListResponse = client.listSchemaRevisions(name); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getSchemasList().get(0), resources.get(0)); + + List actualRequests = mockSchemaService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListSchemaRevisionsRequest actualRequest = ((ListSchemaRevisionsRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listSchemaRevisionsExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockSchemaService.addException(exception); + + try { + String name = "name3373707"; + client.listSchemaRevisions(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void commitSchemaTest() throws Exception { + Schema expectedResponse = + Schema.newBuilder() + .setName(SchemaName.of("[PROJECT]", "[SCHEMA]").toString()) + .setDefinition("definition-1014418093") + .setRevisionId("revisionId-1507445162") + .setRevisionCreateTime(Timestamp.newBuilder().build()) + .build(); + mockSchemaService.addResponse(expectedResponse); + + SchemaName name = SchemaName.of("[PROJECT]", "[SCHEMA]"); + Schema schema = Schema.newBuilder().build(); + + Schema actualResponse = client.commitSchema(name, schema); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockSchemaService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CommitSchemaRequest actualRequest = ((CommitSchemaRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertEquals(schema, actualRequest.getSchema()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void commitSchemaExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockSchemaService.addException(exception); + + try { + SchemaName name = SchemaName.of("[PROJECT]", "[SCHEMA]"); + Schema schema = Schema.newBuilder().build(); + client.commitSchema(name, schema); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void commitSchemaTest2() throws Exception { + Schema expectedResponse = + Schema.newBuilder() + .setName(SchemaName.of("[PROJECT]", "[SCHEMA]").toString()) + .setDefinition("definition-1014418093") + .setRevisionId("revisionId-1507445162") + .setRevisionCreateTime(Timestamp.newBuilder().build()) + .build(); + mockSchemaService.addResponse(expectedResponse); + + String name = "name3373707"; + Schema schema = Schema.newBuilder().build(); + + Schema actualResponse = client.commitSchema(name, schema); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockSchemaService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CommitSchemaRequest actualRequest = ((CommitSchemaRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertEquals(schema, actualRequest.getSchema()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void commitSchemaExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockSchemaService.addException(exception); + + try { + String name = "name3373707"; + Schema schema = Schema.newBuilder().build(); + client.commitSchema(name, schema); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void rollbackSchemaTest() throws Exception { + Schema expectedResponse = + Schema.newBuilder() + .setName(SchemaName.of("[PROJECT]", "[SCHEMA]").toString()) + .setDefinition("definition-1014418093") + .setRevisionId("revisionId-1507445162") + .setRevisionCreateTime(Timestamp.newBuilder().build()) + .build(); + mockSchemaService.addResponse(expectedResponse); + + SchemaName name = SchemaName.of("[PROJECT]", "[SCHEMA]"); + String revisionId = "revisionId-1507445162"; + + Schema actualResponse = client.rollbackSchema(name, revisionId); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockSchemaService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + RollbackSchemaRequest actualRequest = ((RollbackSchemaRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertEquals(revisionId, actualRequest.getRevisionId()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void rollbackSchemaExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockSchemaService.addException(exception); + + try { + SchemaName name = SchemaName.of("[PROJECT]", "[SCHEMA]"); + String revisionId = "revisionId-1507445162"; + client.rollbackSchema(name, revisionId); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void rollbackSchemaTest2() throws Exception { + Schema expectedResponse = + Schema.newBuilder() + .setName(SchemaName.of("[PROJECT]", "[SCHEMA]").toString()) + .setDefinition("definition-1014418093") + .setRevisionId("revisionId-1507445162") + .setRevisionCreateTime(Timestamp.newBuilder().build()) + .build(); + mockSchemaService.addResponse(expectedResponse); + + String name = "name3373707"; + String revisionId = "revisionId-1507445162"; + + Schema actualResponse = client.rollbackSchema(name, revisionId); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockSchemaService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + RollbackSchemaRequest actualRequest = ((RollbackSchemaRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertEquals(revisionId, actualRequest.getRevisionId()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void rollbackSchemaExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockSchemaService.addException(exception); + + try { + String name = "name3373707"; + String revisionId = "revisionId-1507445162"; + client.rollbackSchema(name, revisionId); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void deleteSchemaRevisionTest() throws Exception { + Schema expectedResponse = + Schema.newBuilder() + .setName(SchemaName.of("[PROJECT]", "[SCHEMA]").toString()) + .setDefinition("definition-1014418093") + .setRevisionId("revisionId-1507445162") + .setRevisionCreateTime(Timestamp.newBuilder().build()) + .build(); + mockSchemaService.addResponse(expectedResponse); + + SchemaName name = SchemaName.of("[PROJECT]", "[SCHEMA]"); + String revisionId = "revisionId-1507445162"; + + Schema actualResponse = client.deleteSchemaRevision(name, revisionId); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockSchemaService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeleteSchemaRevisionRequest actualRequest = + ((DeleteSchemaRevisionRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertEquals(revisionId, actualRequest.getRevisionId()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void deleteSchemaRevisionExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockSchemaService.addException(exception); + + try { + SchemaName name = SchemaName.of("[PROJECT]", "[SCHEMA]"); + String revisionId = "revisionId-1507445162"; + client.deleteSchemaRevision(name, revisionId); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void deleteSchemaRevisionTest2() throws Exception { + Schema expectedResponse = + Schema.newBuilder() + .setName(SchemaName.of("[PROJECT]", "[SCHEMA]").toString()) + .setDefinition("definition-1014418093") + .setRevisionId("revisionId-1507445162") + .setRevisionCreateTime(Timestamp.newBuilder().build()) + .build(); + mockSchemaService.addResponse(expectedResponse); + + String name = "name3373707"; + String revisionId = "revisionId-1507445162"; + + Schema actualResponse = client.deleteSchemaRevision(name, revisionId); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockSchemaService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeleteSchemaRevisionRequest actualRequest = + ((DeleteSchemaRevisionRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertEquals(revisionId, actualRequest.getRevisionId()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void deleteSchemaRevisionExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockSchemaService.addException(exception); + + try { + String name = "name3373707"; + String revisionId = "revisionId-1507445162"; + client.deleteSchemaRevision(name, revisionId); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + @Test public void deleteSchemaTest() throws Exception { Empty expectedResponse = Empty.newBuilder().build(); @@ -560,6 +931,7 @@ public void setIamPolicyTest() throws Exception { Policy.newBuilder() .setVersion(351608024) .addAllBindings(new ArrayList()) + .addAllAuditConfigs(new ArrayList()) .setEtag(ByteString.EMPTY) .build(); mockIAMPolicy.addResponse(expectedResponse); @@ -568,6 +940,7 @@ public void setIamPolicyTest() throws Exception { SetIamPolicyRequest.newBuilder() .setResource(SnapshotName.of("[PROJECT]", "[SNAPSHOT]").toString()) .setPolicy(Policy.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) .build(); Policy actualResponse = client.setIamPolicy(request); @@ -579,6 +952,7 @@ public void setIamPolicyTest() throws Exception { Assert.assertEquals(request.getResource(), actualRequest.getResource()); Assert.assertEquals(request.getPolicy(), actualRequest.getPolicy()); + Assert.assertEquals(request.getUpdateMask(), actualRequest.getUpdateMask()); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), @@ -595,6 +969,7 @@ public void setIamPolicyExceptionTest() throws Exception { SetIamPolicyRequest.newBuilder() .setResource(SnapshotName.of("[PROJECT]", "[SNAPSHOT]").toString()) .setPolicy(Policy.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) .build(); client.setIamPolicy(request); Assert.fail("No exception raised"); @@ -609,6 +984,7 @@ public void getIamPolicyTest() throws Exception { Policy.newBuilder() .setVersion(351608024) .addAllBindings(new ArrayList()) + .addAllAuditConfigs(new ArrayList()) .setEtag(ByteString.EMPTY) .build(); mockIAMPolicy.addResponse(expectedResponse); diff --git a/test/integration/goldens/pubsub/src/com/google/cloud/pubsub/v1/SchemaServiceSettings.java b/test/integration/goldens/pubsub/src/com/google/cloud/pubsub/v1/SchemaServiceSettings.java index 8f3ce053be..bc1793ed75 100644 --- a/test/integration/goldens/pubsub/src/com/google/cloud/pubsub/v1/SchemaServiceSettings.java +++ b/test/integration/goldens/pubsub/src/com/google/cloud/pubsub/v1/SchemaServiceSettings.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,10 +16,10 @@ package com.google.cloud.pubsub.v1; +import static com.google.cloud.pubsub.v1.SchemaServiceClient.ListSchemaRevisionsPagedResponse; import static com.google.cloud.pubsub.v1.SchemaServiceClient.ListSchemasPagedResponse; import com.google.api.core.ApiFunction; -import com.google.api.core.BetaApi; import com.google.api.gax.core.GoogleCredentialsProvider; import com.google.api.gax.core.InstantiatingExecutorProvider; import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; @@ -37,11 +37,16 @@ import com.google.iam.v1.TestIamPermissionsRequest; import com.google.iam.v1.TestIamPermissionsResponse; import com.google.protobuf.Empty; +import com.google.pubsub.v1.CommitSchemaRequest; import com.google.pubsub.v1.CreateSchemaRequest; import com.google.pubsub.v1.DeleteSchemaRequest; +import com.google.pubsub.v1.DeleteSchemaRevisionRequest; import com.google.pubsub.v1.GetSchemaRequest; +import com.google.pubsub.v1.ListSchemaRevisionsRequest; +import com.google.pubsub.v1.ListSchemaRevisionsResponse; import com.google.pubsub.v1.ListSchemasRequest; import com.google.pubsub.v1.ListSchemasResponse; +import com.google.pubsub.v1.RollbackSchemaRequest; import com.google.pubsub.v1.Schema; import com.google.pubsub.v1.ValidateMessageRequest; import com.google.pubsub.v1.ValidateMessageResponse; @@ -66,7 +71,9 @@ *

        The builder of this class is recursive, so contained classes are themselves builders. When * build() is called, the tree of builders is called to create the complete settings object. * - *

        For example, to set the total timeout of createSchema to 30 seconds: + *

        For example, to set the + * [RetrySettings](https://cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.retrying.RetrySettings) + * of createSchema: * *

        {@code
          * // This snippet has been automatically generated and should be regarded as a code template only.
        @@ -82,10 +89,21 @@
          *             .createSchemaSettings()
          *             .getRetrySettings()
          *             .toBuilder()
        - *             .setTotalTimeout(Duration.ofSeconds(30))
        + *             .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());
          * SchemaServiceSettings schemaServiceSettings = schemaServiceSettingsBuilder.build();
          * }
        + * + * Please refer to the [Client Side Retry + * Guide](https://docs.cloud.google.com/java/docs/client-retries) for additional support in setting + * retries. */ @Generated("by gapic-generator-java") public class SchemaServiceSettings extends ClientSettings { @@ -106,6 +124,28 @@ public UnaryCallSettings getSchemaSettings() { return ((SchemaServiceStubSettings) getStubSettings()).listSchemasSettings(); } + /** Returns the object with the settings used for calls to listSchemaRevisions. */ + public PagedCallSettings< + ListSchemaRevisionsRequest, ListSchemaRevisionsResponse, ListSchemaRevisionsPagedResponse> + listSchemaRevisionsSettings() { + return ((SchemaServiceStubSettings) getStubSettings()).listSchemaRevisionsSettings(); + } + + /** Returns the object with the settings used for calls to commitSchema. */ + public UnaryCallSettings commitSchemaSettings() { + return ((SchemaServiceStubSettings) getStubSettings()).commitSchemaSettings(); + } + + /** Returns the object with the settings used for calls to rollbackSchema. */ + public UnaryCallSettings rollbackSchemaSettings() { + return ((SchemaServiceStubSettings) getStubSettings()).rollbackSchemaSettings(); + } + + /** Returns the object with the settings used for calls to deleteSchemaRevision. */ + public UnaryCallSettings deleteSchemaRevisionSettings() { + return ((SchemaServiceStubSettings) getStubSettings()).deleteSchemaRevisionSettings(); + } + /** Returns the object with the settings used for calls to deleteSchema. */ public UnaryCallSettings deleteSchemaSettings() { return ((SchemaServiceStubSettings) getStubSettings()).deleteSchemaSettings(); @@ -172,7 +212,6 @@ public static TransportChannelProvider defaultTransportChannelProvider() { return SchemaServiceStubSettings.defaultTransportChannelProvider(); } - @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { return SchemaServiceStubSettings.defaultApiClientHeaderProviderBuilder(); } @@ -252,6 +291,31 @@ public UnaryCallSettings.Builder getSchemaSettings() { return getStubSettingsBuilder().listSchemasSettings(); } + /** Returns the builder for the settings used for calls to listSchemaRevisions. */ + public PagedCallSettings.Builder< + ListSchemaRevisionsRequest, + ListSchemaRevisionsResponse, + ListSchemaRevisionsPagedResponse> + listSchemaRevisionsSettings() { + return getStubSettingsBuilder().listSchemaRevisionsSettings(); + } + + /** Returns the builder for the settings used for calls to commitSchema. */ + public UnaryCallSettings.Builder commitSchemaSettings() { + return getStubSettingsBuilder().commitSchemaSettings(); + } + + /** Returns the builder for the settings used for calls to rollbackSchema. */ + public UnaryCallSettings.Builder rollbackSchemaSettings() { + return getStubSettingsBuilder().rollbackSchemaSettings(); + } + + /** Returns the builder for the settings used for calls to deleteSchemaRevision. */ + public UnaryCallSettings.Builder + deleteSchemaRevisionSettings() { + return getStubSettingsBuilder().deleteSchemaRevisionSettings(); + } + /** Returns the builder for the settings used for calls to deleteSchema. */ public UnaryCallSettings.Builder deleteSchemaSettings() { return getStubSettingsBuilder().deleteSchemaSettings(); diff --git a/test/integration/goldens/pubsub/src/com/google/cloud/pubsub/v1/SubscriptionAdminClient.java b/test/integration/goldens/pubsub/src/com/google/cloud/pubsub/v1/SubscriptionAdminClient.java index c6dd82ba29..010cc884d2 100644 --- a/test/integration/goldens/pubsub/src/com/google/cloud/pubsub/v1/SubscriptionAdminClient.java +++ b/test/integration/goldens/pubsub/src/com/google/cloud/pubsub/v1/SubscriptionAdminClient.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -95,19 +95,349 @@ * such as threads. In the example above, try-with-resources is used, which automatically calls * close(). * - *

        The surface of this class includes several types of Java methods for each of the API's - * methods: - * - *

          - *
        1. A "flattened" method. With this type of method, the fields of the request type have been - * converted into function parameters. It may be the case that not all fields are available as - * parameters, and not every API method will have a flattened method entry point. - *
        2. A "request object" method. This type of method only takes one parameter, a request object, - * which must be constructed before the call. Not every API method will have a request object - * method. - *
        3. A "callable" method. This type of method takes no parameters and returns an immutable API - * callable object, which can be used to initiate calls to the service. - *
        + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + *
        Methods
        MethodDescriptionMethod Variants

        CreateSubscription

        Creates a subscription to a given topic. See the [resource name rules] (https://cloud.google.com/pubsub/docs/admin#resource_names). If the subscription already exists, returns `ALREADY_EXISTS`. If the corresponding topic doesn't exist, returns `NOT_FOUND`. + *

        If the name is not provided in the request, the server will assign a random name for this subscription on the same project as the topic, conforming to the [resource name format] (https://cloud.google.com/pubsub/docs/admin#resource_names). The generated name is populated in the returned Subscription object. Note that for REST API requests, you must specify a name in the request.

        + *

        Request object method variants only take one parameter, a request object, which must be constructed before the call.

        + *
          + *
        • createSubscription(Subscription request) + *

        + *

        "Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

        + *
          + *
        • createSubscription(SubscriptionName name, TopicName topic, PushConfig pushConfig, int ackDeadlineSeconds) + *

        • createSubscription(SubscriptionName name, String topic, PushConfig pushConfig, int ackDeadlineSeconds) + *

        • createSubscription(String name, TopicName topic, PushConfig pushConfig, int ackDeadlineSeconds) + *

        • createSubscription(String name, String topic, PushConfig pushConfig, int ackDeadlineSeconds) + *

        + *

        Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

        + *
          + *
        • createSubscriptionCallable() + *

        + *

        GetSubscription

        Gets the configuration details of a subscription.

        + *

        Request object method variants only take one parameter, a request object, which must be constructed before the call.

        + *
          + *
        • getSubscription(GetSubscriptionRequest request) + *

        + *

        "Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

        + *
          + *
        • getSubscription(SubscriptionName subscription) + *

        • getSubscription(String subscription) + *

        + *

        Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

        + *
          + *
        • getSubscriptionCallable() + *

        + *

        UpdateSubscription

        Updates an existing subscription. Note that certain properties of a subscription, such as its topic, are not modifiable.

        + *

        Request object method variants only take one parameter, a request object, which must be constructed before the call.

        + *
          + *
        • updateSubscription(UpdateSubscriptionRequest request) + *

        + *

        Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

        + *
          + *
        • updateSubscriptionCallable() + *

        + *

        ListSubscriptions

        Lists matching subscriptions.

        + *

        Request object method variants only take one parameter, a request object, which must be constructed before the call.

        + *
          + *
        • listSubscriptions(ListSubscriptionsRequest request) + *

        + *

        "Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

        + *
          + *
        • listSubscriptions(ProjectName project) + *

        • listSubscriptions(String project) + *

        + *

        Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

        + *
          + *
        • listSubscriptionsPagedCallable() + *

        • listSubscriptionsCallable() + *

        + *

        DeleteSubscription

        Deletes an existing subscription. All messages retained in the subscription are immediately dropped. Calls to `Pull` after deletion will return `NOT_FOUND`. After a subscription is deleted, a new one may be created with the same name, but the new one has no association with the old subscription or its topic unless the same topic is specified.

        + *

        Request object method variants only take one parameter, a request object, which must be constructed before the call.

        + *
          + *
        • deleteSubscription(DeleteSubscriptionRequest request) + *

        + *

        "Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

        + *
          + *
        • deleteSubscription(SubscriptionName subscription) + *

        • deleteSubscription(String subscription) + *

        + *

        Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

        + *
          + *
        • deleteSubscriptionCallable() + *

        + *

        ModifyAckDeadline

        Modifies the ack deadline for a specific message. This method is useful to indicate that more time is needed to process a message by the subscriber, or to make the message available for redelivery if the processing was interrupted. Note that this does not modify the subscription-level `ackDeadlineSeconds` used for subsequent messages.

        + *

        Request object method variants only take one parameter, a request object, which must be constructed before the call.

        + *
          + *
        • modifyAckDeadline(ModifyAckDeadlineRequest request) + *

        + *

        "Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

        + *
          + *
        • modifyAckDeadline(SubscriptionName subscription, List<String> ackIds, int ackDeadlineSeconds) + *

        • modifyAckDeadline(String subscription, List<String> ackIds, int ackDeadlineSeconds) + *

        + *

        Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

        + *
          + *
        • modifyAckDeadlineCallable() + *

        + *

        Acknowledge

        Acknowledges the messages associated with the `ack_ids` in the `AcknowledgeRequest`. The Pub/Sub system can remove the relevant messages from the subscription. + *

        Acknowledging a message whose ack deadline has expired may succeed, but such a message may be redelivered later. Acknowledging a message more than once will not result in an error.

        + *

        Request object method variants only take one parameter, a request object, which must be constructed before the call.

        + *
          + *
        • acknowledge(AcknowledgeRequest request) + *

        + *

        "Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

        + *
          + *
        • acknowledge(SubscriptionName subscription, List<String> ackIds) + *

        • acknowledge(String subscription, List<String> ackIds) + *

        + *

        Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

        + *
          + *
        • acknowledgeCallable() + *

        + *

        Pull

        Pulls messages from the server. The server may return `UNAVAILABLE` if there are too many concurrent pull requests pending for the given subscription.

        + *

        Request object method variants only take one parameter, a request object, which must be constructed before the call.

        + *
          + *
        • pull(PullRequest request) + *

        + *

        "Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

        + *
          + *
        • pull(SubscriptionName subscription, int maxMessages) + *

        • pull(String subscription, int maxMessages) + *

        • pull(SubscriptionName subscription, boolean returnImmediately, int maxMessages) + *

        • pull(String subscription, boolean returnImmediately, int maxMessages) + *

        + *

        Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

        + *
          + *
        • pullCallable() + *

        + *

        StreamingPull

        Establishes a stream with the server, which sends messages down to the client. The client streams acknowledgements and ack deadline modifications back to the server. The server will close the stream and return the status on any error. The server may close the stream with status `UNAVAILABLE` to reassign server-side resources, in which case, the client should re-establish the stream. Flow control can be achieved by configuring the underlying RPC channel.

        + *

        Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

        + *
          + *
        • streamingPullCallable() + *

        + *

        ModifyPushConfig

        Modifies the `PushConfig` for a specified subscription. + *

        This may be used to change a push subscription to a pull one (signified by an empty `PushConfig`) or vice versa, or change the endpoint URL and other attributes of a push subscription. Messages will accumulate for delivery continuously through the call regardless of changes to the `PushConfig`.

        + *

        Request object method variants only take one parameter, a request object, which must be constructed before the call.

        + *
          + *
        • modifyPushConfig(ModifyPushConfigRequest request) + *

        + *

        "Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

        + *
          + *
        • modifyPushConfig(SubscriptionName subscription, PushConfig pushConfig) + *

        • modifyPushConfig(String subscription, PushConfig pushConfig) + *

        + *

        Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

        + *
          + *
        • modifyPushConfigCallable() + *

        + *

        GetSnapshot

        Gets the configuration details of a snapshot. Snapshots are used in <a href="https://cloud.google.com/pubsub/docs/replay-overview">Seek</a> operations, which allow you to manage message acknowledgments in bulk. That is, you can set the acknowledgment state of messages in an existing subscription to the state captured by a snapshot.

        + *

        Request object method variants only take one parameter, a request object, which must be constructed before the call.

        + *
          + *
        • getSnapshot(GetSnapshotRequest request) + *

        + *

        "Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

        + *
          + *
        • getSnapshot(SnapshotName snapshot) + *

        • getSnapshot(String snapshot) + *

        + *

        Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

        + *
          + *
        • getSnapshotCallable() + *

        + *

        ListSnapshots

        Lists the existing snapshots. Snapshots are used in [Seek]( https://cloud.google.com/pubsub/docs/replay-overview) operations, which allow you to manage message acknowledgments in bulk. That is, you can set the acknowledgment state of messages in an existing subscription to the state captured by a snapshot.

        + *

        Request object method variants only take one parameter, a request object, which must be constructed before the call.

        + *
          + *
        • listSnapshots(ListSnapshotsRequest request) + *

        + *

        "Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

        + *
          + *
        • listSnapshots(ProjectName project) + *

        • listSnapshots(String project) + *

        + *

        Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

        + *
          + *
        • listSnapshotsPagedCallable() + *

        • listSnapshotsCallable() + *

        + *

        CreateSnapshot

        Creates a snapshot from the requested subscription. Snapshots are used in [Seek](https://cloud.google.com/pubsub/docs/replay-overview) operations, which allow you to manage message acknowledgments in bulk. That is, you can set the acknowledgment state of messages in an existing subscription to the state captured by a snapshot. If the snapshot already exists, returns `ALREADY_EXISTS`. If the requested subscription doesn't exist, returns `NOT_FOUND`. If the backlog in the subscription is too old -- and the resulting snapshot would expire in less than 1 hour -- then `FAILED_PRECONDITION` is returned. See also the `Snapshot.expire_time` field. If the name is not provided in the request, the server will assign a random name for this snapshot on the same project as the subscription, conforming to the [resource name format] (https://cloud.google.com/pubsub/docs/admin#resource_names). The generated name is populated in the returned Snapshot object. Note that for REST API requests, you must specify a name in the request.

        + *

        Request object method variants only take one parameter, a request object, which must be constructed before the call.

        + *
          + *
        • createSnapshot(CreateSnapshotRequest request) + *

        + *

        "Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

        + *
          + *
        • createSnapshot(SnapshotName name, SubscriptionName subscription) + *

        • createSnapshot(SnapshotName name, String subscription) + *

        • createSnapshot(String name, SubscriptionName subscription) + *

        • createSnapshot(String name, String subscription) + *

        + *

        Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

        + *
          + *
        • createSnapshotCallable() + *

        + *

        UpdateSnapshot

        Updates an existing snapshot. Snapshots are used in <a href="https://cloud.google.com/pubsub/docs/replay-overview">Seek</a> operations, which allow you to manage message acknowledgments in bulk. That is, you can set the acknowledgment state of messages in an existing subscription to the state captured by a snapshot.

        + *

        Request object method variants only take one parameter, a request object, which must be constructed before the call.

        + *
          + *
        • updateSnapshot(UpdateSnapshotRequest request) + *

        + *

        Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

        + *
          + *
        • updateSnapshotCallable() + *

        + *

        DeleteSnapshot

        Removes an existing snapshot. Snapshots are used in [Seek] (https://cloud.google.com/pubsub/docs/replay-overview) operations, which allow you to manage message acknowledgments in bulk. That is, you can set the acknowledgment state of messages in an existing subscription to the state captured by a snapshot. When the snapshot is deleted, all messages retained in the snapshot are immediately dropped. After a snapshot is deleted, a new one may be created with the same name, but the new one has no association with the old snapshot or its subscription, unless the same subscription is specified.

        + *

        Request object method variants only take one parameter, a request object, which must be constructed before the call.

        + *
          + *
        • deleteSnapshot(DeleteSnapshotRequest request) + *

        + *

        "Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

        + *
          + *
        • deleteSnapshot(SnapshotName snapshot) + *

        • deleteSnapshot(String snapshot) + *

        + *

        Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

        + *
          + *
        • deleteSnapshotCallable() + *

        + *

        Seek

        Seeks an existing subscription to a point in time or to a given snapshot, whichever is provided in the request. Snapshots are used in [Seek] (https://cloud.google.com/pubsub/docs/replay-overview) operations, which allow you to manage message acknowledgments in bulk. That is, you can set the acknowledgment state of messages in an existing subscription to the state captured by a snapshot. Note that both the subscription and the snapshot must be on the same topic.

        + *

        Request object method variants only take one parameter, a request object, which must be constructed before the call.

        + *
          + *
        • seek(SeekRequest request) + *

        + *

        Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

        + *
          + *
        • seekCallable() + *

        + *

        SetIamPolicy

        Sets the access control policy on the specified resource. Replacesany existing policy. + *

        Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED`errors.

        + *

        Request object method variants only take one parameter, a request object, which must be constructed before the call.

        + *
          + *
        • setIamPolicy(SetIamPolicyRequest request) + *

        + *

        Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

        + *
          + *
        • setIamPolicyCallable() + *

        + *

        GetIamPolicy

        Gets the access control policy for a resource. Returns an empty policyif the resource exists and does not have a policy set.

        + *

        Request object method variants only take one parameter, a request object, which must be constructed before the call.

        + *
          + *
        • getIamPolicy(GetIamPolicyRequest request) + *

        + *

        Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

        + *
          + *
        • getIamPolicyCallable() + *

        + *

        TestIamPermissions

        Returns permissions that a caller has on the specified resource. If theresource does not exist, this will return an empty set ofpermissions, not a `NOT_FOUND` error. + *

        Note: This operation is designed to be used for buildingpermission-aware UIs and command-line tools, not for authorizationchecking. This operation may "fail open" without warning.

        + *

        Request object method variants only take one parameter, a request object, which must be constructed before the call.

        + *
          + *
        • testIamPermissions(TestIamPermissionsRequest request) + *

        + *

        Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

        + *
          + *
        • testIamPermissionsCallable() + *

        + *
        * *

        See the individual methods for example code. * @@ -240,8 +570,8 @@ public SubscriberStub getStub() { * messages. Format is `projects/{project}/topics/{topic}`. The value of this field will be * `_deleted-topic_` if the topic has been deleted. * @param pushConfig If push delivery is used with this subscription, this field is used to - * configure it. An empty `pushConfig` signifies that the subscriber will pull and ack - * messages using API methods. + * configure it. Either `pushConfig` or `bigQueryConfig` can be set, but not both. If both are + * empty, then the subscriber will pull and ack messages using API methods. * @param ackDeadlineSeconds The approximate amount of time (on a best-effort basis) Pub/Sub waits * for the subscriber to acknowledge receipt before resending the message. In the interval * after the message is delivered and before it is acknowledged, it is considered to be @@ -311,8 +641,8 @@ public final Subscription createSubscription( * messages. Format is `projects/{project}/topics/{topic}`. The value of this field will be * `_deleted-topic_` if the topic has been deleted. * @param pushConfig If push delivery is used with this subscription, this field is used to - * configure it. An empty `pushConfig` signifies that the subscriber will pull and ack - * messages using API methods. + * configure it. Either `pushConfig` or `bigQueryConfig` can be set, but not both. If both are + * empty, then the subscriber will pull and ack messages using API methods. * @param ackDeadlineSeconds The approximate amount of time (on a best-effort basis) Pub/Sub waits * for the subscriber to acknowledge receipt before resending the message. In the interval * after the message is delivered and before it is acknowledged, it is considered to be @@ -382,8 +712,8 @@ public final Subscription createSubscription( * messages. Format is `projects/{project}/topics/{topic}`. The value of this field will be * `_deleted-topic_` if the topic has been deleted. * @param pushConfig If push delivery is used with this subscription, this field is used to - * configure it. An empty `pushConfig` signifies that the subscriber will pull and ack - * messages using API methods. + * configure it. Either `pushConfig` or `bigQueryConfig` can be set, but not both. If both are + * empty, then the subscriber will pull and ack messages using API methods. * @param ackDeadlineSeconds The approximate amount of time (on a best-effort basis) Pub/Sub waits * for the subscriber to acknowledge receipt before resending the message. In the interval * after the message is delivered and before it is acknowledged, it is considered to be @@ -453,8 +783,8 @@ public final Subscription createSubscription( * messages. Format is `projects/{project}/topics/{topic}`. The value of this field will be * `_deleted-topic_` if the topic has been deleted. * @param pushConfig If push delivery is used with this subscription, this field is used to - * configure it. An empty `pushConfig` signifies that the subscriber will pull and ack - * messages using API methods. + * configure it. Either `pushConfig` or `bigQueryConfig` can be set, but not both. If both are + * empty, then the subscriber will pull and ack messages using API methods. * @param ackDeadlineSeconds The approximate amount of time (on a best-effort basis) Pub/Sub waits * for the subscriber to acknowledge receipt before resending the message. In the interval * after the message is delivered and before it is acknowledged, it is considered to be @@ -511,6 +841,7 @@ public final Subscription createSubscription( * .setName(SubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]").toString()) * .setTopic(TopicName.ofProjectTopicName("[PROJECT]", "[TOPIC]").toString()) * .setPushConfig(PushConfig.newBuilder().build()) + * .setBigqueryConfig(BigQueryConfig.newBuilder().build()) * .setAckDeadlineSeconds(2135351438) * .setRetainAckedMessages(true) * .setMessageRetentionDuration(Duration.newBuilder().build()) @@ -562,6 +893,7 @@ public final Subscription createSubscription(Subscription request) { * .setName(SubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]").toString()) * .setTopic(TopicName.ofProjectTopicName("[PROJECT]", "[TOPIC]").toString()) * .setPushConfig(PushConfig.newBuilder().build()) + * .setBigqueryConfig(BigQueryConfig.newBuilder().build()) * .setAckDeadlineSeconds(2135351438) * .setRetainAckedMessages(true) * .setMessageRetentionDuration(Duration.newBuilder().build()) @@ -2641,6 +2973,7 @@ public final UnaryCallable seekCallable() { * SetIamPolicyRequest.newBuilder() * .setResource(SnapshotName.of("[PROJECT]", "[SNAPSHOT]").toString()) * .setPolicy(Policy.newBuilder().build()) + * .setUpdateMask(FieldMask.newBuilder().build()) * .build(); * Policy response = subscriptionAdminClient.setIamPolicy(request); * } @@ -2672,6 +3005,7 @@ public final Policy setIamPolicy(SetIamPolicyRequest request) { * SetIamPolicyRequest.newBuilder() * .setResource(SnapshotName.of("[PROJECT]", "[SNAPSHOT]").toString()) * .setPolicy(Policy.newBuilder().build()) + * .setUpdateMask(FieldMask.newBuilder().build()) * .build(); * ApiFuture future = subscriptionAdminClient.setIamPolicyCallable().futureCall(request); * // Do something. diff --git a/test/integration/goldens/pubsub/src/com/google/cloud/pubsub/v1/SubscriptionAdminClientTest.java b/test/integration/goldens/pubsub/src/com/google/cloud/pubsub/v1/SubscriptionAdminClientTest.java index 9138fddb6d..9a85b47afe 100644 --- a/test/integration/goldens/pubsub/src/com/google/cloud/pubsub/v1/SubscriptionAdminClientTest.java +++ b/test/integration/goldens/pubsub/src/com/google/cloud/pubsub/v1/SubscriptionAdminClientTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -31,6 +31,7 @@ import com.google.api.gax.rpc.InvalidArgumentException; import com.google.api.gax.rpc.StatusCode; import com.google.common.collect.Lists; +import com.google.iam.v1.AuditConfig; import com.google.iam.v1.Binding; import com.google.iam.v1.GetIamPolicyRequest; import com.google.iam.v1.GetPolicyOptions; @@ -45,6 +46,7 @@ import com.google.protobuf.FieldMask; import com.google.protobuf.Timestamp; import com.google.pubsub.v1.AcknowledgeRequest; +import com.google.pubsub.v1.BigQueryConfig; import com.google.pubsub.v1.CreateSnapshotRequest; import com.google.pubsub.v1.DeadLetterPolicy; import com.google.pubsub.v1.DeleteSnapshotRequest; @@ -139,6 +141,7 @@ public void createSubscriptionTest() throws Exception { .setName(SubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]").toString()) .setTopic(TopicName.ofProjectTopicName("[PROJECT]", "[TOPIC]").toString()) .setPushConfig(PushConfig.newBuilder().build()) + .setBigqueryConfig(BigQueryConfig.newBuilder().build()) .setAckDeadlineSeconds(2135351438) .setRetainAckedMessages(true) .setMessageRetentionDuration(Duration.newBuilder().build()) @@ -201,6 +204,7 @@ public void createSubscriptionTest2() throws Exception { .setName(SubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]").toString()) .setTopic(TopicName.ofProjectTopicName("[PROJECT]", "[TOPIC]").toString()) .setPushConfig(PushConfig.newBuilder().build()) + .setBigqueryConfig(BigQueryConfig.newBuilder().build()) .setAckDeadlineSeconds(2135351438) .setRetainAckedMessages(true) .setMessageRetentionDuration(Duration.newBuilder().build()) @@ -263,6 +267,7 @@ public void createSubscriptionTest3() throws Exception { .setName(SubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]").toString()) .setTopic(TopicName.ofProjectTopicName("[PROJECT]", "[TOPIC]").toString()) .setPushConfig(PushConfig.newBuilder().build()) + .setBigqueryConfig(BigQueryConfig.newBuilder().build()) .setAckDeadlineSeconds(2135351438) .setRetainAckedMessages(true) .setMessageRetentionDuration(Duration.newBuilder().build()) @@ -325,6 +330,7 @@ public void createSubscriptionTest4() throws Exception { .setName(SubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]").toString()) .setTopic(TopicName.ofProjectTopicName("[PROJECT]", "[TOPIC]").toString()) .setPushConfig(PushConfig.newBuilder().build()) + .setBigqueryConfig(BigQueryConfig.newBuilder().build()) .setAckDeadlineSeconds(2135351438) .setRetainAckedMessages(true) .setMessageRetentionDuration(Duration.newBuilder().build()) @@ -387,6 +393,7 @@ public void getSubscriptionTest() throws Exception { .setName(SubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]").toString()) .setTopic(TopicName.ofProjectTopicName("[PROJECT]", "[TOPIC]").toString()) .setPushConfig(PushConfig.newBuilder().build()) + .setBigqueryConfig(BigQueryConfig.newBuilder().build()) .setAckDeadlineSeconds(2135351438) .setRetainAckedMessages(true) .setMessageRetentionDuration(Duration.newBuilder().build()) @@ -439,6 +446,7 @@ public void getSubscriptionTest2() throws Exception { .setName(SubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]").toString()) .setTopic(TopicName.ofProjectTopicName("[PROJECT]", "[TOPIC]").toString()) .setPushConfig(PushConfig.newBuilder().build()) + .setBigqueryConfig(BigQueryConfig.newBuilder().build()) .setAckDeadlineSeconds(2135351438) .setRetainAckedMessages(true) .setMessageRetentionDuration(Duration.newBuilder().build()) @@ -491,6 +499,7 @@ public void updateSubscriptionTest() throws Exception { .setName(SubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]").toString()) .setTopic(TopicName.ofProjectTopicName("[PROJECT]", "[TOPIC]").toString()) .setPushConfig(PushConfig.newBuilder().build()) + .setBigqueryConfig(BigQueryConfig.newBuilder().build()) .setAckDeadlineSeconds(2135351438) .setRetainAckedMessages(true) .setMessageRetentionDuration(Duration.newBuilder().build()) @@ -1022,7 +1031,7 @@ public void streamingPullTest() throws Exception { StreamingPullResponse expectedResponse = StreamingPullResponse.newBuilder() .addAllReceivedMessages(new ArrayList()) - .setAcknowlegeConfirmation( + .setAcknowledgeConfirmation( StreamingPullResponse.AcknowledgeConfirmation.newBuilder().build()) .setModifyAckDeadlineConfirmation( StreamingPullResponse.ModifyAckDeadlineConfirmation.newBuilder().build()) @@ -1679,6 +1688,7 @@ public void setIamPolicyTest() throws Exception { Policy.newBuilder() .setVersion(351608024) .addAllBindings(new ArrayList()) + .addAllAuditConfigs(new ArrayList()) .setEtag(ByteString.EMPTY) .build(); mockIAMPolicy.addResponse(expectedResponse); @@ -1687,6 +1697,7 @@ public void setIamPolicyTest() throws Exception { SetIamPolicyRequest.newBuilder() .setResource(SnapshotName.of("[PROJECT]", "[SNAPSHOT]").toString()) .setPolicy(Policy.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) .build(); Policy actualResponse = client.setIamPolicy(request); @@ -1698,6 +1709,7 @@ public void setIamPolicyTest() throws Exception { Assert.assertEquals(request.getResource(), actualRequest.getResource()); Assert.assertEquals(request.getPolicy(), actualRequest.getPolicy()); + Assert.assertEquals(request.getUpdateMask(), actualRequest.getUpdateMask()); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), @@ -1714,6 +1726,7 @@ public void setIamPolicyExceptionTest() throws Exception { SetIamPolicyRequest.newBuilder() .setResource(SnapshotName.of("[PROJECT]", "[SNAPSHOT]").toString()) .setPolicy(Policy.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) .build(); client.setIamPolicy(request); Assert.fail("No exception raised"); @@ -1728,6 +1741,7 @@ public void getIamPolicyTest() throws Exception { Policy.newBuilder() .setVersion(351608024) .addAllBindings(new ArrayList()) + .addAllAuditConfigs(new ArrayList()) .setEtag(ByteString.EMPTY) .build(); mockIAMPolicy.addResponse(expectedResponse); diff --git a/test/integration/goldens/pubsub/src/com/google/cloud/pubsub/v1/SubscriptionAdminSettings.java b/test/integration/goldens/pubsub/src/com/google/cloud/pubsub/v1/SubscriptionAdminSettings.java index c81c993d78..4afdf2718a 100644 --- a/test/integration/goldens/pubsub/src/com/google/cloud/pubsub/v1/SubscriptionAdminSettings.java +++ b/test/integration/goldens/pubsub/src/com/google/cloud/pubsub/v1/SubscriptionAdminSettings.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -20,7 +20,6 @@ import static com.google.cloud.pubsub.v1.SubscriptionAdminClient.ListSubscriptionsPagedResponse; import com.google.api.core.ApiFunction; -import com.google.api.core.BetaApi; import com.google.api.gax.core.GoogleCredentialsProvider; import com.google.api.gax.core.InstantiatingExecutorProvider; import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; @@ -80,7 +79,9 @@ *

        The builder of this class is recursive, so contained classes are themselves builders. When * build() is called, the tree of builders is called to create the complete settings object. * - *

        For example, to set the total timeout of createSubscription to 30 seconds: + *

        For example, to set the + * [RetrySettings](https://cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.retrying.RetrySettings) + * of createSubscription: * *

        {@code
          * // This snippet has been automatically generated and should be regarded as a code template only.
        @@ -97,10 +98,21 @@
          *             .createSubscriptionSettings()
          *             .getRetrySettings()
          *             .toBuilder()
        - *             .setTotalTimeout(Duration.ofSeconds(30))
        + *             .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());
          * SubscriptionAdminSettings subscriptionAdminSettings = subscriptionAdminSettingsBuilder.build();
          * }
        + * + * Please refer to the [Client Side Retry + * Guide](https://docs.cloud.google.com/java/docs/client-retries) for additional support in setting + * retries. */ @Generated("by gapic-generator-java") public class SubscriptionAdminSettings extends ClientSettings { @@ -239,7 +251,6 @@ public static TransportChannelProvider defaultTransportChannelProvider() { return SubscriberStubSettings.defaultTransportChannelProvider(); } - @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { return SubscriberStubSettings.defaultApiClientHeaderProviderBuilder(); } diff --git a/test/integration/goldens/pubsub/src/com/google/cloud/pubsub/v1/TopicAdminClient.java b/test/integration/goldens/pubsub/src/com/google/cloud/pubsub/v1/TopicAdminClient.java index 1e4239fd8b..a02ba18b89 100644 --- a/test/integration/goldens/pubsub/src/com/google/cloud/pubsub/v1/TopicAdminClient.java +++ b/test/integration/goldens/pubsub/src/com/google/cloud/pubsub/v1/TopicAdminClient.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -78,19 +78,222 @@ *

        Note: close() needs to be called on the TopicAdminClient object to clean up resources such as * threads. In the example above, try-with-resources is used, which automatically calls close(). * - *

        The surface of this class includes several types of Java methods for each of the API's - * methods: - * - *

          - *
        1. A "flattened" method. With this type of method, the fields of the request type have been - * converted into function parameters. It may be the case that not all fields are available as - * parameters, and not every API method will have a flattened method entry point. - *
        2. A "request object" method. This type of method only takes one parameter, a request object, - * which must be constructed before the call. Not every API method will have a request object - * method. - *
        3. A "callable" method. This type of method takes no parameters and returns an immutable API - * callable object, which can be used to initiate calls to the service. - *
        + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + *
        Methods
        MethodDescriptionMethod Variants

        CreateTopic

        Creates the given topic with the given name. See the [resource name rules] (https://cloud.google.com/pubsub/docs/admin#resource_names).

        + *

        Request object method variants only take one parameter, a request object, which must be constructed before the call.

        + *
          + *
        • createTopic(Topic request) + *

        + *

        "Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

        + *
          + *
        • createTopic(TopicName name) + *

        • createTopic(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.

        + *
          + *
        • createTopicCallable() + *

        + *

        UpdateTopic

        Updates an existing topic. Note that certain properties of a topic are not modifiable.

        + *

        Request object method variants only take one parameter, a request object, which must be constructed before the call.

        + *
          + *
        • updateTopic(UpdateTopicRequest request) + *

        + *

        Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

        + *
          + *
        • updateTopicCallable() + *

        + *

        Publish

        Adds one or more messages to the topic. Returns `NOT_FOUND` if the topic does not exist.

        + *

        Request object method variants only take one parameter, a request object, which must be constructed before the call.

        + *
          + *
        • publish(PublishRequest request) + *

        + *

        "Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

        + *
          + *
        • publish(TopicName topic, List<PubsubMessage> messages) + *

        • publish(String topic, List<PubsubMessage> messages) + *

        + *

        Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

        + *
          + *
        • publishCallable() + *

        + *

        GetTopic

        Gets the configuration of a topic.

        + *

        Request object method variants only take one parameter, a request object, which must be constructed before the call.

        + *
          + *
        • getTopic(GetTopicRequest request) + *

        + *

        "Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

        + *
          + *
        • getTopic(TopicName topic) + *

        • getTopic(String topic) + *

        + *

        Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

        + *
          + *
        • getTopicCallable() + *

        + *

        ListTopics

        Lists matching topics.

        + *

        Request object method variants only take one parameter, a request object, which must be constructed before the call.

        + *
          + *
        • listTopics(ListTopicsRequest request) + *

        + *

        "Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

        + *
          + *
        • listTopics(ProjectName project) + *

        • listTopics(String project) + *

        + *

        Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

        + *
          + *
        • listTopicsPagedCallable() + *

        • listTopicsCallable() + *

        + *

        ListTopicSubscriptions

        Lists the names of the attached subscriptions on this topic.

        + *

        Request object method variants only take one parameter, a request object, which must be constructed before the call.

        + *
          + *
        • listTopicSubscriptions(ListTopicSubscriptionsRequest request) + *

        + *

        "Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

        + *
          + *
        • listTopicSubscriptions(TopicName topic) + *

        • listTopicSubscriptions(String topic) + *

        + *

        Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

        + *
          + *
        • listTopicSubscriptionsPagedCallable() + *

        • listTopicSubscriptionsCallable() + *

        + *

        ListTopicSnapshots

        Lists the names of the snapshots on this topic. Snapshots are used in [Seek](https://cloud.google.com/pubsub/docs/replay-overview) operations, which allow you to manage message acknowledgments in bulk. That is, you can set the acknowledgment state of messages in an existing subscription to the state captured by a snapshot.

        + *

        Request object method variants only take one parameter, a request object, which must be constructed before the call.

        + *
          + *
        • listTopicSnapshots(ListTopicSnapshotsRequest request) + *

        + *

        "Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

        + *
          + *
        • listTopicSnapshots(TopicName topic) + *

        • listTopicSnapshots(String topic) + *

        + *

        Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

        + *
          + *
        • listTopicSnapshotsPagedCallable() + *

        • listTopicSnapshotsCallable() + *

        + *

        DeleteTopic

        Deletes the topic with the given name. Returns `NOT_FOUND` if the topic does not exist. After a topic is deleted, a new topic may be created with the same name; this is an entirely new topic with none of the old configuration or subscriptions. Existing subscriptions to this topic are not deleted, but their `topic` field is set to `_deleted-topic_`.

        + *

        Request object method variants only take one parameter, a request object, which must be constructed before the call.

        + *
          + *
        • deleteTopic(DeleteTopicRequest request) + *

        + *

        "Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

        + *
          + *
        • deleteTopic(TopicName topic) + *

        • deleteTopic(String topic) + *

        + *

        Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

        + *
          + *
        • deleteTopicCallable() + *

        + *

        DetachSubscription

        Detaches a subscription from this topic. All messages retained in the subscription are dropped. Subsequent `Pull` and `StreamingPull` requests will return FAILED_PRECONDITION. If the subscription is a push subscription, pushes to the endpoint will stop.

        + *

        Request object method variants only take one parameter, a request object, which must be constructed before the call.

        + *
          + *
        • detachSubscription(DetachSubscriptionRequest request) + *

        + *

        Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

        + *
          + *
        • detachSubscriptionCallable() + *

        + *

        SetIamPolicy

        Sets the access control policy on the specified resource. Replacesany existing policy. + *

        Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED`errors.

        + *

        Request object method variants only take one parameter, a request object, which must be constructed before the call.

        + *
          + *
        • setIamPolicy(SetIamPolicyRequest request) + *

        + *

        Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

        + *
          + *
        • setIamPolicyCallable() + *

        + *

        GetIamPolicy

        Gets the access control policy for a resource. Returns an empty policyif the resource exists and does not have a policy set.

        + *

        Request object method variants only take one parameter, a request object, which must be constructed before the call.

        + *
          + *
        • getIamPolicy(GetIamPolicyRequest request) + *

        + *

        Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

        + *
          + *
        • getIamPolicyCallable() + *

        + *

        TestIamPermissions

        Returns permissions that a caller has on the specified resource. If theresource does not exist, this will return an empty set ofpermissions, not a `NOT_FOUND` error. + *

        Note: This operation is designed to be used for buildingpermission-aware UIs and command-line tools, not for authorizationchecking. This operation may "fail open" without warning.

        + *

        Request object method variants only take one parameter, a request object, which must be constructed before the call.

        + *
          + *
        • testIamPermissions(TestIamPermissionsRequest request) + *

        + *

        Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

        + *
          + *
        • testIamPermissionsCallable() + *

        + *
        * *

        See the individual methods for example code. * @@ -1312,6 +1515,7 @@ public final DetachSubscriptionResponse detachSubscription(DetachSubscriptionReq * SetIamPolicyRequest.newBuilder() * .setResource(SnapshotName.of("[PROJECT]", "[SNAPSHOT]").toString()) * .setPolicy(Policy.newBuilder().build()) + * .setUpdateMask(FieldMask.newBuilder().build()) * .build(); * Policy response = topicAdminClient.setIamPolicy(request); * } @@ -1343,6 +1547,7 @@ public final Policy setIamPolicy(SetIamPolicyRequest request) { * SetIamPolicyRequest.newBuilder() * .setResource(SnapshotName.of("[PROJECT]", "[SNAPSHOT]").toString()) * .setPolicy(Policy.newBuilder().build()) + * .setUpdateMask(FieldMask.newBuilder().build()) * .build(); * ApiFuture future = topicAdminClient.setIamPolicyCallable().futureCall(request); * // Do something. diff --git a/test/integration/goldens/pubsub/src/com/google/cloud/pubsub/v1/TopicAdminClientTest.java b/test/integration/goldens/pubsub/src/com/google/cloud/pubsub/v1/TopicAdminClientTest.java index f6d60d9032..4123fa75dd 100644 --- a/test/integration/goldens/pubsub/src/com/google/cloud/pubsub/v1/TopicAdminClientTest.java +++ b/test/integration/goldens/pubsub/src/com/google/cloud/pubsub/v1/TopicAdminClientTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -28,6 +28,7 @@ import com.google.api.gax.rpc.ApiClientHeaderProvider; import com.google.api.gax.rpc.InvalidArgumentException; import com.google.common.collect.Lists; +import com.google.iam.v1.AuditConfig; import com.google.iam.v1.Binding; import com.google.iam.v1.GetIamPolicyRequest; import com.google.iam.v1.GetPolicyOptions; @@ -805,6 +806,7 @@ public void setIamPolicyTest() throws Exception { Policy.newBuilder() .setVersion(351608024) .addAllBindings(new ArrayList()) + .addAllAuditConfigs(new ArrayList()) .setEtag(ByteString.EMPTY) .build(); mockIAMPolicy.addResponse(expectedResponse); @@ -813,6 +815,7 @@ public void setIamPolicyTest() throws Exception { SetIamPolicyRequest.newBuilder() .setResource(SnapshotName.of("[PROJECT]", "[SNAPSHOT]").toString()) .setPolicy(Policy.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) .build(); Policy actualResponse = client.setIamPolicy(request); @@ -824,6 +827,7 @@ public void setIamPolicyTest() throws Exception { Assert.assertEquals(request.getResource(), actualRequest.getResource()); Assert.assertEquals(request.getPolicy(), actualRequest.getPolicy()); + Assert.assertEquals(request.getUpdateMask(), actualRequest.getUpdateMask()); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), @@ -840,6 +844,7 @@ public void setIamPolicyExceptionTest() throws Exception { SetIamPolicyRequest.newBuilder() .setResource(SnapshotName.of("[PROJECT]", "[SNAPSHOT]").toString()) .setPolicy(Policy.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) .build(); client.setIamPolicy(request); Assert.fail("No exception raised"); @@ -854,6 +859,7 @@ public void getIamPolicyTest() throws Exception { Policy.newBuilder() .setVersion(351608024) .addAllBindings(new ArrayList()) + .addAllAuditConfigs(new ArrayList()) .setEtag(ByteString.EMPTY) .build(); mockIAMPolicy.addResponse(expectedResponse); diff --git a/test/integration/goldens/pubsub/src/com/google/cloud/pubsub/v1/TopicAdminSettings.java b/test/integration/goldens/pubsub/src/com/google/cloud/pubsub/v1/TopicAdminSettings.java index a0940a9ded..e089bdd568 100644 --- a/test/integration/goldens/pubsub/src/com/google/cloud/pubsub/v1/TopicAdminSettings.java +++ b/test/integration/goldens/pubsub/src/com/google/cloud/pubsub/v1/TopicAdminSettings.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -21,7 +21,6 @@ import static com.google.cloud.pubsub.v1.TopicAdminClient.ListTopicsPagedResponse; import com.google.api.core.ApiFunction; -import com.google.api.core.BetaApi; import com.google.api.gax.core.GoogleCredentialsProvider; import com.google.api.gax.core.InstantiatingExecutorProvider; import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; @@ -73,7 +72,9 @@ *

        The builder of this class is recursive, so contained classes are themselves builders. When * build() is called, the tree of builders is called to create the complete settings object. * - *

        For example, to set the total timeout of createTopic to 30 seconds: + *

        For example, to set the + * [RetrySettings](https://cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.retrying.RetrySettings) + * of createTopic: * *

        {@code
          * // This snippet has been automatically generated and should be regarded as a code template only.
        @@ -89,10 +90,21 @@
          *             .createTopicSettings()
          *             .getRetrySettings()
          *             .toBuilder()
        - *             .setTotalTimeout(Duration.ofSeconds(30))
        + *             .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());
          * TopicAdminSettings topicAdminSettings = topicAdminSettingsBuilder.build();
          * }
        + * + * Please refer to the [Client Side Retry + * Guide](https://docs.cloud.google.com/java/docs/client-retries) for additional support in setting + * retries. */ @Generated("by gapic-generator-java") public class TopicAdminSettings extends ClientSettings { @@ -199,7 +211,6 @@ public static TransportChannelProvider defaultTransportChannelProvider() { return PublisherStubSettings.defaultTransportChannelProvider(); } - @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { return PublisherStubSettings.defaultApiClientHeaderProviderBuilder(); } diff --git a/test/integration/goldens/pubsub/src/com/google/cloud/pubsub/v1/gapic_metadata.json b/test/integration/goldens/pubsub/src/com/google/cloud/pubsub/v1/gapic_metadata.json index 8efac12d01..ff5a589d6e 100644 --- a/test/integration/goldens/pubsub/src/com/google/cloud/pubsub/v1/gapic_metadata.json +++ b/test/integration/goldens/pubsub/src/com/google/cloud/pubsub/v1/gapic_metadata.json @@ -121,21 +121,33 @@ "grpc": { "libraryClient": "SchemaServiceClient", "rpcs": { + "CommitSchema": { + "methods": ["commitSchema", "commitSchema", "commitSchema", "commitSchemaCallable"] + }, "CreateSchema": { "methods": ["createSchema", "createSchema", "createSchema", "createSchemaCallable"] }, "DeleteSchema": { "methods": ["deleteSchema", "deleteSchema", "deleteSchema", "deleteSchemaCallable"] }, + "DeleteSchemaRevision": { + "methods": ["deleteSchemaRevision", "deleteSchemaRevision", "deleteSchemaRevision", "deleteSchemaRevisionCallable"] + }, "GetIamPolicy": { "methods": ["getIamPolicy", "getIamPolicyCallable"] }, "GetSchema": { "methods": ["getSchema", "getSchema", "getSchema", "getSchemaCallable"] }, + "ListSchemaRevisions": { + "methods": ["listSchemaRevisions", "listSchemaRevisions", "listSchemaRevisions", "listSchemaRevisionsPagedCallable", "listSchemaRevisionsCallable"] + }, "ListSchemas": { "methods": ["listSchemas", "listSchemas", "listSchemas", "listSchemasPagedCallable", "listSchemasCallable"] }, + "RollbackSchema": { + "methods": ["rollbackSchema", "rollbackSchema", "rollbackSchema", "rollbackSchemaCallable"] + }, "SetIamPolicy": { "methods": ["setIamPolicy", "setIamPolicyCallable"] }, diff --git a/test/integration/goldens/pubsub/src/com/google/cloud/pubsub/v1/package-info.java b/test/integration/goldens/pubsub/src/com/google/cloud/pubsub/v1/package-info.java index 097c53df35..a85a38b2b4 100644 --- a/test/integration/goldens/pubsub/src/com/google/cloud/pubsub/v1/package-info.java +++ b/test/integration/goldens/pubsub/src/com/google/cloud/pubsub/v1/package-info.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/pubsub/src/com/google/cloud/pubsub/v1/stub/GrpcPublisherCallableFactory.java b/test/integration/goldens/pubsub/src/com/google/cloud/pubsub/v1/stub/GrpcPublisherCallableFactory.java index 140ba04741..92adc0c861 100644 --- a/test/integration/goldens/pubsub/src/com/google/cloud/pubsub/v1/stub/GrpcPublisherCallableFactory.java +++ b/test/integration/goldens/pubsub/src/com/google/cloud/pubsub/v1/stub/GrpcPublisherCallableFactory.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/pubsub/src/com/google/cloud/pubsub/v1/stub/GrpcPublisherStub.java b/test/integration/goldens/pubsub/src/com/google/cloud/pubsub/v1/stub/GrpcPublisherStub.java index bc855e57e9..71c31ff859 100644 --- a/test/integration/goldens/pubsub/src/com/google/cloud/pubsub/v1/stub/GrpcPublisherStub.java +++ b/test/integration/goldens/pubsub/src/com/google/cloud/pubsub/v1/stub/GrpcPublisherStub.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -25,8 +25,8 @@ 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.common.collect.ImmutableMap; import com.google.iam.v1.GetIamPolicyRequest; import com.google.iam.v1.Policy; import com.google.iam.v1.SetIamPolicyRequest; @@ -69,6 +69,7 @@ public class GrpcPublisherStub extends PublisherStub { .setFullMethodName("google.pubsub.v1.Publisher/CreateTopic") .setRequestMarshaller(ProtoUtils.marshaller(Topic.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(Topic.getDefaultInstance())) + .setSampledToLocalTracing(true) .build(); private static final MethodDescriptor updateTopicMethodDescriptor = @@ -77,6 +78,7 @@ public class GrpcPublisherStub extends PublisherStub { .setFullMethodName("google.pubsub.v1.Publisher/UpdateTopic") .setRequestMarshaller(ProtoUtils.marshaller(UpdateTopicRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(Topic.getDefaultInstance())) + .setSampledToLocalTracing(true) .build(); private static final MethodDescriptor publishMethodDescriptor = @@ -85,6 +87,7 @@ public class GrpcPublisherStub extends PublisherStub { .setFullMethodName("google.pubsub.v1.Publisher/Publish") .setRequestMarshaller(ProtoUtils.marshaller(PublishRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(PublishResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) .build(); private static final MethodDescriptor getTopicMethodDescriptor = @@ -93,6 +96,7 @@ public class GrpcPublisherStub extends PublisherStub { .setFullMethodName("google.pubsub.v1.Publisher/GetTopic") .setRequestMarshaller(ProtoUtils.marshaller(GetTopicRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(Topic.getDefaultInstance())) + .setSampledToLocalTracing(true) .build(); private static final MethodDescriptor @@ -102,6 +106,7 @@ public class GrpcPublisherStub extends PublisherStub { .setFullMethodName("google.pubsub.v1.Publisher/ListTopics") .setRequestMarshaller(ProtoUtils.marshaller(ListTopicsRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(ListTopicsResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) .build(); private static final MethodDescriptor< @@ -115,6 +120,7 @@ public class GrpcPublisherStub extends PublisherStub { ProtoUtils.marshaller(ListTopicSubscriptionsRequest.getDefaultInstance())) .setResponseMarshaller( ProtoUtils.marshaller(ListTopicSubscriptionsResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) .build(); private static final MethodDescriptor @@ -126,6 +132,7 @@ public class GrpcPublisherStub extends PublisherStub { ProtoUtils.marshaller(ListTopicSnapshotsRequest.getDefaultInstance())) .setResponseMarshaller( ProtoUtils.marshaller(ListTopicSnapshotsResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) .build(); private static final MethodDescriptor deleteTopicMethodDescriptor = @@ -134,6 +141,7 @@ public class GrpcPublisherStub extends PublisherStub { .setFullMethodName("google.pubsub.v1.Publisher/DeleteTopic") .setRequestMarshaller(ProtoUtils.marshaller(DeleteTopicRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(Empty.getDefaultInstance())) + .setSampledToLocalTracing(true) .build(); private static final MethodDescriptor @@ -145,6 +153,7 @@ public class GrpcPublisherStub extends PublisherStub { ProtoUtils.marshaller(DetachSubscriptionRequest.getDefaultInstance())) .setResponseMarshaller( ProtoUtils.marshaller(DetachSubscriptionResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) .build(); private static final MethodDescriptor setIamPolicyMethodDescriptor = @@ -153,6 +162,7 @@ public class GrpcPublisherStub extends PublisherStub { .setFullMethodName("google.iam.v1.IAMPolicy/SetIamPolicy") .setRequestMarshaller(ProtoUtils.marshaller(SetIamPolicyRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(Policy.getDefaultInstance())) + .setSampledToLocalTracing(true) .build(); private static final MethodDescriptor getIamPolicyMethodDescriptor = @@ -161,6 +171,7 @@ public class GrpcPublisherStub extends PublisherStub { .setFullMethodName("google.iam.v1.IAMPolicy/GetIamPolicy") .setRequestMarshaller(ProtoUtils.marshaller(GetIamPolicyRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(Policy.getDefaultInstance())) + .setSampledToLocalTracing(true) .build(); private static final MethodDescriptor @@ -172,6 +183,7 @@ public class GrpcPublisherStub extends PublisherStub { ProtoUtils.marshaller(TestIamPermissionsRequest.getDefaultInstance())) .setResponseMarshaller( ProtoUtils.marshaller(TestIamPermissionsResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) .build(); private final UnaryCallable createTopicCallable; @@ -242,19 +254,20 @@ protected GrpcPublisherStub( .setMethodDescriptor(createTopicMethodDescriptor) .setParamsExtractor( request -> { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("name", String.valueOf(request.getName())); - return params.build(); + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); }) + .setResourceNameExtractor(request -> request.getName()) .build(); GrpcCallSettings updateTopicTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(updateTopicMethodDescriptor) .setParamsExtractor( request -> { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("topic.name", String.valueOf(request.getTopic().getName())); - return params.build(); + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("topic.name", String.valueOf(request.getTopic().getName())); + return builder.build(); }) .build(); GrpcCallSettings publishTransportSettings = @@ -262,30 +275,33 @@ protected GrpcPublisherStub( .setMethodDescriptor(publishMethodDescriptor) .setParamsExtractor( request -> { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("topic", String.valueOf(request.getTopic())); - return params.build(); + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("topic", String.valueOf(request.getTopic())); + return builder.build(); }) + .setResourceNameExtractor(request -> request.getTopic()) .build(); GrpcCallSettings getTopicTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(getTopicMethodDescriptor) .setParamsExtractor( request -> { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("topic", String.valueOf(request.getTopic())); - return params.build(); + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("topic", String.valueOf(request.getTopic())); + return builder.build(); }) + .setResourceNameExtractor(request -> request.getTopic()) .build(); GrpcCallSettings listTopicsTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(listTopicsMethodDescriptor) .setParamsExtractor( request -> { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("project", String.valueOf(request.getProject())); - return params.build(); + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("project", String.valueOf(request.getProject())); + return builder.build(); }) + .setResourceNameExtractor(request -> request.getProject()) .build(); GrpcCallSettings listTopicSubscriptionsTransportSettings = @@ -294,10 +310,11 @@ protected GrpcPublisherStub( .setMethodDescriptor(listTopicSubscriptionsMethodDescriptor) .setParamsExtractor( request -> { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("topic", String.valueOf(request.getTopic())); - return params.build(); + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("topic", String.valueOf(request.getTopic())); + return builder.build(); }) + .setResourceNameExtractor(request -> request.getTopic()) .build(); GrpcCallSettings listTopicSnapshotsTransportSettings = @@ -305,20 +322,22 @@ protected GrpcPublisherStub( .setMethodDescriptor(listTopicSnapshotsMethodDescriptor) .setParamsExtractor( request -> { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("topic", String.valueOf(request.getTopic())); - return params.build(); + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("topic", String.valueOf(request.getTopic())); + return builder.build(); }) + .setResourceNameExtractor(request -> request.getTopic()) .build(); GrpcCallSettings deleteTopicTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(deleteTopicMethodDescriptor) .setParamsExtractor( request -> { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("topic", String.valueOf(request.getTopic())); - return params.build(); + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("topic", String.valueOf(request.getTopic())); + return builder.build(); }) + .setResourceNameExtractor(request -> request.getTopic()) .build(); GrpcCallSettings detachSubscriptionTransportSettings = @@ -326,30 +345,33 @@ protected GrpcPublisherStub( .setMethodDescriptor(detachSubscriptionMethodDescriptor) .setParamsExtractor( request -> { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("subscription", String.valueOf(request.getSubscription())); - return params.build(); + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("subscription", String.valueOf(request.getSubscription())); + return builder.build(); }) + .setResourceNameExtractor(request -> request.getSubscription()) .build(); GrpcCallSettings setIamPolicyTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(setIamPolicyMethodDescriptor) .setParamsExtractor( request -> { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("resource", String.valueOf(request.getResource())); - return params.build(); + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("resource", String.valueOf(request.getResource())); + return builder.build(); }) + .setResourceNameExtractor(request -> request.getResource()) .build(); GrpcCallSettings getIamPolicyTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(getIamPolicyMethodDescriptor) .setParamsExtractor( request -> { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("resource", String.valueOf(request.getResource())); - return params.build(); + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("resource", String.valueOf(request.getResource())); + return builder.build(); }) + .setResourceNameExtractor(request -> request.getResource()) .build(); GrpcCallSettings testIamPermissionsTransportSettings = @@ -357,10 +379,11 @@ protected GrpcPublisherStub( .setMethodDescriptor(testIamPermissionsMethodDescriptor) .setParamsExtractor( request -> { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("resource", String.valueOf(request.getResource())); - return params.build(); + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("resource", String.valueOf(request.getResource())); + return builder.build(); }) + .setResourceNameExtractor(request -> request.getResource()) .build(); this.createTopicCallable = diff --git a/test/integration/goldens/pubsub/src/com/google/cloud/pubsub/v1/stub/GrpcSchemaServiceCallableFactory.java b/test/integration/goldens/pubsub/src/com/google/cloud/pubsub/v1/stub/GrpcSchemaServiceCallableFactory.java index 25bb845003..16236bc4bd 100644 --- a/test/integration/goldens/pubsub/src/com/google/cloud/pubsub/v1/stub/GrpcSchemaServiceCallableFactory.java +++ b/test/integration/goldens/pubsub/src/com/google/cloud/pubsub/v1/stub/GrpcSchemaServiceCallableFactory.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/pubsub/src/com/google/cloud/pubsub/v1/stub/GrpcSchemaServiceStub.java b/test/integration/goldens/pubsub/src/com/google/cloud/pubsub/v1/stub/GrpcSchemaServiceStub.java index cfd83cf866..775b0ad332 100644 --- a/test/integration/goldens/pubsub/src/com/google/cloud/pubsub/v1/stub/GrpcSchemaServiceStub.java +++ b/test/integration/goldens/pubsub/src/com/google/cloud/pubsub/v1/stub/GrpcSchemaServiceStub.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,6 +16,7 @@ package com.google.cloud.pubsub.v1.stub; +import static com.google.cloud.pubsub.v1.SchemaServiceClient.ListSchemaRevisionsPagedResponse; import static com.google.cloud.pubsub.v1.SchemaServiceClient.ListSchemasPagedResponse; import com.google.api.gax.core.BackgroundResource; @@ -23,8 +24,8 @@ 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.common.collect.ImmutableMap; import com.google.iam.v1.GetIamPolicyRequest; import com.google.iam.v1.Policy; import com.google.iam.v1.SetIamPolicyRequest; @@ -32,11 +33,16 @@ import com.google.iam.v1.TestIamPermissionsResponse; import com.google.longrunning.stub.GrpcOperationsStub; import com.google.protobuf.Empty; +import com.google.pubsub.v1.CommitSchemaRequest; import com.google.pubsub.v1.CreateSchemaRequest; import com.google.pubsub.v1.DeleteSchemaRequest; +import com.google.pubsub.v1.DeleteSchemaRevisionRequest; import com.google.pubsub.v1.GetSchemaRequest; +import com.google.pubsub.v1.ListSchemaRevisionsRequest; +import com.google.pubsub.v1.ListSchemaRevisionsResponse; import com.google.pubsub.v1.ListSchemasRequest; import com.google.pubsub.v1.ListSchemasResponse; +import com.google.pubsub.v1.RollbackSchemaRequest; import com.google.pubsub.v1.Schema; import com.google.pubsub.v1.ValidateMessageRequest; import com.google.pubsub.v1.ValidateMessageResponse; @@ -63,6 +69,7 @@ public class GrpcSchemaServiceStub extends SchemaServiceStub { .setFullMethodName("google.pubsub.v1.SchemaService/CreateSchema") .setRequestMarshaller(ProtoUtils.marshaller(CreateSchemaRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(Schema.getDefaultInstance())) + .setSampledToLocalTracing(true) .build(); private static final MethodDescriptor getSchemaMethodDescriptor = @@ -71,6 +78,7 @@ public class GrpcSchemaServiceStub extends SchemaServiceStub { .setFullMethodName("google.pubsub.v1.SchemaService/GetSchema") .setRequestMarshaller(ProtoUtils.marshaller(GetSchemaRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(Schema.getDefaultInstance())) + .setSampledToLocalTracing(true) .build(); private static final MethodDescriptor @@ -81,6 +89,50 @@ public class GrpcSchemaServiceStub extends SchemaServiceStub { .setRequestMarshaller(ProtoUtils.marshaller(ListSchemasRequest.getDefaultInstance())) .setResponseMarshaller( ProtoUtils.marshaller(ListSchemasResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor + listSchemaRevisionsMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.pubsub.v1.SchemaService/ListSchemaRevisions") + .setRequestMarshaller( + ProtoUtils.marshaller(ListSchemaRevisionsRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(ListSchemaRevisionsResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor commitSchemaMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.pubsub.v1.SchemaService/CommitSchema") + .setRequestMarshaller(ProtoUtils.marshaller(CommitSchemaRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Schema.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor + rollbackSchemaMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.pubsub.v1.SchemaService/RollbackSchema") + .setRequestMarshaller( + ProtoUtils.marshaller(RollbackSchemaRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Schema.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor + deleteSchemaRevisionMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.pubsub.v1.SchemaService/DeleteSchemaRevision") + .setRequestMarshaller( + ProtoUtils.marshaller(DeleteSchemaRevisionRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Schema.getDefaultInstance())) + .setSampledToLocalTracing(true) .build(); private static final MethodDescriptor deleteSchemaMethodDescriptor = @@ -89,6 +141,7 @@ public class GrpcSchemaServiceStub extends SchemaServiceStub { .setFullMethodName("google.pubsub.v1.SchemaService/DeleteSchema") .setRequestMarshaller(ProtoUtils.marshaller(DeleteSchemaRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(Empty.getDefaultInstance())) + .setSampledToLocalTracing(true) .build(); private static final MethodDescriptor @@ -100,6 +153,7 @@ public class GrpcSchemaServiceStub extends SchemaServiceStub { ProtoUtils.marshaller(ValidateSchemaRequest.getDefaultInstance())) .setResponseMarshaller( ProtoUtils.marshaller(ValidateSchemaResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) .build(); private static final MethodDescriptor @@ -111,6 +165,7 @@ public class GrpcSchemaServiceStub extends SchemaServiceStub { ProtoUtils.marshaller(ValidateMessageRequest.getDefaultInstance())) .setResponseMarshaller( ProtoUtils.marshaller(ValidateMessageResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) .build(); private static final MethodDescriptor setIamPolicyMethodDescriptor = @@ -119,6 +174,7 @@ public class GrpcSchemaServiceStub extends SchemaServiceStub { .setFullMethodName("google.iam.v1.IAMPolicy/SetIamPolicy") .setRequestMarshaller(ProtoUtils.marshaller(SetIamPolicyRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(Policy.getDefaultInstance())) + .setSampledToLocalTracing(true) .build(); private static final MethodDescriptor getIamPolicyMethodDescriptor = @@ -127,6 +183,7 @@ public class GrpcSchemaServiceStub extends SchemaServiceStub { .setFullMethodName("google.iam.v1.IAMPolicy/GetIamPolicy") .setRequestMarshaller(ProtoUtils.marshaller(GetIamPolicyRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(Policy.getDefaultInstance())) + .setSampledToLocalTracing(true) .build(); private static final MethodDescriptor @@ -138,6 +195,7 @@ public class GrpcSchemaServiceStub extends SchemaServiceStub { ProtoUtils.marshaller(TestIamPermissionsRequest.getDefaultInstance())) .setResponseMarshaller( ProtoUtils.marshaller(TestIamPermissionsResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) .build(); private final UnaryCallable createSchemaCallable; @@ -145,6 +203,13 @@ public class GrpcSchemaServiceStub extends SchemaServiceStub { private final UnaryCallable listSchemasCallable; private final UnaryCallable listSchemasPagedCallable; + private final UnaryCallable + listSchemaRevisionsCallable; + private final UnaryCallable + listSchemaRevisionsPagedCallable; + private final UnaryCallable commitSchemaCallable; + private final UnaryCallable rollbackSchemaCallable; + private final UnaryCallable deleteSchemaRevisionCallable; private final UnaryCallable deleteSchemaCallable; private final UnaryCallable validateSchemaCallable; private final UnaryCallable @@ -201,40 +266,89 @@ protected GrpcSchemaServiceStub( .setMethodDescriptor(createSchemaMethodDescriptor) .setParamsExtractor( request -> { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("parent", String.valueOf(request.getParent())); - return params.build(); + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); }) + .setResourceNameExtractor(request -> request.getParent()) .build(); GrpcCallSettings getSchemaTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(getSchemaMethodDescriptor) .setParamsExtractor( request -> { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("name", String.valueOf(request.getName())); - return params.build(); + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); }) + .setResourceNameExtractor(request -> request.getName()) .build(); GrpcCallSettings listSchemasTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(listSchemasMethodDescriptor) .setParamsExtractor( request -> { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("parent", String.valueOf(request.getParent())); - return params.build(); + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .setResourceNameExtractor(request -> request.getParent()) + .build(); + GrpcCallSettings + listSchemaRevisionsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(listSchemaRevisionsMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .setResourceNameExtractor(request -> request.getName()) + .build(); + GrpcCallSettings commitSchemaTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(commitSchemaMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .setResourceNameExtractor(request -> request.getName()) + .build(); + GrpcCallSettings rollbackSchemaTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(rollbackSchemaMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); }) + .setResourceNameExtractor(request -> request.getName()) + .build(); + GrpcCallSettings deleteSchemaRevisionTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(deleteSchemaRevisionMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .setResourceNameExtractor(request -> request.getName()) .build(); GrpcCallSettings deleteSchemaTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(deleteSchemaMethodDescriptor) .setParamsExtractor( request -> { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("name", String.valueOf(request.getName())); - return params.build(); + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); }) + .setResourceNameExtractor(request -> request.getName()) .build(); GrpcCallSettings validateSchemaTransportSettings = @@ -242,10 +356,11 @@ protected GrpcSchemaServiceStub( .setMethodDescriptor(validateSchemaMethodDescriptor) .setParamsExtractor( request -> { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("parent", String.valueOf(request.getParent())); - return params.build(); + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); }) + .setResourceNameExtractor(request -> request.getParent()) .build(); GrpcCallSettings validateMessageTransportSettings = @@ -253,30 +368,33 @@ protected GrpcSchemaServiceStub( .setMethodDescriptor(validateMessageMethodDescriptor) .setParamsExtractor( request -> { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("parent", String.valueOf(request.getParent())); - return params.build(); + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); }) + .setResourceNameExtractor(request -> request.getParent()) .build(); GrpcCallSettings setIamPolicyTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(setIamPolicyMethodDescriptor) .setParamsExtractor( request -> { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("resource", String.valueOf(request.getResource())); - return params.build(); + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("resource", String.valueOf(request.getResource())); + return builder.build(); }) + .setResourceNameExtractor(request -> request.getResource()) .build(); GrpcCallSettings getIamPolicyTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(getIamPolicyMethodDescriptor) .setParamsExtractor( request -> { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("resource", String.valueOf(request.getResource())); - return params.build(); + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("resource", String.valueOf(request.getResource())); + return builder.build(); }) + .setResourceNameExtractor(request -> request.getResource()) .build(); GrpcCallSettings testIamPermissionsTransportSettings = @@ -284,10 +402,11 @@ protected GrpcSchemaServiceStub( .setMethodDescriptor(testIamPermissionsMethodDescriptor) .setParamsExtractor( request -> { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("resource", String.valueOf(request.getResource())); - return params.build(); + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("resource", String.valueOf(request.getResource())); + return builder.build(); }) + .setResourceNameExtractor(request -> request.getResource()) .build(); this.createSchemaCallable = @@ -302,6 +421,27 @@ protected GrpcSchemaServiceStub( this.listSchemasPagedCallable = callableFactory.createPagedCallable( listSchemasTransportSettings, settings.listSchemasSettings(), clientContext); + this.listSchemaRevisionsCallable = + callableFactory.createUnaryCallable( + listSchemaRevisionsTransportSettings, + settings.listSchemaRevisionsSettings(), + clientContext); + this.listSchemaRevisionsPagedCallable = + callableFactory.createPagedCallable( + listSchemaRevisionsTransportSettings, + settings.listSchemaRevisionsSettings(), + clientContext); + this.commitSchemaCallable = + callableFactory.createUnaryCallable( + commitSchemaTransportSettings, settings.commitSchemaSettings(), clientContext); + this.rollbackSchemaCallable = + callableFactory.createUnaryCallable( + rollbackSchemaTransportSettings, settings.rollbackSchemaSettings(), clientContext); + this.deleteSchemaRevisionCallable = + callableFactory.createUnaryCallable( + deleteSchemaRevisionTransportSettings, + settings.deleteSchemaRevisionSettings(), + clientContext); this.deleteSchemaCallable = callableFactory.createUnaryCallable( deleteSchemaTransportSettings, settings.deleteSchemaSettings(), clientContext); @@ -351,6 +491,33 @@ public UnaryCallable listSchemasPa return listSchemasPagedCallable; } + @Override + public UnaryCallable + listSchemaRevisionsCallable() { + return listSchemaRevisionsCallable; + } + + @Override + public UnaryCallable + listSchemaRevisionsPagedCallable() { + return listSchemaRevisionsPagedCallable; + } + + @Override + public UnaryCallable commitSchemaCallable() { + return commitSchemaCallable; + } + + @Override + public UnaryCallable rollbackSchemaCallable() { + return rollbackSchemaCallable; + } + + @Override + public UnaryCallable deleteSchemaRevisionCallable() { + return deleteSchemaRevisionCallable; + } + @Override public UnaryCallable deleteSchemaCallable() { return deleteSchemaCallable; diff --git a/test/integration/goldens/pubsub/src/com/google/cloud/pubsub/v1/stub/GrpcSubscriberCallableFactory.java b/test/integration/goldens/pubsub/src/com/google/cloud/pubsub/v1/stub/GrpcSubscriberCallableFactory.java index 555d231b3b..8249a72194 100644 --- a/test/integration/goldens/pubsub/src/com/google/cloud/pubsub/v1/stub/GrpcSubscriberCallableFactory.java +++ b/test/integration/goldens/pubsub/src/com/google/cloud/pubsub/v1/stub/GrpcSubscriberCallableFactory.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/pubsub/src/com/google/cloud/pubsub/v1/stub/GrpcSubscriberStub.java b/test/integration/goldens/pubsub/src/com/google/cloud/pubsub/v1/stub/GrpcSubscriberStub.java index d29c044249..02f4b0cce0 100644 --- a/test/integration/goldens/pubsub/src/com/google/cloud/pubsub/v1/stub/GrpcSubscriberStub.java +++ b/test/integration/goldens/pubsub/src/com/google/cloud/pubsub/v1/stub/GrpcSubscriberStub.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -25,8 +25,8 @@ 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.common.collect.ImmutableMap; import com.google.iam.v1.GetIamPolicyRequest; import com.google.iam.v1.Policy; import com.google.iam.v1.SetIamPolicyRequest; @@ -78,6 +78,7 @@ public class GrpcSubscriberStub extends SubscriberStub { .setFullMethodName("google.pubsub.v1.Subscriber/CreateSubscription") .setRequestMarshaller(ProtoUtils.marshaller(Subscription.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(Subscription.getDefaultInstance())) + .setSampledToLocalTracing(true) .build(); private static final MethodDescriptor @@ -88,6 +89,7 @@ public class GrpcSubscriberStub extends SubscriberStub { .setRequestMarshaller( ProtoUtils.marshaller(GetSubscriptionRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(Subscription.getDefaultInstance())) + .setSampledToLocalTracing(true) .build(); private static final MethodDescriptor @@ -98,6 +100,7 @@ public class GrpcSubscriberStub extends SubscriberStub { .setRequestMarshaller( ProtoUtils.marshaller(UpdateSubscriptionRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(Subscription.getDefaultInstance())) + .setSampledToLocalTracing(true) .build(); private static final MethodDescriptor @@ -109,6 +112,7 @@ public class GrpcSubscriberStub extends SubscriberStub { ProtoUtils.marshaller(ListSubscriptionsRequest.getDefaultInstance())) .setResponseMarshaller( ProtoUtils.marshaller(ListSubscriptionsResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) .build(); private static final MethodDescriptor @@ -119,6 +123,7 @@ public class GrpcSubscriberStub extends SubscriberStub { .setRequestMarshaller( ProtoUtils.marshaller(DeleteSubscriptionRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(Empty.getDefaultInstance())) + .setSampledToLocalTracing(true) .build(); private static final MethodDescriptor @@ -129,6 +134,7 @@ public class GrpcSubscriberStub extends SubscriberStub { .setRequestMarshaller( ProtoUtils.marshaller(ModifyAckDeadlineRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(Empty.getDefaultInstance())) + .setSampledToLocalTracing(true) .build(); private static final MethodDescriptor acknowledgeMethodDescriptor = @@ -137,6 +143,7 @@ public class GrpcSubscriberStub extends SubscriberStub { .setFullMethodName("google.pubsub.v1.Subscriber/Acknowledge") .setRequestMarshaller(ProtoUtils.marshaller(AcknowledgeRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(Empty.getDefaultInstance())) + .setSampledToLocalTracing(true) .build(); private static final MethodDescriptor pullMethodDescriptor = @@ -145,6 +152,7 @@ public class GrpcSubscriberStub extends SubscriberStub { .setFullMethodName("google.pubsub.v1.Subscriber/Pull") .setRequestMarshaller(ProtoUtils.marshaller(PullRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(PullResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) .build(); private static final MethodDescriptor @@ -156,6 +164,7 @@ public class GrpcSubscriberStub extends SubscriberStub { ProtoUtils.marshaller(StreamingPullRequest.getDefaultInstance())) .setResponseMarshaller( ProtoUtils.marshaller(StreamingPullResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) .build(); private static final MethodDescriptor @@ -166,6 +175,7 @@ public class GrpcSubscriberStub extends SubscriberStub { .setRequestMarshaller( ProtoUtils.marshaller(ModifyPushConfigRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(Empty.getDefaultInstance())) + .setSampledToLocalTracing(true) .build(); private static final MethodDescriptor getSnapshotMethodDescriptor = @@ -174,6 +184,7 @@ public class GrpcSubscriberStub extends SubscriberStub { .setFullMethodName("google.pubsub.v1.Subscriber/GetSnapshot") .setRequestMarshaller(ProtoUtils.marshaller(GetSnapshotRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(Snapshot.getDefaultInstance())) + .setSampledToLocalTracing(true) .build(); private static final MethodDescriptor @@ -185,6 +196,7 @@ public class GrpcSubscriberStub extends SubscriberStub { ProtoUtils.marshaller(ListSnapshotsRequest.getDefaultInstance())) .setResponseMarshaller( ProtoUtils.marshaller(ListSnapshotsResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) .build(); private static final MethodDescriptor @@ -195,6 +207,7 @@ public class GrpcSubscriberStub extends SubscriberStub { .setRequestMarshaller( ProtoUtils.marshaller(CreateSnapshotRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(Snapshot.getDefaultInstance())) + .setSampledToLocalTracing(true) .build(); private static final MethodDescriptor @@ -205,6 +218,7 @@ public class GrpcSubscriberStub extends SubscriberStub { .setRequestMarshaller( ProtoUtils.marshaller(UpdateSnapshotRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(Snapshot.getDefaultInstance())) + .setSampledToLocalTracing(true) .build(); private static final MethodDescriptor @@ -215,6 +229,7 @@ public class GrpcSubscriberStub extends SubscriberStub { .setRequestMarshaller( ProtoUtils.marshaller(DeleteSnapshotRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(Empty.getDefaultInstance())) + .setSampledToLocalTracing(true) .build(); private static final MethodDescriptor seekMethodDescriptor = @@ -223,6 +238,7 @@ public class GrpcSubscriberStub extends SubscriberStub { .setFullMethodName("google.pubsub.v1.Subscriber/Seek") .setRequestMarshaller(ProtoUtils.marshaller(SeekRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(SeekResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) .build(); private static final MethodDescriptor setIamPolicyMethodDescriptor = @@ -231,6 +247,7 @@ public class GrpcSubscriberStub extends SubscriberStub { .setFullMethodName("google.iam.v1.IAMPolicy/SetIamPolicy") .setRequestMarshaller(ProtoUtils.marshaller(SetIamPolicyRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(Policy.getDefaultInstance())) + .setSampledToLocalTracing(true) .build(); private static final MethodDescriptor getIamPolicyMethodDescriptor = @@ -239,6 +256,7 @@ public class GrpcSubscriberStub extends SubscriberStub { .setFullMethodName("google.iam.v1.IAMPolicy/GetIamPolicy") .setRequestMarshaller(ProtoUtils.marshaller(GetIamPolicyRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(Policy.getDefaultInstance())) + .setSampledToLocalTracing(true) .build(); private static final MethodDescriptor @@ -250,6 +268,7 @@ public class GrpcSubscriberStub extends SubscriberStub { ProtoUtils.marshaller(TestIamPermissionsRequest.getDefaultInstance())) .setResponseMarshaller( ProtoUtils.marshaller(TestIamPermissionsResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) .build(); private final UnaryCallable createSubscriptionCallable; @@ -326,30 +345,32 @@ protected GrpcSubscriberStub( .setMethodDescriptor(createSubscriptionMethodDescriptor) .setParamsExtractor( request -> { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("name", String.valueOf(request.getName())); - return params.build(); + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); }) + .setResourceNameExtractor(request -> request.getName()) .build(); GrpcCallSettings getSubscriptionTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(getSubscriptionMethodDescriptor) .setParamsExtractor( request -> { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("subscription", String.valueOf(request.getSubscription())); - return params.build(); + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("subscription", String.valueOf(request.getSubscription())); + return builder.build(); }) + .setResourceNameExtractor(request -> request.getSubscription()) .build(); GrpcCallSettings updateSubscriptionTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(updateSubscriptionMethodDescriptor) .setParamsExtractor( request -> { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put( + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add( "subscription.name", String.valueOf(request.getSubscription().getName())); - return params.build(); + return builder.build(); }) .build(); GrpcCallSettings @@ -358,103 +379,113 @@ protected GrpcSubscriberStub( .setMethodDescriptor(listSubscriptionsMethodDescriptor) .setParamsExtractor( request -> { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("project", String.valueOf(request.getProject())); - return params.build(); + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("project", String.valueOf(request.getProject())); + return builder.build(); }) + .setResourceNameExtractor(request -> request.getProject()) .build(); GrpcCallSettings deleteSubscriptionTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(deleteSubscriptionMethodDescriptor) .setParamsExtractor( request -> { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("subscription", String.valueOf(request.getSubscription())); - return params.build(); + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("subscription", String.valueOf(request.getSubscription())); + return builder.build(); }) + .setResourceNameExtractor(request -> request.getSubscription()) .build(); GrpcCallSettings modifyAckDeadlineTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(modifyAckDeadlineMethodDescriptor) .setParamsExtractor( request -> { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("subscription", String.valueOf(request.getSubscription())); - return params.build(); + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("subscription", String.valueOf(request.getSubscription())); + return builder.build(); }) + .setResourceNameExtractor(request -> request.getSubscription()) .build(); GrpcCallSettings acknowledgeTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(acknowledgeMethodDescriptor) .setParamsExtractor( request -> { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("subscription", String.valueOf(request.getSubscription())); - return params.build(); + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("subscription", String.valueOf(request.getSubscription())); + return builder.build(); }) + .setResourceNameExtractor(request -> request.getSubscription()) .build(); GrpcCallSettings pullTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(pullMethodDescriptor) .setParamsExtractor( request -> { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("subscription", String.valueOf(request.getSubscription())); - return params.build(); + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("subscription", String.valueOf(request.getSubscription())); + return builder.build(); }) + .setResourceNameExtractor(request -> request.getSubscription()) .build(); GrpcCallSettings streamingPullTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(streamingPullMethodDescriptor) + .setResourceNameExtractor(request -> request.getSubscription()) .build(); GrpcCallSettings modifyPushConfigTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(modifyPushConfigMethodDescriptor) .setParamsExtractor( request -> { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("subscription", String.valueOf(request.getSubscription())); - return params.build(); + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("subscription", String.valueOf(request.getSubscription())); + return builder.build(); }) + .setResourceNameExtractor(request -> request.getSubscription()) .build(); GrpcCallSettings getSnapshotTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(getSnapshotMethodDescriptor) .setParamsExtractor( request -> { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("snapshot", String.valueOf(request.getSnapshot())); - return params.build(); + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("snapshot", String.valueOf(request.getSnapshot())); + return builder.build(); }) + .setResourceNameExtractor(request -> request.getSnapshot()) .build(); GrpcCallSettings listSnapshotsTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(listSnapshotsMethodDescriptor) .setParamsExtractor( request -> { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("project", String.valueOf(request.getProject())); - return params.build(); + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("project", String.valueOf(request.getProject())); + return builder.build(); }) + .setResourceNameExtractor(request -> request.getProject()) .build(); GrpcCallSettings createSnapshotTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(createSnapshotMethodDescriptor) .setParamsExtractor( request -> { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("name", String.valueOf(request.getName())); - return params.build(); + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); }) + .setResourceNameExtractor(request -> request.getName()) .build(); GrpcCallSettings updateSnapshotTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(updateSnapshotMethodDescriptor) .setParamsExtractor( request -> { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("snapshot.name", String.valueOf(request.getSnapshot().getName())); - return params.build(); + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("snapshot.name", String.valueOf(request.getSnapshot().getName())); + return builder.build(); }) .build(); GrpcCallSettings deleteSnapshotTransportSettings = @@ -462,40 +493,44 @@ protected GrpcSubscriberStub( .setMethodDescriptor(deleteSnapshotMethodDescriptor) .setParamsExtractor( request -> { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("snapshot", String.valueOf(request.getSnapshot())); - return params.build(); + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("snapshot", String.valueOf(request.getSnapshot())); + return builder.build(); }) + .setResourceNameExtractor(request -> request.getSnapshot()) .build(); GrpcCallSettings seekTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(seekMethodDescriptor) .setParamsExtractor( request -> { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("subscription", String.valueOf(request.getSubscription())); - return params.build(); + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("subscription", String.valueOf(request.getSubscription())); + return builder.build(); }) + .setResourceNameExtractor(request -> request.getSubscription()) .build(); GrpcCallSettings setIamPolicyTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(setIamPolicyMethodDescriptor) .setParamsExtractor( request -> { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("resource", String.valueOf(request.getResource())); - return params.build(); + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("resource", String.valueOf(request.getResource())); + return builder.build(); }) + .setResourceNameExtractor(request -> request.getResource()) .build(); GrpcCallSettings getIamPolicyTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(getIamPolicyMethodDescriptor) .setParamsExtractor( request -> { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("resource", String.valueOf(request.getResource())); - return params.build(); + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("resource", String.valueOf(request.getResource())); + return builder.build(); }) + .setResourceNameExtractor(request -> request.getResource()) .build(); GrpcCallSettings testIamPermissionsTransportSettings = @@ -503,10 +538,11 @@ protected GrpcSubscriberStub( .setMethodDescriptor(testIamPermissionsMethodDescriptor) .setParamsExtractor( request -> { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("resource", String.valueOf(request.getResource())); - return params.build(); + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("resource", String.valueOf(request.getResource())); + return builder.build(); }) + .setResourceNameExtractor(request -> request.getResource()) .build(); this.createSubscriptionCallable = diff --git a/test/integration/goldens/pubsub/src/com/google/cloud/pubsub/v1/stub/PublisherStub.java b/test/integration/goldens/pubsub/src/com/google/cloud/pubsub/v1/stub/PublisherStub.java index c26fe479c0..5c7f9d6a89 100644 --- a/test/integration/goldens/pubsub/src/com/google/cloud/pubsub/v1/stub/PublisherStub.java +++ b/test/integration/goldens/pubsub/src/com/google/cloud/pubsub/v1/stub/PublisherStub.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/pubsub/src/com/google/cloud/pubsub/v1/stub/PublisherStubSettings.java b/test/integration/goldens/pubsub/src/com/google/cloud/pubsub/v1/stub/PublisherStubSettings.java index 324a0a74f5..067d40923a 100644 --- a/test/integration/goldens/pubsub/src/com/google/cloud/pubsub/v1/stub/PublisherStubSettings.java +++ b/test/integration/goldens/pubsub/src/com/google/cloud/pubsub/v1/stub/PublisherStubSettings.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -22,7 +22,7 @@ import com.google.api.core.ApiFunction; import com.google.api.core.ApiFuture; -import com.google.api.core.BetaApi; +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; @@ -41,6 +41,7 @@ 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.LibraryMetadata; import com.google.api.gax.rpc.PageContext; import com.google.api.gax.rpc.PagedCallSettings; import com.google.api.gax.rpc.PagedListDescriptor; @@ -75,11 +76,11 @@ import com.google.pubsub.v1.Topic; import com.google.pubsub.v1.UpdateTopicRequest; import java.io.IOException; +import java.time.Duration; import java.util.ArrayList; import java.util.Collection; import java.util.List; import javax.annotation.Generated; -import org.threeten.bp.Duration; // AUTO-GENERATED DOCUMENTATION AND CLASS. /** @@ -96,7 +97,9 @@ *

        The builder of this class is recursive, so contained classes are themselves builders. When * build() is called, the tree of builders is called to create the complete settings object. * - *

        For example, to set the total timeout of createTopic to 30 seconds: + *

        For example, to set the + * [RetrySettings](https://cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.retrying.RetrySettings) + * of createTopic: * *

        {@code
          * // This snippet has been automatically generated and should be regarded as a code template only.
        @@ -112,12 +115,24 @@
          *             .createTopicSettings()
          *             .getRetrySettings()
          *             .toBuilder()
        - *             .setTotalTimeout(Duration.ofSeconds(30))
        + *             .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());
          * PublisherStubSettings topicAdminSettings = topicAdminSettingsBuilder.build();
          * }
        + * + * Please refer to the [Client Side Retry + * Guide](https://docs.cloud.google.com/java/docs/client-retries) for additional support in setting + * retries. */ @Generated("by gapic-generator-java") +@SuppressWarnings("CanonicalDuration") public class PublisherStubSettings extends StubSettings { /** The default scopes of the service. */ private static final ImmutableList DEFAULT_SERVICE_SCOPES = @@ -178,9 +193,7 @@ public String extractNextToken(ListTopicsResponse payload) { @Override public Iterable extractResources(ListTopicsResponse payload) { - return payload.getTopicsList() == null - ? ImmutableList.of() - : payload.getTopicsList(); + return payload.getTopicsList(); } }; @@ -220,9 +233,7 @@ public String extractNextToken(ListTopicSubscriptionsResponse payload) { @Override public Iterable extractResources(ListTopicSubscriptionsResponse payload) { - return payload.getSubscriptionsList() == null - ? ImmutableList.of() - : payload.getSubscriptionsList(); + return payload.getSubscriptionsList(); } }; @@ -259,9 +270,7 @@ public String extractNextToken(ListTopicSnapshotsResponse payload) { @Override public Iterable extractResources(ListTopicSnapshotsResponse payload) { - return payload.getSnapshotsList() == null - ? ImmutableList.of() - : payload.getSnapshotsList(); + return payload.getSnapshotsList(); } }; @@ -472,12 +481,19 @@ public PublisherStub createStub() throws IOException { "Transport not supported: %s", getTransportChannelProvider().getTransportName())); } + /** Returns the default service name. */ + @Override + public String getServiceName() { + return "pubsub"; + } + /** 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 "pubsub.googleapis.com:443"; } @@ -509,7 +525,6 @@ public static TransportChannelProvider defaultTransportChannelProvider() { return defaultGrpcTransportProviderBuilder().build(); } - @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { return ApiClientHeaderProvider.newBuilder() .setGeneratedLibToken("gapic", GaxProperties.getLibraryVersion(PublisherStubSettings.class)) @@ -549,6 +564,11 @@ protected PublisherStubSettings(Builder settingsBuilder) throws IOException { testIamPermissionsSettings = settingsBuilder.testIamPermissionsSettings().build(); } + @Override + protected LibraryMetadata getLibraryMetadata() { + return LibraryMetadata.newBuilder().setVersion(Version.VERSION).build(); + } + /** Builder for PublisherStubSettings. */ public static class Builder extends StubSettings.Builder { private final ImmutableList> unaryMethodSettingsBuilders; @@ -609,35 +629,35 @@ public static class Builder extends StubSettings.Builder listSchemasCallabl throw new UnsupportedOperationException("Not implemented: listSchemasCallable()"); } + public UnaryCallable + listSchemaRevisionsPagedCallable() { + throw new UnsupportedOperationException("Not implemented: listSchemaRevisionsPagedCallable()"); + } + + public UnaryCallable + listSchemaRevisionsCallable() { + throw new UnsupportedOperationException("Not implemented: listSchemaRevisionsCallable()"); + } + + public UnaryCallable commitSchemaCallable() { + throw new UnsupportedOperationException("Not implemented: commitSchemaCallable()"); + } + + public UnaryCallable rollbackSchemaCallable() { + throw new UnsupportedOperationException("Not implemented: rollbackSchemaCallable()"); + } + + public UnaryCallable deleteSchemaRevisionCallable() { + throw new UnsupportedOperationException("Not implemented: deleteSchemaRevisionCallable()"); + } + public UnaryCallable deleteSchemaCallable() { throw new UnsupportedOperationException("Not implemented: deleteSchemaCallable()"); } diff --git a/test/integration/goldens/pubsub/src/com/google/cloud/pubsub/v1/stub/SchemaServiceStubSettings.java b/test/integration/goldens/pubsub/src/com/google/cloud/pubsub/v1/stub/SchemaServiceStubSettings.java index 1b553be281..6feb16de0c 100644 --- a/test/integration/goldens/pubsub/src/com/google/cloud/pubsub/v1/stub/SchemaServiceStubSettings.java +++ b/test/integration/goldens/pubsub/src/com/google/cloud/pubsub/v1/stub/SchemaServiceStubSettings.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,11 +16,12 @@ package com.google.cloud.pubsub.v1.stub; +import static com.google.cloud.pubsub.v1.SchemaServiceClient.ListSchemaRevisionsPagedResponse; import static com.google.cloud.pubsub.v1.SchemaServiceClient.ListSchemasPagedResponse; import com.google.api.core.ApiFunction; import com.google.api.core.ApiFuture; -import com.google.api.core.BetaApi; +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; @@ -31,6 +32,7 @@ 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.LibraryMetadata; import com.google.api.gax.rpc.PageContext; import com.google.api.gax.rpc.PagedCallSettings; import com.google.api.gax.rpc.PagedListDescriptor; @@ -50,11 +52,16 @@ import com.google.iam.v1.TestIamPermissionsRequest; import com.google.iam.v1.TestIamPermissionsResponse; import com.google.protobuf.Empty; +import com.google.pubsub.v1.CommitSchemaRequest; import com.google.pubsub.v1.CreateSchemaRequest; import com.google.pubsub.v1.DeleteSchemaRequest; +import com.google.pubsub.v1.DeleteSchemaRevisionRequest; import com.google.pubsub.v1.GetSchemaRequest; +import com.google.pubsub.v1.ListSchemaRevisionsRequest; +import com.google.pubsub.v1.ListSchemaRevisionsResponse; import com.google.pubsub.v1.ListSchemasRequest; import com.google.pubsub.v1.ListSchemasResponse; +import com.google.pubsub.v1.RollbackSchemaRequest; import com.google.pubsub.v1.Schema; import com.google.pubsub.v1.ValidateMessageRequest; import com.google.pubsub.v1.ValidateMessageResponse; @@ -79,7 +86,9 @@ *

        The builder of this class is recursive, so contained classes are themselves builders. When * build() is called, the tree of builders is called to create the complete settings object. * - *

        For example, to set the total timeout of createSchema to 30 seconds: + *

        For example, to set the + * [RetrySettings](https://cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.retrying.RetrySettings) + * of createSchema: * *

        {@code
          * // This snippet has been automatically generated and should be regarded as a code template only.
        @@ -96,12 +105,24 @@
          *             .createSchemaSettings()
          *             .getRetrySettings()
          *             .toBuilder()
        - *             .setTotalTimeout(Duration.ofSeconds(30))
        + *             .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());
          * SchemaServiceStubSettings schemaServiceSettings = schemaServiceSettingsBuilder.build();
          * }
        + * + * Please refer to the [Client Side Retry + * Guide](https://docs.cloud.google.com/java/docs/client-retries) for additional support in setting + * retries. */ @Generated("by gapic-generator-java") +@SuppressWarnings("CanonicalDuration") public class SchemaServiceStubSettings extends StubSettings { /** The default scopes of the service. */ private static final ImmutableList DEFAULT_SERVICE_SCOPES = @@ -114,6 +135,12 @@ public class SchemaServiceStubSettings extends StubSettings getSchemaSettings; private final PagedCallSettings listSchemasSettings; + private final PagedCallSettings< + ListSchemaRevisionsRequest, ListSchemaRevisionsResponse, ListSchemaRevisionsPagedResponse> + listSchemaRevisionsSettings; + private final UnaryCallSettings commitSchemaSettings; + private final UnaryCallSettings rollbackSchemaSettings; + private final UnaryCallSettings deleteSchemaRevisionSettings; private final UnaryCallSettings deleteSchemaSettings; private final UnaryCallSettings validateSchemaSettings; @@ -154,9 +181,45 @@ public String extractNextToken(ListSchemasResponse payload) { @Override public Iterable extractResources(ListSchemasResponse payload) { - return payload.getSchemasList() == null - ? ImmutableList.of() - : payload.getSchemasList(); + return payload.getSchemasList(); + } + }; + + private static final PagedListDescriptor< + ListSchemaRevisionsRequest, ListSchemaRevisionsResponse, Schema> + LIST_SCHEMA_REVISIONS_PAGE_STR_DESC = + new PagedListDescriptor< + ListSchemaRevisionsRequest, ListSchemaRevisionsResponse, Schema>() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public ListSchemaRevisionsRequest injectToken( + ListSchemaRevisionsRequest payload, String token) { + return ListSchemaRevisionsRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public ListSchemaRevisionsRequest injectPageSize( + ListSchemaRevisionsRequest payload, int pageSize) { + return ListSchemaRevisionsRequest.newBuilder(payload).setPageSize(pageSize).build(); + } + + @Override + public Integer extractPageSize(ListSchemaRevisionsRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(ListSchemaRevisionsResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources(ListSchemaRevisionsResponse payload) { + return payload.getSchemasList(); } }; @@ -177,6 +240,27 @@ public ApiFuture getFuturePagedResponse( } }; + private static final PagedListResponseFactory< + ListSchemaRevisionsRequest, ListSchemaRevisionsResponse, ListSchemaRevisionsPagedResponse> + LIST_SCHEMA_REVISIONS_PAGE_STR_FACT = + new PagedListResponseFactory< + ListSchemaRevisionsRequest, + ListSchemaRevisionsResponse, + ListSchemaRevisionsPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListSchemaRevisionsRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext + pageContext = + PageContext.create( + callable, LIST_SCHEMA_REVISIONS_PAGE_STR_DESC, request, context); + return ListSchemaRevisionsPagedResponse.createAsync(pageContext, futureResponse); + } + }; + /** Returns the object with the settings used for calls to createSchema. */ public UnaryCallSettings createSchemaSettings() { return createSchemaSettings; @@ -193,6 +277,28 @@ public UnaryCallSettings getSchemaSettings() { return listSchemasSettings; } + /** Returns the object with the settings used for calls to listSchemaRevisions. */ + public PagedCallSettings< + ListSchemaRevisionsRequest, ListSchemaRevisionsResponse, ListSchemaRevisionsPagedResponse> + listSchemaRevisionsSettings() { + return listSchemaRevisionsSettings; + } + + /** Returns the object with the settings used for calls to commitSchema. */ + public UnaryCallSettings commitSchemaSettings() { + return commitSchemaSettings; + } + + /** Returns the object with the settings used for calls to rollbackSchema. */ + public UnaryCallSettings rollbackSchemaSettings() { + return rollbackSchemaSettings; + } + + /** Returns the object with the settings used for calls to deleteSchemaRevision. */ + public UnaryCallSettings deleteSchemaRevisionSettings() { + return deleteSchemaRevisionSettings; + } + /** Returns the object with the settings used for calls to deleteSchema. */ public UnaryCallSettings deleteSchemaSettings() { return deleteSchemaSettings; @@ -236,12 +342,19 @@ public SchemaServiceStub createStub() throws IOException { "Transport not supported: %s", getTransportChannelProvider().getTransportName())); } + /** Returns the default service name. */ + @Override + public String getServiceName() { + return "pubsub"; + } + /** 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 "pubsub.googleapis.com:443"; } @@ -273,7 +386,6 @@ public static TransportChannelProvider defaultTransportChannelProvider() { return defaultGrpcTransportProviderBuilder().build(); } - @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { return ApiClientHeaderProvider.newBuilder() .setGeneratedLibToken( @@ -303,6 +415,10 @@ protected SchemaServiceStubSettings(Builder settingsBuilder) throws IOException createSchemaSettings = settingsBuilder.createSchemaSettings().build(); getSchemaSettings = settingsBuilder.getSchemaSettings().build(); listSchemasSettings = settingsBuilder.listSchemasSettings().build(); + listSchemaRevisionsSettings = settingsBuilder.listSchemaRevisionsSettings().build(); + commitSchemaSettings = settingsBuilder.commitSchemaSettings().build(); + rollbackSchemaSettings = settingsBuilder.rollbackSchemaSettings().build(); + deleteSchemaRevisionSettings = settingsBuilder.deleteSchemaRevisionSettings().build(); deleteSchemaSettings = settingsBuilder.deleteSchemaSettings().build(); validateSchemaSettings = settingsBuilder.validateSchemaSettings().build(); validateMessageSettings = settingsBuilder.validateMessageSettings().build(); @@ -311,6 +427,11 @@ protected SchemaServiceStubSettings(Builder settingsBuilder) throws IOException testIamPermissionsSettings = settingsBuilder.testIamPermissionsSettings().build(); } + @Override + protected LibraryMetadata getLibraryMetadata() { + return LibraryMetadata.newBuilder().setVersion(Version.VERSION).build(); + } + /** Builder for SchemaServiceStubSettings. */ public static class Builder extends StubSettings.Builder { private final ImmutableList> unaryMethodSettingsBuilders; @@ -319,6 +440,15 @@ public static class Builder extends StubSettings.Builder listSchemasSettings; + private final PagedCallSettings.Builder< + ListSchemaRevisionsRequest, + ListSchemaRevisionsResponse, + ListSchemaRevisionsPagedResponse> + listSchemaRevisionsSettings; + private final UnaryCallSettings.Builder commitSchemaSettings; + private final UnaryCallSettings.Builder rollbackSchemaSettings; + private final UnaryCallSettings.Builder + deleteSchemaRevisionSettings; private final UnaryCallSettings.Builder deleteSchemaSettings; private final UnaryCallSettings.Builder validateSchemaSettings; @@ -358,6 +488,11 @@ protected Builder(ClientContext clientContext) { createSchemaSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); getSchemaSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); listSchemasSettings = PagedCallSettings.newBuilder(LIST_SCHEMAS_PAGE_STR_FACT); + listSchemaRevisionsSettings = + PagedCallSettings.newBuilder(LIST_SCHEMA_REVISIONS_PAGE_STR_FACT); + commitSchemaSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + rollbackSchemaSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + deleteSchemaRevisionSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); deleteSchemaSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); validateSchemaSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); validateMessageSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); @@ -370,6 +505,10 @@ protected Builder(ClientContext clientContext) { createSchemaSettings, getSchemaSettings, listSchemasSettings, + listSchemaRevisionsSettings, + commitSchemaSettings, + rollbackSchemaSettings, + deleteSchemaRevisionSettings, deleteSchemaSettings, validateSchemaSettings, validateMessageSettings, @@ -385,6 +524,10 @@ protected Builder(SchemaServiceStubSettings settings) { createSchemaSettings = settings.createSchemaSettings.toBuilder(); getSchemaSettings = settings.getSchemaSettings.toBuilder(); listSchemasSettings = settings.listSchemasSettings.toBuilder(); + listSchemaRevisionsSettings = settings.listSchemaRevisionsSettings.toBuilder(); + commitSchemaSettings = settings.commitSchemaSettings.toBuilder(); + rollbackSchemaSettings = settings.rollbackSchemaSettings.toBuilder(); + deleteSchemaRevisionSettings = settings.deleteSchemaRevisionSettings.toBuilder(); deleteSchemaSettings = settings.deleteSchemaSettings.toBuilder(); validateSchemaSettings = settings.validateSchemaSettings.toBuilder(); validateMessageSettings = settings.validateMessageSettings.toBuilder(); @@ -397,6 +540,10 @@ protected Builder(SchemaServiceStubSettings settings) { createSchemaSettings, getSchemaSettings, listSchemasSettings, + listSchemaRevisionsSettings, + commitSchemaSettings, + rollbackSchemaSettings, + deleteSchemaRevisionSettings, deleteSchemaSettings, validateSchemaSettings, validateMessageSettings, @@ -411,7 +558,6 @@ private static Builder createDefault() { builder.setTransportChannelProvider(defaultTransportChannelProvider()); builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); builder.setInternalHeaderProvider(defaultApiClientHeaderProviderBuilder().build()); - builder.setEndpoint(getDefaultEndpoint()); builder.setMtlsEndpoint(getDefaultMtlsEndpoint()); builder.setSwitchToMtlsEndpointAllowed(true); @@ -434,6 +580,26 @@ private static Builder initDefaults(Builder builder) { .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + builder + .listSchemaRevisionsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .commitSchemaSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .rollbackSchemaSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .deleteSchemaRevisionSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + builder .deleteSchemaSettings() .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) @@ -499,6 +665,31 @@ public UnaryCallSettings.Builder getSchemaSettings() { return listSchemasSettings; } + /** Returns the builder for the settings used for calls to listSchemaRevisions. */ + public PagedCallSettings.Builder< + ListSchemaRevisionsRequest, + ListSchemaRevisionsResponse, + ListSchemaRevisionsPagedResponse> + listSchemaRevisionsSettings() { + return listSchemaRevisionsSettings; + } + + /** Returns the builder for the settings used for calls to commitSchema. */ + public UnaryCallSettings.Builder commitSchemaSettings() { + return commitSchemaSettings; + } + + /** Returns the builder for the settings used for calls to rollbackSchema. */ + public UnaryCallSettings.Builder rollbackSchemaSettings() { + return rollbackSchemaSettings; + } + + /** Returns the builder for the settings used for calls to deleteSchemaRevision. */ + public UnaryCallSettings.Builder + deleteSchemaRevisionSettings() { + return deleteSchemaRevisionSettings; + } + /** Returns the builder for the settings used for calls to deleteSchema. */ public UnaryCallSettings.Builder deleteSchemaSettings() { return deleteSchemaSettings; diff --git a/test/integration/goldens/pubsub/src/com/google/cloud/pubsub/v1/stub/SubscriberStub.java b/test/integration/goldens/pubsub/src/com/google/cloud/pubsub/v1/stub/SubscriberStub.java index 8eeab5261a..115a2f2c82 100644 --- a/test/integration/goldens/pubsub/src/com/google/cloud/pubsub/v1/stub/SubscriberStub.java +++ b/test/integration/goldens/pubsub/src/com/google/cloud/pubsub/v1/stub/SubscriberStub.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/pubsub/src/com/google/cloud/pubsub/v1/stub/SubscriberStubSettings.java b/test/integration/goldens/pubsub/src/com/google/cloud/pubsub/v1/stub/SubscriberStubSettings.java index 4c427e5030..4e1bcbc259 100644 --- a/test/integration/goldens/pubsub/src/com/google/cloud/pubsub/v1/stub/SubscriberStubSettings.java +++ b/test/integration/goldens/pubsub/src/com/google/cloud/pubsub/v1/stub/SubscriberStubSettings.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -21,7 +21,7 @@ import com.google.api.core.ApiFunction; import com.google.api.core.ApiFuture; -import com.google.api.core.BetaApi; +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; @@ -32,6 +32,7 @@ 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.LibraryMetadata; import com.google.api.gax.rpc.PageContext; import com.google.api.gax.rpc.PagedCallSettings; import com.google.api.gax.rpc.PagedListDescriptor; @@ -75,9 +76,9 @@ import com.google.pubsub.v1.UpdateSnapshotRequest; import com.google.pubsub.v1.UpdateSubscriptionRequest; import java.io.IOException; +import java.time.Duration; import java.util.List; import javax.annotation.Generated; -import org.threeten.bp.Duration; // AUTO-GENERATED DOCUMENTATION AND CLASS. /** @@ -94,7 +95,9 @@ *

        The builder of this class is recursive, so contained classes are themselves builders. When * build() is called, the tree of builders is called to create the complete settings object. * - *

        For example, to set the total timeout of createSubscription to 30 seconds: + *

        For example, to set the + * [RetrySettings](https://cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.retrying.RetrySettings) + * of createSubscription: * *

        {@code
          * // This snippet has been automatically generated and should be regarded as a code template only.
        @@ -111,12 +114,24 @@
          *             .createSubscriptionSettings()
          *             .getRetrySettings()
          *             .toBuilder()
        - *             .setTotalTimeout(Duration.ofSeconds(30))
        + *             .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());
          * SubscriberStubSettings subscriptionAdminSettings = subscriptionAdminSettingsBuilder.build();
          * }
        + * + * Please refer to the [Client Side Retry + * Guide](https://docs.cloud.google.com/java/docs/client-retries) for additional support in setting + * retries. */ @Generated("by gapic-generator-java") +@SuppressWarnings("CanonicalDuration") public class SubscriberStubSettings extends StubSettings { /** The default scopes of the service. */ private static final ImmutableList DEFAULT_SERVICE_SCOPES = @@ -186,9 +201,7 @@ public String extractNextToken(ListSubscriptionsResponse payload) { @Override public Iterable extractResources(ListSubscriptionsResponse payload) { - return payload.getSubscriptionsList() == null - ? ImmutableList.of() - : payload.getSubscriptionsList(); + return payload.getSubscriptionsList(); } }; @@ -222,9 +235,7 @@ public String extractNextToken(ListSnapshotsResponse payload) { @Override public Iterable extractResources(ListSnapshotsResponse payload) { - return payload.getSnapshotsList() == null - ? ImmutableList.of() - : payload.getSnapshotsList(); + return payload.getSnapshotsList(); } }; @@ -377,12 +388,19 @@ public SubscriberStub createStub() throws IOException { "Transport not supported: %s", getTransportChannelProvider().getTransportName())); } + /** Returns the default service name. */ + @Override + public String getServiceName() { + return "pubsub"; + } + /** 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 "pubsub.googleapis.com:443"; } @@ -414,7 +432,6 @@ public static TransportChannelProvider defaultTransportChannelProvider() { return defaultGrpcTransportProviderBuilder().build(); } - @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { return ApiClientHeaderProvider.newBuilder() .setGeneratedLibToken( @@ -462,6 +479,11 @@ protected SubscriberStubSettings(Builder settingsBuilder) throws IOException { testIamPermissionsSettings = settingsBuilder.testIamPermissionsSettings().build(); } + @Override + protected LibraryMetadata getLibraryMetadata() { + return LibraryMetadata.newBuilder().setVersion(Version.VERSION).build(); + } + /** Builder for SubscriberStubSettings. */ public static class Builder extends StubSettings.Builder { private final ImmutableList> unaryMethodSettingsBuilders; @@ -528,35 +550,35 @@ public static class Builder extends StubSettings.BuilderNote: close() needs to be called on the CloudRedisClient object to clean up resources such as * threads. In the example above, try-with-resources is used, which automatically calls close(). * - *

        The surface of this class includes several types of Java methods for each of the API's - * methods: - * - *

          - *
        1. A "flattened" method. With this type of method, the fields of the request type have been - * converted into function parameters. It may be the case that not all fields are available as - * parameters, and not every API method will have a flattened method entry point. - *
        2. A "request object" method. This type of method only takes one parameter, a request object, - * which must be constructed before the call. Not every API method will have a request object - * method. - *
        3. A "callable" method. This type of method takes no parameters and returns an immutable API - * callable object, which can be used to initiate calls to the service. - *
        + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + *
        Methods
        MethodDescriptionMethod Variants

        ListInstances

        Lists all Redis instances owned by a project in either the specified location (region) or all locations. + *

        The location should have the following format: + *

          + *
        • `projects/{project_id}/locations/{location_id}` + *
        + *

        If `location_id` is specified as `-` (wildcard), then all regions available to the project are queried, and the results are aggregated.

        + *

        Request object method variants only take one parameter, a request object, which must be constructed before the call.

        + *
          + *
        • listInstances(ListInstancesRequest request) + *

        + *

        "Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

        + *
          + *
        • listInstances(LocationName parent) + *

        • listInstances(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.

        + *
          + *
        • listInstancesPagedCallable() + *

        • listInstancesCallable() + *

        + *

        GetInstance

        Gets the details of a specific Redis instance.

        + *

        Request object method variants only take one parameter, a request object, which must be constructed before the call.

        + *
          + *
        • getInstance(GetInstanceRequest request) + *

        + *

        "Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

        + *
          + *
        • getInstance(InstanceName name) + *

        • getInstance(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.

        + *
          + *
        • getInstanceCallable() + *

        + *

        GetInstanceAuthString

        Gets the AUTH string for a Redis instance. If AUTH is not enabled for the instance the response will be empty. This information is not included in the details returned to GetInstance.

        + *

        Request object method variants only take one parameter, a request object, which must be constructed before the call.

        + *
          + *
        • getInstanceAuthString(GetInstanceAuthStringRequest request) + *

        + *

        "Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

        + *
          + *
        • getInstanceAuthString(InstanceName name) + *

        • getInstanceAuthString(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.

        + *
          + *
        • getInstanceAuthStringCallable() + *

        + *

        CreateInstance

        Creates a Redis instance based on the specified tier and memory size. + *

        By default, the instance is accessible from the project's [default network](https://cloud.google.com/vpc/docs/vpc). + *

        The creation is executed asynchronously and callers may check the returned operation to track its progress. Once the operation is completed the Redis instance will be fully functional. The completed longrunning.Operation will contain the new instance object in the response field. + *

        The returned operation is automatically deleted after a few hours, so there is no need to call DeleteOperation.

        + *

        Request object method variants only take one parameter, a request object, which must be constructed before the call.

        + *
          + *
        • createInstanceAsync(CreateInstanceRequest request) + *

        + *

        Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.

        + *
          + *
        • createInstanceAsync(LocationName parent, String instanceId, Instance instance) + *

        • createInstanceAsync(String parent, String instanceId, Instance instance) + *

        + *

        Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

        + *
          + *
        • createInstanceOperationCallable() + *

        • createInstanceCallable() + *

        + *

        UpdateInstance

        Updates the metadata and configuration of a specific Redis instance. + *

        Completed longrunning.Operation will contain the new instance object in the response field. The returned operation is automatically deleted after a few hours, so there is no need to call DeleteOperation.

        + *

        Request object method variants only take one parameter, a request object, which must be constructed before the call.

        + *
          + *
        • updateInstanceAsync(UpdateInstanceRequest request) + *

        + *

        Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.

        + *
          + *
        • updateInstanceAsync(FieldMask updateMask, Instance instance) + *

        + *

        Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

        + *
          + *
        • updateInstanceOperationCallable() + *

        • updateInstanceCallable() + *

        + *

        UpgradeInstance

        Upgrades Redis instance to the newer Redis version specified in the request.

        + *

        Request object method variants only take one parameter, a request object, which must be constructed before the call.

        + *
          + *
        • upgradeInstanceAsync(UpgradeInstanceRequest request) + *

        + *

        Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.

        + *
          + *
        • upgradeInstanceAsync(InstanceName name, String redisVersion) + *

        • upgradeInstanceAsync(String name, String redisVersion) + *

        + *

        Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

        + *
          + *
        • upgradeInstanceOperationCallable() + *

        • upgradeInstanceCallable() + *

        + *

        ImportInstance

        Import a Redis RDB snapshot file from Cloud Storage into a Redis instance. + *

        Redis may stop serving during this operation. Instance state will be IMPORTING for entire operation. When complete, the instance will contain only data from the imported file. + *

        The returned operation is automatically deleted after a few hours, so there is no need to call DeleteOperation.

        + *

        Request object method variants only take one parameter, a request object, which must be constructed before the call.

        + *
          + *
        • importInstanceAsync(ImportInstanceRequest request) + *

        + *

        Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.

        + *
          + *
        • importInstanceAsync(String name, InputConfig inputConfig) + *

        + *

        Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

        + *
          + *
        • importInstanceOperationCallable() + *

        • importInstanceCallable() + *

        + *

        ExportInstance

        Export Redis instance data into a Redis RDB format file in Cloud Storage. + *

        Redis will continue serving during this operation. + *

        The returned operation is automatically deleted after a few hours, so there is no need to call DeleteOperation.

        + *

        Request object method variants only take one parameter, a request object, which must be constructed before the call.

        + *
          + *
        • exportInstanceAsync(ExportInstanceRequest request) + *

        + *

        Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.

        + *
          + *
        • exportInstanceAsync(String name, OutputConfig outputConfig) + *

        + *

        Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

        + *
          + *
        • exportInstanceOperationCallable() + *

        • exportInstanceCallable() + *

        + *

        FailoverInstance

        Initiates a failover of the primary node to current replica node for a specific STANDARD tier Cloud Memorystore for Redis instance.

        + *

        Request object method variants only take one parameter, a request object, which must be constructed before the call.

        + *
          + *
        • failoverInstanceAsync(FailoverInstanceRequest request) + *

        + *

        Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.

        + *
          + *
        • failoverInstanceAsync(InstanceName name, FailoverInstanceRequest.DataProtectionMode dataProtectionMode) + *

        • failoverInstanceAsync(String name, FailoverInstanceRequest.DataProtectionMode dataProtectionMode) + *

        + *

        Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

        + *
          + *
        • failoverInstanceOperationCallable() + *

        • failoverInstanceCallable() + *

        + *

        DeleteInstance

        Deletes a specific Redis instance. Instance stops serving and data is deleted.

        + *

        Request object method variants only take one parameter, a request object, which must be constructed before the call.

        + *
          + *
        • deleteInstanceAsync(DeleteInstanceRequest request) + *

        + *

        Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.

        + *
          + *
        • deleteInstanceAsync(InstanceName name) + *

        • deleteInstanceAsync(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.

        + *
          + *
        • deleteInstanceOperationCallable() + *

        • deleteInstanceCallable() + *

        + *

        RescheduleMaintenance

        Reschedule maintenance for a given instance in a given project and location.

        + *

        Request object method variants only take one parameter, a request object, which must be constructed before the call.

        + *
          + *
        • rescheduleMaintenanceAsync(RescheduleMaintenanceRequest request) + *

        + *

        Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.

        + *
          + *
        • rescheduleMaintenanceAsync(InstanceName name, RescheduleMaintenanceRequest.RescheduleType rescheduleType, Timestamp scheduleTime) + *

        • rescheduleMaintenanceAsync(String name, RescheduleMaintenanceRequest.RescheduleType rescheduleType, Timestamp scheduleTime) + *

        + *

        Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

        + *
          + *
        • rescheduleMaintenanceOperationCallable() + *

        • rescheduleMaintenanceCallable() + *

        + *
        * *

        See the individual methods for example code. * @@ -133,6 +356,19 @@ * CloudRedisClient cloudRedisClient = CloudRedisClient.create(cloudRedisSettings); * } * + *

        To use REST (HTTP1.1/JSON) transport (instead of gRPC) for sending and receiving requests over + * the wire: + * + *

        {@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
        + * CloudRedisSettings cloudRedisSettings = CloudRedisSettings.newHttpJsonBuilder().build();
        + * CloudRedisClient cloudRedisClient = CloudRedisClient.create(cloudRedisSettings);
        + * }
        + * *

        Please refer to the GitHub repository's samples for more quickstart code snippets. */ @BetaApi @@ -140,7 +376,8 @@ public class CloudRedisClient implements BackgroundResource { private final CloudRedisSettings settings; private final CloudRedisStub stub; - private final OperationsClient operationsClient; + private final OperationsClient httpJsonOperationsClient; + private final com.google.longrunning.OperationsClient operationsClient; /** Constructs an instance of CloudRedisClient with default settings. */ public static final CloudRedisClient create() throws IOException { @@ -170,13 +407,17 @@ public static final CloudRedisClient create(CloudRedisStub stub) { protected CloudRedisClient(CloudRedisSettings settings) throws IOException { this.settings = settings; this.stub = ((CloudRedisStubSettings) settings.getStubSettings()).createStub(); - this.operationsClient = OperationsClient.create(this.stub.getOperationsStub()); + this.operationsClient = + com.google.longrunning.OperationsClient.create(this.stub.getOperationsStub()); + this.httpJsonOperationsClient = OperationsClient.create(this.stub.getHttpJsonOperationsStub()); } protected CloudRedisClient(CloudRedisStub stub) { this.settings = null; this.stub = stub; - this.operationsClient = OperationsClient.create(this.stub.getOperationsStub()); + this.operationsClient = + com.google.longrunning.OperationsClient.create(this.stub.getOperationsStub()); + this.httpJsonOperationsClient = OperationsClient.create(this.stub.getHttpJsonOperationsStub()); } public final CloudRedisSettings getSettings() { @@ -191,10 +432,19 @@ public CloudRedisStub getStub() { * 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() { + public final com.google.longrunning.OperationsClient getOperationsClient() { return operationsClient; } + /** + * Returns the OperationsClient that can be used to query the status of a long-running operation + * returned by another API method call. + */ + @BetaApi + public final OperationsClient getHttpJsonOperationsClient() { + return httpJsonOperationsClient; + } + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Lists all Redis instances owned by a project in either the specified location (region) or all diff --git a/test/integration/goldens/redis/src/com/google/cloud/redis/v1beta1/CloudRedisClientHttpJsonTest.java b/test/integration/goldens/redis/src/com/google/cloud/redis/v1beta1/CloudRedisClientHttpJsonTest.java new file mode 100644 index 0000000000..ca59c6bd14 --- /dev/null +++ b/test/integration/goldens/redis/src/com/google/cloud/redis/v1beta1/CloudRedisClientHttpJsonTest.java @@ -0,0 +1,1406 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS 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.redis.v1beta1; + +import static com.google.cloud.redis.v1beta1.CloudRedisClient.ListInstancesPagedResponse; + +import com.google.api.gax.core.NoCredentialsProvider; +import com.google.api.gax.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.testing.MockHttpService; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ApiException; +import com.google.api.gax.rpc.ApiExceptionFactory; +import com.google.api.gax.rpc.InvalidArgumentException; +import com.google.api.gax.rpc.StatusCode; +import com.google.api.gax.rpc.testing.FakeStatusCode; +import com.google.cloud.redis.v1beta1.stub.HttpJsonCloudRedisStub; +import com.google.common.collect.Lists; +import com.google.longrunning.Operation; +import com.google.protobuf.Any; +import com.google.protobuf.Empty; +import com.google.protobuf.FieldMask; +import com.google.protobuf.Timestamp; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +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 CloudRedisClientHttpJsonTest { + private static MockHttpService mockService; + private static CloudRedisClient client; + + @BeforeClass + public static void startStaticServer() throws IOException { + mockService = + new MockHttpService( + HttpJsonCloudRedisStub.getMethodDescriptors(), CloudRedisSettings.getDefaultEndpoint()); + CloudRedisSettings settings = + CloudRedisSettings.newHttpJsonBuilder() + .setTransportChannelProvider( + CloudRedisSettings.defaultHttpJsonTransportProviderBuilder() + .setHttpTransport(mockService) + .build()) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = CloudRedisClient.create(settings); + } + + @AfterClass + public static void stopServer() { + client.close(); + } + + @Before + public void setUp() {} + + @After + public void tearDown() throws Exception { + mockService.reset(); + } + + @Test + public void listInstancesTest() throws Exception { + Instance responsesElement = Instance.newBuilder().build(); + ListInstancesResponse expectedResponse = + ListInstancesResponse.newBuilder() + .setNextPageToken("") + .addAllInstances(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + + ListInstancesPagedResponse pagedListResponse = client.listInstances(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getInstancesList().get(0), resources.get(0)); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void listInstancesExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + client.listInstances(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listInstancesTest2() throws Exception { + Instance responsesElement = Instance.newBuilder().build(); + ListInstancesResponse expectedResponse = + ListInstancesResponse.newBuilder() + .setNextPageToken("") + .addAllInstances(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + String parent = "projects/project-5833/locations/location-5833"; + + ListInstancesPagedResponse pagedListResponse = client.listInstances(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getInstancesList().get(0), resources.get(0)); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void listInstancesExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String parent = "projects/project-5833/locations/location-5833"; + client.listInstances(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getInstanceTest() throws Exception { + Instance expectedResponse = + Instance.newBuilder() + .setName(InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString()) + .setDisplayName("displayName1714148973") + .putAllLabels(new HashMap()) + .setLocationId("locationId1541836720") + .setAlternativeLocationId("alternativeLocationId1787141949") + .setRedisVersion("redisVersion-1972584739") + .setReservedIpRange("reservedIpRange575015950") + .setSecondaryIpRange("secondaryIpRange-1937131454") + .setHost("host3208616") + .setPort(3446913) + .setCurrentLocationId("currentLocationId-1808505335") + .setCreateTime(Timestamp.newBuilder().build()) + .setStatusMessage("statusMessage-958704715") + .putAllRedisConfigs(new HashMap()) + .setMemorySizeGb(34199707) + .setAuthorizedNetwork("authorizedNetwork1515554835") + .setPersistenceIamIdentity("persistenceIamIdentity1464017428") + .setAuthEnabled(true) + .addAllServerCaCerts(new ArrayList()) + .setMaintenancePolicy(MaintenancePolicy.newBuilder().build()) + .setMaintenanceSchedule(MaintenanceSchedule.newBuilder().build()) + .setReplicaCount(564075208) + .addAllNodes(new ArrayList()) + .setReadEndpoint("readEndpoint294053195") + .setReadEndpointPort(-1676143102) + .setPersistenceConfig(PersistenceConfig.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + InstanceName name = InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]"); + + Instance actualResponse = client.getInstance(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void getInstanceExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + InstanceName name = InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]"); + client.getInstance(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getInstanceTest2() throws Exception { + Instance expectedResponse = + Instance.newBuilder() + .setName(InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString()) + .setDisplayName("displayName1714148973") + .putAllLabels(new HashMap()) + .setLocationId("locationId1541836720") + .setAlternativeLocationId("alternativeLocationId1787141949") + .setRedisVersion("redisVersion-1972584739") + .setReservedIpRange("reservedIpRange575015950") + .setSecondaryIpRange("secondaryIpRange-1937131454") + .setHost("host3208616") + .setPort(3446913) + .setCurrentLocationId("currentLocationId-1808505335") + .setCreateTime(Timestamp.newBuilder().build()) + .setStatusMessage("statusMessage-958704715") + .putAllRedisConfigs(new HashMap()) + .setMemorySizeGb(34199707) + .setAuthorizedNetwork("authorizedNetwork1515554835") + .setPersistenceIamIdentity("persistenceIamIdentity1464017428") + .setAuthEnabled(true) + .addAllServerCaCerts(new ArrayList()) + .setMaintenancePolicy(MaintenancePolicy.newBuilder().build()) + .setMaintenanceSchedule(MaintenanceSchedule.newBuilder().build()) + .setReplicaCount(564075208) + .addAllNodes(new ArrayList()) + .setReadEndpoint("readEndpoint294053195") + .setReadEndpointPort(-1676143102) + .setPersistenceConfig(PersistenceConfig.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + String name = "projects/project-9412/locations/location-9412/instances/instance-9412"; + + Instance actualResponse = client.getInstance(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void getInstanceExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String name = "projects/project-9412/locations/location-9412/instances/instance-9412"; + client.getInstance(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getInstanceAuthStringTest() throws Exception { + InstanceAuthString expectedResponse = + InstanceAuthString.newBuilder().setAuthString("authString1994738649").build(); + mockService.addResponse(expectedResponse); + + InstanceName name = InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]"); + + InstanceAuthString actualResponse = client.getInstanceAuthString(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void getInstanceAuthStringExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + InstanceName name = InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]"); + client.getInstanceAuthString(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getInstanceAuthStringTest2() throws Exception { + InstanceAuthString expectedResponse = + InstanceAuthString.newBuilder().setAuthString("authString1994738649").build(); + mockService.addResponse(expectedResponse); + + String name = "projects/project-9412/locations/location-9412/instances/instance-9412"; + + InstanceAuthString actualResponse = client.getInstanceAuthString(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void getInstanceAuthStringExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String name = "projects/project-9412/locations/location-9412/instances/instance-9412"; + client.getInstanceAuthString(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createInstanceTest() throws Exception { + Instance expectedResponse = + Instance.newBuilder() + .setName(InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString()) + .setDisplayName("displayName1714148973") + .putAllLabels(new HashMap()) + .setLocationId("locationId1541836720") + .setAlternativeLocationId("alternativeLocationId1787141949") + .setRedisVersion("redisVersion-1972584739") + .setReservedIpRange("reservedIpRange575015950") + .setSecondaryIpRange("secondaryIpRange-1937131454") + .setHost("host3208616") + .setPort(3446913) + .setCurrentLocationId("currentLocationId-1808505335") + .setCreateTime(Timestamp.newBuilder().build()) + .setStatusMessage("statusMessage-958704715") + .putAllRedisConfigs(new HashMap()) + .setMemorySizeGb(34199707) + .setAuthorizedNetwork("authorizedNetwork1515554835") + .setPersistenceIamIdentity("persistenceIamIdentity1464017428") + .setAuthEnabled(true) + .addAllServerCaCerts(new ArrayList()) + .setMaintenancePolicy(MaintenancePolicy.newBuilder().build()) + .setMaintenanceSchedule(MaintenanceSchedule.newBuilder().build()) + .setReplicaCount(564075208) + .addAllNodes(new ArrayList()) + .setReadEndpoint("readEndpoint294053195") + .setReadEndpointPort(-1676143102) + .setPersistenceConfig(PersistenceConfig.newBuilder().build()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("createInstanceTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockService.addResponse(resultOperation); + + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + String instanceId = "instanceId902024336"; + Instance instance = Instance.newBuilder().build(); + + Instance actualResponse = client.createInstanceAsync(parent, instanceId, instance).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void createInstanceExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + String instanceId = "instanceId902024336"; + Instance instance = Instance.newBuilder().build(); + client.createInstanceAsync(parent, instanceId, instance).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + } + } + + @Test + public void createInstanceTest2() throws Exception { + Instance expectedResponse = + Instance.newBuilder() + .setName(InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString()) + .setDisplayName("displayName1714148973") + .putAllLabels(new HashMap()) + .setLocationId("locationId1541836720") + .setAlternativeLocationId("alternativeLocationId1787141949") + .setRedisVersion("redisVersion-1972584739") + .setReservedIpRange("reservedIpRange575015950") + .setSecondaryIpRange("secondaryIpRange-1937131454") + .setHost("host3208616") + .setPort(3446913) + .setCurrentLocationId("currentLocationId-1808505335") + .setCreateTime(Timestamp.newBuilder().build()) + .setStatusMessage("statusMessage-958704715") + .putAllRedisConfigs(new HashMap()) + .setMemorySizeGb(34199707) + .setAuthorizedNetwork("authorizedNetwork1515554835") + .setPersistenceIamIdentity("persistenceIamIdentity1464017428") + .setAuthEnabled(true) + .addAllServerCaCerts(new ArrayList()) + .setMaintenancePolicy(MaintenancePolicy.newBuilder().build()) + .setMaintenanceSchedule(MaintenanceSchedule.newBuilder().build()) + .setReplicaCount(564075208) + .addAllNodes(new ArrayList()) + .setReadEndpoint("readEndpoint294053195") + .setReadEndpointPort(-1676143102) + .setPersistenceConfig(PersistenceConfig.newBuilder().build()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("createInstanceTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockService.addResponse(resultOperation); + + String parent = "projects/project-5833/locations/location-5833"; + String instanceId = "instanceId902024336"; + Instance instance = Instance.newBuilder().build(); + + Instance actualResponse = client.createInstanceAsync(parent, instanceId, instance).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void createInstanceExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String parent = "projects/project-5833/locations/location-5833"; + String instanceId = "instanceId902024336"; + Instance instance = Instance.newBuilder().build(); + client.createInstanceAsync(parent, instanceId, instance).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + } + } + + @Test + public void updateInstanceTest() throws Exception { + Instance expectedResponse = + Instance.newBuilder() + .setName(InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString()) + .setDisplayName("displayName1714148973") + .putAllLabels(new HashMap()) + .setLocationId("locationId1541836720") + .setAlternativeLocationId("alternativeLocationId1787141949") + .setRedisVersion("redisVersion-1972584739") + .setReservedIpRange("reservedIpRange575015950") + .setSecondaryIpRange("secondaryIpRange-1937131454") + .setHost("host3208616") + .setPort(3446913) + .setCurrentLocationId("currentLocationId-1808505335") + .setCreateTime(Timestamp.newBuilder().build()) + .setStatusMessage("statusMessage-958704715") + .putAllRedisConfigs(new HashMap()) + .setMemorySizeGb(34199707) + .setAuthorizedNetwork("authorizedNetwork1515554835") + .setPersistenceIamIdentity("persistenceIamIdentity1464017428") + .setAuthEnabled(true) + .addAllServerCaCerts(new ArrayList()) + .setMaintenancePolicy(MaintenancePolicy.newBuilder().build()) + .setMaintenanceSchedule(MaintenanceSchedule.newBuilder().build()) + .setReplicaCount(564075208) + .addAllNodes(new ArrayList()) + .setReadEndpoint("readEndpoint294053195") + .setReadEndpointPort(-1676143102) + .setPersistenceConfig(PersistenceConfig.newBuilder().build()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("updateInstanceTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockService.addResponse(resultOperation); + + FieldMask updateMask = FieldMask.newBuilder().build(); + Instance instance = + Instance.newBuilder() + .setName(InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString()) + .setDisplayName("displayName1714148973") + .putAllLabels(new HashMap()) + .setLocationId("locationId1541836720") + .setAlternativeLocationId("alternativeLocationId1787141949") + .setRedisVersion("redisVersion-1972584739") + .setReservedIpRange("reservedIpRange575015950") + .setSecondaryIpRange("secondaryIpRange-1937131454") + .setHost("host3208616") + .setPort(3446913) + .setCurrentLocationId("currentLocationId-1808505335") + .setCreateTime(Timestamp.newBuilder().build()) + .setStatusMessage("statusMessage-958704715") + .putAllRedisConfigs(new HashMap()) + .setMemorySizeGb(34199707) + .setAuthorizedNetwork("authorizedNetwork1515554835") + .setPersistenceIamIdentity("persistenceIamIdentity1464017428") + .setAuthEnabled(true) + .addAllServerCaCerts(new ArrayList()) + .setMaintenancePolicy(MaintenancePolicy.newBuilder().build()) + .setMaintenanceSchedule(MaintenanceSchedule.newBuilder().build()) + .setReplicaCount(564075208) + .addAllNodes(new ArrayList()) + .setReadEndpoint("readEndpoint294053195") + .setReadEndpointPort(-1676143102) + .setPersistenceConfig(PersistenceConfig.newBuilder().build()) + .build(); + + Instance actualResponse = client.updateInstanceAsync(updateMask, instance).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void updateInstanceExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + FieldMask updateMask = FieldMask.newBuilder().build(); + Instance instance = + Instance.newBuilder() + .setName(InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString()) + .setDisplayName("displayName1714148973") + .putAllLabels(new HashMap()) + .setLocationId("locationId1541836720") + .setAlternativeLocationId("alternativeLocationId1787141949") + .setRedisVersion("redisVersion-1972584739") + .setReservedIpRange("reservedIpRange575015950") + .setSecondaryIpRange("secondaryIpRange-1937131454") + .setHost("host3208616") + .setPort(3446913) + .setCurrentLocationId("currentLocationId-1808505335") + .setCreateTime(Timestamp.newBuilder().build()) + .setStatusMessage("statusMessage-958704715") + .putAllRedisConfigs(new HashMap()) + .setMemorySizeGb(34199707) + .setAuthorizedNetwork("authorizedNetwork1515554835") + .setPersistenceIamIdentity("persistenceIamIdentity1464017428") + .setAuthEnabled(true) + .addAllServerCaCerts(new ArrayList()) + .setMaintenancePolicy(MaintenancePolicy.newBuilder().build()) + .setMaintenanceSchedule(MaintenanceSchedule.newBuilder().build()) + .setReplicaCount(564075208) + .addAllNodes(new ArrayList()) + .setReadEndpoint("readEndpoint294053195") + .setReadEndpointPort(-1676143102) + .setPersistenceConfig(PersistenceConfig.newBuilder().build()) + .build(); + client.updateInstanceAsync(updateMask, instance).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + } + } + + @Test + public void upgradeInstanceTest() throws Exception { + Instance expectedResponse = + Instance.newBuilder() + .setName(InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString()) + .setDisplayName("displayName1714148973") + .putAllLabels(new HashMap()) + .setLocationId("locationId1541836720") + .setAlternativeLocationId("alternativeLocationId1787141949") + .setRedisVersion("redisVersion-1972584739") + .setReservedIpRange("reservedIpRange575015950") + .setSecondaryIpRange("secondaryIpRange-1937131454") + .setHost("host3208616") + .setPort(3446913) + .setCurrentLocationId("currentLocationId-1808505335") + .setCreateTime(Timestamp.newBuilder().build()) + .setStatusMessage("statusMessage-958704715") + .putAllRedisConfigs(new HashMap()) + .setMemorySizeGb(34199707) + .setAuthorizedNetwork("authorizedNetwork1515554835") + .setPersistenceIamIdentity("persistenceIamIdentity1464017428") + .setAuthEnabled(true) + .addAllServerCaCerts(new ArrayList()) + .setMaintenancePolicy(MaintenancePolicy.newBuilder().build()) + .setMaintenanceSchedule(MaintenanceSchedule.newBuilder().build()) + .setReplicaCount(564075208) + .addAllNodes(new ArrayList()) + .setReadEndpoint("readEndpoint294053195") + .setReadEndpointPort(-1676143102) + .setPersistenceConfig(PersistenceConfig.newBuilder().build()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("upgradeInstanceTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockService.addResponse(resultOperation); + + InstanceName name = InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]"); + String redisVersion = "redisVersion-1972584739"; + + Instance actualResponse = client.upgradeInstanceAsync(name, redisVersion).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void upgradeInstanceExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + InstanceName name = InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]"); + String redisVersion = "redisVersion-1972584739"; + client.upgradeInstanceAsync(name, redisVersion).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + } + } + + @Test + public void upgradeInstanceTest2() throws Exception { + Instance expectedResponse = + Instance.newBuilder() + .setName(InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString()) + .setDisplayName("displayName1714148973") + .putAllLabels(new HashMap()) + .setLocationId("locationId1541836720") + .setAlternativeLocationId("alternativeLocationId1787141949") + .setRedisVersion("redisVersion-1972584739") + .setReservedIpRange("reservedIpRange575015950") + .setSecondaryIpRange("secondaryIpRange-1937131454") + .setHost("host3208616") + .setPort(3446913) + .setCurrentLocationId("currentLocationId-1808505335") + .setCreateTime(Timestamp.newBuilder().build()) + .setStatusMessage("statusMessage-958704715") + .putAllRedisConfigs(new HashMap()) + .setMemorySizeGb(34199707) + .setAuthorizedNetwork("authorizedNetwork1515554835") + .setPersistenceIamIdentity("persistenceIamIdentity1464017428") + .setAuthEnabled(true) + .addAllServerCaCerts(new ArrayList()) + .setMaintenancePolicy(MaintenancePolicy.newBuilder().build()) + .setMaintenanceSchedule(MaintenanceSchedule.newBuilder().build()) + .setReplicaCount(564075208) + .addAllNodes(new ArrayList()) + .setReadEndpoint("readEndpoint294053195") + .setReadEndpointPort(-1676143102) + .setPersistenceConfig(PersistenceConfig.newBuilder().build()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("upgradeInstanceTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockService.addResponse(resultOperation); + + String name = "projects/project-9412/locations/location-9412/instances/instance-9412"; + String redisVersion = "redisVersion-1972584739"; + + Instance actualResponse = client.upgradeInstanceAsync(name, redisVersion).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void upgradeInstanceExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String name = "projects/project-9412/locations/location-9412/instances/instance-9412"; + String redisVersion = "redisVersion-1972584739"; + client.upgradeInstanceAsync(name, redisVersion).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + } + } + + @Test + public void importInstanceTest() throws Exception { + Instance expectedResponse = + Instance.newBuilder() + .setName(InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString()) + .setDisplayName("displayName1714148973") + .putAllLabels(new HashMap()) + .setLocationId("locationId1541836720") + .setAlternativeLocationId("alternativeLocationId1787141949") + .setRedisVersion("redisVersion-1972584739") + .setReservedIpRange("reservedIpRange575015950") + .setSecondaryIpRange("secondaryIpRange-1937131454") + .setHost("host3208616") + .setPort(3446913) + .setCurrentLocationId("currentLocationId-1808505335") + .setCreateTime(Timestamp.newBuilder().build()) + .setStatusMessage("statusMessage-958704715") + .putAllRedisConfigs(new HashMap()) + .setMemorySizeGb(34199707) + .setAuthorizedNetwork("authorizedNetwork1515554835") + .setPersistenceIamIdentity("persistenceIamIdentity1464017428") + .setAuthEnabled(true) + .addAllServerCaCerts(new ArrayList()) + .setMaintenancePolicy(MaintenancePolicy.newBuilder().build()) + .setMaintenanceSchedule(MaintenanceSchedule.newBuilder().build()) + .setReplicaCount(564075208) + .addAllNodes(new ArrayList()) + .setReadEndpoint("readEndpoint294053195") + .setReadEndpointPort(-1676143102) + .setPersistenceConfig(PersistenceConfig.newBuilder().build()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("importInstanceTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockService.addResponse(resultOperation); + + String name = "projects/project-9412/locations/location-9412/instances/instance-9412"; + InputConfig inputConfig = InputConfig.newBuilder().build(); + + Instance actualResponse = client.importInstanceAsync(name, inputConfig).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void importInstanceExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String name = "projects/project-9412/locations/location-9412/instances/instance-9412"; + InputConfig inputConfig = InputConfig.newBuilder().build(); + client.importInstanceAsync(name, inputConfig).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + } + } + + @Test + public void exportInstanceTest() throws Exception { + Instance expectedResponse = + Instance.newBuilder() + .setName(InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString()) + .setDisplayName("displayName1714148973") + .putAllLabels(new HashMap()) + .setLocationId("locationId1541836720") + .setAlternativeLocationId("alternativeLocationId1787141949") + .setRedisVersion("redisVersion-1972584739") + .setReservedIpRange("reservedIpRange575015950") + .setSecondaryIpRange("secondaryIpRange-1937131454") + .setHost("host3208616") + .setPort(3446913) + .setCurrentLocationId("currentLocationId-1808505335") + .setCreateTime(Timestamp.newBuilder().build()) + .setStatusMessage("statusMessage-958704715") + .putAllRedisConfigs(new HashMap()) + .setMemorySizeGb(34199707) + .setAuthorizedNetwork("authorizedNetwork1515554835") + .setPersistenceIamIdentity("persistenceIamIdentity1464017428") + .setAuthEnabled(true) + .addAllServerCaCerts(new ArrayList()) + .setMaintenancePolicy(MaintenancePolicy.newBuilder().build()) + .setMaintenanceSchedule(MaintenanceSchedule.newBuilder().build()) + .setReplicaCount(564075208) + .addAllNodes(new ArrayList()) + .setReadEndpoint("readEndpoint294053195") + .setReadEndpointPort(-1676143102) + .setPersistenceConfig(PersistenceConfig.newBuilder().build()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("exportInstanceTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockService.addResponse(resultOperation); + + String name = "projects/project-9412/locations/location-9412/instances/instance-9412"; + OutputConfig outputConfig = OutputConfig.newBuilder().build(); + + Instance actualResponse = client.exportInstanceAsync(name, outputConfig).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void exportInstanceExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String name = "projects/project-9412/locations/location-9412/instances/instance-9412"; + OutputConfig outputConfig = OutputConfig.newBuilder().build(); + client.exportInstanceAsync(name, outputConfig).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + } + } + + @Test + public void failoverInstanceTest() throws Exception { + Instance expectedResponse = + Instance.newBuilder() + .setName(InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString()) + .setDisplayName("displayName1714148973") + .putAllLabels(new HashMap()) + .setLocationId("locationId1541836720") + .setAlternativeLocationId("alternativeLocationId1787141949") + .setRedisVersion("redisVersion-1972584739") + .setReservedIpRange("reservedIpRange575015950") + .setSecondaryIpRange("secondaryIpRange-1937131454") + .setHost("host3208616") + .setPort(3446913) + .setCurrentLocationId("currentLocationId-1808505335") + .setCreateTime(Timestamp.newBuilder().build()) + .setStatusMessage("statusMessage-958704715") + .putAllRedisConfigs(new HashMap()) + .setMemorySizeGb(34199707) + .setAuthorizedNetwork("authorizedNetwork1515554835") + .setPersistenceIamIdentity("persistenceIamIdentity1464017428") + .setAuthEnabled(true) + .addAllServerCaCerts(new ArrayList()) + .setMaintenancePolicy(MaintenancePolicy.newBuilder().build()) + .setMaintenanceSchedule(MaintenanceSchedule.newBuilder().build()) + .setReplicaCount(564075208) + .addAllNodes(new ArrayList()) + .setReadEndpoint("readEndpoint294053195") + .setReadEndpointPort(-1676143102) + .setPersistenceConfig(PersistenceConfig.newBuilder().build()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("failoverInstanceTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockService.addResponse(resultOperation); + + InstanceName name = InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]"); + FailoverInstanceRequest.DataProtectionMode dataProtectionMode = + FailoverInstanceRequest.DataProtectionMode.forNumber(0); + + Instance actualResponse = client.failoverInstanceAsync(name, dataProtectionMode).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void failoverInstanceExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + InstanceName name = InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]"); + FailoverInstanceRequest.DataProtectionMode dataProtectionMode = + FailoverInstanceRequest.DataProtectionMode.forNumber(0); + client.failoverInstanceAsync(name, dataProtectionMode).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + } + } + + @Test + public void failoverInstanceTest2() throws Exception { + Instance expectedResponse = + Instance.newBuilder() + .setName(InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString()) + .setDisplayName("displayName1714148973") + .putAllLabels(new HashMap()) + .setLocationId("locationId1541836720") + .setAlternativeLocationId("alternativeLocationId1787141949") + .setRedisVersion("redisVersion-1972584739") + .setReservedIpRange("reservedIpRange575015950") + .setSecondaryIpRange("secondaryIpRange-1937131454") + .setHost("host3208616") + .setPort(3446913) + .setCurrentLocationId("currentLocationId-1808505335") + .setCreateTime(Timestamp.newBuilder().build()) + .setStatusMessage("statusMessage-958704715") + .putAllRedisConfigs(new HashMap()) + .setMemorySizeGb(34199707) + .setAuthorizedNetwork("authorizedNetwork1515554835") + .setPersistenceIamIdentity("persistenceIamIdentity1464017428") + .setAuthEnabled(true) + .addAllServerCaCerts(new ArrayList()) + .setMaintenancePolicy(MaintenancePolicy.newBuilder().build()) + .setMaintenanceSchedule(MaintenanceSchedule.newBuilder().build()) + .setReplicaCount(564075208) + .addAllNodes(new ArrayList()) + .setReadEndpoint("readEndpoint294053195") + .setReadEndpointPort(-1676143102) + .setPersistenceConfig(PersistenceConfig.newBuilder().build()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("failoverInstanceTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockService.addResponse(resultOperation); + + String name = "projects/project-9412/locations/location-9412/instances/instance-9412"; + FailoverInstanceRequest.DataProtectionMode dataProtectionMode = + FailoverInstanceRequest.DataProtectionMode.forNumber(0); + + Instance actualResponse = client.failoverInstanceAsync(name, dataProtectionMode).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void failoverInstanceExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String name = "projects/project-9412/locations/location-9412/instances/instance-9412"; + FailoverInstanceRequest.DataProtectionMode dataProtectionMode = + FailoverInstanceRequest.DataProtectionMode.forNumber(0); + client.failoverInstanceAsync(name, dataProtectionMode).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + } + } + + @Test + public void deleteInstanceTest() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + Operation resultOperation = + Operation.newBuilder() + .setName("deleteInstanceTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockService.addResponse(resultOperation); + + InstanceName name = InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]"); + + client.deleteInstanceAsync(name).get(); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void deleteInstanceExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + InstanceName name = InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]"); + client.deleteInstanceAsync(name).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + } + } + + @Test + public void deleteInstanceTest2() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + Operation resultOperation = + Operation.newBuilder() + .setName("deleteInstanceTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockService.addResponse(resultOperation); + + String name = "projects/project-9412/locations/location-9412/instances/instance-9412"; + + client.deleteInstanceAsync(name).get(); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void deleteInstanceExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String name = "projects/project-9412/locations/location-9412/instances/instance-9412"; + client.deleteInstanceAsync(name).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + } + } + + @Test + public void rescheduleMaintenanceTest() throws Exception { + Instance expectedResponse = + Instance.newBuilder() + .setName(InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString()) + .setDisplayName("displayName1714148973") + .putAllLabels(new HashMap()) + .setLocationId("locationId1541836720") + .setAlternativeLocationId("alternativeLocationId1787141949") + .setRedisVersion("redisVersion-1972584739") + .setReservedIpRange("reservedIpRange575015950") + .setSecondaryIpRange("secondaryIpRange-1937131454") + .setHost("host3208616") + .setPort(3446913) + .setCurrentLocationId("currentLocationId-1808505335") + .setCreateTime(Timestamp.newBuilder().build()) + .setStatusMessage("statusMessage-958704715") + .putAllRedisConfigs(new HashMap()) + .setMemorySizeGb(34199707) + .setAuthorizedNetwork("authorizedNetwork1515554835") + .setPersistenceIamIdentity("persistenceIamIdentity1464017428") + .setAuthEnabled(true) + .addAllServerCaCerts(new ArrayList()) + .setMaintenancePolicy(MaintenancePolicy.newBuilder().build()) + .setMaintenanceSchedule(MaintenanceSchedule.newBuilder().build()) + .setReplicaCount(564075208) + .addAllNodes(new ArrayList()) + .setReadEndpoint("readEndpoint294053195") + .setReadEndpointPort(-1676143102) + .setPersistenceConfig(PersistenceConfig.newBuilder().build()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("rescheduleMaintenanceTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockService.addResponse(resultOperation); + + InstanceName name = InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]"); + RescheduleMaintenanceRequest.RescheduleType rescheduleType = + RescheduleMaintenanceRequest.RescheduleType.forNumber(0); + Timestamp scheduleTime = Timestamp.newBuilder().build(); + + Instance actualResponse = + client.rescheduleMaintenanceAsync(name, rescheduleType, scheduleTime).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void rescheduleMaintenanceExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + InstanceName name = InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]"); + RescheduleMaintenanceRequest.RescheduleType rescheduleType = + RescheduleMaintenanceRequest.RescheduleType.forNumber(0); + Timestamp scheduleTime = Timestamp.newBuilder().build(); + client.rescheduleMaintenanceAsync(name, rescheduleType, scheduleTime).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + } + } + + @Test + public void rescheduleMaintenanceTest2() throws Exception { + Instance expectedResponse = + Instance.newBuilder() + .setName(InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString()) + .setDisplayName("displayName1714148973") + .putAllLabels(new HashMap()) + .setLocationId("locationId1541836720") + .setAlternativeLocationId("alternativeLocationId1787141949") + .setRedisVersion("redisVersion-1972584739") + .setReservedIpRange("reservedIpRange575015950") + .setSecondaryIpRange("secondaryIpRange-1937131454") + .setHost("host3208616") + .setPort(3446913) + .setCurrentLocationId("currentLocationId-1808505335") + .setCreateTime(Timestamp.newBuilder().build()) + .setStatusMessage("statusMessage-958704715") + .putAllRedisConfigs(new HashMap()) + .setMemorySizeGb(34199707) + .setAuthorizedNetwork("authorizedNetwork1515554835") + .setPersistenceIamIdentity("persistenceIamIdentity1464017428") + .setAuthEnabled(true) + .addAllServerCaCerts(new ArrayList()) + .setMaintenancePolicy(MaintenancePolicy.newBuilder().build()) + .setMaintenanceSchedule(MaintenanceSchedule.newBuilder().build()) + .setReplicaCount(564075208) + .addAllNodes(new ArrayList()) + .setReadEndpoint("readEndpoint294053195") + .setReadEndpointPort(-1676143102) + .setPersistenceConfig(PersistenceConfig.newBuilder().build()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("rescheduleMaintenanceTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockService.addResponse(resultOperation); + + String name = "projects/project-9412/locations/location-9412/instances/instance-9412"; + RescheduleMaintenanceRequest.RescheduleType rescheduleType = + RescheduleMaintenanceRequest.RescheduleType.forNumber(0); + Timestamp scheduleTime = Timestamp.newBuilder().build(); + + Instance actualResponse = + client.rescheduleMaintenanceAsync(name, rescheduleType, scheduleTime).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void rescheduleMaintenanceExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String name = "projects/project-9412/locations/location-9412/instances/instance-9412"; + RescheduleMaintenanceRequest.RescheduleType rescheduleType = + RescheduleMaintenanceRequest.RescheduleType.forNumber(0); + Timestamp scheduleTime = Timestamp.newBuilder().build(); + client.rescheduleMaintenanceAsync(name, rescheduleType, scheduleTime).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + } + } +} diff --git a/test/integration/goldens/redis/src/com/google/cloud/redis/v1beta1/CloudRedisClientTest.java b/test/integration/goldens/redis/src/com/google/cloud/redis/v1beta1/CloudRedisClientTest.java index 75d101033b..3ba4428a23 100644 --- a/test/integration/goldens/redis/src/com/google/cloud/redis/v1beta1/CloudRedisClientTest.java +++ b/test/integration/goldens/redis/src/com/google/cloud/redis/v1beta1/CloudRedisClientTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/redis/src/com/google/cloud/redis/v1beta1/CloudRedisSettings.java b/test/integration/goldens/redis/src/com/google/cloud/redis/v1beta1/CloudRedisSettings.java index aa209f989f..94d6f4580a 100644 --- a/test/integration/goldens/redis/src/com/google/cloud/redis/v1beta1/CloudRedisSettings.java +++ b/test/integration/goldens/redis/src/com/google/cloud/redis/v1beta1/CloudRedisSettings.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -23,6 +23,7 @@ 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.httpjson.InstantiatingHttpJsonChannelProvider; import com.google.api.gax.rpc.ApiClientHeaderProvider; import com.google.api.gax.rpc.ClientContext; import com.google.api.gax.rpc.ClientSettings; @@ -54,7 +55,9 @@ *

        The builder of this class is recursive, so contained classes are themselves builders. When * build() is called, the tree of builders is called to create the complete settings object. * - *

        For example, to set the total timeout of getInstance to 30 seconds: + *

        For example, to set the + * [RetrySettings](https://cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.retrying.RetrySettings) + * of getInstance: * *

        {@code
          * // This snippet has been automatically generated and should be regarded as a code template only.
        @@ -70,10 +73,46 @@
          *             .getInstanceSettings()
          *             .getRetrySettings()
          *             .toBuilder()
        - *             .setTotalTimeout(Duration.ofSeconds(30))
        + *             .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());
          * CloudRedisSettings cloudRedisSettings = cloudRedisSettingsBuilder.build();
          * }
        + * + * Please refer to the [Client Side Retry + * Guide](https://docs.cloud.google.com/java/docs/client-retries) 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 createInstance: + * + *

        {@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
        + * CloudRedisSettings.Builder cloudRedisSettingsBuilder = CloudRedisSettings.newBuilder();
        + * TimedRetryAlgorithm timedRetryAlgorithm =
        + *     OperationalTimedPollAlgorithm.create(
        + *         RetrySettings.newBuilder()
        + *             .setInitialRetryDelayDuration(Duration.ofMillis(500))
        + *             .setRetryDelayMultiplier(1.5)
        + *             .setMaxRetryDelayDuration(Duration.ofMillis(5000))
        + *             .setTotalTimeoutDuration(Duration.ofHours(24))
        + *             .build());
        + * cloudRedisSettingsBuilder
        + *     .createClusterOperationSettings()
        + *     .setPollingAlgorithm(timedRetryAlgorithm)
        + *     .build();
        + * }
        */ @BetaApi @Generated("by gapic-generator-java") @@ -209,25 +248,36 @@ public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilde return CloudRedisStubSettings.defaultCredentialsProviderBuilder(); } - /** Returns a builder for the default ChannelProvider for this service. */ + /** Returns a builder for the default gRPC ChannelProvider for this service. */ public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { return CloudRedisStubSettings.defaultGrpcTransportProviderBuilder(); } + /** Returns a builder for the default REST ChannelProvider for this service. */ + @BetaApi + public static InstantiatingHttpJsonChannelProvider.Builder + defaultHttpJsonTransportProviderBuilder() { + return CloudRedisStubSettings.defaultHttpJsonTransportProviderBuilder(); + } + public static TransportChannelProvider defaultTransportChannelProvider() { return CloudRedisStubSettings.defaultTransportChannelProvider(); } - @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { return CloudRedisStubSettings.defaultApiClientHeaderProviderBuilder(); } - /** Returns a new builder for this class. */ + /** Returns a new gRPC builder for this class. */ public static Builder newBuilder() { return Builder.createDefault(); } + /** Returns a new REST builder for this class. */ + public static Builder newHttpJsonBuilder() { + return Builder.createHttpJsonDefault(); + } + /** Returns a new builder for this class. */ public static Builder newBuilder(ClientContext clientContext) { return new Builder(clientContext); @@ -265,6 +315,10 @@ private static Builder createDefault() { return new Builder(CloudRedisStubSettings.newBuilder()); } + private static Builder createHttpJsonDefault() { + return new Builder(CloudRedisStubSettings.newHttpJsonBuilder()); + } + public CloudRedisStubSettings.Builder getStubSettingsBuilder() { return ((CloudRedisStubSettings.Builder) getStubSettings()); } diff --git a/test/integration/goldens/redis/src/com/google/cloud/redis/v1beta1/InstanceName.java b/test/integration/goldens/redis/src/com/google/cloud/redis/v1beta1/InstanceName.java index c5b99af8e8..58994ef581 100644 --- a/test/integration/goldens/redis/src/com/google/cloud/redis/v1beta1/InstanceName.java +++ b/test/integration/goldens/redis/src/com/google/cloud/redis/v1beta1/InstanceName.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -154,7 +154,7 @@ public boolean equals(Object o) { if (o == this) { return true; } - if (o != null || getClass() == o.getClass()) { + if (o != null && getClass() == o.getClass()) { InstanceName that = ((InstanceName) o); return Objects.equals(this.project, that.project) && Objects.equals(this.location, that.location) diff --git a/test/integration/goldens/redis/src/com/google/cloud/redis/v1beta1/LocationName.java b/test/integration/goldens/redis/src/com/google/cloud/redis/v1beta1/LocationName.java index 1643161c98..8ea7eca806 100644 --- a/test/integration/goldens/redis/src/com/google/cloud/redis/v1beta1/LocationName.java +++ b/test/integration/goldens/redis/src/com/google/cloud/redis/v1beta1/LocationName.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -137,7 +137,7 @@ public boolean equals(Object o) { if (o == this) { return true; } - if (o != null || getClass() == o.getClass()) { + if (o != null && getClass() == o.getClass()) { LocationName that = ((LocationName) o); return Objects.equals(this.project, that.project) && Objects.equals(this.location, that.location); diff --git a/test/integration/goldens/redis/src/com/google/cloud/redis/v1beta1/MockCloudRedis.java b/test/integration/goldens/redis/src/com/google/cloud/redis/v1beta1/MockCloudRedis.java index 17eb95477c..c51af637ee 100644 --- a/test/integration/goldens/redis/src/com/google/cloud/redis/v1beta1/MockCloudRedis.java +++ b/test/integration/goldens/redis/src/com/google/cloud/redis/v1beta1/MockCloudRedis.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/redis/src/com/google/cloud/redis/v1beta1/MockCloudRedisImpl.java b/test/integration/goldens/redis/src/com/google/cloud/redis/v1beta1/MockCloudRedisImpl.java index f3e4266f08..d57e8bfee4 100644 --- a/test/integration/goldens/redis/src/com/google/cloud/redis/v1beta1/MockCloudRedisImpl.java +++ b/test/integration/goldens/redis/src/com/google/cloud/redis/v1beta1/MockCloudRedisImpl.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/redis/src/com/google/cloud/redis/v1beta1/package-info.java b/test/integration/goldens/redis/src/com/google/cloud/redis/v1beta1/package-info.java index 18a35816ee..d09b0ecc3a 100644 --- a/test/integration/goldens/redis/src/com/google/cloud/redis/v1beta1/package-info.java +++ b/test/integration/goldens/redis/src/com/google/cloud/redis/v1beta1/package-info.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/redis/src/com/google/cloud/redis/v1beta1/stub/CloudRedisStub.java b/test/integration/goldens/redis/src/com/google/cloud/redis/v1beta1/stub/CloudRedisStub.java index 5c9f2594cc..ee3b618be4 100644 --- a/test/integration/goldens/redis/src/com/google/cloud/redis/v1beta1/stub/CloudRedisStub.java +++ b/test/integration/goldens/redis/src/com/google/cloud/redis/v1beta1/stub/CloudRedisStub.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -53,7 +53,11 @@ public abstract class CloudRedisStub implements BackgroundResource { public OperationsStub getOperationsStub() { - throw new UnsupportedOperationException("Not implemented: getOperationsStub()"); + return null; + } + + public com.google.api.gax.httpjson.longrunning.stub.OperationsStub getHttpJsonOperationsStub() { + return null; } public UnaryCallable diff --git a/test/integration/goldens/redis/src/com/google/cloud/redis/v1beta1/stub/CloudRedisStubSettings.java b/test/integration/goldens/redis/src/com/google/cloud/redis/v1beta1/stub/CloudRedisStubSettings.java index 904d09ba06..086b575f4b 100644 --- a/test/integration/goldens/redis/src/com/google/cloud/redis/v1beta1/stub/CloudRedisStubSettings.java +++ b/test/integration/goldens/redis/src/com/google/cloud/redis/v1beta1/stub/CloudRedisStubSettings.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -21,6 +21,7 @@ import com.google.api.core.ApiFunction; import com.google.api.core.ApiFuture; import com.google.api.core.BetaApi; +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; @@ -28,12 +29,16 @@ 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.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.HttpJsonTransportChannel; +import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; 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.LibraryMetadata; import com.google.api.gax.rpc.OperationCallSettings; import com.google.api.gax.rpc.PageContext; import com.google.api.gax.rpc.PagedCallSettings; @@ -66,9 +71,9 @@ import com.google.protobuf.Any; import com.google.protobuf.Empty; import java.io.IOException; +import java.time.Duration; import java.util.List; import javax.annotation.Generated; -import org.threeten.bp.Duration; // AUTO-GENERATED DOCUMENTATION AND CLASS. /** @@ -85,7 +90,9 @@ *

        The builder of this class is recursive, so contained classes are themselves builders. When * build() is called, the tree of builders is called to create the complete settings object. * - *

        For example, to set the total timeout of getInstance to 30 seconds: + *

        For example, to set the + * [RetrySettings](https://cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.retrying.RetrySettings) + * of getInstance: * *

        {@code
          * // This snippet has been automatically generated and should be regarded as a code template only.
        @@ -101,13 +108,50 @@
          *             .getInstanceSettings()
          *             .getRetrySettings()
          *             .toBuilder()
        - *             .setTotalTimeout(Duration.ofSeconds(30))
        + *             .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());
          * CloudRedisStubSettings cloudRedisSettings = cloudRedisSettingsBuilder.build();
          * }
        + * + * Please refer to the [Client Side Retry + * Guide](https://docs.cloud.google.com/java/docs/client-retries) 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 createInstance: + * + *

        {@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
        + * CloudRedisStubSettings.Builder cloudRedisSettingsBuilder = CloudRedisStubSettings.newBuilder();
        + * TimedRetryAlgorithm timedRetryAlgorithm =
        + *     OperationalTimedPollAlgorithm.create(
        + *         RetrySettings.newBuilder()
        + *             .setInitialRetryDelayDuration(Duration.ofMillis(500))
        + *             .setRetryDelayMultiplier(1.5)
        + *             .setMaxRetryDelayDuration(Duration.ofMillis(5000))
        + *             .setTotalTimeoutDuration(Duration.ofHours(24))
        + *             .build());
        + * cloudRedisSettingsBuilder
        + *     .createClusterOperationSettings()
        + *     .setPollingAlgorithm(timedRetryAlgorithm)
        + *     .build();
        + * }
        */ @BetaApi @Generated("by gapic-generator-java") +@SuppressWarnings("CanonicalDuration") public class CloudRedisStubSettings extends StubSettings { /** The default scopes of the service. */ private static final ImmutableList DEFAULT_SERVICE_SCOPES = @@ -175,9 +219,7 @@ public String extractNextToken(ListInstancesResponse payload) { @Override public Iterable extractResources(ListInstancesResponse payload) { - return payload.getInstancesList() == null - ? ImmutableList.of() - : payload.getInstancesList(); + return payload.getInstancesList(); } }; @@ -310,17 +352,29 @@ public CloudRedisStub createStub() throws IOException { .equals(GrpcTransportChannel.getGrpcTransportName())) { return GrpcCloudRedisStub.create(this); } + if (getTransportChannelProvider() + .getTransportName() + .equals(HttpJsonTransportChannel.getHttpJsonTransportName())) { + return HttpJsonCloudRedisStub.create(this); + } throw new UnsupportedOperationException( String.format( "Transport not supported: %s", getTransportChannelProvider().getTransportName())); } + /** Returns the default service name. */ + @Override + public String getServiceName() { + return "redis"; + } + /** 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 "redis.googleapis.com:443"; } @@ -342,18 +396,24 @@ public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilde .setUseJwtAccessWithScope(true); } - /** Returns a builder for the default ChannelProvider for this service. */ + /** Returns a builder for the default gRPC ChannelProvider for this service. */ public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { return InstantiatingGrpcChannelProvider.newBuilder() .setMaxInboundMessageSize(Integer.MAX_VALUE); } + /** Returns a builder for the default REST ChannelProvider for this service. */ + @BetaApi + public static InstantiatingHttpJsonChannelProvider.Builder + defaultHttpJsonTransportProviderBuilder() { + return InstantiatingHttpJsonChannelProvider.newBuilder(); + } + public static TransportChannelProvider defaultTransportChannelProvider() { return defaultGrpcTransportProviderBuilder().build(); } - @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") - public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + public static ApiClientHeaderProvider.Builder defaultGrpcApiClientHeaderProviderBuilder() { return ApiClientHeaderProvider.newBuilder() .setGeneratedLibToken( "gapic", GaxProperties.getLibraryVersion(CloudRedisStubSettings.class)) @@ -361,11 +421,29 @@ public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuil GaxGrpcProperties.getGrpcTokenName(), GaxGrpcProperties.getGrpcVersion()); } - /** Returns a new builder for this class. */ + public static ApiClientHeaderProvider.Builder defaultHttpJsonApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken( + "gapic", GaxProperties.getLibraryVersion(CloudRedisStubSettings.class)) + .setTransportToken( + GaxHttpJsonProperties.getHttpJsonTokenName(), + GaxHttpJsonProperties.getHttpJsonVersion()); + } + + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return CloudRedisStubSettings.defaultGrpcApiClientHeaderProviderBuilder(); + } + + /** Returns a new gRPC builder for this class. */ public static Builder newBuilder() { return Builder.createDefault(); } + /** Returns a new REST builder for this class. */ + public static Builder newHttpJsonBuilder() { + return Builder.createHttpJsonDefault(); + } + /** Returns a new builder for this class. */ public static Builder newBuilder(ClientContext clientContext) { return new Builder(clientContext); @@ -401,6 +479,11 @@ protected CloudRedisStubSettings(Builder settingsBuilder) throws IOException { settingsBuilder.rescheduleMaintenanceOperationSettings().build(); } + @Override + protected LibraryMetadata getLibraryMetadata() { + return LibraryMetadata.newBuilder().setVersion(Version.VERSION).build(); + } + /** Builder for CloudRedisStubSettings. */ public static class Builder extends StubSettings.Builder { private final ImmutableList> unaryMethodSettingsBuilders; @@ -461,10 +544,10 @@ public static class Builder extends StubSettings.Builder createInstanc } /** Returns the builder for the settings used for calls to createInstance. */ - @BetaApi( - "The surface for use by generated code is not stable yet and may change in the future.") public OperationCallSettings.Builder createInstanceOperationSettings() { return createInstanceOperationSettings; @@ -862,8 +954,6 @@ public UnaryCallSettings.Builder updateInstanc } /** Returns the builder for the settings used for calls to updateInstance. */ - @BetaApi( - "The surface for use by generated code is not stable yet and may change in the future.") public OperationCallSettings.Builder updateInstanceOperationSettings() { return updateInstanceOperationSettings; @@ -875,8 +965,6 @@ public UnaryCallSettings.Builder upgradeInsta } /** Returns the builder for the settings used for calls to upgradeInstance. */ - @BetaApi( - "The surface for use by generated code is not stable yet and may change in the future.") public OperationCallSettings.Builder upgradeInstanceOperationSettings() { return upgradeInstanceOperationSettings; @@ -888,8 +976,6 @@ public UnaryCallSettings.Builder importInstanc } /** Returns the builder for the settings used for calls to importInstance. */ - @BetaApi( - "The surface for use by generated code is not stable yet and may change in the future.") public OperationCallSettings.Builder importInstanceOperationSettings() { return importInstanceOperationSettings; @@ -901,8 +987,6 @@ public UnaryCallSettings.Builder exportInstanc } /** Returns the builder for the settings used for calls to exportInstance. */ - @BetaApi( - "The surface for use by generated code is not stable yet and may change in the future.") public OperationCallSettings.Builder exportInstanceOperationSettings() { return exportInstanceOperationSettings; @@ -915,8 +999,6 @@ public UnaryCallSettings.Builder exportInstanc } /** Returns the builder for the settings used for calls to failoverInstance. */ - @BetaApi( - "The surface for use by generated code is not stable yet and may change in the future.") public OperationCallSettings.Builder failoverInstanceOperationSettings() { return failoverInstanceOperationSettings; @@ -928,8 +1010,6 @@ public UnaryCallSettings.Builder deleteInstanc } /** Returns the builder for the settings used for calls to deleteInstance. */ - @BetaApi( - "The surface for use by generated code is not stable yet and may change in the future.") public OperationCallSettings.Builder deleteInstanceOperationSettings() { return deleteInstanceOperationSettings; @@ -942,8 +1022,6 @@ public UnaryCallSettings.Builder deleteInstanc } /** Returns the builder for the settings used for calls to rescheduleMaintenance. */ - @BetaApi( - "The surface for use by generated code is not stable yet and may change in the future.") public OperationCallSettings.Builder rescheduleMaintenanceOperationSettings() { return rescheduleMaintenanceOperationSettings; diff --git a/test/integration/goldens/redis/src/com/google/cloud/redis/v1beta1/stub/GrpcCloudRedisCallableFactory.java b/test/integration/goldens/redis/src/com/google/cloud/redis/v1beta1/stub/GrpcCloudRedisCallableFactory.java index 7a58d2425b..73f0d9dc6d 100644 --- a/test/integration/goldens/redis/src/com/google/cloud/redis/v1beta1/stub/GrpcCloudRedisCallableFactory.java +++ b/test/integration/goldens/redis/src/com/google/cloud/redis/v1beta1/stub/GrpcCloudRedisCallableFactory.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/redis/src/com/google/cloud/redis/v1beta1/stub/GrpcCloudRedisStub.java b/test/integration/goldens/redis/src/com/google/cloud/redis/v1beta1/stub/GrpcCloudRedisStub.java index dbb63761c6..3668310283 100644 --- a/test/integration/goldens/redis/src/com/google/cloud/redis/v1beta1/stub/GrpcCloudRedisStub.java +++ b/test/integration/goldens/redis/src/com/google/cloud/redis/v1beta1/stub/GrpcCloudRedisStub.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -25,6 +25,7 @@ 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.cloud.redis.v1beta1.CreateInstanceRequest; import com.google.cloud.redis.v1beta1.DeleteInstanceRequest; @@ -40,7 +41,6 @@ import com.google.cloud.redis.v1beta1.RescheduleMaintenanceRequest; import com.google.cloud.redis.v1beta1.UpdateInstanceRequest; import com.google.cloud.redis.v1beta1.UpgradeInstanceRequest; -import com.google.common.collect.ImmutableMap; import com.google.longrunning.Operation; import com.google.longrunning.stub.GrpcOperationsStub; import com.google.protobuf.Any; @@ -70,6 +70,7 @@ public class GrpcCloudRedisStub extends CloudRedisStub { ProtoUtils.marshaller(ListInstancesRequest.getDefaultInstance())) .setResponseMarshaller( ProtoUtils.marshaller(ListInstancesResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) .build(); private static final MethodDescriptor getInstanceMethodDescriptor = @@ -78,6 +79,7 @@ public class GrpcCloudRedisStub extends CloudRedisStub { .setFullMethodName("google.cloud.redis.v1beta1.CloudRedis/GetInstance") .setRequestMarshaller(ProtoUtils.marshaller(GetInstanceRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(Instance.getDefaultInstance())) + .setSampledToLocalTracing(true) .build(); private static final MethodDescriptor @@ -88,6 +90,7 @@ public class GrpcCloudRedisStub extends CloudRedisStub { .setRequestMarshaller( ProtoUtils.marshaller(GetInstanceAuthStringRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(InstanceAuthString.getDefaultInstance())) + .setSampledToLocalTracing(true) .build(); private static final MethodDescriptor @@ -98,6 +101,7 @@ public class GrpcCloudRedisStub extends CloudRedisStub { .setRequestMarshaller( ProtoUtils.marshaller(CreateInstanceRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .setSampledToLocalTracing(true) .build(); private static final MethodDescriptor @@ -108,6 +112,7 @@ public class GrpcCloudRedisStub extends CloudRedisStub { .setRequestMarshaller( ProtoUtils.marshaller(UpdateInstanceRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .setSampledToLocalTracing(true) .build(); private static final MethodDescriptor @@ -118,6 +123,7 @@ public class GrpcCloudRedisStub extends CloudRedisStub { .setRequestMarshaller( ProtoUtils.marshaller(UpgradeInstanceRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .setSampledToLocalTracing(true) .build(); private static final MethodDescriptor @@ -128,6 +134,7 @@ public class GrpcCloudRedisStub extends CloudRedisStub { .setRequestMarshaller( ProtoUtils.marshaller(ImportInstanceRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .setSampledToLocalTracing(true) .build(); private static final MethodDescriptor @@ -138,6 +145,7 @@ public class GrpcCloudRedisStub extends CloudRedisStub { .setRequestMarshaller( ProtoUtils.marshaller(ExportInstanceRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .setSampledToLocalTracing(true) .build(); private static final MethodDescriptor @@ -148,6 +156,7 @@ public class GrpcCloudRedisStub extends CloudRedisStub { .setRequestMarshaller( ProtoUtils.marshaller(FailoverInstanceRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .setSampledToLocalTracing(true) .build(); private static final MethodDescriptor @@ -158,6 +167,7 @@ public class GrpcCloudRedisStub extends CloudRedisStub { .setRequestMarshaller( ProtoUtils.marshaller(DeleteInstanceRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .setSampledToLocalTracing(true) .build(); private static final MethodDescriptor @@ -168,6 +178,7 @@ public class GrpcCloudRedisStub extends CloudRedisStub { .setRequestMarshaller( ProtoUtils.marshaller(RescheduleMaintenanceRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .setSampledToLocalTracing(true) .build(); private final UnaryCallable listInstancesCallable; @@ -249,20 +260,22 @@ protected GrpcCloudRedisStub( .setMethodDescriptor(listInstancesMethodDescriptor) .setParamsExtractor( request -> { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("parent", String.valueOf(request.getParent())); - return params.build(); + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); }) + .setResourceNameExtractor(request -> request.getParent()) .build(); GrpcCallSettings getInstanceTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(getInstanceMethodDescriptor) .setParamsExtractor( request -> { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("name", String.valueOf(request.getName())); - return params.build(); + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); }) + .setResourceNameExtractor(request -> request.getName()) .build(); GrpcCallSettings getInstanceAuthStringTransportSettings = @@ -270,29 +283,31 @@ protected GrpcCloudRedisStub( .setMethodDescriptor(getInstanceAuthStringMethodDescriptor) .setParamsExtractor( request -> { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("name", String.valueOf(request.getName())); - return params.build(); + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); }) + .setResourceNameExtractor(request -> request.getName()) .build(); GrpcCallSettings createInstanceTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(createInstanceMethodDescriptor) .setParamsExtractor( request -> { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("parent", String.valueOf(request.getParent())); - return params.build(); + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); }) + .setResourceNameExtractor(request -> request.getParent()) .build(); GrpcCallSettings updateInstanceTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(updateInstanceMethodDescriptor) .setParamsExtractor( request -> { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("instance.name", String.valueOf(request.getInstance().getName())); - return params.build(); + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("instance.name", String.valueOf(request.getInstance().getName())); + return builder.build(); }) .build(); GrpcCallSettings upgradeInstanceTransportSettings = @@ -300,19 +315,20 @@ protected GrpcCloudRedisStub( .setMethodDescriptor(upgradeInstanceMethodDescriptor) .setParamsExtractor( request -> { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("name", String.valueOf(request.getName())); - return params.build(); + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); }) + .setResourceNameExtractor(request -> request.getName()) .build(); GrpcCallSettings importInstanceTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(importInstanceMethodDescriptor) .setParamsExtractor( request -> { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("name", String.valueOf(request.getName())); - return params.build(); + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); }) .build(); GrpcCallSettings exportInstanceTransportSettings = @@ -320,9 +336,9 @@ protected GrpcCloudRedisStub( .setMethodDescriptor(exportInstanceMethodDescriptor) .setParamsExtractor( request -> { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("name", String.valueOf(request.getName())); - return params.build(); + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); }) .build(); GrpcCallSettings failoverInstanceTransportSettings = @@ -330,20 +346,22 @@ protected GrpcCloudRedisStub( .setMethodDescriptor(failoverInstanceMethodDescriptor) .setParamsExtractor( request -> { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("name", String.valueOf(request.getName())); - return params.build(); + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); }) + .setResourceNameExtractor(request -> request.getName()) .build(); GrpcCallSettings deleteInstanceTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(deleteInstanceMethodDescriptor) .setParamsExtractor( request -> { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("name", String.valueOf(request.getName())); - return params.build(); + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); }) + .setResourceNameExtractor(request -> request.getName()) .build(); GrpcCallSettings rescheduleMaintenanceTransportSettings = @@ -351,10 +369,11 @@ protected GrpcCloudRedisStub( .setMethodDescriptor(rescheduleMaintenanceMethodDescriptor) .setParamsExtractor( request -> { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("name", String.valueOf(request.getName())); - return params.build(); + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); }) + .setResourceNameExtractor(request -> request.getName()) .build(); this.listInstancesCallable = diff --git a/test/integration/goldens/redis/src/com/google/cloud/redis/v1beta1/stub/HttpJsonCloudRedisCallableFactory.java b/test/integration/goldens/redis/src/com/google/cloud/redis/v1beta1/stub/HttpJsonCloudRedisCallableFactory.java new file mode 100644 index 0000000000..dd01482204 --- /dev/null +++ b/test/integration/goldens/redis/src/com/google/cloud/redis/v1beta1/stub/HttpJsonCloudRedisCallableFactory.java @@ -0,0 +1,103 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS 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.redis.v1beta1.stub; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.HttpJsonCallSettings; +import com.google.api.gax.httpjson.HttpJsonCallableFactory; +import com.google.api.gax.httpjson.HttpJsonOperationSnapshotCallable; +import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; +import com.google.api.gax.httpjson.longrunning.stub.OperationsStub; +import com.google.api.gax.rpc.BatchingCallSettings; +import com.google.api.gax.rpc.ClientContext; +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.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.longrunning.Operation; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * REST callable factory implementation for the CloudRedis service API. + * + *

        This class is for advanced usage. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class HttpJsonCloudRedisCallableFactory + implements HttpJsonStubCallableFactory { + + @Override + public UnaryCallable createUnaryCallable( + HttpJsonCallSettings httpJsonCallSettings, + UnaryCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createUnaryCallable( + httpJsonCallSettings, callSettings, clientContext); + } + + @Override + public + UnaryCallable createPagedCallable( + HttpJsonCallSettings httpJsonCallSettings, + PagedCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createPagedCallable( + httpJsonCallSettings, callSettings, clientContext); + } + + @Override + public UnaryCallable createBatchingCallable( + HttpJsonCallSettings httpJsonCallSettings, + BatchingCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createBatchingCallable( + httpJsonCallSettings, callSettings, clientContext); + } + + @Override + public + OperationCallable createOperationCallable( + HttpJsonCallSettings httpJsonCallSettings, + OperationCallSettings callSettings, + ClientContext clientContext, + OperationsStub operationsStub) { + UnaryCallable innerCallable = + HttpJsonCallableFactory.createBaseUnaryCallable( + httpJsonCallSettings, callSettings.getInitialCallSettings(), clientContext); + HttpJsonOperationSnapshotCallable initialCallable = + new HttpJsonOperationSnapshotCallable( + innerCallable, + httpJsonCallSettings.getMethodDescriptor().getOperationSnapshotFactory()); + return HttpJsonCallableFactory.createOperationCallable( + callSettings, clientContext, operationsStub.longRunningClient(), initialCallable); + } + + @Override + public + ServerStreamingCallable createServerStreamingCallable( + HttpJsonCallSettings httpJsonCallSettings, + ServerStreamingCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createServerStreamingCallable( + httpJsonCallSettings, callSettings, clientContext); + } +} diff --git a/test/integration/goldens/redis/src/com/google/cloud/redis/v1beta1/stub/HttpJsonCloudRedisStub.java b/test/integration/goldens/redis/src/com/google/cloud/redis/v1beta1/stub/HttpJsonCloudRedisStub.java new file mode 100644 index 0000000000..8e4ed25365 --- /dev/null +++ b/test/integration/goldens/redis/src/com/google/cloud/redis/v1beta1/stub/HttpJsonCloudRedisStub.java @@ -0,0 +1,995 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS 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.redis.v1beta1.stub; + +import static com.google.cloud.redis.v1beta1.CloudRedisClient.ListInstancesPagedResponse; + +import com.google.api.HttpRule; +import com.google.api.core.BetaApi; +import com.google.api.core.InternalApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.httpjson.ApiMethodDescriptor; +import com.google.api.gax.httpjson.HttpJsonCallSettings; +import com.google.api.gax.httpjson.HttpJsonOperationSnapshot; +import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; +import com.google.api.gax.httpjson.ProtoMessageRequestFormatter; +import com.google.api.gax.httpjson.ProtoMessageResponseParser; +import com.google.api.gax.httpjson.ProtoRestSerializer; +import com.google.api.gax.httpjson.longrunning.stub.HttpJsonOperationsStub; +import com.google.api.gax.longrunning.OperationSnapshot; +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.cloud.redis.v1beta1.CreateInstanceRequest; +import com.google.cloud.redis.v1beta1.DeleteInstanceRequest; +import com.google.cloud.redis.v1beta1.ExportInstanceRequest; +import com.google.cloud.redis.v1beta1.FailoverInstanceRequest; +import com.google.cloud.redis.v1beta1.GetInstanceAuthStringRequest; +import com.google.cloud.redis.v1beta1.GetInstanceRequest; +import com.google.cloud.redis.v1beta1.ImportInstanceRequest; +import com.google.cloud.redis.v1beta1.Instance; +import com.google.cloud.redis.v1beta1.InstanceAuthString; +import com.google.cloud.redis.v1beta1.ListInstancesRequest; +import com.google.cloud.redis.v1beta1.ListInstancesResponse; +import com.google.cloud.redis.v1beta1.RescheduleMaintenanceRequest; +import com.google.cloud.redis.v1beta1.UpdateInstanceRequest; +import com.google.cloud.redis.v1beta1.UpgradeInstanceRequest; +import com.google.common.collect.ImmutableMap; +import com.google.longrunning.Operation; +import com.google.protobuf.Any; +import com.google.protobuf.Empty; +import com.google.protobuf.TypeRegistry; +import java.io.IOException; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * REST stub implementation for the CloudRedis service API. + * + *

        This class is for advanced usage and reflects the underlying API directly. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class HttpJsonCloudRedisStub extends CloudRedisStub { + private static final TypeRegistry typeRegistry = + TypeRegistry.newBuilder() + .add(Empty.getDescriptor()) + .add(Instance.getDescriptor()) + .add(Any.getDescriptor()) + .build(); + + private static final ApiMethodDescriptor + listInstancesMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.redis.v1beta1.CloudRedis/ListInstances") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/{parent=projects/*/locations/*}/instances", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "parent", request.getParent()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "pageSize", request.getPageSize()); + serializer.putQueryParam(fields, "pageToken", request.getPageToken()); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(ListInstancesResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + getInstanceMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.redis.v1beta1.CloudRedis/GetInstance") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/{name=projects/*/locations/*/instances/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Instance.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + getInstanceAuthStringMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.redis.v1beta1.CloudRedis/GetInstanceAuthString") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/{name=projects/*/locations/*/instances/*}/authString", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(InstanceAuthString.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + createInstanceMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.redis.v1beta1.CloudRedis/CreateInstance") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/{parent=projects/*/locations/*}/instances", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "parent", request.getParent()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "instanceId", request.getInstanceId()); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("instance", request.getInstance(), true)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Operation.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .setOperationSnapshotFactory( + (CreateInstanceRequest request, Operation response) -> + HttpJsonOperationSnapshot.create(response)) + .build(); + + private static final ApiMethodDescriptor + updateInstanceMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.redis.v1beta1.CloudRedis/UpdateInstance") + .setHttpMethod("PATCH") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/{instance.name=projects/*/locations/*/instances/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam( + fields, "instance.name", request.getInstance().getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "updateMask", request.getUpdateMask()); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("instance", request.getInstance(), true)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Operation.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .setOperationSnapshotFactory( + (UpdateInstanceRequest request, Operation response) -> + HttpJsonOperationSnapshot.create(response)) + .build(); + + private static final ApiMethodDescriptor + upgradeInstanceMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.redis.v1beta1.CloudRedis/UpgradeInstance") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/{name=projects/*/locations/*/instances/*}:upgrade", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("*", request.toBuilder().clearName().build(), true)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Operation.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .setOperationSnapshotFactory( + (UpgradeInstanceRequest request, Operation response) -> + HttpJsonOperationSnapshot.create(response)) + .build(); + + private static final ApiMethodDescriptor + importInstanceMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.redis.v1beta1.CloudRedis/ImportInstance") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/{name=projects/*/locations/*/instances/*}:import", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("*", request.toBuilder().clearName().build(), true)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Operation.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .setOperationSnapshotFactory( + (ImportInstanceRequest request, Operation response) -> + HttpJsonOperationSnapshot.create(response)) + .build(); + + private static final ApiMethodDescriptor + exportInstanceMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.redis.v1beta1.CloudRedis/ExportInstance") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/{name=projects/*/locations/*/instances/*}:export", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("*", request.toBuilder().clearName().build(), true)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Operation.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .setOperationSnapshotFactory( + (ExportInstanceRequest request, Operation response) -> + HttpJsonOperationSnapshot.create(response)) + .build(); + + private static final ApiMethodDescriptor + failoverInstanceMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.redis.v1beta1.CloudRedis/FailoverInstance") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/{name=projects/*/locations/*/instances/*}:failover", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("*", request.toBuilder().clearName().build(), true)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Operation.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .setOperationSnapshotFactory( + (FailoverInstanceRequest request, Operation response) -> + HttpJsonOperationSnapshot.create(response)) + .build(); + + private static final ApiMethodDescriptor + deleteInstanceMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.redis.v1beta1.CloudRedis/DeleteInstance") + .setHttpMethod("DELETE") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/{name=projects/*/locations/*/instances/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Operation.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .setOperationSnapshotFactory( + (DeleteInstanceRequest request, Operation response) -> + HttpJsonOperationSnapshot.create(response)) + .build(); + + private static final ApiMethodDescriptor + rescheduleMaintenanceMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.redis.v1beta1.CloudRedis/RescheduleMaintenance") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/{name=projects/*/locations/*/instances/*}:rescheduleMaintenance", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("*", request.toBuilder().clearName().build(), true)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Operation.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .setOperationSnapshotFactory( + (RescheduleMaintenanceRequest request, Operation response) -> + HttpJsonOperationSnapshot.create(response)) + .build(); + + private final UnaryCallable listInstancesCallable; + private final UnaryCallable + listInstancesPagedCallable; + private final UnaryCallable getInstanceCallable; + private final UnaryCallable + getInstanceAuthStringCallable; + private final UnaryCallable createInstanceCallable; + private final OperationCallable + createInstanceOperationCallable; + private final UnaryCallable updateInstanceCallable; + private final OperationCallable + updateInstanceOperationCallable; + private final UnaryCallable upgradeInstanceCallable; + private final OperationCallable + upgradeInstanceOperationCallable; + private final UnaryCallable importInstanceCallable; + private final OperationCallable + importInstanceOperationCallable; + private final UnaryCallable exportInstanceCallable; + private final OperationCallable + exportInstanceOperationCallable; + private final UnaryCallable failoverInstanceCallable; + private final OperationCallable + failoverInstanceOperationCallable; + private final UnaryCallable deleteInstanceCallable; + private final OperationCallable + deleteInstanceOperationCallable; + private final UnaryCallable + rescheduleMaintenanceCallable; + private final OperationCallable + rescheduleMaintenanceOperationCallable; + + private final BackgroundResource backgroundResources; + private final HttpJsonOperationsStub httpJsonOperationsStub; + private final HttpJsonStubCallableFactory callableFactory; + + public static final HttpJsonCloudRedisStub create(CloudRedisStubSettings settings) + throws IOException { + return new HttpJsonCloudRedisStub(settings, ClientContext.create(settings)); + } + + public static final HttpJsonCloudRedisStub create(ClientContext clientContext) + throws IOException { + return new HttpJsonCloudRedisStub( + CloudRedisStubSettings.newHttpJsonBuilder().build(), clientContext); + } + + public static final HttpJsonCloudRedisStub create( + ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { + return new HttpJsonCloudRedisStub( + CloudRedisStubSettings.newHttpJsonBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of HttpJsonCloudRedisStub, 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 HttpJsonCloudRedisStub(CloudRedisStubSettings settings, ClientContext clientContext) + throws IOException { + this(settings, clientContext, new HttpJsonCloudRedisCallableFactory()); + } + + /** + * Constructs an instance of HttpJsonCloudRedisStub, 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 HttpJsonCloudRedisStub( + CloudRedisStubSettings settings, + ClientContext clientContext, + HttpJsonStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + this.httpJsonOperationsStub = + HttpJsonOperationsStub.create( + clientContext, + callableFactory, + typeRegistry, + ImmutableMap.builder() + .put( + "google.longrunning.Operations.CancelOperation", + HttpRule.newBuilder() + .setPost("/v1beta1/{name=projects/*/locations/*/operations/*}:cancel") + .build()) + .put( + "google.longrunning.Operations.DeleteOperation", + HttpRule.newBuilder() + .setDelete("/v1beta1/{name=projects/*/locations/*/operations/*}") + .build()) + .put( + "google.longrunning.Operations.GetOperation", + HttpRule.newBuilder() + .setGet("/v1beta1/{name=projects/*/locations/*/operations/*}") + .build()) + .put( + "google.longrunning.Operations.ListOperations", + HttpRule.newBuilder() + .setGet("/v1beta1/{name=projects/*/locations/*}/operations") + .build()) + .build()); + + HttpJsonCallSettings + listInstancesTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(listInstancesMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .setResourceNameExtractor(request -> request.getParent()) + .build(); + HttpJsonCallSettings getInstanceTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getInstanceMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .setResourceNameExtractor(request -> request.getName()) + .build(); + HttpJsonCallSettings + getInstanceAuthStringTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getInstanceAuthStringMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .setResourceNameExtractor(request -> request.getName()) + .build(); + HttpJsonCallSettings createInstanceTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(createInstanceMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .setResourceNameExtractor(request -> request.getParent()) + .build(); + HttpJsonCallSettings updateInstanceTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(updateInstanceMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("instance.name", String.valueOf(request.getInstance().getName())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings upgradeInstanceTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(upgradeInstanceMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .setResourceNameExtractor(request -> request.getName()) + .build(); + HttpJsonCallSettings importInstanceTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(importInstanceMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings exportInstanceTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(exportInstanceMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings failoverInstanceTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(failoverInstanceMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .setResourceNameExtractor(request -> request.getName()) + .build(); + HttpJsonCallSettings deleteInstanceTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(deleteInstanceMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .setResourceNameExtractor(request -> request.getName()) + .build(); + HttpJsonCallSettings + rescheduleMaintenanceTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(rescheduleMaintenanceMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .setResourceNameExtractor(request -> request.getName()) + .build(); + + this.listInstancesCallable = + callableFactory.createUnaryCallable( + listInstancesTransportSettings, settings.listInstancesSettings(), clientContext); + this.listInstancesPagedCallable = + callableFactory.createPagedCallable( + listInstancesTransportSettings, settings.listInstancesSettings(), clientContext); + this.getInstanceCallable = + callableFactory.createUnaryCallable( + getInstanceTransportSettings, settings.getInstanceSettings(), clientContext); + this.getInstanceAuthStringCallable = + callableFactory.createUnaryCallable( + getInstanceAuthStringTransportSettings, + settings.getInstanceAuthStringSettings(), + clientContext); + this.createInstanceCallable = + callableFactory.createUnaryCallable( + createInstanceTransportSettings, settings.createInstanceSettings(), clientContext); + this.createInstanceOperationCallable = + callableFactory.createOperationCallable( + createInstanceTransportSettings, + settings.createInstanceOperationSettings(), + clientContext, + httpJsonOperationsStub); + this.updateInstanceCallable = + callableFactory.createUnaryCallable( + updateInstanceTransportSettings, settings.updateInstanceSettings(), clientContext); + this.updateInstanceOperationCallable = + callableFactory.createOperationCallable( + updateInstanceTransportSettings, + settings.updateInstanceOperationSettings(), + clientContext, + httpJsonOperationsStub); + this.upgradeInstanceCallable = + callableFactory.createUnaryCallable( + upgradeInstanceTransportSettings, settings.upgradeInstanceSettings(), clientContext); + this.upgradeInstanceOperationCallable = + callableFactory.createOperationCallable( + upgradeInstanceTransportSettings, + settings.upgradeInstanceOperationSettings(), + clientContext, + httpJsonOperationsStub); + this.importInstanceCallable = + callableFactory.createUnaryCallable( + importInstanceTransportSettings, settings.importInstanceSettings(), clientContext); + this.importInstanceOperationCallable = + callableFactory.createOperationCallable( + importInstanceTransportSettings, + settings.importInstanceOperationSettings(), + clientContext, + httpJsonOperationsStub); + this.exportInstanceCallable = + callableFactory.createUnaryCallable( + exportInstanceTransportSettings, settings.exportInstanceSettings(), clientContext); + this.exportInstanceOperationCallable = + callableFactory.createOperationCallable( + exportInstanceTransportSettings, + settings.exportInstanceOperationSettings(), + clientContext, + httpJsonOperationsStub); + this.failoverInstanceCallable = + callableFactory.createUnaryCallable( + failoverInstanceTransportSettings, settings.failoverInstanceSettings(), clientContext); + this.failoverInstanceOperationCallable = + callableFactory.createOperationCallable( + failoverInstanceTransportSettings, + settings.failoverInstanceOperationSettings(), + clientContext, + httpJsonOperationsStub); + this.deleteInstanceCallable = + callableFactory.createUnaryCallable( + deleteInstanceTransportSettings, settings.deleteInstanceSettings(), clientContext); + this.deleteInstanceOperationCallable = + callableFactory.createOperationCallable( + deleteInstanceTransportSettings, + settings.deleteInstanceOperationSettings(), + clientContext, + httpJsonOperationsStub); + this.rescheduleMaintenanceCallable = + callableFactory.createUnaryCallable( + rescheduleMaintenanceTransportSettings, + settings.rescheduleMaintenanceSettings(), + clientContext); + this.rescheduleMaintenanceOperationCallable = + callableFactory.createOperationCallable( + rescheduleMaintenanceTransportSettings, + settings.rescheduleMaintenanceOperationSettings(), + clientContext, + httpJsonOperationsStub); + + this.backgroundResources = + new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + @InternalApi + public static List getMethodDescriptors() { + List methodDescriptors = new ArrayList<>(); + methodDescriptors.add(listInstancesMethodDescriptor); + methodDescriptors.add(getInstanceMethodDescriptor); + methodDescriptors.add(getInstanceAuthStringMethodDescriptor); + methodDescriptors.add(createInstanceMethodDescriptor); + methodDescriptors.add(updateInstanceMethodDescriptor); + methodDescriptors.add(upgradeInstanceMethodDescriptor); + methodDescriptors.add(importInstanceMethodDescriptor); + methodDescriptors.add(exportInstanceMethodDescriptor); + methodDescriptors.add(failoverInstanceMethodDescriptor); + methodDescriptors.add(deleteInstanceMethodDescriptor); + methodDescriptors.add(rescheduleMaintenanceMethodDescriptor); + return methodDescriptors; + } + + public HttpJsonOperationsStub getHttpJsonOperationsStub() { + return httpJsonOperationsStub; + } + + @Override + public UnaryCallable listInstancesCallable() { + return listInstancesCallable; + } + + @Override + public UnaryCallable + listInstancesPagedCallable() { + return listInstancesPagedCallable; + } + + @Override + public UnaryCallable getInstanceCallable() { + return getInstanceCallable; + } + + @Override + public UnaryCallable + getInstanceAuthStringCallable() { + return getInstanceAuthStringCallable; + } + + @Override + public UnaryCallable createInstanceCallable() { + return createInstanceCallable; + } + + @Override + public OperationCallable createInstanceOperationCallable() { + return createInstanceOperationCallable; + } + + @Override + public UnaryCallable updateInstanceCallable() { + return updateInstanceCallable; + } + + @Override + public OperationCallable updateInstanceOperationCallable() { + return updateInstanceOperationCallable; + } + + @Override + public UnaryCallable upgradeInstanceCallable() { + return upgradeInstanceCallable; + } + + @Override + public OperationCallable + upgradeInstanceOperationCallable() { + return upgradeInstanceOperationCallable; + } + + @Override + public UnaryCallable importInstanceCallable() { + return importInstanceCallable; + } + + @Override + public OperationCallable importInstanceOperationCallable() { + return importInstanceOperationCallable; + } + + @Override + public UnaryCallable exportInstanceCallable() { + return exportInstanceCallable; + } + + @Override + public OperationCallable exportInstanceOperationCallable() { + return exportInstanceOperationCallable; + } + + @Override + public UnaryCallable failoverInstanceCallable() { + return failoverInstanceCallable; + } + + @Override + public OperationCallable + failoverInstanceOperationCallable() { + return failoverInstanceOperationCallable; + } + + @Override + public UnaryCallable deleteInstanceCallable() { + return deleteInstanceCallable; + } + + @Override + public OperationCallable deleteInstanceOperationCallable() { + return deleteInstanceOperationCallable; + } + + @Override + public UnaryCallable rescheduleMaintenanceCallable() { + return rescheduleMaintenanceCallable; + } + + @Override + public OperationCallable + rescheduleMaintenanceOperationCallable() { + return rescheduleMaintenanceOperationCallable; + } + + @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/test/integration/goldens/redis/src/com/google/cloud/redis/v1beta1/stub/Version.java b/test/integration/goldens/redis/src/com/google/cloud/redis/v1beta1/stub/Version.java new file mode 100644 index 0000000000..1f91550304 --- /dev/null +++ b/test/integration/goldens/redis/src/com/google/cloud/redis/v1beta1/stub/Version.java @@ -0,0 +1,27 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS 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.redis.v1beta1.stub; + +import com.google.api.core.InternalApi; + +@InternalApi("For internal use only") +final class Version { + // {x-version-update-start:null:current} + static final String VERSION = "0.0.0-SNAPSHOT"; + // {x-version-update-end} + +} diff --git a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/cancelresumablewrite/AsyncCancelResumableWrite.java b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/cancelresumablewrite/AsyncCancelResumableWrite.java new file mode 100644 index 0000000000..18f6552638 --- /dev/null +++ b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/cancelresumablewrite/AsyncCancelResumableWrite.java @@ -0,0 +1,47 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.storage.v2.samples; + +// [START storage_v2_generated_Storage_CancelResumableWrite_async] +import com.google.api.core.ApiFuture; +import com.google.storage.v2.CancelResumableWriteRequest; +import com.google.storage.v2.CancelResumableWriteResponse; +import com.google.storage.v2.StorageClient; + +public class AsyncCancelResumableWrite { + + public static void main(String[] args) throws Exception { + asyncCancelResumableWrite(); + } + + public static void asyncCancelResumableWrite() 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 (StorageClient storageClient = StorageClient.create()) { + CancelResumableWriteRequest request = + CancelResumableWriteRequest.newBuilder().setUploadId("uploadId1563990780").build(); + ApiFuture future = + storageClient.cancelResumableWriteCallable().futureCall(request); + // Do something. + CancelResumableWriteResponse response = future.get(); + } + } +} +// [END storage_v2_generated_Storage_CancelResumableWrite_async] diff --git a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/cancelresumablewrite/SyncCancelResumableWrite.java b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/cancelresumablewrite/SyncCancelResumableWrite.java new file mode 100644 index 0000000000..e3732b4584 --- /dev/null +++ b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/cancelresumablewrite/SyncCancelResumableWrite.java @@ -0,0 +1,43 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.storage.v2.samples; + +// [START storage_v2_generated_Storage_CancelResumableWrite_sync] +import com.google.storage.v2.CancelResumableWriteRequest; +import com.google.storage.v2.CancelResumableWriteResponse; +import com.google.storage.v2.StorageClient; + +public class SyncCancelResumableWrite { + + public static void main(String[] args) throws Exception { + syncCancelResumableWrite(); + } + + public static void syncCancelResumableWrite() 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 (StorageClient storageClient = StorageClient.create()) { + CancelResumableWriteRequest request = + CancelResumableWriteRequest.newBuilder().setUploadId("uploadId1563990780").build(); + CancelResumableWriteResponse response = storageClient.cancelResumableWrite(request); + } + } +} +// [END storage_v2_generated_Storage_CancelResumableWrite_sync] diff --git a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/cancelresumablewrite/SyncCancelResumableWriteString.java b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/cancelresumablewrite/SyncCancelResumableWriteString.java new file mode 100644 index 0000000000..76912da3d8 --- /dev/null +++ b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/cancelresumablewrite/SyncCancelResumableWriteString.java @@ -0,0 +1,41 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.storage.v2.samples; + +// [START storage_v2_generated_Storage_CancelResumableWrite_String_sync] +import com.google.storage.v2.CancelResumableWriteResponse; +import com.google.storage.v2.StorageClient; + +public class SyncCancelResumableWriteString { + + public static void main(String[] args) throws Exception { + syncCancelResumableWriteString(); + } + + public static void syncCancelResumableWriteString() 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 (StorageClient storageClient = StorageClient.create()) { + String uploadId = "uploadId1563990780"; + CancelResumableWriteResponse response = storageClient.cancelResumableWrite(uploadId); + } + } +} +// [END storage_v2_generated_Storage_CancelResumableWrite_String_sync] diff --git a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/composeobject/AsyncComposeObject.java b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/composeobject/AsyncComposeObject.java index 0e7d8f5b05..66da85d0ee 100644 --- a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/composeobject/AsyncComposeObject.java +++ b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/composeobject/AsyncComposeObject.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -19,11 +19,10 @@ // [START storage_v2_generated_Storage_ComposeObject_async] import com.google.api.core.ApiFuture; import com.google.storage.v2.CommonObjectRequestParams; -import com.google.storage.v2.CommonRequestParams; import com.google.storage.v2.ComposeObjectRequest; import com.google.storage.v2.CryptoKeyName; import com.google.storage.v2.Object; -import com.google.storage.v2.PredefinedObjectAcl; +import com.google.storage.v2.ObjectChecksums; import com.google.storage.v2.StorageClient; import java.util.ArrayList; @@ -44,14 +43,14 @@ public static void asyncComposeObject() throws Exception { ComposeObjectRequest.newBuilder() .setDestination(Object.newBuilder().build()) .addAllSourceObjects(new ArrayList()) - .setDestinationPredefinedAcl(PredefinedObjectAcl.forNumber(0)) + .setDestinationPredefinedAcl("destinationPredefinedAcl1111125814") .setIfGenerationMatch(-1086241088) .setIfMetagenerationMatch(1043427781) .setKmsKey( CryptoKeyName.of("[PROJECT]", "[LOCATION]", "[KEY_RING]", "[CRYPTO_KEY]") .toString()) .setCommonObjectRequestParams(CommonObjectRequestParams.newBuilder().build()) - .setCommonRequestParams(CommonRequestParams.newBuilder().build()) + .setObjectChecksums(ObjectChecksums.newBuilder().build()) .build(); ApiFuture future = storageClient.composeObjectCallable().futureCall(request); // Do something. diff --git a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/composeobject/SyncComposeObject.java b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/composeobject/SyncComposeObject.java index 3ae9348e7b..76e726746d 100644 --- a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/composeobject/SyncComposeObject.java +++ b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/composeobject/SyncComposeObject.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -18,11 +18,10 @@ // [START storage_v2_generated_Storage_ComposeObject_sync] import com.google.storage.v2.CommonObjectRequestParams; -import com.google.storage.v2.CommonRequestParams; import com.google.storage.v2.ComposeObjectRequest; import com.google.storage.v2.CryptoKeyName; import com.google.storage.v2.Object; -import com.google.storage.v2.PredefinedObjectAcl; +import com.google.storage.v2.ObjectChecksums; import com.google.storage.v2.StorageClient; import java.util.ArrayList; @@ -43,14 +42,14 @@ public static void syncComposeObject() throws Exception { ComposeObjectRequest.newBuilder() .setDestination(Object.newBuilder().build()) .addAllSourceObjects(new ArrayList()) - .setDestinationPredefinedAcl(PredefinedObjectAcl.forNumber(0)) + .setDestinationPredefinedAcl("destinationPredefinedAcl1111125814") .setIfGenerationMatch(-1086241088) .setIfMetagenerationMatch(1043427781) .setKmsKey( CryptoKeyName.of("[PROJECT]", "[LOCATION]", "[KEY_RING]", "[CRYPTO_KEY]") .toString()) .setCommonObjectRequestParams(CommonObjectRequestParams.newBuilder().build()) - .setCommonRequestParams(CommonRequestParams.newBuilder().build()) + .setObjectChecksums(ObjectChecksums.newBuilder().build()) .build(); Object response = storageClient.composeObject(request); } diff --git a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/create/SyncCreateSetCredentialsProvider.java b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/create/SyncCreateSetCredentialsProvider.java index c17ea693e1..7a5a10530f 100644 --- a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/create/SyncCreateSetCredentialsProvider.java +++ b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/create/SyncCreateSetCredentialsProvider.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/create/SyncCreateSetEndpoint.java b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/create/SyncCreateSetEndpoint.java index b43c1b1baa..201a4f11db 100644 --- a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/create/SyncCreateSetEndpoint.java +++ b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/create/SyncCreateSetEndpoint.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/createbucket/AsyncCreateBucket.java b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/createbucket/AsyncCreateBucket.java index 6ffaca8866..9385b8a17c 100644 --- a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/createbucket/AsyncCreateBucket.java +++ b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/createbucket/AsyncCreateBucket.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -20,8 +20,6 @@ import com.google.api.core.ApiFuture; import com.google.storage.v2.Bucket; import com.google.storage.v2.CreateBucketRequest; -import com.google.storage.v2.PredefinedBucketAcl; -import com.google.storage.v2.PredefinedObjectAcl; import com.google.storage.v2.ProjectName; import com.google.storage.v2.StorageClient; @@ -43,8 +41,8 @@ public static void asyncCreateBucket() throws Exception { .setParent(ProjectName.of("[PROJECT]").toString()) .setBucket(Bucket.newBuilder().build()) .setBucketId("bucketId-1603305307") - .setPredefinedAcl(PredefinedBucketAcl.forNumber(0)) - .setPredefinedDefaultObjectAcl(PredefinedObjectAcl.forNumber(0)) + .setPredefinedAcl("predefinedAcl1207041188") + .setPredefinedDefaultObjectAcl("predefinedDefaultObjectAcl2109168048") .build(); ApiFuture future = storageClient.createBucketCallable().futureCall(request); // Do something. diff --git a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/createbucket/SyncCreateBucket.java b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/createbucket/SyncCreateBucket.java index 5978d8d46e..aa0a0e9b49 100644 --- a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/createbucket/SyncCreateBucket.java +++ b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/createbucket/SyncCreateBucket.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -19,8 +19,6 @@ // [START storage_v2_generated_Storage_CreateBucket_sync] import com.google.storage.v2.Bucket; import com.google.storage.v2.CreateBucketRequest; -import com.google.storage.v2.PredefinedBucketAcl; -import com.google.storage.v2.PredefinedObjectAcl; import com.google.storage.v2.ProjectName; import com.google.storage.v2.StorageClient; @@ -42,8 +40,8 @@ public static void syncCreateBucket() throws Exception { .setParent(ProjectName.of("[PROJECT]").toString()) .setBucket(Bucket.newBuilder().build()) .setBucketId("bucketId-1603305307") - .setPredefinedAcl(PredefinedBucketAcl.forNumber(0)) - .setPredefinedDefaultObjectAcl(PredefinedObjectAcl.forNumber(0)) + .setPredefinedAcl("predefinedAcl1207041188") + .setPredefinedDefaultObjectAcl("predefinedDefaultObjectAcl2109168048") .build(); Bucket response = storageClient.createBucket(request); } diff --git a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/createbucket/SyncCreateBucketProjectnameBucketString.java b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/createbucket/SyncCreateBucketProjectnameBucketString.java index 38fba8446b..1bb3e60855 100644 --- a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/createbucket/SyncCreateBucketProjectnameBucketString.java +++ b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/createbucket/SyncCreateBucketProjectnameBucketString.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/createbucket/SyncCreateBucketStringBucketString.java b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/createbucket/SyncCreateBucketStringBucketString.java index 7c6327688c..f8d159a569 100644 --- a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/createbucket/SyncCreateBucketStringBucketString.java +++ b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/createbucket/SyncCreateBucketStringBucketString.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/createhmackey/AsyncCreateHmacKey.java b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/createhmackey/AsyncCreateHmacKey.java index 82e3900e95..a5113e4fde 100644 --- a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/createhmackey/AsyncCreateHmacKey.java +++ b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/createhmackey/AsyncCreateHmacKey.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -18,7 +18,6 @@ // [START storage_v2_generated_Storage_CreateHmacKey_async] import com.google.api.core.ApiFuture; -import com.google.storage.v2.CommonRequestParams; import com.google.storage.v2.CreateHmacKeyRequest; import com.google.storage.v2.CreateHmacKeyResponse; import com.google.storage.v2.ProjectName; @@ -41,7 +40,6 @@ public static void asyncCreateHmacKey() throws Exception { CreateHmacKeyRequest.newBuilder() .setProject(ProjectName.of("[PROJECT]").toString()) .setServiceAccountEmail("serviceAccountEmail1825953988") - .setCommonRequestParams(CommonRequestParams.newBuilder().build()) .build(); ApiFuture future = storageClient.createHmacKeyCallable().futureCall(request); diff --git a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/createhmackey/SyncCreateHmacKey.java b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/createhmackey/SyncCreateHmacKey.java index 6a77091f33..1cc4f4f917 100644 --- a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/createhmackey/SyncCreateHmacKey.java +++ b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/createhmackey/SyncCreateHmacKey.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -17,7 +17,6 @@ package com.google.storage.v2.samples; // [START storage_v2_generated_Storage_CreateHmacKey_sync] -import com.google.storage.v2.CommonRequestParams; import com.google.storage.v2.CreateHmacKeyRequest; import com.google.storage.v2.CreateHmacKeyResponse; import com.google.storage.v2.ProjectName; @@ -40,7 +39,6 @@ public static void syncCreateHmacKey() throws Exception { CreateHmacKeyRequest.newBuilder() .setProject(ProjectName.of("[PROJECT]").toString()) .setServiceAccountEmail("serviceAccountEmail1825953988") - .setCommonRequestParams(CommonRequestParams.newBuilder().build()) .build(); CreateHmacKeyResponse response = storageClient.createHmacKey(request); } diff --git a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/createhmackey/SyncCreateHmacKeyProjectnameString.java b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/createhmackey/SyncCreateHmacKeyProjectnameString.java index fc3577f1aa..88e94ab60c 100644 --- a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/createhmackey/SyncCreateHmacKeyProjectnameString.java +++ b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/createhmackey/SyncCreateHmacKeyProjectnameString.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/createhmackey/SyncCreateHmacKeyStringString.java b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/createhmackey/SyncCreateHmacKeyStringString.java index 9223e5e485..8e139bebd7 100644 --- a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/createhmackey/SyncCreateHmacKeyStringString.java +++ b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/createhmackey/SyncCreateHmacKeyStringString.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/createnotification/AsyncCreateNotification.java b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/createnotification/AsyncCreateNotification.java index 6155ee24d4..9527543085 100644 --- a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/createnotification/AsyncCreateNotification.java +++ b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/createnotification/AsyncCreateNotification.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/createnotification/SyncCreateNotification.java b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/createnotification/SyncCreateNotification.java index f48aec3a56..18c20e05c0 100644 --- a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/createnotification/SyncCreateNotification.java +++ b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/createnotification/SyncCreateNotification.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/createnotification/SyncCreateNotificationProjectnameNotification.java b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/createnotification/SyncCreateNotificationProjectnameNotification.java index bacc5f080b..d04681c02f 100644 --- a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/createnotification/SyncCreateNotificationProjectnameNotification.java +++ b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/createnotification/SyncCreateNotificationProjectnameNotification.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/createnotification/SyncCreateNotificationStringNotification.java b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/createnotification/SyncCreateNotificationStringNotification.java index 8958897191..a847144e51 100644 --- a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/createnotification/SyncCreateNotificationStringNotification.java +++ b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/createnotification/SyncCreateNotificationStringNotification.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/deletebucket/AsyncDeleteBucket.java b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/deletebucket/AsyncDeleteBucket.java index 383879beda..5c888d344e 100644 --- a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/deletebucket/AsyncDeleteBucket.java +++ b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/deletebucket/AsyncDeleteBucket.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -20,7 +20,6 @@ import com.google.api.core.ApiFuture; import com.google.protobuf.Empty; import com.google.storage.v2.BucketName; -import com.google.storage.v2.CommonRequestParams; import com.google.storage.v2.DeleteBucketRequest; import com.google.storage.v2.StorageClient; @@ -42,7 +41,6 @@ public static void asyncDeleteBucket() throws Exception { .setName(BucketName.of("[PROJECT]", "[BUCKET]").toString()) .setIfMetagenerationMatch(1043427781) .setIfMetagenerationNotMatch(1025430873) - .setCommonRequestParams(CommonRequestParams.newBuilder().build()) .build(); ApiFuture future = storageClient.deleteBucketCallable().futureCall(request); // Do something. diff --git a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/deletebucket/SyncDeleteBucket.java b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/deletebucket/SyncDeleteBucket.java index 9f273a03b6..89c9a182fe 100644 --- a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/deletebucket/SyncDeleteBucket.java +++ b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/deletebucket/SyncDeleteBucket.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -19,7 +19,6 @@ // [START storage_v2_generated_Storage_DeleteBucket_sync] import com.google.protobuf.Empty; import com.google.storage.v2.BucketName; -import com.google.storage.v2.CommonRequestParams; import com.google.storage.v2.DeleteBucketRequest; import com.google.storage.v2.StorageClient; @@ -41,7 +40,6 @@ public static void syncDeleteBucket() throws Exception { .setName(BucketName.of("[PROJECT]", "[BUCKET]").toString()) .setIfMetagenerationMatch(1043427781) .setIfMetagenerationNotMatch(1025430873) - .setCommonRequestParams(CommonRequestParams.newBuilder().build()) .build(); storageClient.deleteBucket(request); } diff --git a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/deletebucket/SyncDeleteBucketBucketname.java b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/deletebucket/SyncDeleteBucketBucketname.java index 058b3ba4e2..a00ee41dd3 100644 --- a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/deletebucket/SyncDeleteBucketBucketname.java +++ b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/deletebucket/SyncDeleteBucketBucketname.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/deletebucket/SyncDeleteBucketString.java b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/deletebucket/SyncDeleteBucketString.java index 5f2ad3506c..d1db61b140 100644 --- a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/deletebucket/SyncDeleteBucketString.java +++ b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/deletebucket/SyncDeleteBucketString.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/deletehmackey/AsyncDeleteHmacKey.java b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/deletehmackey/AsyncDeleteHmacKey.java index 4d5371ce77..1fa9e26898 100644 --- a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/deletehmackey/AsyncDeleteHmacKey.java +++ b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/deletehmackey/AsyncDeleteHmacKey.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -19,7 +19,6 @@ // [START storage_v2_generated_Storage_DeleteHmacKey_async] import com.google.api.core.ApiFuture; import com.google.protobuf.Empty; -import com.google.storage.v2.CommonRequestParams; import com.google.storage.v2.DeleteHmacKeyRequest; import com.google.storage.v2.ProjectName; import com.google.storage.v2.StorageClient; @@ -41,7 +40,6 @@ public static void asyncDeleteHmacKey() throws Exception { DeleteHmacKeyRequest.newBuilder() .setAccessId("accessId-2146437729") .setProject(ProjectName.of("[PROJECT]").toString()) - .setCommonRequestParams(CommonRequestParams.newBuilder().build()) .build(); ApiFuture future = storageClient.deleteHmacKeyCallable().futureCall(request); // Do something. diff --git a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/deletehmackey/SyncDeleteHmacKey.java b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/deletehmackey/SyncDeleteHmacKey.java index 4c4987aae3..83c7f17828 100644 --- a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/deletehmackey/SyncDeleteHmacKey.java +++ b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/deletehmackey/SyncDeleteHmacKey.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -18,7 +18,6 @@ // [START storage_v2_generated_Storage_DeleteHmacKey_sync] import com.google.protobuf.Empty; -import com.google.storage.v2.CommonRequestParams; import com.google.storage.v2.DeleteHmacKeyRequest; import com.google.storage.v2.ProjectName; import com.google.storage.v2.StorageClient; @@ -40,7 +39,6 @@ public static void syncDeleteHmacKey() throws Exception { DeleteHmacKeyRequest.newBuilder() .setAccessId("accessId-2146437729") .setProject(ProjectName.of("[PROJECT]").toString()) - .setCommonRequestParams(CommonRequestParams.newBuilder().build()) .build(); storageClient.deleteHmacKey(request); } diff --git a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/deletehmackey/SyncDeleteHmacKeyStringProjectname.java b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/deletehmackey/SyncDeleteHmacKeyStringProjectname.java index 8268243bb2..6c531ca861 100644 --- a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/deletehmackey/SyncDeleteHmacKeyStringProjectname.java +++ b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/deletehmackey/SyncDeleteHmacKeyStringProjectname.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/deletehmackey/SyncDeleteHmacKeyStringString.java b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/deletehmackey/SyncDeleteHmacKeyStringString.java index 0c80aa1abd..5eb5e7ae9b 100644 --- a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/deletehmackey/SyncDeleteHmacKeyStringString.java +++ b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/deletehmackey/SyncDeleteHmacKeyStringString.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/deletenotification/AsyncDeleteNotification.java b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/deletenotification/AsyncDeleteNotification.java index 13375c27c8..53420f3046 100644 --- a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/deletenotification/AsyncDeleteNotification.java +++ b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/deletenotification/AsyncDeleteNotification.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/deletenotification/SyncDeleteNotification.java b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/deletenotification/SyncDeleteNotification.java index eb16ccf746..ad49ebc887 100644 --- a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/deletenotification/SyncDeleteNotification.java +++ b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/deletenotification/SyncDeleteNotification.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/deletenotification/SyncDeleteNotificationNotificationname.java b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/deletenotification/SyncDeleteNotificationNotificationname.java index 2066a7f99b..d811aea09e 100644 --- a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/deletenotification/SyncDeleteNotificationNotificationname.java +++ b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/deletenotification/SyncDeleteNotificationNotificationname.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/deletenotification/SyncDeleteNotificationString.java b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/deletenotification/SyncDeleteNotificationString.java index fdae07c684..70d84d4acf 100644 --- a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/deletenotification/SyncDeleteNotificationString.java +++ b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/deletenotification/SyncDeleteNotificationString.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/deleteobject/AsyncDeleteObject.java b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/deleteobject/AsyncDeleteObject.java index 714cd0468b..770d493784 100644 --- a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/deleteobject/AsyncDeleteObject.java +++ b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/deleteobject/AsyncDeleteObject.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -20,7 +20,6 @@ import com.google.api.core.ApiFuture; import com.google.protobuf.Empty; import com.google.storage.v2.CommonObjectRequestParams; -import com.google.storage.v2.CommonRequestParams; import com.google.storage.v2.DeleteObjectRequest; import com.google.storage.v2.StorageClient; @@ -41,14 +40,12 @@ public static void asyncDeleteObject() throws Exception { DeleteObjectRequest.newBuilder() .setBucket("bucket-1378203158") .setObject("object-1023368385") - .setUploadId("uploadId1563990780") .setGeneration(305703192) .setIfGenerationMatch(-1086241088) .setIfGenerationNotMatch(1475720404) .setIfMetagenerationMatch(1043427781) .setIfMetagenerationNotMatch(1025430873) .setCommonObjectRequestParams(CommonObjectRequestParams.newBuilder().build()) - .setCommonRequestParams(CommonRequestParams.newBuilder().build()) .build(); ApiFuture future = storageClient.deleteObjectCallable().futureCall(request); // Do something. diff --git a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/deleteobject/SyncDeleteObject.java b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/deleteobject/SyncDeleteObject.java index 2256af68a9..638b076c37 100644 --- a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/deleteobject/SyncDeleteObject.java +++ b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/deleteobject/SyncDeleteObject.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -19,7 +19,6 @@ // [START storage_v2_generated_Storage_DeleteObject_sync] import com.google.protobuf.Empty; import com.google.storage.v2.CommonObjectRequestParams; -import com.google.storage.v2.CommonRequestParams; import com.google.storage.v2.DeleteObjectRequest; import com.google.storage.v2.StorageClient; @@ -40,14 +39,12 @@ public static void syncDeleteObject() throws Exception { DeleteObjectRequest.newBuilder() .setBucket("bucket-1378203158") .setObject("object-1023368385") - .setUploadId("uploadId1563990780") .setGeneration(305703192) .setIfGenerationMatch(-1086241088) .setIfGenerationNotMatch(1475720404) .setIfMetagenerationMatch(1043427781) .setIfMetagenerationNotMatch(1025430873) .setCommonObjectRequestParams(CommonObjectRequestParams.newBuilder().build()) - .setCommonRequestParams(CommonRequestParams.newBuilder().build()) .build(); storageClient.deleteObject(request); } diff --git a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/deleteobject/SyncDeleteObjectStringString.java b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/deleteobject/SyncDeleteObjectStringString.java index 17f92a5fb8..1b64dfa3bf 100644 --- a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/deleteobject/SyncDeleteObjectStringString.java +++ b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/deleteobject/SyncDeleteObjectStringString.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/deleteobject/SyncDeleteObjectStringStringLong.java b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/deleteobject/SyncDeleteObjectStringStringLong.java index 96ece21926..c95cbb30c5 100644 --- a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/deleteobject/SyncDeleteObjectStringStringLong.java +++ b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/deleteobject/SyncDeleteObjectStringStringLong.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/getbucket/AsyncGetBucket.java b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/getbucket/AsyncGetBucket.java index 3dcdced845..fc09304b1e 100644 --- a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/getbucket/AsyncGetBucket.java +++ b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/getbucket/AsyncGetBucket.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -21,7 +21,6 @@ import com.google.protobuf.FieldMask; import com.google.storage.v2.Bucket; import com.google.storage.v2.BucketName; -import com.google.storage.v2.CommonRequestParams; import com.google.storage.v2.GetBucketRequest; import com.google.storage.v2.StorageClient; @@ -43,7 +42,6 @@ public static void asyncGetBucket() throws Exception { .setName(BucketName.of("[PROJECT]", "[BUCKET]").toString()) .setIfMetagenerationMatch(1043427781) .setIfMetagenerationNotMatch(1025430873) - .setCommonRequestParams(CommonRequestParams.newBuilder().build()) .setReadMask(FieldMask.newBuilder().build()) .build(); ApiFuture future = storageClient.getBucketCallable().futureCall(request); diff --git a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/getbucket/SyncGetBucket.java b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/getbucket/SyncGetBucket.java index 7f538febb9..b8e023a56b 100644 --- a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/getbucket/SyncGetBucket.java +++ b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/getbucket/SyncGetBucket.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -20,7 +20,6 @@ import com.google.protobuf.FieldMask; import com.google.storage.v2.Bucket; import com.google.storage.v2.BucketName; -import com.google.storage.v2.CommonRequestParams; import com.google.storage.v2.GetBucketRequest; import com.google.storage.v2.StorageClient; @@ -42,7 +41,6 @@ public static void syncGetBucket() throws Exception { .setName(BucketName.of("[PROJECT]", "[BUCKET]").toString()) .setIfMetagenerationMatch(1043427781) .setIfMetagenerationNotMatch(1025430873) - .setCommonRequestParams(CommonRequestParams.newBuilder().build()) .setReadMask(FieldMask.newBuilder().build()) .build(); Bucket response = storageClient.getBucket(request); diff --git a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/getbucket/SyncGetBucketBucketname.java b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/getbucket/SyncGetBucketBucketname.java index 4380dde62d..28de9848d1 100644 --- a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/getbucket/SyncGetBucketBucketname.java +++ b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/getbucket/SyncGetBucketBucketname.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/getbucket/SyncGetBucketString.java b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/getbucket/SyncGetBucketString.java index b405ab5bf8..f9d2bbce5e 100644 --- a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/getbucket/SyncGetBucketString.java +++ b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/getbucket/SyncGetBucketString.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/gethmackey/AsyncGetHmacKey.java b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/gethmackey/AsyncGetHmacKey.java index 6296790f3a..ca0fe82bfa 100644 --- a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/gethmackey/AsyncGetHmacKey.java +++ b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/gethmackey/AsyncGetHmacKey.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -18,7 +18,6 @@ // [START storage_v2_generated_Storage_GetHmacKey_async] import com.google.api.core.ApiFuture; -import com.google.storage.v2.CommonRequestParams; import com.google.storage.v2.GetHmacKeyRequest; import com.google.storage.v2.HmacKeyMetadata; import com.google.storage.v2.ProjectName; @@ -41,7 +40,6 @@ public static void asyncGetHmacKey() throws Exception { GetHmacKeyRequest.newBuilder() .setAccessId("accessId-2146437729") .setProject(ProjectName.of("[PROJECT]").toString()) - .setCommonRequestParams(CommonRequestParams.newBuilder().build()) .build(); ApiFuture future = storageClient.getHmacKeyCallable().futureCall(request); // Do something. diff --git a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/gethmackey/SyncGetHmacKey.java b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/gethmackey/SyncGetHmacKey.java index 3e10b16928..481cc83351 100644 --- a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/gethmackey/SyncGetHmacKey.java +++ b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/gethmackey/SyncGetHmacKey.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -17,7 +17,6 @@ package com.google.storage.v2.samples; // [START storage_v2_generated_Storage_GetHmacKey_sync] -import com.google.storage.v2.CommonRequestParams; import com.google.storage.v2.GetHmacKeyRequest; import com.google.storage.v2.HmacKeyMetadata; import com.google.storage.v2.ProjectName; @@ -40,7 +39,6 @@ public static void syncGetHmacKey() throws Exception { GetHmacKeyRequest.newBuilder() .setAccessId("accessId-2146437729") .setProject(ProjectName.of("[PROJECT]").toString()) - .setCommonRequestParams(CommonRequestParams.newBuilder().build()) .build(); HmacKeyMetadata response = storageClient.getHmacKey(request); } diff --git a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/gethmackey/SyncGetHmacKeyStringProjectname.java b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/gethmackey/SyncGetHmacKeyStringProjectname.java index 1f9a3af72e..0800bb9726 100644 --- a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/gethmackey/SyncGetHmacKeyStringProjectname.java +++ b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/gethmackey/SyncGetHmacKeyStringProjectname.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/gethmackey/SyncGetHmacKeyStringString.java b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/gethmackey/SyncGetHmacKeyStringString.java index 2d474fe1f7..55abc74186 100644 --- a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/gethmackey/SyncGetHmacKeyStringString.java +++ b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/gethmackey/SyncGetHmacKeyStringString.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/getiampolicy/AsyncGetIamPolicy.java b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/getiampolicy/AsyncGetIamPolicy.java index 3ad40f83e0..6dbfc19d3b 100644 --- a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/getiampolicy/AsyncGetIamPolicy.java +++ b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/getiampolicy/AsyncGetIamPolicy.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/getiampolicy/SyncGetIamPolicy.java b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/getiampolicy/SyncGetIamPolicy.java index 8afb23d68d..c92caa1d53 100644 --- a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/getiampolicy/SyncGetIamPolicy.java +++ b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/getiampolicy/SyncGetIamPolicy.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/getiampolicy/SyncGetIamPolicyResourcename.java b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/getiampolicy/SyncGetIamPolicyResourcename.java index 7957b007f7..ec273cb291 100644 --- a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/getiampolicy/SyncGetIamPolicyResourcename.java +++ b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/getiampolicy/SyncGetIamPolicyResourcename.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/getiampolicy/SyncGetIamPolicyString.java b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/getiampolicy/SyncGetIamPolicyString.java index abf33118f1..4ccacac6ac 100644 --- a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/getiampolicy/SyncGetIamPolicyString.java +++ b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/getiampolicy/SyncGetIamPolicyString.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/getnotification/AsyncGetNotification.java b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/getnotification/AsyncGetNotification.java index e435ab17d9..5fe425fbba 100644 --- a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/getnotification/AsyncGetNotification.java +++ b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/getnotification/AsyncGetNotification.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/getnotification/SyncGetNotification.java b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/getnotification/SyncGetNotification.java index cf7daa57e1..82ec4471b8 100644 --- a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/getnotification/SyncGetNotification.java +++ b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/getnotification/SyncGetNotification.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/getnotification/SyncGetNotificationBucketname.java b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/getnotification/SyncGetNotificationBucketname.java index c02279bd04..b6e10fc35f 100644 --- a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/getnotification/SyncGetNotificationBucketname.java +++ b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/getnotification/SyncGetNotificationBucketname.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/getnotification/SyncGetNotificationString.java b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/getnotification/SyncGetNotificationString.java index c986a36bd9..c2a1dc67a0 100644 --- a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/getnotification/SyncGetNotificationString.java +++ b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/getnotification/SyncGetNotificationString.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/getobject/AsyncGetObject.java b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/getobject/AsyncGetObject.java index 7c9ec69f23..3972790bc6 100644 --- a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/getobject/AsyncGetObject.java +++ b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/getobject/AsyncGetObject.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -20,7 +20,6 @@ import com.google.api.core.ApiFuture; import com.google.protobuf.FieldMask; import com.google.storage.v2.CommonObjectRequestParams; -import com.google.storage.v2.CommonRequestParams; import com.google.storage.v2.GetObjectRequest; import com.google.storage.v2.Object; import com.google.storage.v2.StorageClient; @@ -48,7 +47,6 @@ public static void asyncGetObject() throws Exception { .setIfMetagenerationMatch(1043427781) .setIfMetagenerationNotMatch(1025430873) .setCommonObjectRequestParams(CommonObjectRequestParams.newBuilder().build()) - .setCommonRequestParams(CommonRequestParams.newBuilder().build()) .setReadMask(FieldMask.newBuilder().build()) .build(); ApiFuture future = storageClient.getObjectCallable().futureCall(request); diff --git a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/getobject/SyncGetObject.java b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/getobject/SyncGetObject.java index 2df38b0411..6441c2a730 100644 --- a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/getobject/SyncGetObject.java +++ b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/getobject/SyncGetObject.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -19,7 +19,6 @@ // [START storage_v2_generated_Storage_GetObject_sync] import com.google.protobuf.FieldMask; import com.google.storage.v2.CommonObjectRequestParams; -import com.google.storage.v2.CommonRequestParams; import com.google.storage.v2.GetObjectRequest; import com.google.storage.v2.Object; import com.google.storage.v2.StorageClient; @@ -47,7 +46,6 @@ public static void syncGetObject() throws Exception { .setIfMetagenerationMatch(1043427781) .setIfMetagenerationNotMatch(1025430873) .setCommonObjectRequestParams(CommonObjectRequestParams.newBuilder().build()) - .setCommonRequestParams(CommonRequestParams.newBuilder().build()) .setReadMask(FieldMask.newBuilder().build()) .build(); Object response = storageClient.getObject(request); diff --git a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/getobject/SyncGetObjectStringString.java b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/getobject/SyncGetObjectStringString.java index 055976559c..963dd3d0fc 100644 --- a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/getobject/SyncGetObjectStringString.java +++ b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/getobject/SyncGetObjectStringString.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/getobject/SyncGetObjectStringStringLong.java b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/getobject/SyncGetObjectStringStringLong.java index d1b7872f9f..f5be18858c 100644 --- a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/getobject/SyncGetObjectStringStringLong.java +++ b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/getobject/SyncGetObjectStringStringLong.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/getserviceaccount/AsyncGetServiceAccount.java b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/getserviceaccount/AsyncGetServiceAccount.java index 5a7bc7f5bd..c5999d6152 100644 --- a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/getserviceaccount/AsyncGetServiceAccount.java +++ b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/getserviceaccount/AsyncGetServiceAccount.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -18,7 +18,6 @@ // [START storage_v2_generated_Storage_GetServiceAccount_async] import com.google.api.core.ApiFuture; -import com.google.storage.v2.CommonRequestParams; import com.google.storage.v2.GetServiceAccountRequest; import com.google.storage.v2.ProjectName; import com.google.storage.v2.ServiceAccount; @@ -40,7 +39,6 @@ public static void asyncGetServiceAccount() throws Exception { GetServiceAccountRequest request = GetServiceAccountRequest.newBuilder() .setProject(ProjectName.of("[PROJECT]").toString()) - .setCommonRequestParams(CommonRequestParams.newBuilder().build()) .build(); ApiFuture future = storageClient.getServiceAccountCallable().futureCall(request); diff --git a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/getserviceaccount/SyncGetServiceAccount.java b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/getserviceaccount/SyncGetServiceAccount.java index ac6aa64809..befa228bba 100644 --- a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/getserviceaccount/SyncGetServiceAccount.java +++ b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/getserviceaccount/SyncGetServiceAccount.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -17,7 +17,6 @@ package com.google.storage.v2.samples; // [START storage_v2_generated_Storage_GetServiceAccount_sync] -import com.google.storage.v2.CommonRequestParams; import com.google.storage.v2.GetServiceAccountRequest; import com.google.storage.v2.ProjectName; import com.google.storage.v2.ServiceAccount; @@ -39,7 +38,6 @@ public static void syncGetServiceAccount() throws Exception { GetServiceAccountRequest request = GetServiceAccountRequest.newBuilder() .setProject(ProjectName.of("[PROJECT]").toString()) - .setCommonRequestParams(CommonRequestParams.newBuilder().build()) .build(); ServiceAccount response = storageClient.getServiceAccount(request); } diff --git a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/getserviceaccount/SyncGetServiceAccountProjectname.java b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/getserviceaccount/SyncGetServiceAccountProjectname.java index 9c73fbfd80..20728cb150 100644 --- a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/getserviceaccount/SyncGetServiceAccountProjectname.java +++ b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/getserviceaccount/SyncGetServiceAccountProjectname.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/getserviceaccount/SyncGetServiceAccountString.java b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/getserviceaccount/SyncGetServiceAccountString.java index 366ed9739e..4fa0c8cb01 100644 --- a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/getserviceaccount/SyncGetServiceAccountString.java +++ b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/getserviceaccount/SyncGetServiceAccountString.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/listbuckets/AsyncListBuckets.java b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/listbuckets/AsyncListBuckets.java index ee836eb681..4ac0b27c66 100644 --- a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/listbuckets/AsyncListBuckets.java +++ b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/listbuckets/AsyncListBuckets.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -20,7 +20,6 @@ import com.google.api.core.ApiFuture; import com.google.protobuf.FieldMask; import com.google.storage.v2.Bucket; -import com.google.storage.v2.CommonRequestParams; import com.google.storage.v2.ListBucketsRequest; import com.google.storage.v2.ProjectName; import com.google.storage.v2.StorageClient; @@ -45,7 +44,6 @@ public static void asyncListBuckets() throws Exception { .setPageToken("pageToken873572522") .setPrefix("prefix-980110702") .setReadMask(FieldMask.newBuilder().build()) - .setCommonRequestParams(CommonRequestParams.newBuilder().build()) .build(); ApiFuture future = storageClient.listBucketsPagedCallable().futureCall(request); // Do something. diff --git a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/listbuckets/AsyncListBucketsPaged.java b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/listbuckets/AsyncListBucketsPaged.java index 50804dc510..7d8d27498b 100644 --- a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/listbuckets/AsyncListBucketsPaged.java +++ b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/listbuckets/AsyncListBucketsPaged.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -20,7 +20,6 @@ import com.google.common.base.Strings; import com.google.protobuf.FieldMask; import com.google.storage.v2.Bucket; -import com.google.storage.v2.CommonRequestParams; import com.google.storage.v2.ListBucketsRequest; import com.google.storage.v2.ListBucketsResponse; import com.google.storage.v2.ProjectName; @@ -46,7 +45,6 @@ public static void asyncListBucketsPaged() throws Exception { .setPageToken("pageToken873572522") .setPrefix("prefix-980110702") .setReadMask(FieldMask.newBuilder().build()) - .setCommonRequestParams(CommonRequestParams.newBuilder().build()) .build(); while (true) { ListBucketsResponse response = storageClient.listBucketsCallable().call(request); diff --git a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/listbuckets/SyncListBuckets.java b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/listbuckets/SyncListBuckets.java index e8a5825092..a8c537d9cd 100644 --- a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/listbuckets/SyncListBuckets.java +++ b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/listbuckets/SyncListBuckets.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -19,7 +19,6 @@ // [START storage_v2_generated_Storage_ListBuckets_sync] import com.google.protobuf.FieldMask; import com.google.storage.v2.Bucket; -import com.google.storage.v2.CommonRequestParams; import com.google.storage.v2.ListBucketsRequest; import com.google.storage.v2.ProjectName; import com.google.storage.v2.StorageClient; @@ -44,7 +43,6 @@ public static void syncListBuckets() throws Exception { .setPageToken("pageToken873572522") .setPrefix("prefix-980110702") .setReadMask(FieldMask.newBuilder().build()) - .setCommonRequestParams(CommonRequestParams.newBuilder().build()) .build(); for (Bucket element : storageClient.listBuckets(request).iterateAll()) { // doThingsWith(element); diff --git a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/listbuckets/SyncListBucketsProjectname.java b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/listbuckets/SyncListBucketsProjectname.java index e9c9424c1a..482fa10f2c 100644 --- a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/listbuckets/SyncListBucketsProjectname.java +++ b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/listbuckets/SyncListBucketsProjectname.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/listbuckets/SyncListBucketsString.java b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/listbuckets/SyncListBucketsString.java index 630f6bc297..cbd057a206 100644 --- a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/listbuckets/SyncListBucketsString.java +++ b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/listbuckets/SyncListBucketsString.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/listhmackeys/AsyncListHmacKeys.java b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/listhmackeys/AsyncListHmacKeys.java index 93a5d2848d..59f2169777 100644 --- a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/listhmackeys/AsyncListHmacKeys.java +++ b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/listhmackeys/AsyncListHmacKeys.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -18,7 +18,6 @@ // [START storage_v2_generated_Storage_ListHmacKeys_async] import com.google.api.core.ApiFuture; -import com.google.storage.v2.CommonRequestParams; import com.google.storage.v2.HmacKeyMetadata; import com.google.storage.v2.ListHmacKeysRequest; import com.google.storage.v2.ProjectName; @@ -44,7 +43,6 @@ public static void asyncListHmacKeys() throws Exception { .setPageToken("pageToken873572522") .setServiceAccountEmail("serviceAccountEmail1825953988") .setShowDeletedKeys(true) - .setCommonRequestParams(CommonRequestParams.newBuilder().build()) .build(); ApiFuture future = storageClient.listHmacKeysPagedCallable().futureCall(request); diff --git a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/listhmackeys/AsyncListHmacKeysPaged.java b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/listhmackeys/AsyncListHmacKeysPaged.java index 4ab0838fb2..1e820800ba 100644 --- a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/listhmackeys/AsyncListHmacKeysPaged.java +++ b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/listhmackeys/AsyncListHmacKeysPaged.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -18,7 +18,6 @@ // [START storage_v2_generated_Storage_ListHmacKeys_Paged_async] import com.google.common.base.Strings; -import com.google.storage.v2.CommonRequestParams; import com.google.storage.v2.HmacKeyMetadata; import com.google.storage.v2.ListHmacKeysRequest; import com.google.storage.v2.ListHmacKeysResponse; @@ -45,7 +44,6 @@ public static void asyncListHmacKeysPaged() throws Exception { .setPageToken("pageToken873572522") .setServiceAccountEmail("serviceAccountEmail1825953988") .setShowDeletedKeys(true) - .setCommonRequestParams(CommonRequestParams.newBuilder().build()) .build(); while (true) { ListHmacKeysResponse response = storageClient.listHmacKeysCallable().call(request); diff --git a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/listhmackeys/SyncListHmacKeys.java b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/listhmackeys/SyncListHmacKeys.java index aa3911a12e..4b008f166b 100644 --- a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/listhmackeys/SyncListHmacKeys.java +++ b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/listhmackeys/SyncListHmacKeys.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -17,7 +17,6 @@ package com.google.storage.v2.samples; // [START storage_v2_generated_Storage_ListHmacKeys_sync] -import com.google.storage.v2.CommonRequestParams; import com.google.storage.v2.HmacKeyMetadata; import com.google.storage.v2.ListHmacKeysRequest; import com.google.storage.v2.ProjectName; @@ -43,7 +42,6 @@ public static void syncListHmacKeys() throws Exception { .setPageToken("pageToken873572522") .setServiceAccountEmail("serviceAccountEmail1825953988") .setShowDeletedKeys(true) - .setCommonRequestParams(CommonRequestParams.newBuilder().build()) .build(); for (HmacKeyMetadata element : storageClient.listHmacKeys(request).iterateAll()) { // doThingsWith(element); diff --git a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/listhmackeys/SyncListHmacKeysProjectname.java b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/listhmackeys/SyncListHmacKeysProjectname.java index 4a4791ca22..d5f76d4187 100644 --- a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/listhmackeys/SyncListHmacKeysProjectname.java +++ b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/listhmackeys/SyncListHmacKeysProjectname.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/listhmackeys/SyncListHmacKeysString.java b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/listhmackeys/SyncListHmacKeysString.java index cc45b359b6..4ebca8fc9a 100644 --- a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/listhmackeys/SyncListHmacKeysString.java +++ b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/listhmackeys/SyncListHmacKeysString.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/listnotifications/AsyncListNotifications.java b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/listnotifications/AsyncListNotifications.java index 24f3399182..26284e897f 100644 --- a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/listnotifications/AsyncListNotifications.java +++ b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/listnotifications/AsyncListNotifications.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/listnotifications/AsyncListNotificationsPaged.java b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/listnotifications/AsyncListNotificationsPaged.java index 9f14a283b1..66b978552a 100644 --- a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/listnotifications/AsyncListNotificationsPaged.java +++ b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/listnotifications/AsyncListNotificationsPaged.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/listnotifications/SyncListNotifications.java b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/listnotifications/SyncListNotifications.java index 0ccd2eb0d3..223f00cb05 100644 --- a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/listnotifications/SyncListNotifications.java +++ b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/listnotifications/SyncListNotifications.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/listnotifications/SyncListNotificationsProjectname.java b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/listnotifications/SyncListNotificationsProjectname.java index d7ee513685..ff436fb032 100644 --- a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/listnotifications/SyncListNotificationsProjectname.java +++ b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/listnotifications/SyncListNotificationsProjectname.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/listnotifications/SyncListNotificationsString.java b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/listnotifications/SyncListNotificationsString.java index 34898b1a5c..f81e443b1d 100644 --- a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/listnotifications/SyncListNotificationsString.java +++ b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/listnotifications/SyncListNotificationsString.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/listobjects/AsyncListObjects.java b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/listobjects/AsyncListObjects.java index b3dc4aab67..a7783f9988 100644 --- a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/listobjects/AsyncListObjects.java +++ b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/listobjects/AsyncListObjects.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -19,7 +19,6 @@ // [START storage_v2_generated_Storage_ListObjects_async] import com.google.api.core.ApiFuture; import com.google.protobuf.FieldMask; -import com.google.storage.v2.CommonRequestParams; import com.google.storage.v2.ListObjectsRequest; import com.google.storage.v2.Object; import com.google.storage.v2.ProjectName; @@ -50,7 +49,6 @@ public static void asyncListObjects() throws Exception { .setReadMask(FieldMask.newBuilder().build()) .setLexicographicStart("lexicographicStart-2093413008") .setLexicographicEnd("lexicographicEnd1646968169") - .setCommonRequestParams(CommonRequestParams.newBuilder().build()) .build(); ApiFuture future = storageClient.listObjectsPagedCallable().futureCall(request); // Do something. diff --git a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/listobjects/AsyncListObjectsPaged.java b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/listobjects/AsyncListObjectsPaged.java index 52ec978572..f8c5d00773 100644 --- a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/listobjects/AsyncListObjectsPaged.java +++ b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/listobjects/AsyncListObjectsPaged.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -19,7 +19,6 @@ // [START storage_v2_generated_Storage_ListObjects_Paged_async] import com.google.common.base.Strings; import com.google.protobuf.FieldMask; -import com.google.storage.v2.CommonRequestParams; import com.google.storage.v2.ListObjectsRequest; import com.google.storage.v2.ListObjectsResponse; import com.google.storage.v2.Object; @@ -51,7 +50,6 @@ public static void asyncListObjectsPaged() throws Exception { .setReadMask(FieldMask.newBuilder().build()) .setLexicographicStart("lexicographicStart-2093413008") .setLexicographicEnd("lexicographicEnd1646968169") - .setCommonRequestParams(CommonRequestParams.newBuilder().build()) .build(); while (true) { ListObjectsResponse response = storageClient.listObjectsCallable().call(request); diff --git a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/listobjects/SyncListObjects.java b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/listobjects/SyncListObjects.java index 0a7b1bf7c9..974ef89fed 100644 --- a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/listobjects/SyncListObjects.java +++ b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/listobjects/SyncListObjects.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -18,7 +18,6 @@ // [START storage_v2_generated_Storage_ListObjects_sync] import com.google.protobuf.FieldMask; -import com.google.storage.v2.CommonRequestParams; import com.google.storage.v2.ListObjectsRequest; import com.google.storage.v2.Object; import com.google.storage.v2.ProjectName; @@ -49,7 +48,6 @@ public static void syncListObjects() throws Exception { .setReadMask(FieldMask.newBuilder().build()) .setLexicographicStart("lexicographicStart-2093413008") .setLexicographicEnd("lexicographicEnd1646968169") - .setCommonRequestParams(CommonRequestParams.newBuilder().build()) .build(); for (Object element : storageClient.listObjects(request).iterateAll()) { // doThingsWith(element); diff --git a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/listobjects/SyncListObjectsProjectname.java b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/listobjects/SyncListObjectsProjectname.java index ffeab2e800..1a1967d05e 100644 --- a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/listobjects/SyncListObjectsProjectname.java +++ b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/listobjects/SyncListObjectsProjectname.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/listobjects/SyncListObjectsString.java b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/listobjects/SyncListObjectsString.java index 07d0103f29..29150aca72 100644 --- a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/listobjects/SyncListObjectsString.java +++ b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/listobjects/SyncListObjectsString.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/lockbucketretentionpolicy/AsyncLockBucketRetentionPolicy.java b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/lockbucketretentionpolicy/AsyncLockBucketRetentionPolicy.java index 0a03174d88..7162969d9b 100644 --- a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/lockbucketretentionpolicy/AsyncLockBucketRetentionPolicy.java +++ b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/lockbucketretentionpolicy/AsyncLockBucketRetentionPolicy.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -20,7 +20,6 @@ import com.google.api.core.ApiFuture; import com.google.storage.v2.Bucket; import com.google.storage.v2.BucketName; -import com.google.storage.v2.CommonRequestParams; import com.google.storage.v2.LockBucketRetentionPolicyRequest; import com.google.storage.v2.StorageClient; @@ -41,7 +40,6 @@ public static void asyncLockBucketRetentionPolicy() throws Exception { LockBucketRetentionPolicyRequest.newBuilder() .setBucket(BucketName.of("[PROJECT]", "[BUCKET]").toString()) .setIfMetagenerationMatch(1043427781) - .setCommonRequestParams(CommonRequestParams.newBuilder().build()) .build(); ApiFuture future = storageClient.lockBucketRetentionPolicyCallable().futureCall(request); diff --git a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/lockbucketretentionpolicy/SyncLockBucketRetentionPolicy.java b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/lockbucketretentionpolicy/SyncLockBucketRetentionPolicy.java index 47cfec99e8..d1dbd7fd34 100644 --- a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/lockbucketretentionpolicy/SyncLockBucketRetentionPolicy.java +++ b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/lockbucketretentionpolicy/SyncLockBucketRetentionPolicy.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -19,7 +19,6 @@ // [START storage_v2_generated_Storage_LockBucketRetentionPolicy_sync] import com.google.storage.v2.Bucket; import com.google.storage.v2.BucketName; -import com.google.storage.v2.CommonRequestParams; import com.google.storage.v2.LockBucketRetentionPolicyRequest; import com.google.storage.v2.StorageClient; @@ -40,7 +39,6 @@ public static void syncLockBucketRetentionPolicy() throws Exception { LockBucketRetentionPolicyRequest.newBuilder() .setBucket(BucketName.of("[PROJECT]", "[BUCKET]").toString()) .setIfMetagenerationMatch(1043427781) - .setCommonRequestParams(CommonRequestParams.newBuilder().build()) .build(); Bucket response = storageClient.lockBucketRetentionPolicy(request); } diff --git a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/lockbucketretentionpolicy/SyncLockBucketRetentionPolicyBucketname.java b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/lockbucketretentionpolicy/SyncLockBucketRetentionPolicyBucketname.java index 975b421c1f..750c4db8e8 100644 --- a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/lockbucketretentionpolicy/SyncLockBucketRetentionPolicyBucketname.java +++ b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/lockbucketretentionpolicy/SyncLockBucketRetentionPolicyBucketname.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/lockbucketretentionpolicy/SyncLockBucketRetentionPolicyString.java b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/lockbucketretentionpolicy/SyncLockBucketRetentionPolicyString.java index 9a368ae767..b756cf66a1 100644 --- a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/lockbucketretentionpolicy/SyncLockBucketRetentionPolicyString.java +++ b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/lockbucketretentionpolicy/SyncLockBucketRetentionPolicyString.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/querywritestatus/AsyncQueryWriteStatus.java b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/querywritestatus/AsyncQueryWriteStatus.java index 920ed5636d..a0cb79eb22 100644 --- a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/querywritestatus/AsyncQueryWriteStatus.java +++ b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/querywritestatus/AsyncQueryWriteStatus.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -19,7 +19,6 @@ // [START storage_v2_generated_Storage_QueryWriteStatus_async] import com.google.api.core.ApiFuture; import com.google.storage.v2.CommonObjectRequestParams; -import com.google.storage.v2.CommonRequestParams; import com.google.storage.v2.QueryWriteStatusRequest; import com.google.storage.v2.QueryWriteStatusResponse; import com.google.storage.v2.StorageClient; @@ -41,7 +40,6 @@ public static void asyncQueryWriteStatus() throws Exception { QueryWriteStatusRequest.newBuilder() .setUploadId("uploadId1563990780") .setCommonObjectRequestParams(CommonObjectRequestParams.newBuilder().build()) - .setCommonRequestParams(CommonRequestParams.newBuilder().build()) .build(); ApiFuture future = storageClient.queryWriteStatusCallable().futureCall(request); diff --git a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/querywritestatus/SyncQueryWriteStatus.java b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/querywritestatus/SyncQueryWriteStatus.java index c6ca964f02..4f1fa43f07 100644 --- a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/querywritestatus/SyncQueryWriteStatus.java +++ b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/querywritestatus/SyncQueryWriteStatus.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -18,7 +18,6 @@ // [START storage_v2_generated_Storage_QueryWriteStatus_sync] import com.google.storage.v2.CommonObjectRequestParams; -import com.google.storage.v2.CommonRequestParams; import com.google.storage.v2.QueryWriteStatusRequest; import com.google.storage.v2.QueryWriteStatusResponse; import com.google.storage.v2.StorageClient; @@ -40,7 +39,6 @@ public static void syncQueryWriteStatus() throws Exception { QueryWriteStatusRequest.newBuilder() .setUploadId("uploadId1563990780") .setCommonObjectRequestParams(CommonObjectRequestParams.newBuilder().build()) - .setCommonRequestParams(CommonRequestParams.newBuilder().build()) .build(); QueryWriteStatusResponse response = storageClient.queryWriteStatus(request); } diff --git a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/querywritestatus/SyncQueryWriteStatusString.java b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/querywritestatus/SyncQueryWriteStatusString.java index edce608da6..0696704e9d 100644 --- a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/querywritestatus/SyncQueryWriteStatusString.java +++ b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/querywritestatus/SyncQueryWriteStatusString.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/readobject/AsyncReadObject.java b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/readobject/AsyncReadObject.java index 9c514c72f7..4ab9032a96 100644 --- a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/readobject/AsyncReadObject.java +++ b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/readobject/AsyncReadObject.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -20,7 +20,6 @@ import com.google.api.gax.rpc.ServerStream; import com.google.protobuf.FieldMask; import com.google.storage.v2.CommonObjectRequestParams; -import com.google.storage.v2.CommonRequestParams; import com.google.storage.v2.ReadObjectRequest; import com.google.storage.v2.ReadObjectResponse; import com.google.storage.v2.StorageClient; @@ -50,7 +49,6 @@ public static void asyncReadObject() throws Exception { .setIfMetagenerationMatch(1043427781) .setIfMetagenerationNotMatch(1025430873) .setCommonObjectRequestParams(CommonObjectRequestParams.newBuilder().build()) - .setCommonRequestParams(CommonRequestParams.newBuilder().build()) .setReadMask(FieldMask.newBuilder().build()) .build(); ServerStream stream = storageClient.readObjectCallable().call(request); diff --git a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/rewriteobject/AsyncRewriteObject.java b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/rewriteobject/AsyncRewriteObject.java index a85b895d7f..357cc6571f 100644 --- a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/rewriteobject/AsyncRewriteObject.java +++ b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/rewriteobject/AsyncRewriteObject.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -21,10 +21,9 @@ import com.google.protobuf.ByteString; import com.google.storage.v2.BucketName; import com.google.storage.v2.CommonObjectRequestParams; -import com.google.storage.v2.CommonRequestParams; import com.google.storage.v2.CryptoKeyName; import com.google.storage.v2.Object; -import com.google.storage.v2.PredefinedObjectAcl; +import com.google.storage.v2.ObjectChecksums; import com.google.storage.v2.RewriteObjectRequest; import com.google.storage.v2.RewriteResponse; import com.google.storage.v2.StorageClient; @@ -54,7 +53,7 @@ public static void asyncRewriteObject() throws Exception { .setSourceObject("sourceObject1196439354") .setSourceGeneration(1232209852) .setRewriteToken("rewriteToken80654285") - .setDestinationPredefinedAcl(PredefinedObjectAcl.forNumber(0)) + .setDestinationPredefinedAcl("destinationPredefinedAcl1111125814") .setIfGenerationMatch(-1086241088) .setIfGenerationNotMatch(1475720404) .setIfMetagenerationMatch(1043427781) @@ -68,7 +67,7 @@ public static void asyncRewriteObject() throws Exception { .setCopySourceEncryptionKeyBytes(ByteString.EMPTY) .setCopySourceEncryptionKeySha256Bytes(ByteString.EMPTY) .setCommonObjectRequestParams(CommonObjectRequestParams.newBuilder().build()) - .setCommonRequestParams(CommonRequestParams.newBuilder().build()) + .setObjectChecksums(ObjectChecksums.newBuilder().build()) .build(); ApiFuture future = storageClient.rewriteObjectCallable().futureCall(request); // Do something. diff --git a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/rewriteobject/SyncRewriteObject.java b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/rewriteobject/SyncRewriteObject.java index b51f59f440..7036458ad5 100644 --- a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/rewriteobject/SyncRewriteObject.java +++ b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/rewriteobject/SyncRewriteObject.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -20,10 +20,9 @@ import com.google.protobuf.ByteString; import com.google.storage.v2.BucketName; import com.google.storage.v2.CommonObjectRequestParams; -import com.google.storage.v2.CommonRequestParams; import com.google.storage.v2.CryptoKeyName; import com.google.storage.v2.Object; -import com.google.storage.v2.PredefinedObjectAcl; +import com.google.storage.v2.ObjectChecksums; import com.google.storage.v2.RewriteObjectRequest; import com.google.storage.v2.RewriteResponse; import com.google.storage.v2.StorageClient; @@ -53,7 +52,7 @@ public static void syncRewriteObject() throws Exception { .setSourceObject("sourceObject1196439354") .setSourceGeneration(1232209852) .setRewriteToken("rewriteToken80654285") - .setDestinationPredefinedAcl(PredefinedObjectAcl.forNumber(0)) + .setDestinationPredefinedAcl("destinationPredefinedAcl1111125814") .setIfGenerationMatch(-1086241088) .setIfGenerationNotMatch(1475720404) .setIfMetagenerationMatch(1043427781) @@ -67,7 +66,7 @@ public static void syncRewriteObject() throws Exception { .setCopySourceEncryptionKeyBytes(ByteString.EMPTY) .setCopySourceEncryptionKeySha256Bytes(ByteString.EMPTY) .setCommonObjectRequestParams(CommonObjectRequestParams.newBuilder().build()) - .setCommonRequestParams(CommonRequestParams.newBuilder().build()) + .setObjectChecksums(ObjectChecksums.newBuilder().build()) .build(); RewriteResponse response = storageClient.rewriteObject(request); } diff --git a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/setiampolicy/AsyncSetIamPolicy.java b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/setiampolicy/AsyncSetIamPolicy.java index d4ee7afcc6..f0bbf36e40 100644 --- a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/setiampolicy/AsyncSetIamPolicy.java +++ b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/setiampolicy/AsyncSetIamPolicy.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -20,6 +20,7 @@ import com.google.api.core.ApiFuture; import com.google.iam.v1.Policy; import com.google.iam.v1.SetIamPolicyRequest; +import com.google.protobuf.FieldMask; import com.google.storage.v2.CryptoKeyName; import com.google.storage.v2.StorageClient; @@ -42,6 +43,7 @@ public static void asyncSetIamPolicy() throws Exception { CryptoKeyName.of("[PROJECT]", "[LOCATION]", "[KEY_RING]", "[CRYPTO_KEY]") .toString()) .setPolicy(Policy.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) .build(); ApiFuture future = storageClient.setIamPolicyCallable().futureCall(request); // Do something. diff --git a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/setiampolicy/SyncSetIamPolicy.java b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/setiampolicy/SyncSetIamPolicy.java index 83ce240bc6..3293adfe7d 100644 --- a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/setiampolicy/SyncSetIamPolicy.java +++ b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/setiampolicy/SyncSetIamPolicy.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -19,6 +19,7 @@ // [START storage_v2_generated_Storage_SetIamPolicy_sync] import com.google.iam.v1.Policy; import com.google.iam.v1.SetIamPolicyRequest; +import com.google.protobuf.FieldMask; import com.google.storage.v2.CryptoKeyName; import com.google.storage.v2.StorageClient; @@ -41,6 +42,7 @@ public static void syncSetIamPolicy() throws Exception { CryptoKeyName.of("[PROJECT]", "[LOCATION]", "[KEY_RING]", "[CRYPTO_KEY]") .toString()) .setPolicy(Policy.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) .build(); Policy response = storageClient.setIamPolicy(request); } diff --git a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/setiampolicy/SyncSetIamPolicyResourcenamePolicy.java b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/setiampolicy/SyncSetIamPolicyResourcenamePolicy.java index b8c315d928..74e2b39658 100644 --- a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/setiampolicy/SyncSetIamPolicyResourcenamePolicy.java +++ b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/setiampolicy/SyncSetIamPolicyResourcenamePolicy.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/setiampolicy/SyncSetIamPolicyStringPolicy.java b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/setiampolicy/SyncSetIamPolicyStringPolicy.java index 39e5e74725..fe9e08542d 100644 --- a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/setiampolicy/SyncSetIamPolicyStringPolicy.java +++ b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/setiampolicy/SyncSetIamPolicyStringPolicy.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/startresumablewrite/AsyncStartResumableWrite.java b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/startresumablewrite/AsyncStartResumableWrite.java index 6475b7054e..88bd67e77b 100644 --- a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/startresumablewrite/AsyncStartResumableWrite.java +++ b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/startresumablewrite/AsyncStartResumableWrite.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -19,7 +19,7 @@ // [START storage_v2_generated_Storage_StartResumableWrite_async] import com.google.api.core.ApiFuture; import com.google.storage.v2.CommonObjectRequestParams; -import com.google.storage.v2.CommonRequestParams; +import com.google.storage.v2.ObjectChecksums; import com.google.storage.v2.StartResumableWriteRequest; import com.google.storage.v2.StartResumableWriteResponse; import com.google.storage.v2.StorageClient; @@ -42,7 +42,7 @@ public static void asyncStartResumableWrite() throws Exception { StartResumableWriteRequest.newBuilder() .setWriteObjectSpec(WriteObjectSpec.newBuilder().build()) .setCommonObjectRequestParams(CommonObjectRequestParams.newBuilder().build()) - .setCommonRequestParams(CommonRequestParams.newBuilder().build()) + .setObjectChecksums(ObjectChecksums.newBuilder().build()) .build(); ApiFuture future = storageClient.startResumableWriteCallable().futureCall(request); diff --git a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/startresumablewrite/SyncStartResumableWrite.java b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/startresumablewrite/SyncStartResumableWrite.java index 3b707f8b52..c1971f51e6 100644 --- a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/startresumablewrite/SyncStartResumableWrite.java +++ b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/startresumablewrite/SyncStartResumableWrite.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -18,7 +18,7 @@ // [START storage_v2_generated_Storage_StartResumableWrite_sync] import com.google.storage.v2.CommonObjectRequestParams; -import com.google.storage.v2.CommonRequestParams; +import com.google.storage.v2.ObjectChecksums; import com.google.storage.v2.StartResumableWriteRequest; import com.google.storage.v2.StartResumableWriteResponse; import com.google.storage.v2.StorageClient; @@ -41,7 +41,7 @@ public static void syncStartResumableWrite() throws Exception { StartResumableWriteRequest.newBuilder() .setWriteObjectSpec(WriteObjectSpec.newBuilder().build()) .setCommonObjectRequestParams(CommonObjectRequestParams.newBuilder().build()) - .setCommonRequestParams(CommonRequestParams.newBuilder().build()) + .setObjectChecksums(ObjectChecksums.newBuilder().build()) .build(); StartResumableWriteResponse response = storageClient.startResumableWrite(request); } diff --git a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/testiampermissions/AsyncTestIamPermissions.java b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/testiampermissions/AsyncTestIamPermissions.java index c8eb1c9640..4e2dabc45c 100644 --- a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/testiampermissions/AsyncTestIamPermissions.java +++ b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/testiampermissions/AsyncTestIamPermissions.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/testiampermissions/SyncTestIamPermissions.java b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/testiampermissions/SyncTestIamPermissions.java index dae7ffbb49..a035fd01b8 100644 --- a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/testiampermissions/SyncTestIamPermissions.java +++ b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/testiampermissions/SyncTestIamPermissions.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/testiampermissions/SyncTestIamPermissionsResourcenameListstring.java b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/testiampermissions/SyncTestIamPermissionsResourcenameListstring.java index fe6593f2b1..acec3a5793 100644 --- a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/testiampermissions/SyncTestIamPermissionsResourcenameListstring.java +++ b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/testiampermissions/SyncTestIamPermissionsResourcenameListstring.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/testiampermissions/SyncTestIamPermissionsStringListstring.java b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/testiampermissions/SyncTestIamPermissionsStringListstring.java index 607b2ed2a4..069749c84e 100644 --- a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/testiampermissions/SyncTestIamPermissionsStringListstring.java +++ b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/testiampermissions/SyncTestIamPermissionsStringListstring.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/updatebucket/AsyncUpdateBucket.java b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/updatebucket/AsyncUpdateBucket.java index 0c093f5357..8accb98ca7 100644 --- a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/updatebucket/AsyncUpdateBucket.java +++ b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/updatebucket/AsyncUpdateBucket.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -20,9 +20,6 @@ import com.google.api.core.ApiFuture; import com.google.protobuf.FieldMask; import com.google.storage.v2.Bucket; -import com.google.storage.v2.CommonRequestParams; -import com.google.storage.v2.PredefinedBucketAcl; -import com.google.storage.v2.PredefinedObjectAcl; import com.google.storage.v2.StorageClient; import com.google.storage.v2.UpdateBucketRequest; @@ -44,10 +41,9 @@ public static void asyncUpdateBucket() throws Exception { .setBucket(Bucket.newBuilder().build()) .setIfMetagenerationMatch(1043427781) .setIfMetagenerationNotMatch(1025430873) - .setPredefinedAcl(PredefinedBucketAcl.forNumber(0)) - .setPredefinedDefaultObjectAcl(PredefinedObjectAcl.forNumber(0)) + .setPredefinedAcl("predefinedAcl1207041188") + .setPredefinedDefaultObjectAcl("predefinedDefaultObjectAcl2109168048") .setUpdateMask(FieldMask.newBuilder().build()) - .setCommonRequestParams(CommonRequestParams.newBuilder().build()) .build(); ApiFuture future = storageClient.updateBucketCallable().futureCall(request); // Do something. diff --git a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/updatebucket/SyncUpdateBucket.java b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/updatebucket/SyncUpdateBucket.java index af6de69a6a..c3f28715ec 100644 --- a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/updatebucket/SyncUpdateBucket.java +++ b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/updatebucket/SyncUpdateBucket.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -19,9 +19,6 @@ // [START storage_v2_generated_Storage_UpdateBucket_sync] import com.google.protobuf.FieldMask; import com.google.storage.v2.Bucket; -import com.google.storage.v2.CommonRequestParams; -import com.google.storage.v2.PredefinedBucketAcl; -import com.google.storage.v2.PredefinedObjectAcl; import com.google.storage.v2.StorageClient; import com.google.storage.v2.UpdateBucketRequest; @@ -43,10 +40,9 @@ public static void syncUpdateBucket() throws Exception { .setBucket(Bucket.newBuilder().build()) .setIfMetagenerationMatch(1043427781) .setIfMetagenerationNotMatch(1025430873) - .setPredefinedAcl(PredefinedBucketAcl.forNumber(0)) - .setPredefinedDefaultObjectAcl(PredefinedObjectAcl.forNumber(0)) + .setPredefinedAcl("predefinedAcl1207041188") + .setPredefinedDefaultObjectAcl("predefinedDefaultObjectAcl2109168048") .setUpdateMask(FieldMask.newBuilder().build()) - .setCommonRequestParams(CommonRequestParams.newBuilder().build()) .build(); Bucket response = storageClient.updateBucket(request); } diff --git a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/updatebucket/SyncUpdateBucketBucketFieldmask.java b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/updatebucket/SyncUpdateBucketBucketFieldmask.java index def1e336a3..4c041d4071 100644 --- a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/updatebucket/SyncUpdateBucketBucketFieldmask.java +++ b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/updatebucket/SyncUpdateBucketBucketFieldmask.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/updatehmackey/AsyncUpdateHmacKey.java b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/updatehmackey/AsyncUpdateHmacKey.java index e64d3b00af..82f669dc69 100644 --- a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/updatehmackey/AsyncUpdateHmacKey.java +++ b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/updatehmackey/AsyncUpdateHmacKey.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -19,7 +19,6 @@ // [START storage_v2_generated_Storage_UpdateHmacKey_async] import com.google.api.core.ApiFuture; import com.google.protobuf.FieldMask; -import com.google.storage.v2.CommonRequestParams; import com.google.storage.v2.HmacKeyMetadata; import com.google.storage.v2.StorageClient; import com.google.storage.v2.UpdateHmacKeyRequest; @@ -40,7 +39,6 @@ public static void asyncUpdateHmacKey() throws Exception { UpdateHmacKeyRequest request = UpdateHmacKeyRequest.newBuilder() .setHmacKey(HmacKeyMetadata.newBuilder().build()) - .setCommonRequestParams(CommonRequestParams.newBuilder().build()) .setUpdateMask(FieldMask.newBuilder().build()) .build(); ApiFuture future = storageClient.updateHmacKeyCallable().futureCall(request); diff --git a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/updatehmackey/SyncUpdateHmacKey.java b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/updatehmackey/SyncUpdateHmacKey.java index 315cefd0cd..da0860c8f3 100644 --- a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/updatehmackey/SyncUpdateHmacKey.java +++ b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/updatehmackey/SyncUpdateHmacKey.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -18,7 +18,6 @@ // [START storage_v2_generated_Storage_UpdateHmacKey_sync] import com.google.protobuf.FieldMask; -import com.google.storage.v2.CommonRequestParams; import com.google.storage.v2.HmacKeyMetadata; import com.google.storage.v2.StorageClient; import com.google.storage.v2.UpdateHmacKeyRequest; @@ -39,7 +38,6 @@ public static void syncUpdateHmacKey() throws Exception { UpdateHmacKeyRequest request = UpdateHmacKeyRequest.newBuilder() .setHmacKey(HmacKeyMetadata.newBuilder().build()) - .setCommonRequestParams(CommonRequestParams.newBuilder().build()) .setUpdateMask(FieldMask.newBuilder().build()) .build(); HmacKeyMetadata response = storageClient.updateHmacKey(request); diff --git a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/updatehmackey/SyncUpdateHmacKeyHmackeymetadataFieldmask.java b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/updatehmackey/SyncUpdateHmacKeyHmackeymetadataFieldmask.java index 188f04a358..e5480ab668 100644 --- a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/updatehmackey/SyncUpdateHmacKeyHmackeymetadataFieldmask.java +++ b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/updatehmackey/SyncUpdateHmacKeyHmackeymetadataFieldmask.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/updateobject/AsyncUpdateObject.java b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/updateobject/AsyncUpdateObject.java index a91c083c6c..c3cd9b0123 100644 --- a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/updateobject/AsyncUpdateObject.java +++ b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/updateobject/AsyncUpdateObject.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -20,9 +20,7 @@ import com.google.api.core.ApiFuture; import com.google.protobuf.FieldMask; import com.google.storage.v2.CommonObjectRequestParams; -import com.google.storage.v2.CommonRequestParams; import com.google.storage.v2.Object; -import com.google.storage.v2.PredefinedObjectAcl; import com.google.storage.v2.StorageClient; import com.google.storage.v2.UpdateObjectRequest; @@ -46,10 +44,9 @@ public static void asyncUpdateObject() throws Exception { .setIfGenerationNotMatch(1475720404) .setIfMetagenerationMatch(1043427781) .setIfMetagenerationNotMatch(1025430873) - .setPredefinedAcl(PredefinedObjectAcl.forNumber(0)) + .setPredefinedAcl("predefinedAcl1207041188") .setUpdateMask(FieldMask.newBuilder().build()) .setCommonObjectRequestParams(CommonObjectRequestParams.newBuilder().build()) - .setCommonRequestParams(CommonRequestParams.newBuilder().build()) .build(); ApiFuture future = storageClient.updateObjectCallable().futureCall(request); // Do something. diff --git a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/updateobject/SyncUpdateObject.java b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/updateobject/SyncUpdateObject.java index e5dbbf698a..f5a319382b 100644 --- a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/updateobject/SyncUpdateObject.java +++ b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/updateobject/SyncUpdateObject.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -19,9 +19,7 @@ // [START storage_v2_generated_Storage_UpdateObject_sync] import com.google.protobuf.FieldMask; import com.google.storage.v2.CommonObjectRequestParams; -import com.google.storage.v2.CommonRequestParams; import com.google.storage.v2.Object; -import com.google.storage.v2.PredefinedObjectAcl; import com.google.storage.v2.StorageClient; import com.google.storage.v2.UpdateObjectRequest; @@ -45,10 +43,9 @@ public static void syncUpdateObject() throws Exception { .setIfGenerationNotMatch(1475720404) .setIfMetagenerationMatch(1043427781) .setIfMetagenerationNotMatch(1025430873) - .setPredefinedAcl(PredefinedObjectAcl.forNumber(0)) + .setPredefinedAcl("predefinedAcl1207041188") .setUpdateMask(FieldMask.newBuilder().build()) .setCommonObjectRequestParams(CommonObjectRequestParams.newBuilder().build()) - .setCommonRequestParams(CommonRequestParams.newBuilder().build()) .build(); Object response = storageClient.updateObject(request); } diff --git a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/updateobject/SyncUpdateObjectObjectFieldmask.java b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/updateobject/SyncUpdateObjectObjectFieldmask.java index c33865a01e..c4222c6bae 100644 --- a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/updateobject/SyncUpdateObjectObjectFieldmask.java +++ b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/updateobject/SyncUpdateObjectObjectFieldmask.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/writeobject/AsyncWriteObject.java b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/writeobject/AsyncWriteObject.java index 15ab73a6aa..dae24a8f8e 100644 --- a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/writeobject/AsyncWriteObject.java +++ b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storage/writeobject/AsyncWriteObject.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -19,7 +19,6 @@ // [START storage_v2_generated_Storage_WriteObject_async] import com.google.api.gax.rpc.ApiStreamObserver; import com.google.storage.v2.CommonObjectRequestParams; -import com.google.storage.v2.CommonRequestParams; import com.google.storage.v2.ObjectChecksums; import com.google.storage.v2.StorageClient; import com.google.storage.v2.WriteObjectRequest; @@ -63,7 +62,6 @@ public void onCompleted() { .setObjectChecksums(ObjectChecksums.newBuilder().build()) .setFinishWrite(true) .setCommonObjectRequestParams(CommonObjectRequestParams.newBuilder().build()) - .setCommonRequestParams(CommonRequestParams.newBuilder().build()) .build(); requestObserver.onNext(request); } diff --git a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storagesettings/deletebucket/SyncDeleteBucket.java b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storagesettings/deletebucket/SyncDeleteBucket.java index 22d518e905..7ec51a3fa1 100644 --- a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storagesettings/deletebucket/SyncDeleteBucket.java +++ b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storagesettings/deletebucket/SyncDeleteBucket.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -40,7 +40,14 @@ public static void syncDeleteBucket() throws Exception { .deleteBucketSettings() .getRetrySettings() .toBuilder() - .setTotalTimeout(Duration.ofSeconds(30)) + .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()); StorageSettings storageSettings = storageSettingsBuilder.build(); } diff --git a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/stub/storagestubsettings/deletebucket/SyncDeleteBucket.java b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/stub/storagestubsettings/deletebucket/SyncDeleteBucket.java index 73a1bc3c2b..ff1d6d5656 100644 --- a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/stub/storagestubsettings/deletebucket/SyncDeleteBucket.java +++ b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/stub/storagestubsettings/deletebucket/SyncDeleteBucket.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -40,7 +40,14 @@ public static void syncDeleteBucket() throws Exception { .deleteBucketSettings() .getRetrySettings() .toBuilder() - .setTotalTimeout(Duration.ofSeconds(30)) + .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()); StorageStubSettings storageSettings = storageSettingsBuilder.build(); } diff --git a/test/integration/goldens/storage/src/META-INF/native-image/com.google.storage.v2/reflect-config.json b/test/integration/goldens/storage/src/META-INF/native-image/com.google.storage.v2/reflect-config.json new file mode 100644 index 0000000000..bf86e8bc59 --- /dev/null +++ b/test/integration/goldens/storage/src/META-INF/native-image/com.google.storage.v2/reflect-config.json @@ -0,0 +1,2783 @@ +[ + { + "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.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.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.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.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.RoutingParameter", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.RoutingParameter$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.RoutingRule", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.RoutingRule$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.iam.v1.AuditConfig", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.iam.v1.AuditConfig$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.iam.v1.AuditConfigDelta", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.iam.v1.AuditConfigDelta$Action", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.iam.v1.AuditConfigDelta$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.iam.v1.AuditLogConfig", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.iam.v1.AuditLogConfig$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.iam.v1.AuditLogConfig$LogType", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.iam.v1.Binding", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.iam.v1.Binding$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.iam.v1.BindingDelta", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.iam.v1.BindingDelta$Action", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.iam.v1.BindingDelta$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.iam.v1.GetIamPolicyRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.iam.v1.GetIamPolicyRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.iam.v1.GetPolicyOptions", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.iam.v1.GetPolicyOptions$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.iam.v1.Policy", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.iam.v1.Policy$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.iam.v1.PolicyDelta", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.iam.v1.PolicyDelta$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.iam.v1.SetIamPolicyRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.iam.v1.SetIamPolicyRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.iam.v1.TestIamPermissionsRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.iam.v1.TestIamPermissionsRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.iam.v1.TestIamPermissionsResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.iam.v1.TestIamPermissionsResponse$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.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.storage.v2.Bucket", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.storage.v2.Bucket$Autoclass", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.storage.v2.Bucket$Autoclass$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.storage.v2.Bucket$Billing", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.storage.v2.Bucket$Billing$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.storage.v2.Bucket$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.storage.v2.Bucket$Cors", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.storage.v2.Bucket$Cors$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.storage.v2.Bucket$CustomPlacementConfig", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.storage.v2.Bucket$CustomPlacementConfig$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.storage.v2.Bucket$Encryption", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.storage.v2.Bucket$Encryption$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.storage.v2.Bucket$IamConfig", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.storage.v2.Bucket$IamConfig$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.storage.v2.Bucket$IamConfig$UniformBucketLevelAccess", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.storage.v2.Bucket$IamConfig$UniformBucketLevelAccess$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.storage.v2.Bucket$Lifecycle", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.storage.v2.Bucket$Lifecycle$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.storage.v2.Bucket$Lifecycle$Rule", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.storage.v2.Bucket$Lifecycle$Rule$Action", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.storage.v2.Bucket$Lifecycle$Rule$Action$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.storage.v2.Bucket$Lifecycle$Rule$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.storage.v2.Bucket$Lifecycle$Rule$Condition", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.storage.v2.Bucket$Lifecycle$Rule$Condition$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.storage.v2.Bucket$Logging", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.storage.v2.Bucket$Logging$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.storage.v2.Bucket$RetentionPolicy", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.storage.v2.Bucket$RetentionPolicy$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.storage.v2.Bucket$Versioning", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.storage.v2.Bucket$Versioning$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.storage.v2.Bucket$Website", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.storage.v2.Bucket$Website$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.storage.v2.BucketAccessControl", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.storage.v2.BucketAccessControl$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.storage.v2.CancelResumableWriteRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.storage.v2.CancelResumableWriteRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.storage.v2.CancelResumableWriteResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.storage.v2.CancelResumableWriteResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.storage.v2.ChecksummedData", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.storage.v2.ChecksummedData$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.storage.v2.CommonObjectRequestParams", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.storage.v2.CommonObjectRequestParams$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.storage.v2.ComposeObjectRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.storage.v2.ComposeObjectRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.storage.v2.ComposeObjectRequest$SourceObject", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.storage.v2.ComposeObjectRequest$SourceObject$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.storage.v2.ComposeObjectRequest$SourceObject$ObjectPreconditions", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.storage.v2.ComposeObjectRequest$SourceObject$ObjectPreconditions$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.storage.v2.ContentRange", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.storage.v2.ContentRange$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.storage.v2.CreateBucketRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.storage.v2.CreateBucketRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.storage.v2.CreateHmacKeyRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.storage.v2.CreateHmacKeyRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.storage.v2.CreateHmacKeyResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.storage.v2.CreateHmacKeyResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.storage.v2.CreateNotificationRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.storage.v2.CreateNotificationRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.storage.v2.CustomerEncryption", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.storage.v2.CustomerEncryption$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.storage.v2.DeleteBucketRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.storage.v2.DeleteBucketRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.storage.v2.DeleteHmacKeyRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.storage.v2.DeleteHmacKeyRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.storage.v2.DeleteNotificationRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.storage.v2.DeleteNotificationRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.storage.v2.DeleteObjectRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.storage.v2.DeleteObjectRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.storage.v2.GetBucketRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.storage.v2.GetBucketRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.storage.v2.GetHmacKeyRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.storage.v2.GetHmacKeyRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.storage.v2.GetNotificationRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.storage.v2.GetNotificationRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.storage.v2.GetObjectRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.storage.v2.GetObjectRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.storage.v2.GetServiceAccountRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.storage.v2.GetServiceAccountRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.storage.v2.HmacKeyMetadata", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.storage.v2.HmacKeyMetadata$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.storage.v2.ListBucketsRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.storage.v2.ListBucketsRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.storage.v2.ListBucketsResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.storage.v2.ListBucketsResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.storage.v2.ListHmacKeysRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.storage.v2.ListHmacKeysRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.storage.v2.ListHmacKeysResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.storage.v2.ListHmacKeysResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.storage.v2.ListNotificationsRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.storage.v2.ListNotificationsRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.storage.v2.ListNotificationsResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.storage.v2.ListNotificationsResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.storage.v2.ListObjectsRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.storage.v2.ListObjectsRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.storage.v2.ListObjectsResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.storage.v2.ListObjectsResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.storage.v2.LockBucketRetentionPolicyRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.storage.v2.LockBucketRetentionPolicyRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.storage.v2.Notification", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.storage.v2.Notification$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.storage.v2.Object", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.storage.v2.Object$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.storage.v2.ObjectAccessControl", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.storage.v2.ObjectAccessControl$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.storage.v2.ObjectChecksums", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.storage.v2.ObjectChecksums$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.storage.v2.Owner", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.storage.v2.Owner$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.storage.v2.ProjectTeam", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.storage.v2.ProjectTeam$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.storage.v2.QueryWriteStatusRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.storage.v2.QueryWriteStatusRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.storage.v2.QueryWriteStatusResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.storage.v2.QueryWriteStatusResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.storage.v2.ReadObjectRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.storage.v2.ReadObjectRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.storage.v2.ReadObjectResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.storage.v2.ReadObjectResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.storage.v2.RewriteObjectRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.storage.v2.RewriteObjectRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.storage.v2.RewriteResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.storage.v2.RewriteResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.storage.v2.ServiceAccount", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.storage.v2.ServiceAccount$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.storage.v2.ServiceConstants", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.storage.v2.ServiceConstants$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.storage.v2.ServiceConstants$Values", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.storage.v2.StartResumableWriteRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.storage.v2.StartResumableWriteRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.storage.v2.StartResumableWriteResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.storage.v2.StartResumableWriteResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.storage.v2.UpdateBucketRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.storage.v2.UpdateBucketRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.storage.v2.UpdateHmacKeyRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.storage.v2.UpdateHmacKeyRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.storage.v2.UpdateObjectRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.storage.v2.UpdateObjectRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.storage.v2.WriteObjectRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.storage.v2.WriteObjectRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.storage.v2.WriteObjectResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.storage.v2.WriteObjectResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.storage.v2.WriteObjectSpec", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.storage.v2.WriteObjectSpec$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.type.Date", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.type.Date$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.type.Expr", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.type.Expr$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + } +] \ No newline at end of file diff --git a/test/integration/goldens/storage/src/com/google/storage/v2/BucketName.java b/test/integration/goldens/storage/src/com/google/storage/v2/BucketName.java index f53865e272..67619b665f 100644 --- a/test/integration/goldens/storage/src/com/google/storage/v2/BucketName.java +++ b/test/integration/goldens/storage/src/com/google/storage/v2/BucketName.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -137,7 +137,7 @@ public boolean equals(java.lang.Object o) { if (o == this) { return true; } - if (o != null || getClass() == o.getClass()) { + if (o != null && getClass() == o.getClass()) { BucketName that = ((BucketName) o); return Objects.equals(this.project, that.project) && Objects.equals(this.bucket, that.bucket); } diff --git a/test/integration/goldens/storage/src/com/google/storage/v2/CryptoKeyName.java b/test/integration/goldens/storage/src/com/google/storage/v2/CryptoKeyName.java index 99a5046120..f10da50fb9 100644 --- a/test/integration/goldens/storage/src/com/google/storage/v2/CryptoKeyName.java +++ b/test/integration/goldens/storage/src/com/google/storage/v2/CryptoKeyName.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -175,7 +175,7 @@ public boolean equals(java.lang.Object o) { if (o == this) { return true; } - if (o != null || getClass() == o.getClass()) { + if (o != null && getClass() == o.getClass()) { CryptoKeyName that = ((CryptoKeyName) o); return Objects.equals(this.project, that.project) && Objects.equals(this.location, that.location) diff --git a/test/integration/goldens/storage/src/com/google/storage/v2/MockStorage.java b/test/integration/goldens/storage/src/com/google/storage/v2/MockStorage.java index bd53f4d3a4..37179e5870 100644 --- a/test/integration/goldens/storage/src/com/google/storage/v2/MockStorage.java +++ b/test/integration/goldens/storage/src/com/google/storage/v2/MockStorage.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/storage/src/com/google/storage/v2/MockStorageImpl.java b/test/integration/goldens/storage/src/com/google/storage/v2/MockStorageImpl.java index ba41a020ae..263c57bff5 100644 --- a/test/integration/goldens/storage/src/com/google/storage/v2/MockStorageImpl.java +++ b/test/integration/goldens/storage/src/com/google/storage/v2/MockStorageImpl.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -373,6 +373,28 @@ public void deleteObject(DeleteObjectRequest request, StreamObserver resp } } + @Override + public void cancelResumableWrite( + CancelResumableWriteRequest request, + StreamObserver responseObserver) { + java.lang.Object response = responses.poll(); + if (response instanceof CancelResumableWriteResponse) { + requests.add(request); + responseObserver.onNext(((CancelResumableWriteResponse) 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 CancelResumableWrite, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + CancelResumableWriteResponse.class.getName(), + Exception.class.getName()))); + } + } + @Override public void getObject(GetObjectRequest request, StreamObserver responseObserver) { java.lang.Object response = responses.poll(); diff --git a/test/integration/goldens/storage/src/com/google/storage/v2/NotificationName.java b/test/integration/goldens/storage/src/com/google/storage/v2/NotificationName.java index 0476d45605..f69d2add31 100644 --- a/test/integration/goldens/storage/src/com/google/storage/v2/NotificationName.java +++ b/test/integration/goldens/storage/src/com/google/storage/v2/NotificationName.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -154,7 +154,7 @@ public boolean equals(java.lang.Object o) { if (o == this) { return true; } - if (o != null || getClass() == o.getClass()) { + if (o != null && getClass() == o.getClass()) { NotificationName that = ((NotificationName) o); return Objects.equals(this.project, that.project) && Objects.equals(this.bucket, that.bucket) diff --git a/test/integration/goldens/storage/src/com/google/storage/v2/ProjectName.java b/test/integration/goldens/storage/src/com/google/storage/v2/ProjectName.java index 67568b522e..813ee08794 100644 --- a/test/integration/goldens/storage/src/com/google/storage/v2/ProjectName.java +++ b/test/integration/goldens/storage/src/com/google/storage/v2/ProjectName.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -127,7 +127,7 @@ public boolean equals(java.lang.Object o) { if (o == this) { return true; } - if (o != null || getClass() == o.getClass()) { + if (o != null && getClass() == o.getClass()) { ProjectName that = ((ProjectName) o); return Objects.equals(this.project, that.project); } diff --git a/test/integration/goldens/storage/src/com/google/storage/v2/StorageClient.java b/test/integration/goldens/storage/src/com/google/storage/v2/StorageClient.java index d99d3331c3..a5dfd3ca29 100644 --- a/test/integration/goldens/storage/src/com/google/storage/v2/StorageClient.java +++ b/test/integration/goldens/storage/src/com/google/storage/v2/StorageClient.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -78,19 +78,556 @@ *

        Note: close() needs to be called on the StorageClient object to clean up resources such as * threads. In the example above, try-with-resources is used, which automatically calls close(). * - *

        The surface of this class includes several types of Java methods for each of the API's - * methods: - * - *

          - *
        1. A "flattened" method. With this type of method, the fields of the request type have been - * converted into function parameters. It may be the case that not all fields are available as - * parameters, and not every API method will have a flattened method entry point. - *
        2. A "request object" method. This type of method only takes one parameter, a request object, - * which must be constructed before the call. Not every API method will have a request object - * method. - *
        3. A "callable" method. This type of method takes no parameters and returns an immutable API - * callable object, which can be used to initiate calls to the service. - *
        + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + *
        Methods
        MethodDescriptionMethod Variants

        DeleteBucket

        Permanently deletes an empty bucket.

        + *

        Request object method variants only take one parameter, a request object, which must be constructed before the call.

        + *
          + *
        • deleteBucket(DeleteBucketRequest request) + *

        + *

        "Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

        + *
          + *
        • deleteBucket(BucketName name) + *

        • deleteBucket(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.

        + *
          + *
        • deleteBucketCallable() + *

        + *

        GetBucket

        Returns metadata for the specified bucket.

        + *

        Request object method variants only take one parameter, a request object, which must be constructed before the call.

        + *
          + *
        • getBucket(GetBucketRequest request) + *

        + *

        "Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

        + *
          + *
        • getBucket(BucketName name) + *

        • getBucket(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.

        + *
          + *
        • getBucketCallable() + *

        + *

        CreateBucket

        Creates a new bucket.

        + *

        Request object method variants only take one parameter, a request object, which must be constructed before the call.

        + *
          + *
        • createBucket(CreateBucketRequest request) + *

        + *

        "Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

        + *
          + *
        • createBucket(ProjectName parent, Bucket bucket, String bucketId) + *

        • createBucket(String parent, Bucket bucket, String bucketId) + *

        + *

        Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

        + *
          + *
        • createBucketCallable() + *

        + *

        ListBuckets

        Retrieves a list of buckets for a given project.

        + *

        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(ProjectName 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() + *

        + *

        LockBucketRetentionPolicy

        Locks retention policy on a bucket.

        + *

        Request object method variants only take one parameter, a request object, which must be constructed before the call.

        + *
          + *
        • lockBucketRetentionPolicy(LockBucketRetentionPolicyRequest request) + *

        + *

        "Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

        + *
          + *
        • lockBucketRetentionPolicy(BucketName bucket) + *

        • lockBucketRetentionPolicy(String bucket) + *

        + *

        Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

        + *
          + *
        • lockBucketRetentionPolicyCallable() + *

        + *

        GetIamPolicy

        Gets the IAM policy for a specified bucket or object. The `resource` field in the request should be projects/_/buckets/<bucket_name> for a bucket or projects/_/buckets/<bucket_name>/objects/<object_name> for an object.

        + *

        Request object method variants only take one parameter, a request object, which must be constructed before the call.

        + *
          + *
        • getIamPolicy(GetIamPolicyRequest request) + *

        + *

        "Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

        + *
          + *
        • getIamPolicy(ResourceName resource) + *

        • getIamPolicy(String resource) + *

        + *

        Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

        + *
          + *
        • getIamPolicyCallable() + *

        + *

        SetIamPolicy

        Updates an IAM policy for the specified bucket or object. The `resource` field in the request should be projects/_/buckets/<bucket_name> for a bucket or projects/_/buckets/<bucket_name>/objects/<object_name> for an object.

        + *

        Request object method variants only take one parameter, a request object, which must be constructed before the call.

        + *
          + *
        • setIamPolicy(SetIamPolicyRequest request) + *

        + *

        "Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

        + *
          + *
        • setIamPolicy(ResourceName resource, Policy policy) + *

        • setIamPolicy(String resource, Policy policy) + *

        + *

        Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

        + *
          + *
        • setIamPolicyCallable() + *

        + *

        TestIamPermissions

        Tests a set of permissions on the given bucket or object to see which, if any, are held by the caller. The `resource` field in the request should be projects/_/buckets/<bucket_name> for a bucket or projects/_/buckets/<bucket_name>/objects/<object_name> for an object.

        + *

        Request object method variants only take one parameter, a request object, which must be constructed before the call.

        + *
          + *
        • testIamPermissions(TestIamPermissionsRequest request) + *

        + *

        "Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

        + *
          + *
        • testIamPermissions(ResourceName resource, List<String> permissions) + *

        • testIamPermissions(String resource, List<String> permissions) + *

        + *

        Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

        + *
          + *
        • testIamPermissionsCallable() + *

        + *

        UpdateBucket

        Updates a bucket. Equivalent to JSON API's storage.buckets.patch method.

        + *

        Request object method variants only take one parameter, a request object, which must be constructed before the call.

        + *
          + *
        • updateBucket(UpdateBucketRequest request) + *

        + *

        "Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

        + *
          + *
        • updateBucket(Bucket bucket, 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.

        + *
          + *
        • updateBucketCallable() + *

        + *

        DeleteNotification

        Permanently deletes a notification subscription.

        + *

        Request object method variants only take one parameter, a request object, which must be constructed before the call.

        + *
          + *
        • deleteNotification(DeleteNotificationRequest request) + *

        + *

        "Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

        + *
          + *
        • deleteNotification(NotificationName name) + *

        • deleteNotification(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.

        + *
          + *
        • deleteNotificationCallable() + *

        + *

        GetNotification

        View a notification config.

        + *

        Request object method variants only take one parameter, a request object, which must be constructed before the call.

        + *
          + *
        • getNotification(GetNotificationRequest request) + *

        + *

        "Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

        + *
          + *
        • getNotification(BucketName name) + *

        • getNotification(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.

        + *
          + *
        • getNotificationCallable() + *

        + *

        CreateNotification

        Creates a notification subscription for a given bucket. These notifications, when triggered, publish messages to the specified Pub/Sub topics. See https://cloud.google.com/storage/docs/pubsub-notifications.

        + *

        Request object method variants only take one parameter, a request object, which must be constructed before the call.

        + *
          + *
        • createNotification(CreateNotificationRequest request) + *

        + *

        "Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

        + *
          + *
        • createNotification(ProjectName parent, Notification notification) + *

        • createNotification(String parent, Notification notification) + *

        + *

        Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

        + *
          + *
        • createNotificationCallable() + *

        + *

        ListNotifications

        Retrieves a list of notification subscriptions for a given bucket.

        + *

        Request object method variants only take one parameter, a request object, which must be constructed before the call.

        + *
          + *
        • listNotifications(ListNotificationsRequest request) + *

        + *

        "Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

        + *
          + *
        • listNotifications(ProjectName parent) + *

        • listNotifications(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.

        + *
          + *
        • listNotificationsPagedCallable() + *

        • listNotificationsCallable() + *

        + *

        ComposeObject

        Concatenates a list of existing objects into a new object in the same bucket.

        + *

        Request object method variants only take one parameter, a request object, which must be constructed before the call.

        + *
          + *
        • composeObject(ComposeObjectRequest request) + *

        + *

        Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

        + *
          + *
        • composeObjectCallable() + *

        + *

        DeleteObject

        Deletes an object and its metadata. Deletions are permanent if versioning is not enabled for the bucket, or if the `generation` parameter is used.

        + *

        Request object method variants only take one parameter, a request object, which must be constructed before the call.

        + *
          + *
        • deleteObject(DeleteObjectRequest request) + *

        + *

        "Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

        + *
          + *
        • deleteObject(String bucket, String object) + *

        • deleteObject(String bucket, String object, long generation) + *

        + *

        Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

        + *
          + *
        • deleteObjectCallable() + *

        + *

        CancelResumableWrite

        Cancels an in-progress resumable upload.

        + *

        Request object method variants only take one parameter, a request object, which must be constructed before the call.

        + *
          + *
        • cancelResumableWrite(CancelResumableWriteRequest request) + *

        + *

        "Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

        + *
          + *
        • cancelResumableWrite(String uploadId) + *

        + *

        Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

        + *
          + *
        • cancelResumableWriteCallable() + *

        + *

        GetObject

        Retrieves an object's metadata.

        + *

        Request object method variants only take one parameter, a request object, which must be constructed before the call.

        + *
          + *
        • getObject(GetObjectRequest request) + *

        + *

        "Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

        + *
          + *
        • getObject(String bucket, String object) + *

        • getObject(String bucket, String object, long generation) + *

        + *

        Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

        + *
          + *
        • getObjectCallable() + *

        + *

        ReadObject

        Reads an object's data.

        + *

        Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

        + *
          + *
        • readObjectCallable() + *

        + *

        UpdateObject

        Updates an object's metadata. Equivalent to JSON API's storage.objects.patch.

        + *

        Request object method variants only take one parameter, a request object, which must be constructed before the call.

        + *
          + *
        • updateObject(UpdateObjectRequest request) + *

        + *

        "Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

        + *
          + *
        • updateObject(Object object, 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.

        + *
          + *
        • updateObjectCallable() + *

        + *

        WriteObject

        Stores a new object and metadata. + *

        An object can be written either in a single message stream or in a resumable sequence of message streams. To write using a single stream, the client should include in the first message of the stream an `WriteObjectSpec` describing the destination bucket, object, and any preconditions. Additionally, the final message must set 'finish_write' to true, or else it is an error. + *

        For a resumable write, the client should instead call `StartResumableWrite()`, populating a `WriteObjectSpec` into that request. They should then attach the returned `upload_id` to the first message of each following call to `WriteObject`. If the stream is closed before finishing the upload (either explicitly by the client or due to a network error or an error response from the server), the client should do as follows: - Check the result Status of the stream, to determine if writing can be resumed on this stream or must be restarted from scratch (by calling `StartResumableWrite()`). The resumable errors are DEADLINE_EXCEEDED, INTERNAL, and UNAVAILABLE. For each case, the client should use binary exponential backoff before retrying. Additionally, writes can be resumed after RESOURCE_EXHAUSTED errors, but only after taking appropriate measures, which may include reducing aggregate send rate across clients and/or requesting a quota increase for your project. - If the call to `WriteObject` returns `ABORTED`, that indicates concurrent attempts to update the resumable write, caused either by multiple racing clients or by a single client where the previous request was timed out on the client side but nonetheless reached the server. In this case the client should take steps to prevent further concurrent writes (e.g., increase the timeouts, stop using more than one process to perform the upload, etc.), and then should follow the steps below for resuming the upload. - For resumable errors, the client should call `QueryWriteStatus()` and then continue writing from the returned `persisted_size`. This may be less than the amount of data the client previously sent. Note also that it is acceptable to send data starting at an offset earlier than the returned `persisted_size`; in this case, the service will skip data at offsets that were already persisted (without checking that it matches the previously written data), and write only the data starting from the persisted offset. This behavior can make client-side handling simpler in some cases. + *

        The service will not view the object as complete until the client has sent a `WriteObjectRequest` with `finish_write` set to `true`. Sending any requests on a stream after sending a request with `finish_write` set to `true` will cause an error. The client **should** check the response it receives to determine how much data the service was able to commit and whether the service views the object as complete. + *

        Attempting to resume an already finalized object will result in an OK status, with a WriteObjectResponse containing the finalized object's metadata.

        + *

        Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

        + *
          + *
        • writeObjectCallable() + *

        + *

        ListObjects

        Retrieves a list of objects matching the criteria.

        + *

        Request object method variants only take one parameter, a request object, which must be constructed before the call.

        + *
          + *
        • listObjects(ListObjectsRequest request) + *

        + *

        "Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

        + *
          + *
        • listObjects(ProjectName parent) + *

        • listObjects(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.

        + *
          + *
        • listObjectsPagedCallable() + *

        • listObjectsCallable() + *

        + *

        RewriteObject

        Rewrites a source object to a destination object. Optionally overrides metadata.

        + *

        Request object method variants only take one parameter, a request object, which must be constructed before the call.

        + *
          + *
        • rewriteObject(RewriteObjectRequest request) + *

        + *

        Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

        + *
          + *
        • rewriteObjectCallable() + *

        + *

        StartResumableWrite

        Starts a resumable write. How long the write operation remains valid, and what happens when the write operation becomes invalid, are service-dependent.

        + *

        Request object method variants only take one parameter, a request object, which must be constructed before the call.

        + *
          + *
        • startResumableWrite(StartResumableWriteRequest request) + *

        + *

        Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

        + *
          + *
        • startResumableWriteCallable() + *

        + *

        QueryWriteStatus

        Determines the `persisted_size` for an object that is being written, which can then be used as the `write_offset` for the next `Write()` call. + *

        If the object does not exist (i.e., the object has been deleted, or the first `Write()` has not yet reached the service), this method returns the error `NOT_FOUND`. + *

        The client **may** call `QueryWriteStatus()` at any time to determine how much data has been processed for this object. This is useful if the client is buffering data and needs to know which data can be safely evicted. For any sequence of `QueryWriteStatus()` calls for a given object name, the sequence of returned `persisted_size` values will be non-decreasing.

        + *

        Request object method variants only take one parameter, a request object, which must be constructed before the call.

        + *
          + *
        • queryWriteStatus(QueryWriteStatusRequest request) + *

        + *

        "Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

        + *
          + *
        • queryWriteStatus(String uploadId) + *

        + *

        Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

        + *
          + *
        • queryWriteStatusCallable() + *

        + *

        GetServiceAccount

        Retrieves the name of a project's Google Cloud Storage service account.

        + *

        Request object method variants only take one parameter, a request object, which must be constructed before the call.

        + *
          + *
        • getServiceAccount(GetServiceAccountRequest request) + *

        + *

        "Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

        + *
          + *
        • getServiceAccount(ProjectName project) + *

        • getServiceAccount(String project) + *

        + *

        Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

        + *
          + *
        • getServiceAccountCallable() + *

        + *

        CreateHmacKey

        Creates a new HMAC key for the given service account.

        + *

        Request object method variants only take one parameter, a request object, which must be constructed before the call.

        + *
          + *
        • createHmacKey(CreateHmacKeyRequest request) + *

        + *

        "Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

        + *
          + *
        • createHmacKey(ProjectName project, String serviceAccountEmail) + *

        • createHmacKey(String project, String serviceAccountEmail) + *

        + *

        Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

        + *
          + *
        • createHmacKeyCallable() + *

        + *

        DeleteHmacKey

        Deletes a given HMAC key. Key must be in an INACTIVE state.

        + *

        Request object method variants only take one parameter, a request object, which must be constructed before the call.

        + *
          + *
        • deleteHmacKey(DeleteHmacKeyRequest request) + *

        + *

        "Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

        + *
          + *
        • deleteHmacKey(String accessId, ProjectName project) + *

        • deleteHmacKey(String accessId, String project) + *

        + *

        Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

        + *
          + *
        • deleteHmacKeyCallable() + *

        + *

        GetHmacKey

        Gets an existing HMAC key metadata for the given id.

        + *

        Request object method variants only take one parameter, a request object, which must be constructed before the call.

        + *
          + *
        • getHmacKey(GetHmacKeyRequest request) + *

        + *

        "Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

        + *
          + *
        • getHmacKey(String accessId, ProjectName project) + *

        • getHmacKey(String accessId, String project) + *

        + *

        Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

        + *
          + *
        • getHmacKeyCallable() + *

        + *

        ListHmacKeys

        Lists HMAC keys under a given project with the additional filters provided.

        + *

        Request object method variants only take one parameter, a request object, which must be constructed before the call.

        + *
          + *
        • listHmacKeys(ListHmacKeysRequest request) + *

        + *

        "Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

        + *
          + *
        • listHmacKeys(ProjectName project) + *

        • listHmacKeys(String project) + *

        + *

        Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

        + *
          + *
        • listHmacKeysPagedCallable() + *

        • listHmacKeysCallable() + *

        + *

        UpdateHmacKey

        Updates a given HMAC key state between ACTIVE and INACTIVE.

        + *

        Request object method variants only take one parameter, a request object, which must be constructed before the call.

        + *
          + *
        • updateHmacKey(UpdateHmacKeyRequest request) + *

        + *

        "Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

        + *
          + *
        • updateHmacKey(HmacKeyMetadata hmacKey, 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.

        + *
          + *
        • updateHmacKeyCallable() + *

        + *
        * *

        See the individual methods for example code. * @@ -249,7 +786,6 @@ public final void deleteBucket(String name) { * .setName(BucketName.of("[PROJECT]", "[BUCKET]").toString()) * .setIfMetagenerationMatch(1043427781) * .setIfMetagenerationNotMatch(1025430873) - * .setCommonRequestParams(CommonRequestParams.newBuilder().build()) * .build(); * storageClient.deleteBucket(request); * } @@ -280,7 +816,6 @@ public final void deleteBucket(DeleteBucketRequest request) { * .setName(BucketName.of("[PROJECT]", "[BUCKET]").toString()) * .setIfMetagenerationMatch(1043427781) * .setIfMetagenerationNotMatch(1025430873) - * .setCommonRequestParams(CommonRequestParams.newBuilder().build()) * .build(); * ApiFuture future = storageClient.deleteBucketCallable().futureCall(request); * // Do something. @@ -363,7 +898,6 @@ public final Bucket getBucket(String name) { * .setName(BucketName.of("[PROJECT]", "[BUCKET]").toString()) * .setIfMetagenerationMatch(1043427781) * .setIfMetagenerationNotMatch(1025430873) - * .setCommonRequestParams(CommonRequestParams.newBuilder().build()) * .setReadMask(FieldMask.newBuilder().build()) * .build(); * Bucket response = storageClient.getBucket(request); @@ -395,7 +929,6 @@ public final Bucket getBucket(GetBucketRequest request) { * .setName(BucketName.of("[PROJECT]", "[BUCKET]").toString()) * .setIfMetagenerationMatch(1043427781) * .setIfMetagenerationNotMatch(1025430873) - * .setCommonRequestParams(CommonRequestParams.newBuilder().build()) * .setReadMask(FieldMask.newBuilder().build()) * .build(); * ApiFuture future = storageClient.getBucketCallable().futureCall(request); @@ -429,8 +962,9 @@ public final UnaryCallable getBucketCallable() { * } * * @param parent Required. The project to which this bucket will belong. - * @param bucket Required. Properties of the new bucket being inserted. The project and name of - * the bucket are specified in this request, not in the bucket resource. + * @param bucket Properties of the new bucket being inserted. The project and name of the bucket + * are specified in the parent and bucket_id fields, respectively. Populating those fields in + * `bucket` will result in an error. * @param bucketId Required. The ID to use for this bucket, which will become the final component * of the bucket's resource name. For example, the value `foo` might result in a bucket with * the name `projects/123456/buckets/foo`. @@ -467,8 +1001,9 @@ public final Bucket createBucket(ProjectName parent, Bucket bucket, String bucke * } * * @param parent Required. The project to which this bucket will belong. - * @param bucket Required. Properties of the new bucket being inserted. The project and name of - * the bucket are specified in this request, not in the bucket resource. + * @param bucket Properties of the new bucket being inserted. The project and name of the bucket + * are specified in the parent and bucket_id fields, respectively. Populating those fields in + * `bucket` will result in an error. * @param bucketId Required. The ID to use for this bucket, which will become the final component * of the bucket's resource name. For example, the value `foo` might result in a bucket with * the name `projects/123456/buckets/foo`. @@ -502,8 +1037,8 @@ public final Bucket createBucket(String parent, Bucket bucket, String bucketId) * .setParent(ProjectName.of("[PROJECT]").toString()) * .setBucket(Bucket.newBuilder().build()) * .setBucketId("bucketId-1603305307") - * .setPredefinedAcl(PredefinedBucketAcl.forNumber(0)) - * .setPredefinedDefaultObjectAcl(PredefinedObjectAcl.forNumber(0)) + * .setPredefinedAcl("predefinedAcl1207041188") + * .setPredefinedDefaultObjectAcl("predefinedDefaultObjectAcl2109168048") * .build(); * Bucket response = storageClient.createBucket(request); * } @@ -534,8 +1069,8 @@ public final Bucket createBucket(CreateBucketRequest request) { * .setParent(ProjectName.of("[PROJECT]").toString()) * .setBucket(Bucket.newBuilder().build()) * .setBucketId("bucketId-1603305307") - * .setPredefinedAcl(PredefinedBucketAcl.forNumber(0)) - * .setPredefinedDefaultObjectAcl(PredefinedObjectAcl.forNumber(0)) + * .setPredefinedAcl("predefinedAcl1207041188") + * .setPredefinedDefaultObjectAcl("predefinedDefaultObjectAcl2109168048") * .build(); * ApiFuture future = storageClient.createBucketCallable().futureCall(request); * // Do something. @@ -626,7 +1161,6 @@ public final ListBucketsPagedResponse listBuckets(String parent) { * .setPageToken("pageToken873572522") * .setPrefix("prefix-980110702") * .setReadMask(FieldMask.newBuilder().build()) - * .setCommonRequestParams(CommonRequestParams.newBuilder().build()) * .build(); * for (Bucket element : storageClient.listBuckets(request).iterateAll()) { * // doThingsWith(element); @@ -661,7 +1195,6 @@ public final ListBucketsPagedResponse listBuckets(ListBucketsRequest request) { * .setPageToken("pageToken873572522") * .setPrefix("prefix-980110702") * .setReadMask(FieldMask.newBuilder().build()) - * .setCommonRequestParams(CommonRequestParams.newBuilder().build()) * .build(); * ApiFuture future = storageClient.listBucketsPagedCallable().futureCall(request); * // Do something. @@ -696,7 +1229,6 @@ public final ListBucketsPagedResponse listBuckets(ListBucketsRequest request) { * .setPageToken("pageToken873572522") * .setPrefix("prefix-980110702") * .setReadMask(FieldMask.newBuilder().build()) - * .setCommonRequestParams(CommonRequestParams.newBuilder().build()) * .build(); * while (true) { * ListBucketsResponse response = storageClient.listBucketsCallable().call(request); @@ -790,7 +1322,6 @@ public final Bucket lockBucketRetentionPolicy(String bucket) { * LockBucketRetentionPolicyRequest.newBuilder() * .setBucket(BucketName.of("[PROJECT]", "[BUCKET]").toString()) * .setIfMetagenerationMatch(1043427781) - * .setCommonRequestParams(CommonRequestParams.newBuilder().build()) * .build(); * Bucket response = storageClient.lockBucketRetentionPolicy(request); * } @@ -820,7 +1351,6 @@ public final Bucket lockBucketRetentionPolicy(LockBucketRetentionPolicyRequest r * LockBucketRetentionPolicyRequest.newBuilder() * .setBucket(BucketName.of("[PROJECT]", "[BUCKET]").toString()) * .setIfMetagenerationMatch(1043427781) - * .setCommonRequestParams(CommonRequestParams.newBuilder().build()) * .build(); * ApiFuture future = * storageClient.lockBucketRetentionPolicyCallable().futureCall(request); @@ -836,7 +1366,9 @@ public final Bucket lockBucketRetentionPolicy(LockBucketRetentionPolicyRequest r // AUTO-GENERATED DOCUMENTATION AND METHOD. /** - * Gets the IAM policy for a specified bucket. + * Gets the IAM policy for a specified bucket or object. The `resource` field in the request + * should be projects/_/buckets/<bucket_name> for a bucket or + * projects/_/buckets/<bucket_name>/objects/<object_name> for an object. * *

        Sample code: * @@ -867,7 +1399,9 @@ public final Policy getIamPolicy(ResourceName resource) { // AUTO-GENERATED DOCUMENTATION AND METHOD. /** - * Gets the IAM policy for a specified bucket. + * Gets the IAM policy for a specified bucket or object. The `resource` field in the request + * should be projects/_/buckets/<bucket_name> for a bucket or + * projects/_/buckets/<bucket_name>/objects/<object_name> for an object. * *

        Sample code: * @@ -895,7 +1429,9 @@ public final Policy getIamPolicy(String resource) { // AUTO-GENERATED DOCUMENTATION AND METHOD. /** - * Gets the IAM policy for a specified bucket. + * Gets the IAM policy for a specified bucket or object. The `resource` field in the request + * should be projects/_/buckets/<bucket_name> for a bucket or + * projects/_/buckets/<bucket_name>/objects/<object_name> for an object. * *

        Sample code: * @@ -926,7 +1462,9 @@ public final Policy getIamPolicy(GetIamPolicyRequest request) { // AUTO-GENERATED DOCUMENTATION AND METHOD. /** - * Gets the IAM policy for a specified bucket. + * Gets the IAM policy for a specified bucket or object. The `resource` field in the request + * should be projects/_/buckets/<bucket_name> for a bucket or + * projects/_/buckets/<bucket_name>/objects/<object_name> for an object. * *

        Sample code: * @@ -956,7 +1494,9 @@ public final UnaryCallable getIamPolicyCallable() { // AUTO-GENERATED DOCUMENTATION AND METHOD. /** - * Updates an IAM policy for the specified bucket. + * Updates an IAM policy for the specified bucket or object. The `resource` field in the request + * should be projects/_/buckets/<bucket_name> for a bucket or + * projects/_/buckets/<bucket_name>/objects/<object_name> for an object. * *

        Sample code: * @@ -992,7 +1532,9 @@ public final Policy setIamPolicy(ResourceName resource, Policy policy) { // AUTO-GENERATED DOCUMENTATION AND METHOD. /** - * Updates an IAM policy for the specified bucket. + * Updates an IAM policy for the specified bucket or object. The `resource` field in the request + * should be projects/_/buckets/<bucket_name> for a bucket or + * projects/_/buckets/<bucket_name>/objects/<object_name> for an object. * *

        Sample code: * @@ -1025,7 +1567,9 @@ public final Policy setIamPolicy(String resource, Policy policy) { // AUTO-GENERATED DOCUMENTATION AND METHOD. /** - * Updates an IAM policy for the specified bucket. + * Updates an IAM policy for the specified bucket or object. The `resource` field in the request + * should be projects/_/buckets/<bucket_name> for a bucket or + * projects/_/buckets/<bucket_name>/objects/<object_name> for an object. * *

        Sample code: * @@ -1042,6 +1586,7 @@ public final Policy setIamPolicy(String resource, Policy policy) { * CryptoKeyName.of("[PROJECT]", "[LOCATION]", "[KEY_RING]", "[CRYPTO_KEY]") * .toString()) * .setPolicy(Policy.newBuilder().build()) + * .setUpdateMask(FieldMask.newBuilder().build()) * .build(); * Policy response = storageClient.setIamPolicy(request); * } @@ -1056,7 +1601,9 @@ public final Policy setIamPolicy(SetIamPolicyRequest request) { // AUTO-GENERATED DOCUMENTATION AND METHOD. /** - * Updates an IAM policy for the specified bucket. + * Updates an IAM policy for the specified bucket or object. The `resource` field in the request + * should be projects/_/buckets/<bucket_name> for a bucket or + * projects/_/buckets/<bucket_name>/objects/<object_name> for an object. * *

        Sample code: * @@ -1073,6 +1620,7 @@ public final Policy setIamPolicy(SetIamPolicyRequest request) { * CryptoKeyName.of("[PROJECT]", "[LOCATION]", "[KEY_RING]", "[CRYPTO_KEY]") * .toString()) * .setPolicy(Policy.newBuilder().build()) + * .setUpdateMask(FieldMask.newBuilder().build()) * .build(); * ApiFuture future = storageClient.setIamPolicyCallable().futureCall(request); * // Do something. @@ -1086,7 +1634,10 @@ public final UnaryCallable setIamPolicyCallable() { // AUTO-GENERATED DOCUMENTATION AND METHOD. /** - * Tests a set of permissions on the given bucket to see which, if any, are held by the caller. + * Tests a set of permissions on the given bucket or object to see which, if any, are held by the + * caller. The `resource` field in the request should be projects/_/buckets/<bucket_name> + * for a bucket or projects/_/buckets/<bucket_name>/objects/<object_name> for an + * object. * *

        Sample code: * @@ -1123,7 +1674,10 @@ public final TestIamPermissionsResponse testIamPermissions( // AUTO-GENERATED DOCUMENTATION AND METHOD. /** - * Tests a set of permissions on the given bucket to see which, if any, are held by the caller. + * Tests a set of permissions on the given bucket or object to see which, if any, are held by the + * caller. The `resource` field in the request should be projects/_/buckets/<bucket_name> + * for a bucket or projects/_/buckets/<bucket_name>/objects/<object_name> for an + * object. * *

        Sample code: * @@ -1160,7 +1714,10 @@ public final TestIamPermissionsResponse testIamPermissions( // AUTO-GENERATED DOCUMENTATION AND METHOD. /** - * Tests a set of permissions on the given bucket to see which, if any, are held by the caller. + * Tests a set of permissions on the given bucket or object to see which, if any, are held by the + * caller. The `resource` field in the request should be projects/_/buckets/<bucket_name> + * for a bucket or projects/_/buckets/<bucket_name>/objects/<object_name> for an + * object. * *

        Sample code: * @@ -1191,7 +1748,10 @@ public final TestIamPermissionsResponse testIamPermissions(TestIamPermissionsReq // AUTO-GENERATED DOCUMENTATION AND METHOD. /** - * Tests a set of permissions on the given bucket to see which, if any, are held by the caller. + * Tests a set of permissions on the given bucket or object to see which, if any, are held by the + * caller. The `resource` field in the request should be projects/_/buckets/<bucket_name> + * for a bucket or projects/_/buckets/<bucket_name>/objects/<object_name> for an + * object. * *

        Sample code: * @@ -1240,9 +1800,9 @@ public final TestIamPermissionsResponse testIamPermissions(TestIamPermissionsReq * } * } * - * @param bucket The bucket to update. The bucket's `name` field will be used to identify the - * bucket. - * @param updateMask List of fields to be updated. + * @param bucket Required. The bucket to update. The bucket's `name` field will be used to + * identify the bucket. + * @param updateMask Required. List of fields to be updated. *

        To specify ALL fields, equivalent to the JSON API's "update" function, specify a single * field with the value `*`. Note: not recommended. If a new field is introduced at a * later time, an older client updating with the `*` may accidentally reset the new @@ -1275,10 +1835,9 @@ public final Bucket updateBucket(Bucket bucket, FieldMask updateMask) { * .setBucket(Bucket.newBuilder().build()) * .setIfMetagenerationMatch(1043427781) * .setIfMetagenerationNotMatch(1025430873) - * .setPredefinedAcl(PredefinedBucketAcl.forNumber(0)) - * .setPredefinedDefaultObjectAcl(PredefinedObjectAcl.forNumber(0)) + * .setPredefinedAcl("predefinedAcl1207041188") + * .setPredefinedDefaultObjectAcl("predefinedDefaultObjectAcl2109168048") * .setUpdateMask(FieldMask.newBuilder().build()) - * .setCommonRequestParams(CommonRequestParams.newBuilder().build()) * .build(); * Bucket response = storageClient.updateBucket(request); * } @@ -1309,10 +1868,9 @@ public final Bucket updateBucket(UpdateBucketRequest request) { * .setBucket(Bucket.newBuilder().build()) * .setIfMetagenerationMatch(1043427781) * .setIfMetagenerationNotMatch(1025430873) - * .setPredefinedAcl(PredefinedBucketAcl.forNumber(0)) - * .setPredefinedDefaultObjectAcl(PredefinedObjectAcl.forNumber(0)) + * .setPredefinedAcl("predefinedAcl1207041188") + * .setPredefinedDefaultObjectAcl("predefinedDefaultObjectAcl2109168048") * .setUpdateMask(FieldMask.newBuilder().build()) - * .setCommonRequestParams(CommonRequestParams.newBuilder().build()) * .build(); * ApiFuture future = storageClient.updateBucketCallable().futureCall(request); * // Do something. @@ -1857,14 +2415,14 @@ public final ListNotificationsPagedResponse listNotifications(ListNotificationsR * ComposeObjectRequest.newBuilder() * .setDestination(Object.newBuilder().build()) * .addAllSourceObjects(new ArrayList()) - * .setDestinationPredefinedAcl(PredefinedObjectAcl.forNumber(0)) + * .setDestinationPredefinedAcl("destinationPredefinedAcl1111125814") * .setIfGenerationMatch(-1086241088) * .setIfMetagenerationMatch(1043427781) * .setKmsKey( * CryptoKeyName.of("[PROJECT]", "[LOCATION]", "[KEY_RING]", "[CRYPTO_KEY]") * .toString()) * .setCommonObjectRequestParams(CommonObjectRequestParams.newBuilder().build()) - * .setCommonRequestParams(CommonRequestParams.newBuilder().build()) + * .setObjectChecksums(ObjectChecksums.newBuilder().build()) * .build(); * Object response = storageClient.composeObject(request); * } @@ -1894,14 +2452,14 @@ public final Object composeObject(ComposeObjectRequest request) { * ComposeObjectRequest.newBuilder() * .setDestination(Object.newBuilder().build()) * .addAllSourceObjects(new ArrayList()) - * .setDestinationPredefinedAcl(PredefinedObjectAcl.forNumber(0)) + * .setDestinationPredefinedAcl("destinationPredefinedAcl1111125814") * .setIfGenerationMatch(-1086241088) * .setIfMetagenerationMatch(1043427781) * .setKmsKey( * CryptoKeyName.of("[PROJECT]", "[LOCATION]", "[KEY_RING]", "[CRYPTO_KEY]") * .toString()) * .setCommonObjectRequestParams(CommonObjectRequestParams.newBuilder().build()) - * .setCommonRequestParams(CommonRequestParams.newBuilder().build()) + * .setObjectChecksums(ObjectChecksums.newBuilder().build()) * .build(); * ApiFuture future = storageClient.composeObjectCallable().futureCall(request); * // Do something. @@ -1934,7 +2492,8 @@ public final UnaryCallable composeObjectCallable() * } * * @param bucket Required. Name of the bucket in which the object resides. - * @param object Required. The name of the object to delete (when not using a resumable write). + * @param object Required. The name of the finalized object to delete. Note: If you want to delete + * an unfinalized resumable upload please use `CancelResumableWrite`. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final void deleteObject(String bucket, String object) { @@ -1965,7 +2524,8 @@ public final void deleteObject(String bucket, String object) { * } * * @param bucket Required. Name of the bucket in which the object resides. - * @param object Required. The name of the object to delete (when not using a resumable write). + * @param object Required. The name of the finalized object to delete. Note: If you want to delete + * an unfinalized resumable upload please use `CancelResumableWrite`. * @param generation If present, permanently deletes a specific revision of this object (as * opposed to the latest version, the default). * @throws com.google.api.gax.rpc.ApiException if the remote call fails @@ -1998,14 +2558,12 @@ public final void deleteObject(String bucket, String object, long generation) { * DeleteObjectRequest.newBuilder() * .setBucket("bucket-1378203158") * .setObject("object-1023368385") - * .setUploadId("uploadId1563990780") * .setGeneration(305703192) * .setIfGenerationMatch(-1086241088) * .setIfGenerationNotMatch(1475720404) * .setIfMetagenerationMatch(1043427781) * .setIfMetagenerationNotMatch(1025430873) * .setCommonObjectRequestParams(CommonObjectRequestParams.newBuilder().build()) - * .setCommonRequestParams(CommonRequestParams.newBuilder().build()) * .build(); * storageClient.deleteObject(request); * } @@ -2036,14 +2594,12 @@ public final void deleteObject(DeleteObjectRequest request) { * DeleteObjectRequest.newBuilder() * .setBucket("bucket-1378203158") * .setObject("object-1023368385") - * .setUploadId("uploadId1563990780") * .setGeneration(305703192) * .setIfGenerationMatch(-1086241088) * .setIfGenerationNotMatch(1475720404) * .setIfMetagenerationMatch(1043427781) * .setIfMetagenerationNotMatch(1025430873) * .setCommonObjectRequestParams(CommonObjectRequestParams.newBuilder().build()) - * .setCommonRequestParams(CommonRequestParams.newBuilder().build()) * .build(); * ApiFuture future = storageClient.deleteObjectCallable().futureCall(request); * // Do something. @@ -2055,6 +2611,88 @@ public final UnaryCallable deleteObjectCallable() { return stub.deleteObjectCallable(); } + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Cancels an in-progress resumable upload. + * + *

        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 (StorageClient storageClient = StorageClient.create()) {
        +   *   String uploadId = "uploadId1563990780";
        +   *   CancelResumableWriteResponse response = storageClient.cancelResumableWrite(uploadId);
        +   * }
        +   * }
        + * + * @param uploadId Required. The upload_id of the resumable upload to cancel. This should be + * copied from the `upload_id` field of `StartResumableWriteResponse`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final CancelResumableWriteResponse cancelResumableWrite(String uploadId) { + CancelResumableWriteRequest request = + CancelResumableWriteRequest.newBuilder().setUploadId(uploadId).build(); + return cancelResumableWrite(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Cancels an in-progress resumable upload. + * + *

        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 (StorageClient storageClient = StorageClient.create()) {
        +   *   CancelResumableWriteRequest request =
        +   *       CancelResumableWriteRequest.newBuilder().setUploadId("uploadId1563990780").build();
        +   *   CancelResumableWriteResponse response = storageClient.cancelResumableWrite(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 CancelResumableWriteResponse cancelResumableWrite( + CancelResumableWriteRequest request) { + return cancelResumableWriteCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Cancels an in-progress resumable upload. + * + *

        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 (StorageClient storageClient = StorageClient.create()) {
        +   *   CancelResumableWriteRequest request =
        +   *       CancelResumableWriteRequest.newBuilder().setUploadId("uploadId1563990780").build();
        +   *   ApiFuture future =
        +   *       storageClient.cancelResumableWriteCallable().futureCall(request);
        +   *   // Do something.
        +   *   CancelResumableWriteResponse response = future.get();
        +   * }
        +   * }
        + */ + public final UnaryCallable + cancelResumableWriteCallable() { + return stub.cancelResumableWriteCallable(); + } + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Retrieves an object's metadata. @@ -2143,7 +2781,6 @@ public final Object getObject(String bucket, String object, long generation) { * .setIfMetagenerationMatch(1043427781) * .setIfMetagenerationNotMatch(1025430873) * .setCommonObjectRequestParams(CommonObjectRequestParams.newBuilder().build()) - * .setCommonRequestParams(CommonRequestParams.newBuilder().build()) * .setReadMask(FieldMask.newBuilder().build()) * .build(); * Object response = storageClient.getObject(request); @@ -2180,7 +2817,6 @@ public final Object getObject(GetObjectRequest request) { * .setIfMetagenerationMatch(1043427781) * .setIfMetagenerationNotMatch(1025430873) * .setCommonObjectRequestParams(CommonObjectRequestParams.newBuilder().build()) - * .setCommonRequestParams(CommonRequestParams.newBuilder().build()) * .setReadMask(FieldMask.newBuilder().build()) * .build(); * ApiFuture future = storageClient.getObjectCallable().futureCall(request); @@ -2218,7 +2854,6 @@ public final UnaryCallable getObjectCallable() { * .setIfMetagenerationMatch(1043427781) * .setIfMetagenerationNotMatch(1025430873) * .setCommonObjectRequestParams(CommonObjectRequestParams.newBuilder().build()) - * .setCommonRequestParams(CommonRequestParams.newBuilder().build()) * .setReadMask(FieldMask.newBuilder().build()) * .build(); * ServerStream stream = storageClient.readObjectCallable().call(request); @@ -2251,11 +2886,11 @@ public final ServerStreamingCallable read * } * } * - * @param object The object to update. The object's bucket and name fields are used to identify - * the object to update. If present, the object's generation field selects a specific revision - * of this object whose metadata should be updated. Otherwise, assumes the current, live + * @param object Required. The object to update. The object's bucket and name fields are used to + * identify the object to update. If present, the object's generation field selects a specific + * revision of this object whose metadata should be updated. Otherwise, assumes the live * version of the object. - * @param updateMask List of fields to be updated. + * @param updateMask Required. List of fields to be updated. *

        To specify ALL fields, equivalent to the JSON API's "update" function, specify a single * field with the value `*`. Note: not recommended. If a new field is introduced at a * later time, an older client updating with the `*` may accidentally reset the new @@ -2290,10 +2925,9 @@ public final Object updateObject(Object object, FieldMask updateMask) { * .setIfGenerationNotMatch(1475720404) * .setIfMetagenerationMatch(1043427781) * .setIfMetagenerationNotMatch(1025430873) - * .setPredefinedAcl(PredefinedObjectAcl.forNumber(0)) + * .setPredefinedAcl("predefinedAcl1207041188") * .setUpdateMask(FieldMask.newBuilder().build()) * .setCommonObjectRequestParams(CommonObjectRequestParams.newBuilder().build()) - * .setCommonRequestParams(CommonRequestParams.newBuilder().build()) * .build(); * Object response = storageClient.updateObject(request); * } @@ -2326,10 +2960,9 @@ public final Object updateObject(UpdateObjectRequest request) { * .setIfGenerationNotMatch(1475720404) * .setIfMetagenerationMatch(1043427781) * .setIfMetagenerationNotMatch(1025430873) - * .setPredefinedAcl(PredefinedObjectAcl.forNumber(0)) + * .setPredefinedAcl("predefinedAcl1207041188") * .setUpdateMask(FieldMask.newBuilder().build()) * .setCommonObjectRequestParams(CommonObjectRequestParams.newBuilder().build()) - * .setCommonRequestParams(CommonRequestParams.newBuilder().build()) * .build(); * ApiFuture future = storageClient.updateObjectCallable().futureCall(request); * // Do something. @@ -2351,12 +2984,29 @@ public final UnaryCallable updateObjectCallable() { * preconditions. Additionally, the final message must set 'finish_write' to true, or else it is * an error. * - *

        For a resumable write, the client should instead call `StartResumableWrite()` and provide - * that method an `WriteObjectSpec.` They should then attach the returned `upload_id` to the first - * message of each following call to `Create`. If there is an error or the connection is broken - * during the resumable `Create()`, the client should check the status of the `Create()` by - * calling `QueryWriteStatus()` and continue writing from the returned `persisted_size`. This may - * be less than the amount of data the client previously sent. + *

        For a resumable write, the client should instead call `StartResumableWrite()`, populating a + * `WriteObjectSpec` into that request. They should then attach the returned `upload_id` to the + * first message of each following call to `WriteObject`. If the stream is closed before finishing + * the upload (either explicitly by the client or due to a network error or an error response from + * the server), the client should do as follows: - Check the result Status of the stream, to + * determine if writing can be resumed on this stream or must be restarted from scratch (by + * calling `StartResumableWrite()`). The resumable errors are DEADLINE_EXCEEDED, INTERNAL, and + * UNAVAILABLE. For each case, the client should use binary exponential backoff before retrying. + * Additionally, writes can be resumed after RESOURCE_EXHAUSTED errors, but only after taking + * appropriate measures, which may include reducing aggregate send rate across clients and/or + * requesting a quota increase for your project. - If the call to `WriteObject` returns `ABORTED`, + * that indicates concurrent attempts to update the resumable write, caused either by multiple + * racing clients or by a single client where the previous request was timed out on the client + * side but nonetheless reached the server. In this case the client should take steps to prevent + * further concurrent writes (e.g., increase the timeouts, stop using more than one process to + * perform the upload, etc.), and then should follow the steps below for resuming the upload. - + * For resumable errors, the client should call `QueryWriteStatus()` and then continue writing + * from the returned `persisted_size`. This may be less than the amount of data the client + * previously sent. Note also that it is acceptable to send data starting at an offset earlier + * than the returned `persisted_size`; in this case, the service will skip data at offsets that + * were already persisted (without checking that it matches the previously written data), and + * write only the data starting from the persisted offset. This behavior can make client-side + * handling simpler in some cases. * *

        The service will not view the object as complete until the client has sent a * `WriteObjectRequest` with `finish_write` set to `true`. Sending any requests on a stream after @@ -2364,6 +3014,9 @@ public final UnaryCallable updateObjectCallable() { * **should** check the response it receives to determine how much data the * service was able to commit and whether the service views the object as complete. * + *

        Attempting to resume an already finalized object will result in an OK status, with a + * WriteObjectResponse containing the finalized object's metadata. + * *

        Sample code: * *

        {@code
        @@ -2398,7 +3051,6 @@ public final UnaryCallable updateObjectCallable() {
            *           .setObjectChecksums(ObjectChecksums.newBuilder().build())
            *           .setFinishWrite(true)
            *           .setCommonObjectRequestParams(CommonObjectRequestParams.newBuilder().build())
        -   *           .setCommonRequestParams(CommonRequestParams.newBuilder().build())
            *           .build();
            *   requestObserver.onNext(request);
            * }
        @@ -2493,7 +3145,6 @@ public final ListObjectsPagedResponse listObjects(String parent) {
            *           .setReadMask(FieldMask.newBuilder().build())
            *           .setLexicographicStart("lexicographicStart-2093413008")
            *           .setLexicographicEnd("lexicographicEnd1646968169")
        -   *           .setCommonRequestParams(CommonRequestParams.newBuilder().build())
            *           .build();
            *   for (Object element : storageClient.listObjects(request).iterateAll()) {
            *     // doThingsWith(element);
        @@ -2533,7 +3184,6 @@ public final ListObjectsPagedResponse listObjects(ListObjectsRequest request) {
            *           .setReadMask(FieldMask.newBuilder().build())
            *           .setLexicographicStart("lexicographicStart-2093413008")
            *           .setLexicographicEnd("lexicographicEnd1646968169")
        -   *           .setCommonRequestParams(CommonRequestParams.newBuilder().build())
            *           .build();
            *   ApiFuture future = storageClient.listObjectsPagedCallable().futureCall(request);
            *   // Do something.
        @@ -2573,7 +3223,6 @@ public final ListObjectsPagedResponse listObjects(ListObjectsRequest request) {
            *           .setReadMask(FieldMask.newBuilder().build())
            *           .setLexicographicStart("lexicographicStart-2093413008")
            *           .setLexicographicEnd("lexicographicEnd1646968169")
        -   *           .setCommonRequestParams(CommonRequestParams.newBuilder().build())
            *           .build();
            *   while (true) {
            *     ListObjectsResponse response = storageClient.listObjectsCallable().call(request);
        @@ -2619,7 +3268,7 @@ public final UnaryCallable listObjectsC
            *           .setSourceObject("sourceObject1196439354")
            *           .setSourceGeneration(1232209852)
            *           .setRewriteToken("rewriteToken80654285")
        -   *           .setDestinationPredefinedAcl(PredefinedObjectAcl.forNumber(0))
        +   *           .setDestinationPredefinedAcl("destinationPredefinedAcl1111125814")
            *           .setIfGenerationMatch(-1086241088)
            *           .setIfGenerationNotMatch(1475720404)
            *           .setIfMetagenerationMatch(1043427781)
        @@ -2633,7 +3282,7 @@ public final UnaryCallable listObjectsC
            *           .setCopySourceEncryptionKeyBytes(ByteString.EMPTY)
            *           .setCopySourceEncryptionKeySha256Bytes(ByteString.EMPTY)
            *           .setCommonObjectRequestParams(CommonObjectRequestParams.newBuilder().build())
        -   *           .setCommonRequestParams(CommonRequestParams.newBuilder().build())
        +   *           .setObjectChecksums(ObjectChecksums.newBuilder().build())
            *           .build();
            *   RewriteResponse response = storageClient.rewriteObject(request);
            * }
        @@ -2671,7 +3320,7 @@ public final RewriteResponse rewriteObject(RewriteObjectRequest request) {
            *           .setSourceObject("sourceObject1196439354")
            *           .setSourceGeneration(1232209852)
            *           .setRewriteToken("rewriteToken80654285")
        -   *           .setDestinationPredefinedAcl(PredefinedObjectAcl.forNumber(0))
        +   *           .setDestinationPredefinedAcl("destinationPredefinedAcl1111125814")
            *           .setIfGenerationMatch(-1086241088)
            *           .setIfGenerationNotMatch(1475720404)
            *           .setIfMetagenerationMatch(1043427781)
        @@ -2685,7 +3334,7 @@ public final RewriteResponse rewriteObject(RewriteObjectRequest request) {
            *           .setCopySourceEncryptionKeyBytes(ByteString.EMPTY)
            *           .setCopySourceEncryptionKeySha256Bytes(ByteString.EMPTY)
            *           .setCommonObjectRequestParams(CommonObjectRequestParams.newBuilder().build())
        -   *           .setCommonRequestParams(CommonRequestParams.newBuilder().build())
        +   *           .setObjectChecksums(ObjectChecksums.newBuilder().build())
            *           .build();
            *   ApiFuture future = storageClient.rewriteObjectCallable().futureCall(request);
            *   // Do something.
        @@ -2715,7 +3364,7 @@ public final UnaryCallable rewriteObjectC
            *       StartResumableWriteRequest.newBuilder()
            *           .setWriteObjectSpec(WriteObjectSpec.newBuilder().build())
            *           .setCommonObjectRequestParams(CommonObjectRequestParams.newBuilder().build())
        -   *           .setCommonRequestParams(CommonRequestParams.newBuilder().build())
        +   *           .setObjectChecksums(ObjectChecksums.newBuilder().build())
            *           .build();
            *   StartResumableWriteResponse response = storageClient.startResumableWrite(request);
            * }
        @@ -2746,7 +3395,7 @@ public final StartResumableWriteResponse startResumableWrite(StartResumableWrite
            *       StartResumableWriteRequest.newBuilder()
            *           .setWriteObjectSpec(WriteObjectSpec.newBuilder().build())
            *           .setCommonObjectRequestParams(CommonObjectRequestParams.newBuilder().build())
        -   *           .setCommonRequestParams(CommonRequestParams.newBuilder().build())
        +   *           .setObjectChecksums(ObjectChecksums.newBuilder().build())
            *           .build();
            *   ApiFuture future =
            *       storageClient.startResumableWriteCallable().futureCall(request);
        @@ -2825,7 +3474,6 @@ public final QueryWriteStatusResponse queryWriteStatus(String uploadId) {
            *       QueryWriteStatusRequest.newBuilder()
            *           .setUploadId("uploadId1563990780")
            *           .setCommonObjectRequestParams(CommonObjectRequestParams.newBuilder().build())
        -   *           .setCommonRequestParams(CommonRequestParams.newBuilder().build())
            *           .build();
            *   QueryWriteStatusResponse response = storageClient.queryWriteStatus(request);
            * }
        @@ -2865,7 +3513,6 @@ public final QueryWriteStatusResponse queryWriteStatus(QueryWriteStatusRequest r
            *       QueryWriteStatusRequest.newBuilder()
            *           .setUploadId("uploadId1563990780")
            *           .setCommonObjectRequestParams(CommonObjectRequestParams.newBuilder().build())
        -   *           .setCommonRequestParams(CommonRequestParams.newBuilder().build())
            *           .build();
            *   ApiFuture future =
            *       storageClient.queryWriteStatusCallable().futureCall(request);
        @@ -2897,7 +3544,8 @@ public final QueryWriteStatusResponse queryWriteStatus(QueryWriteStatusRequest r
            * }
            * }
            *
        -   * @param project Required. Project ID.
        +   * @param project Required. Project ID, in the format of "projects/<projectIdentifier>".
        +   *     <projectIdentifier> can be the project ID or project number.
            * @throws com.google.api.gax.rpc.ApiException if the remote call fails
            */
           public final ServiceAccount getServiceAccount(ProjectName project) {
        @@ -2926,7 +3574,8 @@ public final ServiceAccount getServiceAccount(ProjectName project) {
            * }
            * }
            *
        -   * @param project Required. Project ID.
        +   * @param project Required. Project ID, in the format of "projects/<projectIdentifier>".
        +   *     <projectIdentifier> can be the project ID or project number.
            * @throws com.google.api.gax.rpc.ApiException if the remote call fails
            */
           public final ServiceAccount getServiceAccount(String project) {
        @@ -2951,7 +3600,6 @@ public final ServiceAccount getServiceAccount(String project) {
            *   GetServiceAccountRequest request =
            *       GetServiceAccountRequest.newBuilder()
            *           .setProject(ProjectName.of("[PROJECT]").toString())
        -   *           .setCommonRequestParams(CommonRequestParams.newBuilder().build())
            *           .build();
            *   ServiceAccount response = storageClient.getServiceAccount(request);
            * }
        @@ -2980,7 +3628,6 @@ public final ServiceAccount getServiceAccount(GetServiceAccountRequest request)
            *   GetServiceAccountRequest request =
            *       GetServiceAccountRequest.newBuilder()
            *           .setProject(ProjectName.of("[PROJECT]").toString())
        -   *           .setCommonRequestParams(CommonRequestParams.newBuilder().build())
            *           .build();
            *   ApiFuture future =
            *       storageClient.getServiceAccountCallable().futureCall(request);
        @@ -3012,7 +3659,9 @@ public final UnaryCallable getServiceA
            * }
            * }
            *
        -   * @param project Required. The project that the HMAC-owning service account lives in.
        +   * @param project Required. The project that the HMAC-owning service account lives in, in the
        +   *     format of "projects/<projectIdentifier>". <projectIdentifier> can be the
        +   *     project ID or project number.
            * @param serviceAccountEmail Required. The service account to create the HMAC for.
            * @throws com.google.api.gax.rpc.ApiException if the remote call fails
            */
        @@ -3045,7 +3694,9 @@ public final CreateHmacKeyResponse createHmacKey(
            * }
            * }
            *
        -   * @param project Required. The project that the HMAC-owning service account lives in.
        +   * @param project Required. The project that the HMAC-owning service account lives in, in the
        +   *     format of "projects/<projectIdentifier>". <projectIdentifier> can be the
        +   *     project ID or project number.
            * @param serviceAccountEmail Required. The service account to create the HMAC for.
            * @throws com.google.api.gax.rpc.ApiException if the remote call fails
            */
        @@ -3075,7 +3726,6 @@ public final CreateHmacKeyResponse createHmacKey(String project, String serviceA
            *       CreateHmacKeyRequest.newBuilder()
            *           .setProject(ProjectName.of("[PROJECT]").toString())
            *           .setServiceAccountEmail("serviceAccountEmail1825953988")
        -   *           .setCommonRequestParams(CommonRequestParams.newBuilder().build())
            *           .build();
            *   CreateHmacKeyResponse response = storageClient.createHmacKey(request);
            * }
        @@ -3105,7 +3755,6 @@ public final CreateHmacKeyResponse createHmacKey(CreateHmacKeyRequest request) {
            *       CreateHmacKeyRequest.newBuilder()
            *           .setProject(ProjectName.of("[PROJECT]").toString())
            *           .setServiceAccountEmail("serviceAccountEmail1825953988")
        -   *           .setCommonRequestParams(CommonRequestParams.newBuilder().build())
            *           .build();
            *   ApiFuture future =
            *       storageClient.createHmacKeyCallable().futureCall(request);
        @@ -3138,7 +3787,9 @@ public final UnaryCallable createHm
            * }
            *
            * @param accessId Required. The identifying key for the HMAC to delete.
        -   * @param project Required. The project id the HMAC key lies in.
        +   * @param project Required. The project that owns the HMAC key, in the format of
        +   *     "projects/<projectIdentifier>". <projectIdentifier> can be the project ID or
        +   *     project number.
            * @throws com.google.api.gax.rpc.ApiException if the remote call fails
            */
           public final void deleteHmacKey(String accessId, ProjectName project) {
        @@ -3170,7 +3821,9 @@ public final void deleteHmacKey(String accessId, ProjectName project) {
            * }
            *
            * @param accessId Required. The identifying key for the HMAC to delete.
        -   * @param project Required. The project id the HMAC key lies in.
        +   * @param project Required. The project that owns the HMAC key, in the format of
        +   *     "projects/<projectIdentifier>". <projectIdentifier> can be the project ID or
        +   *     project number.
            * @throws com.google.api.gax.rpc.ApiException if the remote call fails
            */
           public final void deleteHmacKey(String accessId, String project) {
        @@ -3196,7 +3849,6 @@ public final void deleteHmacKey(String accessId, String project) {
            *       DeleteHmacKeyRequest.newBuilder()
            *           .setAccessId("accessId-2146437729")
            *           .setProject(ProjectName.of("[PROJECT]").toString())
        -   *           .setCommonRequestParams(CommonRequestParams.newBuilder().build())
            *           .build();
            *   storageClient.deleteHmacKey(request);
            * }
        @@ -3226,7 +3878,6 @@ public final void deleteHmacKey(DeleteHmacKeyRequest request) {
            *       DeleteHmacKeyRequest.newBuilder()
            *           .setAccessId("accessId-2146437729")
            *           .setProject(ProjectName.of("[PROJECT]").toString())
        -   *           .setCommonRequestParams(CommonRequestParams.newBuilder().build())
            *           .build();
            *   ApiFuture future = storageClient.deleteHmacKeyCallable().futureCall(request);
            *   // Do something.
        @@ -3258,7 +3909,9 @@ public final UnaryCallable deleteHmacKeyCallable()
            * }
            *
            * @param accessId Required. The identifying key for the HMAC to delete.
        -   * @param project Required. The project id the HMAC key lies in.
        +   * @param project Required. The project the HMAC key lies in, in the format of
        +   *     "projects/<projectIdentifier>". <projectIdentifier> can be the project ID or
        +   *     project number.
            * @throws com.google.api.gax.rpc.ApiException if the remote call fails
            */
           public final HmacKeyMetadata getHmacKey(String accessId, ProjectName project) {
        @@ -3290,7 +3943,9 @@ public final HmacKeyMetadata getHmacKey(String accessId, ProjectName project) {
            * }
            *
            * @param accessId Required. The identifying key for the HMAC to delete.
        -   * @param project Required. The project id the HMAC key lies in.
        +   * @param project Required. The project the HMAC key lies in, in the format of
        +   *     "projects/<projectIdentifier>". <projectIdentifier> can be the project ID or
        +   *     project number.
            * @throws com.google.api.gax.rpc.ApiException if the remote call fails
            */
           public final HmacKeyMetadata getHmacKey(String accessId, String project) {
        @@ -3316,7 +3971,6 @@ public final HmacKeyMetadata getHmacKey(String accessId, String project) {
            *       GetHmacKeyRequest.newBuilder()
            *           .setAccessId("accessId-2146437729")
            *           .setProject(ProjectName.of("[PROJECT]").toString())
        -   *           .setCommonRequestParams(CommonRequestParams.newBuilder().build())
            *           .build();
            *   HmacKeyMetadata response = storageClient.getHmacKey(request);
            * }
        @@ -3346,7 +4000,6 @@ public final HmacKeyMetadata getHmacKey(GetHmacKeyRequest request) {
            *       GetHmacKeyRequest.newBuilder()
            *           .setAccessId("accessId-2146437729")
            *           .setProject(ProjectName.of("[PROJECT]").toString())
        -   *           .setCommonRequestParams(CommonRequestParams.newBuilder().build())
            *           .build();
            *   ApiFuture future = storageClient.getHmacKeyCallable().futureCall(request);
            *   // Do something.
        @@ -3378,7 +4031,9 @@ public final UnaryCallable getHmacKeyCallabl
            * }
            * }
            *
        -   * @param project Required. The project id to list HMAC keys for.
        +   * @param project Required. The project to list HMAC keys for, in the format of
        +   *     "projects/<projectIdentifier>". <projectIdentifier> can be the project ID or
        +   *     project number.
            * @throws com.google.api.gax.rpc.ApiException if the remote call fails
            */
           public final ListHmacKeysPagedResponse listHmacKeys(ProjectName project) {
        @@ -3409,7 +4064,9 @@ public final ListHmacKeysPagedResponse listHmacKeys(ProjectName project) {
            * }
            * }
            *
        -   * @param project Required. The project id to list HMAC keys for.
        +   * @param project Required. The project to list HMAC keys for, in the format of
        +   *     "projects/<projectIdentifier>". <projectIdentifier> can be the project ID or
        +   *     project number.
            * @throws com.google.api.gax.rpc.ApiException if the remote call fails
            */
           public final ListHmacKeysPagedResponse listHmacKeys(String project) {
        @@ -3437,7 +4094,6 @@ public final ListHmacKeysPagedResponse listHmacKeys(String project) {
            *           .setPageToken("pageToken873572522")
            *           .setServiceAccountEmail("serviceAccountEmail1825953988")
            *           .setShowDeletedKeys(true)
        -   *           .setCommonRequestParams(CommonRequestParams.newBuilder().build())
            *           .build();
            *   for (HmacKeyMetadata element : storageClient.listHmacKeys(request).iterateAll()) {
            *     // doThingsWith(element);
        @@ -3472,7 +4128,6 @@ public final ListHmacKeysPagedResponse listHmacKeys(ListHmacKeysRequest request)
            *           .setPageToken("pageToken873572522")
            *           .setServiceAccountEmail("serviceAccountEmail1825953988")
            *           .setShowDeletedKeys(true)
        -   *           .setCommonRequestParams(CommonRequestParams.newBuilder().build())
            *           .build();
            *   ApiFuture future =
            *       storageClient.listHmacKeysPagedCallable().futureCall(request);
        @@ -3508,7 +4163,6 @@ public final ListHmacKeysPagedResponse listHmacKeys(ListHmacKeysRequest request)
            *           .setPageToken("pageToken873572522")
            *           .setServiceAccountEmail("serviceAccountEmail1825953988")
            *           .setShowDeletedKeys(true)
        -   *           .setCommonRequestParams(CommonRequestParams.newBuilder().build())
            *           .build();
            *   while (true) {
            *     ListHmacKeysResponse response = storageClient.listHmacKeysCallable().call(request);
        @@ -3551,7 +4205,8 @@ public final UnaryCallable listHmacKe
            * @param hmacKey Required. The HMAC key to update. If present, the hmac_key's `id` field will be
            *     used to identify the key. Otherwise, the hmac_key's access_id and project fields will be
            *     used to identify the key.
        -   * @param updateMask Update mask for hmac_key.
        +   * @param updateMask Update mask for hmac_key. Not specifying any fields will mean only the
        +   *     `state` field is updated to the value specified in `hmac_key`.
            * @throws com.google.api.gax.rpc.ApiException if the remote call fails
            */
           public final HmacKeyMetadata updateHmacKey(HmacKeyMetadata hmacKey, FieldMask updateMask) {
        @@ -3576,7 +4231,6 @@ public final HmacKeyMetadata updateHmacKey(HmacKeyMetadata hmacKey, FieldMask up
            *   UpdateHmacKeyRequest request =
            *       UpdateHmacKeyRequest.newBuilder()
            *           .setHmacKey(HmacKeyMetadata.newBuilder().build())
        -   *           .setCommonRequestParams(CommonRequestParams.newBuilder().build())
            *           .setUpdateMask(FieldMask.newBuilder().build())
            *           .build();
            *   HmacKeyMetadata response = storageClient.updateHmacKey(request);
        @@ -3606,7 +4260,6 @@ public final HmacKeyMetadata updateHmacKey(UpdateHmacKeyRequest request) {
            *   UpdateHmacKeyRequest request =
            *       UpdateHmacKeyRequest.newBuilder()
            *           .setHmacKey(HmacKeyMetadata.newBuilder().build())
        -   *           .setCommonRequestParams(CommonRequestParams.newBuilder().build())
            *           .setUpdateMask(FieldMask.newBuilder().build())
            *           .build();
            *   ApiFuture future = storageClient.updateHmacKeyCallable().futureCall(request);
        diff --git a/test/integration/goldens/storage/src/com/google/storage/v2/StorageClientTest.java b/test/integration/goldens/storage/src/com/google/storage/v2/StorageClientTest.java
        index 372f68cd18..d6a513a9b1 100644
        --- a/test/integration/goldens/storage/src/com/google/storage/v2/StorageClientTest.java
        +++ b/test/integration/goldens/storage/src/com/google/storage/v2/StorageClientTest.java
        @@ -1,5 +1,5 @@
         /*
        - * Copyright 2022 Google LLC
        + * Copyright 2026 Google LLC
          *
          * Licensed under the Apache License, Version 2.0 (the "License");
          * you may not use this file except in compliance with the License.
        @@ -35,6 +35,7 @@
         import com.google.api.gax.rpc.StatusCode;
         import com.google.api.resourcenames.ResourceName;
         import com.google.common.collect.Lists;
        +import com.google.iam.v1.AuditConfig;
         import com.google.iam.v1.Binding;
         import com.google.iam.v1.GetIamPolicyRequest;
         import com.google.iam.v1.Policy;
        @@ -174,6 +175,7 @@ public void getBucketTest() throws Exception {
                 Bucket.newBuilder()
                     .setName(BucketName.of("[PROJECT]", "[BUCKET]").toString())
                     .setBucketId("bucketId-1603305307")
        +            .setEtag("etag3123477")
                     .setProject(ProjectName.of("[PROJECT]").toString())
                     .setMetageneration(1048558813)
                     .setLocation("location1901043637")
        @@ -198,6 +200,7 @@ public void getBucketTest() throws Exception {
                     .setIamConfig(Bucket.IamConfig.newBuilder().build())
                     .setSatisfiesPzs(true)
                     .setCustomPlacementConfig(Bucket.CustomPlacementConfig.newBuilder().build())
        +            .setAutoclass(Bucket.Autoclass.newBuilder().build())
                     .build();
             mockStorage.addResponse(expectedResponse);
         
        @@ -237,6 +240,7 @@ public void getBucketTest2() throws Exception {
                 Bucket.newBuilder()
                     .setName(BucketName.of("[PROJECT]", "[BUCKET]").toString())
                     .setBucketId("bucketId-1603305307")
        +            .setEtag("etag3123477")
                     .setProject(ProjectName.of("[PROJECT]").toString())
                     .setMetageneration(1048558813)
                     .setLocation("location1901043637")
        @@ -261,6 +265,7 @@ public void getBucketTest2() throws Exception {
                     .setIamConfig(Bucket.IamConfig.newBuilder().build())
                     .setSatisfiesPzs(true)
                     .setCustomPlacementConfig(Bucket.CustomPlacementConfig.newBuilder().build())
        +            .setAutoclass(Bucket.Autoclass.newBuilder().build())
                     .build();
             mockStorage.addResponse(expectedResponse);
         
        @@ -300,6 +305,7 @@ public void createBucketTest() throws Exception {
                 Bucket.newBuilder()
                     .setName(BucketName.of("[PROJECT]", "[BUCKET]").toString())
                     .setBucketId("bucketId-1603305307")
        +            .setEtag("etag3123477")
                     .setProject(ProjectName.of("[PROJECT]").toString())
                     .setMetageneration(1048558813)
                     .setLocation("location1901043637")
        @@ -324,6 +330,7 @@ public void createBucketTest() throws Exception {
                     .setIamConfig(Bucket.IamConfig.newBuilder().build())
                     .setSatisfiesPzs(true)
                     .setCustomPlacementConfig(Bucket.CustomPlacementConfig.newBuilder().build())
        +            .setAutoclass(Bucket.Autoclass.newBuilder().build())
                     .build();
             mockStorage.addResponse(expectedResponse);
         
        @@ -369,6 +376,7 @@ public void createBucketTest2() throws Exception {
                 Bucket.newBuilder()
                     .setName(BucketName.of("[PROJECT]", "[BUCKET]").toString())
                     .setBucketId("bucketId-1603305307")
        +            .setEtag("etag3123477")
                     .setProject(ProjectName.of("[PROJECT]").toString())
                     .setMetageneration(1048558813)
                     .setLocation("location1901043637")
        @@ -393,6 +401,7 @@ public void createBucketTest2() throws Exception {
                     .setIamConfig(Bucket.IamConfig.newBuilder().build())
                     .setSatisfiesPzs(true)
                     .setCustomPlacementConfig(Bucket.CustomPlacementConfig.newBuilder().build())
        +            .setAutoclass(Bucket.Autoclass.newBuilder().build())
                     .build();
             mockStorage.addResponse(expectedResponse);
         
        @@ -526,6 +535,7 @@ public void lockBucketRetentionPolicyTest() throws Exception {
                 Bucket.newBuilder()
                     .setName(BucketName.of("[PROJECT]", "[BUCKET]").toString())
                     .setBucketId("bucketId-1603305307")
        +            .setEtag("etag3123477")
                     .setProject(ProjectName.of("[PROJECT]").toString())
                     .setMetageneration(1048558813)
                     .setLocation("location1901043637")
        @@ -550,6 +560,7 @@ public void lockBucketRetentionPolicyTest() throws Exception {
                     .setIamConfig(Bucket.IamConfig.newBuilder().build())
                     .setSatisfiesPzs(true)
                     .setCustomPlacementConfig(Bucket.CustomPlacementConfig.newBuilder().build())
        +            .setAutoclass(Bucket.Autoclass.newBuilder().build())
                     .build();
             mockStorage.addResponse(expectedResponse);
         
        @@ -590,6 +601,7 @@ public void lockBucketRetentionPolicyTest2() throws Exception {
                 Bucket.newBuilder()
                     .setName(BucketName.of("[PROJECT]", "[BUCKET]").toString())
                     .setBucketId("bucketId-1603305307")
        +            .setEtag("etag3123477")
                     .setProject(ProjectName.of("[PROJECT]").toString())
                     .setMetageneration(1048558813)
                     .setLocation("location1901043637")
        @@ -614,6 +626,7 @@ public void lockBucketRetentionPolicyTest2() throws Exception {
                     .setIamConfig(Bucket.IamConfig.newBuilder().build())
                     .setSatisfiesPzs(true)
                     .setCustomPlacementConfig(Bucket.CustomPlacementConfig.newBuilder().build())
        +            .setAutoclass(Bucket.Autoclass.newBuilder().build())
                     .build();
             mockStorage.addResponse(expectedResponse);
         
        @@ -654,6 +667,7 @@ public void getIamPolicyTest() throws Exception {
                 Policy.newBuilder()
                     .setVersion(351608024)
                     .addAllBindings(new ArrayList())
        +            .addAllAuditConfigs(new ArrayList())
                     .setEtag(ByteString.EMPTY)
                     .build();
             mockStorage.addResponse(expectedResponse);
        @@ -696,6 +710,7 @@ public void getIamPolicyTest2() throws Exception {
                 Policy.newBuilder()
                     .setVersion(351608024)
                     .addAllBindings(new ArrayList())
        +            .addAllAuditConfigs(new ArrayList())
                     .setEtag(ByteString.EMPTY)
                     .build();
             mockStorage.addResponse(expectedResponse);
        @@ -736,6 +751,7 @@ public void setIamPolicyTest() throws Exception {
                 Policy.newBuilder()
                     .setVersion(351608024)
                     .addAllBindings(new ArrayList())
        +            .addAllAuditConfigs(new ArrayList())
                     .setEtag(ByteString.EMPTY)
                     .build();
             mockStorage.addResponse(expectedResponse);
        @@ -781,6 +797,7 @@ public void setIamPolicyTest2() throws Exception {
                 Policy.newBuilder()
                     .setVersion(351608024)
                     .addAllBindings(new ArrayList())
        +            .addAllAuditConfigs(new ArrayList())
                     .setEtag(ByteString.EMPTY)
                     .build();
             mockStorage.addResponse(expectedResponse);
        @@ -904,6 +921,7 @@ public void updateBucketTest() throws Exception {
                 Bucket.newBuilder()
                     .setName(BucketName.of("[PROJECT]", "[BUCKET]").toString())
                     .setBucketId("bucketId-1603305307")
        +            .setEtag("etag3123477")
                     .setProject(ProjectName.of("[PROJECT]").toString())
                     .setMetageneration(1048558813)
                     .setLocation("location1901043637")
        @@ -928,6 +946,7 @@ public void updateBucketTest() throws Exception {
                     .setIamConfig(Bucket.IamConfig.newBuilder().build())
                     .setSatisfiesPzs(true)
                     .setCustomPlacementConfig(Bucket.CustomPlacementConfig.newBuilder().build())
        +            .setAutoclass(Bucket.Autoclass.newBuilder().build())
                     .build();
             mockStorage.addResponse(expectedResponse);
         
        @@ -1038,6 +1057,7 @@ public void getNotificationTest() throws Exception {
                 Notification.newBuilder()
                     .setName(NotificationName.of("[PROJECT]", "[BUCKET]", "[NOTIFICATION]").toString())
                     .setTopic("topic110546223")
        +            .setEtag("etag3123477")
                     .addAllEventTypes(new ArrayList())
                     .putAllCustomAttributes(new HashMap())
                     .setObjectNamePrefix("objectNamePrefix-1978236516")
        @@ -1081,6 +1101,7 @@ public void getNotificationTest2() throws Exception {
                 Notification.newBuilder()
                     .setName(NotificationName.of("[PROJECT]", "[BUCKET]", "[NOTIFICATION]").toString())
                     .setTopic("topic110546223")
        +            .setEtag("etag3123477")
                     .addAllEventTypes(new ArrayList())
                     .putAllCustomAttributes(new HashMap())
                     .setObjectNamePrefix("objectNamePrefix-1978236516")
        @@ -1124,6 +1145,7 @@ public void createNotificationTest() throws Exception {
                 Notification.newBuilder()
                     .setName(NotificationName.of("[PROJECT]", "[BUCKET]", "[NOTIFICATION]").toString())
                     .setTopic("topic110546223")
        +            .setEtag("etag3123477")
                     .addAllEventTypes(new ArrayList())
                     .putAllCustomAttributes(new HashMap())
                     .setObjectNamePrefix("objectNamePrefix-1978236516")
        @@ -1170,6 +1192,7 @@ public void createNotificationTest2() throws Exception {
                 Notification.newBuilder()
                     .setName(NotificationName.of("[PROJECT]", "[BUCKET]", "[NOTIFICATION]").toString())
                     .setTopic("topic110546223")
        +            .setEtag("etag3123477")
                     .addAllEventTypes(new ArrayList())
                     .putAllCustomAttributes(new HashMap())
                     .setObjectNamePrefix("objectNamePrefix-1978236516")
        @@ -1304,6 +1327,7 @@ public void composeObjectTest() throws Exception {
                 Object.newBuilder()
                     .setName("name3373707")
                     .setBucket(BucketName.of("[PROJECT]", "[BUCKET]").toString())
        +            .setEtag("etag3123477")
                     .setGeneration(305703192)
                     .setMetageneration(1048558813)
                     .setStorageClass("storageClass871353277")
        @@ -1337,14 +1361,14 @@ public void composeObjectTest() throws Exception {
                 ComposeObjectRequest.newBuilder()
                     .setDestination(Object.newBuilder().build())
                     .addAllSourceObjects(new ArrayList())
        -            .setDestinationPredefinedAcl(PredefinedObjectAcl.forNumber(0))
        +            .setDestinationPredefinedAcl("destinationPredefinedAcl1111125814")
                     .setIfGenerationMatch(-1086241088)
                     .setIfMetagenerationMatch(1043427781)
                     .setKmsKey(
                         CryptoKeyName.of("[PROJECT]", "[LOCATION]", "[KEY_RING]", "[CRYPTO_KEY]")
                             .toString())
                     .setCommonObjectRequestParams(CommonObjectRequestParams.newBuilder().build())
        -            .setCommonRequestParams(CommonRequestParams.newBuilder().build())
        +            .setObjectChecksums(ObjectChecksums.newBuilder().build())
                     .build();
         
             Object actualResponse = client.composeObject(request);
        @@ -1364,7 +1388,7 @@ public void composeObjectTest() throws Exception {
             Assert.assertEquals(request.getKmsKey(), actualRequest.getKmsKey());
             Assert.assertEquals(
                 request.getCommonObjectRequestParams(), actualRequest.getCommonObjectRequestParams());
        -    Assert.assertEquals(request.getCommonRequestParams(), actualRequest.getCommonRequestParams());
        +    Assert.assertEquals(request.getObjectChecksums(), actualRequest.getObjectChecksums());
             Assert.assertTrue(
                 channelProvider.isHeaderSent(
                     ApiClientHeaderProvider.getDefaultApiClientHeaderKey(),
        @@ -1381,14 +1405,14 @@ public void composeObjectExceptionTest() throws Exception {
                   ComposeObjectRequest.newBuilder()
                       .setDestination(Object.newBuilder().build())
                       .addAllSourceObjects(new ArrayList())
        -              .setDestinationPredefinedAcl(PredefinedObjectAcl.forNumber(0))
        +              .setDestinationPredefinedAcl("destinationPredefinedAcl1111125814")
                       .setIfGenerationMatch(-1086241088)
                       .setIfMetagenerationMatch(1043427781)
                       .setKmsKey(
                           CryptoKeyName.of("[PROJECT]", "[LOCATION]", "[KEY_RING]", "[CRYPTO_KEY]")
                               .toString())
                       .setCommonObjectRequestParams(CommonObjectRequestParams.newBuilder().build())
        -              .setCommonRequestParams(CommonRequestParams.newBuilder().build())
        +              .setObjectChecksums(ObjectChecksums.newBuilder().build())
                       .build();
               client.composeObject(request);
               Assert.fail("No exception raised");
        @@ -1474,12 +1498,50 @@ public void deleteObjectExceptionTest2() throws Exception {
             }
           }
         
        +  @Test
        +  public void cancelResumableWriteTest() throws Exception {
        +    CancelResumableWriteResponse expectedResponse =
        +        CancelResumableWriteResponse.newBuilder().build();
        +    mockStorage.addResponse(expectedResponse);
        +
        +    String uploadId = "uploadId1563990780";
        +
        +    CancelResumableWriteResponse actualResponse = client.cancelResumableWrite(uploadId);
        +    Assert.assertEquals(expectedResponse, actualResponse);
        +
        +    List actualRequests = mockStorage.getRequests();
        +    Assert.assertEquals(1, actualRequests.size());
        +    CancelResumableWriteRequest actualRequest =
        +        ((CancelResumableWriteRequest) actualRequests.get(0));
        +
        +    Assert.assertEquals(uploadId, actualRequest.getUploadId());
        +    Assert.assertTrue(
        +        channelProvider.isHeaderSent(
        +            ApiClientHeaderProvider.getDefaultApiClientHeaderKey(),
        +            GaxGrpcProperties.getDefaultApiClientHeaderPattern()));
        +  }
        +
        +  @Test
        +  public void cancelResumableWriteExceptionTest() throws Exception {
        +    StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT);
        +    mockStorage.addException(exception);
        +
        +    try {
        +      String uploadId = "uploadId1563990780";
        +      client.cancelResumableWrite(uploadId);
        +      Assert.fail("No exception raised");
        +    } catch (InvalidArgumentException e) {
        +      // Expected exception.
        +    }
        +  }
        +
           @Test
           public void getObjectTest() throws Exception {
             Object expectedResponse =
                 Object.newBuilder()
                     .setName("name3373707")
                     .setBucket(BucketName.of("[PROJECT]", "[BUCKET]").toString())
        +            .setEtag("etag3123477")
                     .setGeneration(305703192)
                     .setMetageneration(1048558813)
                     .setStorageClass("storageClass871353277")
        @@ -1548,6 +1610,7 @@ public void getObjectTest2() throws Exception {
                 Object.newBuilder()
                     .setName("name3373707")
                     .setBucket(BucketName.of("[PROJECT]", "[BUCKET]").toString())
        +            .setEtag("etag3123477")
                     .setGeneration(305703192)
                     .setMetageneration(1048558813)
                     .setStorageClass("storageClass871353277")
        @@ -1635,7 +1698,6 @@ public void readObjectTest() throws Exception {
                     .setIfMetagenerationMatch(1043427781)
                     .setIfMetagenerationNotMatch(1025430873)
                     .setCommonObjectRequestParams(CommonObjectRequestParams.newBuilder().build())
        -            .setCommonRequestParams(CommonRequestParams.newBuilder().build())
                     .setReadMask(FieldMask.newBuilder().build())
                     .build();
         
        @@ -1666,7 +1728,6 @@ public void readObjectExceptionTest() throws Exception {
                     .setIfMetagenerationMatch(1043427781)
                     .setIfMetagenerationNotMatch(1025430873)
                     .setCommonObjectRequestParams(CommonObjectRequestParams.newBuilder().build())
        -            .setCommonRequestParams(CommonRequestParams.newBuilder().build())
                     .setReadMask(FieldMask.newBuilder().build())
                     .build();
         
        @@ -1692,6 +1753,7 @@ public void updateObjectTest() throws Exception {
                 Object.newBuilder()
                     .setName("name3373707")
                     .setBucket(BucketName.of("[PROJECT]", "[BUCKET]").toString())
        +            .setEtag("etag3123477")
                     .setGeneration(305703192)
                     .setMetageneration(1048558813)
                     .setStorageClass("storageClass871353277")
        @@ -1764,7 +1826,6 @@ public void writeObjectTest() throws Exception {
                     .setObjectChecksums(ObjectChecksums.newBuilder().build())
                     .setFinishWrite(true)
                     .setCommonObjectRequestParams(CommonObjectRequestParams.newBuilder().build())
        -            .setCommonRequestParams(CommonRequestParams.newBuilder().build())
                     .build();
         
             MockStreamObserver responseObserver = new MockStreamObserver<>();
        @@ -1792,7 +1853,6 @@ public void writeObjectExceptionTest() throws Exception {
                     .setObjectChecksums(ObjectChecksums.newBuilder().build())
                     .setFinishWrite(true)
                     .setCommonObjectRequestParams(CommonObjectRequestParams.newBuilder().build())
        -            .setCommonRequestParams(CommonRequestParams.newBuilder().build())
                     .build();
         
             MockStreamObserver responseObserver = new MockStreamObserver<>();
        @@ -1926,7 +1986,7 @@ public void rewriteObjectTest() throws Exception {
                     .setSourceObject("sourceObject1196439354")
                     .setSourceGeneration(1232209852)
                     .setRewriteToken("rewriteToken80654285")
        -            .setDestinationPredefinedAcl(PredefinedObjectAcl.forNumber(0))
        +            .setDestinationPredefinedAcl("destinationPredefinedAcl1111125814")
                     .setIfGenerationMatch(-1086241088)
                     .setIfGenerationNotMatch(1475720404)
                     .setIfMetagenerationMatch(1043427781)
        @@ -1940,7 +2000,7 @@ public void rewriteObjectTest() throws Exception {
                     .setCopySourceEncryptionKeyBytes(ByteString.EMPTY)
                     .setCopySourceEncryptionKeySha256Bytes(ByteString.EMPTY)
                     .setCommonObjectRequestParams(CommonObjectRequestParams.newBuilder().build())
        -            .setCommonRequestParams(CommonRequestParams.newBuilder().build())
        +            .setObjectChecksums(ObjectChecksums.newBuilder().build())
                     .build();
         
             RewriteResponse actualResponse = client.rewriteObject(request);
        @@ -1987,7 +2047,7 @@ public void rewriteObjectTest() throws Exception {
                 actualRequest.getCopySourceEncryptionKeySha256Bytes());
             Assert.assertEquals(
                 request.getCommonObjectRequestParams(), actualRequest.getCommonObjectRequestParams());
        -    Assert.assertEquals(request.getCommonRequestParams(), actualRequest.getCommonRequestParams());
        +    Assert.assertEquals(request.getObjectChecksums(), actualRequest.getObjectChecksums());
             Assert.assertTrue(
                 channelProvider.isHeaderSent(
                     ApiClientHeaderProvider.getDefaultApiClientHeaderKey(),
        @@ -2012,7 +2072,7 @@ public void rewriteObjectExceptionTest() throws Exception {
                       .setSourceObject("sourceObject1196439354")
                       .setSourceGeneration(1232209852)
                       .setRewriteToken("rewriteToken80654285")
        -              .setDestinationPredefinedAcl(PredefinedObjectAcl.forNumber(0))
        +              .setDestinationPredefinedAcl("destinationPredefinedAcl1111125814")
                       .setIfGenerationMatch(-1086241088)
                       .setIfGenerationNotMatch(1475720404)
                       .setIfMetagenerationMatch(1043427781)
        @@ -2026,7 +2086,7 @@ public void rewriteObjectExceptionTest() throws Exception {
                       .setCopySourceEncryptionKeyBytes(ByteString.EMPTY)
                       .setCopySourceEncryptionKeySha256Bytes(ByteString.EMPTY)
                       .setCommonObjectRequestParams(CommonObjectRequestParams.newBuilder().build())
        -              .setCommonRequestParams(CommonRequestParams.newBuilder().build())
        +              .setObjectChecksums(ObjectChecksums.newBuilder().build())
                       .build();
               client.rewriteObject(request);
               Assert.fail("No exception raised");
        @@ -2045,7 +2105,7 @@ public void startResumableWriteTest() throws Exception {
                 StartResumableWriteRequest.newBuilder()
                     .setWriteObjectSpec(WriteObjectSpec.newBuilder().build())
                     .setCommonObjectRequestParams(CommonObjectRequestParams.newBuilder().build())
        -            .setCommonRequestParams(CommonRequestParams.newBuilder().build())
        +            .setObjectChecksums(ObjectChecksums.newBuilder().build())
                     .build();
         
             StartResumableWriteResponse actualResponse = client.startResumableWrite(request);
        @@ -2058,7 +2118,7 @@ public void startResumableWriteTest() throws Exception {
             Assert.assertEquals(request.getWriteObjectSpec(), actualRequest.getWriteObjectSpec());
             Assert.assertEquals(
                 request.getCommonObjectRequestParams(), actualRequest.getCommonObjectRequestParams());
        -    Assert.assertEquals(request.getCommonRequestParams(), actualRequest.getCommonRequestParams());
        +    Assert.assertEquals(request.getObjectChecksums(), actualRequest.getObjectChecksums());
             Assert.assertTrue(
                 channelProvider.isHeaderSent(
                     ApiClientHeaderProvider.getDefaultApiClientHeaderKey(),
        @@ -2075,7 +2135,7 @@ public void startResumableWriteExceptionTest() throws Exception {
                   StartResumableWriteRequest.newBuilder()
                       .setWriteObjectSpec(WriteObjectSpec.newBuilder().build())
                       .setCommonObjectRequestParams(CommonObjectRequestParams.newBuilder().build())
        -              .setCommonRequestParams(CommonRequestParams.newBuilder().build())
        +              .setObjectChecksums(ObjectChecksums.newBuilder().build())
                       .build();
               client.startResumableWrite(request);
               Assert.fail("No exception raised");
        @@ -2360,6 +2420,7 @@ public void getHmacKeyTest() throws Exception {
                     .setState("state109757585")
                     .setCreateTime(Timestamp.newBuilder().build())
                     .setUpdateTime(Timestamp.newBuilder().build())
        +            .setEtag("etag3123477")
                     .build();
             mockStorage.addResponse(expectedResponse);
         
        @@ -2407,6 +2468,7 @@ public void getHmacKeyTest2() throws Exception {
                     .setState("state109757585")
                     .setCreateTime(Timestamp.newBuilder().build())
                     .setUpdateTime(Timestamp.newBuilder().build())
        +            .setEtag("etag3123477")
                     .build();
             mockStorage.addResponse(expectedResponse);
         
        @@ -2542,6 +2604,7 @@ public void updateHmacKeyTest() throws Exception {
                     .setState("state109757585")
                     .setCreateTime(Timestamp.newBuilder().build())
                     .setUpdateTime(Timestamp.newBuilder().build())
        +            .setEtag("etag3123477")
                     .build();
             mockStorage.addResponse(expectedResponse);
         
        diff --git a/test/integration/goldens/storage/src/com/google/storage/v2/StorageSettings.java b/test/integration/goldens/storage/src/com/google/storage/v2/StorageSettings.java
        index 786041781d..15e9e7d78c 100644
        --- a/test/integration/goldens/storage/src/com/google/storage/v2/StorageSettings.java
        +++ b/test/integration/goldens/storage/src/com/google/storage/v2/StorageSettings.java
        @@ -1,5 +1,5 @@
         /*
        - * Copyright 2022 Google LLC
        + * Copyright 2026 Google LLC
          *
          * Licensed under the Apache License, Version 2.0 (the "License");
          * you may not use this file except in compliance with the License.
        @@ -22,7 +22,6 @@
         import static com.google.storage.v2.StorageClient.ListObjectsPagedResponse;
         
         import com.google.api.core.ApiFunction;
        -import com.google.api.core.BetaApi;
         import com.google.api.gax.core.GoogleCredentialsProvider;
         import com.google.api.gax.core.InstantiatingExecutorProvider;
         import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider;
        @@ -61,7 +60,9 @@
          * 

        The builder of this class is recursive, so contained classes are themselves builders. When * build() is called, the tree of builders is called to create the complete settings object. * - *

        For example, to set the total timeout of deleteBucket to 30 seconds: + *

        For example, to set the + * [RetrySettings](https://cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.retrying.RetrySettings) + * of deleteBucket: * *

        {@code
          * // This snippet has been automatically generated and should be regarded as a code template only.
        @@ -77,10 +78,21 @@
          *             .deleteBucketSettings()
          *             .getRetrySettings()
          *             .toBuilder()
        - *             .setTotalTimeout(Duration.ofSeconds(30))
        + *             .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());
          * StorageSettings storageSettings = storageSettingsBuilder.build();
          * }
        + * + * Please refer to the [Client Side Retry + * Guide](https://docs.cloud.google.com/java/docs/client-retries) for additional support in setting + * retries. */ @Generated("by gapic-generator-java") public class StorageSettings extends ClientSettings { @@ -165,6 +177,12 @@ public UnaryCallSettings deleteObjectSettings() { return ((StorageStubSettings) getStubSettings()).deleteObjectSettings(); } + /** Returns the object with the settings used for calls to cancelResumableWrite. */ + public UnaryCallSettings + cancelResumableWriteSettings() { + return ((StorageStubSettings) getStubSettings()).cancelResumableWriteSettings(); + } + /** Returns the object with the settings used for calls to getObject. */ public UnaryCallSettings getObjectSettings() { return ((StorageStubSettings) getStubSettings()).getObjectSettings(); @@ -272,7 +290,6 @@ public static TransportChannelProvider defaultTransportChannelProvider() { return StorageStubSettings.defaultTransportChannelProvider(); } - @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { return StorageStubSettings.defaultApiClientHeaderProviderBuilder(); } @@ -419,6 +436,12 @@ public UnaryCallSettings.Builder deleteObjectSetting return getStubSettingsBuilder().deleteObjectSettings(); } + /** Returns the builder for the settings used for calls to cancelResumableWrite. */ + public UnaryCallSettings.Builder + cancelResumableWriteSettings() { + return getStubSettingsBuilder().cancelResumableWriteSettings(); + } + /** Returns the builder for the settings used for calls to getObject. */ public UnaryCallSettings.Builder getObjectSettings() { return getStubSettingsBuilder().getObjectSettings(); diff --git a/test/integration/goldens/storage/src/com/google/storage/v2/gapic_metadata.json b/test/integration/goldens/storage/src/com/google/storage/v2/gapic_metadata.json index 5d16f3131d..9442f71159 100644 --- a/test/integration/goldens/storage/src/com/google/storage/v2/gapic_metadata.json +++ b/test/integration/goldens/storage/src/com/google/storage/v2/gapic_metadata.json @@ -10,6 +10,9 @@ "grpc": { "libraryClient": "StorageClient", "rpcs": { + "CancelResumableWrite": { + "methods": ["cancelResumableWrite", "cancelResumableWrite", "cancelResumableWriteCallable"] + }, "ComposeObject": { "methods": ["composeObject", "composeObjectCallable"] }, diff --git a/test/integration/goldens/storage/src/com/google/storage/v2/package-info.java b/test/integration/goldens/storage/src/com/google/storage/v2/package-info.java index 5f909765e1..a4ed7d429d 100644 --- a/test/integration/goldens/storage/src/com/google/storage/v2/package-info.java +++ b/test/integration/goldens/storage/src/com/google/storage/v2/package-info.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/storage/src/com/google/storage/v2/stub/GrpcStorageCallableFactory.java b/test/integration/goldens/storage/src/com/google/storage/v2/stub/GrpcStorageCallableFactory.java index ee3ea61d31..272e2c8c22 100644 --- a/test/integration/goldens/storage/src/com/google/storage/v2/stub/GrpcStorageCallableFactory.java +++ b/test/integration/goldens/storage/src/com/google/storage/v2/stub/GrpcStorageCallableFactory.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/integration/goldens/storage/src/com/google/storage/v2/stub/GrpcStorageStub.java b/test/integration/goldens/storage/src/com/google/storage/v2/stub/GrpcStorageStub.java index 2239a2ae91..5335577783 100644 --- a/test/integration/goldens/storage/src/com/google/storage/v2/stub/GrpcStorageStub.java +++ b/test/integration/goldens/storage/src/com/google/storage/v2/stub/GrpcStorageStub.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -27,8 +27,10 @@ import com.google.api.gax.grpc.GrpcStubCallableFactory; import com.google.api.gax.rpc.ClientContext; import com.google.api.gax.rpc.ClientStreamingCallable; +import com.google.api.gax.rpc.RequestParamsBuilder; import com.google.api.gax.rpc.ServerStreamingCallable; import com.google.api.gax.rpc.UnaryCallable; +import com.google.api.pathtemplate.PathTemplate; import com.google.iam.v1.GetIamPolicyRequest; import com.google.iam.v1.Policy; import com.google.iam.v1.SetIamPolicyRequest; @@ -37,6 +39,8 @@ import com.google.longrunning.stub.GrpcOperationsStub; import com.google.protobuf.Empty; import com.google.storage.v2.Bucket; +import com.google.storage.v2.CancelResumableWriteRequest; +import com.google.storage.v2.CancelResumableWriteResponse; import com.google.storage.v2.ComposeObjectRequest; import com.google.storage.v2.CreateBucketRequest; import com.google.storage.v2.CreateHmacKeyRequest; @@ -80,6 +84,7 @@ import io.grpc.MethodDescriptor; import io.grpc.protobuf.ProtoUtils; import java.io.IOException; +import java.util.Map; import java.util.concurrent.TimeUnit; import javax.annotation.Generated; @@ -97,6 +102,7 @@ public class GrpcStorageStub extends StorageStub { .setFullMethodName("google.storage.v2.Storage/DeleteBucket") .setRequestMarshaller(ProtoUtils.marshaller(DeleteBucketRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(Empty.getDefaultInstance())) + .setSampledToLocalTracing(true) .build(); private static final MethodDescriptor getBucketMethodDescriptor = @@ -105,6 +111,7 @@ public class GrpcStorageStub extends StorageStub { .setFullMethodName("google.storage.v2.Storage/GetBucket") .setRequestMarshaller(ProtoUtils.marshaller(GetBucketRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(Bucket.getDefaultInstance())) + .setSampledToLocalTracing(true) .build(); private static final MethodDescriptor createBucketMethodDescriptor = @@ -113,6 +120,7 @@ public class GrpcStorageStub extends StorageStub { .setFullMethodName("google.storage.v2.Storage/CreateBucket") .setRequestMarshaller(ProtoUtils.marshaller(CreateBucketRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(Bucket.getDefaultInstance())) + .setSampledToLocalTracing(true) .build(); private static final MethodDescriptor @@ -123,6 +131,7 @@ public class GrpcStorageStub extends StorageStub { .setRequestMarshaller(ProtoUtils.marshaller(ListBucketsRequest.getDefaultInstance())) .setResponseMarshaller( ProtoUtils.marshaller(ListBucketsResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) .build(); private static final MethodDescriptor @@ -133,6 +142,7 @@ public class GrpcStorageStub extends StorageStub { .setRequestMarshaller( ProtoUtils.marshaller(LockBucketRetentionPolicyRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(Bucket.getDefaultInstance())) + .setSampledToLocalTracing(true) .build(); private static final MethodDescriptor getIamPolicyMethodDescriptor = @@ -141,6 +151,7 @@ public class GrpcStorageStub extends StorageStub { .setFullMethodName("google.storage.v2.Storage/GetIamPolicy") .setRequestMarshaller(ProtoUtils.marshaller(GetIamPolicyRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(Policy.getDefaultInstance())) + .setSampledToLocalTracing(true) .build(); private static final MethodDescriptor setIamPolicyMethodDescriptor = @@ -149,6 +160,7 @@ public class GrpcStorageStub extends StorageStub { .setFullMethodName("google.storage.v2.Storage/SetIamPolicy") .setRequestMarshaller(ProtoUtils.marshaller(SetIamPolicyRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(Policy.getDefaultInstance())) + .setSampledToLocalTracing(true) .build(); private static final MethodDescriptor @@ -160,6 +172,7 @@ public class GrpcStorageStub extends StorageStub { ProtoUtils.marshaller(TestIamPermissionsRequest.getDefaultInstance())) .setResponseMarshaller( ProtoUtils.marshaller(TestIamPermissionsResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) .build(); private static final MethodDescriptor updateBucketMethodDescriptor = @@ -168,6 +181,7 @@ public class GrpcStorageStub extends StorageStub { .setFullMethodName("google.storage.v2.Storage/UpdateBucket") .setRequestMarshaller(ProtoUtils.marshaller(UpdateBucketRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(Bucket.getDefaultInstance())) + .setSampledToLocalTracing(true) .build(); private static final MethodDescriptor @@ -178,6 +192,7 @@ public class GrpcStorageStub extends StorageStub { .setRequestMarshaller( ProtoUtils.marshaller(DeleteNotificationRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(Empty.getDefaultInstance())) + .setSampledToLocalTracing(true) .build(); private static final MethodDescriptor @@ -188,6 +203,7 @@ public class GrpcStorageStub extends StorageStub { .setRequestMarshaller( ProtoUtils.marshaller(GetNotificationRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(Notification.getDefaultInstance())) + .setSampledToLocalTracing(true) .build(); private static final MethodDescriptor @@ -198,6 +214,7 @@ public class GrpcStorageStub extends StorageStub { .setRequestMarshaller( ProtoUtils.marshaller(CreateNotificationRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(Notification.getDefaultInstance())) + .setSampledToLocalTracing(true) .build(); private static final MethodDescriptor @@ -209,6 +226,7 @@ public class GrpcStorageStub extends StorageStub { ProtoUtils.marshaller(ListNotificationsRequest.getDefaultInstance())) .setResponseMarshaller( ProtoUtils.marshaller(ListNotificationsResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) .build(); private static final MethodDescriptor @@ -219,6 +237,7 @@ public class GrpcStorageStub extends StorageStub { .setRequestMarshaller( ProtoUtils.marshaller(ComposeObjectRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(Object.getDefaultInstance())) + .setSampledToLocalTracing(true) .build(); private static final MethodDescriptor deleteObjectMethodDescriptor = @@ -227,14 +246,28 @@ public class GrpcStorageStub extends StorageStub { .setFullMethodName("google.storage.v2.Storage/DeleteObject") .setRequestMarshaller(ProtoUtils.marshaller(DeleteObjectRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(Empty.getDefaultInstance())) + .setSampledToLocalTracing(true) .build(); + private static final MethodDescriptor + cancelResumableWriteMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.storage.v2.Storage/CancelResumableWrite") + .setRequestMarshaller( + ProtoUtils.marshaller(CancelResumableWriteRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(CancelResumableWriteResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + private static final MethodDescriptor getObjectMethodDescriptor = MethodDescriptor.newBuilder() .setType(MethodDescriptor.MethodType.UNARY) .setFullMethodName("google.storage.v2.Storage/GetObject") .setRequestMarshaller(ProtoUtils.marshaller(GetObjectRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(Object.getDefaultInstance())) + .setSampledToLocalTracing(true) .build(); private static final MethodDescriptor @@ -244,6 +277,7 @@ public class GrpcStorageStub extends StorageStub { .setFullMethodName("google.storage.v2.Storage/ReadObject") .setRequestMarshaller(ProtoUtils.marshaller(ReadObjectRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(ReadObjectResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) .build(); private static final MethodDescriptor updateObjectMethodDescriptor = @@ -252,6 +286,7 @@ public class GrpcStorageStub extends StorageStub { .setFullMethodName("google.storage.v2.Storage/UpdateObject") .setRequestMarshaller(ProtoUtils.marshaller(UpdateObjectRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(Object.getDefaultInstance())) + .setSampledToLocalTracing(true) .build(); private static final MethodDescriptor @@ -262,6 +297,7 @@ public class GrpcStorageStub extends StorageStub { .setRequestMarshaller(ProtoUtils.marshaller(WriteObjectRequest.getDefaultInstance())) .setResponseMarshaller( ProtoUtils.marshaller(WriteObjectResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) .build(); private static final MethodDescriptor @@ -272,6 +308,7 @@ public class GrpcStorageStub extends StorageStub { .setRequestMarshaller(ProtoUtils.marshaller(ListObjectsRequest.getDefaultInstance())) .setResponseMarshaller( ProtoUtils.marshaller(ListObjectsResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) .build(); private static final MethodDescriptor @@ -282,6 +319,7 @@ public class GrpcStorageStub extends StorageStub { .setRequestMarshaller( ProtoUtils.marshaller(RewriteObjectRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(RewriteResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) .build(); private static final MethodDescriptor @@ -293,6 +331,7 @@ public class GrpcStorageStub extends StorageStub { ProtoUtils.marshaller(StartResumableWriteRequest.getDefaultInstance())) .setResponseMarshaller( ProtoUtils.marshaller(StartResumableWriteResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) .build(); private static final MethodDescriptor @@ -304,6 +343,7 @@ public class GrpcStorageStub extends StorageStub { ProtoUtils.marshaller(QueryWriteStatusRequest.getDefaultInstance())) .setResponseMarshaller( ProtoUtils.marshaller(QueryWriteStatusResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) .build(); private static final MethodDescriptor @@ -314,6 +354,7 @@ public class GrpcStorageStub extends StorageStub { .setRequestMarshaller( ProtoUtils.marshaller(GetServiceAccountRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(ServiceAccount.getDefaultInstance())) + .setSampledToLocalTracing(true) .build(); private static final MethodDescriptor @@ -325,6 +366,7 @@ public class GrpcStorageStub extends StorageStub { ProtoUtils.marshaller(CreateHmacKeyRequest.getDefaultInstance())) .setResponseMarshaller( ProtoUtils.marshaller(CreateHmacKeyResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) .build(); private static final MethodDescriptor deleteHmacKeyMethodDescriptor = @@ -333,6 +375,7 @@ public class GrpcStorageStub extends StorageStub { .setFullMethodName("google.storage.v2.Storage/DeleteHmacKey") .setRequestMarshaller(ProtoUtils.marshaller(DeleteHmacKeyRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(Empty.getDefaultInstance())) + .setSampledToLocalTracing(true) .build(); private static final MethodDescriptor @@ -342,6 +385,7 @@ public class GrpcStorageStub extends StorageStub { .setFullMethodName("google.storage.v2.Storage/GetHmacKey") .setRequestMarshaller(ProtoUtils.marshaller(GetHmacKeyRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(HmacKeyMetadata.getDefaultInstance())) + .setSampledToLocalTracing(true) .build(); private static final MethodDescriptor @@ -352,6 +396,7 @@ public class GrpcStorageStub extends StorageStub { .setRequestMarshaller(ProtoUtils.marshaller(ListHmacKeysRequest.getDefaultInstance())) .setResponseMarshaller( ProtoUtils.marshaller(ListHmacKeysResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) .build(); private static final MethodDescriptor @@ -362,6 +407,7 @@ public class GrpcStorageStub extends StorageStub { .setRequestMarshaller( ProtoUtils.marshaller(UpdateHmacKeyRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(HmacKeyMetadata.getDefaultInstance())) + .setSampledToLocalTracing(true) .build(); private final UnaryCallable deleteBucketCallable; @@ -386,6 +432,8 @@ public class GrpcStorageStub extends StorageStub { listNotificationsPagedCallable; private final UnaryCallable composeObjectCallable; private final UnaryCallable deleteObjectCallable; + private final UnaryCallable + cancelResumableWriteCallable; private final UnaryCallable getObjectCallable; private final ServerStreamingCallable readObjectCallable; private final UnaryCallable updateObjectCallable; @@ -412,6 +460,71 @@ public class GrpcStorageStub extends StorageStub { private final GrpcOperationsStub operationsStub; private final GrpcStubCallableFactory callableFactory; + private static final PathTemplate DELETE_BUCKET_0_PATH_TEMPLATE = + PathTemplate.create("{bucket=**}"); + private static final PathTemplate GET_BUCKET_0_PATH_TEMPLATE = PathTemplate.create("{bucket=**}"); + private static final PathTemplate CREATE_BUCKET_0_PATH_TEMPLATE = + PathTemplate.create("{project=**}"); + private static final PathTemplate LIST_BUCKETS_0_PATH_TEMPLATE = + PathTemplate.create("{project=**}"); + private static final PathTemplate LOCK_BUCKET_RETENTION_POLICY_0_PATH_TEMPLATE = + PathTemplate.create("{bucket=**}"); + private static final PathTemplate GET_IAM_POLICY_0_PATH_TEMPLATE = + PathTemplate.create("{bucket=**}"); + private static final PathTemplate GET_IAM_POLICY_1_PATH_TEMPLATE = + PathTemplate.create("{bucket=projects/*/buckets/*}/objects/**"); + private static final PathTemplate SET_IAM_POLICY_0_PATH_TEMPLATE = + PathTemplate.create("{bucket=**}"); + private static final PathTemplate SET_IAM_POLICY_1_PATH_TEMPLATE = + PathTemplate.create("{bucket=projects/*/buckets/*}/objects/**"); + private static final PathTemplate TEST_IAM_PERMISSIONS_0_PATH_TEMPLATE = + PathTemplate.create("{bucket=**}"); + private static final PathTemplate TEST_IAM_PERMISSIONS_1_PATH_TEMPLATE = + PathTemplate.create("{bucket=projects/*/buckets/*}/objects/**"); + private static final PathTemplate UPDATE_BUCKET_0_PATH_TEMPLATE = + PathTemplate.create("{bucket=**}"); + private static final PathTemplate DELETE_NOTIFICATION_0_PATH_TEMPLATE = + PathTemplate.create("{bucket=projects/*/buckets/*}/**"); + private static final PathTemplate GET_NOTIFICATION_0_PATH_TEMPLATE = + PathTemplate.create("{bucket=projects/*/buckets/*}/**"); + private static final PathTemplate CREATE_NOTIFICATION_0_PATH_TEMPLATE = + PathTemplate.create("{bucket=**}"); + private static final PathTemplate LIST_NOTIFICATIONS_0_PATH_TEMPLATE = + PathTemplate.create("{bucket=**}"); + private static final PathTemplate COMPOSE_OBJECT_0_PATH_TEMPLATE = + PathTemplate.create("{bucket=**}"); + private static final PathTemplate DELETE_OBJECT_0_PATH_TEMPLATE = + PathTemplate.create("{bucket=**}"); + private static final PathTemplate CANCEL_RESUMABLE_WRITE_0_PATH_TEMPLATE = + PathTemplate.create("{bucket=projects/*/buckets/*}/**"); + private static final PathTemplate GET_OBJECT_0_PATH_TEMPLATE = PathTemplate.create("{bucket=**}"); + private static final PathTemplate READ_OBJECT_0_PATH_TEMPLATE = + PathTemplate.create("{bucket=**}"); + private static final PathTemplate UPDATE_OBJECT_0_PATH_TEMPLATE = + PathTemplate.create("{bucket=**}"); + private static final PathTemplate LIST_OBJECTS_0_PATH_TEMPLATE = + PathTemplate.create("{bucket=**}"); + private static final PathTemplate REWRITE_OBJECT_0_PATH_TEMPLATE = + PathTemplate.create("{source_bucket=**}"); + private static final PathTemplate REWRITE_OBJECT_1_PATH_TEMPLATE = + PathTemplate.create("{bucket=**}"); + private static final PathTemplate START_RESUMABLE_WRITE_0_PATH_TEMPLATE = + PathTemplate.create("{bucket=**}"); + private static final PathTemplate QUERY_WRITE_STATUS_0_PATH_TEMPLATE = + PathTemplate.create("{bucket=projects/*/buckets/*}/**"); + private static final PathTemplate GET_SERVICE_ACCOUNT_0_PATH_TEMPLATE = + PathTemplate.create("{project=**}"); + private static final PathTemplate CREATE_HMAC_KEY_0_PATH_TEMPLATE = + PathTemplate.create("{project=**}"); + private static final PathTemplate DELETE_HMAC_KEY_0_PATH_TEMPLATE = + PathTemplate.create("{project=**}"); + private static final PathTemplate GET_HMAC_KEY_0_PATH_TEMPLATE = + PathTemplate.create("{project=**}"); + private static final PathTemplate LIST_HMAC_KEYS_0_PATH_TEMPLATE = + PathTemplate.create("{project=**}"); + private static final PathTemplate UPDATE_HMAC_KEY_0_PATH_TEMPLATE = + PathTemplate.create("{project=**}"); + public static final GrpcStorageStub create(StorageStubSettings settings) throws IOException { return new GrpcStorageStub(settings, ClientContext.create(settings)); } @@ -450,77 +563,230 @@ protected GrpcStorageStub( GrpcCallSettings deleteBucketTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(deleteBucketMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add(request.getName(), "bucket", DELETE_BUCKET_0_PATH_TEMPLATE); + return builder.build(); + }) + .setResourceNameExtractor(request -> request.getName()) .build(); GrpcCallSettings getBucketTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(getBucketMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add(request.getName(), "bucket", GET_BUCKET_0_PATH_TEMPLATE); + return builder.build(); + }) + .setResourceNameExtractor(request -> request.getName()) .build(); GrpcCallSettings createBucketTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(createBucketMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add(request.getParent(), "project", CREATE_BUCKET_0_PATH_TEMPLATE); + return builder.build(); + }) + .setResourceNameExtractor(request -> request.getParent()) .build(); GrpcCallSettings listBucketsTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(listBucketsMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add(request.getParent(), "project", LIST_BUCKETS_0_PATH_TEMPLATE); + return builder.build(); + }) + .setResourceNameExtractor(request -> request.getParent()) .build(); GrpcCallSettings lockBucketRetentionPolicyTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(lockBucketRetentionPolicyMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add( + request.getBucket(), + "bucket", + LOCK_BUCKET_RETENTION_POLICY_0_PATH_TEMPLATE); + return builder.build(); + }) + .setResourceNameExtractor(request -> request.getBucket()) .build(); GrpcCallSettings getIamPolicyTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(getIamPolicyMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add(request.getResource(), "bucket", GET_IAM_POLICY_0_PATH_TEMPLATE); + builder.add(request.getResource(), "bucket", GET_IAM_POLICY_1_PATH_TEMPLATE); + return builder.build(); + }) + .setResourceNameExtractor(request -> request.getResource()) .build(); GrpcCallSettings setIamPolicyTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(setIamPolicyMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add(request.getResource(), "bucket", SET_IAM_POLICY_0_PATH_TEMPLATE); + builder.add(request.getResource(), "bucket", SET_IAM_POLICY_1_PATH_TEMPLATE); + return builder.build(); + }) + .setResourceNameExtractor(request -> request.getResource()) .build(); GrpcCallSettings testIamPermissionsTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(testIamPermissionsMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add( + request.getResource(), "bucket", TEST_IAM_PERMISSIONS_0_PATH_TEMPLATE); + builder.add( + request.getResource(), "bucket", TEST_IAM_PERMISSIONS_1_PATH_TEMPLATE); + return builder.build(); + }) + .setResourceNameExtractor(request -> request.getResource()) .build(); GrpcCallSettings updateBucketTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(updateBucketMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + if (request.getBucket() != null) { + builder.add( + request.getBucket().getName(), "bucket", UPDATE_BUCKET_0_PATH_TEMPLATE); + } + return builder.build(); + }) .build(); GrpcCallSettings deleteNotificationTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(deleteNotificationMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add(request.getName(), "bucket", DELETE_NOTIFICATION_0_PATH_TEMPLATE); + return builder.build(); + }) + .setResourceNameExtractor(request -> request.getName()) .build(); GrpcCallSettings getNotificationTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(getNotificationMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add(request.getName(), "bucket", GET_NOTIFICATION_0_PATH_TEMPLATE); + return builder.build(); + }) + .setResourceNameExtractor(request -> request.getName()) .build(); GrpcCallSettings createNotificationTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(createNotificationMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add(request.getParent(), "bucket", CREATE_NOTIFICATION_0_PATH_TEMPLATE); + return builder.build(); + }) + .setResourceNameExtractor(request -> request.getParent()) .build(); GrpcCallSettings listNotificationsTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(listNotificationsMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add( + request.getParent(), "bucket", LIST_NOTIFICATIONS_0_PATH_TEMPLATE); + return builder.build(); + }) + .setResourceNameExtractor(request -> request.getParent()) .build(); GrpcCallSettings composeObjectTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(composeObjectMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + if (request.getDestination() != null) { + builder.add( + request.getDestination().getBucket(), + "bucket", + COMPOSE_OBJECT_0_PATH_TEMPLATE); + } + return builder.build(); + }) + .setResourceNameExtractor(request -> request.getKmsKey()) .build(); GrpcCallSettings deleteObjectTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(deleteObjectMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add(request.getBucket(), "bucket", DELETE_OBJECT_0_PATH_TEMPLATE); + return builder.build(); + }) .build(); + GrpcCallSettings + cancelResumableWriteTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(cancelResumableWriteMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add( + request.getUploadId(), "bucket", CANCEL_RESUMABLE_WRITE_0_PATH_TEMPLATE); + return builder.build(); + }) + .build(); GrpcCallSettings getObjectTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(getObjectMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add(request.getBucket(), "bucket", GET_OBJECT_0_PATH_TEMPLATE); + return builder.build(); + }) .build(); GrpcCallSettings readObjectTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(readObjectMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add(request.getBucket(), "bucket", READ_OBJECT_0_PATH_TEMPLATE); + return builder.build(); + }) .build(); GrpcCallSettings updateObjectTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(updateObjectMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + if (request.getObject() != null) { + builder.add( + request.getObject().getBucket(), "bucket", UPDATE_OBJECT_0_PATH_TEMPLATE); + } + return builder.build(); + }) .build(); GrpcCallSettings writeObjectTransportSettings = GrpcCallSettings.newBuilder() @@ -529,44 +795,126 @@ protected GrpcStorageStub( GrpcCallSettings listObjectsTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(listObjectsMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add(request.getParent(), "bucket", LIST_OBJECTS_0_PATH_TEMPLATE); + return builder.build(); + }) + .setResourceNameExtractor(request -> request.getParent()) .build(); GrpcCallSettings rewriteObjectTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(rewriteObjectMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add( + request.getSourceBucket(), "source_bucket", REWRITE_OBJECT_0_PATH_TEMPLATE); + builder.add( + request.getDestinationBucket(), "bucket", REWRITE_OBJECT_1_PATH_TEMPLATE); + return builder.build(); + }) + .setResourceNameExtractor(request -> request.getDestinationBucket()) .build(); GrpcCallSettings startResumableWriteTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(startResumableWriteMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + if (request.getWriteObjectSpec() != null + && request.getWriteObjectSpec().getResource() != null) { + builder.add( + request.getWriteObjectSpec().getResource().getBucket(), + "bucket", + START_RESUMABLE_WRITE_0_PATH_TEMPLATE); + } + return builder.build(); + }) .build(); GrpcCallSettings queryWriteStatusTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(queryWriteStatusMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add( + request.getUploadId(), "bucket", QUERY_WRITE_STATUS_0_PATH_TEMPLATE); + return builder.build(); + }) .build(); GrpcCallSettings getServiceAccountTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(getServiceAccountMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add(request.getProject(), "project", GET_SERVICE_ACCOUNT_0_PATH_TEMPLATE); + return builder.build(); + }) + .setResourceNameExtractor(request -> request.getProject()) .build(); GrpcCallSettings createHmacKeyTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(createHmacKeyMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add(request.getProject(), "project", CREATE_HMAC_KEY_0_PATH_TEMPLATE); + return builder.build(); + }) + .setResourceNameExtractor(request -> request.getProject()) .build(); GrpcCallSettings deleteHmacKeyTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(deleteHmacKeyMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add(request.getProject(), "project", DELETE_HMAC_KEY_0_PATH_TEMPLATE); + return builder.build(); + }) + .setResourceNameExtractor(request -> request.getProject()) .build(); GrpcCallSettings getHmacKeyTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(getHmacKeyMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add(request.getProject(), "project", GET_HMAC_KEY_0_PATH_TEMPLATE); + return builder.build(); + }) + .setResourceNameExtractor(request -> request.getProject()) .build(); GrpcCallSettings listHmacKeysTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(listHmacKeysMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add(request.getProject(), "project", LIST_HMAC_KEYS_0_PATH_TEMPLATE); + return builder.build(); + }) + .setResourceNameExtractor(request -> request.getProject()) .build(); GrpcCallSettings updateHmacKeyTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(updateHmacKeyMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + if (request.getHmacKey() != null) { + builder.add( + request.getHmacKey().getProject(), + "project", + UPDATE_HMAC_KEY_0_PATH_TEMPLATE); + } + return builder.build(); + }) .build(); this.deleteBucketCallable = @@ -632,6 +980,11 @@ protected GrpcStorageStub( this.deleteObjectCallable = callableFactory.createUnaryCallable( deleteObjectTransportSettings, settings.deleteObjectSettings(), clientContext); + this.cancelResumableWriteCallable = + callableFactory.createUnaryCallable( + cancelResumableWriteTransportSettings, + settings.cancelResumableWriteSettings(), + clientContext); this.getObjectCallable = callableFactory.createUnaryCallable( getObjectTransportSettings, settings.getObjectSettings(), clientContext); @@ -782,6 +1135,12 @@ public UnaryCallable deleteObjectCallable() { return deleteObjectCallable; } + @Override + public UnaryCallable + cancelResumableWriteCallable() { + return cancelResumableWriteCallable; + } + @Override public UnaryCallable getObjectCallable() { return getObjectCallable; diff --git a/test/integration/goldens/storage/src/com/google/storage/v2/stub/StorageStub.java b/test/integration/goldens/storage/src/com/google/storage/v2/stub/StorageStub.java index 04ac9d3ba2..f02424e45e 100644 --- a/test/integration/goldens/storage/src/com/google/storage/v2/stub/StorageStub.java +++ b/test/integration/goldens/storage/src/com/google/storage/v2/stub/StorageStub.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -32,6 +32,8 @@ import com.google.iam.v1.TestIamPermissionsResponse; import com.google.protobuf.Empty; import com.google.storage.v2.Bucket; +import com.google.storage.v2.CancelResumableWriteRequest; +import com.google.storage.v2.CancelResumableWriteResponse; import com.google.storage.v2.ComposeObjectRequest; import com.google.storage.v2.CreateBucketRequest; import com.google.storage.v2.CreateHmacKeyRequest; @@ -155,6 +157,11 @@ public UnaryCallable deleteObjectCallable() { throw new UnsupportedOperationException("Not implemented: deleteObjectCallable()"); } + public UnaryCallable + cancelResumableWriteCallable() { + throw new UnsupportedOperationException("Not implemented: cancelResumableWriteCallable()"); + } + public UnaryCallable getObjectCallable() { throw new UnsupportedOperationException("Not implemented: getObjectCallable()"); } diff --git a/test/integration/goldens/storage/src/com/google/storage/v2/stub/StorageStubSettings.java b/test/integration/goldens/storage/src/com/google/storage/v2/stub/StorageStubSettings.java index f8e9964ea2..2ffbba4bc9 100644 --- a/test/integration/goldens/storage/src/com/google/storage/v2/stub/StorageStubSettings.java +++ b/test/integration/goldens/storage/src/com/google/storage/v2/stub/StorageStubSettings.java @@ -1,5 +1,5 @@ /* - * Copyright 2022 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -23,7 +23,7 @@ import com.google.api.core.ApiFunction; import com.google.api.core.ApiFuture; -import com.google.api.core.BetaApi; +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; @@ -34,6 +34,7 @@ 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.LibraryMetadata; import com.google.api.gax.rpc.PageContext; import com.google.api.gax.rpc.PagedCallSettings; import com.google.api.gax.rpc.PagedListDescriptor; @@ -56,6 +57,8 @@ import com.google.iam.v1.TestIamPermissionsResponse; import com.google.protobuf.Empty; import com.google.storage.v2.Bucket; +import com.google.storage.v2.CancelResumableWriteRequest; +import com.google.storage.v2.CancelResumableWriteResponse; import com.google.storage.v2.ComposeObjectRequest; import com.google.storage.v2.CreateBucketRequest; import com.google.storage.v2.CreateHmacKeyRequest; @@ -97,9 +100,9 @@ import com.google.storage.v2.WriteObjectRequest; import com.google.storage.v2.WriteObjectResponse; import java.io.IOException; +import java.time.Duration; import java.util.List; import javax.annotation.Generated; -import org.threeten.bp.Duration; // AUTO-GENERATED DOCUMENTATION AND CLASS. /** @@ -116,7 +119,9 @@ *

        The builder of this class is recursive, so contained classes are themselves builders. When * build() is called, the tree of builders is called to create the complete settings object. * - *

        For example, to set the total timeout of deleteBucket to 30 seconds: + *

        For example, to set the + * [RetrySettings](https://cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.retrying.RetrySettings) + * of deleteBucket: * *

        {@code
          * // This snippet has been automatically generated and should be regarded as a code template only.
        @@ -132,12 +137,24 @@
          *             .deleteBucketSettings()
          *             .getRetrySettings()
          *             .toBuilder()
        - *             .setTotalTimeout(Duration.ofSeconds(30))
        + *             .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());
          * StorageStubSettings storageSettings = storageSettingsBuilder.build();
          * }
        + * + * Please refer to the [Client Side Retry + * Guide](https://docs.cloud.google.com/java/docs/client-retries) for additional support in setting + * retries. */ @Generated("by gapic-generator-java") +@SuppressWarnings("CanonicalDuration") public class StorageStubSettings extends StubSettings { /** The default scopes of the service. */ private static final ImmutableList DEFAULT_SERVICE_SCOPES = @@ -170,6 +187,8 @@ public class StorageStubSettings extends StubSettings { listNotificationsSettings; private final UnaryCallSettings composeObjectSettings; private final UnaryCallSettings deleteObjectSettings; + private final UnaryCallSettings + cancelResumableWriteSettings; private final UnaryCallSettings getObjectSettings; private final ServerStreamingCallSettings readObjectSettings; @@ -223,9 +242,7 @@ public String extractNextToken(ListBucketsResponse payload) { @Override public Iterable extractResources(ListBucketsResponse payload) { - return payload.getBucketsList() == null - ? ImmutableList.of() - : payload.getBucketsList(); + return payload.getBucketsList(); } }; @@ -263,9 +280,7 @@ public String extractNextToken(ListNotificationsResponse payload) { @Override public Iterable extractResources(ListNotificationsResponse payload) { - return payload.getNotificationsList() == null - ? ImmutableList.of() - : payload.getNotificationsList(); + return payload.getNotificationsList(); } }; @@ -299,9 +314,7 @@ public String extractNextToken(ListObjectsResponse payload) { @Override public Iterable extractResources(ListObjectsResponse payload) { - return payload.getObjectsList() == null - ? ImmutableList.of() - : payload.getObjectsList(); + return payload.getObjectsList(); } }; @@ -336,9 +349,7 @@ public String extractNextToken(ListHmacKeysResponse payload) { @Override public Iterable extractResources(ListHmacKeysResponse payload) { - return payload.getHmacKeysList() == null - ? ImmutableList.of() - : payload.getHmacKeysList(); + return payload.getHmacKeysList(); } }; @@ -494,6 +505,12 @@ public UnaryCallSettings deleteObjectSettings() { return deleteObjectSettings; } + /** Returns the object with the settings used for calls to cancelResumableWrite. */ + public UnaryCallSettings + cancelResumableWriteSettings() { + return cancelResumableWriteSettings; + } + /** Returns the object with the settings used for calls to getObject. */ public UnaryCallSettings getObjectSettings() { return getObjectSettings; @@ -579,12 +596,19 @@ public StorageStub createStub() throws IOException { "Transport not supported: %s", getTransportChannelProvider().getTransportName())); } + /** Returns the default service name. */ + @Override + public String getServiceName() { + return "storage"; + } + /** 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 "storage.googleapis.com:443"; } @@ -616,7 +640,6 @@ public static TransportChannelProvider defaultTransportChannelProvider() { return defaultGrpcTransportProviderBuilder().build(); } - @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { return ApiClientHeaderProvider.newBuilder() .setGeneratedLibToken("gapic", GaxProperties.getLibraryVersion(StorageStubSettings.class)) @@ -657,6 +680,7 @@ protected StorageStubSettings(Builder settingsBuilder) throws IOException { listNotificationsSettings = settingsBuilder.listNotificationsSettings().build(); composeObjectSettings = settingsBuilder.composeObjectSettings().build(); deleteObjectSettings = settingsBuilder.deleteObjectSettings().build(); + cancelResumableWriteSettings = settingsBuilder.cancelResumableWriteSettings().build(); getObjectSettings = settingsBuilder.getObjectSettings().build(); readObjectSettings = settingsBuilder.readObjectSettings().build(); updateObjectSettings = settingsBuilder.updateObjectSettings().build(); @@ -673,6 +697,11 @@ protected StorageStubSettings(Builder settingsBuilder) throws IOException { updateHmacKeySettings = settingsBuilder.updateHmacKeySettings().build(); } + @Override + protected LibraryMetadata getLibraryMetadata() { + return LibraryMetadata.newBuilder().setVersion(Version.VERSION).build(); + } + /** Builder for StorageStubSettings. */ public static class Builder extends StubSettings.Builder { private final ImmutableList> unaryMethodSettingsBuilders; @@ -700,6 +729,9 @@ public static class Builder extends StubSettings.Builder composeObjectSettings; private final UnaryCallSettings.Builder deleteObjectSettings; + private final UnaryCallSettings.Builder< + CancelResumableWriteRequest, CancelResumableWriteResponse> + cancelResumableWriteSettings; private final UnaryCallSettings.Builder getObjectSettings; private final ServerStreamingCallSettings.Builder readObjectSettings; @@ -747,13 +779,13 @@ public static class Builder extends StubSettings.Builder deleteObjectSetting return deleteObjectSettings; } + /** Returns the builder for the settings used for calls to cancelResumableWrite. */ + public UnaryCallSettings.Builder + cancelResumableWriteSettings() { + return cancelResumableWriteSettings; + } + /** Returns the builder for the settings used for calls to getObject. */ public UnaryCallSettings.Builder getObjectSettings() { return getObjectSettings; diff --git a/test/integration/goldens/storage/src/com/google/storage/v2/stub/Version.java b/test/integration/goldens/storage/src/com/google/storage/v2/stub/Version.java new file mode 100644 index 0000000000..54f11445df --- /dev/null +++ b/test/integration/goldens/storage/src/com/google/storage/v2/stub/Version.java @@ -0,0 +1,27 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.storage.v2.stub; + +import com.google.api.core.InternalApi; + +@InternalApi("For internal use only") +final class Version { + // {x-version-update-start:null:current} + static final String VERSION = "0.0.0-SNAPSHOT"; + // {x-version-update-end} + +} diff --git a/versions.txt b/versions.txt index b9064ef863..dba22421d0 100644 --- a/versions.txt +++ b/versions.txt @@ -1,17 +1,26 @@ # Format: # module:released-version:current-version -gapic-generator-java:2.12.0:2.12.1-SNAPSHOT -api-common:2.3.1:2.3.2-SNAPSHOT -gax:2.20.1:2.20.2-SNAPSHOT -gax-grpc:2.20.1:2.20.2-SNAPSHOT -gax-httpjson:0.105.1:0.105.2-SNAPSHOT -proto-google-common-protos:2.11.0:2.11.1-SNAPSHOT -grpc-google-common-protos:2.11.0:2.11.1-SNAPSHOT -proto-google-iam-v1:1.6.22:1.6.23-SNAPSHOT -grpc-google-iam-v1:1.6.22:1.6.23-SNAPSHOT -proto-google-iam-v2beta:1.6.22:1.6.23-SNAPSHOT -grpc-google-iam-v2beta:1.6.22:1.6.23-SNAPSHOT -google-iam-policy:1.6.22:1.6.23-SNAPSHOT -proto-google-iam-v2:1.6.22:1.6.23-SNAPSHOT -grpc-google-iam-v2:1.6.22:1.6.23-SNAPSHOT +gapic-generator-java:2.68.0:2.68.1-SNAPSHOT +api-common:2.59.0:2.59.1-SNAPSHOT +gax:2.76.0:2.76.1-SNAPSHOT +gax-grpc:2.76.0:2.76.1-SNAPSHOT +gax-httpjson:0.161.0:0.161.1-SNAPSHOT +proto-google-common-protos:2.67.0:2.67.1-SNAPSHOT +grpc-google-common-protos:2.67.0:2.67.1-SNAPSHOT +proto-google-iam-v1:1.62.0:1.62.1-SNAPSHOT +grpc-google-iam-v1:1.62.0:1.62.1-SNAPSHOT +proto-google-iam-v2beta:1.62.0:1.62.1-SNAPSHOT +grpc-google-iam-v2beta:1.62.0:1.62.1-SNAPSHOT +google-iam-policy:1.62.0:1.62.1-SNAPSHOT +proto-google-iam-v2:1.62.0:1.62.1-SNAPSHOT +grpc-google-iam-v2:1.62.0:1.62.1-SNAPSHOT +google-cloud-core:2.66.0:2.66.1-SNAPSHOT +google-cloud-shared-dependencies:3.58.0:3.58.1-SNAPSHOT +gapic-showcase:0.14.0:0.14.1-SNAPSHOT +proto-gapic-showcase-v1beta1:0.14.0:0.14.1-SNAPSHOT +grpc-gapic-showcase-v1beta1:0.14.0:0.14.1-SNAPSHOT +proto-google-iam-v3:1.62.0:1.62.1-SNAPSHOT +grpc-google-iam-v3:1.62.0:1.62.1-SNAPSHOT +proto-google-iam-v3beta:1.62.0:1.62.1-SNAPSHOT +grpc-google-iam-v3beta:1.62.0:1.62.1-SNAPSHOT